From 449e9a454d5cc160014f25077bfdf7cd04a411c4 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 20 Apr 2009 18:23:46 +0000 Subject: Bugfix 18558 In OSX, using spin/extrude etc. buttons, with more than 1 3d window open, should turn cursor in a Question Mark to indicate you have to tell which window to use (yes weak, but that's 2.4x!). OSX didn't support that type of cursor, so no hint happened. Now uses the 'hand' icon for osx... no nicer one is there afaik. --- source/blender/src/ghostwinlay.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/ghostwinlay.c b/source/blender/src/ghostwinlay.c index 9388ac93543..794ba0cf6e0 100644 --- a/source/blender/src/ghostwinlay.c +++ b/source/blender/src/ghostwinlay.c @@ -212,7 +212,12 @@ static GHOST_TStandardCursor convert_cursor(int curs) { case CURSOR_FACESEL: return GHOST_kStandardCursorRightArrow; case CURSOR_WAIT: return GHOST_kStandardCursorWait; case CURSOR_EDIT: return GHOST_kStandardCursorCrosshair; - case CURSOR_HELP: return GHOST_kStandardCursorHelp; + case CURSOR_HELP: +#ifdef __APPLE__ + return GHOST_kStandardCursorLeftRight; +#else + return GHOST_kStandardCursorHelp; +#endif case CURSOR_X_MOVE: return GHOST_kStandardCursorLeftRight; case CURSOR_Y_MOVE: return GHOST_kStandardCursorUpDown; case CURSOR_PENCIL: return GHOST_kStandardCursorPencil; -- cgit v1.2.3 From 6afaab654d6d9df31f6cb01e8e2c834ae79927fb Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Mon, 20 Apr 2009 18:31:48 +0000 Subject: Bugfix for [#18554] Time + Scale Node Crash --- source/blender/nodes/intern/CMP_nodes/CMP_scale.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_scale.c b/source/blender/nodes/intern/CMP_nodes/CMP_scale.c index cc6f9249495..ee3607c11f6 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_scale.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_scale.c @@ -65,8 +65,8 @@ static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, b newx = cbuf->x * (rd->size / 100.0f); newy = cbuf->y * (rd->size / 100.0f); } else { /* CMP_SCALE_ABSOLUTE */ - newx= (int)in[1]->vec[0]; - newy= (int)in[2]->vec[0]; + newx= MAX2((int)in[1]->vec[0], 1); + newy= MAX2((int)in[2]->vec[0], 1); } newx= MIN2(newx, CMP_SCALE_MAX); newy= MIN2(newy, CMP_SCALE_MAX); -- cgit v1.2.3 From 2d0d06f642b661b084657c05ebb0c664f998a937 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 20 Apr 2009 21:20:33 +0000 Subject: BGE VideoTexture: fix bug with VideoTexture.materialID() since recent commit. --- source/gameengine/VideoTexture/BlendType.h | 6 ++++-- source/gameengine/VideoTexture/Texture.cpp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/VideoTexture/BlendType.h b/source/gameengine/VideoTexture/BlendType.h index ac3ed8812a6..8b243c43912 100644 --- a/source/gameengine/VideoTexture/BlendType.h +++ b/source/gameengine/VideoTexture/BlendType.h @@ -25,6 +25,7 @@ http://www.gnu.org/copyleft/lesser.txt. /// class allows check type of blender python object and access its contained object +/// MUST ONLY BE USED FOR KX classes that are descendent of PyObjectPlus template class BlendType { public: @@ -48,8 +49,9 @@ public: // if pointer to type is set and don't match to type of provided object, return NULL else if (obj->ob_type != m_objType) return NULL; - // return pointer to object - return (PyObj*)obj; + // return pointer to object, this class can only be used for KX object => + // the Py object is actually a proxy + return (PyObj*)BGE_PROXY_REF(obj); } /// parse arguments to get object diff --git a/source/gameengine/VideoTexture/Texture.cpp b/source/gameengine/VideoTexture/Texture.cpp index 66c67023e38..fa941f9260e 100644 --- a/source/gameengine/VideoTexture/Texture.cpp +++ b/source/gameengine/VideoTexture/Texture.cpp @@ -163,7 +163,8 @@ void Texture_dealloc (Texture * self) // release renderer Py_XDECREF(self->m_source); // close texture - Texture_close(self); + PyObject* ret = Texture_close(self); + Py_DECREF(ret); // release scaled image buffer delete [] self->m_scaledImg; // release object -- cgit v1.2.3 From 217bbb7800679899302ddb058f9ceea1d00c7ce1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 20 Apr 2009 23:17:52 +0000 Subject: BGE Python API Separate getting a normal attribute and getting __dict__, was having to do too a check for __dict__ on each class (multiple times per getattro call from python) when its not used that often. --- source/gameengine/Converter/BL_ActionActuator.cpp | 4 ++ source/gameengine/Converter/BL_ActionActuator.h | 1 + .../Converter/BL_ShapeActionActuator.cpp | 4 ++ .../gameengine/Converter/BL_ShapeActionActuator.h | 1 + source/gameengine/Expressions/ListValue.cpp | 4 ++ source/gameengine/Expressions/ListValue.h | 1 + source/gameengine/Expressions/PyObjectPlus.cpp | 15 ++++-- source/gameengine/Expressions/PyObjectPlus.h | 11 ++-- source/gameengine/Expressions/Value.cpp | 4 ++ source/gameengine/Expressions/Value.h | 1 + .../gameengine/GameLogic/SCA_2DFilterActuator.cpp | 4 ++ source/gameengine/GameLogic/SCA_2DFilterActuator.h | 1 + source/gameengine/GameLogic/SCA_ANDController.cpp | 4 ++ source/gameengine/GameLogic/SCA_ANDController.h | 1 + source/gameengine/GameLogic/SCA_ActuatorSensor.cpp | 4 ++ source/gameengine/GameLogic/SCA_ActuatorSensor.h | 1 + source/gameengine/GameLogic/SCA_AlwaysSensor.cpp | 4 ++ source/gameengine/GameLogic/SCA_AlwaysSensor.h | 2 +- source/gameengine/GameLogic/SCA_DelaySensor.cpp | 4 ++ source/gameengine/GameLogic/SCA_DelaySensor.h | 1 + .../GameLogic/SCA_ExpressionController.h | 1 + source/gameengine/GameLogic/SCA_ILogicBrick.cpp | 7 ++- source/gameengine/GameLogic/SCA_ILogicBrick.h | 1 + source/gameengine/GameLogic/SCA_IObject.cpp | 3 ++ source/gameengine/GameLogic/SCA_IObject.h | 1 + source/gameengine/GameLogic/SCA_ISensor.cpp | 7 ++- source/gameengine/GameLogic/SCA_ISensor.h | 1 + source/gameengine/GameLogic/SCA_JoystickSensor.cpp | 4 ++ source/gameengine/GameLogic/SCA_JoystickSensor.h | 1 + source/gameengine/GameLogic/SCA_KeyboardSensor.cpp | 7 ++- source/gameengine/GameLogic/SCA_KeyboardSensor.h | 1 + source/gameengine/GameLogic/SCA_MouseSensor.cpp | 4 ++ source/gameengine/GameLogic/SCA_MouseSensor.h | 1 + source/gameengine/GameLogic/SCA_NANDController.cpp | 4 ++ source/gameengine/GameLogic/SCA_NANDController.h | 1 + source/gameengine/GameLogic/SCA_NORController.cpp | 4 ++ source/gameengine/GameLogic/SCA_NORController.h | 1 + source/gameengine/GameLogic/SCA_ORController.cpp | 4 ++ source/gameengine/GameLogic/SCA_ORController.h | 1 + .../gameengine/GameLogic/SCA_PropertyActuator.cpp | 4 ++ source/gameengine/GameLogic/SCA_PropertyActuator.h | 1 + source/gameengine/GameLogic/SCA_PropertySensor.cpp | 4 ++ source/gameengine/GameLogic/SCA_PropertySensor.h | 1 + source/gameengine/GameLogic/SCA_RandomActuator.cpp | 4 ++ source/gameengine/GameLogic/SCA_RandomActuator.h | 1 + source/gameengine/GameLogic/SCA_RandomSensor.cpp | 4 ++ source/gameengine/GameLogic/SCA_RandomSensor.h | 1 + source/gameengine/GameLogic/SCA_XNORController.cpp | 4 ++ source/gameengine/GameLogic/SCA_XNORController.h | 1 + source/gameengine/GameLogic/SCA_XORController.cpp | 4 ++ source/gameengine/GameLogic/SCA_XORController.h | 1 + source/gameengine/Ketsji/BL_Shader.cpp | 4 ++ source/gameengine/Ketsji/BL_Shader.h | 1 + .../Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp | 4 ++ .../Ketsji/KXNetwork/KX_NetworkMessageActuator.h | 1 + .../Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp | 4 ++ .../Ketsji/KXNetwork/KX_NetworkMessageSensor.h | 1 + source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 4 ++ source/gameengine/Ketsji/KX_BlenderMaterial.h | 1 + source/gameengine/Ketsji/KX_CDActuator.cpp | 4 ++ source/gameengine/Ketsji/KX_CDActuator.h | 1 + source/gameengine/Ketsji/KX_Camera.cpp | 4 ++ source/gameengine/Ketsji/KX_Camera.h | 1 + source/gameengine/Ketsji/KX_CameraActuator.cpp | 4 ++ source/gameengine/Ketsji/KX_CameraActuator.h | 1 + source/gameengine/Ketsji/KX_ConstraintActuator.cpp | 4 ++ source/gameengine/Ketsji/KX_ConstraintActuator.h | 1 + source/gameengine/Ketsji/KX_ConstraintWrapper.cpp | 8 ++- source/gameengine/Ketsji/KX_ConstraintWrapper.h | 1 + source/gameengine/Ketsji/KX_GameActuator.cpp | 7 ++- source/gameengine/Ketsji/KX_GameActuator.h | 1 + source/gameengine/Ketsji/KX_GameObject.cpp | 62 ++++++++++------------ source/gameengine/Ketsji/KX_GameObject.h | 4 +- source/gameengine/Ketsji/KX_IpoActuator.cpp | 4 ++ source/gameengine/Ketsji/KX_IpoActuator.h | 1 + source/gameengine/Ketsji/KX_Light.cpp | 4 ++ source/gameengine/Ketsji/KX_Light.h | 1 + source/gameengine/Ketsji/KX_MeshProxy.cpp | 4 ++ source/gameengine/Ketsji/KX_MeshProxy.h | 1 + source/gameengine/Ketsji/KX_MouseFocusSensor.cpp | 4 ++ source/gameengine/Ketsji/KX_MouseFocusSensor.h | 3 +- source/gameengine/Ketsji/KX_NearSensor.cpp | 4 ++ source/gameengine/Ketsji/KX_NearSensor.h | 1 + source/gameengine/Ketsji/KX_ObjectActuator.cpp | 4 ++ source/gameengine/Ketsji/KX_ObjectActuator.h | 1 + source/gameengine/Ketsji/KX_ParentActuator.cpp | 4 ++ source/gameengine/Ketsji/KX_ParentActuator.h | 1 + .../gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp | 5 +- source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h | 1 + source/gameengine/Ketsji/KX_PolyProxy.cpp | 4 ++ source/gameengine/Ketsji/KX_PolyProxy.h | 1 + source/gameengine/Ketsji/KX_PolygonMaterial.cpp | 4 ++ source/gameengine/Ketsji/KX_PolygonMaterial.h | 1 + source/gameengine/Ketsji/KX_RadarSensor.cpp | 4 ++ source/gameengine/Ketsji/KX_RadarSensor.h | 1 + source/gameengine/Ketsji/KX_RaySensor.cpp | 4 ++ source/gameengine/Ketsji/KX_RaySensor.h | 1 + .../gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp | 4 ++ .../gameengine/Ketsji/KX_SCA_AddObjectActuator.h | 1 + .../gameengine/Ketsji/KX_SCA_DynamicActuator.cpp | 4 ++ source/gameengine/Ketsji/KX_SCA_DynamicActuator.h | 1 + .../gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp | 4 ++ .../gameengine/Ketsji/KX_SCA_EndObjectActuator.h | 1 + .../Ketsji/KX_SCA_ReplaceMeshActuator.cpp | 4 ++ .../gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h | 1 + source/gameengine/Ketsji/KX_Scene.cpp | 26 +++++---- source/gameengine/Ketsji/KX_Scene.h | 6 +-- source/gameengine/Ketsji/KX_SceneActuator.cpp | 4 ++ source/gameengine/Ketsji/KX_SceneActuator.h | 1 + source/gameengine/Ketsji/KX_SoundActuator.cpp | 4 ++ source/gameengine/Ketsji/KX_SoundActuator.h | 1 + source/gameengine/Ketsji/KX_StateActuator.cpp | 6 ++- source/gameengine/Ketsji/KX_StateActuator.h | 1 + source/gameengine/Ketsji/KX_TouchSensor.cpp | 4 ++ source/gameengine/Ketsji/KX_TouchSensor.h | 1 + source/gameengine/Ketsji/KX_TrackToActuator.cpp | 4 ++ source/gameengine/Ketsji/KX_TrackToActuator.h | 1 + source/gameengine/Ketsji/KX_VehicleWrapper.cpp | 4 ++ source/gameengine/Ketsji/KX_VehicleWrapper.h | 1 + source/gameengine/Ketsji/KX_VertexProxy.cpp | 4 ++ source/gameengine/Ketsji/KX_VertexProxy.h | 1 + source/gameengine/Ketsji/KX_VisibilityActuator.cpp | 4 ++ source/gameengine/Ketsji/KX_VisibilityActuator.h | 1 + 123 files changed, 357 insertions(+), 79 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 7515f3f5f91..3002005ae3f 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -1020,6 +1020,10 @@ PyObject* BL_ActionActuator::py_getattro(PyObject *attr) { py_getattro_up(SCA_IActuator); } +PyObject* BL_ActionActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int BL_ActionActuator::py_setattro(PyObject *attr, PyObject* value) { py_setattro_up(SCA_IActuator); } diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h index 6ae7f716b4b..b3c15c08f50 100644 --- a/source/gameengine/Converter/BL_ActionActuator.h +++ b/source/gameengine/Converter/BL_ActionActuator.h @@ -114,6 +114,7 @@ public: KX_PYMETHOD_DOC(BL_ActionActuator,setChannel); virtual PyObject* py_getattro(PyObject* attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject* attr, PyObject* value); static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index 62bc99bb437..a447ffb8aa9 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -489,6 +489,10 @@ PyObject* BL_ShapeActionActuator::py_getattro(PyObject* attr) { py_getattro_up(SCA_IActuator); } +PyObject* BL_ShapeActionActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int BL_ShapeActionActuator::py_setattro(PyObject *attr, PyObject* value) { py_setattro_up(SCA_IActuator); } diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.h b/source/gameengine/Converter/BL_ShapeActionActuator.h index 3bc35ac9495..d268eef6d23 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.h +++ b/source/gameengine/Converter/BL_ShapeActionActuator.h @@ -107,6 +107,7 @@ public: KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetType); virtual PyObject* py_getattro(PyObject* attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject* attr, PyObject* value); static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index dd9b296dce1..7c31a29f4ac 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -273,6 +273,10 @@ PyObject* CListValue::py_getattro(PyObject* attr) { py_getattro_up(CValue); } +PyObject* CListValue::py_getattro_dict() { + py_getattro_dict_up(CValue); +} + ////////////////////////////////////////////////////////////////////// // Construction/Destruction diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h index 2af5a330c43..3d88b5aea9c 100644 --- a/source/gameengine/Expressions/ListValue.h +++ b/source/gameengine/Expressions/ListValue.h @@ -60,6 +60,7 @@ public: bool CheckEqual(CValue* first,CValue* second); virtual PyObject* py_getattro(PyObject* attr); + virtual PyObject* py_getattro_dict(); virtual PyObject* py_repr(void) { PyObject *py_proxy= this->GetProxy(); PyObject *py_list= PySequence_List(py_proxy); diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 6cfa14ddc80..c4daaff2dd1 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -143,7 +143,13 @@ PyObject *PyObjectPlus::py_base_getattro(PyObject * self, PyObject *attr) PyErr_SetString(PyExc_RuntimeError, BGE_PROXY_ERROR_MSG); return NULL; } - return self_plus->py_getattro(attr); + + PyObject *ret= self_plus->py_getattro(attr); + + if(ret==NULL && (strcmp(PyString_AsString(attr), "__dict__")==0)) + ret= self_plus->py_getattro_dict(); + + return ret; } /* This should be the entry in Type since it takes the C++ class from PyObjectPlus_Proxy */ @@ -177,9 +183,6 @@ PyObject *PyObjectPlus::py_getattro(PyObject* attr) { PyObject *descr = PyDict_GetItem(Type.tp_dict, attr); \ if (descr == NULL) { - if (strcmp(PyString_AsString(attr), "__dict__")==0) { - return py_getattr_dict(NULL, Type.tp_dict); /* no Attributes yet */ - } PyErr_Format(PyExc_AttributeError, "attribute \"%s\" not found", PyString_AsString(attr)); return NULL; } else { @@ -196,6 +199,10 @@ PyObject *PyObjectPlus::py_getattro(PyObject* attr) } } +PyObject* PyObjectPlus::py_getattro_dict() { + return py_getattr_dict(NULL, Type.tp_dict); +} + int PyObjectPlus::py_delattro(PyObject* attr) { PyErr_SetString(PyExc_AttributeError, "attribute cant be deleted"); diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 370717a919b..b0ddfa04e32 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -130,16 +130,12 @@ typedef struct { } \ } else { \ PyErr_Clear(); \ - PyObject *rvalue= Parent::py_getattro(attr); \ - \ - if (strcmp(PyString_AsString(attr), "__dict__")==0) { \ - return py_getattr_dict(rvalue, Type.tp_dict); \ - } \ - \ - return rvalue; \ + return Parent::py_getattro(attr); \ } \ return NULL; +#define py_getattro_dict_up(Parent) \ + return py_getattr_dict(Parent::py_getattro_dict(), Type.tp_dict); /* * nonzero values are an error for setattr @@ -434,6 +430,7 @@ public: /* These are all virtual python methods that are defined in each class * Our own fake subclassing calls these on each class, then calls the parent */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_delattro(PyObject *attr); virtual int py_setattro(PyObject *attr, PyObject *value); virtual PyObject* py_repr(void); diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 7cb97909119..106bd1256a6 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -612,6 +612,10 @@ PyObject* CValue::py_getattro(PyObject *attr) py_getattro_up(PyObjectPlus); } +PyObject* CValue::py_getattro_dict() { + py_getattro_dict_up(PyObjectPlus); +} + CValue* CValue::ConvertPythonToValue(PyObject* pyobj) { diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index a687e1a493c..88186fa95c0 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -225,6 +225,7 @@ public: virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual PyObject* ConvertValueToPython() { return NULL; } diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index 251a586308e..9bf03bf39cc 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -157,6 +157,10 @@ PyObject* SCA_2DFilterActuator::py_getattro(PyObject *attr) py_getattro_up(SCA_IActuator); } +PyObject* SCA_2DFilterActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int SCA_2DFilterActuator::py_setattro(PyObject *attr, PyObject* value) { py_setattro_up(SCA_IActuator); diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.h b/source/gameengine/GameLogic/SCA_2DFilterActuator.h index de0201a4b19..b43dc092ddb 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.h +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.h @@ -71,6 +71,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject* value); }; diff --git a/source/gameengine/GameLogic/SCA_ANDController.cpp b/source/gameengine/GameLogic/SCA_ANDController.cpp index 1cb03f375cb..e4642750942 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.cpp +++ b/source/gameengine/GameLogic/SCA_ANDController.cpp @@ -145,4 +145,8 @@ PyObject* SCA_ANDController::py_getattro(PyObject *attr) { py_getattro_up(SCA_IController); } +PyObject* SCA_ANDController::py_getattro_dict() { + py_getattro_dict_up(SCA_IController); +} + /* eof */ diff --git a/source/gameengine/GameLogic/SCA_ANDController.h b/source/gameengine/GameLogic/SCA_ANDController.h index fdb93d0fc42..9a359d57cb4 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.h +++ b/source/gameengine/GameLogic/SCA_ANDController.h @@ -49,6 +49,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); }; diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index acd906ef9dd..4c85c4f8e5e 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -165,6 +165,10 @@ PyObject* SCA_ActuatorSensor::py_getattro(PyObject *attr) { py_getattro_up(SCA_ISensor); } +PyObject* SCA_ActuatorSensor::py_getattro_dict() { + py_getattro_dict_up(SCA_ISensor); +} + int SCA_ActuatorSensor::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_ISensor); } diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.h b/source/gameengine/GameLogic/SCA_ActuatorSensor.h index 21960993497..974b2e43d78 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.h +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.h @@ -62,6 +62,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); /* 3. setProperty */ diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp index b7ecb0233a1..874883c89b1 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp @@ -143,4 +143,8 @@ PyObject* SCA_AlwaysSensor::py_getattro(PyObject *attr) { py_getattro_up(SCA_ISensor); } +PyObject* SCA_AlwaysSensor::py_getattro_dict() { + py_getattro_dict_up(SCA_ISensor); +} + /* eof */ diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.h b/source/gameengine/GameLogic/SCA_AlwaysSensor.h index 87949babf59..769e1e883bc 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.h +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.h @@ -53,7 +53,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); - + virtual PyObject* py_getattro_dict(); }; diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp index 44a0175d916..0e4a00e2745 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.cpp +++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp @@ -182,6 +182,10 @@ PyObject* SCA_DelaySensor::py_getattro(PyObject *attr) { py_getattro_up(SCA_ISensor); } +PyObject* SCA_DelaySensor::py_getattro_dict() { + py_getattro_dict_up(SCA_ISensor); +} + int SCA_DelaySensor::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_ISensor); } diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.h b/source/gameengine/GameLogic/SCA_DelaySensor.h index 8da76ff7189..31394fdc961 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.h +++ b/source/gameengine/GameLogic/SCA_DelaySensor.h @@ -61,6 +61,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); /* setProperty */ diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.h b/source/gameengine/GameLogic/SCA_ExpressionController.h index 2936742be19..6a34d7b2dff 100644 --- a/source/gameengine/GameLogic/SCA_ExpressionController.h +++ b/source/gameengine/GameLogic/SCA_ExpressionController.h @@ -60,6 +60,7 @@ public: /* --------------------------------------------------------------------- */ // virtual PyObject* py_getattro(PyObject *attr); +// virtual PyObject* py_getattro_dict(); }; diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 3cd750ff63b..02a25916299 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -278,12 +278,15 @@ int SCA_ILogicBrick::CheckProperty(void *self, const PyAttributeDef *attrdef) return 0; } -PyObject* -SCA_ILogicBrick::py_getattro(PyObject *attr) +PyObject* SCA_ILogicBrick::py_getattro(PyObject *attr) { py_getattro_up(CValue); } +PyObject* SCA_ILogicBrick::py_getattro_dict() { + py_getattro_dict_up(CValue); +} + int SCA_ILogicBrick::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(CValue); diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index e59d05ea051..f2353741d39 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -80,6 +80,7 @@ public: virtual bool LessComparedTo(SCA_ILogicBrick* other); virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); static class SCA_LogicManager* m_sCurrentLogicManager; diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index 75804525e7a..8e599e6411a 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -418,3 +418,6 @@ PyObject* SCA_IObject::py_getattro(PyObject *attr) { py_getattro_up(CValue); } +PyObject* SCA_IObject::py_getattro_dict() { + py_getattro_dict_up(CValue); +} diff --git a/source/gameengine/GameLogic/SCA_IObject.h b/source/gameengine/GameLogic/SCA_IObject.h index 44ed3c8f3fe..7f63c9f5efd 100644 --- a/source/gameengine/GameLogic/SCA_IObject.h +++ b/source/gameengine/GameLogic/SCA_IObject.h @@ -146,6 +146,7 @@ public: // here come the python forwarded methods virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int GetGameObjectType() {return -1;} diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 68f5653d53a..dde970962b6 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -459,12 +459,15 @@ PyAttributeDef SCA_ISensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* -SCA_ISensor::py_getattro(PyObject *attr) +PyObject* SCA_ISensor::py_getattro(PyObject *attr) { py_getattro_up(SCA_ILogicBrick); } +PyObject* SCA_ISensor::py_getattro_dict() { + py_getattro_dict_up(SCA_ILogicBrick); +} + int SCA_ISensor::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_ILogicBrick); diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index 6b1c8cca104..e2ceec19b69 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -137,6 +137,7 @@ public: /* Python functions: */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); //Deprecated functions -----> diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index 1c601eded81..a8c6f87ebdd 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -339,6 +339,10 @@ PyObject* SCA_JoystickSensor::py_getattro(PyObject *attr) py_getattro_up(SCA_ISensor); } +PyObject* SCA_JoystickSensor::py_getattro_dict() { + py_getattro_dict_up(SCA_ISensor); +} + int SCA_JoystickSensor::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_ISensor); diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.h b/source/gameengine/GameLogic/SCA_JoystickSensor.h index cf3e7e74414..20fff66f66c 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.h +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.h @@ -123,6 +123,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); /* Joystick Index */ diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index c946156283f..96969dc6dc7 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -664,12 +664,15 @@ PyAttributeDef SCA_KeyboardSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* -SCA_KeyboardSensor::py_getattro(PyObject *attr) +PyObject* SCA_KeyboardSensor::py_getattro(PyObject *attr) { py_getattro_up(SCA_ISensor); } +PyObject* SCA_KeyboardSensor::py_getattro_dict() { + py_getattro_dict_up(SCA_ISensor); +} + int SCA_KeyboardSensor::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_ISensor); diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h index 073b3e6dbe0..1dd6ea21fcd 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h @@ -111,6 +111,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); //Deprecated functions -----> diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index 4dbeb156e63..0bae676d19d 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -342,6 +342,10 @@ PyObject* SCA_MouseSensor::py_getattro(PyObject *attr) py_getattro_up(SCA_ISensor); } +PyObject* SCA_MouseSensor::py_getattro_dict() { + py_getattro_dict_up(SCA_ISensor); +} + int SCA_MouseSensor::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_ISensor); diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.h b/source/gameengine/GameLogic/SCA_MouseSensor.h index 2d1c496029d..528237475db 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.h +++ b/source/gameengine/GameLogic/SCA_MouseSensor.h @@ -110,6 +110,7 @@ class SCA_MouseSensor : public SCA_ISensor /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); //Deprecated functions -----> diff --git a/source/gameengine/GameLogic/SCA_NANDController.cpp b/source/gameengine/GameLogic/SCA_NANDController.cpp index 703c9c1bbaf..dedf32df3c9 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.cpp +++ b/source/gameengine/GameLogic/SCA_NANDController.cpp @@ -145,4 +145,8 @@ PyObject* SCA_NANDController::py_getattro(PyObject *attr) { py_getattro_up(SCA_IController); } +PyObject* SCA_NANDController::py_getattro_dict() { + py_getattro_dict_up(SCA_IController); +} + /* eof */ diff --git a/source/gameengine/GameLogic/SCA_NANDController.h b/source/gameengine/GameLogic/SCA_NANDController.h index 11600914a1a..0ae0ff19745 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.h +++ b/source/gameengine/GameLogic/SCA_NANDController.h @@ -49,6 +49,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); }; diff --git a/source/gameengine/GameLogic/SCA_NORController.cpp b/source/gameengine/GameLogic/SCA_NORController.cpp index 06acae5a81a..8cd575ffef3 100644 --- a/source/gameengine/GameLogic/SCA_NORController.cpp +++ b/source/gameengine/GameLogic/SCA_NORController.cpp @@ -145,4 +145,8 @@ PyObject* SCA_NORController::py_getattro(PyObject *attr) { py_getattro_up(SCA_IController); } +PyObject* SCA_NORController::py_getattro_dict() { + py_getattro_dict_up(SCA_IController); +} + /* eof */ diff --git a/source/gameengine/GameLogic/SCA_NORController.h b/source/gameengine/GameLogic/SCA_NORController.h index fc814e28d37..06cbb70a489 100644 --- a/source/gameengine/GameLogic/SCA_NORController.h +++ b/source/gameengine/GameLogic/SCA_NORController.h @@ -49,6 +49,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); }; diff --git a/source/gameengine/GameLogic/SCA_ORController.cpp b/source/gameengine/GameLogic/SCA_ORController.cpp index 319ff04f776..a12246e9a73 100644 --- a/source/gameengine/GameLogic/SCA_ORController.cpp +++ b/source/gameengine/GameLogic/SCA_ORController.cpp @@ -138,4 +138,8 @@ PyObject* SCA_ORController::py_getattro(PyObject *attr) { py_getattro_up(SCA_IController); } +PyObject* SCA_ORController::py_getattro_dict() { + py_getattro_dict_up(SCA_IController); +} + /* eof */ diff --git a/source/gameengine/GameLogic/SCA_ORController.h b/source/gameengine/GameLogic/SCA_ORController.h index fdc81486e74..66f772c739e 100644 --- a/source/gameengine/GameLogic/SCA_ORController.h +++ b/source/gameengine/GameLogic/SCA_ORController.h @@ -50,6 +50,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); }; #endif //__KX_ORCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index c4db723ee89..beb7a09a137 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -279,6 +279,10 @@ PyObject* SCA_PropertyActuator::py_getattro(PyObject *attr) { py_getattro_up(SCA_IActuator); } +PyObject* SCA_PropertyActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int SCA_PropertyActuator::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_IActuator); } diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.h b/source/gameengine/GameLogic/SCA_PropertyActuator.h index bb841cf88ad..a8df08dfc6e 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.h +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.h @@ -87,6 +87,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); // python wrapped methods diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index de8a9fcf03e..c56dd3a12f4 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -356,6 +356,10 @@ PyObject* SCA_PropertySensor::py_getattro(PyObject *attr) { py_getattro_up(SCA_ISensor); } +PyObject* SCA_PropertySensor::py_getattro_dict() { + py_getattro_dict_up(SCA_ISensor); +} + int SCA_PropertySensor::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_ISensor); } diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.h b/source/gameengine/GameLogic/SCA_PropertySensor.h index e1e378a973c..7abf4d44a5b 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.h +++ b/source/gameengine/GameLogic/SCA_PropertySensor.h @@ -90,6 +90,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); /* 1. getType */ diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index 3a72d9b7652..b9df198f7da 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -395,6 +395,10 @@ PyObject* SCA_RandomActuator::py_getattro(PyObject *attr) { py_getattro_up(SCA_IActuator); } +PyObject* SCA_RandomActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int SCA_RandomActuator::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_IActuator); diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.h b/source/gameengine/GameLogic/SCA_RandomActuator.h index 8f58ed0dcec..310e8a7fbf9 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.h +++ b/source/gameengine/GameLogic/SCA_RandomActuator.h @@ -97,6 +97,7 @@ class SCA_RandomActuator : public SCA_IActuator /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); static PyObject* pyattr_get_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 5ead82db428..494b7a3694e 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -170,6 +170,10 @@ PyObject* SCA_RandomSensor::py_getattro(PyObject *attr) { py_getattro_up(SCA_ISensor); } +PyObject* SCA_RandomSensor::py_getattro_dict() { + py_getattro_dict_up(SCA_ISensor); +} + int SCA_RandomSensor::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_ISensor); diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.h b/source/gameengine/GameLogic/SCA_RandomSensor.h index 764692600c3..63a96dd72d0 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.h +++ b/source/gameengine/GameLogic/SCA_RandomSensor.h @@ -61,6 +61,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); /* 1. setSeed */ diff --git a/source/gameengine/GameLogic/SCA_XNORController.cpp b/source/gameengine/GameLogic/SCA_XNORController.cpp index e9bb37ee958..145afa6aec5 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.cpp +++ b/source/gameengine/GameLogic/SCA_XNORController.cpp @@ -149,4 +149,8 @@ PyObject* SCA_XNORController::py_getattro(PyObject *attr) { py_getattro_up(SCA_IController); } +PyObject* SCA_XNORController::py_getattro_dict() { + py_getattro_dict_up(SCA_IController); +} + /* eof */ diff --git a/source/gameengine/GameLogic/SCA_XNORController.h b/source/gameengine/GameLogic/SCA_XNORController.h index c992d5f1834..4aad5763cb0 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.h +++ b/source/gameengine/GameLogic/SCA_XNORController.h @@ -49,6 +49,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); }; diff --git a/source/gameengine/GameLogic/SCA_XORController.cpp b/source/gameengine/GameLogic/SCA_XORController.cpp index 791a139975f..4dfba3a56ac 100644 --- a/source/gameengine/GameLogic/SCA_XORController.cpp +++ b/source/gameengine/GameLogic/SCA_XORController.cpp @@ -149,4 +149,8 @@ PyObject* SCA_XORController::py_getattro(PyObject *attr) { py_getattro_up(SCA_IController); } +PyObject* SCA_XORController::py_getattro_dict() { + py_getattro_dict_up(SCA_IController); +} + /* eof */ diff --git a/source/gameengine/GameLogic/SCA_XORController.h b/source/gameengine/GameLogic/SCA_XORController.h index 065b31fd901..feb9f2ed07c 100644 --- a/source/gameengine/GameLogic/SCA_XORController.h +++ b/source/gameengine/GameLogic/SCA_XORController.h @@ -49,6 +49,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); }; diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index 88d920043e0..2b3612ec3ae 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -734,6 +734,10 @@ PyObject* BL_Shader::py_getattro(PyObject *attr) py_getattro_up(PyObjectPlus); } +PyObject* BL_Shader::py_getattro_dict() { + py_getattro_dict_up(PyObjectPlus); +} + PyMethodDef BL_Shader::Methods[] = { diff --git a/source/gameengine/Ketsji/BL_Shader.h b/source/gameengine/Ketsji/BL_Shader.h index 08cad5071fd..7db40e778ae 100644 --- a/source/gameengine/Ketsji/BL_Shader.h +++ b/source/gameengine/Ketsji/BL_Shader.h @@ -203,6 +203,7 @@ public: // Python interface virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual PyObject* py_repr(void) { return PyString_FromFormat("BL_Shader\n\tvertex shader:%s\n\n\tfragment shader%s\n\n", vertProg, fragProg); } // ----------------------------------- diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp index 2483a6bfb39..9c36a899505 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp @@ -157,6 +157,10 @@ PyObject* KX_NetworkMessageActuator::py_getattro(PyObject *attr) { py_getattro_up(SCA_IActuator); } +PyObject* KX_NetworkMessageActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int KX_NetworkMessageActuator::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_IActuator); } diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h index 850f825b8f3..cf92fd46fe0 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h @@ -62,6 +62,7 @@ public: /* ------------------------------------------------------------ */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); // Deprecated -----> diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index 7782567943e..b1b9c0e1fc9 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -227,6 +227,10 @@ PyObject* KX_NetworkMessageSensor::py_getattro(PyObject *attr) { py_getattro_up(SCA_ISensor); } +PyObject* KX_NetworkMessageSensor::py_getattro_dict() { + py_getattro_dict_up(SCA_ISensor); +} + int KX_NetworkMessageSensor::py_setattro(PyObject *attr, PyObject *value) { return SCA_ISensor::py_setattro(attr, value); } diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h index ac0e880d25c..3abba7cfffd 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h @@ -73,6 +73,7 @@ public: /* ------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); // Deprecated -----> diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 849332008ce..2edfe4b718c 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -784,6 +784,10 @@ PyObject* KX_BlenderMaterial::py_getattro(PyObject *attr) py_getattro_up(PyObjectPlus); } +PyObject* KX_BlenderMaterial::py_getattro_dict() { + py_getattro_dict_up(PyObjectPlus); +} + int KX_BlenderMaterial::py_setattro(PyObject *attr, PyObject *pyvalue) { return PyObjectPlus::py_setattro(attr, pyvalue); diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index 48d4730ab07..57cdde3c947 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -83,6 +83,7 @@ public: // -------------------------------- virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *pyvalue); virtual PyObject* py_repr(void) { return PyString_FromString(mMaterial->matname.ReadPtr()); } diff --git a/source/gameengine/Ketsji/KX_CDActuator.cpp b/source/gameengine/Ketsji/KX_CDActuator.cpp index 121d4512265..6e318cdcfa3 100644 --- a/source/gameengine/Ketsji/KX_CDActuator.cpp +++ b/source/gameengine/Ketsji/KX_CDActuator.cpp @@ -220,6 +220,10 @@ PyObject* KX_CDActuator::py_getattro(PyObject *attr) py_getattro_up(SCA_IActuator); } +PyObject* KX_CDActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int KX_CDActuator::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_IActuator); diff --git a/source/gameengine/Ketsji/KX_CDActuator.h b/source/gameengine/Ketsji/KX_CDActuator.h index b674755e59f..2fd05ab72e5 100644 --- a/source/gameengine/Ketsji/KX_CDActuator.h +++ b/source/gameengine/Ketsji/KX_CDActuator.h @@ -82,6 +82,7 @@ public: /* -------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); // Deprecated -----> diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index c8575424751..f84ce23b7dd 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -544,6 +544,10 @@ PyObject* KX_Camera::py_getattro(PyObject *attr) py_getattro_up(KX_GameObject); } +PyObject* KX_Camera::py_getattro_dict() { + py_getattro_dict_up(KX_GameObject); +} + int KX_Camera::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(KX_GameObject); diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index 4accd4bc2f1..6f818cb2c57 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -278,6 +278,7 @@ public: KX_PYMETHOD_DOC_NOARGS(KX_Camera, setOnTop); virtual PyObject* py_getattro(PyObject *attr); /* lens, near, far, projection_matrix */ + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *pyvalue); static PyObject* pyattr_get_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index 355cdbb6263..2ef7abfd172 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -425,6 +425,10 @@ PyObject* KX_CameraActuator::py_getattro(PyObject *attr) { py_getattro_up(SCA_IActuator); } +PyObject* KX_CameraActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int KX_CameraActuator::py_setattro(PyObject *attr, PyObject* value) { py_setattro_up(SCA_IActuator); } diff --git a/source/gameengine/Ketsji/KX_CameraActuator.h b/source/gameengine/Ketsji/KX_CameraActuator.h index 9298e1e868d..efa4e2f38d7 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.h +++ b/source/gameengine/Ketsji/KX_CameraActuator.h @@ -121,6 +121,7 @@ private : /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject* value); /* set object to look at */ diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index 1ce7fac0cfe..00fed43cbe8 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -640,6 +640,10 @@ PyObject* KX_ConstraintActuator::py_getattro(PyObject *attr) py_getattro_up(SCA_IActuator); } +PyObject* KX_ConstraintActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int KX_ConstraintActuator::py_setattro(PyObject *attr, PyObject* value) { py_setattro_up(SCA_IActuator); diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.h b/source/gameengine/Ketsji/KX_ConstraintActuator.h index 98f6fcd7906..84512c0ecf2 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.h +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.h @@ -144,6 +144,7 @@ protected: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject* value); static int pyattr_check_direction(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index 7c3abb49159..c537c9abe01 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -87,12 +87,16 @@ PyParentObject KX_ConstraintWrapper::Parents[] = { NULL }; -PyObject* KX_ConstraintWrapper::py_getattro(PyObject *attr) +//here you can search for existing data members (like mass,friction etc.) +PyObject* KX_ConstraintWrapper::py_getattro(PyObject *attr) { - //here you can search for existing data members (like mass,friction etc.) py_getattro_up(PyObjectPlus); } +PyObject* KX_ConstraintWrapper::py_getattro_dict() { + py_getattro_dict_up(PyObjectPlus); +} + int KX_ConstraintWrapper::py_setattro(PyObject *attr,PyObject* pyobj) { int result = 1; diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.h b/source/gameengine/Ketsji/KX_ConstraintWrapper.h index 6e67d842cb6..3270d57188d 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.h +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.h @@ -36,6 +36,7 @@ class KX_ConstraintWrapper : public PyObjectPlus { Py_Header; virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); public: KX_ConstraintWrapper(PHY_ConstraintType ctype,int constraintId,class PHY_IPhysicsEnvironment* physenv,PyTypeObject *T = &Type); diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index 8b587c6f7de..0a411396ff8 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -253,12 +253,15 @@ PyAttributeDef KX_GameActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* -KX_GameActuator::py_getattro(PyObject *attr) +PyObject* KX_GameActuator::py_getattro(PyObject *attr) { py_getattro_up(SCA_IActuator); } +PyObject* KX_GameActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int KX_GameActuator::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_IActuator); diff --git a/source/gameengine/Ketsji/KX_GameActuator.h b/source/gameengine/Ketsji/KX_GameActuator.h index 570cb2e68ef..b2b1d6ec2b9 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.h +++ b/source/gameengine/Ketsji/KX_GameActuator.h @@ -78,6 +78,7 @@ protected: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); // Deprecated functions -----> diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index bea0fcff2af..1f4c9c2e9d5 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1153,8 +1153,6 @@ PyAttributeDef KX_GameObject::Attributes[] = { KX_PYATTRIBUTE_RW_FUNCTION("localScaling", KX_GameObject, pyattr_get_localScaling, pyattr_set_localScaling), KX_PYATTRIBUTE_RO_FUNCTION("worldScaling", KX_GameObject, pyattr_get_worldScaling), - KX_PYATTRIBUTE_RO_FUNCTION("__dict__", KX_GameObject, pyattr_get_dir_dict), - /* Experemental, dont rely on these yet */ KX_PYATTRIBUTE_RO_FUNCTION("sensors", KX_GameObject, pyattr_get_sensors), KX_PYATTRIBUTE_RO_FUNCTION("controllers", KX_GameObject, pyattr_get_controllers), @@ -1703,37 +1701,6 @@ PyObject* KX_GameObject::pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE return resultlist; } -/* __dict__ only for the purpose of giving useful dir() results */ -PyObject* KX_GameObject::pyattr_get_dir_dict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) -{ - KX_GameObject* self= static_cast(self_v); - PyObject *dict_str = PyString_FromString("__dict__"); - PyObject *dict= py_getattr_dict(self->SCA_IObject::py_getattro(dict_str), Type.tp_dict); - Py_DECREF(dict_str); - - if(dict==NULL) - return NULL; - - /* Not super fast getting as a list then making into dict keys but its only for dir() */ - PyObject *list= self->ConvertKeysToPython(); - if(list) - { - int i; - for(i=0; im_attr_dict) - PyDict_Update(dict, self->m_attr_dict); - - return dict; -} - /* We need these because the macros have a return in them */ PyObject* KX_GameObject::py_getattro__internal(PyObject *attr) { @@ -1772,6 +1739,35 @@ PyObject* KX_GameObject::py_getattro(PyObject *attr) return object; } +PyObject* KX_GameObject::py_getattro_dict() { + //py_getattro_dict_up(SCA_IObject); + PyObject *dict= py_getattr_dict(SCA_IObject::py_getattro_dict(), Type.tp_dict); + if(dict==NULL) + return NULL; + + /* normally just return this but KX_GameObject has some more items */ + + + /* Not super fast getting as a list then making into dict keys but its only for dir() */ + PyObject *list= ConvertKeysToPython(); + if(list) + { + int i; + for(i=0; iname+2 : ""); } diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index 8277e7ef19c..d1075f9b296 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -304,6 +304,10 @@ PyObject* KX_RadarSensor::py_getattro(PyObject *attr) py_getattro_up(KX_NearSensor); } +PyObject* KX_RadarSensor::py_getattro_dict() { + py_getattro_dict_up(KX_NearSensor); +} + int KX_RadarSensor::py_setattro(PyObject *attr, PyObject* value) { py_setattro_up(KX_NearSensor); diff --git a/source/gameengine/Ketsji/KX_RadarSensor.h b/source/gameengine/Ketsji/KX_RadarSensor.h index c3a941696ce..8389a2a29eb 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.h +++ b/source/gameengine/Ketsji/KX_RadarSensor.h @@ -90,6 +90,7 @@ public: }; virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject* value); //Deprecated -----> diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index 06c04dbf10d..360aa1a85a8 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -449,6 +449,10 @@ PyObject* KX_RaySensor::py_getattro(PyObject *attr) { py_getattro_up(SCA_ISensor); } +PyObject* KX_RaySensor::py_getattro_dict() { + py_getattro_dict_up(SCA_ISensor); +} + int KX_RaySensor::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_ISensor); } diff --git a/source/gameengine/Ketsji/KX_RaySensor.h b/source/gameengine/Ketsji/KX_RaySensor.h index a5d7d15c60c..558840e2f17 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.h +++ b/source/gameengine/Ketsji/KX_RaySensor.h @@ -87,6 +87,7 @@ public: virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); // Deprecated -----> diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index 56d94a8d226..b5aa7a2f4c2 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -260,6 +260,10 @@ PyObject* KX_SCA_AddObjectActuator::py_getattro(PyObject *attr) py_getattro_up(SCA_IActuator); } +PyObject* KX_SCA_AddObjectActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int KX_SCA_AddObjectActuator::py_setattro(PyObject *attr, PyObject* value) { py_setattro_up(SCA_IActuator); diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h index 4ece5a6d83b..6746b7d1bc6 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h @@ -111,6 +111,7 @@ public: Update(); virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject* value); SCA_IObject* diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp index 9c9cdcd6c4c..dd3250f5b61 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp @@ -97,6 +97,10 @@ PyObject* KX_SCA_DynamicActuator::py_getattro(PyObject *attr) py_getattro_up(SCA_IActuator); } +PyObject* KX_SCA_DynamicActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int KX_SCA_DynamicActuator::py_setattro(PyObject *attr, PyObject* value) { py_setattro_up(SCA_IActuator); diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h index 99855124bdb..4add707f8cd 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h @@ -75,6 +75,7 @@ class KX_SCA_DynamicActuator : public SCA_IActuator virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); /* 1. setOperation */ diff --git a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp index 3b42577810e..c0dc6ea6b55 100644 --- a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp @@ -136,4 +136,8 @@ PyObject* KX_SCA_EndObjectActuator::py_getattro(PyObject *attr) py_getattro_up(SCA_IActuator); } +PyObject* KX_SCA_EndObjectActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + /* eof */ diff --git a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h index 2940246f443..70d72f1f8da 100644 --- a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h @@ -65,6 +65,7 @@ class KX_SCA_EndObjectActuator : public SCA_IActuator /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); }; /* end of class KX_EditObjectActuator : public SCA_PropertyActuator */ diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp index 38f8d581d55..b7135a5503a 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp @@ -99,6 +99,10 @@ PyObject* KX_SCA_ReplaceMeshActuator::py_getattro(PyObject *attr) py_getattro_up(SCA_IActuator); } +PyObject* KX_SCA_ReplaceMeshActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int KX_SCA_ReplaceMeshActuator::py_setattro(PyObject *attr, PyObject* value) { py_setattro_up(SCA_IActuator); diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h index 7a18df2356d..0e7f7852701 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h @@ -72,6 +72,7 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator void InstantReplaceMesh(); virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject* value); static PyObject* pyattr_get_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index aa7bd65f240..f91c4674113 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1630,19 +1630,6 @@ PyObject* KX_Scene::pyattr_get_active_camera(void *self_v, const KX_PYATTRIBUTE_ return self->GetActiveCamera()->GetProxy(); } -/* __dict__ only for the purpose of giving useful dir() results */ -PyObject* KX_Scene::pyattr_get_dir_dict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) -{ - KX_Scene* self= static_cast(self_v); - /* Useually done by py_getattro_up but in this case we want to include m_attr_dict dict */ - PyObject *dict_str= PyString_FromString("__dict__"); - PyObject *dict= py_getattr_dict(self->PyObjectPlus::py_getattro(dict_str), Type.tp_dict); - Py_DECREF(dict_str); - - PyDict_Update(dict, self->m_attr_dict); - return dict; -} - PyAttributeDef KX_Scene::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("name", KX_Scene, pyattr_get_name), KX_PYATTRIBUTE_RO_FUNCTION("objects", KX_Scene, pyattr_get_objects), @@ -1651,7 +1638,6 @@ PyAttributeDef KX_Scene::Attributes[] = { KX_PYATTRIBUTE_BOOL_RO("activity_culling", KX_Scene, m_activity_culling), KX_PYATTRIBUTE_FLOAT_RW("activity_culling_radius", 0.5f, FLT_MAX, KX_Scene, m_activity_box_radius), KX_PYATTRIBUTE_BOOL_RO("dbvt_culling", KX_Scene, m_dbvt_culling), - KX_PYATTRIBUTE_RO_FUNCTION("__dict__", KX_Scene, pyattr_get_dir_dict), { NULL } //Sentinel }; @@ -1685,6 +1671,18 @@ PyObject* KX_Scene::py_getattro(PyObject *attr) return object; } +PyObject* KX_Scene::py_getattro_dict() { + //py_getattro_dict_up(PyObjectPlus); + + PyObject *dict= py_getattr_dict(PyObjectPlus::py_getattro_dict(), Type.tp_dict); + if(dict==NULL) + return NULL; + + /* normally just return this but KX_Scene has some more items */ + + PyDict_Update(dict, m_attr_dict); + return dict; +} int KX_Scene::py_setattro(PyObject *attr, PyObject *value) { diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index a06c66ec5dd..83a4692f815 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -593,12 +593,10 @@ public: static PyObject* pyattr_get_name(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_objects(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_active_camera(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); - - /* for dir(), python3 uses __dir__() */ - static PyObject* pyattr_get_dir_dict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); - virtual PyObject* py_getattro(PyObject *attr); /* name, active_camera, gravity, suspended, viewport, framing, activity_culling, activity_culling_radius */ + virtual PyObject* py_getattro_dict(); + virtual int py_setattro(PyObject *attr, PyObject *pyvalue); virtual int py_delattro(PyObject *attr); virtual PyObject* py_repr(void) { return PyString_FromString(GetName().ReadPtr()); } diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index f54d8542260..c525aeb1e3f 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -281,6 +281,10 @@ PyObject* KX_SceneActuator::py_getattro(PyObject *attr) py_getattro_up(SCA_IActuator); } +PyObject* KX_SceneActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int KX_SceneActuator::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_IActuator); diff --git a/source/gameengine/Ketsji/KX_SceneActuator.h b/source/gameengine/Ketsji/KX_SceneActuator.h index 803c5106a60..315e97e8f70 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.h +++ b/source/gameengine/Ketsji/KX_SceneActuator.h @@ -93,6 +93,7 @@ class KX_SceneActuator : public SCA_IActuator /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); /* 1. set */ diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index 412be497c5a..4103da4ad93 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -340,6 +340,10 @@ PyObject* KX_SoundActuator::py_getattro(PyObject *attr) py_getattro_up(SCA_IActuator); } +PyObject* KX_SoundActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int KX_SoundActuator::py_setattro(PyObject *attr, PyObject* value) { py_setattro_up(SCA_IActuator); } diff --git a/source/gameengine/Ketsji/KX_SoundActuator.h b/source/gameengine/Ketsji/KX_SoundActuator.h index d5e678bbecd..ad58087dc57 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.h +++ b/source/gameengine/Ketsji/KX_SoundActuator.h @@ -81,6 +81,7 @@ public: /* -------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject* value); KX_PYMETHOD_DOC_NOARGS(KX_SoundActuator, startSound); diff --git a/source/gameengine/Ketsji/KX_StateActuator.cpp b/source/gameengine/Ketsji/KX_StateActuator.cpp index 976e7ea5204..16512dc6699 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.cpp +++ b/source/gameengine/Ketsji/KX_StateActuator.cpp @@ -156,7 +156,11 @@ PyAttributeDef KX_StateActuator::Attributes[] = { PyObject* KX_StateActuator::py_getattro(PyObject *attr) { py_getattro_up(SCA_IActuator); -}; +} + +PyObject* KX_StateActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} int KX_StateActuator::py_setattro(PyObject *attr, PyObject* value) { diff --git a/source/gameengine/Ketsji/KX_StateActuator.h b/source/gameengine/Ketsji/KX_StateActuator.h index 4a64894259d..7e7056bd6af 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.h +++ b/source/gameengine/Ketsji/KX_StateActuator.h @@ -76,6 +76,7 @@ class KX_StateActuator : public SCA_IActuator /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject* value); //KX_PYMETHOD_DOC KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetOperation); diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 5a6e8e6f501..8995a0c198a 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -296,6 +296,10 @@ PyObject* KX_TouchSensor::py_getattro(PyObject *attr) py_getattro_up(SCA_ISensor); } +PyObject* KX_TouchSensor::py_getattro_dict() { + py_getattro_dict_up(SCA_ISensor); +} + int KX_TouchSensor::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_ISensor); diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index 15ef653c1b2..4bcc313b65b 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -121,6 +121,7 @@ public: /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); //Deprecated -----> diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index fbf43de6cf4..808bf0a55b5 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -509,6 +509,10 @@ PyObject* KX_TrackToActuator::py_getattro(PyObject *attr) py_getattro_up(SCA_IActuator); } +PyObject* KX_TrackToActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int KX_TrackToActuator::py_setattro(PyObject *attr, PyObject* value) { py_setattro_up(SCA_IActuator); diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.h b/source/gameengine/Ketsji/KX_TrackToActuator.h index 99505f93cfe..a17147c0842 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.h +++ b/source/gameengine/Ketsji/KX_TrackToActuator.h @@ -73,6 +73,7 @@ class KX_TrackToActuator : public SCA_IActuator /* Python part */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject* value); /* These are used to get and set m_ob */ diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp index 1a6fb196db5..5a0ec3515f6 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp @@ -303,6 +303,10 @@ PyObject* KX_VehicleWrapper::py_getattro(PyObject *attr) py_getattro_up(PyObjectPlus); } +PyObject* KX_VehicleWrapper::py_getattro_dict() { + py_getattro_dict_up(PyObjectPlus); +} + int KX_VehicleWrapper::py_setattro(PyObject *attr,PyObject* pyobj) { /* TODO - strange setattr, needs updating */ diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.h b/source/gameengine/Ketsji/KX_VehicleWrapper.h index de7fe75cfba..c2b5e3d9251 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.h +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.h @@ -13,6 +13,7 @@ class KX_VehicleWrapper : public PyObjectPlus { Py_Header; virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); std::vector m_motionStates; diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index 88f63334285..e5078bfa18b 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -159,6 +159,10 @@ KX_VertexProxy::py_getattro(PyObject *attr) py_getattro_up(SCA_IObject); } +PyObject* KX_VertexProxy::py_getattro_dict() { + py_getattro_dict_up(SCA_IObject); +} + int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) { char *attr_str= PyString_AsString(attr); diff --git a/source/gameengine/Ketsji/KX_VertexProxy.h b/source/gameengine/Ketsji/KX_VertexProxy.h index 67a15d96768..50fe6b27704 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.h +++ b/source/gameengine/Ketsji/KX_VertexProxy.h @@ -55,6 +55,7 @@ public: // stuff for python integration virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *pyvalue); KX_PYMETHOD_NOARGS(KX_VertexProxy,GetXYZ); diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp index ba59d0d3d47..9b1849511fe 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp @@ -143,6 +143,10 @@ PyObject* KX_VisibilityActuator::py_getattro(PyObject *attr) py_getattro_up(SCA_IActuator); } +PyObject* KX_VisibilityActuator::py_getattro_dict() { + py_getattro_dict_up(SCA_IActuator); +} + int KX_VisibilityActuator::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_IActuator); diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.h b/source/gameengine/Ketsji/KX_VisibilityActuator.h index 04633bce665..45aba50f645 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.h +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.h @@ -70,6 +70,7 @@ class KX_VisibilityActuator : public SCA_IActuator /* --------------------------------------------------------------------- */ virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); // Deprecated -----> -- cgit v1.2.3 From 720f7a8b6900787734d11cff396945f693961250 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 20 Apr 2009 23:27:53 +0000 Subject: use PyList_SET_ITEM instead of PyList_SetItem, PyList_SetItem does error checking and decref's existing values, PyList_SET_ITEM is a macro for direct assignment, only for use on new lists. --- source/gameengine/Expressions/PyObjectPlus.cpp | 8 +-- source/gameengine/GameLogic/SCA_KeyboardSensor.cpp | 2 +- source/gameengine/Ketsji/KX_ConstraintActuator.cpp | 6 +- source/gameengine/Ketsji/KX_ObjectActuator.cpp | 72 +++++++++++----------- source/gameengine/Ketsji/KX_PythonInit.cpp | 4 +- source/gameengine/Ketsji/KX_RadarSensor.cpp | 12 ++-- source/gameengine/Ketsji/KX_RaySensor.cpp | 18 +++--- 7 files changed, 61 insertions(+), 61 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index c4daaff2dd1..96753d56d94 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -240,14 +240,14 @@ PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef { bool *val = reinterpret_cast(ptr); ptr += sizeof(bool); - PyList_SetItem(resultlist,i,PyInt_FromLong(*val)); + PyList_SET_ITEM(resultlist,i,PyInt_FromLong(*val)); break; } case KX_PYATTRIBUTE_TYPE_SHORT: { short int *val = reinterpret_cast(ptr); ptr += sizeof(short int); - PyList_SetItem(resultlist,i,PyInt_FromLong(*val)); + PyList_SET_ITEM(resultlist,i,PyInt_FromLong(*val)); break; } case KX_PYATTRIBUTE_TYPE_ENUM: @@ -262,14 +262,14 @@ PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef { int *val = reinterpret_cast(ptr); ptr += sizeof(int); - PyList_SetItem(resultlist,i,PyInt_FromLong(*val)); + PyList_SET_ITEM(resultlist,i,PyInt_FromLong(*val)); break; } case KX_PYATTRIBUTE_TYPE_FLOAT: { float *val = reinterpret_cast(ptr); ptr += sizeof(float); - PyList_SetItem(resultlist,i,PyFloat_FromDouble(*val)); + PyList_SET_ITEM(resultlist,i,PyFloat_FromDouble(*val)); break; } default: diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index 96969dc6dc7..2048731f73c 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -694,7 +694,7 @@ PyObject* SCA_KeyboardSensor::pyattr_get_events(void *self_v, const KX_PYATTRIBU { PyObject* keypair = PyList_New(2); PyList_SET_ITEM(keypair,0,PyInt_FromLong(i)); - PyList_SetItem(keypair,1,PyInt_FromLong(inevent.m_status)); + PyList_SET_ITEM(keypair,1,PyInt_FromLong(inevent.m_status)); PyList_Append(resultlist,keypair); } } diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index 00fed43cbe8..34102132db8 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -754,9 +754,9 @@ PyObject* KX_ConstraintActuator::PyGetDirection(){ ShowDeprecationWarning("getDirection()", "the direction property"); PyObject *retVal = PyList_New(3); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_refDirection[0])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_refDirection[1])); - PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_refDirection[2])); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_refDirection[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_refDirection[1])); + PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_refDirection[2])); return retVal; } diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index c115a8f33bc..ed5539709e4 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -352,10 +352,10 @@ PyObject* KX_ObjectActuator::PyGetForce() { PyObject *retVal = PyList_New(4); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_force[0])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_force[1])); - PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_force[2])); - PyList_SetItem(retVal, 3, BoolToPyArg(m_bitLocalFlag.Force)); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_force[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_force[1])); + PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_force[2])); + PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.Force)); return retVal; } @@ -379,10 +379,10 @@ PyObject* KX_ObjectActuator::PyGetTorque() { PyObject *retVal = PyList_New(4); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_torque[0])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_torque[1])); - PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_torque[2])); - PyList_SetItem(retVal, 3, BoolToPyArg(m_bitLocalFlag.Torque)); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_torque[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_torque[1])); + PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_torque[2])); + PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.Torque)); return retVal; } @@ -406,10 +406,10 @@ PyObject* KX_ObjectActuator::PyGetDLoc() { PyObject *retVal = PyList_New(4); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_dloc[0])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_dloc[1])); - PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_dloc[2])); - PyList_SetItem(retVal, 3, BoolToPyArg(m_bitLocalFlag.DLoc)); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_dloc[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[1])); + PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_dloc[2])); + PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.DLoc)); return retVal; } @@ -433,10 +433,10 @@ PyObject* KX_ObjectActuator::PyGetDRot() { PyObject *retVal = PyList_New(4); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_drot[0])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_drot[1])); - PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_drot[2])); - PyList_SetItem(retVal, 3, BoolToPyArg(m_bitLocalFlag.DRot)); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_drot[1])); + PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_drot[2])); + PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.DRot)); return retVal; } @@ -459,10 +459,10 @@ PyObject* KX_ObjectActuator::PySetDRot(PyObject* args) PyObject* KX_ObjectActuator::PyGetLinearVelocity() { PyObject *retVal = PyList_New(4); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_linear_velocity[1])); - PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_linear_velocity[2])); - PyList_SetItem(retVal, 3, BoolToPyArg(m_bitLocalFlag.LinearVelocity)); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_linear_velocity[1])); + PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_linear_velocity[2])); + PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.LinearVelocity)); return retVal; } @@ -486,10 +486,10 @@ PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* args) { PyObject* KX_ObjectActuator::PyGetAngularVelocity() { PyObject *retVal = PyList_New(4); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_angular_velocity[1])); - PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_angular_velocity[2])); - PyList_SetItem(retVal, 3, BoolToPyArg(m_bitLocalFlag.AngularVelocity)); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_angular_velocity[1])); + PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_angular_velocity[2])); + PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.AngularVelocity)); return retVal; } @@ -526,9 +526,9 @@ PyObject* KX_ObjectActuator::PyGetForceLimitX() { PyObject *retVal = PyList_New(3); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_drot[0])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_dloc[0])); - PyList_SetItem(retVal, 2, BoolToPyArg(m_bitLocalFlag.Torque)); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[0])); + PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.Torque)); return retVal; } @@ -551,9 +551,9 @@ PyObject* KX_ObjectActuator::PyGetForceLimitY() { PyObject *retVal = PyList_New(3); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_drot[1])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_dloc[1])); - PyList_SetItem(retVal, 2, BoolToPyArg(m_bitLocalFlag.DLoc)); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[1])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[1])); + PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.DLoc)); return retVal; } @@ -576,9 +576,9 @@ PyObject* KX_ObjectActuator::PyGetForceLimitZ() { PyObject *retVal = PyList_New(3); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_drot[2])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_dloc[2])); - PyList_SetItem(retVal, 2, BoolToPyArg(m_bitLocalFlag.DRot)); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[2])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[2])); + PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.DRot)); return retVal; } @@ -601,9 +601,9 @@ PyObject* KX_ObjectActuator::PyGetPID() { PyObject *retVal = PyList_New(3); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_torque[0])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_torque[1])); - PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_torque[2])); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_torque[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_torque[1])); + PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_torque[2])); return retVal; } diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 9649e50a98b..873e49be6bb 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -216,13 +216,13 @@ static PyObject* gPyGetSpectrum(PyObject*) for (int index = 0; index < 512; index++) { - PyList_SetItem(resultlist, index, PyFloat_FromDouble(spectrum[index])); + PyList_SET_ITEM(resultlist, index, PyFloat_FromDouble(spectrum[index])); } } else { for (int index = 0; index < 512; index++) { - PyList_SetItem(resultlist, index, PyFloat_FromDouble(0.0)); + PyList_SET_ITEM(resultlist, index, PyFloat_FromDouble(0.0)); } } diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index d1075f9b296..d06728c1d4d 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -212,9 +212,9 @@ PyObject* KX_RadarSensor::PyGetConeOrigin() { PyObject *retVal = PyList_New(3); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_cone_origin[0])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_cone_origin[1])); - PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_cone_origin[2])); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_cone_origin[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_cone_origin[1])); + PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_cone_origin[2])); return retVal; } @@ -228,9 +228,9 @@ PyObject* KX_RadarSensor::PyGetConeTarget() { PyObject *retVal = PyList_New(3); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_cone_target[0])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_cone_target[1])); - PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_cone_target[2])); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_cone_target[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_cone_target[1])); + PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_cone_target[2])); return retVal; } diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index 360aa1a85a8..bee644b6a30 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -404,9 +404,9 @@ PyObject* KX_RaySensor::PyGetHitPosition() PyObject *retVal = PyList_New(3); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_hitPosition[0])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_hitPosition[1])); - PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_hitPosition[2])); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_hitPosition[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_hitPosition[1])); + PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_hitPosition[2])); return retVal; } @@ -420,9 +420,9 @@ PyObject* KX_RaySensor::PyGetRayDirection() PyObject *retVal = PyList_New(3); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_rayDirection[0])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_rayDirection[1])); - PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_rayDirection[2])); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_rayDirection[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_rayDirection[1])); + PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_rayDirection[2])); return retVal; } @@ -436,9 +436,9 @@ PyObject* KX_RaySensor::PyGetHitNormal() PyObject *retVal = PyList_New(3); - PyList_SetItem(retVal, 0, PyFloat_FromDouble(m_hitNormal[0])); - PyList_SetItem(retVal, 1, PyFloat_FromDouble(m_hitNormal[1])); - PyList_SetItem(retVal, 2, PyFloat_FromDouble(m_hitNormal[2])); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_hitNormal[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_hitNormal[1])); + PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_hitNormal[2])); return retVal; } -- cgit v1.2.3 From 70dae5f49339a791c1c84d72047cde144e4e2843 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 21 Apr 2009 01:59:14 +0000 Subject: [#18557] incorrect alpha IPO behavior in game engine from Louis-Dominique Dubeau (zenoparadox) report contained fix, ancient bug from rev2. --- source/blender/blenkernel/intern/ipo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 29db0ddd808..0077cf95262 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -2876,7 +2876,7 @@ float IPO_GetFloatValue (Ipo *ipo, IPO_Channel channel, float ctime) calc_ipo_spec(ipo, channel, &ctime); /* unapply rotation hack, as gameengine doesn't use it */ - if ((OB_ROT_X <= channel) && (channel <= OB_DROT_Z)) + if ((ipo->blocktype == ID_OB) && (OB_ROT_X <= channel) && (channel <= OB_DROT_Z)) ctime *= (float)(M_PI_2/9.0); /* return the value of this channel */ -- cgit v1.2.3 From 2d054e00b068786996f9154e378e75f436eca239 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 21 Apr 2009 07:16:29 +0000 Subject: Blender Python API use getseter's for quat and euler types attributes, python3 compatible module initialization for Mathutils and BGL. --- source/blender/python/api2_2x/BGL.c | 22 ++- source/blender/python/api2_2x/Mathutils.c | 20 +++ source/blender/python/api2_2x/euler.c | 147 ++++++++++-------- source/blender/python/api2_2x/quat.c | 248 +++++++++++++++++------------- source/blender/python/api2_2x/vector.c | 15 +- source/blender/python/api2_2x/vector.h | 2 +- 6 files changed, 270 insertions(+), 184 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/BGL.c b/source/blender/python/api2_2x/BGL.c index cfbb4611c6c..ddb12eb2338 100644 --- a/source/blender/python/api2_2x/BGL.c +++ b/source/blender/python/api2_2x/BGL.c @@ -1085,9 +1085,29 @@ static struct PyMethodDef BGL_methods[] = { {NULL, NULL, 0, NULL} }; +#if (PY_VERSION_HEX >= 0x03000000) +static struct PyModuleDef BGL_module_def = { + {}, /* m_base */ + "BGL", /* m_name */ + 0, /* m_doc */ + 0, /* m_size */ + BGL_methods, /* m_methods */ + 0, /* m_reload */ + 0, /* m_traverse */ + 0, /* m_clear */ + 0, /* m_free */ +}; +#endif + PyObject *BGL_Init(const char *from) { - PyObject *mod= Py_InitModule(from, BGL_methods); + PyObject *mod; +#if (PY_VERSION_HEX >= 0x03000000) + mod = PyModule_Create(&BGL_module_def); +#else + mod= Py_InitModule(from, BGL_methods); +#endif + PyObject *dict= PyModule_GetDict(mod); PyObject *item; if( PyType_Ready( &buffer_Type) < 0) diff --git a/source/blender/python/api2_2x/Mathutils.c b/source/blender/python/api2_2x/Mathutils.c index b370aa0e1e8..605b5982137 100644 --- a/source/blender/python/api2_2x/Mathutils.c +++ b/source/blender/python/api2_2x/Mathutils.c @@ -108,6 +108,21 @@ struct PyMethodDef M_Mathutils_methods[] = { }; /*----------------------------MODULE INIT-------------------------*/ /* from can be Blender.Mathutils or GameLogic.Mathutils for the BGE */ + +#if (PY_VERSION_HEX >= 0x03000000) +static struct PyModuleDef M_Mathutils_module_def = { + {}, /* m_base */ + "Mathutils", /* m_name */ + M_Mathutils_doc, /* m_doc */ + 0, /* m_size */ + M_Mathutils_methods, /* m_methods */ + 0, /* m_reload */ + 0, /* m_traverse */ + 0, /* m_clear */ + 0, /* m_free */ +}; +#endif + PyObject *Mathutils_Init(const char *from) { PyObject *submodule; @@ -126,7 +141,12 @@ PyObject *Mathutils_Init(const char *from) if( PyType_Ready( &quaternion_Type ) < 0 ) return NULL; +#if (PY_VERSION_HEX >= 0x03000000) + submodule = PyModule_Create(&M_Mathutils_module_def); +#else submodule = Py_InitModule3(from, M_Mathutils_methods, M_Mathutils_doc); +#endif + return (submodule); } //-----------------------------METHODS---------------------------- diff --git a/source/blender/python/api2_2x/euler.c b/source/blender/python/api2_2x/euler.c index e349dd26532..52f1e00221e 100644 --- a/source/blender/python/api2_2x/euler.c +++ b/source/blender/python/api2_2x/euler.c @@ -189,71 +189,13 @@ static void Euler_dealloc(EulerObject * self) } PyObject_DEL(self); } -//----------------------------getattr()(internal) ------------------ -//object.attribute access (get) -static PyObject *Euler_getattr(EulerObject * self, char *name) -{ - if(STREQ(name,"x")){ - return PyFloat_FromDouble(self->eul[0]); - }else if(STREQ(name, "y")){ - return PyFloat_FromDouble(self->eul[1]); - }else if(STREQ(name, "z")){ - return PyFloat_FromDouble(self->eul[2]); - } - if(STREQ(name, "wrapped")){ - if(self->wrapped == Py_WRAP) - return EXPP_incr_ret((PyObject *)Py_True); - else - return EXPP_incr_ret((PyObject *)Py_False); - } - return Py_FindMethod(Euler_methods, (PyObject *) self, name); -} -//----------------------------setattr()(internal) ------------------ -//object.attribute access (set) -static int Euler_setattr(EulerObject * self, char *name, PyObject * e) -{ - PyObject *f = NULL; - - f = PyNumber_Float(e); - if(f == NULL) { // parsed item not a number - return EXPP_ReturnIntError(PyExc_TypeError, - "euler.attribute = x: argument not a number\n"); - } - - if(STREQ(name,"x")){ - self->eul[0] = (float)PyFloat_AS_DOUBLE(f); - }else if(STREQ(name, "y")){ - self->eul[1] = (float)PyFloat_AS_DOUBLE(f); - }else if(STREQ(name, "z")){ - self->eul[2] = (float)PyFloat_AS_DOUBLE(f); - }else{ - Py_DECREF(f); - return EXPP_ReturnIntError(PyExc_AttributeError, - "euler.attribute = x: unknown attribute\n"); - } - Py_DECREF(f); - return 0; -} //----------------------------print object (internal)-------------- //print the object to screen static PyObject *Euler_repr(EulerObject * self) { - int i; - char buffer[48], str[1024]; - - BLI_strncpy(str,"[",1024); - for(i = 0; i < 3; i++){ - if(i < (2)){ - sprintf(buffer, "%.6f, ", self->eul[i]); - strcat(str,buffer); - }else{ - sprintf(buffer, "%.6f", self->eul[i]); - strcat(str,buffer); - } - } - strcat(str, "](euler)"); - + char str[64]; + sprintf(str, "[%.6f, %.6f, %.6f](euler)", self->eul[0], self->eul[1], self->eul[2]); return PyString_FromString(str); } //------------------------tp_richcmpr @@ -409,6 +351,83 @@ static PySequenceMethods Euler_SeqMethods = { (intobjargproc) Euler_ass_item, /* sq_ass_item */ (intintobjargproc) Euler_ass_slice, /* sq_ass_slice */ }; + + + +/* + * vector axis, vector.x/y/z/w + */ + +static PyObject *Euler_getAxis( EulerObject * self, void *type ) +{ + switch( (long)type ) { + case 'X': /* these are backwards, but that how it works */ + return PyFloat_FromDouble(self->eul[0]); + case 'Y': + return PyFloat_FromDouble(self->eul[1]); + case 'Z': + return PyFloat_FromDouble(self->eul[2]); + } + + PyErr_SetString(PyExc_SystemError, "corrupt euler, cannot get axis"); + return NULL; +} + +static int Euler_setAxis( EulerObject * self, PyObject * value, void * type ) +{ + float param= (float)PyFloat_AsDouble( value ); + + if (param==-1 && PyErr_Occurred()) + return EXPP_ReturnIntError( PyExc_TypeError, + "expected a number for the vector axis" ); + + switch( (long)type ) { + case 'X': /* these are backwards, but that how it works */ + self->eul[0]= param; + break; + case 'Y': + self->eul[1]= param; + break; + case 'Z': + self->eul[2]= param; + break; + } + + return 0; +} + +static PyObject *Euler_getWrapped( VectorObject * self, void *type ) +{ + if (self->wrapped == Py_WRAP) + Py_RETURN_TRUE; + else + Py_RETURN_FALSE; +} + + +/*****************************************************************************/ +/* Python attributes get/set structure: */ +/*****************************************************************************/ +static PyGetSetDef Euler_getseters[] = { + {"x", + (getter)Euler_getAxis, (setter)Euler_setAxis, + "Euler X axis", + (void *)'X'}, + {"y", + (getter)Euler_getAxis, (setter)Euler_setAxis, + "Euler Y axis", + (void *)'Y'}, + {"z", + (getter)Euler_getAxis, (setter)Euler_setAxis, + "Euler Z axis", + (void *)'Z'}, + {"wrapped", + (getter)Euler_getWrapped, (setter)NULL, + "True when this wraps blenders internal data", + NULL}, + {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ +}; + //------------------PY_OBECT DEFINITION-------------------------- PyTypeObject euler_Type = { PyObject_HEAD_INIT(NULL) //tp_head @@ -418,8 +437,8 @@ PyTypeObject euler_Type = { 0, //tp_itemsize (destructor)Euler_dealloc, //tp_dealloc 0, //tp_print - (getattrfunc)Euler_getattr, //tp_getattr - (setattrfunc) Euler_setattr, //tp_setattr + 0, //tp_getattr + 0, //tp_setattr 0, //tp_compare (reprfunc) Euler_repr, //tp_repr 0, //tp_as_number @@ -439,9 +458,9 @@ PyTypeObject euler_Type = { 0, //tp_weaklistoffset 0, //tp_iter 0, //tp_iternext - 0, //tp_methods + Euler_methods, //tp_methods 0, //tp_members - 0, //tp_getset + Euler_getseters, //tp_getset 0, //tp_base 0, //tp_dict 0, //tp_descr_get diff --git a/source/blender/python/api2_2x/quat.c b/source/blender/python/api2_2x/quat.c index 7cfc1a7cde8..1871339d0b8 100644 --- a/source/blender/python/api2_2x/quat.c +++ b/source/blender/python/api2_2x/quat.c @@ -155,109 +155,13 @@ static void Quaternion_dealloc(QuaternionObject * self) } PyObject_DEL(self); } -//----------------------------getattr()(internal) ------------------ -//object.attribute access (get) -static PyObject *Quaternion_getattr(QuaternionObject * self, char *name) -{ - int x; - double mag = 0.0f; - float vec[3]; - - if(STREQ(name,"w")){ - return PyFloat_FromDouble(self->quat[0]); - }else if(STREQ(name, "x")){ - return PyFloat_FromDouble(self->quat[1]); - }else if(STREQ(name, "y")){ - return PyFloat_FromDouble(self->quat[2]); - }else if(STREQ(name, "z")){ - return PyFloat_FromDouble(self->quat[3]); - } - if(STREQ(name, "magnitude")) { - for(x = 0; x < 4; x++) { - mag += self->quat[x] * self->quat[x]; - } - mag = sqrt(mag); - return PyFloat_FromDouble(mag); - } - if(STREQ(name, "angle")) { - mag = self->quat[0]; - mag = 2 * (saacos(mag)); - mag *= (180 / Py_PI); - return PyFloat_FromDouble(mag); - } - if(STREQ(name, "axis")) { - mag = self->quat[0] * (Py_PI / 180); - mag = 2 * (saacos(mag)); - mag = sin(mag / 2); - for(x = 0; x < 3; x++) { - vec[x] = (float)(self->quat[x + 1] / mag); - } - Normalize(vec); - //If the axis of rotation is 0,0,0 set it to 1,0,0 - for zero-degree rotations - if( EXPP_FloatsAreEqual(vec[0], 0.0f, 10) && - EXPP_FloatsAreEqual(vec[1], 0.0f, 10) && - EXPP_FloatsAreEqual(vec[2], 0.0f, 10) ){ - vec[0] = 1.0f; - } - return (PyObject *) newVectorObject(vec, 3, Py_NEW); - } - if(STREQ(name, "wrapped")){ - if(self->wrapped == Py_WRAP) - return EXPP_incr_ret((PyObject *)Py_True); - else - return EXPP_incr_ret((PyObject *)Py_False); - } - - return Py_FindMethod(Quaternion_methods, (PyObject *) self, name); -} -//----------------------------setattr()(internal) ------------------ -//object.attribute access (set) -static int Quaternion_setattr(QuaternionObject * self, char *name, PyObject * q) -{ - PyObject *f = NULL; - - f = PyNumber_Float(q); - if(f == NULL) { // parsed item not a number - return EXPP_ReturnIntError(PyExc_TypeError, - "quaternion.attribute = x: argument not a number\n"); - } - if(STREQ(name,"w")){ - self->quat[0] = (float)PyFloat_AS_DOUBLE(f); - }else if(STREQ(name, "x")){ - self->quat[1] = (float)PyFloat_AS_DOUBLE(f); - }else if(STREQ(name, "y")){ - self->quat[2] = (float)PyFloat_AS_DOUBLE(f); - }else if(STREQ(name, "z")){ - self->quat[3] = (float)PyFloat_AS_DOUBLE(f); - }else{ - Py_DECREF(f); - return EXPP_ReturnIntError(PyExc_AttributeError, - "quaternion.attribute = x: unknown attribute\n"); - } - - Py_DECREF(f); - return 0; -} //----------------------------print object (internal)-------------- //print the object to screen static PyObject *Quaternion_repr(QuaternionObject * self) { - int i; - char buffer[48], str[1024]; - - BLI_strncpy(str,"[",1024); - for(i = 0; i < 4; i++){ - if(i < (3)){ - sprintf(buffer, "%.6f, ", self->quat[i]); - strcat(str,buffer); - }else{ - sprintf(buffer, "%.6f", self->quat[i]); - strcat(str,buffer); - } - } - strcat(str, "](quaternion)"); - + char str[64]; + sprintf(str, "[%.6f, %.6f, %.6f, %.6f](quaternion)", self->quat[0], self->quat[1], self->quat[2], self->quat[3]); return PyString_FromString(str); } //------------------------tp_richcmpr @@ -269,9 +173,9 @@ static PyObject* Quaternion_richcmpr(PyObject *objectA, PyObject *objectB, int c if (!QuaternionObject_Check(objectA) || !QuaternionObject_Check(objectB)){ if (comparison_type == Py_NE){ - return EXPP_incr_ret(Py_True); + Py_RETURN_TRUE; }else{ - return EXPP_incr_ret(Py_False); + Py_RETURN_FALSE; } } quatA = (QuaternionObject*)objectA; @@ -294,9 +198,9 @@ static PyObject* Quaternion_richcmpr(PyObject *objectA, PyObject *objectB, int c break; } if (result == 1){ - return EXPP_incr_ret(Py_True); + Py_RETURN_TRUE; }else{ - return EXPP_incr_ret(Py_False); + Py_RETURN_FALSE; } } //------------------------tp_doc @@ -576,6 +480,138 @@ static PyNumberMethods Quaternion_NumMethods = { (unaryfunc) 0, /* __hex__ */ }; + + +static PyObject *Quaternion_getAxis( QuaternionObject * self, void *type ) +{ + switch( (long)type ) { + case 'W': + return PyFloat_FromDouble(self->quat[0]); + case 'X': + return PyFloat_FromDouble(self->quat[1]); + case 'Y': + return PyFloat_FromDouble(self->quat[2]); + case 'Z': + return PyFloat_FromDouble(self->quat[3]); + } + + PyErr_SetString(PyExc_SystemError, "corrupt quaternion, cannot get axis"); + return NULL; +} + +static int Quaternion_setAxis( QuaternionObject * self, PyObject * value, void * type ) +{ + float param= (float)PyFloat_AsDouble( value ); + + if (param==-1 && PyErr_Occurred()) + return EXPP_ReturnIntError( PyExc_TypeError, + "expected a number for the vector axis" ); + + switch( (long)type ) { + case 'W': + self->quat[0]= param; + break; + case 'X': + self->quat[1]= param; + break; + case 'Y': + self->quat[2]= param; + break; + case 'Z': + self->quat[3]= param; + break; + } + + return 0; +} + +static PyObject *Quaternion_getWrapped( QuaternionObject * self, void *type ) +{ + if (self->wrapped == Py_WRAP) + Py_RETURN_TRUE; + else + Py_RETURN_FALSE; +} + +static PyObject *Quaternion_getMagnitude( QuaternionObject * self, void *type ) +{ + double mag = 0.0; + int i; + for(i = 0; i < 4; i++) { + mag += self->quat[i] * self->quat[i]; + } + return PyFloat_FromDouble(sqrt(mag)); +} + +static PyObject *Quaternion_getAngle( QuaternionObject * self, void *type ) +{ + double ang = self->quat[0]; + ang = 2 * (saacos(ang)); + ang *= (180 / Py_PI); + return PyFloat_FromDouble(ang); +} + +static PyObject *Quaternion_getAxisVec( QuaternionObject * self, void *type ) +{ + int i; + float vec[3]; + double mag = self->quat[0] * (Py_PI / 180); + mag = 2 * (saacos(mag)); + mag = sin(mag / 2); + for(i = 0; i < 3; i++) + vec[i] = (float)(self->quat[i + 1] / mag); + + Normalize(vec); + //If the axis of rotation is 0,0,0 set it to 1,0,0 - for zero-degree rotations + if( EXPP_FloatsAreEqual(vec[0], 0.0f, 10) && + EXPP_FloatsAreEqual(vec[1], 0.0f, 10) && + EXPP_FloatsAreEqual(vec[2], 0.0f, 10) ){ + vec[0] = 1.0f; + } + return (PyObject *) newVectorObject(vec, 3, Py_NEW); +} + + +/*****************************************************************************/ +/* Python attributes get/set structure: */ +/*****************************************************************************/ +static PyGetSetDef Quaternion_getseters[] = { + {"w", + (getter)Quaternion_getAxis, (setter)Quaternion_setAxis, + "Quaternion W value", + (void *)'W'}, + {"x", + (getter)Quaternion_getAxis, (setter)Quaternion_setAxis, + "Quaternion X axis", + (void *)'X'}, + {"y", + (getter)Quaternion_getAxis, (setter)Quaternion_setAxis, + "Quaternion Y axis", + (void *)'Y'}, + {"z", + (getter)Quaternion_getAxis, (setter)Quaternion_setAxis, + "Quaternion Z axis", + (void *)'Z'}, + {"magnitude", + (getter)Quaternion_getMagnitude, (setter)NULL, + "Size of the quaternion", + NULL}, + {"angle", + (getter)Quaternion_getAngle, (setter)NULL, + "angle of the quaternion", + NULL}, + {"axis", + (getter)Quaternion_getAxisVec, (setter)NULL, + "quaternion axis as a vector", + NULL}, + {"wrapped", + (getter)Quaternion_getWrapped, (setter)NULL, + "True when this wraps blenders internal data", + NULL}, + {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ +}; + + //------------------PY_OBECT DEFINITION-------------------------- PyTypeObject quaternion_Type = { PyObject_HEAD_INIT(NULL) //tp_head @@ -585,8 +621,8 @@ PyObject_HEAD_INIT(NULL) //tp_head 0, //tp_itemsize (destructor)Quaternion_dealloc, //tp_dealloc 0, //tp_print - (getattrfunc)Quaternion_getattr, //tp_getattr - (setattrfunc) Quaternion_setattr, //tp_setattr + 0, //tp_getattr + 0, //tp_setattr 0, //tp_compare (reprfunc) Quaternion_repr, //tp_repr &Quaternion_NumMethods, //tp_as_number @@ -606,9 +642,9 @@ PyObject_HEAD_INIT(NULL) //tp_head 0, //tp_weaklistoffset 0, //tp_iter 0, //tp_iternext - 0, //tp_methods + Quaternion_methods, //tp_methods 0, //tp_members - 0, //tp_getset + Quaternion_getseters, //tp_getset 0, //tp_base 0, //tp_dict 0, //tp_descr_get diff --git a/source/blender/python/api2_2x/vector.c b/source/blender/python/api2_2x/vector.c index fe28f0fac42..8f2e8991519 100644 --- a/source/blender/python/api2_2x/vector.c +++ b/source/blender/python/api2_2x/vector.c @@ -1026,14 +1026,12 @@ static PyObject *Vector_getAxis( VectorObject * self, void *type ) static int Vector_setAxis( VectorObject * self, PyObject * value, void * type ) { - float param; + float param= (float)PyFloat_AsDouble( value ); - if (!PyNumber_Check(value)) + if (param==-1 && PyErr_Occurred()) return EXPP_ReturnIntError( PyExc_TypeError, "expected a number for the vector axis" ); - param= (float)PyFloat_AsDouble( value ); - switch( (long)type ) { case 'X': /* these are backwards, but that how it works */ self->vec[0]= param; @@ -1054,13 +1052,6 @@ static int Vector_setAxis( VectorObject * self, PyObject * value, void * type ) self->vec[3]= param; break; - default: - { - char errstr[1024]; - sprintf( errstr, "undefined type '%d' in Vector_setAxis", - (int)((long)type & 0xff)); - return EXPP_ReturnIntError( PyExc_RuntimeError, errstr ); - } } return 0; @@ -1160,7 +1151,7 @@ static PyGetSetDef Vector_getseters[] = { NULL}, {"wrapped", (getter)Vector_getWrapped, (setter)NULL, - "Vector Length", + "True when this wraps blenders internal data", NULL}, {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ }; diff --git a/source/blender/python/api2_2x/vector.h b/source/blender/python/api2_2x/vector.h index 61b50d5f458..898e3947abd 100644 --- a/source/blender/python/api2_2x/vector.h +++ b/source/blender/python/api2_2x/vector.h @@ -34,7 +34,7 @@ extern PyTypeObject vector_Type; -#define VectorObject_Check(v) ((v)->ob_type == &vector_Type) +#define VectorObject_Check(v) (((PyObject *)v)->ob_type == &vector_Type) typedef struct { PyObject_VAR_HEAD -- cgit v1.2.3 From 106b5a435c3f10666240fccf3b7d059d54e7be89 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Tue, 21 Apr 2009 09:20:47 +0000 Subject: BGE: show profile in millisecond in addition to percentage. --- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 83a2fa8a448..4cfe3339631 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -1401,7 +1401,7 @@ void KX_KetsjiEngine::RenderDebugProperties() m_canvas->GetWidth(), m_canvas->GetHeight()); double time = m_logger->GetAverage((KX_TimeCategory)j); - debugtxt.Format("%2.2f %%", time/tottime * 100.f); + debugtxt.Format("%.3fms (%2.2f %%)", time*1000.f, time/tottime * 100.f); m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED, debugtxt.Ptr(), xcoord + 60 ,ycoord, -- cgit v1.2.3 From 6c5e18ca98de0dfa2fd64c7a74258c207371298b Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Tue, 21 Apr 2009 09:38:27 +0000 Subject: Fix compilation error in MSVC. --- source/blender/python/api2_2x/BGL.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/BGL.c b/source/blender/python/api2_2x/BGL.c index ddb12eb2338..7735f2b444f 100644 --- a/source/blender/python/api2_2x/BGL.c +++ b/source/blender/python/api2_2x/BGL.c @@ -1101,15 +1101,14 @@ static struct PyModuleDef BGL_module_def = { PyObject *BGL_Init(const char *from) { - PyObject *mod; + PyObject *mod, *dict, *item; #if (PY_VERSION_HEX >= 0x03000000) mod = PyModule_Create(&BGL_module_def); #else mod= Py_InitModule(from, BGL_methods); #endif + dict= PyModule_GetDict(mod); - PyObject *dict= PyModule_GetDict(mod); - PyObject *item; if( PyType_Ready( &buffer_Type) < 0) return NULL; /* should never happen */ -- cgit v1.2.3 From 3e7cbd5388426a612b4066fbe7f2964c976fb23e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 21 Apr 2009 09:44:29 +0000 Subject: Blender Python API - Removed the gen_utils.c dependency from Mathutils (since gen_utils wont go into 2.5 but mathutils will), repalced with python functions. - removed Blender.Mathutils.Point, since it was not documented, the C api never used it, none of our scripts used it (and I never saw a script that used it). --- source/blender/blenkernel/BKE_scene.h | 1 + source/blender/python/BPY_interface.c | 1 + source/blender/python/api2_2x/Geometry.h | 2 +- source/blender/python/api2_2x/Group.c | 2 +- source/blender/python/api2_2x/Key.c | 2 +- source/blender/python/api2_2x/Mathutils.c | 183 ++----- source/blender/python/api2_2x/Mathutils.h | 25 +- source/blender/python/api2_2x/Node.c | 2 +- source/blender/python/api2_2x/Scene.c | 2 +- source/blender/python/api2_2x/Texture.c | 2 +- source/blender/python/api2_2x/Types.c | 4 - source/blender/python/api2_2x/euler.c | 93 ++-- source/blender/python/api2_2x/gen_utils.c | 32 +- source/blender/python/api2_2x/gen_utils.h | 9 +- source/blender/python/api2_2x/matrix.c | 233 ++++----- source/blender/python/api2_2x/point.c | 523 --------------------- source/blender/python/api2_2x/point.h | 64 --- source/blender/python/api2_2x/quat.c | 97 ++-- source/blender/python/api2_2x/vector.c | 386 +++++++-------- source/blender/python/api2_2x/vector.h | 1 - .../blender/render/intern/source/convertblender.c | 1 - source/gameengine/Ketsji/CMakeLists.txt | 2 - source/gameengine/Ketsji/SConscript | 2 - 23 files changed, 467 insertions(+), 1202 deletions(-) delete mode 100644 source/blender/python/api2_2x/point.c delete mode 100644 source/blender/python/api2_2x/point.h (limited to 'source') diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index 2c3ef42c021..647f7e95fd9 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -35,6 +35,7 @@ struct bglMats; struct Scene; struct Object; struct Base; +struct Text; struct AviCodecData; struct QuicktimeCodecData; struct SculptData; diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index ea3d6a54162..d86c317ee7e 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -70,6 +70,7 @@ #include "api2_2x/Object.h" #include "api2_2x/Registry.h" #include "api2_2x/Pose.h" +#include "api2_2x/Mathutils.h" #include "api2_2x/bpy.h" /* for the new "bpy" module */ #include "api2_2x/bpy_internal_import.h" diff --git a/source/blender/python/api2_2x/Geometry.h b/source/blender/python/api2_2x/Geometry.h index d7de9561078..e9e365cc9ae 100644 --- a/source/blender/python/api2_2x/Geometry.h +++ b/source/blender/python/api2_2x/Geometry.h @@ -32,7 +32,7 @@ #define EXPP_Geometry_H #include -#include "vector.h" +#include "Mathutils.h" PyObject *Geometry_Init( void ); diff --git a/source/blender/python/api2_2x/Group.c b/source/blender/python/api2_2x/Group.c index 0998053e7e1..eefa6fe58d6 100644 --- a/source/blender/python/api2_2x/Group.c +++ b/source/blender/python/api2_2x/Group.c @@ -46,7 +46,7 @@ #include "gen_utils.h" #include "gen_library.h" -#include "vector.h" +#include "Mathutils.h" /* checks for the group being removed */ #define GROUP_DEL_CHECK_PY(bpy_group) if (!(bpy_group->group)) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "Group has been removed" ) ) diff --git a/source/blender/python/api2_2x/Key.c b/source/blender/python/api2_2x/Key.c index 856dabdde74..45a68bfa0e6 100644 --- a/source/blender/python/api2_2x/Key.c +++ b/source/blender/python/api2_2x/Key.c @@ -29,7 +29,7 @@ */ #include "Key.h" /*This must come first*/ -#include "vector.h" +#include "Mathutils.h" #include "DNA_scene_types.h" diff --git a/source/blender/python/api2_2x/Mathutils.c b/source/blender/python/api2_2x/Mathutils.c index 605b5982137..c85d781f4dd 100644 --- a/source/blender/python/api2_2x/Mathutils.c +++ b/source/blender/python/api2_2x/Mathutils.c @@ -69,7 +69,6 @@ static char M_Mathutils_TriangleArea_doc[] = "(v1, v2, v3) - returns the area si static char M_Mathutils_TriangleNormal_doc[] = "(v1, v2, v3) - returns the normal of the 3D triangle defined"; static char M_Mathutils_QuadNormal_doc[] = "(v1, v2, v3, v4) - returns the normal of the 3D quad defined"; static char M_Mathutils_LineIntersect_doc[] = "(v1, v2, v3, v4) - returns a tuple with the points on each line respectively closest to the other"; -static char M_Mathutils_Point_doc[] = "Creates a 2d or 3d point object"; //-----------------------METHOD DEFINITIONS ---------------------- struct PyMethodDef M_Mathutils_methods[] = { {"Rand", (PyCFunction) M_Mathutils_Rand, METH_VARARGS, M_Mathutils_Rand_doc}, @@ -103,7 +102,6 @@ struct PyMethodDef M_Mathutils_methods[] = { {"TriangleNormal", ( PyCFunction ) M_Mathutils_TriangleNormal, METH_VARARGS, M_Mathutils_TriangleNormal_doc}, {"QuadNormal", ( PyCFunction ) M_Mathutils_QuadNormal, METH_VARARGS, M_Mathutils_QuadNormal_doc}, {"LineIntersect", ( PyCFunction ) M_Mathutils_LineIntersect, METH_VARARGS, M_Mathutils_LineIntersect_doc}, - {"Point", (PyCFunction) M_Mathutils_Point, METH_VARARGS, M_Mathutils_Point_doc}, {NULL, NULL, 0, NULL} }; /*----------------------------MODULE INIT-------------------------*/ @@ -184,36 +182,7 @@ PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec) } return newVectorObject(vecNew, vec->size, Py_NEW); } -//This is a helper for point/matrix translation -PyObject *column_point_multiplication(MatrixObject * mat, PointObject* pt) -{ - float ptNew[4], ptCopy[4]; - double dot = 0.0f; - int x, y, z = 0; - - if(mat->rowSize != pt->size){ - if(mat->rowSize == 4 && pt->size != 3){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "matrix * point: matrix row size and point size must be the same\n"); - }else{ - ptCopy[3] = 0.0f; - } - } - - for(x = 0; x < pt->size; x++){ - ptCopy[x] = pt->coord[x]; - } - - for(x = 0; x < mat->rowSize; x++) { - for(y = 0; y < mat->colSize; y++) { - dot += mat->matrix[x][y] * ptCopy[y]; - } - ptNew[z++] = (float)dot; - dot = 0.0f; - } - return newPointObject(ptNew, pt->size, Py_NEW); -} //-----------------row_vector_multiplication (internal)----------- //ROW VECTOR Multiplication - Vector X Matrix //[x][y][z] * [1][2][3] @@ -249,36 +218,7 @@ PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat) } return newVectorObject(vecNew, vec_size, Py_NEW); } -//This is a helper for the point class -PyObject *row_point_multiplication(PointObject* pt, MatrixObject * mat) -{ - float ptNew[4], ptCopy[4]; - double dot = 0.0f; - int x, y, z = 0, size; - if(mat->colSize != pt->size){ - if(mat->rowSize == 4 && pt->size != 3){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "point * matrix: matrix column size and the point size must be the same\n"); - }else{ - ptCopy[3] = 0.0f; - } - } - size = pt->size; - for(x = 0; x < pt->size; x++){ - ptCopy[x] = pt->coord[x]; - } - - //muliplication - for(x = 0; x < mat->colSize; x++) { - for(y = 0; y < mat->rowSize; y++) { - dot += mat->matrix[y][x] * ptCopy[y]; - } - ptNew[z++] = (float)dot; - dot = 0.0f; - } - return newPointObject(ptNew, size, Py_NEW); -} //-----------------quat_rotation (internal)----------- //This function multiplies a vector/point * quat or vice versa //to rotate the point/vector by the quaternion @@ -288,7 +228,6 @@ PyObject *quat_rotation(PyObject *arg1, PyObject *arg2) float rot[3]; QuaternionObject *quat = NULL; VectorObject *vec = NULL; - PointObject *pt = NULL; if(QuaternionObject_Check(arg1)){ quat = (QuaternionObject*)arg1; @@ -307,21 +246,6 @@ PyObject *quat_rotation(PyObject *arg1, PyObject *arg2) quat->quat[2]*quat->quat[2]*vec->vec[2] + 2*quat->quat[0]*quat->quat[1]*vec->vec[1] - quat->quat[1]*quat->quat[1]*vec->vec[2] + quat->quat[0]*quat->quat[0]*vec->vec[2]; return newVectorObject(rot, 3, Py_NEW); - }else if(PointObject_Check(arg2)){ - pt = (PointObject*)arg2; - rot[0] = quat->quat[0]*quat->quat[0]*pt->coord[0] + 2*quat->quat[2]*quat->quat[0]*pt->coord[2] - - 2*quat->quat[3]*quat->quat[0]*pt->coord[1] + quat->quat[1]*quat->quat[1]*pt->coord[0] + - 2*quat->quat[2]*quat->quat[1]*pt->coord[1] + 2*quat->quat[3]*quat->quat[1]*pt->coord[2] - - quat->quat[3]*quat->quat[3]*pt->coord[0] - quat->quat[2]*quat->quat[2]*pt->coord[0]; - rot[1] = 2*quat->quat[1]*quat->quat[2]*pt->coord[0] + quat->quat[2]*quat->quat[2]*pt->coord[1] + - 2*quat->quat[3]*quat->quat[2]*pt->coord[2] + 2*quat->quat[0]*quat->quat[3]*pt->coord[0] - - quat->quat[3]*quat->quat[3]*pt->coord[1] + quat->quat[0]*quat->quat[0]*pt->coord[1] - - 2*quat->quat[1]*quat->quat[0]*pt->coord[2] - quat->quat[1]*quat->quat[1]*pt->coord[1]; - rot[2] = 2*quat->quat[1]*quat->quat[3]*pt->coord[0] + 2*quat->quat[2]*quat->quat[3]*pt->coord[1] + - quat->quat[3]*quat->quat[3]*pt->coord[2] - 2*quat->quat[0]*quat->quat[2]*pt->coord[0] - - quat->quat[2]*quat->quat[2]*pt->coord[2] + 2*quat->quat[0]*quat->quat[1]*pt->coord[1] - - quat->quat[1]*quat->quat[1]*pt->coord[2] + quat->quat[0]*quat->quat[0]*pt->coord[2]; - return newPointObject(rot, 3, Py_NEW); } }else if(VectorObject_Check(arg1)){ vec = (VectorObject*)arg1; @@ -341,24 +265,6 @@ PyObject *quat_rotation(PyObject *arg1, PyObject *arg2) quat->quat[1]*quat->quat[1]*vec->vec[2] + quat->quat[0]*quat->quat[0]*vec->vec[2]; return newVectorObject(rot, 3, Py_NEW); } - }else if(PointObject_Check(arg1)){ - pt = (PointObject*)arg1; - if(QuaternionObject_Check(arg2)){ - quat = (QuaternionObject*)arg2; - rot[0] = quat->quat[0]*quat->quat[0]*pt->coord[0] + 2*quat->quat[2]*quat->quat[0]*pt->coord[2] - - 2*quat->quat[3]*quat->quat[0]*pt->coord[1] + quat->quat[1]*quat->quat[1]*pt->coord[0] + - 2*quat->quat[2]*quat->quat[1]*pt->coord[1] + 2*quat->quat[3]*quat->quat[1]*pt->coord[2] - - quat->quat[3]*quat->quat[3]*pt->coord[0] - quat->quat[2]*quat->quat[2]*pt->coord[0]; - rot[1] = 2*quat->quat[1]*quat->quat[2]*pt->coord[0] + quat->quat[2]*quat->quat[2]*pt->coord[1] + - 2*quat->quat[3]*quat->quat[2]*pt->coord[2] + 2*quat->quat[0]*quat->quat[3]*pt->coord[0] - - quat->quat[3]*quat->quat[3]*pt->coord[1] + quat->quat[0]*quat->quat[0]*pt->coord[1] - - 2*quat->quat[1]*quat->quat[0]*pt->coord[2] - quat->quat[1]*quat->quat[1]*pt->coord[1]; - rot[2] = 2*quat->quat[1]*quat->quat[3]*pt->coord[0] + 2*quat->quat[2]*quat->quat[3]*pt->coord[1] + - quat->quat[3]*quat->quat[3]*pt->coord[2] - 2*quat->quat[0]*quat->quat[2]*pt->coord[0] - - quat->quat[2]*quat->quat[2]*pt->coord[2] + 2*quat->quat[0]*quat->quat[1]*pt->coord[1] - - quat->quat[1]*quat->quat[1]*pt->coord[2] + quat->quat[0]*quat->quat[0]*pt->coord[2]; - return newPointObject(rot, 3, Py_NEW); - } } return (EXPP_ReturnPyObjError(PyExc_RuntimeError, @@ -1329,60 +1235,7 @@ PyObject *M_Mathutils_Euler(PyObject * self, PyObject * args) Py_DECREF(listObject); return newEulerObject(eul, Py_NEW); } -//----------------------------------POINT FUNCTIONS--------------------- -//----------------------------------Mathutils.Point() ------------------ -PyObject *M_Mathutils_Point(PyObject * self, PyObject * args) -{ - PyObject *listObject = NULL; - int size, i; - float point[3]; - PyObject *v, *f; - - size = PySequence_Length(args); - if (size == 1) { - listObject = PySequence_GetItem(args, 0); - if (PySequence_Check(listObject)) { - size = PySequence_Length(listObject); - } else { // Single argument was not a sequence - Py_XDECREF(listObject); - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.Point(): 2-3 floats or ints expected (optionally in a sequence)\n"); - } - } else if (size == 0) { - //returns a new empty 3d point - return newPointObject(NULL, 3, Py_NEW); - } else { - listObject = EXPP_incr_ret(args); - } - - if (size<2 || size>3) { // Invalid vector size - Py_XDECREF(listObject); - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.Point(): 2-3 floats or ints expected (optionally in a sequence)\n"); - } - for (i=0; i 0 && floatSteps < (4 * 1024 * 1024)); + a = *(int*)&A; + if (a < 0) + a = 0x80000000 - a; + b = *(int*)&B; + if (b < 0) + b = 0x80000000 - b; + delta = abs(a - b); + if (delta <= floatSteps) + return 1; + return 0; +} +/*---------------------- EXPP_VectorsAreEqual ------------------------- + Builds on EXPP_FloatsAreEqual to test vectors */ +int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps){ + + int x; + for (x=0; x< size; x++){ + if (EXPP_FloatsAreEqual(vecA[x], vecB[x], floatSteps) == 0) + return 0; + } + return 1; +} + + + //####################################################################### //#############################DEPRECATED################################ diff --git a/source/blender/python/api2_2x/Mathutils.h b/source/blender/python/api2_2x/Mathutils.h index 0db83216178..d3d3354d42f 100644 --- a/source/blender/python/api2_2x/Mathutils.h +++ b/source/blender/python/api2_2x/Mathutils.h @@ -36,13 +36,10 @@ #include "matrix.h" #include "quat.h" #include "euler.h" -#include "point.h" PyObject *Mathutils_Init( const char * from ); PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat); PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec); -PyObject *row_point_multiplication(PointObject* pt, MatrixObject * mat); -PyObject *column_point_multiplication(MatrixObject * mat, PointObject* pt); PyObject *quat_rotation(PyObject *arg1, PyObject *arg2); PyObject *M_Mathutils_Rand(PyObject * self, PyObject * args); @@ -69,7 +66,6 @@ PyObject *M_Mathutils_TriangleArea( PyObject * self, PyObject * args ); PyObject *M_Mathutils_TriangleNormal( PyObject * self, PyObject * args ); PyObject *M_Mathutils_QuadNormal( PyObject * self, PyObject * args ); PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args ); -PyObject *M_Mathutils_Point(PyObject * self, PyObject * args); //DEPRECATED PyObject *M_Mathutils_CopyMat(PyObject * self, PyObject * args); PyObject *M_Mathutils_CopyVec(PyObject * self, PyObject * args); @@ -79,4 +75,25 @@ PyObject *M_Mathutils_RotateEuler(PyObject * self, PyObject * args); PyObject *M_Mathutils_MatMultVec(PyObject * self, PyObject * args); PyObject *M_Mathutils_VecMultMat(PyObject * self, PyObject * args); +int EXPP_FloatsAreEqual(float A, float B, int floatSteps); +int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps); + + +#define Py_PI 3.14159265358979323846 +#define Py_WRAP 1024 +#define Py_NEW 2048 + + +/* Allow us to build with Py3k */ +#if (PY_VERSION_HEX >= 0x03000000) +#define PyString_FromString PyUnicode_FromString +#define intobjargproc ssizeobjargproc +#define intintobjargproc ssizessizeobjargproc +#define intargfunc ssizeargfunc +#define intintargfunc ssizessizeargfunc + + +#endif + + #endif /* EXPP_Mathutils_H */ diff --git a/source/blender/python/api2_2x/Node.c b/source/blender/python/api2_2x/Node.c index 792b2331508..813f5999678 100644 --- a/source/blender/python/api2_2x/Node.c +++ b/source/blender/python/api2_2x/Node.c @@ -40,7 +40,7 @@ #include "BLI_blenlib.h" #include "gen_utils.h" -#include "vector.h" +#include "Mathutils.h" static PyObject *Node_repr( BPy_Node * self ); static int Node_compare(BPy_Node *a, BPy_Node *b); diff --git a/source/blender/python/api2_2x/Scene.c b/source/blender/python/api2_2x/Scene.c index 8a2be2391a4..6d10205c0e3 100644 --- a/source/blender/python/api2_2x/Scene.c +++ b/source/blender/python/api2_2x/Scene.c @@ -85,7 +85,7 @@ struct View3D; #include "BKE_utildefines.h" /* vec copy */ -#include "vector.h" +#include "Mathutils.h" PyObject *M_Object_Get( PyObject * self, PyObject * args ); /* from Object.c */ diff --git a/source/blender/python/api2_2x/Texture.c b/source/blender/python/api2_2x/Texture.c index 51e1c389528..455badef4ad 100644 --- a/source/blender/python/api2_2x/Texture.c +++ b/source/blender/python/api2_2x/Texture.c @@ -53,7 +53,7 @@ #include "gen_utils.h" #include "gen_library.h" -#include "vector.h" /* for Texture_evaluate(vec) */ +#include "Mathutils.h" /* for Texture_evaluate(vec) */ #include "Material.h" /* for EXPP_Colorband_fromPyList and EXPP_PyList_fromColorband */ #include "RE_shader_ext.h" diff --git a/source/blender/python/api2_2x/Types.c b/source/blender/python/api2_2x/Types.c index 10b968cacba..65d816ac7b0 100644 --- a/source/blender/python/api2_2x/Types.c +++ b/source/blender/python/api2_2x/Types.c @@ -60,7 +60,6 @@ extern PyTypeObject World_Type; extern PyTypeObject property_Type; extern PyTypeObject buffer_Type, constant_Type, euler_Type; extern PyTypeObject matrix_Type, quaternion_Type, rgbTuple_Type, vector_Type; -extern PyTypeObject point_Type; extern PyTypeObject Modifier_Type, ModSeq_Type; extern PyTypeObject EditBone_Type; extern PyTypeObject ThemeSpace_Type; @@ -246,7 +245,6 @@ void types_InitAll( void ) PyType_Ready( &rgbTuple_Type ); vector_Type.ob_type = &PyType_Type; property_Type.ob_type = &PyType_Type; - point_Type.ob_type = &PyType_Type; PyType_Ready( &Modifier_Type ); PyType_Ready( &ModSeq_Type ); PyType_Ready( &EditBone_Type ); @@ -358,8 +356,6 @@ PyObject *Types_Init( void ) ( PyObject * ) &Pose_Type ); PyDict_SetItemString( dict, "propertyType", ( PyObject * ) &property_Type ); - PyDict_SetItemString( dict, "pointType", - ( PyObject * ) &point_Type ); PyDict_SetItemString( dict, "ModifierType", ( PyObject * ) &Modifier_Type ); PyDict_SetItemString( dict, "ModSeqType", diff --git a/source/blender/python/api2_2x/euler.c b/source/blender/python/api2_2x/euler.c index 52f1e00221e..23f82fc0eb0 100644 --- a/source/blender/python/api2_2x/euler.c +++ b/source/blender/python/api2_2x/euler.c @@ -31,7 +31,6 @@ #include "BLI_arithb.h" #include "BKE_utildefines.h" #include "BLI_blenlib.h" -#include "gen_utils.h" //-------------------------DOC STRINGS --------------------------- @@ -128,7 +127,8 @@ PyObject *Euler_Unique(EulerObject * self) self->eul[1] = (float)(pitch * 180 / (float)Py_PI); self->eul[2] = (float)(bank * 180 / (float)Py_PI); - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject *)self; } //----------------------------Euler.zero()------------------------- //sets the euler to 0,0,0 @@ -138,7 +138,8 @@ PyObject *Euler_Zero(EulerObject * self) self->eul[1] = 0.0; self->eul[2] = 0.0; - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject *)self; } //----------------------------Euler.rotate()----------------------- //rotates a euler a certain amount and returns the result @@ -150,12 +151,12 @@ PyObject *Euler_Rotate(EulerObject * self, PyObject *args) int x; if(!PyArg_ParseTuple(args, "fs", &angle, &axis)){ - return EXPP_ReturnPyObjError(PyExc_TypeError, - "euler.rotate():expected angle (float) and axis (x,y,z)"); + PyErr_SetString(PyExc_TypeError, "euler.rotate():expected angle (float) and axis (x,y,z)"); + return NULL; } if(!STREQ3(axis,"x","y","z")){ - return EXPP_ReturnPyObjError(PyExc_TypeError, - "euler.rotate(): expected axis to be 'x', 'y' or 'z'"); + PyErr_SetString(PyExc_TypeError, "euler.rotate(): expected axis to be 'x', 'y' or 'z'"); + return NULL; } //covert to radians @@ -169,7 +170,8 @@ PyObject *Euler_Rotate(EulerObject * self, PyObject *args) self->eul[x] *= (180 / (float)Py_PI); } - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject *)self; } //----------------------------Euler.rotate()----------------------- // return a copy of the euler @@ -207,9 +209,9 @@ static PyObject* Euler_richcmpr(PyObject *objectA, PyObject *objectB, int compar if (!EulerObject_Check(objectA) || !EulerObject_Check(objectB)){ if (comparison_type == Py_NE){ - return EXPP_incr_ret(Py_True); + Py_RETURN_TRUE; }else{ - return EXPP_incr_ret(Py_False); + Py_RETURN_FALSE; } } eulA = (EulerObject*)objectA; @@ -232,9 +234,9 @@ static PyObject* Euler_richcmpr(PyObject *objectA, PyObject *objectB, int compar break; } if (result == 1){ - return EXPP_incr_ret(Py_True); + Py_RETURN_TRUE; }else{ - return EXPP_incr_ret(Py_False); + Py_RETURN_FALSE; } } //------------------------tp_doc @@ -250,32 +252,36 @@ static int Euler_len(EulerObject * self) //sequence accessor (get) static PyObject *Euler_item(EulerObject * self, int i) { - if(i < 0 || i >= 3) - return EXPP_ReturnPyObjError(PyExc_IndexError, - "euler[attribute]: array index out of range\n"); - + if(i<0) + i= 3-i; + + if(i < 0 || i >= 3) { + PyErr_SetString(PyExc_IndexError, "euler[attribute]: array index out of range"); + return NULL; + } return PyFloat_FromDouble(self->eul[i]); } //----------------------------object[]------------------------- //sequence accessor (set) -static int Euler_ass_item(EulerObject * self, int i, PyObject * ob) +static int Euler_ass_item(EulerObject * self, int i, PyObject * value) { - PyObject *f = NULL; + float f = PyFloat_AsDouble(value); - f = PyNumber_Float(ob); - if(f == NULL) { // parsed item not a number - return EXPP_ReturnIntError(PyExc_TypeError, - "euler[attribute] = x: argument not a number\n"); + if(f == -1 && PyErr_Occurred()) { // parsed item not a number + PyErr_SetString(PyExc_TypeError, "euler[attribute] = x: argument not a number"); + return -1; } + if(i<0) + i= 3-i; + if(i < 0 || i >= 3){ - Py_DECREF(f); - return EXPP_ReturnIntError(PyExc_IndexError, - "euler[attribute] = x: array assignment index out of range\n"); + PyErr_SetString(PyExc_IndexError, "euler[attribute] = x: array assignment index out of range\n"); + return -1; } - self->eul[i] = (float)PyFloat_AS_DOUBLE(f); - Py_DECREF(f); + + self->eul[i] = f; return 0; } //----------------------------object[z:y]------------------------ @@ -314,26 +320,27 @@ static int Euler_ass_slice(EulerObject * self, int begin, int end, size = PySequence_Length(seq); if(size != (end - begin)){ - return EXPP_ReturnIntError(PyExc_TypeError, - "euler[begin:end] = []: size mismatch in slice assignment\n"); + PyErr_SetString(PyExc_TypeError, "euler[begin:end] = []: size mismatch in slice assignment"); + return -1; } for (i = 0; i < size; i++) { e = PySequence_GetItem(seq, i); if (e == NULL) { // Failed to read sequence - return EXPP_ReturnIntError(PyExc_RuntimeError, - "euler[begin:end] = []: unable to read sequence\n"); + PyErr_SetString(PyExc_RuntimeError, "euler[begin:end] = []: unable to read sequence"); + return -1; } f = PyNumber_Float(e); if(f == NULL) { // parsed item not a number Py_DECREF(e); - return EXPP_ReturnIntError(PyExc_TypeError, - "euler[begin:end] = []: sequence argument not a number\n"); + PyErr_SetString(PyExc_TypeError, "euler[begin:end] = []: sequence argument not a number"); + return -1; } eul[i] = (float)PyFloat_AS_DOUBLE(f); - EXPP_decr2(f,e); + Py_DECREF(f); + Py_DECREF(e); } //parsed well - now set in vector for(y = 0; y < 3; y++){ @@ -377,9 +384,10 @@ static int Euler_setAxis( EulerObject * self, PyObject * value, void * type ) { float param= (float)PyFloat_AsDouble( value ); - if (param==-1 && PyErr_Occurred()) - return EXPP_ReturnIntError( PyExc_TypeError, - "expected a number for the vector axis" ); + if (param==-1 && PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "expected a number for the vector axis"); + return -1; + } switch( (long)type ) { case 'X': /* these are backwards, but that how it works */ @@ -430,8 +438,13 @@ static PyGetSetDef Euler_getseters[] = { //------------------PY_OBECT DEFINITION-------------------------- PyTypeObject euler_Type = { - PyObject_HEAD_INIT(NULL) //tp_head - 0, //tp_internal +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "euler", //tp_name sizeof(EulerObject), //tp_basicsize 0, //tp_itemsize @@ -513,6 +526,6 @@ PyObject *newEulerObject(float *eul, int type) }else{ //bad type return NULL; } - return (PyObject *) self; + return (PyObject *)self; } diff --git a/source/blender/python/api2_2x/gen_utils.c b/source/blender/python/api2_2x/gen_utils.c index de3704164ac..53ace2759a2 100644 --- a/source/blender/python/api2_2x/gen_utils.c +++ b/source/blender/python/api2_2x/gen_utils.c @@ -42,36 +42,6 @@ #include "constant.h" -/*---------------------- EXPP_FloatsAreEqual ------------------------- - Floating point comparisons - floatStep = number of representable floats allowable in between - float A and float B to be considered equal. */ -int EXPP_FloatsAreEqual(float A, float B, int floatSteps) -{ - int a, b, delta; - assert(floatSteps > 0 && floatSteps < (4 * 1024 * 1024)); - a = *(int*)&A; - if (a < 0) - a = 0x80000000 - a; - b = *(int*)&B; - if (b < 0) - b = 0x80000000 - b; - delta = abs(a - b); - if (delta <= floatSteps) - return 1; - return 0; -} -/*---------------------- EXPP_VectorsAreEqual ------------------------- - Builds on EXPP_FloatsAreEqual to test vectors */ -int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps){ - - int x; - for (x=0; x< size; x++){ - if (EXPP_FloatsAreEqual(vecA[x], vecB[x], floatSteps) == 0) - return 0; - } - return 1; -} /*---------------------- EXPP_GetModuleConstant ------------------------- Helper function for returning a module constant */ PyObject *EXPP_GetModuleConstant(char *module, char *constant) @@ -781,7 +751,7 @@ int EXPP_setModuleConstant ( BPy_constant *constant, void *param, char type ) { PyObject *item; - if( constant->ob_type != &constant_Type ) + if( ((PyObject *)constant)->ob_type != &constant_Type ) return EXPP_ReturnIntError( PyExc_TypeError, "expected module constant" ); diff --git a/source/blender/python/api2_2x/gen_utils.h b/source/blender/python/api2_2x/gen_utils.h index f33dc69d703..3486b265949 100644 --- a/source/blender/python/api2_2x/gen_utils.h +++ b/source/blender/python/api2_2x/gen_utils.h @@ -37,9 +37,9 @@ #include "constant.h" -#define Py_PI 3.14159265358979323846 -#define Py_WRAP 1024 -#define Py_NEW 2048 +// #define Py_PI 3.14159265358979323846 +// #define Py_WRAP 1024 +// #define Py_NEW 2048 /* Py_RETURN_NONE @@ -77,9 +77,6 @@ typedef int Py_ssize_t; /* name of list of Armature weak refs built into __main__ */ #define ARM_WEAKREF_LIST_NAME "__arm_weakrefs" -int EXPP_FloatsAreEqual(float A, float B, int floatSteps); -int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps); - PyObject *EXPP_GetModuleConstant(char *module, char *constant); int StringEqual( const char *string1, const char *string2 ); diff --git a/source/blender/python/api2_2x/matrix.c b/source/blender/python/api2_2x/matrix.c index 7802de822cb..a8816ae4baa 100644 --- a/source/blender/python/api2_2x/matrix.c +++ b/source/blender/python/api2_2x/matrix.c @@ -30,7 +30,6 @@ #include "BKE_utildefines.h" #include "BLI_arithb.h" #include "BLI_blenlib.h" -#include "gen_utils.h" /*-------------------------DOC STRINGS ---------------------------*/ char Matrix_Zero_doc[] = "() - set all values in the matrix to 0"; @@ -70,8 +69,8 @@ PyObject *Matrix_toQuat(MatrixObject * self) /*must be 3-4 cols, 3-4 rows, square matrix*/ if(self->colSize < 3 || self->rowSize < 3 || (self->colSize != self->rowSize)) { - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Matrix.toQuat(): inappropriate matrix size - expects 3x3 or 4x4 matrix\n"); + PyErr_SetString(PyExc_AttributeError, "Matrix.toQuat(): inappropriate matrix size - expects 3x3 or 4x4 matrix"); + return NULL; } if(self->colSize == 3){ Mat3ToQuat((float (*)[3])*self->matrix, quat); @@ -95,10 +94,10 @@ PyObject *Matrix_toEuler(MatrixObject * self) float tempmat3[3][3]; Mat3CpyMat4(tempmat3, (float (*)[4])*self->matrix); Mat3ToEul(tempmat3, eul); - }else - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Matrix.toEuler(): inappropriate matrix size - expects 3x3 or 4x4 matrix\n"); - + }else { + PyErr_SetString(PyExc_AttributeError, "Matrix.toEuler(): inappropriate matrix size - expects 3x3 or 4x4 matrix\n"); + return NULL; + } /*have to convert to degrees*/ for(x = 0; x < 3; x++) { eul[x] *= (float) (180 / Py_PI); @@ -111,20 +110,20 @@ PyObject *Matrix_Resize4x4(MatrixObject * self) int x, first_row_elem, curr_pos, new_pos, blank_columns, blank_rows, index; if(self->data.blend_data){ - return EXPP_ReturnPyObjError(PyExc_TypeError, - "cannot resize wrapped data - only python matrices\n"); + PyErr_SetString(PyExc_TypeError, "cannot resize wrapped data - only python matrices"); + return NULL; } self->data.py_data = PyMem_Realloc(self->data.py_data, (sizeof(float) * 16)); if(self->data.py_data == NULL) { - return EXPP_ReturnPyObjError(PyExc_MemoryError, - "matrix.resize4x4(): problem allocating pointer space\n\n"); + PyErr_SetString(PyExc_MemoryError, "matrix.resize4x4(): problem allocating pointer space"); + return NULL; } self->contigPtr = self->data.py_data; /*force*/ self->matrix = PyMem_Realloc(self->matrix, (sizeof(float *) * 4)); if(self->matrix == NULL) { - return EXPP_ReturnPyObjError(PyExc_MemoryError, - "matrix.resize4x4(): problem allocating pointer space\n\n"); + PyErr_SetString(PyExc_MemoryError, "matrix.resize4x4(): problem allocating pointer space"); + return NULL; } /*set row pointers*/ for(x = 0; x < 4; x++) { @@ -155,7 +154,9 @@ PyObject *Matrix_Resize4x4(MatrixObject * self) } self->rowSize = 4; self->colSize = 4; - return EXPP_incr_ret((PyObject*)self); + + Py_INCREF(self); + return (PyObject *)self; } /*---------------------------Matrix.translationPart() ------------*/ PyObject *Matrix_TranslationPart(MatrixObject * self) @@ -163,8 +164,8 @@ PyObject *Matrix_TranslationPart(MatrixObject * self) float vec[4]; if(self->colSize < 3 || self->rowSize < 4){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Matrix.translationPart: inappropriate matrix size\n"); + PyErr_SetString(PyExc_AttributeError, "Matrix.translationPart: inappropriate matrix size"); + return NULL; } vec[0] = self->matrix[3][0]; @@ -180,8 +181,8 @@ PyObject *Matrix_RotationPart(MatrixObject * self) 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; if(self->colSize < 3 || self->rowSize < 3){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Matrix.rotationPart: inappropriate matrix size\n"); + PyErr_SetString(PyExc_AttributeError, "Matrix.rotationPart: inappropriate matrix size\n"); + return NULL; } mat[0] = self->matrix[0][0]; @@ -207,10 +208,10 @@ PyObject *Matrix_scalePart(MatrixObject * self) Mat3CpyMat4(mat, (float (*)[4])*self->matrix); else if(self->colSize == 3 && self->rowSize == 3) Mat3CpyMat3(mat, (float (*)[3])*self->matrix); - else - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Matrix.scalePart(): inappropriate matrix size - expects 3x3 or 4x4 matrix\n"); - + else { + PyErr_SetString(PyExc_AttributeError, "Matrix.scalePart(): inappropriate matrix size - expects 3x3 or 4x4 matrix\n"); + return NULL; + } /* functionality copied from editobject.c apply_obmat */ Mat3ToEul(mat, rot); EulToMat3(rot, tmat); @@ -233,8 +234,8 @@ PyObject *Matrix_Invert(MatrixObject * self) 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; if(self->rowSize != self->colSize){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Matrix.invert(ed): only square matrices are supported\n"); + PyErr_SetString(PyExc_AttributeError, "Matrix.invert(ed): only square matrices are supported"); + return NULL; } /*calculate the determinant*/ @@ -268,10 +269,12 @@ PyObject *Matrix_Invert(MatrixObject * self) /*transpose Matrix_Transpose(self);*/ } else { - return EXPP_ReturnPyObjError(PyExc_ValueError, - "matrix does not have an inverse"); + PyErr_SetString(PyExc_ValueError, "matrix does not have an inverse"); + return NULL; } - return EXPP_incr_ret((PyObject*)self); + + Py_INCREF(self); + return (PyObject *)self; } @@ -281,8 +284,8 @@ PyObject *Matrix_Determinant(MatrixObject * self) float det = 0.0f; if(self->rowSize != self->colSize){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Matrix.determinant: only square matrices are supported\n"); + PyErr_SetString(PyExc_AttributeError, "Matrix.determinant: only square matrices are supported"); + return NULL; } if(self->rowSize == 2) { @@ -306,8 +309,8 @@ PyObject *Matrix_Transpose(MatrixObject * self) float t = 0.0f; if(self->rowSize != self->colSize){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Matrix.transpose(d): only square matrices are supported\n"); + PyErr_SetString(PyExc_AttributeError, "Matrix.transpose(d): only square matrices are supported"); + return NULL; } if(self->rowSize == 2) { @@ -320,7 +323,8 @@ PyObject *Matrix_Transpose(MatrixObject * self) Mat4Transp((float (*)[4])*self->matrix); } - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject *)self; } @@ -334,14 +338,15 @@ PyObject *Matrix_Zero(MatrixObject * self) self->matrix[row][col] = 0.0f; } } - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject *)self; } /*---------------------------Matrix.identity(() ------------------*/ PyObject *Matrix_Identity(MatrixObject * self) { if(self->rowSize != self->colSize){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Matrix.identity: only square matrices are supported\n"); + PyErr_SetString(PyExc_AttributeError, "Matrix.identity: only square matrices are supported\n"); + return NULL; } if(self->rowSize == 2) { @@ -355,7 +360,8 @@ PyObject *Matrix_Identity(MatrixObject * self) Mat4One((float (*)[4]) *self->matrix); } - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject *)self; } /*---------------------------Matrix.inverted() ------------------*/ @@ -387,9 +393,9 @@ static PyObject *Matrix_getattr(MatrixObject * self, char *name) } if(STREQ(name, "wrapped")){ if(self->wrapped == Py_WRAP) - return EXPP_incr_ret((PyObject *)Py_True); + Py_RETURN_TRUE; else - return EXPP_incr_ret((PyObject *)Py_False); + Py_RETURN_FALSE; } return Py_FindMethod(Matrix_methods, (PyObject *) self, name); } @@ -435,9 +441,9 @@ static PyObject* Matrix_richcmpr(PyObject *objectA, PyObject *objectB, int compa if (!MatrixObject_Check(objectA) || !MatrixObject_Check(objectB)){ if (comparison_type == Py_NE){ - return EXPP_incr_ret(Py_True); + Py_RETURN_TRUE; }else{ - return EXPP_incr_ret(Py_False); + Py_RETURN_FALSE; } } matA = (MatrixObject*)objectA; @@ -445,9 +451,9 @@ static PyObject* Matrix_richcmpr(PyObject *objectA, PyObject *objectB, int compa if (matA->colSize != matB->colSize || matA->rowSize != matB->rowSize){ if (comparison_type == Py_NE){ - return EXPP_incr_ret(Py_True); + Py_RETURN_TRUE; }else{ - return EXPP_incr_ret(Py_False); + Py_RETURN_FALSE; } } @@ -471,9 +477,9 @@ static PyObject* Matrix_richcmpr(PyObject *objectA, PyObject *objectB, int compa break; } if (result == 1){ - return EXPP_incr_ret(Py_True); + Py_RETURN_TRUE; }else{ - return EXPP_incr_ret(Py_False); + Py_RETURN_FALSE; } } /*------------------------tp_doc*/ @@ -490,10 +496,10 @@ static int Matrix_len(MatrixObject * self) the wrapped vector gives direct access to the matrix data*/ static PyObject *Matrix_item(MatrixObject * self, int i) { - if(i < 0 || i >= self->rowSize) - return EXPP_ReturnPyObjError(PyExc_IndexError, - "matrix[attribute]: array index out of range\n"); - + if(i < 0 || i >= self->rowSize) { + PyErr_SetString(PyExc_IndexError, "matrix[attribute]: array index out of range"); + return NULL; + } return newVectorObject(self->matrix[i], self->colSize, Py_WRAP); } /*----------------------------object[]------------------------- @@ -505,32 +511,33 @@ static int Matrix_ass_item(MatrixObject * self, int i, PyObject * ob) PyObject *m, *f; if(i >= self->rowSize || i < 0){ - return EXPP_ReturnIntError(PyExc_TypeError, - "matrix[attribute] = x: bad row\n"); + PyErr_SetString(PyExc_TypeError, "matrix[attribute] = x: bad row\n"); + return -1; } if(PySequence_Check(ob)){ size = PySequence_Length(ob); if(size != self->colSize){ - return EXPP_ReturnIntError(PyExc_TypeError, - "matrix[attribute] = x: bad sequence size\n"); + PyErr_SetString(PyExc_TypeError, "matrix[attribute] = x: bad sequence size\n"); + return -1; } for (x = 0; x < size; x++) { m = PySequence_GetItem(ob, x); if (m == NULL) { /*Failed to read sequence*/ - return EXPP_ReturnIntError(PyExc_RuntimeError, - "matrix[attribute] = x: unable to read sequence\n"); + PyErr_SetString(PyExc_RuntimeError, "matrix[attribute] = x: unable to read sequence\n"); + return -1; } f = PyNumber_Float(m); if(f == NULL) { /*parsed item not a number*/ Py_DECREF(m); - return EXPP_ReturnIntError(PyExc_TypeError, - "matrix[attribute] = x: sequence argument not a number\n"); + PyErr_SetString(PyExc_TypeError, "matrix[attribute] = x: sequence argument not a number\n"); + return -1; } vec[x] = (float)PyFloat_AS_DOUBLE(f); - EXPP_decr2(m, f); + Py_DECREF(m); + Py_DECREF(f); } /*parsed well - now set in matrix*/ for(y = 0; y < size; y++){ @@ -538,8 +545,8 @@ static int Matrix_ass_item(MatrixObject * self, int i, PyObject * ob) } return 0; }else{ - return EXPP_ReturnIntError(PyExc_TypeError, - "matrix[attribute] = x: expects a sequence of column size\n"); + PyErr_SetString(PyExc_TypeError, "matrix[attribute] = x: expects a sequence of column size\n"); + return -1; } } /*----------------------------object[z:y]------------------------ @@ -579,16 +586,16 @@ static int Matrix_ass_slice(MatrixObject * self, int begin, int end, if(PySequence_Check(seq)){ size = PySequence_Length(seq); if(size != (end - begin)){ - return EXPP_ReturnIntError(PyExc_TypeError, - "matrix[begin:end] = []: size mismatch in slice assignment\n"); + PyErr_SetString(PyExc_TypeError, "matrix[begin:end] = []: size mismatch in slice assignment\n"); + return -1; } /*parse sub items*/ for (i = 0; i < size; i++) { /*parse each sub sequence*/ subseq = PySequence_GetItem(seq, i); if (subseq == NULL) { /*Failed to read sequence*/ - return EXPP_ReturnIntError(PyExc_RuntimeError, - "matrix[begin:end] = []: unable to read sequence\n"); + PyErr_SetString(PyExc_RuntimeError, "matrix[begin:end] = []: unable to read sequence"); + return -1; } if(PySequence_Check(subseq)){ @@ -596,31 +603,33 @@ static int Matrix_ass_slice(MatrixObject * self, int begin, int end, sub_size = PySequence_Length(subseq); if(sub_size != self->colSize){ Py_DECREF(subseq); - return EXPP_ReturnIntError(PyExc_TypeError, - "matrix[begin:end] = []: size mismatch in slice assignment\n"); + PyErr_SetString(PyExc_TypeError, "matrix[begin:end] = []: size mismatch in slice assignment\n"); + return -1; } for (y = 0; y < sub_size; y++) { m = PySequence_GetItem(subseq, y); if (m == NULL) { /*Failed to read sequence*/ Py_DECREF(subseq); - return EXPP_ReturnIntError(PyExc_RuntimeError, - "matrix[begin:end] = []: unable to read sequence\n"); + PyErr_SetString(PyExc_RuntimeError, "matrix[begin:end] = []: unable to read sequence\n"); + return -1; } f = PyNumber_Float(m); if(f == NULL) { /*parsed item not a number*/ - EXPP_decr2(m, subseq); - return EXPP_ReturnIntError(PyExc_TypeError, - "matrix[begin:end] = []: sequence argument not a number\n"); + Py_DECREF(m); + Py_DECREF(subseq); + PyErr_SetString(PyExc_TypeError, "matrix[begin:end] = []: sequence argument not a number\n"); + return -1; } mat[(i * self->colSize) + y] = (float)PyFloat_AS_DOUBLE(f); - EXPP_decr2(f, m); + Py_DECREF(m); + Py_DECREF(subseq); } }else{ Py_DECREF(subseq); - return EXPP_ReturnIntError(PyExc_TypeError, - "matrix[begin:end] = []: illegal argument type for built-in operation\n"); + PyErr_SetString(PyExc_TypeError, "matrix[begin:end] = []: illegal argument type for built-in operation\n"); + return -1; } Py_DECREF(subseq); } @@ -630,8 +639,8 @@ static int Matrix_ass_slice(MatrixObject * self, int begin, int end, } return 0; }else{ - return EXPP_ReturnIntError(PyExc_TypeError, - "matrix[begin:end] = []: illegal argument type for built-in operation\n"); + PyErr_SetString(PyExc_TypeError, "matrix[begin:end] = []: illegal argument type for built-in operation\n"); + return -1; } } /*------------------------NUMERIC PROTOCOLS---------------------- @@ -647,12 +656,12 @@ static PyObject *Matrix_add(PyObject * m1, PyObject * m2) mat2 = (MatrixObject*)m2; if(mat1->coerced_object || mat2->coerced_object){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Matrix addition: arguments not valid for this operation....\n"); + PyErr_SetString(PyExc_AttributeError, "Matrix addition: arguments not valid for this operation...."); + return NULL; } if(mat1->rowSize != mat2->rowSize || mat1->colSize != mat2->colSize){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Matrix addition: matrices must have the same dimensions for this operation\n"); + PyErr_SetString(PyExc_AttributeError, "Matrix addition: matrices must have the same dimensions for this operation"); + return NULL; } for(x = 0; x < mat1->rowSize; x++) { @@ -676,12 +685,12 @@ static PyObject *Matrix_sub(PyObject * m1, PyObject * m2) mat2 = (MatrixObject*)m2; if(mat1->coerced_object || mat2->coerced_object){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Matrix addition: arguments not valid for this operation....\n"); + PyErr_SetString(PyExc_AttributeError, "Matrix addition: arguments not valid for this operation...."); + return NULL; } if(mat1->rowSize != mat2->rowSize || mat1->colSize != mat2->colSize){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Matrix addition: matrices must have the same dimensions for this operation\n"); + PyErr_SetString(PyExc_AttributeError, "Matrix addition: matrices must have the same dimensions for this operation"); + return NULL; } for(x = 0; x < mat1->rowSize; x++) { @@ -703,7 +712,6 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) double dot = 0.0f; MatrixObject *mat1 = NULL, *mat2 = NULL; PyObject *f = NULL; - PointObject *pt = NULL; mat1 = (MatrixObject*)m1; mat2 = (MatrixObject*)m2; @@ -713,8 +721,8 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) PyInt_Check(mat1->coerced_object)){ /*FLOAT/INT * MATRIX*/ f = PyNumber_Float(mat1->coerced_object); if(f == NULL) { /*parsed item not a number*/ - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Matrix multiplication: arguments not acceptable for this operation\n"); + PyErr_SetString(PyExc_TypeError, "Matrix multiplication: arguments not acceptable for this operation"); + return NULL; } scalar = (float)PyFloat_AS_DOUBLE(f); @@ -733,15 +741,11 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) vec = (VectorObject*)mat2->coerced_object; return column_vector_multiplication(mat1, vec); }else */ - if(PointObject_Check(mat2->coerced_object)){ /*MATRIX * POINT*/ - pt = (PointObject*)mat2->coerced_object; - return column_point_multiplication(mat1, pt); - }else if (PyFloat_Check(mat2->coerced_object) || - PyInt_Check(mat2->coerced_object)){ /*MATRIX * FLOAT/INT*/ + if (PyFloat_Check(mat2->coerced_object) || PyInt_Check(mat2->coerced_object)){ /*MATRIX * FLOAT/INT*/ f = PyNumber_Float(mat2->coerced_object); if(f == NULL) { /*parsed item not a number*/ - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Matrix multiplication: arguments not acceptable for this operation\n"); + PyErr_SetString(PyExc_TypeError, "Matrix multiplication: arguments not acceptable for this operation\n"); + return NULL; } scalar = (float)PyFloat_AS_DOUBLE(f); @@ -755,8 +759,8 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) } }else{ /*MATRIX * MATRIX*/ if(mat1->colSize != mat2->rowSize){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Matrix multiplication: matrix A rowsize must equal matrix B colsize\n"); + PyErr_SetString(PyExc_AttributeError,"Matrix multiplication: matrix A rowsize must equal matrix B colsize"); + return NULL; } for(x = 0; x < mat1->rowSize; x++) { for(y = 0; y < mat2->colSize; y++) { @@ -771,8 +775,8 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) } } - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Matrix multiplication: arguments not acceptable for this operation\n"); + PyErr_SetString(PyExc_TypeError, "Matrix multiplication: arguments not acceptable for this operation\n"); + return NULL; } static PyObject* Matrix_inv(MatrixObject *self) { @@ -789,17 +793,17 @@ static PyObject* Matrix_inv(MatrixObject *self) then call vector.multiply(vector, scalar_cast_as_vector)*/ static int Matrix_coerce(PyObject ** m1, PyObject ** m2) { - if(VectorObject_Check(*m2) || PyFloat_Check(*m2) || PyInt_Check(*m2) || - PointObject_Check(*m2)) { - PyObject *coerced = EXPP_incr_ret(*m2); + if(VectorObject_Check(*m2) || PyFloat_Check(*m2) || PyInt_Check(*m2)) { + PyObject *coerced = (PyObject *)(*m2); + Py_INCREF(coerced); *m2 = newMatrixObject(NULL,3,3,Py_NEW); ((MatrixObject*)*m2)->coerced_object = coerced; Py_INCREF (*m1); return 0; } - return EXPP_ReturnIntError(PyExc_TypeError, - "matrix.coerce(): unknown operand - can't coerce for numeric protocols"); + PyErr_SetString(PyExc_TypeError, "matrix.coerce(): unknown operand - can't coerce for numeric protocols"); + return -1; } /*-----------------PROTOCOL DECLARATIONS--------------------------*/ static PySequenceMethods Matrix_SeqMethods = { @@ -838,8 +842,13 @@ static PyNumberMethods Matrix_NumMethods = { }; /*------------------PY_OBECT DEFINITION--------------------------*/ PyTypeObject matrix_Type = { - PyObject_HEAD_INIT(NULL) /*tp_head*/ - 0, /*tp_internal*/ +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "matrix", /*tp_name*/ sizeof(MatrixObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -910,8 +919,8 @@ PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type) /*matrix objects can be any 2-4row x 2-4col matrix*/ if(rowSize < 2 || rowSize > 4 || colSize < 2 || colSize > 4){ - return EXPP_ReturnPyObjError(PyExc_RuntimeError, - "matrix(): row and column sizes must be between 2 and 4\n"); + PyErr_SetString(PyExc_RuntimeError, "matrix(): row and column sizes must be between 2 and 4"); + return NULL; } self = PyObject_NEW(MatrixObject, &matrix_Type); @@ -927,8 +936,8 @@ PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type) /*create pointer array*/ self->matrix = PyMem_Malloc(rowSize * sizeof(float *)); if(self->matrix == NULL) { /*allocation failure*/ - return EXPP_ReturnPyObjError( PyExc_MemoryError, - "matrix(): problem allocating pointer space\n"); + PyErr_SetString( PyExc_MemoryError, "matrix(): problem allocating pointer space"); + return NULL; } /*pointer array points to contigous memory*/ for(x = 0; x < rowSize; x++) { @@ -938,16 +947,16 @@ PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type) }else if (type == Py_NEW){ self->data.py_data = PyMem_Malloc(rowSize * colSize * sizeof(float)); if(self->data.py_data == NULL) { /*allocation failure*/ - return EXPP_ReturnPyObjError( PyExc_MemoryError, - "matrix(): problem allocating pointer space\n"); + PyErr_SetString( PyExc_MemoryError, "matrix(): problem allocating pointer space\n"); + return NULL; } self->contigPtr = self->data.py_data; /*create pointer array*/ self->matrix = PyMem_Malloc(rowSize * sizeof(float *)); if(self->matrix == NULL) { /*allocation failure*/ PyMem_Free(self->data.py_data); - return EXPP_ReturnPyObjError( PyExc_MemoryError, - "matrix(): problem allocating pointer space\n"); + PyErr_SetString( PyExc_MemoryError, "matrix(): problem allocating pointer space"); + return NULL; } /*pointer array points to contigous memory*/ for(x = 0; x < rowSize; x++) { diff --git a/source/blender/python/api2_2x/point.c b/source/blender/python/api2_2x/point.c deleted file mode 100644 index 0bdedfecdd6..00000000000 --- a/source/blender/python/api2_2x/point.c +++ /dev/null @@ -1,523 +0,0 @@ -/* - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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 LICENSE BLOCK ***** -*/ -#include "Mathutils.h" - -#include "BLI_blenlib.h" -#include "BKE_utildefines.h" -#include "gen_utils.h" - -//-------------------------DOC STRINGS --------------------------- -char Point_Zero_doc[] = "() - set all values in the point to 0"; -char Point_toVector_doc[] = "() - create a vector representation of this point"; -//-----------------------METHOD DEFINITIONS ---------------------- -struct PyMethodDef Point_methods[] = { - {"zero", (PyCFunction) Point_Zero, METH_NOARGS, Point_Zero_doc}, - {"toVector", (PyCFunction) Point_toVector, METH_NOARGS, Point_toVector_doc}, - {NULL, NULL, 0, NULL} -}; -//-----------------------------METHODS---------------------------- -//--------------------------Vector.toPoint()---------------------- -//create a new point object to represent this vector -PyObject *Point_toVector(PointObject * self) -{ - float vec[3]; - int x; - - for(x = 0; x < self->size; x++){ - vec[x] = self->coord[x]; - } - - return newVectorObject(vec, self->size, Py_NEW); -} -//----------------------------Point.zero() ---------------------- -//set the point data to 0,0,0 -PyObject *Point_Zero(PointObject * self) -{ - int x; - for(x = 0; x < self->size; x++) { - self->coord[x] = 0.0f; - } - return EXPP_incr_ret((PyObject*)self); -} -//----------------------------dealloc()(internal) ---------------- -//free the py_object -static void Point_dealloc(PointObject * self) -{ - Py_XDECREF(self->coerced_object); - //only free py_data - if(self->data.py_data){ - PyMem_Free(self->data.py_data); - } - PyObject_DEL(self); -} -//----------------------------getattr()(internal) ---------------- -//object.attribute access (get) -static PyObject *Point_getattr(PointObject * self, char *name) -{ - if(STREQ(name,"x")){ - return PyFloat_FromDouble(self->coord[0]); - }else if(STREQ(name, "y")){ - return PyFloat_FromDouble(self->coord[1]); - }else if(STREQ(name, "z")){ - if(self->size > 2){ - return PyFloat_FromDouble(self->coord[2]); - }else{ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "point.z: illegal attribute access\n"); - } - } - if(STREQ(name, "wrapped")){ - if(self->wrapped == Py_WRAP) - return EXPP_incr_ret((PyObject *)Py_True); - else - return EXPP_incr_ret((PyObject *)Py_False); - } - return Py_FindMethod(Point_methods, (PyObject *) self, name); -} -//----------------------------setattr()(internal) ---------------- -//object.attribute access (set) -static int Point_setattr(PointObject * self, char *name, PyObject * v) -{ - PyObject *f = NULL; - - f = PyNumber_Float(v); - if(f == NULL) { // parsed item not a number - return EXPP_ReturnIntError(PyExc_TypeError, - "point.attribute = x: argument not a number\n"); - } - - if(STREQ(name,"x")){ - self->coord[0] = (float)PyFloat_AS_DOUBLE(f); - }else if(STREQ(name, "y")){ - self->coord[1] = (float)PyFloat_AS_DOUBLE(f); - }else if(STREQ(name, "z")){ - if(self->size > 2){ - self->coord[2] = (float)PyFloat_AS_DOUBLE(f); - }else{ - Py_DECREF(f); - return EXPP_ReturnIntError(PyExc_AttributeError, - "point.z = x: illegal attribute access\n"); - } - }else{ - Py_DECREF(f); - return EXPP_ReturnIntError(PyExc_AttributeError, - "point.attribute = x: unknown attribute\n"); - } - - Py_DECREF(f); - return 0; -} -//----------------------------print object (internal)------------- -//print the object to screen -static PyObject *Point_repr(PointObject * self) -{ - int i; - char buffer[48], str[1024]; - - BLI_strncpy(str,"[",1024); - for(i = 0; i < self->size; i++){ - if(i < (self->size - 1)){ - sprintf(buffer, "%.6f, ", self->coord[i]); - strcat(str,buffer); - }else{ - sprintf(buffer, "%.6f", self->coord[i]); - strcat(str,buffer); - } - } - strcat(str, "](point)"); - - return PyString_FromString(str); -} -//---------------------SEQUENCE PROTOCOLS------------------------ -//----------------------------len(object)------------------------ -//sequence length -static int Point_len(PointObject * self) -{ - return self->size; -} -//----------------------------object[]--------------------------- -//sequence accessor (get) -static PyObject *Point_item(PointObject * self, int i) -{ - if(i < 0 || i >= self->size) - return EXPP_ReturnPyObjError(PyExc_IndexError, - "point[attribute]: array index out of range\n"); - - return PyFloat_FromDouble( (double)self->coord[i] ); - -} -//----------------------------object[]------------------------- -//sequence accessor (set) -static int Point_ass_item(PointObject * self, int i, PyObject * ob) -{ - PyObject *f = NULL; - - f = PyNumber_Float(ob); - if(f == NULL) { // parsed item not a number - return EXPP_ReturnIntError(PyExc_TypeError, - "point[attribute] = x: argument not a number\n"); - } - - if(i < 0 || i >= self->size){ - Py_DECREF(f); - return EXPP_ReturnIntError(PyExc_IndexError, - "point[attribute] = x: array assignment index out of range\n"); - } - self->coord[i] = (float)PyFloat_AS_DOUBLE(f); - Py_DECREF(f); - return 0; -} -//----------------------------object[z:y]------------------------ -//sequence slice (get) -static PyObject *Point_slice(PointObject * self, int begin, int end) -{ - PyObject *list = NULL; - int count; - - CLAMP(begin, 0, self->size); - CLAMP(end, 0, self->size); - begin = MIN2(begin,end); - - list = PyList_New(end - begin); - for(count = begin; count < end; count++) { - PyList_SetItem(list, count - begin, - PyFloat_FromDouble(self->coord[count])); - } - - return list; -} -//----------------------------object[z:y]------------------------ -//sequence slice (set) -static int Point_ass_slice(PointObject * self, int begin, int end, - PyObject * seq) -{ - int i, y, size = 0; - float coord[3]; - PyObject *v, *f; - - CLAMP(begin, 0, self->size); - CLAMP(end, 0, self->size); - begin = MIN2(begin,end); - - size = PySequence_Length(seq); - if(size != (end - begin)){ - return EXPP_ReturnIntError(PyExc_TypeError, - "point[begin:end] = []: size mismatch in slice assignment\n"); - } - - for (i = 0; i < size; i++) { - v = PySequence_GetItem(seq, i); - if (v == NULL) { // Failed to read sequence - return EXPP_ReturnIntError(PyExc_RuntimeError, - "point[begin:end] = []: unable to read sequence\n"); - } - f = PyNumber_Float(v); - if(f == NULL) { // parsed item not a number - Py_DECREF(v); - return EXPP_ReturnIntError(PyExc_TypeError, - "point[begin:end] = []: sequence argument not a number\n"); - } - - coord[i] = (float)PyFloat_AS_DOUBLE(f); - EXPP_decr2(f,v); - } - //parsed well - now set in point - for(y = 0; y < size; y++){ - self->coord[begin + y] = coord[y]; - } - return 0; -} -//------------------------NUMERIC PROTOCOLS---------------------- -//------------------------obj + obj------------------------------ -//addition -static PyObject *Point_add(PyObject * v1, PyObject * v2) -{ - int x, size; - float coord[3]; - PointObject *coord1 = NULL, *coord2 = NULL; - VectorObject *vec = NULL; - - coord1 = (PointObject*)v1; - coord2 = (PointObject*)v2; - - if(!coord1->coerced_object){ - if(coord2->coerced_object){ - if(VectorObject_Check(coord2->coerced_object)){ //POINT + VECTOR - //Point translation - vec = (VectorObject*)coord2->coerced_object; - size = coord1->size; - if(vec->size == size){ - for(x = 0; x < size; x++){ - coord[x] = coord1->coord[x] + vec->vec[x]; - } - }else{ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Point addition: arguments are the wrong size....\n"); - } - return newPointObject(coord, size, Py_NEW); - } - }else{ //POINT + POINT - size = coord1->size; - if(coord2->size == size){ - for(x = 0; x < size; x++) { - coord[x] = coord1->coord[x] + coord2->coord[x]; - } - }else{ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Point addition: arguments are the wrong size....\n"); - } - return newPointObject(coord, size, Py_NEW); - } - } - - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Point addition: arguments not valid for this operation....\n"); -} -//------------------------obj - obj------------------------------ -//subtraction -static PyObject *Point_sub(PyObject * v1, PyObject * v2) -{ - int x, size; - float coord[3]; - PointObject *coord1 = NULL, *coord2 = NULL; - - coord1 = (PointObject*)v1; - coord2 = (PointObject*)v2; - - if(coord1->coerced_object || coord2->coerced_object){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Point subtraction: arguments not valid for this operation....\n"); - } - if(coord1->size != coord2->size){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Point subtraction: points must have the same dimensions for this operation\n"); - } - - size = coord1->size; - for(x = 0; x < size; x++) { - coord[x] = coord1->coord[x] - coord2->coord[x]; - } - - //Point - Point = Vector - return newVectorObject(coord, size, Py_NEW); -} -//------------------------obj * obj------------------------------ -//mulplication -static PyObject *Point_mul(PyObject * p1, PyObject * p2) -{ - int x, size; - float coord[3], scalar; - PointObject *coord1 = NULL, *coord2 = NULL; - PyObject *f = NULL; - MatrixObject *mat = NULL; - QuaternionObject *quat = NULL; - - coord1 = (PointObject*)p1; - coord2 = (PointObject*)p2; - - if(coord1->coerced_object){ - if (PyFloat_Check(coord1->coerced_object) || - PyInt_Check(coord1->coerced_object)){ // FLOAT/INT * POINT - f = PyNumber_Float(coord1->coerced_object); - if(f == NULL) { // parsed item not a number - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Point multiplication: arguments not acceptable for this operation\n"); - } - - scalar = (float)PyFloat_AS_DOUBLE(f); - size = coord2->size; - for(x = 0; x < size; x++) { - coord[x] = coord2->coord[x] * scalar; - } - Py_DECREF(f); - return newPointObject(coord, size, Py_NEW); - } - }else{ - if(coord2->coerced_object){ - if (PyFloat_Check(coord2->coerced_object) || - PyInt_Check(coord2->coerced_object)){ // POINT * FLOAT/INT - f = PyNumber_Float(coord2->coerced_object); - if(f == NULL) { // parsed item not a number - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Point multiplication: arguments not acceptable for this operation\n"); - } - - scalar = (float)PyFloat_AS_DOUBLE(f); - size = coord1->size; - for(x = 0; x < size; x++) { - coord[x] = coord1->coord[x] * scalar; - } - Py_DECREF(f); - return newPointObject(coord, size, Py_NEW); - }else if(MatrixObject_Check(coord2->coerced_object)){ //POINT * MATRIX - mat = (MatrixObject*)coord2->coerced_object; - return row_point_multiplication(coord1, mat); - }else if(QuaternionObject_Check(coord2->coerced_object)){ //POINT * QUATERNION - quat = (QuaternionObject*)coord2->coerced_object; - if(coord1->size != 3){ - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Point multiplication: only 3D point rotations (with quats) currently supported\n"); - } - return quat_rotation((PyObject*)coord1, (PyObject*)quat); - } - } - } - - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Point multiplication: arguments not acceptable for this operation\n"); -} -//-------------------------- -obj ------------------------------- -//returns the negative of this object -static PyObject *Point_neg(PointObject *self) -{ - int x; - float coord[3]; - - for(x = 0; x < self->size; x++) - coord[x] = -self->coord[x]; - - return newPointObject(coord, self->size, Py_NEW); -} - -//------------------------coerce(obj, obj)----------------------- -//coercion of unknown types to type PointObject for numeric protocols -/*Coercion() is called whenever a math operation has 2 operands that - it doesn't understand how to evaluate. 2+Matrix for example. We want to - evaluate some of these operations like: (vector * 2), however, for math - to proceed, the unknown operand must be cast to a type that python math will - understand. (e.g. in the case above case, 2 must be cast to a vector and - then call vector.multiply(vector, scalar_cast_as_vector)*/ -static int Point_coerce(PyObject ** p1, PyObject ** p2) -{ - if(VectorObject_Check(*p2) || PyFloat_Check(*p2) || PyInt_Check(*p2) || - MatrixObject_Check(*p2) || QuaternionObject_Check(*p2)) { - PyObject *coerced = EXPP_incr_ret(*p2); - *p2 = newPointObject(NULL,3,Py_NEW); - ((PointObject*)*p2)->coerced_object = coerced; - Py_INCREF (*p1); - return 0; - } - - return EXPP_ReturnIntError(PyExc_TypeError, - "point.coerce(): unknown operand - can't coerce for numeric protocols"); -} -//-----------------PROTOCOL DECLARATIONS-------------------------- -static PySequenceMethods Point_SeqMethods = { - (inquiry) Point_len, /* sq_length */ - (binaryfunc) 0, /* sq_concat */ - (intargfunc) 0, /* sq_repeat */ - (intargfunc) Point_item, /* sq_item */ - (intintargfunc) Point_slice, /* sq_slice */ - (intobjargproc) Point_ass_item, /* sq_ass_item */ - (intintobjargproc) Point_ass_slice, /* sq_ass_slice */ -}; -static PyNumberMethods Point_NumMethods = { - (binaryfunc) Point_add, /* __add__ */ - (binaryfunc) Point_sub, /* __sub__ */ - (binaryfunc) Point_mul, /* __mul__ */ - (binaryfunc) 0, /* __div__ */ - (binaryfunc) 0, /* __mod__ */ - (binaryfunc) 0, /* __divmod__ */ - (ternaryfunc) 0, /* __pow__ */ - (unaryfunc) Point_neg, /* __neg__ */ - (unaryfunc) 0, /* __pos__ */ - (unaryfunc) 0, /* __abs__ */ - (inquiry) 0, /* __nonzero__ */ - (unaryfunc) 0, /* __invert__ */ - (binaryfunc) 0, /* __lshift__ */ - (binaryfunc) 0, /* __rshift__ */ - (binaryfunc) 0, /* __and__ */ - (binaryfunc) 0, /* __xor__ */ - (binaryfunc) 0, /* __or__ */ - (coercion) Point_coerce, /* __coerce__ */ - (unaryfunc) 0, /* __int__ */ - (unaryfunc) 0, /* __long__ */ - (unaryfunc) 0, /* __float__ */ - (unaryfunc) 0, /* __oct__ */ - (unaryfunc) 0, /* __hex__ */ - -}; -//------------------PY_OBECT DEFINITION-------------------------- -PyTypeObject point_Type = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size */ - "point", /*tp_name */ - sizeof(PointObject), /*tp_basicsize */ - 0, /*tp_itemsize */ - (destructor) Point_dealloc, /*tp_dealloc */ - (printfunc) 0, /*tp_print */ - (getattrfunc) Point_getattr, /*tp_getattr */ - (setattrfunc) Point_setattr, /*tp_setattr */ - 0, /*tp_compare */ - (reprfunc) Point_repr, /*tp_repr */ - &Point_NumMethods, /*tp_as_number */ - &Point_SeqMethods, /*tp_as_sequence */ -}; -//------------------------newPointObject (internal)------------- -//creates a new point object -/*pass Py_WRAP - if point is a WRAPPER for data allocated by BLENDER - (i.e. it was allocated elsewhere by MEM_mallocN()) - pass Py_NEW - if point is not a WRAPPER and managed by PYTHON - (i.e. it must be created here with PyMEM_malloc())*/ -PyObject *newPointObject(float *coord, int size, int type) -{ - PointObject *self; - int x; - - point_Type.ob_type = &PyType_Type; - self = PyObject_NEW(PointObject, &point_Type); - self->data.blend_data = NULL; - self->data.py_data = NULL; - if(size > 3 || size < 2) - return NULL; - self->size = size; - self->coerced_object = NULL; - - if(type == Py_WRAP){ - self->data.blend_data = coord; - self->coord = self->data.blend_data; - self->wrapped = Py_WRAP; - }else if (type == Py_NEW){ - self->data.py_data = PyMem_Malloc(size * sizeof(float)); - self->coord = self->data.py_data; - if(!coord) { //new empty - for(x = 0; x < size; x++){ - self->coord[x] = 0.0f; - } - }else{ - for(x = 0; x < size; x++){ - self->coord[x] = coord[x]; - } - } - self->wrapped = Py_NEW; - }else{ //bad type - return NULL; - } - return (PyObject *) self; -} diff --git a/source/blender/python/api2_2x/point.h b/source/blender/python/api2_2x/point.h deleted file mode 100644 index a9c4e5e4e2c..00000000000 --- a/source/blender/python/api2_2x/point.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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 LICENSE BLOCK ***** -*/ - -#ifndef EXPP_point_h -#define EXPP_point_h - -#include - -extern PyTypeObject point_Type; - -#define PointObject_Check(v) ((v)->ob_type == &point_Type) - -typedef struct { - PyObject_VAR_HEAD - struct{ - float *py_data; //python managed - float *blend_data; //blender managed - }data; - float *coord; //1D array of data (alias) - int size; - int wrapped; //is wrapped data? - PyObject *coerced_object; -} PointObject; -/*coerced_object is a pointer to the object that it was -coerced from when a dummy vector needs to be created from -the coerce() function for numeric protocol operations*/ - -/*struct data contains a pointer to the actual data that the -object uses. It can use either PyMem allocated data (which will -be stored in py_data) or be a wrapper for data allocated through -blender (stored in blend_data). This is an either/or struct not both*/ - -//prototypes -PyObject *Point_Zero( PointObject * self ); -PyObject *Point_toVector(PointObject * self); -PyObject *newPointObject(float *coord, int size, int type); - -#endif /* EXPP_point_h */ diff --git a/source/blender/python/api2_2x/quat.c b/source/blender/python/api2_2x/quat.c index 1871339d0b8..9c718d95c63 100644 --- a/source/blender/python/api2_2x/quat.c +++ b/source/blender/python/api2_2x/quat.c @@ -31,7 +31,6 @@ #include "BLI_arithb.h" #include "BKE_utildefines.h" #include "BLI_blenlib.h" -#include "gen_utils.h" //-------------------------DOC STRINGS --------------------------- @@ -84,7 +83,8 @@ PyObject *Quaternion_ToMatrix(QuaternionObject * self) PyObject *Quaternion_Normalize(QuaternionObject * self) { NormalQuat(self->quat); - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject*)self; } //----------------------------Quaternion.inverse()------------------ //invert the quat @@ -104,7 +104,8 @@ PyObject *Quaternion_Inverse(QuaternionObject * self) self->quat[x] /= (float)(mag * mag); } - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject*)self; } //----------------------------Quaternion.identity()----------------- //generate the identity quaternion @@ -115,7 +116,8 @@ PyObject *Quaternion_Identity(QuaternionObject * self) self->quat[2] = 0.0; self->quat[3] = 0.0; - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject*)self; } //----------------------------Quaternion.negate()------------------- //negate the quat @@ -125,7 +127,8 @@ PyObject *Quaternion_Negate(QuaternionObject * self) for(x = 0; x < 4; x++) { self->quat[x] = -self->quat[x]; } - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject*)self; } //----------------------------Quaternion.conjugate()---------------- //negate the vector part @@ -135,7 +138,8 @@ PyObject *Quaternion_Conjugate(QuaternionObject * self) for(x = 1; x < 4; x++) { self->quat[x] = -self->quat[x]; } - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject*)self; } //----------------------------Quaternion.copy()---------------- //return a copy of the quat @@ -216,9 +220,10 @@ static int Quaternion_len(QuaternionObject * self) //sequence accessor (get) static PyObject *Quaternion_item(QuaternionObject * self, int i) { - if(i < 0 || i >= 4) - return EXPP_ReturnPyObjError(PyExc_IndexError, - "quaternion[attribute]: array index out of range\n"); + if(i < 0 || i >= 4) { + PyErr_SetString(PyExc_IndexError, "quaternion[attribute]: array index out of range\n"); + return NULL; + } return PyFloat_FromDouble(self->quat[i]); } @@ -230,14 +235,14 @@ static int Quaternion_ass_item(QuaternionObject * self, int i, PyObject * ob) f = PyNumber_Float(ob); if(f == NULL) { // parsed item not a number - return EXPP_ReturnIntError(PyExc_TypeError, - "quaternion[attribute] = x: argument not a number\n"); + PyErr_SetString(PyExc_TypeError, "quaternion[attribute] = x: argument not a number\n"); + return -1; } if(i < 0 || i >= 4){ Py_DECREF(f); - return EXPP_ReturnIntError(PyExc_IndexError, - "quaternion[attribute] = x: array assignment index out of range\n"); + PyErr_SetString(PyExc_IndexError, "quaternion[attribute] = x: array assignment index out of range\n"); + return -1; } self->quat[i] = (float)PyFloat_AS_DOUBLE(f); Py_DECREF(f); @@ -279,26 +284,27 @@ static int Quaternion_ass_slice(QuaternionObject * self, int begin, int end, size = PySequence_Length(seq); if(size != (end - begin)){ - return EXPP_ReturnIntError(PyExc_TypeError, - "quaternion[begin:end] = []: size mismatch in slice assignment\n"); + PyErr_SetString(PyExc_TypeError, "quaternion[begin:end] = []: size mismatch in slice assignment\n"); + return -1; } for (i = 0; i < size; i++) { q = PySequence_GetItem(seq, i); if (q == NULL) { // Failed to read sequence - return EXPP_ReturnIntError(PyExc_RuntimeError, - "quaternion[begin:end] = []: unable to read sequence\n"); + PyErr_SetString(PyExc_RuntimeError, "quaternion[begin:end] = []: unable to read sequence\n"); + return -1; } f = PyNumber_Float(q); if(f == NULL) { // parsed item not a number Py_DECREF(q); - return EXPP_ReturnIntError(PyExc_TypeError, - "quaternion[begin:end] = []: sequence argument not a number\n"); + PyErr_SetString(PyExc_TypeError, "quaternion[begin:end] = []: sequence argument not a number\n"); + return -1; } quat[i] = (float)PyFloat_AS_DOUBLE(f); - EXPP_decr2(f,q); + Py_DECREF(f); + Py_DECREF(q); } //parsed well - now set in vector for(y = 0; y < size; y++){ @@ -319,8 +325,8 @@ static PyObject *Quaternion_add(PyObject * q1, PyObject * q2) quat2 = (QuaternionObject*)q2; if(quat1->coerced_object || quat2->coerced_object){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Quaternion addition: arguments not valid for this operation....\n"); + PyErr_SetString(PyExc_AttributeError, "Quaternion addition: arguments not valid for this operation....\n"); + return NULL; } for(x = 0; x < 4; x++) { quat[x] = quat1->quat[x] + quat2->quat[x]; @@ -340,8 +346,8 @@ static PyObject *Quaternion_sub(PyObject * q1, PyObject * q2) quat2 = (QuaternionObject*)q2; if(quat1->coerced_object || quat2->coerced_object){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Quaternion addition: arguments not valid for this operation....\n"); + PyErr_SetString(PyExc_AttributeError, "Quaternion addition: arguments not valid for this operation....\n"); + return NULL; } for(x = 0; x < 4; x++) { quat[x] = quat1->quat[x] - quat2->quat[x]; @@ -359,7 +365,6 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2) QuaternionObject *quat1 = NULL, *quat2 = NULL; PyObject *f = NULL; VectorObject *vec = NULL; - PointObject *pt = NULL; quat1 = (QuaternionObject*)q1; quat2 = (QuaternionObject*)q2; @@ -369,8 +374,8 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2) PyInt_Check(quat1->coerced_object)){ // FLOAT/INT * QUAT f = PyNumber_Float(quat1->coerced_object); if(f == NULL) { // parsed item not a number - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Quaternion multiplication: arguments not acceptable for this operation\n"); + PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: arguments not acceptable for this operation\n"); + return NULL; } scalar = (float)PyFloat_AS_DOUBLE(f); @@ -386,8 +391,8 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2) PyInt_Check(quat2->coerced_object)){ // QUAT * FLOAT/INT f = PyNumber_Float(quat2->coerced_object); if(f == NULL) { // parsed item not a number - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Quaternion multiplication: arguments not acceptable for this operation\n"); + PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: arguments not acceptable for this operation\n"); + return NULL; } scalar = (float)PyFloat_AS_DOUBLE(f); @@ -399,17 +404,10 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2) }else if(VectorObject_Check(quat2->coerced_object)){ //QUAT * VEC vec = (VectorObject*)quat2->coerced_object; if(vec->size != 3){ - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Quaternion multiplication: only 3D vector rotations currently supported\n"); + PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: only 3D vector rotations currently supported\n"); + return NULL; } return quat_rotation((PyObject*)quat1, (PyObject*)vec); - }else if(PointObject_Check(quat2->coerced_object)){ //QUAT * POINT - pt = (PointObject*)quat2->coerced_object; - if(pt->size != 3){ - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Quaternion multiplication: only 3D point rotations currently supported\n"); - } - return quat_rotation((PyObject*)quat1, (PyObject*)pt); } }else{ //QUAT * QUAT (dot product) for(x = 0; x < 4; x++) { @@ -419,8 +417,8 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2) } } - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Quaternion multiplication: arguments not acceptable for this operation\n"); + PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: arguments not acceptable for this operation\n"); + return NULL; } //------------------------coerce(obj, obj)----------------------- //coercion of unknown types to type QuaternionObject for numeric protocols @@ -432,17 +430,18 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2) then call vector.multiply(vector, scalar_cast_as_vector)*/ static int Quaternion_coerce(PyObject ** q1, PyObject ** q2) { - if(VectorObject_Check(*q2) || PyFloat_Check(*q2) || PyInt_Check(*q2) || - PointObject_Check(*q2)) { - PyObject *coerced = EXPP_incr_ret(*q2); + if(VectorObject_Check(*q2) || PyFloat_Check(*q2) || PyInt_Check(*q2)) { + PyObject *coerced = (PyObject *)(*q2); + Py_INCREF(coerced); + *q2 = newQuaternionObject(NULL,Py_NEW); ((QuaternionObject*)*q2)->coerced_object = coerced; Py_INCREF (*q1); return 0; } - return EXPP_ReturnIntError(PyExc_TypeError, - "quaternion.coerce(): unknown operand - can't coerce for numeric protocols"); + PyErr_SetString(PyExc_TypeError, "quaternion.coerce(): unknown operand - can't coerce for numeric protocols"); + return -1; } //-----------------PROTOCOL DECLARATIONS-------------------------- static PySequenceMethods Quaternion_SeqMethods = { @@ -503,10 +502,10 @@ static int Quaternion_setAxis( QuaternionObject * self, PyObject * value, void * { float param= (float)PyFloat_AsDouble( value ); - if (param==-1 && PyErr_Occurred()) - return EXPP_ReturnIntError( PyExc_TypeError, - "expected a number for the vector axis" ); - + if (param==-1 && PyErr_Occurred()) { + PyErr_SetString( PyExc_TypeError, "expected a number for the vector axis" ); + return -1; + } switch( (long)type ) { case 'W': self->quat[0]= param; diff --git a/source/blender/python/api2_2x/vector.c b/source/blender/python/api2_2x/vector.c index 8f2e8991519..f65c4dff600 100644 --- a/source/blender/python/api2_2x/vector.c +++ b/source/blender/python/api2_2x/vector.c @@ -30,7 +30,6 @@ #include "BLI_blenlib.h" #include "BKE_utildefines.h" #include "BLI_arithb.h" -#include "gen_utils.h" /*-------------------------DOC STRINGS ---------------------------*/ @@ -40,7 +39,6 @@ char Vector_Negate_doc[] = "() - changes vector to it's additive inverse"; char Vector_Resize2D_doc[] = "() - resize a vector to [x,y]"; char Vector_Resize3D_doc[] = "() - resize a vector to [x,y,z]"; char Vector_Resize4D_doc[] = "() - resize a vector to [x,y,z,w]"; -char Vector_toPoint_doc[] = "() - create a new Point Object from this vector"; char Vector_ToTrackQuat_doc[] = "(track, up) - extract a quaternion from the vector and the track and up axis"; char Vector_reflect_doc[] = "(mirror) - return a vector reflected on the mirror normal"; char Vector_copy_doc[] = "() - return a copy of the vector"; @@ -52,7 +50,6 @@ struct PyMethodDef Vector_methods[] = { {"resize2D", (PyCFunction) Vector_Resize2D, METH_NOARGS, Vector_Resize2D_doc}, {"resize3D", (PyCFunction) Vector_Resize3D, METH_NOARGS, Vector_Resize2D_doc}, {"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, Vector_Resize2D_doc}, - {"toPoint", (PyCFunction) Vector_toPoint, METH_NOARGS, Vector_toPoint_doc}, {"toTrackQuat", ( PyCFunction ) Vector_ToTrackQuat, METH_VARARGS, Vector_ToTrackQuat_doc}, {"reflect", ( PyCFunction ) Vector_reflect, METH_O, Vector_reflect_doc}, {"copy", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc}, @@ -61,23 +58,6 @@ struct PyMethodDef Vector_methods[] = { }; /*-----------------------------METHODS---------------------------- - --------------------------Vector.toPoint()---------------------- - create a new point object to represent this vector */ -PyObject *Vector_toPoint(VectorObject * self) -{ - float coord[3]; - int i; - - if(self->size < 2 || self->size > 3) { - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Vector.toPoint(): inappropriate vector size - expects 2d or 3d vector\n"); - } - for(i = 0; i < self->size; i++){ - coord[i] = self->vec[i]; - } - - return newPointObject(coord, self->size, Py_NEW); -} /*----------------------------Vector.zero() ---------------------- set the vector data to 0,0,0 */ PyObject *Vector_Zero(VectorObject * self) @@ -86,7 +66,8 @@ PyObject *Vector_Zero(VectorObject * self) for(i = 0; i < self->size; i++) { self->vec[i] = 0.0f; } - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject*)self; } /*----------------------------Vector.normalize() ----------------- normalize the vector data to a unit vector */ @@ -102,7 +83,8 @@ PyObject *Vector_Normalize(VectorObject * self) for(i = 0; i < self->size; i++) { self->vec[i] /= norm; } - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject*)self; } @@ -110,50 +92,54 @@ PyObject *Vector_Normalize(VectorObject * self) resize the vector to x,y */ PyObject *Vector_Resize2D(VectorObject * self) { - if(self->wrapped==Py_WRAP) - return EXPP_ReturnPyObjError(PyExc_TypeError, - "vector.resize2d(): cannot resize wrapped data - only python vectors\n"); - + if(self->wrapped==Py_WRAP) { + PyErr_SetString(PyExc_TypeError, "vector.resize2d(): cannot resize wrapped data - only python vectors\n"); + return NULL; + } self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 2)); - if(self->vec == NULL) - return EXPP_ReturnPyObjError(PyExc_MemoryError, - "vector.resize2d(): problem allocating pointer space\n\n"); + if(self->vec == NULL) { + PyErr_SetString(PyExc_MemoryError, "vector.resize2d(): problem allocating pointer space\n\n"); + return NULL; + } self->size = 2; - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject*)self; } /*----------------------------Vector.resize3D() ------------------ resize the vector to x,y,z */ PyObject *Vector_Resize3D(VectorObject * self) { - if (self->wrapped==Py_WRAP) - return EXPP_ReturnPyObjError(PyExc_TypeError, - "vector.resize3d(): cannot resize wrapped data - only python vectors\n"); - + if (self->wrapped==Py_WRAP) { + PyErr_SetString(PyExc_TypeError, "vector.resize3d(): cannot resize wrapped data - only python vectors\n"); + return NULL; + } self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 3)); - if(self->vec == NULL) - return EXPP_ReturnPyObjError(PyExc_MemoryError, - "vector.resize3d(): problem allocating pointer space\n\n"); + if(self->vec == NULL) { + PyErr_SetString(PyExc_MemoryError, "vector.resize3d(): problem allocating pointer space\n\n"); + return NULL; + } if(self->size == 2) self->vec[2] = 0.0f; self->size = 3; - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject*)self; } /*----------------------------Vector.resize4D() ------------------ resize the vector to x,y,z,w */ PyObject *Vector_Resize4D(VectorObject * self) { - if(self->wrapped==Py_WRAP) - return EXPP_ReturnPyObjError(PyExc_TypeError, - "vector.resize4d(): cannot resize wrapped data - only python vectors\n"); - + if(self->wrapped==Py_WRAP) { + PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize wrapped data - only python vectors"); + return NULL; + } self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 4)); - if(self->vec == NULL) - return EXPP_ReturnPyObjError(PyExc_MemoryError, - "vector.resize4d(): problem allocating pointer space\n\n"); - + if(self->vec == NULL) { + PyErr_SetString(PyExc_MemoryError, "vector.resize4d(): problem allocating pointer space\n\n"); + return NULL; + } if(self->size == 2){ self->vec[2] = 0.0f; self->vec[3] = 1.0f; @@ -161,7 +147,8 @@ PyObject *Vector_Resize4D(VectorObject * self) self->vec[3] = 1.0f; } self->size = 4; - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject*)self; } /*----------------------------Vector.toTrackQuat(track, up) ---------------------- extract a quaternion from the vector and the track and up axis */ @@ -172,11 +159,12 @@ PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) short track = 2, up = 1; if( !PyArg_ParseTuple ( args, "|ss", &strack, &sup ) ) { - return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected optional two strings\n" ); + PyErr_SetString( PyExc_TypeError, "expected optional two strings\n" ); + return NULL; } if (self->size != 3) { - return EXPP_ReturnPyObjError( PyExc_TypeError, "only for 3D vectors\n" ); + PyErr_SetString( PyExc_TypeError, "only for 3D vectors\n" ); + return NULL; } if (strack) { @@ -196,13 +184,13 @@ PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) track = 5; break; default: - return EXPP_ReturnPyObjError( PyExc_ValueError, - "only X, -X, Y, -Y, Z or -Z for track axis\n" ); + PyErr_SetString( PyExc_ValueError, "only X, -X, Y, -Y, Z or -Z for track axis\n" ); + return NULL; } } else { - return EXPP_ReturnPyObjError( PyExc_ValueError, - "only X, -X, Y, -Y, Z or -Z for track axis\n" ); + PyErr_SetString( PyExc_ValueError, "only X, -X, Y, -Y, Z or -Z for track axis\n" ); + return NULL; } } else if (strlen(strack) == 1) { @@ -221,13 +209,13 @@ PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) track = 2; break; default: - return EXPP_ReturnPyObjError( PyExc_ValueError, - "only X, -X, Y, -Y, Z or -Z for track axis\n" ); + PyErr_SetString( PyExc_ValueError, "only X, -X, Y, -Y, Z or -Z for track axis\n" ); + return NULL; } } else { - return EXPP_ReturnPyObjError( PyExc_ValueError, - "only X, -X, Y, -Y, Z or -Z for track axis\n" ); + PyErr_SetString( PyExc_ValueError, "only X, -X, Y, -Y, Z or -Z for track axis\n" ); + return NULL; } } @@ -247,19 +235,19 @@ PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) up = 2; break; default: - return EXPP_ReturnPyObjError( PyExc_ValueError, - "only X, Y or Z for up axis\n" ); + PyErr_SetString( PyExc_ValueError, "only X, Y or Z for up axis\n" ); + return NULL; } } else { - return EXPP_ReturnPyObjError( PyExc_ValueError, - "only X, Y or Z for up axis\n" ); + PyErr_SetString( PyExc_ValueError, "only X, Y or Z for up axis\n" ); + return NULL; } } if (track == up) { - return EXPP_ReturnPyObjError( PyExc_ValueError, - "Can't have the same axis for track and up\n" ); + PyErr_SetString( PyExc_ValueError, "Can't have the same axis for track and up\n" ); + return NULL; } /* @@ -291,9 +279,10 @@ PyObject *Vector_reflect( VectorObject * self, PyObject * value ) int i; float norm = 0.0f; - if (!VectorObject_Check(value)) - return EXPP_ReturnPyObjError( PyExc_TypeError, "expected a vector argument" ); - + if (!VectorObject_Check(value)) { + PyErr_SetString( PyExc_TypeError, "expected a vector argument" ); + return NULL; + } mirrvec = (VectorObject *)value; mirror[0] = mirrvec->vec[0]; @@ -375,9 +364,10 @@ static int Vector_len(VectorObject * self) sequence accessor (get)*/ static PyObject *Vector_item(VectorObject * self, int i) { - if(i < 0 || i >= self->size) - return EXPP_ReturnPyObjError(PyExc_IndexError, - "vector[index]: out of range\n"); + if(i < 0 || i >= self->size) { + PyErr_SetString(PyExc_IndexError,"vector[index]: out of range\n"); + return NULL; + } return PyFloat_FromDouble(self->vec[i]); @@ -388,13 +378,13 @@ static int Vector_ass_item(VectorObject * self, int i, PyObject * ob) { if(!(PyNumber_Check(ob))) { /* parsed item not a number */ - return EXPP_ReturnIntError(PyExc_TypeError, - "vector[index] = x: index argument not a number\n"); + PyErr_SetString(PyExc_TypeError, "vector[index] = x: index argument not a number\n"); + return -1; } if(i < 0 || i >= self->size){ - return EXPP_ReturnIntError(PyExc_IndexError, - "vector[index] = x: assignment index out of range\n"); + PyErr_SetString(PyExc_IndexError, "vector[index] = x: assignment index out of range\n"); + return -1; } self->vec[i] = (float)PyFloat_AsDouble(ob); return 0; @@ -436,21 +426,21 @@ static int Vector_ass_slice(VectorObject * self, int begin, int end, size = PySequence_Length(seq); if(size != (end - begin)){ - return EXPP_ReturnIntError(PyExc_TypeError, - "vector[begin:end] = []: size mismatch in slice assignment\n"); + PyErr_SetString(PyExc_TypeError, "vector[begin:end] = []: size mismatch in slice assignment\n"); + return -1; } for (i = 0; i < size; i++) { v = PySequence_GetItem(seq, i); if (v == NULL) { /* Failed to read sequence */ - return EXPP_ReturnIntError(PyExc_RuntimeError, - "vector[begin:end] = []: unable to read sequence\n"); + PyErr_SetString(PyExc_RuntimeError, "vector[begin:end] = []: unable to read sequence\n"); + return -1; } if(!PyNumber_Check(v)) { /* parsed item not a number */ Py_DECREF(v); - return EXPP_ReturnIntError(PyExc_TypeError, - "vector[begin:end] = []: sequence argument not a number\n"); + PyErr_SetString(PyExc_TypeError, "vector[begin:end] = []: sequence argument not a number\n"); + return -1; } vec[i] = (float)PyFloat_AsDouble(v); @@ -481,33 +471,18 @@ static PyObject *Vector_add(PyObject * v1, PyObject * v2) /* make sure v1 is always the vector */ if (vec1 && vec2 ) { /*VECTOR + VECTOR*/ - if(vec1->size != vec2->size) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Vector addition: vectors must have the same dimensions for this operation\n"); - + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Vector addition: vectors must have the same dimensions for this operation\n"); + return NULL; + } for(i = 0; i < vec1->size; i++) { vec[i] = vec1->vec[i] + vec2->vec[i]; } return newVectorObject(vec, vec1->size, Py_NEW); } - if(PointObject_Check(v2)){ /*VECTOR + POINT*/ - /*Point translation*/ - PointObject *pt = (PointObject*)v2; - - if(pt->size == vec1->size){ - for(i = 0; i < vec1->size; i++){ - vec[i] = vec1->vec[i] + pt->coord[i]; - } - }else{ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Vector addition: arguments are the wrong size....\n"); - } - return newPointObject(vec, vec1->size, Py_NEW); - } - - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Vector addition: arguments not valid for this operation....\n"); + PyErr_SetString(PyExc_AttributeError, "Vector addition: arguments not valid for this operation....\n"); + return NULL; } /* ------------------------obj += obj------------------------------ @@ -527,10 +502,10 @@ static PyObject *Vector_iadd(PyObject * v1, PyObject * v2) /* make sure v1 is always the vector */ if (vec1 && vec2 ) { /*VECTOR + VECTOR*/ - if(vec1->size != vec2->size) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Vector addition: vectors must have the same dimensions for this operation\n"); - + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Vector addition: vectors must have the same dimensions for this operation\n"); + return NULL; + } for(i = 0; i < vec1->size; i++) { vec1->vec[i] += vec2->vec[i]; } @@ -538,24 +513,8 @@ static PyObject *Vector_iadd(PyObject * v1, PyObject * v2) return v1; } - if(PointObject_Check(v2)){ /*VECTOR + POINT*/ - /*Point translation*/ - PointObject *pt = (PointObject*)v2; - - if(pt->size == vec1->size){ - for(i = 0; i < vec1->size; i++){ - vec1->vec[i] += pt->coord[i]; - } - }else{ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Vector addition: arguments are the wrong size....\n"); - } - Py_INCREF( v1 ); - return v1; - } - - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Vector addition: arguments not valid for this operation....\n"); + PyErr_SetString(PyExc_AttributeError, "Vector addition: arguments not valid for this operation....\n"); + return NULL; } /*------------------------obj - obj------------------------------ @@ -566,17 +525,17 @@ static PyObject *Vector_sub(PyObject * v1, PyObject * v2) float vec[4]; VectorObject *vec1 = NULL, *vec2 = NULL; - if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Vector subtraction: arguments not valid for this operation....\n"); - + if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) { + PyErr_SetString(PyExc_AttributeError, "Vector subtraction: arguments not valid for this operation....\n"); + return NULL; + } vec1 = (VectorObject*)v1; vec2 = (VectorObject*)v2; - if(vec1->size != vec2->size) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Vector subtraction: vectors must have the same dimensions for this operation\n"); - + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Vector subtraction: vectors must have the same dimensions for this operation\n"); + return NULL; + } for(i = 0; i < vec1->size; i++) { vec[i] = vec1->vec[i] - vec2->vec[i]; } @@ -591,16 +550,17 @@ static PyObject *Vector_isub(PyObject * v1, PyObject * v2) int i, size; VectorObject *vec1 = NULL, *vec2 = NULL; - if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Vector subtraction: arguments not valid for this operation....\n"); - + if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) { + PyErr_SetString(PyExc_AttributeError, "Vector subtraction: arguments not valid for this operation....\n"); + return NULL; + } vec1 = (VectorObject*)v1; vec2 = (VectorObject*)v2; - if(vec1->size != vec2->size) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Vector subtraction: vectors must have the same dimensions for this operation\n"); + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Vector subtraction: vectors must have the same dimensions for this operation\n"); + return NULL; + } size = vec1->size; for(i = 0; i < vec1->size; i++) { @@ -628,9 +588,10 @@ static PyObject *Vector_mul(PyObject * v1, PyObject * v2) int i; double dot = 0.0f; - if(vec1->size != vec2->size) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Vector multiplication: vectors must have the same dimensions for this operation\n"); + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Vector multiplication: vectors must have the same dimensions for this operation\n"); + return NULL; + } /*dot product*/ for(i = 0; i < vec1->size; i++) { @@ -664,15 +625,15 @@ static PyObject *Vector_mul(PyObject * v1, PyObject * v2) return row_vector_multiplication(vec1, (MatrixObject*)v2); } else if (QuaternionObject_Check(v2)) { QuaternionObject *quat = (QuaternionObject*)v2; - if(vec1->size != 3) - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Vector multiplication: only 3D vector rotations (with quats) currently supported\n"); - + if(vec1->size != 3) { + PyErr_SetString(PyExc_TypeError, "Vector multiplication: only 3D vector rotations (with quats) currently supported\n"); + return NULL; + } return quat_rotation((PyObject*)vec1, (PyObject*)quat); } - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Vector multiplication: arguments not acceptable for this operation\n"); + PyErr_SetString(PyExc_TypeError, "Vector multiplication: arguments not acceptable for this operation\n"); + return NULL; } /*------------------------obj *= obj------------------------------ @@ -702,8 +663,8 @@ static PyObject *Vector_imul(PyObject * v1, PyObject * v2) if(mat->colSize != size){ if(mat->rowSize == 4 && vec->size != 3){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "vector * matrix: matrix column size and the vector size must be the same"); + PyErr_SetString(PyExc_AttributeError, "vector * matrix: matrix column size and the vector size must be the same"); + return NULL; } else { vecCopy[3] = 1.0f; } @@ -726,8 +687,8 @@ static PyObject *Vector_imul(PyObject * v1, PyObject * v2) Py_INCREF( v1 ); return v1; } - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Vector multiplication: arguments not acceptable for this operation\n"); + PyErr_SetString(PyExc_TypeError, "Vector multiplication: arguments not acceptable for this operation\n"); + return NULL; } /*------------------------obj / obj------------------------------ @@ -738,22 +699,22 @@ static PyObject *Vector_div(PyObject * v1, PyObject * v2) float vec[4], scalar; VectorObject *vec1 = NULL; - if(!VectorObject_Check(v1)) /* not a vector */ - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Vector division: Vector must be divided by a float\n"); - + if(!VectorObject_Check(v1)) { /* not a vector */ + PyErr_SetString(PyExc_TypeError, "Vector division: Vector must be divided by a float\n"); + return NULL; + } vec1 = (VectorObject*)v1; /* vector */ - if(!PyNumber_Check(v2)) /* parsed item not a number */ - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Vector division: Vector must be divided by a float\n"); - + if(!PyNumber_Check(v2)) { /* parsed item not a number */ + PyErr_SetString(PyExc_TypeError, "Vector division: Vector must be divided by a float\n"); + return NULL; + } scalar = (float)PyFloat_AsDouble(v2); - if(scalar==0.0) /* not a vector */ - return EXPP_ReturnPyObjError(PyExc_ZeroDivisionError, - "Vector division: divide by zero error.\n"); - + if(scalar==0.0) { /* not a vector */ + PyErr_SetString(PyExc_ZeroDivisionError, "Vector division: divide by zero error.\n"); + return NULL; + } size = vec1->size; for(i = 0; i < size; i++) { vec[i] = vec1->vec[i] / scalar; @@ -769,22 +730,24 @@ static PyObject *Vector_idiv(PyObject * v1, PyObject * v2) float scalar; VectorObject *vec1 = NULL; - /*if(!VectorObject_Check(v1)) - return EXPP_ReturnIntError(PyExc_TypeError, - "Vector division: Vector must be divided by a float\n");*/ + /*if(!VectorObject_Check(v1)) { + PyErr_SetString(PyExc_TypeError, "Vector division: Vector must be divided by a float\n"); + return -1; + }*/ vec1 = (VectorObject*)v1; /* vector */ - if(!PyNumber_Check(v2)) /* parsed item not a number */ - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Vector division: Vector must be divided by a float\n"); + if(!PyNumber_Check(v2)) { /* parsed item not a number */ + PyErr_SetString(PyExc_TypeError, "Vector division: Vector must be divided by a float\n"); + return NULL; + } scalar = (float)PyFloat_AsDouble(v2); - if(scalar==0.0) /* not a vector */ - return EXPP_ReturnPyObjError(PyExc_ZeroDivisionError, - "Vector division: divide by zero error.\n"); - + if(scalar==0.0) { /* not a vector */ + PyErr_SetString(PyExc_ZeroDivisionError, "Vector division: divide by zero error.\n"); + return NULL; + } size = vec1->size; for(i = 0; i < size; i++) { vec1->vec[i] /= scalar; @@ -854,9 +817,9 @@ PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_t if (!VectorObject_Check(objectA) || !VectorObject_Check(objectB)){ if (comparison_type == Py_NE){ - return EXPP_incr_ret(Py_True); + Py_RETURN_TRUE; }else{ - return EXPP_incr_ret(Py_False); + Py_RETURN_FALSE; } } vecA = (VectorObject*)objectA; @@ -864,9 +827,9 @@ PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_t if (vecA->size != vecB->size){ if (comparison_type == Py_NE){ - return EXPP_incr_ret(Py_True); + Py_RETURN_TRUE; }else{ - return EXPP_incr_ret(Py_False); + Py_RETURN_FALSE; } } @@ -919,9 +882,9 @@ PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_t break; } if (result == 1){ - return EXPP_incr_ret(Py_True); + Py_RETURN_TRUE; }else{ - return EXPP_incr_ret(Py_False); + Py_RETURN_FALSE; } } /*-----------------PROTCOL DECLARATIONS--------------------------*/ @@ -1003,23 +966,24 @@ static PyObject *Vector_getAxis( VectorObject * self, void *type ) case 'Y': return PyFloat_FromDouble(self->vec[1]); case 'Z': /* these are backwards, but that how it works */ - if(self->size < 3) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "vector.z: error, cannot get this axis for a 2D vector\n"); - else + if(self->size < 3) { + PyErr_SetString(PyExc_AttributeError, "vector.z: error, cannot get this axis for a 2D vector\n"); + return NULL; + } + else { return PyFloat_FromDouble(self->vec[2]); + } case 'W': - if(self->size < 4) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "vector.w: error, cannot get this axis for a 3D vector\n"); + if(self->size < 4) { + PyErr_SetString(PyExc_AttributeError, "vector.w: error, cannot get this axis for a 3D vector\n"); + return NULL; + } return PyFloat_FromDouble(self->vec[3]); default: { - char errstr[1024]; - sprintf( errstr, "undefined type '%d' in Vector_getAxis", - (int)((long)type & 0xff)); - return EXPP_ReturnPyObjError( PyExc_RuntimeError, errstr ); + PyErr_SetString( PyExc_RuntimeError, "undefined type in Vector_getAxis" ); + return NULL; } } } @@ -1028,10 +992,10 @@ static int Vector_setAxis( VectorObject * self, PyObject * value, void * type ) { float param= (float)PyFloat_AsDouble( value ); - if (param==-1 && PyErr_Occurred()) - return EXPP_ReturnIntError( PyExc_TypeError, - "expected a number for the vector axis" ); - + if (param==-1 && PyErr_Occurred()) { + PyErr_SetString( PyExc_TypeError, "expected a number for the vector axis" ); + return -1; + } switch( (long)type ) { case 'X': /* these are backwards, but that how it works */ self->vec[0]= param; @@ -1040,16 +1004,17 @@ static int Vector_setAxis( VectorObject * self, PyObject * value, void * type ) self->vec[1]= param; break; case 'Z': /* these are backwards, but that how it works */ - if(self->size < 3) - return EXPP_ReturnIntError(PyExc_AttributeError, - "vector.z: error, cannot get this axis for a 2D vector\n"); + if(self->size < 3) { + PyErr_SetString(PyExc_AttributeError, "vector.z: error, cannot get this axis for a 2D vector\n"); + return -1; + } self->vec[2]= param; break; case 'W': - if(self->size < 4) - return EXPP_ReturnIntError(PyExc_AttributeError, - "vector.w: error, cannot get this axis for a 3D vector\n"); - + if(self->size < 4) { + PyErr_SetString(PyExc_AttributeError, "vector.w: error, cannot get this axis for a 3D vector\n"); + return -1; + } self->vec[3]= param; break; } @@ -1074,16 +1039,16 @@ static int Vector_setLength( VectorObject * self, PyObject * value ) double dot = 0.0f, param; int i; - if (!PyNumber_Check(value)) - return EXPP_ReturnIntError( PyExc_TypeError, - "expected a number for the vector axis" ); - + if (!PyNumber_Check(value)) { + PyErr_SetString( PyExc_TypeError, "expected a number for the vector axis" ); + return -1; + } param= PyFloat_AsDouble( value ); - if (param < 0) - return EXPP_ReturnIntError( PyExc_TypeError, - "cannot set a vectors length to a negative value" ); - + if (param < 0) { + PyErr_SetString( PyExc_TypeError, "cannot set a vectors length to a negative value" ); + return -1; + } if (param==0) { for(i = 0; i < self->size; i++){ self->vec[i]= 0; @@ -1297,7 +1262,8 @@ PyObject *Vector_Negate(VectorObject * self) self->vec[i] = -(self->vec[i]); } /*printf("Vector.negate(): Deprecated: use -vector instead\n");*/ - return EXPP_incr_ret((PyObject*)self); + Py_INCREF(self); + return (PyObject*)self; } /*################################################################### ###########################DEPRECATED##############################*/ diff --git a/source/blender/python/api2_2x/vector.h b/source/blender/python/api2_2x/vector.h index 898e3947abd..9ec2eff8047 100644 --- a/source/blender/python/api2_2x/vector.h +++ b/source/blender/python/api2_2x/vector.h @@ -50,7 +50,6 @@ PyObject *Vector_Negate( VectorObject * self ); PyObject *Vector_Resize2D( VectorObject * self ); PyObject *Vector_Resize3D( VectorObject * self ); PyObject *Vector_Resize4D( VectorObject * self ); -PyObject *Vector_toPoint( VectorObject * self ); PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ); PyObject *Vector_reflect( VectorObject * self, PyObject * value ); PyObject *Vector_copy( VectorObject * self ); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 06ba8f16a3b..cd141799f64 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -1437,7 +1437,6 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem Object *ob= obr->ob; Object *tob=0; Material *ma=0; - MTFace *mtface; ParticleSystemModifierData *psmd; ParticleSystem *tpsys=0; ParticleSettings *part, *tpart=0; diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt index b848fa9ef42..c4623b5b6fe 100644 --- a/source/gameengine/Ketsji/CMakeLists.txt +++ b/source/gameengine/Ketsji/CMakeLists.txt @@ -30,9 +30,7 @@ SET(SRC ../../../source/blender/python/api2_2x/Mathutils.c ../../../source/blender/python/api2_2x/constant.c ../../../source/blender/python/api2_2x/euler.c - ../../../source/blender/python/api2_2x/gen_utils.c ../../../source/blender/python/api2_2x/matrix.c - ../../../source/blender/python/api2_2x/point.c ../../../source/blender/python/api2_2x/quat.c ../../../source/blender/python/api2_2x/vector.c ../../../source/blender/python/api2_2x/bpy_internal_import.c diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index 61e722fb957..d97f13b0758 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -11,9 +11,7 @@ sources.extend([\ '#source/blender/python/api2_2x/Mathutils.c',\ '#source/blender/python/api2_2x/constant.c',\ '#source/blender/python/api2_2x/euler.c',\ - '#source/blender/python/api2_2x/gen_utils.c',\ '#source/blender/python/api2_2x/matrix.c',\ - '#source/blender/python/api2_2x/point.c',\ '#source/blender/python/api2_2x/quat.c',\ '#source/blender/python/api2_2x/vector.c',\ ]) -- cgit v1.2.3 From d11a5bbef2750c9e95c0657eb9d965de375b2982 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Tue, 21 Apr 2009 11:01:09 +0000 Subject: BGE: Support mesh modifiers in the game engine. Realtime modifiers applied on mesh objects will be supported in the game engine with the following limitations: - Only real time modifiers are supported (basically all of them!) - Virtual modifiers resulting from parenting are not supported: armature, curve, lattice. You can still use these modifiers (armature is really not recommended) but in non parent mode. The BGE has it's own parenting capability for armature. - Modifiers are computed on the host (using blender modifier stack). - Modifiers are statically evaluated: any possible time dependency in the modifiers is not supported (don't know enough about modifiers to be more specific). - Modifiers are reevaluated if the underlying mesh is deformed due to shape action or armature action. Beware that this is very CPU intensive; modifiers should really be used for static objects only. - Physics is still based on the original mesh: if you have a mirror modifier, the physic shape will be limited to one half of the resulting object. Therefore, the modifiers should preferably be used on graphic objects. - Scripts have no access to the modified mesh. - Modifiers that are based on objects interaction (boolean,..) will not be dependent on the objects position in the GE. What you see in the 3D view is what you get in the GE regardless on the object position, velocity, etc. Besides that, the feature is compatible with all the BGE features that affect meshes: armature action, shape action, relace mesh, VideoTexture, add object, dupligroup. Known problems: - This feature is a bit hacky: the BGE uses the derived mesh draw functions to display the object. This drawing method is a bit slow and is not 100% compatible with the BGE. There may be some problems in multi-texture mode: the multi-texture coordinates are not sent to the GPU. Texface and GLSL on the other hand should be fully supported. - Culling is still based on the extend of the original mesh. If you have a modifer that extends the size of the mesh, the object may disappear while still in the view frustrum. - Derived mesh is not shared between replicas. The derived mesh is allocated and computed for each object with modifiers, regardless if they are static replicas. - Display list are not created on objects with modifiers. I should be able to fix the above problems before release. However, the feature is already useful for game development. Once you are ready to release the game, you can apply the modifiers to get back display list support and mesh sharing capability. MSVC, scons, Cmake, makefile updated. Enjoy /benoit --- source/blender/blenkernel/BKE_DerivedMesh.h | 3 + source/blender/blenkernel/intern/DerivedMesh.c | 21 ++- .../Converter/BL_BlenderDataConversion.cpp | 18 ++- .../gameengine/Converter/BL_ModifierDeformer.cpp | 149 +++++++++++++++++++++ source/gameengine/Converter/BL_ModifierDeformer.h | 97 ++++++++++++++ source/gameengine/Converter/BL_ShapeDeformer.cpp | 10 +- source/gameengine/Converter/BL_ShapeDeformer.h | 3 +- source/gameengine/Converter/BL_SkinDeformer.cpp | 58 ++++---- source/gameengine/Converter/BL_SkinDeformer.h | 4 +- source/gameengine/Converter/BL_SkinMeshObject.cpp | 2 +- source/gameengine/Ketsji/BL_Material.cpp | 2 +- source/gameengine/Ketsji/BL_Material.h | 3 +- source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 24 +++- source/gameengine/Ketsji/KX_BlenderMaterial.h | 4 +- source/gameengine/Ketsji/KX_PolygonMaterial.cpp | 14 ++ source/gameengine/Ketsji/KX_PolygonMaterial.h | 6 +- source/gameengine/Ketsji/KX_Scene.cpp | 36 ++++- source/gameengine/Rasterizer/CMakeLists.txt | 1 + source/gameengine/Rasterizer/Makefile | 1 + source/gameengine/Rasterizer/RAS_Deformer.h | 4 + .../gameengine/Rasterizer/RAS_IPolygonMaterial.cpp | 30 +++++ .../gameengine/Rasterizer/RAS_IPolygonMaterial.h | 11 +- .../gameengine/Rasterizer/RAS_MaterialBucket.cpp | 39 ++++++ source/gameengine/Rasterizer/RAS_MaterialBucket.h | 3 + source/gameengine/Rasterizer/RAS_MeshObject.cpp | 13 ++ source/gameengine/Rasterizer/RAS_MeshObject.h | 1 + .../Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt | 4 + .../Rasterizer/RAS_OpenGLRasterizer/Makefile | 5 + .../RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp | 36 +++-- .../RAS_OpenGLRasterizer/RAS_ListRasterizer.h | 8 +- .../RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp | 79 +++++++++++ .../RAS_VAOpenGLRasterizer.cpp | 12 ++ .../Rasterizer/RAS_OpenGLRasterizer/SConscript | 2 + 33 files changed, 637 insertions(+), 66 deletions(-) create mode 100644 source/gameengine/Converter/BL_ModifierDeformer.cpp create mode 100644 source/gameengine/Converter/BL_ModifierDeformer.h (limited to 'source') diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index 263b17151e7..7ee8a424d03 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -444,6 +444,9 @@ DerivedMesh *mesh_create_derived_no_deform(struct Object *ob, DerivedMesh *mesh_create_derived_no_deform_render(struct Object *ob, float (*vertCos)[3], CustomDataMask dataMask); +/* for gameengine */ +DerivedMesh *mesh_create_derived_no_virtual(struct Object *ob, float (*vertCos)[3], + CustomDataMask dataMask); DerivedMesh *editmesh_get_derived_base(void); DerivedMesh *editmesh_get_derived_cage(CustomDataMask dataMask); diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index d43cbdebe72..eb2975be0c0 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2111,6 +2111,11 @@ static void add_orco_dm(Object *ob, EditMesh *em, DerivedMesh *dm, DerivedMesh * DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, orco); } +/* new value for useDeform -1 (hack for the gameengine): + * - apply only the modifier stack of the object, skipping the virtual modifiers, + * - don't apply the key + * - apply deform modifiers and input vertexco + */ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3], DerivedMesh **deform_r, DerivedMesh **final_r, int useRenderParams, int useDeform, @@ -2125,7 +2130,7 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3], int numVerts = me->totvert; int required_mode; - md = firstmd = modifiers_getVirtualModifierList(ob); + md = firstmd = (useDeform<0) ? ob->modifiers.first : modifiers_getVirtualModifierList(ob); modifiers_clearErrors(ob); @@ -2142,8 +2147,10 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3], else required_mode = eModifierMode_Realtime; if(useDeform) { - if(do_ob_key(ob)) /* shape key makes deform verts */ + if(useDeform > 0 && do_ob_key(ob)) /* shape key makes deform verts */ deformedVerts = mesh_getVertexCos(me, &numVerts); + else if(inputVertexCos) + deformedVerts = inputVertexCos; /* Apply all leading deforming modifiers */ for(;md; md = md->next, curr = curr->next) { @@ -2947,6 +2954,16 @@ DerivedMesh *mesh_create_derived_no_deform(Object *ob, float (*vertCos)[3], return final; } +DerivedMesh *mesh_create_derived_no_virtual(Object *ob, float (*vertCos)[3], + CustomDataMask dataMask) +{ + DerivedMesh *final; + + mesh_calc_modifiers(ob, vertCos, NULL, &final, 0, -1, 0, dataMask, -1); + + return final; +} + DerivedMesh *mesh_create_derived_no_deform_render(Object *ob, float (*vertCos)[3], CustomDataMask dataMask) diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 9f214721c82..b7f74d57ca4 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -90,6 +90,7 @@ #include "BKE_object.h" #include "BKE_scene.h" #include "BL_SkinMeshObject.h" +#include "BL_ModifierDeformer.h" #include "BL_ShapeDeformer.h" #include "BL_SkinDeformer.h" #include "BL_MeshDeformer.h" @@ -341,6 +342,7 @@ BL_Material* ConvertMaterial( material->IdMode = DEFAULT_BLENDER; material->glslmat = (validmat)? glslmat: false; + material->materialindex = mface->mat_nr; // -------------------------------- if(validmat) { @@ -747,7 +749,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* } // Determine if we need to make a skinned mesh - if (mesh->dvert || mesh->key || ((blenderobj->gameflag & OB_SOFT_BODY) != 0)) + if (mesh->dvert || mesh->key || ((blenderobj->gameflag & OB_SOFT_BODY) != 0) || BL_ModifierDeformer::HasCompatibleDeformer(blenderobj)) { meshobj = new BL_SkinMeshObject(mesh, lightlayer); skinMesh = true; @@ -853,8 +855,6 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* bl_mat = ConvertMaterial(ma, tface, tfaceName, mface, mcol, lightlayer, blenderobj, layers, converter->GetGLSLMaterials()); - bl_mat->material_index = (int)mface->mat_nr; - visible = ((bl_mat->ras_mode & POLY_VIS)!=0); collider = ((bl_mat->ras_mode & COLLIDER)!=0); twoside = ((bl_mat->mode & TF_TWOSIDE)!=0); @@ -874,6 +874,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* /* then the KX_BlenderMaterial */ polymat = new KX_BlenderMaterial(scene, bl_mat, skinMesh, lightlayer); + } else { /* do Texture Face materials */ @@ -956,7 +957,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* bool alpha = (transp == TF_ALPHA || transp == TF_ADD); bool zsort = (mode & TF_ALPHASORT)? alpha: 0; - polymat = new KX_PolygonMaterial(imastr, ma, + polymat = new KX_PolygonMaterial(imastr, ma, (int)mface->mat_nr, tile, tilexrep, tileyrep, mode, transp, alpha, zsort, lightlayer, tface, (unsigned int*)mcol); @@ -1689,8 +1690,15 @@ static KX_GameObject *gameobject_from_blenderobject( bool bHasShapeKey = mesh->key != NULL && mesh->key->type==KEY_RELATIVE; bool bHasDvert = mesh->dvert != NULL && ob->defbase.first; bool bHasArmature = (ob->parent && ob->parent->type == OB_ARMATURE && ob->partype==PARSKEL && bHasDvert); + bool bHasModifier = BL_ModifierDeformer::HasCompatibleDeformer(ob); - if (bHasShapeKey) { + if (bHasModifier) { + BL_ModifierDeformer *dcont = new BL_ModifierDeformer((BL_DeformableGameObject *)gameobj, + ob, (BL_SkinMeshObject *)meshobj); + ((BL_DeformableGameObject*)gameobj)->SetDeformer(dcont); + if (bHasShapeKey && bHasArmature) + dcont->LoadShapeDrivers(ob->parent); + } else if (bHasShapeKey) { // not that we can have shape keys without dvert! BL_ShapeDeformer *dcont = new BL_ShapeDeformer((BL_DeformableGameObject*)gameobj, ob, (BL_SkinMeshObject*)meshobj); diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp new file mode 100644 index 00000000000..6113f88e331 --- /dev/null +++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp @@ -0,0 +1,149 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifdef WIN32 +#pragma warning (disable : 4786) +#endif //WIN32 + +#include "MEM_guardedalloc.h" +#include "BL_ModifierDeformer.h" +#include "GEN_Map.h" +#include "STR_HashedString.h" +#include "RAS_IPolygonMaterial.h" +#include "BL_SkinMeshObject.h" + +//#include "BL_ArmatureController.h" +#include "DNA_armature_types.h" +#include "DNA_action_types.h" +#include "DNA_key_types.h" +#include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" +#include "DNA_ipo_types.h" +#include "DNA_curve_types.h" +#include "DNA_modifier_types.h" +#include "BKE_armature.h" +#include "BKE_action.h" +#include "BKE_key.h" +#include "BKE_ipo.h" +#include "MT_Point3.h" + +extern "C"{ + #include "BKE_customdata.h" + #include "BKE_DerivedMesh.h" + #include "BKE_lattice.h" + #include "BKE_modifier.h" +} + #include "BKE_utildefines.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" + +#define __NLA_DEFNORMALS +//#undef __NLA_DEFNORMALS + + +BL_ModifierDeformer::~BL_ModifierDeformer() +{ + if (m_dm) { + m_dm->needsFree = 1; + m_dm->release(m_dm); + } +}; + +RAS_Deformer *BL_ModifierDeformer::GetReplica(class KX_GameObject* replica) +{ + BL_ModifierDeformer *result; + + result = new BL_ModifierDeformer(*this); + result->ProcessReplica(); + return result; +} + +void BL_ModifierDeformer::ProcessReplica() +{ + BL_ShapeDeformer::ProcessReplica(); + m_dm = NULL; + m_lastModifierUpdate = -1; +} + +bool BL_ModifierDeformer::HasCompatibleDeformer(Object *ob) +{ + if (!ob->modifiers.first) + return false; + ModifierData* md; + for (md = (ModifierData*)ob->modifiers.first; md; md = (ModifierData*)md->next) { + if (md->mode & eModifierMode_Realtime) + return true; + } + return false; +} + +bool BL_ModifierDeformer::Update(void) +{ + bool bShapeUpdate = BL_ShapeDeformer::Update(); + + if (bShapeUpdate || m_lastModifierUpdate != m_gameobj->GetLastFrame()) { + /* execute the modifiers */ + Object* blendobj = m_gameobj->GetBlendObject(); + /* hack: the modifiers require that the mesh is attached to the object + It may not be the case here because of replace mesh actuator */ + Mesh *oldmesh = (Mesh*)blendobj->data; + blendobj->data = m_bmesh; + /* execute the modifiers */ + DerivedMesh *dm = mesh_create_derived_no_virtual(blendobj, m_transverts, CD_MASK_MESH); + /* restore object data */ + blendobj->data = oldmesh; + /* free the current derived mesh and replace, (dm should never be NULL) */ + if (m_dm != NULL) { + m_dm->needsFree = 1; + m_dm->release(m_dm); + } + m_dm = dm; + m_lastModifierUpdate=m_gameobj->GetLastFrame(); + bShapeUpdate = true; + } + return bShapeUpdate; +} + +bool BL_ModifierDeformer::Apply(RAS_IPolyMaterial *mat) +{ + if (!Update()) + return false; + + // drawing is based on derived mesh, must set it in the mesh slots + int nmat = m_pMeshObject->NumMaterials(); + for (int imat=0; imatGetMeshMaterial(imat); + RAS_MeshSlot *slot = *mmat->m_slots[(void*)m_gameobj]; + if(!slot) + continue; + slot->m_pDerivedMesh = m_dm; + } + return true; +} diff --git a/source/gameengine/Converter/BL_ModifierDeformer.h b/source/gameengine/Converter/BL_ModifierDeformer.h new file mode 100644 index 00000000000..0caaabf8055 --- /dev/null +++ b/source/gameengine/Converter/BL_ModifierDeformer.h @@ -0,0 +1,97 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef BL_MODIFIERDEFORMER +#define BL_MODIFIERDEFORMER + +#ifdef WIN32 +#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning +#endif //WIN32 + +#include "BL_ShapeDeformer.h" +#include "BL_DeformableGameObject.h" +#include + +struct DerivedMesh; +struct Object; + +class BL_ModifierDeformer : public BL_ShapeDeformer +{ +public: + static bool HasCompatibleDeformer(Object *ob); + + + BL_ModifierDeformer(BL_DeformableGameObject *gameobj, + Object *bmeshobj, + BL_SkinMeshObject *mesh) + : + BL_ShapeDeformer(gameobj,bmeshobj, mesh), + m_lastModifierUpdate(-1), + m_dm(NULL) + { + m_recalcNormal = false; + }; + + /* this second constructor is needed for making a mesh deformable on the fly. */ + BL_ModifierDeformer(BL_DeformableGameObject *gameobj, + struct Object *bmeshobj_old, + struct Object *bmeshobj_new, + class BL_SkinMeshObject *mesh, + bool release_object, + BL_ArmatureObject* arma = NULL) + : + BL_ShapeDeformer(gameobj, bmeshobj_old, bmeshobj_new, mesh, release_object, false, arma), + m_lastModifierUpdate(-1), + m_dm(NULL) + { + }; + + virtual void ProcessReplica(); + virtual RAS_Deformer *GetReplica(class KX_GameObject* replica); + virtual ~BL_ModifierDeformer(); + virtual bool UseVertexArray() + { + return false; + } + + bool Update (void); + bool Apply(RAS_IPolyMaterial *mat); + void ForceUpdate() + { + m_lastModifierUpdate = -1.0; + }; + +protected: + double m_lastModifierUpdate; + DerivedMesh *m_dm; + +}; + +#endif + diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp index fc6498579ad..499732c7f70 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.cpp +++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp @@ -79,6 +79,7 @@ RAS_Deformer *BL_ShapeDeformer::GetReplica(class KX_GameObject* replica) void BL_ShapeDeformer::ProcessReplica() { + BL_SkinDeformer::ProcessReplica(); } bool BL_ShapeDeformer::LoadShapeDrivers(Object* arma) @@ -87,7 +88,7 @@ bool BL_ShapeDeformer::LoadShapeDrivers(Object* arma) m_shapeDrivers.clear(); // check if this mesh has armature driven shape keys - if (m_bmesh->key->ipo) { + if (m_bmesh->key && m_bmesh->key->ipo) { for(icu= (IpoCurve*)m_bmesh->key->ipo->curve.first; icu; icu= (IpoCurve*)icu->next) { if(icu->driver && (icu->flag & IPO_MUTE) == 0 && @@ -147,7 +148,9 @@ bool BL_ShapeDeformer::Update(void) m_pMeshObject->CheckWeightCache(blendobj); /* we will blend the key directly in mvert array: it is used by armature as the start position */ - do_rel_key(0, m_bmesh->totvert, m_bmesh->totvert, (char *)m_bmesh->mvert->co, m_bmesh->key, 0); + /* m_bmesh->key can be NULL in case of Modifier deformer */ + if (m_bmesh->key) + do_rel_key(0, m_bmesh->totvert, m_bmesh->totvert, (char *)m_bmesh->mvert->co, m_bmesh->key, 0); // Don't release the weight array as in Blender, it will most likely be reusable on next frame // The weight array are ultimately deleted when the skin mesh is destroyed @@ -174,7 +177,8 @@ bool BL_ShapeDeformer::Update(void) VECCOPY(m_transverts[v], m_bmesh->mvert[v].co); #ifdef __NLA_DEFNORMALS - RecalcNormals(); + if (m_recalcNormal) + RecalcNormals(); #endif bSkinUpdate = true; } diff --git a/source/gameengine/Converter/BL_ShapeDeformer.h b/source/gameengine/Converter/BL_ShapeDeformer.h index 90b9f5caea1..901a1d82295 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.h +++ b/source/gameengine/Converter/BL_ShapeDeformer.h @@ -58,9 +58,10 @@ public: struct Object *bmeshobj_new, class BL_SkinMeshObject *mesh, bool release_object, + bool recalc_normal, BL_ArmatureObject* arma = NULL) : - BL_SkinDeformer(gameobj, bmeshobj_old, bmeshobj_new, mesh, release_object, arma), + BL_SkinDeformer(gameobj, bmeshobj_old, bmeshobj_new, mesh, release_object, recalc_normal, arma), m_lastShapeUpdate(-1) { }; diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp index d8563763954..ae3e1a10005 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.cpp +++ b/source/gameengine/Converter/BL_SkinDeformer.cpp @@ -65,9 +65,10 @@ BL_SkinDeformer::BL_SkinDeformer(BL_DeformableGameObject *gameobj, BL_MeshDeformer(gameobj, bmeshobj, mesh), m_armobj(arma), m_lastArmaUpdate(-1), - m_defbase(&bmeshobj->defbase), + //m_defbase(&bmeshobj->defbase), m_releaseobject(false), - m_poseApplied(false) + m_poseApplied(false), + m_recalcNormal(true) { Mat4CpyMat4(m_obmat, bmeshobj->obmat); }; @@ -78,12 +79,14 @@ BL_SkinDeformer::BL_SkinDeformer( struct Object *bmeshobj_new, // Blender object that owns the original mesh class BL_SkinMeshObject *mesh, bool release_object, + bool recalc_normal, BL_ArmatureObject* arma) : BL_MeshDeformer(gameobj, bmeshobj_old, mesh), m_armobj(arma), m_lastArmaUpdate(-1), - m_defbase(&bmeshobj_old->defbase), - m_releaseobject(release_object) + //m_defbase(&bmeshobj_old->defbase), + m_releaseobject(release_object), + m_recalcNormal(recalc_normal) { // this is needed to ensure correct deformation of mesh: // the deformation is done with Blender's armature_deform_verts() function @@ -118,31 +121,33 @@ bool BL_SkinDeformer::Apply(RAS_IPolyMaterial *mat) RAS_MeshSlot::iterator it; RAS_MeshMaterial *mmat; RAS_MeshSlot *slot; - size_t i; + size_t i, nmat, imat; // update the vertex in m_transverts - Update(); - - // The vertex cache can only be updated for this deformer: - // Duplicated objects with more than one ploymaterial (=multiple mesh slot per object) - // share the same mesh (=the same cache). As the rendering is done per polymaterial - // cycling through the objects, the entire mesh cache cannot be updated in one shot. - mmat = m_pMeshObject->GetMeshMaterial(mat); - if(!mmat->m_slots[(void*)m_gameobj]) - return true; - - slot = *mmat->m_slots[(void*)m_gameobj]; - - // for each array - for(slot->begin(it); !slot->end(it); slot->next(it)) { - // for each vertex - // copy the untransformed data from the original mvert - for(i=it.startvertex; iNumMaterials(); + for (imat=0; imatGetMeshMaterial(imat); + if(!mmat->m_slots[(void*)m_gameobj]) + continue; + + slot = *mmat->m_slots[(void*)m_gameobj]; + + // for each array + for(slot->begin(it); !slot->end(it); slot->next(it)) { + // for each vertex + // copy the untransformed data from the original mvert + for(i=it.startvertex; iobmat, obmat); #ifdef __NLA_DEFNORMALS - RecalcNormals(); + if (m_recalcNormal) + RecalcNormals(); #endif /* Update the current frame */ diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h index f87860021c6..c93188b0c5a 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.h +++ b/source/gameengine/Converter/BL_SkinDeformer.h @@ -64,6 +64,7 @@ public: struct Object *bmeshobj_new, class BL_SkinMeshObject *mesh, bool release_object, + bool recalc_normal, BL_ArmatureObject* arma = NULL); virtual void ProcessReplica(); @@ -88,10 +89,11 @@ protected: BL_ArmatureObject* m_armobj; // Our parent object float m_time; double m_lastArmaUpdate; - ListBase* m_defbase; + //ListBase* m_defbase; float m_obmat[4][4]; // the reference matrix for skeleton deform bool m_releaseobject; bool m_poseApplied; + bool m_recalcNormal; }; diff --git a/source/gameengine/Converter/BL_SkinMeshObject.cpp b/source/gameengine/Converter/BL_SkinMeshObject.cpp index eb3f9d0588d..0a18296f261 100644 --- a/source/gameengine/Converter/BL_SkinMeshObject.cpp +++ b/source/gameengine/Converter/BL_SkinMeshObject.cpp @@ -87,7 +87,7 @@ void BL_SkinMeshObject::UpdateBuckets(void* clientobj,double* oglmatrix,bool use continue; RAS_MeshSlot *slot = *it->m_slots[clientobj]; - slot->m_pDeformer = ((BL_DeformableGameObject*)clientobj)->GetDeformer(); + slot->SetDeformer(((BL_DeformableGameObject*)clientobj)->GetDeformer()); } RAS_MeshObject::UpdateBuckets(clientobj, oglmatrix, useObjectColor, rgbavec, visible, culled); diff --git a/source/gameengine/Ketsji/BL_Material.cpp b/source/gameengine/Ketsji/BL_Material.cpp index 7e3d6984f19..022ed71ef7b 100644 --- a/source/gameengine/Ketsji/BL_Material.cpp +++ b/source/gameengine/Ketsji/BL_Material.cpp @@ -52,7 +52,7 @@ BL_Material::BL_Material() mode = 0; material = 0; tface = 0; - material_index = 0; + materialindex = 0; amb=0.5f; num_enabled = 0; num_users = 1; diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h index 0eaa234566c..a0ce37aace0 100644 --- a/source/gameengine/Ketsji/BL_Material.h +++ b/source/gameengine/Ketsji/BL_Material.h @@ -54,6 +54,7 @@ public: int tile,tilexrep[MAXTEX],tileyrep[MAXTEX]; STR_String matname; STR_String mtexname[MAXTEX]; + int materialindex; float matcolor[4]; float speccolor[3]; @@ -68,8 +69,6 @@ public: int mode; int num_enabled; - int material_index; - BL_Mapping mapping[MAXTEX]; STR_String imageId[MAXTEX]; diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 2edfe4b718c..7378113bc31 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -53,6 +53,7 @@ KX_BlenderMaterial::KX_BlenderMaterial( RAS_IPolyMaterial( STR_String( data->texname[0] ), STR_String( data->matname ), // needed for physics! + data->materialindex, data->tile, data->tilexrep[0], data->tileyrep[0], @@ -120,6 +121,27 @@ unsigned int* KX_BlenderMaterial::GetMCol(void) const return mMaterial->rgb; } +void KX_BlenderMaterial::GetMaterialRGBAColor(unsigned char *rgba) const +{ + if (mMaterial) { + *rgba++ = (unsigned char) (mMaterial->matcolor[0]*255.0); + *rgba++ = (unsigned char) (mMaterial->matcolor[1]*255.0); + *rgba++ = (unsigned char) (mMaterial->matcolor[2]*255.0); + *rgba++ = (unsigned char) (mMaterial->matcolor[3]*255.0); + } else + RAS_IPolyMaterial::GetMaterialRGBAColor(rgba); +} + +Material *KX_BlenderMaterial::GetBlenderMaterial() const +{ + return mMaterial->material; +} + +Scene* KX_BlenderMaterial::GetBlenderScene() const +{ + return mScene->GetBlenderScene(); +} + void KX_BlenderMaterial::OnConstruction() { if (mConstructed) @@ -863,7 +885,7 @@ void KX_BlenderMaterial::SetBlenderGLSLShader(void) KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getMaterialIndex, "getMaterialIndex()") { - return PyInt_FromLong( mMaterial->material_index ); + return PyInt_FromLong( GetMaterialIndex() ); } KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getTexture, "getTexture( index )" ) diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index 57cdde3c947..eeb919a1bf1 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -73,7 +73,6 @@ public: Image * getImage (unsigned int idx) { return (idx < MAXTEX && mMaterial) ? mMaterial->img[idx] : NULL; } - // for ipos void UpdateIPO( MT_Vector4 rgba, MT_Vector3 specrgb, @@ -117,6 +116,9 @@ private: void ActivateTexGen( RAS_IRasterizer *ras ) const; bool UsesLighting(RAS_IRasterizer *rasty) const; + void GetMaterialRGBAColor(unsigned char *rgba) const; + Material* GetBlenderMaterial() const; + Scene* GetBlenderScene() const; // message centers void setTexData( bool enable,RAS_IRasterizer *ras); diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index 2d5a5f99cea..a8105c1e4f3 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -53,6 +53,7 @@ KX_PolygonMaterial::KX_PolygonMaterial(const STR_String &texname, Material *material, + int materialindex, int tile, int tilexrep, int tileyrep, @@ -67,6 +68,7 @@ KX_PolygonMaterial::KX_PolygonMaterial(const STR_String &texname, : PyObjectPlus(T), RAS_IPolyMaterial(texname, STR_String(material?material->id.name:""), + materialindex, tile, tilexrep, tileyrep, @@ -167,6 +169,18 @@ void KX_PolygonMaterial::DefaultActivate(RAS_IRasterizer* rasty, TCachingInfo& c rasty->SetPolygonOffset(-m_material->zoffs, 0.0); } +void KX_PolygonMaterial::GetMaterialRGBAColor(unsigned char *rgba) const +{ + if (m_material) { + *rgba++ = (unsigned char) (m_material->r*255.0); + *rgba++ = (unsigned char) (m_material->g*255.0); + *rgba++ = (unsigned char) (m_material->b*255.0); + *rgba++ = (unsigned char) (m_material->alpha*255.0); + } else + RAS_IPolyMaterial::GetMaterialRGBAColor(rgba); +} + + //---------------------------------------------------------------------------- //Python diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index e5816058bbf..b6f5f373335 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -53,7 +53,6 @@ private: MTFace* m_tface; unsigned int* m_mcol; Material* m_material; - PyObject* m_pymaterial; mutable int m_pass; @@ -61,6 +60,7 @@ public: KX_PolygonMaterial(const STR_String &texname, Material* ma, + int materialindex, int tile, int tilexrep, int tileyrep, @@ -107,8 +107,8 @@ public: { return m_mcol; } - - + virtual void GetMaterialRGBAColor(unsigned char *rgba) const; + KX_PYMETHOD_DOC(KX_PolygonMaterial, updateTexture); KX_PYMETHOD_DOC(KX_PolygonMaterial, setTexture); KX_PYMETHOD_DOC(KX_PolygonMaterial, activate); diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index f91c4674113..f57a38d290d 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -80,6 +80,7 @@ #include "KX_BlenderSceneConverter.h" #include "KX_MotionState.h" +#include "BL_ModifierDeformer.h" #include "BL_ShapeDeformer.h" #include "BL_DeformableGameObject.h" @@ -1038,6 +1039,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj) Object* oldblendobj = static_cast(m_logicmgr->FindBlendObjByGameMeshName(mesh->GetName())); Mesh* blendmesh = mesh->GetMesh(); + bool bHasModifier = BL_ModifierDeformer::HasCompatibleDeformer(blendobj); bool bHasShapeKey = blendmesh->key != NULL && blendmesh->key->type==KEY_RELATIVE; bool bHasDvert = blendmesh->dvert != NULL; bool bHasArmature = @@ -1053,10 +1055,37 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj) if (oldblendobj==NULL) { std::cout << "warning: ReplaceMesh() new mesh is not used in an object from the current scene, you will get incorrect behavior" << std::endl; - bHasShapeKey= bHasDvert= bHasArmature= false; + bHasShapeKey= bHasDvert= bHasArmature=bHasModifier= false; } - if (bHasShapeKey) + if (bHasModifier) + { + BL_ModifierDeformer* modifierDeformer; + if (bHasShapeKey || bHasArmature) + { + modifierDeformer = new BL_ModifierDeformer( + newobj, + oldblendobj, blendobj, + static_cast(mesh), + true, + static_cast( parentobj ) + ); + releaseParent= false; + modifierDeformer->LoadShapeDrivers(blendobj->parent); + } + else + { + modifierDeformer = new BL_ModifierDeformer( + newobj, + oldblendobj, blendobj, + static_cast(mesh), + false, + NULL + ); + } + newobj->SetDeformer(modifierDeformer); + } + else if (bHasShapeKey) { BL_ShapeDeformer* shapeDeformer; if (bHasArmature) @@ -1066,6 +1095,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj) oldblendobj, blendobj, static_cast(mesh), true, + true, static_cast( parentobj ) ); releaseParent= false; @@ -1078,6 +1108,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj) oldblendobj, blendobj, static_cast(mesh), false, + true, NULL ); } @@ -1090,6 +1121,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj) oldblendobj, blendobj, static_cast(mesh), true, + true, static_cast( parentobj ) ); releaseParent= false; diff --git a/source/gameengine/Rasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/CMakeLists.txt index 6d53ee53471..69a167e54a9 100644 --- a/source/gameengine/Rasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/CMakeLists.txt @@ -29,6 +29,7 @@ FILE(GLOB SRC *.cpp) SET(INC . ../../../source/kernel/gen_system + ../../../source/blender/makesdna ../../../intern/string ../../../intern/moto/include ../../../extern/glew/include diff --git a/source/gameengine/Rasterizer/Makefile b/source/gameengine/Rasterizer/Makefile index 917f70c7108..fa6cf94c4b6 100644 --- a/source/gameengine/Rasterizer/Makefile +++ b/source/gameengine/Rasterizer/Makefile @@ -40,6 +40,7 @@ CPPFLAGS += -I$(OPENGL_HEADERS) CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include CPPFLAGS += -I../../kernel/gen_system +CPPFLAGS += -I../../blender/makesdna CPPFLAGS += -I../BlenderRoutines CPPFLAGS += -I../Expressions diff --git a/source/gameengine/Rasterizer/RAS_Deformer.h b/source/gameengine/Rasterizer/RAS_Deformer.h index 3332ac4c0a7..dc5a49a0f99 100644 --- a/source/gameengine/Rasterizer/RAS_Deformer.h +++ b/source/gameengine/Rasterizer/RAS_Deformer.h @@ -49,6 +49,10 @@ public: { return false; } + virtual bool UseVertexArray() + { + return true; + } protected: class RAS_MeshObject *m_pMesh; }; diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp index cd88112007b..e8f451382b9 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp @@ -29,12 +29,16 @@ #include "RAS_IPolygonMaterial.h" #include "RAS_IRasterizer.h" +#include "DNA_image_types.h" +#include "DNA_meshdata_types.h" + #ifdef HAVE_CONFIG_H #include #endif RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname, const STR_String& matname, + int materialindex, int tile, int tilexrep, int tileyrep, @@ -45,6 +49,7 @@ RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname, int lightlayer) : m_texturename(texname), m_materialname(matname), + m_materialindex(materialindex), m_tile(tile), m_tilexrep(tilexrep), m_tileyrep(tileyrep), @@ -95,6 +100,15 @@ bool RAS_IPolyMaterial::Equals(const RAS_IPolyMaterial& lhs) const } } + +void RAS_IPolyMaterial::GetMaterialRGBAColor(unsigned char *rgba) const +{ + *rgba++ = 0xFF; + *rgba++ = 0xFF; + *rgba++ = 0xFF; + *rgba++ = 0xFF; +} + bool RAS_IPolyMaterial::Less(const RAS_IPolyMaterial& rhs) const { if (Equals(rhs)) @@ -143,6 +157,22 @@ const STR_String& RAS_IPolyMaterial::GetTextureName() const return m_texturename; } +int RAS_IPolyMaterial::GetMaterialIndex() const +{ + return m_materialindex; +} + +Material *RAS_IPolyMaterial::GetBlenderMaterial() const +{ + return NULL; +} + +Scene* RAS_IPolyMaterial::GetBlenderScene() const +{ + return NULL; +} + + unsigned int RAS_IPolyMaterial::GetFlag() const { return m_flag; diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index e5b24070c4b..dcd8b53402e 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -39,6 +39,9 @@ #include "STR_HashedString.h" class RAS_IRasterizer; +struct MTFace; +struct Material; +struct Scene; enum MaterialProps { @@ -71,6 +74,7 @@ protected: bool m_alpha; bool m_zsort; int m_lightlayer; + int m_materialindex; unsigned int m_polymatid; static unsigned int m_newpolymatid; @@ -98,6 +102,7 @@ public: RAS_IPolyMaterial(const STR_String& texname, const STR_String& matname, + int materialindex, int tile, int tilexrep, int tileyrep, @@ -139,10 +144,14 @@ public: dword GetMaterialNameHash() const; const STR_String& GetTextureName() const; unsigned int GetFlag() const; + int GetMaterialIndex() const; + virtual Material* GetBlenderMaterial() const; + virtual Scene* GetBlenderScene() const; + virtual void GetMaterialRGBAColor(unsigned char *rgba) const; virtual bool UsesLighting(RAS_IRasterizer *rasty) const; virtual bool UsesObjectColor() const; - + /* * PreCalculate texture gen */ diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index 6beab28d61f..d63e9c98415 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -56,6 +56,7 @@ RAS_MeshSlot::RAS_MeshSlot() m_DisplayList = NULL; m_bDisplayList = true; m_joinSlot = NULL; + m_pDerivedMesh = NULL; } RAS_MeshSlot::~RAS_MeshSlot() @@ -87,6 +88,7 @@ RAS_MeshSlot::RAS_MeshSlot(const RAS_MeshSlot& slot) m_clientObj = NULL; m_pDeformer = NULL; + m_pDerivedMesh = NULL; m_OpenGLMatrix = NULL; m_mesh = slot.m_mesh; m_bucket = slot.m_bucket; @@ -279,6 +281,43 @@ void RAS_MeshSlot::AddPolygonVertex(int offset) m_endindex++; } +void RAS_MeshSlot::SetDeformer(RAS_Deformer* deformer) +{ + if (deformer && m_pDeformer != deformer) { + // we create local copy of RAS_DisplayArray when we have a deformer: + // this way we can avoid conflict between the vertex cache of duplicates + RAS_DisplayArrayList::iterator it; + for(it=m_displayArrays.begin(); it!=m_displayArrays.end(); it++) { + if (deformer->UseVertexArray()) { + // the deformer makes use of vertex array, make sure we have our local copy + if ((*it)->m_users > 1) { + // only need to copy if there are other users + // note that this is the usual case as vertex arrays are held by the material base slot + RAS_DisplayArray *newarray = new RAS_DisplayArray(*(*it)); + newarray->m_users = 1; + (*it)->m_users--; + *it = newarray; + } + } else { + // the deformer is not using vertex array (Modifier), release them + (*it)->m_users--; + if((*it)->m_users == 0) + delete *it; + } + } + if (!deformer->UseVertexArray()) { + m_displayArrays.clear(); + m_startarray = 0; + m_startvertex = 0; + m_startindex = 0; + m_endarray = 0; + m_endvertex = 0; + m_endindex = 0; + } + } + m_pDeformer = deformer; +} + bool RAS_MeshSlot::Equals(RAS_MeshSlot *target) { if(!m_OpenGLMatrix || !target->m_OpenGLMatrix) diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h index f5c8cd3e107..b07f86b079e 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h @@ -69,6 +69,7 @@ class RAS_DisplayArray; class RAS_MeshSlot; class RAS_MeshMaterial; class RAS_MaterialBucket; +struct DerivedMesh; /* An array with data used for OpenGL drawing */ @@ -110,6 +111,7 @@ public: RAS_MeshObject* m_mesh; void* m_clientObj; RAS_Deformer* m_pDeformer; + DerivedMesh* m_pDerivedMesh; double* m_OpenGLMatrix; // visibility bool m_bVisible; @@ -148,6 +150,7 @@ public: /* used during construction */ void SetDisplayArray(int numverts); RAS_DisplayArray *CurrentDisplayArray(); + void SetDeformer(RAS_Deformer* deformer); void AddPolygon(int numverts); int AddVertex(const RAS_TexVert& tv); diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index 162f9a81335..5625b172913 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -215,6 +215,19 @@ RAS_MeshMaterial *RAS_MeshObject::GetMeshMaterial(RAS_IPolyMaterial *mat) return NULL; } +int RAS_MeshObject::GetMaterialId(RAS_IPolyMaterial *mat) +{ + list::iterator mit; + int imat; + + /* find a mesh material */ + for(imat=0, mit = m_materials.begin(); mit != m_materials.end(); mit++, imat++) + if(mit->m_bucket->GetPolyMaterial() == mat) + return imat; + + return -1; +} + RAS_Polygon* RAS_MeshObject::AddPolygon(RAS_MaterialBucket *bucket, int numverts) { RAS_MeshMaterial *mmat; diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h index 404b7f16a59..cc50f9c783d 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_MeshObject.h @@ -89,6 +89,7 @@ public: RAS_MeshMaterial* GetMeshMaterial(unsigned int matid); RAS_MeshMaterial* GetMeshMaterial(RAS_IPolyMaterial *mat); + int GetMaterialId(RAS_IPolyMaterial *mat); list::iterator GetFirstMaterial(); list::iterator GetLastMaterial(); diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt index e4403ace69f..322d7b79e6f 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt @@ -31,8 +31,12 @@ SET(INC ../../../../intern/string ../../../../intern/moto/include ../../../../source/gameengine/Rasterizer + ../../../../source/gameengine/Ketsji ../../../../extern/glew/include ../../../../source/blender/gpu + ../../../../source/blender/makesdna + ../../../../source/blender/blenkernel + ../../../../source/blender/blenlib ) BLENDERLIB(bf_oglrasterizer "${SRC}" "${INC}") diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile index aee485a22be..b55f6492805 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile @@ -42,8 +42,13 @@ CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include CPPFLAGS += -I../../../kernel/gen_system CPPFLAGS += -I../../../blender/gpu +CPPFLAGS += -I../../../blender/makesdna +CPPFLAGS += -I../../../blender/blenlib +CPPFLAGS += -I../../../blender/blenkernel CPPFLAGS += -I../../BlenderRoutines +CPPFLAGS += -I../../Ketsji CPPFLAGS += -I.. +CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include ifeq ($(OS),darwin) CPPFLAGS += -fpascal-strings diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp index 65aadd63a40..06c61fb4b09 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp @@ -116,10 +116,13 @@ RAS_ListRasterizer::~RAS_ListRasterizer() void RAS_ListRasterizer::RemoveListSlot(RAS_ListSlot* list) { - RAS_Lists::iterator it = mLists.begin(); - while(it != mLists.end()) { + if (list->m_flag & LIST_STANDALONE) + return ; + + RAS_ArrayLists::iterator it = mArrayLists.begin(); + while(it != mArrayLists.end()) { if (it->second == list) { - mLists.erase(it); + mArrayLists.erase(it); break; } it++; @@ -136,12 +139,19 @@ RAS_ListSlot* RAS_ListRasterizer::FindOrAdd(RAS_MeshSlot& ms) */ RAS_ListSlot* localSlot = (RAS_ListSlot*)ms.m_DisplayList; if(!localSlot) { - RAS_Lists::iterator it = mLists.find(ms.m_displayArrays); - if(it == mLists.end()) { + if (ms.m_pDerivedMesh) { + // that means that we draw based on derived mesh, a display list is possible + // but it's unique to this mesh slot localSlot = new RAS_ListSlot(this); - mLists.insert(std::pair(ms.m_displayArrays, localSlot)); + localSlot->m_flag |= LIST_STANDALONE; } else { - localSlot = static_cast(it->second->AddRef()); + RAS_ArrayLists::iterator it = mArrayLists.find(ms.m_displayArrays); + if(it == mArrayLists.end()) { + localSlot = new RAS_ListSlot(this); + mArrayLists.insert(std::pair(ms.m_displayArrays, localSlot)); + } else { + localSlot = static_cast(it->second->AddRef()); + } } } MT_assert(localSlot); @@ -150,12 +160,12 @@ RAS_ListSlot* RAS_ListRasterizer::FindOrAdd(RAS_MeshSlot& ms) void RAS_ListRasterizer::ReleaseAlloc() { - RAS_Lists::iterator it = mLists.begin(); - while(it != mLists.end()) { + RAS_ArrayLists::iterator it = mArrayLists.begin(); + while(it != mArrayLists.end()) { delete it->second; it++; } - mLists.clear(); + mArrayLists.clear(); } void RAS_ListRasterizer::IndexPrimitives(RAS_MeshSlot& ms) @@ -172,8 +182,8 @@ void RAS_ListRasterizer::IndexPrimitives(RAS_MeshSlot& ms) return; } } - - if (mUseVertexArrays) + // derived mesh cannot use vertex array + if (mUseVertexArrays && !ms.m_pDerivedMesh) RAS_VAOpenGLRasterizer::IndexPrimitives(ms); else RAS_OpenGLRasterizer::IndexPrimitives(ms); @@ -204,7 +214,7 @@ void RAS_ListRasterizer::IndexPrimitivesMulti(RAS_MeshSlot& ms) // workaround: note how we do not use vertex arrays for making display // lists, since glVertexAttribPointerARB doesn't seem to work correct // in display lists on ATI? either a bug in the driver or in Blender .. - if (mUseVertexArrays && !localSlot) + if (mUseVertexArrays && !localSlot && !ms.m_pDerivedMesh) RAS_VAOpenGLRasterizer::IndexPrimitivesMulti(ms); else RAS_OpenGLRasterizer::IndexPrimitivesMulti(ms); diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h index 653bb43e534..19211894896 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h @@ -9,6 +9,7 @@ class RAS_ListRasterizer; class RAS_ListSlot : public KX_ListSlot { + friend class RAS_ListRasterizer; unsigned int m_list; unsigned int m_flag; RAS_ListRasterizer* m_rasty; @@ -32,15 +33,16 @@ enum RAS_ListSlotFlags { LIST_NOCREATE =8, LIST_BEGIN =16, LIST_END =32, - LIST_REGEN =64 + LIST_REGEN =64, + LIST_STANDALONE =128, }; -typedef std::map RAS_Lists; +typedef std::map RAS_ArrayLists; class RAS_ListRasterizer : public RAS_VAOpenGLRasterizer { bool mUseVertexArrays; - RAS_Lists mLists; + RAS_ArrayLists mArrayLists; RAS_ListSlot* FindOrAdd(class RAS_MeshSlot& ms); void ReleaseAlloc(); diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index 1a9a28916de..50f56db0645 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -35,11 +35,20 @@ #include "RAS_Rect.h" #include "RAS_TexVert.h" +#include "RAS_MeshObject.h" #include "MT_CmMatrix4x4.h" #include "RAS_IRenderTools.h" // rendering text #include "GPU_draw.h" #include "GPU_material.h" +#include "GPU_extensions.h" + +#include "DNA_image_types.h" +#include "DNA_meshdata_types.h" +#include "DNA_material_types.h" +#include "DNA_scene_types.h" + +#include "BKE_DerivedMesh.h" /** * 32x32 bit masks for vinterlace stereo mode @@ -703,6 +712,51 @@ void RAS_OpenGLRasterizer::IndexPrimitivesMulti(RAS_MeshSlot& ms) IndexPrimitivesInternal(ms, true); } +static bool current_wireframe; +static RAS_MaterialBucket *current_bucket; +static RAS_IPolyMaterial *current_polymat; +static RAS_MeshSlot *current_ms; +static RAS_MeshObject *current_mesh; +static int current_blmat_nr; +static GPUVertexAttribs current_gpu_attribs; +static int CheckMaterialDM(int matnr, void *attribs) +{ + // only draw the current material + if (matnr != current_blmat_nr) + return 0; + GPUVertexAttribs *gattribs = (GPUVertexAttribs *)attribs; + if (gattribs) + memcpy(gattribs, ¤t_gpu_attribs, sizeof(GPUVertexAttribs)); + return 1; +} +static int CheckTexfaceDM(void *mcol, int index) +{ + + // index is the original face index, retrieve the polygon + RAS_Polygon* polygon = (index >= 0 && index < current_mesh->NumPolygons()) ? + current_mesh->GetPolygon(index) : NULL; + if (polygon && polygon->GetMaterial() == current_bucket) { + // must handle color. + if (current_wireframe) + return 2; + if (current_ms->m_bObjectColor) { + MT_Vector4& rgba = current_ms->m_RGBAcolor; + glColor4d(rgba[0], rgba[1], rgba[2], rgba[3]); + // don't use mcol + return 2; + } + if (!mcol) { + // we have to set the color from the material + unsigned char rgba[4]; + current_polymat->GetMaterialRGBAColor(rgba); + glColor4ubv((const GLubyte *)rgba); + return 2; + } + return 1; + } + return 0; +} + void RAS_OpenGLRasterizer::IndexPrimitivesInternal(RAS_MeshSlot& ms, bool multi) { bool obcolor = ms.m_bObjectColor; @@ -710,6 +764,31 @@ void RAS_OpenGLRasterizer::IndexPrimitivesInternal(RAS_MeshSlot& ms, bool multi) MT_Vector4& rgba = ms.m_RGBAcolor; RAS_MeshSlot::iterator it; + if (ms.m_pDerivedMesh) { + // mesh data is in derived mesh, + current_bucket = ms.m_bucket; + current_polymat = current_bucket->GetPolyMaterial(); + current_ms = &ms; + current_mesh = ms.m_mesh; + current_wireframe = wireframe; + MCol *mcol = (MCol*)ms.m_pDerivedMesh->getFaceDataArray(ms.m_pDerivedMesh, CD_MCOL); + if (current_polymat->GetFlag() & RAS_BLENDERGLSL) { + // GetMaterialIndex return the original mface material index, + // increment by 1 to match what derived mesh is doing + current_blmat_nr = current_polymat->GetMaterialIndex()+1; + // For GLSL we need to retrieve the GPU material attribute + Material* blmat = current_polymat->GetBlenderMaterial(); + Scene* blscene = current_polymat->GetBlenderScene(); + if (!wireframe && blscene && blmat) + GPU_material_vertex_attributes(GPU_material_from_blender(blscene, blmat), ¤t_gpu_attribs); + else + memset(¤t_gpu_attribs, 0, sizeof(current_gpu_attribs)); + ms.m_pDerivedMesh->drawFacesGLSL(ms.m_pDerivedMesh, CheckMaterialDM); + } else { + ms.m_pDerivedMesh->drawMappedFacesTex(ms.m_pDerivedMesh, CheckTexfaceDM, mcol); + } + return; + } // iterate over display arrays, each containing an index + vertex array for(ms.begin(it); !ms.end(it); ms.next(it)) { RAS_TexVert *vertex; diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp index 2cb3b52adfb..00f0f27b6c1 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp @@ -110,6 +110,12 @@ void RAS_VAOpenGLRasterizer::IndexPrimitives(RAS_MeshSlot& ms) RAS_MeshSlot::iterator it; GLenum drawmode; + if (ms.m_pDerivedMesh) { + // cannot be handled here, pass to RAS_OpenGLRasterizer + RAS_OpenGLRasterizer::IndexPrimitivesInternal(ms, false); + return; + } + if(!wireframe) glEnableClientState(GL_TEXTURE_COORD_ARRAY); @@ -167,6 +173,12 @@ void RAS_VAOpenGLRasterizer::IndexPrimitivesMulti(RAS_MeshSlot& ms) RAS_MeshSlot::iterator it; GLenum drawmode; + if (ms.m_pDerivedMesh) { + // cannot be handled here, pass to RAS_OpenGLRasterizer + RAS_OpenGLRasterizer::IndexPrimitivesInternal(ms, true); + return; + } + if(!wireframe) EnableTextures(true); diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript index 6731da9a776..314630297e0 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript @@ -5,6 +5,8 @@ sources = env.Glob('*.cpp') incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/Rasterizer #source/gameengine/BlenderRoutines ' incs += ' #source/blender/gpu #extern/glew/include ' + env['BF_OPENGL_INC'] +incs += ' #source/blender/gameengine/Ketsji #source/blender/makesdna #source/blender/blenkernel' +incs += ' #intern/guardedalloc #source/blender/blenlib' cxxflags = [] if env['OURPLATFORM']=='win32-vc': -- cgit v1.2.3 From aa3c9ad0d8061f0087ba94da3ba96ff03716b717 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 21 Apr 2009 12:42:37 +0000 Subject: needed to remove gen_utils functions from Mathutils.c --- source/blender/python/api2_2x/Mathutils.c | 511 ++++++++++++++++-------------- source/blender/python/api2_2x/Mathutils.h | 13 - source/blender/python/api2_2x/vector.c | 2 +- 3 files changed, 273 insertions(+), 253 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Mathutils.c b/source/blender/python/api2_2x/Mathutils.c index c85d781f4dd..9217d94ba1c 100644 --- a/source/blender/python/api2_2x/Mathutils.c +++ b/source/blender/python/api2_2x/Mathutils.c @@ -162,8 +162,8 @@ PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec) if(mat->rowSize != vec->size){ if(mat->rowSize == 4 && vec->size != 3){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "matrix * vector: matrix row size and vector size must be the same"); + PyErr_SetString(PyExc_AttributeError, "matrix * vector: matrix row size and vector size must be the same"); + return NULL; }else{ vecCopy[3] = 1.0f; } @@ -197,8 +197,8 @@ PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat) if(mat->colSize != vec_size){ if(mat->rowSize == 4 && vec_size != 3){ - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "vector * matrix: matrix column size and the vector size must be the same"); + PyErr_SetString(PyExc_AttributeError, "vector * matrix: matrix column size and the vector size must be the same"); + return NULL; }else{ vecCopy[3] = 1.0f; } @@ -267,8 +267,9 @@ PyObject *quat_rotation(PyObject *arg1, PyObject *arg2) } } - return (EXPP_ReturnPyObjError(PyExc_RuntimeError, - "quat_rotation(internal): internal problem rotating vector/point\n")); + PyErr_SetString(PyExc_RuntimeError, "quat_rotation(internal): internal problem rotating vector/point\n"); + return NULL; + } //----------------------------------Mathutils.Rand() -------------------- @@ -281,14 +282,15 @@ PyObject *M_Mathutils_Rand(PyObject * self, PyObject * args) high = 1.0; low = 0.0; - if(!PyArg_ParseTuple(args, "|ff", &low, &high)) - return (EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.Rand(): expected nothing or optional (float, float)\n")); - - if((high < low) || (high < 0 && low > 0)) - return (EXPP_ReturnPyObjError(PyExc_ValueError, - "Mathutils.Rand(): high value should be larger than low value\n")); + if(!PyArg_ParseTuple(args, "|ff", &low, &high)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.Rand(): expected nothing or optional (float, float)\n"); + return NULL; + } + if((high < low) || (high < 0 && low > 0)) { + PyErr_SetString(PyExc_ValueError, "Mathutils.Rand(): high value should be larger than low value\n"); + return NULL; + } //get the random number 0 - 1 drand = BLI_drand(); @@ -317,40 +319,42 @@ PyObject *M_Mathutils_Vector(PyObject * self, PyObject * args) size = PySequence_Length(listObject); } else { // Single argument was not a sequence Py_XDECREF(listObject); - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); + PyErr_SetString(PyExc_TypeError, "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); + return NULL; } } else if (size == 0) { //returns a new empty 3d vector return newVectorObject(NULL, 3, Py_NEW); } else { - listObject = EXPP_incr_ret(args); + Py_INCREF(args); + listObject = args; } if (size<2 || size>4) { // Invalid vector size Py_XDECREF(listObject); - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); + return NULL; } for (i=0; isize != 3 || vec2->size != 3) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.CrossVecs(): expects (2) 3D vector objects\n"); - + if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.CrossVecs(): expects (2) 3D vector objects\n"); + return NULL; + } + + if(vec1->size != 3 || vec2->size != 3) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.CrossVecs(): expects (2) 3D vector objects\n"); + return NULL; + } vecCross = newVectorObject(NULL, 3, Py_NEW); Crossf(((VectorObject*)vecCross)->vec, vec1->vec, vec2->vec); return vecCross; @@ -381,12 +387,15 @@ PyObject *M_Mathutils_DotVecs(PyObject * self, PyObject * args) double dot = 0.0f; int x; - if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2)) - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.DotVecs(): expects (2) vector objects of the same size\n"); - if(vec1->size != vec2->size) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.DotVecs(): expects (2) vector objects of the same size\n"); + if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.DotVecs(): expects (2) vector objects of the same size\n"); + return NULL; + } + + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.DotVecs(): expects (2) vector objects of the same size\n"); + return NULL; + } for(x = 0; x < vec1->size; x++) { dot += vec1->vec[x] * vec2->vec[x]; @@ -428,12 +437,12 @@ PyObject *M_Mathutils_AngleBetweenVecs(PyObject * self, PyObject * args) return PyFloat_FromDouble(angleRads * (180/ Py_PI)); AttributeError1: - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.AngleBetweenVecs(): expects (2) VECTOR objects of the same size\n"); + PyErr_SetString(PyExc_AttributeError, "Mathutils.AngleBetweenVecs(): expects (2) VECTOR objects of the same size\n"); + return NULL; AttributeError2: - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.AngleBetweenVecs(): zero length vectors are not acceptable arguments\n"); + PyErr_SetString(PyExc_AttributeError, "Mathutils.AngleBetweenVecs(): zero length vectors are not acceptable arguments\n"); + return NULL; } //----------------------------------Mathutils.MidpointVecs() ------------- //calculates the midpoint between 2 vectors @@ -443,12 +452,14 @@ PyObject *M_Mathutils_MidpointVecs(PyObject * self, PyObject * args) float vec[4]; int x; - if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2)) - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.MidpointVecs(): expects (2) vector objects of the same size\n"); - if(vec1->size != vec2->size) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.MidpointVecs(): expects (2) vector objects of the same size\n"); + if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.MidpointVecs(): expects (2) vector objects of the same size\n"); + return NULL; + } + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.MidpointVecs(): expects (2) vector objects of the same size\n"); + return NULL; + } for(x = 0; x < vec1->size; x++) { vec[x] = 0.5f * (vec1->vec[x] + vec2->vec[x]); @@ -464,12 +475,14 @@ PyObject *M_Mathutils_ProjectVecs(PyObject * self, PyObject * args) double dot = 0.0f, dot2 = 0.0f; int x, size; - if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2)) - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.ProjectVecs(): expects (2) vector objects of the same size\n"); - if(vec1->size != vec2->size) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.ProjectVecs(): expects (2) vector objects of the same size\n"); + if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.ProjectVecs(): expects (2) vector objects of the same size\n"); + return NULL; + } + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.ProjectVecs(): expects (2) vector objects of the same size\n"); + return NULL; + } //since they are the same size... size = vec1->size; @@ -501,8 +514,8 @@ PyObject *M_Mathutils_Matrix(PyObject * self, PyObject * args) argSize = PySequence_Length(args); if(argSize > 4){ //bad arg nums - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + return NULL; } else if (argSize == 0) { //return empty 4D matrix return (PyObject *) newMatrixObject(NULL, 4, 4, Py_NEW); }else if (argSize == 1){ @@ -525,15 +538,15 @@ PyObject *M_Mathutils_Matrix(PyObject * self, PyObject * args) if(seqSize){ //0 at first if(PySequence_Length(argObject) != seqSize){ //seq size not same Py_DECREF(argObject); - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + return NULL; } } seqSize = PySequence_Length(argObject); }else{ //arg not a sequence Py_XDECREF(argObject); - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + PyErr_SetString(PyExc_TypeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + return NULL; } Py_DECREF(argObject); } @@ -542,27 +555,29 @@ PyObject *M_Mathutils_Matrix(PyObject * self, PyObject * args) for (i = 0; i < argSize; i++){ m = PySequence_GetItem(listObject, i); if (m == NULL) { // Failed to read sequence - return EXPP_ReturnPyObjError(PyExc_RuntimeError, - "Mathutils.Matrix(): failed to parse arguments...\n"); + PyErr_SetString(PyExc_RuntimeError, "Mathutils.Matrix(): failed to parse arguments...\n"); + return NULL; } for (j = 0; j < seqSize; j++) { s = PySequence_GetItem(m, j); - if (s == NULL) { // Failed to read sequence + if (s == NULL) { // Failed to read sequence Py_DECREF(m); - return EXPP_ReturnPyObjError(PyExc_RuntimeError, - "Mathutils.Matrix(): failed to parse arguments...\n"); + PyErr_SetString(PyExc_RuntimeError, "Mathutils.Matrix(): failed to parse arguments...\n"); + return NULL; } f = PyNumber_Float(s); if(f == NULL) { // parsed item is not a number - EXPP_decr2(m,s); - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + Py_DECREF(m); + Py_DECREF(s); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + return NULL; } matrix[(seqSize*i)+j]=(float)PyFloat_AS_DOUBLE(f); - EXPP_decr2(f,s); + Py_DECREF(f); + Py_DECREF(s); } Py_DECREF(m); } @@ -581,10 +596,9 @@ PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args) float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; - if(!PyArg_ParseTuple - (args, "fi|sO!", &angle, &matSize, &axis, &vector_Type, &vec)) { - return EXPP_ReturnPyObjError (PyExc_TypeError, - "Mathutils.RotationMatrix(): expected float int and optional string and vector\n"); + if(!PyArg_ParseTuple(args, "fi|sO!", &angle, &matSize, &axis, &vector_Type, &vec)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.RotationMatrix(): expected float int and optional string and vector\n"); + return NULL; } /* Clamp to -360:360 */ @@ -593,25 +607,29 @@ PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args) while (angle>360.0f) angle-=360.0; - if(matSize != 2 && matSize != 3 && matSize != 4) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.RotationMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); - if(matSize == 2 && (axis != NULL || vec != NULL)) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.RotationMatrix(): cannot create a 2x2 rotation matrix around arbitrary axis\n"); - if((matSize == 3 || matSize == 4) && axis == NULL) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.RotationMatrix(): please choose an axis of rotation for 3d and 4d matrices\n"); + if(matSize != 2 && matSize != 3 && matSize != 4) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.RotationMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); + return NULL; + } + if(matSize == 2 && (axis != NULL || vec != NULL)) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.RotationMatrix(): cannot create a 2x2 rotation matrix around arbitrary axis\n"); + return NULL; + } + if((matSize == 3 || matSize == 4) && axis == NULL) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.RotationMatrix(): please choose an axis of rotation for 3d and 4d matrices\n"); + return NULL; + } if(axis) { - if(((strcmp(axis, "r") == 0) || - (strcmp(axis, "R") == 0)) && vec == NULL) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.RotationMatrix(): please define the arbitrary axis of rotation\n"); + if(((strcmp(axis, "r") == 0) || (strcmp(axis, "R") == 0)) && vec == NULL) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.RotationMatrix(): please define the arbitrary axis of rotation\n"); + return NULL; + } } if(vec) { - if(vec->size != 3) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.RotationMatrix(): the arbitrary axis must be a 3D vector\n"); + if(vec->size != 3) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.RotationMatrix(): the arbitrary axis must be a 3D vector\n"); + return NULL; + } } //convert to radians angle = angle * (float) (Py_PI / 180); @@ -679,8 +697,8 @@ PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args) cosAngle; } } else { - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.RotationMatrix(): unrecognizable axis of rotation type - expected x,y,z or r\n"); + PyErr_SetString(PyExc_AttributeError, "Mathutils.RotationMatrix(): unrecognizable axis of rotation type - expected x,y,z or r\n"); + return NULL; } if(matSize == 4) { //resize matrix @@ -704,12 +722,12 @@ PyObject *M_Mathutils_TranslationMatrix(PyObject * self, VectorObject * vec) 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; if(!VectorObject_Check(vec)) { - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.TranslationMatrix(): expected vector\n"); + PyErr_SetString(PyExc_TypeError, "Mathutils.TranslationMatrix(): expected vector\n"); + return NULL; } if(vec->size != 3 && vec->size != 4) { - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.TranslationMatrix(): vector must be 3D or 4D\n"); + PyErr_SetString(PyExc_TypeError, "Mathutils.TranslationMatrix(): vector must be 3D or 4D\n"); + return NULL; } //create a identity matrix and add translation Mat4One((float(*)[4]) mat); @@ -730,18 +748,19 @@ PyObject *M_Mathutils_ScaleMatrix(PyObject * self, PyObject * args) float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; - if(!PyArg_ParseTuple - (args, "fi|O!", &factor, &matSize, &vector_Type, &vec)) { - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.ScaleMatrix(): expected float int and optional vector\n"); + if(!PyArg_ParseTuple(args, "fi|O!", &factor, &matSize, &vector_Type, &vec)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.ScaleMatrix(): expected float int and optional vector\n"); + return NULL; + } + if(matSize != 2 && matSize != 3 && matSize != 4) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.ScaleMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); + return NULL; } - if(matSize != 2 && matSize != 3 && matSize != 4) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.ScaleMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); if(vec) { - if(vec->size > 2 && matSize == 2) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.ScaleMatrix(): please use 2D vectors when scaling in 2D\n"); + if(vec->size > 2 && matSize == 2) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.ScaleMatrix(): please use 2D vectors when scaling in 2D\n"); + return NULL; + } } if(vec == NULL) { //scaling along axis if(matSize == 2) { @@ -804,18 +823,19 @@ PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * args) float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; - if(!PyArg_ParseTuple - (args, "si|O!", &plane, &matSize, &vector_Type, &vec)) { - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.OrthoProjectionMatrix(): expected string and int and optional vector\n"); - } - if(matSize != 2 && matSize != 3 && matSize != 4) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.OrthoProjectionMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); + if(!PyArg_ParseTuple(args, "si|O!", &plane, &matSize, &vector_Type, &vec)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.OrthoProjectionMatrix(): expected string and int and optional vector\n"); + return NULL; + } + if(matSize != 2 && matSize != 3 && matSize != 4) { + PyErr_SetString(PyExc_AttributeError,"Mathutils.OrthoProjectionMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); + return NULL; + } if(vec) { - if(vec->size > 2 && matSize == 2) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.OrthoProjectionMatrix(): please use 2D vectors when scaling in 2D\n"); + if(vec->size > 2 && matSize == 2) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.OrthoProjectionMatrix(): please use 2D vectors when scaling in 2D\n"); + return NULL; + } } if(vec == NULL) { //ortho projection onto cardinal plane if(((strcmp(plane, "x") == 0) @@ -841,8 +861,8 @@ PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * args) mat[4] = 1.0f; mat[8] = 1.0f; } else { - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.OrthoProjectionMatrix(): unknown plane - expected: x, y, xy, xz, yz\n"); + PyErr_SetString(PyExc_AttributeError, "Mathutils.OrthoProjectionMatrix(): unknown plane - expected: x, y, xy, xz, yz\n"); + return NULL; } } else { //arbitrary plane //normalize arbitrary axis @@ -872,8 +892,8 @@ PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * args) mat[7] = -(vec->vec[1] * vec->vec[2]); mat[8] = 1 - (vec->vec[2] * vec->vec[2]); } else { - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.OrthoProjectionMatrix(): unknown plane - expected: 'r' expected for axis designation\n"); + PyErr_SetString(PyExc_AttributeError, "Mathutils.OrthoProjectionMatrix(): unknown plane - expected: 'r' expected for axis designation\n"); + return NULL; } } if(matSize == 4) { @@ -901,12 +921,13 @@ PyObject *M_Mathutils_ShearMatrix(PyObject * self, PyObject * args) 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; if(!PyArg_ParseTuple(args, "sfi", &plane, &factor, &matSize)) { - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.ShearMatrix(): expected string float and int\n"); + PyErr_SetString(PyExc_TypeError,"Mathutils.ShearMatrix(): expected string float and int\n"); + return NULL; + } + if(matSize != 2 && matSize != 3 && matSize != 4) { + PyErr_SetString(PyExc_AttributeError,"Mathutils.ShearMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); + return NULL; } - if(matSize != 2 && matSize != 3 && matSize != 4) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.ShearMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); if(((strcmp(plane, "x") == 0) || (strcmp(plane, "X") == 0)) && matSize == 2) { @@ -939,8 +960,8 @@ PyObject *M_Mathutils_ShearMatrix(PyObject * self, PyObject * args) mat[4] = 1.0f; mat[8] = 1.0f; } else { - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.ShearMatrix(): expected: x, y, xy, xz, yz or wrong matrix size for shearing plane\n"); + PyErr_SetString(PyExc_AttributeError, "Mathutils.ShearMatrix(): expected: x, y, xy, xz, yz or wrong matrix size for shearing plane\n"); + return NULL; } if(matSize == 4) { //resize matrix @@ -974,15 +995,15 @@ PyObject *M_Mathutils_Quaternion(PyObject * self, PyObject * args) (size == 3 && PySequence_Length(args) !=2) || (size >4 || size < 3)) { // invalid args/size Py_DECREF(listObject); - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; } if(size == 3){ //get angle in axis/angle n = PyNumber_Float(PySequence_GetItem(args, 1)); if(n == NULL) { // parsed item not a number or getItem fail Py_DECREF(listObject); - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; } angle = PyFloat_AS_DOUBLE(n); Py_DECREF(n); @@ -994,40 +1015,41 @@ PyObject *M_Mathutils_Quaternion(PyObject * self, PyObject * args) if (size != 3) { // invalid args/size Py_DECREF(listObject); - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; } n = PyNumber_Float(PySequence_GetItem(args, 0)); if(n == NULL) { // parsed item not a number or getItem fail Py_DECREF(listObject); - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; } angle = PyFloat_AS_DOUBLE(n); Py_DECREF(n); } else { // argument was not a sequence Py_XDECREF(listObject); - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; } } } else if (size == 0) { //returns a new empty quat return newQuaternionObject(NULL, Py_NEW); } else { - listObject = EXPP_incr_ret(args); + Py_INCREF(args); + listObject = args; } if (size == 3) { // invalid quat size if(PySequence_Length(args) != 2){ Py_DECREF(listObject); - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; } }else{ if(size != 4){ Py_DECREF(listObject); - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; } } @@ -1035,19 +1057,21 @@ PyObject *M_Mathutils_Quaternion(PyObject * self, PyObject * args) q = PySequence_GetItem(listObject, i); if (q == NULL) { // Failed to read sequence Py_DECREF(listObject); - return EXPP_ReturnPyObjError(PyExc_RuntimeError, - "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + PyErr_SetString(PyExc_RuntimeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; } f = PyNumber_Float(q); if(f == NULL) { // parsed item not a number - EXPP_decr2(q, listObject); - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + Py_DECREF(q); + Py_DECREF(listObject); + PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; } quat[i] = (float)PyFloat_AS_DOUBLE(f); - EXPP_decr2(f, q); + Py_DECREF(f); + Py_DECREF(q); } if(size == 3){ //calculate the quat based on axis/angle norm = sqrt(quat[0] * quat[0] + quat[1] * quat[1] + quat[2] * quat[2]); @@ -1072,9 +1096,10 @@ PyObject *M_Mathutils_CrossQuats(PyObject * self, PyObject * args) QuaternionObject *quatU = NULL, *quatV = NULL; float quat[4]; - if(!PyArg_ParseTuple(args, "O!O!", &quaternion_Type, &quatU, - &quaternion_Type, &quatV)) - return EXPP_ReturnPyObjError(PyExc_TypeError,"Mathutils.CrossQuats(): expected Quaternion types"); + if(!PyArg_ParseTuple(args, "O!O!", &quaternion_Type, &quatU, &quaternion_Type, &quatV)) { + PyErr_SetString(PyExc_TypeError,"Mathutils.CrossQuats(): expected Quaternion types"); + return NULL; + } QuatMul(quat, quatU->quat, quatV->quat); return newQuaternionObject(quat, Py_NEW); @@ -1087,9 +1112,10 @@ PyObject *M_Mathutils_DotQuats(PyObject * self, PyObject * args) double dot = 0.0f; int x; - if(!PyArg_ParseTuple(args, "O!O!", &quaternion_Type, &quatU, - &quaternion_Type, &quatV)) - return EXPP_ReturnPyObjError(PyExc_TypeError, "Mathutils.DotQuats(): expected Quaternion types"); + if(!PyArg_ParseTuple(args, "O!O!", &quaternion_Type, &quatU, &quaternion_Type, &quatV)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.DotQuats(): expected Quaternion types"); + return NULL; + } for(x = 0; x < 4; x++) { dot += quatU->quat[x] * quatV->quat[x]; @@ -1105,10 +1131,10 @@ PyObject *M_Mathutils_DifferenceQuats(PyObject * self, PyObject * args) double dot = 0.0f; int x; - if(!PyArg_ParseTuple(args, "O!O!", &quaternion_Type, - &quatU, &quaternion_Type, &quatV)) - return EXPP_ReturnPyObjError(PyExc_TypeError, "Mathutils.DifferenceQuats(): expected Quaternion types"); - + if(!PyArg_ParseTuple(args, "O!O!", &quaternion_Type, &quatU, &quaternion_Type, &quatV)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.DifferenceQuats(): expected Quaternion types"); + return NULL; + } tempQuat[0] = quatU->quat[0]; tempQuat[1] = -quatU->quat[1]; tempQuat[2] = -quatU->quat[2]; @@ -1132,14 +1158,14 @@ PyObject *M_Mathutils_Slerp(PyObject * self, PyObject * args) double x, y, dot, sinT, angle, IsinT; int z; - if(!PyArg_ParseTuple(args, "O!O!f", &quaternion_Type, - &quatU, &quaternion_Type, &quatV, ¶m)) - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.Slerp(): expected Quaternion types and float"); - - if(param > 1.0f || param < 0.0f) - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.Slerp(): interpolation factor must be between 0.0 and 1.0"); + if(!PyArg_ParseTuple(args, "O!O!f", &quaternion_Type, &quatU, &quaternion_Type, &quatV, ¶m)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.Slerp(): expected Quaternion types and float"); + return NULL; + } + if(param > 1.0f || param < 0.0f) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.Slerp(): interpolation factor must be between 0.0 and 1.0"); + return NULL; + } //copy quats for(z = 0; z < 4; z++){ @@ -1198,39 +1224,42 @@ PyObject *M_Mathutils_Euler(PyObject * self, PyObject * args) size = PySequence_Length(listObject); } else { // Single argument was not a sequence Py_DECREF(listObject); - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.Euler(): 3d numeric sequence expected\n"); + PyErr_SetString(PyExc_TypeError, "Mathutils.Euler(): 3d numeric sequence expected\n"); + return NULL; } } else if (size == 0) { //returns a new empty 3d euler return newEulerObject(NULL, Py_NEW); } else { - listObject = EXPP_incr_ret(args); + Py_INCREF(args); + listObject = args; } if (size != 3) { // Invalid euler size Py_DECREF(listObject); - return EXPP_ReturnPyObjError(PyExc_AttributeError, - "Mathutils.Euler(): 3d numeric sequence expected\n"); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Euler(): 3d numeric sequence expected\n"); + return NULL; } for (i=0; isize != 3 || vec2->size != 3 || vec3->size != 3 || - ray->size != 3 || ray_off->size != 3) - return ( EXPP_ReturnPyObjError( PyExc_TypeError, - "only 3D vectors for all parameters\n" ) ); + if(!PyArg_ParseTuple(args, "O!O!O!O!O!|i", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3, &vector_Type, &ray, &vector_Type, &ray_off , &clip)) { + PyErr_SetString( PyExc_TypeError, "expected 5 vector types\n" ); + return NULL; + } + if(vec1->size != 3 || vec2->size != 3 || vec3->size != 3 || ray->size != 3 || ray_off->size != 3) { + PyErr_SetString( PyExc_TypeError, "only 3D vectors for all parameters\n"); + return NULL; + } VECCOPY(v1, vec1->vec); VECCOPY(v2, vec2->vec); @@ -1275,7 +1303,7 @@ PyObject *M_Mathutils_Intersect( PyObject * self, PyObject * args ) det = Inpf(e1, pvec); if (det > -0.000001 && det < 0.000001) { - return EXPP_incr_ret( Py_None ); + Py_RETURN_NONE; } inv_det = 1.0f / det; @@ -1286,7 +1314,7 @@ PyObject *M_Mathutils_Intersect( PyObject * self, PyObject * args ) /* calculate U parameter and test bounds */ u = Inpf(tvec, pvec) * inv_det; if (clip && (u < 0.0f || u > 1.0f)) { - return EXPP_incr_ret( Py_None ); + Py_RETURN_NONE; } /* prepare to test the V parameter */ @@ -1296,7 +1324,7 @@ PyObject *M_Mathutils_Intersect( PyObject * self, PyObject * args ) v = Inpf(dir, qvec) * inv_det; if (clip && (v < 0.0f || u + v > 1.0f)) { - return EXPP_incr_ret( Py_None ); + Py_RETURN_NONE; } /* calculate t, ray intersects triangle */ @@ -1315,15 +1343,14 @@ PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args ) VectorObject *vec1, *vec2, *vec3, *vec4; float v1[3], v2[3], v3[3], v4[3], i1[3], i2[3]; - if( !PyArg_ParseTuple - ( args, "O!O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2 - , &vector_Type, &vec3, &vector_Type, &vec4 ) ) - return ( EXPP_ReturnPyObjError - ( PyExc_TypeError, "expected 4 vector types\n" ) ); - if( vec1->size != vec2->size || vec1->size != vec3->size || vec1->size != vec2->size) - return ( EXPP_ReturnPyObjError( PyExc_TypeError, - "vectors must be of the same size\n" ) ); - + if( !PyArg_ParseTuple( args, "O!O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3, &vector_Type, &vec4 ) ) { + PyErr_SetString( PyExc_TypeError, "expected 4 vector types\n" ); + return NULL; + } + if( vec1->size != vec2->size || vec1->size != vec3->size || vec1->size != vec2->size) { + PyErr_SetString( PyExc_TypeError,"vectors must be of the same size\n" ); + return NULL; + } if( vec1->size == 3 || vec1->size == 2) { int result; @@ -1355,7 +1382,7 @@ PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args ) if (result == 0) { /* colinear */ - return EXPP_incr_ret( Py_None ); + Py_RETURN_NONE; } else { tuple = PyTuple_New( 2 ); @@ -1365,8 +1392,8 @@ PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args ) } } else { - return ( EXPP_ReturnPyObjError( PyExc_TypeError, - "2D/3D vectors only\n" ) ); + PyErr_SetString( PyExc_TypeError, "2D/3D vectors only\n" ); + return NULL; } } @@ -1382,18 +1409,18 @@ PyObject *M_Mathutils_QuadNormal( PyObject * self, PyObject * args ) VectorObject *vec4; float v1[3], v2[3], v3[3], v4[3], e1[3], e2[3], n1[3], n2[3]; - if( !PyArg_ParseTuple - ( args, "O!O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2 - , &vector_Type, &vec3, &vector_Type, &vec4 ) ) - return ( EXPP_ReturnPyObjError - ( PyExc_TypeError, "expected 4 vector types\n" ) ); - if( vec1->size != vec2->size || vec1->size != vec3->size || vec1->size != vec4->size) - return ( EXPP_ReturnPyObjError( PyExc_TypeError, - "vectors must be of the same size\n" ) ); - if( vec1->size != 3 ) - return ( EXPP_ReturnPyObjError( PyExc_TypeError, - "only 3D vectors\n" ) ); - + if( !PyArg_ParseTuple( args, "O!O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3, &vector_Type, &vec4 ) ) { + PyErr_SetString( PyExc_TypeError, "expected 4 vector types\n" ); + return NULL; + } + if( vec1->size != vec2->size || vec1->size != vec3->size || vec1->size != vec4->size) { + PyErr_SetString( PyExc_TypeError,"vectors must be of the same size\n" ); + return NULL; + } + if( vec1->size != 3 ) { + PyErr_SetString( PyExc_TypeError, "only 3D vectors\n" ); + return NULL; + } VECCOPY(v1, vec1->vec); VECCOPY(v2, vec2->vec); VECCOPY(v3, vec3->vec); @@ -1426,17 +1453,18 @@ PyObject *M_Mathutils_TriangleNormal( PyObject * self, PyObject * args ) VectorObject *vec1, *vec2, *vec3; float v1[3], v2[3], v3[3], e1[3], e2[3], n[3]; - if( !PyArg_ParseTuple - ( args, "O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2 - , &vector_Type, &vec3 ) ) - return ( EXPP_ReturnPyObjError - ( PyExc_TypeError, "expected 3 vector types\n" ) ); - if( vec1->size != vec2->size || vec1->size != vec3->size ) - return ( EXPP_ReturnPyObjError( PyExc_TypeError, - "vectors must be of the same size\n" ) ); - if( vec1->size != 3 ) - return ( EXPP_ReturnPyObjError( PyExc_TypeError, - "only 3D vectors\n" ) ); + if( !PyArg_ParseTuple( args, "O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3 ) ) { + PyErr_SetString( PyExc_TypeError, "expected 3 vector types\n" ); + return NULL; + } + if( vec1->size != vec2->size || vec1->size != vec3->size ) { + PyErr_SetString( PyExc_TypeError, "vectors must be of the same size\n" ); + return NULL; + } + if( vec1->size != 3 ) { + PyErr_SetString( PyExc_TypeError, "only 3D vectors\n" ); + return NULL; + } VECCOPY(v1, vec1->vec); VECCOPY(v2, vec2->vec); @@ -1461,12 +1489,14 @@ PyObject *M_Mathutils_TriangleArea( PyObject * self, PyObject * args ) if( !PyArg_ParseTuple ( args, "O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2 - , &vector_Type, &vec3 ) ) - return ( EXPP_ReturnPyObjError - ( PyExc_TypeError, "expected 3 vector types\n" ) ); - if( vec1->size != vec2->size || vec1->size != vec3->size ) - return ( EXPP_ReturnPyObjError( PyExc_TypeError, - "vectors must be of the same size\n" ) ); + , &vector_Type, &vec3 ) ) { + PyErr_SetString( PyExc_TypeError, "expected 3 vector types\n"); + return NULL; + } + if( vec1->size != vec2->size || vec1->size != vec3->size ) { + PyErr_SetString( PyExc_TypeError, "vectors must be of the same size\n" ); + return NULL; + } if (vec1->size == 3) { VECCOPY(v1, vec1->vec); @@ -1488,8 +1518,8 @@ PyObject *M_Mathutils_TriangleArea( PyObject * self, PyObject * args ) return PyFloat_FromDouble( AreaF2Dfl(v1, v2, v3) ); } else { - return ( EXPP_ReturnPyObjError( PyExc_TypeError, - "only 2D,3D vectors are supported\n" ) ); + PyErr_SetString( PyExc_TypeError, "only 2D,3D vectors are supported\n" ); + return NULL; } } //#############################DEPRECATED################################ @@ -1581,9 +1611,10 @@ PyObject *M_Mathutils_RotateEuler(PyObject * self, PyObject * args) --warning; } - if(!PyArg_ParseTuple(args, "O!fs", &euler_Type, &Eul, &angle, &axis)) - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.RotateEuler(): expected euler type & float & string"); + if(!PyArg_ParseTuple(args, "O!fs", &euler_Type, &Eul, &angle, &axis)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.RotateEuler(): expected euler type & float & string"); + return NULL; + } Euler_Rotate(Eul, Py_BuildValue("fs", angle, axis)); Py_RETURN_NONE; @@ -1602,9 +1633,10 @@ PyObject *M_Mathutils_MatMultVec(PyObject * self, PyObject * args) } //get pyObjects - if(!PyArg_ParseTuple(args, "O!O!", &matrix_Type, &mat, &vector_Type, &vec)) - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.MatMultVec(): MatMultVec() expects a matrix and a vector object - in that order\n"); + if(!PyArg_ParseTuple(args, "O!O!", &matrix_Type, &mat, &vector_Type, &vec)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.MatMultVec(): MatMultVec() expects a matrix and a vector object - in that order\n"); + return NULL; + } return column_vector_multiplication(mat, vec); } @@ -1622,9 +1654,10 @@ PyObject *M_Mathutils_VecMultMat(PyObject * self, PyObject * args) } //get pyObjects - if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec, &matrix_Type, &mat)) - return EXPP_ReturnPyObjError(PyExc_TypeError, - "Mathutils.VecMultMat(): VecMultMat() expects a vector and matrix object - in that order\n"); + if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec, &matrix_Type, &mat)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.VecMultMat(): VecMultMat() expects a vector and matrix object - in that order\n"); + return NULL; + } return row_vector_multiplication(vec, mat); } diff --git a/source/blender/python/api2_2x/Mathutils.h b/source/blender/python/api2_2x/Mathutils.h index d3d3354d42f..abbf14463a6 100644 --- a/source/blender/python/api2_2x/Mathutils.h +++ b/source/blender/python/api2_2x/Mathutils.h @@ -83,17 +83,4 @@ int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps); #define Py_WRAP 1024 #define Py_NEW 2048 - -/* Allow us to build with Py3k */ -#if (PY_VERSION_HEX >= 0x03000000) -#define PyString_FromString PyUnicode_FromString -#define intobjargproc ssizeobjargproc -#define intintobjargproc ssizessizeobjargproc -#define intargfunc ssizeargfunc -#define intintargfunc ssizessizeargfunc - - -#endif - - #endif /* EXPP_Mathutils_H */ diff --git a/source/blender/python/api2_2x/vector.c b/source/blender/python/api2_2x/vector.c index f65c4dff600..dd53cca9054 100644 --- a/source/blender/python/api2_2x/vector.c +++ b/source/blender/python/api2_2x/vector.c @@ -57,7 +57,7 @@ struct PyMethodDef Vector_methods[] = { {NULL, NULL, 0, NULL} }; -/*-----------------------------METHODS---------------------------- +/*-----------------------------METHODS---------------------------- */ /*----------------------------Vector.zero() ---------------------- set the vector data to 0,0,0 */ PyObject *Vector_Zero(VectorObject * self) -- cgit v1.2.3 From 8b69260f00c32a1ef53c4600684f3271667d800b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 21 Apr 2009 12:48:49 +0000 Subject: hope this lets py2.3 build again --- source/blender/python/api2_2x/Mathutils.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source') diff --git a/source/blender/python/api2_2x/Mathutils.h b/source/blender/python/api2_2x/Mathutils.h index abbf14463a6..7406c5c4810 100644 --- a/source/blender/python/api2_2x/Mathutils.h +++ b/source/blender/python/api2_2x/Mathutils.h @@ -83,4 +83,17 @@ int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps); #define Py_WRAP 1024 #define Py_NEW 2048 + +/* Mathutils is used by the BGE and Blender so have to define + * some things here for luddite mac users of py2.3 */ +#ifndef Py_RETURN_NONE +#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None +#endif +#ifndef Py_RETURN_FALSE +#define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False +#endif +#ifndef Py_RETURN_TRUE +#define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True +#endif + #endif /* EXPP_Mathutils_H */ -- cgit v1.2.3 From ca78b6ee8b7b3eacf2c0cb17fb2570f94dac91b8 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 21 Apr 2009 13:30:58 +0000 Subject: Bugfix #18519 MultiLayer save (F3) crashes when no rendering/layers exist, happens for opengl preview render. It now survives, saving empty file and prints error. Better solution for later: render profiles! --- source/blender/imbuf/intern/openexr/openexr_api.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 3e618a483e3..9e077cbc809 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -570,13 +570,17 @@ void IMB_exr_write_channels(void *handle) FrameBuffer frameBuffer; ExrChannel *echan; - for(echan= (ExrChannel *)data->channels.first; echan; echan= echan->next) - frameBuffer.insert (echan->name, Slice (FLOAT, (char *)echan->rect, - echan->xstride*sizeof(float), echan->ystride*sizeof(float))); - - data->ofile->setFrameBuffer (frameBuffer); - data->ofile->writePixels (data->height); - + if(data->channels.first) { + for(echan= (ExrChannel *)data->channels.first; echan; echan= echan->next) + frameBuffer.insert (echan->name, Slice (FLOAT, (char *)echan->rect, + echan->xstride*sizeof(float), echan->ystride*sizeof(float))); + + data->ofile->setFrameBuffer (frameBuffer); + data->ofile->writePixels (data->height); + } + else { + printf("Error: attempt to save MultiLayer without layers.\n"); + } } void IMB_exr_read_channels(void *handle) -- cgit v1.2.3 From aff2a11110c84fc84764c2108981411275a2dda2 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Tue, 21 Apr 2009 13:34:33 +0000 Subject: Fix for missing include using CMake --- source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt index 322d7b79e6f..d061a449b7e 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt @@ -37,6 +37,7 @@ SET(INC ../../../../source/blender/makesdna ../../../../source/blender/blenkernel ../../../../source/blender/blenlib + ../../../../source/blender/blenloader ) BLENDERLIB(bf_oglrasterizer "${SRC}" "${INC}") -- cgit v1.2.3 From 4cf2863a8f5ece6176f40adb6681beb2d75b8c9e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 21 Apr 2009 13:44:24 +0000 Subject: SHD_dynamic had gen_utils functions from Mathutils, removing --- source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c index 88efd47fa66..9a8f2f13d65 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c @@ -51,13 +51,15 @@ static void node_dynamic_free_storage_cb(bNode *node); #ifndef DISABLE_PYTHON static PyObject *init_dynamicdict(void) { - PyObject *newscriptdict; + PyObject *newscriptdict, *item; PyGILState_STATE gilstate = PyGILState_Ensure(); newscriptdict= PyDict_New(); PyDict_SetItemString(newscriptdict, "__builtins__", PyEval_GetBuiltins()); - EXPP_dict_set_item_str(newscriptdict, "__name__", PyString_FromString("__main__")); + item= PyString_FromString("__main__"); + PyDict_SetItemString(newscriptdict, "__name__", item); + Py_DECREF(item); PyGILState_Release(gilstate); -- cgit v1.2.3 From 5d0fb28f74648e6bf07887bd442740fc45792347 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 21 Apr 2009 15:22:41 +0000 Subject: bugfix #18543 Using feature XRay + Transparent could crash on undo/redo, the view3d afterdraw was still storing data here whilst it shouldn't... Reason was that object got added twice actually... but only freed once. Also caused weird flashy display. Note to Brecht for merging: skip this one, I'll fix it in 2.5 too. --- source/blender/src/drawobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index c9fffa407ee..5fb60449a25 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -4738,7 +4738,7 @@ void draw_object(Base *base, int flag) /* don't do xray in particle mode, need the z-buffer */ if(!(G.f & G_PARTICLEEDIT)) { /* xray and transp are set when it is drawing the 2nd/3rd pass */ - if(!G.vd->xray && !G.vd->transp && (ob->dtx & OB_DRAWXRAY)) { + if(!G.vd->xray && !G.vd->transp && (ob->dtx & OB_DRAWXRAY) && !(ob->dtx & OB_DRAWTRANSP)) { add_view3d_after(G.vd, base, V3D_XRAY, flag); return; } -- cgit v1.2.3 From 6c33cc9bae9a565ee2ea5247754c6a4b127795bf Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 21 Apr 2009 15:38:53 +0000 Subject: Bugfix #18550 "Copy constraints" should increase ipo user count. --- source/blender/blenkernel/intern/constraint.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source') diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index f93fc403404..6b6f4a58e79 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -3551,6 +3551,8 @@ void copy_constraints (ListBase *dst, ListBase *src) /* make a new copy of the constraint's data */ con->data = MEM_dupallocN(con->data); + id_us_plus((ID *)con->ipo); + /* only do specific constraints if required */ if (cti && cti->copy_data) cti->copy_data(con, srccon); -- cgit v1.2.3 From a82a6bedc55fe676c11bf36f1017c0cbddcd9ca2 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Tue, 21 Apr 2009 16:58:25 +0000 Subject: Fix for bug #17457. This bug relates to files that have missing multires vertex data. The fix is, if the file was saved on the highest multires level, then mesh contains a copy of the vertices anyway, and we can just copy it back into multires. Otherwise, multires is removed from the mesh to avoid a crash. --- source/blender/blenkernel/intern/multires.c | 3 ++- source/blender/blenloader/intern/readfile.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 4d312632b1a..8112c64d79f 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -111,7 +111,8 @@ void multires_free(Multires *mr) lvl= lvl->next; } - MEM_freeN(mr->verts); + if(mr->verts) + MEM_freeN(mr->verts); BLI_freelistN(&mr->levels); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c88e06a9993..477f5a6cb59 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2876,6 +2876,18 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh) lvl->map_mem= NULL; } } + + /* Gracefully handle corrupted mesh */ + if(mesh->mr && !mesh->mr->verts) { + /* If totals match, simply load the current mesh verts into multires */ + if(mesh->totvert == ((MultiresLevel*)mesh->mr->levels.last)->totvert) + mesh->mr->verts = MEM_dupallocN(mesh->mvert); + else { + /* Otherwise, we can't recover the data, silently remove multires */ + multires_free(mesh->mr); + mesh->mr = NULL; + } + } if((fd->flags & FD_FLAGS_SWITCH_ENDIAN) && mesh->tface) { TFace *tf= mesh->tface; -- cgit v1.2.3 From 95b43536f6c1da49b8ee94c287e84686c6732a8f Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Tue, 21 Apr 2009 17:24:16 +0000 Subject: Some Makefile changes still laying around. --- source/Makefile | 5 ++++- source/blender/blenkernel/intern/Makefile | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/Makefile b/source/Makefile index d8dee601998..b190118bc38 100644 --- a/source/Makefile +++ b/source/Makefile @@ -83,7 +83,7 @@ GRPLIB += $(NAN_STRING)/lib/$(DEBUG_DIR)libstring.a GRPLIB += $(OCGDIR)/blender/render/$(DEBUG_DIR)librender.a GRPLIB += $(OCGDIR)/blender/radiosity/$(DEBUG_DIR)libradiosity.a GRPLIB += $(NAN_OPENNL)/lib/$(DEBUG_DIR)libopennl.a -GRPLIB += $(NAN_SUPERLU)/lib/$(DEBUG_DIR)libsuperlu.a +GRPLIB += $(NAN_SUPERLU)/lib/$(DEBUG_DIR)libsuperlu.a GRPLIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a # nlin: the reason that some libraries appear more than once below is @@ -154,6 +154,9 @@ ifneq ($(NAN_NO_KETSJI),true) COMLIB += $(NAN_BULLET2)/lib/libbullet2.a endif +# Cloth requires bullet2, gameegine does not matter anymore +#COMLIB += $(NAN_BULLET2)/lib/libbullet2.a + COMLIB += $(NAN_GUARDEDALLOC)/lib/libguardedalloc.a COMLIB += $(NAN_MEMUTIL)/lib/libmemutil.a COMLIB += $(NAN_BMFONT)/lib/$(DEBUG_DIR)libbmfont.a diff --git a/source/blender/blenkernel/intern/Makefile b/source/blender/blenkernel/intern/Makefile index 226e416dad7..75f75b0c3c5 100644 --- a/source/blender/blenkernel/intern/Makefile +++ b/source/blender/blenkernel/intern/Makefile @@ -82,7 +82,7 @@ CPPFLAGS += -I../../gpu CPPFLAGS += -I.. # path to bullet2, for cloth -CPPFLAGS += -I../../../../extern/bullet2/src +CPPFLAGS += -I$(NAN_BULLET2)/include ifeq ($(WITH_FREETYPE2), true) CPPFLAGS += -DWITH_FREETYPE2 -- cgit v1.2.3 From c5756a9822f72579ddc1797dbe7612035a9b2bfe Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Tue, 21 Apr 2009 17:37:07 +0000 Subject: Compile warnings, typos and some clarifications. --- source/blender/blenkernel/bad_level_call_stubs/stubs.c | 5 +++-- source/blender/blenkernel/intern/image.c | 4 ++-- source/blender/imbuf/intern/rotate.c | 6 ++---- source/blender/include/BIF_editseq.h | 2 +- source/blender/include/blendef.h | 2 +- source/blender/src/editseq.c | 2 +- source/blender/src/header_info.c | 6 +++--- source/blender/src/meshtools.c | 12 ++++++------ source/creator/buildinfo.c | 10 +++++----- 9 files changed, 24 insertions(+), 25 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/bad_level_call_stubs/stubs.c b/source/blender/blenkernel/bad_level_call_stubs/stubs.c index 5f6472ce56e..341379de1d9 100644 --- a/source/blender/blenkernel/bad_level_call_stubs/stubs.c +++ b/source/blender/blenkernel/bad_level_call_stubs/stubs.c @@ -327,7 +327,7 @@ void antialias_tagbuf(int xsize, int ysize, char *rectmove) {} /* imagetexture.c stub */ void ibuf_sample(struct ImBuf *ibuf, float fx, float fy, float dx, float dy, float *result) {} -void update_for_newframe() {} +void update_for_newframe(void) {} struct FileList; void BIF_filelist_freelib(struct FileList* filelist) {}; @@ -336,7 +336,8 @@ void BIF_filelist_freelib(struct FileList* filelist) {}; TimeMarker *get_frame_marker(int frame){return 0;}; /* editseq.c */ -Sequence *get_forground_frame_seq(int frame){return 0;}; +#include "BIF_editseq.h" // And fix the missing void there +Sequence *get_foreground_frame_seq(int frame){return 0;}; void clear_last_seq(Sequence *seq){}; diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index e817c38618f..01d8ed4d41c 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -407,7 +407,7 @@ static ImBuf *add_ibuf_size(int width, int height, char *name, int floatbuf, sho unsigned char *rect= NULL; float *rect_float= NULL; int x, y; - int checkerwidth=21, dark=1; + int checkerwidth=32, dark=1; if (floatbuf) { ibuf= IMB_allocImBuf(width, height, 24, IB_rectfloat, 0); @@ -1024,7 +1024,7 @@ static void stampdata(StampData *stamp_data, int do_prefix) } if (G.scene->r.stamp & R_STAMP_SEQSTRIP) { - Sequence *seq = get_forground_frame_seq(CFRA); + Sequence *seq = get_foreground_frame_seq(CFRA); if (seq) strcpy(text, seq->name+2); else strcpy(text, ""); diff --git a/source/blender/imbuf/intern/rotate.c b/source/blender/imbuf/intern/rotate.c index c04987b3e71..732c06907df 100644 --- a/source/blender/imbuf/intern/rotate.c +++ b/source/blender/imbuf/intern/rotate.c @@ -30,6 +30,7 @@ */ #include "BLI_blenlib.h" +#include "BKE_utildefines.h" #include "imbuf.h" #include "imbuf_patch.h" @@ -94,7 +95,6 @@ void IMB_flipy(struct ImBuf * ibuf) void IMB_flipx(struct ImBuf * ibuf) { short x, y, xr, xl, yi; - unsigned int px; float px_f[4]; if (ibuf == NULL) return; @@ -105,9 +105,7 @@ void IMB_flipx(struct ImBuf * ibuf) if (ibuf->rect) { for(yi=y-1;yi>=0;yi--) { for(xr=x-1, xl=0; xr>=xl; xr--, xl++) { - px = ibuf->rect[(x*yi)+xr]; - ibuf->rect[(x*yi)+xr] = ibuf->rect[(x*yi)+xl]; - ibuf->rect[(x*yi)+xl] = px; + SWAP(unsigned int, ibuf->rect[(x*yi)+xr], ibuf->rect[(x*yi)+xl]); } } } diff --git a/source/blender/include/BIF_editseq.h b/source/blender/include/BIF_editseq.h index be30a3eaaf3..54e99ca1828 100644 --- a/source/blender/include/BIF_editseq.h +++ b/source/blender/include/BIF_editseq.h @@ -41,7 +41,7 @@ void reload_sequence(void); void update_seq_ipo_rect(struct Sequence * seq); void update_seq_icu_rects(struct Sequence * seq); struct Sequence* get_last_seq(); -struct Sequence* get_forground_frame_seq( int frame ); +struct Sequence* get_foreground_frame_seq( int frame ); void set_last_seq(struct Sequence * seq); void clear_last_seq(); void del_seq(void); diff --git a/source/blender/include/blendef.h b/source/blender/include/blendef.h index dc05acc1735..8bde3da85c7 100644 --- a/source/blender/include/blendef.h +++ b/source/blender/include/blendef.h @@ -35,7 +35,7 @@ #define MAXFRAMEF 300000.0f #define MINFRAME 1 -#define MINFRAMEF 1.0 +#define MINFRAMEF 1.0f /* max length material array, 16 because of bits in matfrom */ #define MAXPICKBUF 10000 diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c index 76e44e5c24f..e2211e56fca 100644 --- a/source/blender/src/editseq.c +++ b/source/blender/src/editseq.c @@ -174,7 +174,7 @@ void clear_last_seq() _last_seq_init = 0; } -Sequence *get_forground_frame_seq(int frame) +Sequence *get_foreground_frame_seq(int frame) { Editing *ed; Sequence *seq, *best_seq=NULL; diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c index 6e43b6073eb..612836c86e9 100644 --- a/source/blender/src/header_info.c +++ b/source/blender/src/header_info.c @@ -1929,7 +1929,7 @@ static uiBlock *info_timelinemenu(void *arg_unused) void do_info_render_bakemenu(void *arg, int event) { switch (event) { - case 6: + case (R_BAKE_TO_ACTIVE|R_BAKE_OSA): G.scene->r.bake_flag ^= event; break; default: @@ -1948,9 +1948,9 @@ static uiBlock *info_render_bakemenu(void *arg_unused) uiBlockSetButmFunc(block, do_info_render_bakemenu, NULL); if(G.scene->r.bake_flag & R_BAKE_TO_ACTIVE) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Selected to Active", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Selected to Active", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, (R_BAKE_TO_ACTIVE|R_BAKE_OSA), ""); } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Selected to Active", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Selected to Active", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, (R_BAKE_TO_ACTIVE|R_BAKE_OSA), ""); } uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); diff --git a/source/blender/src/meshtools.c b/source/blender/src/meshtools.c index 66a484eb903..db77d596025 100644 --- a/source/blender/src/meshtools.c +++ b/source/blender/src/meshtools.c @@ -650,9 +650,9 @@ static void mesh_octree_add_nodes(MocNode **basetable, float *co, float *offs, f float fx, fy, fz; int vx, vy, vz; - if (isnan(co[0]) || !finite(co[0]) || - isnan(co[1]) || !finite(co[1]) || - isnan(co[2]) || !finite(co[2]) + if (!finite(co[0]) || + !finite(co[1]) || + !finite(co[2]) ) { return; } @@ -869,9 +869,9 @@ EditVert *editmesh_get_x_mirror_vert(Object *ob, float *co) intptr_t poinval; /* ignore nan verts */ - if (isnan(co[0]) || !finite(co[0]) || - isnan(co[1]) || !finite(co[1]) || - isnan(co[2]) || !finite(co[2]) + if (!finite(co[0]) || + !finite(co[1]) || + !finite(co[2]) ) return NULL; diff --git a/source/creator/buildinfo.c b/source/creator/buildinfo.c index e25caa34f46..cef98915d79 100644 --- a/source/creator/buildinfo.c +++ b/source/creator/buildinfo.c @@ -33,11 +33,11 @@ #ifdef BUILD_DATE #ifndef WIN32 -char * build_date=BUILD_DATE; -char * build_time=BUILD_TIME; -char * build_rev=BUILD_REV; -char * build_platform=BUILD_PLATFORM; -char * build_type=BUILD_TYPE; +const char * build_date=BUILD_DATE; +const char * build_time=BUILD_TIME; +const char * build_rev=BUILD_REV; +const char * build_platform=BUILD_PLATFORM; +const char * build_type=BUILD_TYPE; #else #include "winbuildinfo.h" #endif -- cgit v1.2.3 From 41eb029bb9c2ab43c9feba901026ebd640be2c0a Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Tue, 21 Apr 2009 17:40:39 +0000 Subject: Old "divide by zero" bug and remove debug printf. --- source/blender/nodes/intern/CMP_nodes/CMP_normalize.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c b/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c index 846aec490c2..15f3148b54c 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c @@ -55,6 +55,7 @@ static void do_normalize(bNode *node, float *out, float *src, float *min, float } } +/* The code below assumes all data is inside range +- this, and that input buffer is single channel */ #define BLENDER_ZMAX 10000.0f static void node_composit_exec_normalize(void *data, bNode *node, bNodeStack **in, bNodeStack **out) @@ -63,7 +64,7 @@ static void node_composit_exec_normalize(void *data, bNode *node, bNodeStack **i /* stack order out: valbuf */ if(out[0]->hasoutput==0) return; - /* input no image? then only value operation */ + /* Input has no image buffer? Then pass the value */ if(in[0]->data==NULL) { QUATCOPY(out[0]->vec, in[0]->vec); } @@ -78,18 +79,20 @@ static void node_composit_exec_normalize(void *data, bNode *node, bNodeStack **i CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); /* allocs */ for (val = cbuf->rect; tot; tot--, val++) { - if ((*val > max) && (*val < BLENDER_ZMAX)) { + if ((*val > max) && (*val <= BLENDER_ZMAX)) { max = *val; } - if (*val < min) { + if ((*val < min) && (*val >= -BLENDER_ZMAX)) { min = *val; } } - mult = 1.0f/(max-min); - - printf("min %f max %f\n", min, max); - - composit3_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, NULL, &min, NULL, &mult, do_normalize, CB_VAL, CB_VAL, CB_VAL); + /* In the rare case of flat buffer, which would cause a divide by 0, just pass the input to the output */ + if ((max-min) != 0.0f) { + mult = 1.0f/(max-min); + composit3_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, NULL, &min, NULL, &mult, do_normalize, CB_VAL, CB_VAL, CB_VAL); + } else { + memcpy(stackbuf->rect, cbuf->rect, sizeof(float) * cbuf->x * cbuf->y); + } out[0]->data= stackbuf; } -- cgit v1.2.3 From 2db9f14ccd1dfd5608375c326155ed1b9b2e5222 Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Tue, 21 Apr 2009 17:58:28 +0000 Subject: Documentation. --- source/blender/include/BIF_butspace.h | 86 ++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/include/BIF_butspace.h b/source/blender/include/BIF_butspace.h index f0b37814947..c3f7574ec77 100644 --- a/source/blender/include/BIF_butspace.h +++ b/source/blender/include/BIF_butspace.h @@ -134,7 +134,89 @@ extern void validate_editbonebutton_cb(void *bonev, void *namev); #define X4CLM2 77 #define X4CLM3 165 #define X4CLM4 232 - -#endif +#if 0 +/* start buttons grid doc/reclacement version +/* With this system rows can easily have 1 to 4 buttons + or create perfectly aligned 1 to 4 columns layouts + + < - - - PANEL_XMAX - - - >| + < - - - PANELX - - - > + + .-- XSPACE side padding --. + | | + |.- All CLM1 | + || X2CLM2 -. X3CLM3 | + || | | | + +v|-------------|----|-------v+ + <-/ | | | + | [ But1 ] | 1 button of BUTW1 size + <- -/ | | + | [ But1 ]=[ But2 ] | 2 buttons of BUTW2 size + <- -/ | + v | [ But1 ]=[ But2 ]#[ But3 ] | 3 buttons of BUTW3 size + | | | v + ^ | [But1]#[But2]=[But3]#[But4] | | 4 buttons of BUTW3 size + | <- ^ ^ -\ | ^ + | +-------|------|-------|------+ | + | | | | | + '- YSPACE '---.--' '- X4CLM4 '- BUTH + (row to row) | + Padding based in XSPACE (= normal, # +1 pix to make all match) + + Calls like uiBlockBeginAlign/uiBlockEndAlign will make the button + to button space disappear if needed, forming a compact group, in some themes + + TODO: Figure relations, meaning and usage of + PANELY, PANEL_YMAX, PANELW, PANELH + */ +#define PANELX 320 +#define PANELY 0 +#define PANELW 318 +#define PANELH 204 + +#define XSPACE 10 +#define YSPACE 6 +#define PANEL_XMAX (PANELX - XSPACE) +#define PANEL_YMAX 210 + +/* The widths follow 300, 150, 100 and 75, which is nice (discarding spacing) + sadly spacers and integer rounding make 3 and 4 column complex cases + so they better be manually set and checked following the comments */ +#define BUTW1 (PANELX - (2 * XSPACE)) +#define BUTW2 ((BUTW1 / 2) - XSPACE) +/* Manual calc so BUTW3 + XSPACE + BUTW3 + (XSPACE+1) + BUTW3 = BUTW1 + Could be something like ((BUTW1/3)-(1+(2*XSPACE)) if starting with 300 */ +#define BUTW3 93 +/* This time BUTW4 + (XSPACE+1) + BUTW4 + XSPACE + BUTW4 + (XSPACE+1) + BUTW4 = BUTW1 + That would be ((BUTW1/4)-(2+(3*XSPACE)) if starting with 300 */ +#define BUTW4 67 +/* NOTE: Again, BUTW3 and BUTW4 values and formulas include manual tuning, + retune if base BUTW1 stops being 300 pixels. You have been warned */ +#define ICONBUTW 20 +#define BUTH 22 + +/* X axis start positions of column presets + First number declares how many columns total + Second number declares the exact column it controls + So X3CLM2 means X start position of 2nd button for a row of 3 buttons */ +#define X1CLM1 XSPACE + +#define X2CLM1 X1CLM1 +#define X2CLM2 (X2CLM1 + BUTW2 + XSPACE) + +#define X3CLM1 X1CLM1 +#define X3CLM2 (X3CLM1 + BUTW3 + XSPACE) +/* By substracting from end we already get the extra 1 pix */ +#define X3CLM3 (PANEL_XMAX - BUTW3) +#define X4CLM1 X1CLM1 +/* Extra pix to reach the BUTW1 total size */ +#define X4CLM2 (X4CLM1 + BUTW4 + XSPACE + 1) +#define X4CLM3 (X4CLM2 + BUTW4 + XSPACE) +/* By substracting from end we already get the other extra 1 pix */ +#define X4CLM4 (PANEL_XMAX - BUTW4) +/* end buttons grid doc/replacement version */ +#endif /* if 0 */ + +#endif -- cgit v1.2.3 From 094b3e81f68483aeca7c33875467c3f43dee0b0d Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Tue, 21 Apr 2009 18:41:45 +0000 Subject: Balance comment markers. --- source/blender/include/BIF_butspace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/include/BIF_butspace.h b/source/blender/include/BIF_butspace.h index c3f7574ec77..94bf7d65832 100644 --- a/source/blender/include/BIF_butspace.h +++ b/source/blender/include/BIF_butspace.h @@ -137,7 +137,7 @@ extern void validate_editbonebutton_cb(void *bonev, void *namev); #if 0 /* start buttons grid doc/reclacement version -/* With this system rows can easily have 1 to 4 buttons + With this system rows can easily have 1 to 4 buttons or create perfectly aligned 1 to 4 columns layouts < - - - PANEL_XMAX - - - >| -- cgit v1.2.3 From 221f589f519e9adff986281320ca681f0b1b2b7a Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Tue, 21 Apr 2009 21:33:03 +0000 Subject: BGE bug #18521 fixed: Dupligroups + Bullet Softbodies are broken. --- source/gameengine/Ketsji/KX_Scene.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index f57a38d290d..6917305522e 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -717,12 +717,13 @@ void KX_Scene::DupliGroupRecurse(CValue* obj, int level) // set the replica's relative scale with the rootnode's scale replica->NodeSetRelativeScale(newscale); - MT_Matrix3x3 newori = groupobj->NodeGetWorldOrientation() * gameobj->NodeGetWorldOrientation(); - replica->NodeSetLocalOrientation(newori); MT_Point3 offset(group->dupli_ofs); MT_Point3 newpos = groupobj->NodeGetWorldPosition() + newscale*(groupobj->NodeGetWorldOrientation() * (gameobj->NodeGetWorldPosition()-offset)); replica->NodeSetLocalPosition(newpos); + // set the orientation after position for softbody! + MT_Matrix3x3 newori = groupobj->NodeGetWorldOrientation() * gameobj->NodeGetWorldOrientation(); + replica->NodeSetLocalOrientation(newori); replica->GetSGNode()->UpdateWorldData(0); replica->GetSGNode()->SetBBox(gameobj->GetSGNode()->BBox()); -- cgit v1.2.3 From 0145a93f2403063c22a14260e200174efb822fec Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 21 Apr 2009 23:15:18 +0000 Subject: Patch from Mitchell Stokes for KX_Light to use attrdef's Added type access to the SCA_PropertyActuator, added missing function in library docs. --- source/blender/python/api2_2x/doc/Library.py | 9 +- .../gameengine/GameLogic/SCA_PropertyActuator.cpp | 1 + source/gameengine/GameLogic/SCA_RandomSensor.cpp | 2 + source/gameengine/Ketsji/KX_Light.cpp | 247 ++++++++------------- source/gameengine/Ketsji/KX_Light.h | 7 + source/gameengine/Ketsji/KX_MeshProxy.cpp | 2 +- 6 files changed, 116 insertions(+), 152 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/doc/Library.py b/source/blender/python/api2_2x/doc/Library.py index c99739d939b..68b5f2858fb 100644 --- a/source/blender/python/api2_2x/doc/Library.py +++ b/source/blender/python/api2_2x/doc/Library.py @@ -58,7 +58,7 @@ def Close (): Close the currently open library file, if any. """ -def getName (): +def GetName (): """ Get the filename of the currently open library file. @rtype: string @@ -111,4 +111,9 @@ def Update (): down your script and make you look like a lousy programmer. Enough warnings :)? """ - +def LinkedLibs(): + """ + Return a list of all libs used in the the open .blend file (direct and indirect). + @rtype: list of strings + @return: a list of blendfile names. + """ diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index beb7a09a137..4facd8df27a 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -272,6 +272,7 @@ PyMethodDef SCA_PropertyActuator::Methods[] = { PyAttributeDef SCA_PropertyActuator::Attributes[] = { KX_PYATTRIBUTE_STRING_RW_CHECK("property",0,100,false,SCA_PropertyActuator,m_propname,CheckProperty), KX_PYATTRIBUTE_STRING_RW("value",0,100,false,SCA_PropertyActuator,m_exprtxt), + KX_PYATTRIBUTE_INT_RW("type", KX_ACT_PROP_NODEF+1, KX_ACT_PROP_MAX-1, false, SCA_PropertyActuator, m_type), /* ATTR_TODO add constents to game logic dict */ { NULL } //Sentinel }; diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 494b7a3694e..582cff4cde7 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -154,9 +154,11 @@ PyParentObject SCA_RandomSensor::Parents[] = { }; PyMethodDef SCA_RandomSensor::Methods[] = { + //Deprecated functions -----> {"setSeed", (PyCFunction) SCA_RandomSensor::sPySetSeed, METH_VARARGS, (PY_METHODCHAR)SetSeed_doc}, {"getSeed", (PyCFunction) SCA_RandomSensor::sPyGetSeed, METH_NOARGS, (PY_METHODCHAR)GetSeed_doc}, {"getLastDraw", (PyCFunction) SCA_RandomSensor::sPyGetLastDraw, METH_NOARGS, (PY_METHODCHAR)GetLastDraw_doc}, + //<----- Deprecated {NULL,NULL} //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index a1eb08e17bd..c5189907714 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -173,161 +173,15 @@ void KX_LightObject::UnbindShadowBuffer(RAS_IRasterizer *ras) GPU_lamp_shadow_buffer_unbind(lamp); } -PyObject* KX_LightObject::py_getattro(PyObject *attr) -{ - char *attr_str= PyString_AsString(attr); - - if (!strcmp(attr_str, "layer")) - return PyInt_FromLong(m_lightobj.m_layer); - - if (!strcmp(attr_str, "energy")) - return PyFloat_FromDouble(m_lightobj.m_energy); - - if (!strcmp(attr_str, "distance")) - return PyFloat_FromDouble(m_lightobj.m_distance); - - if (!strcmp(attr_str, "colour") || !strcmp(attr_str, "color")) - return Py_BuildValue("[fff]", m_lightobj.m_red, m_lightobj.m_green, m_lightobj.m_blue); - - if (!strcmp(attr_str, "lin_attenuation")) - return PyFloat_FromDouble(m_lightobj.m_att1); - - if (!strcmp(attr_str, "quad_attenuation")) - return PyFloat_FromDouble(m_lightobj.m_att2); - - if (!strcmp(attr_str, "spotsize")) - return PyFloat_FromDouble(m_lightobj.m_spotsize); - - if (!strcmp(attr_str, "spotblend")) - return PyFloat_FromDouble(m_lightobj.m_spotblend); - - if (!strcmp(attr_str, "SPOT")) - return PyInt_FromLong(RAS_LightObject::LIGHT_SPOT); - - if (!strcmp(attr_str, "SUN")) - return PyInt_FromLong(RAS_LightObject::LIGHT_SUN); - - if (!strcmp(attr_str, "NORMAL")) - return PyInt_FromLong(RAS_LightObject::LIGHT_NORMAL); - - if (!strcmp(attr_str, "type")) - return PyInt_FromLong(m_lightobj.m_type); - - py_getattro_up(KX_GameObject); -} +/* ------------------------------------------------------------------------- */ +/* Python Integration Hooks */ +/* ------------------------------------------------------------------------- */ PyObject* KX_LightObject::py_getattro_dict() { py_getattro_dict_up(KX_GameObject); } -int KX_LightObject::py_setattro(PyObject *attr, PyObject *pyvalue) -{ - char *attr_str= PyString_AsString(attr); - - if (PyInt_Check(pyvalue)) - { - int value = PyInt_AsLong(pyvalue); - if (!strcmp(attr_str, "layer")) - { - m_lightobj.m_layer = value; - return PY_SET_ATTR_SUCCESS; - } - - if (!strcmp(attr_str, "type")) - { - if (value >= RAS_LightObject::LIGHT_SPOT && value <= RAS_LightObject::LIGHT_NORMAL) - m_lightobj.m_type = (RAS_LightObject::LightType) value; - return PY_SET_ATTR_SUCCESS; - } - } - - if (PyFloat_Check(pyvalue) || PyInt_Check(pyvalue)) - { - float value = PyFloat_AsDouble(pyvalue); - if (!strcmp(attr_str, "energy")) - { - m_lightobj.m_energy = value; - return PY_SET_ATTR_SUCCESS; - } - - if (!strcmp(attr_str, "distance")) - { - m_lightobj.m_distance = value; - return PY_SET_ATTR_SUCCESS; - } - - if (!strcmp(attr_str, "lin_attenuation")) - { - m_lightobj.m_att1 = value; - return PY_SET_ATTR_SUCCESS; - } - - if (!strcmp(attr_str, "quad_attenuation")) - { - m_lightobj.m_att2 = value; - return PY_SET_ATTR_SUCCESS; - } - - if (!strcmp(attr_str, "spotsize")) - { - m_lightobj.m_spotsize = value; - return PY_SET_ATTR_SUCCESS; - } - - if (!strcmp(attr_str, "spotblend")) - { - m_lightobj.m_spotblend = value; - return PY_SET_ATTR_SUCCESS; - } - } - - if (PySequence_Check(pyvalue)) - { - if (!strcmp(attr_str, "colour") || !strcmp(attr_str, "color")) - { - MT_Vector3 color; - if (PyVecTo(pyvalue, color)) - { - m_lightobj.m_red = color[0]; - m_lightobj.m_green = color[1]; - m_lightobj.m_blue = color[2]; - return PY_SET_ATTR_SUCCESS; - } - return PY_SET_ATTR_FAIL; - } - } - - if (!strcmp(attr_str, "SPOT") || !strcmp(attr_str, "SUN") || !strcmp(attr_str, "NORMAL")) - { - PyErr_Format(PyExc_RuntimeError, "Attribute %s is read only.", attr_str); - return PY_SET_ATTR_FAIL; - } - - return KX_GameObject::py_setattro(attr, pyvalue); -} - -PyMethodDef KX_LightObject::Methods[] = { - {NULL,NULL} //Sentinel -}; - -PyAttributeDef KX_LightObject::Attributes[] = { - KX_PYATTRIBUTE_DUMMY("layer"), - KX_PYATTRIBUTE_DUMMY("energy"), - KX_PYATTRIBUTE_DUMMY("distance"), - KX_PYATTRIBUTE_DUMMY("colour"), - KX_PYATTRIBUTE_DUMMY("color"), - KX_PYATTRIBUTE_DUMMY("lin_attenuation"), - KX_PYATTRIBUTE_DUMMY("quad_attenuation"), - KX_PYATTRIBUTE_DUMMY("spotsize"), - KX_PYATTRIBUTE_DUMMY("spotblend"), - KX_PYATTRIBUTE_DUMMY("SPOT"), - KX_PYATTRIBUTE_DUMMY("SUN"), - KX_PYATTRIBUTE_DUMMY("NORMAL"), - KX_PYATTRIBUTE_DUMMY("type"), - { NULL } //Sentinel -}; - PyTypeObject KX_LightObject::Type = { PyObject_HEAD_INIT(NULL) 0, @@ -356,3 +210,98 @@ PyParentObject KX_LightObject::Parents[] = { &CValue::Type, NULL }; + +PyMethodDef KX_LightObject::Methods[] = { + {NULL,NULL} //Sentinel +}; + +PyAttributeDef KX_LightObject::Attributes[] = { + KX_PYATTRIBUTE_INT_RW("layer", 1, 20, true, KX_LightObject, m_lightobj.m_layer), + KX_PYATTRIBUTE_FLOAT_RW("energy", 0, 10, KX_LightObject, m_lightobj.m_energy), + KX_PYATTRIBUTE_FLOAT_RW("distance", 0.01, 5000, KX_LightObject, m_lightobj.m_distance), + KX_PYATTRIBUTE_RW_FUNCTION("color", KX_LightObject, pyattr_get_color, pyattr_set_color), + KX_PYATTRIBUTE_RW_FUNCTION("colour", KX_LightObject, pyattr_get_color, pyattr_set_color), + KX_PYATTRIBUTE_FLOAT_RW("lin_attenuation", 0, 1, KX_LightObject, m_lightobj.m_att1), + KX_PYATTRIBUTE_FLOAT_RW("quat_attenuation", 0, 1, KX_LightObject, m_lightobj.m_att2), + KX_PYATTRIBUTE_FLOAT_RW("spotsize", 1, 180, KX_LightObject, m_lightobj.m_spotsize), + KX_PYATTRIBUTE_FLOAT_RW("spotblend", 0, 1, KX_LightObject, m_lightobj.m_spotblend), + KX_PYATTRIBUTE_RO_FUNCTION("SPOT", KX_LightObject, pyattr_get_typeconst), + KX_PYATTRIBUTE_RO_FUNCTION("SUN", KX_LightObject, pyattr_get_typeconst), + KX_PYATTRIBUTE_RO_FUNCTION("NORMAL", KX_LightObject, pyattr_get_typeconst), + KX_PYATTRIBUTE_RW_FUNCTION("type", KX_LightObject, pyattr_get_type, pyattr_set_type), + { NULL } //Sentinel +}; + +PyObject* KX_LightObject::pyattr_get_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + KX_LightObject* self = static_cast(self_v); + return Py_BuildValue("[fff]", self->m_lightobj.m_red, self->m_lightobj.m_green, self->m_lightobj.m_blue); +} + +int KX_LightObject::pyattr_set_color(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) +{ + KX_LightObject* self = static_cast(self_v); + + MT_Vector3 color; + if (PyVecTo(value, color)) + { + self->m_lightobj.m_red = color[0]; + self->m_lightobj.m_green = color[1]; + self->m_lightobj.m_blue = color[2]; + return 0; + } + return 1; +} + +PyObject* KX_LightObject::pyattr_get_typeconst(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + PyObject* retvalue; + + const char* type = attrdef->m_name; + + if(strcmp(type, "SPOT")) { + retvalue = PyInt_FromLong(RAS_LightObject::LIGHT_SPOT); + } else if (strcmp(type, "SUN")) { + retvalue = PyInt_FromLong(RAS_LightObject::LIGHT_SUN); + } else if (strcmp(type, "NORMAL")) { + retvalue = PyInt_FromLong(RAS_LightObject::LIGHT_NORMAL); + } + + return retvalue; +} + +PyObject* KX_LightObject::pyattr_get_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + KX_LightObject* self = static_cast(self_v); + return PyInt_FromLong(self->m_lightobj.m_type); +} + +int KX_LightObject::pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value) +{ + KX_LightObject* self = static_cast(self_v); + int val = PyInt_AsLong(value); + switch(val) { + case 0: + self->m_lightobj.m_type = self->m_lightobj.LIGHT_SPOT; + break; + case 1: + self->m_lightobj.m_type = self->m_lightobj.LIGHT_SUN; + break; + default: + self->m_lightobj.m_type = self->m_lightobj.LIGHT_NORMAL; + break; + } + + return PY_SET_ATTR_SUCCESS; +} + + +PyObject* KX_LightObject::py_getattro(PyObject *attr) +{ + py_getattro_up(KX_GameObject); +} + +int KX_LightObject::py_setattro(PyObject *attr, PyObject *value) +{ + py_setattro_up(KX_GameObject); +} diff --git a/source/gameengine/Ketsji/KX_Light.h b/source/gameengine/Ketsji/KX_Light.h index e5d48b6f975..35f25515e3b 100644 --- a/source/gameengine/Ketsji/KX_Light.h +++ b/source/gameengine/Ketsji/KX_Light.h @@ -66,6 +66,13 @@ public: virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *pyvalue); + /* attributes */ + static PyObject* pyattr_get_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value); + static PyObject* pyattr_get_typeconst(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value); + virtual bool IsLight(void) { return true; } }; diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index cefa2ba4488..452cb9ad19b 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -267,7 +267,7 @@ KX_PYMETHODDEF_DOC(KX_MeshProxy, reinstancePhysicsMesh, "Reinstance the physics mesh.") { //this needs to be reviewed, it is dependend on Sumo/Solid. Who is using this ? - Py_RETURN_NONE;//(KX_ReInstanceShapeFromMesh(m_meshobj)) ? Py_RETURN_TRUE : Py_RETURN_FALSE; + (KX_ReInstanceShapeFromMesh(m_meshobj)) ? Py_RETURN_TRUE : Py_RETURN_FALSE; } PyObject* KX_MeshProxy::pyattr_get_materials(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) -- cgit v1.2.3 From 88c58d6b2d5a3ad74e4a06b71fe8071593cd7bfb Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Wed, 22 Apr 2009 06:30:32 +0000 Subject: BGE * the ternary form refused to compile properly with msvc, rewrite a bit. --- source/gameengine/Ketsji/KX_MeshProxy.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index 452cb9ad19b..65b163106c9 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -266,8 +266,12 @@ PyObject* KX_MeshProxy::PyGetPolygon(PyObject* args, PyObject* kwds) KX_PYMETHODDEF_DOC(KX_MeshProxy, reinstancePhysicsMesh, "Reinstance the physics mesh.") { +#if 0 //this needs to be reviewed, it is dependend on Sumo/Solid. Who is using this ? - (KX_ReInstanceShapeFromMesh(m_meshobj)) ? Py_RETURN_TRUE : Py_RETURN_FALSE; + if(KX_ReInstanceShapeFromMesh(m_meshobj)) + Py_RETURN_TRUE; +#endif + Py_RETURN_FALSE; } PyObject* KX_MeshProxy::pyattr_get_materials(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) -- cgit v1.2.3 From 785b784e0903f4cc04889a0790f15f6b01b7860b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 22 Apr 2009 09:47:57 +0000 Subject: BGE Python API improved how attribute errors are set so each classes py_getattro function dosnt need to set an error if the attribute doesn't exist. Now py_base_getattro sets an error on a NULL return value when no errors are set to avoid setting errors at multiple levels. --- source/gameengine/Expressions/PyObjectPlus.cpp | 26 +++++++++++++++++++------- source/gameengine/Expressions/PyObjectPlus.h | 10 +++++----- source/gameengine/Ketsji/KX_GameObject.cpp | 2 +- 3 files changed, 25 insertions(+), 13 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 96753d56d94..30495fc2a45 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -146,9 +146,23 @@ PyObject *PyObjectPlus::py_base_getattro(PyObject * self, PyObject *attr) PyObject *ret= self_plus->py_getattro(attr); - if(ret==NULL && (strcmp(PyString_AsString(attr), "__dict__")==0)) - ret= self_plus->py_getattro_dict(); - + /* Attribute not found, was this a __dict__ lookup?, otherwise set an error if none is set */ + if(ret==NULL) { + char *attr_str= PyString_AsString(attr); + + if (strcmp(attr_str, "__dict__")==0) + { + /* the error string will probably not + * be set but just incase clear it */ + PyErr_Clear(); + ret= self_plus->py_getattro_dict(); + } + else if (!PyErr_Occurred()) { + /* We looked for an attribute but it wasnt found + * since py_getattro didnt set the error, set it here */ + PyErr_Format(PyExc_AttributeError, "'%s' object has no attribute '%s'", self->ob_type->tp_name, attr_str); + } + } return ret; } @@ -183,8 +197,7 @@ PyObject *PyObjectPlus::py_getattro(PyObject* attr) { PyObject *descr = PyDict_GetItem(Type.tp_dict, attr); \ if (descr == NULL) { - PyErr_Format(PyExc_AttributeError, "attribute \"%s\" not found", PyString_AsString(attr)); - return NULL; + return NULL; /* py_base_getattro sets the error, this way we can avoid setting the error at many levels */ } else { /* Copied from py_getattro_up */ if (PyCObject_Check(descr)) { @@ -192,8 +205,7 @@ PyObject *PyObjectPlus::py_getattro(PyObject* attr) } else if (descr->ob_type->tp_descr_get) { return PyCFunction_New(((PyMethodDescrObject *)descr)->d_method, this->m_proxy); } else { - fprintf(stderr, "Unknown attribute type (PyObjectPlus::py_getattro)"); - return descr; + return NULL; } /* end py_getattro_up copy */ } diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index b0ddfa04e32..a3b3952a6d1 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -114,6 +114,9 @@ typedef struct { // This defines the py_getattro_up macro // which allows attribute and method calls // to be properly passed up the hierarchy. + // + // Note, PyDict_GetItem() WONT set an exception! + // let the py_base_getattro function do this. #define py_getattro_up(Parent) \ \ @@ -125,14 +128,11 @@ typedef struct { } else if (descr->ob_type->tp_descr_get) { \ return PyCFunction_New(((PyMethodDescrObject *)descr)->d_method, this->m_proxy); \ } else { \ - fprintf(stderr, "unknown attribute type"); \ - return descr; \ + return NULL; \ } \ } else { \ - PyErr_Clear(); \ return Parent::py_getattro(attr); \ - } \ - return NULL; + } #define py_getattro_dict_up(Parent) \ return py_getattr_dict(Parent::py_getattro_dict(), Type.tp_dict); diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 1f4c9c2e9d5..eb20cfa1131 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1655,7 +1655,7 @@ PyObject* KX_GameObject::pyattr_get_meshes(void *self_v, const KX_PYATTRIBUTE_DE PyObject *meshes= PyList_New(self->m_meshes.size()); int i; - for(i=0; i < self->m_meshes.size(); i++) + for(i=0; i < (int)self->m_meshes.size(); i++) { KX_MeshProxy* meshproxy = new KX_MeshProxy(self->m_meshes[i]); PyList_SET_ITEM(meshes, i, meshproxy->GetProxy()); -- cgit v1.2.3 From c09b1a985c29e59736eef619e2dae1a1dcf2d73a Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 22 Apr 2009 11:54:43 +0000 Subject: bugfix #18187 Using "Key Alpha" didn't work when using MBlur render. The accumulation code was assuming regular alpha then. Now it corrects for it. Still it's a bit of a weak spot in Blender's render system. I will look in the future to make this a real post process; converting all RGBA buffers in the system, including for all passes, to "key alpha". Combined with that our compositor should become alpha type aware too. Everything in Blender assumes premul alpha, which still just will work best in general... --- source/blender/render/intern/source/pipeline.c | 49 +++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 5c3c954aa8e..96edb4ee73c 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1639,6 +1639,42 @@ static void do_render_3d(Render *re) RE_Database_Free(re); } +/* called by blur loop, accumulate RGBA key alpha */ +static void addblur_rect_key(RenderResult *rr, float *rectf, float *rectf1, float blurfac) +{ + float mfac= 1.0f - blurfac; + int a, b, stride= 4*rr->rectx; + int len= stride*sizeof(float); + + for(a=0; arecty; a++) { + if(blurfac==1.0f) { + memcpy(rectf, rectf1, len); + } + else { + float *rf= rectf, *rf1= rectf1; + + for( b= rr->rectx; b>0; b--, rf+=4, rf1+=4) { + if(rf1[3]<0.01f) + rf[3]= mfac*rf[3]; + else if(rf[3]<0.01f) { + rf[0]= rf1[0]; + rf[1]= rf1[1]; + rf[2]= rf1[2]; + rf[3]= blurfac*rf1[3]; + } + else { + rf[0]= mfac*rf[0] + blurfac*rf1[0]; + rf[1]= mfac*rf[1] + blurfac*rf1[1]; + rf[2]= mfac*rf[2] + blurfac*rf1[2]; + rf[3]= mfac*rf[3] + blurfac*rf1[3]; + } + } + } + rectf+= stride; + rectf1+= stride; + } +} + /* called by blur loop, accumulate renderlayers */ static void addblur_rect(RenderResult *rr, float *rectf, float *rectf1, float blurfac, int channels) { @@ -1662,8 +1698,9 @@ static void addblur_rect(RenderResult *rr, float *rectf, float *rectf1, float bl } } + /* called by blur loop, accumulate renderlayers */ -static void merge_renderresult_blur(RenderResult *rr, RenderResult *brr, float blurfac) +static void merge_renderresult_blur(RenderResult *rr, RenderResult *brr, float blurfac, int key_alpha) { RenderLayer *rl, *rl1; RenderPass *rpass, *rpass1; @@ -1672,8 +1709,12 @@ static void merge_renderresult_blur(RenderResult *rr, RenderResult *brr, float b for(rl= rr->layers.first; rl && rl1; rl= rl->next, rl1= rl1->next) { /* combined */ - if(rl->rectf && rl1->rectf) - addblur_rect(rr, rl->rectf, rl1->rectf, blurfac, 4); + if(rl->rectf && rl1->rectf) { + if(key_alpha) + addblur_rect_key(rr, rl->rectf, rl1->rectf, blurfac); + else + addblur_rect(rr, rl->rectf, rl1->rectf, blurfac, 4); + } /* passes are allocated in sync */ rpass1= rl1->passes.first; @@ -1703,7 +1744,7 @@ static void do_render_blur_3d(Render *re) blurfac= 1.0f/(float)(re->r.osa-blur); - merge_renderresult_blur(rres, re->result, blurfac); + merge_renderresult_blur(rres, re->result, blurfac, re->r.alphamode & R_ALPHAKEY); if(re->test_break()) break; } -- cgit v1.2.3 From a8592d09d0173bab0e3eb66a315146e164cf14a4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 22 Apr 2009 12:16:41 +0000 Subject: BGE C++ API Some functions used ProcessReplica(replica); others replica->ProcessReplica() Use the second method everywhere so the PyObjectPlus's ProcessReplica() can be called from its subclasses. Note that PyObjectPlus's ProcessReplica isnt used yet. --- source/gameengine/Converter/BL_ArmatureObject.cpp | 11 ++++++----- source/gameengine/Converter/BL_ArmatureObject.h | 2 +- .../gameengine/Converter/BL_DeformableGameObject.cpp | 14 +++++--------- .../gameengine/Converter/BL_DeformableGameObject.h | 2 +- source/gameengine/Expressions/PyObjectPlus.cpp | 8 ++++++++ source/gameengine/Expressions/PyObjectPlus.h | 6 ++++++ source/gameengine/Ketsji/KX_Camera.cpp | 7 +------ source/gameengine/Ketsji/KX_Camera.h | 9 --------- source/gameengine/Ketsji/KX_GameObject.cpp | 20 ++++++++++---------- source/gameengine/Ketsji/KX_GameObject.h | 4 +--- source/gameengine/Ketsji/KX_Light.cpp | 2 +- 11 files changed, 40 insertions(+), 45 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index d2001212f7d..04e2c55e7dd 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -74,16 +74,17 @@ CValue* BL_ArmatureObject::GetReplica() // this will copy properties and so on... CValue::AddDataToReplica(replica); - ProcessReplica(replica); + replica->ProcessReplica(); return replica; } -void BL_ArmatureObject::ProcessReplica(BL_ArmatureObject *replica) +void BL_ArmatureObject::ProcessReplica() { - KX_GameObject::ProcessReplica(replica); + bPose *pose= m_pose; + KX_GameObject::ProcessReplica(); - replica->m_pose = NULL; - game_copy_pose(&replica->m_pose, m_pose); + m_pose = NULL; + game_copy_pose(&m_pose, pose); } BL_ArmatureObject::~BL_ArmatureObject() diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h index d68e37d9e37..d5402cfd126 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.h +++ b/source/gameengine/Converter/BL_ArmatureObject.h @@ -45,7 +45,7 @@ class BL_ArmatureObject : public KX_GameObject public: double GetLastFrame (); short GetActivePriority(); - virtual void ProcessReplica(BL_ArmatureObject *replica); + virtual void ProcessReplica(); class BL_ActionActuator * GetActiveAction(); BL_ArmatureObject( diff --git a/source/gameengine/Converter/BL_DeformableGameObject.cpp b/source/gameengine/Converter/BL_DeformableGameObject.cpp index e2610d2b405..618744dc1f3 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.cpp +++ b/source/gameengine/Converter/BL_DeformableGameObject.cpp @@ -41,16 +41,12 @@ BL_DeformableGameObject::~BL_DeformableGameObject() delete m_pDeformer; // __NLA : Temporary until we decide where to put this } -void BL_DeformableGameObject::ProcessReplica(KX_GameObject* replica) +void BL_DeformableGameObject::ProcessReplica() { - BL_MeshDeformer *deformer; - KX_GameObject::ProcessReplica(replica); - - if (m_pDeformer) { - deformer = (BL_MeshDeformer*)m_pDeformer->GetReplica(replica); - ((BL_DeformableGameObject*)replica)->m_pDeformer = deformer; - } + KX_GameObject::ProcessReplica(); + if (m_pDeformer) + m_pDeformer= (BL_MeshDeformer*)m_pDeformer->GetReplica(this); } CValue* BL_DeformableGameObject::GetReplica() @@ -61,7 +57,7 @@ CValue* BL_DeformableGameObject::GetReplica() // this will copy properties and so on... CValue::AddDataToReplica(replica); - ProcessReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/Converter/BL_DeformableGameObject.h b/source/gameengine/Converter/BL_DeformableGameObject.h index 126a1fcb1e7..dbc89bd2a20 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.h +++ b/source/gameengine/Converter/BL_DeformableGameObject.h @@ -62,7 +62,7 @@ public: m_pDeformer->Relink (map); KX_GameObject::Relink(map); }; - void ProcessReplica(KX_GameObject* replica); + void ProcessReplica(); BL_DeformableGameObject(Object* blendobj, void* sgReplicationInfo, SG_Callbacks callbacks) : KX_GameObject(sgReplicationInfo,callbacks), diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 30495fc2a45..57a61ac37ae 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -810,6 +810,14 @@ PyObject *PyObjectPlus::PyisA(PyObject *value) // Python wrapper for isA return NULL; } + +void PyObjectPlus::ProcessReplica() +{ + /* Clear the proxy, will be created again if needed with GetProxy() + * otherwise the PyObject will point to the wrong reference */ + m_proxy= NULL; +} + /* Utility function called by the macro py_getattro_up() * for getting ob.__dict__() values from our PyObject * this is used by python for doing dir() on an object, so its good diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index a3b3952a6d1..52e59f7730c 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -450,6 +450,12 @@ public: static PyObject *GetProxy_Ext(PyObjectPlus *self, PyTypeObject *tp); static PyObject *NewProxy_Ext(PyObjectPlus *self, PyTypeObject *tp, bool py_owns); + + /** + * Makes sure any internal data owned by this class is deep copied. + */ + virtual void ProcessReplica(); + }; PyObject *py_getattr_dict(PyObject *pydict, PyObject *tp_dict); diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index f84ce23b7dd..e1784a4cd37 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -72,15 +72,10 @@ CValue* KX_Camera::GetReplica() // this will copy properties and so on... CValue::AddDataToReplica(replica); - ProcessReplica(replica); + replica->ProcessReplica(); return replica; } - -void KX_Camera::ProcessReplica(KX_Camera* replica) -{ - KX_GameObject::ProcessReplica(replica); -} MT_Transform KX_Camera::GetWorldToCamera() const { diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index 6f818cb2c57..d570fac213a 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -146,15 +146,6 @@ public: virtual CValue* GetReplica( ); - - /** - * Inherited from CValue -- Makes sure any internal - * data owned by this class is deep copied. Called internally - */ - virtual void - ProcessReplica( - KX_Camera* replica - ); MT_Transform GetWorldToCamera() const; MT_Transform GetCameraToWorld() const; diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index eb20cfa1131..fe7f96d9fac 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -331,16 +331,16 @@ void KX_GameObject::RemoveParent(KX_Scene *scene) } } -void KX_GameObject::ProcessReplica(KX_GameObject* replica) -{ - replica->m_pPhysicsController1 = NULL; - replica->m_pGraphicController = NULL; - replica->m_pSGNode = NULL; - replica->m_pClient_info = new KX_ClientObjectInfo(*m_pClient_info); - replica->m_pClient_info->m_gameobject = replica; - replica->m_state = 0; +void KX_GameObject::ProcessReplica() +{ + m_pPhysicsController1 = NULL; + m_pGraphicController = NULL; + m_pSGNode = NULL; + m_pClient_info = new KX_ClientObjectInfo(*m_pClient_info); + m_pClient_info->m_gameobject = this; + m_state = 0; if(m_attr_dict) - replica->m_attr_dict= PyDict_Copy(m_attr_dict); + m_attr_dict= PyDict_Copy(m_attr_dict); } @@ -352,7 +352,7 @@ CValue* KX_GameObject::GetReplica() // this will copy properties and so on... CValue::AddDataToReplica(replica); - ProcessReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index e81429dff5a..479a3c1b574 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -279,9 +279,7 @@ public: * data owned by this class is deep copied. Called internally */ virtual void - ProcessReplica( - KX_GameObject* replica - ); + ProcessReplica(); /** * Return the linear velocity of the game object. diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index c5189907714..a426953602b 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -85,7 +85,7 @@ CValue* KX_LightObject::GetReplica() // this will copy properties and so on... CValue::AddDataToReplica(replica); - ProcessReplica(replica); + replica->ProcessReplica(); replica->m_lightobj.m_worldmatrix = replica->GetOpenGLMatrixPtr(); m_rendertools->AddLight(&replica->m_lightobj); -- cgit v1.2.3 From 5553d2c0142539c754575ce471c2676e0d5dff34 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 22 Apr 2009 14:42:00 +0000 Subject: BGE C++ API PyObjectPlus::ProcessReplica() is now called when any of its subclasses are replicated. This is important because PyObjectPlus::ProcessReplica() NULL's the 'm_proxy' python pointer I added recently. Without this a replicated subclass of PyObjectPlus could have an invalid pointer (crashing the BGE). This change also means CValue::AddDataToReplica() can be moved into CValue::ProcessReplica() since ProcessReplica is always called. --- source/gameengine/Converter/BL_ActionActuator.cpp | 9 ++-- source/gameengine/Converter/BL_ArmatureObject.cpp | 4 -- .../Converter/BL_DeformableGameObject.cpp | 4 -- .../gameengine/Converter/BL_ModifierDeformer.cpp | 1 + .../Converter/BL_ShapeActionActuator.cpp | 4 +- source/gameengine/Converter/BL_SkinDeformer.cpp | 2 + source/gameengine/Expressions/BoolValue.cpp | 2 +- source/gameengine/Expressions/EmptyValue.cpp | 2 +- source/gameengine/Expressions/FloatValue.cpp | 4 +- source/gameengine/Expressions/IntValue.cpp | 2 +- source/gameengine/Expressions/ListValue.cpp | 2 +- source/gameengine/Expressions/StringValue.cpp | 2 +- source/gameengine/Expressions/Value.cpp | 50 +++++++++------------- source/gameengine/Expressions/Value.h | 6 +-- source/gameengine/Expressions/VectorValue.cpp | 2 +- .../gameengine/GameLogic/SCA_2DFilterActuator.cpp | 2 - source/gameengine/GameLogic/SCA_ANDController.cpp | 2 +- source/gameengine/GameLogic/SCA_ActuatorSensor.cpp | 2 +- source/gameengine/GameLogic/SCA_AlwaysSensor.cpp | 2 +- source/gameengine/GameLogic/SCA_DelaySensor.cpp | 2 +- .../GameLogic/SCA_ExpressionController.cpp | 2 +- source/gameengine/GameLogic/SCA_IActuator.cpp | 1 + source/gameengine/GameLogic/SCA_JoystickSensor.cpp | 2 +- source/gameengine/GameLogic/SCA_KeyboardSensor.cpp | 2 +- source/gameengine/GameLogic/SCA_MouseSensor.cpp | 2 +- source/gameengine/GameLogic/SCA_NANDController.cpp | 2 +- source/gameengine/GameLogic/SCA_NORController.cpp | 2 +- source/gameengine/GameLogic/SCA_ORController.cpp | 2 +- .../gameengine/GameLogic/SCA_PropertyActuator.cpp | 5 --- source/gameengine/GameLogic/SCA_PropertySensor.cpp | 2 +- .../gameengine/GameLogic/SCA_PythonController.cpp | 2 +- source/gameengine/GameLogic/SCA_RandomActuator.cpp | 2 - source/gameengine/GameLogic/SCA_RandomSensor.cpp | 2 +- source/gameengine/GameLogic/SCA_XNORController.cpp | 2 +- source/gameengine/GameLogic/SCA_XORController.cpp | 2 +- .../Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp | 3 -- .../Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp | 4 +- source/gameengine/Ketsji/KX_CDActuator.cpp | 3 -- source/gameengine/Ketsji/KX_Camera.cpp | 1 - source/gameengine/Ketsji/KX_CameraActuator.cpp | 2 - source/gameengine/Ketsji/KX_ConstraintActuator.h | 2 - source/gameengine/Ketsji/KX_GameActuator.cpp | 2 - source/gameengine/Ketsji/KX_GameObject.cpp | 3 +- source/gameengine/Ketsji/KX_IpoActuator.h | 2 - source/gameengine/Ketsji/KX_Light.cpp | 3 -- source/gameengine/Ketsji/KX_MouseFocusSensor.h | 2 +- source/gameengine/Ketsji/KX_NearSensor.cpp | 3 +- source/gameengine/Ketsji/KX_ObjectActuator.cpp | 3 -- source/gameengine/Ketsji/KX_ParentActuator.cpp | 2 - source/gameengine/Ketsji/KX_RadarSensor.cpp | 3 +- source/gameengine/Ketsji/KX_RaySensor.cpp | 3 +- .../gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp | 1 - .../gameengine/Ketsji/KX_SCA_DynamicActuator.cpp | 4 -- .../gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp | 2 - .../Ketsji/KX_SCA_ReplaceMeshActuator.cpp | 3 -- source/gameengine/Ketsji/KX_SceneActuator.cpp | 3 -- source/gameengine/Ketsji/KX_SoundActuator.cpp | 2 - source/gameengine/Ketsji/KX_StateActuator.cpp | 2 - source/gameengine/Ketsji/KX_TouchSensor.cpp | 3 +- source/gameengine/Ketsji/KX_TrackToActuator.h | 2 - source/gameengine/Ketsji/KX_VisibilityActuator.cpp | 2 - 61 files changed, 63 insertions(+), 140 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 3002005ae3f..e06008ff891 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -66,9 +66,9 @@ BL_ActionActuator::~BL_ActionActuator() game_free_pose(m_blendpose); } -void BL_ActionActuator::ProcessReplica(){ -// bPose *oldpose = m_pose; -// bPose *oldbpose = m_blendpose; +void BL_ActionActuator::ProcessReplica() +{ + SCA_IActuator::ProcessReplica(); m_pose = NULL; m_blendpose = NULL; @@ -84,9 +84,6 @@ void BL_ActionActuator::SetBlendTime (float newtime){ CValue* BL_ActionActuator::GetReplica() { BL_ActionActuator* replica = new BL_ActionActuator(*this);//m_float,GetName()); replica->ProcessReplica(); - - // this will copy properties and so on... - CValue::AddDataToReplica(replica); return replica; } diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index 04e2c55e7dd..b00b493193d 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -70,10 +70,6 @@ BL_ArmatureObject::BL_ArmatureObject( CValue* BL_ArmatureObject::GetReplica() { BL_ArmatureObject* replica = new BL_ArmatureObject(*this); - - // this will copy properties and so on... - CValue::AddDataToReplica(replica); - replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/Converter/BL_DeformableGameObject.cpp b/source/gameengine/Converter/BL_DeformableGameObject.cpp index 618744dc1f3..241ff8d2aaf 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.cpp +++ b/source/gameengine/Converter/BL_DeformableGameObject.cpp @@ -53,10 +53,6 @@ CValue* BL_DeformableGameObject::GetReplica() { BL_DeformableGameObject* replica = new BL_DeformableGameObject(*this);//m_float,GetName()); - - // this will copy properties and so on... - CValue::AddDataToReplica(replica); - replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp index 6113f88e331..79ee6be47f0 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.cpp +++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp @@ -87,6 +87,7 @@ RAS_Deformer *BL_ModifierDeformer::GetReplica(class KX_GameObject* replica) void BL_ModifierDeformer::ProcessReplica() { + /* Note! - This is not inherited from PyObjectPlus */ BL_ShapeDeformer::ProcessReplica(); m_dm = NULL; m_lastModifierUpdate = -1; diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index a447ffb8aa9..60d26b9a99f 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -61,6 +61,7 @@ BL_ShapeActionActuator::~BL_ShapeActionActuator() void BL_ShapeActionActuator::ProcessReplica() { + SCA_IActuator::ProcessReplica(); m_localtime=m_startframe; m_lastUpdate=-1; } @@ -74,9 +75,6 @@ CValue* BL_ShapeActionActuator::GetReplica() { BL_ShapeActionActuator* replica = new BL_ShapeActionActuator(*this);//m_float,GetName()); replica->ProcessReplica(); - - // this will copy properties and so on... - CValue::AddDataToReplica(replica); return replica; } diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp index ae3e1a10005..3267dbce410 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.cpp +++ b/source/gameengine/Converter/BL_SkinDeformer.cpp @@ -156,6 +156,8 @@ RAS_Deformer *BL_SkinDeformer::GetReplica(class KX_GameObject* replica) BL_SkinDeformer *result; result = new BL_SkinDeformer(*this); + /* Not inherited from PyObjectPlus so this isnt needed */ + /* Just call a dummy function below, will be optimized out */ result->ProcessReplica(); return result; } diff --git a/source/gameengine/Expressions/BoolValue.cpp b/source/gameengine/Expressions/BoolValue.cpp index 13c870b68e5..4e0a71e5a19 100644 --- a/source/gameengine/Expressions/BoolValue.cpp +++ b/source/gameengine/Expressions/BoolValue.cpp @@ -201,7 +201,7 @@ const STR_String& CBoolValue::GetText() CValue* CBoolValue::GetReplica() { CBoolValue* replica = new CBoolValue(*this); - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/Expressions/EmptyValue.cpp b/source/gameengine/Expressions/EmptyValue.cpp index f72ddc47096..5d1273b5301 100644 --- a/source/gameengine/Expressions/EmptyValue.cpp +++ b/source/gameengine/Expressions/EmptyValue.cpp @@ -121,7 +121,7 @@ const STR_String & CEmptyValue::GetText() CValue* CEmptyValue::GetReplica() { CEmptyValue* replica = new CEmptyValue(*this); - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/Expressions/FloatValue.cpp b/source/gameengine/Expressions/FloatValue.cpp index 212a55fe457..a31d3b9a528 100644 --- a/source/gameengine/Expressions/FloatValue.cpp +++ b/source/gameengine/Expressions/FloatValue.cpp @@ -307,8 +307,8 @@ const STR_String & CFloatValue::GetText() CValue* CFloatValue::GetReplica() { CFloatValue* replica = new CFloatValue(*this); - replica->m_pstrRep = NULL; - CValue::AddDataToReplica(replica); + replica->m_pstrRep = NULL; /* should be in CFloatValue::ProcessReplica() but its not defined, no matter */ + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/Expressions/IntValue.cpp b/source/gameengine/Expressions/IntValue.cpp index 4e86f7bf789..74ec9865fec 100644 --- a/source/gameengine/Expressions/IntValue.cpp +++ b/source/gameengine/Expressions/IntValue.cpp @@ -311,7 +311,7 @@ const STR_String & CIntValue::GetText() CValue* CIntValue::GetReplica() { CIntValue* replica = new CIntValue(*this); - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); replica->m_pstrRep = NULL; return replica; diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 7c31a29f4ac..6c92e805745 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -324,7 +324,7 @@ const STR_String & CListValue::GetText() CValue* CListValue::GetReplica() { CListValue* replica = new CListValue(*this); - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); replica->m_bReleaseContents=true; // for copy, complete array is copied for now... // copy all values diff --git a/source/gameengine/Expressions/StringValue.cpp b/source/gameengine/Expressions/StringValue.cpp index 2b3c62c411e..857aa97b420 100644 --- a/source/gameengine/Expressions/StringValue.cpp +++ b/source/gameengine/Expressions/StringValue.cpp @@ -133,7 +133,7 @@ bool CStringValue::IsEqual(const STR_String & other) CValue* CStringValue::GetReplica() { CStringValue* replica = new CStringValue(*this); - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; }; diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 106bd1256a6..b5aca518e88 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -439,27 +439,6 @@ int CValue::GetPropertyCount() } - - - -void CValue::CloneProperties(CValue *replica) -{ - - if (m_pNamedPropertyArray) - { - replica->m_pNamedPropertyArray=NULL; - std::map::iterator it; - for (it= m_pNamedPropertyArray->begin(); (it != m_pNamedPropertyArray->end()); it++) - { - CValue *val = (*it).second->GetReplica(); - replica->SetProperty((*it).first,val); - val->Release(); - } - } - - -} - double* CValue::GetVector3(bool bGetTransformedVec) { assertd(false); // don;t get vector from me @@ -534,22 +513,33 @@ void CValue::DisableRefCount() -void CValue::AddDataToReplica(CValue *replica) +void CValue::ProcessReplica() /* was AddDataToReplica in 2.48 */ { - replica->m_refcount = 1; - + m_refcount = 1; + #ifdef _DEBUG //gRefCountValue++; #endif - replica->m_ValFlags.RefCountDisabled = false; + PyObjectPlus::ProcessReplica(); - replica->ReplicaSetName(GetName()); - - //copy all props - CloneProperties(replica); -} + m_ValFlags.RefCountDisabled = false; + ReplicaSetName(GetName()); + /* copy all props */ + if (m_pNamedPropertyArray) + { + std::map *pOldArray = m_pNamedPropertyArray; + m_pNamedPropertyArray=NULL; + std::map::iterator it; + for (it= pOldArray->begin(); (it != pOldArray->end()); it++) + { + CValue *val = (*it).second->GetReplica(); + SetProperty((*it).first,val); + val->Release(); + } + } +} CValue* CValue::FindIdentifier(const STR_String& identifiername) { diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 88186fa95c0..cc791351d8a 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -281,7 +281,6 @@ public: virtual CValue* GetProperty(int inIndex); // Get property number virtual int GetPropertyCount(); // Get the amount of properties assiocated with this value - virtual void CloneProperties(CValue* replica); virtual CValue* FindIdentifier(const STR_String& identifiername); /** Set the wireframe color of this value depending on the CSG * operator type @@ -300,6 +299,7 @@ public: * @attention this particular function should never be called. Why not abstract? */ virtual void SetValue(CValue* newval); virtual CValue* GetReplica() =0; + virtual void ProcessReplica(); //virtual CValue* Copy() = 0; @@ -328,10 +328,10 @@ public: virtual void SetCustomFlag2(bool bCustomFlag) { m_ValFlags.CustomFlag2 = bCustomFlag;}; virtual bool IsCustomFlag2() { return m_ValFlags.CustomFlag2;}; - + protected: virtual void DisableRefCount(); // Disable reference counting for this value - virtual void AddDataToReplica(CValue* replica); + //virtual void AddDataToReplica(CValue* replica); virtual ~CValue(); private: // Member variables diff --git a/source/gameengine/Expressions/VectorValue.cpp b/source/gameengine/Expressions/VectorValue.cpp index 497a50b90e7..e8e1d45c356 100644 --- a/source/gameengine/Expressions/VectorValue.cpp +++ b/source/gameengine/Expressions/VectorValue.cpp @@ -204,7 +204,7 @@ const STR_String & CVectorValue::GetText() CValue* CVectorValue::GetReplica() { CVectorValue* replica = new CVectorValue(*this); - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; }; diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index 9bf03bf39cc..ed834587414 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -64,8 +64,6 @@ CValue* SCA_2DFilterActuator::GetReplica() { SCA_2DFilterActuator* replica = new SCA_2DFilterActuator(*this); replica->ProcessReplica(); - CValue::AddDataToReplica(replica); - return replica; } diff --git a/source/gameengine/GameLogic/SCA_ANDController.cpp b/source/gameengine/GameLogic/SCA_ANDController.cpp index e4642750942..ed2372200e9 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.cpp +++ b/source/gameengine/GameLogic/SCA_ANDController.cpp @@ -94,7 +94,7 @@ CValue* SCA_ANDController::GetReplica() { CValue* replica = new SCA_ANDController(*this); // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index 4c85c4f8e5e..928060d7394 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -60,7 +60,7 @@ CValue* SCA_ActuatorSensor::GetReplica() { SCA_ActuatorSensor* replica = new SCA_ActuatorSensor(*this); // m_range_expr must be recalculated on replica! - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); replica->Init(); return replica; diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp index 874883c89b1..941f3b55b44 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp @@ -72,7 +72,7 @@ CValue* SCA_AlwaysSensor::GetReplica() { CValue* replica = new SCA_AlwaysSensor(*this);//m_float,GetName()); // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp index 0e4a00e2745..15e805a657c 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.cpp +++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp @@ -77,7 +77,7 @@ CValue* SCA_DelaySensor::GetReplica() { CValue* replica = new SCA_DelaySensor(*this); // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.cpp b/source/gameengine/GameLogic/SCA_ExpressionController.cpp index 352a39a6fea..e6bccef08d4 100644 --- a/source/gameengine/GameLogic/SCA_ExpressionController.cpp +++ b/source/gameengine/GameLogic/SCA_ExpressionController.cpp @@ -70,7 +70,7 @@ CValue* SCA_ExpressionController::GetReplica() replica->m_exprText = m_exprText; replica->m_exprCache = NULL; // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/GameLogic/SCA_IActuator.cpp b/source/gameengine/GameLogic/SCA_IActuator.cpp index 309f3108418..3d4ad3aec3a 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.cpp +++ b/source/gameengine/GameLogic/SCA_IActuator.cpp @@ -100,6 +100,7 @@ bool SCA_IActuator::Update() void SCA_IActuator::ProcessReplica() { + SCA_ILogicBrick::ProcessReplica(); m_events.clear(); } diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index a8c6f87ebdd..11b31c67edd 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -87,7 +87,7 @@ CValue* SCA_JoystickSensor::GetReplica() { SCA_JoystickSensor* replica = new SCA_JoystickSensor(*this); // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); replica->Init(); return replica; } diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index 2048731f73c..5dcdb222713 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -85,7 +85,7 @@ CValue* SCA_KeyboardSensor::GetReplica() { SCA_KeyboardSensor* replica = new SCA_KeyboardSensor(*this); // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); replica->Init(); return replica; } diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index 0bae676d19d..65942327e68 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -111,7 +111,7 @@ CValue* SCA_MouseSensor::GetReplica() { SCA_MouseSensor* replica = new SCA_MouseSensor(*this); // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); replica->Init(); return replica; diff --git a/source/gameengine/GameLogic/SCA_NANDController.cpp b/source/gameengine/GameLogic/SCA_NANDController.cpp index dedf32df3c9..ab5c39dc039 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.cpp +++ b/source/gameengine/GameLogic/SCA_NANDController.cpp @@ -94,7 +94,7 @@ CValue* SCA_NANDController::GetReplica() { CValue* replica = new SCA_NANDController(*this); // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/GameLogic/SCA_NORController.cpp b/source/gameengine/GameLogic/SCA_NORController.cpp index 8cd575ffef3..918e6a348ae 100644 --- a/source/gameengine/GameLogic/SCA_NORController.cpp +++ b/source/gameengine/GameLogic/SCA_NORController.cpp @@ -94,7 +94,7 @@ CValue* SCA_NORController::GetReplica() { CValue* replica = new SCA_NORController(*this); // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/GameLogic/SCA_ORController.cpp b/source/gameengine/GameLogic/SCA_ORController.cpp index a12246e9a73..034c3ee29cd 100644 --- a/source/gameengine/GameLogic/SCA_ORController.cpp +++ b/source/gameengine/GameLogic/SCA_ORController.cpp @@ -60,7 +60,7 @@ CValue* SCA_ORController::GetReplica() { CValue* replica = new SCA_ORController(*this); // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index 4facd8df27a..f3ca63066c9 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -186,11 +186,6 @@ GetReplica() { SCA_PropertyActuator* replica = new SCA_PropertyActuator(*this); replica->ProcessReplica(); - - // this will copy properties and so on... - - CValue::AddDataToReplica(replica); - return replica; }; diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index c56dd3a12f4..7953698c6ef 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -111,7 +111,7 @@ CValue* SCA_PropertySensor::GetReplica() { SCA_PropertySensor* replica = new SCA_PropertySensor(*this); // m_range_expr must be recalculated on replica! - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); replica->Init(); replica->m_range_expr = NULL; diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index b8052555528..ab4b5600d3f 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -110,7 +110,7 @@ CValue* SCA_PythonController::GetReplica() */ // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index b9df198f7da..91110425f7f 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -78,8 +78,6 @@ CValue* SCA_RandomActuator::GetReplica() SCA_RandomActuator* replica = new SCA_RandomActuator(*this); // replication just copy the m_base pointer => common random generator replica->ProcessReplica(); - CValue::AddDataToReplica(replica); - return replica; } diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 582cff4cde7..70a23124929 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -76,7 +76,7 @@ CValue* SCA_RandomSensor::GetReplica() CValue* replica = new SCA_RandomSensor(*this); // replication copies m_basegenerator pointer => share same generator // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/GameLogic/SCA_XNORController.cpp b/source/gameengine/GameLogic/SCA_XNORController.cpp index 145afa6aec5..13d50100d6c 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.cpp +++ b/source/gameengine/GameLogic/SCA_XNORController.cpp @@ -98,7 +98,7 @@ CValue* SCA_XNORController::GetReplica() { CValue* replica = new SCA_XNORController(*this); // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/GameLogic/SCA_XORController.cpp b/source/gameengine/GameLogic/SCA_XORController.cpp index 4dfba3a56ac..6613742a080 100644 --- a/source/gameengine/GameLogic/SCA_XORController.cpp +++ b/source/gameengine/GameLogic/SCA_XORController.cpp @@ -98,7 +98,7 @@ CValue* SCA_XORController::GetReplica() { CValue* replica = new SCA_XORController(*this); // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp index 9c36a899505..712f64d5f8f 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp @@ -93,9 +93,6 @@ CValue* KX_NetworkMessageActuator::GetReplica() new KX_NetworkMessageActuator(*this); replica->ProcessReplica(); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); - return replica; } diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index b1b9c0e1fc9..d770465e1ea 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -79,9 +79,7 @@ CValue* KX_NetworkMessageSensor::GetReplica() { CValue* replica = new KX_NetworkMessageSensor(*this); if (replica == NULL) return NULL; - - // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/Ketsji/KX_CDActuator.cpp b/source/gameengine/Ketsji/KX_CDActuator.cpp index 6e318cdcfa3..a0b2c73901f 100644 --- a/source/gameengine/Ketsji/KX_CDActuator.cpp +++ b/source/gameengine/Ketsji/KX_CDActuator.cpp @@ -74,9 +74,6 @@ CValue* KX_CDActuator::GetReplica() { KX_CDActuator* replica = new KX_CDActuator(*this); replica->ProcessReplica(); - - // this will copy properties and so on... - CValue::AddDataToReplica(replica); return replica; }; diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index e1784a4cd37..e536d1f1e7e 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -71,7 +71,6 @@ CValue* KX_Camera::GetReplica() KX_Camera* replica = new KX_Camera(*this); // this will copy properties and so on... - CValue::AddDataToReplica(replica); replica->ProcessReplica(); return replica; diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index 2ef7abfd172..38a68752958 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -82,8 +82,6 @@ GetReplica( ) { KX_CameraActuator* replica = new KX_CameraActuator(*this); replica->ProcessReplica(); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); return replica; }; diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.h b/source/gameengine/Ketsji/KX_ConstraintActuator.h index 84512c0ecf2..40607b44947 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.h +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.h @@ -132,8 +132,6 @@ protected: virtual CValue* GetReplica() { KX_ConstraintActuator* replica = new KX_ConstraintActuator(*this); replica->ProcessReplica(); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); return replica; }; diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index 0a411396ff8..514fb74f6bf 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -73,8 +73,6 @@ CValue* KX_GameActuator::GetReplica() { KX_GameActuator* replica = new KX_GameActuator(*this); replica->ProcessReplica(); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); return replica; } diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index fe7f96d9fac..8bd1e008336 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -333,6 +333,8 @@ void KX_GameObject::RemoveParent(KX_Scene *scene) void KX_GameObject::ProcessReplica() { + SCA_IObject::ProcessReplica(); + m_pPhysicsController1 = NULL; m_pGraphicController = NULL; m_pSGNode = NULL; @@ -351,7 +353,6 @@ CValue* KX_GameObject::GetReplica() KX_GameObject* replica = new KX_GameObject(*this); // this will copy properties and so on... - CValue::AddDataToReplica(replica); replica->ProcessReplica(); return replica; diff --git a/source/gameengine/Ketsji/KX_IpoActuator.h b/source/gameengine/Ketsji/KX_IpoActuator.h index fb3b0eb1dd2..9ea597def1e 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.h +++ b/source/gameengine/Ketsji/KX_IpoActuator.h @@ -128,8 +128,6 @@ public: virtual CValue* GetReplica() { KX_IpoActuator* replica = new KX_IpoActuator(*this);//m_float,GetName()); replica->ProcessReplica(); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); return replica; }; diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index a426953602b..7bc982111fe 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -82,9 +82,6 @@ CValue* KX_LightObject::GetReplica() KX_LightObject* replica = new KX_LightObject(*this); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); - replica->ProcessReplica(); replica->m_lightobj.m_worldmatrix = replica->GetOpenGLMatrixPtr(); diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h index 5a9618f52b2..350fda198db 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h @@ -63,7 +63,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor virtual CValue* GetReplica() { CValue* replica = new KX_MouseFocusSensor(*this); // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; }; /** diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp index ce519e1752c..23c525a1b52 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.cpp +++ b/source/gameengine/Ketsji/KX_NearSensor.cpp @@ -111,8 +111,7 @@ CValue* KX_NearSensor::GetReplica() KX_NearSensor* replica = new KX_NearSensor(*this); replica->m_colliders = new CListValue(); replica->Init(); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); replica->m_client_info = new KX_ClientObjectInfo(m_client_info->m_gameobject, KX_ClientObjectInfo::NEAR); diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index ed5539709e4..b90967d610c 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -253,9 +253,6 @@ CValue* KX_ObjectActuator::GetReplica() KX_ObjectActuator* replica = new KX_ObjectActuator(*this);//m_float,GetName()); replica->ProcessReplica(); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); - return replica; } diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index 79e82670486..afc16ba994c 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -73,8 +73,6 @@ CValue* KX_ParentActuator::GetReplica() KX_ParentActuator* replica = new KX_ParentActuator(*this); // replication just copy the m_base pointer => common random generator replica->ProcessReplica(); - CValue::AddDataToReplica(replica); - return replica; } diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index d06728c1d4d..d9b8b6fec5b 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -82,8 +82,7 @@ CValue* KX_RadarSensor::GetReplica() KX_RadarSensor* replica = new KX_RadarSensor(*this); replica->m_colliders = new CListValue(); replica->Init(); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); replica->m_client_info = new KX_ClientObjectInfo(m_client_info->m_gameobject, KX_ClientObjectInfo::RADAR); diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index bee644b6a30..ea9356a49d1 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -88,8 +88,7 @@ KX_RaySensor::~KX_RaySensor() CValue* KX_RaySensor::GetReplica() { KX_RaySensor* replica = new KX_RaySensor(*this); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); replica->Init(); return replica; diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index b5aa7a2f4c2..dd9d63f5cd9 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -125,7 +125,6 @@ CValue* KX_SCA_AddObjectActuator::GetReplica() // this will copy properties and so on... replica->ProcessReplica(); - CValue::AddDataToReplica(replica); return replica; } diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp index dd3250f5b61..4bc42686d78 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp @@ -215,10 +215,6 @@ CValue* KX_SCA_DynamicActuator::GetReplica() return NULL; replica->ProcessReplica(); - - // this will copy properties and so on... - CValue::AddDataToReplica(replica); - return replica; }; diff --git a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp index c0dc6ea6b55..a0b411dd3a9 100644 --- a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp @@ -82,8 +82,6 @@ CValue* KX_SCA_EndObjectActuator::GetReplica() if (replica == NULL) return NULL; replica->ProcessReplica(); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); return replica; }; diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp index b7135a5503a..8b87253d0a3 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp @@ -217,9 +217,6 @@ CValue* KX_SCA_ReplaceMeshActuator::GetReplica() replica->ProcessReplica(); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); - return replica; }; diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index c525aeb1e3f..6f622939dc4 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -76,9 +76,6 @@ CValue* KX_SceneActuator::GetReplica() { KX_SceneActuator* replica = new KX_SceneActuator(*this); replica->ProcessReplica(); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); - return replica; } diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index 4103da4ad93..db3d92ffd79 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -90,8 +90,6 @@ CValue* KX_SoundActuator::GetReplica() m_soundScene->AddObject(soundobj); } - // this will copy properties and so on... - CValue::AddDataToReplica(replica); return replica; }; diff --git a/source/gameengine/Ketsji/KX_StateActuator.cpp b/source/gameengine/Ketsji/KX_StateActuator.cpp index 16512dc6699..71ffa16cb54 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.cpp +++ b/source/gameengine/Ketsji/KX_StateActuator.cpp @@ -62,8 +62,6 @@ KX_StateActuator::GetReplica( { KX_StateActuator* replica = new KX_StateActuator(*this); replica->ProcessReplica(); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); return replica; } diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 8995a0c198a..cddd018ef33 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -144,8 +144,7 @@ CValue* KX_TouchSensor::GetReplica() KX_TouchSensor* replica = new KX_TouchSensor(*this); replica->m_colliders = new CListValue(); replica->Init(); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); + replica->ProcessReplica(); return replica; } diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.h b/source/gameengine/Ketsji/KX_TrackToActuator.h index a17147c0842..c4cc2b1f062 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.h +++ b/source/gameengine/Ketsji/KX_TrackToActuator.h @@ -61,8 +61,6 @@ class KX_TrackToActuator : public SCA_IActuator virtual CValue* GetReplica() { KX_TrackToActuator* replica = new KX_TrackToActuator(*this); replica->ProcessReplica(); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); return replica; }; diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp index 9b1849511fe..ed12a88ad6a 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp @@ -64,8 +64,6 @@ KX_VisibilityActuator::GetReplica( { KX_VisibilityActuator* replica = new KX_VisibilityActuator(*this); replica->ProcessReplica(); - // this will copy properties and so on... - CValue::AddDataToReplica(replica); return replica; } -- cgit v1.2.3 From 076d1910f58661926393cca2a6f06d7091a5bce5 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 22 Apr 2009 16:26:22 +0000 Subject: BGE: some more cleanup in GetReplica/ProcessReplica of deformers: make them consistent with the other classes. --- .../Converter/BL_DeformableGameObject.cpp | 2 +- source/gameengine/Converter/BL_MeshDeformer.h | 3 ++- .../gameengine/Converter/BL_ModifierDeformer.cpp | 2 +- source/gameengine/Converter/BL_ModifierDeformer.h | 2 +- source/gameengine/Converter/BL_ShapeDeformer.cpp | 7 +---- source/gameengine/Converter/BL_ShapeDeformer.h | 3 +-- source/gameengine/Converter/BL_SkinDeformer.cpp | 11 +++----- source/gameengine/Converter/BL_SkinDeformer.h | 3 +-- .../gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 31 +++++++++++++++------- source/gameengine/Rasterizer/RAS_Deformer.h | 3 ++- 10 files changed, 34 insertions(+), 33 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_DeformableGameObject.cpp b/source/gameengine/Converter/BL_DeformableGameObject.cpp index 241ff8d2aaf..a9d5b643fd4 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.cpp +++ b/source/gameengine/Converter/BL_DeformableGameObject.cpp @@ -46,7 +46,7 @@ void BL_DeformableGameObject::ProcessReplica() KX_GameObject::ProcessReplica(); if (m_pDeformer) - m_pDeformer= (BL_MeshDeformer*)m_pDeformer->GetReplica(this); + m_pDeformer= (BL_MeshDeformer*)m_pDeformer->GetReplica(); } CValue* BL_DeformableGameObject::GetReplica() diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h index 8de59c1cdf3..34944421b28 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.h +++ b/source/gameengine/Converter/BL_MeshDeformer.h @@ -64,7 +64,8 @@ public: virtual void SetSimulatedTime(double time){}; virtual bool Apply(class RAS_IPolyMaterial *mat); virtual bool Update(void){ return false; }; - virtual RAS_Deformer* GetReplica(class KX_GameObject* replica){return NULL;}; + virtual RAS_Deformer* GetReplica(){return NULL;}; + virtual void ProcessReplica() { }; struct Mesh* GetMesh() { return m_bmesh; }; // virtual void InitDeform(double time){}; diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp index 79ee6be47f0..09dbe966d0b 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.cpp +++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp @@ -76,7 +76,7 @@ BL_ModifierDeformer::~BL_ModifierDeformer() } }; -RAS_Deformer *BL_ModifierDeformer::GetReplica(class KX_GameObject* replica) +RAS_Deformer *BL_ModifierDeformer::GetReplica() { BL_ModifierDeformer *result; diff --git a/source/gameengine/Converter/BL_ModifierDeformer.h b/source/gameengine/Converter/BL_ModifierDeformer.h index 0caaabf8055..465c287a88b 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.h +++ b/source/gameengine/Converter/BL_ModifierDeformer.h @@ -73,7 +73,7 @@ public: }; virtual void ProcessReplica(); - virtual RAS_Deformer *GetReplica(class KX_GameObject* replica); + virtual RAS_Deformer *GetReplica(); virtual ~BL_ModifierDeformer(); virtual bool UseVertexArray() { diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp index 499732c7f70..bf5eb5cbcb3 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.cpp +++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp @@ -68,7 +68,7 @@ BL_ShapeDeformer::~BL_ShapeDeformer() { }; -RAS_Deformer *BL_ShapeDeformer::GetReplica(class KX_GameObject* replica) +RAS_Deformer *BL_ShapeDeformer::GetReplica() { BL_ShapeDeformer *result; @@ -77,11 +77,6 @@ RAS_Deformer *BL_ShapeDeformer::GetReplica(class KX_GameObject* replica) return result; } -void BL_ShapeDeformer::ProcessReplica() -{ - BL_SkinDeformer::ProcessReplica(); -} - bool BL_ShapeDeformer::LoadShapeDrivers(Object* arma) { IpoCurve *icu; diff --git a/source/gameengine/Converter/BL_ShapeDeformer.h b/source/gameengine/Converter/BL_ShapeDeformer.h index 901a1d82295..1ec7bfdf74a 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.h +++ b/source/gameengine/Converter/BL_ShapeDeformer.h @@ -66,8 +66,7 @@ public: { }; - virtual void ProcessReplica(); - virtual RAS_Deformer *GetReplica(class KX_GameObject* replica); + virtual RAS_Deformer *GetReplica(); virtual ~BL_ShapeDeformer(); bool Update (void); diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp index 3267dbce410..d40776a645d 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.cpp +++ b/source/gameengine/Converter/BL_SkinDeformer.cpp @@ -108,7 +108,7 @@ void BL_SkinDeformer::Relink(GEN_Map*map) void **h_obj = (*map)[m_armobj]; if (h_obj) - SetArmature( (BL_ArmatureObject*)(*h_obj) ); + m_armobj = (BL_ArmatureObject*)(*h_obj); else m_armobj=NULL; } @@ -151,21 +151,16 @@ bool BL_SkinDeformer::Apply(RAS_IPolyMaterial *mat) return true; } -RAS_Deformer *BL_SkinDeformer::GetReplica(class KX_GameObject* replica) +RAS_Deformer *BL_SkinDeformer::GetReplica() { BL_SkinDeformer *result; result = new BL_SkinDeformer(*this); - /* Not inherited from PyObjectPlus so this isnt needed */ - /* Just call a dummy function below, will be optimized out */ + /* there is m_armobj that must be fixed but we cannot do it now, it will be done in Relink */ result->ProcessReplica(); return result; } -void BL_SkinDeformer::ProcessReplica() -{ -} - //void where_is_pose (Object *ob); //void armature_deform_verts(Object *armOb, Object *target, float (*vertexCos)[3], int numVerts, int deformflag); bool BL_SkinDeformer::Update(void) diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h index c93188b0c5a..ee240588851 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.h +++ b/source/gameengine/Converter/BL_SkinDeformer.h @@ -67,8 +67,7 @@ public: bool recalc_normal, BL_ArmatureObject* arma = NULL); - virtual void ProcessReplica(); - virtual RAS_Deformer *GetReplica(class KX_GameObject* replica); + virtual RAS_Deformer *GetReplica(); virtual ~BL_SkinDeformer(); bool Update (void); bool Apply (class RAS_IPolyMaterial *polymat); diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index 08e2ea30414..f4f8ec9f91b 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -34,7 +34,7 @@ // defines USE_ODE to choose physics engine #include "KX_ConvertPhysicsObject.h" -#include "KX_GameObject.h" +#include "BL_DeformableGameObject.h" #include "RAS_MeshObject.h" #include "KX_Scene.h" #include "SYS_System.h" @@ -670,11 +670,11 @@ void KX_ConvertODEEngineObject(KX_GameObject* gameobj, class KX_SoftBodyDeformer : public RAS_Deformer { - class RAS_MeshObject* m_pMeshObject; - class KX_GameObject* m_gameobj; + class RAS_MeshObject* m_pMeshObject; + class BL_DeformableGameObject* m_gameobj; public: - KX_SoftBodyDeformer(RAS_MeshObject* pMeshObject,KX_GameObject* gameobj) + KX_SoftBodyDeformer(RAS_MeshObject* pMeshObject,BL_DeformableGameObject* gameobj) :m_pMeshObject(pMeshObject), m_gameobj(gameobj) { @@ -687,7 +687,15 @@ void KX_ConvertODEEngineObject(KX_GameObject* gameobj, }; virtual void Relink(GEN_Map*map) { - //printf("relink\n"); + void **h_obj = (*map)[m_gameobj]; + + if (h_obj) { + m_gameobj = (BL_DeformableGameObject*)(*h_obj); + m_pMeshObject = m_gameobj->GetMesh(0); + } else { + m_gameobj = NULL; + m_pMeshObject = NULL; + } } virtual bool Apply(class RAS_IPolyMaterial *polymat) { @@ -751,12 +759,16 @@ void KX_ConvertODEEngineObject(KX_GameObject* gameobj, //printf("update\n"); return true;//?? } - virtual RAS_Deformer *GetReplica(class KX_GameObject* replica) + virtual RAS_Deformer *GetReplica() { - KX_SoftBodyDeformer* deformer = new KX_SoftBodyDeformer(replica->GetMesh(0),replica); + KX_SoftBodyDeformer* deformer = new KX_SoftBodyDeformer(*this); + deformer->ProcessReplica(); return deformer; } - + virtual void ProcessReplica() + { + // we have two pointers to deal with but we cannot do it now, will be done in Relink + } virtual bool SkipVertexTransform() { return true; @@ -1187,9 +1199,8 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, if (softBody && gameobj->GetMesh(0))//only the first mesh, if any { //should be a mesh then, so add a soft body deformer - KX_SoftBodyDeformer* softbodyDeformer = new KX_SoftBodyDeformer( gameobj->GetMesh(0),gameobj); + KX_SoftBodyDeformer* softbodyDeformer = new KX_SoftBodyDeformer( gameobj->GetMesh(0),(BL_DeformableGameObject*)gameobj); gameobj->SetDeformer(softbodyDeformer); - } } diff --git a/source/gameengine/Rasterizer/RAS_Deformer.h b/source/gameengine/Rasterizer/RAS_Deformer.h index dc5a49a0f99..5a6bab4c82d 100644 --- a/source/gameengine/Rasterizer/RAS_Deformer.h +++ b/source/gameengine/Rasterizer/RAS_Deformer.h @@ -44,7 +44,8 @@ public: virtual void Relink(GEN_Map*map)=0; virtual bool Apply(class RAS_IPolyMaterial *polymat)=0; virtual bool Update(void)=0; - virtual RAS_Deformer *GetReplica(class KX_GameObject* replica)=0; + virtual RAS_Deformer *GetReplica()=0; + virtual void ProcessReplica()=0; virtual bool SkipVertexTransform() { return false; -- cgit v1.2.3 From f6d27e73eee3cfdbe090bb1d34372d976ba079bb Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 22 Apr 2009 16:58:04 +0000 Subject: BGE: some more cleanup, remove useless ReplicaSetName(), move code to ProcessReplica. --- source/gameengine/Expressions/Value.cpp | 2 -- source/gameengine/Expressions/Value.h | 9 ++++----- source/gameengine/GameLogic/SCA_ILogicBrick.cpp | 8 -------- source/gameengine/GameLogic/SCA_ILogicBrick.h | 1 - source/gameengine/Ketsji/KX_GameObject.cpp | 15 --------------- source/gameengine/Ketsji/KX_GameObject.h | 8 -------- source/gameengine/Ketsji/KX_MeshProxy.cpp | 1 - source/gameengine/Ketsji/KX_MeshProxy.h | 1 - source/gameengine/Ketsji/KX_PolyProxy.cpp | 2 -- source/gameengine/Ketsji/KX_PolyProxy.h | 1 - source/gameengine/Ketsji/KX_VertexProxy.cpp | 2 -- source/gameengine/Ketsji/KX_VertexProxy.h | 1 - 12 files changed, 4 insertions(+), 47 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index b5aca518e88..b86fbe0b163 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -524,8 +524,6 @@ void CValue::ProcessReplica() /* was AddDataToReplica in 2.48 */ m_ValFlags.RefCountDisabled = false; - ReplicaSetName(GetName()); - /* copy all props */ if (m_pNamedPropertyArray) { diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index cc791351d8a..065fe62d978 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -294,7 +294,6 @@ public: virtual STR_String GetName() = 0; // Retrieve the name of the value virtual void SetName(STR_String name) = 0; // Set the name of the value - virtual void ReplicaSetName(STR_String name) = 0; /** Sets the value to this cvalue. * @attention this particular function should never be called. Why not abstract? */ virtual void SetValue(CValue* newval); @@ -410,10 +409,10 @@ public: if (name.Length()) m_pstrNewName = new STR_String(name); } - virtual void ReplicaSetName(STR_String name) { - m_pstrNewName=NULL; - if (name.Length()) - m_pstrNewName = new STR_String(name); + virtual void ProcessReplica() { + CValue::ProcessReplica(); + if (m_pstrNewName) + m_pstrNewName = new STR_String(*m_pstrNewName); } virtual STR_String GetName() { diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 02a25916299..ec3651ddd1f 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -143,14 +143,6 @@ void SCA_ILogicBrick::SetName(STR_String name) } - -void SCA_ILogicBrick::ReplicaSetName(STR_String name) -{ - m_name = name; -} - - - bool SCA_ILogicBrick::IsActive() { return m_bActive; diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index f2353741d39..b8c6772fe8d 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -72,7 +72,6 @@ public: virtual double GetNumber(); virtual STR_String GetName(); virtual void SetName(STR_String name); - virtual void ReplicaSetName(STR_String name); bool IsActive(); void SetActive(bool active) ; diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 8bd1e008336..ecc887eb567 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -199,26 +199,11 @@ void KX_GameObject::SetName(STR_String name) m_name = name; }; // Set the name of the value - - -void KX_GameObject::ReplicaSetName(STR_String name) -{ -} - - - - - - KX_IPhysicsController* KX_GameObject::GetPhysicsController() { return m_pPhysicsController1; } - - - - KX_GameObject* KX_GameObject::GetParent() { KX_GameObject* result = NULL; diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 479a3c1b574..2ca4fc6a63f 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -257,14 +257,6 @@ public: STR_String name ); - /** - * Inherited from CValue -- does nothing. - */ - void - ReplicaSetName( - STR_String name - ); - /** * Inherited from CValue -- return a new copy of this * instance allocated on the heap. Ownership of the new diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index 65b163106c9..75e46da072e 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -138,7 +138,6 @@ double KX_MeshProxy::GetNumber() { return -1;} STR_String KX_MeshProxy::GetName() { return m_meshobj->GetName();} void KX_MeshProxy::SetName(STR_String name) { }; CValue* KX_MeshProxy::GetReplica() { return NULL;} -void KX_MeshProxy::ReplicaSetName(STR_String name) {}; // stuff for python integration diff --git a/source/gameengine/Ketsji/KX_MeshProxy.h b/source/gameengine/Ketsji/KX_MeshProxy.h index ce9e8fc39c5..f775c963c1e 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.h +++ b/source/gameengine/Ketsji/KX_MeshProxy.h @@ -53,7 +53,6 @@ public: virtual RAS_MeshObject* GetMesh() { return m_meshobj; } virtual STR_String GetName(); virtual void SetName(STR_String name); // Set the name of the value - virtual void ReplicaSetName(STR_String name); virtual CValue* GetReplica(); // stuff for python integration diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index fefea232e99..0ab55a86078 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -183,8 +183,6 @@ double KX_PolyProxy::GetNumber() { return -1;} STR_String KX_PolyProxy::GetName() { return sPolyName;} void KX_PolyProxy::SetName(STR_String) { }; CValue* KX_PolyProxy::GetReplica() { return NULL;} -void KX_PolyProxy::ReplicaSetName(STR_String) {}; - // stuff for python integration diff --git a/source/gameengine/Ketsji/KX_PolyProxy.h b/source/gameengine/Ketsji/KX_PolyProxy.h index 88a06850ee0..223193ec519 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.h +++ b/source/gameengine/Ketsji/KX_PolyProxy.h @@ -48,7 +48,6 @@ public: double GetNumber(); STR_String GetName(); void SetName(STR_String name); // Set the name of the value - void ReplicaSetName(STR_String name); CValue* GetReplica(); diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index e5078bfa18b..6b2507b8b31 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -340,8 +340,6 @@ double KX_VertexProxy::GetNumber() { return -1;} STR_String KX_VertexProxy::GetName() { return sVertexName;} void KX_VertexProxy::SetName(STR_String) { }; CValue* KX_VertexProxy::GetReplica() { return NULL;} -void KX_VertexProxy::ReplicaSetName(STR_String) {}; - // stuff for python integration diff --git a/source/gameengine/Ketsji/KX_VertexProxy.h b/source/gameengine/Ketsji/KX_VertexProxy.h index 50fe6b27704..81dd0d222a7 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.h +++ b/source/gameengine/Ketsji/KX_VertexProxy.h @@ -49,7 +49,6 @@ public: double GetNumber(); STR_String GetName(); void SetName(STR_String name); // Set the name of the value - void ReplicaSetName(STR_String name); CValue* GetReplica(); -- cgit v1.2.3 From 971cabc2d687c86b8ff1e7a5a57474d85450b170 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 22 Apr 2009 17:06:47 +0000 Subject: Bugfix #18058 Ray-transparent didn't pass on thread number to shading code, giving "blothes" in render, when using node materials. This also rewinds Campbells commit of feb 21, which tackled the error, but not the cause. --- source/blender/blenkernel/intern/node.c | 9 ++------- source/blender/render/intern/source/rayshade.c | 11 ++++++----- 2 files changed, 8 insertions(+), 12 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index e4e5883b2d8..413c2fc20f5 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1982,9 +1982,9 @@ static void group_tag_used_outputs(bNode *gnode, bNodeStack *stack) } } +/* notes below are ancient! (ton) */ /* stack indices make sure all nodes only write in allocated data, for making it thread safe */ /* only root tree gets the stack, to enable instances to have own stack entries */ -/* only two threads now! */ /* per tree (and per group) unique indices are created */ /* the index_ext we need to be able to map from groups to the group-node own stack */ @@ -1999,14 +1999,9 @@ static bNodeThreadStack *ntreeGetThreadStack(bNodeTree *ntree, int thread) ListBase *lb= &ntree->threadstack[thread]; bNodeThreadStack *nts; - /* for material shading this is called quite a lot (perhaps too much locking unlocking) - * however without locking we get bug #18058 - Campbell */ - BLI_lock_thread(LOCK_CUSTOM1); - for(nts=lb->first; nts; nts=nts->next) { if(!nts->used) { nts->used= 1; - BLI_unlock_thread(LOCK_CUSTOM1); return nts; } } @@ -2014,7 +2009,7 @@ static bNodeThreadStack *ntreeGetThreadStack(bNodeTree *ntree, int thread) nts->stack= MEM_dupallocN(ntree->stack); nts->used= 1; BLI_addtail(lb, nts); - BLI_unlock_thread(LOCK_CUSTOM1); + return nts; } diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 46a7a1c556c..c6dd8d6890e 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -1273,7 +1273,7 @@ static void addAlphaLight(float *shadfac, float *col, float alpha, float filter) shadfac[3]= (1.0f-alpha)*shadfac[3]; } -static void ray_trace_shadow_tra(Isect *is, int depth, int traflag) +static void ray_trace_shadow_tra(Isect *is, int thread, int depth, int traflag) { /* ray to lamp, find first face that intersects, check alpha properties, if it has col[3]>0.0f continue. so exit when alpha is full */ @@ -1291,6 +1291,7 @@ static void ray_trace_shadow_tra(Isect *is, int depth, int traflag) shi.depth= 1; /* only used to indicate tracing */ shi.mask= 1; + shi.thread= thread; /*shi.osatex= 0; shi.thread= shi.sample= 0; @@ -1315,7 +1316,7 @@ static void ray_trace_shadow_tra(Isect *is, int depth, int traflag) is->oborig= RAY_OBJECT_SET(&R, shi.obi); is->faceorig= (RayFace*)shi.vlr; - ray_trace_shadow_tra(is, depth-1, traflag | RAY_TRA); + ray_trace_shadow_tra(is, thread, depth-1, traflag | RAY_TRA); } } } @@ -1943,7 +1944,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float * isec->col[0]= isec->col[1]= isec->col[2]= 1.0f; isec->col[3]= 1.0f; - ray_trace_shadow_tra(isec, DEPTH_SHADOW_TRA, 0); + ray_trace_shadow_tra(isec, shi->thread, DEPTH_SHADOW_TRA, 0); shadfac[0] += isec->col[0]; shadfac[1] += isec->col[1]; shadfac[2] += isec->col[2]; @@ -2041,7 +2042,7 @@ static void ray_shadow_jitter(ShadeInput *shi, LampRen *lar, float *lampco, floa isec->col[0]= isec->col[1]= isec->col[2]= 1.0f; isec->col[3]= 1.0f; - ray_trace_shadow_tra(isec, DEPTH_SHADOW_TRA, 0); + ray_trace_shadow_tra(isec, shi->thread, DEPTH_SHADOW_TRA, 0); shadfac[0] += isec->col[0]; shadfac[1] += isec->col[1]; shadfac[2] += isec->col[2]; @@ -2122,7 +2123,7 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float *shadfac) isec.col[0]= isec.col[1]= isec.col[2]= 1.0f; isec.col[3]= 1.0f; - ray_trace_shadow_tra(&isec, DEPTH_SHADOW_TRA, 0); + ray_trace_shadow_tra(&isec, shi->thread, DEPTH_SHADOW_TRA, 0); QUATCOPY(shadfac, isec.col); } else if(RE_ray_tree_intersect(R.raytree, &isec)) shadfac[3]= 0.0f; -- cgit v1.2.3 From b22819f686539f75438938ed45751e7dc3405a0c Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 22 Apr 2009 17:35:37 +0000 Subject: Bugfix #18039 Armature modifier didn't set amd->prevCos temp variable to NULL after freeing. Saving this in file will cause error or crash on reading. Quite weird how it survived so long? --- source/blender/blenkernel/intern/modifier.c | 4 +++- source/blender/blenloader/intern/readfile.c | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 7977e7b0160..f7620f5b88c 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -8846,8 +8846,10 @@ void modifier_freeTemporaryData(ModifierData *md) if(md->type == eModifierType_Armature) { ArmatureModifierData *amd= (ArmatureModifierData*)md; - if(amd->prevCos) + if(amd->prevCos) { MEM_freeN(amd->prevCos); + amd->prevCos= NULL; + } } } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 477f5a6cb59..ce154755651 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3176,6 +3176,11 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) smd->emCache = smd->mCache = 0; } + else if (md->type==eModifierType_Armature) { + ArmatureModifierData *amd = (ArmatureModifierData*) md; + + amd->prevCos= NULL; + } else if (md->type==eModifierType_Cloth) { ClothModifierData *clmd = (ClothModifierData*) md; -- cgit v1.2.3 From 48f483d14f1ff6dd9e5b4c87cb8d75ac862f3157 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 22 Apr 2009 18:20:41 +0000 Subject: BGE: some more cleanup, implement proper GetReplica/ProcessReplica workflow for touch/near/radar sensor. Remove duplicated code. --- source/gameengine/Ketsji/KX_NearSensor.cpp | 44 +++++++++-------------------- source/gameengine/Ketsji/KX_NearSensor.h | 1 + source/gameengine/Ketsji/KX_RadarSensor.cpp | 28 ++++-------------- source/gameengine/Ketsji/KX_RadarSensor.h | 1 + source/gameengine/Ketsji/KX_TouchSensor.cpp | 9 ++++-- source/gameengine/Ketsji/KX_TouchSensor.h | 1 + 6 files changed, 29 insertions(+), 55 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp index 23c525a1b52..2f1a3af78fa 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.cpp +++ b/source/gameengine/Ketsji/KX_NearSensor.cpp @@ -109,51 +109,35 @@ void KX_NearSensor::UnregisterSumo(KX_TouchEventManager* touchman) CValue* KX_NearSensor::GetReplica() { KX_NearSensor* replica = new KX_NearSensor(*this); - replica->m_colliders = new CListValue(); - replica->Init(); replica->ProcessReplica(); + return replica; +} + +void KX_NearSensor::ProcessReplica() +{ + KX_TouchSensor::ProcessReplica(); - replica->m_client_info = new KX_ClientObjectInfo(m_client_info->m_gameobject, KX_ClientObjectInfo::NEAR); + m_client_info = new KX_ClientObjectInfo(m_client_info->m_gameobject, KX_ClientObjectInfo::NEAR); - if (replica->m_physCtrl) + if (m_physCtrl) { - replica->m_physCtrl = replica->m_physCtrl->GetReplica(); - if (replica->m_physCtrl) + m_physCtrl = m_physCtrl->GetReplica(); + if (m_physCtrl) { //static_cast(m_eventmgr)->GetPhysicsEnvironment()->addSensor(replica->m_physCtrl); - replica->m_physCtrl->SetMargin(m_Margin); - replica->m_physCtrl->setNewClientInfo(replica->m_client_info); + m_physCtrl->SetMargin(m_Margin); + m_physCtrl->setNewClientInfo(m_client_info); } } - //Wrong: the parent object could be a child, this code works only if it is a root parent. - //Anyway, at this stage, the parent object is already synchronized, nothing to do. - //bool parentUpdated = false; - //((KX_GameObject*)replica->GetParent())->GetSGNode()->ComputeWorldTransforms(NULL, parentUpdated); - replica->SynchronizeTransform(); - - return replica; } - - void KX_NearSensor::ReParent(SCA_IObject* parent) { m_client_info->m_gameobject = static_cast(parent); m_client_info->m_sensors.push_back(this); - - -/* KX_ClientObjectInfo *client_info = gameobj->getClientInfo(); - client_info->m_gameobject = gameobj; - client_info->m_auxilary_info = NULL; - - client_info->m_sensors.push_back(this); - SCA_ISensor::ReParent(parent); -*/ - //Not needed, was done in GetReplica() already - //bool parentUpdated = false; - //((KX_GameObject*)GetParent())->GetSGNode()->ComputeWorldTransforms(NULL,parentUpdated); - //SynchronizeTransform(); + //Synchronize here with the actual parent. + SynchronizeTransform(); SCA_ISensor::ReParent(parent); } diff --git a/source/gameengine/Ketsji/KX_NearSensor.h b/source/gameengine/Ketsji/KX_NearSensor.h index 144f75f4772..5b65312472a 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.h +++ b/source/gameengine/Ketsji/KX_NearSensor.h @@ -70,6 +70,7 @@ public: virtual ~KX_NearSensor(); virtual void SynchronizeTransform(); virtual CValue* GetReplica(); + virtual void ProcessReplica(); virtual bool Evaluate(CValue* event); virtual void ReParent(SCA_IObject* parent); diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index d9b8b6fec5b..bf4b0f67e03 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -80,33 +80,15 @@ KX_RadarSensor::~KX_RadarSensor() CValue* KX_RadarSensor::GetReplica() { KX_RadarSensor* replica = new KX_RadarSensor(*this); - replica->m_colliders = new CListValue(); - replica->Init(); replica->ProcessReplica(); - - replica->m_client_info = new KX_ClientObjectInfo(m_client_info->m_gameobject, KX_ClientObjectInfo::RADAR); - - if (replica->m_physCtrl) - { - replica->m_physCtrl = replica->m_physCtrl->GetReplica(); - if (replica->m_physCtrl) - { - replica->m_physCtrl->setNewClientInfo(replica->m_client_info); - } - } - - //todo: make sure replication works fine! - //>m_sumoObj = new SM_Object(DT_NewCone(m_coneradius, m_coneheight),NULL,NULL,NULL); - //replica->m_sumoObj->setMargin(m_Margin); - //replica->m_sumoObj->setClientObject(replica->m_client_info); - //Wrong: see KX_TouchSensor - //bool parentUpdated = false; - //((KX_GameObject*)replica->GetParent())->GetSGNode()->ComputeWorldTransforms(NULL,parentUpdated); - replica->SynchronizeTransform(); - return replica; } +void KX_RadarSensor::ProcessReplica() +{ + KX_NearSensor::ProcessReplica(); + m_client_info->m_type = KX_ClientObjectInfo::RADAR; +} /** * Transforms the collision object. A cone is not correctly centered diff --git a/source/gameengine/Ketsji/KX_RadarSensor.h b/source/gameengine/Ketsji/KX_RadarSensor.h index 8389a2a29eb..b4268797f85 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.h +++ b/source/gameengine/Ketsji/KX_RadarSensor.h @@ -76,6 +76,7 @@ public: virtual ~KX_RadarSensor(); virtual void SynchronizeTransform(); virtual CValue* GetReplica(); + virtual void ProcessReplica(); /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index cddd018ef33..2addfc31ff3 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -142,12 +142,17 @@ KX_TouchSensor::~KX_TouchSensor() CValue* KX_TouchSensor::GetReplica() { KX_TouchSensor* replica = new KX_TouchSensor(*this); - replica->m_colliders = new CListValue(); - replica->Init(); replica->ProcessReplica(); return replica; } +void KX_TouchSensor::ProcessReplica() +{ + SCA_ISensor::ProcessReplica(); + m_colliders = new CListValue(); + Init(); +} + void KX_TouchSensor::ReParent(SCA_IObject* parent) { KX_GameObject *gameobj = static_cast(parent); diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index 4bcc313b65b..056b5701937 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -84,6 +84,7 @@ public: virtual ~KX_TouchSensor(); virtual CValue* GetReplica(); + virtual void ProcessReplica(); virtual void SynchronizeTransform(); virtual bool Evaluate(CValue* event); virtual void Init(); -- cgit v1.2.3 From f06802050d00cde6eeda93bb074599a1b8c8e7b5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 22 Apr 2009 19:04:00 +0000 Subject: [#18587] bugfix #18425 (Window.EditMode() ignores undo information) from Lorenzo Pierfederici (lento) --- source/blender/python/api2_2x/Window.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Window.c b/source/blender/python/api2_2x/Window.c index 40f6d52d8da..fe7cee5b0e1 100644 --- a/source/blender/python/api2_2x/Window.c +++ b/source/blender/python/api2_2x/Window.c @@ -954,9 +954,11 @@ static PyObject *M_Window_EditMode( PyObject * self, PyObject * args ) enter_editmode(0); } } else if( G.obedit ) { - if( undo_str_len > 63 ) - undo_str[63] = '\0'; /* 64 is max */ - BIF_undo_push( undo_str ); /* This checks user undo settings */ + if( do_undo ) { + if( undo_str_len > 63 ) + undo_str[63] = '\0'; /* 64 is max */ + BIF_undo_push( undo_str ); /* This checks user undo settings */ + } exit_editmode( EM_FREEDATA ); //update armatures -- cgit v1.2.3 From fd108f101988ad119b8a5ed4e83cd64227fc1e96 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 22 Apr 2009 20:43:41 +0000 Subject: [#18586] [bug] Ray sensor doesn't return a hit object Supporting len(GameOb) to see how many properties it has backfired since it can then evaluate as false. --- source/gameengine/Ketsji/KX_GameObject.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index ecc887eb567..bf6a81c8493 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1192,21 +1192,6 @@ PyObject* KX_GameObject::PyGetPosition() return PyObjectFrom(NodeGetWorldPosition()); } - -Py_ssize_t KX_GameObject::Map_Len(PyObject* self_v) -{ - KX_GameObject* self= static_castBGE_PROXY_REF(self_v); - - if (self==NULL) /* not sure what to do here */ - return 0; - - Py_ssize_t len= self->GetPropertyCount(); - if(self->m_attr_dict) - len += PyDict_Size(self->m_attr_dict); - return len; -} - - PyObject *KX_GameObject::Map_GetItem(PyObject *self_v, PyObject *item) { KX_GameObject* self= static_castBGE_PROXY_REF(self_v); @@ -1329,9 +1314,9 @@ int KX_GameObject::Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) return 0; /* success */ } - +/* Cant set the len otherwise it can evaluate as false */ PyMappingMethods KX_GameObject::Mapping = { - (lenfunc)KX_GameObject::Map_Len, /*inquiry mp_length */ + (lenfunc)NULL , /*inquiry mp_length */ (binaryfunc)KX_GameObject::Map_GetItem, /*binaryfunc mp_subscript */ (objobjargproc)KX_GameObject::Map_SetItem, /*objobjargproc mp_ass_subscript */ }; -- cgit v1.2.3 From 90508ed125c8dc81425e74c1e19e3510e1f7799c Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 22 Apr 2009 22:12:36 +0000 Subject: BGE bug #17670: Python controlled mist doesnt work in textured mode. --- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 6 +----- source/gameengine/Ketsji/KX_PythonInit.cpp | 12 ++++++++++++ source/gameengine/Rasterizer/RAS_IRasterizer.h | 1 + .../Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp | 4 ++++ .../Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h | 1 + 5 files changed, 19 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 4cfe3339631..a9206c1bb8f 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -1000,7 +1000,7 @@ void KX_KetsjiEngine::SetWorldSettings(KX_WorldInfo* wi) wi->getAmbientColorBlue() ); - if (m_drawingmode == RAS_IRasterizer::KX_TEXTURED) + if (m_drawingmode >= RAS_IRasterizer::KX_SOLID) { if (wi->hasMist()) { @@ -1012,10 +1012,6 @@ void KX_KetsjiEngine::SetWorldSettings(KX_WorldInfo* wi) wi->getMistColorBlue() ); } - else - { - m_rasterizer->DisableFog(); - } } } } diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 873e49be6bb..8edc71aeec7 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -632,6 +632,17 @@ static PyObject* gPySetMistColor(PyObject*, PyObject* value) Py_RETURN_NONE; } +static PyObject* gPyDisableMist(PyObject*) +{ + + if (!gp_Rasterizer) { + PyErr_SetString(PyExc_RuntimeError, "Rasterizer.setMistColor(color), Rasterizer not available"); + return NULL; + } + gp_Rasterizer->DisableFog(); + + Py_RETURN_NONE; +} static PyObject* gPySetMistStart(PyObject*, PyObject* args) @@ -900,6 +911,7 @@ static struct PyMethodDef rasterizer_methods[] = { METH_VARARGS, "setMousePosition(int x,int y)"}, {"setBackgroundColor",(PyCFunction)gPySetBackgroundColor,METH_O,"set Background Color (rgb)"}, {"setAmbientColor",(PyCFunction)gPySetAmbientColor,METH_O,"set Ambient Color (rgb)"}, + {"disableMist",(PyCFunction)gPyDisableMist,METH_NOARGS,"turn off mist"}, {"setMistColor",(PyCFunction)gPySetMistColor,METH_O,"set Mist Color (rgb)"}, {"setMistStart",(PyCFunction)gPySetMistStart,METH_VARARGS,"set Mist Start(rgb)"}, {"setMistEnd",(PyCFunction)gPySetMistEnd,METH_VARARGS,"set Mist End(rgb)"}, diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h index cfeda06e670..96472b112d6 100644 --- a/source/gameengine/Rasterizer/RAS_IRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h @@ -280,6 +280,7 @@ public: /** */ virtual void DisableFog()=0; + virtual bool IsFogEnabled()=0; virtual void SetBackColor(float red, float green, diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index 50f56db0645..bf50cde2280 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -210,6 +210,10 @@ void RAS_OpenGLRasterizer::DisableFog() m_fogenabled = false; } +bool RAS_OpenGLRasterizer::IsFogEnabled() +{ + return m_fogenabled; +} void RAS_OpenGLRasterizer::DisplayFog() diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h index 83a9f759a8b..6013946fadf 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h @@ -190,6 +190,7 @@ public: void DisableFog(); virtual void DisplayFog(); + virtual bool IsFogEnabled(); virtual void SetBackColor( float red, -- cgit v1.2.3 From 1ca6768051a74a370bf16f877a5ffc1691545ae6 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 22 Apr 2009 22:38:23 +0000 Subject: Fix for bug #18509: mesh deform modifier not working on load, with cage on hidden layer. --- source/blender/blenkernel/intern/modifier.c | 92 +++++++++++++++++------------ 1 file changed, 55 insertions(+), 37 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index f7620f5b88c..10bcb2e09f2 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -6054,8 +6054,6 @@ static void surfaceModifier_deformVerts( float (*vertexCos)[3], int numVerts) { SurfaceModifierData *surmd = (SurfaceModifierData*) md; - DerivedMesh *dm = NULL; - float current_time = 0; unsigned int numverts = 0, i = 0; if(surmd->dm) @@ -6258,6 +6256,48 @@ static int is_last_displist(Object *ob) return 0; } + +static DerivedMesh *get_original_dm(Object *ob, float (*vertexCos)[3], int orco) +{ + DerivedMesh *dm= NULL; + + if(ob->type==OB_MESH) { + dm = CDDM_from_mesh((Mesh*)(ob->data), ob); + + if(vertexCos) { + CDDM_apply_vert_coords(dm, vertexCos); + //CDDM_calc_normals(dm); + } + + if(orco) + DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, get_mesh_orco_verts(ob)); + } + else if(ELEM3(ob->type,OB_FONT,OB_CURVE,OB_SURF)) { + Object *tmpobj; + Curve *tmpcu; + + if(is_last_displist(ob)) { + /* copies object and modifiers (but not the data) */ + tmpobj= copy_object(ob); + tmpcu = (Curve *)tmpobj->data; + tmpcu->id.us--; + + /* copies the data */ + tmpobj->data = copy_curve((Curve *) ob->data); + + makeDispListCurveTypes(tmpobj, 1); + nurbs_to_mesh(tmpobj); + + dm = CDDM_from_mesh((Mesh*)(tmpobj->data), tmpobj); + //CDDM_calc_normals(dm); + + free_libblock_us(&G.main->object, tmpobj); + } + } + + return dm; +} + /* saves the current emitter state for a particle system and calculates particles */ static void particleSystemModifier_deformVerts( ModifierData *md, Object *ob, DerivedMesh *derivedData, @@ -6285,43 +6325,13 @@ static void particleSystemModifier_deformVerts( if(!psys_check_enabled(ob, psys)) return; - if(dm==0){ - if(ob->type==OB_MESH){ - dm = CDDM_from_mesh((Mesh*)(ob->data), ob); - - CDDM_apply_vert_coords(dm, vertexCos); - //CDDM_calc_normals(dm); - - DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, get_mesh_orco_verts(ob)); - - needsFree=1; - } - else if(ELEM3(ob->type,OB_FONT,OB_CURVE,OB_SURF)){ - Object *tmpobj; - Curve *tmpcu; - - if(is_last_displist(ob)){ - /* copies object and modifiers (but not the data) */ - tmpobj= copy_object( ob ); - tmpcu = (Curve *)tmpobj->data; - tmpcu->id.us--; - - /* copies the data */ - tmpobj->data = copy_curve( (Curve *) ob->data ); - - makeDispListCurveTypes( tmpobj, 1 ); - nurbs_to_mesh( tmpobj ); + if(dm==0) { + dm= get_original_dm(ob, vertexCos, 1); - dm = CDDM_from_mesh((Mesh*)(tmpobj->data), tmpobj); - //CDDM_calc_normals(dm); - - free_libblock_us( &G.main->object, tmpobj ); + if(!dm) + return; - needsFree=1; - } - else return; - } - else return; + needsFree= 1; } /* clear old dm */ @@ -7658,6 +7668,14 @@ static void meshdeformModifier_do( } else cagedm= mmd->object->derivedFinal; + + /* if we don't have one computed, use derivedmesh from data + * without any modifiers */ + if(!cagedm) { + cagedm= get_original_dm(mmd->object, NULL, 0); + if(cagedm) + cagedm->needsFree= 1; + } if(!cagedm) return; -- cgit v1.2.3 From d568794a9873eed10a9d240c1e1a1ba52aba929c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 22 Apr 2009 23:01:40 +0000 Subject: Fix for bug #14410: multires + vertex colors crash rendering or baking while in editmode. --- source/blender/blenkernel/intern/multires.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 8112c64d79f..ee9255df837 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -966,9 +966,9 @@ void multires_update_levels(Mesh *me, const int render) multires_update_colors(me, em); } -static void check_colors(Mesh *me) +static void check_colors(Mesh *me, const int render) { - CustomData *src= G.obedit ? &G.editMesh->fdata : &me->fdata; + CustomData *src= (!render && G.obedit)? &G.editMesh->fdata : &me->fdata; const char col= CustomData_has_layer(src, CD_MCOL); /* Check if vertex colors have been deleted or added */ @@ -1110,7 +1110,7 @@ void multires_add_level(Object *ob, Mesh *me, const char subdiv_type) lvl= MEM_callocN(sizeof(MultiresLevel), "multireslevel"); if(me->pv) mesh_pmv_off(ob, me); - check_colors(me); + check_colors(me, 0); multires_update_levels(me, 0); ++me->mr->level_count; @@ -1276,7 +1276,7 @@ void multires_set_level(Object *ob, Mesh *me, const int render) { if(me->pv) mesh_pmv_off(ob, me); - check_colors(me); + check_colors(me, render); multires_update_levels(me, render); me->mr->current= me->mr->newlvl; -- cgit v1.2.3 From 6a270ecb9435fd695988de5c685c65cac5a43c79 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 23 Apr 2009 00:32:33 +0000 Subject: BGE Python API CListValue fixes - Disable changing CValueLists that the BGE uses internally (scene.objects.append(1) would crash when drawing) - val=clist+list would modify clist in place, now return a new value. - clist.append([....]), was working like extend. - clist.append(val) didnt work for most CValue types like KX_GameObjects. Other changes - "isValid" was always returning True. - Set all errors for invalid proxy access to PyExc_SystemError (was using a mix of error types) - Added PyObjectPlus::InvalidateProxy() to manually invalidate, though if python ever gains access again, it will make a new valid proxy. This is so removing an object from a scene can invalidate the object even if its stored elsewhere in a CValueList for eg. --- source/gameengine/Expressions/ListValue.cpp | 153 ++++++++++++++----------- source/gameengine/Expressions/PyObjectPlus.cpp | 25 +++- source/gameengine/Expressions/PyObjectPlus.h | 2 + source/gameengine/Expressions/Value.cpp | 28 +++-- source/gameengine/Expressions/Value.h | 2 +- source/gameengine/Ketsji/KX_GameObject.cpp | 10 +- source/gameengine/Ketsji/KX_MeshProxy.cpp | 2 +- source/gameengine/Ketsji/KX_Scene.cpp | 10 +- source/gameengine/Ketsji/KX_SceneActuator.cpp | 4 +- 9 files changed, 146 insertions(+), 90 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 6c92e805745..c78963142d1 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -39,8 +39,10 @@ Py_ssize_t listvalue_bufferlen(PyObject* self) PyObject* listvalue_buffer_item(PyObject* self, Py_ssize_t index) { CListValue *list= static_cast(BGE_PROXY_REF(self)); + CValue *cval; + if (list==NULL) { - PyErr_SetString(PyExc_IndexError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, "val = CList[i], "BGE_PROXY_ERROR_MSG); return NULL; } @@ -49,24 +51,25 @@ PyObject* listvalue_buffer_item(PyObject* self, Py_ssize_t index) if (index < 0) index = count+index; - if (index >= 0 && index < count) - { - PyObject* pyobj = list->GetValue(index)->ConvertValueToPython(); - if (pyobj) - return pyobj; - else - return list->GetValue(index)->GetProxy(); - + if (index < 0 || index >= count) { + PyErr_SetString(PyExc_IndexError, "CList[i]: Python ListIndex out of range in CValueList"); + return NULL; } - PyErr_SetString(PyExc_IndexError, "list[i]: Python ListIndex out of range in CValueList"); - return NULL; + + cval= list->GetValue(index); + + PyObject* pyobj = cval->ConvertValueToPython(); + if (pyobj) + return pyobj; + else + return cval->GetProxy(); } PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex) { CListValue *list= static_cast(BGE_PROXY_REF(self)); if (list==NULL) { - PyErr_SetString(PyExc_IndexError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, "value = CList[i], "BGE_PROXY_ERROR_MSG); return NULL; } @@ -85,7 +88,7 @@ PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex) } PyObject *pyindex_str = PyObject_Repr(pyindex); /* new ref */ - PyErr_Format(PyExc_KeyError, "list[key]: '%s' key not in list", PyString_AsString(pyindex_str)); + PyErr_Format(PyExc_KeyError, "CList[key]: '%s' key not in list", PyString_AsString(pyindex_str)); Py_DECREF(pyindex_str); return NULL; } @@ -96,7 +99,7 @@ PyObject* listvalue_buffer_slice(PyObject* self,Py_ssize_t ilow, Py_ssize_t ihig { CListValue *list= static_cast(BGE_PROXY_REF(self)); if (list==NULL) { - PyErr_SetString(PyExc_IndexError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, "val = CList[i:j], "BGE_PROXY_ERROR_MSG); return NULL; } @@ -127,73 +130,79 @@ PyObject* listvalue_buffer_slice(PyObject* self,Py_ssize_t ilow, Py_ssize_t ihig } - -static PyObject * -listvalue_buffer_concat(PyObject * self, PyObject * other) +/* clist + list, return a list that python owns */ +static PyObject *listvalue_buffer_concat(PyObject * self, PyObject * other) { CListValue *listval= static_cast(BGE_PROXY_REF(self)); + int i, numitems, numitems_orig; + if (listval==NULL) { - PyErr_SetString(PyExc_IndexError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, "CList+other, "BGE_PROXY_ERROR_MSG); return NULL; } + numitems_orig= listval->GetCount(); + // for now, we support CListValue concatenated with items // and CListValue concatenated to Python Lists // and CListValue concatenated with another CListValue - listval->AddRef(); - if (other->ob_type == &PyList_Type) + /* Shallow copy, dont use listval->GetReplica(), it will screw up with KX_GameObjects */ + CListValue* listval_new = new CListValue(); + + if (PyList_Check(other)) { + CValue* listitemval; bool error = false; - - int i; - int numitems = PyList_Size(other); + + numitems = PyList_Size(other); + + /* copy the first part of the list */ + listval_new->Resize(numitems_orig + numitems); + for (i=0;iSetValue(i, listval->GetValue(i)->AddRef()); + for (i=0;iConvertPythonToValue(listitem); - if (listitemval) - { - listval->Add(listitemval); - } else - { - error = true; + listitemval = listval->ConvertPythonToValue(PyList_GetItem(other,i), "cList + pyList: CListValue, "); + + if (listitemval) { + listval_new->SetValue(i+numitems_orig, listitemval); + } else { + error= true; + break; } } - + if (error) { - PyErr_SetString(PyExc_SystemError, "list.append(val): couldn't add one or more items to this CValueList"); - return NULL; + listval_new->Resize(numitems_orig+i); /* resize so we dont try release NULL pointers */ + listval_new->Release(); + return NULL; /* ConvertPythonToValue above sets the error */ } - - } else - { - if (other->ob_type == &CListValue::Type) - { - // add items from otherlist to this list - CListValue* otherval = (CListValue*) other; - - - for (int i=0;iGetCount();i++) - { - otherval->Add(listval->GetValue(i)->AddRef()); - } - } - else - { - CValue* objval = listval->ConvertPythonToValue(other); - if (objval) - { - listval->Add(objval); - } else - { - PyErr_SetString(PyExc_SystemError, "list.append(i): couldn't add item to this CValueList"); - return NULL; - } + + } + else if (PyObject_TypeCheck(other, &CListValue::Type)) { + // add items from otherlist to this list + CListValue* otherval = static_cast(BGE_PROXY_REF(other)); + if(otherval==NULL) { + listval_new->Release(); + PyErr_SetString(PyExc_SystemError, "CList+other, "BGE_PROXY_ERROR_MSG); + return NULL; } + + numitems = otherval->GetCount(); + + /* copy the first part of the list */ + listval_new->Resize(numitems_orig + numitems); /* resize so we dont try release NULL pointers */ + for (i=0;iSetValue(i, listval->GetValue(i)->AddRef()); + + /* now copy the other part of the list */ + for (i=0;iSetValue(i+numitems_orig, otherval->GetValue(i)->AddRef()); + } - - return self; + return listval_new->NewProxy(true); /* python owns this list */ } @@ -437,14 +446,24 @@ void CListValue::MergeList(CListValue *otherlist) { SetValue(i+numelements,otherlist->GetValue(i)->AddRef()); } - } - PyObject* CListValue::Pyappend(PyObject* value) { - return listvalue_buffer_concat(m_proxy, value); /* m_proxy is the same as self */ + CValue* objval = ConvertPythonToValue(value, "CList.append(i): CValueList, "); + + if (!objval) /* ConvertPythonToValue sets the error */ + return NULL; + + if (!BGE_PROXY_PYOWNS(m_proxy)) { + PyErr_SetString(PyExc_TypeError, "CList.append(i): this CValueList is used internally for the game engine and can't be modified"); + return NULL; + } + + Add(objval); + + Py_RETURN_NONE; } @@ -482,7 +501,7 @@ PyObject* CListValue::Pyindex(PyObject *value) { PyObject* result = NULL; - CValue* checkobj = ConvertPythonToValue(value); + CValue* checkobj = ConvertPythonToValue(value, "val = cList[i]: CValueList, "); if (checkobj==NULL) return NULL; /* ConvertPythonToValue sets the error */ @@ -499,7 +518,7 @@ PyObject* CListValue::Pyindex(PyObject *value) checkobj->Release(); if (result==NULL) { - PyErr_SetString(PyExc_ValueError, "list.index(x): x not in CListValue"); + PyErr_SetString(PyExc_ValueError, "CList.index(x): x not in CListValue"); } return result; @@ -511,7 +530,7 @@ PyObject* CListValue::Pycount(PyObject* value) { int numfound = 0; - CValue* checkobj = ConvertPythonToValue(value); + CValue* checkobj = ConvertPythonToValue(value, "cList.count(val): CValueList, "); if (checkobj==NULL) { /* in this case just return that there are no items in the list */ PyErr_Clear(); diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 57a61ac37ae..54f076741cc 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -138,9 +138,9 @@ PyObject *PyObjectPlus::py_base_getattro(PyObject * self, PyObject *attr) PyObjectPlus *self_plus= BGE_PROXY_REF(self); if(self_plus==NULL) { if(!strcmp("isValid", PyString_AsString(attr))) { - Py_RETURN_TRUE; + Py_RETURN_FALSE; } - PyErr_SetString(PyExc_RuntimeError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); return NULL; } @@ -171,7 +171,7 @@ int PyObjectPlus::py_base_setattro(PyObject *self, PyObject *attr, PyObject *val { PyObjectPlus *self_plus= BGE_PROXY_REF(self); if(self_plus==NULL) { - PyErr_SetString(PyExc_RuntimeError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); return -1; } @@ -186,7 +186,7 @@ PyObject *PyObjectPlus::py_base_repr(PyObject *self) // This should be the ent PyObjectPlus *self_plus= BGE_PROXY_REF(self); if(self_plus==NULL) { - PyErr_SetString(PyExc_RuntimeError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); return NULL; } @@ -818,6 +818,23 @@ void PyObjectPlus::ProcessReplica() m_proxy= NULL; } +/* Sometimes we might want to manually invalidate a BGE type even if + * it hasnt been released by the BGE, say for example when an object + * is removed from a scene, accessing it may cause problems. + * + * In this case the current proxy is made invalid, disowned, + * and will raise an error on access. However if python can get access + * to this class again it will make a new proxy and work as expected. + */ +void PyObjectPlus::InvalidateProxy() // check typename of each parent +{ + if(m_proxy) { + BGE_PROXY_REF(m_proxy)=NULL; + Py_DECREF(m_proxy); + m_proxy= NULL; + } +} + /* Utility function called by the macro py_getattro_up() * for getting ob.__dict__() values from our PyObject * this is used by python for doing dir() on an object, so its good diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 52e59f7730c..257851ef4b3 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -451,6 +451,8 @@ public: static PyObject *GetProxy_Ext(PyObjectPlus *self, PyTypeObject *tp); static PyObject *NewProxy_Ext(PyObjectPlus *self, PyTypeObject *tp, bool py_owns); + void InvalidateProxy(); + /** * Makes sure any internal data owned by this class is deep copied. */ diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index b86fbe0b163..6e8f2ba1061 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -604,7 +604,7 @@ PyObject* CValue::py_getattro_dict() { py_getattro_dict_up(PyObjectPlus); } -CValue* CValue::ConvertPythonToValue(PyObject* pyobj) +CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) { CValue* vallie = NULL; @@ -620,7 +620,7 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj) for (i=0;iAdd(listitemval); @@ -657,13 +657,22 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj) { vallie = new CStringValue(PyString_AsString(pyobj),""); } else - if (pyobj->ob_type==&CValue::Type || pyobj->ob_type==&CListValue::Type) + if (BGE_PROXY_CHECK_TYPE(pyobj)) /* Note, dont let these get assigned to GameObject props, must check elsewhere */ { - vallie = ((CValue*) pyobj)->AddRef(); + if (BGE_PROXY_REF(pyobj) && (BGE_PROXY_REF(pyobj))->isA(&CValue::Type)) + { + vallie = (static_cast(BGE_PROXY_REF(pyobj)))->AddRef(); + } else { + + if(BGE_PROXY_REF(pyobj)) /* this is not a CValue */ + PyErr_Format(PyExc_TypeError, "%sgame engine python type cannot be used as a property", error_prefix); + else /* PyObjectPlus_Proxy has been removed, cant use */ + PyErr_Format(PyExc_SystemError, "%s"BGE_PROXY_ERROR_MSG, error_prefix); + } } else { /* return an error value from the caller */ - PyErr_SetString(PyExc_TypeError, "This python type could not be converted to a to a game engine property"); + PyErr_Format(PyExc_TypeError, "%scould convert python value to a game engine property", error_prefix); } return vallie; @@ -682,10 +691,11 @@ int CValue::py_delattro(PyObject *attr) int CValue::py_setattro(PyObject *attr, PyObject* pyobj) { char *attr_str= PyString_AsString(attr); - CValue* oldprop = GetProperty(attr_str); - - CValue* vallie = ConvertPythonToValue(pyobj); - if (vallie) + CValue* oldprop = GetProperty(attr_str); + CValue* vallie; + + /* Dissallow python to assign GameObjects, Scenes etc as values */ + if ((BGE_PROXY_CHECK_TYPE(pyobj)==0) && (vallie = ConvertPythonToValue(pyobj, "cvalue.attr = value: "))) { if (oldprop) oldprop->SetValue(vallie); diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 065fe62d978..97ce9cddcea 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -230,7 +230,7 @@ public: return NULL; } - virtual CValue* ConvertPythonToValue(PyObject* pyobj); + virtual CValue* ConvertPythonToValue(PyObject* pyobj, const char *error_prefix); virtual int py_delattro(PyObject *attr); diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index bf6a81c8493..7629f9d8f1a 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1200,7 +1200,7 @@ PyObject *KX_GameObject::Map_GetItem(PyObject *self_v, PyObject *item) PyObject* pyconvert; if (self==NULL) { - PyErr_SetString(PyExc_RuntimeError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); return NULL; } @@ -1234,7 +1234,7 @@ int KX_GameObject::Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) PyErr_Clear(); if (self==NULL) { - PyErr_SetString(PyExc_RuntimeError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); return -1; } @@ -1261,9 +1261,9 @@ int KX_GameObject::Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) int set= 0; /* as CValue */ - if(attr_str) + if(attr_str && BGE_PROXY_CHECK_TYPE(val)==0) /* dont allow GameObjects for eg to be assigned to CValue props */ { - CValue* vallie = self->ConvertPythonToValue(val); + CValue* vallie = self->ConvertPythonToValue(val, ""); /* error unused */ if(vallie) { @@ -2643,7 +2643,7 @@ bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py /* sets the error */ if (*object==NULL) { - PyErr_Format(PyExc_RuntimeError, "%s, " BGE_PROXY_ERROR_MSG, error_prefix); + PyErr_Format(PyExc_SystemError, "%s, " BGE_PROXY_ERROR_MSG, error_prefix); return false; } diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index 75e46da072e..009364a3d7b 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -348,7 +348,7 @@ bool ConvertPythonToMesh(PyObject * value, RAS_MeshObject **object, bool py_none /* sets the error */ if (*object==NULL) { - PyErr_Format(PyExc_RuntimeError, "%s, " BGE_PROXY_ERROR_MSG, error_prefix); + PyErr_Format(PyExc_SystemError, "%s, " BGE_PROXY_ERROR_MSG, error_prefix); return false; } diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 6917305522e..0c26a6a7b3b 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -891,7 +891,15 @@ void KX_Scene::RemoveObject(class CValue* gameobj) { KX_GameObject* newobj = (KX_GameObject*) gameobj; - // first disconnect child from parent + /* Invalidate the python reference, since the object may exist in script lists + * its possible that it wont be automatically invalidated, so do it manually here, + * + * if for some reason the object is added back into the scene python can always get a new Proxy + */ + gameobj->InvalidateProxy(); + + + // disconnect child from parent SG_Node* node = newobj->GetSGNode(); if (node) diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index 6f622939dc4..7d2bea25d2c 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -316,7 +316,7 @@ int KX_SceneActuator::pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_ if(camOb==NULL) { - PyErr_SetString(PyExc_RuntimeError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); return 1; } @@ -435,7 +435,7 @@ PyObject* KX_SceneActuator::PySetCamera(PyObject* args) new_camera = static_castBGE_PROXY_REF(cam); if(new_camera==NULL) { - PyErr_SetString(PyExc_RuntimeError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); return NULL; } -- cgit v1.2.3 From e8f5c7500592bad6c59f2cbf1e8ffc9d78330230 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 23 Apr 2009 00:47:45 +0000 Subject: patch from Mitchell Stokes, comments only - KX_PYATTRIBUTE_TODO for missing attributes --- source/gameengine/Converter/BL_ActionActuator.cpp | 1 + source/gameengine/GameLogic/SCA_ILogicBrick.cpp | 1 + source/gameengine/GameLogic/SCA_ISensor.cpp | 3 +++ source/gameengine/GameLogic/SCA_JoystickSensor.cpp | 2 +- source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 3 +++ source/gameengine/Ketsji/KX_ConstraintWrapper.cpp | 1 + source/gameengine/Ketsji/KX_GameActuator.cpp | 1 + source/gameengine/Ketsji/KX_ObjectActuator.cpp | 11 +++++++++++ source/gameengine/Ketsji/KX_ParentActuator.cpp | 1 + source/gameengine/Ketsji/KX_PolyProxy.cpp | 1 + source/gameengine/Ketsji/KX_SceneActuator.cpp | 2 ++ source/gameengine/Ketsji/KX_VertexProxy.cpp | 1 + 12 files changed, 27 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index e06008ff891..3ad55f5ee12 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -1010,6 +1010,7 @@ PyAttributeDef BL_ActionActuator::Attributes[] = { KX_PYATTRIBUTE_BOOL_RW("continue", BL_ActionActuator, m_end_reset), KX_PYATTRIBUTE_FLOAT_RW_CHECK("blendTime", 0, MAXFRAMEF, BL_ActionActuator, m_blendframe, CheckBlendTime), KX_PYATTRIBUTE_SHORT_RW_CHECK("type",0,100,false,BL_ActionActuator,m_playtype,CheckType), + //KX_PYATTRIBUTE_TODO("channel"), { NULL } //Sentinel }; diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index ec3651ddd1f..8439dbac268 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -249,6 +249,7 @@ PyMethodDef SCA_ILogicBrick::Methods[] = { PyAttributeDef SCA_ILogicBrick::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("owner", SCA_ILogicBrick, pyattr_get_owner), KX_PYATTRIBUTE_INT_RW("executePriority",0,100000,false,SCA_ILogicBrick,m_Execute_Ueber_Priority), + //KX_PYATTRIBUTE_TODO("name"), {NULL} //Sentinel }; diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index dde970962b6..b556c14831e 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -456,6 +456,9 @@ PyAttributeDef SCA_ISensor::Attributes[] = { KX_PYATTRIBUTE_BOOL_RW("level",SCA_ISensor,m_level), KX_PYATTRIBUTE_RO_FUNCTION("triggered", SCA_ISensor, pyattr_get_triggered), KX_PYATTRIBUTE_RO_FUNCTION("positive", SCA_ISensor, pyattr_get_positive), + //KX_PYATTRIBUTE_TODO("links"), + //KX_PYATTRIBUTE_TODO("posTicks"), + //KX_PYATTRIBUTE_TODO("negTicks"), { NULL } //Sentinel }; diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index 11b31c67edd..b9d99177259 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -330,7 +330,7 @@ PyAttributeDef SCA_JoystickSensor::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("numButtons", SCA_JoystickSensor, pyattr_get_num_buttons), KX_PYATTRIBUTE_RO_FUNCTION("numHats", SCA_JoystickSensor, pyattr_get_num_hats), KX_PYATTRIBUTE_RO_FUNCTION("connected", SCA_JoystickSensor, pyattr_get_connected), - + //KX_PYATTRIBUTE_TODO("events"), { NULL } //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 7378113bc31..9f11ea11819 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -771,6 +771,9 @@ PyMethodDef KX_BlenderMaterial::Methods[] = }; PyAttributeDef KX_BlenderMaterial::Attributes[] = { + //KX_PYATTRIBUTE_TODO("shader"), + //KX_PYATTRIBUTE_TODO("materialIndex"), + //KX_PYATTRIBUTE_TODO("blending"), { NULL } //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index c537c9abe01..0e6678b8572 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -131,5 +131,6 @@ PyMethodDef KX_ConstraintWrapper::Methods[] = { }; PyAttributeDef KX_ConstraintWrapper::Attributes[] = { + //KX_PYATTRIBUTE_TODO("constraintId"), { NULL } //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index 514fb74f6bf..a46318d0468 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -248,6 +248,7 @@ PyMethodDef KX_GameActuator::Methods[] = PyAttributeDef KX_GameActuator::Attributes[] = { KX_PYATTRIBUTE_STRING_RW("file",0,100,false,KX_GameActuator,m_filename), + //KX_PYATTRIBUTE_TODO("mode"), { NULL } //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index b90967d610c..86ae082523f 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -330,6 +330,17 @@ PyMethodDef KX_ObjectActuator::Methods[] = { }; PyAttributeDef KX_ObjectActuator::Attributes[] = { + //KX_PYATTRIBUTE_TODO("force"), + //KX_PYATTRIBUTE_TODO("torque"), + //KX_PYATTRIBUTE_TODO("dLoc"), + //KX_PYATTRIBUTE_TODO("dRot"), + //KX_PYATTRIBUTE_TODO("linV"), + //KX_PYATTRIBUTE_TODO("angV"), + //KX_PYATTRIBUTE_TODO("damping"), + //KX_PYATTRIBUTE_TODO("forceLimitX"), + //KX_PYATTRIBUTE_TODO("forceLimitY"), + //KX_PYATTRIBUTE_TODO("forceLimitZ"), + //KX_PYATTRIBUTE_TODO("pid"), { NULL } //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index afc16ba994c..ffd7185f235 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -173,6 +173,7 @@ PyMethodDef KX_ParentActuator::Methods[] = { PyAttributeDef KX_ParentActuator::Attributes[] = { KX_PYATTRIBUTE_RW_FUNCTION("object", KX_ParentActuator, pyattr_get_object, pyattr_set_object), + //KX_PYATTRIBUTE_TODO("mode"), { NULL } //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index 0ab55a86078..33e215387b7 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -79,6 +79,7 @@ PyMethodDef KX_PolyProxy::Methods[] = { PyAttributeDef KX_PolyProxy::Attributes[] = { /* All dummy's so they come up in a dir() */ + //KX_PYATTRIBUTE_TODO("DummyProps"), KX_PYATTRIBUTE_DUMMY("matname"), KX_PYATTRIBUTE_DUMMY("texture"), KX_PYATTRIBUTE_DUMMY("material"), diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index 7d2bea25d2c..4447ff48766 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -270,6 +270,8 @@ PyMethodDef KX_SceneActuator::Methods[] = PyAttributeDef KX_SceneActuator::Attributes[] = { KX_PYATTRIBUTE_STRING_RW("scene",0,32,true,KX_SceneActuator,m_nextSceneName), KX_PYATTRIBUTE_RW_FUNCTION("camera",KX_SceneActuator,pyattr_get_camera,pyattr_set_camera), + //KX_PYATTRIBUTE_TODO("useRestart"), + //KX_PYATTRIBUTE_TODO("mode"), { NULL } //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index 6b2507b8b31..629fadff86a 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -79,6 +79,7 @@ PyMethodDef KX_VertexProxy::Methods[] = { }; PyAttributeDef KX_VertexProxy::Attributes[] = { + //KX_PYATTRIBUTE_TODO("DummyProps"), KX_PYATTRIBUTE_DUMMY("x"), KX_PYATTRIBUTE_DUMMY("y"), -- cgit v1.2.3 From 7ac233be8abc405cc997f032c9ab146c2ab8ea89 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 23 Apr 2009 00:49:38 +0000 Subject: BGE Rasterizer methods to handle Screen Space - (getScreenPosition, getScreenVect, getScreenRay) getScreenPosition(obj): - Gets the position of an object projected on screen space. getScreenVect(x, y): - Gets the vector from the camera position in the screen coordinate direction. getScreenRay(x, y, dist, property): - Look towards a screen coordinate (x,y) and find first object hit within dist that matches prop. - The ray is a call to KX_GameObject->rayCastTo from the KX_Camera object. Patch [#18589] test files can be found there. Patch reviewed by Campbell --- source/gameengine/Ketsji/KX_PythonInit.cpp | 127 +++++++++++++++++++++++++++++ source/gameengine/PyDoc/KX_GameObject.py | 2 +- source/gameengine/PyDoc/Rasterizer.py | 43 ++++++++++ 3 files changed, 171 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 8edc71aeec7..bf3b64f1ecf 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -484,6 +484,127 @@ static struct PyMethodDef game_methods[] = { }; +static PyObject* gPyGetScreenPosition(PyObject*, PyObject* value) +{ + MT_Vector3 vect; + KX_GameObject *obj = NULL; + + if (!PyVecTo(value, vect)) + { + if(ConvertPythonToGameObject(value, &obj, true, "")) + { + PyErr_Clear(); + vect = MT_Vector3(obj->NodeGetWorldPosition()); + } + else + { + PyErr_SetString(PyExc_TypeError, "Error in getScreenPosition. Expected a Vector3 or a KX_GameObject or a string for a name of a KX_GameObject"); + return NULL; + } + } + + GLdouble modelMatrix[16]; + GLdouble projMatrix[16]; + GLint viewport[4]; + GLdouble win[3]; + + glGetIntegerv(GL_VIEWPORT, viewport); + glGetDoublev(GL_MODELVIEW_MATRIX, modelMatrix); + glGetDoublev(GL_PROJECTION_MATRIX, projMatrix); + + gluProject(vect[0], vect[1], vect[2], modelMatrix, projMatrix, viewport, &win[0], &win[1], &win[2]); + + vect[0] = win[0] / (viewport[0] + viewport[2]); + vect[1] = win[1] / (viewport[1] + viewport[3]); + + PyObject* ret = PyTuple_New(2); + if(ret){ + PyTuple_SET_ITEM(ret, 0, PyFloat_FromDouble(vect[0])); + PyTuple_SET_ITEM(ret, 1, PyFloat_FromDouble(vect[1])); + return ret; + } + + return NULL; +} + +static PyObject* gPyGetScreenVect(PyObject*, PyObject* args) +{ + double x,y; + if (!PyArg_ParseTuple(args,"dd:getScreenVect",&x,&y)) + return NULL; + + MT_Vector3 vect; + MT_Point3 campos, screenpos; + + GLdouble modelMatrix[16]; + GLdouble projMatrix[16]; + GLint viewport[4]; + GLdouble win[3]; + + glGetIntegerv(GL_VIEWPORT, viewport); + glGetDoublev(GL_MODELVIEW_MATRIX, modelMatrix); + glGetDoublev(GL_PROJECTION_MATRIX, projMatrix); + + vect[0] = x * viewport[2]; + vect[1] = y * viewport[3]; + + vect[0] += viewport[0]; + vect[1] += viewport[1]; + + glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &vect[2]); + gluUnProject(vect[0], vect[1], vect[2], modelMatrix, projMatrix, viewport, &win[0], &win[1], &win[2]); + + campos = gp_Rasterizer->GetCameraPosition(); + screenpos = MT_Point3(win[0], win[1], win[2]); + vect = campos-screenpos; + + vect.normalize(); + return PyObjectFrom(vect); +} + +static PyObject* gPyGetScreenRay(PyObject* self, PyObject* args) +{ + KX_Camera* cam; + MT_Vector3 vect; + double x,y,dist; + char *propName = NULL; + + if (!PyArg_ParseTuple(args,"ddd|s:getScreenRay",&x,&y,&dist,&propName)) + return NULL; + + PyObject* argValue = PyTuple_New(2); + if (argValue) { + PyTuple_SET_ITEM(argValue, 0, PyFloat_FromDouble(x)); + PyTuple_SET_ITEM(argValue, 1, PyFloat_FromDouble(y)); + } + + if(!PyVecTo(gPyGetScreenVect(self,argValue), vect)) + { + Py_DECREF(argValue); + PyErr_SetString(PyExc_TypeError, + "Error in getScreenRay. Invalid 2D coordinate. Expected a normalized 2D screen coordinate and an optional property argument"); + return NULL; + } + Py_DECREF(argValue); + + cam = gp_KetsjiScene->GetActiveCamera(); + dist *= -1.0; + + argValue = (propName?PyTuple_New(3):PyTuple_New(2)); + if (argValue) { + PyTuple_SET_ITEM(argValue, 0, PyObjectFrom(vect)); + PyTuple_SET_ITEM(argValue, 1, PyFloat_FromDouble(dist)); + if (propName) + PyTuple_SET_ITEM(argValue, 2, PyString_FromString(propName)); + + PyObject* ret= cam->PyrayCastTo(argValue,NULL); + Py_DECREF(argValue); + return ret; + } + + return NULL; +} + static PyObject* gPyGetWindowHeight(PyObject*, PyObject* args) { return PyInt_FromLong((gp_Canvas ? gp_Canvas->GetHeight() : 0)); @@ -897,6 +1018,12 @@ static PyObject* gPyDrawLine(PyObject*, PyObject* args) } static struct PyMethodDef rasterizer_methods[] = { + {"getScreenPosition",(PyCFunction) gPyGetScreenPosition, + METH_O, "getScreenPosition doc"}, + {"getScreenVect",(PyCFunction) gPyGetScreenVect, + METH_VARARGS, "getScreenVect doc"}, + {"getScreenRay",(PyCFunction) gPyGetScreenRay, + METH_VARARGS, "getScreenRay doc"}, {"getWindowWidth",(PyCFunction) gPyGetWindowWidth, METH_VARARGS, "getWindowWidth doc"}, {"getWindowHeight",(PyCFunction) gPyGetWindowHeight, diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 21ddf439924..abdd4c3eda1 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -82,7 +82,7 @@ class KX_GameObject: # (SCA_IObject) @ivar isValid: Retuerns fails when the object has been removed from the scene and can no longer be used. @type isValid: bool """ - def endObject(visible): + def endObject(): """ Delete this object, can be used inpace of the EndObject Actuator. The actual removal of the object from the scene is delayed. diff --git a/source/gameengine/PyDoc/Rasterizer.py b/source/gameengine/PyDoc/Rasterizer.py index 6a67cdcc71b..3a2d6408ac9 100644 --- a/source/gameengine/PyDoc/Rasterizer.py +++ b/source/gameengine/PyDoc/Rasterizer.py @@ -44,6 +44,49 @@ Example Uses an L{SCA_MouseSensor}, and two L{KX_ObjectActuator}s to implement M """ +def getScreenPosition(arg): + """ + Gets the position of an object projected on screen space. + + Example: + # For an object in the middle of the screen, coord = [0.5,0.5] + coord = Rasterizer.getScreenPosition(object) + + @param arg: L{KX_GameObject}, object name or list [x, y, z] + @rtype: list [x, y] + @return: the object's position in screen coordinates. + """ +def getScreenVect(x, y): + """ + Gets the vector from the camera position in the screen coordinate direction. + + Example: + # Gets the vector of the camera front direction: + m_vect = Rasterizer.getScreenVect(0.5,0.5) + + @type x: float + @type y: float + @rtype: 3d vector + @return: the vector from a screen coordinate. + """ +def getScreenRay(x, y, dist, property): + """ + Look towards a screen coordinate (x,y) and find first object hit within dist that matches prop. + The ray is similar to KX_GameObject->rayCastTo. + + Example: + # Gets an object with a property "wall" in front of the camera within a distance of 100: + target = Rasterizer.getScreenRay(0.5,0.5,100,"wall") + + @type x: float + @type y: float + @param dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other + @type dist: float + @param prop: property name that object must have; can be omitted => detect any object + @type prop: string + @rtype: L{KX_GameObject} + @return: the first object hit or None if no object or object does not match prop + """ def getWindowWidth(): """ Gets the width of the window (in pixels) -- cgit v1.2.3 From 327881c838eccb54b579bee0832b91b415022b01 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 23 Apr 2009 00:56:05 +0000 Subject: [#18574] small bug - warning for sce.link() depreciated displays even when sce.objects.link() is used Remove the warning since the func will sstay in 2.4x --- source/blender/python/api2_2x/Scene.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') diff --git a/source/blender/python/api2_2x/Scene.c b/source/blender/python/api2_2x/Scene.c index 6d10205c0e3..cfdfa5d3456 100644 --- a/source/blender/python/api2_2x/Scene.c +++ b/source/blender/python/api2_2x/Scene.c @@ -844,12 +844,15 @@ static PyObject *Scene_link( BPy_Scene * self, PyObject * args ) Scene *scene = self->scene; BPy_Object *bpy_obj; Object *object = NULL; + +#if 0 static char warning = 1; if( warning ) { printf("scene.link(ob) deprecated!\n\tuse scene.objects.link(ob) instead\n"); --warning; } +#endif SCENE_DEL_CHECK_PY(self); -- cgit v1.2.3 From 073abf70478965df98d0af61554d0e132dc5ade8 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 23 Apr 2009 02:27:11 +0000 Subject: BGE Dome update: * Enviroment Map implemented (replacing truncated mode 2). - Now it's possible to pre-bake animated (or static) EnvMaps to use with Cube Map textures. * Enabling 2DFilter in Dome mode - no GL_DEPTH_BUFFER supported though. * Tweaking GameSettings menu (centralizing buttons) --- source/blender/src/buttons_scene.c | 38 ++++--- source/gameengine/Ketsji/KX_Dome.cpp | 164 +++++++++++++++++++++++---- source/gameengine/Ketsji/KX_Dome.h | 3 +- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 4 +- 4 files changed, 166 insertions(+), 43 deletions(-) (limited to 'source') diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index f026e5f4034..577486135b4 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -1772,7 +1772,7 @@ static uiBlock *framing_render_menu(void *arg_unused) block= uiNewBlock(&curarea->uiblocks, "framing_options", UI_EMBOSS, UI_HELV, curarea->win); /* use this for a fake extra empy space around the buttons */ - uiDefBut(block, LABEL, 0, "", -5, -10, 295, 300, NULL, 0, 0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "", -5, -10, 295, 305, NULL, 0, 0, 0, 0, ""); uiDefBut(block, LABEL, 0, "Framing:", xco, yco, 68,19, 0, 0, 0, 0, 0, ""); uiBlockBeginAlign(block); @@ -1787,16 +1787,17 @@ static uiBlock *framing_render_menu(void *arg_unused) uiDefButF(block, COL, 0, "", 0, yco - 58 + 18, 33, 58, &G.scene->framing.col[0], 0, 0, 0, randomcolorindex, ""); uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, 0, "R ", xco,yco,243,18, &G.scene->framing.col[0], 0.0, 1.0, randomcolorindex, 0, "Set the red component of the bars"); + uiDefButF(block, NUMSLI, 0, "R ", xco,yco,240,18, &G.scene->framing.col[0], 0.0, 1.0, randomcolorindex, 0, "Set the red component of the bars"); yco -= 20; - uiDefButF(block, NUMSLI, 0, "G ", xco,yco,243,18, &G.scene->framing.col[1], 0.0, 1.0, randomcolorindex, 0, "Set the green component of the bars"); + uiDefButF(block, NUMSLI, 0, "G ", xco,yco,240,18, &G.scene->framing.col[1], 0.0, 1.0, randomcolorindex, 0, "Set the green component of the bars"); yco -= 20; - uiDefButF(block, NUMSLI, 0, "B ", xco,yco,243,18, &G.scene->framing.col[2], 0.0, 1.0, randomcolorindex, 0, "Set the blue component of the bars"); + uiDefButF(block, NUMSLI, 0, "B ", xco,yco,240,18, &G.scene->framing.col[2], 0.0, 1.0, randomcolorindex, 0, "Set the blue component of the bars"); uiBlockEndAlign(block); xco = 0; uiDefBut(block, LABEL, 0, "Fullscreen:", xco, yco-=30, 100, 19, 0, 0.0, 0.0, 0, 0, ""); - uiDefButS(block, TOG, 0, "Fullscreen", xco+70, yco, 68, 19, &G.scene->r.fullscreen, 0.0, 0.0, 0, 0, "Starts player in a new fullscreen display"); + uiDefButS(block, TOG, 0, "Fullscreen", xco+74, yco, 68, 19, &G.scene->r.fullscreen, 0.0, 0.0, 0, 0, "Starts player in a new fullscreen display"); + xco = 3; uiBlockBeginAlign(block); uiDefButS(block, NUM, 0, "X:", xco+40, yco-=27, 100, 19, &G.scene->r.xplay, 10.0, 2000.0, 0, 0, "Displays current X screen/window resolution. Click to change."); uiDefButS(block, NUM, 0, "Y:", xco+140, yco, 100, 19, &G.scene->r.yplay, 10.0, 2000.0, 0, 0, "Displays current Y screen/window resolution. Click to change."); @@ -1816,26 +1817,29 @@ static uiBlock *framing_render_menu(void *arg_unused) * RAS_STEREO_VINTERLACE 7 * RAS_STEREO_DOME 8 */ + + xco = 8; uiBlockBeginAlign(block); uiDefButS(block, ROW, 0, "No Stereo", xco, yco-=30, 88, 19, &(G.scene->r.stereomode), 7.0, 1.0, 0, 0, "Disables stereo"); - uiDefButS(block, ROW, 0, "Pageflip", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 2.0, 0, 0, "Enables hardware pageflip stereo method"); - uiDefButS(block, ROW, 0, "Syncdouble", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 3.0, 0, 0, "Enables syncdoubling stereo method"); - uiDefButS(block, ROW, 0, "Anaglyph", xco-=180, yco-=21, 88, 19, &(G.scene->r.stereomode), 7.0, 5.0, 0, 0, "Enables anaglyph (Red-Blue) stereo method"); - uiDefButS(block, ROW, 0, "Side by Side", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 6.0, 0, 0, "Enables side by side left and right images"); - uiDefButS(block, ROW, 0, "V Interlace", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 7.0, 0, 0, "Enables interlaced vertical strips for autostereo display"); + uiDefButS(block, ROW, 0, "Pageflip", xco+90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 2.0, 0, 0, "Enables hardware pageflip stereo method"); + uiDefButS(block, ROW, 0, "Syncdouble", xco+180, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 3.0, 0, 0, "Enables syncdoubling stereo method"); + uiDefButS(block, ROW, 0, "Anaglyph", xco, yco-=21, 88, 19, &(G.scene->r.stereomode), 7.0, 5.0, 0, 0, "Enables anaglyph (Red-Blue) stereo method"); + uiDefButS(block, ROW, 0, "Side by Side", xco+90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 6.0, 0, 0, "Enables side by side left and right images"); + uiDefButS(block, ROW, 0, "V Interlace", xco+180, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 7.0, 0, 0, "Enables interlaced vertical strips for autostereo display"); uiBlockEndAlign(block); + xco = 8; uiBlockBeginAlign(block); - uiDefButS(block, ROW, 0, "Dome", xco-=180, yco-=30, 88, 19, &(G.scene->r.stereomode), 7.0, 8.0, 0, 0, "Enables dome camera"); - uiDefButS(block, NUM, 0, "Ang:", xco+=90, yco, 88, 19, &G.scene->r.domeangle, 90.0, 250.0, 0, 0, "Angle (Aperture) of the Dome - it only works in mode 1"); - uiDefButS(block, NUM, 0, "Mode:", xco+=90, yco, 88, 19, &G.scene->r.domemode, 1.0, 3.0, 0, 0, "Dome mode - 1 fisheye, 2 truncated, 3 spherical panoramic"); + uiDefButS(block, ROW, 0, "Dome", xco, yco-=30, 88, 19, &(G.scene->r.stereomode), 7.0, 8.0, 0, 0, "Enables dome camera"); + uiDefButS(block, NUM, 0, "Ang:", xco+90, yco, 88, 19, &G.scene->r.domeangle, 90.0, 250.0, 0, 0, "Angle (Aperture) of the Dome - it only works in mode 1"); + uiDefButS(block, NUM, 0, "Mode:", xco+180, yco, 88, 19, &G.scene->r.domemode, 1.0, 3.0, 0, 0, "1 fisheye, 2 environment map, 3 spherical panoramic"); - uiDefButF(block, NUM, 0, "Size:", xco-=180, yco-=21, 88, 19, &G.scene->r.domesize, 0.5, 3.5, 0, 0, "Size adjustments"); - uiDefButS(block, NUM, 0, "Tes:", xco+=90, yco, 88, 19, &G.scene->r.domeres, 1.0, 8.0, 0, 0, "Tesselation level - 1 to 8"); - uiDefButF(block, NUM, 0, "Res:", xco+=90, yco, 88, 19, &G.scene->r.domeresbuf, 0.1, 1.0, 0, 0, "Buffer Resolution - decrease it to increase speed"); + uiDefButF(block, NUM, 0, "Size:", xco, yco-=21, 88, 19, &G.scene->r.domesize, 0.5, 3.5, 0, 0, "Size adjustments"); + uiDefButS(block, NUM, 0, "Tes:", xco+90, yco, 88, 19, &G.scene->r.domeres, 1.0, 8.0, 0, 0, "Tesselation level - 1 to 8"); + uiDefButF(block, NUM, 0, "Res:", xco+180, yco, 88, 19, &G.scene->r.domeresbuf, 0.1, 1.0, 0, 0, "Buffer Resolution - decrease it to increase speed"); - uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Warp Data: ", xco-180,yco-=21,268, 19, &G.scene->r.dometext, "Custom Warp Mesh data file"); + uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Warp Data: ", xco,yco-=21,268, 19, &G.scene->r.dometext, "Custom Warp Mesh data file"); uiBlockEndAlign(block); uiBlockSetDirection(block, UI_TOP); diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index 321370f9f3f..bcff00af76c 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -107,15 +107,9 @@ KX_Dome::KX_Dome ( CreateMeshDome250(); m_numfaces = 5; } break; - case DOME_TRUNCATED: - cubetop.resize(1); - cubebottom.resize(1); - cubeleft.resize(2); - cuberight.resize(2); - - m_angle = 180; - CreateMeshDome180(); - m_numfaces = 4; + case DOME_ENVMAP: + m_angle = 360; + m_numfaces = 6; break; case DOME_PANORAM_SPH: cubeleft.resize(2); @@ -240,7 +234,7 @@ bool KX_Dome::CreateDL(){ dlistId = glGenLists((GLsizei) m_numimages); if (dlistId != 0) { - if(m_mode == DOME_FISHEYE || m_mode == DOME_TRUNCATED){ + if(m_mode == DOME_FISHEYE){ glNewList(dlistId, GL_COMPILE); GLDrawTriangles(cubetop, nfacestop); glEndList(); @@ -386,7 +380,7 @@ void KX_Dome::GLDrawWarpQuads(void) } glEnd(); } else{ - printf("Error: Warp Mode unsupported. Try 1 for Polar Mesh or 2 for Fisheye.\n"); + printf("Error: Warp Mode %d unsupported. Try 1 for Polar Mesh or 2 for Fisheye.\n", warp.mode); } } @@ -1415,7 +1409,7 @@ Uses 6 cameras for angles up to 360 MT_Scalar c = cos(deg45); MT_Scalar s = sin(deg45); - if ((m_mode == DOME_FISHEYE && m_angle <= 180)|| m_mode == DOME_TRUNCATED){ + if ((m_mode == DOME_FISHEYE && m_angle <= 180)){ m_locRot[0] = MT_Matrix3x3( // 90º - Top c, -s, 0.0, @@ -1437,7 +1431,7 @@ Uses 6 cameras for angles up to 360 0.0, 1.0, 0.0, s, 0.0, c); - } else if ((m_mode == DOME_FISHEYE && m_angle > 180)){ + } else if ((m_mode == DOME_FISHEYE && m_angle > 180) || m_mode == DOME_ENVMAP){ m_locRot[0] = MT_Matrix3x3( // 90º - Top 1.0, 0.0, 0.0, @@ -1464,7 +1458,7 @@ Uses 6 cameras for angles up to 360 0.0, 1.0, 0.0, 0.0, 0.0, 1.0); - m_locRot[5] = MT_Matrix3x3( // 180º - Back - NOT USING + m_locRot[5] = MT_Matrix3x3( // 180º - Back - USED for ENVMAP only -1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0,-1.0); @@ -1531,8 +1525,8 @@ void KX_Dome::Draw(void) case DOME_FISHEYE: DrawDomeFisheye(); break; - case DOME_TRUNCATED: - DrawDomeFisheye(); + case DOME_ENVMAP: + DrawEnvMap(); break; case DOME_PANORAM_SPH: DrawPanorama(); @@ -1547,7 +1541,7 @@ void KX_Dome::Draw(void) } } -void KX_Dome::DrawDomeFisheye(void) +void KX_Dome::DrawEnvMap(void) { int i,j; @@ -1563,17 +1557,141 @@ void KX_Dome::DrawDomeFisheye(void) float ortho_width, ortho_height; if (warp.usemesh) - glOrtho((-1.0), 1.0, (-1.0), 1.0, -20.0, 10.0); //stretch the image to reduce resolution lost + glOrtho((-1.0), 1.0, (-0.66), 0.66, -20.0, 10.0); //stretch the image to reduce resolution lost - else if(m_mode == DOME_TRUNCATED){ - ortho_width = 1.0; - ortho_height = 2 * ((float)can_height/can_width) - 1.0 ; + else { + if (can_width/3 <= can_height/2){ + ortho_width = 1.0; + ortho_height = (float)can_height/can_width; + }else{ + ortho_height = 2.0f / 3; + ortho_width = (float)can_width/can_height * ortho_height; + } ortho_width /= m_size; ortho_height /= m_size; + + glOrtho((-ortho_width), ortho_width, (-ortho_height), ortho_height, -20.0, 10.0); + } + + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + gluLookAt(0.0,0.0,1.0, 0.0,0.0,0.0, 0.0,1.0,0.0); + + glPolygonMode(GL_FRONT, GL_FILL); + glShadeModel(GL_SMOOTH); + glDisable(GL_LIGHTING); + glDisable(GL_DEPTH_TEST); + + glEnable(GL_TEXTURE_2D); + glColor3f(1.0,1.0,1.0); + + float uv_ratio = (float)(m_buffersize-1) / m_imagesize; + double onebythree = 1.0f / 3; + + // domefacesId[0] => (top) + glBindTexture(GL_TEXTURE_2D, domefacesId[0]); + glBegin(GL_QUADS); + glTexCoord2f(uv_ratio,uv_ratio); + glVertex3f( onebythree, 0.0f, 3.0f); + glTexCoord2f(0.0,uv_ratio); + glVertex3f(-onebythree, 0.0f, 3.0f); + glTexCoord2f(0.0,0.0); + glVertex3f(-onebythree,-2 * onebythree, 3.0f); + glTexCoord2f(uv_ratio,0.0); + glVertex3f(onebythree,-2 * onebythree, 3.0f); + glEnd(); + + // domefacesId[1] => (bottom) + glBindTexture(GL_TEXTURE_2D, domefacesId[1]); + glBegin(GL_QUADS); + glTexCoord2f(uv_ratio,uv_ratio); + glVertex3f(-onebythree, 0.0f, 3.0f); + glTexCoord2f(0.0,uv_ratio); + glVertex3f(-1.0f, 0.0f, 3.0f); + glTexCoord2f(0.0,0.0); + glVertex3f(-1.0f,-2 * onebythree, 3.0f); + glTexCoord2f(uv_ratio,0.0); + glVertex3f(-onebythree,-2 * onebythree, 3.0f); + glEnd(); + + // domefacesId[2] => -90º (left) + glBindTexture(GL_TEXTURE_2D, domefacesId[2]); + glBegin(GL_QUADS); + glTexCoord2f(uv_ratio,uv_ratio); + glVertex3f(-onebythree, 2 * onebythree, 3.0f); + glTexCoord2f(0.0,uv_ratio); + glVertex3f(-1.0f, 2 * onebythree, 3.0f); + glTexCoord2f(0.0,0.0); + glVertex3f(-1.0f, 0.0f, 3.0f); + glTexCoord2f(uv_ratio,0.0); + glVertex3f(-onebythree, 0.0f, 3.0f); + glEnd(); + + // domefacesId[3] => 90º (right) + glBindTexture(GL_TEXTURE_2D, domefacesId[3]); + glBegin(GL_QUADS); + glTexCoord2f(uv_ratio,uv_ratio); + glVertex3f( 1.0f, 2 * onebythree, 3.0f); + glTexCoord2f(0.0,uv_ratio); + glVertex3f( onebythree, 2 * onebythree, 3.0f); + glTexCoord2f(0.0,0.0); + glVertex3f( onebythree, 0.0f, 3.0f); + glTexCoord2f(uv_ratio,0.0); + glVertex3f(1.0f, 0.0f, 3.0f); + glEnd(); + + // domefacesId[4] => 0º (front) + glBindTexture(GL_TEXTURE_2D, domefacesId[4]); + glBegin(GL_QUADS); + glTexCoord2f(uv_ratio,uv_ratio); + glVertex3f( 1.0f, 0.0f, 3.0f); + glTexCoord2f(0.0,uv_ratio); + glVertex3f( onebythree, 0.0f, 3.0f); + glTexCoord2f(0.0,0.0); + glVertex3f( onebythree,-2 * onebythree, 3.0f); + glTexCoord2f(uv_ratio,0.0); + glVertex3f(1.0f, -2 * onebythree, 3.0f); + glEnd(); + + // domefacesId[5] => 180º (back) + glBindTexture(GL_TEXTURE_2D, domefacesId[5]); + glBegin(GL_QUADS); + glTexCoord2f(uv_ratio,uv_ratio); + glVertex3f( onebythree, 2 * onebythree, 3.0f); + glTexCoord2f(0.0,uv_ratio); + glVertex3f(-onebythree, 2 * onebythree, 3.0f); + glTexCoord2f(0.0,0.0); + glVertex3f(-onebythree, 0.0f, 3.0f); + glTexCoord2f(uv_ratio,0.0); + glVertex3f(onebythree, 0.0f, 3.0f); + glEnd(); + + glDisable(GL_TEXTURE_2D); + glEnable(GL_DEPTH_TEST); +} + +void KX_Dome::DrawDomeFisheye(void) +{ + int i,j; + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + // Making the viewport always square + + int can_width = m_viewport.GetRight(); + int can_height = m_viewport.GetTop(); + + float ortho_width, ortho_height; - glOrtho((-ortho_width), ortho_width, (-ortho_height), ortho_width, -20.0, 10.0); - } else { + if (warp.usemesh) + glOrtho((-1.0), 1.0, (-1.0), 1.0, -20.0, 10.0); //stretch the image to reduce resolution lost + + else { if (can_width < can_height){ ortho_width = 1.0; ortho_height = (float)can_height/can_width; diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h index de3360cd897..762b09e6429 100644 --- a/source/gameengine/Ketsji/KX_Dome.h +++ b/source/gameengine/Ketsji/KX_Dome.h @@ -42,7 +42,7 @@ Developed as part of a Research and Development project for SAT - La Soci //Dome modes: limit hardcoded in buttons_scene.c #define DOME_FISHEYE 1 -#define DOME_TRUNCATED 2 +#define DOME_ENVMAP 2 #define DOME_PANORAM_SPH 3 #define DOME_NUM_MODES 4 @@ -131,6 +131,7 @@ public: void GLDrawWarpQuads(void); void Draw(void); void DrawDomeFisheye(void); + void DrawEnvMap(void); void DrawPanorama(void); void DrawDomeWarped(void); diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index a9206c1bb8f..ef43d6b176c 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -353,7 +353,6 @@ void KX_KetsjiEngine::RenderDome() m_dome->BindImages(i); } -// m_dome->Dome_PostRender(scene, cam, stereomode); m_canvas->EndFrame();//XXX do we really need that? m_canvas->SetViewPort(0, 0, m_canvas->GetWidth(), m_canvas->GetHeight()); @@ -381,7 +380,8 @@ void KX_KetsjiEngine::RenderDome() m_dome->Draw(); - //run 2dfilters + // run the 2dfilters and motion blur once for all the scenes + PostRenderFrame(); EndFrame(); } -- cgit v1.2.3 From ad8e98bccd01ef7ae0e0499473a7032b105ebc70 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Thu, 23 Apr 2009 06:07:51 +0000 Subject: == SEQUENCER == This fixes [#18079] Sequencer color correction does not apply on float image if "make float" is not applied and closes [#18582] bug fix #18079 by removing ibuf->rect on image load if ibuf->rect_float is used. (Don't know, why the OpenEXR loader does that, but I fix this on sequencer side for now...) --- source/blender/src/sequence.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source') diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index ca4cf4df614..d056f345249 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -1761,6 +1761,11 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, if (!se->ibuf) { se->ibuf= IMB_loadiffname( name, IB_rect); + /* we don't need both (speed reasons)! */ + if (se->ibuf->rect_float && se->ibuf->rect) { + imb_freerectImBuf(se->ibuf); + } + copy_to_ibuf_still(seq, se); } @@ -1791,6 +1796,12 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, if(seq->anim) { IMB_anim_set_preseek(seq->anim, seq->anim_preseek); se->ibuf = IMB_anim_absolute(seq->anim, se->nr + seq->anim_startofs); + /* we don't need both (speed reasons)! */ + if (se->ibuf->rect_float + && se->ibuf->rect) { + imb_freerectImBuf(se->ibuf); + } + } copy_to_ibuf_still(seq, se); } -- cgit v1.2.3 From 960581fcc9b0ce937753bed6e6f41209b2359b14 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Thu, 23 Apr 2009 07:40:01 +0000 Subject: == Sequencer == Fixes: [#18489] Adding (add filter) nested strips causes Blender VSE to segfault on frame render. [#18209] 3 VSE crash bugs with .blends (all left click and move mouse over Metastrip/Blend Mode related) ... and a new segfault I introduced with my last commit. Also: memcache limiter refcounts are tested now in critical places, printing an error message, since doing refcounting right is, well, hard. --- source/blender/src/sequence.c | 94 ++++++++++++++++++++++++++++++++----------- 1 file changed, 71 insertions(+), 23 deletions(-) (limited to 'source') diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index d056f345249..cd42c3d4085 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -1672,6 +1672,41 @@ static void free_metastrip_imbufs(ListBase *seqbasep, int cfra, int chanshown) } +static void check_limiter_refcount(const char * func, TStripElem *se) +{ + if (se && se->ibuf) { + int refcount = IMB_cache_limiter_get_refcount(se->ibuf); + if (refcount != 1) { + /* can happen on complex pipelines */ + if (refcount > 1 && (G.f & G_DEBUG) == 0) { + return; + } + + fprintf(stderr, + "sequencer: (ibuf) %s: " + "suspicious memcache " + "limiter refcount: %d\n", func, refcount); + } + } +} + +static void check_limiter_refcount_comp(const char * func, TStripElem *se) +{ + if (se && se->ibuf_comp) { + int refcount = IMB_cache_limiter_get_refcount(se->ibuf_comp); + if (refcount != 1) { + /* can happen on complex pipelines */ + if (refcount > 1 && (G.f & G_DEBUG) == 0) { + return; + } + fprintf(stderr, + "sequencer: (ibuf comp) %s: " + "suspicious memcache " + "limiter refcount: %d\n", func, refcount); + } + } +} + static TStripElem* do_build_seq_array_recursively( ListBase *seqbasep, int cfra, int chanshown); @@ -1686,18 +1721,23 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, if(seq->type == SEQ_META) { TStripElem * meta_se = 0; + int use_preprocess = FALSE; use_limiter = FALSE; if (!build_proxy_run && se->ibuf == 0) { se->ibuf = seq_proxy_fetch(seq, cfra); if (se->ibuf) { use_limiter = TRUE; + use_preprocess = TRUE; } } if(!se->ibuf && seq->seqbase.first) { meta_se = do_build_seq_array_recursively( &seq->seqbase, seq->start + se->nr, 0); + + check_limiter_refcount("do_build_seq_ibuf: for META", + meta_se); } se->ok = STRIPELEM_OK; @@ -1719,14 +1759,17 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, se->ibuf = i; use_limiter = TRUE; + use_preprocess = TRUE; } + } else if (se->ibuf) { + use_limiter = TRUE; } if (meta_se) { free_metastrip_imbufs( &seq->seqbase, seq->start + se->nr, 0); } - if (use_limiter) { + if (use_preprocess) { input_preprocess(seq, se, cfra); } } else if(seq->type & SEQ_EFFECT) { @@ -1762,7 +1805,8 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, se->ibuf= IMB_loadiffname( name, IB_rect); /* we don't need both (speed reasons)! */ - if (se->ibuf->rect_float && se->ibuf->rect) { + if (se->ibuf && + se->ibuf->rect_float && se->ibuf->rect) { imb_freerectImBuf(se->ibuf); } @@ -1797,7 +1841,8 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, IMB_anim_set_preseek(seq->anim, seq->anim_preseek); se->ibuf = IMB_anim_absolute(seq->anim, se->nr + seq->anim_startofs); /* we don't need both (speed reasons)! */ - if (se->ibuf->rect_float + if (se->ibuf + && se->ibuf->rect_float && se->ibuf->rect) { imb_freerectImBuf(se->ibuf); } @@ -1972,6 +2017,7 @@ static void do_effect_seq_recursively(Sequence * seq, TStripElem *se, int cfra) if (se->se3 && se->se3->ibuf) { IMB_cache_limiter_unref(se->se3->ibuf); } + check_limiter_refcount("do_effect_seq_recursively", se); } static TStripElem* do_build_seq_recursively_impl(Sequence * seq, int cfra) @@ -1987,6 +2033,7 @@ static TStripElem* do_build_seq_recursively_impl(Sequence * seq, int cfra) do_build_seq_ibuf(seq, se, cfra, FALSE); } } + check_limiter_refcount("do_build_seq_recursively_impl", se); return se; } @@ -2098,6 +2145,8 @@ static TStripElem* do_handle_speed_effect(Sequence * seq, int cfra) if (se2 && se2->ibuf) IMB_cache_limiter_unref(se2->ibuf); + check_limiter_refcount("do_handle_speed_effect", se); + return se; } @@ -2115,20 +2164,17 @@ static TStripElem* do_handle_speed_effect(Sequence * seq, int cfra) static TStripElem* do_build_seq_recursively(Sequence * seq, int cfra) { + TStripElem* se; if (seq->type == SEQ_SPEED) { - return do_handle_speed_effect(seq, cfra); + se = do_handle_speed_effect(seq, cfra); } else { - return do_build_seq_recursively_impl(seq, cfra); + se = do_build_seq_recursively_impl(seq, cfra); } -} -/* Bug: 18209 - * when dragging the mouse over a metastrip, on mouse-up for some unknown - * reason in some cases the metastrips TStripElem->ibuf->rect is NULL, - * This should be fixed but I had a look and couldnt work out why its - * happening so for now workaround with a NULL check - campbell */ + check_limiter_refcount("do_build_seq_recursively", se); -#define SEQ_SPECIAL_SEQ_UPDATE_WORKAROUND + return se; +} static TStripElem* do_build_seq_array_recursively( ListBase *seqbasep, int cfra, int chanshown) @@ -2191,6 +2237,9 @@ static TStripElem* do_build_seq_array_recursively( se->ibuf_comp = IMB_allocImBuf( (short)seqrectx, (short)seqrecty, 32, IB_rect, 0); + IMB_cache_limiter_insert(se->ibuf_comp); + IMB_cache_limiter_ref(se->ibuf_comp); + IMB_cache_limiter_touch(se->ibuf_comp); } break; } @@ -2221,6 +2270,9 @@ static TStripElem* do_build_seq_array_recursively( se->ibuf_comp = IMB_allocImBuf( (short)seqrectx, (short)seqrecty, 32, IB_rect, 0); + IMB_cache_limiter_insert(se->ibuf_comp); + IMB_cache_limiter_ref(se->ibuf_comp); + IMB_cache_limiter_touch(se->ibuf_comp); } break; case 1: @@ -2239,6 +2291,9 @@ static TStripElem* do_build_seq_array_recursively( se->ibuf = IMB_allocImBuf( (short)seqrectx, (short)seqrecty, 32, IB_rect, 0); + IMB_cache_limiter_insert(se->ibuf); + IMB_cache_limiter_ref(se->ibuf); + IMB_cache_limiter_touch(se->ibuf); } if (i == 0) { se->ibuf_comp = se->ibuf; @@ -2297,13 +2352,6 @@ static TStripElem* do_build_seq_array_recursively( IMB_rect_from_float(se2->ibuf); } -#ifdef SEQ_SPECIAL_SEQ_UPDATE_WORKAROUND - if (se2->ibuf->rect==NULL && se2->ibuf->rect_float==NULL) { - printf("ERROR: sequencer se2->ibuf missing buffer\n"); - } else if (se1->ibuf && se1->ibuf->rect==NULL && se1->ibuf->rect_float==NULL) { - printf("ERROR: sequencer se1->ibuf missing buffer\n"); - } else { -#endif /* bad hack, to fix crazy input ordering of those two effects */ @@ -2325,10 +2373,6 @@ static TStripElem* do_build_seq_array_recursively( se2->ibuf_comp); } -#ifdef SEQ_SPECIAL_SEQ_UPDATE_WORKAROUND - } -#endif - IMB_cache_limiter_insert(se2->ibuf_comp); IMB_cache_limiter_ref(se2->ibuf_comp); IMB_cache_limiter_touch(se2->ibuf_comp); @@ -2383,6 +2427,8 @@ static ImBuf *give_ibuf_seq_impl(int rectx, int recty, int cfra, int chanshown) return 0; } + check_limiter_refcount_comp("give_ibuf_seq_impl", se); + return se->ibuf_comp; } @@ -2400,6 +2446,8 @@ ImBuf *give_ibuf_seq_direct(int rectx, int recty, int cfra, return 0; } + check_limiter_refcount("give_ibuf_seq_direct", se); + if (se->ibuf) { IMB_cache_limiter_unref(se->ibuf); } -- cgit v1.2.3 From 09c341c3bdc28dd4f62b31158ab891a5bcc6004d Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 23 Apr 2009 09:59:19 +0000 Subject: Make: removing hidden directories from .app failed. --- source/darwin/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/darwin/Makefile b/source/darwin/Makefile index f7b513fc214..e2c6f754831 100644 --- a/source/darwin/Makefile +++ b/source/darwin/Makefile @@ -50,7 +50,7 @@ ifeq ($(APPLICATION), blender) @cp -R $(NANBLENDERHOME)/bin/.blender $(DIR)/bin/$(APPLICATION).app/Contents/MacOS @cp -R $(NANBLENDERHOME)/release/scripts $(DIR)/bin/$(APPLICATION).app/Contents/MacOS/.blender/ endif - @echo "---> removing CVS directories and Mac hidden files from distribution" + @echo "---> removing SVN directories and Mac hidden files from distribution" @find $(DIR)/bin/$(APPLICATION).app -name CVS -prune -exec rm -rf {} \; @find $(DIR)/bin/$(APPLICATION).app -name .DS_Store -exec rm -f {} \; - @find $(DIR)/bin/$(APPLICATION).app -name .svn -exec rm -rf {} \; + @find $(DIR)/bin/$(APPLICATION).app -name .svn -prune -exec rm -rf {} \; -- cgit v1.2.3 From 70f1b45430b09e3d522b3633645e180d725de82c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 23 Apr 2009 13:30:34 +0000 Subject: Fix for part of bug #18496: issue with light state switching when using Dome. --- .../BlenderRoutines/KX_BlenderRenderTools.cpp | 2 +- .../GamePlayer/common/GPC_RenderTools.cpp | 2 +- source/gameengine/Ketsji/KX_Dome.cpp | 35 ++++++++-------------- source/gameengine/Ketsji/KX_Dome.h | 3 +- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 6 ++-- 5 files changed, 20 insertions(+), 28 deletions(-) (limited to 'source') diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp index 9dbda3f195b..e393b6d9af4 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp @@ -68,8 +68,8 @@ void KX_BlenderRenderTools::BeginFrame(RAS_IRasterizer* rasty) { m_clientobject = NULL; m_lastlightlayer = -1; - m_lastlighting = false; m_lastauxinfo = NULL; + m_lastlighting = true; /* force disable in DisableOpenGLLights() */ DisableOpenGLLights(); } diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index eafdb8a96bb..1a0d985a864 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -76,8 +76,8 @@ void GPC_RenderTools::BeginFrame(RAS_IRasterizer* rasty) { m_clientobject = NULL; m_lastlightlayer = -1; - m_lastlighting = false; m_lastauxinfo = NULL; + m_lastlighting = true; /* force disable in DisableOpenGLLights() */ DisableOpenGLLights(); } diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index bcff00af76c..077e2ce33b7 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -52,18 +52,18 @@ KX_Dome::KX_Dome ( struct Text* warptext ): - m_canvas(canvas), - m_rasterizer(rasterizer), - m_rendertools(rendertools), - m_engine(engine), + dlistSupported(false), + canvaswidth(-1), canvasheight(-1), m_drawingmode(engine->GetDrawType()), m_size(size), m_resolution(res), m_mode(mode), m_angle(angle), m_resbuffer(resbuf), - canvaswidth(-1), canvasheight(-1), - dlistSupported(false) + m_canvas(canvas), + m_rasterizer(rasterizer), + m_rendertools(rendertools), + m_engine(engine) { warp.usemesh = false; @@ -206,7 +206,7 @@ void KX_Dome::CalculateImageSize(void) canvasheight = m_canvas->GetHeight(); m_buffersize = (canvaswidth > canvasheight?canvasheight:canvaswidth); - m_buffersize *= m_resbuffer; //reduce buffer size for better performance + m_buffersize = (int)(m_buffersize*m_resbuffer); //reduce buffer size for better performance int i = 0; while ((1 << i) <= m_buffersize) @@ -230,8 +230,6 @@ void KX_Dome::CalculateImageSize(void) } bool KX_Dome::CreateDL(){ - int i,j; - dlistId = glGenLists((GLsizei) m_numimages); if (dlistId != 0) { if(m_mode == DOME_FISHEYE){ @@ -409,7 +407,7 @@ y varies from -1 to 1 u and v vary from 0 to 1 i ranges from 0 to 1, if negative don't draw that mesh node */ - int i,j,k; + int i; int nodeX=0, nodeY=0; vector columns, lines; @@ -431,7 +429,7 @@ i ranges from 0 to 1, if negative don't draw that mesh node warp.n_width = atoi(columns[0]); warp.n_height = atoi(columns[1]); - if (lines.size() < 2 + (warp.n_width * warp.n_height)){ + if ((int)lines.size() < 2 + (warp.n_width * warp.n_height)){ printf("Error: Warp Mesh File with insufficient data!\n"); return false; }else{ @@ -1543,8 +1541,6 @@ void KX_Dome::Draw(void) void KX_Dome::DrawEnvMap(void) { - int i,j; - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -1675,7 +1671,7 @@ void KX_Dome::DrawEnvMap(void) void KX_Dome::DrawDomeFisheye(void) { - int i,j; + int i; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); @@ -1759,7 +1755,7 @@ void KX_Dome::DrawDomeFisheye(void) void KX_Dome::DrawPanorama(void) { - int i,j; + int i; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -1846,8 +1842,6 @@ void KX_Dome::DrawPanorama(void) void KX_Dome::DrawDomeWarped(void) { - int i,j; - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -1880,10 +1874,6 @@ void KX_Dome::DrawDomeWarped(void) glEnable(GL_TEXTURE_2D); glColor3f(1.0,1.0,1.0); - - float uv_width = (float)(warp.bufferwidth-1) / warp.imagewidth; - float uv_height = (float)(warp.bufferheight-1) / warp.imageheight; - if (dlistSupported){ glBindTexture(GL_TEXTURE_2D, domefacesId[m_numfaces]); glCallList(dlistId + m_numfaces); @@ -1934,4 +1924,5 @@ void KX_Dome::RenderDomeFrame(KX_Scene* scene, KX_Camera* cam, int i) // restore the original orientation cam->NodeSetLocalOrientation(camori); cam->NodeUpdateGS(0.f); -} \ No newline at end of file +} + diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h index 762b09e6429..84f0c5c72ed 100644 --- a/source/gameengine/Ketsji/KX_Dome.h +++ b/source/gameengine/Ketsji/KX_Dome.h @@ -181,4 +181,5 @@ protected: KX_KetsjiEngine* m_engine; }; -#endif \ No newline at end of file +#endif + diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index ef43d6b176c..63db54a296e 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -145,8 +145,6 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system) m_stereo(false), m_curreye(0), - m_usedome(false), - m_logger(NULL), // Set up timing info display variables @@ -164,7 +162,9 @@ KX_KetsjiEngine::KX_KetsjiEngine(KX_ISystem* system) m_overrideFrameColor(false), m_overrideFrameColorR(0.0), m_overrideFrameColorG(0.0), - m_overrideFrameColorB(0.0) + m_overrideFrameColorB(0.0), + + m_usedome(false) { // Initialize the time logger m_logger = new KX_TimeCategoryLogger (25); -- cgit v1.2.3 From 67b3e1a07b61f4bfccdd120e04942367ae3c8088 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 23 Apr 2009 20:30:01 +0000 Subject: BGE bug #17863: Shaky game camera. --- .../Physics/Bullet/CcdPhysicsController.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 0b9da8f46d3..b944ae085ba 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -572,10 +572,22 @@ bool CcdPhysicsController::SynchronizeMotionStates(float time) btSoftBody* sb = GetSoftBody(); if (sb) { - btVector3 aabbMin,aabbMax; - sb->getAabb(aabbMin,aabbMax); - btVector3 worldPos = (aabbMax+aabbMin)*0.5f; - m_MotionState->setWorldPosition(worldPos[0],worldPos[1],worldPos[2]); + if (sb->m_pose.m_bframe) + { + btVector3 worldPos = sb->m_pose.m_com; + btQuaternion worldquat; + btMatrix3x3 trs = sb->m_pose.m_rot*sb->m_pose.m_scl; + trs.getRotation(worldquat); + m_MotionState->setWorldPosition(worldPos[0],worldPos[1],worldPos[2]); + m_MotionState->setWorldOrientation(worldquat[0],worldquat[1],worldquat[2],worldquat[3]); + } + else + { + btVector3 aabbMin,aabbMax; + sb->getAabb(aabbMin,aabbMax); + btVector3 worldPos = (aabbMax+aabbMin)*0.5f; + m_MotionState->setWorldPosition(worldPos[0],worldPos[1],worldPos[2]); + } m_MotionState->calculateWorldTransformations(); return true; } -- cgit v1.2.3 From 0feaedfa9af37be8ae9cd1bb29a242921bf51ae0 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 23 Apr 2009 21:19:42 +0000 Subject: BGE bug #17950: crash when GE softbody is parented to a rigid body/soft body/dynamic object. --- source/gameengine/Converter/BL_BlenderDataConversion.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index b7f74d57ca4..84b7407aacf 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1528,6 +1528,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, objprop.m_dynamic_parent = parentgameobject; //cannot be dynamic: objprop.m_dyna = false; + objprop.m_softbody = false; shapeprops->m_mass = 0.f; } -- cgit v1.2.3 From a5f4d7cb53682a944eee0f10bbae77f3b0465417 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 24 Apr 2009 07:45:17 +0000 Subject: BGE PyAPI epydoc errors fixed --- source/gameengine/PyDoc/GameKeys.py | 4 ++-- source/gameengine/PyDoc/KX_ConstraintActuator.py | 18 +++++++++--------- source/gameengine/PyDoc/KX_GameObject.py | 2 +- source/gameengine/PyDoc/KX_SoundActuator.py | 16 ++++++++-------- source/gameengine/PyDoc/KX_StateActuator.py | 16 ++++++++-------- source/gameengine/PyDoc/Rasterizer.py | 4 ++-- 6 files changed, 30 insertions(+), 30 deletions(-) (limited to 'source') diff --git a/source/gameengine/PyDoc/GameKeys.py b/source/gameengine/PyDoc/GameKeys.py index 310f2b0d506..14cd7e4f25c 100644 --- a/source/gameengine/PyDoc/GameKeys.py +++ b/source/gameengine/PyDoc/GameKeys.py @@ -174,8 +174,8 @@ def EventToCharacter(event, shift): @type event: int @param event: key event from GameKeys or the keyboard sensor. - @type event: bool - @param event: set to true if shift is held. + @type shift: bool + @param shift: set to true if shift is held. @rtype: string """ diff --git a/source/gameengine/PyDoc/KX_ConstraintActuator.py b/source/gameengine/PyDoc/KX_ConstraintActuator.py index a30b859548b..89ca4d80c73 100644 --- a/source/gameengine/PyDoc/KX_ConstraintActuator.py +++ b/source/gameengine/PyDoc/KX_ConstraintActuator.py @@ -19,15 +19,15 @@ class KX_ConstraintActuator(SCA_IActuator): @type direction: 3-tuple of float: [x,y,z] @ivar option: Binary combination of the following values: - Applicable to Distance constraint: - KX_ACT_CONSTRAINT_NORMAL ( 64) : Activate alignment to surface - KX_ACT_CONSTRAINT_DISTANCE ( 512) : Activate distance control - KX_ACT_CONSTRAINT_LOCAL (1024) : direction of the ray is along the local axis - Applicable to Force field constraint: - KX_ACT_CONSTRAINT_DOROTFH (2048) : Force field act on rotation as well - Applicable to both: - KX_ACT_CONSTRAINT_MATERIAL ( 128) : Detect material rather than property - KX_ACT_CONSTRAINT_PERMANENT ( 256) : No deactivation if ray does not hit target + Applicable to Distance constraint: + - KX_ACT_CONSTRAINT_NORMAL ( 64) : Activate alignment to surface + - KX_ACT_CONSTRAINT_DISTANCE ( 512) : Activate distance control + - KX_ACT_CONSTRAINT_LOCAL (1024) : direction of the ray is along the local axis + Applicable to Force field constraint: + - KX_ACT_CONSTRAINT_DOROTFH (2048) : Force field act on rotation as well + Applicable to both: + - KX_ACT_CONSTRAINT_MATERIAL ( 128) : Detect material rather than property + - KX_ACT_CONSTRAINT_PERMANENT ( 256) : No deactivation if ray does not hit target @type option: integer @ivar time: activation time of the actuator. The actuator disables itself after this many frame. diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index abdd4c3eda1..db0aebfc761 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -110,7 +110,7 @@ class KX_GameObject: # (SCA_IObject) """ Sets the game object's occlusion capability. - @type visible: boolean + @type occlusion: boolean @type recursive: boolean @param recursive: optional argument to set all childrens occlusion flag too. """ diff --git a/source/gameengine/PyDoc/KX_SoundActuator.py b/source/gameengine/PyDoc/KX_SoundActuator.py index 37ae3c6640d..0aec57c851c 100644 --- a/source/gameengine/PyDoc/KX_SoundActuator.py +++ b/source/gameengine/PyDoc/KX_SoundActuator.py @@ -36,20 +36,20 @@ class KX_SoundActuator(SCA_IActuator): @type orientation: 3x3 matrix [[float]] @ivar type: Sets the operation mode of the actuator. You can use one of the following constant: - KX_SOUNDACT_PLAYSTOP (1) - KX_SOUNDACT_PLAYEND (2) - KX_SOUNDACT_LOOPSTOP (3) - KX_SOUNDACT_LOOPEND (4) - KX_SOUNDACT_LOOPBIDIRECTIONAL (5) - KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP (6) + - KX_SOUNDACT_PLAYSTOP (1) + - KX_SOUNDACT_PLAYEND (2) + - KX_SOUNDACT_LOOPSTOP (3) + - KX_SOUNDACT_LOOPEND (4) + - KX_SOUNDACT_LOOPBIDIRECTIONAL (5) + - KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP (6) @type type: integer - @group Play Methods: startSound, pauseSound, stopSound. + @group Play Methods: startSound, pauseSound, stopSound """ def setFilename(filename): """ DEPRECATED: Use the filename property instead. - Sets the filename of the sound this actuator plays. + Sets the filename of the sound this actuator plays. @type filename: string """ diff --git a/source/gameengine/PyDoc/KX_StateActuator.py b/source/gameengine/PyDoc/KX_StateActuator.py index fe3669d3809..d9785ad13fa 100644 --- a/source/gameengine/PyDoc/KX_StateActuator.py +++ b/source/gameengine/PyDoc/KX_StateActuator.py @@ -9,17 +9,17 @@ class KX_StateActuator(SCA_IActuator): Property: @ivar operation: type of bit operation to be applied on object state mask. - You can use one of the following constant: - KX_STATE_OP_CPY (0) : Copy state mask - KX_STATE_OP_SET (1) : Add bits to state mask - KX_STATE_OP_CLR (2) : Substract bits to state mask - KX_STATE_OP_NEG (3) : Invert bits to state mask + You can use one of the following constant: + - KX_STATE_OP_CPY (0) : Copy state mask + - KX_STATE_OP_SET (1) : Add bits to state mask + - KX_STATE_OP_CLR (2) : Substract bits to state mask + - KX_STATE_OP_NEG (3) : Invert bits to state mask @type operation: integer @ivar mask: value that defines the bits that will be modified by the operation. - The bits that are 1 in the mask will be updated in the object state, - the bits that are 0 are will be left unmodified expect for the Copy operation - which copies the mask to the object state + The bits that are 1 in the mask will be updated in the object state, + the bits that are 0 are will be left unmodified expect for the Copy operation + which copies the mask to the object state @type mask: integer """ def setOperation(op): diff --git a/source/gameengine/PyDoc/Rasterizer.py b/source/gameengine/PyDoc/Rasterizer.py index 3a2d6408ac9..fdd53c27898 100644 --- a/source/gameengine/PyDoc/Rasterizer.py +++ b/source/gameengine/PyDoc/Rasterizer.py @@ -82,8 +82,8 @@ def getScreenRay(x, y, dist, property): @type y: float @param dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other @type dist: float - @param prop: property name that object must have; can be omitted => detect any object - @type prop: string + @param property: property name that object must have; can be omitted => detect any object + @type property: string @rtype: L{KX_GameObject} @return: the first object hit or None if no object or object does not match prop """ -- cgit v1.2.3 From 252928ab36b03e73b35ea79e36a03e8f982274f6 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Fri, 24 Apr 2009 19:49:15 +0000 Subject: BGE: removed support for time dependent modifiers, they don't make sense in the GE. Disable modifiers when Bullet soft body is used: bullet needs the original vertex array. --- source/blender/blenkernel/intern/DerivedMesh.c | 2 ++ source/gameengine/Converter/BL_ModifierDeformer.cpp | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index eb2975be0c0..6cf934fa165 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2158,6 +2158,7 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3], if((md->mode & required_mode) != required_mode) continue; if(mti->isDisabled && mti->isDisabled(md)) continue; + if(useDeform < 0 && mti->dependsOnTime && mti->dependsOnTime(md)) continue; if(mti->type == eModifierTypeType_OnlyDeform) { if(!deformedVerts) @@ -2228,6 +2229,7 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3], } if(mti->isDisabled && mti->isDisabled(md)) continue; if(needMapping && !modifier_supportsMapping(md)) continue; + if(useDeform < 0 && mti->dependsOnTime && mti->dependsOnTime(md)) continue; /* add an orco layer if needed by this modifier */ if(dm && mti->requiredDataMask) { diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp index 09dbe966d0b..c3131559a6f 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.cpp +++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp @@ -97,10 +97,16 @@ bool BL_ModifierDeformer::HasCompatibleDeformer(Object *ob) { if (!ob->modifiers.first) return false; + // soft body cannot use mesh modifiers + if ((ob->gameflag & OB_SOFT_BODY) != 0) + return false; ModifierData* md; for (md = (ModifierData*)ob->modifiers.first; md; md = (ModifierData*)md->next) { - if (md->mode & eModifierMode_Realtime) - return true; + if (modifier_dependsOnTime(md)) + continue; + if (!(md->mode & eModifierMode_Realtime)) + continue; + return true; } return false; } -- cgit v1.2.3 From 0c482f76071ff0f48f1b469f9b5173ee7b067add Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 24 Apr 2009 20:27:04 +0000 Subject: BGE API - small changes - print CListValue errors only once. - bge_api_validate_py.txt now validates modules as well as types. - added missing functions and consts for epydoc modules. some of these in GameLogic.py still need sorting. --- source/gameengine/Expressions/ListValue.cpp | 16 +- source/gameengine/Ketsji/KX_PythonInit.cpp | 4 +- source/gameengine/PyDoc/GameKeys.py | 235 ++++++++++++------------ source/gameengine/PyDoc/GameLogic.py | 130 ++++++++++++- source/gameengine/PyDoc/Rasterizer.py | 26 +++ source/gameengine/PyDoc/bge_api_validate_py.txt | 39 +++- 6 files changed, 316 insertions(+), 134 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index c78963142d1..3596128f12d 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -530,7 +530,7 @@ PyObject* CListValue::Pycount(PyObject* value) { int numfound = 0; - CValue* checkobj = ConvertPythonToValue(value, "cList.count(val): CValueList, "); + CValue* checkobj = ConvertPythonToValue(value, ""); /* error ignored */ if (checkobj==NULL) { /* in this case just return that there are no items in the list */ PyErr_Clear(); @@ -578,18 +578,24 @@ PyObject* CListValue::Pyfrom_id(PyObject* value) CValue* CListValue::Calc(VALUE_OPERATOR op,CValue *val) { //assert(false); // todo: implement me! - fprintf(stderr, "CValueList::Calc not yet implimented\n"); + static int error_printed = 0; + if (error_printed==0) { + fprintf(stderr, "CValueList::Calc not yet implimented\n"); + error_printed = 1; + } return NULL; } - - CValue* CListValue::CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue* val) { //assert(false); // todo: implement me! - fprintf(stderr, "CValueList::CalcFinal not yet implimented\n"); + static int error_printed = 0; + if (error_printed==0) { + fprintf(stderr, "CValueList::CalcFinal not yet implimented\n"); + error_printed = 1; + } return NULL; } diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index bf3b64f1ecf..f82110c2bd2 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -852,7 +852,7 @@ static PyObject* gPyEnableMotionBlur(PyObject*, PyObject* args) Py_RETURN_NONE; } -static PyObject* gPyDisableMotionBlur(PyObject*, PyObject* args) +static PyObject* gPyDisableMotionBlur(PyObject*) { if (!gp_Rasterizer) { PyErr_SetString(PyExc_RuntimeError, "Rasterizer.disableMotionBlur(), Rasterizer not available"); @@ -1043,7 +1043,7 @@ static struct PyMethodDef rasterizer_methods[] = { {"setMistStart",(PyCFunction)gPySetMistStart,METH_VARARGS,"set Mist Start(rgb)"}, {"setMistEnd",(PyCFunction)gPySetMistEnd,METH_VARARGS,"set Mist End(rgb)"}, {"enableMotionBlur",(PyCFunction)gPyEnableMotionBlur,METH_VARARGS,"enable motion blur"}, - {"disableMotionBlur",(PyCFunction)gPyDisableMotionBlur,METH_VARARGS,"disable motion blur"}, + {"disableMotionBlur",(PyCFunction)gPyDisableMotionBlur,METH_NOARGS,"disable motion blur"}, {"setEyeSeparation", (PyCFunction) gPySetEyeSeparation, METH_VARARGS, "set the eye separation for stereo mode"}, diff --git a/source/gameengine/PyDoc/GameKeys.py b/source/gameengine/PyDoc/GameKeys.py index 14cd7e4f25c..e798f6c901b 100644 --- a/source/gameengine/PyDoc/GameKeys.py +++ b/source/gameengine/PyDoc/GameKeys.py @@ -5,126 +5,6 @@ Documentation for the GameKeys module. This module holds key constants for the SCA_KeyboardSensor. -Alphabet keys -------------- - - AKEY - - BKEY - - CKEY - - DKEY - - EKEY - - FKEY - - GKEY - - HKEY - - IKEY - - JKEY - - KKEY - - LKEY - - MKEY - - NKEY - - OKEY - - PKEY - - QKEY - - RKEY - - SKEY - - TKEY - - UKEY - - VKEY - - WKEY - - XKEY - - YKEY - - ZKEY - -Number keys ------------ - - ZEROKEY - - ONEKEY - - TWOKEY - - THREEKEY - - FOURKEY - - FIVEKEY - - SIXKEY - - SEVENKEY - - EIGHTKEY - - NINEKEY - -Shift Modifiers ---------------- - - CAPSLOCKKEY - - - LEFTCTRLKEY - - LEFTALTKEY - - RIGHTALTKEY - - RIGHTCTRLKEY - - RIGHTSHIFTKEY - - LEFTSHIFTKEY - -Arrow Keys ----------- - - LEFTARROWKEY - - DOWNARROWKEY - - RIGHTARROWKEY - - UPARROWKEY - -Numberpad Keys --------------- - - PAD0 - - PAD1 - - PAD2 - - PAD3 - - PAD4 - - PAD5 - - PAD6 - - PAD7 - - PAD8 - - PAD9 - - PADPERIOD - - PADSLASHKEY - - PADASTERKEY - - PADMINUS - - PADENTER - - PADPLUSKEY - -Function Keys -------------- - - F1KEY - - F2KEY - - F3KEY - - F4KEY - - F5KEY - - F6KEY - - F7KEY - - F8KEY - - F9KEY - - F10KEY - - F11KEY - - F12KEY - -Other Keys ----------- - - ACCENTGRAVEKEY - - BACKSLASHKEY - - BACKSPACEKEY - - COMMAKEY - - DELKEY - - ENDKEY - - EQUALKEY - - ESCKEY - - HOMEKEY - - INSERTKEY - - LEFTBRACKETKEY - - LINEFEEDKEY - - MINUSKEY - - PAGEDOWNKEY - - PAGEUPKEY - - PAUSEKEY - - PERIODKEY - - QUOTEKEY - - RIGHTBRACKETKEY - - RETKEY - - SEMICOLONKEY - - SLASHKEY - - SPACEKEY - - TABKEY Example:: # Set a connected keyboard sensor to accept F1 @@ -156,7 +36,120 @@ Example:: # Activate Left! if key[0] == GameKeys.DKEY: # Activate Right! - + +@group Alphabet keys: AKEY, BKEY, CKEY, DKEY, EKEY, FKEY, GKEY, HKEY, IKEY, JKEY, KKEY, LKEY, MKEY, NKEY, OKEY, PKEY, QKEY, RKEY, SKEY, TKEY, UKEY, VKEY, WKEY, XKEY, YKEY, ZKEY +@var AKEY: +@var BKEY: +@var CKEY: +@var DKEY: +@var EKEY: +@var FKEY: +@var GKEY: +@var HKEY: +@var IKEY: +@var JKEY: +@var KKEY: +@var LKEY: +@var MKEY: +@var NKEY: +@var OKEY: +@var PKEY: +@var QKEY: +@var RKEY: +@var SKEY: +@var TKEY: +@var UKEY: +@var VKEY: +@var WKEY: +@var XKEY: +@var YKEY: +@var ZKEY: + +@group Number keys: ZEROKEY, ONEKEY, TWOKEY, THREEKEY, FOURKEY, FIVEKEY, SIXKEY, SEVENKEY, EIGHTKEY, NINEKEY +@var ZEROKEY: +@var ONEKEY: +@var TWOKEY: +@var THREEKEY: +@var FOURKEY: +@var FIVEKEY: +@var SIXKEY: +@var SEVENKEY: +@var EIGHTKEY: +@var NINEKEY: + +@group Modifiers: CAPSLOCKKEY, LEFTCTRLKEY, LEFTALTKEY, RIGHTALTKEY, RIGHTCTRLKEY, RIGHTSHIFTKEY, LEFTSHIFTKEY +@var CAPSLOCKKEY: +@var LEFTCTRLKEY: +@var LEFTALTKEY: +@var RIGHTALTKEY: +@var RIGHTCTRLKEY: +@var RIGHTSHIFTKEY: +@var LEFTSHIFTKEY: + +@group Arrow Keys: LEFTARROWKEY, DOWNARROWKEY, RIGHTARROWKEY, UPARROWKEY +@var LEFTARROWKEY: +@var DOWNARROWKEY: +@var RIGHTARROWKEY: +@var UPARROWKEY: + +@group Numberpad Keys: PAD0, PAD1, PAD2, PAD3, PAD4, PAD5, PAD6, PAD7, PAD8, PAD9, PADPERIOD, PADSLASHKEY, PADASTERKEY, PADMINUS, PADENTER, PADPLUSKEY +@var PAD0: +@var PAD1: +@var PAD2: +@var PAD3: +@var PAD4: +@var PAD5: +@var PAD6: +@var PAD7: +@var PAD8: +@var PAD9: +@var PADPERIOD: +@var PADSLASHKEY: +@var PADASTERKEY: +@var PADMINUS: +@var PADENTER: +@var PADPLUSKEY: + +@group Function Keys: F1KEY, F2KEY, F3KEY, F4KEY, F5KEY, F6KEY, F7KEY, F8KEY, F9KEY, F10KEY, F11KEY, F12KEY +@var F1KEY: +@var F2KEY: +@var F3KEY: +@var F4KEY: +@var F5KEY: +@var F6KEY: +@var F7KEY: +@var F8KEY: +@var F9KEY: +@var F10KEY: +@var F11KEY: +@var F12KEY: + +@group Other Keys: ACCENTGRAVEKEY, BACKSLASHKEY, BACKSPACEKEY, COMMAKEY, DELKEY, ENDKEY, EQUALKEY, ESCKEY, HOMEKEY, INSERTKEY, LEFTBRACKETKEY, LINEFEEDKEY, MINUSKEY, PAGEDOWNKEY, PAGEUPKEY, PAUSEKEY, PERIODKEY, QUOTEKEY, RIGHTBRACKETKEY, RETKEY, SEMICOLONKEY, SLASHKEY, SPACEKEY, TABKEY +@var ACCENTGRAVEKEY: +@var BACKSLASHKEY: +@var BACKSPACEKEY: +@var COMMAKEY: +@var DELKEY: +@var ENDKEY: +@var EQUALKEY: +@var ESCKEY: +@var HOMEKEY: +@var INSERTKEY: +@var LEFTBRACKETKEY: +@var LINEFEEDKEY: +@var MINUSKEY: +@var PAGEDOWNKEY: +@var PAGEUPKEY: +@var PAUSEKEY: +@var PERIODKEY: +@var QUOTEKEY: +@var RIGHTBRACKETKEY: +@var RETKEY: +@var SEMICOLONKEY: +@var SLASHKEY: +@var SPACEKEY: +@var TABKEY: + """ def EventToString(event): diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 1996aa3f8a9..74e7f852018 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -62,25 +62,29 @@ Documentation for the GameLogic Module. GameLogic.addActiveActuator(actuator, True) See the actuator's reference for available methods: + - L{2DFilterActuator} - L{ActionActuator} - L{AddObjectActuator} - L{CameraActuator} - L{CDActuator} - L{ConstraintActuator} + - L{DynamicActuator} - L{EndObjectActuator} - L{GameActuator} - L{IpoActuator} - L{NetworkMessageActuator} - L{ObjectActuator} + - L{ParentActuator} - L{PropertyActuator} - L{RandomActuator} - L{ReplaceMeshActuator} - L{SceneActuator} + - L{ShapeActionActuator} - L{SoundActuator} + - L{StateActuator} - L{TrackToActuator} - L{VisibilityActuator} - - L{DynamicActuator} - + Most logic brick's methods are accessors for the properties available in the logic buttons. Consult the logic bricks documentation for more information on how each logic brick works. @@ -107,20 +111,31 @@ Documentation for the GameLogic Module. @var KX_PROPSENSOR_CHANGED: Activate when the property changes @var KX_PROPSENSOR_EXPRESSION: Activate when the expression matches -@group Constraint Actuator: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ, KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY, KX_CONSTRAINTACT_ROTZ + + + +@group Constraint Actuator: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ, KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY, KX_CONSTRAINTACT_ROTZ, KX_CONSTRAINTACT_DIRNX, KX_CONSTRAINTACT_DIRNY, KX_CONSTRAINTACT_DIRPX, KX_CONSTRAINTACT_DIRPY, KX_CONSTRAINTACT_ORIX, KX_CONSTRAINTACT_ORIY, KX_CONSTRAINTACT_ORIZ @var KX_CONSTRAINTACT_LOCX: See L{KX_ConstraintActuator} @var KX_CONSTRAINTACT_LOCY: See L{KX_ConstraintActuator} @var KX_CONSTRAINTACT_LOCZ: See L{KX_ConstraintActuator} @var KX_CONSTRAINTACT_ROTX: See L{KX_ConstraintActuator} @var KX_CONSTRAINTACT_ROTY: See L{KX_ConstraintActuator} @var KX_CONSTRAINTACT_ROTZ: See L{KX_ConstraintActuator} +@var KX_CONSTRAINTACT_DIRNX: See L{KX_ConstraintActuator} +@var KX_CONSTRAINTACT_DIRNY: See L{KX_ConstraintActuator} +@var KX_CONSTRAINTACT_DIRPX: See L{KX_ConstraintActuator} +@var KX_CONSTRAINTACT_DIRPY: See L{KX_ConstraintActuator} +@var KX_CONSTRAINTACT_ORIX: See L{KX_ConstraintActuator} +@var KX_CONSTRAINTACT_ORIY: See L{KX_ConstraintActuator} +@var KX_CONSTRAINTACT_ORIZ: See L{KX_ConstraintActuator} -@group IPO Actuator: KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND +@group IPO Actuator: KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND, KX_IPOACT_FROM_PROP @var KX_IPOACT_PLAY: See L{KX_IpoActuator} @var KX_IPOACT_PINGPONG: See L{KX_IpoActuator} @var KX_IPOACT_FLIPPER: See L{KX_IpoActuator} @var KX_IPOACT_LOOPSTOP: See L{KX_IpoActuator} @var KX_IPOACT_LOOPEND: See L{KX_IpoActuator} +@var KX_IPOACT_FROM_PROP: See L{KX_IpoActuator} @group Random Distributions: KX_RANDOMACT_BOOL_CONST, KX_RANDOMACT_BOOL_UNIFORM, KX_RANDOMACT_BOOL_BERNOUILLI, KX_RANDOMACT_INT_CONST, KX_RANDOMACT_INT_UNIFORM, KX_RANDOMACT_INT_POISSON, KX_RANDOMACT_FLOAT_CONST, KX_RANDOMACT_FLOAT_UNIFORM, KX_RANDOMACT_FLOAT_NORMAL, KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL @var KX_RANDOMACT_BOOL_CONST: See L{SCA_RandomActuator} @@ -183,8 +198,103 @@ Documentation for the GameLogic Module. @var KX_MOUSE_BUT_LEFT: See L{SCA_MouseSensor} @var KX_MOUSE_BUT_MIDDLE: See L{SCA_MouseSensor} @var KX_MOUSE_BUT_RIGHT: See L{SCA_MouseSensor} + +@group States: KX_STATE1, KX_STATE10, KX_STATE11, KX_STATE12, KX_STATE13, KX_STATE14, KX_STATE15, KX_STATE16, KX_STATE17, KX_STATE18, KX_STATE19, KX_STATE2, KX_STATE20, KX_STATE21, KX_STATE22, KX_STATE23, KX_STATE24, KX_STATE25, KX_STATE26, KX_STATE27, KX_STATE28, KX_STATE29, KX_STATE3, KX_STATE30, KX_STATE4, KX_STATE5, KX_STATE6, KX_STATE7, KX_STATE8, KX_STATE9, KX_STATE_OP_CLR, KX_STATE_OP_CPY, KX_STATE_OP_NEG, KX_STATE_OP_SET +@var KX_STATE1: +@var KX_STATE10: +@var KX_STATE11: +@var KX_STATE12: +@var KX_STATE13: +@var KX_STATE14: +@var KX_STATE15: +@var KX_STATE16: +@var KX_STATE17: +@var KX_STATE18: +@var KX_STATE19: +@var KX_STATE2: +@var KX_STATE20: +@var KX_STATE21: +@var KX_STATE22: +@var KX_STATE23: +@var KX_STATE24: +@var KX_STATE25: +@var KX_STATE26: +@var KX_STATE27: +@var KX_STATE28: +@var KX_STATE29: +@var KX_STATE3: +@var KX_STATE30: +@var KX_STATE4: +@var KX_STATE5: +@var KX_STATE6: +@var KX_STATE7: +@var KX_STATE8: +@var KX_STATE9: +@var KX_STATE_OP_CLR: +@var KX_STATE_OP_CPY: +@var KX_STATE_OP_NEG: +@var KX_STATE_OP_SET: + +@group UNSORTED: BL_DST_ALPHA, BL_DST_COLOR, BL_ONE, BL_ONE_MINUS_DST_ALPHA, BL_ONE_MINUS_DST_COLOR, BL_ONE_MINUS_SRC_ALPHA, BL_ONE_MINUS_SRC_COLOR, BL_SRC_ALPHA, BL_SRC_ALPHA_SATURATE, BL_SRC_COLOR, BL_ZERO, CAM_POS, CONSTANT_TIMER, KX_ACT_CONSTRAINT_DISTANCE, KX_ACT_CONSTRAINT_DOROTFH, KX_ACT_CONSTRAINT_FHNX, KX_ACT_CONSTRAINT_FHNY, KX_ACT_CONSTRAINT_FHNZ, KX_ACT_CONSTRAINT_FHPX, KX_ACT_CONSTRAINT_FHPY, KX_ACT_CONSTRAINT_FHPZ, KX_ACT_CONSTRAINT_LOCAL, KX_ACT_CONSTRAINT_MATERIAL, KX_ACT_CONSTRAINT_NORMAL, KX_ACT_CONSTRAINT_PERMANENT, MODELMATRIX, MODELMATRIX_INVERSE, MODELMATRIX_INVERSETRANSPOSE, MODELMATRIX_TRANSPOSE, MODELVIEWMATRIX, MODELVIEWMATRIX_INVERSE, MODELVIEWMATRIX_INVERSETRANSPOSE, MODELVIEWMATRIX_TRANSPOSE, RAS_2DFILTER_BLUR, RAS_2DFILTER_CUSTOMFILTER, RAS_2DFILTER_DILATION, RAS_2DFILTER_DISABLED, RAS_2DFILTER_ENABLED, RAS_2DFILTER_EROSION, RAS_2DFILTER_GRAYSCALE, RAS_2DFILTER_INVERT, RAS_2DFILTER_LAPLACIAN, RAS_2DFILTER_MOTIONBLUR, RAS_2DFILTER_NOFILTER, RAS_2DFILTER_PREWITT, RAS_2DFILTER_SEPIA, RAS_2DFILTER_SHARPEN, RAS_2DFILTER_SOBEL, SHD_TANGENT, VIEWMATRIX, VIEWMATRIX_INVERSE, VIEWMATRIX_INVERSETRANSPOSE, VIEWMATRIX_TRANSPOSE +@var BL_DST_ALPHA: +@var BL_DST_COLOR: +@var BL_ONE: +@var BL_ONE_MINUS_DST_ALPHA: +@var BL_ONE_MINUS_DST_COLOR: +@var BL_ONE_MINUS_SRC_ALPHA: +@var BL_ONE_MINUS_SRC_COLOR: +@var BL_SRC_ALPHA: +@var BL_SRC_ALPHA_SATURATE: +@var BL_SRC_COLOR: +@var BL_ZERO: +@var CAM_POS: +@var CONSTANT_TIMER: +@var KX_ACT_CONSTRAINT_DISTANCE: +@var KX_ACT_CONSTRAINT_DOROTFH: +@var KX_ACT_CONSTRAINT_FHNX: +@var KX_ACT_CONSTRAINT_FHNY: +@var KX_ACT_CONSTRAINT_FHNZ: +@var KX_ACT_CONSTRAINT_FHPX: +@var KX_ACT_CONSTRAINT_FHPY: +@var KX_ACT_CONSTRAINT_FHPZ: +@var KX_ACT_CONSTRAINT_LOCAL: +@var KX_ACT_CONSTRAINT_MATERIAL: +@var KX_ACT_CONSTRAINT_NORMAL: +@var KX_ACT_CONSTRAINT_PERMANENT: +@var MODELMATRIX: +@var MODELMATRIX_INVERSE: +@var MODELMATRIX_INVERSETRANSPOSE: +@var MODELMATRIX_TRANSPOSE: +@var MODELVIEWMATRIX: +@var MODELVIEWMATRIX_INVERSE: +@var MODELVIEWMATRIX_INVERSETRANSPOSE: +@var MODELVIEWMATRIX_TRANSPOSE: +@var RAS_2DFILTER_BLUR: +@var RAS_2DFILTER_CUSTOMFILTER: +@var RAS_2DFILTER_DILATION: +@var RAS_2DFILTER_DISABLED: +@var RAS_2DFILTER_ENABLED: +@var RAS_2DFILTER_EROSION: +@var RAS_2DFILTER_GRAYSCALE: +@var RAS_2DFILTER_INVERT: +@var RAS_2DFILTER_LAPLACIAN: +@var RAS_2DFILTER_MOTIONBLUR: +@var RAS_2DFILTER_NOFILTER: +@var RAS_2DFILTER_PREWITT: +@var RAS_2DFILTER_SEPIA: +@var RAS_2DFILTER_SHARPEN: +@var RAS_2DFILTER_SOBEL: +@var SHD_TANGENT: +@var VIEWMATRIX: +@var VIEWMATRIX_INVERSE: +@var VIEWMATRIX_INVERSETRANSPOSE: +@var VIEWMATRIX_TRANSPOSE: """ +# TODO +# globalDict +# error + def getCurrentController(): """ Gets the Python controller associated with this Python script. @@ -197,6 +307,14 @@ def getCurrentScene(): @rtype: L{KX_Scene} """ +def getSceneList(): + """ + Gets a list of the current scenes loaded in the game engine. + + @note: Scenes in your blend file that have not been converted wont be in this list. This list will only contain scenes such as overlays scenes. + + @rtype: list of L{KX_Scene} + """ def addActiveActuator(actuator, activate): """ Activates the given actuator. @@ -309,3 +427,7 @@ def getBlendFileList(path = "//"): @return: A list of filenames, with no directory prefix @rtype: list """ +def PrintGLInfo(): + """ + Prints GL Extension Info into the console + """ \ No newline at end of file diff --git a/source/gameengine/PyDoc/Rasterizer.py b/source/gameengine/PyDoc/Rasterizer.py index fdd53c27898..25877364836 100644 --- a/source/gameengine/PyDoc/Rasterizer.py +++ b/source/gameengine/PyDoc/Rasterizer.py @@ -148,6 +148,13 @@ def setMistColor(rgb): @type rgb: list [r, g, b] """ + +def setAmbientColor(rgb): + """ + Sets the color of ambient light. + + @type rgb: list [r, g, b] + """ def setMistStart(start): """ @@ -164,6 +171,13 @@ def setMistEnd(end): @type end: float """ +def disableMist(): + """ + Disables mist. + + @note: Set any of the mist properties to enable mist. + """ + def setEyeSeparation(eyesep): """ Sets the eye separation for stereo mode. @@ -237,3 +251,15 @@ def drawLine(fromVec,toVec,color): @type color: list [r, g, b] """ +def enableMotionBlur(factor): + """ + Enable the motion blue effect. + + @param factor: the ammount of motion blur to display. + @type factor: float [0.0 - 1.0] + """ + +def disableMotionBlur(): + """ + Disable the motion blue effect. + """ diff --git a/source/gameengine/PyDoc/bge_api_validate_py.txt b/source/gameengine/PyDoc/bge_api_validate_py.txt index 0920e5d3c7d..492dcef408b 100644 --- a/source/gameengine/PyDoc/bge_api_validate_py.txt +++ b/source/gameengine/PyDoc/bge_api_validate_py.txt @@ -12,9 +12,17 @@ # # Currently it only prints missing modules and methods (not attributes) +import sys, os BGE_API_DOC_PATH = 'source/gameengine/PyDoc' + +mods = ['GameLogic', 'Rasterizer', 'GameKeys'] +mods_dict = {} +for m in mods: + mods_dict[m] = sys.modules[m] + + import GameTypes type_members = {} @@ -34,7 +42,7 @@ for type_name in dir(GameTypes): # print type_object.__name__ + '.' + k members.append(member) -import sys, os + doc_dir= os.path.join(os.getcwd(), BGE_API_DOC_PATH) @@ -58,7 +66,7 @@ def check_attribute(type_mame, member): ''' - if l.startswith('@ivar'): + if l.startswith('@ivar') or l.startswith('@var'): var = l.split()[1].split(':')[0] if var == member: @@ -108,3 +116,30 @@ for type_name in sorted(type_members.keys()): else: print "\tmissing: %s.%s" % (type_name, member) + +# Now check the modules +for mod_name, pymod in mods_dict.iteritems(): + print pymod + del sys.modules[mod_name] + + # Now well get the python version + pydoc = __import__(mod_name) + pydoc = reload(pydoc) # avoid using the out dated pyc file only + print pydoc.__file__ + + for member in sorted(dir(pymod)): + if hasattr(pydoc, member) or check_attribute(mod_name, member): + if PRINT_OK: + print "\tfound module attr: %s.%s" % (mod_name, member) + else: + print "\tmissing module attr: %s.%s" % (mod_name, member) + + # Restore real module + sys.modules[mod_name] = pymod + + +sys.path.pop() # remove the pydoc dir from our import paths + + + + -- cgit v1.2.3 From 3038fb1a0175ef5e3d595460a7f281c77028b5a1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 25 Apr 2009 07:17:36 +0000 Subject: [#18606] Writing to KX_GameObject.orientation causes crash Own bug, conversion function to get an orientation from python - PyOrientationTo() ignored user input completely :| (breaking the orientation attribute) Also made KX_GameObject worldOrientation writable and minor doc fixes. --- source/gameengine/Ketsji/KX_GameObject.cpp | 48 +++++++++++++++++++----------- source/gameengine/Ketsji/KX_GameObject.h | 1 + source/gameengine/Ketsji/KX_PyMath.cpp | 3 +- source/gameengine/PyDoc/KX_GameObject.py | 10 +++---- 4 files changed, 37 insertions(+), 25 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 7629f9d8f1a..297d3048a3a 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1133,7 +1133,7 @@ PyAttributeDef KX_GameObject::Attributes[] = { KX_PYATTRIBUTE_RW_FUNCTION("state", KX_GameObject, pyattr_get_state, pyattr_set_state), KX_PYATTRIBUTE_RO_FUNCTION("meshes", KX_GameObject, pyattr_get_meshes), KX_PYATTRIBUTE_RW_FUNCTION("localOrientation",KX_GameObject,pyattr_get_localOrientation,pyattr_set_localOrientation), - KX_PYATTRIBUTE_RO_FUNCTION("worldOrientation",KX_GameObject,pyattr_get_worldOrientation), + KX_PYATTRIBUTE_RW_FUNCTION("worldOrientation",KX_GameObject,pyattr_get_worldOrientation,pyattr_set_worldOrientation), KX_PYATTRIBUTE_RW_FUNCTION("localPosition", KX_GameObject, pyattr_get_localPosition, pyattr_set_localPosition), KX_PYATTRIBUTE_RW_FUNCTION("worldPosition", KX_GameObject, pyattr_get_worldPosition, pyattr_set_worldPosition), KX_PYATTRIBUTE_RW_FUNCTION("localScaling", KX_GameObject, pyattr_get_localScaling, pyattr_set_localScaling), @@ -1515,6 +1515,26 @@ PyObject* KX_GameObject::pyattr_get_worldOrientation(void *self_v, const KX_PYAT return PyObjectFrom(self->NodeGetWorldOrientation()); } +int KX_GameObject::pyattr_set_worldOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) +{ + KX_GameObject* self= static_cast(self_v); + + /* if value is not a sequence PyOrientationTo makes an error */ + MT_Matrix3x3 rot; + if (!PyOrientationTo(value, rot, "gameOb.worldOrientation = sequence: KX_GameObject, ")) + return NULL; + + if (self->GetSGNode() && self->GetSGNode()->GetSGParent()) { + self->NodeSetLocalOrientation(self->GetSGNode()->GetSGParent()->GetWorldOrientation().inverse()*rot); + } + else { + self->NodeSetLocalOrientation(rot); + } + + self->NodeUpdateGS(0.f); + return 0; +} + PyObject* KX_GameObject::pyattr_get_localOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_GameObject* self= static_cast(self_v); @@ -1530,7 +1550,7 @@ int KX_GameObject::pyattr_set_localOrientation(void *self_v, const KX_PYATTRIBUT /* if value is not a sequence PyOrientationTo makes an error */ MT_Matrix3x3 rot; - if (!PyOrientationTo(value, rot, "gameOb.orientation = sequence: KX_GameObject, ")) + if (!PyOrientationTo(value, rot, "gameOb.localOrientation = sequence: KX_GameObject, ")) return NULL; self->NodeSetLocalOrientation(rot); @@ -2170,23 +2190,15 @@ PyObject* KX_GameObject::PyGetOrientation() //keywords PyObject* KX_GameObject::PySetOrientation(PyObject* value) { ShowDeprecationWarning("setOrientation()", "the orientation property"); - MT_Matrix3x3 matrix; - if (PyObject_IsMT_Matrix(value, 3) && PyMatTo(value, matrix)) - { - NodeSetLocalOrientation(matrix); - NodeUpdateGS(0.f); - Py_RETURN_NONE; - } + MT_Matrix3x3 rot; + + /* if value is not a sequence PyOrientationTo makes an error */ + if (!PyOrientationTo(value, rot, "gameOb.setOrientation(sequence): KX_GameObject, ")) + return NULL; - MT_Quaternion quat; - if (PyVecTo(value, quat)) - { - matrix.setRotation(quat); - NodeSetLocalOrientation(matrix); - NodeUpdateGS(0.f); - Py_RETURN_NONE; - } - return NULL; + NodeSetLocalOrientation(rot); + NodeUpdateGS(0.f); + Py_RETURN_NONE; } PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* args) diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 2ca4fc6a63f..fe9f39a6ed3 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -884,6 +884,7 @@ public: static PyObject* pyattr_get_localInertia(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_localInertia(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static PyObject* pyattr_get_worldOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_worldOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static PyObject* pyattr_get_localOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_localOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static PyObject* pyattr_get_worldScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_PyMath.cpp b/source/gameengine/Ketsji/KX_PyMath.cpp index 0093a72808e..051d7ae7dba 100644 --- a/source/gameengine/Ketsji/KX_PyMath.cpp +++ b/source/gameengine/Ketsji/KX_PyMath.cpp @@ -75,9 +75,8 @@ bool PyObject_IsMT_Matrix(PyObject *pymat, unsigned int rank) return false; } -bool PyOrientationTo(PyObject* pyval, MT_Matrix3x3 &mat, const char *error_prefix) +bool PyOrientationTo(PyObject* pyval, MT_Matrix3x3 &rot, const char *error_prefix) { - MT_Matrix3x3 rot; int size= PySequence_Size(pyval); if (size == 4) diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index db0aebfc761..10abf8b8197 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -49,13 +49,13 @@ class KX_GameObject: # (SCA_IObject) @type scaling: list [sx, sy, sz] On write: local scaling, on read: world scaling @ivar localOrientation: The object's local orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. @type localOrientation: 3x3 Matrix [[float]] - @ivar worldOrientation: The object's world orientation. Read-only. + @ivar worldOrientation: The object's world orientation. @type worldOrientation: 3x3 Matrix [[float]] @ivar localScaling: The object's local scaling factor. @type localScaling: list [sx, sy, sz] @ivar worldScaling: The object's world scaling factor. Read-only @type worldScaling: list [sx, sy, sz] - @ivar localPosition: The object's local position. + @ivar localPosition: The object's local position. @type localPosition: list [x, y, z] @ivar worldPosition: The object's world position. @type worldPosition: list [x, y, z] @@ -87,10 +87,10 @@ class KX_GameObject: # (SCA_IObject) Delete this object, can be used inpace of the EndObject Actuator. The actual removal of the object from the scene is delayed. """ - def replaceMesh(mesh_name): + def replaceMesh(mesh): """ Replace the mesh of this object with a new mesh. This works the same was as the actuator. - @type mesh_name: string + @type mesh: L{KX_MeshProxy} or mesh name """ def getVisible(): """ @@ -468,7 +468,7 @@ class KX_GameObject: # (SCA_IObject) @type objfrom: L{KX_GameObject} or 3-tuple or None @param dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to to @type dist: float - @param prop: property name that object must have; can be omitted => detect any object + @param prop: property name that object must have; can be omitted or "" => detect any object @type prop: string @param face: normal option: 1=>return face normal; 0 or omitted => normal is oriented towards origin @type face: int -- cgit v1.2.3 From b991b32458cdccb19a203e7ba4ca6b5780aad6cb Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sat, 25 Apr 2009 12:20:59 +0000 Subject: BGE mesh modifiers: fix view frustrum culling for mesh with modifiers. Update the bounding box based on mesh extent after applying the modifiers. --- .../gameengine/Converter/BL_BlenderDataConversion.cpp | 8 +++++++- source/gameengine/Converter/BL_MeshDeformer.h | 1 + source/gameengine/Converter/BL_ModifierDeformer.cpp | 9 +++++++++ source/gameengine/Converter/BL_SkinDeformer.h | 5 +++++ source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 7 +++++++ .../gameengine/Physics/Bullet/CcdGraphicController.cpp | 17 +++++++++++++++-- source/gameengine/Physics/Bullet/CcdGraphicController.h | 2 ++ .../gameengine/Physics/common/PHY_IGraphicController.h | 2 ++ source/gameengine/Rasterizer/RAS_Deformer.h | 1 + 9 files changed, 49 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 84b7407aacf..b2f283220a0 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1298,8 +1298,14 @@ void BL_CreateGraphicObjectNew(KX_GameObject* gameobj, gameobj->SetGraphicController(ctrl); ctrl->setNewClientInfo(gameobj->getClientInfo()); ctrl->setLocalAabb(localAabbMin, localAabbMax); - if (isActive) + if (isActive) { + // add first, this will create the proxy handle env->addCcdGraphicController(ctrl); + // update the mesh if there is a deformer, this will also update the bounding box for modifiers + RAS_Deformer* deformer = gameobj->GetDeformer(); + if (deformer) + deformer->UpdateBuckets(); + } } break; #endif diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h index 34944421b28..d1754618df2 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.h +++ b/source/gameengine/Converter/BL_MeshDeformer.h @@ -64,6 +64,7 @@ public: virtual void SetSimulatedTime(double time){}; virtual bool Apply(class RAS_IPolyMaterial *mat); virtual bool Update(void){ return false; }; + virtual bool UpdateBuckets(void){ return false; }; virtual RAS_Deformer* GetReplica(){return NULL;}; virtual void ProcessReplica() { }; struct Mesh* GetMesh() { return m_bmesh; }; diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp index c3131559a6f..3c4c0c5caad 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.cpp +++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp @@ -37,6 +37,7 @@ #include "STR_HashedString.h" #include "RAS_IPolygonMaterial.h" #include "BL_SkinMeshObject.h" +#include "PHY_IGraphicController.h" //#include "BL_ArmatureController.h" #include "DNA_armature_types.h" @@ -132,6 +133,14 @@ bool BL_ModifierDeformer::Update(void) m_dm->release(m_dm); } m_dm = dm; + /* update the graphic controller */ + PHY_IGraphicController *ctrl = m_gameobj->GetGraphicController(); + if (ctrl) { + float min_r[3], max_r[3]; + INIT_MINMAX(min_r, max_r); + m_dm->getMinMax(m_dm, min_r, max_r); + ctrl->setLocalAabb(min_r, max_r); + } m_lastModifierUpdate=m_gameobj->GetLastFrame(); bShapeUpdate = true; } diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h index ee240588851..0a7b60788f9 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.h +++ b/source/gameengine/Converter/BL_SkinDeformer.h @@ -71,6 +71,11 @@ public: virtual ~BL_SkinDeformer(); bool Update (void); bool Apply (class RAS_IPolyMaterial *polymat); + bool UpdateBuckets(void) + { + // update the deformer and all the mesh slots; Apply() does it well, so just call it. + return Apply(NULL); + } bool PoseUpdated(void) { if (m_armobj && m_lastArmaUpdate!=m_armobj->GetLastFrame()) { diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index f4f8ec9f91b..700c5f304e7 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -759,6 +759,13 @@ void KX_ConvertODEEngineObject(KX_GameObject* gameobj, //printf("update\n"); return true;//?? } + virtual bool UpdateBuckets(void) + { + // this is to update the mesh slots outside the rasterizer, + // no need to do it for this deformer, it's done in any case in Apply() + return false; + } + virtual RAS_Deformer *GetReplica() { KX_SoftBodyDeformer* deformer = new KX_SoftBodyDeformer(*this); diff --git a/source/gameengine/Physics/Bullet/CcdGraphicController.cpp b/source/gameengine/Physics/Bullet/CcdGraphicController.cpp index caf18fd28ba..2d1f841af0c 100644 --- a/source/gameengine/Physics/Bullet/CcdGraphicController.cpp +++ b/source/gameengine/Physics/Bullet/CcdGraphicController.cpp @@ -47,11 +47,24 @@ void CcdGraphicController::setLocalAabb(const btVector3& aabbMin,const btVector3 void CcdGraphicController::setLocalAabb(const MT_Point3& aabbMin,const MT_Point3& aabbMax) { - m_localAabbMin = btVector3(aabbMin[0],aabbMin[1],aabbMin[2]); - m_localAabbMax = btVector3(aabbMax[0],aabbMax[1],aabbMax[2]); + m_localAabbMin.setValue(aabbMin[0],aabbMin[1],aabbMin[2]); + m_localAabbMax.setValue(aabbMax[0],aabbMax[1],aabbMax[2]); SetGraphicTransform(); } +void CcdGraphicController::setLocalAabb(const PHY__Vector3& aabbMin,const PHY__Vector3& aabbMax) +{ + m_localAabbMin.setValue(aabbMin[0],aabbMin[1],aabbMin[2]); + m_localAabbMax.setValue(aabbMax[0],aabbMax[1],aabbMax[2]); + SetGraphicTransform(); +} + +void CcdGraphicController::setLocalAabb(const float* aabbMin,const float* aabbMax) +{ + m_localAabbMin.setValue(aabbMin[0],aabbMin[1],aabbMin[2]); + m_localAabbMax.setValue(aabbMax[0],aabbMax[1],aabbMax[2]); + SetGraphicTransform(); +} void CcdGraphicController::getAabb(btVector3& aabbMin, btVector3& aabbMax) { diff --git a/source/gameengine/Physics/Bullet/CcdGraphicController.h b/source/gameengine/Physics/Bullet/CcdGraphicController.h index 8faa0944313..8f44a623371 100644 --- a/source/gameengine/Physics/Bullet/CcdGraphicController.h +++ b/source/gameengine/Physics/Bullet/CcdGraphicController.h @@ -38,6 +38,8 @@ public: void setLocalAabb(const btVector3& aabbMin,const btVector3& aabbMax); void setLocalAabb(const MT_Point3& aabbMin,const MT_Point3& aabbMax); + virtual void setLocalAabb(const PHY__Vector3& aabbMin,const PHY__Vector3& aabbMax); + virtual void setLocalAabb(const float aabbMin[3],const float aabbMax[3]); PHY_IMotionState* GetMotionState() { return m_motionState; } void getAabb(btVector3& aabbMin, btVector3& aabbMax); diff --git a/source/gameengine/Physics/common/PHY_IGraphicController.h b/source/gameengine/Physics/common/PHY_IGraphicController.h index 36b8a978e87..8acc5c2f9d3 100644 --- a/source/gameengine/Physics/common/PHY_IGraphicController.h +++ b/source/gameengine/Physics/common/PHY_IGraphicController.h @@ -47,6 +47,8 @@ class PHY_IGraphicController : public PHY_IController SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding') */ virtual bool SetGraphicTransform()=0; + virtual void setLocalAabb(const PHY__Vector3& aabbMin,const PHY__Vector3& aabbMax)=0; + virtual void setLocalAabb(const float* aabbMin,const float* aabbMax)=0; virtual PHY_IGraphicController* GetReplica(class PHY_IMotionState* motionstate) {return 0;} diff --git a/source/gameengine/Rasterizer/RAS_Deformer.h b/source/gameengine/Rasterizer/RAS_Deformer.h index 5a6bab4c82d..fe081dd4aa5 100644 --- a/source/gameengine/Rasterizer/RAS_Deformer.h +++ b/source/gameengine/Rasterizer/RAS_Deformer.h @@ -44,6 +44,7 @@ public: virtual void Relink(GEN_Map*map)=0; virtual bool Apply(class RAS_IPolyMaterial *polymat)=0; virtual bool Update(void)=0; + virtual bool UpdateBuckets(void)=0; virtual RAS_Deformer *GetReplica()=0; virtual void ProcessReplica()=0; virtual bool SkipVertexTransform() -- cgit v1.2.3 From 5233069908265611bc542d370258b1ab96fddfb4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 25 Apr 2009 12:58:07 +0000 Subject: Running 2.48rc on my system segfaults when starting the game engine, only on the release, not for my own builds. Setting the SDL video driver to dummy prevents the crash, this is recommended in the SDL docs if your not using the video driver. --- source/creator/creator.c | 1 + source/gameengine/PyDoc/KX_GameObject.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/creator/creator.c b/source/creator/creator.c index 5c0ca9e07ff..7804eb7ad98 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -538,6 +538,7 @@ int main(int argc, char **argv) BLI_where_is_temp( btempdir, 1 ); /* call after loading the .B.blend so we can read U.tempdir */ #ifndef DISABLE_SDL + setenv("SDL_VIDEODRIVER", "dummy", 1); /* initializing the video driver can cause crashes on some systems - Campbell */ #ifdef __linux__ /* On linux the default SDL driver dma often would not play * use alsa if none is set */ diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 10abf8b8197..fcb3d91dbcb 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -159,7 +159,7 @@ class KX_GameObject: # (SCA_IObject) @param orn: a rotation matrix specifying the new rotation. @note: When using this matrix with Blender.Mathutils.Matrix() types, it will need to be transposed. """ - def alignAxisToVect(vect, axis): + def alignAxisToVect(vect, axis, factor): """ Aligns any of the game object's axis along the given vector. @@ -170,6 +170,8 @@ class KX_GameObject: # (SCA_IObject) - 0: X axis - 1: Y axis - 2: Z axis (default) + @type factor: float + @param factor: Only rotate a feaction of the distance to the target vector (0.0 - 1.0) """ def getAxisVect(vect): """ -- cgit v1.2.3 From dd21e9b62691daab1464dda0a0ab44d107480dec Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 25 Apr 2009 17:52:04 +0000 Subject: patch from michael williamson, export multiple UV layers to lightwave [#18575] remove unused local variables --- source/blender/nodes/intern/TEX_nodes/TEX_distance.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source') diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c index ff9ec4db76b..d23eb6bc589 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c @@ -44,7 +44,6 @@ static bNodeSocketType outputs[]= { static void valuefn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) { float coord1[3], coord2[3]; - float x, y, z; tex_input_vec(coord1, in[0], coord, thread); tex_input_vec(coord2, in[1], coord, thread); -- cgit v1.2.3 From fb7803c300a89892f1d5a76398b3c2506465cf60 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sat, 25 Apr 2009 20:26:27 +0000 Subject: Amendment for 19924 - no setenv() on Windows, make it work with _putenv_s(). --- source/creator/creator.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source') diff --git a/source/creator/creator.c b/source/creator/creator.c index 7804eb7ad98..74e899d2d14 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -538,7 +538,11 @@ int main(int argc, char **argv) BLI_where_is_temp( btempdir, 1 ); /* call after loading the .B.blend so we can read U.tempdir */ #ifndef DISABLE_SDL +#ifndef WIN32 setenv("SDL_VIDEODRIVER", "dummy", 1); /* initializing the video driver can cause crashes on some systems - Campbell */ +#else + _putenv_s("SDL_VIDEODRIVER", "dummy"); +#endif #ifdef __linux__ /* On linux the default SDL driver dma often would not play * use alsa if none is set */ -- cgit v1.2.3 From fc4ba5e13116835c3208ecfe21c9ccc3e93277f7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 26 Apr 2009 09:41:39 +0000 Subject: When adding multiline text drawing I missed a case where the image pointer should have been checked - drawing text on a face with no image would crash blender. Better tooltip for game actuator file field. --- source/blender/gpu/intern/gpu_draw.c | 21 ++++++++------------- source/blender/src/buttons_logic.c | 2 +- 2 files changed, 9 insertions(+), 14 deletions(-) (limited to 'source') diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 7b1fc67d0c6..6925186d63a 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -79,29 +79,24 @@ void GPU_render_text(MTFace *tface, int mode, const char *textstr, int textlen, unsigned int *col, float *v1, float *v2, float *v3, float *v4, int glattrib) { - if (mode & TF_BMFONT) { - Image* ima; - int characters, index, character; + if ((mode & TF_BMFONT) && (textlen>0) && tface->tpage) { + Image* ima = (Image*)tface->tpage; + int index, character; float centerx, centery, sizex, sizey, transx, transy, movex, movey, advance; float advance_tab; - /* multiline */ - float line_start= 0.0f, line_height; + float line_start= 0.0f, line_height; + if (v4) line_height= MAX4(v1[1], v2[1], v3[1], v4[2]) - MIN4(v1[1], v2[1], v3[1], v4[2]); else line_height= MAX3(v1[1], v2[1], v3[1]) - MIN3(v1[1], v2[1], v3[1]); line_height *= 1.2; /* could be an option? */ /* end multiline */ - - characters = textlen; - ima = (Image*)tface->tpage; - if (ima == NULL) - characters = 0; - - // color has been set + + /* color has been set */ if (tface->mode & TF_OBCOL) col= NULL; else if (!col) @@ -116,7 +111,7 @@ void GPU_render_text(MTFace *tface, int mode, advance_tab= advance * 4; /* tab width could also be an option */ - for (index = 0; index < characters; index++) { + for (index = 0; index < textlen; index++) { float uv[4][2]; // lets calculate offset stuff diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 67531e9b3b8..0a7bbf656b3 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -2389,7 +2389,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh ysize = 48; glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, 63, 0, 0, "Load this file"); + uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, 63, 0, 0, "Load this blend file, use the \"//\" prefix for a path relative to the current blend file"); // uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, 63, 0, 0, "Use this loadinganimation"); } /* else if (gma->type == ACT_GAME_START) -- cgit v1.2.3 From ba563216e9ec4e7c3e55ca343948d925a2dc1651 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 26 Apr 2009 12:23:30 +0000 Subject: BGE: Fix Orthographic mode and viewport scaling - the BGE now uses correct glOrtho projection whe camera is in orthographic mode - --- .../Converter/BL_BlenderDataConversion.cpp | 2 +- source/gameengine/Ketsji/KX_Camera.cpp | 158 +++++++++++---------- source/gameengine/Ketsji/KX_Camera.h | 2 + source/gameengine/Ketsji/KX_Dome.cpp | 6 +- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 82 ++++++----- source/gameengine/Ketsji/KX_Light.cpp | 3 +- source/gameengine/Rasterizer/RAS_CameraData.h | 4 +- .../gameengine/Rasterizer/RAS_FramingManager.cpp | 101 +++++++++++++ source/gameengine/Rasterizer/RAS_FramingManager.h | 22 +++ source/gameengine/Rasterizer/RAS_IRasterizer.h | 26 +++- .../RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp | 33 ++++- .../RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h | 15 +- source/gameengine/VideoTexture/ImageRender.cpp | 50 ++++--- 13 files changed, 354 insertions(+), 150 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index b2f283220a0..962af7cc4c9 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1620,7 +1620,7 @@ static KX_LightObject *gamelight_from_blamp(Object *ob, Lamp *la, unsigned int l static KX_Camera *gamecamera_from_bcamera(Object *ob, KX_Scene *kxscene, KX_BlenderSceneConverter *converter) { Camera* ca = static_cast(ob->data); - RAS_CameraData camdata(ca->lens, ca->clipsta, ca->clipend, ca->type == CAM_PERSP, dof_camera(ob)); + RAS_CameraData camdata(ca->lens, ca->ortho_scale, ca->clipsta, ca->clipend, ca->type == CAM_PERSP, dof_camera(ob)); KX_Camera *gamecamera; gamecamera= new KX_Camera(kxscene, KX_Scene::m_callbacks, camdata); diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index e536d1f1e7e..8565346b30e 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -47,7 +47,7 @@ KX_Camera::KX_Camera(void* sgReplicationInfo, m_camdata(camdata), m_dirty(true), m_normalized(false), - m_frustum_culling(frustum_culling && camdata.m_perspective), + m_frustum_culling(frustum_culling), m_set_projection_matrix(false), m_set_frustum_center(false) { @@ -184,6 +184,11 @@ float KX_Camera::GetLens() const return m_camdata.m_lens; } +float KX_Camera::GetScale() const +{ + return m_camdata.m_scale; +} + float KX_Camera::GetCameraNear() const @@ -264,80 +269,83 @@ void KX_Camera::ExtractFrustumSphere() MT_Matrix4x4 clip_camcs_matrix = m_projection_matrix; clip_camcs_matrix.invert(); - // detect which of the corner of the far clipping plane is the farthest to the origin - MT_Vector4 nfar; // far point in device normalized coordinate - MT_Point3 farpoint; // most extreme far point in camera coordinate - MT_Point3 nearpoint;// most extreme near point in camera coordinate - MT_Point3 farcenter(0.,0.,0.);// center of far cliping plane in camera coordinate - MT_Scalar F=1.0, N; // square distance of far and near point to origin - MT_Scalar f, n; // distance of far and near point to z axis. f is always > 0 but n can be < 0 - MT_Scalar e, s; // far and near clipping distance (<0) - MT_Scalar c; // slope of center line = distance of far clipping center to z axis / far clipping distance - MT_Scalar z; // projection of sphere center on z axis (<0) - // tmp value - MT_Vector4 npoint(1., 1., 1., 1.); - MT_Vector4 hpoint; - MT_Point3 point; - MT_Scalar len; - for (int i=0; i<4; i++) - { - hpoint = clip_camcs_matrix*npoint; - point.setValue(hpoint[0]/hpoint[3], hpoint[1]/hpoint[3], hpoint[2]/hpoint[3]); - len = point.dot(point); - if (len > F) - { - nfar = npoint; - farpoint = point; - F = len; - } - // rotate by 90 degree along the z axis to walk through the 4 extreme points of the far clipping plane - len = npoint[0]; - npoint[0] = -npoint[1]; - npoint[1] = len; - farcenter += point; - } - // the far center is the average of the far clipping points - farcenter *= 0.25; - // the extreme near point is the opposite point on the near clipping plane - nfar.setValue(-nfar[0], -nfar[1], -1., 1.); - nfar = clip_camcs_matrix*nfar; - nearpoint.setValue(nfar[0]/nfar[3], nfar[1]/nfar[3], nfar[2]/nfar[3]); - N = nearpoint.dot(nearpoint); - e = farpoint[2]; - s = nearpoint[2]; - // projection on XY plane for distance to axis computation - MT_Point2 farxy(farpoint[0], farpoint[1]); - // f is forced positive by construction - f = farxy.length(); - // get corresponding point on the near plane - farxy *= s/e; - // this formula preserve the sign of n - n = f*s/e - MT_Point2(nearpoint[0]-farxy[0], nearpoint[1]-farxy[1]).length(); - c = MT_Point2(farcenter[0], farcenter[1]).length()/e; - // the big formula, it simplifies to (F-N)/(2(e-s)) for the symmetric case - z = (F-N)/(2.0*(e-s+c*(f-n))); - m_frustum_center = MT_Point3(farcenter[0]*z/e, farcenter[1]*z/e, z); - m_frustum_radius = m_frustum_center.distance(farpoint); - -#if 0 - // The most extreme points on the near and far plane. (normalized device coords) - MT_Vector4 hnear(1., 1., 0., 1.), hfar(1., 1., 1., 1.); - - // Transform to hom camera local space - hnear = clip_camcs_matrix*hnear; - hfar = clip_camcs_matrix*hfar; - - // Tranform to 3d camera local space. - MT_Point3 nearpoint(hnear[0]/hnear[3], hnear[1]/hnear[3], hnear[2]/hnear[3]); - MT_Point3 farpoint(hfar[0]/hfar[3], hfar[1]/hfar[3], hfar[2]/hfar[3]); - - // Compute center - // don't use camera data in case the user specifies the matrix directly - m_frustum_center = MT_Point3(0., 0., - (nearpoint.dot(nearpoint) - farpoint.dot(farpoint))/(2.0*(nearpoint[2]-farpoint[2] /*m_camdata.m_clipend - m_camdata.m_clipstart*/))); - m_frustum_radius = m_frustum_center.distance(farpoint); -#endif - + if (m_projection_matrix[3][3] == MT_Scalar(0.0)) + { + // frustrum projection + // detect which of the corner of the far clipping plane is the farthest to the origin + MT_Vector4 nfar; // far point in device normalized coordinate + MT_Point3 farpoint; // most extreme far point in camera coordinate + MT_Point3 nearpoint;// most extreme near point in camera coordinate + MT_Point3 farcenter(0.,0.,0.);// center of far cliping plane in camera coordinate + MT_Scalar F=-1.0, N; // square distance of far and near point to origin + MT_Scalar f, n; // distance of far and near point to z axis. f is always > 0 but n can be < 0 + MT_Scalar e, s; // far and near clipping distance (<0) + MT_Scalar c; // slope of center line = distance of far clipping center to z axis / far clipping distance + MT_Scalar z; // projection of sphere center on z axis (<0) + // tmp value + MT_Vector4 npoint(1., 1., 1., 1.); + MT_Vector4 hpoint; + MT_Point3 point; + MT_Scalar len; + for (int i=0; i<4; i++) + { + hpoint = clip_camcs_matrix*npoint; + point.setValue(hpoint[0]/hpoint[3], hpoint[1]/hpoint[3], hpoint[2]/hpoint[3]); + len = point.dot(point); + if (len > F) + { + nfar = npoint; + farpoint = point; + F = len; + } + // rotate by 90 degree along the z axis to walk through the 4 extreme points of the far clipping plane + len = npoint[0]; + npoint[0] = -npoint[1]; + npoint[1] = len; + farcenter += point; + } + // the far center is the average of the far clipping points + farcenter *= 0.25; + // the extreme near point is the opposite point on the near clipping plane + nfar.setValue(-nfar[0], -nfar[1], -1., 1.); + nfar = clip_camcs_matrix*nfar; + nearpoint.setValue(nfar[0]/nfar[3], nfar[1]/nfar[3], nfar[2]/nfar[3]); + // this is a frustrum projection + N = nearpoint.dot(nearpoint); + e = farpoint[2]; + s = nearpoint[2]; + // projection on XY plane for distance to axis computation + MT_Point2 farxy(farpoint[0], farpoint[1]); + // f is forced positive by construction + f = farxy.length(); + // get corresponding point on the near plane + farxy *= s/e; + // this formula preserve the sign of n + n = f*s/e - MT_Point2(nearpoint[0]-farxy[0], nearpoint[1]-farxy[1]).length(); + c = MT_Point2(farcenter[0], farcenter[1]).length()/e; + // the big formula, it simplifies to (F-N)/(2(e-s)) for the symmetric case + z = (F-N)/(2.0*(e-s+c*(f-n))); + m_frustum_center = MT_Point3(farcenter[0]*z/e, farcenter[1]*z/e, z); + m_frustum_radius = m_frustum_center.distance(farpoint); + } + else + { + // orthographic projection + // The most extreme points on the near and far plane. (normalized device coords) + MT_Vector4 hnear(1., 1., 1., 1.), hfar(-1., -1., -1., 1.); + + // Transform to hom camera local space + hnear = clip_camcs_matrix*hnear; + hfar = clip_camcs_matrix*hfar; + + // Tranform to 3d camera local space. + MT_Point3 nearpoint(hnear[0]/hnear[3], hnear[1]/hnear[3], hnear[2]/hnear[3]); + MT_Point3 farpoint(hfar[0]/hfar[3], hfar[1]/hfar[3], hfar[2]/hfar[3]); + + // just use mediant point + m_frustum_center = (farpoint + nearpoint)*0.5; + m_frustum_radius = m_frustum_center.distance(farpoint); + } // Transform to world space. m_frustum_center = GetCameraToWorld()(m_frustum_center); m_frustum_radius /= fabs(NodeGetWorldScaling()[NodeGetWorldScaling().closestAxis()]); diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index d570fac213a..83316972ca0 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -184,6 +184,8 @@ public: /** Gets the aperture. */ float GetLens() const; + /** Gets the ortho scale. */ + float GetScale() const; /** Gets the near clip distance. */ float GetCameraNear() const; /** Gets the far clip distance. */ diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index 077e2ce33b7..9565c53e0bf 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -1507,8 +1507,7 @@ void KX_Dome::RotateCamera(KX_Camera* cam, int i) MT_Transform camtrans(cam->GetWorldToCamera()); MT_Matrix4x4 viewmat(camtrans); - m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldPosition(), - cam->GetCameraLocation(), cam->GetCameraOrientation()); + m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldOrientation(), cam->NodeGetWorldPosition(), cam->GetCameraData()->m_perspective); cam->SetModelviewMatrix(viewmat); // restore the original orientation @@ -1914,8 +1913,7 @@ void KX_Dome::RenderDomeFrame(KX_Scene* scene, KX_Camera* cam, int i) MT_Transform camtrans(cam->GetWorldToCamera()); MT_Matrix4x4 viewmat(camtrans); - m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldPosition(), - cam->GetCameraLocation(), cam->GetCameraOrientation()); + m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldOrientation(), cam->NodeGetWorldPosition(), cam->GetCameraData()->m_perspective); cam->SetModelviewMatrix(viewmat); scene->CalculateVisibleMeshes(m_rasterizer,cam); diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 63db54a296e..9bac0f7d758 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -1093,7 +1093,7 @@ void KX_KetsjiEngine::GetSceneViewport(KX_Scene *scene, KX_Camera* cam, RAS_Rect area = userviewport; } - else if ( m_overrideCam || (scene->GetName() != m_overrideSceneName) || m_overrideCamUseOrtho ) { + else if ( !m_overrideCam || (scene->GetName() != m_overrideSceneName) || m_overrideCamUseOrtho ) { RAS_FramingManager::ComputeViewport( scene->GetFramingType(), m_canvas->GetDisplayArea(), @@ -1163,13 +1163,11 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam) { bool override_camera; RAS_Rect viewport, area; - float left, right, bottom, top, nearfrust, farfrust, focallength; - const float ortho = 100.0; + float nearfrust, farfrust, focallength; // KX_Camera* cam = scene->GetActiveCamera(); if (!cam) return; - GetSceneViewport(scene, cam, area, viewport); // store the computed viewport in the scene @@ -1187,19 +1185,24 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam) override_camera = override_camera && (cam->GetName() == "__default__cam__"); if (override_camera && m_overrideCamUseOrtho) { - MT_CmMatrix4x4 projmat = m_overrideCamProjMat; - m_rasterizer->SetProjectionMatrix(projmat); + m_rasterizer->SetProjectionMatrix(m_overrideCamProjMat); + if (!cam->hasValidProjectionMatrix()) { + // needed to get frustrum planes for culling + MT_Matrix4x4 projmat; + projmat.setValue(m_overrideCamProjMat.getPointer()); + cam->SetProjectionMatrix(projmat); + } } else if (cam->hasValidProjectionMatrix() && !cam->GetViewport() ) { m_rasterizer->SetProjectionMatrix(cam->GetProjectionMatrix()); } else { RAS_FrameFrustum frustum; - float lens = cam->GetLens(); bool orthographic = !cam->GetCameraData()->m_perspective; nearfrust = cam->GetCameraNear(); farfrust = cam->GetCameraFar(); focallength = cam->GetFocalLength(); + MT_Matrix4x4 projmat; if(override_camera) { nearfrust = m_overrideCamNear; @@ -1207,45 +1210,56 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam) } if (orthographic) { - lens *= ortho; - nearfrust = (nearfrust + 1.0)*ortho; - farfrust *= ortho; - } - - RAS_FramingManager::ComputeFrustum( - scene->GetFramingType(), - area, - viewport, - lens, - nearfrust, - farfrust, - frustum - ); - left = frustum.x1 * m_cameraZoom; - right = frustum.x2 * m_cameraZoom; - bottom = frustum.y1 * m_cameraZoom; - top = frustum.y2 * m_cameraZoom; - nearfrust = frustum.camnear; - farfrust = frustum.camfar; + RAS_FramingManager::ComputeOrtho( + scene->GetFramingType(), + area, + viewport, + cam->GetScale(), + nearfrust, + farfrust, + frustum + ); + if (!cam->GetViewport()) { + frustum.x1 *= m_cameraZoom; + frustum.x2 *= m_cameraZoom; + frustum.y1 *= m_cameraZoom; + frustum.y2 *= m_cameraZoom; + } + projmat = m_rasterizer->GetOrthoMatrix( + frustum.x1, frustum.x2, frustum.y1, frustum.y2, frustum.camnear, frustum.camfar); - MT_Matrix4x4 projmat = m_rasterizer->GetFrustumMatrix( - left, right, bottom, top, nearfrust, farfrust, focallength); + } else { + RAS_FramingManager::ComputeFrustum( + scene->GetFramingType(), + area, + viewport, + cam->GetLens(), + nearfrust, + farfrust, + frustum + ); + if (!cam->GetViewport()) { + frustum.x1 *= m_cameraZoom; + frustum.x2 *= m_cameraZoom; + frustum.y1 *= m_cameraZoom; + frustum.y2 *= m_cameraZoom; + } + projmat = m_rasterizer->GetFrustumMatrix( + frustum.x1, frustum.x2, frustum.y1, frustum.y2, frustum.camnear, frustum.camfar, focallength); + } cam->SetProjectionMatrix(projmat); // Otherwise the projection matrix for each eye will be the same... - if (m_rasterizer->Stereo()) + if (!orthographic && m_rasterizer->Stereo()) cam->InvalidateProjectionMatrix(); } MT_Transform camtrans(cam->GetWorldToCamera()); - if (!cam->GetCameraData()->m_perspective) - camtrans.getOrigin()[2] *= ortho; MT_Matrix4x4 viewmat(camtrans); - m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldPosition(), - cam->GetCameraLocation(), cam->GetCameraOrientation()); + m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldOrientation(), cam->NodeGetWorldPosition(), cam->GetCameraData()->m_perspective); cam->SetModelviewMatrix(viewmat); //redundant, already done in Render() diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index 7bc982111fe..498eb7262b5 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -160,8 +160,7 @@ void KX_LightObject::BindShadowBuffer(RAS_IRasterizer *ras, KX_Camera *cam, MT_T /* setup rasterizer transformations */ ras->SetProjectionMatrix(projectionmat); - ras->SetViewMatrix(modelviewmat, cam->NodeGetWorldPosition(), - cam->GetCameraLocation(), cam->GetCameraOrientation()); + ras->SetViewMatrix(modelviewmat, cam->NodeGetWorldOrientation(), cam->NodeGetWorldPosition(), cam->GetCameraData()->m_perspective); } void KX_LightObject::UnbindShadowBuffer(RAS_IRasterizer *ras) diff --git a/source/gameengine/Rasterizer/RAS_CameraData.h b/source/gameengine/Rasterizer/RAS_CameraData.h index e3af43fb839..c8f4d9a0a17 100644 --- a/source/gameengine/Rasterizer/RAS_CameraData.h +++ b/source/gameengine/Rasterizer/RAS_CameraData.h @@ -32,6 +32,7 @@ struct RAS_CameraData { float m_lens; + float m_scale; float m_clipstart; float m_clipend; bool m_perspective; @@ -42,10 +43,11 @@ struct RAS_CameraData int m_viewporttop; float m_focallength; - RAS_CameraData(float lens = 35.0, float clipstart = 0.1, float clipend = 5000.0, bool perspective = true, + RAS_CameraData(float lens = 35.0, float scale = 6.0, float clipstart = 0.1, float clipend = 5000.0, bool perspective = true, float focallength = 0.0f, bool viewport = false, int viewportleft = 0, int viewportbottom = 0, int viewportright = 0, int viewporttop = 0) : m_lens(lens), + m_scale(scale), m_clipstart(clipstart), m_clipend(clipend), m_perspective(perspective), diff --git a/source/gameengine/Rasterizer/RAS_FramingManager.cpp b/source/gameengine/Rasterizer/RAS_FramingManager.cpp index e2bbca48bb5..ea18ffb2298 100644 --- a/source/gameengine/Rasterizer/RAS_FramingManager.cpp +++ b/source/gameengine/Rasterizer/RAS_FramingManager.cpp @@ -70,6 +70,39 @@ ComputeDefaultFrustum( frustum.camfar = camfar; } + void +RAS_FramingManager:: +ComputeDefaultOrtho( + const float camnear, + const float camfar, + const float scale, + const float design_aspect_ratio, + RAS_FrameFrustum & frustum +) +{ + float halfSize = scale*0.5f; + float sizeX; + float sizeY; + + if (design_aspect_ratio > 1.f) { + // halfsize defines the width + sizeX = halfSize; + sizeY = halfSize/design_aspect_ratio; + } else { + // halfsize defines the height + sizeX = halfSize * design_aspect_ratio; + sizeY = halfSize; + } + + frustum.x2 = sizeX; + frustum.x1 = -frustum.x2; + frustum.y2 = sizeY; + frustum.y1 = -frustum.y2; + frustum.camnear = -camfar; + frustum.camfar = camfar; +} + + void RAS_FramingManager:: ComputeBestFitViewRect( @@ -227,5 +260,73 @@ ComputeFrustum( } } + void +RAS_FramingManager:: + ComputeOrtho( + const RAS_FrameSettings &settings, + const RAS_Rect &availableViewport, + const RAS_Rect &viewport, + const float scale, + const float camnear, + const float camfar, + RAS_FrameFrustum &frustum + ) +{ + RAS_FrameSettings::RAS_FrameType type = settings.FrameType(); + + const float design_width = float(settings.DesignAspectWidth()); + const float design_height = float(settings.DesignAspectHeight()); + + float design_aspect_ratio = float(1); + + if (design_height == float(0)) { + // well this is ill defined + // lets just scale the thing + type = RAS_FrameSettings::e_frame_scale; + } else { + design_aspect_ratio = design_width/design_height; + } + + + ComputeDefaultOrtho( + camnear, + camfar, + scale, + design_aspect_ratio, + frustum + ); + + switch (type) { + + case RAS_FrameSettings::e_frame_extend: + { + RAS_Rect vt; + ComputeBestFitViewRect( + availableViewport, + design_aspect_ratio, + vt + ); + + // now scale the calculated frustum by the difference + // between vt and the viewport in each axis. + // These are always > 1 + + float x_scale = float(viewport.GetWidth())/float(vt.GetWidth()); + float y_scale = float(viewport.GetHeight())/float(vt.GetHeight()); + + frustum.x1 *= x_scale; + frustum.x2 *= x_scale; + frustum.y1 *= y_scale; + frustum.y2 *= y_scale; + + break; + } + case RAS_FrameSettings::e_frame_scale : + case RAS_FrameSettings::e_frame_bars: + default : + break; + } + +} diff --git a/source/gameengine/Rasterizer/RAS_FramingManager.h b/source/gameengine/Rasterizer/RAS_FramingManager.h index 0a226ac30f9..4398e2d00c3 100644 --- a/source/gameengine/Rasterizer/RAS_FramingManager.h +++ b/source/gameengine/Rasterizer/RAS_FramingManager.h @@ -207,6 +207,18 @@ public : * and camera description */ + static + void + ComputeOrtho( + const RAS_FrameSettings &settings, + const RAS_Rect &availableViewport, + const RAS_Rect &viewport, + const float scale, + const float camnear, + const float camfar, + RAS_FrameFrustum &frustum + ); + static void ComputeFrustum( @@ -229,6 +241,16 @@ public : RAS_FrameFrustum & frustum ); + static + void + ComputeDefaultOrtho( + const float camnear, + const float camfar, + const float scale, + const float design_aspect_ratio, + RAS_FrameFrustum & frustum + ); + private : static diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h index 96472b112d6..dc8c3c1ebf8 100644 --- a/source/gameengine/Rasterizer/RAS_IRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h @@ -250,9 +250,9 @@ public: * Sets the modelview matrix. */ virtual void SetViewMatrix(const MT_Matrix4x4 & mat, - const MT_Vector3& campos, - const MT_Point3 &camLoc, - const MT_Quaternion &camOrientQuat)=0; + const MT_Matrix3x3 & ori, + const MT_Point3 & pos, + bool perspective)=0; /** */ virtual const MT_Point3& GetCameraPosition()=0; @@ -326,6 +326,26 @@ public: float focallength = 0.0f, bool perspective = true )=0; + + /** + * Generates a orthographic projection matrix from the specified frustum. + * @param left the left clipping plane + * @param right the right clipping plane + * @param bottom the bottom clipping plane + * @param top the top clipping plane + * @param frustnear the near clipping plane + * @param frustfar the far clipping plane + * @return a 4x4 matrix representing the projection transform. + */ + virtual MT_Matrix4x4 GetOrthoMatrix( + float left, + float right, + float bottom, + float top, + float frustnear, + float frustfar + )=0; + /** * Sets the specular color component of the lighting equation. */ diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index bf50cde2280..3fe5e26abc3 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -921,17 +921,40 @@ MT_Matrix4x4 RAS_OpenGLRasterizer::GetFrustumMatrix( return result; } +MT_Matrix4x4 RAS_OpenGLRasterizer::GetOrthoMatrix( + float left, + float right, + float bottom, + float top, + float frustnear, + float frustfar +){ + MT_Matrix4x4 result; + double mat[16]; + + // stereo is meaning less for orthographic, disable it + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(left, right, bottom, top, frustnear, frustfar); + + glGetDoublev(GL_PROJECTION_MATRIX, mat); + result.setValue(mat); + + return result; +} + // next arguments probably contain redundant info, for later... -void RAS_OpenGLRasterizer::SetViewMatrix(const MT_Matrix4x4 &mat, const MT_Vector3& campos, - const MT_Point3 &, const MT_Quaternion &camOrientQuat) +void RAS_OpenGLRasterizer::SetViewMatrix(const MT_Matrix4x4 &mat, + const MT_Matrix3x3 & camOrientMat3x3, + const MT_Point3 & pos, + bool perspective) { m_viewmatrix = mat; // correction for stereo - if(Stereo()) + if(Stereo() && perspective) { - MT_Matrix3x3 camOrientMat3x3(camOrientQuat); MT_Vector3 unitViewDir(0.0, -1.0, 0.0); // minus y direction, Blender convention MT_Vector3 unitViewupVec(0.0, 0.0, 1.0); MT_Vector3 viewDir, viewupVec; @@ -977,7 +1000,7 @@ void RAS_OpenGLRasterizer::SetViewMatrix(const MT_Matrix4x4 &mat, const MT_Vecto glMatrixMode(GL_MODELVIEW); glLoadMatrixd(glviewmat); - m_campos = campos; + m_campos = pos; } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h index 6013946fadf..4d51a477d48 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h @@ -163,9 +163,9 @@ public: virtual void SetProjectionMatrix(const MT_Matrix4x4 & mat); virtual void SetViewMatrix( const MT_Matrix4x4 & mat, - const MT_Vector3& campos, - const MT_Point3 &camLoc, - const MT_Quaternion &camOrientQuat + const MT_Matrix3x3 & ori, + const MT_Point3 & pos, + bool perspective ); virtual const MT_Point3& GetCameraPosition(); @@ -216,6 +216,15 @@ public: bool perspective ); + virtual MT_Matrix4x4 GetOrthoMatrix( + float left, + float right, + float bottom, + float top, + float frustnear, + float frustfar + ); + virtual void SetSpecularity( float specX, float specY, diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index 9a3c4fea70e..f1df47af373 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -181,7 +181,6 @@ void ImageRender::Render() frustrum.camnear = -mirrorOffset[2]; frustrum.camfar = -mirrorOffset[2]+m_clip; } - const float ortho = 100.0; const RAS_IRasterizer::StereoMode stereomode = m_rasterizer->GetStereoMode(); // The screen area that ImageViewport will copy is also the rendering zone @@ -214,37 +213,44 @@ void ImageRender::Render() float farfrust = m_camera->GetCameraFar(); float aspect_ratio = 1.0f; Scene *blenderScene = m_scene->GetBlenderScene(); + MT_Matrix4x4 projmat; - if (orthographic) { - lens *= ortho; - nearfrust = (nearfrust + 1.0)*ortho; - farfrust *= ortho; - } // compute the aspect ratio from frame blender scene settings so that render to texture // works the same in Blender and in Blender player if (blenderScene->r.ysch != 0) - aspect_ratio = float(blenderScene->r.xsch) / float(blenderScene->r.ysch); - - RAS_FramingManager::ComputeDefaultFrustum( - nearfrust, - farfrust, - lens, - aspect_ratio, - frustrum); - - MT_Matrix4x4 projmat = m_rasterizer->GetFrustumMatrix( - frustrum.x1, frustrum.x2, frustrum.y1, frustrum.y2, frustrum.camnear, frustrum.camfar); - + aspect_ratio = float(blenderScene->r.xsch*blenderScene->r.xasp) / float(blenderScene->r.ysch*blenderScene->r.yasp); + + if (orthographic) { + + RAS_FramingManager::ComputeDefaultOrtho( + nearfrust, + farfrust, + m_camera->GetScale(), + aspect_ratio, + frustrum + ); + + projmat = m_rasterizer->GetOrthoMatrix( + frustrum.x1, frustrum.x2, frustrum.y1, frustrum.y2, frustrum.camnear, frustrum.camfar); + } else + { + RAS_FramingManager::ComputeDefaultFrustum( + nearfrust, + farfrust, + lens, + aspect_ratio, + frustrum); + + projmat = m_rasterizer->GetFrustumMatrix( + frustrum.x1, frustrum.x2, frustrum.y1, frustrum.y2, frustrum.camnear, frustrum.camfar); + } m_camera->SetProjectionMatrix(projmat); } MT_Transform camtrans(m_camera->GetWorldToCamera()); - if (!m_camera->GetCameraData()->m_perspective) - camtrans.getOrigin()[2] *= ortho; MT_Matrix4x4 viewmat(camtrans); - m_rasterizer->SetViewMatrix(viewmat, m_camera->NodeGetWorldPosition(), - m_camera->GetCameraLocation(), m_camera->GetCameraOrientation()); + m_rasterizer->SetViewMatrix(viewmat, m_camera->NodeGetWorldOrientation(), m_camera->NodeGetWorldPosition(), m_camera->GetCameraData()->m_perspective); m_camera->SetModelviewMatrix(viewmat); // restore the stereo mode now that the matrix is computed m_rasterizer->SetStereoMode(stereomode); -- cgit v1.2.3 From af1c25c9d0b69a268a2ac824b8ab0e3032d5f110 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Sun, 26 Apr 2009 13:26:18 +0000 Subject: Fixed shrinkwrap bug: shrinkwrap wasn't using the updated coordinates/normals of vertexs when the DerivedMesh had been modified by a previous modifier. before revision 19744, users would only notice a strange behaviour of shrinkwrap in projection mode (because it was using the wrong normals) (jpbouza reported this) after revision 19744 this bug was "bigger". Anyway it's fixed now :) --- source/blender/blenkernel/intern/modifier.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 10bcb2e09f2..c9f6bc18abd 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7915,7 +7915,7 @@ static void shrinkwrapModifier_deformVerts(ModifierData *md, Object *ob, Derived else if(ob->type==OB_LATTICE) dm = NULL; else return; - if(dm != NULL && (dataMask & CD_MVERT)) + if(dm != NULL && (dataMask & (1<type==OB_LATTICE) dm = NULL; else return; - if(dm != NULL && (dataMask & CD_MVERT)) + if(dm != NULL && (dataMask & (1< Date: Sun, 26 Apr 2009 18:38:16 +0000 Subject: Missing end-of-line. --- source/blender/blenkernel/intern/particle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 3fea9e44acb..0ebdcdf58e0 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3974,4 +3974,4 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3] VECADDFAC(center, bb->vec, xvec, bb->offset[0]); VECADDFAC(center, center, yvec, bb->offset[1]); -} \ No newline at end of file +} -- cgit v1.2.3 From ce3aabb4e78b16f570db9268b4a71b762d36b290 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 26 Apr 2009 21:23:59 +0000 Subject: Rewind own commit that aimed to make converting meshes faster at startup. Some files probably need to have UV's welded so better do this even though it seems inefficient. --- source/gameengine/Rasterizer/RAS_TexVert.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/gameengine/Rasterizer/RAS_TexVert.cpp b/source/gameengine/Rasterizer/RAS_TexVert.cpp index 210addfb927..60b00be5705 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.cpp +++ b/source/gameengine/Rasterizer/RAS_TexVert.cpp @@ -113,19 +113,18 @@ void RAS_TexVert::SetTangent(const MT_Vector3& tangent) tangent.getValue(m_tangent); } + // compare two vertices, and return TRUE if both are almost identical (they can be shared) -#define _VEC_EQUAL3(_v1, _v2) (_v1[0]==_v2[0] && _v1[1]==_v2[1] && _v1[2]==_v2[2]) -#define _VEC_EQUAL2(_v1, _v2) (_v1[0]==_v2[0] && _v1[1]==_v2[1]) bool RAS_TexVert::closeTo(const RAS_TexVert* other) { return (m_flag == other->m_flag && m_rgba == other->m_rgba && - _VEC_EQUAL3(m_normal, other->m_normal) && - _VEC_EQUAL3(m_tangent, other->m_tangent) && - _VEC_EQUAL2(m_uv1, other->m_uv1) && - _VEC_EQUAL2(m_uv2, other->m_uv2) // p -- - /* we know the verts must be shared so dont need to check this */ - /*&& FAST_MT_fuzzyEqual3(m_localxyz, other->m_localxyz)*/) ; + MT_fuzzyEqual(MT_Vector3(m_normal), MT_Vector3(other->m_normal)) && + MT_fuzzyEqual(MT_Vector3(m_tangent), MT_Vector3(other->m_tangent)) && + MT_fuzzyEqual(MT_Vector2(m_uv1), MT_Vector2(other->m_uv1)) && + MT_fuzzyEqual(MT_Vector2(m_uv2), MT_Vector2(other->m_uv2)) /* && + MT_fuzzyEqual(MT_Vector3(m_localxyz), MT_Vector3(other->m_localxyz))*/) ; + /* dont bother comparing m_localxyz since we know there from the same vert */ } short RAS_TexVert::getFlag() const -- cgit v1.2.3 From 7a042dcc3a0091fd351b116414e432623daefa6e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 26 Apr 2009 21:30:42 +0000 Subject: [#18623] projection paint alpha paintingacts as 1bit -- 2.49RC1 Also fixed... - smear with alpha channels (had to disabled blending modes). - using uninitialized memory in a few cases. - negative index in an array bug. --- source/blender/src/imagepaint.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'source') diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c index 4d6c0898bce..478debfb922 100644 --- a/source/blender/src/imagepaint.c +++ b/source/blender/src/imagepaint.c @@ -707,7 +707,7 @@ static int project_paint_PickColor(const ProjPaintState *ps, float pt[2], float Vec2Weightf(uv, tf->uv[0], tf->uv[2], tf->uv[3], w); } - ibuf = BKE_image_get_ibuf((Image *)tf->tpage, NULL); /* TODO - this may be slow, the only way around it is to have an ibuf index per face */ + ibuf = tf->tpage->ibufs.first; /* we must have got the imbuf before getting here */ if (!ibuf) return 0; if (interp) { @@ -1362,7 +1362,7 @@ float project_paint_uvpixel_mask( ImBuf *ibuf_other; const MTFace *tf_other = ps->dm_mtface_mask + face_index; - if (tf_other->tpage && (ibuf_other = BKE_image_get_ibuf((Image *)tf_other->tpage, NULL))) { + if (tf_other->tpage && (ibuf_other = BKE_image_get_ibuf(tf_other->tpage, NULL))) { /* BKE_image_get_ibuf - TODO - this may be slow */ unsigned char rgba_ub[4]; float rgba_f[4]; @@ -1518,7 +1518,7 @@ static ProjPixel *project_paint_uvpixel_init( ImBuf *ibuf_other; const MTFace *tf_other = ps->dm_mtface_clone + face_index; - if (tf_other->tpage && (ibuf_other = BKE_image_get_ibuf((Image *)tf_other->tpage, NULL))) { + if (tf_other->tpage && (ibuf_other = BKE_image_get_ibuf(tf_other->tpage, NULL))) { /* BKE_image_get_ibuf - TODO - this may be slow */ if (ibuf->rect_float) { @@ -1969,7 +1969,6 @@ static void project_bucket_clip_face( const int flip = ((SIDE_OF_LINE(v1coSS, v2coSS, v3coSS) > 0.0f) != (SIDE_OF_LINE(uv1co, uv2co, uv3co) > 0.0f)); float bucket_bounds_ss[4][2]; - float w[3]; /* get the UV space bounding box */ inside_bucket_flag |= BLI_in_rctf(bucket_bounds, v1coSS[0], v1coSS[1]); @@ -2040,6 +2039,7 @@ static void project_bucket_clip_face( /* Maximum possible 6 intersections when using a rectangle and triangle */ float isectVCosSS[8][3]; /* The 3rd float is used to store angle for qsort(), NOT as a Z location */ float v1_clipSS[2], v2_clipSS[2]; + float w[3]; /* calc center*/ float cent[2] = {0.0f, 0.0f}; @@ -2082,6 +2082,7 @@ static void project_bucket_clip_face( if ((*tot) < 3) { /* no intersections to speak of */ *tot = 0; + return; } /* now we have all points we need, collect their angles and sort them clockwise */ @@ -2116,7 +2117,6 @@ static void project_bucket_clip_face( if (flip) qsort(isectVCosSS, *tot, sizeof(float)*3, float_z_sort_flip); else qsort(isectVCosSS, *tot, sizeof(float)*3, float_z_sort); - /* remove doubles */ /* first/last check */ if (fabs(isectVCosSS[0][0]-isectVCosSS[(*tot)-1][0]) < PROJ_GEOM_TOLERANCE && fabs(isectVCosSS[0][1]-isectVCosSS[(*tot)-1][1]) < PROJ_GEOM_TOLERANCE) { @@ -3030,7 +3030,7 @@ static void project_paint_begin(ProjPaintState *ps, short mval[2]) ps->buckets_x = (int)(ps->screen_width / (((float)ps->brush->size) / PROJ_BUCKET_BRUSH_DIV)); ps->buckets_y = (int)(ps->screen_height / (((float)ps->brush->size) / PROJ_BUCKET_BRUSH_DIV)); - printf("\tscreenspace bucket division x:%d y:%d\n", ps->buckets_x, ps->buckets_y); + /* printf("\tscreenspace bucket division x:%d y:%d\n", ps->buckets_x, ps->buckets_y); */ /* really high values could cause problems since it has to allocate a few * (ps->buckets_x*ps->buckets_y) sized arrays */ @@ -3203,7 +3203,7 @@ static void project_paint_begin(ProjPaintState *ps, short mval[2]) image_index = BLI_linklist_index(image_LinkList, tf->tpage); - if (image_index==-1 && BKE_image_get_ibuf((Image *)tf->tpage, NULL)) { /* MemArena dosnt have an append func */ + if (image_index==-1 && BKE_image_get_ibuf(tf->tpage, NULL)) { /* MemArena dosnt have an append func */ BLI_linklist_append(&image_LinkList, tf->tpage); image_index = ps->image_tot; ps->image_tot++; @@ -3225,10 +3225,10 @@ static void project_paint_begin(ProjPaintState *ps, short mval[2]) for (node= image_LinkList, i=0; node; node= node->next, i++, projIma++) { projIma->ima = node->link; - // calloced - projIma->touch = 0; + projIma->touch = 0; projIma->ibuf = BKE_image_get_ibuf(projIma->ima, NULL); projIma->partRedrawRect = BLI_memarena_alloc(arena, sizeof(ImagePaintPartialRedraw) * PROJ_BOUNDBOX_SQUARED); - // calloced - memset(projIma->partRedrawRect, 0, sizeof(ImagePaintPartialRedraw) * PROJ_BOUNDBOX_SQUARED); + memset(projIma->partRedrawRect, 0, sizeof(ImagePaintPartialRedraw) * PROJ_BOUNDBOX_SQUARED); } /* we have built the array, discard the linked list */ @@ -3378,7 +3378,7 @@ static void partial_redraw_array_init(ImagePaintPartialRedraw *pr) static int partial_redraw_array_merge(ImagePaintPartialRedraw *pr, ImagePaintPartialRedraw *pr_other, int tot) { - int touch; + int touch= 0; while (tot--) { pr->x1 = MIN2(pr->x1, pr_other->x1); pr->y1 = MIN2(pr->y1, pr_other->y1); @@ -3506,6 +3506,7 @@ static void blend_color_mix(unsigned char *cp, const unsigned char *cp1, const u cp[0]= (mfac*cp1[0]+fac*cp2[0])/255; cp[1]= (mfac*cp1[1]+fac*cp2[1])/255; cp[2]= (mfac*cp1[2]+fac*cp2[2])/255; + cp[3]= (mfac*cp1[3]+fac*cp2[3])/255; } static void blend_color_mix_float(float *cp, const float *cp1, const float *cp2, const float fac) @@ -3514,6 +3515,7 @@ static void blend_color_mix_float(float *cp, const float *cp1, const float *cp2, cp[0]= mfac*cp1[0] + fac*cp2[0]; cp[1]= mfac*cp1[1] + fac*cp2[1]; cp[2]= mfac*cp1[2] + fac*cp2[2]; + cp[3]= mfac*cp1[3] + fac*cp2[3]; } static void do_projectpaint_clone(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask) @@ -3550,8 +3552,8 @@ static void do_projectpaint_smear(ProjPaintState *ps, ProjPixel *projPixel, floa if (project_paint_PickColor(ps, co, NULL, rgba_ub, 1)==0) return; - - ((ProjPixelClone *)projPixel)->clonepx.uint = IMB_blend_color(*projPixel->pixel.uint_pt, *((unsigned int *)rgba_ub), (int)(alpha*mask*255), ps->blend); + /* ((ProjPixelClone *)projPixel)->clonepx.uint = IMB_blend_color(*projPixel->pixel.uint_pt, *((unsigned int *)rgba_ub), (int)(alpha*mask*255), ps->blend); */ + blend_color_mix(((ProjPixelClone *)projPixel)->clonepx.ch, projPixel->pixel.ch_pt, rgba_ub, (int)(alpha*mask*255)); BLI_linklist_prepend_arena(smearPixels, (void *)projPixel, smearArena); } @@ -3564,7 +3566,8 @@ static void do_projectpaint_smear_f(ProjPaintState *ps, ProjPixel *projPixel, fl return; IMAPAINT_FLOAT_RGBA_TO_CHAR(rgba_smear, projPixel->pixel.f_pt); - ((ProjPixelClone *)projPixel)->clonepx.uint = IMB_blend_color(*((unsigned int *)rgba_smear), *((unsigned int *)rgba_ub), (int)(alpha*mask*255), ps->blend); + /* (ProjPixelClone *)projPixel)->clonepx.uint = IMB_blend_color(*((unsigned int *)rgba_smear), *((unsigned int *)rgba_ub), (int)(alpha*mask*255), ps->blend); */ + blend_color_mix(((ProjPixelClone *)projPixel)->clonepx.ch, rgba_smear, (rgba_ub), (int)(alpha*mask*255)); BLI_linklist_prepend_arena(smearPixels_f, (void *)projPixel, smearArena); } @@ -4325,7 +4328,7 @@ static void imapaint_paint_stroke(ImagePaintState *s, BrushPainter *painter, sho ) { ImBuf *ibuf; - newimage = (Image*)((s->me->mtface+newfaceindex)->tpage); + newimage = (s->me->mtface+newfaceindex)->tpage; ibuf= BKE_image_get_ibuf(newimage, G.sima?&G.sima->iuser:NULL); if(ibuf && ibuf->rect) -- cgit v1.2.3 From 310356a732d9460bd647c8e5b465bed6ae037e89 Mon Sep 17 00:00:00 2001 From: Andre Susano Pinto Date: Sun, 26 Apr 2009 21:33:22 +0000 Subject: Shrinkwrap fix (before I only fixed normal projection) nearest surface + nearest vertex fixed now --- source/blender/blenkernel/intern/shrinkwrap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 6784f014efa..69ce9f3d5cd 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -191,7 +191,7 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM calc.vgroup = get_named_vertexgroup_num(calc.ob, smd->vgroup_name); - if(dm != NULL) + if(dm != NULL && smd->shrinkType == MOD_SHRINKWRAP_PROJECT) { //Setup arrays to get vertexs positions, normals and deform weights calc.vert = dm->getVertDataArray(dm, CD_MVERT); -- cgit v1.2.3 From f64265d714e0497a3a78423334e2248244d9c18f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 27 Apr 2009 00:49:01 +0000 Subject: Bugfix #18603: Clear User Transform does not work -- 2.49RC1 Modified the behaviour of Clear User Transform so that when there's no action, Clear User Transform now resets the entire pose to the rest pose. However, when there is an action, the pose on selected bones gets cleared to the pose defined in the action, not the rest pose. --- source/blender/src/poseobject.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index c081bcbcb45..551aca0cc91 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -1748,18 +1748,25 @@ void pose_clear_user_transforms (void) if (ob->pose == NULL) return; - /* find selected bones */ - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if (pchan->bone && (pchan->bone->flag & BONE_SELECTED) && (pchan->bone->layer & arm->layer)) { - /* just clear the BONE_UNKEYED flag, allowing this bone to get overwritten by actions again */ - pchan->bone->flag &= ~BONE_UNKEYED; + /* if the object has an action, restore pose to the pose defined by the action by clearing pose on selected bones */ + if (ob->action) { + /* find selected bones */ + for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { + if (pchan->bone && (pchan->bone->flag & BONE_SELECTED) && (pchan->bone->layer & arm->layer)) { + /* just clear the BONE_UNKEYED flag, allowing this bone to get overwritten by actions again */ + pchan->bone->flag &= ~BONE_UNKEYED; + } } + + /* clear pose locking flag + * - this will only clear the user-defined pose in the selected bones, where BONE_UNKEYED has been cleared + */ + ob->pose->flag |= POSE_DO_UNLOCK; + } + else { + /* no action, so restore entire pose to rest pose (cannot restore only selected bones) */ + rest_pose(ob->pose); } - - /* clear pose locking flag - * - this will only clear the user-defined pose in the selected bones, where BONE_UNKEYED has been cleared - */ - ob->pose->flag |= POSE_DO_UNLOCK; DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); BIF_undo_push("Clear User Transform"); -- cgit v1.2.3 From d2ff190dfbe5606e38c515ecbd43778999a00507 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Mon, 27 Apr 2009 04:21:05 +0000 Subject: Lower the vertex welding threshold, for removing duplicate/nearby vertices for soft bodies (this broke susanne softbody regression test) --- source/gameengine/Converter/KX_ConvertActuators.cpp | 2 +- source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 2 +- source/gameengine/Ketsji/KX_Scene.cpp | 2 +- source/gameengine/Ketsji/KX_Scene.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index eb2d0a1c4b1..73d35a78ded 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -38,7 +38,7 @@ #include "KX_BlenderSceneConverter.h" #include "KX_ConvertActuators.h" - +#include "SND_Scene.h" // Actuators //SCA logiclibrary native logicbricks #include "SCA_PropertyActuator.h" diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index 700c5f304e7..be3b758a14b 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -905,7 +905,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, // Soft bodies require welding. Only avoid remove doubles for non-soft bodies! if (objprop->m_softbody) - shapeInfo->setVertexWeldingThreshold1(0.01f); //todo: expose this to the UI + shapeInfo->setVertexWeldingThreshold1(0.0001f); //todo: expose this to the UI bm = shapeInfo->CreateBulletShape(); //no moving concave meshes, so don't bother calculating inertia diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 0c26a6a7b3b..9e67e39b2a5 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -34,7 +34,7 @@ #include "KX_Scene.h" #include "MT_assert.h" - +#include "SND_Scene.h" #include "KX_KetsjiEngine.h" #include "KX_BlenderMaterial.h" #include "RAS_IPolygonMaterial.h" diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 83a4692f815..dbba7723cc5 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -43,7 +43,7 @@ #include "SG_IObject.h" #include "SCA_IScene.h" #include "MT_Transform.h" -#include "SND_Scene.h" + #include "RAS_FramingManager.h" #include "RAS_Rect.h" -- cgit v1.2.3 From 5d1d6ad4d19cf2b76abb9ed323027f194a65e2a0 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Mon, 27 Apr 2009 05:06:24 +0000 Subject: Don't always activate a Bullet rigid body If you want to keep a rigid body awake, please use the GUI 'No Sleeping' option for Rigid bodies. --- source/gameengine/Ketsji/KX_BulletPhysicsController.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp index 831f9241fec..bc5a64d36a8 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp @@ -438,8 +438,6 @@ SG_Controller* KX_BulletPhysicsController::GetReplica(class SG_Node* destnode) void KX_BulletPhysicsController::SetSumoTransform(bool nondynaonly) { - if (GetRigidBody()) - GetRigidBody()->activate(true); if (!m_bDyna) { -- cgit v1.2.3 From 9c3d628082035c8b7ff49aa6e72898345a683584 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 27 Apr 2009 07:07:22 +0000 Subject: [#18616] Scons+MinGW compiling error with gaming engine enabled. Attempt to fix building in windows with mingw --- source/creator/creator.c | 6 +++--- source/gameengine/Expressions/InputParser.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/creator/creator.c b/source/creator/creator.c index 74e899d2d14..a1531fd7180 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -538,10 +538,10 @@ int main(int argc, char **argv) BLI_where_is_temp( btempdir, 1 ); /* call after loading the .B.blend so we can read U.tempdir */ #ifndef DISABLE_SDL -#ifndef WIN32 - setenv("SDL_VIDEODRIVER", "dummy", 1); /* initializing the video driver can cause crashes on some systems - Campbell */ -#else +#if (defined(WIN32) || defined(WIN64)) && !defined(FREE_WINDOWS) _putenv_s("SDL_VIDEODRIVER", "dummy"); +#else + setenv("SDL_VIDEODRIVER", "dummy", 1); /* initializing the video driver can cause crashes on some systems - Campbell */ #endif #ifdef __linux__ /* On linux the default SDL driver dma often would not play diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp index 66075dd8d42..834dff7af89 100644 --- a/source/gameengine/Expressions/InputParser.cpp +++ b/source/gameengine/Expressions/InputParser.cpp @@ -38,7 +38,7 @@ // cool things like (IF(LOD==1,CCurvedValue,IF(LOD==2,CCurvedValue2)) etc... #include "IfExpr.h" -#if defined(WIN32) || defined(WIN64) +#if (defined(WIN32) || defined(WIN64)) && !defined(FREE_WINDOWS) #define strcasecmp _stricmp #ifndef strtoll -- cgit v1.2.3 From 22df42cdecbf29d886ea6cf81810ecbc575522e4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 27 Apr 2009 11:49:40 +0000 Subject: Fix for bug #18032: AAO pixel cache + refraction artifacts, the pixel cache can only be used for the first hit. --- source/blender/render/intern/source/occlusion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index 494feb96c18..f9301bc0805 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -1632,7 +1632,7 @@ void sample_occ(Render *re, ShadeInput *shi) sample_occ_surface(shi); } /* try to get result from the cache if possible */ - else if(!sample_occ_cache(tree, shi->co, shi->vno, shi->xs, shi->ys, shi->thread, shi->ao)) { + else if(shi->depth!=0 || !sample_occ_cache(tree, shi->co, shi->vno, shi->xs, shi->ys, shi->thread, shi->ao)) { /* no luck, let's sample the occlusion */ exclude.obi= shi->obi - re->objectinstance; exclude.facenr= shi->vlr->index; -- cgit v1.2.3 From e2582ba6c1eb075a3971c7a51e4873a954120c47 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 27 Apr 2009 12:18:18 +0000 Subject: Fix for bug #18610: in the Game menu enabling "Record Game Physics to IPO" made "Generate Display Lists" hidden (these work fine together). --- source/blender/src/header_info.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c index 612836c86e9..71abed0d806 100644 --- a/source/blender/src/header_info.c +++ b/source/blender/src/header_info.c @@ -1720,15 +1720,15 @@ static uiBlock *info_gamemenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Enable All Frames", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_ENABLE_ALL_FRAMES, ""); } - if(G.fileflags & G_FILE_GAME_TO_IPO) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Record Game Physics to IPO", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_TO_IPO, ""); - } else { - if(G.fileflags & G_FILE_DISPLAY_LISTS) { uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Generate Display Lists", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_DISPLAY_LISTS, ""); } else { uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Generate Display Lists", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_DISPLAY_LISTS, ""); } + + if(G.fileflags & G_FILE_GAME_TO_IPO) { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Record Game Physics to IPO", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_TO_IPO, ""); + } else { uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Record Game Physics to IPO", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_TO_IPO, ""); } -- cgit v1.2.3 From 369c8b8055da5f43f52158fc629b6bb4e112d8a8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 27 Apr 2009 14:22:02 +0000 Subject: [#18628] stuck triangle when projection painting -- 2.49RC1 Increasing the tolerance when making intersection comparisons fixed this. There is also a problem where a pixel aligned quad would get a diagonal line down the face. offset the pixel locations a little to avoid this (crappy I know but will fix most cases). --- source/blender/src/imagepaint.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c index 478debfb922..89dff67585e 100644 --- a/source/blender/src/imagepaint.c +++ b/source/blender/src/imagepaint.c @@ -186,7 +186,7 @@ typedef struct ImagePaintPartialRedraw { // #define PROJ_BUCKET_CLONE_INIT 1<<1 /* used for testing doubles, if a point is on a line etc */ -#define PROJ_GEOM_TOLERANCE 0.0002f +#define PROJ_GEOM_TOLERANCE 0.00075f /* vert flags */ #define PROJ_VERT_CULL 1 @@ -2315,9 +2315,20 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i /* Use tf_uv_pxoffset instead of tf->uv so we can offset the UV half a pixel * this is done so we can avoid offseting all the pixels by 0.5 which causes * problems when wrapping negative coords */ - xhalfpx = 0.5f / ibuf_xf; - yhalfpx = 0.5f / ibuf_yf; - + xhalfpx = (0.5f+ (PROJ_GEOM_TOLERANCE/3.0f) ) / ibuf_xf; + yhalfpx = (0.5f+ (PROJ_GEOM_TOLERANCE/4.0f) ) / ibuf_yf; + + /* Note about (PROJ_GEOM_TOLERANCE/x) above... + Needed to add this offset since UV coords are often quads aligned to pixels. + In this case pixels can be exactly between 2 triangles causing nasty + artifacts. + + This workaround can be removed and painting will still work on most cases + but since the first thing most people try is painting onto a quad- better make it work. + */ + + + tf_uv_pxoffset[0][0] = tf->uv[0][0] - xhalfpx; tf_uv_pxoffset[0][1] = tf->uv[0][1] - yhalfpx; -- cgit v1.2.3 From c56ee09c48b4d29dabe1c7daa2133777c27944f6 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 27 Apr 2009 16:40:26 +0000 Subject: BGE bug #18624: Collision detection fails on parented objects. Partial fix, parented shape now moves with the parent but still the parent near detector detects the child only in the zone where it was parented. --- source/gameengine/Ketsji/KX_BulletPhysicsController.cpp | 3 +++ source/gameengine/Ketsji/KX_BulletPhysicsController.h | 1 + 2 files changed, 4 insertions(+) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp index bc5a64d36a8..891317e64a1 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp @@ -361,6 +361,7 @@ void KX_BulletPhysicsController::SuspendDynamics(bool ghost) btBroadphaseProxy* handle = body->getBroadphaseHandle(); m_savedCollisionFlags = body->getCollisionFlags(); m_savedMass = GetMass(); + m_savedDyna = m_bDyna; m_savedCollisionFilterGroup = handle->m_collisionFilterGroup; m_savedCollisionFilterMask = handle->m_collisionFilterMask; m_savedActivationState = body->getActivationState(); @@ -370,6 +371,7 @@ void KX_BulletPhysicsController::SuspendDynamics(bool ghost) btCollisionObject::CF_STATIC_OBJECT|((ghost)?btCollisionObject::CF_NO_CONTACT_RESPONSE:(m_savedCollisionFlags&btCollisionObject::CF_NO_CONTACT_RESPONSE)), btBroadphaseProxy::StaticFilter, btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter); + m_bDyna = false; } } @@ -384,6 +386,7 @@ void KX_BulletPhysicsController::RestoreDynamics() m_savedCollisionFilterGroup, m_savedCollisionFilterMask); body->forceActivationState(m_savedActivationState); + m_bDyna = m_savedDyna; } } diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h index b39098206f7..2174f0db499 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h @@ -13,6 +13,7 @@ private: short int m_savedCollisionFilterGroup; short int m_savedCollisionFilterMask; MT_Scalar m_savedMass; + bool m_savedDyna; btCollisionShape* m_bulletChildShape; public: -- cgit v1.2.3 From 352eaccd5d991ad8966d686ae0954c7a0b03345c Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 27 Apr 2009 16:44:02 +0000 Subject: BGE: Add soft body welding parameter to the Advanced Settings panel. The values are very small so I chose to use logarithmic scale. Should be fine, it's an advanced setting after all. --- source/blender/blenkernel/intern/bullet.c | 1 + source/blender/makesdna/DNA_object_force.h | 2 +- source/blender/src/buttons_logic.c | 20 ++++++++++++++------ .../Converter/BL_BlenderDataConversion.cpp | 5 +++++ source/gameengine/Ketsji/KX_ConvertPhysicsObject.h | 1 + .../gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 4 +++- source/gameengine/Ketsji/KX_GameObject.cpp | 8 ++++---- 7 files changed, 29 insertions(+), 12 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/bullet.c b/source/blender/blenkernel/intern/bullet.c index b389f8c0536..657507ee048 100644 --- a/source/blender/blenkernel/intern/bullet.c +++ b/source/blender/blenkernel/intern/bullet.c @@ -82,6 +82,7 @@ BulletSoftBody *bsbNew(void) bsb->collisionflags = 0; //bsb->collisionflags = OB_BSB_COL_CL_RS + OB_BSB_COL_CL_SS; bsb->numclusteriterations = 64; + bsb->welding = -4.f; return bsb; } diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 49435000820..73dd8b28d15 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -119,7 +119,7 @@ typedef struct BulletSoftBody { float kAHR; /* Anchors hardness [0,1] */ int collisionflags; /* Vertex/Face or Signed Distance Field(SDF) or Clusters, Soft versus Soft or Rigid */ int numclusteriterations; /* number of iterations to refine collision clusters*/ - + float welding; /* welding limit to remove duplicate/nearby vertices, 0.0000001..0.01 */ } BulletSoftBody; /* BulletSoftBody.flag */ diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 0a7bbf656b3..8b6cc457994 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -3073,19 +3073,19 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) { uiBlock *block; Object *ob = arg_ob; - short yco = 20, xco = 0; + short yco, xco = 0; block= uiNewBlock(&curarea->uiblocks, "advanced_bullet_options", UI_EMBOSS, UI_HELV, curarea->win); /* use this for a fake extra empy space around the buttons */ if (ob->gameflag & OB_SOFT_BODY) { - uiDefBut(block, LABEL, 0, "", -10, -10, 380, 60, NULL, 0, 0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "", -10, -10, 380, 80, NULL, 0, 0, 0, 0, ""); if (ob->bsoft) { - + yco = 40; uiBlockBeginAlign(block); uiDefButBitI(block, TOG, OB_BSB_COL_CL_RS, 0, "Cluster Collision RS", xco, yco, 180, 19, &ob->bsoft->collisionflags, 0, 0, 0, 0, @@ -3102,6 +3102,14 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) xco+=180, yco, 180, 19, &ob->bsoft->piterations, 0, 10, 0, 0, "Position solver iterations"); uiBlockEndAlign(block); + yco -= 20; + xco = 0; + if (ob->bsoft->welding == 0.f) + ob->bsoft->welding = -4.f; + + uiDefButF(block, NUMSLI, 0, "Welding(10^) ", + xco, yco, 360, 19, &ob->bsoft->welding, -7.f, -2.f, 10, 2, + "Threshold to remove duplicate/nearby vertices. Displayed in logarithmic scale for readability: linear values from 0.0000001 to 0.01"); /* //too complex tweaking, disable for now @@ -3131,7 +3139,7 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) if (ob->gameflag & OB_DYNAMIC) { - yco = 100; + yco = 80; uiDefBut(block, LABEL, 0, "", -10, -10, 380, 120, NULL, 0, 0, 0, 0, ""); uiBlockBeginAlign(block); if (ob->margin < 0.001f) @@ -3173,7 +3181,7 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) uiBlockEndAlign(block); - uiDefBut(block, LABEL, 0, "Clamp Velocity (zero disables)", xco, yco, 180*2, 19, NULL, 0, 0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "Clamp Velocity (0=disabled)", xco, yco, 180*2, 19, NULL, 0, 0, 0, 0, ""); uiBlockBeginAlign(block); @@ -3215,7 +3223,7 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) } else { - + yco = 20; uiDefBut(block, LABEL, 0, "", -10, -10, 380, 60, NULL, 0, 0, 0, 0, ""); uiDefButF(block, NUM, 0, "Margin", xco, yco, 180, 19, &ob->margin, 0.0, 1.0, 1, 0, diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 962af7cc4c9..b330515c0d3 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1418,6 +1418,10 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, objprop.m_soft_kAHR= blenderobject->bsoft->kAHR; /* Anchors hardness [0,1] */ objprop.m_soft_collisionflags= blenderobject->bsoft->collisionflags; /* Vertex/Face or Signed Distance Field(SDF) or Clusters, Soft versus Soft or Rigid */ objprop.m_soft_numclusteriterations= blenderobject->bsoft->numclusteriterations; /* number of iterations to refine collision clusters*/ + if (blenderobject->bsoft->welding == 0.f) + objprop.m_soft_welding = 0.0001f; /* welding */ + else + objprop.m_soft_welding = pow(10.f,blenderobject->bsoft->welding); /* welding */ } else { @@ -1457,6 +1461,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, objprop.m_soft_kAHR= 0.7f; objprop.m_soft_collisionflags= OB_BSB_COL_SDF_RS + OB_BSB_COL_VF_SS; objprop.m_soft_numclusteriterations= 16; + objprop.m_soft_welding = 0.0001f; } } diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h b/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h index 3534500e619..40c715974f9 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h @@ -124,6 +124,7 @@ struct KX_ObjectProperties float m_soft_kAHR; /* Anchors hardness [0,1] */ int m_soft_collisionflags; /* Vertex/Face or Signed Distance Field(SDF) or Clusters, Soft versus Soft or Rigid */ int m_soft_numclusteriterations; /* number of iterations to refine collision clusters*/ + float m_soft_welding; /* threshold to remove duplicate/nearby vertices */ ///////////////////////// diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index be3b758a14b..1943c436258 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -905,7 +905,9 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, // Soft bodies require welding. Only avoid remove doubles for non-soft bodies! if (objprop->m_softbody) - shapeInfo->setVertexWeldingThreshold1(0.0001f); //todo: expose this to the UI + { + shapeInfo->setVertexWeldingThreshold1(objprop->m_soft_welding); //todo: expose this to the UI + } bm = shapeInfo->CreateBulletShape(); //no moving concave meshes, so don't bother calculating inertia diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 297d3048a3a..53c2d6c7937 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -462,11 +462,11 @@ void KX_GameObject::RemoveMeshes() void KX_GameObject::UpdateTransform() { - if (m_pPhysicsController1) - // only update the transform of static object, dynamic object are handled differently - // note that for bullet, this does not even update the transform of static object + // HACK: saves function call for dynamic object, they are handled differently + if (m_pPhysicsController1 && !m_pPhysicsController1->IsDyna()) + // Note that for Bullet, this does not even update the transform of static object // but merely sets there collision flag to "kinematic" because the synchronization is - // done differently during physics simulation + // done during physics simulation m_pPhysicsController1->SetSumoTransform(true); if (m_pGraphicController) // update the culling tree -- cgit v1.2.3 From dc664e3925d97f1a8bef8c85d5a47941e0866ad4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 27 Apr 2009 17:53:41 +0000 Subject: TexVert sharing was disabled for flat faces, this is silly since a building or any other model with flat faces will often be able to share texverts. Simple testcase with a subdivided cube used 1/3 as many texverts and spend half as much time in the rasterizer while profiling. --- source/gameengine/Rasterizer/RAS_MeshObject.cpp | 4 ++-- source/gameengine/Rasterizer/RAS_TexVert.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index 5625b172913..278aa9c75e2 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -304,7 +304,7 @@ void RAS_MeshObject::AddVertex(RAS_Polygon *poly, int i, slot = mmat->m_baseslot; darray = slot->CurrentDisplayArray(); - if(!flat) { + { /* Shared Vertex! */ /* find vertices shared between faces, with the restriction * that they exist in the same display array, and have the * same uv coordinate etc */ @@ -332,7 +332,7 @@ void RAS_MeshObject::AddVertex(RAS_Polygon *poly, int i, slot->AddPolygonVertex(offset); poly->SetVertexOffset(i, offset); - if(!flat) { + { /* Shared Vertex! */ SharedVertex shared; shared.m_darray = darray; shared.m_offset = offset; diff --git a/source/gameengine/Rasterizer/RAS_TexVert.cpp b/source/gameengine/Rasterizer/RAS_TexVert.cpp index 60b00be5705..8eee24ac7f0 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.cpp +++ b/source/gameengine/Rasterizer/RAS_TexVert.cpp @@ -117,7 +117,9 @@ void RAS_TexVert::SetTangent(const MT_Vector3& tangent) // compare two vertices, and return TRUE if both are almost identical (they can be shared) bool RAS_TexVert::closeTo(const RAS_TexVert* other) { - return (m_flag == other->m_flag && + return ( + /* m_flag == other->m_flag && */ + /* at the moment the face only stores the smooth/flat setting so dont bother comparing it */ m_rgba == other->m_rgba && MT_fuzzyEqual(MT_Vector3(m_normal), MT_Vector3(other->m_normal)) && MT_fuzzyEqual(MT_Vector3(m_tangent), MT_Vector3(other->m_tangent)) && -- cgit v1.2.3 From fa826774a3f2a2db67466d38ed26fbdb845e37a4 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Mon, 27 Apr 2009 22:14:51 +0000 Subject: CMake files changes for FFMpeg update This was broken since last month !!! --- source/creator/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index a20913bc714..f31a68365fb 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -173,14 +173,14 @@ IF(WIN32) ADD_CUSTOM_COMMAND(TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avcodec-51.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avcodec-52.dll\" \"${TARGETDIR}\\\" COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avformat-52.dll\" \"${TARGETDIR}\\\" COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avdevice-52.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avutil-49.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avutil-50.dll\" \"${TARGETDIR}\\\" COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaac-0.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaad-0.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaad-2.dll\" \"${TARGETDIR}\\\" COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libmp3lame-0.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libx264-59.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libx264-67.dll\" \"${TARGETDIR}\\\" COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\swscale-0.dll\" \"${TARGETDIR}\\\" COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\xvidcore.dll\" \"${TARGETDIR}\\\" ) -- cgit v1.2.3 From d4f8b416e92ec5b71bddfa688e9a63ea86510721 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 27 Apr 2009 22:21:42 +0000 Subject: BGE soft body: change welding option to disable welding check by default: speeds up shape conversion. This is fine if the object has no duplicate vertices. Otherwise, bullet will be extremely slow and you can either set some welding or remove duplicates in the mesh. Welding is now displayed in linear scale: 0.0 -> 0.01, no need to use logarithmic scale ;-). Fix a bug with Bullet by which vertex array for soft body must have 3xfloat stride. --- source/blender/blenkernel/intern/bullet.c | 2 +- source/blender/makesdna/DNA_object_force.h | 2 +- source/blender/src/buttons_logic.c | 9 ++-- .../Converter/BL_BlenderDataConversion.cpp | 7 +-- .../Physics/Bullet/CcdPhysicsController.cpp | 60 ++++++++++++---------- .../Physics/Bullet/CcdPhysicsController.h | 10 ++-- 6 files changed, 43 insertions(+), 47 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/bullet.c b/source/blender/blenkernel/intern/bullet.c index 657507ee048..44e8ed1f08c 100644 --- a/source/blender/blenkernel/intern/bullet.c +++ b/source/blender/blenkernel/intern/bullet.c @@ -82,7 +82,7 @@ BulletSoftBody *bsbNew(void) bsb->collisionflags = 0; //bsb->collisionflags = OB_BSB_COL_CL_RS + OB_BSB_COL_CL_SS; bsb->numclusteriterations = 64; - bsb->welding = -4.f; + bsb->welding = 0.f; return bsb; } diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 73dd8b28d15..e8e865a533c 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -119,7 +119,7 @@ typedef struct BulletSoftBody { float kAHR; /* Anchors hardness [0,1] */ int collisionflags; /* Vertex/Face or Signed Distance Field(SDF) or Clusters, Soft versus Soft or Rigid */ int numclusteriterations; /* number of iterations to refine collision clusters*/ - float welding; /* welding limit to remove duplicate/nearby vertices, 0.0000001..0.01 */ + float welding; /* welding limit to remove duplicate/nearby vertices, 0.0..0.01 */ } BulletSoftBody; /* BulletSoftBody.flag */ diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 8b6cc457994..eb65dcc6785 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -3104,12 +3104,9 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) uiBlockEndAlign(block); yco -= 20; xco = 0; - if (ob->bsoft->welding == 0.f) - ob->bsoft->welding = -4.f; - - uiDefButF(block, NUMSLI, 0, "Welding(10^) ", - xco, yco, 360, 19, &ob->bsoft->welding, -7.f, -2.f, 10, 2, - "Threshold to remove duplicate/nearby vertices. Displayed in logarithmic scale for readability: linear values from 0.0000001 to 0.01"); + uiDefButF(block, NUMSLI, 0, "Welding ", + xco, yco, 360, 19, &ob->bsoft->welding, 0.f, 0.01f, 10, 4, + "Welding threshold: distance between nearby vertices to be considered equal => set to 0.0 to disable welding test and speed up scene loading (ok if the mesh has no duplicates)"); /* //too complex tweaking, disable for now diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index b330515c0d3..ef3efbcec87 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1418,10 +1418,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, objprop.m_soft_kAHR= blenderobject->bsoft->kAHR; /* Anchors hardness [0,1] */ objprop.m_soft_collisionflags= blenderobject->bsoft->collisionflags; /* Vertex/Face or Signed Distance Field(SDF) or Clusters, Soft versus Soft or Rigid */ objprop.m_soft_numclusteriterations= blenderobject->bsoft->numclusteriterations; /* number of iterations to refine collision clusters*/ - if (blenderobject->bsoft->welding == 0.f) - objprop.m_soft_welding = 0.0001f; /* welding */ - else - objprop.m_soft_welding = pow(10.f,blenderobject->bsoft->welding); /* welding */ + objprop.m_soft_welding = blenderobject->bsoft->welding; /* welding */ } else { @@ -1461,7 +1458,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, objprop.m_soft_kAHR= 0.7f; objprop.m_soft_collisionflags= OB_BSB_COL_SDF_RS + OB_BSB_COL_VF_SS; objprop.m_soft_numclusteriterations= 16; - objprop.m_soft_welding = 0.0001f; + objprop.m_soft_welding = 0.f; } } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index b944ae085ba..b171fbb3c34 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -1368,9 +1368,9 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, bool polytope,bo } } - m_vertexArray.resize(tot_bt_verts); + m_vertexArray.resize(tot_bt_verts*3); - btVector3 *bt= &m_vertexArray[0]; + btScalar *bt= &m_vertexArray[0]; for (int p2=0; p2getXYZ(); vert_tag_array[orig_index]= false; - bt->setX(vtx[0]); bt->setY(vtx[1]); bt->setZ(vtx[2]); - bt++; + *bt++ = vtx[0]; + *bt++ = vtx[1]; + *bt++ = vtx[2]; } } } @@ -1421,11 +1422,11 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, bool polytope,bo } } - m_vertexArray.resize(tot_bt_verts); + m_vertexArray.resize(tot_bt_verts*3); m_polygonIndexArray.resize(tot_bt_tris); m_triFaceArray.resize(tot_bt_tris*3); - btVector3 *bt= &m_vertexArray[0]; + btScalar *bt= &m_vertexArray[0]; int *poly_index_pt= &m_polygonIndexArray[0]; int *tri_pt= &m_triFaceArray[0]; @@ -1459,20 +1460,23 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, bool polytope,bo if (vert_tag_array[i1]==true) { /* *** v1 *** */ vert_tag_array[i1]= false; vtx = v1->getXYZ(); - bt->setX(vtx[0]); bt->setY( vtx[1]); bt->setZ(vtx[2]); - bt++; + *bt++ = vtx[0]; + *bt++ = vtx[1]; + *bt++ = vtx[2]; } if (vert_tag_array[i2]==true) { /* *** v2 *** */ vert_tag_array[i2]= false; vtx = v2->getXYZ(); - bt->setX(vtx[0]); bt->setY(vtx[1]); bt->setZ(vtx[2]); - bt++; + *bt++ = vtx[0]; + *bt++ = vtx[1]; + *bt++ = vtx[2]; } if (vert_tag_array[i3]==true) { /* *** v3 *** */ vert_tag_array[i3]= false; vtx = v3->getXYZ(); - bt->setX(vtx[0]); bt->setY(vtx[1]); bt->setZ(vtx[2]); - bt++; + *bt++ = vtx[0]; + *bt++ = vtx[1]; + *bt++ = vtx[2]; } if (poly->VertexCount()==4) @@ -1493,8 +1497,9 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, bool polytope,bo if (vert_tag_array[i4]==true) { /* *** v4 *** */ vert_tag_array[i4]= false; vtx = v4->getXYZ(); - bt->setX(vtx[0]); bt->setY(vtx[1]); bt->setZ(vtx[2]); - bt++; + *bt++ = vtx[0]; + *bt++ = vtx[1]; + *bt++ = vtx[2]; } } } @@ -1577,7 +1582,7 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape() break; case PHY_SHAPE_POLYTOPE: - collisionShape = new btConvexHullShape(&m_vertexArray[0].getX(), m_vertexArray.size()); + collisionShape = new btConvexHullShape(&m_vertexArray[0], m_vertexArray.size()/3, 3*sizeof(btScalar)); break; case PHY_SHAPE_MESH: @@ -1594,9 +1599,9 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape() m_polygonIndexArray.size(), &m_triFaceArray[0], 3*sizeof(int), - m_vertexArray.size(), - (btScalar*) &m_vertexArray[0].x(), - sizeof(btVector3) + m_vertexArray.size()/3, + &m_vertexArray[0], + 3*sizeof(btScalar) ); btGImpactMeshShape* gimpactShape = new btGImpactMeshShape(indexVertexArrays); @@ -1619,12 +1624,13 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape() bool removeDuplicateVertices=true; // m_vertexArray not in multiple of 3 anymore, use m_triFaceArray for(int i=0; iaddTriangle( - m_vertexArray[m_triFaceArray[i]], - m_vertexArray[m_triFaceArray[i+1]], - m_vertexArray[m_triFaceArray[i+2]], - removeDuplicateVertices - ); + btScalar *bt = &m_vertexArray[3*m_triFaceArray[i]]; + btVector3 v1(bt[0], bt[1], bt[2]); + bt = &m_vertexArray[3*m_triFaceArray[i+1]]; + btVector3 v2(bt[0], bt[1], bt[2]); + bt = &m_vertexArray[3*m_triFaceArray[i+2]]; + btVector3 v3(bt[0], bt[1], bt[2]); + collisionMeshData->addTriangle(v1, v2, v3, removeDuplicateVertices); } indexVertexArrays = collisionMeshData; @@ -1634,9 +1640,9 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape() m_polygonIndexArray.size(), &m_triFaceArray[0], 3*sizeof(int), - m_vertexArray.size(), - (btScalar*) &m_vertexArray[0].x(), - sizeof(btVector3)); + m_vertexArray.size()/3, + &m_vertexArray[0], + 3*sizeof(btScalar)); } // this shape will be shared and not deleted until shapeInfo is deleted diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 4510bbddf65..4ab478b2106 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -161,8 +161,8 @@ public: btTransform m_childTrans; btVector3 m_childScale; void* m_userData; - btAlignedObjectArray m_vertexArray; // Contains both vertex array for polytope shape and - // triangle array for concave mesh shape. + btAlignedObjectArray m_vertexArray; // Contains both vertex array for polytope shape and + // triangle array for concave mesh shape. Each vertex is 3 consecutive values // In this case a triangle is made of 3 consecutive points std::vector m_polygonIndexArray; // Contains the array of polygon index in the // original mesh that correspond to shape triangles. @@ -173,11 +173,7 @@ public: void setVertexWeldingThreshold1(float threshold) { - m_weldingThreshold1 = threshold; - } - float getVertexWeldingThreshold1() const - { - return m_weldingThreshold1; + m_weldingThreshold1 = threshold*threshold; } protected: static std::map m_meshShapeMap; -- cgit v1.2.3 From eee8dd9086e5b8e1abe36fb545b07aaeba351d57 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 28 Apr 2009 13:02:49 +0000 Subject: - Updated BGE docs to match the game engines class inheritance more closely. - Grouped deprecated functions for KX_Camera, KX_GameObject, SCA_ISensor, SCA_ILogicBrick, KX_Scene --- source/gameengine/PyDoc/BL_Shader.py | 5 ++++- source/gameengine/PyDoc/CListValue.py | 4 +++- source/gameengine/PyDoc/CPropValue.py | 8 +++++++ source/gameengine/PyDoc/CValue.py | 8 +++++++ source/gameengine/PyDoc/KX_BlenderMaterial.py | 5 ++++- source/gameengine/PyDoc/KX_Camera.py | 3 +++ source/gameengine/PyDoc/KX_GameObject.py | 9 ++++---- source/gameengine/PyDoc/KX_MeshProxy.py | 4 +++- source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py | 4 +++- source/gameengine/PyDoc/KX_PolyProxy.py | 3 ++- source/gameengine/PyDoc/KX_Scene.py | 14 +++++++++++- source/gameengine/PyDoc/KX_VehicleWrapper.py | 4 +++- source/gameengine/PyDoc/KX_VertexProxy.py | 4 +++- source/gameengine/PyDoc/PyObjectPlus.py | 26 ++++++++++++++++++++++ source/gameengine/PyDoc/SCA_ILogicBrick.py | 4 +++- source/gameengine/PyDoc/SCA_IObject.py | 9 ++++++++ source/gameengine/PyDoc/SCA_ISensor.py | 1 + 17 files changed, 100 insertions(+), 15 deletions(-) create mode 100644 source/gameengine/PyDoc/CPropValue.py create mode 100644 source/gameengine/PyDoc/CValue.py create mode 100644 source/gameengine/PyDoc/PyObjectPlus.py create mode 100644 source/gameengine/PyDoc/SCA_IObject.py (limited to 'source') diff --git a/source/gameengine/PyDoc/BL_Shader.py b/source/gameengine/PyDoc/BL_Shader.py index 182b73d437b..10e8b7c94ef 100644 --- a/source/gameengine/PyDoc/BL_Shader.py +++ b/source/gameengine/PyDoc/BL_Shader.py @@ -1,4 +1,7 @@ -class BL_Shader: # (PyObjectPlus) + +from PyObjectPlus import * + +class BL_Shader(PyObjectPlus): """ BL_Shader GLSL shaders. diff --git a/source/gameengine/PyDoc/CListValue.py b/source/gameengine/PyDoc/CListValue.py index e9fc4215bb6..1f60e8a7bc2 100644 --- a/source/gameengine/PyDoc/CListValue.py +++ b/source/gameengine/PyDoc/CListValue.py @@ -1,4 +1,6 @@ -class CListValue: # (PyObjectPlus) +from CPropValue import * + +class CListValue(CPropValue): """ CListValue diff --git a/source/gameengine/PyDoc/CPropValue.py b/source/gameengine/PyDoc/CPropValue.py new file mode 100644 index 00000000000..498b47ab013 --- /dev/null +++ b/source/gameengine/PyDoc/CPropValue.py @@ -0,0 +1,8 @@ +# +# Documentation for CValue class +from CValue import * +class CPropValue(CValue): + """ + This class has no python functions + """ + pass diff --git a/source/gameengine/PyDoc/CValue.py b/source/gameengine/PyDoc/CValue.py new file mode 100644 index 00000000000..e9b0563955b --- /dev/null +++ b/source/gameengine/PyDoc/CValue.py @@ -0,0 +1,8 @@ +# +# Documentation for CValue class +from PyObjectPlus import * +class CValue(PyObjectPlus): + """ + This class has no python functions + """ + pass diff --git a/source/gameengine/PyDoc/KX_BlenderMaterial.py b/source/gameengine/PyDoc/KX_BlenderMaterial.py index 21417db1802..c70a7dddcca 100644 --- a/source/gameengine/PyDoc/KX_BlenderMaterial.py +++ b/source/gameengine/PyDoc/KX_BlenderMaterial.py @@ -1,4 +1,7 @@ -class KX_BlenderMaterial: # (PyObjectPlus) + +from PyObjectPlus import * + +class KX_BlenderMaterial(PyObjectPlus): # , RAS_IPolyMaterial) """ KX_BlenderMaterial diff --git a/source/gameengine/PyDoc/KX_Camera.py b/source/gameengine/PyDoc/KX_Camera.py index f5d0d45f968..5c54935192a 100644 --- a/source/gameengine/PyDoc/KX_Camera.py +++ b/source/gameengine/PyDoc/KX_Camera.py @@ -40,6 +40,8 @@ class KX_Camera(KX_GameObject): Regenerated every frame from the camera's position and orientation. This is camera_to_world inverted. @type world_to_camera: 4x4 Matrix [[float]] + + @group Deprecated: enableViewport """ def sphereInsideFrustum(centre, radius): @@ -187,6 +189,7 @@ class KX_Camera(KX_GameObject): def enableViewport(viewport): """ + DEPRECATED: use the isViewport property Use this camera to draw a viewport on the screen (for split screen games or overlay scenes). The viewport region is defined with L{setViewport}. @type viewport: bool diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index fcb3d91dbcb..2688de0d018 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -1,18 +1,18 @@ # $Id$ # Documentation for game objects -# from SCA_IObject import * +from SCA_IObject import * # from SCA_ISensor import * # from SCA_IController import * # from SCA_IActuator import * -class KX_GameObject: # (SCA_IObject) +class KX_GameObject(SCA_IObject): """ All game objects are derived from this class. Properties assigned to game objects are accessible as attributes of this class. - - note: Calling ANY method or attribute on an object that has been removed from a scene will raise a RuntimeError, if an object may have been removed since last accessing it use the L{isValid} attribute to check. + - note: Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError, if an object may have been removed since last accessing it use the L{invalid} attribute to check. @ivar name: The object's name. (Read only) - note: Currently (Blender 2.49) the prefix "OB" is added to all objects name. This may change in blender 2.5. @@ -79,8 +79,7 @@ class KX_GameObject: # (SCA_IObject) - note: This attribute is experemental and may be removed (but probably wont be). - note: Changes to this list will not update the KX_GameObject. @type actuators: list - @ivar isValid: Retuerns fails when the object has been removed from the scene and can no longer be used. - @type isValid: bool + @group Deprecated: getPosition, setPosition, setWorldPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass, getMesh """ def endObject(): """ diff --git a/source/gameengine/PyDoc/KX_MeshProxy.py b/source/gameengine/PyDoc/KX_MeshProxy.py index e8839ac484c..c864523cde8 100644 --- a/source/gameengine/PyDoc/KX_MeshProxy.py +++ b/source/gameengine/PyDoc/KX_MeshProxy.py @@ -1,7 +1,9 @@ # $Id$ # Documentation for KX_MeshProxy -class KX_MeshProxy: +from SCA_IObject import * + +class KX_MeshProxy(SCA_IObject): """ A mesh object. diff --git a/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py b/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py index 2171cf4c7b6..ea9a2a3a411 100644 --- a/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py +++ b/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py @@ -1,4 +1,6 @@ -class KX_PhysicsObjectWrapper: # (PyObjectPlus) +from PyObjectPlus import * + +class KX_PhysicsObjectWrapper(PyObjectPlus): """ KX_PhysicsObjectWrapper diff --git a/source/gameengine/PyDoc/KX_PolyProxy.py b/source/gameengine/PyDoc/KX_PolyProxy.py index bcd42c2ac2e..2d1c1f9b218 100644 --- a/source/gameengine/PyDoc/KX_PolyProxy.py +++ b/source/gameengine/PyDoc/KX_PolyProxy.py @@ -1,7 +1,8 @@ # $Id$ # Documentation for the polygon proxy class +from SCA_IObject import * -class KX_PolyProxy: +class KX_PolyProxy(SCA_IObject): """ A polygon holds the index of the vertex forming the poylgon. diff --git a/source/gameengine/PyDoc/KX_Scene.py b/source/gameengine/PyDoc/KX_Scene.py index 5dcd560ee96..4fe150be898 100644 --- a/source/gameengine/PyDoc/KX_Scene.py +++ b/source/gameengine/PyDoc/KX_Scene.py @@ -1,7 +1,9 @@ # $Id$ # Documentation for KX_Scene.py -class KX_Scene: +from PyObjectPlus import * + +class KX_Scene(PyObjectPlus): """ Scene. @@ -41,6 +43,12 @@ class KX_Scene: @type name: string @ivar objects: A list of objects in the scene. @type objects: L{CListValue} of L{KX_GameObject} + @ivar objects_inactive: A list of objects on background layers (used for the addObject actuator). + @type objects_inactive: L{CListValue} of L{KX_GameObject} + @ivar lights: A list of lights in the scene. + @type lights: L{CListValue} of L{KX_GameObject} + @ivar cameras: A list of cameras in the scene. + @type cameras: L{CListValue} of L{KX_GameObject} @ivar active_camera: The current active camera @type active_camera: L{KX_Camera} @ivar suspended: True if the scene is suspended. @@ -49,22 +57,26 @@ class KX_Scene: @type activity_culling: boolean @ivar activity_culling_radius: The distance outside which to do activity culling. Measured in manhattan distance. @type activity_culling_radius: float + @group Deprecated: getLightList, getObjectList, getName """ def getLightList(): """ + DEPRECATED: use the 'lights' property. Returns the list of lights in the scene. @rtype: list [L{KX_LightObject}] """ def getObjectList(): """ + DEPRECATED: use the 'objects' property. Returns the list of objects in the scene. @rtype: list [L{KX_GameObject}] """ def getName(): """ + DEPRECATED: use the 'name' property. Returns the name of the scene. @rtype: string diff --git a/source/gameengine/PyDoc/KX_VehicleWrapper.py b/source/gameengine/PyDoc/KX_VehicleWrapper.py index 087aa167475..3d91b7db676 100644 --- a/source/gameengine/PyDoc/KX_VehicleWrapper.py +++ b/source/gameengine/PyDoc/KX_VehicleWrapper.py @@ -1,4 +1,6 @@ -class KX_VehicleWrapper: # (PyObjectPlus) +from PyObjectPlus import * + +class KX_VehicleWrapper(PyObjectPlus): """ KX_VehicleWrapper diff --git a/source/gameengine/PyDoc/KX_VertexProxy.py b/source/gameengine/PyDoc/KX_VertexProxy.py index 7ee5087b316..114e0d88075 100644 --- a/source/gameengine/PyDoc/KX_VertexProxy.py +++ b/source/gameengine/PyDoc/KX_VertexProxy.py @@ -1,7 +1,9 @@ # $Id$ # Documentation for the vertex proxy class -class KX_VertexProxy: +from SCA_IObject import * + +class KX_VertexProxy(SCA_IObject): """ A vertex holds position, UV, colour and normal information. diff --git a/source/gameengine/PyDoc/PyObjectPlus.py b/source/gameengine/PyDoc/PyObjectPlus.py new file mode 100644 index 00000000000..1750bcb6ca1 --- /dev/null +++ b/source/gameengine/PyDoc/PyObjectPlus.py @@ -0,0 +1,26 @@ +# +# Documentation for PyObjectPlus base class + +class PyObjectPlus: + """ + PyObjectPlus base class of most other types in the Game Engine. + + @ivar invalid: Test if the object has been freed by the game engine and is no longer valid. + + Normally this is not a problem but when storing game engine data in the GameLogic module, + KX_Scenes or other KX_GameObjects its possible to hold a reference to invalid data. + Calling an attribute or method on an invalid object will raise a SystemError. + + The invalid attribute allows testing for this case without exception handling. + @type invalid: bool + """ + + def isA(game_type): + """ + Check if this is a type or a subtype game_type. + + @param game_type: the name of the type or the type its self from the L{GameTypes} module. + @type game_type: string or type + @return: True if this object is a type or a subtype of game_type. + @rtype: bool + """ diff --git a/source/gameengine/PyDoc/SCA_ILogicBrick.py b/source/gameengine/PyDoc/SCA_ILogicBrick.py index 4688ba12bb6..2bfe407204a 100644 --- a/source/gameengine/PyDoc/SCA_ILogicBrick.py +++ b/source/gameengine/PyDoc/SCA_ILogicBrick.py @@ -1,8 +1,9 @@ # $Id$ # Documentation for the logic brick base class SCA_ILogicBrick from KX_GameObject import * +from CValue import * -class SCA_ILogicBrick: +class SCA_ILogicBrick(CValue): """ Base class for all logic bricks. @@ -10,6 +11,7 @@ class SCA_ILogicBrick: @type executePriority: int @ivar owner: The game object this logic brick is attached to (read only). @type owner: L{KX_GameObject} or None in exceptional cases. + @group Deprecated: getOwner, setExecutePriority, getExecutePriority """ def getOwner(): diff --git a/source/gameengine/PyDoc/SCA_IObject.py b/source/gameengine/PyDoc/SCA_IObject.py new file mode 100644 index 00000000000..92e4884e815 --- /dev/null +++ b/source/gameengine/PyDoc/SCA_IObject.py @@ -0,0 +1,9 @@ +# +# Documentation for SCA_IObject class + +from CValue import * +class SCA_IObject(CValue): + """ + This class has no python functions + """ + pass diff --git a/source/gameengine/PyDoc/SCA_ISensor.py b/source/gameengine/PyDoc/SCA_ISensor.py index ab35996aa50..0b72548b103 100644 --- a/source/gameengine/PyDoc/SCA_ISensor.py +++ b/source/gameengine/PyDoc/SCA_ISensor.py @@ -24,6 +24,7 @@ class SCA_ISensor(SCA_ILogicBrick): @type triggered: boolean @ivar positive: True if this sensor brick is in a positive state. (Read only) @type positive: boolean + @group Deprecated: isPositive, isTriggered, getUsePosPulseMode, setUsePosPulseMode, getFrequency, setFrequency, getUseNegPulseMode, setUseNegPulseMode, getInvert, setInvert, getLevel, setLevel """ def reset(): -- cgit v1.2.3 From 94c6cadfe22d0fe1cdc666243463bc7971c5de51 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 28 Apr 2009 13:11:56 +0000 Subject: BGE PyAPI - renamed generic attribute "isValid" to "invalid" since BL_Shader already uses isValid. - Moved deprecation warnings from CValue - removed unused KX_Scene::SetProjectionMatrix and KX_Scene::GetViewMatrix - Added KX_Scene attributes "lights", "cameras", "objects_inactive", to allow access to objects in unseen layers (before the AddObject actuator adds them) - KX_Camera deprecated cam.enableViewport(bool) for cam.isViewport which can be read as well. --- source/gameengine/Expressions/PyObjectPlus.cpp | 61 +++++++++++++++++-- source/gameengine/Expressions/PyObjectPlus.h | 10 +++- source/gameengine/Expressions/Value.cpp | 50 ---------------- source/gameengine/Expressions/Value.h | 5 -- source/gameengine/Ketsji/KX_Camera.cpp | 34 +++++++++-- source/gameengine/Ketsji/KX_Camera.h | 3 + source/gameengine/Ketsji/KX_GameObject.cpp | 17 +++--- source/gameengine/Ketsji/KX_Scene.cpp | 83 +++++++++++++++----------- source/gameengine/Ketsji/KX_Scene.h | 33 +--------- 9 files changed, 157 insertions(+), 139 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 54f076741cc..8bd34cdc73b 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -113,13 +113,13 @@ PyMethodDef PyObjectPlus::Methods[] = { }; PyAttributeDef PyObjectPlus::Attributes[] = { - KX_PYATTRIBUTE_RO_FUNCTION("isValid", PyObjectPlus, pyattr_get_is_valid), + KX_PYATTRIBUTE_RO_FUNCTION("invalid", PyObjectPlus, pyattr_get_invalid), {NULL} //Sentinel }; -PyObject* PyObjectPlus::pyattr_get_is_valid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +PyObject* PyObjectPlus::pyattr_get_invalid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - Py_RETURN_TRUE; + Py_RETURN_FALSE; } /*------------------------------ @@ -137,8 +137,8 @@ PyObject *PyObjectPlus::py_base_getattro(PyObject * self, PyObject *attr) { PyObjectPlus *self_plus= BGE_PROXY_REF(self); if(self_plus==NULL) { - if(!strcmp("isValid", PyString_AsString(attr))) { - Py_RETURN_FALSE; + if(!strcmp("invalid", PyString_AsString(attr))) { + Py_RETURN_TRUE; } PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); return NULL; @@ -896,5 +896,56 @@ PyObject *PyObjectPlus::NewProxy_Ext(PyObjectPlus *self, PyTypeObject *tp, bool return self->m_proxy; } +/////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////// +/* deprecation warning management */ +bool PyObjectPlus::m_ignore_deprecation_warnings(false); +void PyObjectPlus::SetDeprecationWarnings(bool ignoreDeprecationWarnings) +{ + m_ignore_deprecation_warnings = ignoreDeprecationWarnings; +} + +void PyObjectPlus::ShowDeprecationWarning(const char* old_way,const char* new_way) +{ + if (!m_ignore_deprecation_warnings) { + printf("Method %s is deprecated, please use %s instead.\n", old_way, new_way); + + // import sys; print '\t%s:%d' % (sys._getframe(0).f_code.co_filename, sys._getframe(0).f_lineno) + + PyObject *getframe, *frame; + PyObject *f_lineno, *f_code, *co_filename; + + getframe = PySys_GetObject((char *)"_getframe"); // borrowed + if (getframe) { + frame = PyObject_CallObject(getframe, NULL); + if (frame) { + f_lineno= PyObject_GetAttrString(frame, "f_lineno"); + f_code= PyObject_GetAttrString(frame, "f_code"); + if (f_lineno && f_code) { + co_filename= PyObject_GetAttrString(f_code, "co_filename"); + if (co_filename) { + + printf("\t%s:%d\n", PyString_AsString(co_filename), (int)PyInt_AsLong(f_lineno)); + + Py_DECREF(f_lineno); + Py_DECREF(f_code); + Py_DECREF(co_filename); + Py_DECREF(frame); + return; + } + } + + Py_XDECREF(f_lineno); + Py_XDECREF(f_code); + Py_DECREF(frame); + } + + } + PyErr_Clear(); + printf("\tERROR - Could not access sys._getframe(0).f_lineno or sys._getframe().f_code.co_filename\n"); + } +} + + #endif //NO_EXP_PYTHON_EMBEDDING diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 257851ef4b3..f90a1436d00 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -446,7 +446,7 @@ public: KX_PYMETHOD_O(PyObjectPlus,isA); /* Kindof dumb, always returns True, the false case is checked for, before this function gets accessed */ - static PyObject* pyattr_get_is_valid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_invalid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject *GetProxy_Ext(PyObjectPlus *self, PyTypeObject *tp); static PyObject *NewProxy_Ext(PyObjectPlus *self, PyTypeObject *tp, bool py_owns); @@ -458,6 +458,14 @@ public: */ virtual void ProcessReplica(); + + static bool m_ignore_deprecation_warnings; + + /** enable/disable display of deprecation warnings */ + static void SetDeprecationWarnings(bool ignoreDeprecationWarnings); + /** Shows a deprecation warning */ + static void ShowDeprecationWarning(const char* method,const char* prop); + }; PyObject *py_getattr_dict(PyObject *pydict, PyObject *tp_dict); diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 6e8f2ba1061..088b5cb98a4 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -32,7 +32,6 @@ ////////////////////////////////////////////////////////////////////// double CValue::m_sZeroVec[3] = {0.0,0.0,0.0}; -bool CValue::m_ignore_deprecation_warnings(false); #ifndef NO_EXP_PYTHON_EMBEDDING @@ -781,52 +780,3 @@ void CValue::SetValue(CValue* newval) // no one should get here assertd(newval->GetNumber() == 10121969); } -/////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////// -/* deprecation warning management */ -void CValue::SetDeprecationWarnings(bool ignoreDeprecationWarnings) -{ - m_ignore_deprecation_warnings = ignoreDeprecationWarnings; -} - -void CValue::ShowDeprecationWarning(const char* old_way,const char* new_way) -{ - if (!m_ignore_deprecation_warnings) { - printf("Method %s is deprecated, please use %s instead.\n", old_way, new_way); - - // import sys; print '\t%s:%d' % (sys._getframe(0).f_code.co_filename, sys._getframe(0).f_lineno) - - PyObject *getframe, *frame; - PyObject *f_lineno, *f_code, *co_filename; - - getframe = PySys_GetObject((char *)"_getframe"); // borrowed - if (getframe) { - frame = PyObject_CallObject(getframe, NULL); - if (frame) { - f_lineno= PyObject_GetAttrString(frame, "f_lineno"); - f_code= PyObject_GetAttrString(frame, "f_code"); - if (f_lineno && f_code) { - co_filename= PyObject_GetAttrString(f_code, "co_filename"); - if (co_filename) { - - printf("\t%s:%d\n", PyString_AsString(co_filename), (int)PyInt_AsLong(f_lineno)); - - Py_DECREF(f_lineno); - Py_DECREF(f_code); - Py_DECREF(co_filename); - Py_DECREF(frame); - return; - } - } - - Py_XDECREF(f_lineno); - Py_XDECREF(f_code); - Py_DECREF(frame); - } - - } - PyErr_Clear(); - printf("\tERROR - Could not access sys._getframe(0).f_lineno or sys._getframe().f_code.co_filename\n"); - } -} - diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 97ce9cddcea..fca603a831e 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -303,10 +303,6 @@ public: STR_String op2str(VALUE_OPERATOR op); - /** enable/disable display of deprecation warnings */ - static void SetDeprecationWarnings(bool ignoreDeprecationWarnings); - /** Shows a deprecation warning */ - static void ShowDeprecationWarning(const char* method,const char* prop); // setting / getting flags inline void SetSelected(bool bSelected) { m_ValFlags.Selected = bSelected; } @@ -338,7 +334,6 @@ private: ValueFlags m_ValFlags; // Frequently used flags in a bitfield (low memoryusage) int m_refcount; // Reference Counter static double m_sZeroVec[3]; - static bool m_ignore_deprecation_warnings; }; diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 8565346b30e..bc2c2fc33b0 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -478,10 +478,12 @@ PyMethodDef KX_Camera::Methods[] = { KX_PYMETHODTABLE_NOARGS(KX_Camera, getWorldToCamera), KX_PYMETHODTABLE_NOARGS(KX_Camera, getProjectionMatrix), KX_PYMETHODTABLE_O(KX_Camera, setProjectionMatrix), - KX_PYMETHODTABLE_O(KX_Camera, enableViewport), KX_PYMETHODTABLE(KX_Camera, setViewport), KX_PYMETHODTABLE_NOARGS(KX_Camera, setOnTop), + // DEPRECATED + KX_PYMETHODTABLE_O(KX_Camera, enableViewport), + {NULL,NULL} //Sentinel }; @@ -494,6 +496,8 @@ PyAttributeDef KX_Camera::Attributes[] = { KX_PYATTRIBUTE_RW_FUNCTION("near", KX_Camera, pyattr_get_near, pyattr_set_near), KX_PYATTRIBUTE_RW_FUNCTION("far", KX_Camera, pyattr_get_far, pyattr_set_far), + KX_PYATTRIBUTE_RW_FUNCTION("isViewport", KX_Camera, pyattr_get_is_viewport, pyattr_set_is_viewport), + KX_PYATTRIBUTE_RO_FUNCTION("projection_matrix", KX_Camera, pyattr_get_projection_matrix), KX_PYATTRIBUTE_RO_FUNCTION("modelview_matrix", KX_Camera, pyattr_get_modelview_matrix), KX_PYATTRIBUTE_RO_FUNCTION("camera_to_world", KX_Camera, pyattr_get_camera_to_world), @@ -745,8 +749,9 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, enableViewport, "Sets this camera's viewport status\n" ) { - int viewport = PyObject_IsTrue(value); + ShowDeprecationWarning("enableViewport(bool)", "the isViewport property"); + int viewport = PyObject_IsTrue(value); if (viewport == -1) { PyErr_SetString(PyExc_ValueError, "camera.enableViewport(bool): KX_Camera, expected True/False or 0/1"); return NULL; @@ -776,10 +781,7 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_Camera, setOnTop, "setOnTop()\n" "Sets this camera's viewport on top\n") { - class KX_Scene* scene; - - scene = KX_GetActiveScene(); - MT_assert(scene); + class KX_Scene* scene = KX_GetActiveScene(); scene->SetCameraOnTop(this); Py_RETURN_NONE; } @@ -863,6 +865,26 @@ int KX_Camera::pyattr_set_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, P return 0; } + +PyObject* KX_Camera::pyattr_get_is_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + KX_Camera* self= static_cast(self_v); + return PyBool_FromLong(self->GetViewport()); +} + +int KX_Camera::pyattr_set_is_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) +{ + KX_Camera* self= static_cast(self_v); + int param = PyObject_IsTrue( value ); + if (param == -1) { + PyErr_SetString(PyExc_AttributeError, "camera.isViewport = bool: KX_Camera, expected True or False"); + return 1; + } + self->EnableViewport((bool)param); + return 0; +} + + PyObject* KX_Camera::pyattr_get_projection_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_Camera* self= static_cast(self_v); diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index 83316972ca0..e99a0594701 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -284,6 +284,9 @@ public: static PyObject* pyattr_get_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_is_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_is_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_projection_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_projection_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 53c2d6c7937..ed162238e8a 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1067,7 +1067,6 @@ CListValue* KX_GameObject::GetChildrenRecursive() /* ------- python stuff ---------------------------------------------------*/ PyMethodDef KX_GameObject::Methods[] = { - {"setWorldPosition", (PyCFunction) KX_GameObject::sPySetWorldPosition, METH_O}, {"applyForce", (PyCFunction) KX_GameObject::sPyApplyForce, METH_VARARGS}, {"applyTorque", (PyCFunction) KX_GameObject::sPyApplyTorque, METH_VARARGS}, {"applyRotation", (PyCFunction) KX_GameObject::sPyApplyRotation, METH_VARARGS}, @@ -1106,6 +1105,7 @@ PyMethodDef KX_GameObject::Methods[] = { // deprecated {"getPosition", (PyCFunction) KX_GameObject::sPyGetPosition, METH_NOARGS}, {"setPosition", (PyCFunction) KX_GameObject::sPySetPosition, METH_O}, + {"setWorldPosition", (PyCFunction) KX_GameObject::sPySetWorldPosition, METH_O}, {"getOrientation", (PyCFunction) KX_GameObject::sPyGetOrientation, METH_NOARGS}, {"setOrientation", (PyCFunction) KX_GameObject::sPySetOrientation, METH_O}, {"getState",(PyCFunction) KX_GameObject::sPyGetState, METH_NOARGS}, @@ -1177,8 +1177,8 @@ PyObject* KX_GameObject::PyReplaceMesh(PyObject* value) PyObject* KX_GameObject::PyEndObject() { - KX_Scene *scene = KX_GetActiveScene(); + scene->DelayedRemoveObject(this); Py_RETURN_NONE; @@ -1321,7 +1321,6 @@ PyMappingMethods KX_GameObject::Mapping = { (objobjargproc)KX_GameObject::Map_SetItem, /*objobjargproc mp_ass_subscript */ }; - PyTypeObject KX_GameObject::Type = { PyObject_HEAD_INIT(NULL) 0, @@ -2069,17 +2068,20 @@ PyObject* KX_GameObject::PyGetParent() PyObject* KX_GameObject::PySetParent(PyObject* value) { + KX_Scene *scene = KX_GetActiveScene(); KX_GameObject *obj; + if (!ConvertPythonToGameObject(value, &obj, false, "gameOb.setParent(value): KX_GameObject")) return NULL; - this->SetParent(KX_GetActiveScene(), obj); + this->SetParent(scene, obj); Py_RETURN_NONE; } PyObject* KX_GameObject::PyRemoveParent() { KX_Scene *scene = KX_GetActiveScene(); + this->RemoveParent(scene); Py_RETURN_NONE; } @@ -2249,6 +2251,7 @@ PyObject* KX_GameObject::PySetPosition(PyObject* value) PyObject* KX_GameObject::PySetWorldPosition(PyObject* value) { + ShowDeprecationWarning("setWorldPosition()", "the worldPosition property"); MT_Point3 pos; if (PyVecTo(value, pos)) { @@ -2585,6 +2588,7 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_GameObject, sendMessage, "body = Message body (string)" "to = Name of object to send the message to") { + KX_Scene *scene = KX_GetActiveScene(); char* subject; char* body = (char *)""; char* to = (char *)""; @@ -2592,9 +2596,8 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_GameObject, sendMessage, if (!PyArg_ParseTuple(args, "s|sss:sendMessage", &subject, &body, &to)) return NULL; - - KX_GetActiveScene()->GetNetworkScene()->SendMessage(to, from, subject, body); - + + scene->GetNetworkScene()->SendMessage(to, from, subject, body); Py_RETURN_NONE; } diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 9e67e39b2a5..1c1cc881d17 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -255,13 +255,6 @@ KX_Scene::~KX_Scene() Py_DECREF(m_attr_dict); } -void KX_Scene::SetProjectionMatrix(MT_CmMatrix4x4& pmat) -{ - m_projectionmat = pmat; -} - - - RAS_BucketManager* KX_Scene::GetBucketManager() { return m_bucketmanager; @@ -1153,24 +1146,6 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj) gameobj->AddMeshUser(); } - - -MT_CmMatrix4x4& KX_Scene::GetViewMatrix() -{ - MT_Scalar cammat[16]; - m_active_camera->GetWorldToCamera().getValue(cammat); - m_viewmat = cammat; - return m_viewmat; -} - - - -MT_CmMatrix4x4& KX_Scene::GetProjectionMatrix() -{ - return m_projectionmat; -} - - KX_Camera* KX_Scene::FindCamera(KX_Camera* cam) { list::iterator it = m_cameras.begin(); @@ -1645,9 +1620,9 @@ PyParentObject KX_Scene::Parents[] = { }; PyMethodDef KX_Scene::Methods[] = { - KX_PYMETHODTABLE(KX_Scene, getLightList), - KX_PYMETHODTABLE(KX_Scene, getObjectList), - KX_PYMETHODTABLE(KX_Scene, getName), + KX_PYMETHODTABLE_NOARGS(KX_Scene, getLightList), + KX_PYMETHODTABLE_NOARGS(KX_Scene, getObjectList), + KX_PYMETHODTABLE_NOARGS(KX_Scene, getName), KX_PYMETHODTABLE(KX_Scene, addObject), {NULL,NULL} //Sentinel @@ -1665,6 +1640,39 @@ PyObject* KX_Scene::pyattr_get_objects(void *self_v, const KX_PYATTRIBUTE_DEF *a return self->GetObjectList()->GetProxy(); } +PyObject* KX_Scene::pyattr_get_objects_inactive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + KX_Scene* self= static_cast(self_v); + return self->GetInactiveList()->GetProxy(); +} + +PyObject* KX_Scene::pyattr_get_lights(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + KX_Scene* self= static_cast(self_v); + return self->GetLightList()->GetProxy(); +} + +PyObject* KX_Scene::pyattr_get_cameras(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + /* With refcounts in this case... + * the new CListValue is owned by python, so its possible python holds onto it longer then the BGE + * however this is the same with "scene.objects + []", when you make a copy by adding lists. + */ + + KX_Scene* self= static_cast(self_v); + CListValue* clist = new CListValue(); + + /* return self->GetCameras()->GetProxy(); */ + + list::iterator it = self->GetCameras()->begin(); + while (it != self->GetCameras()->end()) { + clist->Add((*it)->AddRef()); + it++; + } + + return clist->NewProxy(true); +} + PyObject* KX_Scene::pyattr_get_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_Scene* self= static_cast(self_v); @@ -1672,13 +1680,16 @@ PyObject* KX_Scene::pyattr_get_active_camera(void *self_v, const KX_PYATTRIBUTE_ } PyAttributeDef KX_Scene::Attributes[] = { - KX_PYATTRIBUTE_RO_FUNCTION("name", KX_Scene, pyattr_get_name), - KX_PYATTRIBUTE_RO_FUNCTION("objects", KX_Scene, pyattr_get_objects), - KX_PYATTRIBUTE_RO_FUNCTION("active_camera", KX_Scene, pyattr_get_active_camera), - KX_PYATTRIBUTE_BOOL_RO("suspended", KX_Scene, m_suspend), - KX_PYATTRIBUTE_BOOL_RO("activity_culling", KX_Scene, m_activity_culling), + KX_PYATTRIBUTE_RO_FUNCTION("name", KX_Scene, pyattr_get_name), + KX_PYATTRIBUTE_RO_FUNCTION("objects", KX_Scene, pyattr_get_objects), + KX_PYATTRIBUTE_RO_FUNCTION("objects_inactive", KX_Scene, pyattr_get_objects_inactive), KX_PYATTRIBUTE_RO_FUNCTION("lights", KX_Scene, pyattr_get_lights), + KX_PYATTRIBUTE_RO_FUNCTION("cameras", KX_Scene, pyattr_get_cameras), + KX_PYATTRIBUTE_RO_FUNCTION("lights", KX_Scene, pyattr_get_lights), + KX_PYATTRIBUTE_RO_FUNCTION("active_camera", KX_Scene, pyattr_get_active_camera), + KX_PYATTRIBUTE_BOOL_RO("suspended", KX_Scene, m_suspend), + KX_PYATTRIBUTE_BOOL_RO("activity_culling", KX_Scene, m_activity_culling), KX_PYATTRIBUTE_FLOAT_RW("activity_culling_radius", 0.5f, FLT_MAX, KX_Scene, m_activity_box_radius), - KX_PYATTRIBUTE_BOOL_RO("dbvt_culling", KX_Scene, m_dbvt_culling), + KX_PYATTRIBUTE_BOOL_RO("dbvt_culling", KX_Scene, m_dbvt_culling), { NULL } //Sentinel }; @@ -1754,6 +1765,7 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getLightList, "Returns a list of all lights in the scene.\n" ) { + ShowDeprecationWarning("getLightList()", "the lights property"); return m_lightlist->GetProxy(); } @@ -1762,7 +1774,7 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getObjectList, "Returns a list of all game objects in the scene.\n" ) { - // ShowDeprecationWarning("getObjectList()", "the objects property"); // XXX Grr, why doesnt this work? + ShowDeprecationWarning("getObjectList()", "the objects property"); return m_objectlist->GetProxy(); } @@ -1771,6 +1783,7 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getName, "Returns the name of the scene.\n" ) { + ShowDeprecationWarning("getName()", "the name property"); return PyString_FromString(GetName()); } diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index dbba7723cc5..52a3cd5733e 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -32,8 +32,6 @@ #include "KX_PhysicsEngineEnums.h" -#include "MT_CmMatrix4x4.h" - #include #include #include @@ -191,15 +189,6 @@ protected: */ KX_Camera* m_active_camera; - /** - * The projection and view matrices of this scene - * The projection matrix is computed externally by KX_Engine - * The view mat is stored as a side effect of GetViewMatrix() - * and is totally unnessary. - */ - MT_CmMatrix4x4 m_projectionmat; - MT_CmMatrix4x4 m_viewmat; - /** Desired canvas width set at design time. */ unsigned int m_canvasDesignWidth; /** Desired canvas height set at design time. */ @@ -422,25 +411,6 @@ public: class KX_Camera* ); - /** Return the viewmatrix as used by the last frame. */ - MT_CmMatrix4x4& - GetViewMatrix( - ); - - /** - * Return the projectionmatrix as used by the last frame. This is - * set by hand :) - */ - MT_CmMatrix4x4& - GetProjectionMatrix( - ); - - /** Sets the projection matrix. */ - void - SetProjectionMatrix( - MT_CmMatrix4x4& pmat - ); - /** * Activates new desired canvas width set at design time. * @param width The new desired width. @@ -592,6 +562,9 @@ public: /* attributes */ static PyObject* pyattr_get_name(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_objects(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_objects_inactive(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_lights(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_cameras(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_active_camera(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); virtual PyObject* py_getattro(PyObject *attr); /* name, active_camera, gravity, suspended, viewport, framing, activity_culling, activity_culling_radius */ -- cgit v1.2.3 From d3b20dddd73297c76a2973a55cf3c5b15b8dd30a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 28 Apr 2009 15:28:02 +0000 Subject: Mathutils - fix own mistake with matrix slicing that would crash blender (from recent commit). - fix 3 memory leaks from ascotan r4717 in the Mathutils.Quaternion(...) function. --- source/blender/python/api2_2x/Mathutils.c | 33 +++++++++++++++++++++---------- source/blender/python/api2_2x/matrix.c | 13 ++++++------ 2 files changed, 29 insertions(+), 17 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Mathutils.c b/source/blender/python/api2_2x/Mathutils.c index 9217d94ba1c..9c73ca16e70 100644 --- a/source/blender/python/api2_2x/Mathutils.c +++ b/source/blender/python/api2_2x/Mathutils.c @@ -309,8 +309,8 @@ PyObject *M_Mathutils_Vector(PyObject * self, PyObject * args) { PyObject *listObject = NULL; int size, i; - float vec[4]; - PyObject *v, *f; + float vec[4], f; + PyObject *v; size = PySequence_Length(args); if (size == 1) { @@ -344,16 +344,15 @@ PyObject *M_Mathutils_Vector(PyObject * self, PyObject * args) return NULL; } - f=PyNumber_Float(v); - if(f==NULL) { // parsed item not a number + f= PyFloat_AsDouble(v); + if(f==-1 && PyErr_Occurred()) { // parsed item not a number Py_DECREF(v); Py_XDECREF(listObject); PyErr_SetString(PyExc_TypeError, "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); return NULL; } - vec[i]=(float)PyFloat_AS_DOUBLE(f); - Py_DECREF(f); + vec[i]= f; Py_DECREF(v); } Py_DECREF(listObject); @@ -999,16 +998,24 @@ PyObject *M_Mathutils_Quaternion(PyObject * self, PyObject * args) return NULL; } if(size == 3){ //get angle in axis/angle - n = PyNumber_Float(PySequence_GetItem(args, 1)); + n = PySequence_GetItem(args, 1); if(n == NULL) { // parsed item not a number or getItem fail Py_DECREF(listObject); PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); return NULL; } - angle = PyFloat_AS_DOUBLE(n); + + angle = PyFloat_AsDouble(n); Py_DECREF(n); + + if (angle==-1 && PyErr_Occurred()) { + Py_DECREF(listObject); + PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } } }else{ + Py_DECREF(listObject); /* assume the list is teh second arg */ listObject = PySequence_GetItem(args, 1); if (size>1 && PySequence_Check(listObject)) { size = PySequence_Length(listObject); @@ -1018,14 +1025,20 @@ PyObject *M_Mathutils_Quaternion(PyObject * self, PyObject * args) PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); return NULL; } - n = PyNumber_Float(PySequence_GetItem(args, 0)); + n = PySequence_GetItem(args, 0); if(n == NULL) { // parsed item not a number or getItem fail Py_DECREF(listObject); PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); return NULL; } - angle = PyFloat_AS_DOUBLE(n); + angle = PyFloat_AsDouble(n); Py_DECREF(n); + + if (angle==-1 && PyErr_Occurred()) { + Py_DECREF(listObject); + PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } } else { // argument was not a sequence Py_XDECREF(listObject); PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); diff --git a/source/blender/python/api2_2x/matrix.c b/source/blender/python/api2_2x/matrix.c index a8816ae4baa..659f746468a 100644 --- a/source/blender/python/api2_2x/matrix.c +++ b/source/blender/python/api2_2x/matrix.c @@ -575,9 +575,9 @@ static int Matrix_ass_slice(MatrixObject * self, int begin, int end, PyObject * seq) { int i, x, y, size, sub_size = 0; - float mat[16]; + float mat[16], f; PyObject *subseq; - PyObject *m, *f; + PyObject *m; CLAMP(begin, 0, self->rowSize); CLAMP(end, 0, self->rowSize); @@ -613,18 +613,17 @@ static int Matrix_ass_slice(MatrixObject * self, int begin, int end, PyErr_SetString(PyExc_RuntimeError, "matrix[begin:end] = []: unable to read sequence\n"); return -1; } - - f = PyNumber_Float(m); - if(f == NULL) { /*parsed item not a number*/ + + f = PyFloat_AsDouble(m); /* faster to assume a float and raise an error after */ + if(f == -1 && PyErr_Occurred()) { /*parsed item not a number*/ Py_DECREF(m); Py_DECREF(subseq); PyErr_SetString(PyExc_TypeError, "matrix[begin:end] = []: sequence argument not a number\n"); return -1; } - mat[(i * self->colSize) + y] = (float)PyFloat_AS_DOUBLE(f); + mat[(i * self->colSize) + y] = f; Py_DECREF(m); - Py_DECREF(subseq); } }else{ Py_DECREF(subseq); -- cgit v1.2.3 From 851e6d9e44cda1bc1e79c6f84f926c53bdd41789 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 28 Apr 2009 17:25:50 +0000 Subject: Bugfix #18637 Sorting of files didn't take numbers into account propertly, so it ordered files like; 10.jpg 300.jpg 89.jpg 9.jpg Quite simple to solve, almost moved report to the 'todo', but too fun to leave this. :) function name is BLI_natstrcmp() "natural string compare". --- source/blender/blenlib/BLI_blenlib.h | 1 + source/blender/blenlib/intern/storage.c | 2 +- source/blender/blenlib/intern/util.c | 49 +++++++++++++++++++++++++++++++++ source/blender/src/filesel.c | 2 +- 4 files changed, 52 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h index 13d5b5fe829..c131dd93c72 100644 --- a/source/blender/blenlib/BLI_blenlib.h +++ b/source/blender/blenlib/BLI_blenlib.h @@ -387,6 +387,7 @@ void BLI_setInterruptCallBack(int (*f)(void)); char *BLI_strcasestr(const char *s, const char *find); int BLI_strcasecmp(const char *s1, const char *s2); int BLI_strncasecmp(const char *s1, const char *s2, int n); +int BLI_natstrcmp(const char *s1, const char *s2); void BLI_timestr(double _time, char *str); /* time var is global */ /** diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 8ba03ad1343..088b5e40a51 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -153,7 +153,7 @@ int BLI_compare(struct direntry *entry1, struct direntry *entry2) if( strcmp(entry2->relname, ".")==0 ) return (1); if( strcmp(entry1->relname, "..")==0 ) return (-1); - return (BLI_strcasecmp(entry1->relname,entry2->relname)); + return (BLI_natstrcmp(entry1->relname,entry2->relname)); } diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 013b9e0bb1b..842ebc4c0a9 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -1985,6 +1985,55 @@ int BLI_strncasecmp(const char *s1, const char *s2, int n) { return 0; } +/* natural string compare, keeping numbers in order */ +int BLI_natstrcmp(const char *s1, const char *s2) +{ + int d1= 0, d2= 0; + + /* if both chars are numeric, to a strtol(). + then increase string deltas as long they are + numeric, else do a tolower and char compare */ + + while(1) { + char c1 = tolower(s1[d1]); + char c2 = tolower(s2[d2]); + + if( isdigit(c1) && isdigit(c2) ) { + int val1, val2; + + val1= (int)strtol(s1+d1, (char **)NULL, 10); + val2= (int)strtol(s2+d2, (char **)NULL, 10); + + if (val1val2) { + return 1; + } + d1++; + while( isdigit(s1[d1]) ) + d1++; + d2++; + while( isdigit(s2[d2]) ) + d2++; + + c1 = tolower(s1[d1]); + c2 = tolower(s2[d2]); + } + + if (c1c2) { + return 1; + } else if (c1==0) { + break; + } + d1++; + d2++; + } + +} + + #ifdef WITH_ICONV #include "iconv.h" diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c index 9800c80b57d..36427fce36b 100644 --- a/source/blender/src/filesel.c +++ b/source/blender/src/filesel.c @@ -196,7 +196,7 @@ static int compare_name(const void *a1, const void *a2) if( strcmp(entry2->relname, ".")==0 ) return (1); if( strcmp(entry1->relname, "..")==0 ) return (-1); - return (BLI_strcasecmp(entry1->relname,entry2->relname)); + return (BLI_natstrcmp(entry1->relname,entry2->relname)); } static int compare_date(const void *a1, const void *a2) -- cgit v1.2.3 From 35c1b3134b60c5a2fb806fd18f50b70ee582ffe8 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Tue, 28 Apr 2009 17:55:48 +0000 Subject: etch-a-ton bugfix cut and trim didn't set normal properly. --- source/blender/src/editarmature_sketch.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source') diff --git a/source/blender/src/editarmature_sketch.c b/source/blender/src/editarmature_sketch.c index 91aadd07392..dbf53bedbf9 100644 --- a/source/blender/src/editarmature_sketch.c +++ b/source/blender/src/editarmature_sketch.c @@ -2230,6 +2230,7 @@ void sk_applyCutGesture(SK_Gesture *gest, SK_Sketch *sketch) pt.type = PT_EXACT; pt.mode = PT_PROJECT; /* take mode from neighbouring points */ VECCOPY(pt.p, isect->p); + VECCOPY(pt.no, isect->stroke->points[isect->before].no); sk_insertStrokePoint(isect->stroke, &pt, isect->after); } @@ -2271,6 +2272,7 @@ void sk_applyTrimGesture(SK_Gesture *gest, SK_Sketch *sketch) pt.type = PT_EXACT; pt.mode = PT_PROJECT; /* take mode from neighbouring points */ VECCOPY(pt.p, isect->p); + VECCOPY(pt.no, isect->stroke->points[isect->before].no); VecSubf(stroke_dir, isect->stroke->points[isect->after].p, isect->stroke->points[isect->before].p); -- cgit v1.2.3 From 5e66971dd35973d5099974a000beb15fe0905d05 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Tue, 28 Apr 2009 18:53:15 +0000 Subject: add note to Image.save method that all new buffers are saved as Targa --- source/blender/python/api2_2x/doc/Image.py | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/blender/python/api2_2x/doc/Image.py b/source/blender/python/api2_2x/doc/Image.py index e376b11c4fa..12231ee8bcc 100644 --- a/source/blender/python/api2_2x/doc/Image.py +++ b/source/blender/python/api2_2x/doc/Image.py @@ -373,6 +373,7 @@ class Image: def save(): """ Saves the current image to L{filename} + @note: New images created in Blender will always save as Targa regardless of filename. @note: Saving to a directory that doent exist will raise an error. @note: Saving a packed image will make a unique (numbered) name if the file alredy exists. Remove the file first to be sure it will not be renamed. @returns: None -- cgit v1.2.3 From e4abebfa9153a0aae6eab438b89020c1f5af42ee Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Tue, 28 Apr 2009 18:56:48 +0000 Subject: BGE: reenable object activation for static object, otherwise their physic shape is not updated when they move due to parent relation. --- source/gameengine/Ketsji/KX_BulletPhysicsController.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp index 891317e64a1..9e74706e1c0 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp @@ -444,7 +444,9 @@ void KX_BulletPhysicsController::SetSumoTransform(bool nondynaonly) if (!m_bDyna) { - GetCollisionObject()->setCollisionFlags(GetRigidBody()->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + btCollisionObject* object = GetRigidBody(); + object->setActivationState(ACTIVE_TAG); + object->setCollisionFlags(object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); } else { if (!nondynaonly) -- cgit v1.2.3 From 2d78dcfb610381a5056eed5f59dd57aa50e444c3 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Tue, 28 Apr 2009 23:26:35 +0000 Subject: fix so that torque can be applied to DYNAMIC game objects, this fixes the skategirl. Note that skategirl needs a bit higher angular damping, perhaps the conversion formula needs to be tweaked better? --- source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source') diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index b171fbb3c34..961e9096442 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -964,7 +964,14 @@ void CcdPhysicsController::ApplyTorque(float torqueX,float torqueY,float torque torque = xform.getBasis()*torque; } if (body) + { + //workaround for incompatibility between 'DYNAMIC' game object, and angular factor + //a DYNAMIC object has some inconsistency: it has no angular effect due to collisions, but still has torque + const btVector3& angFac = body->getAngularFactor(); + body->setAngularFactor(1.f); body->applyTorque(torque); + body->setAngularFactor(angFac); + } } } -- cgit v1.2.3 From f004c36e41023b8a4ffa386226589b19c92eb971 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 29 Apr 2009 10:06:38 +0000 Subject: BGE: speed up mesh conversion by avoiding allocation/deallocation of material object on each face. The speed up is minor on optimized builds but considerable on less optimized builds, good for debugging large scene. --- .../Converter/BL_BlenderDataConversion.cpp | 54 +++++++++++++------- source/gameengine/Ketsji/BL_Material.cpp | 5 ++ source/gameengine/Ketsji/BL_Material.h | 1 + source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 50 +++++++++++-------- source/gameengine/Ketsji/KX_BlenderMaterial.h | 6 ++- source/gameengine/Ketsji/KX_PolygonMaterial.cpp | 58 +++++++++++++--------- source/gameengine/Ketsji/KX_PolygonMaterial.h | 8 +-- .../gameengine/Rasterizer/RAS_IPolygonMaterial.cpp | 55 ++++++++++++++++++++ .../gameengine/Rasterizer/RAS_IPolygonMaterial.h | 13 ++++- 9 files changed, 183 insertions(+), 67 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index ef3efbcec87..6a570c9e815 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -318,7 +318,8 @@ typedef struct MTF_localLayer }MTF_localLayer; // ------------------------------------ -BL_Material* ConvertMaterial( +bool ConvertMaterial( + BL_Material *material, Material *mat, MTFace* tface, const char *tfaceName, @@ -329,9 +330,7 @@ BL_Material* ConvertMaterial( MTF_localLayer *layers, bool glslmat) { - //this needs some type of manager - BL_Material *material = new BL_Material(); - + material->Initialize(); int numchan = -1, texalpha = 0; bool validmat = (mat!=0); bool validface = (tface!=0); @@ -720,7 +719,7 @@ BL_Material* ConvertMaterial( material->tface = tface; material->material = mat; - return material; + return true; } @@ -781,6 +780,13 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* meshobj->SetName(mesh->id.name); meshobj->m_sharedvertex_map.resize(totvert); + RAS_IPolyMaterial* polymat = NULL; + STR_String imastr; + // These pointers will hold persistent material structure during the conversion + // to avoid countless allocation/deallocation of memory. + BL_Material* bl_mat = NULL; + KX_BlenderMaterial* kx_blmat = NULL; + KX_PolygonMaterial* kx_polymat = NULL; for (int f=0;fGetMaterials()) { /* do Blender Multitexture and Blender GLSL materials */ @@ -852,7 +856,9 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* MT_Point2 uv[4]; /* first is the BL_Material */ - bl_mat = ConvertMaterial(ma, tface, tfaceName, mface, mcol, + if (!bl_mat) + bl_mat = new BL_Material(); + ConvertMaterial(bl_mat, ma, tface, tfaceName, mface, mcol, lightlayer, blenderobj, layers, converter->GetGLSLMaterials()); visible = ((bl_mat->ras_mode & POLY_VIS)!=0); @@ -873,13 +879,16 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* uv22 = uv[2]; uv23 = uv[3]; /* then the KX_BlenderMaterial */ - polymat = new KX_BlenderMaterial(scene, bl_mat, skinMesh, lightlayer); + if (kx_blmat == NULL) + kx_blmat = new KX_BlenderMaterial(); + kx_blmat->Initialize(scene, bl_mat, skinMesh, lightlayer); + polymat = static_cast(kx_blmat); } else { /* do Texture Face materials */ Image* bima = (tface)? (Image*)tface->tpage: NULL; - STR_String imastr = (tface)? (bima? (bima)->id.name : "" ) : ""; + imastr = (tface)? (bima? (bima)->id.name : "" ) : ""; char transp=0; short mode=0, tile=0; @@ -957,9 +966,12 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* bool alpha = (transp == TF_ALPHA || transp == TF_ADD); bool zsort = (mode & TF_ALPHASORT)? alpha: 0; - polymat = new KX_PolygonMaterial(imastr, ma, (int)mface->mat_nr, + if (kx_polymat == NULL) + kx_polymat = new KX_PolygonMaterial(); + kx_polymat->Initialize(imastr, ma, (int)mface->mat_nr, tile, tilexrep, tileyrep, mode, transp, alpha, zsort, lightlayer, tface, (unsigned int*)mcol); + polymat = static_cast(kx_polymat); if (ma) { polymat->m_specular = MT_Vector3(ma->specr, ma->specg, ma->specb)*ma->spec; @@ -984,15 +996,17 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* converter->RegisterPolyMaterial(polymat); if(converter->GetMaterials()) { converter->RegisterBlenderMaterial(bl_mat); + // the poly material has been stored in the bucket, next time we must create a new one + bl_mat = NULL; + kx_blmat = NULL; + } else { + // the poly material has been stored in the bucket, next time we must create a new one + kx_polymat = NULL; } } else { - // delete the material objects since they are no longer needed // from now on, use the polygon material from the material bucket - delete polymat; - if(converter->GetMaterials()) { - delete bl_mat; - } polymat = bucket->GetPolyMaterial(); + // keep the material pointers, they will be reused for next face } int nverts = (mface->v4)? 4: 3; @@ -1036,7 +1050,13 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* delete []layers; dm->release(dm); - + // cleanup material + if (bl_mat) + delete bl_mat; + if (kx_blmat) + delete kx_blmat; + if (kx_polymat) + delete kx_polymat; return meshobj; } diff --git a/source/gameengine/Ketsji/BL_Material.cpp b/source/gameengine/Ketsji/BL_Material.cpp index 022ed71ef7b..c63b9d55306 100644 --- a/source/gameengine/Ketsji/BL_Material.cpp +++ b/source/gameengine/Ketsji/BL_Material.cpp @@ -27,6 +27,11 @@ int getNumTexChannels( Material *mat ) } BL_Material::BL_Material() +{ + Initialize(); +} + +void BL_Material::Initialize() { rgb[0] = 0; rgb[1] = 0; diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h index a0ce37aace0..4f572f95891 100644 --- a/source/gameengine/Ketsji/BL_Material.h +++ b/source/gameengine/Ketsji/BL_Material.h @@ -44,6 +44,7 @@ private: public: // ----------------------------------- BL_Material(); + void Initialize(); int IdMode; unsigned int ras_mode; diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 9f11ea11819..70907db608a 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -43,16 +43,30 @@ BL_BlenderShader *KX_BlenderMaterial::mLastBlenderShader = NULL; //static PyObject *gTextureDict = 0; KX_BlenderMaterial::KX_BlenderMaterial( - KX_Scene *scene, - BL_Material *data, - bool skin, - int lightlayer, PyTypeObject *T ) : PyObjectPlus(T), - RAS_IPolyMaterial( - STR_String( data->texname[0] ), - STR_String( data->matname ), // needed for physics! + RAS_IPolyMaterial(), + mMaterial(NULL), + mShader(0), + mBlenderShader(0), + mScene(NULL), + mUserDefBlend(0), + mModified(0), + mConstructed(false), + mPass(0) +{ +} + +void KX_BlenderMaterial::Initialize( + KX_Scene *scene, + BL_Material *data, + bool skin, + int lightlayer) +{ + RAS_IPolyMaterial::Initialize( + data->texname[0], + data->matname, data->materialindex, data->tile, data->tilexrep[0], @@ -62,17 +76,15 @@ KX_BlenderMaterial::KX_BlenderMaterial( ((data->ras_mode &ALPHA)!=0), ((data->ras_mode &ZSORT)!=0), lightlayer - ), - mMaterial(data), - mShader(0), - mBlenderShader(0), - mScene(scene), - mUserDefBlend(0), - mModified(0), - mConstructed(false), - mPass(0) - -{ + ); + mMaterial = data; + mShader = 0; + mBlenderShader = 0; + mScene = scene; + mUserDefBlend = 0; + mModified = 0; + mConstructed = false; + mPass = 0; // -------------------------------- // RAS_IPolyMaterial variables... m_flag |= RAS_BLENDERMAT; @@ -96,7 +108,6 @@ KX_BlenderMaterial::KX_BlenderMaterial( ); } m_multimode += mMaterial->IdMode+ (mMaterial->ras_mode & ~(COLLIDER|USE_LIGHT)); - } KX_BlenderMaterial::~KX_BlenderMaterial() @@ -107,7 +118,6 @@ KX_BlenderMaterial::~KX_BlenderMaterial() OnExit(); } - MTFace* KX_BlenderMaterial::GetMTFace(void) const { // fonts on polys diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index eeb919a1bf1..d763ba3ef03 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -24,11 +24,13 @@ class KX_BlenderMaterial : public PyObjectPlus, public RAS_IPolyMaterial public: // -------------------------------- KX_BlenderMaterial( + PyTypeObject* T=&Type + ); + void Initialize( class KX_Scene* scene, BL_Material* mat, bool skin, - int lightlayer, - PyTypeObject* T=&Type + int lightlayer ); virtual ~KX_BlenderMaterial(); diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index a8105c1e4f3..a39ff486689 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -51,23 +51,36 @@ #include "KX_PyMath.h" -KX_PolygonMaterial::KX_PolygonMaterial(const STR_String &texname, - Material *material, - int materialindex, - int tile, - int tilexrep, - int tileyrep, - int mode, - int transp, - bool alpha, - bool zsort, - int lightlayer, - struct MTFace* tface, - unsigned int* mcol, - PyTypeObject *T) +KX_PolygonMaterial::KX_PolygonMaterial(PyTypeObject *T) : PyObjectPlus(T), - RAS_IPolyMaterial(texname, - STR_String(material?material->id.name:""), + RAS_IPolyMaterial(), + + m_tface(NULL), + m_mcol(NULL), + m_material(NULL), + m_pymaterial(NULL), + m_pass(0) +{ +} + +void KX_PolygonMaterial::Initialize( + const STR_String &texname, + Material* ma, + int materialindex, + int tile, + int tilexrep, + int tileyrep, + int mode, + int transp, + bool alpha, + bool zsort, + int lightlayer, + struct MTFace* tface, + unsigned int* mcol) +{ + RAS_IPolyMaterial::Initialize( + texname, + ma?ma->id.name:"", materialindex, tile, tilexrep, @@ -76,13 +89,12 @@ KX_PolygonMaterial::KX_PolygonMaterial(const STR_String &texname, transp, alpha, zsort, - lightlayer), - m_tface(tface), - m_mcol(mcol), - m_material(material), - m_pymaterial(0), - m_pass(0) -{ + lightlayer); + m_tface = tface; + m_mcol = mcol; + m_material = ma; + m_pymaterial = 0; + m_pass = 0; } KX_PolygonMaterial::~KX_PolygonMaterial() diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index b6f5f373335..89ecb026da9 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -57,8 +57,8 @@ private: mutable int m_pass; public: - - KX_PolygonMaterial(const STR_String &texname, + KX_PolygonMaterial(PyTypeObject *T = &Type); + void Initialize(const STR_String &texname, Material* ma, int materialindex, int tile, @@ -70,8 +70,8 @@ public: bool zsort, int lightlayer, struct MTFace* tface, - unsigned int* mcol, - PyTypeObject *T = &Type); + unsigned int* mcol); + virtual ~KX_PolygonMaterial(); /** diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp index e8f451382b9..c10e4040a92 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp @@ -36,6 +36,61 @@ #include #endif +void RAS_IPolyMaterial::Initialize( + const STR_String& texname, + const STR_String& matname, + int materialindex, + int tile, + int tilexrep, + int tileyrep, + int mode, + int transp, + bool alpha, + bool zsort, + int lightlayer) +{ + m_texturename = texname; + m_materialname = matname; + m_materialindex = materialindex; + m_tile = tile; + m_tilexrep = tilexrep; + m_tileyrep = tileyrep; + m_drawingmode = mode; + m_transp = transp; + m_alpha = alpha; + m_zsort = zsort; + m_lightlayer = lightlayer; + m_polymatid = m_newpolymatid++; + m_flag = 0; + m_multimode = 0; + m_shininess = 35.0; + m_specular.setValue(0.5,0.5,0.5); + m_specularity = 1.0; + m_diffuse.setValue(0.5,0.5,0.5); +} + +RAS_IPolyMaterial::RAS_IPolyMaterial() + : m_texturename("__Dummy_Texture_Name__"), + m_materialname("__Dummy_Material_Name__"), + m_materialindex(0), + m_tile(0), + m_tilexrep(0), + m_tileyrep(0), + m_drawingmode (0), + m_transp(0), + m_alpha(false), + m_zsort(false), + m_lightlayer(0), + m_polymatid(0), + m_flag(0), + m_multimode(0) +{ + m_shininess = 35.0; + m_specular = MT_Vector3(0.5,0.5,0.5); + m_specularity = 1.0; + m_diffuse = MT_Vector3(0.5,0.5,0.5); +} + RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname, const STR_String& matname, int materialindex, diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index dcd8b53402e..35652f528b9 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -100,6 +100,7 @@ public: SHADOW =8192 }; + RAS_IPolyMaterial::RAS_IPolyMaterial(); RAS_IPolyMaterial(const STR_String& texname, const STR_String& matname, int materialindex, @@ -111,6 +112,17 @@ public: bool alpha, bool zsort, int lightlayer); + void Initialize(const STR_String& texname, + const STR_String& matname, + int materialindex, + int tile, + int tilexrep, + int tileyrep, + int mode, + int transp, + bool alpha, + bool zsort, + int lightlayer); virtual ~RAS_IPolyMaterial() {}; /** @@ -151,7 +163,6 @@ public: virtual void GetMaterialRGBAColor(unsigned char *rgba) const; virtual bool UsesLighting(RAS_IRasterizer *rasty) const; virtual bool UsesObjectColor() const; - /* * PreCalculate texture gen */ -- cgit v1.2.3 From 3bc02088e8d947b6c3efcb567b74e4fca7d40da7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 29 Apr 2009 10:24:12 +0000 Subject: remove uneeded checks and testMethod from KX_ConstraintWrapper, typo in import_obj --- source/gameengine/Ketsji/KX_ConstraintWrapper.cpp | 34 ++--------------------- 1 file changed, 2 insertions(+), 32 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index 0e6678b8572..cab42f08d2a 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -48,20 +48,12 @@ KX_ConstraintWrapper::KX_ConstraintWrapper( KX_ConstraintWrapper::~KX_ConstraintWrapper() { } -//python integration methods -PyObject* KX_ConstraintWrapper::PyTestMethod(PyObject* args, PyObject* kwds) -{ - Py_RETURN_NONE; -} PyObject* KX_ConstraintWrapper::PyGetConstraintId(PyObject* args, PyObject* kwds) { return PyInt_FromLong(m_constraintId); } - - - //python specific stuff PyTypeObject KX_ConstraintWrapper::Type = { PyObject_HEAD_INIT(NULL) @@ -97,35 +89,13 @@ PyObject* KX_ConstraintWrapper::py_getattro_dict() { py_getattro_dict_up(PyObjectPlus); } -int KX_ConstraintWrapper::py_setattro(PyObject *attr,PyObject* pyobj) +int KX_ConstraintWrapper::py_setattro(PyObject *attr,PyObject* value) { - int result = 1; - /* what the heck is this supposed to do?, needs attention */ - if (PyList_Check(pyobj)) - { - result = 0; - } - if (PyFloat_Check(pyobj)) - { - result = 0; - - } - if (PyInt_Check(pyobj)) - { - result = 0; - } - if (PyString_Check(pyobj)) - { - result = 0; - } - if (result) - result = PyObjectPlus::py_setattro(attr,pyobj); - return result; + py_setattro_up(PyObjectPlus); }; PyMethodDef KX_ConstraintWrapper::Methods[] = { - {"testMethod",(PyCFunction) KX_ConstraintWrapper::sPyTestMethod, METH_VARARGS}, {"getConstraintId",(PyCFunction) KX_ConstraintWrapper::sPyGetConstraintId, METH_VARARGS}, {NULL,NULL} //Sentinel }; -- cgit v1.2.3 From 32b70e333fde4351fd385dab1238ffd74b012663 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 29 Apr 2009 11:16:26 +0000 Subject: needed this minor change to build on gcc --- source/gameengine/Rasterizer/RAS_IPolygonMaterial.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index 35652f528b9..1bc03a1db05 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -100,7 +100,7 @@ public: SHADOW =8192 }; - RAS_IPolyMaterial::RAS_IPolyMaterial(); + RAS_IPolyMaterial(); RAS_IPolyMaterial(const STR_String& texname, const STR_String& matname, int materialindex, -- cgit v1.2.3 From 988fbb88dc621d8f41d1b07a729ae5afc24efdaa Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 29 Apr 2009 11:20:07 +0000 Subject: bugfix #18609 This fixes a commit from Peter, revision 12931, Dec 17 2007 He added quick image scaling code, derived from ppmqscale, http://libdv.sf.net This implementation gave ugly banding. especially visible on dark colors or byte images with very close colors. Solution is to add correct rounding, seems to me normal for such fixed point magic. Optimizing code and keeping quality is tricky dudes! Results for scaling down in sequencer were bad for over a year (2.47 and 2.48 both wrong). --- source/blender/imbuf/intern/scaling.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'source') diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index 807b0c84e90..b308915cd62 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -609,34 +609,35 @@ static void shrink_picture_byte( w = (weight1y * weight1x) >> 16; - dst_line1[x].r += (line[0] * w) >> 16; - dst_line1[x].g += (line[1] * w) >> 16; - dst_line1[x].b += (line[2] * w) >> 16; - dst_line1[x].a += (line[3] * w) >> 16; + /* ensure correct rounding, without this you get ugly banding (ton) */ + dst_line1[x].r += (line[0] * w + 32767) >> 16; + dst_line1[x].g += (line[1] * w + 32767) >> 16; + dst_line1[x].b += (line[2] * w + 32767) >> 16; + dst_line1[x].a += (line[3] * w + 32767) >> 16; dst_line1[x].weight += w; w = (weight2y * weight1x) >> 16; - dst_line2[x].r += (line[0] * w) >> 16; - dst_line2[x].g += (line[1] * w) >> 16; - dst_line2[x].b += (line[2] * w) >> 16; - dst_line2[x].a += (line[3] * w) >> 16; + dst_line2[x].r += (line[0] * w + 32767) >> 16; + dst_line2[x].g += (line[1] * w + 32767) >> 16; + dst_line2[x].b += (line[2] * w + 32767) >> 16; + dst_line2[x].a += (line[3] * w + 32767) >> 16; dst_line2[x].weight += w; w = (weight1y * weight2x) >> 16; - dst_line1[x+1].r += (line[0] * w) >> 16; - dst_line1[x+1].g += (line[1] * w) >> 16; - dst_line1[x+1].b += (line[2] * w) >> 16; - dst_line1[x+1].a += (line[3] * w) >> 16; + dst_line1[x+1].r += (line[0] * w + 32767) >> 16; + dst_line1[x+1].g += (line[1] * w + 32767) >> 16; + dst_line1[x+1].b += (line[2] * w + 32767) >> 16; + dst_line1[x+1].a += (line[3] * w + 32767) >> 16; dst_line1[x+1].weight += w; w = (weight2y * weight2x) >> 16; - dst_line2[x+1].r += (line[0] * w) >> 16; - dst_line2[x+1].g += (line[1] * w) >> 16; - dst_line2[x+1].b += (line[2] * w) >> 16; - dst_line2[x+1].a += (line[3] * w) >> 16; + dst_line2[x+1].r += (line[0] * w + 32767) >> 16; + dst_line2[x+1].g += (line[1] * w + 32767) >> 16; + dst_line2[x+1].b += (line[2] * w + 32767) >> 16; + dst_line2[x+1].a += (line[3] * w + 32767) >> 16; dst_line2[x+1].weight += w; x_dst += dx_dst; -- cgit v1.2.3 From f8656d35101317a2b4a00eaf33f6d91d2d28dd7a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 29 Apr 2009 12:43:09 +0000 Subject: BGE alternative run mode for python controllers. Option to run a function in a module rather then a script from a python controller, this has a number of advantages. - No allocating and freeing the namespace dictionary for every time its triggered (hard to measure the overhead here, but in a test with calling 42240 scripts a second each defining 200 vars, using modules was ~25% faster) - Ability to use external python scripts for game logic. - Convenient debug option that lets you edit scripts while the game engine runs. --- source/blender/makesdna/DNA_controller_types.h | 6 + source/blender/src/buttons_logic.c | 11 +- .../gameengine/Converter/KX_ConvertControllers.cpp | 51 ++++--- .../gameengine/GameLogic/SCA_PythonController.cpp | 169 +++++++++++++++------ source/gameengine/GameLogic/SCA_PythonController.h | 26 +++- 5 files changed, 190 insertions(+), 73 deletions(-) (limited to 'source') diff --git a/source/blender/makesdna/DNA_controller_types.h b/source/blender/makesdna/DNA_controller_types.h index 376f95b0145..b3c82e746c1 100644 --- a/source/blender/makesdna/DNA_controller_types.h +++ b/source/blender/makesdna/DNA_controller_types.h @@ -43,6 +43,9 @@ typedef struct bExpressionCont { typedef struct bPythonCont { struct Text *text; + char module[64]; + int mode; + int flag; /* only used for debug now */ } bPythonCont; typedef struct bController { @@ -77,5 +80,8 @@ typedef struct bController { #define CONT_NEW 4 #define CONT_MASK 8 +/* pyctrl->flag */ +#define CONT_PY_DEBUG 1 + #endif diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index eb65dcc6785..168726c9dab 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -1578,7 +1578,16 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Script: ", xco+45,yco-24,width-90, 19, &pc->text, ""); + + uiBlockBeginAlign(block); + uiDefButI(block, MENU, B_REDR, "Execution Method%t|Script%x0|Module%x1", xco+24,yco-24, 66, 19, &pc->mode, 0, 0, 0, 0, "Python script type (textblock or module)"); + if(pc->mode==0) + uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "", xco+90,yco-24,width-90, 19, &pc->text, "Blender textblock to run as a script"); + else { + uiDefBut(block, TEX, 1, "", xco+90,yco-24,(width-90)-25, 19, pc->module, 0, 63, 0, 0, "Module name and function to run eg \"someModule.main\""); + uiDefButBitI(block, TOG, CONT_PY_DEBUG, B_REDR, "D", (xco+width)-25, yco-24, 19, 19, &pc->flag, 0, 0, 0, 0, "Continuously reload the module from disk for editing external modules without restrting, (slow)"); + } + uiBlockEndAlign(block); yco-= ysize; break; diff --git a/source/gameengine/Converter/KX_ConvertControllers.cpp b/source/gameengine/Converter/KX_ConvertControllers.cpp index fb100b0a68b..79664ca4622 100644 --- a/source/gameengine/Converter/KX_ConvertControllers.cpp +++ b/source/gameengine/Converter/KX_ConvertControllers.cpp @@ -154,29 +154,38 @@ void BL_ConvertControllers( } case CONT_PYTHON: { - - // we should create a Python controller here - - SCA_PythonController* pyctrl = new SCA_PythonController(gameobj); - gamecontroller = pyctrl; - bPythonCont* pycont = (bPythonCont*) bcontr->data; + SCA_PythonController* pyctrl = new SCA_PythonController(gameobj, pycont->mode); + gamecontroller = pyctrl; + pyctrl->SetDictionary(pythondictionary); - - if (pycont->text) - { - char *buf; - // this is some blender specific code - buf= txt_to_buf(pycont->text); - if (buf) + + if(pycont->mode==SCA_PythonController::SCA_PYEXEC_SCRIPT) { + if (pycont->text) { - pyctrl->SetScriptText(STR_String(buf)); - pyctrl->SetScriptName(pycont->text->id.name+2); - MEM_freeN(buf); + char *buf; + // this is some blender specific code + buf= txt_to_buf(pycont->text); + if (buf) + { + pyctrl->SetScriptText(STR_String(buf)); + pyctrl->SetScriptName(pycont->text->id.name+2); + MEM_freeN(buf); + } + } - } - + else { + /* let the controller print any warnings here when importing */ + pyctrl->SetScriptText(STR_String(pycont->module)); + pyctrl->SetScriptName(pycont->module); /* will be something like module.func so using it as the name is OK */ + } + + if(pycont->flag & CONT_PY_DEBUG) { + printf("\nDebuging \"%s\", module for object %s\n\texpect worse performance.\n", pycont->module, blenderobject->id.name+2); + pyctrl->SetDebug(true); + } + LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); break; } @@ -202,9 +211,13 @@ void BL_ConvertControllers( converter->RegisterGameController(gamecontroller, bcontr); if (bcontr->type==CONT_PYTHON) { + SCA_PythonController *pyctrl= static_cast(gamecontroller); /* not strictly needed but gives syntax errors early on and * gives more pradictable performance for larger scripts */ - (static_cast(gamecontroller))->Compile(); + if(pyctrl->m_mode==SCA_PythonController::SCA_PYEXEC_SCRIPT) + pyctrl->Compile(); + else + pyctrl->Import(); } //done with gamecontroller diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index ab4b5600d3f..39367c1ab9e 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -48,12 +48,17 @@ SCA_PythonController* SCA_PythonController::m_sCurrentController = NULL; SCA_PythonController::SCA_PythonController(SCA_IObject* gameobj, + int mode, PyTypeObject* T) : SCA_IController(gameobj, T), m_bytecode(NULL), + m_function(NULL), m_bModified(true), + m_debug(false), + m_mode(mode), m_pythondictionary(NULL) { + } /* @@ -74,15 +79,12 @@ int SCA_PythonController::Release() SCA_PythonController::~SCA_PythonController() { - if (m_bytecode) - { - // - //printf("released python byte script\n"); - Py_DECREF(m_bytecode); - } + //printf("released python byte script\n"); - if (m_pythondictionary) - { + Py_XDECREF(m_bytecode); + Py_XDECREF(m_function); + + if (m_pythondictionary) { // break any circular references in the dictionary PyDict_Clear(m_pythondictionary); Py_DECREF(m_pythondictionary); @@ -95,7 +97,7 @@ CValue* SCA_PythonController::GetReplica() { SCA_PythonController* replica = new SCA_PythonController(*this); // Copy the compiled bytecode if possible. - Py_XINCREF(replica->m_bytecode); + Py_XINCREF(replica->m_function); // this is ok since its not set to NULL replica->m_bModified = replica->m_bytecode == NULL; // The replica->m_pythondictionary is stolen - replace with a copy. @@ -267,41 +269,90 @@ PyAttributeDef SCA_PythonController::Attributes[] = { { NULL } //Sentinel }; -bool SCA_PythonController::Compile() +void SCA_PythonController::ErrorPrint(const char *error_msg) { + // didn't compile, so instead of compile, complain + // something is wrong, tell the user what went wrong + printf("%s - controller \"%s\":\n", error_msg, GetName().Ptr()); + //PyRun_SimpleString(m_scriptText.Ptr()); + PyErr_Print(); + + /* Added in 2.48a, the last_traceback can reference Objects for example, increasing + * their user count. Not to mention holding references to wrapped data. + * This is especially bad when the PyObject for the wrapped data is free'd, after blender + * has alredy dealocated the pointer */ + PySys_SetObject( (char *)"last_traceback", NULL); + PyErr_Clear(); /* just to be sure */ +} + +bool SCA_PythonController::Compile() +{ //printf("py script modified '%s'\n", m_scriptName.Ptr()); + m_bModified= false; // if a script already exists, decref it before replace the pointer to a new script - if (m_bytecode) - { + if (m_bytecode) { Py_DECREF(m_bytecode); m_bytecode=NULL; } + // recompile the scripttext into bytecode m_bytecode = Py_CompileString(m_scriptText.Ptr(), m_scriptName.Ptr(), Py_file_input); - m_bModified=false; - if (m_bytecode) - { - + if (m_bytecode) { return true; + } else { + ErrorPrint("Python error compiling script"); + return false; } - else { - // didn't compile, so instead of compile, complain - // something is wrong, tell the user what went wrong - printf("Python compile error from controller \"%s\": \n", GetName().Ptr()); - //PyRun_SimpleString(m_scriptText.Ptr()); - PyErr_Print(); - - /* Added in 2.48a, the last_traceback can reference Objects for example, increasing - * their user count. Not to mention holding references to wrapped data. - * This is especially bad when the PyObject for the wrapped data is free'd, after blender - * has alredy dealocated the pointer */ - PySys_SetObject( (char *)"last_traceback", NULL); - PyErr_Clear(); /* just to be sure */ - +} + +bool SCA_PythonController::Import() +{ + //printf("py module modified '%s'\n", m_scriptName.Ptr()); + m_bModified= false; + + /* incase we re-import */ + Py_XDECREF(m_function); + m_function= NULL; + + vector module_func = m_scriptText.Explode('.'); + + if(module_func.size() != 2 || module_func[0].Length()==0 || module_func[1].Length()==0) { + printf("Python module name formatting error \"%s\":\n\texpected \"SomeModule.Func\", got \"%s\"", GetName().Ptr(), m_scriptText.Ptr()); return false; } + + PyObject *mod = PyImport_ImportModule(module_func[0]); + if(mod && m_debug) { + Py_DECREF(mod); /* getting a new one so dont hold a ref to the old one */ + mod= PyImport_ReloadModule(mod); + } + + if(mod==NULL) { + ErrorPrint("Python module not found"); + return false; + } + Py_DECREF(mod); /* will be added to sys.modules so no need to keep a ref */ + + + PyObject *dict= PyModule_GetDict(mod); + m_function= PyDict_GetItemString(dict, module_func[1]); /* borrow */ + + if(m_function==NULL) { + printf("Python module error \"%s\":\n \"%s\" module fount but function missing\n", GetName().Ptr(), m_scriptText.Ptr()); + return false; + } + + if(!PyCallable_Check(m_function)) { + printf("Python module function error \"%s\":\n \"%s\" not callable", GetName().Ptr(), m_scriptText.Ptr()); + return false; + } + + Py_INCREF(m_function); + Py_INCREF(mod); + + return true; } void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) @@ -309,16 +360,18 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) m_sCurrentController = this; m_sCurrentLogicManager = logicmgr; - if (m_bModified) + PyObject *excdict= NULL; + PyObject* resultobj= NULL; + + switch(m_mode) { + case SCA_PYEXEC_SCRIPT: { - if (Compile()==false) // sets m_bModified to false + if (m_bModified) + if (Compile()==false) // sets m_bModified to false + return; + if (!m_bytecode) return; - } - if (!m_bytecode) { - return; - } - /* * This part here with excdict is a temporary patch * to avoid python/gameengine crashes when python @@ -337,10 +390,28 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) * should always ensure excdict is cleared). */ - PyObject *excdict= PyDict_Copy(m_pythondictionary); - PyObject* resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode, - excdict, excdict); - + excdict= PyDict_Copy(m_pythondictionary); + resultobj = PyEval_EvalCode((PyCodeObject*)m_bytecode, excdict, excdict); + /* PyRun_SimpleString(m_scriptText.Ptr()); */ + break; + } + case SCA_PYEXEC_MODULE: + { + if (m_bModified || m_debug) + if (Import()==false) // sets m_bModified to false + return; + if (!m_function) + return; + + resultobj = PyObject_CallObject(m_function, NULL); + break; + } + + } /* end switch */ + + + + /* Free the return value and print the error */ if (resultobj) { Py_DECREF(resultobj); @@ -357,14 +428,16 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) * has alredy dealocated the pointer */ PySys_SetObject( (char *)"last_traceback", NULL); PyErr_Clear(); /* just to be sure */ - - //PyRun_SimpleString(m_scriptText.Ptr()); } - - // clear after PyErrPrint - seems it can be using - // something in this dictionary and crash? - PyDict_Clear(excdict); - Py_DECREF(excdict); + + if(excdict) /* Only for SCA_PYEXEC_SCRIPT types */ + { + /* clear after PyErrPrint - seems it can be using + * something in this dictionary and crash? */ + PyDict_Clear(excdict); + Py_DECREF(excdict); + } + m_triggeredSensors.erase(m_triggeredSensors.begin(), m_triggeredSensors.end()); m_sCurrentController = NULL; } diff --git a/source/gameengine/GameLogic/SCA_PythonController.h b/source/gameengine/GameLogic/SCA_PythonController.h index f10c4e47ebb..12307632b06 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.h +++ b/source/gameengine/GameLogic/SCA_PythonController.h @@ -42,23 +42,35 @@ 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 */ 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 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 +79,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); -- cgit v1.2.3 From 3b19b6c33fa5a68309efe99c49fca0df60db02aa Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 29 Apr 2009 15:25:13 +0000 Subject: 2.5+ file read provision for 2.49 I've managed to find a basic fail-safe method to prevent using the read data with an OK popup. I then still will read the file, but wait for user confirmation to continue, or just free the database. The pupup tells the user that at least animation data will be lost. For background renders of 2.5+ things are more tricky, so here I've added a default failure to read, returning 0, which will typically gracefully quit blender. --- source/blender/blenkernel/intern/blender.c | 32 +++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 5dcccc56d06..906971f8bae 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -423,18 +423,31 @@ static void setup_app_data(BlendFileData *bfd, char *filename) MEM_freeN(bfd); } -static void handle_subversion_warning(Main *main) +static int handle_subversion_warning(Main *main) { if(main->minversionfile > BLENDER_VERSION || (main->minversionfile == BLENDER_VERSION && main->minsubversionfile > BLENDER_SUBVERSION)) { + extern int okee(char *str, ...); // XXX BAD LEVEL, DO NOT PORT TO 2.5! char str[128]; - - sprintf(str, "File written by newer Blender binary: %d.%d , expect loss of data!", main->minversionfile, main->minsubversionfile); - error(str); + + if(main->minversionfile >= 250) { + sprintf(str, "You have opened a %d file, key information will get lost, like animation data. Continue?", main->minversionfile); + + if(G.background) { + printf("ERROR: cannot render %d file\n", main->versionfile); + return 0; + } + else + return okee(str); + } + else { + sprintf(str, "File written by newer Blender binary: %d.%d , expect loss of data!", main->minversionfile, main->minsubversionfile); + error(str); + } } - + return 1; } /* returns: @@ -458,9 +471,14 @@ int BKE_read_file(char *dir, void *type_r) if (type_r) *((BlenFileType*)type_r)= bfd->type; - setup_app_data(bfd, dir); + if(0==handle_subversion_warning(bfd->main)) { + free_main(bfd->main); + MEM_freeN(bfd); + bfd= NULL; + } + else + setup_app_data(bfd, dir); // frees BFD - handle_subversion_warning(G.main); } else { error("Loading %s failed: %s", dir, BLO_bre_as_string(bre)); -- cgit v1.2.3 From f56bfbdd0c25feb815accdd377cf0b743c5d7e19 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 29 Apr 2009 16:07:10 +0000 Subject: Bugfix from own testing: Blender crashed, when started in debug -d, with compositor, after render. Reason was the BKE_image_print_memlist() which reads the ibuf->rect from all images, but for Image types "VIEWER" that's not valid, this data is coming from other sources. --- source/blender/blenkernel/intern/image.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source') diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 01d8ed4d41c..444c7c080ea 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -640,6 +640,11 @@ static uintptr_t image_mem_size(Image *ima) uintptr_t size = 0; size= 0; + + /* viewers have memory depending on other rules, has no valid rect pointer */ + if(ima->source==IMA_SRC_VIEWER) + return 0; + for(ibuf= ima->ibufs.first; ibuf; ibuf= ibuf->next) { if(ibuf->rect) size += MEM_allocN_len(ibuf->rect); else if(ibuf->rect_float) size += MEM_allocN_len(ibuf->rect_float); -- cgit v1.2.3 From 133c91dd2f54bbee0343480dc7c711cdbc11b78b Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 29 Apr 2009 16:16:08 +0000 Subject: Bugfix #18649 Grease pencil, floating panel, "Delete last stroke" crashed when there were no strokes. Simple NULL check added. --- source/blender/src/drawgpencil.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/src/drawgpencil.c b/source/blender/src/drawgpencil.c index 5cabb38887a..4ec9b587b58 100644 --- a/source/blender/src/drawgpencil.c +++ b/source/blender/src/drawgpencil.c @@ -139,12 +139,14 @@ void gp_ui_delstroke_cb (void *gpd, void *gpl) { bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0); - if (gpf->framenum != CFRA) return; + if (gpf) { + if (gpf->framenum != CFRA) return; - gpencil_layer_setactive(gpd, gpl); - gpencil_frame_delete_laststroke(gpl, gpf); - - scrarea_queue_winredraw(curarea); + gpencil_layer_setactive(gpd, gpl); + gpencil_frame_delete_laststroke(gpl, gpf); + + scrarea_queue_winredraw(curarea); + } } /* delete active frame of active layer */ -- cgit v1.2.3 From 11ad5f838992857f8bd494bbe0adb0d91963514f Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 29 Apr 2009 16:41:18 +0000 Subject: Bug, reported by venomgfx: Scrub frames in Sequencer image window stopped working. Was in a commit from Joshua last july, with greasepencil fixes. No idea why he disabled it, doesn't seem to harm gpencil at all (not in sequencer supported). --- source/blender/src/space.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/space.c b/source/blender/src/space.c index c6510b780d8..8ff2b526ae8 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -5023,7 +5023,7 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) switch(event) { case LEFTMOUSE: - if(sseq->mainb==0 && view2dmove(event)==0) { + if(sseq->mainb==0 || view2dmove(event)==0) { first= 1; set_special_seq_update(1); -- cgit v1.2.3 From d6c525d624ea98bf6eeac1a7f3483f41fed1ef4f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 29 Apr 2009 16:48:00 +0000 Subject: attempt to fix for py2.3 --- source/gameengine/GameLogic/SCA_PythonController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 39367c1ab9e..b9f8dde89bf 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -323,7 +323,7 @@ bool SCA_PythonController::Import() return false; } - PyObject *mod = PyImport_ImportModule(module_func[0]); + PyObject *mod = PyImport_ImportModule((char *)module_func[0].Ptr()); if(mod && m_debug) { Py_DECREF(mod); /* getting a new one so dont hold a ref to the old one */ mod= PyImport_ReloadModule(mod); -- cgit v1.2.3 From 81dfdf8374382c766c88bbed421ed70c02565234 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 29 Apr 2009 16:54:45 +0000 Subject: ifdef's for future py3 support, after this adding py3 can mostly be done with defines or batch renaming funcs (with the exception of CListValue slicing) . No changes for py2.x. --- .../BlenderRoutines/KX_BlenderRenderTools.cpp | 1 + source/gameengine/Converter/BL_ActionActuator.cpp | 9 ++- .../Converter/BL_ShapeActionActuator.cpp | 9 ++- source/gameengine/Expressions/InputParser.cpp | 19 +++++++ source/gameengine/Expressions/ListValue.cpp | 17 +++++- source/gameengine/Expressions/PyObjectPlus.cpp | 7 ++- source/gameengine/Expressions/Value.cpp | 27 ++++++++- .../gameengine/GameLogic/SCA_2DFilterActuator.cpp | 9 ++- source/gameengine/GameLogic/SCA_ANDController.cpp | 9 ++- source/gameengine/GameLogic/SCA_ActuatorSensor.cpp | 9 ++- source/gameengine/GameLogic/SCA_AlwaysSensor.cpp | 9 ++- source/gameengine/GameLogic/SCA_DelaySensor.cpp | 9 ++- source/gameengine/GameLogic/SCA_ILogicBrick.cpp | 9 ++- source/gameengine/GameLogic/SCA_IObject.cpp | 9 ++- source/gameengine/GameLogic/SCA_ISensor.cpp | 9 ++- source/gameengine/GameLogic/SCA_JoystickSensor.cpp | 9 ++- source/gameengine/GameLogic/SCA_KeyboardSensor.cpp | 9 ++- source/gameengine/GameLogic/SCA_MouseSensor.cpp | 9 ++- source/gameengine/GameLogic/SCA_NANDController.cpp | 9 ++- source/gameengine/GameLogic/SCA_NORController.cpp | 9 ++- source/gameengine/GameLogic/SCA_ORController.cpp | 9 ++- .../gameengine/GameLogic/SCA_PropertyActuator.cpp | 9 ++- source/gameengine/GameLogic/SCA_PropertySensor.cpp | 9 ++- .../gameengine/GameLogic/SCA_PythonController.cpp | 9 ++- source/gameengine/GameLogic/SCA_RandomActuator.cpp | 9 ++- source/gameengine/GameLogic/SCA_RandomSensor.cpp | 9 ++- source/gameengine/GameLogic/SCA_XNORController.cpp | 9 ++- source/gameengine/GameLogic/SCA_XORController.cpp | 9 ++- source/gameengine/Ketsji/BL_Shader.cpp | 9 ++- .../Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp | 9 ++- .../Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp | 9 ++- source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 9 ++- source/gameengine/Ketsji/KX_CDActuator.cpp | 9 ++- source/gameengine/Ketsji/KX_Camera.cpp | 9 ++- source/gameengine/Ketsji/KX_CameraActuator.cpp | 9 ++- source/gameengine/Ketsji/KX_ConstraintActuator.cpp | 9 ++- source/gameengine/Ketsji/KX_ConstraintWrapper.cpp | 9 ++- source/gameengine/Ketsji/KX_GameActuator.cpp | 9 ++- source/gameengine/Ketsji/KX_GameObject.cpp | 9 ++- source/gameengine/Ketsji/KX_IpoActuator.cpp | 9 ++- source/gameengine/Ketsji/KX_Light.cpp | 9 ++- source/gameengine/Ketsji/KX_MeshProxy.cpp | 9 ++- source/gameengine/Ketsji/KX_MouseFocusSensor.cpp | 9 ++- source/gameengine/Ketsji/KX_NearSensor.cpp | 9 ++- source/gameengine/Ketsji/KX_ObjectActuator.cpp | 9 ++- source/gameengine/Ketsji/KX_ParentActuator.cpp | 9 ++- .../gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp | 9 ++- source/gameengine/Ketsji/KX_PolyProxy.cpp | 9 ++- source/gameengine/Ketsji/KX_PolygonMaterial.cpp | 9 ++- .../gameengine/Ketsji/KX_PyConstraintBinding.cpp | 18 +++++- source/gameengine/Ketsji/KX_PythonInit.cpp | 65 +++++++++++++++++++++- source/gameengine/Ketsji/KX_RadarSensor.cpp | 9 ++- source/gameengine/Ketsji/KX_RaySensor.cpp | 9 ++- .../gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp | 9 ++- .../gameengine/Ketsji/KX_SCA_DynamicActuator.cpp | 9 ++- .../gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp | 9 ++- .../Ketsji/KX_SCA_ReplaceMeshActuator.cpp | 9 ++- source/gameengine/Ketsji/KX_Scene.cpp | 9 ++- source/gameengine/Ketsji/KX_SceneActuator.cpp | 9 ++- source/gameengine/Ketsji/KX_SoundActuator.cpp | 9 ++- source/gameengine/Ketsji/KX_StateActuator.cpp | 9 ++- source/gameengine/Ketsji/KX_TouchSensor.cpp | 9 ++- source/gameengine/Ketsji/KX_TrackToActuator.cpp | 9 ++- source/gameengine/Ketsji/KX_VehicleWrapper.cpp | 9 ++- source/gameengine/Ketsji/KX_VertexProxy.cpp | 9 ++- source/gameengine/Ketsji/KX_VisibilityActuator.cpp | 9 ++- .../gameengine/VideoTexture/FilterBlueScreen.cpp | 7 ++- source/gameengine/VideoTexture/FilterColor.cpp | 21 ++++++- source/gameengine/VideoTexture/FilterNormal.cpp | 7 ++- source/gameengine/VideoTexture/FilterSource.cpp | 21 ++++++- source/gameengine/VideoTexture/ImageBuff.cpp | 7 ++- source/gameengine/VideoTexture/ImageMix.cpp | 7 ++- source/gameengine/VideoTexture/ImageRender.cpp | 14 ++++- source/gameengine/VideoTexture/ImageViewport.cpp | 7 ++- source/gameengine/VideoTexture/Texture.cpp | 7 ++- source/gameengine/VideoTexture/VideoFFmpeg.cpp | 14 ++++- source/gameengine/VideoTexture/blendVideoTex.cpp | 24 +++++++- 77 files changed, 677 insertions(+), 144 deletions(-) (limited to 'source') diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp index e393b6d9af4..0239027f2cb 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp @@ -268,6 +268,7 @@ void KX_BlenderRenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmat // 'normal' object glMultMatrixd(oglmatrix); } + glMultMatrixd(oglmatrix); } } diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 3ad55f5ee12..ee97e325a8e 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -942,8 +942,13 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, /* ------------------------------------------------------------------------- */ PyTypeObject BL_ActionActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "BL_ActionActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index 60d26b9a99f..5fea568dcb2 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -418,8 +418,13 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) /* Integration hooks ------------------------------------------------------- */ PyTypeObject BL_ShapeActionActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "BL_ShapeActionActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp index 834dff7af89..d45a9375dc7 100644 --- a/source/gameengine/Expressions/InputParser.cpp +++ b/source/gameengine/Expressions/InputParser.cpp @@ -658,10 +658,29 @@ static PyMethodDef CParserMethods[] = { NULL,NULL} // Sentinel }; + +#if (PY_VERSION_HEX >= 0x03000000) +static struct PyModuleDef Expression_module_def = { + {}, /* m_base */ + "Expression", /* m_name */ + 0, /* m_doc */ + 0, /* m_size */ + CParserMethods, /* m_methods */ + 0, /* m_reload */ + 0, /* m_traverse */ + 0, /* m_clear */ + 0, /* m_free */ +}; +#endif + extern "C" { void initExpressionModule(void) { +#if (PY_VERSION_HEX >= 0x03000000) + PyModule_Create(&Expression_module_def); +#else Py_InitModule("Expression",CParserMethods); +#endif } } diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 3596128f12d..fc6b9299146 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -212,9 +212,15 @@ static PySequenceMethods listvalue_as_sequence = { listvalue_buffer_concat, /*sq_concat*/ NULL, /*sq_repeat*/ listvalue_buffer_item, /*sq_item*/ +#if (PY_VERSION_HEX >= 0x03000000) // TODO, slicing in py3? + NULL, + NULL, + NULL, +#else listvalue_buffer_slice, /*sq_slice*/ - NULL, /*sq_ass_item*/ - NULL /*sq_ass_slice*/ + (ssizeobjargproc)NULL, /*sq_ass_item*/ + NULL, /*sq_ass_slice*/ +#endif }; @@ -229,8 +235,13 @@ static PyMappingMethods instance_as_mapping = { PyTypeObject CListValue::Type = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "CListValue", /*tp_name*/ sizeof(PyObjectPlus_Proxy), /*tp_basicsize*/ 0, /*tp_itemsize*/ diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 8bd34cdc73b..e6b49332273 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -56,8 +56,13 @@ PyTypeObject PyObjectPlus::Type = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "PyObjectPlus", /*tp_name*/ sizeof(PyObjectPlus_Proxy), /*tp_basicsize*/ 0, /*tp_itemsize*/ diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 088b5cb98a4..fbd86cc4022 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -36,8 +36,13 @@ double CValue::m_sZeroVec[3] = {0.0,0.0,0.0}; #ifndef NO_EXP_PYTHON_EMBEDDING PyTypeObject CValue::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "CValue", sizeof(PyObjectPlus_Proxy), 0, @@ -751,10 +756,28 @@ PyObject* CValue::PyMake(PyObject* ignored,PyObject* args) } */ +#if (PY_VERSION_HEX >= 0x03000000) +static struct PyModuleDef CValue_module_def = { + {}, /* m_base */ + "CValue", /* m_name */ + 0, /* m_doc */ + 0, /* m_size */ + CValueMethods, /* m_methods */ + 0, /* m_reload */ + 0, /* m_traverse */ + 0, /* m_clear */ + 0, /* m_free */ +}; +#endif + extern "C" { void initCValue(void) { +#if (PY_VERSION_HEX >= 0x03000000) + PyModule_Create(&CValue_module_def); +#else Py_InitModule("CValue",CValueMethods); +#endif } } diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index ed834587414..fb72eefb4a4 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -108,8 +108,13 @@ void SCA_2DFilterActuator::SetShaderText(STR_String text) /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_2DFilterActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_2DFilterActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_ANDController.cpp b/source/gameengine/GameLogic/SCA_ANDController.cpp index ed2372200e9..1b151cbe615 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.cpp +++ b/source/gameengine/GameLogic/SCA_ANDController.cpp @@ -107,8 +107,13 @@ CValue* SCA_ANDController::GetReplica() /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_ANDController::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_ANDController", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index 928060d7394..464797fd776 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -122,8 +122,13 @@ void SCA_ActuatorSensor::Update() /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_ActuatorSensor::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_ActuatorSensor", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp index 941f3b55b44..19d19b6e0be 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp @@ -105,8 +105,13 @@ bool SCA_AlwaysSensor::Evaluate(CValue* event) /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_AlwaysSensor::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_AlwaysSensor", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp index 15e805a657c..4752d0eb345 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.cpp +++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp @@ -131,8 +131,13 @@ bool SCA_DelaySensor::Evaluate(CValue* event) /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_DelaySensor::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_DelaySensor", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 8439dbac268..84babda1d7a 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -209,8 +209,13 @@ CValue* SCA_ILogicBrick::GetEvent() /* python stuff */ PyTypeObject SCA_ILogicBrick::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_ILogicBrick", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index 8e599e6411a..b3c4708978d 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -375,8 +375,13 @@ void SCA_IObject::SetState(unsigned int state) /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_IObject::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_IObject", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index b556c14831e..4d69216ed0b 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -393,8 +393,13 @@ KX_PYMETHODDEF_DOC_NOARGS(SCA_ISensor, reset, /* ----------------------------------------------- */ PyTypeObject SCA_ISensor::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_ISensor", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index b9d99177259..34d63a4ee2b 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -266,8 +266,13 @@ bool SCA_JoystickSensor::isValid(SCA_JoystickSensor::KX_JOYSENSORMODE m) /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_JoystickSensor::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_JoystickSensor", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index 5dcdb222713..821d2155d2a 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -612,8 +612,13 @@ KX_PYMETHODDEF_DOC_O(SCA_KeyboardSensor, getKeyStatus, /* ------------------------------------------------------------------------- */ PyTypeObject SCA_KeyboardSensor::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_KeyboardSensor", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index 65942327e68..46be6ad9e16 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -296,8 +296,13 @@ KX_PYMETHODDEF_DOC_O(SCA_MouseSensor, getButtonStatus, /* ------------------------------------------------------------------------- */ PyTypeObject SCA_MouseSensor::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_MouseSensor", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_NANDController.cpp b/source/gameengine/GameLogic/SCA_NANDController.cpp index ab5c39dc039..4643a42a4be 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.cpp +++ b/source/gameengine/GameLogic/SCA_NANDController.cpp @@ -107,8 +107,13 @@ CValue* SCA_NANDController::GetReplica() /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_NANDController::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_NANDController", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_NORController.cpp b/source/gameengine/GameLogic/SCA_NORController.cpp index 918e6a348ae..a0e9fcb239c 100644 --- a/source/gameengine/GameLogic/SCA_NORController.cpp +++ b/source/gameengine/GameLogic/SCA_NORController.cpp @@ -107,8 +107,13 @@ CValue* SCA_NORController::GetReplica() /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_NORController::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_NORController", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_ORController.cpp b/source/gameengine/GameLogic/SCA_ORController.cpp index 034c3ee29cd..87e6d19d008 100644 --- a/source/gameengine/GameLogic/SCA_ORController.cpp +++ b/source/gameengine/GameLogic/SCA_ORController.cpp @@ -99,8 +99,13 @@ void SCA_ORController::Trigger(SCA_LogicManager* logicmgr) /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_ORController::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_ORController", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index f3ca63066c9..33dc83506f3 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -228,8 +228,13 @@ void SCA_PropertyActuator::Relink(GEN_Map *obj_map) /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_PropertyActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_PropertyActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index 7953698c6ef..c78283db423 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -306,8 +306,13 @@ int SCA_PropertySensor::validValueForProperty(void *self, const PyAttributeDef*) /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_PropertySensor::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_PropertySensor", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index b9f8dde89bf..33207950697 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -223,8 +223,13 @@ const char* SCA_PythonController::sPyAddActiveActuator__doc__= "addActiveActuato const char SCA_PythonController::GetActuators_doc[] = "getActuator"; PyTypeObject SCA_PythonController::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_PythonController", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index 91110425f7f..2db871c77cf 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -310,8 +310,13 @@ void SCA_RandomActuator::enforceConstraints() { /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_RandomActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_RandomActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 70a23124929..5c109bac024 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -127,8 +127,13 @@ bool SCA_RandomSensor::Evaluate(CValue* event) /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_RandomSensor::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_RandomSensor", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_XNORController.cpp b/source/gameengine/GameLogic/SCA_XNORController.cpp index 13d50100d6c..947e8b7a68a 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.cpp +++ b/source/gameengine/GameLogic/SCA_XNORController.cpp @@ -111,8 +111,13 @@ CValue* SCA_XNORController::GetReplica() /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_XNORController::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_XNORController", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/GameLogic/SCA_XORController.cpp b/source/gameengine/GameLogic/SCA_XORController.cpp index 6613742a080..d9e41c2b27e 100644 --- a/source/gameengine/GameLogic/SCA_XORController.cpp +++ b/source/gameengine/GameLogic/SCA_XORController.cpp @@ -111,8 +111,13 @@ CValue* SCA_XORController::GetReplica() /* Integration hooks ------------------------------------------------------- */ PyTypeObject SCA_XORController::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "SCA_XORController", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index 2b3612ec3ae..c5c517c8a65 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -776,8 +776,13 @@ PyAttributeDef BL_Shader::Attributes[] = { }; PyTypeObject BL_Shader::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "BL_Shader", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp index 712f64d5f8f..7f21c490e67 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp @@ -102,8 +102,13 @@ CValue* KX_NetworkMessageActuator::GetReplica() /* Integration hooks -------------------------------------------------- */ PyTypeObject KX_NetworkMessageActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_NetworkMessageActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index d770465e1ea..82e2437064b 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -166,8 +166,13 @@ bool KX_NetworkMessageSensor::IsPositiveTrigger() /* Integration hooks --------------------------------------------------- */ PyTypeObject KX_NetworkMessageSensor::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_NetworkMessageSensor", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 70907db608a..5f08739ea14 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -788,8 +788,13 @@ PyAttributeDef KX_BlenderMaterial::Attributes[] = { }; PyTypeObject KX_BlenderMaterial::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_BlenderMaterial", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_CDActuator.cpp b/source/gameengine/Ketsji/KX_CDActuator.cpp index a0b2c73901f..7f8505afa3d 100644 --- a/source/gameengine/Ketsji/KX_CDActuator.cpp +++ b/source/gameengine/Ketsji/KX_CDActuator.cpp @@ -155,8 +155,13 @@ bool KX_CDActuator::Update() /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_CDActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_SoundActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index bc2c2fc33b0..3ea01cca5ca 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -512,8 +512,13 @@ PyAttributeDef KX_Camera::Attributes[] = { }; PyTypeObject KX_Camera::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_Camera", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index 38a68752958..e701a680511 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -369,8 +369,13 @@ bool KX_CameraActuator::string2axischoice(const char *axisString) /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_CameraActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_CameraActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index 34102132db8..c9cb8e1b942 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -566,8 +566,13 @@ bool KX_ConstraintActuator::IsValidMode(KX_ConstraintActuator::KX_CONSTRAINTTYPE /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_ConstraintActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_ConstraintActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index cab42f08d2a..c63f9e57ed2 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -56,8 +56,13 @@ PyObject* KX_ConstraintWrapper::PyGetConstraintId(PyObject* args, PyObject* kwds //python specific stuff PyTypeObject KX_ConstraintWrapper::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_ConstraintWrapper", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index a46318d0468..48d7dcd84a2 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -206,8 +206,13 @@ bool KX_GameActuator::Update() /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_GameActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_GameActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index ed162238e8a..20113afaae2 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1322,8 +1322,13 @@ PyMappingMethods KX_GameObject::Mapping = { }; PyTypeObject KX_GameObject::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_GameObject", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index df80085d9f2..efe01993b08 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -413,8 +413,13 @@ int KX_IpoActuator::string2mode(char* modename) { /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_IpoActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_IpoActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index 498eb7262b5..0f90bfd8a02 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -179,8 +179,13 @@ PyObject* KX_LightObject::py_getattro_dict() { PyTypeObject KX_LightObject::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_LightObject", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index 009364a3d7b..eede3a0e832 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -46,8 +46,13 @@ #include "PyObjectPlus.h" PyTypeObject KX_MeshProxy::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_MeshProxy", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index d141aa482c8..9106902ca0e 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -335,8 +335,13 @@ const MT_Vector3& KX_MouseFocusSensor::HitNormal() const /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_MouseFocusSensor::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_MouseFocusSensor", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp index 2f1a3af78fa..e7f05555b64 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.cpp +++ b/source/gameengine/Ketsji/KX_NearSensor.cpp @@ -269,8 +269,13 @@ bool KX_NearSensor::NewHandleCollision(void* obj1,void* obj2,const PHY_CollData /* ------------------------------------------------------------------------- */ PyTypeObject KX_NearSensor::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_NearSensor", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 86ae082523f..e3d7a0f4b71 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -274,8 +274,13 @@ bool KX_ObjectActuator::isValid(KX_ObjectActuator::KX_OBJECT_ACT_VEC_TYPE type) /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_ObjectActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_ObjectActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index ffd7185f235..37d2e50cdb6 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -137,8 +137,13 @@ bool KX_ParentActuator::Update() /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_ParentActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_ParentActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp index c0c15b5599c..c968e50957e 100644 --- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp +++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp @@ -113,8 +113,13 @@ PyAttributeDef KX_PhysicsObjectWrapper::Attributes[] = { //python specific stuff PyTypeObject KX_PhysicsObjectWrapper::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_PhysicsObjectWrapper", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index 33e215387b7..ca38117a9e7 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -39,8 +39,13 @@ #include "KX_PyMath.h" PyTypeObject KX_PolyProxy::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_PolyProxy", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index a39ff486689..918c251599e 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -234,8 +234,13 @@ PyAttributeDef KX_PolygonMaterial::Attributes[] = { }; PyTypeObject KX_PolygonMaterial::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_PolygonMaterial", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index 2c65c184a9c..e801e9c5858 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -565,6 +565,19 @@ static struct PyMethodDef physicsconstraints_methods[] = { }; +#if (PY_VERSION_HEX >= 0x03000000) +static struct PyModuleDef PhysicsConstraints_module_def = { + {}, /* m_base */ + "PhysicsConstraints", /* m_name */ + PhysicsConstraints_module_documentation, /* m_doc */ + 0, /* m_size */ + physicsconstraints_methods, /* m_methods */ + 0, /* m_reload */ + 0, /* m_traverse */ + 0, /* m_clear */ + 0, /* m_free */ +}; +#endif PyObject* initPythonConstraintBinding() { @@ -573,10 +586,13 @@ PyObject* initPythonConstraintBinding() PyObject* m; PyObject* d; - +#if (PY_VERSION_HEX >= 0x03000000) + m = PyModule_Create(&PhysicsConstraints_module_def); +#else m = Py_InitModule4("PhysicsConstraints", physicsconstraints_methods, PhysicsConstraints_module_documentation, (PyObject*)NULL,PYTHON_API_VERSION); +#endif // Add some symbolic constants to the module d = PyModule_GetDict(m); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index f82110c2bd2..22e092e8277 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1073,7 +1073,19 @@ static char Rasterizer_module_documentation[] = "This is the Python API for the game engine of Rasterizer" ; - +#if (PY_VERSION_HEX >= 0x03000000) +static struct PyModuleDef GameLogic_module_def = { + {}, /* m_base */ + "GameLogic", /* m_name */ + GameLogic_module_documentation, /* m_doc */ + 0, /* m_size */ + game_methods, /* m_methods */ + 0, /* m_reload */ + 0, /* m_traverse */ + 0, /* m_clear */ + 0, /* m_free */ +}; +#endif PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack to get gravity hook { @@ -1087,9 +1099,14 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack gUseVisibilityTemp=false; // Create the module and add the functions + +#if (PY_VERSION_HEX >= 0x03000000) + m = PyModule_Create(&GameLogic_module_def); +#else m = Py_InitModule4("GameLogic", game_methods, GameLogic_module_documentation, (PyObject*)NULL,PYTHON_API_VERSION); +#endif // Add some symbolic constants to the module d = PyModule_GetDict(m); @@ -1498,15 +1515,18 @@ void setSandbox(TPythonSecurityLevel level) */ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level, Main *maggie, int argc, char** argv) { +#if (PY_VERSION_HEX < 0x03000000) STR_String pname = progname; Py_SetProgramName(pname.Ptr()); +#endif Py_NoSiteFlag=1; Py_FrozenFlag=1; Py_Initialize(); +#if (PY_VERSION_HEX < 0x03000000) if(argv) /* browser plugins dont currently set this */ PySys_SetArgv(argc, argv); - +#endif //importBlenderModules() setSandbox(level); @@ -1530,8 +1550,10 @@ void exitGamePlayerPythonScripting() */ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level, Main *maggie) { +#if (PY_VERSION_HEX < 0x03000000) STR_String pname = progname; Py_SetProgramName(pname.Ptr()); +#endif Py_NoSiteFlag=1; Py_FrozenFlag=1; @@ -1587,6 +1609,19 @@ void exitGamePythonScripting() } +#if (PY_VERSION_HEX >= 0x03000000) +static struct PyModuleDef Rasterizer_module_def = { + {}, /* m_base */ + "Rasterizer", /* m_name */ + Rasterizer_module_documentation, /* m_doc */ + 0, /* m_size */ + rasterizer_methods, /* m_methods */ + 0, /* m_reload */ + 0, /* m_traverse */ + 0, /* m_clear */ + 0, /* m_free */ +}; +#endif PyObject* initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas) { @@ -1599,9 +1634,13 @@ PyObject* initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas) PyObject* item; // Create the module and add the functions +#if (PY_VERSION_HEX >= 0x03000000) + m = PyModule_Create(&Rasterizer_module_def); +#else m = Py_InitModule4("Rasterizer", rasterizer_methods, Rasterizer_module_documentation, (PyObject*)NULL,PYTHON_API_VERSION); +#endif // Add some symbolic constants to the module d = PyModule_GetDict(m); @@ -1651,7 +1690,12 @@ static PyObject* gPyEventToString(PyObject*, PyObject* value) dict = PyModule_GetDict(mod); while (PyDict_Next(dict, &pos, &key, &val)) { +#if (PY_VERSION_HEX >= 0x03000000) + if (PyObject_RichCompareBool(value, val, Py_EQ)) { +#else if (PyObject_Compare(value, val)==0) { +#endif + ret = key; break; } @@ -1693,6 +1737,19 @@ static struct PyMethodDef gamekeys_methods[] = { }; +#if (PY_VERSION_HEX >= 0x03000000) +static struct PyModuleDef GameKeys_module_def = { + {}, /* m_base */ + "GameKeys", /* m_name */ + GameKeys_module_documentation, /* m_doc */ + 0, /* m_size */ + gamekeys_methods, /* m_methods */ + 0, /* m_reload */ + 0, /* m_traverse */ + 0, /* m_clear */ + 0, /* m_free */ +}; +#endif PyObject* initGameKeys() { @@ -1701,9 +1758,13 @@ PyObject* initGameKeys() PyObject* item; // Create the module and add the functions +#if (PY_VERSION_HEX >= 0x03000000) + m = PyModule_Create(&GameKeys_module_def); +#else m = Py_InitModule4("GameKeys", gamekeys_methods, GameKeys_module_documentation, (PyObject*)NULL,PYTHON_API_VERSION); +#endif // Add some symbolic constants to the module d = PyModule_GetDict(m); diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index bf4b0f67e03..1959dd52046 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -232,8 +232,13 @@ PyObject* KX_RadarSensor::PyGetConeHeight() { /* Python Integration Hooks */ /* ------------------------------------------------------------------------- */ PyTypeObject KX_RadarSensor::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_RadarSensor", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index ea9356a49d1..43d8806fc68 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -320,8 +320,13 @@ bool KX_RaySensor::Evaluate(CValue* event) /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_RaySensor::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_RaySensor", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index dd9d63f5cd9..2fd786e44e3 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -166,8 +166,13 @@ void KX_SCA_AddObjectActuator::Relink(GEN_Map *obj_map) /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_SCA_AddObjectActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_SCA_AddObjectActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp index 4bc42686d78..af5631b4403 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp @@ -51,8 +51,13 @@ PyTypeObject KX_SCA_DynamicActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_SCA_DynamicActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp index a0b411dd3a9..728254e7f48 100644 --- a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp @@ -92,8 +92,13 @@ CValue* KX_SCA_EndObjectActuator::GetReplica() /* ------------------------------------------------------------------------- */ PyTypeObject KX_SCA_EndObjectActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_SCA_EndObjectActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp index 8b87253d0a3..730d1ed49e6 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp @@ -53,8 +53,13 @@ PyTypeObject KX_SCA_ReplaceMeshActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_SCA_ReplaceMeshActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 1c1cc881d17..fd244037722 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1595,8 +1595,13 @@ double KX_Scene::getSuspendedDelta() //Python PyTypeObject KX_Scene::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_Scene", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index 4447ff48766..1cce93fbcc5 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -223,8 +223,13 @@ KX_Scene* KX_SceneActuator::FindScene(char * sceneName) /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_SceneActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_SceneActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index db3d92ffd79..15eb354ee79 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -232,8 +232,13 @@ void KX_SoundActuator::setSoundObject(class SND_SoundObject* soundobject) /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_SoundActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_SoundActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_StateActuator.cpp b/source/gameengine/Ketsji/KX_StateActuator.cpp index 71ffa16cb54..2cbb42b3311 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.cpp +++ b/source/gameengine/Ketsji/KX_StateActuator.cpp @@ -107,8 +107,13 @@ KX_StateActuator::Update() /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_StateActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_StateActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 2addfc31ff3..f000c16041a 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -246,8 +246,13 @@ bool KX_TouchSensor::NewHandleCollision(void*object1,void*object2,const PHY_Coll /* ------------------------------------------------------------------------- */ /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_TouchSensor::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_TouchSensor", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index 808bf0a55b5..672b9e739ba 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -425,8 +425,13 @@ bool KX_TrackToActuator::Update(double curtime, bool frame) /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_TrackToActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_TrackToActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp index 5a0ec3515f6..e43a5caa50a 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp @@ -273,8 +273,13 @@ PyObject* KX_VehicleWrapper::PyGetConstraintType(PyObject* args) //python specific stuff PyTypeObject KX_VehicleWrapper::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_VehicleWrapper", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index 629fadff86a..93ff35b5a9d 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -37,8 +37,13 @@ #include "KX_PyMath.h" PyTypeObject KX_VertexProxy::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_VertexProxy", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp index ed12a88ad6a..46a1db9378a 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp @@ -92,8 +92,13 @@ KX_VisibilityActuator::Update() /* Integration hooks ------------------------------------------------------- */ PyTypeObject KX_VisibilityActuator::Type = { - PyObject_HEAD_INIT(NULL) - 0, +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "KX_VisibilityActuator", sizeof(PyObjectPlus_Proxy), 0, diff --git a/source/gameengine/VideoTexture/FilterBlueScreen.cpp b/source/gameengine/VideoTexture/FilterBlueScreen.cpp index 43d7566102a..6b23105a278 100644 --- a/source/gameengine/VideoTexture/FilterBlueScreen.cpp +++ b/source/gameengine/VideoTexture/FilterBlueScreen.cpp @@ -135,8 +135,13 @@ static PyGetSetDef filterBSGetSets[] = // define python type PyTypeObject FilterBlueScreenType = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.FilterBlueScreen", /*tp_name*/ sizeof(PyFilter), /*tp_basicsize*/ 0, /*tp_itemsize*/ diff --git a/source/gameengine/VideoTexture/FilterColor.cpp b/source/gameengine/VideoTexture/FilterColor.cpp index 22ee729b200..5ff1f7f11ce 100644 --- a/source/gameengine/VideoTexture/FilterColor.cpp +++ b/source/gameengine/VideoTexture/FilterColor.cpp @@ -41,8 +41,13 @@ static PyGetSetDef filterGrayGetSets[] = // define python type PyTypeObject FilterGrayType = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.FilterGray", /*tp_name*/ sizeof(PyFilter), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -173,8 +178,13 @@ static PyGetSetDef filterColorGetSets[] = // define python type PyTypeObject FilterColorType = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.FilterColor", /*tp_name*/ sizeof(PyFilter), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -307,8 +317,13 @@ static PyGetSetDef filterLevelGetSets[] = // define python type PyTypeObject FilterLevelType = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.FilterLevel", /*tp_name*/ sizeof(PyFilter), /*tp_basicsize*/ 0, /*tp_itemsize*/ diff --git a/source/gameengine/VideoTexture/FilterNormal.cpp b/source/gameengine/VideoTexture/FilterNormal.cpp index a7266967efb..9a2b1e90d5a 100644 --- a/source/gameengine/VideoTexture/FilterNormal.cpp +++ b/source/gameengine/VideoTexture/FilterNormal.cpp @@ -124,8 +124,13 @@ static PyGetSetDef filterNormalGetSets[] = // define python type PyTypeObject FilterNormalType = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.FilterNormal", /*tp_name*/ sizeof(PyFilter), /*tp_basicsize*/ 0, /*tp_itemsize*/ diff --git a/source/gameengine/VideoTexture/FilterSource.cpp b/source/gameengine/VideoTexture/FilterSource.cpp index f3676e93a6d..4c75e14bbac 100644 --- a/source/gameengine/VideoTexture/FilterSource.cpp +++ b/source/gameengine/VideoTexture/FilterSource.cpp @@ -36,8 +36,13 @@ http://www.gnu.org/copyleft/lesser.txt. // define python type PyTypeObject FilterRGB24Type = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.FilterRGB24", /*tp_name*/ sizeof(PyFilter), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -82,8 +87,13 @@ PyTypeObject FilterRGB24Type = // define python type PyTypeObject FilterRGBA32Type = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.FilterRGBA32", /*tp_name*/ sizeof(PyFilter), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -128,8 +138,13 @@ PyTypeObject FilterRGBA32Type = // define python type PyTypeObject FilterBGR24Type = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.FilterBGR24", /*tp_name*/ sizeof(PyFilter), /*tp_basicsize*/ 0, /*tp_itemsize*/ diff --git a/source/gameengine/VideoTexture/ImageBuff.cpp b/source/gameengine/VideoTexture/ImageBuff.cpp index 19ad17ac643..c8e62aff240 100644 --- a/source/gameengine/VideoTexture/ImageBuff.cpp +++ b/source/gameengine/VideoTexture/ImageBuff.cpp @@ -123,8 +123,13 @@ static PyGetSetDef imageBuffGetSets[] = // define python type PyTypeObject ImageBuffType = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.ImageBuff", /*tp_name*/ sizeof(PyImage), /*tp_basicsize*/ 0, /*tp_itemsize*/ diff --git a/source/gameengine/VideoTexture/ImageMix.cpp b/source/gameengine/VideoTexture/ImageMix.cpp index b07b362818c..2418ba254e4 100644 --- a/source/gameengine/VideoTexture/ImageMix.cpp +++ b/source/gameengine/VideoTexture/ImageMix.cpp @@ -162,8 +162,13 @@ static PyGetSetDef imageMixGetSets[] = // define python type PyTypeObject ImageMixType = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.ImageMix", /*tp_name*/ sizeof(PyImage), /*tp_basicsize*/ 0, /*tp_itemsize*/ diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index f1df47af373..1e3a84c1efb 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -379,8 +379,13 @@ static PyGetSetDef imageRenderGetSets[] = // define python type PyTypeObject ImageRenderType = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.ImageRender", /*tp_name*/ sizeof(PyImage), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -713,8 +718,13 @@ ImageRender::ImageRender (KX_Scene * scene, KX_GameObject * observer, KX_GameObj // define python type PyTypeObject ImageMirrorType = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.ImageMirror", /*tp_name*/ sizeof(PyImage), /*tp_basicsize*/ 0, /*tp_itemsize*/ diff --git a/source/gameengine/VideoTexture/ImageViewport.cpp b/source/gameengine/VideoTexture/ImageViewport.cpp index 4c2c81e2208..b808b06eb2b 100644 --- a/source/gameengine/VideoTexture/ImageViewport.cpp +++ b/source/gameengine/VideoTexture/ImageViewport.cpp @@ -289,8 +289,13 @@ static PyGetSetDef imageViewportGetSets[] = // define python type PyTypeObject ImageViewportType = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.ImageViewport", /*tp_name*/ sizeof(PyImage), /*tp_basicsize*/ 0, /*tp_itemsize*/ diff --git a/source/gameengine/VideoTexture/Texture.cpp b/source/gameengine/VideoTexture/Texture.cpp index fa941f9260e..f1fcbee3041 100644 --- a/source/gameengine/VideoTexture/Texture.cpp +++ b/source/gameengine/VideoTexture/Texture.cpp @@ -435,8 +435,13 @@ static PyGetSetDef textureGetSets[] = // class Texture declaration PyTypeObject TextureType = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.Texture", /*tp_name*/ sizeof(Texture), /*tp_basicsize*/ 0, /*tp_itemsize*/ diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp index 5265b0ecb93..08c02628f05 100644 --- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp +++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp @@ -1123,8 +1123,13 @@ static PyGetSetDef videoGetSets[] = // python type declaration PyTypeObject VideoFFmpegType = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.VideoFFmpeg", /*tp_name*/ sizeof(PyImage), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -1241,8 +1246,13 @@ static PyGetSetDef imageGetSets[] = // python type declaration PyTypeObject ImageFFmpegType = { - PyObject_HEAD_INIT(NULL) +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ 0, /*ob_size*/ +#endif "VideoTexture.ImageFFmpeg", /*tp_name*/ sizeof(PyImage), /*tp_basicsize*/ 0, /*tp_itemsize*/ diff --git a/source/gameengine/VideoTexture/blendVideoTex.cpp b/source/gameengine/VideoTexture/blendVideoTex.cpp index c11e7fffecd..8b2a9dc2a5d 100644 --- a/source/gameengine/VideoTexture/blendVideoTex.cpp +++ b/source/gameengine/VideoTexture/blendVideoTex.cpp @@ -159,8 +159,25 @@ static void registerAllTypes(void) pyFilterTypes.add(&FilterBGR24Type, "FilterBGR24"); } + +#if (PY_VERSION_HEX >= 0x03000000) +static struct PyModuleDef VideoTexture_module_def = { + {}, /* m_base */ + "VideoTexture", /* m_name */ + "Module that allows to play video files on textures in GameBlender.", /* m_doc */ + 0, /* m_size */ + moduleMethods, /* m_methods */ + 0, /* m_reload */ + 0, /* m_traverse */ + 0, /* m_clear */ + 0, /* m_free */ +}; +#endif + PyObject* initVideoTexture(void) { + PyObject * m; + // initialize GL extensions //bgl::InitExtensions(0); @@ -175,9 +192,14 @@ PyObject* initVideoTexture(void) if (PyType_Ready(&TextureType) < 0) return NULL; - PyObject * m = Py_InitModule4("VideoTexture", moduleMethods, +#if (PY_VERSION_HEX >= 0x03000000) + m = PyModule_Create(&VideoTexture_module_def); +#else + m = Py_InitModule4("VideoTexture", moduleMethods, "Module that allows to play video files on textures in GameBlender.", (PyObject*)NULL,PYTHON_API_VERSION); +#endif + if (m == NULL) return NULL; -- cgit v1.2.3 From 70bcdb817b288374554543b3d138615bae01c8d9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 29 Apr 2009 17:01:35 +0000 Subject: was testing this, didnt mean to commit. --- source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp index 0239027f2cb..e393b6d9af4 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp @@ -268,7 +268,6 @@ void KX_BlenderRenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmat // 'normal' object glMultMatrixd(oglmatrix); } - glMultMatrixd(oglmatrix); } } -- cgit v1.2.3 From 11dcf7461cff32131efe1f22930b0a10e3562842 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 29 Apr 2009 17:41:41 +0000 Subject: Bugfix #18632 Duplicating an armature, with constraints having a local Ipo, didn't make a copy of this Ipo too, frustrating its drivers too. --- source/blender/blenkernel/intern/object.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 0b153c3c065..bffbcf73672 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1169,6 +1169,9 @@ static void copy_object_pose(Object *obn, Object *ob) * is changed to object->proxy_from when evaluating the driver. */ if(con->ipo && !con->ipo->id.lib) { IpoCurve *icu; + + con->ipo= copy_ipo(con->ipo); + for(icu= con->ipo->curve.first; icu; icu= icu->next) { if(icu->driver && icu->driver->ob==ob) icu->driver->ob= obn; -- cgit v1.2.3 From a9aac77ccf6b915e15915ba1e10daebabd79610a Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Wed, 29 Apr 2009 19:13:32 +0000 Subject: Win64 fixes - I don't think that they introduced any bugs yet, but I want to be sure. Please report problems. --- source/blender/blenkernel/intern/DerivedMesh.c | 2 +- source/blender/blenkernel/intern/bmfont.c | 2 +- source/blender/blenkernel/intern/customdata.c | 4 ++-- source/blender/blenkernel/intern/displist.c | 2 +- source/blender/blenkernel/intern/exotic.c | 18 +++++++++--------- source/blender/blenkernel/intern/font.c | 2 +- source/blender/blenlib/BLI_vfontdata.h | 2 +- source/blender/src/editfont.c | 6 +++--- source/blender/src/imagepaint.c | 6 +++--- source/blender/src/reeb.c | 2 +- 10 files changed, 23 insertions(+), 23 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 6cf934fa165..ddb7d853f2f 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -909,7 +909,7 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm, glShadeModel(GL_SMOOTH); for (i=0,eve=em->verts.first; eve; eve= eve->next) - eve->tmp.l = (long) i++; + eve->tmp.l = (intptr_t) i++; #define PASSATTRIB(efa, eve, vert) { \ if(attribs.totorco) { \ diff --git a/source/blender/blenkernel/intern/bmfont.c b/source/blender/blenkernel/intern/bmfont.c index 0af54b86ed6..09770b2b4ba 100644 --- a/source/blender/blenkernel/intern/bmfont.c +++ b/source/blender/blenkernel/intern/bmfont.c @@ -178,7 +178,7 @@ void detectBitmapFont(ImBuf *ibuf) { unsigned char * rect; unsigned short version; - long i; + int i; if (ibuf != NULL) { // bitmap must have an x size that is a power of two diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 05271aa59a7..6d5b86fa874 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -626,7 +626,7 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest, number++; if(layer->flag & CD_FLAG_NOCOPY) continue; - else if(!(mask & (1 << type))) continue; + else if(!((int)mask & (int)(1 << (int)type))) continue; else if(number < CustomData_number_of_layers(dest, type)) continue; if((alloctype == CD_ASSIGN) && (layer->flag & CD_FLAG_NOFREE)) @@ -1144,7 +1144,7 @@ void CustomData_set_only_copy(const struct CustomData *data, int i; for(i = 0; i < data->totlayer; ++i) - if(!(mask & (1 << data->layers[i].type))) + if(!((int)mask & (int)(1 << (int)data->layers[i].type))) data->layers[i].flag |= CD_FLAG_NOCOPY; } diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 7716d71225e..91eea56c9e7 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -937,7 +937,7 @@ void filldisplist(ListBase *dispbase, ListBase *to) DispList *dlnew=0, *dl; float *f1; int colnr=0, charidx=0, cont=1, tot, a, *index; - long totvert; + intptr_t totvert; if(dispbase==0) return; if(dispbase->first==0) return; diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index ee3fd59fe9f..76ad0cf07c3 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -1131,7 +1131,7 @@ static int iv_finddata(struct IvNode *iv, char *field, int fieldnr) float *fp; int len, stackcount, skipdata=0; char *cpa, terminator, str[64]; - long i; + intptr_t i; len= strlen(field); @@ -2592,7 +2592,7 @@ static void write_videoscape_mesh(Object *ob, char *str) unsigned int kleur[32]; float co[3]; int a; - long tot; + intptr_t tot; char *cp; if(ob && ob->type==OB_MESH); @@ -2642,17 +2642,17 @@ static void write_videoscape_mesh(Object *ob, char *str) if(evl->v4==0) { fprintf(fp, "3 %ld %ld %ld 0x%x\n", - (long int) evl->v1->tmp.l, - (long int) evl->v2->tmp.l, - (long int) evl->v3->tmp.l, + (intptr_t) evl->v1->tmp.l, + (intptr_t) evl->v2->tmp.l, + (intptr_t) evl->v3->tmp.l, kleur[evl->mat_nr]); } else { fprintf(fp, "4 %ld %ld %ld %ld 0x%x\n", - (long int) evl->v1->tmp.l, - (long int) evl->v2->tmp.l, - (long int) evl->v3->tmp.l, - (long int) evl->v4->tmp.l, + (intptr_t) evl->v1->tmp.l, + (intptr_t) evl->v2->tmp.l, + (intptr_t) evl->v3->tmp.l, + (intptr_t) evl->v4->tmp.l, kleur[evl->mat_nr]); } evl= evl->next; diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 52275e507dd..45b52f5af8e 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -1131,7 +1131,7 @@ struct chartrans *text_to_curve(Object *ob, int mode) ct= chartransdata; if (cu->sepchar==0) { for (i= 0; istrinfo[i]); if (info->mat_nr > (ob->totcol)) { /* printf("Error: Illegal material index (%d) in text object, setting to 0\n", info->mat_nr); */ diff --git a/source/blender/blenlib/BLI_vfontdata.h b/source/blender/blenlib/BLI_vfontdata.h index 8838b1992e4..bd89959801a 100644 --- a/source/blender/blenlib/BLI_vfontdata.h +++ b/source/blender/blenlib/BLI_vfontdata.h @@ -54,7 +54,7 @@ typedef struct VFontData { typedef struct VChar { struct VChar *next, *prev; ListBase nurbsbase; - unsigned long index; + intptr_t index; float resol; float width; float *points; diff --git a/source/blender/src/editfont.c b/source/blender/src/editfont.c index a3b05a008c8..682125dabb1 100644 --- a/source/blender/src/editfont.c +++ b/source/blender/src/editfont.c @@ -241,7 +241,7 @@ void update_string(Curve *cu) wcs2utf8s(cu->str, textbuf); } -static int insert_into_textbuf(Curve *cu, unsigned long c) +static int insert_into_textbuf(Curve *cu, uintptr_t c) { if (cu->lendata; diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c index 89dff67585e..b0946e81dce 100644 --- a/source/blender/src/imagepaint.c +++ b/source/blender/src/imagepaint.c @@ -334,7 +334,7 @@ typedef struct UndoTile { typedef struct UndoElem { struct UndoElem *next, *prev; char name[MAXUNDONAME]; - unsigned long undosize; + uintptr_t undosize; ImBuf *ibuf; ListBase tiles; @@ -478,12 +478,12 @@ static void undo_imagepaint_push_begin(char *name) static void undo_imagepaint_push_end() { UndoElem *uel; - unsigned long totmem, maxmem; + uintptr_t totmem, maxmem; if(U.undomemory != 0) { /* limit to maximum memory (afterwards, we can't know in advance) */ totmem= 0; - maxmem= ((unsigned long)U.undomemory)*1024*1024; + maxmem= ((uintptr_t)U.undomemory)*1024*1024; uel= undobase.last; while(uel) { diff --git a/source/blender/src/reeb.c b/source/blender/src/reeb.c index 67cfce55907..f49071be63c 100644 --- a/source/blender/src/reeb.c +++ b/source/blender/src/reeb.c @@ -2695,7 +2695,7 @@ static float cotan_weight(float *v1, float *v2, float *v3) return Inpf(a, b)/clen; } -void addTriangle(EditVert *v1, EditVert *v2, EditVert *v3, long e1, long e2, long e3) +void addTriangle(EditVert *v1, EditVert *v2, EditVert *v3, int e1, int e2, int e3) { /* Angle opposite e1 */ float t1= cotan_weight(v1->co, v2->co, v3->co) / e2; -- cgit v1.2.3 From 604f3e08d35464a86a818b9248085e2dbdb4d561 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 29 Apr 2009 19:33:05 +0000 Subject: Possible fix for bug #18648: one armature disappears when joining armatures. Not sure it actually fixes the problem because I can't test this on Win 64, but this fixes use of unitialized memory at least. Mat4MulMat34 only sets the 3x3 part of the 4x4 matrix, which may lead to a NaN bone roll value. --- source/blender/src/editarmature.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c index ec14e2aabe2..e5be396fa47 100644 --- a/source/blender/src/editarmature.c +++ b/source/blender/src/editarmature.c @@ -715,6 +715,7 @@ int join_armature(void) VecSubf(delta, curbone->tail, curbone->head); vec_roll_to_mat3(delta, curbone->roll, temp); + Mat4One(premat); /* Mat4MulMat34 only sets 3x3 part */ Mat4MulMat34(premat, temp, mat); Mat4MulVecfl(mat, curbone->head); -- cgit v1.2.3 From 39caa9898c84c59aecc7443dce5ac94f1abd3ade Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Wed, 29 Apr 2009 20:09:08 +0000 Subject: * fix linking problem for mingw with setenv/_putenv_s, here we use putenv("key=val"); --- source/creator/creator.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/creator/creator.c b/source/creator/creator.c index a1531fd7180..2b542b13c97 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -538,8 +538,12 @@ int main(int argc, char **argv) BLI_where_is_temp( btempdir, 1 ); /* call after loading the .B.blend so we can read U.tempdir */ #ifndef DISABLE_SDL -#if (defined(WIN32) || defined(WIN64)) && !defined(FREE_WINDOWS) +#if (defined(WIN32) || defined(WIN64)) +#if defined(FREE_WINDOWS) + putenv("SDL_VIDEODRIVER=dummy"); +#else _putenv_s("SDL_VIDEODRIVER", "dummy"); +#endif #else setenv("SDL_VIDEODRIVER", "dummy", 1); /* initializing the video driver can cause crashes on some systems - Campbell */ #endif -- cgit v1.2.3 From 4d7017b42393951052ca8f805dca5fe1e3e75637 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Wed, 29 Apr 2009 20:56:27 +0000 Subject: * make sure header file agrees with editfont.c (unsigned long -> uintptr_t), following commit by Genscher r19983 --- source/blender/include/BIF_editfont.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/include/BIF_editfont.h b/source/blender/include/BIF_editfont.h index d41f52f3c25..c5a8cd1187b 100644 --- a/source/blender/include/BIF_editfont.h +++ b/source/blender/include/BIF_editfont.h @@ -46,7 +46,7 @@ typedef struct unicodect int end; } unicodect; -void do_textedit(unsigned short event, short val, unsigned long _ascii); +void do_textedit(unsigned short event, short val, uintptr_t _ascii); void make_editText(void); void load_editText(void); void remake_editText(void); -- cgit v1.2.3 From ebf631b3fe70b9fe640129adf06bbd0bab27ef22 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Wed, 29 Apr 2009 22:09:28 +0000 Subject: * instead of using okee() (breaking builds) use error() in 250 subversion handling in 2.49 --- source/blender/blenkernel/intern/blender.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 906971f8bae..73c93abdf4b 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -429,7 +429,6 @@ static int handle_subversion_warning(Main *main) (main->minversionfile == BLENDER_VERSION && main->minsubversionfile > BLENDER_SUBVERSION)) { - extern int okee(char *str, ...); // XXX BAD LEVEL, DO NOT PORT TO 2.5! char str[128]; if(main->minversionfile >= 250) { @@ -437,10 +436,9 @@ static int handle_subversion_warning(Main *main) if(G.background) { printf("ERROR: cannot render %d file\n", main->versionfile); - return 0; } - else - return okee(str); + error(str); + return 0; } else { sprintf(str, "File written by newer Blender binary: %d.%d , expect loss of data!", main->minversionfile, main->minsubversionfile); @@ -475,6 +473,7 @@ int BKE_read_file(char *dir, void *type_r) free_main(bfd->main); MEM_freeN(bfd); bfd= NULL; + retval= 0; } else setup_app_data(bfd, dir); // frees BFD -- cgit v1.2.3 From 537b0803798674501634c4dfbaeedb97b2ee889c Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Wed, 29 Apr 2009 23:33:04 +0000 Subject: missing stdint.h include --- source/blender/include/BIF_editfont.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/blender/include/BIF_editfont.h b/source/blender/include/BIF_editfont.h index c5a8cd1187b..e4401eb66a2 100644 --- a/source/blender/include/BIF_editfont.h +++ b/source/blender/include/BIF_editfont.h @@ -28,6 +28,7 @@ */ #include +#include #ifndef BIF_EDITFONT_H #define BIF_EDITFONT_H -- cgit v1.2.3 From 1e7df5851959db6822bdc2a71b83aa533b0ec117 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 29 Apr 2009 23:39:27 +0000 Subject: python modules in the game engine could point to builtin modules like GameLogic that was cleared. I added module clearing before there was checks for invalid python objects, so now its not needed for BGE Builtin types at least. also made the builtin modules get re-used if they already exist and clear all user modules when the game engine finishes so with Module-Py-Controllers the referenced modules are at least up to date when pressing Pkey. --- .../blender/python/api2_2x/bpy_internal_import.c | 11 +++- .../blender/python/api2_2x/bpy_internal_import.h | 2 +- source/gameengine/Expressions/InputParser.cpp | 16 ++++- source/gameengine/Expressions/Value.cpp | 16 ++++- .../gameengine/Ketsji/KX_PyConstraintBinding.cpp | 15 ++++- source/gameengine/Ketsji/KX_PythonInit.cpp | 69 ++++++++++++++++------ source/gameengine/VideoTexture/blendVideoTex.cpp | 22 +++++-- 7 files changed, 119 insertions(+), 32 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/bpy_internal_import.c b/source/blender/python/api2_2x/bpy_internal_import.c index 1e1454dcd5c..125993cc425 100644 --- a/source/blender/python/api2_2x/bpy_internal_import.c +++ b/source/blender/python/api2_2x/bpy_internal_import.c @@ -272,7 +272,12 @@ PyMethodDef bpy_reload_meth[] = { {"bpy_reload_meth", blender_reload, METH_VARAR * Its also needed for the BGE Python api so imported scripts are not used between levels * * This clears every modules that has a __file__ attribute (is not a builtin) - * and is a filename only (no path). since pythons bultins include a full path even for win32. + * + * Note that clearing external python modules is important for the BGE otherwise + * it wont reload scripts between loading different blend files or while making the game. + * - use 'clear_all' arg in this case. + * + * Since pythons bultins include a full path even for win32. * even if we remove a python module a reimport will bring it back again. */ @@ -284,7 +289,7 @@ PyMethodDef bpy_reload_meth[] = { {"bpy_reload_meth", blender_reload, METH_VARAR #endif -void bpy_text_clear_modules(void) +void bpy_text_clear_modules(int clear_all) { PyObject *modules= PySys_GetObject("modules"); @@ -309,7 +314,7 @@ void bpy_text_clear_modules(void) while (PyDict_Next(modules, &pos, &key, &value)) { fname= PyModule_GetFilename(value); if(fname) { - if ((strstr(fname, SEPSTR))==0) { /* no path ? */ + if (clear_all || ((strstr(fname, SEPSTR))==0)) { /* no path ? */ file_extension = strstr(fname, ".py"); if(file_extension && *(file_extension + 3) == '\0') { /* .py extension ? */ /* now we can be fairly sure its a python import from the blendfile */ diff --git a/source/blender/python/api2_2x/bpy_internal_import.h b/source/blender/python/api2_2x/bpy_internal_import.h index 137818bb0db..7220212f13e 100644 --- a/source/blender/python/api2_2x/bpy_internal_import.h +++ b/source/blender/python/api2_2x/bpy_internal_import.h @@ -37,7 +37,7 @@ PyObject* bpy_text_import( char *name, int *found ); PyObject* bpy_text_reimport( PyObject *module, int *found ); -void bpy_text_clear_modules( void ); /* Clear user modules */ +void bpy_text_clear_modules( int clear_all ); /* Clear user modules */ extern PyMethodDef bpy_import_meth[]; extern PyMethodDef bpy_reload_meth[]; diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp index d45a9375dc7..834faf70aae 100644 --- a/source/gameengine/Expressions/InputParser.cpp +++ b/source/gameengine/Expressions/InputParser.cpp @@ -676,11 +676,23 @@ static struct PyModuleDef Expression_module_def = { extern "C" { void initExpressionModule(void) { + PyObject *m; + /* Use existing module where possible + * be careful not to init any runtime vars after this */ + m = PyImport_ImportModule( "Expression" ); + if(m) { + Py_DECREF(m); + return m; + } + else { + PyErr_Clear(); + #if (PY_VERSION_HEX >= 0x03000000) - PyModule_Create(&Expression_module_def); + PyModule_Create(&Expression_module_def); #else - Py_InitModule("Expression",CParserMethods); + Py_InitModule("Expression",CParserMethods); #endif + } } } diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index fbd86cc4022..373924301ae 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -773,11 +773,23 @@ static struct PyModuleDef CValue_module_def = { extern "C" { void initCValue(void) { + PyObject *m; + /* Use existing module where possible + * be careful not to init any runtime vars after this */ + m = PyImport_ImportModule( "CValue" ); + if(m) { + Py_DECREF(m); + return m; + } + else { + PyErr_Clear(); + #if (PY_VERSION_HEX >= 0x03000000) - PyModule_Create(&CValue_module_def); + PyModule_Create(&CValue_module_def); #else - Py_InitModule("CValue",CValueMethods); + Py_InitModule("CValue",CValueMethods); #endif + } } } diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index e801e9c5858..0f21b24489d 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -586,13 +586,24 @@ PyObject* initPythonConstraintBinding() PyObject* m; PyObject* d; + /* Use existing module where possible + * be careful not to init any runtime vars after this */ + m = PyImport_ImportModule( "PhysicsConstraints" ); + if(m) { + Py_DECREF(m); + return m; + } + else { + PyErr_Clear(); + #if (PY_VERSION_HEX >= 0x03000000) - m = PyModule_Create(&PhysicsConstraints_module_def); + m = PyModule_Create(&PhysicsConstraints_module_def); #else - m = Py_InitModule4("PhysicsConstraints", physicsconstraints_methods, + m = Py_InitModule4("PhysicsConstraints", physicsconstraints_methods, PhysicsConstraints_module_documentation, (PyObject*)NULL,PYTHON_API_VERSION); #endif + } // Add some symbolic constants to the module d = PyModule_GetDict(m); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 22e092e8277..22960eaed2c 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1098,16 +1098,28 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack gUseVisibilityTemp=false; - // Create the module and add the functions + + /* Use existing module where possible + * be careful not to init any runtime vars after this */ + m = PyImport_ImportModule( "GameLogic" ); + if(m) { + Py_DECREF(m); + return m; + } + else { + PyErr_Clear(); + + // Create the module and add the functions #if (PY_VERSION_HEX >= 0x03000000) - m = PyModule_Create(&GameLogic_module_def); + m = PyModule_Create(&GameLogic_module_def); #else - m = Py_InitModule4("GameLogic", game_methods, - GameLogic_module_documentation, - (PyObject*)NULL,PYTHON_API_VERSION); + m = Py_InitModule4("GameLogic", game_methods, + GameLogic_module_documentation, + (PyObject*)NULL,PYTHON_API_VERSION); #endif - + } + // Add some symbolic constants to the module d = PyModule_GetDict(m); @@ -1562,8 +1574,7 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev bpy_import_main_set(maggie); - /* run this to clear game modules and user modules which - * may contain references to in game data */ + /* clear user defined modules that may contain data from the last run */ clearGameModules(); PyObject* moduleobj = PyImport_AddModule("__main__"); @@ -1583,6 +1594,8 @@ static void clearModule(PyObject *modules, const char *name) static void clearGameModules() { + /* references to invalid BGE data is better supported in 2.49+ so dont clear dicts */ +#if 0 /* Note, user modules could still reference these modules * but since the dict's are cleared their members wont be accessible */ @@ -1597,9 +1610,10 @@ static void clearGameModules() clearModule(modules, "Mathutils"); clearModule(modules, "BGL"); PyErr_Clear(); // incase some of these were alredy removed. +#endif - /* clear user defined modules */ - bpy_text_clear_modules(); + /* clear user defined modules, arg '1' for clear external py modules too */ + bpy_text_clear_modules(1); } void exitGamePythonScripting() @@ -1633,14 +1647,25 @@ PyObject* initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas) PyObject* d; PyObject* item; - // Create the module and add the functions + /* Use existing module where possible + * be careful not to init any runtime vars after this */ + m = PyImport_ImportModule( "Rasterizer" ); + if(m) { + Py_DECREF(m); + return m; + } + else { + PyErr_Clear(); + + // Create the module and add the functions #if (PY_VERSION_HEX >= 0x03000000) - m = PyModule_Create(&Rasterizer_module_def); + m = PyModule_Create(&Rasterizer_module_def); #else - m = Py_InitModule4("Rasterizer", rasterizer_methods, + m = Py_InitModule4("Rasterizer", rasterizer_methods, Rasterizer_module_documentation, (PyObject*)NULL,PYTHON_API_VERSION); #endif + } // Add some symbolic constants to the module d = PyModule_GetDict(m); @@ -1756,15 +1781,25 @@ PyObject* initGameKeys() PyObject* m; PyObject* d; PyObject* item; - - // Create the module and add the functions + + /* Use existing module where possible */ + m = PyImport_ImportModule( "GameKeys" ); + if(m) { + Py_DECREF(m); + return m; + } + else { + PyErr_Clear(); + + // Create the module and add the functions #if (PY_VERSION_HEX >= 0x03000000) - m = PyModule_Create(&GameKeys_module_def); + m = PyModule_Create(&GameKeys_module_def); #else - m = Py_InitModule4("GameKeys", gamekeys_methods, + m = Py_InitModule4("GameKeys", gamekeys_methods, GameKeys_module_documentation, (PyObject*)NULL,PYTHON_API_VERSION); #endif + } // Add some symbolic constants to the module d = PyModule_GetDict(m); diff --git a/source/gameengine/VideoTexture/blendVideoTex.cpp b/source/gameengine/VideoTexture/blendVideoTex.cpp index 8b2a9dc2a5d..239f43763b8 100644 --- a/source/gameengine/VideoTexture/blendVideoTex.cpp +++ b/source/gameengine/VideoTexture/blendVideoTex.cpp @@ -192,13 +192,24 @@ PyObject* initVideoTexture(void) if (PyType_Ready(&TextureType) < 0) return NULL; + /* Use existing module where possible + * be careful not to init any runtime vars after this */ + m = PyImport_ImportModule( "VideoTexture" ); + if(m) { + Py_DECREF(m); + return m; + } + else { + PyErr_Clear(); + #if (PY_VERSION_HEX >= 0x03000000) - m = PyModule_Create(&VideoTexture_module_def); + m = PyModule_Create(&VideoTexture_module_def); #else - m = Py_InitModule4("VideoTexture", moduleMethods, - "Module that allows to play video files on textures in GameBlender.", - (PyObject*)NULL,PYTHON_API_VERSION); + m = Py_InitModule4("VideoTexture", moduleMethods, + "Module that allows to play video files on textures in GameBlender.", + (PyObject*)NULL,PYTHON_API_VERSION); #endif + } if (m == NULL) return NULL; @@ -209,9 +220,10 @@ PyObject* initVideoTexture(void) Py_INCREF(&TextureType); PyModule_AddObject(m, (char*)"Texture", (PyObject*)&TextureType); - + // init last error description Exception::m_lastError[0] = '\0'; + return m; } -- cgit v1.2.3 From 6a155b5c078a294654b710e23a1ef3904ef9be5e Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Wed, 29 Apr 2009 23:43:12 +0000 Subject: use BLO_sys_types.h instead, it's windows proof --- source/blender/include/BIF_editfont.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/include/BIF_editfont.h b/source/blender/include/BIF_editfont.h index e4401eb66a2..f8bb708bccd 100644 --- a/source/blender/include/BIF_editfont.h +++ b/source/blender/include/BIF_editfont.h @@ -28,11 +28,12 @@ */ #include -#include #ifndef BIF_EDITFONT_H #define BIF_EDITFONT_H +#include "BLO_sys_types.h" + struct Text; extern char *BIF_lorem; -- cgit v1.2.3 From a625f5e476189499c23e911ef44b2c05b4cb6d70 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 29 Apr 2009 23:59:59 +0000 Subject: error in last commit --- source/gameengine/Expressions/InputParser.cpp | 2 +- source/gameengine/Expressions/Value.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp index 834faf70aae..91a14f97851 100644 --- a/source/gameengine/Expressions/InputParser.cpp +++ b/source/gameengine/Expressions/InputParser.cpp @@ -682,7 +682,7 @@ extern "C" { m = PyImport_ImportModule( "Expression" ); if(m) { Py_DECREF(m); - return m; + //return m; } else { PyErr_Clear(); diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 373924301ae..c50a941f3a9 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -779,7 +779,7 @@ extern "C" { m = PyImport_ImportModule( "CValue" ); if(m) { Py_DECREF(m); - return m; + //return m; } else { PyErr_Clear(); -- cgit v1.2.3 From 1782be5c72cc5cd72a710d5d6cbcf52b38b8b2ae Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 30 Apr 2009 00:51:11 +0000 Subject: Not sure why this INCREF is needed since making a replica wont use the m_bytecode so why should it add a user? Removed in 19974 but that crashes YoFrankie so adding back in for now. --- source/gameengine/GameLogic/SCA_PythonController.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 33207950697..d443c1688e4 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -96,7 +96,11 @@ SCA_PythonController::~SCA_PythonController() CValue* SCA_PythonController::GetReplica() { SCA_PythonController* replica = new SCA_PythonController(*this); - // Copy the compiled bytecode if possible. + + /* why is this needed at all??? - m_bytecode is NULL'd below so this doesnt make sense + * but removing it crashes blender (with YoFrankie). so leave in for now - Campbell */ + Py_XINCREF(replica->m_bytecode); + Py_XINCREF(replica->m_function); // this is ok since its not set to NULL replica->m_bModified = replica->m_bytecode == NULL; -- cgit v1.2.3 From 199341ad7be34cc07f784c6be0d9b1e5473c9346 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 30 Apr 2009 02:07:08 +0000 Subject: 2 BGE bugs from 2.48 fixed - the gp_GamePythonPath relative path variable wasnt updated when loading new files. - missing NULL check for scene crashed blender when it failed to load a file. Both problems dont affect blenderplayer --- source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index fee5a4ad899..2337ab49ee9 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -280,6 +280,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, if(blenderdata) { BLI_strncpy(G.sce, blenderdata->name, sizeof(G.sce)); BLI_strncpy(pathname, blenderdata->name, sizeof(pathname)); + setGamePythonPath(G.sce); } } // else forget it, we can't find it @@ -309,12 +310,11 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, { int startFrame = blscene->r.cfra; ketsjiengine->SetGame2IpoMode(game2ipo,startFrame); + + // Quad buffered needs a special window. + if (blscene->r.stereomode != RAS_IRasterizer::RAS_STEREO_QUADBUFFERED) + rasterizer->SetStereoMode((RAS_IRasterizer::StereoMode) blscene->r.stereomode); } - - - // Quad buffered needs a special window. - if (blscene->r.stereomode != RAS_IRasterizer::RAS_STEREO_QUADBUFFERED) - rasterizer->SetStereoMode((RAS_IRasterizer::StereoMode) blscene->r.stereomode); if (exitrequested != KX_EXIT_REQUEST_QUIT_GAME) { -- cgit v1.2.3 From 5908e2aa779b0b95a27dad96e2bb8d3be926956a Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 30 Apr 2009 02:41:07 +0000 Subject: BGE Dome update. Spurious black seams (finally) fixed. The solution is a hack. It's a workaround for another bug (#18655). Now it's working in all modes: fullscreen, maximized screen and gameplayer. * small change to always set the perspective mode as true during dome mode. --- source/gameengine/Ketsji/KX_Dome.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index 9565c53e0bf..e4c3d92fbf2 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -147,7 +147,7 @@ KX_Dome::~KX_Dome (void) void KX_Dome::SetViewPort(GLuint viewport[4]) { - if(canvaswidth != m_canvas->GetWidth() || canvasheight != m_canvas->GetHeight()) + if(canvaswidth != m_viewport.GetWidth() || canvasheight != m_viewport.GetHeight()) { m_viewport.SetLeft(viewport[0]); m_viewport.SetBottom(viewport[1]); @@ -200,13 +200,26 @@ void KX_Dome::CalculateImageSize(void) - determine the minimum buffer size - reduce the buffer for better performace - create a power of 2 texture bigger than the buffer +*/ +/* +Blender handles Canvas size differently when in fullscreen mode. +We are manually checking for that. Although it's a hack, it works. + +Bug reported here: #18655 - Inconsistency of pixels in canvas dimensions when in maximized mode (affecting BGE Dome) +http://projects.blender.org/tracker/?func=detail&aid=18655&group_id=9&atid=125 */ canvaswidth = m_canvas->GetWidth(); canvasheight = m_canvas->GetHeight(); + bool fullscreen(false); //XXX HACK + fullscreen = (canvaswidth != m_viewport.GetWidth()); + m_buffersize = (canvaswidth > canvasheight?canvasheight:canvaswidth); m_buffersize = (int)(m_buffersize*m_resbuffer); //reduce buffer size for better performance + + if (fullscreen) //XXX HACK + m_buffersize --; int i = 0; while ((1 << i) <= m_buffersize) @@ -227,6 +240,9 @@ void KX_Dome::CalculateImageSize(void) i++; warp.imageheight = (1 << i); } + //XXX HACK + canvaswidth = m_viewport.GetWidth(); + canvasheight = m_viewport.GetHeight(); } bool KX_Dome::CreateDL(){ @@ -1365,7 +1381,7 @@ void KX_Dome::CalculateFrustum(KX_Camera * cam) /* // manually creating a 90º Field of View Frustum - the original formula: + the original formula: top = tan(fov*3.14159/360.0) * near [for fov in degrees] fov*0.5 = arctan ((top-bottom)*0.5 / near) [for fov in radians] bottom = -top @@ -1913,7 +1929,7 @@ void KX_Dome::RenderDomeFrame(KX_Scene* scene, KX_Camera* cam, int i) MT_Transform camtrans(cam->GetWorldToCamera()); MT_Matrix4x4 viewmat(camtrans); - m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldOrientation(), cam->NodeGetWorldPosition(), cam->GetCameraData()->m_perspective); + m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldOrientation(), cam->NodeGetWorldPosition(), 1.0); cam->SetModelviewMatrix(viewmat); scene->CalculateVisibleMeshes(m_rasterizer,cam); -- cgit v1.2.3 From 939290b59c52bdd84b9f20083d4dd76ada293ee8 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 30 Apr 2009 03:46:31 +0000 Subject: BGE 2dFilters: Revert of part of own commit [rev. 19687] Therefore we still need to find a better way to solve this problem: [#18154] 2dFilter and motion blur should run only once to all the scenes: http://projects.blender.org/tracker/?func=detail&aid=18154&group_id=9&atid=127 --- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 9bac0f7d758..764c3c2dfec 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -906,9 +906,6 @@ void KX_KetsjiEngine::Render() } } // if(m_rasterizer->Stereo()) - // run the 2dfilters and motion blur once for all the scenes - PostRenderFrame(); - EndFrame(); } @@ -1284,6 +1281,9 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam) scene->GetPhysicsEnvironment()->debugDrawWorld(); m_rasterizer->FlushDebugLines(); + + //it's running once for every scene (i.e. overlay scenes have it running twice). That's not the ideal. + PostRenderFrame(); } void KX_KetsjiEngine::PostRenderFrame() -- cgit v1.2.3 From b5b24ee521866637871e7555d4294c0936a0664d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 30 Apr 2009 08:01:31 +0000 Subject: BGE Python sys.path for the blenderplayer and blender sys.path is the search path for python modules. This is useful so people making games can put all their scripts in a folder and be sure they will always load into the BGE. for each blend file a scripts directory is added to the path /home/me/foo.blend will look for modules in... /home/me/scripts/*.py It could also default to look for modules in the same directory as the blend file but I think this is messy. Added a note in the tooltip about //scripts so its not such a hidden feature. This works by storing the original sys.path, then adding the paths for the blendfile and all its libs, when a new blendfile is loaded, the original sys.path is restored before adding the blendfiles paths again so the sys.path wont get junk in it. One problem with this - when using linked libs the module names must be unique else it will load the wrong module for one of the controllers. also fixed 2 bugs - sys.path in the blenderplayer was growing by 1 for every file load in blenderplayer - the relative path (gp_GamePythonPath), wasnt being set when loading files in the blenderlayer (as I wrongly said in the last commit). --- source/blender/src/buttons_logic.c | 6 +- source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 2 +- source/gameengine/Ketsji/KX_PythonInit.cpp | 120 ++++++++++++++++++++++- 3 files changed, 123 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 168726c9dab..54b48de716f 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -1580,12 +1580,12 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco uiBlockBeginAlign(block); - uiDefButI(block, MENU, B_REDR, "Execution Method%t|Script%x0|Module%x1", xco+24,yco-24, 66, 19, &pc->mode, 0, 0, 0, 0, "Python script type (textblock or module)"); + uiDefButI(block, MENU, B_REDR, "Execution Method%t|Script%x0|Module%x1", xco+24,yco-24, 66, 19, &pc->mode, 0, 0, 0, 0, "Python script type (textblock or module - faster)"); if(pc->mode==0) uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "", xco+90,yco-24,width-90, 19, &pc->text, "Blender textblock to run as a script"); else { - uiDefBut(block, TEX, 1, "", xco+90,yco-24,(width-90)-25, 19, pc->module, 0, 63, 0, 0, "Module name and function to run eg \"someModule.main\""); - uiDefButBitI(block, TOG, CONT_PY_DEBUG, B_REDR, "D", (xco+width)-25, yco-24, 19, 19, &pc->flag, 0, 0, 0, 0, "Continuously reload the module from disk for editing external modules without restrting, (slow)"); + uiDefBut(block, TEX, 1, "", xco+90,yco-24,(width-90)-25, 19, pc->module, 0, 63, 0, 0, "Module name and function to run eg \"someModule.main\", internal texts and //scripts/*.py on the filesystem can be used"); + uiDefButBitI(block, TOG, CONT_PY_DEBUG, B_REDR, "D", (xco+width)-25, yco-24, 19, 19, &pc->flag, 0, 0, 0, 0, "Continuously reload the module from disk for editing external modules without restrting"); } uiBlockEndAlign(block); diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 64e70ce37c3..7c47d2353a6 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -704,10 +704,10 @@ int main(int argc, char** argv) BLI_strncpy(pathname, maggie->name, sizeof(pathname)); BLI_strncpy(G.sce, maggie->name, sizeof(G.sce)); + setGamePythonPath(G.sce); if (firstTimeRunning) { - setGamePythonPath(G.sce); firstTimeRunning = false; if (fullScreen) diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 22960eaed2c..b17d4042bb6 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -80,6 +80,10 @@ #include "KX_PythonInitTypes.h" +/* we only need this to get a list of libraries from the main struct */ +#include "DNA_ID.h" +#include "BKE_main.h" + extern "C" { #include "Mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use. #include "bpy_internal_import.h" /* from the blender python api, but we want to import text too! */ @@ -110,6 +114,7 @@ static KX_Scene* gp_KetsjiScene = NULL; static KX_KetsjiEngine* gp_KetsjiEngine = NULL; static RAS_IRasterizer* gp_Rasterizer = NULL; static char gp_GamePythonPath[FILE_MAXDIR + FILE_MAXFILE] = ""; +static PyObject *gp_OrigPythonSysPath= NULL; void KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,const MT_Vector3& color) { @@ -1522,11 +1527,111 @@ void setSandbox(TPythonSecurityLevel level) } } +/* Explanation of + * + * - backupPySysPath() : stores sys.path in gp_OrigPythonSysPath + * - initPySysPath(main) : initializes the blendfile and library paths + * - restorePySysPath() : restores sys.path from gp_OrigPythonSysPath + * + * These exist so the //scripts folder can always be used to import modules from. + * the reason we need a few functions for this is that python is not only used by the game engine + * so we cant just add to sys.path all the time, it would leave pythons state in a mess. + * It would also be incorrect since loading blend files for new levels etc would alwasy add to sys.path + * + * To play nice with blenders python, the sys.path is backed up and the current blendfile along + * with all its lib paths are added to the sys path. + * When loading a new blendfile, the original sys.path is restored and the new paths are added over the top. + */ + +/** + * So we can have external modules mixed with our blend files. + */ +static void backupPySysPath(void) +{ + PyObject *sys_path= PySys_GetObject("path"); /* should never fail */ + + /* just incase its set */ + Py_XDECREF(gp_OrigPythonSysPath); + gp_OrigPythonSysPath= NULL; + + gp_OrigPythonSysPath = PyList_GetSlice(sys_path, 0, INT_MAX); /* copy the list */ +} + +/* for initPySysPath only, + * takes a blend path and adds a scripts dir from it + * + * "/home/me/foo.blend" -> "/home/me/scripts" + */ +static void initPySysPath__append(PyObject *sys_path, char *filename) +{ + PyObject *item; + char expanded[FILE_MAXDIR + FILE_MAXFILE] = "//"; + + BLI_convertstringcode(expanded, filename); + BLI_join_dirfile(expanded, expanded, "scripts"); /* double checked and using the dir twice is safe */ + + item= PyString_FromString(expanded); + + if(PySequence_Index(sys_path, item) == -1) { + PyList_Insert(sys_path, 0, item); + } + + Py_DECREF(item); +} +static void initPySysPath(Main *maggie) +{ + PyObject *sys_path= PySys_GetObject("path"); /* should never fail */ + + if (gp_OrigPythonSysPath==NULL) { + /* backup */ + backupPySysPath(); + } + else { + /* get the original sys path when the BGE started */ + PyList_SetSlice(sys_path, 0, INT_MAX, gp_OrigPythonSysPath); + } + + Library *lib= (Library *)maggie->library.first; + + while(lib) { + initPySysPath__append(sys_path, lib->name); + lib= (Library *)lib->id.next; + } + + initPySysPath__append(sys_path, gp_GamePythonPath); + +// fprintf(stderr, "\nNew Path: %d ", PyList_Size(sys_path)); +// PyObject_Print(sys_path, stderr, 0); +} + +static void restorePySysPath(void) +{ + if (gp_OrigPythonSysPath==NULL) + return; + + PyObject *sys_path= PySys_GetObject("path"); /* should never fail */ + + PyList_SetSlice(sys_path, 0, INT_MAX, gp_OrigPythonSysPath); + Py_DECREF(gp_OrigPythonSysPath); + gp_OrigPythonSysPath= NULL; + +// fprintf(stderr, "\nRestore Path: %d ", PyList_Size(sys_path)); +// PyObject_Print(sys_path, stderr, 0); +} + /** * Python is not initialised. */ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level, Main *maggie, int argc, char** argv) { + /* Yet another gotcha in the py api + * Cant run PySys_SetArgv more then once because this adds the + * binary dir to the sys.path each time. + * Id have thaught python being totally restarted would make this ok but + * somehow it remembers the sys.path - Campbell + */ + static bool first_time = true; + #if (PY_VERSION_HEX < 0x03000000) STR_String pname = progname; Py_SetProgramName(pname.Ptr()); @@ -1536,7 +1641,7 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur Py_Initialize(); #if (PY_VERSION_HEX < 0x03000000) - if(argv) /* browser plugins dont currently set this */ + if(argv && first_time) /* browser plugins dont currently set this */ PySys_SetArgv(argc, argv); #endif //importBlenderModules() @@ -1546,6 +1651,10 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur bpy_import_main_set(maggie); + initPySysPath(maggie); + + first_time = false; + PyObject* moduleobj = PyImport_AddModule("__main__"); return PyModule_GetDict(moduleobj); } @@ -1553,10 +1662,16 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur void exitGamePlayerPythonScripting() { //clearGameModules(); // were closing python anyway + + /* since python restarts we cant let the python backup of the sys.path hang around in a global pointer */ + restorePySysPath(); /* get back the original sys.path and clear the backup */ + Py_Finalize(); bpy_import_main_set(NULL); } + + /** * Python is already initialized. */ @@ -1574,6 +1689,8 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev bpy_import_main_set(maggie); + initPySysPath(maggie); + /* clear user defined modules that may contain data from the last run */ clearGameModules(); @@ -1619,6 +1736,7 @@ static void clearGameModules() void exitGamePythonScripting() { clearGameModules(); + restorePySysPath(); /* get back the original sys.path and clear the backup */ bpy_import_main_set(NULL); } -- cgit v1.2.3 From 81ea467091996dab41a10af1111cd85fd34d1d69 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 30 Apr 2009 08:02:26 +0000 Subject: BGE fux #17796: Glsl + bones + set smooth = bug on vertext groups. --- source/gameengine/Converter/BL_MeshDeformer.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source') diff --git a/source/gameengine/Converter/BL_MeshDeformer.cpp b/source/gameengine/Converter/BL_MeshDeformer.cpp index 80112346c72..b6a59774636 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.cpp +++ b/source/gameengine/Converter/BL_MeshDeformer.cpp @@ -47,6 +47,7 @@ #include "GEN_Map.h" #include "STR_HashedString.h" +#include "BLI_arithb.h" bool BL_MeshDeformer::Apply(RAS_IPolyMaterial*) { @@ -166,6 +167,7 @@ void BL_MeshDeformer::RecalcNormals() fnor[0]= n1[1]*n2[2] - n1[2]*n2[1]; fnor[1]= n1[2]*n2[0] - n1[0]*n2[2]; fnor[2]= n1[0]*n2[1] - n1[1]*n2[0]; + Normalize(fnor); /* add to vertices for smooth normals */ float *vn1 = m_transnors[v1.getOrigIndex()]; -- cgit v1.2.3 From de2cc4d14d1b7a7b47cbbf01db7c980d929a7846 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 30 Apr 2009 10:11:37 +0000 Subject: Second trial to get an OK menu work to allow people to decide whether or not to use a 2.5+ saved file in 2.49. Apparently the msvc linker was choking on it? --- source/blender/blenkernel/BKE_bad_level_calls.h | 1 + source/blender/blenkernel/bad_level_call_stubs/stubs.c | 1 + source/blender/blenkernel/intern/blender.c | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_bad_level_calls.h b/source/blender/blenkernel/BKE_bad_level_calls.h index 0962a174a8e..71f8aee8e99 100644 --- a/source/blender/blenkernel/BKE_bad_level_calls.h +++ b/source/blender/blenkernel/BKE_bad_level_calls.h @@ -92,6 +92,7 @@ int pytype_is_pynode(struct PyObject *pyob); struct Oops; void free_oops(struct Oops *oops); void error(char *str, ...); +int okee(char *str, ...); /* anim.c */ extern struct ListBase editNurb; diff --git a/source/blender/blenkernel/bad_level_call_stubs/stubs.c b/source/blender/blenkernel/bad_level_call_stubs/stubs.c index 341379de1d9..3012c19ff02 100644 --- a/source/blender/blenkernel/bad_level_call_stubs/stubs.c +++ b/source/blender/blenkernel/bad_level_call_stubs/stubs.c @@ -160,6 +160,7 @@ void BPY_pyconstraint_target(struct bPythonConstraint *con, struct bConstraintTa void free_oops(struct Oops *oops){} void exit_posemode(int freedata){} void error(char *str, ...){} +int okee(char *str, ...){} /* anim.c */ ListBase editNurb; diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 73c93abdf4b..107953138c6 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -431,14 +431,14 @@ static int handle_subversion_warning(Main *main) char str[128]; + /* XXX DO NOT PORT OVER TO 2.5 BRANCH! */ if(main->minversionfile >= 250) { sprintf(str, "You have opened a %d file, key information will get lost, like animation data. Continue?", main->minversionfile); if(G.background) { printf("ERROR: cannot render %d file\n", main->versionfile); } - error(str); - return 0; + return okee(str); } else { sprintf(str, "File written by newer Blender binary: %d.%d , expect loss of data!", main->minversionfile, main->minsubversionfile); -- cgit v1.2.3 From fdf6ea916db3225e2cee437cdb19b3fbee84db41 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 30 Apr 2009 12:45:13 +0000 Subject: added Geometry as a BGE module, removed its dependency on gen_utils.c --- source/blender/python/api2_2x/Blender.c | 2 +- source/blender/python/api2_2x/Geometry.c | 128 +++++++++++++-------- source/blender/python/api2_2x/Geometry.h | 2 +- .../BlenderRoutines/BL_KetsjiEmbedStart.cpp | 2 + .../GamePlayer/ghost/GPG_Application.cpp | 1 + source/gameengine/Ketsji/CMakeLists.txt | 1 + source/gameengine/Ketsji/KX_PythonInit.cpp | 9 +- source/gameengine/Ketsji/KX_PythonInit.h | 1 + source/gameengine/Ketsji/SConscript | 1 + 9 files changed, 96 insertions(+), 51 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Blender.c b/source/blender/python/api2_2x/Blender.c index 2e44f0635e5..fd316eb484f 100644 --- a/source/blender/python/api2_2x/Blender.c +++ b/source/blender/python/api2_2x/Blender.c @@ -1092,7 +1092,7 @@ void M_Blender_Init(void) PyDict_SetItemString(dict, "Mesh", Mesh_Init()); PyDict_SetItemString(dict, "Metaball", Metaball_Init()); PyDict_SetItemString(dict, "Mathutils", Mathutils_Init("Blender.Mathutils")); - PyDict_SetItemString(dict, "Geometry", Geometry_Init()); + PyDict_SetItemString(dict, "Geometry", Geometry_Init("Blender.Geometry")); PyDict_SetItemString(dict, "Modifier", Modifier_Init()); PyDict_SetItemString(dict, "NMesh", NMesh_Init()); PyDict_SetItemString(dict, "Node", Node_Init()); diff --git a/source/blender/python/api2_2x/Geometry.c b/source/blender/python/api2_2x/Geometry.c index 89c63870d59..d568472c838 100644 --- a/source/blender/python/api2_2x/Geometry.c +++ b/source/blender/python/api2_2x/Geometry.c @@ -38,9 +38,6 @@ #include "BKE_displist.h" #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" - -/* needed for EXPP_ReturnPyObjError and EXPP_check_sequence_consistency */ -#include "gen_utils.h" #include "BKE_utildefines.h" #include "BLI_boxpack2d.h" @@ -76,13 +73,32 @@ struct PyMethodDef M_Geometry_methods[] = { {"BoxPack2D", ( PyCFunction ) M_Geometry_BoxPack2D, METH_O, M_Geometry_BoxPack2D_doc}, {NULL, NULL, 0, NULL} }; + +#if (PY_VERSION_HEX >= 0x03000000) +static struct PyModuleDef M_Geometry_module_def = { + {}, /* m_base */ + "Geometry", /* m_name */ + M_Geometry_doc, /* m_doc */ + 0, /* m_size */ + M_Geometry_methods, /* m_methods */ + 0, /* m_reload */ + 0, /* m_traverse */ + 0, /* m_clear */ + 0, /* m_free */ +}; +#endif + /*----------------------------MODULE INIT-------------------------*/ -PyObject *Geometry_Init(void) +PyObject *Geometry_Init(const char *from) { PyObject *submodule; - - submodule = Py_InitModule3("Blender.Geometry", - M_Geometry_methods, M_Geometry_doc); + +#if (PY_VERSION_HEX >= 0x03000000) + submodule = PyModule_Create(&M_Geometry_module_def); +#else + submodule = Py_InitModule3(from, M_Geometry_methods, M_Geometry_doc); +#endif + return (submodule); } @@ -92,7 +108,7 @@ static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq ) { PyObject *tri_list; /*return this list of tri's */ PyObject *polyLine, *polyVec; - int i, len_polylines, len_polypoints; + int i, len_polylines, len_polypoints, ls_error = 0; /* display listbase */ ListBase dispbase={NULL, NULL}; @@ -105,8 +121,8 @@ static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq ) if(!PySequence_Check(polyLineSeq)) { - return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected a sequence of poly lines" ); + PyErr_SetString( PyExc_TypeError, "expected a sequence of poly lines" ); + return NULL; } len_polylines = PySequence_Size( polyLineSeq ); @@ -116,19 +132,20 @@ static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq ) if (!PySequence_Check(polyLine)) { freedisplist(&dispbase); Py_XDECREF(polyLine); /* may be null so use Py_XDECREF*/ - return EXPP_ReturnPyObjError( PyExc_TypeError, - "One or more of the polylines is not a sequence of Mathutils.Vector's" ); + PyErr_SetString( PyExc_TypeError, "One or more of the polylines is not a sequence of Mathutils.Vector's" ); + return NULL; } len_polypoints= PySequence_Size( polyLine ); if (len_polypoints>0) { /* dont bother adding edges as polylines */ +#if 0 if (EXPP_check_sequence_consistency( polyLine, &vector_Type ) != 1) { freedisplist(&dispbase); Py_DECREF(polyLine); - return EXPP_ReturnPyObjError( PyExc_TypeError, - "A point in one of the polylines is not a Mathutils.Vector type" ); + PyErr_SetString( PyExc_TypeError, "A point in one of the polylines is not a Mathutils.Vector type" ); + return NULL; } - +#endif dl= MEM_callocN(sizeof(DispList), "poly disp"); BLI_addtail(&dispbase, dl); dl->type= DL_INDEX3; @@ -141,13 +158,17 @@ static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq ) for( index = 0; indexvec[0]; - fp[1] = ((VectorObject *)polyVec)->vec[1]; - if( ((VectorObject *)polyVec)->size > 2 ) - fp[2] = ((VectorObject *)polyVec)->vec[2]; - else - fp[2]= 0.0f; /* if its a 2d vector then set the z to be zero */ + if(VectorObject_Check(polyVec)) { + fp[0] = ((VectorObject *)polyVec)->vec[0]; + fp[1] = ((VectorObject *)polyVec)->vec[1]; + if( ((VectorObject *)polyVec)->size > 2 ) + fp[2] = ((VectorObject *)polyVec)->vec[2]; + else + fp[2]= 0.0f; /* if its a 2d vector then set the z to be zero */ + } + else { + ls_error= 1; + } totpoints++; Py_DECREF(polyVec); @@ -156,7 +177,12 @@ static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq ) Py_DECREF(polyLine); } - if (totpoints) { + if(ls_error) { + freedisplist(&dispbase); /* possible some dl was allocated */ + PyErr_SetString( PyExc_TypeError, "A point in one of the polylines is not a Mathutils.Vector type" ); + return NULL; + } + else if (totpoints) { /* now make the list to return */ filldisplist(&dispbase, &dispbase); @@ -167,8 +193,8 @@ static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq ) tri_list= PyList_New(dl->parts); if( !tri_list ) { freedisplist(&dispbase); - return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "Geometry.PolyFill failed to make a new list" ); + PyErr_SetString( PyExc_RuntimeError, "Geometry.PolyFill failed to make a new list" ); + return NULL; } index= 0; @@ -181,6 +207,7 @@ static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq ) freedisplist(&dispbase); } else { /* no points, do this so scripts dont barf */ + freedisplist(&dispbase); /* possible some dl was allocated */ tri_list= PyList_New(0); } @@ -197,9 +224,10 @@ static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args ) &vector_Type, &line_a2, &vector_Type, &line_b1, &vector_Type, &line_b2) - ) - return ( EXPP_ReturnPyObjError - ( PyExc_TypeError, "expected 4 vector types\n" ) ); + ) { + PyErr_SetString( PyExc_TypeError, "expected 4 vector types\n" ); + return NULL; + } a1x= line_a1->vec[0]; a1y= line_a1->vec[1]; @@ -293,10 +321,10 @@ static PyObject *M_Geometry_ClosestPointOnLine( PyObject * self, PyObject * args &vector_Type, &pt, &vector_Type, &line_1, &vector_Type, &line_2) - ) - return ( EXPP_ReturnPyObjError - ( PyExc_TypeError, "expected 3 vector types\n" ) ); - + ) { + PyErr_SetString( PyExc_TypeError, "expected 3 vector types\n" ); + return NULL; + } /* accept 2d verts */ if (pt->size==3) { VECCOPY(pt_in, pt->vec);} else { pt_in[2]=0.0; VECCOPY2D(pt_in, pt->vec) } @@ -325,9 +353,10 @@ static PyObject *M_Geometry_PointInTriangle2D( PyObject * self, PyObject * args &vector_Type, &tri_p1, &vector_Type, &tri_p2, &vector_Type, &tri_p3) - ) - return ( EXPP_ReturnPyObjError - ( PyExc_TypeError, "expected 4 vector types\n" ) ); + ) { + PyErr_SetString( PyExc_TypeError, "expected 4 vector types\n" ); + return NULL; + } return PyInt_FromLong(IsectPT2Df(pt_vec->vec, tri_p1->vec, tri_p2->vec, tri_p3->vec)); } @@ -342,9 +371,10 @@ static PyObject *M_Geometry_PointInQuad2D( PyObject * self, PyObject * args ) &vector_Type, &quad_p2, &vector_Type, &quad_p3, &vector_Type, &quad_p4) - ) - return ( EXPP_ReturnPyObjError - ( PyExc_TypeError, "expected 5 vector types\n" ) ); + ) { + PyErr_SetString( PyExc_TypeError, "expected 5 vector types\n" ); + return NULL; + } return PyInt_FromLong(IsectPQ2Df(pt_vec->vec, quad_p1->vec, quad_p2->vec, quad_p3->vec, quad_p4->vec)); } @@ -357,9 +387,10 @@ static int boxPack_FromPyObject(PyObject * value, boxPack **boxarray ) /* Error checking must alredy be done */ - if( !PyList_Check( value ) ) - return EXPP_ReturnIntError( PyExc_TypeError, - "can only back a list of [x,y,x,w]" ); + if( !PyList_Check( value ) ) { + PyErr_SetString( PyExc_TypeError, "can only back a list of [x,y,x,w]" ); + return -1; + } len = PyList_Size( value ); @@ -370,8 +401,8 @@ static int boxPack_FromPyObject(PyObject * value, boxPack **boxarray ) list_item = PyList_GET_ITEM( value, i ); if( !PyList_Check( list_item ) || PyList_Size( list_item ) < 4 ) { MEM_freeN(*boxarray); - return EXPP_ReturnIntError( PyExc_TypeError, - "can only back a list of [x,y,x,w]" ); + PyErr_SetString( PyExc_TypeError, "can only back a list of [x,y,x,w]" ); + return -1; } box = (*boxarray)+i; @@ -381,8 +412,8 @@ static int boxPack_FromPyObject(PyObject * value, boxPack **boxarray ) if (!PyNumber_Check(item_1) || !PyNumber_Check(item_2)) { MEM_freeN(*boxarray); - return EXPP_ReturnIntError( PyExc_TypeError, - "can only back a list of 2d boxes [x,y,x,w]" ); + PyErr_SetString( PyExc_TypeError, "can only back a list of 2d boxes [x,y,x,w]" ); + return -1; } box->w = (float)PyFloat_AsDouble( item_1 ); @@ -418,9 +449,10 @@ static PyObject *M_Geometry_BoxPack2D( PyObject * self, PyObject * boxlist ) int len; int error; - if(!PyList_Check(boxlist)) - return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected a sequence of boxes [[x,y,w,h], ... ]" ); + if(!PyList_Check(boxlist)) { + PyErr_SetString( PyExc_TypeError, "expected a sequence of boxes [[x,y,w,h], ... ]" ); + return NULL; + } len = PyList_Size( boxlist ); diff --git a/source/blender/python/api2_2x/Geometry.h b/source/blender/python/api2_2x/Geometry.h index e9e365cc9ae..ebfb054c54a 100644 --- a/source/blender/python/api2_2x/Geometry.h +++ b/source/blender/python/api2_2x/Geometry.h @@ -34,6 +34,6 @@ #include #include "Mathutils.h" -PyObject *Geometry_Init( void ); +PyObject *Geometry_Init( const char *from ); #endif /* EXPP_Geometry_H */ diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 2337ab49ee9..641938253b7 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -368,6 +368,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, initGameKeys(); initPythonConstraintBinding(); initMathutils(); + initGeometry(); initBGL(); #ifdef WITH_FFMPEG initVideoTexture(); @@ -671,6 +672,7 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area, initGameKeys(); initPythonConstraintBinding(); initMathutils(); + initGeometry(); initBGL(); #ifdef WITH_FFMPEG initVideoTexture(); diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index 907ba99e63b..af8b94857b9 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -693,6 +693,7 @@ bool GPG_Application::startEngine(void) initGameKeys(); initPythonConstraintBinding(); initMathutils(); + initGeometry(); initBGL(); #ifdef WITH_FFMPEG initVideoTexture(); diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt index c4623b5b6fe..abc2b44825e 100644 --- a/source/gameengine/Ketsji/CMakeLists.txt +++ b/source/gameengine/Ketsji/CMakeLists.txt @@ -28,6 +28,7 @@ FILE(GLOB SRC *.cpp) SET(SRC ${SRC} ../../../source/blender/python/api2_2x/Mathutils.c + ../../../source/blender/python/api2_2x/Geometry.c ../../../source/blender/python/api2_2x/constant.c ../../../source/blender/python/api2_2x/euler.c ../../../source/blender/python/api2_2x/matrix.c diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index b17d4042bb6..f5d32e36fc5 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -86,6 +86,7 @@ extern "C" { #include "Mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use. + #include "Geometry.h" // Blender.Geometry module copied here so the blenderlayer can use. #include "bpy_internal_import.h" /* from the blender python api, but we want to import text too! */ #include "BGL.h" } @@ -1407,7 +1408,7 @@ PyObject *KXpy_import(PyObject *self, PyObject *args) /* quick hack for GamePython modules TODO: register builtin modules properly by ExtendInittab */ if (!strcmp(name, "GameLogic") || !strcmp(name, "GameKeys") || !strcmp(name, "PhysicsConstraints") || - !strcmp(name, "Rasterizer") || !strcmp(name, "Mathutils") || !strcmp(name, "BGL")) { + !strcmp(name, "Rasterizer") || !strcmp(name, "Mathutils") || !strcmp(name, "BGL") || !strcmp(name, "Geometry")) { return PyImport_ImportModuleEx(name, globals, locals, fromlist); } @@ -1725,6 +1726,7 @@ static void clearGameModules() clearModule(modules, "GameKeys"); clearModule(modules, "VideoTexture"); clearModule(modules, "Mathutils"); + clearModule(modules, "Geometry"); clearModule(modules, "BGL"); PyErr_Clear(); // incase some of these were alredy removed. #endif @@ -2051,6 +2053,11 @@ PyObject* initMathutils() return Mathutils_Init("Mathutils"); // Use as a top level module in BGE } +PyObject* initGeometry() +{ + return Geometry_Init("Geometry"); // Use as a top level module in BGE +} + PyObject* initBGL() { return BGL_Init("BGL"); // Use as a top level module in BGE diff --git a/source/gameengine/Ketsji/KX_PythonInit.h b/source/gameengine/Ketsji/KX_PythonInit.h index 11360197b95..3253ac8f711 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.h +++ b/source/gameengine/Ketsji/KX_PythonInit.h @@ -45,6 +45,7 @@ PyObject* initGameKeys(); PyObject* initRasterizer(class RAS_IRasterizer* rasty,class RAS_ICanvas* canvas); PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level, struct Main *maggie, int argc, char** argv); PyObject* initMathutils(); +PyObject* initGeometry(); PyObject* initBGL(); PyObject* initVideoTexture(void); void exitGamePlayerPythonScripting(); diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index d97f13b0758..dd7297080e5 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -9,6 +9,7 @@ defs = '' # Mathutils C files. sources.extend([\ '#source/blender/python/api2_2x/Mathutils.c',\ + '#source/blender/python/api2_2x/Geometry.c',\ '#source/blender/python/api2_2x/constant.c',\ '#source/blender/python/api2_2x/euler.c',\ '#source/blender/python/api2_2x/matrix.c',\ -- cgit v1.2.3 From 8570071e4075b51262ad2adae4881ca3077916bb Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 30 Apr 2009 15:27:38 +0000 Subject: supporting warp data files with tabs instead of spaces. --- source/gameengine/Ketsji/KX_Dome.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index e4c3d92fbf2..3802f260391 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -434,6 +434,8 @@ i ranges from 0 to 1, if negative don't draw that mesh node return false; } columns = lines[1].Explode(' '); + if(columns.size() == 1) + columns = lines[1].Explode('\t'); if(columns.size() !=2){ printf("Error: Warp Mesh File incorrect. The second line should contain: width height.\n"); @@ -453,6 +455,8 @@ i ranges from 0 to 1, if negative don't draw that mesh node for(i=2; i-2 < (warp.n_width*warp.n_height); i++){ columns = lines[i].Explode(' '); + if(columns.size() == 1) + columns = lines[i].Explode('\t'); if (columns.size() == 5){ nodeX = (i-2)%warp.n_width; -- cgit v1.2.3 From 2ec50d7bb282c3962d752771ceed8cb152f956a9 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 30 Apr 2009 19:00:17 +0000 Subject: BGE bug #18091: Hitbox of object X doesn't move along when object X is parented to object Y. --- .../gameengine/Ketsji/KX_BulletPhysicsController.cpp | 19 +++++++++++-------- source/gameengine/Ketsji/KX_BulletPhysicsController.h | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp index 9e74706e1c0..300a7906e81 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp @@ -21,9 +21,13 @@ KX_BulletPhysicsController::KX_BulletPhysicsController (const CcdConstructionInf : KX_IPhysicsController(dyna,compound,(PHY_IPhysicsController*)this), CcdPhysicsController(ci), m_savedCollisionFlags(0), +m_savedCollisionFilterGroup(0), +m_savedCollisionFilterMask(0), +m_savedMass(0.0), +m_savedDyna(false), +m_suspended(false), m_bulletChildShape(NULL) { - } KX_BulletPhysicsController::~KX_BulletPhysicsController () @@ -337,8 +341,7 @@ void KX_BulletPhysicsController::RemoveCompoundChild(KX_IPhysicsController* c void KX_BulletPhysicsController::SetMass(MT_Scalar newmass) { btRigidBody *body = GetRigidBody(); - if (body && body->getActivationState() != DISABLE_SIMULATION && - newmass>MT_EPSILON && GetMass()>MT_EPSILON) + if (body && !m_suspended && newmass>MT_EPSILON && GetMass()>MT_EPSILON) { btVector3 grav = body->getGravity(); btVector3 accel = grav / GetMass(); @@ -356,7 +359,7 @@ void KX_BulletPhysicsController::SetMass(MT_Scalar newmass) void KX_BulletPhysicsController::SuspendDynamics(bool ghost) { btRigidBody *body = GetRigidBody(); - if (body && body->getActivationState() != DISABLE_SIMULATION) + if (body && !m_suspended) { btBroadphaseProxy* handle = body->getBroadphaseHandle(); m_savedCollisionFlags = body->getCollisionFlags(); @@ -364,8 +367,7 @@ void KX_BulletPhysicsController::SuspendDynamics(bool ghost) m_savedDyna = m_bDyna; m_savedCollisionFilterGroup = handle->m_collisionFilterGroup; m_savedCollisionFilterMask = handle->m_collisionFilterMask; - m_savedActivationState = body->getActivationState(); - body->forceActivationState(DISABLE_SIMULATION); + m_suspended = true; GetPhysicsEnvironment()->updateCcdPhysicsController(this, 0.0, btCollisionObject::CF_STATIC_OBJECT|((ghost)?btCollisionObject::CF_NO_CONTACT_RESPONSE:(m_savedCollisionFlags&btCollisionObject::CF_NO_CONTACT_RESPONSE)), @@ -378,15 +380,16 @@ void KX_BulletPhysicsController::SuspendDynamics(bool ghost) void KX_BulletPhysicsController::RestoreDynamics() { btRigidBody *body = GetRigidBody(); - if (body && body->getActivationState() == DISABLE_SIMULATION) + if (body && m_suspended) { GetPhysicsEnvironment()->updateCcdPhysicsController(this, m_savedMass, m_savedCollisionFlags, m_savedCollisionFilterGroup, m_savedCollisionFilterMask); - body->forceActivationState(m_savedActivationState); + body->activate(); m_bDyna = m_savedDyna; + m_suspended = false; } } diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h index 2174f0db499..9d2afad1a5c 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h @@ -14,6 +14,7 @@ private: short int m_savedCollisionFilterMask; MT_Scalar m_savedMass; bool m_savedDyna; + bool m_suspended; btCollisionShape* m_bulletChildShape; public: -- cgit v1.2.3 From 36d0e2649ee8bc95d68e5d8e5317aee4e82e44bf Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 30 Apr 2009 20:02:22 +0000 Subject: BGE bug fix: when a dynamic object is parented to a compound shape and then unparented, it jumps at the position it had before the parenting. --- source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source') diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 3e1e0294321..a0bf0448e3e 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -533,6 +533,12 @@ void CcdPhysicsEnvironment::enableCcdPhysicsController(CcdPhysicsController* ctr { btCollisionObject* obj = ctrl->GetCollisionObject(); obj->setUserPointer(ctrl); + // update the position of the object from the user + if (ctrl->GetMotionState()) + { + btTransform xform = CcdPhysicsController::GetTransformFromMotionState(ctrl->GetMotionState()); + ctrl->SetCenterOfMassTransform(xform); + } m_dynamicsWorld->addCollisionObject(obj, ctrl->GetCollisionFilterGroup(), ctrl->GetCollisionFilterMask()); } -- cgit v1.2.3 From bb3fa18a95b898cd52437d03839e531140972941 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 1 May 2009 04:55:40 +0000 Subject: add blendfile dirs to the sys.path without the scripts subdir --- source/blender/python/api2_2x/Geometry.c | 2 +- source/blender/src/buttons_logic.c | 2 +- source/gameengine/Ketsji/KX_PythonInit.cpp | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Geometry.c b/source/blender/python/api2_2x/Geometry.c index d568472c838..80869889af7 100644 --- a/source/blender/python/api2_2x/Geometry.c +++ b/source/blender/python/api2_2x/Geometry.c @@ -59,7 +59,7 @@ static PyObject *M_Geometry_BoxPack2D( PyObject * self, PyObject * args ); static char M_Geometry_doc[] = "The Blender Geometry module\n\n"; static char M_Geometry_PolyFill_doc[] = "(veclist_list) - takes a list of polylines (each point a vector) and returns the point indicies for a polyline filled with triangles"; static char M_Geometry_LineIntersect2D_doc[] = "(lineA_p1, lineA_p2, lineB_p1, lineB_p2) - takes 2 lines (as 4 vectors) and returns a vector for their point of intersection or None"; -static char M_Geometry_ClosestPointOnLine_doc[] = "(pt, line_p1, line_p2) - takes a point and a line and returns a (Vector, Bool) for the point on the line, and the bool so you can know if the point was between the 2 points"; +static char M_Geometry_ClosestPointOnLine_doc[] = "(pt, line_p1, line_p2) - takes a point and a line and returns a (Vector, float) for the point on the line, and the bool so you can know if the point was between the 2 points"; static char M_Geometry_PointInTriangle2D_doc[] = "(pt, tri_p1, tri_p2, tri_p3) - takes 4 vectors, one is the point and the next 3 define the triangle, only the x and y are used from the vectors"; static char M_Geometry_PointInQuad2D_doc[] = "(pt, quad_p1, quad_p2, quad_p3, quad_p4) - takes 5 vectors, one is the point and the next 4 define the quad, only the x and y are used from the vectors"; static char M_Geometry_BoxPack2D_doc[] = ""; diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 54b48de716f..941ed5ebe12 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -1584,7 +1584,7 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco if(pc->mode==0) uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "", xco+90,yco-24,width-90, 19, &pc->text, "Blender textblock to run as a script"); else { - uiDefBut(block, TEX, 1, "", xco+90,yco-24,(width-90)-25, 19, pc->module, 0, 63, 0, 0, "Module name and function to run eg \"someModule.main\", internal texts and //scripts/*.py on the filesystem can be used"); + uiDefBut(block, TEX, 1, "", xco+90,yco-24,(width-90)-25, 19, pc->module, 0, 63, 0, 0, "Module name and function to run eg \"someModule.main\", internal texts external python files can be used"); uiDefButBitI(block, TOG, CONT_PY_DEBUG, B_REDR, "D", (xco+width)-25, yco-24, 19, 19, &pc->flag, 0, 0, 0, 0, "Continuously reload the module from disk for editing external modules without restrting"); } uiBlockEndAlign(block); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index f5d32e36fc5..d774d8ed5f8 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1534,7 +1534,7 @@ void setSandbox(TPythonSecurityLevel level) * - initPySysPath(main) : initializes the blendfile and library paths * - restorePySysPath() : restores sys.path from gp_OrigPythonSysPath * - * These exist so the //scripts folder can always be used to import modules from. + * These exist so the current blend dir "//" can always be used to import modules from. * the reason we need a few functions for this is that python is not only used by the game engine * so we cant just add to sys.path all the time, it would leave pythons state in a mess. * It would also be incorrect since loading blend files for new levels etc would alwasy add to sys.path @@ -1569,7 +1569,6 @@ static void initPySysPath__append(PyObject *sys_path, char *filename) char expanded[FILE_MAXDIR + FILE_MAXFILE] = "//"; BLI_convertstringcode(expanded, filename); - BLI_join_dirfile(expanded, expanded, "scripts"); /* double checked and using the dir twice is safe */ item= PyString_FromString(expanded); -- cgit v1.2.3 From 742ddade1245973980d58ef3781226c7390506a7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 1 May 2009 14:19:56 +0000 Subject: [#18654] different behaviour if script is called from (1) Menu (2) TextEditor (3) ScriptsWindow [including crash!] bugfix, simple NULL check --- source/blender/python/api2_2x/Draw.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Draw.c b/source/blender/python/api2_2x/Draw.c index 57b3869d775..7e3f57da60d 100644 --- a/source/blender/python/api2_2x/Draw.c +++ b/source/blender/python/api2_2x/Draw.c @@ -915,12 +915,12 @@ static PyObject *Method_Exit( PyObject * self ) exit_pydraw( sc, 0 ); script = sc->script; - - /* remove our lock to the current namespace */ - script->flags &= ~SCRIPT_GUI; - script->scriptname[0] = '\0'; - script->scriptarg[0] = '\0'; - + if(script) { /* in very rare cases this can be NULL, (when saving and loading see bug #18654)*/ + /* remove our lock to the current namespace */ + script->flags &= ~SCRIPT_GUI; + script->scriptname[0] = '\0'; + script->scriptarg[0] = '\0'; + } Py_RETURN_NONE; } -- cgit v1.2.3 From 1c6cd47f2b93ba05c54f82c9363f269c71e28cda Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Fri, 1 May 2009 15:19:47 +0000 Subject: Fix linking issue with gameplayer. Kent --- source/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/Makefile b/source/Makefile index b190118bc38..7374ef3e7d6 100644 --- a/source/Makefile +++ b/source/Makefile @@ -261,6 +261,7 @@ SPLIB += $(OCGDIR)/blender/readblenfile/$(DEBUG_DIR)libreadblenfile.a # can I just not check them? nm claims they aren't... SPLIB += $(OCGDIR)/blender/blenkernel/blenkernel_blc/$(DEBUG_DIR)libblenkernel_blc.a SPLIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a +SPLIB += $(OCGDIR)/blender/blenlib/$(DEBUG_DIR)libblenlib.a # These three need to be explicitly mentioned on the cl, because # if they are offered as a lib, they are optimized away. (nzc) -- cgit v1.2.3 From 672492f563e148dc608965c5d0011413fbfae0eb Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Fri, 1 May 2009 16:35:06 +0000 Subject: BGE: New function GameLogic.setMaxLogicFrame() to allow better control over the time spent on logic. This function sets the maximum number of logic frame executed per render frame. Valid values: 1..5 This function is useful to control the amount of processing consumed by logic. By default, up to 5 logic frames can be executed per render frame. This is fine as long as the time spent on logic is negligible compared to the render time. If it's not the case, the default value will drag the performance of the game down by executing unnecessary logic frames that take up most of the CPU time. You can avoid that by lowering the value with this function. The drawback is less precision in the logic system to physics and I/O activity. Note that it does not affect the physics system: physics will still run at full frame rate (actually up to 5 times the ticrate). You can further control the render frame rate with GameLogic.setLogicTicRate(). --- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 31 ++++- source/gameengine/Ketsji/KX_KetsjiEngine.h | 9 ++ source/gameengine/Ketsji/KX_PythonInit.cpp | 17 +++ .../Physics/BlOde/OdePhysicsEnvironment.cpp | 2 +- .../Physics/BlOde/OdePhysicsEnvironment.h | 2 +- .../Physics/Bullet/CcdPhysicsEnvironment.cpp | 129 ++++++++++----------- .../Physics/Bullet/CcdPhysicsEnvironment.h | 2 +- .../Physics/Dummy/DummyPhysicsEnvironment.cpp | 2 +- .../Physics/Dummy/DummyPhysicsEnvironment.h | 2 +- .../Physics/Sumo/SumoPhysicsEnvironment.cpp | 2 +- .../Physics/Sumo/SumoPhysicsEnvironment.h | 2 +- .../Physics/common/PHY_IPhysicsEnvironment.h | 2 +- source/gameengine/PyDoc/GameLogic.py | 17 ++- 13 files changed, 135 insertions(+), 84 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 764c3c2dfec..d6747bd1ba4 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -97,6 +97,7 @@ const char KX_KetsjiEngine::m_profileLabels[tc_numCategories][15] = { }; double KX_KetsjiEngine::m_ticrate = DEFAULT_LOGIC_TIC_RATE; +int KX_KetsjiEngine::m_maxLogicFrame = 5; double KX_KetsjiEngine::m_anim_framerate = 25.0; double KX_KetsjiEngine::m_suspendedtime = 0.0; double KX_KetsjiEngine::m_suspendeddelta = 0.0; @@ -399,6 +400,7 @@ void KX_KetsjiEngine::StartEngine(bool clearIpo) m_firstframe = true; m_bInitialized = true; m_ticrate = DEFAULT_LOGIC_TIC_RATE; + m_maxLogicFrame = 5; if (m_game2ipo) { @@ -511,7 +513,8 @@ void KX_KetsjiEngine::EndFrame() bool KX_KetsjiEngine::NextFrame() { - + double timestep = 1.0/m_ticrate; + double framestep = timestep; // static hidden::Clock sClock; m_logger->StartLog(tc_services, m_kxsystem->GetTimeInSeconds(),true); @@ -520,7 +523,7 @@ m_logger->StartLog(tc_services, m_kxsystem->GetTimeInSeconds(),true); //sClock.reset(); if (m_bFixedTime) - m_clockTime += 1./m_ticrate; + m_clockTime += timestep; else { @@ -554,18 +557,24 @@ else { // printf("framedOut: %d\n",frames); - m_frameTime+=(frames-frameOut)*(1.0/m_ticrate); + m_frameTime+=(frames-frameOut)*timestep; frames = frameOut; } bool doRender = frames>0; + if (frames > m_maxLogicFrame) + { + framestep = (frames*timestep)/m_maxLogicFrame; + frames = m_maxLogicFrame; + } + while (frames) { - m_frameTime += 1.0/m_ticrate; + m_frameTime += framestep; for (sceneit = m_scenes.begin();sceneit != m_scenes.end(); ++sceneit) // for each scene, call the proceed functions @@ -644,7 +653,7 @@ else // Perform physics calculations on the scene. This can involve // many iterations of the physics solver. - scene->GetPhysicsEnvironment()->proceedDeltaTime(m_frameTime,1.0/m_ticrate);//m_deltatimerealDeltaTime); + scene->GetPhysicsEnvironment()->proceedDeltaTime(m_frameTime,timestep,framestep);//m_deltatimerealDeltaTime); m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true); SG_SetActiveStage(SG_STAGE_PHYSICS2_UPDATE); @@ -717,7 +726,7 @@ else // Perform physics calculations on the scene. This can involve // many iterations of the physics solver. m_logger->StartLog(tc_physics, m_kxsystem->GetTimeInSeconds(), true); - scene->GetPhysicsEnvironment()->proceedDeltaTime(m_clockTime,0.f); + scene->GetPhysicsEnvironment()->proceedDeltaTime(m_clockTime,timestep,timestep); // Update scenegraph after physics step. This maps physics calculations // into node positions. m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true); @@ -1729,6 +1738,16 @@ void KX_KetsjiEngine::SetTicRate(double ticrate) m_ticrate = ticrate; } +int KX_KetsjiEngine::GetMaxLogicFrame() +{ + return m_maxLogicFrame; +} + +void KX_KetsjiEngine::SetMaxLogicFrame(int frame) +{ + m_maxLogicFrame = frame; +} + double KX_KetsjiEngine::GetAnimFrameRate() { return m_anim_framerate; diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index a8ccd6100d7..791c5d24daa 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -103,6 +103,7 @@ private: double m_previousClockTime;//previous clock time double m_remainingTime; + static int m_maxLogicFrame; /* maximum number of consecutive logic frame */ static double m_ticrate; static double m_anim_framerate; /* for animation playback only - ipo and action */ @@ -283,6 +284,14 @@ public: * Sets the number of logic updates per second. */ static void SetTicRate(double ticrate); + /** + * Gets the maximum number of logic frame before render frame + */ + static int KX_KetsjiEngine::GetMaxLogicFrame(); + /** + * Sets the maximum number of logic frame before render frame + */ + static void KX_KetsjiEngine::SetMaxLogicFrame(int frame); /** * Gets the framerate for playing animations. (actions and ipos) diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index d774d8ed5f8..01c1382a6d1 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -288,6 +288,21 @@ static PyObject* gPyGetLogicTicRate(PyObject*) return PyFloat_FromDouble(KX_KetsjiEngine::GetTicRate()); } +static PyObject* gPySetMaxLogicFrame(PyObject*, PyObject* args) +{ + int frame; + if (!PyArg_ParseTuple(args, "i:setMaxLogicFrame", &frame)) + return NULL; + + KX_KetsjiEngine::SetMaxLogicFrame(frame); + Py_RETURN_NONE; +} + +static PyObject* gPyGetMaxLogicFrame(PyObject*) +{ + return PyInt_FromLong(KX_KetsjiEngine::GetMaxLogicFrame()); +} + static PyObject* gPySetPhysicsTicRate(PyObject*, PyObject* args) { float ticrate; @@ -479,6 +494,8 @@ static struct PyMethodDef game_methods[] = { {"setGravity",(PyCFunction) gPySetGravity, METH_O, (PY_METHODCHAR)"set Gravitation"}, {"getSpectrum",(PyCFunction) gPyGetSpectrum, METH_NOARGS, (PY_METHODCHAR)"get audio spectrum"}, {"stopDSP",(PyCFunction) gPyStopDSP, METH_VARARGS, (PY_METHODCHAR)"stop using the audio dsp (for performance reasons)"}, + {"getMaxLogicFrame", (PyCFunction) gPyGetMaxLogicFrame, METH_NOARGS, (PY_METHODCHAR)"Gets the max number of logic frame per render frame"}, + {"setMaxLogicFrame", (PyCFunction) gPySetMaxLogicFrame, METH_VARARGS, (PY_METHODCHAR)"Sets the max number of logic frame per render frame"}, {"getLogicTicRate", (PyCFunction) gPyGetLogicTicRate, METH_NOARGS, (PY_METHODCHAR)"Gets the logic tic rate"}, {"setLogicTicRate", (PyCFunction) gPySetLogicTicRate, METH_VARARGS, (PY_METHODCHAR)"Sets the logic tic rate"}, {"getPhysicsTicRate", (PyCFunction) gPyGetPhysicsTicRate, METH_NOARGS, (PY_METHODCHAR)"Gets the physics tic rate"}, diff --git a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp index 2e8ee31058f..54e97858b7f 100644 --- a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp +++ b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp @@ -75,7 +75,7 @@ float ODEPhysicsEnvironment::getFixedTimeStep() -bool ODEPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep1) +bool ODEPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep1,float interval) { float deltaTime = timeStep1; diff --git a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h index 2e4709cf420..82e26e01460 100644 --- a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h +++ b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h @@ -44,7 +44,7 @@ public: // Perform an integration step of duration 'timeStep'. - virtual bool proceedDeltaTime(double curTime,float timeStep); + virtual bool proceedDeltaTime(double curTime,float timeStep,float interval); virtual void setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep); virtual float getFixedTimeStep(); diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index a0bf0448e3e..bcf83e25d84 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -623,7 +623,7 @@ void CcdPhysicsEnvironment::debugDrawWorld() m_dynamicsWorld->debugDrawWorld(); } -bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep) +bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep,float interval) { std::set::iterator it; int i; @@ -633,14 +633,9 @@ bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep) (*it)->SynchronizeMotionStates(timeStep); } - processFhSprings(curTime,timeStep); - float subStep = timeStep / float(m_numTimeSubSteps); - for (i=0;istepSimulation(subStep,20,1./240.);//perform always a full simulation step - m_dynamicsWorld->stepSimulation(subStep,0);//perform always a full simulation step - } + i = m_dynamicsWorld->stepSimulation(interval,25,subStep);//perform always a full simulation step + processFhSprings(curTime,i*subStep); for (it=m_controllers.begin(); it!=m_controllers.end(); it++) { @@ -692,9 +687,11 @@ public: }; -void CcdPhysicsEnvironment::processFhSprings(double curTime,float timeStep) +void CcdPhysicsEnvironment::processFhSprings(double curTime,float interval) { std::set::iterator it; + // dynamic of Fh spring is based on a timestep of 1/60 + int numIter = (int)(interval*60.0001f); for (it=m_controllers.begin(); it!=m_controllers.end(); it++) { @@ -706,8 +703,6 @@ void CcdPhysicsEnvironment::processFhSprings(double curTime,float timeStep) //printf("has Fh or RotFh\n"); //re-implement SM_FhObject.cpp using btCollisionWorld::rayTest and info from ctrl->getConstructionInfo() //send a ray from {0.0, 0.0, 0.0} towards {0.0, 0.0, -10.0}, in local coordinates - - CcdPhysicsController* parentCtrl = ctrl->getParentCtrl(); btRigidBody* parentBody = parentCtrl?parentCtrl->GetRigidBody() : 0; btRigidBody* cl_object = parentBody ? parentBody : body; @@ -754,82 +749,78 @@ void CcdPhysicsEnvironment::processFhSprings(double curTime,float timeStep) btVector3 normal = resultCallback.m_hitNormalWorld; normal.normalize(); - - if (ctrl->getConstructionInfo().m_do_fh) + for (int i=0; igetCenterOfMassPosition() - + rayDirLocal * resultCallback.m_closestHitFraction; + if (ctrl->getConstructionInfo().m_do_fh) + { + btVector3 lspot = cl_object->getCenterOfMassPosition() + + rayDirLocal * resultCallback.m_closestHitFraction; + + + lspot -= hit_object->getCenterOfMassPosition(); + btVector3 rel_vel = cl_object->getLinearVelocity() - hit_object->getVelocityInLocalPoint(lspot); + btScalar rel_vel_ray = ray_dir.dot(rel_vel); + btScalar spring_extent = 1.0 - distance / hitObjShapeProps.m_fh_distance; + btScalar i_spring = spring_extent * hitObjShapeProps.m_fh_spring; + btScalar i_damp = rel_vel_ray * hitObjShapeProps.m_fh_damping; + + cl_object->setLinearVelocity(cl_object->getLinearVelocity() + (-(i_spring + i_damp) * ray_dir)); + if (hitObjShapeProps.m_fh_normal) + { + cl_object->setLinearVelocity(cl_object->getLinearVelocity()+(i_spring + i_damp) *(normal - normal.dot(ray_dir) * ray_dir)); + } + + btVector3 lateral = rel_vel - rel_vel_ray * ray_dir; + + + if (ctrl->getConstructionInfo().m_do_anisotropic) { + //Bullet basis contains no scaling/shear etc. + const btMatrix3x3& lcs = cl_object->getCenterOfMassTransform().getBasis(); + btVector3 loc_lateral = lateral * lcs; + const btVector3& friction_scaling = cl_object->getAnisotropicFriction(); + loc_lateral *= friction_scaling; + lateral = lcs * loc_lateral; + } - lspot -= hit_object->getCenterOfMassPosition(); - btVector3 rel_vel = cl_object->getLinearVelocity() - hit_object->getVelocityInLocalPoint(lspot); - btScalar rel_vel_ray = ray_dir.dot(rel_vel); - btScalar spring_extent = 1.0 - distance / hitObjShapeProps.m_fh_distance; - - btScalar i_spring = spring_extent * hitObjShapeProps.m_fh_spring; - btScalar i_damp = rel_vel_ray * hitObjShapeProps.m_fh_damping; - - cl_object->setLinearVelocity(cl_object->getLinearVelocity() + (-(i_spring + i_damp) * ray_dir)); - if (hitObjShapeProps.m_fh_normal) - { - cl_object->setLinearVelocity(cl_object->getLinearVelocity()+(i_spring + i_damp) *(normal - normal.dot(ray_dir) * ray_dir)); - } - - btVector3 lateral = rel_vel - rel_vel_ray * ray_dir; - - - if (ctrl->getConstructionInfo().m_do_anisotropic) { - //Bullet basis contains no scaling/shear etc. - const btMatrix3x3& lcs = cl_object->getCenterOfMassTransform().getBasis(); - btVector3 loc_lateral = lateral * lcs; - const btVector3& friction_scaling = cl_object->getAnisotropicFriction(); - loc_lateral *= friction_scaling; - lateral = lcs * loc_lateral; + btScalar rel_vel_lateral = lateral.length(); + + if (rel_vel_lateral > SIMD_EPSILON) { + btScalar friction_factor = hit_object->getFriction();//cl_object->getFriction(); + + btScalar max_friction = friction_factor * btMax(btScalar(0.0), i_spring); + + btScalar rel_mom_lateral = rel_vel_lateral / cl_object->getInvMass(); + + btVector3 friction = (rel_mom_lateral > max_friction) ? + -lateral * (max_friction / rel_vel_lateral) : + -lateral; + + cl_object->applyCentralImpulse(friction); + } } - btScalar rel_vel_lateral = lateral.length(); - if (rel_vel_lateral > SIMD_EPSILON) { - btScalar friction_factor = hit_object->getFriction();//cl_object->getFriction(); + if (ctrl->getConstructionInfo().m_do_rot_fh) { + btVector3 up2 = cl_object->getWorldTransform().getBasis().getColumn(2); - btScalar max_friction = friction_factor * btMax(btScalar(0.0), i_spring); + btVector3 t_spring = up2.cross(normal) * hitObjShapeProps.m_fh_spring; + btVector3 ang_vel = cl_object->getAngularVelocity(); - btScalar rel_mom_lateral = rel_vel_lateral / cl_object->getInvMass(); + // only rotations that tilt relative to the normal are damped + ang_vel -= ang_vel.dot(normal) * normal; - btVector3 friction = (rel_mom_lateral > max_friction) ? - -lateral * (max_friction / rel_vel_lateral) : - -lateral; + btVector3 t_damp = ang_vel * hitObjShapeProps.m_fh_damping; - cl_object->applyCentralImpulse(friction); + cl_object->setAngularVelocity(cl_object->getAngularVelocity() + (t_spring - t_damp)); } } - - - if (ctrl->getConstructionInfo().m_do_rot_fh) { - btVector3 up2 = cl_object->getWorldTransform().getBasis().getColumn(2); - - btVector3 t_spring = up2.cross(normal) * hitObjShapeProps.m_fh_spring; - btVector3 ang_vel = cl_object->getAngularVelocity(); - - // only rotations that tilt relative to the normal are damped - ang_vel -= ang_vel.dot(normal) * normal; - - btVector3 t_damp = ang_vel * hitObjShapeProps.m_fh_damping; - - cl_object->setAngularVelocity(cl_object->getAngularVelocity() + (t_spring - t_damp)); - } - } - - } - - } } - } void CcdPhysicsEnvironment::setDebugMode(int debugMode) diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h index f861621ae37..5f9fb9511d6 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h @@ -114,7 +114,7 @@ protected: virtual void beginFrame(); virtual void endFrame() {}; /// Perform an integration step of duration 'timeStep'. - virtual bool proceedDeltaTime(double curTime,float timeStep); + virtual bool proceedDeltaTime(double curTime,float timeStep,float interval); virtual void debugDrawWorld(); // virtual bool proceedDeltaTimeOneStep(float timeStep); diff --git a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp index ba196b5cf55..e41574ff181 100644 --- a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp @@ -57,7 +57,7 @@ void DummyPhysicsEnvironment::endFrame() -bool DummyPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep) +bool DummyPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep,float interval) { //step physics simulation, typically perform diff --git a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h index 4e15e6ec130..397a1ba4218 100644 --- a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h +++ b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h @@ -48,7 +48,7 @@ public: virtual void beginFrame(); virtual void endFrame(); // Perform an integration step of duration 'timeStep'. - virtual bool proceedDeltaTime(double curTime,float timeStep); + virtual bool proceedDeltaTime(double curTime,float timeStep,float interval); virtual void setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep); virtual float getFixedTimeStep(); diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp index 3be5e027345..cc6d5654ec9 100644 --- a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp @@ -81,7 +81,7 @@ float SumoPhysicsEnvironment::getFixedTimeStep() } -bool SumoPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep) +bool SumoPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep,float interval) { bool result = false; diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h index 418a361a065..c2b443a2b38 100644 --- a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h +++ b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h @@ -54,7 +54,7 @@ public: virtual void beginFrame(); virtual void endFrame(); // Perform an integration step of duration 'timeStep'. - virtual bool proceedDeltaTime(double curTime,float timeStep); + virtual bool proceedDeltaTime(double curTime,float timeStep,float interval); virtual void setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep); virtual float getFixedTimeStep(); diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h index 9a4500c3214..a3605669f70 100644 --- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h +++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h @@ -89,7 +89,7 @@ class PHY_IPhysicsEnvironment virtual void beginFrame() = 0; virtual void endFrame() = 0; /// Perform an integration step of duration 'timeStep'. - virtual bool proceedDeltaTime(double curTime,float timeStep)=0; + virtual bool proceedDeltaTime(double curTime,float timeStep,float interval)=0; ///draw debug lines (make sure to call this during the render phase, otherwise lines are not drawn properly) virtual void debugDrawWorld(){} virtual void setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep)=0; diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 74e7f852018..85e94e63416 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -360,6 +360,21 @@ def stopDSP(): Only the fmod sound driver supports this. DSP can be computationally expensive. """ +def getMaxLogicFrame(): + """ + Gets the maximum number of logic frame per render frame. + + @return: The maximum number of logic frame per render frame + @rtype: interger + """ +def setMaxLogicFrame(maxlogic): + """ + Sets the maximum number of logic frame that are executed per render frame. + This does not affect the physic system that still runs at full frame rate. + + @param maxlogic: The new maximum number of logic frame per render frame. Valid values: 1..5 + @type maxlogic: integer + """ def getLogicTicRate(): """ Gets the logic update frequency. @@ -372,7 +387,7 @@ def setLogicTicRate(ticrate): Sets the logic update frequency. The logic update frequency is the number of times logic bricks are executed every second. - The default is 30 Hz. + The default is 60 Hz. @param ticrate: The new logic update frequency (in Hz). @type ticrate: float -- cgit v1.2.3 From e13a089d918cbe3709f544ccebbb718a452ac6fa Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Fri, 1 May 2009 19:02:23 +0000 Subject: BGE: work around a problem with DBVT culling when graphic objects are rescaled. This happens when objects with very diverse scale are instantiated with dupligroup. The problem remains when the objects are rescaled during the game. The effect of the problem is an inefficient culling: objects can have a bounding box larger than needed. Patch to fix the problem is filed at Bullet forum. --- source/gameengine/Ketsji/KX_GameObject.cpp | 29 ++++++++++++++++++++++ source/gameengine/Ketsji/KX_GameObject.h | 4 +++ source/gameengine/Ketsji/KX_Scene.cpp | 7 +++++- .../Physics/Bullet/CcdGraphicController.cpp | 11 +++++++- .../Physics/Bullet/CcdGraphicController.h | 4 +++ .../Physics/Bullet/CcdPhysicsEnvironment.cpp | 2 +- .../Physics/common/PHY_IGraphicController.h | 1 + 7 files changed, 55 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 20113afaae2..fa95a89135b 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -331,6 +331,35 @@ void KX_GameObject::ProcessReplica() } +static void setGraphicController_recursive(SG_Node* node, bool v) +{ + NodeList& children = node->GetSGChildren(); + + for (NodeList::iterator childit = children.begin();!(childit==children.end());++childit) + { + SG_Node* childnode = (*childit); + KX_GameObject *clientgameobj = static_cast( (*childit)->GetSGClientObject()); + if (clientgameobj != NULL) // This is a GameObject + clientgameobj->ActivateGraphicController(v, false); + + // if the childobj is NULL then this may be an inverse parent link + // so a non recursive search should still look down this node. + setGraphicController_recursive(childnode, v); + } +} + + +void KX_GameObject::ActivateGraphicController(bool active, bool recurse) +{ + if (m_pGraphicController) + { + m_pGraphicController->Activate(active); + } + if (recurse) + { + setGraphicController_recursive(GetSGNode(), active); + } +} CValue* KX_GameObject::GetReplica() diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index fe9f39a6ed3..14ed713ecfa 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -385,6 +385,10 @@ public: { m_pGraphicController = graphiccontroller; } + /* + * @add/remove the graphic controller to the physic system + */ + void ActivateGraphicController(bool active, bool recurse); /** * @section Coordinate system manipulation functions diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index fd244037722..36486440c00 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -717,10 +717,13 @@ void KX_Scene::DupliGroupRecurse(CValue* obj, int level) // set the orientation after position for softbody! MT_Matrix3x3 newori = groupobj->NodeGetWorldOrientation() * gameobj->NodeGetWorldOrientation(); replica->NodeSetLocalOrientation(newori); - + // update scenegraph for entire tree of children replica->GetSGNode()->UpdateWorldData(0); replica->GetSGNode()->SetBBox(gameobj->GetSGNode()->BBox()); replica->GetSGNode()->SetRadius(gameobj->GetSGNode()->Radius()); + // we can now add the graphic controller to the physic engine + replica->ActivateGraphicController(true,true); + // done with replica replica->Release(); } @@ -831,6 +834,8 @@ SCA_IObject* KX_Scene::AddReplicaObject(class CValue* originalobject, replica->GetSGNode()->UpdateWorldData(0); replica->GetSGNode()->SetBBox(originalobj->GetSGNode()->BBox()); replica->GetSGNode()->SetRadius(originalobj->GetSGNode()->Radius()); + // the size is correct, we can add the graphic controller to the physic engine + replica->ActivateGraphicController(true,true); // now replicate logic vector::iterator git; diff --git a/source/gameengine/Physics/Bullet/CcdGraphicController.cpp b/source/gameengine/Physics/Bullet/CcdGraphicController.cpp index 2d1f841af0c..2dbbb7fa4a0 100644 --- a/source/gameengine/Physics/Bullet/CcdGraphicController.cpp +++ b/source/gameengine/Physics/Bullet/CcdGraphicController.cpp @@ -118,8 +118,17 @@ PHY_IGraphicController* CcdGraphicController::GetReplica(class PHY_IMotionState* replica->m_motionState = motionState; replica->m_newClientInfo = NULL; replica->m_handle = NULL; - m_phyEnv->addCcdGraphicController(replica); + // don't add the graphic controller now: work around a bug in Bullet with rescaling, + // (the scale of the controller is not yet defined). + //m_phyEnv->addCcdGraphicController(replica); return replica; } +void CcdGraphicController::Activate(bool active) +{ + if (active) + m_phyEnv->addCcdGraphicController(this); + else + m_phyEnv->removeCcdGraphicController(this); +} diff --git a/source/gameengine/Physics/Bullet/CcdGraphicController.h b/source/gameengine/Physics/Bullet/CcdGraphicController.h index 8f44a623371..b0626f902c2 100644 --- a/source/gameengine/Physics/Bullet/CcdGraphicController.h +++ b/source/gameengine/Physics/Bullet/CcdGraphicController.h @@ -55,6 +55,10 @@ public: * Updates the Aabb based on the motion state */ virtual bool SetGraphicTransform(); + /** + * Add/remove to environment + */ + virtual void Activate(bool active); // client info for culling virtual void* getNewClientInfo() { return m_newClientInfo; } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index bcf83e25d84..03c9d13a7dd 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -579,7 +579,7 @@ void CcdPhysicsEnvironment::refreshCcdPhysicsController(CcdPhysicsController* ct void CcdPhysicsEnvironment::addCcdGraphicController(CcdGraphicController* ctrl) { - if (m_cullingTree) + if (m_cullingTree && !ctrl->getBroadphaseHandle()) { btVector3 minAabb; btVector3 maxAabb; diff --git a/source/gameengine/Physics/common/PHY_IGraphicController.h b/source/gameengine/Physics/common/PHY_IGraphicController.h index 8acc5c2f9d3..470d42cb84a 100644 --- a/source/gameengine/Physics/common/PHY_IGraphicController.h +++ b/source/gameengine/Physics/common/PHY_IGraphicController.h @@ -47,6 +47,7 @@ class PHY_IGraphicController : public PHY_IController SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding') */ virtual bool SetGraphicTransform()=0; + virtual void Activate(bool active=true)=0; virtual void setLocalAabb(const PHY__Vector3& aabbMin,const PHY__Vector3& aabbMax)=0; virtual void setLocalAabb(const float* aabbMin,const float* aabbMax)=0; -- cgit v1.2.3 From 07abb9dee2aba5ed161c22f3ec45031f9fdb183a Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Fri, 1 May 2009 20:34:23 +0000 Subject: BGE performance: - Vast performance increase when removing scene containing large number of objects: the sensor/controller map was updated for each deleted object, causing massive slow down when the number of objects was large (O(n^2)). - Use reference when scanning the sensor map => avoid useless copy. - Remove dynamically the object bounding box from the DBVT when the object is invisible => faster culling. --- source/gameengine/GameLogic/SCA_LogicManager.cpp | 29 ++++++++++++++++-------- source/gameengine/GameLogic/SCA_LogicManager.h | 8 +++++-- source/gameengine/Ketsji/KX_GameObject.cpp | 2 ++ source/gameengine/Ketsji/KX_KetsjiEngine.h | 4 ++-- source/gameengine/Ketsji/KX_Scene.cpp | 2 ++ 5 files changed, 32 insertions(+), 13 deletions(-) (limited to 'source') diff --git a/source/gameengine/GameLogic/SCA_LogicManager.cpp b/source/gameengine/GameLogic/SCA_LogicManager.cpp index b584b37180f..0b549ded474 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.cpp +++ b/source/gameengine/GameLogic/SCA_LogicManager.cpp @@ -79,6 +79,13 @@ SCA_LogicManager::~SCA_LogicManager() m_activeActuators.clear(); } +// this function is a performance helper when the scene is destoyed +// without it, the map updated for each object... a massive slow down when there are +// large number of objects. By clearing the map upfront we avoid the waster of time. +void SCA_LogicManager::RemoveSensorMap() +{ + m_sensorcontrollermapje.clear(); +} /* // this kind of fixes bug 398 but breakes games, so better leave it out for now. @@ -171,12 +178,16 @@ void* SCA_LogicManager::FindBlendObjByGameMeshName(const STR_String& gamemeshnam void SCA_LogicManager::RemoveSensor(SCA_ISensor* sensor) { - controllerlist contlist = m_sensorcontrollermapje[sensor]; - for (controllerlist::const_iterator c= contlist.begin();!(c==contlist.end());c++) + sensormap_t::const_iterator mit = m_sensorcontrollermapje.find(sensor); + if (mit != m_sensorcontrollermapje.end()) { - (*c)->UnlinkSensor(sensor); + const controllerlist& contlist = mit->second; + for (controllerlist::const_iterator c= contlist.begin();!(c==contlist.end());c++) + { + (*c)->UnlinkSensor(sensor); + } + m_sensorcontrollermapje.erase(sensor); } - m_sensorcontrollermapje.erase(sensor); sensor->UnregisterToManager(); } @@ -184,7 +195,7 @@ void SCA_LogicManager::RemoveController(SCA_IController* controller) { controller->UnlinkAllSensors(); controller->UnlinkAllActuators(); - std::map::iterator sit; + sensormap_t::iterator sit; for (sit = m_sensorcontrollermapje.begin();!(sit==m_sensorcontrollermapje.end());++sit) { (*sit).second.remove(controller); @@ -197,10 +208,10 @@ void SCA_LogicManager::RemoveDestroyedActuator(SCA_IActuator* actuator) m_removedActuators.push_back(SmartActuatorPtr(actuator,0)); // take care that no controller can use this actuator again ! - std::map::const_iterator sit; + sensormap_t::const_iterator sit; for (sit = m_sensorcontrollermapje.begin();!(sit==m_sensorcontrollermapje.end());++sit) { - controllerlist contlist = (*sit).second; + const controllerlist& contlist = sit->second; for (list::const_iterator c= contlist.begin();!(c==contlist.end());c++) { (*c)->UnlinkActuator(actuator); @@ -237,8 +248,8 @@ void SCA_LogicManager::BeginFrame(double curtime, double fixedtime) !(is==m_activatedsensors.end());is++) { SCA_ISensor* sensor = *is; - controllerlist contlist = m_sensorcontrollermapje[sensor]; - for (list::const_iterator c= contlist.begin(); + const controllerlist& contlist = m_sensorcontrollermapje[sensor]; + for (list::const_iterator c= contlist.begin(); !(c==contlist.end());c++) { SCA_IController* contr = *c;//controllerarray->at(c); diff --git a/source/gameengine/GameLogic/SCA_LogicManager.h b/source/gameengine/GameLogic/SCA_LogicManager.h index 50383879d8f..17971c219e5 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.h +++ b/source/gameengine/GameLogic/SCA_LogicManager.h @@ -47,7 +47,8 @@ #include "KX_HashedPtr.h" using namespace std; -typedef list controllerlist; +typedef std::list controllerlist; +typedef std::map sensormap_t; /** * This manager handles sensor, controllers and actuators. @@ -101,7 +102,7 @@ class SCA_LogicManager set m_activeActuators; set m_triggeredControllerSet; - map m_sensorcontrollermapje; + sensormap_t m_sensorcontrollermapje; // need to find better way for this // also known as FactoryManager... @@ -116,6 +117,9 @@ class SCA_LogicManager public: SCA_LogicManager(); virtual ~SCA_LogicManager(); + // can ONLY be used during scene destruction, avoid massive slow down when scene has many many objects + void RemoveSensorMap(); + //void SetKeyboardManager(SCA_KeyboardManager* keyboardmgr) { m_keyboardmgr=keyboardmgr;} void RegisterEventManager(SCA_EventManager* eventmgr); void RegisterToSensor(SCA_IController* controller, diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index fa95a89135b..22b9c940178 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -628,6 +628,8 @@ KX_GameObject::SetVisible( { if (GetSGNode()) { m_bVisible = v; + if (m_pGraphicController) + m_pGraphicController->Activate(m_bVisible); if (recursive) setVisible_recursive(GetSGNode(), v); } diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index 791c5d24daa..528465b6c2c 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -287,11 +287,11 @@ public: /** * Gets the maximum number of logic frame before render frame */ - static int KX_KetsjiEngine::GetMaxLogicFrame(); + static int GetMaxLogicFrame(); /** * Sets the maximum number of logic frame before render frame */ - static void KX_KetsjiEngine::SetMaxLogicFrame(int frame); + static void SetMaxLogicFrame(int frame); /** * Gets the framerate for playing animations. (actions and ipos) diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 36486440c00..171ed5d130f 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -208,6 +208,8 @@ KX_Scene::~KX_Scene() // It's still there but we remove all properties here otherwise some // reference might be hanging and causing late release of objects RemoveAllDebugProperties(); + // early removal of sensor map to avoid massive slow down when there are many objects + m_logicmgr->RemoveSensorMap(); while (GetRootParentList()->GetCount() > 0) { -- cgit v1.2.3 From ef20036b847396940de475c16e364661690c63a7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 2 May 2009 02:40:11 +0000 Subject: BGE Py API patch from Mitchell Stokes, adds extra attributes and docs --- source/gameengine/Converter/BL_ActionActuator.cpp | 1 - source/gameengine/GameLogic/SCA_ILogicBrick.cpp | 2 +- source/gameengine/Ketsji/KX_GameActuator.cpp | 2 +- source/gameengine/Ketsji/KX_ParentActuator.cpp | 2 +- source/gameengine/Ketsji/KX_ParentActuator.h | 1 + source/gameengine/Ketsji/KX_PythonInit.cpp | 25 +++++++++++++++++++++++ source/gameengine/Ketsji/KX_SceneActuator.cpp | 4 ++-- source/gameengine/PyDoc/GameLogic.py | 18 ++++++++++++++++ source/gameengine/PyDoc/KX_GameActuator.py | 2 ++ source/gameengine/PyDoc/KX_ParentActuator.py | 2 ++ source/gameengine/PyDoc/KX_SceneActuator.py | 2 ++ source/gameengine/PyDoc/SCA_ILogicBrick.py | 2 ++ 12 files changed, 57 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index ee97e325a8e..8b8e6b54320 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -1015,7 +1015,6 @@ PyAttributeDef BL_ActionActuator::Attributes[] = { KX_PYATTRIBUTE_BOOL_RW("continue", BL_ActionActuator, m_end_reset), KX_PYATTRIBUTE_FLOAT_RW_CHECK("blendTime", 0, MAXFRAMEF, BL_ActionActuator, m_blendframe, CheckBlendTime), KX_PYATTRIBUTE_SHORT_RW_CHECK("type",0,100,false,BL_ActionActuator,m_playtype,CheckType), - //KX_PYATTRIBUTE_TODO("channel"), { NULL } //Sentinel }; diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 84babda1d7a..c138ae46283 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -254,7 +254,7 @@ PyMethodDef SCA_ILogicBrick::Methods[] = { PyAttributeDef SCA_ILogicBrick::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("owner", SCA_ILogicBrick, pyattr_get_owner), KX_PYATTRIBUTE_INT_RW("executePriority",0,100000,false,SCA_ILogicBrick,m_Execute_Ueber_Priority), - //KX_PYATTRIBUTE_TODO("name"), + KX_PYATTRIBUTE_STRING_RO("name", SCA_ILogicBrick, m_name), {NULL} //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index 48d7dcd84a2..9588e14d360 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -253,7 +253,7 @@ PyMethodDef KX_GameActuator::Methods[] = PyAttributeDef KX_GameActuator::Attributes[] = { KX_PYATTRIBUTE_STRING_RW("file",0,100,false,KX_GameActuator,m_filename), - //KX_PYATTRIBUTE_TODO("mode"), + KX_PYATTRIBUTE_INT_RW("mode", KX_GAME_NODEF+1, KX_GAME_MAX-1, true, KX_GameActuator, m_mode), { NULL } //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index 37d2e50cdb6..f55ffd4f69a 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -178,7 +178,7 @@ PyMethodDef KX_ParentActuator::Methods[] = { PyAttributeDef KX_ParentActuator::Attributes[] = { KX_PYATTRIBUTE_RW_FUNCTION("object", KX_ParentActuator, pyattr_get_object, pyattr_set_object), - //KX_PYATTRIBUTE_TODO("mode"), + KX_PYATTRIBUTE_INT_RW("mode", KX_PARENT_NODEF+1, KX_PARENT_MAX-1, true, KX_ParentActuator, m_mode), { NULL } //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h index a9bf7304bc8..6af0888e2ba 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.h +++ b/source/gameengine/Ketsji/KX_ParentActuator.h @@ -57,6 +57,7 @@ class KX_ParentActuator : public SCA_IActuator KX_PARENT_NODEF = 0, KX_PARENT_SET, KX_PARENT_REMOVE, + KX_PARENT_MAX }; diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 01c1382a6d1..afc1fc5d1f8 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -49,6 +49,9 @@ #include "KX_KetsjiEngine.h" #include "KX_RadarSensor.h" #include "KX_RaySensor.h" +#include "KX_SceneActuator.h" +#include "KX_GameActuator.h" +#include "KX_ParentActuator.h" #include "KX_SCA_DynamicActuator.h" #include "SCA_IInputDevice.h" @@ -1359,6 +1362,28 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_LOCAL, KX_ConstraintActuator::KX_ACT_CONSTRAINT_LOCAL); KX_MACRO_addTypesToDict(d, KX_ACT_CONSTRAINT_DOROTFH, KX_ConstraintActuator::KX_ACT_CONSTRAINT_DOROTFH); + /* Game Actuator Modes */ + KX_MACRO_addTypesToDict(d, KX_GAME_LOAD, KX_GameActuator::KX_GAME_LOAD); + KX_MACRO_addTypesToDict(d, KX_GAME_START, KX_GameActuator::KX_GAME_START); + KX_MACRO_addTypesToDict(d, KX_GAME_RESTART, KX_GameActuator::KX_GAME_RESTART); + KX_MACRO_addTypesToDict(d, KX_GAME_QUIT, KX_GameActuator::KX_GAME_QUIT); + KX_MACRO_addTypesToDict(d, KX_GAME_SAVECFG, KX_GameActuator::KX_GAME_SAVECFG); + KX_MACRO_addTypesToDict(d, KX_GAME_LOADCFG, KX_GameActuator::KX_GAME_LOADCFG); + + /* Scene Actuator Modes */ + KX_MACRO_addTypesToDict(d, KX_SCENE_RESTART, KX_SceneActuator::KX_SCENE_RESTART); + KX_MACRO_addTypesToDict(d, KX_SCENE_SET_SCENE, KX_SceneActuator::KX_SCENE_SET_SCENE); + KX_MACRO_addTypesToDict(d, KX_SCENE_SET_CAMERA, KX_SceneActuator::KX_SCENE_SET_CAMERA); + KX_MACRO_addTypesToDict(d, KX_SCENE_ADD_FRONT_SCENE, KX_SceneActuator::KX_SCENE_ADD_FRONT_SCENE); + KX_MACRO_addTypesToDict(d, KX_SCENE_ADD_BACK_SCENE, KX_SceneActuator::KX_SCENE_ADD_BACK_SCENE); + KX_MACRO_addTypesToDict(d, KX_SCENE_REMOVE_SCENE, KX_SceneActuator::KX_SCENE_REMOVE_SCENE); + KX_MACRO_addTypesToDict(d, KX_SCENE_SUSPEND, KX_SceneActuator::KX_SCENE_SUSPEND); + KX_MACRO_addTypesToDict(d, KX_SCENE_RESUME, KX_SceneActuator::KX_SCENE_RESUME); + + /* Parent Actuator Modes */ + KX_MACRO_addTypesToDict(d, KX_PARENT_SET, KX_ParentActuator::KX_PARENT_SET); + KX_MACRO_addTypesToDict(d, KX_PARENT_REMOVE, KX_ParentActuator::KX_PARENT_REMOVE); + // Check for errors if (PyErr_Occurred()) { diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index 1cce93fbcc5..eed1bb8027b 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -275,8 +275,8 @@ PyMethodDef KX_SceneActuator::Methods[] = PyAttributeDef KX_SceneActuator::Attributes[] = { KX_PYATTRIBUTE_STRING_RW("scene",0,32,true,KX_SceneActuator,m_nextSceneName), KX_PYATTRIBUTE_RW_FUNCTION("camera",KX_SceneActuator,pyattr_get_camera,pyattr_set_camera), - //KX_PYATTRIBUTE_TODO("useRestart"), - //KX_PYATTRIBUTE_TODO("mode"), + KX_PYATTRIBUTE_BOOL_RW("useRestart", KX_SceneActuator, m_restart), + KX_PYATTRIBUTE_INT_RW("mode", KX_SCENE_NODEF+1, KX_SCENE_MAX-1, true, KX_SceneActuator, m_mode), { NULL } //Sentinel }; diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 85e94e63416..708dc29f137 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -187,6 +187,24 @@ Documentation for the GameLogic Module. @var KX_DYN_DISABLE_RIGID_BODY: See L{KX_SCA_DynamicActuator} @var KX_DYN_SET_MASS: See L{KX_SCA_DynamicActuator} +@group Game Actuator: KX_GAME_LOAD, KX_GAME_START, KX_GAME_RESTART, KX_GAME_QUIT, KX_GAME_SAVECFG, KX_GAME_LOADCFG +@var KX_Game_LOAD: See L{KX_GameActuator} +@var KX_Game_START: See L{KX_GameActuator} +@var KX_Game_RESTART: See L{KX_GameActuator} +@var KX_Game_QUIT: See L{KX_GameActuator} +@var KX_Game_SAVECFG: See L{KX_GameActuator} +@var KX_Game_LOADCFG: See L{KX_GameActuator} + +@group Scene Actuator: KX_SCENE_RESTART, KX_SCENE_SET_SCENE, KX_SCENE_SET_CAMERA, KX_SCENE_ADD_FRONT_SCENE, KX_SCENE_ADD_BACK_SCENE, KX_SCENE_REMOVE_SCENE, KX_SCENE_SUSPEND, KX_SCENE_RESUME +KX_SCENE_RESTART: See L{KX_SceneActuator} +KX_SCENE_SET_SCENE: See L{KX_SceneActuator} +KX_SCENE_SET_CAMERA: See L{KX_SceneActuator} +KX_SCENE_ADD_FRONT_SCENE: See L{KX_SceneActuator} +KX_SCENE_ADD_BACK_SCENE: See L{KX_SceneActuator} +KX_SCENE_REMOVE_SCENE: See L{KX_SceneActuator} +KX_SCENE_SUSPEND: See L{KX_SceneActuator} +KX_SCENE_RESUME: See L{KX_SceneActuator} + @group Input Status: KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED @var KX_INPUT_NONE: See L{SCA_MouseSensor} @var KX_INPUT_JUST_ACTIVATED: See L{SCA_MouseSensor} diff --git a/source/gameengine/PyDoc/KX_GameActuator.py b/source/gameengine/PyDoc/KX_GameActuator.py index fc5bd6005fc..0b329419ad7 100644 --- a/source/gameengine/PyDoc/KX_GameActuator.py +++ b/source/gameengine/PyDoc/KX_GameActuator.py @@ -10,6 +10,8 @@ class KX_GameActuator(SCA_IActuator): @ivar file: the new .blend file to load @type file: string. + @ivar mode: The mode of this actuator + @type mode: int from 0 to 5 L{GameLogic.Game Actuator} """ def getFile(): """ diff --git a/source/gameengine/PyDoc/KX_ParentActuator.py b/source/gameengine/PyDoc/KX_ParentActuator.py index 2f5d9515d0b..1e2bfe60a4f 100644 --- a/source/gameengine/PyDoc/KX_ParentActuator.py +++ b/source/gameengine/PyDoc/KX_ParentActuator.py @@ -7,6 +7,8 @@ class KX_ParentActuator(SCA_IActuator): The parent actuator can set or remove an objects parent object. @ivar object: the object this actuator sets the parent too. @type object: KX_GameObject or None + @ivar mode: The mode of this actuator + @type mode: int from 0 to 1 L{GameLogic.Parent Actuator} """ def setObject(object): """ diff --git a/source/gameengine/PyDoc/KX_SceneActuator.py b/source/gameengine/PyDoc/KX_SceneActuator.py index 6e27257533e..2429cd6fb80 100644 --- a/source/gameengine/PyDoc/KX_SceneActuator.py +++ b/source/gameengine/PyDoc/KX_SceneActuator.py @@ -18,6 +18,8 @@ class KX_SceneActuator(SCA_IActuator): @ivar camera: the camera to change to. When setting the attribute, you can use either a L{KX_Camera} or the name of the camera. @type camera: L{KX_Camera} on read, string or L{KX_Camera} on write + @type mode: The mode of the actuator + @type mode: int from 0 to 5 L{GameLogic.Scene Actuator} """ def setUseRestart(flag): """ diff --git a/source/gameengine/PyDoc/SCA_ILogicBrick.py b/source/gameengine/PyDoc/SCA_ILogicBrick.py index 2bfe407204a..a96e77c3249 100644 --- a/source/gameengine/PyDoc/SCA_ILogicBrick.py +++ b/source/gameengine/PyDoc/SCA_ILogicBrick.py @@ -11,6 +11,8 @@ class SCA_ILogicBrick(CValue): @type executePriority: int @ivar owner: The game object this logic brick is attached to (read only). @type owner: L{KX_GameObject} or None in exceptional cases. + @ivar name: The name of this logic brick (read only). + @type name: string @group Deprecated: getOwner, setExecutePriority, getExecutePriority """ -- cgit v1.2.3 From 41f42099acba137bbc6411341819fa1c8cd6d769 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 2 May 2009 04:53:01 +0000 Subject: BGE Py API patch from Mitchell Stokes, add distance attribute to the radar sensor, dont use 'continue' because its a python keyword. removed (ssizeobjargproc) it breaks py2.3 --- source/gameengine/Converter/BL_ActionActuator.cpp | 2 +- source/gameengine/Expressions/ListValue.cpp | 2 +- source/gameengine/Ketsji/KX_RadarSensor.cpp | 1 + source/gameengine/PyDoc/BL_ActionActuator.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 8b8e6b54320..646a65d347b 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -1012,7 +1012,7 @@ PyAttributeDef BL_ActionActuator::Attributes[] = { KX_PYATTRIBUTE_FLOAT_RW_CHECK("frame", 0, MAXFRAMEF, BL_ActionActuator, m_localtime, CheckFrame), KX_PYATTRIBUTE_STRING_RW("property", 0, 31, false, BL_ActionActuator, m_propname), KX_PYATTRIBUTE_STRING_RW("frameProperty", 0, 31, false, BL_ActionActuator, m_framepropname), - KX_PYATTRIBUTE_BOOL_RW("continue", BL_ActionActuator, m_end_reset), + KX_PYATTRIBUTE_BOOL_RW("useContinue", BL_ActionActuator, m_end_reset), KX_PYATTRIBUTE_FLOAT_RW_CHECK("blendTime", 0, MAXFRAMEF, BL_ActionActuator, m_blendframe, CheckBlendTime), KX_PYATTRIBUTE_SHORT_RW_CHECK("type",0,100,false,BL_ActionActuator,m_playtype,CheckType), { NULL } //Sentinel diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index fc6b9299146..027d2594336 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -218,7 +218,7 @@ static PySequenceMethods listvalue_as_sequence = { NULL, #else listvalue_buffer_slice, /*sq_slice*/ - (ssizeobjargproc)NULL, /*sq_ass_item*/ + NULL, /*sq_ass_item*/ NULL, /*sq_ass_slice*/ #endif }; diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index 1959dd52046..4532224a81e 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -280,6 +280,7 @@ PyMethodDef KX_RadarSensor::Methods[] = { PyAttributeDef KX_RadarSensor::Attributes[] = { KX_PYATTRIBUTE_FLOAT_ARRAY_RO("coneOrigin", KX_RadarSensor, m_cone_origin, 3), KX_PYATTRIBUTE_FLOAT_ARRAY_RO("coneTarget", KX_RadarSensor, m_cone_target, 3), + KX_PYATTRIBUTE_FLOAT_RO("distance", KX_RadarSensor, m_coneheight), KX_PYATTRIBUTE_FLOAT_RW("angle", 0, 360, KX_RadarSensor, m_coneradius), KX_PYATTRIBUTE_INT_RW("axis", 0, 5, true, KX_RadarSensor, m_axis), {NULL} //Sentinel diff --git a/source/gameengine/PyDoc/BL_ActionActuator.py b/source/gameengine/PyDoc/BL_ActionActuator.py index 480681dc14a..455f83d5ce7 100644 --- a/source/gameengine/PyDoc/BL_ActionActuator.py +++ b/source/gameengine/PyDoc/BL_ActionActuator.py @@ -29,7 +29,7 @@ class BL_ActionActuator(SCA_IActuator): @type blendTime: float @ivar type: The operation mode of the actuator. KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND @type type: integer - @ivar continue: The actions continue option, True or False. + @ivar useContinue: The actions continue option, True or False. When True, the action will always play from where last left off, otherwise negative events to this actuator will reset it to its start frame. @type: boolean -- cgit v1.2.3 From 40fc1d2af74257ee45ae1b5bf7564b3b5768eb80 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 2 May 2009 15:09:06 +0000 Subject: BGE PyController module type. - Added support for any number of attributes, this means packages are supported automatically. so as well as "myModule.myFunc" you can do "myPackage.myModule.myFunc", nested packages work too. - pass the controller to the python function as an argument for functions that take 1 arg, this check is only done at startup so it wont slow things down. added support for --- .../gameengine/GameLogic/SCA_PythonController.cpp | 61 +++++++++++++++++----- source/gameengine/GameLogic/SCA_PythonController.h | 2 + 2 files changed, 50 insertions(+), 13 deletions(-) (limited to 'source') diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index d443c1688e4..bf4c2475a64 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -53,6 +53,7 @@ SCA_PythonController::SCA_PythonController(SCA_IObject* gameobj, : SCA_IController(gameobj, T), m_bytecode(NULL), m_function(NULL), + m_function_argc(0), m_bModified(true), m_debug(false), m_mode(mode), @@ -325,14 +326,14 @@ bool SCA_PythonController::Import() Py_XDECREF(m_function); m_function= NULL; - vector module_func = m_scriptText.Explode('.'); + vector py_function_path = m_scriptText.Explode('.'); - if(module_func.size() != 2 || module_func[0].Length()==0 || module_func[1].Length()==0) { - printf("Python module name formatting error \"%s\":\n\texpected \"SomeModule.Func\", got \"%s\"", GetName().Ptr(), m_scriptText.Ptr()); + if(py_function_path.size() < 2) { + printf("Python module name formatting error \"%s\":\n\texpected \"SomeModule.Func\", got \"%s\"\n", GetName().Ptr(), m_scriptText.Ptr()); return false; } - PyObject *mod = PyImport_ImportModule((char *)module_func[0].Ptr()); + PyObject *mod = PyImport_ImportModule((char *)py_function_path[0].Ptr()); if(mod && m_debug) { Py_DECREF(mod); /* getting a new one so dont hold a ref to the old one */ mod= PyImport_ReloadModule(mod); @@ -342,24 +343,50 @@ bool SCA_PythonController::Import() ErrorPrint("Python module not found"); return false; } - Py_DECREF(mod); /* will be added to sys.modules so no need to keep a ref */ + /* 'mod' will be DECREF'd as 'base' + * 'm_function' will be left holding a reference that the controller owns */ + PyObject *base= mod; - PyObject *dict= PyModule_GetDict(mod); - m_function= PyDict_GetItemString(dict, module_func[1]); /* borrow */ + for(unsigned int i=1; i < py_function_path.size(); i++) { + m_function = PyObject_GetAttrString(base, py_function_path[i].Ptr()); + Py_DECREF(base); + base = m_function; /* for the next loop if there is on */ + + if(m_function==NULL) { + PyErr_Clear(); /* print our own error below */ + break; + } + } if(m_function==NULL) { - printf("Python module error \"%s\":\n \"%s\" module fount but function missing\n", GetName().Ptr(), m_scriptText.Ptr()); + printf("Python module error \"%s\":\n \"%s\" module found but function missing\n", GetName().Ptr(), m_scriptText.Ptr()); return false; } if(!PyCallable_Check(m_function)) { - printf("Python module function error \"%s\":\n \"%s\" not callable", GetName().Ptr(), m_scriptText.Ptr()); + Py_DECREF(m_function); + printf("Python module function error \"%s\":\n \"%s\" not callable\n", GetName().Ptr(), m_scriptText.Ptr()); return false; } - Py_INCREF(m_function); - Py_INCREF(mod); + m_function_argc = 0; /* rare cases this could be a function that isnt defined in python, assume zero args */ + if (PyFunction_Check(m_function)) { + PyObject *py_arg_count = PyObject_GetAttrString(PyFunction_GET_CODE(m_function), "co_argcount"); + if(py_arg_count) { + m_function_argc = PyLong_AsLong(py_arg_count); + Py_DECREF(py_arg_count); + } + else { + PyErr_Clear(); /* unlikely to fail but just incase */ + } + } + + if(m_function_argc > 1) { + Py_DECREF(m_function); + printf("Python module function has \"%s\":\n \"%s\" takes %d args, should be zero or 1 controller arg\n", GetName().Ptr(), m_scriptText.Ptr(), m_function_argc); + return false; + } return true; } @@ -412,7 +439,15 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) if (!m_function) return; - resultobj = PyObject_CallObject(m_function, NULL); + PyObject *args= NULL; + + if(m_function_argc==1) { + args = PyTuple_New(1); + PyTuple_SET_ITEM(args, 0, GetProxy()); + } + + resultobj = PyObject_CallObject(m_function, args); + Py_XDECREF(args); break; } @@ -428,7 +463,7 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) else { // something is wrong, tell the user what went wrong - printf("Python script error from controller \"%s\": \n", GetName().Ptr()); + printf("Python script error from controller \"%s\":\n", GetName().Ptr()); PyErr_Print(); /* Added in 2.48a, the last_traceback can reference Objects for example, increasing diff --git a/source/gameengine/GameLogic/SCA_PythonController.h b/source/gameengine/GameLogic/SCA_PythonController.h index 12307632b06..587e6264d8c 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.h +++ b/source/gameengine/GameLogic/SCA_PythonController.h @@ -44,9 +44,11 @@ class SCA_PythonController : public SCA_IController Py_Header; 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; -- cgit v1.2.3 From 490dad89d555458b0fa1f5309b2912115ab94be1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 2 May 2009 19:46:54 +0000 Subject: fix for a painting bug where disabled culling & occlusion would not paint onto backfaces also use the math floating point functions sqrt -> sqrtf, fmod -> fmodf etc. --- source/blender/src/imagepaint.c | 67 +++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 26 deletions(-) (limited to 'source') diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c index b0946e81dce..ad155dc27a1 100644 --- a/source/blender/src/imagepaint.c +++ b/source/blender/src/imagepaint.c @@ -672,8 +672,8 @@ static int project_paint_PickFace(const ProjPaintState *ps, float pt[2], float w static void uvco_to_wrapped_pxco(float uv[2], int ibuf_x, int ibuf_y, float *x, float *y) { /* use */ - *x = (float)fmod(uv[0], 1.0f); - *y = (float)fmod(uv[1], 1.0f); + *x = (float)fmodf(uv[0], 1.0f); + *y = (float)fmodf(uv[1], 1.0f); if (*x < 0.0f) *x += 1.0f; if (*y < 0.0f) *y += 1.0f; @@ -895,7 +895,7 @@ static int line_isect_y(const float p1[2], const float p2[2], const float y_leve return ISECT_TRUE_P2; } - y_diff= fabs(p1[1]-p2[1]); /* yuck, horizontal line, we cant do much here */ + y_diff= fabsf(p1[1]-p2[1]); /* yuck, horizontal line, we cant do much here */ if (y_diff < 0.000001f) { *x_isect = (p1[0]+p2[0]) * 0.5f; @@ -928,7 +928,7 @@ static int line_isect_x(const float p1[2], const float p2[2], const float x_leve return ISECT_TRUE_P2; } - x_diff= fabs(p1[0]-p2[0]); /* yuck, horizontal line, we cant do much here */ + x_diff= fabsf(p1[0]-p2[0]); /* yuck, horizontal line, we cant do much here */ if (x_diff < 0.000001) { /* yuck, vertical line, we cant do much here */ *y_isect = (p1[0]+p2[0]) * 0.5f; @@ -955,11 +955,11 @@ static int line_isect_x(const float p1[2], const float p2[2], const float x_leve static int cmp_uv(const float vec2a[2], const float vec2b[2]) { /* if the UV's are not between 0.0 and 1.0 */ - float xa = (float)fmod(vec2a[0], 1.0f); - float ya = (float)fmod(vec2a[1], 1.0f); + float xa = (float)fmodf(vec2a[0], 1.0f); + float ya = (float)fmodf(vec2a[1], 1.0f); - float xb = (float)fmod(vec2b[0], 1.0f); - float yb = (float)fmod(vec2b[1], 1.0f); + float xb = (float)fmodf(vec2b[0], 1.0f); + float yb = (float)fmodf(vec2b[1], 1.0f); if (xa < 0.0f) xa += 1.0f; if (ya < 0.0f) ya += 1.0f; @@ -967,7 +967,7 @@ static int cmp_uv(const float vec2a[2], const float vec2b[2]) if (xb < 0.0f) xb += 1.0f; if (yb < 0.0f) yb += 1.0f; - return ((fabs(xa-xb) < PROJ_GEOM_TOLERANCE) && (fabs(ya-yb) < PROJ_GEOM_TOLERANCE)) ? 1:0; + return ((fabsf(xa-xb) < PROJ_GEOM_TOLERANCE) && (fabsf(ya-yb) < PROJ_GEOM_TOLERANCE)) ? 1:0; } @@ -1106,7 +1106,7 @@ static float angleToLength(float angle) return 1.0f; } else { - return fabs(1.0f / cos(angle * (M_PI/180.0f))); + return fabsf(1.0f / cosf(angle * (M_PI/180.0f))); } } @@ -1587,7 +1587,7 @@ static int line_clip_rect2f( { /* first account for horizontal, then vertical lines */ /* horiz */ - if (fabs(l1[1]-l2[1]) < PROJ_GEOM_TOLERANCE) { + if (fabsf(l1[1]-l2[1]) < PROJ_GEOM_TOLERANCE) { /* is the line out of range on its Y axis? */ if (l1[1] < rect->ymin || l1[1] > rect->ymax) { return 0; @@ -1598,7 +1598,7 @@ static int line_clip_rect2f( } - if (fabs(l1[0]-l2[0]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/ + if (fabsf(l1[0]-l2[0]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/ if (BLI_in_rctf(rect, l1[0], l1[1])) { VECCOPY2D(l1_clip, l1); VECCOPY2D(l2_clip, l2); @@ -1615,7 +1615,7 @@ static int line_clip_rect2f( CLAMP(l2_clip[0], rect->xmin, rect->xmax); return 1; } - else if (fabs(l1[0]-l2[0]) < PROJ_GEOM_TOLERANCE) { + else if (fabsf(l1[0]-l2[0]) < PROJ_GEOM_TOLERANCE) { /* is the line out of range on its X axis? */ if (l1[0] < rect->xmin || l1[0] > rect->xmax) { return 0; @@ -1626,7 +1626,7 @@ static int line_clip_rect2f( return 0; } - if (fabs(l1[1]-l2[1]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/ + if (fabsf(l1[1]-l2[1]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/ if (BLI_in_rctf(rect, l1[0], l1[1])) { VECCOPY2D(l1_clip, l1); VECCOPY2D(l2_clip, l2); @@ -2111,7 +2111,7 @@ static void project_bucket_clip_face( for(i=0; i<(*tot); i++) { v2_clipSS[0] = isectVCosSS[i][0] - cent[0]; v2_clipSS[1] = isectVCosSS[i][1] - cent[1]; - isectVCosSS[i][2] = atan2(v1_clipSS[0]*v2_clipSS[1] - v1_clipSS[1]*v2_clipSS[0], v1_clipSS[0]*v2_clipSS[0]+v1_clipSS[1]*v2_clipSS[1]); + isectVCosSS[i][2] = atan2f(v1_clipSS[0]*v2_clipSS[1] - v1_clipSS[1]*v2_clipSS[0], v1_clipSS[0]*v2_clipSS[0]+v1_clipSS[1]*v2_clipSS[1]); } if (flip) qsort(isectVCosSS, *tot, sizeof(float)*3, float_z_sort_flip); @@ -2119,7 +2119,7 @@ static void project_bucket_clip_face( /* remove doubles */ /* first/last check */ - if (fabs(isectVCosSS[0][0]-isectVCosSS[(*tot)-1][0]) < PROJ_GEOM_TOLERANCE && fabs(isectVCosSS[0][1]-isectVCosSS[(*tot)-1][1]) < PROJ_GEOM_TOLERANCE) { + if (fabsf(isectVCosSS[0][0]-isectVCosSS[(*tot)-1][0]) < PROJ_GEOM_TOLERANCE && fabsf(isectVCosSS[0][1]-isectVCosSS[(*tot)-1][1]) < PROJ_GEOM_TOLERANCE) { (*tot)--; } @@ -2134,8 +2134,8 @@ static void project_bucket_clip_face( while (doubles==TRUE) { doubles = FALSE; for(i=1; i<(*tot); i++) { - if (fabs(isectVCosSS[i-1][0]-isectVCosSS[i][0]) < PROJ_GEOM_TOLERANCE && - fabs(isectVCosSS[i-1][1]-isectVCosSS[i][1]) < PROJ_GEOM_TOLERANCE) + if (fabsf(isectVCosSS[i-1][0]-isectVCosSS[i][0]) < PROJ_GEOM_TOLERANCE && + fabsf(isectVCosSS[i-1][1]-isectVCosSS[i][1]) < PROJ_GEOM_TOLERANCE) { int j; for(j=i+1; j<(*tot); j++) { @@ -2263,6 +2263,19 @@ int IsectPoly2Df(const float pt[2], float uv[][2], const int tot) return 1; } +static int IsectPoly2Df_twoside(const float pt[2], float uv[][2], const int tot) +{ + int i; + int side = (SIDE_OF_LINE(uv[tot-1], uv[0], pt) > 0.0f); + + for (i=1; i 0.0f) != side) + return 0; + + } + + return 1; +} /* One of the most important function for projectiopn painting, since it selects the pixels to be added into each bucket. * initialize pixels from this face where it intersects with the bucket_index, optionally initialize pixels for removing seams */ @@ -2306,6 +2319,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i float uv_clip[8][2]; int uv_clip_tot; const short is_ortho = ps->is_ortho; + const short do_backfacecull = ps->do_backfacecull; vCo[0] = ps->dm_mvert[mf->v1].co; vCo[1] = ps->dm_mvert[mf->v2].co; @@ -2364,8 +2378,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i v1coSS = ps->screenCoords[ (*(&mf->v1 + i1)) ]; v2coSS = ps->screenCoords[ (*(&mf->v1 + i2)) ]; v3coSS = ps->screenCoords[ (*(&mf->v1 + i3)) ]; - - + /* This funtion gives is a concave polyline in UV space from the clipped quad and tri*/ project_bucket_clip_face( is_ortho, bucket_bounds, @@ -2373,8 +2386,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i uv1co, uv2co, uv3co, uv_clip, &uv_clip_tot ); - - + /* sometimes this happens, better just allow for 8 intersectiosn even though there should be max 6 */ /* if (uv_clip_tot>6) { @@ -2396,7 +2408,10 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i //uv[0] = (((float)x) + 0.5f) / ibuf->x; uv[0] = (float)x / ibuf_xf; /* use pixel offset UV coords instead */ - if (IsectPoly2Df(uv, uv_clip, uv_clip_tot)) { + /* Note about IsectPoly2Df_twoside, checking the face or uv flipping doesnt work, + * could check the poly direction but better to do this */ + if( (do_backfacecull && IsectPoly2Df(uv, uv_clip, uv_clip_tot)) || + (do_backfacecull==0 && IsectPoly2Df_twoside(uv, uv_clip, uv_clip_tot))) { has_x_isect = has_isect = 1; @@ -3689,12 +3704,12 @@ static void *do_projectpaint_thread(void *ph_v) projPixel = (ProjPixel *)node->link; - /*dist = Vec2Lenf(projPixel->projCoSS, pos);*/ /* correct but uses a sqrt */ + /*dist = Vec2Lenf(projPixel->projCoSS, pos);*/ /* correct but uses a sqrtf */ dist_nosqrt = Vec2Lenf_nosqrt(projPixel->projCoSS, pos); - /*if (dist < s->brush->size) {*/ /* correct but uses a sqrt */ + /*if (dist < s->brush->size) {*/ /* correct but uses a sqrtf */ if (dist_nosqrt < brush_size_sqared) { - falloff = brush_sample_falloff_noalpha(ps->brush, sqrt(dist_nosqrt)); + falloff = brush_sample_falloff_noalpha(ps->brush, sqrtf(dist_nosqrt)); if (falloff > 0.0f) { if (ps->is_texbrush) { brush_sample_tex(ps->brush, projPixel->projCoSS, rgba); -- cgit v1.2.3 From 6b0f7c741ec11f5ac63cde6af85efac992787ab4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 2 May 2009 21:11:48 +0000 Subject: [#18191] VSE: when moving a project containing a relative path Audio RAM strip, it is still pointing old file Its a bit silly its not using the name from the file selector alredy (which has been made relative), but this fixes the bug. --- source/blender/src/editseq.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source') diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c index e2211e56fca..5dcfae30960 100644 --- a/source/blender/src/editseq.c +++ b/source/blender/src/editseq.c @@ -1183,6 +1183,10 @@ static Sequence *sfile_to_ramsnd_sequence(SpaceFile *sfile, strncpy(str, sfile->dir, FILE_MAXDIR-1); strncat(str, sfile->file, FILE_MAXFILE-1); + if(sfile->flag & FILE_STRINGCODE) { + BLI_makestringcode(G.sce, str); + } + sound= sound_new_sound(str); if (!sound || sound->sample->type == SAMPLE_INVALID) { error("Unsupported audio format"); -- cgit v1.2.3 From b0ec497f39cb7aa7df1f7936418b443aeefbaade Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 3 May 2009 09:03:47 +0000 Subject: [#18492] Old 3dView painting does't work anymore. use flag the wrong way --- source/blender/src/drawview.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index cd40b5e0ae2..203c9869022 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -978,7 +978,7 @@ void backdrawview3d(int test) #endif if( G.f & G_VERTEXPAINT || G.f & G_WEIGHTPAINT ); - else if ((G.f & G_TEXTUREPAINT) && G.scene->toolsettings && (G.scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_DISABLE)==0); + else if ((G.f & G_TEXTUREPAINT) && G.scene->toolsettings && (G.scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_DISABLE)); else if(G.obedit && G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)); else { G.vd->flag &= ~V3D_NEEDBACKBUFDRAW; -- cgit v1.2.3 From 22b501c7917e8e209aab2dee02101286b7ecc45f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 3 May 2009 09:21:58 +0000 Subject: fixes for bugs submitted by BGE users, fixes by myself and Mitchell Stokes - when the attribute check function failed it didnt set an error raising a SystemError instead - Rasterizer.getMaterialMode would never return KX_BLENDER_MULTITEX_MATERIAL - PropertySensor value attribute checking function was always returning a fail. - Vertex Self Shadow python script didnt update for meshes with modifiers. --- source/gameengine/Expressions/PyObjectPlus.cpp | 4 ++++ source/gameengine/GameLogic/SCA_PropertySensor.cpp | 3 +-- source/gameengine/Ketsji/KX_PythonInit.cpp | 2 +- source/gameengine/Ketsji/KX_SceneActuator.cpp | 4 ++-- source/gameengine/PyDoc/KX_SceneActuator.py | 6 ++++-- 5 files changed, 12 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index e6b49332273..107b12b7159 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -519,6 +519,10 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb { if ((*attrdef->m_checkFunction)(self, attrdef) != 0) { + // if the checing function didnt set an error then set a generic one here so we dont set an error with no exception + if (PyErr_Occurred()==0) + PyErr_Format(PyExc_AttributeError, "type check error for attribute \"%s\", reasion unknown", attrdef->m_name); + // post check returned an error, restore values UNDO_AND_ERROR: if (undoBuffer) diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index c78283db423..e8a291b0a92 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -295,9 +295,8 @@ CValue* SCA_PropertySensor::FindIdentifier(const STR_String& identifiername) int SCA_PropertySensor::validValueForProperty(void *self, const PyAttributeDef*) { - bool result = true; /* There is no type checking at this moment, unfortunately... */ - return result; + return 0; } /* ------------------------------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index afc1fc5d1f8..18fd990dc51 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1004,7 +1004,7 @@ static PyObject* gPyGetMaterialType(PyObject*) { int flag; - if(G.fileflags & (G_FILE_GAME_MAT|G_FILE_GAME_MAT_GLSL)) + if(G.fileflags & G_FILE_GAME_MAT_GLSL) flag = KX_BLENDER_GLSL_MATERIAL; else if(G.fileflags & G_FILE_GAME_MAT) flag = KX_BLENDER_MULTITEX_MATERIAL; diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index eed1bb8027b..64edb6cd6d5 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -363,7 +363,7 @@ const char KX_SceneActuator::SetUseRestart_doc[] = "\tSet flag to 1 to restart the scene.\n" ; PyObject* KX_SceneActuator::PySetUseRestart(PyObject* args) { - ShowDeprecationWarning("setUseRestart()", "(no replacement)"); + ShowDeprecationWarning("setUseRestart()", "the useRestart property"); int boolArg; if (!PyArg_ParseTuple(args, "i:setUseRestart", &boolArg)) @@ -384,7 +384,7 @@ const char KX_SceneActuator::GetUseRestart_doc[] = "\tReturn whether the scene will be restarted.\n" ; PyObject* KX_SceneActuator::PyGetUseRestart() { - ShowDeprecationWarning("getUseRestart()", "(no replacement)"); + ShowDeprecationWarning("getUseRestart()", "the useRestart property"); return PyInt_FromLong(!(m_restart == 0)); } diff --git a/source/gameengine/PyDoc/KX_SceneActuator.py b/source/gameengine/PyDoc/KX_SceneActuator.py index 2429cd6fb80..8e806c2c50e 100644 --- a/source/gameengine/PyDoc/KX_SceneActuator.py +++ b/source/gameengine/PyDoc/KX_SceneActuator.py @@ -18,12 +18,14 @@ class KX_SceneActuator(SCA_IActuator): @ivar camera: the camera to change to. When setting the attribute, you can use either a L{KX_Camera} or the name of the camera. @type camera: L{KX_Camera} on read, string or L{KX_Camera} on write + @ivar useRestart: Set flag to True to restart the sene + @type useRestart: bool @type mode: The mode of the actuator @type mode: int from 0 to 5 L{GameLogic.Scene Actuator} """ def setUseRestart(flag): """ - DEPRECATED + DEPRECATED: use the useRestart property instead Set flag to True to restart the scene. @type flag: boolean @@ -46,7 +48,7 @@ class KX_SceneActuator(SCA_IActuator): """ def getUseRestart(): """ - DEPRECATED + DEPRECATED: use the useRestart property instead Returns True if the scene will be restarted. @rtype: boolean -- cgit v1.2.3 From 12a5c03d1602b478b9f1c23bbc80129a957b0bdb Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 3 May 2009 11:25:09 +0000 Subject: Bugfix #18671 Texture Nodes: the option to use nodes was also visible for textures on world, lamp, brush. Since it only works for Materials now, I've made the button disappear then. --- source/blender/src/buttons_shading.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index a129698cce3..1e4f6dab843 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -1705,7 +1705,8 @@ static void texture_panel_texture(MTex *actmtex, Material *ma, World *wrld, Lamp uiDefButS(block, MENU, B_TEXTYPE, textypes, 160, 125, 140, 25, &tex->type, 0,0,0,0, "Select texture type"); } - uiDefButC(block, TOG, B_TEX_USENODES, "Nodes", 160, 100, 140, 25, &tex->use_nodes, 0.0f, 0.0f, 0, 0, ""); + if(ma) + uiDefButC(block, TOG, B_TEX_USENODES, "Nodes", 160, 100, 140, 25, &tex->use_nodes, 0.0f, 0.0f, 0, 0, ""); } else { -- cgit v1.2.3 From ab3339f3801dcaedff8d4758c40c612cc65e86c9 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 3 May 2009 11:46:57 +0000 Subject: NLA SoC: Initial commit of changes for the way NLA is evaluated * Recoded the flags for NLA-Strips to take into account the new design directions * Modified parts of the evaluation pipeline to reflect this --- source/blender/blenkernel/intern/action.c | 32 +---- source/blender/blenkernel/intern/anim_sys.c | 212 ++++++++++++++++++++-------- source/blender/makesdna/DNA_anim_types.h | 122 ++++++++-------- 3 files changed, 220 insertions(+), 146 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index d54bc749b71..f2e3583c87b 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -717,45 +717,25 @@ static bActionStrip *get_active_strip(Object *ob) return NULL; } -/* non clipped mapping of strip */ -static float get_actionstrip_frame(bActionStrip *strip, float cframe, int invert) -{ - float length, actlength, repeat, scale; - - if (strip->repeat == 0.0f) strip->repeat = 1.0f; - repeat = (strip->flag & ACTSTRIP_USESTRIDE) ? (1.0f) : (strip->repeat); - - if (strip->scale == 0.0f) strip->scale= 1.0f; - scale = (float)fabs(strip->scale); /* scale must be positive (for now) */ - - actlength = strip->actend-strip->actstart; - if (actlength == 0.0f) actlength = 1.0f; - length = repeat * scale * actlength; - - /* invert = convert action-strip time to global time */ - if (invert) - return length*(cframe - strip->actstart)/(repeat*actlength) + strip->start; - else - return repeat*actlength*(cframe - strip->start)/length + strip->actstart; -} - /* if the conditions match, it converts current time to strip time */ +// TODO: change this adt float get_action_frame(Object *ob, float cframe) { bActionStrip *strip= get_active_strip(ob); - if(strip) - return get_actionstrip_frame(strip, cframe, 0); + //if(strip) + // return get_actionstrip_frame(strip, cframe, 0); return cframe; } /* inverted, strip time to current time */ +// TODO: change this to adt float get_action_frame_inv(Object *ob, float cframe) { bActionStrip *strip= get_active_strip(ob); - if(strip) - return get_actionstrip_frame(strip, cframe, 1); + //if(strip) + // return get_actionstrip_frame(strip, cframe, 1); return cframe; } diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 30dcb383ef6..2840e3f5d45 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "MEM_guardedalloc.h" @@ -544,19 +545,17 @@ typedef struct NlaEvalStrip { struct NlaEvalStrip *next, *prev; NlaTrack *track; /* track that this strip belongs to */ - NlaStrip *strip; /* strip that's being used */ - NlaStrip *sblend; /* strip that's being blended towards (if applicable) */ + NlaStrip *strip; /* strip that's being used */ short track_index; /* the index of the track within the list */ short strip_mode; /* which end of the strip are we looking at */ } NlaEvalStrip; -/* bNlaEvalStrip->strip_mode */ +/* NlaEvalStrip->strip_mode */ enum { NES_TIME_BEFORE = -1, NES_TIME_WITHIN, NES_TIME_AFTER, - NES_TIME_AFTER_BLEND } eNlaEvalStrip_StripMode; @@ -565,8 +564,9 @@ enum { typedef struct NlaEvalChannel { struct NlaEvalChannel *next, *prev; - char *path; /* ready-to-use path (i.e. remapped already) */ - int array_index; /* if applicable... */ + PointerRNA *ptr; /* pointer to struct containing property to use */ + PropertyRNA *prop; /* RNA-property type to use (should be in the struct given) */ + int index; /* array index (where applicable) */ float value; /* value of this channel */ } NlaEvalChannel; @@ -574,24 +574,98 @@ typedef struct NlaEvalChannel { /* ---------------------- */ -/* evaluate the F-Curves controlling settings for the NLA-strips (currently, not relinkable) */ -static void nlastrip_evaluate_fcurves (NlaStrip *strip, float ctime) +/* non clipped mapping for strip-time <-> global time + * invert = convert action-strip time to global time + */ +static float nlastrip_get_frame (NlaStrip *strip, float cframe, short invert) { - //PointerRNA actstrip_ptr; - //FCurve *fcu; + float length, actlength, repeat, scale; + + /* get number of repeats */ + if (strip->repeat == 0.0f) strip->repeat = 1.0f; + repeat = strip->repeat; + + /* scaling */ + if (strip->scale == 0.0f) strip->scale= 1.0f; + scale = (float)fabs(strip->scale); /* scale must be positive - we've got a special flag for reversing */ - /* create RNA-pointer needed to set values */ - //RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &actstrip_ptr); + /* length of referenced action */ + actlength = strip->actend-strip->actstart; + if (actlength == 0.0f) actlength = 1.0f; - /* execute these settings as per normal */ - //animsys_evaluate_fcurves(&actstrip_ptr, &strip->fcurves, NULL, ctime); + /* length of strip */ + length = repeat * scale * actlength; + + /* reversed = play strip backwards */ + if (strip->flag & NLASTRIP_FLAG_REVERSE) { + // FIXME: verify these + /* invert = convert action-strip time to global time */ + if (invert) + return length*(strip->actend - cframe)/(repeat*actlength) + strip->start; + else + return strip->actend - repeat*actlength*(cframe - strip->start)/length; + } + else { + /* invert = convert action-strip time to global time */ + if (invert) + return length*(cframe - strip->actstart)/(repeat*actlength) + strip->start; + else + return repeat*actlength*(cframe - strip->start)/length + strip->actstart; + } +} + +/* calculate influence of strip based for given frame based on blendin/out values */ +static float nlastrip_get_influence (NlaStrip *strip, float cframe) +{ + /* sanity checks - normalise the blendin/out values? */ + strip->blendin= (float)fabs(strip->blendin); + strip->blendout= (float)fabs(strip->blendout); + + /* result depends on where frame is in respect to blendin/out values */ + // TODO: are the fabs() tests needed here? + if (IS_EQ(strip->blendin, 0)==0 && (cframe <= (strip->start + strip->blendin))) { + /* there is some blend-in */ + return (float)fabs(cframe - strip->start) / (strip->blendin); + } + else if (IS_EQ(strip->blendout, 0)==0 && (cframe >= (strip->end - strip->blendout))) { + /* there is some blend-out */ + return (float)fabs(strip->end - cframe) / (strip->blendout); + } + else { + /* in the middle of the strip, we should be full strength */ + return 1.0f; + } +} + +/* evaluate the evaluation time and influence for the strip, storing the results in the strip */ +void nlastrip_evaluate_controls (NlaStrip *strip, float cframe) +{ + /* firstly, analytically generate values for influence and time (if applicable) */ + if ((strip->flag & NLASTRIP_FLAG_USR_TIME) == 0) + strip->strip_time= nlastrip_get_frame(strip, cframe, 1); /* last arg '1' means current time to 'strip'/action time */ + if ((strip->flag & NLASTRIP_FLAG_USR_INFLUENCE) == 0) + strip->influence= nlastrip_get_influence(strip, cframe); + + /* now strip's evaluate F-Curves for these settings (if applicable) */ + if (strip->fcurves.first) { +#if 0 + PointerRNA strip_ptr; + FCurve *fcu; + + /* create RNA-pointer needed to set values */ + RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &strip_ptr); + + /* execute these settings as per normal */ + animsys_evaluate_fcurves(&actstrip_ptr, &strip->fcurves, NULL, ctime); +#endif + } } -/* gets the strip active at the current time for a track */ +/* gets the strip active at the current time for a track for evaluation purposes */ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index, float ctime) { - NlaStrip *strip, *astrip=NULL, *bstrip=NULL; + NlaStrip *strip, *estrip=NULL; NlaEvalStrip *nes; short side= 0; @@ -601,71 +675,91 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index /* loop over strips, checking if they fall within the range */ for (strip= nlt->strips.first; strip; strip= strip->next) { - /* only consider if: - * - current time occurs within strip's extents - * - current time occurs before strip (if it is the first) - * - current time occurs after strip (if hold is on) - * - current time occurs between strips (1st of those isn't holding) - blend! - */ + /* check if current time occurs within this strip */ if (IN_RANGE(ctime, strip->start, strip->end)) { - astrip= strip; + /* this strip is active, so try to use it */ + estrip= strip; side= NES_TIME_WITHIN; break; } - else if (ctime < strip->start) { + + /* if time occurred before current strip... */ + if (ctime < strip->start) { if (strip == nlt->strips.first) { - astrip= strip; + /* before first strip - only try to use it if it extends backwards in time too */ + if (strip->extendmode == NLASTRIP_EXTEND_HOLD) + estrip= strip; + + /* side is 'before' regardless of whether there's a useful strip */ side= NES_TIME_BEFORE; - break; } else { - astrip= strip->prev; + /* before next strip - previous strip has ended, but next hasn't begun, + * so blending mode depends on whether strip is being held or not... + * - only occurs when no transition strip added, otherwise the transition would have + * been picked up above... + */ + strip= strip->prev; - if (astrip->flag & NLASTRIP_HOLDLASTFRAME) { - side= NES_TIME_AFTER; - break; - } - else { - bstrip= strip; - side= NES_TIME_AFTER_BLEND; - break; - } + if (strip->extendmode != NLASTRIP_EXTEND_NOTHING) + estrip= strip; + side= NES_TIME_AFTER; + } + break; + } + + /* if time occurred after current strip... */ + if (ctime > strip->end) { + /* only if this is the last strip should we do anything, and only if that is being held */ + if (strip == nlt->strips.last) { + if (strip->extendmode != NLASTRIP_EXTEND_NOTHING) + estrip= strip; + + side= NES_TIME_AFTER; + break; } + + /* otherwise, skip... as the 'before' case will catch it more elegantly! */ } } - /* check if strip has been found (and whether it has data worth considering) */ - if (ELEM(NULL, astrip, astrip->act)) - return; - if (astrip->flag & NLASTRIP_MUTE) + /* check if a valid strip was found + * - must not be muted (i.e. will have contribution + */ + if ((estrip == NULL) || (estrip->flag & NLASTRIP_FLAG_MUTED)) return; - /* check if blending between strips */ - if (side == NES_TIME_AFTER_BLEND) { - /* blending between strips... so calculate influence+act_time of both */ - nlastrip_evaluate_fcurves(astrip, ctime); - nlastrip_evaluate_fcurves(bstrip, ctime); - - if ((astrip->influence <= 0.0f) && (bstrip->influence <= 0.0f)) - return; - } - else { - /* calculate/set the influence+act_time of this strip - don't consider if 0 influence */ - nlastrip_evaluate_fcurves(astrip, ctime); + /* evaluate strip's evaluation controls + * - skip if no influence (i.e. same effect as muting the strip) + * - negative influence is not supported yet... how would that be defined? + */ + // TODO: this sounds a bit hacky having a few isolated F-Curves stuck on some data it operates on... + nlastrip_evaluate_controls(estrip, ctime); + if (estrip->influence <= 0.0f) + return; - if (astrip->influence <= 0.0f) - return; + /* check if strip has valid data to evaluate */ + switch (estrip->type) { + case NLASTRIP_TYPE_CLIP: + /* clip must have some action to evaluate */ + if (estrip->act == NULL) + return; + break; + case NLASTRIP_TYPE_TRANSITION: + /* there must be strips to transition from and to (i.e. prev and next required) */ + // TODO: what happens about cross-track transitions? + if (ELEM(NULL, estrip->prev, estrip->next)) + return; + break; } - - /* allocate new eval-strip for this strip + add to stack */ + /* add to list of strips we need to evaluate */ nes= MEM_callocN(sizeof(NlaEvalStrip), "NlaEvalStrip"); nes->track= nlt; - nes->strip= astrip; - nes->sblend= bstrip; - nes->track_index= index; + nes->strip= estrip; nes->strip_mode= side; + nes->track_index= index; BLI_addtail(list, nes); } diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index d015d703309..7ca3110912d 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -360,26 +360,13 @@ typedef struct AnimMapper { /* ************************************************ */ /* NLA - Non-Linear Animation */ -// TODO: the concepts here still need to be refined to solve any unresolved items - -/* NLA Modifiers ---------------------------------- */ - -/* These differ from F-Curve modifiers, as although F-Curve modifiers also operate on a - * per-channel basis too (in general), they are part of the animation data itself, which - * means that their effects are inherited by all of their users. In order to counteract this, - * the modifiers here should be used to provide variation to pre-created motions only. - */ /* NLA Strips ------------------------------------- */ /* NLA Strip (strip) * * A NLA Strip is a container for the reuse of Action data, defining parameters - * to control the remapping of the Action data to some destination. Actions being - * referenced by NLA-Strips SHOULD-NOT be editable, unless they were created in such - * a way that results in very little mapping distortion (i.e. for layered animation only, - * opposed to prebuilt 'blocks' which are quickly dumped into the NLA for crappymatic machima-type - * stuff) + * to control the remapping of the Action data to some destination. */ typedef struct NlaStrip { struct NlaStrip *next, *prev; @@ -387,58 +374,75 @@ typedef struct NlaStrip { bAction *act; /* Action that is referenced by this strip */ AnimMapper *remap; /* Remapping info this strip (for tweaking correspondance of action with context) */ - ListBase modifiers; /* NLA Modifiers */ - - ListBase fcurves; /* F-Curves for controlling this strip's influence and timing */ + ListBase fcurves; /* F-Curves for controlling this strip's influence and timing */ // TODO: move out? + ListBase modifiers; /* F-Curve modifiers to be applied to the entire strip's referenced F-Curves */ float influence; /* Influence of strip */ - float act_time; /* Current 'time' within action being used */ + float strip_time; /* Current 'time' within action being used (automatically evaluated, but can be overridden) */ float start, end; /* extents of the strip */ float actstart, actend; /* range of the action to use */ - float repeat; /* The number of times to repeat the action range (only when no F-Curves) */ - float scale; /* The amount the action range is scaled by (only when no F-Curves) */ + float repeat; /* The number of times to repeat the action range (only when no F-Curves) */ + float scale; /* The amount the action range is scaled by (only when no F-Curves) */ float blendin, blendout; /* strip blending length (only used when there are no F-Curves) */ - int blendmode; /* strip blending mode */ - - int flag; /* settings */ - - // umm... old unused cruft? - int stride_axis; /* axis for stridebone stuff - 0=x, 1=y, 2=z */ - int pad; - - float actoffs; /* Offset within action, for cycles and striding (only set for ACT_USESTRIDE) */ - float stridelen; /* The stridelength (considered when flag & ACT_USESTRIDE) */ + short blendmode; /* strip blending mode (layer-based mixing) */ + short extendmode; /* strip extrapolation mode (time-based mixing) */ - char stridechannel[32]; /* Instead of stridelen, it uses an action channel */ - char offs_bone[32]; /* if repeat, use this bone/channel for defining offset */ + short flag; /* settings */ + short type; /* type of NLA strip */ } NlaStrip; /* NLA Strip Blending Mode */ enum { - NLASTRIPMODE_BLEND = 0, - NLASTRIPMODE_ADD, - NLASTRIPMODE_SUBTRACT, -} eActStrip_Mode; + NLASTRIP_MODE_BLEND = 0, + NLASTRIP_MODE_ADD, + NLASTRIP_MODE_SUBTRACT, + NLASTRIP_MODE_MULTIPLY, +} eNlaStrip_Blend_Mode; + +/* NLA Strip Extrpolation Mode */ +enum { + /* extend before first frame if no previous strips in track, and always hold+extend last frame */ + NLASTRIP_EXTEND_HOLD = 0, + /* only hold+extend last frame */ + NLASTRIP_EXTEND_HOLD_FORWARD, + /* don't contribute at all */ + NLASTRIP_EXTEND_NOTHING, +} eNlaStrip_Extrapolate_Mode; /* NLA Strip Settings */ -// TODO: check on which of these are still useful... enum { - NLASTRIP_SELECT = (1<<0), - NLASTRIP_USESTRIDE = (1<<1), - NLASTRIP_BLENDTONEXT = (1<<2), /* Not implemented. Is not used anywhere */ - NLASTRIP_HOLDLASTFRAME = (1<<3), - NLASTRIP_ACTIVE = (1<<4), - NLASTRIP_LOCK_ACTION = (1<<5), - NLASTRIP_MUTE = (1<<6), - NLASTRIP_REVERSE = (1<<7), /* This has yet to be implemented. To indicate that a strip should be played backwards */ - NLASTRIP_CYCLIC_USEX = (1<<8), - NLASTRIP_CYCLIC_USEY = (1<<9), - NLASTRIP_CYCLIC_USEZ = (1<<10), - NLASTRIP_AUTO_BLENDS = (1<<11), - NLASTRIP_TWEAK = (1<<12), /* This strip is a tweaking strip (only set if owner track is a tweak track) */ -} eActionStrip_Flag; + /* UI selection flags */ + /* NLA strip is the active one in the track (also indicates if strip is being tweaked) */ + NLASTRIP_FLAG_ACTIVE = (1<<0), + /* NLA strip is selected for editing */ + NLASTRIP_FLAG_SELECT = (1<<1), +// NLASTRIP_FLAG_SELECT_L = (1<<2), // left handle selected +// NLASTRIP_FLAG_SELECT_R = (1<<3), // right handle selected + + /* controls driven by local F-Curves */ + /* strip influence is controlled by local F-Curve */ + NLASTRIP_FLAG_USR_INFLUENCE = (1<<5), + NLASTRIP_FLAG_USR_TIME = (1<<6), + + /* playback flags (may be overriden by F-Curves) */ + /* NLA strip blendin/out values are set automatically based on overlaps */ + NLASTRIP_FLAG_AUTO_BLENDS = (1<<10), + /* NLA strip is played back in reverse order */ + NLASTRIP_FLAG_REVERSE = (1<<11), + /* NLA strip is muted (i.e. doesn't contribute in any way) */ + // TODO: this overlaps a lot with the functionality in track + NLASTRIP_FLAG_MUTED = (1<<12), +} eNlaStrip_Flag; + +/* NLA Strip Type */ +enum { + /* 'clip' - references an Action */ + NLASTRIP_TYPE_CLIP = 0, + /* 'transition' - blends between the adjacent strips */ + NLASTRIP_TYPE_TRANSITION, +} eNlaStrip_Type; /* NLA Tracks ------------------------------------- */ @@ -457,14 +461,12 @@ typedef struct NlaTrack { int flag; /* settings for this track */ int index; /* index of the track in the stack (NOTE: not really useful, but we need a pad var anyways!) */ - char info[64]; /* short user-description of this track */ + char name[64]; /* short user-description of this track */ } NlaTrack; /* settings for track */ enum { - /* track is the one that settings can be modified on (doesn't indicate - * that it's for 'tweaking' though) - */ + /* track is the one that settings can be modified on, also indicates if track is being 'tweaked' */ NLATRACK_ACTIVE = (1<<0), /* track is selected in UI for relevant editing operations */ NLATRACK_SELECTED = (1<<1), @@ -474,10 +476,6 @@ enum { NLATRACK_SOLO = (1<<3), /* track's settings (and strips) cannot be edited (to guard against unwanted changes) */ NLATRACK_PROTECTED = (1<<4), - /* strip is the 'last' one that should be evaluated, as the active action - * is being used to tweak the animation of the strips up to here - */ - NLATRACK_TWEAK = (1<<5), } eNlaTrack_Flag; @@ -650,11 +648,13 @@ enum { ADT_NLA_SOLO_TRACK = (1<<0), /* don't use NLA */ ADT_NLA_EVAL_OFF = (1<<1), - /* don't execute drivers */ - ADT_DRIVERS_DISABLED = (1<<2), + /* NLA is being 'tweaked' (i.e. in EditMode) */ + ADT_NLA_EDIT_ON = (1<<2), /* drivers expanded in UI */ ADT_DRIVERS_COLLAPSED = (1<<10), + /* don't execute drivers */ + ADT_DRIVERS_DISABLED = (1<<11), } eAnimData_Flag; /* Animation Data recalculation settings (to be set by depsgraph) */ -- cgit v1.2.3 From b89126dbe85501c54d9041ce5e4adb5c626d9c04 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 3 May 2009 12:06:43 +0000 Subject: Bugfix #18676 Map a texture to Material Ambient factor didn't work. Probably not since 2.42 or so... :) --- source/blender/render/intern/source/texture.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source') diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 61e9d9cf412..d41f68c021a 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -2031,6 +2031,10 @@ void do_material_tex(ShadeInput *shi) shi->amb= texture_value_blend(mtex->def_var, shi->amb, texres.tin, varfac, mtex->blendtype, flip); if(shi->amb<0.0) shi->amb= 0.0; else if(shi->amb>1.0) shi->amb= 1.0; + + shi->ambr= shi->amb*R.wrld.ambr; + shi->ambg= shi->amb*R.wrld.ambg; + shi->ambb= shi->amb*R.wrld.ambb; } } } -- cgit v1.2.3 From c35299363fe411537f4e579e9c449233a4e6b412 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 3 May 2009 13:17:37 +0000 Subject: Fix for bug #18659: glsl math material node, "tangent" option didn't work. --- source/blender/nodes/intern/SHD_nodes/SHD_math.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_math.c b/source/blender/nodes/intern/SHD_nodes/SHD_math.c index 050c2cdcc95..645f95686d7 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_math.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_math.c @@ -197,7 +197,7 @@ bNodeStack **out) static int gpu_shader_math(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) { static char *names[] = {"math_add", "math_subtract", "math_multiply", - "math_divide", "math_sine", "math_cosine", "math_tangnet", "math_asin", + "math_divide", "math_sine", "math_cosine", "math_tangent", "math_asin", "math_acos", "math_atan", "math_pow", "math_log", "math_min", "math_max", "math_round", "math_less_than", "math_greater_than"}; -- cgit v1.2.3 From 56b8ce2ec17ea555dc2042ab3d843384b9d1e7cd Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 3 May 2009 13:22:26 +0000 Subject: Bugfix 18671 revisted Node editor didn't support editing non-material texture node trees. Campbell pointed me to fact it's been used already, like for brush painting. However, this only worked via linking the texture to a material... hackish stuff. Now the Node Editor supports all other Textures too, with three extra icon buttons to define which. - Active Object: for textures linked to Materials or Lamps - World: textures from Scene world. - Brush: textures from active Brush The latter can only be set and used when in Paint or Sculpt mode: - Paint mode: in Image window, Paint Tool panel, set active brush - Sculpt mode: in EditButtons, Texture panel, select empty slot, add texture. Note that refreshes of previews in Node Editor is not always happening on switching contextes. Just click a socket to refresh view. --- source/blender/makesdna/DNA_space_types.h | 8 +++++- source/blender/src/buttons_shading.c | 3 +-- source/blender/src/editnode.c | 41 ++++++++++++++++++++++++++----- source/blender/src/header_node.c | 21 +++++++++++++++- 4 files changed, 63 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 735e1c4f195..d14acc12693 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -356,7 +356,8 @@ typedef struct SpaceNode { float xof, yof; /* offset for drawing the backdrop */ struct bNodeTree *nodetree, *edittree; - int treetype, pad; /* treetype: as same nodetree->type */ + int treetype; /* treetype: as same nodetree->type */ + short texfrom, pad; /* texfrom object, world or brush */ struct bGPdata *gpd; /* grease-pencil data */ } SpaceNode; @@ -366,6 +367,11 @@ typedef struct SpaceNode { #define SNODE_BACKDRAW 2 #define SNODE_DISPGP 4 +/* snode->texfrom */ +#define SNODE_TEX_OBJECT 0 +#define SNODE_TEX_WORLD 1 +#define SNODE_TEX_BRUSH 2 + typedef struct SpaceImaSel { SpaceLink *next, *prev; int spacetype; diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 1e4f6dab843..a129698cce3 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -1705,8 +1705,7 @@ static void texture_panel_texture(MTex *actmtex, Material *ma, World *wrld, Lamp uiDefButS(block, MENU, B_TEXTYPE, textypes, 160, 125, 140, 25, &tex->type, 0,0,0,0, "Select texture type"); } - if(ma) - uiDefButC(block, TOG, B_TEX_USENODES, "Nodes", 160, 100, 140, 25, &tex->use_nodes, 0.0f, 0.0f, 0, 0, ""); + uiDefButC(block, TOG, B_TEX_USENODES, "Nodes", 160, 100, 140, 25, &tex->use_nodes, 0.0f, 0.0f, 0, 0, ""); } else { diff --git a/source/blender/src/editnode.c b/source/blender/src/editnode.c index f5de20891b4..f0046a960e9 100644 --- a/source/blender/src/editnode.c +++ b/source/blender/src/editnode.c @@ -35,6 +35,7 @@ #include "MEM_guardedalloc.h" #include "DNA_action_types.h" +#include "DNA_brush_types.h" #include "DNA_color_types.h" #include "DNA_image_types.h" #include "DNA_ipo_types.h" @@ -583,13 +584,41 @@ void snode_set_context(SpaceNode *snode) snode->nodetree= G.scene->nodetree; } else if(snode->treetype==NTREE_TEXTURE) { - if(ob) { - Tex *tx= give_current_texture(ob, ob->actcol); - if(tx) { - snode->from= (ID*)ob; /* please check this; i have no idea what 'from' is. */ - snode->id= &tx->id; - snode->nodetree= tx->nodetree; + Tex *tx= NULL; + + if(snode->texfrom==SNODE_TEX_OBJECT) { + if(ob) { + tx= give_current_texture(ob, ob->actcol); + snode->from= (ID *)ob; + } + } + else if(snode->texfrom==SNODE_TEX_WORLD) { + tx= give_current_world_texture(); + snode->from= (ID *)G.scene->world; + } + else { + MTex *mtex= NULL; + + if(G.f & G_SCULPTMODE) { + SculptData *sd= &G.scene->sculptdata; + if(sd->texact != -1) + mtex= sd->mtex[sd->texact]; } + else { + Brush *br= G.scene->toolsettings->imapaint.brush; + if(br) + mtex= br->mtex[br->texact]; + } + + if(mtex) { + snode->from= (ID *)G.scene; + tx= mtex->tex; + } + } + + if(tx) { + snode->id= &tx->id; + snode->nodetree= tx->nodetree; } } diff --git a/source/blender/src/header_node.c b/source/blender/src/header_node.c index 2bd028766d1..c23913bb97c 100644 --- a/source/blender/src/header_node.c +++ b/source/blender/src/header_node.c @@ -756,8 +756,26 @@ void node_buttons(ScrArea *sa) uiDefIconButI(block, ROW, B_REDR, ICON_TEXTURE_DEHLT, xco,2,XIC,YIC-2, &(snode->treetype), 2, 2, 0, 0, "Texture Nodes"); xco+= 2*XIC; + uiBlockEndAlign(block); + if(snode->treetype==NTREE_TEXTURE) { + + uiBlockBeginAlign(block); + uiDefIconButS(block, ROW, B_REDR, ICON_OBJECT, xco,2,XIC,YIC-2, + &(snode->texfrom), 3, SNODE_TEX_OBJECT, 0, 0, "Texture Nodes from Object"); + xco+= XIC; + uiDefIconButS(block, ROW, B_REDR, ICON_WORLD_DEHLT, xco,2,XIC,YIC-2, + &(snode->texfrom), 3, SNODE_TEX_WORLD, 0, 0, "Texture Nodes from World"); + xco+= XIC; + uiDefIconButS(block, ROW, B_REDR, ICON_TPAINT_DEHLT, xco,2,XIC,YIC-2, + &(snode->texfrom), 3, SNODE_TEX_BRUSH, 0, 0, "Texture Nodes from Active Brush or Sculpt Data"); + xco+= 2*XIC; + + uiBlockEndAlign(block); + + } + /* find and set the context */ snode_set_context(snode); @@ -785,8 +803,9 @@ void node_buttons(ScrArea *sa) else if(snode->treetype==NTREE_TEXTURE) { if(snode->from) { + /* can't use unlink etc here, code requires buttons context */ xco= std_libbuttons(block, xco, 0, 0, NULL, B_TEXBROWSE, ID_TE, 1, snode->id, snode->from, &(snode->menunr), - B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA); + 0, 0, 0, B_AUTOTEXNAME, B_KEEPDATA); if(snode->id) { Tex *tx= (Tex *)snode->id; -- cgit v1.2.3 From 03a0770df57835ca3551642fc6ba879bdde9564a Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 3 May 2009 17:48:32 +0000 Subject: Bugfix #17929 Old bug (2.42): when using node material, transparent shadow did not work. It was missing to set the proper 'pass flag'. Do note an important difference with non-node materials for 'transparent shadow'. If there are no nodes, it uses the color from the unshaded material. When it has nodes, it uses the color output from the entire node tree, which is typically from shaded materials. The latter is because node shaders have no support for shade passes yet (it only outputs rgb + a). --- source/blender/render/intern/source/rayshade.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index c6dd8d6890e..97ac8666181 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -262,13 +262,14 @@ static void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr) shade_input_set_shade_texco(shi); - if(is->mode==RE_RAY_SHADOW_TRA) + if(is->mode==RE_RAY_SHADOW_TRA) { if(shi->mat->nodetree && shi->mat->use_nodes) { ntreeShaderExecTree(shi->mat->nodetree, shi, shr); shi->mat= vlr->mat; /* shi->mat is being set in nodetree */ } else shade_color(shi, shr); + } else { if(shi->mat->nodetree && shi->mat->use_nodes) { ntreeShaderExecTree(shi->mat->nodetree, shi, shr); @@ -1292,15 +1293,8 @@ static void ray_trace_shadow_tra(Isect *is, int thread, int depth, int traflag) shi.depth= 1; /* only used to indicate tracing */ shi.mask= 1; shi.thread= thread; - - /*shi.osatex= 0; - shi.thread= shi.sample= 0; - shi.lay= 0; - shi.passflag= 0; - shi.combinedflag= 0; - shi.do_preview= 0; - shi.light_override= NULL; - shi.mat_override= NULL;*/ + shi.passflag= SCE_PASS_COMBINED; + shi.combinedflag= 0xFFFFFF; /* ray trace does all options */ shade_ray(is, &shi, &shr); if (traflag & RAY_TRA) -- cgit v1.2.3 From 8a83aff9f56c5b8f8240847835578f1a23e2e9cf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 3 May 2009 17:52:03 +0000 Subject: [#18678] Swizzle properties for Mathutils.Vector patch from Alex Fraser (z0r) eg. - vec.xyz = vec.zyx - vec.xy = vec.zw - vec.xxy = vec.wzz - vec.yzyz = vec.yxyx See http://en.wikipedia.org/wiki/Swizzling_(computer_graphics) made some minor modifications to this patch. tested access times and adding 336 attributes to vectors doesn't make a noticeable differences to speed of existing axis attributes (x,y,z,w) - thanks to python dict lookups. --- source/blender/python/BPY_interface.c | 2 + source/blender/python/api2_2x/Mathutils.c | 15 +- source/blender/python/api2_2x/Mathutils.h | 2 + source/blender/python/api2_2x/doc/Mathutils.py | 17 +- source/blender/python/api2_2x/vector.c | 311 ++++++++++++++++++++++++- source/blender/python/api2_2x/vector.h | 4 + source/gameengine/Ketsji/KX_PythonInit.cpp | 3 + 7 files changed, 347 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index d86c317ee7e..1c98d6a5a59 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -286,6 +286,8 @@ void BPY_end_python( void ) free_libblock( &G.main->script, script ); } + Mathutils_Free(NULL); + Py_Finalize( ); BPyMenu_RemoveAllEntries( ); /* freeing bpymenu mem */ diff --git a/source/blender/python/api2_2x/Mathutils.c b/source/blender/python/api2_2x/Mathutils.c index 9c73ca16e70..83a58193a8b 100644 --- a/source/blender/python/api2_2x/Mathutils.c +++ b/source/blender/python/api2_2x/Mathutils.c @@ -107,6 +107,11 @@ struct PyMethodDef M_Mathutils_methods[] = { /*----------------------------MODULE INIT-------------------------*/ /* from can be Blender.Mathutils or GameLogic.Mathutils for the BGE */ +void Mathutils_Free(void * closure) +{ + Vector_Free(); +} + #if (PY_VERSION_HEX >= 0x03000000) static struct PyModuleDef M_Mathutils_module_def = { {}, /* m_base */ @@ -117,7 +122,7 @@ static struct PyModuleDef M_Mathutils_module_def = { 0, /* m_reload */ 0, /* m_traverse */ 0, /* m_clear */ - 0, /* m_free */ + Mathutils_Free, /* m_free */ }; #endif @@ -126,10 +131,13 @@ PyObject *Mathutils_Init(const char *from) PyObject *submodule; //seed the generator for the rand function - BLI_srand((unsigned int) (PIL_check_seconds_timer() * - 0x7FFFFFFF)); + BLI_srand((unsigned int) (PIL_check_seconds_timer() * 0x7FFFFFFF)); /* needed for getseters */ + if(!(vector_Type.tp_flags & Py_TPFLAGS_READY)) + if (Vector_Init() != 0) /* setup dynamic getset array */ + return NULL; + if( PyType_Ready( &vector_Type ) < 0 ) return NULL; if( PyType_Ready( &matrix_Type ) < 0 ) @@ -147,6 +155,7 @@ PyObject *Mathutils_Init(const char *from) return (submodule); } + //-----------------------------METHODS---------------------------- //----------------column_vector_multiplication (internal)--------- //COLUMN VECTOR Multiplication (Matrix X Vector) diff --git a/source/blender/python/api2_2x/Mathutils.h b/source/blender/python/api2_2x/Mathutils.h index 7406c5c4810..ec6c3f548d9 100644 --- a/source/blender/python/api2_2x/Mathutils.h +++ b/source/blender/python/api2_2x/Mathutils.h @@ -38,6 +38,8 @@ #include "euler.h" PyObject *Mathutils_Init( const char * from ); +void Mathutils_Free(void *); + PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat); PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec); PyObject *quat_rotation(PyObject *arg1, PyObject *arg2); diff --git a/source/blender/python/api2_2x/doc/Mathutils.py b/source/blender/python/api2_2x/doc/Mathutils.py index 524d1fb6d4c..fc0c4ed10fa 100644 --- a/source/blender/python/api2_2x/doc/Mathutils.py +++ b/source/blender/python/api2_2x/doc/Mathutils.py @@ -400,6 +400,7 @@ class Vector: The Vector object ================= This object gives access to Vectors in Blender. + @group Axises: x, y, z, w @ivar x: The x value. @ivar y: The y value. @ivar z: The z value (if any). @@ -420,6 +421,16 @@ class Vector: - -vec @note: You can access a vector object like a sequence - x = vector[0] + - vec_a[:] vec_b + - vec2d[:] vec3d[:2] + @note: Vectors support 'swizzle' operations + - vec.xyz = vec.zyx + - vec.xy = vec.zw + - vec.xxy = vec.wzz + - vec.yzyz = vec.yxyx + + See U{http://en.wikipedia.org/wiki/Swizzling_(computer_graphics)} + @attention: Vector data can be wrapped or non-wrapped. When a object is wrapped it means that the object will give you direct access to the data inside of blender. Modification of this object will directly change the data inside of blender. To copy a wrapped object @@ -535,6 +546,7 @@ class Euler: The Euler object ================ This object gives access to Eulers in Blender. + @group Axises: x, y, z, w @ivar x: The heading value in degrees. @ivar y: The pitch value in degrees. @ivar z: The roll value in degrees. @@ -596,7 +608,7 @@ class Euler: """ Return a matrix representation of the euler. @rtype: Matrix object - @return: A roation matrix representation of the euler. + @return: A 3x3 roation matrix representation of the euler. """ def toQuat(): @@ -611,6 +623,7 @@ class Quaternion: The Quaternion object ===================== This object gives access to Quaternions in Blender. + @group Axises: x, y, z, w @ivar w: The w value. @ivar x: The x value. @ivar y: The y value. @@ -716,7 +729,7 @@ class Quaternion: """ Return a matrix representation of the quaternion. @rtype: Matrix object - @return: A rotation matrix representation of the quaternion. + @return: A 3x3 rotation matrix representation of the quaternion. """ class Matrix: diff --git a/source/blender/python/api2_2x/vector.c b/source/blender/python/api2_2x/vector.c index dd53cca9054..bef2917b0fa 100644 --- a/source/blender/python/api2_2x/vector.c +++ b/source/blender/python/api2_2x/vector.c @@ -20,7 +20,7 @@ * All rights reserved. * * - * Contributor(s): Willian P. Germano & Joseph Gilbert, Ken Hughes + * Contributor(s): Willian P. Germano, Joseph Gilbert, Ken Hughes, Alex Fraser, Campbell Barton * * ***** END GPL LICENSE BLOCK ***** */ @@ -31,6 +31,24 @@ #include "BKE_utildefines.h" #include "BLI_arithb.h" +#define MAX_DIMENSIONS 4 +/* Swizzle axes get packed into a single value that is used as a closure. Each + axis uses SWIZZLE_BITS_PER_AXIS bits. The first bit (SWIZZLE_VALID_AXIS) is + used as a sentinel: if it is unset, the axis is not valid. */ +#define SWIZZLE_BITS_PER_AXIS 3 +#define SWIZZLE_VALID_AXIS 0x4 +#define SWIZZLE_AXIS 0x3 + + +/* An array of getseters, some of which have members on the stack and some on + the heap. + + Vector_dyn_getseters: The getseter structures. Terminated with a NULL sentinel. + Vector_dyn_names: All the names of the getseters that were allocated on the heap. + Each name is terminated with a null character, but there is + currently no way to find the length of this array. */ +PyGetSetDef* Vector_dyn_getseters = NULL; +char* Vector_dyn_names = NULL; /*-------------------------DOC STRINGS ---------------------------*/ char Vector_Zero_doc[] = "() - set all values in the vector to 0"; @@ -42,6 +60,7 @@ char Vector_Resize4D_doc[] = "() - resize a vector to [x,y,z,w]"; char Vector_ToTrackQuat_doc[] = "(track, up) - extract a quaternion from the vector and the track and up axis"; char Vector_reflect_doc[] = "(mirror) - return a vector reflected on the mirror normal"; char Vector_copy_doc[] = "() - return a copy of the vector"; +char Vector_swizzle_doc[] = "Swizzle: Get or set axes in specified order"; /*-----------------------METHOD DEFINITIONS ----------------------*/ struct PyMethodDef Vector_methods[] = { {"zero", (PyCFunction) Vector_Zero, METH_NOARGS, Vector_Zero_doc}, @@ -1121,7 +1140,287 @@ static PyGetSetDef Vector_getseters[] = { {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ }; +/* Get a new Vector according to the provided swizzle. This function has little + error checking, as we are in control of the inputs: the closure is set by us + in Vector_createSwizzleGetSeter. */ +static PyObject *Vector_getSwizzle(VectorObject * self, void *closure) +{ + size_t axisA; + size_t axisB; + float vec[MAX_DIMENSIONS]; + unsigned int swizzleClosure; + + /* Unpack the axes from the closure into an array. */ + axisA = 0; + swizzleClosure = (unsigned int) closure; + while (swizzleClosure & SWIZZLE_VALID_AXIS) + { + axisB = swizzleClosure & SWIZZLE_AXIS; + vec[axisA] = self->vec[axisB]; + swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS; + axisA++; + } + + return newVectorObject(vec, axisA, Py_NEW); +} + +/* Set the items of this vector using a swizzle. + - If value is a vector or list this operates like an array copy, except that + the destination is effectively re-ordered as defined by the swizzle. At + most min(len(source), len(dest)) values will be copied. + - If the value is scalar, it is copied to all axes listed in the swizzle. + - If an axis appears more than once in the swizzle, the final occurrance is + the one that determines its value. + + Returns 0 on success and -1 on failure. On failure, the vector will be + unchanged. */ +static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closure) +{ + VectorObject *vecVal; + PyObject *item; + size_t listLen; + float scalarVal; + + size_t axisB; + size_t axisA; + unsigned int swizzleClosure; + + float vecTemp[MAX_DIMENSIONS]; + + /* Check that the closure can be used with this vector: even 2D vectors have + swizzles defined for axes z and w, but they would be invalid. */ + swizzleClosure = (unsigned int) closure; + while (swizzleClosure & SWIZZLE_VALID_AXIS) + { + axisA = swizzleClosure & SWIZZLE_AXIS; + if (axisA >= self->size) + { + PyErr_SetString(PyExc_AttributeError, "Error: vector does not have specified axis.\n"); + return -1; + } + swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS; + } + + if (VectorObject_Check(value)) + { + /* Copy vector contents onto swizzled axes. */ + vecVal = (VectorObject*) value; + axisB = 0; + swizzleClosure = (unsigned int) closure; + while (swizzleClosure & SWIZZLE_VALID_AXIS && axisB < vecVal->size) + { + axisA = swizzleClosure & SWIZZLE_AXIS; + vecTemp[axisA] = vecVal->vec[axisB]; + + swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS; + axisB++; + } + memcpy(self->vec, vecTemp, axisB * sizeof(float)); + return 0; + } + else if (PyList_Check(value)) + { + /* Copy list contents onto swizzled axes. */ + listLen = PyList_Size(value); + swizzleClosure = (unsigned int) closure; + axisB = 0; + while (swizzleClosure & SWIZZLE_VALID_AXIS && axisB < listLen) + { + item = PyList_GetItem(value, axisB); + if (!PyNumber_Check(item)) + { + PyErr_SetString(PyExc_AttributeError, "Error: vector does not have specified axis.\n"); + return -1; + } + scalarVal = (float)PyFloat_AsDouble(item); + + axisA = swizzleClosure & SWIZZLE_AXIS; + vecTemp[axisA] = scalarVal; + + swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS; + axisB++; + } + memcpy(self->vec, vecTemp, axisB * sizeof(float)); + return 0; + } + else if (PyNumber_Check(value)) + { + /* Assign the same value to each axis. */ + scalarVal = (float)PyFloat_AsDouble(value); + swizzleClosure = (unsigned int) closure; + while (swizzleClosure & SWIZZLE_VALID_AXIS) + { + axisA = swizzleClosure & SWIZZLE_AXIS; + self->vec[axisA] = scalarVal; + + swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS; + } + return 0; + } + else + { + PyErr_SetString( PyExc_TypeError, "Expected a Vector, list or scalar value." ); + return -1; + } +} + +/* Create a getseter that operates on the axes defined in swizzle. + Parameters: + gsd: An empty PyGetSetDef object. This will be modified. + swizzle: An array of axis indices. + dimensions: The number of axes to swizzle. Must be >= 2 and <= + MAX_DIMENSIONS. + name: A pointer to string that the name will be stored in. This is + purely to reduce the number of allocations. Before this function + returns, name will be advanced to the point immediately after + the name of the new getseter. Therefore, do not attempt to read + its contents. */ +static void Vector_createSwizzleGetSeter +( + PyGetSetDef *gsd, + unsigned short *swizzle, + size_t dimensions, + char **name +) +{ + const char axes[] = {'x', 'y', 'z', 'w'}; + unsigned int closure; + int i; + + /* Convert the index array into named axes. Store the name in the string + that was passed in, and make the getseter structure point to the same + address. */ + gsd->name = *name; + for (i = 0; i < dimensions; i++) + gsd->name[i] = axes[swizzle[i]]; + gsd->name[i] = '\0'; + /* Advance the name pointer to the next available address. */ + (*name) = (*name) + dimensions + 1; + + gsd->get = (getter)Vector_getSwizzle; + gsd->set = (setter)Vector_setSwizzle; + + gsd->doc = Vector_swizzle_doc; + + /* Pack the axes into a single value to use as the closure. Pack these in + in reverse so they come out in the right order when unpacked. */ + closure = 0; + for (i = MAX_DIMENSIONS - 1; i >= 0; i--) + { + closure = closure << SWIZZLE_BITS_PER_AXIS; + if (i < dimensions) + closure = closure | swizzle[i] | SWIZZLE_VALID_AXIS; + } + gsd->closure = (void*) closure; +} + +/* Create and append all implicit swizzle getseters to an existing array of + getseters. + Parameters: + Vector_getseters: + A null-terminated array of getseters that have been manually + defined. + resGds: The resultant array of getseters. This will be a combination of + static and manually-defined getseters. Use Vector_DelGetseters + to free this array. + + Returns: 0 on success, -1 on failure. On failure, resGsd will be left + untouched. */ +static int Vector_AppendSwizzleGetseters(void) +{ + int len; + int len_orig; + int len_names; + unsigned int i; + unsigned short swizzle[MAX_DIMENSIONS]; + char *name; + + /* Count the explicit getseters. */ + for (len_orig = 0; Vector_getseters[len_orig].name != NULL; len_orig++); + + /* Then there are 4^4 + 4^3 + 4^2 = 336 swizzles. */ + len = len_orig + 336 + 1; /* Plus one sentinel. */ + + /* That means 4^4 names of length 4 + 1, 4^3 names of length 3 + 1, and 4^2 + names of length 2 + 1 (including a null character at the end of each) + = (4^4) * 5 + (4^3) * 4 + (4^2) * 3 + = 1584 */ + len_names = 1584; + + if(Vector_dyn_getseters) { /* Should never happen */ + PyMem_Del(Vector_dyn_getseters); + Vector_dyn_getseters= NULL; + } + Vector_dyn_getseters = PyMem_New(PyGetSetDef, len * sizeof(PyGetSetDef)); + if (Vector_dyn_getseters == NULL) { + PyErr_SetString(PyExc_MemoryError, "Could not allocate memory for swizzle getseters."); + return -1; + } + memset(Vector_dyn_getseters, 0, len * sizeof(PyGetSetDef)); + + if(Vector_dyn_names) { /* Should never happen */ + PyMem_Del(Vector_dyn_names); + Vector_dyn_getseters= NULL; + } + Vector_dyn_names = PyMem_New(char, len_names * sizeof(char)); + if (Vector_dyn_names == NULL) { + PyErr_SetString(PyExc_MemoryError, "Could not allocate memory for swizzle getseter names."); + PyMem_Del(Vector_dyn_getseters); + return -1; + } + memset(Vector_dyn_names, 0, len_names * sizeof(char)); + + /* Do a shallow copy of the getseters. A deep clone can't be done because + we don't know how much memory each closure needs. */ + memcpy(Vector_dyn_getseters, Vector_getseters, len_orig * sizeof(PyGetSetDef)); + + /* Create the swizzle functions. The pointer for name will be advanced by + Vector_createSwizzleGetSeter. */ + name = Vector_dyn_names; + i = len_orig; + for (swizzle[0] = 0; swizzle[0] < MAX_DIMENSIONS; swizzle[0]++) + { + for (swizzle[1] = 0; swizzle[1] < MAX_DIMENSIONS; swizzle[1]++) + { + Vector_createSwizzleGetSeter(&Vector_dyn_getseters[i++], swizzle, 2, &name); + for (swizzle[2] = 0; swizzle[2] < MAX_DIMENSIONS; swizzle[2]++) + { + Vector_createSwizzleGetSeter(&Vector_dyn_getseters[i++], swizzle, 3, &name); + for (swizzle[3] = 0; swizzle[3] < MAX_DIMENSIONS; swizzle[3]++) + { + Vector_createSwizzleGetSeter(&Vector_dyn_getseters[i++], swizzle, 4, &name); + } + } + } + } + + /* No need to add a sentinel - memory was initialised to zero above. */ + vector_Type.tp_getset = Vector_dyn_getseters; + + return 0; +} +/* Delete an array of getseters that was created by + Vector_AppendSwizzleGetseters. It is safe to call this even if the structure + members are NULL. */ +static void Vector_DelGetseters(void) +{ + /* Free strings that were allocated on the heap. */ + if (Vector_dyn_names != NULL) { + PyMem_Del(Vector_dyn_names); + Vector_dyn_names = NULL; + } + + /* Free the structure arrays themselves. */ + if (Vector_dyn_getseters != NULL) { + PyMem_Del(Vector_dyn_getseters); + Vector_dyn_getseters = NULL; + } + + /* for the blenderplayer that will initialize multiple times :| */ + vector_Type.tp_getset = Vector_getseters; + vector_Type.tp_flags = 0; /* maybe python does this when finalizing? - wont hurt anyway */ +} /* Note Py_TPFLAGS_CHECKTYPES allows us to avoid casting all types to Vector when coercing @@ -1189,7 +1488,7 @@ PyTypeObject vector_Type = { /*** Attribute descriptor and subclassing stuff ***/ Vector_methods, /* struct PyMethodDef *tp_methods; */ NULL, /* struct PyMemberDef *tp_members; */ - Vector_getseters, /* struct PyGetSetDef *tp_getset; */ + Vector_getseters, /* struct PyGetSetDef *tp_getset; */ NULL, /* struct _typeobject *tp_base; */ NULL, /* PyObject *tp_dict; */ NULL, /* descrgetfunc tp_descr_get; */ @@ -1268,3 +1567,11 @@ PyObject *Vector_Negate(VectorObject * self) /*################################################################### ###########################DEPRECATED##############################*/ +int Vector_Init(void) +{ + return Vector_AppendSwizzleGetseters(); +} + +void Vector_Free() { + Vector_DelGetseters(); +} diff --git a/source/blender/python/api2_2x/vector.h b/source/blender/python/api2_2x/vector.h index 9ec2eff8047..16a4a1f462a 100644 --- a/source/blender/python/api2_2x/vector.h +++ b/source/blender/python/api2_2x/vector.h @@ -43,6 +43,10 @@ typedef struct { short wrapped; /* is wrapped data? */ } VectorObject; +void Vector_Free(void); +int Vector_Init(void); + + /*prototypes*/ PyObject *Vector_Zero( VectorObject * self ); PyObject *Vector_Normalize( VectorObject * self ); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 18fd990dc51..e4252b55fb1 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1708,6 +1708,9 @@ void exitGamePlayerPythonScripting() /* since python restarts we cant let the python backup of the sys.path hang around in a global pointer */ restorePySysPath(); /* get back the original sys.path and clear the backup */ + /* Modules that need freeing */ + Mathutils_Free(NULL); + Py_Finalize(); bpy_import_main_set(NULL); } -- cgit v1.2.3 From d85bbb8070f5d37c58694d8cb1378b4439b7eda8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 3 May 2009 19:47:13 +0000 Subject: on second thought its less trouble to make a python script that makes all the getset's in the array, apologies to Alex for suggesting this be dynamic :/ included python script to print out getsets as a comment --- source/blender/python/BPY_interface.c | 2 - source/blender/python/api2_2x/Mathutils.c | 12 +- source/blender/python/api2_2x/Mathutils.h | 1 - source/blender/python/api2_2x/vector.c | 620 +++++++++++++++++++---------- source/blender/python/api2_2x/vector.h | 4 - source/gameengine/Ketsji/KX_PythonInit.cpp | 3 - 6 files changed, 413 insertions(+), 229 deletions(-) (limited to 'source') diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index 1c98d6a5a59..1f35ebad9f7 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -285,8 +285,6 @@ void BPY_end_python( void ) next_script = script->id.next; free_libblock( &G.main->script, script ); } - - Mathutils_Free(NULL); Py_Finalize( ); diff --git a/source/blender/python/api2_2x/Mathutils.c b/source/blender/python/api2_2x/Mathutils.c index 83a58193a8b..8f99723e12d 100644 --- a/source/blender/python/api2_2x/Mathutils.c +++ b/source/blender/python/api2_2x/Mathutils.c @@ -107,11 +107,6 @@ struct PyMethodDef M_Mathutils_methods[] = { /*----------------------------MODULE INIT-------------------------*/ /* from can be Blender.Mathutils or GameLogic.Mathutils for the BGE */ -void Mathutils_Free(void * closure) -{ - Vector_Free(); -} - #if (PY_VERSION_HEX >= 0x03000000) static struct PyModuleDef M_Mathutils_module_def = { {}, /* m_base */ @@ -122,7 +117,7 @@ static struct PyModuleDef M_Mathutils_module_def = { 0, /* m_reload */ 0, /* m_traverse */ 0, /* m_clear */ - Mathutils_Free, /* m_free */ + 0, /* m_free */ }; #endif @@ -133,11 +128,6 @@ PyObject *Mathutils_Init(const char *from) //seed the generator for the rand function BLI_srand((unsigned int) (PIL_check_seconds_timer() * 0x7FFFFFFF)); - /* needed for getseters */ - if(!(vector_Type.tp_flags & Py_TPFLAGS_READY)) - if (Vector_Init() != 0) /* setup dynamic getset array */ - return NULL; - if( PyType_Ready( &vector_Type ) < 0 ) return NULL; if( PyType_Ready( &matrix_Type ) < 0 ) diff --git a/source/blender/python/api2_2x/Mathutils.h b/source/blender/python/api2_2x/Mathutils.h index ec6c3f548d9..b511f2046a6 100644 --- a/source/blender/python/api2_2x/Mathutils.h +++ b/source/blender/python/api2_2x/Mathutils.h @@ -38,7 +38,6 @@ #include "euler.h" PyObject *Mathutils_Init( const char * from ); -void Mathutils_Free(void *); PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat); PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec); diff --git a/source/blender/python/api2_2x/vector.c b/source/blender/python/api2_2x/vector.c index bef2917b0fa..f4504a13f72 100644 --- a/source/blender/python/api2_2x/vector.c +++ b/source/blender/python/api2_2x/vector.c @@ -39,17 +39,6 @@ #define SWIZZLE_VALID_AXIS 0x4 #define SWIZZLE_AXIS 0x3 - -/* An array of getseters, some of which have members on the stack and some on - the heap. - - Vector_dyn_getseters: The getseter structures. Terminated with a NULL sentinel. - Vector_dyn_names: All the names of the getseters that were allocated on the heap. - Each name is terminated with a null character, but there is - currently no way to find the length of this array. */ -PyGetSetDef* Vector_dyn_getseters = NULL; -char* Vector_dyn_names = NULL; - /*-------------------------DOC STRINGS ---------------------------*/ char Vector_Zero_doc[] = "() - set all values in the vector to 0"; char Vector_Normalize_doc[] = "() - normalize the vector"; @@ -1105,41 +1094,6 @@ static PyObject *Vector_getWrapped( VectorObject * self, void *type ) } -/*****************************************************************************/ -/* Python attributes get/set structure: */ -/*****************************************************************************/ -static PyGetSetDef Vector_getseters[] = { - {"x", - (getter)Vector_getAxis, (setter)Vector_setAxis, - "Vector X axis", - (void *)'X'}, - {"y", - (getter)Vector_getAxis, (setter)Vector_setAxis, - "Vector Y axis", - (void *)'Y'}, - {"z", - (getter)Vector_getAxis, (setter)Vector_setAxis, - "Vector Z axis", - (void *)'Z'}, - {"w", - (getter)Vector_getAxis, (setter)Vector_setAxis, - "Vector Z axis", - (void *)'W'}, - {"length", - (getter)Vector_getLength, (setter)Vector_setLength, - "Vector Length", - NULL}, - {"magnitude", - (getter)Vector_getLength, (setter)Vector_setLength, - "Vector Length", - NULL}, - {"wrapped", - (getter)Vector_getWrapped, (setter)NULL, - "True when this wraps blenders internal data", - NULL}, - {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ -}; - /* Get a new Vector according to the provided swizzle. This function has little error checking, as we are in control of the inputs: the closure is set by us in Vector_createSwizzleGetSeter. */ @@ -1264,163 +1218,422 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur } } -/* Create a getseter that operates on the axes defined in swizzle. - Parameters: - gsd: An empty PyGetSetDef object. This will be modified. - swizzle: An array of axis indices. - dimensions: The number of axes to swizzle. Must be >= 2 and <= - MAX_DIMENSIONS. - name: A pointer to string that the name will be stored in. This is - purely to reduce the number of allocations. Before this function - returns, name will be advanced to the point immediately after - the name of the new getseter. Therefore, do not attempt to read - its contents. */ -static void Vector_createSwizzleGetSeter -( - PyGetSetDef *gsd, - unsigned short *swizzle, - size_t dimensions, - char **name -) -{ - const char axes[] = {'x', 'y', 'z', 'w'}; - unsigned int closure; - int i; - - /* Convert the index array into named axes. Store the name in the string - that was passed in, and make the getseter structure point to the same - address. */ - gsd->name = *name; - for (i = 0; i < dimensions; i++) - gsd->name[i] = axes[swizzle[i]]; - gsd->name[i] = '\0'; - /* Advance the name pointer to the next available address. */ - (*name) = (*name) + dimensions + 1; - - gsd->get = (getter)Vector_getSwizzle; - gsd->set = (setter)Vector_setSwizzle; - - gsd->doc = Vector_swizzle_doc; +/*****************************************************************************/ +/* Python attributes get/set structure: */ +/*****************************************************************************/ +static PyGetSetDef Vector_getseters[] = { + {"x", + (getter)Vector_getAxis, (setter)Vector_setAxis, + "Vector X axis", + (void *)'X'}, + {"y", + (getter)Vector_getAxis, (setter)Vector_setAxis, + "Vector Y axis", + (void *)'Y'}, + {"z", + (getter)Vector_getAxis, (setter)Vector_setAxis, + "Vector Z axis", + (void *)'Z'}, + {"w", + (getter)Vector_getAxis, (setter)Vector_setAxis, + "Vector Z axis", + (void *)'W'}, + {"length", + (getter)Vector_getLength, (setter)Vector_setLength, + "Vector Length", + NULL}, + {"magnitude", + (getter)Vector_getLength, (setter)Vector_setLength, + "Vector Length", + NULL}, + {"wrapped", + (getter)Vector_getWrapped, (setter)NULL, + "True when this wraps blenders internal data", + NULL}, - /* Pack the axes into a single value to use as the closure. Pack these in - in reverse so they come out in the right order when unpacked. */ - closure = 0; - for (i = MAX_DIMENSIONS - 1; i >= 0; i--) - { - closure = closure << SWIZZLE_BITS_PER_AXIS; - if (i < dimensions) - closure = closure | swizzle[i] | SWIZZLE_VALID_AXIS; - } - gsd->closure = (void*) closure; -} + /* autogenerated swizzle attrs, see python script below */ + {"xx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, Vector_swizzle_doc, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<= 2: + + for axis_0 in axises: + axis_0_pos = axis_pos[axis_0] + for axis_1 in axises: + axis_1_pos = axis_pos[axis_1] + axis_dict[axis_0+axis_1] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<2: + for axis_2 in axises: + axis_2_pos = axis_pos[axis_2] + axis_dict[axis_0+axis_1+axis_2] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<3: + for axis_3 in axises: + axis_3_pos = axis_pos[axis_3] + axis_dict[axis_0+axis_1+axis_2+axis_3] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)< Date: Sun, 3 May 2009 20:47:29 +0000 Subject: fix for a problem with setUV2 reported by cthames on blenderartist http://blenderartists.org/forum/showpost.php?p=1369757&postcount=35 there was an undocumented second arg but may as well allow a single vector arg like setUV() --- source/gameengine/Ketsji/KX_VertexProxy.cpp | 5 +++-- source/gameengine/PyDoc/KX_VertexProxy.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index 93ff35b5a9d..6563d0446eb 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -435,9 +435,10 @@ PyObject* KX_VertexProxy::PyGetUV2() PyObject* KX_VertexProxy::PySetUV2(PyObject* args) { MT_Point2 vec; - unsigned int unit=0; + unsigned int unit= RAS_TexVert::SECOND_UV; + PyObject* list= NULL; - if(!PyArg_ParseTuple(args, "Oi:setUV2", &list, &unit)) + if(!PyArg_ParseTuple(args, "O|i:setUV2", &list, &unit)) return NULL; if (!PyVecTo(list, vec)) diff --git a/source/gameengine/PyDoc/KX_VertexProxy.py b/source/gameengine/PyDoc/KX_VertexProxy.py index 114e0d88075..75bd4d788a6 100644 --- a/source/gameengine/PyDoc/KX_VertexProxy.py +++ b/source/gameengine/PyDoc/KX_VertexProxy.py @@ -86,11 +86,13 @@ class KX_VertexProxy(SCA_IObject): @rtype: list [u, v] @return: this vertexes UV (texture) coordinates. """ - def setUV2(uv): + def setUV2(uv, unit): """ Sets the 2nd UV (texture) coordinates of this vertex. @type uv: list [u, v] + @param unit: optional argument, FLAT==1, SECOND_UV==2, defaults to SECOND_UV + @param unit: int """ def getRGBA(): """ -- cgit v1.2.3 From 20888482aed16df7da3e2b3736306799e5601036 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 3 May 2009 21:42:39 +0000 Subject: BGE: fix a crash with previous scene destruction speed up commit when sensors and controllers are cross connected between objects. --- source/gameengine/GameLogic/SCA_LogicManager.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/GameLogic/SCA_LogicManager.cpp b/source/gameengine/GameLogic/SCA_LogicManager.cpp index 0b549ded474..c43875a0047 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.cpp +++ b/source/gameengine/GameLogic/SCA_LogicManager.cpp @@ -193,10 +193,20 @@ void SCA_LogicManager::RemoveSensor(SCA_ISensor* sensor) void SCA_LogicManager::RemoveController(SCA_IController* controller) { + sensormap_t::iterator sit; + sit = m_sensorcontrollermapje.begin(); + if (sit==m_sensorcontrollermapje.end()) + { + //TRICK: either there is no sensor at all, or the scene is being deleted + //(see KX_Scene::~KX_Scene()). In the first case, this is harmless. + //In the second case, we cannot rely on the sensor being still available, + //make the controller inactive to avoid link count. + //Need a better solution, maybe something similar to m_removedActuators. + controller->SetActive(false); + } controller->UnlinkAllSensors(); controller->UnlinkAllActuators(); - sensormap_t::iterator sit; - for (sit = m_sensorcontrollermapje.begin();!(sit==m_sensorcontrollermapje.end());++sit) + for (;!(sit==m_sensorcontrollermapje.end());++sit) { (*sit).second.remove(controller); } -- cgit v1.2.3 From 2aa3c932d00977a70bc299bd709fa505c48518d8 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 3 May 2009 21:51:57 +0000 Subject: BGE performance: use inline function as much as possible in scenegraph and logic to avoid function call. --- source/gameengine/Expressions/Value.cpp | 38 -------------------- source/gameengine/Expressions/Value.h | 47 ++++++++++++++++++++++--- source/gameengine/GameLogic/SCA_IActuator.cpp | 7 ---- source/gameengine/GameLogic/SCA_IActuator.h | 6 +++- source/gameengine/GameLogic/SCA_ILogicBrick.cpp | 31 ---------------- source/gameengine/GameLogic/SCA_ILogicBrick.h | 15 ++++++-- source/gameengine/GameLogic/SCA_IObject.cpp | 45 ----------------------- source/gameengine/GameLogic/SCA_IObject.h | 27 ++++++++++---- source/gameengine/Ketsji/KX_GameObject.h | 5 --- 9 files changed, 81 insertions(+), 140 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index c50a941f3a9..a811b39d790 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -453,50 +453,12 @@ double* CValue::GetVector3(bool bGetTransformedVec) /*--------------------------------------------------------------------------------------------------------------------- Reference Counting ---------------------------------------------------------------------------------------------------------------------*/ -// -// Add a reference to this value -// -CValue *CValue::AddRef() -{ - // Increase global reference count, used to see at the end of the program - // if all CValue-derived classes have been dereferenced to 0 - //debug(gRefCountValue++); -#ifdef _DEBUG - //gRefCountValue++; -#endif - m_refcount++; - return this; -} // // Release a reference to this value (when reference count reaches 0, the value is removed from the heap) // -int CValue::Release() -{ - // Decrease global reference count, used to see at the end of the program - // if all CValue-derived classes have been dereferenced to 0 - //debug(gRefCountValue--); -#ifdef _DEBUG - //gRefCountValue--; -#endif - // Decrease local reference count, if it reaches 0 the object should be freed - if (--m_refcount > 0) - { - // Reference count normal, return new reference count - return m_refcount; - } - else - { - // Reference count reached 0, delete ourselves and return 0 -// MT_assert(m_refcount==0, "Reference count reached sub-zero, object released too much"); - - delete this; - return 0; - } - -} diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index fca603a831e..c5c8229ebcf 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -259,10 +259,49 @@ public: }; /// Reference Counting - int GetRefCount() { return m_refcount; } - virtual CValue* AddRef(); // Add a reference to this value - virtual int Release(); // Release a reference to this value (when reference count reaches 0, the value is removed from the heap) - + int GetRefCount() + { + return m_refcount; + } + + // Add a reference to this value + CValue* AddRef() + { + // Increase global reference count, used to see at the end of the program + // if all CValue-derived classes have been dereferenced to 0 + //debug(gRefCountValue++); + #ifdef _DEBUG + //gRefCountValue++; + #endif + m_refcount++; + return this; + } + + // Release a reference to this value (when reference count reaches 0, the value is removed from the heap) + int Release() + { + // Decrease global reference count, used to see at the end of the program + // if all CValue-derived classes have been dereferenced to 0 + //debug(gRefCountValue--); + #ifdef _DEBUG + //gRefCountValue--; + #endif + // Decrease local reference count, if it reaches 0 the object should be freed + if (--m_refcount > 0) + { + // Reference count normal, return new reference count + return m_refcount; + } + else + { + // Reference count reached 0, delete ourselves and return 0 + // MT_assert(m_refcount==0, "Reference count reached sub-zero, object released too much"); + + delete this; + return 0; + } + } + /// Property Management virtual void SetProperty(const STR_String& name,CValue* ioProperty); // Set property , overwrites and releases a previous property with the same name if needed diff --git a/source/gameengine/GameLogic/SCA_IActuator.cpp b/source/gameengine/GameLogic/SCA_IActuator.cpp index 3d4ad3aec3a..214c7dded76 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.cpp +++ b/source/gameengine/GameLogic/SCA_IActuator.cpp @@ -44,13 +44,6 @@ SCA_IActuator::SCA_IActuator(SCA_IObject* gameobj, -void SCA_IActuator::AddEvent(CValue* event) -{ - m_events.push_back(event); -} - - - void SCA_IActuator::RemoveAllEvents() { // remove event queue! for (vector::iterator i=m_events.begin(); !(i==m_events.end());i++) diff --git a/source/gameengine/GameLogic/SCA_IActuator.h b/source/gameengine/GameLogic/SCA_IActuator.h index 51bd6454d92..e5f0a2cf4cc 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.h +++ b/source/gameengine/GameLogic/SCA_IActuator.h @@ -75,7 +75,11 @@ public: /** * Add an event to an actuator. */ - void AddEvent(CValue* event); + void AddEvent(CValue* event) + { + m_events.push_back(event); + } + virtual void ProcessReplica(); /** diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index c138ae46283..6de9986b03a 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -71,13 +71,6 @@ void SCA_ILogicBrick::SetUeberExecutePriority(int execute_Priority) -SCA_IObject* SCA_ILogicBrick::GetParent() -{ - return m_gameobj; -} - - - void SCA_ILogicBrick::ReParent(SCA_IObject* parent) { m_gameobj = parent; @@ -142,14 +135,6 @@ void SCA_ILogicBrick::SetName(STR_String name) m_name = name; } - -bool SCA_ILogicBrick::IsActive() -{ - return m_bActive; -} - - - bool SCA_ILogicBrick::LessComparedTo(SCA_ILogicBrick* other) { return (this->m_Execute_Ueber_Priority < other->m_Execute_Ueber_Priority) @@ -157,22 +142,6 @@ bool SCA_ILogicBrick::LessComparedTo(SCA_ILogicBrick* other) (this->m_Execute_Priority < other->m_Execute_Priority)); } - - -void SCA_ILogicBrick::SetActive(bool active) -{ - m_bActive=active; - if (active) - { - //m_gameobj->SetDebugColor(GetDrawColor()); - } else - { - //m_gameobj->ResetDebugColor(); - } -} - - - void SCA_ILogicBrick::RegisterEvent(CValue* eventval) { if (m_eventval) diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index b8c6772fe8d..b1384e88826 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -59,7 +59,8 @@ public: void SetExecutePriority(int execute_Priority); void SetUeberExecutePriority(int execute_Priority); - SCA_IObject* GetParent(); + SCA_IObject* GetParent() { return m_gameobj; } + virtual void ReParent(SCA_IObject* parent); virtual void Relink(GEN_Map *obj_map); virtual void Delete() { Release(); } @@ -73,8 +74,16 @@ public: virtual STR_String GetName(); virtual void SetName(STR_String name); - bool IsActive(); - void SetActive(bool active) ; + bool IsActive() + { + return m_bActive; + } + + void SetActive(bool active) + { + m_bActive=active; + } + virtual bool LessComparedTo(SCA_ILogicBrick* other); diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index b3c4708978d..7eaa5c607be 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -79,29 +79,6 @@ SCA_IObject::~SCA_IObject() //} } - - -SCA_ControllerList& SCA_IObject::GetControllers() -{ - return m_controllers; -} - - - -SCA_SensorList& SCA_IObject::GetSensors() -{ - return m_sensors; -} - - - -SCA_ActuatorList& SCA_IObject::GetActuators() -{ - return m_actuators; -} - - - void SCA_IObject::AddSensor(SCA_ISensor* act) { act->AddRef(); @@ -143,20 +120,6 @@ void SCA_IObject::UnregisterActuator(SCA_IActuator* act) } } -void SCA_IObject::SetIgnoreActivityCulling(bool b) -{ - m_ignore_activity_culling = b; -} - - - -bool SCA_IObject::GetIgnoreActivityCulling() -{ - return m_ignore_activity_culling; -} - - - void SCA_IObject::ReParentLogic() { SCA_ActuatorList& oldactuators = GetActuators(); @@ -256,14 +219,6 @@ SCA_IActuator* SCA_IObject::FindActuator(const STR_String& actuatorname) -void SCA_IObject::SetCurrentTime(float currentTime) { - //T_InterpolatorList::iterator i; - //for (i = m_interpolators.begin(); !(i == m_interpolators.end()); ++i) { - // (*i)->Execute(currentTime); - //} -} - - #if 0 const MT_Point3& SCA_IObject::ConvertPythonPylist(PyObject* pylist) { diff --git a/source/gameengine/GameLogic/SCA_IObject.h b/source/gameengine/GameLogic/SCA_IObject.h index 7f63c9f5efd..10cf551aeb6 100644 --- a/source/gameengine/GameLogic/SCA_IObject.h +++ b/source/gameengine/GameLogic/SCA_IObject.h @@ -83,9 +83,18 @@ public: SCA_IObject(PyTypeObject* T=&Type); virtual ~SCA_IObject(); - SCA_ControllerList& GetControllers(); - SCA_SensorList& GetSensors(); - SCA_ActuatorList& GetActuators(); + SCA_ControllerList& GetControllers() + { + return m_controllers; + } + SCA_SensorList& GetSensors() + { + return m_sensors; + } + SCA_ActuatorList& GetActuators() + { + return m_actuators; + } void AddSensor(SCA_ISensor* act); void AddController(SCA_IController* act); @@ -97,20 +106,26 @@ public: SCA_IActuator* FindActuator(const STR_String& actuatorname); SCA_IController* FindController(const STR_String& controllername); - void SetCurrentTime(float currentTime); + void SetCurrentTime(float currentTime) {} void ReParentLogic(); /** * Set whether or not to ignore activity culling requests */ - void SetIgnoreActivityCulling(bool b); + void SetIgnoreActivityCulling(bool b) + { + m_ignore_activity_culling = b; + } /** * Set whether or not this object wants to ignore activity culling * requests */ - bool GetIgnoreActivityCulling(); + bool GetIgnoreActivityCulling() + { + return m_ignore_activity_culling; + } /** * Suspend all progress. diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 14ed713ecfa..bbb1b8bb360 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -192,11 +192,6 @@ public: ~KX_GameObject( ); - CValue* - AddRef() { - /* temporarily to find memleaks */ return CValue::AddRef(); - } - /** * @section Stuff which is here due to poor design. * Inherited from CValue and needs an implementation. -- cgit v1.2.3 From 3abb8e8e68c824db7cecdf2360e8e1daaff00413 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 3 May 2009 22:29:00 +0000 Subject: BGE performance: second round of scenegraph improvement. Use dynamic linked list to handle scenegraph rather than dumb scan of the whole tree. The performance improvement depends on the fraction of moving objects. If most objects are static, the speed up is considerable. The following table compares the time spent on scenegraph before and after this commit on a scene with 10000 objects in various configuratons: Scenegraph time (ms) Before After (includes culling) All objects static, 8.8 1.7 all visible but small fraction in the view frustrum All objects static, 7,5 0.01 all invisible. All objects moving, 14.1 8.4 all visible but small fraction in the view frustrum This tables shows that static and invisible objects take no CPU at all for scenegraph and culling. In the general case, this commit will speed up the scenegraph between 2x and 5x. Compared to 2.48a, it should be between 4x and 10x faster. Further speed up is possible by making the scenegraph cache-friendly. Next round of performance improvement will be on the rasterizer: use the same dynamic linked list technique for the mesh slots. --- .../Converter/BL_BlenderDataConversion.cpp | 4 +- .../Ketsji/KX_SG_BoneParentNodeRelationship.cpp | 4 +- .../gameengine/Ketsji/KX_SG_NodeRelationships.cpp | 10 +- source/gameengine/Ketsji/KX_Scene.cpp | 40 ++++- source/gameengine/Ketsji/KX_Scene.h | 7 + source/gameengine/SceneGraph/SG_DList.h | 147 +++++++++++++++++ source/gameengine/SceneGraph/SG_IObject.cpp | 92 ++--------- source/gameengine/SceneGraph/SG_IObject.h | 129 +++++++++++---- source/gameengine/SceneGraph/SG_Node.cpp | 63 +------- source/gameengine/SceneGraph/SG_Node.h | 113 ++++++++----- source/gameengine/SceneGraph/SG_QList.h | 144 +++++++++++++++++ source/gameengine/SceneGraph/SG_Spatial.cpp | 147 +---------------- source/gameengine/SceneGraph/SG_Spatial.h | 178 +++++++++++++-------- 13 files changed, 649 insertions(+), 429 deletions(-) create mode 100644 source/gameengine/SceneGraph/SG_DList.h create mode 100644 source/gameengine/SceneGraph/SG_QList.h (limited to 'source') diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 6a570c9e815..c4c71d9dd85 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -2055,7 +2055,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, if ((blenderobject->parent != 0)&&(!converter->addInitFromFrame)) { // blender has an additional 'parentinverse' offset in each object - SG_Node* parentinversenode = new SG_Node(NULL,NULL,SG_Callbacks()); + SG_Node* parentinversenode = new SG_Node(NULL,kxscene,SG_Callbacks(NULL,NULL,NULL,KX_Scene::KX_ScenegraphUpdateFunc,KX_Scene::KX_ScenegraphRescheduleFunc)); // define a normal parent relationship for this node. KX_NormalParentRelation * parent_relation = KX_NormalParentRelation::New(); @@ -2249,7 +2249,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, if ((blenderobject->parent != 0)&&(!converter->addInitFromFrame)) { // blender has an additional 'parentinverse' offset in each object - SG_Node* parentinversenode = new SG_Node(NULL,NULL,SG_Callbacks()); + SG_Node* parentinversenode = new SG_Node(NULL,kxscene,SG_Callbacks(NULL,NULL,NULL,KX_Scene::KX_ScenegraphUpdateFunc,KX_Scene::KX_ScenegraphRescheduleFunc)); // define a normal parent relationship for this node. KX_NormalParentRelation * parent_relation = KX_NormalParentRelation::New(); diff --git a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp index 0e7571031e8..cb933419c57 100644 --- a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp +++ b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp @@ -125,7 +125,9 @@ UpdateChildCoordinates( else { child->SetWorldFromLocalTransform(); } - child->SetModified(false); + child->ClearModified(); + // this node must always be updated, so reschedule it for next time + child->ActivateRecheduleUpdateCallback(); return valid_parent_transform; } diff --git a/source/gameengine/Ketsji/KX_SG_NodeRelationships.cpp b/source/gameengine/Ketsji/KX_SG_NodeRelationships.cpp index c3b0c21c8e0..c49b6d671a7 100644 --- a/source/gameengine/Ketsji/KX_SG_NodeRelationships.cpp +++ b/source/gameengine/Ketsji/KX_SG_NodeRelationships.cpp @@ -63,7 +63,7 @@ UpdateChildCoordinates( if (parent==NULL) { /* Simple case */ child->SetWorldFromLocalTransform(); - child->SetModified(false); + child->ClearModified(); return true; //false; } else { @@ -75,7 +75,7 @@ UpdateChildCoordinates( child->SetWorldScale(p_world_scale * child->GetLocalScale()); child->SetWorldOrientation(p_world_rotation * child->GetLocalOrientation()); child->SetWorldPosition(p_world_pos + p_world_scale * (p_world_rotation * child->GetLocalPosition())); - child->SetModified(false); + child->ClearModified(); return true; } } @@ -137,7 +137,7 @@ UpdateChildCoordinates( child->SetWorldPosition(child->GetLocalPosition()); child->SetWorldOrientation(child->GetLocalOrientation()); - child->SetModified(false); + child->ClearModified(); return true; //parent != NULL; } @@ -259,7 +259,9 @@ UpdateChildCoordinates( child->SetWorldScale(child_w_scale); child->SetWorldPosition(child_w_pos); child->SetWorldOrientation(child_w_rotation); - child->SetModified(false); + child->ClearModified(); + // this node must always be updated, so reschedule it for next time + child->ActivateRecheduleUpdateCallback(); return true; //parent != NULL; } diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 171ed5d130f..d31d451f02e 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -111,7 +111,22 @@ void* KX_SceneDestructionFunc(SG_IObject* node,void* gameobj,void* scene) return NULL; }; -SG_Callbacks KX_Scene::m_callbacks = SG_Callbacks(KX_SceneReplicationFunc,KX_SceneDestructionFunc,KX_GameObject::UpdateTransformFunc); +bool KX_Scene::KX_ScenegraphUpdateFunc(SG_IObject* node,void* gameobj,void* scene) +{ + return ((SG_Node*)node)->Schedule(((KX_Scene*)scene)->m_sghead); +} + +bool KX_Scene::KX_ScenegraphRescheduleFunc(SG_IObject* node,void* gameobj,void* scene) +{ + return ((SG_Node*)node)->Reschedule(((KX_Scene*)scene)->m_sghead); +} + +SG_Callbacks KX_Scene::m_callbacks = SG_Callbacks( + KX_SceneReplicationFunc, + KX_SceneDestructionFunc, + KX_GameObject::UpdateTransformFunc, + KX_Scene::KX_ScenegraphUpdateFunc, + KX_Scene::KX_ScenegraphRescheduleFunc); // temporarily var until there is a button in the userinterface // (defined in KX_PythonInit.cpp) @@ -1473,15 +1488,28 @@ void KX_Scene::LogicEndFrame() */ void KX_Scene::UpdateParents(double curtime) { -// int numrootobjects = GetRootParentList()->GetCount(); + // we use the SG dynamic list + SG_Node* node; - for (int i=0; iGetCount(); i++) + while ((node = SG_Node::GetNextScheduled(m_sghead)) != NULL) { - KX_GameObject* parentobj = (KX_GameObject*)GetRootParentList()->GetValue(i); - parentobj->NodeUpdateGS(curtime); + node->UpdateWorldData(curtime); } -} + //for (int i=0; iGetCount(); i++) + //{ + // KX_GameObject* parentobj = (KX_GameObject*)GetRootParentList()->GetValue(i); + // parentobj->NodeUpdateGS(curtime); + //} + + // the list must be empty here + assert(m_sghead.Empty()); + // some nodes may be ready for reschedule, move them to schedule list for next time + while ((node = SG_Node::GetNextRescheduled(m_sghead)) != NULL) + { + node->Schedule(m_sghead); + } +} RAS_MaterialBucket* KX_Scene::FindBucket(class RAS_IPolyMaterial* polymat, bool &bucketCreated) diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 52a3cd5733e..0cfef8b7bd1 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -118,6 +118,11 @@ protected: CListValue* m_parentlist; // all 'root' parents CListValue* m_lightlist; CListValue* m_inactivelist; // all objects that are not in the active layer + + SG_QList m_sghead; // list of nodes that needs scenegraph update + // the Dlist is not object that must be updated + // the Qlist is for objects that needs to be rescheduled + // for updates after udpate is over (slow parent, bone parent) /** * The tree of objects in the scene. @@ -307,6 +312,8 @@ public: /** * Update all transforms according to the scenegraph. */ + static bool KX_ScenegraphUpdateFunc(SG_IObject* node,void* gameobj,void* scene); + static bool KX_ScenegraphRescheduleFunc(SG_IObject* node,void* gameobj,void* scene); void UpdateParents(double curtime); void DupliGroupRecurse(CValue* gameobj, int level); bool IsObjectInGroup(CValue* gameobj) diff --git a/source/gameengine/SceneGraph/SG_DList.h b/source/gameengine/SceneGraph/SG_DList.h new file mode 100644 index 00000000000..d682be679e6 --- /dev/null +++ b/source/gameengine/SceneGraph/SG_DList.h @@ -0,0 +1,147 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ +#ifndef __SG_DLIST +#define __SG_DLIST + +#include + +/** + * Double circular linked list + */ +class SG_DList +{ +protected : + SG_DList* m_flink; + SG_DList* m_blink; + +public: + template class iterator + { + private: + SG_DList& m_head; + T* m_current; + public: + typedef iterator _myT; + iterator(SG_DList& head) : m_head(head), m_current(NULL) {} + ~iterator() {} + + void begin() + { + m_current = (T*)m_head.Peek(); + if (m_current == (T*)m_head.Self()) + { + m_current = NULL; + } + } + bool end() + { + return (NULL == m_current); + } + T* operator*() + { + return m_current; + } + _myT& operator++() + { + assert(m_current); + m_current = (T*)m_current->Peek(); + if (m_current == (T*)m_head.Self()) + { + m_current = NULL; + } + return *this; + } + }; + + SG_DList() + { + m_flink = m_blink = this; + } + virtual ~SG_DList() + { + Delink(); + } + + inline bool Empty() // Check for empty queue + { + return ( m_flink == this ); + } + bool AddBack( SG_DList *item ) // Add to the back + { + if (!item->Empty()) + return false; + item->m_blink = m_blink; + item->m_flink = this; + m_blink->m_flink = item; + m_blink = item; + return true; + } + bool AddFront( SG_DList *item ) // Add to the back + { + if (!item->Empty()) + return false; + item->m_flink = m_flink; + item->m_blink = this; + m_flink->m_blink = item; + m_flink = item; + return true; + } + SG_DList *Remove() // Remove from the front + { + if (Empty()) + { + return NULL; + } + SG_DList* item = m_flink; + m_flink = item->m_flink; + m_flink->m_blink = this; + item->m_flink = item->m_blink = item; + return item; + } + void Delink() // Remove from the middle + { + if (!Empty()) + { + m_blink->m_flink = m_flink; + m_flink->m_blink = m_blink; + m_flink = m_blink = this; + } + } + inline SG_DList *Peek() // Look at front without removing + { + return m_flink; + } + inline SG_DList *Self() + { + return this; + } +}; + +#endif //__SG_DLIST + diff --git a/source/gameengine/SceneGraph/SG_IObject.cpp b/source/gameengine/SceneGraph/SG_IObject.cpp index fbab4032a10..5795ca57113 100644 --- a/source/gameengine/SceneGraph/SG_IObject.cpp +++ b/source/gameengine/SceneGraph/SG_IObject.cpp @@ -39,19 +39,20 @@ SG_IObject:: SG_IObject( void* clientobj, void* clientinfo, - SG_Callbacks callbacks + SG_Callbacks& callbacks ): + SG_QList(), m_SGclientObject(clientobj), - m_SGclientInfo(clientinfo), - m_callbacks(callbacks) + m_SGclientInfo(clientinfo) { - //nothing to do + m_callbacks = callbacks; } SG_IObject:: SG_IObject( const SG_IObject &other ) : + SG_QList(), m_SGclientObject(other.m_SGclientObject), m_SGclientInfo(other.m_SGclientInfo), m_callbacks(other.m_callbacks) @@ -74,92 +75,17 @@ RemoveAllControllers( m_SGcontrollers.clear(); } -/// Needed for replication - SGControllerList& -SG_IObject:: -GetSGControllerList( -){ - return m_SGcontrollers; -} - - void* -SG_IObject:: -GetSGClientObject( -){ - return m_SGclientObject; -} - -const - void* -SG_IObject:: -GetSGClientObject( -) const { - return m_SGclientObject; -} - - void -SG_IObject:: -SetSGClientObject( - void* clientObject -){ - m_SGclientObject = clientObject; -} - - - bool -SG_IObject:: -ActivateReplicationCallback( - SG_IObject *replica -){ - if (m_callbacks.m_replicafunc) - { - // Call client provided replication func - if (m_callbacks.m_replicafunc(replica,m_SGclientObject,m_SGclientInfo) == NULL) - return false; - } - return true; -}; - - void -SG_IObject:: -ActivateDestructionCallback( -){ - if (m_callbacks.m_destructionfunc) - { - // Call client provided destruction function on this! - m_callbacks.m_destructionfunc(this,m_SGclientObject,m_SGclientInfo); - } - else - { - // no callback but must still destroy the node to avoid memory leak - delete this; - } -} - - void -SG_IObject:: -ActivateUpdateTransformCallback( -){ - if (m_callbacks.m_updatefunc) - { - // Call client provided update func. - m_callbacks.m_updatefunc(this, m_SGclientObject, m_SGclientInfo); - } -} - - void -SG_IObject:: -SetControllerTime( - double time -){ +void SG_IObject::SetControllerTime(double time) +{ SGControllerList::iterator contit; - for (contit = m_SGcontrollers.begin();contit!=m_SGcontrollers.end();++contit) { (*contit)->SetSimulatedTime(time); } } +/// Needed for replication + SG_IObject:: ~SG_IObject() diff --git a/source/gameengine/SceneGraph/SG_IObject.h b/source/gameengine/SceneGraph/SG_IObject.h index 9012b532059..b4dd9a9ddf2 100644 --- a/source/gameengine/SceneGraph/SG_IObject.h +++ b/source/gameengine/SceneGraph/SG_IObject.h @@ -29,6 +29,7 @@ #ifndef __SG_IOBJECT #define __SG_IOBJECT +#include "SG_QList.h" #include // used for debugging: stage of the game engine main loop at which a Scenegraph modification is done @@ -84,6 +85,18 @@ typedef void (*SG_UpdateTransformCallback)( void* clientinfo ); +typedef bool (*SG_ScheduleUpdateCallback)( + SG_IObject* sgobject, + void* clientobj, + void* clientinfo +); + +typedef bool (*SG_RescheduleUpdateCallback)( + SG_IObject* sgobject, + void* clientobj, + void* clientinfo +); + /** * SG_Callbacks hold 2 call backs to the outside world. @@ -106,30 +119,38 @@ struct SG_Callbacks ): m_replicafunc(NULL), m_destructionfunc(NULL), - m_updatefunc(NULL) + m_updatefunc(NULL), + m_schedulefunc(NULL), + m_reschedulefunc(NULL) { }; SG_Callbacks( SG_ReplicationNewCallback repfunc, SG_DestructionNewCallback destructfunc, - SG_UpdateTransformCallback updatefunc + SG_UpdateTransformCallback updatefunc, + SG_ScheduleUpdateCallback schedulefunc, + SG_RescheduleUpdateCallback reschedulefunc ): m_replicafunc(repfunc), m_destructionfunc(destructfunc), - m_updatefunc(updatefunc) + m_updatefunc(updatefunc), + m_schedulefunc(schedulefunc), + m_reschedulefunc(reschedulefunc) { }; SG_ReplicationNewCallback m_replicafunc; SG_DestructionNewCallback m_destructionfunc; SG_UpdateTransformCallback m_updatefunc; + SG_ScheduleUpdateCallback m_schedulefunc; + SG_RescheduleUpdateCallback m_reschedulefunc; }; /** base object that can be part of the scenegraph. */ -class SG_IObject +class SG_IObject : public SG_QList { private : @@ -177,9 +198,10 @@ public: * using STL? */ - SGControllerList& - GetSGControllerList( - ); + SGControllerList& GetSGControllerList() + { + return m_SGcontrollers; + } /** @@ -192,16 +214,16 @@ public: * This may be NULL. */ - void* - GetSGClientObject( - ); + inline const void* GetSGClientObject() const + { + return m_SGclientObject; + } - const - void* - GetSGClientObject( - ) const ; + inline void* GetSGClientObject() + { + return m_SGclientObject; + } - /** * Set the client object for this node. This is just a * pointer to an object allocated that should exist for @@ -209,10 +231,10 @@ public: * this function is called again. */ - void - SetSGClientObject( - void* clientObject - ); + void SetSGClientObject(void* clientObject) + { + m_SGclientObject = clientObject; + } /** * Set the current simulation time for this node. @@ -220,10 +242,7 @@ public: * the nodes list of controllers and calls their SetSimulatedTime methods */ - void - SetControllerTime( - double time - ); + void SetControllerTime(double time); virtual void @@ -235,20 +254,76 @@ protected : bool ActivateReplicationCallback( SG_IObject *replica - ); + ) + { + if (m_callbacks.m_replicafunc) + { + // Call client provided replication func + if (m_callbacks.m_replicafunc(replica,m_SGclientObject,m_SGclientInfo) == NULL) + return false; + } + return true; + } + void ActivateDestructionCallback( - ); + ) + { + if (m_callbacks.m_destructionfunc) + { + // Call client provided destruction function on this! + m_callbacks.m_destructionfunc(this,m_SGclientObject,m_SGclientInfo); + } + else + { + // no callback but must still destroy the node to avoid memory leak + delete this; + } + } void ActivateUpdateTransformCallback( - ); + ) + { + if (m_callbacks.m_updatefunc) + { + // Call client provided update func. + m_callbacks.m_updatefunc(this, m_SGclientObject, m_SGclientInfo); + } + } + + bool + ActivateScheduleUpdateCallback( + ) + { + // HACK, this check assumes that the scheduled nodes are put on a DList (see SG_Node.h) + // The early check on Empty() allows up to avoid calling the callback function + // when the node is already scheduled for update. + if (Empty() && m_callbacks.m_schedulefunc) + { + // Call client provided update func. + return m_callbacks.m_schedulefunc(this, m_SGclientObject, m_SGclientInfo); + } + return false; + } + + void + ActivateRecheduleUpdateCallback( + ) + { + if (m_callbacks.m_reschedulefunc) + { + // Call client provided update func. + m_callbacks.m_reschedulefunc(this, m_SGclientObject, m_SGclientInfo); + } + } + SG_IObject( void* clientobj, void* clientinfo, - SG_Callbacks callbacks + SG_Callbacks& callbacks ); SG_IObject( diff --git a/source/gameengine/SceneGraph/SG_Node.cpp b/source/gameengine/SceneGraph/SG_Node.cpp index 64d9019c86a..c4a1b151846 100644 --- a/source/gameengine/SceneGraph/SG_Node.cpp +++ b/source/gameengine/SceneGraph/SG_Node.cpp @@ -40,7 +40,7 @@ using namespace std; SG_Node::SG_Node( void* clientobj, void* clientinfo, - SG_Callbacks callbacks + SG_Callbacks& callbacks ) : SG_Spatial(clientobj,clientinfo,callbacks), @@ -141,22 +141,6 @@ Destruct() ActivateDestructionCallback(); } - - SG_Node* -SG_Node:: -GetSGParent( -) const { - return m_SGparent; -} - - void -SG_Node:: -SetSGParent( - SG_Node* parent -){ - m_SGparent = parent; -} - const SG_Node* SG_Node:: @@ -165,28 +149,6 @@ GetRootSGParent( return (m_SGparent ? (const SG_Node*) m_SGparent->GetRootSGParent() : (const SG_Node*) this); } - bool -SG_Node:: -IsVertexParent() -{ - if (m_parent_relation) - { - return m_parent_relation->IsVertexRelation(); - } - return false; -} - - bool -SG_Node:: -IsSlowParent() -{ - if (m_parent_relation) - { - return m_parent_relation->IsSlowRelation(); - } - return false; -} - void SG_Node:: DisconnectFromParent( @@ -199,8 +161,6 @@ DisconnectFromParent( } - - void SG_Node::AddChild(SG_Node* child) { m_children.push_back(child); @@ -228,6 +188,9 @@ void SG_Node::UpdateWorldData(double time, bool parentUpdated) // to update the ActivateUpdateTransformCallback(); + // The node is updated, remove it from the update list + Delink(); + // update children's worlddata for (NodeList::iterator it = m_children.begin();it!=m_children.end();++it) { @@ -236,24 +199,6 @@ void SG_Node::UpdateWorldData(double time, bool parentUpdated) } -NodeList& SG_Node::GetSGChildren() -{ - return this->m_children; -} - - -const NodeList& SG_Node::GetSGChildren() const -{ - return this->m_children; -} - - -void SG_Node::ClearSGChildren() -{ - m_children.clear(); -} - - void SG_Node::SetSimulatedTime(double time,bool recurse) { diff --git a/source/gameengine/SceneGraph/SG_Node.h b/source/gameengine/SceneGraph/SG_Node.h index 29943653a81..7c6ef92f670 100644 --- a/source/gameengine/SceneGraph/SG_Node.h +++ b/source/gameengine/SceneGraph/SG_Node.h @@ -44,7 +44,7 @@ public: SG_Node( void* clientobj, void* clientinfo, - SG_Callbacks callbacks + SG_Callbacks& callbacks ); SG_Node( @@ -85,45 +85,47 @@ public: * @return a reference to the list of children of this node. */ - NodeList& - GetSGChildren( - ); + NodeList& GetSGChildren() + { + return this->m_children; + } /** * Get the current list of children. * @return a const reference to the current list of children of this node. */ - const - NodeList& - GetSGChildren( - ) const; + const NodeList& GetSGChildren() const + { + return this->m_children; + } /** * Clear the list of children associated with this node */ - void - ClearSGChildren( - ); + void ClearSGChildren() + { + m_children.clear(); + } /** * return the parent of this node if it exists. */ - SG_Node* - GetSGParent( - ) const ; - + SG_Node* GetSGParent() const + { + return m_SGparent; + } /** * Set the parent of this node. */ - void - SetSGParent( - SG_Node* parent - ); + void SetSGParent(SG_Node* parent) + { + m_SGparent = parent; + } /** * Return the top node in this node's Scene graph hierarchy @@ -142,31 +144,34 @@ public: DisconnectFromParent( ); - /** - * Tell this node to treat it's parent as a vertex parent. - */ - - void - SetVertexParent( - bool isvertexparent - ) ; - - /** * Return vertex parent status. */ + bool IsVertexParent() + { + if (m_parent_relation) + { + return m_parent_relation->IsVertexRelation(); + } + return false; + } + - bool - IsVertexParent( - ) ; - /** * Return slow parent status. */ - bool - IsSlowParent( - ) ; + bool IsSlowParent() + { + if (m_parent_relation) + { + return m_parent_relation->IsSlowRelation(); + } + return false; + } + + + /** * Update the spatial data of this node. Iterate through @@ -190,6 +195,42 @@ public: bool recurse ); + /** + * Schedule this node for update by placing it in head queue + */ + bool Schedule(SG_QList& head) + { + // Put top parent in front of list to make sure they are updated before their + // children => the children will be udpated and removed from the list before + // we get to them, should they be in the list too. + return (m_SGparent)?head.AddBack(this):head.AddFront(this); + } + + /** + * Used during Scenegraph update + */ + static SG_Node* GetNextScheduled(SG_QList& head) + { + return static_cast(head.Remove()); + } + + /** + * Make this node ready for schedule on next update. This is needed for nodes + * that must always be updated (slow parent, bone parent) + */ + bool Reschedule(SG_QList& head) + { + return head.QAddBack(this); + } + + /** + * Used during Scenegraph update + */ + static SG_Node* GetNextRescheduled(SG_QList& head) + { + return static_cast(head.QRemove()); + } + /** * Node replication functions. */ diff --git a/source/gameengine/SceneGraph/SG_QList.h b/source/gameengine/SceneGraph/SG_QList.h new file mode 100644 index 00000000000..efaa613bbb9 --- /dev/null +++ b/source/gameengine/SceneGraph/SG_QList.h @@ -0,0 +1,144 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ +#ifndef __SG_QLIST +#define __SG_QLIST + +#include "SG_DList.h" + +/** + * Double-Double circular linked list + * For storing an object is two lists simultaneously + */ +class SG_QList : public SG_DList +{ +protected : + SG_QList* m_fqlink; + SG_QList* m_bqlink; + +public: + template class iterator + { + private: + SG_QList& m_head; + T* m_current; + public: + typedef iterator _myT; + iterator(SG_QList& head) : m_head(head), m_current(NULL) {} + ~iterator() {} + + void begin() + { + m_current = (T*)m_head.QPeek(); + if (m_current == (T*)m_head.Self()) + { + m_current = NULL; + } + } + bool end() + { + return (NULL == m_current); + } + T* operator*() + { + return m_current; + } + _myT& operator++() + { + assert(m_current); + m_current = (T*)m_current->QPeek(); + if (m_current == (T*)m_head.Self()) + { + m_current = NULL; + } + return *this; + } + }; + + SG_QList() : SG_DList() + { + m_fqlink = m_bqlink = this; + } + virtual ~SG_QList() + { + QDelink(); + } + + inline bool QEmpty() // Check for empty queue + { + return ( m_fqlink == this ); + } + bool QAddBack( SG_QList *item ) // Add to the back + { + if (!item->QEmpty()) + return false; + item->m_bqlink = m_bqlink; + item->m_fqlink = this; + m_bqlink->m_fqlink = item; + m_bqlink = item; + return true; + } + bool QAddFront( SG_QList *item ) // Add to the back + { + if (!item->Empty()) + return false; + item->m_fqlink = m_fqlink; + item->m_bqlink = this; + m_fqlink->m_bqlink = item; + m_fqlink = item; + return true; + } + SG_QList *QRemove() // Remove from the front + { + if (QEmpty()) + { + return NULL; + } + SG_QList* item = m_fqlink; + m_fqlink = item->m_fqlink; + m_fqlink->m_bqlink = this; + item->m_fqlink = item->m_bqlink = item; + return item; + } + void QDelink() // Remove from the middle + { + if (!QEmpty()) + { + m_bqlink->m_fqlink = m_fqlink; + m_fqlink->m_bqlink = m_bqlink; + m_fqlink = m_bqlink = this; + } + } + inline SG_QList *QPeek() // Look at front without removing + { + return m_fqlink; + } +}; + +#endif //__SG_QLIST + diff --git a/source/gameengine/SceneGraph/SG_Spatial.cpp b/source/gameengine/SceneGraph/SG_Spatial.cpp index 2f3176816c6..97b15bdf376 100644 --- a/source/gameengine/SceneGraph/SG_Spatial.cpp +++ b/source/gameengine/SceneGraph/SG_Spatial.cpp @@ -40,7 +40,7 @@ SG_Spatial:: SG_Spatial( void* clientobj, void* clientinfo, - SG_Callbacks callbacks + SG_Callbacks& callbacks ): SG_IObject(clientobj,clientinfo,callbacks), @@ -56,8 +56,9 @@ SG_Spatial( m_bbox(MT_Point3(-1.0, -1.0, -1.0), MT_Point3(1.0, 1.0, 1.0)), m_radius(1.0), - m_modified(true) + m_modified(false) { + SetModified(); } SG_Spatial:: @@ -88,13 +89,6 @@ SG_Spatial:: delete (m_parent_relation); } - SG_ParentRelation * -SG_Spatial:: -GetParentRelation( -){ - return m_parent_relation; -} - void SG_Spatial:: SetParentRelation( @@ -102,7 +96,7 @@ SetParentRelation( ){ delete (m_parent_relation); m_parent_relation = relation; - m_modified = true; + SetModified(); } @@ -143,11 +137,6 @@ UpdateSpatialData( return bComputesWorldTransform; } -bool SG_Spatial::ComputeWorldTransforms(const SG_Spatial *parent, bool& parentUpdated) -{ - return m_parent_relation->UpdateChildCoordinates(this,parent,parentUpdated); -} - /** * Position and translation methods */ @@ -169,56 +158,14 @@ RelativeTranslate( m_localPosition += trans; } } - m_modified = true; + SetModified(); } - void -SG_Spatial:: -SetLocalPosition( - const MT_Point3& trans -){ - m_localPosition = trans; - m_modified = true; -} - - void -SG_Spatial:: -SetWorldPosition( - const MT_Point3& trans -) { - m_worldPosition = trans; -} /** * Scaling methods. */ - void -SG_Spatial:: -RelativeScale( - const MT_Vector3& scale -){ - m_localScaling = m_localScaling * scale; - m_modified = true; -} - - void -SG_Spatial:: -SetLocalScale( - const MT_Vector3& scale -){ - m_localScaling = scale; - m_modified = true; -} - - - void -SG_Spatial:: -SetWorldScale( - const MT_Vector3& scale -){ - m_worldScaling = scale; -} /** * Orientation and rotation methods. @@ -236,93 +183,11 @@ RelativeRotate( rot : (GetWorldOrientation().inverse() * rot * GetWorldOrientation())); - m_modified = true; -} - - void -SG_Spatial:: -SetLocalOrientation(const MT_Matrix3x3& rot) -{ - m_localRotation = rot; - m_modified = true; + SetModified(); } - void -SG_Spatial:: -SetWorldOrientation( - const MT_Matrix3x3& rot -) { - m_worldRotation = rot; -} - -const - MT_Point3& -SG_Spatial:: -GetLocalPosition( -) const { - return m_localPosition; -} - -const - MT_Matrix3x3& -SG_Spatial:: -GetLocalOrientation( -) const { - return m_localRotation; -} - -const - MT_Vector3& -SG_Spatial:: -GetLocalScale( -) const{ - return m_localScaling; -} - - -const - MT_Point3& -SG_Spatial:: -GetWorldPosition( -) const { - return m_worldPosition; -} - -const - MT_Matrix3x3& -SG_Spatial:: -GetWorldOrientation( -) const { - return m_worldRotation; -} - -const - MT_Vector3& -SG_Spatial:: -GetWorldScaling( -) const { - return m_worldScaling; -} - -void SG_Spatial::SetWorldFromLocalTransform() -{ - m_worldPosition= m_localPosition; - m_worldScaling= m_localScaling; - m_worldRotation= m_localRotation; -} - -SG_BBox& SG_Spatial::BBox() -{ - return m_bbox; -} - -void SG_Spatial::SetBBox(SG_BBox& bbox) -{ - m_bbox = bbox; -} - MT_Transform SG_Spatial::GetWorldTransform() const { return MT_Transform(m_worldPosition, diff --git a/source/gameengine/SceneGraph/SG_Spatial.h b/source/gameengine/SceneGraph/SG_Spatial.h index c2ed80d21b2..eb1e87fbf19 100644 --- a/source/gameengine/SceneGraph/SG_Spatial.h +++ b/source/gameengine/SceneGraph/SG_Spatial.h @@ -35,6 +35,7 @@ #include // or Quaternion later ? #include "SG_IObject.h" #include "SG_BBox.h" +#include "SG_ParentRelation.h" class SG_Node; @@ -65,6 +66,16 @@ protected: public: + inline void ClearModified() + { + m_modified = false; + } + inline void SetModified() + { + m_modified = true; + ActivateScheduleUpdateCallback(); + } + /** * Define the realtionship this node has with it's parent * node. You should pass an unshared instance of an SG_ParentRelation @@ -84,9 +95,12 @@ public: SG_ParentRelation *relation ); - SG_ParentRelation * - GetParentRelation( - ); + SG_ParentRelation * GetParentRelation() + { + return m_parent_relation; + } + + /** @@ -105,15 +119,17 @@ public: bool local ); - void - SetLocalPosition( - const MT_Point3& trans - ); + void SetLocalPosition(const MT_Point3& trans) + { + m_localPosition = trans; + SetModified(); + } + + void SetWorldPosition(const MT_Point3& trans) + { + m_worldPosition = trans; + } - void - SetWorldPosition( - const MT_Point3& trans - ); void RelativeRotate( @@ -121,72 +137,95 @@ public: bool local ); - void - SetLocalOrientation( - const MT_Matrix3x3& rot - ); - - void - SetWorldOrientation( - const MT_Matrix3x3& rot - ); - - void - RelativeScale( - const MT_Vector3& scale - ); - - void - SetLocalScale( - const MT_Vector3& scale - ); - - void - SetWorldScale( - const MT_Vector3& scale - ); - - const - MT_Point3& - GetLocalPosition( - ) const ; + void SetLocalOrientation(const MT_Matrix3x3& rot) + { + m_localRotation = rot; + SetModified(); + } + + void SetWorldOrientation(const MT_Matrix3x3& rot) + { + m_worldRotation = rot; + } + + void RelativeScale(const MT_Vector3& scale) + { + m_localScaling = m_localScaling * scale; + SetModified(); + } + + void SetLocalScale(const MT_Vector3& scale) + { + m_localScaling = scale; + SetModified(); + } + + void SetWorldScale(const MT_Vector3& scale) + { + m_worldScaling = scale; + } + + const MT_Point3& GetLocalPosition() const + { + return m_localPosition; + } + + const MT_Matrix3x3& GetLocalOrientation() const + { + return m_localRotation; + } + + const MT_Vector3& GetLocalScale() const + { + return m_localScaling; + } + + const MT_Point3& GetWorldPosition() const + { + return m_worldPosition; + } + + const MT_Matrix3x3& GetWorldOrientation() const + { + return m_worldRotation; + } + + const MT_Vector3& GetWorldScaling() const + { + return m_worldScaling; + } + + void SetWorldFromLocalTransform() + { + m_worldPosition= m_localPosition; + m_worldScaling= m_localScaling; + m_worldRotation= m_localRotation; + } - const - MT_Matrix3x3& - GetLocalOrientation( - ) const ; - const - MT_Vector3& - GetLocalScale( - ) const; - - const - MT_Point3& - GetWorldPosition( - ) const ; - - const - MT_Matrix3x3& - GetWorldOrientation( - ) const ; - - const - MT_Vector3& - GetWorldScaling( - ) const ; - - void SetWorldFromLocalTransform(); MT_Transform GetWorldTransform() const; - bool ComputeWorldTransforms(const SG_Spatial *parent, bool& parentUpdated); + bool ComputeWorldTransforms(const SG_Spatial *parent, bool& parentUpdated) + { + return m_parent_relation->UpdateChildCoordinates(this,parent,parentUpdated); + } + /** * Bounding box functions. */ - SG_BBox& BBox(); - void SetBBox(SG_BBox & bbox); + SG_BBox& BBox() + { + return m_bbox; + } + + void SetBBox(SG_BBox& bbox) + { + m_bbox = bbox; + } + + bool inside(const MT_Point3 &point) const; void getBBox(MT_Point3 *box) const; void getAABBox(MT_Point3 *box) const; @@ -210,7 +249,7 @@ protected: SG_Spatial( void* clientobj, void* clientinfo, - SG_Callbacks callbacks + SG_Callbacks& callbacks ); SG_Spatial( @@ -231,7 +270,6 @@ protected: double time, bool& parentUpdated ); - void SetModified(bool modified) { m_modified = modified; } }; -- cgit v1.2.3 From 9248da811e7e0c1e8945d85a6520e74678d9e6c0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 4 May 2009 08:17:18 +0000 Subject: gcc4.4 needed this to build --- source/gameengine/Converter/BL_BlenderDataConversion.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index c4c71d9dd85..3c93265c40b 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -2055,7 +2055,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, if ((blenderobject->parent != 0)&&(!converter->addInitFromFrame)) { // blender has an additional 'parentinverse' offset in each object - SG_Node* parentinversenode = new SG_Node(NULL,kxscene,SG_Callbacks(NULL,NULL,NULL,KX_Scene::KX_ScenegraphUpdateFunc,KX_Scene::KX_ScenegraphRescheduleFunc)); + SG_Callbacks callback(NULL,NULL,NULL,KX_Scene::KX_ScenegraphUpdateFunc,KX_Scene::KX_ScenegraphRescheduleFunc); + SG_Node* parentinversenode = new SG_Node(NULL,kxscene,callback); // define a normal parent relationship for this node. KX_NormalParentRelation * parent_relation = KX_NormalParentRelation::New(); @@ -2249,7 +2250,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, if ((blenderobject->parent != 0)&&(!converter->addInitFromFrame)) { // blender has an additional 'parentinverse' offset in each object - SG_Node* parentinversenode = new SG_Node(NULL,kxscene,SG_Callbacks(NULL,NULL,NULL,KX_Scene::KX_ScenegraphUpdateFunc,KX_Scene::KX_ScenegraphRescheduleFunc)); + SG_Callbacks callback(NULL,NULL,NULL,KX_Scene::KX_ScenegraphUpdateFunc,KX_Scene::KX_ScenegraphRescheduleFunc); + SG_Node* parentinversenode = new SG_Node(NULL,kxscene,callback); // define a normal parent relationship for this node. KX_NormalParentRelation * parent_relation = KX_NormalParentRelation::New(); -- cgit v1.2.3 From 2f7cd19ff520ff5a1a0f80a55cc5e68c802b7df5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 4 May 2009 08:55:54 +0000 Subject: print BGE Py api warnings only once to avoid flooding the terminal and slowing the game down too much, resets on loading scenes/blendfiles and restarting the game engine. --- source/gameengine/Expressions/PyObjectPlus.cpp | 29 +++++++++++++++++-- source/gameengine/Expressions/PyObjectPlus.h | 40 +++++++++++++++++++++++++- source/gameengine/Ketsji/KX_PythonInit.cpp | 10 +++++-- 3 files changed, 74 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 107b12b7159..82f67a9b007 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -908,15 +908,16 @@ PyObject *PyObjectPlus::NewProxy_Ext(PyObjectPlus *self, PyTypeObject *tp, bool /////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////// /* deprecation warning management */ + bool PyObjectPlus::m_ignore_deprecation_warnings(false); void PyObjectPlus::SetDeprecationWarnings(bool ignoreDeprecationWarnings) { m_ignore_deprecation_warnings = ignoreDeprecationWarnings; } -void PyObjectPlus::ShowDeprecationWarning(const char* old_way,const char* new_way) +void PyObjectPlus::ShowDeprecationWarning_func(const char* old_way,const char* new_way) { - if (!m_ignore_deprecation_warnings) { + { printf("Method %s is deprecated, please use %s instead.\n", old_way, new_way); // import sys; print '\t%s:%d' % (sys._getframe(0).f_code.co_filename, sys._getframe(0).f_lineno) @@ -955,6 +956,30 @@ void PyObjectPlus::ShowDeprecationWarning(const char* old_way,const char* new_wa } } +void PyObjectPlus::ClearDeprecationWarning() +{ + WarnLink *wlink_next; + WarnLink *wlink = GetDeprecationWarningLinkFirst(); + + while(wlink) + { + wlink->warn_done= false; /* no need to NULL the link, its cleared before adding to the list next time round */ + wlink_next= reinterpret_cast(wlink->link); + wlink->link= NULL; + wlink= wlink_next; + } + NullDeprecationWarning(); +} + +WarnLink* m_base_wlink_first= NULL; +WarnLink* m_base_wlink_last= NULL; + +WarnLink* PyObjectPlus::GetDeprecationWarningLinkFirst(void) {return m_base_wlink_first;} +WarnLink* PyObjectPlus::GetDeprecationWarningLinkLast(void) {return m_base_wlink_last;} +void PyObjectPlus::SetDeprecationWarningFirst(WarnLink* wlink) {m_base_wlink_first= wlink;} +void PyObjectPlus::SetDeprecationWarningLinkLast(WarnLink* wlink) {m_base_wlink_last= wlink;} +void PyObjectPlus::NullDeprecationWarning() {m_base_wlink_first= m_base_wlink_last= NULL;} + #endif //NO_EXP_PYTHON_EMBEDDING diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index f90a1436d00..449ece535c1 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -81,6 +81,36 @@ static inline void Py_Fatal(const char *M) { exit(-1); }; + +/* Use with ShowDeprecationWarning macro */ +typedef struct { + bool warn_done; + void *link; +} WarnLink; + +#define ShowDeprecationWarning(old_way, new_way) \ +{ \ + static WarnLink wlink = {false, NULL}; \ + if ((m_ignore_deprecation_warnings || wlink.warn_done)==0) \ + { \ + ShowDeprecationWarning_func(old_way, new_way); \ + WarnLink *wlink_last= GetDeprecationWarningLinkLast(); \ + ShowDeprecationWarning_func(old_way, new_way); \ + wlink.warn_done = true; \ + wlink.link = NULL; \ + \ + if(wlink_last) { \ + wlink_last->link= (void *)&(wlink); \ + SetDeprecationWarningLinkLast(&(wlink)); \ + } else { \ + SetDeprecationWarningFirst(&(wlink)); \ + SetDeprecationWarningLinkLast(&(wlink)); \ + } \ + } \ +} \ + + + typedef struct { PyObject_HEAD /* required python macro */ class PyObjectPlus *ref; @@ -461,13 +491,21 @@ public: static bool m_ignore_deprecation_warnings; + static WarnLink* GetDeprecationWarningLinkFirst(void); + static WarnLink* GetDeprecationWarningLinkLast(void); + static void SetDeprecationWarningFirst(WarnLink* wlink); + static void SetDeprecationWarningLinkLast(WarnLink* wlink); + static void NullDeprecationWarning(); + /** enable/disable display of deprecation warnings */ static void SetDeprecationWarnings(bool ignoreDeprecationWarnings); /** Shows a deprecation warning */ - static void ShowDeprecationWarning(const char* method,const char* prop); + static void ShowDeprecationWarning_func(const char* method,const char* prop); + static void ClearDeprecationWarning(); }; + PyObject *py_getattr_dict(PyObject *pydict, PyObject *tp_dict); #endif // _adr_py_lib_h_ diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 18fd990dc51..8eb8956cfe2 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1123,8 +1123,8 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack gp_KetsjiScene = scene; gUseVisibilityTemp=false; - - + + PyObjectPlus::ClearDeprecationWarning(); /* Not that nice to call here but makes sure warnings are reset between loading scenes */ /* Use existing module where possible * be careful not to init any runtime vars after this */ @@ -1697,6 +1697,8 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur first_time = false; + PyObjectPlus::ClearDeprecationWarning(); + PyObject* moduleobj = PyImport_AddModule("__main__"); return PyModule_GetDict(moduleobj); } @@ -1710,6 +1712,7 @@ void exitGamePlayerPythonScripting() Py_Finalize(); bpy_import_main_set(NULL); + PyObjectPlus::ClearDeprecationWarning(); } @@ -1736,6 +1739,8 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev /* clear user defined modules that may contain data from the last run */ clearGameModules(); + PyObjectPlus::NullDeprecationWarning(); + PyObject* moduleobj = PyImport_AddModule("__main__"); return PyModule_GetDict(moduleobj); } @@ -1781,6 +1786,7 @@ void exitGamePythonScripting() clearGameModules(); restorePySysPath(); /* get back the original sys.path and clear the backup */ bpy_import_main_set(NULL); + PyObjectPlus::ClearDeprecationWarning(); } -- cgit v1.2.3 From 3226b33e4852f58c2ebc9d28beee2e03278bd2d9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 4 May 2009 13:01:18 +0000 Subject: python geometry function Geometry.BezierInterp(vec_knot_1, vec_handle_1, vec_handle_2, vec_knot_2, resolution) can use 2D-4D vectors Also made 3ds import give a message when no python installed --- source/blender/python/api2_2x/Geometry.c | 49 +++++++++++++++++++++++++++ source/blender/python/api2_2x/doc/Geometry.py | 8 ++++- 2 files changed, 56 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Geometry.c b/source/blender/python/api2_2x/Geometry.c index 80869889af7..cbb6d60632e 100644 --- a/source/blender/python/api2_2x/Geometry.c +++ b/source/blender/python/api2_2x/Geometry.c @@ -40,6 +40,7 @@ #include "BLI_blenlib.h" #include "BKE_utildefines.h" +#include "BKE_curve.h" #include "BLI_boxpack2d.h" #include "BLI_arithb.h" @@ -53,6 +54,7 @@ static PyObject *M_Geometry_ClosestPointOnLine( PyObject * self, PyObject * args static PyObject *M_Geometry_PointInTriangle2D( PyObject * self, PyObject * args ); static PyObject *M_Geometry_PointInQuad2D( PyObject * self, PyObject * args ); static PyObject *M_Geometry_BoxPack2D( PyObject * self, PyObject * args ); +static PyObject *M_Geometry_BezierInterp( PyObject * self, PyObject * args ); /*-------------------------DOC STRINGS ---------------------------*/ @@ -63,6 +65,7 @@ static char M_Geometry_ClosestPointOnLine_doc[] = "(pt, line_p1, line_p2) - take static char M_Geometry_PointInTriangle2D_doc[] = "(pt, tri_p1, tri_p2, tri_p3) - takes 4 vectors, one is the point and the next 3 define the triangle, only the x and y are used from the vectors"; static char M_Geometry_PointInQuad2D_doc[] = "(pt, quad_p1, quad_p2, quad_p3, quad_p4) - takes 5 vectors, one is the point and the next 4 define the quad, only the x and y are used from the vectors"; static char M_Geometry_BoxPack2D_doc[] = ""; +static char M_Geometry_BezierInterp_doc[] = ""; /*-----------------------METHOD DEFINITIONS ----------------------*/ struct PyMethodDef M_Geometry_methods[] = { {"PolyFill", ( PyCFunction ) M_Geometry_PolyFill, METH_O, M_Geometry_PolyFill_doc}, @@ -71,6 +74,7 @@ struct PyMethodDef M_Geometry_methods[] = { {"PointInTriangle2D", ( PyCFunction ) M_Geometry_PointInTriangle2D, METH_VARARGS, M_Geometry_PointInTriangle2D_doc}, {"PointInQuad2D", ( PyCFunction ) M_Geometry_PointInQuad2D, METH_VARARGS, M_Geometry_PointInQuad2D_doc}, {"BoxPack2D", ( PyCFunction ) M_Geometry_BoxPack2D, METH_O, M_Geometry_BoxPack2D_doc}, + {"BezierInterp", ( PyCFunction ) M_Geometry_BezierInterp, METH_VARARGS, M_Geometry_BezierInterp_doc}, {NULL, NULL, 0, NULL} }; @@ -469,3 +473,48 @@ static PyObject *M_Geometry_BoxPack2D( PyObject * self, PyObject * boxlist ) return Py_BuildValue( "ff", tot_width, tot_height); } + +static PyObject *M_Geometry_BezierInterp( PyObject * self, PyObject * args ) +{ + VectorObject *vec_k1, *vec_h1, *vec_k2, *vec_h2; + int resolu; + int dims; + int i; + float *coord_array, *fp; + + float k1[4] = {0.0, 0.0, 0.0, 0.0}; + float h1[4] = {0.0, 0.0, 0.0, 0.0}; + float k2[4] = {0.0, 0.0, 0.0, 0.0}; + float h2[4] = {0.0, 0.0, 0.0, 0.0}; + + float a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y, xi, yi, a1,a2,b1,b2, newvec[2]; + if( !PyArg_ParseTuple ( args, "O!O!O!O!i", + &vector_Type, &vec_k1, + &vector_Type, &vec_h1, + &vector_Type, &vec_h2, + &vector_Type, &vec_k2, &resolu) || (resolu<=1) + ) { + PyErr_SetString( PyExc_TypeError, "expected 4 vector types and an int greater then 1\n" ); + return NULL; + } + + dims= MAX4(vec_k1->size, vec_h1->size, vec_h2->size, vec_k2->size); + + for(i=0; i < vec_k1->size; i++) k1[i]= vec_k1->vec[i]; + for(i=0; i < vec_h1->size; i++) h1[i]= vec_h1->vec[i]; + for(i=0; i < vec_k2->size; i++) k2[i]= vec_k2->vec[i]; + for(i=0; i < vec_h2->size; i++) h2[i]= vec_h2->vec[i]; + + coord_array = MEM_callocN(dims * (resolu) * sizeof(float), "BezierInterp"); + for(i=0; i Date: Mon, 4 May 2009 14:41:25 +0000 Subject: Fix for msvc compile error reported by Wahooney - thanks --- source/blender/python/api2_2x/Geometry.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Geometry.c b/source/blender/python/api2_2x/Geometry.c index cbb6d60632e..2ac6b8a714a 100644 --- a/source/blender/python/api2_2x/Geometry.c +++ b/source/blender/python/api2_2x/Geometry.c @@ -481,6 +481,7 @@ static PyObject *M_Geometry_BezierInterp( PyObject * self, PyObject * args ) int dims; int i; float *coord_array, *fp; + PyObject *list; float k1[4] = {0.0, 0.0, 0.0, 0.0}; float h1[4] = {0.0, 0.0, 0.0, 0.0}; @@ -510,7 +511,7 @@ static PyObject *M_Geometry_BezierInterp( PyObject * self, PyObject * args ) forward_diff_bezier(k1[i], h1[i], h2[i], k2[i], coord_array+i, resolu-1, dims); } - PyObject* list= PyList_New(resolu); + list= PyList_New(resolu); fp= coord_array; for(i=0; i Date: Mon, 4 May 2009 22:21:02 +0000 Subject: BGE logic: new sensor "tap" option to generate automatically on/off pulses When enabled, this option converts any positive trigger from the sensor into a pair of positive+negative trigger, with the negative trigger sent in the next frame. The negative trigger from the sensor are not passed to the controller as the option automatically generates the negative triggers. From the controller point of view, the sensor is positive only for 1 frame, even if the underlying sensor state remains positive. The option interacts with the other sensor option in this way: - Level option: tap option is mutually exclusive with level option. Both cannot be enabled at the same time. - Invert option: tap option operates on the negative trigger of the sensor, which are converted to positive trigger by the invert option. Hence, the controller will see the sensor positive for 1 frame when the underlying sensor state turns negative. - Positive pulse option: tap option adds a negative trigger after each repeated positive pulse, unless the frequency option is 0, in which case positive pulse are generated on every frame as before, as long as the underlying sensor state is positive. - Negative pulse option: this option is not compatible with tap option and is ignored when tap option is enabled. Notes: - Keyboard "All keys" is handled specially when tap option is set: There will be one pair of positive/negative trigger for each new key press, regardless on how many keys are already pressed and there is no trigger when keys are released, regardless if keys are still pressed. In case two keys are pressed in succesive frames, there will be 2 positive triggers and 1 negative trigger in the following frame. --- source/blender/makesdna/DNA_sensor_types.h | 3 +- source/blender/src/buttons_logic.c | 36 ++++++++-- source/gameengine/Converter/KX_ConvertSensors.cpp | 3 + source/gameengine/GameLogic/SCA_ANDController.cpp | 2 +- .../GameLogic/SCA_ExpressionController.cpp | 2 +- source/gameengine/GameLogic/SCA_ISensor.cpp | 78 ++++++++++++++++++---- source/gameengine/GameLogic/SCA_ISensor.h | 19 +++++- source/gameengine/GameLogic/SCA_KeyboardSensor.cpp | 3 + source/gameengine/GameLogic/SCA_NANDController.cpp | 2 +- source/gameengine/GameLogic/SCA_NORController.cpp | 2 +- source/gameengine/GameLogic/SCA_ORController.cpp | 2 +- source/gameengine/GameLogic/SCA_XNORController.cpp | 2 +- source/gameengine/GameLogic/SCA_XORController.cpp | 2 +- 13 files changed, 126 insertions(+), 30 deletions(-) (limited to 'source') diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h index 7a358ad0694..8b29ce1338d 100644 --- a/source/blender/makesdna/DNA_sensor_types.h +++ b/source/blender/makesdna/DNA_sensor_types.h @@ -158,7 +158,8 @@ typedef struct bSensor { /* just add here, to avoid align errors... */ short invert; /* Whether or not to invert the output. */ short level; /* Whether the sensor is level base (edge by default) */ - int pad; + short tap; + short pad; } bSensor; typedef struct bJoystickSensor { diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 941ed5ebe12..dccbc73787d 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -1026,6 +1026,19 @@ static void set_col_sensor(int type, int medium) BIF_ThemeColorShade(col, medium?30:0); } + +static void verify_logicbutton_func(void *data1, void *data2) +{ + bSensor *sens= (bSensor*)data1; + + if(sens->level && sens->tap) { + if(data2 == &(sens->level)) sens->tap= 0; + else sens->level= 0; + allqueue(REDRAWBUTSLOGIC, 0); + } +} + + /** * Draws a toggle for pulse mode, a frequency field and a toggle to invert * the value of this sensor. Operates on the shared data block of sensors. @@ -1036,30 +1049,39 @@ static void draw_default_sensor_header(bSensor *sens, short y, short w) { + uiBut *but; + /* Pulsing and frequency */ uiDefIconButBitS(block, TOG, SENS_PULSE_REPEAT, 1, ICON_DOTSUP, - (short)(x + 10 + 0. * (w-20)), (short)(y - 21), (short)(0.15 * (w-20)), 19, + (short)(x + 10 + 0. * (w-20)), (short)(y - 21), (short)(0.1 * (w-20)), 19, &sens->pulse, 0.0, 0.0, 0, 0, "Activate TRUE level triggering (pulse mode)"); uiDefIconButBitS(block, TOG, SENS_NEG_PULSE_MODE, 1, ICON_DOTSDOWN, - (short)(x + 10 + 0.15 * (w-20)), (short)(y - 21), (short)(0.15 * (w-20)), 19, + (short)(x + 10 + 0.1 * (w-20)), (short)(y - 21), (short)(0.1 * (w-20)), 19, &sens->pulse, 0.0, 0.0, 0, 0, "Activate FALSE level triggering (pulse mode)"); uiDefButS(block, NUM, 1, "f:", - (short)(x + 10 + 0.3 * (w-20)), (short)(y - 21), (short)(0.275 * (w-20)), 19, + (short)(x + 10 + 0.2 * (w-20)), (short)(y - 21), (short)(0.275 * (w-20)), 19, &sens->freq, 0.0, 10000.0, 0, 0, "Delay between repeated pulses (in logic tics, 0 = no delay)"); /* value or shift? */ + but= uiDefButS(block, TOG, 1, "Level", + (short)(x + 10 + 0.5 * (w-20)), (short)(y - 21), (short)(0.20 * (w-20)), 19, + &sens->level, 0.0, 0.0, 0, 0, + "Level detector, trigger controllers of new states (only applicable upon logic state transition)"); + uiButSetFunc(but, verify_logicbutton_func, sens, &(sens->level)); + but= uiDefButS(block, TOG, 1, "Tap", + (short)(x + 10 + 0.702 * (w-20)), (short)(y - 21), (short)(0.12 * (w-20)), 19, + &sens->tap, 0.0, 0.0, 0, 0, + "Trigger controllers only for an instant, even while the sensor remains true"); + uiButSetFunc(but, verify_logicbutton_func, sens, &(sens->tap)); + uiDefButS(block, TOG, 1, "Inv", (short)(x + 10 + 0.85 * (w-20)), (short)(y - 21), (short)(0.15 * (w-20)), 19, &sens->invert, 0.0, 0.0, 0, 0, "Invert the level (output) of this sensor"); - uiDefButS(block, TOG, 1, "Level", - (short)(x + 10 + 0.65 * (w-20)), (short)(y - 21), (short)(0.20 * (w-20)), 19, - &sens->level, 0.0, 0.0, 0, 0, - "Level detector, trigger controllers of new states (only applicable upon logic state transition)"); } static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short yco, short width,char* objectname) diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp index 19e594ff0cb..af57094b2b5 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.cpp +++ b/source/gameengine/Converter/KX_ConvertSensors.cpp @@ -255,6 +255,7 @@ void BL_ConvertSensors(struct Object* blenderobject, int frequency = 0; bool invert = false; bool level = false; + bool tap = false; while(sens) { @@ -268,6 +269,7 @@ void BL_ConvertSensors(struct Object* blenderobject, frequency = sens->freq; invert = !(sens->invert == 0); level = !(sens->level == 0); + tap = !(sens->tap == 0); switch (sens->type) { @@ -755,6 +757,7 @@ void BL_ConvertSensors(struct Object* blenderobject, frequency); gamesensor->SetInvert(invert); gamesensor->SetLevel(level); + gamesensor->SetTap(tap); gamesensor->SetName(STR_String(sens->name)); gameobj->AddSensor(gamesensor); diff --git a/source/gameengine/GameLogic/SCA_ANDController.cpp b/source/gameengine/GameLogic/SCA_ANDController.cpp index 1b151cbe615..7991e82168f 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.cpp +++ b/source/gameengine/GameLogic/SCA_ANDController.cpp @@ -66,7 +66,7 @@ void SCA_ANDController::Trigger(SCA_LogicManager* logicmgr) !(is==m_linkedsensors.end());is++) { SCA_ISensor* sensor = *is; - if (!sensor->IsPositiveTrigger()) + if (!sensor->GetState()) { sensorresult = false; break; diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.cpp b/source/gameengine/GameLogic/SCA_ExpressionController.cpp index e6bccef08d4..a4e898a808f 100644 --- a/source/gameengine/GameLogic/SCA_ExpressionController.cpp +++ b/source/gameengine/GameLogic/SCA_ExpressionController.cpp @@ -161,7 +161,7 @@ CValue* SCA_ExpressionController::FindIdentifier(const STR_String& identifiernam SCA_ISensor* sensor = *is; if (sensor->GetName() == identifiername) { - identifierval = new CBoolValue(sensor->IsPositiveTrigger()); + identifierval = new CBoolValue(sensor->GetState()); //identifierval = sensor->AddRef(); } diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 4d69216ed0b..1e9a4521df5 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -52,19 +52,21 @@ void SCA_ISensor::ReParent(SCA_IObject* parent) SCA_ISensor::SCA_ISensor(SCA_IObject* gameobj, class SCA_EventManager* eventmgr, PyTypeObject* T ) : - SCA_ILogicBrick(gameobj,T), - m_triggered(false) + SCA_ILogicBrick(gameobj,T) { m_links = 0; m_suspended = false; m_invert = false; m_level = false; + m_tap = false; m_reset = false; m_pos_ticks = 0; m_neg_ticks = 0; m_pos_pulsemode = false; m_neg_pulsemode = false; m_pulse_frequency = 0; + m_state = false; + m_prev_state = false; m_eventmgr = eventmgr; } @@ -104,9 +106,13 @@ void SCA_ISensor::SetLevel(bool lvl) { m_level = lvl; } +void SCA_ISensor::SetTap(bool tap) { + m_tap = tap; +} + double SCA_ISensor::GetNumber() { - return IsPositiveTrigger(); + return GetState(); } void SCA_ISensor::Suspend() { @@ -143,6 +149,7 @@ void SCA_ISensor::RegisterToManager() { // sensor is just activated, initialize it Init(); + m_state = false; m_newControllers.erase(m_newControllers.begin(), m_newControllers.end()); m_eventmgr->RegisterSensor(this); } @@ -159,11 +166,20 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr, CValue* event) // don't evaluate a sensor that is not connected to any controller if (m_links && !m_suspended) { bool result = this->Evaluate(event); + // store the state for the rest of the logic system + m_prev_state = m_state; + m_state = this->IsPositiveTrigger(); if (result) { - logicmgr->AddActivatedSensor(this); - // reset these counters so that pulse are synchronized with transition - m_pos_ticks = 0; - m_neg_ticks = 0; + // the sensor triggered this frame + if (m_state || !m_tap) { + logicmgr->AddActivatedSensor(this); + // reset these counters so that pulse are synchronized with transition + m_pos_ticks = 0; + m_neg_ticks = 0; + } else + { + result = false; + } } else { /* First, the pulsing behaviour, if pulse mode is @@ -172,19 +188,20 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr, CValue* event) if (m_pos_pulsemode) { m_pos_ticks++; if (m_pos_ticks > m_pulse_frequency) { - if ( this->IsPositiveTrigger() ) + if ( m_state ) { logicmgr->AddActivatedSensor(this); + result = true; } m_pos_ticks = 0; } } - - if (m_neg_pulsemode) + // negative pulse doesn't make sense in tap mode, skip + if (m_neg_pulsemode && !m_tap) { m_neg_ticks++; if (m_neg_ticks > m_pulse_frequency) { - if (!this->IsPositiveTrigger() ) + if (!m_state ) { logicmgr->AddActivatedSensor(this); } @@ -192,6 +209,21 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr, CValue* event) } } } + if (m_tap) + { + // in tap mode: we send always a negative pulse immediately after a positive pulse + if (!result) + { + // the sensor did not trigger on this frame + if (m_prev_state) + { + // but it triggered on previous frame => send a negative pulse + logicmgr->AddActivatedSensor(this); + } + // in any case, absence of trigger means sensor off + m_state = false; + } + } if (!m_newControllers.empty()) { if (!IsActive() && m_level) @@ -221,7 +253,7 @@ const char SCA_ISensor::IsPositive_doc[] = PyObject* SCA_ISensor::PyIsPositive() { ShowDeprecationWarning("isPositive()", "the read-only positive property"); - int retval = IsPositiveTrigger(); + int retval = GetState(); return PyInt_FromLong(retval); } @@ -385,6 +417,7 @@ KX_PYMETHODDEF_DOC_NOARGS(SCA_ISensor, reset, "\tThe sensor is put in its initial state as if it was just activated.\n") { Init(); + m_prev_state = false; Py_RETURN_NONE; } @@ -458,7 +491,8 @@ PyAttributeDef SCA_ISensor::Attributes[] = { KX_PYATTRIBUTE_BOOL_RW("useNegPulseMode",SCA_ISensor,m_neg_pulsemode), KX_PYATTRIBUTE_INT_RW("frequency",0,100000,true,SCA_ISensor,m_pulse_frequency), KX_PYATTRIBUTE_BOOL_RW("invert",SCA_ISensor,m_invert), - KX_PYATTRIBUTE_BOOL_RW("level",SCA_ISensor,m_level), + KX_PYATTRIBUTE_BOOL_RW_CHECK("level",SCA_ISensor,m_level,pyattr_check_level), + KX_PYATTRIBUTE_BOOL_RW_CHECK("tap",SCA_ISensor,m_tap,pyattr_check_tap), KX_PYATTRIBUTE_RO_FUNCTION("triggered", SCA_ISensor, pyattr_get_triggered), KX_PYATTRIBUTE_RO_FUNCTION("positive", SCA_ISensor, pyattr_get_positive), //KX_PYATTRIBUTE_TODO("links"), @@ -493,7 +527,23 @@ PyObject* SCA_ISensor::pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_D PyObject* SCA_ISensor::pyattr_get_positive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_ISensor* self= static_cast(self_v); - return PyInt_FromLong(self->IsPositiveTrigger()); + return PyInt_FromLong(self->GetState()); +} + +int SCA_ISensor::pyattr_check_level(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + SCA_ISensor* self= static_cast(self_v); + if (self->m_level) + self->m_tap = false; + return 0; +} + +int SCA_ISensor::pyattr_check_tap(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + SCA_ISensor* self= static_cast(self_v); + if (self->m_tap) + self->m_level = false; + return 0; } /* eof */ diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index e2ceec19b69..7bbef5fef2f 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -43,7 +43,6 @@ class SCA_ISensor : public SCA_ILogicBrick { Py_Header; class SCA_EventManager* m_eventmgr; - bool m_triggered; /** Pulse positive pulses? */ bool m_pos_pulsemode; @@ -66,6 +65,9 @@ class SCA_ISensor : public SCA_ILogicBrick /** detect level instead of edge*/ bool m_level; + /** tap mode */ + bool m_tap; + /** sensor has been reset */ bool m_reset; @@ -75,6 +77,12 @@ class SCA_ISensor : public SCA_ILogicBrick /** number of connections to controller */ int m_links; + /** current sensor state */ + bool m_state; + + /** previous state (for tap option) */ + bool m_prev_state; + /** list of controllers that have just activated this sensor because of a state change */ std::vector m_newControllers; @@ -109,6 +117,7 @@ public: void SetInvert(bool inv); /** set the level detection on or off */ void SetLevel(bool lvl); + void SetTap(bool tap); virtual void RegisterToManager(); virtual void UnregisterToManager(); @@ -121,6 +130,12 @@ public: /** Is this sensor switched off? */ bool IsSuspended(); + /** get the state of the sensor: positive or negative */ + bool GetState() + { + return m_state; + } + /** Resume sensing. */ void Resume(); @@ -158,6 +173,8 @@ public: static PyObject* pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_positive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_check_level(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_check_tap(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); }; #endif //__SCA_ISENSOR diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index 821d2155d2a..a9ea4272531 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -195,6 +195,9 @@ bool SCA_KeyboardSensor::Evaluate(CValue* eventval) } } } + if (m_tap) + // special case for tap mode: only generate event for new activation + result = false; } diff --git a/source/gameengine/GameLogic/SCA_NANDController.cpp b/source/gameengine/GameLogic/SCA_NANDController.cpp index 4643a42a4be..df62f91aaed 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.cpp +++ b/source/gameengine/GameLogic/SCA_NANDController.cpp @@ -66,7 +66,7 @@ void SCA_NANDController::Trigger(SCA_LogicManager* logicmgr) !(is==m_linkedsensors.end());is++) { SCA_ISensor* sensor = *is; - if (!sensor->IsPositiveTrigger()) + if (!sensor->GetState()) { sensorresult = true; break; diff --git a/source/gameengine/GameLogic/SCA_NORController.cpp b/source/gameengine/GameLogic/SCA_NORController.cpp index a0e9fcb239c..b87af965a50 100644 --- a/source/gameengine/GameLogic/SCA_NORController.cpp +++ b/source/gameengine/GameLogic/SCA_NORController.cpp @@ -66,7 +66,7 @@ void SCA_NORController::Trigger(SCA_LogicManager* logicmgr) !(is==m_linkedsensors.end());is++) { SCA_ISensor* sensor = *is; - if (sensor->IsPositiveTrigger()) + if (sensor->GetState()) { sensorresult = false; break; diff --git a/source/gameengine/GameLogic/SCA_ORController.cpp b/source/gameengine/GameLogic/SCA_ORController.cpp index 87e6d19d008..7aa58b6c320 100644 --- a/source/gameengine/GameLogic/SCA_ORController.cpp +++ b/source/gameengine/GameLogic/SCA_ORController.cpp @@ -76,7 +76,7 @@ void SCA_ORController::Trigger(SCA_LogicManager* logicmgr) while ( (!sensorresult) && (!(is==m_linkedsensors.end())) ) { sensor = *is; - if (sensor->IsPositiveTrigger()) sensorresult = true; + if (sensor->GetState()) sensorresult = true; is++; } diff --git a/source/gameengine/GameLogic/SCA_XNORController.cpp b/source/gameengine/GameLogic/SCA_XNORController.cpp index 947e8b7a68a..9b0fe51c5b8 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.cpp +++ b/source/gameengine/GameLogic/SCA_XNORController.cpp @@ -66,7 +66,7 @@ void SCA_XNORController::Trigger(SCA_LogicManager* logicmgr) !(is==m_linkedsensors.end());is++) { SCA_ISensor* sensor = *is; - if (sensor->IsPositiveTrigger()) + if (sensor->GetState()) { if (sensorresult == false) { diff --git a/source/gameengine/GameLogic/SCA_XORController.cpp b/source/gameengine/GameLogic/SCA_XORController.cpp index d9e41c2b27e..9232120075f 100644 --- a/source/gameengine/GameLogic/SCA_XORController.cpp +++ b/source/gameengine/GameLogic/SCA_XORController.cpp @@ -66,7 +66,7 @@ void SCA_XORController::Trigger(SCA_LogicManager* logicmgr) !(is==m_linkedsensors.end());is++) { SCA_ISensor* sensor = *is; - if (sensor->IsPositiveTrigger()) + if (sensor->GetState()) { if (sensorresult == true) { -- cgit v1.2.3 From 9e8261a13b696708c3f7f7bac83d5aae8ef43fed Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 5 May 2009 05:57:08 +0000 Subject: Disable importing module python controller scripts at conversion time because it can run BGE functions and crash since the internal state isnt setup yet. face-select mode wasnt working when used with projection paint. --- source/blender/src/drawview.c | 2 +- source/gameengine/Converter/KX_ConvertControllers.cpp | 9 +++++++-- source/gameengine/GameLogic/SCA_PythonController.cpp | 5 +++++ 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index 203c9869022..d6184f42410 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -977,7 +977,7 @@ void backdrawview3d(int test) int m; #endif - if( G.f & G_VERTEXPAINT || G.f & G_WEIGHTPAINT ); + if( G.f & G_VERTEXPAINT || G.f & G_WEIGHTPAINT || (FACESEL_PAINT_TEST)); else if ((G.f & G_TEXTUREPAINT) && G.scene->toolsettings && (G.scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_DISABLE)); else if(G.obedit && G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)); else { diff --git a/source/gameengine/Converter/KX_ConvertControllers.cpp b/source/gameengine/Converter/KX_ConvertControllers.cpp index 79664ca4622..856f3f79588 100644 --- a/source/gameengine/Converter/KX_ConvertControllers.cpp +++ b/source/gameengine/Converter/KX_ConvertControllers.cpp @@ -216,8 +216,13 @@ void BL_ConvertControllers( * gives more pradictable performance for larger scripts */ if(pyctrl->m_mode==SCA_PythonController::SCA_PYEXEC_SCRIPT) pyctrl->Compile(); - else - pyctrl->Import(); + else { + /* We cant do this because importing runs the script which could end up accessing + * internal BGE functions, this is unstable while we're converting the scene. + * This is a pitty because its useful to see errors at startup but cant help it */ + + // pyctrl->Import(); + } } //done with gamecontroller diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index bf4c2475a64..0e78e03d5af 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -164,6 +164,11 @@ static const char* sPyGetCurrentController__doc__; /* warning, self is not the SCA_PythonController, its a PyObjectPlus_Proxy */ PyObject* SCA_PythonController::sPyGetCurrentController(PyObject *self) { + if(m_sCurrentController==NULL) + { + PyErr_SetString(PyExc_SystemError, "GameLogic.getCurrentController(), this function is being run outside the python controllers context, or blenders internal state is corrupt."); + return NULL; + } return m_sCurrentController->GetProxy(); } -- cgit v1.2.3 From 362202cc14d501484ab62bdd6c638e81bc52981d Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Tue, 5 May 2009 22:32:15 +0000 Subject: Fix an undefined variable bug detected by valgrind. --- source/gameengine/SceneGraph/SG_Node.cpp | 3 ++- source/gameengine/SceneGraph/SG_Spatial.cpp | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/SceneGraph/SG_Node.cpp b/source/gameengine/SceneGraph/SG_Node.cpp index c4a1b151846..4cd43e852b8 100644 --- a/source/gameengine/SceneGraph/SG_Node.cpp +++ b/source/gameengine/SceneGraph/SG_Node.cpp @@ -46,6 +46,7 @@ SG_Node::SG_Node( : SG_Spatial(clientobj,clientinfo,callbacks), m_SGparent(NULL) { + m_modified = true; } SG_Node::SG_Node( @@ -55,7 +56,7 @@ SG_Node::SG_Node( m_children(other.m_children), m_SGparent(other.m_SGparent) { - // nothing to do + m_modified = true; } SG_Node::~SG_Node() diff --git a/source/gameengine/SceneGraph/SG_Spatial.cpp b/source/gameengine/SceneGraph/SG_Spatial.cpp index 97b15bdf376..b79d4bac91a 100644 --- a/source/gameengine/SceneGraph/SG_Spatial.cpp +++ b/source/gameengine/SceneGraph/SG_Spatial.cpp @@ -58,7 +58,6 @@ SG_Spatial( m_radius(1.0), m_modified(false) { - SetModified(); } SG_Spatial:: -- cgit v1.2.3 From 31b52cf95365ea08ac46987700f08e893d1ccb7f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 5 May 2009 23:15:31 +0000 Subject: Bugfix: Data from hidden objects was still being taken into account for many NLA-editor operations NOTE for Merging - do not port this commit, since the changes here are utterly irrelevant to the new system --- source/blender/src/editnla.c | 22 +++++++++++++++++++--- source/blender/src/transform_conversions.c | 9 +++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/src/editnla.c b/source/blender/src/editnla.c index 179ea41d5ad..3127f0e5072 100644 --- a/source/blender/src/editnla.c +++ b/source/blender/src/editnla.c @@ -927,7 +927,11 @@ void deselect_nlachannel_keys (int test) /* Determine if this is selection or deselection */ if (test){ - for (base=G.scene->base.first; base && sel; base=base->next){ + for (base=G.scene->base.first; base && sel; base=base->next){ + /* only consider if visible */ + if (nla_filter(base) == 0) + continue; + /* Test object ipos */ if (is_ipo_key_selected(base->object->ipo)){ sel = 0; @@ -986,7 +990,11 @@ void deselect_nlachannel_keys (int test) /* Set the flags */ - for (base=G.scene->base.first; base; base=base->next){ + for (base=G.scene->base.first; base; base=base->next){ + /* only consider if visible */ + if (nla_filter(base) == 0) + continue; + /* Set the object ipos */ set_ipo_key_selection(base->object->ipo, sel); @@ -1068,6 +1076,10 @@ void delete_nlachannel_keys(void) bActionStrip *strip, *nextstrip; for (base = G.scene->base.first; base; base=base->next){ + /* only consider if visible */ + if (nla_filter(base) == 0) + continue; + /* Delete object ipos */ delete_ipo_keys(base->object->ipo); @@ -1122,7 +1134,11 @@ void duplicate_nlachannel_keys(void) bActionStrip *strip, *laststrip; /* Find selected items */ - for (base = G.scene->base.first; base; base=base->next){ + for (base = G.scene->base.first; base; base=base->next){ + /* only consider if visible */ + if (nla_filter(base) == 0) + continue; + /* Duplicate object keys */ duplicate_ipo_keys(base->object->ipo); diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index 76f315cde04..2eab0bc9730 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -120,6 +120,7 @@ #include "BSE_view.h" #include "BSE_drawipo.h" +#include "BSE_drawnla.h" // nla_filter() #include "BSE_edit.h" #include "BSE_editipo.h" #include "BSE_editipo_types.h" @@ -3132,6 +3133,10 @@ static void createTransNlaData(TransInfo *t) /* Ensure that partial selections result in beztriple selections */ for (base=G.scene->base.first; base; base=base->next) { + /* only consider if visible */ + if (nla_filter(base) == 0) + continue; + /* Check object ipos */ i= count_ipo_keys(base->object->ipo, side, (float)CFRA); if (i) base->flag |= BA_HAS_RECALC_OB; @@ -3197,6 +3202,10 @@ static void createTransNlaData(TransInfo *t) /* build the transdata structure */ td= t->data; for (base=G.scene->base.first; base; base=base->next) { + /* only consider if visible */ + if (nla_filter(base) == 0) + continue; + /* Manipulate object ipos */ /* - no scaling of keyframe times is allowed here */ td= IpoToTransData(td, base->object->ipo, NULL, side, (float)CFRA); -- cgit v1.2.3 From 013afe4314dbda5345d52abc84938fabd51a86b5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 6 May 2009 01:41:04 +0000 Subject: [#18690] mesh ripping allowed on multires also fixed uninitialized variable use in the BGE when shaders are not supported. --- source/blender/src/editmesh_tools.c | 2 ++ source/gameengine/Rasterizer/RAS_2DFilterManager.cpp | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c index 377cb42e2f5..0fb072c1af4 100644 --- a/source/blender/src/editmesh_tools.c +++ b/source/blender/src/editmesh_tools.c @@ -5624,6 +5624,8 @@ void mesh_rip(void) float projectMat[4][4], viewMat[4][4], vec[3], dist, mindist; short doit= 1, mval[2],propmode,prop; + if(multires_test()) return; + propmode = G.scene->prop_mode; G.scene->prop_mode = 0; prop = G.scene->proportional; diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp index 176da51b183..239031866ca 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp @@ -63,11 +63,9 @@ numberoffilters(0), need_tex_update(true) isshadersupported = GLEW_ARB_shader_objects && GLEW_ARB_fragment_shader && GLEW_ARB_multitexture; + /* used to return before 2.49 but need to initialize values so dont */ if(!isshadersupported) - { std::cout<<"shaders not supported!" << std::endl; - return; - } int passindex; for(passindex =0; passindex Date: Wed, 6 May 2009 08:33:40 +0000 Subject: Fix for [#18697] 2.49RC1: Keyed Particles fine in viewport but give me a crash during render --- source/blender/blenkernel/intern/particle_system.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index bbf62d033bf..d3ba3fa3802 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -2007,7 +2007,6 @@ static void set_keyed_keys(Object *ob, ParticleSystem *psys) Object *kob = ob; ParticleSystem *kpsys = psys; ParticleData *pa; - ParticleKey state; int totpart = psys->totpart, i, k, totkeys = psys->totkeyed + 1; float prevtime, nexttime, keyedtime; @@ -2031,10 +2030,11 @@ static void set_keyed_keys(Object *ob, ParticleSystem *psys) } psys->flag &= ~PSYS_KEYED; - state.time=-1.0; for(k=0; kparticles; ikeys + k)->time = -1.0; /* use current time */ + if(kpsys->totpart > 0) psys_get_particle_state(kob, kpsys, i%kpsys->totpart, pa->keys + k, 1); -- cgit v1.2.3 From c1e1091f027e2d1b8a84ff5595e9a85b092f1b88 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 6 May 2009 09:12:08 +0000 Subject: moved py controller functions from SCA_PythonController to SCA_IController - the base controller class so python can get the sensors & actuators from any controller (not just SCA_PythonController types) also deprecated getActuators() and getSensors() for 'sensors' and 'actuators' attributes. an example of getting every sensor connected to an object. all_sensors = [s for c in ob.controllers for s in c.sensors] --- source/blender/python/api2_2x/doc/Mathutils.py | 8 +- source/gameengine/GameLogic/SCA_IController.cpp | 174 +++++++++++++++++++++ source/gameengine/GameLogic/SCA_IController.h | 17 +- .../gameengine/GameLogic/SCA_PythonController.cpp | 115 +------------- source/gameengine/GameLogic/SCA_PythonController.h | 9 +- source/gameengine/Ketsji/KX_PythonInitTypes.cpp | 5 +- source/gameengine/PyDoc/GameLogic.py | 6 +- source/gameengine/PyDoc/KX_SceneActuator.py | 2 +- source/gameengine/PyDoc/SCA_IController.py | 52 ++++++ source/gameengine/PyDoc/SCA_PythonController.py | 42 +---- 10 files changed, 266 insertions(+), 164 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/doc/Mathutils.py b/source/blender/python/api2_2x/doc/Mathutils.py index fc0c4ed10fa..7ca10c53d02 100644 --- a/source/blender/python/api2_2x/doc/Mathutils.py +++ b/source/blender/python/api2_2x/doc/Mathutils.py @@ -440,7 +440,7 @@ class Vector: Example:: wrappedObject = Object.getAttribute() #this is wrapped data print wrappedObject.wrapped #prints 'True' - copyOfObject = Object(wrappedObject) #creates a copy of the object + copyOfObject = wrappedObject.copy() #creates a copy of the object secondPointer = wrappedObject #creates a second pointer to the same data print wrappedObject.attribute #prints '5' secondPointer.attribute = 10 @@ -564,7 +564,7 @@ class Euler: Example:: wrappedObject = Object.getAttribute() #this is wrapped data print wrappedObject.wrapped #prints 'True' - copyOfObject = Object(wrappedObject) #creates a copy of the object + copyOfObject = wrappedObject.copy() #creates a copy of the object secondPointer = wrappedObject #creates a second pointer to the same data print wrappedObject.attribute #prints '5' secondPointer.attribute = 10 @@ -652,7 +652,7 @@ class Quaternion: Example:: wrappedObject = Object.getAttribute() #this is wrapped data print wrappedObject.wrapped #prints 'True' - copyOfObject = Object(wrappedObject) #creates a copy of the object + copyOfObject = wrappedObject.copy() #creates a copy of the object secondPointer = wrappedObject #creates a second pointer to the same data print wrappedObject.attribute #prints '5' secondPointer.attribute = 10 @@ -760,7 +760,7 @@ class Matrix: Example:: wrappedObject = Object.getAttribute() #this is wrapped data print wrappedObject.wrapped #prints 'True' - copyOfObject = Object(wrappedObject) #creates a copy of the object + copyOfObject = wrappedObject.copy() #creates a copy of the object secondPointer = wrappedObject #creates a second pointer to the same data print wrappedObject.attribute #prints '5' secondPointer.attribute = 10 diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp index f9c192cae5c..8bf21ed8264 100644 --- a/source/gameengine/GameLogic/SCA_IController.cpp +++ b/source/gameengine/GameLogic/SCA_IController.cpp @@ -30,6 +30,7 @@ #include "SCA_LogicManager.h" #include "SCA_IActuator.h" #include "SCA_ISensor.h" +#include "PyObjectPlus.h" #ifdef HAVE_CONFIG_H #include @@ -207,3 +208,176 @@ void SCA_IController::ApplyState(unsigned int state) } } +/* Python api */ + +PyTypeObject SCA_IController::Type = { +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif + "SCA_IController", + sizeof(PyObjectPlus_Proxy), + 0, + py_base_dealloc, + 0, + 0, + 0, + 0, + py_base_repr, + 0,0,0,0,0,0, + py_base_getattro, + py_base_setattro, + 0,0,0,0,0,0,0,0,0, + Methods +}; + +PyParentObject SCA_IController::Parents[] = { + &SCA_IController::Type, + &CValue::Type, + NULL +}; + +PyMethodDef SCA_IController::Methods[] = { + {"getActuator", (PyCFunction) SCA_IController::sPyGetActuator, METH_O}, + {"getSensor", (PyCFunction) SCA_IController::sPyGetSensor, METH_O}, + + //Deprecated functions ------> + {"getSensors", (PyCFunction) SCA_IController::sPyGetSensors, METH_NOARGS}, + {"getActuators", (PyCFunction) SCA_IController::sPyGetActuators, METH_NOARGS}, + {"getState", (PyCFunction) SCA_IController::sPyGetState, METH_NOARGS}, + //<----- Deprecated + {NULL,NULL} //Sentinel +}; + +PyAttributeDef SCA_IController::Attributes[] = { + KX_PYATTRIBUTE_RO_FUNCTION("state", SCA_IController, pyattr_get_state), + KX_PYATTRIBUTE_RO_FUNCTION("sensors", SCA_IController, pyattr_get_sensors), + KX_PYATTRIBUTE_RO_FUNCTION("actuators", SCA_IController, pyattr_get_actuators), + { NULL } //Sentinel +}; + +PyObject* SCA_IController::py_getattro(PyObject *attr) +{ + py_getattro_up(SCA_ILogicBrick); +} + +PyObject* SCA_IController::py_getattro_dict() { + py_getattro_dict_up(SCA_ILogicBrick); +} + +int SCA_IController::py_setattro(PyObject *attr, PyObject *value) +{ + py_setattro_up(SCA_ILogicBrick); +} + + + +PyObject* SCA_IController::PyGetActuators() +{ + ShowDeprecationWarning("getActuators()", "the actuators property"); + + PyObject* resultlist = PyList_New(m_linkedactuators.size()); + for (unsigned int index=0;indexGetProxy()); + } + + return resultlist; +} + +PyObject* SCA_IController::PyGetSensor(PyObject* value) +{ + + char *scriptArg = PyString_AsString(value); + if (scriptArg==NULL) { + PyErr_SetString(PyExc_TypeError, "controller.getSensor(string): Python Controller, expected a string (sensor name)"); + return NULL; + } + + for (unsigned int index=0;indexGetName(); + if (realname == scriptArg) + { + return sensor->GetProxy(); + } + } + + PyErr_Format(PyExc_AttributeError, "controller.getSensor(string): Python Controller, unable to find requested sensor \"%s\"", scriptArg); + return NULL; +} + +PyObject* SCA_IController::PyGetActuator(PyObject* value) +{ + + char *scriptArg = PyString_AsString(value); + if (scriptArg==NULL) { + PyErr_SetString(PyExc_TypeError, "controller.getActuator(string): Python Controller, expected a string (actuator name)"); + return NULL; + } + + for (unsigned int index=0;indexGetName() == scriptArg) + { + return actua->GetProxy(); + } + } + + PyErr_Format(PyExc_AttributeError, "controller.getActuator(string): Python Controller, unable to find requested actuator \"%s\"", scriptArg); + return NULL; +} + +PyObject* SCA_IController::PyGetSensors() +{ + ShowDeprecationWarning("getSensors()", "the sensors property"); + + PyObject* resultlist = PyList_New(m_linkedsensors.size()); + for (unsigned int index=0;indexGetProxy()); + } + + return resultlist; +} + +PyObject* SCA_IController::PyGetState() +{ + ShowDeprecationWarning("getState()", "the state property"); + return PyInt_FromLong(m_statemask); +} + +PyObject* SCA_IController::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + SCA_IController* self= static_cast(self_v); + return PyInt_FromLong(self->m_statemask); +} + +PyObject* SCA_IController::pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + SCA_IController* self= static_cast(self_v); + vector linkedsensors = self->GetLinkedSensors(); + PyObject* resultlist = PyList_New(linkedsensors.size()); + + for (unsigned int index=0;indexGetProxy()); + + return resultlist; +} + +PyObject* SCA_IController::pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + SCA_IController* self= static_cast(self_v); + vector linkedactuators = self->GetLinkedActuators(); + PyObject* resultlist = PyList_New(linkedactuators.size()); + + for (unsigned int index=0;indexGetProxy()); + + return resultlist; +} diff --git a/source/gameengine/GameLogic/SCA_IController.h b/source/gameengine/GameLogic/SCA_IController.h index f67c0942eb4..7ed83bc90b8 100644 --- a/source/gameengine/GameLogic/SCA_IController.h +++ b/source/gameengine/GameLogic/SCA_IController.h @@ -30,9 +30,11 @@ #define __KX_ICONTROLLER #include "SCA_ILogicBrick.h" +#include "PyObjectPlus.h" class SCA_IController : public SCA_ILogicBrick { + Py_Header; protected: std::vector m_linkedsensors; std::vector m_linkedactuators; @@ -51,7 +53,20 @@ public: void UnlinkSensor(class SCA_ISensor* sensor); void SetState(unsigned int state) { m_statemask = state; } void ApplyState(unsigned int state); - + + virtual PyObject* py_getattro(PyObject *attr); + virtual PyObject* py_getattro_dict(); + virtual int py_setattro(PyObject *attr, PyObject *value); + + KX_PYMETHOD_NOARGS(SCA_IController,GetSensors); + KX_PYMETHOD_NOARGS(SCA_IController,GetActuators); + KX_PYMETHOD_O(SCA_IController,GetSensor); + KX_PYMETHOD_O(SCA_IController,GetActuator); + KX_PYMETHOD_NOARGS(SCA_IController,GetState); + + static PyObject* pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); }; diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 0e78e03d5af..063a7b47321 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -157,10 +157,6 @@ int SCA_PythonController::IsTriggered(class SCA_ISensor* sensor) return 0; } -#if 0 -static const char* sPyGetCurrentController__doc__; -#endif - /* warning, self is not the SCA_PythonController, its a PyObjectPlus_Proxy */ PyObject* SCA_PythonController::sPyGetCurrentController(PyObject *self) { @@ -189,7 +185,7 @@ SCA_IActuator* SCA_PythonController::LinkedActuatorFromPy(PyObject *value) } } else if (BGE_PROXY_CHECK_TYPE(value)) { - PyObjectPlus *value_plus= BGE_PROXY_REF(value); /* Expecting an actuator type */ // XXX TODO - CHECK TYPE + PyObjectPlus *value_plus= BGE_PROXY_REF(value); for(it = lacts.begin(); it!= lacts.end(); it++) { if( static_cast(value_plus) == (*it) ) { return *it; @@ -205,13 +201,11 @@ SCA_IActuator* SCA_PythonController::LinkedActuatorFromPy(PyObject *value) return false; } -#if 0 -static const char* sPyAddActiveActuator__doc__; -#endif - /* warning, self is not the SCA_PythonController, its a PyObjectPlus_Proxy */ PyObject* SCA_PythonController::sPyAddActiveActuator(PyObject* self, PyObject* args) { + ShowDeprecationWarning("GameLogic.addActiveActuator(act, bool)", "controller.activate(act) or controller.deactivate(act)"); + PyObject* ob1; int activate; if (!PyArg_ParseTuple(args, "Oi:addActiveActuator", &ob1,&activate)) @@ -227,10 +221,8 @@ PyObject* SCA_PythonController::sPyAddActiveActuator(PyObject* self, PyObject* a Py_RETURN_NONE; } - const char* SCA_PythonController::sPyGetCurrentController__doc__ = "getCurrentController()"; const char* SCA_PythonController::sPyAddActiveActuator__doc__= "addActiveActuator(actuator,bool)"; -const char SCA_PythonController::GetActuators_doc[] = "getActuator"; PyTypeObject SCA_PythonController::Type = { #if (PY_VERSION_HEX >= 0x02060000) @@ -266,20 +258,14 @@ PyMethodDef SCA_PythonController::Methods[] = { {"activate", (PyCFunction) SCA_PythonController::sPyActivate, METH_O}, {"deactivate", (PyCFunction) SCA_PythonController::sPyDeActivate, METH_O}, - {"getActuators", (PyCFunction) SCA_PythonController::sPyGetActuators, METH_NOARGS, (PY_METHODCHAR)SCA_PythonController::GetActuators_doc}, - {"getActuator", (PyCFunction) SCA_PythonController::sPyGetActuator, METH_O, (PY_METHODCHAR)SCA_PythonController::GetActuator_doc}, - {"getSensors", (PyCFunction) SCA_PythonController::sPyGetSensors, METH_NOARGS, (PY_METHODCHAR)SCA_PythonController::GetSensors_doc}, - {"getSensor", (PyCFunction) SCA_PythonController::sPyGetSensor, METH_O, (PY_METHODCHAR)SCA_PythonController::GetSensor_doc}, //Deprecated functions ------> {"setScript", (PyCFunction) SCA_PythonController::sPySetScript, METH_O}, {"getScript", (PyCFunction) SCA_PythonController::sPyGetScript, METH_NOARGS}, - {"getState", (PyCFunction) SCA_PythonController::sPyGetState, METH_NOARGS}, //<----- Deprecated {NULL,NULL} //Sentinel }; PyAttributeDef SCA_PythonController::Attributes[] = { - KX_PYATTRIBUTE_RO_FUNCTION("state", SCA_PythonController, pyattr_get_state), KX_PYATTRIBUTE_RW_FUNCTION("script", SCA_PythonController, pyattr_get_script, pyattr_set_script), { NULL } //Sentinel }; @@ -498,6 +484,10 @@ PyObject* SCA_PythonController::py_getattro(PyObject *attr) py_getattro_up(SCA_IController); } +PyObject* SCA_PythonController::py_getattro_dict() { + py_getattro_dict_up(SCA_IController); +} + int SCA_PythonController::py_setattro(PyObject *attr, PyObject *value) { py_setattro_up(SCA_IController); @@ -527,84 +517,6 @@ PyObject* SCA_PythonController::PyDeActivate(PyObject *value) Py_RETURN_NONE; } -PyObject* SCA_PythonController::PyGetActuators() -{ - PyObject* resultlist = PyList_New(m_linkedactuators.size()); - for (unsigned int index=0;indexGetProxy()); - } - - return resultlist; -} - -const char SCA_PythonController::GetSensor_doc[] = -"getSensor (char sensorname) return linked sensor that is named [sensorname]\n"; -PyObject* -SCA_PythonController::PyGetSensor(PyObject* value) -{ - - char *scriptArg = PyString_AsString(value); - if (scriptArg==NULL) { - PyErr_SetString(PyExc_TypeError, "controller.getSensor(string): Python Controller, expected a string (sensor name)"); - return NULL; - } - - for (unsigned int index=0;indexGetName(); - if (realname == scriptArg) - { - return sensor->GetProxy(); - } - } - - PyErr_Format(PyExc_AttributeError, "controller.getSensor(string): Python Controller, unable to find requested sensor \"%s\"", scriptArg); - return NULL; -} - - - -const char SCA_PythonController::GetActuator_doc[] = -"getActuator (char sensorname) return linked actuator that is named [actuatorname]\n"; -PyObject* -SCA_PythonController::PyGetActuator(PyObject* value) -{ - - char *scriptArg = PyString_AsString(value); - if (scriptArg==NULL) { - PyErr_SetString(PyExc_TypeError, "controller.getActuator(string): Python Controller, expected a string (actuator name)"); - return NULL; - } - - for (unsigned int index=0;indexGetName() == scriptArg) - { - return actua->GetProxy(); - } - } - - PyErr_Format(PyExc_AttributeError, "controller.getActuator(string): Python Controller, unable to find requested actuator \"%s\"", scriptArg); - return NULL; -} - - -const char SCA_PythonController::GetSensors_doc[] = "getSensors returns a list of all attached sensors"; -PyObject* -SCA_PythonController::PyGetSensors() -{ - PyObject* resultlist = PyList_New(m_linkedsensors.size()); - for (unsigned int index=0;indexGetProxy()); - } - - return resultlist; -} - /* 1. getScript */ PyObject* SCA_PythonController::PyGetScript() { @@ -632,19 +544,6 @@ PyObject* SCA_PythonController::PySetScript(PyObject* value) Py_RETURN_NONE; } -/* 1. getScript */ -PyObject* SCA_PythonController::PyGetState() -{ - ShowDeprecationWarning("getState()", "the state property"); - return PyInt_FromLong(m_statemask); -} - -PyObject* SCA_PythonController::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) -{ - SCA_PythonController* self= static_cast(self_v); - return PyInt_FromLong(self->m_statemask); -} - PyObject* SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_PythonController* self= static_cast(self_v); diff --git a/source/gameengine/GameLogic/SCA_PythonController.h b/source/gameengine/GameLogic/SCA_PythonController.h index 587e6264d8c..0c2af79c3a3 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.h +++ b/source/gameengine/GameLogic/SCA_PythonController.h @@ -96,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); diff --git a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp index dcd11b551a1..cd21663f41d 100644 --- a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp +++ b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp @@ -84,6 +84,7 @@ #include "SCA_PropertySensor.h" #include "SCA_PythonController.h" #include "SCA_RandomActuator.h" +#include "SCA_IController.h" void initPyObjectPlusType(PyTypeObject **parents) @@ -225,9 +226,7 @@ void initPyTypes(void) PyType_Ready_Attr(dict, SCA_RandomSensor); PyType_Ready_Attr(dict, SCA_XNORController); PyType_Ready_Attr(dict, SCA_XORController); - - - + PyType_Ready_Attr(dict, SCA_IController); } #endif \ No newline at end of file diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 708dc29f137..d16c00ca272 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -59,7 +59,7 @@ Documentation for the GameLogic Module. actuator = co.getActuator("actuatorname") # Activate an actuator - GameLogic.addActiveActuator(actuator, True) + controller.activate(actuator) See the actuator's reference for available methods: - L{2DFilterActuator} @@ -307,6 +307,8 @@ KX_SCENE_RESUME: See L{KX_SceneActuator} @var VIEWMATRIX_INVERSE: @var VIEWMATRIX_INVERSETRANSPOSE: @var VIEWMATRIX_TRANSPOSE: + +@group Deprecated: addActiveActuator """ # TODO @@ -335,7 +337,7 @@ def getSceneList(): """ def addActiveActuator(actuator, activate): """ - Activates the given actuator. + Activates the given actuator. (B{deprecated}) @type actuator: L{SCA_IActuator} or the actuator name as a string. @type activate: boolean diff --git a/source/gameengine/PyDoc/KX_SceneActuator.py b/source/gameengine/PyDoc/KX_SceneActuator.py index 8e806c2c50e..937c94c91e6 100644 --- a/source/gameengine/PyDoc/KX_SceneActuator.py +++ b/source/gameengine/PyDoc/KX_SceneActuator.py @@ -20,7 +20,7 @@ class KX_SceneActuator(SCA_IActuator): @type camera: L{KX_Camera} on read, string or L{KX_Camera} on write @ivar useRestart: Set flag to True to restart the sene @type useRestart: bool - @type mode: The mode of the actuator + @ivar mode: The mode of the actuator @type mode: int from 0 to 5 L{GameLogic.Scene Actuator} """ def setUseRestart(flag): diff --git a/source/gameengine/PyDoc/SCA_IController.py b/source/gameengine/PyDoc/SCA_IController.py index f83e7c97dce..3e6ee45e115 100644 --- a/source/gameengine/PyDoc/SCA_IController.py +++ b/source/gameengine/PyDoc/SCA_IController.py @@ -5,5 +5,57 @@ from SCA_ILogicBrick import * class SCA_IController(SCA_ILogicBrick): """ Base class for all controller logic bricks. + + @ivar state: the controllers state bitmask. + This can be used with the GameObject's state to test if the controller is active. + @type state: int bitmask + @ivar sensors: a list of sensors linked to this controller + - note: the sensors are not necessarily owned by the same object. + - note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup. + @type sensors: list + @ivar actuators: a list of actuators linked to this controller. + - note: the sensors are not necessarily owned by the same object. + - note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup. + @type actuators: list + + @group Deprecated: getState, getSensors, getActuators """ + def getState(): + """ + DEPRECATED: use the state property + Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active. + This for instance will always be true however you could compare with a previous state to see when the state was activated. + GameLogic.getCurrentController().getState() & GameLogic.getCurrentController().getOwner().getState() + + @rtype: int + """ + def getSensors(): + """ + DEPRECATED: use the sensors property + Gets a list of all sensors attached to this controller. + + @rtype: list [L{SCA_ISensor}] + """ + def getSensor(name): + """ + Gets the named linked sensor. + + @type name: string + @rtype: L{SCA_ISensor} + """ + def getActuators(): + """ + DEPRECATED: use the actuators property + Gets a list of all actuators linked to this controller. + + @rtype: list [L{SCA_IActuator}] + """ + def getActuator(name): + """ + Gets the named linked actuator. + + @type name: string + @rtype: L{SCA_IActuator} + """ + \ No newline at end of file diff --git a/source/gameengine/PyDoc/SCA_PythonController.py b/source/gameengine/PyDoc/SCA_PythonController.py index 9684b41d481..7b9b6ccd80a 100644 --- a/source/gameengine/PyDoc/SCA_PythonController.py +++ b/source/gameengine/PyDoc/SCA_PythonController.py @@ -11,9 +11,8 @@ class SCA_PythonController(SCA_IController): @ivar script: the Python script this controller executes @type script: string, read-only - @ivar state: the controllers state bitmask. - This can be used with the GameObject's state to test if the controller is active. - @type state: integer + + @group Deprecated: getScript, setScript """ def activate(actuator): """ @@ -25,33 +24,6 @@ class SCA_PythonController(SCA_IController): Deactivates an actuator attached to this controller. @type actuator: actuator or the actuator name as a string """ - - def getSensors(): - """ - Gets a list of all sensors attached to this controller. - - @rtype: list [L{SCA_ISensor}] - """ - def getSensor(name): - """ - Gets the named linked sensor. - - @type name: string - @rtype: L{SCA_ISensor} - """ - def getActuators(): - """ - Gets a list of all actuators linked to this controller. - - @rtype: list [L{SCA_IActuator}] - """ - def getActuator(name): - """ - Gets the named linked actuator. - - @type name: string - @rtype: L{SCA_IActuator} - """ def getScript(): """ DEPRECATED: use the script property @@ -61,17 +33,9 @@ class SCA_PythonController(SCA_IController): """ def setScript(script): """ + DEPRECATED: use the script property Sets the Python script this controller executes. @type script: string. """ - def getState(): - """ - DEPRECATED: use the state property - Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active. - This for instance will always be true however you could compare with a previous state to see when the state was activated. - GameLogic.getCurrentController().getState() & GameLogic.getCurrentController().getOwner().getState() - - @rtype: int - """ -- cgit v1.2.3 From 94e9e954b1ce5395a66b1f66d3fdc1818fe96a6c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 6 May 2009 12:45:08 +0000 Subject: [#18681] Mousesensor Over doesn't work in ortho mode of 3dview camera bugfix, the clip near/far are scaled up for some reason, so use a range between 0 - clipfar for now. --- source/gameengine/Ketsji/KX_MouseFocusSensor.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index 9106902ca0e..8b7c3cb928b 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -230,18 +230,17 @@ bool KX_MouseFocusSensor::ParentObjectHasFocusCamera(KX_Camera *cam) */ frompoint.setValue( (2 * (m_x-x_lb) / width) - 1.0, 1.0 - (2 * (m_y - y_lb) / height), + /*cam->GetCameraData()->m_perspective ? 0.0:cdata->m_clipstart,*/ /* real clipstart is scaled in ortho for some reason, zero is ok */ 0.0, /* nearclip, see above comments */ 1.0 ); topoint.setValue( (2 * (m_x-x_lb) / width) - 1.0, 1.0 - (2 * (m_y-y_lb) / height), - 1.0, /* farclip, see above comments */ + cam->GetCameraData()->m_perspective ? 1.0:cam->GetCameraData()->m_clipend, /* farclip, see above comments */ 1.0 ); /* camera to world */ MT_Transform wcs_camcs_tranform = cam->GetWorldToCamera(); - if (!cam->GetCameraData()->m_perspective) - wcs_camcs_tranform.getOrigin()[2] *= 100.0; MT_Transform cams_wcs_transform; cams_wcs_transform.invert(wcs_camcs_tranform); -- cgit v1.2.3 From c46fa2745a98fe0b4545743751ad1e96802e330d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 7 May 2009 01:27:58 +0000 Subject: smudge on float images crashed --- source/blender/src/imagepaint.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c index ad155dc27a1..86534438ba0 100644 --- a/source/blender/src/imagepaint.c +++ b/source/blender/src/imagepaint.c @@ -3798,10 +3798,9 @@ static void *do_projectpaint_thread(void *ph_v) *projPixel->pixel.uint_pt = ((ProjPixelClone *)projPixel)->clonepx.uint; } - for (node= smearPixels_f; node; node= node->next) { /* this wont run for a float image */ + for (node= smearPixels_f; node; node= node->next) { projPixel = node->link; IMAPAINT_CHAR_RGBA_TO_FLOAT(projPixel->pixel.f_pt, ((ProjPixelClone *)projPixel)->clonepx.ch); - node = node->next; } BLI_memarena_free(smearArena); -- cgit v1.2.3 From 779bf435ef2ba87fbcee6a28b053d97a551b8eb5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 7 May 2009 05:23:15 +0000 Subject: python3 compatibility for the BGE api, this only works with scons when WITH_BF_NOBLENDER is enabled. Mathutils, Geometry and BGL modules are currently disabled with python3 --- .../blender/nodes/intern/SHD_nodes/SHD_dynamic.c | 5 ++++ source/blender/python/SConscript | 4 +++- source/gameengine/Expressions/PyObjectPlus.h | 17 +++++++++++++ source/gameengine/Ketsji/KX_PythonInit.cpp | 12 ++++++++-- source/gameengine/Ketsji/KX_VehicleWrapper.cpp | 27 ++------------------- source/gameengine/Ketsji/SConscript | 28 ++++++++++++---------- source/gameengine/VideoTexture/Texture.cpp | 2 +- 7 files changed, 53 insertions(+), 42 deletions(-) (limited to 'source') diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c index 9a8f2f13d65..4b20ca9da21 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c @@ -33,6 +33,11 @@ #include #endif +/* TODO, support python3.x */ +#if PY_VERSION_HEX >= 0x03000000 +#define DISABLE_PYTHON 1 +#endif + #include "DNA_text_types.h" #include "BKE_text.h" #include "BKE_utildefines.h" diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index e869cfba556..e06cf1840c5 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -30,4 +30,6 @@ if env['WITH_BF_FFMPEG']: if env['BF_BUILDINFO']: defs.append('NAN_BUILDINFO') -env.BlenderLib ( libname='blender_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype=['core','game2'], priority = [60,115] ) +# A bit dodgy but disable building with python3 +if not env['BF_PYTHON_VERSION'].startswith('3'): + env.BlenderLib ( libname='blender_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype=['core','game2'], priority = [60,115] ) diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 449ece535c1..c21dc3a6e57 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -43,6 +43,23 @@ * Python defines ------------------------------*/ + + +#if PY_VERSION_HEX > 0x03000000 +#define PyString_FromString PyUnicode_FromString +#define PyString_FromFormat PyUnicode_FromFormat +#define PyString_Check PyUnicode_Check +#define PyString_Size PyUnicode_GetSize + +#define PyInt_FromLong PyLong_FromSsize_t +#define PyInt_AsLong PyLong_AsSsize_t +#define PyString_AsString _PyUnicode_AsString +#define PyInt_Check PyLong_Check +#define PyInt_AS_LONG PyLong_AsLong // TODO - check this one +#endif + + + /* Py_RETURN_NONE Python 2.4 macro. diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 8eb8956cfe2..1a571633b15 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -88,10 +88,12 @@ #include "BKE_main.h" extern "C" { + #include "bpy_internal_import.h" /* from the blender python api, but we want to import text too! */ +#if PY_VERSION_HEX < 0x03000000 #include "Mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use. #include "Geometry.h" // Blender.Geometry module copied here so the blenderlayer can use. - #include "bpy_internal_import.h" /* from the blender python api, but we want to import text too! */ #include "BGL.h" +#endif } #include "marshal.h" /* python header for loading/saving dicts */ @@ -1770,7 +1772,7 @@ static void clearGameModules() clearModule(modules, "GameLogic"); clearModule(modules, "Rasterizer"); clearModule(modules, "GameKeys"); - clearModule(modules, "VideoTexture"); + clearModule(modules, "VideoTexture"); clearModule(modules, "Mathutils"); clearModule(modules, "Geometry"); clearModule(modules, "BGL"); @@ -2095,6 +2097,7 @@ PyObject* initGameKeys() return d; } +#if PY_VERSION_HEX < 0x03000000 PyObject* initMathutils() { return Mathutils_Init("Mathutils"); // Use as a top level module in BGE @@ -2109,6 +2112,11 @@ PyObject* initBGL() { return BGL_Init("BGL"); // Use as a top level module in BGE } +#else // TODO Py3k conversion +PyObject* initMathutils() {Py_INCREF(Py_None);return Py_None;} +PyObject* initGeometry() {Py_INCREF(Py_None);return Py_None;} +PyObject* initBGL() {Py_INCREF(Py_None);return Py_None;} +#endif void KX_SetActiveScene(class KX_Scene* scene) { diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp index e43a5caa50a..8146d04a878 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp @@ -312,32 +312,9 @@ PyObject* KX_VehicleWrapper::py_getattro_dict() { py_getattro_dict_up(PyObjectPlus); } -int KX_VehicleWrapper::py_setattro(PyObject *attr,PyObject* pyobj) +int KX_VehicleWrapper::py_setattro(PyObject *attr,PyObject* value) { - /* TODO - strange setattr, needs updating */ - PyTypeObject* type = pyobj->ob_type; - int result = 1; - - if (type == &PyList_Type) - { - result = 0; - } - if (type == &PyFloat_Type) - { - result = 0; - - } - if (type == &PyInt_Type) - { - result = 0; - } - if (type == &PyString_Type) - { - result = 0; - } - if (result) - result = PyObjectPlus::py_setattro(attr,pyobj); - return result; + py_setattro_up(PyObjectPlus); }; diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index dd7297080e5..2c87c7dd78a 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -7,25 +7,27 @@ sources = env.Glob('*.cpp') defs = '' # Mathutils C files. -sources.extend([\ - '#source/blender/python/api2_2x/Mathutils.c',\ - '#source/blender/python/api2_2x/Geometry.c',\ - '#source/blender/python/api2_2x/constant.c',\ - '#source/blender/python/api2_2x/euler.c',\ - '#source/blender/python/api2_2x/matrix.c',\ - '#source/blender/python/api2_2x/quat.c',\ - '#source/blender/python/api2_2x/vector.c',\ -]) +if not env['BF_PYTHON_VERSION'].startswith('3'): + # TODO - py3 support + sources.extend([\ + '#source/blender/python/api2_2x/Mathutils.c',\ + '#source/blender/python/api2_2x/Geometry.c',\ + '#source/blender/python/api2_2x/euler.c',\ + '#source/blender/python/api2_2x/matrix.c',\ + '#source/blender/python/api2_2x/quat.c',\ + '#source/blender/python/api2_2x/vector.c',\ + '#source/blender/python/api2_2x/constant.c',\ + ]) + + sources.extend([\ + '#source/blender/python/api2_2x/BGL.c' + ]) sources.extend([\ '#source/blender/python/api2_2x/bpy_internal_import.c' ]) -sources.extend([\ - '#source/blender/python/api2_2x/BGL.c' -]) - incs = '. #source/blender/python/api2_2x' # Only for Mathutils! and bpy_internal_import.h, be very careful incs += ' #source/kernel/gen_system #intern/string #intern/guardedalloc' diff --git a/source/gameengine/VideoTexture/Texture.cpp b/source/gameengine/VideoTexture/Texture.cpp index f1fcbee3041..a8ece4bc17e 100644 --- a/source/gameengine/VideoTexture/Texture.cpp +++ b/source/gameengine/VideoTexture/Texture.cpp @@ -168,7 +168,7 @@ void Texture_dealloc (Texture * self) // release scaled image buffer delete [] self->m_scaledImg; // release object - self->ob_type->tp_free((PyObject*)self); + ((PyObject *)self)->ob_type->tp_free((PyObject*)self); } -- cgit v1.2.3 From 42557f90bd16771a5c6437dbfb3952527df7fb1a Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 7 May 2009 09:13:01 +0000 Subject: BGE performance, 3rd round: culling and rasterizer. This commit extend the technique of dynamic linked list to the mesh slots so as to eliminate dumb scan or map lookup. It provides massive performance improvement in the culling and in the rasterizer when the majority of objects are static. Other improvements: - Compute the opengl matrix only for objects that are visible. - Simplify hash function for GEN_HasedPtr - Scan light list instead of general object list to render shadows - Remove redundant opengl calls to set specularity, shinyness and diffuse between each mesh slots. - Cache GPU material to avoid frequent call to GPU_material_from_blender - Only set once the fixed elements of mesh slot - Use more inline function The following table shows the performance increase between 2.48, 1st round and this round of improvement. The test was done with a scene containing 40000 objects, of which 1000 are in the view frustrum approximately. The object are simple textured cube to make sure the GPU is not the bottleneck. As some of the rasterizer processing time has moved under culling, I present the sum of scenegraph(includes culling)+rasterizer time Scenegraph+rasterizer(ms) 2.48 1st round 3rd round All objects static, 323.0 86.0 7.2 all visible, 1000 in the view frustrum All objects static, 219.0 49.7 N/A(*) all invisible. All objects moving, 323.0 105.6 34.7 all visible, 1000 in the view frustrum Scene destruction 40min 40min 4s (*) : this time is not representative because the frame rate was at 60fps. In that case, the GPU holds down the GE by frame sync. By design, the overhead of the rasterizer is 0 when the the objects are invisible. This table shows a global speed up between 9x and 45x compared to 2.48a for scenegraph, culling and rasterizer overhead. The speed up goes much higher when objects are invisible. An additional 2-4x speed up is possible in the scenegraph by upgrading the Moto library to use Eigen2 BLAS library instead of C++ classes but the scenegraph is already so fast that it is not a priority right now. Next speed up in logic: many things to do there... --- source/gameengine/Ketsji/BL_BlenderShader.cpp | 32 +++++------- source/gameengine/Ketsji/BL_BlenderShader.h | 13 ++++- source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 18 +++++-- source/gameengine/Ketsji/KX_BlenderMaterial.h | 1 + source/gameengine/Ketsji/KX_GameObject.cpp | 51 +++++++++++++++--- source/gameengine/Ketsji/KX_GameObject.h | 1 + source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 28 +++++----- source/gameengine/Ketsji/KX_Light.cpp | 5 +- source/gameengine/Ketsji/KX_PolygonMaterial.cpp | 15 ++++-- source/gameengine/Ketsji/KX_PythonInit.cpp | 7 +-- source/gameengine/Ketsji/KX_Scene.cpp | 2 + source/gameengine/Rasterizer/CMakeLists.txt | 1 + source/gameengine/Rasterizer/Makefile | 1 + source/gameengine/Rasterizer/RAS_BucketManager.cpp | 60 +++++++++++++++++++++- source/gameengine/Rasterizer/RAS_BucketManager.h | 1 + .../gameengine/Rasterizer/RAS_IPolygonMaterial.cpp | 3 ++ .../gameengine/Rasterizer/RAS_IPolygonMaterial.h | 1 + .../gameengine/Rasterizer/RAS_MaterialBucket.cpp | 12 ++--- source/gameengine/Rasterizer/RAS_MaterialBucket.h | 25 +++++++-- source/gameengine/Rasterizer/RAS_MeshObject.cpp | 8 ++- source/gameengine/Rasterizer/RAS_MeshObject.h | 2 +- .../Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt | 1 + .../Rasterizer/RAS_OpenGLRasterizer/Makefile | 1 + .../RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp | 2 +- .../Rasterizer/RAS_OpenGLRasterizer/SConscript | 2 +- source/gameengine/Rasterizer/SConscript | 2 +- source/gameengine/SceneGraph/SG_DList.h | 4 ++ source/gameengine/SceneGraph/SG_QList.h | 4 ++ source/gameengine/SceneGraph/SG_Spatial.cpp | 7 ++- source/gameengine/SceneGraph/SG_Spatial.h | 8 ++- source/gameengine/VideoTexture/ImageRender.cpp | 3 -- source/kernel/gen_system/GEN_HashedPtr.cpp | 9 +++- 32 files changed, 249 insertions(+), 81 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/BL_BlenderShader.cpp b/source/gameengine/Ketsji/BL_BlenderShader.cpp index 3df483b0598..a0a61d01bb2 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.cpp +++ b/source/gameengine/Ketsji/BL_BlenderShader.cpp @@ -20,41 +20,33 @@ BL_BlenderShader::BL_BlenderShader(KX_Scene *scene, struct Material *ma, int lig : mScene(scene), mMat(ma), - mLightLayer(lightlayer) + mLightLayer(lightlayer), + mGPUMat(NULL) { mBlenderScene = scene->GetBlenderScene(); mBlendMode = GPU_BLEND_SOLID; - if(mMat) - GPU_material_from_blender(mBlenderScene, mMat); + ReloadMaterial(); } BL_BlenderShader::~BL_BlenderShader() { - if(mMat && GPU_material_from_blender(mBlenderScene, mMat)) - GPU_material_unbind(GPU_material_from_blender(mBlenderScene, mMat)); + if(mGPUMat) + GPU_material_unbind(mGPUMat); } -bool BL_BlenderShader::Ok() +void BL_BlenderShader::ReloadMaterial() { - return VerifyShader(); -} - -bool BL_BlenderShader::VerifyShader() -{ - if(mMat) - return (GPU_material_from_blender(mBlenderScene, mMat) != 0); - else - return false; + mGPUMat = (mMat) ? GPU_material_from_blender(mBlenderScene, mMat) : NULL; } void BL_BlenderShader::SetProg(bool enable, double time) { if(VerifyShader()) { if(enable) - GPU_material_bind(GPU_material_from_blender(mBlenderScene, mMat), mLightLayer, mBlenderScene->lay, time); + GPU_material_bind(mGPUMat, mLightLayer, mBlenderScene->lay, time); else - GPU_material_unbind(GPU_material_from_blender(mBlenderScene, mMat)); + GPU_material_unbind(mGPUMat); } } @@ -66,7 +58,7 @@ int BL_BlenderShader::GetAttribNum() if(!VerifyShader()) return enabled; - GPU_material_vertex_attributes(GPU_material_from_blender(mBlenderScene, mMat), &attribs); + GPU_material_vertex_attributes(mGPUMat, &attribs); for(i = 0; i < attribs.totlayer; i++) if(attribs.layer[i].glindex+1 > enabled) @@ -89,7 +81,7 @@ void BL_BlenderShader::SetAttribs(RAS_IRasterizer* ras, const BL_Material *mat) if(!VerifyShader()) return; - gpumat = GPU_material_from_blender(mBlenderScene, mMat); + gpumat = mGPUMat; if(ras->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) { GPU_material_vertex_attributes(gpumat, &attribs); @@ -131,7 +123,7 @@ void BL_BlenderShader::Update(const RAS_MeshSlot & ms, RAS_IRasterizer* rasty ) float obmat[4][4], viewmat[4][4], viewinvmat[4][4], obcol[4]; GPUMaterial *gpumat; - gpumat = GPU_material_from_blender(mBlenderScene, mMat); + gpumat = mGPUMat; if(!gpumat || !GPU_material_bound(gpumat)) return; diff --git a/source/gameengine/Ketsji/BL_BlenderShader.h b/source/gameengine/Ketsji/BL_BlenderShader.h index 5c1f59f94ad..9af53bfc863 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.h +++ b/source/gameengine/Ketsji/BL_BlenderShader.h @@ -32,19 +32,28 @@ private: struct Material *mMat; int mLightLayer; int mBlendMode; + GPUMaterial *mGPUMat; - bool VerifyShader(); + bool VerifyShader() + { + return (NULL != mGPUMat); + } public: BL_BlenderShader(KX_Scene *scene, struct Material *ma, int lightlayer); virtual ~BL_BlenderShader(); - bool Ok(); + bool Ok() + { + // same as VerifyShared + return (NULL != mGPUMat); + } void SetProg(bool enable, double time=0.0); int GetAttribNum(); void SetAttribs(class RAS_IRasterizer* ras, const BL_Material *mat); void Update(const class RAS_MeshSlot & ms, class RAS_IRasterizer* rasty); + void ReloadMaterial(); int GetBlendMode(); bool Equals(BL_BlenderShader *blshader); diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 5f08739ea14..c3c738a8183 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -152,6 +152,12 @@ Scene* KX_BlenderMaterial::GetBlenderScene() const return mScene->GetBlenderScene(); } +void KX_BlenderMaterial::ReleaseMaterial() +{ + if (mBlenderShader) + mBlenderShader->ReloadMaterial(); +} + void KX_BlenderMaterial::OnConstruction() { if (mConstructed) @@ -409,10 +415,12 @@ KX_BlenderMaterial::ActivatShaders( } else rasty->SetLines(false); + ActivatGLMaterials(rasty); + ActivateTexGen(rasty); } - ActivatGLMaterials(rasty); - ActivateTexGen(rasty); + //ActivatGLMaterials(rasty); + //ActivateTexGen(rasty); } void @@ -501,10 +509,12 @@ KX_BlenderMaterial::ActivateMat( } else rasty->SetLines(false); + ActivatGLMaterials(rasty); + ActivateTexGen(rasty); } - ActivatGLMaterials(rasty); - ActivateTexGen(rasty); + //ActivatGLMaterials(rasty); + //ActivateTexGen(rasty); } bool diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index d763ba3ef03..52019ed2248 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -121,6 +121,7 @@ private: void GetMaterialRGBAColor(unsigned char *rgba) const; Material* GetBlenderMaterial() const; Scene* GetBlenderScene() const; + void ReleaseMaterial(); // message centers void setTexData( bool enable,RAS_IRasterizer *ras); diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 22b9c940178..b20c0dae97b 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -436,6 +436,7 @@ double* KX_GameObject::GetOpenGLMatrix() m_bIsNegativeScaling = ((scaling[0] < 0.0) ^ (scaling[1] < 0.0) ^ (scaling[2] < 0.0)) ? true : false; trans.scale(scaling[0], scaling[1], scaling[2]); trans.getValue(fl); + GetSGNode()->ClearDirty(); } return fl; } @@ -443,8 +444,27 @@ double* KX_GameObject::GetOpenGLMatrix() void KX_GameObject::AddMeshUser() { for (size_t i=0;iAddMeshUser(this); - + { + m_meshes[i]->AddMeshUser(this, &m_meshSlots); + } + // set the part of the mesh slot that never change + double* fl = GetOpenGLMatrixPtr()->getPointer(); + RAS_Deformer *deformer = GetDeformer(); + + //RAS_MeshSlot *ms; + //for(ms =static_cast(m_meshSlots.QPeek()); + // ms!=static_cast(m_meshSlots.Self()); + // ms =static_cast(ms->QPeek())) + //{ + // ms->m_OpenGLMatrix = fl; + // ms->SetDeformer(deformer); + //} + SG_QList::iterator mit(m_meshSlots); + for(mit.begin(); !mit.end(); ++mit) + { + (*mit)->m_OpenGLMatrix = fl; + (*mit)->SetDeformer(deformer); + } UpdateBuckets(false); } @@ -468,10 +488,29 @@ static void UpdateBuckets_recursive(SG_Node* node) void KX_GameObject::UpdateBuckets( bool recursive ) { if (GetSGNode()) { - double* fl = GetOpenGLMatrixPtr()->getPointer(); - - for (size_t i=0;iUpdateBuckets(this, fl, m_bUseObjectColor, m_objectColor, m_bVisible, m_bCulled); + RAS_MeshSlot *ms; + + if (GetSGNode()->IsDirty()) + GetOpenGLMatrix(); + //for(ms =static_cast(m_meshSlots.QPeek()); + // ms!=static_cast(m_meshSlots.Self()); + // ms =static_cast(ms->QPeek())) + SG_QList::iterator mit(m_meshSlots); + for(mit.begin(); !mit.end(); ++mit) + { + ms = *mit; + ms->m_bObjectColor = m_bUseObjectColor; + ms->m_RGBAcolor = m_objectColor; + ms->m_bVisible = m_bVisible; + ms->m_bCulled = m_bCulled || !m_bVisible; + if (!ms->m_bCulled) + ms->m_bucket->ActivateMesh(ms); + + /* split if necessary */ +#ifdef USE_SPLIT + ms->Split(); +#endif + } if (recursive) { UpdateBuckets_recursive(GetSGNode()); diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index bbb1b8bb360..2869404ee9b 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -77,6 +77,7 @@ protected: STR_String m_text; int m_layer; std::vector m_meshes; + SG_QList m_meshSlots; // head of mesh slots of this struct Object* m_pBlenderObject; struct Object* m_pBlenderGroupObject; diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index d6747bd1ba4..e773a9571f1 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -296,11 +296,13 @@ void KX_KetsjiEngine::RenderDome() return; KX_SceneList::iterator sceneit; - for (sceneit = m_scenes.begin();sceneit != m_scenes.end(); sceneit++) - { - // do this only once per scene - (*sceneit)->UpdateMeshTransformations(); - } + + // This is now done incrementally in KX_Scene::CalculateVisibleMeshes() + //for (sceneit = m_scenes.begin();sceneit != m_scenes.end(); sceneit++) + //{ + // // do this only once per scene + // (*sceneit)->UpdateMeshTransformations(); + //} int n_renders=m_dome->GetNumberRenders();// usually 4 or 6 for (int i=0;iGetWorldInfo()); - // do this only once per scene - scene->UpdateMeshTransformations(); + // this is now done incrementatlly in KX_Scene::CalculateVisibleMeshes + //scene->UpdateMeshTransformations(); // shadow buffers RenderShadowBuffers(scene); @@ -1119,16 +1121,13 @@ void KX_KetsjiEngine::GetSceneViewport(KX_Scene *scene, KX_Camera* cam, RAS_Rect void KX_KetsjiEngine::RenderShadowBuffers(KX_Scene *scene) { - CListValue *objectlist = scene->GetObjectList(); + CListValue *lightlist = scene->GetLightList(); int i, drawmode; m_rendertools->SetAuxilaryClientInfo(scene); - for(i=0; iGetCount(); i++) { - KX_GameObject *gameobj = (KX_GameObject*)objectlist->GetValue(i); - - if(!gameobj->IsLight()) - continue; + for(i=0; iGetCount(); i++) { + KX_GameObject *gameobj = (KX_GameObject*)lightlist->GetValue(i); KX_LightObject *light = (KX_LightObject*)gameobj; @@ -1268,9 +1267,6 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam) m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldOrientation(), cam->NodeGetWorldPosition(), cam->GetCameraData()->m_perspective); cam->SetModelviewMatrix(viewmat); - //redundant, already done in Render() - //scene->UpdateMeshTransformations(); - // The following actually reschedules all vertices to be // redrawn. There is a cache between the actual rescheduling // and this call though. Visibility is imparted when this call diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index 0f90bfd8a02..777a7f32629 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -102,8 +102,11 @@ void KX_LightObject::Update() { GPULamp *lamp; - if((lamp = GetGPULamp())) { + if((lamp = GetGPULamp()) != NULL && GetSGNode()) { float obmat[4][4]; + // lights don't get their openGL matrix updated, do it now + if (GetSGNode()->IsDirty()) + GetOpenGLMatrix(); double *dobmat = GetOpenGLMatrixPtr()->getPointer(); for(int i=0; i<4; i++) diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index 918c251599e..2aa0ef921e9 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -172,13 +172,18 @@ void KX_PolygonMaterial::DefaultActivate(RAS_IRasterizer* rasty, TCachingInfo& c rasty->SetLines(true); else rasty->SetLines(false); + rasty->SetSpecularity(m_specular[0],m_specular[1],m_specular[2],m_specularity); + rasty->SetShinyness(m_shininess); + rasty->SetDiffuse(m_diffuse[0], m_diffuse[1],m_diffuse[2], 1.0); + if (m_material) + rasty->SetPolygonOffset(-m_material->zoffs, 0.0); } - rasty->SetSpecularity(m_specular[0],m_specular[1],m_specular[2],m_specularity); - rasty->SetShinyness(m_shininess); - rasty->SetDiffuse(m_diffuse[0], m_diffuse[1],m_diffuse[2], 1.0); - if (m_material) - rasty->SetPolygonOffset(-m_material->zoffs, 0.0); + //rasty->SetSpecularity(m_specular[0],m_specular[1],m_specular[2],m_specularity); + //rasty->SetShinyness(m_shininess); + //rasty->SetDiffuse(m_diffuse[0], m_diffuse[1],m_diffuse[2], 1.0); + //if (m_material) + // rasty->SetPolygonOffset(-m_material->zoffs, 0.0); } void KX_PolygonMaterial::GetMaterialRGBAColor(unsigned char *rgba) const diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 1a571633b15..57f736a6c09 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -936,16 +936,17 @@ static PyObject* gPySetGLSLMaterialSetting(PyObject*, /* display lists and GLSL materials need to be remade */ if(G.fileflags != fileflags) { + GPU_materials_free(); if(gp_KetsjiEngine) { KX_SceneList *scenes = gp_KetsjiEngine->CurrentScenes(); KX_SceneList::iterator it; for(it=scenes->begin(); it!=scenes->end(); it++) - if((*it)->GetBucketManager()) + if((*it)->GetBucketManager()) { (*it)->GetBucketManager()->ReleaseDisplayLists(); + (*it)->GetBucketManager()->ReleaseMaterials(); + } } - - GPU_materials_free(); } Py_RETURN_NONE; diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index d31d451f02e..7280071cd1d 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -488,6 +488,8 @@ KX_GameObject* KX_Scene::AddNodeReplicaObject(class SG_IObject* node, class CVal // this is the list of object that are send to the graphics pipeline m_objectlist->Add(newobj->AddRef()); + if (newobj->IsLight()) + m_lightlist->Add(newobj->AddRef()); newobj->AddMeshUser(); // logic cannot be replicated, until the whole hierarchy is replicated. diff --git a/source/gameengine/Rasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/CMakeLists.txt index 69a167e54a9..143209f5a54 100644 --- a/source/gameengine/Rasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/CMakeLists.txt @@ -30,6 +30,7 @@ SET(INC . ../../../source/kernel/gen_system ../../../source/blender/makesdna + ../../../source/gameengine/SceneGraph ../../../intern/string ../../../intern/moto/include ../../../extern/glew/include diff --git a/source/gameengine/Rasterizer/Makefile b/source/gameengine/Rasterizer/Makefile index fa6cf94c4b6..eafa2ded2f2 100644 --- a/source/gameengine/Rasterizer/Makefile +++ b/source/gameengine/Rasterizer/Makefile @@ -41,6 +41,7 @@ CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include CPPFLAGS += -I../../kernel/gen_system CPPFLAGS += -I../../blender/makesdna +CPPFLAGS += -I../SceneGraph CPPFLAGS += -I../BlenderRoutines CPPFLAGS += -I../Expressions diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp index ec290f89d9e..a111ac2786f 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp +++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp @@ -113,16 +113,38 @@ void RAS_BucketManager::OrderBuckets(const MT_Transform& cameratrans, BucketList const MT_Vector3 pnorm(cameratrans.getBasis()[2]); for (bit = buckets.begin(); bit != buckets.end(); ++bit) + { +#if 1 + SG_DList::iterator mit((*bit)->GetActiveMeshSlots()); + for(mit.begin(); !mit.end(); ++mit) + size++; +#else for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) if (!mit->IsCulled()) size++; +#endif + } slots.resize(size); for (bit = buckets.begin(); bit != buckets.end(); ++bit) + { +#if 1 + RAS_MaterialBucket* bucket = *bit; + RAS_MeshSlot* ms; + // remove the mesh slot form the list, it culls them automatically for next frame + for(ms = bucket->GetNextActiveMeshSlot(); + ms!= NULL; + ms = bucket->GetNextActiveMeshSlot()) + { + slots[i++].set(ms, bucket, pnorm); + } +#else for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) if (!mit->IsCulled()) slots[i++].set(&*mit, *bit, pnorm); +#endif + } if(alpha) sort(slots.begin(), slots.end(), backtofront()); @@ -161,11 +183,28 @@ void RAS_BucketManager::RenderSolidBuckets( const MT_Transform& cameratrans, RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools) { BucketList::iterator bit; - list::iterator mit; rasty->SetDepthMask(RAS_IRasterizer::KX_DEPTHMASK_ENABLED); for (bit = m_SolidBuckets.begin(); bit != m_SolidBuckets.end(); ++bit) { +#if 1 + RAS_MaterialBucket* bucket = *bit; + RAS_MeshSlot* ms; + // remove the mesh slot form the list, it culls them automatically for next frame + for(ms = bucket->GetNextActiveMeshSlot(); + ms!= NULL; + ms = bucket->GetNextActiveMeshSlot()) + { + rendertools->SetClientObject(rasty, ms->m_clientObj); + while (bucket->ActivateMaterial(cameratrans, rasty, rendertools)) + bucket->RenderMeshSlot(cameratrans, rasty, rendertools, *ms); + + // make this mesh slot culled automatically for next frame + // it will be culled out by frustrum culling + ms->SetCulled(true); + } +#else + list::iterator mit; for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) { if (mit->IsCulled()) continue; @@ -179,6 +218,7 @@ void RAS_BucketManager::RenderSolidBuckets( // it will be culled out by frustrum culling mit->SetCulled(true); } +#endif } /* this code draws meshes order front-to-back instead to reduce overdraw. @@ -276,3 +316,21 @@ void RAS_BucketManager::ReleaseDisplayLists(RAS_IPolyMaterial *mat) } } +void RAS_BucketManager::ReleaseMaterials(RAS_IPolyMaterial * mat) +{ + BucketList::iterator bit; + list::iterator mit; + + for (bit = m_SolidBuckets.begin(); bit != m_SolidBuckets.end(); ++bit) { + if (mat == NULL || (mat == (*bit)->GetPolyMaterial())) { + (*bit)->GetPolyMaterial()->ReleaseMaterial(); + } + } + + for (bit = m_AlphaBuckets.begin(); bit != m_AlphaBuckets.end(); ++bit) { + if (mat == NULL || (mat == (*bit)->GetPolyMaterial())) { + (*bit)->GetPolyMaterial()->ReleaseMaterial(); + } + } +} + diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.h b/source/gameengine/Rasterizer/RAS_BucketManager.h index 74526f365a0..2b81ddd3c82 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.h +++ b/source/gameengine/Rasterizer/RAS_BucketManager.h @@ -58,6 +58,7 @@ public: void OptimizeBuckets(MT_Scalar distance); void ReleaseDisplayLists(RAS_IPolyMaterial * material = NULL); + void ReleaseMaterials(RAS_IPolyMaterial * material = NULL); private: void OrderBuckets(const MT_Transform& cameratrans, BucketList& buckets, vector& slots, bool alpha); diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp index c10e4040a92..f2fd96d63e9 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp @@ -227,6 +227,9 @@ Scene* RAS_IPolyMaterial::GetBlenderScene() const return NULL; } +void RAS_IPolyMaterial::ReleaseMaterial() +{ +} unsigned int RAS_IPolyMaterial::GetFlag() const { diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index 1bc03a1db05..decd93c3d13 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -160,6 +160,7 @@ public: virtual Material* GetBlenderMaterial() const; virtual Scene* GetBlenderScene() const; + virtual void ReleaseMaterial(); virtual void GetMaterialRGBAColor(unsigned char *rgba) const; virtual bool UsesLighting(RAS_IRasterizer *rasty) const; virtual bool UsesObjectColor() const; diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index d63e9c98415..db6394c1ec0 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -42,7 +42,7 @@ /* mesh slot */ -RAS_MeshSlot::RAS_MeshSlot() +RAS_MeshSlot::RAS_MeshSlot() : SG_QList() { m_clientObj = NULL; m_pDeformer = NULL; @@ -82,7 +82,7 @@ RAS_MeshSlot::~RAS_MeshSlot() } } -RAS_MeshSlot::RAS_MeshSlot(const RAS_MeshSlot& slot) +RAS_MeshSlot::RAS_MeshSlot(const RAS_MeshSlot& slot) : SG_QList() { RAS_DisplayArrayList::iterator it; @@ -461,21 +461,21 @@ bool RAS_MeshSlot::Split(bool force) return false; } + +#ifdef USE_SPLIT bool RAS_MeshSlot::IsCulled() { - list::iterator it; - if(m_joinSlot) return true; if(!m_bCulled) return false; -#ifdef USE_SPLIT + list::iterator it; for(it=m_joinedSlots.begin(); it!=m_joinedSlots.end(); it++) if(!(*it)->m_bCulled) return false; -#endif return true; } +#endif /* material bucket sorting */ diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h index b07f86b079e..8db75b8b735 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h @@ -32,6 +32,7 @@ #include "RAS_TexVert.h" #include "GEN_Map.h" #include "STR_HashedString.h" +#include "SG_QList.h" #include "MT_Transform.h" #include "RAS_IPolygonMaterial.h" @@ -89,7 +90,9 @@ public: /* Entry of a RAS_MeshObject into RAS_MaterialBucket */ typedef std::vector RAS_DisplayArrayList; -class RAS_MeshSlot +// The QList is used to link the mesh slots to the object +// The DList is used to link the visible mesh slots to the material bucket +class RAS_MeshSlot : public SG_QList { friend class RAS_ListRasterizer; private: @@ -160,7 +163,11 @@ public: bool Split(bool force=false); bool Join(RAS_MeshSlot *target, MT_Scalar distance); bool Equals(RAS_MeshSlot *target); +#ifdef USE_SPLIT bool IsCulled(); +#else + bool IsCulled() { return m_bCulled; } +#endif void SetCulled(bool culled) { m_bCulled = culled; } }; @@ -171,7 +178,6 @@ class RAS_MeshMaterial public: RAS_MeshSlot *m_baseslot; class RAS_MaterialBucket *m_bucket; - GEN_Map m_slots; }; @@ -208,10 +214,23 @@ public: class RAS_MeshSlot* CopyMesh(class RAS_MeshSlot *ms); void RemoveMesh(class RAS_MeshSlot* ms); void Optimize(MT_Scalar distance); + void ActivateMesh(RAS_MeshSlot* slot) + { + m_activeMeshSlotsHead.AddBack(slot); + } + SG_DList& GetActiveMeshSlots() + { + return m_activeMeshSlotsHead; + } + RAS_MeshSlot* GetNextActiveMeshSlot() + { + return (RAS_MeshSlot*)m_activeMeshSlotsHead.Remove(); + } private: - list m_meshSlots; + list m_meshSlots; // all the mesh slots RAS_IPolyMaterial* m_material; + SG_DList m_activeMeshSlotsHead; // only those which must be rendered }; diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index 278aa9c75e2..c3223cb9448 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -242,6 +242,7 @@ RAS_Polygon* RAS_MeshObject::AddPolygon(RAS_MaterialBucket *bucket, int numverts RAS_MeshMaterial meshmat; meshmat.m_bucket = bucket; meshmat.m_baseslot = meshmat.m_bucket->AddMesh(numverts); + meshmat.m_baseslot->m_mesh = this; m_materials.push_back(meshmat); mmat = &m_materials.back(); } @@ -381,7 +382,7 @@ RAS_TexVert* RAS_MeshObject::GetVertex(unsigned int matid, return NULL; } -void RAS_MeshObject::AddMeshUser(void *clientobj) +void RAS_MeshObject::AddMeshUser(void *clientobj, SG_QList *head) { list::iterator it; @@ -391,6 +392,7 @@ void RAS_MeshObject::AddMeshUser(void *clientobj) RAS_MeshSlot *ms = it->m_bucket->CopyMesh(it->m_baseslot); ms->m_clientObj = clientobj; it->m_slots.insert(clientobj, ms); + head->QAddBack(ms); } } @@ -402,7 +404,7 @@ void RAS_MeshObject::UpdateBuckets(void* clientobj, bool culled) { list::iterator it; - + for(it = m_materials.begin();it!=m_materials.end();++it) { RAS_MeshSlot **msp = it->m_slots[clientobj]; @@ -417,6 +419,8 @@ void RAS_MeshObject::UpdateBuckets(void* clientobj, ms->m_RGBAcolor = rgbavec; ms->m_bVisible = visible; ms->m_bCulled = culled || !visible; + if (!ms->m_bCulled) + ms->m_bucket->ActivateMesh(ms); /* split if necessary */ #ifdef USE_SPLIT diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h index cc50f9c783d..a2283b9bc5d 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_MeshObject.h @@ -130,7 +130,7 @@ public: RAS_Polygon* GetPolygon(int num) const; /* buckets */ - virtual void AddMeshUser(void *clientobj); + virtual void AddMeshUser(void *clientobj, SG_QList *head); virtual void UpdateBuckets( void* clientobj, double* oglmatrix, diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt index d061a449b7e..fe3d0f6aeea 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt @@ -32,6 +32,7 @@ SET(INC ../../../../intern/moto/include ../../../../source/gameengine/Rasterizer ../../../../source/gameengine/Ketsji + ../../../../source/gameengine/SceneGraph ../../../../extern/glew/include ../../../../source/blender/gpu ../../../../source/blender/makesdna diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile index b55f6492805..0327714dc5f 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile @@ -47,6 +47,7 @@ CPPFLAGS += -I../../../blender/blenlib CPPFLAGS += -I../../../blender/blenkernel CPPFLAGS += -I../../BlenderRoutines CPPFLAGS += -I../../Ketsji +CPPFLAGS += -I../../SceneGraph CPPFLAGS += -I.. CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp index 06c61fb4b09..3ae4522f8e1 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp @@ -214,7 +214,7 @@ void RAS_ListRasterizer::IndexPrimitivesMulti(RAS_MeshSlot& ms) // workaround: note how we do not use vertex arrays for making display // lists, since glVertexAttribPointerARB doesn't seem to work correct // in display lists on ATI? either a bug in the driver or in Blender .. - if (mUseVertexArrays && !localSlot && !ms.m_pDerivedMesh) + if (mUseVertexArrays && /*!localSlot &&*/ !ms.m_pDerivedMesh) RAS_VAOpenGLRasterizer::IndexPrimitivesMulti(ms); else RAS_OpenGLRasterizer::IndexPrimitivesMulti(ms); diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript index 314630297e0..d4b029ea34d 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('*.cpp') incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/Rasterizer #source/gameengine/BlenderRoutines ' incs += ' #source/blender/gpu #extern/glew/include ' + env['BF_OPENGL_INC'] -incs += ' #source/blender/gameengine/Ketsji #source/blender/makesdna #source/blender/blenkernel' +incs += ' #source/blender/gameengine/Ketsji #source/gameengine/SceneGraph #source/blender/makesdna #source/blender/blenkernel' incs += ' #intern/guardedalloc #source/blender/blenlib' cxxflags = [] diff --git a/source/gameengine/Rasterizer/SConscript b/source/gameengine/Rasterizer/SConscript index a16a04b8514..771d3399485 100644 --- a/source/gameengine/Rasterizer/SConscript +++ b/source/gameengine/Rasterizer/SConscript @@ -4,7 +4,7 @@ Import ('env') sources = env.Glob('*.cpp') -incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/BlenderRoutines #extern/glew/include #source/gameengine/Expressions #source/blender/blenkernel #source/blender/makesdna' +incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/BlenderRoutines #extern/glew/include #source/gameengine/Expressions #source/gameengine/SceneGraph #source/blender/blenkernel #source/blender/makesdna' incs += ' ' + env['BF_PYTHON_INC'] cxxflags = [] diff --git a/source/gameengine/SceneGraph/SG_DList.h b/source/gameengine/SceneGraph/SG_DList.h index d682be679e6..dc5afa2ee99 100644 --- a/source/gameengine/SceneGraph/SG_DList.h +++ b/source/gameengine/SceneGraph/SG_DList.h @@ -83,6 +83,10 @@ public: { m_flink = m_blink = this; } + SG_DList(const SG_DList& other) + { + m_flink = m_blink = this; + } virtual ~SG_DList() { Delink(); diff --git a/source/gameengine/SceneGraph/SG_QList.h b/source/gameengine/SceneGraph/SG_QList.h index efaa613bbb9..4a254ac36a4 100644 --- a/source/gameengine/SceneGraph/SG_QList.h +++ b/source/gameengine/SceneGraph/SG_QList.h @@ -84,6 +84,10 @@ public: { m_fqlink = m_bqlink = this; } + SG_QList(const SG_QList& other) : SG_DList() + { + m_fqlink = m_bqlink = this; + } virtual ~SG_QList() { QDelink(); diff --git a/source/gameengine/SceneGraph/SG_Spatial.cpp b/source/gameengine/SceneGraph/SG_Spatial.cpp index b79d4bac91a..5a47f07f573 100644 --- a/source/gameengine/SceneGraph/SG_Spatial.cpp +++ b/source/gameengine/SceneGraph/SG_Spatial.cpp @@ -56,7 +56,8 @@ SG_Spatial( m_bbox(MT_Point3(-1.0, -1.0, -1.0), MT_Point3(1.0, 1.0, 1.0)), m_radius(1.0), - m_modified(false) + m_modified(false), + m_ogldirty(false) { } @@ -76,7 +77,9 @@ SG_Spatial( m_parent_relation(NULL), m_bbox(other.m_bbox), - m_radius(other.m_radius) + m_radius(other.m_radius), + m_modified(false), + m_ogldirty(false) { // duplicate the parent relation for this object m_parent_relation = other.m_parent_relation->NewCopy(); diff --git a/source/gameengine/SceneGraph/SG_Spatial.h b/source/gameengine/SceneGraph/SG_Spatial.h index eb1e87fbf19..d1fc95cceac 100644 --- a/source/gameengine/SceneGraph/SG_Spatial.h +++ b/source/gameengine/SceneGraph/SG_Spatial.h @@ -63,19 +63,24 @@ protected: SG_BBox m_bbox; MT_Scalar m_radius; bool m_modified; + bool m_ogldirty; // true if the openGL matrix for this object must be recomputed public: inline void ClearModified() { m_modified = false; + m_ogldirty = true; } inline void SetModified() { m_modified = true; ActivateScheduleUpdateCallback(); } - + inline void ClearDirty() + { + m_ogldirty = false; + } /** * Define the realtionship this node has with it's parent * node. You should pass an unshared instance of an SG_ParentRelation @@ -233,6 +238,7 @@ public: MT_Scalar Radius() const { return m_radius; } void SetRadius(MT_Scalar radius) { m_radius = radius; } bool IsModified() { return m_modified; } + bool IsDirty() { return m_ogldirty; } protected: friend class SG_Controller; diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index 1e3a84c1efb..db4461325d8 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -255,9 +255,6 @@ void ImageRender::Render() // restore the stereo mode now that the matrix is computed m_rasterizer->SetStereoMode(stereomode); - // do not update the mesh transform, we don't want to do it more than once per frame - //m_scene->UpdateMeshTransformations(); - m_scene->CalculateVisibleMeshes(m_rasterizer,m_camera); m_scene->RenderBuckets(camtrans, m_rasterizer, m_rendertools); diff --git a/source/kernel/gen_system/GEN_HashedPtr.cpp b/source/kernel/gen_system/GEN_HashedPtr.cpp index 6dbed1fb7a8..ff9de465a34 100644 --- a/source/kernel/gen_system/GEN_HashedPtr.cpp +++ b/source/kernel/gen_system/GEN_HashedPtr.cpp @@ -40,11 +40,12 @@ // is a 32-bit integer, use all the bits of the pointer as long // as possible. // - +#if 1 unsigned int GEN_Hash(void * inDWord) { uintptr_t key = (uintptr_t)inDWord; - +#if 0 + // this is way too complicated key += ~(key << 16); key ^= (key >> 5); key += (key << 3); @@ -53,4 +54,8 @@ unsigned int GEN_Hash(void * inDWord) key ^= (key >> 17); return (unsigned int)(key & 0xffffffff); +#else + return (unsigned int)(key ^ (key>>4)); +#endif } +#endif \ No newline at end of file -- cgit v1.2.3 From f590ffdadc0dceac9d37d30dc565ca083c3c7fca Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 7 May 2009 14:53:40 +0000 Subject: [#18645] Texture painting smudge brush darkens images - 2.49RC1 not fixed but the problem is now less bad when projection painting, bilinear interpolation was rounding down. - added gameOb.attrDict to get the internal gameObject dict. - mesh.getVertex wasnt setting an exception. --- source/blender/imbuf/intern/imageprocess.c | 10 ++++++---- source/gameengine/Ketsji/KX_GameObject.cpp | 12 ++++++++++++ source/gameengine/Ketsji/KX_GameObject.h | 1 + source/gameengine/Ketsji/KX_MeshProxy.cpp | 25 +++++++++++-------------- source/gameengine/PyDoc/KX_GameObject.py | 2 ++ 5 files changed, 32 insertions(+), 18 deletions(-) (limited to 'source') diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c index fe7e26eac2b..6be257ff737 100644 --- a/source/blender/imbuf/intern/imageprocess.c +++ b/source/blender/imbuf/intern/imageprocess.c @@ -294,10 +294,12 @@ void bilinear_interpolation_color(struct ImBuf *in, unsigned char *outI, float * b= v-floor(v); a_b= a*b; ma_b= (1.0f-a)*b; a_mb= a*(1.0f-b); ma_mb= (1.0f-a)*(1.0f-b); - outI[0]= ma_mb*row1I[0] + a_mb*row3I[0] + ma_b*row2I[0]+ a_b*row4I[0]; - outI[1]= ma_mb*row1I[1] + a_mb*row3I[1] + ma_b*row2I[1]+ a_b*row4I[1]; - outI[2]= ma_mb*row1I[2] + a_mb*row3I[2] + ma_b*row2I[2]+ a_b*row4I[2]; - outI[3]= ma_mb*row1I[3] + a_mb*row3I[3] + ma_b*row2I[3]+ a_b*row4I[3]; + /* need to add 0.5 to avoid rounding down (causes darken with the smear brush) + * tested with white images and this should not wrap back to zero */ + outI[0]= (ma_mb*row1I[0] + a_mb*row3I[0] + ma_b*row2I[0]+ a_b*row4I[0]) + 0.5f; + outI[1]= (ma_mb*row1I[1] + a_mb*row3I[1] + ma_b*row2I[1]+ a_b*row4I[1]) + 0.5f; + outI[2]= (ma_mb*row1I[2] + a_mb*row3I[2] + ma_b*row2I[2]+ a_b*row4I[2]) + 0.5f; + outI[3]= (ma_mb*row1I[3] + a_mb*row3I[3] + ma_b*row2I[3]+ a_b*row4I[3]) + 0.5f; } } diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index b20c0dae97b..492f72584f5 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1208,6 +1208,7 @@ PyAttributeDef KX_GameObject::Attributes[] = { KX_PYATTRIBUTE_RW_FUNCTION("worldPosition", KX_GameObject, pyattr_get_worldPosition, pyattr_set_worldPosition), KX_PYATTRIBUTE_RW_FUNCTION("localScaling", KX_GameObject, pyattr_get_localScaling, pyattr_set_localScaling), KX_PYATTRIBUTE_RO_FUNCTION("worldScaling", KX_GameObject, pyattr_get_worldScaling), + KX_PYATTRIBUTE_RO_FUNCTION("attrDict", KX_GameObject, pyattr_get_attrDict), /* Experemental, dont rely on these yet */ KX_PYATTRIBUTE_RO_FUNCTION("sensors", KX_GameObject, pyattr_get_sensors), @@ -1766,6 +1767,17 @@ PyObject* KX_GameObject::pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE return resultlist; } +PyObject* KX_GameObject::pyattr_get_attrDict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + KX_GameObject* self= static_cast(self_v); + + if(self->m_attr_dict==NULL) + self->m_attr_dict= PyDict_New(); + + Py_INCREF(self->m_attr_dict); + return self->m_attr_dict; +} + /* We need these because the macros have a return in them */ PyObject* KX_GameObject::py_getattro__internal(PyObject *attr) { diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 2869404ee9b..8fafcc1f9b6 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -895,6 +895,7 @@ public: static PyObject* pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static PyObject* pyattr_get_meshes(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_attrDict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); /* Experemental! */ static PyObject* pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index eede3a0e832..c0b05859539 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -221,24 +221,21 @@ PyObject* KX_MeshProxy::PyGetVertexArrayLength(PyObject* args, PyObject* kwds) PyObject* KX_MeshProxy::PyGetVertex(PyObject* args, PyObject* kwds) { - int vertexindex= 1; - int matindex= 1; + int vertexindex; + int matindex; PyObject* vertexob = NULL; - if (PyArg_ParseTuple(args,"ii:getVertex",&matindex,&vertexindex)) - { - RAS_TexVert* vertex = m_meshobj->GetVertex(matindex,vertexindex); - if (vertex) - { - vertexob = (new KX_VertexProxy(this, vertex))->NewProxy(true); - } - } - else { + if (!PyArg_ParseTuple(args,"ii:getVertex",&matindex,&vertexindex)) + return NULL; + + RAS_TexVert* vertex = m_meshobj->GetVertex(matindex,vertexindex); + + if(vertex==NULL) { + PyErr_SetString(PyExc_ValueError, "mesh.getVertex(mat_idx, vert_idx): KX_MeshProxy, could not get a vertex at the given indicies"); return NULL; } - - return vertexob; - + + return (new KX_VertexProxy(this, vertex))->NewProxy(true); } PyObject* KX_MeshProxy::PyGetPolygon(PyObject* args, PyObject* kwds) diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 2688de0d018..0f9bfea98f3 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -79,6 +79,8 @@ class KX_GameObject(SCA_IObject): - note: This attribute is experemental and may be removed (but probably wont be). - note: Changes to this list will not update the KX_GameObject. @type actuators: list + @ivar attrDict: get the objects internal python attribute dictionary for direct (faster) access. + @type attrDict: dict @group Deprecated: getPosition, setPosition, setWorldPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass, getMesh """ def endObject(): -- cgit v1.2.3 From 1f5ccd19287dbf8faa5e7bdcd62502e35863ede3 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 7 May 2009 19:36:12 +0000 Subject: BGE: unfortunately VA+list still doesn't work on ATI card, so put a specific check for ATI. --- .../Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp | 8 +++++--- .../Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp index 3ae4522f8e1..f5324c6fbc9 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp @@ -104,9 +104,11 @@ bool RAS_ListSlot::End() RAS_ListRasterizer::RAS_ListRasterizer(RAS_ICanvas* canvas, bool useVertexArrays, bool lock) : RAS_VAOpenGLRasterizer(canvas, lock), - mUseVertexArrays(useVertexArrays) + mUseVertexArrays(useVertexArrays), + mATI(false) { - // -- + if (!strcmp((const char*)glGetString(GL_VENDOR), "ATI Technologies Inc.")) + mATI = true; } RAS_ListRasterizer::~RAS_ListRasterizer() @@ -214,7 +216,7 @@ void RAS_ListRasterizer::IndexPrimitivesMulti(RAS_MeshSlot& ms) // workaround: note how we do not use vertex arrays for making display // lists, since glVertexAttribPointerARB doesn't seem to work correct // in display lists on ATI? either a bug in the driver or in Blender .. - if (mUseVertexArrays && /*!localSlot &&*/ !ms.m_pDerivedMesh) + if (mUseVertexArrays && !mATI && !ms.m_pDerivedMesh) RAS_VAOpenGLRasterizer::IndexPrimitivesMulti(ms); else RAS_OpenGLRasterizer::IndexPrimitivesMulti(ms); diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h index 19211894896..912f28af6aa 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h @@ -42,6 +42,7 @@ typedef std::map RAS_ArrayLists; class RAS_ListRasterizer : public RAS_VAOpenGLRasterizer { bool mUseVertexArrays; + bool mATI; RAS_ArrayLists mArrayLists; RAS_ListSlot* FindOrAdd(class RAS_MeshSlot& ms); -- cgit v1.2.3 From e1c958c3648ef903777f49b9fb6d4230af316885 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 7 May 2009 20:00:09 +0000 Subject: BGE Dome: Implementation of FBO to handle warp mesh rendering. We are using an image twice as big to render the fisheye before warping. It'll slow down warping meshes a little, but we get way more resolution. Therefore I will bring Truncated Dome mode back in order to avoid using warping mesh for that. --- source/gameengine/Ketsji/KX_Dome.cpp | 103 +++++++++++++++++++++++++++-------- source/gameengine/Ketsji/KX_Dome.h | 6 +- 2 files changed, 85 insertions(+), 24 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index 3802f260391..4a6575ff412 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -66,6 +66,7 @@ KX_Dome::KX_Dome ( m_engine(engine) { warp.usemesh = false; + fboSupported = false; if (mode >= DOME_NUM_MODES) m_mode = DOME_FISHEYE; @@ -131,16 +132,20 @@ KX_Dome::KX_Dome ( CreateGLImages(); + if(warp.usemesh) + fboSupported = CreateFBO(); + dlistSupported = CreateDL(); } // destructor KX_Dome::~KX_Dome (void) { - GLuint m_numimages = m_numfaces; - ClearGLImages(); + if(fboSupported) + glDeleteFramebuffersEXT(1, &warp.fboId); + if(dlistSupported) glDeleteLists(dlistId, (GLsizei) m_numimages); } @@ -174,9 +179,9 @@ void KX_Dome::CreateGLImages(void) } if(warp.usemesh){ glBindTexture(GL_TEXTURE_2D, domefacesId[m_numfaces]); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, warp.imagewidth, warp.imageheight, 0, GL_RGB8, + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, warp.imagesize, warp.imagesize, 0, GL_RGB8, GL_UNSIGNED_BYTE, 0); - glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 0, 0, warp.imagewidth, warp.imageheight, 0); + glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 0, 0, warp.imagesize, warp.imagesize, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); @@ -227,19 +232,21 @@ http://projects.blender.org/tracker/?func=detail&aid=18655&group_id=9&atid=125 m_imagesize = (1 << i); if (warp.usemesh){ - warp.bufferwidth = canvaswidth; - warp.bufferheight = canvasheight; + // trying to use twice the size of the cube faces + GLint glMaxTexDim; + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &glMaxTexDim); - i = 0; - while ((1 << i) <= warp.bufferwidth) - i++; - warp.imagewidth = (1 << i); + if (2 * m_imagesize > glMaxTexDim) + warp.imagesize = m_imagesize; - i = 0; - while ((1 << i) <= warp.bufferheight) - i++; - warp.imageheight = (1 << i); + else + warp.imagesize = 2 * m_imagesize; + + //if FBO is not working/supported, we use the canvas dimension as buffer + warp.bufferwidth = canvaswidth; + warp.bufferheight = canvasheight; } + //XXX HACK canvaswidth = m_viewport.GetWidth(); canvasheight = m_viewport.GetHeight(); @@ -320,6 +327,40 @@ bool KX_Dome::CreateDL(){ return true; } +bool KX_Dome::CreateFBO(void) +{ + glGenFramebuffersEXT(1, &warp.fboId); + if(warp.fboId==0) + { + printf("Dome Error: Invalid frame buffer object. Using low resolution warp image."); + return false; + } + + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, warp.fboId); + + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, + GL_TEXTURE_2D, domefacesId[m_numfaces], 0); + + GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + + if(status == GL_FRAMEBUFFER_UNSUPPORTED_EXT) + { + printf("Dome Error: FrameBuffer unsupported. Using low resolution warp image."); + return false; + } + else if(status != GL_FRAMEBUFFER_COMPLETE_EXT) + { + glDeleteFramebuffersEXT(1, &warp.fboId); + return false; + } + + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + + //nothing failed: we can use the whole FBO as buffersize + warp.bufferwidth = warp.bufferheight = warp.imagesize; + return true; +} + void KX_Dome::GLDrawTriangles(vector & face, int nfaces) { int i,j; @@ -336,8 +377,9 @@ void KX_Dome::GLDrawTriangles(vector & face, int nfaces) void KX_Dome::GLDrawWarpQuads(void) { int i, j, i2; - float uv_width = (float)(warp.bufferwidth-1) / warp.imagewidth; - float uv_height = (float)(warp.bufferheight-1) / warp.imageheight; + + float uv_width = (float)(warp.bufferwidth) / warp.imagesize; + float uv_height = (float)(warp.bufferheight) / warp.imagesize; if(warp.mode ==2 ){ glBegin(GL_QUADS); @@ -394,7 +436,7 @@ void KX_Dome::GLDrawWarpQuads(void) } glEnd(); } else{ - printf("Error: Warp Mode %d unsupported. Try 1 for Polar Mesh or 2 for Fisheye.\n", warp.mode); + printf("Dome Error: Warp Mode %d unsupported. Try 1 for Polar Mesh or 2 for Fisheye.\n", warp.mode); } } @@ -430,7 +472,7 @@ i ranges from 0 to 1, if negative don't draw that mesh node lines = text.Explode('\n'); if(lines.size() < 6){ - printf("Error: Warp Mesh File with insufficient data!\n"); + printf("Dome Error: Warp Mesh File with insufficient data!\n"); return false; } columns = lines[1].Explode(' '); @@ -438,7 +480,7 @@ i ranges from 0 to 1, if negative don't draw that mesh node columns = lines[1].Explode('\t'); if(columns.size() !=2){ - printf("Error: Warp Mesh File incorrect. The second line should contain: width height.\n"); + printf("Dome Error: Warp Mesh File incorrect. The second line should contain: width height.\n"); return false; } @@ -448,7 +490,7 @@ i ranges from 0 to 1, if negative don't draw that mesh node warp.n_height = atoi(columns[1]); if ((int)lines.size() < 2 + (warp.n_width * warp.n_height)){ - printf("Error: Warp Mesh File with insufficient data!\n"); + printf("Dome Error: Warp Mesh File with insufficient data!\n"); return false; }else{ warp.nodes = vector > (warp.n_height, vector(warp.n_width)); @@ -470,7 +512,7 @@ i ranges from 0 to 1, if negative don't draw that mesh node } else{ warp.nodes.clear(); - printf("Error: Warp Mesh File with wrong number of fields. You should use 5: x y u v i.\n"); + printf("Dome Error: Warp Mesh File with wrong number of fields. You should use 5: x y u v i.\n"); return false; } } @@ -1538,6 +1580,13 @@ void KX_Dome::RotateCamera(KX_Camera* cam, int i) void KX_Dome::Draw(void) { + if (fboSupported){ + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, warp.fboId); + + glViewport(0,0,warp.imagesize, warp.imagesize); + glScissor(0,0,warp.imagesize, warp.imagesize); + } + switch(m_mode){ case DOME_FISHEYE: DrawDomeFisheye(); @@ -1552,8 +1601,16 @@ void KX_Dome::Draw(void) if(warp.usemesh) { - glBindTexture(GL_TEXTURE_2D, domefacesId[m_numfaces]); - glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_viewport.GetLeft(), m_viewport.GetBottom(), warp.bufferwidth, warp.bufferheight); + if(fboSupported) + { + m_canvas->SetViewPort(0, 0, m_canvas->GetWidth(), m_canvas->GetHeight()); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + } + else + { + glBindTexture(GL_TEXTURE_2D, domefacesId[m_numfaces]); + glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_viewport.GetLeft(), m_viewport.GetBottom(), warp.bufferwidth, warp.bufferheight); + } DrawDomeWarped(); } } diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h index 84f0c5c72ed..257172ac215 100644 --- a/source/gameengine/Ketsji/KX_Dome.h +++ b/source/gameengine/Ketsji/KX_Dome.h @@ -74,6 +74,7 @@ public: //openGL checks: bool dlistSupported; + bool fboSupported; //openGL names: GLuint domefacesId[7]; // ID of the images -- room for 7 images, using only 4 for 180º x 360º dome, 6 for panoramic and +1 for warp mesh @@ -93,8 +94,9 @@ public: bool usemesh; int mode; int n_width, n_height; //nodes width and height - int imagewidth, imageheight; + int imagesize; int bufferwidth, bufferheight; + GLuint fboId; vector > nodes; } warp; @@ -140,6 +142,8 @@ public: void ClearGLImages(void);//called on resize bool CreateDL(void); //create Display Lists void ClearDL(void); //remove Display Lists + bool CreateFBO(void);//create FBO (for warp mesh) + void ClearFBO(void); //remove FBO void CalculateCameraOrientation(); void CalculateImageSize(); //set m_imagesize -- cgit v1.2.3 From cdba1ddd5d454aca4d39dbb01866c155421b5d11 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 7 May 2009 22:06:27 +0000 Subject: BGE Python owned proxies had a problem being decref'd twice, this would crash on freeing KX_Vertex/Poly Proxy types when python was compiled with debug options enabled. add_mesh_torus.py wasnt tested from update, will go through all edited scripts and test :\ --- source/gameengine/Expressions/PyObjectPlus.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 82f67a9b007..7d302246c70 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -95,6 +95,7 @@ void PyObjectPlus::py_base_dealloc(PyObject *self) // python wrapper PyObjectPlus *self_plus= BGE_PROXY_REF(self); if(self_plus) { if(BGE_PROXY_PYOWNS(self)) { /* Does python own this?, then delete it */ + self_plus->m_proxy = NULL; /* Need this to stop ~PyObjectPlus from decrefing m_proxy otherwise its decref'd twice and py-debug crashes */ delete self_plus; } -- cgit v1.2.3 From 57beadf40613b3c4ba6f20cbaddc1066c6800bbc Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Thu, 7 May 2009 22:31:19 +0000 Subject: Second fix for [#18697] 2.49RC1: Keyed Particles fine in viewport but give me a crash during render --- source/blender/blenkernel/intern/particle_system.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index d3ba3fa3802..f74e32acdbf 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -203,8 +203,11 @@ static void realloc_particles(Object *ob, ParticleSystem *psys, int new_totpart) if(psys->particles->keys) MEM_freeN(psys->particles->keys); - for(i=0, pa=psys->particles; ikeys) pa->keys= NULL; + for(i=totsaved, pa=psys->particles+totsaved; itotpart; i++, pa++) + if(pa->keys) { + pa->keys= NULL; + pa->totkey= 0; + } for(i=totsaved, pa=psys->particles+totsaved; itotpart; i++, pa++) if(pa->hair) MEM_freeN(pa->hair); -- cgit v1.2.3 From 1d11df17085bd4f1231a892089a0771887d155bb Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 8 May 2009 18:59:08 +0000 Subject: BGE Dome: Truncated Dome are back (Upright and Downright) + GLEW_EXT_framebuffer_object check before generating FBO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After last commit (20099) warping meshes got slower (more quality == less performance). Since we don't need an extra warping for truncated domes, It's better to handle them directly in openGL without the need of warping it. I'll talk with some Dome owners to see if we need both Upright and Downright modes. I may remove one of them by 2.49 them. *) also: a proper GLEW_EXT_framebuffer_object check before generating FBO (for warping meshes). **) next in line (maybe after RC2): tilt option to tilt the camera up to 90º upward. --- source/gameengine/Ketsji/KX_Dome.cpp | 75 +++++++++++++++++++++++++++--------- source/gameengine/Ketsji/KX_Dome.h | 7 ++-- 2 files changed, 61 insertions(+), 21 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index 4a6575ff412..a302bf98cb8 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -124,6 +124,16 @@ KX_Dome::KX_Dome ( CreateMeshPanorama(); m_numfaces = 6; break; + default: //DOME_TRUNCATED_DOWN and DOME_TRUNCATED_UP + cubetop.resize(1); + cubebottom.resize(1); + cubeleft.resize(2); + cuberight.resize(2); + + m_angle = 180; + CreateMeshDome180(); + m_numfaces = 4; + break; } m_numimages =(warp.usemesh?m_numfaces+1:m_numfaces); @@ -255,7 +265,7 @@ http://projects.blender.org/tracker/?func=detail&aid=18655&group_id=9&atid=125 bool KX_Dome::CreateDL(){ dlistId = glGenLists((GLsizei) m_numimages); if (dlistId != 0) { - if(m_mode == DOME_FISHEYE){ + if(m_mode == DOME_FISHEYE || m_mode == DOME_TRUNCATED_UP || m_mode == DOME_TRUNCATED_DOWN){ glNewList(dlistId, GL_COMPILE); GLDrawTriangles(cubetop, nfacestop); glEndList(); @@ -329,6 +339,12 @@ bool KX_Dome::CreateDL(){ bool KX_Dome::CreateFBO(void) { + if (!GLEW_EXT_framebuffer_object) + { + printf("Dome Error: FrameBuffer unsupported. Using low resolution warp image."); + return false; + } + glGenFramebuffersEXT(1, &warp.fboId); if(warp.fboId==0) { @@ -345,7 +361,7 @@ bool KX_Dome::CreateFBO(void) if(status == GL_FRAMEBUFFER_UNSUPPORTED_EXT) { - printf("Dome Error: FrameBuffer unsupported. Using low resolution warp image."); + printf("Dome Error: FrameBuffer settings unsupported. Using low resolution warp image."); return false; } else if(status != GL_FRAMEBUFFER_COMPLETE_EXT) @@ -1469,7 +1485,9 @@ Uses 6 cameras for angles up to 360 MT_Scalar c = cos(deg45); MT_Scalar s = sin(deg45); - if ((m_mode == DOME_FISHEYE && m_angle <= 180)){ + if ((m_mode == DOME_FISHEYE && m_angle <= 180) + || m_mode == DOME_TRUNCATED_UP + || m_mode == DOME_TRUNCATED_DOWN){ m_locRot[0] = MT_Matrix3x3( // 90º - Top c, -s, 0.0, @@ -1597,6 +1615,12 @@ void KX_Dome::Draw(void) case DOME_PANORAM_SPH: DrawPanorama(); break; + case DOME_TRUNCATED_UP: + DrawDomeFisheye(); + break; + case DOME_TRUNCATED_DOWN: + DrawDomeFisheye(); + break; } if(warp.usemesh) @@ -1760,22 +1784,37 @@ void KX_Dome::DrawDomeFisheye(void) float ortho_width, ortho_height; - if (warp.usemesh) - glOrtho((-1.0), 1.0, (-1.0), 1.0, -20.0, 10.0); //stretch the image to reduce resolution lost - - else { - if (can_width < can_height){ - ortho_width = 1.0; - ortho_height = (float)can_height/can_width; - }else{ - ortho_width = (float)can_width/can_height; - ortho_height = 1.0; + if(m_mode == DOME_FISHEYE) { + if (warp.usemesh) + glOrtho((-1.0), 1.0, (-1.0), 1.0, -20.0, 10.0); //stretch the image to reduce resolution lost + + else { + if (can_width < can_height){ + ortho_width = 1.0; + ortho_height = (float)can_height/can_width; + }else{ + ortho_width = (float)can_width/can_height; + ortho_height = 1.0; + } + + ortho_width /= m_size; + ortho_height /= m_size; + + glOrtho((-ortho_width), ortho_width, (-ortho_height), ortho_height, -20.0, 10.0); } - - ortho_width /= m_size; - ortho_height /= m_size; - - glOrtho((-ortho_width), ortho_width, (-ortho_height), ortho_height, -20.0, 10.0); + } + else if(m_mode == DOME_TRUNCATED_UP) + { + ortho_width = 1.0; + ortho_height = 2 * ((float)can_height/can_width) - 1.0 ; + + glOrtho((-ortho_width), ortho_width, (-ortho_height), ortho_width, -20.0, 10.0); + } + else { //m_mode == DOME_TRUNCATED_DOWN + ortho_width = 1.0; + ortho_height = 2 * ((float)can_height/can_width) - 1.0 ; + + glOrtho((-ortho_width), ortho_width, (-ortho_width), ortho_height, -20.0, 10.0); } glMatrixMode(GL_TEXTURE); diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h index 257172ac215..30d02dce7a0 100644 --- a/source/gameengine/Ketsji/KX_Dome.h +++ b/source/gameengine/Ketsji/KX_Dome.h @@ -38,13 +38,14 @@ Developed as part of a Research and Development project for SAT - La Soci #include "MEM_guardedalloc.h" #include "BKE_text.h" -//#include "BLI_blenlib.h" //Dome modes: limit hardcoded in buttons_scene.c #define DOME_FISHEYE 1 #define DOME_ENVMAP 2 #define DOME_PANORAM_SPH 3 -#define DOME_NUM_MODES 4 +#define DOME_TRUNCATED_UP 4 +#define DOME_TRUNCATED_DOWN 5 +#define DOME_NUM_MODES 6 /// class for render 3d scene @@ -118,7 +119,7 @@ public: void CalculateFrustum(KX_Camera* cam); void RotateCamera(KX_Camera* cam, int i); - //Mesh Creating Functions + //Mesh creation Functions void CreateMeshDome180(void); void CreateMeshDome250(void); void CreateMeshPanorama(void); -- cgit v1.2.3 From 5d6b249c9bc38bd5b07b22d191aefdccc87e2090 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 9 May 2009 16:29:00 +0000 Subject: refcounting bugfix, gameOb.getParent() and gameOb.parent both added a reference when they should not have. --- source/gameengine/Ketsji/KX_GameObject.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 492f72584f5..4f3202aafea 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1440,8 +1440,10 @@ PyObject* KX_GameObject::pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DE { KX_GameObject* self= static_cast(self_v); KX_GameObject* parent = self->GetParent(); - if (parent) + if (parent) { + parent->Release(); /* self->GetParent() AddRef's */ return parent->GetProxy(); + } Py_RETURN_NONE; } @@ -2148,8 +2150,10 @@ PyObject* KX_GameObject::PyGetParent() { ShowDeprecationWarning("getParent()", "the parent property"); KX_GameObject* parent = this->GetParent(); - if (parent) + if (parent) { + parent->Release(); /* self->GetParent() AddRef's */ return parent->GetProxy(); + } Py_RETURN_NONE; } -- cgit v1.2.3 From cfc21667b98e1be9ba8ebabbd19a75541585ad24 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sat, 9 May 2009 16:59:25 +0000 Subject: BGE: repair soft body - include this in RC2 please --- source/gameengine/Converter/BL_BlenderDataConversion.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 3c93265c40b..1d2b275cab9 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -2121,7 +2121,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, //tf.Add(gameobj->GetSGNode()); gameobj->NodeUpdateGS(0); - gameobj->AddMeshUser(); + //move to after finishing everything so that soft body deformer is included + //gameobj->AddMeshUser(); } else @@ -2311,7 +2312,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, //tf.Add(gameobj->GetSGNode()); gameobj->NodeUpdateGS(0); - gameobj->AddMeshUser(); + //move to after finishing everything so that soft body deformer is included + //gameobj->AddMeshUser(); } else { @@ -2665,6 +2667,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, { KX_GameObject* gameobj = static_cast(objectlist->GetValue(i)); gameobj->ResetState(); + gameobj->AddMeshUser(); } #endif //CONVERT_LOGIC -- cgit v1.2.3 From 355b585447040e7f5697e4ee8adb951ca2aea4d3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 9 May 2009 17:24:21 +0000 Subject: More refcount errors spotted by Benoit, one with python getting a list item so scene.objects["OBfoo"] would always mess up refcounts. --- source/gameengine/Expressions/ListValue.cpp | 8 +++++--- source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 027d2594336..f4a801a965b 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -78,13 +78,15 @@ PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex) STR_String index(PyString_AsString(pyindex)); CValue *item = ((CListValue*) list)->FindValue(index); if (item) + { + item->Release(); /* FindValue() AddRef's */ return item->GetProxy(); - + } } - if (PyInt_Check(pyindex)) + else if (PyInt_Check(pyindex)) { int index = PyInt_AsLong(pyindex); - return listvalue_buffer_item(self, index); + return listvalue_buffer_item(self, index); /* wont add a ref */ } PyObject *pyindex_str = PyObject_Repr(pyindex); /* new ref */ diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index c3c738a8183..65a026656c5 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -715,6 +715,7 @@ void KX_BlenderMaterial::setObjectMatrixData(int i, RAS_IRasterizer *ras) mScene->GetObjectList()->FindValue(mMaterial->mapping[i].objconame); if(!obj) return; + obj->Release(); /* FindValue() AddRef's */ glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR ); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR ); -- cgit v1.2.3 From df01af5a1f05d03ad1464bca1fcbffe495ca0539 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 9 May 2009 18:18:04 +0000 Subject: Methods didn't check for zombies which could crash in the case where a method for an object is kept. func = ob.getMass ...remove ob... func() # crash 2 More refcount fixes spotted by Benoit too --- source/gameengine/Expressions/PyObjectPlus.h | 8 ++++++++ source/gameengine/Ketsji/KX_GameObject.cpp | 2 +- source/gameengine/Ketsji/KX_Scene.cpp | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index c21dc3a6e57..b7f22404c7a 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -225,30 +225,35 @@ typedef struct { #define KX_PYMETHOD(class_name, method_name) \ PyObject* Py##method_name(PyObject* args, PyObject* kwds); \ static PyObject* sPy##method_name( PyObject* self, PyObject* args, PyObject* kwds) { \ + if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_SystemError, #class_name "." #method_name "() - " BGE_PROXY_ERROR_MSG); return NULL; } \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \ }; \ #define KX_PYMETHOD_VARARGS(class_name, method_name) \ PyObject* Py##method_name(PyObject* args); \ static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \ + if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_SystemError, #class_name "." #method_name "() - " BGE_PROXY_ERROR_MSG); return NULL; } \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \ }; \ #define KX_PYMETHOD_NOARGS(class_name, method_name) \ PyObject* Py##method_name(); \ static PyObject* sPy##method_name( PyObject* self) { \ + if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_SystemError, #class_name "." #method_name "() - " BGE_PROXY_ERROR_MSG); return NULL; } \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \ }; \ #define KX_PYMETHOD_O(class_name, method_name) \ PyObject* Py##method_name(PyObject* value); \ static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \ + if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_SystemError, #class_name "." #method_name "(value) - " BGE_PROXY_ERROR_MSG); return NULL; } \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \ }; \ #define KX_PYMETHOD_DOC(class_name, method_name) \ PyObject* Py##method_name(PyObject* args, PyObject* kwds); \ static PyObject* sPy##method_name( PyObject* self, PyObject* args, PyObject* kwds) { \ + if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_SystemError, #class_name "." #method_name "(...) - " BGE_PROXY_ERROR_MSG); return NULL; } \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args, kwds); \ }; \ static const char method_name##_doc[]; \ @@ -256,6 +261,7 @@ typedef struct { #define KX_PYMETHOD_DOC_VARARGS(class_name, method_name) \ PyObject* Py##method_name(PyObject* args); \ static PyObject* sPy##method_name( PyObject* self, PyObject* args) { \ + if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_SystemError, #class_name "." #method_name "(...) - " BGE_PROXY_ERROR_MSG); return NULL; } \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(args); \ }; \ static const char method_name##_doc[]; \ @@ -263,6 +269,7 @@ typedef struct { #define KX_PYMETHOD_DOC_O(class_name, method_name) \ PyObject* Py##method_name(PyObject* value); \ static PyObject* sPy##method_name( PyObject* self, PyObject* value) { \ + if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_SystemError, #class_name "." #method_name "(value) - " BGE_PROXY_ERROR_MSG); return NULL; } \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(value); \ }; \ static const char method_name##_doc[]; \ @@ -270,6 +277,7 @@ typedef struct { #define KX_PYMETHOD_DOC_NOARGS(class_name, method_name) \ PyObject* Py##method_name(); \ static PyObject* sPy##method_name( PyObject* self) { \ + if(BGE_PROXY_REF(self)==NULL) { PyErr_SetString(PyExc_SystemError, #class_name "." #method_name "() - " BGE_PROXY_ERROR_MSG); return NULL; } \ return ((class_name*)BGE_PROXY_REF(self))->Py##method_name(); \ }; \ static const char method_name##_doc[]; \ diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 4f3202aafea..c2216fd3514 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1726,7 +1726,7 @@ PyObject* KX_GameObject::pyattr_get_meshes(void *self_v, const KX_PYATTRIBUTE_DE for(i=0; i < (int)self->m_meshes.size(); i++) { KX_MeshProxy* meshproxy = new KX_MeshProxy(self->m_meshes[i]); - PyList_SET_ITEM(meshes, i, meshproxy->GetProxy()); + PyList_SET_ITEM(meshes, i, meshproxy->NewProxy(true)); } return meshes; diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 7280071cd1d..208f8fc9461 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1847,5 +1847,9 @@ KX_PYMETHODDEF_DOC(KX_Scene, addObject, SCA_IObject* replica = AddReplicaObject((SCA_IObject*)ob, other, time); + + // release here because AddReplicaObject AddRef's + // the object is added to the scene so we dont want python to own a reference + replica->Release(); return replica->GetProxy(); } \ No newline at end of file -- cgit v1.2.3 From 4a2341fe9a53839c4be685070c41f7b0ea980017 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Sat, 9 May 2009 21:04:03 +0000 Subject: =?UTF-8?q?BGE=20Dome:=20Allowing=20FOV=20different=20from=20180?= =?UTF-8?q?=C2=BA=20for=20Truncated=20Domes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit *) a small note: In the end it turned out that we have upright and downright domes out there. So I may rearrange the order of the gui later: (1 = fisheye, 2 = truncated up, 3 = truncated down, 4 = envmap, 5 = spherical panoramic) I don't plan to do a doVersion() for that, so if you are using it already keep in mind that the modes may change before 249 final release. --- source/gameengine/Ketsji/KX_Dome.cpp | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index a302bf98cb8..429c1b84918 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -125,15 +125,24 @@ KX_Dome::KX_Dome ( m_numfaces = 6; break; default: //DOME_TRUNCATED_DOWN and DOME_TRUNCATED_UP - cubetop.resize(1); - cubebottom.resize(1); - cubeleft.resize(2); - cuberight.resize(2); + if (m_angle <= 180){ + cubetop.resize(1); + cubebottom.resize(1); + cubeleft.resize(2); + cuberight.resize(2); - m_angle = 180; - CreateMeshDome180(); - m_numfaces = 4; - break; + CreateMeshDome180(); + m_numfaces = 4; + }else if (m_angle > 180){ + cubetop.resize(2); + cubebottom.resize(2); + cubeleft.resize(2); + cubefront.resize(2); + cuberight.resize(2); + + CreateMeshDome250(); + m_numfaces = 5; + } break; } m_numimages =(warp.usemesh?m_numfaces+1:m_numfaces); @@ -1485,9 +1494,9 @@ Uses 6 cameras for angles up to 360 MT_Scalar c = cos(deg45); MT_Scalar s = sin(deg45); - if ((m_mode == DOME_FISHEYE && m_angle <= 180) + if (m_angle <= 180 && (m_mode == DOME_FISHEYE || m_mode == DOME_TRUNCATED_UP - || m_mode == DOME_TRUNCATED_DOWN){ + || m_mode == DOME_TRUNCATED_DOWN)){ m_locRot[0] = MT_Matrix3x3( // 90º - Top c, -s, 0.0, @@ -1509,7 +1518,9 @@ Uses 6 cameras for angles up to 360 0.0, 1.0, 0.0, s, 0.0, c); - } else if ((m_mode == DOME_FISHEYE && m_angle > 180) || m_mode == DOME_ENVMAP){ + } else if (m_mode == DOME_ENVMAP || (m_angle > 180 && (m_mode == DOME_FISHEYE + || m_mode == DOME_TRUNCATED_UP + || m_mode == DOME_TRUNCATED_DOWN))){ m_locRot[0] = MT_Matrix3x3( // 90º - Top 1.0, 0.0, 0.0, -- cgit v1.2.3 From f155da0039104af88379bb354674e32ef2595960 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Sat, 9 May 2009 21:54:22 +0000 Subject: BGE Dome: Reducing FBO size to warped meshes. Commit 20099 started using a FBO way too big. According to Paul Bourke this is how it's done in other Engines: Projectors HD: 1920x1050 - buffersize = 1024; FBO size = 2048 1400x1050 - buffersize = 1024; FBO size = 2048 Projectors XGA: 1024x768 - buffersize = 512; FBO size = 1024 Now in Blender Game Engine we are using: Projectors HD: 1920x1050 - buffersize = 1050; FBO size = 2048 1400x1050 - buffersize = 1050; FBO size = 2048 Projectors XGA: 1024x768 - buffersize = 768; FBO size = 1024 (I guess I should be committing code to the ge_dome branch instead of the trunk. I feel bad doing all those adjustments in a hurry to 2.49 final release in the trunk. That is ok, right?) --- source/gameengine/Ketsji/KX_Dome.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index 429c1b84918..25efe0a59c9 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -251,15 +251,10 @@ http://projects.blender.org/tracker/?func=detail&aid=18655&group_id=9&atid=125 m_imagesize = (1 << i); if (warp.usemesh){ - // trying to use twice the size of the cube faces - GLint glMaxTexDim; - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &glMaxTexDim); - - if (2 * m_imagesize > glMaxTexDim) - warp.imagesize = m_imagesize; - - else - warp.imagesize = 2 * m_imagesize; + // warp FBO needs to be up to twice as big as m_buffersize to get more resolution + warp.imagesize = m_imagesize; + if (m_buffersize == m_imagesize) + warp.imagesize *= 2; //if FBO is not working/supported, we use the canvas dimension as buffer warp.bufferwidth = canvaswidth; -- cgit v1.2.3 From 136d4c34badc12b72f5c3541fcdaf2b1459af408 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 10 May 2009 01:48:14 +0000 Subject: deprecate controller.getActuator(name) and controller.getSensor(name) for controller.actuators[name] and controller.sensors[name] Made a read-only sequence type for logic brick sensors and actuators which can access single items or be used like a list or dictionary. We could use a python dictionary or CValueList but that would be slower to create. So you can do... for s in controller.sensors: print s print controller.sensors["Sensor"] print controller.sensors[0] sensors = list(controller.sensors) This sequence type keeps a reference to the proxy it came from and will raise an error on access if the proxy has been removed. --- source/gameengine/Expressions/PyObjectPlus.cpp | 1 - source/gameengine/GameLogic/SCA_IController.cpp | 30 +- source/gameengine/Ketsji/KX_GameObject.cpp | 28 +- source/gameengine/Ketsji/KX_PythonSeq.cpp | 384 ++++++++++++++++++++++++ source/gameengine/Ketsji/KX_PythonSeq.h | 60 ++++ source/gameengine/PyDoc/KX_GameObject.py | 6 +- source/gameengine/PyDoc/SCA_IController.py | 8 +- 7 files changed, 465 insertions(+), 52 deletions(-) create mode 100644 source/gameengine/Ketsji/KX_PythonSeq.cpp create mode 100644 source/gameengine/Ketsji/KX_PythonSeq.h (limited to 'source') diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 7d302246c70..7026db5b8a4 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -981,6 +981,5 @@ void PyObjectPlus::SetDeprecationWarningFirst(WarnLink* wlink) {m_base_wlink_f void PyObjectPlus::SetDeprecationWarningLinkLast(WarnLink* wlink) {m_base_wlink_last= wlink;} void PyObjectPlus::NullDeprecationWarning() {m_base_wlink_first= m_base_wlink_last= NULL;} - #endif //NO_EXP_PYTHON_EMBEDDING diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp index 8bf21ed8264..24509f6e6ed 100644 --- a/source/gameengine/GameLogic/SCA_IController.cpp +++ b/source/gameengine/GameLogic/SCA_IController.cpp @@ -31,6 +31,7 @@ #include "SCA_IActuator.h" #include "SCA_ISensor.h" #include "PyObjectPlus.h" +#include "../Ketsji/KX_PythonSeq.h" /* not nice, only need for KX_PythonSeq_CreatePyObject */ #ifdef HAVE_CONFIG_H #include @@ -241,10 +242,9 @@ PyParentObject SCA_IController::Parents[] = { }; PyMethodDef SCA_IController::Methods[] = { - {"getActuator", (PyCFunction) SCA_IController::sPyGetActuator, METH_O}, - {"getSensor", (PyCFunction) SCA_IController::sPyGetSensor, METH_O}, - //Deprecated functions ------> + {"getSensor", (PyCFunction) SCA_IController::sPyGetSensor, METH_O}, + {"getActuator", (PyCFunction) SCA_IController::sPyGetActuator, METH_O}, {"getSensors", (PyCFunction) SCA_IController::sPyGetSensors, METH_NOARGS}, {"getActuators", (PyCFunction) SCA_IController::sPyGetActuators, METH_NOARGS}, {"getState", (PyCFunction) SCA_IController::sPyGetState, METH_NOARGS}, @@ -290,7 +290,8 @@ PyObject* SCA_IController::PyGetActuators() PyObject* SCA_IController::PyGetSensor(PyObject* value) { - + ShowDeprecationWarning("getSensor(string)", "the sensors[string] property"); + char *scriptArg = PyString_AsString(value); if (scriptArg==NULL) { PyErr_SetString(PyExc_TypeError, "controller.getSensor(string): Python Controller, expected a string (sensor name)"); @@ -313,7 +314,8 @@ PyObject* SCA_IController::PyGetSensor(PyObject* value) PyObject* SCA_IController::PyGetActuator(PyObject* value) { - + ShowDeprecationWarning("getActuator(string)", "the actuators[string] property"); + char *scriptArg = PyString_AsString(value); if (scriptArg==NULL) { PyErr_SetString(PyExc_TypeError, "controller.getActuator(string): Python Controller, expected a string (actuator name)"); @@ -360,24 +362,10 @@ PyObject* SCA_IController::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_D PyObject* SCA_IController::pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_IController* self= static_cast(self_v); - vector linkedsensors = self->GetLinkedSensors(); - PyObject* resultlist = PyList_New(linkedsensors.size()); - - for (unsigned int index=0;indexGetProxy()); - - return resultlist; + return KX_PythonSeq_CreatePyObject((static_cast(self_v))->m_proxy, KX_PYGENSEQ_CONT_TYPE_SENSORS); } PyObject* SCA_IController::pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - SCA_IController* self= static_cast(self_v); - vector linkedactuators = self->GetLinkedActuators(); - PyObject* resultlist = PyList_New(linkedactuators.size()); - - for (unsigned int index=0;indexGetProxy()); - - return resultlist; + return KX_PythonSeq_CreatePyObject((static_cast(self_v))->m_proxy, KX_PYGENSEQ_CONT_TYPE_ACTUATORS); } diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index c2216fd3514..2f5b5631761 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -63,6 +63,7 @@ typedef unsigned long uint_ptr; #include "KX_RayCast.h" #include "KX_PythonInit.h" #include "KX_PyMath.h" +#include "KX_PythonSeq.h" #include "SCA_IActuator.h" #include "SCA_ISensor.h" #include "SCA_IController.h" @@ -1735,38 +1736,17 @@ PyObject* KX_GameObject::pyattr_get_meshes(void *self_v, const KX_PYATTRIBUTE_DE /* experemental! */ PyObject* KX_GameObject::pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast(self_v); - SCA_SensorList& sensors= self->GetSensors(); - PyObject* resultlist = PyList_New(sensors.size()); - - for (unsigned int index=0;indexGetProxy()); - - return resultlist; + return KX_PythonSeq_CreatePyObject((static_cast(self_v))->m_proxy, KX_PYGENSEQ_OB_TYPE_SENSORS); } PyObject* KX_GameObject::pyattr_get_controllers(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast(self_v); - SCA_ControllerList& controllers= self->GetControllers(); - PyObject* resultlist = PyList_New(controllers.size()); - - for (unsigned int index=0;indexGetProxy()); - - return resultlist; + return KX_PythonSeq_CreatePyObject((static_cast(self_v))->m_proxy, KX_PYGENSEQ_OB_TYPE_CONTROLLERS); } PyObject* KX_GameObject::pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast(self_v); - SCA_ActuatorList& actuators= self->GetActuators(); - PyObject* resultlist = PyList_New(actuators.size()); - - for (unsigned int index=0;indexGetProxy()); - - return resultlist; + return KX_PythonSeq_CreatePyObject((static_cast(self_v))->m_proxy, KX_PYGENSEQ_OB_TYPE_ACTUATORS); } PyObject* KX_GameObject::pyattr_get_attrDict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp new file mode 100644 index 00000000000..c3ae35fa47c --- /dev/null +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -0,0 +1,384 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + * Readonly sequence wrapper for lookups on logic bricks + */ + + +#include "KX_PythonSeq.h" +#include "KX_GameObject.h" +#include "SCA_ISensor.h" +#include "SCA_IController.h" +#include "SCA_IActuator.h" + + +PyObject *KX_PythonSeq_CreatePyObject( PyObject *base, short type ) +{ + KX_PythonSeq *seq = PyObject_NEW( KX_PythonSeq, &KX_PythonSeq_Type); + seq->base = base; + Py_INCREF(base); /* so we can always access to check if its valid */ + seq->type = type; + seq->iter = -1; /* init */ + return (PyObject *)seq; + } + + static void KX_PythonSeq_dealloc( KX_PythonSeq * self ) +{ + Py_DECREF(self->base); + PyObject_DEL( self ); +} + +static int KX_PythonSeq_len( KX_PythonSeq * self ) +{ + PyObjectPlus *self_plus= BGE_PROXY_REF(self->base); + + if(self_plus==NULL) { + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + return -1; + } + + switch(self->type) { + case KX_PYGENSEQ_CONT_TYPE_SENSORS: + return ((SCA_IController *)self_plus)->GetLinkedSensors().size(); + case KX_PYGENSEQ_CONT_TYPE_ACTUATORS: + return ((SCA_IController *)self_plus)->GetLinkedActuators().size(); + case KX_PYGENSEQ_OB_TYPE_SENSORS: + return ((KX_GameObject *)self_plus)->GetSensors().size(); + case KX_PYGENSEQ_OB_TYPE_CONTROLLERS: + return ((KX_GameObject *)self_plus)->GetControllers().size(); + case KX_PYGENSEQ_OB_TYPE_ACTUATORS: + return ((KX_GameObject *)self_plus)->GetActuators().size(); + default: + /* Should never happen */ + PyErr_SetString(PyExc_SystemError, "invalid type, internal error"); + return -1; + } +} + +static PyObject *KX_PythonSeq_getIndex(KX_PythonSeq * self, int index) +{ + PyObjectPlus *self_plus= BGE_PROXY_REF(self->base); + + if(self_plus==NULL) { + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + NULL; + } + + switch(self->type) { + case KX_PYGENSEQ_CONT_TYPE_SENSORS: + { + vector linkedsensors = ((SCA_IController *)self_plus)->GetLinkedSensors(); + SCA_ISensor* sensor; + if(index<0) index += linkedsensors.size(); + if(index<0 || index>= linkedsensors.size()) { + PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); + return NULL; + } + return linkedsensors[index]->GetProxy(); + } + case KX_PYGENSEQ_CONT_TYPE_ACTUATORS: + { + vector linkedactuators = ((SCA_IController *)self_plus)->GetLinkedActuators(); + SCA_IActuator* sensor; + if(index<0) index += linkedactuators.size(); + if(index<0 || index>= linkedactuators.size()) { + PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); + return NULL; + } + return linkedactuators[index]->GetProxy(); + } + case KX_PYGENSEQ_OB_TYPE_SENSORS: + { + SCA_SensorList& linkedsensors= ((KX_GameObject *)self_plus)->GetSensors(); + SCA_ISensor *sensor; + if(index<0) index += linkedsensors.size(); + if(index<0 || index>= linkedsensors.size()) { + PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); + return NULL; + } + return linkedsensors[index]->GetProxy(); + } + case KX_PYGENSEQ_OB_TYPE_CONTROLLERS: + { + SCA_ControllerList& linkedcontrollers= ((KX_GameObject *)self_plus)->GetControllers(); + SCA_IController *controller; + if(index<0) index += linkedcontrollers.size(); + if(index<0 || index>= linkedcontrollers.size()) { + PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); + return NULL; + } + return linkedcontrollers[index]->GetProxy(); + } + case KX_PYGENSEQ_OB_TYPE_ACTUATORS: + { + SCA_ActuatorList& linkedactuators= ((KX_GameObject *)self_plus)->GetActuators(); + SCA_IActuator *actuator; + if(index<0) index += linkedactuators.size(); + if(index<0 || index>= linkedactuators.size()) { + PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); + return NULL; + } + return linkedactuators[index]->GetProxy(); + } + } +} + + +static PyObject * KX_PythonSeq_subscript(KX_PythonSeq * self, PyObject *key) +{ + PyObjectPlus *self_plus= BGE_PROXY_REF(self->base); + char *name = NULL; + + if(self_plus==NULL) { + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + return NULL; + } + + if (PyInt_Check(key)) { + return KX_PythonSeq_getIndex(self, PyInt_AS_LONG( key )); + } else if ( PyString_Check(key) ) { + name = PyString_AsString( key ); + } else { + PyErr_SetString( PyExc_TypeError, "expected a string or an index" ); + return NULL; + } + + switch(self->type) { + case KX_PYGENSEQ_CONT_TYPE_SENSORS: + { + vector linkedsensors = ((SCA_IController *)self_plus)->GetLinkedSensors(); + SCA_ISensor* sensor; + for (unsigned int index=0;indexGetName() == name) + return sensor->GetProxy(); + } + break; + } + case KX_PYGENSEQ_CONT_TYPE_ACTUATORS: + { + vector linkedactuators = ((SCA_IController *)self_plus)->GetLinkedActuators(); + SCA_IActuator* sensor; + for (unsigned int index=0;indexGetName() == name) + return sensor->GetProxy(); + } + break; + } + case KX_PYGENSEQ_OB_TYPE_SENSORS: + { + SCA_SensorList& linkedsensors= ((KX_GameObject *)self_plus)->GetSensors(); + SCA_ISensor *sensor; + for (unsigned int index=0;indexGetName() == name) + return sensor->GetProxy(); + } + break; + } + case KX_PYGENSEQ_OB_TYPE_CONTROLLERS: + { + SCA_ControllerList& linkedcontrollers= ((KX_GameObject *)self_plus)->GetControllers(); + SCA_IController *controller; + for (unsigned int index=0;indexGetName() == name) + return controller->GetProxy(); + } + break; + } + case KX_PYGENSEQ_OB_TYPE_ACTUATORS: + { + SCA_ActuatorList& linkedactuators= ((KX_GameObject *)self_plus)->GetActuators(); + SCA_IActuator *actuator; + for (unsigned int index=0;indexGetName() == name) + return actuator->GetProxy(); + } + break; + } + } + + PyErr_Format( PyExc_KeyError, "requested item \"%s\" does not exist", name); + return NULL; +} + +static PyMappingMethods KX_PythonSeq_as_mapping = { + ( inquiry ) KX_PythonSeq_len, /* mp_length */ + ( binaryfunc ) KX_PythonSeq_subscript, /* mp_subscript */ + ( objobjargproc ) 0, /* mp_ass_subscript */ +}; + + +/* + * Initialize the interator index + */ + +static PyObject *KX_PythonSeq_getIter( KX_PythonSeq * self ) +{ + if(BGE_PROXY_REF(self->base)==NULL) { + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + NULL; + } + + /* create a new iterator if were alredy using this one */ + if (self->iter == -1) { + self->iter = 0; + Py_INCREF(self); + return (PyObject *)self; + } else { + return KX_PythonSeq_CreatePyObject(self->base, self->type); + } + } + + +/* + * Return next KX_PythonSeq iter. + */ + +static PyObject *KX_PythonSeq_nextIter( KX_PythonSeq * self ) +{ + PyObject *object = KX_PythonSeq_getIndex(self, self->iter); + + self->iter++; + if( object==NULL ) { + self->iter= -1; /* for reuse */ + PyErr_SetString(PyExc_StopIteration, "iterator at end"); + } + return object; /* can be NULL for end of iterator */ +} + + +static int KX_PythonSeq_compare( KX_PythonSeq * a, KX_PythonSeq * b ) /* TODO - python3.x wants richcmp */ +{ + return ( a->type == b->type && a->base == b->base) ? 0 : -1; +} + +/* + * repr function + * convert to a list and get its string value + */ +static PyObject *KX_PythonSeq_repr( KX_PythonSeq * self ) +{ + PyObject *list = PySequence_List((PyObject *)self); + PyObject *repr = PyObject_Repr(list); + Py_DECREF(list); + return repr; +} + + +/*****************************************************************************/ +/* Python KX_PythonSeq_Type structure definition: */ +/*****************************************************************************/ +PyTypeObject KX_PythonSeq_Type = { +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif + /* For printing, in format "." */ + "KX_PythonSeq", /* char *tp_name; */ + sizeof( KX_PythonSeq ), /* int tp_basicsize; */ + 0, /* tp_itemsize; For allocation */ + + /* Methods to implement standard operations */ + + ( destructor ) KX_PythonSeq_dealloc, /* destructor tp_dealloc; */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + ( cmpfunc ) KX_PythonSeq_compare, /* cmpfunc tp_compare; */ + ( reprfunc ) KX_PythonSeq_repr, /* reprfunc tp_repr; */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + &KX_PythonSeq_as_mapping, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + ( getiterfunc) KX_PythonSeq_getIter, /* getiterfunc tp_iter; */ + ( iternextfunc ) KX_PythonSeq_nextIter, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + NULL, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + NULL, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; diff --git a/source/gameengine/Ketsji/KX_PythonSeq.h b/source/gameengine/Ketsji/KX_PythonSeq.h new file mode 100644 index 00000000000..15a016224a9 --- /dev/null +++ b/source/gameengine/Ketsji/KX_PythonSeq.h @@ -0,0 +1,60 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + * Readonly sequence wrapper for lookups on logic bricks + */ + +#ifndef _adr_py_seq_h_ // only process once, +#define _adr_py_seq_h_ // even if multiply included + +#include "PyObjectPlus.h" + +// ------------------------- +enum KX_PYGENSEQ_TYPE { + KX_PYGENSEQ_CONT_TYPE_SENSORS, + KX_PYGENSEQ_CONT_TYPE_ACTUATORS, + KX_PYGENSEQ_OB_TYPE_SENSORS, + KX_PYGENSEQ_OB_TYPE_CONTROLLERS, + KX_PYGENSEQ_OB_TYPE_ACTUATORS +}; + +/* The Main PyType Object defined in Main.c */ +extern PyTypeObject KX_PythonSeq_Type; + +#define BPy_KX_PythonSeq_Check(v) \ + ((v)->ob_type == &KX_PythonSeq_Type) + +typedef struct { + PyObject_VAR_HEAD + PyObject *base; + short type; + short iter; +} KX_PythonSeq; + +PyObject *KX_PythonSeq_CreatePyObject(PyObject *base, short type); + +#endif // _adr_py_seq_h_ diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py index 0f9bfea98f3..257a25e8ad9 100644 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ b/source/gameengine/PyDoc/KX_GameObject.py @@ -67,15 +67,15 @@ class KX_GameObject(SCA_IObject): - note: Most objects use only 1 mesh. - note: Changes to this list will not update the KX_GameObject. @type meshes: list of L{KX_MeshProxy} - @ivar sensors: a list of L{SCA_ISensor} objects. + @ivar sensors: a sequence of L{SCA_ISensor} objects with string/index lookups and iterator support. - note: This attribute is experemental and may be removed (but probably wont be). - note: Changes to this list will not update the KX_GameObject. @type sensors: list - @ivar controllers: a list of L{SCA_IController} objects. + @ivar controllers: a sequence of L{SCA_IController} objects with string/index lookups and iterator support. - note: This attribute is experemental and may be removed (but probably wont be). - note: Changes to this list will not update the KX_GameObject. @type controllers: list of L{SCA_ISensor}. - @ivar actuators: a list of L{SCA_IActuator} objects. + @ivar actuators: a list of L{SCA_IActuator} with string/index lookups and iterator support. - note: This attribute is experemental and may be removed (but probably wont be). - note: Changes to this list will not update the KX_GameObject. @type actuators: list diff --git a/source/gameengine/PyDoc/SCA_IController.py b/source/gameengine/PyDoc/SCA_IController.py index 3e6ee45e115..cfb4c18a826 100644 --- a/source/gameengine/PyDoc/SCA_IController.py +++ b/source/gameengine/PyDoc/SCA_IController.py @@ -12,13 +12,13 @@ class SCA_IController(SCA_ILogicBrick): @ivar sensors: a list of sensors linked to this controller - note: the sensors are not necessarily owned by the same object. - note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup. - @type sensors: list + @type sensors: sequence supporting index/string lookups and iteration. @ivar actuators: a list of actuators linked to this controller. - note: the sensors are not necessarily owned by the same object. - note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup. - @type actuators: list + @type actuators: sequence supporting index/string lookups and iteration. - @group Deprecated: getState, getSensors, getActuators + @group Deprecated: getState, getSensors, getActuators, getSensor, getActuator """ def getState(): @@ -39,6 +39,7 @@ class SCA_IController(SCA_ILogicBrick): """ def getSensor(name): """ + DEPRECATED: use the sensors[name] property Gets the named linked sensor. @type name: string @@ -53,6 +54,7 @@ class SCA_IController(SCA_ILogicBrick): """ def getActuator(name): """ + DEPRECATED: use the actuators[name] property Gets the named linked actuator. @type name: string -- cgit v1.2.3 From 6f5ef6044dabdd383a91a14c65a2f9f454fb5c42 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 10 May 2009 15:23:18 +0000 Subject: remove unneeded vars and wasn't returning on some errors --- source/gameengine/Ketsji/KX_PythonSeq.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp index c3ae35fa47c..039cf640a6f 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.cpp +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -52,7 +52,7 @@ PyObject *KX_PythonSeq_CreatePyObject( PyObject *base, short type ) PyObject_DEL( self ); } -static int KX_PythonSeq_len( KX_PythonSeq * self ) +static Py_ssize_t KX_PythonSeq_len( KX_PythonSeq * self ) { PyObjectPlus *self_plus= BGE_PROXY_REF(self->base); @@ -85,14 +85,13 @@ static PyObject *KX_PythonSeq_getIndex(KX_PythonSeq * self, int index) if(self_plus==NULL) { PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); - NULL; + return NULL; } switch(self->type) { case KX_PYGENSEQ_CONT_TYPE_SENSORS: { vector linkedsensors = ((SCA_IController *)self_plus)->GetLinkedSensors(); - SCA_ISensor* sensor; if(index<0) index += linkedsensors.size(); if(index<0 || index>= linkedsensors.size()) { PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); @@ -103,7 +102,6 @@ static PyObject *KX_PythonSeq_getIndex(KX_PythonSeq * self, int index) case KX_PYGENSEQ_CONT_TYPE_ACTUATORS: { vector linkedactuators = ((SCA_IController *)self_plus)->GetLinkedActuators(); - SCA_IActuator* sensor; if(index<0) index += linkedactuators.size(); if(index<0 || index>= linkedactuators.size()) { PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); @@ -114,7 +112,6 @@ static PyObject *KX_PythonSeq_getIndex(KX_PythonSeq * self, int index) case KX_PYGENSEQ_OB_TYPE_SENSORS: { SCA_SensorList& linkedsensors= ((KX_GameObject *)self_plus)->GetSensors(); - SCA_ISensor *sensor; if(index<0) index += linkedsensors.size(); if(index<0 || index>= linkedsensors.size()) { PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); @@ -125,7 +122,6 @@ static PyObject *KX_PythonSeq_getIndex(KX_PythonSeq * self, int index) case KX_PYGENSEQ_OB_TYPE_CONTROLLERS: { SCA_ControllerList& linkedcontrollers= ((KX_GameObject *)self_plus)->GetControllers(); - SCA_IController *controller; if(index<0) index += linkedcontrollers.size(); if(index<0 || index>= linkedcontrollers.size()) { PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); @@ -136,7 +132,6 @@ static PyObject *KX_PythonSeq_getIndex(KX_PythonSeq * self, int index) case KX_PYGENSEQ_OB_TYPE_ACTUATORS: { SCA_ActuatorList& linkedactuators= ((KX_GameObject *)self_plus)->GetActuators(); - SCA_IActuator *actuator; if(index<0) index += linkedactuators.size(); if(index<0 || index>= linkedactuators.size()) { PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); @@ -145,6 +140,9 @@ static PyObject *KX_PythonSeq_getIndex(KX_PythonSeq * self, int index) return linkedactuators[index]->GetProxy(); } } + + PyErr_SetString(PyExc_SystemError, "invalid sequence type, this is a bug"); + return NULL; } @@ -182,11 +180,11 @@ static PyObject * KX_PythonSeq_subscript(KX_PythonSeq * self, PyObject *key) case KX_PYGENSEQ_CONT_TYPE_ACTUATORS: { vector linkedactuators = ((SCA_IController *)self_plus)->GetLinkedActuators(); - SCA_IActuator* sensor; + SCA_IActuator* actuator; for (unsigned int index=0;indexGetName() == name) - return sensor->GetProxy(); + actuator = linkedactuators[index]; + if (actuator->GetName() == name) + return actuator->GetProxy(); } break; } @@ -232,7 +230,7 @@ static PyObject * KX_PythonSeq_subscript(KX_PythonSeq * self, PyObject *key) static PyMappingMethods KX_PythonSeq_as_mapping = { ( inquiry ) KX_PythonSeq_len, /* mp_length */ ( binaryfunc ) KX_PythonSeq_subscript, /* mp_subscript */ - ( objobjargproc ) 0, /* mp_ass_subscript */ + 0, /* mp_ass_subscript */ }; @@ -244,7 +242,7 @@ static PyObject *KX_PythonSeq_getIter( KX_PythonSeq * self ) { if(BGE_PROXY_REF(self->base)==NULL) { PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); - NULL; + return NULL; } /* create a new iterator if were alredy using this one */ -- cgit v1.2.3 From 386122ada6432b29437c3ca7f1eea2b5b919d377 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 10 May 2009 20:53:58 +0000 Subject: BGE performance, 4th round: logic This commit extends the technique of dynamic linked list to the logic system to eliminate as much as possible temporaries, map lookup or full scan. The logic engine is now free of memory allocation, which is an important stability factor. The overhead of the logic system is reduced by a factor between 3 and 6 depending on the logic setup. This is the speed-up you can expect on a logic setup using simple bricks. Heavy bricks like python controllers and ray sensors will still take about the same time to execute so the speed up will be less important. The core of the logic engine has been much reworked but the functionality is still the same except for one thing: the priority system on the execution of controllers. The exact same remark applies to actuators but I'll explain for controllers only: Previously, it was possible, with the "executePriority" attribute to set a controller to run before any other controllers in the game. Other than that, the sequential execution of controllers, as defined in Blender was guaranteed by default. With the new system, the sequential execution of controllers is still guaranteed but only within the controllers of one object. the user can no longer set a controller to run before any other controllers in the game. The "executePriority" attribute controls the execution of controllers within one object. The priority is a small number starting from 0 for the first controller and incrementing for each controller. If this missing feature is a must, a special method can be implemented to set a controller to run before all other controllers. Other improvements: - Systematic use of reference in parameter passing to avoid unnecessary data copy - Use pre increment in iterator instead of post increment to avoid temporary allocation - Use const char* instead of STR_String whenever possible to avoid temporary allocation - Fix reference counting bugs (memory leak) - Fix a crash in certain cases of state switching and object deletion - Minor speed up in property sensor - Removal of objects during the game is a lot faster --- .../BlenderRoutines/KX_BlenderRenderTools.cpp | 2 +- source/gameengine/Converter/BL_ActionActuator.cpp | 13 +- .../Converter/BL_BlenderDataConversion.cpp | 8 +- .../Converter/BL_ShapeActionActuator.cpp | 13 +- .../gameengine/Converter/KX_ConvertActuators.cpp | 14 +- source/gameengine/Converter/KX_ConvertActuators.h | 1 - .../gameengine/Converter/KX_ConvertControllers.cpp | 21 +- .../gameengine/Converter/KX_ConvertControllers.h | 1 - source/gameengine/Converter/KX_ConvertSensors.cpp | 310 ++++++++++---------- source/gameengine/Converter/KX_ConvertSensors.h | 1 - source/gameengine/Expressions/BoolValue.cpp | 8 +- source/gameengine/Expressions/BoolValue.h | 5 +- source/gameengine/Expressions/CMakeLists.txt | 1 + source/gameengine/Expressions/ErrorValue.cpp | 6 +- source/gameengine/Expressions/ErrorValue.h | 2 +- source/gameengine/Expressions/FloatValue.cpp | 2 +- source/gameengine/Expressions/FloatValue.h | 2 +- source/gameengine/Expressions/IfExpr.cpp | 7 +- source/gameengine/Expressions/InputParser.cpp | 10 +- source/gameengine/Expressions/InputParser.h | 10 +- source/gameengine/Expressions/IntValue.cpp | 2 +- source/gameengine/Expressions/IntValue.h | 2 +- source/gameengine/Expressions/ListValue.cpp | 12 +- source/gameengine/Expressions/ListValue.h | 2 +- source/gameengine/Expressions/Makefile | 1 + source/gameengine/Expressions/PyObjectPlus.cpp | 2 +- source/gameengine/Expressions/PyObjectPlus.h | 14 +- source/gameengine/Expressions/SConscript | 2 +- source/gameengine/Expressions/StringValue.cpp | 2 +- source/gameengine/Expressions/StringValue.h | 2 +- source/gameengine/Expressions/Value.cpp | 10 +- source/gameengine/Expressions/Value.h | 39 +-- source/gameengine/Expressions/VectorValue.cpp | 2 +- source/gameengine/Expressions/VectorValue.h | 2 +- source/gameengine/GameLogic/CMakeLists.txt | 1 + source/gameengine/GameLogic/Makefile | 1 + .../gameengine/GameLogic/SCA_2DFilterActuator.cpp | 2 +- source/gameengine/GameLogic/SCA_2DFilterActuator.h | 2 +- source/gameengine/GameLogic/SCA_ANDController.cpp | 11 +- .../GameLogic/SCA_ActuatorEventManager.cpp | 10 +- source/gameengine/GameLogic/SCA_ActuatorSensor.cpp | 2 +- source/gameengine/GameLogic/SCA_ActuatorSensor.h | 2 +- .../GameLogic/SCA_AlwaysEventManager.cpp | 5 +- source/gameengine/GameLogic/SCA_AlwaysSensor.cpp | 2 +- source/gameengine/GameLogic/SCA_AlwaysSensor.h | 2 +- source/gameengine/GameLogic/SCA_DelaySensor.cpp | 2 +- source/gameengine/GameLogic/SCA_DelaySensor.h | 2 +- source/gameengine/GameLogic/SCA_EventManager.cpp | 7 +- source/gameengine/GameLogic/SCA_EventManager.h | 5 +- .../GameLogic/SCA_ExpressionController.cpp | 25 +- source/gameengine/GameLogic/SCA_IActuator.cpp | 75 ++--- source/gameengine/GameLogic/SCA_IActuator.h | 61 +++- source/gameengine/GameLogic/SCA_IController.cpp | 88 +++--- source/gameengine/GameLogic/SCA_IController.h | 38 ++- source/gameengine/GameLogic/SCA_ILogicBrick.cpp | 10 +- source/gameengine/GameLogic/SCA_ILogicBrick.h | 11 +- source/gameengine/GameLogic/SCA_IObject.cpp | 18 +- source/gameengine/GameLogic/SCA_IObject.h | 30 ++ source/gameengine/GameLogic/SCA_IScene.cpp | 2 +- source/gameengine/GameLogic/SCA_IScene.h | 2 +- source/gameengine/GameLogic/SCA_ISensor.cpp | 87 ++++-- source/gameengine/GameLogic/SCA_ISensor.h | 28 +- .../gameengine/GameLogic/SCA_JoystickManager.cpp | 11 +- source/gameengine/GameLogic/SCA_JoystickSensor.cpp | 2 +- source/gameengine/GameLogic/SCA_JoystickSensor.h | 2 +- .../gameengine/GameLogic/SCA_KeyboardManager.cpp | 7 +- source/gameengine/GameLogic/SCA_KeyboardSensor.cpp | 2 +- source/gameengine/GameLogic/SCA_KeyboardSensor.h | 2 +- source/gameengine/GameLogic/SCA_LogicManager.cpp | 320 ++++----------------- source/gameengine/GameLogic/SCA_LogicManager.h | 50 +--- source/gameengine/GameLogic/SCA_MouseManager.cpp | 6 +- source/gameengine/GameLogic/SCA_MouseSensor.cpp | 2 +- source/gameengine/GameLogic/SCA_MouseSensor.h | 2 +- source/gameengine/GameLogic/SCA_NANDController.cpp | 11 +- source/gameengine/GameLogic/SCA_NORController.cpp | 11 +- source/gameengine/GameLogic/SCA_ORController.cpp | 9 +- .../GameLogic/SCA_PropertyEventManager.cpp | 5 +- source/gameengine/GameLogic/SCA_PropertySensor.cpp | 18 +- source/gameengine/GameLogic/SCA_PropertySensor.h | 2 +- .../gameengine/GameLogic/SCA_PythonController.cpp | 17 +- .../GameLogic/SCA_RandomEventManager.cpp | 5 +- source/gameengine/GameLogic/SCA_RandomSensor.cpp | 2 +- source/gameengine/GameLogic/SCA_RandomSensor.h | 2 +- .../gameengine/GameLogic/SCA_TimeEventManager.cpp | 6 +- source/gameengine/GameLogic/SCA_XNORController.cpp | 11 +- source/gameengine/GameLogic/SCA_XORController.cpp | 11 +- source/gameengine/GameLogic/SConscript | 2 +- source/gameengine/Ketsji/KXNetwork/CMakeLists.txt | 1 + .../Ketsji/KXNetwork/KX_NetworkEventManager.cpp | 8 +- .../Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp | 2 +- .../Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp | 10 +- .../Ketsji/KXNetwork/KX_NetworkMessageSensor.h | 2 +- source/gameengine/Ketsji/KXNetwork/Makefile | 1 + source/gameengine/Ketsji/KXNetwork/SConscript | 2 +- source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 5 +- source/gameengine/Ketsji/KX_CameraActuator.cpp | 2 +- source/gameengine/Ketsji/KX_GameObject.cpp | 20 +- source/gameengine/Ketsji/KX_GameObject.h | 4 +- source/gameengine/Ketsji/KX_IpoActuator.cpp | 6 +- source/gameengine/Ketsji/KX_MeshProxy.cpp | 13 +- source/gameengine/Ketsji/KX_MeshProxy.h | 6 +- source/gameengine/Ketsji/KX_MouseFocusSensor.cpp | 4 +- source/gameengine/Ketsji/KX_MouseFocusSensor.h | 2 +- source/gameengine/Ketsji/KX_NearSensor.cpp | 2 +- source/gameengine/Ketsji/KX_NearSensor.h | 2 +- source/gameengine/Ketsji/KX_ParentActuator.cpp | 2 +- source/gameengine/Ketsji/KX_PolyProxy.cpp | 10 +- source/gameengine/Ketsji/KX_PolyProxy.h | 6 +- source/gameengine/Ketsji/KX_PythonSeq.cpp | 8 +- source/gameengine/Ketsji/KX_RayEventManager.cpp | 5 +- source/gameengine/Ketsji/KX_RaySensor.cpp | 2 +- source/gameengine/Ketsji/KX_RaySensor.h | 2 +- .../gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp | 26 +- source/gameengine/Ketsji/KX_Scene.cpp | 64 ++--- source/gameengine/Ketsji/KX_Scene.h | 7 - source/gameengine/Ketsji/KX_SoundActuator.cpp | 14 +- source/gameengine/Ketsji/KX_SoundActuator.h | 1 + source/gameengine/Ketsji/KX_TouchEventManager.cpp | 25 +- source/gameengine/Ketsji/KX_TouchSensor.cpp | 4 +- source/gameengine/Ketsji/KX_TouchSensor.h | 2 +- source/gameengine/Ketsji/KX_TrackToActuator.cpp | 17 +- source/gameengine/Ketsji/KX_VertexProxy.cpp | 12 +- source/gameengine/Ketsji/KX_VertexProxy.h | 6 +- source/gameengine/Network/NG_NetworkScene.cpp | 4 +- source/gameengine/Rasterizer/RAS_BucketManager.cpp | 12 - source/gameengine/Rasterizer/RAS_MeshObject.cpp | 4 +- source/gameengine/Rasterizer/RAS_MeshObject.h | 4 +- source/gameengine/SceneGraph/SG_DList.h | 44 +-- source/gameengine/SceneGraph/SG_QList.h | 43 +-- 129 files changed, 930 insertions(+), 1066 deletions(-) (limited to 'source') diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp index e393b6d9af4..17d1bf65ca4 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp @@ -295,7 +295,7 @@ void KX_BlenderRenderTools::RenderText( RAS_IPolyMaterial* polymat, float v1[3], float v2[3], float v3[3], float v4[3], int glattrib) { - STR_String mytext = ((CValue*)m_clientobject)->GetPropertyText("Text"); + const STR_String& mytext = ((CValue*)m_clientobject)->GetPropertyText("Text"); const unsigned int flag = polymat->GetFlag(); struct MTFace* tface = 0; diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 646a65d347b..145cb1f22de 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -156,16 +156,9 @@ bool BL_ActionActuator::Update(double curtime, bool frame) // maybe there are events for us in the queue ! if (frame) { - for (vector::iterator i=m_events.begin(); !(i==m_events.end());i++) - { - if ((*i)->GetNumber() == 0.0f) - bNegativeEvent = true; - else - bPositiveEvent= true; - (*i)->Release(); - - } - m_events.clear(); + bNegativeEvent = m_negevent; + bPositiveEvent = m_posevent; + RemoveAllEvents(); if (bPositiveEvent) m_flag |= ACT_FLAG_ACTIVE; diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 1d2b275cab9..7d0bbbe107c 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -2610,8 +2610,6 @@ void BL_ConvertBlenderObjects(struct Main* maggie, templist->Release(); sumolist->Release(); - int executePriority=0; /* incremented by converter routines */ - // convert global sound stuff /* XXX, glob is the very very wrong place for this @@ -2642,7 +2640,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, struct Object* blenderobj = converter->FindBlenderObject(gameobj); int layerMask = (groupobj.find(blenderobj) == groupobj.end()) ? activeLayerBitInfo : 0; bool isInActiveLayer = (blenderobj->lay & layerMask)!=0; - BL_ConvertActuators(maggie->name, blenderobj,gameobj,logicmgr,kxscene,ketsjiEngine,executePriority, layerMask,isInActiveLayer,rendertools,converter); + BL_ConvertActuators(maggie->name, blenderobj,gameobj,logicmgr,kxscene,ketsjiEngine,layerMask,isInActiveLayer,rendertools,converter); } for ( i=0;iGetCount();i++) { @@ -2650,7 +2648,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, struct Object* blenderobj = converter->FindBlenderObject(gameobj); int layerMask = (groupobj.find(blenderobj) == groupobj.end()) ? activeLayerBitInfo : 0; bool isInActiveLayer = (blenderobj->lay & layerMask)!=0; - BL_ConvertControllers(blenderobj,gameobj,logicmgr,pythondictionary,executePriority,layerMask,isInActiveLayer,converter); + BL_ConvertControllers(blenderobj,gameobj,logicmgr,pythondictionary,layerMask,isInActiveLayer,converter); } for ( i=0;iGetCount();i++) { @@ -2658,7 +2656,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, struct Object* blenderobj = converter->FindBlenderObject(gameobj); int layerMask = (groupobj.find(blenderobj) == groupobj.end()) ? activeLayerBitInfo : 0; bool isInActiveLayer = (blenderobj->lay & layerMask)!=0; - BL_ConvertSensors(blenderobj,gameobj,logicmgr,kxscene,ketsjiEngine,keydev,executePriority,layerMask,isInActiveLayer,canvas,converter); + BL_ConvertSensors(blenderobj,gameobj,logicmgr,kxscene,ketsjiEngine,keydev,layerMask,isInActiveLayer,canvas,converter); // set the init state to all objects gameobj->SetInitState((blenderobj->init_state)?blenderobj->init_state:blenderobj->state); } diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index 5fea568dcb2..29bbe9b3d7d 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -160,16 +160,9 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) // maybe there are events for us in the queue ! if (frame) { - for (vector::iterator i=m_events.begin(); !(i==m_events.end());i++) - { - if ((*i)->GetNumber() == 0.0f) - bNegativeEvent = true; - else - bPositiveEvent= true; - (*i)->Release(); - - } - m_events.clear(); + bNegativeEvent = m_negevent; + bPositiveEvent = m_posevent; + RemoveAllEvents(); if (bPositiveEvent) m_flag |= ACT_FLAG_ACTIVE; diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 73d35a78ded..76b8540118a 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -105,7 +105,6 @@ void BL_ConvertActuators(char* maggiename, SCA_LogicManager* logicmgr, KX_Scene* scene, KX_KetsjiEngine* ketsjiEngine, - int & executePriority, int activeLayerBitInfo, bool isInActiveLayer, RAS_IRenderTools* rendertools, @@ -114,11 +113,20 @@ void BL_ConvertActuators(char* maggiename, { int uniqueint = 0; + int actcount = 0; + int executePriority = 0; bActuator* bact = (bActuator*) blenderobject->actuators.first; + while (bact) + { + actcount++; + bact = bact->next; + } + gameobj->ReserveActuator(actcount); + bact = (bActuator*) blenderobject->actuators.first; while(bact) { STR_String uniquename = bact->name; - STR_String objectname = gameobj->GetName(); + STR_String& objectname = gameobj->GetName(); SCA_IActuator* baseact = NULL; switch (bact->type) @@ -1144,7 +1152,7 @@ void BL_ConvertActuators(char* maggiename, CIntValue* uniqueval = new CIntValue(uniqueint); uniquename += uniqueval->GetText(); uniqueval->Release(); - baseact->SetName(STR_String(bact->name)); + baseact->SetName(bact->name); //gameobj->SetProperty(uniquename,baseact); gameobj->AddActuator(baseact); diff --git a/source/gameengine/Converter/KX_ConvertActuators.h b/source/gameengine/Converter/KX_ConvertActuators.h index 03ea0db99b9..e38a9c74efc 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.h +++ b/source/gameengine/Converter/KX_ConvertActuators.h @@ -35,7 +35,6 @@ void BL_ConvertActuators(char* maggiename, class SCA_LogicManager* logicmgr, class KX_Scene* scene, class KX_KetsjiEngine* ketsjiEngine, - int & executePriority, int activeLayerBitInfo, bool isInActiveLayer, class RAS_IRenderTools* rendertools, diff --git a/source/gameengine/Converter/KX_ConvertControllers.cpp b/source/gameengine/Converter/KX_ConvertControllers.cpp index 856f3f79588..9b0e27b573a 100644 --- a/source/gameengine/Converter/KX_ConvertControllers.cpp +++ b/source/gameengine/Converter/KX_ConvertControllers.cpp @@ -76,6 +76,7 @@ LinkControllerToActuators( // Iterate through the actuators of the game blender // controller and find the corresponding ketsji actuator. + game_controller->ReserveActuator(bcontr->totlinks); for (int i=0;itotlinks;i++) { bActuator* bact = (bActuator*) bcontr->links[i]; @@ -92,14 +93,22 @@ void BL_ConvertControllers( class KX_GameObject* gameobj, SCA_LogicManager* logicmgr, PyObject* pythondictionary, - int &executePriority, int activeLayerBitInfo, bool isInActiveLayer, KX_BlenderSceneConverter* converter ) { int uniqueint=0; + int count = 0; + int executePriority=0; bController* bcontr = (bController*)blenderobject->controllers.first; while (bcontr) + { + bcontr = bcontr->next; + count++; + } + gameobj->ReserveController(count); + bcontr = (bController*)blenderobject->controllers.first; + while (bcontr) { SCA_IController* gamecontroller = NULL; switch(bcontr->type) @@ -107,37 +116,31 @@ void BL_ConvertControllers( case CONT_LOGIC_AND: { gamecontroller = new SCA_ANDController(gameobj); - LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); break; } case CONT_LOGIC_OR: { gamecontroller = new SCA_ORController(gameobj); - LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); break; } case CONT_LOGIC_NAND: { gamecontroller = new SCA_NANDController(gameobj); - LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); break; } case CONT_LOGIC_NOR: { gamecontroller = new SCA_NORController(gameobj); - LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); break; } case CONT_LOGIC_XOR: { gamecontroller = new SCA_XORController(gameobj); - LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); break; } case CONT_LOGIC_XNOR: { gamecontroller = new SCA_XNORController(gameobj); - LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); break; } case CONT_EXPRESSION: @@ -147,8 +150,6 @@ void BL_ConvertControllers( if (expressiontext.Length() > 0) { gamecontroller = new SCA_ExpressionController(gameobj,expressiontext); - LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); - } break; } @@ -186,7 +187,6 @@ void BL_ConvertControllers( pyctrl->SetDebug(true); } - LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); break; } default: @@ -197,6 +197,7 @@ void BL_ConvertControllers( if (gamecontroller) { + LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); gamecontroller->SetExecutePriority(executePriority++); gamecontroller->SetState(bcontr->state_mask); STR_String uniquename = bcontr->name; diff --git a/source/gameengine/Converter/KX_ConvertControllers.h b/source/gameengine/Converter/KX_ConvertControllers.h index 3e8a87fc90b..d340778290c 100644 --- a/source/gameengine/Converter/KX_ConvertControllers.h +++ b/source/gameengine/Converter/KX_ConvertControllers.h @@ -36,7 +36,6 @@ void BL_ConvertControllers( class KX_GameObject* gameobj, class SCA_LogicManager* logicmgr, PyObject* pythondictionary, - int & executePriority, int activeLayerBitInfo, bool isInActiveLayer, class KX_BlenderSceneConverter* converter diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp index af57094b2b5..07b0abae6df 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.cpp +++ b/source/gameengine/Converter/KX_ConvertSensors.cpp @@ -94,161 +94,166 @@ void BL_ConvertSensors(struct Object* blenderobject, KX_Scene* kxscene, KX_KetsjiEngine* kxengine, SCA_IInputDevice* keydev, - int & executePriority, int activeLayerBitInfo, bool isInActiveLayer, RAS_ICanvas* canvas, KX_BlenderSceneConverter* converter ) { + static bool reverseTableConverted = false; - - - /* The reverse table. In order to not confuse ourselves, we */ - /* immediately convert all events that come in to KX codes. */ - gReverseKeyTranslateTable[LEFTMOUSE ] = SCA_IInputDevice::KX_LEFTMOUSE; - gReverseKeyTranslateTable[MIDDLEMOUSE ] = SCA_IInputDevice::KX_MIDDLEMOUSE; - gReverseKeyTranslateTable[RIGHTMOUSE ] = SCA_IInputDevice::KX_RIGHTMOUSE; - gReverseKeyTranslateTable[WHEELUPMOUSE ] = SCA_IInputDevice::KX_WHEELUPMOUSE; - gReverseKeyTranslateTable[WHEELDOWNMOUSE ] = SCA_IInputDevice::KX_WHEELDOWNMOUSE; - gReverseKeyTranslateTable[MOUSEX ] = SCA_IInputDevice::KX_MOUSEX; - gReverseKeyTranslateTable[MOUSEY ] = SCA_IInputDevice::KX_MOUSEY; - - // TIMERS - - gReverseKeyTranslateTable[TIMER0 ] = SCA_IInputDevice::KX_TIMER0; - gReverseKeyTranslateTable[TIMER1 ] = SCA_IInputDevice::KX_TIMER1; - gReverseKeyTranslateTable[TIMER2 ] = SCA_IInputDevice::KX_TIMER2; - gReverseKeyTranslateTable[TIMER3 ] = SCA_IInputDevice::KX_TIMER3; - - // SYSTEM - - gReverseKeyTranslateTable[KEYBD ] = SCA_IInputDevice::KX_KEYBD; - gReverseKeyTranslateTable[RAWKEYBD ] = SCA_IInputDevice::KX_RAWKEYBD; - gReverseKeyTranslateTable[REDRAW ] = SCA_IInputDevice::KX_REDRAW; - gReverseKeyTranslateTable[INPUTCHANGE ] = SCA_IInputDevice::KX_INPUTCHANGE; - gReverseKeyTranslateTable[QFULL ] = SCA_IInputDevice::KX_QFULL; - gReverseKeyTranslateTable[WINFREEZE ] = SCA_IInputDevice::KX_WINFREEZE; - gReverseKeyTranslateTable[WINTHAW ] = SCA_IInputDevice::KX_WINTHAW; - gReverseKeyTranslateTable[WINCLOSE ] = SCA_IInputDevice::KX_WINCLOSE; - gReverseKeyTranslateTable[WINQUIT ] = SCA_IInputDevice::KX_WINQUIT; - gReverseKeyTranslateTable[Q_FIRSTTIME ] = SCA_IInputDevice::KX_Q_FIRSTTIME; - - // standard keyboard - - gReverseKeyTranslateTable[AKEY ] = SCA_IInputDevice::KX_AKEY; - gReverseKeyTranslateTable[BKEY ] = SCA_IInputDevice::KX_BKEY; - gReverseKeyTranslateTable[CKEY ] = SCA_IInputDevice::KX_CKEY; - gReverseKeyTranslateTable[DKEY ] = SCA_IInputDevice::KX_DKEY; - gReverseKeyTranslateTable[EKEY ] = SCA_IInputDevice::KX_EKEY; - gReverseKeyTranslateTable[FKEY ] = SCA_IInputDevice::KX_FKEY; - gReverseKeyTranslateTable[GKEY ] = SCA_IInputDevice::KX_GKEY; - gReverseKeyTranslateTable[HKEY ] = SCA_IInputDevice::KX_HKEY; - gReverseKeyTranslateTable[IKEY ] = SCA_IInputDevice::KX_IKEY; - gReverseKeyTranslateTable[JKEY ] = SCA_IInputDevice::KX_JKEY; - gReverseKeyTranslateTable[KKEY ] = SCA_IInputDevice::KX_KKEY; - gReverseKeyTranslateTable[LKEY ] = SCA_IInputDevice::KX_LKEY; - gReverseKeyTranslateTable[MKEY ] = SCA_IInputDevice::KX_MKEY; - gReverseKeyTranslateTable[NKEY ] = SCA_IInputDevice::KX_NKEY; - gReverseKeyTranslateTable[OKEY ] = SCA_IInputDevice::KX_OKEY; - gReverseKeyTranslateTable[PKEY ] = SCA_IInputDevice::KX_PKEY; - gReverseKeyTranslateTable[QKEY ] = SCA_IInputDevice::KX_QKEY; - gReverseKeyTranslateTable[RKEY ] = SCA_IInputDevice::KX_RKEY; - gReverseKeyTranslateTable[SKEY ] = SCA_IInputDevice::KX_SKEY; - gReverseKeyTranslateTable[TKEY ] = SCA_IInputDevice::KX_TKEY; - gReverseKeyTranslateTable[UKEY ] = SCA_IInputDevice::KX_UKEY; - gReverseKeyTranslateTable[VKEY ] = SCA_IInputDevice::KX_VKEY; - gReverseKeyTranslateTable[WKEY ] = SCA_IInputDevice::KX_WKEY; - gReverseKeyTranslateTable[XKEY ] = SCA_IInputDevice::KX_XKEY; - gReverseKeyTranslateTable[YKEY ] = SCA_IInputDevice::KX_YKEY; - gReverseKeyTranslateTable[ZKEY ] = SCA_IInputDevice::KX_ZKEY; - - gReverseKeyTranslateTable[ZEROKEY ] = SCA_IInputDevice::KX_ZEROKEY; - gReverseKeyTranslateTable[ONEKEY ] = SCA_IInputDevice::KX_ONEKEY; - gReverseKeyTranslateTable[TWOKEY ] = SCA_IInputDevice::KX_TWOKEY; - gReverseKeyTranslateTable[THREEKEY ] = SCA_IInputDevice::KX_THREEKEY; - gReverseKeyTranslateTable[FOURKEY ] = SCA_IInputDevice::KX_FOURKEY; - gReverseKeyTranslateTable[FIVEKEY ] = SCA_IInputDevice::KX_FIVEKEY; - gReverseKeyTranslateTable[SIXKEY ] = SCA_IInputDevice::KX_SIXKEY; - gReverseKeyTranslateTable[SEVENKEY ] = SCA_IInputDevice::KX_SEVENKEY; - gReverseKeyTranslateTable[EIGHTKEY ] = SCA_IInputDevice::KX_EIGHTKEY; - gReverseKeyTranslateTable[NINEKEY ] = SCA_IInputDevice::KX_NINEKEY; - - gReverseKeyTranslateTable[CAPSLOCKKEY ] = SCA_IInputDevice::KX_CAPSLOCKKEY; - - gReverseKeyTranslateTable[LEFTCTRLKEY ] = SCA_IInputDevice::KX_LEFTCTRLKEY; - gReverseKeyTranslateTable[LEFTALTKEY ] = SCA_IInputDevice::KX_LEFTALTKEY; - gReverseKeyTranslateTable[RIGHTALTKEY ] = SCA_IInputDevice::KX_RIGHTALTKEY; - gReverseKeyTranslateTable[RIGHTCTRLKEY ] = SCA_IInputDevice::KX_RIGHTCTRLKEY; - gReverseKeyTranslateTable[RIGHTSHIFTKEY ] = SCA_IInputDevice::KX_RIGHTSHIFTKEY; - gReverseKeyTranslateTable[LEFTSHIFTKEY ] = SCA_IInputDevice::KX_LEFTSHIFTKEY; - - gReverseKeyTranslateTable[ESCKEY ] = SCA_IInputDevice::KX_ESCKEY; - gReverseKeyTranslateTable[TABKEY ] = SCA_IInputDevice::KX_TABKEY; - gReverseKeyTranslateTable[RETKEY ] = SCA_IInputDevice::KX_RETKEY; - gReverseKeyTranslateTable[SPACEKEY ] = SCA_IInputDevice::KX_SPACEKEY; - gReverseKeyTranslateTable[LINEFEEDKEY ] = SCA_IInputDevice::KX_LINEFEEDKEY; - gReverseKeyTranslateTable[BACKSPACEKEY ] = SCA_IInputDevice::KX_BACKSPACEKEY; - gReverseKeyTranslateTable[DELKEY ] = SCA_IInputDevice::KX_DELKEY; - gReverseKeyTranslateTable[SEMICOLONKEY ] = SCA_IInputDevice::KX_SEMICOLONKEY; - gReverseKeyTranslateTable[PERIODKEY ] = SCA_IInputDevice::KX_PERIODKEY; - gReverseKeyTranslateTable[COMMAKEY ] = SCA_IInputDevice::KX_COMMAKEY; - gReverseKeyTranslateTable[QUOTEKEY ] = SCA_IInputDevice::KX_QUOTEKEY; - gReverseKeyTranslateTable[ACCENTGRAVEKEY ] = SCA_IInputDevice::KX_ACCENTGRAVEKEY; - gReverseKeyTranslateTable[MINUSKEY ] = SCA_IInputDevice::KX_MINUSKEY; - gReverseKeyTranslateTable[SLASHKEY ] = SCA_IInputDevice::KX_SLASHKEY; - gReverseKeyTranslateTable[BACKSLASHKEY ] = SCA_IInputDevice::KX_BACKSLASHKEY; - gReverseKeyTranslateTable[EQUALKEY ] = SCA_IInputDevice::KX_EQUALKEY; - gReverseKeyTranslateTable[LEFTBRACKETKEY ] = SCA_IInputDevice::KX_LEFTBRACKETKEY; - gReverseKeyTranslateTable[RIGHTBRACKETKEY ] = SCA_IInputDevice::KX_RIGHTBRACKETKEY; - - gReverseKeyTranslateTable[LEFTARROWKEY ] = SCA_IInputDevice::KX_LEFTARROWKEY; - gReverseKeyTranslateTable[DOWNARROWKEY ] = SCA_IInputDevice::KX_DOWNARROWKEY; - gReverseKeyTranslateTable[RIGHTARROWKEY ] = SCA_IInputDevice::KX_RIGHTARROWKEY; - gReverseKeyTranslateTable[UPARROWKEY ] = SCA_IInputDevice::KX_UPARROWKEY; - - gReverseKeyTranslateTable[PAD2 ] = SCA_IInputDevice::KX_PAD2; - gReverseKeyTranslateTable[PAD4 ] = SCA_IInputDevice::KX_PAD4; - gReverseKeyTranslateTable[PAD6 ] = SCA_IInputDevice::KX_PAD6; - gReverseKeyTranslateTable[PAD8 ] = SCA_IInputDevice::KX_PAD8; - - gReverseKeyTranslateTable[PAD1 ] = SCA_IInputDevice::KX_PAD1; - gReverseKeyTranslateTable[PAD3 ] = SCA_IInputDevice::KX_PAD3; - gReverseKeyTranslateTable[PAD5 ] = SCA_IInputDevice::KX_PAD5; - gReverseKeyTranslateTable[PAD7 ] = SCA_IInputDevice::KX_PAD7; - gReverseKeyTranslateTable[PAD9 ] = SCA_IInputDevice::KX_PAD9; - - gReverseKeyTranslateTable[PADPERIOD ] = SCA_IInputDevice::KX_PADPERIOD; - gReverseKeyTranslateTable[PADSLASHKEY ] = SCA_IInputDevice::KX_PADSLASHKEY; - gReverseKeyTranslateTable[PADASTERKEY ] = SCA_IInputDevice::KX_PADASTERKEY; - - gReverseKeyTranslateTable[PAD0 ] = SCA_IInputDevice::KX_PAD0; - gReverseKeyTranslateTable[PADMINUS ] = SCA_IInputDevice::KX_PADMINUS; - gReverseKeyTranslateTable[PADENTER ] = SCA_IInputDevice::KX_PADENTER; - gReverseKeyTranslateTable[PADPLUSKEY ] = SCA_IInputDevice::KX_PADPLUSKEY; - - - gReverseKeyTranslateTable[F1KEY ] = SCA_IInputDevice::KX_F1KEY; - gReverseKeyTranslateTable[F2KEY ] = SCA_IInputDevice::KX_F2KEY; - gReverseKeyTranslateTable[F3KEY ] = SCA_IInputDevice::KX_F3KEY; - gReverseKeyTranslateTable[F4KEY ] = SCA_IInputDevice::KX_F4KEY; - gReverseKeyTranslateTable[F5KEY ] = SCA_IInputDevice::KX_F5KEY; - gReverseKeyTranslateTable[F6KEY ] = SCA_IInputDevice::KX_F6KEY; - gReverseKeyTranslateTable[F7KEY ] = SCA_IInputDevice::KX_F7KEY; - gReverseKeyTranslateTable[F8KEY ] = SCA_IInputDevice::KX_F8KEY; - gReverseKeyTranslateTable[F9KEY ] = SCA_IInputDevice::KX_F9KEY; - gReverseKeyTranslateTable[F10KEY ] = SCA_IInputDevice::KX_F10KEY; - gReverseKeyTranslateTable[F11KEY ] = SCA_IInputDevice::KX_F11KEY; - gReverseKeyTranslateTable[F12KEY ] = SCA_IInputDevice::KX_F12KEY; - - gReverseKeyTranslateTable[PAUSEKEY ] = SCA_IInputDevice::KX_PAUSEKEY; - gReverseKeyTranslateTable[INSERTKEY ] = SCA_IInputDevice::KX_INSERTKEY; - gReverseKeyTranslateTable[HOMEKEY ] = SCA_IInputDevice::KX_HOMEKEY; - gReverseKeyTranslateTable[PAGEUPKEY ] = SCA_IInputDevice::KX_PAGEUPKEY; - gReverseKeyTranslateTable[PAGEDOWNKEY ] = SCA_IInputDevice::KX_PAGEDOWNKEY; - gReverseKeyTranslateTable[ENDKEY ] = SCA_IInputDevice::KX_ENDKEY; - + if (!reverseTableConverted) + { + reverseTableConverted = true; + + /* The reverse table. In order to not confuse ourselves, we */ + /* immediately convert all events that come in to KX codes. */ + gReverseKeyTranslateTable[LEFTMOUSE ] = SCA_IInputDevice::KX_LEFTMOUSE; + gReverseKeyTranslateTable[MIDDLEMOUSE ] = SCA_IInputDevice::KX_MIDDLEMOUSE; + gReverseKeyTranslateTable[RIGHTMOUSE ] = SCA_IInputDevice::KX_RIGHTMOUSE; + gReverseKeyTranslateTable[WHEELUPMOUSE ] = SCA_IInputDevice::KX_WHEELUPMOUSE; + gReverseKeyTranslateTable[WHEELDOWNMOUSE ] = SCA_IInputDevice::KX_WHEELDOWNMOUSE; + gReverseKeyTranslateTable[MOUSEX ] = SCA_IInputDevice::KX_MOUSEX; + gReverseKeyTranslateTable[MOUSEY ] = SCA_IInputDevice::KX_MOUSEY; + + // TIMERS + + gReverseKeyTranslateTable[TIMER0 ] = SCA_IInputDevice::KX_TIMER0; + gReverseKeyTranslateTable[TIMER1 ] = SCA_IInputDevice::KX_TIMER1; + gReverseKeyTranslateTable[TIMER2 ] = SCA_IInputDevice::KX_TIMER2; + gReverseKeyTranslateTable[TIMER3 ] = SCA_IInputDevice::KX_TIMER3; + + // SYSTEM + + gReverseKeyTranslateTable[KEYBD ] = SCA_IInputDevice::KX_KEYBD; + gReverseKeyTranslateTable[RAWKEYBD ] = SCA_IInputDevice::KX_RAWKEYBD; + gReverseKeyTranslateTable[REDRAW ] = SCA_IInputDevice::KX_REDRAW; + gReverseKeyTranslateTable[INPUTCHANGE ] = SCA_IInputDevice::KX_INPUTCHANGE; + gReverseKeyTranslateTable[QFULL ] = SCA_IInputDevice::KX_QFULL; + gReverseKeyTranslateTable[WINFREEZE ] = SCA_IInputDevice::KX_WINFREEZE; + gReverseKeyTranslateTable[WINTHAW ] = SCA_IInputDevice::KX_WINTHAW; + gReverseKeyTranslateTable[WINCLOSE ] = SCA_IInputDevice::KX_WINCLOSE; + gReverseKeyTranslateTable[WINQUIT ] = SCA_IInputDevice::KX_WINQUIT; + gReverseKeyTranslateTable[Q_FIRSTTIME ] = SCA_IInputDevice::KX_Q_FIRSTTIME; + + // standard keyboard + + gReverseKeyTranslateTable[AKEY ] = SCA_IInputDevice::KX_AKEY; + gReverseKeyTranslateTable[BKEY ] = SCA_IInputDevice::KX_BKEY; + gReverseKeyTranslateTable[CKEY ] = SCA_IInputDevice::KX_CKEY; + gReverseKeyTranslateTable[DKEY ] = SCA_IInputDevice::KX_DKEY; + gReverseKeyTranslateTable[EKEY ] = SCA_IInputDevice::KX_EKEY; + gReverseKeyTranslateTable[FKEY ] = SCA_IInputDevice::KX_FKEY; + gReverseKeyTranslateTable[GKEY ] = SCA_IInputDevice::KX_GKEY; + gReverseKeyTranslateTable[HKEY ] = SCA_IInputDevice::KX_HKEY; + gReverseKeyTranslateTable[IKEY ] = SCA_IInputDevice::KX_IKEY; + gReverseKeyTranslateTable[JKEY ] = SCA_IInputDevice::KX_JKEY; + gReverseKeyTranslateTable[KKEY ] = SCA_IInputDevice::KX_KKEY; + gReverseKeyTranslateTable[LKEY ] = SCA_IInputDevice::KX_LKEY; + gReverseKeyTranslateTable[MKEY ] = SCA_IInputDevice::KX_MKEY; + gReverseKeyTranslateTable[NKEY ] = SCA_IInputDevice::KX_NKEY; + gReverseKeyTranslateTable[OKEY ] = SCA_IInputDevice::KX_OKEY; + gReverseKeyTranslateTable[PKEY ] = SCA_IInputDevice::KX_PKEY; + gReverseKeyTranslateTable[QKEY ] = SCA_IInputDevice::KX_QKEY; + gReverseKeyTranslateTable[RKEY ] = SCA_IInputDevice::KX_RKEY; + gReverseKeyTranslateTable[SKEY ] = SCA_IInputDevice::KX_SKEY; + gReverseKeyTranslateTable[TKEY ] = SCA_IInputDevice::KX_TKEY; + gReverseKeyTranslateTable[UKEY ] = SCA_IInputDevice::KX_UKEY; + gReverseKeyTranslateTable[VKEY ] = SCA_IInputDevice::KX_VKEY; + gReverseKeyTranslateTable[WKEY ] = SCA_IInputDevice::KX_WKEY; + gReverseKeyTranslateTable[XKEY ] = SCA_IInputDevice::KX_XKEY; + gReverseKeyTranslateTable[YKEY ] = SCA_IInputDevice::KX_YKEY; + gReverseKeyTranslateTable[ZKEY ] = SCA_IInputDevice::KX_ZKEY; + + gReverseKeyTranslateTable[ZEROKEY ] = SCA_IInputDevice::KX_ZEROKEY; + gReverseKeyTranslateTable[ONEKEY ] = SCA_IInputDevice::KX_ONEKEY; + gReverseKeyTranslateTable[TWOKEY ] = SCA_IInputDevice::KX_TWOKEY; + gReverseKeyTranslateTable[THREEKEY ] = SCA_IInputDevice::KX_THREEKEY; + gReverseKeyTranslateTable[FOURKEY ] = SCA_IInputDevice::KX_FOURKEY; + gReverseKeyTranslateTable[FIVEKEY ] = SCA_IInputDevice::KX_FIVEKEY; + gReverseKeyTranslateTable[SIXKEY ] = SCA_IInputDevice::KX_SIXKEY; + gReverseKeyTranslateTable[SEVENKEY ] = SCA_IInputDevice::KX_SEVENKEY; + gReverseKeyTranslateTable[EIGHTKEY ] = SCA_IInputDevice::KX_EIGHTKEY; + gReverseKeyTranslateTable[NINEKEY ] = SCA_IInputDevice::KX_NINEKEY; + + gReverseKeyTranslateTable[CAPSLOCKKEY ] = SCA_IInputDevice::KX_CAPSLOCKKEY; + + gReverseKeyTranslateTable[LEFTCTRLKEY ] = SCA_IInputDevice::KX_LEFTCTRLKEY; + gReverseKeyTranslateTable[LEFTALTKEY ] = SCA_IInputDevice::KX_LEFTALTKEY; + gReverseKeyTranslateTable[RIGHTALTKEY ] = SCA_IInputDevice::KX_RIGHTALTKEY; + gReverseKeyTranslateTable[RIGHTCTRLKEY ] = SCA_IInputDevice::KX_RIGHTCTRLKEY; + gReverseKeyTranslateTable[RIGHTSHIFTKEY ] = SCA_IInputDevice::KX_RIGHTSHIFTKEY; + gReverseKeyTranslateTable[LEFTSHIFTKEY ] = SCA_IInputDevice::KX_LEFTSHIFTKEY; + + gReverseKeyTranslateTable[ESCKEY ] = SCA_IInputDevice::KX_ESCKEY; + gReverseKeyTranslateTable[TABKEY ] = SCA_IInputDevice::KX_TABKEY; + gReverseKeyTranslateTable[RETKEY ] = SCA_IInputDevice::KX_RETKEY; + gReverseKeyTranslateTable[SPACEKEY ] = SCA_IInputDevice::KX_SPACEKEY; + gReverseKeyTranslateTable[LINEFEEDKEY ] = SCA_IInputDevice::KX_LINEFEEDKEY; + gReverseKeyTranslateTable[BACKSPACEKEY ] = SCA_IInputDevice::KX_BACKSPACEKEY; + gReverseKeyTranslateTable[DELKEY ] = SCA_IInputDevice::KX_DELKEY; + gReverseKeyTranslateTable[SEMICOLONKEY ] = SCA_IInputDevice::KX_SEMICOLONKEY; + gReverseKeyTranslateTable[PERIODKEY ] = SCA_IInputDevice::KX_PERIODKEY; + gReverseKeyTranslateTable[COMMAKEY ] = SCA_IInputDevice::KX_COMMAKEY; + gReverseKeyTranslateTable[QUOTEKEY ] = SCA_IInputDevice::KX_QUOTEKEY; + gReverseKeyTranslateTable[ACCENTGRAVEKEY ] = SCA_IInputDevice::KX_ACCENTGRAVEKEY; + gReverseKeyTranslateTable[MINUSKEY ] = SCA_IInputDevice::KX_MINUSKEY; + gReverseKeyTranslateTable[SLASHKEY ] = SCA_IInputDevice::KX_SLASHKEY; + gReverseKeyTranslateTable[BACKSLASHKEY ] = SCA_IInputDevice::KX_BACKSLASHKEY; + gReverseKeyTranslateTable[EQUALKEY ] = SCA_IInputDevice::KX_EQUALKEY; + gReverseKeyTranslateTable[LEFTBRACKETKEY ] = SCA_IInputDevice::KX_LEFTBRACKETKEY; + gReverseKeyTranslateTable[RIGHTBRACKETKEY ] = SCA_IInputDevice::KX_RIGHTBRACKETKEY; + + gReverseKeyTranslateTable[LEFTARROWKEY ] = SCA_IInputDevice::KX_LEFTARROWKEY; + gReverseKeyTranslateTable[DOWNARROWKEY ] = SCA_IInputDevice::KX_DOWNARROWKEY; + gReverseKeyTranslateTable[RIGHTARROWKEY ] = SCA_IInputDevice::KX_RIGHTARROWKEY; + gReverseKeyTranslateTable[UPARROWKEY ] = SCA_IInputDevice::KX_UPARROWKEY; + + gReverseKeyTranslateTable[PAD2 ] = SCA_IInputDevice::KX_PAD2; + gReverseKeyTranslateTable[PAD4 ] = SCA_IInputDevice::KX_PAD4; + gReverseKeyTranslateTable[PAD6 ] = SCA_IInputDevice::KX_PAD6; + gReverseKeyTranslateTable[PAD8 ] = SCA_IInputDevice::KX_PAD8; + + gReverseKeyTranslateTable[PAD1 ] = SCA_IInputDevice::KX_PAD1; + gReverseKeyTranslateTable[PAD3 ] = SCA_IInputDevice::KX_PAD3; + gReverseKeyTranslateTable[PAD5 ] = SCA_IInputDevice::KX_PAD5; + gReverseKeyTranslateTable[PAD7 ] = SCA_IInputDevice::KX_PAD7; + gReverseKeyTranslateTable[PAD9 ] = SCA_IInputDevice::KX_PAD9; + + gReverseKeyTranslateTable[PADPERIOD ] = SCA_IInputDevice::KX_PADPERIOD; + gReverseKeyTranslateTable[PADSLASHKEY ] = SCA_IInputDevice::KX_PADSLASHKEY; + gReverseKeyTranslateTable[PADASTERKEY ] = SCA_IInputDevice::KX_PADASTERKEY; + + gReverseKeyTranslateTable[PAD0 ] = SCA_IInputDevice::KX_PAD0; + gReverseKeyTranslateTable[PADMINUS ] = SCA_IInputDevice::KX_PADMINUS; + gReverseKeyTranslateTable[PADENTER ] = SCA_IInputDevice::KX_PADENTER; + gReverseKeyTranslateTable[PADPLUSKEY ] = SCA_IInputDevice::KX_PADPLUSKEY; + + + gReverseKeyTranslateTable[F1KEY ] = SCA_IInputDevice::KX_F1KEY; + gReverseKeyTranslateTable[F2KEY ] = SCA_IInputDevice::KX_F2KEY; + gReverseKeyTranslateTable[F3KEY ] = SCA_IInputDevice::KX_F3KEY; + gReverseKeyTranslateTable[F4KEY ] = SCA_IInputDevice::KX_F4KEY; + gReverseKeyTranslateTable[F5KEY ] = SCA_IInputDevice::KX_F5KEY; + gReverseKeyTranslateTable[F6KEY ] = SCA_IInputDevice::KX_F6KEY; + gReverseKeyTranslateTable[F7KEY ] = SCA_IInputDevice::KX_F7KEY; + gReverseKeyTranslateTable[F8KEY ] = SCA_IInputDevice::KX_F8KEY; + gReverseKeyTranslateTable[F9KEY ] = SCA_IInputDevice::KX_F9KEY; + gReverseKeyTranslateTable[F10KEY ] = SCA_IInputDevice::KX_F10KEY; + gReverseKeyTranslateTable[F11KEY ] = SCA_IInputDevice::KX_F11KEY; + gReverseKeyTranslateTable[F12KEY ] = SCA_IInputDevice::KX_F12KEY; + + gReverseKeyTranslateTable[PAUSEKEY ] = SCA_IInputDevice::KX_PAUSEKEY; + gReverseKeyTranslateTable[INSERTKEY ] = SCA_IInputDevice::KX_INSERTKEY; + gReverseKeyTranslateTable[HOMEKEY ] = SCA_IInputDevice::KX_HOMEKEY; + gReverseKeyTranslateTable[PAGEUPKEY ] = SCA_IInputDevice::KX_PAGEUPKEY; + gReverseKeyTranslateTable[PAGEDOWNKEY ] = SCA_IInputDevice::KX_PAGEDOWNKEY; + gReverseKeyTranslateTable[ENDKEY ] = SCA_IInputDevice::KX_ENDKEY; + } + + int executePriority = 0; int uniqueint = 0; + int count = 0; bSensor* sens = (bSensor*)blenderobject->sensors.first; bool pos_pulsemode = false; bool neg_pulsemode = false; @@ -257,6 +262,13 @@ void BL_ConvertSensors(struct Object* blenderobject, bool level = false; bool tap = false; + while (sens) + { + sens = sens->next; + count++; + } + gameobj->ReserveSensor(count); + sens = (bSensor*)blenderobject->sensors.first; while(sens) { SCA_ISensor* gamesensor=NULL; @@ -758,7 +770,7 @@ void BL_ConvertSensors(struct Object* blenderobject, gamesensor->SetInvert(invert); gamesensor->SetLevel(level); gamesensor->SetTap(tap); - gamesensor->SetName(STR_String(sens->name)); + gamesensor->SetName(sens->name); gameobj->AddSensor(gamesensor); @@ -767,7 +779,7 @@ void BL_ConvertSensors(struct Object* blenderobject, //if (isInActiveLayer) // gamesensor->RegisterToManager(); - + gamesensor->ReserveController(sens->totlinks); for (int i=0;itotlinks;i++) { bController* linkedcont = (bController*) sens->links[i]; diff --git a/source/gameengine/Converter/KX_ConvertSensors.h b/source/gameengine/Converter/KX_ConvertSensors.h index b18ffc10a2a..9162a866768 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.h +++ b/source/gameengine/Converter/KX_ConvertSensors.h @@ -35,7 +35,6 @@ void BL_ConvertSensors(struct Object* blenderobject, class KX_Scene* kxscene, class KX_KetsjiEngine* kxengine, class SCA_IInputDevice* keydev, - int & executePriority , int activeLayerBitInfo, bool isInActiveLayer, class RAS_ICanvas* canvas, diff --git a/source/gameengine/Expressions/BoolValue.cpp b/source/gameengine/Expressions/BoolValue.cpp index 4e0a71e5a19..d90da8b3a92 100644 --- a/source/gameengine/Expressions/BoolValue.cpp +++ b/source/gameengine/Expressions/BoolValue.cpp @@ -26,6 +26,9 @@ // Construction/Destruction ////////////////////////////////////////////////////////////////////// +const STR_String CBoolValue::sTrueString = "TRUE"; +const STR_String CBoolValue::sFalseString = "FALSE"; + CBoolValue::CBoolValue() /* @@ -45,7 +48,7 @@ CBoolValue::CBoolValue(bool inBool) -CBoolValue::CBoolValue(bool innie,STR_String name,AllocationTYPE alloctype) +CBoolValue::CBoolValue(bool innie,const char *name,AllocationTYPE alloctype) { m_bool = innie; SetName(name); @@ -190,9 +193,6 @@ double CBoolValue::GetNumber() const STR_String& CBoolValue::GetText() { - static STR_String sTrueString = STR_String("TRUE"); - static STR_String sFalseString = STR_String("FALSE"); - return m_bool ? sTrueString : sFalseString; } diff --git a/source/gameengine/Expressions/BoolValue.h b/source/gameengine/Expressions/BoolValue.h index 9352b9d4b92..726619e7193 100644 --- a/source/gameengine/Expressions/BoolValue.h +++ b/source/gameengine/Expressions/BoolValue.h @@ -28,9 +28,12 @@ class CBoolValue : public CPropValue //PLUGIN_DECLARE_SERIAL(CBoolValue,CValue) public: + static const STR_String sTrueString; + static const STR_String sFalseString; + CBoolValue(); CBoolValue(bool inBool); - CBoolValue(bool innie, STR_String name, AllocationTYPE alloctype = CValue::HEAPVALUE); + CBoolValue(bool innie, const char *name, AllocationTYPE alloctype = CValue::HEAPVALUE); virtual const STR_String& GetText(); virtual double GetNumber(); diff --git a/source/gameengine/Expressions/CMakeLists.txt b/source/gameengine/Expressions/CMakeLists.txt index 6b2a835d648..eb87fdcee81 100644 --- a/source/gameengine/Expressions/CMakeLists.txt +++ b/source/gameengine/Expressions/CMakeLists.txt @@ -31,6 +31,7 @@ SET(INC ../../../source/kernel/gen_system ../../../intern/string ../../../intern/moto/include + ../../../source/gameengine/Scenegraph ${PYTHON_INC} ) diff --git a/source/gameengine/Expressions/ErrorValue.cpp b/source/gameengine/Expressions/ErrorValue.cpp index 651a772db19..a44abf8b22e 100644 --- a/source/gameengine/Expressions/ErrorValue.cpp +++ b/source/gameengine/Expressions/ErrorValue.cpp @@ -34,13 +34,15 @@ effect: constructs a new CErrorValue containing errormessage "Error" -CErrorValue::CErrorValue(STR_String errmsg) +CErrorValue::CErrorValue(const char *errmsg) /* pre: effect: constructs a new CErrorValue containing errormessage errmsg */ { - m_strErrorText = "[" + errmsg + "]"; + m_strErrorText = "["; + m_strErrorText += errmsg; + m_strErrorText += "]"; SetError(true); } diff --git a/source/gameengine/Expressions/ErrorValue.h b/source/gameengine/Expressions/ErrorValue.h index 5b5795196ba..b4b758feea7 100644 --- a/source/gameengine/Expressions/ErrorValue.h +++ b/source/gameengine/Expressions/ErrorValue.h @@ -25,7 +25,7 @@ public: virtual const STR_String & GetText(); virtual double GetNumber(); CErrorValue(); - CErrorValue(STR_String errmsg); + CErrorValue(const char *errmsg); virtual ~CErrorValue(); virtual CValue* Calc(VALUE_OPERATOR op, CValue* val); virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); diff --git a/source/gameengine/Expressions/FloatValue.cpp b/source/gameengine/Expressions/FloatValue.cpp index a31d3b9a528..4de685a82c1 100644 --- a/source/gameengine/Expressions/FloatValue.cpp +++ b/source/gameengine/Expressions/FloatValue.cpp @@ -50,7 +50,7 @@ effect: constructs a new CFloatValue containing value fl -CFloatValue::CFloatValue(float fl,STR_String name,AllocationTYPE alloctype) +CFloatValue::CFloatValue(float fl,const char *name,AllocationTYPE alloctype) /* pre: effect: constructs a new CFloatValue containing value fl diff --git a/source/gameengine/Expressions/FloatValue.h b/source/gameengine/Expressions/FloatValue.h index 41f70b5c54c..fb75b7c702b 100644 --- a/source/gameengine/Expressions/FloatValue.h +++ b/source/gameengine/Expressions/FloatValue.h @@ -23,7 +23,7 @@ class CFloatValue : public CPropValue public: CFloatValue(); CFloatValue(float fl); - CFloatValue(float fl,STR_String name,AllocationTYPE alloctype=CValue::HEAPVALUE); + CFloatValue(float fl,const char *name,AllocationTYPE alloctype=CValue::HEAPVALUE); virtual const STR_String & GetText(); diff --git a/source/gameengine/Expressions/IfExpr.cpp b/source/gameengine/Expressions/IfExpr.cpp index 5d3eb3641ca..fcb37bff52d 100644 --- a/source/gameengine/Expressions/IfExpr.cpp +++ b/source/gameengine/Expressions/IfExpr.cpp @@ -15,6 +15,7 @@ #include "IfExpr.h" #include "EmptyValue.h" #include "ErrorValue.h" +#include "BoolValue.h" #ifdef HAVE_CONFIG_H #include @@ -72,14 +73,14 @@ ret: a new object containing the value of m_e1 if m_guard is a boolean TRUE { CValue *guardval; guardval = m_guard->Calculate(); - STR_String text = guardval->GetText(); + const STR_String& text = guardval->GetText(); guardval->Release(); - if (text == STR_String("TRUE")) + if (&text == &CBoolValue::sTrueString) { return m_e1->Calculate(); } - else if (text == STR_String("FALSE")) + else if (&text == &CBoolValue::sFalseString) { return m_e2->Calculate(); } diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp index 91a14f97851..b15b206a38a 100644 --- a/source/gameengine/Expressions/InputParser.cpp +++ b/source/gameengine/Expressions/InputParser.cpp @@ -66,7 +66,7 @@ CParser::~CParser() -void CParser::ScanError(STR_String str) +void CParser::ScanError(const char *str) { // sets the global variable errmsg to an errormessage with // contents str, appending if it already exists @@ -81,7 +81,7 @@ void CParser::ScanError(STR_String str) -CExpression* CParser::Error(STR_String str) +CExpression* CParser::Error(const char *str) { // makes and returns a new CConstExpr filled with an CErrorValue // with string str @@ -537,7 +537,7 @@ CExpression *CParser::Expr() { } CExpression* CParser::ProcessText -(STR_String intext) { +(const char *intext) { // and parses the string in intext and returns it. @@ -574,7 +574,7 @@ CExpression* CParser::ProcessText -float CParser::GetFloat(STR_String txt) +float CParser::GetFloat(STR_String& txt) { // returns parsed text into a float // empty string returns -1 @@ -599,7 +599,7 @@ float CParser::GetFloat(STR_String txt) return result; } -CValue* CParser::GetValue(STR_String txt, bool bFallbackToText) +CValue* CParser::GetValue(STR_String& txt, bool bFallbackToText) { // returns parsed text into a value, // empty string returns NULL value ! diff --git a/source/gameengine/Expressions/InputParser.h b/source/gameengine/Expressions/InputParser.h index 3d517222639..810bdc244a8 100644 --- a/source/gameengine/Expressions/InputParser.h +++ b/source/gameengine/Expressions/InputParser.h @@ -27,9 +27,9 @@ public: CParser(); virtual ~CParser(); - float GetFloat(STR_String txt); - CValue* GetValue(STR_String txt, bool bFallbackToText=false); - CExpression* ProcessText(STR_String intext); + float GetFloat(STR_String& txt); + CValue* GetValue(STR_String& txt, bool bFallbackToText=false); + CExpression* ProcessText(const char *intext); void SetContext(CValue* context); private: @@ -86,8 +86,8 @@ private: CValue* m_identifierContext;// context in which identifiers are looked up - void ScanError(STR_String str); - CExpression* Error(STR_String str); + void ScanError(const char *str); + CExpression* Error(const char *str); void NextCh(); void TermChar(char c); void DigRep(); diff --git a/source/gameengine/Expressions/IntValue.cpp b/source/gameengine/Expressions/IntValue.cpp index 74ec9865fec..227518e9439 100644 --- a/source/gameengine/Expressions/IntValue.cpp +++ b/source/gameengine/Expressions/IntValue.cpp @@ -54,7 +54,7 @@ effect: constructs a new CIntValue containing cInt innie -CIntValue::CIntValue(cInt innie,STR_String name,AllocationTYPE alloctype) +CIntValue::CIntValue(cInt innie,const char *name,AllocationTYPE alloctype) { m_int = innie; SetName(name); diff --git a/source/gameengine/Expressions/IntValue.h b/source/gameengine/Expressions/IntValue.h index 0f3a38b274b..06bf1755749 100644 --- a/source/gameengine/Expressions/IntValue.h +++ b/source/gameengine/Expressions/IntValue.h @@ -32,7 +32,7 @@ public: CIntValue(); CIntValue(cInt innie); CIntValue(cInt innie, - STR_String name, + const char *name, AllocationTYPE alloctype=CValue::HEAPVALUE); virtual CValue* Calc(VALUE_OPERATOR op, diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index f4a801a965b..75ae2cb787f 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -18,6 +18,7 @@ #include "StringValue.h" #include "VoidValue.h" #include +#include "BoolValue.h" #ifdef HAVE_CONFIG_H #include @@ -75,7 +76,7 @@ PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex) if (PyString_Check(pyindex)) { - STR_String index(PyString_AsString(pyindex)); + const char *index = PyString_AsString(pyindex); CValue *item = ((CListValue*) list)->FindValue(index); if (item) { @@ -394,7 +395,7 @@ void CListValue::ReleaseAndRemoveAll() -CValue* CListValue::FindValue(const STR_String & name) +CValue* CListValue::FindValue(const char * name) { CValue* resultval = NULL; int i=0; @@ -497,13 +498,12 @@ bool CListValue::CheckEqual(CValue* first,CValue* second) if (eqval==NULL) return false; - - STR_String txt = eqval->GetText(); - eqval->Release(); - if (txt=="TRUE") + const STR_String& text = eqval->GetText(); + if (&text==&CBoolValue::sTrueString) { result = true; } + eqval->Release(); return result; } diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h index 3d88b5aea9c..ad918cbb925 100644 --- a/source/gameengine/Expressions/ListValue.h +++ b/source/gameengine/Expressions/ListValue.h @@ -45,7 +45,7 @@ public: void SetReleaseOnDestruct(bool bReleaseContents); bool SearchValue(CValue* val); - CValue* FindValue(const STR_String & name); + CValue* FindValue(const char *name); void ReleaseAndRemoveAll(); virtual void SetModified(bool bModified); diff --git a/source/gameengine/Expressions/Makefile b/source/gameengine/Expressions/Makefile index 6736149bbcd..a1400c4e461 100644 --- a/source/gameengine/Expressions/Makefile +++ b/source/gameengine/Expressions/Makefile @@ -41,4 +41,5 @@ CPPFLAGS += -I../../blender/makesdna CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include CPPFLAGS += -I../../kernel/gen_system +CPPFLAGS += -I../../gameengine/Scenegraph diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 7026db5b8a4..83c0b25df24 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -104,7 +104,7 @@ void PyObjectPlus::py_base_dealloc(PyObject *self) // python wrapper PyObject_DEL( self ); }; -PyObjectPlus::PyObjectPlus(PyTypeObject *T) // constructor +PyObjectPlus::PyObjectPlus(PyTypeObject *T) : SG_QList() // constructor { MT_assert(T != NULL); m_proxy= NULL; diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index b7f22404c7a..b69697f3290 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -38,6 +38,7 @@ #include "KX_Python.h" #include "STR_String.h" +#include "SG_QList.h" /*------------------------------ * Python defines @@ -462,7 +463,18 @@ typedef struct KX_PYATTRIBUTE_DEF { ------------------------------*/ typedef PyTypeObject * PyParentObject; // Define the PyParent Object -class PyObjectPlus +// By making SG_QList the ultimate parent for PyObjectPlus objects, it +// allows to put them in 2 different dynamic lists at the same time +// The use of these links is interesting because they free of memory allocation +// but it's very important not to mess up with them. If you decide that +// the SG_QList or SG_DList component is used for something for a certain class, +// they cannot can be used for anything else at a parent level! +// What these lists are and what they are used for must be carefully documented +// at the level where they are used. +// DON'T MAKE ANY USE OF THESE LIST AT THIS LEVEL, they are already used +// at SCA_IActuator, SCA_ISensor, SCA_IController level which rules out the +// possibility to use them at SCA_ILogicBrick, CValue and PyObjectPlus level. +class PyObjectPlus : public SG_QList { // The PyObjectPlus abstract class Py_Header; // Always start with Py_Header diff --git a/source/gameengine/Expressions/SConscript b/source/gameengine/Expressions/SConscript index 3d855d40623..9d6823e3879 100644 --- a/source/gameengine/Expressions/SConscript +++ b/source/gameengine/Expressions/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('*.cpp') -incs ='. #source/kernel/gen_system #intern/string #intern/moto/include' +incs ='. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/Scenegraph' incs += ' ' + env['BF_PYTHON_INC'] cxxflags = [] diff --git a/source/gameengine/Expressions/StringValue.cpp b/source/gameengine/Expressions/StringValue.cpp index 857aa97b420..a7033fcf11c 100644 --- a/source/gameengine/Expressions/StringValue.cpp +++ b/source/gameengine/Expressions/StringValue.cpp @@ -34,7 +34,7 @@ effect: constructs a new CStringValue m_strString = "[Illegal String constructor call]"; } -CStringValue::CStringValue(STR_String txt,STR_String name,AllocationTYPE alloctype) +CStringValue::CStringValue(const char *txt,const char *name,AllocationTYPE alloctype) /* pre: effect: constructs a new CStringValue containing text txt diff --git a/source/gameengine/Expressions/StringValue.h b/source/gameengine/Expressions/StringValue.h index 16575ed7ffa..52f8a580f4d 100644 --- a/source/gameengine/Expressions/StringValue.h +++ b/source/gameengine/Expressions/StringValue.h @@ -26,7 +26,7 @@ class CStringValue : public CPropValue public: /// Construction / destruction CStringValue(); - CStringValue (STR_String txt, STR_String name , AllocationTYPE alloctype = CValue::HEAPVALUE); + CStringValue (const char *txt, const char *name , AllocationTYPE alloctype = CValue::HEAPVALUE); virtual ~CStringValue() { }; diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index a811b39d790..83deeef91a3 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -291,13 +291,17 @@ CValue* CValue::GetProperty(const char *inName) // // Get text description of property with name , returns an empty string if there is no property named // -STR_String CValue::GetPropertyText(const STR_String & inName,const STR_String& deftext) +const STR_String& CValue::GetPropertyText(const STR_String & inName,const char *deftext) { + const static STR_String sEmpty(""); + CValue *property = GetProperty(inName); if (property) return property->GetText(); + else if (deftext) + return STR_String(deftext); else - return deftext;//String::sEmpty; + return sEmpty; } float CValue::GetPropertyNumber(const STR_String& inName,float defnumber) @@ -647,7 +651,7 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) int CValue::py_delattro(PyObject *attr) { char *attr_str= PyString_AsString(attr); - if (RemoveProperty(STR_String(attr_str))) + if (RemoveProperty(attr_str)) return 0; PyErr_Format(PyExc_AttributeError, "attribute \"%s\" dosnt exist", attr_str); diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index c5c8229ebcf..e5c95df1c5c 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -308,7 +308,7 @@ public: virtual void SetProperty(const char* name,CValue* ioProperty); virtual CValue* GetProperty(const char* inName); // Get pointer to a property with name , returns NULL if there is no property named virtual CValue* GetProperty(const STR_String & inName); - STR_String GetPropertyText(const STR_String & inName,const STR_String& deftext=""); // Get text description of property with name , returns an empty string if there is no property named + const STR_String& GetPropertyText(const STR_String & inName,const char *deftext=NULL); // Get text description of property with name , returns an empty string if there is no property named float GetPropertyNumber(const STR_String& inName,float defnumber); virtual bool RemoveProperty(const char *inName); // Remove the property named , returns true if the property was succesfully removed, false if property was not found or could not be removed virtual vector GetPropertyNames(); @@ -331,8 +331,8 @@ public: double* ZeroVector() { return m_sZeroVec; }; virtual double* GetVector3(bool bGetTransformedVec = false); - virtual STR_String GetName() = 0; // Retrieve the name of the value - virtual void SetName(STR_String name) = 0; // Set the name of the value + virtual STR_String& GetName() = 0; // Retrieve the name of the value + virtual void SetName(const char *name) = 0; // Set the name of the value /** Sets the value to this cvalue. * @attention this particular function should never be called. Why not abstract? */ virtual void SetValue(CValue* newval); @@ -420,49 +420,28 @@ public: #else CPropValue() : #endif //NO_EXP_PYTHON_EMBEDDING - m_pstrNewName(NULL) + m_strNewName() { } virtual ~CPropValue() { - if (m_pstrNewName) - { - delete m_pstrNewName; - m_pstrNewName = NULL; - } } - virtual void SetName(STR_String name) { - if (m_pstrNewName) - { - delete m_pstrNewName; - m_pstrNewName = NULL; - } - if (name.Length()) - m_pstrNewName = new STR_String(name); - } - virtual void ProcessReplica() { - CValue::ProcessReplica(); - if (m_pstrNewName) - m_pstrNewName = new STR_String(*m_pstrNewName); + virtual void SetName(const char *name) { + m_strNewName = name; } - virtual STR_String GetName() { + virtual STR_String& GetName() { //STR_String namefromprop = GetPropertyText("Name"); //if (namefromprop.Length() > 0) // return namefromprop; - - if (m_pstrNewName) - { - return *m_pstrNewName; - } - return STR_String(""); + return m_strNewName; }; // name of Value protected: - STR_String* m_pstrNewName; // Identification + STR_String m_strNewName; // Identification }; #endif // !defined _VALUEBASECLASS_H diff --git a/source/gameengine/Expressions/VectorValue.cpp b/source/gameengine/Expressions/VectorValue.cpp index e8e1d45c356..c58c78e6ebe 100644 --- a/source/gameengine/Expressions/VectorValue.cpp +++ b/source/gameengine/Expressions/VectorValue.cpp @@ -48,7 +48,7 @@ CVectorValue::CVectorValue(float x,float y,float z, AllocationTYPE alloctype) m_vec[KX_Z] = m_transformedvec[KX_Z] = z; } -CVectorValue::CVectorValue(double vec[],STR_String name,AllocationTYPE alloctype) { +CVectorValue::CVectorValue(double vec[],const char *name,AllocationTYPE alloctype) { SetCustomFlag1(false);//FancyOutput=false; diff --git a/source/gameengine/Expressions/VectorValue.h b/source/gameengine/Expressions/VectorValue.h index 99bf0abb11b..19c7dd30076 100644 --- a/source/gameengine/Expressions/VectorValue.h +++ b/source/gameengine/Expressions/VectorValue.h @@ -41,7 +41,7 @@ public: CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); - CVectorValue(double vec[],STR_String name,AllocationTYPE alloctype=CValue::HEAPVALUE); + CVectorValue(double vec[],const char *name,AllocationTYPE alloctype=CValue::HEAPVALUE); CVectorValue() {}; CVectorValue(double vec[],AllocationTYPE alloctype=CValue::HEAPVALUE); diff --git a/source/gameengine/GameLogic/CMakeLists.txt b/source/gameengine/GameLogic/CMakeLists.txt index a7519196d50..449aae3ac84 100644 --- a/source/gameengine/GameLogic/CMakeLists.txt +++ b/source/gameengine/GameLogic/CMakeLists.txt @@ -31,6 +31,7 @@ SET(INC ../../../source/kernel/gen_system ../../../intern/string ../../../source/gameengine/Expressions + ../../../source/gameengine/Scenegraph ../../../intern/moto/include ../../../source/gameengine/Rasterizer ${PYTHON_INC} diff --git a/source/gameengine/GameLogic/Makefile b/source/gameengine/GameLogic/Makefile index 355ece6e8bd..6e9af674549 100644 --- a/source/gameengine/GameLogic/Makefile +++ b/source/gameengine/GameLogic/Makefile @@ -39,6 +39,7 @@ include nan_compile.mk CCFLAGS += $(LEVEL_1_CPP_WARNINGS) CPPFLAGS += -I../Expressions +CPPFLAGS += -I../Scenegraph CPPFLAGS += -I../Rasterizer CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index fb72eefb4a4..1aaa59ee207 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -95,7 +95,7 @@ bool SCA_2DFilterActuator::Update() } -void SCA_2DFilterActuator::SetShaderText(STR_String text) +void SCA_2DFilterActuator::SetShaderText(STR_String& text) { m_shaderText = text; } diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.h b/source/gameengine/GameLogic/SCA_2DFilterActuator.h index b43dc092ddb..aea3a35d404 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.h +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.h @@ -60,7 +60,7 @@ public: PyTypeObject* T=&Type ); - void SetShaderText(STR_String text); + void SetShaderText(STR_String& text); virtual ~SCA_2DFilterActuator(); virtual bool Update(); diff --git a/source/gameengine/GameLogic/SCA_ANDController.cpp b/source/gameengine/GameLogic/SCA_ANDController.cpp index 7991e82168f..87f7c612e7c 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.cpp +++ b/source/gameengine/GameLogic/SCA_ANDController.cpp @@ -73,19 +73,12 @@ void SCA_ANDController::Trigger(SCA_LogicManager* logicmgr) } } - CValue* newevent = new CBoolValue(sensorresult); - for (vector::const_iterator i=m_linkedactuators.begin(); !(i==m_linkedactuators.end());i++) { - SCA_IActuator* actua = *i;//m_linkedactuators.at(i); - logicmgr->AddActiveActuator(actua,newevent); + SCA_IActuator* actua = *i; + logicmgr->AddActiveActuator(actua,sensorresult); } - - // every actuator that needs the event, has a it's own reference to it now so - // release it (so to be clear: if there is no actuator, it's deleted right now) - newevent->Release(); - } diff --git a/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp b/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp index 768a3a45937..a80b2af55c8 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp @@ -51,17 +51,19 @@ SCA_ActuatorEventManager::~SCA_ActuatorEventManager() void SCA_ActuatorEventManager::NextFrame() { // check for changed actuator - for (set::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++) + SG_DList::iterator it(m_sensors); + for (it.begin();!it.end();++it) { - (*it)->Activate(m_logicmgr,NULL); + (*it)->Activate(m_logicmgr); } } void SCA_ActuatorEventManager::UpdateFrame() { // update the state of actuator before executing them - for (set::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++) + SG_DList::iterator it(m_sensors); + for (it.begin();!it.end();++it) { - ((SCA_ActuatorSensor*)(*it))->Update(); + (*it)->Update(); } } \ No newline at end of file diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index 464797fd776..4dad65c5a25 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -89,7 +89,7 @@ SCA_ActuatorSensor::~SCA_ActuatorSensor() -bool SCA_ActuatorSensor::Evaluate(CValue* event) +bool SCA_ActuatorSensor::Evaluate() { if (m_actuator) { diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.h b/source/gameengine/GameLogic/SCA_ActuatorSensor.h index 974b2e43d78..6655e08dc70 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.h +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.h @@ -52,7 +52,7 @@ public: virtual ~SCA_ActuatorSensor(); virtual CValue* GetReplica(); virtual void Init(); - virtual bool Evaluate(CValue* event); + virtual bool Evaluate(); virtual bool IsPositiveTrigger(); virtual void ReParent(SCA_IObject* parent); void Update(); diff --git a/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp b/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp index 4cd2dfba994..dd3b55abcc9 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp +++ b/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp @@ -51,9 +51,10 @@ SCA_AlwaysEventManager::SCA_AlwaysEventManager(class SCA_LogicManager* logicmgr) void SCA_AlwaysEventManager::NextFrame() { - for (set::const_iterator i= m_sensors.begin();!(i==m_sensors.end());i++) + SG_DList::iterator it(m_sensors); + for (it.begin();!it.end();++it) { - (*i)->Activate(m_logicmgr, NULL); + (*it)->Activate(m_logicmgr); } } diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp index 19d19b6e0be..ff02680f191 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp @@ -86,7 +86,7 @@ bool SCA_AlwaysSensor::IsPositiveTrigger() -bool SCA_AlwaysSensor::Evaluate(CValue* event) +bool SCA_AlwaysSensor::Evaluate() { /* Nice! :) */ //return true; diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.h b/source/gameengine/GameLogic/SCA_AlwaysSensor.h index 769e1e883bc..0f85a641ef1 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.h +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.h @@ -43,7 +43,7 @@ public: PyTypeObject* T =&Type); virtual ~SCA_AlwaysSensor(); virtual CValue* GetReplica(); - virtual bool Evaluate(CValue* event); + virtual bool Evaluate(); virtual bool IsPositiveTrigger(); virtual void Init(); diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp index 4752d0eb345..dcdae0b4e75 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.cpp +++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp @@ -89,7 +89,7 @@ bool SCA_DelaySensor::IsPositiveTrigger() return (m_invert ? !m_lastResult : m_lastResult); } -bool SCA_DelaySensor::Evaluate(CValue* event) +bool SCA_DelaySensor::Evaluate() { bool trigger = false; bool result; diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.h b/source/gameengine/GameLogic/SCA_DelaySensor.h index 31394fdc961..5ccb33f8a16 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.h +++ b/source/gameengine/GameLogic/SCA_DelaySensor.h @@ -51,7 +51,7 @@ public: PyTypeObject* T =&Type); virtual ~SCA_DelaySensor(); virtual CValue* GetReplica(); - virtual bool Evaluate(CValue* event); + virtual bool Evaluate(); virtual bool IsPositiveTrigger(); virtual void Init(); diff --git a/source/gameengine/GameLogic/SCA_EventManager.cpp b/source/gameengine/GameLogic/SCA_EventManager.cpp index e4fd0379597..d1301541a0a 100644 --- a/source/gameengine/GameLogic/SCA_EventManager.cpp +++ b/source/gameengine/GameLogic/SCA_EventManager.cpp @@ -28,6 +28,7 @@ #include #include "SCA_EventManager.h" +#include "SCA_ISensor.h" #ifdef HAVE_CONFIG_H #include @@ -43,16 +44,18 @@ SCA_EventManager::SCA_EventManager(EVENT_MANAGER_TYPE mgrtype) SCA_EventManager::~SCA_EventManager() { + // all sensors should be removed + assert(m_sensors.Empty()); } void SCA_EventManager::RegisterSensor(class SCA_ISensor* sensor) { - m_sensors.insert(sensor); + m_sensors.AddBack(sensor); } void SCA_EventManager::RemoveSensor(class SCA_ISensor* sensor) { - m_sensors.erase(sensor); + sensor->Delink(); } void SCA_EventManager::NextFrame(double curtime, double fixedtime) diff --git a/source/gameengine/GameLogic/SCA_EventManager.h b/source/gameengine/GameLogic/SCA_EventManager.h index 9dbb5a6d24f..5ff55849bfe 100644 --- a/source/gameengine/GameLogic/SCA_EventManager.h +++ b/source/gameengine/GameLogic/SCA_EventManager.h @@ -33,11 +33,14 @@ #include #include +#include "SG_DList.h" + class SCA_EventManager { protected: // use a set to speed-up insertion/removal - std::set m_sensors; + //std::set m_sensors; + SG_DList m_sensors; public: enum EVENT_MANAGER_TYPE { diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.cpp b/source/gameengine/GameLogic/SCA_ExpressionController.cpp index a4e898a808f..8e044b89c71 100644 --- a/source/gameengine/GameLogic/SCA_ExpressionController.cpp +++ b/source/gameengine/GameLogic/SCA_ExpressionController.cpp @@ -115,37 +115,14 @@ void SCA_ExpressionController::Trigger(SCA_LogicManager* logicmgr) value->Release(); } - //m_exprCache->Release(); - //m_exprCache = NULL; } - /* - - for (vector::const_iterator is=m_linkedsensors.begin(); - !(is==m_linkedsensors.end());is++) - { - SCA_ISensor* sensor = *is; - if (!sensor->IsPositiveTrigger()) - { - sensorresult = false; - break; - } - } - - */ - - CValue* newevent = new CBoolValue(expressionresult); - for (vector::const_iterator i=m_linkedactuators.begin(); !(i==m_linkedactuators.end());i++) { SCA_IActuator* actua = *i; - logicmgr->AddActiveActuator(actua,newevent); + logicmgr->AddActiveActuator(actua,expressionresult); } - //printf("expr %d.",expressionresult); - // every actuator that needs the event, has a it's own reference to it now so - // release it (so to be clear: if there is no actuator, it's deleted right now) - newevent->Release(); } diff --git a/source/gameengine/GameLogic/SCA_IActuator.cpp b/source/gameengine/GameLogic/SCA_IActuator.cpp index 214c7dded76..5f71bb3f9e4 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.cpp +++ b/source/gameengine/GameLogic/SCA_IActuator.cpp @@ -37,46 +37,13 @@ using namespace std; SCA_IActuator::SCA_IActuator(SCA_IObject* gameobj, PyTypeObject* T) : SCA_ILogicBrick(gameobj,T), - m_links(0) + m_links(0), + m_posevent(false), + m_negevent(false) { // nothing to do } - - -void SCA_IActuator::RemoveAllEvents() -{ // remove event queue! - for (vector::iterator i=m_events.begin(); !(i==m_events.end());i++) - { - (*i)->Release(); - } - m_events.clear(); -} - - - - - -bool SCA_IActuator::IsNegativeEvent() const -{ - bool bPositiveEvent(false); - bool bNegativeEvent(false); - - for (vector::const_iterator i=m_events.begin(); i!=m_events.end();++i) - { - if ((*i)->GetNumber() == 0.0f) - { - bNegativeEvent = true; - } else { - bPositiveEvent = true; - } - } - - // if at least 1 positive event, return false - - return !bPositiveEvent && bNegativeEvent; -} - bool SCA_IActuator::Update(double curtime, bool frame) { if (frame) @@ -94,7 +61,8 @@ bool SCA_IActuator::Update() void SCA_IActuator::ProcessReplica() { SCA_ILogicBrick::ProcessReplica(); - m_events.clear(); + RemoveAllEvents(); + m_linkedcontrollers.clear(); } @@ -113,3 +81,36 @@ void SCA_IActuator::DecLink() m_links = 0; } } + +void SCA_IActuator::LinkToController(SCA_IController* controller) +{ + m_linkedcontrollers.push_back(controller); +} + +void SCA_IActuator::UnlinkController(SCA_IController* controller) +{ + std::vector::iterator contit; + for (contit = m_linkedcontrollers.begin();!(contit==m_linkedcontrollers.end());++contit) + { + if ((*contit) == controller) + { + *contit = m_linkedcontrollers.back(); + m_linkedcontrollers.pop_back(); + return; + } + } + printf("Missing link from actuator %s:%s to controller %s:%s\n", + m_gameobj->GetName().ReadPtr(), GetName().ReadPtr(), + controller->GetParent()->GetName().ReadPtr(), controller->GetName().ReadPtr()); +} + +void SCA_IActuator::UnlinkAllControllers() +{ + std::vector::iterator contit; + for (contit = m_linkedcontrollers.begin();!(contit==m_linkedcontrollers.end());++contit) + { + (*contit)->UnlinkActuator(this); + } + m_linkedcontrollers.clear(); +} + diff --git a/source/gameengine/GameLogic/SCA_IActuator.h b/source/gameengine/GameLogic/SCA_IActuator.h index e5f0a2cf4cc..3055e1d946f 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.h +++ b/source/gameengine/GameLogic/SCA_IActuator.h @@ -29,17 +29,33 @@ #ifndef __KX_IACTUATOR #define __KX_IACTUATOR -#include "SCA_ILogicBrick.h" +#include "SCA_IController.h" #include +/* + * Use of SG_DList : element of actuator being deactivated + * Head: SCA_LogicManager::m_removedActuators + * Use of SG_QList : element of activated actuator list of their owner + * Head: SCA_IObject::m_activeActuators + */ class SCA_IActuator : public SCA_ILogicBrick { friend class SCA_LogicManager; protected: int m_links; // number of active links to controllers // when 0, the actuator is automatically stopped - std::vector m_events; - void RemoveAllEvents(); + //std::vector m_events; + bool m_posevent; + bool m_negevent; + + std::vector m_linkedcontrollers; + + void RemoveAllEvents() + { + m_posevent = false; + m_negevent = false; + } + public: /** @@ -75,9 +91,13 @@ public: /** * Add an event to an actuator. */ - void AddEvent(CValue* event) + //void AddEvent(CValue* event) + void AddEvent(bool event) { - m_events.push_back(event); + if (event) + m_posevent = true; + else + m_negevent = true; } virtual void ProcessReplica(); @@ -88,9 +108,38 @@ public: * not immediately clear. But usually refers to key-up events * or events where no action is required. */ - bool IsNegativeEvent() const; + bool IsNegativeEvent() const + { + return !m_posevent && m_negevent; + } + virtual ~SCA_IActuator(); + /** + * remove this actuator from the list of active actuators + */ + void Deactivate() + { + if (QDelink()) + // the actuator was in the active list + if (m_gameobj->m_activeActuators.QEmpty()) + // the owner object has no more active actuators, remove it from the global list + m_gameobj->m_activeActuators.Delink(); + } + + void Activate(SG_DList& head) + { + if (QEmpty()) + { + InsertActiveQList(m_gameobj->m_activeActuators); + head.AddBack(&m_gameobj->m_activeActuators); + } + } + + void LinkToController(SCA_IController* controller); + void UnlinkController(class SCA_IController* cont); + void UnlinkAllControllers(); + void ClrLink() { m_links=0; } void IncLink() { m_links++; } void DecLink(); diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp index 24509f6e6ed..f8b081ef050 100644 --- a/source/gameengine/GameLogic/SCA_IController.cpp +++ b/source/gameengine/GameLogic/SCA_IController.cpp @@ -41,7 +41,8 @@ SCA_IController::SCA_IController(SCA_IObject* gameobj, PyTypeObject* T) : SCA_ILogicBrick(gameobj,T), - m_statemask(0) + m_statemask(0), + m_justActivated(false) { } @@ -49,19 +50,19 @@ SCA_IController::SCA_IController(SCA_IObject* gameobj, SCA_IController::~SCA_IController() { - UnlinkAllActuators(); + //UnlinkAllActuators(); } -const std::vector& SCA_IController::GetLinkedSensors() +std::vector& SCA_IController::GetLinkedSensors() { return m_linkedsensors; } -const std::vector& SCA_IController::GetLinkedActuators() +std::vector& SCA_IController::GetLinkedActuators() { return m_linkedactuators; } @@ -70,13 +71,14 @@ const std::vector& SCA_IController::GetLinkedActuators() void SCA_IController::UnlinkAllSensors() { - if (IsActive()) + std::vector::iterator sensit; + for (sensit = m_linkedsensors.begin();!(sensit==m_linkedsensors.end());++sensit) { - std::vector::iterator sensit; - for (sensit = m_linkedsensors.begin();!(sensit==m_linkedsensors.end());++sensit) + if (IsActive()) { (*sensit)->DecLink(); } + (*sensit)->UnlinkController(this); } m_linkedsensors.clear(); } @@ -85,34 +87,18 @@ void SCA_IController::UnlinkAllSensors() void SCA_IController::UnlinkAllActuators() { - if (IsActive()) + std::vector::iterator actit; + for (actit = m_linkedactuators.begin();!(actit==m_linkedactuators.end());++actit) { - std::vector::iterator actit; - for (actit = m_linkedactuators.begin();!(actit==m_linkedactuators.end());++actit) + if (IsActive()) { (*actit)->DecLink(); } + (*actit)->UnlinkController(this); } m_linkedactuators.clear(); } - - -/* -void SCA_IController::Trigger(SCA_LogicManager* logicmgr) -{ - //for (int i=0;i::const_iterator i=m_linkedactuators.begin(); - !(i==m_linkedactuators.end());i++) - { - SCA_IActuator* actua = *i;//m_linkedactuators.at(i); - - logicmgr->AddActiveActuator(actua); - } - -} -*/ - void SCA_IController::LinkToActuator(SCA_IActuator* actua) { m_linkedactuators.push_back(actua); @@ -129,18 +115,18 @@ void SCA_IController::UnlinkActuator(class SCA_IActuator* actua) { if ((*actit) == actua) { - break; - } - - } - if (!(actit==m_linkedactuators.end())) - { - if (IsActive()) - { - (*actit)->DecLink(); + if (IsActive()) + { + (*actit)->DecLink(); + } + *actit = m_linkedactuators.back(); + m_linkedactuators.pop_back(); + return; } - m_linkedactuators.erase(actit); } + printf("Missing link from controller %s:%s to actuator %s:%s\n", + m_gameobj->GetName().ReadPtr(), GetName().ReadPtr(), + actua->GetParent()->GetName().ReadPtr(), actua->GetName().ReadPtr()); } void SCA_IController::LinkToSensor(SCA_ISensor* sensor) @@ -159,20 +145,21 @@ void SCA_IController::UnlinkSensor(class SCA_ISensor* sensor) { if ((*sensit) == sensor) { - break; - } - - } - if (!(sensit==m_linkedsensors.end())) - { - if (IsActive()) - { - (*sensit)->DecLink(); + if (IsActive()) + { + sensor->DecLink(); + } + *sensit = m_linkedsensors.back(); + m_linkedsensors.pop_back(); + return; } - m_linkedsensors.erase(sensit); } + printf("Missing link from controller %s:%s to sensor %s:%s\n", + m_gameobj->GetName().ReadPtr(), GetName().ReadPtr(), + sensor->GetParent()->GetName().ReadPtr(), sensor->GetName().ReadPtr()); } + void SCA_IController::ApplyState(unsigned int state) { std::vector::iterator actit; @@ -187,13 +174,13 @@ void SCA_IController::ApplyState(unsigned int state) { (*actit)->IncLink(); } + for (sensit = m_linkedsensors.begin();!(sensit==m_linkedsensors.end());++sensit) { (*sensit)->IncLink(); - // remember that this controller just activated that sensor - (*sensit)->AddNewController(this); } SetActive(true); + m_justActivated = true; } } else if (IsActive()) { @@ -206,6 +193,7 @@ void SCA_IController::ApplyState(unsigned int state) (*sensit)->DecLink(); } SetActive(false); + m_justActivated = false; } } @@ -301,7 +289,7 @@ PyObject* SCA_IController::PyGetSensor(PyObject* value) for (unsigned int index=0;indexGetName(); + STR_String& realname = sensor->GetName(); if (realname == scriptArg) { return sensor->GetProxy(); diff --git a/source/gameengine/GameLogic/SCA_IController.h b/source/gameengine/GameLogic/SCA_IController.h index 7ed83bc90b8..1b9d8fb0d2b 100644 --- a/source/gameengine/GameLogic/SCA_IController.h +++ b/source/gameengine/GameLogic/SCA_IController.h @@ -32,6 +32,11 @@ #include "SCA_ILogicBrick.h" #include "PyObjectPlus.h" +/* + * Use of SG_DList element: none + * Use of SG_QList element: build ordered list of activated controller on the owner object + * Head: SCA_IObject::m_activeControllers + */ class SCA_IController : public SCA_ILogicBrick { Py_Header; @@ -39,21 +44,48 @@ protected: std::vector m_linkedsensors; std::vector m_linkedactuators; unsigned int m_statemask; + bool m_justActivated; public: SCA_IController(SCA_IObject* gameobj,PyTypeObject* T); virtual ~SCA_IController(); virtual void Trigger(class SCA_LogicManager* logicmgr)=0; void LinkToSensor(SCA_ISensor* sensor); void LinkToActuator(SCA_IActuator*); - const std::vector& GetLinkedSensors(); - const std::vector& GetLinkedActuators(); + std::vector& GetLinkedSensors(); + std::vector& GetLinkedActuators(); + void ReserveActuator(int num) + { + m_linkedactuators.reserve(num); + } void UnlinkAllSensors(); void UnlinkAllActuators(); void UnlinkActuator(class SCA_IActuator* actua); void UnlinkSensor(class SCA_ISensor* sensor); void SetState(unsigned int state) { m_statemask = state; } void ApplyState(unsigned int state); - + void Deactivate() + { + // the controller can only be part of a sensor m_newControllers list + Delink(); + } + bool IsJustActivated() + { + return m_justActivated; + } + void ClrJustActivated() + { + m_justActivated = false; + } + + void Activate(SG_DList& head) + { + if (QEmpty()) + { + InsertActiveQList(m_gameobj->m_activeControllers); + head.AddBack(&m_gameobj->m_activeControllers); + } + } + virtual PyObject* py_getattro(PyObject *attr); virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *value); diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 6de9986b03a..2dc80f54568 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -123,14 +123,14 @@ double SCA_ILogicBrick::GetNumber() -STR_String SCA_ILogicBrick::GetName() +STR_String& SCA_ILogicBrick::GetName() { return m_name; } -void SCA_ILogicBrick::SetName(STR_String name) +void SCA_ILogicBrick::SetName(const char *name) { m_name = name; } @@ -222,7 +222,7 @@ PyMethodDef SCA_ILogicBrick::Methods[] = { PyAttributeDef SCA_ILogicBrick::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("owner", SCA_ILogicBrick, pyattr_get_owner), - KX_PYATTRIBUTE_INT_RW("executePriority",0,100000,false,SCA_ILogicBrick,m_Execute_Ueber_Priority), + KX_PYATTRIBUTE_INT_RW("executePriority",0,100000,false,SCA_ILogicBrick,m_Execute_Priority), KX_PYATTRIBUTE_STRING_RO("name", SCA_ILogicBrick, m_name), {NULL} //Sentinel }; @@ -286,7 +286,7 @@ PyObject* SCA_ILogicBrick::PySetExecutePriority(PyObject* args) return NULL; } - m_Execute_Ueber_Priority = priority; + m_Execute_Priority = priority; Py_RETURN_NONE; } @@ -296,7 +296,7 @@ PyObject* SCA_ILogicBrick::PySetExecutePriority(PyObject* args) PyObject* SCA_ILogicBrick::PyGetExecutePriority() { ShowDeprecationWarning("getExecutePriority()", "the executePriority property"); - return PyInt_FromLong(m_Execute_Ueber_Priority); + return PyInt_FromLong(m_Execute_Priority); } diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index b1384e88826..90881c0536f 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -71,8 +71,8 @@ public: virtual const STR_String & GetText(); virtual double GetNumber(); - virtual STR_String GetName(); - virtual void SetName(STR_String name); + virtual STR_String& GetName(); + virtual void SetName(const char *); bool IsActive() { @@ -84,6 +84,13 @@ public: m_bActive=active; } + // insert in a QList at position corresponding to m_Execute_Priority + void InsertActiveQList(SG_QList& head) + { + SG_QList::iterator it(head); + for(it.begin(); !it.end() && m_Execute_Priority > (*it)->m_Execute_Priority; ++it); + it.add_back(this); + } virtual bool LessComparedTo(SCA_ILogicBrick* other); diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index 7eaa5c607be..8962c8e8580 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -70,7 +70,7 @@ SCA_IObject::~SCA_IObject() } for (ita = m_actuators.begin(); !(ita==m_actuators.end()); ++ita) { - ((CValue*)(*ita))->Release(); + (*ita)->Delete(); } //T_InterpolatorList::iterator i; @@ -110,7 +110,7 @@ void SCA_IObject::RegisterActuator(SCA_IActuator* act) void SCA_IObject::UnregisterActuator(SCA_IActuator* act) { SCA_ActuatorList::iterator ita; - for (ita = m_registeredActuators.begin(); ita != m_registeredActuators.end(); ita++) + for (ita = m_registeredActuators.begin(); ita != m_registeredActuators.end(); ++ita) { if ((*ita) == act) { (*ita) = m_registeredActuators.back(); @@ -171,7 +171,7 @@ SCA_ISensor* SCA_IObject::FindSensor(const STR_String& sensorname) { SCA_ISensor* foundsensor = NULL; - for (SCA_SensorList::iterator its = m_sensors.begin();!(its==m_sensors.end());its++) + for (SCA_SensorList::iterator its = m_sensors.begin();!(its==m_sensors.end());++its) { if ((*its)->GetName() == sensorname) { @@ -188,7 +188,7 @@ SCA_IController* SCA_IObject::FindController(const STR_String& controllername) { SCA_IController* foundcontroller = NULL; - for (SCA_ControllerList::iterator itc = m_controllers.begin();!(itc==m_controllers.end());itc++) + for (SCA_ControllerList::iterator itc = m_controllers.begin();!(itc==m_controllers.end());++itc) { if ((*itc)->GetName() == controllername) { @@ -205,7 +205,7 @@ SCA_IActuator* SCA_IObject::FindActuator(const STR_String& actuatorname) { SCA_IActuator* foundactuator = NULL; - for (SCA_ActuatorList::iterator ita = m_actuators.begin();!(ita==m_actuators.end());ita++) + for (SCA_ActuatorList::iterator ita = m_actuators.begin();!(ita==m_actuators.end());++ita) { if ((*ita)->GetName() == actuatorname) { @@ -272,7 +272,7 @@ void SCA_IObject::Suspend() SCA_SensorList::iterator i = m_sensors.begin(); while (i != m_sensors.end()) { (*i)->Suspend(); - i++; + ++i; } } } @@ -287,7 +287,7 @@ void SCA_IObject::Resume(void) SCA_SensorList::iterator i = m_sensors.begin(); while (i != m_sensors.end()) { (*i)->Resume(); - i++; + ++i; } } } @@ -307,7 +307,7 @@ void SCA_IObject::SetState(unsigned int state) if (tmpstate != m_state) { // update the status of the controllers - for (contit = m_controllers.begin(); contit != m_controllers.end(); contit++) + for (contit = m_controllers.begin(); contit != m_controllers.end(); ++contit) { (*contit)->ApplyState(tmpstate); } @@ -315,7 +315,7 @@ void SCA_IObject::SetState(unsigned int state) m_state = state; if (m_state != tmpstate) { - for (contit = m_controllers.begin(); contit != m_controllers.end(); contit++) + for (contit = m_controllers.begin(); contit != m_controllers.end(); ++contit) { (*contit)->ApplyState(m_state); } diff --git a/source/gameengine/GameLogic/SCA_IObject.h b/source/gameengine/GameLogic/SCA_IObject.h index 10cf551aeb6..281c72ecd46 100644 --- a/source/gameengine/GameLogic/SCA_IObject.h +++ b/source/gameengine/GameLogic/SCA_IObject.h @@ -52,10 +52,24 @@ class SCA_IObject : public CValue Py_Header; protected: + friend class SCA_IActuator; + friend class SCA_IController; SCA_SensorList m_sensors; SCA_ControllerList m_controllers; SCA_ActuatorList m_actuators; SCA_ActuatorList m_registeredActuators; // actuators that use a pointer to this object + + // SG_Dlist: element of objects with active actuators + // Head: SCA_LogicManager::m_activeActuators + // SG_QList: Head of active actuators list on this object + // Elements: SCA_IActuator + SG_QList m_activeActuators; + // SG_Dlist: element of objects with active controllers + // Head: SCA_LogicManager::m_activeControllers + // SG_QList: Head of active controller list on this object + // Elements: SCA_IController + SG_QList m_activeControllers; + static class MT_Point3 m_sDummy; /** @@ -95,10 +109,26 @@ public: { return m_actuators; } + SG_QList& GetActiveActuators() + { + return m_activeActuators; + } void AddSensor(SCA_ISensor* act); + void ReserveSensor(int num) + { + m_sensors.reserve(num); + } void AddController(SCA_IController* act); + void ReserveController(int num) + { + m_controllers.reserve(num); + } void AddActuator(SCA_IActuator* act); + void ReserveActuator(int num) + { + m_actuators.reserve(num); + } void RegisterActuator(SCA_IActuator* act); void UnregisterActuator(SCA_IActuator* act); diff --git a/source/gameengine/GameLogic/SCA_IScene.cpp b/source/gameengine/GameLogic/SCA_IScene.cpp index 9fbeb706910..86b176a38b0 100644 --- a/source/gameengine/GameLogic/SCA_IScene.cpp +++ b/source/gameengine/GameLogic/SCA_IScene.cpp @@ -50,7 +50,7 @@ SCA_IScene::SCA_IScene() void SCA_IScene::RemoveAllDebugProperties() { for (std::vector::iterator it = m_debugList.begin(); - !(it==m_debugList.end());it++) + !(it==m_debugList.end());++it) { delete (*it); } diff --git a/source/gameengine/GameLogic/SCA_IScene.h b/source/gameengine/GameLogic/SCA_IScene.h index d18778a37c2..b641efc6ee1 100644 --- a/source/gameengine/GameLogic/SCA_IScene.h +++ b/source/gameengine/GameLogic/SCA_IScene.h @@ -52,7 +52,7 @@ public: int lifespan=0)=0; virtual void RemoveObject(class CValue* gameobj)=0; virtual void DelayedRemoveObject(class CValue* gameobj)=0; - virtual void DelayedReleaseObject(class CValue* gameobj)=0; + //virtual void DelayedReleaseObject(class CValue* gameobj)=0; virtual void ReplaceMesh(class CValue* gameobj, void* meshobj)=0; diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 1e9a4521df5..2783bf14600 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -45,7 +45,7 @@ void SCA_ISensor::ReParent(SCA_IObject* parent) SCA_ILogicBrick::ReParent(parent); // will be done when the sensor is activated //m_eventmgr->RegisterSensor(this); - this->SetActive(false); + //this->SetActive(false); } @@ -77,6 +77,12 @@ SCA_ISensor::~SCA_ISensor() // intentionally empty } +void SCA_ISensor::ProcessReplica() +{ + SCA_ILogicBrick::ProcessReplica(); + m_linkedcontrollers.clear(); +} + bool SCA_ISensor::IsPositiveTrigger() { bool result = false; @@ -150,29 +156,72 @@ void SCA_ISensor::RegisterToManager() // sensor is just activated, initialize it Init(); m_state = false; - m_newControllers.erase(m_newControllers.begin(), m_newControllers.end()); m_eventmgr->RegisterSensor(this); } +void SCA_ISensor::LinkToController(SCA_IController* controller) +{ + m_linkedcontrollers.push_back(controller); +} + +void SCA_ISensor::UnlinkController(SCA_IController* controller) +{ + std::vector::iterator contit; + for (contit = m_linkedcontrollers.begin();!(contit==m_linkedcontrollers.end());++contit) + { + if ((*contit) == controller) + { + *contit = m_linkedcontrollers.back(); + m_linkedcontrollers.pop_back(); + return; + } + } + printf("Missing link from sensor %s:%s to controller %s:%s\n", + m_gameobj->GetName().ReadPtr(), GetName().ReadPtr(), + controller->GetParent()->GetName().ReadPtr(), controller->GetName().ReadPtr()); +} + +void SCA_ISensor::UnlinkAllControllers() +{ + std::vector::iterator contit; + for (contit = m_linkedcontrollers.begin();!(contit==m_linkedcontrollers.end());++contit) + { + (*contit)->UnlinkSensor(this); + } + m_linkedcontrollers.clear(); +} + void SCA_ISensor::UnregisterToManager() { m_eventmgr->RemoveSensor(this); + m_links = 0; } -void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr, CValue* event) +void SCA_ISensor::ActivateControllers(class SCA_LogicManager* logicmgr) +{ + for(vector::const_iterator c= m_linkedcontrollers.begin(); + c!=m_linkedcontrollers.end();++c) + { + SCA_IController* contr = *c; + if (contr->IsActive()) + logicmgr->AddTriggeredController(contr, this); + } +} + +void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr) { // calculate if a __triggering__ is wanted // don't evaluate a sensor that is not connected to any controller if (m_links && !m_suspended) { - bool result = this->Evaluate(event); + bool result = this->Evaluate(); // store the state for the rest of the logic system m_prev_state = m_state; m_state = this->IsPositiveTrigger(); if (result) { // the sensor triggered this frame if (m_state || !m_tap) { - logicmgr->AddActivatedSensor(this); + ActivateControllers(logicmgr); // reset these counters so that pulse are synchronized with transition m_pos_ticks = 0; m_neg_ticks = 0; @@ -190,7 +239,7 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr, CValue* event) if (m_pos_ticks > m_pulse_frequency) { if ( m_state ) { - logicmgr->AddActivatedSensor(this); + ActivateControllers(logicmgr); result = true; } m_pos_ticks = 0; @@ -203,7 +252,8 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr, CValue* event) if (m_neg_ticks > m_pulse_frequency) { if (!m_state ) { - logicmgr->AddActivatedSensor(this); + ActivateControllers(logicmgr); + result = true; } m_neg_ticks = 0; } @@ -218,27 +268,24 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr, CValue* event) if (m_prev_state) { // but it triggered on previous frame => send a negative pulse - logicmgr->AddActivatedSensor(this); + ActivateControllers(logicmgr); + result = true; } // in any case, absence of trigger means sensor off m_state = false; } } - if (!m_newControllers.empty()) + if (!result && m_level) { - if (!IsActive() && m_level) + // This level sensor is connected to at least one controller that was just made + // active but it did not generate an event yet, do it now to those controllers only + for(vector::const_iterator c= m_linkedcontrollers.begin(); + c!=m_linkedcontrollers.end();++c) { - // This level sensor is connected to at least one controller that was just made - // active but it did not generate an event yet, do it now to those controllers only - for (std::vector::iterator ci=m_newControllers.begin(); - ci != m_newControllers.end(); ci++) - { - logicmgr->AddTriggeredController(*ci, this); - } + SCA_IController* contr = *c; + if (contr->IsJustActivated()) + logicmgr->AddTriggeredController(contr, this); } - // clear the list. Instead of using clear, which also release the memory, - // use erase, which keeps the memory available for next time. - m_newControllers.erase(m_newControllers.begin(), m_newControllers.end()); } } } diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index 7bbef5fef2f..9aeda728caf 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -32,16 +32,21 @@ #ifndef __SCA_ISENSOR #define __SCA_ISENSOR -#include "SCA_ILogicBrick.h" +#include "SCA_IController.h" #include /** * Interface Class for all logic Sensors. Implements - * pulsemode,pulsefrequency */ + * pulsemode,pulsefrequency + * Use of SG_DList element: link sensors to their respective event manager + * Head: SCA_EventManager::m_sensors + * Use of SG_QList element: not used + */ class SCA_ISensor : public SCA_ILogicBrick { Py_Header; +protected: class SCA_EventManager* m_eventmgr; /** Pulse positive pulses? */ @@ -83,8 +88,7 @@ class SCA_ISensor : public SCA_ILogicBrick /** previous state (for tap option) */ bool m_prev_state; - /** list of controllers that have just activated this sensor because of a state change */ - std::vector m_newControllers; + std::vector m_linkedcontrollers; public: SCA_ISensor(SCA_IObject* gameobj, @@ -97,8 +101,8 @@ public: /* an implementation on this level. It requires an evaluate on the lower */ /* level of individual sensors. Mapping the old activate()s is easy. */ /* The IsPosTrig() also has to change, to keep things consistent. */ - void Activate(class SCA_LogicManager* logicmgr,CValue* event); - virtual bool Evaluate(CValue* event) = 0; + void Activate(class SCA_LogicManager* logicmgr); + virtual bool Evaluate() = 0; virtual bool IsPositiveTrigger(); virtual void Init(); @@ -121,6 +125,16 @@ public: virtual void RegisterToManager(); virtual void UnregisterToManager(); + void ReserveController(int num) + { + m_linkedcontrollers.reserve(num); + } + void LinkToController(SCA_IController* controller); + void UnlinkController(SCA_IController* controller); + void UnlinkAllControllers(); + void ActivateControllers(class SCA_LogicManager* logicmgr); + + virtual void ProcessReplica(); virtual double GetNumber(); @@ -139,8 +153,6 @@ public: /** Resume sensing. */ void Resume(); - void AddNewController(class SCA_IController* controller) - { m_newControllers.push_back(controller); } void ClrLink() { m_links = 0; } void IncLink() diff --git a/source/gameengine/GameLogic/SCA_JoystickManager.cpp b/source/gameengine/GameLogic/SCA_JoystickManager.cpp index f3ce549a637..ff8f3b1c81f 100644 --- a/source/gameengine/GameLogic/SCA_JoystickManager.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickManager.cpp @@ -59,20 +59,21 @@ SCA_JoystickManager::~SCA_JoystickManager() void SCA_JoystickManager::NextFrame(double curtime,double deltatime) { - if (m_sensors.size()==0) { + if (m_sensors.Empty()) { return; } else { - set::iterator it; + ; #ifndef DISABLE_SDL SCA_Joystick::HandleEvents(); /* Handle all SDL Joystick events */ #endif - for (it = m_sensors.begin(); it != m_sensors.end(); it++) + SG_DList::iterator it(m_sensors); + for (it.begin();!it.end();++it) { - SCA_JoystickSensor* joysensor = (SCA_JoystickSensor*)(*it); + SCA_JoystickSensor* joysensor = *it; if(!joysensor->IsSuspended()) { - joysensor->Activate(m_logicmgr, NULL); + joysensor->Activate(m_logicmgr); } } } diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index 34d63a4ee2b..906d454b728 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -102,7 +102,7 @@ bool SCA_JoystickSensor::IsPositiveTrigger() } -bool SCA_JoystickSensor::Evaluate(CValue* event) +bool SCA_JoystickSensor::Evaluate() { SCA_Joystick *js = m_pJoystickMgr->GetJoystickDevice(m_joyindex); bool result = false; diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.h b/source/gameengine/GameLogic/SCA_JoystickSensor.h index 20fff66f66c..e8185d1911e 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.h +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.h @@ -110,7 +110,7 @@ public: virtual ~SCA_JoystickSensor(); virtual CValue* GetReplica(); - virtual bool Evaluate(CValue* event); + virtual bool Evaluate(); virtual bool IsPositiveTrigger(); virtual void Init(); diff --git a/source/gameengine/GameLogic/SCA_KeyboardManager.cpp b/source/gameengine/GameLogic/SCA_KeyboardManager.cpp index 6a96442b124..279adab94d8 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardManager.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardManager.cpp @@ -62,12 +62,11 @@ void SCA_KeyboardManager::NextFrame() { //const SCA_InputEvent& event = GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode)=0; // cerr << "SCA_KeyboardManager::NextFrame"<< endl; - set::iterator it; - for (it=m_sensors.begin(); it != m_sensors.end(); it++) + SG_DList::iterator it(m_sensors); + for (it.begin();!it.end();++it) { - (*it)->Activate(m_logicmanager,NULL); + (*it)->Activate(m_logicmanager); } - } bool SCA_KeyboardManager::IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode) diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index a9ea4272531..f8ee8ed8b41 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -118,7 +118,7 @@ bool SCA_KeyboardSensor::TriggerOnAllKeys() -bool SCA_KeyboardSensor::Evaluate(CValue* eventval) +bool SCA_KeyboardSensor::Evaluate() { bool result = false; bool reset = m_reset && m_level; diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h index 1dd6ea21fcd..033225cd9be 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h @@ -102,7 +102,7 @@ public: short int GetHotkey(); - virtual bool Evaluate(CValue* event); + virtual bool Evaluate(); virtual bool IsPositiveTrigger(); bool TriggerOnAllKeys(); diff --git a/source/gameengine/GameLogic/SCA_LogicManager.cpp b/source/gameengine/GameLogic/SCA_LogicManager.cpp index c43875a0047..74370f89cf2 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.cpp +++ b/source/gameengine/GameLogic/SCA_LogicManager.cpp @@ -49,42 +49,12 @@ SCA_LogicManager::SCA_LogicManager() SCA_LogicManager::~SCA_LogicManager() { - /* AddRef() is not used when the objects are added to m_mapStringToGameObjects - so Release() should not be used either. The memory leak big is fixed - in BL_ConvertBlenderObjects() - - int numgameobj = m_mapStringToGameObjects.size(); - for (int i = 0; i < numgameobj; i++) - { - CValue** gameobjptr = m_mapStringToGameObjects.at(i); - assert(gameobjptr); - if (gameobjptr) - (*gameobjptr)->Release(); - - } - */ - /*for (int i=0;i* controllerarray = *(m_sensorcontrollermap[i]); - delete controllerarray; - } - */ - for (vector::iterator it = m_eventmanagers.begin();!(it==m_eventmanagers.end());it++) + for (vector::iterator it = m_eventmanagers.begin();!(it==m_eventmanagers.end());++it) { delete (*it); } m_eventmanagers.clear(); - m_sensorcontrollermapje.clear(); - m_removedActuators.clear(); - m_activeActuators.clear(); -} - -// this function is a performance helper when the scene is destoyed -// without it, the map updated for each object... a massive slow down when there are -// large number of objects. By clearing the map upfront we avoid the waster of time. -void SCA_LogicManager::RemoveSensorMap() -{ - m_sensorcontrollermapje.clear(); + assert(m_activeActuators.Empty()); } /* @@ -178,62 +148,30 @@ void* SCA_LogicManager::FindBlendObjByGameMeshName(const STR_String& gamemeshnam void SCA_LogicManager::RemoveSensor(SCA_ISensor* sensor) { - sensormap_t::const_iterator mit = m_sensorcontrollermapje.find(sensor); - if (mit != m_sensorcontrollermapje.end()) - { - const controllerlist& contlist = mit->second; - for (controllerlist::const_iterator c= contlist.begin();!(c==contlist.end());c++) - { - (*c)->UnlinkSensor(sensor); - } - m_sensorcontrollermapje.erase(sensor); - } + sensor->UnlinkAllControllers(); sensor->UnregisterToManager(); } void SCA_LogicManager::RemoveController(SCA_IController* controller) { - sensormap_t::iterator sit; - sit = m_sensorcontrollermapje.begin(); - if (sit==m_sensorcontrollermapje.end()) - { - //TRICK: either there is no sensor at all, or the scene is being deleted - //(see KX_Scene::~KX_Scene()). In the first case, this is harmless. - //In the second case, we cannot rely on the sensor being still available, - //make the controller inactive to avoid link count. - //Need a better solution, maybe something similar to m_removedActuators. - controller->SetActive(false); - } controller->UnlinkAllSensors(); controller->UnlinkAllActuators(); - for (;!(sit==m_sensorcontrollermapje.end());++sit) - { - (*sit).second.remove(controller); - } + controller->Deactivate(); } -void SCA_LogicManager::RemoveDestroyedActuator(SCA_IActuator* actuator) +void SCA_LogicManager::RemoveActuator(SCA_IActuator* actuator) { - m_removedActuators.push_back(SmartActuatorPtr(actuator,0)); - // take care that no controller can use this actuator again ! - - sensormap_t::const_iterator sit; - for (sit = m_sensorcontrollermapje.begin();!(sit==m_sensorcontrollermapje.end());++sit) - { - const controllerlist& contlist = sit->second; - for (list::const_iterator c= contlist.begin();!(c==contlist.end());c++) - { - (*c)->UnlinkActuator(actuator); - } - } + actuator->UnlinkAllControllers(); + actuator->Deactivate(); + actuator->SetActive(false); } void SCA_LogicManager::RegisterToSensor(SCA_IController* controller,SCA_ISensor* sensor) { - m_sensorcontrollermapje[sensor].push_back(controller); + sensor->LinkToController(controller); controller->LinkToSensor(sensor); } @@ -241,6 +179,7 @@ void SCA_LogicManager::RegisterToSensor(SCA_IController* controller,SCA_ISensor* void SCA_LogicManager::RegisterToActuator(SCA_IController* controller,SCA_IActuator* actua) { + actua->LinkToController(controller); controller->LinkToActuator(actua); } @@ -251,88 +190,60 @@ void SCA_LogicManager::BeginFrame(double curtime, double fixedtime) for (vector::const_iterator ie=m_eventmanagers.begin(); !(ie==m_eventmanagers.end()); ie++) (*ie)->NextFrame(curtime, fixedtime); - // for this frame, look up for activated sensors, and build the collection of triggered controllers - // int numsensors = this->m_activatedsensors.size(); /*unused*/ - - for (vector::const_iterator is=m_activatedsensors.begin(); - !(is==m_activatedsensors.end());is++) + for(SG_QList* obj = (SG_QList*)m_triggeredControllerSet.Remove(); + obj != NULL; + obj = (SG_QList*)m_triggeredControllerSet.Remove()) { - SCA_ISensor* sensor = *is; - const controllerlist& contlist = m_sensorcontrollermapje[sensor]; - for (list::const_iterator c= contlist.begin(); - !(c==contlist.end());c++) + for(SCA_IController* contr = (SCA_IController*)obj->QRemove(); + contr != NULL; + contr = (SCA_IController*)obj->QRemove()) { - SCA_IController* contr = *c;//controllerarray->at(c); - if (contr->IsActive()) - { - m_triggeredControllerSet.insert(SmartControllerPtr(contr,0)); - // So that the controller knows which sensor has activited it. - // Only needed for the python controller though. - if (contr->GetType() == &SCA_PythonController::Type) - { - SCA_PythonController* pythonController = (SCA_PythonController*)contr; - pythonController->AddTriggeredSensor(sensor); - } - } + contr->Trigger(this); + contr->ClrJustActivated(); } - //sensor->SetActive(false); - } - - - // int numtriggered = triggeredControllerSet.size(); /*unused*/ - for (set::iterator tit=m_triggeredControllerSet.begin(); - !(tit==m_triggeredControllerSet.end());tit++) - { - (*tit)->Trigger(this); } - m_triggeredControllerSet.clear(); } void SCA_LogicManager::UpdateFrame(double curtime, bool frame) { - vector::iterator ra; - for (ra = m_removedActuators.begin(); !(ra == m_removedActuators.end()); ra++) - { - m_activeActuators.erase(*ra); - (*ra)->SetActive(false); - } - m_removedActuators.clear(); - - // About to run actuators, but before update the sensors for those which depends on actuators for (vector::const_iterator ie=m_eventmanagers.begin(); !(ie==m_eventmanagers.end()); ie++) (*ie)->UpdateFrame(); - for (set::iterator ia = m_activeActuators.begin();!(ia==m_activeActuators.end());ia++) + SG_DList::iterator io(m_activeActuators); + for (io.begin(); !io.end(); ++io) { - //SCA_IActuator* actua = *ia; - if (!(*ia)->Update(curtime, frame)) - { - //*ia = m_activeactuators.back(); - m_removedActuators.push_back(*ia); - - (*ia)->SetActive(false); - //m_activeactuators.pop_back(); - } else if ((*ia)->IsNoLink()) + SG_QList::iterator ia(*(*io)); + for (ia.begin(); !ia.end(); ++ia) { - // This actuator has no more links but it still active - // make sure it will get a negative event on next frame to stop it - // Do this check after Update() rather than before to make sure - // that all the actuators that are activated at same time than a state - // actuator have a chance to execute. - CValue* event = new CBoolValue(false); - (*ia)->RemoveAllEvents(); - (*ia)->AddEvent(event); + SCA_IActuator* actua = *ia; + if (!actua->Update(curtime, frame)) + { + // cannot deactive the actuator now as it will disturb the list + m_removedActuators.AddBack(actua); + actua->SetActive(false); + } else if (actua->IsNoLink()) + { + // This actuator has no more links but it still active + // make sure it will get a negative event on next frame to stop it + // Do this check after Update() rather than before to make sure + // that all the actuators that are activated at same time than a state + // actuator have a chance to execute. + bool event = false; + actua->RemoveAllEvents(); + actua->AddEvent(event); + } } } - - for ( ra = m_removedActuators.begin(); !(ra == m_removedActuators.end()); ra++) + + for (SCA_IActuator* act = (SCA_IActuator*)m_removedActuators.Remove(); + act != NULL; + act = (SCA_IActuator*)m_removedActuators.Remove()) { - m_activeActuators.erase(*ra); - (*ra)->SetActive(false); + act->Deactivate(); + act->SetActive(false); } - m_removedActuators.clear(); } @@ -381,39 +292,17 @@ void SCA_LogicManager::RegisterActionName(const STR_String& actname,void* action void SCA_LogicManager::EndFrame() { - for (vector::const_iterator is=m_activatedsensors.begin(); - !(is==m_activatedsensors.end());is++) - { - SCA_ISensor* sensor = *is; - sensor->SetActive(false); - } - m_activatedsensors.clear(); - for (vector::const_iterator ie=m_eventmanagers.begin(); !(ie==m_eventmanagers.end());ie++) { (*ie)->EndFrame(); } - - } - -void SCA_LogicManager::AddActivatedSensor(SCA_ISensor* sensor) -{ - // each frame, only add sensor once, and to avoid a seek, or bloated container - // hold a flag in each sensor, with the 'framenr' - if (!sensor->IsActive()) - { - sensor->SetActive(true); - m_activatedsensors.push_back(sensor); - } -} - void SCA_LogicManager::AddTriggeredController(SCA_IController* controller, SCA_ISensor* sensor) { - m_triggeredControllerSet.insert(SmartControllerPtr(controller,0)); + controller->Activate(m_triggeredControllerSet); // so that the controller knows which sensor has activited it // only needed for python controller if (controller->GetType() == &SCA_PythonController::Type) @@ -424,14 +313,11 @@ void SCA_LogicManager::AddTriggeredController(SCA_IController* controller, SCA_I } -void SCA_LogicManager::AddActiveActuator(SCA_IActuator* actua,CValue* event) +void SCA_LogicManager::AddActiveActuator(SCA_IActuator* actua,bool event) { - if (!actua->IsActive()) - { - actua->SetActive(true); - m_activeActuators.insert(SmartActuatorPtr(actua,0)); - } - actua->AddEvent(event->AddRef()); + actua->SetActive(true); + actua->Activate(m_activeActuators); + actua->AddEvent(event); } @@ -453,109 +339,3 @@ SCA_EventManager* SCA_LogicManager::FindEventManager(int eventmgrtype) } return eventmgr; } - - - -SmartActuatorPtr::SmartActuatorPtr(const SmartActuatorPtr& other) -{ - this->m_actuator = other.m_actuator; - this->m_actuator->AddRef(); -} - - - -SmartActuatorPtr::SmartActuatorPtr(SCA_IActuator* actua,int dummy) -: m_actuator(actua) -{ - actua->AddRef(); -} - - - -SmartActuatorPtr::~SmartActuatorPtr() -{ - m_actuator->Release(); -} - - - -bool SmartActuatorPtr::operator <(const SmartActuatorPtr& other) const -{ - - return m_actuator->LessComparedTo(*other); -} - - - -bool SmartActuatorPtr::operator ==(const SmartActuatorPtr& other) const -{ - bool result2 = other->LessComparedTo(m_actuator); - return (m_actuator->LessComparedTo(*other) && result2); -} - - - -SCA_IActuator* SmartActuatorPtr::operator->() const -{ - return m_actuator; -} - - - -SCA_IActuator* SmartActuatorPtr::operator*() const -{ - return m_actuator; -} - - - -SmartControllerPtr::SmartControllerPtr(const SmartControllerPtr& copy) -{ - this->m_controller = copy.m_controller; - this->m_controller->AddRef(); -} - - - -SmartControllerPtr::SmartControllerPtr(SCA_IController* contr,int dummy) -: m_controller(contr) -{ - m_controller->AddRef(); -} - - - -SmartControllerPtr::~SmartControllerPtr() -{ - m_controller->Release(); -} - - - -bool SmartControllerPtr::operator <(const SmartControllerPtr& other) const -{ - return m_controller->LessComparedTo(*other); -} - - - -bool SmartControllerPtr::operator ==(const SmartControllerPtr& other) const -{ - return (m_controller->LessComparedTo(*other) && other->LessComparedTo(m_controller)); -} - - - -SCA_IController* SmartControllerPtr::operator->() const -{ - return m_controller; -} - - - -SCA_IController* SmartControllerPtr::operator*() const -{ - return m_controller; -} - - diff --git a/source/gameengine/GameLogic/SCA_LogicManager.h b/source/gameengine/GameLogic/SCA_LogicManager.h index 17971c219e5..0d610c9cc46 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.h +++ b/source/gameengine/GameLogic/SCA_LogicManager.h @@ -43,6 +43,7 @@ #include "GEN_Map.h" #include "STR_HashedString.h" #include "Value.h" +#include "SG_QList.h" #include "KX_HashedPtr.h" @@ -65,44 +66,17 @@ typedef std::map sensormap_t; #include "SCA_ILogicBrick.h" -// todo: make this into a template, but first I want to think about what exactly to put in -class SmartActuatorPtr -{ - SCA_IActuator* m_actuator; -public: - SmartActuatorPtr(SCA_IActuator* actua,int dummy); - SmartActuatorPtr(const SmartActuatorPtr& other); - virtual ~SmartActuatorPtr(); - bool operator <(const SmartActuatorPtr& other) const; - bool operator ==(const SmartActuatorPtr& other) const; - SCA_IActuator* operator->() const; - SCA_IActuator* operator*() const; - -}; - -class SmartControllerPtr -{ - SCA_IController* m_controller; -public: - SmartControllerPtr(const SmartControllerPtr& copy); - SmartControllerPtr(SCA_IController* contr,int dummy); - virtual ~SmartControllerPtr(); - bool operator <(const SmartControllerPtr& other) const; - bool operator ==(const SmartControllerPtr& other) const; - SCA_IController* operator->() const; - SCA_IController* operator*() const; - -}; class SCA_LogicManager { vector m_eventmanagers; - vector m_activatedsensors; - set m_activeActuators; - set m_triggeredControllerSet; - - sensormap_t m_sensorcontrollermapje; + // SG_DList: Head of objects having activated actuators + // element: SCA_IObject::m_activeActuators + SG_DList m_activeActuators; + // SG_DList: Head of objects having activated controllers + // element: SCA_IObject::m_activeControllers + SG_DList m_triggeredControllerSet; // need to find better way for this // also known as FactoryManager... @@ -113,12 +87,11 @@ class SCA_LogicManager GEN_Map m_map_gamemeshname_to_blendobj; GEN_Map m_map_blendobj_to_gameobj; - vector m_removedActuators; + // head of actuators being deactivated during the logic update + SG_DList m_removedActuators; public: SCA_LogicManager(); virtual ~SCA_LogicManager(); - // can ONLY be used during scene destruction, avoid massive slow down when scene has many many objects - void RemoveSensorMap(); //void SetKeyboardManager(SCA_KeyboardManager* keyboardmgr) { m_keyboardmgr=keyboardmgr;} void RegisterEventManager(SCA_EventManager* eventmgr); @@ -130,8 +103,7 @@ public: void BeginFrame(double curtime, double fixedtime); void UpdateFrame(double curtime, bool frame); void EndFrame(); - void AddActivatedSensor(SCA_ISensor* sensor); - void AddActiveActuator(SCA_IActuator* sensor,class CValue* event); + void AddActiveActuator(SCA_IActuator* sensor,bool event); void AddTriggeredController(SCA_IController* controller, SCA_ISensor* sensor); SCA_EventManager* FindEventManager(int eventmgrtype); @@ -142,7 +114,7 @@ public: */ void RemoveSensor(SCA_ISensor* sensor); void RemoveController(SCA_IController* controller); - void RemoveDestroyedActuator(SCA_IActuator* actuator); + void RemoveActuator(SCA_IActuator* actuator); // for the scripting... needs a FactoryManager later (if we would have time... ;) diff --git a/source/gameengine/GameLogic/SCA_MouseManager.cpp b/source/gameengine/GameLogic/SCA_MouseManager.cpp index ca875dad07c..d407647cec3 100644 --- a/source/gameengine/GameLogic/SCA_MouseManager.cpp +++ b/source/gameengine/GameLogic/SCA_MouseManager.cpp @@ -75,8 +75,8 @@ void SCA_MouseManager::NextFrame() { if (m_mousedevice) { - set::iterator it; - for (it=m_sensors.begin(); it!=m_sensors.end(); it++) + SG_DList::iterator it(m_sensors); + for (it.begin();!it.end();++it) { SCA_MouseSensor* mousesensor = (SCA_MouseSensor*)(*it); // (0,0) is the Upper Left corner in our local window @@ -93,7 +93,7 @@ void SCA_MouseManager::NextFrame() mousesensor->setX(mx); mousesensor->setY(my); - mousesensor->Activate(m_logicmanager,NULL); + mousesensor->Activate(m_logicmanager); } } } diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index 46be6ad9e16..c5e1c3c0441 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -144,7 +144,7 @@ SCA_IInputDevice::KX_EnumInputs SCA_MouseSensor::GetHotKey() -bool SCA_MouseSensor::Evaluate(CValue* event) +bool SCA_MouseSensor::Evaluate() { bool result = false; bool reset = m_reset && m_level; diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.h b/source/gameengine/GameLogic/SCA_MouseSensor.h index 528237475db..6d6302b514a 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.h +++ b/source/gameengine/GameLogic/SCA_MouseSensor.h @@ -97,7 +97,7 @@ class SCA_MouseSensor : public SCA_ISensor virtual ~SCA_MouseSensor(); virtual CValue* GetReplica(); - virtual bool Evaluate(CValue* event); + virtual bool Evaluate(); virtual void Init(); virtual bool IsPositiveTrigger(); short int GetModeKey(); diff --git a/source/gameengine/GameLogic/SCA_NANDController.cpp b/source/gameengine/GameLogic/SCA_NANDController.cpp index df62f91aaed..d27aea5e6f7 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.cpp +++ b/source/gameengine/GameLogic/SCA_NANDController.cpp @@ -73,19 +73,12 @@ void SCA_NANDController::Trigger(SCA_LogicManager* logicmgr) } } - CValue* newevent = new CBoolValue(sensorresult); - for (vector::const_iterator i=m_linkedactuators.begin(); !(i==m_linkedactuators.end());i++) { - SCA_IActuator* actua = *i;//m_linkedactuators.at(i); - logicmgr->AddActiveActuator(actua,newevent); + SCA_IActuator* actua = *i; + logicmgr->AddActiveActuator(actua,sensorresult); } - - // every actuator that needs the event, has a it's own reference to it now so - // release it (so to be clear: if there is no actuator, it's deleted right now) - newevent->Release(); - } diff --git a/source/gameengine/GameLogic/SCA_NORController.cpp b/source/gameengine/GameLogic/SCA_NORController.cpp index b87af965a50..6c9141636b2 100644 --- a/source/gameengine/GameLogic/SCA_NORController.cpp +++ b/source/gameengine/GameLogic/SCA_NORController.cpp @@ -73,19 +73,12 @@ void SCA_NORController::Trigger(SCA_LogicManager* logicmgr) } } - CValue* newevent = new CBoolValue(sensorresult); - for (vector::const_iterator i=m_linkedactuators.begin(); !(i==m_linkedactuators.end());i++) { - SCA_IActuator* actua = *i;//m_linkedactuators.at(i); - logicmgr->AddActiveActuator(actua,newevent); + SCA_IActuator* actua = *i; + logicmgr->AddActiveActuator(actua,sensorresult); } - - // every actuator that needs the event, has a it's own reference to it now so - // release it (so to be clear: if there is no actuator, it's deleted right now) - newevent->Release(); - } diff --git a/source/gameengine/GameLogic/SCA_ORController.cpp b/source/gameengine/GameLogic/SCA_ORController.cpp index 7aa58b6c320..42c0a67d657 100644 --- a/source/gameengine/GameLogic/SCA_ORController.cpp +++ b/source/gameengine/GameLogic/SCA_ORController.cpp @@ -80,17 +80,12 @@ void SCA_ORController::Trigger(SCA_LogicManager* logicmgr) is++; } - CValue* newevent = new CBoolValue(sensorresult); - for (vector::const_iterator i=m_linkedactuators.begin(); !(i==m_linkedactuators.end());i++) { - SCA_IActuator* actua = *i;//m_linkedactuators.at(i); - logicmgr->AddActiveActuator(actua,newevent); + SCA_IActuator* actua = *i; + logicmgr->AddActiveActuator(actua,sensorresult); } - - - newevent->Release(); } /* ------------------------------------------------------------------------- */ diff --git a/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp b/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp index e5e3f9cced5..764465309df 100644 --- a/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp @@ -50,8 +50,9 @@ SCA_PropertyEventManager::~SCA_PropertyEventManager() void SCA_PropertyEventManager::NextFrame() { // check for changed properties - for (set::const_iterator it = m_sensors.begin();!(it==m_sensors.end());it++) + SG_DList::iterator it(m_sensors); + for (it.begin();!it.end();++it) { - (*it)->Activate(m_logicmgr,NULL); + (*it)->Activate(m_logicmgr); } } diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index e8a291b0a92..2632cbd3dac 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -37,6 +37,7 @@ #include "StringValue.h" #include "SCA_EventManager.h" #include "SCA_LogicManager.h" +#include "BoolValue.h" #ifdef HAVE_CONFIG_H #include @@ -152,7 +153,7 @@ SCA_PropertySensor::~SCA_PropertySensor() -bool SCA_PropertySensor::Evaluate(CValue* event) +bool SCA_PropertySensor::Evaluate() { bool result = CheckPropertyCondition(); bool reset = m_reset && m_level; @@ -182,17 +183,14 @@ bool SCA_PropertySensor::CheckPropertyCondition() CValue* orgprop = GetParent()->FindIdentifier(m_checkpropname); if (!orgprop->IsError()) { - STR_String testprop = orgprop->GetText(); + const STR_String& testprop = orgprop->GetText(); // Force strings to upper case, to avoid confusion in // bool tests. It's stupid the prop's identity is lost // on the way here... - if ((testprop == "TRUE") || (testprop == "FALSE")) { - STR_String checkprop = m_checkpropval; - checkprop.Upper(); - result = (testprop == checkprop); - } else { - result = (orgprop->GetText() == m_checkpropval); + if ((&testprop == &CBoolValue::sTrueString) || (&testprop == &CBoolValue::sFalseString)) { + m_checkpropval.Upper(); } + result = (testprop == m_checkpropval); } orgprop->Release(); @@ -232,8 +230,8 @@ bool SCA_PropertySensor::CheckPropertyCondition() CValue* vallie = m_range_expr->Calculate(); if (vallie) { - STR_String errtext = vallie->GetText(); - if (errtext == "TRUE") + const STR_String& errtext = vallie->GetText(); + if (&errtext == &CBoolValue::sTrueString) { result = true; } else diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.h b/source/gameengine/GameLogic/SCA_PropertySensor.h index 7abf4d44a5b..538ecd65949 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.h +++ b/source/gameengine/GameLogic/SCA_PropertySensor.h @@ -81,7 +81,7 @@ public: void PrecalculateRangeExpression(); bool CheckPropertyCondition(); - virtual bool Evaluate(CValue* event); + virtual bool Evaluate(); virtual bool IsPositiveTrigger(); virtual CValue* FindIdentifier(const STR_String& identifiername); diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 063a7b47321..212366e6526 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -178,7 +178,7 @@ SCA_IActuator* SCA_PythonController::LinkedActuatorFromPy(PyObject *value) if (PyString_Check(value)) { /* get the actuator from the name */ char *name= PyString_AsString(value); - for(it = lacts.begin(); it!= lacts.end(); it++) { + for(it = lacts.begin(); it!= lacts.end(); ++it) { if( name == (*it)->GetName() ) { return *it; } @@ -186,7 +186,7 @@ SCA_IActuator* SCA_PythonController::LinkedActuatorFromPy(PyObject *value) } else if (BGE_PROXY_CHECK_TYPE(value)) { PyObjectPlus *value_plus= BGE_PROXY_REF(value); - for(it = lacts.begin(); it!= lacts.end(); it++) { + for(it = lacts.begin(); it!= lacts.end(); ++it) { if( static_cast(value_plus) == (*it) ) { return *it; } @@ -215,9 +215,8 @@ PyObject* SCA_PythonController::sPyAddActiveActuator(PyObject* self, PyObject* a if(actu==NULL) return NULL; - CValue* boolval = new CBoolValue(activate!=0); + bool boolval = (activate!=0); m_sCurrentLogicManager->AddActiveActuator((SCA_IActuator*)actu,boolval); - boolval->Release(); Py_RETURN_NONE; } @@ -473,7 +472,7 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) Py_DECREF(excdict); } - m_triggeredSensors.erase(m_triggeredSensors.begin(), m_triggeredSensors.end()); + m_triggeredSensors.clear(); m_sCurrentController = NULL; } @@ -499,9 +498,7 @@ PyObject* SCA_PythonController::PyActivate(PyObject *value) if(actu==NULL) return NULL; - CValue* boolval = new CBoolValue(true); - m_sCurrentLogicManager->AddActiveActuator((SCA_IActuator*)actu, boolval); - boolval->Release(); + m_sCurrentLogicManager->AddActiveActuator((SCA_IActuator*)actu, true); Py_RETURN_NONE; } @@ -511,9 +508,7 @@ PyObject* SCA_PythonController::PyDeActivate(PyObject *value) if(actu==NULL) return NULL; - CValue* boolval = new CBoolValue(false); - m_sCurrentLogicManager->AddActiveActuator((SCA_IActuator*)actu, boolval); - boolval->Release(); + m_sCurrentLogicManager->AddActiveActuator((SCA_IActuator*)actu, false); Py_RETURN_NONE; } diff --git a/source/gameengine/GameLogic/SCA_RandomEventManager.cpp b/source/gameengine/GameLogic/SCA_RandomEventManager.cpp index 156478d866d..976597aa812 100644 --- a/source/gameengine/GameLogic/SCA_RandomEventManager.cpp +++ b/source/gameengine/GameLogic/SCA_RandomEventManager.cpp @@ -50,9 +50,10 @@ SCA_RandomEventManager::SCA_RandomEventManager(class SCA_LogicManager* logicmgr) void SCA_RandomEventManager::NextFrame() { - for (set::const_iterator i= m_sensors.begin();!(i==m_sensors.end());i++) + SG_DList::iterator it(m_sensors); + for (it.begin();!it.end();++it) { - (*i)->Activate(m_logicmgr, NULL); + (*it)->Activate(m_logicmgr); } } diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 5c109bac024..1581a29480e 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -89,7 +89,7 @@ bool SCA_RandomSensor::IsPositiveTrigger() } -bool SCA_RandomSensor::Evaluate(CValue* event) +bool SCA_RandomSensor::Evaluate() { /* Random generator is the generator from Line 25 of Table 1 in */ /* [KNUTH 1981, The Art of Computer Programming Vol. 2 */ diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.h b/source/gameengine/GameLogic/SCA_RandomSensor.h index 63a96dd72d0..27b41841f0b 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.h +++ b/source/gameengine/GameLogic/SCA_RandomSensor.h @@ -52,7 +52,7 @@ public: PyTypeObject* T=&Type); virtual ~SCA_RandomSensor(); virtual CValue* GetReplica(); - virtual bool Evaluate(CValue* event); + virtual bool Evaluate(); virtual bool IsPositiveTrigger(); virtual void Init(); diff --git a/source/gameengine/GameLogic/SCA_TimeEventManager.cpp b/source/gameengine/GameLogic/SCA_TimeEventManager.cpp index b7fadd3d62c..911ea772bef 100644 --- a/source/gameengine/GameLogic/SCA_TimeEventManager.cpp +++ b/source/gameengine/GameLogic/SCA_TimeEventManager.cpp @@ -52,7 +52,7 @@ SCA_TimeEventManager::SCA_TimeEventManager(SCA_LogicManager* logicmgr) SCA_TimeEventManager::~SCA_TimeEventManager() { for (vector::iterator it = m_timevalues.begin(); - !(it == m_timevalues.end()); it++) + !(it == m_timevalues.end()); ++it) { (*it)->Release(); } @@ -80,7 +80,7 @@ void SCA_TimeEventManager::NextFrame(double curtime, double fixedtime) // update sensors, but ... need deltatime ! for (vector::iterator it = m_timevalues.begin(); - !(it == m_timevalues.end()); it++) + !(it == m_timevalues.end()); ++it) { float newtime = (*it)->GetNumber() + fixedtime; floatval->SetFloat(newtime); @@ -104,7 +104,7 @@ void SCA_TimeEventManager::AddTimeProperty(CValue* timeval) void SCA_TimeEventManager::RemoveTimeProperty(CValue* timeval) { for (vector::iterator it = m_timevalues.begin(); - !(it == m_timevalues.end()); it++) + !(it == m_timevalues.end()); ++it) { if ((*it) == timeval) { diff --git a/source/gameengine/GameLogic/SCA_XNORController.cpp b/source/gameengine/GameLogic/SCA_XNORController.cpp index 9b0fe51c5b8..aee8e26c21a 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.cpp +++ b/source/gameengine/GameLogic/SCA_XNORController.cpp @@ -77,19 +77,12 @@ void SCA_XNORController::Trigger(SCA_LogicManager* logicmgr) } } - CValue* newevent = new CBoolValue(sensorresult); - for (vector::const_iterator i=m_linkedactuators.begin(); !(i==m_linkedactuators.end());i++) { - SCA_IActuator* actua = *i;//m_linkedactuators.at(i); - logicmgr->AddActiveActuator(actua,newevent); + SCA_IActuator* actua = *i; + logicmgr->AddActiveActuator(actua,sensorresult); } - - // every actuator that needs the event, has a it's own reference to it now so - // release it (so to be clear: if there is no actuator, it's deleted right now) - newevent->Release(); - } diff --git a/source/gameengine/GameLogic/SCA_XORController.cpp b/source/gameengine/GameLogic/SCA_XORController.cpp index 9232120075f..5afb3a750f5 100644 --- a/source/gameengine/GameLogic/SCA_XORController.cpp +++ b/source/gameengine/GameLogic/SCA_XORController.cpp @@ -77,19 +77,12 @@ void SCA_XORController::Trigger(SCA_LogicManager* logicmgr) } } - CValue* newevent = new CBoolValue(sensorresult); - for (vector::const_iterator i=m_linkedactuators.begin(); !(i==m_linkedactuators.end());i++) { - SCA_IActuator* actua = *i;//m_linkedactuators.at(i); - logicmgr->AddActiveActuator(actua,newevent); + SCA_IActuator* actua = *i; + logicmgr->AddActiveActuator(actua,sensorresult); } - - // every actuator that needs the event, has a it's own reference to it now so - // release it (so to be clear: if there is no actuator, it's deleted right now) - newevent->Release(); - } diff --git a/source/gameengine/GameLogic/SConscript b/source/gameengine/GameLogic/SConscript index ebf225f728f..189c39ee237 100644 --- a/source/gameengine/GameLogic/SConscript +++ b/source/gameengine/GameLogic/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('*.cpp') + env.Glob('Joystick/*.cpp') incs = '. #/source/kernel/gen_system #/intern/string' incs += ' #/source/gameengine/Expressions #/intern/moto/include' -incs += ' #/source/gameengine/Rasterizer' +incs += ' #/source/gameengine/Rasterizer #/source/gameengine/Scenegraph' incs += ' ' + env['BF_PYTHON_INC'] diff --git a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt index fa0ca378c6b..eb1d5fc67a3 100644 --- a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt +++ b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt @@ -33,6 +33,7 @@ SET(INC ../../../../source/gameengine/Ketsji ../../../../source/gameengine/GameLogic ../../../../source/gameengine/Expressions + ../../../../source/gameengine/Scenegraph ../../../../source/gameengine/Network ${PYTHON_INC} ) diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp index eee8e9f6827..738f64713b0 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp @@ -61,12 +61,12 @@ void KX_NetworkEventManager::NextFrame() // each frame, the logicmanager will call the network // eventmanager to look for network events, and process it's // 'network' sensors - set::iterator it; - - for (it = m_sensors.begin(); !(it==m_sensors.end()); it++) { + SG_DList::iterator it(m_sensors); + for (it.begin();!it.end();++it) + { // printf("KX_NetworkEventManager::proceed sensor %.2f\n", curtime); // process queue - (*it)->Activate(m_logicmgr, NULL); + (*it)->Activate(m_logicmgr); } // now a list of triggerer sensors has been built diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp index 7f21c490e67..63773352d96 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp @@ -75,7 +75,7 @@ bool KX_NetworkMessageActuator::Update() m_toPropName, GetParent()->GetName(), m_subject, - GetParent()->GetPropertyText(m_body,"")); + GetParent()->GetPropertyText(m_body)); } else { m_networkscene->SendMessage( diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index 82e2437064b..8ddcd87b66f 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -85,7 +85,7 @@ CValue* KX_NetworkMessageSensor::GetReplica() { } // Return true only for flank (UP and DOWN) -bool KX_NetworkMessageSensor::Evaluate(CValue* event) +bool KX_NetworkMessageSensor::Evaluate() { bool result = false; bool WasUp = m_IsUp; @@ -102,8 +102,8 @@ bool KX_NetworkMessageSensor::Evaluate(CValue* event) m_SubjectList = NULL; } - STR_String toname=GetParent()->GetName(); - STR_String subject = this->m_subject; + STR_String& toname=GetParent()->GetName(); + STR_String& subject = this->m_subject; vector messages = m_NetworkScene->FindMessages(toname,"",subject,true); @@ -123,9 +123,9 @@ bool KX_NetworkMessageSensor::Evaluate(CValue* event) for (mesit=messages.begin();mesit!=messages.end();mesit++) { // save the body - STR_String body = (*mesit)->GetMessageText(); + const STR_String& body = (*mesit)->GetMessageText(); // save the subject - STR_String messub = (*mesit)->GetSubject(); + const STR_String& messub = (*mesit)->GetSubject(); #ifdef NAN_NET_DEBUG if (body) { cout << "body [" << body << "]\n"; diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h index 3abba7cfffd..53183f33826 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h @@ -63,7 +63,7 @@ public: virtual ~KX_NetworkMessageSensor(); virtual CValue* GetReplica(); - virtual bool Evaluate(CValue* event); + virtual bool Evaluate(); virtual bool IsPositiveTrigger(); virtual void Init(); void EndFrame(); diff --git a/source/gameengine/Ketsji/KXNetwork/Makefile b/source/gameengine/Ketsji/KXNetwork/Makefile index ddcb03600d5..ec3099611e0 100644 --- a/source/gameengine/Ketsji/KXNetwork/Makefile +++ b/source/gameengine/Ketsji/KXNetwork/Makefile @@ -40,6 +40,7 @@ CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I../../Expressions CPPFLAGS += -I../../GameLogic +CPPFLAGS += -I../../Scenegraph CPPFLAGS += -I../../Network CPPFLAGS += -I../../../kernel/gen_system CPPFLAGS += -I.. diff --git a/source/gameengine/Ketsji/KXNetwork/SConscript b/source/gameengine/Ketsji/KXNetwork/SConscript index 2476ed1f275..26f95fab8af 100644 --- a/source/gameengine/Ketsji/KXNetwork/SConscript +++ b/source/gameengine/Ketsji/KXNetwork/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('*.cpp') incs = '. #source/kernel/gen_system #intern/string #source/gameengine/Ketsji' incs += ' #source/gameengine/GameLogic #source/gameengine/Expressions' -incs += ' #source/gameengine/Network' +incs += ' #source/gameengine/Network #source/gameengine/Scenegraph' incs += ' ' + env['BF_PYTHON_INC'] diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 65a026656c5..3b8917efe90 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -643,8 +643,7 @@ void KX_BlenderMaterial::ActivateTexGen(RAS_IRasterizer *ras) const if (mode &USECUSTOMUV) { - STR_String str = mMaterial->mapping[i].uvCoName; - if (!str.IsEmpty()) + if (!mMaterial->mapping[i].uvCoName.IsEmpty()) ras->SetTexCoord(RAS_IRasterizer::RAS_TEXCO_UV2, i); continue; } @@ -717,6 +716,8 @@ void KX_BlenderMaterial::setObjectMatrixData(int i, RAS_IRasterizer *ras) if(!obj) return; obj->Release(); /* FindValue() AddRef's */ + obj->Release(); + glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR ); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR ); glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR ); diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index e701a680511..5f7197e31f1 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -454,7 +454,7 @@ PyObject* KX_CameraActuator::PyGetObject(PyObject* args) Py_RETURN_NONE; if (ret_name_only) - return PyString_FromString(m_ob->GetName()); + return PyString_FromString(m_ob->GetName().ReadPtr()); else return m_ob->GetProxy(); } diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 2f5b5631761..4d01d96ced4 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -188,14 +188,14 @@ double KX_GameObject::GetNumber() -STR_String KX_GameObject::GetName() +STR_String& KX_GameObject::GetName() { return m_name; } -void KX_GameObject::SetName(STR_String name) +void KX_GameObject::SetName(const char *name) { m_name = name; }; // Set the name of the value @@ -452,14 +452,6 @@ void KX_GameObject::AddMeshUser() double* fl = GetOpenGLMatrixPtr()->getPointer(); RAS_Deformer *deformer = GetDeformer(); - //RAS_MeshSlot *ms; - //for(ms =static_cast(m_meshSlots.QPeek()); - // ms!=static_cast(m_meshSlots.Self()); - // ms =static_cast(ms->QPeek())) - //{ - // ms->m_OpenGLMatrix = fl; - // ms->SetDeformer(deformer); - //} SG_QList::iterator mit(m_meshSlots); for(mit.begin(); !mit.end(); ++mit) { @@ -493,9 +485,7 @@ void KX_GameObject::UpdateBuckets( bool recursive ) if (GetSGNode()->IsDirty()) GetOpenGLMatrix(); - //for(ms =static_cast(m_meshSlots.QPeek()); - // ms!=static_cast(m_meshSlots.Self()); - // ms =static_cast(ms->QPeek())) + SG_QList::iterator mit(m_meshSlots); for(mit.begin(); !mit.end(); ++mit) { @@ -1844,7 +1834,7 @@ int KX_GameObject::py_setattro(PyObject *attr, PyObject *value) // py_setattro m if (ret==PY_SET_ATTR_COERCE_FAIL) { /* CValue attribute exists, remove CValue and add PyDict value */ - RemoveProperty(STR_String(PyString_AsString(attr))); + RemoveProperty(PyString_AsString(attr)); ret= PY_SET_ATTR_MISSING; } @@ -1871,7 +1861,7 @@ int KX_GameObject::py_delattro(PyObject *attr) { char *attr_str= PyString_AsString(attr); - if (RemoveProperty(STR_String(attr_str))) // XXX - should call CValues instead but its only 2 lines here + if (RemoveProperty(attr_str)) // XXX - should call CValues instead but its only 2 lines here return 0; if (m_attr_dict && (PyDict_DelItem(m_attr_dict, attr) == 0)) diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 8fafcc1f9b6..e5b26539d4d 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -241,7 +241,7 @@ public: /** * Inherited from CValue -- returns the name of this object. */ - STR_String + STR_String& GetName( ); @@ -250,7 +250,7 @@ public: */ void SetName( - STR_String name + const char *name ); /** diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index efe01993b08..5e1785e9c21 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -164,14 +164,14 @@ bool KX_IpoActuator::Update(double curtime, bool frame) // result = true if animation has to be continued, false if animation stops // maybe there are events for us in the queue ! bool bNegativeEvent = false; - int numevents = 0; + bool numevents = false; bool bIpoStart = false; curtime -= KX_KetsjiEngine::GetSuspendedDelta(); if (frame) { - numevents = m_events.size(); + numevents = m_posevent || m_negevent; bNegativeEvent = IsNegativeEvent(); RemoveAllEvents(); } @@ -273,7 +273,7 @@ bool KX_IpoActuator::Update(double curtime, bool frame) { result = false; m_bNegativeEvent = false; - numevents = 0; + numevents = false; } if (!m_bIpoPlaying) { diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index c0b05859539..0d1bc289a5c 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -71,7 +71,6 @@ PyTypeObject KX_MeshProxy::Type = { PyParentObject KX_MeshProxy::Parents[] = { &KX_MeshProxy::Type, - &SCA_IObject::Type, &CValue::Type, &PyObjectPlus::Type, NULL @@ -110,21 +109,21 @@ void KX_MeshProxy::SetMeshModified(bool v) PyObject* KX_MeshProxy::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IObject); + py_getattro_up(CValue); } PyObject* KX_MeshProxy::py_getattro_dict() { - py_getattro_dict_up(SCA_IObject); + py_getattro_dict_up(CValue); } int KX_MeshProxy::py_setattro(PyObject *attr, PyObject* value) { - py_setattro_up(SCA_IObject); + py_setattro_up(CValue); } KX_MeshProxy::KX_MeshProxy(RAS_MeshObject* mesh) - : SCA_IObject(&Type), m_meshobj(mesh) + : CValue(&Type), m_meshobj(mesh) { } @@ -140,8 +139,8 @@ CValue* KX_MeshProxy::CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValu const STR_String & KX_MeshProxy::GetText() {return m_meshobj->GetName();}; double KX_MeshProxy::GetNumber() { return -1;} -STR_String KX_MeshProxy::GetName() { return m_meshobj->GetName();} -void KX_MeshProxy::SetName(STR_String name) { }; +STR_String& KX_MeshProxy::GetName() { return m_meshobj->GetName();} +void KX_MeshProxy::SetName(const char *name) { }; CValue* KX_MeshProxy::GetReplica() { return NULL;} diff --git a/source/gameengine/Ketsji/KX_MeshProxy.h b/source/gameengine/Ketsji/KX_MeshProxy.h index f775c963c1e..bfdd4be4118 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.h +++ b/source/gameengine/Ketsji/KX_MeshProxy.h @@ -34,7 +34,7 @@ /* utility conversion function */ bool ConvertPythonToMesh(PyObject * value, class RAS_MeshObject **object, bool py_none_ok, const char *error_prefix); -class KX_MeshProxy : public SCA_IObject +class KX_MeshProxy : public CValue { Py_Header; @@ -51,8 +51,8 @@ public: virtual const STR_String & GetText(); virtual double GetNumber(); virtual RAS_MeshObject* GetMesh() { return m_meshobj; } - virtual STR_String GetName(); - virtual void SetName(STR_String name); // Set the name of the value + virtual STR_String& GetName(); + virtual void SetName(const char *name); // Set the name of the value virtual CValue* GetReplica(); // stuff for python integration diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index 8b7c3cb928b..74b5c923db8 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -86,7 +86,7 @@ void KX_MouseFocusSensor::Init() m_hitNormal.setValue(0,0,1); } -bool KX_MouseFocusSensor::Evaluate(CValue* event) +bool KX_MouseFocusSensor::Evaluate() { bool result = false; bool obHasFocus = false; @@ -119,7 +119,7 @@ bool KX_MouseFocusSensor::Evaluate(CValue* event) * mode is never used, because the converter never makes this * sensor for a mouse-key event. It is here for * completeness. */ - result = SCA_MouseSensor::Evaluate(event); + result = SCA_MouseSensor::Evaluate(); m_positive_event = (m_val!=0); } diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h index 350fda198db..29d674eb305 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h @@ -69,7 +69,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor /** * @attention Overrides default evaluate. */ - virtual bool Evaluate(CValue* event); + virtual bool Evaluate(); virtual void Init(); virtual bool IsPositiveTrigger() { diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp index e7f05555b64..a3c4e95ae24 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.cpp +++ b/source/gameengine/Ketsji/KX_NearSensor.cpp @@ -160,7 +160,7 @@ KX_NearSensor::~KX_NearSensor() } -bool KX_NearSensor::Evaluate(CValue* event) +bool KX_NearSensor::Evaluate() { bool result = false; // KX_GameObject* parent = static_cast(GetParent()); diff --git a/source/gameengine/Ketsji/KX_NearSensor.h b/source/gameengine/Ketsji/KX_NearSensor.h index 5b65312472a..35136b79d13 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.h +++ b/source/gameengine/Ketsji/KX_NearSensor.h @@ -71,7 +71,7 @@ public: virtual void SynchronizeTransform(); virtual CValue* GetReplica(); virtual void ProcessReplica(); - virtual bool Evaluate(CValue* event); + virtual bool Evaluate(); virtual void ReParent(SCA_IObject* parent); virtual bool NewHandleCollision(void* obj1,void* obj2, diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index f55ffd4f69a..c5248785b12 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -267,7 +267,7 @@ PyObject* KX_ParentActuator::PyGetObject(PyObject* args) Py_RETURN_NONE; if (ret_name_only) - return PyString_FromString(m_ob->GetName()); + return PyString_FromString(m_ob->GetName().ReadPtr()); else return m_ob->GetProxy(); } diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index ca38117a9e7..b56b5500c39 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -64,8 +64,8 @@ PyTypeObject KX_PolyProxy::Type = { PyParentObject KX_PolyProxy::Parents[] = { &KX_PolyProxy::Type, - &SCA_IObject::Type, &CValue::Type, + &PyObjectPlus::Type, NULL }; @@ -162,11 +162,11 @@ PyObject* KX_PolyProxy::py_getattro(PyObject *attr) { return PyInt_FromLong(m_polygon->IsCollider()); } - py_getattro_up(SCA_IObject); + py_getattro_up(CValue); } PyObject* KX_PolyProxy::py_getattro_dict() { - py_getattro_dict_up(SCA_IObject); + py_getattro_dict_up(CValue); } KX_PolyProxy::KX_PolyProxy(const RAS_MeshObject*mesh, RAS_Polygon* polygon) @@ -186,8 +186,8 @@ CValue* KX_PolyProxy::CalcFinal(VALUE_DATA_TYPE, VALUE_OPERATOR, CValue *) { re STR_String sPolyName="polygone"; const STR_String & KX_PolyProxy::GetText() {return sPolyName;}; double KX_PolyProxy::GetNumber() { return -1;} -STR_String KX_PolyProxy::GetName() { return sPolyName;} -void KX_PolyProxy::SetName(STR_String) { }; +STR_String& KX_PolyProxy::GetName() { return sPolyName;} +void KX_PolyProxy::SetName(const char *) { }; CValue* KX_PolyProxy::GetReplica() { return NULL;} // stuff for python integration diff --git a/source/gameengine/Ketsji/KX_PolyProxy.h b/source/gameengine/Ketsji/KX_PolyProxy.h index 223193ec519..d8fd36fec6c 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.h +++ b/source/gameengine/Ketsji/KX_PolyProxy.h @@ -31,7 +31,7 @@ #include "SCA_IObject.h" -class KX_PolyProxy : public SCA_IObject +class KX_PolyProxy : public CValue { Py_Header; protected: @@ -46,8 +46,8 @@ public: CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); const STR_String & GetText(); double GetNumber(); - STR_String GetName(); - void SetName(STR_String name); // Set the name of the value + STR_String& GetName(); + void SetName(const char *name); // Set the name of the value CValue* GetReplica(); diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp index 039cf640a6f..42b1850a454 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.cpp +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -91,7 +91,7 @@ static PyObject *KX_PythonSeq_getIndex(KX_PythonSeq * self, int index) switch(self->type) { case KX_PYGENSEQ_CONT_TYPE_SENSORS: { - vector linkedsensors = ((SCA_IController *)self_plus)->GetLinkedSensors(); + vector& linkedsensors = ((SCA_IController *)self_plus)->GetLinkedSensors(); if(index<0) index += linkedsensors.size(); if(index<0 || index>= linkedsensors.size()) { PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); @@ -101,7 +101,7 @@ static PyObject *KX_PythonSeq_getIndex(KX_PythonSeq * self, int index) } case KX_PYGENSEQ_CONT_TYPE_ACTUATORS: { - vector linkedactuators = ((SCA_IController *)self_plus)->GetLinkedActuators(); + vector& linkedactuators = ((SCA_IController *)self_plus)->GetLinkedActuators(); if(index<0) index += linkedactuators.size(); if(index<0 || index>= linkedactuators.size()) { PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); @@ -168,7 +168,7 @@ static PyObject * KX_PythonSeq_subscript(KX_PythonSeq * self, PyObject *key) switch(self->type) { case KX_PYGENSEQ_CONT_TYPE_SENSORS: { - vector linkedsensors = ((SCA_IController *)self_plus)->GetLinkedSensors(); + vector& linkedsensors = ((SCA_IController *)self_plus)->GetLinkedSensors(); SCA_ISensor* sensor; for (unsigned int index=0;index linkedactuators = ((SCA_IController *)self_plus)->GetLinkedActuators(); + vector& linkedactuators = ((SCA_IController *)self_plus)->GetLinkedActuators(); SCA_IActuator* actuator; for (unsigned int index=0;index::const_iterator i= m_sensors.begin();!(i==m_sensors.end());i++) + SG_DList::iterator it(m_sensors); + for (it.begin();!it.end();++it) { - (*i)->Activate(m_logicmgr, NULL); + (*it)->Activate(m_logicmgr); } } diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index 43d8806fc68..fdde5fdcf7b 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -178,7 +178,7 @@ bool KX_RaySensor::NeedRayCast(KX_ClientObjectInfo* client) return true; } -bool KX_RaySensor::Evaluate(CValue* event) +bool KX_RaySensor::Evaluate() { bool result = false; bool reset = m_reset && m_level; diff --git a/source/gameengine/Ketsji/KX_RaySensor.h b/source/gameengine/Ketsji/KX_RaySensor.h index 558840e2f17..9efb046742f 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.h +++ b/source/gameengine/Ketsji/KX_RaySensor.h @@ -67,7 +67,7 @@ public: virtual ~KX_RaySensor(); virtual CValue* GetReplica(); - virtual bool Evaluate(CValue* event); + virtual bool Evaluate(); virtual bool IsPositiveTrigger(); virtual void Init(); diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index 2fd786e44e3..3c72eac3e62 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -87,7 +87,7 @@ KX_SCA_AddObjectActuator::~KX_SCA_AddObjectActuator() if (m_OriginalObject) m_OriginalObject->UnregisterActuator(this); if (m_lastCreatedObject) - m_lastCreatedObject->Release(); + m_lastCreatedObject->UnregisterActuator(this); } @@ -145,6 +145,12 @@ bool KX_SCA_AddObjectActuator::UnlinkObject(SCA_IObject* clientobj) m_OriginalObject = NULL; return true; } + if (clientobj == m_lastCreatedObject) + { + // this object is being deleted, we cannot continue to track it. + m_lastCreatedObject = NULL; + return true; + } return false; } @@ -356,7 +362,7 @@ PyObject* KX_SCA_AddObjectActuator::PyGetObject(PyObject* args) Py_RETURN_NONE; if (ret_name_only) - return PyString_FromString(m_OriginalObject->GetName()); + return PyString_FromString(m_OriginalObject->GetName().ReadPtr()); else return m_OriginalObject->GetProxy(); } @@ -464,13 +470,21 @@ void KX_SCA_AddObjectActuator::InstantAddObject() // keep a copy of the last object, to allow python scripters to change it if (m_lastCreatedObject) { - //careful with destruction, it might still have outstanding collision callbacks - m_scene->DelayedReleaseObject(m_lastCreatedObject); - m_lastCreatedObject->Release(); + //Let's not keep a reference to the object: it's bad, if the object is deleted + //this will force to keep a "zombie" in the game for no good reason. + //m_scene->DelayedReleaseObject(m_lastCreatedObject); + //m_lastCreatedObject->Release(); + + //Instead we use the registration mechanism + m_lastCreatedObject->UnregisterActuator(this); + m_lastCreatedObject = NULL; } m_lastCreatedObject = replica; - m_lastCreatedObject->AddRef(); + // no reference + //m_lastCreatedObject->AddRef(); + // but registration + m_lastCreatedObject->RegisterActuator(this); // finished using replica? then release it replica->Release(); } diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 208f8fc9461..84c6d374386 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -164,7 +164,6 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice, m_lightlist= new CListValue(); m_inactivelist = new CListValue(); m_euthanasyobjects = new CListValue(); - m_delayReleaseObjects = new CListValue(); m_logicmgr = new SCA_LogicManager(); @@ -223,8 +222,6 @@ KX_Scene::~KX_Scene() // It's still there but we remove all properties here otherwise some // reference might be hanging and causing late release of objects RemoveAllDebugProperties(); - // early removal of sensor map to avoid massive slow down when there are many objects - m_logicmgr->RemoveSensorMap(); while (GetRootParentList()->GetCount() > 0) { @@ -249,8 +246,6 @@ KX_Scene::~KX_Scene() if (m_euthanasyobjects) m_euthanasyobjects->Release(); - if (m_delayReleaseObjects) - m_delayReleaseObjects->Release(); if (m_logicmgr) delete m_logicmgr; @@ -419,11 +414,11 @@ void KX_Scene::RemoveNodeDestructObject(class SG_IObject* node,class CValue* gam KX_GameObject* orgobj = (KX_GameObject*)gameobj; if (NewRemoveObject(orgobj) != 0) { - // object is not yet deleted (this can happen when it hangs in an add object actuator - // last object created reference. It's a bad situation, don't know how to fix it exactly - // The least I can do, is remove the reference to the node in the object as the node - // will in any case be deleted. This ensures that the object will not try to use the node - // when it is finally deleted (see KX_GameObject destructor) + // object is not yet deleted because a reference is hanging somewhere. + // This should not happen anymore since we use proxy object for Python + // confident enough to put an assert? + //assert(false); + printf("Zombie object! name=%s\n", orgobj->GetName().ReadPtr()); orgobj->SetSGNode(NULL); PHY_IGraphicController* ctrl = orgobj->GetGraphicController(); if (ctrl) @@ -550,8 +545,9 @@ void KX_Scene::ReplicateLogic(KX_GameObject* newobj) vector linkedactuators = cont->GetLinkedActuators(); // disconnect the sensors and actuators - cont->UnlinkAllSensors(); - cont->UnlinkAllActuators(); + // do it directly on the list at this controller is not connected to anything at this stage + cont->GetLinkedSensors().clear(); + cont->GetLinkedActuators().clear(); // now relink each sensor for (vector::iterator its = linkedsensors.begin();!(its==linkedsensors.end());its++) @@ -908,14 +904,6 @@ void KX_Scene::RemoveObject(class CValue* gameobj) { KX_GameObject* newobj = (KX_GameObject*) gameobj; - /* Invalidate the python reference, since the object may exist in script lists - * its possible that it wont be automatically invalidated, so do it manually here, - * - * if for some reason the object is added back into the scene python can always get a new Proxy - */ - gameobj->InvalidateProxy(); - - // disconnect child from parent SG_Node* node = newobj->GetSGNode(); @@ -930,12 +918,6 @@ void KX_Scene::RemoveObject(class CValue* gameobj) //newobj->SetSGNode(0); } -void KX_Scene::DelayedReleaseObject(CValue* gameobj) -{ - m_delayReleaseObjects->Add(gameobj->AddRef()); -} - - void KX_Scene::DelayedRemoveObject(class CValue* gameobj) { //KX_GameObject* newobj = (KX_GameObject*) gameobj; @@ -952,6 +934,13 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj) int ret; KX_GameObject* newobj = (KX_GameObject*) gameobj; + /* Invalidate the python reference, since the object may exist in script lists + * its possible that it wont be automatically invalidated, so do it manually here, + * + * if for some reason the object is added back into the scene python can always get a new Proxy + */ + newobj->InvalidateProxy(); + // keep the blender->game object association up to date // note that all the replicas of an object will have the same // blender object, that's why we need to check the game object @@ -981,7 +970,7 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj) for (SCA_ActuatorList::iterator ita = actuators.begin(); !(ita==actuators.end());ita++) { - m_logicmgr->RemoveDestroyedActuator(*ita); + m_logicmgr->RemoveActuator(*ita); } // the sensors/controllers/actuators must also be released, this is done in ~SCA_IObject @@ -1464,23 +1453,16 @@ void KX_Scene::LogicEndFrame() m_logicmgr->EndFrame(); int numobj = m_euthanasyobjects->GetCount(); int i; - for (i = numobj - 1; i >= 0; i--) - { - KX_GameObject* gameobj = (KX_GameObject*)m_euthanasyobjects->GetValue(i); - // KX_Scene::RemoveObject will also remove the object from this list - // that's why we start from the end - this->RemoveObject(gameobj); - } + KX_GameObject* obj; - numobj= m_delayReleaseObjects->GetCount(); - for (i = numobj-1;i>=0;i--) + while ((numobj = m_euthanasyobjects->GetCount()) > 0) { - KX_GameObject* gameobj = (KX_GameObject*)m_delayReleaseObjects->GetValue(i); - // This list is not for object removal, but just object release - gameobj->Release(); + // remove the object from this list to make sure we will not hit it again + obj = (KX_GameObject*)m_euthanasyobjects->GetValue(numobj-1); + m_euthanasyobjects->Remove(numobj-1); + obj->Release(); + RemoveObject(obj); } - // empty the list as we have removed all references - m_delayReleaseObjects->Resize(0); } diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 0cfef8b7bd1..128f8d23135 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -108,11 +108,6 @@ protected: * LogicEndFrame() via a call to RemoveObject(). */ CListValue* m_euthanasyobjects; - /** - * The list of objects that couldn't be released during logic update. - * for example, AddObject actuator sometimes releases an object that was cached from previous frame - */ - CListValue* m_delayReleaseObjects; CListValue* m_objectlist; CListValue* m_parentlist; // all 'root' parents @@ -331,8 +326,6 @@ public: void RemoveObject(CValue* gameobj); void DelayedRemoveObject(CValue* gameobj); - void DelayedReleaseObject(CValue* gameobj); - int NewRemoveObject(CValue* gameobj); void ReplaceMesh(CValue* gameobj, void* meshobj); diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index 15eb354ee79..07a880c950b 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -83,17 +83,19 @@ CValue* KX_SoundActuator::GetReplica() { KX_SoundActuator* replica = new KX_SoundActuator(*this); replica->ProcessReplica(); + return replica; +}; + +void KX_SoundActuator::ProcessReplica() +{ + SCA_IActuator::ProcessReplica(); if (m_soundObject) { SND_SoundObject* soundobj = new SND_SoundObject(*m_soundObject); - replica->setSoundObject(soundobj); + setSoundObject(soundobj); m_soundScene->AddObject(soundobj); } - - return replica; -}; - - +} bool KX_SoundActuator::Update(double curtime, bool frame) { diff --git a/source/gameengine/Ketsji/KX_SoundActuator.h b/source/gameengine/Ketsji/KX_SoundActuator.h index ad58087dc57..a7491355667 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.h +++ b/source/gameengine/Ketsji/KX_SoundActuator.h @@ -75,6 +75,7 @@ public: virtual bool Update(double curtime, bool frame); CValue* GetReplica(); + void ProcessReplica(); /* -------------------------------------------------------------------- */ /* Python interface --------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.cpp b/source/gameengine/Ketsji/KX_TouchEventManager.cpp index 48d4cf59a2b..8ae5fae8fa3 100644 --- a/source/gameengine/Ketsji/KX_TouchEventManager.cpp +++ b/source/gameengine/Ketsji/KX_TouchEventManager.cpp @@ -100,7 +100,7 @@ bool KX_TouchEventManager::newBroadphaseResponse(void *client_data, void KX_TouchEventManager::RegisterSensor(SCA_ISensor* sensor) { KX_TouchSensor* touchsensor = static_cast(sensor); - if (m_sensors.insert(touchsensor).second) + if (m_sensors.AddBack(touchsensor)) // the sensor was effectively inserted, register it touchsensor->RegisterSumo(this); } @@ -108,7 +108,7 @@ void KX_TouchEventManager::RegisterSensor(SCA_ISensor* sensor) void KX_TouchEventManager::RemoveSensor(SCA_ISensor* sensor) { KX_TouchSensor* touchsensor = static_cast(sensor); - if (m_sensors.erase(touchsensor)) + if (touchsensor->Delink()) // the sensor was effectively removed, unregister it touchsensor->UnregisterSumo(this); } @@ -117,12 +117,10 @@ void KX_TouchEventManager::RemoveSensor(SCA_ISensor* sensor) void KX_TouchEventManager::EndFrame() { - set::iterator it; - for ( it = m_sensors.begin(); - !(it==m_sensors.end());it++) + SG_DList::iterator it(m_sensors); + for (it.begin();!it.end();++it) { - ((KX_TouchSensor*)*it)->EndFrame(); - + (*it)->EndFrame(); } } @@ -130,12 +128,11 @@ void KX_TouchEventManager::EndFrame() void KX_TouchEventManager::NextFrame() { - if (m_sensors.size() > 0) + if (!m_sensors.Empty()) { - set::iterator it; - - for (it = m_sensors.begin();!(it==m_sensors.end());++it) - static_cast(*it)->SynchronizeTransform(); + SG_DList::iterator it(m_sensors); + for (it.begin();!it.end();++it) + (*it)->SynchronizeTransform(); for (std::set::iterator cit = m_newCollisions.begin(); cit != m_newCollisions.end(); ++cit) { @@ -161,7 +158,7 @@ void KX_TouchEventManager::NextFrame() m_newCollisions.clear(); - for (it = m_sensors.begin();!(it==m_sensors.end());++it) - (*it)->Activate(m_logicmgr,NULL); + for (it.begin();!it.end();++it) + (*it)->Activate(m_logicmgr); } } diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index f000c16041a..2c02d949c63 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -66,10 +66,10 @@ void KX_TouchSensor::UnregisterToManager() { // before unregistering the sensor, make sure we release all references EndFrame(); - m_eventmgr->RemoveSensor(this); + SCA_ISensor::UnregisterToManager(); } -bool KX_TouchSensor::Evaluate(CValue* event) +bool KX_TouchSensor::Evaluate() { bool result = false; bool reset = m_reset && m_level; diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index 056b5701937..9c9c6bf5816 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -86,7 +86,7 @@ public: virtual CValue* GetReplica(); virtual void ProcessReplica(); virtual void SynchronizeTransform(); - virtual bool Evaluate(CValue* event); + virtual bool Evaluate(); virtual void Init(); virtual void ReParent(SCA_IObject* parent); diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index 672b9e739ba..800da83dc3d 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -83,6 +83,10 @@ KX_TrackToActuator::KX_TrackToActuator(SCA_IObject *gameobj, // if so, store the initial local rotation // this is needed to revert the effect of the parent inverse node (TBC) m_parentlocalmat = m_parentobj->GetSGNode()->GetLocalOrientation(); + // use registration mechanism rather than AddRef, it creates zombie objects + m_parentobj->RegisterActuator(this); + // GetParent did AddRef, undo here + m_parentobj->Release(); } } } @@ -189,7 +193,7 @@ KX_TrackToActuator::~KX_TrackToActuator() if (m_object) m_object->UnregisterActuator(this); if (m_parentobj) - m_parentobj->Release(); + m_parentobj->UnregisterActuator(this); } /* end of destructor */ void KX_TrackToActuator::ProcessReplica() @@ -198,7 +202,7 @@ void KX_TrackToActuator::ProcessReplica() if (m_object) m_object->RegisterActuator(this); if (m_parentobj) - m_parentobj->AddRef(); + m_parentobj->RegisterActuator(this); SCA_IActuator::ProcessReplica(); } @@ -211,6 +215,11 @@ bool KX_TrackToActuator::UnlinkObject(SCA_IObject* clientobj) m_object = NULL; return true; } + if (clientobj == m_parentobj) + { + m_parentobj = NULL; + return true; + } return false; } @@ -227,9 +236,9 @@ void KX_TrackToActuator::Relink(GEN_Map *obj_map) void **h_parobj = (*obj_map)[m_parentobj]; if (h_parobj) { if (m_parentobj) - m_parentobj->Release(); + m_parentobj->UnregisterActuator(this); m_parentobj= (KX_GameObject*)(*h_parobj); - m_parentobj->AddRef(); + m_parentobj->RegisterActuator(this); } } diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index 6563d0446eb..4b0ad083473 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -62,8 +62,8 @@ PyTypeObject KX_VertexProxy::Type = { PyParentObject KX_VertexProxy::Parents[] = { &KX_VertexProxy::Type, - &SCA_IObject::Type, &CValue::Type, + &PyObjectPlus::Type, NULL }; @@ -162,11 +162,11 @@ KX_VertexProxy::py_getattro(PyObject *attr) return PyObjectFrom(MT_Vector3(m_vertex->getNormal())); } - py_getattro_up(SCA_IObject); + py_getattro_up(CValue); } PyObject* KX_VertexProxy::py_getattro_dict() { - py_getattro_dict_up(SCA_IObject); + py_getattro_dict_up(CValue); } int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) @@ -322,7 +322,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) } } - return SCA_IObject::py_setattro(attr, pyvalue); + return CValue::py_setattro(attr, pyvalue); } KX_VertexProxy::KX_VertexProxy(KX_MeshProxy*mesh, RAS_TexVert* vertex) @@ -343,8 +343,8 @@ CValue* KX_VertexProxy::CalcFinal(VALUE_DATA_TYPE, VALUE_OPERATOR, CValue *) { STR_String sVertexName="vertex"; const STR_String & KX_VertexProxy::GetText() {return sVertexName;}; double KX_VertexProxy::GetNumber() { return -1;} -STR_String KX_VertexProxy::GetName() { return sVertexName;} -void KX_VertexProxy::SetName(STR_String) { }; +STR_String& KX_VertexProxy::GetName() { return sVertexName;} +void KX_VertexProxy::SetName(const char *) { }; CValue* KX_VertexProxy::GetReplica() { return NULL;} // stuff for python integration diff --git a/source/gameengine/Ketsji/KX_VertexProxy.h b/source/gameengine/Ketsji/KX_VertexProxy.h index 81dd0d222a7..42db5fbc322 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.h +++ b/source/gameengine/Ketsji/KX_VertexProxy.h @@ -31,7 +31,7 @@ #include "SCA_IObject.h" -class KX_VertexProxy : public SCA_IObject +class KX_VertexProxy : public CValue { Py_Header; protected: @@ -47,8 +47,8 @@ public: CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); const STR_String & GetText(); double GetNumber(); - STR_String GetName(); - void SetName(STR_String name); // Set the name of the value + STR_String& GetName(); + void SetName(const char *name); // Set the name of the value CValue* GetReplica(); diff --git a/source/gameengine/Network/NG_NetworkScene.cpp b/source/gameengine/Network/NG_NetworkScene.cpp index 22263a2bdda..f8e489a8f48 100644 --- a/source/gameengine/Network/NG_NetworkScene.cpp +++ b/source/gameengine/Network/NG_NetworkScene.cpp @@ -119,7 +119,7 @@ void NG_NetworkScene::AddObject(NG_NetworkObject* object) { if (! m_networkdevice->IsOnline()) return; - STR_String name = object->GetName(); + const STR_String& name = object->GetName(); m_networkObjects.insert(name, object); } @@ -130,7 +130,7 @@ void NG_NetworkScene::RemoveObject(NG_NetworkObject* object) { if (! m_networkdevice->IsOnline()) return; - STR_String name = object->GetName(); + const STR_String& name = object->GetName(); m_networkObjects.remove(name); } diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp index a111ac2786f..200b1c6c89f 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp +++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp @@ -114,22 +114,15 @@ void RAS_BucketManager::OrderBuckets(const MT_Transform& cameratrans, BucketList for (bit = buckets.begin(); bit != buckets.end(); ++bit) { -#if 1 SG_DList::iterator mit((*bit)->GetActiveMeshSlots()); for(mit.begin(); !mit.end(); ++mit) size++; -#else - for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) - if (!mit->IsCulled()) - size++; -#endif } slots.resize(size); for (bit = buckets.begin(); bit != buckets.end(); ++bit) { -#if 1 RAS_MaterialBucket* bucket = *bit; RAS_MeshSlot* ms; // remove the mesh slot form the list, it culls them automatically for next frame @@ -139,11 +132,6 @@ void RAS_BucketManager::OrderBuckets(const MT_Transform& cameratrans, BucketList { slots[i++].set(ms, bucket, pnorm); } -#else - for (mit = (*bit)->msBegin(); mit != (*bit)->msEnd(); ++mit) - if (!mit->IsCulled()) - slots[i++].set(&*mit, *bit, pnorm); -#endif } if(alpha) diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index c3223cb9448..edd7615efd4 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -179,14 +179,14 @@ list::iterator RAS_MeshObject::GetLastMaterial() -void RAS_MeshObject::SetName(STR_String name) +void RAS_MeshObject::SetName(const char *name) { m_name = name; } -const STR_String& RAS_MeshObject::GetName() +STR_String& RAS_MeshObject::GetName() { return m_name; } diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h index a2283b9bc5d..fbc3c549a7a 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_MeshObject.h @@ -97,8 +97,8 @@ public: unsigned int GetLightLayer(); /* name */ - void SetName(STR_String name); - const STR_String& GetName(); + void SetName(const char *name); + STR_String& GetName(); /* modification state */ bool MeshModified(); diff --git a/source/gameengine/SceneGraph/SG_DList.h b/source/gameengine/SceneGraph/SG_DList.h index dc5afa2ee99..7bef13cc9e3 100644 --- a/source/gameengine/SceneGraph/SG_DList.h +++ b/source/gameengine/SceneGraph/SG_DList.h @@ -54,14 +54,18 @@ public: void begin() { m_current = (T*)m_head.Peek(); - if (m_current == (T*)m_head.Self()) - { - m_current = NULL; - } + } + void back() + { + m_current = (T*)m_head.Back(); } bool end() { - return (NULL == m_current); + return (m_current == (T*)m_head.Self()); + } + bool add_back(T* item) + { + return m_current->AddBack(item); } T* operator*() { @@ -69,12 +73,14 @@ public: } _myT& operator++() { - assert(m_current); + // no check of NULL! make sure you don't try to increment beyond end m_current = (T*)m_current->Peek(); - if (m_current == (T*)m_head.Self()) - { - m_current = NULL; - } + return *this; + } + _myT& operator--() + { + // no check of NULL! make sure you don't try to increment beyond end + m_current = (T*)m_current->Back(); return *this; } }; @@ -128,19 +134,23 @@ public: item->m_flink = item->m_blink = item; return item; } - void Delink() // Remove from the middle + bool Delink() // Remove from the middle { - if (!Empty()) - { - m_blink->m_flink = m_flink; - m_flink->m_blink = m_blink; - m_flink = m_blink = this; - } + if (Empty()) + return false; + m_blink->m_flink = m_flink; + m_flink->m_blink = m_blink; + m_flink = m_blink = this; + return true; } inline SG_DList *Peek() // Look at front without removing { return m_flink; } + inline SG_DList *Back() // Look at front without removing + { + return m_blink; + } inline SG_DList *Self() { return this; diff --git a/source/gameengine/SceneGraph/SG_QList.h b/source/gameengine/SceneGraph/SG_QList.h index 4a254ac36a4..7a6b2e466c9 100644 --- a/source/gameengine/SceneGraph/SG_QList.h +++ b/source/gameengine/SceneGraph/SG_QList.h @@ -55,14 +55,18 @@ public: void begin() { m_current = (T*)m_head.QPeek(); - if (m_current == (T*)m_head.Self()) - { - m_current = NULL; - } + } + void back() + { + m_current = (T*)m_head.QBack(); } bool end() { - return (NULL == m_current); + return (m_current == (T*)m_head.Self()); + } + bool add_back(T* item) + { + return m_current->QAddBack(item); } T* operator*() { @@ -70,12 +74,13 @@ public: } _myT& operator++() { - assert(m_current); m_current = (T*)m_current->QPeek(); - if (m_current == (T*)m_head.Self()) - { - m_current = NULL; - } + return *this; + } + _myT& operator--() + { + // no check on NULL! make sure you don't try to increment beyond end + m_current = (T*)m_current->QBack(); return *this; } }; @@ -129,19 +134,23 @@ public: item->m_fqlink = item->m_bqlink = item; return item; } - void QDelink() // Remove from the middle + bool QDelink() // Remove from the middle { - if (!QEmpty()) - { - m_bqlink->m_fqlink = m_fqlink; - m_fqlink->m_bqlink = m_bqlink; - m_fqlink = m_bqlink = this; - } + if (QEmpty()) + return false; + m_bqlink->m_fqlink = m_fqlink; + m_fqlink->m_bqlink = m_bqlink; + m_fqlink = m_bqlink = this; + return true; } inline SG_QList *QPeek() // Look at front without removing { return m_fqlink; } + inline SG_QList *QBack() // Look at front without removing + { + return m_bqlink; + } }; #endif //__SG_QLIST -- cgit v1.2.3 From a6721e549d560c12c07a6a0f14ada3c429d4bc79 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 10 May 2009 21:22:25 +0000 Subject: changes to get benoits logic updates building on scons with gcc --- source/gameengine/Converter/KX_ConvertActuators.cpp | 3 ++- source/gameengine/Expressions/SConscript | 2 +- source/gameengine/GameLogic/SConscript | 2 +- source/gameengine/Ketsji/KXNetwork/SConscript | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 76b8540118a..5d3db25b9ed 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -1105,7 +1105,8 @@ void BL_ConvertActuators(char* maggiename, buf = txt_to_buf(_2dfilter->text); if (buf) { - tmp->SetShaderText(STR_String(buf)); + STR_String buf_str= buf; + tmp->SetShaderText(buf_str); MEM_freeN(buf); } } diff --git a/source/gameengine/Expressions/SConscript b/source/gameengine/Expressions/SConscript index 9d6823e3879..12d4a163c86 100644 --- a/source/gameengine/Expressions/SConscript +++ b/source/gameengine/Expressions/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('*.cpp') -incs ='. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/Scenegraph' +incs ='. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/SceneGraph' incs += ' ' + env['BF_PYTHON_INC'] cxxflags = [] diff --git a/source/gameengine/GameLogic/SConscript b/source/gameengine/GameLogic/SConscript index 189c39ee237..aadc4154298 100644 --- a/source/gameengine/GameLogic/SConscript +++ b/source/gameengine/GameLogic/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('*.cpp') + env.Glob('Joystick/*.cpp') incs = '. #/source/kernel/gen_system #/intern/string' incs += ' #/source/gameengine/Expressions #/intern/moto/include' -incs += ' #/source/gameengine/Rasterizer #/source/gameengine/Scenegraph' +incs += ' #/source/gameengine/Rasterizer #/source/gameengine/SceneGraph' incs += ' ' + env['BF_PYTHON_INC'] diff --git a/source/gameengine/Ketsji/KXNetwork/SConscript b/source/gameengine/Ketsji/KXNetwork/SConscript index 26f95fab8af..9dc68669b4a 100644 --- a/source/gameengine/Ketsji/KXNetwork/SConscript +++ b/source/gameengine/Ketsji/KXNetwork/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('*.cpp') incs = '. #source/kernel/gen_system #intern/string #source/gameengine/Ketsji' incs += ' #source/gameengine/GameLogic #source/gameengine/Expressions' -incs += ' #source/gameengine/Network #source/gameengine/Scenegraph' +incs += ' #source/gameengine/Network #source/gameengine/SceneGraph' incs += ' ' + env['BF_PYTHON_INC'] -- cgit v1.2.3 From 89c2d80d32228a140f27b2b2c0e25b30fc1394a8 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 10 May 2009 21:30:30 +0000 Subject: Linux compilation problem, better fix --- source/gameengine/Converter/KX_ConvertActuators.cpp | 3 +-- source/gameengine/GameLogic/SCA_2DFilterActuator.cpp | 2 +- source/gameengine/GameLogic/SCA_2DFilterActuator.h | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 5d3db25b9ed..60d64621665 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -1105,8 +1105,7 @@ void BL_ConvertActuators(char* maggiename, buf = txt_to_buf(_2dfilter->text); if (buf) { - STR_String buf_str= buf; - tmp->SetShaderText(buf_str); + tmp->SetShaderText(buf); MEM_freeN(buf); } } diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index 1aaa59ee207..7682f6755ef 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -95,7 +95,7 @@ bool SCA_2DFilterActuator::Update() } -void SCA_2DFilterActuator::SetShaderText(STR_String& text) +void SCA_2DFilterActuator::SetShaderText(const char *text) { m_shaderText = text; } diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.h b/source/gameengine/GameLogic/SCA_2DFilterActuator.h index aea3a35d404..13b9997a010 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.h +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.h @@ -60,7 +60,7 @@ public: PyTypeObject* T=&Type ); - void SetShaderText(STR_String& text); + void SetShaderText(const char *text); virtual ~SCA_2DFilterActuator(); virtual bool Update(); -- cgit v1.2.3 From a417334026946c0eaa9e5dfc600eb12447ec0af0 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 10 May 2009 22:06:11 +0000 Subject: Linux compilation problem --- source/gameengine/Ketsji/KX_PythonSeq.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp index 42b1850a454..c2ecf3b384f 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.cpp +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -52,7 +52,7 @@ PyObject *KX_PythonSeq_CreatePyObject( PyObject *base, short type ) PyObject_DEL( self ); } -static Py_ssize_t KX_PythonSeq_len( KX_PythonSeq * self ) +static int KX_PythonSeq_len( KX_PythonSeq * self ) { PyObjectPlus *self_plus= BGE_PROXY_REF(self->base); @@ -63,15 +63,15 @@ static Py_ssize_t KX_PythonSeq_len( KX_PythonSeq * self ) switch(self->type) { case KX_PYGENSEQ_CONT_TYPE_SENSORS: - return ((SCA_IController *)self_plus)->GetLinkedSensors().size(); + return (int)(((SCA_IController *)self_plus)->GetLinkedSensors().size()); case KX_PYGENSEQ_CONT_TYPE_ACTUATORS: - return ((SCA_IController *)self_plus)->GetLinkedActuators().size(); + return (int)(((SCA_IController *)self_plus)->GetLinkedActuators().size()); case KX_PYGENSEQ_OB_TYPE_SENSORS: - return ((KX_GameObject *)self_plus)->GetSensors().size(); + return (int)(((KX_GameObject *)self_plus)->GetSensors().size()); case KX_PYGENSEQ_OB_TYPE_CONTROLLERS: - return ((KX_GameObject *)self_plus)->GetControllers().size(); + return (int)(((KX_GameObject *)self_plus)->GetControllers().size()); case KX_PYGENSEQ_OB_TYPE_ACTUATORS: - return ((KX_GameObject *)self_plus)->GetActuators().size(); + return (int)(((KX_GameObject *)self_plus)->GetActuators().size()); default: /* Should never happen */ PyErr_SetString(PyExc_SystemError, "invalid type, internal error"); -- cgit v1.2.3 From 9cc61dd9c8233c8878599aec1bd95fe8019094a6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 10 May 2009 22:33:21 +0000 Subject: use the same sequence mapping types as CListValue, hopefully this means it will build on different python versions --- source/gameengine/Ketsji/KX_PythonSeq.cpp | 40 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp index c2ecf3b384f..cc8021fc2e4 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.cpp +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -20,7 +20,7 @@ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * The Original Code is: all of this file. + * The Original Code is: none of this file. * * Contributor(s): Campbell Barton * @@ -52,26 +52,26 @@ PyObject *KX_PythonSeq_CreatePyObject( PyObject *base, short type ) PyObject_DEL( self ); } -static int KX_PythonSeq_len( KX_PythonSeq * self ) +static Py_ssize_t KX_PythonSeq_len( PyObject * self ) { - PyObjectPlus *self_plus= BGE_PROXY_REF(self->base); + PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); if(self_plus==NULL) { PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); return -1; } - switch(self->type) { + switch(((KX_PythonSeq *)self)->type) { case KX_PYGENSEQ_CONT_TYPE_SENSORS: - return (int)(((SCA_IController *)self_plus)->GetLinkedSensors().size()); + return ((SCA_IController *)self_plus)->GetLinkedSensors().size(); case KX_PYGENSEQ_CONT_TYPE_ACTUATORS: - return (int)(((SCA_IController *)self_plus)->GetLinkedActuators().size()); + return ((SCA_IController *)self_plus)->GetLinkedActuators().size(); case KX_PYGENSEQ_OB_TYPE_SENSORS: - return (int)(((KX_GameObject *)self_plus)->GetSensors().size()); + return ((KX_GameObject *)self_plus)->GetSensors().size(); case KX_PYGENSEQ_OB_TYPE_CONTROLLERS: - return (int)(((KX_GameObject *)self_plus)->GetControllers().size()); + return ((KX_GameObject *)self_plus)->GetControllers().size(); case KX_PYGENSEQ_OB_TYPE_ACTUATORS: - return (int)(((KX_GameObject *)self_plus)->GetActuators().size()); + return ((KX_GameObject *)self_plus)->GetActuators().size(); default: /* Should never happen */ PyErr_SetString(PyExc_SystemError, "invalid type, internal error"); @@ -79,16 +79,16 @@ static int KX_PythonSeq_len( KX_PythonSeq * self ) } } -static PyObject *KX_PythonSeq_getIndex(KX_PythonSeq * self, int index) +static PyObject *KX_PythonSeq_getIndex(PyObject* self, int index) { - PyObjectPlus *self_plus= BGE_PROXY_REF(self->base); + PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); if(self_plus==NULL) { PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); return NULL; } - switch(self->type) { + switch(((KX_PythonSeq *)self)->type) { case KX_PYGENSEQ_CONT_TYPE_SENSORS: { vector& linkedsensors = ((SCA_IController *)self_plus)->GetLinkedSensors(); @@ -146,9 +146,9 @@ static PyObject *KX_PythonSeq_getIndex(KX_PythonSeq * self, int index) } -static PyObject * KX_PythonSeq_subscript(KX_PythonSeq * self, PyObject *key) +static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) { - PyObjectPlus *self_plus= BGE_PROXY_REF(self->base); + PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); char *name = NULL; if(self_plus==NULL) { @@ -165,7 +165,7 @@ static PyObject * KX_PythonSeq_subscript(KX_PythonSeq * self, PyObject *key) return NULL; } - switch(self->type) { + switch(((KX_PythonSeq *)self)->type) { case KX_PYGENSEQ_CONT_TYPE_SENSORS: { vector& linkedsensors = ((SCA_IController *)self_plus)->GetLinkedSensors(); @@ -228,8 +228,8 @@ static PyObject * KX_PythonSeq_subscript(KX_PythonSeq * self, PyObject *key) } static PyMappingMethods KX_PythonSeq_as_mapping = { - ( inquiry ) KX_PythonSeq_len, /* mp_length */ - ( binaryfunc ) KX_PythonSeq_subscript, /* mp_subscript */ + KX_PythonSeq_len, /* mp_length */ + KX_PythonSeq_subscript, /* mp_subscript */ 0, /* mp_ass_subscript */ }; @@ -238,7 +238,7 @@ static PyMappingMethods KX_PythonSeq_as_mapping = { * Initialize the interator index */ -static PyObject *KX_PythonSeq_getIter( KX_PythonSeq * self ) +static PyObject *KX_PythonSeq_getIter(KX_PythonSeq *self) { if(BGE_PROXY_REF(self->base)==NULL) { PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); @@ -260,9 +260,9 @@ static PyObject *KX_PythonSeq_getIter( KX_PythonSeq * self ) * Return next KX_PythonSeq iter. */ -static PyObject *KX_PythonSeq_nextIter( KX_PythonSeq * self ) +static PyObject *KX_PythonSeq_nextIter(KX_PythonSeq *self) { - PyObject *object = KX_PythonSeq_getIndex(self, self->iter); + PyObject *object = KX_PythonSeq_getIndex((PyObject *)self, self->iter); self->iter++; if( object==NULL ) { -- cgit v1.2.3 From 99849b659da72f11d2926150a3d0fdde72897aa4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 11 May 2009 12:06:53 +0000 Subject: Fix for bug #18683: GLSL refresh issue when adding lamp. There's still cases where this goes wrong, as noted in the release logs, this is just a temporary fix, in 2.5 can solve it properly with notifiers. --- source/blender/src/editobject.c | 1 + source/blender/src/previewrender.c | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'source') diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 2f127f9a3ec..b6b6c3c8df9 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -216,6 +216,7 @@ void add_object_draw(int type) /* for toolbox or menus, only non-editmode stuff else if(type==OB_LAMP) { BIF_undo_push("Add Lamp"); reshadeall_displist(); /* only frees */ + BIF_preview_changed(ID_LA); } else if(type==OB_LATTICE) BIF_undo_push("Add Lattice"); else if(type==OB_CAMERA) BIF_undo_push("Add Camera"); diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c index 8dfa32d48c8..21be4b2cf49 100644 --- a/source/blender/src/previewrender.c +++ b/source/blender/src/previewrender.c @@ -243,6 +243,13 @@ void BIF_preview_changed(short id_code) allqueue(REDRAWVIEW3D, 0); } } + + for(ma=G.main->mat.first; ma; ma=ma->id.next) { + if(ma->gpumaterial.first) { + GPU_material_free(ma); + allqueue(REDRAWVIEW3D, 0); + } + } } else if(OBACT) { Object *ob = OBACT; -- cgit v1.2.3 From ee1c29028d924c1ee7520d547da98b3fd88ece05 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 11 May 2009 12:41:48 +0000 Subject: BGE: Add MT_Vector3 support for Py attribute macro system. See KX_PYATTRIBUTE_VECTOR_... --- source/gameengine/Expressions/PyObjectPlus.cpp | 52 +++++++++++++- source/gameengine/Expressions/PyObjectPlus.h | 86 +++++++++++++---------- source/gameengine/Ketsji/KXNetwork/CMakeLists.txt | 1 + source/gameengine/Ketsji/KXNetwork/Makefile | 1 + source/gameengine/Ketsji/KXNetwork/SConscript | 2 +- 5 files changed, 102 insertions(+), 40 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 83c0b25df24..720094b6f98 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -50,6 +50,7 @@ #include "stdlib.h" #include "PyObjectPlus.h" #include "STR_String.h" +#include "MT_Vector3.h" /*------------------------------ * PyObjectPlus Type -- Every class, even the abstract one should have a Type ------------------------------*/ @@ -328,6 +329,16 @@ PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef float *val = reinterpret_cast(ptr); return PyFloat_FromDouble(*val); } + case KX_PYATTRIBUTE_TYPE_VECTOR: + { + PyObject* resultlist = PyList_New(3); + MT_Vector3 *val = reinterpret_cast(ptr); + for (unsigned int i=0; i<3; i++) + { + PyList_SET_ITEM(resultlist,i,PyFloat_FromDouble((*val)[i])); + } + return resultlist; + } case KX_PYATTRIBUTE_TYPE_STRING: { STR_String *val = reinterpret_cast(ptr); @@ -549,7 +560,7 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb } return (*attrdef->m_setFunction)(self, attrdef, value); } - if (attrdef->m_checkFunction != NULL) + if (attrdef->m_checkFunction != NULL || attrdef->m_type == KX_PYATTRIBUTE_TYPE_VECTOR) { // post check function is provided, prepare undo buffer sourceBuffer = ptr; @@ -573,6 +584,9 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb if (sourceBuffer) bufferSize = strlen(reinterpret_cast(sourceBuffer))+1; break; + case KX_PYATTRIBUTE_TYPE_VECTOR: + bufferSize = sizeof(MT_Vector3); + break; default: PyErr_Format(PyExc_AttributeError, "unknown type for attribute \"%s\", report to blender.org", attrdef->m_name); return 1; @@ -693,6 +707,42 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb *var = (float)val; break; } + case KX_PYATTRIBUTE_TYPE_VECTOR: + { + if (!PySequence_Check(value) || PySequence_Size(value) != 3) + { + PyErr_Format(PyExc_TypeError, "expected a sequence of 3 floats for attribute \"%s\"", attrdef->m_name); + return 1; + } + MT_Vector3 *var = reinterpret_cast(ptr); + for (int i=0; i<3; i++) + { + PyObject *item = PySequence_GetItem(value, i); /* new ref */ + // we can decrement the reference immediately, the reference count + // is at least 1 because the item is part of an array + Py_DECREF(item); + double val = PyFloat_AsDouble(item); + if (val == -1.0 && PyErr_Occurred()) + { + PyErr_Format(PyExc_TypeError, "expected a sequence of 3 floats for attribute \"%s\"", attrdef->m_name); + goto RESTORE_AND_ERROR; + } + else if (attrdef->m_clamp) + { + if (val < attrdef->m_fmin) + val = attrdef->m_fmin; + else if (val > attrdef->m_fmax) + val = attrdef->m_fmax; + } + else if (val < attrdef->m_fmin || val > attrdef->m_fmax) + { + PyErr_Format(PyExc_ValueError, "value out of range for attribute \"%s\"", attrdef->m_name); + goto RESTORE_AND_ERROR; + } + (*var)[i] = (MT_Scalar)val; + } + break; + } case KX_PYATTRIBUTE_TYPE_STRING: { STR_String *var = reinterpret_cast(ptr); diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index b69697f3290..45797fe7975 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -38,6 +38,7 @@ #include "KX_Python.h" #include "STR_String.h" +#include "MT_Vector3.h" #include "SG_QList.h" /*------------------------------ @@ -328,6 +329,7 @@ enum KX_PYATTRIBUTE_TYPE { KX_PYATTRIBUTE_TYPE_STRING, KX_PYATTRIBUTE_TYPE_DUMMY, KX_PYATTRIBUTE_TYPE_FUNCTION, + KX_PYATTRIBUTE_TYPE_VECTOR, }; enum KX_PYATTRIBUTE_ACCESS { @@ -365,97 +367,105 @@ typedef struct KX_PYATTRIBUTE_DEF { int *m_intPtr; float *m_floatPtr; STR_String *m_stringPtr; + MT_Vector3 *m_vectorPtr; } m_typeCheck; } PyAttributeDef; #define KX_PYATTRIBUTE_DUMMY(name) \ - { name, KX_PYATTRIBUTE_TYPE_DUMMY, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, 0, 0, 1, NULL, NULL, NULL, {NULL, NULL, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_DUMMY, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, 0, 0, 1, NULL, NULL, NULL, {NULL, NULL, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_BOOL_RW(name,object,field) \ - { name, KX_PYATTRIBUTE_TYPE_BOOL, KX_PYATTRIBUTE_RW, 0, 1, 0.f, 0.f, false, offsetof(object,field), 0, 1, NULL, NULL, NULL, {&((object *)0)->field, NULL, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_BOOL, KX_PYATTRIBUTE_RW, 0, 1, 0.f, 0.f, false, offsetof(object,field), 0, 1, NULL, NULL, NULL, {&((object *)0)->field, NULL, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_BOOL_RW_CHECK(name,object,field,function) \ - { name, KX_PYATTRIBUTE_TYPE_BOOL, KX_PYATTRIBUTE_RW, 0, 1, 0.f, 0.f, false, offsetof(object,field), 0, 1, &object::function, NULL, NULL, {&((object *)0)->field, NULL, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_BOOL, KX_PYATTRIBUTE_RW, 0, 1, 0.f, 0.f, false, offsetof(object,field), 0, 1, &object::function, NULL, NULL, {&((object *)0)->field, NULL, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_BOOL_RO(name,object,field) \ - { name, KX_PYATTRIBUTE_TYPE_BOOL, KX_PYATTRIBUTE_RO, 0, 1, 0.f, 0.f, false, offsetof(object,field), 0, 1, NULL, NULL, NULL, {&((object *)0)->field, NULL, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_BOOL, KX_PYATTRIBUTE_RO, 0, 1, 0.f, 0.f, false, offsetof(object,field), 0, 1, NULL, NULL, NULL, {&((object *)0)->field, NULL, NULL, NULL, NULL, NULL} } // enum field cannot be mapped to pointer (because we would need a pointer for each enum) // use field size to verify mapping at runtime only, assuming enum size is equal to int size. #define KX_PYATTRIBUTE_ENUM_RW(name,min,max,clamp,object,field) \ - { name, KX_PYATTRIBUTE_TYPE_ENUM, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), sizeof(((object *)0)->field), 1, NULL, NULL, NULL, {NULL, NULL, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_ENUM, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), sizeof(((object *)0)->field), 1, NULL, NULL, NULL, {NULL, NULL, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_ENUM_RW_CHECK(name,min,max,clamp,object,field,function) \ - { name, KX_PYATTRIBUTE_TYPE_ENUM, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), sizeof(((object *)0)->field), 1, &object::function, NULL, NULL, {NULL, NULL, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_ENUM, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), sizeof(((object *)0)->field), 1, &object::function, NULL, NULL, {NULL, NULL, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_ENUM_RO(name,object,field) \ - { name, KX_PYATTRIBUTE_TYPE_ENUM, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), sizeof(((object *)0)->field), 1, NULL, NULL, NULL, {NULL, NULL, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_ENUM, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), sizeof(((object *)0)->field), 1, NULL, NULL, NULL, {NULL, NULL, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_SHORT_RW(name,min,max,clamp,object,field) \ - { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, 1, NULL, NULL, NULL, {NULL, &((object *)0)->field, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, 1, NULL, NULL, NULL, {NULL, &((object *)0)->field, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_SHORT_RW_CHECK(name,min,max,clamp,object,field,function) \ - { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, 1, &object::function, NULL, NULL, {NULL, &((object *)0)->field, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, 1, &object::function, NULL, NULL, {NULL, &((object *)0)->field, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_SHORT_RO(name,object,field) \ - { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, 1, NULL, NULL, NULL, {NULL, &((object *)0)->field, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, 1, NULL, NULL, NULL, {NULL, &((object *)0)->field, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_SHORT_ARRAY_RW(name,min,max,clamp,object,field,length) \ - { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, ((object *)0)->field, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, ((object *)0)->field, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_SHORT_ARRAY_RW_CHECK(name,min,max,clamp,object,field,length,function) \ - { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, &object::function, NULL, NULL, {NULL, ((object *)0)->field, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, &object::function, NULL, NULL, {NULL, ((object *)0)->field, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_SHORT_ARRAY_RO(name,object,field,length) \ - { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, ((object *)0)->field, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, ((object *)0)->field, NULL, NULL, NULL, NULL} } // SHORT_LIST #define KX_PYATTRIBUTE_SHORT_LIST_RW(name,min,max,clamp,object,field,length) \ - { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, &((object *)0)->field, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, &((object *)0)->field, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_SHORT_LIST_RW_CHECK(name,min,max,clamp,object,field,length,function) \ - { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, &object::function, NULL, NULL, {NULL, &((object *)0)->field, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, &object::function, NULL, NULL, {NULL, &((object *)0)->field, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_SHORT_LIST_RO(name,object,field,length) \ - { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, &((object *)0)->field, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_SHORT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, &((object *)0)->field, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_INT_RW(name,min,max,clamp,object,field) \ - { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, 1, NULL, NULL, NULL, {NULL, NULL, &((object *)0)->field, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, 1, NULL, NULL, NULL, {NULL, NULL, &((object *)0)->field, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_INT_RW_CHECK(name,min,max,clamp,object,field,function) \ - { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, 1, &object::function, NULL, NULL, {NULL, NULL, &((object *)0)->field, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, 1, &object::function, NULL, NULL, {NULL, NULL, &((object *)0)->field, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_INT_RO(name,object,field) \ - { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, 1, NULL, NULL, NULL, {NULL, NULL, &((object *)0)->field, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, 1, NULL, NULL, NULL, {NULL, NULL, &((object *)0)->field, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_INT_ARRAY_RW(name,min,max,clamp,object,field,length) \ - { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, NULL, ((object *)0)->field, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, NULL, ((object *)0)->field, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_INT_ARRAY_RW_CHECK(name,min,max,clamp,object,field,length,function) \ - { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, &object::function, NULL, NULL, {NULL, NULL, ((object *)0)->field, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, &object::function, NULL, NULL, {NULL, NULL, ((object *)0)->field, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_INT_ARRAY_RO(name,object,field,length) \ - { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, NULL, ((object *)0)->field, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, NULL, ((object *)0)->field, NULL, NULL, NULL} } // INT_LIST #define KX_PYATTRIBUTE_INT_LIST_RW(name,min,max,clamp,object,field,length) \ - { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, NULL, &((object *)0)->field, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, NULL, &((object *)0)->field, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_INT_LIST_RW_CHECK(name,min,max,clamp,object,field,length,function) \ - { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, &object::function, NULL, NULL, {NULL, NULL, &((object *)0)->field, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, length, &object::function, NULL, NULL, {NULL, NULL, &((object *)0)->field, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_INT_LIST_RO(name,object,field,length) \ - { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, NULL, &((object *)0)->field, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_INT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, NULL, &((object *)0)->field, NULL, NULL, NULL} } // always clamp for float #define KX_PYATTRIBUTE_FLOAT_RW(name,min,max,object,field) \ - { name, KX_PYATTRIBUTE_TYPE_FLOAT, KX_PYATTRIBUTE_RW, 0, 0, min, max, true, offsetof(object,field), 0, 1, NULL, NULL, NULL, {NULL, NULL, NULL, &((object *)0)->field, NULL} } + { name, KX_PYATTRIBUTE_TYPE_FLOAT, KX_PYATTRIBUTE_RW, 0, 0, min, max, true, offsetof(object,field), 0, 1, NULL, NULL, NULL, {NULL, NULL, NULL, &((object *)0)->field, NULL, NULL} } #define KX_PYATTRIBUTE_FLOAT_RW_CHECK(name,min,max,object,field,function) \ - { name, KX_PYATTRIBUTE_TYPE_FLOAT, KX_PYATTRIBUTE_RW, 0, 0, min, max, true, offsetof(object,field), 0, 1, &object::function, NULL, NULL, {NULL, NULL, NULL, &((object *)0)->field, NULL} } + { name, KX_PYATTRIBUTE_TYPE_FLOAT, KX_PYATTRIBUTE_RW, 0, 0, min, max, true, offsetof(object,field), 0, 1, &object::function, NULL, NULL, {NULL, NULL, NULL, &((object *)0)->field, NULL, NULL} } #define KX_PYATTRIBUTE_FLOAT_RO(name,object,field) \ - { name, KX_PYATTRIBUTE_TYPE_FLOAT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, 1, NULL, NULL, NULL, {NULL, NULL, NULL, &((object *)0)->field, NULL} } + { name, KX_PYATTRIBUTE_TYPE_FLOAT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, 1, NULL, NULL, NULL, {NULL, NULL, NULL, &((object *)0)->field, NULL, NULL} } #define KX_PYATTRIBUTE_FLOAT_ARRAY_RW(name,min,max,object,field,length) \ - { name, KX_PYATTRIBUTE_TYPE_FLOAT, KX_PYATTRIBUTE_RW, 0, 0, min, max, true, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, NULL, NULL, ((object *)0)->field, NULL} } + { name, KX_PYATTRIBUTE_TYPE_FLOAT, KX_PYATTRIBUTE_RW, 0, 0, min, max, true, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, NULL, NULL, ((object *)0)->field, NULL, NULL} } #define KX_PYATTRIBUTE_FLOAT_ARRAY_RW_CHECK(name,min,max,object,field,length,function) \ - { name, KX_PYATTRIBUTE_TYPE_FLOAT, KX_PYATTRIBUTE_RW, 0, 0, min, max, true, offsetof(object,field), 0, length, &object::function, NULL, NULL, {NULL, NULL, NULL, ((object *)0)->field, NULL} } + { name, KX_PYATTRIBUTE_TYPE_FLOAT, KX_PYATTRIBUTE_RW, 0, 0, min, max, true, offsetof(object,field), 0, length, &object::function, NULL, NULL, {NULL, NULL, NULL, ((object *)0)->field, NULL, NULL} } #define KX_PYATTRIBUTE_FLOAT_ARRAY_RO(name,object,field,length) \ - { name, KX_PYATTRIBUTE_TYPE_FLOAT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, NULL, NULL, ((object *)0)->field, NULL} } + { name, KX_PYATTRIBUTE_TYPE_FLOAT, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, length, NULL, NULL, NULL, {NULL, NULL, NULL, ((object *)0)->field, NULL, NULL} } #define KX_PYATTRIBUTE_STRING_RW(name,min,max,clamp,object,field) \ - { name, KX_PYATTRIBUTE_TYPE_STRING, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, 1, NULL, NULL, NULL, {NULL, NULL, NULL, NULL, &((object *)0)->field} } + { name, KX_PYATTRIBUTE_TYPE_STRING, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, 1, NULL, NULL, NULL, {NULL, NULL, NULL, NULL, &((object *)0)->field, NULL} } #define KX_PYATTRIBUTE_STRING_RW_CHECK(name,min,max,clamp,object,field,function) \ - { name, KX_PYATTRIBUTE_TYPE_STRING, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, 1, &object::function, NULL, NULL, {NULL, NULL, NULL, NULL, &((object *)0)->field} } + { name, KX_PYATTRIBUTE_TYPE_STRING, KX_PYATTRIBUTE_RW, min, max, 0.f, 0.f, clamp, offsetof(object,field), 0, 1, &object::function, NULL, NULL, {NULL, NULL, NULL, NULL, &((object *)0)->field, NULL} } #define KX_PYATTRIBUTE_STRING_RO(name,object,field) \ - { name, KX_PYATTRIBUTE_TYPE_STRING, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, 1 , NULL, NULL, NULL, {NULL, NULL, NULL, NULL, &((object *)0)->field} } + { name, KX_PYATTRIBUTE_TYPE_STRING, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, 1 , NULL, NULL, NULL, {NULL, NULL, NULL, NULL, &((object *)0)->field, NULL} } + +#define KX_PYATTRIBUTE_VECTOR_RW(name,min,max,object,field) \ + { name, KX_PYATTRIBUTE_TYPE_VECTOR, KX_PYATTRIBUTE_RW, 0, 0, min, max, true, offsetof(object,field), 0, 1, NULL, NULL, NULL, {NULL, NULL, NULL, NULL, NULL, &((object *)0)->field} } +#define KX_PYATTRIBUTE_VECTOR_RW_CHECK(name,min,max,clamp,object,field,function) \ + { name, KX_PYATTRIBUTE_TYPE_VECTOR, KX_PYATTRIBUTE_RW, 0, 0, min, max, true, offsetof(object,field), 0, 1, &object::function, NULL, NULL, {NULL, NULL, NULL, NULL, NULL, &((object *)0)->field} } +#define KX_PYATTRIBUTE_VECTOR_RO(name,object,field) \ + { name, KX_PYATTRIBUTE_TYPE_VECTOR, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, offsetof(object,field), 0, 1 , NULL, NULL, NULL, {NULL, NULL, NULL, NULL, NULL, &((object *)0)->field} } #define KX_PYATTRIBUTE_RW_FUNCTION(name,object,getfunction,setfunction) \ - { name, KX_PYATTRIBUTE_TYPE_FUNCTION, KX_PYATTRIBUTE_RW, 0, 0, 0.f, 0.f, false, 0, 0, 1, NULL, &object::setfunction, &object::getfunction, {NULL, NULL, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_FUNCTION, KX_PYATTRIBUTE_RW, 0, 0, 0.f, 0.f, false, 0, 0, 1, NULL, &object::setfunction, &object::getfunction, {NULL, NULL, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_RO_FUNCTION(name,object,getfunction) \ - { name, KX_PYATTRIBUTE_TYPE_FUNCTION, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, 0, 0, 1, NULL, NULL, &object::getfunction, {NULL, NULL, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_FUNCTION, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0.f, false, 0, 0, 1, NULL, NULL, &object::getfunction, {NULL, NULL, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_ARRAY_RW_FUNCTION(name,object,length,getfunction,setfunction) \ - { name, KX_PYATTRIBUTE_TYPE_FUNCTION, KX_PYATTRIBUTE_RW, 0, 0, 0.f, 0,f, false, 0, 0, length, NULL, &object::setfunction, &object::getfunction, {NULL, NULL, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_FUNCTION, KX_PYATTRIBUTE_RW, 0, 0, 0.f, 0,f, false, 0, 0, length, NULL, &object::setfunction, &object::getfunction, {NULL, NULL, NULL, NULL, NULL, NULL} } #define KX_PYATTRIBUTE_ARRAY_RO_FUNCTION(name,object,length,getfunction) \ - { name, KX_PYATTRIBUTE_TYPE_FUNCTION, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0,f, false, 0, 0, length, NULL, NULL, &object::getfunction, {NULL, NULL, NULL, NULL, NULL} } + { name, KX_PYATTRIBUTE_TYPE_FUNCTION, KX_PYATTRIBUTE_RO, 0, 0, 0.f, 0,f, false, 0, 0, length, NULL, NULL, &object::getfunction, {NULL, NULL, NULL, NULL, NULL, NULL} } /*------------------------------ diff --git a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt index eb1d5fc67a3..999e7148039 100644 --- a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt +++ b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt @@ -30,6 +30,7 @@ SET(INC . ../../../../source/kernel/gen_system ../../../../intern/string + ../../../../intern/moto/include ../../../../source/gameengine/Ketsji ../../../../source/gameengine/GameLogic ../../../../source/gameengine/Expressions diff --git a/source/gameengine/Ketsji/KXNetwork/Makefile b/source/gameengine/Ketsji/KXNetwork/Makefile index ec3099611e0..8c626d344f5 100644 --- a/source/gameengine/Ketsji/KXNetwork/Makefile +++ b/source/gameengine/Ketsji/KXNetwork/Makefile @@ -38,6 +38,7 @@ CCFLAGS += $(LEVEL_1_CPP_WARNINGS) CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) CPPFLAGS += -I$(NAN_STRING)/include +CPPFLAGS += -I$(NAN_MOTO)/include CPPFLAGS += -I../../Expressions CPPFLAGS += -I../../GameLogic CPPFLAGS += -I../../Scenegraph diff --git a/source/gameengine/Ketsji/KXNetwork/SConscript b/source/gameengine/Ketsji/KXNetwork/SConscript index 9dc68669b4a..5d9dd1464b3 100644 --- a/source/gameengine/Ketsji/KXNetwork/SConscript +++ b/source/gameengine/Ketsji/KXNetwork/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('*.cpp') -incs = '. #source/kernel/gen_system #intern/string #source/gameengine/Ketsji' +incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/Ketsji' incs += ' #source/gameengine/GameLogic #source/gameengine/Expressions' incs += ' #source/gameengine/Network #source/gameengine/SceneGraph' -- cgit v1.2.3 From 0c6ec76a4c7de61e84cc4dddbbda1698b7bf2a4b Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Mon, 11 May 2009 15:34:46 +0000 Subject: Fix Makefiles for gameengine. --- source/gameengine/Expressions/Makefile | 2 +- source/gameengine/GameLogic/Joystick/Makefile | 2 +- source/gameengine/GameLogic/Makefile | 2 +- source/gameengine/Ketsji/KXNetwork/Makefile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/Makefile b/source/gameengine/Expressions/Makefile index a1400c4e461..f46c0037200 100644 --- a/source/gameengine/Expressions/Makefile +++ b/source/gameengine/Expressions/Makefile @@ -41,5 +41,5 @@ CPPFLAGS += -I../../blender/makesdna CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include CPPFLAGS += -I../../kernel/gen_system -CPPFLAGS += -I../../gameengine/Scenegraph +CPPFLAGS += -I../../gameengine/SceneGraph diff --git a/source/gameengine/GameLogic/Joystick/Makefile b/source/gameengine/GameLogic/Joystick/Makefile index 7016f1ed16f..02def1cec62 100644 --- a/source/gameengine/GameLogic/Joystick/Makefile +++ b/source/gameengine/GameLogic/Joystick/Makefile @@ -40,5 +40,5 @@ CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) CPPFLAGS += $(NAN_SDLCFLAGS) - +CPPFLAGS += -I../../SceneGraph CPPFLAGS += -I../../../kernel/gen_system diff --git a/source/gameengine/GameLogic/Makefile b/source/gameengine/GameLogic/Makefile index 6e9af674549..a1794a60452 100644 --- a/source/gameengine/GameLogic/Makefile +++ b/source/gameengine/GameLogic/Makefile @@ -39,7 +39,7 @@ include nan_compile.mk CCFLAGS += $(LEVEL_1_CPP_WARNINGS) CPPFLAGS += -I../Expressions -CPPFLAGS += -I../Scenegraph +CPPFLAGS += -I../SceneGraph CPPFLAGS += -I../Rasterizer CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include diff --git a/source/gameengine/Ketsji/KXNetwork/Makefile b/source/gameengine/Ketsji/KXNetwork/Makefile index 8c626d344f5..365ed8fc9c3 100644 --- a/source/gameengine/Ketsji/KXNetwork/Makefile +++ b/source/gameengine/Ketsji/KXNetwork/Makefile @@ -41,7 +41,7 @@ CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include CPPFLAGS += -I../../Expressions CPPFLAGS += -I../../GameLogic -CPPFLAGS += -I../../Scenegraph +CPPFLAGS += -I../../SceneGraph CPPFLAGS += -I../../Network CPPFLAGS += -I../../../kernel/gen_system CPPFLAGS += -I.. -- cgit v1.2.3 From c24a81a29385f177771e1d1957c8980e25e0856d Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Mon, 11 May 2009 16:57:54 +0000 Subject: Remove incorrect "w" attribute from Eulers, gave warning in epydocs. --- source/blender/python/api2_2x/doc/Mathutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/doc/Mathutils.py b/source/blender/python/api2_2x/doc/Mathutils.py index 7ca10c53d02..d8492558317 100644 --- a/source/blender/python/api2_2x/doc/Mathutils.py +++ b/source/blender/python/api2_2x/doc/Mathutils.py @@ -546,7 +546,7 @@ class Euler: The Euler object ================ This object gives access to Eulers in Blender. - @group Axises: x, y, z, w + @group Axises: x, y, z @ivar x: The heading value in degrees. @ivar y: The pitch value in degrees. @ivar z: The roll value in degrees. -- cgit v1.2.3 From 0aeaf08242631cd53a2d1065b3a7686d0022d77c Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Mon, 11 May 2009 19:19:36 +0000 Subject: Ugh, yet another try to fix [#18697] 2.49RC1: Keyed Particles fine in viewport but give me a crash during render. Hopefully it's now fixed for good. --- source/blender/blenkernel/intern/particle.c | 12 +++++++++++- source/blender/blenkernel/intern/particle_system.c | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 0ebdcdf58e0..41ce23347a3 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -351,8 +351,18 @@ void free_hair(ParticleSystem *psys, int softbody) } void free_keyed_keys(ParticleSystem *psys) { - if(psys->particles && psys->particles->keys) + ParticleData *pa; + int i; + + if(psys->particles && psys->particles->keys) { MEM_freeN(psys->particles->keys); + + for(i=0, pa=psys->particles; itotpart; i++, pa++) + if(pa->keys) { + pa->keys= NULL; + pa->totkey= 0; + } + } } void free_child_path_cache(ParticleSystem *psys) { diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index f74e32acdbf..3445556b53b 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -203,7 +203,7 @@ static void realloc_particles(Object *ob, ParticleSystem *psys, int new_totpart) if(psys->particles->keys) MEM_freeN(psys->particles->keys); - for(i=totsaved, pa=psys->particles+totsaved; itotpart; i++, pa++) + for(i=0, pa=psys->particles; itotpart; i++, pa++) if(pa->keys) { pa->keys= NULL; pa->totkey= 0; -- cgit v1.2.3 From e847bcf784f2f5b8006d836789fb0c42a0d68e35 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 11 May 2009 21:35:38 +0000 Subject: BGE Doc updates thanks to Roelf de Kock --- Notes from Roelf, maybe some other BGE devs could help resolve these Here is what I have so far. I've left "TODO's" were there needs to be some more comments. The following things also need to be resolved: -KX_VehicleWrapper.getWheelOrientationQuaternion looks like it should return a quaternion but if I look at the code it looks like it returns a rotation matrix. -I still need to find out what exactly KX_VehicleWrapper.getWheelRotation is. I've got the return type but I would like to add some explanation for what it actualy means (and units if any). -BL_Shader.setNumberOfPasses ignores the parameter but from the comment in the code it looks like the parameter that is being set (it is harcoded to be =1) in setNumberOfPasses is not used. So I'm not sure if this method should be documented at all. --- source/gameengine/PyDoc/BL_Shader.py | 307 +++++++++++---------- source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py | 63 +++-- source/gameengine/PyDoc/KX_VehicleWrapper.py | 174 ++++++------ source/gameengine/PyDoc/epy_docgen.sh | 2 +- 4 files changed, 283 insertions(+), 263 deletions(-) (limited to 'source') diff --git a/source/gameengine/PyDoc/BL_Shader.py b/source/gameengine/PyDoc/BL_Shader.py index 10e8b7c94ef..8fd4ae7c7ac 100644 --- a/source/gameengine/PyDoc/BL_Shader.py +++ b/source/gameengine/PyDoc/BL_Shader.py @@ -5,227 +5,244 @@ class BL_Shader(PyObjectPlus): """ BL_Shader GLSL shaders. - All placeholders have a __ prefix + TODO - Description """ - def __setUniformfv(val): + def setUniformfv(name, fList): """ - TODO - Description + Set a uniform with a list of float values - @param val: the starting frame of the animation - @type val: float + @param name: the uniform name + @type name: string - @rtype: integer - @return: TODO Description + @param fList: a list (2, 3 or 4 elements) of float values + @type fList: list[float] """ - def __delSource(val): + def delSource(): """ TODO - Description - - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description + """ - def __getFragmentProg(val): + def getFragmentProg(): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float + Returns the fragment program. - @rtype: integer - @return: TODO Description + @rtype: string + @return: The fragment program. """ - def __getVertexProg(val): + def getVertexProg(): """ - TODO - Description + Get the vertex program. - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description + @rtype: string + @return: The vertex program. """ - def __isValid(val): + def isValid(): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description + Check if the shader is valid. + + @rtype: bool + @return: True if the shader is valid """ - def __setAttrib(val): + def setAttrib(enum): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float + Set attribute location. (The parameter is ignored a.t.m. and the value of "tangent" is always used.) - @rtype: integer - @return: TODO Description + @param enum: attribute location value + @type enum: integer """ - def __setNumberOfPasses(val): + def setNumberOfPasses( max_pass ): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float + Set the maximum number of passes. Not used a.t.m. - @rtype: integer - @return: TODO Description + @param max_pass: the maximum number of passes + @type max_pass: integer """ - def __setSampler(val): + def setSampler(name, index): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float + Set uniform texture sample index. - @rtype: integer - @return: TODO Description + @param name: Uniform name + @type name: string + + @param index: Texture sample index. + @type index: integer """ - def __setSource(val): + def setSource(vertexProgram, fragmentProgram): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float + Set the vertex and fragment programs - @rtype: integer - @return: TODO Description + @param vertexProgram: Vertex program + @type vertexProgram: string + + @param fragmentProgram: Fragment program + @type fragmentProgram: string """ - def __setUniform1f(val): + def setUniform1f(name, fx): """ - TODO - Description + Set a uniform with 1 float value. - @param val: the starting frame of the animation - @type val: float + @param name: the uniform name + @type name: string - @rtype: integer - @return: TODO Description + @param fx: Uniform value + @type fx: float """ - def __setUniform1i(val): + def setUniform1i(name, ix): """ - TODO - Description + Set a uniform with an integer value. - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description + @param name: the uniform name + @type name: string + + @param ix: the uniform value + @type ix: integer """ - def __setUniform2f(val): + def setUniform2f(name, fx, fy): """ - TODO - Description + Set a uniform with 2 float values - @param val: the starting frame of the animation - @type val: float + @param name: the uniform name + @type name: string + + @param fx: first float value + @type fx: float - @rtype: integer - @return: TODO Description + @param fy: second float value + @type fy: float """ - def __setUniform2i(val): + def setUniform2i(name, ix, iy): """ - TODO - Description + Set a uniform with 2 integer values - @param val: the starting frame of the animation - @type val: float + @param name: the uniform name + @type name: string + + @param ix: first integer value + @type ix: integer - @rtype: integer - @return: TODO Description + @param iy: second integer value + @type iy: integer """ - def __setUniform3f(val): + def setUniform3f(name, fx,fy,fz): """ - TODO - Description + Set a uniform with 3 float values. - @param val: the starting frame of the animation - @type val: float + @param name: the uniform name + @type name: string + + @param fx: first float value + @type fx: float - @rtype: integer - @return: TODO Description + @param fy: second float value + @type fy: float + + @param fz: third float value + @type fz: float """ - def __setUniform3i(val): + def setUniform3i(name, ix,iy,iz): """ - TODO - Description + Set a uniform with 3 integer values - @param val: the starting frame of the animation - @type val: float + @param name: the uniform name + @type name: string + + @param ix: first integer value + @type ix: integer + + @param iy: second integer value + @type iy: integer - @rtype: integer - @return: TODO Description + @param iz: third integer value + @type iz: integer """ - def __setUniform4f(val): + def setUniform4f(name, fx,fy,fz,fw): """ - TODO - Description + Set a uniform with 4 float values. - @param val: the starting frame of the animation - @type val: float + @param name: the uniform name + @type name: string + + @param fx: first float value + @type fx: float - @rtype: integer - @return: TODO Description + @param fy: second float value + @type fy: float + + @param fz: third float value + @type fz: float + + @param fw: fourth float value + @type fw: float """ - def __setUniform4i(val): + def setUniform4i(name, ix,iy,iz, iw): """ - TODO - Description + Set a uniform with 4 integer values - @param val: the starting frame of the animation - @type val: float + @param name: the uniform name + @type name: string + + @param ix: first integer value + @type ix: integer + + @param iy: second integer value + @type iy: integer - @rtype: integer - @return: TODO Description + @param iz: third integer value + @type iz: integer + + @param iw: fourth integer value + @type iw: integer """ - def __setUniformDef(val): + def setUniformDef(name, type): """ - TODO - Description + Define a new uniform - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description + @param name: the uniform name + @type name: string + + @param type: uniform type + @type type: UNI_NONE, UNI_INT, UNI_FLOAT, UNI_INT2, UNI_FLOAT2, UNI_INT3, UNI_FLOAT3, UNI_INT4, UNI_FLOAT4, UNI_MAT3, UNI_MAT4, UNI_MAX """ - def __setUniformMatrix3(val): + def setUniformMatrix3(name, mat, transpose): """ - TODO - Description + Set a uniform with a 3x3 matrix value - @param val: the starting frame of the animation - @type val: float + @param name: the uniform name + @type name: string + + @param mat: A 3x3 matrix [[f,f,f], [f,f,f], [f,f,f]] + @type mat: 3x3 matrix - @rtype: integer - @return: TODO Description + @param transpose: set to True to transpose the matrix + @type transpose: bool """ - def __setUniformMatrix4(val): + def setUniformMatrix4(name, mat, transpose): """ - TODO - Description + Set a uniform with a 4x4 matrix value - @param val: the starting frame of the animation - @type val: float + @param name: the uniform name + @type name: string + + @param mat: A 4x4 matrix [[f,f,f,f], [f,f,f,f], [f,f,f,f], [f,f,f,f]] + @type mat: 4x4 matrix - @rtype: integer - @return: TODO Description + @param transpose: set to True to transpose the matrix + @type transpose: bool """ - def __setUniformiv(val): + def setUniformiv(name, iList): """ - TODO - Description + Set a uniform with a list of integer values - @param val: the starting frame of the animation - @type val: float + @param name: the uniform name + @type name: string - @rtype: integer - @return: TODO Description + @param iList: a list (2, 3 or 4 elements) of integer values + @type iList: list[integer] """ - def __validate(val): + def validate(): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float + Validate the shader object. - @rtype: integer - @return: TODO Description """ diff --git a/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py b/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py index ea9a2a3a411..4cbdbf7cebb 100644 --- a/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py +++ b/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py @@ -4,46 +4,57 @@ class KX_PhysicsObjectWrapper(PyObjectPlus): """ KX_PhysicsObjectWrapper - All placeholders have a __ prefix """ - def __setActive(val): + def setActive(active): """ - TODO - Description + Set the object to be active. - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description + @param active: set to True to be active + @type active: bool """ - def __setAngularVelocity(val): + def setAngularVelocity(x, y, z, local): """ - TODO - Description + Set the angular velocity of the object. + + @param x: angular velocity for the x-axis + @type x: float + + @param y: angular velocity for the y-axis + @type y: float - @param val: the starting frame of the animation - @type val: float + @param z: angular velocity for the z-axis + @type z: float - @rtype: integer - @return: TODO Description + @param local: set to True for local axis + @type local: bool """ - def __setLinearVelocity(val): + def setLinearVelocity(x, y, z, local): """ - TODO - Description + Set the linear velocity of the object. - @param val: the starting frame of the animation - @type val: float + @param x: linear velocity for the x-axis + @type x: float - @rtype: integer - @return: TODO Description + @param y: linear velocity for the y-axis + @type y: float + + @param z: linear velocity for the z-axis + @type z: float + + @param local: set to True for local axis + @type local: bool """ - def __setPosition(val): + def setPosition(x, y, z): """ - TODO - Description + Set the position of the object + + @param x: x coordinate + @type x: float - @param val: the starting frame of the animation - @type val: float + @param y: y coordinate + @type y: float - @rtype: integer - @return: TODO Description + @param z: z coordinate + @type z: float """ diff --git a/source/gameengine/PyDoc/KX_VehicleWrapper.py b/source/gameengine/PyDoc/KX_VehicleWrapper.py index 3d91b7db676..86991634f2d 100644 --- a/source/gameengine/PyDoc/KX_VehicleWrapper.py +++ b/source/gameengine/PyDoc/KX_VehicleWrapper.py @@ -4,13 +4,13 @@ class KX_VehicleWrapper(PyObjectPlus): """ KX_VehicleWrapper - All placeholders have a __ prefix + TODO - description """ def addWheel(wheel, attachPos, attachDir, axleDir, suspensionRestLength, wheelRadius, hasSteering): """ - TODO - Description + Add a wheel to the vehicle @param wheel: The object to use as a wheel. @type wheel: L{KX_GameObject} or a KX_GameObject name @@ -26,143 +26,135 @@ class KX_VehicleWrapper(PyObjectPlus): @type wheelRadius: float """ - def __applyBraking(val): + def applyBraking(force, wheelIndex): """ - TODO - Description + Apply a braking force to the specified wheel - @param val: the starting frame of the animation - @type val: float + @param force: the brake force + @type force: float - @rtype: integer - @return: TODO Description + @param wheelIndex: index of the wheel where the force needs to be applied + @type wheelIndex: integer """ - def __applyEngineForce(val): + def applyEngineForce(force, wheelIndex): """ - TODO - Description + Apply an engine force to the specified wheel - @param val: the starting frame of the animation - @type val: float + @param force: the engine force + @type force: float - @rtype: integer - @return: TODO Description + @param wheelIndex: index of the wheel where the force needs to be applied + @type wheelIndex: integer """ - def __getConstraintId(val): + def getConstraintId(): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float + Get the constraint ID @rtype: integer - @return: TODO Description + @return: the constraint id """ - def __getConstraintType(val): + def getConstraintType(): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float + Returns the constraint type. @rtype: integer - @return: TODO Description + @return: constraint type """ - def __getNumWheels(val): + def getNumWheels(): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float + Returns the number of wheels. @rtype: integer - @return: TODO Description + @return: the number of wheels for this vehicle """ - def __getWheelOrientationQuaternion(val): + def getWheelOrientationQuaternion(wheelIndex): """ - TODO - Description + Returns the wheel orientation as a quaternion. - @param val: the starting frame of the animation - @type val: float + @param wheelIndex: the wheel index + @type wheelIndex: integer - @rtype: integer + @rtype: TODO - type should be quat as per method name but from the code it looks like a matrix @return: TODO Description """ - def __getWheelPosition(val): + def getWheelPosition(wheelIndex): """ - TODO - Description + Returns the position of the specified wheel - @param val: the starting frame of the animation - @type val: float + @param wheelIndex: the wheel index + @type wheelIndex: integer - @rtype: integer - @return: TODO Description + @rtype: list[x, y, z] + @return: position vector """ - def __getWheelRotation(val): + def getWheelRotation(wheelIndex): """ - TODO - Description + Returns the rotation of the specified wheel - @param val: the starting frame of the animation - @type val: float + @param wheelIndex: the wheel index + @type wheelIndex: integer - @rtype: integer - @return: TODO Description + @rtype: float + @return: the wheel rotation """ - def __setRollInfluence(val): + def setRollInfluence(rollInfluece, wheelIndex): """ - TODO - Description + Set the specified wheel's roll influence. + The higher the roll influence the more the vehicle will tend to roll over in corners. - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description + @param rollInfluece: the wheel roll influence + @type rollInfluece: float + + @param wheelIndex: the wheel index + @type wheelIndex: integer """ - def __setSteeringValue(val): + def setSteeringValue(steering, wheelIndex): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float + Set the specified wheel's steering - @rtype: integer - @return: TODO Description + @param steering: the wheel steering + @type steering: float + + @param wheelIndex: the wheel index + @type wheelIndex: integer """ - def __setSuspensionCompression(val): + def setSuspensionCompression(compression, wheelIndex): """ - TODO - Description + Set the specified wheel's compression - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description + @param compression: the wheel compression + @type compression: float + + @param wheelIndex: the wheel index + @type wheelIndex: integer """ - def __setSuspensionDamping(val): + def setSuspensionDamping(damping, wheelIndex): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float + Set the specified wheel's damping - @rtype: integer - @return: TODO Description + @param damping: the wheel damping + @type damping: float + + @param wheelIndex: the wheel index + @type wheelIndex: integer """ - def __setSuspensionStiffness(val): + def setSuspensionStiffness(stiffness, wheelIndex): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float + Set the specified wheel's stiffness - @rtype: integer - @return: TODO Description + @param stiffness: the wheel stiffness + @type stiffness: float + + @param wheelIndex: the wheel index + @type wheelIndex: integer """ - def __setTyreFriction(val): + def setTyreFriction(friction, wheelIndex): """ - TODO - Description + Set the specified wheel's tyre friction - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description + @param friction: the tyre friction + @type friction: float + + @param wheelIndex: the wheel index + @type wheelIndex: integer """ diff --git a/source/gameengine/PyDoc/epy_docgen.sh b/source/gameengine/PyDoc/epy_docgen.sh index ddf39dcc081..0872d2abbbd 100755 --- a/source/gameengine/PyDoc/epy_docgen.sh +++ b/source/gameengine/PyDoc/epy_docgen.sh @@ -8,4 +8,4 @@ LC_ALL=POSIX epydoc --debug -v -o BPY_GE --url "http://www.blender.org" --top GameLogic \ - --name "Blender GameEngine" --no-private --no-frames --no-sourcecode --inheritance=included *.py + --name "Blender GameEngine" --no-private --no-sourcecode --inheritance=included *.py -- cgit v1.2.3 From 24906dc9626c0acb40d8ee77070df7f95b58e0ce Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 11 May 2009 22:07:30 +0000 Subject: BGE #18724: Modifier cause crash in 2.49RC2. My bad, I was too quick to fix the soft body problem in revision 20119. This time I tested against modifiers, soft body, armatures and replace mesh. --- source/gameengine/Converter/BL_BlenderDataConversion.cpp | 7 ++----- source/gameengine/Converter/BL_DeformableGameObject.cpp | 13 +++++++++++++ source/gameengine/Converter/BL_DeformableGameObject.h | 5 +---- 3 files changed, 16 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 7d0bbbe107c..09604e5c2e3 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -2121,8 +2121,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, //tf.Add(gameobj->GetSGNode()); gameobj->NodeUpdateGS(0); - //move to after finishing everything so that soft body deformer is included - //gameobj->AddMeshUser(); + gameobj->AddMeshUser(); } else @@ -2312,8 +2311,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, //tf.Add(gameobj->GetSGNode()); gameobj->NodeUpdateGS(0); - //move to after finishing everything so that soft body deformer is included - //gameobj->AddMeshUser(); + gameobj->AddMeshUser(); } else { @@ -2665,7 +2663,6 @@ void BL_ConvertBlenderObjects(struct Main* maggie, { KX_GameObject* gameobj = static_cast(objectlist->GetValue(i)); gameobj->ResetState(); - gameobj->AddMeshUser(); } #endif //CONVERT_LOGIC diff --git a/source/gameengine/Converter/BL_DeformableGameObject.cpp b/source/gameengine/Converter/BL_DeformableGameObject.cpp index a9d5b643fd4..cb882f31e80 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.cpp +++ b/source/gameengine/Converter/BL_DeformableGameObject.cpp @@ -30,6 +30,8 @@ #include "BL_DeformableGameObject.h" #include "BL_ShapeDeformer.h" #include "BL_ShapeActionActuator.h" +#include "RAS_MaterialBucket.h" + #ifdef HAVE_CONFIG_H #include @@ -101,3 +103,14 @@ bool BL_DeformableGameObject::GetShape(vector &shape) return !shape.empty(); } +void BL_DeformableGameObject::SetDeformer(class RAS_Deformer* deformer) +{ + m_pDeformer = deformer; + + SG_QList::iterator mit(m_meshSlots); + for(mit.begin(); !mit.end(); ++mit) + { + (*mit)->SetDeformer(deformer); + } +} + diff --git a/source/gameengine/Converter/BL_DeformableGameObject.h b/source/gameengine/Converter/BL_DeformableGameObject.h index dbc89bd2a20..b20b8e81b37 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.h +++ b/source/gameengine/Converter/BL_DeformableGameObject.h @@ -83,10 +83,7 @@ public: return (m_pDeformer) ? ((BL_MeshDeformer*)m_pDeformer)->GetMesh()->key : NULL; } - virtual void SetDeformer(class RAS_Deformer* deformer) - { - m_pDeformer = deformer; - } + virtual void SetDeformer(class RAS_Deformer* deformer); virtual class RAS_Deformer* GetDeformer() { return m_pDeformer; -- cgit v1.2.3 From b75268d412cdce0867a12e4234fd3843d44c5cba Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 11 May 2009 22:17:58 +0000 Subject: problem with unloading modules, py modules would be refreshed but external modules that were pyc or pyo's would be kept. This made it not refresh the module when taking an external BGE Module and making it internal because the external pyc would never be freed so the internal text wouldn't get used until restarting blender. --- source/blender/python/api2_2x/bpy_internal_import.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/bpy_internal_import.c b/source/blender/python/api2_2x/bpy_internal_import.c index 125993cc425..3bc90eb4f54 100644 --- a/source/blender/python/api2_2x/bpy_internal_import.c +++ b/source/blender/python/api2_2x/bpy_internal_import.c @@ -316,7 +316,7 @@ void bpy_text_clear_modules(int clear_all) if(fname) { if (clear_all || ((strstr(fname, SEPSTR))==0)) { /* no path ? */ file_extension = strstr(fname, ".py"); - if(file_extension && *(file_extension + 3) == '\0') { /* .py extension ? */ + if(file_extension && (*(file_extension + 3) == '\0' || *(file_extension + 4) == '\0')) { /* .py or pyc extension? */ /* now we can be fairly sure its a python import from the blendfile */ PyList_Append(list, key); /* free'd with the list */ } -- cgit v1.2.3 From 75b7bcab7711043e3475d8ef8d80770ed57abeda Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Mon, 11 May 2009 22:27:06 +0000 Subject: Python API ---------- Patch by Jean-michel Soler (jms) to support ShrinkWrap and SimpleDeform modifiers. --- source/blender/python/api2_2x/Modifier.c | 248 +++++++++++++++++++++++++- source/blender/python/api2_2x/doc/Modifier.py | 49 +++-- 2 files changed, 276 insertions(+), 21 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Modifier.c b/source/blender/python/api2_2x/Modifier.c index b43c810b435..49220bcd05e 100644 --- a/source/blender/python/api2_2x/Modifier.c +++ b/source/blender/python/api2_2x/Modifier.c @@ -64,17 +64,19 @@ enum mod_constants { EXPP_MOD_ONCAGE, /*GENERIC*/ - EXPP_MOD_OBJECT, /*ARMATURE, LATTICE, CURVE, BOOLEAN, ARRAY*/ - EXPP_MOD_VERTGROUP, /*ARMATURE, LATTICE, CURVE, SMOOTH, CAST*/ + EXPP_MOD_OBJECT, /*ARMATURE, LATTICE, CURVE, BOOLEAN, ARRAY, + SHRINKWRAP, SIMPLEDEFORM*/ + EXPP_MOD_VERTGROUP, /*ARMATURE, LATTICE, CURVE, SMOOTH, CAST, + SHRINKWRAP, SIMPLEDEFORM */ EXPP_MOD_LIMIT, /*ARRAY, MIRROR*/ EXPP_MOD_FLAG, /*MIRROR, WAVE*/ EXPP_MOD_COUNT, /*DECIMATOR, ARRAY*/ EXPP_MOD_LENGTH, /*BUILD, ARRAY*/ - EXPP_MOD_FACTOR, /*SMOOTH, CAST*/ + EXPP_MOD_FACTOR, /*SMOOTH, CAST, SIMPLEDEFORM*/ EXPP_MOD_ENABLE_X, /*SMOOTH, CAST*/ EXPP_MOD_ENABLE_Y, /*SMOOTH, CAST*/ EXPP_MOD_ENABLE_Z, /*SMOOTH, CAST*/ - EXPP_MOD_TYPES, /*SUBSURF, CAST*/ + EXPP_MOD_TYPES, /*SUBSURF, CAST, SHRINKWRAP, SIMPLEDEFORM*/ /*SUBSURF SPECIFIC*/ EXPP_MOD_LEVELS, @@ -144,8 +146,29 @@ enum mod_constants { EXPP_MOD_RADIUS, EXPP_MOD_SIZE, EXPP_MOD_USE_OB_TRANSFORM, - EXPP_MOD_SIZE_FROM_RADIUS - + EXPP_MOD_SIZE_FROM_RADIUS, + + /* SHRINKWRAP*/ + EXPP_MOD_OBJECT_AUX, + EXPP_MOD_KEEPDIST, + EXPP_MOD_PROJECT_OVER_X_AXIS, + EXPP_MOD_PROJECT_OVER_Y_AXIS, + EXPP_MOD_PROJECT_OVER_Z_AXIS, + EXPP_MOD_PROJECT_OVER_NORMAL, + EXPP_MOD_SUBSURFLEVELS, + EXPP_MOD_ALLOW_POS_DIR, + EXPP_MOD_ALLOW_NEG_DIR, + EXPP_MOD_CULL_TARGET_FRONTFACE, + EXPP_MOD_CULL_TARGET_BACKFACE, + EXPP_MOD_KEEP_ABOVE_SURFACE, + + /* SIMPLEDEFORM*/ + EXPP_MOD_RELATIVE, + EXPP_MOD_LOWER_LIMIT, + EXPP_MOD_UPPER_LIMIT, + EXPP_MOD_LOCK_AXIS_X, + EXPP_MOD_LOCK_AXIS_Y + /* yet to be implemented */ /* EXPP_MOD_HOOK_,*/ /* , */ @@ -989,6 +1012,43 @@ static PyObject *shrinkwrap_getter( BPy_Modifier * self, int type ) switch( type ) { case EXPP_MOD_OBJECT: return Object_CreatePyObject( md->target ); + case EXPP_MOD_OBJECT_AUX: + return Object_CreatePyObject( md->auxTarget ); + case EXPP_MOD_VERTGROUP: + return PyString_FromString( md->vgroup_name ) ; + case EXPP_MOD_TYPES: + return PyInt_FromLong( (long)md->shrinkType ); + case EXPP_MOD_ALLOW_POS_DIR: + return PyBool_FromLong( ( long ) + ( md->shrinkOpts & MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR) ) ; + case EXPP_MOD_ALLOW_NEG_DIR: + return PyBool_FromLong( ( long ) + ( md->shrinkOpts & MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR) ) ; + case EXPP_MOD_CULL_TARGET_FRONTFACE: + return PyBool_FromLong( ( long ) + ( md->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) ) ; + case EXPP_MOD_CULL_TARGET_BACKFACE: + return PyBool_FromLong( ( long ) + ( md->shrinkOpts & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) ) ; + case EXPP_MOD_KEEP_ABOVE_SURFACE: + return PyBool_FromLong( ( long ) + ( md->shrinkOpts & MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE) ) ; + case EXPP_MOD_KEEPDIST: + return PyFloat_FromDouble( (double)md->keepDist ); + case EXPP_MOD_PROJECT_OVER_X_AXIS: + return PyBool_FromLong( ( long ) + ( md->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS) ) ; + case EXPP_MOD_PROJECT_OVER_Y_AXIS: + return PyBool_FromLong( ( long ) + ( md->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS) ) ; + case EXPP_MOD_PROJECT_OVER_Z_AXIS: + return PyBool_FromLong( ( long ) + ( md->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS) ) ; + case EXPP_MOD_PROJECT_OVER_NORMAL: + return PyBool_FromLong( ( long ) + ( md->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) ) ; + case EXPP_MOD_SUBSURFLEVELS: + return PyInt_FromLong( ( long )md->subsurfLevels ); default: return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" ); } @@ -1012,11 +1072,144 @@ static int shrinkwrap_setter( BPy_Modifier *self, int type, PyObject *value ) } return 0; } + case EXPP_MOD_OBJECT_AUX: { + Object *ob_new=NULL; + if (value == Py_None) { + md->auxTarget = NULL; + } else if (BPy_Object_Check( value )) { + ob_new = ((( BPy_Object * )value)->object); + md->auxTarget = ob_new; + } else { + return EXPP_ReturnIntError( PyExc_TypeError, + "Expected an Object or None value" ); + } + return 0; + } + case EXPP_MOD_VERTGROUP:{ + char *defgrp_name = PyString_AsString( value ); + if( !defgrp_name ) + return EXPP_ReturnIntError( PyExc_TypeError, + "expected string arg" ); + BLI_strncpy( md->vgroup_name, defgrp_name, sizeof( md->vgroup_name ) ); + return 0; + } + case EXPP_MOD_TYPES: + return EXPP_setIValueRange( value, &md->shrinkType, 0, + MOD_SHRINKWRAP_NEAREST_VERTEX, 'h' ); + case EXPP_MOD_KEEPDIST: + return EXPP_setFloatClamped( value, &md->keepDist, -1000.0, +1000.0 ); + case EXPP_MOD_PROJECT_OVER_X_AXIS: + return EXPP_setBitfield( value, &md->projAxis, + MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS, 'h' ); + case EXPP_MOD_PROJECT_OVER_Y_AXIS: + return EXPP_setBitfield( value, &md->projAxis, + MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS, 'h' ); + case EXPP_MOD_PROJECT_OVER_Z_AXIS: + return EXPP_setBitfield( value, &md->projAxis, + MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS, 'h' ); + case EXPP_MOD_PROJECT_OVER_NORMAL: + return EXPP_setBitfield( value, &md->projAxis, + MOD_SHRINKWRAP_PROJECT_OVER_NORMAL, 'h' ); + + case EXPP_MOD_ALLOW_POS_DIR: + return EXPP_setBitfield( value, &md->shrinkOpts, + MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR, 'h' ); + case EXPP_MOD_ALLOW_NEG_DIR: + return EXPP_setBitfield( value, &md->shrinkOpts, + MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR, 'h' ); + case EXPP_MOD_CULL_TARGET_FRONTFACE: + return EXPP_setBitfield( value, &md->shrinkOpts, + MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, 'h' ); + case EXPP_MOD_CULL_TARGET_BACKFACE: + return EXPP_setBitfield( value, &md->shrinkOpts, + MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, 'h' ); + case EXPP_MOD_KEEP_ABOVE_SURFACE: + return EXPP_setBitfield( value, &md->shrinkOpts, + MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE, 'h' ); + case EXPP_MOD_SUBSURFLEVELS: + return EXPP_setIValueClamped( value, &md->subsurfLevels, 1, 6, 'h' ); + default: return EXPP_ReturnIntError( PyExc_KeyError, "key not found" ); } } +static PyObject *simpledeform_getter( BPy_Modifier * self, int type ) +{ + SimpleDeformModifierData *md = (SimpleDeformModifierData *)(self->md); + + switch( type ) { + case EXPP_MOD_OBJECT: + return Object_CreatePyObject( md->origin ); + case EXPP_MOD_TYPES: + return PyInt_FromLong( (long)md->mode ); + case EXPP_MOD_FACTOR: + return PyFloat_FromDouble( (double)md->factor ); + case EXPP_MOD_UPPER_LIMIT: + return PyFloat_FromDouble( (double)md->limit[1] ); + case EXPP_MOD_LOWER_LIMIT: + return PyFloat_FromDouble( (double)md->limit[0] ); + case EXPP_MOD_VERTGROUP: + return PyString_FromString( md->vgroup_name ) ; + case EXPP_MOD_RELATIVE: + return PyBool_FromLong( (long) md->originOpts ) ; + case EXPP_MOD_LOCK_AXIS_X: + return PyBool_FromLong( (long) + ( md->axis & MOD_SIMPLEDEFORM_LOCK_AXIS_X) ) ; + case EXPP_MOD_LOCK_AXIS_Y: + return PyBool_FromLong( (long) + ( md->axis & MOD_SIMPLEDEFORM_LOCK_AXIS_Y) ) ; + default: + return EXPP_ReturnPyObjError( PyExc_KeyError, "key not found" ); + } +} + +static int simpledeform_setter( BPy_Modifier *self, int type, PyObject *value ) +{ + SimpleDeformModifierData *md = (SimpleDeformModifierData *)(self->md); + + switch( type ) { + case EXPP_MOD_OBJECT: { /* Only object for now */ + Object *ob_new=NULL; + if (value == Py_None) { + md->origin = NULL; + } else if (BPy_Object_Check( value )) { + ob_new = ((( BPy_Object * )value)->object); + md->origin = ob_new; + } else { + return EXPP_ReturnIntError( PyExc_TypeError, + "Expected an Object or None value" ); + } + return 0; + } + case EXPP_MOD_TYPES: + return EXPP_setIValueRange( value, &md->mode, 1, MOD_SIMPLEDEFORM_MODE_STRETCH, 'h' ); + case EXPP_MOD_FACTOR: + return EXPP_setFloatClamped( value, &md->factor, -10.0, 10.0 ); + case EXPP_MOD_LOWER_LIMIT: + return EXPP_setFloatClamped( value, &md->limit[0], 0.0, md->limit[1] ); + case EXPP_MOD_UPPER_LIMIT: + return EXPP_setFloatClamped( value, &md->limit[1], md->limit[0], 1.0 ); + case EXPP_MOD_VERTGROUP:{ + char *defgrp_name = PyString_AsString( value ); + if( !defgrp_name ) + return EXPP_ReturnIntError( PyExc_TypeError, + "expected string arg" ); + BLI_strncpy( md->vgroup_name, defgrp_name, sizeof( md->vgroup_name ) ); + return 0; + } + case EXPP_MOD_RELATIVE: + return EXPP_setBitfield( value, &md->originOpts, 1, 'h' ); + case EXPP_MOD_LOCK_AXIS_X: + return EXPP_setBitfield( value, &md->axis, + MOD_SIMPLEDEFORM_LOCK_AXIS_X, 'h' ); + case EXPP_MOD_LOCK_AXIS_Y: + return EXPP_setBitfield( value, &md->axis, + MOD_SIMPLEDEFORM_LOCK_AXIS_Y, 'h' ); + default: + return EXPP_ReturnIntError( PyExc_KeyError, "key not found" ); + } +} /* static PyObject *uvproject_getter( BPy_Modifier * self, int type ) { @@ -1100,7 +1293,9 @@ static PyObject *Modifier_getData( BPy_Modifier * self, PyObject * key ) case eModifierType_Shrinkwrap: return shrinkwrap_getter( self, setting ); /*case eModifierType_UVProject: - return uvproject_getter( self, setting );*/ + return uvproject_getter( self, setting );*/ + case eModifierType_SimpleDeform: + return simpledeform_getter( self, setting ); case eModifierType_Hook: case eModifierType_Softbody: case eModifierType_None: @@ -1171,6 +1366,8 @@ static int Modifier_setData( BPy_Modifier * self, PyObject * key, return displace_setter( self, key_int, arg ); case eModifierType_Shrinkwrap: return shrinkwrap_setter( self, key_int, arg ); + case eModifierType_SimpleDeform: + return simpledeform_setter( self, key_int, arg ); /*case eModifierType_UVProject: return uvproject_setter( self, key_int, arg );*/ case eModifierType_Hook: @@ -1603,8 +1800,8 @@ static PyObject *M_Modifier_TypeDict( void ) PyInt_FromLong( eModifierType_Bevel ) ); PyConstant_Insert( d, "SHRINKWRAP", PyInt_FromLong( eModifierType_Shrinkwrap ) ); - PyConstant_Insert( d, "SHRINKWRAP", - PyInt_FromLong( eModifierType_Shrinkwrap ) ); + PyConstant_Insert( d, "SIMPLEDEFORM", + PyInt_FromLong( eModifierType_SimpleDeform ) ); } return S; } @@ -1768,6 +1965,39 @@ for var in st.replace(',','').split('\n'): PyConstant_Insert( d, "SIZE_FROM_RADIUS", PyInt_FromLong( EXPP_MOD_SIZE_FROM_RADIUS ) ); /*End Auto generated code*/ + PyConstant_Insert( d, "RELATIVE", + PyInt_FromLong( EXPP_MOD_RELATIVE ) ); + PyConstant_Insert( d, "UPPER_LIMIT", + PyInt_FromLong( EXPP_MOD_UPPER_LIMIT ) ); + PyConstant_Insert( d, "LOWER_LIMIT", + PyInt_FromLong( EXPP_MOD_LOWER_LIMIT ) ); + PyConstant_Insert( d, "LOCK_AXIS_X", + PyInt_FromLong( EXPP_MOD_LOCK_AXIS_X ) ); + PyConstant_Insert( d, "LOCK_AXIS_Y", + PyInt_FromLong( EXPP_MOD_LOCK_AXIS_Y ) ); + + PyConstant_Insert( d, "OBJECT_AUX", + PyInt_FromLong( EXPP_MOD_OBJECT_AUX ) ); + PyConstant_Insert( d, "KEEPDIST", + PyInt_FromLong( EXPP_MOD_KEEPDIST ) ); + PyConstant_Insert( d, "PROJECT_OVER_X_AXIS", + PyInt_FromLong( EXPP_MOD_PROJECT_OVER_X_AXIS ) ); + PyConstant_Insert( d, "PROJECT_OVER_Y_AXIS", + PyInt_FromLong( EXPP_MOD_PROJECT_OVER_Y_AXIS ) ); + PyConstant_Insert( d, "PROJECT_OVER_Z_AXIS", + PyInt_FromLong( EXPP_MOD_PROJECT_OVER_Z_AXIS ) ); + PyConstant_Insert( d, "SUBSURFLEVELS", + PyInt_FromLong( EXPP_MOD_SUBSURFLEVELS ) ); + PyConstant_Insert( d, "ALLOW_POS_DIR", + PyInt_FromLong( EXPP_MOD_ALLOW_POS_DIR ) ); + PyConstant_Insert( d, "ALLOW_NEG_DIR", + PyInt_FromLong( EXPP_MOD_ALLOW_NEG_DIR ) ); + PyConstant_Insert( d, "CULL_TARGET_FRONTFACE", + PyInt_FromLong( EXPP_MOD_CULL_TARGET_FRONTFACE ) ); + PyConstant_Insert( d, "CULL_TARGET_BACKFACE", + PyInt_FromLong( EXPP_MOD_CULL_TARGET_BACKFACE ) ); + PyConstant_Insert( d, "KEEP_ABOVE_SURFACE", + PyInt_FromLong( EXPP_MOD_KEEP_ABOVE_SURFACE ) ); } return S; } diff --git a/source/blender/python/api2_2x/doc/Modifier.py b/source/blender/python/api2_2x/doc/Modifier.py index 03b868d3605..8b62a7270f0 100644 --- a/source/blender/python/api2_2x/doc/Modifier.py +++ b/source/blender/python/api2_2x/doc/Modifier.py @@ -50,18 +50,23 @@ Example:: modifier sequence and comparing with L{Modifier.type}: - ARMATURE - type value for Armature modifiers - ARRAY - type value for Array modifiers - - BOOLEAN - type value for Boolean modifiers + - BEVEL - type value for Bevel modifiers + - BOOLEAN - type value for Boolean modifiers - BUILD - type value for Build modifiers + - CAST - type value for Cast modifiers - CURVE - type value for Curve modifiers - - MIRROR - type value for Mirror modifiers - DECIMATE - type value for Decimate modifiers - - LATTICE - type value for Lattice modifiers - - SUBSURF - type value for Subsurf modifiers - - WAVE - type value for Wave modifiers - - EDGESPLIT - type value for Edge Split modifiers - DISPLACE - type value for Displace modifiers + - EDGESPLIT - type value for Edge Split modifiers + - LATTICE - type value for Lattice modifiers + - MESHDEFORM - type value for MeshDeform modifiers + - MASK - type value for Mask modifiers + - MIRROR - type value for Mirror modifiers + - SHRINKWRAP - type value for Shrinkwrap modifiers + - SIMPLEDEFORM - type value for SimpleDeform modifiers - SMOOTH - type value for Smooth modifiers - - CAST - type value for Cast modifiers + - SUBSURF - type value for Subsurf modifiers + - WAVE - type value for Wave modifiers @type Settings: readonly dictionary @var Settings: Constant Modifier dict used for changing modifier settings. @@ -70,17 +75,17 @@ Example:: - EDITMODE - Used for all modifiers (bool) If both REALTIME and EDITMODE are true, the modifier is enabled for interactive display while the object is in edit mode. - ONCAGE - Used for all modifiers (bool) If true, the modifier is enabled for the editing cage during edit mode. - - OBJECT - Used for Armature, Lattice, Curve, Boolean and Array (Object) - - VERTGROUP - Used for Armature, Lattice, Curve, Smooth and Cast (String) - - LIMIT - Array and Mirror (float [0.0 - 1.0]) + - OBJECT - Used for Armature, Lattice, Curve, Boolean, Array, Shrinkwrap and SimpleDeform (Object) + - VERTGROUP - Used for Armature, Lattice, Curve, Smooth, Cast, Shrinkwrap and SimpleDeform (String) + - LIMIT - Array, Mirror (float [0.0 - 1.0]) - FLAG - Mirror and Wave (int) - COUNT - Decimator Polycount (readonly) and Array (int) - LENGTH - Build [1.0-300000.0] and Array [0.0 - 10000.0] (float) - - FACTOR - Smooth [-10.0, 10.0] and Cast [-10.0, 10.0] (float) + - FACTOR - Smooth [-10.0, 10.0], Cast [-10.0, 10.0] and SimpleDeform [-10.0, 10.0] (float) - ENABLE_X = Smooth and Cast (bool, default: True) - ENABLE_Y = Smooth and Cast (bool, default: True) - ENABLE_Z = Smooth and Cast (bool, default: True) - - TYPES - Subsurf and Cast. For Subsurf it determines the subdivision algorithm - (int): 0 = Catmull-Clark; 1 = simple subdivision. For Cast it determines the shape to deform to = (int): 0 = Sphere; 1 = Cylinder; 2 = Cuboid + - TYPES - Subsurf, Cast, Shrinkwrap and SimpleDeform. For Subsurf it determines the subdivision algorithm - (int): 0 = Catmull-Clark; 1 = simple subdivision. For Cast it determines the shape to deform to = (int): 0 = Sphere; 1 = Cylinder; 2 = Cuboid. For Shrinkwrap it determines where it has to project = (int): 0 = Nearest surface; 1 = Project; 2 = Nearest vertex. For DeformMesh it determines the function to apply = (int): 1 = Twist; 2 = Bend; 3 = Taper; 4 = Stretch. - LEVELS - Used for Subsurf only (int [0 - 6]). The number of subdivision levels used for interactive display. - RENDLEVELS - Used for Subsurf only (int [0 - 6]). The number of subdivision levels used for rendering. @@ -139,6 +144,26 @@ Example:: - SIZE - Used for Cast only (float [0.0, 100.0], default: 0.0) - SIZE_FROM_RADIUS - Used for Cast only (bool, default: True) - USE_OB_TRANSFORM - Used for Cast only (bool, default: False) + + - OBJECT_AUX - Used for Shrinkwrap only, (Object) + - KEEPDIST - Used for Shrinkwrap only (float [-1000.0, 1000.0, default: 0.0) + - PROJECT_OVER_X_AXIS - Used for Shrinkwrap only, should the modifier not project over normal (bool) + - PROJECT_OVER_Y_AXIS - Used for Shrinkwrap only, should the modifier not project over normal (bool) + - PROJECT_OVER_Z_AXIS - Used for Shrinkwrap only, should the modifier not project over normal (bool) + - PROJECT_OVER_NORMAL - Used for Shrinkwrap only (bool) + - ALLOW_POS_DIR - Used for Shrinkwrap only, should the modifier use Project TYPES (bool) + - ALLOW_NEG_DIR - Used for Shrinkwrap only, should the modifier use Project TYPES (bool) + - CULL_TARGET_FRONTFACE - Used for Shrinkwrap only, should the modifier use Project TYPES (bool) + - CULL_TARGET_BACKFACE - Used for Shrinkwrap only, should the modifier use Project TYPES (bool) + - KEEP_ABOVE_SURFACE - Used for Shrinkwrap only , should the modifier use Nearest Surface TYPES(bool) + - SUBSURFLEVELS - Used for Shrinkwrap only (int [0 - 6]). The number of subdivision levels used. + + - RELATIVE - Used for Simpledeform only (bool, default: False) + - LOWER_LIMIT - Used for Simpledeform only (float [0.0, UPPER_LIMIT], default: 0.0)) + - UPPER_LIMIT - Used for Simpledeform only (float [LOWER_LIMIT,1.0], default: 1.0)) + - LOCK_AXIS_X - Used for Simpledeform only (bool, default: False) + - LOCK_AXIS_Y - Used for Simpledeform only (bool, default: False) + """ class ModSeq: -- cgit v1.2.3 From 732c3ee66f228660ae856079eced41c57d1206f1 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 11 May 2009 23:05:13 +0000 Subject: BGE bug #18596: No ipo dynamics is 2.49rc1. --- source/gameengine/Ketsji/KX_IPO_SGController.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.cpp b/source/gameengine/Ketsji/KX_IPO_SGController.cpp index 55a7e2ade60..bd7e09d1dda 100644 --- a/source/gameengine/Ketsji/KX_IPO_SGController.cpp +++ b/source/gameengine/Ketsji/KX_IPO_SGController.cpp @@ -194,7 +194,8 @@ bool KX_IpoSGController::Update(double currentTime) else newPosition = m_ipo_start_point + newPosition; } - ob->SetLocalPosition(newPosition); + if (m_game_object) + m_game_object->NodeSetLocalPosition(newPosition); } } //modifies orientation? @@ -233,7 +234,8 @@ bool KX_IpoSGController::Update(double currentTime) rotation = m_ipo_start_orient * rotation; else rotation = rotation * m_ipo_start_orient; - ob->SetLocalOrientation(rotation); + if (m_game_object) + m_game_object->NodeSetLocalOrientation(rotation); } } else if (m_ipo_channels_active[OB_ROT_X] || m_ipo_channels_active[OB_ROT_Y] || m_ipo_channels_active[OB_ROT_Z]) { if (m_ipo_euler_initialized) { @@ -265,7 +267,8 @@ bool KX_IpoSGController::Update(double currentTime) else if (m_ipo_channels_active[OB_DROT_Z]) { roll += m_ipo_xform.GetDeltaEulerAngles()[2]; } - ob->SetLocalOrientation(MT_Vector3(yaw, pitch, roll)); + if (m_game_object) + m_game_object->NodeSetLocalOrientation(MT_Vector3(yaw, pitch, roll)); } } else if (m_ipo_start_initialized) { // only DROT, treat as Add @@ -286,7 +289,8 @@ bool KX_IpoSGController::Update(double currentTime) // dRot are always local MT_Matrix3x3 rotation(MT_Vector3(yaw, pitch, roll)); rotation = m_ipo_start_orient * rotation; - ob->SetLocalOrientation(rotation); + if (m_game_object) + m_game_object->NodeSetLocalOrientation(rotation); } } //modifies scale? @@ -322,8 +326,8 @@ bool KX_IpoSGController::Update(double currentTime) if (m_ipo_add) { newScale = m_ipo_start_scale * newScale; } - - ob->SetLocalScale(newScale); + if (m_game_object) + m_game_object->NodeSetLocalScale(newScale); } m_modified=false; @@ -342,6 +346,7 @@ SG_Controller* KX_IpoSGController::GetReplica(class SG_Node* destnode) KX_IpoSGController* iporeplica = new KX_IpoSGController(*this); // clear object that ipo acts on in the replica. iporeplica->ClearObject(); + iporeplica->SetGameObject((KX_GameObject*)destnode->GetSGClientObject()); // dirty hack, ask Gino for a better solution in the ipo implementation // hacken en zagen, in what we call datahiding, not written for replication :( -- cgit v1.2.3 From b6fa9afccb941aa413ac788a5bc73d9170fd6228 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 12 May 2009 15:28:07 +0000 Subject: [#13726] Segfault with (Re)Appending objects fix this by freeing the lib-file-data after linking or appending, re-appending will be slower now (as slow as appending for the first time). Not strictly needed, set the memory for bhead's to zero in readfile.c since comparisons are done later on with this data making valgrind complain. Added some missing headers too. --- source/blender/blenkernel/intern/fluidsim.c | 2 ++ source/blender/blenloader/intern/readfile.c | 8 ++++++++ source/blender/src/filelist.c | 2 ++ 3 files changed, 12 insertions(+) (limited to 'source') diff --git a/source/blender/blenkernel/intern/fluidsim.c b/source/blender/blenkernel/intern/fluidsim.c index 29c4e0f2fb5..b650f3a3e98 100644 --- a/source/blender/blenkernel/intern/fluidsim.c +++ b/source/blender/blenkernel/intern/fluidsim.c @@ -36,6 +36,8 @@ #include "DNA_particle_types.h" #include "DNA_scene_types.h" // N_T +#include "PIL_time.h" // for PIL_sleep_ms + #include "BLI_arithb.h" #include "BLI_blenlib.h" diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ce154755651..0873c572382 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -133,6 +133,7 @@ #include "BKE_main.h" // for Main #include "BKE_mesh.h" // for ME_ defines (patching) #include "BKE_modifier.h" +#include "BKE_multires.h" // for multires_free #include "BKE_node.h" // for tree type defines #include "BKE_object.h" #include "BKE_particle.h" @@ -617,6 +618,11 @@ static BHeadN *get_bhead(FileData *fd) BHeadN *new_bhead = 0; int readsize; + /* not strictly needed but shuts valgrind up + * since uninitialized memory gets compared */ + memset(&bhead8, 0, sizeof(BHead8)); + memset(&bhead4, 0, sizeof(BHead4)); + if (fd) { if ( ! fd->eof) { @@ -9233,6 +9239,8 @@ void BLO_script_library_append(BlendHandle **bh, char *dir, char *name, void BLO_library_append(SpaceFile *sfile, char *dir, int idcode) { BLO_library_append_(&sfile->libfiledata, sfile->filelist, sfile->totfile, dir, sfile->file, sfile->flag, idcode); + BLO_blendhandle_close(sfile->libfiledata); + sfile->libfiledata= NULL; } void BLO_library_append_(BlendHandle** libfiledata, struct direntry* filelist, int totfile, char *dir, char* file, short flag, int idcode) diff --git a/source/blender/src/filelist.c b/source/blender/src/filelist.c index 008bcbe147d..5c8fab77e04 100644 --- a/source/blender/src/filelist.c +++ b/source/blender/src/filelist.c @@ -913,6 +913,8 @@ void BIF_filelist_from_library(struct FileList* filelist) void BIF_filelist_append_library(struct FileList *filelist, char *dir, char *file, short flag, int idcode) { BLO_library_append_(&filelist->libfiledata, filelist->filelist, filelist->numfiles, dir, file, flag, idcode); + BLO_blendhandle_close(filelist->libfiledata); + filelist->libfiledata= NULL; } void BIF_filelist_from_main(struct FileList *filelist) -- cgit v1.2.3 From 705764fe050fd15703fe2ab410516ff3ccc3f421 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 12 May 2009 16:20:23 +0000 Subject: Fix face occlusion for projection paint, (was broken for all RC's but nobody noticed) Its still not working right in perspective mode. For bleed use a faster method then Barycentric weights function since the point is always on the edge. last commit with memset in readfile.c missed one var. --- source/blender/blenloader/intern/readfile.c | 11 +++---- source/blender/src/imagepaint.c | 46 ++++++++++++++++++----------- 2 files changed, 35 insertions(+), 22 deletions(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 0873c572382..cbf2516da77 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -617,15 +617,16 @@ static BHeadN *get_bhead(FileData *fd) BHead bhead; BHeadN *new_bhead = 0; int readsize; - - /* not strictly needed but shuts valgrind up - * since uninitialized memory gets compared */ - memset(&bhead8, 0, sizeof(BHead8)); - memset(&bhead4, 0, sizeof(BHead4)); if (fd) { if ( ! fd->eof) { + /* not strictly needed but shuts valgrind up + * since uninitialized memory gets compared */ + memset(&bhead8, 0, sizeof(BHead8)); + memset(&bhead4, 0, sizeof(BHead4)); + memset(&bhead, 0, sizeof(BHead)); + // First read the bhead structure. // Depending on the platform the file was written on this can // be a big or little endian BHead4 or BHead8 structure. diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c index 86534438ba0..37670d09749 100644 --- a/source/blender/src/imagepaint.c +++ b/source/blender/src/imagepaint.c @@ -230,8 +230,8 @@ typedef struct ProjPaintState { char *faceSeamFlags; /* store info about faces, if they are initialized etc*/ float (*faceSeamUVs)[4][2]; /* expanded UVs for faces to use as seams */ LinkNode **vertFaces; /* Only needed for when seam_bleed_px is enabled, use to find UV seams */ - char *vertFlags; /* store options per vert, now only store if the vert is pointing away from the view */ #endif + char *vertFlags; /* store options per vert, now only store if the vert is pointing away from the view */ int buckets_x; /* The size of the bucket grid, the grid span's screenMin/screenMax so you can paint outsize the screen or with 2 brushes at once */ int buckets_y; @@ -867,7 +867,7 @@ static int project_bucket_point_occluded(const ProjPaintState *ps, LinkNode *buc else isect_ret = project_paint_occlude_ptv(pixelScreenCo, ps->screenCoords[mf->v1], ps->screenCoords[mf->v3], ps->screenCoords[mf->v4], w, ps->is_ortho); } - if (isect_ret==1) { + if (isect_ret>=1) { /* TODO - we may want to cache the first hit, * it is not possible to swap the face order in the list anymore */ return 1; @@ -952,6 +952,7 @@ static int line_isect_x(const float p1[2], const float p2[2], const float x_leve * Its possible this gives incorrect results, when the UVs for 1 face go into the next * tile, but do not do this for the adjacent face, it could return a false positive. * This is so unlikely that Id not worry about it. */ +#ifndef PROJ_DEBUG_NOSEAMBLEED static int cmp_uv(const float vec2a[2], const float vec2b[2]) { /* if the UV's are not between 0.0 and 1.0 */ @@ -969,10 +970,11 @@ static int cmp_uv(const float vec2a[2], const float vec2b[2]) return ((fabsf(xa-xb) < PROJ_GEOM_TOLERANCE) && (fabsf(ya-yb) < PROJ_GEOM_TOLERANCE)) ? 1:0; } - +#endif /* set min_px and max_px to the image space bounds of the UV coords * return zero if there is no area in the returned rectangle */ +#ifndef PROJ_DEBUG_NOSEAMBLEED static int pixel_bounds_uv( const float uv1[2], const float uv2[2], const float uv3[2], const float uv4[2], rcti *bounds_px, @@ -1000,6 +1002,7 @@ static int pixel_bounds_uv( /* face uses no UV area when quantized to pixels? */ return (bounds_px->xmin == bounds_px->xmax || bounds_px->ymin == bounds_px->ymax) ? 0 : 1; } +#endif static int pixel_bounds_array(float (* uv)[2], rcti *bounds_px, const int ibuf_x, const int ibuf_y, int tot) { @@ -2498,7 +2501,6 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i float (*outset_uv)[2] = ps->faceSeamUVs[face_index]; float insetCos[4][3]; /* inset face coords. NOTE!!! ScreenSace for ortho, Worldspace in prespective view */ - float *uv_seam_quad[4]; float fac; float *vCoSS[4]; /* vertex screenspace coords */ @@ -2554,16 +2556,11 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i fac1 = Vec2Lenf(vCoSS[fidx1], bucket_clip_edges[0]) / ftot; fac2 = Vec2Lenf(vCoSS[fidx1], bucket_clip_edges[1]) / ftot; - uv_seam_quad[0] = tf_uv_pxoffset[fidx1]; - uv_seam_quad[1] = tf_uv_pxoffset[fidx2]; - uv_seam_quad[2] = outset_uv[fidx2]; - uv_seam_quad[3] = outset_uv[fidx1]; - - Vec2Lerpf(seam_subsection[0], uv_seam_quad[0], uv_seam_quad[1], fac1); - Vec2Lerpf(seam_subsection[1], uv_seam_quad[0], uv_seam_quad[1], fac2); - - Vec2Lerpf(seam_subsection[2], uv_seam_quad[3], uv_seam_quad[2], fac2); - Vec2Lerpf(seam_subsection[3], uv_seam_quad[3], uv_seam_quad[2], fac1); + Vec2Lerpf(seam_subsection[0], tf_uv_pxoffset[fidx1], tf_uv_pxoffset[fidx2], fac1); + Vec2Lerpf(seam_subsection[1], tf_uv_pxoffset[fidx1], tf_uv_pxoffset[fidx2], fac2); + + Vec2Lerpf(seam_subsection[2], outset_uv[fidx1], outset_uv[fidx2], fac2); + Vec2Lerpf(seam_subsection[3], outset_uv[fidx1], outset_uv[fidx2], fac1); /* if the bucket_clip_edges values Z values was kept we could avoid this * Inset needs to be added so occlusion tests wont hit adjacent faces */ @@ -2616,14 +2613,28 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i /* Only bother calculating the weights if we intersect */ if (ps->do_mask_normal || ps->dm_mtface_clone) { - /* TODO, this is not QUITE correct since UV is not inside the UV's but good enough for seams */ +#if 0 + /* This is not QUITE correct since UV is not inside the UV's but good enough for seams */ if (side) { BarycentricWeights2f(uv, tf_uv_pxoffset[0], tf_uv_pxoffset[2], tf_uv_pxoffset[3], w); } else { BarycentricWeights2f(uv, tf_uv_pxoffset[0], tf_uv_pxoffset[1], tf_uv_pxoffset[2], w); } - +#endif +#if 1 + /* Cheat, we know where we are along the edge so work out the weights from that */ + fac = fac1 + (fac * (fac2-fac1)); + w[0]=w[1]=w[2]= 0.0; + if (side) { + w[fidx1?fidx1-1:0] = fac; + w[fidx2?fidx2-1:0] = 1.0-fac; + } + else { + w[fidx1] = fac; + w[fidx2] = 1.0-fac; + } +#endif } /* a pitty we need to get the worldspace pixel location here */ @@ -3356,15 +3367,16 @@ static void project_paint_end(ProjPaintState *ps) MEM_freeN(ps->bucketFaces); MEM_freeN(ps->bucketFlags); +#ifndef PROJ_DEBUG_NOSEAMBLEED if (ps->seam_bleed_px > 0.0f) { MEM_freeN(ps->vertFaces); MEM_freeN(ps->faceSeamFlags); MEM_freeN(ps->faceSeamUVs); } +#endif if (ps->vertFlags) MEM_freeN(ps->vertFlags); - for (a=0; athread_tot; a++) { BLI_memarena_free(ps->arena_mt[a]); } -- cgit v1.2.3 From 5a0de728b0a6a4b916f88554322cc56884f17ad8 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Tue, 12 May 2009 19:48:18 +0000 Subject: BGE performance: allow to create display list on meshes with modifiers but without armature and shape keys. These modified meshes are static and can be put safely in a display list. As the rendering of modifiers is done in direct openGL call, it results is a bit performance boost. --- source/gameengine/Converter/BL_MeshDeformer.h | 2 +- source/gameengine/Converter/BL_ShapeDeformer.cpp | 6 ++++-- source/gameengine/Converter/BL_SkinDeformer.cpp | 3 ++- source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 2 ++ source/gameengine/Rasterizer/RAS_Deformer.h | 8 +++++++- source/gameengine/Rasterizer/RAS_MaterialBucket.cpp | 2 +- 6 files changed, 17 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h index d1754618df2..11ca3b00a1d 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.h +++ b/source/gameengine/Converter/BL_MeshDeformer.h @@ -66,7 +66,7 @@ public: virtual bool Update(void){ return false; }; virtual bool UpdateBuckets(void){ return false; }; virtual RAS_Deformer* GetReplica(){return NULL;}; - virtual void ProcessReplica() { }; + virtual void ProcessReplica() {m_bDynamic=false;}; struct Mesh* GetMesh() { return m_bmesh; }; // virtual void InitDeform(double time){}; diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp index bf5eb5cbcb3..e04d4dad015 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.cpp +++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp @@ -121,7 +121,7 @@ bool BL_ShapeDeformer::ExecuteShapeDrivers(void) ForceUpdate(); m_armobj->RestorePose(); - + m_bDynamic = true; return true; } return false; @@ -144,8 +144,10 @@ bool BL_ShapeDeformer::Update(void) /* we will blend the key directly in mvert array: it is used by armature as the start position */ /* m_bmesh->key can be NULL in case of Modifier deformer */ - if (m_bmesh->key) + if (m_bmesh->key) { do_rel_key(0, m_bmesh->totvert, m_bmesh->totvert, (char *)m_bmesh->mvert->co, m_bmesh->key, 0); + m_bDynamic = true; + } // Don't release the weight array as in Blender, it will most likely be reusable on next frame // The weight array are ultimately deleted when the skin mesh is destroyed diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp index d40776a645d..e92c3b29543 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.cpp +++ b/source/gameengine/Converter/BL_SkinDeformer.cpp @@ -201,7 +201,8 @@ bool BL_SkinDeformer::Update(void) m_lastArmaUpdate=m_armobj->GetLastFrame(); m_armobj->RestorePose(); - + /* dynamic vertex, cannot use display list */ + m_bDynamic = true; /* indicate that the m_transverts and normals are up to date */ return true; } diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index 1943c436258..07fdc8ec41b 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -757,6 +757,7 @@ void KX_ConvertODEEngineObject(KX_GameObject* gameobj, virtual bool Update(void) { //printf("update\n"); + m_bDynamic = true; return true;//?? } virtual bool UpdateBuckets(void) @@ -775,6 +776,7 @@ void KX_ConvertODEEngineObject(KX_GameObject* gameobj, virtual void ProcessReplica() { // we have two pointers to deal with but we cannot do it now, will be done in Relink + m_bDynamic = false; } virtual bool SkipVertexTransform() { diff --git a/source/gameengine/Rasterizer/RAS_Deformer.h b/source/gameengine/Rasterizer/RAS_Deformer.h index fe081dd4aa5..bb8e3750485 100644 --- a/source/gameengine/Rasterizer/RAS_Deformer.h +++ b/source/gameengine/Rasterizer/RAS_Deformer.h @@ -39,7 +39,7 @@ class RAS_Deformer { public: - RAS_Deformer(){}; + RAS_Deformer() : m_pMesh(0), m_bDynamic(false) {}; virtual ~RAS_Deformer(){}; virtual void Relink(GEN_Map*map)=0; virtual bool Apply(class RAS_IPolyMaterial *polymat)=0; @@ -55,8 +55,14 @@ public: { return true; } + // true when deformer produces varying vertex (shape or armature) + bool IsDynamic() + { + return m_bDynamic; + } protected: class RAS_MeshObject *m_pMesh; + bool m_bDynamic; }; #endif diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index db6394c1ec0..841264465cf 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -597,7 +597,7 @@ void RAS_MaterialBucket::RenderMeshSlot(const MT_Transform& cameratrans, RAS_IRa // then it won't have texture coordinates for actual drawing. also // for zsort we can't make a display list, since the polygon order // changes all the time. - if(ms.m_pDeformer) + if(ms.m_pDeformer && ms.m_pDeformer->IsDynamic()) ms.m_bDisplayList = false; else if(!ms.m_DisplayList && rasty->GetDrawingMode() == RAS_IRasterizer::KX_SHADOW) ms.m_bDisplayList = false; -- cgit v1.2.3 From 7d923df2bf524c0155439c2d68cd0f512c93b794 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 12 May 2009 21:13:29 +0000 Subject: [#18728] Particle (newtonian) physics API for Python patch from Alberto Santos (dnakhain) --- source/blender/python/api2_2x/Particle.c | 578 ++++++++++++++++++++++++++ source/blender/python/api2_2x/doc/Particle.py | 73 +++- 2 files changed, 650 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Particle.c b/source/blender/python/api2_2x/Particle.c index a7db8290c62..ac3e418bb6a 100644 --- a/source/blender/python/api2_2x/Particle.c +++ b/source/blender/python/api2_2x/Particle.c @@ -133,6 +133,50 @@ static int Part_setRenderStep( BPy_PartSys * self, PyObject * args ); static PyObject *Part_getRenderStep( BPy_PartSys * self ); static PyObject *Part_getDupOb( BPy_PartSys * self ); static PyObject *Part_getDrawAs( BPy_PartSys * self ); +static int Part_setPhysType( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getPhysType( BPy_PartSys * self ); +static int Part_setIntegrator( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getIntegrator( BPy_PartSys * self ); +static int Part_setIniVelObject( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getIniVelObject( BPy_PartSys * self ); +static int Part_setIniVelNormal( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getIniVelNormal( BPy_PartSys * self ); +static int Part_setIniVelRandom( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getIniVelRandom( BPy_PartSys * self ); +static int Part_setIniVelTan( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getIniVelTan( BPy_PartSys * self ); +static int Part_setIniVelRot( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getIniVelRot( BPy_PartSys * self ); +static int Part_setIniVelPart( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getIniVelPart( BPy_PartSys * self ); +static int Part_setIniVelReact( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getIniVelReact( BPy_PartSys * self ); +static int Part_setRotDynamic( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getRotDynamic( BPy_PartSys * self ); +static int Part_setRotation( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getRotation( BPy_PartSys * self ); +static int Part_setRotRandom( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getRotRandom( BPy_PartSys * self ); +static int Part_setRotPhase( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getRotPhase( BPy_PartSys * self ); +static int Part_setRotPhaseR( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getRotPhaseR( BPy_PartSys * self ); +static int Part_setRotAngularV( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getRotAngularV( BPy_PartSys * self ); +static int Part_setRotAngularVAm( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getRotAngularVAm( BPy_PartSys * self ); +static int Part_setGlobAccX( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getGlobAccX( BPy_PartSys * self ); +static int Part_setGlobAccY( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getGlobAccY( BPy_PartSys * self ); +static int Part_setGlobAccZ( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getGlobAccZ( BPy_PartSys * self ); +static int Part_setGlobDrag( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getGlobDrag( BPy_PartSys * self ); +static int Part_setGlobBrown( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getGlobBrown( BPy_PartSys * self ); +static int Part_setGlobDamp( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getGlobDamp( BPy_PartSys * self ); static PyObject *Part_GetAge( BPy_PartSys * self, PyObject * args ); static int Part_setChildAmount( BPy_PartSys * self, PyObject * args ); static PyObject *Part_getChildAmount( BPy_PartSys * self ); @@ -366,6 +410,95 @@ static PyGetSetDef BPy_ParticleSys_getseters[] = { (getter)Part_getDrawAs, NULL, "Get draw type Particle.DRAWAS([ 'NONE' | 'OBJECT' | 'POINT' | ... ] )", NULL}, +/* Newtonian Physics */ + {"physics", + (getter)Part_getPhysType, (setter)Part_setPhysType, + "Select particle physics type Particle.PHYSICS([ 'BOIDS' | 'KEYED' | 'NEWTONIAN' | 'NONE' ])", + NULL}, + {"integration", + (getter)Part_getIntegrator, (setter)Part_setIntegrator, + "Select physics integrator type Particle.INTEGRATOR([ 'RK4' | 'MIDPOINT' | 'EULER' ])", + NULL}, + {"inVelObj", + (getter)Part_getIniVelObject, (setter)Part_setIniVelObject, + "Let the object give the particle a starting speed", + NULL}, + {"inVelNor", + (getter)Part_getIniVelNormal, (setter)Part_setIniVelNormal, + "Let the surface normal give the particle a starting speed", + NULL}, + {"inVelRan", + (getter)Part_getIniVelRandom, (setter)Part_setIniVelRandom, + "Give the starting speed a random variation", + NULL}, + {"inVelTan", + (getter)Part_getIniVelTan, (setter)Part_setIniVelTan, + "Let the surface tangent give the particle a starting speed", + NULL}, + {"inVelRot", + (getter)Part_getIniVelRot, (setter)Part_setIniVelRot, + "Rotate the surface tangent", + NULL}, + {"inVelPart", + (getter)Part_getIniVelPart, (setter)Part_setIniVelPart, + "Let the target particle give the particle a starting speed", + NULL}, + {"inVelReact", + (getter)Part_getIniVelReact, (setter)Part_setIniVelReact, + "Let the vector away from the target particles location give the particle a starting speed", + NULL}, + {"rotation", + (getter)Part_getRotation, (setter)Part_setRotation, + "Particles initial rotation Particle.ROTATION([ 'OBZ' | 'OBY' | 'OBX' | 'GLZ' | 'GLY' | 'GLX' | 'VEL' | 'NOR' | 'NONE' ])", + NULL}, + {"rotDyn", + (getter)Part_getRotDynamic, (setter)Part_setRotDynamic, + "Sets rotation to dynamic/constant", + NULL}, + {"rotRand", + (getter)Part_getRotRandom, (setter)Part_setRotRandom, + "Randomize rotation", + NULL}, + {"rotPhase", + (getter)Part_getRotPhase, (setter)Part_setRotPhase, + "Initial rotation phase", + NULL}, + {"rotPhaseR", + (getter)Part_getRotPhaseR, (setter)Part_setRotPhaseR, + "Randomize rotation phase", + NULL}, + {"rotAnV", + (getter)Part_getRotAngularV, (setter)Part_setRotAngularV, + "Select particle angular velocity mode Particle.ANGULARV([ 'RANDOM' | 'SPIN' | 'NONE' ])", + NULL}, + {"rotAnVAm", + (getter)Part_getRotAngularVAm, (setter)Part_setRotAngularVAm, + "Angular velocity amount", + NULL}, + {"glAccX", + (getter)Part_getGlobAccX, (setter)Part_setGlobAccX, + "Specify a constant acceleration along the X-axis", + NULL}, + {"glAccY", + (getter)Part_getGlobAccY, (setter)Part_setGlobAccY, + "Specify a constant acceleration along the Y-axis", + NULL}, + {"glAccZ", + (getter)Part_getGlobAccZ, (setter)Part_setGlobAccZ, + "Specify a constant acceleration along the Z-axis", + NULL}, + {"glDrag", + (getter)Part_getGlobDrag, (setter)Part_setGlobDrag, + "Specify the amount of air-drag", + NULL}, + {"glBrown", + (getter)Part_getGlobBrown, (setter)Part_setGlobBrown, + "Specify the amount of brownian motion", + NULL}, + {"glDamp", + (getter)Part_getGlobDamp, (setter)Part_setGlobDamp, + "Specify the amount of damping", + NULL}, /* Children */ {"childAmount", (getter)Part_getChildAmount, (setter)Part_setChildAmount, @@ -859,6 +992,95 @@ static PyObject *Particle_ReactOnDict( void ) return ReactOn; } +/* create the Blender.Particle.Physics constant dict */ + +static PyObject *Particle_PhysicsDict( void ) +{ + PyObject *Physics = PyConstant_New( ); + + if( Physics ) { + BPy_constant *c = ( BPy_constant * ) Physics; + + PyConstant_Insert( c, "BOIDS", + PyInt_FromLong( 3 ) ); + PyConstant_Insert( c, "KEYED", + PyInt_FromLong( 2 ) ); + PyConstant_Insert( c, "NEWTONIAN", + PyInt_FromLong( 1 ) ); + PyConstant_Insert( c, "NONE", + PyInt_FromLong( 0 ) ); + } + return Physics; +} + +/* create the Blender.Particle.Integrator constant dict */ + +static PyObject *Particle_IntegratorDict( void ) +{ + PyObject *Integrator = PyConstant_New( ); + + if( Integrator ) { + BPy_constant *c = ( BPy_constant * ) Integrator; + + PyConstant_Insert( c, "EULER", + PyInt_FromLong( 2 ) ); + PyConstant_Insert( c, "MIDPOINT", + PyInt_FromLong( 1 ) ); + PyConstant_Insert( c, "EULER", + PyInt_FromLong( 0 ) ); + } + return Integrator; +} + +/* create the Blender.Particle.Rotation constant dict */ + +static PyObject *Particle_RotationDict( void ) +{ + PyObject *Rotation = PyConstant_New( ); + + if( Rotation ) { + BPy_constant *c = ( BPy_constant * ) Rotation; + + PyConstant_Insert( c, "OBZ", + PyInt_FromLong( 8 ) ); + PyConstant_Insert( c, "OBY", + PyInt_FromLong( 7 ) ); + PyConstant_Insert( c, "OBX", + PyInt_FromLong( 6 ) ); + PyConstant_Insert( c, "GLZ", + PyInt_FromLong( 5 ) ); + PyConstant_Insert( c, "GLY", + PyInt_FromLong( 4 ) ); + PyConstant_Insert( c, "GLX", + PyInt_FromLong( 3 ) ); + PyConstant_Insert( c, "VEL", + PyInt_FromLong( 2 ) ); + PyConstant_Insert( c, "NOR", + PyInt_FromLong( 1 ) ); + PyConstant_Insert( c, "NONE", + PyInt_FromLong( 0 ) ); + } + return Rotation; +} + +/* create the Blender.Particle.AngularV constant dict */ + +static PyObject *Particle_AngularVDict( void ) +{ + PyObject *AngularV = PyConstant_New( ); + + if( AngularV ) { + BPy_constant *c = ( BPy_constant * ) AngularV; + + PyConstant_Insert( c, "RANDOM", + PyInt_FromLong( 2 ) ); + PyConstant_Insert( c, "SPIN", + PyInt_FromLong( 1 ) ); + PyConstant_Insert( c, "NONE", + PyInt_FromLong( 0 ) ); + } + return AngularV; +} /* create the Blender.Particle.ChildType constant dict */ @@ -967,6 +1189,10 @@ PyObject *ParticleSys_Init( void ){ PyObject *EmitFrom; PyObject *Dist; PyObject *DrawAs; + PyObject *Physics; + PyObject *Integrator; + PyObject *Rotation; + PyObject *AngularV; PyObject *ChildTypes; PyObject *ChildKinks; PyObject *ChildKinkAxes; @@ -980,6 +1206,10 @@ PyObject *ParticleSys_Init( void ){ EmitFrom = Particle_EmitFrom(); DrawAs = Particle_DrawAs(); Dist = Particle_DistrDict(); + Physics = Particle_PhysicsDict(); + Integrator = Particle_IntegratorDict(); + Rotation = Particle_RotationDict(); + AngularV = Particle_AngularVDict(); ChildTypes = Particle_ChildTypeDict(); ChildKinks = Particle_ChildKinkDict(); ChildKinkAxes = Particle_ChildKinkAxisDict(); @@ -997,6 +1227,14 @@ PyObject *ParticleSys_Init( void ){ PyModule_AddObject( submodule, "DISTRIBUTION", Dist ); if( DrawAs ) PyModule_AddObject( submodule, "DRAWAS", DrawAs ); + if( Physics ) + PyModule_AddObject( submodule, "PHYSICS", Physics ); + if( Integrator ) + PyModule_AddObject( submodule, "INTEGRATOR", Integrator ); + if( Rotation ) + PyModule_AddObject( submodule, "ROTATION", Rotation ); + if( AngularV ) + PyModule_AddObject( submodule, "ANGULARV", AngularV ); if( ChildTypes ) PyModule_AddObject( submodule, "CHILDTYPE", ChildTypes ); if( ChildKinks ) @@ -2202,6 +2440,346 @@ static PyObject *Part_getDrawAs( BPy_PartSys * self ) return PyInt_FromLong( (long)( self->psys->part->draw_as ) ); } +static int Part_setPhysType( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setIValueRange( args, &self->psys->part->phystype, + 0, 3, 'h' ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getPhysType( BPy_PartSys * self ) +{ + return PyInt_FromLong( (short)( self->psys->part->phystype ) ); +} + +static int Part_setIntegrator( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setIValueRange( args, &self->psys->part->integrator, + 0, 2, 'h' ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getIntegrator( BPy_PartSys * self ) +{ + return PyInt_FromLong( (short)( self->psys->part->integrator ) ); +} + +static int Part_setIniVelObject( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->obfac, + -1.0, 1.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getIniVelObject( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->obfac )) ); +} + +static int Part_setIniVelNormal( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->normfac, + -200.0, 200.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getIniVelNormal( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->normfac )) ); +} + +static int Part_setIniVelRandom( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->randfac, + 0.0, 200.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getIniVelRandom( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->randfac )) ); +} + +static int Part_setIniVelTan( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->tanfac, + -200.0, 200.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getIniVelTan( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->tanfac )) ); +} + +static int Part_setIniVelRot( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->tanphase, + -1.0, 1.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getIniVelRot( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->tanphase )) ); +} + +static int Part_setIniVelPart( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->partfac, + -10.0, 10.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getIniVelPart( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->partfac )) ); +} + +static int Part_setIniVelReact( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->reactfac, + -10.0, 10.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getIniVelReact( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->reactfac )) ); +} + +static int Part_setRotation( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setIValueRange( args, &self->psys->part->rotmode, + 0, 8, 'h' ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getRotation( BPy_PartSys * self ) +{ + return PyInt_FromLong( (short)( self->psys->part->rotmode ) ); +} + +static int Part_setRotDynamic( BPy_PartSys * self, PyObject * args ) +{ + int number; + + if( !PyInt_Check( args ) ) + return EXPP_ReturnIntError( PyExc_TypeError, "expected int argument" ); + + number = PyInt_AS_LONG( args ); + + if (number){ + self->psys->part->flag |= PART_ROT_DYN; + }else{ + self->psys->part->flag &= ~PART_ROT_DYN; + } + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return 0; +} + +static PyObject *Part_getRotDynamic( BPy_PartSys * self ) +{ + return PyInt_FromLong( ((long)( self->psys->part->flag & PART_ROT_DYN )) > 0 ); +} + +static int Part_setRotRandom( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->randrotfac, + 0.0, 1.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getRotRandom( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->randrotfac )) ); +} + +static int Part_setRotPhase( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->phasefac, + -1.0, 1.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getRotPhase( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->phasefac )) ); +} + +static int Part_setRotPhaseR( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->randphasefac, + 0.0, 1.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getRotPhaseR( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->randphasefac )) ); +} + +static int Part_setRotAngularV( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setIValueRange( args, &self->psys->part->avemode, + 0, 2, 'h' ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getRotAngularV( BPy_PartSys * self ) +{ + return PyInt_FromLong( ((int)( self->psys->part->avemode )) ); +} + +static int Part_setRotAngularVAm( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->avefac, + -200.0, 200.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getRotAngularVAm( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->avefac )) ); +} + +static int Part_setGlobAccX( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->acc[0], + -200.0, 200.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getGlobAccX( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->acc[0] )) ); +} + +static int Part_setGlobAccY( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->acc[1], + -200.0, 200.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getGlobAccY( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->acc[1] )) ); +} + +static int Part_setGlobAccZ( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->acc[2], + -200.0, 200.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getGlobAccZ( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->acc[2] )) ); +} + +static int Part_setGlobDrag( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->dragfac, + 0.0, 1.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getGlobDrag( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->dragfac )) ); +} + +static int Part_setGlobBrown( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->brownfac, + 0.0, 200.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getGlobBrown( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->brownfac )) ); +} + +static int Part_setGlobDamp( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setFloatRange( args, &self->psys->part->dampfac, + 0.0, 1.0 ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getGlobDamp( BPy_PartSys * self ) +{ + return PyFloat_FromDouble( ((float)( self->psys->part->dampfac )) ); +} + static int Part_setChildAmount( BPy_PartSys * self, PyObject * args ) { int res = EXPP_setIValueRange( args, &self->psys->part->child_nbr, diff --git a/source/blender/python/api2_2x/doc/Particle.py b/source/blender/python/api2_2x/doc/Particle.py index 6107f0bda2f..962e8c16249 100644 --- a/source/blender/python/api2_2x/doc/Particle.py +++ b/source/blender/python/api2_2x/doc/Particle.py @@ -42,8 +42,35 @@ This module provides access to the B{Particle} in Blender. - OBJECT: Draw object - GROUP: Draw group - BILLBOARD: Draw as billboard +@type PHYSICS: readonly dictionary +@var PHYSICS: Constant dict used for with L{Particle.PHYSICS} + - NONE: No physics + - NEWTONIAN: Use newtonian physics + - KEYED: Use keyed physics + - BOIDS: Use Boids physics +@type INTEGRATOR: readonly dictionary +@var INTEGRATOR: Constant dict used for with L{Particle.INTEGRATOR} + - EULER: Use Euler integrator + - MIDPOINT: Use Midpoint integrator + - RK4: Use RK4 integrator +@type ROTATION: readonly dictionary +@var ROTATION: Constant dict used for with L{Particle.ROTATION} + - NONE: No particle initial rotation + - NOR: Rotate along the normal + - VEL: Rotate affect to velocity + - GLX: Rotate along global X-Axis + - GLY: Rotate along global Y-Axis + - GLZ: Rotate along global Z-Axis + - OBX: Rotate along local X-Axis + - OBY: Rotate along local Y-Axis + - OBZ: Rotate along local Z-Axis +@type ANGULARV: readonly dictionary +@var ANGULARV: Constant dict used for with L{Particle.ANGULARV} + - NONE: No particle angular velocity + - SPIN: Spin particle angular velocity + - RANDOM: Random particle angular velocity @type CHILDTYPE: readonly dictionary -@var CHILDTYPE: Constant dict used for whith L{Particle.CHILDTYPE} +@var CHILDTYPE: Constant dict used for with L{Particle.CHILDTYPE} - NONE: set no children - PARTICLES: set children born from particles - FACES: set children born from faces @@ -135,6 +162,50 @@ class Particle: @type duplicateObject: Blender Object @ivar drawAs: Get draw type Particle.DRAWAS([ 'NONE' | 'OBJECT' | 'POINT' | ... ]). @type drawAs: int + @ivar physics: Select particle physics type Particle.PHYSICS([ 'BOIDS' | 'KEYED' | 'NEWTONIAN' | 'NONE' ]) + @type physics: int + @ivar integration: Select physics integrator type Particle.INTEGRATOR([ 'RK4' | 'MIDPOINT' | 'EULER' ]) + @type integration: int + @ivar inVelObj: Let the object give the particle a starting speed + @type inVelObj: float + @ivar inVelNor: Let the surface normal give the particle a starting speed + @type inVelNor: float + @ivar inVelRan: Give the starting speed a random variation + @type inVelRan: float + @ivar inVelTan: Let the surface tangent give the particle a starting speed + @type inVelTan: float + @ivar inVelRot: Rotate the surface tangent + @type inVelRot: float + @ivar inVelPart: Let the target particle give the particle a starting speed + @type inVelPart: float + @ivar inVelReact: Let the vector away from the target particles location give the particle a starting speed + @type inVelReact: float + @ivar rotation: Particles initial rotation Particle.ROTATION([ 'OBZ' | 'OBY' | 'OBX' | 'GLZ' | 'GLY' | 'GLX' | 'VEL' | 'NOR' | 'NONE' ]) + @type rotation: int + @ivar rotDyn: Sets rotation to dynamic/constant + @type rotDyn: int + @ivar rotRand: Randomize rotation + @type rotRand: float + @ivar rotPhase: Initial rotation phase + @type rotPhase: float + @ivar rotPhaseR: Randomize rotation phase + @type rotPhaseR: float + @ivar rotAnV: Select particle angular velocity mode Particle.ANGULARV([ 'RANDOM' | 'SPIN' | 'NONE' ]) + @type rotAnV: int + @ivar rotAnVAm: Angular velocity amount + @type rotAnVAm: float + @ivar glAccX: Specify a constant acceleration along the X-axis + @type glAccX: float + @ivar glAccY: Specify a constant acceleration along the Y-axis + @type glAccY: float + @ivar glAccZ: Specify a constant acceleration along the Z-axis + @type glAccZ: float + @ivar glDrag: Specify the amount of air-drag + @type glDrag: float + @ivar glBrown: Specify the amount of brownian motion + @type glBrown: float + @ivar glDamp: Specify the amount of damping + @type glDamp: float @ivar childAmount: The total number of children @type childAmount: int @ivar childType: Type of childrens ( Particle.CHILDTYPE[ 'FACES' | 'PARTICLES' | 'NONE' ] ) -- cgit v1.2.3 From 3c0f6b65fb5491c73c9fc79889e818f277400bd2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 12 May 2009 21:27:01 +0000 Subject: [#18711] Particle render API for Python from Alberto Santos (dnakhain) --- source/blender/python/api2_2x/Particle.c | 173 ++++++++++++++++++++++++++ source/blender/python/api2_2x/doc/Particle.py | 19 +++ 2 files changed, 192 insertions(+) (limited to 'source') diff --git a/source/blender/python/api2_2x/Particle.c b/source/blender/python/api2_2x/Particle.c index ac3e418bb6a..5d40763bb3e 100644 --- a/source/blender/python/api2_2x/Particle.c +++ b/source/blender/python/api2_2x/Particle.c @@ -64,6 +64,7 @@ static PyObject *M_ParticleSys_Get( PyObject * self, PyObject * args ); static PyObject *Part_freeEdit( BPy_PartSys * self, PyObject * args ); static PyObject *Part_GetLoc( BPy_PartSys * self, PyObject * args ); static PyObject *Part_GetRot( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_SetMat( BPy_PartSys * self, PyObject * args ); static PyObject *Part_GetMat( BPy_PartSys * self, PyObject * args ); static PyObject *Part_GetSize( BPy_PartSys * self, PyObject * args ); static int Part_setSeed( BPy_PartSys * self, PyObject * args ); @@ -127,6 +128,16 @@ static int Part_setTargetPsys( BPy_PartSys * self, PyObject * args ); static PyObject *Part_getTargetPsys( BPy_PartSys * self ); static int Part_setRenderObject( BPy_PartSys * self, PyObject * args ); static PyObject *Part_getRenderObject( BPy_PartSys * self ); +static int Part_setRenderMaterialColor( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getRenderMaterialColor( BPy_PartSys * self ); +static int Part_setRenderParents( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getRenderParents( BPy_PartSys * self ); +static int Part_setRenderUnborn( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getRenderUnborn( BPy_PartSys * self ); +static int Part_setRenderDied( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getRenderDied( BPy_PartSys * self ); +static int Part_setRenderMaterialIndex( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getRenderMaterialIndex( BPy_PartSys * self ); static int Part_setStep( BPy_PartSys * self, PyObject * args ); static PyObject *Part_getStep( BPy_PartSys * self ); static int Part_setRenderStep( BPy_PartSys * self, PyObject * args ); @@ -257,6 +268,8 @@ static PyMethodDef BPy_ParticleSys_methods[] = { METH_VARARGS, "() - Get particles location"}, {"getRot", ( PyCFunction ) Part_GetRot, METH_VARARGS, "() - Get particles rotations (list of 4 floats quaternion)"}, + {"setMat", ( PyCFunction ) Part_SetMat, + METH_VARARGS, "() - Set particles material"}, {"getMat", ( PyCFunction ) Part_GetMat, METH_NOARGS, "() - Get particles material"}, {"getSize", ( PyCFunction ) Part_GetSize, @@ -390,6 +403,26 @@ static PyGetSetDef BPy_ParticleSys_getseters[] = { (getter)Part_getRenderObject, (setter)Part_setRenderObject, "Render emitter object", NULL}, + {"renderMatCol", + (getter)Part_getRenderMaterialColor, (setter)Part_setRenderMaterialColor, + "Draw particles using material's diffuse color", + NULL}, + {"renderParents", + (getter)Part_getRenderParents, (setter)Part_setRenderParents, + "Render parent particles", + NULL}, + {"renderUnborn", + (getter)Part_getRenderUnborn, (setter)Part_setRenderUnborn, + "Show particles before they are emitted", + NULL}, + {"renderDied", + (getter)Part_getRenderDied, (setter)Part_setRenderDied, + "Show particles after they have died", + NULL}, + {"renderMaterial", + (getter)Part_getRenderMaterialIndex, (setter)Part_setRenderMaterialIndex, + "Specify material index used for the particles", + NULL}, {"displayPercentage", (getter)Part_getParticleDisp, (setter)Part_setParticleDisp, "Particle display percentage", @@ -1778,6 +1811,37 @@ error: return NULL; } +static PyObject *Part_SetMat( BPy_PartSys * self, PyObject * args ) +{ + Object *ob = self->object; + BPy_Material *pymat; + Material *mat; + short index; + + if( !PyArg_ParseTuple( args, "O!", &Material_Type, &pymat ) ) + return EXPP_ReturnPyObjError( PyExc_TypeError, + "expected Blender Material PyObject" ); + + mat = pymat->material; + + if( ob->totcol >= MAXMAT ) + return EXPP_ReturnPyObjError( PyExc_RuntimeError, + "object data material lists can't have more than 16 materials" ); + + index = find_material_index(ob,mat); + if (index == 0){ /*Not found*/ + assign_material(ob,mat,ob->totcol+1); + index = find_material_index(ob,mat); + } + + if (index>0 && indexpsys->part->omat = index; + + /* since we have messed with object, we need to flag for DAG recalc */ + self->object->recalc |= OB_RECALC_OB; + + Py_RETURN_NONE; +} static PyObject *Part_GetMat( BPy_PartSys * self, PyObject * args ){ Material *ma; @@ -2387,6 +2451,115 @@ static PyObject *Part_getRenderObject( BPy_PartSys * self ) return PyInt_FromLong( ((long)( self->psys->part->draw & PART_DRAW_EMITTER )) > 0 ); } +static int Part_setRenderMaterialColor( BPy_PartSys * self, PyObject * args ) +{ + int number; + + if( !PyInt_Check( args ) ) + return EXPP_ReturnIntError( PyExc_TypeError, "expected int argument" ); + + number = PyInt_AS_LONG( args ); + + if (number){ + self->psys->part->draw |= PART_DRAW_MAT_COL; + }else{ + self->psys->part->draw &= ~PART_DRAW_MAT_COL; + } + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return 0; +} + +static PyObject *Part_getRenderMaterialColor( BPy_PartSys * self ) +{ + return PyInt_FromLong( ((long)( self->psys->part->draw & PART_DRAW_MAT_COL )) > 0 ); +} + +static int Part_setRenderParents( BPy_PartSys * self, PyObject * args ) +{ + int number; + + if( !PyInt_Check( args ) ) + return EXPP_ReturnIntError( PyExc_TypeError, "expected int argument" ); + + number = PyInt_AS_LONG( args ); + + if (number){ + self->psys->part->draw |= PART_DRAW_PARENT; + }else{ + self->psys->part->draw &= ~PART_DRAW_PARENT; + } + + return 0; +} + +static PyObject *Part_getRenderParents( BPy_PartSys * self ) +{ + return PyInt_FromLong( ((long)( self->psys->part->draw & PART_DRAW_PARENT )) > 0 ); +} + +static int Part_setRenderUnborn( BPy_PartSys * self, PyObject * args ) +{ + int number; + + if( !PyInt_Check( args ) ) + return EXPP_ReturnIntError( PyExc_TypeError, "expected int argument" ); + + number = PyInt_AS_LONG( args ); + + if (number){ + self->psys->part->flag |= PART_UNBORN; + }else{ + self->psys->part->flag &= ~PART_UNBORN; + } + + return 0; +} + +static PyObject *Part_getRenderUnborn( BPy_PartSys * self ) +{ + return PyInt_FromLong( ((long)( self->psys->part->flag & PART_UNBORN )) > 0 ); +} + +static int Part_setRenderDied( BPy_PartSys * self, PyObject * args ) +{ + int number; + + if( !PyInt_Check( args ) ) + return EXPP_ReturnIntError( PyExc_TypeError, "expected int argument" ); + + number = PyInt_AS_LONG( args ); + + if (number){ + self->psys->part->flag |= PART_DIED; + }else{ + self->psys->part->flag &= ~PART_DIED; + } + + return 0; +} + +static int Part_setRenderMaterialIndex( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setIValueRange( args, &self->psys->part->omat, + 1, 16, 'i' ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getRenderMaterialIndex( BPy_PartSys * self ) +{ + return PyInt_FromLong( ((int)( self->psys->part->omat )) ); +} + +static PyObject *Part_getRenderDied( BPy_PartSys * self ) +{ + return PyInt_FromLong( ((long)( self->psys->part->flag & PART_DIED )) > 0 ); +} + static int Part_setParticleDisp( BPy_PartSys * self, PyObject * args ) { int res = EXPP_setIValueRange( args, &self->psys->part->disp, diff --git a/source/blender/python/api2_2x/doc/Particle.py b/source/blender/python/api2_2x/doc/Particle.py index 962e8c16249..82d197f71dd 100644 --- a/source/blender/python/api2_2x/doc/Particle.py +++ b/source/blender/python/api2_2x/doc/Particle.py @@ -152,6 +152,16 @@ class Particle: @type object: Blender Object @ivar renderEmitter: Render emitter object. @type renderEmitter: int + @ivar renderMatCol: Draw particles using material's diffuse color. + @type renderMatCol: int + @ivar renderParents: Render parent particles. + @type renderParents: int + @ivar renderUnborn: Show particles before they are emitted. + @type renderUnborn: int + @ivar renderDied: Show particles after they have died. + @type renderDied: int + @ivar renderMaterial: Specify material used for the particles. + @type renderMaterial: int @ivar displayPercentage: Particle display percentage. @type displayPercentage: int @ivar hairDisplayStep: How many steps paths are drawn with (power of 2) in visu mode. @@ -291,6 +301,15 @@ class Particle: @return: list of 4-tuples or None if system is disabled """ + def setMat(mat): + """ + Set the particles' material. This method checks if the argument + given is really a material, imposes a limit of 16 materials and adds + the material if it wasn't already in the list of the object. + @type mat: Blender Material + @param mat: The material to be assigned to particles + """ + def getMat(): """ Get the particles' material. -- cgit v1.2.3 From a70440d918b13b62e7a6695f562089bd5d4b613a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 12 May 2009 21:41:04 +0000 Subject: [#18735] Particle vertex group API for Python from Alberto Santos (dnakhain) Changed "None" to "" for returning an unset vertex group. "" is a valid name for a vertex group this is asking for trouble. --- source/blender/python/api2_2x/Particle.c | 153 ++++++++++++++++++++++++++ source/blender/python/api2_2x/doc/Particle.py | 21 ++++ 2 files changed, 174 insertions(+) (limited to 'source') diff --git a/source/blender/python/api2_2x/Particle.c b/source/blender/python/api2_2x/Particle.c index 5d40763bb3e..97bdc127426 100644 --- a/source/blender/python/api2_2x/Particle.c +++ b/source/blender/python/api2_2x/Particle.c @@ -67,6 +67,8 @@ static PyObject *Part_GetRot( BPy_PartSys * self, PyObject * args ); static PyObject *Part_SetMat( BPy_PartSys * self, PyObject * args ); static PyObject *Part_GetMat( BPy_PartSys * self, PyObject * args ); static PyObject *Part_GetSize( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_GetVertGroup( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_SetVertGroup( BPy_PartSys * self, PyObject * args ); static int Part_setSeed( BPy_PartSys * self, PyObject * args ); static PyObject *Part_getSeed( BPy_PartSys * self ); static int Part_setType( BPy_PartSys * self, PyObject * args ); @@ -276,6 +278,10 @@ static PyMethodDef BPy_ParticleSys_methods[] = { METH_VARARGS, "() - Get particles size in a list"}, {"getAge", ( PyCFunction ) Part_GetAge, METH_VARARGS, "() - Get particles life in a list"}, + {"getVertGroup", ( PyCFunction ) Part_GetVertGroup, + METH_VARARGS, "() - Get the vertex group which affects a particles attribute"}, + {"setVertGroup", ( PyCFunction ) Part_SetVertGroup, + METH_VARARGS, "() - Set the vertex group to affect a particles attribute"}, {NULL, NULL, 0, NULL} }; @@ -1134,6 +1140,44 @@ static PyObject *Particle_ChildTypeDict( void ) return ChildTypes; } +/* create the Blender.Particle.VertexGroups constant dict */ + +static PyObject *Particle_VertexGroupsDict( void ) +{ + PyObject *VertexGroups = PyConstant_New( ); + + if( VertexGroups ) { + BPy_constant *c = ( BPy_constant * ) VertexGroups; + + PyConstant_Insert( c, "EFFECTOR", + PyInt_FromLong( 11 ) ); + PyConstant_Insert( c, "TANROT", + PyInt_FromLong( 10 ) ); + PyConstant_Insert( c, "TANVEL", + PyInt_FromLong( 9 ) ); + PyConstant_Insert( c, "SIZE", + PyInt_FromLong( 8 ) ); + PyConstant_Insert( c, "ROUGHE", + PyInt_FromLong( 7 ) ); + PyConstant_Insert( c, "ROUGH2", + PyInt_FromLong( 6 ) ); + PyConstant_Insert( c, "ROUGH1", + PyInt_FromLong( 5 ) ); + PyConstant_Insert( c, "KINK", + PyInt_FromLong( 4 ) ); + PyConstant_Insert( c, "CLUMP", + PyInt_FromLong( 3 ) ); + PyConstant_Insert( c, "LENGHT", + PyInt_FromLong( 2 ) ); + PyConstant_Insert( c, "VELOCITY", + PyInt_FromLong( 1 ) ); + PyConstant_Insert( c, "DENSITY", + PyInt_FromLong( 0 ) ); + } + return VertexGroups; +} + + /* create the Blender.Particle.ChildKink constant dict */ static PyObject *Particle_ChildKinkDict( void ) @@ -1227,6 +1271,7 @@ PyObject *ParticleSys_Init( void ){ PyObject *Rotation; PyObject *AngularV; PyObject *ChildTypes; + PyObject *VertexGroups; PyObject *ChildKinks; PyObject *ChildKinkAxes; @@ -1243,6 +1288,7 @@ PyObject *ParticleSys_Init( void ){ Integrator = Particle_IntegratorDict(); Rotation = Particle_RotationDict(); AngularV = Particle_AngularVDict(); + VertexGroups = Particle_VertexGroupsDict(); ChildTypes = Particle_ChildTypeDict(); ChildKinks = Particle_ChildKinkDict(); ChildKinkAxes = Particle_ChildKinkAxisDict(); @@ -1268,6 +1314,8 @@ PyObject *ParticleSys_Init( void ){ PyModule_AddObject( submodule, "ROTATION", Rotation ); if( AngularV ) PyModule_AddObject( submodule, "ANGULARV", AngularV ); + if( VertexGroups ) + PyModule_AddObject( submodule, "VERTEXGROUPS", VertexGroups ); if( ChildTypes ) PyModule_AddObject( submodule, "CHILDTYPE", ChildTypes ); if( ChildKinks ) @@ -1854,6 +1902,111 @@ static PyObject *Part_GetMat( BPy_PartSys * self, PyObject * args ){ return mat; } +static PyObject *Part_GetVertGroup( BPy_PartSys * self, PyObject * args ){ + PyObject *list; + char errstr[128]; + bDeformGroup *defGroup = NULL; + Object *obj = self->object; + int vg_attribute = 0; + int vg_number = 0; + int count; + PyObject *vg_neg; + PyObject *vg_name; + + if( !obj ) + return EXPP_ReturnPyObjError( PyExc_AttributeError, + "particle system must be linked to an object first" ); + + if( obj->type != OB_MESH ) + return EXPP_ReturnPyObjError( PyExc_AttributeError, + "linked object is not a mesh" ); + + if( !PyArg_ParseTuple( args, "i", &vg_attribute ) ) + return EXPP_ReturnPyObjError( PyExc_TypeError, + "expected integer argument" ); + + if( vg_attribute < 0 || vg_attribute > PSYS_TOT_VG-1 ){ + sprintf ( errstr, "expected int argument in [0,%d]", PSYS_TOT_VG-1 ); + return EXPP_ReturnPyObjError( PyExc_TypeError, errstr ); + } + + /*search*/ + vg_number = self->psys->vgroup[vg_attribute]; + count = 1; + defGroup = obj->defbase.first; + while(countnext; + count++; + } + + /*vg_name*/ + if (defGroup && vg_number>0) + vg_name = PyString_FromString( defGroup->name ); + else + vg_name = PyString_FromString( "" ); + + /*vg_neg*/ + vg_neg = PyInt_FromLong( ((long)( self->psys->vg_neg & (1< 0 ); + + list = PyList_New( 2 ); + PyList_SET_ITEM( list, 0, vg_name ); + PyList_SET_ITEM( list, 1, vg_neg ); + + return list; +} + +static PyObject *Part_SetVertGroup( BPy_PartSys * self, PyObject * args ){ + char errstr[128]; + bDeformGroup *defGroup; + Object *obj = self->object; + char *vg_name = NULL; + int vg_attribute = 0; + int vg_neg = 0; + int vg_number = 0; + int count; + + if( !obj ) + return EXPP_ReturnPyObjError( PyExc_AttributeError, + "particle system must be linked to an object first" ); + + if( obj->type != OB_MESH ) + return EXPP_ReturnPyObjError( PyExc_AttributeError, + "linked object is not a mesh" ); + + if( !PyArg_ParseTuple( args, "sii", &vg_name, &vg_attribute, &vg_neg ) ) + return EXPP_ReturnPyObjError( PyExc_TypeError, + "expected one string and two integers arguments" ); + + if( vg_attribute < 0 || vg_attribute > PSYS_TOT_VG-1 ){ + sprintf ( errstr, "expected int argument in [0,%d]", PSYS_TOT_VG-1 ); + return EXPP_ReturnPyObjError( PyExc_TypeError, errstr ); + } + + /*search*/ + count = 1; + defGroup = obj->defbase.first; + while (defGroup){ + if (strcmp(vg_name,defGroup->name)==0) + vg_number = count; + defGroup = defGroup->next; + count++; + } + + /*vgroup*/ + self->psys->vgroup[vg_attribute] = vg_number; + + /*vg_neg*/ + if (vg_neg){ + self->psys->vg_neg |= (1<psys->vg_neg &= ~(1<psys->part, PSYS_ALLOC, 1 ); + + Py_RETURN_NONE; +} + /*****************************************************************************/ /* Function: Set/Get Seed */ diff --git a/source/blender/python/api2_2x/doc/Particle.py b/source/blender/python/api2_2x/doc/Particle.py index 82d197f71dd..888747f6225 100644 --- a/source/blender/python/api2_2x/doc/Particle.py +++ b/source/blender/python/api2_2x/doc/Particle.py @@ -340,3 +340,24 @@ class Particle: @rtype: list of floats @return: list of floats or list of tuples if id is not zero (size,id) or None if system is disabled. """ + + def getVertGroup(attribute): + """ + Get vertex group name and negation bit assigned to affect parameter attribute. + A list of string and integer (vertex group name, negation bit). + @type attribute: int + @param attribute: Particle.VERTEXGROUPS([ 'DENSITY' | 'VELOCITY' | ... ]) + @rtype: list of objects + @return: first element is the vg name and second the negation bit + """ + def setVertGroup(name,attribute,negated): + """ + Set vertex group and negation bit to affect particles system attribute. + @type name: string + @param name: Name of the vertex group + @type attribute: int + @param attribute: Particle.VERTEXGROUPS([ 'DENSITY' | 'VELOCITY' | ... ]) + @type negated: int + @param negated: Negate the effect of the vertex group + @return: None + """ -- cgit v1.2.3 From f790744faf3ee8e3d65afa0cdc65f7efc24b87ab Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Tue, 12 May 2009 23:41:46 +0000 Subject: Fix crash when missing int argument for -s -e and -j. --- source/creator/creator.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/creator/creator.c b/source/creator/creator.c index 2b542b13c97..a39d2916a84 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -662,7 +662,8 @@ int main(int argc, char **argv) a++; if (G.scene) { if (a < argc) { - int frame= MIN2(MAXFRAME, MAX2(1, atoi(argv[a]))); + int frame = atoi(argv[a]); + frame = MIN2(MAXFRAME, MAX2(1, frame)); Render *re= RE_NewRender(G.scene->id.name); #ifndef DISABLE_PYTHON if (G.f & G_DOSCRIPTLINKS) @@ -701,8 +702,10 @@ int main(int argc, char **argv) case 's': a++; if(G.scene) { - int frame= MIN2(MAXFRAME, MAX2(1, atoi(argv[a]))); - if (a < argc) (G.scene->r.sfra) = frame; + if (a < argc) { + int frame = atoi(argv[a]); + (G.scene->r.sfra) = MIN2(MAXFRAME, MAX2(1, frame)); + } } else { printf("\nError: no blend loaded. cannot use '-s'.\n"); } @@ -710,8 +713,10 @@ int main(int argc, char **argv) case 'e': a++; if(G.scene) { - int frame= MIN2(MAXFRAME, MAX2(1, atoi(argv[a]))); - if (a < argc) (G.scene->r.efra) = frame; + if (a < argc) { + int frame = atoi(argv[a]); + (G.scene->r.efra) = MIN2(MAXFRAME, MAX2(1, frame)); + } } else { printf("\nError: no blend loaded. cannot use '-e'.\n"); } @@ -719,8 +724,10 @@ int main(int argc, char **argv) case 'j': a++; if(G.scene) { - int fstep= MIN2(MAXFRAME, MAX2(1, atoi(argv[a]))); - if (a < argc) (G.scene->frame_step) = fstep; + if (a < argc) { + int frame = atoi(argv[a]); + (G.scene->frame_step) = MIN2(MAXFRAME, MAX2(1, frame)); + } } else { printf("\nError: no blend loaded. cannot use '-j'.\n"); } -- cgit v1.2.3 From 9147124ac2813f79bc44ae54ca2676c8afab0ade Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Tue, 12 May 2009 23:53:55 +0000 Subject: Mixed declaration and code. That should teach me to ignore warnings. --- source/creator/creator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/creator/creator.c b/source/creator/creator.c index a39d2916a84..e04a5b1db3d 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -663,8 +663,9 @@ int main(int argc, char **argv) if (G.scene) { if (a < argc) { int frame = atoi(argv[a]); + Render *re = RE_NewRender(G.scene->id.name); + frame = MIN2(MAXFRAME, MAX2(1, frame)); - Render *re= RE_NewRender(G.scene->id.name); #ifndef DISABLE_PYTHON if (G.f & G_DOSCRIPTLINKS) BPY_do_all_scripts(SCRIPT_RENDER, 0); -- cgit v1.2.3 From 82b4975ccfa8fe2c72278388a3cf3a8432cc9fb0 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 13 May 2009 06:42:15 +0000 Subject: BGE #18732: Python Light options don't work with GLSL materials. Commited patch from dfelinto and moguri, thanks for the good work. --- source/blender/gpu/GPU_material.h | 1 + source/blender/gpu/intern/gpu_material.c | 12 ++++++++++++ source/blender/src/drawview.c | 2 ++ source/gameengine/Ketsji/KX_Light.cpp | 9 +++++++++ source/gameengine/Ketsji/KX_Light.h | 1 + 5 files changed, 25 insertions(+) (limited to 'source') diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index ccc687858f4..49c0dc166c1 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -159,6 +159,7 @@ void GPU_lamp_shadow_buffer_bind(GPULamp *lamp, float viewmat[][4], int *winsize void GPU_lamp_shadow_buffer_unbind(GPULamp *lamp); void GPU_lamp_update(GPULamp *lamp, int lay, float obmat[][4]); +void GPU_lamp_update_colors(GPULamp *lamp, float r, float g, float b, float energy); int GPU_lamp_shadow_layer(GPULamp *lamp); #ifdef __cplusplus diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 87703bc73bf..f7052694fc7 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1306,6 +1306,18 @@ void GPU_lamp_update(GPULamp *lamp, int lay, float obmat[][4]) Mat4Invert(lamp->imat, mat); } +void GPU_lamp_update_colors(GPULamp *lamp, float r, float g, float b, float energy) +{ + lamp->la->energy = energy; + lamp->la->r = r; + lamp->la->g = g; + lamp->la->b = b; + + lamp->col[0]= lamp->la->r*lamp->energy; + lamp->col[1]= lamp->la->g*lamp->energy; + lamp->col[2]= lamp->la->b*lamp->energy; +} + static void gpu_lamp_from_blender(Scene *scene, Object *ob, Object *par, Lamp *la, GPULamp *lamp) { float temp, angle, pixsize, wsize; diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index d6184f42410..9b2f7fe53d9 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -3152,12 +3152,14 @@ typedef struct View3DShadow{ static void gpu_render_lamp_update(View3D *v3d, Object *ob, Object *par, float obmat[][4], ListBase *shadows) { GPULamp *lamp; + Lamp *la = (Lamp*)ob->data; View3DShadow *shadow; lamp = GPU_lamp_from_blender(G.scene, ob, par); if(lamp) { GPU_lamp_update(lamp, ob->lay, obmat); + GPU_lamp_update_colors(lamp, la->r, la->g, la->b, la->energy); if((ob->lay & v3d->lay) && GPU_lamp_has_shadow_buffer(lamp)) { shadow= MEM_callocN(sizeof(View3DShadow), "View3DShadow"); diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index 777a7f32629..3af34c39123 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -61,6 +61,11 @@ KX_LightObject::KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks, m_rendertools->AddLight(&m_lightobj); m_glsl = glsl; m_blenderscene = ((KX_Scene*)sgReplicationInfo)->GetBlenderScene(); + + m_initialvalues[0] = lightobj.m_red; + m_initialvalues[1] = lightobj.m_green; + m_initialvalues[2] = lightobj.m_blue; + m_initialvalues[3] = lightobj.m_energy; }; @@ -71,6 +76,8 @@ KX_LightObject::~KX_LightObject() if((lamp = GetGPULamp())) { float obmat[4][4] = {{0}}; GPU_lamp_update(lamp, 0, obmat); + GPU_lamp_update_colors(lamp, m_initialvalues[0], m_initialvalues[1], + m_initialvalues[2], m_initialvalues[3]); } m_rendertools->RemoveLight(&m_lightobj); @@ -114,6 +121,8 @@ void KX_LightObject::Update() obmat[i][j] = (float)*dobmat; GPU_lamp_update(lamp, m_lightobj.m_layer, obmat); + GPU_lamp_update_colors(lamp, m_lightobj.m_red, m_lightobj.m_green, + m_lightobj.m_blue, m_lightobj.m_energy); } } diff --git a/source/gameengine/Ketsji/KX_Light.h b/source/gameengine/Ketsji/KX_Light.h index 35f25515e3b..690231ff090 100644 --- a/source/gameengine/Ketsji/KX_Light.h +++ b/source/gameengine/Ketsji/KX_Light.h @@ -44,6 +44,7 @@ class KX_LightObject : public KX_GameObject Py_Header; protected: RAS_LightObject m_lightobj; + float m_initialvalues [4]; class RAS_IRenderTools* m_rendertools; //needed for registering and replication of lightobj bool m_glsl; Scene* m_blenderscene; -- cgit v1.2.3 From 24f326fb014be09b63850ef1effd02f9697ccf79 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 May 2009 10:15:19 +0000 Subject: Moved game engine types into GameTypes.py because every type put into a module giving lots of references to KX_GameObject.KX_GameObject and having to write in links like L{CListValue}. Looked into ways around this but epydoc has no way to import a class without its module and the @include field is maked as 'TODO'. Also removed the outdated 'WhatsNew' section and linked to the 2.49 release notes. --- source/gameengine/PyDoc/BL_ActionActuator.py | 230 - source/gameengine/PyDoc/BL_Shader.py | 248 - source/gameengine/PyDoc/BL_ShapeActionActuator.py | 199 - source/gameengine/PyDoc/CListValue.py | 61 - source/gameengine/PyDoc/CPropValue.py | 8 - source/gameengine/PyDoc/CValue.py | 8 - source/gameengine/PyDoc/GameLogic.py | 70 +- source/gameengine/PyDoc/GameTypes.py | 5468 +++++++++++++++++++- source/gameengine/PyDoc/KX_BlenderMaterial.py | 41 - source/gameengine/PyDoc/KX_CDActuator.py | 55 - source/gameengine/PyDoc/KX_Camera.py | 212 - source/gameengine/PyDoc/KX_CameraActuator.py | 98 - source/gameengine/PyDoc/KX_ConstraintActuator.py | 249 - source/gameengine/PyDoc/KX_ConstraintWrapper.py | 28 - source/gameengine/PyDoc/KX_GameActuator.py | 31 - source/gameengine/PyDoc/KX_GameObject.py | 507 -- source/gameengine/PyDoc/KX_IpoActuator.py | 124 - source/gameengine/PyDoc/KX_LightObject.py | 45 - source/gameengine/PyDoc/KX_MeshProxy.py | 134 - source/gameengine/PyDoc/KX_MouseFocusSensor.py | 67 - source/gameengine/PyDoc/KX_NearSensor.py | 14 - .../gameengine/PyDoc/KX_NetworkMessageActuator.py | 49 - source/gameengine/PyDoc/KX_NetworkMessageSensor.py | 60 - source/gameengine/PyDoc/KX_ObjectActuator.py | 250 - source/gameengine/PyDoc/KX_ParentActuator.py | 29 - source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py | 60 - source/gameengine/PyDoc/KX_PolyProxy.py | 101 - source/gameengine/PyDoc/KX_PolygonMaterial.py | 281 - source/gameengine/PyDoc/KX_RadarSensor.py | 49 - source/gameengine/PyDoc/KX_RaySensor.py | 58 - .../gameengine/PyDoc/KX_SCA_AddObjectActuator.py | 118 - source/gameengine/PyDoc/KX_SCA_DynamicActuator.py | 30 - .../gameengine/PyDoc/KX_SCA_EndObjectActuator.py | 11 - .../gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py | 84 - source/gameengine/PyDoc/KX_Scene.py | 97 - source/gameengine/PyDoc/KX_SceneActuator.py | 71 - source/gameengine/PyDoc/KX_SoundActuator.py | 195 - source/gameengine/PyDoc/KX_StateActuator.py | 44 - source/gameengine/PyDoc/KX_TouchSensor.py | 63 - source/gameengine/PyDoc/KX_TrackToActuator.py | 70 - source/gameengine/PyDoc/KX_VehicleWrapper.py | 160 - source/gameengine/PyDoc/KX_VertexProxy.py | 152 - source/gameengine/PyDoc/KX_VisibilityActuator.py | 22 - source/gameengine/PyDoc/PyObjectPlus.py | 26 - source/gameengine/PyDoc/SCA_2DFilterActuator.py | 44 - source/gameengine/PyDoc/SCA_ANDController.py | 11 - source/gameengine/PyDoc/SCA_ActuatorSensor.py | 33 - source/gameengine/PyDoc/SCA_AlwaysSensor.py | 9 - source/gameengine/PyDoc/SCA_DelaySensor.py | 72 - source/gameengine/PyDoc/SCA_IActuator.py | 9 - source/gameengine/PyDoc/SCA_IController.py | 63 - source/gameengine/PyDoc/SCA_ILogicBrick.py | 49 - source/gameengine/PyDoc/SCA_IObject.py | 9 - source/gameengine/PyDoc/SCA_ISensor.py | 112 - source/gameengine/PyDoc/SCA_JoystickSensor.py | 169 - source/gameengine/PyDoc/SCA_KeyboardSensor.py | 116 - source/gameengine/PyDoc/SCA_MouseSensor.py | 44 - source/gameengine/PyDoc/SCA_NANDController.py | 11 - source/gameengine/PyDoc/SCA_NORController.py | 11 - source/gameengine/PyDoc/SCA_ORController.py | 11 - source/gameengine/PyDoc/SCA_PropertyActuator.py | 49 - source/gameengine/PyDoc/SCA_PropertySensor.py | 74 - source/gameengine/PyDoc/SCA_PythonController.py | 41 - source/gameengine/PyDoc/SCA_RandomActuator.py | 175 - source/gameengine/PyDoc/SCA_RandomSensor.py | 35 - source/gameengine/PyDoc/SCA_XNORController.py | 11 - source/gameengine/PyDoc/SCA_XORController.py | 11 - source/gameengine/PyDoc/WhatsNew.py | 34 - 68 files changed, 5432 insertions(+), 5748 deletions(-) delete mode 100644 source/gameengine/PyDoc/BL_ActionActuator.py delete mode 100644 source/gameengine/PyDoc/BL_Shader.py delete mode 100644 source/gameengine/PyDoc/BL_ShapeActionActuator.py delete mode 100644 source/gameengine/PyDoc/CListValue.py delete mode 100644 source/gameengine/PyDoc/CPropValue.py delete mode 100644 source/gameengine/PyDoc/CValue.py delete mode 100644 source/gameengine/PyDoc/KX_BlenderMaterial.py delete mode 100644 source/gameengine/PyDoc/KX_CDActuator.py delete mode 100644 source/gameengine/PyDoc/KX_Camera.py delete mode 100644 source/gameengine/PyDoc/KX_CameraActuator.py delete mode 100644 source/gameengine/PyDoc/KX_ConstraintActuator.py delete mode 100644 source/gameengine/PyDoc/KX_ConstraintWrapper.py delete mode 100644 source/gameengine/PyDoc/KX_GameActuator.py delete mode 100644 source/gameengine/PyDoc/KX_GameObject.py delete mode 100644 source/gameengine/PyDoc/KX_IpoActuator.py delete mode 100644 source/gameengine/PyDoc/KX_LightObject.py delete mode 100644 source/gameengine/PyDoc/KX_MeshProxy.py delete mode 100644 source/gameengine/PyDoc/KX_MouseFocusSensor.py delete mode 100644 source/gameengine/PyDoc/KX_NearSensor.py delete mode 100644 source/gameengine/PyDoc/KX_NetworkMessageActuator.py delete mode 100644 source/gameengine/PyDoc/KX_NetworkMessageSensor.py delete mode 100644 source/gameengine/PyDoc/KX_ObjectActuator.py delete mode 100644 source/gameengine/PyDoc/KX_ParentActuator.py delete mode 100644 source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py delete mode 100644 source/gameengine/PyDoc/KX_PolyProxy.py delete mode 100644 source/gameengine/PyDoc/KX_PolygonMaterial.py delete mode 100644 source/gameengine/PyDoc/KX_RadarSensor.py delete mode 100644 source/gameengine/PyDoc/KX_RaySensor.py delete mode 100644 source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py delete mode 100644 source/gameengine/PyDoc/KX_SCA_DynamicActuator.py delete mode 100644 source/gameengine/PyDoc/KX_SCA_EndObjectActuator.py delete mode 100644 source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py delete mode 100644 source/gameengine/PyDoc/KX_Scene.py delete mode 100644 source/gameengine/PyDoc/KX_SceneActuator.py delete mode 100644 source/gameengine/PyDoc/KX_SoundActuator.py delete mode 100644 source/gameengine/PyDoc/KX_StateActuator.py delete mode 100644 source/gameengine/PyDoc/KX_TouchSensor.py delete mode 100644 source/gameengine/PyDoc/KX_TrackToActuator.py delete mode 100644 source/gameengine/PyDoc/KX_VehicleWrapper.py delete mode 100644 source/gameengine/PyDoc/KX_VertexProxy.py delete mode 100644 source/gameengine/PyDoc/KX_VisibilityActuator.py delete mode 100644 source/gameengine/PyDoc/PyObjectPlus.py delete mode 100644 source/gameengine/PyDoc/SCA_2DFilterActuator.py delete mode 100644 source/gameengine/PyDoc/SCA_ANDController.py delete mode 100644 source/gameengine/PyDoc/SCA_ActuatorSensor.py delete mode 100644 source/gameengine/PyDoc/SCA_AlwaysSensor.py delete mode 100644 source/gameengine/PyDoc/SCA_DelaySensor.py delete mode 100644 source/gameengine/PyDoc/SCA_IActuator.py delete mode 100644 source/gameengine/PyDoc/SCA_IController.py delete mode 100644 source/gameengine/PyDoc/SCA_ILogicBrick.py delete mode 100644 source/gameengine/PyDoc/SCA_IObject.py delete mode 100644 source/gameengine/PyDoc/SCA_ISensor.py delete mode 100644 source/gameengine/PyDoc/SCA_JoystickSensor.py delete mode 100644 source/gameengine/PyDoc/SCA_KeyboardSensor.py delete mode 100644 source/gameengine/PyDoc/SCA_MouseSensor.py delete mode 100644 source/gameengine/PyDoc/SCA_NANDController.py delete mode 100644 source/gameengine/PyDoc/SCA_NORController.py delete mode 100644 source/gameengine/PyDoc/SCA_ORController.py delete mode 100644 source/gameengine/PyDoc/SCA_PropertyActuator.py delete mode 100644 source/gameengine/PyDoc/SCA_PropertySensor.py delete mode 100644 source/gameengine/PyDoc/SCA_PythonController.py delete mode 100644 source/gameengine/PyDoc/SCA_RandomActuator.py delete mode 100644 source/gameengine/PyDoc/SCA_RandomSensor.py delete mode 100644 source/gameengine/PyDoc/SCA_XNORController.py delete mode 100644 source/gameengine/PyDoc/SCA_XORController.py delete mode 100644 source/gameengine/PyDoc/WhatsNew.py (limited to 'source') diff --git a/source/gameengine/PyDoc/BL_ActionActuator.py b/source/gameengine/PyDoc/BL_ActionActuator.py deleted file mode 100644 index 455f83d5ce7..00000000000 --- a/source/gameengine/PyDoc/BL_ActionActuator.py +++ /dev/null @@ -1,230 +0,0 @@ -# $Id$ -# Documentation for BL_ActionActuator -import SCA_ILogicBrick -from SCA_IActuator import * - - -class BL_ActionActuator(SCA_IActuator): - """ - Action Actuators apply an action to an actor. - - @ivar action: The name of the action to set as the current action. - @type action: string - @ivar start: Specifies the starting frame of the animation. - @type start: float - @ivar end: Specifies the ending frame of the animation. - @type end: float - @ivar blendin: Specifies the number of frames of animation to generate when making transitions between actions. - @type blendin: float - @ivar priority: Sets the priority of this actuator. Actuators will lower - priority numbers will override actuators with higher - numbers. - @type priority: integer - @ivar frame: Sets the current frame for the animation. - @type frame: float - @ivar property: Sets the property to be used in FromProp playback mode. - @type property: string - @ivar blendTime: Sets the internal frame timer. This property must be in - the range from 0.0 to blendin. - @type blendTime: float - @ivar type: The operation mode of the actuator. KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND - @type type: integer - @ivar useContinue: The actions continue option, True or False. - When True, the action will always play from where last left off, - otherwise negative events to this actuator will reset it to its start frame. - @type: boolean - @ivar frameProperty: The name of the property that is set to the current frame number. - @type frameProperty: string - """ - def setChannel(channel, matrix, mode = False): - """ - @param channel: A string specifying the name of the bone channel. - @type channel: string - @param matrix: A 4x4 matrix specifying the overriding transformation - as an offset from the bone's rest position. - @type matrix: list [[float]] - @param mode: True for armature/world space, False for bone space - @type mode: boolean - """ - - #--The following methods are deprecated-- - def setAction(action, reset = True): - """ - DEPRECATED: use the 'action' property - Sets the current action. - - @param action: The name of the action to set as the current action. - @type action: string - @param reset: Optional parameter indicating whether to reset the - blend timer or not. A value of 1 indicates that the - timer should be reset. A value of 0 will leave it - unchanged. If reset is not specified, the timer will - be reset. - """ - - def setStart(start): - """ - DEPRECATED: use the 'start' property - Specifies the starting frame of the animation. - - @param start: the starting frame of the animation - @type start: float - """ - - def setEnd(end): - """ - DEPRECATED: use the 'end' property - Specifies the ending frame of the animation. - - @param end: the ending frame of the animation - @type end: float - """ - def setBlendin(blendin): - """ - DEPRECATED: use the 'blendin' property - Specifies the number of frames of animation to generate - when making transitions between actions. - - @param blendin: the number of frames in transition. - @type blendin: float - """ - - def setPriority(priority): - """ - DEPRECATED: use the 'priority' property - Sets the priority of this actuator. - - @param priority: Specifies the new priority. Actuators will lower - priority numbers will override actuators with higher - numbers. - @type priority: integer - """ - def setFrame(frame): - """ - DEPRECATED: use the 'frame' property - Sets the current frame for the animation. - - @param frame: Specifies the new current frame for the animation - @type frame: float - """ - - def setProperty(prop): - """ - DEPRECATED: use the 'property' property - Sets the property to be used in FromProp playback mode. - - @param prop: the name of the property to use. - @type prop: string. - """ - - def setBlendtime(blendtime): - """ - DEPRECATED: use the 'blendTime' property - Sets the internal frame timer. - - Allows the script to directly modify the internal timer - used when generating transitions between actions. - - @param blendtime: The new time. This parameter must be in the range from 0.0 to 1.0. - @type blendtime: float - """ - - def setType(mode): - """ - DEPRECATED: use the 'type' property - Sets the operation mode of the actuator - - @param mode: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND - @type mode: integer - """ - - def setContinue(cont): - """ - DEPRECATED: use the 'continue' property - Set the actions continue option True or False. see getContinue. - - @param cont: The continue option. - @type cont: bool - """ - - def getType(): - """ - DEPRECATED: use the 'type' property - Returns the operation mode of the actuator - - @rtype: integer - @return: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND - """ - - def getContinue(): - """ - DEPRECATED: use the 'continue' property - When True, the action will always play from where last left off, otherwise negative events to this actuator will reset it to its start frame. - - @rtype: bool - """ - - def getAction(): - """ - DEPRECATED: use the 'action' property - getAction() returns the name of the action associated with this actuator. - - @rtype: string - """ - - def getStart(): - """ - DEPRECATED: use the 'start' property - Returns the starting frame of the action. - - @rtype: float - """ - def getEnd(): - """ - DEPRECATED: use the 'end' property - Returns the last frame of the action. - - @rtype: float - """ - def getBlendin(): - """ - DEPRECATED: use the 'blendin' property - Returns the number of interpolation animation frames to be generated when this actuator is triggered. - - @rtype: float - """ - def getPriority(): - """ - DEPRECATED: use the 'priority' property - Returns the priority for this actuator. Actuators with lower Priority numbers will - override actuators with higher numbers. - - @rtype: integer - """ - def getFrame(): - """ - DEPRECATED: use the 'frame' property - Returns the current frame number. - - @rtype: float - """ - def getProperty(): - """ - DEPRECATED: use the 'property' property - Returns the name of the property to be used in FromProp mode. - - @rtype: string - """ - def setFrameProperty(prop): - """ - DEPRECATED: use the 'frameProperty' property - @param prop: A string specifying the property of the object that will be updated with the action frame number. - @type prop: string - """ - def getFrameProperty(): - """ - DEPRECATED: use the 'frameProperty' property - Returns the name of the property that is set to the current frame number. - - @rtype: string - """ diff --git a/source/gameengine/PyDoc/BL_Shader.py b/source/gameengine/PyDoc/BL_Shader.py deleted file mode 100644 index 8fd4ae7c7ac..00000000000 --- a/source/gameengine/PyDoc/BL_Shader.py +++ /dev/null @@ -1,248 +0,0 @@ - -from PyObjectPlus import * - -class BL_Shader(PyObjectPlus): - """ - BL_Shader GLSL shaders. - - TODO - Description - """ - - def setUniformfv(name, fList): - """ - Set a uniform with a list of float values - - @param name: the uniform name - @type name: string - - @param fList: a list (2, 3 or 4 elements) of float values - @type fList: list[float] - """ - - def delSource(): - """ - TODO - Description - - """ - def getFragmentProg(): - """ - Returns the fragment program. - - @rtype: string - @return: The fragment program. - """ - def getVertexProg(): - """ - Get the vertex program. - - @rtype: string - @return: The vertex program. - """ - def isValid(): - """ - Check if the shader is valid. - - @rtype: bool - @return: True if the shader is valid - """ - def setAttrib(enum): - """ - Set attribute location. (The parameter is ignored a.t.m. and the value of "tangent" is always used.) - - @param enum: attribute location value - @type enum: integer - """ - def setNumberOfPasses( max_pass ): - """ - Set the maximum number of passes. Not used a.t.m. - - @param max_pass: the maximum number of passes - @type max_pass: integer - """ - def setSampler(name, index): - """ - Set uniform texture sample index. - - @param name: Uniform name - @type name: string - - @param index: Texture sample index. - @type index: integer - """ - def setSource(vertexProgram, fragmentProgram): - """ - Set the vertex and fragment programs - - @param vertexProgram: Vertex program - @type vertexProgram: string - - @param fragmentProgram: Fragment program - @type fragmentProgram: string - """ - def setUniform1f(name, fx): - """ - Set a uniform with 1 float value. - - @param name: the uniform name - @type name: string - - @param fx: Uniform value - @type fx: float - """ - def setUniform1i(name, ix): - """ - Set a uniform with an integer value. - - @param name: the uniform name - @type name: string - - @param ix: the uniform value - @type ix: integer - """ - def setUniform2f(name, fx, fy): - """ - Set a uniform with 2 float values - - @param name: the uniform name - @type name: string - - @param fx: first float value - @type fx: float - - @param fy: second float value - @type fy: float - """ - def setUniform2i(name, ix, iy): - """ - Set a uniform with 2 integer values - - @param name: the uniform name - @type name: string - - @param ix: first integer value - @type ix: integer - - @param iy: second integer value - @type iy: integer - """ - def setUniform3f(name, fx,fy,fz): - """ - Set a uniform with 3 float values. - - @param name: the uniform name - @type name: string - - @param fx: first float value - @type fx: float - - @param fy: second float value - @type fy: float - - @param fz: third float value - @type fz: float - """ - def setUniform3i(name, ix,iy,iz): - """ - Set a uniform with 3 integer values - - @param name: the uniform name - @type name: string - - @param ix: first integer value - @type ix: integer - - @param iy: second integer value - @type iy: integer - - @param iz: third integer value - @type iz: integer - """ - def setUniform4f(name, fx,fy,fz,fw): - """ - Set a uniform with 4 float values. - - @param name: the uniform name - @type name: string - - @param fx: first float value - @type fx: float - - @param fy: second float value - @type fy: float - - @param fz: third float value - @type fz: float - - @param fw: fourth float value - @type fw: float - """ - def setUniform4i(name, ix,iy,iz, iw): - """ - Set a uniform with 4 integer values - - @param name: the uniform name - @type name: string - - @param ix: first integer value - @type ix: integer - - @param iy: second integer value - @type iy: integer - - @param iz: third integer value - @type iz: integer - - @param iw: fourth integer value - @type iw: integer - """ - def setUniformDef(name, type): - """ - Define a new uniform - - @param name: the uniform name - @type name: string - - @param type: uniform type - @type type: UNI_NONE, UNI_INT, UNI_FLOAT, UNI_INT2, UNI_FLOAT2, UNI_INT3, UNI_FLOAT3, UNI_INT4, UNI_FLOAT4, UNI_MAT3, UNI_MAT4, UNI_MAX - """ - def setUniformMatrix3(name, mat, transpose): - """ - Set a uniform with a 3x3 matrix value - - @param name: the uniform name - @type name: string - - @param mat: A 3x3 matrix [[f,f,f], [f,f,f], [f,f,f]] - @type mat: 3x3 matrix - - @param transpose: set to True to transpose the matrix - @type transpose: bool - """ - def setUniformMatrix4(name, mat, transpose): - """ - Set a uniform with a 4x4 matrix value - - @param name: the uniform name - @type name: string - - @param mat: A 4x4 matrix [[f,f,f,f], [f,f,f,f], [f,f,f,f], [f,f,f,f]] - @type mat: 4x4 matrix - - @param transpose: set to True to transpose the matrix - @type transpose: bool - """ - def setUniformiv(name, iList): - """ - Set a uniform with a list of integer values - - @param name: the uniform name - @type name: string - - @param iList: a list (2, 3 or 4 elements) of integer values - @type iList: list[integer] - """ - def validate(): - """ - Validate the shader object. - - """ diff --git a/source/gameengine/PyDoc/BL_ShapeActionActuator.py b/source/gameengine/PyDoc/BL_ShapeActionActuator.py deleted file mode 100644 index e1e8b039749..00000000000 --- a/source/gameengine/PyDoc/BL_ShapeActionActuator.py +++ /dev/null @@ -1,199 +0,0 @@ -# $Id$ -# Documentation for BL_ShapeActionActuator -from SCA_IActuator import * -from SCA_ILogicBrick import * - -class BL_ShapeActionActuator(SCA_IActuator): - """ - ShapeAction Actuators apply an shape action to an mesh object.\ - - @ivar action: The name of the action to set as the current shape action. - @type action: string - @ivar start: Specifies the starting frame of the shape animation. - @type start: float - @ivar end: Specifies the ending frame of the shape animation. - @type end: float - @ivar blendin: Specifies the number of frames of animation to generate when making transitions between actions. - @type blendin: float - @ivar priority: Sets the priority of this actuator. Actuators will lower - priority numbers will override actuators with higher - numbers. - @type priority: integer - @ivar frame: Sets the current frame for the animation. - @type frame: float - @ivar property: Sets the property to be used in FromProp playback mode. - @type property: string - @ivar blendTime: Sets the internal frame timer. This property must be in - the range from 0.0 to blendin. - @type blendTime: float - @ivar type: The operation mode of the actuator. - KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, - KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND - @type type: integer - @ivar frameProperty: The name of the property that is set to the current frame number. - @type frameProperty: string - - """ - def setAction(action, reset = True): - """ - DEPRECATED: use the 'action' property - Sets the current action. - - @param action: The name of the action to set as the current action. - @type action: string - @param reset: Optional parameter indicating whether to reset the - blend timer or not. A value of 1 indicates that the - timer should be reset. A value of 0 will leave it - unchanged. If reset is not specified, the timer will - be reset. - """ - - def setStart(start): - """ - DEPRECATED: use the 'start' property - Specifies the starting frame of the animation. - - @param start: the starting frame of the animation - @type start: float - """ - - def setEnd(end): - """ - DEPRECATED: use the 'end' property - Specifies the ending frame of the animation. - - @param end: the ending frame of the animation - @type end: float - """ - def setBlendin(blendin): - """ - DEPRECATED: use the 'blendin' property - Specifies the number of frames of animation to generate - when making transitions between actions. - - @param blendin: the number of frames in transition. - @type blendin: float - """ - - def setPriority(priority): - """ - DEPRECATED: use the 'priority' property - Sets the priority of this actuator. - - @param priority: Specifies the new priority. Actuators will lower - priority numbers will override actuators with higher - numbers. - @type priority: integer - """ - def setFrame(frame): - """ - DEPRECATED: use the 'frame' property - Sets the current frame for the animation. - - @param frame: Specifies the new current frame for the animation - @type frame: float - """ - - def setProperty(prop): - """ - DEPRECATED: use the 'property' property - Sets the property to be used in FromProp playback mode. - - @param prop: the name of the property to use. - @type prop: string. - """ - - def setBlendtime(blendtime): - """ - DEPRECATED: use the 'blendTime' property - Sets the internal frame timer. - - Allows the script to directly modify the internal timer - used when generating transitions between actions. - - @param blendtime: The new time. This parameter must be in the range from 0.0 to 1.0. - @type blendtime: float - """ - - def setType(mode): - """ - DEPRECATED: use the 'type' property - Sets the operation mode of the actuator - - @param mode: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND - @type mode: integer - """ - - def getType(): - """ - DEPRECATED: use the 'type' property - Returns the operation mode of the actuator - - @rtype: integer - @return: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND - """ - - def getAction(): - """ - DEPRECATED: use the 'action' property - getAction() returns the name of the action associated with this actuator. - - @rtype: string - """ - - def getStart(): - """ - DEPRECATED: use the 'start' property - Returns the starting frame of the action. - - @rtype: float - """ - def getEnd(): - """ - DEPRECATED: use the 'end' property - Returns the last frame of the action. - - @rtype: float - """ - def getBlendin(): - """ - DEPRECATED: use the 'blendin' property - Returns the number of interpolation animation frames to be generated when this actuator is triggered. - - @rtype: float - """ - def getPriority(): - """ - DEPRECATED: use the 'priority' property - Returns the priority for this actuator. Actuators with lower Priority numbers will - override actuators with higher numbers. - - @rtype: integer - """ - def getFrame(): - """ - DEPRECATED: use the 'frame' property - Returns the current frame number. - - @rtype: float - """ - def getProperty(): - """ - DEPRECATED: use the 'property' property - Returns the name of the property to be used in FromProp mode. - - @rtype: string - """ - def setFrameProperty(prop): - """ - DEPRECATED: use the 'frameProperty' property - @param prop: A string specifying the property of the object that will be updated with the action frame number. - @type prop: string - """ - def getFrameProperty(): - """ - DEPRECATED: use the 'frameProperty' property - Returns the name of the property that is set to the current frame number. - - @rtype: string - """ diff --git a/source/gameengine/PyDoc/CListValue.py b/source/gameengine/PyDoc/CListValue.py deleted file mode 100644 index 1f60e8a7bc2..00000000000 --- a/source/gameengine/PyDoc/CListValue.py +++ /dev/null @@ -1,61 +0,0 @@ -from CPropValue import * - -class CListValue(CPropValue): - """ - CListValue - - This is a list like object used in the game engine internally that behaves similar to a python list in most ways. - - As well as the normal index lookup. - C{val= clist[i]} - - CListValue supports string lookups. - C{val= scene.objects["OBCube"]} - - Other operations such as C{len(clist), list(clist), clist[0:10]} are also supported. - """ - def append(val): - """ - Add an item to the list (like pythons append) - - Warning: Appending values to the list can cause crashes when the list is used internally by the game engine. - """ - - def count(val): - """ - Count the number of instances of a value in the list. - - @rtype: integer - @return: number of instances - """ - def index(val): - """ - Return the index of a value in the list. - - @rtype: integer - @return: The index of the value in the list. - """ - def reverse(): - """ - Reverse the order of the list. - """ - def from_id(id): - """ - This is a funtion especially for the game engine to return a value with a spesific id. - - Since object names are not always unique, the id of an object can be used to get an object from the CValueList. - - Example. - - C{myObID = id(gameObject)} - - C{...} - - C{ob= scene.objects.from_id(myObID)} - - Where myObID is an int or long from the id function. - - This has the advantage that you can store the id in places you could not store a gameObject. - - Warning: the id is derived from a memory location and will be different each time the game engine starts. - """ \ No newline at end of file diff --git a/source/gameengine/PyDoc/CPropValue.py b/source/gameengine/PyDoc/CPropValue.py deleted file mode 100644 index 498b47ab013..00000000000 --- a/source/gameengine/PyDoc/CPropValue.py +++ /dev/null @@ -1,8 +0,0 @@ -# -# Documentation for CValue class -from CValue import * -class CPropValue(CValue): - """ - This class has no python functions - """ - pass diff --git a/source/gameengine/PyDoc/CValue.py b/source/gameengine/PyDoc/CValue.py deleted file mode 100644 index e9b0563955b..00000000000 --- a/source/gameengine/PyDoc/CValue.py +++ /dev/null @@ -1,8 +0,0 @@ -# -# Documentation for CValue class -from PyObjectPlus import * -class CValue(PyObjectPlus): - """ - This class has no python functions - """ - pass diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index d16c00ca272..a0be06e8830 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -17,7 +17,7 @@ Documentation for the GameLogic Module. All the other modules are accessible through the methods in GameLogic. - See L{WhatsNew} for updates, changes and new functionality in the Game Engine Python API. + See U{release notes} for updates, changes and new functionality in the Game Engine Python API. Examples:: # To get the controller thats running this python script: @@ -38,18 +38,18 @@ Documentation for the GameLogic Module. sensors = co.getSensors() See the sensor's reference for available methods: - - L{DelaySensor} - - L{JoystickSensor} - - L{KeyboardSensor} - - L{MouseFocusSensor} - - L{MouseSensor} - - L{NearSensor} - - L{NetworkMessageSensor} - - L{PropertySensor} - - L{RadarSensor} - - L{RandomSensor} - - L{RaySensor} - - L{TouchSensor} + - L{DelaySensor} + - L{JoystickSensor} + - L{KeyboardSensor} + - L{MouseFocusSensor} + - L{MouseSensor} + - L{NearSensor} + - L{NetworkMessageSensor} + - L{PropertySensor} + - L{RadarSensor} + - L{RandomSensor} + - L{RaySensor} + - L{TouchSensor} You can also access actuators linked to the controller:: # To get an actuator attached to the controller: @@ -62,28 +62,28 @@ Documentation for the GameLogic Module. controller.activate(actuator) See the actuator's reference for available methods: - - L{2DFilterActuator} - - L{ActionActuator} - - L{AddObjectActuator} - - L{CameraActuator} - - L{CDActuator} - - L{ConstraintActuator} - - L{DynamicActuator} - - L{EndObjectActuator} - - L{GameActuator} - - L{IpoActuator} - - L{NetworkMessageActuator} - - L{ObjectActuator} - - L{ParentActuator} - - L{PropertyActuator} - - L{RandomActuator} - - L{ReplaceMeshActuator} - - L{SceneActuator} - - L{ShapeActionActuator} - - L{SoundActuator} - - L{StateActuator} - - L{TrackToActuator} - - L{VisibilityActuator} + - L{2DFilterActuator} + - L{ActionActuator} + - L{AddObjectActuator} + - L{CameraActuator} + - L{CDActuator} + - L{ConstraintActuator} + - L{DynamicActuator} + - L{EndObjectActuator} + - L{GameActuator} + - L{IpoActuator} + - L{NetworkMessageActuator} + - L{ObjectActuator} + - L{ParentActuator} + - L{PropertyActuator} + - L{RandomActuator} + - L{ReplaceMeshActuator} + - L{SceneActuator} + - L{ShapeActionActuator} + - L{SoundActuator} + - L{StateActuator} + - L{TrackToActuator} + - L{VisibilityActuator} Most logic brick's methods are accessors for the properties available in the logic buttons. Consult the logic bricks documentation for more information on how each logic brick works. diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index 2b07a18247c..a22f63854ea 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -1,75 +1,5401 @@ -# $Id$ """ -GameEngine Types -================ -@var BL_ActionActuator: L{BL_ActionActuator} -@var BL_Shader: L{BL_Shader} -@var BL_ShapeActionActuator: L{BL_ShapeActionActuator} -@var CListValue: L{CListValue} -@var CValue: L{CValue} -@var KX_BlenderMaterial: L{KX_BlenderMaterial} -@var KX_CDActuator: L{KX_CDActuator} -@var KX_Camera: L{KX_Camera} -@var KX_CameraActuator: L{KX_CameraActuator} -@var KX_ConstraintActuator: L{KX_ConstraintActuator} -@var KX_ConstraintWrapper: L{KX_ConstraintWrapper} -@var KX_GameActuator: L{KX_GameActuator} -@var KX_GameObject: L{KX_GameObject} -@var KX_IpoActuator: L{KX_IpoActuator} -@var KX_LightObject: L{KX_LightObject} -@var KX_MeshProxy: L{KX_MeshProxy} -@var KX_MouseFocusSensor: L{KX_MouseFocusSensor} -@var KX_NearSensor: L{KX_NearSensor} -@var KX_NetworkMessageActuator: L{KX_NetworkMessageActuator} -@var KX_NetworkMessageSensor: L{KX_NetworkMessageSensor} -@var KX_ObjectActuator: L{KX_ObjectActuator} -@var KX_ParentActuator: L{KX_ParentActuator} -@var KX_PhysicsObjectWrapper: L{KX_PhysicsObjectWrapper} -@var KX_PolyProxy: L{KX_PolyProxy} -@var KX_PolygonMaterial: L{KX_PolygonMaterial} -@var KX_RadarSensor: L{KX_RadarSensor} -@var KX_RaySensor: L{KX_RaySensor} -@var KX_SCA_AddObjectActuator: L{KX_SCA_AddObjectActuator} -@var KX_SCA_DynamicActuator: L{KX_SCA_DynamicActuator} -@var KX_SCA_EndObjectActuator: L{KX_SCA_EndObjectActuator} -@var KX_SCA_ReplaceMeshActuator: L{KX_SCA_ReplaceMeshActuator} -@var KX_Scene: L{KX_Scene} -@var KX_SceneActuator: L{KX_SceneActuator} -@var KX_SoundActuator: L{KX_SoundActuator} -@var KX_StateActuator: L{KX_StateActuator} -@var KX_TouchSensor: L{KX_TouchSensor} -@var KX_TrackToActuator: L{KX_TrackToActuator} -@var KX_VehicleWrapper: L{KX_VehicleWrapper} -@var KX_VertexProxy: L{KX_VertexProxy} -@var KX_VisibilityActuator: L{KX_VisibilityActuator} -@var PyObjectPlus: L{PyObjectPlus} -@var SCA_2DFilterActuator: L{SCA_2DFilterActuator} -@var SCA_ANDController: L{SCA_ANDController} -@var SCA_ActuatorSensor: L{SCA_ActuatorSensor} -@var SCA_AlwaysSensor: L{SCA_AlwaysSensor} -@var SCA_DelaySensor: L{SCA_DelaySensor} -@var SCA_ILogicBrick: L{SCA_ILogicBrick} -@var SCA_IObject: L{SCA_IObject} -@var SCA_ISensor: L{SCA_ISensor} -@var SCA_JoystickSensor: L{SCA_JoystickSensor} -@var SCA_KeyboardSensor: L{SCA_KeyboardSensor} -@var SCA_MouseSensor: L{SCA_MouseSensor} -@var SCA_NANDController: L{SCA_NANDController} -@var SCA_NORController: L{SCA_NORController} -@var SCA_ORController: L{SCA_ORController} -@var SCA_PropertyActuator: L{SCA_PropertyActuator} -@var SCA_PropertySensor: L{SCA_PropertySensor} -@var SCA_PythonController: L{SCA_PythonController} -@var SCA_RandomActuator: L{SCA_RandomActuator} -@var SCA_RandomSensor: L{SCA_RandomSensor} -@var SCA_XNORController: L{SCA_XNORController} -@var SCA_XORController: L{SCA_XORController} +Documentation for the GameTypes Module. +======================================= + +@group Base: PyObjectPlus, CValue, CPropValue, SCA_ILogicBrick, SCA_IObject, SCA_ISensor, SCA_IController, SCA_IActuator + +@group Object: KX_GameObject, KX_LightObject, KX_Camera + +@group Mesh: KX_MeshProxy, KX_PolyProxy, KX_VertexProxy + +@group Shading: KX_PolygonMaterial, KX_BlenderMaterial, BL_Shader + +@group Sensors: SCA_ActuatorSensor, SCA_AlwaysSensor, SCA_DelaySensor, SCA_JoystickSensor, SCA_KeyboardSensor, KX_MouseFocusSensor, SCA_MouseSensor, KX_NearSensor, KX_NetworkMessageSensor, SCA_PropertySensor, KX_RadarSensor, SCA_RandomSensor, KX_RaySensor, KX_TouchSensor + +@group Actuators: SCA_2DFilterActuator, BL_ActionActuator, KX_SCA_AddObjectActuator, KX_CameraActuator, KX_CDActuator, KX_ConstraintActuator, KX_SCA_DynamicActuator, KX_SCA_EndObjectActuator, KX_GameActuator, KX_IpoActuator, KX_NetworkMessageActuator, KX_ObjectActuator, KX_ParentActuator, SCA_PropertyActuator, SCA_RandomActuator, KX_SCA_ReplaceMeshActuator, KX_SceneActuator, BL_ShapeActionActuator, KX_SoundActuator, KX_StateActuator, KX_TrackToActuator, KX_VisibilityActuator + +@group Controllers: SCA_ANDController, SCA_NANDController, SCA_NORController, SCA_ORController, SCA_PythonController, SCA_XNORController, SCA_XORController """ +import GameLogic + +class PyObjectPlus: + """ + PyObjectPlus base class of most other types in the Game Engine. + + @ivar invalid: Test if the object has been freed by the game engine and is no longer valid. + + Normally this is not a problem but when storing game engine data in the GameLogic module, + KX_Scenes or other KX_GameObjects its possible to hold a reference to invalid data. + Calling an attribute or method on an invalid object will raise a SystemError. + + The invalid attribute allows testing for this case without exception handling. + @type invalid: bool + """ + + def isA(game_type): + """ + Check if this is a type or a subtype game_type. + + @param game_type: the name of the type or the type its self from the L{GameTypes} module. + @type game_type: string or type + @return: True if this object is a type or a subtype of game_type. + @rtype: bool + """ + +class CValue(PyObjectPlus): + """ + This class has no python functions + """ + pass + +class CPropValue(CValue): + """ + This class has no python functions + """ + pass + +class SCA_ILogicBrick(CValue): + """ + Base class for all logic bricks. + + @ivar executePriority: This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first). + @type executePriority: int + @ivar owner: The game object this logic brick is attached to (read only). + @type owner: L{KX_GameObject} or None in exceptional cases. + @ivar name: The name of this logic brick (read only). + @type name: string + @group Deprecated: getOwner, setExecutePriority, getExecutePriority + """ + + def getOwner(): + """ + Gets the game object associated with this logic brick. + + Deprecated: Use the "owner" property instead. + + @rtype: L{KX_GameObject} + """ + + #--The following methods are deprecated-- + def setExecutePriority(priority): + """ + Sets the priority of this logic brick. + + This determines the order controllers are evaluated, and actuators are activated. + Bricks with lower priority will be executed first. + + Deprecated: Use the "executePriority" property instead. + + @type priority: integer + @param priority: the priority of this logic brick. + """ + def getExecutePriority(): + """ + Gets the execution priority of this logic brick. + + Deprecated: Use the "executePriority" property instead. + + @rtype: integer + @return: this logic bricks current priority. + """ + + +class SCA_IObject(CValue): + """ + This class has no python functions + """ + pass + +class SCA_ISensor(SCA_ILogicBrick): + """ + Base class for all sensor logic bricks. + + @ivar usePosPulseMode: Flag to turn positive pulse mode on and off. + @type usePosPulseMode: boolean + @ivar useNegPulseMode: Flag to turn negative pulse mode on and off. + @type useNegPulseMode: boolean + @ivar frequency: The frequency for pulse mode sensors. + @type frequency: int + @ivar level: Flag to set whether to detect level or edge transition when entering a state. + It makes a difference only in case of logic state transition (state actuator). + A level detector will immediately generate a pulse, negative or positive + depending on the sensor condition, as soon as the state is activated. + A edge detector will wait for a state change before generating a pulse. + @type level: boolean + @ivar invert: Flag to set if this sensor activates on positive or negative events. + @type invert: boolean + @ivar triggered: True if this sensor brick is in a positive state. (Read only) + @type triggered: boolean + @ivar positive: True if this sensor brick is in a positive state. (Read only) + @type positive: boolean + @group Deprecated: isPositive, isTriggered, getUsePosPulseMode, setUsePosPulseMode, getFrequency, setFrequency, getUseNegPulseMode, setUseNegPulseMode, getInvert, setInvert, getLevel, setLevel + """ + + def reset(): + """ + Reset sensor internal state, effect depends on the type of sensor and settings. + + The sensor is put in its initial state as if it was just activated. + """ + + #--The following methods are deprecated-- + def isPositive(): + """ + True if this sensor brick is in a positive state. + """ + + def isTriggered(): + """ + True if this sensor brick has triggered the current controller. + """ + + def getUsePosPulseMode(): + """ + True if the sensor is in positive pulse mode. + """ + def setUsePosPulseMode(pulse): + """ + Sets positive pulse mode. + + @type pulse: boolean + @param pulse: If True, will activate positive pulse mode for this sensor. + """ + def getFrequency(): + """ + The frequency for pulse mode sensors. + + @rtype: integer + @return: the pulse frequency in 1/50 sec. + """ + def setFrequency(freq): + """ + Sets the frequency for pulse mode sensors. + + @type freq: integer + @return: the pulse frequency in 1/50 sec. + """ + def getUseNegPulseMode(): + """ + True if the sensor is in negative pulse mode. + """ + def setUseNegPulseMode(pulse): + """ + Sets negative pulse mode. + + @type pulse: boolean + @param pulse: If True, will activate negative pulse mode for this sensor. + """ + def getInvert(): + """ + True if this sensor activates on negative events. + """ + def setInvert(invert): + """ + Sets if this sensor activates on positive or negative events. + + @type invert: boolean + @param invert: true if activates on negative events; false if activates on positive events. + """ + def getLevel(): + """ + Returns whether this sensor is a level detector or a edge detector. + It makes a difference only in case of logic state transition (state actuator). + A level detector will immediately generate a pulse, negative or positive + depending on the sensor condition, as soon as the state is activated. + A edge detector will wait for a state change before generating a pulse. + + @rtype: boolean + @return: true if sensor is level sensitive, false if it is edge sensitive + """ + def setLevel(level): + """ + Set whether to detect level or edge transition when entering a state. + + @param level: Detect level instead of edge? (KX_TRUE, KX_FALSE) + @type level: boolean + """ + +class SCA_IController(SCA_ILogicBrick): + """ + Base class for all controller logic bricks. + + @ivar state: the controllers state bitmask. + This can be used with the GameObject's state to test if the controller is active. + @type state: int bitmask + @ivar sensors: a list of sensors linked to this controller + - note: the sensors are not necessarily owned by the same object. + - note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup. + @type sensors: sequence supporting index/string lookups and iteration. + @ivar actuators: a list of actuators linked to this controller. + - note: the sensors are not necessarily owned by the same object. + - note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup. + @type actuators: sequence supporting index/string lookups and iteration. + + @group Deprecated: getState, getSensors, getActuators, getSensor, getActuator + """ + + def getState(): + """ + DEPRECATED: use the state property + Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active. + This for instance will always be true however you could compare with a previous state to see when the state was activated. + GameLogic.getCurrentController().getState() & GameLogic.getCurrentController().getOwner().getState() + + @rtype: int + """ + def getSensors(): + """ + DEPRECATED: use the sensors property + Gets a list of all sensors attached to this controller. + + @rtype: list [L{SCA_ISensor}] + """ + def getSensor(name): + """ + DEPRECATED: use the sensors[name] property + Gets the named linked sensor. + + @type name: string + @rtype: L{SCA_ISensor} + """ + def getActuators(): + """ + DEPRECATED: use the actuators property + Gets a list of all actuators linked to this controller. + + @rtype: list [L{SCA_IActuator}] + """ + def getActuator(name): + """ + DEPRECATED: use the actuators[name] property + Gets the named linked actuator. + + @type name: string + @rtype: L{SCA_IActuator} + """ + +class SCA_IActuator(SCA_ILogicBrick): + """ + Base class for all actuator logic bricks. + """ + +class BL_ActionActuator(SCA_IActuator): + """ + Action Actuators apply an action to an actor. + + @ivar action: The name of the action to set as the current action. + @type action: string + @ivar start: Specifies the starting frame of the animation. + @type start: float + @ivar end: Specifies the ending frame of the animation. + @type end: float + @ivar blendin: Specifies the number of frames of animation to generate when making transitions between actions. + @type blendin: float + @ivar priority: Sets the priority of this actuator. Actuators will lower + priority numbers will override actuators with higher + numbers. + @type priority: integer + @ivar frame: Sets the current frame for the animation. + @type frame: float + @ivar property: Sets the property to be used in FromProp playback mode. + @type property: string + @ivar blendTime: Sets the internal frame timer. This property must be in + the range from 0.0 to blendin. + @type blendTime: float + @ivar type: The operation mode of the actuator. KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND + @type type: integer + @ivar useContinue: The actions continue option, True or False. + When True, the action will always play from where last left off, + otherwise negative events to this actuator will reset it to its start frame. + @type: boolean + @ivar frameProperty: The name of the property that is set to the current frame number. + @type frameProperty: string + """ + def setChannel(channel, matrix, mode = False): + """ + @param channel: A string specifying the name of the bone channel. + @type channel: string + @param matrix: A 4x4 matrix specifying the overriding transformation + as an offset from the bone's rest position. + @type matrix: list [[float]] + @param mode: True for armature/world space, False for bone space + @type mode: boolean + """ + + #--The following methods are deprecated-- + def setAction(action, reset = True): + """ + DEPRECATED: use the 'action' property + Sets the current action. + + @param action: The name of the action to set as the current action. + @type action: string + @param reset: Optional parameter indicating whether to reset the + blend timer or not. A value of 1 indicates that the + timer should be reset. A value of 0 will leave it + unchanged. If reset is not specified, the timer will + be reset. + """ + + def setStart(start): + """ + DEPRECATED: use the 'start' property + Specifies the starting frame of the animation. + + @param start: the starting frame of the animation + @type start: float + """ + + def setEnd(end): + """ + DEPRECATED: use the 'end' property + Specifies the ending frame of the animation. + + @param end: the ending frame of the animation + @type end: float + """ + def setBlendin(blendin): + """ + DEPRECATED: use the 'blendin' property + Specifies the number of frames of animation to generate + when making transitions between actions. + + @param blendin: the number of frames in transition. + @type blendin: float + """ + + def setPriority(priority): + """ + DEPRECATED: use the 'priority' property + Sets the priority of this actuator. + + @param priority: Specifies the new priority. Actuators will lower + priority numbers will override actuators with higher + numbers. + @type priority: integer + """ + def setFrame(frame): + """ + DEPRECATED: use the 'frame' property + Sets the current frame for the animation. + + @param frame: Specifies the new current frame for the animation + @type frame: float + """ + + def setProperty(prop): + """ + DEPRECATED: use the 'property' property + Sets the property to be used in FromProp playback mode. + + @param prop: the name of the property to use. + @type prop: string. + """ + + def setBlendtime(blendtime): + """ + DEPRECATED: use the 'blendTime' property + Sets the internal frame timer. + + Allows the script to directly modify the internal timer + used when generating transitions between actions. + + @param blendtime: The new time. This parameter must be in the range from 0.0 to 1.0. + @type blendtime: float + """ + + def setType(mode): + """ + DEPRECATED: use the 'type' property + Sets the operation mode of the actuator + + @param mode: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND + @type mode: integer + """ + + def setContinue(cont): + """ + DEPRECATED: use the 'continue' property + Set the actions continue option True or False. see getContinue. + + @param cont: The continue option. + @type cont: bool + """ + + def getType(): + """ + DEPRECATED: use the 'type' property + Returns the operation mode of the actuator + + @rtype: integer + @return: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND + """ + + def getContinue(): + """ + DEPRECATED: use the 'continue' property + When True, the action will always play from where last left off, otherwise negative events to this actuator will reset it to its start frame. + + @rtype: bool + """ + + def getAction(): + """ + DEPRECATED: use the 'action' property + getAction() returns the name of the action associated with this actuator. + + @rtype: string + """ + + def getStart(): + """ + DEPRECATED: use the 'start' property + Returns the starting frame of the action. + + @rtype: float + """ + def getEnd(): + """ + DEPRECATED: use the 'end' property + Returns the last frame of the action. + + @rtype: float + """ + def getBlendin(): + """ + DEPRECATED: use the 'blendin' property + Returns the number of interpolation animation frames to be generated when this actuator is triggered. + + @rtype: float + """ + def getPriority(): + """ + DEPRECATED: use the 'priority' property + Returns the priority for this actuator. Actuators with lower Priority numbers will + override actuators with higher numbers. + + @rtype: integer + """ + def getFrame(): + """ + DEPRECATED: use the 'frame' property + Returns the current frame number. + + @rtype: float + """ + def getProperty(): + """ + DEPRECATED: use the 'property' property + Returns the name of the property to be used in FromProp mode. + + @rtype: string + """ + def setFrameProperty(prop): + """ + DEPRECATED: use the 'frameProperty' property + @param prop: A string specifying the property of the object that will be updated with the action frame number. + @type prop: string + """ + def getFrameProperty(): + """ + DEPRECATED: use the 'frameProperty' property + Returns the name of the property that is set to the current frame number. + + @rtype: string + """ + +class BL_Shader(PyObjectPlus): + """ + BL_Shader GLSL shaders. + + TODO - Description + """ + + def setUniformfv(name, fList): + """ + Set a uniform with a list of float values + + @param name: the uniform name + @type name: string + + @param fList: a list (2, 3 or 4 elements) of float values + @type fList: list[float] + """ + + def delSource(): + """ + TODO - Description + + """ + def getFragmentProg(): + """ + Returns the fragment program. + + @rtype: string + @return: The fragment program. + """ + def getVertexProg(): + """ + Get the vertex program. + + @rtype: string + @return: The vertex program. + """ + def isValid(): + """ + Check if the shader is valid. + + @rtype: bool + @return: True if the shader is valid + """ + def setAttrib(enum): + """ + Set attribute location. (The parameter is ignored a.t.m. and the value of "tangent" is always used.) + + @param enum: attribute location value + @type enum: integer + """ + def setNumberOfPasses( max_pass ): + """ + Set the maximum number of passes. Not used a.t.m. + + @param max_pass: the maximum number of passes + @type max_pass: integer + """ + def setSampler(name, index): + """ + Set uniform texture sample index. + + @param name: Uniform name + @type name: string + + @param index: Texture sample index. + @type index: integer + """ + def setSource(vertexProgram, fragmentProgram): + """ + Set the vertex and fragment programs + + @param vertexProgram: Vertex program + @type vertexProgram: string + + @param fragmentProgram: Fragment program + @type fragmentProgram: string + """ + def setUniform1f(name, fx): + """ + Set a uniform with 1 float value. + + @param name: the uniform name + @type name: string + + @param fx: Uniform value + @type fx: float + """ + def setUniform1i(name, ix): + """ + Set a uniform with an integer value. + + @param name: the uniform name + @type name: string + + @param ix: the uniform value + @type ix: integer + """ + def setUniform2f(name, fx, fy): + """ + Set a uniform with 2 float values + + @param name: the uniform name + @type name: string + + @param fx: first float value + @type fx: float + + @param fy: second float value + @type fy: float + """ + def setUniform2i(name, ix, iy): + """ + Set a uniform with 2 integer values + + @param name: the uniform name + @type name: string + + @param ix: first integer value + @type ix: integer + + @param iy: second integer value + @type iy: integer + """ + def setUniform3f(name, fx,fy,fz): + """ + Set a uniform with 3 float values. + + @param name: the uniform name + @type name: string + + @param fx: first float value + @type fx: float + + @param fy: second float value + @type fy: float + + @param fz: third float value + @type fz: float + """ + def setUniform3i(name, ix,iy,iz): + """ + Set a uniform with 3 integer values + + @param name: the uniform name + @type name: string + + @param ix: first integer value + @type ix: integer + + @param iy: second integer value + @type iy: integer + + @param iz: third integer value + @type iz: integer + """ + def setUniform4f(name, fx,fy,fz,fw): + """ + Set a uniform with 4 float values. + + @param name: the uniform name + @type name: string + + @param fx: first float value + @type fx: float + + @param fy: second float value + @type fy: float + + @param fz: third float value + @type fz: float + + @param fw: fourth float value + @type fw: float + """ + def setUniform4i(name, ix,iy,iz, iw): + """ + Set a uniform with 4 integer values + + @param name: the uniform name + @type name: string + + @param ix: first integer value + @type ix: integer + + @param iy: second integer value + @type iy: integer + + @param iz: third integer value + @type iz: integer + + @param iw: fourth integer value + @type iw: integer + """ + def setUniformDef(name, type): + """ + Define a new uniform + + @param name: the uniform name + @type name: string + + @param type: uniform type + @type type: UNI_NONE, UNI_INT, UNI_FLOAT, UNI_INT2, UNI_FLOAT2, UNI_INT3, UNI_FLOAT3, UNI_INT4, UNI_FLOAT4, UNI_MAT3, UNI_MAT4, UNI_MAX + """ + def setUniformMatrix3(name, mat, transpose): + """ + Set a uniform with a 3x3 matrix value + + @param name: the uniform name + @type name: string + + @param mat: A 3x3 matrix [[f,f,f], [f,f,f], [f,f,f]] + @type mat: 3x3 matrix + + @param transpose: set to True to transpose the matrix + @type transpose: bool + """ + def setUniformMatrix4(name, mat, transpose): + """ + Set a uniform with a 4x4 matrix value + + @param name: the uniform name + @type name: string + + @param mat: A 4x4 matrix [[f,f,f,f], [f,f,f,f], [f,f,f,f], [f,f,f,f]] + @type mat: 4x4 matrix + + @param transpose: set to True to transpose the matrix + @type transpose: bool + """ + def setUniformiv(name, iList): + """ + Set a uniform with a list of integer values + + @param name: the uniform name + @type name: string + + @param iList: a list (2, 3 or 4 elements) of integer values + @type iList: list[integer] + """ + def validate(): + """ + Validate the shader object. + + """ + +class BL_ShapeActionActuator(SCA_IActuator): + """ + ShapeAction Actuators apply an shape action to an mesh object.\ + + @ivar action: The name of the action to set as the current shape action. + @type action: string + @ivar start: Specifies the starting frame of the shape animation. + @type start: float + @ivar end: Specifies the ending frame of the shape animation. + @type end: float + @ivar blendin: Specifies the number of frames of animation to generate when making transitions between actions. + @type blendin: float + @ivar priority: Sets the priority of this actuator. Actuators will lower + priority numbers will override actuators with higher + numbers. + @type priority: integer + @ivar frame: Sets the current frame for the animation. + @type frame: float + @ivar property: Sets the property to be used in FromProp playback mode. + @type property: string + @ivar blendTime: Sets the internal frame timer. This property must be in + the range from 0.0 to blendin. + @type blendTime: float + @ivar type: The operation mode of the actuator. + KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, + KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND + @type type: integer + @ivar frameProperty: The name of the property that is set to the current frame number. + @type frameProperty: string + + """ + def setAction(action, reset = True): + """ + DEPRECATED: use the 'action' property + Sets the current action. + + @param action: The name of the action to set as the current action. + @type action: string + @param reset: Optional parameter indicating whether to reset the + blend timer or not. A value of 1 indicates that the + timer should be reset. A value of 0 will leave it + unchanged. If reset is not specified, the timer will + be reset. + """ + + def setStart(start): + """ + DEPRECATED: use the 'start' property + Specifies the starting frame of the animation. + + @param start: the starting frame of the animation + @type start: float + """ + + def setEnd(end): + """ + DEPRECATED: use the 'end' property + Specifies the ending frame of the animation. + + @param end: the ending frame of the animation + @type end: float + """ + def setBlendin(blendin): + """ + DEPRECATED: use the 'blendin' property + Specifies the number of frames of animation to generate + when making transitions between actions. + + @param blendin: the number of frames in transition. + @type blendin: float + """ + + def setPriority(priority): + """ + DEPRECATED: use the 'priority' property + Sets the priority of this actuator. + + @param priority: Specifies the new priority. Actuators will lower + priority numbers will override actuators with higher + numbers. + @type priority: integer + """ + def setFrame(frame): + """ + DEPRECATED: use the 'frame' property + Sets the current frame for the animation. + + @param frame: Specifies the new current frame for the animation + @type frame: float + """ + + def setProperty(prop): + """ + DEPRECATED: use the 'property' property + Sets the property to be used in FromProp playback mode. + + @param prop: the name of the property to use. + @type prop: string. + """ + + def setBlendtime(blendtime): + """ + DEPRECATED: use the 'blendTime' property + Sets the internal frame timer. + + Allows the script to directly modify the internal timer + used when generating transitions between actions. + + @param blendtime: The new time. This parameter must be in the range from 0.0 to 1.0. + @type blendtime: float + """ + + def setType(mode): + """ + DEPRECATED: use the 'type' property + Sets the operation mode of the actuator + + @param mode: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND + @type mode: integer + """ + + def getType(): + """ + DEPRECATED: use the 'type' property + Returns the operation mode of the actuator + + @rtype: integer + @return: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND + """ + + def getAction(): + """ + DEPRECATED: use the 'action' property + getAction() returns the name of the action associated with this actuator. + + @rtype: string + """ + + def getStart(): + """ + DEPRECATED: use the 'start' property + Returns the starting frame of the action. + + @rtype: float + """ + def getEnd(): + """ + DEPRECATED: use the 'end' property + Returns the last frame of the action. + + @rtype: float + """ + def getBlendin(): + """ + DEPRECATED: use the 'blendin' property + Returns the number of interpolation animation frames to be generated when this actuator is triggered. + + @rtype: float + """ + def getPriority(): + """ + DEPRECATED: use the 'priority' property + Returns the priority for this actuator. Actuators with lower Priority numbers will + override actuators with higher numbers. + + @rtype: integer + """ + def getFrame(): + """ + DEPRECATED: use the 'frame' property + Returns the current frame number. + + @rtype: float + """ + def getProperty(): + """ + DEPRECATED: use the 'property' property + Returns the name of the property to be used in FromProp mode. + + @rtype: string + """ + def setFrameProperty(prop): + """ + DEPRECATED: use the 'frameProperty' property + @param prop: A string specifying the property of the object that will be updated with the action frame number. + @type prop: string + """ + def getFrameProperty(): + """ + DEPRECATED: use the 'frameProperty' property + Returns the name of the property that is set to the current frame number. + + @rtype: string + """ + +class CListValue(CPropValue): + """ + CListValue + + This is a list like object used in the game engine internally that behaves similar to a python list in most ways. + + As well as the normal index lookup. + C{val= clist[i]} + + CListValue supports string lookups. + C{val= scene.objects["OBCube"]} + + Other operations such as C{len(clist), list(clist), clist[0:10]} are also supported. + """ + def append(val): + """ + Add an item to the list (like pythons append) + + Warning: Appending values to the list can cause crashes when the list is used internally by the game engine. + """ + + def count(val): + """ + Count the number of instances of a value in the list. + + @rtype: integer + @return: number of instances + """ + def index(val): + """ + Return the index of a value in the list. + + @rtype: integer + @return: The index of the value in the list. + """ + def reverse(): + """ + Reverse the order of the list. + """ + def from_id(id): + """ + This is a funtion especially for the game engine to return a value with a spesific id. + + Since object names are not always unique, the id of an object can be used to get an object from the CValueList. + + Example. + + C{myObID = id(gameObject)} + + C{...} + + C{ob= scene.objects.from_id(myObID)} + + Where myObID is an int or long from the id function. + + This has the advantage that you can store the id in places you could not store a gameObject. + + Warning: the id is derived from a memory location and will be different each time the game engine starts. + """# + +class KX_BlenderMaterial(PyObjectPlus): # , RAS_IPolyMaterial) + """ + KX_BlenderMaterial + + All placeholders have a __ prefix + """ + + def __getShader(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + + def __setBlending(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + def __getMaterialIndex(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + +class KX_CDActuator(SCA_IActuator): + """ + CD Controller actuator. + @ivar volume: controls the volume to set the CD to. 0.0 = silent, 1.0 = max volume. + @type volume: float + @ivar track: the track selected to be played + @type track: integer + @ivar gain: the gain (volume) of the CD between 0.0 and 1.0. + @type gain: float + """ + def startCD(): + """ + Starts the CD playing. + """ + def stopCD(): + """ + Stops the CD playing. + """ + def pauseCD(): + """ + Pauses the CD. + """ + def resumeCD(): + """ + Resumes the CD after a pause. + """ + def playAll(): + """ + Plays the CD from the beginning. + """ + def playTrack(trackNumber): + """ + Plays the track selected. + """ + def setGain(gain): + """ + DEPRECATED: Use the volume property. + Sets the gain (volume) of the CD. + + @type gain: float + @param gain: the gain to set the CD to. 0.0 = silent, 1.0 = max volume. + """ + def getGain(): + """ + DEPRECATED: Use the volume property. + Gets the current gain (volume) of the CD. + + @rtype: float + @return: Between 0.0 (silent) and 1.0 (max volume) + """ + +class KX_CameraActuator(SCA_IActuator): + """ + Applies changes to a camera. + + @ivar min: minimum distance to the target object maintained by the actuator + @type min: float + @ivar max: maximum distance to stay from the target object + @type max: float + @ivar height: height to stay above the target object + @type height: float + @ivar xy: axis this actuator is tracking, true=X, false=Y + @type xy: boolean + @ivar object: the object this actuator tracks. + @type object: KX_GameObject or None + @author: snail + """ + def getObject(name_only = 1): + """ + Returns the name of the object this actuator tracks. + + @type name_only: bool + @param name_only: optional argument, when 0 return a KX_GameObject + @rtype: string, KX_GameObject or None if no object is set + """ + + def setObject(target): + """ + Sets the object this actuator tracks. + + @param target: the object to track. + @type target: L{KX_GameObject}, string or None + """ + + def getMin(): + """ + Returns the minimum distance to target maintained by the actuator. + + @rtype: float + """ + + def setMin(distance): + """ + Sets the minimum distance to the target object maintained by the + actuator. + + @param distance: The minimum distance to maintain. + @type distance: float + """ + + def getMax(): + """ + Gets the maximum distance to stay from the target object. + + @rtype: float + """ + + def setMax(distance): + """ + Sets the maximum distance to stay from the target object. + + @param distance: The maximum distance to maintain. + @type distance: float + """ + + def getHeight(): + """ + Returns the height to stay above the target object. + + @rtype: float + """ + + def setHeight(height): + """ + Sets the height to stay above the target object. + + @type height: float + @param height: The height to stay above the target object. + """ + + def setXY(xaxis): + """ + Sets the axis to get behind. + + @param xaxis: False to track Y axis, True to track X axis. + @type xaxis: boolean + """ + + def getXY(): + """ + Returns the axis this actuator is tracking. + + @return: True if tracking X axis, False if tracking Y axis. + @rtype: boolean + """ + +class KX_ConstraintActuator(SCA_IActuator): + """ + A constraint actuator limits the position, rotation, distance or orientation of an object. + + Properties: + + @ivar damp: time constant of the constraint expressed in frame (not use by Force field constraint) + @type damp: integer + + @ivar rotDamp: time constant for the rotation expressed in frame (only for the distance constraint) + 0 = use damp for rotation as well + @type rotDamp: integer + + @ivar direction: the reference direction in world coordinate for the orientation constraint + @type direction: 3-tuple of float: [x,y,z] + + @ivar option: Binary combination of the following values: + Applicable to Distance constraint: + - KX_ACT_CONSTRAINT_NORMAL ( 64) : Activate alignment to surface + - KX_ACT_CONSTRAINT_DISTANCE ( 512) : Activate distance control + - KX_ACT_CONSTRAINT_LOCAL (1024) : direction of the ray is along the local axis + Applicable to Force field constraint: + - KX_ACT_CONSTRAINT_DOROTFH (2048) : Force field act on rotation as well + Applicable to both: + - KX_ACT_CONSTRAINT_MATERIAL ( 128) : Detect material rather than property + - KX_ACT_CONSTRAINT_PERMANENT ( 256) : No deactivation if ray does not hit target + @type option: integer + + @ivar time: activation time of the actuator. The actuator disables itself after this many frame. + If set to 0, the actuator is not limited in time. + @type time: integer + + @ivar property: the name of the property or material for the ray detection of the distance constraint. + @type property: string + + @ivar min: The lower bound of the constraint + For the rotation and orientation constraint, it represents radiant + @type min: float + + @ivar distance: the target distance of the distance constraint + @type distance: float + + @ivar max: the upper bound of the constraint. + For rotation and orientation constraints, it represents radiant. + @type max: float + + @ivar rayLength: the length of the ray of the distance constraint. + @type rayLength: float + + @ivar limit: type of constraint, use one of the following constant: + KX_ACT_CONSTRAINT_LOCX ( 1) : limit X coord + KX_ACT_CONSTRAINT_LOCY ( 2) : limit Y coord + KX_ACT_CONSTRAINT_LOCZ ( 3) : limit Z coord + KX_ACT_CONSTRAINT_ROTX ( 4) : limit X rotation + KX_ACT_CONSTRAINT_ROTY ( 5) : limit Y rotation + KX_ACT_CONSTRAINT_ROTZ ( 6) : limit Z rotation + KX_ACT_CONSTRAINT_DIRPX ( 7) : set distance along positive X axis + KX_ACT_CONSTRAINT_DIRPY ( 8) : set distance along positive Y axis + KX_ACT_CONSTRAINT_DIRPZ ( 9) : set distance along positive Z axis + KX_ACT_CONSTRAINT_DIRNX (10) : set distance along negative X axis + KX_ACT_CONSTRAINT_DIRNY (11) : set distance along negative Y axis + KX_ACT_CONSTRAINT_DIRNZ (12) : set distance along negative Z axis + KX_ACT_CONSTRAINT_ORIX (13) : set orientation of X axis + KX_ACT_CONSTRAINT_ORIY (14) : set orientation of Y axis + KX_ACT_CONSTRAINT_ORIZ (15) : set orientation of Z axis + KX_ACT_CONSTRAINT_FHPX (16) : set force field along positive X axis + KX_ACT_CONSTRAINT_FHPY (17) : set force field along positive Y axis + KX_ACT_CONSTRAINT_FHPZ (18) : set force field along positive Z axis + KX_ACT_CONSTRAINT_FHNX (19) : set force field along negative X axis + KX_ACT_CONSTRAINT_FHNY (20) : set force field along negative Y axis + KX_ACT_CONSTRAINT_FHNZ (21) : set force field along negative Z axis + @type limit: integer + """ + def setDamp(time): + """ + Sets the time this constraint is delayed. + + @param time: The number of frames to delay. + Negative values are ignored. + @type time: integer + """ + def getDamp(): + """ + Returns the damping time of the constraint. + + @rtype: integer + """ + def setMin(lower): + """ + Sets the lower bound of the constraint. + + For rotational and orientation constraints, lower is specified in degrees. + + @type lower: float + """ + def getMin(): + """ + Gets the lower bound of the constraint. + + For rotational and orientation constraints, the lower bound is returned in radians. + + @rtype: float + """ + def setMax(upper): + """ + Sets the upper bound of the constraint. + + For rotational and orientation constraints, upper is specified in degrees. + + @type upper: float + """ + def getMax(): + """ + Gets the upper bound of the constraint. + + For rotational and orientation constraints, the upper bound is returned in radians. + + @rtype: float + """ + def setLimit(limit): + """ + Sets the type of constraint. + + See module L{GameLogic} for valid constraint types. + + @param limit: + Position constraints: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ + Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY or KX_CONSTRAINTACT_ROTZ + Distance contraints: KX_ACT_CONSTRAINT_DIRPX, KX_ACT_CONSTRAINT_DIRPY, KX_ACT_CONSTRAINT_DIRPZ, KX_ACT_CONSTRAINT_DIRNX, KX_ACT_CONSTRAINT_DIRNY, KX_ACT_CONSTRAINT_DIRNZ + Orientation constraints: KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ + """ + def getLimit(): + """ + Gets the type of constraint. + + See module L{GameLogic} for valid constraints. + + @return: + Position constraints: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ, + Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY, KX_CONSTRAINTACT_ROTZ, + Distance contraints: KX_ACT_CONSTRAINT_DIRPX, KX_ACT_CONSTRAINT_DIRPY, KX_ACT_CONSTRAINT_DIRPZ, KX_ACT_CONSTRAINT_DIRNX, KX_ACT_CONSTRAINT_DIRNY, KX_ACT_CONSTRAINT_DIRNZ, + Orientation constraints: KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ + """ + def setRotDamp(duration): + """ + Sets the time constant of the orientation constraint. + + @param duration: If the duration is negative, it is set to 0. + @type duration: integer + """ + def getRotDamp(): + """ + Returns the damping time for application of the constraint. + + @rtype: integer + """ + def setDirection(vector): + """ + Sets the reference direction in world coordinate for the orientation constraint + + @type vector: 3-tuple + """ + def getDirection(): + """ + Returns the reference direction of the orientation constraint in world coordinate. + + @rtype: 3-tuple + """ + def setOption(option): + """ + Sets several options of the distance constraint. + + @type option: integer + @param option: Binary combination of the following values: + 64 : Activate alignment to surface + 128 : Detect material rather than property + 256 : No deactivation if ray does not hit target + 512 : Activate distance control + """ + def getOption(): + """ + Returns the option parameter. + + @rtype: integer + """ + def setTime(duration): + """ + Sets the activation time of the actuator. + + @type duration: integer + @param duration: The actuator disables itself after this many frame. + If set to 0 or negative, the actuator is not limited in time. + """ + def getTime(): + """ + Returns the time parameter. + + @rtype: integer + """ + def setProperty(property): + """ + Sets the name of the property or material for the ray detection of the distance constraint. + + @type property: string + @param property: If empty, the ray will detect any collisioning object. + """ + def getProperty(): + """ + Returns the property parameter. + + @rtype: string + """ + def setDistance(distance): + """ + Sets the target distance in distance constraint. + + @type distance: float + """ + def getDistance(): + """ + Returns the distance parameter. + + @rtype: float + """ + def setRayLength(length): + """ + Sets the maximum ray length of the distance constraint. + + @type length: float + """ + def getRayLength(): + """ + Returns the length of the ray + + @rtype: float + """ + +class KX_ConstraintWrapper(PyObjectPlus): + """ + KX_ConstraintWrapper + + All placeholders have a __ prefix + """ + def __getConstraintId(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + + def __testMethod(val): + """ + TODO - Description + + @param val: the starting frame of the animation + @type val: float + + @rtype: integer + @return: TODO Description + """ + +class KX_GameActuator(SCA_IActuator): + """ + The game actuator loads a new .blend file, restarts the current .blend file or quits the game. + + Properties: + + @ivar file: the new .blend file to load + @type file: string. + @ivar mode: The mode of this actuator + @type mode: int from 0 to 5 L{GameLogic.Game Actuator} + """ + def getFile(): + """ + DEPRECATED: use the file property + Returns the filename of the new .blend file to load. + + @rtype: string + """ + def setFile(filename): + """ + DEPRECATED: use the file property + Sets the new .blend file to load. + + @param filename: The file name this actuator will load. + @type filename: string + """ + +class KX_GameObject(SCA_IObject): + """ + All game objects are derived from this class. + + Properties assigned to game objects are accessible as attributes of this class. + - note: Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError, if an object may have been removed since last accessing it use the L{invalid} attribute to check. + + @ivar name: The object's name. (Read only) + - note: Currently (Blender 2.49) the prefix "OB" is added to all objects name. This may change in blender 2.5. + @type name: string. + @ivar mass: The object's mass + - note: The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0 + @type mass: float + @ivar linVelocityMin: Enforces the object keeps moving at a minimum velocity. + - note: Applies to dynamic and rigid body objects only. + - note: A value of 0.0 disables this option. + - note: While objects are stationary the minimum velocity will not be applied. + @type linVelocityMin: float + @ivar linVelocityMax: Clamp the maximum linear velocity to prevent objects moving beyond a set speed. + - note: Applies to dynamic and rigid body objects only. + - note: A value of 0.0 disables this option (rather then setting it stationary). + @type linVelocityMax: float + @ivar localInertia: the object's inertia vector in local coordinates. Read only. + @type localInertia: list [ix, iy, iz] + @ivar parent: The object's parent object. (Read only) + @type parent: L{KX_GameObject} or None + @ivar visible: visibility flag. + - note: Game logic will still run for invisible objects. + @type visible: boolean + @ivar occlusion: occlusion capability flag. + @type occlusion: boolean + @ivar position: The object's position. + DEPRECATED: use localPosition and worldPosition + @type position: list [x, y, z] On write: local position, on read: world position + @ivar orientation: The object's orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. + DEPRECATED: use localOrientation and worldOrientation + @type orientation: 3x3 Matrix [[float]] On write: local orientation, on read: world orientation + @ivar scaling: The object's scaling factor. list [sx, sy, sz] + DEPRECATED: use localScaling and worldScaling + @type scaling: list [sx, sy, sz] On write: local scaling, on read: world scaling + @ivar localOrientation: The object's local orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. + @type localOrientation: 3x3 Matrix [[float]] + @ivar worldOrientation: The object's world orientation. + @type worldOrientation: 3x3 Matrix [[float]] + @ivar localScaling: The object's local scaling factor. + @type localScaling: list [sx, sy, sz] + @ivar worldScaling: The object's world scaling factor. Read-only + @type worldScaling: list [sx, sy, sz] + @ivar localPosition: The object's local position. + @type localPosition: list [x, y, z] + @ivar worldPosition: The object's world position. + @type worldPosition: list [x, y, z] + @ivar timeOffset: adjust the slowparent delay at runtime. + @type timeOffset: float + @ivar state: the game object's state bitmask, using the first 30 bits, one bit must always be set. + @type state: int + @ivar meshes: a list meshes for this object. + - note: Most objects use only 1 mesh. + - note: Changes to this list will not update the KX_GameObject. + @type meshes: list of L{KX_MeshProxy} + @ivar sensors: a sequence of L{SCA_ISensor} objects with string/index lookups and iterator support. + - note: This attribute is experemental and may be removed (but probably wont be). + - note: Changes to this list will not update the KX_GameObject. + @type sensors: list + @ivar controllers: a sequence of L{SCA_IController} objects with string/index lookups and iterator support. + - note: This attribute is experemental and may be removed (but probably wont be). + - note: Changes to this list will not update the KX_GameObject. + @type controllers: list of L{SCA_ISensor}. + @ivar actuators: a list of L{SCA_IActuator} with string/index lookups and iterator support. + - note: This attribute is experemental and may be removed (but probably wont be). + - note: Changes to this list will not update the KX_GameObject. + @type actuators: list + @ivar attrDict: get the objects internal python attribute dictionary for direct (faster) access. + @type attrDict: dict + @group Deprecated: getPosition, setPosition, setWorldPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass, getMesh + """ + def endObject(): + """ + Delete this object, can be used inpace of the EndObject Actuator. + The actual removal of the object from the scene is delayed. + """ + def replaceMesh(mesh): + """ + Replace the mesh of this object with a new mesh. This works the same was as the actuator. + @type mesh: L{KX_MeshProxy} or mesh name + """ + def getVisible(): + """ + Gets the game object's visible flag. (B{deprecated}) + + @rtype: boolean + """ + def setVisible(visible, recursive): + """ + Sets the game object's visible flag. + + @type visible: boolean + @type recursive: boolean + @param recursive: optional argument to set all childrens visibility flag too. + """ + def setOcclusion(occlusion, recursive): + """ + Sets the game object's occlusion capability. + + @type occlusion: boolean + @type recursive: boolean + @param recursive: optional argument to set all childrens occlusion flag too. + """ + def getState(): + """ + Gets the game object's state bitmask. (B{deprecated}) + + @rtype: int + @return: the objects state. + """ + def setState(state): + """ + Sets the game object's state flag. (B{deprecated}). + The bitmasks for states from 1 to 30 can be set with (1<<0, 1<<1, 1<<2 ... 1<<29) + + @type state: integer + """ + def setPosition(pos): + """ + Sets the game object's position. (B{deprecated}) + Global coordinates for root object, local for child objects. + + + @type pos: [x, y, z] + @param pos: the new position, in local coordinates. + """ + def setWorldPosition(pos): + """ + Sets the game object's position in world coordinates regardless if the object is root or child. + + @type pos: [x, y, z] + @param pos: the new position, in world coordinates. + """ + def getPosition(): + """ + Gets the game object's position. (B{deprecated}) + + @rtype: list [x, y, z] + @return: the object's position in world coordinates. + """ + def setOrientation(orn): + """ + Sets the game object's orientation. (B{deprecated}) + + @type orn: 3x3 rotation matrix, or Quaternion. + @param orn: a rotation matrix specifying the new rotation. + @note: When using this matrix with Blender.Mathutils.Matrix() types, it will need to be transposed. + """ + def alignAxisToVect(vect, axis, factor): + """ + Aligns any of the game object's axis along the given vector. + + @type vect: 3d vector. + @param vect: a vector to align the axis. + @type axis: integer. + @param axis:The axis you want to align + - 0: X axis + - 1: Y axis + - 2: Z axis (default) + @type factor: float + @param factor: Only rotate a feaction of the distance to the target vector (0.0 - 1.0) + """ + def getAxisVect(vect): + """ + Returns the axis vector rotates by the objects worldspace orientation. + This is the equivalent if multiplying the vector by the orientation matrix. + + @type vect: 3d vector. + @param vect: a vector to align the axis. + @rtype: 3d vector. + @return: The vector in relation to the objects rotation. + + """ + def getOrientation(): + """ + Gets the game object's orientation. (B{deprecated}) + + @rtype: 3x3 rotation matrix + @return: The game object's rotation matrix + @note: When using this matrix with Blender.Mathutils.Matrix() types, it will need to be transposed. + """ + def applyMovement(movement, local = 0): + """ + Sets the game object's movement. + + @type movement: 3d vector. + @param movement: movement vector. + @type local: boolean + @param local: - False: you get the "global" movement ie: relative to world orientation (default). + - True: you get the "local" movement ie: relative to object orientation. + """ + def applyRotation(rotation, local = 0): + """ + Sets the game object's rotation. + + @type rotation: 3d vector. + @param rotation: rotation vector. + @type local: boolean + @param local: - False: you get the "global" rotation ie: relative to world orientation (default). + - True: you get the "local" rotation ie: relative to object orientation. + """ + def applyForce(force, local = 0): + """ + Sets the game object's force. + + This requires a dynamic object. + + @type force: 3d vector. + @param force: force vector. + @type local: boolean + @param local: - False: you get the "global" force ie: relative to world orientation (default). + - True: you get the "local" force ie: relative to object orientation. + """ + def applyTorque(torque, local = 0): + """ + Sets the game object's torque. + + This requires a dynamic object. + + @type torque: 3d vector. + @param torque: torque vector. + @type local: boolean + @param local: - False: you get the "global" torque ie: relative to world orientation (default). + - True: you get the "local" torque ie: relative to object orientation. + """ + def getLinearVelocity(local = 0): + """ + Gets the game object's linear velocity. + + This method returns the game object's velocity through it's centre of mass, + ie no angular velocity component. + + @type local: boolean + @param local: - False: you get the "global" velocity ie: relative to world orientation (default). + - True: you get the "local" velocity ie: relative to object orientation. + @rtype: list [vx, vy, vz] + @return: the object's linear velocity. + """ + def setLinearVelocity(velocity, local = 0): + """ + Sets the game object's linear velocity. + + This method sets game object's velocity through it's centre of mass, + ie no angular velocity component. + + This requires a dynamic object. + + @type velocity: 3d vector. + @param velocity: linear velocity vector. + @type local: boolean + @param local: - False: you get the "global" velocity ie: relative to world orientation (default). + - True: you get the "local" velocity ie: relative to object orientation. + """ + def getAngularVelocity(local = 0): + """ + Gets the game object's angular velocity. + + @type local: boolean + @param local: - False: you get the "global" velocity ie: relative to world orientation (default). + - True: you get the "local" velocity ie: relative to object orientation. + @rtype: list [vx, vy, vz] + @return: the object's angular velocity. + """ + def setAngularVelocity(velocity, local = 0): + """ + Sets the game object's angular velocity. + + This requires a dynamic object. + + @type velocity: 3d vector. + @param velocity: angular velocity vector. + @type local: boolean + @param local: - False: you get the "global" velocity ie: relative to world orientation (default). + - True: you get the "local" velocity ie: relative to object orientation. + """ + def getVelocity(point): + """ + Gets the game object's velocity at the specified point. + + Gets the game object's velocity at the specified point, including angular + components. + + @type point: list [x, y, z] + @param point: the point to return the velocity for, in local coordinates. (optional: default = [0, 0, 0]) + @rtype: list [vx, vy, vz] + @return: the velocity at the specified point. + """ + def getMass(): + """ + Gets the game object's mass. (B{deprecated}) + + @rtype: float + @return: the object's mass. + """ + def getReactionForce(): + """ + Gets the game object's reaction force. + + The reaction force is the force applied to this object over the last simulation timestep. + This also includes impulses, eg from collisions. + + (B{This is not implimented for bullet physics at the moment}) + + @rtype: list [fx, fy, fz] + @return: the reaction force of this object. + """ + def applyImpulse(point, impulse): + """ + Applies an impulse to the game object. + + This will apply the specified impulse to the game object at the specified point. + If point != getPosition(), applyImpulse will also change the object's angular momentum. + Otherwise, only linear momentum will change. + + @type point: list [x, y, z] + @param point: the point to apply the impulse to (in world coordinates) + """ + def suspendDynamics(): + """ + Suspends physics for this object. + """ + def restoreDynamics(): + """ + Resumes physics for this object. + @Note: The objects linear velocity will be applied from when the dynamics were suspended. + """ + def enableRigidBody(): + """ + Enables rigid body physics for this object. + + Rigid body physics allows the object to roll on collisions. + @Note: This is not working with bullet physics yet. + """ + def disableRigidBody(): + """ + Disables rigid body physics for this object. + @Note: This is not working with bullet physics yet. The angular is removed but rigid body physics can still rotate it later. + """ + def getParent(): + """ + Gets this object's parent. (B{deprecated}) + + @rtype: L{KX_GameObject} + @return: this object's parent object, or None if this object has no parent. + """ + def setParent(parent): + """ + Sets this object's parent. + + @type parent: L{KX_GameObject} + @param parent: new parent object. + """ + def removeParent(): + """ + Removes this objects parent. + """ + def getChildren(): + """ + Return a list of immediate children of this object. + @rtype: L{CListValue} of L{KX_GameObject} + @return: a list of all this objects children. + """ + def getChildrenRecursive(): + """ + Return a list of children of this object, including all their childrens children. + @rtype: L{CListValue} of L{KX_GameObject} + @return: a list of all this objects children recursivly. + """ + def getMesh(mesh): + """ + Gets the mesh object for this object. + + @type mesh: integer + @param mesh: the mesh object to return (optional: default mesh = 0) + @rtype: L{KX_MeshProxy} + @return: the first mesh object associated with this game object, or None if this object has no meshs. + """ + def getPhysicsId(): + """ + Returns the user data object associated with this game object's physics controller. + """ + def getPropertyNames(): + """ + Gets a list of all property names. + @rtype: list + @return: All property names for this object. + """ + def getDistanceTo(other): + """ + Returns the distance to another object or point. + + @param other: a point or another L{KX_GameObject} to measure the distance to. + @type other: L{KX_GameObject} or list [x, y, z] + @rtype: float + """ + def getVectTo(other): + """ + Returns the vector and the distance to another object or point. + The vector is normalized unless the distance is 0, in which a NULL vector is returned. + + @param other: a point or another L{KX_GameObject} to get the vector and distance to. + @type other: L{KX_GameObject} or list [x, y, z] + @rtype: 3-tuple (float, 3-tuple (x,y,z), 3-tuple (x,y,z)) + @return: (distance, globalVector(3), localVector(3)) + """ + def rayCastTo(other,dist,prop): + """ + Look towards another point/object and find first object hit within dist that matches prop. + + The ray is always casted from the center of the object, ignoring the object itself. + The ray is casted towards the center of another object or an explicit [x,y,z] point. + Use rayCast() if you need to retrieve the hit point + + @param other: [x,y,z] or object towards which the ray is casted + @type other: L{KX_GameObject} or 3-tuple + @param dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other + @type dist: float + @param prop: property name that object must have; can be omitted => detect any object + @type prop: string + @rtype: L{KX_GameObject} + @return: the first object hit or None if no object or object does not match prop + """ + def rayCast(objto,objfrom,dist,prop,face,xray,poly): + """ + Look from a point/object to another point/object and find first object hit within dist that matches prop. + if poly is 0, returns a 3-tuple with object reference, hit point and hit normal or (None,None,None) if no hit. + if poly is 1, returns a 4-tuple with in addition a L{KX_PolyProxy} as 4th element. + + Ex:: + # shoot along the axis gun-gunAim (gunAim should be collision-free) + ob,point,normal = gun.rayCast(gunAim,None,50) + if ob: + # hit something + + Notes: + The ray ignores the object on which the method is called. + It is casted from/to object center or explicit [x,y,z] points. + + The face paremeter determines the orientation of the normal:: + 0 => hit normal is always oriented towards the ray origin (as if you casted the ray from outside) + 1 => hit normal is the real face normal (only for mesh object, otherwise face has no effect) + + The ray has X-Ray capability if xray parameter is 1, otherwise the first object hit (other than self object) stops the ray. + The prop and xray parameters interact as follow:: + prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray. + prop off, xray on : idem. + prop on, xray off: return closest hit if it matches prop, no hit otherwise. + prop on, xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray. + The L{KX_PolyProxy} 4th element of the return tuple when poly=1 allows to retrieve information on the polygon hit by the ray. + If there is no hit or the hit object is not a static mesh, None is returned as 4th element. + + The ray ignores collision-free objects and faces that dont have the collision flag enabled, you can however use ghost objects. + + @param objto: [x,y,z] or object to which the ray is casted + @type objto: L{KX_GameObject} or 3-tuple + @param objfrom: [x,y,z] or object from which the ray is casted; None or omitted => use self object center + @type objfrom: L{KX_GameObject} or 3-tuple or None + @param dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to to + @type dist: float + @param prop: property name that object must have; can be omitted or "" => detect any object + @type prop: string + @param face: normal option: 1=>return face normal; 0 or omitted => normal is oriented towards origin + @type face: int + @param xray: X-ray option: 1=>skip objects that don't match prop; 0 or omitted => stop on first object + @type xray: int + @param poly: polygon option: 1=>return value is a 4-tuple and the 4th element is a L{KX_PolyProxy} + @type poly: int + @rtype: 3-tuple (L{KX_GameObject}, 3-tuple (x,y,z), 3-tuple (nx,ny,nz)) + or 4-tuple (L{KX_GameObject}, 3-tuple (x,y,z), 3-tuple (nx,ny,nz), L{KX_PolyProxy}) + @return: (object,hitpoint,hitnormal) or (object,hitpoint,hitnormal,polygon) + If no hit, returns (None,None,None) or (None,None,None,None) + If the object hit is not a static mesh, polygon is None + """ + def setCollisionMargin(margin): + """ + Set the objects collision margin. + + note: If this object has no physics controller (a physics ID of zero), this function will raise RuntimeError. + + @type margin: float + @param margin: the collision margin distance in blender units. + """ + def sendMessage(subject, body="", to=""): + """ + Sends a message. + + @param subject: The subject of the message + @type subject: string + @param body: The body of the message (optional) + @type body: string + @param to: The name of the object to send the message to (optional) + @type to: string + """ + +class KX_IpoActuator(SCA_IActuator): + """ + IPO actuator activates an animation. + + @ivar startFrame: Start frame. + @type startFrame: float + @ivar endFrame: End frame. + @type endFrame: float + @ivar propName: Use this property to define the Ipo position + @type propName: string + @ivar framePropName: Assign this property this action current frame number + @type framePropName: string + @ivar type: Play mode for the ipo. (In GameLogic.KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND, KX_IPOACT_FROM_PROP) + @type type: int + @ivar useIpoAsForce: Apply Ipo as a global or local force depending on the local option (dynamic objects only) + @type useIpoAsForce: bool + @ivar useIpoAdd: Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag + @type useIpoAdd: bool + @ivar useIpoLocal: Let the ipo acts in local coordinates, used in Force and Add mode. + @type useIpoLocal: bool + @ivar useChildren: Update IPO on all children Objects as well + @type useChildren: bool + """ + def set(mode, startframe, endframe, force): + """ + Sets the properties of the actuator. (B{deprecated}) + + @param mode: "Play", "PingPong", "Flipper", "LoopStop", "LoopEnd" or "FromProp" + @type mode: string + @param startframe: first frame to use + @type startframe: integer + @param endframe: last frame to use + @type endframe: integer + @param force: special mode + @type force: integer (0=normal, 1=interpret location as force, 2=additive) + """ + def setProperty(property): + """ + Sets the name of the property to be used in FromProp mode. (B{deprecated}) + + @type property: string + """ + def setStart(startframe): + """ + Sets the frame from which the IPO starts playing. (B{deprecated}) + + @type startframe: integer + """ + def getStart(): + """ + Returns the frame from which the IPO starts playing. (B{deprecated}) + + @rtype: integer + """ + def setEnd(endframe): + """ + Sets the frame at which the IPO stops playing. (B{deprecated}) + + @type endframe: integer + """ + def getEnd(): + """ + Returns the frame at which the IPO stops playing. (B{deprecated}) + + @rtype: integer + """ + def setIpoAsForce(force): + """ + Set whether to interpret the ipo as a force rather than a displacement. (B{deprecated}) + + @type force: boolean + @param force: KX_TRUE or KX_FALSE + """ + def getIpoAsForce(): + """ + Returns whether to interpret the ipo as a force rather than a displacement. (B{deprecated}) + + @rtype: boolean + """ + def setIpoAdd(add): + """ + Set whether to interpret the ipo as additive rather than absolute. (B{deprecated}) + + @type add: boolean + @param add: KX_TRUE or KX_FALSE + """ + def getIpoAdd(): + """ + Returns whether to interpret the ipo as additive rather than absolute. (B{deprecated}) + + @rtype: boolean + """ + def setType(mode): + """ + Sets the operation mode of the actuator. (B{deprecated}) + + @param mode: KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND + @type mode: string + """ + def getType(): + """ + Returns the operation mode of the actuator. (B{deprecated}) + + @rtype: integer + @return: KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND + """ + def setForceIpoActsLocal(local): + """ + Set whether to apply the force in the object's local + coordinates rather than the world global coordinates. (B{deprecated}) + + @param local: Apply the ipo-as-force in the object's local + coordinates? (KX_TRUE, KX_FALSE) + @type local: boolean + """ + def getForceIpoActsLocal(): + """ + Return whether to apply the force in the object's local + coordinates rather than the world global coordinates. (B{deprecated}) + """ + +class KX_LightObject(KX_GameObject): + """ + A Light object. + + Example: + + # Turn on a red alert light. + import GameLogic + + co = GameLogic.getCurrentController() + light = co.getOwner() + + light.energy = 1.0 + light.colour = [1.0, 0.0, 0.0] + + @group Constants: NORMAL, SPOT, SUN + @ivar SPOT: A spot light source. See attribute 'type' + @ivar SUN: A point light source with no attenuation. See attribute 'type' + @ivar NORMAL: A point light source. See attribute 'type' + + @ivar type: The type of light - must be SPOT, SUN or NORMAL + @ivar layer: The layer mask that this light affects object on. + @type layer: bitfield + @ivar energy: The brightness of this light. + @type energy: float + @ivar distance: The maximum distance this light can illuminate. (SPOT and NORMAL lights only) + @type distance: float + @ivar colour: The colour of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0] + @type colour: list [r, g, b] + @ivar color: Synonym for colour. + @ivar lin_attenuation: The linear component of this light's attenuation. (SPOT and NORMAL lights only) + @type lin_attenuation: float + @ivar quad_attenuation: The quadratic component of this light's attenuation (SPOT and NORMAL lights only) + @type quad_attenuation: float + @ivar spotsize: The cone angle of the spot light, in degrees. (float) (SPOT lights only) + 0.0 <= spotsize <= 180.0. Spotsize = 360.0 is also accepted. + @ivar spotblend: Specifies the intensity distribution of the spot light. (float) (SPOT lights only) + Higher values result in a more focused light source. + 0.0 <= spotblend <= 1.0. + + """ + +class KX_MeshProxy(SCA_IObject): + """ + A mesh object. + + You can only change the vertex properties of a mesh object, not the mesh topology. + + To use mesh objects effectively, you should know a bit about how the game engine handles them. + 1. Mesh Objects are converted from Blender at scene load. + 2. The Converter groups polygons by Material. This means they can be sent to the + renderer efficiently. A material holds: + 1. The texture. + 2. The Blender material. + 3. The Tile properties + 4. The face properties - (From the "Texture Face" panel) + 5. Transparency & z sorting + 6. Light layer + 7. Polygon shape (triangle/quad) + 8. Game Object + 3. Verticies will be split by face if necessary. Verticies can only be shared between + faces if: + 1. They are at the same position + 2. UV coordinates are the same + 3. Their normals are the same (both polygons are "Set Smooth") + 4. They are the same colour + For example: a cube has 24 verticies: 6 faces with 4 verticies per face. + + The correct method of iterating over every L{KX_VertexProxy} in a game object:: + import GameLogic + + co = GameLogic.getcurrentController() + obj = co.getOwner() + + m_i = 0 + mesh = obj.getMesh(m_i) # There can be more than one mesh... + while mesh != None: + for mat in range(mesh.getNumMaterials()): + for v_index in range(mesh.getVertexArrayLength(mat)): + vertex = mesh.getVertex(mat, v_index) + # Do something with vertex here... + # ... eg: colour the vertex red. + vertex.colour = [1.0, 0.0, 0.0, 1.0] + m_i += 1 + mesh = obj.getMesh(m_i) + + @ivar materials: + @type materials: list of L{KX_BlenderMaterial} or L{KX_PolygonMaterial} types + + @ivar numPolygons: + @type numPolygons: integer + + @ivar numMaterials: + @type numMaterials: integer + """ + + def getNumMaterials(): + """ + Gets the number of materials associated with this object. + + @rtype: integer + """ + + def getMaterialName(matid): + """ + Gets the name of the specified material. + + @type matid: integer + @param matid: the specified material. + @rtype: string + @return: the attached material name. + """ + def getTextureName(matid): + """ + Gets the name of the specified material's texture. + + @type matid: integer + @param matid: the specified material + @rtype: string + @return: the attached material's texture name. + """ + def getVertexArrayLength(matid): + """ + Gets the length of the vertex array associated with the specified material. + + There is one vertex array for each material. + + @type matid: integer + @param matid: the specified material + @rtype: integer + @return: the number of verticies in the vertex array. + """ + def getVertex(matid, index): + """ + Gets the specified vertex from the mesh object. + + @type matid: integer + @param matid: the specified material + @type index: integer + @param index: the index into the vertex array. + @rtype: L{KX_VertexProxy} + @return: a vertex object. + """ + def getNumPolygons(): + """ + Returns the number of polygon in the mesh. + + @rtype: integer + """ + def getPolygon(index): + """ + Gets the specified polygon from the mesh. + + @type index: integer + @param index: polygon number + @rtype: L{KX_PolyProxy} + @return: a polygon object. + """ + def reinstancePhysicsMesh(): + """ + Updates the physics system with the changed mesh. + + A mesh must have only one material with collision flags, + and have all collision primitives in one vertex array (ie. < 65535 verts) and + be either a polytope or polyheder mesh. If you don't get a warning in the + console when the collision type is polytope, the mesh is suitable for reinstance. + + @rtype: boolean + @return: True if reinstance succeeded, False if it failed. + """ + +class SCA_MouseSensor(SCA_ISensor): + """ + Mouse Sensor logic brick. + + Properties: + + @ivar position: current [x,y] coordinates of the mouse, in frame coordinates (pixels) + @type position: [integer,interger] + @ivar mode: sensor mode: 1=KX_MOUSESENSORMODE_LEFTBUTTON 2=KX_MOUSESENSORMODE_MIDDLEBUTTON + 3=KX_MOUSESENSORMODE_RIGHTBUTTON 4=KX_MOUSESENSORMODE_WHEELUP + 5=KX_MOUSESENSORMODE_WHEELDOWN 9=KX_MOUSESENSORMODE_MOVEMENT + @type mode: integer + """ + + def getXPosition(): + """ + DEPRECATED: use the position property + Gets the x coordinate of the mouse. + + @rtype: integer + @return: the current x coordinate of the mouse, in frame coordinates (pixels) + """ + def getYPosition(): + """ + DEPRECATED: use the position property + Gets the y coordinate of the mouse. + + @rtype: integer + @return: the current y coordinate of the mouse, in frame coordinates (pixels). + """ + def getButtonStatus(button): + """ + Get the mouse button status. + + @type button: int + @param button: value in GameLogic members KX_MOUSE_BUT_LEFT, KX_MOUSE_BUT_MIDDLE, KX_MOUSE_BUT_RIGHT + + @rtype: integer + @return: value in GameLogic members KX_INPUT_NONE, KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED + """ + +class KX_MouseFocusSensor(SCA_MouseSensor): + """ + The mouse focus sensor detects when the mouse is over the current game object. + + The mouse focus sensor works by transforming the mouse coordinates from 2d device + space to 3d space then raycasting away from the camera. + + @ivar raySource: The worldspace source of the ray (the view position) + @type raySource: list (vector of 3 floats) + @ivar rayTarget: The worldspace target of the ray. + @type rayTarget: list (vector of 3 floats) + @ivar rayDirection: The L{rayTarget} - L{raySource} normalized. + @type rayDirection: list (normalized vector of 3 floats) + @ivar hitObject: the last object the mouse was over. + @type hitObject: L{KX_GameObject} or None + @ivar hitPosition: The worldspace position of the ray intersecton. + @type hitPosition: list (vector of 3 floats) + @ivar hitNormal: the worldspace normal from the face at point of intersection. + @type hitNormal: list (normalized vector of 3 floats) + """ + + def getHitNormal(): + """ + Returns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray. (B{deprecated}) + + @rtype: list [x, y, z] + @return: the ray collision normal. + """ + def getHitObject(): + """ + Returns the object that was hit by this ray or None. (B{deprecated}) + + @rtype: L{KX_GameObject} or None + @return: the collision object. + """ + def getHitPosition(): + """ + Returns the position (in worldcoordinates) at the point of collision where the object was hit by this ray. (B{deprecated}) + + @rtype: list [x, y, z] + @return: the ray collision position. + """ + def getRayDirection(): + """ + Returns the normalized direction (in worldcoordinates) of the ray cast by the mouse. (B{deprecated}) + + @rtype: list [x, y, z] + @return: the ray direction. + """ + def getRaySource(): + """ + Returns the position (in worldcoordinates) the ray was cast from by the mouse. (B{deprecated}) + + @rtype: list [x, y, z] + @return: the ray source. + """ + def getRayTarget(): + """ + Returns the target of the ray (in worldcoordinates) that seeks the focus object. (B{deprecated}) + + @rtype: list [x, y, z] + @return: the ray target. + """ + +class KX_TouchSensor(SCA_ISensor): + """ + Touch sensor detects collisions between objects. + + @ivar property: The property or material to collide with. + @type property: string + @ivar useMaterial: Determines if the sensor is looking for a property or material. + KX_True = Find material; KX_False = Find property + @type useMaterial: boolean + @ivar pulseCollisions: The last collided object. + @type pulseCollisions: bool + @ivar objectHit: The last collided object. (Read Only) + @type objectHit: L{KX_GameObject} or None + @ivar objectHitList: A list of colliding objects. (Read Only) + @type objectHitList: L{CListValue} of L{KX_GameObject} + """ + + #--The following methods are deprecated, please use properties instead. + def setProperty(name): + """ + DEPRECATED: use the property property + Set the property or material to collide with. Use + setTouchMaterial() to switch between properties and + materials. + @type name: string + """ + + def getProperty(): + """ + DEPRECATED: use the property property + Returns the property or material to collide with. Use + getTouchMaterial() to find out whether this sensor + looks for properties or materials. (B{deprecated}) + + @rtype: string + """ + def getHitObject(): + """ + DEPRECATED: use the objectHit property + Returns the last object hit by this touch sensor. (B{deprecated}) + + @rtype: L{KX_GameObject} + """ + def getHitObjectList(): + """ + DEPRECATED: use the objectHitList property + Returns a list of all objects hit in the last frame. (B{deprecated}) + + Only objects that have the requisite material/property are listed. + + @rtype: L{CListValue} of L{KX_GameObject} + """ + def getTouchMaterial(): + """ + DEPRECATED: use the useMaterial property + Returns KX_TRUE if this sensor looks for a specific material, + KX_FALSE if it looks for a specific property. (B{deprecated}) + """ + +class KX_NearSensor(KX_TouchSensor): + """ + A near sensor is a specialised form of touch sensor. + + @ivar distance: The near sensor activates when an object is within this distance. + @type distance: float + @ivar resetDistance: The near sensor deactivates when the object exceeds this distance. + @type resetDistance: float + """ + +class KX_NetworkMessageActuator(SCA_IActuator): + """ + Message Actuator + + @ivar propName: Messages will only be sent to objects with the given property name. + @type propName: string + @ivar subject: The subject field of the message. + @type subject: string + @ivar body: The body of the message. + @type body: string + @ivar usePropBody: Send a property instead of a regular body message. + @type usePropBody: boolean + """ + def setToPropName(name): + """ + DEPRECATED: Use the propName property instead. + Messages will only be sent to objects with the given property name. + + @type name: string + """ + def setSubject(subject): + """ + DEPRECATED: Use the subject property instead. + Sets the subject field of the message. + + @type subject: string + """ + def setBodyType(bodytype): + """ + DEPRECATED: Use the usePropBody property instead. + Sets the type of body to send. + + @type bodytype: boolean + @param bodytype: True to send the value of a property, False to send the body text. + """ + def setBody(body): + """ + DEPRECATED: Use the body property instead. + Sets the message body. + + @type body: string + @param body: if the body type is True, this is the name of the property to send. + if the body type is False, this is the text to send. + """ + +class KX_NetworkMessageSensor(SCA_ISensor): + """ + The Message Sensor logic brick. + + Currently only loopback (local) networks are supported. + + @ivar subject: The subject the sensor is looking for. + @type subject: string + @ivar frameMessageCount: The number of messages received since the last frame. + (Read-only) + @type framemessageCount: int + @ivar subjects: The list of message subjects received. (Read-only) + @type subjects: list of strings + @ivar bodies: The list of message bodies received. (Read-only) + @type bodies: list of strings + """ + + + def setSubjectFilterText(subject): + """ + DEPRECATED: Use the subject property instead. + Change the message subject text that this sensor is listening to. + + @type subject: string + @param subject: the new message subject to listen for. + """ + + def getFrameMessageCount(): + """ + DEPRECATED: Use the frameMessageCount property instead. + Get the number of messages received since the last frame. + + @rtype: integer + """ + def getBodies(): + """ + DEPRECATED: Use the bodies property instead. + Gets the list of message bodies. + + @rtype: list + """ + def getSubject(): + """ + DEPRECATED: Use the subject property instead. + Gets the message subject this sensor is listening for from the Subject: field. + + @rtype: string + """ + def getSubjects(): + """ + DEPRECATED: Use the subjects property instead. + Gets the list of message subjects received. + + @rtype: list + """ + +class KX_ObjectActuator(SCA_IActuator): + """ + The object actuator ("Motion Actuator") applies force, torque, displacement, angular displacement, + velocity, or angular velocity to an object. + Servo control allows to regulate force to achieve a certain speed target. + """ + def getForce(): + """ + Returns the force applied by the actuator. + + @rtype: list [fx, fy, fz, local] + @return: A four item list, containing the vector force, and a flag specifying whether the force is local. + """ + def setForce(fx, fy, fz, local): + """ + Sets the force applied by the actuator. + + @type fx: float + @param fx: the x component of the force. + @type fy: float + @param fy: the z component of the force. + @type fz: float + @param fz: the z component of the force. + @type local: boolean + @param local: - False: the force is applied in world coordinates. + - True: the force is applied in local coordinates. + """ + def getTorque(): + """ + Returns the torque applied by the actuator. + + @rtype: list [S{Tau}x, S{Tau}y, S{Tau}z, local] + @return: A four item list, containing the vector torque, and a flag specifying whether + the torque is applied in local coordinates (True) or world coordinates (False) + """ + def setTorque(tx, ty, tz, local): + """ + Sets the torque applied by the actuator. + + @type tx: float + @param tx: the x component of the torque. + @type ty: float + @param ty: the z component of the torque. + @type tz: float + @param tz: the z component of the torque. + @type local: boolean + @param local: - False: the torque is applied in world coordinates. + - True: the torque is applied in local coordinates. + """ + def getDLoc(): + """ + Returns the displacement vector applied by the actuator. + + @rtype: list [dx, dy, dz, local] + @return: A four item list, containing the vector displacement, and whether + the displacement is applied in local coordinates (True) or world + coordinates (False) + """ + def setDLoc(dx, dy, dz, local): + """ + Sets the displacement vector applied by the actuator. + + Since the displacement is applied every frame, you must adjust the displacement + based on the frame rate, or you game experience will depend on the player's computer + speed. + + @type dx: float + @param dx: the x component of the displacement vector. + @type dy: float + @param dy: the z component of the displacement vector. + @type dz: float + @param dz: the z component of the displacement vector. + @type local: boolean + @param local: - False: the displacement vector is applied in world coordinates. + - True: the displacement vector is applied in local coordinates. + """ + def getDRot(): + """ + Returns the angular displacement vector applied by the actuator. + + @rtype: list [dx, dy, dz, local] + @return: A four item list, containing the angular displacement vector, and whether + the displacement is applied in local coordinates (True) or world + coordinates (False) + """ + def setDRot(dx, dy, dz, local): + """ + Sets the angular displacement vector applied by the actuator. + + Since the displacement is applied every frame, you must adjust the displacement + based on the frame rate, or you game experience will depend on the player's computer + speed. + + @type dx: float + @param dx: the x component of the angular displacement vector. + @type dy: float + @param dy: the z component of the angular displacement vector. + @type dz: float + @param dz: the z component of the angular displacement vector. + @type local: boolean + @param local: - False: the angular displacement vector is applied in world coordinates. + - True: the angular displacement vector is applied in local coordinates. + """ + def getLinearVelocity(): + """ + Returns the linear velocity applied by the actuator. + For the servo control actuator, this is the target speed. + + @rtype: list [vx, vy, vz, local] + @return: A four item list, containing the vector velocity, and whether the velocity is applied in local coordinates (True) or world coordinates (False) + """ + def setLinearVelocity(vx, vy, vz, local): + """ + Sets the linear velocity applied by the actuator. + For the servo control actuator, sets the target speed. + + @type vx: float + @param vx: the x component of the velocity vector. + @type vy: float + @param vy: the z component of the velocity vector. + @type vz: float + @param vz: the z component of the velocity vector. + @type local: boolean + @param local: - False: the velocity vector is in world coordinates. + - True: the velocity vector is in local coordinates. + """ + def getAngularVelocity(): + """ + Returns the angular velocity applied by the actuator. + + @rtype: list [S{omega}x, S{omega}y, S{omega}z, local] + @return: A four item list, containing the vector velocity, and whether + the velocity is applied in local coordinates (True) or world + coordinates (False) + """ + def setAngularVelocity(wx, wy, wz, local): + """ + Sets the angular velocity applied by the actuator. + + @type wx: float + @param wx: the x component of the velocity vector. + @type wy: float + @param wy: the z component of the velocity vector. + @type wz: float + @param wz: the z component of the velocity vector. + @type local: boolean + @param local: - False: the velocity vector is applied in world coordinates. + - True: the velocity vector is applied in local coordinates. + """ + def getDamping(): + """ + Returns the damping parameter of the servo controller. + + @rtype: integer + @return: the time constant of the servo controller in frame unit. + """ + def setDamping(damp): + """ + Sets the damping parameter of the servo controller. + + @type damp: integer + @param damp: the damping parameter in frame unit. + """ + def getForceLimitX(): + """ + Returns the min/max force limit along the X axis used by the servo controller. + + @rtype: list [min, max, enabled] + @return: A three item list, containing the min and max limits of the force as float + and whether the limits are active(true) or inactive(true) + """ + def setForceLimitX(min, max, enable): + """ + Sets the min/max force limit along the X axis and activates or deactivates the limits in the servo controller. + + @type min: float + @param min: the minimum value of the force along the X axis. + @type max: float + @param max: the maximum value of the force along the X axis. + @type enable: boolean + @param enable: - True: the force will be limited to the min/max + - False: the force will not be limited + """ + def getForceLimitY(): + """ + Returns the min/max force limit along the Y axis used by the servo controller. + + @rtype: list [min, max, enabled] + @return: A three item list, containing the min and max limits of the force as float + and whether the limits are active(true) or inactive(true) + """ + def setForceLimitY(min, max, enable): + """ + Sets the min/max force limit along the Y axis and activates or deactivates the limits in the servo controller. + + @type min: float + @param min: the minimum value of the force along the Y axis. + @type max: float + @param max: the maximum value of the force along the Y axis. + @type enable: boolean + @param enable: - True: the force will be limited to the min/max + - False: the force will not be limited + """ + def getForceLimitZ(): + """ + Returns the min/max force limit along the Z axis used by the servo controller. + + @rtype: list [min, max, enabled] + @return: A three item list, containing the min and max limits of the force as float + and whether the limits are active(true) or inactive(true) + """ + def setForceLimitZ(min, max, enable): + """ + Sets the min/max force limit along the Z axis and activates or deactivates the limits in the servo controller. + + @type min: float + @param min: the minimum value of the force along the Z axis. + @type max: float + @param max: the maximum value of the force along the Z axis. + @type enable: boolean + @param enable: - True: the force will be limited to the min/max + - False: the force will not be limited + """ + def getPID(): + """ + Returns the PID coefficient of the servo controller. + + @rtype: list [P, I, D] + @return: A three item list, containing the PID coefficient as floats: + P : proportional coefficient + I : Integral coefficient + D : Derivate coefficient + """ + def setPID(P, I, D): + """ + Sets the PID coefficients of the servo controller. + + @type P: flat + @param P: proportional coefficient + @type I: float + @param I: Integral coefficient + @type D: float + @param D: Derivate coefficient + """ + +class KX_ParentActuator(SCA_IActuator): + """ + The parent actuator can set or remove an objects parent object. + @ivar object: the object this actuator sets the parent too. + @type object: KX_GameObject or None + @ivar mode: The mode of this actuator + @type mode: int from 0 to 1 L{GameLogic.Parent Actuator} + """ + def setObject(object): + """ + DEPRECATED: Use the object property. + Sets the object to set as parent. + + Object can be either a L{KX_GameObject} or the name of the object. + + @type object: L{KX_GameObject}, string or None + """ + def getObject(name_only = 1): + """ + DEPRECATED: Use the object property. + Returns the name of the object to change to. + @type name_only: bool + @param name_only: optional argument, when 0 return a KX_GameObject + @rtype: string, KX_GameObject or None if no object is set + """ + +class KX_PhysicsObjectWrapper(PyObjectPlus): + """ + KX_PhysicsObjectWrapper + + """ + def setActive(active): + """ + Set the object to be active. + + @param active: set to True to be active + @type active: bool + """ + + def setAngularVelocity(x, y, z, local): + """ + Set the angular velocity of the object. + + @param x: angular velocity for the x-axis + @type x: float + + @param y: angular velocity for the y-axis + @type y: float + + @param z: angular velocity for the z-axis + @type z: float + + @param local: set to True for local axis + @type local: bool + """ + def setLinearVelocity(x, y, z, local): + """ + Set the linear velocity of the object. + + @param x: linear velocity for the x-axis + @type x: float + + @param y: linear velocity for the y-axis + @type y: float + + @param z: linear velocity for the z-axis + @type z: float + + @param local: set to True for local axis + @type local: bool + """ + def setPosition(x, y, z): + """ + Set the position of the object + + @param x: x coordinate + @type x: float + + @param y: y coordinate + @type y: float + + @param z: z coordinate + @type z: float + """ + +class KX_PolyProxy(SCA_IObject): + """ + A polygon holds the index of the vertex forming the poylgon. + + Note: + The polygon attributes are read-only, you need to retrieve the vertex proxy if you want + to change the vertex settings. + + @ivar matname: The name of polygon material, empty if no material. + @type matname: string + @ivar material: The material of the polygon + @type material: L{KX_PolygonMaterial} or KX_BlenderMaterial + @ivar texture: The texture name of the polygon. + @type texture: string + @ivar matid: The material index of the polygon, use this to retrieve vertex proxy from mesh proxy + @type matid: integer + @ivar v1: vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy + @type v1: integer + @ivar v2: vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy + @type v2: integer + @ivar v3: vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy + @type v3: integer + @ivar v4: vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex + use this to retrieve vertex proxy from mesh proxy + @type v4: integer + @ivar visible: visible state of the polygon: 1=visible, 0=invisible + @type visible: integer + @ivar collide: collide state of the polygon: 1=receives collision, 0=collision free. + @type collide: integer + """ + + def getMaterialName(): + """ + Returns the polygon material name with MA prefix + + @rtype: string + @return: material name + """ + def getMaterial(): + """ + Returns the polygon material + + @rtype: L{KX_PolygonMaterial} or KX_BlenderMaterial + """ + def getTextureName(): + """ + Returns the polygon texture name + + @rtype: string + @return: texture name + """ + def getMaterialIndex(): + """ + Returns the material bucket index of the polygon. + This index and the ones returned by getVertexIndex() are needed to retrieve the vertex proxy from L{KX_MeshProxy}. + + @rtype: integer + @return: the material index in the mesh + """ + def getNumVertex(): + """ + Returns the number of vertex of the polygon. + + @rtype: integer + @return: number of vertex, 3 or 4. + """ + def isVisible(): + """ + Returns whether the polygon is visible or not + + @rtype: integer + @return: 0=invisible, 1=visible + """ + def isCollider(): + """ + Returns whether the polygon is receives collision or not + + @rtype: integer + @return: 0=collision free, 1=receives collision + """ + def getVertexIndex(vertex): + """ + Returns the mesh vertex index of a polygon vertex + This index and the one returned by getMaterialIndex() are needed to retrieve the vertex proxy from L{KX_MeshProxy}. + + @type vertex: integer + @param vertex: index of the vertex in the polygon: 0->3 + @rtype: integer + @return: mesh vertex index + """ + def getMesh(): + """ + Returns a mesh proxy + + @rtype: L{KX_MeshProxy} + @return: mesh proxy + """ + +class KX_PolygonMaterial: + """ + This is the interface to materials in the game engine. + + Materials define the render state to be applied to mesh objects. + + Warning: Some of the methods/variables are CObjects. If you mix these up, + you will crash blender. + + This example requires: + - PyOpenGL http://pyopengl.sourceforge.net/ + - GLEWPy http://glewpy.sourceforge.net/ + Example:: + + import GameLogic + import OpenGL + from OpenGL.GL import * + from OpenGL.GLU import * + import glew + from glew import * + + glewInit() + + vertex_shader = \"\"\" + + void main(void) + { + gl_Position = ftransform(); + } + \"\"\" + + fragment_shader =\"\"\" + + void main(void) + { + gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); + } + \"\"\" + + class MyMaterial: + def __init__(self): + self.pass_no = 0 + # Create a shader + self.m_program = glCreateProgramObjectARB() + # Compile the vertex shader + self.shader(GL_VERTEX_SHADER_ARB, (vertex_shader)) + # Compile the fragment shader + self.shader(GL_FRAGMENT_SHADER_ARB, (fragment_shader)) + # Link the shaders together + self.link() + + def PrintInfoLog(self, tag, object): + \"\"\" + PrintInfoLog prints the GLSL compiler log + \"\"\" + print "Tag: def PrintGLError(self, tag = ""): + + def PrintGLError(self, tag = ""): + \"\"\" + Prints the current GL error status + \"\"\" + if len(tag): + print tag + err = glGetError() + if err != GL_NO_ERROR: + print "GL Error: %s\\n"%(gluErrorString(err)) + + def shader(self, type, shaders): + \"\"\" + shader compiles a GLSL shader and attaches it to the current + program. + + type should be either GL_VERTEX_SHADER_ARB or GL_FRAGMENT_SHADER_ARB + shaders should be a sequence of shader source to compile. + \"\"\" + # Create a shader object + shader_object = glCreateShaderObjectARB(type) + + # Add the source code + glShaderSourceARB(shader_object, len(shaders), shaders) + + # Compile the shader + glCompileShaderARB(shader_object) + + # Print the compiler log + self.PrintInfoLog("vertex shader", shader_object) + + # Check if compiled, and attach if it did + compiled = glGetObjectParameterivARB(shader_object, GL_OBJECT_COMPILE_STATUS_ARB) + if compiled: + glAttachObjectARB(self.m_program, shader_object) + + # Delete the object (glAttachObjectARB makes a copy) + glDeleteObjectARB(shader_object) + + # print the gl error log + self.PrintGLError() + + def link(self): + \"\"\" + Links the shaders together. + \"\"\" + # clear error indicator + glGetError() + + glLinkProgramARB(self.m_program) + + self.PrintInfoLog("link", self.m_program) + + linked = glGetObjectParameterivARB(self.m_program, GL_OBJECT_LINK_STATUS_ARB) + if not linked: + print "Shader failed to link" + return + + glValidateProgramARB(self.m_program) + valid = glGetObjectParameterivARB(self.m_program, GL_OBJECT_VALIDATE_STATUS_ARB) + if not valid: + print "Shader failed to validate" + return + + def activate(self, rasty, cachingInfo, mat): + self.pass_no+=1 + if (self.pass_no == 1): + glDisable(GL_COLOR_MATERIAL) + glUseProgramObjectARB(self.m_program) + return True + + glEnable(GL_COLOR_MATERIAL) + glUseProgramObjectARB(0) + self.pass_no = 0 + return False + + obj = GameLogic.getCurrentController().getOwner() + + mesh = obj.getMesh(0) + + for mat in mesh.materials: + mat.setCustomMaterial(MyMaterial()) + print mat.texture + + @ivar texture: Texture name + @type texture: string (read only) + + @ivar gl_texture: OpenGL texture handle (eg for glBindTexture(GL_TEXTURE_2D, gl_texture) + @type gl_texture: integer (read only) + + @ivar material: Material name + @type material: string (read only) + + @ivar tface: Texture face properties + @type tface: CObject (read only) + + @ivar tile: Texture is tiling + @type tile: boolean + @ivar tilexrep: Number of tile repetitions in x direction. + @type tilexrep: integer + @ivar tileyrep: Number of tile repetitions in y direction. + @type tileyrep: integer + + @ivar drawingmode: Drawing mode for the material. + - 2 (drawingmode & 4) Textured + - 4 (drawingmode & 16) Light + - 14 (drawingmode & 16384) 3d Polygon Text + @type drawingmode: bitfield + + @ivar transparent: This material is transparent. All meshes with this + material will be rendered after non transparent meshes from back + to front. + @type transparent: boolean + + @ivar zsort: Transparent polygons in meshes with this material will be sorted back to + front before rendering. + Non-Transparent polygons will be sorted front to back before rendering. + @type zsort: boolean + + @ivar lightlayer: Light layers this material affects. + @type lightlayer: bitfield. + + @ivar triangle: Mesh data with this material is triangles. It's probably not safe to change this. + @type triangle: boolean + + @ivar diffuse: The diffuse colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0] + @type diffuse: list [r, g, b] + @ivar specular: The specular colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0] + @type specular: list [r, g, b] + @ivar shininess: The shininess (specular exponent) of the material. 0.0 <= shininess <= 128.0 + @type shininess: float + @ivar specularity: The amount of specular of the material. 0.0 <= specularity <= 1.0 + @type specularity: float + """ + def updateTexture(tface, rasty): + """ + Updates a realtime animation. + + @param tface: Texture face (eg mat.tface) + @type tface: CObject + @param rasty: Rasterizer + @type rasty: CObject + """ + def setTexture(tface): + """ + Sets texture render state. + + Example:: + mat.setTexture(mat.tface) + + @param tface: Texture face + @type tface: CObject + """ + def activate(rasty, cachingInfo): + """ + Sets material parameters for this object for rendering. + + Material Parameters set: + 1. Texture + 2. Backface culling + 3. Line drawing + 4. Specular Colour + 5. Shininess + 6. Diffuse Colour + 7. Polygon Offset. + + @param rasty: Rasterizer instance. + @type rasty: CObject + @param cachingInfo: Material cache instance. + @type cachingInfo: CObject + """ + def setCustomMaterial(material): + """ + Sets the material state setup object. + + Using this method, you can extend or completely replace the gameengine material + to do your own advanced multipass effects. + + Use this method to register your material class. Instead of the normal material, + your class's activate method will be called just before rendering the mesh. + This should setup the texture, material, and any other state you would like. + It should return True to render the mesh, or False if you are finished. You should + clean up any state Blender does not set before returning False. + + Activate Method Definition:: + def activate(self, rasty, cachingInfo, material): + + Example:: + class PyMaterial: + def __init__(self): + self.pass_no = -1 + + def activate(self, rasty, cachingInfo, material): + # Activate the material here. + # + # The activate method will be called until it returns False. + # Every time the activate method returns True the mesh will + # be rendered. + # + # rasty is a CObject for passing to material.updateTexture() + # and material.activate() + # cachingInfo is a CObject for passing to material.activate() + # material is the KX_PolygonMaterial instance this material + # was added to + + # default material properties: + self.pass_no += 1 + if self.pass_no == 0: + material.activate(rasty, cachingInfo) + # Return True to do this pass + return True + + # clean up and return False to finish. + self.pass_no = -1 + return False + + # Create a new Python Material and pass it to the renderer. + mat.setCustomMaterial(PyMaterial()) + + @param material: The material object. + @type material: instance + """ + +class KX_RadarSensor(KX_NearSensor): + """ + Radar sensor is a near sensor with a conical sensor object. + + @ivar coneOrigin: The origin of the cone with which to test. The origin + is in the middle of the cone. + (Read only) + @type coneOrigin: list of floats [x, y, z] + @ivar coneTarget: The center of the bottom face of the cone with which to test. + (Read only) + @type coneTarget: list of floats [x, y, z] + @ivar distance: The height of the cone with which to test. + @type distance: float + @ivar angle: The angle of the cone (in degrees) with which to test. + @type angle: float from 0 to 360 + @ivar axis: The axis on which the radar cone is cast + @type axis: int from 0 to 5 + KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z, + KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z + """ + + + #--The following methods are deprecated, please use properties instead. + def getConeOrigin(): + """ + Returns the origin of the cone with which to test. The origin + is in the middle of the cone. + + @rtype: list [x, y, z] + """ + + def getConeTarget(): + """ + Returns the center of the bottom face of the cone with which to test. + + @rtype: list [x, y, z] + """ + + def getConeHeight(): + """ + Returns the height of the cone with which to test. + + @rtype: float + """ + +class KX_RaySensor(SCA_ISensor): + """ + A ray sensor detects the first object in a given direction. + + @ivar property: The property the ray is looking for. + @type property: string + @ivar range: The distance of the ray. + @type range: float + @ivar useMaterial: Whether or not to look for a material (false = property) + @type useMaterial: boolean + @ivar useXRay: Whether or not to use XRay. + @type useXRay: boolean + @ivar hitObject: The game object that was hit by the ray. (Read-only) + @type hitObject: KX_GameObject + @ivar hitPosition: The position (in worldcoordinates) where the object was hit by the ray. (Read-only) + @type hitPosition: list [x, y, z] + @ivar hitNormal: The normal (in worldcoordinates) of the object at the location where the object was hit by the ray. (Read-only) + @type hitNormal: list [x, y, z] + @ivar rayDirection: The direction from the ray (in worldcoordinates). (Read-only) + @type rayDirection: list [x, y, z] + @ivar axis: The axis the ray is pointing on. + @type axis: int from 0 to 5 + KX_RAY_AXIS_POS_X, KX_RAY_AXIS_POS_Y, KX_RAY_AXIS_POS_Z, + KX_RAY_AXIS_NEG_X, KX_RAY_AXIS_NEG_Y, KX_RAY_AXIS_NEG_Z + """ + + def getHitObject(): + """ + DEPRECATED: Use the hitObject property instead. + Returns the game object that was hit by this ray. + + @rtype: KX_GameObject + """ + def getHitPosition(): + """ + DEPRECATED: Use the hitPosition property instead. + Returns the position (in worldcoordinates) where the object was hit by this ray. + + @rtype: list [x, y, z] + """ + def getHitNormal(): + """ + DEPRECATED: Use the hitNormal property instead. + Returns the normal (in worldcoordinates) of the object at the location where the object was hit by this ray. + + @rtype: list [nx, ny, nz] + """ + def getRayDirection(): + """ + DEPRECATED: Use the rayDirection property instead. + Returns the direction from the ray (in worldcoordinates) + + @rtype: list [dx, dy, dz] + """ + +class KX_SCA_AddObjectActuator(SCA_IActuator): + """ + Edit Object Actuator (in Add Object Mode) + @ivar object: the object this actuator adds. + @type object: KX_GameObject or None + @ivar objectLastCreated: the last added object from this actuator (read only). + @type objectLastCreated: KX_GameObject or None + @ivar time: the lifetime of added objects, in frames. + @type time: integer + @ivar linearVelocity: the initial linear velocity of added objects. + @type linearVelocity: list [vx, vy, vz] + @ivar angularVelocity: the initial angular velocity of added objects. + @type angularVelocity: list [vx, vy, vz] + + @warning: An Add Object actuator will be ignored if at game start, the linked object doesn't exist + (or is empty) or the linked object is in an active layer. + + This will genereate a warning in the console: + + C{ERROR: GameObject I{OBName} has a AddObjectActuator I{ActuatorName} without object (in 'nonactive' layer)} + """ + def setObject(object): + """ + DEPRECATED: use the object property + Sets the game object to add. + + A copy of the object will be added to the scene when the actuator is activated. + + If the object does not exist, this function is ignored. + + object can either be a L{KX_GameObject} or the name of an object or None. + + @type object: L{KX_GameObject}, string or None + """ + def getObject(name_only = 0): + """ + DEPRECATED: use the object property + Returns the name of the game object to be added. + + Returns None if no game object has been assigned to be added. + @type name_only: bool + @param name_only: optional argument, when 0 return a KX_GameObject + @rtype: string, KX_GameObject or None if no object is set + """ + def setTime(time): + """ + DEPRECATED: use the time property + Sets the lifetime of added objects, in frames. + + If time == 0, the object will last forever. + + @type time: integer + @param time: The minimum value for time is 0. + """ + def getTime(): + """ + DEPRECATED: use the time property + Returns the lifetime of the added object, in frames. + + @rtype: integer + """ + def setLinearVelocity(vx, vy, vz): + """ + DEPRECATED: use the linearVelocity property + Sets the initial linear velocity of added objects. + + @type vx: float + @param vx: the x component of the initial linear velocity. + @type vy: float + @param vy: the y component of the initial linear velocity. + @type vz: float + @param vz: the z component of the initial linear velocity. + """ + def getLinearVelocity(): + """ + DEPRECATED: use the linearVelocity property + Returns the initial linear velocity of added objects. + + @rtype: list [vx, vy, vz] + """ + def setAngularVelocity(vx, vy, vz): + """ + DEPRECATED: use the angularVelocity property + Sets the initial angular velocity of added objects. + + @type vx: float + @param vx: the x component of the initial angular velocity. + @type vy: float + @param vy: the y component of the initial angular velocity. + @type vz: float + @param vz: the z component of the initial angular velocity. + """ + def getAngularVelocity(): + """ + DEPRECATED: use the angularVelocity property + Returns the initial angular velocity of added objects. + + @rtype: list [vx, vy, vz] + """ + def getLastCreatedObject(): + """ + DEPRECATED: use the objectLastCreated property + Returns the last object created by this actuator. + + @rtype: L{KX_GameObject} + @return: A L{KX_GameObject} or None if no object has been created. + """ + def instantAddObject(): + """ + Returns the last object created by this actuator. The object can then be accessed from L{objectLastCreated}. + + @rtype: None + """ + +class KX_SCA_DynamicActuator(SCA_IActuator): + """ + Dynamic Actuator. + @ivar operation: the type of operation of the actuator, 0-4 + KX_DYN_RESTORE_DYNAMICS, KX_DYN_DISABLE_DYNAMICS, + KX_DYN_ENABLE_RIGID_BODY, KX_DYN_DISABLE_RIGID_BODY, KX_DYN_SET_MASS + @type operation: integer + @ivar mass: the mass value for the KX_DYN_SET_MASS operation + @type mass: float + """ + def setOperation(operation): + """ + DEPRECATED: Use the operation property instead. + Set the type of operation when the actuator is activated: + - 0 = restore dynamics + - 1 = disable dynamics + - 2 = enable rigid body + - 3 = disable rigid body + - 4 = set mass + """ + def getOperation(): + """ + DEPRECATED: Use the operation property instead. + return the type of operation + """ + +class KX_SCA_EndObjectActuator(SCA_IActuator): + """ + Edit Object Actuator (in End Object mode) + + This actuator has no python methods. + """ + +class KX_SCA_ReplaceMeshActuator(SCA_IActuator): + """ + Edit Object actuator, in Replace Mesh mode. + + Example:: + # Level-of-detail + # Switch a game object's mesh based on its depth in the camera view. + # +----------+ +-----------+ +-------------------------------------+ + # | Always +-----+ Python +-----+ Edit Object (Replace Mesh) LOD.Mesh | + # +----------+ +-----------+ +-------------------------------------+ + import GameLogic + + # List detail meshes here + # Mesh (name, near, far) + # Meshes overlap so that they don't 'pop' when on the edge of the distance. + meshes = ((".Hi", 0.0, -20.0), + (".Med", -15.0, -50.0), + (".Lo", -40.0, -100.0) + ) + + co = GameLogic.getCurrentController() + obj = co.getOwner() + act = co.getActuator("LOD." + obj.name) + cam = GameLogic.getCurrentScene().active_camera + + def Depth(pos, plane): + return pos[0]*plane[0] + pos[1]*plane[1] + pos[2]*plane[2] + plane[3] + + # Depth is negative and decreasing further from the camera + depth = Depth(obj.position, cam.world_to_camera[2]) + + newmesh = None + curmesh = None + # Find the lowest detail mesh for depth + for mesh in meshes: + if depth < mesh[1] and depth > mesh[2]: + newmesh = mesh + if "ME" + obj.name + mesh[0] == act.getMesh(): + curmesh = mesh + + if newmesh != None and "ME" + obj.name + newmesh[0] != act.getMesh(): + # The mesh is a different mesh - switch it. + # Check the current mesh is not a better fit. + if curmesh == None or curmesh[1] < depth or curmesh[2] > depth: + act.setMesh(obj.getName() + newmesh[0]) + GameLogic.addActiveActuator(act, True) + + @warning: Replace mesh actuators will be ignored if at game start, the + named mesh doesn't exist. + + This will generate a warning in the console: + + C{ERROR: GameObject I{OBName} ReplaceMeshActuator I{ActuatorName} without object} + + @ivar mesh: L{KX_MeshProxy} or the name of the mesh that will replace the current one + Set to None to disable actuator + @type mesh: L{KX_MeshProxy} or None if no mesh is set + """ + def setMesh(name): + """ + DEPRECATED: Use the mesh property instead. + Sets the name of the mesh that will replace the current one. + When the name is None it will unset the mesh value so no action is taken. + + @type name: string or None + """ + def getMesh(): + """ + DEPRECATED: Use the mesh property instead. + Returns the name of the mesh that will replace the current one. + + Returns None if no mesh has been scheduled to be added. + + @rtype: string or None + """ + def instantReplaceMesh(): + """ + Immediately replace mesh without delay. + @rtype: None + """ + +class KX_Scene(PyObjectPlus): + """ + An active scene that gives access to objects, cameras, lights and scene attributes. + + The activity culling stuff is supposed to disable logic bricks when their owner gets too far + from the active camera. It was taken from some code lurking at the back of KX_Scene - who knows + what it does! + + Example:: + import GameLogic + + # get the scene + scene = GameLogic.getCurrentScene() + + # print all the objects in the scene + for obj in scene.objects: + print obj.name + + # get an object named 'Cube' + obj = scene.objects["OBCube"] + + # get the first object in the scene. + obj = scene.objects[0] + + Example:: + # Get the depth of an object in the camera view. + import GameLogic + + obj = GameLogic.getCurrentController().getOwner() + cam = GameLogic.getCurrentScene().active_camera + + # Depth is negative and decreasing further from the camera + depth = obj.position[0]*cam.world_to_camera[2][0] + obj.position[1]*cam.world_to_camera[2][1] + obj.position[2]*cam.world_to_camera[2][2] + cam.world_to_camera[2][3] + + @bug: All attributes are read only at the moment. + + @ivar name: The scene's name + @type name: string + @ivar objects: A list of objects in the scene. + @type objects: L{CListValue} of L{KX_GameObject} + @ivar objects_inactive: A list of objects on background layers (used for the addObject actuator). + @type objects_inactive: L{CListValue} of L{KX_GameObject} + @ivar lights: A list of lights in the scene. + @type lights: L{CListValue} of L{KX_LightObject} + @ivar cameras: A list of cameras in the scene. + @type cameras: L{CListValue} of L{KX_Camera} + @ivar active_camera: The current active camera + @type active_camera: L{KX_Camera} + @ivar suspended: True if the scene is suspended. + @type suspended: boolean + @ivar activity_culling: True if the scene is activity culling + @type activity_culling: boolean + @ivar activity_culling_radius: The distance outside which to do activity culling. Measured in manhattan distance. + @type activity_culling_radius: float + @group Deprecated: getLightList, getObjectList, getName + """ + + def getLightList(): + """ + DEPRECATED: use the 'lights' property. + Returns the list of lights in the scene. + + @rtype: list [L{KX_LightObject}] + """ + def getObjectList(): + """ + DEPRECATED: use the 'objects' property. + Returns the list of objects in the scene. + + @rtype: list [L{KX_GameObject}] + """ + def getName(): + """ + DEPRECATED: use the 'name' property. + Returns the name of the scene. + + @rtype: string + """ + + def addObject(object, other, time=0): + """ + Adds an object to the scene like the Add Object Actuator would, and returns the created object. + + @param object: The object to add + @type object: L{KX_GameObject} or string + @param other: The object's center to use when adding the object + @type other: L{KX_GameObject} or string + @param time: The lifetime of the added object, in frames. A time of 0 means the object will last forever. + @type time: int + + @rtype: L{KX_GameObject} + """ + +class KX_SceneActuator(SCA_IActuator): + """ + Scene Actuator logic brick. + + @warning: Scene actuators that use a scene name will be ignored if at game start, the + named scene doesn't exist or is empty + + This will generate a warning in the console: + + C{ERROR: GameObject I{OBName} has a SceneActuator I{ActuatorName} (SetScene) without scene} + + @ivar scene: the name of the scene to change to/overlay/underlay/remove/suspend/resume + @type scene: string. + @ivar camera: the camera to change to. + When setting the attribute, you can use either a L{KX_Camera} or the name of the camera. + @type camera: L{KX_Camera} on read, string or L{KX_Camera} on write + @ivar useRestart: Set flag to True to restart the sene + @type useRestart: bool + @ivar mode: The mode of the actuator + @type mode: int from 0 to 5 L{GameLogic.Scene Actuator} + """ + def setUseRestart(flag): + """ + DEPRECATED: use the useRestart property instead + Set flag to True to restart the scene. + + @type flag: boolean + """ + def setScene(scene): + """ + DEPRECATED: use the scene property instead + Sets the name of the scene to change to/overlay/underlay/remove/suspend/resume. + + @type scene: string + """ + def setCamera(camera): + """ + DEPRECATED: use the camera property instead + Sets the camera to change to. + + Camera can be either a L{KX_Camera} or the name of the camera. + + @type camera: L{KX_Camera} or string + """ + def getUseRestart(): + """ + DEPRECATED: use the useRestart property instead + Returns True if the scene will be restarted. + + @rtype: boolean + """ + def getScene(): + """ + DEPRECATED: use the scene property instead + Returns the name of the scene to change to/overlay/underlay/remove/suspend/resume. + + Returns an empty string ("") if no scene has been set. + + @rtype: string + """ + def getCamera(): + """ + DEPRECATED: use the camera property instead + Returns the name of the camera to change to. + + @rtype: string + """ + +class KX_SoundActuator(SCA_IActuator): + """ + Sound Actuator. + + The L{startSound()}, L{pauseSound()} and L{stopSound()} do not require + the actuator to be activated - they act instantly provided that the actuator has + been activated once at least. + + @ivar filename: Sets the filename of the sound this actuator plays. + @type filename: string + + @ivar volume: Sets the volume (gain) of the sound. + @type volume: float + + @ivar pitch: Sets the pitch of the sound. + @type pitch: float + + @ivar rollOffFactor: Sets the roll off factor. Rolloff defines the rate of attenuation as the sound gets further away. + @type rollOffFactor: float + + @ivar looping: Sets the loop mode of the actuator. + @type looping: integer + + @ivar position: Sets the position of the sound. + @type position: float array + + @ivar velocity: Sets the speed of the sound; The speed of the sound alter the pitch. + @type velocity: float array + + @ivar orientation: Sets the orientation of the sound. When setting the orientation you can + also use quaternion [float,float,float,float] or euler angles [float,float,float] + @type orientation: 3x3 matrix [[float]] + + @ivar type: Sets the operation mode of the actuator. You can use one of the following constant: + - KX_SOUNDACT_PLAYSTOP (1) + - KX_SOUNDACT_PLAYEND (2) + - KX_SOUNDACT_LOOPSTOP (3) + - KX_SOUNDACT_LOOPEND (4) + - KX_SOUNDACT_LOOPBIDIRECTIONAL (5) + - KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP (6) + @type type: integer + + @group Play Methods: startSound, pauseSound, stopSound + """ + def setFilename(filename): + """ + DEPRECATED: Use the filename property instead. + Sets the filename of the sound this actuator plays. + + @type filename: string + """ + def getFilename(): + """ + DEPRECATED: Use the filename property instead. + Returns the filename of the sound this actuator plays. + + @rtype: string + """ + def startSound(): + """ + Starts the sound. + """ + def pauseSound(): + """ + Pauses the sound. + """ + def stopSound(): + """ + Stops the sound. + """ + def setGain(gain): + """ + DEPRECATED: Use the volume property instead + Sets the gain (volume) of the sound + + @type gain: float + @param gain: 0.0 (quiet) <= gain <= 1.0 (loud) + """ + def getGain(): + """ + DEPRECATED: Use the volume property instead. + Gets the gain (volume) of the sound. + + @rtype: float + """ + def setPitch(pitch): + """ + DEPRECATED: Use the pitch property instead. + Sets the pitch of the sound. + + @type pitch: float + """ + def getPitch(): + """ + DEPRECATED: Use the pitch property instead. + Returns the pitch of the sound. + + @rtype: float + """ + def setRollOffFactor(rolloff): + """ + DEPRECATED: Use the rollOffFactor property instead. + Sets the rolloff factor for the sounds. + + Rolloff defines the rate of attenuation as the sound gets further away. + Higher rolloff factors shorten the distance at which the sound can be heard. + + @type rolloff: float + """ + def getRollOffFactor(): + """ + DEPRECATED: Use the rollOffFactor property instead. + Returns the rolloff factor for the sound. + + @rtype: float + """ + def setLooping(loop): + """ + DEPRECATED: Use the looping property instead. + Sets the loop mode of the actuator. + + @bug: There are no constants defined for this method! + @param loop: - Play Stop 1 + - Play End 2 + - Loop Stop 3 + - Loop End 4 + - Bidirection Stop 5 + - Bidirection End 6 + @type loop: integer + """ + def getLooping(): + """ + DEPRECATED: Use the looping property instead. + Returns the current loop mode of the actuator. + + @rtype: integer + """ + def setPosition(x, y, z): + """ + DEPRECATED: Use the position property instead. + Sets the position this sound will come from. + + @type x: float + @param x: The x coordinate of the sound. + @type y: float + @param y: The y coordinate of the sound. + @type z: float + @param z: The z coordinate of the sound. + """ + def setVelocity(vx, vy, vz): + """ + DEPRECATED: Use the velocity property instead. + Sets the velocity this sound is moving at. + + The sound's pitch is determined from the velocity. + + @type vx: float + @param vx: The vx coordinate of the sound. + @type vy: float + @param vy: The vy coordinate of the sound. + @type vz: float + @param vz: The vz coordinate of the sound. + """ + def setOrientation(o11, o12, o13, o21, o22, o23, o31, o32, o33): + """ + DEPRECATED: Use the orientation property instead. + Sets the orientation of the sound. + + The nine parameters specify a rotation matrix:: + | o11, o12, o13 | + | o21, o22, o23 | + | o31, o32, o33 | + """ + + def setType(mode): + """ + DEPRECATED: Use the type property instead. + Sets the operation mode of the actuator. + + @param mode: KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP + @type mode: integer + """ + + def getType(): + """ + DEPRECATED: Use the type property instead. + Returns the operation mode of the actuator. + + @rtype: integer + @return: KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP + """ + +class KX_StateActuator(SCA_IActuator): + """ + State actuator changes the state mask of parent object. + + Property: + + @ivar operation: type of bit operation to be applied on object state mask. + You can use one of the following constant: + - KX_STATE_OP_CPY (0) : Copy state mask + - KX_STATE_OP_SET (1) : Add bits to state mask + - KX_STATE_OP_CLR (2) : Substract bits to state mask + - KX_STATE_OP_NEG (3) : Invert bits to state mask + @type operation: integer + + @ivar mask: value that defines the bits that will be modified by the operation. + The bits that are 1 in the mask will be updated in the object state, + the bits that are 0 are will be left unmodified expect for the Copy operation + which copies the mask to the object state + @type mask: integer + """ + def setOperation(op): + """ + DEPRECATED: Use the operation property instead. + Set the type of bit operation to be applied on object state mask. + Use setMask() to specify the bits that will be modified. + + @param op: bit operation (0=Copy, 1=Add, 2=Substract, 3=Invert) + @type op: integer + """ + def setMask(mask): + """ + DEPRECATED: Use the mask property instead. + Set the value that defines the bits that will be modified by the operation. + The bits that are 1 in the value will be updated in the object state, + the bits that are 0 are will be left unmodified expect for the Copy operation + which copies the value to the object state. + + @param mask: bits that will be modified + @type mask: integer + """ + +class KX_TrackToActuator(SCA_IActuator): + """ + Edit Object actuator in Track To mode. + + @warning: Track To Actuators will be ignored if at game start, the + object to track to is invalid. + + This will generate a warning in the console: + + C{ERROR: GameObject I{OBName} no object in EditObjectActuator I{ActuatorName}} + + @ivar object: the object this actuator tracks. + @type object: KX_GameObject or None + @ivar time: the time in frames with which to delay the tracking motion + @type time: integer + @ivar use3D: the tracking motion to use 3D + @type use3D: boolean + + """ + def setObject(object): + """ + DEPRECATED: Use the object property. + Sets the object to track. + + @type object: L{KX_GameObject}, string or None + @param object: Either a reference to a game object or the name of the object to track. + """ + def getObject(name_only): + """ + DEPRECATED: Use the object property. + Returns the name of the object to track. + + @type name_only: bool + @param name_only: optional argument, when 0 return a KX_GameObject + @rtype: string, KX_GameObject or None if no object is set + """ + def setTime(time): + """ + DEPRECATED: Use the time property. + Sets the time in frames with which to delay the tracking motion. + + @type time: integer + """ + def getTime(): + """ + DEPRECATED: Use the time property. + Returns the time in frames with which the tracking motion is delayed. + + @rtype: integer + """ + def setUse3D(use3d): + """ + DEPRECATED: Use the use3D property. + Sets the tracking motion to use 3D. + + @type use3d: boolean + @param use3d: - True: allow the tracking motion to extend in the z-direction. + - False: lock the tracking motion to the x-y plane. + """ + def getUse3D(): + """ + DEPRECATED: Use the use3D property. + Returns True if the tracking motion will track in the z direction. + + @rtype: boolean + """ + +class KX_VehicleWrapper(PyObjectPlus): + """ + KX_VehicleWrapper + + TODO - description + """ + + def addWheel(wheel, attachPos, attachDir, axleDir, suspensionRestLength, wheelRadius, hasSteering): + + """ + Add a wheel to the vehicle + + @param wheel: The object to use as a wheel. + @type wheel: L{KX_GameObject} or a KX_GameObject name + @param attachPos: The position that this wheel will attach to. + @type attachPos: vector of 3 floats + @param attachDir: The direction this wheel points. + @type attachDir: vector of 3 floats + @param axleDir: The direction of this wheels axle. + @type axleDir: vector of 3 floats + @param suspensionRestLength: TODO - Description + @type suspensionRestLength: float + @param wheelRadius: The size of the wheel. + @type wheelRadius: float + """ + + def applyBraking(force, wheelIndex): + """ + Apply a braking force to the specified wheel + + @param force: the brake force + @type force: float + + @param wheelIndex: index of the wheel where the force needs to be applied + @type wheelIndex: integer + """ + def applyEngineForce(force, wheelIndex): + """ + Apply an engine force to the specified wheel + + @param force: the engine force + @type force: float + + @param wheelIndex: index of the wheel where the force needs to be applied + @type wheelIndex: integer + """ + def getConstraintId(): + """ + Get the constraint ID + + @rtype: integer + @return: the constraint id + """ + def getConstraintType(): + """ + Returns the constraint type. + + @rtype: integer + @return: constraint type + """ + def getNumWheels(): + """ + Returns the number of wheels. + + @rtype: integer + @return: the number of wheels for this vehicle + """ + def getWheelOrientationQuaternion(wheelIndex): + """ + Returns the wheel orientation as a quaternion. + + @param wheelIndex: the wheel index + @type wheelIndex: integer + + @rtype: TODO - type should be quat as per method name but from the code it looks like a matrix + @return: TODO Description + """ + def getWheelPosition(wheelIndex): + """ + Returns the position of the specified wheel + + @param wheelIndex: the wheel index + @type wheelIndex: integer + + @rtype: list[x, y, z] + @return: position vector + """ + def getWheelRotation(wheelIndex): + """ + Returns the rotation of the specified wheel + + @param wheelIndex: the wheel index + @type wheelIndex: integer + + @rtype: float + @return: the wheel rotation + """ + def setRollInfluence(rollInfluece, wheelIndex): + """ + Set the specified wheel's roll influence. + The higher the roll influence the more the vehicle will tend to roll over in corners. + + @param rollInfluece: the wheel roll influence + @type rollInfluece: float + + @param wheelIndex: the wheel index + @type wheelIndex: integer + """ + def setSteeringValue(steering, wheelIndex): + """ + Set the specified wheel's steering + + @param steering: the wheel steering + @type steering: float + + @param wheelIndex: the wheel index + @type wheelIndex: integer + """ + def setSuspensionCompression(compression, wheelIndex): + """ + Set the specified wheel's compression + + @param compression: the wheel compression + @type compression: float + + @param wheelIndex: the wheel index + @type wheelIndex: integer + """ + def setSuspensionDamping(damping, wheelIndex): + """ + Set the specified wheel's damping + + @param damping: the wheel damping + @type damping: float + + @param wheelIndex: the wheel index + @type wheelIndex: integer + """ + def setSuspensionStiffness(stiffness, wheelIndex): + """ + Set the specified wheel's stiffness + + @param stiffness: the wheel stiffness + @type stiffness: float + + @param wheelIndex: the wheel index + @type wheelIndex: integer + """ + def setTyreFriction(friction, wheelIndex): + """ + Set the specified wheel's tyre friction + + @param friction: the tyre friction + @type friction: float + + @param wheelIndex: the wheel index + @type wheelIndex: integer + """ + +class KX_VertexProxy(SCA_IObject): + """ + A vertex holds position, UV, colour and normal information. + + Note: + The physics simulation is NOT currently updated - physics will not respond + to changes in the vertex position. + + @ivar XYZ: The position of the vertex. + @type XYZ: list [x, y, z] + @ivar UV: The texture coordinates of the vertex. + @type UV: list [u, v] + @ivar normal: The normal of the vertex + @type normal: list [nx, ny, nz] + @ivar colour: The colour of the vertex. + Black = [0.0, 0.0, 0.0, 1.0], White = [1.0, 1.0, 1.0, 1.0] + @type colour: list [r, g, b, a] + @ivar color: Synonym for colour. + + @group Position: x, y, z + @ivar x: The x coordinate of the vertex. + @type x: float + @ivar y: The y coordinate of the vertex. + @type y: float + @ivar z: The z coordinate of the vertex. + @type z: float + + @group Texture Coordinates: u, v + @ivar u: The u texture coordinate of the vertex. + @type u: float + @ivar v: The v texture coordinate of the vertex. + @type v: float + + @ivar u2: The second u texture coordinate of the vertex. + @type u2: float + @ivar v2: The second v texture coordinate of the vertex. + @type v2: float + + @group Colour: r, g, b, a + @ivar r: The red component of the vertex colour. 0.0 <= r <= 1.0 + @type r: float + @ivar g: The green component of the vertex colour. 0.0 <= g <= 1.0 + @type g: float + @ivar b: The blue component of the vertex colour. 0.0 <= b <= 1.0 + @type b: float + @ivar a: The alpha component of the vertex colour. 0.0 <= a <= 1.0 + @type a: float + """ + + def getXYZ(): + """ + Gets the position of this vertex. + + @rtype: list [x, y, z] + @return: this vertexes position in local coordinates. + """ + def setXYZ(pos): + """ + Sets the position of this vertex. + + @type pos: list [x, y, z] + @param pos: the new position for this vertex in local coordinates. + """ + def getUV(): + """ + Gets the UV (texture) coordinates of this vertex. + + @rtype: list [u, v] + @return: this vertexes UV (texture) coordinates. + """ + def setUV(uv): + """ + Sets the UV (texture) coordinates of this vertex. + + @type uv: list [u, v] + """ + def getUV2(): + """ + Gets the 2nd UV (texture) coordinates of this vertex. + + @rtype: list [u, v] + @return: this vertexes UV (texture) coordinates. + """ + def setUV2(uv, unit): + """ + Sets the 2nd UV (texture) coordinates of this vertex. + + @type uv: list [u, v] + @param unit: optional argument, FLAT==1, SECOND_UV==2, defaults to SECOND_UV + @param unit: int + """ + def getRGBA(): + """ + Gets the colour of this vertex. + + The colour is represented as four bytes packed into an integer value. The colour is + packed as RGBA. + + Since Python offers no way to get each byte without shifting, you must use the struct module to + access colour in an machine independent way. + + Because of this, it is suggested you use the r, g, b and a attributes or the colour attribute instead. + + Example:: + import struct; + col = struct.unpack('4B', struct.pack('I', v.getRGBA())) + # col = (r, g, b, a) + # black = ( 0, 0, 0, 255) + # white = (255, 255, 255, 255) + + @rtype: integer + @return: packed colour. 4 byte integer with one byte per colour channel in RGBA format. + """ + def setRGBA(col): + """ + Sets the colour of this vertex. + + See getRGBA() for the format of col, and its relevant problems. Use the r, g, b and a attributes + or the colour attribute instead. + + setRGBA() also accepts a four component list as argument col. The list represents the colour as [r, g, b, a] + with black = [0.0, 0.0, 0.0, 1.0] and white = [1.0, 1.0, 1.0, 1.0] + + Example:: + v.setRGBA(0xff0000ff) # Red + v.setRGBA(0xff00ff00) # Green on little endian, transparent purple on big endian + v.setRGBA([1.0, 0.0, 0.0, 1.0]) # Red + v.setRGBA([0.0, 1.0, 0.0, 1.0]) # Green on all platforms. + + @type col: integer or list [r, g, b, a] + @param col: the new colour of this vertex in packed RGBA format. + """ + def getNormal(): + """ + Gets the normal vector of this vertex. + + @rtype: list [nx, ny, nz] + @return: normalised normal vector. + """ + def setNormal(normal): + """ + Sets the normal vector of this vertex. + + @type normal: sequence of floats [r, g, b] + @param normal: the new normal of this vertex. + """ + +class KX_VisibilityActuator(SCA_IActuator): + """ + Visibility Actuator. + @ivar visibility: whether the actuator makes its parent object visible or invisible + @type visibility: boolean + @ivar occlusion: whether the actuator makes its parent object an occluder or not + @type occlusion: boolean + @ivar recursion: whether the visibility/occlusion should be propagated to all children of the object + @type recursion: boolean + """ + def set(visible): + """ + DEPRECATED: Use the visibility property instead. + Sets whether the actuator makes its parent object visible or invisible. + + @param visible: - True: Makes its parent visible. + - False: Makes its parent invisible. + """ +# +# Documentation for PyObjectPlus base class + +class SCA_2DFilterActuator(SCA_IActuator): + """ + Create, enable and disable 2D filters + + Properties: + + The following properties don't have an immediate effect. + You must active the actuator to get the result. + The actuator is not persistent: it automatically stops itself after setting up the filter + but the filter remains active. To stop a filter you must activate the actuator with 'type' + set to RAS_2DFILTER_DISABLED or RAS_2DFILTER_NOFILTER. + + @ivar shaderText: shader source code for custom shader + @type shaderText: string + @ivar disableMotionBlur: action on motion blur: 0=enable, 1=disable + @type disableMotionBlur: integer + @ivar type: type of 2D filter, use one of the following constants: + RAS_2DFILTER_ENABLED (-2) : enable the filter that was previously disabled + RAS_2DFILTER_DISABLED (-1) : disable the filter that is currently active + RAS_2DFILTER_NOFILTER (0) : disable and destroy the filter that is currently active + RAS_2DFILTER_MOTIONBLUR (1) : create and enable preset filters + RAS_2DFILTER_BLUR (2) + RAS_2DFILTER_SHARPEN (3) + RAS_2DFILTER_DILATION (4) + RAS_2DFILTER_EROSION (5) + RAS_2DFILTER_LAPLACIAN (6) + RAS_2DFILTER_SOBEL (7) + RAS_2DFILTER_PREWITT (8) + RAS_2DFILTER_GRAYSCALE (9) + RAS_2DFILTER_SEPIA (10) + RAS_2DFILTER_INVERT (11) + RAS_2DFILTER_CUSTOMFILTER (12) : customer filter, the code code is set via shaderText property + @type type: integer + @ivar passNb: order number of filter in the stack of 2D filters. Filters are executed in increasing order of passNb. + Only be one filter can be defined per passNb. + @type passNb: integer (0-100) + @ivar value: argument for motion blur filter + @type value: float (0.0-100.0) + """ + +class SCA_ANDController(SCA_IController): + """ + An AND controller activates only when all linked sensors are activated. + + There are no special python methods for this controller. + """ + +class SCA_ActuatorSensor(SCA_ISensor): + """ + Actuator sensor detect change in actuator state of the parent object. + It generates a positive pulse if the corresponding actuator is activated + and a negative pulse if the actuator is deactivated. + + Properties: + + @ivar actuator: the name of the actuator that the sensor is monitoring. + @type actuator: string + """ + def getActuator(): + """ + DEPRECATED: use the actuator property + Return the Actuator with which the sensor operates. + + @rtype: string + """ + def setActuator(name): + """ + DEPRECATED: use the actuator property + Sets the Actuator with which to operate. If there is no Actuator + of this name, the function has no effect. + + @param name: actuator name + @type name: string + """ + +class SCA_AlwaysSensor(SCA_ISensor): + """ + This sensor is always activated. + """ + +class SCA_DelaySensor(SCA_ISensor): + """ + The Delay sensor generates positive and negative triggers at precise time, + expressed in number of frames. The delay parameter defines the length + of the initial OFF period. A positive trigger is generated at the end of this period. + The duration parameter defines the length of the ON period following the OFF period. + There is a negative trigger at the end of the ON period. If duration is 0, the sensor + stays ON and there is no negative trigger. + The sensor runs the OFF-ON cycle once unless the repeat option is set: the + OFF-ON cycle repeats indefinately (or the OFF cycle if duration is 0). + Use SCA_ISensor::reset() at any time to restart sensor. + + Properties: + + @ivar delay: length of the initial OFF period as number of frame, 0 for immediate trigger. + @type delay: integer. + @ivar duration: length of the ON period in number of frame after the initial OFF period. + If duration is greater than 0, a negative trigger is sent at the end of the ON pulse. + @type duration: integer + @ivar repeat: 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once. + @type repeat: integer + """ + def setDelay(delay): + """ + DEPRECATED: use the delay property + Set the initial delay before the positive trigger. + + @param delay: length of the initial OFF period as number of frame, 0 for immediate trigger + @type delay: integer + """ + def setDuration(duration): + """ + DEPRECATED: use the duration property + Set the duration of the ON pulse after initial delay and the generation of the positive trigger. + If duration is greater than 0, a negative trigger is sent at the end of the ON pulse. + + @param duration: length of the ON period in number of frame after the initial OFF period + @type duration: integer + """ + def setRepeat(repeat): + """ + DEPRECATED: use the repeat property + Set if the sensor repeat mode. + + @param repeat: 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once. + @type repeat: integer + """ + def getDelay(): + """ + DEPRECATED: use the delay property + Return the delay parameter value. + + @rtype: integer + """ + def getDuration(): + """ + DEPRECATED: use the duration property + Return the duration parameter value + + @rtype: integer + """ + def getRepeat(): + """ + DEPRECATED: use the repeat property + Return the repeat parameter value + + @rtype: KX_TRUE or KX_FALSE + """ + +class SCA_JoystickSensor(SCA_ISensor): + """ + This sensor detects player joystick events. + + Properties: + + @ivar axisValues: (read-only) The state of the joysticks axis as a list of values L{numAxis} long. + each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing. + The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls. + left:[-32767, 0, ...], right:[32767, 0, ...], up:[0, -32767, ...], down:[0, 32767, ...] + @type axisValues: list of ints + + @ivar axisSingle: (read-only) like L{axisValues} but returns a single axis value that is set by the sensor. + Only use this for "Single Axis" type sensors otherwise it will raise an error. + @type axisSingle: int + + @ivar numAxis: (read-only) The number of axes for the joystick at this index. + @type numAxis: integer + @ivar numButtons: (read-only) The number of buttons for the joystick at this index. + @type numButtons: integer + @ivar numHats: (read-only) The number of hats for the joystick at this index. + @type numHats: integer + @ivar connected: (read-only) True if a joystick is connected at this joysticks index. + @type connected: boolean + @ivar index: The joystick index to use (from 0 to 7). The first joystick is always 0. + @type index: integer + @ivar threshold: Axis threshold. Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive. + @type threshold: integer + @ivar button: The button index the sensor reacts to (first button = 0). When the "All Events" toggle is set, this option has no effect. + @type button: integer + @ivar axis: The axis this sensor reacts to, as a list of two values [axisIndex, axisDirection] + axisIndex: the axis index to use when detecting axis movement, 1=primary directional control, 2=secondary directional control. + axisDirection: 0=right, 1=up, 2=left, 3=down + @type axis: [integer, integer] + @ivar hat: The hat the sensor reacts to, as a list of two values: [hatIndex, hatDirection] + hatIndex: the hat index to use when detecting hat movement, 1=primary hat, 2=secondary hat. + hatDirection: 0-11 + @type hat: [integer, integer] + """ + + def getButtonActiveList(): + """ + Returns a list containing the indicies of the currently pressed buttons. + @rtype: list + """ + def getButtonStatus(buttonIndex): + """ + Returns a bool of the current pressed state of the specified button. + @param buttonIndex: the button index, 0=first button + @type buttonIndex: integer + @rtype: bool + """ + def getIndex(): + """ + DEPRECATED: use the 'index' property. + Returns the joystick index to use (from 1 to 8). + @rtype: integer + """ + def setIndex(index): + """ + DEPRECATED: use the 'index' property. + Sets the joystick index to use. + @param index: The index of this joystick sensor, Clamped between 1 and 8. + @type index: integer + @note: This is only useful when you have more then 1 joystick connected to your computer - multiplayer games. + """ + def getAxis(): + """ + DEPRECATED: use the 'axis' property. + Returns the current axis this sensor reacts to. See L{getAxisValue()} for the current axis state. + @rtype: list + @return: 2 values returned are [axisIndex, axisDirection] - see L{setAxis()} for their purpose. + @note: When the "All Events" toggle is set, this option has no effect. + """ + def setAxis(axisIndex, axisDirection): + """ + DEPRECATED: use the 'axis' property. + @param axisIndex: Set the axis index to use when detecting axis movement. + @type axisIndex: integer from 1 to 2 + @param axisDirection: Set the axis direction used for detecting motion. 0:right, 1:up, 2:left, 3:down. + @type axisDirection: integer from 0 to 3 + @note: When the "All Events" toggle is set, this option has no effect. + """ + def getAxisValue(): + """ + DEPRECATED: use the 'axisPosition' property. + Returns the state of the joysticks axis. See differs to L{getAxis()} returning the current state of the joystick. + @rtype: list + @return: 4 values, each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing. + + The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls. + + left:[-32767, 0, ...], right:[32767, 0, ...], up:[0, -32767, ...], down:[0, 32767, ...] + @note: Some gamepads only set the axis on and off like a button. + """ + def getThreshold(): + """ + DEPRECATED: use the 'threshold' property. + Get the axis threshold. See L{setThreshold()} for details. + @rtype: integer + """ + def setThreshold(threshold): + """ + DEPRECATED: use the 'threshold' property. + Set the axis threshold. + @param threshold: Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive. + @type threshold: integer + """ + def getButton(): + """ + DEPRECATED: use the 'button' property. + Returns the button index the sensor reacts to. See L{getButtonValue()} for a list of pressed buttons. + @rtype: integer + @note: When the "All Events" toggle is set, this option has no effect. + """ + def setButton(index): + """ + DEPRECATED: use the 'button' property. + Sets the button index the sensor reacts to when the "All Events" option is not set. + @note: When the "All Events" toggle is set, this option has no effect. + """ + def getButtonValue(): + """ + DEPRECATED: use the 'getButtonActiveList' method. + Returns a list containing the indicies of the currently pressed buttons. + @rtype: list + """ + def getHat(): + """ + DEPRECATED: use the 'hat' property. + Returns the current hat direction this sensor is set to. + [hatNumber, hatDirection]. + @rtype: list + @note: When the "All Events" toggle is set, this option has no effect. + """ + def setHat(index,direction): + """ + DEPRECATED: use the 'hat' property. + Sets the hat index the sensor reacts to when the "All Events" option is not set. + @type index: integer + """ + def getNumAxes(): + """ + DEPRECATED: use the 'numAxis' property. + Returns the number of axes for the joystick at this index. + @rtype: integer + """ + def getNumButtons(): + """ + DEPRECATED: use the 'numButtons' property. + Returns the number of buttons for the joystick at this index. + @rtype: integer + """ + def getNumHats(): + """ + DEPRECATED: use the 'numHats' property. + Returns the number of hats for the joystick at this index. + @rtype: integer + """ + def isConnected(): + """ + DEPRECATED: use the 'connected' property. + Returns True if a joystick is detected at this joysticks index. + @rtype: bool + """ + +class SCA_KeyboardSensor(SCA_ISensor): + """ + A keyboard sensor detects player key presses. + + See module L{GameKeys} for keycode values. + + @ivar key: The key code this sensor is looking for. + @type key: keycode from L{GameKeys} module + @ivar hold1: The key code for the first modifier this sensor is looking for. + @type hold1: keycode from L{GameKeys} module + @ivar hold2: The key code for the second modifier this sensor is looking for. + @type hold2: keycode from L{GameKeys} module + @ivar toggleProperty: The name of the property that indicates whether or not to log keystrokes as a string. + @type toggleProperty: string + @ivar targetProperty: The name of the property that receives keystrokes in case in case a string is logged. + @type targetProperty: string + @ivar useAllKeys: Flag to determine whether or not to accept all keys. + @type useAllKeys: boolean + @ivar events: a list of pressed keys that have either been pressed, or just released, or are active this frame. (read only). + + - 'keycode' matches the values in L{GameKeys}. + - 'status' uses... + - L{GameLogic.KX_INPUT_NONE} + - L{GameLogic.KX_INPUT_JUST_ACTIVATED} + - L{GameLogic.KX_INPUT_ACTIVE} + - L{GameLogic.KX_INPUT_JUST_RELEASED} + + @type events: list [[keycode, status], ...] + """ + + def getKeyStatus(keycode): + """ + Get the status of a key. + + @rtype: key state L{GameLogic} members (KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED) + @return: The state of the given key + @type keycode: integer + @param keycode: The code that represents the key you want to get the state of + """ + + #--The following methods are DEPRECATED-- + def getKey(): + """ + Returns the key code this sensor is looking for. + + B{DEPRECATED: Use the "key" property instead}. + + @rtype: keycode from L{GameKeys} module + """ + + def setKey(keycode): + """ + Set the key this sensor should listen for. + + B{DEPRECATED: Use the "key" property instead}. + + @type keycode: keycode from L{GameKeys} module + """ + + def getHold1(): + """ + Returns the key code for the first modifier this sensor is looking for. + + B{DEPRECATED: Use the "hold1" property instead}. + + @rtype: keycode from L{GameKeys} module + """ + + def setHold1(keycode): + """ + Sets the key code for the first modifier this sensor should look for. + + B{DEPRECATED: Use the "hold1" property instead}. + + @type keycode: keycode from L{GameKeys} module + """ + + def getHold2(): + """ + Returns the key code for the second modifier this sensor is looking for. + + B{DEPRECATED: Use the "hold2" property instead}. + + @rtype: keycode from L{GameKeys} module + """ + + def setHold2(keycode): + """ + Sets the key code for the second modifier this sensor should look for. + + B{DEPRECATED: Use the "hold2" property instead.} + + @type keycode: keycode from L{GameKeys} module + """ + + def getPressedKeys(): + """ + Get a list of keys that have either been pressed, or just released this frame. + + B{DEPRECATED: Use "events" instead.} + + @rtype: list of key status. [[keycode, status]] + """ + + def getCurrentlyPressedKeys(): + """ + Get a list of currently pressed keys that have either been pressed, or just released + + B{DEPRECATED: Use "events" instead.} + + @rtype: list of key status. [[keycode, status]] + """ + +class SCA_NANDController(SCA_IController): + """ + An NAND controller activates when all linked sensors are not active. + + There are no special python methods for this controller. + """ + +class SCA_NORController(SCA_IController): + """ + An NOR controller activates only when all linked sensors are de-activated. + + There are no special python methods for this controller. + """ + +class SCA_ORController(SCA_IController): + """ + An OR controller activates when any connected sensor activates. + + There are no special python methods for this controller. + """ + +class SCA_PropertyActuator(SCA_IActuator): + """ + Property Actuator + + Properties: + + @ivar property: the property on which to operate. + @type property: string + @ivar value: the value with which the actuator operates. + @type value: string + """ + def setProperty(prop): + """ + DEPRECATED: use the 'property' property + Set the property on which to operate. + + If there is no property of this name, the call is ignored. + + @type prop: string + @param prop: The name of the property to set. + """ + def getProperty(): + """ + DEPRECATED: use the 'property' property + Returns the name of the property on which to operate. + + @rtype: string + """ + def setValue(value): + """ + DEPRECATED: use the 'value' property + Set the value with which the actuator operates. + + If the value is not compatible with the type of the + property, the subsequent action is ignored. + + @type value: string + """ + def getValue(): + """ + DEPRECATED: use the 'value' property + Gets the value with which this actuator operates. + + @rtype: string + """ + +class SCA_PropertySensor(SCA_ISensor): + """ + Activates when the game object property matches. + + Properties: + + @ivar type: type of check on the property: + KX_PROPSENSOR_EQUAL(1), KX_PROPSENSOR_NOTEQUAL(2), KX_PROPSENSOR_INTERVAL(3), + KX_PROPSENSOR_CHANGED(4), KX_PROPSENSOR_EXPRESSION(5) + @type type: integer + @ivar property: the property with which the sensor operates. + @type property: string + @ivar value: the value with which the sensor compares to the value of the property. + @type value: string + """ + + def getType(): + """ + DEPRECATED: use the type property + Gets when to activate this sensor. + + @return: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL, + KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED, + or KX_PROPSENSOR_EXPRESSION. + """ + + def setType(checktype): + """ + DEPRECATED: use the type property + Set the type of check to perform. + + @type checktype: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL, + KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED, + or KX_PROPSENSOR_EXPRESSION. + """ + + def getProperty(): + """ + DEPRECATED: use the property property + Return the property with which the sensor operates. + + @rtype: string + @return: the name of the property this sensor is watching. + """ + def setProperty(name): + """ + DEPRECATED: use the property property + Sets the property with which to operate. If there is no property + of that name, this call is ignored. + + @type name: string. + """ + def getValue(): + """ + DEPRECATED: use the value property + Return the value with which the sensor compares to the value of the property. + + @rtype: string + @return: the value of the property this sensor is watching. + """ + def setValue(value): + """ + DEPRECATED: use the value property + Set the value with which the sensor operates. If the value + is not compatible with the type of the property, the subsequent + action is ignored. + + @type value: string + """ + +class SCA_PythonController(SCA_IController): + """ + A Python controller uses a Python script to activate it's actuators, + based on it's sensors. + + Properties: + + @ivar script: the Python script this controller executes + @type script: string, read-only + + @group Deprecated: getScript, setScript + """ + def activate(actuator): + """ + Activates an actuator attached to this controller. + @type actuator: actuator or the actuator name as a string + """ + def deactivate(actuator): + """ + Deactivates an actuator attached to this controller. + @type actuator: actuator or the actuator name as a string + """ + def getScript(): + """ + DEPRECATED: use the script property + Gets the Python script this controller executes. + + @rtype: string + """ + def setScript(script): + """ + DEPRECATED: use the script property + Sets the Python script this controller executes. + + @type script: string. + """ + +class SCA_RandomActuator(SCA_IActuator): + """ + Random Actuator + + Properties: + + @ivar seed: Seed of the random number generator. + Equal seeds produce equal series. If the seed is 0, + the generator will produce the same value on every call. + @type seed: integer + @ivar para1: the first parameter of the active distribution. + Refer to the documentation of the generator types for the meaning + of this value. + @type para1: float, read-only + @ivar para2: the second parameter of the active distribution. + Refer to the documentation of the generator types for the meaning + of this value. + @type para2: float, read-only + @ivar distribution: distribution type: + KX_RANDOMACT_BOOL_CONST, KX_RANDOMACT_BOOL_UNIFORM, KX_RANDOMACT_BOOL_BERNOUILLI, + KX_RANDOMACT_INT_CONST, KX_RANDOMACT_INT_UNIFORM, KX_RANDOMACT_INT_POISSON, + KX_RANDOMACT_FLOAT_CONST, KX_RANDOMACT_FLOAT_UNIFORM, KX_RANDOMACT_FLOAT_NORMAL, + KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL + @type distribution: integer, read-only + @ivar property: the name of the property to set with the random value. + If the generator and property types do not match, the assignment is ignored. + @type property: string + + """ + def setSeed(seed): + """ + DEPRECATED: use the seed property + Sets the seed of the random number generator. + + Equal seeds produce equal series. If the seed is 0, + the generator will produce the same value on every call. + + @type seed: integer + """ + def getSeed(): + """ + DEPRECATED: use the seed property + Returns the initial seed of the generator. + + @rtype: integer + """ + def getPara1(): + """ + DEPRECATED: use the para1 property + Returns the first parameter of the active distribution. + + Refer to the documentation of the generator types for the meaning + of this value. + + @rtype: float + """ + def getPara2(): + """ + DEPRECATED: use the para2 property + Returns the second parameter of the active distribution. + + Refer to the documentation of the generator types for the meaning + of this value. + + @rtype: float + """ + def getDistribution(): + """ + DEPRECATED: use the distribution property + Returns the type of random distribution. + + @rtype: distribution type + @return: KX_RANDOMACT_BOOL_CONST, KX_RANDOMACT_BOOL_UNIFORM, KX_RANDOMACT_BOOL_BERNOUILLI, + KX_RANDOMACT_INT_CONST, KX_RANDOMACT_INT_UNIFORM, KX_RANDOMACT_INT_POISSON, + KX_RANDOMACT_FLOAT_CONST, KX_RANDOMACT_FLOAT_UNIFORM, KX_RANDOMACT_FLOAT_NORMAL, + KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL + """ + def setProperty(property): + """ + DEPRECATED: use the property property + Set the property to which the random value is assigned. + + If the generator and property types do not match, the assignment is ignored. + + @type property: string + @param property: The name of the property to set. + """ + def getProperty(): + """ + DEPRECATED: use the property property + Returns the name of the property to set. + + @rtype: string + """ + def setBoolConst(value): + """ + Sets this generator to produce a constant boolean value. + + @param value: The value to return. + @type value: boolean + """ + def setBoolUniform(): + """ + Sets this generator to produce a uniform boolean distribution. + + The generator will generate True or False with 50% chance. + """ + def setBoolBernouilli(value): + """ + Sets this generator to produce a Bernouilli distribution. + + @param value: Specifies the proportion of False values to produce. + - 0.0: Always generate True + - 1.0: Always generate False + @type value: float + """ + def setIntConst(value): + """ + Sets this generator to always produce the given value. + + @param value: the value this generator produces. + @type value: integer + """ + def setIntUniform(lower_bound, upper_bound): + """ + Sets this generator to produce a random value between the given lower and + upper bounds (inclusive). + + @type lower_bound: integer + @type upper_bound: integer + """ + def setIntPoisson(value): + """ + Generate a Poisson-distributed number. + + This performs a series of Bernouilli tests with parameter value. + It returns the number of tries needed to achieve succes. + + @type value: float + """ + def setFloatConst(value): + """ + Always generate the given value. + + @type value: float + """ + def setFloatUniform(lower_bound, upper_bound): + """ + Generates a random float between lower_bound and upper_bound with a + uniform distribution. + + @type lower_bound: float + @type upper_bound: float + """ + def setFloatNormal(mean, standard_deviation): + """ + Generates a random float from the given normal distribution. + + @type mean: float + @param mean: The mean (average) value of the generated numbers + @type standard_deviation: float + @param standard_deviation: The standard deviation of the generated numbers. + """ + def setFloatNegativeExponential(half_life): + """ + Generate negative-exponentially distributed numbers. + + The half-life 'time' is characterized by half_life. + + @type half_life: float + """ + +class SCA_RandomSensor(SCA_ISensor): + """ + This sensor activates randomly. + + @ivar lastDraw: The seed of the random number generator. + @type lastDraw: int + @ivar seed: The seed of the random number generator. + @type seed: int + """ + + def setSeed(seed): + """ + Sets the seed of the random number generator. + + If the seed is 0, the generator will produce the same value on every call. + + @type seed: integer. + """ + def getSeed(): + """ + Returns the initial seed of the generator. Equal seeds produce equal random + series. + + @rtype: integer + """ + def getLastDraw(): + """ + Returns the last random number generated. + + @rtype: integer + """ + +class SCA_XNORController(SCA_IController): + """ + An XNOR controller activates when all linked sensors are the same (activated or inative). + + There are no special python methods for this controller. + """ + +class SCA_XORController(SCA_IController): + """ + An XOR controller activates when there is the input is mixed, but not when all are on or off. + + There are no special python methods for this controller. + """ + +class KX_Camera(KX_GameObject): + """ + A Camera object. + + @group Constants: INSIDE, INTERSECT, OUTSIDE + @ivar INSIDE: see sphereInsideFrustum() and boxInsideFrustum() + @ivar INTERSECT: see sphereInsideFrustum() and boxInsideFrustum() + @ivar OUTSIDE: see sphereInsideFrustum() and boxInsideFrustum() + + @ivar lens: The camera's lens value. + @type lens: float + @ivar near: The camera's near clip distance. + @type near: float + @ivar far: The camera's far clip distance. + @type far: float + @ivar perspective: True if this camera has a perspective transform. + + If perspective is False, this camera has an orthographic transform. + + Note that the orthographic transform is faked by multiplying the lens attribute + by 100.0 and translating the camera 100.0 along the z axis. + + This is the same as Blender. If you want a true orthographic transform, see L{setProjectionMatrix}. + @type perspective: boolean + @ivar frustum_culling: True if this camera is frustum culling. + @type frustum_culling: boolean + @ivar projection_matrix: This camera's 4x4 projection matrix. + @type projection_matrix: 4x4 Matrix [[float]] + @ivar modelview_matrix: This camera's 4x4 model view matrix. (read only) + Regenerated every frame from the camera's position and orientation. + @type modelview_matrix: 4x4 Matrix [[float]] + @ivar camera_to_world: This camera's camera to world transform. (read only) + Regenerated every frame from the camera's position and orientation. + @type camera_to_world: 4x4 Matrix [[float]] + @ivar world_to_camera: This camera's world to camera transform. (read only) + Regenerated every frame from the camera's position and orientation. + This is camera_to_world inverted. + @type world_to_camera: 4x4 Matrix [[float]] + + @group Deprecated: enableViewport + """ + + def sphereInsideFrustum(centre, radius): + """ + Tests the given sphere against the view frustum. + + @param centre: The centre of the sphere (in world coordinates.) + @type centre: list [x, y, z] + @param radius: the radius of the sphere + @type radius: float + @return: INSIDE, OUTSIDE or INTERSECT + + Example:: + import GameLogic + co = GameLogic.getCurrentController() + cam = co.GetOwner() + + # A sphere of radius 4.0 located at [x, y, z] = [1.0, 1.0, 1.0] + if (cam.sphereInsideFrustum([1.0, 1.0, 1.0], 4) != cam.OUTSIDE): + # Sphere is inside frustum ! + # Do something useful ! + else: + # Sphere is outside frustum + """ + def boxInsideFrustum(box): + """ + Tests the given box against the view frustum. + + Example:: + import GameLogic + co = GameLogic.getCurrentController() + cam = co.GetOwner() + + # Box to test... + box = [] + box.append([-1.0, -1.0, -1.0]) + box.append([-1.0, -1.0, 1.0]) + box.append([-1.0, 1.0, -1.0]) + box.append([-1.0, 1.0, 1.0]) + box.append([ 1.0, -1.0, -1.0]) + box.append([ 1.0, -1.0, 1.0]) + box.append([ 1.0, 1.0, -1.0]) + box.append([ 1.0, 1.0, 1.0]) + + if (cam.boxInsideFrustum(box) != cam.OUTSIDE): + # Box is inside/intersects frustum ! + # Do something useful ! + else: + # Box is outside the frustum ! + + @return: INSIDE, OUTSIDE or INTERSECT + @type box: list + @param box: Eight (8) corner points of the box (in world coordinates.) + """ + def pointInsideFrustum(point): + """ + Tests the given point against the view frustum. + + Example:: + import GameLogic + co = GameLogic.getCurrentController() + cam = co.GetOwner() + + # Test point [0.0, 0.0, 0.0] + if (cam.pointInsideFrustum([0.0, 0.0, 0.0])): + # Point is inside frustum ! + # Do something useful ! + else: + # Box is outside the frustum ! + + @rtype: boolean + @return: True if the given point is inside this camera's viewing frustum. + @type point: [x, y, z] + @param point: The point to test (in world coordinates.) + """ + def getCameraToWorld(): + """ + Returns the camera-to-world transform. + + @rtype: matrix (4x4 list) + @return: the camera-to-world transform matrix. + """ + def getWorldToCamera(): + """ + Returns the world-to-camera transform. + + This returns the inverse matrix of getCameraToWorld(). + + @rtype: matrix (4x4 list) + @return: the world-to-camera transform matrix. + """ + def getProjectionMatrix(): + """ + Returns the camera's projection matrix. + + @rtype: matrix (4x4 list) + @return: the camera's projection matrix. + """ + def setProjectionMatrix(matrix): + """ + Sets the camera's projection matrix. + + You should use normalised device coordinates for the clipping planes: + left = -1.0, right = 1.0, top = 1.0, bottom = -1.0, near = cam.near, far = cam.far + + Example:: + import GameLogic -if 0: - # Use to print out all the links - for i in a.split('\n'): - if i.startswith('@var'): - var = i.split(' ')[1].split(':')[0] - print '@var %s: L{%s<%s.%s>}' % (var, var, var, var) + def Scale(matrix, size): + for y in range(4): + for x in range(4): + matrix[y][x] = matrix[y][x] * size[y] + return matrix + + # Generate a perspective projection matrix + def Perspective(cam): + return [[cam.near, 0.0 , 0.0 , 0.0 ], + [0.0 , cam.near, 0.0 , 0.0 ], + [0.0 , 0.0 , -(cam.far+cam.near)/(cam.far-cam.near), -2.0*cam.far*cam.near/(cam.far - cam.near)], + [0.0 , 0.0 , -1.0 , 0.0 ]] + + # Generate an orthographic projection matrix + # You will need to scale the camera + def Orthographic(cam): + return [[1.0/cam.scaling[0], 0.0 , 0.0 , 0.0 ], + [0.0 , 1.0/cam.scaling[1], 0.0 , 0.0 ], + [0.0 , 0.0 , -2.0/(cam.far-cam.near), -(cam.far+cam.near)/(cam.far-cam.near)], + [0.0 , 0.0 , 0.0 , 1.0 ]] + + # Generate an isometric projection matrix + def Isometric(cam): + return Scale([[0.707, 0.0 , 0.707, 0.0], + [0.408, 0.816,-0.408, 0.0], + [0.0 , 0.0 , 0.0 , 0.0], + [0.0 , 0.0 , 0.0 , 1.0]], + [1.0/cam.scaling[0], 1.0/cam.scaling[1], 1.0/cam.scaling[2], 1.0]) + + co = GameLogic.getCurrentController() + cam = co.getOwner() + cam.setProjectionMatrix(Perspective(cam))) + + @type matrix: 4x4 matrix. + @param matrix: The new projection matrix for this camera. + """ + def enableViewport(viewport): + """ + DEPRECATED: use the isViewport property + Use this camera to draw a viewport on the screen (for split screen games or overlay scenes). The viewport region is defined with L{setViewport}. + + @type viewport: bool + @param viewport: the new viewport status + """ + def setOnTop(): + """ + Set this cameras viewport ontop of all other viewport. + """ + def setViewport(left, bottom, right, top): + """ + Sets the region of this viewport on the screen in pixels. + + Use L{Rasterizer.getWindowHeight} L{Rasterizer.getWindowWidth} to calculate values relative to the entire display. + + @type left: int + @type bottom: int + @type right: int + @type top: int + """ diff --git a/source/gameengine/PyDoc/KX_BlenderMaterial.py b/source/gameengine/PyDoc/KX_BlenderMaterial.py deleted file mode 100644 index c70a7dddcca..00000000000 --- a/source/gameengine/PyDoc/KX_BlenderMaterial.py +++ /dev/null @@ -1,41 +0,0 @@ - -from PyObjectPlus import * - -class KX_BlenderMaterial(PyObjectPlus): # , RAS_IPolyMaterial) - """ - KX_BlenderMaterial - - All placeholders have a __ prefix - """ - - def __getShader(val): - """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description - """ - - def __setBlending(val): - """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description - """ - def __getMaterialIndex(val): - """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description - """ diff --git a/source/gameengine/PyDoc/KX_CDActuator.py b/source/gameengine/PyDoc/KX_CDActuator.py deleted file mode 100644 index e1067674e7e..00000000000 --- a/source/gameengine/PyDoc/KX_CDActuator.py +++ /dev/null @@ -1,55 +0,0 @@ -# $Id$ -# Documentation for CD Actuator -from SCA_IActuator import * - -class KX_CDActuator(SCA_IActuator): - """ - CD Controller actuator. - @ivar volume: controls the volume to set the CD to. 0.0 = silent, 1.0 = max volume. - @type volume: float - @ivar track: the track selected to be played - @type track: integer - @ivar gain: the gain (volume) of the CD between 0.0 and 1.0. - @type gain: float - """ - def startCD(): - """ - Starts the CD playing. - """ - def stopCD(): - """ - Stops the CD playing. - """ - def pauseCD(): - """ - Pauses the CD. - """ - def resumeCD(): - """ - Resumes the CD after a pause. - """ - def playAll(): - """ - Plays the CD from the beginning. - """ - def playTrack(trackNumber): - """ - Plays the track selected. - """ - def setGain(gain): - """ - DEPRECATED: Use the volume property. - Sets the gain (volume) of the CD. - - @type gain: float - @param gain: the gain to set the CD to. 0.0 = silent, 1.0 = max volume. - """ - def getGain(): - """ - DEPRECATED: Use the volume property. - Gets the current gain (volume) of the CD. - - @rtype: float - @return: Between 0.0 (silent) and 1.0 (max volume) - """ - diff --git a/source/gameengine/PyDoc/KX_Camera.py b/source/gameengine/PyDoc/KX_Camera.py deleted file mode 100644 index 5c54935192a..00000000000 --- a/source/gameengine/PyDoc/KX_Camera.py +++ /dev/null @@ -1,212 +0,0 @@ -# $Id$ -# Documentation for Camera game objects. -from KX_GameObject import * - -class KX_Camera(KX_GameObject): - """ - A Camera object. - - @group Constants: INSIDE, INTERSECT, OUTSIDE - @ivar INSIDE: see sphereInsideFrustum() and boxInsideFrustum() - @ivar INTERSECT: see sphereInsideFrustum() and boxInsideFrustum() - @ivar OUTSIDE: see sphereInsideFrustum() and boxInsideFrustum() - - @ivar lens: The camera's lens value. - @type lens: float - @ivar near: The camera's near clip distance. - @type near: float - @ivar far: The camera's far clip distance. - @type far: float - @ivar perspective: True if this camera has a perspective transform. - - If perspective is False, this camera has an orthographic transform. - - Note that the orthographic transform is faked by multiplying the lens attribute - by 100.0 and translating the camera 100.0 along the z axis. - - This is the same as Blender. If you want a true orthographic transform, see L{setProjectionMatrix}. - @type perspective: boolean - @ivar frustum_culling: True if this camera is frustum culling. - @type frustum_culling: boolean - @ivar projection_matrix: This camera's 4x4 projection matrix. - @type projection_matrix: 4x4 Matrix [[float]] - @ivar modelview_matrix: This camera's 4x4 model view matrix. (read only) - Regenerated every frame from the camera's position and orientation. - @type modelview_matrix: 4x4 Matrix [[float]] - @ivar camera_to_world: This camera's camera to world transform. (read only) - Regenerated every frame from the camera's position and orientation. - @type camera_to_world: 4x4 Matrix [[float]] - @ivar world_to_camera: This camera's world to camera transform. (read only) - Regenerated every frame from the camera's position and orientation. - This is camera_to_world inverted. - @type world_to_camera: 4x4 Matrix [[float]] - - @group Deprecated: enableViewport - """ - - def sphereInsideFrustum(centre, radius): - """ - Tests the given sphere against the view frustum. - - @param centre: The centre of the sphere (in world coordinates.) - @type centre: list [x, y, z] - @param radius: the radius of the sphere - @type radius: float - @return: INSIDE, OUTSIDE or INTERSECT - - Example:: - import GameLogic - co = GameLogic.getCurrentController() - cam = co.GetOwner() - - # A sphere of radius 4.0 located at [x, y, z] = [1.0, 1.0, 1.0] - if (cam.sphereInsideFrustum([1.0, 1.0, 1.0], 4) != cam.OUTSIDE): - # Sphere is inside frustum ! - # Do something useful ! - else: - # Sphere is outside frustum - """ - def boxInsideFrustum(box): - """ - Tests the given box against the view frustum. - - Example:: - import GameLogic - co = GameLogic.getCurrentController() - cam = co.GetOwner() - - # Box to test... - box = [] - box.append([-1.0, -1.0, -1.0]) - box.append([-1.0, -1.0, 1.0]) - box.append([-1.0, 1.0, -1.0]) - box.append([-1.0, 1.0, 1.0]) - box.append([ 1.0, -1.0, -1.0]) - box.append([ 1.0, -1.0, 1.0]) - box.append([ 1.0, 1.0, -1.0]) - box.append([ 1.0, 1.0, 1.0]) - - if (cam.boxInsideFrustum(box) != cam.OUTSIDE): - # Box is inside/intersects frustum ! - # Do something useful ! - else: - # Box is outside the frustum ! - - @return: INSIDE, OUTSIDE or INTERSECT - @type box: list - @param box: Eight (8) corner points of the box (in world coordinates.) - """ - def pointInsideFrustum(point): - """ - Tests the given point against the view frustum. - - Example:: - import GameLogic - co = GameLogic.getCurrentController() - cam = co.GetOwner() - - # Test point [0.0, 0.0, 0.0] - if (cam.pointInsideFrustum([0.0, 0.0, 0.0])): - # Point is inside frustum ! - # Do something useful ! - else: - # Box is outside the frustum ! - - @rtype: boolean - @return: True if the given point is inside this camera's viewing frustum. - @type point: [x, y, z] - @param point: The point to test (in world coordinates.) - """ - def getCameraToWorld(): - """ - Returns the camera-to-world transform. - - @rtype: matrix (4x4 list) - @return: the camera-to-world transform matrix. - """ - def getWorldToCamera(): - """ - Returns the world-to-camera transform. - - This returns the inverse matrix of getCameraToWorld(). - - @rtype: matrix (4x4 list) - @return: the world-to-camera transform matrix. - """ - def getProjectionMatrix(): - """ - Returns the camera's projection matrix. - - @rtype: matrix (4x4 list) - @return: the camera's projection matrix. - """ - def setProjectionMatrix(matrix): - """ - Sets the camera's projection matrix. - - You should use normalised device coordinates for the clipping planes: - left = -1.0, right = 1.0, top = 1.0, bottom = -1.0, near = cam.near, far = cam.far - - Example:: - import GameLogic - - def Scale(matrix, size): - for y in range(4): - for x in range(4): - matrix[y][x] = matrix[y][x] * size[y] - return matrix - - # Generate a perspective projection matrix - def Perspective(cam): - return [[cam.near, 0.0 , 0.0 , 0.0 ], - [0.0 , cam.near, 0.0 , 0.0 ], - [0.0 , 0.0 , -(cam.far+cam.near)/(cam.far-cam.near), -2.0*cam.far*cam.near/(cam.far - cam.near)], - [0.0 , 0.0 , -1.0 , 0.0 ]] - - # Generate an orthographic projection matrix - # You will need to scale the camera - def Orthographic(cam): - return [[1.0/cam.scaling[0], 0.0 , 0.0 , 0.0 ], - [0.0 , 1.0/cam.scaling[1], 0.0 , 0.0 ], - [0.0 , 0.0 , -2.0/(cam.far-cam.near), -(cam.far+cam.near)/(cam.far-cam.near)], - [0.0 , 0.0 , 0.0 , 1.0 ]] - - # Generate an isometric projection matrix - def Isometric(cam): - return Scale([[0.707, 0.0 , 0.707, 0.0], - [0.408, 0.816,-0.408, 0.0], - [0.0 , 0.0 , 0.0 , 0.0], - [0.0 , 0.0 , 0.0 , 1.0]], - [1.0/cam.scaling[0], 1.0/cam.scaling[1], 1.0/cam.scaling[2], 1.0]) - - co = GameLogic.getCurrentController() - cam = co.getOwner() - cam.setProjectionMatrix(Perspective(cam))) - - @type matrix: 4x4 matrix. - @param matrix: The new projection matrix for this camera. - """ - - def enableViewport(viewport): - """ - DEPRECATED: use the isViewport property - Use this camera to draw a viewport on the screen (for split screen games or overlay scenes). The viewport region is defined with L{setViewport}. - - @type viewport: bool - @param viewport: the new viewport status - """ - def setOnTop(): - """ - Set this cameras viewport ontop of all other viewport. - """ - def setViewport(left, bottom, right, top): - """ - Sets the region of this viewport on the screen in pixels. - - Use L{Rasterizer.getWindowHeight} L{Rasterizer.getWindowWidth} to calculate values relative to the entire display. - - @type left: int - @type bottom: int - @type right: int - @type top: int - """ diff --git a/source/gameengine/PyDoc/KX_CameraActuator.py b/source/gameengine/PyDoc/KX_CameraActuator.py deleted file mode 100644 index 6ffc55a5854..00000000000 --- a/source/gameengine/PyDoc/KX_CameraActuator.py +++ /dev/null @@ -1,98 +0,0 @@ -# $Id$ -# Documentation for KX_CameraActuator -from SCA_IActuator import * - -class KX_CameraActuator(SCA_IActuator): - """ - Applies changes to a camera. - - @ivar min: minimum distance to the target object maintained by the actuator - @type min: float - @ivar max: maximum distance to stay from the target object - @type max: float - @ivar height: height to stay above the target object - @type height: float - @ivar xy: axis this actuator is tracking, true=X, false=Y - @type xy: boolean - @ivar object: the object this actuator tracks. - @type object: KX_GameObject or None - @author: snail - """ - def getObject(name_only = 1): - """ - Returns the name of the object this actuator tracks. - - @type name_only: bool - @param name_only: optional argument, when 0 return a KX_GameObject - @rtype: string, KX_GameObject or None if no object is set - """ - - def setObject(target): - """ - Sets the object this actuator tracks. - - @param target: the object to track. - @type target: L{KX_GameObject}, string or None - """ - - def getMin(): - """ - Returns the minimum distance to target maintained by the actuator. - - @rtype: float - """ - - def setMin(distance): - """ - Sets the minimum distance to the target object maintained by the - actuator. - - @param distance: The minimum distance to maintain. - @type distance: float - """ - - def getMax(): - """ - Gets the maximum distance to stay from the target object. - - @rtype: float - """ - - def setMax(distance): - """ - Sets the maximum distance to stay from the target object. - - @param distance: The maximum distance to maintain. - @type distance: float - """ - - def getHeight(): - """ - Returns the height to stay above the target object. - - @rtype: float - """ - - def setHeight(height): - """ - Sets the height to stay above the target object. - - @type height: float - @param height: The height to stay above the target object. - """ - - def setXY(xaxis): - """ - Sets the axis to get behind. - - @param xaxis: False to track Y axis, True to track X axis. - @type xaxis: boolean - """ - - def getXY(): - """ - Returns the axis this actuator is tracking. - - @return: True if tracking X axis, False if tracking Y axis. - @rtype: boolean - """ diff --git a/source/gameengine/PyDoc/KX_ConstraintActuator.py b/source/gameengine/PyDoc/KX_ConstraintActuator.py deleted file mode 100644 index 89ca4d80c73..00000000000 --- a/source/gameengine/PyDoc/KX_ConstraintActuator.py +++ /dev/null @@ -1,249 +0,0 @@ -# $Id$ -# Documentation for KX_ConstraintActuator -from SCA_IActuator import * - -class KX_ConstraintActuator(SCA_IActuator): - """ - A constraint actuator limits the position, rotation, distance or orientation of an object. - - Properties: - - @ivar damp: time constant of the constraint expressed in frame (not use by Force field constraint) - @type damp: integer - - @ivar rotDamp: time constant for the rotation expressed in frame (only for the distance constraint) - 0 = use damp for rotation as well - @type rotDamp: integer - - @ivar direction: the reference direction in world coordinate for the orientation constraint - @type direction: 3-tuple of float: [x,y,z] - - @ivar option: Binary combination of the following values: - Applicable to Distance constraint: - - KX_ACT_CONSTRAINT_NORMAL ( 64) : Activate alignment to surface - - KX_ACT_CONSTRAINT_DISTANCE ( 512) : Activate distance control - - KX_ACT_CONSTRAINT_LOCAL (1024) : direction of the ray is along the local axis - Applicable to Force field constraint: - - KX_ACT_CONSTRAINT_DOROTFH (2048) : Force field act on rotation as well - Applicable to both: - - KX_ACT_CONSTRAINT_MATERIAL ( 128) : Detect material rather than property - - KX_ACT_CONSTRAINT_PERMANENT ( 256) : No deactivation if ray does not hit target - @type option: integer - - @ivar time: activation time of the actuator. The actuator disables itself after this many frame. - If set to 0, the actuator is not limited in time. - @type time: integer - - @ivar property: the name of the property or material for the ray detection of the distance constraint. - @type property: string - - @ivar min: The lower bound of the constraint - For the rotation and orientation constraint, it represents radiant - @type min: float - - @ivar distance: the target distance of the distance constraint - @type distance: float - - @ivar max: the upper bound of the constraint. - For rotation and orientation constraints, it represents radiant. - @type max: float - - @ivar rayLength: the length of the ray of the distance constraint. - @type rayLength: float - - @ivar limit: type of constraint, use one of the following constant: - KX_ACT_CONSTRAINT_LOCX ( 1) : limit X coord - KX_ACT_CONSTRAINT_LOCY ( 2) : limit Y coord - KX_ACT_CONSTRAINT_LOCZ ( 3) : limit Z coord - KX_ACT_CONSTRAINT_ROTX ( 4) : limit X rotation - KX_ACT_CONSTRAINT_ROTY ( 5) : limit Y rotation - KX_ACT_CONSTRAINT_ROTZ ( 6) : limit Z rotation - KX_ACT_CONSTRAINT_DIRPX ( 7) : set distance along positive X axis - KX_ACT_CONSTRAINT_DIRPY ( 8) : set distance along positive Y axis - KX_ACT_CONSTRAINT_DIRPZ ( 9) : set distance along positive Z axis - KX_ACT_CONSTRAINT_DIRNX (10) : set distance along negative X axis - KX_ACT_CONSTRAINT_DIRNY (11) : set distance along negative Y axis - KX_ACT_CONSTRAINT_DIRNZ (12) : set distance along negative Z axis - KX_ACT_CONSTRAINT_ORIX (13) : set orientation of X axis - KX_ACT_CONSTRAINT_ORIY (14) : set orientation of Y axis - KX_ACT_CONSTRAINT_ORIZ (15) : set orientation of Z axis - KX_ACT_CONSTRAINT_FHPX (16) : set force field along positive X axis - KX_ACT_CONSTRAINT_FHPY (17) : set force field along positive Y axis - KX_ACT_CONSTRAINT_FHPZ (18) : set force field along positive Z axis - KX_ACT_CONSTRAINT_FHNX (19) : set force field along negative X axis - KX_ACT_CONSTRAINT_FHNY (20) : set force field along negative Y axis - KX_ACT_CONSTRAINT_FHNZ (21) : set force field along negative Z axis - @type limit: integer - """ - def setDamp(time): - """ - Sets the time this constraint is delayed. - - @param time: The number of frames to delay. - Negative values are ignored. - @type time: integer - """ - def getDamp(): - """ - Returns the damping time of the constraint. - - @rtype: integer - """ - def setMin(lower): - """ - Sets the lower bound of the constraint. - - For rotational and orientation constraints, lower is specified in degrees. - - @type lower: float - """ - def getMin(): - """ - Gets the lower bound of the constraint. - - For rotational and orientation constraints, the lower bound is returned in radians. - - @rtype: float - """ - def setMax(upper): - """ - Sets the upper bound of the constraint. - - For rotational and orientation constraints, upper is specified in degrees. - - @type upper: float - """ - def getMax(): - """ - Gets the upper bound of the constraint. - - For rotational and orientation constraints, the upper bound is returned in radians. - - @rtype: float - """ - def setLimit(limit): - """ - Sets the type of constraint. - - See module L{GameLogic} for valid constraint types. - - @param limit: - Position constraints: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ - Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY or KX_CONSTRAINTACT_ROTZ - Distance contraints: KX_ACT_CONSTRAINT_DIRPX, KX_ACT_CONSTRAINT_DIRPY, KX_ACT_CONSTRAINT_DIRPZ, KX_ACT_CONSTRAINT_DIRNX, KX_ACT_CONSTRAINT_DIRNY, KX_ACT_CONSTRAINT_DIRNZ - Orientation constraints: KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ - """ - def getLimit(): - """ - Gets the type of constraint. - - See module L{GameLogic} for valid constraints. - - @return: - Position constraints: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ, - Rotation constraints: KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY, KX_CONSTRAINTACT_ROTZ, - Distance contraints: KX_ACT_CONSTRAINT_DIRPX, KX_ACT_CONSTRAINT_DIRPY, KX_ACT_CONSTRAINT_DIRPZ, KX_ACT_CONSTRAINT_DIRNX, KX_ACT_CONSTRAINT_DIRNY, KX_ACT_CONSTRAINT_DIRNZ, - Orientation constraints: KX_ACT_CONSTRAINT_ORIX, KX_ACT_CONSTRAINT_ORIY, KX_ACT_CONSTRAINT_ORIZ - """ - def setRotDamp(duration): - """ - Sets the time constant of the orientation constraint. - - @param duration: If the duration is negative, it is set to 0. - @type duration: integer - """ - def getRotDamp(): - """ - Returns the damping time for application of the constraint. - - @rtype: integer - """ - def setDirection(vector): - """ - Sets the reference direction in world coordinate for the orientation constraint - - @type vector: 3-tuple - """ - def getDirection(): - """ - Returns the reference direction of the orientation constraint in world coordinate. - - @rtype: 3-tuple - """ - def setOption(option): - """ - Sets several options of the distance constraint. - - @type option: integer - @param option: Binary combination of the following values: - 64 : Activate alignment to surface - 128 : Detect material rather than property - 256 : No deactivation if ray does not hit target - 512 : Activate distance control - """ - def getOption(): - """ - Returns the option parameter. - - @rtype: integer - """ - def setTime(duration): - """ - Sets the activation time of the actuator. - - @type duration: integer - @param duration: The actuator disables itself after this many frame. - If set to 0 or negative, the actuator is not limited in time. - """ - def getTime(): - """ - Returns the time parameter. - - @rtype: integer - """ - def setProperty(property): - """ - Sets the name of the property or material for the ray detection of the distance constraint. - - @type property: string - @param property: If empty, the ray will detect any collisioning object. - """ - def getProperty(): - """ - Returns the property parameter. - - @rtype: string - """ - def setDistance(distance): - """ - Sets the target distance in distance constraint. - - @type distance: float - """ - def getDistance(): - """ - Returns the distance parameter. - - @rtype: float - """ - def setRayLength(length): - """ - Sets the maximum ray length of the distance constraint. - - @type length: float - """ - def getRayLength(): - """ - Returns the length of the ray - - @rtype: float - """ - - - - - - - - - diff --git a/source/gameengine/PyDoc/KX_ConstraintWrapper.py b/source/gameengine/PyDoc/KX_ConstraintWrapper.py deleted file mode 100644 index 5b34e1609e8..00000000000 --- a/source/gameengine/PyDoc/KX_ConstraintWrapper.py +++ /dev/null @@ -1,28 +0,0 @@ -class KX_ConstraintWrapper: # (PyObjectPlus) - """ - KX_ConstraintWrapper - - All placeholders have a __ prefix - """ - def __getConstraintId(val): - """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description - """ - - def __testMethod(val): - """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description - """ - diff --git a/source/gameengine/PyDoc/KX_GameActuator.py b/source/gameengine/PyDoc/KX_GameActuator.py deleted file mode 100644 index 0b329419ad7..00000000000 --- a/source/gameengine/PyDoc/KX_GameActuator.py +++ /dev/null @@ -1,31 +0,0 @@ -# $Id$ -# Documentation for KX_GameActuator -from SCA_IActuator import * - -class KX_GameActuator(SCA_IActuator): - """ - The game actuator loads a new .blend file, restarts the current .blend file or quits the game. - - Properties: - - @ivar file: the new .blend file to load - @type file: string. - @ivar mode: The mode of this actuator - @type mode: int from 0 to 5 L{GameLogic.Game Actuator} - """ - def getFile(): - """ - DEPRECATED: use the file property - Returns the filename of the new .blend file to load. - - @rtype: string - """ - def setFile(filename): - """ - DEPRECATED: use the file property - Sets the new .blend file to load. - - @param filename: The file name this actuator will load. - @type filename: string - """ - diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py deleted file mode 100644 index 257a25e8ad9..00000000000 --- a/source/gameengine/PyDoc/KX_GameObject.py +++ /dev/null @@ -1,507 +0,0 @@ -# $Id$ -# Documentation for game objects - -from SCA_IObject import * -# from SCA_ISensor import * -# from SCA_IController import * -# from SCA_IActuator import * - - -class KX_GameObject(SCA_IObject): - """ - All game objects are derived from this class. - - Properties assigned to game objects are accessible as attributes of this class. - - note: Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError, if an object may have been removed since last accessing it use the L{invalid} attribute to check. - - @ivar name: The object's name. (Read only) - - note: Currently (Blender 2.49) the prefix "OB" is added to all objects name. This may change in blender 2.5. - @type name: string. - @ivar mass: The object's mass - - note: The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0 - @type mass: float - @ivar linVelocityMin: Enforces the object keeps moving at a minimum velocity. - - note: Applies to dynamic and rigid body objects only. - - note: A value of 0.0 disables this option. - - note: While objects are stationary the minimum velocity will not be applied. - @type linVelocityMin: float - @ivar linVelocityMax: Clamp the maximum linear velocity to prevent objects moving beyond a set speed. - - note: Applies to dynamic and rigid body objects only. - - note: A value of 0.0 disables this option (rather then setting it stationary). - @type linVelocityMax: float - @ivar localInertia: the object's inertia vector in local coordinates. Read only. - @type localInertia: list [ix, iy, iz] - @ivar parent: The object's parent object. (Read only) - @type parent: L{KX_GameObject} or None - @ivar visible: visibility flag. - - note: Game logic will still run for invisible objects. - @type visible: boolean - @ivar occlusion: occlusion capability flag. - @type occlusion: boolean - @ivar position: The object's position. - DEPRECATED: use localPosition and worldPosition - @type position: list [x, y, z] On write: local position, on read: world position - @ivar orientation: The object's orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. - DEPRECATED: use localOrientation and worldOrientation - @type orientation: 3x3 Matrix [[float]] On write: local orientation, on read: world orientation - @ivar scaling: The object's scaling factor. list [sx, sy, sz] - DEPRECATED: use localScaling and worldScaling - @type scaling: list [sx, sy, sz] On write: local scaling, on read: world scaling - @ivar localOrientation: The object's local orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. - @type localOrientation: 3x3 Matrix [[float]] - @ivar worldOrientation: The object's world orientation. - @type worldOrientation: 3x3 Matrix [[float]] - @ivar localScaling: The object's local scaling factor. - @type localScaling: list [sx, sy, sz] - @ivar worldScaling: The object's world scaling factor. Read-only - @type worldScaling: list [sx, sy, sz] - @ivar localPosition: The object's local position. - @type localPosition: list [x, y, z] - @ivar worldPosition: The object's world position. - @type worldPosition: list [x, y, z] - @ivar timeOffset: adjust the slowparent delay at runtime. - @type timeOffset: float - @ivar state: the game object's state bitmask, using the first 30 bits, one bit must always be set. - @type state: int - @ivar meshes: a list meshes for this object. - - note: Most objects use only 1 mesh. - - note: Changes to this list will not update the KX_GameObject. - @type meshes: list of L{KX_MeshProxy} - @ivar sensors: a sequence of L{SCA_ISensor} objects with string/index lookups and iterator support. - - note: This attribute is experemental and may be removed (but probably wont be). - - note: Changes to this list will not update the KX_GameObject. - @type sensors: list - @ivar controllers: a sequence of L{SCA_IController} objects with string/index lookups and iterator support. - - note: This attribute is experemental and may be removed (but probably wont be). - - note: Changes to this list will not update the KX_GameObject. - @type controllers: list of L{SCA_ISensor}. - @ivar actuators: a list of L{SCA_IActuator} with string/index lookups and iterator support. - - note: This attribute is experemental and may be removed (but probably wont be). - - note: Changes to this list will not update the KX_GameObject. - @type actuators: list - @ivar attrDict: get the objects internal python attribute dictionary for direct (faster) access. - @type attrDict: dict - @group Deprecated: getPosition, setPosition, setWorldPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass, getMesh - """ - def endObject(): - """ - Delete this object, can be used inpace of the EndObject Actuator. - The actual removal of the object from the scene is delayed. - """ - def replaceMesh(mesh): - """ - Replace the mesh of this object with a new mesh. This works the same was as the actuator. - @type mesh: L{KX_MeshProxy} or mesh name - """ - def getVisible(): - """ - Gets the game object's visible flag. (B{deprecated}) - - @rtype: boolean - """ - def setVisible(visible, recursive): - """ - Sets the game object's visible flag. - - @type visible: boolean - @type recursive: boolean - @param recursive: optional argument to set all childrens visibility flag too. - """ - def setOcclusion(occlusion, recursive): - """ - Sets the game object's occlusion capability. - - @type occlusion: boolean - @type recursive: boolean - @param recursive: optional argument to set all childrens occlusion flag too. - """ - def getState(): - """ - Gets the game object's state bitmask. (B{deprecated}) - - @rtype: int - @return: the objects state. - """ - def setState(state): - """ - Sets the game object's state flag. (B{deprecated}). - The bitmasks for states from 1 to 30 can be set with (1<<0, 1<<1, 1<<2 ... 1<<29) - - @type state: integer - """ - def setPosition(pos): - """ - Sets the game object's position. (B{deprecated}) - Global coordinates for root object, local for child objects. - - - @type pos: [x, y, z] - @param pos: the new position, in local coordinates. - """ - def setWorldPosition(pos): - """ - Sets the game object's position in world coordinates regardless if the object is root or child. - - @type pos: [x, y, z] - @param pos: the new position, in world coordinates. - """ - def getPosition(): - """ - Gets the game object's position. (B{deprecated}) - - @rtype: list [x, y, z] - @return: the object's position in world coordinates. - """ - def setOrientation(orn): - """ - Sets the game object's orientation. (B{deprecated}) - - @type orn: 3x3 rotation matrix, or Quaternion. - @param orn: a rotation matrix specifying the new rotation. - @note: When using this matrix with Blender.Mathutils.Matrix() types, it will need to be transposed. - """ - def alignAxisToVect(vect, axis, factor): - """ - Aligns any of the game object's axis along the given vector. - - @type vect: 3d vector. - @param vect: a vector to align the axis. - @type axis: integer. - @param axis:The axis you want to align - - 0: X axis - - 1: Y axis - - 2: Z axis (default) - @type factor: float - @param factor: Only rotate a feaction of the distance to the target vector (0.0 - 1.0) - """ - def getAxisVect(vect): - """ - Returns the axis vector rotates by the objects worldspace orientation. - This is the equivalent if multiplying the vector by the orientation matrix. - - @type vect: 3d vector. - @param vect: a vector to align the axis. - @rtype: 3d vector. - @return: The vector in relation to the objects rotation. - - """ - def getOrientation(): - """ - Gets the game object's orientation. (B{deprecated}) - - @rtype: 3x3 rotation matrix - @return: The game object's rotation matrix - @note: When using this matrix with Blender.Mathutils.Matrix() types, it will need to be transposed. - """ - def applyMovement(movement, local = 0): - """ - Sets the game object's movement. - - @type movement: 3d vector. - @param movement: movement vector. - @type local: boolean - @param local: - False: you get the "global" movement ie: relative to world orientation (default). - - True: you get the "local" movement ie: relative to object orientation. - """ - def applyRotation(rotation, local = 0): - """ - Sets the game object's rotation. - - @type rotation: 3d vector. - @param rotation: rotation vector. - @type local: boolean - @param local: - False: you get the "global" rotation ie: relative to world orientation (default). - - True: you get the "local" rotation ie: relative to object orientation. - """ - def applyForce(force, local = 0): - """ - Sets the game object's force. - - This requires a dynamic object. - - @type force: 3d vector. - @param force: force vector. - @type local: boolean - @param local: - False: you get the "global" force ie: relative to world orientation (default). - - True: you get the "local" force ie: relative to object orientation. - """ - def applyTorque(torque, local = 0): - """ - Sets the game object's torque. - - This requires a dynamic object. - - @type torque: 3d vector. - @param torque: torque vector. - @type local: boolean - @param local: - False: you get the "global" torque ie: relative to world orientation (default). - - True: you get the "local" torque ie: relative to object orientation. - """ - def getLinearVelocity(local = 0): - """ - Gets the game object's linear velocity. - - This method returns the game object's velocity through it's centre of mass, - ie no angular velocity component. - - @type local: boolean - @param local: - False: you get the "global" velocity ie: relative to world orientation (default). - - True: you get the "local" velocity ie: relative to object orientation. - @rtype: list [vx, vy, vz] - @return: the object's linear velocity. - """ - def setLinearVelocity(velocity, local = 0): - """ - Sets the game object's linear velocity. - - This method sets game object's velocity through it's centre of mass, - ie no angular velocity component. - - This requires a dynamic object. - - @type velocity: 3d vector. - @param velocity: linear velocity vector. - @type local: boolean - @param local: - False: you get the "global" velocity ie: relative to world orientation (default). - - True: you get the "local" velocity ie: relative to object orientation. - """ - def getAngularVelocity(local = 0): - """ - Gets the game object's angular velocity. - - @type local: boolean - @param local: - False: you get the "global" velocity ie: relative to world orientation (default). - - True: you get the "local" velocity ie: relative to object orientation. - @rtype: list [vx, vy, vz] - @return: the object's angular velocity. - """ - def setAngularVelocity(velocity, local = 0): - """ - Sets the game object's angular velocity. - - This requires a dynamic object. - - @type velocity: 3d vector. - @param velocity: angular velocity vector. - @type local: boolean - @param local: - False: you get the "global" velocity ie: relative to world orientation (default). - - True: you get the "local" velocity ie: relative to object orientation. - """ - def getVelocity(point): - """ - Gets the game object's velocity at the specified point. - - Gets the game object's velocity at the specified point, including angular - components. - - @type point: list [x, y, z] - @param point: the point to return the velocity for, in local coordinates. (optional: default = [0, 0, 0]) - @rtype: list [vx, vy, vz] - @return: the velocity at the specified point. - """ - def getMass(): - """ - Gets the game object's mass. (B{deprecated}) - - @rtype: float - @return: the object's mass. - """ - def getReactionForce(): - """ - Gets the game object's reaction force. - - The reaction force is the force applied to this object over the last simulation timestep. - This also includes impulses, eg from collisions. - - (B{This is not implimented for bullet physics at the moment}) - - @rtype: list [fx, fy, fz] - @return: the reaction force of this object. - """ - def applyImpulse(point, impulse): - """ - Applies an impulse to the game object. - - This will apply the specified impulse to the game object at the specified point. - If point != getPosition(), applyImpulse will also change the object's angular momentum. - Otherwise, only linear momentum will change. - - @type point: list [x, y, z] - @param point: the point to apply the impulse to (in world coordinates) - """ - def suspendDynamics(): - """ - Suspends physics for this object. - """ - def restoreDynamics(): - """ - Resumes physics for this object. - @Note: The objects linear velocity will be applied from when the dynamics were suspended. - """ - def enableRigidBody(): - """ - Enables rigid body physics for this object. - - Rigid body physics allows the object to roll on collisions. - @Note: This is not working with bullet physics yet. - """ - def disableRigidBody(): - """ - Disables rigid body physics for this object. - @Note: This is not working with bullet physics yet. The angular is removed but rigid body physics can still rotate it later. - """ - def getParent(): - """ - Gets this object's parent. (B{deprecated}) - - @rtype: L{KX_GameObject} - @return: this object's parent object, or None if this object has no parent. - """ - def setParent(parent): - """ - Sets this object's parent. - - @type parent: L{KX_GameObject} - @param parent: new parent object. - """ - def removeParent(): - """ - Removes this objects parent. - """ - def getChildren(): - """ - Return a list of immediate children of this object. - @rtype: L{CListValue} of L{KX_GameObject} - @return: a list of all this objects children. - """ - def getChildrenRecursive(): - """ - Return a list of children of this object, including all their childrens children. - @rtype: L{CListValue} of L{KX_GameObject} - @return: a list of all this objects children recursivly. - """ - def getMesh(mesh): - """ - Gets the mesh object for this object. - - @type mesh: integer - @param mesh: the mesh object to return (optional: default mesh = 0) - @rtype: L{KX_MeshProxy} - @return: the first mesh object associated with this game object, or None if this object has no meshs. - """ - def getPhysicsId(): - """ - Returns the user data object associated with this game object's physics controller. - """ - def getPropertyNames(): - """ - Gets a list of all property names. - @rtype: list - @return: All property names for this object. - """ - def getDistanceTo(other): - """ - Returns the distance to another object or point. - - @param other: a point or another L{KX_GameObject} to measure the distance to. - @type other: L{KX_GameObject} or list [x, y, z] - @rtype: float - """ - def getVectTo(other): - """ - Returns the vector and the distance to another object or point. - The vector is normalized unless the distance is 0, in which a NULL vector is returned. - - @param other: a point or another L{KX_GameObject} to get the vector and distance to. - @type other: L{KX_GameObject} or list [x, y, z] - @rtype: 3-tuple (float, 3-tuple (x,y,z), 3-tuple (x,y,z)) - @return: (distance, globalVector(3), localVector(3)) - """ - def rayCastTo(other,dist,prop): - """ - Look towards another point/object and find first object hit within dist that matches prop. - - The ray is always casted from the center of the object, ignoring the object itself. - The ray is casted towards the center of another object or an explicit [x,y,z] point. - Use rayCast() if you need to retrieve the hit point - - @param other: [x,y,z] or object towards which the ray is casted - @type other: L{KX_GameObject} or 3-tuple - @param dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other - @type dist: float - @param prop: property name that object must have; can be omitted => detect any object - @type prop: string - @rtype: L{KX_GameObject} - @return: the first object hit or None if no object or object does not match prop - """ - def rayCast(objto,objfrom,dist,prop,face,xray,poly): - """ - Look from a point/object to another point/object and find first object hit within dist that matches prop. - if poly is 0, returns a 3-tuple with object reference, hit point and hit normal or (None,None,None) if no hit. - if poly is 1, returns a 4-tuple with in addition a L{KX_PolyProxy} as 4th element. - - Ex:: - # shoot along the axis gun-gunAim (gunAim should be collision-free) - ob,point,normal = gun.rayCast(gunAim,None,50) - if ob: - # hit something - - Notes: - The ray ignores the object on which the method is called. - It is casted from/to object center or explicit [x,y,z] points. - - The face paremeter determines the orientation of the normal:: - 0 => hit normal is always oriented towards the ray origin (as if you casted the ray from outside) - 1 => hit normal is the real face normal (only for mesh object, otherwise face has no effect) - - The ray has X-Ray capability if xray parameter is 1, otherwise the first object hit (other than self object) stops the ray. - The prop and xray parameters interact as follow:: - prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray. - prop off, xray on : idem. - prop on, xray off: return closest hit if it matches prop, no hit otherwise. - prop on, xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray. - The L{KX_PolyProxy} 4th element of the return tuple when poly=1 allows to retrieve information on the polygon hit by the ray. - If there is no hit or the hit object is not a static mesh, None is returned as 4th element. - - The ray ignores collision-free objects and faces that dont have the collision flag enabled, you can however use ghost objects. - - @param objto: [x,y,z] or object to which the ray is casted - @type objto: L{KX_GameObject} or 3-tuple - @param objfrom: [x,y,z] or object from which the ray is casted; None or omitted => use self object center - @type objfrom: L{KX_GameObject} or 3-tuple or None - @param dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to to - @type dist: float - @param prop: property name that object must have; can be omitted or "" => detect any object - @type prop: string - @param face: normal option: 1=>return face normal; 0 or omitted => normal is oriented towards origin - @type face: int - @param xray: X-ray option: 1=>skip objects that don't match prop; 0 or omitted => stop on first object - @type xray: int - @param poly: polygon option: 1=>return value is a 4-tuple and the 4th element is a L{KX_PolyProxy} - @type poly: int - @rtype: 3-tuple (L{KX_GameObject}, 3-tuple (x,y,z), 3-tuple (nx,ny,nz)) - or 4-tuple (L{KX_GameObject}, 3-tuple (x,y,z), 3-tuple (nx,ny,nz), L{KX_PolyProxy}) - @return: (object,hitpoint,hitnormal) or (object,hitpoint,hitnormal,polygon) - If no hit, returns (None,None,None) or (None,None,None,None) - If the object hit is not a static mesh, polygon is None - """ - def setCollisionMargin(margin): - """ - Set the objects collision margin. - - note: If this object has no physics controller (a physics ID of zero), this function will raise RuntimeError. - - @type margin: float - @param margin: the collision margin distance in blender units. - """ - def sendMessage(subject, body="", to=""): - """ - Sends a message. - - @param subject: The subject of the message - @type subject: string - @param body: The body of the message (optional) - @type body: string - @param to: The name of the object to send the message to (optional) - @type to: string - """ diff --git a/source/gameengine/PyDoc/KX_IpoActuator.py b/source/gameengine/PyDoc/KX_IpoActuator.py deleted file mode 100644 index ebc0b855f0a..00000000000 --- a/source/gameengine/PyDoc/KX_IpoActuator.py +++ /dev/null @@ -1,124 +0,0 @@ -# $Id$ -# Documentation for KX_IpoActuator -from SCA_IActuator import * - -class KX_IpoActuator(SCA_IActuator): - """ - IPO actuator activates an animation. - - @ivar startFrame: Start frame. - @type startFrame: float - @ivar endFrame: End frame. - @type endFrame: float - @ivar propName: Use this property to define the Ipo position - @type propName: string - @ivar framePropName: Assign this property this action current frame number - @type framePropName: string - @ivar type: Play mode for the ipo. (In GameLogic.KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND, KX_IPOACT_FROM_PROP) - @type type: int - @ivar useIpoAsForce: Apply Ipo as a global or local force depending on the local option (dynamic objects only) - @type useIpoAsForce: bool - @ivar useIpoAdd: Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag - @type useIpoAdd: bool - @ivar useIpoLocal: Let the ipo acts in local coordinates, used in Force and Add mode. - @type useIpoLocal: bool - @ivar useChildren: Update IPO on all children Objects as well - @type useChildren: bool - """ - def set(mode, startframe, endframe, force): - """ - Sets the properties of the actuator. (B{deprecated}) - - @param mode: "Play", "PingPong", "Flipper", "LoopStop", "LoopEnd" or "FromProp" - @type mode: string - @param startframe: first frame to use - @type startframe: integer - @param endframe: last frame to use - @type endframe: integer - @param force: special mode - @type force: integer (0=normal, 1=interpret location as force, 2=additive) - """ - def setProperty(property): - """ - Sets the name of the property to be used in FromProp mode. (B{deprecated}) - - @type property: string - """ - def setStart(startframe): - """ - Sets the frame from which the IPO starts playing. (B{deprecated}) - - @type startframe: integer - """ - def getStart(): - """ - Returns the frame from which the IPO starts playing. (B{deprecated}) - - @rtype: integer - """ - def setEnd(endframe): - """ - Sets the frame at which the IPO stops playing. (B{deprecated}) - - @type endframe: integer - """ - def getEnd(): - """ - Returns the frame at which the IPO stops playing. (B{deprecated}) - - @rtype: integer - """ - def setIpoAsForce(force): - """ - Set whether to interpret the ipo as a force rather than a displacement. (B{deprecated}) - - @type force: boolean - @param force: KX_TRUE or KX_FALSE - """ - def getIpoAsForce(): - """ - Returns whether to interpret the ipo as a force rather than a displacement. (B{deprecated}) - - @rtype: boolean - """ - def setIpoAdd(add): - """ - Set whether to interpret the ipo as additive rather than absolute. (B{deprecated}) - - @type add: boolean - @param add: KX_TRUE or KX_FALSE - """ - def getIpoAdd(): - """ - Returns whether to interpret the ipo as additive rather than absolute. (B{deprecated}) - - @rtype: boolean - """ - def setType(mode): - """ - Sets the operation mode of the actuator. (B{deprecated}) - - @param mode: KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND - @type mode: string - """ - def getType(): - """ - Returns the operation mode of the actuator. (B{deprecated}) - - @rtype: integer - @return: KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND - """ - def setForceIpoActsLocal(local): - """ - Set whether to apply the force in the object's local - coordinates rather than the world global coordinates. (B{deprecated}) - - @param local: Apply the ipo-as-force in the object's local - coordinates? (KX_TRUE, KX_FALSE) - @type local: boolean - """ - def getForceIpoActsLocal(): - """ - Return whether to apply the force in the object's local - coordinates rather than the world global coordinates. (B{deprecated}) - """ diff --git a/source/gameengine/PyDoc/KX_LightObject.py b/source/gameengine/PyDoc/KX_LightObject.py deleted file mode 100644 index 8cc1787887b..00000000000 --- a/source/gameengine/PyDoc/KX_LightObject.py +++ /dev/null @@ -1,45 +0,0 @@ -# $Id$ -# Documentation for Light game objects. -from KX_GameObject import * - -class KX_LightObject(KX_GameObject): - """ - A Light object. - - Example: - - # Turn on a red alert light. - import GameLogic - - co = GameLogic.getCurrentController() - light = co.getOwner() - - light.energy = 1.0 - light.colour = [1.0, 0.0, 0.0] - - @group Constants: NORMAL, SPOT, SUN - @ivar SPOT: A spot light source. See attribute 'type' - @ivar SUN: A point light source with no attenuation. See attribute 'type' - @ivar NORMAL: A point light source. See attribute 'type' - - @ivar type: The type of light - must be SPOT, SUN or NORMAL - @ivar layer: The layer mask that this light affects object on. - @type layer: bitfield - @ivar energy: The brightness of this light. - @type energy: float - @ivar distance: The maximum distance this light can illuminate. (SPOT and NORMAL lights only) - @type distance: float - @ivar colour: The colour of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0] - @type colour: list [r, g, b] - @ivar color: Synonym for colour. - @ivar lin_attenuation: The linear component of this light's attenuation. (SPOT and NORMAL lights only) - @type lin_attenuation: float - @ivar quad_attenuation: The quadratic component of this light's attenuation (SPOT and NORMAL lights only) - @type quad_attenuation: float - @ivar spotsize: The cone angle of the spot light, in degrees. (float) (SPOT lights only) - 0.0 <= spotsize <= 180.0. Spotsize = 360.0 is also accepted. - @ivar spotblend: Specifies the intensity distribution of the spot light. (float) (SPOT lights only) - Higher values result in a more focused light source. - 0.0 <= spotblend <= 1.0. - - """ diff --git a/source/gameengine/PyDoc/KX_MeshProxy.py b/source/gameengine/PyDoc/KX_MeshProxy.py deleted file mode 100644 index c864523cde8..00000000000 --- a/source/gameengine/PyDoc/KX_MeshProxy.py +++ /dev/null @@ -1,134 +0,0 @@ -# $Id$ -# Documentation for KX_MeshProxy - -from SCA_IObject import * - -class KX_MeshProxy(SCA_IObject): - """ - A mesh object. - - You can only change the vertex properties of a mesh object, not the mesh topology. - - To use mesh objects effectively, you should know a bit about how the game engine handles them. - 1. Mesh Objects are converted from Blender at scene load. - 2. The Converter groups polygons by Material. This means they can be sent to the - renderer efficiently. A material holds: - 1. The texture. - 2. The Blender material. - 3. The Tile properties - 4. The face properties - (From the "Texture Face" panel) - 5. Transparency & z sorting - 6. Light layer - 7. Polygon shape (triangle/quad) - 8. Game Object - 3. Verticies will be split by face if necessary. Verticies can only be shared between - faces if: - 1. They are at the same position - 2. UV coordinates are the same - 3. Their normals are the same (both polygons are "Set Smooth") - 4. They are the same colour - For example: a cube has 24 verticies: 6 faces with 4 verticies per face. - - The correct method of iterating over every L{KX_VertexProxy} in a game object:: - import GameLogic - - co = GameLogic.getcurrentController() - obj = co.getOwner() - - m_i = 0 - mesh = obj.getMesh(m_i) # There can be more than one mesh... - while mesh != None: - for mat in range(mesh.getNumMaterials()): - for v_index in range(mesh.getVertexArrayLength(mat)): - vertex = mesh.getVertex(mat, v_index) - # Do something with vertex here... - # ... eg: colour the vertex red. - vertex.colour = [1.0, 0.0, 0.0, 1.0] - m_i += 1 - mesh = obj.getMesh(m_i) - - @ivar materials: - @type materials: list of L{KX_BlenderMaterial} or L{KX_PolygonMaterial} types - - @ivar numPolygons: - @type numPolygons: integer - - @ivar numMaterials: - @type numMaterials: integer - """ - - def getNumMaterials(): - """ - Gets the number of materials associated with this object. - - @rtype: integer - """ - - def getMaterialName(matid): - """ - Gets the name of the specified material. - - @type matid: integer - @param matid: the specified material. - @rtype: string - @return: the attached material name. - """ - def getTextureName(matid): - """ - Gets the name of the specified material's texture. - - @type matid: integer - @param matid: the specified material - @rtype: string - @return: the attached material's texture name. - """ - def getVertexArrayLength(matid): - """ - Gets the length of the vertex array associated with the specified material. - - There is one vertex array for each material. - - @type matid: integer - @param matid: the specified material - @rtype: integer - @return: the number of verticies in the vertex array. - """ - def getVertex(matid, index): - """ - Gets the specified vertex from the mesh object. - - @type matid: integer - @param matid: the specified material - @type index: integer - @param index: the index into the vertex array. - @rtype: L{KX_VertexProxy} - @return: a vertex object. - """ - def getNumPolygons(): - """ - Returns the number of polygon in the mesh. - - @rtype: integer - """ - def getPolygon(index): - """ - Gets the specified polygon from the mesh. - - @type index: integer - @param index: polygon number - @rtype: L{KX_PolyProxy} - @return: a polygon object. - """ - def reinstancePhysicsMesh(): - """ - Updates the physics system with the changed mesh. - - A mesh must have only one material with collision flags, - and have all collision primitives in one vertex array (ie. < 65535 verts) and - be either a polytope or polyheder mesh. If you don't get a warning in the - console when the collision type is polytope, the mesh is suitable for reinstance. - - @rtype: boolean - @return: True if reinstance succeeded, False if it failed. - """ - diff --git a/source/gameengine/PyDoc/KX_MouseFocusSensor.py b/source/gameengine/PyDoc/KX_MouseFocusSensor.py deleted file mode 100644 index 24f7716218b..00000000000 --- a/source/gameengine/PyDoc/KX_MouseFocusSensor.py +++ /dev/null @@ -1,67 +0,0 @@ -# $Id$ -# Documentation for KX_MouseFocusSensor -from SCA_MouseSensor import * - -class KX_MouseFocusSensor(SCA_MouseSensor): - """ - The mouse focus sensor detects when the mouse is over the current game object. - - The mouse focus sensor works by transforming the mouse coordinates from 2d device - space to 3d space then raycasting away from the camera. - - @ivar raySource: The worldspace source of the ray (the view position) - @type raySource: list (vector of 3 floats) - @ivar rayTarget: The worldspace target of the ray. - @type rayTarget: list (vector of 3 floats) - @ivar rayDirection: The L{rayTarget} - L{raySource} normalized. - @type rayDirection: list (normalized vector of 3 floats) - @ivar hitObject: the last object the mouse was over. - @type hitObject: L{KX_GameObject} or None - @ivar hitPosition: The worldspace position of the ray intersecton. - @type hitPosition: list (vector of 3 floats) - @ivar hitNormal: the worldspace normal from the face at point of intersection. - @type hitNormal: list (normalized vector of 3 floats) - """ - - def getHitNormal(): - """ - Returns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray. (B{deprecated}) - - @rtype: list [x, y, z] - @return: the ray collision normal. - """ - def getHitObject(): - """ - Returns the object that was hit by this ray or None. (B{deprecated}) - - @rtype: L{KX_GameObject} or None - @return: the collision object. - """ - def getHitPosition(): - """ - Returns the position (in worldcoordinates) at the point of collision where the object was hit by this ray. (B{deprecated}) - - @rtype: list [x, y, z] - @return: the ray collision position. - """ - def getRayDirection(): - """ - Returns the normalized direction (in worldcoordinates) of the ray cast by the mouse. (B{deprecated}) - - @rtype: list [x, y, z] - @return: the ray direction. - """ - def getRaySource(): - """ - Returns the position (in worldcoordinates) the ray was cast from by the mouse. (B{deprecated}) - - @rtype: list [x, y, z] - @return: the ray source. - """ - def getRayTarget(): - """ - Returns the target of the ray (in worldcoordinates) that seeks the focus object. (B{deprecated}) - - @rtype: list [x, y, z] - @return: the ray target. - """ \ No newline at end of file diff --git a/source/gameengine/PyDoc/KX_NearSensor.py b/source/gameengine/PyDoc/KX_NearSensor.py deleted file mode 100644 index a8c408827fe..00000000000 --- a/source/gameengine/PyDoc/KX_NearSensor.py +++ /dev/null @@ -1,14 +0,0 @@ -# $Id$ -# Documentation for KX_NearSensor -from KX_TouchSensor import * - -class KX_NearSensor(KX_TouchSensor): - """ - A near sensor is a specialised form of touch sensor. - - @ivar distance: The near sensor activates when an object is within this distance. - @type distance: float - @ivar resetDistance: The near sensor deactivates when the object exceeds this distance. - @type resetDistance: float - """ - diff --git a/source/gameengine/PyDoc/KX_NetworkMessageActuator.py b/source/gameengine/PyDoc/KX_NetworkMessageActuator.py deleted file mode 100644 index c9f48d47eb8..00000000000 --- a/source/gameengine/PyDoc/KX_NetworkMessageActuator.py +++ /dev/null @@ -1,49 +0,0 @@ -# $Id$ -# Documentation for KX_NetworkMessageActuator -from SCA_IActuator import * - -class KX_NetworkMessageActuator(SCA_IActuator): - """ - Message Actuator - - @ivar propName: Messages will only be sent to objects with the given property name. - @type propName: string - @ivar subject: The subject field of the message. - @type subject: string - @ivar body: The body of the message. - @type body: string - @ivar usePropBody: Send a property instead of a regular body message. - @type usePropBody: boolean - """ - def setToPropName(name): - """ - DEPRECATED: Use the propName property instead. - Messages will only be sent to objects with the given property name. - - @type name: string - """ - def setSubject(subject): - """ - DEPRECATED: Use the subject property instead. - Sets the subject field of the message. - - @type subject: string - """ - def setBodyType(bodytype): - """ - DEPRECATED: Use the usePropBody property instead. - Sets the type of body to send. - - @type bodytype: boolean - @param bodytype: True to send the value of a property, False to send the body text. - """ - def setBody(body): - """ - DEPRECATED: Use the body property instead. - Sets the message body. - - @type body: string - @param body: if the body type is True, this is the name of the property to send. - if the body type is False, this is the text to send. - """ - diff --git a/source/gameengine/PyDoc/KX_NetworkMessageSensor.py b/source/gameengine/PyDoc/KX_NetworkMessageSensor.py deleted file mode 100644 index 0fecad58437..00000000000 --- a/source/gameengine/PyDoc/KX_NetworkMessageSensor.py +++ /dev/null @@ -1,60 +0,0 @@ -# $Id$ -# Documentation for KX_NetworkMessageSensor -from SCA_ISensor import * - -class KX_NetworkMessageSensor(SCA_ISensor): - """ - The Message Sensor logic brick. - - Currently only loopback (local) networks are supported. - - @ivar subject: The subject the sensor is looking for. - @type subject: string - @ivar frameMessageCount: The number of messages received since the last frame. - (Read-only) - @type framemessageCount: int - @ivar subjects: The list of message subjects received. (Read-only) - @type subjects: list of strings - @ivar bodies: The list of message bodies received. (Read-only) - @type bodies: list of strings - """ - - - def setSubjectFilterText(subject): - """ - DEPRECATED: Use the subject property instead. - Change the message subject text that this sensor is listening to. - - @type subject: string - @param subject: the new message subject to listen for. - """ - - def getFrameMessageCount(): - """ - DEPRECATED: Use the frameMessageCount property instead. - Get the number of messages received since the last frame. - - @rtype: integer - """ - def getBodies(): - """ - DEPRECATED: Use the bodies property instead. - Gets the list of message bodies. - - @rtype: list - """ - def getSubject(): - """ - DEPRECATED: Use the subject property instead. - Gets the message subject this sensor is listening for from the Subject: field. - - @rtype: string - """ - def getSubjects(): - """ - DEPRECATED: Use the subjects property instead. - Gets the list of message subjects received. - - @rtype: list - """ - \ No newline at end of file diff --git a/source/gameengine/PyDoc/KX_ObjectActuator.py b/source/gameengine/PyDoc/KX_ObjectActuator.py deleted file mode 100644 index b7b76473292..00000000000 --- a/source/gameengine/PyDoc/KX_ObjectActuator.py +++ /dev/null @@ -1,250 +0,0 @@ -# $Id$ -# Documentation for KX_ObjectActuator -from SCA_IActuator import * - -class KX_ObjectActuator(SCA_IActuator): - """ - The object actuator ("Motion Actuator") applies force, torque, displacement, angular displacement, - velocity, or angular velocity to an object. - Servo control allows to regulate force to achieve a certain speed target. - """ - def getForce(): - """ - Returns the force applied by the actuator. - - @rtype: list [fx, fy, fz, local] - @return: A four item list, containing the vector force, and a flag specifying whether the force is local. - """ - def setForce(fx, fy, fz, local): - """ - Sets the force applied by the actuator. - - @type fx: float - @param fx: the x component of the force. - @type fy: float - @param fy: the z component of the force. - @type fz: float - @param fz: the z component of the force. - @type local: boolean - @param local: - False: the force is applied in world coordinates. - - True: the force is applied in local coordinates. - """ - def getTorque(): - """ - Returns the torque applied by the actuator. - - @rtype: list [S{Tau}x, S{Tau}y, S{Tau}z, local] - @return: A four item list, containing the vector torque, and a flag specifying whether - the torque is applied in local coordinates (True) or world coordinates (False) - """ - def setTorque(tx, ty, tz, local): - """ - Sets the torque applied by the actuator. - - @type tx: float - @param tx: the x component of the torque. - @type ty: float - @param ty: the z component of the torque. - @type tz: float - @param tz: the z component of the torque. - @type local: boolean - @param local: - False: the torque is applied in world coordinates. - - True: the torque is applied in local coordinates. - """ - def getDLoc(): - """ - Returns the displacement vector applied by the actuator. - - @rtype: list [dx, dy, dz, local] - @return: A four item list, containing the vector displacement, and whether - the displacement is applied in local coordinates (True) or world - coordinates (False) - """ - def setDLoc(dx, dy, dz, local): - """ - Sets the displacement vector applied by the actuator. - - Since the displacement is applied every frame, you must adjust the displacement - based on the frame rate, or you game experience will depend on the player's computer - speed. - - @type dx: float - @param dx: the x component of the displacement vector. - @type dy: float - @param dy: the z component of the displacement vector. - @type dz: float - @param dz: the z component of the displacement vector. - @type local: boolean - @param local: - False: the displacement vector is applied in world coordinates. - - True: the displacement vector is applied in local coordinates. - """ - def getDRot(): - """ - Returns the angular displacement vector applied by the actuator. - - @rtype: list [dx, dy, dz, local] - @return: A four item list, containing the angular displacement vector, and whether - the displacement is applied in local coordinates (True) or world - coordinates (False) - """ - def setDRot(dx, dy, dz, local): - """ - Sets the angular displacement vector applied by the actuator. - - Since the displacement is applied every frame, you must adjust the displacement - based on the frame rate, or you game experience will depend on the player's computer - speed. - - @type dx: float - @param dx: the x component of the angular displacement vector. - @type dy: float - @param dy: the z component of the angular displacement vector. - @type dz: float - @param dz: the z component of the angular displacement vector. - @type local: boolean - @param local: - False: the angular displacement vector is applied in world coordinates. - - True: the angular displacement vector is applied in local coordinates. - """ - def getLinearVelocity(): - """ - Returns the linear velocity applied by the actuator. - For the servo control actuator, this is the target speed. - - @rtype: list [vx, vy, vz, local] - @return: A four item list, containing the vector velocity, and whether the velocity is applied in local coordinates (True) or world coordinates (False) - """ - def setLinearVelocity(vx, vy, vz, local): - """ - Sets the linear velocity applied by the actuator. - For the servo control actuator, sets the target speed. - - @type vx: float - @param vx: the x component of the velocity vector. - @type vy: float - @param vy: the z component of the velocity vector. - @type vz: float - @param vz: the z component of the velocity vector. - @type local: boolean - @param local: - False: the velocity vector is in world coordinates. - - True: the velocity vector is in local coordinates. - """ - def getAngularVelocity(): - """ - Returns the angular velocity applied by the actuator. - - @rtype: list [S{omega}x, S{omega}y, S{omega}z, local] - @return: A four item list, containing the vector velocity, and whether - the velocity is applied in local coordinates (True) or world - coordinates (False) - """ - def setAngularVelocity(wx, wy, wz, local): - """ - Sets the angular velocity applied by the actuator. - - @type wx: float - @param wx: the x component of the velocity vector. - @type wy: float - @param wy: the z component of the velocity vector. - @type wz: float - @param wz: the z component of the velocity vector. - @type local: boolean - @param local: - False: the velocity vector is applied in world coordinates. - - True: the velocity vector is applied in local coordinates. - """ - def getDamping(): - """ - Returns the damping parameter of the servo controller. - - @rtype: integer - @return: the time constant of the servo controller in frame unit. - """ - def setDamping(damp): - """ - Sets the damping parameter of the servo controller. - - @type damp: integer - @param damp: the damping parameter in frame unit. - """ - def getForceLimitX(): - """ - Returns the min/max force limit along the X axis used by the servo controller. - - @rtype: list [min, max, enabled] - @return: A three item list, containing the min and max limits of the force as float - and whether the limits are active(true) or inactive(true) - """ - def setForceLimitX(min, max, enable): - """ - Sets the min/max force limit along the X axis and activates or deactivates the limits in the servo controller. - - @type min: float - @param min: the minimum value of the force along the X axis. - @type max: float - @param max: the maximum value of the force along the X axis. - @type enable: boolean - @param enable: - True: the force will be limited to the min/max - - False: the force will not be limited - """ - def getForceLimitY(): - """ - Returns the min/max force limit along the Y axis used by the servo controller. - - @rtype: list [min, max, enabled] - @return: A three item list, containing the min and max limits of the force as float - and whether the limits are active(true) or inactive(true) - """ - def setForceLimitY(min, max, enable): - """ - Sets the min/max force limit along the Y axis and activates or deactivates the limits in the servo controller. - - @type min: float - @param min: the minimum value of the force along the Y axis. - @type max: float - @param max: the maximum value of the force along the Y axis. - @type enable: boolean - @param enable: - True: the force will be limited to the min/max - - False: the force will not be limited - """ - def getForceLimitZ(): - """ - Returns the min/max force limit along the Z axis used by the servo controller. - - @rtype: list [min, max, enabled] - @return: A three item list, containing the min and max limits of the force as float - and whether the limits are active(true) or inactive(true) - """ - def setForceLimitZ(min, max, enable): - """ - Sets the min/max force limit along the Z axis and activates or deactivates the limits in the servo controller. - - @type min: float - @param min: the minimum value of the force along the Z axis. - @type max: float - @param max: the maximum value of the force along the Z axis. - @type enable: boolean - @param enable: - True: the force will be limited to the min/max - - False: the force will not be limited - """ - def getPID(): - """ - Returns the PID coefficient of the servo controller. - - @rtype: list [P, I, D] - @return: A three item list, containing the PID coefficient as floats: - P : proportional coefficient - I : Integral coefficient - D : Derivate coefficient - """ - def setPID(P, I, D): - """ - Sets the PID coefficients of the servo controller. - - @type P: flat - @param P: proportional coefficient - @type I: float - @param I: Integral coefficient - @type D: float - @param D: Derivate coefficient - """ - - diff --git a/source/gameengine/PyDoc/KX_ParentActuator.py b/source/gameengine/PyDoc/KX_ParentActuator.py deleted file mode 100644 index 1e2bfe60a4f..00000000000 --- a/source/gameengine/PyDoc/KX_ParentActuator.py +++ /dev/null @@ -1,29 +0,0 @@ -# $Id$ -# Documentation for KX_ParentActuator -from SCA_IActuator import * - -class KX_ParentActuator(SCA_IActuator): - """ - The parent actuator can set or remove an objects parent object. - @ivar object: the object this actuator sets the parent too. - @type object: KX_GameObject or None - @ivar mode: The mode of this actuator - @type mode: int from 0 to 1 L{GameLogic.Parent Actuator} - """ - def setObject(object): - """ - DEPRECATED: Use the object property. - Sets the object to set as parent. - - Object can be either a L{KX_GameObject} or the name of the object. - - @type object: L{KX_GameObject}, string or None - """ - def getObject(name_only = 1): - """ - DEPRECATED: Use the object property. - Returns the name of the object to change to. - @type name_only: bool - @param name_only: optional argument, when 0 return a KX_GameObject - @rtype: string, KX_GameObject or None if no object is set - """ diff --git a/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py b/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py deleted file mode 100644 index 4cbdbf7cebb..00000000000 --- a/source/gameengine/PyDoc/KX_PhysicsObjectWrapper.py +++ /dev/null @@ -1,60 +0,0 @@ -from PyObjectPlus import * - -class KX_PhysicsObjectWrapper(PyObjectPlus): - """ - KX_PhysicsObjectWrapper - - """ - def setActive(active): - """ - Set the object to be active. - - @param active: set to True to be active - @type active: bool - """ - - def setAngularVelocity(x, y, z, local): - """ - Set the angular velocity of the object. - - @param x: angular velocity for the x-axis - @type x: float - - @param y: angular velocity for the y-axis - @type y: float - - @param z: angular velocity for the z-axis - @type z: float - - @param local: set to True for local axis - @type local: bool - """ - def setLinearVelocity(x, y, z, local): - """ - Set the linear velocity of the object. - - @param x: linear velocity for the x-axis - @type x: float - - @param y: linear velocity for the y-axis - @type y: float - - @param z: linear velocity for the z-axis - @type z: float - - @param local: set to True for local axis - @type local: bool - """ - def setPosition(x, y, z): - """ - Set the position of the object - - @param x: x coordinate - @type x: float - - @param y: y coordinate - @type y: float - - @param z: z coordinate - @type z: float - """ diff --git a/source/gameengine/PyDoc/KX_PolyProxy.py b/source/gameengine/PyDoc/KX_PolyProxy.py deleted file mode 100644 index 2d1c1f9b218..00000000000 --- a/source/gameengine/PyDoc/KX_PolyProxy.py +++ /dev/null @@ -1,101 +0,0 @@ -# $Id$ -# Documentation for the polygon proxy class -from SCA_IObject import * - -class KX_PolyProxy(SCA_IObject): - """ - A polygon holds the index of the vertex forming the poylgon. - - Note: - The polygon attributes are read-only, you need to retrieve the vertex proxy if you want - to change the vertex settings. - - @ivar matname: The name of polygon material, empty if no material. - @type matname: string - @ivar material: The material of the polygon - @type material: L{KX_PolygonMaterial} or KX_BlenderMaterial - @ivar texture: The texture name of the polygon. - @type texture: string - @ivar matid: The material index of the polygon, use this to retrieve vertex proxy from mesh proxy - @type matid: integer - @ivar v1: vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy - @type v1: integer - @ivar v2: vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy - @type v2: integer - @ivar v3: vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy - @type v3: integer - @ivar v4: vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex - use this to retrieve vertex proxy from mesh proxy - @type v4: integer - @ivar visible: visible state of the polygon: 1=visible, 0=invisible - @type visible: integer - @ivar collide: collide state of the polygon: 1=receives collision, 0=collision free. - @type collide: integer - """ - - def getMaterialName(): - """ - Returns the polygon material name with MA prefix - - @rtype: string - @return: material name - """ - def getMaterial(): - """ - Returns the polygon material - - @rtype: L{KX_PolygonMaterial} or KX_BlenderMaterial - """ - def getTextureName(): - """ - Returns the polygon texture name - - @rtype: string - @return: texture name - """ - def getMaterialIndex(): - """ - Returns the material bucket index of the polygon. - This index and the ones returned by getVertexIndex() are needed to retrieve the vertex proxy from L{KX_MeshProxy}. - - @rtype: integer - @return: the material index in the mesh - """ - def getNumVertex(): - """ - Returns the number of vertex of the polygon. - - @rtype: integer - @return: number of vertex, 3 or 4. - """ - def isVisible(): - """ - Returns whether the polygon is visible or not - - @rtype: integer - @return: 0=invisible, 1=visible - """ - def isCollider(): - """ - Returns whether the polygon is receives collision or not - - @rtype: integer - @return: 0=collision free, 1=receives collision - """ - def getVertexIndex(vertex): - """ - Returns the mesh vertex index of a polygon vertex - This index and the one returned by getMaterialIndex() are needed to retrieve the vertex proxy from L{KX_MeshProxy}. - - @type vertex: integer - @param vertex: index of the vertex in the polygon: 0->3 - @rtype: integer - @return: mesh vertex index - """ - def getMesh(): - """ - Returns a mesh proxy - - @rtype: L{KX_MeshProxy} - @return: mesh proxy - """ diff --git a/source/gameengine/PyDoc/KX_PolygonMaterial.py b/source/gameengine/PyDoc/KX_PolygonMaterial.py deleted file mode 100644 index cfc4257f95d..00000000000 --- a/source/gameengine/PyDoc/KX_PolygonMaterial.py +++ /dev/null @@ -1,281 +0,0 @@ -# $Id$ - -class KX_PolygonMaterial: - """ - This is the interface to materials in the game engine. - - Materials define the render state to be applied to mesh objects. - - Warning: Some of the methods/variables are CObjects. If you mix these up, - you will crash blender. - - This example requires: - - PyOpenGL http://pyopengl.sourceforge.net/ - - GLEWPy http://glewpy.sourceforge.net/ - Example:: - - import GameLogic - import OpenGL - from OpenGL.GL import * - from OpenGL.GLU import * - import glew - from glew import * - - glewInit() - - vertex_shader = \"\"\" - - void main(void) - { - gl_Position = ftransform(); - } - \"\"\" - - fragment_shader =\"\"\" - - void main(void) - { - gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); - } - \"\"\" - - class MyMaterial: - def __init__(self): - self.pass_no = 0 - # Create a shader - self.m_program = glCreateProgramObjectARB() - # Compile the vertex shader - self.shader(GL_VERTEX_SHADER_ARB, (vertex_shader)) - # Compile the fragment shader - self.shader(GL_FRAGMENT_SHADER_ARB, (fragment_shader)) - # Link the shaders together - self.link() - - def PrintInfoLog(self, tag, object): - \"\"\" - PrintInfoLog prints the GLSL compiler log - \"\"\" - print "Tag: def PrintGLError(self, tag = ""): - - def PrintGLError(self, tag = ""): - \"\"\" - Prints the current GL error status - \"\"\" - if len(tag): - print tag - err = glGetError() - if err != GL_NO_ERROR: - print "GL Error: %s\\n"%(gluErrorString(err)) - - def shader(self, type, shaders): - \"\"\" - shader compiles a GLSL shader and attaches it to the current - program. - - type should be either GL_VERTEX_SHADER_ARB or GL_FRAGMENT_SHADER_ARB - shaders should be a sequence of shader source to compile. - \"\"\" - # Create a shader object - shader_object = glCreateShaderObjectARB(type) - - # Add the source code - glShaderSourceARB(shader_object, len(shaders), shaders) - - # Compile the shader - glCompileShaderARB(shader_object) - - # Print the compiler log - self.PrintInfoLog("vertex shader", shader_object) - - # Check if compiled, and attach if it did - compiled = glGetObjectParameterivARB(shader_object, GL_OBJECT_COMPILE_STATUS_ARB) - if compiled: - glAttachObjectARB(self.m_program, shader_object) - - # Delete the object (glAttachObjectARB makes a copy) - glDeleteObjectARB(shader_object) - - # print the gl error log - self.PrintGLError() - - def link(self): - \"\"\" - Links the shaders together. - \"\"\" - # clear error indicator - glGetError() - - glLinkProgramARB(self.m_program) - - self.PrintInfoLog("link", self.m_program) - - linked = glGetObjectParameterivARB(self.m_program, GL_OBJECT_LINK_STATUS_ARB) - if not linked: - print "Shader failed to link" - return - - glValidateProgramARB(self.m_program) - valid = glGetObjectParameterivARB(self.m_program, GL_OBJECT_VALIDATE_STATUS_ARB) - if not valid: - print "Shader failed to validate" - return - - def activate(self, rasty, cachingInfo, mat): - self.pass_no+=1 - if (self.pass_no == 1): - glDisable(GL_COLOR_MATERIAL) - glUseProgramObjectARB(self.m_program) - return True - - glEnable(GL_COLOR_MATERIAL) - glUseProgramObjectARB(0) - self.pass_no = 0 - return False - - obj = GameLogic.getCurrentController().getOwner() - - mesh = obj.getMesh(0) - - for mat in mesh.materials: - mat.setCustomMaterial(MyMaterial()) - print mat.texture - - @ivar texture: Texture name - @type texture: string (read only) - - @ivar gl_texture: OpenGL texture handle (eg for glBindTexture(GL_TEXTURE_2D, gl_texture) - @type gl_texture: integer (read only) - - @ivar material: Material name - @type material: string (read only) - - @ivar tface: Texture face properties - @type tface: CObject (read only) - - @ivar tile: Texture is tiling - @type tile: boolean - @ivar tilexrep: Number of tile repetitions in x direction. - @type tilexrep: integer - @ivar tileyrep: Number of tile repetitions in y direction. - @type tileyrep: integer - - @ivar drawingmode: Drawing mode for the material. - - 2 (drawingmode & 4) Textured - - 4 (drawingmode & 16) Light - - 14 (drawingmode & 16384) 3d Polygon Text - @type drawingmode: bitfield - - @ivar transparent: This material is transparent. All meshes with this - material will be rendered after non transparent meshes from back - to front. - @type transparent: boolean - - @ivar zsort: Transparent polygons in meshes with this material will be sorted back to - front before rendering. - Non-Transparent polygons will be sorted front to back before rendering. - @type zsort: boolean - - @ivar lightlayer: Light layers this material affects. - @type lightlayer: bitfield. - - @ivar triangle: Mesh data with this material is triangles. It's probably not safe to change this. - @type triangle: boolean - - @ivar diffuse: The diffuse colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0] - @type diffuse: list [r, g, b] - @ivar specular: The specular colour of the material. black = [0.0, 0.0, 0.0] white = [1.0, 1.0, 1.0] - @type specular: list [r, g, b] - @ivar shininess: The shininess (specular exponent) of the material. 0.0 <= shininess <= 128.0 - @type shininess: float - @ivar specularity: The amount of specular of the material. 0.0 <= specularity <= 1.0 - @type specularity: float - """ - def updateTexture(tface, rasty): - """ - Updates a realtime animation. - - @param tface: Texture face (eg mat.tface) - @type tface: CObject - @param rasty: Rasterizer - @type rasty: CObject - """ - def setTexture(tface): - """ - Sets texture render state. - - Example:: - mat.setTexture(mat.tface) - - @param tface: Texture face - @type tface: CObject - """ - def activate(rasty, cachingInfo): - """ - Sets material parameters for this object for rendering. - - Material Parameters set: - 1. Texture - 2. Backface culling - 3. Line drawing - 4. Specular Colour - 5. Shininess - 6. Diffuse Colour - 7. Polygon Offset. - - @param rasty: Rasterizer instance. - @type rasty: CObject - @param cachingInfo: Material cache instance. - @type cachingInfo: CObject - """ - def setCustomMaterial(material): - """ - Sets the material state setup object. - - Using this method, you can extend or completely replace the gameengine material - to do your own advanced multipass effects. - - Use this method to register your material class. Instead of the normal material, - your class's activate method will be called just before rendering the mesh. - This should setup the texture, material, and any other state you would like. - It should return True to render the mesh, or False if you are finished. You should - clean up any state Blender does not set before returning False. - - Activate Method Definition:: - def activate(self, rasty, cachingInfo, material): - - Example:: - class PyMaterial: - def __init__(self): - self.pass_no = -1 - - def activate(self, rasty, cachingInfo, material): - # Activate the material here. - # - # The activate method will be called until it returns False. - # Every time the activate method returns True the mesh will - # be rendered. - # - # rasty is a CObject for passing to material.updateTexture() - # and material.activate() - # cachingInfo is a CObject for passing to material.activate() - # material is the KX_PolygonMaterial instance this material - # was added to - - # default material properties: - self.pass_no += 1 - if self.pass_no == 0: - material.activate(rasty, cachingInfo) - # Return True to do this pass - return True - - # clean up and return False to finish. - self.pass_no = -1 - return False - - # Create a new Python Material and pass it to the renderer. - mat.setCustomMaterial(PyMaterial()) - - @param material: The material object. - @type material: instance - """ - diff --git a/source/gameengine/PyDoc/KX_RadarSensor.py b/source/gameengine/PyDoc/KX_RadarSensor.py deleted file mode 100644 index b68bf4ea0f3..00000000000 --- a/source/gameengine/PyDoc/KX_RadarSensor.py +++ /dev/null @@ -1,49 +0,0 @@ -# $Id$ -# Documentation for KX_RadarSensor -from KX_NearSensor import * - -class KX_RadarSensor(KX_NearSensor): - """ - Radar sensor is a near sensor with a conical sensor object. - - @ivar coneOrigin: The origin of the cone with which to test. The origin - is in the middle of the cone. - (Read only) - @type coneOrigin: list of floats [x, y, z] - @ivar coneTarget: The center of the bottom face of the cone with which to test. - (Read only) - @type coneTarget: list of floats [x, y, z] - @ivar distance: The height of the cone with which to test. - @type distance: float - @ivar angle: The angle of the cone (in degrees) with which to test. - @type angle: float from 0 to 360 - @ivar axis: The axis on which the radar cone is cast - @type axis: int from 0 to 5 - KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z, - KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z - """ - - - #--The following methods are deprecated, please use properties instead. - def getConeOrigin(): - """ - Returns the origin of the cone with which to test. The origin - is in the middle of the cone. - - @rtype: list [x, y, z] - """ - - def getConeTarget(): - """ - Returns the center of the bottom face of the cone with which to test. - - @rtype: list [x, y, z] - """ - - def getConeHeight(): - """ - Returns the height of the cone with which to test. - - @rtype: float - """ - diff --git a/source/gameengine/PyDoc/KX_RaySensor.py b/source/gameengine/PyDoc/KX_RaySensor.py deleted file mode 100644 index b9de54e92a5..00000000000 --- a/source/gameengine/PyDoc/KX_RaySensor.py +++ /dev/null @@ -1,58 +0,0 @@ -# $Id$ -# Documentation for KX_RaySensor -from SCA_ISensor import * - -class KX_RaySensor(SCA_ISensor): - """ - A ray sensor detects the first object in a given direction. - - @ivar property: The property the ray is looking for. - @type property: string - @ivar range: The distance of the ray. - @type range: float - @ivar useMaterial: Whether or not to look for a material (false = property) - @type useMaterial: boolean - @ivar useXRay: Whether or not to use XRay. - @type useXRay: boolean - @ivar hitObject: The game object that was hit by the ray. (Read-only) - @type hitObject: KX_GameObject - @ivar hitPosition: The position (in worldcoordinates) where the object was hit by the ray. (Read-only) - @type hitPosition: list [x, y, z] - @ivar hitNormal: The normal (in worldcoordinates) of the object at the location where the object was hit by the ray. (Read-only) - @type hitNormal: list [x, y, z] - @ivar rayDirection: The direction from the ray (in worldcoordinates). (Read-only) - @type rayDirection: list [x, y, z] - @ivar axis: The axis the ray is pointing on. - @type axis: int from 0 to 5 - KX_RAY_AXIS_POS_X, KX_RAY_AXIS_POS_Y, KX_RAY_AXIS_POS_Z, - KX_RAY_AXIS_NEG_X, KX_RAY_AXIS_NEG_Y, KX_RAY_AXIS_NEG_Z - """ - - def getHitObject(): - """ - DEPRECATED: Use the hitObject property instead. - Returns the game object that was hit by this ray. - - @rtype: KX_GameObject - """ - def getHitPosition(): - """ - DEPRECATED: Use the hitPosition property instead. - Returns the position (in worldcoordinates) where the object was hit by this ray. - - @rtype: list [x, y, z] - """ - def getHitNormal(): - """ - DEPRECATED: Use the hitNormal property instead. - Returns the normal (in worldcoordinates) of the object at the location where the object was hit by this ray. - - @rtype: list [nx, ny, nz] - """ - def getRayDirection(): - """ - DEPRECATED: Use the rayDirection property instead. - Returns the direction from the ray (in worldcoordinates) - - @rtype: list [dx, dy, dz] - """ diff --git a/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py b/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py deleted file mode 100644 index 572b864ff0a..00000000000 --- a/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py +++ /dev/null @@ -1,118 +0,0 @@ -# $Id$ -# Documentation for KX_SCA_AddObjectActuator -from SCA_IActuator import * - -class KX_SCA_AddObjectActuator(SCA_IActuator): - """ - Edit Object Actuator (in Add Object Mode) - @ivar object: the object this actuator adds. - @type object: KX_GameObject or None - @ivar objectLastCreated: the last added object from this actuator (read only). - @type objectLastCreated: KX_GameObject or None - @ivar time: the lifetime of added objects, in frames. - @type time: integer - @ivar linearVelocity: the initial linear velocity of added objects. - @type linearVelocity: list [vx, vy, vz] - @ivar angularVelocity: the initial angular velocity of added objects. - @type angularVelocity: list [vx, vy, vz] - - @warning: An Add Object actuator will be ignored if at game start, the linked object doesn't exist - (or is empty) or the linked object is in an active layer. - - This will genereate a warning in the console: - - C{ERROR: GameObject I{OBName} has a AddObjectActuator I{ActuatorName} without object (in 'nonactive' layer)} - """ - def setObject(object): - """ - DEPRECATED: use the object property - Sets the game object to add. - - A copy of the object will be added to the scene when the actuator is activated. - - If the object does not exist, this function is ignored. - - object can either be a L{KX_GameObject} or the name of an object or None. - - @type object: L{KX_GameObject}, string or None - """ - def getObject(name_only = 0): - """ - DEPRECATED: use the object property - Returns the name of the game object to be added. - - Returns None if no game object has been assigned to be added. - @type name_only: bool - @param name_only: optional argument, when 0 return a KX_GameObject - @rtype: string, KX_GameObject or None if no object is set - """ - def setTime(time): - """ - DEPRECATED: use the time property - Sets the lifetime of added objects, in frames. - - If time == 0, the object will last forever. - - @type time: integer - @param time: The minimum value for time is 0. - """ - def getTime(): - """ - DEPRECATED: use the time property - Returns the lifetime of the added object, in frames. - - @rtype: integer - """ - def setLinearVelocity(vx, vy, vz): - """ - DEPRECATED: use the linearVelocity property - Sets the initial linear velocity of added objects. - - @type vx: float - @param vx: the x component of the initial linear velocity. - @type vy: float - @param vy: the y component of the initial linear velocity. - @type vz: float - @param vz: the z component of the initial linear velocity. - """ - def getLinearVelocity(): - """ - DEPRECATED: use the linearVelocity property - Returns the initial linear velocity of added objects. - - @rtype: list [vx, vy, vz] - """ - def setAngularVelocity(vx, vy, vz): - """ - DEPRECATED: use the angularVelocity property - Sets the initial angular velocity of added objects. - - @type vx: float - @param vx: the x component of the initial angular velocity. - @type vy: float - @param vy: the y component of the initial angular velocity. - @type vz: float - @param vz: the z component of the initial angular velocity. - """ - def getAngularVelocity(): - """ - DEPRECATED: use the angularVelocity property - Returns the initial angular velocity of added objects. - - @rtype: list [vx, vy, vz] - """ - def getLastCreatedObject(): - """ - DEPRECATED: use the objectLastCreated property - Returns the last object created by this actuator. - - @rtype: L{KX_GameObject} - @return: A L{KX_GameObject} or None if no object has been created. - """ - def instantAddObject(): - """ - Returns the last object created by this actuator. The object can then be accessed from L{objectLastCreated}. - - @rtype: None - """ - diff --git a/source/gameengine/PyDoc/KX_SCA_DynamicActuator.py b/source/gameengine/PyDoc/KX_SCA_DynamicActuator.py deleted file mode 100644 index 22da159ce71..00000000000 --- a/source/gameengine/PyDoc/KX_SCA_DynamicActuator.py +++ /dev/null @@ -1,30 +0,0 @@ -# $Id$ -# Documentation for KX_SCA_DynamicActuator -from SCA_IActuator import * - -class KX_SCA_DynamicActuator(SCA_IActuator): - """ - Dynamic Actuator. - @ivar operation: the type of operation of the actuator, 0-4 - KX_DYN_RESTORE_DYNAMICS, KX_DYN_DISABLE_DYNAMICS, - KX_DYN_ENABLE_RIGID_BODY, KX_DYN_DISABLE_RIGID_BODY, KX_DYN_SET_MASS - @type operation: integer - @ivar mass: the mass value for the KX_DYN_SET_MASS operation - @type mass: float - """ - def setOperation(operation): - """ - DEPRECATED: Use the operation property instead. - Set the type of operation when the actuator is activated: - - 0 = restore dynamics - - 1 = disable dynamics - - 2 = enable rigid body - - 3 = disable rigid body - - 4 = set mass - """ - def getOperation(): - """ - DEPRECATED: Use the operation property instead. - return the type of operation - """ - diff --git a/source/gameengine/PyDoc/KX_SCA_EndObjectActuator.py b/source/gameengine/PyDoc/KX_SCA_EndObjectActuator.py deleted file mode 100644 index 8a7c79bb52b..00000000000 --- a/source/gameengine/PyDoc/KX_SCA_EndObjectActuator.py +++ /dev/null @@ -1,11 +0,0 @@ -# $Id$ -# Documentation for KX_SCA_EndObjectActuator -from SCA_IActuator import * - -class KX_SCA_EndObjectActuator(SCA_IActuator): - """ - Edit Object Actuator (in End Object mode) - - This actuator has no python methods. - """ - diff --git a/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py b/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py deleted file mode 100644 index 951c118a99a..00000000000 --- a/source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py +++ /dev/null @@ -1,84 +0,0 @@ -# $Id$ -# Documentation for KX_SCA_ReplaceMeshActuator -from SCA_IActuator import * - -class KX_SCA_ReplaceMeshActuator(SCA_IActuator): - """ - Edit Object actuator, in Replace Mesh mode. - - Example:: - # Level-of-detail - # Switch a game object's mesh based on its depth in the camera view. - # +----------+ +-----------+ +-------------------------------------+ - # | Always +-----+ Python +-----+ Edit Object (Replace Mesh) LOD.Mesh | - # +----------+ +-----------+ +-------------------------------------+ - import GameLogic - - # List detail meshes here - # Mesh (name, near, far) - # Meshes overlap so that they don't 'pop' when on the edge of the distance. - meshes = ((".Hi", 0.0, -20.0), - (".Med", -15.0, -50.0), - (".Lo", -40.0, -100.0) - ) - - co = GameLogic.getCurrentController() - obj = co.getOwner() - act = co.getActuator("LOD." + obj.name) - cam = GameLogic.getCurrentScene().active_camera - - def Depth(pos, plane): - return pos[0]*plane[0] + pos[1]*plane[1] + pos[2]*plane[2] + plane[3] - - # Depth is negative and decreasing further from the camera - depth = Depth(obj.position, cam.world_to_camera[2]) - - newmesh = None - curmesh = None - # Find the lowest detail mesh for depth - for mesh in meshes: - if depth < mesh[1] and depth > mesh[2]: - newmesh = mesh - if "ME" + obj.name + mesh[0] == act.getMesh(): - curmesh = mesh - - if newmesh != None and "ME" + obj.name + newmesh[0] != act.getMesh(): - # The mesh is a different mesh - switch it. - # Check the current mesh is not a better fit. - if curmesh == None or curmesh[1] < depth or curmesh[2] > depth: - act.setMesh(obj.getName() + newmesh[0]) - GameLogic.addActiveActuator(act, True) - - @warning: Replace mesh actuators will be ignored if at game start, the - named mesh doesn't exist. - - This will generate a warning in the console: - - C{ERROR: GameObject I{OBName} ReplaceMeshActuator I{ActuatorName} without object} - - @ivar mesh: L{KX_MeshProxy} or the name of the mesh that will replace the current one - Set to None to disable actuator - @type mesh: L{KX_MeshProxy} or None if no mesh is set - """ - def setMesh(name): - """ - DEPRECATED: Use the mesh property instead. - Sets the name of the mesh that will replace the current one. - When the name is None it will unset the mesh value so no action is taken. - - @type name: string or None - """ - def getMesh(): - """ - DEPRECATED: Use the mesh property instead. - Returns the name of the mesh that will replace the current one. - - Returns None if no mesh has been scheduled to be added. - - @rtype: string or None - """ - def instantReplaceMesh(): - """ - Immediately replace mesh without delay. - @rtype: None - """ \ No newline at end of file diff --git a/source/gameengine/PyDoc/KX_Scene.py b/source/gameengine/PyDoc/KX_Scene.py deleted file mode 100644 index 4fe150be898..00000000000 --- a/source/gameengine/PyDoc/KX_Scene.py +++ /dev/null @@ -1,97 +0,0 @@ -# $Id$ -# Documentation for KX_Scene.py - -from PyObjectPlus import * - -class KX_Scene(PyObjectPlus): - """ - Scene. - - The activity culling stuff is supposed to disable logic bricks when their owner gets too far - from the active camera. It was taken from some code lurking at the back of KX_Scene - who knows - what it does! - - Example:: - import GameLogic - - # get the scene - scene = GameLogic.getCurrentScene() - - # print all the objects in the scene - for obj in scene.objects: - print obj.name - - # get an object named 'Cube' - obj = scene.objects["OBCube"] - - # get the first object in the scene. - obj = scene.objects[0] - - Example:: - # Get the depth of an object in the camera view. - import GameLogic - - obj = GameLogic.getCurrentController().getOwner() - cam = GameLogic.getCurrentScene().active_camera - - # Depth is negative and decreasing further from the camera - depth = obj.position[0]*cam.world_to_camera[2][0] + obj.position[1]*cam.world_to_camera[2][1] + obj.position[2]*cam.world_to_camera[2][2] + cam.world_to_camera[2][3] - - @bug: All attributes are read only at the moment. - - @ivar name: The scene's name - @type name: string - @ivar objects: A list of objects in the scene. - @type objects: L{CListValue} of L{KX_GameObject} - @ivar objects_inactive: A list of objects on background layers (used for the addObject actuator). - @type objects_inactive: L{CListValue} of L{KX_GameObject} - @ivar lights: A list of lights in the scene. - @type lights: L{CListValue} of L{KX_GameObject} - @ivar cameras: A list of cameras in the scene. - @type cameras: L{CListValue} of L{KX_GameObject} - @ivar active_camera: The current active camera - @type active_camera: L{KX_Camera} - @ivar suspended: True if the scene is suspended. - @type suspended: boolean - @ivar activity_culling: True if the scene is activity culling - @type activity_culling: boolean - @ivar activity_culling_radius: The distance outside which to do activity culling. Measured in manhattan distance. - @type activity_culling_radius: float - @group Deprecated: getLightList, getObjectList, getName - """ - - def getLightList(): - """ - DEPRECATED: use the 'lights' property. - Returns the list of lights in the scene. - - @rtype: list [L{KX_LightObject}] - """ - def getObjectList(): - """ - DEPRECATED: use the 'objects' property. - Returns the list of objects in the scene. - - @rtype: list [L{KX_GameObject}] - """ - def getName(): - """ - DEPRECATED: use the 'name' property. - Returns the name of the scene. - - @rtype: string - """ - - def addObject(object, other, time=0): - """ - Adds an object to the scene like the Add Object Actuator would, and returns the created object. - - @param object: The object to add - @type object: L{KX_GameObject} or string - @param other: The object's center to use when adding the object - @type other: L{KX_GameObject} or string - @param time: The lifetime of the added object, in frames. A time of 0 means the object will last forever. - @type time: int - - @rtype: L{KX_GameObject} - """ diff --git a/source/gameengine/PyDoc/KX_SceneActuator.py b/source/gameengine/PyDoc/KX_SceneActuator.py deleted file mode 100644 index 937c94c91e6..00000000000 --- a/source/gameengine/PyDoc/KX_SceneActuator.py +++ /dev/null @@ -1,71 +0,0 @@ -# $Id$ -# Documentation for KX_SceneActuator -from SCA_IActuator import * - -class KX_SceneActuator(SCA_IActuator): - """ - Scene Actuator logic brick. - - @warning: Scene actuators that use a scene name will be ignored if at game start, the - named scene doesn't exist or is empty - - This will generate a warning in the console: - - C{ERROR: GameObject I{OBName} has a SceneActuator I{ActuatorName} (SetScene) without scene} - - @ivar scene: the name of the scene to change to/overlay/underlay/remove/suspend/resume - @type scene: string. - @ivar camera: the camera to change to. - When setting the attribute, you can use either a L{KX_Camera} or the name of the camera. - @type camera: L{KX_Camera} on read, string or L{KX_Camera} on write - @ivar useRestart: Set flag to True to restart the sene - @type useRestart: bool - @ivar mode: The mode of the actuator - @type mode: int from 0 to 5 L{GameLogic.Scene Actuator} - """ - def setUseRestart(flag): - """ - DEPRECATED: use the useRestart property instead - Set flag to True to restart the scene. - - @type flag: boolean - """ - def setScene(scene): - """ - DEPRECATED: use the scene property instead - Sets the name of the scene to change to/overlay/underlay/remove/suspend/resume. - - @type scene: string - """ - def setCamera(camera): - """ - DEPRECATED: use the camera property instead - Sets the camera to change to. - - Camera can be either a L{KX_Camera} or the name of the camera. - - @type camera: L{KX_Camera} or string - """ - def getUseRestart(): - """ - DEPRECATED: use the useRestart property instead - Returns True if the scene will be restarted. - - @rtype: boolean - """ - def getScene(): - """ - DEPRECATED: use the scene property instead - Returns the name of the scene to change to/overlay/underlay/remove/suspend/resume. - - Returns an empty string ("") if no scene has been set. - - @rtype: string - """ - def getCamera(): - """ - DEPRECATED: use the camera property instead - Returns the name of the camera to change to. - - @rtype: string - """ diff --git a/source/gameengine/PyDoc/KX_SoundActuator.py b/source/gameengine/PyDoc/KX_SoundActuator.py deleted file mode 100644 index 0aec57c851c..00000000000 --- a/source/gameengine/PyDoc/KX_SoundActuator.py +++ /dev/null @@ -1,195 +0,0 @@ -# $Id$ -# Documentation for KX_SoundActuator -from SCA_IActuator import * - -class KX_SoundActuator(SCA_IActuator): - """ - Sound Actuator. - - The L{startSound()}, L{pauseSound()} and L{stopSound()} do not require - the actuator to be activated - they act instantly provided that the actuator has - been activated once at least. - - @ivar filename: Sets the filename of the sound this actuator plays. - @type filename: string - - @ivar volume: Sets the volume (gain) of the sound. - @type volume: float - - @ivar pitch: Sets the pitch of the sound. - @type pitch: float - - @ivar rollOffFactor: Sets the roll off factor. Rolloff defines the rate of attenuation as the sound gets further away. - @type rollOffFactor: float - - @ivar looping: Sets the loop mode of the actuator. - @type looping: integer - - @ivar position: Sets the position of the sound. - @type position: float array - - @ivar velocity: Sets the speed of the sound; The speed of the sound alter the pitch. - @type velocity: float array - - @ivar orientation: Sets the orientation of the sound. When setting the orientation you can - also use quaternion [float,float,float,float] or euler angles [float,float,float] - @type orientation: 3x3 matrix [[float]] - - @ivar type: Sets the operation mode of the actuator. You can use one of the following constant: - - KX_SOUNDACT_PLAYSTOP (1) - - KX_SOUNDACT_PLAYEND (2) - - KX_SOUNDACT_LOOPSTOP (3) - - KX_SOUNDACT_LOOPEND (4) - - KX_SOUNDACT_LOOPBIDIRECTIONAL (5) - - KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP (6) - @type type: integer - - @group Play Methods: startSound, pauseSound, stopSound - """ - def setFilename(filename): - """ - DEPRECATED: Use the filename property instead. - Sets the filename of the sound this actuator plays. - - @type filename: string - """ - def getFilename(): - """ - DEPRECATED: Use the filename property instead. - Returns the filename of the sound this actuator plays. - - @rtype: string - """ - def startSound(): - """ - Starts the sound. - """ - def pauseSound(): - """ - Pauses the sound. - """ - def stopSound(): - """ - Stops the sound. - """ - def setGain(gain): - """ - DEPRECATED: Use the volume property instead - Sets the gain (volume) of the sound - - @type gain: float - @param gain: 0.0 (quiet) <= gain <= 1.0 (loud) - """ - def getGain(): - """ - DEPRECATED: Use the volume property instead. - Gets the gain (volume) of the sound. - - @rtype: float - """ - def setPitch(pitch): - """ - DEPRECATED: Use the pitch property instead. - Sets the pitch of the sound. - - @type pitch: float - """ - def getPitch(): - """ - DEPRECATED: Use the pitch property instead. - Returns the pitch of the sound. - - @rtype: float - """ - def setRollOffFactor(rolloff): - """ - DEPRECATED: Use the rollOffFactor property instead. - Sets the rolloff factor for the sounds. - - Rolloff defines the rate of attenuation as the sound gets further away. - Higher rolloff factors shorten the distance at which the sound can be heard. - - @type rolloff: float - """ - def getRollOffFactor(): - """ - DEPRECATED: Use the rollOffFactor property instead. - Returns the rolloff factor for the sound. - - @rtype: float - """ - def setLooping(loop): - """ - DEPRECATED: Use the looping property instead. - Sets the loop mode of the actuator. - - @bug: There are no constants defined for this method! - @param loop: - Play Stop 1 - - Play End 2 - - Loop Stop 3 - - Loop End 4 - - Bidirection Stop 5 - - Bidirection End 6 - @type loop: integer - """ - def getLooping(): - """ - DEPRECATED: Use the looping property instead. - Returns the current loop mode of the actuator. - - @rtype: integer - """ - def setPosition(x, y, z): - """ - DEPRECATED: Use the position property instead. - Sets the position this sound will come from. - - @type x: float - @param x: The x coordinate of the sound. - @type y: float - @param y: The y coordinate of the sound. - @type z: float - @param z: The z coordinate of the sound. - """ - def setVelocity(vx, vy, vz): - """ - DEPRECATED: Use the velocity property instead. - Sets the velocity this sound is moving at. - - The sound's pitch is determined from the velocity. - - @type vx: float - @param vx: The vx coordinate of the sound. - @type vy: float - @param vy: The vy coordinate of the sound. - @type vz: float - @param vz: The vz coordinate of the sound. - """ - def setOrientation(o11, o12, o13, o21, o22, o23, o31, o32, o33): - """ - DEPRECATED: Use the orientation property instead. - Sets the orientation of the sound. - - The nine parameters specify a rotation matrix:: - | o11, o12, o13 | - | o21, o22, o23 | - | o31, o32, o33 | - """ - - def setType(mode): - """ - DEPRECATED: Use the type property instead. - Sets the operation mode of the actuator. - - @param mode: KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP - @type mode: integer - """ - - def getType(): - """ - DEPRECATED: Use the type property instead. - Returns the operation mode of the actuator. - - @rtype: integer - @return: KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP - """ diff --git a/source/gameengine/PyDoc/KX_StateActuator.py b/source/gameengine/PyDoc/KX_StateActuator.py deleted file mode 100644 index d9785ad13fa..00000000000 --- a/source/gameengine/PyDoc/KX_StateActuator.py +++ /dev/null @@ -1,44 +0,0 @@ -# $Id$ -# Documentation for KX_StateActuator -from SCA_IActuator import * - -class KX_StateActuator(SCA_IActuator): - """ - State actuator changes the state mask of parent object. - - Property: - - @ivar operation: type of bit operation to be applied on object state mask. - You can use one of the following constant: - - KX_STATE_OP_CPY (0) : Copy state mask - - KX_STATE_OP_SET (1) : Add bits to state mask - - KX_STATE_OP_CLR (2) : Substract bits to state mask - - KX_STATE_OP_NEG (3) : Invert bits to state mask - @type operation: integer - - @ivar mask: value that defines the bits that will be modified by the operation. - The bits that are 1 in the mask will be updated in the object state, - the bits that are 0 are will be left unmodified expect for the Copy operation - which copies the mask to the object state - @type mask: integer - """ - def setOperation(op): - """ - DEPRECATED: Use the operation property instead. - Set the type of bit operation to be applied on object state mask. - Use setMask() to specify the bits that will be modified. - - @param op: bit operation (0=Copy, 1=Add, 2=Substract, 3=Invert) - @type op: integer - """ - def setMask(mask): - """ - DEPRECATED: Use the mask property instead. - Set the value that defines the bits that will be modified by the operation. - The bits that are 1 in the value will be updated in the object state, - the bits that are 0 are will be left unmodified expect for the Copy operation - which copies the value to the object state. - - @param mask: bits that will be modified - @type mask: integer - """ diff --git a/source/gameengine/PyDoc/KX_TouchSensor.py b/source/gameengine/PyDoc/KX_TouchSensor.py deleted file mode 100644 index f4fcbeefc62..00000000000 --- a/source/gameengine/PyDoc/KX_TouchSensor.py +++ /dev/null @@ -1,63 +0,0 @@ -# $Id$ -# Documentation for KX_TouchSensor -from SCA_ISensor import * -from KX_GameObject import * - -class KX_TouchSensor(SCA_ISensor): - """ - Touch sensor detects collisions between objects. - - @ivar property: The property or material to collide with. - @type property: string - @ivar useMaterial: Determines if the sensor is looking for a property or material. - KX_True = Find material; KX_False = Find property - @type useMaterial: boolean - @ivar pulseCollisions: The last collided object. - @type pulseCollisions: bool - @ivar objectHit: The last collided object. (Read Only) - @type objectHit: L{KX_GameObject} or None - @ivar objectHitList: A list of colliding objects. (Read Only) - @type objectHitList: L{CListValue} of L{KX_GameObject} - """ - - #--The following methods are deprecated, please use properties instead. - def setProperty(name): - """ - DEPRECATED: use the property property - Set the property or material to collide with. Use - setTouchMaterial() to switch between properties and - materials. - @type name: string - """ - - def getProperty(): - """ - DEPRECATED: use the property property - Returns the property or material to collide with. Use - getTouchMaterial() to find out whether this sensor - looks for properties or materials. (B{deprecated}) - - @rtype: string - """ - def getHitObject(): - """ - DEPRECATED: use the objectHit property - Returns the last object hit by this touch sensor. (B{deprecated}) - - @rtype: L{KX_GameObject} - """ - def getHitObjectList(): - """ - DEPRECATED: use the objectHitList property - Returns a list of all objects hit in the last frame. (B{deprecated}) - - Only objects that have the requisite material/property are listed. - - @rtype: L{CListValue} of L{KX_GameObject} - """ - def getTouchMaterial(): - """ - DEPRECATED: use the useMaterial property - Returns KX_TRUE if this sensor looks for a specific material, - KX_FALSE if it looks for a specific property. (B{deprecated}) - """ diff --git a/source/gameengine/PyDoc/KX_TrackToActuator.py b/source/gameengine/PyDoc/KX_TrackToActuator.py deleted file mode 100644 index ee2dc5d6144..00000000000 --- a/source/gameengine/PyDoc/KX_TrackToActuator.py +++ /dev/null @@ -1,70 +0,0 @@ -# $Id$ -# Documentation for KX_TrackToActuator -from SCA_IActuator import * - -class KX_TrackToActuator(SCA_IActuator): - """ - Edit Object actuator in Track To mode. - - @warning: Track To Actuators will be ignored if at game start, the - object to track to is invalid. - - This will generate a warning in the console: - - C{ERROR: GameObject I{OBName} no object in EditObjectActuator I{ActuatorName}} - - @ivar object: the object this actuator tracks. - @type object: KX_GameObject or None - @ivar time: the time in frames with which to delay the tracking motion - @type time: integer - @ivar use3D: the tracking motion to use 3D - @type use3D: boolean - - """ - def setObject(object): - """ - DEPRECATED: Use the object property. - Sets the object to track. - - @type object: L{KX_GameObject}, string or None - @param object: Either a reference to a game object or the name of the object to track. - """ - def getObject(name_only): - """ - DEPRECATED: Use the object property. - Returns the name of the object to track. - - @type name_only: bool - @param name_only: optional argument, when 0 return a KX_GameObject - @rtype: string, KX_GameObject or None if no object is set - """ - def setTime(time): - """ - DEPRECATED: Use the time property. - Sets the time in frames with which to delay the tracking motion. - - @type time: integer - """ - def getTime(): - """ - DEPRECATED: Use the time property. - Returns the time in frames with which the tracking motion is delayed. - - @rtype: integer - """ - def setUse3D(use3d): - """ - DEPRECATED: Use the use3D property. - Sets the tracking motion to use 3D. - - @type use3d: boolean - @param use3d: - True: allow the tracking motion to extend in the z-direction. - - False: lock the tracking motion to the x-y plane. - """ - def getUse3D(): - """ - DEPRECATED: Use the use3D property. - Returns True if the tracking motion will track in the z direction. - - @rtype: boolean - """ diff --git a/source/gameengine/PyDoc/KX_VehicleWrapper.py b/source/gameengine/PyDoc/KX_VehicleWrapper.py deleted file mode 100644 index 86991634f2d..00000000000 --- a/source/gameengine/PyDoc/KX_VehicleWrapper.py +++ /dev/null @@ -1,160 +0,0 @@ -from PyObjectPlus import * - -class KX_VehicleWrapper(PyObjectPlus): - """ - KX_VehicleWrapper - - TODO - description - """ - - def addWheel(wheel, attachPos, attachDir, axleDir, suspensionRestLength, wheelRadius, hasSteering): - - """ - Add a wheel to the vehicle - - @param wheel: The object to use as a wheel. - @type wheel: L{KX_GameObject} or a KX_GameObject name - @param attachPos: The position that this wheel will attach to. - @type attachPos: vector of 3 floats - @param attachDir: The direction this wheel points. - @type attachDir: vector of 3 floats - @param axleDir: The direction of this wheels axle. - @type axleDir: vector of 3 floats - @param suspensionRestLength: TODO - Description - @type suspensionRestLength: float - @param wheelRadius: The size of the wheel. - @type wheelRadius: float - """ - - def applyBraking(force, wheelIndex): - """ - Apply a braking force to the specified wheel - - @param force: the brake force - @type force: float - - @param wheelIndex: index of the wheel where the force needs to be applied - @type wheelIndex: integer - """ - def applyEngineForce(force, wheelIndex): - """ - Apply an engine force to the specified wheel - - @param force: the engine force - @type force: float - - @param wheelIndex: index of the wheel where the force needs to be applied - @type wheelIndex: integer - """ - def getConstraintId(): - """ - Get the constraint ID - - @rtype: integer - @return: the constraint id - """ - def getConstraintType(): - """ - Returns the constraint type. - - @rtype: integer - @return: constraint type - """ - def getNumWheels(): - """ - Returns the number of wheels. - - @rtype: integer - @return: the number of wheels for this vehicle - """ - def getWheelOrientationQuaternion(wheelIndex): - """ - Returns the wheel orientation as a quaternion. - - @param wheelIndex: the wheel index - @type wheelIndex: integer - - @rtype: TODO - type should be quat as per method name but from the code it looks like a matrix - @return: TODO Description - """ - def getWheelPosition(wheelIndex): - """ - Returns the position of the specified wheel - - @param wheelIndex: the wheel index - @type wheelIndex: integer - - @rtype: list[x, y, z] - @return: position vector - """ - def getWheelRotation(wheelIndex): - """ - Returns the rotation of the specified wheel - - @param wheelIndex: the wheel index - @type wheelIndex: integer - - @rtype: float - @return: the wheel rotation - """ - def setRollInfluence(rollInfluece, wheelIndex): - """ - Set the specified wheel's roll influence. - The higher the roll influence the more the vehicle will tend to roll over in corners. - - @param rollInfluece: the wheel roll influence - @type rollInfluece: float - - @param wheelIndex: the wheel index - @type wheelIndex: integer - """ - def setSteeringValue(steering, wheelIndex): - """ - Set the specified wheel's steering - - @param steering: the wheel steering - @type steering: float - - @param wheelIndex: the wheel index - @type wheelIndex: integer - """ - def setSuspensionCompression(compression, wheelIndex): - """ - Set the specified wheel's compression - - @param compression: the wheel compression - @type compression: float - - @param wheelIndex: the wheel index - @type wheelIndex: integer - """ - def setSuspensionDamping(damping, wheelIndex): - """ - Set the specified wheel's damping - - @param damping: the wheel damping - @type damping: float - - @param wheelIndex: the wheel index - @type wheelIndex: integer - """ - def setSuspensionStiffness(stiffness, wheelIndex): - """ - Set the specified wheel's stiffness - - @param stiffness: the wheel stiffness - @type stiffness: float - - @param wheelIndex: the wheel index - @type wheelIndex: integer - """ - def setTyreFriction(friction, wheelIndex): - """ - Set the specified wheel's tyre friction - - @param friction: the tyre friction - @type friction: float - - @param wheelIndex: the wheel index - @type wheelIndex: integer - """ diff --git a/source/gameengine/PyDoc/KX_VertexProxy.py b/source/gameengine/PyDoc/KX_VertexProxy.py deleted file mode 100644 index 75bd4d788a6..00000000000 --- a/source/gameengine/PyDoc/KX_VertexProxy.py +++ /dev/null @@ -1,152 +0,0 @@ -# $Id$ -# Documentation for the vertex proxy class - -from SCA_IObject import * - -class KX_VertexProxy(SCA_IObject): - """ - A vertex holds position, UV, colour and normal information. - - Note: - The physics simulation is NOT currently updated - physics will not respond - to changes in the vertex position. - - @ivar XYZ: The position of the vertex. - @type XYZ: list [x, y, z] - @ivar UV: The texture coordinates of the vertex. - @type UV: list [u, v] - @ivar normal: The normal of the vertex - @type normal: list [nx, ny, nz] - @ivar colour: The colour of the vertex. - Black = [0.0, 0.0, 0.0, 1.0], White = [1.0, 1.0, 1.0, 1.0] - @type colour: list [r, g, b, a] - @ivar color: Synonym for colour. - - @group Position: x, y, z - @ivar x: The x coordinate of the vertex. - @type x: float - @ivar y: The y coordinate of the vertex. - @type y: float - @ivar z: The z coordinate of the vertex. - @type z: float - - @group Texture Coordinates: u, v - @ivar u: The u texture coordinate of the vertex. - @type u: float - @ivar v: The v texture coordinate of the vertex. - @type v: float - - @ivar u2: The second u texture coordinate of the vertex. - @type u2: float - @ivar v2: The second v texture coordinate of the vertex. - @type v2: float - - @group Colour: r, g, b, a - @ivar r: The red component of the vertex colour. 0.0 <= r <= 1.0 - @type r: float - @ivar g: The green component of the vertex colour. 0.0 <= g <= 1.0 - @type g: float - @ivar b: The blue component of the vertex colour. 0.0 <= b <= 1.0 - @type b: float - @ivar a: The alpha component of the vertex colour. 0.0 <= a <= 1.0 - @type a: float - """ - - def getXYZ(): - """ - Gets the position of this vertex. - - @rtype: list [x, y, z] - @return: this vertexes position in local coordinates. - """ - def setXYZ(pos): - """ - Sets the position of this vertex. - - @type pos: list [x, y, z] - @param pos: the new position for this vertex in local coordinates. - """ - def getUV(): - """ - Gets the UV (texture) coordinates of this vertex. - - @rtype: list [u, v] - @return: this vertexes UV (texture) coordinates. - """ - def setUV(uv): - """ - Sets the UV (texture) coordinates of this vertex. - - @type uv: list [u, v] - """ - def getUV2(): - """ - Gets the 2nd UV (texture) coordinates of this vertex. - - @rtype: list [u, v] - @return: this vertexes UV (texture) coordinates. - """ - def setUV2(uv, unit): - """ - Sets the 2nd UV (texture) coordinates of this vertex. - - @type uv: list [u, v] - @param unit: optional argument, FLAT==1, SECOND_UV==2, defaults to SECOND_UV - @param unit: int - """ - def getRGBA(): - """ - Gets the colour of this vertex. - - The colour is represented as four bytes packed into an integer value. The colour is - packed as RGBA. - - Since Python offers no way to get each byte without shifting, you must use the struct module to - access colour in an machine independent way. - - Because of this, it is suggested you use the r, g, b and a attributes or the colour attribute instead. - - Example:: - import struct; - col = struct.unpack('4B', struct.pack('I', v.getRGBA())) - # col = (r, g, b, a) - # black = ( 0, 0, 0, 255) - # white = (255, 255, 255, 255) - - @rtype: integer - @return: packed colour. 4 byte integer with one byte per colour channel in RGBA format. - """ - def setRGBA(col): - """ - Sets the colour of this vertex. - - See getRGBA() for the format of col, and its relevant problems. Use the r, g, b and a attributes - or the colour attribute instead. - - setRGBA() also accepts a four component list as argument col. The list represents the colour as [r, g, b, a] - with black = [0.0, 0.0, 0.0, 1.0] and white = [1.0, 1.0, 1.0, 1.0] - - Example:: - v.setRGBA(0xff0000ff) # Red - v.setRGBA(0xff00ff00) # Green on little endian, transparent purple on big endian - v.setRGBA([1.0, 0.0, 0.0, 1.0]) # Red - v.setRGBA([0.0, 1.0, 0.0, 1.0]) # Green on all platforms. - - @type col: integer or list [r, g, b, a] - @param col: the new colour of this vertex in packed RGBA format. - """ - def getNormal(): - """ - Gets the normal vector of this vertex. - - @rtype: list [nx, ny, nz] - @return: normalised normal vector. - """ - def setNormal(normal): - """ - Sets the normal vector of this vertex. - - @type normal: sequence of floats [r, g, b] - @param normal: the new normal of this vertex. - """ - diff --git a/source/gameengine/PyDoc/KX_VisibilityActuator.py b/source/gameengine/PyDoc/KX_VisibilityActuator.py deleted file mode 100644 index 36f25b2423c..00000000000 --- a/source/gameengine/PyDoc/KX_VisibilityActuator.py +++ /dev/null @@ -1,22 +0,0 @@ -# $Id$ -# Documentation for KX_VisibilityActuator -from SCA_IActuator import * - -class KX_VisibilityActuator(SCA_IActuator): - """ - Visibility Actuator. - @ivar visibility: whether the actuator makes its parent object visible or invisible - @type visibility: boolean - @ivar occlusion: whether the actuator makes its parent object an occluder or not - @type occlusion: boolean - @ivar recursion: whether the visibility/occlusion should be propagated to all children of the object - @type recursion: boolean - """ - def set(visible): - """ - DEPRECATED: Use the visibility property instead. - Sets whether the actuator makes its parent object visible or invisible. - - @param visible: - True: Makes its parent visible. - - False: Makes its parent invisible. - """ diff --git a/source/gameengine/PyDoc/PyObjectPlus.py b/source/gameengine/PyDoc/PyObjectPlus.py deleted file mode 100644 index 1750bcb6ca1..00000000000 --- a/source/gameengine/PyDoc/PyObjectPlus.py +++ /dev/null @@ -1,26 +0,0 @@ -# -# Documentation for PyObjectPlus base class - -class PyObjectPlus: - """ - PyObjectPlus base class of most other types in the Game Engine. - - @ivar invalid: Test if the object has been freed by the game engine and is no longer valid. - - Normally this is not a problem but when storing game engine data in the GameLogic module, - KX_Scenes or other KX_GameObjects its possible to hold a reference to invalid data. - Calling an attribute or method on an invalid object will raise a SystemError. - - The invalid attribute allows testing for this case without exception handling. - @type invalid: bool - """ - - def isA(game_type): - """ - Check if this is a type or a subtype game_type. - - @param game_type: the name of the type or the type its self from the L{GameTypes} module. - @type game_type: string or type - @return: True if this object is a type or a subtype of game_type. - @rtype: bool - """ diff --git a/source/gameengine/PyDoc/SCA_2DFilterActuator.py b/source/gameengine/PyDoc/SCA_2DFilterActuator.py deleted file mode 100644 index 9a010e8f221..00000000000 --- a/source/gameengine/PyDoc/SCA_2DFilterActuator.py +++ /dev/null @@ -1,44 +0,0 @@ -# $Id$ -# Documentation for SCA_2DFilterActuator -from SCA_IActuator import * -from SCA_ILogicBrick import * - -class SCA_2DFilterActuator(SCA_IActuator): - """ - Create, enable and disable 2D filters - - Properties: - - The following properties don't have an immediate effect. - You must active the actuator to get the result. - The actuator is not persistent: it automatically stops itself after setting up the filter - but the filter remains active. To stop a filter you must activate the actuator with 'type' - set to RAS_2DFILTER_DISABLED or RAS_2DFILTER_NOFILTER. - - @ivar shaderText: shader source code for custom shader - @type shaderText: string - @ivar disableMotionBlur: action on motion blur: 0=enable, 1=disable - @type disableMotionBlur: integer - @ivar type: type of 2D filter, use one of the following constants: - RAS_2DFILTER_ENABLED (-2) : enable the filter that was previously disabled - RAS_2DFILTER_DISABLED (-1) : disable the filter that is currently active - RAS_2DFILTER_NOFILTER (0) : disable and destroy the filter that is currently active - RAS_2DFILTER_MOTIONBLUR (1) : create and enable preset filters - RAS_2DFILTER_BLUR (2) - RAS_2DFILTER_SHARPEN (3) - RAS_2DFILTER_DILATION (4) - RAS_2DFILTER_EROSION (5) - RAS_2DFILTER_LAPLACIAN (6) - RAS_2DFILTER_SOBEL (7) - RAS_2DFILTER_PREWITT (8) - RAS_2DFILTER_GRAYSCALE (9) - RAS_2DFILTER_SEPIA (10) - RAS_2DFILTER_INVERT (11) - RAS_2DFILTER_CUSTOMFILTER (12) : customer filter, the code code is set via shaderText property - @type type: integer - @ivar passNb: order number of filter in the stack of 2D filters. Filters are executed in increasing order of passNb. - Only be one filter can be defined per passNb. - @type passNb: integer (0-100) - @ivar value: argument for motion blur filter - @type value: float (0.0-100.0) - """ diff --git a/source/gameengine/PyDoc/SCA_ANDController.py b/source/gameengine/PyDoc/SCA_ANDController.py deleted file mode 100644 index 1717e613595..00000000000 --- a/source/gameengine/PyDoc/SCA_ANDController.py +++ /dev/null @@ -1,11 +0,0 @@ -# $Id$ -# Documentation for SCA_ANDController -from SCA_IController import * - -class SCA_ANDController(SCA_IController): - """ - An AND controller activates only when all linked sensors are activated. - - There are no special python methods for this controller. - """ - diff --git a/source/gameengine/PyDoc/SCA_ActuatorSensor.py b/source/gameengine/PyDoc/SCA_ActuatorSensor.py deleted file mode 100644 index 515354e8716..00000000000 --- a/source/gameengine/PyDoc/SCA_ActuatorSensor.py +++ /dev/null @@ -1,33 +0,0 @@ -# $Id$ -# Documentation for SCA_ActuatorSensor -from SCA_IActuator import * -from SCA_ISensor import * -from SCA_ILogicBrick import * - -class SCA_ActuatorSensor(SCA_ISensor): - """ - Actuator sensor detect change in actuator state of the parent object. - It generates a positive pulse if the corresponding actuator is activated - and a negative pulse if the actuator is deactivated. - - Properties: - - @ivar actuator: the name of the actuator that the sensor is monitoring. - @type actuator: string - """ - def getActuator(): - """ - DEPRECATED: use the actuator property - Return the Actuator with which the sensor operates. - - @rtype: string - """ - def setActuator(name): - """ - DEPRECATED: use the actuator property - Sets the Actuator with which to operate. If there is no Actuator - of this name, the function has no effect. - - @param name: actuator name - @type name: string - """ diff --git a/source/gameengine/PyDoc/SCA_AlwaysSensor.py b/source/gameengine/PyDoc/SCA_AlwaysSensor.py deleted file mode 100644 index 54ab07a8a99..00000000000 --- a/source/gameengine/PyDoc/SCA_AlwaysSensor.py +++ /dev/null @@ -1,9 +0,0 @@ -# $Id$ -# Documentation for SCA_AlwaysSensor -from SCA_ISensor import * - -class SCA_AlwaysSensor(SCA_ISensor): - """ - This sensor is always activated. - """ - diff --git a/source/gameengine/PyDoc/SCA_DelaySensor.py b/source/gameengine/PyDoc/SCA_DelaySensor.py deleted file mode 100644 index 6560df6573e..00000000000 --- a/source/gameengine/PyDoc/SCA_DelaySensor.py +++ /dev/null @@ -1,72 +0,0 @@ -# $Id$ -# Documentation for SCA_DelaySensor -from SCA_ISensor import * - -class SCA_DelaySensor(SCA_ISensor): - """ - The Delay sensor generates positive and negative triggers at precise time, - expressed in number of frames. The delay parameter defines the length - of the initial OFF period. A positive trigger is generated at the end of this period. - The duration parameter defines the length of the ON period following the OFF period. - There is a negative trigger at the end of the ON period. If duration is 0, the sensor - stays ON and there is no negative trigger. - The sensor runs the OFF-ON cycle once unless the repeat option is set: the - OFF-ON cycle repeats indefinately (or the OFF cycle if duration is 0). - Use SCA_ISensor::reset() at any time to restart sensor. - - Properties: - - @ivar delay: length of the initial OFF period as number of frame, 0 for immediate trigger. - @type delay: integer. - @ivar duration: length of the ON period in number of frame after the initial OFF period. - If duration is greater than 0, a negative trigger is sent at the end of the ON pulse. - @type duration: integer - @ivar repeat: 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once. - @type repeat: integer - """ - def setDelay(delay): - """ - DEPRECATED: use the delay property - Set the initial delay before the positive trigger. - - @param delay: length of the initial OFF period as number of frame, 0 for immediate trigger - @type delay: integer - """ - def setDuration(duration): - """ - DEPRECATED: use the duration property - Set the duration of the ON pulse after initial delay and the generation of the positive trigger. - If duration is greater than 0, a negative trigger is sent at the end of the ON pulse. - - @param duration: length of the ON period in number of frame after the initial OFF period - @type duration: integer - """ - def setRepeat(repeat): - """ - DEPRECATED: use the repeat property - Set if the sensor repeat mode. - - @param repeat: 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once. - @type repeat: integer - """ - def getDelay(): - """ - DEPRECATED: use the delay property - Return the delay parameter value. - - @rtype: integer - """ - def getDuration(): - """ - DEPRECATED: use the duration property - Return the duration parameter value - - @rtype: integer - """ - def getRepeat(): - """ - DEPRECATED: use the repeat property - Return the repeat parameter value - - @rtype: KX_TRUE or KX_FALSE - """ diff --git a/source/gameengine/PyDoc/SCA_IActuator.py b/source/gameengine/PyDoc/SCA_IActuator.py deleted file mode 100644 index ac47c15dc78..00000000000 --- a/source/gameengine/PyDoc/SCA_IActuator.py +++ /dev/null @@ -1,9 +0,0 @@ -# $Id$ -# Documentation for SCA_IActuator -from SCA_ILogicBrick import * - -class SCA_IActuator(SCA_ILogicBrick): - """ - Base class for all actuator logic bricks. - """ - diff --git a/source/gameengine/PyDoc/SCA_IController.py b/source/gameengine/PyDoc/SCA_IController.py deleted file mode 100644 index cfb4c18a826..00000000000 --- a/source/gameengine/PyDoc/SCA_IController.py +++ /dev/null @@ -1,63 +0,0 @@ -# $Id$ -# Documentation for KX_CameraActuator -from SCA_ILogicBrick import * - -class SCA_IController(SCA_ILogicBrick): - """ - Base class for all controller logic bricks. - - @ivar state: the controllers state bitmask. - This can be used with the GameObject's state to test if the controller is active. - @type state: int bitmask - @ivar sensors: a list of sensors linked to this controller - - note: the sensors are not necessarily owned by the same object. - - note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup. - @type sensors: sequence supporting index/string lookups and iteration. - @ivar actuators: a list of actuators linked to this controller. - - note: the sensors are not necessarily owned by the same object. - - note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup. - @type actuators: sequence supporting index/string lookups and iteration. - - @group Deprecated: getState, getSensors, getActuators, getSensor, getActuator - """ - - def getState(): - """ - DEPRECATED: use the state property - Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active. - This for instance will always be true however you could compare with a previous state to see when the state was activated. - GameLogic.getCurrentController().getState() & GameLogic.getCurrentController().getOwner().getState() - - @rtype: int - """ - def getSensors(): - """ - DEPRECATED: use the sensors property - Gets a list of all sensors attached to this controller. - - @rtype: list [L{SCA_ISensor}] - """ - def getSensor(name): - """ - DEPRECATED: use the sensors[name] property - Gets the named linked sensor. - - @type name: string - @rtype: L{SCA_ISensor} - """ - def getActuators(): - """ - DEPRECATED: use the actuators property - Gets a list of all actuators linked to this controller. - - @rtype: list [L{SCA_IActuator}] - """ - def getActuator(name): - """ - DEPRECATED: use the actuators[name] property - Gets the named linked actuator. - - @type name: string - @rtype: L{SCA_IActuator} - """ - \ No newline at end of file diff --git a/source/gameengine/PyDoc/SCA_ILogicBrick.py b/source/gameengine/PyDoc/SCA_ILogicBrick.py deleted file mode 100644 index a96e77c3249..00000000000 --- a/source/gameengine/PyDoc/SCA_ILogicBrick.py +++ /dev/null @@ -1,49 +0,0 @@ -# $Id$ -# Documentation for the logic brick base class SCA_ILogicBrick -from KX_GameObject import * -from CValue import * - -class SCA_ILogicBrick(CValue): - """ - Base class for all logic bricks. - - @ivar executePriority: This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first). - @type executePriority: int - @ivar owner: The game object this logic brick is attached to (read only). - @type owner: L{KX_GameObject} or None in exceptional cases. - @ivar name: The name of this logic brick (read only). - @type name: string - @group Deprecated: getOwner, setExecutePriority, getExecutePriority - """ - - def getOwner(): - """ - Gets the game object associated with this logic brick. - - Deprecated: Use the "owner" property instead. - - @rtype: L{KX_GameObject} - """ - - #--The following methods are deprecated-- - def setExecutePriority(priority): - """ - Sets the priority of this logic brick. - - This determines the order controllers are evaluated, and actuators are activated. - Bricks with lower priority will be executed first. - - Deprecated: Use the "executePriority" property instead. - - @type priority: integer - @param priority: the priority of this logic brick. - """ - def getExecutePriority(): - """ - Gets the execution priority of this logic brick. - - Deprecated: Use the "executePriority" property instead. - - @rtype: integer - @return: this logic bricks current priority. - """ diff --git a/source/gameengine/PyDoc/SCA_IObject.py b/source/gameengine/PyDoc/SCA_IObject.py deleted file mode 100644 index 92e4884e815..00000000000 --- a/source/gameengine/PyDoc/SCA_IObject.py +++ /dev/null @@ -1,9 +0,0 @@ -# -# Documentation for SCA_IObject class - -from CValue import * -class SCA_IObject(CValue): - """ - This class has no python functions - """ - pass diff --git a/source/gameengine/PyDoc/SCA_ISensor.py b/source/gameengine/PyDoc/SCA_ISensor.py deleted file mode 100644 index 0b72548b103..00000000000 --- a/source/gameengine/PyDoc/SCA_ISensor.py +++ /dev/null @@ -1,112 +0,0 @@ -# $Id$ -# Documentation for SCA_ISensor -from SCA_ILogicBrick import * - -class SCA_ISensor(SCA_ILogicBrick): - """ - Base class for all sensor logic bricks. - - @ivar usePosPulseMode: Flag to turn positive pulse mode on and off. - @type usePosPulseMode: boolean - @ivar useNegPulseMode: Flag to turn negative pulse mode on and off. - @type useNegPulseMode: boolean - @ivar frequency: The frequency for pulse mode sensors. - @type frequency: int - @ivar level: Flag to set whether to detect level or edge transition when entering a state. - It makes a difference only in case of logic state transition (state actuator). - A level detector will immediately generate a pulse, negative or positive - depending on the sensor condition, as soon as the state is activated. - A edge detector will wait for a state change before generating a pulse. - @type level: boolean - @ivar invert: Flag to set if this sensor activates on positive or negative events. - @type invert: boolean - @ivar triggered: True if this sensor brick is in a positive state. (Read only) - @type triggered: boolean - @ivar positive: True if this sensor brick is in a positive state. (Read only) - @type positive: boolean - @group Deprecated: isPositive, isTriggered, getUsePosPulseMode, setUsePosPulseMode, getFrequency, setFrequency, getUseNegPulseMode, setUseNegPulseMode, getInvert, setInvert, getLevel, setLevel - """ - - def reset(): - """ - Reset sensor internal state, effect depends on the type of sensor and settings. - - The sensor is put in its initial state as if it was just activated. - """ - - #--The following methods are deprecated-- - def isPositive(): - """ - True if this sensor brick is in a positive state. - """ - - def isTriggered(): - """ - True if this sensor brick has triggered the current controller. - """ - - def getUsePosPulseMode(): - """ - True if the sensor is in positive pulse mode. - """ - def setUsePosPulseMode(pulse): - """ - Sets positive pulse mode. - - @type pulse: boolean - @param pulse: If True, will activate positive pulse mode for this sensor. - """ - def getFrequency(): - """ - The frequency for pulse mode sensors. - - @rtype: integer - @return: the pulse frequency in 1/50 sec. - """ - def setFrequency(freq): - """ - Sets the frequency for pulse mode sensors. - - @type freq: integer - @return: the pulse frequency in 1/50 sec. - """ - def getUseNegPulseMode(): - """ - True if the sensor is in negative pulse mode. - """ - def setUseNegPulseMode(pulse): - """ - Sets negative pulse mode. - - @type pulse: boolean - @param pulse: If True, will activate negative pulse mode for this sensor. - """ - def getInvert(): - """ - True if this sensor activates on negative events. - """ - def setInvert(invert): - """ - Sets if this sensor activates on positive or negative events. - - @type invert: boolean - @param invert: true if activates on negative events; false if activates on positive events. - """ - def getLevel(): - """ - Returns whether this sensor is a level detector or a edge detector. - It makes a difference only in case of logic state transition (state actuator). - A level detector will immediately generate a pulse, negative or positive - depending on the sensor condition, as soon as the state is activated. - A edge detector will wait for a state change before generating a pulse. - - @rtype: boolean - @return: true if sensor is level sensitive, false if it is edge sensitive - """ - def setLevel(level): - """ - Set whether to detect level or edge transition when entering a state. - - @param level: Detect level instead of edge? (KX_TRUE, KX_FALSE) - @type level: boolean - """ diff --git a/source/gameengine/PyDoc/SCA_JoystickSensor.py b/source/gameengine/PyDoc/SCA_JoystickSensor.py deleted file mode 100644 index 13b006e8dd6..00000000000 --- a/source/gameengine/PyDoc/SCA_JoystickSensor.py +++ /dev/null @@ -1,169 +0,0 @@ -# $Id$ -# Documentation for SCA_RandomSensor -from SCA_ISensor import * - -class SCA_JoystickSensor(SCA_ISensor): - """ - This sensor detects player joystick events. - - Properties: - - @ivar axisValues: (read-only) The state of the joysticks axis as a list of values L{numAxis} long. - each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing. - The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls. - left:[-32767, 0, ...], right:[32767, 0, ...], up:[0, -32767, ...], down:[0, 32767, ...] - @type axisValues: list of ints - - @ivar axisSingle: (read-only) like L{axisValues} but returns a single axis value that is set by the sensor. - Only use this for "Single Axis" type sensors otherwise it will raise an error. - @type axisSingle: int - - @ivar numAxis: (read-only) The number of axes for the joystick at this index. - @type numAxis: integer - @ivar numButtons: (read-only) The number of buttons for the joystick at this index. - @type numButtons: integer - @ivar numHats: (read-only) The number of hats for the joystick at this index. - @type numHats: integer - @ivar connected: (read-only) True if a joystick is connected at this joysticks index. - @type connected: boolean - @ivar index: The joystick index to use (from 0 to 7). The first joystick is always 0. - @type index: integer - @ivar threshold: Axis threshold. Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive. - @type threshold: integer - @ivar button: The button index the sensor reacts to (first button = 0). When the "All Events" toggle is set, this option has no effect. - @type button: integer - @ivar axis: The axis this sensor reacts to, as a list of two values [axisIndex, axisDirection] - axisIndex: the axis index to use when detecting axis movement, 1=primary directional control, 2=secondary directional control. - axisDirection: 0=right, 1=up, 2=left, 3=down - @type axis: [integer, integer] - @ivar hat: The hat the sensor reacts to, as a list of two values: [hatIndex, hatDirection] - hatIndex: the hat index to use when detecting hat movement, 1=primary hat, 2=secondary hat. - hatDirection: 0-11 - @type hat: [integer, integer] - """ - - def getButtonActiveList(): - """ - Returns a list containing the indicies of the currently pressed buttons. - @rtype: list - """ - def getButtonStatus(buttonIndex): - """ - Returns a bool of the current pressed state of the specified button. - @param buttonIndex: the button index, 0=first button - @type buttonIndex: integer - @rtype: bool - """ - def getIndex(): - """ - DEPRECATED: use the 'index' property. - Returns the joystick index to use (from 1 to 8). - @rtype: integer - """ - def setIndex(index): - """ - DEPRECATED: use the 'index' property. - Sets the joystick index to use. - @param index: The index of this joystick sensor, Clamped between 1 and 8. - @type index: integer - @note: This is only useful when you have more then 1 joystick connected to your computer - multiplayer games. - """ - def getAxis(): - """ - DEPRECATED: use the 'axis' property. - Returns the current axis this sensor reacts to. See L{getAxisValue()} for the current axis state. - @rtype: list - @return: 2 values returned are [axisIndex, axisDirection] - see L{setAxis()} for their purpose. - @note: When the "All Events" toggle is set, this option has no effect. - """ - def setAxis(axisIndex, axisDirection): - """ - DEPRECATED: use the 'axis' property. - @param axisIndex: Set the axis index to use when detecting axis movement. - @type axisIndex: integer from 1 to 2 - @param axisDirection: Set the axis direction used for detecting motion. 0:right, 1:up, 2:left, 3:down. - @type axisDirection: integer from 0 to 3 - @note: When the "All Events" toggle is set, this option has no effect. - """ - def getAxisValue(): - """ - DEPRECATED: use the 'axisPosition' property. - Returns the state of the joysticks axis. See differs to L{getAxis()} returning the current state of the joystick. - @rtype: list - @return: 4 values, each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing. - - The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls. - - left:[-32767, 0, ...], right:[32767, 0, ...], up:[0, -32767, ...], down:[0, 32767, ...] - @note: Some gamepads only set the axis on and off like a button. - """ - def getThreshold(): - """ - DEPRECATED: use the 'threshold' property. - Get the axis threshold. See L{setThreshold()} for details. - @rtype: integer - """ - def setThreshold(threshold): - """ - DEPRECATED: use the 'threshold' property. - Set the axis threshold. - @param threshold: Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive. - @type threshold: integer - """ - def getButton(): - """ - DEPRECATED: use the 'button' property. - Returns the button index the sensor reacts to. See L{getButtonValue()} for a list of pressed buttons. - @rtype: integer - @note: When the "All Events" toggle is set, this option has no effect. - """ - def setButton(index): - """ - DEPRECATED: use the 'button' property. - Sets the button index the sensor reacts to when the "All Events" option is not set. - @note: When the "All Events" toggle is set, this option has no effect. - """ - def getButtonValue(): - """ - DEPRECATED: use the 'getButtonActiveList' method. - Returns a list containing the indicies of the currently pressed buttons. - @rtype: list - """ - def getHat(): - """ - DEPRECATED: use the 'hat' property. - Returns the current hat direction this sensor is set to. - [hatNumber, hatDirection]. - @rtype: list - @note: When the "All Events" toggle is set, this option has no effect. - """ - def setHat(index,direction): - """ - DEPRECATED: use the 'hat' property. - Sets the hat index the sensor reacts to when the "All Events" option is not set. - @type index: integer - """ - def getNumAxes(): - """ - DEPRECATED: use the 'numAxis' property. - Returns the number of axes for the joystick at this index. - @rtype: integer - """ - def getNumButtons(): - """ - DEPRECATED: use the 'numButtons' property. - Returns the number of buttons for the joystick at this index. - @rtype: integer - """ - def getNumHats(): - """ - DEPRECATED: use the 'numHats' property. - Returns the number of hats for the joystick at this index. - @rtype: integer - """ - def isConnected(): - """ - DEPRECATED: use the 'connected' property. - Returns True if a joystick is detected at this joysticks index. - @rtype: bool - """ diff --git a/source/gameengine/PyDoc/SCA_KeyboardSensor.py b/source/gameengine/PyDoc/SCA_KeyboardSensor.py deleted file mode 100644 index 8abb1fda762..00000000000 --- a/source/gameengine/PyDoc/SCA_KeyboardSensor.py +++ /dev/null @@ -1,116 +0,0 @@ -# $Id$ -# Documentation for SCA_KeyboardSensor -from SCA_ISensor import * - -class SCA_KeyboardSensor(SCA_ISensor): - """ - A keyboard sensor detects player key presses. - - See module L{GameKeys} for keycode values. - - @ivar key: The key code this sensor is looking for. - @type key: keycode from L{GameKeys} module - @ivar hold1: The key code for the first modifier this sensor is looking for. - @type hold1: keycode from L{GameKeys} module - @ivar hold2: The key code for the second modifier this sensor is looking for. - @type hold2: keycode from L{GameKeys} module - @ivar toggleProperty: The name of the property that indicates whether or not to log keystrokes as a string. - @type toggleProperty: string - @ivar targetProperty: The name of the property that receives keystrokes in case in case a string is logged. - @type targetProperty: string - @ivar useAllKeys: Flag to determine whether or not to accept all keys. - @type useAllKeys: boolean - @ivar events: a list of pressed keys that have either been pressed, or just released, or are active this frame. (read only). - - - 'keycode' matches the values in L{GameKeys}. - - 'status' uses... - - L{GameLogic.KX_INPUT_NONE} - - L{GameLogic.KX_INPUT_JUST_ACTIVATED} - - L{GameLogic.KX_INPUT_ACTIVE} - - L{GameLogic.KX_INPUT_JUST_RELEASED} - - @type events: list [[keycode, status], ...] - """ - - def getKeyStatus(keycode): - """ - Get the status of a key. - - @rtype: key state L{GameLogic} members (KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED) - @return: The state of the given key - @type keycode: integer - @param keycode: The code that represents the key you want to get the state of - """ - - #--The following methods are DEPRECATED-- - def getKey(): - """ - Returns the key code this sensor is looking for. - - B{DEPRECATED: Use the "key" property instead}. - - @rtype: keycode from L{GameKeys} module - """ - - def setKey(keycode): - """ - Set the key this sensor should listen for. - - B{DEPRECATED: Use the "key" property instead}. - - @type keycode: keycode from L{GameKeys} module - """ - - def getHold1(): - """ - Returns the key code for the first modifier this sensor is looking for. - - B{DEPRECATED: Use the "hold1" property instead}. - - @rtype: keycode from L{GameKeys} module - """ - - def setHold1(keycode): - """ - Sets the key code for the first modifier this sensor should look for. - - B{DEPRECATED: Use the "hold1" property instead}. - - @type keycode: keycode from L{GameKeys} module - """ - - def getHold2(): - """ - Returns the key code for the second modifier this sensor is looking for. - - B{DEPRECATED: Use the "hold2" property instead}. - - @rtype: keycode from L{GameKeys} module - """ - - def setHold2(keycode): - """ - Sets the key code for the second modifier this sensor should look for. - - B{DEPRECATED: Use the "hold2" property instead.} - - @type keycode: keycode from L{GameKeys} module - """ - - def getPressedKeys(): - """ - Get a list of keys that have either been pressed, or just released this frame. - - B{DEPRECATED: Use "events" instead.} - - @rtype: list of key status. [[keycode, status]] - """ - - def getCurrentlyPressedKeys(): - """ - Get a list of currently pressed keys that have either been pressed, or just released - - B{DEPRECATED: Use "events" instead.} - - @rtype: list of key status. [[keycode, status]] - """ \ No newline at end of file diff --git a/source/gameengine/PyDoc/SCA_MouseSensor.py b/source/gameengine/PyDoc/SCA_MouseSensor.py deleted file mode 100644 index 278ebe63b8a..00000000000 --- a/source/gameengine/PyDoc/SCA_MouseSensor.py +++ /dev/null @@ -1,44 +0,0 @@ -# $Id$ -# Documentation for SCA_MouseSensor -from SCA_ISensor import * - -class SCA_MouseSensor(SCA_ISensor): - """ - Mouse Sensor logic brick. - - Properties: - - @ivar position: current [x,y] coordinates of the mouse, in frame coordinates (pixels) - @type position: [integer,interger] - @ivar mode: sensor mode: 1=KX_MOUSESENSORMODE_LEFTBUTTON 2=KX_MOUSESENSORMODE_MIDDLEBUTTON - 3=KX_MOUSESENSORMODE_RIGHTBUTTON 4=KX_MOUSESENSORMODE_WHEELUP - 5=KX_MOUSESENSORMODE_WHEELDOWN 9=KX_MOUSESENSORMODE_MOVEMENT - @type mode: integer - """ - - def getXPosition(): - """ - DEPRECATED: use the position property - Gets the x coordinate of the mouse. - - @rtype: integer - @return: the current x coordinate of the mouse, in frame coordinates (pixels) - """ - def getYPosition(): - """ - DEPRECATED: use the position property - Gets the y coordinate of the mouse. - - @rtype: integer - @return: the current y coordinate of the mouse, in frame coordinates (pixels). - """ - def getButtonStatus(button): - """ - Get the mouse button status. - - @type button: int - @param button: value in GameLogic members KX_MOUSE_BUT_LEFT, KX_MOUSE_BUT_MIDDLE, KX_MOUSE_BUT_RIGHT - - @rtype: integer - @return: value in GameLogic members KX_INPUT_NONE, KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED - """ diff --git a/source/gameengine/PyDoc/SCA_NANDController.py b/source/gameengine/PyDoc/SCA_NANDController.py deleted file mode 100644 index a864ff2981c..00000000000 --- a/source/gameengine/PyDoc/SCA_NANDController.py +++ /dev/null @@ -1,11 +0,0 @@ -# $Id$ -# Documentation for SCA_NANDController -from SCA_IController import * - -class SCA_NANDController(SCA_IController): - """ - An NAND controller activates when all linked sensors are not active. - - There are no special python methods for this controller. - """ - diff --git a/source/gameengine/PyDoc/SCA_NORController.py b/source/gameengine/PyDoc/SCA_NORController.py deleted file mode 100644 index 0bc0a71d7b1..00000000000 --- a/source/gameengine/PyDoc/SCA_NORController.py +++ /dev/null @@ -1,11 +0,0 @@ -# $Id$ -# Documentation for SCA_NORController -from SCA_IController import * - -class SCA_NORController(SCA_IController): - """ - An NOR controller activates only when all linked sensors are de-activated. - - There are no special python methods for this controller. - """ - diff --git a/source/gameengine/PyDoc/SCA_ORController.py b/source/gameengine/PyDoc/SCA_ORController.py deleted file mode 100644 index eeeb9de3afe..00000000000 --- a/source/gameengine/PyDoc/SCA_ORController.py +++ /dev/null @@ -1,11 +0,0 @@ -# $Id$ -# Documentation for SCA_ORController -from SCA_IController import * - -class SCA_ORController(SCA_IController): - """ - An OR controller activates when any connected sensor activates. - - There are no special python methods for this controller. - """ - diff --git a/source/gameengine/PyDoc/SCA_PropertyActuator.py b/source/gameengine/PyDoc/SCA_PropertyActuator.py deleted file mode 100644 index 52aefcae651..00000000000 --- a/source/gameengine/PyDoc/SCA_PropertyActuator.py +++ /dev/null @@ -1,49 +0,0 @@ -# $Id$ -# Documentation for SCA_PropertyActuator -from SCA_IActuator import * - -class SCA_PropertyActuator(SCA_IActuator): - """ - Property Actuator - - Properties: - - @ivar property: the property on which to operate. - @type property: string - @ivar value: the value with which the actuator operates. - @type value: string - """ - def setProperty(prop): - """ - DEPRECATED: use the 'property' property - Set the property on which to operate. - - If there is no property of this name, the call is ignored. - - @type prop: string - @param prop: The name of the property to set. - """ - def getProperty(): - """ - DEPRECATED: use the 'property' property - Returns the name of the property on which to operate. - - @rtype: string - """ - def setValue(value): - """ - DEPRECATED: use the 'value' property - Set the value with which the actuator operates. - - If the value is not compatible with the type of the - property, the subsequent action is ignored. - - @type value: string - """ - def getValue(): - """ - DEPRECATED: use the 'value' property - Gets the value with which this actuator operates. - - @rtype: string - """ diff --git a/source/gameengine/PyDoc/SCA_PropertySensor.py b/source/gameengine/PyDoc/SCA_PropertySensor.py deleted file mode 100644 index 949ffd3b703..00000000000 --- a/source/gameengine/PyDoc/SCA_PropertySensor.py +++ /dev/null @@ -1,74 +0,0 @@ -# $Id$ -# Documentation for SCA_PropertySensor -from SCA_ISensor import * - -class SCA_PropertySensor(SCA_ISensor): - """ - Activates when the game object property matches. - - Properties: - - @ivar type: type of check on the property: - KX_PROPSENSOR_EQUAL(1), KX_PROPSENSOR_NOTEQUAL(2), KX_PROPSENSOR_INTERVAL(3), - KX_PROPSENSOR_CHANGED(4), KX_PROPSENSOR_EXPRESSION(5) - @type type: integer - @ivar property: the property with which the sensor operates. - @type property: string - @ivar value: the value with which the sensor compares to the value of the property. - @type value: string - """ - - def getType(): - """ - DEPRECATED: use the type property - Gets when to activate this sensor. - - @return: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL, - KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED, - or KX_PROPSENSOR_EXPRESSION. - """ - - def setType(checktype): - """ - DEPRECATED: use the type property - Set the type of check to perform. - - @type checktype: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL, - KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED, - or KX_PROPSENSOR_EXPRESSION. - """ - - def getProperty(): - """ - DEPRECATED: use the property property - Return the property with which the sensor operates. - - @rtype: string - @return: the name of the property this sensor is watching. - """ - def setProperty(name): - """ - DEPRECATED: use the property property - Sets the property with which to operate. If there is no property - of that name, this call is ignored. - - @type name: string. - """ - def getValue(): - """ - DEPRECATED: use the value property - Return the value with which the sensor compares to the value of the property. - - @rtype: string - @return: the value of the property this sensor is watching. - """ - def setValue(value): - """ - DEPRECATED: use the value property - Set the value with which the sensor operates. If the value - is not compatible with the type of the property, the subsequent - action is ignored. - - @type value: string - """ - diff --git a/source/gameengine/PyDoc/SCA_PythonController.py b/source/gameengine/PyDoc/SCA_PythonController.py deleted file mode 100644 index 7b9b6ccd80a..00000000000 --- a/source/gameengine/PyDoc/SCA_PythonController.py +++ /dev/null @@ -1,41 +0,0 @@ -# $Id$ -# Documentation for SCA_PythonController -from SCA_IController import * - -class SCA_PythonController(SCA_IController): - """ - A Python controller uses a Python script to activate it's actuators, - based on it's sensors. - - Properties: - - @ivar script: the Python script this controller executes - @type script: string, read-only - - @group Deprecated: getScript, setScript - """ - def activate(actuator): - """ - Activates an actuator attached to this controller. - @type actuator: actuator or the actuator name as a string - """ - def deactivate(actuator): - """ - Deactivates an actuator attached to this controller. - @type actuator: actuator or the actuator name as a string - """ - def getScript(): - """ - DEPRECATED: use the script property - Gets the Python script this controller executes. - - @rtype: string - """ - def setScript(script): - """ - DEPRECATED: use the script property - Sets the Python script this controller executes. - - @type script: string. - """ - diff --git a/source/gameengine/PyDoc/SCA_RandomActuator.py b/source/gameengine/PyDoc/SCA_RandomActuator.py deleted file mode 100644 index 000a1af7846..00000000000 --- a/source/gameengine/PyDoc/SCA_RandomActuator.py +++ /dev/null @@ -1,175 +0,0 @@ -# $Id$ -# Documentation for SCA_RandomActuator -from SCA_IActuator import * - -class SCA_RandomActuator(SCA_IActuator): - """ - Random Actuator - - Properties: - - @ivar seed: Seed of the random number generator. - Equal seeds produce equal series. If the seed is 0, - the generator will produce the same value on every call. - @type seed: integer - @ivar para1: the first parameter of the active distribution. - Refer to the documentation of the generator types for the meaning - of this value. - @type para1: float, read-only - @ivar para2: the second parameter of the active distribution. - Refer to the documentation of the generator types for the meaning - of this value. - @type para2: float, read-only - @ivar distribution: distribution type: - KX_RANDOMACT_BOOL_CONST, KX_RANDOMACT_BOOL_UNIFORM, KX_RANDOMACT_BOOL_BERNOUILLI, - KX_RANDOMACT_INT_CONST, KX_RANDOMACT_INT_UNIFORM, KX_RANDOMACT_INT_POISSON, - KX_RANDOMACT_FLOAT_CONST, KX_RANDOMACT_FLOAT_UNIFORM, KX_RANDOMACT_FLOAT_NORMAL, - KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL - @type distribution: integer, read-only - @ivar property: the name of the property to set with the random value. - If the generator and property types do not match, the assignment is ignored. - @type property: string - - """ - def setSeed(seed): - """ - DEPRECATED: use the seed property - Sets the seed of the random number generator. - - Equal seeds produce equal series. If the seed is 0, - the generator will produce the same value on every call. - - @type seed: integer - """ - def getSeed(): - """ - DEPRECATED: use the seed property - Returns the initial seed of the generator. - - @rtype: integer - """ - def getPara1(): - """ - DEPRECATED: use the para1 property - Returns the first parameter of the active distribution. - - Refer to the documentation of the generator types for the meaning - of this value. - - @rtype: float - """ - def getPara2(): - """ - DEPRECATED: use the para2 property - Returns the second parameter of the active distribution. - - Refer to the documentation of the generator types for the meaning - of this value. - - @rtype: float - """ - def getDistribution(): - """ - DEPRECATED: use the distribution property - Returns the type of random distribution. - - @rtype: distribution type - @return: KX_RANDOMACT_BOOL_CONST, KX_RANDOMACT_BOOL_UNIFORM, KX_RANDOMACT_BOOL_BERNOUILLI, - KX_RANDOMACT_INT_CONST, KX_RANDOMACT_INT_UNIFORM, KX_RANDOMACT_INT_POISSON, - KX_RANDOMACT_FLOAT_CONST, KX_RANDOMACT_FLOAT_UNIFORM, KX_RANDOMACT_FLOAT_NORMAL, - KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL - """ - def setProperty(property): - """ - DEPRECATED: use the property property - Set the property to which the random value is assigned. - - If the generator and property types do not match, the assignment is ignored. - - @type property: string - @param property: The name of the property to set. - """ - def getProperty(): - """ - DEPRECATED: use the property property - Returns the name of the property to set. - - @rtype: string - """ - def setBoolConst(value): - """ - Sets this generator to produce a constant boolean value. - - @param value: The value to return. - @type value: boolean - """ - def setBoolUniform(): - """ - Sets this generator to produce a uniform boolean distribution. - - The generator will generate True or False with 50% chance. - """ - def setBoolBernouilli(value): - """ - Sets this generator to produce a Bernouilli distribution. - - @param value: Specifies the proportion of False values to produce. - - 0.0: Always generate True - - 1.0: Always generate False - @type value: float - """ - def setIntConst(value): - """ - Sets this generator to always produce the given value. - - @param value: the value this generator produces. - @type value: integer - """ - def setIntUniform(lower_bound, upper_bound): - """ - Sets this generator to produce a random value between the given lower and - upper bounds (inclusive). - - @type lower_bound: integer - @type upper_bound: integer - """ - def setIntPoisson(value): - """ - Generate a Poisson-distributed number. - - This performs a series of Bernouilli tests with parameter value. - It returns the number of tries needed to achieve succes. - - @type value: float - """ - def setFloatConst(value): - """ - Always generate the given value. - - @type value: float - """ - def setFloatUniform(lower_bound, upper_bound): - """ - Generates a random float between lower_bound and upper_bound with a - uniform distribution. - - @type lower_bound: float - @type upper_bound: float - """ - def setFloatNormal(mean, standard_deviation): - """ - Generates a random float from the given normal distribution. - - @type mean: float - @param mean: The mean (average) value of the generated numbers - @type standard_deviation: float - @param standard_deviation: The standard deviation of the generated numbers. - """ - def setFloatNegativeExponential(half_life): - """ - Generate negative-exponentially distributed numbers. - - The half-life 'time' is characterized by half_life. - - @type half_life: float - """ diff --git a/source/gameengine/PyDoc/SCA_RandomSensor.py b/source/gameengine/PyDoc/SCA_RandomSensor.py deleted file mode 100644 index 6dc0a3c23c0..00000000000 --- a/source/gameengine/PyDoc/SCA_RandomSensor.py +++ /dev/null @@ -1,35 +0,0 @@ -# $Id$ -# Documentation for SCA_RandomSensor -from SCA_ISensor import * - -class SCA_RandomSensor(SCA_ISensor): - """ - This sensor activates randomly. - - @ivar lastDraw: The seed of the random number generator. - @type lastDraw: int - @ivar seed: The seed of the random number generator. - @type seed: int - """ - - def setSeed(seed): - """ - Sets the seed of the random number generator. - - If the seed is 0, the generator will produce the same value on every call. - - @type seed: integer. - """ - def getSeed(): - """ - Returns the initial seed of the generator. Equal seeds produce equal random - series. - - @rtype: integer - """ - def getLastDraw(): - """ - Returns the last random number generated. - - @rtype: integer - """ diff --git a/source/gameengine/PyDoc/SCA_XNORController.py b/source/gameengine/PyDoc/SCA_XNORController.py deleted file mode 100644 index 5fb2561f35a..00000000000 --- a/source/gameengine/PyDoc/SCA_XNORController.py +++ /dev/null @@ -1,11 +0,0 @@ -# $Id$ -# Documentation for SCA_XNORController -from SCA_IController import * - -class SCA_XNORController(SCA_IController): - """ - An XNOR controller activates when all linked sensors are the same (activated or inative). - - There are no special python methods for this controller. - """ - diff --git a/source/gameengine/PyDoc/SCA_XORController.py b/source/gameengine/PyDoc/SCA_XORController.py deleted file mode 100644 index 10e20fb0945..00000000000 --- a/source/gameengine/PyDoc/SCA_XORController.py +++ /dev/null @@ -1,11 +0,0 @@ -# $Id$ -# Documentation for SCA_XORController -from SCA_IController import * - -class SCA_XORController(SCA_IController): - """ - An XOR controller activates when there is the input is mixed, but not when all are on or off. - - There are no special python methods for this controller. - """ - diff --git a/source/gameengine/PyDoc/WhatsNew.py b/source/gameengine/PyDoc/WhatsNew.py deleted file mode 100644 index 4d86e6ef3c4..00000000000 --- a/source/gameengine/PyDoc/WhatsNew.py +++ /dev/null @@ -1,34 +0,0 @@ -# $Id$ -""" -New Python Functionality in this Version of Blender -=================================================== - -This document lists what has been changed in the Game Engine Python API. - -Blender CVS - - Added L{KX_GameObject}.getDistanceTo() method. (thanks Charlie C) - - Added L{KX_PolygonMaterial} module - -Blender 2.36 ------------- - - Added L{KX_CameraActuator} methods (thanks snail) - -Blender 2.35 ------------- - - Added tic rate methods to L{GameLogic} - - Added stereo eye separation and focal length methods to L{Rasterizer}. - - Fixed L{Rasterizer}.makeScreenshot() method. - - Added setLogicTicRate() and setPhysicsTicRate() to L{GameLogic} - -Blender 2.34 ------------- - - - Added getType() and setType() to L{BL_ActionActuator} and L{KX_SoundActuator} (sgefant) - - New Scene module: L{KX_Scene} - - New Camera module: L{KX_Camera} - - New Light module: L{KX_LightObject} - - Added attributes to L{KX_GameObject}, L{KX_VertexProxy} - - L{KX_SCA_AddObjectActuator}.setObject(), L{KX_TrackToActuator}.setObject() and - L{KX_SceneActuator}.setCamera() now accept L{KX_GameObject}s as parameters - -""" -- cgit v1.2.3 From df1879783aba023bb0ab7d48a5faf0ec8ebe5eb2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 May 2009 12:26:54 +0000 Subject: use epy deprecated field and link to attributes --- source/gameengine/PyDoc/GameTypes.py | 521 +++++++++++++++++++---------------- 1 file changed, 278 insertions(+), 243 deletions(-) (limited to 'source') diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index a22f63854ea..d1b92e37099 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -67,16 +67,15 @@ class SCA_ILogicBrick(CValue): @group Deprecated: getOwner, setExecutePriority, getExecutePriority """ + #--The following methods are deprecated-- def getOwner(): """ Gets the game object associated with this logic brick. - Deprecated: Use the "owner" property instead. - + @deprecated: Use the L{owner} property instead. @rtype: L{KX_GameObject} """ - - #--The following methods are deprecated-- + def setExecutePriority(priority): """ Sets the priority of this logic brick. @@ -84,8 +83,7 @@ class SCA_ILogicBrick(CValue): This determines the order controllers are evaluated, and actuators are activated. Bricks with lower priority will be executed first. - Deprecated: Use the "executePriority" property instead. - + @deprecated: Use the L{executePriority} property instead. @type priority: integer @param priority: the priority of this logic brick. """ @@ -93,8 +91,7 @@ class SCA_ILogicBrick(CValue): """ Gets the execution priority of this logic brick. - Deprecated: Use the "executePriority" property instead. - + @deprecated: Use the L{executePriority} property instead. @rtype: integer @return: this logic bricks current priority. """ @@ -236,40 +233,35 @@ class SCA_IController(SCA_ILogicBrick): def getState(): """ - DEPRECATED: use the state property Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active. This for instance will always be true however you could compare with a previous state to see when the state was activated. GameLogic.getCurrentController().getState() & GameLogic.getCurrentController().getOwner().getState() - + @deprecated: Use the L{state} property @rtype: int """ def getSensors(): """ - DEPRECATED: use the sensors property Gets a list of all sensors attached to this controller. - + @deprecated: use the L{sensors} property @rtype: list [L{SCA_ISensor}] """ def getSensor(name): """ - DEPRECATED: use the sensors[name] property Gets the named linked sensor. - + @deprecated: use the L{sensors}[name] property @type name: string @rtype: L{SCA_ISensor} """ def getActuators(): """ - DEPRECATED: use the actuators property Gets a list of all actuators linked to this controller. - + @deprecated: Use the L{actuators} property @rtype: list [L{SCA_IActuator}] """ def getActuator(name): """ - DEPRECATED: use the actuators[name] property Gets the named linked actuator. - + @deprecated: use the L{actuators}[name] property @type name: string @rtype: L{SCA_IActuator} """ @@ -325,9 +317,8 @@ class BL_ActionActuator(SCA_IActuator): #--The following methods are deprecated-- def setAction(action, reset = True): """ - DEPRECATED: use the 'action' property Sets the current action. - + @deprecated: use the L{action} property @param action: The name of the action to set as the current action. @type action: string @param reset: Optional parameter indicating whether to reset the @@ -339,36 +330,33 @@ class BL_ActionActuator(SCA_IActuator): def setStart(start): """ - DEPRECATED: use the 'start' property Specifies the starting frame of the animation. - + @deprecated: Use the L{start} property @param start: the starting frame of the animation @type start: float """ def setEnd(end): """ - DEPRECATED: use the 'end' property Specifies the ending frame of the animation. - + @deprecated: use the L{end} property @param end: the ending frame of the animation @type end: float """ def setBlendin(blendin): """ - DEPRECATED: use the 'blendin' property Specifies the number of frames of animation to generate when making transitions between actions. - + @deprecated: use the L{blendin} property @param blendin: the number of frames in transition. @type blendin: float """ def setPriority(priority): """ - DEPRECATED: use the 'priority' property Sets the priority of this actuator. + @deprecated: Use use the L{priority} property @param priority: Specifies the new priority. Actuators will lower priority numbers will override actuators with higher numbers. @@ -376,131 +364,131 @@ class BL_ActionActuator(SCA_IActuator): """ def setFrame(frame): """ - DEPRECATED: use the 'frame' property Sets the current frame for the animation. + @deprecated: use the L{frame} property @param frame: Specifies the new current frame for the animation @type frame: float """ def setProperty(prop): """ - DEPRECATED: use the 'property' property Sets the property to be used in FromProp playback mode. + @deprecated: use the L{property} property @param prop: the name of the property to use. @type prop: string. """ def setBlendtime(blendtime): """ - DEPRECATED: use the 'blendTime' property Sets the internal frame timer. - + Allows the script to directly modify the internal timer used when generating transitions between actions. + @deprecated: use the L{blendTime} property @param blendtime: The new time. This parameter must be in the range from 0.0 to 1.0. @type blendtime: float """ def setType(mode): """ - DEPRECATED: use the 'type' property Sets the operation mode of the actuator + @deprecated: use the L{type} property @param mode: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND @type mode: integer """ def setContinue(cont): """ - DEPRECATED: use the 'continue' property Set the actions continue option True or False. see getContinue. + @deprecated: use the L{continue} property @param cont: The continue option. @type cont: bool """ def getType(): """ - DEPRECATED: use the 'type' property Returns the operation mode of the actuator - + + @deprecated: use the L{type} property @rtype: integer @return: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND """ def getContinue(): """ - DEPRECATED: use the 'continue' property When True, the action will always play from where last left off, otherwise negative events to this actuator will reset it to its start frame. - + + @deprecated: use the L{useContinue} property @rtype: bool """ def getAction(): """ - DEPRECATED: use the 'action' property getAction() returns the name of the action associated with this actuator. + @deprecated: use the L{action} property @rtype: string """ def getStart(): """ - DEPRECATED: use the 'start' property Returns the starting frame of the action. + @deprecated: use the L{start} property @rtype: float """ def getEnd(): """ - DEPRECATED: use the 'end' property Returns the last frame of the action. + @deprecated: use the L{end} property @rtype: float """ def getBlendin(): """ - DEPRECATED: use the 'blendin' property Returns the number of interpolation animation frames to be generated when this actuator is triggered. + @deprecated: use the L{blendin} property @rtype: float """ def getPriority(): """ - DEPRECATED: use the 'priority' property Returns the priority for this actuator. Actuators with lower Priority numbers will override actuators with higher numbers. + @deprecated: use the L{priority} property @rtype: integer """ def getFrame(): """ - DEPRECATED: use the 'frame' property Returns the current frame number. + @deprecated: use the L{frame} property @rtype: float """ def getProperty(): """ - DEPRECATED: use the 'property' property Returns the name of the property to be used in FromProp mode. + @deprecated: use the L{property} property @rtype: string """ def setFrameProperty(prop): """ - DEPRECATED: use the 'frameProperty' property + @deprecated: use the L{frameProperty} property @param prop: A string specifying the property of the object that will be updated with the action frame number. @type prop: string """ def getFrameProperty(): """ - DEPRECATED: use the 'frameProperty' property Returns the name of the property that is set to the current frame number. + @deprecated: use the L{frameProperty} property @rtype: string """ @@ -783,9 +771,9 @@ class BL_ShapeActionActuator(SCA_IActuator): """ def setAction(action, reset = True): """ - DEPRECATED: use the 'action' property Sets the current action. + @deprecated: use the L{action} property @param action: The name of the action to set as the current action. @type action: string @param reset: Optional parameter indicating whether to reset the @@ -797,36 +785,36 @@ class BL_ShapeActionActuator(SCA_IActuator): def setStart(start): """ - DEPRECATED: use the 'start' property Specifies the starting frame of the animation. + @deprecated: use the L{start} property @param start: the starting frame of the animation @type start: float """ def setEnd(end): """ - DEPRECATED: use the 'end' property Specifies the ending frame of the animation. + @deprecated: use the L{end} property @param end: the ending frame of the animation @type end: float """ def setBlendin(blendin): """ - DEPRECATED: use the 'blendin' property Specifies the number of frames of animation to generate when making transitions between actions. + @deprecated: use the L{blendin} property @param blendin: the number of frames in transition. @type blendin: float """ def setPriority(priority): """ - DEPRECATED: use the 'priority' property Sets the priority of this actuator. + @deprecated: use the L{priority} property @param priority: Specifies the new priority. Actuators will lower priority numbers will override actuators with higher numbers. @@ -834,114 +822,114 @@ class BL_ShapeActionActuator(SCA_IActuator): """ def setFrame(frame): """ - DEPRECATED: use the 'frame' property Sets the current frame for the animation. + @deprecated: use the L{frame} property @param frame: Specifies the new current frame for the animation @type frame: float """ def setProperty(prop): """ - DEPRECATED: use the 'property' property Sets the property to be used in FromProp playback mode. + @deprecated: use the L{property} property @param prop: the name of the property to use. @type prop: string. """ def setBlendtime(blendtime): """ - DEPRECATED: use the 'blendTime' property Sets the internal frame timer. - + Allows the script to directly modify the internal timer used when generating transitions between actions. + @deprecated: use the L{blendTime} property @param blendtime: The new time. This parameter must be in the range from 0.0 to 1.0. @type blendtime: float """ def setType(mode): """ - DEPRECATED: use the 'type' property Sets the operation mode of the actuator + @deprecated: use the L{type} property @param mode: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND @type mode: integer """ def getType(): """ - DEPRECATED: use the 'type' property Returns the operation mode of the actuator - + + @deprecated: use the L{type} property @rtype: integer @return: KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND """ def getAction(): """ - DEPRECATED: use the 'action' property getAction() returns the name of the action associated with this actuator. + @deprecated: use the L{action} property @rtype: string """ def getStart(): """ - DEPRECATED: use the 'start' property Returns the starting frame of the action. + @deprecated: use the L{start} property @rtype: float """ def getEnd(): """ - DEPRECATED: use the 'end' property Returns the last frame of the action. + @deprecated: use the L{end} property @rtype: float """ def getBlendin(): """ - DEPRECATED: use the 'blendin' property Returns the number of interpolation animation frames to be generated when this actuator is triggered. + @deprecated: use the L{blendin} property @rtype: float """ def getPriority(): """ - DEPRECATED: use the 'priority' property Returns the priority for this actuator. Actuators with lower Priority numbers will override actuators with higher numbers. + @deprecated: use the L{priority} property @rtype: integer """ def getFrame(): """ - DEPRECATED: use the 'frame' property Returns the current frame number. + @deprecated: use the L{frame} property @rtype: float """ def getProperty(): """ - DEPRECATED: use the 'property' property Returns the name of the property to be used in FromProp mode. + @deprecated: use the L{property} property @rtype: string """ def setFrameProperty(prop): """ - DEPRECATED: use the 'frameProperty' property + @deprecated: use the L{frameProperty} property @param prop: A string specifying the property of the object that will be updated with the action frame number. @type prop: string """ def getFrameProperty(): """ - DEPRECATED: use the 'frameProperty' property Returns the name of the property that is set to the current frame number. + @deprecated: use the L{frameProperty} property @rtype: string """ @@ -1080,17 +1068,17 @@ class KX_CDActuator(SCA_IActuator): """ def setGain(gain): """ - DEPRECATED: Use the volume property. Sets the gain (volume) of the CD. + @deprecated: Use the L{volume} property. @type gain: float @param gain: the gain to set the CD to. 0.0 = silent, 1.0 = max volume. """ def getGain(): """ - DEPRECATED: Use the volume property. Gets the current gain (volume) of the CD. + @deprecated: Use the L{volume} property. @rtype: float @return: Between 0.0 (silent) and 1.0 (max volume) """ @@ -1468,16 +1456,16 @@ class KX_GameActuator(SCA_IActuator): """ def getFile(): """ - DEPRECATED: use the file property Returns the filename of the new .blend file to load. + @deprecated: use the L{file} property @rtype: string """ def setFile(filename): """ - DEPRECATED: use the file property Sets the new .blend file to load. + @deprecated: use the L{file} property @param filename: The file name this actuator will load. @type filename: string """ @@ -1514,13 +1502,16 @@ class KX_GameObject(SCA_IObject): @ivar occlusion: occlusion capability flag. @type occlusion: boolean @ivar position: The object's position. - DEPRECATED: use localPosition and worldPosition + + deprecated: use L{localPosition} and L{worldPosition} @type position: list [x, y, z] On write: local position, on read: world position @ivar orientation: The object's orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. - DEPRECATED: use localOrientation and worldOrientation + + deprecated: use L{localOrientation} and L{worldOrientation} @type orientation: 3x3 Matrix [[float]] On write: local orientation, on read: world orientation @ivar scaling: The object's scaling factor. list [sx, sy, sz] - DEPRECATED: use localScaling and worldScaling + + deprecated: use L{localScaling} and L{worldScaling} @type scaling: list [sx, sy, sz] On write: local scaling, on read: world scaling @ivar localOrientation: The object's local orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. @type localOrientation: 3x3 Matrix [[float]] @@ -1570,8 +1561,9 @@ class KX_GameObject(SCA_IObject): """ def getVisible(): """ - Gets the game object's visible flag. (B{deprecated}) + Gets the game object's visible flag. + @deprecated: use L{visible} @rtype: boolean """ def setVisible(visible, recursive): @@ -1592,24 +1584,25 @@ class KX_GameObject(SCA_IObject): """ def getState(): """ - Gets the game object's state bitmask. (B{deprecated}) + Gets the game object's state bitmask. + @deprecated: use L{state} @rtype: int @return: the objects state. """ def setState(state): """ - Sets the game object's state flag. (B{deprecated}). + Sets the game object's state flag. The bitmasks for states from 1 to 30 can be set with (1<<0, 1<<1, 1<<2 ... 1<<29) - + @deprecated: use L{state} @type state: integer """ def setPosition(pos): """ - Sets the game object's position. (B{deprecated}) + Sets the game object's position. Global coordinates for root object, local for child objects. - + @deprecated: use L{localPosition} @type pos: [x, y, z] @param pos: the new position, in local coordinates. """ @@ -1622,15 +1615,17 @@ class KX_GameObject(SCA_IObject): """ def getPosition(): """ - Gets the game object's position. (B{deprecated}) + Gets the game object's position. + @deprecated: use L{worldPosition} @rtype: list [x, y, z] @return: the object's position in world coordinates. """ def setOrientation(orn): """ - Sets the game object's orientation. (B{deprecated}) + Sets the game object's orientation. + @deprecated: use L{localOrientation} @type orn: 3x3 rotation matrix, or Quaternion. @param orn: a rotation matrix specifying the new rotation. @note: When using this matrix with Blender.Mathutils.Matrix() types, it will need to be transposed. @@ -1662,8 +1657,9 @@ class KX_GameObject(SCA_IObject): """ def getOrientation(): """ - Gets the game object's orientation. (B{deprecated}) + Gets the game object's orientation. + @deprecated: use L{worldOrientation} @rtype: 3x3 rotation matrix @return: The game object's rotation matrix @note: When using this matrix with Blender.Mathutils.Matrix() types, it will need to be transposed. @@ -1776,8 +1772,9 @@ class KX_GameObject(SCA_IObject): """ def getMass(): """ - Gets the game object's mass. (B{deprecated}) + Gets the game object's mass. + @deprecated: use L{mass} @rtype: float @return: the object's mass. """ @@ -1827,8 +1824,9 @@ class KX_GameObject(SCA_IObject): """ def getParent(): """ - Gets this object's parent. (B{deprecated}) + Gets this object's parent. + @deprecated: use L{parent} @rtype: L{KX_GameObject} @return: this object's parent object, or None if this object has no parent. """ @@ -2006,8 +2004,9 @@ class KX_IpoActuator(SCA_IActuator): """ def set(mode, startframe, endframe, force): """ - Sets the properties of the actuator. (B{deprecated}) + Sets the properties of the actuator. + @deprecated: use other attributes. @param mode: "Play", "PingPong", "Flipper", "LoopStop", "LoopEnd" or "FromProp" @type mode: string @param startframe: first frame to use @@ -2019,79 +2018,91 @@ class KX_IpoActuator(SCA_IActuator): """ def setProperty(property): """ - Sets the name of the property to be used in FromProp mode. (B{deprecated}) + Sets the name of the property to be used in FromProp mode. + @deprecated: use L{propName} @type property: string """ def setStart(startframe): """ - Sets the frame from which the IPO starts playing. (B{deprecated}) + Sets the frame from which the IPO starts playing. + @deprecated: use L{startFrame} @type startframe: integer """ def getStart(): """ - Returns the frame from which the IPO starts playing. (B{deprecated}) + Returns the frame from which the IPO starts playing. + @deprecated: use L{startFrame} @rtype: integer """ def setEnd(endframe): """ - Sets the frame at which the IPO stops playing. (B{deprecated}) + Sets the frame at which the IPO stops playing. + @deprecated: use L{endFrame} @type endframe: integer """ def getEnd(): """ - Returns the frame at which the IPO stops playing. (B{deprecated}) + Returns the frame at which the IPO stops playing. + @deprecated: use L{endFrame} @rtype: integer """ def setIpoAsForce(force): """ - Set whether to interpret the ipo as a force rather than a displacement. (B{deprecated}) + Set whether to interpret the ipo as a force rather than a displacement. + @deprecated: use L{useIpoAsForce} @type force: boolean @param force: KX_TRUE or KX_FALSE """ def getIpoAsForce(): """ - Returns whether to interpret the ipo as a force rather than a displacement. (B{deprecated}) + Returns whether to interpret the ipo as a force rather than a displacement. + @deprecated: use L{useIpoAsForce} @rtype: boolean """ def setIpoAdd(add): """ - Set whether to interpret the ipo as additive rather than absolute. (B{deprecated}) + Set whether to interpret the ipo as additive rather than absolute. + @deprecated: use L{useIpoAdd} @type add: boolean @param add: KX_TRUE or KX_FALSE """ def getIpoAdd(): """ - Returns whether to interpret the ipo as additive rather than absolute. (B{deprecated}) + Returns whether to interpret the ipo as additive rather than absolute. + @deprecated: use L{useIpoAdd} @rtype: boolean """ def setType(mode): """ - Sets the operation mode of the actuator. (B{deprecated}) + Sets the operation mode of the actuator. + @deprecated: use L{type} @param mode: KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND @type mode: string """ def getType(): """ - Returns the operation mode of the actuator. (B{deprecated}) + Returns the operation mode of the actuator. + @deprecated: use L{type} @rtype: integer @return: KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND """ def setForceIpoActsLocal(local): """ Set whether to apply the force in the object's local - coordinates rather than the world global coordinates. (B{deprecated}) + coordinates rather than the world global coordinates. + @deprecated: use L{useIpoLocal} @param local: Apply the ipo-as-force in the object's local coordinates? (KX_TRUE, KX_FALSE) @type local: boolean @@ -2099,7 +2110,9 @@ class KX_IpoActuator(SCA_IActuator): def getForceIpoActsLocal(): """ Return whether to apply the force in the object's local - coordinates rather than the world global coordinates. (B{deprecated}) + coordinates rather than the world global coordinates. + + @deprecated: use L{useIpoLocal} """ class KX_LightObject(KX_GameObject): @@ -2289,17 +2302,17 @@ class SCA_MouseSensor(SCA_ISensor): def getXPosition(): """ - DEPRECATED: use the position property Gets the x coordinate of the mouse. + @deprecated: use the L{position} property @rtype: integer @return: the current x coordinate of the mouse, in frame coordinates (pixels) """ def getYPosition(): """ - DEPRECATED: use the position property Gets the y coordinate of the mouse. + @deprecated: use the L{position} property @rtype: integer @return: the current y coordinate of the mouse, in frame coordinates (pixels). """ @@ -2337,43 +2350,49 @@ class KX_MouseFocusSensor(SCA_MouseSensor): def getHitNormal(): """ - Returns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray. (B{deprecated}) - + Returns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray. + + @deprecated: use the L{hitNormal} property @rtype: list [x, y, z] @return: the ray collision normal. """ def getHitObject(): """ - Returns the object that was hit by this ray or None. (B{deprecated}) + Returns the object that was hit by this ray or None. + @deprecated: use the L{hitObject} property @rtype: L{KX_GameObject} or None @return: the collision object. """ def getHitPosition(): """ - Returns the position (in worldcoordinates) at the point of collision where the object was hit by this ray. (B{deprecated}) + Returns the position (in worldcoordinates) at the point of collision where the object was hit by this ray. + @deprecated: use the L{hitPosition} property @rtype: list [x, y, z] @return: the ray collision position. """ def getRayDirection(): """ - Returns the normalized direction (in worldcoordinates) of the ray cast by the mouse. (B{deprecated}) + Returns the normalized direction (in worldcoordinates) of the ray cast by the mouse. + @deprecated: use the L{rayDirection} property @rtype: list [x, y, z] @return: the ray direction. """ def getRaySource(): """ - Returns the position (in worldcoordinates) the ray was cast from by the mouse. (B{deprecated}) + Returns the position (in worldcoordinates) the ray was cast from by the mouse. + @deprecated: use the L{raySource} property @rtype: list [x, y, z] @return: the ray source. """ def getRayTarget(): """ - Returns the target of the ray (in worldcoordinates) that seeks the focus object. (B{deprecated}) + Returns the target of the ray (in worldcoordinates) that seeks the focus object. + @deprecated: use the L{rayTarget} property @rtype: list [x, y, z] @return: the ray target. """ @@ -2398,43 +2417,45 @@ class KX_TouchSensor(SCA_ISensor): #--The following methods are deprecated, please use properties instead. def setProperty(name): """ - DEPRECATED: use the property property Set the property or material to collide with. Use setTouchMaterial() to switch between properties and materials. + + @deprecated: use the L{property} property @type name: string """ def getProperty(): """ - DEPRECATED: use the property property Returns the property or material to collide with. Use getTouchMaterial() to find out whether this sensor looks for properties or materials. (B{deprecated}) + @deprecated: use the L{property} property @rtype: string """ def getHitObject(): """ - DEPRECATED: use the objectHit property - Returns the last object hit by this touch sensor. (B{deprecated}) + Returns the last object hit by this touch sensor. + @deprecated: use the L{objectHit} property @rtype: L{KX_GameObject} """ def getHitObjectList(): """ - DEPRECATED: use the objectHitList property Returns a list of all objects hit in the last frame. (B{deprecated}) Only objects that have the requisite material/property are listed. + @deprecated: use the L{objectHitList} property @rtype: L{CListValue} of L{KX_GameObject} """ def getTouchMaterial(): """ - DEPRECATED: use the useMaterial property Returns KX_TRUE if this sensor looks for a specific material, KX_FALSE if it looks for a specific property. (B{deprecated}) + + @deprecated: use the L{useMaterial} property """ class KX_NearSensor(KX_TouchSensor): @@ -2462,31 +2483,31 @@ class KX_NetworkMessageActuator(SCA_IActuator): """ def setToPropName(name): """ - DEPRECATED: Use the propName property instead. Messages will only be sent to objects with the given property name. + @deprecated: Use the L{propName} property instead. @type name: string """ def setSubject(subject): """ - DEPRECATED: Use the subject property instead. Sets the subject field of the message. + @deprecated: Use the L{subject} property instead. @type subject: string """ def setBodyType(bodytype): """ - DEPRECATED: Use the usePropBody property instead. Sets the type of body to send. + @deprecated: Use the L{usePropBody} property instead. @type bodytype: boolean @param bodytype: True to send the value of a property, False to send the body text. """ def setBody(body): """ - DEPRECATED: Use the body property instead. Sets the message body. + deprecated: Use the L{body} property instead. @type body: string @param body: if the body type is True, this is the name of the property to send. if the body type is False, this is the text to send. @@ -2512,39 +2533,39 @@ class KX_NetworkMessageSensor(SCA_ISensor): def setSubjectFilterText(subject): """ - DEPRECATED: Use the subject property instead. Change the message subject text that this sensor is listening to. + @deprecated: Use the L{subject} property instead. @type subject: string @param subject: the new message subject to listen for. """ def getFrameMessageCount(): """ - DEPRECATED: Use the frameMessageCount property instead. Get the number of messages received since the last frame. + @deprecated: Use the L{frameMessageCount} property instead. @rtype: integer """ def getBodies(): """ - DEPRECATED: Use the bodies property instead. Gets the list of message bodies. + @deprecated: Use the L{bodies} property instead. @rtype: list """ def getSubject(): """ - DEPRECATED: Use the subject property instead. Gets the message subject this sensor is listening for from the Subject: field. + @deprecated: Use the L{subject} property instead. @rtype: string """ def getSubjects(): """ - DEPRECATED: Use the subjects property instead. Gets the list of message subjects received. + @deprecated: Use the L{subjects} property instead. @rtype: list """ @@ -2803,17 +2824,18 @@ class KX_ParentActuator(SCA_IActuator): """ def setObject(object): """ - DEPRECATED: Use the object property. Sets the object to set as parent. Object can be either a L{KX_GameObject} or the name of the object. + @deprecated: Use the L{object} property. @type object: L{KX_GameObject}, string or None """ def getObject(name_only = 1): """ - DEPRECATED: Use the object property. Returns the name of the object to change to. + + @deprecated: Use the L{object} property. @type name_only: bool @param name_only: optional argument, when 0 return a KX_GameObject @rtype: string, KX_GameObject or None if no object is set @@ -2889,7 +2911,7 @@ class KX_PolyProxy(SCA_IObject): @ivar matname: The name of polygon material, empty if no material. @type matname: string @ivar material: The material of the polygon - @type material: L{KX_PolygonMaterial} or KX_BlenderMaterial + @type material: L{KX_PolygonMaterial} or L{KX_BlenderMaterial} @ivar texture: The texture name of the polygon. @type texture: string @ivar matid: The material index of the polygon, use this to retrieve vertex proxy from mesh proxy @@ -2920,7 +2942,7 @@ class KX_PolyProxy(SCA_IObject): """ Returns the polygon material - @rtype: L{KX_PolygonMaterial} or KX_BlenderMaterial + @rtype: L{KX_PolygonMaterial} or L{KX_BlenderMaterial} """ def getTextureName(): """ @@ -3283,6 +3305,7 @@ class KX_RadarSensor(KX_NearSensor): Returns the origin of the cone with which to test. The origin is in the middle of the cone. + @deprecated: Use the L{coneOrigin} property. @rtype: list [x, y, z] """ @@ -3290,6 +3313,7 @@ class KX_RadarSensor(KX_NearSensor): """ Returns the center of the bottom face of the cone with which to test. + @deprecated: Use the L{coneTarget} property. @rtype: list [x, y, z] """ @@ -3328,30 +3352,30 @@ class KX_RaySensor(SCA_ISensor): def getHitObject(): """ - DEPRECATED: Use the hitObject property instead. Returns the game object that was hit by this ray. + @deprecated: Use the L{hitObject} property instead. @rtype: KX_GameObject """ def getHitPosition(): """ - DEPRECATED: Use the hitPosition property instead. Returns the position (in worldcoordinates) where the object was hit by this ray. + @deprecated: Use the L{hitPosition} property instead. @rtype: list [x, y, z] """ def getHitNormal(): """ - DEPRECATED: Use the hitNormal property instead. Returns the normal (in worldcoordinates) of the object at the location where the object was hit by this ray. + @deprecated: Use the L{hitNormal} property instead. @rtype: list [nx, ny, nz] """ def getRayDirection(): """ - DEPRECATED: Use the rayDirection property instead. Returns the direction from the ray (in worldcoordinates) + @deprecated: Use the L{rayDirection} property instead. @rtype: list [dx, dy, dz] """ @@ -3378,7 +3402,6 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): """ def setObject(object): """ - DEPRECATED: use the object property Sets the game object to add. A copy of the object will be added to the scene when the actuator is activated. @@ -3387,40 +3410,42 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): object can either be a L{KX_GameObject} or the name of an object or None. + @deprecated: use the L{object} property @type object: L{KX_GameObject}, string or None """ def getObject(name_only = 0): """ - DEPRECATED: use the object property Returns the name of the game object to be added. Returns None if no game object has been assigned to be added. + + @deprecated: use the L{object} property @type name_only: bool @param name_only: optional argument, when 0 return a KX_GameObject @rtype: string, KX_GameObject or None if no object is set """ def setTime(time): """ - DEPRECATED: use the time property Sets the lifetime of added objects, in frames. If time == 0, the object will last forever. + @deprecated: use the L{time} property @type time: integer @param time: The minimum value for time is 0. """ def getTime(): """ - DEPRECATED: use the time property Returns the lifetime of the added object, in frames. + @deprecated: use the L{time} property @rtype: integer """ def setLinearVelocity(vx, vy, vz): """ - DEPRECATED: use the linearVelocity property Sets the initial linear velocity of added objects. + @deprecated: use the L{linearVelocity} property @type vx: float @param vx: the x component of the initial linear velocity. @type vy: float @@ -3430,16 +3455,16 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): """ def getLinearVelocity(): """ - DEPRECATED: use the linearVelocity property Returns the initial linear velocity of added objects. + @deprecated: use the L{linearVelocity} property @rtype: list [vx, vy, vz] """ def setAngularVelocity(vx, vy, vz): """ - DEPRECATED: use the angularVelocity property Sets the initial angular velocity of added objects. + @deprecated: use the L{angularVelocity} property @type vx: float @param vx: the x component of the initial angular velocity. @type vy: float @@ -3449,16 +3474,16 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): """ def getAngularVelocity(): """ - DEPRECATED: use the angularVelocity property Returns the initial angular velocity of added objects. + @deprecated: use the L{angularVelocity} property @rtype: list [vx, vy, vz] """ def getLastCreatedObject(): """ - DEPRECATED: use the objectLastCreated property Returns the last object created by this actuator. + @deprecated: use the L{objectLastCreated} property @rtype: L{KX_GameObject} @return: A L{KX_GameObject} or None if no object has been created. """ @@ -3481,18 +3506,19 @@ class KX_SCA_DynamicActuator(SCA_IActuator): """ def setOperation(operation): """ - DEPRECATED: Use the operation property instead. Set the type of operation when the actuator is activated: - 0 = restore dynamics - 1 = disable dynamics - 2 = enable rigid body - 3 = disable rigid body - 4 = set mass + + @deprecated: Use the L{operation} property instead. """ def getOperation(): """ - DEPRECATED: Use the operation property instead. return the type of operation + @deprecated: Use the L{operation} property instead. """ class KX_SCA_EndObjectActuator(SCA_IActuator): @@ -3562,19 +3588,19 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator): """ def setMesh(name): """ - DEPRECATED: Use the mesh property instead. Sets the name of the mesh that will replace the current one. When the name is None it will unset the mesh value so no action is taken. + @deprecated: Use the L{mesh} property instead. @type name: string or None """ def getMesh(): """ - DEPRECATED: Use the mesh property instead. Returns the name of the mesh that will replace the current one. Returns None if no mesh has been scheduled to be added. + @deprecated: Use the L{mesh} property instead. @rtype: string or None """ def instantReplaceMesh(): @@ -3642,23 +3668,23 @@ class KX_Scene(PyObjectPlus): def getLightList(): """ - DEPRECATED: use the 'lights' property. Returns the list of lights in the scene. + @deprecated: Use the L{lights} property instead. @rtype: list [L{KX_LightObject}] """ def getObjectList(): """ - DEPRECATED: use the 'objects' property. Returns the list of objects in the scene. + @deprecated: Use the L{objects} property instead. @rtype: list [L{KX_GameObject}] """ def getName(): """ - DEPRECATED: use the 'name' property. Returns the name of the scene. + @deprecated: Use the L{name} property instead. @rtype: string """ @@ -3699,48 +3725,48 @@ class KX_SceneActuator(SCA_IActuator): """ def setUseRestart(flag): """ - DEPRECATED: use the useRestart property instead Set flag to True to restart the scene. + @deprecated: Use the L{useRestart} property instead. @type flag: boolean """ def setScene(scene): """ - DEPRECATED: use the scene property instead Sets the name of the scene to change to/overlay/underlay/remove/suspend/resume. + @deprecated: use the L{scene} property instead. @type scene: string """ def setCamera(camera): """ - DEPRECATED: use the camera property instead Sets the camera to change to. Camera can be either a L{KX_Camera} or the name of the camera. + @deprecated: use the L{camera} property instead. @type camera: L{KX_Camera} or string """ def getUseRestart(): """ - DEPRECATED: use the useRestart property instead Returns True if the scene will be restarted. + @deprecated: use the L{useRestart} property instead. @rtype: boolean """ def getScene(): """ - DEPRECATED: use the scene property instead Returns the name of the scene to change to/overlay/underlay/remove/suspend/resume. Returns an empty string ("") if no scene has been set. + @deprecated: use the L{scene} property instead. @rtype: string """ def getCamera(): """ - DEPRECATED: use the camera property instead Returns the name of the camera to change to. + @deprecated: use the L{camera} property instead. @rtype: string """ @@ -3790,16 +3816,16 @@ class KX_SoundActuator(SCA_IActuator): """ def setFilename(filename): """ - DEPRECATED: Use the filename property instead. Sets the filename of the sound this actuator plays. + @deprecated: Use the L{filename} property instead. @type filename: string """ def getFilename(): """ - DEPRECATED: Use the filename property instead. Returns the filename of the sound this actuator plays. + @deprecated: Use the L{filename} property instead. @rtype: string """ def startSound(): @@ -3816,76 +3842,77 @@ class KX_SoundActuator(SCA_IActuator): """ def setGain(gain): """ - DEPRECATED: Use the volume property instead Sets the gain (volume) of the sound + @deprecated: Use the L{volume} property instead. @type gain: float @param gain: 0.0 (quiet) <= gain <= 1.0 (loud) """ def getGain(): """ - DEPRECATED: Use the volume property instead. Gets the gain (volume) of the sound. + @deprecated: Use the L{volume} property instead. @rtype: float """ def setPitch(pitch): """ - DEPRECATED: Use the pitch property instead. Sets the pitch of the sound. + @deprecated: Use the L{pitch} property instead. @type pitch: float """ def getPitch(): """ - DEPRECATED: Use the pitch property instead. Returns the pitch of the sound. + @deprecated: Use the L{pitch} property instead. @rtype: float """ def setRollOffFactor(rolloff): """ - DEPRECATED: Use the rollOffFactor property instead. Sets the rolloff factor for the sounds. Rolloff defines the rate of attenuation as the sound gets further away. Higher rolloff factors shorten the distance at which the sound can be heard. + @deprecated: Use the L{rollOffFactor} property instead. @type rolloff: float """ def getRollOffFactor(): """ - DEPRECATED: Use the rollOffFactor property instead. Returns the rolloff factor for the sound. + @deprecated: Use the L{rollOffFactor} property instead. @rtype: float """ def setLooping(loop): """ - DEPRECATED: Use the looping property instead. Sets the loop mode of the actuator. @bug: There are no constants defined for this method! @param loop: - Play Stop 1 - - Play End 2 - - Loop Stop 3 - - Loop End 4 - - Bidirection Stop 5 - - Bidirection End 6 + - Play End 2 + - Loop Stop 3 + - Loop End 4 + - Bidirection Stop 5 + - Bidirection End 6 + + @deprecated: Use the L{looping} property instead. @type loop: integer """ def getLooping(): """ - DEPRECATED: Use the looping property instead. Returns the current loop mode of the actuator. + @deprecated: Use the L{looping} property instead. @rtype: integer """ def setPosition(x, y, z): """ - DEPRECATED: Use the position property instead. Sets the position this sound will come from. + @deprecated: Use the L{position} property instead. @type x: float @param x: The x coordinate of the sound. @type y: float @@ -3895,11 +3922,11 @@ class KX_SoundActuator(SCA_IActuator): """ def setVelocity(vx, vy, vz): """ - DEPRECATED: Use the velocity property instead. Sets the velocity this sound is moving at. The sound's pitch is determined from the velocity. + @deprecated: Use the L{velocity} property instead. @type vx: float @param vx: The vx coordinate of the sound. @type vy: float @@ -3909,29 +3936,29 @@ class KX_SoundActuator(SCA_IActuator): """ def setOrientation(o11, o12, o13, o21, o22, o23, o31, o32, o33): """ - DEPRECATED: Use the orientation property instead. Sets the orientation of the sound. The nine parameters specify a rotation matrix:: | o11, o12, o13 | | o21, o22, o23 | | o31, o32, o33 | + @deprecated: Use the L{orientation} property instead. """ def setType(mode): """ - DEPRECATED: Use the type property instead. Sets the operation mode of the actuator. + @deprecated: Use the L{type} property instead. @param mode: KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP @type mode: integer """ def getType(): """ - DEPRECATED: Use the type property instead. Returns the operation mode of the actuator. + @deprecated: Use the L{type} property instead. @rtype: integer @return: KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP """ @@ -3958,21 +3985,21 @@ class KX_StateActuator(SCA_IActuator): """ def setOperation(op): """ - DEPRECATED: Use the operation property instead. Set the type of bit operation to be applied on object state mask. Use setMask() to specify the bits that will be modified. + @deprecated: Use the L{operation} property instead. @param op: bit operation (0=Copy, 1=Add, 2=Substract, 3=Invert) @type op: integer """ def setMask(mask): """ - DEPRECATED: Use the mask property instead. Set the value that defines the bits that will be modified by the operation. The bits that are 1 in the value will be updated in the object state, the bits that are 0 are will be left unmodified expect for the Copy operation which copies the value to the object state. + @deprecated: Use the L{mask} property instead. @param mask: bits that will be modified @type mask: integer """ @@ -3998,49 +4025,50 @@ class KX_TrackToActuator(SCA_IActuator): """ def setObject(object): """ - DEPRECATED: Use the object property. Sets the object to track. + @deprecated: Use the L{object} property instead. @type object: L{KX_GameObject}, string or None @param object: Either a reference to a game object or the name of the object to track. """ def getObject(name_only): """ - DEPRECATED: Use the object property. Returns the name of the object to track. + @deprecated: Use the L{object} property instead. @type name_only: bool @param name_only: optional argument, when 0 return a KX_GameObject @rtype: string, KX_GameObject or None if no object is set """ def setTime(time): """ - DEPRECATED: Use the time property. Sets the time in frames with which to delay the tracking motion. + @deprecated: Use the L{time} property instead. @type time: integer """ def getTime(): """ - DEPRECATED: Use the time property. Returns the time in frames with which the tracking motion is delayed. + @deprecated: Use the L{time} property instead. @rtype: integer """ def setUse3D(use3d): """ - DEPRECATED: Use the use3D property. + DEPRECATED: Use the property. Sets the tracking motion to use 3D. + @deprecated: Use the L{use3D} property instead. @type use3d: boolean @param use3d: - True: allow the tracking motion to extend in the z-direction. - False: lock the tracking motion to the x-y plane. """ def getUse3D(): """ - DEPRECATED: Use the use3D property. Returns True if the tracking motion will track in the z direction. + @deprecated: Use the L{use3D} property instead. @rtype: boolean """ @@ -4362,9 +4390,9 @@ class KX_VisibilityActuator(SCA_IActuator): """ def set(visible): """ - DEPRECATED: Use the visibility property instead. Sets whether the actuator makes its parent object visible or invisible. - + + @deprecated: Use the L{visibility} property instead. @param visible: - True: Makes its parent visible. - False: Makes its parent invisible. """ @@ -4431,17 +4459,17 @@ class SCA_ActuatorSensor(SCA_ISensor): """ def getActuator(): """ - DEPRECATED: use the actuator property Return the Actuator with which the sensor operates. + @deprecated: Use the L{actuator} property instead. @rtype: string """ def setActuator(name): """ - DEPRECATED: use the actuator property Sets the Actuator with which to operate. If there is no Actuator of this name, the function has no effect. + @deprecated: Use the L{actuator} property instead. @param name: actuator name @type name: string """ @@ -4475,48 +4503,48 @@ class SCA_DelaySensor(SCA_ISensor): """ def setDelay(delay): """ - DEPRECATED: use the delay property Set the initial delay before the positive trigger. + @deprecated: Use the L{delay} property instead. @param delay: length of the initial OFF period as number of frame, 0 for immediate trigger @type delay: integer """ def setDuration(duration): """ - DEPRECATED: use the duration property Set the duration of the ON pulse after initial delay and the generation of the positive trigger. If duration is greater than 0, a negative trigger is sent at the end of the ON pulse. + @deprecated: Use the L{duration} property instead. @param duration: length of the ON period in number of frame after the initial OFF period @type duration: integer """ def setRepeat(repeat): """ - DEPRECATED: use the repeat property Set if the sensor repeat mode. + @deprecated: Use the L{repeat} property instead. @param repeat: 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once. @type repeat: integer """ def getDelay(): """ - DEPRECATED: use the delay property Return the delay parameter value. + @deprecated: Use the L{delay} property instead. @rtype: integer """ def getDuration(): """ - DEPRECATED: use the duration property Return the duration parameter value + @deprecated: Use the L{duration} property instead. @rtype: integer """ def getRepeat(): """ - DEPRECATED: use the repeat property Return the repeat parameter value + @deprecated: Use the L{repeat} property instead. @rtype: KX_TRUE or KX_FALSE """ @@ -4574,29 +4602,32 @@ class SCA_JoystickSensor(SCA_ISensor): """ def getIndex(): """ - DEPRECATED: use the 'index' property. Returns the joystick index to use (from 1 to 8). + + @deprecated: Use the L{index} property instead. @rtype: integer """ def setIndex(index): """ - DEPRECATED: use the 'index' property. Sets the joystick index to use. + + @deprecated: Use the L{index} property instead. @param index: The index of this joystick sensor, Clamped between 1 and 8. @type index: integer @note: This is only useful when you have more then 1 joystick connected to your computer - multiplayer games. """ def getAxis(): """ - DEPRECATED: use the 'axis' property. Returns the current axis this sensor reacts to. See L{getAxisValue()} for the current axis state. + + @deprecated: Use the L{axis} property instead. @rtype: list @return: 2 values returned are [axisIndex, axisDirection] - see L{setAxis()} for their purpose. @note: When the "All Events" toggle is set, this option has no effect. """ def setAxis(axisIndex, axisDirection): """ - DEPRECATED: use the 'axis' property. + @deprecated: Use the L{axis} property instead. @param axisIndex: Set the axis index to use when detecting axis movement. @type axisIndex: integer from 1 to 2 @param axisDirection: Set the axis direction used for detecting motion. 0:right, 1:up, 2:left, 3:down. @@ -4605,8 +4636,9 @@ class SCA_JoystickSensor(SCA_ISensor): """ def getAxisValue(): """ - DEPRECATED: use the 'axisPosition' property. Returns the state of the joysticks axis. See differs to L{getAxis()} returning the current state of the joystick. + + @deprecated: Use the L{axisPosition} property instead. @rtype: list @return: 4 values, each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing. @@ -4617,72 +4649,83 @@ class SCA_JoystickSensor(SCA_ISensor): """ def getThreshold(): """ - DEPRECATED: use the 'threshold' property. Get the axis threshold. See L{setThreshold()} for details. + + @deprecated: Use the L{threshold} property instead. @rtype: integer """ def setThreshold(threshold): """ - DEPRECATED: use the 'threshold' property. Set the axis threshold. + + @deprecated: Use the L{threshold} property instead. @param threshold: Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive. @type threshold: integer """ def getButton(): """ - DEPRECATED: use the 'button' property. Returns the button index the sensor reacts to. See L{getButtonValue()} for a list of pressed buttons. + + @deprecated: Use the L{button} property instead. @rtype: integer @note: When the "All Events" toggle is set, this option has no effect. """ def setButton(index): """ - DEPRECATED: use the 'button' property. Sets the button index the sensor reacts to when the "All Events" option is not set. + + @deprecated: Use the L{button} property instead. @note: When the "All Events" toggle is set, this option has no effect. """ def getButtonValue(): """ - DEPRECATED: use the 'getButtonActiveList' method. Returns a list containing the indicies of the currently pressed buttons. + + @deprecated: Use the L{getButtonActiveList} method instead. @rtype: list """ def getHat(): """ - DEPRECATED: use the 'hat' property. Returns the current hat direction this sensor is set to. [hatNumber, hatDirection]. + + @deprecated: Use the L{hat} property instead. @rtype: list @note: When the "All Events" toggle is set, this option has no effect. """ def setHat(index,direction): """ - DEPRECATED: use the 'hat' property. Sets the hat index the sensor reacts to when the "All Events" option is not set. + + @deprecated: Use the L{hat} property instead. @type index: integer """ def getNumAxes(): """ - DEPRECATED: use the 'numAxis' property. Returns the number of axes for the joystick at this index. + + @deprecated: Use the L{numAxis} property instead. @rtype: integer """ def getNumButtons(): """ - DEPRECATED: use the 'numButtons' property. Returns the number of buttons for the joystick at this index. + + @deprecated: Use the L{numButtons} property instead. @rtype: integer """ def getNumHats(): """ - DEPRECATED: use the 'numHats' property. Returns the number of hats for the joystick at this index. + + @deprecated: Use the L{numHats} property instead. @rtype: integer """ def isConnected(): """ - DEPRECATED: use the 'connected' property. Returns True if a joystick is detected at this joysticks index. + + @deprecated: Use the L{connected} property instead. @rtype: bool """ @@ -4731,8 +4774,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Returns the key code this sensor is looking for. - B{DEPRECATED: Use the "key" property instead}. - + @deprecated: Use the L{key} property instead. @rtype: keycode from L{GameKeys} module """ @@ -4740,8 +4782,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Set the key this sensor should listen for. - B{DEPRECATED: Use the "key" property instead}. - + @deprecated: Use the L{key} property instead. @type keycode: keycode from L{GameKeys} module """ @@ -4749,8 +4790,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Returns the key code for the first modifier this sensor is looking for. - B{DEPRECATED: Use the "hold1" property instead}. - + @deprecated: Use the L{hold1} property instead. @rtype: keycode from L{GameKeys} module """ @@ -4758,8 +4798,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Sets the key code for the first modifier this sensor should look for. - B{DEPRECATED: Use the "hold1" property instead}. - + @deprecated: Use the L{hold1} property instead. @type keycode: keycode from L{GameKeys} module """ @@ -4767,8 +4806,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Returns the key code for the second modifier this sensor is looking for. - B{DEPRECATED: Use the "hold2" property instead}. - + @deprecated: Use the L{hold2} property instead. @rtype: keycode from L{GameKeys} module """ @@ -4776,8 +4814,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Sets the key code for the second modifier this sensor should look for. - B{DEPRECATED: Use the "hold2" property instead.} - + @deprecated: Use the L{hold2} property instead. @type keycode: keycode from L{GameKeys} module """ @@ -4785,8 +4822,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Get a list of keys that have either been pressed, or just released this frame. - B{DEPRECATED: Use "events" instead.} - + @deprecated: Use the L{events} property instead. @rtype: list of key status. [[keycode, status]] """ @@ -4794,8 +4830,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Get a list of currently pressed keys that have either been pressed, or just released - B{DEPRECATED: Use "events" instead.} - + @deprecated: Use the L{events} property instead. @rtype: list of key status. [[keycode, status]] """ @@ -4833,36 +4868,36 @@ class SCA_PropertyActuator(SCA_IActuator): """ def setProperty(prop): """ - DEPRECATED: use the 'property' property Set the property on which to operate. If there is no property of this name, the call is ignored. + @deprecated: Use the L{property} property instead. @type prop: string @param prop: The name of the property to set. """ def getProperty(): """ - DEPRECATED: use the 'property' property Returns the name of the property on which to operate. + @deprecated: Use the L{property} property instead. @rtype: string """ def setValue(value): """ - DEPRECATED: use the 'value' property Set the value with which the actuator operates. If the value is not compatible with the type of the property, the subsequent action is ignored. + @deprecated: Use the L{value} property instead. @type value: string """ def getValue(): """ - DEPRECATED: use the 'value' property Gets the value with which this actuator operates. + @deprecated: Use the L{value} property instead. @rtype: string """ @@ -4884,9 +4919,9 @@ class SCA_PropertySensor(SCA_ISensor): def getType(): """ - DEPRECATED: use the type property Gets when to activate this sensor. + @deprecated: Use the L{type} property instead. @return: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL, KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED, or KX_PROPSENSOR_EXPRESSION. @@ -4894,9 +4929,9 @@ class SCA_PropertySensor(SCA_ISensor): def setType(checktype): """ - DEPRECATED: use the type property Set the type of check to perform. + @deprecated: Use the L{type} property instead. @type checktype: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL, KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED, or KX_PROPSENSOR_EXPRESSION. @@ -4904,35 +4939,35 @@ class SCA_PropertySensor(SCA_ISensor): def getProperty(): """ - DEPRECATED: use the property property Return the property with which the sensor operates. + @deprecated: Use the L{property} property instead. @rtype: string @return: the name of the property this sensor is watching. """ def setProperty(name): """ - DEPRECATED: use the property property Sets the property with which to operate. If there is no property of that name, this call is ignored. + @deprecated: Use the L{property} property instead. @type name: string. """ def getValue(): """ - DEPRECATED: use the value property Return the value with which the sensor compares to the value of the property. + @deprecated: Use the L{value} property instead. @rtype: string @return: the value of the property this sensor is watching. """ def setValue(value): """ - DEPRECATED: use the value property Set the value with which the sensor operates. If the value is not compatible with the type of the property, the subsequent action is ignored. + @deprecated: Use the L{value} property instead. @type value: string """ @@ -4960,16 +4995,16 @@ class SCA_PythonController(SCA_IController): """ def getScript(): """ - DEPRECATED: use the script property Gets the Python script this controller executes. + @deprecated: Use the L{script} property instead. @rtype: string """ def setScript(script): """ - DEPRECATED: use the script property Sets the Python script this controller executes. + @deprecated: Use the L{script} property instead. @type script: string. """ @@ -5004,46 +5039,46 @@ class SCA_RandomActuator(SCA_IActuator): """ def setSeed(seed): """ - DEPRECATED: use the seed property Sets the seed of the random number generator. Equal seeds produce equal series. If the seed is 0, the generator will produce the same value on every call. + @deprecated: Use the L{seed} property instead. @type seed: integer """ def getSeed(): """ - DEPRECATED: use the seed property Returns the initial seed of the generator. + @deprecated: Use the L{seed} property instead. @rtype: integer """ def getPara1(): """ - DEPRECATED: use the para1 property Returns the first parameter of the active distribution. Refer to the documentation of the generator types for the meaning of this value. + @deprecated: Use the L{para1} property instead. @rtype: float """ def getPara2(): """ - DEPRECATED: use the para2 property Returns the second parameter of the active distribution. Refer to the documentation of the generator types for the meaning of this value. + @deprecated: Use the L{para2} property instead. @rtype: float """ def getDistribution(): """ - DEPRECATED: use the distribution property Returns the type of random distribution. + @deprecated: Use the L{distribution} property instead. @rtype: distribution type @return: KX_RANDOMACT_BOOL_CONST, KX_RANDOMACT_BOOL_UNIFORM, KX_RANDOMACT_BOOL_BERNOUILLI, KX_RANDOMACT_INT_CONST, KX_RANDOMACT_INT_UNIFORM, KX_RANDOMACT_INT_POISSON, @@ -5052,19 +5087,19 @@ class SCA_RandomActuator(SCA_IActuator): """ def setProperty(property): """ - DEPRECATED: use the property property Set the property to which the random value is assigned. If the generator and property types do not match, the assignment is ignored. + @deprecated: Use the L{property} property instead. @type property: string @param property: The name of the property to set. """ def getProperty(): """ - DEPRECATED: use the property property Returns the name of the property to set. + @deprecated: Use the L{property} property instead. @rtype: string """ def setBoolConst(value): @@ -5378,9 +5413,9 @@ class KX_Camera(KX_GameObject): def enableViewport(viewport): """ - DEPRECATED: use the isViewport property Use this camera to draw a viewport on the screen (for split screen games or overlay scenes). The viewport region is defined with L{setViewport}. + @deprecated: Use the L{isViewport} property instead. @type viewport: bool @param viewport: the new viewport status """ -- cgit v1.2.3 From 77f321d15fbd39d42700b43909d6d7ec8bbc0262 Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Wed, 13 May 2009 15:41:33 +0000 Subject: Python API ---------- Fix problem with ShrinkWrap PROJECT_OVER_NORMAL setting. --- source/blender/python/api2_2x/Modifier.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Modifier.c b/source/blender/python/api2_2x/Modifier.c index 49220bcd05e..db2afe1072c 100644 --- a/source/blender/python/api2_2x/Modifier.c +++ b/source/blender/python/api2_2x/Modifier.c @@ -1046,7 +1046,7 @@ static PyObject *shrinkwrap_getter( BPy_Modifier * self, int type ) ( md->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS) ) ; case EXPP_MOD_PROJECT_OVER_NORMAL: return PyBool_FromLong( ( long ) - ( md->projAxis & MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) ) ; + ( md->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) ) ; case EXPP_MOD_SUBSURFLEVELS: return PyInt_FromLong( ( long )md->subsurfLevels ); default: @@ -1107,10 +1107,10 @@ static int shrinkwrap_setter( BPy_Modifier *self, int type, PyObject *value ) case EXPP_MOD_PROJECT_OVER_Z_AXIS: return EXPP_setBitfield( value, &md->projAxis, MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS, 'h' ); - case EXPP_MOD_PROJECT_OVER_NORMAL: - return EXPP_setBitfield( value, &md->projAxis, - MOD_SHRINKWRAP_PROJECT_OVER_NORMAL, 'h' ); - + case EXPP_MOD_PROJECT_OVER_NORMAL:{ + md->projAxis = MOD_SHRINKWRAP_PROJECT_OVER_NORMAL; + return 0; + } case EXPP_MOD_ALLOW_POS_DIR: return EXPP_setBitfield( value, &md->shrinkOpts, MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR, 'h' ); @@ -1974,8 +1974,7 @@ for var in st.replace(',','').split('\n'): PyConstant_Insert( d, "LOCK_AXIS_X", PyInt_FromLong( EXPP_MOD_LOCK_AXIS_X ) ); PyConstant_Insert( d, "LOCK_AXIS_Y", - PyInt_FromLong( EXPP_MOD_LOCK_AXIS_Y ) ); - + PyInt_FromLong( EXPP_MOD_LOCK_AXIS_Y ) ); PyConstant_Insert( d, "OBJECT_AUX", PyInt_FromLong( EXPP_MOD_OBJECT_AUX ) ); PyConstant_Insert( d, "KEEPDIST", @@ -1985,7 +1984,9 @@ for var in st.replace(',','').split('\n'): PyConstant_Insert( d, "PROJECT_OVER_Y_AXIS", PyInt_FromLong( EXPP_MOD_PROJECT_OVER_Y_AXIS ) ); PyConstant_Insert( d, "PROJECT_OVER_Z_AXIS", - PyInt_FromLong( EXPP_MOD_PROJECT_OVER_Z_AXIS ) ); + PyInt_FromLong( EXPP_MOD_PROJECT_OVER_Z_AXIS ) ); + PyConstant_Insert( d, "PROJECT_OVER_NORMAL", + PyInt_FromLong( EXPP_MOD_PROJECT_OVER_NORMAL ) ); PyConstant_Insert( d, "SUBSURFLEVELS", PyInt_FromLong( EXPP_MOD_SUBSURFLEVELS ) ); PyConstant_Insert( d, "ALLOW_POS_DIR", -- cgit v1.2.3 From f5bacc6c8a6bf06c20301fbfdc36d7b5b9de041d Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 13 May 2009 16:48:33 +0000 Subject: BGE API cleanup: motion actuator. Apply patch from Moguri. --- source/gameengine/Ketsji/KX_ObjectActuator.cpp | 185 ++++++++++++++++++++++--- source/gameengine/Ketsji/KX_ObjectActuator.h | 79 ++++++++--- source/gameengine/PyDoc/GameTypes.py | 90 +++++++++--- 3 files changed, 298 insertions(+), 56 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index e3d7a0f4b71..0232e3407b0 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -31,6 +31,7 @@ #include "KX_ObjectActuator.h" #include "KX_GameObject.h" +#include "KX_PyMath.h" // For PyVecTo - should this include be put in PyObjectPlus? #include "KX_IPhysicsController.h" #ifdef HAVE_CONFIG_H @@ -76,7 +77,10 @@ KX_ObjectActuator( { // in servo motion, the force is local if the target velocity is local m_bitLocalFlag.Force = m_bitLocalFlag.LinearVelocity; + + m_pid = m_torque; } + UpdateFuzzyFlags(); } @@ -132,7 +136,7 @@ bool KX_ObjectActuator::Update() MT_Vector3 dv = e - m_previous_error; MT_Vector3 I = m_error_accumulator + e; - m_force = m_torque.x()*e+m_torque.y()*I+m_torque.z()*dv; + m_force = m_pid.x()*e+m_pid.y()*I+m_pid.z()*dv; // to automatically adapt the PID coefficient to mass; m_force *= mass; if (m_bitLocalFlag.Torque) @@ -306,6 +310,7 @@ PyParentObject KX_ObjectActuator::Parents[] = { }; PyMethodDef KX_ObjectActuator::Methods[] = { + // Deprecated -----> {"getForce", (PyCFunction) KX_ObjectActuator::sPyGetForce, METH_NOARGS}, {"setForce", (PyCFunction) KX_ObjectActuator::sPySetForce, METH_VARARGS}, {"getTorque", (PyCFunction) KX_ObjectActuator::sPyGetTorque, METH_NOARGS}, @@ -329,40 +334,163 @@ PyMethodDef KX_ObjectActuator::Methods[] = { {"setPID", (PyCFunction) KX_ObjectActuator::sPyGetPID, METH_NOARGS}, {"getPID", (PyCFunction) KX_ObjectActuator::sPySetPID, METH_VARARGS}, - + // <----- Deprecated {NULL,NULL} //Sentinel }; PyAttributeDef KX_ObjectActuator::Attributes[] = { - //KX_PYATTRIBUTE_TODO("force"), - //KX_PYATTRIBUTE_TODO("torque"), - //KX_PYATTRIBUTE_TODO("dLoc"), - //KX_PYATTRIBUTE_TODO("dRot"), - //KX_PYATTRIBUTE_TODO("linV"), - //KX_PYATTRIBUTE_TODO("angV"), - //KX_PYATTRIBUTE_TODO("damping"), - //KX_PYATTRIBUTE_TODO("forceLimitX"), - //KX_PYATTRIBUTE_TODO("forceLimitY"), - //KX_PYATTRIBUTE_TODO("forceLimitZ"), - //KX_PYATTRIBUTE_TODO("pid"), + KX_PYATTRIBUTE_VECTOR_RW_CHECK("force", -1000, 1000, false, KX_ObjectActuator, m_force, PyUpdateFuzzyFlags), + KX_PYATTRIBUTE_BOOL_RW("useLocalForce", KX_ObjectActuator, m_bitLocalFlag.Force), + KX_PYATTRIBUTE_VECTOR_RW_CHECK("torque", -1000, 1000, false, KX_ObjectActuator, m_torque, PyUpdateFuzzyFlags), + KX_PYATTRIBUTE_BOOL_RW("useLocalTorque", KX_ObjectActuator, m_bitLocalFlag.Torque), + KX_PYATTRIBUTE_VECTOR_RW_CHECK("dLoc", -1000, 1000, false, KX_ObjectActuator, m_dloc, PyUpdateFuzzyFlags), + KX_PYATTRIBUTE_BOOL_RW("useLocalDLoc", KX_ObjectActuator, m_bitLocalFlag.DLoc), + KX_PYATTRIBUTE_VECTOR_RW_CHECK("dRot", -1000, 1000, false, KX_ObjectActuator, m_drot, PyUpdateFuzzyFlags), + KX_PYATTRIBUTE_BOOL_RW("useLocalDRot", KX_ObjectActuator, m_bitLocalFlag.DRot), + KX_PYATTRIBUTE_VECTOR_RW_CHECK("linV", -1000, 1000, false, KX_ObjectActuator, m_linear_velocity, PyUpdateFuzzyFlags), + KX_PYATTRIBUTE_BOOL_RW("useLocalLinV", KX_ObjectActuator, m_bitLocalFlag.LinearVelocity), + KX_PYATTRIBUTE_VECTOR_RW_CHECK("angV", -1000, 1000, false, KX_ObjectActuator, m_angular_velocity, PyUpdateFuzzyFlags), + KX_PYATTRIBUTE_BOOL_RW("useLocalAngV", KX_ObjectActuator, m_bitLocalFlag.AngularVelocity), + KX_PYATTRIBUTE_SHORT_RW("damping", 0, 1000, false, KX_ObjectActuator, m_damping), + KX_PYATTRIBUTE_RW_FUNCTION("forceLimitX", KX_ObjectActuator, pyattr_get_forceLimitX, pyattr_set_forceLimitX), + KX_PYATTRIBUTE_RW_FUNCTION("forceLimitY", KX_ObjectActuator, pyattr_get_forceLimitY, pyattr_set_forceLimitY), + KX_PYATTRIBUTE_RW_FUNCTION("forceLimitZ", KX_ObjectActuator, pyattr_get_forceLimitZ, pyattr_set_forceLimitZ), + KX_PYATTRIBUTE_VECTOR_RW_CHECK("pid", -100, 200, true, KX_ObjectActuator, m_pid, PyCheckPid), { NULL } //Sentinel }; PyObject* KX_ObjectActuator::py_getattro(PyObject *attr) { py_getattro_up(SCA_IActuator); -}; +} + PyObject* KX_ObjectActuator::py_getattro_dict() { py_getattro_dict_up(SCA_IActuator); } +int KX_ObjectActuator::py_setattro(PyObject *attr, PyObject *value) +{ + py_setattro_up(SCA_IActuator); +} + +/* Attribute get/set functions */ + +PyObject* KX_ObjectActuator::pyattr_get_forceLimitX(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + KX_ObjectActuator* self = reinterpret_cast(self_v); + PyObject *retVal = PyList_New(3); + + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(self->m_drot[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(self->m_dloc[0])); + PyList_SET_ITEM(retVal, 2, PyBool_FromLong(self->m_bitLocalFlag.Torque)); + + return retVal; +} + +int KX_ObjectActuator::pyattr_set_forceLimitX(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) +{ + KX_ObjectActuator* self = reinterpret_cast(self_v); + + PyObject* seq = PySequence_Fast(value, ""); + if (seq && PySequence_Fast_GET_SIZE(seq) == 3) + { + self->m_drot[0] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 0)); + self->m_dloc[0] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 1)); + self->m_bitLocalFlag.Torque = (PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 2)) != 0); + + if (!PyErr_Occurred()) + { + Py_DECREF(seq); + return PY_SET_ATTR_SUCCESS; + } + } + + Py_XDECREF(seq); + + PyErr_SetString(PyExc_ValueError, "expected a sequence of 2 floats and a bool"); + return PY_SET_ATTR_FAIL; +} + +PyObject* KX_ObjectActuator::pyattr_get_forceLimitY(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + KX_ObjectActuator* self = reinterpret_cast(self_v); + PyObject *retVal = PyList_New(3); + + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(self->m_drot[1])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(self->m_dloc[1])); + PyList_SET_ITEM(retVal, 2, PyBool_FromLong(self->m_bitLocalFlag.DLoc)); + + return retVal; +} + +int KX_ObjectActuator::pyattr_set_forceLimitY(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) +{ + KX_ObjectActuator* self = reinterpret_cast(self_v); + + PyObject* seq = PySequence_Fast(value, ""); + if (seq && PySequence_Fast_GET_SIZE(seq) == 3) + { + self->m_drot[1] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 0)); + self->m_dloc[1] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 1)); + self->m_bitLocalFlag.DLoc = (PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 2)) != 0); + + if (!PyErr_Occurred()) + { + Py_DECREF(seq); + return PY_SET_ATTR_SUCCESS; + } + } + + Py_XDECREF(seq); + + PyErr_SetString(PyExc_ValueError, "expected a sequence of 2 floats and a bool"); + return PY_SET_ATTR_FAIL; +} + +PyObject* KX_ObjectActuator::pyattr_get_forceLimitZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + KX_ObjectActuator* self = reinterpret_cast(self_v); + PyObject *retVal = PyList_New(3); + + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(self->m_drot[2])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(self->m_dloc[2])); + PyList_SET_ITEM(retVal, 2, PyBool_FromLong(self->m_bitLocalFlag.DRot)); + + return retVal; +} + +int KX_ObjectActuator::pyattr_set_forceLimitZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) +{ + KX_ObjectActuator* self = reinterpret_cast(self_v); + + PyObject* seq = PySequence_Fast(value, ""); + if (seq && PySequence_Fast_GET_SIZE(seq) == 3) + { + self->m_drot[2] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 0)); + self->m_dloc[2] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 1)); + self->m_bitLocalFlag.DRot = (PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 2)) != 0); + + if (!PyErr_Occurred()) + { + Py_DECREF(seq); + return PY_SET_ATTR_SUCCESS; + } + } + + Py_XDECREF(seq); + + PyErr_SetString(PyExc_ValueError, "expected a sequence of 2 floats and a bool"); + return PY_SET_ATTR_FAIL; +} + /* 1. set ------------------------------------------------------------------ */ /* Removed! */ /* 2. getForce */ PyObject* KX_ObjectActuator::PyGetForce() { + ShowDeprecationWarning("getForce()", "the force and the useLocalForce properties"); PyObject *retVal = PyList_New(4); PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_force[0])); @@ -375,6 +503,7 @@ PyObject* KX_ObjectActuator::PyGetForce() /* 3. setForce */ PyObject* KX_ObjectActuator::PySetForce(PyObject* args) { + ShowDeprecationWarning("setForce()", "the force and the useLocalForce properties"); float vecArg[3]; int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi:setForce", &vecArg[0], &vecArg[1], @@ -390,6 +519,7 @@ PyObject* KX_ObjectActuator::PySetForce(PyObject* args) /* 4. getTorque */ PyObject* KX_ObjectActuator::PyGetTorque() { + ShowDeprecationWarning("getTorque()", "the torque and the useLocalTorque properties"); PyObject *retVal = PyList_New(4); PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_torque[0])); @@ -402,6 +532,7 @@ PyObject* KX_ObjectActuator::PyGetTorque() /* 5. setTorque */ PyObject* KX_ObjectActuator::PySetTorque(PyObject* args) { + ShowDeprecationWarning("setTorque()", "the torque and the useLocalTorque properties"); float vecArg[3]; int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi:setTorque", &vecArg[0], &vecArg[1], @@ -417,6 +548,7 @@ PyObject* KX_ObjectActuator::PySetTorque(PyObject* args) /* 6. getDLoc */ PyObject* KX_ObjectActuator::PyGetDLoc() { + ShowDeprecationWarning("getDLoc()", "the dLoc and the useLocalDLoc properties"); PyObject *retVal = PyList_New(4); PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_dloc[0])); @@ -429,6 +561,7 @@ PyObject* KX_ObjectActuator::PyGetDLoc() /* 7. setDLoc */ PyObject* KX_ObjectActuator::PySetDLoc(PyObject* args) { + ShowDeprecationWarning("setDLoc()", "the dLoc and the useLocalDLoc properties"); float vecArg[3]; int bToggle = 0; if(!PyArg_ParseTuple(args, "fffi:setDLoc", &vecArg[0], &vecArg[1], @@ -444,6 +577,7 @@ PyObject* KX_ObjectActuator::PySetDLoc(PyObject* args) /* 8. getDRot */ PyObject* KX_ObjectActuator::PyGetDRot() { + ShowDeprecationWarning("getDRot()", "the dRot and the useLocalDRot properties"); PyObject *retVal = PyList_New(4); PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[0])); @@ -456,6 +590,7 @@ PyObject* KX_ObjectActuator::PyGetDRot() /* 9. setDRot */ PyObject* KX_ObjectActuator::PySetDRot(PyObject* args) { + ShowDeprecationWarning("setDRot()", "the dRot and the useLocalDRot properties"); float vecArg[3]; int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi:setDRot", &vecArg[0], &vecArg[1], @@ -470,6 +605,7 @@ PyObject* KX_ObjectActuator::PySetDRot(PyObject* args) /* 10. getLinearVelocity */ PyObject* KX_ObjectActuator::PyGetLinearVelocity() { + ShowDeprecationWarning("getLinearVelocity()", "the linV and the useLocalLinV properties"); PyObject *retVal = PyList_New(4); PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0])); @@ -482,6 +618,7 @@ PyObject* KX_ObjectActuator::PyGetLinearVelocity() { /* 11. setLinearVelocity */ PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* args) { + ShowDeprecationWarning("setLinearVelocity()", "the linV and the useLocalLinV properties"); float vecArg[3]; int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi:setLinearVelocity", &vecArg[0], &vecArg[1], @@ -497,6 +634,7 @@ PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* args) { /* 12. getAngularVelocity */ PyObject* KX_ObjectActuator::PyGetAngularVelocity() { + ShowDeprecationWarning("getAngularVelocity()", "the angV and the useLocalAngV properties"); PyObject *retVal = PyList_New(4); PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0])); @@ -508,6 +646,7 @@ PyObject* KX_ObjectActuator::PyGetAngularVelocity() { } /* 13. setAngularVelocity */ PyObject* KX_ObjectActuator::PySetAngularVelocity(PyObject* args) { + ShowDeprecationWarning("setAngularVelocity()", "the angV and the useLocalAngV properties"); float vecArg[3]; int bToggle = 0; if (!PyArg_ParseTuple(args, "fffi:setAngularVelocity", &vecArg[0], &vecArg[1], @@ -522,6 +661,7 @@ PyObject* KX_ObjectActuator::PySetAngularVelocity(PyObject* args) { /* 13. setDamping */ PyObject* KX_ObjectActuator::PySetDamping(PyObject* args) { + ShowDeprecationWarning("setDamping()", "the damping property"); int damping = 0; if (!PyArg_ParseTuple(args, "i:setDamping", &damping) || damping < 0 || damping > 1000) { return NULL; @@ -532,11 +672,13 @@ PyObject* KX_ObjectActuator::PySetDamping(PyObject* args) { /* 13. getVelocityDamping */ PyObject* KX_ObjectActuator::PyGetDamping() { + ShowDeprecationWarning("getDamping()", "the damping property"); return Py_BuildValue("i",m_damping); } /* 6. getForceLimitX */ PyObject* KX_ObjectActuator::PyGetForceLimitX() { + ShowDeprecationWarning("getForceLimitX()", "the forceLimitX property"); PyObject *retVal = PyList_New(3); PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[0])); @@ -548,6 +690,7 @@ PyObject* KX_ObjectActuator::PyGetForceLimitX() /* 7. setForceLimitX */ PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* args) { + ShowDeprecationWarning("setForceLimitX()", "the forceLimitX property"); float vecArg[2]; int bToggle = 0; if(!PyArg_ParseTuple(args, "ffi:setForceLimitX", &vecArg[0], &vecArg[1], &bToggle)) { @@ -562,6 +705,7 @@ PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* args) /* 6. getForceLimitY */ PyObject* KX_ObjectActuator::PyGetForceLimitY() { + ShowDeprecationWarning("getForceLimitY()", "the forceLimitY property"); PyObject *retVal = PyList_New(3); PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[1])); @@ -573,6 +717,7 @@ PyObject* KX_ObjectActuator::PyGetForceLimitY() /* 7. setForceLimitY */ PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* args) { + ShowDeprecationWarning("setForceLimitY()", "the forceLimitY property"); float vecArg[2]; int bToggle = 0; if(!PyArg_ParseTuple(args, "ffi:setForceLimitY", &vecArg[0], &vecArg[1], &bToggle)) { @@ -587,6 +732,7 @@ PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* args) /* 6. getForceLimitZ */ PyObject* KX_ObjectActuator::PyGetForceLimitZ() { + ShowDeprecationWarning("getForceLimitZ()", "the forceLimitZ property"); PyObject *retVal = PyList_New(3); PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[2])); @@ -598,6 +744,7 @@ PyObject* KX_ObjectActuator::PyGetForceLimitZ() /* 7. setForceLimitZ */ PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* args) { + ShowDeprecationWarning("setForceLimitZ()", "the forceLimitZ property"); float vecArg[2]; int bToggle = 0; if(!PyArg_ParseTuple(args, "ffi:setForceLimitZ", &vecArg[0], &vecArg[1], &bToggle)) { @@ -612,22 +759,24 @@ PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* args) /* 4. getPID */ PyObject* KX_ObjectActuator::PyGetPID() { + ShowDeprecationWarning("getPID()", "the pid property"); PyObject *retVal = PyList_New(3); - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_torque[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_torque[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_torque[2])); + PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_pid[0])); + PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_pid[1])); + PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_pid[2])); return retVal; } /* 5. setPID */ PyObject* KX_ObjectActuator::PySetPID(PyObject* args) { + ShowDeprecationWarning("setPID()", "the pid property"); float vecArg[3]; if (!PyArg_ParseTuple(args, "fff:setPID", &vecArg[0], &vecArg[1], &vecArg[2])) { return NULL; } - m_torque.setValue(vecArg); + m_pid.setValue(vecArg); Py_RETURN_NONE; } diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h index ab5fbe44409..b60f877074d 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.h +++ b/source/gameengine/Ketsji/KX_ObjectActuator.h @@ -36,7 +36,7 @@ #include "MT_Vector3.h" // -// Bitfield that stores the flags for each CValue derived class +// Stores the flags for each CValue derived class // struct KX_LocalFlags { KX_LocalFlags() : @@ -55,20 +55,20 @@ struct KX_LocalFlags { { } - unsigned short Force : 1; - unsigned short Torque : 1; - unsigned short DRot : 1; - unsigned short DLoc : 1; - unsigned short LinearVelocity : 1; - unsigned short AngularVelocity : 1; - unsigned short AddOrSetLinV : 1; - unsigned short ServoControl : 1; - unsigned short ZeroForce : 1; - unsigned short ZeroTorque : 1; - unsigned short ZeroDRot : 1; - unsigned short ZeroDLoc : 1; - unsigned short ZeroLinearVelocity : 1; - unsigned short ZeroAngularVelocity : 1; + bool Force; + bool Torque; + bool DRot; + bool DLoc; + bool LinearVelocity; + bool AngularVelocity; + bool AddOrSetLinV; + bool ServoControl; + bool ZeroForce; + bool ZeroTorque; + bool ZeroDRot; + bool ZeroDLoc; + bool ZeroLinearVelocity; + bool ZeroAngularVelocity; }; class KX_ObjectActuator : public SCA_IActuator @@ -80,7 +80,8 @@ class KX_ObjectActuator : public SCA_IActuator MT_Vector3 m_dloc; MT_Vector3 m_drot; MT_Vector3 m_linear_velocity; - MT_Vector3 m_angular_velocity; + MT_Vector3 m_angular_velocity; + MT_Vector3 m_pid; MT_Scalar m_linear_length2; MT_Scalar m_angular_length2; // used in damping @@ -155,6 +156,7 @@ public: virtual PyObject* py_getattro(PyObject *attr); virtual PyObject* py_getattro_dict(); + virtual int py_setattro(PyObject *attr, PyObject *value); KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForce); KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForce); @@ -178,6 +180,51 @@ public: KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitZ); KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetPID); KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetPID); + + /* Attributes */ + static PyObject* pyattr_get_forceLimitX(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_forceLimitX(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_forceLimitY(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_forceLimitY(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_forceLimitZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_forceLimitZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + + // This lets the attribute macros use UpdateFuzzyFlags() + static int PyUpdateFuzzyFlags(void *self, const PyAttributeDef *attrdef) + { + KX_ObjectActuator* act = reinterpret_cast(self); + act->UpdateFuzzyFlags(); + return 0; + } + + // This is the keep the PID values in check after they are assigned with Python + static int PyCheckPid(void *self, const PyAttributeDef *attrdef) + { + KX_ObjectActuator* act = reinterpret_cast(self); + + //P 0 to 200 + if (act->m_pid[0] < 0) { + act->m_pid[0] = 0; + } else if (act->m_pid[0] > 200) { + act->m_pid[0] = 200; + } + + //I 0 to 3 + if (act->m_pid[1] < 0) { + act->m_pid[1] = 0; + } else if (act->m_pid[1] > 3) { + act->m_pid[1] = 3; + } + + //D -100 to 100 + if (act->m_pid[2] < -100) { + act->m_pid[2] = -100; + } else if (act->m_pid[2] > 100) { + act->m_pid[2] = 100; + } + + return 0; + } }; #endif //__KX_OBJECTACTUATOR diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index d1b92e37099..828435b813a 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -2574,17 +2574,63 @@ class KX_ObjectActuator(SCA_IActuator): The object actuator ("Motion Actuator") applies force, torque, displacement, angular displacement, velocity, or angular velocity to an object. Servo control allows to regulate force to achieve a certain speed target. + + @ivar force: The force applied by the actuator + @type force: list [x, y, z] + @ivar useLocalForce: A flag specifying if the force is local + @type force: bool + @ivar torque: The torque applied by the actuator + @type torque: list [x, y, z] + @ivar useLocalTorque: A flag specifying if the torque is local + @type useLocalTorque: bool + @ivar dLoc: The displacement vector applied by the actuator + @type dLoc: list [x, y, z] + @ivar useLocalDLoc: A flag specifying if the dLoc is local + @type useLocalDLoc: bool + @ivar dRot: The angular displacement vector applied by the actuator + - note: Since the displacement is applied every frame, you must adjust the displacement + based on the frame rate, or you game experience will depend on the player's computer + speed. + @type dRot: list [x, y, z] + @ivar useLocalDRot: A flag specifying if the dRot is local + @type useLocalDRot: bool + @ivar linV: The linear velocity applied by the actuator + @type linV: list [x, y, z] + @ivar useLocalLinV: A flag specifying if the linear velocity is local + - note: This is the target speed for servo controllers + @type useLocalLinV: bool + @ivar angV: The angular velocity applied by the actuator + @type angV: list [x, y, z] + @ivar useLocalAngV: A flag specifying if the angular velocity is local + @type useLocalAngV: bool + + @ivar damping: The damping parameter of the servo controller + @type damping: short + + @ivar forceLimitX: The min/max force limit along the X axis and activates or deactivates the limits in the servo controller + @type forceLimitX: list [min(float), max(float), bool] + @ivar forceLimitY: The min/max force limit along the Y axis and activates or deactivates the limits in the servo controller + @type forceLimitY: list [min(float), max(float), bool] + @ivar forceLimitZ: The min/max force limit along the Z axis and activates or deactivates the limits in the servo controller + @type forceLimitZ: list [min(float), max(float), bool] + + @ivar pid: The PID coefficients of the servo controller + @type pid: list of floats [proportional, integral, derivate] + + @group Deprecated: getForce, setForce, getTorque, setTorque, getDLoc, setDLoc, getDRot, setDRot, getLinearVelocity, setLinearVelocity, getAngularVelocity, + setAngularVelocity, getDamping, setDamping, getForceLimitX, setForceLimitX, getForceLimitY, setForceLimitY, getForceLimitZ, setForceLimitZ, + getPID, setPID """ def getForce(): """ - Returns the force applied by the actuator. + Returns the force applied by the actuator. (B{deprecated}) @rtype: list [fx, fy, fz, local] @return: A four item list, containing the vector force, and a flag specifying whether the force is local. """ def setForce(fx, fy, fz, local): """ - Sets the force applied by the actuator. + Sets the force applied by the actuator. (B{deprecated}) @type fx: float @param fx: the x component of the force. @@ -2598,7 +2644,7 @@ class KX_ObjectActuator(SCA_IActuator): """ def getTorque(): """ - Returns the torque applied by the actuator. + Returns the torque applied by the actuator. (B{deprecated}) @rtype: list [S{Tau}x, S{Tau}y, S{Tau}z, local] @return: A four item list, containing the vector torque, and a flag specifying whether @@ -2606,7 +2652,7 @@ class KX_ObjectActuator(SCA_IActuator): """ def setTorque(tx, ty, tz, local): """ - Sets the torque applied by the actuator. + Sets the torque applied by the actuator. (B{deprecated}) @type tx: float @param tx: the x component of the torque. @@ -2620,7 +2666,7 @@ class KX_ObjectActuator(SCA_IActuator): """ def getDLoc(): """ - Returns the displacement vector applied by the actuator. + Returns the displacement vector applied by the actuator. (B{deprecated}) @rtype: list [dx, dy, dz, local] @return: A four item list, containing the vector displacement, and whether @@ -2629,7 +2675,7 @@ class KX_ObjectActuator(SCA_IActuator): """ def setDLoc(dx, dy, dz, local): """ - Sets the displacement vector applied by the actuator. + Sets the displacement vector applied by the actuator. (B{deprecated}) Since the displacement is applied every frame, you must adjust the displacement based on the frame rate, or you game experience will depend on the player's computer @@ -2647,7 +2693,7 @@ class KX_ObjectActuator(SCA_IActuator): """ def getDRot(): """ - Returns the angular displacement vector applied by the actuator. + Returns the angular displacement vector applied by the actuator. (B{deprecated}) @rtype: list [dx, dy, dz, local] @return: A four item list, containing the angular displacement vector, and whether @@ -2656,7 +2702,7 @@ class KX_ObjectActuator(SCA_IActuator): """ def setDRot(dx, dy, dz, local): """ - Sets the angular displacement vector applied by the actuator. + Sets the angular displacement vector applied by the actuator. (B{deprecated}) Since the displacement is applied every frame, you must adjust the displacement based on the frame rate, or you game experience will depend on the player's computer @@ -2675,7 +2721,7 @@ class KX_ObjectActuator(SCA_IActuator): def getLinearVelocity(): """ Returns the linear velocity applied by the actuator. - For the servo control actuator, this is the target speed. + For the servo control actuator, this is the target speed. (B{deprecated}) @rtype: list [vx, vy, vz, local] @return: A four item list, containing the vector velocity, and whether the velocity is applied in local coordinates (True) or world coordinates (False) @@ -2683,7 +2729,7 @@ class KX_ObjectActuator(SCA_IActuator): def setLinearVelocity(vx, vy, vz, local): """ Sets the linear velocity applied by the actuator. - For the servo control actuator, sets the target speed. + For the servo control actuator, sets the target speed. (B{deprecated}) @type vx: float @param vx: the x component of the velocity vector. @@ -2697,7 +2743,7 @@ class KX_ObjectActuator(SCA_IActuator): """ def getAngularVelocity(): """ - Returns the angular velocity applied by the actuator. + Returns the angular velocity applied by the actuator. (B{deprecated}) @rtype: list [S{omega}x, S{omega}y, S{omega}z, local] @return: A four item list, containing the vector velocity, and whether @@ -2706,7 +2752,7 @@ class KX_ObjectActuator(SCA_IActuator): """ def setAngularVelocity(wx, wy, wz, local): """ - Sets the angular velocity applied by the actuator. + Sets the angular velocity applied by the actuator. (B{deprecated}) @type wx: float @param wx: the x component of the velocity vector. @@ -2720,21 +2766,21 @@ class KX_ObjectActuator(SCA_IActuator): """ def getDamping(): """ - Returns the damping parameter of the servo controller. + Returns the damping parameter of the servo controller. (B{deprecated}) @rtype: integer @return: the time constant of the servo controller in frame unit. """ def setDamping(damp): """ - Sets the damping parameter of the servo controller. + Sets the damping parameter of the servo controller. (B{deprecated}) @type damp: integer @param damp: the damping parameter in frame unit. """ def getForceLimitX(): """ - Returns the min/max force limit along the X axis used by the servo controller. + Returns the min/max force limit along the X axis used by the servo controller. (B{deprecated}) @rtype: list [min, max, enabled] @return: A three item list, containing the min and max limits of the force as float @@ -2742,7 +2788,7 @@ class KX_ObjectActuator(SCA_IActuator): """ def setForceLimitX(min, max, enable): """ - Sets the min/max force limit along the X axis and activates or deactivates the limits in the servo controller. + Sets the min/max force limit along the X axis and activates or deactivates the limits in the servo controller. (B{deprecated}) @type min: float @param min: the minimum value of the force along the X axis. @@ -2754,7 +2800,7 @@ class KX_ObjectActuator(SCA_IActuator): """ def getForceLimitY(): """ - Returns the min/max force limit along the Y axis used by the servo controller. + Returns the min/max force limit along the Y axis used by the servo controller. (B{deprecated}) @rtype: list [min, max, enabled] @return: A three item list, containing the min and max limits of the force as float @@ -2762,7 +2808,7 @@ class KX_ObjectActuator(SCA_IActuator): """ def setForceLimitY(min, max, enable): """ - Sets the min/max force limit along the Y axis and activates or deactivates the limits in the servo controller. + Sets the min/max force limit along the Y axis and activates or deactivates the limits in the servo controller. (B{deprecated}) @type min: float @param min: the minimum value of the force along the Y axis. @@ -2774,7 +2820,7 @@ class KX_ObjectActuator(SCA_IActuator): """ def getForceLimitZ(): """ - Returns the min/max force limit along the Z axis used by the servo controller. + Returns the min/max force limit along the Z axis used by the servo controller. (B{deprecated}) @rtype: list [min, max, enabled] @return: A three item list, containing the min and max limits of the force as float @@ -2782,7 +2828,7 @@ class KX_ObjectActuator(SCA_IActuator): """ def setForceLimitZ(min, max, enable): """ - Sets the min/max force limit along the Z axis and activates or deactivates the limits in the servo controller. + Sets the min/max force limit along the Z axis and activates or deactivates the limits in the servo controller. (B{deprecated}) @type min: float @param min: the minimum value of the force along the Z axis. @@ -2794,7 +2840,7 @@ class KX_ObjectActuator(SCA_IActuator): """ def getPID(): """ - Returns the PID coefficient of the servo controller. + Returns the PID coefficient of the servo controller. (B{deprecated}) @rtype: list [P, I, D] @return: A three item list, containing the PID coefficient as floats: @@ -2804,7 +2850,7 @@ class KX_ObjectActuator(SCA_IActuator): """ def setPID(P, I, D): """ - Sets the PID coefficients of the servo controller. + Sets the PID coefficients of the servo controller. (B{deprecated}) @type P: flat @param P: proportional coefficient -- cgit v1.2.3 From c7519789b8a7ba8973b2a165b2d008679c3f8241 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 13 May 2009 17:02:39 +0000 Subject: BGE: 1-liner patch to put the Always sensor in non pulse mode by default. I've seen enough games with Always sensors in pulse mode while they should not; this patch should prevent this common mistake. --- source/blender/blenkernel/intern/sca.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index 47d11bb9d29..bbca97d75f7 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -134,7 +134,7 @@ void init_sensor(bSensor *sens) switch(sens->type) { case SENS_ALWAYS: - sens->pulse = 1; + sens->pulse = 0; break; case SENS_TOUCH: sens->data= MEM_callocN(sizeof(bTouchSensor), "touchsens"); -- cgit v1.2.3 From 240aa6d34d561ac6156eda50ece90130903a2df0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 May 2009 22:52:31 +0000 Subject: * More updates to game engine type docs from Roelf de Kock * FBX Bugfix, was exporting all animation curves as 'Constant' type (no docs for this so could only guess), Thanks to Sander Brandenburg for spotting this problem. Also improved keyframe removal to work on animation curves an angle --- source/gameengine/PyDoc/GameTypes.py | 81 ++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 40 deletions(-) (limited to 'source') diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index 828435b813a..6758824611c 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -512,8 +512,7 @@ class BL_Shader(PyObjectPlus): def delSource(): """ - TODO - Description - + Clear the shader. Use this method before the source is changed with L{setSource}. """ def getFragmentProg(): """ @@ -997,39 +996,56 @@ class KX_BlenderMaterial(PyObjectPlus): # , RAS_IPolyMaterial) """ KX_BlenderMaterial - All placeholders have a __ prefix """ - def __getShader(val): + def getShader(): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float + Returns the material's shader. - @rtype: integer - @return: TODO Description + @rtype: L{BL_Shader} + @return: the material's shader """ - def __setBlending(val): + def setBlending(src, dest): """ - TODO - Description + Set the pixel color arithmetic functions. - @param val: the starting frame of the animation - @type val: float + @param src: Specifies how the red, green, blue, + and alpha source blending factors are computed. + @type src: GL_ZERO, + GL_ONE, + GL_SRC_COLOR, + GL_ONE_MINUS_SRC_COLOR, + GL_DST_COLOR, + GL_ONE_MINUS_DST_COLOR, + GL_SRC_ALPHA, + GL_ONE_MINUS_SRC_ALPHA, + GL_DST_ALPHA, + GL_ONE_MINUS_DST_ALPHA, + GL_SRC_ALPHA_SATURATE + - @rtype: integer - @return: TODO Description + @param dest: Specifies how the red, green, blue, + and alpha destination blending factors are computed. + @type dest: GL_ZERO, + GL_ONE, + GL_SRC_COLOR, + GL_ONE_MINUS_SRC_COLOR, + GL_DST_COLOR, + GL_ONE_MINUS_DST_COLOR, + GL_SRC_ALPHA, + GL_ONE_MINUS_SRC_ALPHA, + GL_DST_ALPHA, + GL_ONE_MINUS_DST_ALPHA, + GL_SRC_ALPHA_SATURATE + """ - def __getMaterialIndex(val): + def getMaterialIndex(): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float + Returns the material's index. @rtype: integer - @return: TODO Description + @return: the material's index """ class KX_CDActuator(SCA_IActuator): @@ -1419,28 +1435,13 @@ class KX_ConstraintWrapper(PyObjectPlus): """ KX_ConstraintWrapper - All placeholders have a __ prefix """ - def __getConstraintId(val): - """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float - - @rtype: integer - @return: TODO Description - """ - - def __testMethod(val): + def getConstraintId(val): """ - TODO - Description - - @param val: the starting frame of the animation - @type val: float + Returns the contraint's ID @rtype: integer - @return: TODO Description + @return: the constraint's ID """ class KX_GameActuator(SCA_IActuator): -- cgit v1.2.3 From 5f78efe19cdea2f508fff41a1723477489d7ac03 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 May 2009 00:10:25 +0000 Subject: print warnings when python attributes and methods conflict with game properties. --- source/gameengine/Converter/KX_ConvertProperties.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source') diff --git a/source/gameengine/Converter/KX_ConvertProperties.cpp b/source/gameengine/Converter/KX_ConvertProperties.cpp index dfbc6f0c48d..e9984ee0525 100644 --- a/source/gameengine/Converter/KX_ConvertProperties.cpp +++ b/source/gameengine/Converter/KX_ConvertProperties.cpp @@ -129,6 +129,22 @@ void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventMan // done with propval, release it propval->Release(); } + + + /* Warn if we double up on attributes, this isnt quite right since it wont find inherited attributes however there arnt many */ + for(PyAttributeDef *attrdef = KX_GameObject::Attributes; attrdef->m_name; attrdef++) { + if(strcmp(prop->name, attrdef->m_name)==0) { + printf("Warning! user defined property name \"%s\" is also a python attribute for object \"%s\"\n\tUse ob[\"%s\"] syntax to avoid conflict\n", prop->name, object->id.name+2, prop->name); + break; + } + } + for(PyMethodDef *methdef = KX_GameObject::Methods; methdef->ml_name; methdef++) { + if(strcmp(prop->name, methdef->ml_name)==0) { + printf("Warning! user defined property name \"%s\" is also a python method for object \"%s\"\n\tUse ob[\"%s\"] syntax to avoid conflict\n", prop->name, object->id.name+2, prop->name); + break; + } + } + /* end warning check */ prop = prop->next; } -- cgit v1.2.3 From d2cff7307d26ada0dd34949d0a9fbb3c37c72f19 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 May 2009 02:21:50 +0000 Subject: [#18685] dark pixels created when during texture "full baking" fix/workaround - offset by a 500th of a pixel to avoid baking missing pixels that are between 2 faces, its still possible pixels could be between faces but much less likely then it is currently with pixel aligned UVs. --- source/blender/render/intern/source/rendercore.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 5dfb509939b..2793e238dc7 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -2542,8 +2542,12 @@ static void shade_tface(BakeShade *bs) /* get pixel level vertex coordinates */ for(a=0; a<4; a++) { - vec[a][0]= tface->uv[a][0]*(float)bs->rectx - 0.5f; - vec[a][1]= tface->uv[a][1]*(float)bs->recty - 0.5f; + /* Note, workaround for pixel aligned UVs which are common and can screw up our intersection tests + * where a pixel gets inbetween 2 faces or the middle of a quad, + * camera aligned quads also have this problem but they are less common. + * Add a small offset to the UVs, fixes bug #18685 - Campbell */ + vec[a][0]= tface->uv[a][0]*(float)bs->rectx - (0.5f + 0.001); + vec[a][1]= tface->uv[a][1]*(float)bs->recty - (0.5f + 0.002); } /* UV indices have to be corrected for possible quad->tria splits */ -- cgit v1.2.3 From d257586fe6d59f9a7c622b460fbe38a168fb5428 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 May 2009 07:59:44 +0000 Subject: BGE Py API scene.active_camera can now be set so you can more easily set the current camera from python scripts without using an actuator. ConvertPythonToCamera utility function to get a camera from a python string or KX_Camera type. --- source/gameengine/Ketsji/KX_Camera.cpp | 54 +++++++++++++++ source/gameengine/Ketsji/KX_Camera.h | 3 + source/gameengine/Ketsji/KX_GameObject.cpp | 4 +- source/gameengine/Ketsji/KX_Scene.cpp | 21 ++++-- source/gameengine/Ketsji/KX_Scene.h | 3 +- source/gameengine/Ketsji/KX_SceneActuator.cpp | 97 ++++++--------------------- source/gameengine/Ketsji/KX_SceneActuator.h | 2 +- source/gameengine/PyDoc/GameTypes.py | 41 +++++------ 8 files changed, 121 insertions(+), 104 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 3ea01cca5ca..df39faf8b22 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -933,3 +933,57 @@ PyObject* KX_Camera::pyattr_get_OUTSIDE(void *self_v, const KX_PYATTRIBUTE_DEF * PyObject* KX_Camera::pyattr_get_INTERSECT(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { return PyInt_FromLong(INTERSECT); } + +bool ConvertPythonToCamera(PyObject * value, KX_Camera **object, bool py_none_ok, const char *error_prefix) +{ + if (value==NULL) { + PyErr_Format(PyExc_TypeError, "%s, python pointer NULL, should never happen", error_prefix); + *object = NULL; + return false; + } + + if (value==Py_None) { + *object = NULL; + + if (py_none_ok) { + return true; + } else { + PyErr_Format(PyExc_TypeError, "%s, expected KX_Camera or a KX_Camera name, None is invalid", error_prefix); + return false; + } + } + + if (PyString_Check(value)) { + STR_String value_str = PyString_AsString(value); + *object = KX_GetActiveScene()->FindCamera(value_str); + + if (*object) { + return true; + } else { + PyErr_Format(PyExc_ValueError, "%s, requested name \"%s\" did not match any KX_Camera in this scene", error_prefix, PyString_AsString(value)); + return false; + } + } + + if (PyObject_TypeCheck(value, &KX_Camera::Type)) { + *object = static_castBGE_PROXY_REF(value); + + /* sets the error */ + if (*object==NULL) { + PyErr_Format(PyExc_SystemError, "%s, " BGE_PROXY_ERROR_MSG, error_prefix); + return false; + } + + return true; + } + + *object = NULL; + + if (py_none_ok) { + PyErr_Format(PyExc_TypeError, "%s, expect a KX_Camera, a string or None", error_prefix); + } else { + PyErr_Format(PyExc_TypeError, "%s, expect a KX_Camera or a string", error_prefix); + } + + return false; +} \ No newline at end of file diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index e99a0594701..ce8bbb8d656 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -41,6 +41,9 @@ #include "IntValue.h" #include "RAS_CameraData.h" +/* utility conversion function */ +bool ConvertPythonToCamera(PyObject * value, KX_Camera **object, bool py_none_ok, const char *error_prefix); + class KX_Camera : public KX_GameObject { Py_Header; diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 4d01d96ced4..fe9fb8bb583 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1819,9 +1819,7 @@ PyObject* KX_GameObject::py_getattro_dict() { int KX_GameObject::py_setattro(PyObject *attr, PyObject *value) // py_setattro method { - int ret; - - ret= py_setattro__internal(attr, value); + int ret= py_setattro__internal(attr, value); if (ret==PY_SET_ATTR_SUCCESS) { /* remove attribute in our own dict to avoid double ups */ diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 84c6d374386..e3622c211ff 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1703,13 +1703,27 @@ PyObject* KX_Scene::pyattr_get_active_camera(void *self_v, const KX_PYATTRIBUTE_ return self->GetActiveCamera()->GetProxy(); } + +int KX_Scene::pyattr_set_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) +{ + KX_Scene* self= static_cast(self_v); + KX_Camera *camOb; + + if (!ConvertPythonToCamera(value, &camOb, false, "scene.active_camera = value: KX_Scene")) + return PY_SET_ATTR_FAIL; + + self->SetActiveCamera(camOb); + return PY_SET_ATTR_SUCCESS; +} + + PyAttributeDef KX_Scene::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("name", KX_Scene, pyattr_get_name), KX_PYATTRIBUTE_RO_FUNCTION("objects", KX_Scene, pyattr_get_objects), KX_PYATTRIBUTE_RO_FUNCTION("objects_inactive", KX_Scene, pyattr_get_objects_inactive), KX_PYATTRIBUTE_RO_FUNCTION("lights", KX_Scene, pyattr_get_lights), KX_PYATTRIBUTE_RO_FUNCTION("cameras", KX_Scene, pyattr_get_cameras), KX_PYATTRIBUTE_RO_FUNCTION("lights", KX_Scene, pyattr_get_lights), - KX_PYATTRIBUTE_RO_FUNCTION("active_camera", KX_Scene, pyattr_get_active_camera), + KX_PYATTRIBUTE_RW_FUNCTION("active_camera", KX_Scene, pyattr_get_active_camera, pyattr_set_active_camera), KX_PYATTRIBUTE_BOOL_RO("suspended", KX_Scene, m_suspend), KX_PYATTRIBUTE_BOOL_RO("activity_culling", KX_Scene, m_activity_culling), KX_PYATTRIBUTE_FLOAT_RW("activity_culling_radius", 0.5f, FLT_MAX, KX_Scene, m_activity_box_radius), @@ -1717,15 +1731,14 @@ PyAttributeDef KX_Scene::Attributes[] = { { NULL } //Sentinel }; - PyObject* KX_Scene::py_getattro__internal(PyObject *attr) { py_getattro_up(PyObjectPlus); } -int KX_Scene::py_setattro__internal(PyObject *attr, PyObject *pyvalue) +int KX_Scene::py_setattro__internal(PyObject *attr, PyObject *value) { - return PyObjectPlus::py_setattro(attr, pyvalue); + py_setattro_up(PyObjectPlus); } PyObject* KX_Scene::py_getattro(PyObject *attr) diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 128f8d23135..5191ea9f23f 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -566,11 +566,12 @@ public: static PyObject* pyattr_get_lights(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_cameras(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_active_camera(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); virtual PyObject* py_getattro(PyObject *attr); /* name, active_camera, gravity, suspended, viewport, framing, activity_culling, activity_culling_radius */ virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *pyvalue); + virtual int py_setattro(PyObject *attr, PyObject *value); virtual int py_delattro(PyObject *attr); virtual PyObject* py_repr(void) { return PyString_FromString(GetName().ReadPtr()); } diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index 64edb6cd6d5..1b790ec9824 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -264,7 +264,7 @@ PyMethodDef KX_SceneActuator::Methods[] = //Deprecated functions ------> {"setUseRestart", (PyCFunction) KX_SceneActuator::sPySetUseRestart, METH_VARARGS, (PY_METHODCHAR)SetUseRestart_doc}, {"setScene", (PyCFunction) KX_SceneActuator::sPySetScene, METH_VARARGS, (PY_METHODCHAR)SetScene_doc}, - {"setCamera", (PyCFunction) KX_SceneActuator::sPySetCamera, METH_VARARGS, (PY_METHODCHAR)SetCamera_doc}, + {"setCamera", (PyCFunction) KX_SceneActuator::sPySetCamera, METH_O, (PY_METHODCHAR)SetCamera_doc}, {"getUseRestart", (PyCFunction) KX_SceneActuator::sPyGetUseRestart, METH_NOARGS, (PY_METHODCHAR)GetUseRestart_doc}, {"getScene", (PyCFunction) KX_SceneActuator::sPyGetScene, METH_NOARGS, (PY_METHODCHAR)GetScene_doc}, {"getCamera", (PyCFunction) KX_SceneActuator::sPyGetCamera, METH_NOARGS, (PY_METHODCHAR)GetCamera_doc}, @@ -308,51 +308,21 @@ int KX_SceneActuator::pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_ KX_SceneActuator* actuator = static_cast(self); KX_Camera *camOb; - if(value==Py_None) - { - if (actuator->m_camera) - actuator->m_camera->UnregisterActuator(actuator); - + if (!ConvertPythonToCamera(value, &camOb, true, "actu.camera = value: KX_SceneActuator")) + return PY_SET_ATTR_FAIL; + + if (actuator->m_camera) + actuator->m_camera->UnregisterActuator(actuator); + + if(camOb==NULL) { actuator->m_camera= NULL; - return 0; } - - if (PyObject_TypeCheck(value, &KX_Camera::Type)) - { - KX_Camera *camOb= static_castBGE_PROXY_REF(value); - - if(camOb==NULL) - { - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); - return 1; - } - - if (actuator->m_camera) - actuator->m_camera->UnregisterActuator(actuator); - + else { actuator->m_camera = camOb; actuator->m_camera->RegisterActuator(actuator); - return 0; - } - - if (PyString_Check(value)) - { - char *camName = PyString_AsString(value); - - camOb = actuator->FindCamera(camName); - if (camOb) - { - if (actuator->m_camera) - actuator->m_camera->UnregisterActuator(actuator); - actuator->m_camera = camOb; - actuator->m_camera->RegisterActuator(actuator); - return 0; - } - PyErr_SetString(PyExc_TypeError, "not a valid camera name"); - return 1; } - PyErr_SetString(PyExc_TypeError, "expected a string or a camera object reference"); - return 1; + + return PY_SET_ATTR_SUCCESS; } @@ -431,47 +401,24 @@ const char KX_SceneActuator::SetCamera_doc[] = "setCamera(camera)\n" "\t- camera: string\n" "\tSet the camera to switch to.\n" ; -PyObject* KX_SceneActuator::PySetCamera(PyObject* args) +PyObject* KX_SceneActuator::PySetCamera(PyObject* value) { ShowDeprecationWarning("setCamera()", "the camera property"); - PyObject *cam; - if (PyArg_ParseTuple(args, "O!:setCamera", &KX_Camera::Type, &cam)) - { - KX_Camera *new_camera; - - new_camera = static_castBGE_PROXY_REF(cam); - if(new_camera==NULL) - { - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); - return NULL; - } - - if (m_camera) - m_camera->UnregisterActuator(this); - - m_camera= new_camera; - - m_camera->RegisterActuator(this); - Py_RETURN_NONE; - } - PyErr_Clear(); - - /* one argument: a scene, ignore the rest */ - char *camName; - if(!PyArg_ParseTuple(args, "s:setCamera", &camName)) - { + KX_Camera *camOb; + + if (!ConvertPythonToCamera(value, &camOb, true, "actu.setCamera(value): KX_SceneActuator")) return NULL; + + if (m_camera) + m_camera->UnregisterActuator(this); + + if(camOb==NULL) { + m_camera= NULL; } - - KX_Camera *camOb = FindCamera(camName); - if (camOb) - { - if (m_camera) - m_camera->UnregisterActuator(this); + else { m_camera = camOb; m_camera->RegisterActuator(this); } - Py_RETURN_NONE; } diff --git a/source/gameengine/Ketsji/KX_SceneActuator.h b/source/gameengine/Ketsji/KX_SceneActuator.h index 315e97e8f70..2412dd02590 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.h +++ b/source/gameengine/Ketsji/KX_SceneActuator.h @@ -108,7 +108,7 @@ class KX_SceneActuator : public SCA_IActuator /* 5. getScene: */ KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetScene); /* 6. setCamera: */ - KX_PYMETHOD_DOC_VARARGS(KX_SceneActuator,SetCamera); + KX_PYMETHOD_DOC_O(KX_SceneActuator,SetCamera); /* 7. getCamera: */ KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetCamera); diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index 6758824611c..e560489f91f 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -235,7 +235,7 @@ class SCA_IController(SCA_ILogicBrick): """ Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active. This for instance will always be true however you could compare with a previous state to see when the state was activated. - GameLogic.getCurrentController().getState() & GameLogic.getCurrentController().getOwner().getState() + GameLogic.getCurrentController().state & GameLogic.getCurrentController().owner.state @deprecated: Use the L{state} property @rtype: int """ @@ -2126,7 +2126,7 @@ class KX_LightObject(KX_GameObject): import GameLogic co = GameLogic.getCurrentController() - light = co.getOwner() + light = co.owner light.energy = 1.0 light.colour = [1.0, 0.0, 0.0] @@ -2187,8 +2187,8 @@ class KX_MeshProxy(SCA_IObject): The correct method of iterating over every L{KX_VertexProxy} in a game object:: import GameLogic - co = GameLogic.getcurrentController() - obj = co.getOwner() + co = GameLogic.getCurrentController() + obj = co.owner m_i = 0 mesh = obj.getMesh(m_i) # There can be more than one mesh... @@ -3177,9 +3177,9 @@ class KX_PolygonMaterial: self.pass_no = 0 return False - obj = GameLogic.getCurrentController().getOwner() + obj = GameLogic.getCurrentController().owner - mesh = obj.getMesh(0) + mesh = obj.meshes[0] for mat in mesh.materials: mat.setCustomMaterial(MyMaterial()) @@ -3596,8 +3596,8 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator): ) co = GameLogic.getCurrentController() - obj = co.getOwner() - act = co.getActuator("LOD." + obj.name) + obj = co.owner + act = co.actuators["LOD." + obj.name] cam = GameLogic.getCurrentScene().active_camera def Depth(pos, plane): @@ -3684,7 +3684,7 @@ class KX_Scene(PyObjectPlus): # Get the depth of an object in the camera view. import GameLogic - obj = GameLogic.getCurrentController().getOwner() + obj = GameLogic.getCurrentController().owner cam = GameLogic.getCurrentScene().active_camera # Depth is negative and decreasing further from the camera @@ -3692,19 +3692,20 @@ class KX_Scene(PyObjectPlus): @bug: All attributes are read only at the moment. - @ivar name: The scene's name + @ivar name: The scene's name, (read-only). @type name: string - @ivar objects: A list of objects in the scene. + @ivar objects: A list of objects in the scene, (read-only). @type objects: L{CListValue} of L{KX_GameObject} - @ivar objects_inactive: A list of objects on background layers (used for the addObject actuator). + @ivar objects_inactive: A list of objects on background layers (used for the addObject actuator), (read-only). @type objects_inactive: L{CListValue} of L{KX_GameObject} - @ivar lights: A list of lights in the scene. + @ivar lights: A list of lights in the scene, (read-only). @type lights: L{CListValue} of L{KX_LightObject} - @ivar cameras: A list of cameras in the scene. + @ivar cameras: A list of cameras in the scene, (read-only). @type cameras: L{CListValue} of L{KX_Camera} - @ivar active_camera: The current active camera + @ivar active_camera: The current active camera. + @note: this can be set directly from python to avoid using the L{KX_SceneActuator} @type active_camera: L{KX_Camera} - @ivar suspended: True if the scene is suspended. + @ivar suspended: True if the scene is suspended, (read-only). @type suspended: boolean @ivar activity_culling: True if the scene is activity culling @type activity_culling: boolean @@ -5328,7 +5329,7 @@ class KX_Camera(KX_GameObject): Example:: import GameLogic co = GameLogic.getCurrentController() - cam = co.GetOwner() + cam = co.owner # A sphere of radius 4.0 located at [x, y, z] = [1.0, 1.0, 1.0] if (cam.sphereInsideFrustum([1.0, 1.0, 1.0], 4) != cam.OUTSIDE): @@ -5344,7 +5345,7 @@ class KX_Camera(KX_GameObject): Example:: import GameLogic co = GameLogic.getCurrentController() - cam = co.GetOwner() + cam = co.owner # Box to test... box = [] @@ -5374,7 +5375,7 @@ class KX_Camera(KX_GameObject): Example:: import GameLogic co = GameLogic.getCurrentController() - cam = co.GetOwner() + cam = co.owner # Test point [0.0, 0.0, 0.0] if (cam.pointInsideFrustum([0.0, 0.0, 0.0])): @@ -5451,7 +5452,7 @@ class KX_Camera(KX_GameObject): [1.0/cam.scaling[0], 1.0/cam.scaling[1], 1.0/cam.scaling[2], 1.0]) co = GameLogic.getCurrentController() - cam = co.getOwner() + cam = co.owner cam.setProjectionMatrix(Perspective(cam))) @type matrix: 4x4 matrix. -- cgit v1.2.3 From a74d2574ee5322dc29754fe2ac93e100fcf73633 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 14 May 2009 09:32:47 +0000 Subject: Bugfix #18725 Particles using group-duplication, with Metaballs in group, enter eternal loop in our code now. This is a non-supported case... metaball code doesn't support recursions. Added a provision in code to catch this case, and print an error in console to denote this. --- source/blender/blenkernel/intern/mball.c | 5 ++++- source/blender/blenkernel/intern/scene.c | 16 ++++++++++++++-- source/blender/makesdna/DNA_scene_types.h | 1 + 3 files changed, 19 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 79205814ae7..97226b5ec42 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -297,7 +297,10 @@ Object *find_basis_mball(Object *basis) splitIDname(basis->id.name+2, basisname, &basisnr); totelem= 0; - next_object(0, 0, 0); + /* XXX recursion check, see scene.c, just too simple code this next_object() */ + if(F_ERROR==next_object(0, 0, 0)) + return NULL; + while(next_object(1, &base, &ob)) { if (ob->type==OB_MBALL) { diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 5def3577218..ed1a77d645e 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -402,16 +402,25 @@ int next_object(int val, Base **base, Object **ob) { static ListBase *duplilist= NULL; static DupliObject *dupob; - static int fase; + static int fase= F_START, in_next_object= 0; int run_again=1; /* init */ if(val==0) { fase= F_START; dupob= NULL; + + /* XXX particle systems with metas+dupligroups call this recursively */ + /* see bug #18725 */ + if(in_next_object) { + printf("ERROR: MetaBall generation called recursively, not supported\n"); + + return F_ERROR; + } } else { - + in_next_object= 1; + /* run_again is set when a duplilist has been ended */ while(run_again) { run_again= 0; @@ -493,6 +502,9 @@ int next_object(int val, Base **base, Object **ob) } } + /* reset recursion test */ + in_next_object= 0; + return fase; } diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index d26bdd469f6..ac73ccc498c 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -788,6 +788,7 @@ typedef struct Scene { #define PROP_RANDOM 6 /* return flag next_object function */ +#define F_ERROR -1 #define F_START 0 #define F_SCENE 1 #define F_SET 2 -- cgit v1.2.3 From a1e73e55c7f745ef28bca21d3d9f6b251f4a3244 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 May 2009 10:59:38 +0000 Subject: updated BGE doc checker script for classes now being in GameTypes.py --- source/gameengine/PyDoc/bge_api_validate_py.txt | 32 ++++++++----------------- 1 file changed, 10 insertions(+), 22 deletions(-) (limited to 'source') diff --git a/source/gameengine/PyDoc/bge_api_validate_py.txt b/source/gameengine/PyDoc/bge_api_validate_py.txt index 492dcef408b..ec92cc28770 100644 --- a/source/gameengine/PyDoc/bge_api_validate_py.txt +++ b/source/gameengine/PyDoc/bge_api_validate_py.txt @@ -50,13 +50,8 @@ if doc_dir not in sys.path: sys.path.append(doc_dir) -def check_attribute(type_mame, member): - filename = os.path.join(doc_dir, type_mame + '.py') - # print filename - - file = open(filename, 'rU') - - for l in file: +def check_attribute(class_ob, member): + for l in class_ob.__doc__.split('\n'): l = l.strip() ''' @@ -70,10 +65,8 @@ def check_attribute(type_mame, member): var = l.split()[1].split(':')[0] if var == member: - file.close() return True - file.close() return False @@ -85,19 +78,15 @@ print '\n\n\nChecking Docs' PRINT_OK = False +pymod = sys.modules['GameTypes'] +del sys.modules['GameTypes'] # temp remove +mod = __import__('GameTypes') # get the python module +reload(mod) # incase were editing it +sys.modules['GameTypes'] = pymod + for type_name in sorted(type_members.keys()): members = type_members[type_name] - try: - mod = __import__(type_name) - if PRINT_OK: - print "type: %s" % type_name - except: - print "missing: %s - %s" % (type_name, str(sorted(members))) - continue - - reload(mod) # incase were editing it - try: type_class = getattr(mod, type_name) except: @@ -110,7 +99,7 @@ for type_name in sorted(type_members.keys()): if PRINT_OK: print "\tfound: %s.%s" % (type_name, member) except: - if check_attribute(type_name, member): + if check_attribute(type_class, member): if PRINT_OK: print "\tfound attr: %s.%s" % (type_name, member) else: @@ -128,7 +117,7 @@ for mod_name, pymod in mods_dict.iteritems(): print pydoc.__file__ for member in sorted(dir(pymod)): - if hasattr(pydoc, member) or check_attribute(mod_name, member): + if hasattr(pydoc, member) or check_attribute(pydoc, member): if PRINT_OK: print "\tfound module attr: %s.%s" % (mod_name, member) else: @@ -142,4 +131,3 @@ sys.path.pop() # remove the pydoc dir from our import paths - -- cgit v1.2.3 From 34f99fa4b9e5a370ee208db247f56fcbea4e71f9 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 14 May 2009 11:36:52 +0000 Subject: Bugfix #18743 Render: raytracing materials with transp-shadow + SSS crashed --- source/blender/render/intern/source/rayshade.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 97ac8666181..f4dcbe9e186 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -1274,7 +1274,7 @@ static void addAlphaLight(float *shadfac, float *col, float alpha, float filter) shadfac[3]= (1.0f-alpha)*shadfac[3]; } -static void ray_trace_shadow_tra(Isect *is, int thread, int depth, int traflag) +static void ray_trace_shadow_tra(Isect *is, ShadeInput *origshi, int depth, int traflag) { /* ray to lamp, find first face that intersects, check alpha properties, if it has col[3]>0.0f continue. so exit when alpha is full */ @@ -1291,10 +1291,14 @@ static void ray_trace_shadow_tra(Isect *is, int thread, int depth, int traflag) /* end warning! - Campbell */ shi.depth= 1; /* only used to indicate tracing */ - shi.mask= 1; - shi.thread= thread; + shi.mask= origshi->mask; + shi.thread= origshi->thread; shi.passflag= SCE_PASS_COMBINED; shi.combinedflag= 0xFFFFFF; /* ray trace does all options */ + + shi.xs= origshi->xs; + shi.ys= origshi->ys; + shi.lay= origshi->lay; shade_ray(is, &shi, &shr); if (traflag & RAY_TRA) @@ -1310,7 +1314,7 @@ static void ray_trace_shadow_tra(Isect *is, int thread, int depth, int traflag) is->oborig= RAY_OBJECT_SET(&R, shi.obi); is->faceorig= (RayFace*)shi.vlr; - ray_trace_shadow_tra(is, thread, depth-1, traflag | RAY_TRA); + ray_trace_shadow_tra(is, origshi, depth-1, traflag | RAY_TRA); } } } @@ -1938,7 +1942,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float * isec->col[0]= isec->col[1]= isec->col[2]= 1.0f; isec->col[3]= 1.0f; - ray_trace_shadow_tra(isec, shi->thread, DEPTH_SHADOW_TRA, 0); + ray_trace_shadow_tra(isec, shi, DEPTH_SHADOW_TRA, 0); shadfac[0] += isec->col[0]; shadfac[1] += isec->col[1]; shadfac[2] += isec->col[2]; @@ -2036,7 +2040,7 @@ static void ray_shadow_jitter(ShadeInput *shi, LampRen *lar, float *lampco, floa isec->col[0]= isec->col[1]= isec->col[2]= 1.0f; isec->col[3]= 1.0f; - ray_trace_shadow_tra(isec, shi->thread, DEPTH_SHADOW_TRA, 0); + ray_trace_shadow_tra(isec, shi, DEPTH_SHADOW_TRA, 0); shadfac[0] += isec->col[0]; shadfac[1] += isec->col[1]; shadfac[2] += isec->col[2]; @@ -2117,7 +2121,7 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float *shadfac) isec.col[0]= isec.col[1]= isec.col[2]= 1.0f; isec.col[3]= 1.0f; - ray_trace_shadow_tra(&isec, shi->thread, DEPTH_SHADOW_TRA, 0); + ray_trace_shadow_tra(&isec, shi, DEPTH_SHADOW_TRA, 0); QUATCOPY(shadfac, isec.col); } else if(RE_ray_tree_intersect(R.raytree, &isec)) shadfac[3]= 0.0f; -- cgit v1.2.3 From 003534513645576215092b79f1aa46e85c89e3bd Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 14 May 2009 12:36:07 +0000 Subject: Bugfix, sorta :) Removed option to choose rendering to yafray. New yafaray is better, and already is being linked as option on the blender.org download page. --- source/blender/blenloader/intern/readfile.c | 8 ++++++++ source/blender/src/buttons_scene.c | 10 +--------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index cbf2516da77..6c5a5bd551c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8092,6 +8092,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main) wrld->occlusionRes = 128; } } + + if (main->versionfile < 249) { + Scene *sce; + for (sce= main->scene.first; sce; sce= sce->id.next) + sce->r.renderer= 0; + + } + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 577486135b4..d140001ba2d 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -2277,15 +2277,7 @@ static void render_panel_render(void) if(uiNewPanel(curarea, block, "Render", "Render", 320, 0, 318, 204)==0) return; uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_DORENDER,"RENDER", 369, 164, 191,37, 0, 0, 0, 0, 0, "Render the current frame (F12)"); -#ifndef DISABLE_YAFRAY - /* yafray: on request, render engine menu is back again, and moved to Render panel */ - uiDefButS(block, MENU, B_SWITCHRENDER, "Rendering Engine %t|Blender Internal %x0|YafRay %x1", - 369, 142, 191, 20, &G.scene->r.renderer, 0, 0, 0, 0, "Choose rendering engine"); -#else - uiDefButS(block, MENU, B_SWITCHRENDER, "Rendering Engine %t|Blender Internal %x0", - 369, 142, 191, 20, &G.scene->r.renderer, 0, 0, 0, 0, "Choose rendering engine"); -#endif /* disable yafray */ + uiDefBut(block, BUT,B_DORENDER,"RENDER", 369, 142, 191,59, 0, 0, 0, 0, 0, "Render the current frame (F12)"); uiBlockBeginAlign(block); if((G.scene->r.scemode & R_FULL_SAMPLE) && (G.scene->r.scemode & R_EXR_TILE_FILE)) -- cgit v1.2.3 From d95a10999052ad308599cb0fbbe7ed4f59870c9c Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 14 May 2009 13:47:08 +0000 Subject: BGE modifier: generate correct physic shape, share static derived mesh, share display list. This commit completes the support for modifiers in the BGE. - The physic shape is generated according to the derived mesh. This is true for all types of shapes and all types of objects except soft body. - Optimization for static derived mesh (mesh with modifiers but no armature and no shape keys). Replicas will share the derived mesh and the display list: less memory and faster rendering. With this optimization, the static derived mesh will render as fast as if the modifiers were applied. Known Limits: - Sharing of mesh and display list is only possible between in-game replicas or dupligroup. If you want to instantiate multiple objects with modifiers, use dupligroup to ensure best memory and GPU utilization. - rayCast() will interact with the derived mesh as follow: Hit position and hit normal are the real values according to the derived mesh but the KX_PolyProxy object refers to the original mesh. You should use it only to retrieve the material. - Dynamic derived mesh have very poor performance: They use direct openGL calls for rendering (no support for display list and vertex array) and they dont't share the derived mesh memory. Always apply modifiers on dynamic mesh for best performance. - Time dependent modifiers are not supported. - Modifiers are not supported for Bullet soft body. --- .../Converter/BL_BlenderDataConversion.cpp | 102 ++++++----- source/gameengine/Converter/BL_MeshDeformer.cpp | 9 + source/gameengine/Converter/BL_MeshDeformer.h | 2 +- .../gameengine/Converter/BL_ModifierDeformer.cpp | 73 +++++--- source/gameengine/Converter/BL_ModifierDeformer.h | 5 + source/gameengine/Converter/BL_ShapeDeformer.cpp | 9 +- source/gameengine/Converter/BL_ShapeDeformer.h | 1 + source/gameengine/Converter/BL_SkinDeformer.cpp | 45 +++-- source/gameengine/Converter/BL_SkinDeformer.h | 2 + source/gameengine/Ketsji/KX_ConvertPhysicsObject.h | 2 + .../gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 51 +++--- source/gameengine/Physics/Bullet/CMakeLists.txt | 3 + .../Physics/Bullet/CcdPhysicsController.cpp | 200 ++++++++++++--------- .../Physics/Bullet/CcdPhysicsController.h | 5 +- source/gameengine/Physics/Bullet/Makefile | 2 + source/gameengine/Physics/Bullet/SConscript | 3 + source/gameengine/Rasterizer/RAS_Deformer.h | 10 +- .../RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp | 46 +++-- .../RAS_OpenGLRasterizer/RAS_ListRasterizer.h | 6 +- 19 files changed, 353 insertions(+), 223 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 09604e5c2e3..9ea623f17e4 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1249,18 +1249,34 @@ static void my_tex_space_mesh(Mesh *me) } -static void my_get_local_bounds(Object *ob, float *center, float *size) +static void my_get_local_bounds(Object *ob, DerivedMesh *dm, float *center, float *size) { BoundBox *bb= NULL; /* uses boundbox, function used by Ketsji */ switch (ob->type) { case OB_MESH: - bb= ( (Mesh *)ob->data )->bb; - if(bb==0) + if (dm) + { + float min_r[3], max_r[3]; + INIT_MINMAX(min_r, max_r); + dm->getMinMax(dm, min_r, max_r); + size[0]= 0.5*fabs(max_r[0] - min_r[0]); + size[1]= 0.5*fabs(max_r[1] - min_r[1]); + size[2]= 0.5*fabs(max_r[2] - min_r[2]); + + center[0]= 0.5*(max_r[0] + min_r[0]); + center[1]= 0.5*(max_r[1] + min_r[1]); + center[2]= 0.5*(max_r[2] + min_r[2]); + return; + } else { - my_tex_space_mesh((struct Mesh *)ob->data); bb= ( (Mesh *)ob->data )->bb; + if(bb==0) + { + my_tex_space_mesh((struct Mesh *)ob->data); + bb= ( (Mesh *)ob->data )->bb; + } } break; case OB_CURVE: @@ -1498,7 +1514,10 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, } KX_BoxBounds bb; - my_get_local_bounds(blenderobject,objprop.m_boundobject.box.m_center,bb.m_extends); + DerivedMesh* dm = NULL; + if (gameobj->GetDeformer()) + dm = gameobj->GetDeformer()->GetFinalMesh(); + my_get_local_bounds(blenderobject,dm,objprop.m_boundobject.box.m_center,bb.m_extends); if (blenderobject->gameflag & OB_BOUNDS) { switch (blenderobject->boundtype) @@ -1567,7 +1586,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, { #ifdef USE_BULLET case UseBullet: - KX_ConvertBulletObject(gameobj, meshobj, kxscene, shapeprops, smmaterial, &objprop); + KX_ConvertBulletObject(gameobj, meshobj, dm, kxscene, shapeprops, smmaterial, &objprop); break; #endif @@ -1947,8 +1966,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, int activeLayerBitInfo = blenderscene->lay; - // templist to find Root Parents (object with no parents) - CListValue* templist = new CListValue(); + // list of all object converted, active and inactive CListValue* sumolist = new CListValue(); vector vec_parent_child; @@ -2048,9 +2066,6 @@ void BL_ConvertBlenderObjects(struct Main* maggie, gameobj->SetName(blenderobject->id.name); - // templist to find Root Parents (object with no parents) - templist->Add(gameobj->AddRef()); - // update children/parent hierarchy if ((blenderobject->parent != 0)&&(!converter->addInitFromFrame)) { @@ -2243,9 +2258,6 @@ void BL_ConvertBlenderObjects(struct Main* maggie, gameobj->SetName(blenderobject->id.name); - // templist to find Root Parents (object with no parents) - templist->Add(gameobj->AddRef()); - // update children/parent hierarchy if ((blenderobject->parent != 0)&&(!converter->addInitFromFrame)) { @@ -2398,8 +2410,6 @@ void BL_ConvertBlenderObjects(struct Main* maggie, for ( i=0;iGetCount();i++) { KX_GameObject* obj = static_cast(childrenlist->GetValue(i)); - if (templist->RemoveValue(obj)) - obj->Release(); if (sumolist->RemoveValue(obj)) obj->Release(); if (logicbrick_conversionlist->RemoveValue(obj)) @@ -2455,16 +2465,47 @@ void BL_ConvertBlenderObjects(struct Main* maggie, vec_parent_child.clear(); // find 'root' parents (object that has not parents in SceneGraph) - for (i=0;iGetCount();++i) + for (i=0;iGetCount();++i) { - KX_GameObject* gameobj = (KX_GameObject*) templist->GetValue(i); + KX_GameObject* gameobj = (KX_GameObject*) sumolist->GetValue(i); if (gameobj->GetSGNode()->GetSGParent() == 0) { parentlist->Add(gameobj->AddRef()); gameobj->NodeUpdateGS(0); } } - + + // create graphic controller for culling + if (kxscene->GetDbvtCulling()) + { + bool occlusion = false; + for (i=0; iGetCount();i++) + { + KX_GameObject* gameobj = (KX_GameObject*) sumolist->GetValue(i); + if (gameobj->GetMeshCount() > 0) + { + MT_Point3 box[2]; + gameobj->GetSGNode()->BBox().getmm(box, MT_Transform::Identity()); + // box[0] is the min, box[1] is the max + bool isactive = objectlist->SearchValue(gameobj); + BL_CreateGraphicObjectNew(gameobj,box[0],box[1],kxscene,isactive,physics_engine); + if (gameobj->GetOccluder()) + occlusion = true; + } + } + if (occlusion) + kxscene->SetDbvtOcclusionRes(blenderscene->world->occlusionRes); + } + + // now that the scenegraph is complete, let's instantiate the deformers. + // We need that to create reusable derived mesh and physic shapes + for (i=0;iGetCount();++i) + { + KX_GameObject* gameobj = (KX_GameObject*) sumolist->GetValue(i); + if (gameobj->GetDeformer()) + gameobj->GetDeformer()->UpdateBuckets(); + } + bool processCompoundChildren = false; // create physics information @@ -2498,28 +2539,6 @@ void BL_ConvertBlenderObjects(struct Main* maggie, BL_CreatePhysicsObjectNew(gameobj,blenderobject,meshobj,kxscene,layerMask,physics_engine,converter,processCompoundChildren); } - // create graphic controller for culling - if (kxscene->GetDbvtCulling()) - { - bool occlusion = false; - for (i=0; iGetCount();i++) - { - KX_GameObject* gameobj = (KX_GameObject*) sumolist->GetValue(i); - if (gameobj->GetMeshCount() > 0) - { - MT_Point3 box[2]; - gameobj->GetSGNode()->BBox().getmm(box, MT_Transform::Identity()); - // box[0] is the min, box[1] is the max - bool isactive = objectlist->SearchValue(gameobj); - BL_CreateGraphicObjectNew(gameobj,box[0],box[1],kxscene,isactive,physics_engine); - if (gameobj->GetOccluder()) - occlusion = true; - } - } - if (occlusion) - kxscene->SetDbvtOcclusionRes(blenderscene->world->occlusionRes); - } - //set ini linearVel and int angularVel //rcruiz if (converter->addInitFromFrame) for (i=0;iGetCount();i++) @@ -2605,7 +2624,6 @@ void BL_ConvertBlenderObjects(struct Main* maggie, } } - templist->Release(); sumolist->Release(); // convert global sound stuff diff --git a/source/gameengine/Converter/BL_MeshDeformer.cpp b/source/gameengine/Converter/BL_MeshDeformer.cpp index b6a59774636..b49544050d1 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.cpp +++ b/source/gameengine/Converter/BL_MeshDeformer.cpp @@ -91,6 +91,15 @@ BL_MeshDeformer::~BL_MeshDeformer() delete [] m_transnors; } +void BL_MeshDeformer::ProcessReplica() +{ + m_transverts = NULL; + m_transnors = NULL; + m_tvtot = 0; + m_bDynamic=false; + m_lastDeformUpdate = -1; +} + void BL_MeshDeformer::Relink(GEN_Map*map) { void **h_obj = (*map)[m_gameobj]; diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h index 11ca3b00a1d..99ae5f9dea0 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.h +++ b/source/gameengine/Converter/BL_MeshDeformer.h @@ -66,7 +66,7 @@ public: virtual bool Update(void){ return false; }; virtual bool UpdateBuckets(void){ return false; }; virtual RAS_Deformer* GetReplica(){return NULL;}; - virtual void ProcessReplica() {m_bDynamic=false;}; + virtual void ProcessReplica(); struct Mesh* GetMesh() { return m_bmesh; }; // virtual void InitDeform(double time){}; diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp index 3c4c0c5caad..fe539f9a6c5 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.cpp +++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp @@ -72,8 +72,11 @@ extern "C"{ BL_ModifierDeformer::~BL_ModifierDeformer() { if (m_dm) { - m_dm->needsFree = 1; - m_dm->release(m_dm); + // deformedOnly is used as a user counter + if (--m_dm->deformedOnly == 0) { + m_dm->needsFree = 1; + m_dm->release(m_dm); + } } }; @@ -90,7 +93,10 @@ void BL_ModifierDeformer::ProcessReplica() { /* Note! - This is not inherited from PyObjectPlus */ BL_ShapeDeformer::ProcessReplica(); - m_dm = NULL; + if (m_dm) + // by default try to reuse mesh, deformedOnly is used as a user count + m_dm->deformedOnly++; + // this will force an update and if the mesh cannot be reused, a new one will be created m_lastModifierUpdate = -1; } @@ -117,29 +123,40 @@ bool BL_ModifierDeformer::Update(void) bool bShapeUpdate = BL_ShapeDeformer::Update(); if (bShapeUpdate || m_lastModifierUpdate != m_gameobj->GetLastFrame()) { - /* execute the modifiers */ - Object* blendobj = m_gameobj->GetBlendObject(); - /* hack: the modifiers require that the mesh is attached to the object - It may not be the case here because of replace mesh actuator */ - Mesh *oldmesh = (Mesh*)blendobj->data; - blendobj->data = m_bmesh; - /* execute the modifiers */ - DerivedMesh *dm = mesh_create_derived_no_virtual(blendobj, m_transverts, CD_MASK_MESH); - /* restore object data */ - blendobj->data = oldmesh; - /* free the current derived mesh and replace, (dm should never be NULL) */ - if (m_dm != NULL) { - m_dm->needsFree = 1; + // static derived mesh are not updated + if (m_dm == NULL || m_bDynamic) { + /* execute the modifiers */ + Object* blendobj = m_gameobj->GetBlendObject(); + /* hack: the modifiers require that the mesh is attached to the object + It may not be the case here because of replace mesh actuator */ + Mesh *oldmesh = (Mesh*)blendobj->data; + blendobj->data = m_bmesh; + /* execute the modifiers */ + DerivedMesh *dm = mesh_create_derived_no_virtual(blendobj, m_transverts, CD_MASK_MESH); + /* restore object data */ + blendobj->data = oldmesh; + /* free the current derived mesh and replace, (dm should never be NULL) */ + if (m_dm != NULL) { + // HACK! use deformedOnly as a user counter + if (--m_dm->deformedOnly == 0) { + m_dm->needsFree = 1; + m_dm->release(m_dm); + } + } + m_dm = dm; + // get rid of temporary data + m_dm->needsFree = 0; m_dm->release(m_dm); - } - m_dm = dm; - /* update the graphic controller */ - PHY_IGraphicController *ctrl = m_gameobj->GetGraphicController(); - if (ctrl) { - float min_r[3], max_r[3]; - INIT_MINMAX(min_r, max_r); - m_dm->getMinMax(m_dm, min_r, max_r); - ctrl->setLocalAabb(min_r, max_r); + // HACK! use deformedOnly as a user counter + m_dm->deformedOnly = 1; + /* update the graphic controller */ + PHY_IGraphicController *ctrl = m_gameobj->GetGraphicController(); + if (ctrl) { + float min_r[3], max_r[3]; + INIT_MINMAX(min_r, max_r); + m_dm->getMinMax(m_dm, min_r, max_r); + ctrl->setLocalAabb(min_r, max_r); + } } m_lastModifierUpdate=m_gameobj->GetLastFrame(); bShapeUpdate = true; @@ -156,10 +173,10 @@ bool BL_ModifierDeformer::Apply(RAS_IPolyMaterial *mat) int nmat = m_pMeshObject->NumMaterials(); for (int imat=0; imatGetMeshMaterial(imat); - RAS_MeshSlot *slot = *mmat->m_slots[(void*)m_gameobj]; - if(!slot) + RAS_MeshSlot **slot = mmat->m_slots[(void*)m_gameobj]; + if(!slot || !*slot) continue; - slot->m_pDerivedMesh = m_dm; + (*slot)->m_pDerivedMesh = m_dm; } return true; } diff --git a/source/gameengine/Converter/BL_ModifierDeformer.h b/source/gameengine/Converter/BL_ModifierDeformer.h index 465c287a88b..d5a1caeb91f 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.h +++ b/source/gameengine/Converter/BL_ModifierDeformer.h @@ -86,6 +86,11 @@ public: { m_lastModifierUpdate = -1.0; }; + virtual struct DerivedMesh* GetFinalMesh() + { + return m_dm; + } + protected: double m_lastModifierUpdate; diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp index e04d4dad015..12ef3ff84f1 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.cpp +++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp @@ -77,6 +77,12 @@ RAS_Deformer *BL_ShapeDeformer::GetReplica() return result; } +void BL_ShapeDeformer::ProcessReplica() +{ + BL_SkinDeformer::ProcessReplica(); + m_lastShapeUpdate = -1; +} + bool BL_ShapeDeformer::LoadShapeDrivers(Object* arma) { IpoCurve *icu; @@ -163,7 +169,8 @@ bool BL_ShapeDeformer::Update(void) // check for armature deform bSkinUpdate = BL_SkinDeformer::Update(); - if (!bSkinUpdate && bShapeUpdate) { + // non dynamic deformer = Modifer without armature and shape keys, no need to create storage + if (!bSkinUpdate && bShapeUpdate && m_bDynamic) { // this means that there is no armature, we still need to copy the vertex to m_transverts // and update the normal (was not done after shape key calculation) diff --git a/source/gameengine/Converter/BL_ShapeDeformer.h b/source/gameengine/Converter/BL_ShapeDeformer.h index 1ec7bfdf74a..949e5e1e3ad 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.h +++ b/source/gameengine/Converter/BL_ShapeDeformer.h @@ -67,6 +67,7 @@ public: }; virtual RAS_Deformer *GetReplica(); + virtual void ProcessReplica(); virtual ~BL_ShapeDeformer(); bool Update (void); diff --git a/source/gameengine/Converter/BL_SkinDeformer.cpp b/source/gameengine/Converter/BL_SkinDeformer.cpp index e92c3b29543..a13f78e1b27 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.cpp +++ b/source/gameengine/Converter/BL_SkinDeformer.cpp @@ -127,24 +127,26 @@ bool BL_SkinDeformer::Apply(RAS_IPolyMaterial *mat) if (!Update()) return false; - // the vertex cache is unique to this deformer, no need to update it - // if it wasn't updated! We must update all the materials at once - // because we will not get here again for the other material - nmat = m_pMeshObject->NumMaterials(); - for (imat=0; imatGetMeshMaterial(imat); - if(!mmat->m_slots[(void*)m_gameobj]) - continue; - - slot = *mmat->m_slots[(void*)m_gameobj]; - - // for each array - for(slot->begin(it); !slot->end(it); slot->next(it)) { - // for each vertex - // copy the untransformed data from the original mvert - for(i=it.startvertex; iNumMaterials(); + for (imat=0; imatGetMeshMaterial(imat); + if(!mmat->m_slots[(void*)m_gameobj]) + continue; + + slot = *mmat->m_slots[(void*)m_gameobj]; + + // for each array + for(slot->begin(it); !slot->end(it); slot->next(it)) { + // for each vertex + // copy the untransformed data from the original mvert + for(i=it.startvertex; iSetMesh(meshobj, true,false); + shapeInfo->SetMesh(meshobj, dm,true,false); bm = shapeInfo->CreateBulletShape(); break; } case KX_BOUNDMESH: { - - if (!ci.m_mass ||objprop->m_softbody) - { - // mesh shapes can be shared, check first if we already have a shape on that mesh - class CcdShapeConstructionInfo *sharedShapeInfo = CcdShapeConstructionInfo::FindMesh(meshobj, false); - if (sharedShapeInfo != NULL) - { - delete shapeInfo; - shapeInfo = sharedShapeInfo; - shapeInfo->AddRef(); - } else - { - shapeInfo->SetMesh(meshobj, false,false); - } + bool useGimpact = (ci.m_mass && !objprop->m_softbody); - // Soft bodies require welding. Only avoid remove doubles for non-soft bodies! - if (objprop->m_softbody) - { - shapeInfo->setVertexWeldingThreshold1(objprop->m_soft_welding); //todo: expose this to the UI - } - - bm = shapeInfo->CreateBulletShape(); - //no moving concave meshes, so don't bother calculating inertia - //bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor); + // mesh shapes can be shared, check first if we already have a shape on that mesh + class CcdShapeConstructionInfo *sharedShapeInfo = CcdShapeConstructionInfo::FindMesh(meshobj, dm, false,useGimpact); + if (sharedShapeInfo != NULL) + { + delete shapeInfo; + shapeInfo = sharedShapeInfo; + shapeInfo->AddRef(); } else { - shapeInfo->SetMesh(meshobj, false,true); - bm = shapeInfo->CreateBulletShape(); + shapeInfo->SetMesh(meshobj, dm, false,useGimpact); } + // Soft bodies require welding. Only avoid remove doubles for non-soft bodies! + if (objprop->m_softbody) + { + shapeInfo->setVertexWeldingThreshold1(objprop->m_soft_welding); //todo: expose this to the UI + } + + bm = shapeInfo->CreateBulletShape(); + //should we compute inertia for dynamic shape? + //bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor); + break; } } diff --git a/source/gameengine/Physics/Bullet/CMakeLists.txt b/source/gameengine/Physics/Bullet/CMakeLists.txt index ec2cdede683..02f2aa635af 100644 --- a/source/gameengine/Physics/Bullet/CMakeLists.txt +++ b/source/gameengine/Physics/Bullet/CMakeLists.txt @@ -32,6 +32,7 @@ SET(INC ../../../../extern/bullet2/src ../../../../extern/glew/include ../../../../intern/moto/include + ../../../../intern/guardedalloc ../../../kernel/gen_system ../../../../intern/string ../../../../intern/SoundSystem @@ -41,6 +42,8 @@ SET(INC ../../GameLogic ../../SceneGraph ../../../../source/blender/makesdna + ../../../../source/blender/blenlib + ../../../../source/blender/blenkernel ${PYTHON_INC} ) diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 961e9096442..01e8aa2560f 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -35,6 +35,10 @@ subject to the following restrictions: #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" +extern "C"{ +#include "BKE_cdderivedmesh.h" +} + class BP_Proxy; ///todo: fill all the empty CcdPhysicsController methods, hook them up to the btRigidBody class @@ -1312,9 +1316,9 @@ void DefaultMotionState::calculateWorldTransformations() // Shape constructor std::map CcdShapeConstructionInfo::m_meshShapeMap; -CcdShapeConstructionInfo* CcdShapeConstructionInfo::FindMesh(RAS_MeshObject* mesh, bool polytope) +CcdShapeConstructionInfo* CcdShapeConstructionInfo::FindMesh(RAS_MeshObject* mesh, struct DerivedMesh* dm, bool polytope, bool gimpact) { - if (polytope) + if (polytope || dm || gimpact) // not yet supported return NULL; @@ -1324,9 +1328,9 @@ CcdShapeConstructionInfo* CcdShapeConstructionInfo::FindMesh(RAS_MeshObject* mes return NULL; } -bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, bool polytope,bool useGimpact) +bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm, bool polytope,bool useGimpact) { - int numpolys; + int numpolys, numverts; m_useGimpact = useGimpact; @@ -1335,6 +1339,7 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, bool polytope,bo assert(IsUnused()); m_shapeType = PHY_SHAPE_NONE; m_meshObject = NULL; + bool free_dm = false; // No mesh object or mesh has no polys if (!meshobj || meshobj->HasColliderPolygon()==false) { @@ -1344,12 +1349,21 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, bool polytope,bo return false; } - numpolys = meshobj->NumPolygons(); + if (!dm) { + free_dm = true; + dm = CDDM_from_mesh(meshobj->GetMesh(), NULL); + } + + MVert *mvert = dm->getVertArray(dm); + MFace *mface = dm->getFaceArray(dm); + numpolys = dm->getNumFaces(dm); + numverts = dm->getNumVerts(dm); + int* index = (int*)dm->getFaceDataArray(dm, CD_ORIGINDEX); m_shapeType = (polytope) ? PHY_SHAPE_POLYTOPE : PHY_SHAPE_MESH; /* Convert blender geometry into bullet mesh, need these vars for mapping */ - vector vert_tag_array(meshobj->GetMesh()->totvert, false); + vector vert_tag_array(numverts, false); unsigned int tot_bt_verts= 0; unsigned int orig_index; int i; @@ -1359,19 +1373,16 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, bool polytope,bo // Tag verts we're using for (int p2=0; p2GetPolygon(p2); + MFace* mf = &mface[p2]; + RAS_Polygon* poly = meshobj->GetPolygon(index[p2]); // only add polygons that have the collision flag set if (poly->IsCollider()) { - for(i=0; iVertexCount(); i++) { - orig_index= poly->GetVertex(i)->getOrigIndex(); - if (vert_tag_array[orig_index]==false) - { - vert_tag_array[orig_index]= true; - tot_bt_verts++; - } - } + if (vert_tag_array[mf->v1]==false) {vert_tag_array[mf->v1]= true;tot_bt_verts++;} + if (vert_tag_array[mf->v2]==false) {vert_tag_array[mf->v2]= true;tot_bt_verts++;} + if (vert_tag_array[mf->v3]==false) {vert_tag_array[mf->v3]= true;tot_bt_verts++;} + if (mf->v4 && vert_tag_array[mf->v4]==false) {vert_tag_array[mf->v4]= true;tot_bt_verts++;} } } @@ -1381,51 +1392,69 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, bool polytope,bo for (int p2=0; p2GetPolygon(p2); + MFace* mf = &mface[p2]; + RAS_Polygon* poly= meshobj->GetPolygon(index[p2]); // only add polygons that have the collisionflag set if (poly->IsCollider()) { - for(i=0; iVertexCount(); i++) { - RAS_TexVert *v= poly->GetVertex(i); - orig_index= v->getOrigIndex(); - - if (vert_tag_array[orig_index]==true) - { - const float* vtx = v->getXYZ(); - vert_tag_array[orig_index]= false; - - *bt++ = vtx[0]; - *bt++ = vtx[1]; - *bt++ = vtx[2]; - } + if (vert_tag_array[mf->v1]==true) + { + const float* vtx = mvert[mf->v1].co; + vert_tag_array[mf->v1]= false; + *bt++ = vtx[0]; + *bt++ = vtx[1]; + *bt++ = vtx[2]; + } + if (vert_tag_array[mf->v2]==true) + { + const float* vtx = mvert[mf->v2].co; + vert_tag_array[mf->v2]= false; + *bt++ = vtx[0]; + *bt++ = vtx[1]; + *bt++ = vtx[2]; + } + if (vert_tag_array[mf->v3]==true) + { + const float* vtx = mvert[mf->v3].co; + vert_tag_array[mf->v3]= false; + *bt++ = vtx[0]; + *bt++ = vtx[1]; + *bt++ = vtx[2]; + } + if (mf->v4 && vert_tag_array[mf->v4]==true) + { + const float* vtx = mvert[mf->v4].co; + vert_tag_array[mf->v4]= false; + *bt++ = vtx[0]; + *bt++ = vtx[1]; + *bt++ = vtx[2]; } } } } else { unsigned int tot_bt_tris= 0; - vector vert_remap_array(meshobj->GetMesh()->totvert, 0); + vector vert_remap_array(numverts, 0); // Tag verts we're using for (int p2=0; p2GetPolygon(p2); + MFace* mf = &mface[p2]; + RAS_Polygon* poly= meshobj->GetPolygon(index[p2]); // only add polygons that have the collision flag set if (poly->IsCollider()) { - for(i=0; iVertexCount(); i++) { - orig_index= poly->GetVertex(i)->getOrigIndex(); - if (vert_tag_array[orig_index]==false) - { - vert_tag_array[orig_index]= true; - vert_remap_array[orig_index]= tot_bt_verts; - tot_bt_verts++; - } - } - - tot_bt_tris += (i==4 ? 2:1); /* a quad or a tri */ + if (vert_tag_array[mf->v1]==false) + {vert_tag_array[mf->v1]= true;vert_remap_array[mf->v1]= tot_bt_verts;tot_bt_verts++;} + if (vert_tag_array[mf->v2]==false) + {vert_tag_array[mf->v2]= true;vert_remap_array[mf->v2]= tot_bt_verts;tot_bt_verts++;} + if (vert_tag_array[mf->v3]==false) + {vert_tag_array[mf->v3]= true;vert_remap_array[mf->v3]= tot_bt_verts;tot_bt_verts++;} + if (mf->v4 && vert_tag_array[mf->v4]==false) + {vert_tag_array[mf->v4]= true;vert_remap_array[mf->v4]= tot_bt_verts;tot_bt_verts++;} + tot_bt_tris += (mf->v4 ? 2:1); /* a quad or a tri */ } } @@ -1437,76 +1466,67 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, bool polytope,bo int *poly_index_pt= &m_polygonIndexArray[0]; int *tri_pt= &m_triFaceArray[0]; - for (int p2=0; p2GetPolygon(p2); + MFace* mf = &mface[p2]; + RAS_Polygon* poly= meshobj->GetPolygon(index[p2]); // only add polygons that have the collisionflag set if (poly->IsCollider()) { - RAS_TexVert *v1= poly->GetVertex(0); - RAS_TexVert *v2= poly->GetVertex(1); - RAS_TexVert *v3= poly->GetVertex(2); - int i1= v1->getOrigIndex(); - int i2= v2->getOrigIndex(); - int i3= v3->getOrigIndex(); - const float* vtx; + MVert *v1= &mvert[mf->v1]; + MVert *v2= &mvert[mf->v2]; + MVert *v3= &mvert[mf->v3]; // the face indicies - tri_pt[0]= vert_remap_array[i1]; - tri_pt[1]= vert_remap_array[i2]; - tri_pt[2]= vert_remap_array[i3]; + tri_pt[0]= vert_remap_array[mf->v1]; + tri_pt[1]= vert_remap_array[mf->v2]; + tri_pt[2]= vert_remap_array[mf->v3]; tri_pt= tri_pt+3; // m_polygonIndexArray - *poly_index_pt= p2; + *poly_index_pt= index[p2]; poly_index_pt++; // the vertex location - if (vert_tag_array[i1]==true) { /* *** v1 *** */ - vert_tag_array[i1]= false; - vtx = v1->getXYZ(); - *bt++ = vtx[0]; - *bt++ = vtx[1]; - *bt++ = vtx[2]; + if (vert_tag_array[mf->v1]==true) { /* *** v1 *** */ + vert_tag_array[mf->v1]= false; + *bt++ = v1->co[0]; + *bt++ = v1->co[1]; + *bt++ = v1->co[2]; } - if (vert_tag_array[i2]==true) { /* *** v2 *** */ - vert_tag_array[i2]= false; - vtx = v2->getXYZ(); - *bt++ = vtx[0]; - *bt++ = vtx[1]; - *bt++ = vtx[2]; + if (vert_tag_array[mf->v2]==true) { /* *** v2 *** */ + vert_tag_array[mf->v2]= false; + *bt++ = v2->co[0]; + *bt++ = v2->co[1]; + *bt++ = v2->co[2]; } - if (vert_tag_array[i3]==true) { /* *** v3 *** */ - vert_tag_array[i3]= false; - vtx = v3->getXYZ(); - *bt++ = vtx[0]; - *bt++ = vtx[1]; - *bt++ = vtx[2]; + if (vert_tag_array[mf->v3]==true) { /* *** v3 *** */ + vert_tag_array[mf->v3]= false; + *bt++ = v3->co[0]; + *bt++ = v3->co[1]; + *bt++ = v3->co[2]; } - if (poly->VertexCount()==4) + if (mf->v4) { - RAS_TexVert *v4= poly->GetVertex(3); - int i4= v4->getOrigIndex(); + MVert *v4= &mvert[mf->v4]; - tri_pt[0]= vert_remap_array[i1]; - tri_pt[1]= vert_remap_array[i3]; - tri_pt[2]= vert_remap_array[i4]; + tri_pt[0]= vert_remap_array[mf->v1]; + tri_pt[1]= vert_remap_array[mf->v3]; + tri_pt[2]= vert_remap_array[mf->v4]; tri_pt= tri_pt+3; // m_polygonIndexArray - *poly_index_pt= p2; + *poly_index_pt= index[p2]; poly_index_pt++; // the vertex location - if (vert_tag_array[i4]==true) { /* *** v4 *** */ - vert_tag_array[i4]= false; - vtx = v4->getXYZ(); - *bt++ = vtx[0]; - *bt++ = vtx[1]; - *bt++ = vtx[2]; + if (vert_tag_array[mf->v4]==true) { /* *** v4 *** */ + vert_tag_array[mf->v4]= false; + *bt++ = v4->co[0]; + *bt++ = v4->co[1]; + *bt++ = v4->co[2]; } } } @@ -1538,7 +1558,13 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, bool polytope,bo #endif m_meshObject = meshobj; - if (!polytope) + if (free_dm) { + dm->release(dm); + dm = NULL; + } + + // sharing only on static mesh at present, if you change that, you must also change in FindMesh + if (!polytope && !dm && !useGimpact) { // triangle shape can be shared, store the mesh object in the map m_meshShapeMap.insert(std::pair(meshobj,this)); diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 4ab478b2106..315e2bdf429 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -36,6 +36,7 @@ extern bool gDisableDeactivation; class CcdPhysicsEnvironment; class btMotionState; class RAS_MeshObject; +struct DerivedMesh; class btCollisionShape; @@ -59,7 +60,7 @@ class CcdShapeConstructionInfo public: - static CcdShapeConstructionInfo* FindMesh(RAS_MeshObject* mesh, bool polytope); + static CcdShapeConstructionInfo* FindMesh(class RAS_MeshObject* mesh, struct DerivedMesh* dm, bool polytope, bool gimpact); CcdShapeConstructionInfo() : m_shapeType(PHY_SHAPE_NONE), @@ -139,7 +140,7 @@ public: return true; } - bool SetMesh(RAS_MeshObject* mesh, bool polytope,bool useGimpact); + bool SetMesh(class RAS_MeshObject* mesh, struct DerivedMesh* dm, bool polytope,bool useGimpact); RAS_MeshObject* GetMesh(void) { return m_meshObject; diff --git a/source/gameengine/Physics/Bullet/Makefile b/source/gameengine/Physics/Bullet/Makefile index 48e537bb6a3..19b17de275a 100644 --- a/source/gameengine/Physics/Bullet/Makefile +++ b/source/gameengine/Physics/Bullet/Makefile @@ -51,4 +51,6 @@ CPPFLAGS += -I../../Expressions CPPFLAGS += -I../../GameLogic CPPFLAGS += -I../../SceneGraph CPPFLAGS += -I../../../../source/blender/makesdna +CPPFLAGS += -I../../../../source/blender/blenkernel +CPPFLAGS += -I../../../../source/blender/blenlib diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript index 115ab8bf730..c517d8b5d9d 100644 --- a/source/gameengine/Physics/Bullet/SConscript +++ b/source/gameengine/Physics/Bullet/SConscript @@ -14,7 +14,10 @@ incs += ' #source/gameengine/Expressions' incs += ' #source/gameengine/GameLogic' incs += ' #source/gameengine/SceneGraph' incs += ' #source/blender/makesdna' +incs += ' #source/blender/blenkernel' +incs += ' #source/blender/blenlib' incs += ' #intern/SoundSystem' +incs += ' #intern/guardedalloc' incs += ' ' + env['BF_BULLET_INC'] incs += ' ' + env['BF_PYTHON_INC'] diff --git a/source/gameengine/Rasterizer/RAS_Deformer.h b/source/gameengine/Rasterizer/RAS_Deformer.h index bb8e3750485..9dc656ba56a 100644 --- a/source/gameengine/Rasterizer/RAS_Deformer.h +++ b/source/gameengine/Rasterizer/RAS_Deformer.h @@ -34,12 +34,15 @@ #pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning #endif //WIN32 +#include #include "GEN_Map.h" +struct DerivedMesh; + class RAS_Deformer { public: - RAS_Deformer() : m_pMesh(0), m_bDynamic(false) {}; + RAS_Deformer() : m_pMesh(NULL), m_bDynamic(false) {}; virtual ~RAS_Deformer(){}; virtual void Relink(GEN_Map*map)=0; virtual bool Apply(class RAS_IPolyMaterial *polymat)=0; @@ -60,6 +63,11 @@ public: { return m_bDynamic; } + virtual struct DerivedMesh* GetFinalMesh() + { + return NULL; + } + protected: class RAS_MeshObject *m_pMesh; bool m_bDynamic; diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp index f5324c6fbc9..014169f8838 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp @@ -118,16 +118,24 @@ RAS_ListRasterizer::~RAS_ListRasterizer() void RAS_ListRasterizer::RemoveListSlot(RAS_ListSlot* list) { - if (list->m_flag & LIST_STANDALONE) - return ; - - RAS_ArrayLists::iterator it = mArrayLists.begin(); - while(it != mArrayLists.end()) { - if (it->second == list) { - mArrayLists.erase(it); - break; + if (list->m_flag & LIST_DERIVEDMESH) { + RAS_DerivedMeshLists::iterator it = mDerivedMeshLists.begin(); + while(it != mDerivedMeshLists.end()) { + if (it->second == list) { + mDerivedMeshLists.erase(it); + break; + } + it++; + } + } else { + RAS_ArrayLists::iterator it = mArrayLists.begin(); + while(it != mArrayLists.end()) { + if (it->second == list) { + mArrayLists.erase(it); + break; + } + it++; } - it++; } } @@ -143,9 +151,15 @@ RAS_ListSlot* RAS_ListRasterizer::FindOrAdd(RAS_MeshSlot& ms) if(!localSlot) { if (ms.m_pDerivedMesh) { // that means that we draw based on derived mesh, a display list is possible - // but it's unique to this mesh slot - localSlot = new RAS_ListSlot(this); - localSlot->m_flag |= LIST_STANDALONE; + // Note that we come here only for static derived mesh + RAS_DerivedMeshLists::iterator it = mDerivedMeshLists.find(ms.m_pDerivedMesh); + if(it == mDerivedMeshLists.end()) { + localSlot = new RAS_ListSlot(this); + localSlot->m_flag |= LIST_DERIVEDMESH; + mDerivedMeshLists.insert(std::pair(ms.m_pDerivedMesh, localSlot)); + } else { + localSlot = static_cast(it->second->AddRef()); + } } else { RAS_ArrayLists::iterator it = mArrayLists.find(ms.m_displayArrays); if(it == mArrayLists.end()) { @@ -162,12 +176,12 @@ RAS_ListSlot* RAS_ListRasterizer::FindOrAdd(RAS_MeshSlot& ms) void RAS_ListRasterizer::ReleaseAlloc() { - RAS_ArrayLists::iterator it = mArrayLists.begin(); - while(it != mArrayLists.end()) { + for(RAS_ArrayLists::iterator it = mArrayLists.begin();it != mArrayLists.end();++it) delete it->second; - it++; - } mArrayLists.clear(); + for (RAS_DerivedMeshLists::iterator it = mDerivedMeshLists.begin();it != mDerivedMeshLists.end();++it) + delete it->second; + mDerivedMeshLists.clear(); } void RAS_ListRasterizer::IndexPrimitives(RAS_MeshSlot& ms) diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h index 912f28af6aa..fe358808e4a 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h @@ -34,16 +34,20 @@ enum RAS_ListSlotFlags { LIST_BEGIN =16, LIST_END =32, LIST_REGEN =64, - LIST_STANDALONE =128, + LIST_DERIVEDMESH=128, }; +struct DerivedMesh; + typedef std::map RAS_ArrayLists; +typedef std::map RAS_DerivedMeshLists; class RAS_ListRasterizer : public RAS_VAOpenGLRasterizer { bool mUseVertexArrays; bool mATI; RAS_ArrayLists mArrayLists; + RAS_DerivedMeshLists mDerivedMeshLists; RAS_ListSlot* FindOrAdd(class RAS_MeshSlot& ms); void ReleaseAlloc(); -- cgit v1.2.3 From 23251ba286dd6af4101e61371925b25e8ea00fec Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Thu, 14 May 2009 18:32:27 +0000 Subject: Fix for bug #18622 Snapping has to be reinit after changing mode during transform. Needs to be fixed in 2.5 too, but a tad differently. --- source/blender/src/transform.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index a1abc5ea6bb..f0ae37e8d87 100644 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -740,6 +740,7 @@ static void transformEvent(unsigned short event, short val) { resetTransRestrictions(&Trans); restoreTransObjects(&Trans); initTranslation(&Trans); + initSnapping(&Trans); Trans.redraw = 1; } break; @@ -749,6 +750,7 @@ static void transformEvent(unsigned short event, short val) { resetTransRestrictions(&Trans); restoreTransObjects(&Trans); initResize(&Trans); + initSnapping(&Trans); Trans.redraw = 1; } break; @@ -766,6 +768,7 @@ static void transformEvent(unsigned short event, short val) { restoreTransObjects(&Trans); initRotation(&Trans); } + initSnapping(&Trans); Trans.redraw = 1; } break; -- cgit v1.2.3 From a20a2ebb9f5cb0854793464c805043acf81101ec Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 May 2009 21:06:48 +0000 Subject: [#18749] BGE: Crash on joysticksensor.getAxisValue() negative index would be used when the joystick was not found, crashing python api, initialize these as 0 now. --- source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp index c300baa9bd4..c32ff303aea 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp @@ -220,12 +220,17 @@ int SCA_Joystick::GetNumberOfHats() bool SCA_Joystick::CreateJoystickDevice(void) { #ifdef DISABLE_SDL + m_isinit = true; + m_axismax = m_buttonmax = m_hatmax = 0; return false; #else if(m_isinit == false){ if (m_joyindex>=SDL_NumJoysticks()) { // don't print a message, because this is done anyway //echo("Joystick-Error: " << SDL_NumJoysticks() << " avaiable joystick(s)"); + + // Need this so python args can return empty lists + m_axismax = m_buttonmax = m_hatmax = 0; return false; } @@ -237,12 +242,14 @@ bool SCA_Joystick::CreateJoystickDevice(void) /* must run after being initialized */ m_axismax = SDL_JoystickNumAxes(m_private->m_joystick); - if (m_axismax > JOYAXIS_MAX) m_axismax= JOYAXIS_MAX; /* very unlikely */ - m_buttonmax = SDL_JoystickNumButtons(m_private->m_joystick); m_hatmax = SDL_JoystickNumHats(m_private->m_joystick); + if (m_axismax > JOYAXIS_MAX) m_axismax= JOYAXIS_MAX; /* very unlikely */ + else if (m_axismax < 0) m_axismax = 0; + if(m_buttonmax<0) m_buttonmax= 0; + if(m_hatmax<0) m_buttonmax= 0; } return true; #endif -- cgit v1.2.3 From 0e423e5bb61cdce77aa6cd527f6bf2521b9b33c6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 May 2009 23:06:05 +0000 Subject: BGE PyAPI [#18701] Issues with camera.pointInsideFrustum method - note in docs that the projection matrix is not correct for first logic tick. Renamed... KX_Camera.isViewport -> KX_Camera.useViewport KX_Lamp.quat_attenuation -> KX_Lamp.quad_attenuation Deprecated KX_Camera.getProjectionMatrix(), KX_Camera.setProjectionMatrix() for projection_matrix attr Added most missing docs reported by the doc-checker script --- source/gameengine/Ketsji/KX_Camera.cpp | 17 +- source/gameengine/Ketsji/KX_Camera.h | 4 +- source/gameengine/Ketsji/KX_Light.cpp | 2 +- source/gameengine/PyDoc/GameLogic.py | 158 +++++++++-------- source/gameengine/PyDoc/GameTypes.py | 298 ++++++++++++++++++--------------- 5 files changed, 257 insertions(+), 222 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index df39faf8b22..0d2e68243f8 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -476,13 +476,13 @@ PyMethodDef KX_Camera::Methods[] = { KX_PYMETHODTABLE_O(KX_Camera, pointInsideFrustum), KX_PYMETHODTABLE_NOARGS(KX_Camera, getCameraToWorld), KX_PYMETHODTABLE_NOARGS(KX_Camera, getWorldToCamera), - KX_PYMETHODTABLE_NOARGS(KX_Camera, getProjectionMatrix), - KX_PYMETHODTABLE_O(KX_Camera, setProjectionMatrix), KX_PYMETHODTABLE(KX_Camera, setViewport), KX_PYMETHODTABLE_NOARGS(KX_Camera, setOnTop), // DEPRECATED KX_PYMETHODTABLE_O(KX_Camera, enableViewport), + KX_PYMETHODTABLE_NOARGS(KX_Camera, getProjectionMatrix), + KX_PYMETHODTABLE_O(KX_Camera, setProjectionMatrix), {NULL,NULL} //Sentinel }; @@ -496,9 +496,9 @@ PyAttributeDef KX_Camera::Attributes[] = { KX_PYATTRIBUTE_RW_FUNCTION("near", KX_Camera, pyattr_get_near, pyattr_set_near), KX_PYATTRIBUTE_RW_FUNCTION("far", KX_Camera, pyattr_get_far, pyattr_set_far), - KX_PYATTRIBUTE_RW_FUNCTION("isViewport", KX_Camera, pyattr_get_is_viewport, pyattr_set_is_viewport), + KX_PYATTRIBUTE_RW_FUNCTION("useViewport", KX_Camera, pyattr_get_use_viewport, pyattr_set_use_viewport), - KX_PYATTRIBUTE_RO_FUNCTION("projection_matrix", KX_Camera, pyattr_get_projection_matrix), + KX_PYATTRIBUTE_RW_FUNCTION("projection_matrix", KX_Camera, pyattr_get_projection_matrix, pyattr_set_projection_matrix), KX_PYATTRIBUTE_RO_FUNCTION("modelview_matrix", KX_Camera, pyattr_get_modelview_matrix), KX_PYATTRIBUTE_RO_FUNCTION("camera_to_world", KX_Camera, pyattr_get_camera_to_world), KX_PYATTRIBUTE_RO_FUNCTION("world_to_camera", KX_Camera, pyattr_get_world_to_camera), @@ -693,6 +693,7 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_Camera, getProjectionMatrix, "\tie: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]])\n" ) { + ShowDeprecationWarning("getProjectionMatrix()", "the projection_matrix property"); return PyObjectFrom(GetProjectionMatrix()); /* new ref */ } @@ -738,6 +739,8 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, setProjectionMatrix, "\tcam = co.getOwner()\n" "\tcam.setProjectionMatrix(Perspective(-1.0, 1.0, -1.0, 1.0, 0.1, 1))\n") { + ShowDeprecationWarning("setProjectionMatrix(mat)", "the projection_matrix property"); + MT_Matrix4x4 mat; if (!PyMatTo(value, mat)) { @@ -871,18 +874,18 @@ int KX_Camera::pyattr_set_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, P } -PyObject* KX_Camera::pyattr_get_is_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +PyObject* KX_Camera::pyattr_get_use_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_Camera* self= static_cast(self_v); return PyBool_FromLong(self->GetViewport()); } -int KX_Camera::pyattr_set_is_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) +int KX_Camera::pyattr_set_use_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { KX_Camera* self= static_cast(self_v); int param = PyObject_IsTrue( value ); if (param == -1) { - PyErr_SetString(PyExc_AttributeError, "camera.isViewport = bool: KX_Camera, expected True or False"); + PyErr_SetString(PyExc_AttributeError, "camera.useViewport = bool: KX_Camera, expected True or False"); return 1; } self->EnableViewport((bool)param); diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index ce8bbb8d656..c00741bf43f 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -287,8 +287,8 @@ public: static PyObject* pyattr_get_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); - static PyObject* pyattr_get_is_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); - static int pyattr_set_is_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_use_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_use_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static PyObject* pyattr_get_projection_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_projection_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index 3af34c39123..df7691d016b 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -235,7 +235,7 @@ PyAttributeDef KX_LightObject::Attributes[] = { KX_PYATTRIBUTE_RW_FUNCTION("color", KX_LightObject, pyattr_get_color, pyattr_set_color), KX_PYATTRIBUTE_RW_FUNCTION("colour", KX_LightObject, pyattr_get_color, pyattr_set_color), KX_PYATTRIBUTE_FLOAT_RW("lin_attenuation", 0, 1, KX_LightObject, m_lightobj.m_att1), - KX_PYATTRIBUTE_FLOAT_RW("quat_attenuation", 0, 1, KX_LightObject, m_lightobj.m_att2), + KX_PYATTRIBUTE_FLOAT_RW("quad_attenuation", 0, 1, KX_LightObject, m_lightobj.m_att2), KX_PYATTRIBUTE_FLOAT_RW("spotsize", 1, 180, KX_LightObject, m_lightobj.m_spotsize), KX_PYATTRIBUTE_FLOAT_RW("spotblend", 0, 1, KX_LightObject, m_lightobj.m_spotblend), KX_PYATTRIBUTE_RO_FUNCTION("SPOT", KX_LightObject, pyattr_get_typeconst), diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index a0be06e8830..9b87842f7e0 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -104,17 +104,14 @@ Documentation for the GameLogic Module. @var KX_TRUE: True value used by some modules. @var KX_FALSE: False value used by some modules. -@group Property Sensor: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL, KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED, KX_PROPSENSOR_EXPRESSION +@group Property Sensor: KX_PROPSENSOR_* @var KX_PROPSENSOR_EQUAL: Activate when the property is equal to the sensor value. @var KX_PROPSENSOR_NOTEQUAL: Activate when the property is not equal to the sensor value. @var KX_PROPSENSOR_INTERVAL: Activate when the property is between the specified limits. @var KX_PROPSENSOR_CHANGED: Activate when the property changes @var KX_PROPSENSOR_EXPRESSION: Activate when the expression matches - - - -@group Constraint Actuator: KX_CONSTRAINTACT_LOCX, KX_CONSTRAINTACT_LOCY, KX_CONSTRAINTACT_LOCZ, KX_CONSTRAINTACT_ROTX, KX_CONSTRAINTACT_ROTY, KX_CONSTRAINTACT_ROTZ, KX_CONSTRAINTACT_DIRNX, KX_CONSTRAINTACT_DIRNY, KX_CONSTRAINTACT_DIRPX, KX_CONSTRAINTACT_DIRPY, KX_CONSTRAINTACT_ORIX, KX_CONSTRAINTACT_ORIY, KX_CONSTRAINTACT_ORIZ +@group Constraint Actuator: KX_CONSTRAINTACT_* @var KX_CONSTRAINTACT_LOCX: See L{KX_ConstraintActuator} @var KX_CONSTRAINTACT_LOCY: See L{KX_ConstraintActuator} @var KX_CONSTRAINTACT_LOCZ: See L{KX_ConstraintActuator} @@ -129,7 +126,7 @@ Documentation for the GameLogic Module. @var KX_CONSTRAINTACT_ORIY: See L{KX_ConstraintActuator} @var KX_CONSTRAINTACT_ORIZ: See L{KX_ConstraintActuator} -@group IPO Actuator: KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND, KX_IPOACT_FROM_PROP +@group IPO Actuator: KX_IPOACT_* @var KX_IPOACT_PLAY: See L{KX_IpoActuator} @var KX_IPOACT_PINGPONG: See L{KX_IpoActuator} @var KX_IPOACT_FLIPPER: See L{KX_IpoActuator} @@ -137,7 +134,7 @@ Documentation for the GameLogic Module. @var KX_IPOACT_LOOPEND: See L{KX_IpoActuator} @var KX_IPOACT_FROM_PROP: See L{KX_IpoActuator} -@group Random Distributions: KX_RANDOMACT_BOOL_CONST, KX_RANDOMACT_BOOL_UNIFORM, KX_RANDOMACT_BOOL_BERNOUILLI, KX_RANDOMACT_INT_CONST, KX_RANDOMACT_INT_UNIFORM, KX_RANDOMACT_INT_POISSON, KX_RANDOMACT_FLOAT_CONST, KX_RANDOMACT_FLOAT_UNIFORM, KX_RANDOMACT_FLOAT_NORMAL, KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL +@group Random Distributions: KX_RANDOMACT_* @var KX_RANDOMACT_BOOL_CONST: See L{SCA_RandomActuator} @var KX_RANDOMACT_BOOL_UNIFORM: See L{SCA_RandomActuator} @var KX_RANDOMACT_BOOL_BERNOUILLI: See L{SCA_RandomActuator} @@ -149,14 +146,14 @@ Documentation for the GameLogic Module. @var KX_RANDOMACT_FLOAT_NORMAL: See L{SCA_RandomActuator} @var KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL: See L{SCA_RandomActuator} -@group Action Actuator: KX_ACTIONACT_PLAY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND, KX_ACTIONACT_PROPERTY +@group Action Actuator: KX_ACTIONACT_* @var KX_ACTIONACT_PLAY: See L{BL_ActionActuator} @var KX_ACTIONACT_FLIPPER: See L{BL_ActionActuator} @var KX_ACTIONACT_LOOPSTOP: See L{BL_ActionActuator} @var KX_ACTIONACT_LOOPEND: See L{BL_ActionActuator} @var KX_ACTIONACT_PROPERTY: See L{BL_ActionActuator} -@group Sound Actuator: KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP +@group Sound Actuator: KX_SOUNDACT_* @var KX_SOUNDACT_PLAYSTOP: See L{KX_SoundActuator} @var KX_SOUNDACT_PLAYEND: See L{KX_SoundActuator} @var KX_SOUNDACT_LOOPSTOP: See L{KX_SoundActuator} @@ -164,7 +161,7 @@ Documentation for the GameLogic Module. @var KX_SOUNDACT_LOOPBIDIRECTIONAL: See L{KX_SoundActuator} @var KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP: See L{KX_SoundActuator} -@group Radar Sensor: KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z, KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z +@group Radar Sensor: KX_RADAR_* @var KX_RADAR_AXIS_POS_X: See L{KX_RadarSensor} @var KX_RADAR_AXIS_POS_Y: See L{KX_RadarSensor} @var KX_RADAR_AXIS_POS_Z: See L{KX_RadarSensor} @@ -172,7 +169,7 @@ Documentation for the GameLogic Module. @var KX_RADAR_AXIS_NEG_Y: See L{KX_RadarSensor} @var KX_RADAR_AXIS_NEG_Z: See L{KX_RadarSensor} -@group Ray Sensor: KX_RAY_AXIS_POS_X, KX_RAY_AXIS_POS_Y, KX_RAY_AXIS_POS_Z, KX_RAY_AXIS_NEG_X, KX_RAY_AXIS_NEG_Y, KX_RAY_AXIS_NEG_Z +@group Ray Sensor: KX_RAY_* @var KX_RAY_AXIS_POS_X: See L{KX_RaySensor} @var KX_RAY_AXIS_POS_Y: See L{KX_RaySensor} @var KX_RAY_AXIS_POS_Z: See L{KX_RaySensor} @@ -180,44 +177,44 @@ Documentation for the GameLogic Module. @var KX_RAY_AXIS_NEG_Y: See L{KX_RaySensor} @var KX_RAY_AXIS_NEG_Z: See L{KX_RaySensor} -@group Dynamic Actuator: KX_DYN_RESTORE_DYNAMICS, KX_DYN_DISABLE_DYNAMICS, KX_DYN_ENABLE_RIGID_BODY, KX_DYN_DISABLE_RIGID_BODY, KX_DYN_SET_MASS +@group Dynamic Actuator: KX_DYN_* @var KX_DYN_RESTORE_DYNAMICS: See L{KX_SCA_DynamicActuator} @var KX_DYN_DISABLE_DYNAMICS: See L{KX_SCA_DynamicActuator} @var KX_DYN_ENABLE_RIGID_BODY: See L{KX_SCA_DynamicActuator} @var KX_DYN_DISABLE_RIGID_BODY: See L{KX_SCA_DynamicActuator} @var KX_DYN_SET_MASS: See L{KX_SCA_DynamicActuator} -@group Game Actuator: KX_GAME_LOAD, KX_GAME_START, KX_GAME_RESTART, KX_GAME_QUIT, KX_GAME_SAVECFG, KX_GAME_LOADCFG -@var KX_Game_LOAD: See L{KX_GameActuator} -@var KX_Game_START: See L{KX_GameActuator} -@var KX_Game_RESTART: See L{KX_GameActuator} -@var KX_Game_QUIT: See L{KX_GameActuator} -@var KX_Game_SAVECFG: See L{KX_GameActuator} -@var KX_Game_LOADCFG: See L{KX_GameActuator} - -@group Scene Actuator: KX_SCENE_RESTART, KX_SCENE_SET_SCENE, KX_SCENE_SET_CAMERA, KX_SCENE_ADD_FRONT_SCENE, KX_SCENE_ADD_BACK_SCENE, KX_SCENE_REMOVE_SCENE, KX_SCENE_SUSPEND, KX_SCENE_RESUME -KX_SCENE_RESTART: See L{KX_SceneActuator} -KX_SCENE_SET_SCENE: See L{KX_SceneActuator} -KX_SCENE_SET_CAMERA: See L{KX_SceneActuator} -KX_SCENE_ADD_FRONT_SCENE: See L{KX_SceneActuator} -KX_SCENE_ADD_BACK_SCENE: See L{KX_SceneActuator} -KX_SCENE_REMOVE_SCENE: See L{KX_SceneActuator} -KX_SCENE_SUSPEND: See L{KX_SceneActuator} -KX_SCENE_RESUME: See L{KX_SceneActuator} - -@group Input Status: KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED +@group Game Actuator: KX_GAME_* +@var KX_GAME_LOAD: See L{KX_GameActuator} +@var KX_GAME_START: See L{KX_GameActuator} +@var KX_GAME_RESTART: See L{KX_GameActuator} +@var KX_GAME_QUIT: See L{KX_GameActuator} +@var KX_GAME_SAVECFG: See L{KX_GameActuator} +@var KX_GAME_LOADCFG: See L{KX_GameActuator} + +@group Scene Actuator: KX_SCENE_* +@var KX_SCENE_RESTART: See L{KX_SceneActuator} +@var KX_SCENE_SET_SCENE: See L{KX_SceneActuator} +@var KX_SCENE_SET_CAMERA: See L{KX_SceneActuator} +@var KX_SCENE_ADD_FRONT_SCENE: See L{KX_SceneActuator} +@var KX_SCENE_ADD_BACK_SCENE: See L{KX_SceneActuator} +@var KX_SCENE_REMOVE_SCENE: See L{KX_SceneActuator} +@var KX_SCENE_SUSPEND: See L{KX_SceneActuator} +@var KX_SCENE_RESUME: See L{KX_SceneActuator} + +@group Input Status: KX_INPUT_* @var KX_INPUT_NONE: See L{SCA_MouseSensor} @var KX_INPUT_JUST_ACTIVATED: See L{SCA_MouseSensor} @var KX_INPUT_ACTIVE: See L{SCA_MouseSensor} @var KX_INPUT_JUST_RELEASED: See L{SCA_MouseSensor} -@group Mouse Buttons: KX_MOUSE_BUT_LEFT, KX_MOUSE_BUT_MIDDLE, KX_MOUSE_BUT_RIGHT +@group Mouse Buttons: KX_MOUSE_BUT_* @var KX_MOUSE_BUT_LEFT: See L{SCA_MouseSensor} @var KX_MOUSE_BUT_MIDDLE: See L{SCA_MouseSensor} @var KX_MOUSE_BUT_RIGHT: See L{SCA_MouseSensor} -@group States: KX_STATE1, KX_STATE10, KX_STATE11, KX_STATE12, KX_STATE13, KX_STATE14, KX_STATE15, KX_STATE16, KX_STATE17, KX_STATE18, KX_STATE19, KX_STATE2, KX_STATE20, KX_STATE21, KX_STATE22, KX_STATE23, KX_STATE24, KX_STATE25, KX_STATE26, KX_STATE27, KX_STATE28, KX_STATE29, KX_STATE3, KX_STATE30, KX_STATE4, KX_STATE5, KX_STATE6, KX_STATE7, KX_STATE8, KX_STATE9, KX_STATE_OP_CLR, KX_STATE_OP_CPY, KX_STATE_OP_NEG, KX_STATE_OP_SET +@group States: KX_STATE* @var KX_STATE1: @var KX_STATE10: @var KX_STATE11: @@ -253,20 +250,24 @@ KX_SCENE_RESUME: See L{KX_SceneActuator} @var KX_STATE_OP_NEG: @var KX_STATE_OP_SET: -@group UNSORTED: BL_DST_ALPHA, BL_DST_COLOR, BL_ONE, BL_ONE_MINUS_DST_ALPHA, BL_ONE_MINUS_DST_COLOR, BL_ONE_MINUS_SRC_ALPHA, BL_ONE_MINUS_SRC_COLOR, BL_SRC_ALPHA, BL_SRC_ALPHA_SATURATE, BL_SRC_COLOR, BL_ZERO, CAM_POS, CONSTANT_TIMER, KX_ACT_CONSTRAINT_DISTANCE, KX_ACT_CONSTRAINT_DOROTFH, KX_ACT_CONSTRAINT_FHNX, KX_ACT_CONSTRAINT_FHNY, KX_ACT_CONSTRAINT_FHNZ, KX_ACT_CONSTRAINT_FHPX, KX_ACT_CONSTRAINT_FHPY, KX_ACT_CONSTRAINT_FHPZ, KX_ACT_CONSTRAINT_LOCAL, KX_ACT_CONSTRAINT_MATERIAL, KX_ACT_CONSTRAINT_NORMAL, KX_ACT_CONSTRAINT_PERMANENT, MODELMATRIX, MODELMATRIX_INVERSE, MODELMATRIX_INVERSETRANSPOSE, MODELMATRIX_TRANSPOSE, MODELVIEWMATRIX, MODELVIEWMATRIX_INVERSE, MODELVIEWMATRIX_INVERSETRANSPOSE, MODELVIEWMATRIX_TRANSPOSE, RAS_2DFILTER_BLUR, RAS_2DFILTER_CUSTOMFILTER, RAS_2DFILTER_DILATION, RAS_2DFILTER_DISABLED, RAS_2DFILTER_ENABLED, RAS_2DFILTER_EROSION, RAS_2DFILTER_GRAYSCALE, RAS_2DFILTER_INVERT, RAS_2DFILTER_LAPLACIAN, RAS_2DFILTER_MOTIONBLUR, RAS_2DFILTER_NOFILTER, RAS_2DFILTER_PREWITT, RAS_2DFILTER_SEPIA, RAS_2DFILTER_SHARPEN, RAS_2DFILTER_SOBEL, SHD_TANGENT, VIEWMATRIX, VIEWMATRIX_INVERSE, VIEWMATRIX_INVERSETRANSPOSE, VIEWMATRIX_TRANSPOSE -@var BL_DST_ALPHA: -@var BL_DST_COLOR: -@var BL_ONE: -@var BL_ONE_MINUS_DST_ALPHA: -@var BL_ONE_MINUS_DST_COLOR: -@var BL_ONE_MINUS_SRC_ALPHA: -@var BL_ONE_MINUS_SRC_COLOR: -@var BL_SRC_ALPHA: -@var BL_SRC_ALPHA_SATURATE: -@var BL_SRC_COLOR: -@var BL_ZERO: -@var CAM_POS: -@var CONSTANT_TIMER: +@group 2D Filter: RAS_2DFILTER_* +@var RAS_2DFILTER_BLUR: +@var RAS_2DFILTER_CUSTOMFILTER: +@var RAS_2DFILTER_DILATION: +@var RAS_2DFILTER_DISABLED: +@var RAS_2DFILTER_ENABLED: +@var RAS_2DFILTER_EROSION: +@var RAS_2DFILTER_GRAYSCALE: +@var RAS_2DFILTER_INVERT: +@var RAS_2DFILTER_LAPLACIAN: +@var RAS_2DFILTER_MOTIONBLUR: +@var RAS_2DFILTER_NOFILTER: +@var RAS_2DFILTER_PREWITT: +@var RAS_2DFILTER_SEPIA: +@var RAS_2DFILTER_SHARPEN: +@var RAS_2DFILTER_SOBEL: + +@group Constraint Actuator: KX_ACT_CONSTRAINT_* @var KX_ACT_CONSTRAINT_DISTANCE: @var KX_ACT_CONSTRAINT_DOROTFH: @var KX_ACT_CONSTRAINT_FHNX: @@ -279,6 +280,16 @@ KX_SCENE_RESUME: See L{KX_SceneActuator} @var KX_ACT_CONSTRAINT_MATERIAL: @var KX_ACT_CONSTRAINT_NORMAL: @var KX_ACT_CONSTRAINT_PERMANENT: + +@group Parent Actuator: KX_PARENT_* +@var KX_PARENT_REMOVE: +@var KX_PARENT_SET: + +@group Shader: MODELMATRIX*, MODELVIEWMATRIX*, VIEWMATRIX*, CAM_POS, CONSTANT_TIMER +@var VIEWMATRIX: +@var VIEWMATRIX_INVERSE: +@var VIEWMATRIX_INVERSETRANSPOSE: +@var VIEWMATRIX_TRANSPOSE: @var MODELMATRIX: @var MODELMATRIX_INVERSE: @var MODELMATRIX_INVERSETRANSPOSE: @@ -287,26 +298,22 @@ KX_SCENE_RESUME: See L{KX_SceneActuator} @var MODELVIEWMATRIX_INVERSE: @var MODELVIEWMATRIX_INVERSETRANSPOSE: @var MODELVIEWMATRIX_TRANSPOSE: -@var RAS_2DFILTER_BLUR: -@var RAS_2DFILTER_CUSTOMFILTER: -@var RAS_2DFILTER_DILATION: -@var RAS_2DFILTER_DISABLED: -@var RAS_2DFILTER_ENABLED: -@var RAS_2DFILTER_EROSION: -@var RAS_2DFILTER_GRAYSCALE: -@var RAS_2DFILTER_INVERT: -@var RAS_2DFILTER_LAPLACIAN: -@var RAS_2DFILTER_MOTIONBLUR: -@var RAS_2DFILTER_NOFILTER: -@var RAS_2DFILTER_PREWITT: -@var RAS_2DFILTER_SEPIA: -@var RAS_2DFILTER_SHARPEN: -@var RAS_2DFILTER_SOBEL: -@var SHD_TANGENT: -@var VIEWMATRIX: -@var VIEWMATRIX_INVERSE: -@var VIEWMATRIX_INVERSETRANSPOSE: -@var VIEWMATRIX_TRANSPOSE: +@var CAM_POS: Current camera position +@var CONSTANT_TIMER: Current camera position +@var SHD_TANGENT: Current camera position + +@group Blender Material: BL_* +@var BL_DST_ALPHA: +@var BL_DST_COLOR: +@var BL_ONE: +@var BL_ONE_MINUS_DST_ALPHA: +@var BL_ONE_MINUS_DST_COLOR: +@var BL_ONE_MINUS_SRC_ALPHA: +@var BL_ONE_MINUS_SRC_COLOR: +@var BL_SRC_ALPHA: +@var BL_SRC_ALPHA_SATURATE: +@var BL_SRC_COLOR: +@var BL_ZERO: @group Deprecated: addActiveActuator """ @@ -337,8 +344,9 @@ def getSceneList(): """ def addActiveActuator(actuator, activate): """ - Activates the given actuator. (B{deprecated}) + Activates the given actuator. + @deprecated: Use L{SCA_PythonController.activate} and L{SCA_PythonController.deactivate} instead. @type actuator: L{SCA_IActuator} or the actuator name as a string. @type activate: boolean @param activate: whether to activate or deactivate the given actuator. @@ -356,10 +364,6 @@ def sendMessage(subject, body="", to="", message_from=""): @param message_from: The name of the object that the message is coming from (optional) @type message_from: string """ -def getRandomFloat(): - """ - Returns a random floating point value in the range [0...1) - """ def setGravity(gravity): """ Sets the world gravity. @@ -429,6 +433,8 @@ def setPhysicsTicRate(ticrate): @param ticrate: The new update frequency (in Hz). @type ticrate: float """ + +#{ Utility functions def getAverageFrameRate(): """ Gets the estimated average framerate @@ -436,7 +442,6 @@ def getAverageFrameRate(): @return: The estimed average framerate in frames per second @rtype: float """ - def expandPath(path): """ Converts a blender internal path into a proper file system path. @@ -465,4 +470,9 @@ def getBlendFileList(path = "//"): def PrintGLInfo(): """ Prints GL Extension Info into the console - """ \ No newline at end of file + """ +def getRandomFloat(): + """ + Returns a random floating point value in the range [0...1) + """ +#} diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index e560489f91f..e6f5b90b5ce 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -44,9 +44,15 @@ class PyObjectPlus: class CValue(PyObjectPlus): """ - This class has no python functions + This class is a basis for other classes. """ - pass + def getName(): + """ + Returns the name of the CValue. + + @note: in most cases the CValue's subclasses will override this function. + @rtype: string + """ class CPropValue(CValue): """ @@ -60,9 +66,9 @@ class SCA_ILogicBrick(CValue): @ivar executePriority: This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first). @type executePriority: int - @ivar owner: The game object this logic brick is attached to (read only). + @ivar owner: The game object this logic brick is attached to (read-only). @type owner: L{KX_GameObject} or None in exceptional cases. - @ivar name: The name of this logic brick (read only). + @ivar name: The name of this logic brick (read-only). @type name: string @group Deprecated: getOwner, setExecutePriority, getExecutePriority """ @@ -72,7 +78,7 @@ class SCA_ILogicBrick(CValue): """ Gets the game object associated with this logic brick. - @deprecated: Use the L{owner} property instead. + @deprecated: Use the L{owner} attribute instead. @rtype: L{KX_GameObject} """ @@ -83,7 +89,7 @@ class SCA_ILogicBrick(CValue): This determines the order controllers are evaluated, and actuators are activated. Bricks with lower priority will be executed first. - @deprecated: Use the L{executePriority} property instead. + @deprecated: Use the L{executePriority} attribute instead. @type priority: integer @param priority: the priority of this logic brick. """ @@ -91,7 +97,7 @@ class SCA_ILogicBrick(CValue): """ Gets the execution priority of this logic brick. - @deprecated: Use the L{executePriority} property instead. + @deprecated: Use the L{executePriority} attribute instead. @rtype: integer @return: this logic bricks current priority. """ @@ -113,17 +119,23 @@ class SCA_ISensor(SCA_ILogicBrick): @type useNegPulseMode: boolean @ivar frequency: The frequency for pulse mode sensors. @type frequency: int - @ivar level: Flag to set whether to detect level or edge transition when entering a state. + @ivar level: Option whether to detect level or edge transition when entering a state. It makes a difference only in case of logic state transition (state actuator). A level detector will immediately generate a pulse, negative or positive depending on the sensor condition, as soon as the state is activated. A edge detector will wait for a state change before generating a pulse. + note: mutually exclusive with L{tap}, enabling will disable L{tap}. @type level: boolean + @ivar tap: When enabled only sensors that are just activated will send a positive event, + after this they will be detected as negative by the controllers. + This will make a key thats held act as if its only tapped for an instant. + note: mutually exclusive with L{level}, enabling will disable L{level}. + @type tap: boolean @ivar invert: Flag to set if this sensor activates on positive or negative events. @type invert: boolean - @ivar triggered: True if this sensor brick is in a positive state. (Read only) + @ivar triggered: True if this sensor brick is in a positive state. (read-only) @type triggered: boolean - @ivar positive: True if this sensor brick is in a positive state. (Read only) + @ivar positive: True if this sensor brick is in a positive state. (read-only) @type positive: boolean @group Deprecated: isPositive, isTriggered, getUsePosPulseMode, setUsePosPulseMode, getFrequency, setFrequency, getUseNegPulseMode, setUseNegPulseMode, getInvert, setInvert, getLevel, setLevel """ @@ -1453,7 +1465,13 @@ class KX_GameActuator(SCA_IActuator): @ivar file: the new .blend file to load @type file: string. @ivar mode: The mode of this actuator - @type mode: int from 0 to 5 L{GameLogic.Game Actuator} + @type mode: Constant in... + - L{GameLogic.KX_GAME_LOAD} + - L{GameLogic.KX_GAME_START} + - L{GameLogic.KX_GAME_RESTART} + - L{GameLogic.KX_GAME_QUIT} + - L{GameLogic.KX_GAME_SAVECFG} + - L{GameLogic.KX_GAME_LOADCFG} """ def getFile(): """ @@ -1478,7 +1496,7 @@ class KX_GameObject(SCA_IObject): Properties assigned to game objects are accessible as attributes of this class. - note: Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError, if an object may have been removed since last accessing it use the L{invalid} attribute to check. - @ivar name: The object's name. (Read only) + @ivar name: The object's name. (read-only) - note: Currently (Blender 2.49) the prefix "OB" is added to all objects name. This may change in blender 2.5. @type name: string. @ivar mass: The object's mass @@ -1495,7 +1513,7 @@ class KX_GameObject(SCA_IObject): @type linVelocityMax: float @ivar localInertia: the object's inertia vector in local coordinates. Read only. @type localInertia: list [ix, iy, iz] - @ivar parent: The object's parent object. (Read only) + @ivar parent: The object's parent object. (read-only) @type parent: L{KX_GameObject} or None @ivar visible: visibility flag. - note: Game logic will still run for invisible objects. @@ -2409,9 +2427,9 @@ class KX_TouchSensor(SCA_ISensor): @type useMaterial: boolean @ivar pulseCollisions: The last collided object. @type pulseCollisions: bool - @ivar objectHit: The last collided object. (Read Only) + @ivar objectHit: The last collided object. (read-only) @type objectHit: L{KX_GameObject} or None - @ivar objectHitList: A list of colliding objects. (Read Only) + @ivar objectHitList: A list of colliding objects. (read-only) @type objectHitList: L{CListValue} of L{KX_GameObject} """ @@ -2486,21 +2504,21 @@ class KX_NetworkMessageActuator(SCA_IActuator): """ Messages will only be sent to objects with the given property name. - @deprecated: Use the L{propName} property instead. + @deprecated: Use the L{propName} attribute instead. @type name: string """ def setSubject(subject): """ Sets the subject field of the message. - @deprecated: Use the L{subject} property instead. + @deprecated: Use the L{subject} attribute instead. @type subject: string """ def setBodyType(bodytype): """ Sets the type of body to send. - @deprecated: Use the L{usePropBody} property instead. + @deprecated: Use the L{usePropBody} attribute instead. @type bodytype: boolean @param bodytype: True to send the value of a property, False to send the body text. """ @@ -2508,7 +2526,7 @@ class KX_NetworkMessageActuator(SCA_IActuator): """ Sets the message body. - deprecated: Use the L{body} property instead. + deprecated: Use the L{body} attribute instead. @type body: string @param body: if the body type is True, this is the name of the property to send. if the body type is False, this is the text to send. @@ -2536,7 +2554,7 @@ class KX_NetworkMessageSensor(SCA_ISensor): """ Change the message subject text that this sensor is listening to. - @deprecated: Use the L{subject} property instead. + @deprecated: Use the L{subject} attribute instead. @type subject: string @param subject: the new message subject to listen for. """ @@ -2545,28 +2563,28 @@ class KX_NetworkMessageSensor(SCA_ISensor): """ Get the number of messages received since the last frame. - @deprecated: Use the L{frameMessageCount} property instead. + @deprecated: Use the L{frameMessageCount} attribute instead. @rtype: integer """ def getBodies(): """ Gets the list of message bodies. - @deprecated: Use the L{bodies} property instead. + @deprecated: Use the L{bodies} attribute instead. @rtype: list """ def getSubject(): """ Gets the message subject this sensor is listening for from the Subject: field. - @deprecated: Use the L{subject} property instead. + @deprecated: Use the L{subject} attribute instead. @rtype: string """ def getSubjects(): """ Gets the list of message subjects received. - @deprecated: Use the L{subjects} property instead. + @deprecated: Use the L{subjects} attribute instead. @rtype: list """ @@ -2579,7 +2597,7 @@ class KX_ObjectActuator(SCA_IActuator): @ivar force: The force applied by the actuator @type force: list [x, y, z] @ivar useLocalForce: A flag specifying if the force is local - @type force: bool + @type useLocalForce: bool @ivar torque: The torque applied by the actuator @type torque: list [x, y, z] @ivar useLocalTorque: A flag specifying if the torque is local @@ -3186,16 +3204,16 @@ class KX_PolygonMaterial: print mat.texture @ivar texture: Texture name - @type texture: string (read only) + @type texture: string (read-only) @ivar gl_texture: OpenGL texture handle (eg for glBindTexture(GL_TEXTURE_2D, gl_texture) - @type gl_texture: integer (read only) + @type gl_texture: integer (read-only) @ivar material: Material name - @type material: string (read only) + @type material: string (read-only) @ivar tface: Texture face properties - @type tface: CObject (read only) + @type tface: CObject (read-only) @ivar tile: Texture is tiling @type tile: boolean @@ -3330,10 +3348,10 @@ class KX_RadarSensor(KX_NearSensor): @ivar coneOrigin: The origin of the cone with which to test. The origin is in the middle of the cone. - (Read only) + (read-only) @type coneOrigin: list of floats [x, y, z] @ivar coneTarget: The center of the bottom face of the cone with which to test. - (Read only) + (read-only) @type coneTarget: list of floats [x, y, z] @ivar distance: The height of the cone with which to test. @type distance: float @@ -3401,28 +3419,28 @@ class KX_RaySensor(SCA_ISensor): """ Returns the game object that was hit by this ray. - @deprecated: Use the L{hitObject} property instead. + @deprecated: Use the L{hitObject} attribute instead. @rtype: KX_GameObject """ def getHitPosition(): """ Returns the position (in worldcoordinates) where the object was hit by this ray. - @deprecated: Use the L{hitPosition} property instead. + @deprecated: Use the L{hitPosition} attribute instead. @rtype: list [x, y, z] """ def getHitNormal(): """ Returns the normal (in worldcoordinates) of the object at the location where the object was hit by this ray. - @deprecated: Use the L{hitNormal} property instead. + @deprecated: Use the L{hitNormal} attribute instead. @rtype: list [nx, ny, nz] """ def getRayDirection(): """ Returns the direction from the ray (in worldcoordinates) - @deprecated: Use the L{rayDirection} property instead. + @deprecated: Use the L{rayDirection} attribute instead. @rtype: list [dx, dy, dz] """ @@ -3431,7 +3449,7 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): Edit Object Actuator (in Add Object Mode) @ivar object: the object this actuator adds. @type object: KX_GameObject or None - @ivar objectLastCreated: the last added object from this actuator (read only). + @ivar objectLastCreated: the last added object from this actuator (read-only). @type objectLastCreated: KX_GameObject or None @ivar time: the lifetime of added objects, in frames. @type time: integer @@ -3560,12 +3578,12 @@ class KX_SCA_DynamicActuator(SCA_IActuator): - 3 = disable rigid body - 4 = set mass - @deprecated: Use the L{operation} property instead. + @deprecated: Use the L{operation} attribute instead. """ def getOperation(): """ return the type of operation - @deprecated: Use the L{operation} property instead. + @deprecated: Use the L{operation} attribute instead. """ class KX_SCA_EndObjectActuator(SCA_IActuator): @@ -3638,7 +3656,7 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator): Sets the name of the mesh that will replace the current one. When the name is None it will unset the mesh value so no action is taken. - @deprecated: Use the L{mesh} property instead. + @deprecated: Use the L{mesh} attribute instead. @type name: string or None """ def getMesh(): @@ -3647,7 +3665,7 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator): Returns None if no mesh has been scheduled to be added. - @deprecated: Use the L{mesh} property instead. + @deprecated: Use the L{mesh} attribute instead. @rtype: string or None """ def instantReplaceMesh(): @@ -3703,7 +3721,7 @@ class KX_Scene(PyObjectPlus): @ivar cameras: A list of cameras in the scene, (read-only). @type cameras: L{CListValue} of L{KX_Camera} @ivar active_camera: The current active camera. - @note: this can be set directly from python to avoid using the L{KX_SceneActuator} + note: this can be set directly from python to avoid using the L{KX_SceneActuator}. @type active_camera: L{KX_Camera} @ivar suspended: True if the scene is suspended, (read-only). @type suspended: boolean @@ -3711,6 +3729,8 @@ class KX_Scene(PyObjectPlus): @type activity_culling: boolean @ivar activity_culling_radius: The distance outside which to do activity culling. Measured in manhattan distance. @type activity_culling_radius: float + @ivar dbvt_culling: True when Dynamic Bounding box Volume Tree is set (read-only). + @type dbvt_culling: bool @group Deprecated: getLightList, getObjectList, getName """ @@ -3718,21 +3738,21 @@ class KX_Scene(PyObjectPlus): """ Returns the list of lights in the scene. - @deprecated: Use the L{lights} property instead. + @deprecated: Use the L{lights} attribute instead. @rtype: list [L{KX_LightObject}] """ def getObjectList(): """ Returns the list of objects in the scene. - @deprecated: Use the L{objects} property instead. + @deprecated: Use the L{objects} attribute instead. @rtype: list [L{KX_GameObject}] """ def getName(): """ Returns the name of the scene. - @deprecated: Use the L{name} property instead. + @deprecated: Use the L{name} attribute instead. @rtype: string """ @@ -3775,14 +3795,14 @@ class KX_SceneActuator(SCA_IActuator): """ Set flag to True to restart the scene. - @deprecated: Use the L{useRestart} property instead. + @deprecated: Use the L{useRestart} attribute instead. @type flag: boolean """ def setScene(scene): """ Sets the name of the scene to change to/overlay/underlay/remove/suspend/resume. - @deprecated: use the L{scene} property instead. + @deprecated: use the L{scene} attribute instead. @type scene: string """ def setCamera(camera): @@ -3791,14 +3811,14 @@ class KX_SceneActuator(SCA_IActuator): Camera can be either a L{KX_Camera} or the name of the camera. - @deprecated: use the L{camera} property instead. + @deprecated: use the L{camera} attribute instead. @type camera: L{KX_Camera} or string """ def getUseRestart(): """ Returns True if the scene will be restarted. - @deprecated: use the L{useRestart} property instead. + @deprecated: use the L{useRestart} attribute instead. @rtype: boolean """ def getScene(): @@ -3807,14 +3827,14 @@ class KX_SceneActuator(SCA_IActuator): Returns an empty string ("") if no scene has been set. - @deprecated: use the L{scene} property instead. + @deprecated: use the L{scene} attribute instead. @rtype: string """ def getCamera(): """ Returns the name of the camera to change to. - @deprecated: use the L{camera} property instead. + @deprecated: use the L{camera} attribute instead. @rtype: string """ @@ -3866,14 +3886,14 @@ class KX_SoundActuator(SCA_IActuator): """ Sets the filename of the sound this actuator plays. - @deprecated: Use the L{filename} property instead. + @deprecated: Use the L{filename} attribute instead. @type filename: string """ def getFilename(): """ Returns the filename of the sound this actuator plays. - @deprecated: Use the L{filename} property instead. + @deprecated: Use the L{filename} attribute instead. @rtype: string """ def startSound(): @@ -3892,7 +3912,7 @@ class KX_SoundActuator(SCA_IActuator): """ Sets the gain (volume) of the sound - @deprecated: Use the L{volume} property instead. + @deprecated: Use the L{volume} attribute instead. @type gain: float @param gain: 0.0 (quiet) <= gain <= 1.0 (loud) """ @@ -3900,21 +3920,21 @@ class KX_SoundActuator(SCA_IActuator): """ Gets the gain (volume) of the sound. - @deprecated: Use the L{volume} property instead. + @deprecated: Use the L{volume} attribute instead. @rtype: float """ def setPitch(pitch): """ Sets the pitch of the sound. - @deprecated: Use the L{pitch} property instead. + @deprecated: Use the L{pitch} attribute instead. @type pitch: float """ def getPitch(): """ Returns the pitch of the sound. - @deprecated: Use the L{pitch} property instead. + @deprecated: Use the L{pitch} attribute instead. @rtype: float """ def setRollOffFactor(rolloff): @@ -3924,14 +3944,14 @@ class KX_SoundActuator(SCA_IActuator): Rolloff defines the rate of attenuation as the sound gets further away. Higher rolloff factors shorten the distance at which the sound can be heard. - @deprecated: Use the L{rollOffFactor} property instead. + @deprecated: Use the L{rollOffFactor} attribute instead. @type rolloff: float """ def getRollOffFactor(): """ Returns the rolloff factor for the sound. - @deprecated: Use the L{rollOffFactor} property instead. + @deprecated: Use the L{rollOffFactor} attribute instead. @rtype: float """ def setLooping(loop): @@ -3946,21 +3966,21 @@ class KX_SoundActuator(SCA_IActuator): - Bidirection Stop 5 - Bidirection End 6 - @deprecated: Use the L{looping} property instead. + @deprecated: Use the L{looping} attribute instead. @type loop: integer """ def getLooping(): """ Returns the current loop mode of the actuator. - @deprecated: Use the L{looping} property instead. + @deprecated: Use the L{looping} attribute instead. @rtype: integer """ def setPosition(x, y, z): """ Sets the position this sound will come from. - @deprecated: Use the L{position} property instead. + @deprecated: Use the L{position} attribute instead. @type x: float @param x: The x coordinate of the sound. @type y: float @@ -3974,7 +3994,7 @@ class KX_SoundActuator(SCA_IActuator): The sound's pitch is determined from the velocity. - @deprecated: Use the L{velocity} property instead. + @deprecated: Use the L{velocity} attribute instead. @type vx: float @param vx: The vx coordinate of the sound. @type vy: float @@ -3990,14 +4010,14 @@ class KX_SoundActuator(SCA_IActuator): | o11, o12, o13 | | o21, o22, o23 | | o31, o32, o33 | - @deprecated: Use the L{orientation} property instead. + @deprecated: Use the L{orientation} attribute instead. """ def setType(mode): """ Sets the operation mode of the actuator. - @deprecated: Use the L{type} property instead. + @deprecated: Use the L{type} attribute instead. @param mode: KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP @type mode: integer """ @@ -4006,7 +4026,7 @@ class KX_SoundActuator(SCA_IActuator): """ Returns the operation mode of the actuator. - @deprecated: Use the L{type} property instead. + @deprecated: Use the L{type} attribute instead. @rtype: integer @return: KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP """ @@ -4036,7 +4056,7 @@ class KX_StateActuator(SCA_IActuator): Set the type of bit operation to be applied on object state mask. Use setMask() to specify the bits that will be modified. - @deprecated: Use the L{operation} property instead. + @deprecated: Use the L{operation} attribute instead. @param op: bit operation (0=Copy, 1=Add, 2=Substract, 3=Invert) @type op: integer """ @@ -4047,7 +4067,7 @@ class KX_StateActuator(SCA_IActuator): the bits that are 0 are will be left unmodified expect for the Copy operation which copies the value to the object state. - @deprecated: Use the L{mask} property instead. + @deprecated: Use the L{mask} attribute instead. @param mask: bits that will be modified @type mask: integer """ @@ -4075,7 +4095,7 @@ class KX_TrackToActuator(SCA_IActuator): """ Sets the object to track. - @deprecated: Use the L{object} property instead. + @deprecated: Use the L{object} attribute instead. @type object: L{KX_GameObject}, string or None @param object: Either a reference to a game object or the name of the object to track. """ @@ -4083,7 +4103,7 @@ class KX_TrackToActuator(SCA_IActuator): """ Returns the name of the object to track. - @deprecated: Use the L{object} property instead. + @deprecated: Use the L{object} attribute instead. @type name_only: bool @param name_only: optional argument, when 0 return a KX_GameObject @rtype: string, KX_GameObject or None if no object is set @@ -4092,14 +4112,14 @@ class KX_TrackToActuator(SCA_IActuator): """ Sets the time in frames with which to delay the tracking motion. - @deprecated: Use the L{time} property instead. + @deprecated: Use the L{time} attribute instead. @type time: integer """ def getTime(): """ Returns the time in frames with which the tracking motion is delayed. - @deprecated: Use the L{time} property instead. + @deprecated: Use the L{time} attribute instead. @rtype: integer """ def setUse3D(use3d): @@ -4107,7 +4127,7 @@ class KX_TrackToActuator(SCA_IActuator): DEPRECATED: Use the property. Sets the tracking motion to use 3D. - @deprecated: Use the L{use3D} property instead. + @deprecated: Use the L{use3D} attribute instead. @type use3d: boolean @param use3d: - True: allow the tracking motion to extend in the z-direction. - False: lock the tracking motion to the x-y plane. @@ -4116,7 +4136,7 @@ class KX_TrackToActuator(SCA_IActuator): """ Returns True if the tracking motion will track in the z direction. - @deprecated: Use the L{use3D} property instead. + @deprecated: Use the L{use3D} attribute instead. @rtype: boolean """ @@ -4440,7 +4460,7 @@ class KX_VisibilityActuator(SCA_IActuator): """ Sets whether the actuator makes its parent object visible or invisible. - @deprecated: Use the L{visibility} property instead. + @deprecated: Use the L{visibility} attribute instead. @param visible: - True: Makes its parent visible. - False: Makes its parent invisible. """ @@ -4509,7 +4529,7 @@ class SCA_ActuatorSensor(SCA_ISensor): """ Return the Actuator with which the sensor operates. - @deprecated: Use the L{actuator} property instead. + @deprecated: Use the L{actuator} attribute instead. @rtype: string """ def setActuator(name): @@ -4517,7 +4537,7 @@ class SCA_ActuatorSensor(SCA_ISensor): Sets the Actuator with which to operate. If there is no Actuator of this name, the function has no effect. - @deprecated: Use the L{actuator} property instead. + @deprecated: Use the L{actuator} attribute instead. @param name: actuator name @type name: string """ @@ -4553,7 +4573,7 @@ class SCA_DelaySensor(SCA_ISensor): """ Set the initial delay before the positive trigger. - @deprecated: Use the L{delay} property instead. + @deprecated: Use the L{delay} attribute instead. @param delay: length of the initial OFF period as number of frame, 0 for immediate trigger @type delay: integer """ @@ -4562,7 +4582,7 @@ class SCA_DelaySensor(SCA_ISensor): Set the duration of the ON pulse after initial delay and the generation of the positive trigger. If duration is greater than 0, a negative trigger is sent at the end of the ON pulse. - @deprecated: Use the L{duration} property instead. + @deprecated: Use the L{duration} attribute instead. @param duration: length of the ON period in number of frame after the initial OFF period @type duration: integer """ @@ -4570,7 +4590,7 @@ class SCA_DelaySensor(SCA_ISensor): """ Set if the sensor repeat mode. - @deprecated: Use the L{repeat} property instead. + @deprecated: Use the L{repeat} attribute instead. @param repeat: 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once. @type repeat: integer """ @@ -4578,21 +4598,21 @@ class SCA_DelaySensor(SCA_ISensor): """ Return the delay parameter value. - @deprecated: Use the L{delay} property instead. + @deprecated: Use the L{delay} attribute instead. @rtype: integer """ def getDuration(): """ Return the duration parameter value - @deprecated: Use the L{duration} property instead. + @deprecated: Use the L{duration} attribute instead. @rtype: integer """ def getRepeat(): """ Return the repeat parameter value - @deprecated: Use the L{repeat} property instead. + @deprecated: Use the L{repeat} attribute instead. @rtype: KX_TRUE or KX_FALSE """ @@ -4652,14 +4672,14 @@ class SCA_JoystickSensor(SCA_ISensor): """ Returns the joystick index to use (from 1 to 8). - @deprecated: Use the L{index} property instead. + @deprecated: Use the L{index} attribute instead. @rtype: integer """ def setIndex(index): """ Sets the joystick index to use. - @deprecated: Use the L{index} property instead. + @deprecated: Use the L{index} attribute instead. @param index: The index of this joystick sensor, Clamped between 1 and 8. @type index: integer @note: This is only useful when you have more then 1 joystick connected to your computer - multiplayer games. @@ -4668,14 +4688,14 @@ class SCA_JoystickSensor(SCA_ISensor): """ Returns the current axis this sensor reacts to. See L{getAxisValue()} for the current axis state. - @deprecated: Use the L{axis} property instead. + @deprecated: Use the L{axis} attribute instead. @rtype: list @return: 2 values returned are [axisIndex, axisDirection] - see L{setAxis()} for their purpose. @note: When the "All Events" toggle is set, this option has no effect. """ def setAxis(axisIndex, axisDirection): """ - @deprecated: Use the L{axis} property instead. + @deprecated: Use the L{axis} attribute instead. @param axisIndex: Set the axis index to use when detecting axis movement. @type axisIndex: integer from 1 to 2 @param axisDirection: Set the axis direction used for detecting motion. 0:right, 1:up, 2:left, 3:down. @@ -4686,7 +4706,7 @@ class SCA_JoystickSensor(SCA_ISensor): """ Returns the state of the joysticks axis. See differs to L{getAxis()} returning the current state of the joystick. - @deprecated: Use the L{axisPosition} property instead. + @deprecated: Use the L{axisPosition} attribute instead. @rtype: list @return: 4 values, each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing. @@ -4699,14 +4719,14 @@ class SCA_JoystickSensor(SCA_ISensor): """ Get the axis threshold. See L{setThreshold()} for details. - @deprecated: Use the L{threshold} property instead. + @deprecated: Use the L{threshold} attribute instead. @rtype: integer """ def setThreshold(threshold): """ Set the axis threshold. - @deprecated: Use the L{threshold} property instead. + @deprecated: Use the L{threshold} attribute instead. @param threshold: Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive. @type threshold: integer """ @@ -4714,7 +4734,7 @@ class SCA_JoystickSensor(SCA_ISensor): """ Returns the button index the sensor reacts to. See L{getButtonValue()} for a list of pressed buttons. - @deprecated: Use the L{button} property instead. + @deprecated: Use the L{button} attribute instead. @rtype: integer @note: When the "All Events" toggle is set, this option has no effect. """ @@ -4722,7 +4742,7 @@ class SCA_JoystickSensor(SCA_ISensor): """ Sets the button index the sensor reacts to when the "All Events" option is not set. - @deprecated: Use the L{button} property instead. + @deprecated: Use the L{button} attribute instead. @note: When the "All Events" toggle is set, this option has no effect. """ def getButtonValue(): @@ -4737,7 +4757,7 @@ class SCA_JoystickSensor(SCA_ISensor): Returns the current hat direction this sensor is set to. [hatNumber, hatDirection]. - @deprecated: Use the L{hat} property instead. + @deprecated: Use the L{hat} attribute instead. @rtype: list @note: When the "All Events" toggle is set, this option has no effect. """ @@ -4745,35 +4765,35 @@ class SCA_JoystickSensor(SCA_ISensor): """ Sets the hat index the sensor reacts to when the "All Events" option is not set. - @deprecated: Use the L{hat} property instead. + @deprecated: Use the L{hat} attribute instead. @type index: integer """ def getNumAxes(): """ Returns the number of axes for the joystick at this index. - @deprecated: Use the L{numAxis} property instead. + @deprecated: Use the L{numAxis} attribute instead. @rtype: integer """ def getNumButtons(): """ Returns the number of buttons for the joystick at this index. - @deprecated: Use the L{numButtons} property instead. + @deprecated: Use the L{numButtons} attribute instead. @rtype: integer """ def getNumHats(): """ Returns the number of hats for the joystick at this index. - @deprecated: Use the L{numHats} property instead. + @deprecated: Use the L{numHats} attribute instead. @rtype: integer """ def isConnected(): """ Returns True if a joystick is detected at this joysticks index. - @deprecated: Use the L{connected} property instead. + @deprecated: Use the L{connected} attribute instead. @rtype: bool """ @@ -4795,7 +4815,7 @@ class SCA_KeyboardSensor(SCA_ISensor): @type targetProperty: string @ivar useAllKeys: Flag to determine whether or not to accept all keys. @type useAllKeys: boolean - @ivar events: a list of pressed keys that have either been pressed, or just released, or are active this frame. (read only). + @ivar events: a list of pressed keys that have either been pressed, or just released, or are active this frame. (read-only). - 'keycode' matches the values in L{GameKeys}. - 'status' uses... @@ -4822,7 +4842,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Returns the key code this sensor is looking for. - @deprecated: Use the L{key} property instead. + @deprecated: Use the L{key} attribute instead. @rtype: keycode from L{GameKeys} module """ @@ -4830,7 +4850,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Set the key this sensor should listen for. - @deprecated: Use the L{key} property instead. + @deprecated: Use the L{key} attribute instead. @type keycode: keycode from L{GameKeys} module """ @@ -4838,7 +4858,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Returns the key code for the first modifier this sensor is looking for. - @deprecated: Use the L{hold1} property instead. + @deprecated: Use the L{hold1} attribute instead. @rtype: keycode from L{GameKeys} module """ @@ -4846,7 +4866,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Sets the key code for the first modifier this sensor should look for. - @deprecated: Use the L{hold1} property instead. + @deprecated: Use the L{hold1} attribute instead. @type keycode: keycode from L{GameKeys} module """ @@ -4854,7 +4874,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Returns the key code for the second modifier this sensor is looking for. - @deprecated: Use the L{hold2} property instead. + @deprecated: Use the L{hold2} attribute instead. @rtype: keycode from L{GameKeys} module """ @@ -4862,7 +4882,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Sets the key code for the second modifier this sensor should look for. - @deprecated: Use the L{hold2} property instead. + @deprecated: Use the L{hold2} attribute instead. @type keycode: keycode from L{GameKeys} module """ @@ -4870,7 +4890,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Get a list of keys that have either been pressed, or just released this frame. - @deprecated: Use the L{events} property instead. + @deprecated: Use the L{events} attribute instead. @rtype: list of key status. [[keycode, status]] """ @@ -4878,7 +4898,7 @@ class SCA_KeyboardSensor(SCA_ISensor): """ Get a list of currently pressed keys that have either been pressed, or just released - @deprecated: Use the L{events} property instead. + @deprecated: Use the L{events} attribute instead. @rtype: list of key status. [[keycode, status]] """ @@ -4913,6 +4933,8 @@ class SCA_PropertyActuator(SCA_IActuator): @type property: string @ivar value: the value with which the actuator operates. @type value: string + @ivar type: TODO - add constants to game logic dict!. + @type type: iny """ def setProperty(prop): """ @@ -4920,7 +4942,7 @@ class SCA_PropertyActuator(SCA_IActuator): If there is no property of this name, the call is ignored. - @deprecated: Use the L{property} property instead. + @deprecated: Use the L{property} attribute instead. @type prop: string @param prop: The name of the property to set. """ @@ -4928,7 +4950,7 @@ class SCA_PropertyActuator(SCA_IActuator): """ Returns the name of the property on which to operate. - @deprecated: Use the L{property} property instead. + @deprecated: Use the L{property} attribute instead. @rtype: string """ def setValue(value): @@ -4938,14 +4960,14 @@ class SCA_PropertyActuator(SCA_IActuator): If the value is not compatible with the type of the property, the subsequent action is ignored. - @deprecated: Use the L{value} property instead. + @deprecated: Use the L{value} attribute instead. @type value: string """ def getValue(): """ Gets the value with which this actuator operates. - @deprecated: Use the L{value} property instead. + @deprecated: Use the L{value} attribute instead. @rtype: string """ @@ -4969,7 +4991,7 @@ class SCA_PropertySensor(SCA_ISensor): """ Gets when to activate this sensor. - @deprecated: Use the L{type} property instead. + @deprecated: Use the L{type} attribute instead. @return: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL, KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED, or KX_PROPSENSOR_EXPRESSION. @@ -4979,7 +5001,7 @@ class SCA_PropertySensor(SCA_ISensor): """ Set the type of check to perform. - @deprecated: Use the L{type} property instead. + @deprecated: Use the L{type} attribute instead. @type checktype: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL, KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED, or KX_PROPSENSOR_EXPRESSION. @@ -4989,7 +5011,7 @@ class SCA_PropertySensor(SCA_ISensor): """ Return the property with which the sensor operates. - @deprecated: Use the L{property} property instead. + @deprecated: Use the L{property} attribute instead. @rtype: string @return: the name of the property this sensor is watching. """ @@ -4998,14 +5020,14 @@ class SCA_PropertySensor(SCA_ISensor): Sets the property with which to operate. If there is no property of that name, this call is ignored. - @deprecated: Use the L{property} property instead. + @deprecated: Use the L{property} attribute instead. @type name: string. """ def getValue(): """ Return the value with which the sensor compares to the value of the property. - @deprecated: Use the L{value} property instead. + @deprecated: Use the L{value} attribute instead. @rtype: string @return: the value of the property this sensor is watching. """ @@ -5015,7 +5037,7 @@ class SCA_PropertySensor(SCA_ISensor): is not compatible with the type of the property, the subsequent action is ignored. - @deprecated: Use the L{value} property instead. + @deprecated: Use the L{value} attribute instead. @type value: string """ @@ -5045,14 +5067,14 @@ class SCA_PythonController(SCA_IController): """ Gets the Python script this controller executes. - @deprecated: Use the L{script} property instead. + @deprecated: Use the L{script} attribute instead. @rtype: string """ def setScript(script): """ Sets the Python script this controller executes. - @deprecated: Use the L{script} property instead. + @deprecated: Use the L{script} attribute instead. @type script: string. """ @@ -5092,14 +5114,14 @@ class SCA_RandomActuator(SCA_IActuator): Equal seeds produce equal series. If the seed is 0, the generator will produce the same value on every call. - @deprecated: Use the L{seed} property instead. + @deprecated: Use the L{seed} attribute instead. @type seed: integer """ def getSeed(): """ Returns the initial seed of the generator. - @deprecated: Use the L{seed} property instead. + @deprecated: Use the L{seed} attribute instead. @rtype: integer """ def getPara1(): @@ -5109,7 +5131,7 @@ class SCA_RandomActuator(SCA_IActuator): Refer to the documentation of the generator types for the meaning of this value. - @deprecated: Use the L{para1} property instead. + @deprecated: Use the L{para1} attribute instead. @rtype: float """ def getPara2(): @@ -5119,14 +5141,14 @@ class SCA_RandomActuator(SCA_IActuator): Refer to the documentation of the generator types for the meaning of this value. - @deprecated: Use the L{para2} property instead. + @deprecated: Use the L{para2} attribute instead. @rtype: float """ def getDistribution(): """ Returns the type of random distribution. - @deprecated: Use the L{distribution} property instead. + @deprecated: Use the L{distribution} attribute instead. @rtype: distribution type @return: KX_RANDOMACT_BOOL_CONST, KX_RANDOMACT_BOOL_UNIFORM, KX_RANDOMACT_BOOL_BERNOUILLI, KX_RANDOMACT_INT_CONST, KX_RANDOMACT_INT_UNIFORM, KX_RANDOMACT_INT_POISSON, @@ -5139,7 +5161,7 @@ class SCA_RandomActuator(SCA_IActuator): If the generator and property types do not match, the assignment is ignored. - @deprecated: Use the L{property} property instead. + @deprecated: Use the L{property} attribute instead. @type property: string @param property: The name of the property to set. """ @@ -5147,7 +5169,7 @@ class SCA_RandomActuator(SCA_IActuator): """ Returns the name of the property to set. - @deprecated: Use the L{property} property instead. + @deprecated: Use the L{property} attribute instead. @rtype: string """ def setBoolConst(value): @@ -5289,37 +5311,33 @@ class KX_Camera(KX_GameObject): @type near: float @ivar far: The camera's far clip distance. @type far: float - @ivar perspective: True if this camera has a perspective transform. - - If perspective is False, this camera has an orthographic transform. - - Note that the orthographic transform is faked by multiplying the lens attribute - by 100.0 and translating the camera 100.0 along the z axis. - - This is the same as Blender. If you want a true orthographic transform, see L{setProjectionMatrix}. + @ivar perspective: True if this camera has a perspective transform, False for an orthographic projection. @type perspective: boolean @ivar frustum_culling: True if this camera is frustum culling. @type frustum_culling: boolean @ivar projection_matrix: This camera's 4x4 projection matrix. @type projection_matrix: 4x4 Matrix [[float]] - @ivar modelview_matrix: This camera's 4x4 model view matrix. (read only) + @ivar modelview_matrix: This camera's 4x4 model view matrix. (read-only) Regenerated every frame from the camera's position and orientation. @type modelview_matrix: 4x4 Matrix [[float]] - @ivar camera_to_world: This camera's camera to world transform. (read only) + @ivar camera_to_world: This camera's camera to world transform. (read-only) Regenerated every frame from the camera's position and orientation. @type camera_to_world: 4x4 Matrix [[float]] - @ivar world_to_camera: This camera's world to camera transform. (read only) + @ivar world_to_camera: This camera's world to camera transform. (read-only) Regenerated every frame from the camera's position and orientation. This is camera_to_world inverted. @type world_to_camera: 4x4 Matrix [[float]] + @ivar useViewport: True when the camera is used as a viewport, set True to enable a viewport for this camera. + @type useViewport: bool - @group Deprecated: enableViewport + @group Deprecated: enableViewport, getProjectionMatrix, setProjectionMatrix """ def sphereInsideFrustum(centre, radius): """ Tests the given sphere against the view frustum. + @note: when the camera is first initialized the result will be invalid because the projection matrix has not been set. @param centre: The centre of the sphere (in world coordinates.) @type centre: list [x, y, z] @param radius: the radius of the sphere @@ -5364,6 +5382,7 @@ class KX_Camera(KX_GameObject): else: # Box is outside the frustum ! + @note: when the camera is first initialized the result will be invalid because the projection matrix has not been set. @return: INSIDE, OUTSIDE or INTERSECT @type box: list @param box: Eight (8) corner points of the box (in world coordinates.) @@ -5384,6 +5403,7 @@ class KX_Camera(KX_GameObject): else: # Box is outside the frustum ! + @note: when the camera is first initialized the result will be invalid because the projection matrix has not been set. @rtype: boolean @return: True if the given point is inside this camera's viewing frustum. @type point: [x, y, z] @@ -5409,6 +5429,7 @@ class KX_Camera(KX_GameObject): """ Returns the camera's projection matrix. + @deprecated: Use the L{projection_matrix} attribute instead. @rtype: matrix (4x4 list) @return: the camera's projection matrix. """ @@ -5455,6 +5476,7 @@ class KX_Camera(KX_GameObject): cam = co.owner cam.setProjectionMatrix(Perspective(cam))) + @deprecated: Use the L{projection_matrix} attribute instead. @type matrix: 4x4 matrix. @param matrix: The new projection matrix for this camera. """ @@ -5463,7 +5485,7 @@ class KX_Camera(KX_GameObject): """ Use this camera to draw a viewport on the screen (for split screen games or overlay scenes). The viewport region is defined with L{setViewport}. - @deprecated: Use the L{isViewport} property instead. + @deprecated: Use the L{useViewport} attribute instead. @type viewport: bool @param viewport: the new viewport status """ -- cgit v1.2.3 From e8c0440660be3523f5d6dda300158225d93145f1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 15 May 2009 02:03:27 +0000 Subject: minor change - mistake in joystick fix, util function for getting attrs from BGE types --- source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp | 2 +- source/gameengine/PyDoc/GameTypes.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp index c32ff303aea..b19424f20e9 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp @@ -249,7 +249,7 @@ bool SCA_Joystick::CreateJoystickDevice(void) else if (m_axismax < 0) m_axismax = 0; if(m_buttonmax<0) m_buttonmax= 0; - if(m_hatmax<0) m_buttonmax= 0; + if(m_hatmax<0) m_hatmax= 0; } return true; #endif diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index e6f5b90b5ce..0240efa4eab 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -5504,3 +5504,19 @@ class KX_Camera(KX_GameObject): @type right: int @type top: int """ + +# Util func to extract all attrs +""" +import types +attrs = [] +for name, val in __builtins__.locals().items(): + if name.startswith('__'): + continue + if type(val) == types.ClassType: + for line in val.__doc__.split('\n'): + if '@ivar' in line: + attrs.append(name + '::' + line.split()[1].replace(':', '')) + +for a in attrs: + print a +""" \ No newline at end of file -- cgit v1.2.3 From b8657fd64895f9fcf7d5308b298e516c02faf110 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 15 May 2009 03:26:53 +0000 Subject: Name attributes added since 2.48a more consistently. BL_ActionActuator::blendin -> blendIn BL_ActionActuator::end -> frameEnd BL_ActionActuator::property -> propName BL_ActionActuator::start -> frameStart BL_ActionActuator::type -> mode BL_ShapeActionActuator::blendin -> blendIn BL_ShapeActionActuator::end -> frameEnd BL_ShapeActionActuator::frameProperty -> framePropName BL_ShapeActionActuator::property -> propName BL_ShapeActionActuator::start -> frameStart BL_ShapeActionActuator::type -> mode KX_CameraActuator::xy -> useXY KX_ConstraintActuator::property -> propName KX_GameActuator::file -> fileName KX_GameObject::localScaling -> localScaling KX_GameObject::worldScaling -> worldScaling KX_IpoActuator::endFrame -> frameEnd KX_IpoActuator::startFrame -> frameStart KX_IpoActuator::type -> mode KX_RaySensor::property -> propName KX_SCA_DynamicActuator::operation -> mode KX_Scene::objects_inactive -> objectsInactive KX_SoundActuator::filename -> fileName KX_SoundActuator::type -> mode KX_TouchSensor::objectHit -> hitObject KX_TouchSensor::objectHitList -> hitObjectList KX_TouchSensor::property -> propName KX_TouchSensor::pulseCollisions -> usePulseCollision KX_VisibilityActuator::occlusion -> useOcclusion KX_VisibilityActuator::recursion -> useRecursion SCA_2DFilterActuator::passNb -> passNumber SCA_PropertyActuator::property -> propName SCA_PropertyActuator::type -> mode SCA_PropertySensor::property -> propName SCA_PropertySensor::type -> mode SCA_RandomActuator::property -> propName --- source/gameengine/Converter/BL_ActionActuator.cpp | 12 +- .../Converter/BL_ShapeActionActuator.cpp | 12 +- .../gameengine/GameLogic/SCA_2DFilterActuator.cpp | 4 +- .../gameengine/GameLogic/SCA_PropertyActuator.cpp | 8 +- source/gameengine/GameLogic/SCA_PropertySensor.cpp | 12 +- source/gameengine/GameLogic/SCA_RandomActuator.cpp | 6 +- source/gameengine/Ketsji/KX_CameraActuator.cpp | 4 +- source/gameengine/Ketsji/KX_ConstraintActuator.cpp | 2 +- source/gameengine/Ketsji/KX_GameActuator.cpp | 6 +- source/gameengine/Ketsji/KX_GameObject.cpp | 4 +- source/gameengine/Ketsji/KX_IpoActuator.cpp | 23 +- source/gameengine/Ketsji/KX_RaySensor.cpp | 2 +- .../gameengine/Ketsji/KX_SCA_DynamicActuator.cpp | 6 +- source/gameengine/Ketsji/KX_Scene.cpp | 2 +- source/gameengine/Ketsji/KX_SoundActuator.cpp | 16 +- source/gameengine/Ketsji/KX_TouchSensor.cpp | 16 +- source/gameengine/Ketsji/KX_VisibilityActuator.cpp | 4 +- source/gameengine/PyDoc/GameLogic.py | 4 +- source/gameengine/PyDoc/GameTypes.py | 457 +++++++++++---------- source/gameengine/PyDoc/bge_api_validate_py.txt | 7 +- 20 files changed, 324 insertions(+), 283 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 145cb1f22de..d0a4a87af72 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -997,17 +997,17 @@ PyMethodDef BL_ActionActuator::Methods[] = { }; PyAttributeDef BL_ActionActuator::Attributes[] = { - KX_PYATTRIBUTE_FLOAT_RW("start", 0, MAXFRAMEF, BL_ActionActuator, m_startframe), - KX_PYATTRIBUTE_FLOAT_RW("end", 0, MAXFRAMEF, BL_ActionActuator, m_endframe), - KX_PYATTRIBUTE_FLOAT_RW("blendin", 0, MAXFRAMEF, BL_ActionActuator, m_blendin), + KX_PYATTRIBUTE_FLOAT_RW("frameStart", 0, MAXFRAMEF, BL_ActionActuator, m_startframe), + KX_PYATTRIBUTE_FLOAT_RW("frameEnd", 0, MAXFRAMEF, BL_ActionActuator, m_endframe), + KX_PYATTRIBUTE_FLOAT_RW("blendIn", 0, MAXFRAMEF, BL_ActionActuator, m_blendin), KX_PYATTRIBUTE_RW_FUNCTION("action", BL_ActionActuator, pyattr_get_action, pyattr_set_action), KX_PYATTRIBUTE_SHORT_RW("priority", 0, 100, false, BL_ActionActuator, m_priority), KX_PYATTRIBUTE_FLOAT_RW_CHECK("frame", 0, MAXFRAMEF, BL_ActionActuator, m_localtime, CheckFrame), - KX_PYATTRIBUTE_STRING_RW("property", 0, 31, false, BL_ActionActuator, m_propname), - KX_PYATTRIBUTE_STRING_RW("frameProperty", 0, 31, false, BL_ActionActuator, m_framepropname), + KX_PYATTRIBUTE_STRING_RW("propName", 0, 31, false, BL_ActionActuator, m_propname), + KX_PYATTRIBUTE_STRING_RW("framePropName", 0, 31, false, BL_ActionActuator, m_framepropname), KX_PYATTRIBUTE_BOOL_RW("useContinue", BL_ActionActuator, m_end_reset), KX_PYATTRIBUTE_FLOAT_RW_CHECK("blendTime", 0, MAXFRAMEF, BL_ActionActuator, m_blendframe, CheckBlendTime), - KX_PYATTRIBUTE_SHORT_RW_CHECK("type",0,100,false,BL_ActionActuator,m_playtype,CheckType), + KX_PYATTRIBUTE_SHORT_RW_CHECK("mode",0,100,false,BL_ActionActuator,m_playtype,CheckType), { NULL } //Sentinel }; diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index 29bbe9b3d7d..a24d83da90c 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -467,16 +467,16 @@ PyMethodDef BL_ShapeActionActuator::Methods[] = { }; PyAttributeDef BL_ShapeActionActuator::Attributes[] = { - KX_PYATTRIBUTE_FLOAT_RW("start", 0, MAXFRAMEF, BL_ShapeActionActuator, m_startframe), - KX_PYATTRIBUTE_FLOAT_RW("end", 0, MAXFRAMEF, BL_ShapeActionActuator, m_endframe), - KX_PYATTRIBUTE_FLOAT_RW("blendin", 0, MAXFRAMEF, BL_ShapeActionActuator, m_blendin), + KX_PYATTRIBUTE_FLOAT_RW("frameStart", 0, MAXFRAMEF, BL_ShapeActionActuator, m_startframe), + KX_PYATTRIBUTE_FLOAT_RW("frameEnd", 0, MAXFRAMEF, BL_ShapeActionActuator, m_endframe), + KX_PYATTRIBUTE_FLOAT_RW("blendIn", 0, MAXFRAMEF, BL_ShapeActionActuator, m_blendin), KX_PYATTRIBUTE_RW_FUNCTION("action", BL_ShapeActionActuator, pyattr_get_action, pyattr_set_action), KX_PYATTRIBUTE_SHORT_RW("priority", 0, 100, false, BL_ShapeActionActuator, m_priority), KX_PYATTRIBUTE_FLOAT_RW_CHECK("frame", 0, MAXFRAMEF, BL_ShapeActionActuator, m_localtime, CheckFrame), - KX_PYATTRIBUTE_STRING_RW("property", 0, 31, false, BL_ShapeActionActuator, m_propname), - KX_PYATTRIBUTE_STRING_RW("frameProperty", 0, 31, false, BL_ShapeActionActuator, m_framepropname), + KX_PYATTRIBUTE_STRING_RW("propName", 0, 31, false, BL_ShapeActionActuator, m_propname), + KX_PYATTRIBUTE_STRING_RW("framePropName", 0, 31, false, BL_ShapeActionActuator, m_framepropname), KX_PYATTRIBUTE_FLOAT_RW_CHECK("blendTime", 0, MAXFRAMEF, BL_ShapeActionActuator, m_blendframe, CheckBlendTime), - KX_PYATTRIBUTE_SHORT_RW_CHECK("type",0,100,false,BL_ShapeActionActuator,m_playtype,CheckType), + KX_PYATTRIBUTE_SHORT_RW_CHECK("mode",0,100,false,BL_ShapeActionActuator,m_playtype,CheckType), { NULL } //Sentinel }; diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index 7682f6755ef..caed85b9938 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -149,8 +149,8 @@ PyMethodDef SCA_2DFilterActuator::Methods[] = { PyAttributeDef SCA_2DFilterActuator::Attributes[] = { KX_PYATTRIBUTE_STRING_RW("shaderText", 0, 64000, false, SCA_2DFilterActuator, m_shaderText), KX_PYATTRIBUTE_SHORT_RW("disableMotionBlur", 0, 1, true, SCA_2DFilterActuator, m_disableMotionBlur), - KX_PYATTRIBUTE_ENUM_RW("type",RAS_2DFilterManager::RAS_2DFILTER_ENABLED,RAS_2DFilterManager::RAS_2DFILTER_NUMBER_OF_FILTERS,false,SCA_2DFilterActuator,m_type), - KX_PYATTRIBUTE_INT_RW("passNb", 0, 100, true, SCA_2DFilterActuator, m_int_arg), + KX_PYATTRIBUTE_ENUM_RW("mode",RAS_2DFilterManager::RAS_2DFILTER_ENABLED,RAS_2DFilterManager::RAS_2DFILTER_NUMBER_OF_FILTERS,false,SCA_2DFilterActuator,m_type), + KX_PYATTRIBUTE_INT_RW("passNumber", 0, 100, true, SCA_2DFilterActuator, m_int_arg), KX_PYATTRIBUTE_FLOAT_RW("value", 0.0, 100.0, SCA_2DFilterActuator, m_float_arg), { NULL } //Sentinel }; diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index 33dc83506f3..4faa4b55d4a 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -270,9 +270,9 @@ PyMethodDef SCA_PropertyActuator::Methods[] = { }; PyAttributeDef SCA_PropertyActuator::Attributes[] = { - KX_PYATTRIBUTE_STRING_RW_CHECK("property",0,100,false,SCA_PropertyActuator,m_propname,CheckProperty), + KX_PYATTRIBUTE_STRING_RW_CHECK("propName",0,100,false,SCA_PropertyActuator,m_propname,CheckProperty), KX_PYATTRIBUTE_STRING_RW("value",0,100,false,SCA_PropertyActuator,m_exprtxt), - KX_PYATTRIBUTE_INT_RW("type", KX_ACT_PROP_NODEF+1, KX_ACT_PROP_MAX-1, false, SCA_PropertyActuator, m_type), /* ATTR_TODO add constents to game logic dict */ + KX_PYATTRIBUTE_INT_RW("mode", KX_ACT_PROP_NODEF+1, KX_ACT_PROP_MAX-1, false, SCA_PropertyActuator, m_type), /* ATTR_TODO add constents to game logic dict */ { NULL } //Sentinel }; @@ -296,7 +296,7 @@ const char SCA_PropertyActuator::SetProperty_doc[] = "\tof this name, the call is ignored.\n"; PyObject* SCA_PropertyActuator::PySetProperty(PyObject* args, PyObject* kwds) { - ShowDeprecationWarning("setProperty()", "the 'property' property"); + ShowDeprecationWarning("setProperty()", "the 'propName' property"); /* Check whether the name exists first ! */ char *nameArg; if (!PyArg_ParseTuple(args, "s:setProperty", &nameArg)) { @@ -321,7 +321,7 @@ const char SCA_PropertyActuator::GetProperty_doc[] = "\tReturn the property on which the actuator operates.\n"; PyObject* SCA_PropertyActuator::PyGetProperty(PyObject* args, PyObject* kwds) { - ShowDeprecationWarning("getProperty()", "the 'property' property"); + ShowDeprecationWarning("getProperty()", "the 'propName' property"); return PyString_FromString(m_propname); } diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index 2632cbd3dac..3b343af3cba 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -347,8 +347,8 @@ PyMethodDef SCA_PropertySensor::Methods[] = { }; PyAttributeDef SCA_PropertySensor::Attributes[] = { - KX_PYATTRIBUTE_INT_RW("type",KX_PROPSENSOR_NODEF,KX_PROPSENSOR_MAX-1,false,SCA_PropertySensor,m_checktype), - KX_PYATTRIBUTE_STRING_RW_CHECK("property",0,100,false,SCA_PropertySensor,m_checkpropname,CheckProperty), + KX_PYATTRIBUTE_INT_RW("mode",KX_PROPSENSOR_NODEF,KX_PROPSENSOR_MAX-1,false,SCA_PropertySensor,m_checktype), + KX_PYATTRIBUTE_STRING_RW_CHECK("propName",0,100,false,SCA_PropertySensor,m_checkpropname,CheckProperty), KX_PYATTRIBUTE_STRING_RW_CHECK("value",0,100,false,SCA_PropertySensor,m_checkpropval,validValueForProperty), { NULL } //Sentinel }; @@ -372,7 +372,7 @@ const char SCA_PropertySensor::GetType_doc[] = "\tReturns the type of check this sensor performs.\n"; PyObject* SCA_PropertySensor::PyGetType() { - ShowDeprecationWarning("getType()", "the type property"); + ShowDeprecationWarning("getType()", "the mode property"); return PyInt_FromLong(m_checktype); } @@ -385,7 +385,7 @@ const char SCA_PropertySensor::SetType_doc[] = "\tSet the type of check to perform.\n"; PyObject* SCA_PropertySensor::PySetType(PyObject* args) { - ShowDeprecationWarning("setType()", "the type property"); + ShowDeprecationWarning("setType()", "the mode property"); int typeArg; if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) { @@ -406,7 +406,7 @@ const char SCA_PropertySensor::GetProperty_doc[] = "\tReturn the property with which the sensor operates.\n"; PyObject* SCA_PropertySensor::PyGetProperty() { - ShowDeprecationWarning("getProperty()", "the 'property' property"); + ShowDeprecationWarning("getProperty()", "the 'propName' property"); return PyString_FromString(m_checkpropname); } @@ -418,7 +418,7 @@ const char SCA_PropertySensor::SetProperty_doc[] = "\tof this name, the call is ignored.\n"; PyObject* SCA_PropertySensor::PySetProperty(PyObject* args) { - ShowDeprecationWarning("setProperty()", "the 'property' property"); + ShowDeprecationWarning("setProperty()", "the 'propName' property"); /* We should query whether the name exists. Or should we create a prop */ /* on the fly? */ char *propNameArg = NULL; diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index 2db871c77cf..ff957d8350e 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -370,7 +370,7 @@ PyAttributeDef SCA_RandomActuator::Attributes[] = { KX_PYATTRIBUTE_FLOAT_RO("para1",SCA_RandomActuator,m_parameter1), KX_PYATTRIBUTE_FLOAT_RO("para2",SCA_RandomActuator,m_parameter2), KX_PYATTRIBUTE_ENUM_RO("distribution",SCA_RandomActuator,m_distribution), - KX_PYATTRIBUTE_STRING_RW_CHECK("property",0,100,false,SCA_RandomActuator,m_propname,CheckProperty), + KX_PYATTRIBUTE_STRING_RW_CHECK("propName",0,100,false,SCA_RandomActuator,m_propname,CheckProperty), KX_PYATTRIBUTE_RW_FUNCTION("seed",SCA_RandomActuator,pyattr_get_seed,pyattr_set_seed), { NULL } //Sentinel }; @@ -477,7 +477,7 @@ const char SCA_RandomActuator::SetProperty_doc[] = "\tSet the property to which the random value is assigned. If the \n" "\tgenerator and property types do not match, the assignment is ignored.\n"; PyObject* SCA_RandomActuator::PySetProperty(PyObject* args) { - ShowDeprecationWarning("setProperty()", "the 'property' property"); + ShowDeprecationWarning("setProperty()", "the 'propName' property"); char *nameArg; if (!PyArg_ParseTuple(args, "s:setProperty", &nameArg)) { return NULL; @@ -501,7 +501,7 @@ const char SCA_RandomActuator::GetProperty_doc[] = "\tgenerator and property types do not match, the assignment is ignored.\n"; PyObject* SCA_RandomActuator::PyGetProperty() { - ShowDeprecationWarning("getProperty()", "the 'property' property"); + ShowDeprecationWarning("getProperty()", "the 'propName' property"); return PyString_FromString(m_propname); } diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index 5f7197e31f1..b87d0ee4283 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -419,7 +419,7 @@ PyAttributeDef KX_CameraActuator::Attributes[] = { KX_PYATTRIBUTE_FLOAT_RW("min",-MAXFLOAT,MAXFLOAT,KX_CameraActuator,m_minHeight), KX_PYATTRIBUTE_FLOAT_RW("max",-MAXFLOAT,MAXFLOAT,KX_CameraActuator,m_maxHeight), KX_PYATTRIBUTE_FLOAT_RW("height",-MAXFLOAT,MAXFLOAT,KX_CameraActuator,m_height), - KX_PYATTRIBUTE_BOOL_RW("xy",KX_CameraActuator,m_x), + KX_PYATTRIBUTE_BOOL_RW("useXY",KX_CameraActuator,m_x), KX_PYATTRIBUTE_RW_FUNCTION("object", KX_CameraActuator, pyattr_get_object, pyattr_set_object), {NULL} }; @@ -561,7 +561,7 @@ const char KX_CameraActuator::SetXY_doc[] = "\t1=x, 0=y\n"; PyObject* KX_CameraActuator::PySetXY(PyObject* args) { - ShowDeprecationWarning("setXY()", "the xy property"); + ShowDeprecationWarning("setXY()", "the useXY property"); int value; if(PyArg_ParseTuple(args,"i:setXY", &value)) { diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index c9cb8e1b942..6f66faaeafb 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -631,7 +631,7 @@ PyAttributeDef KX_ConstraintActuator::Attributes[] = { KX_PYATTRIBUTE_FLOAT_ARRAY_RW_CHECK("direction",-MAXFLOAT,MAXFLOAT,KX_ConstraintActuator,m_refDirection,3,pyattr_check_direction), KX_PYATTRIBUTE_INT_RW("option",0,0xFFFF,false,KX_ConstraintActuator,m_option), KX_PYATTRIBUTE_INT_RW("time",0,1000,true,KX_ConstraintActuator,m_activeTime), - KX_PYATTRIBUTE_STRING_RW("property",0,32,true,KX_ConstraintActuator,m_property), + KX_PYATTRIBUTE_STRING_RW("propName",0,32,true,KX_ConstraintActuator,m_property), KX_PYATTRIBUTE_FLOAT_RW("min",-MAXFLOAT,MAXFLOAT,KX_ConstraintActuator,m_minimumBound), KX_PYATTRIBUTE_FLOAT_RW("distance",-MAXFLOAT,MAXFLOAT,KX_ConstraintActuator,m_minimumBound), KX_PYATTRIBUTE_FLOAT_RW("max",-MAXFLOAT,MAXFLOAT,KX_ConstraintActuator,m_maximumBound), diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index 9588e14d360..7c18b03906e 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -252,7 +252,7 @@ PyMethodDef KX_GameActuator::Methods[] = }; PyAttributeDef KX_GameActuator::Attributes[] = { - KX_PYATTRIBUTE_STRING_RW("file",0,100,false,KX_GameActuator,m_filename), + KX_PYATTRIBUTE_STRING_RW("fileName",0,100,false,KX_GameActuator,m_filename), KX_PYATTRIBUTE_INT_RW("mode", KX_GAME_NODEF+1, KX_GAME_MAX-1, true, KX_GameActuator, m_mode), { NULL } //Sentinel }; @@ -279,7 +279,7 @@ const char KX_GameActuator::GetFile_doc[] = "get the name of the file to start.\n"; PyObject* KX_GameActuator::PyGetFile(PyObject* args, PyObject* kwds) { - ShowDeprecationWarning("getFile()", "the file property"); + ShowDeprecationWarning("getFile()", "the fileName property"); return PyString_FromString(m_filename); } @@ -291,7 +291,7 @@ PyObject* KX_GameActuator::PySetFile(PyObject* args, PyObject* kwds) { char* new_file; - ShowDeprecationWarning("setFile()", "the file property"); + ShowDeprecationWarning("setFile()", "the fileName property"); if (!PyArg_ParseTuple(args, "s:setFile", &new_file)) { diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index fe9fb8bb583..9196d1e0527 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1197,8 +1197,8 @@ PyAttributeDef KX_GameObject::Attributes[] = { KX_PYATTRIBUTE_RW_FUNCTION("worldOrientation",KX_GameObject,pyattr_get_worldOrientation,pyattr_set_worldOrientation), KX_PYATTRIBUTE_RW_FUNCTION("localPosition", KX_GameObject, pyattr_get_localPosition, pyattr_set_localPosition), KX_PYATTRIBUTE_RW_FUNCTION("worldPosition", KX_GameObject, pyattr_get_worldPosition, pyattr_set_worldPosition), - KX_PYATTRIBUTE_RW_FUNCTION("localScaling", KX_GameObject, pyattr_get_localScaling, pyattr_set_localScaling), - KX_PYATTRIBUTE_RO_FUNCTION("worldScaling", KX_GameObject, pyattr_get_worldScaling), + KX_PYATTRIBUTE_RW_FUNCTION("localScale", KX_GameObject, pyattr_get_localScaling, pyattr_set_localScaling), + KX_PYATTRIBUTE_RO_FUNCTION("worldScale", KX_GameObject, pyattr_get_worldScaling), KX_PYATTRIBUTE_RO_FUNCTION("attrDict", KX_GameObject, pyattr_get_attrDict), /* Experemental, dont rely on these yet */ diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index 5e1785e9c21..3ec0598ac03 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -445,9 +445,8 @@ PyParentObject KX_IpoActuator::Parents[] = { }; PyMethodDef KX_IpoActuator::Methods[] = { - {"set", (PyCFunction) KX_IpoActuator::sPySet, METH_VARARGS, (PY_METHODCHAR)Set_doc}, - // deprecated + {"set", (PyCFunction) KX_IpoActuator::sPySet, METH_VARARGS, (PY_METHODCHAR)Set_doc}, {"setProperty", (PyCFunction) KX_IpoActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc}, {"setStart", (PyCFunction) KX_IpoActuator::sPySetStart, METH_VARARGS, (PY_METHODCHAR)SetStart_doc}, {"getStart", (PyCFunction) KX_IpoActuator::sPyGetStart, METH_NOARGS, (PY_METHODCHAR)GetStart_doc}, @@ -465,11 +464,11 @@ PyMethodDef KX_IpoActuator::Methods[] = { }; PyAttributeDef KX_IpoActuator::Attributes[] = { - KX_PYATTRIBUTE_FLOAT_RW("startFrame", 0, 300000, KX_IpoActuator, m_startframe), - KX_PYATTRIBUTE_FLOAT_RW("endFrame", 0, 300000, KX_IpoActuator, m_endframe), + KX_PYATTRIBUTE_FLOAT_RW("frameStart", 0, 300000, KX_IpoActuator, m_startframe), + KX_PYATTRIBUTE_FLOAT_RW("frameEnd", 0, 300000, KX_IpoActuator, m_endframe), KX_PYATTRIBUTE_STRING_RW("propName", 0, 64, false, KX_IpoActuator, m_propname), KX_PYATTRIBUTE_STRING_RW("framePropName", 0, 64, false, KX_IpoActuator, m_framepropname), - KX_PYATTRIBUTE_INT_RW("type", KX_ACT_IPO_NODEF+1, KX_ACT_IPO_MAX-1, true, KX_IpoActuator, m_type), + KX_PYATTRIBUTE_INT_RW("mode", KX_ACT_IPO_NODEF+1, KX_ACT_IPO_MAX-1, true, KX_IpoActuator, m_type), KX_PYATTRIBUTE_BOOL_RW("useIpoAsForce", KX_IpoActuator, m_ipo_as_force), KX_PYATTRIBUTE_BOOL_RW("useIpoAdd", KX_IpoActuator, m_ipo_add), KX_PYATTRIBUTE_BOOL_RW("useIpoLocal", KX_IpoActuator, m_ipo_local), @@ -501,7 +500,7 @@ const char KX_IpoActuator::Set_doc[] = "\tSet the properties of the actuator.\n"; PyObject* KX_IpoActuator::PySet(PyObject* args) { - ShowDeprecationWarning("set()", "a number properties"); + ShowDeprecationWarning("set()", "a range properties"); /* sets modes PLAY, PINGPONG, FLIPPER, LOOPSTOP, LOOPEND */ /* arg 1 = mode string, arg 2 = startframe, arg3 = stopframe, */ @@ -563,7 +562,7 @@ const char KX_IpoActuator::SetStart_doc[] = "\tSet the frame from which the ipo starts playing.\n"; PyObject* KX_IpoActuator::PySetStart(PyObject* args) { - ShowDeprecationWarning("setStart()", "the startFrame property"); + ShowDeprecationWarning("setStart()", "the frameStart property"); float startArg; if(!PyArg_ParseTuple(args, "f:setStart", &startArg)) { @@ -579,7 +578,7 @@ const char KX_IpoActuator::GetStart_doc[] = "getStart()\n" "\tReturns the frame from which the ipo starts playing.\n"; PyObject* KX_IpoActuator::PyGetStart() { - ShowDeprecationWarning("getStart()", "the startFrame property"); + ShowDeprecationWarning("getStart()", "the frameStart property"); return PyFloat_FromDouble(m_startframe); } @@ -589,7 +588,7 @@ const char KX_IpoActuator::SetEnd_doc[] = "\t - frame: last frame to use (int)\n" "\tSet the frame at which the ipo stops playing.\n"; PyObject* KX_IpoActuator::PySetEnd(PyObject* args) { - ShowDeprecationWarning("setEnd()", "the endFrame property"); + ShowDeprecationWarning("setEnd()", "the frameEnd property"); float endArg; if(!PyArg_ParseTuple(args, "f:setEnd", &endArg)) { return NULL; @@ -604,7 +603,7 @@ const char KX_IpoActuator::GetEnd_doc[] = "getEnd()\n" "\tReturns the frame at which the ipo stops playing.\n"; PyObject* KX_IpoActuator::PyGetEnd() { - ShowDeprecationWarning("getEnd()", "the endFrame property"); + ShowDeprecationWarning("getEnd()", "the frameEnd property"); return PyFloat_FromDouble(m_endframe); } @@ -670,7 +669,7 @@ const char KX_IpoActuator::SetType_doc[] = "\t - mode: Play, PingPong, Flipper, LoopStop, LoopEnd or FromProp (string)\n" "\tSet the operation mode of the actuator.\n"; PyObject* KX_IpoActuator::PySetType(PyObject* args) { - ShowDeprecationWarning("setType()", "the type property"); + ShowDeprecationWarning("setType()", "the mode property"); int typeArg; if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) { @@ -689,7 +688,7 @@ const char KX_IpoActuator::GetType_doc[] = "getType()\n" "\tReturns the operation mode of the actuator.\n"; PyObject* KX_IpoActuator::PyGetType() { - ShowDeprecationWarning("getType()", "the type property"); + ShowDeprecationWarning("getType()", "the mode property"); return PyInt_FromLong(m_type); } diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index fdde5fdcf7b..78a61e9d95e 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -366,7 +366,7 @@ PyAttributeDef KX_RaySensor::Attributes[] = { KX_PYATTRIBUTE_BOOL_RW("useMaterial", KX_RaySensor, m_bFindMaterial), KX_PYATTRIBUTE_BOOL_RW("useXRay", KX_RaySensor, m_bXRay), KX_PYATTRIBUTE_FLOAT_RW("range", 0, 10000, KX_RaySensor, m_distance), - KX_PYATTRIBUTE_STRING_RW("property", 0, 100, false, KX_RaySensor, m_propertyname), + KX_PYATTRIBUTE_STRING_RW("propName", 0, 100, false, KX_RaySensor, m_propertyname), KX_PYATTRIBUTE_INT_RW("axis", 0, 5, true, KX_RaySensor, m_axis), KX_PYATTRIBUTE_FLOAT_ARRAY_RO("hitPosition", KX_RaySensor, m_hitPosition, 3), KX_PYATTRIBUTE_FLOAT_ARRAY_RO("rayDirection", KX_RaySensor, m_rayDirection, 3), diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp index af5631b4403..3d3bc1265a0 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp @@ -91,7 +91,7 @@ PyMethodDef KX_SCA_DynamicActuator::Methods[] = { }; PyAttributeDef KX_SCA_DynamicActuator::Attributes[] = { - KX_PYATTRIBUTE_SHORT_RW("operation",0,4,false,KX_SCA_DynamicActuator,m_dyn_operation), + KX_PYATTRIBUTE_SHORT_RW("mode",0,4,false,KX_SCA_DynamicActuator,m_dyn_operation), KX_PYATTRIBUTE_FLOAT_RW("mass",0.0,MAXFLOAT,KX_SCA_DynamicActuator,m_setmass), { NULL } //Sentinel }; @@ -122,7 +122,7 @@ KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, setOperation, "\t 3 = disable rigid body\n" "Change the dynamic status of the parent object.\n") { - ShowDeprecationWarning("setOperation()", "the operation property"); + ShowDeprecationWarning("setOperation()", "the mode property"); int dyn_operation; if (!PyArg_ParseTuple(args, "i:setOperation", &dyn_operation)) @@ -142,7 +142,7 @@ KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, getOperation, "Returns the operation type of this actuator.\n" ) { - ShowDeprecationWarning("getOperation()", "the operation property"); + ShowDeprecationWarning("getOperation()", "the mode property"); return PyInt_FromLong((long)m_dyn_operation); } diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index e3622c211ff..9502599603c 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1720,7 +1720,7 @@ int KX_Scene::pyattr_set_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *a PyAttributeDef KX_Scene::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("name", KX_Scene, pyattr_get_name), KX_PYATTRIBUTE_RO_FUNCTION("objects", KX_Scene, pyattr_get_objects), - KX_PYATTRIBUTE_RO_FUNCTION("objects_inactive", KX_Scene, pyattr_get_objects_inactive), KX_PYATTRIBUTE_RO_FUNCTION("lights", KX_Scene, pyattr_get_lights), + KX_PYATTRIBUTE_RO_FUNCTION("objectsInactive", KX_Scene, pyattr_get_objects_inactive), KX_PYATTRIBUTE_RO_FUNCTION("lights", KX_Scene, pyattr_get_lights), KX_PYATTRIBUTE_RO_FUNCTION("cameras", KX_Scene, pyattr_get_cameras), KX_PYATTRIBUTE_RO_FUNCTION("lights", KX_Scene, pyattr_get_lights), KX_PYATTRIBUTE_RW_FUNCTION("active_camera", KX_Scene, pyattr_get_active_camera, pyattr_set_active_camera), diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index 07a880c950b..3a341f007e4 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -295,7 +295,7 @@ PyMethodDef KX_SoundActuator::Methods[] = { }; PyAttributeDef KX_SoundActuator::Attributes[] = { - KX_PYATTRIBUTE_RW_FUNCTION("filename", KX_SoundActuator, pyattr_get_filename, pyattr_set_filename), + KX_PYATTRIBUTE_RW_FUNCTION("fileName", KX_SoundActuator, pyattr_get_filename, pyattr_set_filename), KX_PYATTRIBUTE_RW_FUNCTION("volume", KX_SoundActuator, pyattr_get_gain, pyattr_set_gain), KX_PYATTRIBUTE_RW_FUNCTION("pitch", KX_SoundActuator, pyattr_get_pitch, pyattr_set_pitch), KX_PYATTRIBUTE_RW_FUNCTION("rollOffFactor", KX_SoundActuator, pyattr_get_rollOffFactor, pyattr_set_rollOffFactor), @@ -303,7 +303,7 @@ PyAttributeDef KX_SoundActuator::Attributes[] = { KX_PYATTRIBUTE_RW_FUNCTION("position", KX_SoundActuator, pyattr_get_position, pyattr_set_position), KX_PYATTRIBUTE_RW_FUNCTION("velocity", KX_SoundActuator, pyattr_get_velocity, pyattr_set_velocity), KX_PYATTRIBUTE_RW_FUNCTION("orientation", KX_SoundActuator, pyattr_get_orientation, pyattr_set_orientation), - KX_PYATTRIBUTE_ENUM_RW("type",KX_SoundActuator::KX_SOUNDACT_NODEF+1,KX_SoundActuator::KX_SOUNDACT_MAX-1,false,KX_SoundActuator,m_type), + KX_PYATTRIBUTE_ENUM_RW("mode",KX_SoundActuator::KX_SOUNDACT_NODEF+1,KX_SoundActuator::KX_SOUNDACT_MAX-1,false,KX_SoundActuator,m_type), { NULL } //Sentinel }; @@ -364,7 +364,7 @@ PyObject* KX_SoundActuator::pyattr_get_filename(void *self, const struct KX_PYAT char* name = objectname.Ptr(); if (!name) { - PyErr_SetString(PyExc_RuntimeError, "value = actuator.filename: KX_SoundActuator, unable to get sound filename"); + PyErr_SetString(PyExc_RuntimeError, "value = actuator.fileName: KX_SoundActuator, unable to get sound fileName"); return NULL; } else return PyString_FromString(name); @@ -565,7 +565,7 @@ int KX_SoundActuator::pyattr_set_orientation(void *self, const struct KX_PYATTRI PyObject* KX_SoundActuator::PySetFilename(PyObject* args) { char *soundName = NULL; - ShowDeprecationWarning("setFilename()", "the filename property"); + ShowDeprecationWarning("setFilename()", "the fileName property"); // void *soundPointer = NULL; /*unused*/ if (!PyArg_ParseTuple(args, "s", &soundName)) @@ -576,7 +576,7 @@ PyObject* KX_SoundActuator::PySetFilename(PyObject* args) PyObject* KX_SoundActuator::PyGetFilename() { - ShowDeprecationWarning("getFilename()", "the filename property"); + ShowDeprecationWarning("getFilename()", "the fileName property"); if (!m_soundObject) { return PyString_FromString(""); @@ -585,7 +585,7 @@ PyObject* KX_SoundActuator::PyGetFilename() char* name = objectname.Ptr(); if (!name) { - PyErr_SetString(PyExc_RuntimeError, "Unable to get sound filename"); + PyErr_SetString(PyExc_RuntimeError, "Unable to get sound fileName"); return NULL; } else return PyString_FromString(name); @@ -759,7 +759,7 @@ PyObject* KX_SoundActuator::PySetOrientation(PyObject* args) PyObject* KX_SoundActuator::PySetType(PyObject* args) { int typeArg; - ShowDeprecationWarning("setType()", "the type property"); + ShowDeprecationWarning("setType()", "the mode property"); if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) { return NULL; @@ -775,7 +775,7 @@ PyObject* KX_SoundActuator::PySetType(PyObject* args) PyObject* KX_SoundActuator::PyGetType() { - ShowDeprecationWarning("getType()", "the type property"); + ShowDeprecationWarning("getType()", "the mode property"); return PyInt_FromLong(m_type); } // <----- diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 2c02d949c63..8c0d5596939 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -292,11 +292,11 @@ PyMethodDef KX_TouchSensor::Methods[] = { }; PyAttributeDef KX_TouchSensor::Attributes[] = { - KX_PYATTRIBUTE_STRING_RW("property",0,100,false,KX_TouchSensor,m_touchedpropname), + KX_PYATTRIBUTE_STRING_RW("propName",0,100,false,KX_TouchSensor,m_touchedpropname), KX_PYATTRIBUTE_BOOL_RW("useMaterial",KX_TouchSensor,m_bFindMaterial), - KX_PYATTRIBUTE_BOOL_RW("pulseCollisions",KX_TouchSensor,m_bTouchPulse), - KX_PYATTRIBUTE_RO_FUNCTION("objectHit", KX_TouchSensor, pyattr_get_object_hit), - KX_PYATTRIBUTE_RO_FUNCTION("objectHitList", KX_TouchSensor, pyattr_get_object_hit_list), + KX_PYATTRIBUTE_BOOL_RW("usePulseCollision",KX_TouchSensor,m_bTouchPulse), + KX_PYATTRIBUTE_RO_FUNCTION("hitObject", KX_TouchSensor, pyattr_get_object_hit), + KX_PYATTRIBUTE_RO_FUNCTION("hitObjectList", KX_TouchSensor, pyattr_get_object_hit_list), { NULL } //Sentinel }; @@ -325,7 +325,7 @@ const char KX_TouchSensor::SetProperty_doc[] = "\tmaterials."; PyObject* KX_TouchSensor::PySetProperty(PyObject* value) { - ShowDeprecationWarning("setProperty()", "the propertyName property"); + ShowDeprecationWarning("setProperty()", "the propName property"); char *nameArg= PyString_AsString(value); if (nameArg==NULL) { PyErr_SetString(PyExc_ValueError, "expected a "); @@ -342,6 +342,8 @@ const char KX_TouchSensor::GetProperty_doc[] = "\tgetTouchMaterial() to find out whether this sensor\n" "\tlooks for properties or materials."; PyObject* KX_TouchSensor::PyGetProperty() { + ShowDeprecationWarning("getProperty()", "the propName property"); + return PyString_FromString(m_touchedpropname); } @@ -350,7 +352,7 @@ const char KX_TouchSensor::GetHitObject_doc[] = ; PyObject* KX_TouchSensor::PyGetHitObject() { - ShowDeprecationWarning("getHitObject()", "the objectHit property"); + ShowDeprecationWarning("getHitObject()", "the hitObject property"); /* to do: do Py_IncRef if the object is already known in Python */ /* otherwise, this leaks memory */ if (m_hitObject) @@ -366,7 +368,7 @@ const char KX_TouchSensor::GetHitObjectList_doc[] = "\tbut only those matching the property/material condition.\n"; PyObject* KX_TouchSensor::PyGetHitObjectList() { - ShowDeprecationWarning("getHitObjectList()", "the objectHitList property"); + ShowDeprecationWarning("getHitObjectList()", "the hitObjectList property"); /* to do: do Py_IncRef if the object is already known in Python */ /* otherwise, this leaks memory */ /* Edit, this seems ok and not to leak memory - Campbell */ return m_colliders->GetProxy(); diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp index 46a1db9378a..d848065ad73 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp @@ -136,8 +136,8 @@ KX_VisibilityActuator::Methods[] = { PyAttributeDef KX_VisibilityActuator::Attributes[] = { KX_PYATTRIBUTE_BOOL_RW("visibility", KX_VisibilityActuator, m_visible), - KX_PYATTRIBUTE_BOOL_RW("occlusion", KX_VisibilityActuator, m_occlusion), - KX_PYATTRIBUTE_BOOL_RW("recursion", KX_VisibilityActuator, m_recursive), + KX_PYATTRIBUTE_BOOL_RW("useOcclusion", KX_VisibilityActuator, m_occlusion), + KX_PYATTRIBUTE_BOOL_RW("useRecursion", KX_VisibilityActuator, m_recursive), { NULL } //Sentinel }; diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 9b87842f7e0..28fd95611bc 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -318,6 +318,8 @@ Documentation for the GameLogic Module. @group Deprecated: addActiveActuator """ +import GameTypes + # TODO # globalDict # error @@ -346,7 +348,7 @@ def addActiveActuator(actuator, activate): """ Activates the given actuator. - @deprecated: Use L{SCA_PythonController.activate} and L{SCA_PythonController.deactivate} instead. + @deprecated: Use L{GameTypes.SCA_PythonController.activate} and L{GameTypes.SCA_PythonController.deactivate} instead. @type actuator: L{SCA_IActuator} or the actuator name as a string. @type activate: boolean @param activate: whether to activate or deactivate the given actuator. diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index 0240efa4eab..d58f9087a9f 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -70,10 +70,9 @@ class SCA_ILogicBrick(CValue): @type owner: L{KX_GameObject} or None in exceptional cases. @ivar name: The name of this logic brick (read-only). @type name: string - @group Deprecated: getOwner, setExecutePriority, getExecutePriority """ - - #--The following methods are deprecated-- + +#{ Deprecated def getOwner(): """ Gets the game object associated with this logic brick. @@ -101,7 +100,7 @@ class SCA_ILogicBrick(CValue): @rtype: integer @return: this logic bricks current priority. """ - +#} class SCA_IObject(CValue): """ @@ -137,7 +136,6 @@ class SCA_ISensor(SCA_ILogicBrick): @type triggered: boolean @ivar positive: True if this sensor brick is in a positive state. (read-only) @type positive: boolean - @group Deprecated: isPositive, isTriggered, getUsePosPulseMode, setUsePosPulseMode, getFrequency, setFrequency, getUseNegPulseMode, setUseNegPulseMode, getInvert, setInvert, getLevel, setLevel """ def reset(): @@ -146,8 +144,7 @@ class SCA_ISensor(SCA_ILogicBrick): The sensor is put in its initial state as if it was just activated. """ - - #--The following methods are deprecated-- +#{ Deprecated def isPositive(): """ True if this sensor brick is in a positive state. @@ -223,6 +220,7 @@ class SCA_ISensor(SCA_ILogicBrick): @param level: Detect level instead of edge? (KX_TRUE, KX_FALSE) @type level: boolean """ +#} class SCA_IController(SCA_ILogicBrick): """ @@ -239,10 +237,8 @@ class SCA_IController(SCA_ILogicBrick): - note: the sensors are not necessarily owned by the same object. - note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup. @type actuators: sequence supporting index/string lookups and iteration. - - @group Deprecated: getState, getSensors, getActuators, getSensor, getActuator """ - +#{ Deprecated def getState(): """ Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active. @@ -277,6 +273,7 @@ class SCA_IController(SCA_ILogicBrick): @type name: string @rtype: L{SCA_IActuator} """ +#} class SCA_IActuator(SCA_ILogicBrick): """ @@ -289,31 +286,31 @@ class BL_ActionActuator(SCA_IActuator): @ivar action: The name of the action to set as the current action. @type action: string - @ivar start: Specifies the starting frame of the animation. - @type start: float - @ivar end: Specifies the ending frame of the animation. - @type end: float - @ivar blendin: Specifies the number of frames of animation to generate when making transitions between actions. - @type blendin: float + @ivar frameStart: Specifies the starting frame of the animation. + @type frameStart: float + @ivar frameEnd: Specifies the ending frame of the animation. + @type frameEnd: float + @ivar blendIn: Specifies the number of frames of animation to generate when making transitions between actions. + @type blendIn: float @ivar priority: Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers. @type priority: integer @ivar frame: Sets the current frame for the animation. @type frame: float - @ivar property: Sets the property to be used in FromProp playback mode. - @type property: string + @ivar propName: Sets the property to be used in FromProp playback mode. + @type propName: string @ivar blendTime: Sets the internal frame timer. This property must be in - the range from 0.0 to blendin. + the range from 0.0 to blendIn. @type blendTime: float - @ivar type: The operation mode of the actuator. KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND - @type type: integer + @ivar mode: The operation mode of the actuator. KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND + @type mode: integer @ivar useContinue: The actions continue option, True or False. When True, the action will always play from where last left off, otherwise negative events to this actuator will reset it to its start frame. @type: boolean - @ivar frameProperty: The name of the property that is set to the current frame number. - @type frameProperty: string + @ivar framePropName: The name of the property that is set to the current frame number. + @type framePropName: string """ def setChannel(channel, matrix, mode = False): """ @@ -326,7 +323,7 @@ class BL_ActionActuator(SCA_IActuator): @type mode: boolean """ - #--The following methods are deprecated-- +#{ Deprecated def setAction(action, reset = True): """ Sets the current action. @@ -343,7 +340,7 @@ class BL_ActionActuator(SCA_IActuator): def setStart(start): """ Specifies the starting frame of the animation. - @deprecated: Use the L{start} property + @deprecated: Use the L{frameStart} property @param start: the starting frame of the animation @type start: float """ @@ -351,7 +348,7 @@ class BL_ActionActuator(SCA_IActuator): def setEnd(end): """ Specifies the ending frame of the animation. - @deprecated: use the L{end} property + @deprecated: use the L{frameEnd} property @param end: the ending frame of the animation @type end: float """ @@ -359,7 +356,7 @@ class BL_ActionActuator(SCA_IActuator): """ Specifies the number of frames of animation to generate when making transitions between actions. - @deprecated: use the L{blendin} property + @deprecated: use the L{blendIn} property @param blendin: the number of frames in transition. @type blendin: float """ @@ -417,7 +414,7 @@ class BL_ActionActuator(SCA_IActuator): """ Set the actions continue option True or False. see getContinue. - @deprecated: use the L{continue} property + @deprecated: use the L{useContinue} property @param cont: The continue option. @type cont: bool """ @@ -451,21 +448,21 @@ class BL_ActionActuator(SCA_IActuator): """ Returns the starting frame of the action. - @deprecated: use the L{start} property + @deprecated: use the L{frameStart} property @rtype: float """ def getEnd(): """ Returns the last frame of the action. - @deprecated: use the L{end} property + @deprecated: use the L{frameEnd} property @rtype: float """ def getBlendin(): """ Returns the number of interpolation animation frames to be generated when this actuator is triggered. - @deprecated: use the L{blendin} property + @deprecated: use the L{blendIn} property @rtype: float """ def getPriority(): @@ -492,7 +489,7 @@ class BL_ActionActuator(SCA_IActuator): """ def setFrameProperty(prop): """ - @deprecated: use the L{frameProperty} property + @deprecated: use the L{framePropName} property @param prop: A string specifying the property of the object that will be updated with the action frame number. @type prop: string """ @@ -500,9 +497,10 @@ class BL_ActionActuator(SCA_IActuator): """ Returns the name of the property that is set to the current frame number. - @deprecated: use the L{frameProperty} property + @deprecated: use the L{framePropName} property @rtype: string """ +#} class BL_Shader(PyObjectPlus): """ @@ -755,31 +753,32 @@ class BL_ShapeActionActuator(SCA_IActuator): @ivar action: The name of the action to set as the current shape action. @type action: string - @ivar start: Specifies the starting frame of the shape animation. - @type start: float - @ivar end: Specifies the ending frame of the shape animation. - @type end: float - @ivar blendin: Specifies the number of frames of animation to generate when making transitions between actions. - @type blendin: float + @ivar frameStart: Specifies the starting frame of the shape animation. + @type frameStart: float + @ivar frameEnd: Specifies the ending frame of the shape animation. + @type frameEnd: float + @ivar blendIn: Specifies the number of frames of animation to generate when making transitions between actions. + @type blendIn: float @ivar priority: Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers. @type priority: integer @ivar frame: Sets the current frame for the animation. @type frame: float - @ivar property: Sets the property to be used in FromProp playback mode. - @type property: string + @ivar propName: Sets the property to be used in FromProp playback mode. + @type propName: string @ivar blendTime: Sets the internal frame timer. This property must be in the range from 0.0 to blendin. @type blendTime: float - @ivar type: The operation mode of the actuator. + @ivar mode: The operation mode of the actuator. KX_ACTIONACT_PLAY, KX_ACTIONACT_PROPERTY, KX_ACTIONACT_FLIPPER, KX_ACTIONACT_LOOPSTOP, KX_ACTIONACT_LOOPEND - @type type: integer - @ivar frameProperty: The name of the property that is set to the current frame number. - @type frameProperty: string + @type mode: integer + @ivar framePropName: The name of the property that is set to the current frame number. + @type framePropName: string """ +#{ Deprecated def setAction(action, reset = True): """ Sets the current action. @@ -798,7 +797,7 @@ class BL_ShapeActionActuator(SCA_IActuator): """ Specifies the starting frame of the animation. - @deprecated: use the L{start} property + @deprecated: use the L{frameStart} property @param start: the starting frame of the animation @type start: float """ @@ -807,7 +806,7 @@ class BL_ShapeActionActuator(SCA_IActuator): """ Specifies the ending frame of the animation. - @deprecated: use the L{end} property + @deprecated: use the L{frameEnd} property @param end: the ending frame of the animation @type end: float """ @@ -816,7 +815,7 @@ class BL_ShapeActionActuator(SCA_IActuator): Specifies the number of frames of animation to generate when making transitions between actions. - @deprecated: use the L{blendin} property + @deprecated: use the L{blendIn} property @param blendin: the number of frames in transition. @type blendin: float """ @@ -891,21 +890,21 @@ class BL_ShapeActionActuator(SCA_IActuator): """ Returns the starting frame of the action. - @deprecated: use the L{start} property + @deprecated: use the L{frameStart} property @rtype: float """ def getEnd(): """ Returns the last frame of the action. - @deprecated: use the L{end} property + @deprecated: use the L{frameEnd} property @rtype: float """ def getBlendin(): """ Returns the number of interpolation animation frames to be generated when this actuator is triggered. - @deprecated: use the L{blendin} property + @deprecated: use the L{blendIn} property @rtype: float """ def getPriority(): @@ -932,7 +931,7 @@ class BL_ShapeActionActuator(SCA_IActuator): """ def setFrameProperty(prop): """ - @deprecated: use the L{frameProperty} property + @deprecated: use the L{framePropName} property @param prop: A string specifying the property of the object that will be updated with the action frame number. @type prop: string """ @@ -940,9 +939,10 @@ class BL_ShapeActionActuator(SCA_IActuator): """ Returns the name of the property that is set to the current frame number. - @deprecated: use the L{frameProperty} property + @deprecated: use the L{framePropName} property @rtype: string """ +#} class CListValue(CPropValue): """ @@ -1002,7 +1002,7 @@ class CListValue(CPropValue): This has the advantage that you can store the id in places you could not store a gameObject. Warning: the id is derived from a memory location and will be different each time the game engine starts. - """# + """ class KX_BlenderMaterial(PyObjectPlus): # , RAS_IPolyMaterial) """ @@ -1023,7 +1023,7 @@ class KX_BlenderMaterial(PyObjectPlus): # , RAS_IPolyMaterial) Set the pixel color arithmetic functions. @param src: Specifies how the red, green, blue, - and alpha source blending factors are computed. + and alpha source blending factors are computed. @type src: GL_ZERO, GL_ONE, GL_SRC_COLOR, @@ -1094,6 +1094,7 @@ class KX_CDActuator(SCA_IActuator): """ Plays the track selected. """ +#{ Deprecated def setGain(gain): """ Sets the gain (volume) of the CD. @@ -1110,6 +1111,7 @@ class KX_CDActuator(SCA_IActuator): @rtype: float @return: Between 0.0 (silent) and 1.0 (max volume) """ +#} class KX_CameraActuator(SCA_IActuator): """ @@ -1121,16 +1123,18 @@ class KX_CameraActuator(SCA_IActuator): @type max: float @ivar height: height to stay above the target object @type height: float - @ivar xy: axis this actuator is tracking, true=X, false=Y - @type xy: boolean + @ivar useXY: axis this actuator is tracking, true=X, false=Y + @type useXY: boolean @ivar object: the object this actuator tracks. @type object: KX_GameObject or None @author: snail """ +#{ Deprecated def getObject(name_only = 1): """ Returns the name of the object this actuator tracks. + @deprecated: Use the L{object} attribute instead. @type name_only: bool @param name_only: optional argument, when 0 return a KX_GameObject @rtype: string, KX_GameObject or None if no object is set @@ -1140,6 +1144,7 @@ class KX_CameraActuator(SCA_IActuator): """ Sets the object this actuator tracks. + @deprecated: Use the L{object} attribute instead. @param target: the object to track. @type target: L{KX_GameObject}, string or None """ @@ -1148,6 +1153,7 @@ class KX_CameraActuator(SCA_IActuator): """ Returns the minimum distance to target maintained by the actuator. + @deprecated: Use the L{min} attribute instead. @rtype: float """ @@ -1156,6 +1162,7 @@ class KX_CameraActuator(SCA_IActuator): Sets the minimum distance to the target object maintained by the actuator. + @deprecated: Use the L{min} attribute instead. @param distance: The minimum distance to maintain. @type distance: float """ @@ -1164,6 +1171,7 @@ class KX_CameraActuator(SCA_IActuator): """ Gets the maximum distance to stay from the target object. + @deprecated: Use the L{max} attribute instead. @rtype: float """ @@ -1171,6 +1179,7 @@ class KX_CameraActuator(SCA_IActuator): """ Sets the maximum distance to stay from the target object. + @deprecated: Use the L{max} attribute instead. @param distance: The maximum distance to maintain. @type distance: float """ @@ -1179,6 +1188,7 @@ class KX_CameraActuator(SCA_IActuator): """ Returns the height to stay above the target object. + @deprecated: Use the L{height} attribute instead. @rtype: float """ @@ -1186,6 +1196,7 @@ class KX_CameraActuator(SCA_IActuator): """ Sets the height to stay above the target object. + @deprecated: Use the L{height} attribute instead. @type height: float @param height: The height to stay above the target object. """ @@ -1194,6 +1205,7 @@ class KX_CameraActuator(SCA_IActuator): """ Sets the axis to get behind. + @deprecated: Use the L{useXY} attribute instead. @param xaxis: False to track Y axis, True to track X axis. @type xaxis: boolean """ @@ -1202,9 +1214,11 @@ class KX_CameraActuator(SCA_IActuator): """ Returns the axis this actuator is tracking. + @deprecated: Use the L{useXY} attribute instead. @return: True if tracking X axis, False if tracking Y axis. @rtype: boolean """ +#} class KX_ConstraintActuator(SCA_IActuator): """ @@ -1238,8 +1252,8 @@ class KX_ConstraintActuator(SCA_IActuator): If set to 0, the actuator is not limited in time. @type time: integer - @ivar property: the name of the property or material for the ray detection of the distance constraint. - @type property: string + @ivar propName: the name of the property or material for the ray detection of the distance constraint. + @type propName: string @ivar min: The lower bound of the constraint For the rotation and orientation constraint, it represents radiant @@ -1279,6 +1293,7 @@ class KX_ConstraintActuator(SCA_IActuator): KX_ACT_CONSTRAINT_FHNZ (21) : set force field along negative Z axis @type limit: integer """ +#{ Deprecated def setDamp(time): """ Sets the time this constraint is delayed. @@ -1442,6 +1457,7 @@ class KX_ConstraintActuator(SCA_IActuator): @rtype: float """ +#} class KX_ConstraintWrapper(PyObjectPlus): """ @@ -1462,8 +1478,8 @@ class KX_GameActuator(SCA_IActuator): Properties: - @ivar file: the new .blend file to load - @type file: string. + @ivar fileName: the new .blend file to load + @type fileName: string. @ivar mode: The mode of this actuator @type mode: Constant in... - L{GameLogic.KX_GAME_LOAD} @@ -1473,21 +1489,23 @@ class KX_GameActuator(SCA_IActuator): - L{GameLogic.KX_GAME_SAVECFG} - L{GameLogic.KX_GAME_LOADCFG} """ +#{ Deprecated def getFile(): """ Returns the filename of the new .blend file to load. - @deprecated: use the L{file} property + @deprecated: use the L{fileName} property @rtype: string """ def setFile(filename): """ Sets the new .blend file to load. - @deprecated: use the L{file} property + @deprecated: use the L{fileName} property @param filename: The file name this actuator will load. @type filename: string """ +#} class KX_GameObject(SCA_IObject): """ @@ -1530,16 +1548,16 @@ class KX_GameObject(SCA_IObject): @type orientation: 3x3 Matrix [[float]] On write: local orientation, on read: world orientation @ivar scaling: The object's scaling factor. list [sx, sy, sz] - deprecated: use L{localScaling} and L{worldScaling} + deprecated: use L{localScale} and L{worldScale} @type scaling: list [sx, sy, sz] On write: local scaling, on read: world scaling @ivar localOrientation: The object's local orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. @type localOrientation: 3x3 Matrix [[float]] @ivar worldOrientation: The object's world orientation. @type worldOrientation: 3x3 Matrix [[float]] - @ivar localScaling: The object's local scaling factor. - @type localScaling: list [sx, sy, sz] - @ivar worldScaling: The object's world scaling factor. Read-only - @type worldScaling: list [sx, sy, sz] + @ivar localScale: The object's local scaling factor. + @type localScale: list [sx, sy, sz] + @ivar worldScale: The object's world scaling factor. Read-only + @type worldScale: list [sx, sy, sz] @ivar localPosition: The object's local position. @type localPosition: list [x, y, z] @ivar worldPosition: The object's world position. @@ -2002,16 +2020,16 @@ class KX_IpoActuator(SCA_IActuator): """ IPO actuator activates an animation. - @ivar startFrame: Start frame. - @type startFrame: float - @ivar endFrame: End frame. - @type endFrame: float + @ivar frameStart: Start frame. + @type frameStart: float + @ivar frameEnd: End frame. + @type frameEnd: float @ivar propName: Use this property to define the Ipo position @type propName: string @ivar framePropName: Assign this property this action current frame number @type framePropName: string - @ivar type: Play mode for the ipo. (In GameLogic.KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND, KX_IPOACT_FROM_PROP) - @type type: int + @ivar mode: Play mode for the ipo. (In GameLogic.KX_IPOACT_PLAY, KX_IPOACT_PINGPONG, KX_IPOACT_FLIPPER, KX_IPOACT_LOOPSTOP, KX_IPOACT_LOOPEND, KX_IPOACT_FROM_PROP) + @type mode: int @ivar useIpoAsForce: Apply Ipo as a global or local force depending on the local option (dynamic objects only) @type useIpoAsForce: bool @ivar useIpoAdd: Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag @@ -2021,6 +2039,7 @@ class KX_IpoActuator(SCA_IActuator): @ivar useChildren: Update IPO on all children Objects as well @type useChildren: bool """ +#{ Deprecated def set(mode, startframe, endframe, force): """ Sets the properties of the actuator. @@ -2046,28 +2065,28 @@ class KX_IpoActuator(SCA_IActuator): """ Sets the frame from which the IPO starts playing. - @deprecated: use L{startFrame} + @deprecated: use L{frameStart} @type startframe: integer """ def getStart(): """ Returns the frame from which the IPO starts playing. - @deprecated: use L{startFrame} + @deprecated: use L{frameStart} @rtype: integer """ def setEnd(endframe): """ Sets the frame at which the IPO stops playing. - @deprecated: use L{endFrame} + @deprecated: use L{frameEnd} @type endframe: integer """ def getEnd(): """ Returns the frame at which the IPO stops playing. - @deprecated: use L{endFrame} + @deprecated: use L{frameEnd} @rtype: integer """ def setIpoAsForce(force): @@ -2133,6 +2152,7 @@ class KX_IpoActuator(SCA_IActuator): @deprecated: use L{useIpoLocal} """ +#} class KX_LightObject(KX_GameObject): """ @@ -2420,20 +2440,19 @@ class KX_TouchSensor(SCA_ISensor): """ Touch sensor detects collisions between objects. - @ivar property: The property or material to collide with. - @type property: string + @ivar propName: The property or material to collide with. + @type propName: string @ivar useMaterial: Determines if the sensor is looking for a property or material. KX_True = Find material; KX_False = Find property @type useMaterial: boolean - @ivar pulseCollisions: The last collided object. - @type pulseCollisions: bool - @ivar objectHit: The last collided object. (read-only) - @type objectHit: L{KX_GameObject} or None - @ivar objectHitList: A list of colliding objects. (read-only) - @type objectHitList: L{CListValue} of L{KX_GameObject} + @ivar usePulseCollision: The last collided object. + @type usePulseCollision: bool + @ivar hitObject: The last collided object. (read-only) + @type hitObject: L{KX_GameObject} or None + @ivar hitObjectList: A list of colliding objects. (read-only) + @type hitObjectList: L{CListValue} of L{KX_GameObject} """ - - #--The following methods are deprecated, please use properties instead. +#{ Deprecated def setProperty(name): """ Set the property or material to collide with. Use @@ -2457,7 +2476,7 @@ class KX_TouchSensor(SCA_ISensor): """ Returns the last object hit by this touch sensor. - @deprecated: use the L{objectHit} property + @deprecated: use the L{hitObject} property @rtype: L{KX_GameObject} """ def getHitObjectList(): @@ -2466,8 +2485,8 @@ class KX_TouchSensor(SCA_ISensor): Only objects that have the requisite material/property are listed. - @deprecated: use the L{objectHitList} property - @rtype: L{CListValue} of L{KX_GameObject} + @deprecated: use the L{hitObjectList} property + @rtype: L{CListValue} of L{hitObjectList} """ def getTouchMaterial(): """ @@ -2476,6 +2495,7 @@ class KX_TouchSensor(SCA_ISensor): @deprecated: use the L{useMaterial} property """ +#} class KX_NearSensor(KX_TouchSensor): """ @@ -3393,8 +3413,8 @@ class KX_RaySensor(SCA_ISensor): """ A ray sensor detects the first object in a given direction. - @ivar property: The property the ray is looking for. - @type property: string + @ivar propName: The property the ray is looking for. + @type propName: string @ivar range: The distance of the ray. @type range: float @ivar useMaterial: Whether or not to look for a material (false = property) @@ -3414,7 +3434,7 @@ class KX_RaySensor(SCA_ISensor): KX_RAY_AXIS_POS_X, KX_RAY_AXIS_POS_Y, KX_RAY_AXIS_POS_Z, KX_RAY_AXIS_NEG_X, KX_RAY_AXIS_NEG_Y, KX_RAY_AXIS_NEG_Z """ - +#{ Deprecated def getHitObject(): """ Returns the game object that was hit by this ray. @@ -3443,6 +3463,7 @@ class KX_RaySensor(SCA_ISensor): @deprecated: Use the L{rayDirection} attribute instead. @rtype: list [dx, dy, dz] """ +#} class KX_SCA_AddObjectActuator(SCA_IActuator): """ @@ -3562,13 +3583,14 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): class KX_SCA_DynamicActuator(SCA_IActuator): """ Dynamic Actuator. - @ivar operation: the type of operation of the actuator, 0-4 + @ivar mode: the type of operation of the actuator, 0-4 KX_DYN_RESTORE_DYNAMICS, KX_DYN_DISABLE_DYNAMICS, KX_DYN_ENABLE_RIGID_BODY, KX_DYN_DISABLE_RIGID_BODY, KX_DYN_SET_MASS - @type operation: integer + @type mode: integer @ivar mass: the mass value for the KX_DYN_SET_MASS operation @type mass: float """ +#{ Deprecated def setOperation(operation): """ Set the type of operation when the actuator is activated: @@ -3578,13 +3600,14 @@ class KX_SCA_DynamicActuator(SCA_IActuator): - 3 = disable rigid body - 4 = set mass - @deprecated: Use the L{operation} attribute instead. + @deprecated: Use the L{mode} attribute instead. """ def getOperation(): """ return the type of operation - @deprecated: Use the L{operation} attribute instead. + @deprecated: Use the L{mode} attribute instead. """ +#} class KX_SCA_EndObjectActuator(SCA_IActuator): """ @@ -3714,8 +3737,8 @@ class KX_Scene(PyObjectPlus): @type name: string @ivar objects: A list of objects in the scene, (read-only). @type objects: L{CListValue} of L{KX_GameObject} - @ivar objects_inactive: A list of objects on background layers (used for the addObject actuator), (read-only). - @type objects_inactive: L{CListValue} of L{KX_GameObject} + @ivar objectsInactive: A list of objects on background layers (used for the addObject actuator), (read-only). + @type objectsInactive: L{CListValue} of L{KX_GameObject} @ivar lights: A list of lights in the scene, (read-only). @type lights: L{CListValue} of L{KX_LightObject} @ivar cameras: A list of cameras in the scene, (read-only). @@ -3791,6 +3814,7 @@ class KX_SceneActuator(SCA_IActuator): @ivar mode: The mode of the actuator @type mode: int from 0 to 5 L{GameLogic.Scene Actuator} """ +#{ Deprecated def setUseRestart(flag): """ Set flag to True to restart the scene. @@ -3837,6 +3861,7 @@ class KX_SceneActuator(SCA_IActuator): @deprecated: use the L{camera} attribute instead. @rtype: string """ +#} class KX_SoundActuator(SCA_IActuator): """ @@ -3846,8 +3871,8 @@ class KX_SoundActuator(SCA_IActuator): the actuator to be activated - they act instantly provided that the actuator has been activated once at least. - @ivar filename: Sets the filename of the sound this actuator plays. - @type filename: string + @ivar fileName: Sets the filename of the sound this actuator plays. + @type fileName: string @ivar volume: Sets the volume (gain) of the sound. @type volume: float @@ -3871,31 +3896,17 @@ class KX_SoundActuator(SCA_IActuator): also use quaternion [float,float,float,float] or euler angles [float,float,float] @type orientation: 3x3 matrix [[float]] - @ivar type: Sets the operation mode of the actuator. You can use one of the following constant: + @ivar mode: Sets the operation mode of the actuator. You can use one of the following constant: - KX_SOUNDACT_PLAYSTOP (1) - KX_SOUNDACT_PLAYEND (2) - KX_SOUNDACT_LOOPSTOP (3) - KX_SOUNDACT_LOOPEND (4) - KX_SOUNDACT_LOOPBIDIRECTIONAL (5) - KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP (6) - @type type: integer - - @group Play Methods: startSound, pauseSound, stopSound + @type mode: integer """ - def setFilename(filename): - """ - Sets the filename of the sound this actuator plays. - - @deprecated: Use the L{filename} attribute instead. - @type filename: string - """ - def getFilename(): - """ - Returns the filename of the sound this actuator plays. - - @deprecated: Use the L{filename} attribute instead. - @rtype: string - """ + +#{ Play Methods def startSound(): """ Starts the sound. @@ -3908,6 +3919,23 @@ class KX_SoundActuator(SCA_IActuator): """ Stops the sound. """ +#} + +#{ Deprecated + def setFilename(filename): + """ + Sets the filename of the sound this actuator plays. + + @deprecated: Use the L{fileName} attribute instead. + @type filename: string + """ + def getFilename(): + """ + Returns the filename of the sound this actuator plays. + + @deprecated: Use the L{fileName} attribute instead. + @rtype: string + """ def setGain(gain): """ Sets the gain (volume) of the sound @@ -4030,6 +4058,7 @@ class KX_SoundActuator(SCA_IActuator): @rtype: integer @return: KX_SOUNDACT_PLAYSTOP, KX_SOUNDACT_PLAYEND, KX_SOUNDACT_LOOPSTOP, KX_SOUNDACT_LOOPEND, KX_SOUNDACT_LOOPBIDIRECTIONAL, KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP """ +#} class KX_StateActuator(SCA_IActuator): """ @@ -4451,11 +4480,12 @@ class KX_VisibilityActuator(SCA_IActuator): Visibility Actuator. @ivar visibility: whether the actuator makes its parent object visible or invisible @type visibility: boolean - @ivar occlusion: whether the actuator makes its parent object an occluder or not - @type occlusion: boolean - @ivar recursion: whether the visibility/occlusion should be propagated to all children of the object - @type recursion: boolean + @ivar useOcclusion: whether the actuator makes its parent object an occluder or not + @type useOcclusion: boolean + @ivar useRecursion: whether the visibility/occlusion should be propagated to all children of the object + @type useRecursion: boolean """ +#{ Deprecated def set(visible): """ Sets whether the actuator makes its parent object visible or invisible. @@ -4464,8 +4494,7 @@ class KX_VisibilityActuator(SCA_IActuator): @param visible: - True: Makes its parent visible. - False: Makes its parent invisible. """ -# -# Documentation for PyObjectPlus base class +#} class SCA_2DFilterActuator(SCA_IActuator): """ @@ -4483,7 +4512,7 @@ class SCA_2DFilterActuator(SCA_IActuator): @type shaderText: string @ivar disableMotionBlur: action on motion blur: 0=enable, 1=disable @type disableMotionBlur: integer - @ivar type: type of 2D filter, use one of the following constants: + @ivar mode: type of 2D filter, use one of the following constants: RAS_2DFILTER_ENABLED (-2) : enable the filter that was previously disabled RAS_2DFILTER_DISABLED (-1) : disable the filter that is currently active RAS_2DFILTER_NOFILTER (0) : disable and destroy the filter that is currently active @@ -4499,10 +4528,10 @@ class SCA_2DFilterActuator(SCA_IActuator): RAS_2DFILTER_SEPIA (10) RAS_2DFILTER_INVERT (11) RAS_2DFILTER_CUSTOMFILTER (12) : customer filter, the code code is set via shaderText property - @type type: integer - @ivar passNb: order number of filter in the stack of 2D filters. Filters are executed in increasing order of passNb. + @type mode: integer + @ivar passNumber: order number of filter in the stack of 2D filters. Filters are executed in increasing order of passNb. Only be one filter can be defined per passNb. - @type passNb: integer (0-100) + @type passNumber: integer (0-100) @ivar value: argument for motion blur filter @type value: float (0.0-100.0) """ @@ -4706,7 +4735,7 @@ class SCA_JoystickSensor(SCA_ISensor): """ Returns the state of the joysticks axis. See differs to L{getAxis()} returning the current state of the joystick. - @deprecated: Use the L{axisPosition} attribute instead. + @deprecated: Use the L{axisSingle} attribute instead. @rtype: list @return: 4 values, each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing. @@ -4929,13 +4958,14 @@ class SCA_PropertyActuator(SCA_IActuator): Properties: - @ivar property: the property on which to operate. - @type property: string + @ivar propName: the property on which to operate. + @type propName: string @ivar value: the value with which the actuator operates. @type value: string - @ivar type: TODO - add constants to game logic dict!. - @type type: iny + @ivar mode: TODO - add constants to game logic dict!. + @type mode: int """ +#{ Deprecated def setProperty(prop): """ Set the property on which to operate. @@ -4970,6 +5000,7 @@ class SCA_PropertyActuator(SCA_IActuator): @deprecated: Use the L{value} attribute instead. @rtype: string """ +#} class SCA_PropertySensor(SCA_ISensor): """ @@ -4977,21 +5008,21 @@ class SCA_PropertySensor(SCA_ISensor): Properties: - @ivar type: type of check on the property: + @ivar mode: type of check on the property: KX_PROPSENSOR_EQUAL(1), KX_PROPSENSOR_NOTEQUAL(2), KX_PROPSENSOR_INTERVAL(3), KX_PROPSENSOR_CHANGED(4), KX_PROPSENSOR_EXPRESSION(5) - @type type: integer - @ivar property: the property with which the sensor operates. - @type property: string + @type mode: integer + @ivar propName: the property the sensor operates. + @type propName: string @ivar value: the value with which the sensor compares to the value of the property. @type value: string """ - +#{ Deprecated def getType(): """ Gets when to activate this sensor. - @deprecated: Use the L{type} attribute instead. + @deprecated: Use the L{mode} attribute instead. @return: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL, KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED, or KX_PROPSENSOR_EXPRESSION. @@ -5001,7 +5032,7 @@ class SCA_PropertySensor(SCA_ISensor): """ Set the type of check to perform. - @deprecated: Use the L{type} attribute instead. + @deprecated: Use the L{mode} attribute instead. @type checktype: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL, KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED, or KX_PROPSENSOR_EXPRESSION. @@ -5011,7 +5042,7 @@ class SCA_PropertySensor(SCA_ISensor): """ Return the property with which the sensor operates. - @deprecated: Use the L{property} attribute instead. + @deprecated: Use the L{propName} attribute instead. @rtype: string @return: the name of the property this sensor is watching. """ @@ -5020,7 +5051,7 @@ class SCA_PropertySensor(SCA_ISensor): Sets the property with which to operate. If there is no property of that name, this call is ignored. - @deprecated: Use the L{property} attribute instead. + @deprecated: Use the L{propName} attribute instead. @type name: string. """ def getValue(): @@ -5040,6 +5071,7 @@ class SCA_PropertySensor(SCA_ISensor): @deprecated: Use the L{value} attribute instead. @type value: string """ +#} class SCA_PythonController(SCA_IController): """ @@ -5102,76 +5134,11 @@ class SCA_RandomActuator(SCA_IActuator): KX_RANDOMACT_FLOAT_CONST, KX_RANDOMACT_FLOAT_UNIFORM, KX_RANDOMACT_FLOAT_NORMAL, KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL @type distribution: integer, read-only - @ivar property: the name of the property to set with the random value. + @ivar propName: the name of the property to set with the random value. If the generator and property types do not match, the assignment is ignored. - @type property: string + @type propName: string """ - def setSeed(seed): - """ - Sets the seed of the random number generator. - - Equal seeds produce equal series. If the seed is 0, - the generator will produce the same value on every call. - - @deprecated: Use the L{seed} attribute instead. - @type seed: integer - """ - def getSeed(): - """ - Returns the initial seed of the generator. - - @deprecated: Use the L{seed} attribute instead. - @rtype: integer - """ - def getPara1(): - """ - Returns the first parameter of the active distribution. - - Refer to the documentation of the generator types for the meaning - of this value. - - @deprecated: Use the L{para1} attribute instead. - @rtype: float - """ - def getPara2(): - """ - Returns the second parameter of the active distribution. - - Refer to the documentation of the generator types for the meaning - of this value. - - @deprecated: Use the L{para2} attribute instead. - @rtype: float - """ - def getDistribution(): - """ - Returns the type of random distribution. - - @deprecated: Use the L{distribution} attribute instead. - @rtype: distribution type - @return: KX_RANDOMACT_BOOL_CONST, KX_RANDOMACT_BOOL_UNIFORM, KX_RANDOMACT_BOOL_BERNOUILLI, - KX_RANDOMACT_INT_CONST, KX_RANDOMACT_INT_UNIFORM, KX_RANDOMACT_INT_POISSON, - KX_RANDOMACT_FLOAT_CONST, KX_RANDOMACT_FLOAT_UNIFORM, KX_RANDOMACT_FLOAT_NORMAL, - KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL - """ - def setProperty(property): - """ - Set the property to which the random value is assigned. - - If the generator and property types do not match, the assignment is ignored. - - @deprecated: Use the L{property} attribute instead. - @type property: string - @param property: The name of the property to set. - """ - def getProperty(): - """ - Returns the name of the property to set. - - @deprecated: Use the L{property} attribute instead. - @rtype: string - """ def setBoolConst(value): """ Sets this generator to produce a constant boolean value. @@ -5249,6 +5216,74 @@ class SCA_RandomActuator(SCA_IActuator): @type half_life: float """ +#{ Deprecated + def setSeed(seed): + """ + Sets the seed of the random number generator. + + Equal seeds produce equal series. If the seed is 0, + the generator will produce the same value on every call. + + @deprecated: Use the L{seed} attribute instead. + @type seed: integer + """ + def getSeed(): + """ + Returns the initial seed of the generator. + + @deprecated: Use the L{seed} attribute instead. + @rtype: integer + """ + def getPara1(): + """ + Returns the first parameter of the active distribution. + + Refer to the documentation of the generator types for the meaning + of this value. + + @deprecated: Use the L{para1} attribute instead. + @rtype: float + """ + def getPara2(): + """ + Returns the second parameter of the active distribution. + + Refer to the documentation of the generator types for the meaning + of this value. + + @deprecated: Use the L{para2} attribute instead. + @rtype: float + """ + def getDistribution(): + """ + Returns the type of random distribution. + + @deprecated: Use the L{distribution} attribute instead. + @rtype: distribution type + @return: KX_RANDOMACT_BOOL_CONST, KX_RANDOMACT_BOOL_UNIFORM, KX_RANDOMACT_BOOL_BERNOUILLI, + KX_RANDOMACT_INT_CONST, KX_RANDOMACT_INT_UNIFORM, KX_RANDOMACT_INT_POISSON, + KX_RANDOMACT_FLOAT_CONST, KX_RANDOMACT_FLOAT_UNIFORM, KX_RANDOMACT_FLOAT_NORMAL, + KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL + """ + def setProperty(property): + """ + Set the property to which the random value is assigned. + + If the generator and property types do not match, the assignment is ignored. + + @deprecated: Use the L{propName} attribute instead. + @type property: string + @param property: The name of the property to set. + """ + def getProperty(): + """ + Returns the name of the property to set. + + @deprecated: Use the L{propName} attribute instead. + @rtype: string + """ +#} + class SCA_RandomSensor(SCA_ISensor): """ diff --git a/source/gameengine/PyDoc/bge_api_validate_py.txt b/source/gameengine/PyDoc/bge_api_validate_py.txt index ec92cc28770..ebd74c06bb3 100644 --- a/source/gameengine/PyDoc/bge_api_validate_py.txt +++ b/source/gameengine/PyDoc/bge_api_validate_py.txt @@ -51,7 +51,11 @@ if doc_dir not in sys.path: def check_attribute(class_ob, member): - for l in class_ob.__doc__.split('\n'): + doc = class_ob.__doc__ + if not doc: + return False + + for l in doc.split('\n'): l = l.strip() ''' @@ -130,4 +134,3 @@ for mod_name, pymod in mods_dict.iteritems(): sys.path.pop() # remove the pydoc dir from our import paths - -- cgit v1.2.3 From e295cfd4d5e9adcd006cbab95f84eb93a73ea6bc Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 15 May 2009 13:23:03 +0000 Subject: NLA Branch: Setting up evaluation system for action strips * Refactored F-Curve Modifier stack evaluation into functions which can be reused for F-Curve Modifiers on NLA-Strips * Started setting up temporary accumulation buffer system for use when evaluating strips --- source/blender/blenkernel/BKE_fcurve.h | 6 +- source/blender/blenkernel/intern/anim_sys.c | 110 ++++++++++++++++++-- source/blender/blenkernel/intern/fcurve.c | 156 +++++++++++++++++----------- 3 files changed, 201 insertions(+), 71 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index 9b8a2990fe5..7058b9d236a 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -108,11 +108,15 @@ struct FModifier *fcurve_add_modifier(struct FCurve *fcu, int type); void fcurve_copy_modifiers(ListBase *dst, ListBase *src); void fcurve_remove_modifier(struct FCurve *fcu, struct FModifier *fcm); void fcurve_free_modifiers(struct FCurve *fcu); -void fcurve_bake_modifiers(struct FCurve *fcu, int start, int end); struct FModifier *fcurve_find_active_modifier(struct FCurve *fcu); void fcurve_set_active_modifier(struct FCurve *fcu, struct FModifier *fcm); +float evaluate_time_fmodifiers(ListBase *modifiers, struct FCurve *fcu, float cvalue, float evaltime); +void evaluate_value_fmodifiers(ListBase *modifiers, struct FCurve *fcu, float *cvalue, float evaltime); + +void fcurve_bake_modifiers(struct FCurve *fcu, int start, int end); + /* ************** F-Curves API ******************** */ /* -------- Data Managemnt -------- */ diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 2840e3f5d45..5a4a2d91469 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "MEM_guardedalloc.h" @@ -564,7 +565,7 @@ enum { typedef struct NlaEvalChannel { struct NlaEvalChannel *next, *prev; - PointerRNA *ptr; /* pointer to struct containing property to use */ + PointerRNA ptr; /* pointer to struct containing property to use */ PropertyRNA *prop; /* RNA-property type to use (should be in the struct given) */ int index; /* array index (where applicable) */ @@ -638,13 +639,13 @@ static float nlastrip_get_influence (NlaStrip *strip, float cframe) } /* evaluate the evaluation time and influence for the strip, storing the results in the strip */ -void nlastrip_evaluate_controls (NlaStrip *strip, float cframe) +void nlastrip_evaluate_controls (NlaStrip *strip, float ctime) { /* firstly, analytically generate values for influence and time (if applicable) */ if ((strip->flag & NLASTRIP_FLAG_USR_TIME) == 0) - strip->strip_time= nlastrip_get_frame(strip, cframe, 1); /* last arg '1' means current time to 'strip'/action time */ + strip->strip_time= nlastrip_get_frame(strip, ctime, 1); /* last arg '1' means current time to 'strip'/action time */ if ((strip->flag & NLASTRIP_FLAG_USR_INFLUENCE) == 0) - strip->influence= nlastrip_get_influence(strip, cframe); + strip->influence= nlastrip_get_influence(strip, ctime); /* now strip's evaluate F-Curves for these settings (if applicable) */ if (strip->fcurves.first) { @@ -766,13 +767,104 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index /* ---------------------- */ +/* verify that an appropriate NlaEvalChannel for this F-Curve */ +static NlaEvalChannel *nlaevalchan_verify (PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes, FCurve *fcu, short *newChan) +{ + NlaEvalChannel *nec= NULL; + NlaStrip *strip= nes->strip; + PropertyRNA *prop; + PointerRNA new_ptr; + char *path = NULL; + short free_path=0; + + /* sanity checks */ + if (channels == NULL) + return NULL; + + /* get RNA pointer+property info from F-Curve for more convenient handling */ + /* get path, remapped as appropriate to work in its new environment */ + free_path= animsys_remap_path(strip->remap, fcu->rna_path, &path); + + /* get property to write to */ + if (RNA_path_resolve(ptr, path, &new_ptr, &prop) == 0) + return NULL; + /* only ok if animateable */ + else if (RNA_property_animateable(&new_ptr, prop) == 0) + return NULL; + + /* loop through existing channels, checking for a channel which affects the same property */ + for (nec= channels->first; nec; nec= nec->next) { + if ((nec->ptr.data == new_ptr.data) && (nec->prop == prop)) + return nec; + } + + /* allocate a new struct for this */ + nec= MEM_callocN(sizeof(NlaEvalChannel), "NlaEvalChannel"); + *newChan= 1; + BLI_addtail(channels, nec); + + nec->ptr= new_ptr; + nec->prop= prop; + nec->index= fcu->array_index; + + return nec; +} + +/* ---------------------- */ + +/* evaluate action-clip strip */ +static void nlastrip_evaluate_actionclip (PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes) +{ + NlaStrip *strip= nes->strip; + FCurve *fcu; + float evaltime; + + /* evaluate strip's modifiers which modify time to evaluate the base curves at */ + evaltime= evaluate_time_fmodifiers(&strip->modifiers, NULL, 0.0f, strip->strip_time); + + /* evaluate all the F-Curves in the action, saving the relevant pointers to data that will need to be used */ + for (fcu= strip->act->curves.first; fcu; fcu= fcu->next) { + NlaEvalChannel *nec; + float value = 0.0f; + short newChan = -1; + + /* check if this curve should be skipped */ + if (fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) + continue; + + /* evaluate the F-Curve's value for the time given in the strip + * NOTE: we use the modified time here, since strip's F-Curve Modifiers are applied on top of this + */ + value= evaluate_fcurve(fcu, evaltime); + + /* apply strip's F-Curve Modifiers on this value + * NOTE: we apply the strip's original evaluation time not the modified one (as per standard F-Curve eval) + */ + evaluate_value_fmodifiers(&strip->modifiers, fcu, &value, strip->strip_time); + + + /* get an NLA evaluation channel to work with, and accumulate the evaluated value with the value(s) + * stored in this channel if it has been used already + */ + nec= nlaevalchan_verify(ptr, channels, nes, fcu, &newChan); + //if (nec) + // nlaevalchan_accumulate(ptr, nec, nes, newChan, value); + } +} + /* evaluates the given evaluation strip */ -// FIXME: will we need the evaluation cache table set up to blend stuff in? // TODO: only evaluate here, but flush in one go using the accumulated channels at end... -static void nlastrip_ctime_evaluate (ListBase *channels, NlaEvalStrip *nes, float ctime) +static void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes) { - // 1. (in old code) was to extract 'IPO-channels' from actions - // 2. blend between the 'accumulated' data, and the new data + /* actions to take depend on the type of strip */ + switch (nes->strip->type) { + case NLASTRIP_TYPE_CLIP: /* action-clip */ + nlastrip_evaluate_actionclip(ptr, channels, nes); + break; + case NLASTRIP_TYPE_TRANSITION: /* transition */ + // XXX code this... + break; + } } /* write the accumulated settings to */ @@ -807,7 +899,7 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime) /* 2. for each strip, evaluate then accumulate on top of existing channels, but don't set values yet */ for (nes= estrips.first; nes; nes= nes->next) - nlastrip_ctime_evaluate(&echannels, nes, ctime); + nlastrip_evaluate(ptr, &echannels, nes); /* 3. flush effects of accumulating channels in NLA to the actual data they affect */ nladata_flush_channels(ptr, &echannels); diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index cade555a07a..1a40911170e 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -2166,34 +2166,6 @@ void fcurve_free_modifiers (FCurve *fcu) } } -/* Bake modifiers for given F-Curve to curve sample data, in the frame range defined - * by start and end (inclusive). - */ -void fcurve_bake_modifiers (FCurve *fcu, int start, int end) -{ - ChannelDriver *driver; - - /* sanity checks */ - // TODO: make these tests report errors using reports not printf's - if ELEM(NULL, fcu, fcu->modifiers.first) { - printf("Error: No F-Curve with F-Curve Modifiers to Bake\n"); - return; - } - - /* temporarily, disable driver while we sample, so that they don't influence the outcome */ - driver= fcu->driver; - fcu->driver= NULL; - - /* bake the modifiers, by sampling the curve at each frame */ - fcurve_store_samples(fcu, NULL, start, end, fcurve_samplingcb_evalcurve); - - /* free the modifiers now */ - fcurve_free_modifiers(fcu); - - /* restore driver */ - fcu->driver= driver; -} - /* Find the active F-Curve Modifier */ FModifier *fcurve_find_active_modifier (FCurve *fcu) { @@ -2231,6 +2203,98 @@ void fcurve_set_active_modifier (FCurve *fcu, FModifier *fcm) fcm->flag |= FMODIFIER_FLAG_ACTIVE; } +/* Evaluation API --------------------------- */ + +/* evaluate time modifications imposed by some F-Curve Modifiers + * - this step acts as an optimisation to prevent the F-Curve stack being evaluated + * several times by modifiers requesting the time be modified, as the final result + * would have required using the modified time + * - modifiers only ever recieve the unmodified time, as subsequent modifiers should be + * working on the 'global' result of the modified curve, not some localised segment, + * so nevaltime gets set to whatever the last time-modifying modifier likes... + * - we start from the end of the stack, as only the last one matters for now + */ +float evaluate_time_fmodifiers (ListBase *modifiers, FCurve *fcu, float cvalue, float evaltime) +{ + FModifier *fcm; + float m_evaltime= evaltime; + + /* sanity checks */ + if ELEM(NULL, modifiers, modifiers->first) + return evaltime; + + /* find the first modifier from end of stack that modifies time, and calculate the time the modifier + * would calculate time at + */ + for (fcm= fcu->modifiers.last; fcm; fcm= fcm->prev) { + FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); + + /* only evaluate if there's a callback for this */ + // TODO: implement the 'influence' control feature... + if (fmi && fmi->evaluate_modifier_time) { + if ((fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) == 0) + m_evaltime= fmi->evaluate_modifier_time(fcu, fcm, cvalue, evaltime); + break; + } + } + + /* return the modified evaltime */ + return m_evaltime; +} + +/* Evalautes the given set of F-Curve Modifiers using the given data + * Should only be called after evaluate_time_fmodifiers() has been called... + */ +void evaluate_value_fmodifiers (ListBase *modifiers, FCurve *fcu, float *cvalue, float evaltime) +{ + FModifier *fcm; + + /* sanity checks */ + if ELEM(NULL, modifiers, modifiers->first) + return; + + /* evaluate modifiers */ + for (fcm= modifiers->first; fcm; fcm= fcm->next) { + FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); + + /* only evaluate if there's a callback for this */ + // TODO: implement the 'influence' control feature... + if (fmi && fmi->evaluate_modifier) { + if ((fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) == 0) + fmi->evaluate_modifier(fcu, fcm, cvalue, evaltime); + } + } +} + + +/* Bake modifiers for given F-Curve to curve sample data, in the frame range defined + * by start and end (inclusive). + */ +void fcurve_bake_modifiers (FCurve *fcu, int start, int end) +{ + ChannelDriver *driver; + + /* sanity checks */ + // TODO: make these tests report errors using reports not printf's + if ELEM(NULL, fcu, fcu->modifiers.first) { + printf("Error: No F-Curve with F-Curve Modifiers to Bake\n"); + return; + } + + /* temporarily, disable driver while we sample, so that they don't influence the outcome */ + driver= fcu->driver; + fcu->driver= NULL; + + /* bake the modifiers, by sampling the curve at each frame */ + fcurve_store_samples(fcu, NULL, start, end, fcurve_samplingcb_evalcurve); + + /* free the modifiers now */ + fcurve_free_modifiers(fcu); + + /* restore driver */ + fcu->driver= driver; +} + /* ***************************** F-Curve - Evaluation ********************************* */ /* Evaluate and return the value of the given F-Curve at the specified frame ("evaltime") @@ -2238,7 +2302,6 @@ void fcurve_set_active_modifier (FCurve *fcu, FModifier *fcm) */ float evaluate_fcurve (FCurve *fcu, float evaltime) { - FModifier *fcm; float cvalue= 0.0f; float devaltime; @@ -2251,28 +2314,8 @@ float evaluate_fcurve (FCurve *fcu, float evaltime) evaltime= cvalue= evaluate_driver(fcu->driver, evaltime); } - /* evaluate time modifications imposed by some F-Curve Modifiers - * - this step acts as an optimisation to prevent the F-Curve stack being evaluated - * several times by modifiers requesting the time be modified, as the final result - * would have required using the modified time - * - modifiers only ever recieve the unmodified time, as subsequent modifiers should be - * working on the 'global' result of the modified curve, not some localised segment, - * so nevaltime gets set to whatever the last time-modifying modifier likes... - * - we start from the end of the stack, as only the last one matters for now - */ - devaltime= evaltime; - - for (fcm= fcu->modifiers.last; fcm; fcm= fcm->prev) { - FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); - - /* only evaluate if there's a callback for this */ - // TODO: implement the 'influence' control feature... - if (fmi && fmi->evaluate_modifier_time) { - if ((fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) == 0) - devaltime= fmi->evaluate_modifier_time(fcu, fcm, cvalue, evaltime); - break; - } - } + /* evaluate modifiers which modify time to evaluate the base curve at */ + devaltime= evaluate_time_fmodifiers(&fcu->modifiers, fcu, cvalue, evaltime); /* evaluate curve-data * - 'devaltime' instead of 'evaltime', as this is the time that the last time-modifying @@ -2284,16 +2327,7 @@ float evaluate_fcurve (FCurve *fcu, float evaltime) cvalue= fcurve_eval_samples(fcu, fcu->fpt, devaltime); /* evaluate modifiers */ - for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) { - FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); - - /* only evaluate if there's a callback for this */ - // TODO: implement the 'influence' control feature... - if (fmi && fmi->evaluate_modifier) { - if ((fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) == 0) - fmi->evaluate_modifier(fcu, fcm, &cvalue, evaltime); - } - } + evaluate_value_fmodifiers(&fcu->modifiers, fcu, &cvalue, evaltime); /* if curve can only have integral values, perform truncation (i.e. drop the decimal part) * here so that the curve can be sampled correctly -- cgit v1.2.3 From 58db6df0696ab066b1cf4b37f4593fa03f65e099 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 15 May 2009 18:21:27 +0000 Subject: * Fix for compile error on MSVC. * Remove alut from makefiles and cmake. --- source/Makefile | 8 -------- 1 file changed, 8 deletions(-) (limited to 'source') diff --git a/source/Makefile b/source/Makefile index 7374ef3e7d6..d06105a0b9b 100644 --- a/source/Makefile +++ b/source/Makefile @@ -363,8 +363,6 @@ else NAN_SND_LIBS += $(OPENALSOUND) NAN_SND_LIBS += $(SDLSOUND) NAN_SND_LIBS += $(NAN_OPENAL)/lib/libopenal.a - ALUT = $(wildcard $(NAN_OPENAL)/lib/libalut.a) - NAN_SND_LIBS += $(ALUT) NAN_SND_LIBS += $(SOUNDSYSTEM) else ifeq ($(OS),windows) @@ -373,8 +371,6 @@ else NAN_SND_LIBS += $(OPENALSOUND) NAN_SND_LIBS += $(SDLSOUND) NAN_SND_LIBS += $(NAN_OPENAL)/lib/openal_static.lib - ALUT = $(wildcard $(NAN_OPENAL)/lib/alut_static.lib) - NAN_SND_LIBS += $(ALUT) NAN_SND_LIBS += $(SOUNDSYSTEM) else NAN_SND_LIBS = $(SOUNDSYSTEM) @@ -388,8 +384,6 @@ else NAN_SND_LIBS += $(DUMMYSOUND) NAN_SND_LIBS += $(OPENALSOUND) NAN_SND_LIBS += $(NAN_OPENAL)/lib/libopenal.a - ALUT = $(wildcard $(NAN_OPENAL)/lib/libalut.a) - NAN_SND_LIBS += $(ALUT) NAN_SND_LIBS += $(SOUNDSYSTEM) else ifeq ($(OS), solaris) @@ -398,8 +392,6 @@ else NAN_SND_LIBS += $(OPENALSOUND) NAN_SND_LIBS += $(SDLSOUND) NAN_SND_LIBS += $(NAN_OPENAL)/lib/libopenal.a - ALUT = $(wildcard $(NAN_OPENAL)/lib/libalut.a) - NAN_SND_LIBS += $(ALUT) NAN_SND_LIBS += $(SOUNDSYSTEM) else ifeq ($(OS), irix) -- cgit v1.2.3 From ef8f92ffe63d76ec40d28f31660b22e12e4650be Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Fri, 15 May 2009 20:51:32 +0000 Subject: BGE: fix a compatibility problem since logic patch with YoFrankie (and other games I guess). State actuators will now execute before any other actuators to make sure that the actuators link count are up to date when they execute. --- source/gameengine/GameLogic/SCA_IActuator.cpp | 21 ++++++++++++++++++++ source/gameengine/GameLogic/SCA_IActuator.h | 19 ++---------------- source/gameengine/GameLogic/SCA_LogicManager.cpp | 10 ---------- source/gameengine/GameLogic/SCA_LogicManager.h | 9 ++++++++- source/gameengine/Ketsji/KX_StateActuator.cpp | 25 ++++++++++++++++++++++++ source/gameengine/Ketsji/KX_StateActuator.h | 4 ++++ 6 files changed, 60 insertions(+), 28 deletions(-) (limited to 'source') diff --git a/source/gameengine/GameLogic/SCA_IActuator.cpp b/source/gameengine/GameLogic/SCA_IActuator.cpp index 5f71bb3f9e4..c2be36d5108 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.cpp +++ b/source/gameengine/GameLogic/SCA_IActuator.cpp @@ -58,6 +58,27 @@ bool SCA_IActuator::Update() return false; } +void SCA_IActuator::Activate(SG_DList& head) +{ + if (QEmpty()) + { + InsertActiveQList(m_gameobj->m_activeActuators); + head.AddBack(&m_gameobj->m_activeActuators); + } +} + +void SCA_IActuator::Deactivate() +{ + if (QDelink()) + { + // the actuator was in the active list + if (m_gameobj->m_activeActuators.QEmpty()) + // the owner object has no more active actuators, remove it from the global list + m_gameobj->m_activeActuators.Delink(); + } +} + + void SCA_IActuator::ProcessReplica() { SCA_ILogicBrick::ProcessReplica(); diff --git a/source/gameengine/GameLogic/SCA_IActuator.h b/source/gameengine/GameLogic/SCA_IActuator.h index 3055e1d946f..2bd92c343b9 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.h +++ b/source/gameengine/GameLogic/SCA_IActuator.h @@ -118,23 +118,8 @@ public: /** * remove this actuator from the list of active actuators */ - void Deactivate() - { - if (QDelink()) - // the actuator was in the active list - if (m_gameobj->m_activeActuators.QEmpty()) - // the owner object has no more active actuators, remove it from the global list - m_gameobj->m_activeActuators.Delink(); - } - - void Activate(SG_DList& head) - { - if (QEmpty()) - { - InsertActiveQList(m_gameobj->m_activeActuators); - head.AddBack(&m_gameobj->m_activeActuators); - } - } + virtual void Deactivate(); + virtual void Activate(SG_DList& head); void LinkToController(SCA_IController* controller); void UnlinkController(class SCA_IController* cont); diff --git a/source/gameengine/GameLogic/SCA_LogicManager.cpp b/source/gameengine/GameLogic/SCA_LogicManager.cpp index 74370f89cf2..7acec465921 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.cpp +++ b/source/gameengine/GameLogic/SCA_LogicManager.cpp @@ -312,16 +312,6 @@ void SCA_LogicManager::AddTriggeredController(SCA_IController* controller, SCA_I } } - -void SCA_LogicManager::AddActiveActuator(SCA_IActuator* actua,bool event) -{ - actua->SetActive(true); - actua->Activate(m_activeActuators); - actua->AddEvent(event); -} - - - SCA_EventManager* SCA_LogicManager::FindEventManager(int eventmgrtype) { // find an eventmanager of a certain type diff --git a/source/gameengine/GameLogic/SCA_LogicManager.h b/source/gameengine/GameLogic/SCA_LogicManager.h index 0d610c9cc46..fe7b40b3ba4 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.h +++ b/source/gameengine/GameLogic/SCA_LogicManager.h @@ -65,6 +65,7 @@ typedef std::map sensormap_t; */ #include "SCA_ILogicBrick.h" +#include "SCA_IActuator.h" class SCA_LogicManager @@ -103,7 +104,13 @@ public: void BeginFrame(double curtime, double fixedtime); void UpdateFrame(double curtime, bool frame); void EndFrame(); - void AddActiveActuator(SCA_IActuator* sensor,bool event); + void AddActiveActuator(SCA_IActuator* actua,bool event) + { + actua->SetActive(true); + actua->Activate(m_activeActuators); + actua->AddEvent(event); + } + void AddTriggeredController(SCA_IController* controller, SCA_ISensor* sensor); SCA_EventManager* FindEventManager(int eventmgrtype); diff --git a/source/gameengine/Ketsji/KX_StateActuator.cpp b/source/gameengine/Ketsji/KX_StateActuator.cpp index 2cbb42b3311..5f9730d7e10 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.cpp +++ b/source/gameengine/Ketsji/KX_StateActuator.cpp @@ -55,6 +55,9 @@ KX_StateActuator::~KX_StateActuator( // intentionally empty } +// used to put state actuator to be executed before any other actuators +SG_QList KX_StateActuator::m_stateActuatorHead; + CValue* KX_StateActuator::GetReplica( void @@ -99,6 +102,28 @@ KX_StateActuator::Update() return false; } +void KX_StateActuator::Deactivate() +{ + if (QDelink()) + { + // the actuator was in the active list + if (m_stateActuatorHead.QEmpty()) + // no more state object active + m_stateActuatorHead.Delink(); + } +} + +void KX_StateActuator::Activate(SG_DList& head) +{ + // no need to sort the state actuators + if (m_stateActuatorHead.QAddBack(this)) + { + // add front to make sure it runs before other actuators + head.AddFront(&m_stateActuatorHead); + } +} + + /* ------------------------------------------------------------------------- */ /* Python functions */ /* ------------------------------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_StateActuator.h b/source/gameengine/Ketsji/KX_StateActuator.h index 7e7056bd6af..57303ad403f 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.h +++ b/source/gameengine/Ketsji/KX_StateActuator.h @@ -46,6 +46,7 @@ class KX_StateActuator : public SCA_IActuator OP_NEG, OP_COUNT }; + static SG_QList m_stateActuatorHead; int m_operation; int m_mask; @@ -71,6 +72,9 @@ class KX_StateActuator : public SCA_IActuator virtual bool Update(); + virtual void Deactivate(); + virtual void Activate(SG_DList& head); + /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ -- cgit v1.2.3 From 006ad4aaacc36a7e7fd1a8cd96e60a5e74cbfedd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 May 2009 00:49:28 +0000 Subject: BGE Py API Bugfixes KX_GameObject.getVelocity() would set an error but nor return an error value when an non vector argument was given. KX_PythonSeq_Type was not initialized with PyType_Ready which could crash blender when inspecting the type. --- source/gameengine/Ketsji/KX_GameObject.cpp | 8 +------- source/gameengine/Ketsji/KX_PythonInitTypes.cpp | 4 ++++ source/gameengine/PyDoc/GameTypes.py | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 9196d1e0527..ae30aeb971c 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -2051,14 +2051,8 @@ PyObject* KX_GameObject::PyGetVelocity(PyObject* args) MT_Point3 point(0.0,0.0,0.0); PyObject* pypos = NULL; - if (PyArg_ParseTuple(args, "|O:getVelocity", &pypos)) - { - if (pypos) - PyVecTo(pypos, point); - } - else { + if (!PyArg_ParseTuple(args, "|O:getVelocity", &pypos) || (pypos && !PyVecTo(pypos, point))) return NULL; - } if (m_pPhysicsController1) { diff --git a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp index cd21663f41d..83c4dcbb34c 100644 --- a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp +++ b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp @@ -51,6 +51,7 @@ #include "KX_PhysicsObjectWrapper.h" #include "KX_PolyProxy.h" #include "KX_PolygonMaterial.h" +#include "KX_PythonSeq.h" #include "KX_SCA_AddObjectActuator.h" #include "KX_SCA_EndObjectActuator.h" #include "KX_SCA_ReplaceMeshActuator.h" @@ -227,6 +228,9 @@ void initPyTypes(void) PyType_Ready_Attr(dict, SCA_XNORController); PyType_Ready_Attr(dict, SCA_XORController); PyType_Ready_Attr(dict, SCA_IController); + + /* Normal python type */ + PyType_Ready(&KX_PythonSeq_Type); } #endif \ No newline at end of file diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index d58f9087a9f..b5b0839c0f4 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -5544,7 +5544,7 @@ class KX_Camera(KX_GameObject): """ import types attrs = [] -for name, val in __builtins__.locals().items(): +for name, val in locals().items(): if name.startswith('__'): continue if type(val) == types.ClassType: @@ -5554,4 +5554,4 @@ for name, val in __builtins__.locals().items(): for a in attrs: print a -""" \ No newline at end of file +""" -- cgit v1.2.3 From cebf6cb22deb930f5ec235e81c20072bf7154a83 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 16 May 2009 01:00:41 +0000 Subject: NLA SoC: Code for basic evaluation of NLA strips done In theory, actions can now be evaluated in NLA, though in practice, we don't have an NLA Editor to create data to use this yet! Next up, transitions... Some notes: * Recoded the way the 'accumulation' methods work (i.e. blend, add, etc.), adding a few new ones. It should now be more obvious how these work. * Some assorted code cleanups done too (removing unneeded vars/args) --- source/blender/blenkernel/intern/anim_sys.c | 157 ++++++++++++++++++++++++---- 1 file changed, 135 insertions(+), 22 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 5a4a2d91469..702da23ef47 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -735,8 +735,9 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index * - negative influence is not supported yet... how would that be defined? */ // TODO: this sounds a bit hacky having a few isolated F-Curves stuck on some data it operates on... + // TODO: should we clamp the time to only be on the endpoints of the strip? nlastrip_evaluate_controls(estrip, ctime); - if (estrip->influence <= 0.0f) + if (estrip->influence <= 0.0f) // XXX is it useful to invert the strip? return; /* check if strip has valid data to evaluate */ @@ -767,10 +768,36 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index /* ---------------------- */ -/* verify that an appropriate NlaEvalChannel for this F-Curve */ +/* find an NlaEvalChannel that matches the given criteria + * - ptr and prop are the RNA data to find a match for + */ +static NlaEvalChannel *nlaevalchan_find_match (ListBase *channels, PointerRNA *ptr, PropertyRNA *prop, int array_index) +{ + NlaEvalChannel *nec; + + /* sanity check */ + if (channels == NULL) + return NULL; + + /* loop through existing channels, checking for a channel which affects the same property */ + for (nec= channels->first; nec; nec= nec->next) { + /* - comparing the PointerRNA's is done by comparing the pointers + * to the actual struct the property resides in, since that all the + * other data stored in PointerRNA cannot allow us to definitively + * identify the data + */ + if ((nec->ptr.data == ptr->data) && (nec->prop == prop) && (nec->index == array_index)) + return nec; + } + + /* not found */ + return NULL; +} + +/* verify that an appropriate NlaEvalChannel for this F-Curve exists */ static NlaEvalChannel *nlaevalchan_verify (PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes, FCurve *fcu, short *newChan) { - NlaEvalChannel *nec= NULL; + NlaEvalChannel *nec; NlaStrip *strip= nes->strip; PropertyRNA *prop; PointerRNA new_ptr; @@ -785,31 +812,79 @@ static NlaEvalChannel *nlaevalchan_verify (PointerRNA *ptr, ListBase *channels, /* get path, remapped as appropriate to work in its new environment */ free_path= animsys_remap_path(strip->remap, fcu->rna_path, &path); - /* get property to write to */ - if (RNA_path_resolve(ptr, path, &new_ptr, &prop) == 0) + /* a valid property must be available, and it must be animateable */ + if (RNA_path_resolve(ptr, path, &new_ptr, &prop) == 0) { + if (G.f & G_DEBUG) printf("NLA Strip Eval: Cannot resolve path \n"); return NULL; + } /* only ok if animateable */ - else if (RNA_property_animateable(&new_ptr, prop) == 0) + else if (RNA_property_animateable(&new_ptr, prop) == 0) { + if (G.f & G_DEBUG) printf("NLA Strip Eval: Property not animateable \n"); return NULL; - - /* loop through existing channels, checking for a channel which affects the same property */ - for (nec= channels->first; nec; nec= nec->next) { - if ((nec->ptr.data == new_ptr.data) && (nec->prop == prop)) - return nec; } - /* allocate a new struct for this */ - nec= MEM_callocN(sizeof(NlaEvalChannel), "NlaEvalChannel"); - *newChan= 1; - BLI_addtail(channels, nec); + /* try to find a match */ + nec= nlaevalchan_find_match(channels, &new_ptr, prop, fcu->array_index); - nec->ptr= new_ptr; - nec->prop= prop; - nec->index= fcu->array_index; + /* allocate a new struct for this if none found */ + if (nec == NULL) { + nec= MEM_callocN(sizeof(NlaEvalChannel), "NlaEvalChannel"); + *newChan= 1; + BLI_addtail(channels, nec); + + nec->ptr= new_ptr; + nec->prop= prop; + nec->index= fcu->array_index; + } + /* we can now return */ return nec; } +/* accumulate (i.e. blend) the given value on to the channel it affects */ +static void nlaevalchan_accumulate (NlaEvalChannel *nec, NlaEvalStrip *nes, short newChan, float value) +{ + NlaStrip *strip= nes->strip; + float inf= strip->influence; + + /* if channel is new, just store value regardless of blending factors, etc. */ + if (newChan) { + nec->value= value; + return; + } + + /* premultiply the value by the weighting factor */ + if (IS_EQ(inf, 0)) return; + value *= inf; + + /* perform blending */ + switch (strip->blendmode) { + case NLASTRIP_MODE_ADD: + /* simply add the scaled value on to the stack */ + nec->value += value; + break; + + case NLASTRIP_MODE_SUBTRACT: + /* simply subtract the scaled value from the stack */ + nec->value -= value; + break; + + case NLASTRIP_MODE_MULTIPLY: + /* multiply the scaled value with the stack */ + nec->value *= value; + break; + + case NLASTRIP_MODE_BLEND: + default: // TODO: do we really want to blend by default? it seems more uses might prefer add... + /* do linear interpolation + * - the influence of the accumulated data (elsewhere, that is called dstweight) + * is 1 - influence, since the strip's influence is srcweight + */ + nec->value= nec->value * (1.0f - inf) + value; + break; + } +} + /* ---------------------- */ /* evaluate action-clip strip */ @@ -847,8 +922,8 @@ static void nlastrip_evaluate_actionclip (PointerRNA *ptr, ListBase *channels, N * stored in this channel if it has been used already */ nec= nlaevalchan_verify(ptr, channels, nes, fcu, &newChan); - //if (nec) - // nlaevalchan_accumulate(ptr, nec, nes, newChan, value); + if (nec) + nlaevalchan_accumulate(nec, nes, newChan, value); } } @@ -868,9 +943,47 @@ static void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, NlaEvalStrip } /* write the accumulated settings to */ -static void nladata_flush_channels (PointerRNA *ptr, ListBase *channels) +static void nladata_flush_channels (ListBase *channels) { + NlaEvalChannel *nec; + /* sanity checks */ + if (channels == NULL) + return; + + /* for each channel with accumulated values, write its value on the property it affects */ + for (nec= channels->first; nec; nec= nec->next) { + PointerRNA *ptr= &nec->ptr; + PropertyRNA *prop= nec->prop; + int array_index= nec->index; + float value= nec->value; + + /* write values - see animsys_write_rna_setting() to sync the code */ + switch (RNA_property_type(prop)) + { + case PROP_BOOLEAN: + if (RNA_property_array_length(prop)) + RNA_property_boolean_set_index(ptr, prop, array_index, (int)value); + else + RNA_property_boolean_set(ptr, prop, (int)value); + break; + case PROP_INT: + if (RNA_property_array_length(prop)) + RNA_property_int_set_index(ptr, prop, array_index, (int)value); + else + RNA_property_int_set(ptr, prop, (int)value); + break; + case PROP_FLOAT: + if (RNA_property_array_length(prop)) + RNA_property_float_set_index(ptr, prop, array_index, value); + else + RNA_property_float_set(ptr, prop, value); + break; + case PROP_ENUM: + RNA_property_enum_set(ptr, prop, (int)value); + break; + } + } } /* ---------------------- */ @@ -902,7 +1015,7 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime) nlastrip_evaluate(ptr, &echannels, nes); /* 3. flush effects of accumulating channels in NLA to the actual data they affect */ - nladata_flush_channels(ptr, &echannels); + nladata_flush_channels(&echannels); /* 4. free temporary evaluation data */ BLI_freelistN(&estrips); -- cgit v1.2.3 From b063d2f6212d181a9a766b2e1138336a11519463 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 May 2009 06:57:38 +0000 Subject: replace Py_BuildValue("OOO", Py_None, Py_None, Py_None) with a function that makes and fills the tuple, since some scripts call rayCast many times in a single logic tick, contrived benchmark shows this to be about 20% faster. --- source/gameengine/Ketsji/KX_GameObject.cpp | 40 +++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index ae30aeb971c..79519bfb491 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -2509,6 +2509,34 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo, Py_RETURN_NONE; } +/* faster then Py_BuildValue since some scripts call raycast a lot */ +static PyObject *none_tuple_3() +{ + PyObject *ret= PyTuple_New(3); + PyTuple_SET_ITEM(ret, 0, Py_None); + PyTuple_SET_ITEM(ret, 1, Py_None); + PyTuple_SET_ITEM(ret, 2, Py_None); + + Py_INCREF(Py_None); + Py_INCREF(Py_None); + Py_INCREF(Py_None); + return ret; +} +static PyObject *none_tuple_4() +{ + PyObject *ret= PyTuple_New(4); + PyTuple_SET_ITEM(ret, 0, Py_None); + PyTuple_SET_ITEM(ret, 1, Py_None); + PyTuple_SET_ITEM(ret, 2, Py_None); + PyTuple_SET_ITEM(ret, 3, Py_None); + + Py_INCREF(Py_None); + Py_INCREF(Py_None); + Py_INCREF(Py_None); + Py_INCREF(Py_None); + return ret; +} + KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, "rayCast(to,from,dist,prop,face,xray,poly): cast a ray and return 3-tuple (object,hit,normal) or 4-tuple (object,hit,normal,polygon) of contact point with object within dist that matches prop.\n" " If no hit, return (None,None,None) or (None,None,None,None).\n" @@ -2576,12 +2604,14 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, if (dist != 0.0f) { MT_Vector3 toDir = toPoint-fromPoint; if (MT_fuzzyZero(toDir.length2())) { - return Py_BuildValue("OOO", Py_None, Py_None, Py_None); + //return Py_BuildValue("OOO", Py_None, Py_None, Py_None); + return none_tuple_3(); } toDir.normalize(); toPoint = fromPoint + (dist) * toDir; } else if (MT_fuzzyZero((toPoint-fromPoint).length2())) { - return Py_BuildValue("OOO", Py_None, Py_None, Py_None); + //return Py_BuildValue("OOO", Py_None, Py_None, Py_None); + return none_tuple_3(); } PHY_IPhysicsEnvironment* pe = GetPhysicsEnvironment(); @@ -2629,9 +2659,11 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, } // no hit if (poly) - return Py_BuildValue("OOOO", Py_None, Py_None, Py_None, Py_None); + //return Py_BuildValue("OOOO", Py_None, Py_None, Py_None, Py_None); + return none_tuple_4(); else - return Py_BuildValue("OOO", Py_None, Py_None, Py_None); + //return Py_BuildValue("OOO", Py_None, Py_None, Py_None); + return none_tuple_3(); } KX_PYMETHODDEF_DOC_VARARGS(KX_GameObject, sendMessage, -- cgit v1.2.3 From 10ed9a4f6456b32dae1fc5693a2319e8c2ad9692 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 May 2009 13:19:23 +0000 Subject: setting up the BGE Python sys.path for importing modules wasnt working for library paths. --- source/gameengine/Ketsji/KX_PythonInit.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 57f736a6c09..d32f3b1b8a2 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1611,13 +1611,15 @@ static void backupPySysPath(void) static void initPySysPath__append(PyObject *sys_path, char *filename) { PyObject *item; - char expanded[FILE_MAXDIR + FILE_MAXFILE] = "//"; + char expanded[FILE_MAXDIR + FILE_MAXFILE]; - BLI_convertstringcode(expanded, filename); + BLI_split_dirfile_basic(filename, expanded, NULL); /* get the dir part of filename only */ + BLI_convertstringcode(expanded, gp_GamePythonPath); item= PyString_FromString(expanded); if(PySequence_Index(sys_path, item) == -1) { + PyErr_Clear(); /* PySequence_Index sets a ValueError */ PyList_Insert(sys_path, 0, item); } -- cgit v1.2.3 From d1f71a34564bc594d1d2f2641459c24c70ba8fec Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Sat, 16 May 2009 21:16:04 +0000 Subject: Bugfix: Changing ShadowBufferSize didn't update 3d view - reported by nudelZ via IRC (simple update call was missing) --- source/blender/src/buttons_shading.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index a129698cce3..79f95d1bf5f 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -2447,7 +2447,8 @@ void do_lampbuts(unsigned short event) break; case B_SBUFF: la= G.buts->lockpoin; - la->bufsize = la->bufsize&=(~15); + la->bufsize = la->bufsize&=(~15); + BIF_preview_changed(ID_LA); allqueue(REDRAWBUTSSHADING, 0); allqueue(REDRAWOOPS, 0); break; -- cgit v1.2.3 From cd3e447bb88ab72508fd7fc3b3221c6f42312905 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Sat, 16 May 2009 23:47:17 +0000 Subject: Same tooltip whether snap button is press or not (it used to have a different one when turned on). --- source/blender/src/header_view3d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index 6d72e434e67..cee20a57462 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -5848,7 +5848,7 @@ void view3d_buttons(void) uiBlockBeginAlign(block); if (G.scene->snap_flag & SCE_SNAP) { - uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEO,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Use Snap or Grid (Shift Tab)"); + uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEO,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)"); xco+= XIC; uiDefIconButBitS(block, TOG, SCE_SNAP_ROTATE, B_REDR, ICON_SNAP_NORMAL,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Align rotation with the snapping target"); xco+= XIC; -- cgit v1.2.3 From 6dad6bb9bf3a280b228cbd04d9180a35534afefb Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 17 May 2009 09:56:48 +0000 Subject: Bugfix #18756 Texture nodes: on file load, the preview render signal was ignored. Found out it ignores it all the way, inserting refreshes all over, not using the 'afterqueue'. Will live with that for now, in 2.5 it's nicer supported anyway. Just added another refresh line on the proper signal to make it look nice on file loads. --- source/blender/src/editnode.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/src/editnode.c b/source/blender/src/editnode.c index f0046a960e9..cfda82c055e 100644 --- a/source/blender/src/editnode.c +++ b/source/blender/src/editnode.c @@ -180,7 +180,7 @@ static void snode_handle_recalc(SpaceNode *snode) allqueue(REDRAWNODE, 1); } else if(snode->treetype==NTREE_TEXTURE) { - ntreeTexUpdatePreviews(snode->nodetree); + ntreeTexUpdatePreviews(snode->nodetree);/* XXX texture nodes should follow shader node methods (ton) */ BIF_preview_changed(ID_TE); } } @@ -550,7 +550,7 @@ void node_texture_default(Tex *tx) nodeAddLink(tx->nodetree, in, fromsock, out, tosock); ntreeSolveOrder(tx->nodetree); /* needed for pointers */ - ntreeTexUpdatePreviews(tx->nodetree); + ntreeTexUpdatePreviews(tx->nodetree);/* XXX texture nodes should follow shader node methods (ton) */ } /* Here we set the active tree(s), even called for each redraw now, so keep it fast :) */ @@ -1301,7 +1301,7 @@ static void scale_node(SpaceNode *snode, bNode *node) allqueue(REDRAWNODE, 1); if(snode->nodetree->type == NTREE_TEXTURE) - ntreeTexUpdatePreviews(snode->nodetree); + ntreeTexUpdatePreviews(snode->nodetree);/* XXX texture nodes should follow shader node methods (ton) */ } /* ******************** rename ******************* */ @@ -1819,7 +1819,7 @@ bNode *node_add_node(SpaceNode *snode, int type, float locx, float locy) if(snode->nodetree->type==NTREE_TEXTURE) { ntreeTexCheckCyclics(snode->edittree); - ntreeTexUpdatePreviews(snode->edittree); + ntreeTexUpdatePreviews(snode->edittree);/* XXX texture nodes should follow shader node methods (ton) */ } return node; @@ -2608,6 +2608,9 @@ void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt) case RENDERPREVIEW: if(snode->treetype==NTREE_SHADER) shader_node_previewrender(sa, snode); + else if(snode->nodetree->type==NTREE_TEXTURE) + ntreeTexUpdatePreviews(snode->edittree); /* XXX texture nodes should follow shader node methods (ton) */ + break; case PADPLUSKEY: -- cgit v1.2.3 From d4116adf11678726a5af5f544a12b194ef2fbcb9 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 17 May 2009 10:30:13 +0000 Subject: Bugfix #18676 Texture "map to" Ambient did work now (previous fix) but not for ambient occlusion yet. --- source/blender/render/intern/source/shadeoutput.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 4c627056c1d..869cca0f7d0 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -1007,9 +1007,9 @@ static void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec) /* pure AO, check for raytrace and world should have been done */ void ambient_occlusion(ShadeInput *shi) { - if((R.wrld.ao_gather_method == WO_AOGATHER_APPROX) && shi->mat->amb!=0.0f) + if((R.wrld.ao_gather_method == WO_AOGATHER_APPROX) && shi->amb!=0.0f) sample_occ(&R, shi); - else if((R.r.mode & R_RAYTRACE) && shi->mat->amb!=0.0f) + else if((R.r.mode & R_RAYTRACE) && shi->amb!=0.0f) ray_ao(shi, shi->ao); else shi->ao[0]= shi->ao[1]= shi->ao[2]= 1.0f; @@ -1020,8 +1020,8 @@ void ambient_occlusion(ShadeInput *shi) void ambient_occlusion_to_diffuse(ShadeInput *shi, float *diff) { if((R.r.mode & R_RAYTRACE) || R.wrld.ao_gather_method == WO_AOGATHER_APPROX) { - if(shi->mat->amb!=0.0f) { - float f= R.wrld.aoenergy*shi->mat->amb; + if(shi->amb!=0.0f) { + float f= R.wrld.aoenergy*shi->amb; if (R.wrld.aomix==WO_AOADDSUB) { diff[0] = 2.0f*shi->ao[0]-1.0f; -- cgit v1.2.3 From 96aa60cee36dfb8a98501b6b9d4c88222b909c35 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 17 May 2009 12:25:06 +0000 Subject: cmake: apply ADD_SUBDIR patch. --- source/CMakeLists.txt | 7 +++--- source/blender/CMakeLists.txt | 25 ++++++++++++++++---- source/blender/blenkernel/CMakeLists.txt | 2 +- source/blender/makesdna/CMakeLists.txt | 2 +- source/gameengine/CMakeLists.txt | 36 ++++++++++++++--------------- source/gameengine/GamePlayer/CMakeLists.txt | 5 ++-- 6 files changed, 46 insertions(+), 31 deletions(-) (limited to 'source') diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 04566ec3b0b..4764caddf6a 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -24,12 +24,13 @@ # # ***** END GPL LICENSE BLOCK ***** -SUBDIRS(blender kernel) +ADD_SUBDIRECTORY(blender) +ADD_SUBDIRECTORY(kernel) IF(WITH_GAMEENGINE) - SUBDIRS(gameengine) + ADD_SUBDIRECTORY(gameengine) ENDIF(WITH_GAMEENGINE) IF(WINDOWS) - SUBDIRS(icons) + ADD_SUBDIRECTORY(icons) ENDIF(WINDOWS) diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt index 007ee34e4e7..f65163ce26c 100644 --- a/source/blender/CMakeLists.txt +++ b/source/blender/CMakeLists.txt @@ -24,20 +24,35 @@ # # ***** END GPL LICENSE BLOCK ***** -SUBDIRS(avi nodes blenkernel blenlib blenloader blenpluginapi imbuf imbuf/intern/cineon gpu makesdna python radiosity readblenfile render src yafray) +ADD_SUBDIRECTORY(avi) +ADD_SUBDIRECTORY(nodes) +ADD_SUBDIRECTORY(blenkernel) +ADD_SUBDIRECTORY(blenlib) +ADD_SUBDIRECTORY(blenloader) +ADD_SUBDIRECTORY(blenpluginapi) +ADD_SUBDIRECTORY(imbuf) +ADD_SUBDIRECTORY(imbuf/intern/cineon) +ADD_SUBDIRECTORY(gpu) +ADD_SUBDIRECTORY(makesdna) +ADD_SUBDIRECTORY(python) +ADD_SUBDIRECTORY(radiosity) +ADD_SUBDIRECTORY(readblenfile) +ADD_SUBDIRECTORY(render) +ADD_SUBDIRECTORY(src) +ADD_SUBDIRECTORY(yafray) IF(WITH_INTERNATIONAL) - SUBDIRS(ftfont) + ADD_SUBDIRECTORY(ftfont) ENDIF(WITH_INTERNATIONAL) IF(WITH_OPENEXR) - SUBDIRS(imbuf/intern/openexr) + ADD_SUBDIRECTORY(imbuf/intern/openexr) ENDIF(WITH_OPENEXR) IF(WITH_DDS) - SUBDIRS(imbuf/intern/dds) + ADD_SUBDIRECTORY(imbuf/intern/dds) ENDIF(WITH_DDS) IF(WITH_QUICKTIME) - SUBDIRS(quicktime) + ADD_SUBDIRECTORY(quicktime) ENDIF(WITH_QUICKTIME) diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 27be1b45779..3a8058b2b21 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -66,7 +66,7 @@ IF(WITH_FFMPEG) ENDIF(WITH_FFMPEG) IF(WITH_PLAYER) - SUBDIRS(bad_level_call_stubs) + ADD_SUBDIRECTORY(bad_level_call_stubs) ENDIF(WITH_PLAYER) BLENDERLIB(bf_blenkernel "${SRC}" "${INC}") diff --git a/source/blender/makesdna/CMakeLists.txt b/source/blender/makesdna/CMakeLists.txt index a1afa37e5e6..1f8ab831ba6 100644 --- a/source/blender/makesdna/CMakeLists.txt +++ b/source/blender/makesdna/CMakeLists.txt @@ -24,4 +24,4 @@ # # ***** END GPL LICENSE BLOCK ***** -SUBDIRS(intern) +ADD_SUBDIRECTORY(intern) diff --git a/source/gameengine/CMakeLists.txt b/source/gameengine/CMakeLists.txt index 3ea788791e2..fd05858710d 100644 --- a/source/gameengine/CMakeLists.txt +++ b/source/gameengine/CMakeLists.txt @@ -24,25 +24,23 @@ # # ***** END GPL LICENSE BLOCK ***** -SUBDIRS( - BlenderRoutines - Converter - Expressions - GameLogic - Ketsji - Ketsji/KXNetwork - Network - Network/LoopBackNetwork - Physics/common - Physics/Dummy - Rasterizer - Rasterizer/RAS_OpenGLRasterizer - SceneGraph - Physics/Bullet - Physics/Sumo - VideoTexture -) +ADD_SUBDIRECTORY(BlenderRoutines) +ADD_SUBDIRECTORY(Converter) +ADD_SUBDIRECTORY(Expressions) +ADD_SUBDIRECTORY(GameLogic) +ADD_SUBDIRECTORY(Ketsji) +ADD_SUBDIRECTORY(Ketsji/KXNetwork) +ADD_SUBDIRECTORY(Network) +ADD_SUBDIRECTORY(Network/LoopBackNetwork) +ADD_SUBDIRECTORY(Physics/common) +ADD_SUBDIRECTORY(Physics/Dummy) +ADD_SUBDIRECTORY(Rasterizer) +ADD_SUBDIRECTORY(Rasterizer/RAS_OpenGLRasterizer) +ADD_SUBDIRECTORY(SceneGraph) +ADD_SUBDIRECTORY(Physics/Bullet) +ADD_SUBDIRECTORY(Physics/Sumo) +ADD_SUBDIRECTORY(VideoTexture) IF(WITH_PLAYER) - SUBDIRS(GamePlayer) + ADD_SUBDIRECTORY(GamePlayer) ENDIF(WITH_PLAYER) diff --git a/source/gameengine/GamePlayer/CMakeLists.txt b/source/gameengine/GamePlayer/CMakeLists.txt index fc5912155cf..134f8fce3b2 100644 --- a/source/gameengine/GamePlayer/CMakeLists.txt +++ b/source/gameengine/GamePlayer/CMakeLists.txt @@ -24,8 +24,9 @@ # # ***** END GPL LICENSE BLOCK ***** -SUBDIRS(common ghost) +ADD_SUBDIRECTORY(common) +ADD_SUBDIRECTORY(ghost) IF(WITH_WEBPLUGIN) - SUBDIRS(xembed) + ADD_SUBDIRECTORY(xembed) ENDIF(WITH_WEBPLUGIN) -- cgit v1.2.3 From 3ea1c1b4b640b18e651de7eacb40bb7cc7a2f55f Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 17 May 2009 12:51:51 +0000 Subject: BGE: new sensor object to generalize Near and Radar sensor, static-static collision capbility. A new type of "Sensor" physics object is available in the GE for advanced collision management. It's called Sensor for its similarities with the physics objects that underlie the Near and Radar sensors. Like the Near and Radar object it is: - static and ghost - invisible by default - always active to ensure correct collision detection - capable of detecting both static and dynamic objects - ignoring collision with their parent - capable of broadphase filtering based on: * Actor option: the collisioning object must have the Actor flag set to be detected * property/material: as specified in the collision sensors attached to it Broadphase filtering is important for performance reason: the collision points will be computed only for the objects that pass the broahphase filter. - automatically removed from the simulation when no collision sensor is active on it Unlike the Near and Radar object it can: - take any shape, including triangle mesh - be made visible for debugging (just use the Visible actuator) - have multiple collision sensors using it Other than that, the sensor objects are ordinary objects. You can move them freely or parent them. When parented to a dynamic object, they can provide advanced collision control to this object. The type of collision capability depends on the shape: - box, sphere, cylinder, cone, convex hull provide volume detection. - triangle mesh provides surface detection but you can give some volume to the suface by increasing the margin in the Advanced Settings panel. The margin applies on both sides of the surface. Performance tip: - Sensor objects perform better than Near and Radar: they do less synchronizations because of the Scenegraph optimizations and they can have multiple collision sensors on them (with different property filtering for example). - Always prefer simple shape (box, sphere) to complex shape whenever possible. - Always use broadphase filtering (avoid collision sensor with empty propery/material) - Use collision sensor only when you need them. When no collision sensor is active on the sensor object, it is removed from the simulation and consume no CPU. Known limitations: - When running Blender in debug mode, you will see one warning line of the console: "warning btCollisionDispatcher::needsCollision: static-static collision!" In release mode this message is not printed. - Collision margin has no effect on sphere, cone and cylinder shape. Other performance improvements: - Remove unnecessary interpolation for Near and Radar objects and by extension sensor objects. - Use direct matrix copy instead of quaternion to synchronize orientation. Other bug fix: - Fix Near/Radar position error on newly activated objects. This was causing several detection problems in YoFrankie - Fix margin not passed correctly to gImpact shape. - Disable force/velocity actions on static objects --- source/blender/makesdna/DNA_object_types.h | 2 + source/blender/python/api2_2x/Object.c | 3 +- source/blender/src/buttons_logic.c | 82 ++++++--- .../Converter/BL_BlenderDataConversion.cpp | 1 + source/gameengine/GameLogic/SCA_ISensor.h | 11 ++ .../Ketsji/KX_BulletPhysicsController.cpp | 24 ++- .../gameengine/Ketsji/KX_BulletPhysicsController.h | 3 +- source/gameengine/Ketsji/KX_ClientObjectInfo.h | 5 +- source/gameengine/Ketsji/KX_ConvertPhysicsObject.h | 1 + .../gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 54 ++++-- source/gameengine/Ketsji/KX_GameObject.cpp | 26 ++- source/gameengine/Ketsji/KX_GameObject.h | 9 +- source/gameengine/Ketsji/KX_IPhysicsController.cpp | 3 +- source/gameengine/Ketsji/KX_IPhysicsController.h | 12 +- source/gameengine/Ketsji/KX_MotionState.cpp | 5 + source/gameengine/Ketsji/KX_MotionState.h | 1 + source/gameengine/Ketsji/KX_NearSensor.cpp | 35 ++-- source/gameengine/Ketsji/KX_NearSensor.h | 4 +- source/gameengine/Ketsji/KX_OdePhysicsController.h | 1 + source/gameengine/Ketsji/KX_RadarSensor.cpp | 21 +-- source/gameengine/Ketsji/KX_RadarSensor.h | 2 +- source/gameengine/Ketsji/KX_Scene.cpp | 4 +- .../gameengine/Ketsji/KX_SumoPhysicsController.h | 3 +- source/gameengine/Ketsji/KX_TouchEventManager.cpp | 34 +++- source/gameengine/Ketsji/KX_TouchSensor.cpp | 58 +++++- source/gameengine/Ketsji/KX_TouchSensor.h | 3 +- .../Physics/BlOde/OdePhysicsController.cpp | 5 +- .../Physics/BlOde/OdePhysicsController.h | 1 + .../Physics/BlOde/OdePhysicsEnvironment.h | 4 +- .../Physics/Bullet/CcdPhysicsController.cpp | 199 ++++++++++++--------- .../Physics/Bullet/CcdPhysicsController.h | 14 +- .../Physics/Bullet/CcdPhysicsEnvironment.cpp | 87 ++------- .../Physics/Bullet/CcdPhysicsEnvironment.h | 4 +- .../Physics/Dummy/DummyPhysicsEnvironment.h | 4 +- .../Physics/Sumo/SumoPhysicsController.cpp | 5 + .../Physics/Sumo/SumoPhysicsController.h | 1 + .../Physics/Sumo/SumoPhysicsEnvironment.cpp | 7 +- .../Physics/Sumo/SumoPhysicsEnvironment.h | 4 +- .../gameengine/Physics/common/PHY_IMotionState.h | 2 + .../Physics/common/PHY_IPhysicsController.h | 3 +- .../Physics/common/PHY_IPhysicsEnvironment.h | 4 +- source/gameengine/SceneGraph/SG_IObject.h | 7 + source/gameengine/SceneGraph/SG_Spatial.h | 7 + 43 files changed, 464 insertions(+), 301 deletions(-) (limited to 'source') diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 82da883df4a..9121f38be16 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -440,6 +440,7 @@ extern Object workob; #define OB_COLLISION 65536 #define OB_SOFT_BODY 0x20000 #define OB_OCCLUDER 0x40000 +#define OB_SENSOR 0x80000 /* ob->gameflag2 */ #define OB_NEVER_DO_ACTIVITY_CULLING 1 @@ -459,6 +460,7 @@ extern Object workob; #define OB_BODY_TYPE_RIGID 3 #define OB_BODY_TYPE_SOFT 4 #define OB_BODY_TYPE_OCCLUDER 5 +#define OB_BODY_TYPE_SENSOR 6 /* ob->scavisflag */ #define OB_VIS_SENS 1 diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index 2de2906335f..c3f7a21a7bf 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -3562,7 +3562,7 @@ static int Object_setRBMass( BPy_Object * self, PyObject * args ) /* this is too low level, possible to add helper methods */ #define GAMEFLAG_MASK ( OB_OCCLUDER | OB_COLLISION | OB_DYNAMIC | OB_CHILD | OB_ACTOR | OB_DO_FH | \ - OB_ROT_FH | OB_ANISOTROPIC_FRICTION | OB_GHOST | OB_RIGID_BODY | OB_SOFT_BODY | \ + OB_ROT_FH | OB_ANISOTROPIC_FRICTION | OB_GHOST | OB_RIGID_BODY | OB_SOFT_BODY | OB_SENSOR | \ OB_BOUNDS | OB_COLLISION_RESPONSE | OB_SECTOR | OB_PROP | \ OB_MAINACTOR ) @@ -5544,6 +5544,7 @@ static PyObject *M_Object_RBFlagsDict( void ) BPy_constant *d = ( BPy_constant * ) M; PyConstant_Insert( d, "OCCLUDER", PyInt_FromLong( OB_OCCLUDER ) ); PyConstant_Insert( d, "COLLISION", PyInt_FromLong( OB_COLLISION ) ); + PyConstant_Insert( d, "SENSOR", PyInt_FromLong( OB_SENSOR ) ); PyConstant_Insert( d, "DYNAMIC", PyInt_FromLong( OB_DYNAMIC ) ); PyConstant_Insert( d, "CHILD", PyInt_FromLong( OB_CHILD ) ); PyConstant_Insert( d, "ACTOR", PyInt_FromLong( OB_ACTOR ) ); diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index dccbc73787d..a537d32feae 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -3064,29 +3064,33 @@ static void check_body_type(void *arg1_but, void *arg2_object) Object *ob = arg2_object; switch (ob->body_type) { + case OB_BODY_TYPE_SENSOR: + ob->gameflag |= OB_SENSOR|OB_COLLISION|OB_GHOST; + ob->gameflag &= ~(OB_OCCLUDER|OB_DYNAMIC|OB_RIGID_BODY|OB_ACTOR|OB_ANISOTROPIC_FRICTION|OB_DO_FH|OB_ROT_FH|OB_COLLISION_RESPONSE); + break; case OB_BODY_TYPE_OCCLUDER: ob->gameflag |= OB_OCCLUDER; - ob->gameflag &= ~(OB_COLLISION|OB_DYNAMIC); + ob->gameflag &= ~(OB_SENSOR|OB_COLLISION|OB_DYNAMIC); break; case OB_BODY_TYPE_NO_COLLISION: - ob->gameflag &= ~(OB_COLLISION|OB_OCCLUDER|OB_DYNAMIC); + ob->gameflag &= ~(OB_SENSOR|OB_COLLISION|OB_OCCLUDER|OB_DYNAMIC); break; case OB_BODY_TYPE_STATIC: ob->gameflag |= OB_COLLISION; - ob->gameflag &= ~(OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY|OB_OCCLUDER); + ob->gameflag &= ~(OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY|OB_OCCLUDER|OB_SENSOR); break; case OB_BODY_TYPE_DYNAMIC: ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_ACTOR; - ob->gameflag &= ~(OB_RIGID_BODY|OB_SOFT_BODY|OB_OCCLUDER); + ob->gameflag &= ~(OB_RIGID_BODY|OB_SOFT_BODY|OB_OCCLUDER|OB_SENSOR); break; case OB_BODY_TYPE_RIGID: ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_RIGID_BODY|OB_ACTOR; - ob->gameflag &= ~(OB_SOFT_BODY|OB_OCCLUDER); + ob->gameflag &= ~(OB_SOFT_BODY|OB_OCCLUDER|OB_SENSOR); break; default: case OB_BODY_TYPE_SOFT: ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_SOFT_BODY|OB_ACTOR; - ob->gameflag &= ~(OB_RIGID_BODY|OB_OCCLUDER); + ob->gameflag &= ~(OB_RIGID_BODY|OB_OCCLUDER|OB_SENSOR); /* assume triangle mesh, if no bounds chosen for soft body */ if ((ob->gameflag & OB_BOUNDS) && (ob->boundtypegameflag & OB_COLLISION)) - ob->body_type = (ob->gameflag & OB_OCCLUDER) ? OB_BODY_TYPE_OCCLUDER : OB_BODY_TYPE_NO_COLLISION; - else if (!(ob->gameflag & OB_DYNAMIC)) + if (!(ob->gameflag & OB_COLLISION)) { + if (ob->gameflag & OB_OCCLUDER) { + tip = "Occluder"; + ob->body_type = OB_BODY_TYPE_OCCLUDER; + } else { + tip = "Disable colision for this object"; + ob->body_type = OB_BODY_TYPE_NO_COLLISION; + } + } else if (ob->gameflag & OB_SENSOR) { + tip = "Collision Sensor, detects static and dynamic objects but not the other collision sensor objects"; + ob->body_type = OB_BODY_TYPE_SENSOR; + } else if (!(ob->gameflag & OB_DYNAMIC)) { + tip = "Static"; ob->body_type = OB_BODY_TYPE_STATIC; - else if (!(ob->gameflag & (OB_RIGID_BODY|OB_SOFT_BODY))) + } else if (!(ob->gameflag & (OB_RIGID_BODY|OB_SOFT_BODY))) { + tip = "Dynamic"; ob->body_type = OB_BODY_TYPE_DYNAMIC; - else if (ob->gameflag & OB_RIGID_BODY) + } else if (ob->gameflag & OB_RIGID_BODY) { + tip = "Rigid body"; ob->body_type = OB_BODY_TYPE_RIGID; - else { + } else { + tip = "Soft body"; ob->body_type = OB_BODY_TYPE_SOFT; /* create the structure here because we display soft body buttons in the main panel */ if (!ob->bsoft) @@ -3292,28 +3310,36 @@ static void buttons_bullet(uiBlock *block, Object *ob) //only enable game soft body if Blender Soft Body exists but = uiDefButS(block, MENU, REDRAWVIEW3D, - "Object type%t|Occluder%x5|No collision%x0|Static%x1|Dynamic%x2|Rigid body%x3|Soft body%x4", - 10, 205, 100, 19, &ob->body_type, 0, 0, 0, 0, "Selects the type of physical representation"); + "Object type%t|Occluder%x5|No collision%x0|Sensor%x6|Static%x1|Dynamic%x2|Rigid body%x3|Soft body%x4", + 10, 205, 100, 19, &ob->body_type, 0, 0, 0, 0, tip); uiButSetFunc(but, check_body_type, but, ob); if (ob->gameflag & OB_COLLISION) { - uiDefButBitI(block, TOG, OB_ACTOR, 0, "Actor", - 110, 205, 50, 19, &ob->gameflag, 0, 0, 0, 0, - "Objects that are detected by the Near and Radar sensor"); + if (ob->gameflag & OB_SENSOR) { + uiBlockEndAlign(block); + uiDefBlockBut(block, advanced_bullet_menu, ob, + "Advanced Settings", + 210, 205, 140, 19, "Display collision advanced settings"); + uiBlockBeginAlign(block); + } else { + uiDefButBitI(block, TOG, OB_ACTOR, 0, "Actor", + 110, 205, 50, 19, &ob->gameflag, 0, 0, 0, 0, + "Objects that are detected by the Near and Radar sensor and the collision sensor objects"); - + - uiDefButBitI(block, TOG, OB_GHOST, B_REDR, "Ghost", - 160,205,50,19, - &ob->gameflag, 0, 0, 0, 0, - "Objects that don't restitute collisions (like a ghost)"); + uiDefButBitI(block, TOG, OB_GHOST, B_REDR, "Ghost", + 160,205,50,19, + &ob->gameflag, 0, 0, 0, 0, + "Objects that don't restitute collisions (like a ghost)"); - //uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefBlockBut(block, advanced_bullet_menu, ob, - "Advanced Settings", - 210, 205, 140, 19, "Display collision advanced settings"); - //uiBlockSetCol(block, TH_BUT_SETTING2); + //uiBlockSetCol(block, TH_BUT_SETTING1); + uiDefBlockBut(block, advanced_bullet_menu, ob, + "Advanced Settings", + 210, 205, 140, 19, "Display collision advanced settings"); + //uiBlockSetCol(block, TH_BUT_SETTING2); + } if(ob->gameflag & OB_DYNAMIC) { @@ -3394,7 +3420,7 @@ static void buttons_bullet(uiBlock *block, Object *ob) /* In Bullet, anisotripic friction can be applied to static objects as well, just not soft bodies */ - if (!(ob->gameflag & OB_SOFT_BODY)) + if (!(ob->gameflag & (OB_SOFT_BODY|OB_SENSOR))) { uiDefButBitI(block, TOG, OB_ANISOTROPIC_FRICTION, B_REDR, "Anisotropic", 230, 145, 120, 19, diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 9ea623f17e4..d4cc047d5e3 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1413,6 +1413,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, objprop.m_dyna = (blenderobject->gameflag & OB_DYNAMIC) != 0; objprop.m_softbody = (blenderobject->gameflag & OB_SOFT_BODY) != 0; objprop.m_angular_rigidbody = (blenderobject->gameflag & OB_RIGID_BODY) != 0; + objprop.m_sensor = (blenderobject->gameflag & OB_SENSOR) != 0; if (objprop.m_softbody) { diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index 9aeda728caf..ad8865299d6 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -91,6 +91,15 @@ protected: std::vector m_linkedcontrollers; public: + + enum sensortype { + NONE = 0, + TOUCH, + NEAR, + RADAR, + // to be updated as needed + }; + SCA_ISensor(SCA_IObject* gameobj, class SCA_EventManager* eventmgr, PyTypeObject* T );; @@ -138,6 +147,8 @@ public: virtual double GetNumber(); + virtual sensortype GetSensorType() { return NONE; } + /** Stop sensing for a while. */ void Suspend(); diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp index 300a7906e81..e22edfd1306 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp @@ -17,8 +17,8 @@ #include "BulletSoftBody/btSoftBody.h" -KX_BulletPhysicsController::KX_BulletPhysicsController (const CcdConstructionInfo& ci, bool dyna, bool compound) -: KX_IPhysicsController(dyna,compound,(PHY_IPhysicsController*)this), +KX_BulletPhysicsController::KX_BulletPhysicsController (const CcdConstructionInfo& ci, bool dyna, bool sensor, bool compound) +: KX_IPhysicsController(dyna,sensor,compound,(PHY_IPhysicsController*)this), CcdPhysicsController(ci), m_savedCollisionFlags(0), m_savedCollisionFilterGroup(0), @@ -174,6 +174,20 @@ void KX_BulletPhysicsController::setScaling(const MT_Vector3& scaling) { CcdPhysicsController::setScaling(scaling.x(),scaling.y(),scaling.z()); } +void KX_BulletPhysicsController::SetTransform() +{ + btVector3 pos; + btVector3 scale; + float ori[12]; + m_MotionState->getWorldPosition(pos.m_floats[0],pos.m_floats[1],pos.m_floats[2]); + m_MotionState->getWorldScaling(scale.m_floats[0],scale.m_floats[1],scale.m_floats[2]); + m_MotionState->getWorldOrientation(ori); + btMatrix3x3 rot(ori[0], ori[4], ori[8], + ori[1], ori[5], ori[9], + ori[2], ori[6], ori[10]); + CcdPhysicsController::forceWorldTransform(rot, pos); +} + MT_Scalar KX_BulletPhysicsController::GetMass() { if (GetSoftBody()) @@ -262,7 +276,7 @@ void KX_BulletPhysicsController::AddCompoundChild(KX_IPhysicsController* chil // add to parent compound shapeinfo GetShapeInfo()->AddShape(proxyShapeInfo); // create new bullet collision shape from the object shapeinfo and set scaling - btCollisionShape* newChildShape = proxyShapeInfo->CreateBulletShape(); + btCollisionShape* newChildShape = proxyShapeInfo->CreateBulletShape(childCtrl->GetMargin()); newChildShape->setLocalScaling(relativeScale); // add bullet collision shape to parent compound collision shape compoundShape->addChildShape(proxyShapeInfo->m_childTrans,newChildShape); @@ -359,7 +373,7 @@ void KX_BulletPhysicsController::SetMass(MT_Scalar newmass) void KX_BulletPhysicsController::SuspendDynamics(bool ghost) { btRigidBody *body = GetRigidBody(); - if (body && !m_suspended) + if (body && !m_suspended && !IsSensor()) { btBroadphaseProxy* handle = body->getBroadphaseHandle(); m_savedCollisionFlags = body->getCollisionFlags(); @@ -445,7 +459,7 @@ SG_Controller* KX_BulletPhysicsController::GetReplica(class SG_Node* destnode) void KX_BulletPhysicsController::SetSumoTransform(bool nondynaonly) { - if (!m_bDyna) + if (!m_bDyna && !m_bSensor) { btCollisionObject* object = GetRigidBody(); object->setActivationState(ACTIVE_TAG); diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h index 9d2afad1a5c..755b1cbd780 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h @@ -19,7 +19,7 @@ private: public: - KX_BulletPhysicsController (const CcdConstructionInfo& ci, bool dyna, bool compound); + KX_BulletPhysicsController (const CcdConstructionInfo& ci, bool dyna, bool sensor, bool compound); virtual ~KX_BulletPhysicsController (); /////////////////////////////////// @@ -42,6 +42,7 @@ public: virtual void setOrientation(const MT_Matrix3x3& orn); virtual void setPosition(const MT_Point3& pos); virtual void setScaling(const MT_Vector3& scaling); + virtual void SetTransform(); virtual MT_Scalar GetMass(); virtual void SetMass(MT_Scalar newmass); virtual MT_Vector3 GetLocalInertia(); diff --git a/source/gameengine/Ketsji/KX_ClientObjectInfo.h b/source/gameengine/Ketsji/KX_ClientObjectInfo.h index 7345edb054b..74d463fbf20 100644 --- a/source/gameengine/Ketsji/KX_ClientObjectInfo.h +++ b/source/gameengine/Ketsji/KX_ClientObjectInfo.h @@ -50,8 +50,8 @@ struct KX_ClientObjectInfo STATIC, ACTOR, RESERVED1, - RADAR, - NEAR + SENSOR, + OBSENSOR } m_type; KX_GameObject* m_gameobject; void* m_auxilary_info; @@ -84,6 +84,7 @@ public: } bool isActor() { return m_type <= ACTOR; } + bool isSensor() { return m_type >= SENSOR && m_type <= OBSENSOR; } }; #endif //__KX_CLIENTOBJECT_INFO_H diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h b/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h index 5b912a123fe..e48fddb30bd 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h @@ -83,6 +83,7 @@ struct KX_ObjectProperties bool m_ghost; class KX_GameObject* m_dynamic_parent; bool m_isactor; + bool m_sensor; bool m_concave; bool m_isdeformable; bool m_disableSleeping; diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index f18ffb56ccb..73693e68642 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -808,12 +808,12 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, bool isbulletdyna = false; + bool isbulletsensor = false; CcdConstructionInfo ci; class PHY_IMotionState* motionstate = new KX_MotionState(gameobj->GetSGNode()); class CcdShapeConstructionInfo *shapeInfo = new CcdShapeConstructionInfo(); - if (!objprop->m_dyna) { ci.m_collisionFlags |= btCollisionObject::CF_STATIC_OBJECT; @@ -832,6 +832,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, ci.m_margin = objprop->m_margin; shapeInfo->m_radius = objprop->m_radius; isbulletdyna = objprop->m_dyna; + isbulletsensor = objprop->m_sensor; ci.m_localInertiaTensor = btVector3(ci.m_mass/3.f,ci.m_mass/3.f,ci.m_mass/3.f); @@ -851,7 +852,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, //bm = new MultiSphereShape(inertiaHalfExtents,,&trans.getOrigin(),&radius,1); shapeInfo->m_shapeType = PHY_SHAPE_SPHERE; - bm = shapeInfo->CreateBulletShape(); + bm = shapeInfo->CreateBulletShape(ci.m_margin); break; }; case KX_BOUNDBOX: @@ -864,7 +865,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, shapeInfo->m_halfExtend /= 2.0; shapeInfo->m_halfExtend = shapeInfo->m_halfExtend.absolute(); shapeInfo->m_shapeType = PHY_SHAPE_BOX; - bm = shapeInfo->CreateBulletShape(); + bm = shapeInfo->CreateBulletShape(ci.m_margin); break; }; case KX_BOUNDCYLINDER: @@ -875,7 +876,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, objprop->m_boundobject.c.m_height * 0.5f ); shapeInfo->m_shapeType = PHY_SHAPE_CYLINDER; - bm = shapeInfo->CreateBulletShape(); + bm = shapeInfo->CreateBulletShape(ci.m_margin); break; } @@ -884,18 +885,18 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, shapeInfo->m_radius = objprop->m_boundobject.c.m_radius; shapeInfo->m_height = objprop->m_boundobject.c.m_height; shapeInfo->m_shapeType = PHY_SHAPE_CONE; - bm = shapeInfo->CreateBulletShape(); + bm = shapeInfo->CreateBulletShape(ci.m_margin); break; } case KX_BOUNDPOLYTOPE: { shapeInfo->SetMesh(meshobj, dm,true,false); - bm = shapeInfo->CreateBulletShape(); + bm = shapeInfo->CreateBulletShape(ci.m_margin); break; } case KX_BOUNDMESH: { - bool useGimpact = (ci.m_mass && !objprop->m_softbody); + bool useGimpact = ((ci.m_mass || isbulletsensor) && !objprop->m_softbody); // mesh shapes can be shared, check first if we already have a shape on that mesh class CcdShapeConstructionInfo *sharedShapeInfo = CcdShapeConstructionInfo::FindMesh(meshobj, dm, false,useGimpact); @@ -915,7 +916,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, shapeInfo->setVertexWeldingThreshold1(objprop->m_soft_welding); //todo: expose this to the UI } - bm = shapeInfo->CreateBulletShape(); + bm = shapeInfo->CreateBulletShape(ci.m_margin); //should we compute inertia for dynamic shape? //bm->calculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor); @@ -933,7 +934,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, return; } - bm->setMargin(ci.m_margin); + //bm->setMargin(ci.m_margin); if (objprop->m_isCompoundChild) @@ -1103,26 +1104,39 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, ci.m_soft_numclusteriterations= objprop->m_soft_numclusteriterations; /* number of iterations to refine collision clusters*/ //////////////////// - - ci.m_collisionFilterGroup = (isbulletdyna) ? short(CcdConstructionInfo::DefaultFilter) : short(CcdConstructionInfo::StaticFilter); - ci.m_collisionFilterMask = (isbulletdyna) ? short(CcdConstructionInfo::AllFilter) : short(CcdConstructionInfo::AllFilter ^ CcdConstructionInfo::StaticFilter); + ci.m_collisionFilterGroup = + (isbulletsensor) ? short(CcdConstructionInfo::SensorFilter) : + (isbulletdyna) ? short(CcdConstructionInfo::DefaultFilter) : + short(CcdConstructionInfo::StaticFilter); + ci.m_collisionFilterMask = + (isbulletsensor) ? short(CcdConstructionInfo::AllFilter ^ CcdConstructionInfo::SensorFilter) : + (isbulletdyna) ? short(CcdConstructionInfo::AllFilter) : + short(CcdConstructionInfo::AllFilter ^ CcdConstructionInfo::StaticFilter); ci.m_bRigid = objprop->m_dyna && objprop->m_angular_rigidbody; ci.m_bSoft = objprop->m_softbody; + ci.m_bSensor = isbulletsensor; MT_Vector3 scaling = gameobj->NodeGetWorldScaling(); ci.m_scaling.setValue(scaling[0], scaling[1], scaling[2]); - KX_BulletPhysicsController* physicscontroller = new KX_BulletPhysicsController(ci,isbulletdyna,objprop->m_hasCompoundChildren); + KX_BulletPhysicsController* physicscontroller = new KX_BulletPhysicsController(ci,isbulletdyna,isbulletsensor,objprop->m_hasCompoundChildren); // shapeInfo is reference counted, decrement now as we don't use it anymore if (shapeInfo) shapeInfo->Release(); - if (objprop->m_in_active_layer) + gameobj->SetPhysicsController(physicscontroller,isbulletdyna); + if (isbulletsensor) + { + // use a different callback function for sensor object, + // bullet will not synchronize, we must do it explicitely + SG_Callbacks& callbacks = gameobj->GetSGNode()->GetCallBackFunctions(); + callbacks.m_updatefunc = KX_GameObject::SynchronizeTransformFunc; + // make sensor object invisible by default + gameobj->SetVisible(false, false); + } + // don't add automatically sensor object, they are added when a collision sensor is registered + else if (objprop->m_in_active_layer) { env->addCcdPhysicsController( physicscontroller); } - - - - gameobj->SetPhysicsController(physicscontroller,isbulletdyna); physicscontroller->setNewClientInfo(gameobj->getClientInfo()); { btRigidBody* rbody = physicscontroller->GetRigidBody(); @@ -1181,7 +1195,9 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, } bool isActor = objprop->m_isactor; - gameobj->getClientInfo()->m_type = (isActor ? KX_ClientObjectInfo::ACTOR : KX_ClientObjectInfo::STATIC); + gameobj->getClientInfo()->m_type = + (isbulletsensor) ? KX_ClientObjectInfo::OBSENSOR : + (isActor) ? KX_ClientObjectInfo::ACTOR : KX_ClientObjectInfo::STATIC; // store materialname in auxinfo, needed for touchsensors if (meshobj) { diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 79519bfb491..1d7bf56f6d3 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -332,7 +332,7 @@ void KX_GameObject::ProcessReplica() } -static void setGraphicController_recursive(SG_Node* node, bool v) +static void setGraphicController_recursive(SG_Node* node) { NodeList& children = node->GetSGChildren(); @@ -341,24 +341,24 @@ static void setGraphicController_recursive(SG_Node* node, bool v) SG_Node* childnode = (*childit); KX_GameObject *clientgameobj = static_cast( (*childit)->GetSGClientObject()); if (clientgameobj != NULL) // This is a GameObject - clientgameobj->ActivateGraphicController(v, false); + clientgameobj->ActivateGraphicController(false); // if the childobj is NULL then this may be an inverse parent link // so a non recursive search should still look down this node. - setGraphicController_recursive(childnode, v); + setGraphicController_recursive(childnode); } } -void KX_GameObject::ActivateGraphicController(bool active, bool recurse) +void KX_GameObject::ActivateGraphicController(bool recurse) { if (m_pGraphicController) { - m_pGraphicController->Activate(active); + m_pGraphicController->Activate(m_bVisible); } if (recurse) { - setGraphicController_recursive(GetSGNode(), active); + setGraphicController_recursive(GetSGNode()); } } @@ -538,6 +538,20 @@ void KX_GameObject::UpdateTransformFunc(SG_IObject* node, void* gameobj, void* s ((KX_GameObject*)gameobj)->UpdateTransform(); } +void KX_GameObject::SynchronizeTransform() +{ + // only used for sensor object, do full synchronization as bullet doesn't do it + if (m_pPhysicsController1) + m_pPhysicsController1->SetTransform(); + if (m_pGraphicController) + m_pGraphicController->SetGraphicTransform(); +} + +void KX_GameObject::SynchronizeTransformFunc(SG_IObject* node, void* gameobj, void* scene) +{ + ((KX_GameObject*)gameobj)->SynchronizeTransform(); +} + void KX_GameObject::SetDebugColor(unsigned int bgra) { diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index e5b26539d4d..e0e78918dde 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -384,7 +384,7 @@ public: /* * @add/remove the graphic controller to the physic system */ - void ActivateGraphicController(bool active, bool recurse); + void ActivateGraphicController(bool recurse); /** * @section Coordinate system manipulation functions @@ -559,6 +559,13 @@ public: static void UpdateTransformFunc(SG_IObject* node, void* gameobj, void* scene); + /** + * only used for sensor objects + */ + void SynchronizeTransform(); + + static void SynchronizeTransformFunc(SG_IObject* node, void* gameobj, void* scene); + /** * Function to set IPO option at start of IPO */ diff --git a/source/gameengine/Ketsji/KX_IPhysicsController.cpp b/source/gameengine/Ketsji/KX_IPhysicsController.cpp index a38222c5f7e..673acabd774 100644 --- a/source/gameengine/Ketsji/KX_IPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_IPhysicsController.cpp @@ -35,9 +35,10 @@ #include "PHY_DynamicTypes.h" -KX_IPhysicsController::KX_IPhysicsController(bool dyna, bool compound, void* userdata) +KX_IPhysicsController::KX_IPhysicsController(bool dyna, bool sensor, bool compound, void* userdata) : m_bDyna(dyna), + m_bSensor(sensor), m_bCompound(compound), m_suspendDynamics(false), m_userdata(userdata) diff --git a/source/gameengine/Ketsji/KX_IPhysicsController.h b/source/gameengine/Ketsji/KX_IPhysicsController.h index 10b66da7b76..81c01045071 100644 --- a/source/gameengine/Ketsji/KX_IPhysicsController.h +++ b/source/gameengine/Ketsji/KX_IPhysicsController.h @@ -49,11 +49,12 @@ class KX_IPhysicsController : public SG_Controller { protected: bool m_bDyna; + bool m_bSensor; bool m_bCompound; bool m_suspendDynamics; void* m_userdata; public: - KX_IPhysicsController(bool dyna,bool compound, void* userdata); + KX_IPhysicsController(bool dyna,bool sensor,bool compound, void* userdata); virtual ~KX_IPhysicsController(); @@ -74,6 +75,7 @@ public: virtual void getOrientation(MT_Quaternion& orn)=0; virtual void setOrientation(const MT_Matrix3x3& orn)=0; + virtual void SetTransform()=0; //virtual void setOrientation(const MT_Quaternion& orn)=0; virtual void setPosition(const MT_Point3& pos)=0; virtual void setScaling(const MT_Vector3& scaling)=0; @@ -100,10 +102,18 @@ public: m_bDyna = isDynamic; } + void SetSensor(bool isSensor) { + m_bSensor = isSensor; + } + bool IsDyna(void) { return m_bDyna; } + bool IsSensor(void) { + return m_bSensor; + } + bool IsCompound(void) { return m_bCompound; } diff --git a/source/gameengine/Ketsji/KX_MotionState.cpp b/source/gameengine/Ketsji/KX_MotionState.cpp index b4d58dccfdf..60455d33312 100644 --- a/source/gameengine/Ketsji/KX_MotionState.cpp +++ b/source/gameengine/Ketsji/KX_MotionState.cpp @@ -73,6 +73,11 @@ void KX_MotionState::getWorldOrientation(float* ori) mat.getValue(ori); } +void KX_MotionState::setWorldOrientation(const float* ori) +{ + m_node->SetLocalOrientation(ori); +} + void KX_MotionState::setWorldPosition(float posX,float posY,float posZ) { m_node->SetLocalPosition(MT_Point3(posX,posY,posZ)); diff --git a/source/gameengine/Ketsji/KX_MotionState.h b/source/gameengine/Ketsji/KX_MotionState.h index 7ba3ca2f85c..0e43e88fbeb 100644 --- a/source/gameengine/Ketsji/KX_MotionState.h +++ b/source/gameengine/Ketsji/KX_MotionState.h @@ -45,6 +45,7 @@ public: virtual void setWorldPosition(float posX,float posY,float posZ); virtual void setWorldOrientation(float quatIma0,float quatIma1,float quatIma2,float quatReal); virtual void getWorldOrientation(float* ori); + virtual void setWorldOrientation(const float* ori); virtual void calculateWorldTransformations(); }; diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp index a3c4e95ae24..44842b7f5b3 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.cpp +++ b/source/gameengine/Ketsji/KX_NearSensor.cpp @@ -36,6 +36,7 @@ #include "KX_Scene.h" // needed to create a replica #include "PHY_IPhysicsEnvironment.h" #include "PHY_IPhysicsController.h" +#include "PHY_IMotionState.h" #ifdef HAVE_CONFIG_H #include @@ -62,7 +63,7 @@ KX_NearSensor::KX_NearSensor(SCA_EventManager* eventmgr, { gameobj->getClientInfo()->m_sensors.remove(this); - m_client_info = new KX_ClientObjectInfo(gameobj, KX_ClientObjectInfo::NEAR); + m_client_info = new KX_ClientObjectInfo(gameobj, KX_ClientObjectInfo::SENSOR); m_client_info->m_sensors.push_back(this); //DT_ShapeHandle shape = (DT_ShapeHandle) vshape; @@ -81,28 +82,14 @@ void KX_NearSensor::SynchronizeTransform() // not linked to the parent object, must synchronize it. if (m_physCtrl) { + PHY_IMotionState* motionState = m_physCtrl->GetMotionState(); KX_GameObject* parent = ((KX_GameObject*)GetParent()); - MT_Vector3 pos = parent->NodeGetWorldPosition(); - MT_Quaternion orn = parent->NodeGetWorldOrientation().getRotation(); - m_physCtrl->setPosition(pos.x(),pos.y(),pos.z()); - m_physCtrl->setOrientation(orn.x(),orn.y(),orn.z(),orn.w()); - m_physCtrl->calcXform(); - } -} - -void KX_NearSensor::RegisterSumo(KX_TouchEventManager *touchman) -{ - if (m_physCtrl) - { - touchman->GetPhysicsEnvironment()->addSensor(m_physCtrl); - } -} - -void KX_NearSensor::UnregisterSumo(KX_TouchEventManager* touchman) -{ - if (m_physCtrl) - { - touchman->GetPhysicsEnvironment()->removeSensor(m_physCtrl); + const MT_Point3& pos = parent->NodeGetWorldPosition(); + float ori[12]; + parent->NodeGetWorldOrientation().getValue(ori); + motionState->setWorldPosition(pos[0], pos[1], pos[2]); + motionState->setWorldOrientation(ori); + m_physCtrl->WriteMotionStateToDynamics(true); } } @@ -117,7 +104,7 @@ void KX_NearSensor::ProcessReplica() { KX_TouchSensor::ProcessReplica(); - m_client_info = new KX_ClientObjectInfo(m_client_info->m_gameobject, KX_ClientObjectInfo::NEAR); + m_client_info = new KX_ClientObjectInfo(m_client_info->m_gameobject, KX_ClientObjectInfo::SENSOR); if (m_physCtrl) { @@ -134,11 +121,11 @@ void KX_NearSensor::ProcessReplica() void KX_NearSensor::ReParent(SCA_IObject* parent) { + SCA_ISensor::ReParent(parent); m_client_info->m_gameobject = static_cast(parent); m_client_info->m_sensors.push_back(this); //Synchronize here with the actual parent. SynchronizeTransform(); - SCA_ISensor::ReParent(parent); } diff --git a/source/gameengine/Ketsji/KX_NearSensor.h b/source/gameengine/Ketsji/KX_NearSensor.h index 35136b79d13..d98b464a443 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.h +++ b/source/gameengine/Ketsji/KX_NearSensor.h @@ -77,8 +77,8 @@ public: virtual bool NewHandleCollision(void* obj1,void* obj2, const PHY_CollData * coll_data); virtual bool BroadPhaseFilterCollision(void*obj1,void*obj2); - virtual void RegisterSumo(KX_TouchEventManager *touchman); - virtual void UnregisterSumo(KX_TouchEventManager* touchman); + virtual bool BroadPhaseSensorFilterCollision(void*obj1,void*obj2) { return false; }; + virtual sensortype GetSensorType() { return NEAR; } /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_OdePhysicsController.h b/source/gameengine/Ketsji/KX_OdePhysicsController.h index 21b7e632d83..8c3974c38a3 100644 --- a/source/gameengine/Ketsji/KX_OdePhysicsController.h +++ b/source/gameengine/Ketsji/KX_OdePhysicsController.h @@ -70,6 +70,7 @@ public: virtual void setOrientation(const MT_Matrix3x3& orn); virtual void setPosition(const MT_Point3& pos); virtual void setScaling(const MT_Vector3& scaling); + virtual void SetTransform() {} virtual MT_Scalar GetMass(); virtual MT_Vector3 getReactionForce(); virtual void setRigidBody(bool rigid); diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index 4532224a81e..064dc9126ac 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -30,6 +30,7 @@ #include "KX_GameObject.h" #include "KX_PyMath.h" #include "PHY_IPhysicsController.h" +#include "PHY_IMotionState.h" #ifdef HAVE_CONFIG_H #include @@ -66,7 +67,7 @@ KX_RadarSensor::KX_RadarSensor(SCA_EventManager* eventmgr, m_coneheight(coneheight), m_axis(axis) { - m_client_info->m_type = KX_ClientObjectInfo::RADAR; + m_client_info->m_type = KX_ClientObjectInfo::SENSOR; //m_client_info->m_clientobject = gameobj; //m_client_info->m_auxilary_info = NULL; //sumoObj->setClientObject(&m_client_info); @@ -84,12 +85,6 @@ CValue* KX_RadarSensor::GetReplica() return replica; } -void KX_RadarSensor::ProcessReplica() -{ - KX_NearSensor::ProcessReplica(); - m_client_info->m_type = KX_ClientObjectInfo::RADAR; -} - /** * Transforms the collision object. A cone is not correctly centered * for usage. */ @@ -169,11 +164,13 @@ void KX_RadarSensor::SynchronizeTransform() if (m_physCtrl) { - MT_Quaternion orn = trans.getRotation(); - MT_Point3 pos = trans.getOrigin(); - m_physCtrl->setPosition(pos[0],pos[1],pos[2]); - m_physCtrl->setOrientation(orn[0],orn[1],orn[2],orn[3]); - m_physCtrl->calcXform(); + PHY_IMotionState* motionState = m_physCtrl->GetMotionState(); + const MT_Point3& pos = trans.getOrigin(); + float ori[12]; + trans.getBasis().getValue(ori); + motionState->setWorldPosition(pos[0], pos[1], pos[2]); + motionState->setWorldOrientation(ori); + m_physCtrl->WriteMotionStateToDynamics(true); } } diff --git a/source/gameengine/Ketsji/KX_RadarSensor.h b/source/gameengine/Ketsji/KX_RadarSensor.h index b4268797f85..6779a9edffe 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.h +++ b/source/gameengine/Ketsji/KX_RadarSensor.h @@ -76,7 +76,6 @@ public: virtual ~KX_RadarSensor(); virtual void SynchronizeTransform(); virtual CValue* GetReplica(); - virtual void ProcessReplica(); /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ @@ -93,6 +92,7 @@ public: virtual PyObject* py_getattro(PyObject *attr); virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject* value); + virtual sensortype GetSensorType() { return RADAR; } //Deprecated -----> KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeOrigin); diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 9502599603c..bb5e0875402 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -737,7 +737,7 @@ void KX_Scene::DupliGroupRecurse(CValue* obj, int level) replica->GetSGNode()->SetBBox(gameobj->GetSGNode()->BBox()); replica->GetSGNode()->SetRadius(gameobj->GetSGNode()->Radius()); // we can now add the graphic controller to the physic engine - replica->ActivateGraphicController(true,true); + replica->ActivateGraphicController(true); // done with replica replica->Release(); @@ -850,7 +850,7 @@ SCA_IObject* KX_Scene::AddReplicaObject(class CValue* originalobject, replica->GetSGNode()->SetBBox(originalobj->GetSGNode()->BBox()); replica->GetSGNode()->SetRadius(originalobj->GetSGNode()->Radius()); // the size is correct, we can add the graphic controller to the physic engine - replica->ActivateGraphicController(true,true); + replica->ActivateGraphicController(true); // now replicate logic vector::iterator git; diff --git a/source/gameengine/Ketsji/KX_SumoPhysicsController.h b/source/gameengine/Ketsji/KX_SumoPhysicsController.h index 083d89896f6..278994c6ae7 100644 --- a/source/gameengine/Ketsji/KX_SumoPhysicsController.h +++ b/source/gameengine/Ketsji/KX_SumoPhysicsController.h @@ -53,7 +53,7 @@ public: class SM_Object* sumoObj, class PHY_IMotionState* motionstate ,bool dyna) - : KX_IPhysicsController(dyna,false,NULL) , + : KX_IPhysicsController(dyna,false,false,NULL) , SumoPhysicsController(sumoScene,/*solidscene,*/sumoObj,motionstate,dyna) { }; @@ -83,6 +83,7 @@ public: virtual void getOrientation(MT_Quaternion& orn); virtual void setOrientation(const MT_Matrix3x3& orn); + virtual void SetTransform() {} virtual void setPosition(const MT_Point3& pos); virtual void setScaling(const MT_Vector3& scaling); diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.cpp b/source/gameengine/Ketsji/KX_TouchEventManager.cpp index 8ae5fae8fa3..46927541099 100644 --- a/source/gameengine/Ketsji/KX_TouchEventManager.cpp +++ b/source/gameengine/Ketsji/KX_TouchEventManager.cpp @@ -85,14 +85,34 @@ bool KX_TouchEventManager::newBroadphaseResponse(void *client_data, PHY_IPhysicsController* ctrl = static_cast(object1); KX_ClientObjectInfo* info = (ctrl) ? static_cast(ctrl->getNewClientInfo()) : NULL; // This call back should only be called for controllers of Near and Radar sensor - if (info && - info->m_sensors.size() == 1 && - (info->m_type == KX_ClientObjectInfo::NEAR || - info->m_type == KX_ClientObjectInfo::RADAR)) + if (!info) + return true; + + switch (info->m_type) { - // only one sensor for this type of object - KX_TouchSensor* touchsensor = static_cast(*info->m_sensors.begin()); - return touchsensor->BroadPhaseFilterCollision(object1,object2); + case KX_ClientObjectInfo::SENSOR: + if (info->m_sensors.size() == 1) + { + // only one sensor for this type of object + KX_TouchSensor* touchsensor = static_cast(*info->m_sensors.begin()); + return touchsensor->BroadPhaseFilterCollision(object1,object2); + } + break; + case KX_ClientObjectInfo::OBSENSOR: + // this object may have multiple collision sensors, + // check is any of them is interested in this object + for(std::list::iterator it = info->m_sensors.begin(); + it != info->m_sensors.end(); + ++it) + { + if ((*it)->GetSensorType() == SCA_ISensor::TOUCH) + { + KX_TouchSensor* touchsensor = static_cast(*it); + if (touchsensor->BroadPhaseSensorFilterCollision(object1, object2)) + return true; + } + } + return false; } return true; } diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 8c0d5596939..509fc60e9f5 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -173,19 +173,65 @@ void KX_TouchSensor::RegisterSumo(KX_TouchEventManager *touchman) { if (m_physCtrl) { - touchman->GetPhysicsEnvironment()->requestCollisionCallback(m_physCtrl); - // collision - // Deprecated - + if (touchman->GetPhysicsEnvironment()->requestCollisionCallback(m_physCtrl)) + { + KX_ClientObjectInfo* client_info = static_cast(m_physCtrl->getNewClientInfo()); + if (client_info->isSensor()) + touchman->GetPhysicsEnvironment()->addSensor(m_physCtrl); + } } } - void KX_TouchSensor::UnregisterSumo(KX_TouchEventManager* touchman) { if (m_physCtrl) { - touchman->GetPhysicsEnvironment()->removeCollisionCallback(m_physCtrl); + if (touchman->GetPhysicsEnvironment()->removeCollisionCallback(m_physCtrl)) + { + // no more sensor on the controller, can remove it if it is a sensor object + KX_ClientObjectInfo* client_info = static_cast(m_physCtrl->getNewClientInfo()); + if (client_info->isSensor()) + touchman->GetPhysicsEnvironment()->removeSensor(m_physCtrl); + } + } +} + +// this function is called only for sensor objects +// return true if the controller can collide with the object +bool KX_TouchSensor::BroadPhaseSensorFilterCollision(void*obj1,void*obj2) +{ + assert(obj1==m_physCtrl && obj2); + + KX_GameObject* myobj = (KX_GameObject*)GetParent(); + KX_GameObject* myparent = myobj->GetParent(); + KX_ClientObjectInfo* client_info = static_cast(((PHY_IPhysicsController*)obj2)->getNewClientInfo()); + KX_GameObject* otherobj = ( client_info ? client_info->m_gameobject : NULL); + + // first, decrement refcount as GetParent() increases it + if (myparent) + myparent->Release(); + + // we can only check on persistent characteristic: m_link and m_suspended are not + // good candidate because they are transient. That must be handled at another level + if (!otherobj || + otherobj == myparent || // don't interact with our parent + client_info->m_type != KX_ClientObjectInfo::ACTOR) // only with actor objects + return false; + + bool found = m_touchedpropname.IsEmpty(); + if (!found) + { + if (m_bFindMaterial) + { + if (client_info->m_auxilary_info) + { + found = (!strcmp(m_touchedpropname.Ptr(), (char*)client_info->m_auxilary_info)); + } + } else + { + found = (otherobj->GetProperty(m_touchedpropname) != NULL); + } } + return found; } bool KX_TouchSensor::NewHandleCollision(void*object1,void*object2,const PHY_CollData* colldata) diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index 9c9c6bf5816..b62ec6eaf4d 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -103,7 +103,8 @@ public: // obj1 = sensor physical controller, obj2 = physical controller of second object // return value = true if collision should be checked on pair of object virtual bool BroadPhaseFilterCollision(void*obj1,void*obj2) { return true; } - + virtual bool BroadPhaseSensorFilterCollision(void*obj1,void*obj2); + virtual sensortype GetSensorType() { return TOUCH; } virtual bool IsPositiveTrigger() { diff --git a/source/gameengine/Physics/BlOde/OdePhysicsController.cpp b/source/gameengine/Physics/BlOde/OdePhysicsController.cpp index efe4554d970..5efd0994311 100644 --- a/source/gameengine/Physics/BlOde/OdePhysicsController.cpp +++ b/source/gameengine/Physics/BlOde/OdePhysicsController.cpp @@ -379,7 +379,10 @@ bool ODEPhysicsController::SynchronizeMotionStates(float time) return false; //it update the worldpos } - +PHY_IMotionState* ODEPhysicsController::GetMotionState() +{ + return m_MotionState; +} // kinematic methods diff --git a/source/gameengine/Physics/BlOde/OdePhysicsController.h b/source/gameengine/Physics/BlOde/OdePhysicsController.h index e97afdb68c3..544d11da2ca 100644 --- a/source/gameengine/Physics/BlOde/OdePhysicsController.h +++ b/source/gameengine/Physics/BlOde/OdePhysicsController.h @@ -102,6 +102,7 @@ public: virtual void WriteDynamicsToMotionState() {}; virtual void WriteMotionStateToDynamics(bool nondynaonly); + virtual class PHY_IMotionState* GetMotionState(); /** call from Scene Graph Node to 'update'. diff --git a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h index 82e26e01460..54e4f7f90e1 100644 --- a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h +++ b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h @@ -64,8 +64,8 @@ public: virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user) { } - virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl) {} - virtual void removeCollisionCallback(PHY_IPhysicsController* ctrl) {} + virtual bool requestCollisionCallback(PHY_IPhysicsController* ctrl) {return false;} + virtual bool removeCollisionCallback(PHY_IPhysicsController* ctrl) {return false;} virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position) {return 0;} virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight) { return 0;} diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 01e8aa2560f..7302c47f4bf 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -92,16 +92,19 @@ CcdPhysicsController::CcdPhysicsController (const CcdConstructionInfo& ci) } -btTransform CcdPhysicsController::GetTransformFromMotionState(PHY_IMotionState* motionState) +btTransform& CcdPhysicsController::GetTransformFromMotionState(PHY_IMotionState* motionState) { - btTransform trans; - float tmp[3]; - motionState->getWorldPosition(tmp[0],tmp[1],tmp[2]); - trans.setOrigin(btVector3(tmp[0],tmp[1],tmp[2])); - - btQuaternion orn; - motionState->getWorldOrientation(orn[0],orn[1],orn[2],orn[3]); - trans.setRotation(orn); + static btTransform trans; + btVector3 tmp; + motionState->getWorldPosition(tmp.m_floats[0], tmp.m_floats[1], tmp.m_floats[2]); + trans.setOrigin(tmp); + + float ori[12]; + motionState->getWorldOrientation(ori); + trans.getBasis().setFromOpenGLSubMatrix(ori); + //btQuaternion orn; + //motionState->getWorldOrientation(orn[0],orn[1],orn[2],orn[3]); + //trans.setRotation(orn); return trans; } @@ -118,18 +121,18 @@ public: } - virtual void getWorldTransform(btTransform& worldTrans ) const + void getWorldTransform(btTransform& worldTrans ) const { - float pos[3]; - float quatOrn[4]; + btVector3 pos; + float ori[12]; - m_blenderMotionState->getWorldPosition(pos[0],pos[1],pos[2]); - m_blenderMotionState->getWorldOrientation(quatOrn[0],quatOrn[1],quatOrn[2],quatOrn[3]); - worldTrans.setOrigin(btVector3(pos[0],pos[1],pos[2])); - worldTrans.setBasis(btMatrix3x3(btQuaternion(quatOrn[0],quatOrn[1],quatOrn[2],quatOrn[3]))); + m_blenderMotionState->getWorldPosition(pos.m_floats[0],pos.m_floats[1],pos.m_floats[2]); + m_blenderMotionState->getWorldOrientation(ori); + worldTrans.setOrigin(pos); + worldTrans.getBasis().setFromOpenGLSubMatrix(ori); } - virtual void setWorldTransform(const btTransform& worldTrans) + void setWorldTransform(const btTransform& worldTrans) { m_blenderMotionState->setWorldPosition(worldTrans.getOrigin().getX(),worldTrans.getOrigin().getY(),worldTrans.getOrigin().getZ()); btQuaternion rotQuat = worldTrans.getRotation(); @@ -493,10 +496,12 @@ void CcdPhysicsController::CreateRigidbody() //convert collision flags! //special case: a near/radar sensor controller should not be defined static or it will //generate loads of static-static collision messages on the console - if ((m_cci.m_collisionFilterGroup & CcdConstructionInfo::SensorFilter) != 0) + if (m_cci.m_bSensor) { // reset the flags that have been set so far GetCollisionObject()->setCollisionFlags(0); + // sensor must never go to sleep: they need to detect continously + GetCollisionObject()->setActivationState(DISABLE_DEACTIVATION); } GetCollisionObject()->setCollisionFlags(m_object->getCollisionFlags() | m_cci.m_collisionFlags); btRigidBody* body = GetRigidBody(); @@ -613,12 +618,13 @@ bool CcdPhysicsController::SynchronizeMotionStates(float time) body->setLinearVelocity(linvel * (m_cci.m_clamp_vel_min / len)); } - const btVector3& worldPos = body->getCenterOfMassPosition(); + const btTransform& xform = body->getCenterOfMassTransform(); + const btMatrix3x3& worldOri = xform.getBasis(); + const btVector3& worldPos = xform.getOrigin(); + float ori[12]; + worldOri.getOpenGLSubMatrix(ori); + m_MotionState->setWorldOrientation(ori); m_MotionState->setWorldPosition(worldPos[0],worldPos[1],worldPos[2]); - - const btQuaternion& worldquat = body->getOrientation(); - m_MotionState->setWorldOrientation(worldquat[0],worldquat[1],worldquat[2],worldquat[3]); - m_MotionState->calculateWorldTransformations(); float scale[3]; @@ -655,8 +661,10 @@ bool CcdPhysicsController::SynchronizeMotionStates(float time) void CcdPhysicsController::WriteMotionStateToDynamics(bool nondynaonly) { - + btTransform& xform = CcdPhysicsController::GetTransformFromMotionState(m_MotionState); + SetCenterOfMassTransform(xform); } + void CcdPhysicsController::WriteDynamicsToMotionState() { } @@ -673,12 +681,12 @@ void CcdPhysicsController::PostProcessReplica(class PHY_IMotionState* motionsta if (m_shapeInfo) { m_shapeInfo->AddRef(); - m_collisionShape = m_shapeInfo->CreateBulletShape(); + m_collisionShape = m_shapeInfo->CreateBulletShape(m_cci.m_margin); if (m_collisionShape) { // new shape has no scaling, apply initial scaling - m_collisionShape->setMargin(m_cci.m_margin); + //m_collisionShape->setMargin(m_cci.m_margin); m_collisionShape->setLocalScaling(m_cci.m_scaling); if (m_cci.m_mass) @@ -697,8 +705,10 @@ void CcdPhysicsController::PostProcessReplica(class PHY_IMotionState* motionsta { body->setMassProps(m_cci.m_mass, m_cci.m_localInertiaTensor * m_cci.m_inertiaFactor); } - } - m_cci.m_physicsEnv->addCcdPhysicsController(this); + } + // sensor object are added when needed + if (!m_cci.m_bSensor) + m_cci.m_physicsEnv->addCcdPhysicsController(this); /* SM_Object* dynaparent=0; @@ -773,7 +783,7 @@ void CcdPhysicsController::RelativeTranslate(float dlocX,float dlocY,float dloc if (m_object) { m_object->activate(true); - if (m_object->isStaticObject()) + if (m_object->isStaticObject() && !m_cci.m_bSensor) { m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); } @@ -799,7 +809,7 @@ void CcdPhysicsController::RelativeRotate(const float rotval[9],bool local) if (m_object) { m_object->activate(true); - if (m_object->isStaticObject()) + if (m_object->isStaticObject() && !m_cci.m_bSensor) { m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); } @@ -843,7 +853,7 @@ void CcdPhysicsController::setOrientation(float quatImag0,float quatImag1,float if (m_object) { m_object->activate(true); - if (m_object->isStaticObject()) + if (m_object->isStaticObject() && !m_cci.m_bSensor) { m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); } @@ -866,7 +876,7 @@ void CcdPhysicsController::setWorldOrientation(const btMatrix3x3& orn) if (m_object) { m_object->activate(true); - if (m_object->isStaticObject()) + if (m_object->isStaticObject() && !m_cci.m_bSensor) { m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); } @@ -895,7 +905,7 @@ void CcdPhysicsController::setPosition(float posX,float posY,float posZ) if (m_object) { m_object->activate(true); - if (m_object->isStaticObject()) + if (m_object->isStaticObject() && !m_cci.m_bSensor) { m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); } @@ -909,9 +919,19 @@ void CcdPhysicsController::setPosition(float posX,float posY,float posZ) // not required //m_bulletMotionState->setWorldTransform(xform); } +} - +void CcdPhysicsController::forceWorldTransform(const btMatrix3x3& mat, const btVector3& pos) +{ + if (m_object) + { + btTransform& xform = m_object->getWorldTransform(); + xform.setBasis(mat); + xform.setOrigin(pos); + } } + + void CcdPhysicsController::resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ) { } @@ -961,7 +981,9 @@ void CcdPhysicsController::ApplyTorque(float torqueX,float torqueY,float torque m_object->activate(); if (m_object->isStaticObject()) { - m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + if (!m_cci.m_bSensor) + m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + return; } if (local) { @@ -989,27 +1011,26 @@ void CcdPhysicsController::ApplyForce(float forceX,float forceY,float forceZ,bo m_object->activate(); if (m_object->isStaticObject()) { - m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + if (!m_cci.m_bSensor) + m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + return; } - + btTransform xform = m_object->getWorldTransform(); + + if (local) + { + force = xform.getBasis()*force; + } + btRigidBody* body = GetRigidBody(); + if (body) + body->applyCentralForce(force); + btSoftBody* soft = GetSoftBody(); + if (soft) { - btTransform xform = m_object->getWorldTransform(); - - if (local) - { - force = xform.getBasis()*force; - } - btRigidBody* body = GetRigidBody(); - if (body) - body->applyCentralForce(force); - btSoftBody* soft = GetSoftBody(); - if (soft) - { - // the force is applied on each node, must reduce it in the same extend - if (soft->m_nodes.size() > 0) - force /= soft->m_nodes.size(); - soft->addForce(force); - } + // the force is applied on each node, must reduce it in the same extend + if (soft->m_nodes.size() > 0) + force /= soft->m_nodes.size(); + soft->addForce(force); } } } @@ -1021,19 +1042,18 @@ void CcdPhysicsController::SetAngularVelocity(float ang_velX,float ang_velY,flo m_object->activate(true); if (m_object->isStaticObject()) { - m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); - } else + if (!m_cci.m_bSensor) + m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + return; + } + btTransform xform = m_object->getWorldTransform(); + if (local) { - btTransform xform = m_object->getWorldTransform(); - if (local) - { - angvel = xform.getBasis()*angvel; - } - btRigidBody* body = GetRigidBody(); - if (body) - body->setAngularVelocity(angvel); - + angvel = xform.getBasis()*angvel; } + btRigidBody* body = GetRigidBody(); + if (body) + body->setAngularVelocity(angvel); } } @@ -1046,7 +1066,8 @@ void CcdPhysicsController::SetLinearVelocity(float lin_velX,float lin_velY,floa m_object->activate(true); if (m_object->isStaticObject()) { - m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + if (!m_cci.m_bSensor) + m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); return; } @@ -1080,7 +1101,9 @@ void CcdPhysicsController::applyImpulse(float attachX,float attachY,float attac m_object->activate(); if (m_object->isStaticObject()) { - m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + if (!m_cci.m_bSensor) + m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + return; } btVector3 pos(attachX,attachY,attachZ); @@ -1207,7 +1230,7 @@ PHY_IPhysicsController* CcdPhysicsController::GetReplica() if (m_shapeInfo) { // This situation does not normally happen - cinfo.m_collisionShape = m_shapeInfo->CreateBulletShape(); + cinfo.m_collisionShape = m_shapeInfo->CreateBulletShape(0.01); } else if (m_collisionShape) { @@ -1274,28 +1297,22 @@ void DefaultMotionState::getWorldScaling(float& scaleX,float& scaleY,float& scal void DefaultMotionState::getWorldOrientation(float& quatIma0,float& quatIma1,float& quatIma2,float& quatReal) { - quatIma0 = m_worldTransform.getRotation().x(); - quatIma1 = m_worldTransform.getRotation().y(); - quatIma2 = m_worldTransform.getRotation().z(); - quatReal = m_worldTransform.getRotation()[3]; + btQuaternion quat = m_worldTransform.getRotation(); + quatIma0 = quat.x(); + quatIma1 = quat.y(); + quatIma2 = quat.z(); + quatReal = quat[3]; } void DefaultMotionState::getWorldOrientation(float* ori) { - *ori++ = m_worldTransform.getBasis()[0].x(); - *ori++ = m_worldTransform.getBasis()[1].x(); - *ori++ = m_worldTransform.getBasis()[1].x(); - *ori++ = 0.f; - *ori++ = m_worldTransform.getBasis()[0].y(); - *ori++ = m_worldTransform.getBasis()[1].y(); - *ori++ = m_worldTransform.getBasis()[1].y(); - *ori++ = 0.f; - *ori++ = m_worldTransform.getBasis()[0].z(); - *ori++ = m_worldTransform.getBasis()[1].z(); - *ori++ = m_worldTransform.getBasis()[1].z(); - *ori++ = 0.f; + m_worldTransform.getBasis().getOpenGLSubMatrix(ori); } +void DefaultMotionState::setWorldOrientation(const float* ori) +{ + m_worldTransform.getBasis().setFromOpenGLSubMatrix(ori); +} void DefaultMotionState::setWorldPosition(float posX,float posY,float posZ) { btVector3 pos(posX,posY,posZ); @@ -1583,7 +1600,7 @@ bool CcdShapeConstructionInfo::SetProxy(CcdShapeConstructionInfo* shapeInfo) return true; } -btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape() +btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape(btScalar margin) { btCollisionShape* collisionShape = 0; btTriangleMeshShape* concaveShape = 0; @@ -1591,7 +1608,7 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape() CcdShapeConstructionInfo* nextShapeInfo; if (m_shapeType == PHY_SHAPE_PROXY && m_shapeProxy != NULL) - return m_shapeProxy->CreateBulletShape(); + return m_shapeProxy->CreateBulletShape(margin); switch (m_shapeType) { @@ -1600,22 +1617,27 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape() case PHY_SHAPE_BOX: collisionShape = new btBoxShape(m_halfExtend); + collisionShape->setMargin(margin); break; case PHY_SHAPE_SPHERE: collisionShape = new btSphereShape(m_radius); + collisionShape->setMargin(margin); break; case PHY_SHAPE_CYLINDER: collisionShape = new btCylinderShapeZ(m_halfExtend); + collisionShape->setMargin(margin); break; case PHY_SHAPE_CONE: collisionShape = new btConeShapeZ(m_radius, m_height); + collisionShape->setMargin(margin); break; case PHY_SHAPE_POLYTOPE: collisionShape = new btConvexHullShape(&m_vertexArray[0], m_vertexArray.size()/3, 3*sizeof(btScalar)); + collisionShape->setMargin(margin); break; case PHY_SHAPE_MESH: @@ -1638,7 +1660,7 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape() ); btGImpactMeshShape* gimpactShape = new btGImpactMeshShape(indexVertexArrays); - + gimpactShape->setMargin(margin); collisionShape = gimpactShape; gimpactShape->updateBound(); @@ -1683,6 +1705,7 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape() m_unscaledShape->recalcLocalAabb(); } collisionShape = new btScaledBvhTriangleMeshShape(m_unscaledShape, btVector3(1.0f,1.0f,1.0f)); + collisionShape->setMargin(margin); } break; @@ -1694,7 +1717,7 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape() sit != m_shapeArray.end(); sit++) { - collisionShape = (*sit)->CreateBulletShape(); + collisionShape = (*sit)->CreateBulletShape(margin); if (collisionShape) { collisionShape->setLocalScaling((*sit)->m_childScale); diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 315e2bdf429..fc8de0e2ded 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -152,7 +152,7 @@ public: return m_shapeProxy; } - btCollisionShape* CreateBulletShape(); + btCollisionShape* CreateBulletShape(btScalar margin); // member variables PHY_ShapeType m_shapeType; @@ -222,6 +222,7 @@ struct CcdConstructionInfo m_collisionFlags(0), m_bRigid(false), m_bSoft(false), + m_bSensor(false), m_collisionFilterGroup(DefaultFilter), m_collisionFilterMask(AllFilter), m_collisionShape(0), @@ -288,6 +289,7 @@ struct CcdConstructionInfo int m_collisionFlags; bool m_bRigid; bool m_bSoft; + bool m_bSensor; ///optional use of collision group/mask: ///only collision with object goups that match the collision mask. @@ -326,7 +328,7 @@ class btSoftBody; ///CcdPhysicsController is a physics object that supports continuous collision detection and time of impact based physics resolution. class CcdPhysicsController : public PHY_IPhysicsController { - +protected: btCollisionObject* m_object; @@ -361,8 +363,8 @@ class CcdPhysicsController : public PHY_IPhysicsController return (--m_registerCount == 0) ? true : false; } - protected: - void setWorldOrientation(const btMatrix3x3& mat); + void setWorldOrientation(const btMatrix3x3& mat); + void forceWorldTransform(const btMatrix3x3& mat, const btVector3& pos); public: @@ -407,6 +409,7 @@ class CcdPhysicsController : public PHY_IPhysicsController virtual void WriteMotionStateToDynamics(bool nondynaonly); virtual void WriteDynamicsToMotionState(); + // controller replication virtual void PostProcessReplica(class PHY_IMotionState* motionstate,class PHY_IPhysicsController* parentctrl); @@ -505,7 +508,7 @@ class CcdPhysicsController : public PHY_IPhysicsController void SetCenterOfMassTransform(btTransform& xform); - static btTransform GetTransformFromMotionState(PHY_IMotionState* motionState); + static btTransform& GetTransformFromMotionState(PHY_IMotionState* motionState); void setAabb(const btVector3& aabbMin,const btVector3& aabbMax); @@ -563,6 +566,7 @@ class DefaultMotionState : public PHY_IMotionState virtual void setWorldPosition(float posX,float posY,float posZ); virtual void setWorldOrientation(float quatIma0,float quatIma1,float quatIma2,float quatReal); virtual void getWorldOrientation(float* ori); + virtual void setWorldOrientation(const float* ori); virtual void calculateWorldTransformations(); diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 03c9d13a7dd..ed517e637dc 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -415,61 +415,7 @@ void CcdPhysicsEnvironment::addCcdPhysicsController(CcdPhysicsController* ctrl) obj->setActivationState(ISLAND_SLEEPING); } - - //CollisionObject(body,ctrl->GetCollisionFilterGroup(),ctrl->GetCollisionFilterMask()); - assert(obj->getBroadphaseHandle()); - - btBroadphaseInterface* scene = getBroadphase(); - - - btCollisionShape* shapeinterface = ctrl->GetCollisionShape(); - - assert(shapeinterface); - - const btTransform& t = ctrl->GetCollisionObject()->getWorldTransform(); - - - btVector3 minAabb,maxAabb; - - shapeinterface->getAabb(t,minAabb,maxAabb); - - float timeStep = 0.02f; - - - //extent it with the motion - - if (body) - { - btVector3 linMotion = body->getLinearVelocity()*timeStep; - - float maxAabbx = maxAabb.getX(); - float maxAabby = maxAabb.getY(); - float maxAabbz = maxAabb.getZ(); - float minAabbx = minAabb.getX(); - float minAabby = minAabb.getY(); - float minAabbz = minAabb.getZ(); - - if (linMotion.x() > 0.f) - maxAabbx += linMotion.x(); - else - minAabbx += linMotion.x(); - if (linMotion.y() > 0.f) - maxAabby += linMotion.y(); - else - minAabby += linMotion.y(); - if (linMotion.z() > 0.f) - maxAabbz += linMotion.z(); - else - minAabbz += linMotion.z(); - - - minAabb = btVector3(minAabbx,minAabby,minAabbz); - maxAabb = btVector3(maxAabbx,maxAabby,maxAabbz); - } - - - } @@ -1884,29 +1830,20 @@ void CcdPhysicsEnvironment::addSensor(PHY_IPhysicsController* ctrl) // addCcdPhysicsController(ctrl1); //} enableCcdPhysicsController(ctrl1); - - //Collision filter/mask is now set at the time of the creation of the controller - //force collision detection with everything, including static objects (might hurt performance!) - //ctrl1->GetRigidBody()->getBroadphaseHandle()->m_collisionFilterMask = btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::SensorTrigger; - //ctrl1->GetRigidBody()->getBroadphaseHandle()->m_collisionFilterGroup = btBroadphaseProxy::SensorTrigger; - //todo: make this 'sensor'! - - requestCollisionCallback(ctrl); - //printf("addSensor\n"); } -void CcdPhysicsEnvironment::removeCollisionCallback(PHY_IPhysicsController* ctrl) +bool CcdPhysicsEnvironment::removeCollisionCallback(PHY_IPhysicsController* ctrl) { CcdPhysicsController* ccdCtrl = (CcdPhysicsController*)ctrl; - if (ccdCtrl->Unregister()) - m_triggerControllers.erase(ccdCtrl); + if (!ccdCtrl->Unregister()) + return false; + m_triggerControllers.erase(ccdCtrl); + return true; } void CcdPhysicsEnvironment::removeSensor(PHY_IPhysicsController* ctrl) { - removeCollisionCallback(ctrl); - disableCcdPhysicsController((CcdPhysicsController*)ctrl); } @@ -1942,12 +1879,14 @@ void CcdPhysicsEnvironment::addTouchCallback(int response_class, PHY_ResponseCal m_triggerCallbacksUserPtrs[response_class] = user; } -void CcdPhysicsEnvironment::requestCollisionCallback(PHY_IPhysicsController* ctrl) +bool CcdPhysicsEnvironment::requestCollisionCallback(PHY_IPhysicsController* ctrl) { CcdPhysicsController* ccdCtrl = static_cast(ctrl); - if (ccdCtrl->Register()) - m_triggerControllers.insert(ccdCtrl); + if (!ccdCtrl->Register()) + return false; + m_triggerControllers.insert(ccdCtrl); + return true; } void CcdPhysicsEnvironment::CallbackTriggers() @@ -2096,12 +2035,13 @@ PHY_IPhysicsController* CcdPhysicsEnvironment::CreateSphereController(float radi // declare this object as Dyamic rather then static!! // The reason as it is designed to detect all type of object, including static object // It would cause static-static message to be printed on the console otherwise - cinfo.m_collisionFlags |= btCollisionObject::CF_NO_CONTACT_RESPONSE/* | btCollisionObject::CF_KINEMATIC_OBJECT*/; + cinfo.m_collisionFlags |= btCollisionObject::CF_NO_CONTACT_RESPONSE | btCollisionObject::CF_STATIC_OBJECT; DefaultMotionState* motionState = new DefaultMotionState(); cinfo.m_MotionState = motionState; // we will add later the possibility to select the filter from option cinfo.m_collisionFilterMask = CcdConstructionInfo::AllFilter ^ CcdConstructionInfo::SensorFilter; cinfo.m_collisionFilterGroup = CcdConstructionInfo::SensorFilter; + cinfo.m_bSensor = true; motionState->m_worldTransform.setIdentity(); motionState->m_worldTransform.setOrigin(btVector3(position[0],position[1],position[2])); @@ -2555,13 +2495,14 @@ PHY_IPhysicsController* CcdPhysicsEnvironment::CreateConeController(float conera cinfo.m_collisionShape = new btConeShape(coneradius,coneheight); cinfo.m_MotionState = 0; cinfo.m_physicsEnv = this; - cinfo.m_collisionFlags |= btCollisionObject::CF_NO_CONTACT_RESPONSE; + cinfo.m_collisionFlags |= btCollisionObject::CF_NO_CONTACT_RESPONSE | btCollisionObject::CF_STATIC_OBJECT; DefaultMotionState* motionState = new DefaultMotionState(); cinfo.m_MotionState = motionState; // we will add later the possibility to select the filter from option cinfo.m_collisionFilterMask = CcdConstructionInfo::AllFilter ^ CcdConstructionInfo::SensorFilter; cinfo.m_collisionFilterGroup = CcdConstructionInfo::SensorFilter; + cinfo.m_bSensor = true; motionState->m_worldTransform.setIdentity(); // motionState->m_worldTransform.setOrigin(btVector3(position[0],position[1],position[2])); diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h index 5f9fb9511d6..4e39d531cd6 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h @@ -179,8 +179,8 @@ protected: virtual void addSensor(PHY_IPhysicsController* ctrl); virtual void removeSensor(PHY_IPhysicsController* ctrl); virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user); - virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl); - virtual void removeCollisionCallback(PHY_IPhysicsController* ctrl); + virtual bool requestCollisionCallback(PHY_IPhysicsController* ctrl); + virtual bool removeCollisionCallback(PHY_IPhysicsController* ctrl); //These two methods are used *solely* to create controllers for Near/Radar sensor! Don't use for anything else virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position); virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight); diff --git a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h index 397a1ba4218..73e7e947355 100644 --- a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h +++ b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h @@ -79,8 +79,8 @@ public: virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user) { } - virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl) {} - virtual void removeCollisionCallback(PHY_IPhysicsController* ctrl) {} + virtual bool requestCollisionCallback(PHY_IPhysicsController* ctrl) { return false; } + virtual bool removeCollisionCallback(PHY_IPhysicsController* ctrl) { return false;} virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position) {return 0;} virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight) { return 0;} diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsController.cpp b/source/gameengine/Physics/Sumo/SumoPhysicsController.cpp index 3451e6c3ec8..56caa9236bf 100644 --- a/source/gameengine/Physics/Sumo/SumoPhysicsController.cpp +++ b/source/gameengine/Physics/Sumo/SumoPhysicsController.cpp @@ -390,6 +390,11 @@ void SumoPhysicsController::PostProcessReplica(class PHY_IMotionState* motionst m_sumoScene->add(* (m_sumoObj)); } +PHY_IMotionState* SumoPhysicsController::GetMotionState() +{ + return m_MotionState; +} + void SumoPhysicsController::SetSimulatedTime(float) { } diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsController.h b/source/gameengine/Physics/Sumo/SumoPhysicsController.h index 415bc1e3982..adf29649f18 100644 --- a/source/gameengine/Physics/Sumo/SumoPhysicsController.h +++ b/source/gameengine/Physics/Sumo/SumoPhysicsController.h @@ -110,6 +110,7 @@ public: virtual void WriteDynamicsToMotionState() {}; virtual void WriteMotionStateToDynamics(bool nondynaonly); + virtual class PHY_IMotionState* GetMotionState(); /** * call from Scene Graph Node to 'update'. diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp index cc6d5654ec9..b4daf0a3f80 100644 --- a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp @@ -213,7 +213,7 @@ void SumoPhysicsEnvironment::addTouchCallback(int response_class, PHY_ResponseCa m_sumoScene->addTouchCallback(sumoRespClass,SumoPHYCallbackBridge::StaticSolidToPHYCallback,bridge); } -void SumoPhysicsEnvironment::requestCollisionCallback(PHY_IPhysicsController* ctrl) +bool SumoPhysicsEnvironment::requestCollisionCallback(PHY_IPhysicsController* ctrl) { SumoPhysicsController* smctrl = dynamic_cast(ctrl); MT_assert(smctrl); @@ -225,12 +225,15 @@ void SumoPhysicsEnvironment::requestCollisionCallback(PHY_IPhysicsController* ct smObject->setPhysicsClientObject(ctrl); m_sumoScene->requestCollisionCallback(*smObject); + return true; } + return false; } -void SumoPhysicsEnvironment::removeCollisionCallback(PHY_IPhysicsController* ctrl) +bool SumoPhysicsEnvironment::removeCollisionCallback(PHY_IPhysicsController* ctrl) { // intentionally empty + return false; } PHY_IPhysicsController* SumoPhysicsEnvironment::CreateSphereController(float radius,const PHY__Vector3& position) diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h index c2b443a2b38..4c9d59e3673 100644 --- a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h +++ b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h @@ -83,8 +83,8 @@ public: virtual void addSensor(PHY_IPhysicsController* ctrl); virtual void removeSensor(PHY_IPhysicsController* ctrl); virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user); - virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl); - virtual void removeCollisionCallback(PHY_IPhysicsController* ctrl); + virtual bool requestCollisionCallback(PHY_IPhysicsController* ctrl); + virtual bool removeCollisionCallback(PHY_IPhysicsController* ctrl); virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position); virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight); diff --git a/source/gameengine/Physics/common/PHY_IMotionState.h b/source/gameengine/Physics/common/PHY_IMotionState.h index 64bb810ee7c..f7bcbd4f2d0 100644 --- a/source/gameengine/Physics/common/PHY_IMotionState.h +++ b/source/gameengine/Physics/common/PHY_IMotionState.h @@ -45,10 +45,12 @@ class PHY_IMotionState virtual void getWorldOrientation(float& quatIma0,float& quatIma1,float& quatIma2,float& quatReal)=0; // ori = array 12 floats, [0..3] = first column + 0, [4..7] = second colum, [8..11] = third column virtual void getWorldOrientation(float* ori)=0; + virtual void setWorldOrientation(const float* ori)=0; virtual void setWorldPosition(float posX,float posY,float posZ)=0; virtual void setWorldOrientation(float quatIma0,float quatIma1,float quatIma2,float quatReal)=0; + virtual void calculateWorldTransformations()=0; }; diff --git a/source/gameengine/Physics/common/PHY_IPhysicsController.h b/source/gameengine/Physics/common/PHY_IPhysicsController.h index 770426b48db..d7b8cb0b54f 100644 --- a/source/gameengine/Physics/common/PHY_IPhysicsController.h +++ b/source/gameengine/Physics/common/PHY_IPhysicsController.h @@ -31,7 +31,7 @@ #include "PHY_IController.h" - +class PHY_IMotionState; /** PHY_IPhysicsController is the abstract simplified Interface to a physical object. @@ -53,6 +53,7 @@ class PHY_IPhysicsController : public PHY_IController virtual void WriteMotionStateToDynamics(bool nondynaonly)=0; virtual void WriteDynamicsToMotionState()=0; + virtual class PHY_IMotionState* GetMotionState() = 0; // controller replication virtual void PostProcessReplica(class PHY_IMotionState* motionstate,class PHY_IPhysicsController* parentctrl)=0; diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h index a3605669f70..1939083ef5f 100644 --- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h +++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h @@ -152,8 +152,8 @@ class PHY_IPhysicsEnvironment virtual void addSensor(PHY_IPhysicsController* ctrl)=0; virtual void removeSensor(PHY_IPhysicsController* ctrl)=0; virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user)=0; - virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl)=0; - virtual void removeCollisionCallback(PHY_IPhysicsController* ctrl)=0; + virtual bool requestCollisionCallback(PHY_IPhysicsController* ctrl)=0; + virtual bool removeCollisionCallback(PHY_IPhysicsController* ctrl)=0; //These two methods are *solely* used to create controllers for sensor! Don't use for anything else virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position) =0; virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight)=0; diff --git a/source/gameengine/SceneGraph/SG_IObject.h b/source/gameengine/SceneGraph/SG_IObject.h index b4dd9a9ddf2..8f448a0e890 100644 --- a/source/gameengine/SceneGraph/SG_IObject.h +++ b/source/gameengine/SceneGraph/SG_IObject.h @@ -203,6 +203,13 @@ public: return m_SGcontrollers; } + /** + * + */ + SG_Callbacks& GetCallBackFunctions() + { + return m_callbacks; + } /** * Get the client object associated with this diff --git a/source/gameengine/SceneGraph/SG_Spatial.h b/source/gameengine/SceneGraph/SG_Spatial.h index d1fc95cceac..6e274487c9d 100644 --- a/source/gameengine/SceneGraph/SG_Spatial.h +++ b/source/gameengine/SceneGraph/SG_Spatial.h @@ -148,6 +148,13 @@ public: SetModified(); } + // rot is arrange like openGL matrix + void SetLocalOrientation(const float* rot) + { + m_localRotation.setValue(rot); + SetModified(); + } + void SetWorldOrientation(const MT_Matrix3x3& rot) { m_worldRotation = rot; -- cgit v1.2.3 From 41acd3b81cd2a7156b8c5ced4d4aa257e7575517 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 17 May 2009 16:30:18 +0000 Subject: While testing YoFrankie with the new API attributes found some issues... - corrections to docs - disallow calling controller.activate(actuator) when the controller is not active. (Raise a SystemError) - Added 2 new attributes, CValue.name - deprecates CValue.getName(), KX_GameObject.children deprecated KX_GameObject.getChildren(), (same for getChildrenRecursive()). --- source/gameengine/Expressions/Value.cpp | 9 ++++++++- source/gameengine/Expressions/Value.h | 2 ++ .../gameengine/GameLogic/SCA_PythonController.cpp | 10 ++++++++++ source/gameengine/Ketsji/KX_Camera.cpp | 2 +- source/gameengine/Ketsji/KX_GameObject.cpp | 20 +++++++++++++++++++- source/gameengine/Ketsji/KX_GameObject.h | 2 ++ source/gameengine/PyDoc/GameTypes.py | 22 ++++++++++++++++------ 7 files changed, 58 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 83deeef91a3..f61ef1455b4 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -66,13 +66,14 @@ PyParentObject CValue::Parents[] = { }; PyMethodDef CValue::Methods[] = { -// { "printHello", (PyCFunction) CValue::sPyPrintHello, METH_VARARGS}, { "getName", (PyCFunction) CValue::sPyGetName, METH_NOARGS}, {NULL,NULL} //Sentinel }; PyObject* CValue::PyGetName() { + ShowDeprecationWarning("getName()", "the name property"); + return PyString_FromString(this->GetName()); } @@ -550,6 +551,7 @@ static PyMethodDef CValueMethods[] = }; PyAttributeDef CValue::Attributes[] = { + KX_PYATTRIBUTE_RO_FUNCTION("name", CValue, pyattr_get_name), { NULL } //Sentinel }; @@ -574,6 +576,11 @@ PyObject* CValue::py_getattro_dict() { py_getattro_dict_up(PyObjectPlus); } +PyObject * CValue::pyattr_get_name(void * self_v, const KX_PYATTRIBUTE_DEF * attrdef) { + CValue * self = static_cast (self_v); + return PyString_FromString(self->GetName()); +} + CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) { diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index e5c95df1c5c..0be76c4f452 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -236,6 +236,8 @@ public: virtual int py_delattro(PyObject *attr); virtual int py_setattro(PyObject *attr, PyObject* value); + static PyObject * pyattr_get_name(void * self, const KX_PYATTRIBUTE_DEF * attrdef); + virtual PyObject* ConvertKeysToPython( void ); KX_PYMETHOD_NOARGS(CValue,GetName); diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 212366e6526..abb3b36b91e 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -494,6 +494,11 @@ int SCA_PythonController::py_setattro(PyObject *attr, PyObject *value) PyObject* SCA_PythonController::PyActivate(PyObject *value) { + if(m_sCurrentController != this) { + PyErr_SetString(PyExc_SystemError, "Cannot add an actuator from a non-active controller"); + return NULL; + } + SCA_IActuator* actu = LinkedActuatorFromPy(value); if(actu==NULL) return NULL; @@ -504,6 +509,11 @@ PyObject* SCA_PythonController::PyActivate(PyObject *value) PyObject* SCA_PythonController::PyDeActivate(PyObject *value) { + if(m_sCurrentController != this) { + PyErr_SetString(PyExc_SystemError, "Cannot add an actuator from a non-active controller"); + return NULL; + } + SCA_IActuator* actu = LinkedActuatorFromPy(value); if(actu==NULL) return NULL; diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 0d2e68243f8..625710fa65d 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -757,7 +757,7 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, enableViewport, "Sets this camera's viewport status\n" ) { - ShowDeprecationWarning("enableViewport(bool)", "the isViewport property"); + ShowDeprecationWarning("enableViewport(bool)", "the useViewport property"); int viewport = PyObject_IsTrue(value); if (viewport == -1) { diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 1d7bf56f6d3..cbd17e66f62 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1213,6 +1213,8 @@ PyAttributeDef KX_GameObject::Attributes[] = { KX_PYATTRIBUTE_RW_FUNCTION("worldPosition", KX_GameObject, pyattr_get_worldPosition, pyattr_set_worldPosition), KX_PYATTRIBUTE_RW_FUNCTION("localScale", KX_GameObject, pyattr_get_localScaling, pyattr_set_localScaling), KX_PYATTRIBUTE_RO_FUNCTION("worldScale", KX_GameObject, pyattr_get_worldScaling), + KX_PYATTRIBUTE_RO_FUNCTION("children", KX_GameObject, pyattr_get_children), + KX_PYATTRIBUTE_RO_FUNCTION("childrenRecursive", KX_GameObject, pyattr_get_children_recursive), KX_PYATTRIBUTE_RO_FUNCTION("attrDict", KX_GameObject, pyattr_get_attrDict), /* Experemental, dont rely on these yet */ @@ -1753,6 +1755,18 @@ PyObject* KX_GameObject::pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE return KX_PythonSeq_CreatePyObject((static_cast(self_v))->m_proxy, KX_PYGENSEQ_OB_TYPE_ACTUATORS); } +PyObject* KX_GameObject::pyattr_get_children(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + KX_GameObject* self= static_cast(self_v); + return self->GetChildren()->NewProxy(true); +} + +PyObject* KX_GameObject::pyattr_get_children_recursive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + KX_GameObject* self= static_cast(self_v); + return self->GetChildrenRecursive()->NewProxy(true); +} + PyObject* KX_GameObject::pyattr_get_attrDict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_GameObject* self= static_cast(self_v); @@ -2155,11 +2169,15 @@ PyObject* KX_GameObject::PyRemoveParent() PyObject* KX_GameObject::PyGetChildren() { + ShowDeprecationWarning("getChildren()", "the children property"); + return GetChildren()->NewProxy(true); } PyObject* KX_GameObject::PyGetChildrenRecursive() { + ShowDeprecationWarning("getChildrenRecursive()", "the childrenRecursive property"); + return GetChildrenRecursive()->NewProxy(true); } @@ -2304,7 +2322,7 @@ PyObject* KX_GameObject::PyGetAxisVect(PyObject* value) PyObject* KX_GameObject::PySetPosition(PyObject* value) { - ShowDeprecationWarning("setPosition()", "the position property"); + ShowDeprecationWarning("setPosition()", "the localPosition property"); MT_Point3 pos; if (PyVecTo(value, pos)) { diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index e0e78918dde..0011b8407fd 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -902,6 +902,8 @@ public: static PyObject* pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static PyObject* pyattr_get_meshes(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_children(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_children_recursive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_attrDict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); /* Experemental! */ diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index b5b0839c0f4..3a6c62e7d23 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -45,11 +45,14 @@ class PyObjectPlus: class CValue(PyObjectPlus): """ This class is a basis for other classes. + @ivar name: The name of this CValue derived object (read-only). + @type name: string """ def getName(): """ Returns the name of the CValue. + @deprecated: Use the L{name} attribute instead. @note: in most cases the CValue's subclasses will override this function. @rtype: string """ @@ -1584,7 +1587,11 @@ class KX_GameObject(SCA_IObject): @type actuators: list @ivar attrDict: get the objects internal python attribute dictionary for direct (faster) access. @type attrDict: dict - @group Deprecated: getPosition, setPosition, setWorldPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass, getMesh + @ivar children: direct children of this object, (read-only). + @type children: L{CListValue} of L{KX_GameObject}'s + @ivar childrenRecursive: all children of this object including childrens children, (read-only). + @type childrenRecursive: L{CListValue} of L{KX_GameObject}'s + @group Deprecated: getPosition, setPosition, setWorldPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass, getMesh, getChildren, getChildrenRecursive """ def endObject(): """ @@ -1647,6 +1654,7 @@ class KX_GameObject(SCA_IObject): """ Sets the game object's position in world coordinates regardless if the object is root or child. + @deprecated: use L{worldPosition} @type pos: [x, y, z] @param pos: the new position, in world coordinates. """ @@ -2386,7 +2394,7 @@ class KX_MouseFocusSensor(SCA_MouseSensor): @ivar hitNormal: the worldspace normal from the face at point of intersection. @type hitNormal: list (normalized vector of 3 floats) """ - +#{ Deprecated def getHitNormal(): """ Returns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray. @@ -2435,6 +2443,7 @@ class KX_MouseFocusSensor(SCA_MouseSensor): @rtype: list [x, y, z] @return: the ray target. """ +#} class KX_TouchSensor(SCA_ISensor): """ @@ -2736,8 +2745,7 @@ class KX_ObjectActuator(SCA_IActuator): @rtype: list [dx, dy, dz, local] @return: A four item list, containing the angular displacement vector, and whether - the displacement is applied in local coordinates (True) or world - coordinates (False) + the displacement is applied in local coordinates (True) or world coordinates (False) """ def setDRot(dx, dy, dz, local): """ @@ -3660,7 +3668,7 @@ class KX_SCA_ReplaceMeshActuator(SCA_IActuator): # The mesh is a different mesh - switch it. # Check the current mesh is not a better fit. if curmesh == None or curmesh[1] < depth or curmesh[2] > depth: - act.setMesh(obj.getName() + newmesh[0]) + act.mesh = obj.getName() + newmesh[0] GameLogic.addActiveActuator(act, True) @warning: Replace mesh actuators will be ignored if at game start, the @@ -4008,7 +4016,7 @@ class KX_SoundActuator(SCA_IActuator): """ Sets the position this sound will come from. - @deprecated: Use the L{position} attribute instead. + @deprecated: Use the L{localPosition} attribute instead. @type x: float @param x: The x coordinate of the sound. @type y: float @@ -4120,6 +4128,7 @@ class KX_TrackToActuator(SCA_IActuator): @type use3D: boolean """ +#{ Deprecated def setObject(object): """ Sets the object to track. @@ -4168,6 +4177,7 @@ class KX_TrackToActuator(SCA_IActuator): @deprecated: Use the L{use3D} attribute instead. @rtype: boolean """ +#} class KX_VehicleWrapper(PyObjectPlus): """ -- cgit v1.2.3 From 9ce8a676906b6b07b0971f0d5886ae338d188629 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Sun, 17 May 2009 20:37:13 +0000 Subject: BGE Dome: removing of size option and adding tilt option. - Size adjustments can be accomplished with warp mesh data now. So we get a free spot in the GUI for a tilt option. - Tilt option to tilt the camera (for planetarium domes). Angle is in degree from -180 to +180. It's needed for planetarium domes (as this one http://domejunky.blogspot.com/2009/05/dome-corrected-bge.html ). - This is the last commit regarding dome code I expected to 2.49. I consider this feature full implemented now. (working on docs now) --- source/blender/blenkernel/intern/scene.c | 2 +- source/blender/blenloader/intern/readfile.c | 2 +- source/blender/makesdna/DNA_scene_types.h | 4 +- source/blender/src/buttons_scene.c | 8 ++-- .../BlenderRoutines/BL_KetsjiEmbedStart.cpp | 2 +- .../GamePlayer/ghost/GPG_Application.cpp | 2 +- source/gameengine/Ketsji/KX_Dome.cpp | 54 +++++++++++++--------- source/gameengine/Ketsji/KX_Dome.h | 20 ++++---- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 12 +---- source/gameengine/Ketsji/KX_KetsjiEngine.h | 2 +- 10 files changed, 54 insertions(+), 54 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index ed1a77d645e..df304568ed5 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -232,9 +232,9 @@ Scene *add_scene(char *name) sce->r.stereomode = 1; // no stereo sce->r.domeangle = 180; sce->r.domemode = 1; - sce->r.domesize = 1.0f; sce->r.domeres = 4; sce->r.domeresbuf = 1.0f; + sce->r.dometilt = 0; sce->r.simplify_subsurf= 6; sce->r.simplify_particles= 1.0f; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 6c5a5bd551c..91557da7aa6 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8082,9 +8082,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for (sce= main->scene.first; sce; sce= sce->id.next) { sce->r.domeangle = 180; sce->r.domemode = 1; - sce->r.domesize = 1.0f; sce->r.domeres = 4; sce->r.domeresbuf = 1.0f; + sce->r.dometilt = 0; } /* DBVT culling by default */ for(wrld=main->world.first; wrld; wrld= wrld->id.next) { diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index ac73ccc498c..36df11ac2e8 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -318,9 +318,9 @@ typedef struct RenderData { /* Dome variables */ short domeres, domemode; - short domeangle, pad9; - float domesize; + short domeangle, dometilt; float domeresbuf; + float pad2; struct Text *dometext; } RenderData; diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index d140001ba2d..3036bb78da8 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -1832,11 +1832,11 @@ static uiBlock *framing_render_menu(void *arg_unused) xco = 8; uiBlockBeginAlign(block); uiDefButS(block, ROW, 0, "Dome", xco, yco-=30, 88, 19, &(G.scene->r.stereomode), 7.0, 8.0, 0, 0, "Enables dome camera"); - uiDefButS(block, NUM, 0, "Ang:", xco+90, yco, 88, 19, &G.scene->r.domeangle, 90.0, 250.0, 0, 0, "Angle (Aperture) of the Dome - it only works in mode 1"); - uiDefButS(block, NUM, 0, "Mode:", xco+180, yco, 88, 19, &G.scene->r.domemode, 1.0, 3.0, 0, 0, "1 fisheye, 2 environment map, 3 spherical panoramic"); + uiDefButS(block, NUM, 0, "Ang:", xco+90, yco, 88, 19, &G.scene->r.domeangle, 90.0, 250.0, 0, 0, "Angle (Aperture) of the Dome - it only works in mode 1 to 3"); + uiDefButS(block, NUM, 0, "Mode:", xco+180, yco, 88, 19, &G.scene->r.domemode, 1.0, 5.0, 0, 0, "1 fulldome, 2 front-truncated, 3 rear-truncated, 4 environment map, 5 spherical panoramic"); - uiDefButF(block, NUM, 0, "Size:", xco, yco-=21, 88, 19, &G.scene->r.domesize, 0.5, 3.5, 0, 0, "Size adjustments"); - uiDefButS(block, NUM, 0, "Tes:", xco+90, yco, 88, 19, &G.scene->r.domeres, 1.0, 8.0, 0, 0, "Tesselation level - 1 to 8"); + uiDefButS(block, NUM, 0, "Tilt:", xco, yco-=21, 88, 19, &G.scene->r.dometilt, -180.0, 180.0, 0, 0, "Dome tilt - camera rotation in horizontal axis"); + uiDefButS(block, NUM, 0, "Tes:", xco+90, yco, 88, 19, &G.scene->r.domeres, 0.0, 8.0, 0, 0, "Tesselation level - check the generated mesh in wireframe mode"); uiDefButF(block, NUM, 0, "Res:", xco+180, yco, 88, 19, &G.scene->r.domeresbuf, 0.1, 1.0, 0, 0, "Buffer Resolution - decrease it to increase speed"); uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Warp Data: ", xco,yco-=21,268, 19, &G.scene->r.dometext, "Custom Warp Mesh data file"); diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 641938253b7..0e0377a7cb9 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -376,7 +376,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, //initialize Dome Settings if(blscene->r.stereomode == RAS_IRasterizer::RAS_STEREO_DOME) - ketsjiengine->InitDome(blscene->r.domesize, blscene->r.domeres, blscene->r.domemode, blscene->r.domeangle, blscene->r.domeresbuf, blscene->r.dometext); + ketsjiengine->InitDome(blscene->r.domeres, blscene->r.domemode, blscene->r.domeangle, blscene->r.domeresbuf, blscene->r.dometilt, blscene->r.dometext); if (sceneconverter) { diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index af8b94857b9..8a594f7365d 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -701,7 +701,7 @@ bool GPG_Application::startEngine(void) //initialize Dome Settings if(m_startScene->r.stereomode == RAS_IRasterizer::RAS_STEREO_DOME) - m_ketsjiengine->InitDome(m_startScene->r.domesize, m_startScene->r.domeres, m_startScene->r.domemode, m_startScene->r.domeangle, m_startScene->r.domeresbuf, m_startScene->r.dometext); + m_ketsjiengine->InitDome(m_startScene->r.domeres, m_startScene->r.domemode, m_startScene->r.domeangle, m_startScene->r.domeresbuf, m_startScene->r.dometilt, m_startScene->r.dometext); // Set the GameLogic.globalDict from marshal'd data, so we can // load new blend files and keep data in GameLogic.globalDict diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index 25efe0a59c9..daa31379985 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -43,23 +43,23 @@ KX_Dome::KX_Dome ( RAS_IRenderTools* rendertools, /// engine KX_KetsjiEngine* engine, - - float size, //size for adjustments + short res, //resolution of the mesh short mode, //mode - fisheye, truncated, warped, panoramic, ... short angle, float resbuf, //size adjustment of the buffer + short tilt, struct Text* warptext ): dlistSupported(false), canvaswidth(-1), canvasheight(-1), m_drawingmode(engine->GetDrawType()), - m_size(size), m_resolution(res), m_mode(mode), m_angle(angle), m_resbuffer(resbuf), + m_tilt(tilt), m_canvas(canvas), m_rasterizer(rasterizer), m_rendertools(rendertools), @@ -124,7 +124,7 @@ KX_Dome::KX_Dome ( CreateMeshPanorama(); m_numfaces = 6; break; - default: //DOME_TRUNCATED_DOWN and DOME_TRUNCATED_UP + default: //DOME_TRUNCATED_FRONT and DOME_TRUNCATED_REAR if (m_angle <= 180){ cubetop.resize(1); cubebottom.resize(1); @@ -269,7 +269,7 @@ http://projects.blender.org/tracker/?func=detail&aid=18655&group_id=9&atid=125 bool KX_Dome::CreateDL(){ dlistId = glGenLists((GLsizei) m_numimages); if (dlistId != 0) { - if(m_mode == DOME_FISHEYE || m_mode == DOME_TRUNCATED_UP || m_mode == DOME_TRUNCATED_DOWN){ + if(m_mode == DOME_FISHEYE || m_mode == DOME_TRUNCATED_FRONT || m_mode == DOME_TRUNCATED_REAR){ glNewList(dlistId, GL_COMPILE); GLDrawTriangles(cubetop, nfacestop); glEndList(); @@ -1485,13 +1485,14 @@ Uses 4 cameras for angles up to 180 Uses 5 cameras for angles up to 250º Uses 6 cameras for angles up to 360º */ + int i; float deg45 = MT_PI / 4; MT_Scalar c = cos(deg45); MT_Scalar s = sin(deg45); if (m_angle <= 180 && (m_mode == DOME_FISHEYE - || m_mode == DOME_TRUNCATED_UP - || m_mode == DOME_TRUNCATED_DOWN)){ + || m_mode == DOME_TRUNCATED_FRONT + || m_mode == DOME_TRUNCATED_REAR)){ m_locRot[0] = MT_Matrix3x3( // 90º - Top c, -s, 0.0, @@ -1514,8 +1515,8 @@ Uses 6 cameras for angles up to 360 s, 0.0, c); } else if (m_mode == DOME_ENVMAP || (m_angle > 180 && (m_mode == DOME_FISHEYE - || m_mode == DOME_TRUNCATED_UP - || m_mode == DOME_TRUNCATED_DOWN))){ + || m_mode == DOME_TRUNCATED_FRONT + || m_mode == DOME_TRUNCATED_REAR))){ m_locRot[0] = MT_Matrix3x3( // 90º - Top 1.0, 0.0, 0.0, @@ -1579,6 +1580,23 @@ Uses 6 cameras for angles up to 360 0.0, 1.0, 0.0, s, 0.0, c); } + + // rotating the camera in horizontal axis + if (m_tilt) + { + float tiltdeg = ((m_tilt % 360) * 2 * MT_PI) / 360; + c = cos(tiltdeg); + s = sin(tiltdeg); + + MT_Matrix3x3 tilt_mat = MT_Matrix3x3( + 1.0, 0.0, 0.0, + 0.0, c, -s, + 0.0, s, c + ); + + for (i =0;i<6;i++) + m_locRot[i] = tilt_mat * m_locRot[i]; + } } void KX_Dome::RotateCamera(KX_Camera* cam, int i) @@ -1621,10 +1639,10 @@ void KX_Dome::Draw(void) case DOME_PANORAM_SPH: DrawPanorama(); break; - case DOME_TRUNCATED_UP: + case DOME_TRUNCATED_FRONT: DrawDomeFisheye(); break; - case DOME_TRUNCATED_DOWN: + case DOME_TRUNCATED_REAR: DrawDomeFisheye(); break; } @@ -1670,9 +1688,6 @@ void KX_Dome::DrawEnvMap(void) ortho_width = (float)can_width/can_height * ortho_height; } - ortho_width /= m_size; - ortho_height /= m_size; - glOrtho((-ortho_width), ortho_width, (-ortho_height), ortho_height, -20.0, 10.0); } @@ -1803,20 +1818,17 @@ void KX_Dome::DrawDomeFisheye(void) ortho_height = 1.0; } - ortho_width /= m_size; - ortho_height /= m_size; - glOrtho((-ortho_width), ortho_width, (-ortho_height), ortho_height, -20.0, 10.0); } } - else if(m_mode == DOME_TRUNCATED_UP) + else if(m_mode == DOME_TRUNCATED_FRONT) { ortho_width = 1.0; ortho_height = 2 * ((float)can_height/can_width) - 1.0 ; glOrtho((-ortho_width), ortho_width, (-ortho_height), ortho_width, -20.0, 10.0); } - else { //m_mode == DOME_TRUNCATED_DOWN + else { //m_mode == DOME_TRUNCATED_REAR ortho_width = 1.0; ortho_height = 2 * ((float)can_height/can_width) - 1.0 ; @@ -1901,9 +1913,6 @@ void KX_Dome::DrawPanorama(void) ortho_width = (float)can_width/can_height * 0.5; ortho_height = 0.5; } - - ortho_width /= m_size; - ortho_height /= m_size; glOrtho((-ortho_width), ortho_width, (-ortho_height), ortho_height, -20.0, 10.0); } @@ -1972,7 +1981,6 @@ void KX_Dome::DrawDomeWarped(void) int can_height = m_viewport.GetTop(); double screen_ratio = can_width/ (double) can_height; - screen_ratio /= m_size; glOrtho(-screen_ratio,screen_ratio,-1.0,1.0,-20.0,10.0); diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h index 30d02dce7a0..032098d38ad 100644 --- a/source/gameengine/Ketsji/KX_Dome.h +++ b/source/gameengine/Ketsji/KX_Dome.h @@ -40,12 +40,12 @@ Developed as part of a Research and Development project for SAT - La Soci #include "BKE_text.h" //Dome modes: limit hardcoded in buttons_scene.c -#define DOME_FISHEYE 1 -#define DOME_ENVMAP 2 -#define DOME_PANORAM_SPH 3 -#define DOME_TRUNCATED_UP 4 -#define DOME_TRUNCATED_DOWN 5 -#define DOME_NUM_MODES 6 +#define DOME_FISHEYE 1 +#define DOME_TRUNCATED_FRONT 2 +#define DOME_TRUNCATED_REAR 3 +#define DOME_ENVMAP 4 +#define DOME_PANORAM_SPH 5 +#define DOME_NUM_MODES 6 /// class for render 3d scene @@ -61,12 +61,12 @@ public: RAS_IRenderTools* m_rendertools, /// engine KX_KetsjiEngine* m_engine, - - float size, + short res, short mode, short angle, float resbuf, + short tilt, struct Text* warptext ); @@ -159,13 +159,13 @@ protected: int m_buffersize; // canvas small dimension int m_numfaces; // 4 to 6 depending on the kind of dome image int m_numimages; //numfaces +1 if we have warp mesh - - float m_size; // size to adjust + short m_resolution; //resolution to tesselate the mesh short m_mode; // the mode (truncated, warped, panoramic,...) short m_angle; //the angle of the fisheye float m_radangle; //the angle of the fisheye in radians float m_resbuffer; //the resolution of the buffer + short m_tilt; //the dome tilt (camera rotation on horizontal axis) RAS_Rect m_viewport; diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index e773a9571f1..4107ed7d82e 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -262,9 +262,9 @@ void KX_KetsjiEngine::SetSceneConverter(KX_ISceneConverter* sceneconverter) m_sceneconverter = sceneconverter; } -void KX_KetsjiEngine::InitDome(float size, short res, short mode, short angle, float resbuf, struct Text* text) +void KX_KetsjiEngine::InitDome(short res, short mode, short angle, float resbuf, short tilt, struct Text* text) { - m_dome = new KX_Dome(m_canvas, m_rasterizer, m_rendertools,this, size, res, mode, angle, resbuf, text); + m_dome = new KX_Dome(m_canvas, m_rasterizer, m_rendertools,this, res, mode, angle, resbuf, tilt, text); m_usedome = true; } @@ -272,7 +272,6 @@ void KX_KetsjiEngine::RenderDome() { GLuint viewport[4]={0}; glGetIntegerv(GL_VIEWPORT,(GLint *)viewport); -// unsigned int m_viewport[4] = {viewport[0], viewport[1], viewport[2], viewport[3]}; m_dome->SetViewPort(viewport); @@ -297,13 +296,6 @@ void KX_KetsjiEngine::RenderDome() KX_SceneList::iterator sceneit; - // This is now done incrementally in KX_Scene::CalculateVisibleMeshes() - //for (sceneit = m_scenes.begin();sceneit != m_scenes.end(); sceneit++) - //{ - // // do this only once per scene - // (*sceneit)->UpdateMeshTransformations(); - //} - int n_renders=m_dome->GetNumberRenders();// usually 4 or 6 for (int i=0;iClearBuffer(RAS_ICanvas::COLOR_BUFFER|RAS_ICanvas::DEPTH_BUFFER); diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index 528465b6c2c..cc9b9198db7 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -211,7 +211,7 @@ public: RAS_IRenderTools* GetRenderTools(){return m_rendertools;}; /// Dome functions - void InitDome(float size, short res, short mode, short angle, float resbuf, struct Text* text); + void InitDome(short res, short mode, short angle, float resbuf, short tilt, struct Text* text); void EndDome(); void RenderDome(); bool m_usedome; -- cgit v1.2.3 From 9a40f4d2a63183edb741bd5280b27aa068773d92 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 17 May 2009 21:50:31 +0000 Subject: BGE: bookmark option on controller to make them run before all other controllers. A new bookmark button is available on the controller UI. When set, the controller is guaranteed to execute before all other non-bookmarked controllers, provided it is scheduled for execution. This is useful for initialization scripts that run once at startup or scripts that must set some prerequisite for the other controllers at the start of each logic frame. This feature is also available at python level with the "bookmark" attribute. It can be changed during the game. Note that if several script are bookmarked, their relative order of execution is not guaranteed. Make sure they don't depend on each other. --- source/blender/makesdna/DNA_controller_types.h | 1 + source/blender/src/buttons_logic.c | 5 +++-- source/gameengine/Converter/KX_ConvertControllers.cpp | 1 + source/gameengine/GameLogic/SCA_IController.cpp | 1 + source/gameengine/GameLogic/SCA_IController.h | 18 +++++++++++++++--- source/gameengine/GameLogic/SCA_IObject.cpp | 3 +-- source/gameengine/GameLogic/SCA_IObject.h | 7 ++++++- source/gameengine/Ketsji/KX_StateActuator.h | 11 +++++++++++ source/gameengine/PyDoc/GameTypes.py | 4 ++++ 9 files changed, 43 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/makesdna/DNA_controller_types.h b/source/blender/makesdna/DNA_controller_types.h index b3c82e746c1..599bbf9653a 100644 --- a/source/blender/makesdna/DNA_controller_types.h +++ b/source/blender/makesdna/DNA_controller_types.h @@ -79,6 +79,7 @@ typedef struct bController { #define CONT_DEL 2 #define CONT_NEW 4 #define CONT_MASK 8 +#define CONT_PRIO 16 /* pyctrl->flag */ #define CONT_PY_DEBUG 1 diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index a537d32feae..b229fe440a5 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -3788,6 +3788,7 @@ void logic_buts(void) uiBlockSetEmboss(block, UI_EMBOSSM); uiDefIconButBitS(block, TOG, CONT_DEL, B_DEL_CONT, ICON_X, xco, yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Delete Controller"); uiDefIconButBitS(block, ICONTOG, CONT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Controller settings"); + uiDefIconButBitS(block, TOG, CONT_PRIO, B_REDR, ICON_BOOKMARKS, (short)(xco+width-66), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Bookmarl controller to run before all other non-bookmarked controllers on each logic frame"); uiBlockSetEmboss(block, UI_EMBOSSP); sprintf(name, "%d", first_bit(cont->state_mask)+1); uiDefBlockBut(block, controller_state_mask_menu, cont, name, (short)(xco+width-44), yco, 22, 19, "Set controller state index (from 1 to 30)"); @@ -3796,7 +3797,7 @@ void logic_buts(void) if(cont->flag & CONT_SHOW) { cont->otype= cont->type; uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 70, 19, &cont->type, 0, 0, 0, 0, "Controller type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-136), 19, cont->name, 0, 31, 0, 0, "Controller name"); + but= uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-158), 19, cont->name, 0, 31, 0, 0, "Controller name"); uiButSetFunc(but, make_unique_prop_names_cb, cont->name, (void*) 0); ycoo= yco; @@ -3808,7 +3809,7 @@ void logic_buts(void) glRecti(xco+22, yco, xco+width-22,yco+19); but= uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, 19, cont, 0, 0, 0, 0, "Controller type"); uiButSetFunc(but, sca_move_controller, cont, NULL); - but= uiDefBut(block, LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-136), 19, cont, 0, 0, 0, 0, "Controller name"); + but= uiDefBut(block, LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-158), 19, cont, 0, 0, 0, 0, "Controller name"); uiButSetFunc(but, sca_move_controller, cont, NULL); ycoo= yco; } diff --git a/source/gameengine/Converter/KX_ConvertControllers.cpp b/source/gameengine/Converter/KX_ConvertControllers.cpp index 9b0e27b573a..85ab8e4f8b8 100644 --- a/source/gameengine/Converter/KX_ConvertControllers.cpp +++ b/source/gameengine/Converter/KX_ConvertControllers.cpp @@ -199,6 +199,7 @@ void BL_ConvertControllers( { LinkControllerToActuators(gamecontroller,bcontr,logicmgr,converter); gamecontroller->SetExecutePriority(executePriority++); + gamecontroller->SetBookmark((bcontr->flag & CONT_PRIO) != 0); gamecontroller->SetState(bcontr->state_mask); STR_String uniquename = bcontr->name; uniquename += "#CONTR#"; diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp index f8b081ef050..84a6bfb8085 100644 --- a/source/gameengine/GameLogic/SCA_IController.cpp +++ b/source/gameengine/GameLogic/SCA_IController.cpp @@ -244,6 +244,7 @@ PyAttributeDef SCA_IController::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("state", SCA_IController, pyattr_get_state), KX_PYATTRIBUTE_RO_FUNCTION("sensors", SCA_IController, pyattr_get_sensors), KX_PYATTRIBUTE_RO_FUNCTION("actuators", SCA_IController, pyattr_get_actuators), + KX_PYATTRIBUTE_BOOL_RW("bookmark",SCA_IController,m_bookmark), { NULL } //Sentinel }; diff --git a/source/gameengine/GameLogic/SCA_IController.h b/source/gameengine/GameLogic/SCA_IController.h index 1b9d8fb0d2b..a52c57ab3ed 100644 --- a/source/gameengine/GameLogic/SCA_IController.h +++ b/source/gameengine/GameLogic/SCA_IController.h @@ -45,6 +45,7 @@ protected: std::vector m_linkedactuators; unsigned int m_statemask; bool m_justActivated; + bool m_bookmark; public: SCA_IController(SCA_IObject* gameobj,PyTypeObject* T); virtual ~SCA_IController(); @@ -76,13 +77,24 @@ public: { m_justActivated = false; } - + void SetBookmark(bool bookmark) + { + m_bookmark = bookmark; + } void Activate(SG_DList& head) { if (QEmpty()) { - InsertActiveQList(m_gameobj->m_activeControllers); - head.AddBack(&m_gameobj->m_activeControllers); + if (m_bookmark) + { + m_gameobj->m_activeBookmarkedControllers.QAddBack(this); + head.AddFront(&m_gameobj->m_activeBookmarkedControllers); + } + else + { + InsertActiveQList(m_gameobj->m_activeControllers); + head.AddBack(&m_gameobj->m_activeControllers); + } } } diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index 8962c8e8580..2b87a7c1526 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -39,13 +39,12 @@ #endif MT_Point3 SCA_IObject::m_sDummy=MT_Point3(0,0,0); +SG_QList SCA_IObject::m_activeBookmarkedControllers; SCA_IObject::SCA_IObject(PyTypeObject* T): CValue(T), m_initState(0), m_state(0) { m_suspended = false; } - - SCA_IObject::~SCA_IObject() { diff --git a/source/gameengine/GameLogic/SCA_IObject.h b/source/gameengine/GameLogic/SCA_IObject.h index 281c72ecd46..c4f346059d4 100644 --- a/source/gameengine/GameLogic/SCA_IObject.h +++ b/source/gameengine/GameLogic/SCA_IObject.h @@ -64,11 +64,16 @@ protected: // SG_QList: Head of active actuators list on this object // Elements: SCA_IActuator SG_QList m_activeActuators; - // SG_Dlist: element of objects with active controllers + // SG_Dlist: element of list os lists with active controllers // Head: SCA_LogicManager::m_activeControllers // SG_QList: Head of active controller list on this object // Elements: SCA_IController SG_QList m_activeControllers; + // SG_Dlist: element of list of lists of active controllers + // Head: SCA_LogicManager::m_activeControllers + // SG_QList: Head of active bookmarked controller list globally + // Elements: SCA_IController with bookmark option + static SG_QList m_activeBookmarkedControllers; static class MT_Point3 m_sDummy; diff --git a/source/gameengine/Ketsji/KX_StateActuator.h b/source/gameengine/Ketsji/KX_StateActuator.h index 57303ad403f..a4191a4c5fd 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.h +++ b/source/gameengine/Ketsji/KX_StateActuator.h @@ -33,6 +33,13 @@ #include "SCA_IActuator.h" + +/* + * Use of SG_DList : element of actuator being deactivated + * Head: SCA_LogicManager::m_removedActuators + * Use of SG_QList : element of global activated state actuator list + * Head: KX_StateActuator::m_stateActuatorHead + */ class KX_StateActuator : public SCA_IActuator { Py_Header; @@ -46,6 +53,10 @@ class KX_StateActuator : public SCA_IActuator OP_NEG, OP_COUNT }; + // SG_Dlist: element of objects with active actuators, always put in front of the list + // Head: SCA_LogicManager::m_activeActuators + // SG_QList: Head of active state actuators list globally + // Elements: KX_StateActuator static SG_QList m_stateActuatorHead; int m_operation; int m_mask; diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index 3a6c62e7d23..ca02b1a2798 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -240,6 +240,10 @@ class SCA_IController(SCA_ILogicBrick): - note: the sensors are not necessarily owned by the same object. - note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup. @type actuators: sequence supporting index/string lookups and iteration. + @ivar bookmark: the bookmark option. + If set, the controller executes always before all other non-bookmarked controllers. + - note: Order of execution between bookmarked controllers is not guaranteed. + @type bookmark: bool """ #{ Deprecated def getState(): -- cgit v1.2.3 From 5a16f0b60cf373016881d1ce2d67a84b4121f265 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 May 2009 04:11:54 +0000 Subject: Bugfix for FBX export for animations in 2.48 constant interpolations meant that wasnt a problem but since it now uses linear interp. you can notice errors with animated characters because the 2 eulers are not compatible. Added optional euler_compat argument to matrix.toEuler(eul) and quat.toEuler(eul) so when getting the euler rotations from a list of matrices the animation curve will be continues. Also added euler.makeCompatible(euler). - warning silenced for imagepaint.c --- source/blender/python/api2_2x/doc/Mathutils.py | 14 +++++++++++-- source/blender/python/api2_2x/euler.c | 29 +++++++++++++++++++++++++- source/blender/python/api2_2x/euler.h | 1 + source/blender/python/api2_2x/matrix.c | 27 +++++++++++++++++------- source/blender/python/api2_2x/matrix.h | 2 +- source/blender/python/api2_2x/quat.c | 28 ++++++++++++++++++++----- source/blender/python/api2_2x/quat.h | 2 +- source/blender/src/imagepaint.c | 3 ++- 8 files changed, 88 insertions(+), 18 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/doc/Mathutils.py b/source/blender/python/api2_2x/doc/Mathutils.py index d8492558317..52cd5fbcc7f 100644 --- a/source/blender/python/api2_2x/doc/Mathutils.py +++ b/source/blender/python/api2_2x/doc/Mathutils.py @@ -617,6 +617,12 @@ class Euler: @rtype: Quaternion object @return: Quaternion representation of the euler. """ + def makeCompatible(eul_compat): + """ + Make this euler compatible with another, so interpolating between them works as expected. + @rtype: Euler object + @return: an instance of itself + """ class Quaternion: """ @@ -718,9 +724,11 @@ class Quaternion: @return: an instance of itself """ - def toEuler(): + def toEuler(eul_compat): """ Return Euler representation of the quaternion. + @type eul_compat: L{Euler} + @param eul_compat: Optional euler argument the new euler will be made compatible with (no axis flipping between them). Useful for converting a series of matrices to animation curves. @rtype: Euler object @return: Euler representation of the quaternion. """ @@ -870,9 +878,11 @@ class Matrix: @return: an instance of itself. """ - def toEuler(): + def toEuler(eul_compat): """ Return an Euler representation of the rotation matrix (3x3 or 4x4 matrix only). + @type eul_compat: L{Euler} + @param eul_compat: Optional euler argument the new euler will be made compatible with (no axis flipping between them). Useful for converting a series of matrices to animation curves. @rtype: Euler object @return: Euler representation of the rotation matrix. """ diff --git a/source/blender/python/api2_2x/euler.c b/source/blender/python/api2_2x/euler.c index 23f82fc0eb0..ae7eeed5d33 100644 --- a/source/blender/python/api2_2x/euler.c +++ b/source/blender/python/api2_2x/euler.c @@ -40,6 +40,7 @@ char Euler_ToMatrix_doc[] = "() - returns a rotation matrix representing the eul char Euler_ToQuat_doc[] = "() - returns a quaternion representing the euler rotation"; char Euler_Rotate_doc[] = "() - rotate a euler by certain amount around an axis of rotation"; char Euler_copy_doc[] = "() - returns a copy of the euler."; +char Euler_MakeCompatible_doc[] = "(euler) - Make this user compatible with another (no axis flipping)."; //-----------------------METHOD DEFINITIONS ---------------------- struct PyMethodDef Euler_methods[] = { {"zero", (PyCFunction) Euler_Zero, METH_NOARGS, Euler_Zero_doc}, @@ -47,6 +48,7 @@ struct PyMethodDef Euler_methods[] = { {"toMatrix", (PyCFunction) Euler_ToMatrix, METH_NOARGS, Euler_ToMatrix_doc}, {"toQuat", (PyCFunction) Euler_ToQuat, METH_NOARGS, Euler_ToQuat_doc}, {"rotate", (PyCFunction) Euler_Rotate, METH_VARARGS, Euler_Rotate_doc}, + {"makeCompatible", (PyCFunction) Euler_MakeCompatible, METH_O, Euler_MakeCompatible_doc}, {"__copy__", (PyCFunction) Euler_copy, METH_VARARGS, Euler_copy_doc}, {"copy", (PyCFunction) Euler_copy, METH_VARARGS, Euler_copy_doc}, {NULL, NULL, 0, NULL} @@ -173,6 +175,32 @@ PyObject *Euler_Rotate(EulerObject * self, PyObject *args) Py_INCREF(self); return (PyObject *)self; } + +PyObject *Euler_MakeCompatible(EulerObject * self, EulerObject *value) +{ + float eul_from_rad[3]; + int x; + + if(!EulerObject_Check(value)) { + PyErr_SetString(PyExc_TypeError, "euler.makeCompatible(euler):expected a single euler argument."); + return NULL; + } + + //covert to radians + for(x = 0; x < 3; x++) { + self->eul[x] = self->eul[x] * ((float)Py_PI / 180); + eul_from_rad[x] = value->eul[x] * ((float)Py_PI / 180); + } + compatible_eul(self->eul, eul_from_rad); + //convert back from radians + for(x = 0; x < 3; x++) { + self->eul[x] *= (180 / (float)Py_PI); + } + + Py_INCREF(self); + return (PyObject *)self; +} + //----------------------------Euler.rotate()----------------------- // return a copy of the euler PyObject *Euler_copy(EulerObject * self, PyObject *args) @@ -528,4 +556,3 @@ PyObject *newEulerObject(float *eul, int type) } return (PyObject *)self; } - diff --git a/source/blender/python/api2_2x/euler.h b/source/blender/python/api2_2x/euler.h index b76eb962baa..5a5a84074a7 100644 --- a/source/blender/python/api2_2x/euler.h +++ b/source/blender/python/api2_2x/euler.h @@ -58,6 +58,7 @@ PyObject *Euler_Unique( EulerObject * self ); PyObject *Euler_ToMatrix( EulerObject * self ); PyObject *Euler_ToQuat( EulerObject * self ); PyObject *Euler_Rotate( EulerObject * self, PyObject *args ); +PyObject *Euler_MakeCompatible( EulerObject * self, EulerObject *value ); PyObject *Euler_copy( EulerObject * self, PyObject *args ); PyObject *newEulerObject( float *eul, int type ); diff --git a/source/blender/python/api2_2x/matrix.c b/source/blender/python/api2_2x/matrix.c index 659f746468a..07f67c1c15f 100644 --- a/source/blender/python/api2_2x/matrix.c +++ b/source/blender/python/api2_2x/matrix.c @@ -41,7 +41,7 @@ char Matrix_TranslationPart_doc[] = "() - return a vector encompassing the trans char Matrix_RotationPart_doc[] = "() - return a vector encompassing the rotation of the matrix"; char Matrix_scalePart_doc[] = "() - convert matrix to a 3D vector"; char Matrix_Resize4x4_doc[] = "() - resize the matrix to a 4x4 square matrix"; -char Matrix_toEuler_doc[] = "() - convert matrix to a euler angle rotation"; +char Matrix_toEuler_doc[] = "(eul_compat) - convert matrix to a euler angle rotation, optional euler argument that the new euler will be made compatible with."; char Matrix_toQuat_doc[] = "() - convert matrix to a quaternion rotation"; char Matrix_copy_doc[] = "() - return a copy of the matrix"; /*-----------------------METHOD DEFINITIONS ----------------------*/ @@ -55,7 +55,7 @@ struct PyMethodDef Matrix_methods[] = { {"rotationPart", (PyCFunction) Matrix_RotationPart, METH_NOARGS, Matrix_RotationPart_doc}, {"scalePart", (PyCFunction) Matrix_scalePart, METH_NOARGS, Matrix_scalePart_doc}, {"resize4x4", (PyCFunction) Matrix_Resize4x4, METH_NOARGS, Matrix_Resize4x4_doc}, - {"toEuler", (PyCFunction) Matrix_toEuler, METH_NOARGS, Matrix_toEuler_doc}, + {"toEuler", (PyCFunction) Matrix_toEuler, METH_VARARGS, Matrix_toEuler_doc}, {"toQuat", (PyCFunction) Matrix_toQuat, METH_NOARGS, Matrix_toQuat_doc}, {"copy", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc}, {"__copy__", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc}, @@ -81,19 +81,32 @@ PyObject *Matrix_toQuat(MatrixObject * self) return newQuaternionObject(quat, Py_NEW); } /*---------------------------Matrix.toEuler() --------------------*/ -PyObject *Matrix_toEuler(MatrixObject * self) +PyObject *Matrix_toEuler(MatrixObject * self, PyObject *args) { - float eul[3]; - + float eul[3], eul_compatf[3]; + EulerObject *eul_compat = NULL; int x; - + + if(!PyArg_ParseTuple(args, "|O!:toEuler", &euler_Type, &eul_compat)) + return NULL; + + if(eul_compat) { + for(x = 0; x < 3; x++) { + eul_compatf[x] = eul_compat->eul[x] * ((float)Py_PI / 180); + } + } + /*must be 3-4 cols, 3-4 rows, square matrix*/ if(self->colSize ==3 && self->rowSize ==3) { - Mat3ToEul((float (*)[3])*self->matrix, eul); + if(eul_compat) Mat3ToCompatibleEul((float (*)[3])*self->matrix, eul, eul_compatf); + else Mat3ToEul((float (*)[3])*self->matrix, eul); }else if (self->colSize ==4 && self->rowSize ==4) { float tempmat3[3][3]; Mat3CpyMat4(tempmat3, (float (*)[4])*self->matrix); Mat3ToEul(tempmat3, eul); + if(eul_compat) Mat3ToCompatibleEul(tempmat3, eul, eul_compatf); + else Mat3ToEul(tempmat3, eul); + }else { PyErr_SetString(PyExc_AttributeError, "Matrix.toEuler(): inappropriate matrix size - expects 3x3 or 4x4 matrix\n"); return NULL; diff --git a/source/blender/python/api2_2x/matrix.h b/source/blender/python/api2_2x/matrix.h index 8e6bfc0674e..130977742f1 100644 --- a/source/blender/python/api2_2x/matrix.h +++ b/source/blender/python/api2_2x/matrix.h @@ -69,7 +69,7 @@ PyObject *Matrix_TranslationPart( MatrixObject * self ); PyObject *Matrix_RotationPart( MatrixObject * self ); PyObject *Matrix_scalePart( MatrixObject * self ); PyObject *Matrix_Resize4x4( MatrixObject * self ); -PyObject *Matrix_toEuler( MatrixObject * self ); +PyObject *Matrix_toEuler( MatrixObject * self, PyObject *args ); PyObject *Matrix_toQuat( MatrixObject * self ); PyObject *Matrix_copy( MatrixObject * self ); PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type); diff --git a/source/blender/python/api2_2x/quat.c b/source/blender/python/api2_2x/quat.c index 9c718d95c63..14fd5f9ba4c 100644 --- a/source/blender/python/api2_2x/quat.c +++ b/source/blender/python/api2_2x/quat.c @@ -39,7 +39,7 @@ char Quaternion_Negate_doc[] = "() - set all values in the quaternion to their n char Quaternion_Conjugate_doc[] = "() - set the quaternion to it's conjugate"; char Quaternion_Inverse_doc[] = "() - set the quaternion to it's inverse"; char Quaternion_Normalize_doc[] = "() - normalize the vector portion of the quaternion"; -char Quaternion_ToEuler_doc[] = "() - return a euler rotation representing the quaternion"; +char Quaternion_ToEuler_doc[] = "(eul_compat) - return a euler rotation representing the quaternion, optional euler argument that the new euler will be made compatible with."; char Quaternion_ToMatrix_doc[] = "() - return a rotation matrix representing the quaternion"; char Quaternion_copy_doc[] = "() - return a copy of the quat"; //-----------------------METHOD DEFINITIONS ---------------------- @@ -49,7 +49,7 @@ struct PyMethodDef Quaternion_methods[] = { {"conjugate", (PyCFunction) Quaternion_Conjugate, METH_NOARGS, Quaternion_Conjugate_doc}, {"inverse", (PyCFunction) Quaternion_Inverse, METH_NOARGS, Quaternion_Inverse_doc}, {"normalize", (PyCFunction) Quaternion_Normalize, METH_NOARGS, Quaternion_Normalize_doc}, - {"toEuler", (PyCFunction) Quaternion_ToEuler, METH_NOARGS, Quaternion_ToEuler_doc}, + {"toEuler", (PyCFunction) Quaternion_ToEuler, METH_VARARGS, Quaternion_ToEuler_doc}, {"toMatrix", (PyCFunction) Quaternion_ToMatrix, METH_NOARGS, Quaternion_ToMatrix_doc}, {"__copy__", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc}, {"copy", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc}, @@ -58,12 +58,30 @@ struct PyMethodDef Quaternion_methods[] = { //-----------------------------METHODS------------------------------ //----------------------------Quaternion.toEuler()------------------ //return the quat as a euler -PyObject *Quaternion_ToEuler(QuaternionObject * self) +PyObject *Quaternion_ToEuler(QuaternionObject * self, PyObject *args) { float eul[3]; + EulerObject *eul_compat = NULL; int x; - - QuatToEul(self->quat, eul); + + if(!PyArg_ParseTuple(args, "|O!:toEuler", &euler_Type, &eul_compat)) + return NULL; + + if(eul_compat) { + float mat[3][3], eul_compatf[3]; + + for(x = 0; x < 3; x++) { + eul_compatf[x] = eul_compat->eul[x] * ((float)Py_PI / 180); + } + + QuatToMat3(self->quat, mat); + Mat3ToCompatibleEul(mat, eul, eul_compatf); + } + else { + QuatToEul(self->quat, eul); + } + + for(x = 0; x < 3; x++) { eul[x] *= (180 / (float)Py_PI); } diff --git a/source/blender/python/api2_2x/quat.h b/source/blender/python/api2_2x/quat.h index ac70b4e3802..9f3a919bce0 100644 --- a/source/blender/python/api2_2x/quat.h +++ b/source/blender/python/api2_2x/quat.h @@ -62,7 +62,7 @@ PyObject *Quaternion_Negate( QuaternionObject * self ); PyObject *Quaternion_Conjugate( QuaternionObject * self ); PyObject *Quaternion_Inverse( QuaternionObject * self ); PyObject *Quaternion_Normalize( QuaternionObject * self ); -PyObject *Quaternion_ToEuler( QuaternionObject * self ); +PyObject *Quaternion_ToEuler( QuaternionObject * self, PyObject *args ); PyObject *Quaternion_ToMatrix( QuaternionObject * self ); PyObject *Quaternion_copy( QuaternionObject * self ); PyObject *newQuaternionObject( float *quat, int type ); diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c index 37670d09749..1a6eb10b00b 100644 --- a/source/blender/src/imagepaint.c +++ b/source/blender/src/imagepaint.c @@ -2603,7 +2603,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i if (!is_ortho) { pixelScreenCo[3] = 1.0f; - Mat4MulVec4fl(ps->projectMat, pixelScreenCo); + Mat4MulVec4fl((float (*)[4])*ps->projectMat, pixelScreenCo); pixelScreenCo[0] = (float)(curarea->winx/2.0f)+(curarea->winx/2.0f)*pixelScreenCo[0]/pixelScreenCo[3]; pixelScreenCo[1] = (float)(curarea->winy/2.0f)+(curarea->winy/2.0f)*pixelScreenCo[1]/pixelScreenCo[3]; pixelScreenCo[2] = pixelScreenCo[2]/pixelScreenCo[3]; /* Use the depth for bucket point occlusion */ @@ -4664,3 +4664,4 @@ void imagepaint_pick(short mousebutton) sample_vpaint(); } + -- cgit v1.2.3 From 07fc2aa5268da7708a289fa785b0f0cbd9be2575 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 18 May 2009 08:22:51 +0000 Subject: BGE #18665: Servo control and relative motion Servo control motion actuator did not work as expected when the object is moving on a moving platform. This patch introduces a new Ref field in the servo motion actuator to set a reference object for the velocity calculation. You can set the object during the game using the actuator "reference" attribute; use an object name or an object reference. The servo controller takes into account the angular velocity of the reference object to compute the relative local velocity. --- source/blender/blenkernel/intern/sca.c | 9 +++ source/blender/blenloader/intern/readfile.c | 17 +++++ source/blender/makesdna/DNA_actuator_types.h | 1 + source/blender/src/buttons_logic.c | 54 +++++++------- .../gameengine/Converter/KX_ConvertActuators.cpp | 7 +- source/gameengine/Ketsji/KX_ObjectActuator.cpp | 83 +++++++++++++++++++++- source/gameengine/Ketsji/KX_ObjectActuator.h | 12 +++- source/gameengine/PyDoc/GameTypes.py | 2 + 8 files changed, 155 insertions(+), 30 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index bbca97d75f7..ea7b566c3b5 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -579,6 +579,10 @@ void set_sca_new_poins_ob(Object *ob) bCameraActuator *ca= act->data; ID_NEW(ca->ob); } + else if(act->type==ACT_OBJECT) { + bObjectActuator *oa= act->data; + ID_NEW(oa->reference); + } else if(act->type==ACT_SCENE) { bSceneActuator *sca= act->data; ID_NEW(sca->camera); @@ -606,6 +610,7 @@ void sca_remove_ob_poin(Object *obt, Object *ob) bMessageSensor *ms; bActuator *act; bCameraActuator *ca; + bObjectActuator *oa; bSceneActuator *sa; bEditObjectActuator *eoa; bPropertyActuator *pa; @@ -628,6 +633,10 @@ void sca_remove_ob_poin(Object *obt, Object *ob) ca= act->data; if(ca->ob==ob) ca->ob= NULL; break; + case ACT_OBJECT: + oa= act->data; + if(oa->reference==ob) oa->reference= NULL; + break; case ACT_PROPERTY: pa= act->data; if(pa->ob==ob) pa->ob= NULL; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 91557da7aa6..0f233410f4e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3077,6 +3077,10 @@ static void lib_link_object(FileData *fd, Main *main) bAddObjectActuator *eoa= act->data; if(eoa) eoa->ob= newlibadr(fd, ob->id.lib, eoa->ob); } + else if(act->type==ACT_OBJECT) { + bObjectActuator *oa= act->data; + oa->reference= newlibadr(fd, ob->id.lib, oa->reference); + } else if(act->type==ACT_EDIT_OBJECT) { bEditObjectActuator *eoa= act->data; if(eoa==NULL) { @@ -3087,6 +3091,15 @@ static void lib_link_object(FileData *fd, Main *main) eoa->me= newlibadr(fd, ob->id.lib, eoa->me); } } + else if(act->type==ACT_OBJECT) { + bObjectActuator *oa= act->data; + if(oa==NULL) { + init_actuator(act); + } + else { + oa->reference= newlibadr(fd, ob->id.lib, oa->reference); + } + } else if(act->type==ACT_SCENE) { bSceneActuator *sa= act->data; sa->camera= newlibadr(fd, ob->id.lib, sa->camera); @@ -8862,6 +8875,10 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob) expand_doit(fd, mainvar, eoa->me); } } + else if(act->type==ACT_OBJECT) { + bObjectActuator *oa= act->data; + expand_doit(fd, mainvar, oa->reference); + } else if(act->type==ACT_SCENE) { bSceneActuator *sa= act->data; expand_doit(fd, mainvar, sa->camera); diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index aeabae42adf..81c02779cba 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -107,6 +107,7 @@ typedef struct bObjectActuator { float loc[3], rot[3]; float dloc[3], drot[3]; float linearvelocity[3], angularvelocity[3]; + struct Object *reference; } bObjectActuator; typedef struct bIpoActuator { diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index b229fe440a5..605568680ba 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -1830,42 +1830,44 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh } } else if (oa->type == ACT_OBJECT_SERVO) { - ysize= 172; + ysize= 195; glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - uiDefBut(block, LABEL, 0, "linV", xco, yco-45, 45, 19, NULL, 0, 0, 0, 0, "Sets the target linear velocity, it will be achieve by automatic application of force. Null velocity is a valid target"); - uiDefButF(block, NUM, 0, "", xco+45, yco-45, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-45, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-45, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, ""); - uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-45, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Velocity is defined in local coordinates"); - - uiDefBut(block, LABEL, 0, "Limit", xco, yco-68, 45, 19, NULL, 0, 0, 0, 0, "Select if the force need to be limited along certain axis (local or global depending on LinV Local flag)"); - uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_X, B_REDR, "X", xco+45, yco-68, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the X axis"); - uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_Y, B_REDR, "Y", xco+45+wval, yco-68, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the Y axis"); - uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_Z, B_REDR, "Z", xco+45+2*wval, yco-68, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the Z axis"); - uiDefBut(block, LABEL, 0, "Max", xco, yco-87, 45, 19, NULL, 0, 0, 0, 0, "Set the upper limit for force"); - uiDefBut(block, LABEL, 0, "Min", xco, yco-106, 45, 19, NULL, 0, 0, 0, 0, "Set the lower limit for force"); + uiDefBut(block, LABEL, 0, "Ref", xco, yco-45, 45, 19, NULL, 0, 0, 0, 0, ""); + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+45, yco-45, wval*3, 19, &(oa->reference), "Reference object for velocity calculation, leave empty for world reference"); + uiDefBut(block, LABEL, 0, "linV", xco, yco-68, 45, 19, NULL, 0, 0, 0, 0, "Sets the target relative linear velocity, it will be achieve by automatic application of force. Null velocity is a valid target"); + uiDefButF(block, NUM, 0, "", xco+45, yco-68, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-68, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-68, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, ""); + uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-68, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Velocity is defined in local coordinates"); + + uiDefBut(block, LABEL, 0, "Limit", xco, yco-91, 45, 19, NULL, 0, 0, 0, 0, "Select if the force need to be limited along certain axis (local or global depending on LinV Local flag)"); + uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_X, B_REDR, "X", xco+45, yco-91, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the X axis"); + uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_Y, B_REDR, "Y", xco+45+wval, yco-91, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the Y axis"); + uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_Z, B_REDR, "Z", xco+45+2*wval, yco-91, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the Z axis"); + uiDefBut(block, LABEL, 0, "Max", xco, yco-110, 45, 19, NULL, 0, 0, 0, 0, "Set the upper limit for force"); + uiDefBut(block, LABEL, 0, "Min", xco, yco-129, 45, 19, NULL, 0, 0, 0, 0, "Set the lower limit for force"); if (oa->flag & ACT_SERVO_LIMIT_X) { - uiDefButF(block, NUM, 0, "", xco+45, yco-87, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45, yco-106, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45, yco-110, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45, yco-129, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, ""); } if (oa->flag & ACT_SERVO_LIMIT_Y) { - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-87, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-106, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-110, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-129, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, ""); } if (oa->flag & ACT_SERVO_LIMIT_Z) { - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-87, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-106, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-110, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-129, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, ""); } - uiDefBut(block, LABEL, 0, "Servo", xco, yco-129, 45, 19, NULL, 0, 0, 0, 0, "Coefficients of the PID servo controller"); - uiDefButF(block, NUMSLI, B_REDR, "P: ", xco+45, yco-129, wval*3, 19, oa->forcerot, 0.00, 200.0, 100, 0, "Proportional coefficient, typical value is 60x Integral coefficient"); - uiDefBut(block, LABEL, 0, "Slow", xco, yco-148, 45, 19, NULL, 0, 0, 0, 0, "Low value of I coefficient correspond to slow response"); - but = uiDefButF(block, NUMSLI, B_REDR, " I : ", xco+45, yco-148, wval*3, 19, oa->forcerot+1, 0.0, 3.0, 1, 0, "Integral coefficient, low value (0.01) for slow response, high value (0.5) for fast response"); + uiDefBut(block, LABEL, 0, "Servo", xco, yco-152, 45, 19, NULL, 0, 0, 0, 0, "Coefficients of the PID servo controller"); + uiDefButF(block, NUMSLI, B_REDR, "P: ", xco+45, yco-152, wval*3, 19, oa->forcerot, 0.00, 200.0, 100, 0, "Proportional coefficient, typical value is 60x Integral coefficient"); + uiDefBut(block, LABEL, 0, "Slow", xco, yco-152, 45, 19, NULL, 0, 0, 0, 0, "Low value of I coefficient correspond to slow response"); + but = uiDefButF(block, NUMSLI, B_REDR, " I : ", xco+45, yco-171, wval*3, 19, oa->forcerot+1, 0.0, 3.0, 1, 0, "Integral coefficient, low value (0.01) for slow response, high value (0.5) for fast response"); uiButSetFunc(but, update_object_actuator_PID, oa, NULL); - uiDefBut(block, LABEL, 0, "Fast", xco+45+3*wval, yco-148, 45, 19, NULL, 0, 0, 0, 0, "High value of I coefficient correspond to fast response"); - uiDefButF(block, NUMSLI, B_REDR, "D: ", xco+45, yco-167, wval*3, 19, oa->forcerot+2, -100.0, 100.0, 100, 0, "Derivate coefficient, not required, high values can cause instability"); + uiDefBut(block, LABEL, 0, "Fast", xco+45+3*wval, yco-171, 45, 19, NULL, 0, 0, 0, 0, "High value of I coefficient correspond to fast response"); + uiDefButF(block, NUMSLI, B_REDR, "D: ", xco+45, yco-190, wval*3, 19, oa->forcerot+2, -100.0, 100.0, 100, 0, "Derivate coefficient, not required, high values can cause instability"); } str= "Motion Type %t|Simple motion %x0|Servo Control %x1"; but = uiDefButS(block, MENU, B_REDR, str, xco+40, yco-23, (width-80), 19, &oa->type, 0.0, 0.0, 0, 0, ""); @@ -3788,7 +3790,7 @@ void logic_buts(void) uiBlockSetEmboss(block, UI_EMBOSSM); uiDefIconButBitS(block, TOG, CONT_DEL, B_DEL_CONT, ICON_X, xco, yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Delete Controller"); uiDefIconButBitS(block, ICONTOG, CONT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Controller settings"); - uiDefIconButBitS(block, TOG, CONT_PRIO, B_REDR, ICON_BOOKMARKS, (short)(xco+width-66), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Bookmarl controller to run before all other non-bookmarked controllers on each logic frame"); + uiDefIconButBitS(block, TOG, CONT_PRIO, B_REDR, ICON_BOOKMARKS, (short)(xco+width-66), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Bookmarl controller to run before all other non-bookmarked controllers"); uiBlockSetEmboss(block, UI_EMBOSSP); sprintf(name, "%d", first_bit(cont->state_mask)+1); uiDefBlockBut(block, controller_state_mask_menu, cont, name, (short)(xco+width-44), yco, 22, 19, "Set controller state index (from 1 to 30)"); diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 60d64621665..98df34aa4a9 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -134,6 +134,7 @@ void BL_ConvertActuators(char* maggiename, case ACT_OBJECT: { bObjectActuator* obact = (bObjectActuator*) bact->data; + KX_GameObject* obref = NULL; MT_Vector3 forcevec(KX_BLENDERTRUNC(obact->forceloc[0]), KX_BLENDERTRUNC(obact->forceloc[1]), KX_BLENDERTRUNC(obact->forceloc[2])); @@ -171,9 +172,13 @@ void BL_ConvertActuators(char* maggiename, bitLocalFlag.AngularVelocity = bool((obact->flag & ACT_ANG_VEL_LOCAL)!=0); bitLocalFlag.ServoControl = bool(obact->type == ACT_OBJECT_SERVO); bitLocalFlag.AddOrSetLinV = bool((obact->flag & ACT_ADD_LIN_VEL)!=0); - + if (obact->reference && bitLocalFlag.ServoControl) + { + obref = converter->FindGameObject(obact->reference); + } KX_ObjectActuator* tmpbaseact = new KX_ObjectActuator(gameobj, + obref, forcevec.getValue(), torquevec.getValue(), dlocvec.getValue(), diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 0232e3407b0..eaae04d406d 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -45,6 +45,7 @@ KX_ObjectActuator:: KX_ObjectActuator( SCA_IObject* gameobj, + KX_GameObject* refobj, const MT_Vector3& force, const MT_Vector3& torque, const MT_Vector3& dloc, @@ -69,6 +70,7 @@ KX_ObjectActuator( m_previous_error(0.0,0.0,0.0), m_error_accumulator(0.0,0.0,0.0), m_bitLocalFlag (flag), + m_reference(refobj), m_active_combined_velocity (false), m_linear_damping_active(false), m_angular_damping_active(false) @@ -80,10 +82,17 @@ KX_ObjectActuator( m_pid = m_torque; } - + if (m_reference) + m_reference->RegisterActuator(this); UpdateFuzzyFlags(); } +KX_ObjectActuator::~KX_ObjectActuator() +{ + if (m_reference) + m_reference->UnregisterActuator(this); +} + bool KX_ObjectActuator::Update() { @@ -132,6 +141,18 @@ bool KX_ObjectActuator::Update() if (mass < MT_EPSILON) return false; MT_Vector3 v = parent->GetLinearVelocity(m_bitLocalFlag.LinearVelocity); + if (m_reference) + { + const MT_Point3& mypos = parent->NodeGetWorldPosition(); + const MT_Point3& refpos = m_reference->NodeGetWorldPosition(); + MT_Point3 relpos; + relpos = (mypos-refpos); + MT_Vector3 vel= m_reference->GetVelocity(relpos); + if (m_bitLocalFlag.LinearVelocity) + // must convert in local space + vel = parent->NodeGetWorldOrientation().transposed()*vel; + v -= vel; + } MT_Vector3 e = m_linear_velocity - v; MT_Vector3 dv = e - m_previous_error; MT_Vector3 I = m_error_accumulator + e; @@ -260,7 +281,34 @@ CValue* KX_ObjectActuator::GetReplica() return replica; } +void KX_ObjectActuator::ProcessReplica() +{ + SCA_IActuator::ProcessReplica(); + if (m_reference) + m_reference->RegisterActuator(this); +} +bool KX_ObjectActuator::UnlinkObject(SCA_IObject* clientobj) +{ + if (clientobj == (SCA_IObject*)m_reference) + { + // this object is being deleted, we cannot continue to use it as reference. + m_reference = NULL; + return true; + } + return false; +} + +void KX_ObjectActuator::Relink(GEN_Map *obj_map) +{ + void **h_obj = (*obj_map)[m_reference]; + if (h_obj) { + if (m_reference) + m_reference->UnregisterActuator(this); + m_reference = (KX_GameObject*)(*h_obj); + m_reference->RegisterActuator(this); + } +} /* some 'standard' utilities... */ bool KX_ObjectActuator::isValid(KX_ObjectActuator::KX_OBJECT_ACT_VEC_TYPE type) @@ -357,6 +405,7 @@ PyAttributeDef KX_ObjectActuator::Attributes[] = { KX_PYATTRIBUTE_RW_FUNCTION("forceLimitY", KX_ObjectActuator, pyattr_get_forceLimitY, pyattr_set_forceLimitY), KX_PYATTRIBUTE_RW_FUNCTION("forceLimitZ", KX_ObjectActuator, pyattr_get_forceLimitZ, pyattr_set_forceLimitZ), KX_PYATTRIBUTE_VECTOR_RW_CHECK("pid", -100, 200, true, KX_ObjectActuator, m_pid, PyCheckPid), + KX_PYATTRIBUTE_RW_FUNCTION("reference", KX_ObjectActuator,pyattr_get_reference,pyattr_set_reference), { NULL } //Sentinel }; @@ -484,6 +533,38 @@ int KX_ObjectActuator::pyattr_set_forceLimitZ(void *self_v, const KX_PYATTRIBUTE return PY_SET_ATTR_FAIL; } +PyObject* KX_ObjectActuator::pyattr_get_reference(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) +{ + KX_ObjectActuator* actuator = static_cast(self); + if (!actuator->m_reference) + Py_RETURN_NONE; + + return actuator->m_reference->GetProxy(); +} + +int KX_ObjectActuator::pyattr_set_reference(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) +{ + KX_ObjectActuator* actuator = static_cast(self); + KX_GameObject *refOb; + + if (!ConvertPythonToGameObject(value, &refOb, true, "actu.reference = value: KX_ObjectActuator")) + return PY_SET_ATTR_FAIL; + + if (actuator->m_reference) + actuator->m_reference->UnregisterActuator(actuator); + + if(refOb==NULL) { + actuator->m_reference= NULL; + } + else { + actuator->m_reference = refOb; + actuator->m_reference->RegisterActuator(actuator); + } + + return PY_SET_ATTR_SUCCESS; +} + + /* 1. set ------------------------------------------------------------------ */ /* Removed! */ diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h index b60f877074d..f9bd2a0c748 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.h +++ b/source/gameengine/Ketsji/KX_ObjectActuator.h @@ -35,6 +35,8 @@ #include "SCA_IActuator.h" #include "MT_Vector3.h" +class KX_GameObject; + // // Stores the flags for each CValue derived class // @@ -92,7 +94,7 @@ class KX_ObjectActuator : public SCA_IActuator MT_Vector3 m_previous_error; MT_Vector3 m_error_accumulator; KX_LocalFlags m_bitLocalFlag; - + KX_GameObject* m_reference; // A hack bool -- oh no sorry everyone // This bool is used to check if we have informed // the physics object that we are no longer @@ -121,6 +123,7 @@ public: KX_ObjectActuator( SCA_IObject* gameobj, + KX_GameObject* refobj, const MT_Vector3& force, const MT_Vector3& torque, const MT_Vector3& dloc, @@ -131,8 +134,11 @@ public: const KX_LocalFlags& flag, PyTypeObject* T=&Type ); - + ~KX_ObjectActuator(); CValue* GetReplica(); + void ProcessReplica(); + bool UnlinkObject(SCA_IObject* clientobj); + void Relink(GEN_Map *obj_map); void SetForceLoc(const double force[3]) { /*m_force=force;*/ } void UpdateFuzzyFlags() @@ -188,6 +194,8 @@ public: static int pyattr_set_forceLimitY(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static PyObject* pyattr_get_forceLimitZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_forceLimitZ(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_reference(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_reference(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); // This lets the attribute macros use UpdateFuzzyFlags() static int PyUpdateFuzzyFlags(void *self, const PyAttributeDef *attrdef) diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index ca02b1a2798..5ec6f31e30c 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -2668,6 +2668,8 @@ class KX_ObjectActuator(SCA_IActuator): @ivar pid: The PID coefficients of the servo controller @type pid: list of floats [proportional, integral, derivate] + @ivar reference: The object that is used as reference to compute the velocity for the servo controller. + @type reference: KX_GameObject or None @group Deprecated: getForce, setForce, getTorque, setTorque, getDLoc, setDLoc, getDRot, setDRot, getLinearVelocity, setLinearVelocity, getAngularVelocity, setAngularVelocity, getDamping, setDamping, getForceLimitX, setForceLimitX, getForceLimitY, setForceLimitY, getForceLimitZ, setForceLimitZ, -- cgit v1.2.3 From cb96dc40e8b1039382a1bb978b82adcedcd8c713 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 May 2009 10:27:09 +0000 Subject: Sensor objects were initialized as invisible, which conflicted with initializing the invisible setting from the outliner render object (which it seems nobody knew about). Added an 'Invisible' button to make this more clear, it seems like a display option but its also related to logic because the actuators can toggle this after the game starts. Without this its annoying to add UV's only to set the invisible flag. Sensor objects were not clearing the softbody gameflag --- source/blender/src/buttons_logic.c | 19 +++++++++++++------ source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 2 -- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 605568680ba..2cda73eaef3 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -3068,7 +3068,7 @@ static void check_body_type(void *arg1_but, void *arg2_object) switch (ob->body_type) { case OB_BODY_TYPE_SENSOR: ob->gameflag |= OB_SENSOR|OB_COLLISION|OB_GHOST; - ob->gameflag &= ~(OB_OCCLUDER|OB_DYNAMIC|OB_RIGID_BODY|OB_ACTOR|OB_ANISOTROPIC_FRICTION|OB_DO_FH|OB_ROT_FH|OB_COLLISION_RESPONSE); + ob->gameflag &= ~(OB_OCCLUDER|OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY|OB_ACTOR|OB_ANISOTROPIC_FRICTION|OB_DO_FH|OB_ROT_FH|OB_COLLISION_RESPONSE); break; case OB_BODY_TYPE_OCCLUDER: ob->gameflag |= OB_OCCLUDER; @@ -3315,14 +3315,21 @@ static void buttons_bullet(uiBlock *block, Object *ob) "Object type%t|Occluder%x5|No collision%x0|Sensor%x6|Static%x1|Dynamic%x2|Rigid body%x3|Soft body%x4", 10, 205, 100, 19, &ob->body_type, 0, 0, 0, 0, tip); uiButSetFunc(but, check_body_type, but, ob); - + + uiBlockEndAlign(block); + + uiDefButBitS(block, TOG, OB_RESTRICT_RENDER, B_NOP, "Invisible", + 210, 205, 60, 19, + &ob->restrictflag, 0, 0, 0, 0, + "Initializes objects as invisible, this can be toggled by the visibility actuator (uses outliner render option)"); + if (ob->gameflag & OB_COLLISION) { if (ob->gameflag & OB_SENSOR) { uiBlockEndAlign(block); uiDefBlockBut(block, advanced_bullet_menu, ob, - "Advanced Settings", - 210, 205, 140, 19, "Display collision advanced settings"); + "Advanced", + 270, 205, 80, 19, "Display collision advanced settings"); uiBlockBeginAlign(block); } else { uiDefButBitI(block, TOG, OB_ACTOR, 0, "Actor", @@ -3338,8 +3345,8 @@ static void buttons_bullet(uiBlock *block, Object *ob) //uiBlockSetCol(block, TH_BUT_SETTING1); uiDefBlockBut(block, advanced_bullet_menu, ob, - "Advanced Settings", - 210, 205, 140, 19, "Display collision advanced settings"); + "Advanced", + 270, 205, 80, 19, "Display collision advanced settings"); //uiBlockSetCol(block, TH_BUT_SETTING2); } diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index 73693e68642..d81b6d5a653 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -1129,8 +1129,6 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, // bullet will not synchronize, we must do it explicitely SG_Callbacks& callbacks = gameobj->GetSGNode()->GetCallBackFunctions(); callbacks.m_updatefunc = KX_GameObject::SynchronizeTransformFunc; - // make sensor object invisible by default - gameobj->SetVisible(false, false); } // don't add automatically sensor object, they are added when a collision sensor is registered else if (objprop->m_in_active_layer) -- cgit v1.2.3 From b1a393e8156d9020aaefb25cf5cf8fb4103cea75 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 18 May 2009 10:34:26 +0000 Subject: Bugfix #18733 & #18609 (revisited) New imbuf scaling code, advertised as "quick and quality" gave inacceptable noise and rounding errors. Check this bugreport for images that show it well: http://projects.blender.org/tracker/?func=detail&atid=125&aid=18609&group_id=9 For release, better disable this code and fall back on perfectly working old code. :) --- source/blender/imbuf/intern/scaling.c | 36 +++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'source') diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index b308915cd62..1ccdad05deb 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -596,12 +596,12 @@ static void shrink_picture_byte( y_counter = 65536; for (y_src = 0; y_src < src_height; y_src++) { unsigned char* line = src + y_src * 4 * src_width; - uintptr_t weight1y = 65536 - (y_dst & 0xffff); - uintptr_t weight2y = 65536 - weight1y; + uintptr_t weight1y = 65535 - (y_dst & 0xffff); + uintptr_t weight2y = 65535 - weight1y; x_dst = 0; for (x_src = 0; x_src < src_width; x_src++) { - uintptr_t weight1x = 65536 - (x_dst & 0xffff); - uintptr_t weight2x = 65536 - weight1x; + uintptr_t weight1x = 65535 - (x_dst & 0xffff); + uintptr_t weight2x = 65535 - weight1x; uintptr_t x = x_dst >> 16; @@ -609,7 +609,7 @@ static void shrink_picture_byte( w = (weight1y * weight1x) >> 16; - /* ensure correct rounding, without this you get ugly banding (ton) */ + /* ensure correct rounding, without this you get ugly banding, or too low color values (ton) */ dst_line1[x].r += (line[0] * w + 32767) >> 16; dst_line1[x].g += (line[1] * w + 32767) >> 16; dst_line1[x].b += (line[2] * w + 32767) >> 16; @@ -647,18 +647,18 @@ static void shrink_picture_byte( y_dst += dy_dst; y_counter -= dy_dst; if (y_counter < 0) { + int val; uintptr_t x; struct scale_outpix_byte * temp; y_counter += 65536; for (x=0; x < dst_width; x++) { - uintptr_t f = 0x80000000UL - / dst_line1[x].weight; - *dst++ = (dst_line1[x].r * f) >> 15; - *dst++ = (dst_line1[x].g * f) >> 15; - *dst++ = (dst_line1[x].b * f) >> 15; - *dst++ = (dst_line1[x].a * f) >> 15; + uintptr_t f = 0x80000000UL / dst_line1[x].weight; + *dst++ = (val= (dst_line1[x].r * f) >> 15) > 255 ? 255: val; + *dst++ = (val= (dst_line1[x].g * f) >> 15) > 255 ? 255: val; + *dst++ = (val= (dst_line1[x].b * f) >> 15) > 255 ? 255: val; + *dst++ = (val= (dst_line1[x].a * f) >> 15) > 255 ? 255: val; } memset(dst_line1, 0, dst_width * sizeof(struct scale_outpix_byte)); @@ -668,13 +668,14 @@ static void shrink_picture_byte( } } if (dst - dst_begin < dst_width * dst_height * 4) { + int val; uintptr_t x; for (x = 0; x < dst_width; x++) { uintptr_t f = 0x80000000UL / dst_line1[x].weight; - *dst++ = (dst_line1[x].r * f) >> 15; - *dst++ = (dst_line1[x].g * f) >> 15; - *dst++ = (dst_line1[x].b * f) >> 15; - *dst++ = (dst_line1[x].a * f) >> 15; + *dst++ = (val= (dst_line1[x].r * f) >> 15) > 255 ? 255: val; + *dst++ = (val= (dst_line1[x].g * f) >> 15) > 255 ? 255: val; + *dst++ = (val= (dst_line1[x].b * f) >> 15) > 255 ? 255: val; + *dst++ = (val= (dst_line1[x].a * f) >> 15) > 255 ? 255: val; } } MEM_freeN(dst_line1); @@ -912,6 +913,8 @@ static void q_scale_float(float* in, float* out, int in_width, Should be comparable in speed to the ImBuf ..._fast functions at least for byte-buffers. + NOTE: disabled, due to inacceptable inaccuracy and quality loss, see bug #18609 (ton) + */ static int q_scale_linear_interpolation( struct ImBuf *ibuf, int newx, int newy) @@ -1584,7 +1587,8 @@ struct ImBuf *IMB_scaleImBuf(struct ImBuf * ibuf, short newx, short newy) scalefast_Z_ImBuf(ibuf, newx, newy); /* try to scale common cases in a fast way */ - if (q_scale_linear_interpolation(ibuf, newx, newy)) { + /* disabled, quality loss is inacceptable, see report #18609 (ton) */ + if (0 && q_scale_linear_interpolation(ibuf, newx, newy)) { return ibuf; } -- cgit v1.2.3 From 65bd48c896492a6485121524171f2f447fe1b95f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 May 2009 11:15:24 +0000 Subject: [#18778] Lattice Vertex Groups Don't get deleted fixed 'Copy Group' for lattice too. --- source/blender/src/editdeform.c | 57 +++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 19 deletions(-) (limited to 'source') diff --git a/source/blender/src/editdeform.c b/source/blender/src/editdeform.c index 8a07a4fddff..ac027b2c1ad 100644 --- a/source/blender/src/editdeform.c +++ b/source/blender/src/editdeform.c @@ -211,11 +211,10 @@ void duplicate_defgroup ( Object *ob ) bDeformGroup *dg, *cdg; char name[32], s[32]; MDeformWeight *org, *cpy; - MDeformVert *dvert; - Mesh *me; - int i, idg, icdg; + MDeformVert *dvert, *dvert_array; + int i, idg, icdg, dvert_tot; - if (ob->type != OB_MESH) + if (ob->type != OB_MESH && ob->type != OB_LATTICE) return; dg = BLI_findlink (&ob->defbase, (ob->actdef-1)); @@ -246,12 +245,22 @@ void duplicate_defgroup ( Object *ob ) ob->actdef = BLI_countlist (&ob->defbase); icdg = (ob->actdef-1); - me = get_mesh (ob); - if (!me->dvert) + if(ob->type == OB_MESH) { + Mesh *me = get_mesh (ob); + dvert_array= me->dvert; + dvert_tot= me->totvert; + } + else if (ob->type == OB_LATTICE) { + Lattice *lt= (Lattice *)ob->data; + dvert_array= lt->dvert; + dvert_tot= lt->pntsu*lt->pntsv*lt->pntsw; + } + + if (!dvert_array) return; - for (i = 0; i < me->totvert; i++) { - dvert = me->dvert+i; + for (i = 0; i < dvert_tot; i++) { + dvert = dvert_array+i; org = get_defweight (dvert, idg); if (org) { cpy = verify_defweight (dvert, icdg); @@ -323,29 +332,39 @@ static void del_defgroup_update_users(Object *ob, int id) void del_defgroup_in_object_mode ( Object *ob ) { bDeformGroup *dg; - MDeformVert *dvert; - Mesh *me; - int i, e; + MDeformVert *dvert_array, *dvert; + + int i, e, dvert_tot; - if ((!ob) || (ob->type != OB_MESH)) + if ((!ob) || (ob->type != OB_MESH && ob->type != OB_LATTICE)) return; + if(ob->type == OB_MESH) { + Mesh *me = get_mesh (ob); + dvert_array= me->dvert; + dvert_tot= me->totvert; + } + else if (ob->type == OB_LATTICE) { + Lattice *lt= (Lattice *)ob->data; + dvert_array= lt->dvert; + dvert_tot= lt->pntsu*lt->pntsv*lt->pntsw; + } + dg = BLI_findlink (&ob->defbase, (ob->actdef-1)); if (!dg) return; - - me = get_mesh (ob); - if (me->dvert) { - for (i = 0; i < me->totvert; i++) { - dvert = me->dvert + i; + + if (dvert_array) { + for (i = 0; i < dvert_tot; i++) { + dvert = dvert_array + i; if (dvert) { if (get_defweight (dvert, (ob->actdef-1))) remove_vert_defgroup (ob, dg, i); } } - for (i = 0; i < me->totvert; i++) { - dvert = me->dvert+i; + for (i = 0; i < dvert_tot; i++) { + dvert = dvert_array+i; if (dvert) { for (e = 0; e < dvert->totweight; e++) { if (dvert->dw[e].def_nr > (ob->actdef-1)) -- cgit v1.2.3 From 9c8f09d2a0ade9eefb430c6cab3c98c23b0e188a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 May 2009 14:20:16 +0000 Subject: bug in copy weight group since 2.44, accessing free'd memory. --- source/blender/src/editdeform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/editdeform.c b/source/blender/src/editdeform.c index ac027b2c1ad..e9e4c2e2440 100644 --- a/source/blender/src/editdeform.c +++ b/source/blender/src/editdeform.c @@ -263,8 +263,10 @@ void duplicate_defgroup ( Object *ob ) dvert = dvert_array+i; org = get_defweight (dvert, idg); if (org) { + float weight = org->weight; + /* verify_defweight re-allocs org so need to store the weight first */ cpy = verify_defweight (dvert, icdg); - cpy->weight = org->weight; + cpy->weight = weight; } } } -- cgit v1.2.3 From d35a556d6603d021cf3297ed3b2519e46b74871b Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Mon, 18 May 2009 20:23:38 +0000 Subject: Bug fix for: [#18761] GLSL Negative light option in Blender does not work in the GE --- source/blender/gpu/intern/gpu_material.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index f7052694fc7..93604e76527 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1309,9 +1309,9 @@ void GPU_lamp_update(GPULamp *lamp, int lay, float obmat[][4]) void GPU_lamp_update_colors(GPULamp *lamp, float r, float g, float b, float energy) { lamp->la->energy = energy; - lamp->la->r = r; - lamp->la->g = g; - lamp->la->b = b; + lamp->la->r = fabs(r); + lamp->la->g = fabs(g); + lamp->la->b = fabs(b); lamp->col[0]= lamp->la->r*lamp->energy; lamp->col[1]= lamp->la->g*lamp->energy; -- cgit v1.2.3 From 2ac81cc7ad83135b00e2e44103f69515a751bafd Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 18 May 2009 21:32:03 +0000 Subject: BGE soft body: give access to the soft body collision margin in the Advanced panel. By default the collision margin is set to 0.25, which causes the soft body to somewhat float above the ground. You can decrease this value to get more realistic collision. Note that the algorithm may become unstable with lower margin. --- source/blender/makesdna/DNA_object_force.h | 1 + source/blender/src/buttons_logic.c | 10 ++++++++-- source/gameengine/Converter/BL_BlenderDataConversion.cpp | 3 ++- source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 6 +++++- 4 files changed, 16 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index e8e865a533c..dc449a64c6d 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -120,6 +120,7 @@ typedef struct BulletSoftBody { int collisionflags; /* Vertex/Face or Signed Distance Field(SDF) or Clusters, Soft versus Soft or Rigid */ int numclusteriterations; /* number of iterations to refine collision clusters*/ float welding; /* welding limit to remove duplicate/nearby vertices, 0.0..0.01 */ + float margin; /* margin specific to softbody */ } BulletSoftBody; /* BulletSoftBody.flag */ diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 2cda73eaef3..2f8933b593b 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -3141,8 +3141,14 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) uiBlockEndAlign(block); yco -= 20; xco = 0; - uiDefButF(block, NUMSLI, 0, "Welding ", - xco, yco, 360, 19, &ob->bsoft->welding, 0.f, 0.01f, 10, 4, + if (ob->bsoft->margin < 0.001f) + ob->bsoft->margin = 0.25f; + uiDefButF(block, NUM, 0, "Margin", + xco, yco, 180, 19, &ob->bsoft->margin, 0.001, 1.0, 1, 0, + "Collision margin for soft body. Small value makes the algorithm unstable"); + + uiDefButF(block, NUM, 0, "Welding ", + xco+=180, yco, 180, 19, &ob->bsoft->welding, 0.f, 0.01f, 10, 4, "Welding threshold: distance between nearby vertices to be considered equal => set to 0.0 to disable welding test and speed up scene loading (ok if the mesh has no duplicates)"); /* diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index d4cc047d5e3..13aac74edca 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1456,7 +1456,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, objprop.m_soft_collisionflags= blenderobject->bsoft->collisionflags; /* Vertex/Face or Signed Distance Field(SDF) or Clusters, Soft versus Soft or Rigid */ objprop.m_soft_numclusteriterations= blenderobject->bsoft->numclusteriterations; /* number of iterations to refine collision clusters*/ objprop.m_soft_welding = blenderobject->bsoft->welding; /* welding */ - + objprop.m_margin = blenderobject->bsoft->margin; } else { objprop.m_gamesoftFlag = OB_BSB_BENDING_CONSTRAINTS | OB_BSB_SHAPE_MATCHING | OB_BSB_AERO_VPOINT; @@ -1496,6 +1496,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, objprop.m_soft_collisionflags= OB_BSB_COL_SDF_RS + OB_BSB_COL_VF_SS; objprop.m_soft_numclusteriterations= 16; objprop.m_soft_welding = 0.f; + objprop.m_margin = 0.f; } } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 7302c47f4bf..6b00011b693 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -296,7 +296,11 @@ void CcdPhysicsController::CreateRigidbody() } } - + if (m_cci.m_margin > 0.f) + { + psb->getCollisionShape()->setMargin(m_cci.m_margin); + psb->updateBounds(); + } m_object = psb; -- cgit v1.2.3 From def33757e303255bfd9c17eb716a02d49df58062 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 19 May 2009 05:07:52 +0000 Subject: recorded game physics ipo's also have the same problem FBX export had with eulers rotations http://www.graphicall.org/ftp/ideasman42/game_euler.png - dont calculate handles for key added (it does them all at the end). - was doing twice the number of curve lookup's per frame as was needed. - test handles function that runs at the end was converting to ipo transformation values for no reason. - when adding new curves set them to linear interpolation. --- .../Converter/KX_BlenderSceneConverter.cpp | 284 ++++++--------------- 1 file changed, 73 insertions(+), 211 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 190f9dbb472..c9ac7a23625 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -87,6 +87,7 @@ extern "C" #include "BSE_editipo_types.h" #include "DNA_ipo_types.h" #include "BKE_global.h" +#include "BKE_ipo.h" // eval_icu #include "DNA_space_types.h" } @@ -666,7 +667,9 @@ extern "C" struct IpoCurve *verify_ipocurve(struct ID *, short, char *, char *, char *, int, short); void testhandles_ipocurve(struct IpoCurve *icu); void insert_vert_icu(struct IpoCurve *, float, float, short); - void Mat3ToEul(float tmat[][3], float *eul); + float eval_icu(struct IpoCurve *icu, float ipotime); + //void Mat3ToEul(float tmat[][3], float *eul); + void Mat3ToCompatibleEul(float mat[][3], float *eul, float *oldrot); } IpoCurve* findIpoCurve(IpoCurve* first, const char* searchName) @@ -816,7 +819,6 @@ void KX_BlenderSceneConverter::resetNoneDynamicObjectToIpo(){ } } -#define TEST_HANDLES_GAME2IPO 0 ///this generates ipo curves for position, rotation, allowing to use game physics in animation void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber) @@ -840,138 +842,80 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber) //KX_IPhysicsController* physCtrl = gameObj->GetPhysicsController(); Object* blenderObject = FindBlenderObject(gameObj); - if (blenderObject) + if (blenderObject && blenderObject->ipo) { - + const MT_Point3& position = gameObj->NodeGetWorldPosition(); + //const MT_Vector3& scale = gameObj->NodeGetWorldScaling(); const MT_Matrix3x3& orn = gameObj->NodeGetWorldOrientation(); + float eulerAngles[3]; + float eulerAnglesOld[3] = {0.0f, 0.0f, 0.0f}; float tmat[3][3]; - for (int r=0;r<3;r++) - { - for (int c=0;c<3;c++) - { - tmat[r][c] = orn[c][r]; - } - } - Mat3ToEul(tmat, eulerAngles); - - for(int x = 0; x < 3; x++) { - eulerAngles[x] *= (float) (180 / 3.14159265f); - } - - eulerAngles[0]/=10.f; - eulerAngles[1]/=10.f; - eulerAngles[2]/=10.f; - - - - //const MT_Vector3& scale = gameObj->NodeGetWorldScaling(); - const MT_Point3& position = gameObj->NodeGetWorldPosition(); Ipo* ipo = blenderObject->ipo; - if (ipo) - { - //create the curves, if not existing + //create the curves, if not existing, set linear if new - IpoCurve *icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocX"); - if (!icu1) - icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_X, 1); + IpoCurve *icu_lx = findIpoCurve((IpoCurve *)ipo->curve.first,"LocX"); + if (!icu_lx) { + icu_lx = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_X, 1); + if(icu_lx) icu_lx->ipo = IPO_LIN; + } + IpoCurve *icu_ly = findIpoCurve((IpoCurve *)ipo->curve.first,"LocY"); + if (!icu_ly) { + icu_ly = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Y, 1); + if(icu_ly) icu_ly->ipo = IPO_LIN; + } + IpoCurve *icu_lz = findIpoCurve((IpoCurve *)ipo->curve.first,"LocZ"); + if (!icu_lz) { + icu_lz = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Z, 1); + if(icu_lz) icu_lz->ipo = IPO_LIN; + } + IpoCurve *icu_rx = findIpoCurve((IpoCurve *)ipo->curve.first,"RotX"); + if (!icu_rx) { + icu_rx = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_X, 1); + if(icu_rx) icu_rx->ipo = IPO_LIN; + } + IpoCurve *icu_ry = findIpoCurve((IpoCurve *)ipo->curve.first,"RotY"); + if (!icu_ry) { + icu_ry = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Y, 1); + if(icu_ry) icu_ry->ipo = IPO_LIN; + } + IpoCurve *icu_rz = findIpoCurve((IpoCurve *)ipo->curve.first,"RotZ"); + if (!icu_rz) { + icu_rz = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Z, 1); + if(icu_rz) icu_rz->ipo = IPO_LIN; + } - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocY"); - if (!icu1) - icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Y, 1); + if(icu_rx) eulerAnglesOld[0]= eval_icu( icu_rx, frameNumber - 1 ) / ((180 / 3.14159265f) / 10); + if(icu_ry) eulerAnglesOld[1]= eval_icu( icu_ry, frameNumber - 1 ) / ((180 / 3.14159265f) / 10); + if(icu_rz) eulerAnglesOld[2]= eval_icu( icu_rz, frameNumber - 1 ) / ((180 / 3.14159265f) / 10); + + // orn.getValue((float *)tmat); // uses the wrong ordering, cant use this + for (int r=0;r<3;r++) + for (int c=0;c<3;c++) + tmat[r][c] = orn[c][r]; + + // Mat3ToEul(tmat, eulerAngles); // better to use Mat3ToCompatibleEul + Mat3ToCompatibleEul(tmat, eulerAngles, eulerAnglesOld); + + //eval_icu + for(int x = 0; x < 3; x++) + eulerAngles[x] *= (float) ((180 / 3.14159265f) / 10.0); - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocZ"); - if (!icu1) - icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Z, 1); - - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotX"); - if (!icu1) - icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_X, 1); - - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotY"); - if (!icu1) - icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Y, 1); - - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotZ"); - if (!icu1) - icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Z, 1); - - - //fill the curves with data - - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocX"); - if (icu1) - { - float curVal = position.x(); - insert_vert_icu(icu1, frameNumber, curVal, 0); -#ifdef TEST_HANDLES_GAME2IPO - testhandles_ipocurve(icu1); -#endif - } - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocY"); - if (icu1) - { - float curVal = position.y(); - insert_vert_icu(icu1, frameNumber, curVal, 0); -#ifdef TEST_HANDLES_GAME2IPO - - testhandles_ipocurve(icu1); -#endif - } - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocZ"); - if (icu1) - { - float curVal = position.z(); - insert_vert_icu(icu1, frameNumber, curVal, 0); -#ifdef TEST_HANDLES_GAME2IPO - testhandles_ipocurve(icu1); -#endif - } - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotX"); - if (icu1) - { - float curVal = eulerAngles[0]; - insert_vert_icu(icu1, frameNumber, curVal, 0); -#ifdef TEST_HANDLES_GAME2IPO - - testhandles_ipocurve(icu1); -#endif - } - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotY"); - if (icu1) - { - float curVal = eulerAngles[1]; - insert_vert_icu(icu1, frameNumber, curVal, 0); -#ifdef TEST_HANDLES_GAME2IPO - - testhandles_ipocurve(icu1); -#endif - } - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotZ"); - if (icu1) - { - float curVal = eulerAngles[2]; - insert_vert_icu(icu1, frameNumber, curVal, 0); -#ifdef TEST_HANDLES_GAME2IPO - - testhandles_ipocurve(icu1); -#endif - - } - - } + if (icu_lx) insert_vert_icu(icu_lx, frameNumber, position.x(), 1); + if (icu_ly) insert_vert_icu(icu_ly, frameNumber, position.y(), 1); + if (icu_lz) insert_vert_icu(icu_lz, frameNumber, position.z(), 1); + if (icu_rx) insert_vert_icu(icu_rx, frameNumber, eulerAngles[0], 1); + if (icu_ry) insert_vert_icu(icu_ry, frameNumber, eulerAngles[1], 1); + if (icu_rz) insert_vert_icu(icu_rz, frameNumber, eulerAngles[2], 1); + + // Handles are corrected at the end, testhandles_ipocurve isnt needed yet } } - } - - - } - - + } } @@ -996,100 +940,18 @@ void KX_BlenderSceneConverter::TestHandlesPhysicsObjectToAnimationIpo() //KX_IPhysicsController* physCtrl = gameObj->GetPhysicsController(); Object* blenderObject = FindBlenderObject(gameObj); - if (blenderObject) + if (blenderObject && blenderObject->ipo) { - - const MT_Matrix3x3& orn = gameObj->NodeGetWorldOrientation(); - float eulerAngles[3]; - float tmat[3][3]; - for (int r=0;r<3;r++) - { - for (int c=0;c<3;c++) - { - tmat[r][c] = orn[c][r]; - } - } - Mat3ToEul(tmat, eulerAngles); - - for(int x = 0; x < 3; x++) { - eulerAngles[x] *= (float) (180 / 3.14159265f); - } - - eulerAngles[0]/=10.f; - eulerAngles[1]/=10.f; - eulerAngles[2]/=10.f; - - - - //const MT_Vector3& scale = gameObj->NodeGetWorldScaling(); - //const MT_Point3& position = gameObj->NodeGetWorldPosition(); - Ipo* ipo = blenderObject->ipo; - if (ipo) - { - - //create the curves, if not existing - - IpoCurve *icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocX"); - if (!icu1) - icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_X, 1); - - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocY"); - if (!icu1) - icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Y, 1); - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocZ"); - if (!icu1) - icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_LOC_Z, 1); - - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotX"); - if (!icu1) - icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_X, 1); - - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotY"); - if (!icu1) - icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Y, 1); - - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotZ"); - if (!icu1) - icu1 = verify_ipocurve(&blenderObject->id, ipo->blocktype, NULL, NULL, NULL, OB_ROT_Z, 1); - - - - //fill the curves with data - - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocX"); - if (icu1) - { - testhandles_ipocurve(icu1); - } - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocY"); - if (icu1) - { - testhandles_ipocurve(icu1); - } - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"LocZ"); - if (icu1) - { - testhandles_ipocurve(icu1); - } - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotX"); - if (icu1) - { - testhandles_ipocurve(icu1); - } - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotY"); - if (icu1) - { - testhandles_ipocurve(icu1); - } - icu1 = findIpoCurve((IpoCurve *)ipo->curve.first,"RotZ"); - if (icu1) - { - testhandles_ipocurve(icu1); - } - - } + //create the curves, if not existing + //testhandles_ipocurve checks for NULL + testhandles_ipocurve(findIpoCurve((IpoCurve *)ipo->curve.first,"LocX")); + testhandles_ipocurve(findIpoCurve((IpoCurve *)ipo->curve.first,"LocY")); + testhandles_ipocurve(findIpoCurve((IpoCurve *)ipo->curve.first,"LocZ")); + testhandles_ipocurve(findIpoCurve((IpoCurve *)ipo->curve.first,"RotX")); + testhandles_ipocurve(findIpoCurve((IpoCurve *)ipo->curve.first,"RotY")); + testhandles_ipocurve(findIpoCurve((IpoCurve *)ipo->curve.first,"RotZ")); } } -- cgit v1.2.3 From 5bd4b25dd1997672e4487f7dcba76e4b74ce814f Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Tue, 19 May 2009 06:48:36 +0000 Subject: BGE bug #18762 fixed: softbody. An incompatibility between the soft body deformer and other types of deformer was causing the soft body to disappear in the game. This was the case when the soft body had an armature or simply vertex groups. --- source/gameengine/Converter/BL_SkinDeformer.h | 4 ++ source/gameengine/Rasterizer/RAS_Deformer.h | 4 ++ .../gameengine/Rasterizer/RAS_MaterialBucket.cpp | 66 ++++++++++++++-------- 3 files changed, 51 insertions(+), 23 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h index 8d3167746be..7c43246a9d7 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.h +++ b/source/gameengine/Converter/BL_SkinDeformer.h @@ -90,6 +90,10 @@ public: { m_lastArmaUpdate = -1.0; }; + virtual bool ShareVertexArray() + { + return false; + } protected: BL_ArmatureObject* m_armobj; // Our parent object diff --git a/source/gameengine/Rasterizer/RAS_Deformer.h b/source/gameengine/Rasterizer/RAS_Deformer.h index 9dc656ba56a..fe9b1540af8 100644 --- a/source/gameengine/Rasterizer/RAS_Deformer.h +++ b/source/gameengine/Rasterizer/RAS_Deformer.h @@ -54,6 +54,10 @@ public: { return false; } + virtual bool ShareVertexArray() + { + return true; + } virtual bool UseVertexArray() { return true; diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index 841264465cf..8e90c9a1c08 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -284,35 +284,55 @@ void RAS_MeshSlot::AddPolygonVertex(int offset) void RAS_MeshSlot::SetDeformer(RAS_Deformer* deformer) { if (deformer && m_pDeformer != deformer) { - // we create local copy of RAS_DisplayArray when we have a deformer: - // this way we can avoid conflict between the vertex cache of duplicates RAS_DisplayArrayList::iterator it; - for(it=m_displayArrays.begin(); it!=m_displayArrays.end(); it++) { - if (deformer->UseVertexArray()) { - // the deformer makes use of vertex array, make sure we have our local copy - if ((*it)->m_users > 1) { - // only need to copy if there are other users - // note that this is the usual case as vertex arrays are held by the material base slot - RAS_DisplayArray *newarray = new RAS_DisplayArray(*(*it)); - newarray->m_users = 1; - (*it)->m_users--; - *it = newarray; - } - } else { - // the deformer is not using vertex array (Modifier), release them + if (deformer->ShareVertexArray()) { + // this deformer uses the base vertex array, first release the current ones + for(it=m_displayArrays.begin(); it!=m_displayArrays.end(); it++) { (*it)->m_users--; if((*it)->m_users == 0) delete *it; } - } - if (!deformer->UseVertexArray()) { m_displayArrays.clear(); - m_startarray = 0; - m_startvertex = 0; - m_startindex = 0; - m_endarray = 0; - m_endvertex = 0; - m_endindex = 0; + // then hook to the base ones + RAS_MeshMaterial *mmat = m_mesh->GetMeshMaterial(m_bucket->GetPolyMaterial()); + if (mmat && mmat->m_baseslot) { + m_displayArrays = mmat->m_baseslot->m_displayArrays; + for(it=m_displayArrays.begin(); it!=m_displayArrays.end(); it++) { + (*it)->m_users++; + } + } + } + else { + // no sharing + // we create local copy of RAS_DisplayArray when we have a deformer: + // this way we can avoid conflict between the vertex cache of duplicates + for(it=m_displayArrays.begin(); it!=m_displayArrays.end(); it++) { + if (deformer->UseVertexArray()) { + // the deformer makes use of vertex array, make sure we have our local copy + if ((*it)->m_users > 1) { + // only need to copy if there are other users + // note that this is the usual case as vertex arrays are held by the material base slot + RAS_DisplayArray *newarray = new RAS_DisplayArray(*(*it)); + newarray->m_users = 1; + (*it)->m_users--; + *it = newarray; + } + } else { + // the deformer is not using vertex array (Modifier), release them + (*it)->m_users--; + if((*it)->m_users == 0) + delete *it; + } + } + if (!deformer->UseVertexArray()) { + m_displayArrays.clear(); + m_startarray = 0; + m_startvertex = 0; + m_startindex = 0; + m_endarray = 0; + m_endvertex = 0; + m_endindex = 0; + } } } m_pDeformer = deformer; -- cgit v1.2.3 From 1a16fb1953a566cd57f49683d4711b7052d6b586 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 19 May 2009 07:16:40 +0000 Subject: BGE Py API use PY_SET_ATTR_FAIL and PY_SET_ATTR_SUCCESS return values so the fake subclassing can know if a value failed to be set or if it was missing from the type. (with PY_SET_ATTR_MISSING) Also noticed some other mistakes. - KX_LightObject, setting the type didnt check for an int. - KX_SoundActuator, didnt return an error when assigning an invalid orientation value - KX_GameObject, worldOrientation didnt return an error value. --- source/gameengine/Converter/BL_ActionActuator.cpp | 6 +-- .../Converter/BL_ShapeActionActuator.cpp | 6 +-- .../gameengine/GameLogic/SCA_PythonController.cpp | 4 +- source/gameengine/GameLogic/SCA_RandomActuator.cpp | 4 +- source/gameengine/GameLogic/SCA_RandomSensor.cpp | 4 +- source/gameengine/Ketsji/KX_CDActuator.cpp | 2 +- source/gameengine/Ketsji/KX_Camera.cpp | 24 +++++------ source/gameengine/Ketsji/KX_CameraActuator.cpp | 4 +- source/gameengine/Ketsji/KX_GameObject.cpp | 46 +++++++++++----------- source/gameengine/Ketsji/KX_Light.cpp | 11 ++++-- source/gameengine/Ketsji/KX_ParentActuator.cpp | 4 +- source/gameengine/Ketsji/KX_PolygonMaterial.cpp | 8 ++-- .../gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp | 4 +- .../Ketsji/KX_SCA_ReplaceMeshActuator.cpp | 4 +- source/gameengine/Ketsji/KX_SoundActuator.cpp | 37 ++++++++--------- source/gameengine/Ketsji/KX_TrackToActuator.cpp | 4 +- 16 files changed, 89 insertions(+), 83 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index d0a4a87af72..0812693ee0a 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -1037,7 +1037,7 @@ int BL_ActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF if (!PyString_Check(value)) { PyErr_SetString(PyExc_ValueError, "actuator.action = val: Action Actuator, expected the string name of the action"); - return -1; + return PY_SET_ATTR_FAIL; } bAction *action= NULL; @@ -1049,11 +1049,11 @@ int BL_ActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF if (!action) { PyErr_SetString(PyExc_ValueError, "actuator.action = val: Action Actuator, action not found!"); - return 1; + return PY_SET_ATTR_FAIL; } } self->SetAction(action); - return 0; + return PY_SET_ATTR_SUCCESS; } diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index a24d83da90c..bf7edb5f641 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -870,7 +870,7 @@ int BL_ShapeActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE if (!PyString_Check(value)) { PyErr_SetString(PyExc_ValueError, "actuator.action = val: Shape Action Actuator, expected the string name of the action"); - return -1; + return PY_SET_ATTR_FAIL; } bAction *action= NULL; @@ -882,11 +882,11 @@ int BL_ShapeActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE if (action==NULL) { PyErr_SetString(PyExc_ValueError, "actuator.action = val: Shape Action Actuator, action not found!"); - return 1; + return PY_SET_ATTR_FAIL; } } self->SetAction(action); - return 0; + return PY_SET_ATTR_SUCCESS; } diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index abb3b36b91e..d58259457e6 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -563,14 +563,14 @@ int SCA_PythonController::pyattr_set_script(void *self_v, const KX_PYATTRIBUTE_D if (scriptArg==NULL) { PyErr_SetString(PyExc_TypeError, "controller.script = string: Python Controller, expected a string script text"); - return -1; + return PY_SET_ATTR_FAIL; } /* set scripttext sets m_bModified to true, so next time the script is needed, a reparse into byte code is done */ self->SetScriptText(scriptArg); - return 0; + return PY_SET_ATTR_SUCCESS; } diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index ff957d8350e..1bc4487b5bf 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -387,10 +387,10 @@ int SCA_RandomActuator::pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_ if (PyInt_Check(value)) { int ival = PyInt_AsLong(value); act->m_base->SetSeed(ival); - return 0; + return PY_SET_ATTR_SUCCESS; } else { PyErr_SetString(PyExc_TypeError, "actuator.seed = int: Random Actuator, expected an integer"); - return 1; + return PY_SET_ATTR_FAIL; } } diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 1581a29480e..3c04173d10e 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -236,10 +236,10 @@ int SCA_RandomSensor::pyattr_set_seed(void *self_v, const KX_PYATTRIBUTE_DEF *at SCA_RandomSensor* self= static_cast(self_v); if (!PyInt_Check(value)) { PyErr_SetString(PyExc_TypeError, "sensor.seed = int: Random Sensor, expected an integer"); - return -1; + return PY_SET_ATTR_FAIL; } self->m_basegenerator->SetSeed(PyInt_AsLong(value)); - return 0; + return PY_SET_ATTR_SUCCESS; } /* eof */ diff --git a/source/gameengine/Ketsji/KX_CDActuator.cpp b/source/gameengine/Ketsji/KX_CDActuator.cpp index 7f8505afa3d..8511526fd5f 100644 --- a/source/gameengine/Ketsji/KX_CDActuator.cpp +++ b/source/gameengine/Ketsji/KX_CDActuator.cpp @@ -214,7 +214,7 @@ int KX_CDActuator::pyattr_setGain(void *self, const struct KX_PYATTRIBUTE_DEF *a { KX_CDActuator* act = static_cast(self); SND_CDObject::Instance()->SetGain(act->m_gain); - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_CDActuator::py_getattro(PyObject *attr) diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 625710fa65d..fe50b371475 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -806,11 +806,11 @@ int KX_Camera::pyattr_set_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *at int param = PyObject_IsTrue( value ); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.perspective = bool: KX_Camera, expected True/False or 0/1"); - return -1; + return PY_SET_ATTR_FAIL; } self->m_camdata.m_perspective= param; - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_Camera::pyattr_get_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -825,12 +825,12 @@ int KX_Camera::pyattr_set_lens(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, float param = PyFloat_AsDouble(value); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.lens = float: KX_Camera, expected a float greater then zero"); - return -1; + return PY_SET_ATTR_FAIL; } self->m_camdata.m_lens= param; self->m_set_projection_matrix = false; - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_Camera::pyattr_get_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -845,12 +845,12 @@ int KX_Camera::pyattr_set_near(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, float param = PyFloat_AsDouble(value); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.near = float: KX_Camera, expected a float greater then zero"); - return -1; + return PY_SET_ATTR_FAIL; } self->m_camdata.m_clipstart= param; self->m_set_projection_matrix = false; - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_Camera::pyattr_get_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -865,12 +865,12 @@ int KX_Camera::pyattr_set_far(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, P float param = PyFloat_AsDouble(value); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.far = float: KX_Camera, expected a float greater then zero"); - return -1; + return PY_SET_ATTR_FAIL; } self->m_camdata.m_clipend= param; self->m_set_projection_matrix = false; - return 0; + return PY_SET_ATTR_SUCCESS; } @@ -886,10 +886,10 @@ int KX_Camera::pyattr_set_use_viewport(void *self_v, const KX_PYATTRIBUTE_DEF *a int param = PyObject_IsTrue( value ); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "camera.useViewport = bool: KX_Camera, expected True or False"); - return 1; + return PY_SET_ATTR_FAIL; } self->EnableViewport((bool)param); - return 0; + return PY_SET_ATTR_SUCCESS; } @@ -904,10 +904,10 @@ int KX_Camera::pyattr_set_projection_matrix(void *self_v, const KX_PYATTRIBUTE_D KX_Camera* self= static_cast(self_v); MT_Matrix4x4 mat; if (!PyMatTo(value, mat)) - return -1; + return PY_SET_ATTR_FAIL; self->SetProjectionMatrix(mat); - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_Camera::pyattr_get_modelview_matrix(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index b87d0ee4283..3a6011db604 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -597,7 +597,7 @@ int KX_CameraActuator::pyattr_set_object(void *self_v, const KX_PYATTRIBUTE_DEF KX_GameObject *gameobj; if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.object = value: KX_CameraActuator")) - return 1; // ConvertPythonToGameObject sets the error + return PY_SET_ATTR_FAIL; // ConvertPythonToGameObject sets the error if (self->m_ob) self->m_ob->UnregisterActuator(self); @@ -605,7 +605,7 @@ int KX_CameraActuator::pyattr_set_object(void *self_v, const KX_PYATTRIBUTE_DEF if ((self->m_ob = (SCA_IObject*)gameobj)) self->m_ob->RegisterActuator(self); - return 0; + return PY_SET_ATTR_SUCCESS; } /* eof */ diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index cbd17e66f62..63d508e6250 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1468,13 +1468,13 @@ int KX_GameObject::pyattr_set_mass(void *self_v, const KX_PYATTRIBUTE_DEF *attrd MT_Scalar val = PyFloat_AsDouble(value); if (val < 0.0f) { /* also accounts for non float */ PyErr_SetString(PyExc_AttributeError, "gameOb.mass = float: KX_GameObject, expected a float zero or above"); - return 1; + return PY_SET_ATTR_FAIL; } if (spc) spc->SetMass(val); - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_GameObject::pyattr_get_lin_vel_min(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -1491,13 +1491,13 @@ int KX_GameObject::pyattr_set_lin_vel_min(void *self_v, const KX_PYATTRIBUTE_DEF MT_Scalar val = PyFloat_AsDouble(value); if (val < 0.0f) { /* also accounts for non float */ PyErr_SetString(PyExc_AttributeError, "gameOb.linVelocityMin = float: KX_GameObject, expected a float zero or above"); - return 1; + return PY_SET_ATTR_FAIL; } if (spc) spc->SetLinVelocityMin(val); - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_GameObject::pyattr_get_lin_vel_max(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -1514,13 +1514,13 @@ int KX_GameObject::pyattr_set_lin_vel_max(void *self_v, const KX_PYATTRIBUTE_DEF MT_Scalar val = PyFloat_AsDouble(value); if (val < 0.0f) { /* also accounts for non float */ PyErr_SetString(PyExc_AttributeError, "gameOb.linVelocityMax = float: KX_GameObject, expected a float zero or above"); - return 1; + return PY_SET_ATTR_FAIL; } if (spc) spc->SetLinVelocityMax(val); - return 0; + return PY_SET_ATTR_SUCCESS; } @@ -1536,12 +1536,12 @@ int KX_GameObject::pyattr_set_visible(void *self_v, const KX_PYATTRIBUTE_DEF *at int param = PyObject_IsTrue( value ); if (param == -1) { PyErr_SetString(PyExc_AttributeError, "gameOb.visible = bool: KX_GameObject, expected True or False"); - return 1; + return PY_SET_ATTR_FAIL; } self->SetVisible(param, false); self->UpdateBuckets(false); - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_GameObject::pyattr_get_worldPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -1555,11 +1555,11 @@ int KX_GameObject::pyattr_set_worldPosition(void *self_v, const KX_PYATTRIBUTE_D KX_GameObject* self= static_cast(self_v); MT_Point3 pos; if (!PyVecTo(value, pos)) - return 1; + return PY_SET_ATTR_FAIL; self->NodeSetWorldPosition(pos); self->NodeUpdateGS(0.f); - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_GameObject::pyattr_get_localPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -1576,11 +1576,11 @@ int KX_GameObject::pyattr_set_localPosition(void *self_v, const KX_PYATTRIBUTE_D KX_GameObject* self= static_cast(self_v); MT_Point3 pos; if (!PyVecTo(value, pos)) - return 1; + return PY_SET_ATTR_FAIL; self->NodeSetLocalPosition(pos); self->NodeUpdateGS(0.f); - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_GameObject::pyattr_get_localInertia(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -1606,7 +1606,7 @@ int KX_GameObject::pyattr_set_worldOrientation(void *self_v, const KX_PYATTRIBUT /* if value is not a sequence PyOrientationTo makes an error */ MT_Matrix3x3 rot; if (!PyOrientationTo(value, rot, "gameOb.worldOrientation = sequence: KX_GameObject, ")) - return NULL; + return PY_SET_ATTR_FAIL; if (self->GetSGNode() && self->GetSGNode()->GetSGParent()) { self->NodeSetLocalOrientation(self->GetSGNode()->GetSGParent()->GetWorldOrientation().inverse()*rot); @@ -1616,7 +1616,7 @@ int KX_GameObject::pyattr_set_worldOrientation(void *self_v, const KX_PYATTRIBUT } self->NodeUpdateGS(0.f); - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_GameObject::pyattr_get_localOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -1635,11 +1635,11 @@ int KX_GameObject::pyattr_set_localOrientation(void *self_v, const KX_PYATTRIBUT /* if value is not a sequence PyOrientationTo makes an error */ MT_Matrix3x3 rot; if (!PyOrientationTo(value, rot, "gameOb.localOrientation = sequence: KX_GameObject, ")) - return NULL; + return PY_SET_ATTR_FAIL; self->NodeSetLocalOrientation(rot); self->NodeUpdateGS(0.f); - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_GameObject::pyattr_get_worldScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -1662,11 +1662,11 @@ int KX_GameObject::pyattr_set_localScaling(void *self_v, const KX_PYATTRIBUTE_DE KX_GameObject* self= static_cast(self_v); MT_Vector3 scale; if (!PyVecTo(value, scale)) - return 1; + return PY_SET_ATTR_FAIL; self->NodeSetLocalScale(scale); self->NodeUpdateGS(0.f); - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_GameObject::pyattr_get_timeOffset(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -1688,12 +1688,12 @@ int KX_GameObject::pyattr_set_timeOffset(void *self_v, const KX_PYATTRIBUTE_DEF SG_Node* sg_parent= self->GetSGNode()->GetSGParent(); if (val < 0.0f) { /* also accounts for non float */ PyErr_SetString(PyExc_AttributeError, "gameOb.timeOffset = float: KX_GameObject, expected a float zero or above"); - return 1; + return PY_SET_ATTR_FAIL; } if (sg_parent && sg_parent->IsSlowParent()) static_cast(sg_parent->GetParentRelation())->SetTimeOffset(val); } - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_GameObject::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -1712,16 +1712,16 @@ int KX_GameObject::pyattr_set_state(void *self_v, const KX_PYATTRIBUTE_DEF *attr if (state_i == -1 && PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "gameOb.state = int: KX_GameObject, expected an int bit field"); - return 1; + return PY_SET_ATTR_FAIL; } state |= state_i; if ((state & ((1<<30)-1)) == 0) { PyErr_SetString(PyExc_AttributeError, "gameOb.state = int: KX_GameObject, state bitfield was not between 0 and 30 (1<<0 and 1<<29)"); - return 1; + return PY_SET_ATTR_FAIL; } self->SetState(state); - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_GameObject::pyattr_get_meshes(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index df7691d016b..1496f34c5f2 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -261,9 +261,9 @@ int KX_LightObject::pyattr_set_color(void *self_v, const KX_PYATTRIBUTE_DEF *att self->m_lightobj.m_red = color[0]; self->m_lightobj.m_green = color[1]; self->m_lightobj.m_blue = color[2]; - return 0; + return PY_SET_ATTR_SUCCESS; } - return 1; + return PY_SET_ATTR_FAIL; } PyObject* KX_LightObject::pyattr_get_typeconst(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -293,6 +293,11 @@ int KX_LightObject::pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attr { KX_LightObject* self = static_cast(self_v); int val = PyInt_AsLong(value); + if((val==-1 && PyErr_Occurred()) || val<0 || val>2) { + PyErr_SetString(PyExc_ValueError, "light.type= val: KX_LightObject, expected an int between 0 and 2"); + return PY_SET_ATTR_FAIL; + } + switch(val) { case 0: self->m_lightobj.m_type = self->m_lightobj.LIGHT_SPOT; @@ -300,7 +305,7 @@ int KX_LightObject::pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attr case 1: self->m_lightobj.m_type = self->m_lightobj.LIGHT_SUN; break; - default: + case 2: self->m_lightobj.m_type = self->m_lightobj.LIGHT_NORMAL; break; } diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index c5248785b12..38ad9aec33b 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -197,7 +197,7 @@ int KX_ParentActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUTE KX_GameObject *gameobj; if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.object = value: KX_ParentActuator")) - return 1; // ConvertPythonToGameObject sets the error + return PY_SET_ATTR_FAIL; // ConvertPythonToGameObject sets the error if (actuator->m_ob != NULL) actuator->m_ob->UnregisterActuator(actuator); @@ -207,7 +207,7 @@ int KX_ParentActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUTE if (actuator->m_ob) actuator->m_ob->RegisterActuator(actuator); - return 0; + return PY_SET_ATTR_SUCCESS; } diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index 2aa0ef921e9..98aad3943fe 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -386,10 +386,10 @@ int KX_PolygonMaterial::pyattr_set_diffuse(void *self_v, const KX_PYATTRIBUTE_DE MT_Vector3 vec; if (!PyVecTo(value, vec)) - return -1; + return PY_SET_ATTR_FAIL; self->m_diffuse= vec; - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_PolygonMaterial::pyattr_get_specular(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -404,8 +404,8 @@ int KX_PolygonMaterial::pyattr_set_specular(void *self_v, const KX_PYATTRIBUTE_D MT_Vector3 vec; if (!PyVecTo(value, vec)) - return -1; + return PY_SET_ATTR_FAIL; self->m_specular= vec; - return 0; + return PY_SET_ATTR_SUCCESS; } diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index 3c72eac3e62..dec76a75e50 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -242,7 +242,7 @@ int KX_SCA_AddObjectActuator::pyattr_set_object(void *self, const struct KX_PYAT KX_GameObject *gameobj; if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.object = value: KX_SCA_AddObjectActuator")) - return 1; // ConvertPythonToGameObject sets the error + return PY_SET_ATTR_FAIL; // ConvertPythonToGameObject sets the error if (actuator->m_OriginalObject != NULL) actuator->m_OriginalObject->UnregisterActuator(actuator); @@ -252,7 +252,7 @@ int KX_SCA_AddObjectActuator::pyattr_set_object(void *self, const struct KX_PYAT if (actuator->m_OriginalObject) actuator->m_OriginalObject->RegisterActuator(actuator); - return 0; + return PY_SET_ATTR_SUCCESS; } PyObject* KX_SCA_AddObjectActuator::pyattr_get_objectLastCreated(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp index 730d1ed49e6..00842d7012a 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp @@ -128,10 +128,10 @@ int KX_SCA_ReplaceMeshActuator::pyattr_set_mesh(void *self, const struct KX_PYAT RAS_MeshObject* new_mesh; if (!ConvertPythonToMesh(value, &new_mesh, true, "actuator.mesh = value: KX_SCA_ReplaceMeshActuator")) - return 1; + return PY_SET_ATTR_FAIL; actuator->m_mesh = new_mesh; - return 0; + return PY_SET_ATTR_SUCCESS; } /* 1. setMesh */ diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index 3a341f007e4..5c02a2db646 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -450,13 +450,13 @@ int KX_SoundActuator::pyattr_set_filename(void *self, const struct KX_PYATTRIBUT // void *soundPointer = NULL; /*unused*/ if (!PyArg_Parse(value, "s", &soundName)) - return 1; + return PY_SET_ATTR_FAIL; if (actuator->m_soundObject) { actuator->m_soundObject->SetObjectName(soundName); } - return 0; + return PY_SET_ATTR_SUCCESS; } @@ -465,12 +465,12 @@ int KX_SoundActuator::pyattr_set_gain(void *self, const struct KX_PYATTRIBUTE_DE float gain = 1.0; KX_SoundActuator * actuator = static_cast (self); if (!PyArg_Parse(value, "f", &gain)) - return 1; + return PY_SET_ATTR_FAIL; if (actuator->m_soundObject) actuator->m_soundObject->SetGain(gain); - return 0; + return PY_SET_ATTR_SUCCESS; } int KX_SoundActuator::pyattr_set_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) @@ -478,12 +478,12 @@ int KX_SoundActuator::pyattr_set_pitch(void *self, const struct KX_PYATTRIBUTE_D float pitch = 1.0; KX_SoundActuator * actuator = static_cast (self); if (!PyArg_Parse(value, "f", &pitch)) - return 1; + return PY_SET_ATTR_FAIL; if (actuator->m_soundObject) actuator->m_soundObject->SetPitch(pitch); - return 0; + return PY_SET_ATTR_SUCCESS; } int KX_SoundActuator::pyattr_set_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) @@ -491,12 +491,12 @@ int KX_SoundActuator::pyattr_set_rollOffFactor(void *self, const struct KX_PYATT KX_SoundActuator * actuator = static_cast (self); float rollofffactor = 1.0; if (!PyArg_Parse(value, "f", &rollofffactor)) - return 1; + return PY_SET_ATTR_FAIL; if (actuator->m_soundObject) actuator->m_soundObject->SetRollOffFactor(rollofffactor); - return 0; + return PY_SET_ATTR_SUCCESS; } int KX_SoundActuator::pyattr_set_looping(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) @@ -504,12 +504,12 @@ int KX_SoundActuator::pyattr_set_looping(void *self, const struct KX_PYATTRIBUTE KX_SoundActuator * actuator = static_cast (self); int looping = 1; if (!PyArg_Parse(value, "i", &looping)) - return 1; + return PY_SET_ATTR_FAIL; if (actuator->m_soundObject) actuator->m_soundObject->SetLoopMode(looping); - return 0; + return PY_SET_ATTR_SUCCESS; } int KX_SoundActuator::pyattr_set_position(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) @@ -519,12 +519,12 @@ int KX_SoundActuator::pyattr_set_position(void *self, const struct KX_PYATTRIBUT KX_SoundActuator * actuator = static_cast (self); if (!PyArg_ParseTuple(value, "fff", &pos[0], &pos[1], &pos[2])) - return 1; + return PY_SET_ATTR_FAIL; if (actuator->m_soundObject) actuator->m_soundObject->SetPosition(MT_Vector3(pos)); - return 0; + return PY_SET_ATTR_SUCCESS; } int KX_SoundActuator::pyattr_set_velocity(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) @@ -534,12 +534,12 @@ int KX_SoundActuator::pyattr_set_velocity(void *self, const struct KX_PYATTRIBUT if (!PyArg_ParseTuple(value, "fff", &vel[0], &vel[1], &vel[2])) - return 1; + return PY_SET_ATTR_FAIL; if (actuator->m_soundObject) actuator->m_soundObject->SetVelocity(MT_Vector3(vel)); - return 0; + return PY_SET_ATTR_SUCCESS; } @@ -551,14 +551,15 @@ int KX_SoundActuator::pyattr_set_orientation(void *self, const struct KX_PYATTRI /* if value is not a sequence PyOrientationTo makes an error */ if (!PyOrientationTo(value, rot, "actuator.orientation = value: KX_SoundActuator")) - return NULL; + return PY_SET_ATTR_FAIL; + /* Since not having m_soundObject didn't do anything in the old version, + * it probably should be kept that way */ if (!actuator->m_soundObject) - return 0; /* Since not having m_soundObject didn't do anything in the old version, - * it probably should be kept that way */ + return PY_SET_ATTR_SUCCESS; actuator->m_soundObject->SetOrientation(rot); - return 0; + return PY_SET_ATTR_SUCCESS; } // Deprecated -----> diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index 800da83dc3d..5a50d0fb944 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -504,7 +504,7 @@ int KX_TrackToActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUT KX_GameObject *gameobj; if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.object = value: KX_TrackToActuator")) - return 1; // ConvertPythonToGameObject sets the error + return PY_SET_ATTR_FAIL; // ConvertPythonToGameObject sets the error if (actuator->m_object != NULL) actuator->m_object->UnregisterActuator(actuator); @@ -514,7 +514,7 @@ int KX_TrackToActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUT if (actuator->m_object) actuator->m_object->RegisterActuator(actuator); - return 0; + return PY_SET_ATTR_SUCCESS; } -- cgit v1.2.3 From ecacef36829897c1b5d03dffb08f3a4ab7863e9a Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 19 May 2009 15:40:03 +0000 Subject: Last minute mini feature: Expanded the "10-timer" (ALT+CTRL+T) with two new test options: - Draw entire window - Anim step The latter will only call animation system, no drawing. Added this to match the testing menu in 2.5 too, so we can get good reference performance tests. --- source/blender/src/toets.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c index 804660c3433..3a1b21e91f1 100644 --- a/source/blender/src/toets.c +++ b/source/blender/src/toets.c @@ -901,7 +901,7 @@ int blenderqread(unsigned short event, short val) } else if(G.qual==(LR_ALTKEY|LR_CTRLKEY)) { int a; - int event= pupmenu("10 Timer%t|draw|draw+swap|undo"); + int event= pupmenu("10 Timer%t|Draw Area|Draw Area and Swap|Draw Window and Swap|Anim Steps|Undo/Redo"); if(event>0) { double stime= PIL_check_seconds_timer(); char tmpstr[128]; @@ -912,11 +912,20 @@ int blenderqread(unsigned short event, short val) for(a=0; a<10; a++) { if (event==1) { scrarea_do_windraw(curarea); - } else if (event==2) { + } + else if (event==2) { scrarea_do_windraw(curarea); screen_swapbuffers(); } - else if(event==3) { + else if (event==3) { + force_draw_all(1); + } + else if(event==4) { + if(a & 1) G.scene->r.cfra--; + else G.scene->r.cfra++; + scene_update_for_newframe(G.scene, G.scene->lay); + } + else if(event==5) { BIF_undo(); BIF_redo(); } @@ -924,9 +933,11 @@ int blenderqread(unsigned short event, short val) time= (int) ((PIL_check_seconds_timer()-stime)*1000); - if(event==1) sprintf(tmpstr, "draw %%t|%d ms", time); - if(event==2) sprintf(tmpstr, "d+sw %%t|%d ms", time); - if(event==3) sprintf(tmpstr, "undo %%t|%d ms", time); + if(event==1) sprintf(tmpstr, "Draw %%t|%d ms", time); + if(event==2) sprintf(tmpstr, "Draw+swap %%t|%d ms", time); + if(event==3) sprintf(tmpstr, "Window+sw %%t|%d ms", time); + if(event==4) sprintf(tmpstr, "Anim %%t|%d ms", time); + if(event==5) sprintf(tmpstr, "Undo %%t|%d ms", time); waitcursor(0); pupmenu(tmpstr); -- cgit v1.2.3 From 73904597e9c822fde9ec633db650c9783cf43847 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 20 May 2009 01:11:56 +0000 Subject: - Added an intro page for the BGE docs rather then using GameLogic - Added notes on BGE stability and modules - updated some examples to new api syntax - include BGL Mathutils and Geometry modules in docs --- source/gameengine/PyDoc/API_intro.py | 103 ++++++++++++++++++++++++++++++++++ source/gameengine/PyDoc/GameLogic.py | 30 +++------- source/gameengine/PyDoc/epy_docgen.sh | 9 ++- 3 files changed, 118 insertions(+), 24 deletions(-) create mode 100644 source/gameengine/PyDoc/API_intro.py (limited to 'source') diff --git a/source/gameengine/PyDoc/API_intro.py b/source/gameengine/PyDoc/API_intro.py new file mode 100644 index 00000000000..ad37e34fbac --- /dev/null +++ b/source/gameengine/PyDoc/API_intro.py @@ -0,0 +1,103 @@ +# This is not a real module, it's simply an introductory text. + +""" +The Blender Game Engine Python API Reference +============================================ + + See U{release notes} for updates, changes and new functionality in the Game Engine Python API. + + Top Module: + ----------- + + - L{GameLogic} + - L{GameKeys} + - L{GameTypes} + - L{Mathutils} + - L{Geometry} + - L{BGL} + + Undocumented modules: + --------------------- + - VideoTexture + - CValue + - Expression + - PhysicsConstraints + + +Introduction: +============= + + This reference documents the Blender Python API, a growing collection of + Python modules (libraries) that give access to part of the program's internal + data and functions. + + Through scripting Blender can be extended in real-time via + U{Python }, an impressive high level, multi-paradigm, open + source language. Newcomers are recommended to start with the tutorial that + comes with it. + + This opens many interesting possibilities not available with logic bricks. + + Game Engine API Stability: + -------------------------- + + When writing python scripts there are a number of situations you should avoid to prevent crashes or unstable behavior. + While the API tries to prevent problems there are some situations where error checking would be too time consuming. + + Known cases: + - Memory Limits. + + There is nothing stopping you from filling a list or making a string so big that that causes blender to run out of memory, in this case python should rasie a MemoryError, but its likely blender will crash before this point. + + - Accessing any data that has been freed. + + For instance accessing a KX_GameObject after its End Object actuator runs. + This will cause a SystemError, however for L{KX_MeshProxy}, L{KX_VertexProxy} and L{KX_VertexProxy} it will crash the blender game engine. + + See: L{GameTypes.PyObjectPlus.invalid} which many types inherit. + + - Mixing L{KX_GameObject} between scenes. + + For instance tracking/parenting an L{KX_GameObject} object to an object from other scene. + + External Modules: + ----------------- + + Since 2.49 support for importing modules has been added. + + This allows you to import any blender textblock with a .py extension. + + External python scripts may be imported as modules when the script is in the same directory as the blend file. + + The current blend files path is included in the sys.path for loading modules. + All linked libraries will also be included so you can be sure when linking in assets from another blend file the scripts will load too. + + A note to newbie script writers: + -------------------------------- + + Interpreted languages are known to be much slower than compiled code, but for + many applications the difference is negligible or acceptable. Also, with + profiling (or even simple direct timing with L{Blender.sys.time}) to + identify slow areas and well thought optimizations, the speed can be + I{considerably} improved in many cases. Try some of the best BPython scripts + to get an idea of what can be done, you may be surprised. + +@author: The Blender Python Team +@requires: Blender 2.49 or newer. +@version: 2.49 +@see: U{www.blender.org}: documentation and forum +@see: U{blenderartists.org}: user forum +@see: U{projects.blender.org} +@see: U{www.python.org} +@see: U{www.python.org/doc} +@see: U{Blending into Python}: User contributed documentation, featuring a blender/python cookbook with many examples. + +@note: the official version of this reference guide is only updated for each + new Blender release. But you can build the current SVN + version yourself: install epydoc, grab all files in the + source/gameengine/PyDoc/ folder of Blender's SVN and use the + epy_docgen.sh script also found there to generate the html docs. + Naturally you will also need a recent Blender binary to try the new + features. If you prefer not to compile it yourself, there is a testing + builds forum at U{blender.org}. +""" diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 28fd95611bc..1bc406daf09 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -2,29 +2,15 @@ """ Documentation for the GameLogic Module. ======================================= - - Modules available in the game engine: - - GameLogic - - L{GameKeys} - - L{Rasterizer} - - L{GameTypes} - - Undocumented modules: - - VideoTexture - - CValue - - Expression - - PhysicsConstraints - - All the other modules are accessible through the methods in GameLogic. - See U{release notes} for updates, changes and new functionality in the Game Engine Python API. + Module to access logic functions, imported automatically into the python controllers namespace. Examples:: # To get the controller thats running this python script: - co = GameLogic.getCurrentController() # GameLogic is automatically imported + cont = GameLogic.getCurrentController() # GameLogic is automatically imported # To get the game object this controller is on: - obj = co.getOwner() + obj = cont.owner L{KX_GameObject} and L{KX_Camera} or L{KX_LightObject} methods are available depending on the type of object:: # To get a sensor linked to this controller. @@ -32,10 +18,10 @@ Documentation for the GameLogic Module. # +---------------------+ +--------+ # | Sensor "sensorname" +--+ Python + # +---------------------+ +--------+ - sens = co.getSensor("sensorname") + sens = cont.sensors["sensorname"] - # To get a list of all sensors: - sensors = co.getSensors() + # To get a sequence of all sensors: + sensors = co.sensors See the sensor's reference for available methods: - L{DelaySensor} @@ -56,7 +42,7 @@ Documentation for the GameLogic Module. # +--------+ +-------------------------+ # + Python +--+ Actuator "actuatorname" | # +--------+ +-------------------------+ - actuator = co.getActuator("actuatorname") + actuator = co.actuators["actuatorname"] # Activate an actuator controller.activate(actuator) @@ -96,7 +82,7 @@ Documentation for the GameLogic Module. cam = scene.active_camera Matricies as used by the game engine are B{row major}:: - matrix[row][col] = blah + matrix[row][col] = float L{KX_Camera} has some examples using matricies. diff --git a/source/gameengine/PyDoc/epy_docgen.sh b/source/gameengine/PyDoc/epy_docgen.sh index 0872d2abbbd..dd30256f42f 100755 --- a/source/gameengine/PyDoc/epy_docgen.sh +++ b/source/gameengine/PyDoc/epy_docgen.sh @@ -7,5 +7,10 @@ # set posix locale so regex works properly for [A-Z]*.py LC_ALL=POSIX -epydoc --debug -v -o BPY_GE --url "http://www.blender.org" --top GameLogic \ - --name "Blender GameEngine" --no-private --no-sourcecode --inheritance=included *.py +epydoc --debug -v -o BPY_GE --url "http://www.blender.org" --top API_intro \ + --name "Blender GameEngine" --no-private --no-sourcecode --inheritance=included \ + *.py \ + ../../../source/blender/python/api2_2x/doc/BGL.py \ + ../../../source/blender/python/api2_2x/doc/Mathutils.py \ + ../../../source/blender/python/api2_2x/doc/Geometry.py + -- cgit v1.2.3 From dc6ae673b1d95d28c4fab4dbfbd9947d4a6c3bb2 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Wed, 20 May 2009 05:33:39 +0000 Subject: Moving ScreenSpace methods from Rasterizer to KX_Camera (getScreenPos, getScreenVect, getScreenRay) The modules were moved in order to access the camera internal matrixes. It will make then compatible with multiple viewports in a near future. So far the problem I found was: 1) KX_Camera doesn't store the canvas viewport 2) RAS_ICanvas methods: GetDisplayArea and GetWindowArea are affected by multiple viewports (and they shouldn't). Test file is here: http://www.pasteall.org/blend/68 --- source/gameengine/Ketsji/KX_Camera.cpp | 144 ++++++++++++++++++++++++++++- source/gameengine/Ketsji/KX_Camera.h | 4 + source/gameengine/Ketsji/KX_PythonInit.cpp | 128 ------------------------- source/gameengine/PyDoc/GameTypes.py | 43 +++++++++ source/gameengine/PyDoc/Rasterizer.py | 44 --------- 5 files changed, 189 insertions(+), 174 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index fe50b371475..4bef4936813 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -28,6 +28,7 @@ * Camera in the gameengine. Cameras are also used for views. */ +#include "GL/glew.h" #include "KX_Camera.h" #include "KX_Scene.h" #include "KX_PythonInit.h" @@ -478,7 +479,10 @@ PyMethodDef KX_Camera::Methods[] = { KX_PYMETHODTABLE_NOARGS(KX_Camera, getWorldToCamera), KX_PYMETHODTABLE(KX_Camera, setViewport), KX_PYMETHODTABLE_NOARGS(KX_Camera, setOnTop), - + KX_PYMETHODTABLE_O(KX_Camera, getScreenPosition), + KX_PYMETHODTABLE(KX_Camera, getScreenVect), + KX_PYMETHODTABLE(KX_Camera, getScreenRay), + // DEPRECATED KX_PYMETHODTABLE_O(KX_Camera, enableViewport), KX_PYMETHODTABLE_NOARGS(KX_Camera, getProjectionMatrix), @@ -989,4 +993,140 @@ bool ConvertPythonToCamera(PyObject * value, KX_Camera **object, bool py_none_ok } return false; -} \ No newline at end of file +} + +KX_PYMETHODDEF_DOC_O(KX_Camera, getScreenPosition, +"getScreenPosition()\n" +) + +{ + MT_Vector3 vect; + KX_GameObject *obj = NULL; + + if (!PyVecTo(value, vect)) + { + if(ConvertPythonToGameObject(value, &obj, true, "")) + { + PyErr_Clear(); + vect = MT_Vector3(obj->NodeGetWorldPosition()); + } + else + { + PyErr_SetString(PyExc_TypeError, "Error in getScreenPosition. Expected a Vector3 or a KX_GameObject or a string for a name of a KX_GameObject"); + return NULL; + } + } + + GLint viewport[4]; + GLdouble win[3]; + GLdouble modelmatrix[16]; + GLdouble projmatrix[16]; + + MT_Matrix4x4 m_modelmatrix = this->GetModelviewMatrix(); + MT_Matrix4x4 m_projmatrix = this->GetProjectionMatrix(); + + m_modelmatrix.getValue(modelmatrix); + m_projmatrix.getValue(projmatrix); + + glGetIntegerv(GL_VIEWPORT, viewport); + + gluProject(vect[0], vect[1], vect[2], modelmatrix, projmatrix, viewport, &win[0], &win[1], &win[2]); + + vect[0] = win[0] / (viewport[0] + viewport[2]); + vect[1] = win[1] / (viewport[1] + viewport[3]); + + PyObject* ret = PyTuple_New(2); + if(ret){ + PyTuple_SET_ITEM(ret, 0, PyFloat_FromDouble(vect[0])); + PyTuple_SET_ITEM(ret, 1, PyFloat_FromDouble(vect[1])); + return ret; + } + + return NULL; +} + +KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenVect, +"getScreenVect()\n" +) +{ + double x,y; + if (!PyArg_ParseTuple(args,"dd:getScreenVect",&x,&y)) + return NULL; + + MT_Vector3 vect; + MT_Point3 campos, screenpos; + + GLint viewport[4]; + GLdouble win[3]; + GLdouble modelmatrix[16]; + GLdouble projmatrix[16]; + + MT_Matrix4x4 m_modelmatrix = this->GetModelviewMatrix(); + MT_Matrix4x4 m_projmatrix = this->GetProjectionMatrix(); + + m_modelmatrix.getValue(modelmatrix); + m_projmatrix.getValue(projmatrix); + + glGetIntegerv(GL_VIEWPORT, viewport); + + vect[0] = x * viewport[2]; + vect[1] = y * viewport[3]; + + vect[0] += viewport[0]; + vect[1] += viewport[1]; + + glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &vect[2]); + gluUnProject(vect[0], vect[1], vect[2], modelmatrix, projmatrix, viewport, &win[0], &win[1], &win[2]); + + campos = this->GetCameraLocation(); + screenpos = MT_Point3(win[0], win[1], win[2]); + vect = campos-screenpos; + + vect.normalize(); + return PyObjectFrom(vect); +} + +KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenRay, +"getScreenRay()\n" +) +{ + KX_Camera* cam; + MT_Vector3 vect; + double x,y,dist; + char *propName = NULL; + + if (!PyArg_ParseTuple(args,"ddd|s:getScreenRay",&x,&y,&dist,&propName)) + return NULL; + + PyObject* argValue = PyTuple_New(2); + if (argValue) { + PyTuple_SET_ITEM(argValue, 0, PyFloat_FromDouble(x)); + PyTuple_SET_ITEM(argValue, 1, PyFloat_FromDouble(y)); + } + + if(!PyVecTo(PygetScreenVect(argValue), vect)) + { + Py_DECREF(argValue); + PyErr_SetString(PyExc_TypeError, + "Error in getScreenRay. Invalid 2D coordinate. Expected a normalized 2D screen coordinate, a distance and an optional property argument"); + return NULL; + } + Py_DECREF(argValue); + + dist *= -1.0; + + argValue = (propName?PyTuple_New(3):PyTuple_New(2)); + if (argValue) { + PyTuple_SET_ITEM(argValue, 0, PyObjectFrom(vect)); + PyTuple_SET_ITEM(argValue, 1, PyFloat_FromDouble(dist)); + if (propName) + PyTuple_SET_ITEM(argValue, 2, PyString_FromString(propName)); + + PyObject* ret= this->PyrayCastTo(argValue,NULL); + Py_DECREF(argValue); + return ret; + } + + return NULL; +} + diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index c00741bf43f..2ec60be0404 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -273,6 +273,10 @@ public: KX_PYMETHOD_DOC_VARARGS(KX_Camera, setViewport); KX_PYMETHOD_DOC_NOARGS(KX_Camera, setOnTop); + KX_PYMETHOD_DOC_O(KX_Camera, getScreenPosition); + KX_PYMETHOD_DOC_VARARGS(KX_Camera, getScreenVect); + KX_PYMETHOD_DOC_VARARGS(KX_Camera, getScreenRay); + virtual PyObject* py_getattro(PyObject *attr); /* lens, near, far, projection_matrix */ virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject *pyvalue); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index d32f3b1b8a2..fb99eab7747 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -511,128 +511,6 @@ static struct PyMethodDef game_methods[] = { {NULL, (PyCFunction) NULL, 0, NULL } }; - -static PyObject* gPyGetScreenPosition(PyObject*, PyObject* value) -{ - MT_Vector3 vect; - KX_GameObject *obj = NULL; - - if (!PyVecTo(value, vect)) - { - if(ConvertPythonToGameObject(value, &obj, true, "")) - { - PyErr_Clear(); - vect = MT_Vector3(obj->NodeGetWorldPosition()); - } - else - { - PyErr_SetString(PyExc_TypeError, "Error in getScreenPosition. Expected a Vector3 or a KX_GameObject or a string for a name of a KX_GameObject"); - return NULL; - } - } - - GLdouble modelMatrix[16]; - GLdouble projMatrix[16]; - GLint viewport[4]; - GLdouble win[3]; - - glGetIntegerv(GL_VIEWPORT, viewport); - glGetDoublev(GL_MODELVIEW_MATRIX, modelMatrix); - glGetDoublev(GL_PROJECTION_MATRIX, projMatrix); - - gluProject(vect[0], vect[1], vect[2], modelMatrix, projMatrix, viewport, &win[0], &win[1], &win[2]); - - vect[0] = win[0] / (viewport[0] + viewport[2]); - vect[1] = win[1] / (viewport[1] + viewport[3]); - - PyObject* ret = PyTuple_New(2); - if(ret){ - PyTuple_SET_ITEM(ret, 0, PyFloat_FromDouble(vect[0])); - PyTuple_SET_ITEM(ret, 1, PyFloat_FromDouble(vect[1])); - return ret; - } - - return NULL; -} - -static PyObject* gPyGetScreenVect(PyObject*, PyObject* args) -{ - double x,y; - if (!PyArg_ParseTuple(args,"dd:getScreenVect",&x,&y)) - return NULL; - - MT_Vector3 vect; - MT_Point3 campos, screenpos; - - GLdouble modelMatrix[16]; - GLdouble projMatrix[16]; - GLint viewport[4]; - GLdouble win[3]; - - glGetIntegerv(GL_VIEWPORT, viewport); - glGetDoublev(GL_MODELVIEW_MATRIX, modelMatrix); - glGetDoublev(GL_PROJECTION_MATRIX, projMatrix); - - vect[0] = x * viewport[2]; - vect[1] = y * viewport[3]; - - vect[0] += viewport[0]; - vect[1] += viewport[1]; - - glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &vect[2]); - gluUnProject(vect[0], vect[1], vect[2], modelMatrix, projMatrix, viewport, &win[0], &win[1], &win[2]); - - campos = gp_Rasterizer->GetCameraPosition(); - screenpos = MT_Point3(win[0], win[1], win[2]); - vect = campos-screenpos; - - vect.normalize(); - return PyObjectFrom(vect); -} - -static PyObject* gPyGetScreenRay(PyObject* self, PyObject* args) -{ - KX_Camera* cam; - MT_Vector3 vect; - double x,y,dist; - char *propName = NULL; - - if (!PyArg_ParseTuple(args,"ddd|s:getScreenRay",&x,&y,&dist,&propName)) - return NULL; - - PyObject* argValue = PyTuple_New(2); - if (argValue) { - PyTuple_SET_ITEM(argValue, 0, PyFloat_FromDouble(x)); - PyTuple_SET_ITEM(argValue, 1, PyFloat_FromDouble(y)); - } - - if(!PyVecTo(gPyGetScreenVect(self,argValue), vect)) - { - Py_DECREF(argValue); - PyErr_SetString(PyExc_TypeError, - "Error in getScreenRay. Invalid 2D coordinate. Expected a normalized 2D screen coordinate and an optional property argument"); - return NULL; - } - Py_DECREF(argValue); - - cam = gp_KetsjiScene->GetActiveCamera(); - dist *= -1.0; - - argValue = (propName?PyTuple_New(3):PyTuple_New(2)); - if (argValue) { - PyTuple_SET_ITEM(argValue, 0, PyObjectFrom(vect)); - PyTuple_SET_ITEM(argValue, 1, PyFloat_FromDouble(dist)); - if (propName) - PyTuple_SET_ITEM(argValue, 2, PyString_FromString(propName)); - - PyObject* ret= cam->PyrayCastTo(argValue,NULL); - Py_DECREF(argValue); - return ret; - } - - return NULL; -} - static PyObject* gPyGetWindowHeight(PyObject*, PyObject* args) { return PyInt_FromLong((gp_Canvas ? gp_Canvas->GetHeight() : 0)); @@ -1047,12 +925,6 @@ static PyObject* gPyDrawLine(PyObject*, PyObject* args) } static struct PyMethodDef rasterizer_methods[] = { - {"getScreenPosition",(PyCFunction) gPyGetScreenPosition, - METH_O, "getScreenPosition doc"}, - {"getScreenVect",(PyCFunction) gPyGetScreenVect, - METH_VARARGS, "getScreenVect doc"}, - {"getScreenRay",(PyCFunction) gPyGetScreenRay, - METH_VARARGS, "getScreenRay doc"}, {"getWindowWidth",(PyCFunction) gPyGetWindowWidth, METH_VARARGS, "getWindowWidth doc"}, {"getWindowHeight",(PyCFunction) gPyGetWindowHeight, diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index 5ec6f31e30c..b5dc89e4002 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -5555,6 +5555,49 @@ class KX_Camera(KX_GameObject): @type right: int @type top: int """ + def getScreenPosition(arg): + """ + Gets the position of an object projected on screen space. + + Example: + # For an object in the middle of the screen, coord = [0.5,0.5] + coord = camera.getScreenPosition(object) + + @param arg: L{KX_GameObject}, object name or list [x, y, z] + @rtype: list [x, y] + @return: the object's position in screen coordinates. + """ + def getScreenVect(x, y): + """ + Gets the vector from the camera position in the screen coordinate direction. + + Example: + # Gets the vector of the camera front direction: + m_vect = camera.getScreenVect(0.5,0.5) + + @type x: float + @type y: float + @rtype: 3d vector + @return: the vector from a screen coordinate. + """ + def getScreenRay(x, y, dist, property): + """ + Look towards a screen coordinate (x,y) and find first object hit within dist that matches prop. + The ray is similar to KX_GameObject->rayCastTo. + + Example: + # Gets an object with a property "wall" in front of the camera within a distance of 100: + target = camera.getScreenRay(0.5,0.5,100,"wall") + + @type x: float + @type y: float + @param dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other + @type dist: float + @param property: property name that object must have; can be omitted => detect any object + @type property: string + @rtype: L{KX_GameObject} + @return: the first object hit or None if no object or object does not match prop + """ # Util func to extract all attrs """ diff --git a/source/gameengine/PyDoc/Rasterizer.py b/source/gameengine/PyDoc/Rasterizer.py index 25877364836..bafcfece473 100644 --- a/source/gameengine/PyDoc/Rasterizer.py +++ b/source/gameengine/PyDoc/Rasterizer.py @@ -43,50 +43,6 @@ Example Uses an L{SCA_MouseSensor}, and two L{KX_ObjectActuator}s to implement M @var KX_BLENDER_GLSL_MATERIAL: Materials approximating blender materials with GLSL. """ - -def getScreenPosition(arg): - """ - Gets the position of an object projected on screen space. - - Example: - # For an object in the middle of the screen, coord = [0.5,0.5] - coord = Rasterizer.getScreenPosition(object) - - @param arg: L{KX_GameObject}, object name or list [x, y, z] - @rtype: list [x, y] - @return: the object's position in screen coordinates. - """ -def getScreenVect(x, y): - """ - Gets the vector from the camera position in the screen coordinate direction. - - Example: - # Gets the vector of the camera front direction: - m_vect = Rasterizer.getScreenVect(0.5,0.5) - - @type x: float - @type y: float - @rtype: 3d vector - @return: the vector from a screen coordinate. - """ -def getScreenRay(x, y, dist, property): - """ - Look towards a screen coordinate (x,y) and find first object hit within dist that matches prop. - The ray is similar to KX_GameObject->rayCastTo. - - Example: - # Gets an object with a property "wall" in front of the camera within a distance of 100: - target = Rasterizer.getScreenRay(0.5,0.5,100,"wall") - - @type x: float - @type y: float - @param dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other - @type dist: float - @param property: property name that object must have; can be omitted => detect any object - @type property: string - @rtype: L{KX_GameObject} - @return: the first object hit or None if no object or object does not match prop - """ def getWindowWidth(): """ Gets the width of the window (in pixels) -- cgit v1.2.3 From c0844b7938ec21e1fcd2ceea11ef5ae18e39c070 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 20 May 2009 08:45:42 +0000 Subject: BGE logic patch: fix another incompatibility with YF. Previous patch was not sorting the state actuators. This was causing some problems with YoFrankie that relies on the order of actuators when multiple state actuators are activated at once. Active state actuators will now be sorted per object. This doesn't change the fact that state actuators are executed before all other actuators as before. Incidently, made the logic loop faster. --- source/gameengine/GameLogic/SCA_IActuator.cpp | 2 ++ source/gameengine/GameLogic/SCA_IActuator.h | 3 +-- source/gameengine/GameLogic/SCA_ILogicBrick.h | 28 ++++++++++++++++++++++ source/gameengine/GameLogic/SCA_IObject.cpp | 3 ++- source/gameengine/GameLogic/SCA_IObject.h | 6 +++++ source/gameengine/GameLogic/SCA_LogicManager.cpp | 30 +++++++++++++----------- source/gameengine/GameLogic/SCA_LogicManager.h | 3 --- source/gameengine/Ketsji/KX_StateActuator.cpp | 12 +++++++--- source/gameengine/SceneGraph/SG_QList.h | 2 +- 9 files changed, 65 insertions(+), 24 deletions(-) (limited to 'source') diff --git a/source/gameengine/GameLogic/SCA_IActuator.cpp b/source/gameengine/GameLogic/SCA_IActuator.cpp index c2be36d5108..be7c2651686 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.cpp +++ b/source/gameengine/GameLogic/SCA_IActuator.cpp @@ -67,6 +67,8 @@ void SCA_IActuator::Activate(SG_DList& head) } } +// this function is only used to deactivate actuators outside the logic loop +// e.g. when an object is deleted. void SCA_IActuator::Deactivate() { if (QDelink()) diff --git a/source/gameengine/GameLogic/SCA_IActuator.h b/source/gameengine/GameLogic/SCA_IActuator.h index 2bd92c343b9..27afcbc386b 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.h +++ b/source/gameengine/GameLogic/SCA_IActuator.h @@ -33,8 +33,7 @@ #include /* - * Use of SG_DList : element of actuator being deactivated - * Head: SCA_LogicManager::m_removedActuators + * Use of SG_DList : None * Use of SG_QList : element of activated actuator list of their owner * Head: SCA_IObject::m_activeActuators */ diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index 90881c0536f..779e5397a6a 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -92,6 +92,34 @@ public: it.add_back(this); } + // insert in a QList at position corresponding to m_Execute_Priority + // inside a longer list that contains elements of other objects. + // Sorting is done only between the elements of the same object. + // head is the head of the combined list + // current points to the first element of the object in the list, NULL if none yet + void InsertSelfActiveQList(SG_QList& head, SG_QList** current) + { + if (!*current) + { + // first element can be put anywhere + head.QAddBack(this); + *current = this; + return; + } + // note: we assume current points actually to one o our element, skip the tests + SG_QList::iterator it(head,*current); + if (m_Execute_Priority <= (*it)->m_Execute_Priority) + { + // this element comes before the first + *current = this; + } + else + { + for(++it; !it.end() && (*it)->m_gameobj == m_gameobj && m_Execute_Priority > (*it)->m_Execute_Priority; ++it); + } + it.add_back(this); + } + virtual bool LessComparedTo(SCA_ILogicBrick* other); virtual PyObject* py_getattro(PyObject *attr); diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index 2b87a7c1526..9876f2512c0 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -41,7 +41,8 @@ MT_Point3 SCA_IObject::m_sDummy=MT_Point3(0,0,0); SG_QList SCA_IObject::m_activeBookmarkedControllers; -SCA_IObject::SCA_IObject(PyTypeObject* T): CValue(T), m_initState(0), m_state(0) +SCA_IObject::SCA_IObject(PyTypeObject* T): CValue(T), m_initState(0), m_state(0), m_firstState(NULL) + { m_suspended = false; } diff --git a/source/gameengine/GameLogic/SCA_IObject.h b/source/gameengine/GameLogic/SCA_IObject.h index c4f346059d4..eae427741ca 100644 --- a/source/gameengine/GameLogic/SCA_IObject.h +++ b/source/gameengine/GameLogic/SCA_IObject.h @@ -52,6 +52,7 @@ class SCA_IObject : public CValue Py_Header; protected: + friend class KX_StateActuator; friend class SCA_IActuator; friend class SCA_IController; SCA_SensorList m_sensors; @@ -97,6 +98,11 @@ protected: */ unsigned int m_state; + /** + * pointer inside state actuator list for sorting + */ + SG_QList* m_firstState; + public: SCA_IObject(PyTypeObject* T=&Type); diff --git a/source/gameengine/GameLogic/SCA_LogicManager.cpp b/source/gameengine/GameLogic/SCA_LogicManager.cpp index 7acec465921..83271288154 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.cpp +++ b/source/gameengine/GameLogic/SCA_LogicManager.cpp @@ -212,17 +212,22 @@ void SCA_LogicManager::UpdateFrame(double curtime, bool frame) (*ie)->UpdateFrame(); SG_DList::iterator io(m_activeActuators); - for (io.begin(); !io.end(); ++io) + for (io.begin(); !io.end(); ) { - SG_QList::iterator ia(*(*io)); - for (ia.begin(); !ia.end(); ++ia) + SG_QList* ahead = *io; + // increment now so that we can remove the current element + ++io; + SG_QList::iterator ia(*ahead); + for (ia.begin(); !ia.end(); ) { SCA_IActuator* actua = *ia; + // increment first to allow removal of inactive actuators. + ++ia; if (!actua->Update(curtime, frame)) { - // cannot deactive the actuator now as it will disturb the list - m_removedActuators.AddBack(actua); - actua->SetActive(false); + // this actuator is not active anymore, remove + actua->QDelink(); + actua->SetActive(false); } else if (actua->IsNoLink()) { // This actuator has no more links but it still active @@ -235,14 +240,11 @@ void SCA_LogicManager::UpdateFrame(double curtime, bool frame) actua->AddEvent(event); } } - } - - for (SCA_IActuator* act = (SCA_IActuator*)m_removedActuators.Remove(); - act != NULL; - act = (SCA_IActuator*)m_removedActuators.Remove()) - { - act->Deactivate(); - act->SetActive(false); + if (ahead->QEmpty()) + { + // no more active controller, remove from main list + ahead->Delink(); + } } } diff --git a/source/gameengine/GameLogic/SCA_LogicManager.h b/source/gameengine/GameLogic/SCA_LogicManager.h index fe7b40b3ba4..53e75e1eaee 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.h +++ b/source/gameengine/GameLogic/SCA_LogicManager.h @@ -87,9 +87,6 @@ class SCA_LogicManager GEN_Map m_map_gamemeshname_to_blendobj; GEN_Map m_map_blendobj_to_gameobj; - - // head of actuators being deactivated during the logic update - SG_DList m_removedActuators; public: SCA_LogicManager(); virtual ~SCA_LogicManager(); diff --git a/source/gameengine/Ketsji/KX_StateActuator.cpp b/source/gameengine/Ketsji/KX_StateActuator.cpp index 5f9730d7e10..f6979eee0f4 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.cpp +++ b/source/gameengine/Ketsji/KX_StateActuator.cpp @@ -73,7 +73,10 @@ KX_StateActuator::Update() { bool bNegativeEvent = IsNegativeEvent(); unsigned int objMask; - + + // execution of state actuator means that we are in the execution phase, reset this pointer + // because all the active actuator of this object will be removed for sure. + m_gameobj->m_firstState = NULL; RemoveAllEvents(); if (bNegativeEvent) return false; @@ -102,6 +105,8 @@ KX_StateActuator::Update() return false; } +// this function is only used to deactivate actuators outside the logic loop +// e.g. when an object is deleted. void KX_StateActuator::Deactivate() { if (QDelink()) @@ -115,9 +120,10 @@ void KX_StateActuator::Deactivate() void KX_StateActuator::Activate(SG_DList& head) { - // no need to sort the state actuators - if (m_stateActuatorHead.QAddBack(this)) + // sort the state actuators per object on the global list + if (QEmpty()) { + InsertSelfActiveQList(m_stateActuatorHead, &m_gameobj->m_firstState); // add front to make sure it runs before other actuators head.AddFront(&m_stateActuatorHead); } diff --git a/source/gameengine/SceneGraph/SG_QList.h b/source/gameengine/SceneGraph/SG_QList.h index 7a6b2e466c9..d8afc33ea4f 100644 --- a/source/gameengine/SceneGraph/SG_QList.h +++ b/source/gameengine/SceneGraph/SG_QList.h @@ -49,7 +49,7 @@ public: T* m_current; public: typedef iterator _myT; - iterator(SG_QList& head) : m_head(head), m_current(NULL) {} + iterator(SG_QList& head, SG_QList* current=NULL) : m_head(head) { m_current = (T*)current; } ~iterator() {} void begin() -- cgit v1.2.3 From ac0766c64b62ca74cb29b3d58c40d2ce92ec5b9b Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Wed, 20 May 2009 12:13:37 +0000 Subject: Fix for [#18785] Crash rendering hair particle system --- source/blender/render/intern/source/convertblender.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index cd141799f64..79ab661e578 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -1766,7 +1766,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem if(parent->num < psmd->dm->getNumFaces(psmd->dm)) num = parent->num; - get_particle_uvco_mcol(part->from, psmd->dm, pa->fuv, num, &sd); + get_particle_uvco_mcol(part->from, psmd->dm, parent->fuv, num, &sd); } dosimplify = psys_render_simplify_params(psys, cpa, simplify); -- cgit v1.2.3 From fcdb34f593735f977589e925c4c66883603d2bbc Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 20 May 2009 21:34:50 +0000 Subject: BGE #18664: Incorrect behavior for objects when unparented. A parented object is made static in all cases. --- source/gameengine/Converter/BL_BlenderDataConversion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 13aac74edca..bf965f677c6 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1571,8 +1571,8 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, } - if (parent && (parent->gameflag & OB_DYNAMIC)) { - + if (parent/* && (parent->gameflag & OB_DYNAMIC)*/) { + // parented object cannot be dynamic KX_GameObject *parentgameobject = converter->FindGameObject(parent); objprop.m_dynamic_parent = parentgameobject; //cannot be dynamic: -- cgit v1.2.3 From 3daa8bd4ef5a52c40b01827b55df3807a1917eea Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 20 May 2009 23:31:58 +0000 Subject: fix for [#18772] c3d_import script crashes Patch from Roger Wickes update to 2.48 sFrame, eFrame, fps. [#18794] GE API conversion script: 2.48 -> 2.49 patch from Alex Fraser (z0r), will test further in the next few days. --- This is text plug in and standalone script that updates Blender 2.48 Game Engine scripts to be compatible with the 2.49 API. The script contains a mapping of attribute names to functions that do the conversion. Most of the mappings were extracted from the documentation in GameTypes.py. Where the conversion is ambiguous, the script will not change the source except to insert a warning as a comment. This means that the script does not completely automate the conversion process, but will do a lot of the work. The script still needs a fair bit of testing. Many of the mappings have not been tested and could result in broken scripts. I'm submitting this patch now to start the review process early. I think I might need help if it is to be included in 2.49. --- source/gameengine/PyDoc/GameTypes.py | 85 +++++++++++++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index b5dc89e4002..47c27a5c3c9 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -151,16 +151,22 @@ class SCA_ISensor(SCA_ILogicBrick): def isPositive(): """ True if this sensor brick is in a positive state. + + @deprecated: use L{positive} """ def isTriggered(): """ True if this sensor brick has triggered the current controller. + + @deprecated: use L{triggered} """ def getUsePosPulseMode(): """ True if the sensor is in positive pulse mode. + + @deprecated: use L{usePosPulseMode} """ def setUsePosPulseMode(pulse): """ @@ -168,6 +174,7 @@ class SCA_ISensor(SCA_ILogicBrick): @type pulse: boolean @param pulse: If True, will activate positive pulse mode for this sensor. + @deprecated: use L{usePosPulseMode} """ def getFrequency(): """ @@ -175,6 +182,7 @@ class SCA_ISensor(SCA_ILogicBrick): @rtype: integer @return: the pulse frequency in 1/50 sec. + @deprecated: use L{frequency} """ def setFrequency(freq): """ @@ -182,10 +190,13 @@ class SCA_ISensor(SCA_ILogicBrick): @type freq: integer @return: the pulse frequency in 1/50 sec. + @deprecated: use L{frequency} """ def getUseNegPulseMode(): """ True if the sensor is in negative pulse mode. + + @deprecated: use L{useNegPulseMode} """ def setUseNegPulseMode(pulse): """ @@ -193,10 +204,13 @@ class SCA_ISensor(SCA_ILogicBrick): @type pulse: boolean @param pulse: If True, will activate negative pulse mode for this sensor. + @deprecated: use L{useNegPulseMode} """ def getInvert(): """ True if this sensor activates on negative events. + + @deprecated: use L{invert} """ def setInvert(invert): """ @@ -204,6 +218,7 @@ class SCA_ISensor(SCA_ILogicBrick): @type invert: boolean @param invert: true if activates on negative events; false if activates on positive events. + @deprecated: use L{invert} """ def getLevel(): """ @@ -215,6 +230,7 @@ class SCA_ISensor(SCA_ILogicBrick): @rtype: boolean @return: true if sensor is level sensitive, false if it is edge sensitive + @deprecated: use L{level} """ def setLevel(level): """ @@ -222,6 +238,7 @@ class SCA_ISensor(SCA_ILogicBrick): @param level: Detect level instead of edge? (KX_TRUE, KX_FALSE) @type level: boolean + @deprecated: use L{level} """ #} @@ -315,7 +332,7 @@ class BL_ActionActuator(SCA_IActuator): @ivar useContinue: The actions continue option, True or False. When True, the action will always play from where last left off, otherwise negative events to this actuator will reset it to its start frame. - @type: boolean + @type useContinue: boolean @ivar framePropName: The name of the property that is set to the current frame number. @type framePropName: string """ @@ -2575,7 +2592,7 @@ class KX_NetworkMessageSensor(SCA_ISensor): @type subject: string @ivar frameMessageCount: The number of messages received since the last frame. (Read-only) - @type framemessageCount: int + @type frameMessageCount: int @ivar subjects: The list of message subjects received. (Read-only) @type subjects: list of strings @ivar bodies: The list of message bodies received. (Read-only) @@ -5614,3 +5631,67 @@ for name, val in locals().items(): for a in attrs: print a """ + + +# Util func to construct a mapping from deprecated attrs to new ones. +""" +import types +import re +import pprint +depAttrs = {} +for name, val in locals().items(): + if name.startswith('__'): + continue + if type(val) == types.ClassType: + print "\t# %s" % name + + # Inspect each attribute. + for attrName in dir(val): + if attrName.startswith('__'): + continue + attr = getattr(val, attrName) + + # Check whether this attribute is deprecated by searching each line. + newAttrName = None + for line in attr.__doc__.split('\n'): + match = re.search(r'@deprecated.*L{(\w+)}', line) + if match: + newAttrName = match.group(1) + break + if not newAttrName: + continue + + # Store the mappings to new attributes in a list (because there + # could be collisions). + if not depAttrs.has_key(attrName): + depAttrs[attrName] = {} + mapping = depAttrs[attrName] + + for line in val.__doc__.split('\n'): + if ("@type %s:" % newAttrName) in line: + # The attribute is being replaced in this class (i.e. the + # deprecated attribute wasn't inherited from a parent). We + # have a winner! + funcType = None + if 'sequence' in line: + funcType = 'Keyed' + else: + funcType = 'Simple' + + if attrName.startswith('get') or attrName.startswith('is'): + func = "replace%sGetter" % funcType + elif attrName.startswith('set') or attrName.startswith('enable'): + func = "replace%sSetter" % funcType + else: + func = 'UNKNOWN' + + # Another mapping, from a conversion tuple to lists of class + # names. + conversion = (func, newAttrName) + if not mapping.has_key(conversion): + mapping[conversion] = [] + mapping[conversion].append(name) + break + +pprint.pprint(depAttrs, width = 100) +""" -- cgit v1.2.3 From 3f584de8ecf76ad084b15eb4fb1e78e827ab1328 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 21 May 2009 07:28:02 +0000 Subject: [#18795] Subdivide Smooth can give wrong vcol weights given by subdivide are not normalized, if that was fixed could avoid clamping. --- source/blender/blenkernel/intern/customdata.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 6d5b86fa874..4038ccb1ea7 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -33,7 +33,7 @@ */ #include "BKE_customdata.h" - +#include "BKE_utildefines.h" // CLAMP #include "BLI_blenlib.h" #include "BLI_linklist.h" #include "BLI_mempool.h" @@ -421,6 +421,14 @@ static void layerInterp_mloopcol(void **sources, float *weights, col.b += src->b * weight; } } + + /* Subdivide smooth or fractal can cause problems without clamping + * although weights should also not cause this situation */ + CLAMP(col.a, 0.0f, 255.0f); + CLAMP(col.r, 0.0f, 255.0f); + CLAMP(col.g, 0.0f, 255.0f); + CLAMP(col.b, 0.0f, 255.0f); + mc->a = (int)col.a; mc->r = (int)col.r; mc->g = (int)col.g; @@ -496,6 +504,14 @@ static void layerInterp_mcol(void **sources, float *weights, } for(j = 0; j < 4; ++j) { + + /* Subdivide smooth or fractal can cause problems without clamping + * although weights should also not cause this situation */ + CLAMP(col[j].a, 0.0f, 255.0f); + CLAMP(col[j].r, 0.0f, 255.0f); + CLAMP(col[j].g, 0.0f, 255.0f); + CLAMP(col[j].b, 0.0f, 255.0f); + mc[j].a = (int)col[j].a; mc[j].r = (int)col[j].r; mc[j].g = (int)col[j].g; -- cgit v1.2.3 From 5fc6afe2405833b9a4963bf66829b736998eec73 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Thu, 21 May 2009 10:25:40 +0000 Subject: == Sequencer == This fixes: [#18007] Audio playback of a scene strip containing audio is broken. (needed a different recursion protection than video render code, since video and audio render can be called simultaneously because of SDL audio thread callbacks) Also: we don't display a wait cursor, if the scene strip has DOSEQ enabled. (no need to wait, it is the sequencer which is realtime by definition :) --- source/blender/include/BSE_seqaudio.h | 6 +- source/blender/makesdna/DNA_scene_types.h | 1 + source/blender/src/seqaudio.c | 166 +++++++++++++++++++++++------- source/blender/src/sequence.c | 9 +- 4 files changed, 139 insertions(+), 43 deletions(-) (limited to 'source') diff --git a/source/blender/include/BSE_seqaudio.h b/source/blender/include/BSE_seqaudio.h index 64aa50c661d..1886b3e8771 100644 --- a/source/blender/include/BSE_seqaudio.h +++ b/source/blender/include/BSE_seqaudio.h @@ -43,10 +43,10 @@ void audio_mixdown(); void audio_makestream(bSound *sound); -void audiostream_play(uint32_t startframe, uint32_t duration, int mixdown); +void audiostream_play(int startframe, uint32_t duration, int mixdown); void audiostream_fill(uint8_t* mixdown, int len); -void audiostream_start(uint32_t frame); -void audiostream_scrub(uint32_t frame); +void audiostream_start(int frame); +void audiostream_scrub(int frame); void audiostream_stop(void); int audiostream_pos(void); diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 36df11ac2e8..a885cbeb2af 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -668,6 +668,7 @@ typedef struct Scene { #define R_STAMP_INFO 0x4000 #define R_FULL_SAMPLE 0x8000 #define R_COMP_RERENDER 0x10000 +#define R_RECURS_PROTECTION 0x20000 /* r->stamp */ #define R_STAMP_TIME 0x0001 diff --git a/source/blender/src/seqaudio.c b/source/blender/src/seqaudio.c index 0bc40674350..078750ca118 100644 --- a/source/blender/src/seqaudio.c +++ b/source/blender/src/seqaudio.c @@ -95,6 +95,12 @@ static int audio_playing=0; static int audio_initialised=0; static int audio_startframe=0; static double audio_starttime = 0.0; +static Scene * audio_scene = 0; /* we can't use G.scene, since + Sequence Scene strips can change G.scene + (and SDL-audio-fill callback can be + called while we have G.scene changed!) + */ + ///// // /* local protos ------------------- */ @@ -217,7 +223,7 @@ void audiostream_fill(uint8_t *mixdown, int len) #ifndef DISABLE_SDL for (i = 0; i < len; i += 64) { CFRA = (int) ( ((float)(audio_pos-64) - /( G.scene->audio.mixrate*4 )) + /( audio_scene->audio.mixrate*4 )) * FPS ); audio_fill(mixdown + i, NULL, @@ -238,7 +244,7 @@ static void audio_levels(uint8_t *buf, int len, float db, float facf, float pan) if (pan>=0) { facr = 1.0; facl = 1.0-pan; } else { facr = pan+1.0; facl = 1.0; } - fac = pow(10.0, ((-(db+G.scene->audio.main))/20.0)) / facf; + fac = pow(10.0, ((-(db+audio_scene->audio.main))/20.0)) / facf; facl /= fac; facr /= fac; @@ -294,7 +300,8 @@ void audio_makestream(bSound *sound) #ifndef DISABLE_SDL static void audio_fill_ram_sound(Sequence *seq, void * mixdown, - uint8_t * sstream, int len) + uint8_t * sstream, int len, + int cfra) { uint8_t* cvtbuf; bSound* sound; @@ -303,10 +310,10 @@ static void audio_fill_ram_sound(Sequence *seq, void * mixdown, sound = seq->sound; audio_makestream(sound); if ((seq->curposstreamlen -len) && (seq->curpos>=0) && - (seq->startdisp <= CFRA) && ((seq->enddisp) > CFRA)) + (seq->startdisp <= cfra) && ((seq->enddisp) > cfra)) { if(seq->ipo && seq->ipo->curve.first) { - do_seq_ipo(seq, CFRA); + do_seq_ipo(seq, cfra); facf = seq->facf0; } else { facf = 1.0; @@ -328,16 +335,16 @@ static void audio_fill_ram_sound(Sequence *seq, void * mixdown, #ifndef DISABLE_SDL static void audio_fill_hd_sound(Sequence *seq, void * mixdown, uint8_t * sstream, - int len) + int len, int cfra) { uint8_t* cvtbuf; float facf; if ((seq->curpos >= 0) && - (seq->startdisp <= CFRA) && ((seq->enddisp) > CFRA)) + (seq->startdisp <= cfra) && ((seq->enddisp) > cfra)) { if(seq->ipo && seq->ipo->curve.first) { - do_seq_ipo(seq, CFRA); + do_seq_ipo(seq, cfra); facf = seq->facf0; } else { facf = 1.0; @@ -346,7 +353,7 @@ static void audio_fill_hd_sound(Sequence *seq, sound_hdaudio_extract(seq->hdaudio, (short*) cvtbuf, seq->curpos / 4, - G.scene->audio.mixrate, + audio_scene->audio.mixrate, 2, len / 4); audio_levels(cvtbuf, len, seq->level, facf, seq->pan); @@ -365,19 +372,66 @@ static void audio_fill_hd_sound(Sequence *seq, #ifndef DISABLE_SDL static void audio_fill_seq(Sequence * seq, void * mixdown, - uint8_t *sstream, int len, int advance_only) + uint8_t *sstream, int len, int cfra, + int advance_only); + +static void audio_fill_scene_strip(Sequence * seq, void * mixdown, + uint8_t *sstream, int len, int cfra, + int advance_only) +{ + Editing *ed; + + /* prevent eternal loop */ + seq->scene->r.scemode |= R_RECURS_PROTECTION; + + ed = seq->scene->ed; + + if (ed) { + int sce_cfra = seq->sfra + seq->anim_startofs + + cfra - seq->startdisp; + + audio_fill_seq(ed->seqbasep->first, + mixdown, + sstream, len, sce_cfra, + advance_only); + } + + /* restore */ + seq->scene->r.scemode &= ~R_RECURS_PROTECTION; +} +#endif + +#ifndef DISABLE_SDL +static void audio_fill_seq(Sequence * seq, void * mixdown, + uint8_t *sstream, int len, int cfra, + int advance_only) { while(seq) { if (seq->type == SEQ_META && (!(seq->flag & SEQ_MUTE))) { - if (seq->startdisp <= CFRA && seq->enddisp > CFRA) { + if (seq->startdisp <= cfra && seq->enddisp > cfra) { audio_fill_seq(seq->seqbase.first, mixdown, sstream, len, - advance_only); + cfra, advance_only); } else { audio_fill_seq(seq->seqbase.first, mixdown, sstream, len, - 1); + cfra, 1); + } + } + if (seq->type == SEQ_SCENE + && (!(seq->flag & SEQ_MUTE)) + && seq->scene + && (seq->scene->r.scemode & R_DOSEQ) + && !(seq->scene->r.scemode & R_RECURS_PROTECTION)) { + if (seq->startdisp <= cfra && seq->enddisp > cfra) { + audio_fill_scene_strip( + seq, mixdown, sstream, len, + cfra, advance_only); + } else { + audio_fill_scene_strip( + seq, mixdown, sstream, len, + cfra, 1); } } if ( (seq->type == SEQ_RAM_SOUND) && @@ -387,7 +441,8 @@ static void audio_fill_seq(Sequence * seq, void * mixdown, seq->curpos += len; } else { audio_fill_ram_sound( - seq, mixdown, sstream, len); + seq, mixdown, sstream, len, + cfra); } } if ( (seq->type == SEQ_HD_SOUND) && @@ -405,7 +460,8 @@ static void audio_fill_seq(Sequence * seq, void * mixdown, } if (seq->hdaudio) { audio_fill_hd_sound(seq, mixdown, - sstream, len); + sstream, len, + cfra); } } } @@ -420,10 +476,15 @@ static void audio_fill(void *mixdown, uint8_t *sstream, int len) Editing *ed; Sequence *seq; - ed = G.scene->ed; - if((ed) && (!(G.scene->audio.flag & AUDIO_MUTE))) { + if (!audio_scene) { + return; + } + + ed = audio_scene->ed; + if((ed) && (!(audio_scene->audio.flag & AUDIO_MUTE))) { seq = ed->seqbasep->first; - audio_fill_seq(seq, mixdown, sstream, len, 0); + audio_fill_seq(seq, mixdown, sstream, len, + audio_scene->r.cfra, 0); } audio_pos += len; @@ -463,7 +524,7 @@ static int audio_init(SDL_AudioSpec *desired) } #endif -static int audiostream_play_seq(Sequence * seq, uint32_t startframe) +static int audiostream_play_seq(Sequence * seq, int startframe) { char name[FILE_MAXDIR+FILE_MAXFILE]; int have_sound = 0; @@ -475,14 +536,38 @@ static int audiostream_play_seq(Sequence * seq, uint32_t startframe) have_sound = 1; } } + if (seq->type == SEQ_SCENE + && seq->scene + && (seq->scene->r.scemode & R_DOSEQ) + && !(seq->scene->r.scemode & R_RECURS_PROTECTION)) { + Editing *ed; + + /* prevent eternal loop */ + seq->scene->r.scemode |= R_RECURS_PROTECTION; + + ed = seq->scene->ed; + + if (ed) { + int sce_cfra = seq->sfra + seq->anim_startofs + + startframe - seq->startdisp; + + if (audiostream_play_seq(ed->seqbasep->first, + sce_cfra)) { + have_sound = 1; + } + } + + /* restore */ + seq->scene->r.scemode &= ~R_RECURS_PROTECTION; + } if ((seq->type == SEQ_RAM_SOUND) && (seq->sound)) { have_sound = 1; - seq->curpos = (int)( (FRA2TIME( - (double) startframe - - (double) seq->start + - (double) - seq->anim_startofs) - * ((float)G.scene->audio.mixrate) + seq->curpos = (int)( (FRA2TIME(((double) startframe) - + ((double) seq->start) + + ((double) + seq->anim_startofs)) + * ((float)audio_scene + ->audio.mixrate) * 4 )); } if ((seq->type == SEQ_HD_SOUND)) { @@ -494,11 +579,13 @@ static int audiostream_play_seq(Sequence * seq, uint32_t startframe) seq->hdaudio = sound_open_hdaudio(name); } - seq->curpos = (int)( (FRA2TIME((double) startframe - - (double) seq->start + - (double) - seq->anim_startofs) - * ((float)G.scene->audio.mixrate) + + seq->curpos = (int)( (FRA2TIME(((double) startframe) - + ((double) seq->start) + + ((double) + seq->anim_startofs)) + * ((float)audio_scene + ->audio.mixrate) * 4 )); } seq= seq->next; @@ -506,14 +593,16 @@ static int audiostream_play_seq(Sequence * seq, uint32_t startframe) return have_sound; } -void audiostream_play(uint32_t startframe, uint32_t duration, int mixdown) +void audiostream_play(int startframe, uint32_t duration, int mixdown) { #ifndef DISABLE_SDL static SDL_AudioSpec desired; Editing *ed; int have_sound = 0; - ed= G.scene->ed; + audio_scene = G.scene; + + ed= audio_scene->ed; if(ed) { have_sound = audiostream_play_seq(ed->seqbasep->first, startframe); @@ -525,7 +614,7 @@ void audiostream_play(uint32_t startframe, uint32_t duration, int mixdown) } if (U.mixbufsize && !audio_initialised && !mixdown) { - desired.freq=G.scene->audio.mixrate; + desired.freq=audio_scene->audio.mixrate; desired.format=AUDIO_S16SYS; desired.channels=2; desired.samples=U.mixbufsize; @@ -538,7 +627,7 @@ void audiostream_play(uint32_t startframe, uint32_t duration, int mixdown) audio_startframe = startframe; audio_pos = ( ((int)( FRA2TIME(startframe) - *(G.scene->audio.mixrate)*4 )) & (~3) ); + *(audio_scene->audio.mixrate)*4 )) & (~3) ); audio_starttime = PIL_check_seconds_timer(); /* if audio already is playing, just reseek, otherwise @@ -553,12 +642,12 @@ void audiostream_play(uint32_t startframe, uint32_t duration, int mixdown) #endif } -void audiostream_start(uint32_t frame) +void audiostream_start(int frame) { audiostream_play(frame, 0, 0); } -void audiostream_scrub(uint32_t frame) +void audiostream_scrub(int frame) { if (U.mixbufsize) audiostream_play(frame, 4096/U.mixbufsize, 0); } @@ -568,6 +657,7 @@ void audiostream_stop(void) #ifndef DISABLE_SDL SDL_PauseAudio(1); audio_playing=0; + audio_scene=0; #endif } @@ -575,9 +665,9 @@ int audiostream_pos(void) { int pos; - if (U.mixbufsize) { + if (U.mixbufsize && audio_scene) { pos = (int) (((double)(audio_pos-U.mixbufsize) - / ( G.scene->audio.mixrate*4 )) + / ( audio_scene->audio.mixrate*4 )) * FPS ); } else { /* fallback to seconds_timer when no audio available */ pos = (int) ((PIL_check_seconds_timer() - audio_starttime) diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index cd42c3d4085..edc68d016a1 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -1884,7 +1884,10 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, if (!sce_valid) { se->ok = STRIPELEM_FAILED; } else if (se->ibuf==NULL && sce_valid) { - waitcursor(1); + /* no need to display a waitcursor on sequencer + scene strips */ + if (!(sce->r.scemode & R_DOSEQ)) + waitcursor(1); /* Hack! This function can be called from do_render_seq(), in that case the seq->scene can already have a Render initialized with same name, @@ -1935,7 +1938,9 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, /* restore */ G.scene->r.scemode |= doseq; - if((G.f & G_PLAYANIM)==0) /* bad, is set on do_render_seq */ + if((G.f & G_PLAYANIM)==0 /* bad, is set on do_render_seq */ + && !(sce->r.scemode & R_DOSEQ)) + waitcursor(0); CFRA = oldcfra; set_last_seq(oldseq); -- cgit v1.2.3 From 06a7155b681cdb02c6b75b9934f9235efcc6c297 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 21 May 2009 13:32:15 +0000 Subject: BGE: user control to compound shape and setParent. Compound shape control ====================== 1) GUI control It is now possible to control which child shape is added to a parent compound shape in the Physics buttons. The "Compound" shape button becomes "Add to parent" on child objects and determines whether the child shape is to be added to the top parent compound shape when the game is stated. Notes: * "Compound" is only available to top parent objects (objects without parent). * Nesting of compound shape is not possible: a child object with "Add to parent" button set will be added to the top parent compound shape, regardless of its position in the parent-child hierarchy and even if its immediate parent doesn't have the "Add to parent" button set. 2) runtime control It is now possible to control the compound shape at runtime: The SetParent actuator has a new "Compound" button that indicates whether the object shape should be added to the compound shape of the parent object, provided the parent has a compound shape of course. If not, the object retain it's individual state while parented. Similarly, the KX_GameObject.setParent() python function has a new compound parameter. Notes: * When an object is dynamically added to a compound shape, it looses temporarily all its physics capability to the benefit of the parent: it cannot register collisions and the characteristics of its shape are lost (ghost, sensor, dynamic, etc.). * Nested compound shape is not supported: if the object being parented is already a compound shape, it is not added to the compound parent (as if the Compound option was not set in the actuator or the setParent function). * To ensure compatibility with old blend files, the Blender subversion is changed to 2.48.5 and the old blend files are automatically converted to match the old behavior: all children of a Compound object will have the "Add to parent" button set automatically. Child ghost control =================== It is now possible to control if an object should becomes ghost or solid when parented. This is only applicable if the object is not added to the parent compound shape (see above). A new "Ghost" button is available on the SetParent actuator to that effect. Similarly the KX_GameObject.setParent() python function has a new compound parameter. Notes: * This option is not applicable to sensor objects: they stay ghost all the time. * Make sure the child object does not enter in collision with the parent shape when the Ghost option if off and the parent is dynamic: the collision creates a reaction force but the parent cannot escape the child, so the force builds up and produces eratic movements. * The collision capability of an ordinary object (dynamic or static) is limited when it is parented: it becomes automatically static and can only detect dynamic and sensor objects. * A sensor object retain its full collision capability when parented: it can detect static and dynamic object. Python control ============== KX_GameObject.setParent(parent,compound,ghost): Sets this object's parent. Control the shape status with the optional compound and ghost parameters: compound=1: the object shape should be added to the parent compound shape (default) compound=0: the object should keep its individual shape. In that case you can control if it should be ghost or not: ghost=1 if the object should be made ghost while parented (default) ghost=0 if the object should be solid while parented Note: if the object type is sensor, it stays ghost regardless of ghost parameter parent: KX_GameObject reference or string (object name w/o OB prefix) --- source/blender/blenkernel/BKE_blender.h | 2 +- source/blender/blenloader/intern/readfile.c | 16 ++++++++ source/blender/makesdna/DNA_actuator_types.h | 8 +++- source/blender/src/buttons_logic.c | 26 +++++++++--- .../Converter/BL_BlenderDataConversion.cpp | 7 ++-- .../gameengine/Converter/KX_ConvertActuators.cpp | 6 +++ .../gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 48 ++++++++-------------- source/gameengine/Ketsji/KX_GameObject.cpp | 21 ++++++---- source/gameengine/Ketsji/KX_GameObject.h | 4 +- source/gameengine/Ketsji/KX_ParentActuator.cpp | 8 +++- source/gameengine/Ketsji/KX_ParentActuator.h | 5 +++ source/gameengine/PyDoc/GameTypes.py | 22 +++++++++- 12 files changed, 120 insertions(+), 53 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index d49a5425b61..aa2366661f8 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -41,7 +41,7 @@ struct ListBase; struct MemFile; #define BLENDER_VERSION 248 -#define BLENDER_SUBVERSION 4 +#define BLENDER_SUBVERSION 5 #define BLENDER_MINVERSION 245 #define BLENDER_MINSUBVERSION 15 diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 0f233410f4e..25c8a928a3b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8106,6 +8106,22 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 5)) { + Object *ob; + for(ob = main->object.first; ob; ob= ob->id.next) { + if(ob->parent) { + /* check if top parent has compound shape set and if yes, set this object + to compound shaper as well (was the behaviour before, now it's optional) */ + Object *parent= newlibadr(fd, lib, ob->parent); + while (parent->parent != NULL) { + parent = newlibadr(fd, lib, parent->parent); + } + if (parent->gameflag & OB_CHILD) + ob->gameflag |= OB_CHILD; + } + } + } + if (main->versionfile < 249) { Scene *sce; for (sce= main->scene.first; sce; sce= sce->id.next) diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index 81c02779cba..f713b4a8acc 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -215,7 +215,8 @@ typedef struct bTwoDFilterActuator{ }bTwoDFilterActuator; typedef struct bParentActuator { - char pad[4]; + char pad[2]; + short flag; int type; struct Object *ob; } bParentActuator; @@ -483,6 +484,11 @@ typedef struct FreeCamera { /* parentactuator->type */ #define ACT_PARENT_SET 0 #define ACT_PARENT_REMOVE 1 + +/* parentactuator->flag */ +#define ACT_PARENT_COMPOUND 1 +#define ACT_PARENT_GHOST 2 + #endif diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 2f8933b593b..b7039673dfc 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -2747,11 +2747,22 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh if(parAct->type==ACT_PARENT_SET) { - ysize= 48; + ysize= 68; glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+40, yco-44, (width-80), 19, &(parAct->ob), "Set this object as parent"); + uiBlockBeginAlign(block); + uiDefButBitI(block, TOGN, ACT_PARENT_COMPOUND, B_REDR, + "Compound", + xco + 40, yco - 64, (width - 80)/2, 19, &parAct->flag, + 0.0, 0.0, 0, 0, + "Add this object shape to the parent shape (only if the parent shape is already compound)"); + uiDefButBitI(block, TOGN, ACT_PARENT_GHOST, B_REDR, + "Ghost", + xco + 40 + ((width - 80)/2), yco - 64, (width - 80)/2, 19, &parAct->flag, + 0.0, 0.0, 0, 0, + "Make this object ghost while parented (only if not compound)"); + uiBlockEndAlign(block); } else if(parAct->type==ACT_PARENT_REMOVE) { @@ -3480,9 +3491,14 @@ static void buttons_bullet(uiBlock *block, Object *ob) } if (ob->body_type!=OB_BODY_TYPE_SOFT) { - uiDefButBitI(block, TOG, OB_CHILD, B_REDR, "Compound", 240,105,110,19, - &ob->gameflag, 0, 0, 0, 0, - "Add Children"); + if (ob->parent) + uiDefButBitI(block, TOG, OB_CHILD, B_REDR, "Add to parent", 240,105,110,19, + &ob->gameflag, 0, 0, 0, 0, + "Add this shape to the parent compound shape"); + else + uiDefButBitI(block, TOG, OB_CHILD, B_REDR, "Compound", 240,105,110,19, + &ob->gameflag, 0, 0, 0, 0, + "Create a compound shape with the children's shape that are tagged for addition"); } } uiBlockEndAlign(block); diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index bf965f677c6..82edd4f218b 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1377,10 +1377,11 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, } bool isCompoundChild = false; + bool hasCompoundChildren = !parent && (blenderobject->gameflag & OB_CHILD); - if (parent && (parent->gameflag & OB_DYNAMIC)) { + if (parent/* && (parent->gameflag & OB_DYNAMIC)*/) { - if ((parent->gameflag & OB_CHILD) != 0) + if ((parent->gameflag & OB_CHILD) != 0 && (blenderobject->gameflag & OB_CHILD)) { isCompoundChild = true; } @@ -1406,7 +1407,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, objprop.m_lockZRotaxis = (blenderobject->gameflag2 & OB_LOCK_RIGID_BODY_Z_ROT_AXIS) !=0; objprop.m_isCompoundChild = isCompoundChild; - objprop.m_hasCompoundChildren = (blenderobject->gameflag & OB_CHILD) != 0; + objprop.m_hasCompoundChildren = hasCompoundChildren; objprop.m_margin = blenderobject->margin; // ACTOR is now a separate feature objprop.m_isactor = (blenderobject->gameflag & OB_ACTOR)!=0; diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 98df34aa4a9..2b832996c45 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -1123,6 +1123,8 @@ void BL_ConvertActuators(char* maggiename, { bParentActuator *parAct = (bParentActuator *) bact->data; int mode = KX_ParentActuator::KX_PARENT_NODEF; + bool addToCompound = true; + bool ghost = true; KX_GameObject *tmpgob = NULL; switch(parAct->type) @@ -1130,6 +1132,8 @@ void BL_ConvertActuators(char* maggiename, case ACT_PARENT_SET: mode = KX_ParentActuator::KX_PARENT_SET; tmpgob = converter->FindGameObject(parAct->ob); + addToCompound = !(parAct->flag & ACT_PARENT_COMPOUND); + ghost = !(parAct->flag & ACT_PARENT_GHOST); break; case ACT_PARENT_REMOVE: mode = KX_ParentActuator::KX_PARENT_REMOVE; @@ -1140,6 +1144,8 @@ void BL_ConvertActuators(char* maggiename, KX_ParentActuator *tmpparact = new KX_ParentActuator(gameobj, mode, + addToCompound, + ghost, tmpgob); baseact = tmpparact; break; diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index d81b6d5a653..406339586cc 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -949,39 +949,27 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, assert(colShape->isCompound()); btCompoundShape* compoundShape = (btCompoundShape*)colShape; - // compute the local transform from parent, this may include a parent inverse node + // compute the local transform from parent, this may include several node in the chain SG_Node* gameNode = gameobj->GetSGNode(); - SG_Node* parentInverseNode = gameNode->GetSGParent(); - if (parentInverseNode && parentInverseNode->GetSGClientObject() != NULL) - // this is not a parent inverse node, cancel it - parentInverseNode = NULL; - // now combine the parent inverse node and the game node - MT_Point3 childPos = gameNode->GetLocalPosition(); - MT_Matrix3x3 childRot = gameNode->GetLocalOrientation(); - MT_Vector3 childScale = gameNode->GetLocalScale(); - if (parentInverseNode) - { - const MT_Point3& parentInversePos = parentInverseNode->GetLocalPosition(); - const MT_Matrix3x3& parentInverseRot = parentInverseNode->GetLocalOrientation(); - const MT_Vector3& parentInverseScale = parentInverseNode->GetLocalScale(); - childRot = parentInverseRot * childRot; - childScale = parentInverseScale * childScale; - childPos = parentInversePos+parentInverseScale*(parentInverseRot*childPos); - } - - shapeInfo->m_childScale.setValue(childScale.x(),childScale.y(),childScale.z()); + SG_Node* parentNode = objprop->m_dynamic_parent->GetSGNode(); + // relative transform + MT_Vector3 parentScale = parentNode->GetWorldScaling(); + parentScale[0] = MT_Scalar(1.0)/parentScale[0]; + parentScale[1] = MT_Scalar(1.0)/parentScale[1]; + parentScale[2] = MT_Scalar(1.0)/parentScale[2]; + MT_Vector3 relativeScale = gameNode->GetWorldScaling() * parentScale; + MT_Matrix3x3 parentInvRot = parentNode->GetWorldOrientation().transposed(); + MT_Vector3 relativePos = parentInvRot*((gameNode->GetWorldPosition()-parentNode->GetWorldPosition())*parentScale); + MT_Matrix3x3 relativeRot = parentInvRot*gameNode->GetWorldOrientation(); + + shapeInfo->m_childScale.setValue(relativeScale[0],relativeScale[1],relativeScale[2]); bm->setLocalScaling(shapeInfo->m_childScale); - - shapeInfo->m_childTrans.setOrigin(btVector3(childPos.x(),childPos.y(),childPos.z())); - float rotval[12]; - childRot.getValue(rotval); - btMatrix3x3 newRot; - newRot.setValue(rotval[0],rotval[1],rotval[2],rotval[4],rotval[5],rotval[6],rotval[8],rotval[9],rotval[10]); - newRot = newRot.transpose(); - - shapeInfo->m_childTrans.setBasis(newRot); + shapeInfo->m_childTrans.getOrigin().setValue(relativePos[0],relativePos[1],relativePos[2]); + float rot[12]; + relativeRot.getValue(rot); + shapeInfo->m_childTrans.getBasis().setFromOpenGLSubMatrix(rot); + parentShapeInfo->AddShape(shapeInfo); - compoundShape->addChildShape(shapeInfo->m_childTrans,bm); //do some recalc? //recalc inertia for rigidbody diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 63d508e6250..0c191257f41 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -224,7 +224,7 @@ KX_GameObject* KX_GameObject::GetParent() } -void KX_GameObject::SetParent(KX_Scene *scene, KX_GameObject* obj) +void KX_GameObject::SetParent(KX_Scene *scene, KX_GameObject* obj, bool addToCompound, bool ghost) { // check on valid node in case a python controller holds a reference to a deleted object if (obj && GetSGNode() && obj->GetSGNode() && GetSGNode()->GetSGParent() != obj->GetSGNode()) @@ -245,7 +245,7 @@ void KX_GameObject::SetParent(KX_Scene *scene, KX_GameObject* obj) if (m_pPhysicsController1) { - m_pPhysicsController1->SuspendDynamics(true); + m_pPhysicsController1->SuspendDynamics(ghost); } // Set us to our new scale, position, and orientation scale2[0] = 1.0/scale2[0]; @@ -266,7 +266,7 @@ void KX_GameObject::SetParent(KX_Scene *scene, KX_GameObject* obj) Release(); // if the new parent is a compound object, add this object shape to the compound shape. // step 0: verify this object has physical controller - if (m_pPhysicsController1) + if (m_pPhysicsController1 && addToCompound) { // step 1: find the top parent (not necessarily obj) KX_GameObject* rootobj = (KX_GameObject*)obj->GetSGNode()->GetRootSGParent()->GetSGClientObject(); @@ -1160,7 +1160,7 @@ PyMethodDef KX_GameObject::Methods[] = { {"disableRigidBody", (PyCFunction)KX_GameObject::sPyDisableRigidBody,METH_NOARGS}, {"applyImpulse", (PyCFunction) KX_GameObject::sPyApplyImpulse, METH_VARARGS}, {"setCollisionMargin", (PyCFunction) KX_GameObject::sPySetCollisionMargin, METH_O}, - {"setParent", (PyCFunction)KX_GameObject::sPySetParent,METH_O}, + {"setParent", (PyCFunction)KX_GameObject::sPySetParent,METH_VARARGS}, {"setVisible",(PyCFunction) KX_GameObject::sPySetVisible, METH_VARARGS}, {"setOcclusion",(PyCFunction) KX_GameObject::sPySetOcclusion, METH_VARARGS}, {"removeParent", (PyCFunction)KX_GameObject::sPyRemoveParent,METH_NOARGS}, @@ -2147,15 +2147,20 @@ PyObject* KX_GameObject::PyGetParent() Py_RETURN_NONE; } -PyObject* KX_GameObject::PySetParent(PyObject* value) +PyObject* KX_GameObject::PySetParent(PyObject* args) { KX_Scene *scene = KX_GetActiveScene(); + PyObject* pyobj; KX_GameObject *obj; + int addToCompound=1, ghost=1; - if (!ConvertPythonToGameObject(value, &obj, false, "gameOb.setParent(value): KX_GameObject")) + if (!PyArg_ParseTuple(args,"O|ii:setParent", &pyobj, &addToCompound, &ghost)) { + return NULL; // Python sets a simple error + } + if (!ConvertPythonToGameObject(pyobj, &obj, true, "gameOb.setParent(obj): KX_GameObject")) return NULL; - - this->SetParent(scene, obj); + if (obj) + this->SetParent(scene, obj, addToCompound, ghost); Py_RETURN_NONE; } diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 0011b8407fd..c89b8f30779 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -171,7 +171,7 @@ public: /** * Sets the parent of this object to a game object */ - void SetParent(KX_Scene *scene, KX_GameObject *obj); + void SetParent(KX_Scene *scene, KX_GameObject *obj, bool addToCompound=true, bool ghost=true); /** * Removes the parent of this object to a game object @@ -858,7 +858,7 @@ public: KX_PYMETHOD_VARARGS(KX_GameObject,ApplyImpulse); KX_PYMETHOD_O(KX_GameObject,SetCollisionMargin); KX_PYMETHOD_NOARGS(KX_GameObject,GetParent); - KX_PYMETHOD_O(KX_GameObject,SetParent); + KX_PYMETHOD_VARARGS(KX_GameObject,SetParent); KX_PYMETHOD_NOARGS(KX_GameObject,RemoveParent); KX_PYMETHOD_NOARGS(KX_GameObject,GetChildren); KX_PYMETHOD_NOARGS(KX_GameObject,GetChildrenRecursive); diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index 38ad9aec33b..cd2ed456c48 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -48,10 +48,14 @@ KX_ParentActuator::KX_ParentActuator(SCA_IObject *gameobj, int mode, + bool addToCompound, + bool ghost, SCA_IObject *ob, PyTypeObject* T) : SCA_IActuator(gameobj, T), m_mode(mode), + m_addToCompound(addToCompound), + m_ghost(ghost), m_ob(ob) { if (m_ob) @@ -121,7 +125,7 @@ bool KX_ParentActuator::Update() switch (m_mode) { case KX_PARENT_SET: if (m_ob) - obj->SetParent(scene, (KX_GameObject*)m_ob); + obj->SetParent(scene, (KX_GameObject*)m_ob, m_addToCompound, m_ghost); break; case KX_PARENT_REMOVE: obj->RemoveParent(scene); @@ -179,6 +183,8 @@ PyMethodDef KX_ParentActuator::Methods[] = { PyAttributeDef KX_ParentActuator::Attributes[] = { KX_PYATTRIBUTE_RW_FUNCTION("object", KX_ParentActuator, pyattr_get_object, pyattr_set_object), KX_PYATTRIBUTE_INT_RW("mode", KX_PARENT_NODEF+1, KX_PARENT_MAX-1, true, KX_ParentActuator, m_mode), + KX_PYATTRIBUTE_BOOL_RW("compound", KX_ParentActuator, m_addToCompound), + KX_PYATTRIBUTE_BOOL_RW("ghost", KX_ParentActuator, m_ghost), { NULL } //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h index 6af0888e2ba..148375e994c 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.h +++ b/source/gameengine/Ketsji/KX_ParentActuator.h @@ -46,6 +46,9 @@ class KX_ParentActuator : public SCA_IActuator /** Mode */ int m_mode; + /** option */ + bool m_addToCompound; + bool m_ghost; /** Object to set as parent */ SCA_IObject *m_ob; @@ -63,6 +66,8 @@ class KX_ParentActuator : public SCA_IActuator KX_ParentActuator(class SCA_IObject* gameobj, int mode, + bool addToCompound, + bool ghost, SCA_IObject *ob, PyTypeObject* T=&Type); virtual ~KX_ParentActuator(); diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index 47c27a5c3c9..3f9b627247f 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -1896,12 +1896,23 @@ class KX_GameObject(SCA_IObject): @rtype: L{KX_GameObject} @return: this object's parent object, or None if this object has no parent. """ - def setParent(parent): + def setParent(parent,compound,ghost): """ - Sets this object's parent. + Sets this object's parent. + Control the shape status with the optional compound and ghost parameters: + compound=1: the object shape should be added to the parent compound shape (default) + compound=0: the object should keep its individual shape. + In that case you can control if it should be ghost or not: + ghost=1 if the object should be made ghost while parented (default) + ghost=0 if the object should be solid while parented + Note: if the object type is sensor, it stays ghost regardless of ghost parameter @type parent: L{KX_GameObject} @param parent: new parent object. + @type compound: int + @param compound: whether the shape should be added to the parent compound shape + @type ghost: int + @param ghost: whether the object should be ghost while parented """ def removeParent(): """ @@ -2937,6 +2948,13 @@ class KX_ParentActuator(SCA_IActuator): @type object: KX_GameObject or None @ivar mode: The mode of this actuator @type mode: int from 0 to 1 L{GameLogic.Parent Actuator} + @ivar compound: Whether the object shape should be added to the parent compound shape when parenting + Effective only if the parent is already a compound shape + @type compound: bool + @ivar ghost: whether the object should be made ghost when parenting + Effective only if the shape is not added to the parent compound shape + @type ghost: bool + """ def setObject(object): """ -- cgit v1.2.3 From 036ebc55233241bf9bd8149f855185cfcfb1ab67 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 21 May 2009 18:10:19 +0000 Subject: BGE: GUI control over frame rate, logic rate, physics rate and physics subrate. Four new buttons in World settings to control frame rate: fps: Nominal frame rate in frame per second. Also sets the physics timestep = 1/fps phys: Maximum number of physics timestep per game frame in case the actual fps is less than nominal. This allows the physics to keep up with real time even if the graphics slows down the game. sub: Fixed number of simulation substeps per physic timestep. Improves the precision of the physics simulation. Useful for fast moving objects for example. log: Maximum number of logic steps per game frame in case the actual fps is less than nominal. This allows the logic system to follow the physics simulation. Upper bound = phys (setting the value higher than phys has no effect). On games with heavy logic system, it is useful to set this value to 1, to keep logic time under control. All these values were already accessible from Python except phys: GameLogic.getMaxPhysicsFrame(): Gets the maximum number of physics frame per render frame. GameLogic.setMaxPhysicsFrame(phys): Sets the maximum number of physics timestep that are executed per render frame. Higher value allows physics to keep up with realtime even if graphics slows down the game. Physics timestep is fixed and equal to 1/tickrate (see setLogicTicRate) maxphysics/ticrate is the maximum delay of the renderer that physics can compensate. phys: integer --- source/blender/blenkernel/intern/world.c | 4 +++ source/blender/blenloader/intern/readfile.c | 7 +++++ source/blender/makesdna/DNA_world_types.h | 1 + source/blender/src/buttons_shading.c | 17 +++++++--- .../Converter/BL_BlenderDataConversion.cpp | 2 ++ source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 36 ++++++++++++++++++---- source/gameengine/Ketsji/KX_KetsjiEngine.h | 9 ++++++ source/gameengine/Ketsji/KX_PythonInit.cpp | 17 ++++++++++ source/gameengine/PyDoc/GameLogic.py | 19 ++++++++++++ 9 files changed, 102 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index 6635ef29d51..d47f4efeb4e 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -109,6 +109,10 @@ World *add_world(char *name) wrld->mode = WO_DBVT_CULLING; // DBVT culling by default wrld->occlusionRes = 128; wrld->preview = NULL; + wrld->ticrate = 60; + wrld->maxlogicstep = 5; + wrld->physubstep = 1; + wrld->maxphystep = 5; return wrld; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 25c8a928a3b..bda0348f2ca 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8108,6 +8108,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 5)) { Object *ob; + World *wrld; for(ob = main->object.first; ob; ob= ob->id.next) { if(ob->parent) { /* check if top parent has compound shape set and if yes, set this object @@ -8120,6 +8121,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ob->gameflag |= OB_CHILD; } } + for(wrld=main->world.first; wrld; wrld= wrld->id.next) { + wrld->ticrate = 60; + wrld->maxlogicstep = 5; + wrld->physubstep = 1; + wrld->maxphystep = 5; + } } if (main->versionfile < 249) { diff --git a/source/blender/makesdna/DNA_world_types.h b/source/blender/makesdna/DNA_world_types.h index f599364ed66..5f6e47acac4 100644 --- a/source/blender/makesdna/DNA_world_types.h +++ b/source/blender/makesdna/DNA_world_types.h @@ -90,6 +90,7 @@ typedef struct World { short mode; short occlusionRes; /* resolution of occlusion Z buffer in pixel */ short physicsEngine; /* here it's aligned */ + short ticrate, maxlogicstep, physubstep, maxphystep; float misi, miststa, mistdist, misthi; diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 79f95d1bf5f..12219944945 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -2198,16 +2198,25 @@ static void world_panel_mistaph(World *wrld) /* Gravitation for the game worlds */ uiDefButF(block, NUMSLI,0, "Grav ", 150,180,150,19, &(wrld->gravity), 0.0, 25.0, 0, 0, "Sets the gravitation constant of the game world"); + uiDefButS(block, NUM, B_REDR, "fps:", + 10, 160, 70, 19, &wrld->ticrate, 1.0, 120.0, 0, 0, "Sets the nominal number of game frames per second. Physics fixed timestep = 1/fps, independently of actual frame rate"); + uiDefButS(block, NUM, B_REDR, "log:", + 80, 160, 70, 19, &wrld->maxlogicstep, 1.0, 5.0, 0, 0, "Sets the maxmimum number of logic frame per game frame if graphics slows down the game, higher value allows better synchronization with physics"); + uiDefButS(block, NUM, B_REDR, "phys:", + 150, 160, 75, 19, &wrld->maxphystep, 1.0, 5.0, 0, 0, "Sets the maximum number of physics step per game frame if graphics slows down the game, higher value allows physics to keep up with realtime"); + uiDefButS(block, NUM, B_REDR, "sub:", + 225, 160, 75, 19, &wrld->physubstep, 1.0, 5.0, 0, 0, "Sets the number of simulation substep per physic timestep, higher value give better physics precision"); + if (wrld->physicsEngine == WOPHY_BULLET) { - uiDefButBitS(block, TOG, WO_DBVT_CULLING, B_REDR, "DBVT culling", 10,160,140,19, &wrld->mode, 0, 0, 0, 0, "Toggles use of optimized Bullet DBVT tree for view frustrum and occlusion culling"); + uiDefButBitS(block, TOG, WO_DBVT_CULLING, B_REDR, "DBVT culling", 10,140,140,19, &wrld->mode, 0, 0, 0, 0, "Toggles use of optimized Bullet DBVT tree for view frustrum and occlusion culling"); if (wrld->mode & WO_DBVT_CULLING) uiDefButS(block, NUM, B_REDR, "Occlu Res:", - 150, 160, 150, 19, &wrld->occlusionRes, 128.0, 1024.0, 0, 0, "Sets the size of the occlusion buffer in pixel, use higher value for better precsion (slower)"); + 150, 140, 150, 19, &wrld->occlusionRes, 128.0, 1024.0, 0, 0, "Sets the size of the occlusion buffer in pixel, use higher value for better precsion (slower)"); } #endif uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButBitS(block, TOG, WO_MIST, B_WORLDPRV2,"Mist", 10,120,140,19, &wrld->mode, 0, 0, 0, 0, "Toggles mist simulation"); + uiDefButBitS(block, TOG, WO_MIST, B_WORLDPRV2,"Mist", 10,115,140,19, &wrld->mode, 0, 0, 0, 0, "Toggles mist simulation"); uiBlockSetCol(block, TH_AUTO); uiBlockBeginAlign(block); @@ -2222,7 +2231,7 @@ static void world_panel_mistaph(World *wrld) uiBlockEndAlign(block); uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButBitS(block, TOG, WO_STARS, B_WORLDPRV2, "Stars",160,120,140,19, &wrld->mode, 0, 0, 0, 0, "Toggles starfield generation"); + uiDefButBitS(block, TOG, WO_STARS, B_WORLDPRV2, "Stars",160,115,140,19, &wrld->mode, 0, 0, 0, 0, "Toggles starfield generation"); uiBlockSetCol(block, TH_AUTO); uiBlockBeginAlign(block); diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 82edd4f218b..f3024197a8a 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -2499,6 +2499,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, if (occlusion) kxscene->SetDbvtOcclusionRes(blenderscene->world->occlusionRes); } + if (blenderscene->world) + kxscene->GetPhysicsEnvironment()->setNumTimeSubSteps(blenderscene->world->physubstep); // now that the scenegraph is complete, let's instantiate the deformers. // We need that to create reusable derived mesh and physic shapes diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 4107ed7d82e..983059d0c70 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -77,6 +77,8 @@ #include "RAS_FramingManager.h" #include "stdio.h" +#include "DNA_world_types.h" +#include "DNA_scene_types.h" // If define: little test for Nzc: guarded drawing. If the canvas is // not valid, skip rendering this frame. @@ -98,6 +100,7 @@ const char KX_KetsjiEngine::m_profileLabels[tc_numCategories][15] = { double KX_KetsjiEngine::m_ticrate = DEFAULT_LOGIC_TIC_RATE; int KX_KetsjiEngine::m_maxLogicFrame = 5; +int KX_KetsjiEngine::m_maxPhysicsFrame = 5; double KX_KetsjiEngine::m_anim_framerate = 25.0; double KX_KetsjiEngine::m_suspendedtime = 0.0; double KX_KetsjiEngine::m_suspendeddelta = 0.0; @@ -393,8 +396,20 @@ void KX_KetsjiEngine::StartEngine(bool clearIpo) m_firstframe = true; m_bInitialized = true; - m_ticrate = DEFAULT_LOGIC_TIC_RATE; - m_maxLogicFrame = 5; + // there is always one scene enabled at startup + World* world = m_scenes[0]->GetBlenderScene()->world; + if (world) + { + m_ticrate = world->ticrate; + m_maxLogicFrame = world->maxlogicstep; + m_maxPhysicsFrame = world->maxphystep; + } + else + { + m_ticrate = DEFAULT_LOGIC_TIC_RATE; + m_maxLogicFrame = 5; + m_maxPhysicsFrame = 5; + } if (m_game2ipo) { @@ -545,14 +560,13 @@ else // PIL_sleep_ms(1); KX_SceneList::iterator sceneit; - int frameOut = 5; - if (frames>frameOut) + if (frames>m_maxPhysicsFrame) { // printf("framedOut: %d\n",frames); - m_frameTime+=(frames-frameOut)*timestep; - frames = frameOut; + m_frameTime+=(frames-m_maxPhysicsFrame)*timestep; + frames = m_maxPhysicsFrame; } @@ -1736,6 +1750,16 @@ void KX_KetsjiEngine::SetMaxLogicFrame(int frame) m_maxLogicFrame = frame; } +int KX_KetsjiEngine::GetMaxPhysicsFrame() +{ + return m_maxPhysicsFrame; +} + +void KX_KetsjiEngine::SetMaxPhysicsFrame(int frame) +{ + m_maxPhysicsFrame = frame; +} + double KX_KetsjiEngine::GetAnimFrameRate() { return m_anim_framerate; diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index cc9b9198db7..5c14c63dd04 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -104,6 +104,7 @@ private: double m_remainingTime; static int m_maxLogicFrame; /* maximum number of consecutive logic frame */ + static int m_maxPhysicsFrame; /* maximum number of consecutive physics frame */ static double m_ticrate; static double m_anim_framerate; /* for animation playback only - ipo and action */ @@ -292,6 +293,14 @@ public: * Sets the maximum number of logic frame before render frame */ static void SetMaxLogicFrame(int frame); + /** + * Gets the maximum number of physics frame before render frame + */ + static int GetMaxPhysicsFrame(); + /** + * Sets the maximum number of physics frame before render frame + */ + static void SetMaxPhysicsFrame(int frame); /** * Gets the framerate for playing animations. (actions and ipos) diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index fb99eab7747..3626d7baa9a 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -308,6 +308,21 @@ static PyObject* gPyGetMaxLogicFrame(PyObject*) return PyInt_FromLong(KX_KetsjiEngine::GetMaxLogicFrame()); } +static PyObject* gPySetMaxPhysicsFrame(PyObject*, PyObject* args) +{ + int frame; + if (!PyArg_ParseTuple(args, "i:setMaxPhysicsFrame", &frame)) + return NULL; + + KX_KetsjiEngine::SetMaxPhysicsFrame(frame); + Py_RETURN_NONE; +} + +static PyObject* gPyGetMaxPhysicsFrame(PyObject*) +{ + return PyInt_FromLong(KX_KetsjiEngine::GetMaxPhysicsFrame()); +} + static PyObject* gPySetPhysicsTicRate(PyObject*, PyObject* args) { float ticrate; @@ -501,6 +516,8 @@ static struct PyMethodDef game_methods[] = { {"stopDSP",(PyCFunction) gPyStopDSP, METH_VARARGS, (PY_METHODCHAR)"stop using the audio dsp (for performance reasons)"}, {"getMaxLogicFrame", (PyCFunction) gPyGetMaxLogicFrame, METH_NOARGS, (PY_METHODCHAR)"Gets the max number of logic frame per render frame"}, {"setMaxLogicFrame", (PyCFunction) gPySetMaxLogicFrame, METH_VARARGS, (PY_METHODCHAR)"Sets the max number of logic frame per render frame"}, + {"getMaxPhysicsFrame", (PyCFunction) gPyGetMaxPhysicsFrame, METH_NOARGS, (PY_METHODCHAR)"Gets the max number of physics frame per render frame"}, + {"setMaxPhysicsFrame", (PyCFunction) gPySetMaxPhysicsFrame, METH_VARARGS, (PY_METHODCHAR)"Sets the max number of physics farme per render frame"}, {"getLogicTicRate", (PyCFunction) gPyGetLogicTicRate, METH_NOARGS, (PY_METHODCHAR)"Gets the logic tic rate"}, {"setLogicTicRate", (PyCFunction) gPySetLogicTicRate, METH_VARARGS, (PY_METHODCHAR)"Sets the logic tic rate"}, {"getPhysicsTicRate", (PyCFunction) gPyGetPhysicsTicRate, METH_NOARGS, (PY_METHODCHAR)"Gets the physics tic rate"}, diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 1bc406daf09..3ec30a63c58 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -387,6 +387,23 @@ def setMaxLogicFrame(maxlogic): @param maxlogic: The new maximum number of logic frame per render frame. Valid values: 1..5 @type maxlogic: integer """ +def getMaxPhysicsFrame(): + """ + Gets the maximum number of physics frame per render frame. + + @return: The maximum number of physics frame per render frame + @rtype: interger + """ +def setMaxPhysicsFrame(maxphysics): + """ + Sets the maximum number of physics timestep that are executed per render frame. + Higher value allows physics to keep up with realtime even if graphics slows down the game. + Physics timestep is fixed and equal to 1/tickrate (see setLogicTicRate) + maxphysics/ticrate is the maximum delay of the renderer that physics can compensate. + + @param maxphysics: The new maximum number of physics timestep per render frame. Valid values: 1..5. + @type maxphysics: integer + """ def getLogicTicRate(): """ Gets the logic update frequency. @@ -406,6 +423,7 @@ def setLogicTicRate(ticrate): """ def getPhysicsTicRate(): """ + NOT IMPLEMENTED Gets the physics update frequency @return: The physics update frequency in Hz @@ -413,6 +431,7 @@ def getPhysicsTicRate(): """ def setPhysicsTicRate(ticrate): """ + NOT IMPLEMENTED Sets the physics update frequency The physics update frequency is the number of times the physics system is executed every second. -- cgit v1.2.3 From 7f5acd68755cb36aa7f679ffbd41cc3c6d9cbf58 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 21 May 2009 19:38:49 +0000 Subject: BGE remove parent: unparented object keeps the linear and angular velocity it had while being parented. --- source/gameengine/Ketsji/KX_GameObject.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 0c191257f41..3740972ba29 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -312,6 +312,18 @@ void KX_GameObject::RemoveParent(KX_Scene *scene) rootobj->m_pPhysicsController1->RemoveCompoundChild(m_pPhysicsController1); } m_pPhysicsController1->RestoreDynamics(); + if (m_pPhysicsController1->IsDyna() && rootobj->m_pPhysicsController1) + { + // dynamic object should remember the velocity they had while being parented + MT_Point3 childPoint = GetSGNode()->GetWorldPosition(); + MT_Point3 rootPoint = rootobj->GetSGNode()->GetWorldPosition(); + MT_Point3 relPoint; + relPoint = (childPoint-rootPoint); + MT_Vector3 linVel = rootobj->m_pPhysicsController1->GetVelocity(relPoint); + MT_Vector3 angVel = rootobj->m_pPhysicsController1->GetAngularVelocity(); + m_pPhysicsController1->SetLinearVelocity(linVel, false); + m_pPhysicsController1->SetAngularVelocity(angVel, false); + } } // graphically, the object hasn't change place, no need to update m_pGraphicController } -- cgit v1.2.3 From 9b1ce6e55608e868a1fa1bc62710e053919c39de Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 22 May 2009 01:16:26 +0000 Subject: NLA SoC: Part 1 of NLA-Data Management API In this commit: * Added code for freeing NLA data now stored in AnimData * Started writing some utilities for adding NLA data, especially the 'push-down' concept for Actions * Cleanups of existing code - removal of obsolete NLA code from various places Next commits/parts: * File IO code for new-style NLA data * Version patching for old data to new data --- source/blender/blenkernel/BKE_nla.h | 33 ++- source/blender/blenkernel/intern/anim_sys.c | 7 + source/blender/blenkernel/intern/nla.c | 345 ++++++++++++++++++--------- source/blender/blenkernel/intern/object.c | 8 +- source/blender/editors/space_nla/space_nla.c | 1 + source/blender/makesdna/DNA_anim_types.h | 4 +- source/blender/makesdna/DNA_space_types.h | 2 +- 7 files changed, 270 insertions(+), 130 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 230096d7ea7..0f23a5cb44d 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -17,12 +17,12 @@ * 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. + * The Original Code is Copyright (C) 2009 Blender Foundation, Joshua Leung * All rights reserved. * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Joshua Leung (full recode) * * ***** END GPL LICENSE BLOCK ***** */ @@ -30,15 +30,26 @@ #ifndef BKE_NLA_H #define BKE_NLA_H -struct bActionStrip; -struct ListBase; -struct Object; +struct AnimData; +struct NlaStrip; +struct NlaTrack; + +/* ----------------------------- */ +/* Data Management */ + +void free_nlastrip(ListBase *strips, struct NlaStrip *strip); +void free_nlatrack(ListBase *tracks, struct NlaTrack *nlt); +void free_nladata(ListBase *tracks); + +struct NlaTrack *add_nlatrack(struct AnimData *adt); + +/* ----------------------------- */ +/* API */ + +struct NlaTrack *BKE_nlatrack_find_active(ListBase *tracks); +void BKE_nlatrack_set_active(ListBase *tracks, struct NlaTrack *nlt_a); + +void BKE_nla_action_pushdown(struct AnimData *adt); -void free_actionstrip (struct bActionStrip* strip); -void free_nlastrips (struct ListBase *nlalist); -void copy_nlastrips (struct ListBase *dst, struct ListBase *src); -void copy_actionstrip (struct bActionStrip **dst, struct bActionStrip **src); -void find_stridechannel(struct Object *ob, struct bActionStrip *strip); -struct bActionStrip *convert_action_to_strip (struct Object *ob); #endif diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 702da23ef47..b47d734ef4f 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -17,6 +17,7 @@ #include "BKE_animsys.h" #include "BKE_action.h" #include "BKE_fcurve.h" +#include "BKE_nla.h" #include "BKE_global.h" #include "BKE_main.h" #include "BKE_utildefines.h" @@ -118,6 +119,9 @@ void BKE_free_animdata (ID *id) if (adt->action) adt->action->id.us--; + /* free nla data */ + free_nladata(&adt->nla_tracks); + /* free drivers - stored as a list of F-Curves */ free_fcurves(&adt->drivers); @@ -982,6 +986,9 @@ static void nladata_flush_channels (ListBase *channels) case PROP_ENUM: RNA_property_enum_set(ptr, prop, (int)value); break; + default: + // can't do anything with other types of property.... + break; } } } diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index dc2bf26759f..ac767fe86cc 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -17,171 +17,296 @@ * 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. + * The Original Code is Copyright (C) 2009 Blender Foundation, Joshua Leung * All rights reserved. * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Joshua Leung (full recode) * * ***** END GPL LICENSE BLOCK ***** */ #include +#include +#include +#include +#include #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" -#include "DNA_space_types.h" -#include "DNA_nla_types.h" +#include "DNA_anim_types.h" #include "DNA_action_types.h" -#include "DNA_ID.h" -#include "DNA_ipo_types.h" -#include "DNA_object_types.h" -#include "BKE_nla.h" +#include "BKE_animsys.h" #include "BKE_action.h" +#include "BKE_fcurve.h" +#include "BKE_nla.h" #include "BKE_blender.h" #include "BKE_library.h" -#include "BKE_object.h" /* for convert_action_to_strip(ob) */ +#include "BKE_object.h" +#include "BKE_utildefines.h" #ifdef HAVE_CONFIG_H #include #endif -/* NOTE: in group.c the strips get copied for group-nla override, this assumes - that strips are one single block, without additional data to be copied */ -void copy_actionstrip (bActionStrip **dst, bActionStrip **src){ - bActionStrip *dstrip; - bActionStrip *sstrip = *src; +/* *************************************************** */ +/* Data Management */ - if (!*src){ - *dst=NULL; +/* Freeing ------------------------------------------- */ + +/* Remove the given NLA strip from the NLA track it occupies, free the strip's data, + * and the strip itself. + */ +// TODO: with things like transitions, should these get freed too? Maybe better as a UI tool +void free_nlastrip (ListBase *strips, NlaStrip *strip) +{ + FModifier *fcm, *fmn; + + /* sanity checks */ + if (strip == NULL) return; + + /* remove reference to action */ + if (strip->act) + strip->act->id.us--; + + /* free remapping info */ + //if (strip->remap) + // BKE_animremap_free(); + + /* free own F-Curves */ + free_fcurves(&strip->fcurves); + + /* free F-Modifiers */ + for (fcm= strip->modifiers.first; fcm; fcm= fmn) { + fmn= fcm->next; + + BLI_remlink(&strip->modifiers, fcm); + fcurve_remove_modifier(NULL, fcm); } + + /* free the strip itself */ + if (strips) + BLI_freelinkN(strips, strip); + else + MEM_freeN(strip); +} - *dst = MEM_dupallocN(sstrip); - - dstrip = *dst; - if (dstrip->act) - dstrip->act->id.us++; - - if (dstrip->ipo) - dstrip->ipo->id.us++; +/* Remove the given NLA track from the set of NLA tracks, free the track's data, + * and the track itself. + */ +void free_nlatrack (ListBase *tracks, NlaTrack *nlt) +{ + NlaStrip *strip, *stripn; - if (dstrip->modifiers.first) { - BLI_duplicatelist (&dstrip->modifiers, &sstrip->modifiers); + /* sanity checks */ + if (nlt == NULL) + return; + + /* free strips */ + for (strip= nlt->strips.first; strip; strip= stripn) { + stripn= strip->next; + free_nlastrip(&nlt->strips, strip); } + /* free NLA track itself now */ + if (tracks) + BLI_freelinkN(tracks, nlt); + else + MEM_freeN(nlt); } -void copy_nlastrips (ListBase *dst, ListBase *src) +/* Free the elements of type NLA Tracks provided in the given list, but do not free + * the list itself since that is not free-standing + */ +void free_nladata (ListBase *tracks) { - bActionStrip *strip; - - dst->first=dst->last=NULL; - - BLI_duplicatelist (dst, src); - - /* Update specific data */ - if (!dst->first) + NlaTrack *nlt, *nltn; + + /* sanity checks */ + if ELEM(NULL, tracks, tracks->first) return; - - for (strip = dst->first; strip; strip=strip->next){ - if (strip->act) - strip->act->id.us++; - if (strip->ipo) - strip->ipo->id.us++; - if (strip->modifiers.first) { - ListBase listb; - BLI_duplicatelist (&listb, &strip->modifiers); - strip->modifiers= listb; - } + + /* free tracks one by one */ + for (nlt= tracks->first; nlt; nlt= nltn) { + nltn= nlt->next; + free_nlatrack(tracks, nlt); } + + /* clear the list's pointers to be safe */ + tracks->first= tracks->last= NULL; } -/* from editnla, for convert_action_to_strip -- no UI code so should be ok here.. */ -void find_stridechannel(Object *ob, bActionStrip *strip) +/* Copying ------------------------------------------- */ + +// TODO... + +/* Adding ------------------------------------------- */ + +/* Add a NLA Strip referencing the given Action, to the given NLA Track */ +// TODO: any extra parameters to control how this is done? +NlaStrip *add_nlastrip (NlaTrack *nlt, bAction *act) { - if(ob && ob->pose) { - bPoseChannel *pchan; - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) - if(pchan->flag & POSE_STRIDE) - break; - if(pchan) - BLI_strncpy(strip->stridechannel, pchan->name, 32); - else - strip->stridechannel[0]= 0; - } + NlaStrip *strip; + + /* sanity checks */ + if ELEM(NULL, nlt, act) + return NULL; + + /* allocate new strip */ + strip= MEM_callocN(sizeof(NlaStrip), "NlaStrip"); + BLI_addtail(&nlt->strips, strip); + + /* generic settings + * - selected flag to highlight this to the user + * - auto-blends to ensure that blend in/out values are automatically + * determined by overlaps of strips + * - (XXX) synchronisation of strip-length in accordance with changes to action-length + * is not done though, since this should only really happens in editmode for strips now + * though this decision is still subject to further review... + */ + strip->flag = NLASTRIP_FLAG_SELECT|NLASTRIP_FLAG_AUTO_BLENDS; + + /* assign the action reference */ + strip->act= act; + id_us_plus(&act->id); + + /* determine initial range + * - strip length cannot be 0... ever... + */ + calc_action_range(strip->act, &strip->actstart, &strip->actend, 1); + + strip->start = strip->actstart; + strip->end = (IS_EQ(strip->actstart, strip->actend)) ? (strip->actstart + 1.0f): (strip->actend); + + /* strip should be referenced as-is */ + strip->scale= 1.0f; + strip->repeat = 1.0f; + + /* return the new strip */ + return strip; } -//called by convert_nla / bpy api with an object with the action to be converted to a new strip -bActionStrip *convert_action_to_strip (Object *ob) +/* Add a NLA Track to the given AnimData */ +NlaTrack *add_nlatrack (AnimData *adt) { - bActionStrip *nstrip; - - /* Make new actionstrip */ - nstrip = MEM_callocN(sizeof(bActionStrip), "bActionStrip"); - - /* Link the action to the nstrip */ - nstrip->act = ob->action; - id_us_plus(&nstrip->act->id); - calc_action_range(nstrip->act, &nstrip->actstart, &nstrip->actend, 1); - nstrip->start = nstrip->actstart; - nstrip->end = nstrip->actend; - nstrip->flag = ACTSTRIP_SELECT|ACTSTRIP_LOCK_ACTION; - - find_stridechannel(ob, nstrip); - //set_active_strip(ob, nstrip); /* is in editnla as does UI calls */ - - nstrip->repeat = 1.0; - - if(ob->nlastrips.first == NULL) - ob->nlaflag |= OB_NLA_OVERRIDE; - - BLI_addtail(&ob->nlastrips, nstrip); - return nstrip; /* is created, malloced etc. here so is safe to just return the pointer? - this is needed for setting this active in UI, and probably useful for API too */ + NlaTrack *nlt; + + /* sanity checks */ + if (adt == NULL) + return NULL; + + /* allocate new track */ + nlt= MEM_callocN(sizeof(NlaTrack), "NlaTrack"); + + /* set settings requiring the track to not be part of the stack yet */ + nlt->flag = NLATRACK_SELECTED; + nlt->index= BLI_countlist(&adt->nla_tracks); + + /* add track to stack, and make it the active one */ + BLI_addtail(&adt->nla_tracks, nlt); + BKE_nlatrack_set_active(&adt->nla_tracks, nlt); + + /* must have unique name, but we need to seed this */ + sprintf(nlt->name, "NlaTrack"); + BLI_uniquename(&adt->nla_tracks, nlt, "NlaTrack", '.', offsetof(NlaTrack, name), 64); + /* return the new track */ + return nlt; } +/* *************************************************** */ +/* Basic Utilities */ -/* not strip itself! */ -void free_actionstrip(bActionStrip* strip) -{ - if (!strip) - return; +/* States ------------------------------------------- */ - if (strip->act){ - strip->act->id.us--; - strip->act = NULL; - } - if (strip->ipo){ - strip->ipo->id.us--; - strip->ipo = NULL; - } - if (strip->modifiers.first) { - BLI_freelistN(&strip->modifiers); +/* Find the active NLA-track for the given stack */ +NlaTrack *BKE_nlatrack_find_active (ListBase *tracks) +{ + NlaTrack *nlt; + + /* sanity check */ + if ELEM(NULL, tracks, tracks->first) + return NULL; + + /* try to find the first active track */ + for (nlt= tracks->first; nlt; nlt= nlt->next) { + if (nlt->flag & NLATRACK_ACTIVE) + return nlt; } + /* none found */ + return NULL; } -void free_nlastrips (ListBase *nlalist) +/* Make the given NLA-track the active one for the given stack. If no track is provided, + * this function can be used to simply deactivate all the NLA tracks in the given stack too. + */ +void BKE_nlatrack_set_active (ListBase *tracks, NlaTrack *nlt_a) { - bActionStrip *strip; - - if (!nlalist->first) + NlaTrack *nlt; + + /* sanity check */ + if ELEM(NULL, tracks, tracks->first) return; + + /* deactive all the rest */ + for (nlt= tracks->first; nlt; nlt= nlt->next) + nlt->flag &= ~NLATRACK_ACTIVE; + + /* set the given one as the active one */ + if (nlt_a) + nlt_a->flag |= NLATRACK_ACTIVE; +} - /* Do any specific freeing */ - for (strip=nlalist->first; strip; strip=strip->next) - { - free_actionstrip (strip); - }; +/* Tools ------------------------------------------- */ - /* Free the whole list */ - BLI_freelistN(nlalist); +/* For the given AnimData block, add the active action to the NLA + * stack (i.e. 'push-down' action). The UI should only allow this + * for normal editing only (i.e. not in editmode for some strip's action), + * so no checks for this are performed. + */ +// TODO: maybe we should have checks for this too... +void BKE_nla_action_pushdown (AnimData *adt) +{ + NlaTrack *nlt; + NlaStrip *strip; + + /* sanity checks */ + // TODO: need to report the error for this + if ELEM(NULL, adt, adt->action) + return; + + /* if the action is empty, we also shouldn't try to add to stack, + * as that will cause us grief down the track + */ + // TODO: code a method for this, and report errors after... + + /* add a new NLA track to house this action + * - we could investigate trying to fit the action into an appropriately + * sized gap in the existing tracks, however, this may result in unexpected + * changes in blending behaviour... + */ + nlt= add_nlatrack(adt); + if (nlt == NULL) + return; + + /* add a new NLA strip to the track, which references the active action */ + strip= add_nlastrip(nlt, adt->action); + + /* clear reference to action now that we've pushed it onto the stack */ + if (strip) { + adt->action->id.us--; + adt->action= NULL; + } + + // TODO: set any other flags necessary here... } + +/* *************************************************** */ diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index b913651d856..b0902784687 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1193,18 +1193,12 @@ Object *copy_object(Object *ob) armature_rebuild_pose(obn, obn->data); } copy_defgroups(&obn->defbase, &ob->defbase); -#if 0 // XXX old animation system - copy_nlastrips(&obn->nlastrips, &ob->nlastrips); -#endif // XXX old animation system copy_constraints(&obn->constraints, &ob->constraints); /* increase user numbers */ id_us_plus((ID *)obn->data); -#if 0 // XXX old animation system - id_us_plus((ID *)obn->ipo); - id_us_plus((ID *)obn->action); -#endif // XXX old animation system id_us_plus((ID *)obn->dup_group); + // FIXME: add this for animdata too... for(a=0; atotcol; a++) id_us_plus((ID *)obn->mat[a]); diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 6e1a97dea34..188315c73fb 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -29,6 +29,7 @@ #include #include +#include "DNA_anim_types.h" #include "DNA_nla_types.h" #include "DNA_object_types.h" #include "DNA_space_types.h" diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index c0cdc1ab589..b20ec7ba37f 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -395,7 +395,7 @@ typedef struct AnimMapper { typedef struct NlaStrip { struct NlaStrip *next, *prev; - bAction *act; /* Action that is referenced by this strip */ + bAction *act; /* Action that is referenced by this strip (strip is 'user' of the action) */ AnimMapper *remap; /* Remapping info this strip (for tweaking correspondance of action with context) */ ListBase fcurves; /* F-Curves for controlling this strip's influence and timing */ // TODO: move out? @@ -458,6 +458,8 @@ enum { /* NLA strip is muted (i.e. doesn't contribute in any way) */ // TODO: this overlaps a lot with the functionality in track NLASTRIP_FLAG_MUTED = (1<<12), + /* NLA strip length is synced to the length of the referenced action */ + NLASTRIP_FLAG_SYNC_LENGTH = (1<<13), } eNlaStrip_Flag; /* NLA Strip Type */ diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 0e19a6845da..0a4fe1c5814 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -244,7 +244,7 @@ typedef struct SpaceNla { short blockhandler[8]; - short menunr, lock; + int filterflag; /* filtering flags (similar to the ones used for Keyframe Editors) */ short autosnap; /* this uses the same settings as autosnap for Action Editor */ short flag; -- cgit v1.2.3 From e191618cb5906ad50c7b6a75f52ad54cc6a812f7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 22 May 2009 03:22:56 +0000 Subject: - Deprecated Mathutils.CrossVecs(v1,v2) for v1.cross(v2), (same with .DotVecs -> v1.dot(v2), for CrossQuats and DotQuats too) - Grouped Mathutils deprecated functions - Dont include source code in bpy epydocs --- source/blender/python/api2_2x/Mathutils.h | 8 ++-- source/blender/python/api2_2x/doc/Mathutils.py | 44 +++++++++++++++++++++ source/blender/python/api2_2x/doc/epy_docgen.sh | 2 +- source/blender/python/api2_2x/quat.c | 38 ++++++++++++++++++ source/blender/python/api2_2x/quat.h | 2 + source/blender/python/api2_2x/vector.c | 52 +++++++++++++++++++++++-- source/blender/python/api2_2x/vector.h | 4 +- 7 files changed, 140 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Mathutils.h b/source/blender/python/api2_2x/Mathutils.h index b511f2046a6..789470d43c6 100644 --- a/source/blender/python/api2_2x/Mathutils.h +++ b/source/blender/python/api2_2x/Mathutils.h @@ -45,8 +45,6 @@ PyObject *quat_rotation(PyObject *arg1, PyObject *arg2); PyObject *M_Mathutils_Rand(PyObject * self, PyObject * args); PyObject *M_Mathutils_Vector(PyObject * self, PyObject * args); -PyObject *M_Mathutils_CrossVecs(PyObject * self, PyObject * args); -PyObject *M_Mathutils_DotVecs(PyObject * self, PyObject * args); PyObject *M_Mathutils_AngleBetweenVecs(PyObject * self, PyObject * args); PyObject *M_Mathutils_MidpointVecs(PyObject * self, PyObject * args); PyObject *M_Mathutils_ProjectVecs(PyObject * self, PyObject * args); @@ -57,8 +55,6 @@ PyObject *M_Mathutils_ScaleMatrix(PyObject * self, PyObject * args); PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * args); PyObject *M_Mathutils_ShearMatrix(PyObject * self, PyObject * args); PyObject *M_Mathutils_Quaternion(PyObject * self, PyObject * args); -PyObject *M_Mathutils_CrossQuats(PyObject * self, PyObject * args); -PyObject *M_Mathutils_DotQuats(PyObject * self, PyObject * args); PyObject *M_Mathutils_DifferenceQuats(PyObject * self, PyObject * args); PyObject *M_Mathutils_Slerp(PyObject * self, PyObject * args); PyObject *M_Mathutils_Euler(PyObject * self, PyObject * args); @@ -75,6 +71,10 @@ PyObject *M_Mathutils_CopyEuler(PyObject * self, PyObject * args); PyObject *M_Mathutils_RotateEuler(PyObject * self, PyObject * args); PyObject *M_Mathutils_MatMultVec(PyObject * self, PyObject * args); PyObject *M_Mathutils_VecMultMat(PyObject * self, PyObject * args); +PyObject *M_Mathutils_CrossVecs(PyObject * self, PyObject * args); +PyObject *M_Mathutils_DotVecs(PyObject * self, PyObject * args); +PyObject *M_Mathutils_CrossQuats(PyObject * self, PyObject * args); +PyObject *M_Mathutils_DotQuats(PyObject * self, PyObject * args); int EXPP_FloatsAreEqual(float A, float B, int floatSteps); int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps); diff --git a/source/blender/python/api2_2x/doc/Mathutils.py b/source/blender/python/api2_2x/doc/Mathutils.py index 52cd5fbcc7f..73a2ce46c4f 100644 --- a/source/blender/python/api2_2x/doc/Mathutils.py +++ b/source/blender/python/api2_2x/doc/Mathutils.py @@ -26,6 +26,8 @@ Example:: angle = DifferenceQuats(quat1, quat2) print angle + +@group Deprecated: CopyMat, CopyVec, CopyQuat, CopyEuler, RotateEuler, MatMultVec, VecMultMat, CrossVecs, DotVecs, CrossQuats, DotQuats """ def Rand (low=0.0, high = 1.0): @@ -129,6 +131,7 @@ def CopyVec(vector): def CrossVecs(vec1, vec2): """ Return the cross product of two vectors. + @attention: B{DEPRECATED} use vector.cross(other) instead. @type vec1: Vector object. @param vec1: A 3d vector. @type vec2: Vector object. @@ -141,6 +144,7 @@ def CrossVecs(vec1, vec2): def DotVecs(vec1, vec2): """ Return the dot product of two vectors. + @attention: B{DEPRECATED} use vector.dot(other) instead. @type vec1: Vector object. @param vec1: A 2d,3d or 4d vector. @type vec2: Vector object. @@ -323,6 +327,7 @@ def CopyQuat(quaternion): def CrossQuats(quat1, quat2): """ Return the cross product of two quaternions. + @attention: B{DEPRECATED} use quat.cross(other) instead. @type quat1: Quaternion object. @param quat1: Quaternion. @type quat2: Quaternion object. @@ -335,6 +340,7 @@ def CrossQuats(quat1, quat2): def DotQuats(quat1, quat2): """ Return the dot product of two quaternions. + @attention: B{DEPRECATED} use quat.dot(other) instead. @type quat1: Quaternion object. @param quat1: Quaternion. @type quat2: Quaternion object. @@ -541,6 +547,26 @@ class Vector: @return: The reflected vector. """ + def cross(other): + """ + Return the cross product of this vector and another. + @note: both vectors must be 3D. + @type other: Vector object + @param other: The other vector to perform the cross product with. + @rtype: Vector + @return: The cross product. + """ + + def dot(other): + """ + Return the dot product of this vector and another. + @note: both vectors must be the same size. + @type other: Vector object + @param other: The other vector to perform the dot product with. + @rtype: float + @return: The dot product. + """ + class Euler: """ The Euler object @@ -740,6 +766,24 @@ class Quaternion: @return: A 3x3 rotation matrix representation of the quaternion. """ + def cross(other): + """ + Return the cross product of this quaternion and another. + @type other: Quaterion object + @param other: The other quaternion to perform the cross product with. + @rtype: Vector + @return: The cross product. + """ + + def dot(other): + """ + Return the dot product of this quaternion and another. + @type other: Quaterion object + @param other: The other quaternion to perform the dot product with. + @rtype: float + @return: The dot product. + """ + class Matrix: """ The Matrix Object diff --git a/source/blender/python/api2_2x/doc/epy_docgen.sh b/source/blender/python/api2_2x/doc/epy_docgen.sh index 0e5350e41ae..3c903e849af 100755 --- a/source/blender/python/api2_2x/doc/epy_docgen.sh +++ b/source/blender/python/api2_2x/doc/epy_docgen.sh @@ -8,4 +8,4 @@ LC_ALL=POSIX epydoc --debug -v -o BPY_API --url "http://www.blender.org" --top API_intro \ - --name "Blender" --no-private --no-frames [A-Z]*.py + --name "Blender" --no-private --no-sourcecode [A-Z]*.py diff --git a/source/blender/python/api2_2x/quat.c b/source/blender/python/api2_2x/quat.c index 14fd5f9ba4c..585b76a34dc 100644 --- a/source/blender/python/api2_2x/quat.c +++ b/source/blender/python/api2_2x/quat.c @@ -41,6 +41,8 @@ char Quaternion_Inverse_doc[] = "() - set the quaternion to it's inverse"; char Quaternion_Normalize_doc[] = "() - normalize the vector portion of the quaternion"; char Quaternion_ToEuler_doc[] = "(eul_compat) - return a euler rotation representing the quaternion, optional euler argument that the new euler will be made compatible with."; char Quaternion_ToMatrix_doc[] = "() - return a rotation matrix representing the quaternion"; +char Quaternion_Cross_doc[] = "(other) - return the cross product between this quaternion and another"; +char Quaternion_Dot_doc[] = "(other) - return the dot product between this quaternion and another"; char Quaternion_copy_doc[] = "() - return a copy of the quat"; //-----------------------METHOD DEFINITIONS ---------------------- struct PyMethodDef Quaternion_methods[] = { @@ -51,6 +53,8 @@ struct PyMethodDef Quaternion_methods[] = { {"normalize", (PyCFunction) Quaternion_Normalize, METH_NOARGS, Quaternion_Normalize_doc}, {"toEuler", (PyCFunction) Quaternion_ToEuler, METH_VARARGS, Quaternion_ToEuler_doc}, {"toMatrix", (PyCFunction) Quaternion_ToMatrix, METH_NOARGS, Quaternion_ToMatrix_doc}, + {"cross", (PyCFunction) Quaternion_Cross, METH_O, Quaternion_Cross_doc}, + {"dot", (PyCFunction) Quaternion_Dot, METH_O, Quaternion_Dot_doc}, {"__copy__", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc}, {"copy", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc}, {NULL, NULL, 0, NULL} @@ -96,6 +100,40 @@ PyObject *Quaternion_ToMatrix(QuaternionObject * self) return newMatrixObject(mat, 3, 3, Py_NEW); } + +//----------------------------Quaternion.cross(other)------------------ +//return the cross quat +PyObject *Quaternion_Cross(QuaternionObject * self, QuaternionObject * value) +{ + float quat[4]; + + if (!QuaternionObject_Check(value)) { + PyErr_SetString( PyExc_TypeError, "quat.cross(value): expected a quaternion argument" ); + return NULL; + } + + QuatMul(quat, self->quat, value->quat); + return newQuaternionObject(quat, Py_NEW); +} + +//----------------------------Quaternion.dot(other)------------------ +//return the dot quat +PyObject *Quaternion_Dot(QuaternionObject * self, QuaternionObject * value) +{ + int x; + double dot = 0.0; + + if (!QuaternionObject_Check(value)) { + PyErr_SetString( PyExc_TypeError, "quat.dot(value): expected a quaternion argument" ); + return NULL; + } + + for(x = 0; x < 4; x++) { + dot += self->quat[x] * value->quat[x]; + } + return PyFloat_FromDouble(dot); +} + //----------------------------Quaternion.normalize()---------------- //normalize the axis of rotation of [theta,vector] PyObject *Quaternion_Normalize(QuaternionObject * self) diff --git a/source/blender/python/api2_2x/quat.h b/source/blender/python/api2_2x/quat.h index 9f3a919bce0..84a013d9788 100644 --- a/source/blender/python/api2_2x/quat.h +++ b/source/blender/python/api2_2x/quat.h @@ -64,6 +64,8 @@ PyObject *Quaternion_Inverse( QuaternionObject * self ); PyObject *Quaternion_Normalize( QuaternionObject * self ); PyObject *Quaternion_ToEuler( QuaternionObject * self, PyObject *args ); PyObject *Quaternion_ToMatrix( QuaternionObject * self ); +PyObject *Quaternion_Cross( QuaternionObject * self, QuaternionObject * value ); +PyObject *Quaternion_Dot( QuaternionObject * self, QuaternionObject * value ); PyObject *Quaternion_copy( QuaternionObject * self ); PyObject *newQuaternionObject( float *quat, int type ); diff --git a/source/blender/python/api2_2x/vector.c b/source/blender/python/api2_2x/vector.c index f4504a13f72..cb206363dbf 100644 --- a/source/blender/python/api2_2x/vector.c +++ b/source/blender/python/api2_2x/vector.c @@ -47,7 +47,9 @@ char Vector_Resize2D_doc[] = "() - resize a vector to [x,y]"; char Vector_Resize3D_doc[] = "() - resize a vector to [x,y,z]"; char Vector_Resize4D_doc[] = "() - resize a vector to [x,y,z,w]"; char Vector_ToTrackQuat_doc[] = "(track, up) - extract a quaternion from the vector and the track and up axis"; -char Vector_reflect_doc[] = "(mirror) - return a vector reflected on the mirror normal"; +char Vector_Reflect_doc[] = "(mirror) - return a vector reflected on the mirror normal"; +char Vector_Cross_doc[] = "(other) - return the cross product between this vector and another"; +char Vector_Dot_doc[] = "(other) - return the dot product between this vector and another"; char Vector_copy_doc[] = "() - return a copy of the vector"; char Vector_swizzle_doc[] = "Swizzle: Get or set axes in specified order"; /*-----------------------METHOD DEFINITIONS ----------------------*/ @@ -59,7 +61,9 @@ struct PyMethodDef Vector_methods[] = { {"resize3D", (PyCFunction) Vector_Resize3D, METH_NOARGS, Vector_Resize2D_doc}, {"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, Vector_Resize2D_doc}, {"toTrackQuat", ( PyCFunction ) Vector_ToTrackQuat, METH_VARARGS, Vector_ToTrackQuat_doc}, - {"reflect", ( PyCFunction ) Vector_reflect, METH_O, Vector_reflect_doc}, + {"reflect", ( PyCFunction ) Vector_Reflect, METH_O, Vector_Reflect_doc}, + {"cross", ( PyCFunction ) Vector_Cross, METH_O, Vector_Dot_doc}, + {"dot", ( PyCFunction ) Vector_Dot, METH_O, Vector_Cross_doc}, {"copy", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc}, {"__copy__", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc}, {NULL, NULL, 0, NULL} @@ -275,7 +279,7 @@ PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) return a reflected vector on the mirror normal ((2 * DotVecs(vec, mirror)) * mirror) - vec using arithb.c would be nice here */ -PyObject *Vector_reflect( VectorObject * self, PyObject * value ) +PyObject *Vector_Reflect( VectorObject * self, PyObject * value ) { VectorObject *mirrvec; float mirror[3]; @@ -288,7 +292,7 @@ PyObject *Vector_reflect( VectorObject * self, PyObject * value ) float norm = 0.0f; if (!VectorObject_Check(value)) { - PyErr_SetString( PyExc_TypeError, "expected a vector argument" ); + PyErr_SetString( PyExc_TypeError, "vec.reflect(value): expected a vector argument" ); return NULL; } mirrvec = (VectorObject *)value; @@ -322,6 +326,46 @@ PyObject *Vector_reflect( VectorObject * self, PyObject * value ) return newVectorObject(reflect, self->size, Py_NEW); } +PyObject *Vector_Cross( VectorObject * self, VectorObject * value ) +{ + VectorObject *vecCross = NULL; + + if (!VectorObject_Check(value)) { + PyErr_SetString( PyExc_TypeError, "vec.cross(value): expected a vector argument" ); + return NULL; + } + + if(self->size != 3 || value->size != 3) { + PyErr_SetString(PyExc_AttributeError, "vec.cross(value): expects both vectors to be 3D\n"); + return NULL; + } + + vecCross = (VectorObject *)newVectorObject(NULL, 3, Py_NEW); + Crossf(vecCross->vec, self->vec, value->vec); + return (PyObject *)vecCross; +} + +PyObject *Vector_Dot( VectorObject * self, VectorObject * value ) +{ + double dot = 0.0; + int x; + + if (!VectorObject_Check(value)) { + PyErr_SetString( PyExc_TypeError, "vec.cross(value): expected a vector argument" ); + return NULL; + } + + if(self->size != value->size) { + PyErr_SetString(PyExc_AttributeError, "vec.dot(value): expects both vectors to have the same size\n"); + return NULL; + } + + for(x = 0; x < self->size; x++) { + dot += self->vec[x] * value->vec[x]; + } + return PyFloat_FromDouble(dot); +} + /*----------------------------Vector.copy() -------------------------------------- return a copy of the vector */ PyObject *Vector_copy(VectorObject * self) diff --git a/source/blender/python/api2_2x/vector.h b/source/blender/python/api2_2x/vector.h index 9ec2eff8047..94827935ebb 100644 --- a/source/blender/python/api2_2x/vector.h +++ b/source/blender/python/api2_2x/vector.h @@ -51,7 +51,9 @@ PyObject *Vector_Resize2D( VectorObject * self ); PyObject *Vector_Resize3D( VectorObject * self ); PyObject *Vector_Resize4D( VectorObject * self ); PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ); -PyObject *Vector_reflect( VectorObject * self, PyObject * value ); +PyObject *Vector_Reflect( VectorObject * self, PyObject * value ); +PyObject *Vector_Cross( VectorObject * self, VectorObject * value ); +PyObject *Vector_Dot( VectorObject * self, VectorObject * value ); PyObject *Vector_copy( VectorObject * self ); PyObject *newVectorObject(float *vec, int size, int type); -- cgit v1.2.3 From ec60c74f081b006a6e8aebefe930a37aac95b865 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 22 May 2009 06:12:18 +0000 Subject: Fix for: energy IPO not supported in glsl mode (reported in the forum). in fact I redid part of the last "fix", making it working properly now. Before we were changing Lamp->la . This is the Blender Lamp, we shouldn't touch it. So this part of the code is correct now. Things that could be tackled: - color attribute is returning negative values when NEGATIVE is toggled - objects with no material (default gray one) still don't support lamp spots (not spot lamp but the spot of the lamps) --- source/blender/gpu/intern/gpu_material.c | 14 ++++++-------- source/gameengine/Ketsji/KX_Light.cpp | 7 ------- source/gameengine/Ketsji/KX_Light.h | 1 - 3 files changed, 6 insertions(+), 16 deletions(-) (limited to 'source') diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 93604e76527..818b67170c7 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1308,14 +1308,12 @@ void GPU_lamp_update(GPULamp *lamp, int lay, float obmat[][4]) void GPU_lamp_update_colors(GPULamp *lamp, float r, float g, float b, float energy) { - lamp->la->energy = energy; - lamp->la->r = fabs(r); - lamp->la->g = fabs(g); - lamp->la->b = fabs(b); - - lamp->col[0]= lamp->la->r*lamp->energy; - lamp->col[1]= lamp->la->g*lamp->energy; - lamp->col[2]= lamp->la->b*lamp->energy; + lamp->energy = energy; + if(lamp->mode & LA_NEG) lamp->energy= -lamp->energy; + + lamp->col[0]= r* lamp->energy; + lamp->col[1]= g* lamp->energy; + lamp->col[2]= b* lamp->energy; } static void gpu_lamp_from_blender(Scene *scene, Object *ob, Object *par, Lamp *la, GPULamp *lamp) diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index 1496f34c5f2..fe575384a35 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -61,11 +61,6 @@ KX_LightObject::KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks, m_rendertools->AddLight(&m_lightobj); m_glsl = glsl; m_blenderscene = ((KX_Scene*)sgReplicationInfo)->GetBlenderScene(); - - m_initialvalues[0] = lightobj.m_red; - m_initialvalues[1] = lightobj.m_green; - m_initialvalues[2] = lightobj.m_blue; - m_initialvalues[3] = lightobj.m_energy; }; @@ -76,8 +71,6 @@ KX_LightObject::~KX_LightObject() if((lamp = GetGPULamp())) { float obmat[4][4] = {{0}}; GPU_lamp_update(lamp, 0, obmat); - GPU_lamp_update_colors(lamp, m_initialvalues[0], m_initialvalues[1], - m_initialvalues[2], m_initialvalues[3]); } m_rendertools->RemoveLight(&m_lightobj); diff --git a/source/gameengine/Ketsji/KX_Light.h b/source/gameengine/Ketsji/KX_Light.h index 690231ff090..35f25515e3b 100644 --- a/source/gameengine/Ketsji/KX_Light.h +++ b/source/gameengine/Ketsji/KX_Light.h @@ -44,7 +44,6 @@ class KX_LightObject : public KX_GameObject Py_Header; protected: RAS_LightObject m_lightobj; - float m_initialvalues [4]; class RAS_IRenderTools* m_rendertools; //needed for registering and replication of lightobj bool m_glsl; Scene* m_blenderscene; -- cgit v1.2.3 From 66ed4325f488d408f4a9179decced37bd1d816ad Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 22 May 2009 09:48:05 +0000 Subject: the debug option for BGE scripts only reloaded modules but not packages submodules. Now reload all the submodules too. It was also hiding the error message if there was a syntax error which wasnt so helpful. --- source/gameengine/GameLogic/SCA_PythonController.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index d58259457e6..8140dbd53db 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -324,10 +324,7 @@ bool SCA_PythonController::Import() } PyObject *mod = PyImport_ImportModule((char *)py_function_path[0].Ptr()); - if(mod && m_debug) { - Py_DECREF(mod); /* getting a new one so dont hold a ref to the old one */ - mod= PyImport_ReloadModule(mod); - } + /* Dont reload yet, do this within the loop so packages reload too */ if(mod==NULL) { ErrorPrint("Python module not found"); @@ -339,18 +336,29 @@ bool SCA_PythonController::Import() PyObject *base= mod; for(unsigned int i=1; i < py_function_path.size(); i++) { + if(m_debug) { + Py_DECREF(base); /* getting a new one so dont hold a ref to the old one */ + base= PyImport_ReloadModule(base); + if (base==NULL) { + m_function= NULL; + break; + } + } + m_function = PyObject_GetAttrString(base, py_function_path[i].Ptr()); Py_DECREF(base); base = m_function; /* for the next loop if there is on */ if(m_function==NULL) { - PyErr_Clear(); /* print our own error below */ break; } } if(m_function==NULL) { - printf("Python module error \"%s\":\n \"%s\" module found but function missing\n", GetName().Ptr(), m_scriptText.Ptr()); + if(PyErr_Occurred()) + ErrorPrint("Python controller found the module but could not access the function"); + else + printf("Python module error \"%s\":\n \"%s\" module found but function missing\n", GetName().Ptr(), m_scriptText.Ptr()); return false; } -- cgit v1.2.3 From 3b7f63a0884c6ec9db5abb938708f4191ea35274 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 22 May 2009 11:19:35 +0000 Subject: NLA SoC: File IO for new NLA Datatypes --- source/blender/blenkernel/BKE_nla.h | 2 + source/blender/blenloader/intern/readfile.c | 149 +++++++++++++++++++-------- source/blender/blenloader/intern/writefile.c | 125 +++++++++++++--------- 3 files changed, 186 insertions(+), 90 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 0f23a5cb44d..3864d9da5f6 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -33,6 +33,7 @@ struct AnimData; struct NlaStrip; struct NlaTrack; +struct bAction; /* ----------------------------- */ /* Data Management */ @@ -41,6 +42,7 @@ void free_nlastrip(ListBase *strips, struct NlaStrip *strip); void free_nlatrack(ListBase *tracks, struct NlaTrack *nlt); void free_nladata(ListBase *tracks); +struct NlaStrip *add_nlastrip(struct NlaTrack *nlt, struct bAction *act); struct NlaTrack *add_nlatrack(struct AnimData *adt); /* ----------------------------- */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index fd9da2059e1..cfb8baa4c84 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1657,10 +1657,26 @@ static void lib_link_constraint_channels(FileData *fd, ID *id, ListBase *chanbas /* Data Linking ----------------------------- */ +static void lib_link_fmodifiers(FileData *fd, ID *id, ListBase *list) +{ + FModifier *fcm; + + for (fcm= list->first; fcm; fcm= fcm->next) { + /* data for specific modifiers */ + switch (fcm->type) { + case FMODIFIER_TYPE_PYTHON: + { + FMod_Python *data= (FMod_Python *)fcm->data; + data->script = newlibadr(fd, id->lib, data->script); + } + break; + } + } +} + static void lib_link_fcurves(FileData *fd, ID *id, ListBase *list) { FCurve *fcu; - FModifier *fcm; /* relink ID-block references... */ for (fcu= list->first; fcu; fcu= fcu->next) { @@ -1674,16 +1690,45 @@ static void lib_link_fcurves(FileData *fd, ID *id, ListBase *list) } /* modifiers */ - for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) { - /* data for specific modifiers */ - switch (fcm->type) { - case FMODIFIER_TYPE_PYTHON: - { - FMod_Python *data= (FMod_Python *)fcm->data; - data->script = newlibadr(fd, id->lib, data->script); - } - break; + lib_link_fmodifiers(fd, id, &fcu->modifiers); + } +} + + +/* NOTE: this assumes that link_list has already been called on the list */ +static void direct_link_fmodifiers(FileData *fd, ListBase *list) +{ + FModifier *fcm; + + for (fcm= list->first; fcm; fcm= fcm->next) { + /* relink general data */ + fcm->data = newdataadr(fd, fcm->data); + fcm->edata= NULL; + + /* do relinking of data for specific types */ + switch (fcm->type) { + case FMODIFIER_TYPE_GENERATOR: + { + FMod_Generator *data= (FMod_Generator *)fcm->data; + + data->coefficients= newdataadr(fd, data->coefficients); } + break; + case FMODIFIER_TYPE_ENVELOPE: + { + FMod_Envelope *data= (FMod_Envelope *)fcm->data; + + data->data= newdataadr(fd, data->data); + } + break; + case FMODIFIER_TYPE_PYTHON: + { + FMod_Python *data= (FMod_Python *)fcm->data; + + data->prop = newdataadr(fd, data->prop); + IDP_DirectLinkProperty(data->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); + } + break; } } } @@ -1692,7 +1737,6 @@ static void lib_link_fcurves(FileData *fd, ID *id, ListBase *list) static void direct_link_fcurves(FileData *fd, ListBase *list) { FCurve *fcu; - FModifier *fcm; /* link F-Curve data to F-Curve again (non ID-libs) */ for (fcu= list->first; fcu; fcu= fcu->next) { @@ -1720,37 +1764,7 @@ static void direct_link_fcurves(FileData *fd, ListBase *list) /* modifiers */ link_list(fd, &fcu->modifiers); - for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) { - /* relink general data */ - fcm->data = newdataadr(fd, fcm->data); - fcm->edata= NULL; - - /* do relinking of data for specific types */ - switch (fcm->type) { - case FMODIFIER_TYPE_GENERATOR: - { - FMod_Generator *data= (FMod_Generator *)fcm->data; - - data->coefficients= newdataadr(fd, data->coefficients); - } - break; - case FMODIFIER_TYPE_ENVELOPE: - { - FMod_Envelope *data= (FMod_Envelope *)fcm->data; - - data->data= newdataadr(fd, data->data); - } - break; - case FMODIFIER_TYPE_PYTHON: - { - FMod_Python *data= (FMod_Python *)fcm->data; - - data->prop = newdataadr(fd, data->prop); - IDP_DirectLinkProperty(data->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); - } - break; - } - } + direct_link_fmodifiers(fd, &fcu->modifiers); } } @@ -1802,6 +1816,44 @@ static void direct_link_action(FileData *fd, bAction *act) } } + +static void lib_link_nladata (FileData *fd, ID *id, ListBase *list) +{ + NlaTrack *nlt; + NlaStrip *strip; + + /* we only acare about the NLA strips inside the tracks */ + for (nlt= list->first; nlt; nlt= nlt->next) { + for (strip= nlt->strips.first; strip; strip= strip->next) { + /* reassign the counted-reference to action */ + strip->act = newlibadr_us(fd, id->lib, strip->act); + } + } +} + +/* NOTE: this assumes that link_list has already been called on the list */ +static void direct_link_nladata(FileData *fd, ListBase *list) +{ + NlaTrack *nlt; + NlaStrip *strip; + + for (nlt= list->first; nlt; nlt= nlt->next) { + /* relink list of strips */ + link_list(fd, &nlt->strips); + + /* relink strip data */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + /* strip's F-Curves */ + link_list(fd, &strip->fcurves); + direct_link_fcurves(fd, &strip->fcurves); + + /* strip's F-Modifiers */ + link_list(fd, &strip->modifiers); + direct_link_fcurves(fd, &strip->modifiers); + } + } +} + /* ------- */ static void lib_link_keyingsets(FileData *fd, ID *id, ListBase *list) @@ -1851,7 +1903,7 @@ static void lib_link_animdata(FileData *fd, ID *id, AnimData *adt) /* overrides don't have lib-link for now, so no need to do anything */ /* link NLA-data */ - // TODO... + lib_link_nladata(fd, id, &adt->nla_tracks); } static void direct_link_animdata(FileData *fd, AnimData *adt) @@ -1868,7 +1920,8 @@ static void direct_link_animdata(FileData *fd, AnimData *adt) // TODO... /* link NLA-data */ - // TODO... + link_list(fd, &adt->nla_tracks); + direct_link_nladata(fd, &adt->nla_tracks); } /* ************ READ NODE TREE *************** */ @@ -9302,6 +9355,8 @@ static void expand_keyingsets(FileData *fd, Main *mainvar, ListBase *list) static void expand_animdata(FileData *fd, Main *mainvar, AnimData *adt) { FCurve *fcd; + NlaTrack *nlt; + NlaStrip *strip; /* own action */ expand_doit(fd, mainvar, adt->action); @@ -9314,6 +9369,12 @@ static void expand_animdata(FileData *fd, Main *mainvar, AnimData *adt) for (dtar= driver->targets.first; dtar; dtar= dtar->next) expand_doit(fd, mainvar, dtar->id); } + + /* nla-data - referenced actions */ + for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { + for (strip= nlt->strips.first; strip; strip= strip->next) + expand_doit(fd, mainvar, strip->act); + } } static void expand_particlesettings(FileData *fd, Main *mainvar, ParticleSettings *part) diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index b690c708dc3..0375feffb31 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -760,10 +760,59 @@ static void write_actuators(WriteData *wd, ListBase *lb) } } +static void write_fmodifiers(WriteData *wd, ListBase *fmodifiers) +{ + FModifier *fcm; + + /* Modifiers */ + for (fcm= fmodifiers->first; fcm; fcm= fcm->next) { + FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); + + /* Write the specific data */ + if (fmi && fcm->data) { + /* firstly, just write the plain fmi->data struct */ + writestruct(wd, DATA, fmi->structName, 1, fcm->data); + + /* do any modifier specific stuff */ + switch (fcm->type) { + case FMODIFIER_TYPE_GENERATOR: + { + FMod_Generator *data= (FMod_Generator *)fcm->data; + + /* write coefficients array */ + if (data->coefficients) + writedata(wd, DATA, sizeof(float)*(data->arraysize), data->coefficients); + } + break; + case FMODIFIER_TYPE_ENVELOPE: + { + FMod_Envelope *data= (FMod_Envelope *)fcm->data; + + /* write envelope data */ + if (data->data) + writedata(wd, DATA, sizeof(FCM_EnvelopeData)*(data->totvert), data->data); + } + break; + case FMODIFIER_TYPE_PYTHON: + { + FMod_Python *data = (FMod_Python *)fcm->data; + + /* Write ID Properties -- and copy this comment EXACTLY for easy finding + of library blocks that implement this.*/ + IDP_WriteProperty(data->prop, wd); + } + break; + } + } + + /* Write the modifier */ + writestruct(wd, DATA, "FModifier", 1, fcm); + } +} + static void write_fcurves(WriteData *wd, ListBase *fcurves) { FCurve *fcu; - FModifier *fcm; for (fcu=fcurves->first; fcu; fcu=fcu->next) { /* F-Curve */ @@ -794,50 +843,8 @@ static void write_fcurves(WriteData *wd, ListBase *fcurves) } } - /* Modifiers */ - for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) { - FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); - - /* Write the specific data */ - if (fmi && fcm->data) { - /* firstly, just write the plain fmi->data struct */ - writestruct(wd, DATA, fmi->structName, 1, fcm->data); - - /* do any modifier specific stuff */ - switch (fcm->type) { - case FMODIFIER_TYPE_GENERATOR: - { - FMod_Generator *data= (FMod_Generator *)fcm->data; - - /* write coefficients array */ - if (data->coefficients) - writedata(wd, DATA, sizeof(float)*(data->arraysize), data->coefficients); - } - break; - case FMODIFIER_TYPE_ENVELOPE: - { - FMod_Envelope *data= (FMod_Envelope *)fcm->data; - - /* write envelope data */ - if (data->data) - writedata(wd, DATA, sizeof(FCM_EnvelopeData)*(data->totvert), data->data); - } - break; - case FMODIFIER_TYPE_PYTHON: - { - FMod_Python *data = (FMod_Python *)fcm->data; - - /* Write ID Properties -- and copy this comment EXACTLY for easy finding - of library blocks that implement this.*/ - IDP_WriteProperty(data->prop, wd); - } - break; - } - } - - /* Write the modifier */ - writestruct(wd, DATA, "FModifier", 1, fcm); - } + /* write F-Modifiers */ + write_fmodifiers(wd, &fcu->modifiers); } } @@ -888,6 +895,29 @@ static void write_keyingsets(WriteData *wd, ListBase *list) } } +static void write_nladata(WriteData *wd, ListBase *nlabase) +{ + NlaTrack *nlt; + NlaStrip *strip; + + /* write all the tracks */ + for (nlt= nlabase->first; nlt; nlt= nlt->next) { + /* write the track first */ + writestruct(wd, DATA, "NlaTrack", 1, nlt); + + for (strip= nlt->strips.first; strip; strip= strip->next) { + /* write the strip first */ + writestruct(wd, DATA, "NlaStrip", 1, strip); + + /* write the strip's F-Curves and modifiers */ + write_fcurves(wd, &strip->fcurves); + write_fmodifiers(wd, &strip->modifiers); + + // TODO write the remaps + } + } +} + static void write_animdata(WriteData *wd, AnimData *adt) { AnimOverride *aor; @@ -899,14 +929,17 @@ static void write_animdata(WriteData *wd, AnimData *adt) write_fcurves(wd, &adt->drivers); /* write overrides */ + // FIXME: are these needed? for (aor= adt->overrides.first; aor; aor= aor->next) { /* overrides consist of base data + rna_path */ writestruct(wd, DATA, "AnimOverride", 1, aor); writedata(wd, DATA, strlen(aor->rna_path)+1, aor->rna_path); } + // TODO write the remaps (if they are needed) + /* write NLA data */ - // XXX todo... + write_nladata(wd, &adt->nla_tracks); } static void write_constraints(WriteData *wd, ListBase *conlist) -- cgit v1.2.3 From 89049782dea9ce6ffc0a9de2cb95db4a448db05d Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Fri, 22 May 2009 17:01:32 +0000 Subject: Python API ---------- Fix incorrect exception message. --- source/blender/python/api2_2x/Text3d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Text3d.c b/source/blender/python/api2_2x/Text3d.c index 202195cdcb4..6312f7fffc7 100644 --- a/source/blender/python/api2_2x/Text3d.c +++ b/source/blender/python/api2_2x/Text3d.c @@ -1116,7 +1116,7 @@ static PyObject *Text3d_setFont( BPy_Text3d * self, PyObject * args ) VFont *vf; //, *vfont; if( !PyArg_ParseTuple( args, "|O!",&Font_Type, &pyobj) ) return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected a string" ); + "expected a font object" ); if( !pyobj ) { // pyobj= M_Text3d_LoadFont (self, Py_BuildValue("(s)", "")); self->curve->vfont= get_builtin_font (); -- cgit v1.2.3 From cfa2b4f0a5530e0cdda09d466fff267ad9e7eccc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 23 May 2009 03:19:47 +0000 Subject: [#18802] BGE conversion script: more attributes; updated GameTypes.py Patch from Alex Fraser (z0r) - All attributes in the conversion map have been checked against the docs. More ambiguities have been resolved. - Added option to convert all text buffers in Blender. - Updated GameTypes.py: there were inconsistencies. The script works well (causes no errors) with 0_FPS_Template.blend and vehicle_demo.blend from the physics-2.43-physics-testfiles pack. Caveats: - Conversions were checked against other deprecated attributes. I may have missed some cases where a deprecated attribute has the same name as a non-deprecated attribute. I did catch a few though. - As with the last version, the conversion is purely text-based and doesn't compile the code. It's easy to create a script that would break on conversion. Still, it should get you 90% of the way to a converted script. --- source/gameengine/PyDoc/GameTypes.py | 52 +++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 21 deletions(-) (limited to 'source') diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index 3f9b627247f..a7ad29d5cfa 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -2561,6 +2561,7 @@ class KX_NetworkMessageActuator(SCA_IActuator): @ivar usePropBody: Send a property instead of a regular body message. @type usePropBody: boolean """ +#{Deprecated def setToPropName(name): """ Messages will only be sent to objects with the given property name. @@ -2592,6 +2593,7 @@ class KX_NetworkMessageActuator(SCA_IActuator): @param body: if the body type is True, this is the name of the property to send. if the body type is False, this is the text to send. """ +#} class KX_NetworkMessageSensor(SCA_ISensor): """ @@ -2609,8 +2611,7 @@ class KX_NetworkMessageSensor(SCA_ISensor): @ivar bodies: The list of message bodies received. (Read-only) @type bodies: list of strings """ - - +#{ Deprecated def setSubjectFilterText(subject): """ Change the message subject text that this sensor is listening to. @@ -2648,6 +2649,7 @@ class KX_NetworkMessageSensor(SCA_ISensor): @deprecated: Use the L{subjects} attribute instead. @rtype: list """ +#} class KX_ObjectActuator(SCA_IActuator): """ @@ -3431,8 +3433,7 @@ class KX_RadarSensor(KX_NearSensor): KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z, KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z """ - - +#{Deprecated #--The following methods are deprecated, please use properties instead. def getConeOrigin(): """ @@ -3450,6 +3451,7 @@ class KX_RadarSensor(KX_NearSensor): @deprecated: Use the L{coneTarget} property. @rtype: list [x, y, z] """ +#} def getConeHeight(): """ @@ -3521,7 +3523,7 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): @type object: KX_GameObject or None @ivar objectLastCreated: the last added object from this actuator (read-only). @type objectLastCreated: KX_GameObject or None - @ivar time: the lifetime of added objects, in frames. + @ivar time: the lifetime of added objects, in frames. Set to 0 to disable automatic deletion. @type time: integer @ivar linearVelocity: the initial linear velocity of added objects. @type linearVelocity: list [vx, vy, vz] @@ -3535,6 +3537,7 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): C{ERROR: GameObject I{OBName} has a AddObjectActuator I{ActuatorName} without object (in 'nonactive' layer)} """ +#{Deprecated def setObject(object): """ Sets the game object to add. @@ -3622,6 +3625,7 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): @rtype: L{KX_GameObject} @return: A L{KX_GameObject} or None if no object has been created. """ +#} def instantAddObject(): """ Returns the last object created by this actuator. The object can then be accessed from L{objectLastCreated}. @@ -3920,32 +3924,31 @@ class KX_SoundActuator(SCA_IActuator): the actuator to be activated - they act instantly provided that the actuator has been activated once at least. - @ivar fileName: Sets the filename of the sound this actuator plays. + @ivar fileName: The filename of the sound this actuator plays. @type fileName: string - @ivar volume: Sets the volume (gain) of the sound. + @ivar volume: The volume (gain) of the sound. @type volume: float - @ivar pitch: Sets the pitch of the sound. + @ivar pitch: The pitch of the sound. @type pitch: float - @ivar rollOffFactor: Sets the roll off factor. Rolloff defines the rate of attenuation as the sound gets further away. + @ivar rollOffFactor: The roll off factor. Rolloff defines the rate of attenuation as the sound gets further away. @type rollOffFactor: float - @ivar looping: Sets the loop mode of the actuator. + @ivar looping: The loop mode of the actuator. @type looping: integer - @ivar position: Sets the position of the sound. + @ivar position: The position of the sound as a list: [x, y, z]. @type position: float array - @ivar velocity: Sets the speed of the sound; The speed of the sound alter the pitch. + @ivar velocity: The velocity of the emitter as a list: [x, y, z]. The relative velocity to the observer determines the pitch. List of 3 floats: [x, y, z]. @type velocity: float array - @ivar orientation: Sets the orientation of the sound. When setting the orientation you can - also use quaternion [float,float,float,float] or euler angles [float,float,float] + @ivar orientation: The orientation of the sound. When setting the orientation you can also use quaternion [float,float,float,float] or euler angles [float,float,float] @type orientation: 3x3 matrix [[float]] - @ivar mode: Sets the operation mode of the actuator. You can use one of the following constant: + @ivar mode: The operation mode of the actuator. You can use one of the following constants: - KX_SOUNDACT_PLAYSTOP (1) - KX_SOUNDACT_PLAYEND (2) - KX_SOUNDACT_LOOPSTOP (3) @@ -4057,7 +4060,7 @@ class KX_SoundActuator(SCA_IActuator): """ Sets the position this sound will come from. - @deprecated: Use the L{localPosition} attribute instead. + @deprecated: Use the L{position} attribute instead. @type x: float @param x: The x coordinate of the sound. @type y: float @@ -4605,6 +4608,7 @@ class SCA_ActuatorSensor(SCA_ISensor): @ivar actuator: the name of the actuator that the sensor is monitoring. @type actuator: string """ +#{Deprecated def getActuator(): """ Return the Actuator with which the sensor operates. @@ -4621,6 +4625,7 @@ class SCA_ActuatorSensor(SCA_ISensor): @param name: actuator name @type name: string """ +#} class SCA_AlwaysSensor(SCA_ISensor): """ @@ -4649,6 +4654,7 @@ class SCA_DelaySensor(SCA_ISensor): @ivar repeat: 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once. @type repeat: integer """ +#{Deprecated def setDelay(delay): """ Set the initial delay before the positive trigger. @@ -4695,6 +4701,7 @@ class SCA_DelaySensor(SCA_ISensor): @deprecated: Use the L{repeat} attribute instead. @rtype: KX_TRUE or KX_FALSE """ +#} class SCA_JoystickSensor(SCA_ISensor): """ @@ -4748,6 +4755,7 @@ class SCA_JoystickSensor(SCA_ISensor): @type buttonIndex: integer @rtype: bool """ +#{Deprecated def getIndex(): """ Returns the joystick index to use (from 1 to 8). @@ -4786,7 +4794,7 @@ class SCA_JoystickSensor(SCA_ISensor): """ Returns the state of the joysticks axis. See differs to L{getAxis()} returning the current state of the joystick. - @deprecated: Use the L{axisSingle} attribute instead. + @deprecated: Use the L{axisValues} attribute instead. @rtype: list @return: 4 values, each spesifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing. @@ -4876,6 +4884,7 @@ class SCA_JoystickSensor(SCA_ISensor): @deprecated: Use the L{connected} attribute instead. @rtype: bool """ +#} class SCA_KeyboardSensor(SCA_ISensor): """ @@ -4917,7 +4926,7 @@ class SCA_KeyboardSensor(SCA_ISensor): @param keycode: The code that represents the key you want to get the state of """ - #--The following methods are DEPRECATED-- +#{Deprecated def getKey(): """ Returns the key code this sensor is looking for. @@ -4981,6 +4990,7 @@ class SCA_KeyboardSensor(SCA_ISensor): @deprecated: Use the L{events} attribute instead. @rtype: list of key status. [[keycode, status]] """ +#} class SCA_NANDController(SCA_IController): """ @@ -5023,7 +5033,7 @@ class SCA_PropertyActuator(SCA_IActuator): If there is no property of this name, the call is ignored. - @deprecated: Use the L{property} attribute instead. + @deprecated: Use the L{propName} attribute instead. @type prop: string @param prop: The name of the property to set. """ @@ -5031,7 +5041,7 @@ class SCA_PropertyActuator(SCA_IActuator): """ Returns the name of the property on which to operate. - @deprecated: Use the L{property} attribute instead. + @deprecated: Use the L{propName} attribute instead. @rtype: string """ def setValue(value): @@ -5132,7 +5142,7 @@ class SCA_PythonController(SCA_IController): Properties: @ivar script: the Python script this controller executes - @type script: string, read-only + @type script: string @group Deprecated: getScript, setScript """ -- cgit v1.2.3 From 3820e4f3db2ca23f7eeed7c3121cc41b0e12db25 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 23 May 2009 04:56:37 +0000 Subject: BGE PyController module reloading didnt check that the base of the function was a module (could be a class). --- source/gameengine/GameLogic/SCA_PythonController.cpp | 2 +- source/gameengine/Ketsji/KX_Scene.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 8140dbd53db..52f6bece132 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -336,7 +336,7 @@ bool SCA_PythonController::Import() PyObject *base= mod; for(unsigned int i=1; i < py_function_path.size(); i++) { - if(m_debug) { + if(m_debug && PyModule_Check(base)) { /* base could be a class */ Py_DECREF(base); /* getting a new one so dont hold a ref to the old one */ base= PyImport_ReloadModule(base); if (base==NULL) { diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index bb5e0875402..2c74c88dc14 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1452,7 +1452,7 @@ void KX_Scene::LogicEndFrame() { m_logicmgr->EndFrame(); int numobj = m_euthanasyobjects->GetCount(); - int i; + KX_GameObject* obj; while ((numobj = m_euthanasyobjects->GetCount()) > 0) -- cgit v1.2.3 From 443df708e22e772965c098a93842083dc20cfbac Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sat, 23 May 2009 07:37:02 +0000 Subject: == Sequencer == This fixes: [#18373] WAV with IPO CURVE: Clicking in playback by adding linear interpolation between frames. (Old IPOs were only calculated once per frame which will lead to clicking on steep curves) --- source/blender/src/seqaudio.c | 92 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 75 insertions(+), 17 deletions(-) (limited to 'source') diff --git a/source/blender/src/seqaudio.c b/source/blender/src/seqaudio.c index 078750ca118..92264605380 100644 --- a/source/blender/src/seqaudio.c +++ b/source/blender/src/seqaudio.c @@ -101,6 +101,9 @@ static Scene * audio_scene = 0; /* we can't use G.scene, since called while we have G.scene changed!) */ +#define AFRA2TIME(a) ((((double) audio_scene->r.frs_sec_base) * (a)) / audio_scene->r.frs_sec) +#define ATIME2FRA(a) ((((double) audio_scene->r.frs_sec) * (a)) / audio_scene->r.frs_sec_base) + ///// // /* local protos ------------------- */ @@ -235,23 +238,27 @@ void audiostream_fill(uint8_t *mixdown, int len) } -static void audio_levels(uint8_t *buf, int len, float db, float facf, float pan) +static void audio_levels(uint8_t *buf, int len, float db, + float facf_start, float facf_end, float pan) { int i; + double m = (facf_end - facf_start) / len; float facl, facr, fac; signed short *sample; if (pan>=0) { facr = 1.0; facl = 1.0-pan; } else { facr = pan+1.0; facl = 1.0; } - fac = pow(10.0, ((-(db+audio_scene->audio.main))/20.0)) / facf; - facl /= fac; - facr /= fac; - + fac = pow(10.0, ((-(db+audio_scene->audio.main))/20.0)); + for (i=0; istart) + + ((double) + seq->anim_startofs)) + * ((float)audio_scene + ->audio.mixrate) + * 4 )); +} + +static int curpos2fra(Sequence * seq, int curpos) +{ + return ((int) floor( + ATIME2FRA( + ((double) curpos) / 4 + /audio_scene->audio.mixrate))) + - seq->anim_startofs + seq->start; +} + +static void do_audio_seq_ipo(Sequence * seq, int len, float * facf_start, + float * facf_end) +{ + int cfra_start = curpos2fra(seq, seq->curpos); + int cfra_end = cfra_start + 1; + int ipo_curpos_start = fra2curpos(seq, curpos2fra(seq, seq->curpos)); + int ipo_curpos_end = fra2curpos(seq, cfra_end); + double ipo_facf_start; + double ipo_facf_end; + double m; + + do_seq_ipo(seq, cfra_start); + ipo_facf_start = seq->facf0; + + do_seq_ipo(seq, cfra_end); + ipo_facf_end = seq->facf0; + + m = (ipo_facf_end- ipo_facf_start)/(ipo_curpos_end - ipo_curpos_start); + + *facf_start = ipo_facf_start + (seq->curpos - ipo_curpos_start) * m; + *facf_end = ipo_facf_start + (seq->curpos + len-ipo_curpos_start) * m; +} + +#endif + #ifndef DISABLE_SDL static void audio_fill_ram_sound(Sequence *seq, void * mixdown, uint8_t * sstream, int len, @@ -305,7 +359,8 @@ static void audio_fill_ram_sound(Sequence *seq, void * mixdown, { uint8_t* cvtbuf; bSound* sound; - float facf; + float facf_start; + float facf_end; sound = seq->sound; audio_makestream(sound); @@ -313,14 +368,15 @@ static void audio_fill_ram_sound(Sequence *seq, void * mixdown, (seq->startdisp <= cfra) && ((seq->enddisp) > cfra)) { if(seq->ipo && seq->ipo->curve.first) { - do_seq_ipo(seq, cfra); - facf = seq->facf0; + do_audio_seq_ipo(seq, len, &facf_start, &facf_end); } else { - facf = 1.0; + facf_start = 1.0; + facf_end = 1.0; } cvtbuf = malloc(len); memcpy(cvtbuf, ((uint8_t*)sound->stream)+(seq->curpos & (~3)), len); - audio_levels(cvtbuf, len, seq->level, facf, seq->pan); + audio_levels(cvtbuf, len, seq->level, facf_start, facf_end, + seq->pan); if (!mixdown) { SDL_MixAudio(sstream, cvtbuf, len, SDL_MIX_MAXVOLUME); } else { @@ -338,16 +394,17 @@ static void audio_fill_hd_sound(Sequence *seq, int len, int cfra) { uint8_t* cvtbuf; - float facf; + float facf_start; + float facf_end; if ((seq->curpos >= 0) && (seq->startdisp <= cfra) && ((seq->enddisp) > cfra)) { if(seq->ipo && seq->ipo->curve.first) { - do_seq_ipo(seq, cfra); - facf = seq->facf0; + do_audio_seq_ipo(seq, len, &facf_start, &facf_end); } else { - facf = 1.0; + facf_start = 1.0; + facf_end = 1.0; } cvtbuf = malloc(len); @@ -356,7 +413,8 @@ static void audio_fill_hd_sound(Sequence *seq, audio_scene->audio.mixrate, 2, len / 4); - audio_levels(cvtbuf, len, seq->level, facf, seq->pan); + audio_levels(cvtbuf, len, seq->level, facf_start, facf_end, + seq->pan); if (!mixdown) { SDL_MixAudio(sstream, cvtbuf, len, SDL_MIX_MAXVOLUME); -- cgit v1.2.3 From d141aff097d17c106071f2ad966fdd97a1fb5ba4 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 23 May 2009 09:36:18 +0000 Subject: NLA SoC: Adding more backend code/utilities * Data copying * Strip sorting --- source/blender/blenkernel/BKE_action.h | 3 + source/blender/blenkernel/BKE_nla.h | 9 +- source/blender/blenkernel/intern/action.c | 17 +++- source/blender/blenkernel/intern/anim_sys.c | 2 +- source/blender/blenkernel/intern/nla.c | 148 +++++++++++++++++++++++++++- 5 files changed, 173 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h index 67eb2ed58bf..cc10a4071a6 100644 --- a/source/blender/blenkernel/BKE_action.h +++ b/source/blender/blenkernel/BKE_action.h @@ -68,6 +68,9 @@ void make_local_action(struct bAction *act); /* Some kind of bounding box operation on the action */ void calc_action_range(const struct bAction *act, float *start, float *end, int incl_hidden); +/* Does action have any motion data at all? */ +short action_has_motion(const struct bAction *act); + /* Action Groups API ----------------- */ /* Make the given Action Group the active one */ diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 3864d9da5f6..49796250633 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -42,6 +42,10 @@ void free_nlastrip(ListBase *strips, struct NlaStrip *strip); void free_nlatrack(ListBase *tracks, struct NlaTrack *nlt); void free_nladata(ListBase *tracks); +struct NlaStrip *copy_nlastrip(struct NlaStrip *strip); +struct NlaTrack *copy_nlatrack(struct NlaTrack *nlt); +void copy_nladata(ListBase *dst, ListBase *src); + struct NlaStrip *add_nlastrip(struct NlaTrack *nlt, struct bAction *act); struct NlaTrack *add_nlatrack(struct AnimData *adt); @@ -49,7 +53,10 @@ struct NlaTrack *add_nlatrack(struct AnimData *adt); /* API */ struct NlaTrack *BKE_nlatrack_find_active(ListBase *tracks); -void BKE_nlatrack_set_active(ListBase *tracks, struct NlaTrack *nlt_a); +void BKE_nlatrack_set_active(ListBase *tracks, struct NlaTrack *nlt); + +short BKE_nlatrack_has_space(struct NlaTrack *nlt, float start, float end); +void BKE_nlatrack_sort_strips(struct NlaTrack *nlt); void BKE_nla_action_pushdown(struct AnimData *adt); diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index f2e3583c87b..bb458cc7e25 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -740,7 +740,22 @@ float get_action_frame_inv(Object *ob, float cframe) } - +/* Check if the given action has any keyframes */ +short action_has_motion(const bAction *act) +{ + FCurve *fcu; + + /* return on the first F-Curve that has some keyframes/samples defined */ + if (act) { + for (fcu= act->curves.first; fcu; fcu= fcu->next) { + if (fcu->totvert) + return 1; + } + } + + /* nothing found */ + return 0; +} /* Calculate the extents of given action */ void calc_action_range(const bAction *act, float *start, float *end, int incl_hidden) diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index b47d734ef4f..f21fed416cc 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -153,7 +153,7 @@ AnimData *BKE_copy_animdata (AnimData *adt) dadt->action= copy_action(adt->action); /* duplicate NLA data */ - // XXX todo... + copy_nladata(&dadt->nla_tracks, &adt->nla_tracks); /* duplicate drivers (F-Curves) */ copy_fcurves(&dadt->drivers, &adt->drivers); diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index ac767fe86cc..d062a2ab14b 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -145,7 +145,73 @@ void free_nladata (ListBase *tracks) /* Copying ------------------------------------------- */ -// TODO... +/* Copy NLA strip */ +NlaStrip *copy_nlastrip (NlaStrip *strip) +{ + NlaStrip *strip_d; + + /* sanity check */ + if (strip == NULL) + return NULL; + + /* make a copy */ + strip_d= MEM_dupallocN(strip); + strip_d->next= strip_d->prev= NULL; + + /* increase user-count of action */ + if (strip_d->act) + strip_d->act->id.us++; + + /* copy F-Curves and modifiers */ + copy_fcurves(&strip_d->fcurves, &strip->fcurves); + fcurve_copy_modifiers(&strip_d->modifiers, &strip->modifiers); + + /* return the strip */ + return strip_d; +} + +/* Copy NLA Track */ +NlaTrack *copy_nlatrack (NlaTrack *nlt) +{ + NlaStrip *strip, *strip_d; + NlaTrack *nlt_d; + + /* sanity check */ + if (nlt == NULL) + return NULL; + + /* make a copy */ + nlt_d= MEM_dupallocN(nlt); + nlt_d->next= nlt_d->prev= NULL; + + /* make a copy of all the strips, one at a time */ + nlt_d->strips.first= nlt_d->strips.last= NULL; + + for (strip= nlt->strips.first; strip; strip= strip->next) { + strip_d= copy_nlastrip(strip); + BLI_addtail(&nlt_d->strips, strip_d); + } + + /* return the copy */ + return nlt_d; +} + +/* Copy all NLA data */ +void copy_nladata (ListBase *dst, ListBase *src) +{ + NlaTrack *nlt, *nlt_d; + + /* sanity checks */ + if ELEM(NULL, dst, src) + return; + + /* copy each NLA-track, one at a time */ + for (nlt= src->first; nlt; nlt= nlt->next) { + /* make a copy, and add the copy to the destination list */ + nlt_d= copy_nlatrack(nlt); + BLI_addtail(dst, nlt_d); + } +} /* Adding ------------------------------------------- */ @@ -224,7 +290,7 @@ NlaTrack *add_nlatrack (AnimData *adt) /* *************************************************** */ /* Basic Utilities */ -/* States ------------------------------------------- */ +/* NLA-Tracks ---------------------------------------- */ /* Find the active NLA-track for the given stack */ NlaTrack *BKE_nlatrack_find_active (ListBase *tracks) @@ -265,6 +331,80 @@ void BKE_nlatrack_set_active (ListBase *tracks, NlaTrack *nlt_a) nlt_a->flag |= NLATRACK_ACTIVE; } +/* Check if there is any space in the last track to add the given strip */ +short BKE_nlatrack_has_space (NlaTrack *nlt, float start, float end) +{ + NlaStrip *strip; + + /* sanity checks */ + if ((nlt == NULL) || IS_EQ(start, end)) + return 0; + if (start > end) { + puts("BKE_nlatrack_has_space error... start and end arguments swapped"); + SWAP(float, start, end); + } + + /* loop over NLA strips checking for any overlaps with this area... */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + /* if start frame of strip is past the target end-frame, that means that + * we've gone past the window we need to check for, so things are fine + */ + if (strip->start > end) + return 1; + + /* if the end of the strip is greater than either of the boundaries, the range + * must fall within the extents of the strip + */ + if ((strip->end > start) || (strip->end > end)) + return 0; + } + + /* if we are still here, we haven't encountered any overlapping strips */ + return 1; +} + +/* Rearrange the strips in the track so that they are always in order + * (usually only needed after a strip has been moved) + */ +void BKE_nlatrack_sort_strips (NlaTrack *nlt) +{ + ListBase tmp = {NULL, NULL}; + NlaStrip *strip, *sstrip; + + /* sanity checks */ + if ELEM(NULL, nlt, nlt->strips.first) + return; + + /* we simply perform insertion sort on this list, since it is assumed that per track, + * there are only likely to be at most 5-10 strips + */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + short not_added = 1; + + /* remove this strip from the list, and add it to the new list, searching from the end of + * the list, assuming that the lists are in order + */ + BLI_remlink(&nlt->strips, strip); + + for (sstrip= tmp.last; not_added && sstrip; sstrip= sstrip->prev) { + /* check if add after */ + if (sstrip->end < strip->start) { + BLI_insertlinkafter(&tmp, sstrip, strip); + not_added= 0; + break; + } + } + + /* add before first? */ + if (not_added) + BLI_addhead(&tmp, strip); + } + + /* reassign the start and end points of the strips */ + nlt->strips.first= tmp.first; + nlt->strips.last= tmp.last; +} + /* Tools ------------------------------------------- */ /* For the given AnimData block, add the active action to the NLA @@ -286,7 +426,9 @@ void BKE_nla_action_pushdown (AnimData *adt) /* if the action is empty, we also shouldn't try to add to stack, * as that will cause us grief down the track */ - // TODO: code a method for this, and report errors after... + // TODO: what about modifiers? + if (action_has_motion(adt->action) == 0) + return; /* add a new NLA track to house this action * - we could investigate trying to fit the action into an appropriately -- cgit v1.2.3 From 6d8d7cd768f292a7fbbcecaf5f1cbc3090973f12 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sat, 23 May 2009 14:40:36 +0000 Subject: BGE: Random sensor will produce true random sequence of events when seed is set to 0 in the GUI (the actual seed value is stored in the sensor seed attribute). Positive values will use fixed pseudo random sequence. --- source/gameengine/Converter/KX_ConvertSensors.cpp | 5 +++++ source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 5 +++++ source/gameengine/Ketsji/KX_KetsjiEngine.h | 1 + 3 files changed, 11 insertions(+) (limited to 'source') diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp index 07b0abae6df..37631a0523d 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.cpp +++ b/source/gameengine/Converter/KX_ConvertSensors.cpp @@ -682,6 +682,11 @@ void BL_ConvertSensors(struct Object* blenderobject, if (eventmgr) { int randomSeed = blenderrndsensor->seed; + if (randomSeed == 0) + { + randomSeed = (int)(kxengine->GetRealTime()*100000.0); + randomSeed ^= (intptr_t)blenderrndsensor; + } gamesensor = new SCA_RandomSensor(eventmgr, gameobj, randomSeed); } } diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 983059d0c70..347634b4599 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -1770,6 +1770,11 @@ double KX_KetsjiEngine::GetClockTime(void) const return m_clockTime; } +double KX_KetsjiEngine::GetRealTime(void) const +{ + return m_kxsystem->GetTimeInSeconds(); +} + void KX_KetsjiEngine::SetAnimFrameRate(double framerate) { m_anim_framerate = framerate; diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index 5c14c63dd04..6fa379e551a 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -271,6 +271,7 @@ public: */ double GetClockTime(void) const; + double GetRealTime(void) const; /** * Returns the difference between the local time of the scene (when it * was running and not suspended) and the "curtime" -- cgit v1.2.3 From 5441323dca30c169d1ecb726d26e8cb4c5f4994d Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sat, 23 May 2009 14:46:43 +0000 Subject: BGE: fix memleaks. SCA_RandomActuator: The random generator was shared between replicas and not deleted. Added ref counting between replicas to allow deletion at the end. KX_Camera: The scenegraph node was not deleted for temporary cameras (ImageMirror and shadow), causing 500 bytes leak per frame and per shadow light. KX_GameActuator: Global dictionary buffer was not deleted after saving. KX_MotionState: The motion state for compound child was not deleted KX_ReplaceMeshActuator: The mesh was unnecessarily converted for each actuator and not deleted, causing large memleak. After these fix, YoFrankie runs without memleak. --- .../gameengine/Converter/BL_BlenderDataConversion.cpp | 12 +++++------- .../gameengine/Converter/KX_BlenderSceneConverter.cpp | 6 +++--- source/gameengine/Converter/KX_BlenderSceneConverter.h | 2 +- .../gameengine/GameLogic/SCA_RandomNumberGenerator.cpp | 1 + source/gameengine/GameLogic/SCA_RandomNumberGenerator.h | 13 +++++++++++++ source/gameengine/GameLogic/SCA_RandomSensor.cpp | 10 +++++++--- source/gameengine/GameLogic/SCA_RandomSensor.h | 1 + source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 8 ++++---- source/gameengine/Ketsji/KX_BlenderMaterial.h | 4 ++-- source/gameengine/Ketsji/KX_Camera.cpp | 17 ++++++++++++++++- source/gameengine/Ketsji/KX_Camera.h | 8 +++++++- source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 2 ++ source/gameengine/Ketsji/KX_GameActuator.cpp | 2 ++ source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 2 +- source/gameengine/Ketsji/KX_PolygonMaterial.cpp | 2 +- source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp | 14 +++++++------- source/gameengine/Rasterizer/RAS_IPolygonMaterial.h | 6 +++--- source/gameengine/Rasterizer/RAS_MeshObject.cpp | 10 +++++----- source/gameengine/Rasterizer/RAS_MeshObject.h | 4 ++-- source/gameengine/VideoTexture/ImageRender.cpp | 4 ++-- 20 files changed, 85 insertions(+), 43 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index f3024197a8a..06a4da4fce0 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -729,6 +729,8 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* bool skinMesh = false; int lightlayer = blenderobj->lay; + if ((meshobj = converter->FindGameMesh(mesh/*, ob->lay*/)) != NULL) + return meshobj; // Get DerivedMesh data DerivedMesh *dm = CDDM_from_mesh(mesh, blenderobj); @@ -1043,7 +1045,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* // pre calculate texture generation for(list::iterator mit = meshobj->GetFirstMaterial(); mit != meshobj->GetLastMaterial(); ++ mit) { - mit->m_bucket->GetPolyMaterial()->OnConstruction(); + mit->m_bucket->GetPolyMaterial()->OnConstruction(lightlayer); } if (layers) @@ -1057,6 +1059,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools* delete kx_blmat; if (kx_polymat) delete kx_polymat; + converter->RegisterGameMesh(meshobj, mesh); return meshobj; } @@ -1712,14 +1715,9 @@ static KX_GameObject *gameobject_from_blenderobject( case OB_MESH: { Mesh* mesh = static_cast(ob->data); - RAS_MeshObject* meshobj = converter->FindGameMesh(mesh, ob->lay); float center[3], extents[3]; float radius = my_boundbox_mesh((Mesh*) ob->data, center, extents); - - if (!meshobj) { - meshobj = BL_ConvertMesh(mesh,ob,rendertools,kxscene,converter); - converter->RegisterGameMesh(meshobj, mesh); - } + RAS_MeshObject* meshobj = BL_ConvertMesh(mesh,ob,rendertools,kxscene,converter); // needed for python scripting kxscene->GetLogicManager()->RegisterMeshName(meshobj->GetName(),meshobj); diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index c9ac7a23625..646e569a27e 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -550,12 +550,12 @@ void KX_BlenderSceneConverter::RegisterGameMesh( RAS_MeshObject *KX_BlenderSceneConverter::FindGameMesh( - struct Mesh *for_blendermesh, - unsigned int onlayer) + struct Mesh *for_blendermesh/*, + unsigned int onlayer*/) { RAS_MeshObject** meshp = m_map_mesh_to_gamemesh[CHashedPtr(for_blendermesh)]; - if (meshp && onlayer==(*meshp)->GetLightLayer()) { + if (meshp/* && onlayer==(*meshp)->GetLightLayer()*/) { return *meshp; } else { return NULL; diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h index 2317e952a0a..f7c1a506457 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.h +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h @@ -115,7 +115,7 @@ public: struct Object *FindBlenderObject(KX_GameObject *for_gameobject); void RegisterGameMesh(RAS_MeshObject *gamemesh, struct Mesh *for_blendermesh); - RAS_MeshObject *FindGameMesh(struct Mesh *for_blendermesh, unsigned int onlayer); + RAS_MeshObject *FindGameMesh(struct Mesh *for_blendermesh/*, unsigned int onlayer*/); // void RegisterSumoShape(DT_ShapeHandle shape, RAS_MeshObject *for_gamemesh); // DT_ShapeHandle FindSumoShape(RAS_MeshObject *for_gamemesh); diff --git a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp index 06b5cca6ce9..0267cc8ebbf 100644 --- a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp @@ -59,6 +59,7 @@ SCA_RandomNumberGenerator::SCA_RandomNumberGenerator(long seed) { // int mti = N + 1; /*unused*/ m_seed = seed; + m_refcount = 1; SetStartVector(); } diff --git a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h index b9311d31af6..842a0331752 100644 --- a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h +++ b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h @@ -36,6 +36,9 @@ class SCA_RandomNumberGenerator { + /* reference counted for memleak */ + int m_refcount; + /** base seed */ long m_seed; @@ -56,6 +59,16 @@ class SCA_RandomNumberGenerator { float DrawFloat(); long GetSeed(); void SetSeed(long newseed); + SCA_RandomNumberGenerator* AddRef() + { + ++m_refcount; + return this; + } + void Release() + { + if (--m_refcount == 0) + delete this; + } }; #endif /* __KX_RANDOMNUMBERGENERATOR */ diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 3c04173d10e..d5cbeef01ae 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -50,7 +50,6 @@ SCA_RandomSensor::SCA_RandomSensor(SCA_EventManager* eventmgr, PyTypeObject* T) : SCA_ISensor(gameobj,eventmgr, T) { - // m_basegenerator is never deleted => memory leak m_basegenerator = new SCA_RandomNumberGenerator(startseed); Init(); } @@ -59,7 +58,7 @@ SCA_RandomSensor::SCA_RandomSensor(SCA_EventManager* eventmgr, SCA_RandomSensor::~SCA_RandomSensor() { - /* Nothing to be done here. */ + m_basegenerator->Release(); } void SCA_RandomSensor::Init() @@ -74,13 +73,18 @@ void SCA_RandomSensor::Init() CValue* SCA_RandomSensor::GetReplica() { CValue* replica = new SCA_RandomSensor(*this); - // replication copies m_basegenerator pointer => share same generator // this will copy properties and so on... replica->ProcessReplica(); return replica; } +void SCA_RandomSensor::ProcessReplica() +{ + SCA_ISensor::ProcessReplica(); + // increment reference count so that we can release the generator at this end + m_basegenerator->AddRef(); +} bool SCA_RandomSensor::IsPositiveTrigger() diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.h b/source/gameengine/GameLogic/SCA_RandomSensor.h index 27b41841f0b..b2bf2440966 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.h +++ b/source/gameengine/GameLogic/SCA_RandomSensor.h @@ -52,6 +52,7 @@ public: PyTypeObject* T=&Type); virtual ~SCA_RandomSensor(); virtual CValue* GetReplica(); + virtual void ProcessReplica(); virtual bool Evaluate(); virtual bool IsPositiveTrigger(); virtual void Init(); diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 3b8917efe90..f1543d752f1 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -158,14 +158,14 @@ void KX_BlenderMaterial::ReleaseMaterial() mBlenderShader->ReloadMaterial(); } -void KX_BlenderMaterial::OnConstruction() +void KX_BlenderMaterial::OnConstruction(int layer) { if (mConstructed) // when material are reused between objects return; if(mMaterial->glslmat) - SetBlenderGLSLShader(); + SetBlenderGLSLShader(layer); // for each unique material... int i; @@ -902,10 +902,10 @@ KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()") } -void KX_BlenderMaterial::SetBlenderGLSLShader(void) +void KX_BlenderMaterial::SetBlenderGLSLShader(int layer) { if(!mBlenderShader) - mBlenderShader = new BL_BlenderShader(mScene, mMaterial->material, m_lightlayer); + mBlenderShader = new BL_BlenderShader(mScene, mMaterial->material, layer); if(!mBlenderShader->Ok()) { delete mBlenderShader; diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index 52019ed2248..b29f2df98db 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -97,7 +97,7 @@ public: // -------------------------------- // pre calculate to avoid pops/lag at startup - virtual void OnConstruction( ); + virtual void OnConstruction(int layer); static void EndFrame(); @@ -112,7 +112,7 @@ private: bool mModified; bool mConstructed; // if false, don't clean on exit - void SetBlenderGLSLShader(); + void SetBlenderGLSLShader(int layer); void ActivatGLMaterials( RAS_IRasterizer* rasty )const; void ActivateTexGen( RAS_IRasterizer *ras ) const; diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 4bef4936813..144ff4ac883 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -42,6 +42,7 @@ KX_Camera::KX_Camera(void* sgReplicationInfo, SG_Callbacks callbacks, const RAS_CameraData& camdata, bool frustum_culling, + bool delete_node, PyTypeObject *T) : KX_GameObject(sgReplicationInfo,callbacks,T), @@ -50,7 +51,8 @@ KX_Camera::KX_Camera(void* sgReplicationInfo, m_normalized(false), m_frustum_culling(frustum_culling), m_set_projection_matrix(false), - m_set_frustum_center(false) + m_set_frustum_center(false), + m_delete_node(delete_node) { // setting a name would be nice... m_name = "cam"; @@ -64,6 +66,12 @@ KX_Camera::KX_Camera(void* sgReplicationInfo, KX_Camera::~KX_Camera() { + if (m_delete_node && m_pSGNode) + { + // for shadow camera, avoids memleak + delete m_pSGNode; + m_pSGNode = NULL; + } } @@ -77,6 +85,13 @@ CValue* KX_Camera::GetReplica() return replica; } +void KX_Camera::ProcessReplica() +{ + KX_GameObject::ProcessReplica(); + // replicated camera are always registered in the scene + m_delete_node = false; +} + MT_Transform KX_Camera::GetWorldToCamera() const { MT_Transform camtrans; diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index 2ec60be0404..aef21cd91e4 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -112,6 +112,11 @@ protected: MT_Scalar m_frustum_radius; bool m_set_frustum_center; + /** + * whether the camera should delete the node itself (only for shadow camera) + */ + bool m_delete_node; + /** * Extracts the camera clip frames from the projection and world-to-camera matrices. */ @@ -138,7 +143,7 @@ public: enum { INSIDE, INTERSECT, OUTSIDE } ; - KX_Camera(void* sgReplicationInfo,SG_Callbacks callbacks,const RAS_CameraData& camdata, bool frustum_culling = true, PyTypeObject *T = &Type); + KX_Camera(void* sgReplicationInfo,SG_Callbacks callbacks,const RAS_CameraData& camdata, bool frustum_culling = true, bool delete_node = false, PyTypeObject *T = &Type); virtual ~KX_Camera(); /** @@ -149,6 +154,7 @@ public: virtual CValue* GetReplica( ); + virtual void ProcessReplica(); MT_Transform GetWorldToCamera() const; MT_Transform GetCameraToWorld() const; diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index 406339586cc..76642649afc 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -980,6 +980,8 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, compoundShape->calculateLocalInertia(mass,localInertia); rigidbody->setMassProps(mass,localInertia); } + // delete motionstate as it's not used + delete motionstate; return; } diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index 7c18b03906e..28bf12f5e87 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -149,6 +149,8 @@ bool KX_GameActuator::Update() } else { printf("Warning: could not create marshal buffer\n"); } + if (marshal_buffer) + delete [] marshal_buffer; } break; } diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 347634b4599..b30b79e7f23 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -1142,7 +1142,7 @@ void KX_KetsjiEngine::RenderShadowBuffers(KX_Scene *scene) if(m_drawingmode == RAS_IRasterizer::KX_TEXTURED && light->HasShadowBuffer()) { /* make temporary camera */ RAS_CameraData camdata = RAS_CameraData(); - KX_Camera *cam = new KX_Camera(scene, scene->m_callbacks, camdata, false); + KX_Camera *cam = new KX_Camera(scene, scene->m_callbacks, camdata, true, true); cam->SetName("__shadow__cam__"); MT_Transform camtrans; diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index 98aad3943fe..506c167a905 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -220,7 +220,7 @@ PyAttributeDef KX_PolygonMaterial::Attributes[] = { KX_PYATTRIBUTE_INT_RW("tilexrep", INT_MIN, INT_MAX, true, KX_PolygonMaterial, m_tilexrep), KX_PYATTRIBUTE_INT_RW("tileyrep", INT_MIN, INT_MAX, true, KX_PolygonMaterial, m_tileyrep), KX_PYATTRIBUTE_INT_RW("drawingmode", INT_MIN, INT_MAX, true, KX_PolygonMaterial, m_drawingmode), - KX_PYATTRIBUTE_INT_RW("lightlayer", INT_MIN, INT_MAX, true, KX_PolygonMaterial, m_lightlayer), + //KX_PYATTRIBUTE_INT_RW("lightlayer", INT_MIN, INT_MAX, true, KX_PolygonMaterial, m_lightlayer), KX_PYATTRIBUTE_BOOL_RW("transparent", KX_PolygonMaterial, m_alpha), KX_PYATTRIBUTE_BOOL_RW("zsort", KX_PolygonMaterial, m_zsort), diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp index f2fd96d63e9..6af00d63c2d 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp @@ -59,7 +59,7 @@ void RAS_IPolyMaterial::Initialize( m_transp = transp; m_alpha = alpha; m_zsort = zsort; - m_lightlayer = lightlayer; + //m_lightlayer = lightlayer; m_polymatid = m_newpolymatid++; m_flag = 0; m_multimode = 0; @@ -80,7 +80,7 @@ RAS_IPolyMaterial::RAS_IPolyMaterial() m_transp(0), m_alpha(false), m_zsort(false), - m_lightlayer(0), + //m_lightlayer(0), m_polymatid(0), m_flag(0), m_multimode(0) @@ -112,7 +112,7 @@ RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname, m_transp(transp), m_alpha(alpha), m_zsort(zsort), - m_lightlayer(lightlayer), + //m_lightlayer(lightlayer), m_polymatid(m_newpolymatid++), m_flag(0), m_multimode(0) @@ -172,10 +172,10 @@ bool RAS_IPolyMaterial::Less(const RAS_IPolyMaterial& rhs) const return m_polymatid < rhs.m_polymatid; } -int RAS_IPolyMaterial::GetLightLayer() const -{ - return m_lightlayer; -} +//int RAS_IPolyMaterial::GetLightLayer() const +//{ +// return m_lightlayer; +//} bool RAS_IPolyMaterial::IsAlpha() const { diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index decd93c3d13..e19db35ccb5 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -73,7 +73,7 @@ protected: int m_transp; bool m_alpha; bool m_zsort; - int m_lightlayer; + //int m_lightlayer; int m_materialindex; unsigned int m_polymatid; @@ -147,7 +147,7 @@ public: virtual bool Equals(const RAS_IPolyMaterial& lhs) const; bool Less(const RAS_IPolyMaterial& rhs) const; - int GetLightLayer() const; + //int GetLightLayer() const; bool IsAlpha() const; bool IsZSort() const; unsigned int hash() const; @@ -167,7 +167,7 @@ public: /* * PreCalculate texture gen */ - virtual void OnConstruction(){} + virtual void OnConstruction(int layer){} }; inline bool operator ==( const RAS_IPolyMaterial & rhs,const RAS_IPolyMaterial & lhs) diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index edd7615efd4..1cb394aaff3 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -91,7 +91,7 @@ struct RAS_MeshObject::fronttoback STR_String RAS_MeshObject::s_emptyname = ""; RAS_MeshObject::RAS_MeshObject(Mesh* mesh, int lightlayer) - : m_lightlayer(lightlayer), + : //m_lightlayer(lightlayer), m_bModified(true), m_bMeshModified(true), m_mesh(mesh), @@ -112,10 +112,10 @@ bool RAS_MeshObject::MeshModified() return m_bMeshModified; } -unsigned int RAS_MeshObject::GetLightLayer() -{ - return m_lightlayer; -} +//unsigned int RAS_MeshObject::GetLightLayer() +//{ +// return m_lightlayer; +//} diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h index fbc3c549a7a..0a16c7fa0f6 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_MeshObject.h @@ -54,7 +54,7 @@ class RAS_MeshObject { private: unsigned int m_debugcolor; - int m_lightlayer; + //int m_lightlayer; bool m_bModified; bool m_bMeshModified; @@ -94,7 +94,7 @@ public: list::iterator GetFirstMaterial(); list::iterator GetLastMaterial(); - unsigned int GetLightLayer(); + //unsigned int GetLightLayer(); /* name */ void SetName(const char *name); diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index db4461325d8..7ceb9e58c7a 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -561,8 +561,8 @@ ImageRender::ImageRender (KX_Scene * scene, KX_GameObject * observer, KX_GameObj float yaxis[3] = {0.f, 1.f, 0.f}; float mirrorMat[3][3]; float left, right, top, bottom, back; - - m_camera= new KX_Camera(scene, KX_Scene::m_callbacks, camdata); + // make sure this camera will delete its node + m_camera= new KX_Camera(scene, KX_Scene::m_callbacks, camdata, true, true); m_camera->SetName("__mirror__cam__"); // don't add the camera to the scene object list, it doesn't need to be accessible m_owncamera = true; -- cgit v1.2.3 From 2de8f6e328e90ac5287187cee16e159411075956 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sat, 23 May 2009 19:36:11 +0000 Subject: == Sequencer == Fix for the fix: SDL_PauseAudio() doesn't really wait for callback to finish which can lead to random segfaults if we set audio_scene to 0 afterwards. So we don't do that. --- source/blender/src/seqaudio.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/seqaudio.c b/source/blender/src/seqaudio.c index 92264605380..fd70cbe1f08 100644 --- a/source/blender/src/seqaudio.c +++ b/source/blender/src/seqaudio.c @@ -715,7 +715,6 @@ void audiostream_stop(void) #ifndef DISABLE_SDL SDL_PauseAudio(1); audio_playing=0; - audio_scene=0; #endif } -- cgit v1.2.3 From a96ce9453f2a8d39e238d20c1c4dec9fe5becfb5 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sat, 23 May 2009 20:02:12 +0000 Subject: Minor fixes in Bullet/constraint solving Should make generic 6DOF constraint more useable, and rigid body stacking more stable (warmstarting was accidently switched off) If time allows, a few more minor last-minute 2.49 fixes might follow. Check out http://bulletphysics.com/constraintsTutorial.blend --- source/blender/src/buttons_object.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index a41f954c4d8..edc8e2a56a1 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -1510,10 +1510,11 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - uiDefButI(block, MENU, B_CONSTRAINT_TEST, "Joint Types%t|Ball%x1|Hinge%x2|Cone Twist%x4|Generic (experimental)%x12",//|Extra Force%x6", + uiDefButI(block, MENU, B_CONSTRAINT_TEST, "Joint Types%t|Ball%x1|Hinge%x2|Generic 6DOF%x12",//|Extra Force%x6", + //uiDefButI(block, MENU, B_CONSTRAINT_TEST, "Joint Types%t|Ball%x1|Hinge%x2|Cone Twist%x4|Generic 6DOF%x12",//|Extra Force%x6", *xco, *yco-25, 150, 18, &data->type, 0, 0, 0, 0, "Choose the joint type"); - uiDefButBitS(block, TOG, CONSTRAINT_DISABLE_LINKED_COLLISION, B_CONSTRAINT_TEST, "No Col.", *xco+155, *yco-25, 111, 18, &data->flag, 0, 24, 0, 0, "Disable Collision Between Linked Bodies"); + uiDefButBitS(block, TOG, CONSTRAINT_DISABLE_LINKED_COLLISION, B_CONSTRAINT_TEST, "No Collision", *xco+155, *yco-25, 111, 18, &data->flag, 0, 24, 0, 0, "Disable Collision Between Linked Bodies"); uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "toObject:", *xco, *yco-50, 130, 18, &data->tar, "Child Object"); -- cgit v1.2.3 From eb8c5f3272b87fffaf017badf55f761de9a04fd1 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sat, 23 May 2009 22:35:47 +0000 Subject: Set default constraint solver mode more compatible to Blender 2.48 settings, this fixes rigid body stacking in this blend file: http://blenderartists.org/forum/showpost.php?p=1382653&postcount=102 (todo: expose this setting in World setting GUI) Expose contact processing threshold in Advanced GUI, next to rigid body margin, called CPT. Default to 1, makes rigid body stacking a bit more stable, smaller values makes sliding easier (at the cost of easier jittering). Disabled for 'dynamic' objects that don't rotate, because characters etc. always need smooth sliding. --- source/blender/blenkernel/intern/object.c | 2 ++ source/blender/blenloader/intern/readfile.c | 5 +++-- source/blender/makesdna/DNA_object_types.h | 2 +- source/blender/src/buttons_logic.c | 15 +++++++++++++-- source/gameengine/Converter/BL_BlenderDataConversion.cpp | 13 +++++++++++++ source/gameengine/Ketsji/KX_ConvertPhysicsObject.h | 2 ++ source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 2 ++ source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 2 ++ source/gameengine/Physics/Bullet/CcdPhysicsController.h | 10 +++++++++- 9 files changed, 47 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index bffbcf73672..9739668c7c7 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -984,6 +984,8 @@ Object *add_only_object(int type, char *name) ob->anisotropicFriction[2] = 1.0f; ob->gameflag= OB_PROP|OB_COLLISION; ob->margin = 0.0; + /* ob->pad3 == Contact Processing Threshold */ + ob->pad3 = 1.; /* NT fluid sim defaults */ ob->fluidsimFlag = 0; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index bda0348f2ca..0b0a97b7ec0 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8083,7 +8083,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* Adjustments needed after Bullets update */ for(ob = main->object.first; ob; ob= ob->id.next) { ob->damping *= 0.635f; - ob->rdamping = 0.1 + (0.59f * ob->rdamping); + ob->rdamping = 0.1 + (0.8f * ob->rdamping); } } @@ -8105,11 +8105,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main) wrld->occlusionRes = 128; } } - + if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 5)) { Object *ob; World *wrld; for(ob = main->object.first; ob; ob= ob->id.next) { + ob->pad3 = 1.; //pad3 is used for m_contactProcessingThreshold if(ob->parent) { /* check if top parent has compound shape set and if yes, set this object to compound shaper as well (was the behaviour before, now it's optional) */ diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 9121f38be16..11fa44fe488 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -159,7 +159,7 @@ typedef struct Object { float margin; float max_vel; /* clamp the maximum velocity 0.0 is disabled */ float min_vel; /* clamp the maximum velocity 0.0 is disabled */ - float pad3; /* clamp the maximum velocity 0.0 is disabled */ + float pad3; /* pad3 is now used for m_contactProcessingThreshold, can we still rename it? */ char dt, dtx; char totcol; /* copy of mesh or curve or meta */ diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index b7039673dfc..b0ce3c8a95b 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -3198,11 +3198,17 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) uiDefButF(block, NUM, 0, "Margin", xco, yco, 180, 19, &ob->margin, 0.001, 1.0, 1, 0, "Collision margin"); + - yco -= 20; if (ob->gameflag & OB_RIGID_BODY) { + uiDefButF(block, NUM, 0, "CPT", + xco+180, yco, 180, 19, &ob->pad3, 0.00, 1., 1, 0, + "Contact Processing Threshold"); + + yco -= 20; + uiDefButBitI(block, TOG, OB_LOCK_RIGID_BODY_X_AXIS, 0, "Lock X Axis", xco, yco, 180, 19, &ob->gameflag2, 0, 0, 0, 0, "Disable simulation of linear motion along the X axis"); @@ -3226,8 +3232,9 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) uiDefButBitI(block, TOG, OB_LOCK_RIGID_BODY_Z_ROT_AXIS, 0, "Lock Z Rot Axis", xco+=180, yco, 180, 19, &ob->gameflag2, 0, 0, 0, 0, "Disable simulation of angular motion along the Z axis"); - yco -= 20; } + + yco -= 20; xco = 0; uiBlockEndAlign(block); @@ -3279,6 +3286,10 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) uiDefButF(block, NUM, 0, "Margin", xco, yco, 180, 19, &ob->margin, 0.0, 1.0, 1, 0, "Collision margin"); + uiDefButF(block, NUM, 0, "CPT", + xco+180, yco, 180, 19, &ob->pad3, 0.00, 1., 1, 0, + "Contact Processing Threshold"); + } yco -= 20; xco = 0; diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 06a4da4fce0..a9c839595c2 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1412,11 +1412,22 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, objprop.m_isCompoundChild = isCompoundChild; objprop.m_hasCompoundChildren = hasCompoundChildren; objprop.m_margin = blenderobject->margin; + // ACTOR is now a separate feature objprop.m_isactor = (blenderobject->gameflag & OB_ACTOR)!=0; objprop.m_dyna = (blenderobject->gameflag & OB_DYNAMIC) != 0; objprop.m_softbody = (blenderobject->gameflag & OB_SOFT_BODY) != 0; objprop.m_angular_rigidbody = (blenderobject->gameflag & OB_RIGID_BODY) != 0; + + ///contact processing threshold is only for rigid bodies and static geometry, not 'dynamic' + if (objprop.m_angular_rigidbody || !objprop.m_dyna ) + { + objprop.m_contactProcessingThreshold = blenderobject->pad3; + } else + { + objprop.m_contactProcessingThreshold = 0.f; + } + objprop.m_sensor = (blenderobject->gameflag & OB_SENSOR) != 0; if (objprop.m_softbody) @@ -1461,6 +1472,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, objprop.m_soft_numclusteriterations= blenderobject->bsoft->numclusteriterations; /* number of iterations to refine collision clusters*/ objprop.m_soft_welding = blenderobject->bsoft->welding; /* welding */ objprop.m_margin = blenderobject->bsoft->margin; + objprop.m_contactProcessingThreshold = 0.f; } else { objprop.m_gamesoftFlag = OB_BSB_BENDING_CONSTRAINTS | OB_BSB_SHAPE_MATCHING | OB_BSB_AERO_VPOINT; @@ -1501,6 +1513,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, objprop.m_soft_numclusteriterations= 16; objprop.m_soft_welding = 0.f; objprop.m_margin = 0.f; + objprop.m_contactProcessingThreshold = 0.f; } } diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h b/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h index e48fddb30bd..74042366bae 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h @@ -139,6 +139,8 @@ struct KX_ObjectProperties ///////////////////////// double m_margin; + float m_contactProcessingThreshold; + KX_BoundBoxClass m_boundclass; union { KX_BoxBounds box; diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index 76642649afc..cdba59dd9ca 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -1103,6 +1103,8 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, (isbulletdyna) ? short(CcdConstructionInfo::AllFilter) : short(CcdConstructionInfo::AllFilter ^ CcdConstructionInfo::StaticFilter); ci.m_bRigid = objprop->m_dyna && objprop->m_angular_rigidbody; + + ci.m_contactProcessingThreshold = objprop->m_contactProcessingThreshold;//todo: expose this in advanced settings, just like margin, default to 10000 or so ci.m_bSoft = objprop->m_softbody; ci.m_bSensor = isbulletsensor; MT_Vector3 scaling = gameobj->NodeGetWorldScaling(); diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 6b00011b693..710d0656f6d 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -519,6 +519,8 @@ void CcdPhysicsController::CreateRigidbody() { body->setAngularFactor(0.f); } + body->setContactProcessingThreshold(m_cci.m_contactProcessingThreshold); + } if (m_object && m_cci.m_do_anisotropic) { diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index fc8de0e2ded..d73759bac76 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -231,7 +231,8 @@ struct CcdConstructionInfo m_physicsEnv(0), m_inertiaFactor(1.f), m_do_anisotropic(false), - m_anisotropicFriction(1.f,1.f,1.f) + m_anisotropicFriction(1.f,1.f,1.f), + m_contactProcessingThreshold(1e10) { } @@ -317,6 +318,13 @@ struct CcdConstructionInfo btScalar m_fh_distance; ///< The range above the surface where Fh is active. bool m_fh_normal; ///< Should the object slide off slopes? float m_radius;//for fh backwards compatibility + + ///m_contactProcessingThreshold allows to process contact points with positive distance + ///normally only contacts with negative distance (penetration) are solved + ///however, rigid body stacking is more stable when positive contacts are still passed into the constraint solver + ///this might sometimes lead to collisions with 'internal edges' such as a sliding character controller + ///so disable/set m_contactProcessingThreshold to zero for sliding characters etc. + float m_contactProcessingThreshold;///< Process contacts with positive distance in range [0..INF] }; -- cgit v1.2.3 From 4922dd03393489e85f04bd5785496c44af78d0d6 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sun, 24 May 2009 00:42:40 +0000 Subject: fix generic 6dof constraint support -> convert 3 values into euler angles and convert those into a full constraint frame (same values as Rigid Body constraint Generic 6DOF values), and add 'setLimit' support for generic 6DOF constraint. todo: enableMotor --- source/gameengine/Ketsji/KX_ConstraintWrapper.cpp | 30 ++++++++++++++++++++++ source/gameengine/Ketsji/KX_ConstraintWrapper.h | 2 ++ .../gameengine/Ketsji/KX_PyConstraintBinding.cpp | 27 ++++++++++++++++++- 3 files changed, 58 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index c63f9e57ed2..7af2b15a14c 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -54,6 +54,31 @@ PyObject* KX_ConstraintWrapper::PyGetConstraintId(PyObject* args, PyObject* kwds return PyInt_FromLong(m_constraintId); } +PyObject* KX_ConstraintWrapper::PySetLimit(PyObject* args, PyObject* kwds) +{ + int len = PyTuple_Size(args); + int success = 1; + + if (len == 3) + { + int dof; + float minLimit,maxLimit; + success = PyArg_ParseTuple(args,"iff",&dof,&minLimit,&maxLimit); + if (success) + { + m_physenv->setConstraintParam(m_constraintId,dof,minLimit,maxLimit); + Py_RETURN_NONE; + } + } + return NULL; +} + +PyObject* KX_ConstraintWrapper::PyEnableMotor(PyObject* args, PyObject* kwds) +{ + ///will add it soon + return PyInt_FromLong(0); +} + //python specific stuff PyTypeObject KX_ConstraintWrapper::Type = { #if (PY_VERSION_HEX >= 0x02060000) @@ -100,8 +125,13 @@ int KX_ConstraintWrapper::py_setattro(PyObject *attr,PyObject* value) }; + + + PyMethodDef KX_ConstraintWrapper::Methods[] = { {"getConstraintId",(PyCFunction) KX_ConstraintWrapper::sPyGetConstraintId, METH_VARARGS}, + {"setLimit",(PyCFunction) KX_ConstraintWrapper::sPySetLimit, METH_VARARGS}, + {"enableMotor",(PyCFunction) KX_ConstraintWrapper::sPyEnableMotor, METH_VARARGS}, {NULL,NULL} //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.h b/source/gameengine/Ketsji/KX_ConstraintWrapper.h index 3270d57188d..0772d257b56 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.h +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.h @@ -45,6 +45,8 @@ public: KX_PYMETHOD(KX_ConstraintWrapper,TestMethod); KX_PYMETHOD(KX_ConstraintWrapper,GetConstraintId); + KX_PYMETHOD(KX_ConstraintWrapper,SetLimit); + KX_PYMETHOD(KX_ConstraintWrapper,EnableMotor); private: int m_constraintId; diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index 0f21b24489d..1d52057317e 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -33,6 +33,7 @@ #include "KX_PhysicsObjectWrapper.h" #include "PHY_IPhysicsController.h" #include "PHY_IVehicle.h" +#include "MT_Matrix3x3.h" #include "PyObjectPlus.h" @@ -435,7 +436,31 @@ static PyObject* gPyCreateConstraint(PyObject* self, PHY_IPhysicsController* physctrl2 = (PHY_IPhysicsController*) physicsid2; if (physctrl) //TODO:check for existance of this pointer! { - int constraintid = PHY_GetActiveEnvironment()->createConstraint(physctrl,physctrl2,(enum PHY_ConstraintType)constrainttype,pivotX,pivotY,pivotZ,axisX,axisY,axisZ,0); + PHY_ConstraintType ct = (PHY_ConstraintType) constrainttype; + int constraintid =0; + + if (ct == PHY_GENERIC_6DOF_CONSTRAINT) + { + //convert from euler angle into axis + float radsPerDeg = 6.283185307179586232f / 360.f; + + //we need to pass a full constraint frame, not just axis + //localConstraintFrameBasis + MT_Matrix3x3 localCFrame(MT_Vector3(radsPerDeg*axisX,radsPerDeg*axisY,radsPerDeg*axisZ)); + MT_Vector3 axis0 = localCFrame.getColumn(0); + MT_Vector3 axis1 = localCFrame.getColumn(1); + MT_Vector3 axis2 = localCFrame.getColumn(2); + + constraintid = PHY_GetActiveEnvironment()->createConstraint(physctrl,physctrl2,(enum PHY_ConstraintType)constrainttype, + pivotX,pivotY,pivotZ, + (float)axis0.x(),(float)axis0.y(),(float)axis0.z(), + (float)axis1.x(),(float)axis1.y(),(float)axis1.z(), + (float)axis2.x(),(float)axis2.y(),(float)axis2.z(),0);//dat->flag); //flag? + + } else + { + constraintid = PHY_GetActiveEnvironment()->createConstraint(physctrl,physctrl2,(enum PHY_ConstraintType)constrainttype,pivotX,pivotY,pivotZ,axisX,axisY,axisZ,0); + } KX_ConstraintWrapper* wrap = new KX_ConstraintWrapper((enum PHY_ConstraintType)constrainttype,constraintid,PHY_GetActiveEnvironment()); -- cgit v1.2.3 From 52b0a2b3dbf5c5e0b930dcaff8647ec1d06e2d3c Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sun, 24 May 2009 01:55:24 +0000 Subject: PhysicsConstraints.createConstraint: allow to dynamically create rigid body constraints while disable collision detection between connected bodies, pass as 10th argument the flag 128 PhysiPython KX_ConstraintWrapper, setParam export setParam(paramIndex,paramValue0,paramValue1) for Physics constraints paramIndex 0,1,2 are linear limits, 3,4,5 are angular limits, 6,7,8 are linear motors, 9,10,11 are angular motors For example: disableConnectedBodies=128 cons = PhysicsConstraints.createConstraint(oid,rid,generic6dof,pivotInAx,pivotInAy,pivotInAz,angleX,angleY,angleZ,disableConnectedBodies) #params 0,1,2 are linear limits, low,high value. if low > high then disable limit cons.setParam(0,0,0) I will provide an example .blend for Blender 2.49 --- source/gameengine/Ketsji/KX_ConstraintWrapper.cpp | 11 ++--- source/gameengine/Ketsji/KX_ConstraintWrapper.h | 3 +- .../gameengine/Ketsji/KX_PyConstraintBinding.cpp | 9 ++++- .../Physics/Bullet/CcdPhysicsEnvironment.cpp | 47 ++++++++++++++++++++-- 4 files changed, 56 insertions(+), 14 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index 7af2b15a14c..b0576424a47 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -54,7 +54,7 @@ PyObject* KX_ConstraintWrapper::PyGetConstraintId(PyObject* args, PyObject* kwds return PyInt_FromLong(m_constraintId); } -PyObject* KX_ConstraintWrapper::PySetLimit(PyObject* args, PyObject* kwds) +PyObject* KX_ConstraintWrapper::PySetParam(PyObject* args, PyObject* kwds) { int len = PyTuple_Size(args); int success = 1; @@ -73,11 +73,7 @@ PyObject* KX_ConstraintWrapper::PySetLimit(PyObject* args, PyObject* kwds) return NULL; } -PyObject* KX_ConstraintWrapper::PyEnableMotor(PyObject* args, PyObject* kwds) -{ - ///will add it soon - return PyInt_FromLong(0); -} + //python specific stuff PyTypeObject KX_ConstraintWrapper::Type = { @@ -130,8 +126,7 @@ int KX_ConstraintWrapper::py_setattro(PyObject *attr,PyObject* value) PyMethodDef KX_ConstraintWrapper::Methods[] = { {"getConstraintId",(PyCFunction) KX_ConstraintWrapper::sPyGetConstraintId, METH_VARARGS}, - {"setLimit",(PyCFunction) KX_ConstraintWrapper::sPySetLimit, METH_VARARGS}, - {"enableMotor",(PyCFunction) KX_ConstraintWrapper::sPyEnableMotor, METH_VARARGS}, + {"setParam",(PyCFunction) KX_ConstraintWrapper::sPySetParam, METH_VARARGS}, {NULL,NULL} //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.h b/source/gameengine/Ketsji/KX_ConstraintWrapper.h index 0772d257b56..b8ac464ceab 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.h +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.h @@ -45,8 +45,7 @@ public: KX_PYMETHOD(KX_ConstraintWrapper,TestMethod); KX_PYMETHOD(KX_ConstraintWrapper,GetConstraintId); - KX_PYMETHOD(KX_ConstraintWrapper,SetLimit); - KX_PYMETHOD(KX_ConstraintWrapper,EnableMotor); + KX_PYMETHOD(KX_ConstraintWrapper,SetParam); private: int m_constraintId; diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index 1d52057317e..a098d99864f 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -405,6 +405,8 @@ static PyObject* gPyCreateConstraint(PyObject* self, int physicsid=0,physicsid2 = 0,constrainttype=0,extrainfo=0; int len = PyTuple_Size(args); int success = 1; + int flag = 0; + float pivotX=1,pivotY=1,pivotZ=1,axisX=0,axisY=0,axisZ=1; if (len == 3) { @@ -421,6 +423,11 @@ static PyObject* gPyCreateConstraint(PyObject* self, success = PyArg_ParseTuple(args,"iiiffffff",&physicsid,&physicsid2,&constrainttype, &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ); } + else if (len == 10) + { + success = PyArg_ParseTuple(args,"iiiffffffi",&physicsid,&physicsid2,&constrainttype, + &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ,&flag); + } else if (len==4) { success = PyArg_ParseTuple(args,"iiii",&physicsid,&physicsid2,&constrainttype,&extrainfo); @@ -455,7 +462,7 @@ static PyObject* gPyCreateConstraint(PyObject* self, pivotX,pivotY,pivotZ, (float)axis0.x(),(float)axis0.y(),(float)axis0.z(), (float)axis1.x(),(float)axis1.y(),(float)axis1.z(), - (float)axis2.x(),(float)axis2.y(),(float)axis2.z(),0);//dat->flag); //flag? + (float)axis2.x(),(float)axis2.y(),(float)axis2.z(),flag); } else { diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index ed517e637dc..561c370854f 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -426,6 +426,13 @@ void CcdPhysicsEnvironment::removeCcdPhysicsController(CcdPhysicsController* ctr btRigidBody* body = ctrl->GetRigidBody(); if (body) { + for (int i=body->getNumConstraintRefs()-1;i>=0;i--) + { + btTypedConstraint* con = body->getConstraintRef(i); + m_dynamicsWorld->removeConstraint(con); + body->removeConstraintRef(con); + //delete con; //might be kept by python KX_ConstraintWrapper + } m_dynamicsWorld->removeRigidBody(ctrl->GetRigidBody()); } else { @@ -1791,9 +1798,43 @@ void CcdPhysicsEnvironment::setConstraintParam(int constraintId,int param,float { case PHY_GENERIC_6DOF_CONSTRAINT: { - //param = 1..12, min0,max0,min1,max1...min6,max6 - btGeneric6DofConstraint* genCons = (btGeneric6DofConstraint*)typedConstraint; - genCons->setLimit(param,value0,value1); + + switch (param) + { + case 0: case 1: case 2: case 3: case 4: case 5: + { + //param = 0..5 are constraint limits, with low/high limit value + btGeneric6DofConstraint* genCons = (btGeneric6DofConstraint*)typedConstraint; + genCons->setLimit(param,value0,value1); + break; + } + case 6: case 7: case 8: + { + //param = 6,7,8 are translational motors, with value0=target velocity, value1 = max motor force + btGeneric6DofConstraint* genCons = (btGeneric6DofConstraint*)typedConstraint; + int transMotorIndex = param-6; + btTranslationalLimitMotor* transMotor = genCons->getTranslationalLimitMotor(); + transMotor->m_targetVelocity[transMotorIndex]= value0; + transMotor->m_maxMotorForce[transMotorIndex]=value1; + transMotor->m_enableMotor[transMotorIndex] = (value1>0.f); + break; + } + case 9: case 10: case 11: + { + //param = 9,10,11 are rotational motors, with value0=target velocity, value1 = max motor force + btGeneric6DofConstraint* genCons = (btGeneric6DofConstraint*)typedConstraint; + int angMotorIndex = param-9; + btRotationalLimitMotor* rotMotor = genCons->getRotationalLimitMotor(angMotorIndex); + rotMotor->m_enableMotor = (value1 > 0.f); + rotMotor->m_targetVelocity = value0; + rotMotor->m_maxMotorForce = value1; + break; + } + + default: + { + } + } break; }; default: -- cgit v1.2.3 From 45f2463c833577852b2c9d3c85e435fc25b945bd Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Sun, 24 May 2009 04:45:10 +0000 Subject: Patch #18815: BGE: More updates to deprecation documentation and 2.49 conversion script by Alex Frases(z0r) - Fixed some deprecation warnings in documentation. - Added more conversions to script. - Added more attributes to script todo list. - Print out name of text buffer when encountering an error in batch mode. - Refactor: Simplified attribute map. - Added notImplemented function to print warnings for missing conversions. References documentation. --- source/gameengine/PyDoc/GameTypes.py | 100 +++++++++++++++++++++-------------- 1 file changed, 61 insertions(+), 39 deletions(-) (limited to 'source') diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index a7ad29d5cfa..8a590a48c9e 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -2508,7 +2508,7 @@ class KX_TouchSensor(SCA_ISensor): """ Returns the property or material to collide with. Use getTouchMaterial() to find out whether this sensor - looks for properties or materials. (B{deprecated}) + looks for properties or materials. @deprecated: use the L{property} property @rtype: string @@ -2588,7 +2588,7 @@ class KX_NetworkMessageActuator(SCA_IActuator): """ Sets the message body. - deprecated: Use the L{body} attribute instead. + @deprecated: Use the L{body} attribute instead. @type body: string @param body: if the body type is True, this is the name of the property to send. if the body type is False, this is the text to send. @@ -2707,15 +2707,17 @@ class KX_ObjectActuator(SCA_IActuator): """ def getForce(): """ - Returns the force applied by the actuator. (B{deprecated}) - + Returns the force applied by the actuator. + + @deprecated: Use L{force} and L{useLocalForce} instead. @rtype: list [fx, fy, fz, local] @return: A four item list, containing the vector force, and a flag specifying whether the force is local. """ def setForce(fx, fy, fz, local): """ - Sets the force applied by the actuator. (B{deprecated}) + Sets the force applied by the actuator. + @deprecated: Use L{force} and L{useLocalForce} instead. @type fx: float @param fx: the x component of the force. @type fy: float @@ -2728,16 +2730,18 @@ class KX_ObjectActuator(SCA_IActuator): """ def getTorque(): """ - Returns the torque applied by the actuator. (B{deprecated}) + Returns the torque applied by the actuator. + @deprecated: Use L{torque} and L{useLocalTorque} instead. @rtype: list [S{Tau}x, S{Tau}y, S{Tau}z, local] @return: A four item list, containing the vector torque, and a flag specifying whether the torque is applied in local coordinates (True) or world coordinates (False) """ def setTorque(tx, ty, tz, local): """ - Sets the torque applied by the actuator. (B{deprecated}) + Sets the torque applied by the actuator. + @deprecated: Use L{torque} and L{useLocalTorque} instead. @type tx: float @param tx: the x component of the torque. @type ty: float @@ -2750,8 +2754,9 @@ class KX_ObjectActuator(SCA_IActuator): """ def getDLoc(): """ - Returns the displacement vector applied by the actuator. (B{deprecated}) + Returns the displacement vector applied by the actuator. + @deprecated: Use L{dLoc} and L{useLocalDLoc} instead. @rtype: list [dx, dy, dz, local] @return: A four item list, containing the vector displacement, and whether the displacement is applied in local coordinates (True) or world @@ -2759,12 +2764,13 @@ class KX_ObjectActuator(SCA_IActuator): """ def setDLoc(dx, dy, dz, local): """ - Sets the displacement vector applied by the actuator. (B{deprecated}) + Sets the displacement vector applied by the actuator. Since the displacement is applied every frame, you must adjust the displacement based on the frame rate, or you game experience will depend on the player's computer speed. + @deprecated: Use L{dLoc} and L{useLocalDLoc} instead. @type dx: float @param dx: the x component of the displacement vector. @type dy: float @@ -2777,20 +2783,22 @@ class KX_ObjectActuator(SCA_IActuator): """ def getDRot(): """ - Returns the angular displacement vector applied by the actuator. (B{deprecated}) + Returns the angular displacement vector applied by the actuator. + @deprecated: Use L{dRot} and L{useLocalDRot} instead. @rtype: list [dx, dy, dz, local] @return: A four item list, containing the angular displacement vector, and whether the displacement is applied in local coordinates (True) or world coordinates (False) """ def setDRot(dx, dy, dz, local): """ - Sets the angular displacement vector applied by the actuator. (B{deprecated}) + Sets the angular displacement vector applied by the actuator. Since the displacement is applied every frame, you must adjust the displacement based on the frame rate, or you game experience will depend on the player's computer speed. + @deprecated: Use L{dRot} and L{useLocalDRot} instead. @type dx: float @param dx: the x component of the angular displacement vector. @type dy: float @@ -2804,16 +2812,18 @@ class KX_ObjectActuator(SCA_IActuator): def getLinearVelocity(): """ Returns the linear velocity applied by the actuator. - For the servo control actuator, this is the target speed. (B{deprecated}) - + For the servo control actuator, this is the target speed. + + @deprecated: Use L{linV} and L{useLocalLinV} instead. @rtype: list [vx, vy, vz, local] @return: A four item list, containing the vector velocity, and whether the velocity is applied in local coordinates (True) or world coordinates (False) """ def setLinearVelocity(vx, vy, vz, local): """ Sets the linear velocity applied by the actuator. - For the servo control actuator, sets the target speed. (B{deprecated}) - + For the servo control actuator, sets the target speed. + + @deprecated: Use L{linV} and L{useLocalLinV} instead. @type vx: float @param vx: the x component of the velocity vector. @type vy: float @@ -2826,8 +2836,9 @@ class KX_ObjectActuator(SCA_IActuator): """ def getAngularVelocity(): """ - Returns the angular velocity applied by the actuator. (B{deprecated}) - + Returns the angular velocity applied by the actuator. + + @deprecated: Use L{angV} and L{useLocalAngV} instead. @rtype: list [S{omega}x, S{omega}y, S{omega}z, local] @return: A four item list, containing the vector velocity, and whether the velocity is applied in local coordinates (True) or world @@ -2835,8 +2846,9 @@ class KX_ObjectActuator(SCA_IActuator): """ def setAngularVelocity(wx, wy, wz, local): """ - Sets the angular velocity applied by the actuator. (B{deprecated}) - + Sets the angular velocity applied by the actuator. + + @deprecated: Use L{angV} and L{useLocalAngV} instead. @type wx: float @param wx: the x component of the velocity vector. @type wy: float @@ -2849,30 +2861,34 @@ class KX_ObjectActuator(SCA_IActuator): """ def getDamping(): """ - Returns the damping parameter of the servo controller. (B{deprecated}) - + Returns the damping parameter of the servo controller. + + @deprecated: Use L{damping} instead. @rtype: integer @return: the time constant of the servo controller in frame unit. """ def setDamping(damp): """ - Sets the damping parameter of the servo controller. (B{deprecated}) - + Sets the damping parameter of the servo controller. + + @deprecated: Use L{damping} instead. @type damp: integer @param damp: the damping parameter in frame unit. """ def getForceLimitX(): """ - Returns the min/max force limit along the X axis used by the servo controller. (B{deprecated}) - + Returns the min/max force limit along the X axis used by the servo controller. + + @deprecated: Use L{forceLimitX} instead. @rtype: list [min, max, enabled] @return: A three item list, containing the min and max limits of the force as float and whether the limits are active(true) or inactive(true) """ def setForceLimitX(min, max, enable): """ - Sets the min/max force limit along the X axis and activates or deactivates the limits in the servo controller. (B{deprecated}) - + Sets the min/max force limit along the X axis and activates or deactivates the limits in the servo controller. + + @deprecated: Use L{forceLimitX} instead. @type min: float @param min: the minimum value of the force along the X axis. @type max: float @@ -2883,16 +2899,18 @@ class KX_ObjectActuator(SCA_IActuator): """ def getForceLimitY(): """ - Returns the min/max force limit along the Y axis used by the servo controller. (B{deprecated}) - + Returns the min/max force limit along the Y axis used by the servo controller. + + @deprecated: Use L{forceLimitY} instead. @rtype: list [min, max, enabled] @return: A three item list, containing the min and max limits of the force as float and whether the limits are active(true) or inactive(true) """ def setForceLimitY(min, max, enable): """ - Sets the min/max force limit along the Y axis and activates or deactivates the limits in the servo controller. (B{deprecated}) - + Sets the min/max force limit along the Y axis and activates or deactivates the limits in the servo controller. + + @deprecated: Use L{forceLimitY} instead. @type min: float @param min: the minimum value of the force along the Y axis. @type max: float @@ -2903,16 +2921,18 @@ class KX_ObjectActuator(SCA_IActuator): """ def getForceLimitZ(): """ - Returns the min/max force limit along the Z axis used by the servo controller. (B{deprecated}) - + Returns the min/max force limit along the Z axis used by the servo controller. + + @deprecated: Use L{forceLimitZ} instead. @rtype: list [min, max, enabled] @return: A three item list, containing the min and max limits of the force as float and whether the limits are active(true) or inactive(true) """ def setForceLimitZ(min, max, enable): """ - Sets the min/max force limit along the Z axis and activates or deactivates the limits in the servo controller. (B{deprecated}) - + Sets the min/max force limit along the Z axis and activates or deactivates the limits in the servo controller. + + @deprecated: Use L{forceLimitZ} instead. @type min: float @param min: the minimum value of the force along the Z axis. @type max: float @@ -2923,8 +2943,9 @@ class KX_ObjectActuator(SCA_IActuator): """ def getPID(): """ - Returns the PID coefficient of the servo controller. (B{deprecated}) - + Returns the PID coefficient of the servo controller. + + @deprecated: Use L{pid} instead. @rtype: list [P, I, D] @return: A three item list, containing the PID coefficient as floats: P : proportional coefficient @@ -2933,8 +2954,9 @@ class KX_ObjectActuator(SCA_IActuator): """ def setPID(P, I, D): """ - Sets the PID coefficients of the servo controller. (B{deprecated}) - + Sets the PID coefficients of the servo controller. + + @deprecated: Use L{pid} instead. @type P: flat @param P: proportional coefficient @type I: float -- cgit v1.2.3 From 83bb096f24cb2252f90a77923bd1818930a2fed2 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sun, 24 May 2009 06:31:47 +0000 Subject: + renamed pad3 to m_contactProcessingThreshold (thanks Campbell Barton/ideasman for confirming it is ok to rename it) + fixed Python method, PyArg_ParseTuple already checks for errors, no returning of NULL, thanks Campbell too) + added linear/angular spring for each of the 6DOFs of a generic 6dof constraint. This makes the generic 6dof constraint very versatile. --- source/blender/blenkernel/intern/object.c | 2 +- source/blender/blenloader/intern/readfile.c | 2 +- source/blender/makesdna/DNA_object_types.h | 2 +- source/blender/src/buttons_logic.c | 4 ++-- .../Converter/BL_BlenderDataConversion.cpp | 2 +- source/gameengine/Ketsji/KX_ConstraintWrapper.cpp | 17 +++++-------- .../Physics/Bullet/CcdPhysicsEnvironment.cpp | 28 +++++++++++++++++++--- 7 files changed, 37 insertions(+), 20 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 9739668c7c7..ec068c35c11 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -985,7 +985,7 @@ Object *add_only_object(int type, char *name) ob->gameflag= OB_PROP|OB_COLLISION; ob->margin = 0.0; /* ob->pad3 == Contact Processing Threshold */ - ob->pad3 = 1.; + ob->m_contactProcessingThreshold = 1.; /* NT fluid sim defaults */ ob->fluidsimFlag = 0; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 0b0a97b7ec0..d8566e06ed7 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8110,7 +8110,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) Object *ob; World *wrld; for(ob = main->object.first; ob; ob= ob->id.next) { - ob->pad3 = 1.; //pad3 is used for m_contactProcessingThreshold + ob->m_contactProcessingThreshold = 1.; //pad3 is used for m_contactProcessingThreshold if(ob->parent) { /* check if top parent has compound shape set and if yes, set this object to compound shaper as well (was the behaviour before, now it's optional) */ diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 11fa44fe488..741822b5a98 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -159,7 +159,7 @@ typedef struct Object { float margin; float max_vel; /* clamp the maximum velocity 0.0 is disabled */ float min_vel; /* clamp the maximum velocity 0.0 is disabled */ - float pad3; /* pad3 is now used for m_contactProcessingThreshold, can we still rename it? */ + float m_contactProcessingThreshold; char dt, dtx; char totcol; /* copy of mesh or curve or meta */ diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index b0ce3c8a95b..c283cd18ca2 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -3204,7 +3204,7 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) if (ob->gameflag & OB_RIGID_BODY) { uiDefButF(block, NUM, 0, "CPT", - xco+180, yco, 180, 19, &ob->pad3, 0.00, 1., 1, 0, + xco+180, yco, 180, 19, &ob->m_contactProcessingThreshold, 0.00, 1., 1, 0, "Contact Processing Threshold"); yco -= 20; @@ -3287,7 +3287,7 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) xco, yco, 180, 19, &ob->margin, 0.0, 1.0, 1, 0, "Collision margin"); uiDefButF(block, NUM, 0, "CPT", - xco+180, yco, 180, 19, &ob->pad3, 0.00, 1., 1, 0, + xco+180, yco, 180, 19, &ob->m_contactProcessingThreshold, 0.00, 1., 1, 0, "Contact Processing Threshold"); } diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index a9c839595c2..d9e93d41f34 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1422,7 +1422,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, ///contact processing threshold is only for rigid bodies and static geometry, not 'dynamic' if (objprop.m_angular_rigidbody || !objprop.m_dyna ) { - objprop.m_contactProcessingThreshold = blenderobject->pad3; + objprop.m_contactProcessingThreshold = blenderobject->m_contactProcessingThreshold; } else { objprop.m_contactProcessingThreshold = 0.f; diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index b0576424a47..b40100db2f7 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -59,22 +59,17 @@ PyObject* KX_ConstraintWrapper::PySetParam(PyObject* args, PyObject* kwds) int len = PyTuple_Size(args); int success = 1; - if (len == 3) + int dof; + float minLimit,maxLimit; + success = PyArg_ParseTuple(args,"iff:setParam",&dof,&minLimit,&maxLimit); + if (success) { - int dof; - float minLimit,maxLimit; - success = PyArg_ParseTuple(args,"iff",&dof,&minLimit,&maxLimit); - if (success) - { - m_physenv->setConstraintParam(m_constraintId,dof,minLimit,maxLimit); - Py_RETURN_NONE; - } + m_physenv->setConstraintParam(m_constraintId,dof,minLimit,maxLimit); } - return NULL; + Py_RETURN_NONE; } - //python specific stuff PyTypeObject KX_ConstraintWrapper::Type = { #if (PY_VERSION_HEX >= 0x02060000) diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 561c370854f..58720c8cc30 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -922,7 +922,7 @@ int CcdPhysicsEnvironment::createUniversalD6Constraint( bool useReferenceFrameA = true; - genericConstraint = new btGeneric6DofConstraint( + genericConstraint = new btGeneric6DofSpringConstraint( *rb0,*rb1, frameInA,frameInB,useReferenceFrameA); genericConstraint->setLinearLowerLimit(linearMinLimits); @@ -1831,6 +1831,28 @@ void CcdPhysicsEnvironment::setConstraintParam(int constraintId,int param,float break; } + case 12: case 13: case 14: case 15: case 16: case 17: + { + //param 13-17 are for motorized springs on each of the degrees of freedom + btGeneric6DofSpringConstraint* genCons = (btGeneric6DofSpringConstraint*)typedConstraint; + int springIndex = param-12; + if (value0!=0.f) + { + bool springEnabled = true; + genCons->setStiffness(springIndex,value0); + genCons->enableSpring(springIndex,springEnabled); + if (value1>0.5f) + { + genCons->setEquilibriumPoint(springIndex); + } + } else + { + bool springEnabled = false; + genCons->enableSpring(springIndex,springEnabled); + } + break; + } + default: { } @@ -2351,7 +2373,7 @@ int CcdPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl frameInB = inv * globalFrameA; bool useReferenceFrameA = true; - genericConstraint = new btGeneric6DofConstraint( + genericConstraint = new btGeneric6DofSpringConstraint( *rb0,*rb1, frameInA,frameInB,useReferenceFrameA); @@ -2375,7 +2397,7 @@ int CcdPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl frameInB = rb0->getCenterOfMassTransform() * frameInA; bool useReferenceFrameA = true; - genericConstraint = new btGeneric6DofConstraint( + genericConstraint = new btGeneric6DofSpringConstraint( *rb0,s_fixedObject2, frameInA,frameInB,useReferenceFrameA); } -- cgit v1.2.3 From e41eeaa0451c8affeda8b9ff44a60d804d8622cc Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 24 May 2009 12:53:49 +0000 Subject: BGE: renamed sensor type enum to avoid conflict with mingw (NEAR was causing the problem). --- source/gameengine/GameLogic/SCA_ISensor.h | 10 +++++----- source/gameengine/Ketsji/KX_NearSensor.h | 2 +- source/gameengine/Ketsji/KX_RadarSensor.h | 2 +- source/gameengine/Ketsji/KX_TouchEventManager.cpp | 2 +- source/gameengine/Ketsji/KX_TouchSensor.h | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index ad8865299d6..9bbd6ed41e4 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -93,10 +93,10 @@ protected: public: enum sensortype { - NONE = 0, - TOUCH, - NEAR, - RADAR, + ST_NONE = 0, + ST_TOUCH, + ST_NEAR, + ST_RADAR, // to be updated as needed }; @@ -147,7 +147,7 @@ public: virtual double GetNumber(); - virtual sensortype GetSensorType() { return NONE; } + virtual sensortype GetSensorType() { return ST_NONE; } /** Stop sensing for a while. */ void Suspend(); diff --git a/source/gameengine/Ketsji/KX_NearSensor.h b/source/gameengine/Ketsji/KX_NearSensor.h index d98b464a443..63099e181a0 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.h +++ b/source/gameengine/Ketsji/KX_NearSensor.h @@ -78,7 +78,7 @@ public: const PHY_CollData * coll_data); virtual bool BroadPhaseFilterCollision(void*obj1,void*obj2); virtual bool BroadPhaseSensorFilterCollision(void*obj1,void*obj2) { return false; }; - virtual sensortype GetSensorType() { return NEAR; } + virtual sensortype GetSensorType() { return ST_NEAR; } /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_RadarSensor.h b/source/gameengine/Ketsji/KX_RadarSensor.h index 6779a9edffe..2e5a0e68bed 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.h +++ b/source/gameengine/Ketsji/KX_RadarSensor.h @@ -92,7 +92,7 @@ public: virtual PyObject* py_getattro(PyObject *attr); virtual PyObject* py_getattro_dict(); virtual int py_setattro(PyObject *attr, PyObject* value); - virtual sensortype GetSensorType() { return RADAR; } + virtual sensortype GetSensorType() { return ST_RADAR; } //Deprecated -----> KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeOrigin); diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.cpp b/source/gameengine/Ketsji/KX_TouchEventManager.cpp index 46927541099..9603410c3ac 100644 --- a/source/gameengine/Ketsji/KX_TouchEventManager.cpp +++ b/source/gameengine/Ketsji/KX_TouchEventManager.cpp @@ -105,7 +105,7 @@ bool KX_TouchEventManager::newBroadphaseResponse(void *client_data, it != info->m_sensors.end(); ++it) { - if ((*it)->GetSensorType() == SCA_ISensor::TOUCH) + if ((*it)->GetSensorType() == SCA_ISensor::ST_TOUCH) { KX_TouchSensor* touchsensor = static_cast(*it); if (touchsensor->BroadPhaseSensorFilterCollision(object1, object2)) diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index b62ec6eaf4d..476c63e89db 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -104,7 +104,7 @@ public: // return value = true if collision should be checked on pair of object virtual bool BroadPhaseFilterCollision(void*obj1,void*obj2) { return true; } virtual bool BroadPhaseSensorFilterCollision(void*obj1,void*obj2); - virtual sensortype GetSensorType() { return TOUCH; } + virtual sensortype GetSensorType() { return ST_TOUCH; } virtual bool IsPositiveTrigger() { -- cgit v1.2.3 From ea94f8ab8a2cbe7ccfb4914ef6441c3be7ac0e60 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 24 May 2009 13:41:37 +0000 Subject: == Sequencer == This adds custom proxy file storage to the sequencer. Reasoning: sometimes low resolution versions are already available as a seperate file built by the capture application. So there is no real reason to make blender build it's own seperate proxy. This also somewhat fixes (aehm works around :) ) [#13632] Creating Proxy Takes Over Process, Should be Background Since now you can just fire up ffmpeg to build your proxies in the background. (You could have done before and build a directory of jpeg files, but then you would have to rename all the files since otherwise things are off by one...) --- source/blender/blenloader/intern/readfile.c | 1 + source/blender/include/butspace.h | 3 +- source/blender/makesdna/DNA_sequence_types.h | 3 ++ source/blender/src/buttons_scene.c | 56 +++++++++++++++++++++++----- source/blender/src/sequence.c | 42 +++++++++++++++++++++ 5 files changed, 94 insertions(+), 11 deletions(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d8566e06ed7..d9df1ee4419 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3689,6 +3689,7 @@ static void direct_link_scene(FileData *fd, Scene *sce) if (seq->flag & SEQ_USE_PROXY) { seq->strip->proxy = newdataadr( fd, seq->strip->proxy); + seq->strip->proxy->anim = 0; } else { seq->strip->proxy = 0; } diff --git a/source/blender/include/butspace.h b/source/blender/include/butspace.h index 8a9c1933c97..8aaf4a7c65b 100644 --- a/source/blender/include/butspace.h +++ b/source/blender/include/butspace.h @@ -318,7 +318,7 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la /* *********************** */ #define B_RENDERBUTS 1690 -#define B_SEQUENCERBUTS 1699 +#define B_SEQUENCERBUTS 1700 #define B_FS_PIC 1601 #define B_FS_BACKBUF 1602 @@ -377,6 +377,7 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la #define B_SEQ_BUT_RELOAD_FILE 1696 #define B_SEQ_BUT_REBUILD_PROXY 1697 #define B_SEQ_SEL_PROXY_DIR 1698 +#define B_SEQ_SEL_PROXY_FILE 1699 /* *********************** */ #define B_ARMATUREBUTS 1800 #define B_POSE 1701 diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 7bad8ec3b44..801b283a6c2 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -78,6 +78,8 @@ typedef struct StripColorBalance { typedef struct StripProxy { char dir[160]; + char file[80]; + struct anim *anim; } StripProxy; typedef struct Strip { @@ -258,6 +260,7 @@ typedef struct SpeedControlVars { #define SEQ_USE_COLOR_BALANCE 262144 #define SEQ_USE_PROXY_CUSTOM_DIR 524288 #define SEQ_ACTIVE 1048576 +#define SEQ_USE_PROXY_CUSTOM_FILE 2097152 #define SEQ_COLOR_BALANCE_INVERSE_GAIN 1 #define SEQ_COLOR_BALANCE_INVERSE_GAMMA 2 diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 3036bb78da8..f99ac47b2c5 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -1174,7 +1174,7 @@ static void seq_panel_proxy() uiDefButBitI(block, TOG, SEQ_USE_PROXY, B_SEQ_BUT_RELOAD, "Use Proxy", - 10,140,120,19, &last_seq->flag, + 10,140,80,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Use a preview proxy for this strip"); @@ -1187,10 +1187,16 @@ static void seq_panel_proxy() uiDefButBitI(block, TOG, SEQ_USE_PROXY_CUSTOM_DIR, B_SEQ_BUT_RELOAD, "Custom Dir", - 130,140,120,19, &last_seq->flag, + 90,140,80,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Use a custom directory to store data"); + uiDefButBitI(block, TOG, SEQ_USE_PROXY_CUSTOM_FILE, + B_SEQ_BUT_RELOAD, "Custom File", + 170,140,80,19, &last_seq->flag, + 0.0, 21.0, 100, 0, + "Use a custom file to load data from"); + if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR) { uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_DIR, ICON_FILESEL, 10, 120, 20, 20, 0, 0, 0, 0, 0, @@ -1202,30 +1208,41 @@ static void seq_panel_proxy() 30,120,220,20, last_seq->strip->proxy->dir, 0.0, 160.0, 100, 0, ""); } + if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { + uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_FILE, + ICON_FILESEL, 10, 100, 20, 20, 0, 0, 0, + 0, 0, + "Select the custom proxy file " + "(used for all preview resolutions!)"); + + uiDefBut(block, TEX, + B_SEQ_BUT_RELOAD, "File: ", + 30,100,220,20, last_seq->strip->proxy->file, + 0.0, 160.0, 100, 0, ""); + } } if (last_seq->flag & SEQ_USE_PROXY) { if (G.scene->r.size == 100) { uiDefBut(block, LABEL, 0, "Full render size selected, ", - 10,100,240,19, 0, 0, 0, 0, 0, ""); + 10,60,240,19, 0, 0, 0, 0, 0, ""); uiDefBut(block, LABEL, 0, "so no proxy enabled!", - 10,80,240,19, 0, 0, 0, 0, 0, ""); + 10,40,240,19, 0, 0, 0, 0, 0, ""); } else if (last_seq->type != SEQ_MOVIE && last_seq->type != SEQ_IMAGE && !(last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)) { uiDefBut(block, LABEL, 0, "Cannot proxy this strip without ", - 10,100,240,19, 0, 0, 0, 0, 0, ""); + 10,60,240,19, 0, 0, 0, 0, 0, ""); uiDefBut(block, LABEL, 0, "custom directory selection!", - 10,80,240,19, 0, 0, 0, 0, 0, ""); - - } else { + 10,40,240,19, 0, 0, 0, 0, 0, ""); + } else if (!(last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE)) { uiDefBut(block, BUT, B_SEQ_BUT_REBUILD_PROXY, "Rebuild proxy", - 10,100,240,19, 0, 0, 0, 0, 0, + 10,60,240,19, 0, 0, 0, 0, 0, "Rebuild proxy for the " "currently selected strip."); } @@ -1294,7 +1311,19 @@ static void sel_proxy_dir(char *name) allqueue(REDRAWBUTSSCENE, 0); - BIF_undo_push("Change proxy directory"); + BIF_undo_push("Change custom proxy directory"); +} + +static void sel_proxy_file(char *name) +{ + Sequence *last_seq = get_last_seq(); + + BLI_split_dirfile_basic(name, last_seq->strip->proxy->dir, + last_seq->strip->proxy->file); + + allqueue(REDRAWBUTSSCENE, 0); + + BIF_undo_push("Change custom proxy file"); } void do_sequencer_panels(unsigned short event) @@ -1324,6 +1353,13 @@ void do_sequencer_panels(unsigned short event) last_seq->strip->proxy->dir, sel_proxy_dir); break; + case B_SEQ_SEL_PROXY_FILE: + sa= closest_bigger_area(); + areawinset(sa->win); + activate_fileselect(FILE_SPECIAL, "SELECT PROXY FILE", + last_seq->strip->proxy->dir, + sel_proxy_file); + break; case B_SEQ_BUT_RELOAD: case B_SEQ_BUT_RELOAD_ALL: update_seq_ipo_rect(last_seq); diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index edc68d016a1..d94f30a2bdb 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -106,6 +106,14 @@ void free_tstripdata(int len, TStripElem *se) } +static void free_proxy_seq(Sequence *seq) +{ + if (seq->strip && seq->strip->proxy && seq->strip->proxy->anim) { + IMB_free_anim(seq->strip->proxy->anim); + seq->strip->proxy->anim = 0; + } +} + void free_strip(Strip *strip) { strip->us--; @@ -120,6 +128,10 @@ void free_strip(Strip *strip) } if (strip->proxy) { + if (strip->proxy->anim) { + IMB_free_anim(strip->proxy->anim); + } + MEM_freeN(strip->proxy); } if (strip->crop) { @@ -517,6 +529,8 @@ void reload_sequence_new_file(Sequence * seq) seq->strip->len = seq->len; } + free_proxy_seq(seq); + calc_sequence(seq); } @@ -1053,6 +1067,12 @@ static int seq_proxy_get_fname(Sequence * seq, int cfra, char * name) } } + if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { + snprintf(name, PROXY_MAXFILE, "%s/%s", + dir, seq->strip->proxy->file); + return TRUE; + } + /* generate a seperate proxy directory for each preview size */ if (seq->type == SEQ_IMAGE) { @@ -1099,6 +1119,20 @@ static struct ImBuf * seq_proxy_fetch(Sequence * seq, int cfra) return 0; } + if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { + if (!seq->strip->proxy->anim) { + if (!seq_proxy_get_fname(seq, cfra, name)) { + return 0; + } + + seq->strip->proxy->anim = openanim(name, IB_rect); + } + if (!seq->strip->proxy->anim) { + return 0; + } + return IMB_anim_absolute(seq->strip->proxy->anim, cfra); + } + if (!seq_proxy_get_fname(seq, cfra, name)) { return 0; } @@ -1131,6 +1165,11 @@ static void seq_proxy_build_frame(Sequence * seq, int cfra) return; } + /* that's why it is called custom... */ + if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { + return; + } + if (!seq_proxy_get_fname(seq, cfra, name)) { return; } @@ -2866,6 +2905,7 @@ void free_imbuf_seq_except(int cfra) if(seq->type==SEQ_MOVIE) if(seq->startdisp > cfra || seq->enddisp < cfra) free_anim_seq(seq); + free_proxy_seq(seq); } } END_SEQ @@ -2909,6 +2949,7 @@ void free_imbuf_seq() if(seq->type==SEQ_SPEED) { sequence_effect_speed_rebuild_map(seq, 1); } + free_proxy_seq(seq); } } END_SEQ @@ -2974,6 +3015,7 @@ static int update_changed_seq_recurs(Sequence *seq, Sequence *changed_seq, int l if(seq->type == SEQ_SPEED) { sequence_effect_speed_rebuild_map(seq, 1); } + free_proxy_seq(seq); } if(len_change) -- cgit v1.2.3 From 95e14ac4d3f1d2e399ea8e5646da3841544054d7 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 24 May 2009 14:11:16 +0000 Subject: == Sequencer == Fixed output rescaling, when changing between preview proxy rendering and final resolution. --- source/blender/src/drawseq.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c index f54ac186a21..6bba4fbdcc4 100644 --- a/source/blender/src/drawseq.c +++ b/source/blender/src/drawseq.c @@ -930,6 +930,7 @@ static void draw_image_seq(ScrArea *sa) zoom= SEQ_ZOOM_FAC(sseq->zoom); if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) { + zoom /= G.scene->r.size / 100.0; zoomx = zoom * ((float)G.scene->r.xasp / (float)G.scene->r.yasp); zoomy = zoom; } else { -- cgit v1.2.3 From e5509b98ce253fddc7fdc85beb03702bf1d83254 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 24 May 2009 14:14:58 +0000 Subject: == Sequencer == Made relative paths work with custom proxy files. --- source/blender/src/sequence.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index d94f30a2bdb..e26df73b673 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -1068,8 +1068,10 @@ static int seq_proxy_get_fname(Sequence * seq, int cfra, char * name) } if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { - snprintf(name, PROXY_MAXFILE, "%s/%s", - dir, seq->strip->proxy->file); + BLI_join_dirfile(name, dir, seq->strip->proxy->file); + BLI_convertstringcode(name, G.sce); + BLI_convertstringframe(name, cfra); + return TRUE; } -- cgit v1.2.3 From 2f0ec4b7fc10bbf178220a67acd335e7ae82f7d8 Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Sun, 24 May 2009 16:22:09 +0000 Subject: User Interface -------------- Bugfix 18817: DataBrowse for MTex used Material IDs instead of Texture IDs. --- source/blender/src/headerbuttons.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c index f4135071e3e..17d16924ae6 100644 --- a/source/blender/src/headerbuttons.c +++ b/source/blender/src/headerbuttons.c @@ -896,10 +896,10 @@ void do_global_buttons(unsigned short event) } } if(G.qual & LR_CTRLKEY) { - activate_databrowse_imasel((ID*)lockpoin, ID_TE, 0, B_TEXBROWSE, menunr, do_global_buttons); + activate_databrowse_imasel(id, ID_TE, 0, B_TEXBROWSE, menunr, do_global_buttons); } else { - activate_databrowse((ID*)lockpoin, ID_TE, 0, B_TEXBROWSE, menunr, do_global_buttons); + activate_databrowse(id, ID_TE, 0, B_TEXBROWSE, menunr, do_global_buttons); } return; } -- cgit v1.2.3 From 4f7264ee529f980fa2635d7a3fa6ea1492c86f81 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Sun, 24 May 2009 19:21:54 +0000 Subject: Action actuator default value changed from 0.0 to 1.0. Bookmark renamed to Mark and other small logic tooltip changes - IPOs and actions start it's frame counting in frame 1, not zero. - Talked with Ben and we agreed to rename the "bookmark" feature before an official release. - some English typos. - removed all period in the end of tooltips for consistency's sake. * note: I resisted one more time to the temptation of alphabetical ordering the Sensors and Actuators. That will be the first thing I would like to do after we are done with 2.49 :) It really annoys me as a user. --- source/blender/src/buttons_logic.c | 108 ++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 54 deletions(-) (limited to 'source') diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index c283cd18ca2..b8c851f5ab8 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -1155,11 +1155,11 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short uiDefButBitS(block, TOG, SENS_COLLISION_PULSE, B_REDR, "Pulse",(short)(xco + 10),(short)(yco - 44), (short)(0.20 * (width-20)), 19, &cs->mode, 0.0, 0.0, 0, 0, - "Changes to the set of colliding objects generate pulses"); + "Changes to the set of colliding objects generated pulses"); uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P",(short)(xco + 10 + (0.20 * (width-20))),(short)(yco - 44), (short)(0.20 * (width-20)), 19, &cs->mode, 0.0, 0.0, 0, 0, - "Toggle collision on material or property."); + "Toggle collision on material or property"); if (cs->mode & SENS_COLLISION_MATERIAL) { uiDefBut(block, TEX, 1, "Material:", (short)(xco + 10 + 0.40 * (width-20)), @@ -1215,12 +1215,12 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short uiDefButS(block, MENU, B_REDR, str, (short)(10+xco+0.7 * (width-20)), (short)(yco-44), (short)(0.3 * (width-22)), 19, &rs->axis, 2.0, 31, 0, 0, - "Specify along which axis the radar cone is cast."); + "Specify along which axis the radar cone is cast"); uiDefButF(block, NUM, 1, "Ang:", (short)(10+xco), (short)(yco-68), (short)((width-20)/2), 19, &rs->angle, 0.0, 179.9, 10, 0, - "Opening angle of the radar cone."); + "Opening angle of the radar cone"); uiDefButF(block, NUM, 1, "Dist:", (short)(xco+10 + (width-20)/2), (short)(yco-68), (short)((width-20)/2), 19, &rs->range, 0.01, 10000.0, 100, 0, @@ -1263,14 +1263,14 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short xco+10, yco-((ks->type&1) ? 68:92), (width-20), 19, ks->toggleName, 0, 31, 0, 0, "Property that indicates whether to log " - "keystrokes as a string."); + "keystrokes as a string"); /* line 5: target property for string logging mode */ uiDefBut(block, TEX, 1, "Target: ", xco+10, yco-((ks->type&1) ? 92:116), (width-20), 19, ks->targetName, 0, 31, 0, 0, "Property that receives the keystrokes in case " - "a string is logged."); + "a string is logged"); yco-= ysize; break; @@ -1369,7 +1369,7 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short "Right button %x4|Wheel Up %x5|Wheel Down %x6|Movement %x8|Mouse over %x16|Mouse over any%x32"; uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, width-20, 19, &ms->type, 0, 31, 0, 0, - "Specify the type of event this mouse sensor should trigger on."); + "Specify the type of event this mouse sensor should trigger on"); yco-= ysize; break; @@ -1406,7 +1406,7 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P", xco + 10,yco - 44, 0.20 * (width-20), 19, &raySens->mode, 0.0, 0.0, 0, 0, - "Toggle collision on material or property."); + "Toggle collision on material or property"); if (raySens->mode & SENS_COLLISION_MATERIAL) { @@ -1435,7 +1435,7 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short str = "Type %t|+ X axis %x1|+ Y axis %x0|+ Z axis %x2|- X axis %x3|- Y axis %x4|- Z axis %x5"; uiDefButI(block, MENU, B_REDR, str, xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19, &raySens->axisflag, 2.0, 31, 0, 0, - "Specify along which axis the ray is cast."); + "Specify along which axis the ray is cast"); yco-= ysize; break; @@ -1482,7 +1482,7 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short str= "Type %t|Button %x0|Axis %x1|Single Axis %x3|Hat%x2"; uiDefButC(block, MENU, B_REDR, str, xco+87, yco-44, 0.26 * (width-20), 19, &joy->type, 0, 31, 0, 0, - "The type of event this joystick sensor is triggered on."); + "The type of event this joystick sensor is triggered on"); if (joy->type != SENS_JOY_AXIS_SINGLE) { if (joy->flag & SENS_JOY_ANY_EVENT) { @@ -1518,7 +1518,7 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short { uiDefButS(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19, &joy->axis, 1, 8.0, 100, 0, - "Specify which axis pair to use, 1 is useually the main direction input."); + "Specify which axis pair to use, 1 is useually the main direction input"); uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20),yco-44, 0.4 * (width-20), 19, &joy->precision, 0, 32768.0, 100, 0, @@ -1606,8 +1606,8 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco if(pc->mode==0) uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "", xco+90,yco-24,width-90, 19, &pc->text, "Blender textblock to run as a script"); else { - uiDefBut(block, TEX, 1, "", xco+90,yco-24,(width-90)-25, 19, pc->module, 0, 63, 0, 0, "Module name and function to run eg \"someModule.main\", internal texts external python files can be used"); - uiDefButBitI(block, TOG, CONT_PY_DEBUG, B_REDR, "D", (xco+width)-25, yco-24, 19, 19, &pc->flag, 0, 0, 0, 0, "Continuously reload the module from disk for editing external modules without restrting"); + uiDefBut(block, TEX, 1, "", xco+90,yco-24,(width-90)-25, 19, pc->module, 0, 63, 0, 0, "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used"); + uiDefButBitI(block, TOG, CONT_PY_DEBUG, B_REDR, "D", (xco+width)-25, yco-24, 19, 19, &pc->flag, 0, 0, 0, 0, "Continuously reload the module from disk for editing external modules without restarting"); } uiBlockEndAlign(block); @@ -1837,13 +1837,13 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh uiDefBut(block, LABEL, 0, "Ref", xco, yco-45, 45, 19, NULL, 0, 0, 0, 0, ""); uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+45, yco-45, wval*3, 19, &(oa->reference), "Reference object for velocity calculation, leave empty for world reference"); - uiDefBut(block, LABEL, 0, "linV", xco, yco-68, 45, 19, NULL, 0, 0, 0, 0, "Sets the target relative linear velocity, it will be achieve by automatic application of force. Null velocity is a valid target"); + uiDefBut(block, LABEL, 0, "linV", xco, yco-68, 45, 19, NULL, 0, 0, 0, 0, "Sets the target relative linear velocity, it will be achieved by automatic application of force. Null velocity is a valid target"); uiDefButF(block, NUM, 0, "", xco+45, yco-68, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, ""); uiDefButF(block, NUM, 0, "", xco+45+wval, yco-68, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, ""); uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-68, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, ""); uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-68, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Velocity is defined in local coordinates"); - uiDefBut(block, LABEL, 0, "Limit", xco, yco-91, 45, 19, NULL, 0, 0, 0, 0, "Select if the force need to be limited along certain axis (local or global depending on LinV Local flag)"); + uiDefBut(block, LABEL, 0, "Limit", xco, yco-91, 45, 19, NULL, 0, 0, 0, 0, "Select if the force needs to be limited along certain axis (local or global depending on LinV Local flag)"); uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_X, B_REDR, "X", xco+45, yco-91, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the X axis"); uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_Y, B_REDR, "Y", xco+45+wval, yco-91, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the Y axis"); uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_Z, B_REDR, "Z", xco+45+2*wval, yco-91, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the Z axis"); @@ -1911,8 +1911,8 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh } else { - uiDefButI(block, NUM, 0, "Sta: ",xco+10, yco-44, (width-20)/2, 19, &aa->sta, 0.0, MAXFRAMEF, 0, 0, "Start frame"); - uiDefButI(block, NUM, 0, "End: ",xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &aa->end, 0.0, MAXFRAMEF, 0, 0, "End frame"); + uiDefButI(block, NUM, 0, "Sta: ",xco+10, yco-44, (width-20)/2, 19, &aa->sta, 1.0, MAXFRAMEF, 0, 0, "Start frame"); + uiDefButI(block, NUM, 0, "End: ",xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &aa->end, 1.0, MAXFRAMEF, 0, 0, "End frame"); } uiDefButS(block, NUM, 0, "Blendin: ", xco+10, yco-64, (width-20)/2, 19, &aa->blendin, 0.0, 32767, 0.0, 0.0, "Number of frames of motion blending"); @@ -1963,7 +1963,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh uiDefButBitS(block, TOG, ACT_IPOLOCAL, 0, "L", xco+width-30, yco-24, 20, 19, &ia->flag, 0, 0, 0, 0, - "Let the ipo acts in local coordinates, used in Force and Add mode."); + "Let the ipo acts in local coordinates, used in Force and Add mode"); } if(ia->type==ACT_IPO_FROM_PROP) { @@ -1989,7 +1989,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh uiDefBut(block, TEX, 0, "FrameProp: ", xco+10, yco-64, width-20, 19, ia->frameProp, 0.0, 31.0, 0, 0, - "Assign this property this action current frame number"); + "Assign the action's current frame number to this property"); yco-= ysize; break; @@ -2133,16 +2133,16 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh wval= (width-60)/3; uiDefBut(block, LABEL, 0, "linV", xco, yco-68, 45, 19, NULL, 0, 0, 0, 0, - "Velocity upon creation."); + "Velocity upon creation"); uiDefButF(block, NUM, 0, "", xco+45, yco-68, wval, 19, eoa->linVelocity, -100.0, 100.0, 10, 0, - "Velocity upon creation, x component."); + "Velocity upon creation, x component"); uiDefButF(block, NUM, 0, "", xco+45+wval, yco-68, wval, 19, eoa->linVelocity+1, -100.0, 100.0, 10, 0, - "Velocity upon creation, y component."); + "Velocity upon creation, y component"); uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-68, wval, 19, eoa->linVelocity+2, -100.0, 100.0, 10, 0, - "Velocity upon creation, z component."); + "Velocity upon creation, z component"); uiDefButBitS(block, TOG, ACT_EDOB_LOCAL_LINV, 0, "L", xco+45+3*wval, yco-68, 15, 19, &eoa->localflag, 0.0, 0.0, 0, 0, "Apply the transformation locally"); @@ -2150,16 +2150,16 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh uiDefBut(block, LABEL, 0, "AngV", xco, yco-90, 45, 19, NULL, 0, 0, 0, 0, - "Angular velocity upon creation."); + "Angular velocity upon creation"); uiDefButF(block, NUM, 0, "", xco+45, yco-90, wval, 19, eoa->angVelocity, -10000.0, 10000.0, 10, 0, - "Angular velocity upon creation, x component."); + "Angular velocity upon creation, x component"); uiDefButF(block, NUM, 0, "", xco+45+wval, yco-90, wval, 19, eoa->angVelocity+1, -10000.0, 10000.0, 10, 0, - "Angular velocity upon creation, y component."); + "Angular velocity upon creation, y component"); uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-90, wval, 19, eoa->angVelocity+2, -10000.0, 10000.0, 10, 0, - "Angular velocity upon creation, z component."); + "Angular velocity upon creation, z component"); uiDefButBitS(block, TOG, ACT_EDOB_LOCAL_ANGV, 0, "L", xco+45+3*wval, yco-90, 15, 19, &eoa->localflag, 0.0, 0.0, 0, 0, "Apply the rotation locally"); @@ -2197,7 +2197,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh if(eoa->dyn_operation==4) { uiDefButF(block, NUM, 0, "", xco+40, yco-63, width-80, 19, &eoa->mass, 0.0, 10000.0, 10, 0, - "Mass for object."); + "Mass for object"); } } str= "Edit Object %t|Add Object %x0|End Object %x1|Replace Mesh %x2|Track to %x3|Dynamics %x4"; @@ -2577,9 +2577,9 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh "Always false or always true"); break; case ACT_RANDOM_BOOL_UNIFORM: - uiDefBut(block, LABEL, 0, " Do a 50-50 pick.", (xco+10), yco-64, (width-20), 19, + uiDefBut(block, LABEL, 0, " Do a 50-50 pick", (xco+10), yco-64, (width-20), 19, NULL, 0, 0, 0, 0, - "Choose between true and false, 50% chance each."); + "Choose between true and false, 50% chance each"); break; case ACT_RANDOM_BOOL_BERNOUILLI: uiDefButF(block, NUM, 1, "Chance", (xco+10), yco-64, (width-20), 19, @@ -2596,16 +2596,16 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh uiDefButI(block, NUM, 1, "Min: ", (xco+10), yco-64, (width-20)/2, 19, &randAct->int_arg_1, -1000, 1000, 0, 0, "Choose a number from a range. " - "Lower boundary of the range."); + "Lower boundary of the range"); uiDefButI(block, NUM, 1, "Max: ", (xco+10) + (width-20)/2, yco-64, (width-20)/2, 19, &randAct->int_arg_2, -1000, 1000, 0, 0, "Choose a number from a range. " - "Upper boundary of the range."); + "Upper boundary of the range"); break; case ACT_RANDOM_INT_POISSON: uiDefButF(block, NUM, 1, "Mean: ", (xco+10), yco-64, (width-20), 19, &randAct->float_arg_1, 0.01, 100.0, 0, 0, - "Expected mean value of the distribution."); + "Expected mean value of the distribution"); break; case ACT_RANDOM_FLOAT_CONST: uiDefButF(block, NUM, 1, "Value: ", (xco+10), yco-64, (width-20), 19, @@ -2615,26 +2615,26 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh case ACT_RANDOM_FLOAT_UNIFORM: uiDefButF(block, NUM, 1, "Min: ", (xco+10), yco-64, (width-20)/2, 19, &randAct->float_arg_1, -10000.0, 10000.0, 0, 0, - "Choose a number from a range. " - "Lower boundary of the range."); + "Choose a number from a range" + "Lower boundary of the range"); uiDefButF(block, NUM, 1, "Max: ", (xco+10) + (width-20)/2, yco-64, (width-20)/2, 19, &randAct->float_arg_2, -10000.0, 10000.0, 0, 0, - "Choose a number from a range. " - "Upper boundary of the range."); + "Choose a number from a range" + "Upper boundary of the range"); break; case ACT_RANDOM_FLOAT_NORMAL: uiDefButF(block, NUM, 1, "Mean: ", (xco+10), yco-64, (width-20)/2, 19, &randAct->float_arg_1, -10000.0, 10000.0, 0, 0, - "A normal distribution. Mean of the distribution."); + "A normal distribution. Mean of the distribution"); uiDefButF(block, NUM, 1, "SD: ", (xco+10) + (width-20)/2, yco-64, (width-20)/2, 19, &randAct->float_arg_2, 0.0, 10000.0, 0, 0, "A normal distribution. Standard deviation of the " - "distribution."); + "distribution"); break; case ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL: uiDefButF(block, NUM, 1, "Half-life time: ", (xco+10), yco-64, (width-20), 19, &randAct->float_arg_1, 0.001, 10000.0, 0, 0, - "Negative exponential dropoff."); + "Negative exponential dropoff"); break; default: ; /* don't know what this distro is... can be useful for testing */ @@ -2664,13 +2664,13 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh uiDefBut(block, TEX, 1, "Subject: ", (xco+10), (yco-(myline++*24)), (width-20), 19, &ma->subject, 0, 31, 0, 0, - "Optional message subject. This is what can be filtered on."); + "Optional message subject. This is what can be filtered on"); /* line 3: Text/Property */ uiDefButBitS(block, TOG, 1, B_REDR, "T/P", (xco+10),(yco-(myline*24)), (0.20 * (width-20)), 19, &ma->bodyType, 0.0, 0.0, 0, 0, - "Toggle message type: either Text or a PropertyName."); + "Toggle message type: either Text or a PropertyName"); if (ma->bodyType == ACT_MESG_MESG) { @@ -3040,13 +3040,13 @@ static void buttons_ketsji(uiBlock *block, Object *ob) if (ob->gameflag & OB_ANISOTROPIC_FRICTION) { uiDefButF(block, NUM, B_DIFF, "x friction:", 10, 125, 114, 19, &ob->anisotropicFriction[0], 0.0, 1.0, 10, 0, - "Relative friction coefficient in the x-direction."); + "Relative friction coefficient in the x-direction"); uiDefButF(block, NUM, B_DIFF, "y friction:", 124, 125, 113, 19, &ob->anisotropicFriction[1], 0.0, 1.0, 10, 0, - "Relative friction coefficient in the y-direction."); + "Relative friction coefficient in the y-direction"); uiDefButF(block, NUM, B_DIFF, "z friction:", 237, 125, 113, 19, &ob->anisotropicFriction[2], 0.0, 1.0, 10, 0, - "Relative friction coefficient in the z-direction."); + "Relative friction coefficient in the z-direction"); } } @@ -3143,10 +3143,10 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) "Enable cluster collision between soft and soft body"); yco -= 20; xco = 0; - uiDefButI(block, NUM, 0, "Cluster Iter.", + uiDefButI(block, NUM, 0, "Cluster Iter", xco, yco, 180, 19, &ob->bsoft->numclusteriterations, 1.0, 128., 0, 0, "Specify the number of cluster iterations"); - uiDefButI(block, NUM, 0, "Position Iter.", + uiDefButI(block, NUM, 0, "Position Iter", xco+=180, yco, 180, 19, &ob->bsoft->piterations, 0, 10, 0, 0, "Position solver iterations"); uiBlockEndAlign(block); @@ -3260,10 +3260,10 @@ static uiBlock *advanced_bullet_menu(void *arg_ob) "Enable cluster collision between soft and soft body"); yco -= 20; xco = 0; - uiDefButI(block, NUM, 0, "Cluster Iter.", + uiDefButI(block, NUM, 0, "Cluster Iter", xco, yco, 180, 19, &ob->bsoft->numclusteriterations, 1.0, 128., 0, 0, "Specify the number of cluster iterations"); - uiDefButI(block, NUM, 0, "Position Iter.", + uiDefButI(block, NUM, 0, "Position Iter", xco+=180, yco, 180, 19, &ob->bsoft->piterations, 0, 10, 0, 0, "Position solver iterations"); #define OB_LOCK_RIGID_BODY_X_AXIS 4 @@ -3424,7 +3424,7 @@ static void buttons_bullet(uiBlock *block, Object *ob) 120, 185, 110, 19, &ob->bsoft->flag, 0, 0, 0, 0, "Enable soft body shape matching goal"); - uiDefButBitI(block, TOG, OB_BSB_BENDING_CONSTRAINTS, 0, "Bending Const.", + uiDefButBitI(block, TOG, OB_BSB_BENDING_CONSTRAINTS, 0, "Bending Const", 230, 185, 120, 19, &ob->bsoft->flag, 0, 0, 0, 0, "Enable bending constraints"); @@ -3467,13 +3467,13 @@ static void buttons_bullet(uiBlock *block, Object *ob) if (ob->gameflag & OB_ANISOTROPIC_FRICTION) { uiDefButF(block, NUM, B_DIFF, "x friction:", 10, 125, 114, 19, &ob->anisotropicFriction[0], 0.0, 1.0, 10, 0, - "Relative friction coefficient in the x-direction."); + "Relative friction coefficient in the x-direction"); uiDefButF(block, NUM, B_DIFF, "y friction:", 124, 125, 113, 19, &ob->anisotropicFriction[1], 0.0, 1.0, 10, 0, - "Relative friction coefficient in the y-direction."); + "Relative friction coefficient in the y-direction"); uiDefButF(block, NUM, B_DIFF, "z friction:", 237, 125, 113, 19, &ob->anisotropicFriction[2], 0.0, 1.0, 10, 0, - "Relative friction coefficient in the z-direction."); + "Relative friction coefficient in the z-direction"); } @@ -3830,7 +3830,7 @@ void logic_buts(void) uiBlockSetEmboss(block, UI_EMBOSSM); uiDefIconButBitS(block, TOG, CONT_DEL, B_DEL_CONT, ICON_X, xco, yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Delete Controller"); uiDefIconButBitS(block, ICONTOG, CONT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Controller settings"); - uiDefIconButBitS(block, TOG, CONT_PRIO, B_REDR, ICON_BOOKMARKS, (short)(xco+width-66), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Bookmarl controller to run before all other non-bookmarked controllers"); + uiDefIconButBitS(block, TOG, CONT_PRIO, B_REDR, ICON_BOOKMARKS, (short)(xco+width-66), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Mark controller for execution before all non-marked controllers (good for startup scripts)"); uiBlockSetEmboss(block, UI_EMBOSSP); sprintf(name, "%d", first_bit(cont->state_mask)+1); uiDefBlockBut(block, controller_state_mask_menu, cont, name, (short)(xco+width-44), yco, 22, 19, "Set controller state index (from 1 to 30)"); -- cgit v1.2.3 From 4e0e720158d9aae16960a1b659def19d8d635b74 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 24 May 2009 19:54:35 +0000 Subject: == Sequencer == This fixes a stupid mistake in proxy handling with custom files: CFRA not calculated correctly for proxy... --- source/blender/src/sequence.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index e26df73b673..a6f264e2b09 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -1122,6 +1122,8 @@ static struct ImBuf * seq_proxy_fetch(Sequence * seq, int cfra) } if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { + TStripElem * tse = give_tstripelem(seq, cfra); + int frameno = tse->nr + seq->anim_startofs; if (!seq->strip->proxy->anim) { if (!seq_proxy_get_fname(seq, cfra, name)) { return 0; @@ -1132,7 +1134,8 @@ static struct ImBuf * seq_proxy_fetch(Sequence * seq, int cfra) if (!seq->strip->proxy->anim) { return 0; } - return IMB_anim_absolute(seq->strip->proxy->anim, cfra); + + return IMB_anim_absolute(seq->strip->proxy->anim, frameno); } if (!seq_proxy_get_fname(seq, cfra, name)) { -- cgit v1.2.3 From 323052068a8f0c35ec293ff3bd70989acfc6be8e Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 24 May 2009 23:12:38 +0000 Subject: VideoTexture: exception in C++ was not returning an error in Python. Added function name ini PyArg_ParseTuple. --- source/gameengine/VideoTexture/ImageBase.cpp | 8 ++++++-- source/gameengine/VideoTexture/ImageBuff.cpp | 3 +-- source/gameengine/VideoTexture/ImageMix.cpp | 8 ++++++-- source/gameengine/VideoTexture/Texture.cpp | 4 ++-- source/gameengine/VideoTexture/VideoFFmpeg.cpp | 7 ++++--- source/gameengine/VideoTexture/blendVideoTex.cpp | 4 ++-- 6 files changed, 21 insertions(+), 13 deletions(-) (limited to 'source') diff --git a/source/gameengine/VideoTexture/ImageBase.cpp b/source/gameengine/VideoTexture/ImageBase.cpp index dcca20de24a..5e2841271a6 100644 --- a/source/gameengine/VideoTexture/ImageBase.cpp +++ b/source/gameengine/VideoTexture/ImageBase.cpp @@ -437,7 +437,9 @@ PyObject * Image_getSource (PyImage * self, PyObject * args) { // get arguments char * id; - if (self->m_image != NULL && PyArg_ParseTuple(args, "s", &id)) + if (!PyArg_ParseTuple(args, "s:getSource", &id)) + return NULL; + if (self->m_image != NULL) { // get source object PyObject * src = reinterpret_cast(self->m_image->getSource(id)); @@ -460,7 +462,9 @@ PyObject * Image_setSource (PyImage * self, PyObject * args) // get arguments char * id; PyObject * obj; - if (self->m_image != NULL && PyArg_ParseTuple(args, "sO", &id, &obj)) + if (!PyArg_ParseTuple(args, "sO:setSource", &id, &obj)) + return NULL; + if (self->m_image != NULL) { // check type of object if (pyImageTypes.in(obj->ob_type)) diff --git a/source/gameengine/VideoTexture/ImageBuff.cpp b/source/gameengine/VideoTexture/ImageBuff.cpp index c8e62aff240..c7185660e83 100644 --- a/source/gameengine/VideoTexture/ImageBuff.cpp +++ b/source/gameengine/VideoTexture/ImageBuff.cpp @@ -71,10 +71,9 @@ static PyObject * load (PyImage * self, PyObject * args) short width; short height; // parse parameters - if (!PyArg_ParseTuple(args, "s#hh", &buff, &buffSize, &width, &height)) + if (!PyArg_ParseTuple(args, "s#hh:load", &buff, &buffSize, &width, &height)) { // report error - PyErr_SetString(PyExc_TypeError, "Parameters are not correct"); return NULL; } // else check buffer size diff --git a/source/gameengine/VideoTexture/ImageMix.cpp b/source/gameengine/VideoTexture/ImageMix.cpp index 2418ba254e4..067143e57bb 100644 --- a/source/gameengine/VideoTexture/ImageMix.cpp +++ b/source/gameengine/VideoTexture/ImageMix.cpp @@ -109,7 +109,9 @@ PyObject * getWeight (PyImage * self, PyObject * args) short weight = 0; // get arguments char * id; - if (self->m_image != NULL && PyArg_ParseTuple(args, "s", &id)) + if (!PyArg_ParseTuple(args, "s:getWeight", &id)) + return NULL; + if (self->m_image != NULL) // get weight weight = getImageMix(self)->getWeight(id); // return weight @@ -123,7 +125,9 @@ PyObject * setWeight (PyImage * self, PyObject * args) // get arguments char * id; short weight = 0; - if (self->m_image != NULL && PyArg_ParseTuple(args, "sh", &id, &weight)) + if (!PyArg_ParseTuple(args, "sh:setWeight", &id, &weight)) + return NULL; + if (self->m_image != NULL) // set weight if (!getImageMix(self)->setWeight(id, weight)) { diff --git a/source/gameengine/VideoTexture/Texture.cpp b/source/gameengine/VideoTexture/Texture.cpp index a8ece4bc17e..51d96d7596e 100644 --- a/source/gameengine/VideoTexture/Texture.cpp +++ b/source/gameengine/VideoTexture/Texture.cpp @@ -51,7 +51,7 @@ http://www.gnu.org/copyleft/lesser.txt. // macro for exception handling and logging #define CATCH_EXCP catch (Exception & exp) \ -{ exp.report(); } +{ exp.report(); return NULL; } // Blender GameObject type @@ -280,7 +280,7 @@ PyObject * Texture_refresh (Texture * self, PyObject * args) { // get parameter - refresh source PyObject * param; - if (!PyArg_ParseTuple(args, "O", ¶m) || !PyBool_Check(param)) + if (!PyArg_ParseTuple(args, "O:refresh", ¶m) || !PyBool_Check(param)) { // report error PyErr_SetString(PyExc_TypeError, "The value must be a bool"); diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp index 08c02628f05..d509f366910 100644 --- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp +++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp @@ -1178,7 +1178,7 @@ static int ImageFFmpeg_init (PyObject * pySelf, PyObject * args, PyObject * kwds char * file = NULL; // get parameters - if (!PyArg_ParseTuple(args, "s", &file)) + if (!PyArg_ParseTuple(args, "s:ImageFFmpeg", &file)) return -1; try @@ -1203,8 +1203,9 @@ static int ImageFFmpeg_init (PyObject * pySelf, PyObject * args, PyObject * kwds PyObject * Image_reload (PyImage * self, PyObject *args) { char * newname = NULL; - - if (self->m_image != NULL && PyArg_ParseTuple(args, "|s", &newname)) + if (!PyArg_ParseTuple(args, "|s:reload", &newname)) + return NULL; + if (self->m_image != NULL) { VideoFFmpeg* video = getFFmpeg(self); // check type of object diff --git a/source/gameengine/VideoTexture/blendVideoTex.cpp b/source/gameengine/VideoTexture/blendVideoTex.cpp index 239f43763b8..1dcc72c8f7d 100644 --- a/source/gameengine/VideoTexture/blendVideoTex.cpp +++ b/source/gameengine/VideoTexture/blendVideoTex.cpp @@ -74,7 +74,7 @@ static PyObject * getLastError (PyObject *self, PyObject *args) static PyObject * setLogFile (PyObject *self, PyObject *args) { // get parameters - if (!PyArg_ParseTuple(args, "s", &Exception::m_logFile)) + if (!PyArg_ParseTuple(args, "s:setLogFile", &Exception::m_logFile)) return Py_BuildValue("i", -1); // log file was loaded return Py_BuildValue("i", 0); @@ -86,7 +86,7 @@ static PyObject * imageToArray (PyObject * self, PyObject *args) { // parameter is Image object PyObject * pyImg; - if (!PyArg_ParseTuple(args, "O", &pyImg) || !pyImageTypes.in(pyImg->ob_type)) + if (!PyArg_ParseTuple(args, "O:imageToArray", &pyImg) || !pyImageTypes.in(pyImg->ob_type)) { // if object is incorect, report error PyErr_SetString(PyExc_TypeError, "VideoTexture.imageToArray(image): The value must be a image source object"); -- cgit v1.2.3 From fe85bdd0401e92e82e39461d023bad34fe056c38 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 24 May 2009 23:43:10 +0000 Subject: - BGE Py API, any py function/attribute that took a KX_GameObject would not accept a KX_Light or KX_Camera (bad oversight on my part) - Typo in occlusion variable init "m_buffer == NULL;" -> "m_buffer = NULL;" CcdPhysicsEnvironment.cpp and CcdPhysicsController.cpp had too many warnings, fixed most of them. --- source/gameengine/Ketsji/KX_GameObject.cpp | 8 +++++++- .../gameengine/Physics/Bullet/CcdPhysicsController.cpp | 16 ++++++---------- .../gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp | 16 ++++------------ 3 files changed, 17 insertions(+), 23 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 3740972ba29..f1c3fb89df2 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -49,6 +49,8 @@ typedef unsigned long uint_ptr; #include "RAS_IPolygonMaterial.h" #include "KX_BlenderMaterial.h" #include "KX_GameObject.h" +#include "KX_Camera.h" // only for their ::Type +#include "KX_Light.h" // only for their ::Type #include "RAS_MeshObject.h" #include "KX_MeshProxy.h" #include "KX_PolyProxy.h" @@ -2757,6 +2759,7 @@ void KX_GameObject::Relink(GEN_Map *map_parameter) } } + bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py_none_ok, const char *error_prefix) { if (value==NULL) { @@ -2787,7 +2790,10 @@ bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py } } - if (PyObject_TypeCheck(value, &KX_GameObject::Type)) { + if ( PyObject_TypeCheck(value, &KX_GameObject::Type) || + PyObject_TypeCheck(value, &KX_LightObject::Type) || + PyObject_TypeCheck(value, &KX_Camera::Type) ) + { *object = static_castBGE_PROXY_REF(value); /* sets the error */ diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 710d0656f6d..9a5f9644a47 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -185,12 +185,12 @@ void CcdPhysicsController::CreateRigidbody() rbci.m_restitution = m_cci.m_restitution; - int nodecount = 0; + + - int numtriangles = 1; btVector3 p(0,0,0);// = getOrigin(); - btScalar h = 1.f; + btSoftRigidDynamicsWorld* softDynaWorld = (btSoftRigidDynamicsWorld*)m_cci.m_physicsEnv->getDynamicsWorld(); @@ -794,7 +794,7 @@ void CcdPhysicsController::RelativeTranslate(float dlocX,float dlocY,float dloc m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); } - btRigidBody* body = GetRigidBody(); + // btRigidBody* body = GetRigidBody(); // not used anymore btVector3 dloc(dlocX,dlocY,dlocZ); btTransform xform = m_object->getWorldTransform(); @@ -1388,8 +1388,6 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject* meshobj, DerivedMesh* dm, /* Convert blender geometry into bullet mesh, need these vars for mapping */ vector vert_tag_array(numverts, false); unsigned int tot_bt_verts= 0; - unsigned int orig_index; - int i; if (polytope) { @@ -1609,9 +1607,7 @@ bool CcdShapeConstructionInfo::SetProxy(CcdShapeConstructionInfo* shapeInfo) btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape(btScalar margin) { btCollisionShape* collisionShape = 0; - btTriangleMeshShape* concaveShape = 0; - btCompoundShape* compoundShape = 0; - CcdShapeConstructionInfo* nextShapeInfo; + btCompoundShape* compoundShape = 0; if (m_shapeType == PHY_SHAPE_PROXY && m_shapeProxy != NULL) return m_shapeProxy->CreateBulletShape(margin); @@ -1684,7 +1680,7 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape(btScalar margin) collisionMeshData->m_weldingThreshold = m_weldingThreshold1; bool removeDuplicateVertices=true; // m_vertexArray not in multiple of 3 anymore, use m_triFaceArray - for(int i=0; i(rayResult.m_collisionObject->getUserPointer()); + //CcdPhysicsController* curHit = static_cast(rayResult.m_collisionObject->getUserPointer()); // save shape information as ClosestRayResultCallback::AddSingleResult() does not do it if (rayResult.m_localShapeInfo) { @@ -1021,10 +1021,6 @@ struct FilterClosestRayResultCallback : public btCollisionWorld::ClosestRayResul PHY_IPhysicsController* CcdPhysicsEnvironment::rayTest(PHY_IRayCastFilterCallback &filterCallback, float fromX,float fromY,float fromZ, float toX,float toY,float toZ) { - - - float minFraction = 1.f; - btVector3 rayFrom(fromX,fromY,fromZ); btVector3 rayTo(toX,toY,toZ); @@ -1174,7 +1170,7 @@ struct OcclusionBuffer { m_initialized=false; m_occlusion = false; - m_buffer == NULL; + m_buffer = NULL; m_bufferSize = 0; } // multiplication of column major matrices: m=m1*m2 @@ -1282,8 +1278,7 @@ struct OcclusionBuffer static bool project(btVector4* p,int n) { for(int i=0;igetDebugMode() & btIDebugDraw::DBG_DrawContactPoints))) { //walk over all overlapping pairs, and if one of the involved bodies is registered for trigger callback, perform callback -- cgit v1.2.3 From b7653ba5421a245957ac6170f0bbca0589220bae Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 May 2009 00:31:41 +0000 Subject: missing null check, would crash blender when loading some files --- source/blender/blenloader/intern/readfile.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d9df1ee4419..3284f8efdf2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8116,11 +8116,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* check if top parent has compound shape set and if yes, set this object to compound shaper as well (was the behaviour before, now it's optional) */ Object *parent= newlibadr(fd, lib, ob->parent); - while (parent->parent != NULL) { - parent = newlibadr(fd, lib, parent->parent); + if(parent) { + while (parent->parent != NULL) { + parent = newlibadr(fd, lib, parent->parent); + } + if (parent->gameflag & OB_CHILD) + ob->gameflag |= OB_CHILD; } - if (parent->gameflag & OB_CHILD) - ob->gameflag |= OB_CHILD; } } for(wrld=main->world.first; wrld; wrld= wrld->id.next) { -- cgit v1.2.3 From 1266e0f2bffb95a59157075f9f4f071dcc744f73 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 May 2009 01:00:17 +0000 Subject: quick fix still allowed for possible crash, check for valid newlibadr return value in the while loop. --- source/blender/blenloader/intern/readfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 3284f8efdf2..abfb8ebd04c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8116,10 +8116,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* check if top parent has compound shape set and if yes, set this object to compound shaper as well (was the behaviour before, now it's optional) */ Object *parent= newlibadr(fd, lib, ob->parent); + while (parent && parent->parent != NULL) { + parent = newlibadr(fd, lib, parent->parent); + } if(parent) { - while (parent->parent != NULL) { - parent = newlibadr(fd, lib, parent->parent); - } if (parent->gameflag & OB_CHILD) ob->gameflag |= OB_CHILD; } -- cgit v1.2.3 From 3ceed4cfb207e06c978d49f2992f8a19970cab22 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 May 2009 01:45:35 +0000 Subject: [#18731] trouble with the python api in assigning script constraint's target. - Setting the constraint script from python didnt update the target count - Setting objects didnt work at all, since it checked the input sequence for being an BPy_Object type (rather then an item in the sequence) --- source/blender/python/api2_2x/Constraint.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Constraint.c b/source/blender/python/api2_2x/Constraint.c index 9ecec8eb973..ae96627cc2f 100644 --- a/source/blender/python/api2_2x/Constraint.c +++ b/source/blender/python/api2_2x/Constraint.c @@ -52,6 +52,7 @@ #include "blendef.h" #include "mydevice.h" +#include "../BPY_extern.h" // BPY_pyconstraint_update #include "IDProp.h" #include "Object.h" #include "NLA.h" @@ -1498,6 +1499,11 @@ static int script_setter( BPy_Constraint *self, int type, PyObject *value ) bConstraintTarget *ct; int ok= 0; + if (PySequence_Check(value) == 0 || PyString_Check(value)) { + PyErr_SetString(PyExc_TypeError, "expected a sequence of strings or blender"); + return -1; + } + if (cti) { /* change space of targets */ if (cti->get_constraint_targets) { @@ -1506,13 +1512,12 @@ static int script_setter( BPy_Constraint *self, int type, PyObject *value ) /* get targets, and extract values from the given list */ num_tars= cti->get_constraint_targets(self->con, &targets); + if ((PySequence_Size(value) != num_tars)) { + PyErr_Format(PyExc_TypeError, "expected sequence of strings or blender objects - %d length", num_tars); + return -1; + } + if (num_tars) { - if ((PySequence_Check(value) == 0) || (PySequence_Size(value) != num_tars)) { - char errorstr[64]; - sprintf(errorstr, "expected sequence of %d integer(s)", num_tars); - return EXPP_ReturnIntError(PyExc_TypeError, errorstr); - } - for (ct=targets.first; ct; ct=ct->next, i++) { PyObject *val= PySequence_ITEM(value, i); @@ -1530,10 +1535,11 @@ static int script_setter( BPy_Constraint *self, int type, PyObject *value ) BLI_strncpy(ct->subtarget, name, sizeof(ct->subtarget)); } - else { + else /* if EXPP_CONSTR_TARGET */ { + Object *obj = (( BPy_Object * )val)->object; - if ( !BPy_Object_Check(value) ) { + if ( !BPy_Object_Check(val) ) { // hrm... should we break here instead? ok = EXPP_ReturnIntError(PyExc_TypeError, "expected BPy object argument as member of list"); @@ -1564,6 +1570,7 @@ static int script_setter( BPy_Constraint *self, int type, PyObject *value ) return EXPP_ReturnIntError( PyExc_TypeError, "expected BPy text argument" ); con->text = text; + BPY_pyconstraint_update(self->obj, self->con); return 0; } case EXPP_CONSTR_PROPS: -- cgit v1.2.3 From 1af059b642c94b44e7d09c1546e583659775ceb8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 May 2009 02:11:18 +0000 Subject: [#18808] Unstable results of Pack Margin in UV editor was scaling the margin by the area twice --- source/blender/src/parametrizer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/src/parametrizer.c b/source/blender/src/parametrizer.c index feb774b604a..46218ec921b 100644 --- a/source/blender/src/parametrizer.c +++ b/source/blender/src/parametrizer.c @@ -4188,11 +4188,11 @@ void param_pack(ParamHandle *handle, float margin) } box = boxarray+(i-unpacked); - trans[0] = margin * area; - trans[1] = margin * area; + trans[0] = margin; + trans[1] = margin; p_chart_uv_translate(chart, trans); - box->w += (margin * area) *2; - box->h += (margin * area) *2; + box->w += margin*2; + box->h += margin*2; } } -- cgit v1.2.3 From 3053ce1a8c93480d6412386c0afe11fac4c27f9c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 May 2009 02:39:05 +0000 Subject: [#18819] save and load globalDictionary actuators don't load the proper files in 2.49 RC3 For this actuator to be useful it needs to use the first opened blendfile as the base name for the configuration file. A recent fix that made the gp_GamePythonPath always match the current loaded blend file made this actuator work differently. keep the original filename to use for making the config name so you can load the config between loading blendfiles. --- source/gameengine/Ketsji/KX_PythonInit.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 3626d7baa9a..7c131d01cd1 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -120,6 +120,7 @@ static KX_Scene* gp_KetsjiScene = NULL; static KX_KetsjiEngine* gp_KetsjiEngine = NULL; static RAS_IRasterizer* gp_Rasterizer = NULL; static char gp_GamePythonPath[FILE_MAXDIR + FILE_MAXFILE] = ""; +static char gp_GamePythonPathOrig[FILE_MAXDIR + FILE_MAXFILE] = ""; // not super happy about this, but we need to remember the first loaded file for the global/dict load save static PyObject *gp_OrigPythonSysPath= NULL; void KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,const MT_Vector3& color) @@ -2096,9 +2097,9 @@ int loadGamePythonConfig(char *marshal_buffer, int marshal_length) void pathGamePythonConfig( char *path ) { - int len = strlen(gp_GamePythonPath); + int len = strlen(gp_GamePythonPathOrig); // Always use the first loaded blend filename - BLI_strncpy(path, gp_GamePythonPath, sizeof(gp_GamePythonPath)); + BLI_strncpy(path, gp_GamePythonPathOrig, sizeof(gp_GamePythonPathOrig)); /* replace extension */ if (BLI_testextensie(path, ".blend")) { @@ -2111,5 +2112,8 @@ void pathGamePythonConfig( char *path ) void setGamePythonPath(char *path) { BLI_strncpy(gp_GamePythonPath, path, sizeof(gp_GamePythonPath)); + + if (gp_GamePythonPathOrig[0] == '\0') + BLI_strncpy(gp_GamePythonPathOrig, path, sizeof(gp_GamePythonPathOrig)); } -- cgit v1.2.3 From 2a9d9605d08e2521b2c6aadafe8294e1eed78fc3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 May 2009 03:06:03 +0000 Subject: Pressing the '~' key in the ipo view didnt store the view state in the ipo curves as clicking on the ipo channel names does. --- source/blender/src/header_ipo.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source') diff --git a/source/blender/src/header_ipo.c b/source/blender/src/header_ipo.c index 27549a5b502..3ef76c31e53 100644 --- a/source/blender/src/header_ipo.c +++ b/source/blender/src/header_ipo.c @@ -1216,6 +1216,8 @@ void do_ipo_buttons(short event) if (ei->icu) ei->flag |= IPO_VISIBLE; else ei->flag &= ~IPO_VISIBLE; } + update_editipo_flags(); + break; case B_IPOREDRAW: DAG_object_flush_update(G.scene, ob, OB_RECALC); -- cgit v1.2.3 From 2fa8504dd104e0bde32ee487f97fbce4fd6d7104 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 May 2009 06:24:23 +0000 Subject: BGE Joystick Hat Bugfix bug reported by blenderage on blenderartist (found other bugs too). - "All Hat Events" didnt work. - Multiple hats didnt work - use a menu with direction names rather then have the user guess. disallow zero as a direction. - Allow up to 4 hats (was 2). - Python api was clamping the axis to 2, maximum is currently JOYAXIS_MAX - 16 - New python attributes hatValues and hatSingle, match axis functions. - Use SDL Axis events to fill in the axis and hat array rather then filling in every axis with SDL_JoystickGetAxis for each axis event. --- source/blender/src/buttons_logic.c | 13 +++--- .../gameengine/GameLogic/Joystick/SCA_Joystick.cpp | 34 +++++--------- .../gameengine/GameLogic/Joystick/SCA_Joystick.h | 44 ++++-------------- .../GameLogic/Joystick/SCA_JoystickDefines.h | 1 + .../GameLogic/Joystick/SCA_JoystickEvents.cpp | 13 +++--- source/gameengine/GameLogic/SCA_JoystickSensor.cpp | 52 +++++++++++++--------- source/gameengine/GameLogic/SCA_JoystickSensor.h | 17 ++++--- source/gameengine/PyDoc/GameTypes.py | 25 +++++++++-- 8 files changed, 99 insertions(+), 100 deletions(-) (limited to 'source') diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index b8c851f5ab8..25bed178130 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -1534,13 +1534,14 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short else if (joy->type == SENS_JOY_HAT) { uiDefButI(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19, - &joy->hat, 1, 2.0, 100, 0, + &joy->hat, 1, 4.0, 100, 0, "Specify which hat to use"); if ((joy->flag & SENS_JOY_ANY_EVENT)==0) { - uiDefButI(block, NUM, 1, "Direction:", xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19, - &joy->hatf, 0, 12, 100, 0, - "Specify hat direction"); + str = "Direction%t|Up%x1|Down%x4|Left%x8|Right%x2|%l|Up/Right%x3|Down/Left%x12|Up/Left%x9|Down/Right%x6"; + uiDefButI(block, MENU, B_NOP, str, xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19, + &joy->hatf, 2.0, 31, 0, 0, + "The direction of the hat, use 'All Events' to recieve events on any direction"); } } else { /* (joy->type == SENS_JOY_AXIS_SINGLE)*/ @@ -2752,12 +2753,12 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+40, yco-44, (width-80), 19, &(parAct->ob), "Set this object as parent"); uiBlockBeginAlign(block); - uiDefButBitI(block, TOGN, ACT_PARENT_COMPOUND, B_REDR, + uiDefButBitS(block, TOGN, ACT_PARENT_COMPOUND, B_REDR, "Compound", xco + 40, yco - 64, (width - 80)/2, 19, &parAct->flag, 0.0, 0.0, 0, 0, "Add this object shape to the parent shape (only if the parent shape is already compound)"); - uiDefButBitI(block, TOGN, ACT_PARENT_GHOST, B_REDR, + uiDefButBitS(block, TOGN, ACT_PARENT_GHOST, B_REDR, "Ghost", xco + 40 + ((width - 80)/2), yco - 64, (width - 80)/2, 19, &parAct->flag, 0.0, 0.0, 0, 0, diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp index b19424f20e9..7c4ebb4c330 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp @@ -42,7 +42,6 @@ SCA_Joystick::SCA_Joystick(short int index) m_axismax(-1), m_buttonmax(-1), m_hatmax(-1), - m_hatdir(-2), m_isinit(0), m_istrig_axis(0), m_istrig_button(0), @@ -50,6 +49,10 @@ SCA_Joystick::SCA_Joystick(short int index) { for(int i=0; i JOYAXIS_MAX) m_axismax= JOYAXIS_MAX; /* very unlikely */ else if (m_axismax < 0) m_axismax = 0; + if (m_hatmax > JOYHAT_MAX) m_hatmax= JOYHAT_MAX; /* very unlikely */ + else if(m_hatmax<0) m_hatmax= 0; + if(m_buttonmax<0) m_buttonmax= 0; - if(m_hatmax<0) m_hatmax= 0; + } return true; #endif @@ -278,15 +273,6 @@ int SCA_Joystick::Connected(void) return 0; } -void SCA_Joystick::pFillAxes() -{ -#ifndef DISABLE_SDL - for(int i=0; im_joystick, i); -#endif -} - - int SCA_Joystick::pGetAxis(int axisnum, int udlr) { #ifndef DISABLE_SDL diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h index 53cd65cd495..5822f8e8ff8 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h @@ -53,28 +53,20 @@ class SCA_Joystick int m_joyindex; /* - *support for 2 axes + *support for JOYAXIS_MAX axes (in pairs) */ int m_axis_array[JOYAXIS_MAX]; + + /* + *support for JOYHAT_MAX hats (each is a direction) + */ + int m_hat_array[JOYHAT_MAX]; /* * Precision or range of the axes */ int m_prec; - /* - * multiple axis values stored here - */ - int m_axisnum; - int m_axisvalue; - - /* - * max # of axes avail - */ - /*disabled - int m_axismax; - */ - /* * button values stored here */ @@ -88,18 +80,6 @@ class SCA_Joystick int m_buttonmax; int m_hatmax; - /* - * hat values stored here - */ - int m_hatnum; - int m_hatdir; - - /* - - * max # of hats avail - disabled - int m_hatmax; - */ /* is the joystick initialized ?*/ bool m_isinit; @@ -136,7 +116,6 @@ class SCA_Joystick /* * fills the axis mnember values */ - void pFillAxes(void); void pFillButtons(void); /* @@ -149,11 +128,6 @@ class SCA_Joystick */ int pGetAxis(int axisnum, int udlr); - /* - * gets the current hat direction - */ - int pGetHat(int direction); - SCA_Joystick(short int index); ~SCA_Joystick(); @@ -175,7 +149,7 @@ public: bool aAnyButtonReleaseIsPositive(void); bool aButtonPressIsPositive(int button); bool aButtonReleaseIsPositive(int button); - bool aHatIsPositive(int dir); + bool aHatIsPositive(int hatnum, int dir); /* * precision is default '3200' which is overridden by input @@ -191,8 +165,8 @@ public: return m_buttonnum; } - int GetHat(void){ - return m_hatdir; + int GetHat(int index){ + return m_hat_array[index]; } int GetThreshold(void){ diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h b/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h index 636c4dd5a42..c7a9a5114df 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h +++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h @@ -40,6 +40,7 @@ #define JOYINDEX_MAX 8 #define JOYAXIS_MAX 16 +#define JOYHAT_MAX 4 #define JOYAXIS_RIGHT 0 #define JOYAXIS_UP 1 diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp index 8e190060e95..3ca8d7d2329 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp @@ -35,17 +35,20 @@ #ifndef DISABLE_SDL void SCA_Joystick::OnAxisMotion(SDL_Event* sdl_event) { - pFillAxes(); - m_axisnum = sdl_event->jaxis.axis; - m_axisvalue = sdl_event->jaxis.value; + if(sdl_event->jaxis.axis >= JOYAXIS_MAX) + return; + + m_axis_array[sdl_event->jaxis.axis]= sdl_event->jaxis.value; m_istrig_axis = 1; } void SCA_Joystick::OnHatMotion(SDL_Event* sdl_event) { - m_hatdir = sdl_event->jhat.value; - m_hatnum = sdl_event->jhat.hat; + if(sdl_event->jhat.hat >= JOYAXIS_MAX) + return; + + m_hat_array[sdl_event->jhat.hat]= sdl_event->jhat.value; m_istrig_hat = 1; } diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index 906d454b728..16061d6fb6e 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -198,33 +198,20 @@ bool SCA_JoystickSensor::Evaluate() case KX_JOYSENSORMODE_HAT: { /* what is what! - numberof = m_hat -- max 2 + numberof = m_hat -- max 4 direction= m_hatf -- max 12 */ if (!js->IsTrigHat() && !reset) /* No events from SDL? - dont bother */ return false; - if(m_hat == 1){ - if(js->aHatIsPositive(m_hatf)){ - m_istrig = 1; - result = true; - }else{ - if(m_istrig){ - m_istrig = 0; - result = true; - } - } - } - if(m_hat == 2){ - if(js->aHatIsPositive(m_hatf)){ - m_istrig = 1; + if((m_bAllEvents && js->GetHat(m_hat-1)) || js->aHatIsPositive(m_hat-1, m_hatf)) { + m_istrig = 1; + result = true; + }else{ + if(m_istrig){ + m_istrig = 0; result = true; - }else{ - if(m_istrig){ - m_istrig = 0; - result = true; - } } } break; @@ -331,6 +318,8 @@ PyAttributeDef SCA_JoystickSensor::Attributes[] = { KX_PYATTRIBUTE_INT_LIST_RW_CHECK("hat",0,12,true,SCA_JoystickSensor,m_hat,2,CheckHat), KX_PYATTRIBUTE_RO_FUNCTION("axisValues", SCA_JoystickSensor, pyattr_get_axis_values), KX_PYATTRIBUTE_RO_FUNCTION("axisSingle", SCA_JoystickSensor, pyattr_get_axis_single), + KX_PYATTRIBUTE_RO_FUNCTION("hatValues", SCA_JoystickSensor, pyattr_get_hat_values), + KX_PYATTRIBUTE_RO_FUNCTION("hatSingle", SCA_JoystickSensor, pyattr_get_hat_single), KX_PYATTRIBUTE_RO_FUNCTION("numAxis", SCA_JoystickSensor, pyattr_get_num_axis), KX_PYATTRIBUTE_RO_FUNCTION("numButtons", SCA_JoystickSensor, pyattr_get_num_buttons), KX_PYATTRIBUTE_RO_FUNCTION("numHats", SCA_JoystickSensor, pyattr_get_num_hats), @@ -617,6 +606,29 @@ PyObject* SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYAT return PyInt_FromLong(joy->GetAxisPosition(self->m_axis-1)); } +PyObject* SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + SCA_JoystickSensor* self= static_cast(self_v); + SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); + + int hat_index= joy->GetNumberOfHats(); + PyObject *list= PyList_New(hat_index); + + while(hat_index--) { + PyList_SET_ITEM(list, hat_index, PyInt_FromLong(joy->GetHat(hat_index))); + } + + return list; +} + +PyObject* SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + SCA_JoystickSensor* self= static_cast(self_v); + SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); + + return PyInt_FromLong(joy->GetHat(self->m_hat-1)); +} + PyObject* SCA_JoystickSensor::pyattr_get_num_axis(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.h b/source/gameengine/GameLogic/SCA_JoystickSensor.h index e8185d1911e..e6a1d2eef32 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.h +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.h @@ -30,6 +30,7 @@ #define __JOYSENSOR_H #include "SCA_ISensor.h" +#include "./Joystick/SCA_JoystickDefines.h" class SCA_JoystickSensor :public SCA_ISensor { @@ -37,7 +38,7 @@ class SCA_JoystickSensor :public SCA_ISensor class SCA_JoystickManager* m_pJoystickMgr; /** - * Axis 1-or-2, MUST be followed by m_axisf + * Axis 1-JOYAXIS_MAX, MUST be followed by m_axisf */ int m_axis; /** @@ -53,11 +54,11 @@ class SCA_JoystickSensor :public SCA_ISensor */ int m_buttonf; /** - * The actual hat. MUST be followed by m_hatf + * The actual hat 1-JOYHAT_MAX. MUST be followed by m_hatf */ int m_hat; /** - * Flag to find direction 0-11, MUST be an int + * Flag to find direction 1-12, MUST be an int */ int m_hatf; /** @@ -152,6 +153,8 @@ public: static PyObject* pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_axis_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_hat_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject* pyattr_get_hat_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_num_axis(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_num_buttons(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_num_hats(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); @@ -164,8 +167,8 @@ public: SCA_JoystickSensor* sensor = reinterpret_cast(self); if (sensor->m_axis < 1) sensor->m_axis = 1; - else if (sensor->m_axis > 2) - sensor->m_axis = 2; + else if (sensor->m_axis > JOYAXIS_MAX) + sensor->m_axis = JOYAXIS_MAX; return 0; } static int CheckHat(void *self, const PyAttributeDef*) @@ -173,8 +176,8 @@ public: SCA_JoystickSensor* sensor = reinterpret_cast(self); if (sensor->m_hat < 1) sensor->m_hat = 1; - else if (sensor->m_hat > 2) - sensor->m_hat = 2; + else if (sensor->m_hat > JOYHAT_MAX) + sensor->m_hat = JOYHAT_MAX; return 0; } diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index 8a590a48c9e..ca9c674a942 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -47,6 +47,7 @@ class CValue(PyObjectPlus): This class is a basis for other classes. @ivar name: The name of this CValue derived object (read-only). @type name: string + @group Deprecated: getName """ def getName(): """ @@ -259,7 +260,7 @@ class SCA_IController(SCA_ILogicBrick): @type actuators: sequence supporting index/string lookups and iteration. @ivar bookmark: the bookmark option. If set, the controller executes always before all other non-bookmarked controllers. - - note: Order of execution between bookmarked controllers is not guaranteed. + note: Order of execution between bookmarked controllers is not guaranteed. @type bookmark: bool """ #{ Deprecated @@ -4741,6 +4742,24 @@ class SCA_JoystickSensor(SCA_ISensor): Only use this for "Single Axis" type sensors otherwise it will raise an error. @type axisSingle: int + @ivar hatValues: (read-only) The state of the joysticks hats as a list of values L{numHats} long. + each spesifying the direction of the hat from 1 to 12, 0 when inactive. + Hat directions are as follows... + - 0:None + - 1:Up + - 2:Right + - 4:Down + - 8:Left + - 3:Up - Right + - 6:Down - Right + - 12:Down - Left + - 9:Up - Left + + @type hatValues: list of ints + + @ivar hatSingle: (read-only) like L{hatValues} but returns a single hat direction value that is set by the sensor. + @type hatSingle: int + @ivar numAxis: (read-only) The number of axes for the joystick at this index. @type numAxis: integer @ivar numButtons: (read-only) The number of buttons for the joystick at this index. @@ -4760,8 +4779,8 @@ class SCA_JoystickSensor(SCA_ISensor): axisDirection: 0=right, 1=up, 2=left, 3=down @type axis: [integer, integer] @ivar hat: The hat the sensor reacts to, as a list of two values: [hatIndex, hatDirection] - hatIndex: the hat index to use when detecting hat movement, 1=primary hat, 2=secondary hat. - hatDirection: 0-11 + hatIndex: the hat index to use when detecting hat movement, 1=primary hat, 2=secondary hat (4 max). + hatDirection: 1-12 @type hat: [integer, integer] """ -- cgit v1.2.3 From ca8497d001417ec110982b0d6ce7264da50e2b6d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 May 2009 11:39:09 +0000 Subject: * UI tweaks to python controller (more space for module name), setParent actuator use less space * object_drop.py - option to orient to face normal (useful for scattering objects over terrain), accounts for normal flipping and can adjust the orientation %. --- source/blender/src/buttons_logic.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 25bed178130..a1fddfefb9c 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -1603,12 +1603,12 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco uiBlockBeginAlign(block); - uiDefButI(block, MENU, B_REDR, "Execution Method%t|Script%x0|Module%x1", xco+24,yco-24, 66, 19, &pc->mode, 0, 0, 0, 0, "Python script type (textblock or module - faster)"); + uiDefButI(block, MENU, B_REDR, "Execution Method%t|Script%x0|Module%x1", xco+4,yco-23, 66, 19, &pc->mode, 0, 0, 0, 0, "Python script type (textblock or module - faster)"); if(pc->mode==0) - uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "", xco+90,yco-24,width-90, 19, &pc->text, "Blender textblock to run as a script"); + uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "", xco+70,yco-23,width-74, 19, &pc->text, "Blender textblock to run as a script"); else { - uiDefBut(block, TEX, 1, "", xco+90,yco-24,(width-90)-25, 19, pc->module, 0, 63, 0, 0, "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used"); - uiDefButBitI(block, TOG, CONT_PY_DEBUG, B_REDR, "D", (xco+width)-25, yco-24, 19, 19, &pc->flag, 0, 0, 0, 0, "Continuously reload the module from disk for editing external modules without restarting"); + uiDefBut(block, TEX, 1, "", xco+70,yco-23,(width-70)-25, 19, pc->module, 0, 63, 0, 0, "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used"); + uiDefButBitI(block, TOG, CONT_PY_DEBUG, B_REDR, "D", (xco+width)-25, yco-23, 19, 19, &pc->flag, 0, 0, 0, 0, "Continuously reload the module from disk for editing external modules without restarting"); } uiBlockEndAlign(block); @@ -2748,19 +2748,19 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh if(parAct->type==ACT_PARENT_SET) { - ysize= 68; + ysize= 48; glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+40, yco-44, (width-80), 19, &(parAct->ob), "Set this object as parent"); + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+95, yco-24, (width-100), 19, &(parAct->ob), "Set this object as parent"); uiBlockBeginAlign(block); uiDefButBitS(block, TOGN, ACT_PARENT_COMPOUND, B_REDR, "Compound", - xco + 40, yco - 64, (width - 80)/2, 19, &parAct->flag, + xco + 5, yco - 44, (width - 10)/2, 19, &parAct->flag, 0.0, 0.0, 0, 0, "Add this object shape to the parent shape (only if the parent shape is already compound)"); uiDefButBitS(block, TOGN, ACT_PARENT_GHOST, B_REDR, "Ghost", - xco + 40 + ((width - 80)/2), yco - 64, (width - 80)/2, 19, &parAct->flag, + xco + 5 + ((width - 10)/2), yco - 44, (width - 10)/2, 19, &parAct->flag, 0.0, 0.0, 0, 0, "Make this object ghost while parented (only if not compound)"); uiBlockEndAlign(block); @@ -2773,7 +2773,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh } str= "Parent %t|Set Parent %x0|Remove Parent %x1"; - uiDefButI(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &parAct->type, 0.0, 0.0, 0, 0, ""); + uiDefButI(block, MENU, B_REDR, str, xco+5, yco-24, parAct->type==1?(width-80):90, 19, &parAct->type, 0.0, 0.0, 0, 0, ""); yco-= ysize; break; -- cgit v1.2.3 From 801eeb6423f4fcd3f2b2fac73cc5e65c96654c5b Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 25 May 2009 13:07:54 +0000 Subject: NLA SoC: Groundwork for NLA UI Adapted the channel-filtering code for the other animation editors for eventual use by the NLA Editor. --- source/blender/blenloader/intern/readfile.c | 5 + source/blender/blenloader/intern/writefile.c | 5 +- source/blender/editors/animation/anim_filter.c | 460 +++++++++++++++---------- source/blender/editors/include/ED_anim_api.h | 14 +- source/blender/editors/space_nla/space_nla.c | 9 +- source/blender/makesdna/DNA_action_types.h | 1 + source/blender/makesdna/DNA_space_types.h | 3 +- 7 files changed, 315 insertions(+), 182 deletions(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index cfb8baa4c84..c919a6dd6a9 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4679,6 +4679,11 @@ static void direct_link_screen(FileData *fd, bScreen *sc) sipo->ads= newdataadr(fd, sipo->ads); sipo->ghostCurves.first= sipo->ghostCurves.last= NULL; } + else if (sl->spacetype==SPACE_NLA) { + SpaceNla *snla= (SpaceNla*)sl; + + snla->ads= newdataadr(fd, snla->ads); + } else if (sl->spacetype==SPACE_OUTLINER) { SpaceOops *soops= (SpaceOops*) sl; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 0375feffb31..bb1ee15eaea 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1904,7 +1904,10 @@ static void write_screens(WriteData *wd, ListBase *scrbase) writestruct(wd, DATA, "SpaceSound", 1, sl); } else if(sl->spacetype==SPACE_NLA){ - writestruct(wd, DATA, "SpaceNla", 1, sl); + SpaceNla *snla= (SpaceNla *)sl; + + writestruct(wd, DATA, "SpaceNla", 1, snla); + if(snla->ads) writestruct(wd, DATA, "bDopeSheet", 1, snla->ads); } else if(sl->spacetype==SPACE_TIME){ writestruct(wd, DATA, "SpaceTime", 1, sl); diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index afad396607b..69e4fbfb08e 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -195,7 +195,7 @@ static short actedit_get_context (bAnimContext *ac, SpaceAction *saction) } } -/* ----------- Private Stuff - IPO Editor ------------- */ +/* ----------- Private Stuff - Graph Editor ------------- */ /* Get data being edited in Graph Editor (depending on current 'mode') */ static short graphedit_get_context (bAnimContext *ac, SpaceIpo *sipo) @@ -237,6 +237,26 @@ static short graphedit_get_context (bAnimContext *ac, SpaceIpo *sipo) } } +/* ----------- Private Stuff - NLA Editor ------------- */ + +/* Get data being edited in Graph Editor (depending on current 'mode') */ +static short nlaedit_get_context (bAnimContext *ac, SpaceNla *snla) +{ + /* init dopesheet data if non-existant (i.e. for old files) */ + if (snla->ads == NULL) + snla->ads= MEM_callocN(sizeof(bDopeSheet), "GraphEdit DopeSheet"); + + /* sync settings with current view status, then return appropriate data */ + /* update scene-pointer (no need to check for pinning yet, as not implemented) */ + snla->ads->source= (ID *)ac->scene; + snla->ads->filterflag |= ADS_FILTER_ONLYNLA; + + ac->datatype= ANIMCONT_NLA; + ac->data= snla->ads; + + return 1; +} + /* ----------- Public API --------------- */ /* Obtain current anim-data context, given that context info from Blender context has already been set @@ -264,6 +284,13 @@ short ANIM_animdata_context_getdata (bAnimContext *ac) ok= graphedit_get_context(ac, sipo); } break; + + case SPACE_NLA: + { + SpaceNla *snla= (SpaceNla *)sa->spacedata.first; + ok= nlaedit_get_context(ac, snla); + } + break; } } @@ -313,6 +340,39 @@ short ANIM_animdata_get_context (const bContext *C, bAnimContext *ac) /* quick macro to test if AnimData is usable for drivers */ #define ANIMDATA_HAS_DRIVERS(id) ((id)->adt && (id)->adt->drivers.first) +/* quick macro to test if AnimData is usable for NLA */ +#define ANIMDATA_HAS_NLA(id) ((id)->adt && (id)->adt->nla_tracks.first) + +/* quick macro to test for all three avove usability tests, performing the appropriate provided + * action for each when the AnimData context is appropriate. + * + * Priority order for this goes (most important, to least): NLA, Drivers, Keyframes + * + * - id: ID block which should have an AnimData pointer following it immediately, to use + * - nlaOk: line or block of code to execute for NLA case + * - driversOk: line or block of code to execute for Drivers case + * - keysOk: line or block of code for Keyframes case + */ +#define ANIMDATA_FILTER_CASES(id, nlaOk, driversOk, keysOk) \ + {\ + if (ads->filterflag & ADS_FILTER_ONLYNLA) {\ + if (ANIMDATA_HAS_NLA(id)) {\ + nlaOk\ + }\ + }\ + else if (ads->filterflag & ADS_FILTER_ONLYDRIVERS) {\ + if (ANIMDATA_HAS_DRIVERS(id)) {\ + driversOk\ + }\ + }\ + else {\ + if (ANIMDATA_HAS_KEYS(id)) {\ + keysOk\ + }\ + }\ + } + + /* quick macro to test if a anim-channel (F-Curve, Group, etc.) is selected in an acceptable way */ #define ANIMCHANNEL_SELOK(test_func) \ ( !(filter_mode & (ANIMFILTER_SEL|ANIMFILTER_UNSEL)) || \ @@ -494,6 +554,18 @@ bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, s ale->datatype= ALE_GPFRAME; } break; + + case ANIMTYPE_NLATRACK: + { + NlaTrack *nlt= (NlaTrack *)data; + + ale->flag= nlt->flag; + + // XXX or should this be done some other way? + ale->key_data= &nlt->strips; + ale->datatype= ALE_NLASTRIP; + } + break; } } @@ -610,6 +682,12 @@ static int animdata_filter_action (ListBase *anim_data, bAction *act, int filter return items; } +static int animdata_filter_nla (ListBase *anim_data, NlaTrack *first, int filter_mode, void *owner, short ownertype, ID *owner_id) +{ + // FIXME + return 0; +} + static int animdata_filter_shapekey (ListBase *anim_data, Key *key, int filter_mode, void *owner, short ownertype, ID *owner_id) { bAnimListElem *ale; @@ -752,19 +830,18 @@ static int animdata_filter_dopesheet_mats (ListBase *anim_data, bDopeSheet *ads, /* firstly check that we actuallly have some materials, by gathering all materials in a temp list */ for (a=0; a < ob->totcol; a++) { Material *ma= give_current_material(ob, a); + short ok = 0; /* for now, if no material returned, skip (this shouldn't confuse the user I hope) */ if (ELEM(NULL, ma, ma->adt)) continue; - if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS)==0) { - if (ANIMDATA_HAS_KEYS(ma) == 0) - continue; - } - else { - if (ANIMDATA_HAS_DRIVERS(ma) == 0) - continue; - } + /* check if ok */ + ANIMDATA_FILTER_CASES(ma, + ok=1;, + ok=1;, + ok=1;) + if (ok == 0) continue; /* make a temp list elem for this */ ld= MEM_callocN(sizeof(LinkData), "DopeSheet-MaterialCache"); @@ -801,16 +878,12 @@ static int animdata_filter_dopesheet_mats (ListBase *anim_data, bDopeSheet *ads, } } - /* add material's F-Curve or Driver channels? */ + /* add material's animation data */ if (FILTER_MAT_OBJD(ma) || (filter_mode & ANIMFILTER_CURVESONLY)) { - if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS)==0) { - // XXX the 'owner' info here is still subject to improvement - items += animdata_filter_action(anim_data, ma->adt->action, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma); - } - else { - // need to make the ownertype normal object here... (maybe type should be a separate one for clarity?) - items += animdata_filter_fcurves(anim_data, ma->adt->drivers.first, NULL, ma, ANIMTYPE_DSMAT, filter_mode, (ID *)ma); - } + ANIMDATA_FILTER_CASES(ma, + items += animdata_filter_nla(anim_data, ma->adt->nla_tracks.first, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);, + items += animdata_filter_fcurves(anim_data, ma->adt->drivers.first, NULL, ma, ANIMTYPE_DSMAT, filter_mode, (ID *)ma);, + items += animdata_filter_action(anim_data, ma->adt->action, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);) } } } @@ -871,15 +944,11 @@ static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ad /* add object-data animation channels? */ if ((expanded) || (filter_mode & ANIMFILTER_CURVESONLY)) { - /* Action or Drivers? */ - if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS) == 0) { - // XXX the 'owner' info here is still subject to improvement - items += animdata_filter_action(anim_data, iat->adt->action, filter_mode, iat, type, (ID *)iat); - } - else { - // need to make the ownertype normal object here... (maybe type should be a separate one for clarity?) - items += animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, iat, type, filter_mode, (ID *)iat); - } + /* filtering for channels - nla, drivers, keyframes */ + ANIMDATA_FILTER_CASES(iat, + items+= animdata_filter_nla(anim_data, iat->adt->nla_tracks.first, filter_mode, iat, type, (ID *)iat);, + items+= animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, iat, type, filter_mode, (ID *)iat);, + items += animdata_filter_action(anim_data, iat->adt->action, filter_mode, iat, type, (ID *)iat);) } /* return the number of items added to the list */ @@ -889,8 +958,10 @@ static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ad static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode) { bAnimListElem *ale=NULL; + AnimData *adt = NULL; Object *ob= base->object; Key *key= ob_get_key(ob); + short obdata_ok = 0; int items = 0; /* add this object as a channel first */ @@ -909,73 +980,83 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B if ( (EXPANDED_OBJC(ob) == 0) && !(filter_mode & ANIMFILTER_CURVESONLY) ) return items; - /* Action or Drivers */ - if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS) == 0) { - /* Action? */ - if (ANIMDATA_HAS_KEYS(ob) /*&& !(ads->filterflag & ADS_FILTER_NOACTS)*/) { - AnimData *adt= ob->adt; - - /* include action-expand widget? */ - if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { - ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLACTD, base, ANIMTYPE_OBJECT, (ID *)ob); - if (ale) { - BLI_addtail(anim_data, ale); - items++; + /* Action, Drivers, or NLA */ + if (ob->adt) { + adt= ob->adt; + ANIMDATA_FILTER_CASES(ob, + { /* nla */ +#if 0 + /* include nla-expand widget? */ + if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { + ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLNLA, base, ANIMTYPE_OBJECT, (ID *)ob); + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } } - } - - /* add F-Curve channels? */ - if (EXPANDED_ACTC(adt->action) || !(filter_mode & ANIMFILTER_CHANNELS)) { - // need to make the ownertype normal object here... (maybe type should be a separate one for clarity?) - items += animdata_filter_action(anim_data, adt->action, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); - } - } - } - else { - /* Drivers */ - if (ANIMDATA_HAS_DRIVERS(ob)) { - AnimData *adt= ob->adt; - - /* include drivers-expand widget? */ - if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { - ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLDRIVERS, base, ANIMTYPE_OBJECT, (ID *)ob); - if (ale) { - BLI_addtail(anim_data, ale); - items++; +#endif + + /* add NLA tracks */ + if (/*EXPANDED_NLTD(adt) ||*/ !(filter_mode & ANIMFILTER_CHANNELS)) + items += animdata_filter_nla(anim_data, adt->nla_tracks.first, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); + }, + { /* drivers */ + /* include drivers-expand widget? */ + if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { + ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLDRIVERS, base, ANIMTYPE_OBJECT, (ID *)ob); + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } + } + + /* add F-Curve channels (drivers are F-Curves) */ + if (EXPANDED_DRVD(adt) || !(filter_mode & ANIMFILTER_CHANNELS)) { + // need to make the ownertype normal object here... (maybe type should be a separate one for clarity?) + items += animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, ob, ANIMTYPE_OBJECT, filter_mode, (ID *)ob); + } + }, + { /* action (keyframes) */ + /* include action-expand widget? */ + if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { + ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLACTD, base, ANIMTYPE_OBJECT, (ID *)ob); + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } + } + + /* add F-Curve channels? */ + if (EXPANDED_ACTC(adt->action) || !(filter_mode & ANIMFILTER_CHANNELS)) { + // need to make the ownertype normal object here... (maybe type should be a separate one for clarity?) + items += animdata_filter_action(anim_data, adt->action, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); } } - - /* add F-Curve channels (drivers are F-Curves) */ - if (EXPANDED_DRVD(adt) || !(filter_mode & ANIMFILTER_CHANNELS)) { - // need to make the ownertype normal object here... (maybe type should be a separate one for clarity?) - items += animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, ob, ANIMTYPE_OBJECT, filter_mode, (ID *)ob); - } - } + ) } + /* ShapeKeys? */ if ((key) && !(ads->filterflag & ADS_FILTER_NOSHAPEKEYS)) { - /* Animation or Drivers */ - if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS) == 0) { - /* include shapekey-expand widget? */ - if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { - ale= make_new_animlistelem(key, ANIMTYPE_DSSKEY, base, ANIMTYPE_OBJECT, (ID *)ob); - if (ale) { - BLI_addtail(anim_data, ale); - items++; + adt= key->adt; + ANIMDATA_FILTER_CASES(key, + { /* nla */ +#if 0 + /* include nla-expand widget? */ + if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { + ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLNLA, base, ANIMTYPE_OBJECT, (ID *)ob); + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } } - } - - /* add channels */ - if (FILTER_SKE_OBJD(key) || (filter_mode & ANIMFILTER_CURVESONLY)) { - items += animdata_filter_shapekey(anim_data, key, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); - } - } - else { - /* Drivers */ - if (ANIMDATA_HAS_DRIVERS(key)) { - AnimData *adt= key->adt; +#endif + /* add NLA tracks */ + if (/*EXPANDED_NLTD(adt) ||*/ !(filter_mode & ANIMFILTER_CHANNELS)) + items += animdata_filter_nla(anim_data, adt->nla_tracks.first, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); + }, + { /* drivers */ /* include shapekey-expand widget? */ if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { ale= make_new_animlistelem(key, ANIMTYPE_DSSKEY, base, ANIMTYPE_OBJECT, (ID *)ob); @@ -985,15 +1066,28 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B } } - /* add F-Curve channels (drivers are F-Curves) */ - if (FILTER_SKE_OBJD(key)/*EXPANDED_DRVD(adt)*/ || !(filter_mode & ANIMFILTER_CHANNELS)) { - // XXX owner info is messed up now... - items += animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, ob, ANIMTYPE_OBJECT, filter_mode, (ID *)key); + /* add channels */ + if (FILTER_SKE_OBJD(key) || (filter_mode & ANIMFILTER_CURVESONLY)) { + items += animdata_filter_shapekey(anim_data, key, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); + } + }, + { /* action (keyframes) */ + /* include shapekey-expand widget? */ + if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { + ale= make_new_animlistelem(key, ANIMTYPE_DSSKEY, base, ANIMTYPE_OBJECT, (ID *)ob); + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } + } + + /* add channels */ + if (FILTER_SKE_OBJD(key) || (filter_mode & ANIMFILTER_CURVESONLY)) { + items += animdata_filter_shapekey(anim_data, key, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); } } - } + ) } - /* Materials? */ if ((ob->totcol) && !(ads->filterflag & ADS_FILTER_NOMAT)) @@ -1006,14 +1100,10 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B Camera *ca= (Camera *)ob->data; if ((ads->filterflag & ADS_FILTER_NOCAM) == 0) { - if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS)==0) { - if (ANIMDATA_HAS_KEYS(ca)) - items += animdata_filter_dopesheet_obdata(anim_data, ads, base, filter_mode); - } - else { - if (ANIMDATA_HAS_DRIVERS(ca)) - items += animdata_filter_dopesheet_obdata(anim_data, ads, base, filter_mode); - } + ANIMDATA_FILTER_CASES(ca, + obdata_ok= 1;, + obdata_ok= 1;, + obdata_ok= 1;) } } break; @@ -1022,14 +1112,10 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B Lamp *la= (Lamp *)ob->data; if ((ads->filterflag & ADS_FILTER_NOLAM) == 0) { - if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS)==0) { - if (ANIMDATA_HAS_KEYS(la)) - items += animdata_filter_dopesheet_obdata(anim_data, ads, base, filter_mode); - } - else { - if (ANIMDATA_HAS_DRIVERS(la)) - items += animdata_filter_dopesheet_obdata(anim_data, ads, base, filter_mode); - } + ANIMDATA_FILTER_CASES(la, + obdata_ok= 1;, + obdata_ok= 1;, + obdata_ok= 1;) } } break; @@ -1038,18 +1124,16 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B Curve *cu= (Curve *)ob->data; if ((ads->filterflag & ADS_FILTER_NOCUR) == 0) { - if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS)==0) { - if (ANIMDATA_HAS_KEYS(cu)) - items += animdata_filter_dopesheet_obdata(anim_data, ads, base, filter_mode); - } - else { - if (ANIMDATA_HAS_DRIVERS(cu)) - items += animdata_filter_dopesheet_obdata(anim_data, ads, base, filter_mode); - } + ANIMDATA_FILTER_CASES(cu, + obdata_ok= 1;, + obdata_ok= 1;, + obdata_ok= 1;) } } break; } + if (obdata_ok) + items += animdata_filter_dopesheet_obdata(anim_data, ads, base, filter_mode); /* return the number of items added to the list */ return items; @@ -1058,6 +1142,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode) { World *wo= sce->world; + AnimData *adt= NULL; bAnimListElem *ale; int items = 0; @@ -1077,74 +1162,82 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads if ( (EXPANDED_SCEC(sce) == 0) && !(filter_mode & ANIMFILTER_CURVESONLY) ) return items; - /* Action or Drivers */ - if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS) == 0) { - /* Action? */ - if (ANIMDATA_HAS_KEYS(sce) && !(ads->filterflag & ADS_FILTER_NOSCE)) { - AnimData *adt= sce->adt; - - /* include action-expand widget? */ - if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { - ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLACTD, sce, ANIMTYPE_SCENE, (ID *)sce); - if (ale) { - BLI_addtail(anim_data, ale); - items++; + /* Action, Drivers, or NLA for Scene */ + if ((ads->filterflag & ADS_FILTER_NOSCE) == 0) { + adt= sce->adt; + ANIMDATA_FILTER_CASES(sce, + { /* nla */ +#if 0 + /* include nla-expand widget? */ + if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { + ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLNLA, base, ANIMTYPE_SCENE (ID *)sce); + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } } - } - - /* add F-Curve channels? */ - if (EXPANDED_ACTC(adt->action) || !(filter_mode & ANIMFILTER_CHANNELS)) { - items += animdata_filter_action(anim_data, adt->action, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce); - } - } - } - else { - /* Drivers */ - if (ANIMDATA_HAS_DRIVERS(sce) && !(ads->filterflag & ADS_FILTER_NOSCE)) { - AnimData *adt= sce->adt; - - /* include drivers-expand widget? */ - if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { - ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLDRIVERS, sce, ANIMTYPE_SCENE, (ID *)sce); - if (ale) { - BLI_addtail(anim_data, ale); - items++; +#endif + + /* add NLA tracks */ + if (/*EXPANDED_NLTD(adt) ||*/ !(filter_mode & ANIMFILTER_CHANNELS)) + items += animdata_filter_nla(anim_data, adt->nla_tracks.first, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce); + }, + { /* drivers */ + /* include drivers-expand widget? */ + if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { + ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLDRIVERS, sce, ANIMTYPE_SCENE, (ID *)sce); + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } + } + + /* add F-Curve channels (drivers are F-Curves) */ + if (EXPANDED_DRVD(adt) || !(filter_mode & ANIMFILTER_CHANNELS)) { + items += animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, sce, ANIMTYPE_SCENE, filter_mode, (ID *)sce); + } + }, + { /* action */ + /* include action-expand widget? */ + if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { + ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLACTD, sce, ANIMTYPE_SCENE, (ID *)sce); + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } + } + + /* add F-Curve channels? */ + if (EXPANDED_ACTC(adt->action) || !(filter_mode & ANIMFILTER_CHANNELS)) { + items += animdata_filter_action(anim_data, adt->action, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce); } } - - /* add F-Curve channels (drivers are F-Curves) */ - if (EXPANDED_DRVD(adt) || !(filter_mode & ANIMFILTER_CHANNELS)) { - items += animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, sce, ANIMTYPE_SCENE, filter_mode, (ID *)sce); - } - } + ) } - + /* world */ if ((wo && wo->adt) && !(ads->filterflag & ADS_FILTER_NOWOR)) { - /* Animation or Drivers */ - if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS) == 0) { - AnimData *adt= wo->adt; - - /* include world-expand widget? */ - if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { - ale= make_new_animlistelem(wo, ANIMTYPE_DSWOR, sce, ANIMTYPE_SCENE, (ID *)sce); - if (ale) { - BLI_addtail(anim_data, ale); - items++; + /* Action, Drivers, or NLA for World */ + adt= wo->adt; + ANIMDATA_FILTER_CASES(wo, + { /* nla */ +#if 0 + /* include nla-expand widget? */ + if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { + ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLNLA, base, ANIMTYPE_DSWOR (ID *)wo); + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } } - } - - /* add channels */ - if (FILTER_WOR_SCED(wo) || (filter_mode & ANIMFILTER_CURVESONLY)) { - items += animdata_filter_action(anim_data, adt->action, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo); - } - } - else { - /* Drivers */ - if (ANIMDATA_HAS_DRIVERS(wo)) { - AnimData *adt= wo->adt; +#endif - /* include shapekey-expand widget? */ + /* add NLA tracks */ + if (/*EXPANDED_NLTD(adt) ||*/ !(filter_mode & ANIMFILTER_CHANNELS)) + items += animdata_filter_nla(anim_data, adt->nla_tracks.first, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo); + }, + { /* drivers */ + /* include world-expand widget? */ if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { ale= make_new_animlistelem(wo, ANIMTYPE_DSWOR, sce, ANIMTYPE_SCENE, (ID *)wo); if (ale) { @@ -1158,8 +1251,23 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads // XXX owner info is messed up now... items += animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, wo, ANIMTYPE_DSWOR, filter_mode, (ID *)wo); } + }, + { /* action */ + /* include world-expand widget? */ + if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { + ale= make_new_animlistelem(wo, ANIMTYPE_DSWOR, sce, ANIMTYPE_SCENE, (ID *)sce); + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } + } + + /* add channels */ + if (FILTER_WOR_SCED(wo) || (filter_mode & ANIMFILTER_CURVESONLY)) { + items += animdata_filter_action(anim_data, adt->action, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo); + } } - } + ) } /* return the number of items added to the list */ diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index efc0a0b9a57..75c10f957cc 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -75,8 +75,9 @@ typedef enum eAnimCont_Types { ANIMCONT_SHAPEKEY, /* shapekey (Key) */ ANIMCONT_GPENCIL, /* grease pencil (screen) */ ANIMCONT_DOPESHEET, /* dopesheet (bDopesheet) */ - ANIMCONT_FCURVES, /* animation F-Curves (bDopesheet) */ // XXX + ANIMCONT_FCURVES, /* animation F-Curves (bDopesheet) */ ANIMCONT_DRIVERS, /* drivers (bDopesheet) */ + ANIMCONT_NLA, /* nla (bDopesheet) */ } eAnimCont_Types; /* --------------- Channels -------------------- */ @@ -92,10 +93,10 @@ typedef struct bAnimListElem { int flag; /* copy of elem's flags for quick access */ int index; /* copy of adrcode where applicable */ - void *key_data; /* motion data - ipo or ipo-curve */ + void *key_data; /* motion data - mostly F-Curves, but can be other types too */ short datatype; /* type of motion data to expect */ - struct ID *id; /* ID block that channel is attached to (may be used */ + struct ID *id; /* ID block that channel is attached to (may be used */ void *owner; /* group or channel which acts as this channel's owner */ short ownertype; /* type of owner */ @@ -128,6 +129,8 @@ typedef enum eAnim_ChannelType { ANIMTYPE_GPDATABLOCK, ANIMTYPE_GPLAYER, + + ANIMTYPE_NLATRACK, } eAnim_ChannelType; /* types of keyframe data in bAnimListElem */ @@ -135,6 +138,7 @@ typedef enum eAnim_KeyType { ALE_NONE = 0, /* no keyframe data */ ALE_FCURVE, /* F-Curve */ ALE_GPFRAME, /* Grease Pencil Frames */ + ALE_NLASTRIP, /* NLA Strips */ // XXX the following are for summaries... should these be kept? ALE_SCE, /* Scene summary */ @@ -202,6 +206,10 @@ typedef enum eAnimFilter_Flags { #define EDITABLE_GPL(gpl) ((gpl->flag & GP_LAYER_LOCKED)==0) #define SEL_GPL(gpl) ((gpl->flag & GP_LAYER_ACTIVE) || (gpl->flag & GP_LAYER_SELECT)) +/* NLA only */ +#define SEL_NLT(nlt) (nlt->flag & NLATRACK_SELECTED) +#define EDITABLE_NLT(nlt) ((nlt->flag & NLATRACK_PROTECTED)==0) + /* -------------- Channel Defines -------------- */ /* channel heights */ diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 188315c73fb..cdaabe9e9de 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -72,6 +72,9 @@ static SpaceLink *nla_new(const bContext *C) snla= MEM_callocN(sizeof(SpaceNla), "initnla"); snla->spacetype= SPACE_NLA; + /* allocate DopeSheet data for NLA Editor */ + snla->ads= MEM_callocN(sizeof(bDopeSheet), "NLAEdit DopeSheet"); + /* header */ ar= MEM_callocN(sizeof(ARegion), "header for nla"); @@ -123,8 +126,12 @@ static SpaceLink *nla_new(const bContext *C) /* not spacelink itself */ static void nla_free(SpaceLink *sl) { -// SpaceNla *snla= (SpaceNla*) sl; + SpaceNla *snla= (SpaceNla*) sl; + if (snla->ads) { + BLI_freelistN(&snla->ads->chanbase); + MEM_freeN(snla->ads); + } } diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index cf54d69bb8b..9643e012ad4 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -287,6 +287,7 @@ typedef enum DOPESHEET_FILTERFLAG { /* general filtering */ ADS_FILTER_ONLYSEL = (1<<0), ADS_FILTER_ONLYDRIVERS = (1<<1), + ADS_FILTER_ONLYNLA = (1<<2), /* datatype-based filtering */ ADS_FILTER_NOSHAPEKEYS = (1<<6), diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 0a4fe1c5814..2dea6c4c969 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -244,10 +244,11 @@ typedef struct SpaceNla { short blockhandler[8]; - int filterflag; /* filtering flags (similar to the ones used for Keyframe Editors) */ short autosnap; /* this uses the same settings as autosnap for Action Editor */ short flag; + int pad; + struct bDopeSheet *ads; View2D v2d; /* depricated, copied to region */ } SpaceNla; -- cgit v1.2.3 From ca39228fb70a2c1b45c504ef344a5ac434f8989c Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Mon, 25 May 2009 16:09:22 +0000 Subject: Interface --------- Bugfix 18811: long filenames caused stack corruption in BLI_adddirstrings(). --- source/blender/blenlib/intern/storage.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 088b5e40a51..2ea9a54f13f 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -329,7 +329,7 @@ void BLI_builddir(char *dirname, char *relname) void BLI_adddirstrings() { char datum[100]; - char buf[250]; + char buf[512]; char size[250]; static char * types[8] = {"---", "--x", "-w-", "-wx", "r--", "r-x", "rw-", "rwx"}; int num, mode; @@ -432,9 +432,6 @@ void BLI_adddirstrings() sprintf(size, "%10d", (int) st_size); } - sprintf(buf,"%s %s %10s %s", files[num].date, files[num].time, size, - files[num].relname); - sprintf(buf,"%s %s %s %7s %s %s %10s %s", file->mode1, file->mode2, file->mode3, files[num].owner, files[num].date, files[num].time, size, files[num].relname); -- cgit v1.2.3 From 25c564c7c33701650dc9457969da0e596b787fa4 Mon Sep 17 00:00:00 2001 From: Stefan Gartner Date: Mon, 25 May 2009 23:20:38 +0000 Subject: tiny fix for irix: use putenv instead of setenv --- source/creator/creator.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source') diff --git a/source/creator/creator.c b/source/creator/creator.c index e04a5b1db3d..f8bf7288143 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -544,9 +544,13 @@ int main(int argc, char **argv) #else _putenv_s("SDL_VIDEODRIVER", "dummy"); #endif +#else +#ifdef __sgi + putenv("SDL_VIDEODRIVER=dummy"); #else setenv("SDL_VIDEODRIVER", "dummy", 1); /* initializing the video driver can cause crashes on some systems - Campbell */ #endif +#endif #ifdef __linux__ /* On linux the default SDL driver dma often would not play * use alsa if none is set */ -- cgit v1.2.3 From bbed7918c891c928cb18cc38e2497e9209da9ad7 Mon Sep 17 00:00:00 2001 From: Stefan Gartner Date: Mon, 25 May 2009 23:35:29 +0000 Subject: IRIX: use python 2.5 by default --- source/nan_definitions.mk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk index f7bcd47930c..953f8593f91 100644 --- a/source/nan_definitions.mk +++ b/source/nan_definitions.mk @@ -292,8 +292,12 @@ endif export HOST = $(shell /usr/bsd/hostname -s) #export NAN_NO_KETSJI=true export NAN_JUST_BLENDERDYNAMIC=true - export NAN_PYTHON ?= $(LCGDIR)/python - export NAN_PYTHON_VERSION ?= 2.3 + export NAN_PYTHON_VERSION ?= 2.5 + ifeq ($(IRIX_USE_GCC), true) + export NAN_PYTHON ?= $(LCGDIR)/python_gcc + else + export NAN_PYTHON ?= $(LCGDIR)/python + endif export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION) export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a -lpthread export NAN_OPENAL ?= $(LCGDIR)/openal -- cgit v1.2.3 From 5f82855a07eb1cfbb89aba654c9c8f7da1544c5b Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Tue, 26 May 2009 00:14:22 +0000 Subject: Interface --------- Fixing typo in TimeOffset tooltip. --- source/blender/src/buttons_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index edc8e2a56a1..a90dd0447e9 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -2768,7 +2768,7 @@ static void object_panel_anim(Object *ob) uiBlockBeginAlign(block); timeoffset_ui = give_timeoffset(ob); - but = uiDefButF(block, NUM, REDRAWALL, "TimeOffset:", 24,35,115,20, &timeoffset_ui, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Animation offset in frames for ipo's and dupligroup instances"); + but = uiDefButF(block, NUM, REDRAWALL, "TimeOffset:", 24,35,115,20, &timeoffset_ui, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Animation offset in frames for IPOs and dupligroup instances"); uiButSetFunc(but, object_panel_anim_timeoffset_callback, ob, &timeoffset_ui); uiDefBut(block, BUT, B_AUTOTIMEOFS, "Auto", 139,35,34,20, 0, 0, 0, 0, 0, "Assign selected objects a timeoffset within a range, starting from the active object"); -- cgit v1.2.3 From 7ba91ddcc37bbc8cd6c417e588d7ca7a3bb65e24 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 26 May 2009 07:41:34 +0000 Subject: BGE Script template for a python module (set EOL to native this time) BGE PyAPI use defines for error return values - del gameOb['var'] error message was wrong. --- source/gameengine/Expressions/PyObjectPlus.cpp | 18 +++++++++--------- source/gameengine/Expressions/Value.cpp | 2 +- source/gameengine/Ketsji/KX_GameObject.cpp | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 720094b6f98..defb6853e67 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -362,12 +362,12 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb if (!PySequence_Check(value)) { PyErr_Format(PyExc_TypeError, "expected a sequence for attribute \"%s\"", attrdef->m_name); - return 1; + return PY_SET_ATTR_FAIL; } if (PySequence_Size(value) != attrdef->m_length) { PyErr_Format(PyExc_TypeError, "incorrect number of elements in sequence for attribute \"%s\"", attrdef->m_name); - return 1; + return PY_SET_ATTR_FAIL; } switch (attrdef->m_type) { @@ -375,7 +375,7 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb if (attrdef->m_setFunction == NULL) { PyErr_Format(PyExc_AttributeError, "function attribute without function for attribute \"%s\", report to blender.org", attrdef->m_name); - return 1; + return PY_SET_ATTR_FAIL; } return (*attrdef->m_setFunction)(self, attrdef, value); case KX_PYATTRIBUTE_TYPE_BOOL: @@ -394,7 +394,7 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb default: // should not happen PyErr_Format(PyExc_AttributeError, "Unsupported attribute type for attribute \"%s\", report to blender.org", attrdef->m_name); - return 1; + return PY_SET_ATTR_FAIL; } // let's implement a smart undo method bufferSize *= attrdef->m_length; @@ -542,12 +542,12 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb memcpy(sourceBuffer, undoBuffer, bufferSize); free(undoBuffer); } - return 1; + return PY_SET_ATTR_FAIL; } } if (undoBuffer) free(undoBuffer); - return 0; + return PY_SET_ATTR_SUCCESS; } else // simple attribute value { @@ -556,7 +556,7 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb if (attrdef->m_setFunction == NULL) { PyErr_Format(PyExc_AttributeError, "function attribute without function \"%s\", report to blender.org", attrdef->m_name); - return 1; + return PY_SET_ATTR_FAIL; } return (*attrdef->m_setFunction)(self, attrdef, value); } @@ -589,7 +589,7 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb break; default: PyErr_Format(PyExc_AttributeError, "unknown type for attribute \"%s\", report to blender.org", attrdef->m_name); - return 1; + return PY_SET_ATTR_FAIL; } if (bufferSize) { @@ -712,7 +712,7 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb if (!PySequence_Check(value) || PySequence_Size(value) != 3) { PyErr_Format(PyExc_TypeError, "expected a sequence of 3 floats for attribute \"%s\"", attrdef->m_name); - return 1; + return PY_SET_ATTR_FAIL; } MT_Vector3 *var = reinterpret_cast(ptr); for (int i=0; i<3; i++) diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index f61ef1455b4..773fd94a0fb 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -662,7 +662,7 @@ int CValue::py_delattro(PyObject *attr) return 0; PyErr_Format(PyExc_AttributeError, "attribute \"%s\" dosnt exist", attr_str); - return 1; + return PY_SET_ATTR_MISSING; } int CValue::py_setattro(PyObject *attr, PyObject* pyobj) diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index f1c3fb89df2..1f7eeca1b69 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1342,7 +1342,7 @@ int KX_GameObject::Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) if (del==0) { if(attr_str) PyErr_Format(PyExc_KeyError, "gameOb[key] = value: KX_GameObject, key \"%s\" could not be set", attr_str); - else PyErr_SetString(PyExc_KeyError, "gameOb[key] = value: KX_GameObject, key could not be set"); + else PyErr_SetString(PyExc_KeyError, "del gameOb[key]: KX_GameObject, key could not be deleted"); return -1; } else if (self->m_attr_dict) { @@ -1902,13 +1902,13 @@ int KX_GameObject::py_delattro(PyObject *attr) char *attr_str= PyString_AsString(attr); if (RemoveProperty(attr_str)) // XXX - should call CValues instead but its only 2 lines here - return 0; + return PY_SET_ATTR_SUCCESS; if (m_attr_dict && (PyDict_DelItem(m_attr_dict, attr) == 0)) - return 0; + return PY_SET_ATTR_SUCCESS; PyErr_Format(PyExc_AttributeError, "del gameOb.myAttr: KX_GameObject, attribute \"%s\" dosnt exist", attr_str); - return 1; + return PY_SET_ATTR_MISSING; } -- cgit v1.2.3 From ca4d741ce9865c696ef0e41c0c44dd916974d099 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 26 May 2009 08:30:28 +0000 Subject: Bugfix: (discovered by course participant :) Brush option "Clone" didn't read linked Clone Image from file. No idea how this ever could work even... even for Undo it would crash. --- source/blender/blenloader/intern/readfile.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index abfb8ebd04c..a99cb86f86b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1459,6 +1459,8 @@ static void lib_link_brush(FileData *fd, Main *main) if(brush->id.flag & LIB_NEEDLINK) { brush->id.flag -= LIB_NEEDLINK; + brush->clone.image= newlibadr_us(fd, brush->id.lib, brush->clone.image); + for(a=0; amtex[a]; if(mtex) -- cgit v1.2.3 From e93d1ba8e775a481e9a719355b12d4523cabcae1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 26 May 2009 10:44:14 +0000 Subject: Misc warnings - Removed/Commented some unused vars - CValue::GetPropertyText() could return a temp reference to a variable on the stack, option wasnt used anywhere so removed. - KX_ConstraintWrapper::GetConstraintId allows args but ignored them - KX_ConstraintWrapper::PySetParam didnt return NULL on an error (messing up pythons exceptions). - BLI_natstrcmp didnt return 0 when the while loop exited --- source/blender/blenkernel/bad_level_call_stubs/stubs.c | 3 ++- source/blender/blenkernel/intern/anim.c | 2 +- source/blender/blenlib/intern/util.c | 2 +- source/blender/imbuf/intern/openexr/openexr_api.cpp | 2 +- source/blender/python/api2_2x/Geometry.c | 2 +- source/blender/src/butspace.c | 2 +- source/blender/src/buttons_editing.c | 2 +- source/blender/src/drawobject.c | 2 +- source/gameengine/Expressions/Value.cpp | 4 +--- source/gameengine/Expressions/Value.h | 2 +- source/gameengine/GamePlayer/common/GPC_RenderTools.cpp | 3 --- source/gameengine/Ketsji/KX_Camera.cpp | 1 - source/gameengine/Ketsji/KX_ConstraintWrapper.cpp | 17 +++++++---------- source/gameengine/Ketsji/KX_ConstraintWrapper.h | 3 +-- source/gameengine/Ketsji/KX_MeshProxy.cpp | 1 - source/gameengine/VideoTexture/PyTypeList.cpp | 1 - 16 files changed, 19 insertions(+), 30 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/bad_level_call_stubs/stubs.c b/source/blender/blenkernel/bad_level_call_stubs/stubs.c index 3012c19ff02..1a33102f845 100644 --- a/source/blender/blenkernel/bad_level_call_stubs/stubs.c +++ b/source/blender/blenkernel/bad_level_call_stubs/stubs.c @@ -57,6 +57,7 @@ struct bConstraintOb; struct bConstraintTarget; struct ListBase; struct EditFace; +struct LOD_Decimation_Info; char *getIpoCurveName( struct IpoCurve * icu ); void insert_vert_icu(struct IpoCurve *icu, float x, float y, short fast); @@ -160,7 +161,7 @@ void BPY_pyconstraint_target(struct bPythonConstraint *con, struct bConstraintTa void free_oops(struct Oops *oops){} void exit_posemode(int freedata){} void error(char *str, ...){} -int okee(char *str, ...){} +int okee(char *str, ...){return 1;} /* anim.c */ ListBase editNurb; diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 50be417c8ef..ffb7ff51b87 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -747,7 +747,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_ float ctime, pa_time, scale = 1.0f; float tmat[4][4], mat[4][4], pamat[4][4], size=0.0; float (*obmat)[4], (*oldobmat)[4]; - int lay, a, b, k, counter, hair = 0; + int lay, a, b, counter, hair = 0; int totpart, totchild, totgroup=0, pa_num; if(psys==0) return; diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 842ebc4c0a9..e202d91f0e6 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -2030,7 +2030,7 @@ int BLI_natstrcmp(const char *s1, const char *s2) d1++; d2++; } - + return 0; } diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 9e077cbc809..32d97d79bd7 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -865,7 +865,7 @@ static const char *exr_rgba_channelname(InputFile *file, const char *chan) for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); ++i) { - const Channel &channel = i.channel(); + /* const Channel &channel = i.channel(); */ /* Not used yet */ const char *str= i.name(); int len= strlen(str); if(len) { diff --git a/source/blender/python/api2_2x/Geometry.c b/source/blender/python/api2_2x/Geometry.c index 2ac6b8a714a..f875cbc52fb 100644 --- a/source/blender/python/api2_2x/Geometry.c +++ b/source/blender/python/api2_2x/Geometry.c @@ -488,7 +488,7 @@ static PyObject *M_Geometry_BezierInterp( PyObject * self, PyObject * args ) float k2[4] = {0.0, 0.0, 0.0, 0.0}; float h2[4] = {0.0, 0.0, 0.0, 0.0}; - float a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y, xi, yi, a1,a2,b1,b2, newvec[2]; + if( !PyArg_ParseTuple ( args, "O!O!O!O!i", &vector_Type, &vec_k1, &vector_Type, &vec_h1, diff --git a/source/blender/src/butspace.c b/source/blender/src/butspace.c index ba4d02d2355..38d628d2056 100644 --- a/source/blender/src/butspace.c +++ b/source/blender/src/butspace.c @@ -511,7 +511,7 @@ void curvemap_buttons(uiBlock *block, CurveMapping *cumap, char labeltype, short static void do_node_buts(unsigned short event) { Material *ma; - SpaceNode *snode = curarea->spacedata.first; + /* SpaceNode *snode = curarea->spacedata.first; */ /* all operations default on active material layer here */ /* but this also gets called for lamp and world... */ diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 1ecc63fe93d..43fafeb387a 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -6437,7 +6437,7 @@ void brush_buttons(uiBlock *block, short sima, } else { if ( - (sima==NULL) && /* 3D View */ + (!sima) && /* 3D View */ (settings->imapaint.flag & IMAGEPAINT_PROJECT_DISABLE)==0 && /* Projection Painting */ (settings->imapaint.tool == PAINT_TOOL_CLONE) ) { diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index 5fb60449a25..ef37b184a85 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -2918,7 +2918,7 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys, int dt) float cfra=bsystem_time(ob,(float)CFRA,0.0); float *vdata=0, *vedata=0, *cdata=0, *ndata=0, *vd=0, *ved=0, *cd=0, *nd=0, xvec[3], yvec[3], zvec[3]; float ma_r=0.0f, ma_g=0.0f, ma_b=0.0f; - int a, k, k_max=0, totpart, totpoint=0, draw_as, totchild=0; + int a, totpart, totpoint=0, draw_as, totchild=0; int select=ob->flag&SELECT, create_cdata=0; GLint polygonmode[2]; char val[32]; diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 773fd94a0fb..08249f92902 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -292,15 +292,13 @@ CValue* CValue::GetProperty(const char *inName) // // Get text description of property with name , returns an empty string if there is no property named // -const STR_String& CValue::GetPropertyText(const STR_String & inName,const char *deftext) +const STR_String& CValue::GetPropertyText(const STR_String & inName) { const static STR_String sEmpty(""); CValue *property = GetProperty(inName); if (property) return property->GetText(); - else if (deftext) - return STR_String(deftext); else return sEmpty; } diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 0be76c4f452..29ef19b46c9 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -310,7 +310,7 @@ public: virtual void SetProperty(const char* name,CValue* ioProperty); virtual CValue* GetProperty(const char* inName); // Get pointer to a property with name , returns NULL if there is no property named virtual CValue* GetProperty(const STR_String & inName); - const STR_String& GetPropertyText(const STR_String & inName,const char *deftext=NULL); // Get text description of property with name , returns an empty string if there is no property named + const STR_String& GetPropertyText(const STR_String & inName); // Get text description of property with name , returns an empty string if there is no property named float GetPropertyNumber(const STR_String& inName,float defnumber); virtual bool RemoveProperty(const char *inName); // Remove the property named , returns true if the property was succesfully removed, false if property was not found or could not be removed virtual vector GetPropertyNames(); diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index 1a0d985a864..02f23a8431b 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -288,10 +288,7 @@ void GPC_RenderTools::RenderText2D(RAS_TEXT_RENDER_MODE mode, int height) { STR_String tmpstr(text); - int lines; char* s = tmpstr.Ptr(); - char* p; - // Save and change OpenGL settings int texture2D; diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 144ff4ac883..1d6c5f77ae5 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -1105,7 +1105,6 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenRay, "getScreenRay()\n" ) { - KX_Camera* cam; MT_Vector3 vect; double x,y,dist; char *propName = NULL; diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index b40100db2f7..3e5594e0d1c 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -49,23 +49,20 @@ KX_ConstraintWrapper::~KX_ConstraintWrapper() { } -PyObject* KX_ConstraintWrapper::PyGetConstraintId(PyObject* args, PyObject* kwds) +PyObject* KX_ConstraintWrapper::PyGetConstraintId() { return PyInt_FromLong(m_constraintId); } PyObject* KX_ConstraintWrapper::PySetParam(PyObject* args, PyObject* kwds) { - int len = PyTuple_Size(args); - int success = 1; - int dof; float minLimit,maxLimit; - success = PyArg_ParseTuple(args,"iff:setParam",&dof,&minLimit,&maxLimit); - if (success) - { - m_physenv->setConstraintParam(m_constraintId,dof,minLimit,maxLimit); - } + + if (!PyArg_ParseTuple(args,"iff:setParam",&dof,&minLimit,&maxLimit)) + return NULL; + + m_physenv->setConstraintParam(m_constraintId,dof,minLimit,maxLimit); Py_RETURN_NONE; } @@ -120,7 +117,7 @@ int KX_ConstraintWrapper::py_setattro(PyObject *attr,PyObject* value) PyMethodDef KX_ConstraintWrapper::Methods[] = { - {"getConstraintId",(PyCFunction) KX_ConstraintWrapper::sPyGetConstraintId, METH_VARARGS}, + {"getConstraintId",(PyCFunction) KX_ConstraintWrapper::sPyGetConstraintId, METH_NOARGS}, {"setParam",(PyCFunction) KX_ConstraintWrapper::sPySetParam, METH_VARARGS}, {NULL,NULL} //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.h b/source/gameengine/Ketsji/KX_ConstraintWrapper.h index b8ac464ceab..d4f038e2898 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.h +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.h @@ -43,8 +43,7 @@ public: virtual ~KX_ConstraintWrapper (); int getConstraintId() { return m_constraintId;}; - KX_PYMETHOD(KX_ConstraintWrapper,TestMethod); - KX_PYMETHOD(KX_ConstraintWrapper,GetConstraintId); + KX_PYMETHOD_NOARGS(KX_ConstraintWrapper,GetConstraintId); KX_PYMETHOD(KX_ConstraintWrapper,SetParam); private: diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index 0d1bc289a5c..11effa1ca98 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -222,7 +222,6 @@ PyObject* KX_MeshProxy::PyGetVertex(PyObject* args, PyObject* kwds) { int vertexindex; int matindex; - PyObject* vertexob = NULL; if (!PyArg_ParseTuple(args,"ii:getVertex",&matindex,&vertexindex)) return NULL; diff --git a/source/gameengine/VideoTexture/PyTypeList.cpp b/source/gameengine/VideoTexture/PyTypeList.cpp index 6d2676dce09..2d571675dbd 100644 --- a/source/gameengine/VideoTexture/PyTypeList.cpp +++ b/source/gameengine/VideoTexture/PyTypeList.cpp @@ -45,7 +45,6 @@ bool PyTypeList::in (PyTypeObject * type) /// add type to list void PyTypeList::add (PyTypeObject * type, const char * name) { - PyTypeListItem * typeItem; // if list doesn't exist, create it if (m_list.get() == NULL) m_list.reset(new PyTypeListType()); -- cgit v1.2.3 From 137b3e1dc519bef99bad4201e9374346877bbe40 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Tue, 26 May 2009 12:57:16 +0000 Subject: == Sequencer == This adds a per preview option to set render sizes (which proxy size is used). That makes it possible to have * several small preview screens which update really fast using the proxy files * one large output screen that operates in full resolution Since most of the time not all input strips are considered when calculating an output screen, this is a big win. Also: one can disable a preview screen completely using this option. Other use cases: vector + chromaviews don't always need full resolution pictures and work equally well on proxy files! This option finally makes my working setup _completely_ realtime :) --- source/blender/include/BSE_sequence.h | 10 +- source/blender/makesdna/DNA_space_types.h | 3 +- source/blender/src/drawseq.c | 35 +++++-- source/blender/src/header_seq.c | 16 ++++ source/blender/src/sequence.c | 154 ++++++++++++++++++------------ 5 files changed, 142 insertions(+), 76 deletions(-) (limited to 'source') diff --git a/source/blender/include/BSE_sequence.h b/source/blender/include/BSE_sequence.h index 0d96de7be60..33a43e1a458 100644 --- a/source/blender/include/BSE_sequence.h +++ b/source/blender/include/BSE_sequence.h @@ -68,18 +68,20 @@ char *give_seqname(struct Sequence *seq); int evaluate_seq_frame(int cfra); struct StripElem *give_stripelem(struct Sequence *seq, int cfra); struct TStripElem *give_tstripelem(struct Sequence *seq, int cfra); -struct ImBuf *give_ibuf_seq(int rectx, int recty, int cfra, int chansel); +struct ImBuf *give_ibuf_seq(int rectx, int recty, int cfra, int chansel, + int render_size); /* chansel: render this channel. Default=0 (renders end result)*/ struct ImBuf *give_ibuf_seq_direct(int rectx, int recty, int cfra, - struct Sequence * seq); + int render_size, struct Sequence * seq); /* sequence prefetch API */ void seq_start_threads(); void seq_stop_threads(); -void give_ibuf_prefetch_request(int rectx, int recty, int cfra, int chanshown); +void give_ibuf_prefetch_request(int rectx, int recty, int cfra, int chanshown, + int render_size); void seq_wait_for_prefetch_ready(); struct ImBuf * give_ibuf_seq_threaded(int rectx, int recty, int cfra, - int chanshown); + int chanshown, int render_size); void free_imbuf_seq_except(int cfra); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index d14acc12693..4cbd31b4519 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -146,7 +146,8 @@ typedef struct SpaceSeq { View2D v2d; float xof, yof; /* offset for drawing the image preview */ - short mainb, pad; + short mainb; + short render_size; short chanshown; short zebra; int flag; diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c index 6bba4fbdcc4..7fd7d8880a1 100644 --- a/source/blender/src/drawseq.c +++ b/source/blender/src/drawseq.c @@ -849,6 +849,7 @@ static void draw_image_seq(ScrArea *sa) static int recursive= 0; float zoom; float zoomx, zoomy; + int render_size = 0; glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); @@ -856,8 +857,16 @@ static void draw_image_seq(ScrArea *sa) sseq= sa->spacedata.first; if(sseq==0) return; - rectx= (G.scene->r.size*G.scene->r.xsch)/100; - recty= (G.scene->r.size*G.scene->r.ysch)/100; + render_size = sseq->render_size; + if (render_size == 0) { + render_size = G.scene->r.size; + } + if (render_size < 0) { + return; + } + + rectx= (render_size*G.scene->r.xsch)/100; + recty= (render_size*G.scene->r.ysch)/100; /* BIG PROBLEM: the give_ibuf_seq() can call a rendering, which in turn calls redraws... this shouldn't belong in a window drawing.... @@ -870,16 +879,16 @@ static void draw_image_seq(ScrArea *sa) recursive= 1; if (special_seq_update) { ibuf= give_ibuf_seq_direct( - rectx, recty, (G.scene->r.cfra), + rectx, recty, (G.scene->r.cfra), render_size, special_seq_update); } else if (!U.prefetchframes || (G.f & G_PLAYANIM) == 0) { ibuf= (ImBuf *)give_ibuf_seq( rectx, recty, (G.scene->r.cfra), - sseq->chanshown); + sseq->chanshown, render_size); } else { ibuf= (ImBuf *)give_ibuf_seq_threaded( rectx, recty, (G.scene->r.cfra), - sseq->chanshown); + sseq->chanshown, render_size); } recursive= 0; @@ -930,7 +939,7 @@ static void draw_image_seq(ScrArea *sa) zoom= SEQ_ZOOM_FAC(sseq->zoom); if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) { - zoom /= G.scene->r.size / 100.0; + zoom /= render_size / 100.0; zoomx = zoom * ((float)G.scene->r.xasp / (float)G.scene->r.yasp); zoomy = zoom; } else { @@ -1112,13 +1121,21 @@ void drawprefetchseqspace(ScrArea *sa, void *spacedata) { SpaceSeq *sseq= sa->spacedata.first; int rectx, recty; + int render_size = sseq->render_size; + if (render_size == 0) { + render_size = G.scene->r.size; + } + if (render_size < 0) { + return; + } - rectx= (G.scene->r.size*G.scene->r.xsch)/100; - recty= (G.scene->r.size*G.scene->r.ysch)/100; + rectx= (render_size*G.scene->r.xsch)/100; + recty= (render_size*G.scene->r.ysch)/100; if(sseq->mainb) { give_ibuf_prefetch_request( - rectx, recty, (G.scene->r.cfra), sseq->chanshown); + rectx, recty, (G.scene->r.cfra), sseq->chanshown, + render_size); } } diff --git a/source/blender/src/header_seq.c b/source/blender/src/header_seq.c index 8138918877f..23712b93b50 100644 --- a/source/blender/src/header_seq.c +++ b/source/blender/src/header_seq.c @@ -740,6 +740,22 @@ void seq_buttons() xco+= 8 + XIC*3.5; + uiDefButS(block, MENU, B_REDR, + "Render size: %t" + "|R 100 %x100" + "|R 75 %x75" + "|R 50 %x50" + "|R 25 %x25" + "|R Sce %x0" + "|R Off %x-1", + xco,0,3.0 * XIC, YIC, &sseq->render_size, + 0,0,0,0, + "Use different (proxy) render size " + "for this preview screen, use scene render size " + "or disable this preview completely"); + + xco+= 8 + XIC*3.0; + if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) { uiDefButS(block, MENU, B_REDR, "Show zebra: %t" diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index a6f264e2b09..cf2b28c6d72 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -1047,7 +1047,8 @@ static int get_shown_sequences( #define PROXY_MAXFILE (2*FILE_MAXDIR+FILE_MAXFILE) -static int seq_proxy_get_fname(Sequence * seq, int cfra, char * name) +static int seq_proxy_get_fname(Sequence * seq, int cfra, char * name, + int render_size) { int frameno; char dir[FILE_MAXDIR]; @@ -1080,7 +1081,7 @@ static int seq_proxy_get_fname(Sequence * seq, int cfra, char * name) if (seq->type == SEQ_IMAGE) { StripElem * se = give_stripelem(seq, cfra); snprintf(name, PROXY_MAXFILE, "%s/images/%d/%s_proxy", - dir, G.scene->r.size, se->name); + dir, render_size, se->name); frameno = 1; } else if (seq->type == SEQ_MOVIE) { TStripElem * tse = give_tstripelem(seq, cfra); @@ -1089,14 +1090,14 @@ static int seq_proxy_get_fname(Sequence * seq, int cfra, char * name) snprintf(name, PROXY_MAXFILE, "%s/%s/%d/####", dir, seq->strip->stripdata->name, - G.scene->r.size); + render_size); } else { TStripElem * tse = give_tstripelem(seq, cfra); frameno = tse->nr + seq->anim_startofs; snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/####", dir, - G.scene->r.size); + render_size); } BLI_convertstringcode(name, G.sce); @@ -1108,7 +1109,8 @@ static int seq_proxy_get_fname(Sequence * seq, int cfra, char * name) return TRUE; } -static struct ImBuf * seq_proxy_fetch(Sequence * seq, int cfra) +static struct ImBuf * seq_proxy_fetch(Sequence * seq, int cfra, + int render_size) { char name[PROXY_MAXFILE]; @@ -1117,7 +1119,7 @@ static struct ImBuf * seq_proxy_fetch(Sequence * seq, int cfra) } /* rendering at 100% ? No real sense in proxy-ing, right? */ - if (G.scene->r.size == 100.0) { + if (render_size == 100) { return 0; } @@ -1125,7 +1127,7 @@ static struct ImBuf * seq_proxy_fetch(Sequence * seq, int cfra) TStripElem * tse = give_tstripelem(seq, cfra); int frameno = tse->nr + seq->anim_startofs; if (!seq->strip->proxy->anim) { - if (!seq_proxy_get_fname(seq, cfra, name)) { + if (!seq_proxy_get_fname(seq, cfra,name,render_size)) { return 0; } @@ -1138,7 +1140,7 @@ static struct ImBuf * seq_proxy_fetch(Sequence * seq, int cfra) return IMB_anim_absolute(seq->strip->proxy->anim, frameno); } - if (!seq_proxy_get_fname(seq, cfra, name)) { + if (!seq_proxy_get_fname(seq, cfra, name, render_size)) { return 0; } @@ -1150,9 +1152,9 @@ static struct ImBuf * seq_proxy_fetch(Sequence * seq, int cfra) } static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, - int build_proxy_run); + int build_proxy_run, int render_size); -static void seq_proxy_build_frame(Sequence * seq, int cfra) +static void seq_proxy_build_frame(Sequence * seq, int cfra, int render_size) { char name[PROXY_MAXFILE]; int quality; @@ -1166,7 +1168,7 @@ static void seq_proxy_build_frame(Sequence * seq, int cfra) } /* rendering at 100% ? No real sense in proxy-ing, right? */ - if (G.scene->r.size == 100.0) { + if (render_size == 100.0) { return; } @@ -1175,7 +1177,7 @@ static void seq_proxy_build_frame(Sequence * seq, int cfra) return; } - if (!seq_proxy_get_fname(seq, cfra, name)) { + if (!seq_proxy_get_fname(seq, cfra, name, render_size)) { return; } @@ -1189,14 +1191,14 @@ static void seq_proxy_build_frame(Sequence * seq, int cfra) se->ibuf = 0; } - do_build_seq_ibuf(seq, se, cfra, TRUE); + do_build_seq_ibuf(seq, se, cfra, TRUE, render_size); if (!se->ibuf) { return; } - rectx= (G.scene->r.size*G.scene->r.xsch)/100; - recty= (G.scene->r.size*G.scene->r.ysch)/100; + rectx= (render_size*G.scene->r.xsch)/100; + recty= (render_size*G.scene->r.ysch)/100; ibuf = se->ibuf; @@ -1251,7 +1253,8 @@ void seq_proxy_rebuild(Sequence * seq) TStripElem * tse = give_tstripelem(seq, cfra); if (!(tse->flag & STRIPELEM_PREVIEW_DONE)) { - seq_proxy_build_frame(seq, cfra); + seq_proxy_build_frame(seq, cfra, + G.scene->r.size); tse->flag |= STRIPELEM_PREVIEW_DONE; } if (blender_test_break()) { @@ -1264,7 +1267,8 @@ void seq_proxy_rebuild(Sequence * seq) TStripElem * tse = give_tstripelem(seq, cfra); if (!(tse->flag & STRIPELEM_PREVIEW_DONE)) { - seq_proxy_build_frame(seq, cfra); + seq_proxy_build_frame(seq, cfra, + G.scene->r.size); tse->flag |= STRIPELEM_PREVIEW_DONE; } if (blender_test_break()) { @@ -1752,10 +1756,10 @@ static void check_limiter_refcount_comp(const char * func, TStripElem *se) } static TStripElem* do_build_seq_array_recursively( - ListBase *seqbasep, int cfra, int chanshown); + ListBase *seqbasep, int cfra, int chanshown, int render_size); static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, - int build_proxy_run) + int build_proxy_run, int render_size) { char name[FILE_MAXDIR+FILE_MAXFILE]; int use_limiter = TRUE; @@ -1769,7 +1773,7 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, use_limiter = FALSE; if (!build_proxy_run && se->ibuf == 0) { - se->ibuf = seq_proxy_fetch(seq, cfra); + se->ibuf = seq_proxy_fetch(seq, cfra, render_size); if (se->ibuf) { use_limiter = TRUE; use_preprocess = TRUE; @@ -1778,7 +1782,8 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, if(!se->ibuf && seq->seqbase.first) { meta_se = do_build_seq_array_recursively( - &seq->seqbase, seq->start + se->nr, 0); + &seq->seqbase, seq->start + se->nr, 0, + render_size); check_limiter_refcount("do_build_seq_ibuf: for META", meta_se); @@ -1820,7 +1825,7 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, /* should the effect be recalculated? */ if (!build_proxy_run && se->ibuf == 0) { - se->ibuf = seq_proxy_fetch(seq, cfra); + se->ibuf = seq_proxy_fetch(seq, cfra, render_size); } if(se->ibuf == 0) { @@ -1841,7 +1846,8 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, BLI_convertstringcode(name, G.sce); BLI_convertstringframe(name, G.scene->r.cfra); if (!build_proxy_run) { - se->ibuf = seq_proxy_fetch(seq, cfra); + se->ibuf = seq_proxy_fetch(seq, cfra, + render_size); } copy_from_ibuf_still(seq, se); @@ -1866,7 +1872,8 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, } else if(seq->type == SEQ_MOVIE) { if(se->ok == STRIPELEM_OK && se->ibuf==0) { if(!build_proxy_run) { - se->ibuf = seq_proxy_fetch(seq, cfra); + se->ibuf = seq_proxy_fetch(seq, cfra, + render_size); } copy_from_ibuf_still(seq, se); @@ -1912,7 +1919,7 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, int sce_valid =sce&& (sce->camera || sce->r.scemode & R_DOSEQ); if (se->ibuf == NULL && sce_valid && !build_proxy_run) { - se->ibuf = seq_proxy_fetch(seq, cfra); + se->ibuf = seq_proxy_fetch(seq, cfra, render_size); if (se->ibuf) { input_preprocess(seq, se, cfra); } @@ -2010,9 +2017,11 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, } } -static TStripElem* do_build_seq_recursively(Sequence * seq, int cfra); +static TStripElem* do_build_seq_recursively(Sequence * seq, int cfra, + int render_size); -static void do_effect_seq_recursively(Sequence * seq, TStripElem *se, int cfra) +static void do_effect_seq_recursively(Sequence * seq, TStripElem *se, int cfra, + int render_size) { float fac, facf; struct SeqEffectHandle sh = get_sequence_effect(seq); @@ -2038,22 +2047,27 @@ static void do_effect_seq_recursively(Sequence * seq, TStripElem *se, int cfra) /* no input needed */ break; case 0: - se->se1 = do_build_seq_recursively(seq->seq1, cfra); - se->se2 = do_build_seq_recursively(seq->seq2, cfra); + se->se1 = do_build_seq_recursively(seq->seq1, cfra, + render_size); + se->se2 = do_build_seq_recursively(seq->seq2, cfra, + render_size); if (seq->seq3) { - se->se3 = do_build_seq_recursively(seq->seq3, cfra); + se->se3 = do_build_seq_recursively(seq->seq3, cfra, + render_size); } break; case 1: - se->se1 = do_build_seq_recursively(seq->seq1, cfra); + se->se1 = do_build_seq_recursively(seq->seq1, cfra, + render_size); break; case 2: - se->se2 = do_build_seq_recursively(seq->seq2, cfra); + se->se2 = do_build_seq_recursively(seq->seq2, cfra, + render_size); break; } - do_build_seq_ibuf(seq, se, cfra, FALSE); + do_build_seq_ibuf(seq, se, cfra, FALSE, render_size); /* children are not needed anymore ... */ @@ -2069,7 +2083,8 @@ static void do_effect_seq_recursively(Sequence * seq, TStripElem *se, int cfra) check_limiter_refcount("do_effect_seq_recursively", se); } -static TStripElem* do_build_seq_recursively_impl(Sequence * seq, int cfra) +static TStripElem* do_build_seq_recursively_impl(Sequence * seq, int cfra, + int render_size) { TStripElem *se; @@ -2077,9 +2092,9 @@ static TStripElem* do_build_seq_recursively_impl(Sequence * seq, int cfra) if(se) { if (seq->type & SEQ_EFFECT) { - do_effect_seq_recursively(seq, se, cfra); + do_effect_seq_recursively(seq, se, cfra, render_size); } else { - do_build_seq_ibuf(seq, se, cfra, FALSE); + do_build_seq_ibuf(seq, se, cfra, FALSE, render_size); } } check_limiter_refcount("do_build_seq_recursively_impl", se); @@ -2094,7 +2109,8 @@ instead of faking using the blend code below... */ -static TStripElem* do_handle_speed_effect(Sequence * seq, int cfra) +static TStripElem* do_handle_speed_effect(Sequence * seq, int cfra, + int render_size) { SpeedControlVars * s = (SpeedControlVars *)seq->effectdata; int nr = cfra - seq->start; @@ -2124,7 +2140,7 @@ static TStripElem* do_handle_speed_effect(Sequence * seq, int cfra) if (se->ibuf == NULL) { se1 = do_build_seq_recursively_impl( - seq->seq1, cfra_left); + seq->seq1, cfra_left, render_size); if((se1 && se1->ibuf && se1->ibuf->rect_float)) se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rectfloat, 0); @@ -2157,9 +2173,9 @@ static TStripElem* do_handle_speed_effect(Sequence * seq, int cfra) if (se->ibuf == NULL) { se1 = do_build_seq_recursively_impl( - seq->seq1, cfra_left); + seq->seq1, cfra_left, render_size); se2 = do_build_seq_recursively_impl( - seq->seq1, cfra_right); + seq->seq1, cfra_right, render_size); if((se1 && se1->ibuf && se1->ibuf->rect_float)) se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rectfloat, 0); @@ -2211,13 +2227,14 @@ static TStripElem* do_handle_speed_effect(Sequence * seq, int cfra) * */ -static TStripElem* do_build_seq_recursively(Sequence * seq, int cfra) +static TStripElem* do_build_seq_recursively(Sequence * seq, int cfra, + int render_size) { TStripElem* se; if (seq->type == SEQ_SPEED) { - se = do_handle_speed_effect(seq, cfra); + se = do_handle_speed_effect(seq, cfra, render_size); } else { - se = do_build_seq_recursively_impl(seq, cfra); + se = do_build_seq_recursively_impl(seq, cfra, render_size); } check_limiter_refcount("do_build_seq_recursively", se); @@ -2226,7 +2243,7 @@ static TStripElem* do_build_seq_recursively(Sequence * seq, int cfra) } static TStripElem* do_build_seq_array_recursively( - ListBase *seqbasep, int cfra, int chanshown) + ListBase *seqbasep, int cfra, int chanshown, int render_size) { Sequence* seq_arr[MAXSEQ+1]; int count; @@ -2256,7 +2273,7 @@ static TStripElem* do_build_seq_array_recursively( if(count == 1) { - se = do_build_seq_recursively(seq_arr[0], cfra); + se = do_build_seq_recursively(seq_arr[0], cfra, render_size); if (se->ibuf) { se->ibuf_comp = se->ibuf; IMB_refImBuf(se->ibuf_comp); @@ -2278,7 +2295,7 @@ static TStripElem* do_build_seq_array_recursively( break; } if (seq->blend_mode == SEQ_BLEND_REPLACE) { - do_build_seq_recursively(seq, cfra); + do_build_seq_recursively(seq, cfra, render_size); if (se->ibuf) { se->ibuf_comp = se->ibuf; IMB_refImBuf(se->ibuf); @@ -2311,7 +2328,7 @@ static TStripElem* do_build_seq_array_recursively( switch (early_out) { case -1: case 2: - do_build_seq_recursively(seq, cfra); + do_build_seq_recursively(seq, cfra, render_size); if (se->ibuf) { se->ibuf_comp = se->ibuf; IMB_refImBuf(se->ibuf_comp); @@ -2335,7 +2352,7 @@ static TStripElem* do_build_seq_array_recursively( } break; case 0: - do_build_seq_recursively(seq, cfra); + do_build_seq_recursively(seq, cfra, render_size); if (!se->ibuf) { se->ibuf = IMB_allocImBuf( (short)seqrectx, (short)seqrecty, @@ -2449,7 +2466,8 @@ static TStripElem* do_build_seq_array_recursively( * you have to unref after usage! */ -static ImBuf *give_ibuf_seq_impl(int rectx, int recty, int cfra, int chanshown) +static ImBuf *give_ibuf_seq_impl(int rectx, int recty, int cfra, int chanshown, + int render_size) { Editing *ed; int count; @@ -2470,7 +2488,8 @@ static ImBuf *give_ibuf_seq_impl(int rectx, int recty, int cfra, int chanshown) seqrectx= rectx; /* bad bad global! */ seqrecty= recty; - se = do_build_seq_array_recursively(seqbasep, cfra, chanshown); + se = do_build_seq_array_recursively(seqbasep, cfra, chanshown, + render_size); if(!se) { return 0; @@ -2481,7 +2500,7 @@ static ImBuf *give_ibuf_seq_impl(int rectx, int recty, int cfra, int chanshown) return se->ibuf_comp; } -ImBuf *give_ibuf_seq_direct(int rectx, int recty, int cfra, +ImBuf *give_ibuf_seq_direct(int rectx, int recty, int cfra, int render_size, Sequence * seq) { TStripElem* se; @@ -2489,7 +2508,7 @@ ImBuf *give_ibuf_seq_direct(int rectx, int recty, int cfra, seqrectx= rectx; /* bad bad global! */ seqrecty= recty; - se = do_build_seq_recursively(seq, cfra); + se = do_build_seq_recursively(seq, cfra, render_size); if(!se) { return 0; @@ -2504,9 +2523,11 @@ ImBuf *give_ibuf_seq_direct(int rectx, int recty, int cfra, return se->ibuf; } -ImBuf *give_ibuf_seq(int rectx, int recty, int cfra, int chanshown) +ImBuf *give_ibuf_seq(int rectx, int recty, int cfra, int chanshown, + int render_size) { - ImBuf* i = give_ibuf_seq_impl(rectx, recty, cfra, chanshown); + ImBuf* i = give_ibuf_seq_impl(rectx, recty, cfra, chanshown, + render_size); if (i) { IMB_cache_limiter_unref(i); @@ -2558,6 +2579,7 @@ typedef struct PrefetchQueueElem { int recty; int cfra; int chanshown; + int render_size; int monoton_cfra; @@ -2603,7 +2625,8 @@ static void * seq_prefetch_thread(void * This_) if (e->cfra >= s_last) { e->ibuf = give_ibuf_seq_impl( - e->rectx, e->recty, e->cfra, e->chanshown); + e->rectx, e->recty, e->cfra, e->chanshown, + e->render_size); } pthread_mutex_lock(&queue_lock); @@ -2712,7 +2735,8 @@ void seq_stop_threads() BLI_end_threads(0); } -void give_ibuf_prefetch_request(int rectx, int recty, int cfra, int chanshown) +void give_ibuf_prefetch_request(int rectx, int recty, int cfra, int chanshown, + int render_size) { PrefetchQueueElem * e; if (seq_thread_shutdown) { @@ -2724,6 +2748,7 @@ void give_ibuf_prefetch_request(int rectx, int recty, int cfra, int chanshown) e->recty = recty; e->cfra = cfra; e->chanshown = chanshown; + e->render_size = render_size; e->monoton_cfra = monoton_cfra++; pthread_mutex_lock(&queue_lock); @@ -2764,13 +2789,15 @@ void seq_wait_for_prefetch_ready() fprintf(stderr, "SEQ-THREAD: prefetch done\n"); } -ImBuf * give_ibuf_seq_threaded(int rectx, int recty, int cfra, int chanshown) +ImBuf * give_ibuf_seq_threaded(int rectx, int recty, int cfra, int chanshown, + int render_size) { PrefetchQueueElem * e = 0; int found_something = FALSE; if (seq_thread_shutdown) { - return give_ibuf_seq(rectx, recty, cfra, chanshown); + return give_ibuf_seq(rectx, recty, cfra, chanshown, + render_size); } while (!e) { @@ -2781,7 +2808,8 @@ ImBuf * give_ibuf_seq_threaded(int rectx, int recty, int cfra, int chanshown) if (cfra == e->cfra && chanshown == e->chanshown && rectx == e->rectx && - recty == e->recty) { + recty == e->recty && + render_size == e->render_size) { success = TRUE; found_something = TRUE; break; @@ -2793,7 +2821,8 @@ ImBuf * give_ibuf_seq_threaded(int rectx, int recty, int cfra, int chanshown) if (cfra == e->cfra && chanshown == e->chanshown && rectx == e->rectx && - recty == e->recty) { + recty == e->recty && + render_size == e->render_size) { found_something = TRUE; break; } @@ -2809,7 +2838,8 @@ ImBuf * give_ibuf_seq_threaded(int rectx, int recty, int cfra, int chanshown) cfra == tslot->current->cfra && chanshown == tslot->current->chanshown && rectx == tslot->current->rectx && - recty == tslot->current->recty) { + recty == tslot->current->recty && + render_size== tslot->current->render_size){ found_something = TRUE; break; } @@ -3048,7 +3078,7 @@ void do_render_seq(RenderResult *rr, int cfra) G.f |= G_PLAYANIM; /* waitcursor patch */ - ibuf= give_ibuf_seq(rr->rectx, rr->recty, cfra, 0); + ibuf= give_ibuf_seq(rr->rectx, rr->recty, cfra, 0, G.scene->r.size); if(ibuf) { if(ibuf->rect_float) { -- cgit v1.2.3 From 33304d022d7f43eb1319fe7e9db33ec6559c275d Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 26 May 2009 13:46:08 +0000 Subject: Bugfix #18801 Third transparent shadow bug... this time it's a Material Node, which has mirror + transp-shadow on, and when it traces its own material it enters an eternal loop... Raytracing + shading + materialnode combo really needs work! --- source/blender/nodes/intern/SHD_nodes/SHD_material.c | 2 ++ source/blender/render/extern/include/RE_shader_ext.h | 1 + source/blender/render/intern/source/rayshade.c | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_material.c b/source/blender/nodes/intern/SHD_nodes/SHD_material.c index c0a2534ac4a..69c2c0a345c 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_material.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_material.c @@ -130,7 +130,9 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in, nodestack_get_vec(&shi->translucency, SOCK_VALUE, in[MAT_IN_TRANSLUCENCY]); } + shi->nodes= 1; /* temp hack to prevent trashadow recursion */ node_shader_lamp_loop(shi, &shrnode); /* clears shrnode */ + shi->nodes= 0; /* write to outputs */ if(node->custom1 & SH_NODE_MAT_DIFF) { diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h index 2cee2673a26..0ad48fe97a9 100644 --- a/source/blender/render/extern/include/RE_shader_ext.h +++ b/source/blender/render/extern/include/RE_shader_ext.h @@ -171,6 +171,7 @@ typedef struct ShadeInput /* from initialize, part or renderlayer */ short do_preview; /* for nodes, in previewrender */ short thread, sample; /* sample: ShadeSample array index */ + short nodes; /* indicate node shading, temp hack to prevent recursion */ unsigned int lay; int layflag, passflag, combinedflag; diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index f4dcbe9e186..75b9557f337 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -263,7 +263,8 @@ static void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr) shade_input_set_shade_texco(shi); if(is->mode==RE_RAY_SHADOW_TRA) { - if(shi->mat->nodetree && shi->mat->use_nodes) { + /* temp hack to prevent recursion */ + if(shi->nodes==0 && shi->mat->nodetree && shi->mat->use_nodes) { ntreeShaderExecTree(shi->mat->nodetree, shi, shr); shi->mat= vlr->mat; /* shi->mat is being set in nodetree */ } @@ -1299,6 +1300,7 @@ static void ray_trace_shadow_tra(Isect *is, ShadeInput *origshi, int depth, int shi.xs= origshi->xs; shi.ys= origshi->ys; shi.lay= origshi->lay; + shi.nodes= origshi->nodes; shade_ray(is, &shi, &shr); if (traflag & RAY_TRA) -- cgit v1.2.3 From 7e48820a97a1cc5d806caa2c7ea5b47f4809aa58 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 26 May 2009 15:01:06 +0000 Subject: Fix for bug #18788: vector math node subtract did not work, patch by Matt D., thanks. --- source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c b/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c index 96db8db18a6..8a73a318f70 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c @@ -101,7 +101,7 @@ static void node_shader_exec_vect_math(void *data, bNode *node, bNodeStack **in, static int gpu_shader_vect_math(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *out) { - static char *names[] = {"vec_math_add", "vec_math_subtract", + static char *names[] = {"vec_math_add", "vec_math_sub", "vec_math_average", "vec_math_dot", "vec_math_cross", "vec_math_normalize"}; -- cgit v1.2.3 From 33b974ee43c2d6c131860efbe02fd478197b9fda Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 26 May 2009 16:15:40 +0000 Subject: BGE Py API - Deprecation warnings for using attribute access - Added dictionary functions to KX_GameObject and ListValue ob.get(key, default=None) ob.has_key(key) ob.has_key is important since there was no way to do something like hasattr(ob, "attr") which can be replaced by ob.has_key("attr") - (both still work of course). ob.get is just useful in many cases where you want a property if it exists but can fallback to a default. - CListValue::FindValue was adding a reference but the ~3 places it was used were releasing the reference. added a FindValue that accepts a const char* type to avoid converting python strings to STR_String. --- source/gameengine/Expressions/ListValue.cpp | 65 +++++++++++++++++-------- source/gameengine/Expressions/ListValue.h | 3 ++ source/gameengine/Expressions/Value.cpp | 6 +++ source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 1 - source/gameengine/Ketsji/KX_GameObject.cpp | 50 ++++++++++++++++++- source/gameengine/Ketsji/KX_GameObject.h | 5 ++ source/gameengine/PyDoc/GameTypes.py | 24 +++++++++ 7 files changed, 132 insertions(+), 22 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 75ae2cb787f..c741a6d8809 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -76,13 +76,9 @@ PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex) if (PyString_Check(pyindex)) { - const char *index = PyString_AsString(pyindex); - CValue *item = ((CListValue*) list)->FindValue(index); + CValue *item = ((CListValue*) list)->FindValue(PyString_AsString(pyindex)); if (item) - { - item->Release(); /* FindValue() AddRef's */ return item->GetProxy(); - } } else if (PyInt_Check(pyindex)) { @@ -279,10 +275,17 @@ PyParentObject CListValue::Parents[] = { PyMethodDef CListValue::Methods[] = { + /* List style access */ {"append", (PyCFunction)CListValue::sPyappend,METH_O}, {"reverse", (PyCFunction)CListValue::sPyreverse,METH_NOARGS}, {"index", (PyCFunction)CListValue::sPyindex,METH_O}, {"count", (PyCFunction)CListValue::sPycount,METH_O}, + + /* Dict style access */ + {"get", (PyCFunction)CListValue::sPyget,METH_VARARGS}, + {"has_key", (PyCFunction)CListValue::sPyhas_key,METH_O}, + + /* Own cvalue funcs */ {"from_id", (PyCFunction)CListValue::sPyfrom_id,METH_O}, {NULL,NULL} //Sentinel @@ -395,25 +398,23 @@ void CListValue::ReleaseAndRemoveAll() -CValue* CListValue::FindValue(const char * name) +CValue* CListValue::FindValue(const STR_String & name) { - CValue* resultval = NULL; - int i=0; + for (int i=0; i < GetCount(); i++) + if (GetValue(i)->GetName() == name) + return GetValue(i); - while (!resultval && i < GetCount()) - { - CValue* myval = GetValue(i); - - if (myval->GetName() == name) - resultval = GetValue(i)->AddRef(); // add referencecount - else - i++; - - } - return resultval; + return NULL; } - +CValue* CListValue::FindValue(const char * name) +{ + for (int i=0; i < GetCount(); i++) + if (GetValue(i)->GetName() == name) + return GetValue(i); + + return NULL; +} bool CListValue::SearchValue(CValue *val) { @@ -564,7 +565,31 @@ PyObject* CListValue::Pycount(PyObject* value) return PyInt_FromLong(numfound); } +/* Matches python dict.get(key, [default]) */ +PyObject* CListValue::Pyget(PyObject *args) +{ + char *key; + PyObject* def = Py_None; + + if (!PyArg_ParseTuple(args, "s|O:get", &key, &def)) + return NULL; + + CValue *item = FindValue((const char *)key); + if (item) + return item->GetProxy(); + + Py_INCREF(def); + return def; +} +/* Matches python dict.has_key() */ +PyObject* CListValue::Pyhas_key(PyObject* value) +{ + if (PyString_Check(value) && FindValue((const char *)PyString_AsString(value))) + Py_RETURN_TRUE; + + Py_RETURN_FALSE; +} PyObject* CListValue::Pyfrom_id(PyObject* value) { diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h index ad918cbb925..68e900e25e0 100644 --- a/source/gameengine/Expressions/ListValue.h +++ b/source/gameengine/Expressions/ListValue.h @@ -45,6 +45,7 @@ public: void SetReleaseOnDestruct(bool bReleaseContents); bool SearchValue(CValue* val); + CValue* FindValue(const STR_String & name); CValue* FindValue(const char *name); void ReleaseAndRemoveAll(); @@ -74,6 +75,8 @@ public: KX_PYMETHOD_NOARGS(CListValue,reverse); KX_PYMETHOD_O(CListValue,index); KX_PYMETHOD_O(CListValue,count); + KX_PYMETHOD_VARARGS(CListValue,get); + KX_PYMETHOD_O(CListValue,has_key); KX_PYMETHOD_O(CListValue,from_id); diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 08249f92902..7f4ed388442 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -556,6 +556,8 @@ PyAttributeDef CValue::Attributes[] = { PyObject* CValue::py_getattro(PyObject *attr) { + ShowDeprecationWarning("val = ob.attr", "val = ob['attr']"); + char *attr_str= PyString_AsString(attr); CValue* resultattr = GetProperty(attr_str); if (resultattr) @@ -655,6 +657,8 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) int CValue::py_delattro(PyObject *attr) { + ShowDeprecationWarning("del ob.attr", "del ob['attr']"); + char *attr_str= PyString_AsString(attr); if (RemoveProperty(attr_str)) return 0; @@ -665,6 +669,8 @@ int CValue::py_delattro(PyObject *attr) int CValue::py_setattro(PyObject *attr, PyObject* pyobj) { + ShowDeprecationWarning("ob.attr = val", "ob['attr'] = val"); + char *attr_str= PyString_AsString(attr); CValue* oldprop = GetProperty(attr_str); CValue* vallie; diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index f1543d752f1..bc2d718203b 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -714,7 +714,6 @@ void KX_BlenderMaterial::setObjectMatrixData(int i, RAS_IRasterizer *ras) mScene->GetObjectList()->FindValue(mMaterial->mapping[i].objconame); if(!obj) return; - obj->Release(); /* FindValue() AddRef's */ obj->Release(); diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 1f7eeca1b69..f75f611f9bb 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1190,7 +1190,11 @@ PyMethodDef KX_GameObject::Methods[] = { KX_PYMETHODTABLE_O(KX_GameObject, getDistanceTo), KX_PYMETHODTABLE_O(KX_GameObject, getVectTo), KX_PYMETHODTABLE(KX_GameObject, sendMessage), - + + // dict style access for props + {"has_key",(PyCFunction) KX_GameObject::sPyhas_key, METH_O}, + {"get",(PyCFunction) KX_GameObject::sPyget, METH_VARARGS}, + // deprecated {"getPosition", (PyCFunction) KX_GameObject::sPyGetPosition, METH_NOARGS}, {"setPosition", (PyCFunction) KX_GameObject::sPySetPosition, METH_O}, @@ -1899,6 +1903,8 @@ int KX_GameObject::py_setattro(PyObject *attr, PyObject *value) // py_setattro m int KX_GameObject::py_delattro(PyObject *attr) { + ShowDeprecationWarning("del ob.attr", "del ob['attr'] for user defined properties"); + char *attr_str= PyString_AsString(attr); if (RemoveProperty(attr_str)) // XXX - should call CValues instead but its only 2 lines here @@ -2737,6 +2743,48 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_GameObject, sendMessage, Py_RETURN_NONE; } +/* dict style access */ + + +/* Matches python dict.get(key, [default]) */ +PyObject* KX_GameObject::Pyget(PyObject *args) +{ + PyObject *key; + PyObject* def = Py_None; + PyObject* ret; + + if (!PyArg_ParseTuple(args, "O|O:get", &key, &def)) + return NULL; + + + if(PyString_Check(key)) { + CValue *item = GetProperty(PyString_AsString(key)); + if (item) + return item->GetProxy(); + } + + if (m_attr_dict && (ret=PyDict_GetItem(m_attr_dict, key))) { + Py_INCREF(ret); + return ret; + } + + Py_INCREF(def); + return def; +} + +/* Matches python dict.has_key() */ +PyObject* KX_GameObject::Pyhas_key(PyObject* value) +{ + if(PyString_Check(value) && GetProperty(PyString_AsString(value))) + Py_RETURN_TRUE; + + if (m_attr_dict && PyDict_GetItem(m_attr_dict, value)) + Py_RETURN_TRUE; + + Py_RETURN_FALSE; +} + + /* --------------------------------------------------------------------- * Some stuff taken from the header * --------------------------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index c89b8f30779..dbdea97031d 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -872,6 +872,11 @@ public: KX_PYMETHOD_DOC_O(KX_GameObject,getDistanceTo); KX_PYMETHOD_DOC_O(KX_GameObject,getVectTo); KX_PYMETHOD_DOC_VARARGS(KX_GameObject, sendMessage); + + /* Dict access */ + KX_PYMETHOD_VARARGS(KX_GameObject,get); + KX_PYMETHOD_O(KX_GameObject,has_key); + /* attributes */ static PyObject* pyattr_get_name(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index ca9c674a942..d951ec0c954 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -1008,6 +1008,17 @@ class CListValue(CPropValue): """ Reverse the order of the list. """ + def get(key, default=None): + """ + Return the value matching key, or the default value if its not found. + @return: The key value or a default. + """ + def has_key(key): + """ + Return True if the key is found. + @rtype: boolean + @return: The key value or a default. + """ def from_id(id): """ This is a funtion especially for the game engine to return a value with a spesific id. @@ -1614,6 +1625,7 @@ class KX_GameObject(SCA_IObject): @ivar childrenRecursive: all children of this object including childrens children, (read-only). @type childrenRecursive: L{CListValue} of L{KX_GameObject}'s @group Deprecated: getPosition, setPosition, setWorldPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass, getMesh, getChildren, getChildrenRecursive + @group Property Access: get, has_key, attrDict, getPropertyNames """ def endObject(): """ @@ -2056,6 +2068,18 @@ class KX_GameObject(SCA_IObject): @param to: The name of the object to send the message to (optional) @type to: string """ + def get(key, default=None): + """ + Return the value matching key, or the default value if its not found. + @return: The key value or a default. + """ + def has_key(key): + """ + Return True if the key is found. + @rtype: boolean + @return: The key value or a default. + """ + class KX_IpoActuator(SCA_IActuator): """ -- cgit v1.2.3 From 74977721a4516bf29052ff927e4752376e795e77 Mon Sep 17 00:00:00 2001 From: Chris Want Date: Tue, 26 May 2009 17:15:29 +0000 Subject: BGE build probs with CMake: directory "source/gameengine/SceneGraph" was been referenced as "source/gameengine/Scenegraph" in some include paths. --- source/gameengine/Expressions/CMakeLists.txt | 2 +- source/gameengine/GameLogic/CMakeLists.txt | 2 +- source/gameengine/Ketsji/KXNetwork/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/CMakeLists.txt b/source/gameengine/Expressions/CMakeLists.txt index eb87fdcee81..e3942b46557 100644 --- a/source/gameengine/Expressions/CMakeLists.txt +++ b/source/gameengine/Expressions/CMakeLists.txt @@ -31,7 +31,7 @@ SET(INC ../../../source/kernel/gen_system ../../../intern/string ../../../intern/moto/include - ../../../source/gameengine/Scenegraph + ../../../source/gameengine/SceneGraph ${PYTHON_INC} ) diff --git a/source/gameengine/GameLogic/CMakeLists.txt b/source/gameengine/GameLogic/CMakeLists.txt index 449aae3ac84..7e2bc85bd1f 100644 --- a/source/gameengine/GameLogic/CMakeLists.txt +++ b/source/gameengine/GameLogic/CMakeLists.txt @@ -31,7 +31,7 @@ SET(INC ../../../source/kernel/gen_system ../../../intern/string ../../../source/gameengine/Expressions - ../../../source/gameengine/Scenegraph + ../../../source/gameengine/SceneGraph ../../../intern/moto/include ../../../source/gameengine/Rasterizer ${PYTHON_INC} diff --git a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt index 999e7148039..d9a9fc54f4b 100644 --- a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt +++ b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt @@ -34,7 +34,7 @@ SET(INC ../../../../source/gameengine/Ketsji ../../../../source/gameengine/GameLogic ../../../../source/gameengine/Expressions - ../../../../source/gameengine/Scenegraph + ../../../../source/gameengine/SceneGraph ../../../../source/gameengine/Network ${PYTHON_INC} ) -- cgit v1.2.3 From 25569b0f7df6c29033834c281f246523b42bf16c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 26 May 2009 18:06:09 +0000 Subject: BGE PyAPI Bug reported by Pitel on blenderartist. importing "pygame" failed when running the BGE for the second time. Rather then clearing modules, backup and restore them (as its doing with sys.path) This way the BGE will never remember any modules imported during game play (which can cause bugs/crashes), but it also wont break pythons state by possibly removing modules that are being used internally. --- .../blender/python/api2_2x/bpy_internal_import.c | 3 +- .../blender/python/api2_2x/bpy_internal_import.h | 2 +- source/gameengine/Ketsji/KX_PythonInit.cpp | 99 ++++++++-------------- 3 files changed, 38 insertions(+), 66 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/bpy_internal_import.c b/source/blender/python/api2_2x/bpy_internal_import.c index 3bc90eb4f54..4aa703e8be4 100644 --- a/source/blender/python/api2_2x/bpy_internal_import.c +++ b/source/blender/python/api2_2x/bpy_internal_import.c @@ -281,6 +281,7 @@ PyMethodDef bpy_reload_meth[] = { {"bpy_reload_meth", blender_reload, METH_VARAR * even if we remove a python module a reimport will bring it back again. */ +#if 0 // not used anymore but may still come in handy later #if defined(WIN32) || defined(WIN64) #define SEPSTR "\\" @@ -336,4 +337,4 @@ void bpy_text_clear_modules(int clear_all) Py_DECREF(list); /* removes all references from append */ } - +#endif diff --git a/source/blender/python/api2_2x/bpy_internal_import.h b/source/blender/python/api2_2x/bpy_internal_import.h index 7220212f13e..c93d930dab0 100644 --- a/source/blender/python/api2_2x/bpy_internal_import.h +++ b/source/blender/python/api2_2x/bpy_internal_import.h @@ -37,7 +37,7 @@ PyObject* bpy_text_import( char *name, int *found ); PyObject* bpy_text_reimport( PyObject *module, int *found ); -void bpy_text_clear_modules( int clear_all ); /* Clear user modules */ +/* void bpy_text_clear_modules( int clear_all );*/ /* Clear user modules */ extern PyMethodDef bpy_import_meth[]; extern PyMethodDef bpy_reload_meth[]; diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 7c131d01cd1..ff5a37801f4 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -112,7 +112,6 @@ extern "C" { #include "GPU_material.h" static void setSandbox(TPythonSecurityLevel level); -static void clearGameModules(); // 'local' copy of canvas ptr, for window height/width python scripts static RAS_ICanvas* gp_Canvas = NULL; @@ -122,6 +121,7 @@ static RAS_IRasterizer* gp_Rasterizer = NULL; static char gp_GamePythonPath[FILE_MAXDIR + FILE_MAXFILE] = ""; static char gp_GamePythonPathOrig[FILE_MAXDIR + FILE_MAXFILE] = ""; // not super happy about this, but we need to remember the first loaded file for the global/dict load save static PyObject *gp_OrigPythonSysPath= NULL; +static PyObject *gp_OrigPythonSysModules= NULL; void KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,const MT_Vector3& color) { @@ -1465,9 +1465,9 @@ void setSandbox(TPythonSecurityLevel level) /* Explanation of * - * - backupPySysPath() : stores sys.path in gp_OrigPythonSysPath - * - initPySysPath(main) : initializes the blendfile and library paths - * - restorePySysPath() : restores sys.path from gp_OrigPythonSysPath + * - backupPySysObjects() : stores sys.path in gp_OrigPythonSysPath + * - initPySysObjects(main) : initializes the blendfile and library paths + * - restorePySysObjects() : restores sys.path from gp_OrigPythonSysPath * * These exist so the current blend dir "//" can always be used to import modules from. * the reason we need a few functions for this is that python is not only used by the game engine @@ -1482,23 +1482,27 @@ void setSandbox(TPythonSecurityLevel level) /** * So we can have external modules mixed with our blend files. */ -static void backupPySysPath(void) +static void backupPySysObjects(void) { PyObject *sys_path= PySys_GetObject("path"); /* should never fail */ + PyObject *sys_mods= PySys_GetObject("modules"); /* should never fail */ - /* just incase its set */ - Py_XDECREF(gp_OrigPythonSysPath); - gp_OrigPythonSysPath= NULL; - + /* paths */ + Py_XDECREF(gp_OrigPythonSysPath); /* just incase its set */ gp_OrigPythonSysPath = PyList_GetSlice(sys_path, 0, INT_MAX); /* copy the list */ + + /* modules */ + Py_XDECREF(gp_OrigPythonSysModules); /* just incase its set */ + gp_OrigPythonSysModules = PyDict_Copy(sys_mods); /* copy the list */ + } -/* for initPySysPath only, +/* for initPySysObjects only, * takes a blend path and adds a scripts dir from it * * "/home/me/foo.blend" -> "/home/me/scripts" */ -static void initPySysPath__append(PyObject *sys_path, char *filename) +static void initPySysObjects__append(PyObject *sys_path, char *filename) { PyObject *item; char expanded[FILE_MAXDIR + FILE_MAXFILE]; @@ -1515,13 +1519,13 @@ static void initPySysPath__append(PyObject *sys_path, char *filename) Py_DECREF(item); } -static void initPySysPath(Main *maggie) +static void initPySysObjects(Main *maggie) { PyObject *sys_path= PySys_GetObject("path"); /* should never fail */ if (gp_OrigPythonSysPath==NULL) { /* backup */ - backupPySysPath(); + backupPySysObjects(); } else { /* get the original sys path when the BGE started */ @@ -1531,27 +1535,36 @@ static void initPySysPath(Main *maggie) Library *lib= (Library *)maggie->library.first; while(lib) { - initPySysPath__append(sys_path, lib->name); + initPySysObjects__append(sys_path, lib->name); lib= (Library *)lib->id.next; } - initPySysPath__append(sys_path, gp_GamePythonPath); + initPySysObjects__append(sys_path, gp_GamePythonPath); // fprintf(stderr, "\nNew Path: %d ", PyList_Size(sys_path)); // PyObject_Print(sys_path, stderr, 0); } -static void restorePySysPath(void) +static void restorePySysObjects(void) { if (gp_OrigPythonSysPath==NULL) return; PyObject *sys_path= PySys_GetObject("path"); /* should never fail */ - + PyObject *sys_mods= PySys_GetObject("modules"); /* should never fail */ + + /* paths */ PyList_SetSlice(sys_path, 0, INT_MAX, gp_OrigPythonSysPath); Py_DECREF(gp_OrigPythonSysPath); gp_OrigPythonSysPath= NULL; + /* modules */ + PyDict_Clear(sys_mods); + PyDict_Update(sys_mods, gp_OrigPythonSysModules); + Py_DECREF(gp_OrigPythonSysModules); + gp_OrigPythonSysModules= NULL; + + // fprintf(stderr, "\nRestore Path: %d ", PyList_Size(sys_path)); // PyObject_Print(sys_path, stderr, 0); } @@ -1588,7 +1601,7 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur bpy_import_main_set(maggie); - initPySysPath(maggie); + initPySysObjects(maggie); first_time = false; @@ -1599,11 +1612,9 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur } void exitGamePlayerPythonScripting() -{ - //clearGameModules(); // were closing python anyway - +{ /* since python restarts we cant let the python backup of the sys.path hang around in a global pointer */ - restorePySysPath(); /* get back the original sys.path and clear the backup */ + restorePySysObjects(); /* get back the original sys.path and clear the backup */ Py_Finalize(); bpy_import_main_set(NULL); @@ -1629,10 +1640,7 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev bpy_import_main_set(maggie); - initPySysPath(maggie); - - /* clear user defined modules that may contain data from the last run */ - clearGameModules(); + initPySysObjects(maggie); PyObjectPlus::NullDeprecationWarning(); @@ -1640,46 +1648,9 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev return PyModule_GetDict(moduleobj); } -static void clearModule(PyObject *modules, const char *name) -{ - PyObject *mod= PyDict_GetItemString(modules, name); - - if (mod==NULL) - return; - - PyDict_Clear(PyModule_GetDict(mod)); /* incase there are any circular refs */ - PyDict_DelItemString(modules, name); -} - -static void clearGameModules() -{ - /* references to invalid BGE data is better supported in 2.49+ so dont clear dicts */ -#if 0 - /* Note, user modules could still reference these modules - * but since the dict's are cleared their members wont be accessible */ - - PyObject *modules= PySys_GetObject((char *)"modules"); - clearModule(modules, "Expression"); - clearModule(modules, "CValue"); - clearModule(modules, "PhysicsConstraints"); - clearModule(modules, "GameLogic"); - clearModule(modules, "Rasterizer"); - clearModule(modules, "GameKeys"); - clearModule(modules, "VideoTexture"); - clearModule(modules, "Mathutils"); - clearModule(modules, "Geometry"); - clearModule(modules, "BGL"); - PyErr_Clear(); // incase some of these were alredy removed. -#endif - - /* clear user defined modules, arg '1' for clear external py modules too */ - bpy_text_clear_modules(1); -} - void exitGamePythonScripting() { - clearGameModules(); - restorePySysPath(); /* get back the original sys.path and clear the backup */ + restorePySysObjects(); /* get back the original sys.path and clear the backup */ bpy_import_main_set(NULL); PyObjectPlus::ClearDeprecationWarning(); } -- cgit v1.2.3 From 328d3128a5806be3bb4f11f852fde108ebba955a Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Tue, 26 May 2009 18:37:46 +0000 Subject: BGE VideoTexture: VideoFFmpeg was missing a rewind function: rename stop() to pause() and add stop() that will also reset the frame counter. --- source/gameengine/VideoTexture/VideoBase.cpp | 5 +- source/gameengine/VideoTexture/VideoBase.h | 13 +++++- source/gameengine/VideoTexture/VideoFFmpeg.cpp | 64 ++++++++++++++++++++------ source/gameengine/VideoTexture/VideoFFmpeg.h | 5 +- 4 files changed, 69 insertions(+), 18 deletions(-) (limited to 'source') diff --git a/source/gameengine/VideoTexture/VideoBase.cpp b/source/gameengine/VideoTexture/VideoBase.cpp index 3c703d75cda..ada672c5569 100644 --- a/source/gameengine/VideoTexture/VideoBase.cpp +++ b/source/gameengine/VideoTexture/VideoBase.cpp @@ -113,7 +113,10 @@ void Video_open (VideoBase * self, char * file, short captureID) PyObject * Video_play (PyImage * self) { if (getVideo(self)->play()) Py_RETURN_TRUE; else Py_RETURN_FALSE; } -// stop video +// pause video +PyObject * Video_pause (PyImage * self) +{ if (getVideo(self)->pause()) Py_RETURN_TRUE; else Py_RETURN_FALSE; } + PyObject * Video_stop (PyImage * self) { if (getVideo(self)->stop()) Py_RETURN_TRUE; else Py_RETURN_FALSE; } diff --git a/source/gameengine/VideoTexture/VideoBase.h b/source/gameengine/VideoTexture/VideoBase.h index 15ecb7a78f4..0c8668ee0bc 100644 --- a/source/gameengine/VideoTexture/VideoBase.h +++ b/source/gameengine/VideoTexture/VideoBase.h @@ -80,7 +80,17 @@ public: } return false; } - /// stop/pause video + /// pause video + virtual bool pause (void) + { + if (m_status == SourcePlaying) + { + m_status = SourceStopped; + return true; + } + return false; + } + /// stop video virtual bool stop (void) { if (m_status == SourcePlaying) @@ -170,6 +180,7 @@ template void Video_init (PyImage * self) // video functions void Video_open (VideoBase * self, char * file, short captureID); PyObject * Video_play (PyImage * self); +PyObject * Video_pause (PyImage * self); PyObject * Video_stop (PyImage * self); PyObject * Video_refresh (PyImage * self); PyObject * Video_getStatus (PyImage * self, void * closure); diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp index d509f366910..7910113a225 100644 --- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp +++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp @@ -669,12 +669,12 @@ bool VideoFFmpeg::play (void) } -// stop video -bool VideoFFmpeg::stop (void) +// pause video +bool VideoFFmpeg::pause (void) { try { - if (VideoBase::stop()) + if (VideoBase::pause()) { return true; } @@ -683,6 +683,20 @@ bool VideoFFmpeg::stop (void) return false; } +// stop video +bool VideoFFmpeg::stop (void) +{ + try + { + VideoBase::stop(); + // force restart when play + m_lastFrame = -1; + return true; + } + CATCH_EXCP; + return false; +} + // set video range void VideoFFmpeg::setRange (double start, double stop) @@ -721,6 +735,8 @@ void VideoFFmpeg::loadFrame (void) { // get actual time double startTime = PIL_check_seconds_timer(); + if (m_lastFrame == -1) + m_startTime = startTime; double actTime = startTime - m_startTime; // if video has ended if (m_isFile && actTime * m_frameRate >= m_range[1]) @@ -886,28 +902,47 @@ AVFrame *VideoFFmpeg::grabFrame(long position) if (position != m_curPosition + 1) { double timeBase = av_q2d(m_formatCtx->streams[m_videoStream]->time_base); - long long pos = (long long) - ((long long) (position - m_preseek) * AV_TIME_BASE / m_baseFrameRate); - long long startTs = m_formatCtx->streams[m_videoStream]->start_time; + int64_t pos = (int64_t)((position - m_preseek) / (m_baseFrameRate*timeBase)); + int64_t startTs = m_formatCtx->streams[m_videoStream]->start_time; + int seekres; if (pos < 0) pos = 0; if (startTs != AV_NOPTS_VALUE) - pos += (long long)(startTs * AV_TIME_BASE * timeBase); + pos += startTs; if (position <= m_curPosition || !m_eof) { - // no need to seek past the end of the file - if (av_seek_frame(m_formatCtx, -1, pos, AVSEEK_FLAG_BACKWARD) >= 0) +#if 0 + // Tried to make this work but couldn't: seeking on byte is ignored by the + // format plugin and it will generally continue to read from last timestamp. + // Too bad because frame seek is not always able to get the first frame + // of the file. + if (position <= m_preseek) + { + // we can safely go the begining of the file + if (av_seek_frame(m_formatCtx, m_videoStream, 0, AVSEEK_FLAG_BYTE) >= 0) + { + // binary seek does not reset the timestamp, must do it now + av_update_cur_dts(m_formatCtx, m_formatCtx->streams[m_videoStream], startTs); + m_curPosition = 0; + } + } + else +#endif { // current position is now lost, guess a value. - // It's not important because it will be set at this end of this function - m_curPosition = position - m_preseek - 1; + if (av_seek_frame(m_formatCtx, m_videoStream, pos, AVSEEK_FLAG_BACKWARD) >= 0) + { + // current position is now lost, guess a value. + // It's not important because it will be set at this end of this function + m_curPosition = position - m_preseek - 1; + } } } // this is the timestamp of the frame we're looking for - targetTs = (long long)(((double) position) / m_baseFrameRate / timeBase); + targetTs = (int64_t)(position / (m_baseFrameRate * timeBase)); if (startTs != AV_NOPTS_VALUE) targetTs += startTs; @@ -1097,8 +1132,9 @@ int VideoFFmpeg_setDeinterlace (PyImage * self, PyObject * value, void * closure // methods structure static PyMethodDef videoMethods[] = { // methods from VideoBase class - {"play", (PyCFunction)Video_play, METH_NOARGS, "Play video"}, - {"stop", (PyCFunction)Video_stop, METH_NOARGS, "Stop (pause) video"}, + {"play", (PyCFunction)Video_play, METH_NOARGS, "Play (restart) video"}, + {"pause", (PyCFunction)Video_pause, METH_NOARGS, "pause video"}, + {"stop", (PyCFunction)Video_stop, METH_NOARGS, "stop video (play will replay it from start)"}, {"refresh", (PyCFunction)Video_refresh, METH_NOARGS, "Refresh video - get its status"}, {NULL} }; diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.h b/source/gameengine/VideoTexture/VideoFFmpeg.h index 51f1067c466..fbd04e7e1fc 100644 --- a/source/gameengine/VideoTexture/VideoFFmpeg.h +++ b/source/gameengine/VideoTexture/VideoFFmpeg.h @@ -83,9 +83,10 @@ public: /// play video virtual bool play (void); - /// stop/pause video + /// pause video + virtual bool pause (void); + /// stop video virtual bool stop (void); - /// set play range virtual void setRange (double start, double stop); /// set frame rate -- cgit v1.2.3 From 191e22dd62ee53fa8f6410d384116278c36e00b5 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Tue, 26 May 2009 21:32:19 +0000 Subject: BGE: fix a bug with kinematic object not giving the correct friction to dynamic object when they have a translation and rotation movement at the same time (translation is ignored). Performance: avoid unnecessary synchronization for static object. --- .../Physics/Bullet/CcdPhysicsController.cpp | 35 ++++++++++++++-------- 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'source') diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 9a5f9644a47..6b904364fbe 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -789,9 +789,12 @@ void CcdPhysicsController::RelativeTranslate(float dlocX,float dlocY,float dloc if (m_object) { m_object->activate(true); - if (m_object->isStaticObject() && !m_cci.m_bSensor) + if (m_object->isStaticObject()) { - m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + if (!m_cci.m_bSensor) + m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + // kinematic object should not set the transform, it disturbs the velocity interpolation + return; } // btRigidBody* body = GetRigidBody(); // not used anymore @@ -815,9 +818,12 @@ void CcdPhysicsController::RelativeRotate(const float rotval[9],bool local) if (m_object) { m_object->activate(true); - if (m_object->isStaticObject() && !m_cci.m_bSensor) + if (m_object->isStaticObject()) { - m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + if (!m_cci.m_bSensor) + m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + // kinematic object should not set the transform, it disturbs the velocity interpolation + return; } btMatrix3x3 drotmat( rotval[0],rotval[4],rotval[8], @@ -840,10 +846,9 @@ void CcdPhysicsController::RelativeRotate(const float rotval[9],bool local) void CcdPhysicsController::GetWorldOrientation(btMatrix3x3& mat) { - float orn[4]; - m_MotionState->getWorldOrientation(orn[0],orn[1],orn[2],orn[3]); - btQuaternion quat(orn[0],orn[1],orn[2],orn[3]); - mat.setRotation(quat); + float ori[12]; + m_MotionState->getWorldOrientation(ori); + mat.setFromOpenGLSubMatrix(ori); } void CcdPhysicsController::getOrientation(float &quatImag0,float &quatImag1,float &quatImag2,float &quatReal) @@ -859,9 +864,12 @@ void CcdPhysicsController::setOrientation(float quatImag0,float quatImag1,float if (m_object) { m_object->activate(true); - if (m_object->isStaticObject() && !m_cci.m_bSensor) + if (m_object->isStaticObject()) { - m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + if (!m_cci.m_bSensor) + m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + // kinematic object should not set the transform, it disturbs the velocity interpolation + return; } // not required //m_MotionState->setWorldOrientation(quatImag0,quatImag1,quatImag2,quatReal); @@ -911,9 +919,12 @@ void CcdPhysicsController::setPosition(float posX,float posY,float posZ) if (m_object) { m_object->activate(true); - if (m_object->isStaticObject() && !m_cci.m_bSensor) + if (m_object->isStaticObject()) { - m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + if (!m_cci.m_bSensor) + m_object->setCollisionFlags(m_object->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT); + // kinematic object should not set the transform, it disturbs the velocity interpolation + return; } // not required, this function is only used to update the physic controller //m_MotionState->setWorldPosition(posX,posY,posZ); -- cgit v1.2.3 From 0cab562e466352b9aaa409797e2efba7336554f5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 May 2009 02:03:22 +0000 Subject: Workaround for size 1 brushes not working with projection paint, need to investigate why this wont work but for now just clamp the value while projection painting. --- source/blender/src/imagepaint.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source') diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c index 1a6eb10b00b..e6b14497838 100644 --- a/source/blender/src/imagepaint.c +++ b/source/blender/src/imagepaint.c @@ -4438,6 +4438,7 @@ void imagepaint_paint(short mousebutton, short texpaint) BrushPainter *painter; ToolSettings *settings= G.scene->toolsettings; short prevmval[2], mval[2], project = 0; + short brush_size_orig; /* not nice hack because 1 size brushes always fail with projection paint */ double time; float pressure; int init = 1; @@ -4472,6 +4473,8 @@ void imagepaint_paint(short mousebutton, short texpaint) ps.brush = s.brush; ps.tool = s.tool; ps.blend = s.blend; + + brush_size_orig = ps.brush->size; /* hack, fixme */ } if(texpaint) { @@ -4535,6 +4538,10 @@ void imagepaint_paint(short mousebutton, short texpaint) persp(PERSP_WIN); return; } + + /* Dont allow brush size below 2 */ + if (ps.brush->size<=1) + ps.brush->size = 2; } settings->imapaint.flag |= IMAGEPAINT_DRAWING; @@ -4613,6 +4620,7 @@ void imagepaint_paint(short mousebutton, short texpaint) brush_painter_free(painter); if (project) { + ps.brush->size = brush_size_orig; project_paint_end(&ps); } -- cgit v1.2.3 From fb7d688c1bd327f17b86ac74dab511bab40496df Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 May 2009 03:43:22 +0000 Subject: flag the images as dirty when projection painting (so there is the option to repack a packed image) --- source/blender/src/imagepaint.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c index e6b14497838..afe9678a216 100644 --- a/source/blender/src/imagepaint.c +++ b/source/blender/src/imagepaint.c @@ -3300,6 +3300,7 @@ static void project_paint_end(ProjPaintState *ps) int size = sizeof(UndoTile **) * IMAPAINT_TILE_NUMBER(last_projIma->ibuf->x) * IMAPAINT_TILE_NUMBER(last_projIma->ibuf->y); last_projIma->undoRect = (UndoTile **) BLI_memarena_alloc(arena, size); memset(last_projIma->undoRect, 0, size); + last_projIma->ibuf->userflags |= IB_BITMAPDIRTY; } for (bucket_index = 0; bucket_index < bucket_tot; bucket_index++) { -- cgit v1.2.3 From 01f8956a6d6848e738dbd665b1c1b4dee6dbb445 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Wed, 27 May 2009 22:37:45 +0000 Subject: == FFMPEG == This fixes: [#17505] Bad Interlacing for NTSC in mpeg-2 files --- source/blender/blenkernel/intern/writeffmpeg.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index c3d8ed855a2..6576d25dd76 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -248,6 +248,9 @@ static void write_video_frame(AVFrame* frame) #ifdef FFMPEG_CODEC_TIME_BASE frame->pts = G.scene->r.cfra - G.scene->r.sfra; #endif + if (G.scene->r.mode & R_FIELDS) { + frame->top_field_first = ((G.scene->r.mode & R_ODDFIELD) != 0); + } outsize = avcodec_encode_video(c, video_buffer, video_buffersize, frame); -- cgit v1.2.3 From ea826759c459f675d53c2ee95870397d235d45b5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 28 May 2009 06:13:56 +0000 Subject: Projection paint, cloning from 1 layer to another would show ugly black lines at the seams because interpolation didnt wrap across the image. Added bilinear_interpolation_color_wrap to be used instead of bilinear_interpolation_color for painting. --- source/blender/imbuf/IMB_imbuf.h | 1 + source/blender/imbuf/intern/imageprocess.c | 67 ++++++++++++++++++++++++++++++ source/blender/src/imagepaint.c | 12 +++--- 3 files changed, 74 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index 8bc1439fd09..1d8035a2358 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -410,6 +410,7 @@ void bilinear_interpolation(struct ImBuf *in, struct ImBuf *out, float u, float void bicubic_interpolation_color(struct ImBuf *in, unsigned char *col, float *col_float, float u, float v); void neareast_interpolation_color(struct ImBuf *in, unsigned char *col, float *col_float, float u, float v); void bilinear_interpolation_color(struct ImBuf *in, unsigned char *col, float *col_float, float u, float v); +void bilinear_interpolation_color_wrap(struct ImBuf *in, unsigned char *col, float *col_float, float u, float v); /** * Change the ordering of the color bytes pointed to by rect from diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c index 6be257ff737..e4977c77155 100644 --- a/source/blender/imbuf/intern/imageprocess.c +++ b/source/blender/imbuf/intern/imageprocess.c @@ -303,6 +303,73 @@ void bilinear_interpolation_color(struct ImBuf *in, unsigned char *outI, float * } } +/* function assumes out to be zero'ed, only does RGBA */ +/* BILINEAR INTERPOLATION */ + +/* Note about wrapping, the u/v still needs to be within the image bounds, + * just the interpolation is wrapped. + * This the same as bilinear_interpolation_color except it wraps rather then using empty and emptyI */ +void bilinear_interpolation_color_wrap(struct ImBuf *in, unsigned char *outI, float *outF, float u, float v) +{ + float *row1, *row2, *row3, *row4, a, b; + unsigned char *row1I, *row2I, *row3I, *row4I; + float a_b, ma_b, a_mb, ma_mb; + int y1, y2, x1, x2; + + + /* ImBuf in must have a valid rect or rect_float, assume this is alredy checked */ + + x1= (int)floor(u); + x2= (int)ceil(u); + y1= (int)floor(v); + y2= (int)ceil(v); + + // sample area entirely outside image? + if (x2<0 || x1>in->x-1 || y2<0 || y1>in->y-1) return; + + /* wrap interpolation pixels - main difference from bilinear_interpolation_color */ + if(x1<0)x1= in->x+x1; + if(y1<0)y1= in->y+y1; + + if(x2>=in->x)x2= x2-in->x; + if(y2>=in->y)y2= y2-in->y; + + if (outF) { + // sample including outside of edges of image + row1= (float *)in->rect_float + in->x * y1 * 4 + 4*x1; + row2= (float *)in->rect_float + in->x * y2 * 4 + 4*x1; + row3= (float *)in->rect_float + in->x * y1 * 4 + 4*x2; + row4= (float *)in->rect_float + in->x * y2 * 4 + 4*x2; + + a= u-floor(u); + b= v-floor(v); + a_b= a*b; ma_b= (1.0f-a)*b; a_mb= a*(1.0f-b); ma_mb= (1.0f-a)*(1.0f-b); + + outF[0]= ma_mb*row1[0] + a_mb*row3[0] + ma_b*row2[0]+ a_b*row4[0]; + outF[1]= ma_mb*row1[1] + a_mb*row3[1] + ma_b*row2[1]+ a_b*row4[1]; + outF[2]= ma_mb*row1[2] + a_mb*row3[2] + ma_b*row2[2]+ a_b*row4[2]; + outF[3]= ma_mb*row1[3] + a_mb*row3[3] + ma_b*row2[3]+ a_b*row4[3]; + } + if (outI) { + // sample including outside of edges of image + row1I= (unsigned char *)in->rect + in->x * y1 * 4 + 4*x1; + row2I= (unsigned char *)in->rect + in->x * y2 * 4 + 4*x1; + row3I= (unsigned char *)in->rect + in->x * y1 * 4 + 4*x2; + row4I= (unsigned char *)in->rect + in->x * y2 * 4 + 4*x2; + + a= u-floor(u); + b= v-floor(v); + a_b= a*b; ma_b= (1.0f-a)*b; a_mb= a*(1.0f-b); ma_mb= (1.0f-a)*(1.0f-b); + + /* need to add 0.5 to avoid rounding down (causes darken with the smear brush) + * tested with white images and this should not wrap back to zero */ + outI[0]= (ma_mb*row1I[0] + a_mb*row3I[0] + ma_b*row2I[0]+ a_b*row4I[0]) + 0.5f; + outI[1]= (ma_mb*row1I[1] + a_mb*row3I[1] + ma_b*row2I[1]+ a_b*row4I[1]) + 0.5f; + outI[2]= (ma_mb*row1I[2] + a_mb*row3I[2] + ma_b*row2I[2]+ a_b*row4I[2]) + 0.5f; + outI[3]= (ma_mb*row1I[3] + a_mb*row3I[3] + ma_b*row2I[3]+ a_b*row4I[3]) + 0.5f; + } +} + void bilinear_interpolation(ImBuf *in, ImBuf *out, float u, float v, int xout, int yout) { diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c index afe9678a216..3ec4205d9cf 100644 --- a/source/blender/src/imagepaint.c +++ b/source/blender/src/imagepaint.c @@ -716,21 +716,21 @@ static int project_paint_PickColor(const ProjPaintState *ps, float pt[2], float if (ibuf->rect_float) { if (rgba_fp) { - bilinear_interpolation_color(ibuf, NULL, rgba_fp, x, y); + bilinear_interpolation_color_wrap(ibuf, NULL, rgba_fp, x, y); } else { float rgba_tmp_f[4]; - bilinear_interpolation_color(ibuf, NULL, rgba_tmp_f, x, y); + bilinear_interpolation_color_wrap(ibuf, NULL, rgba_tmp_f, x, y); IMAPAINT_FLOAT_RGBA_TO_CHAR(rgba, rgba_tmp_f); } } else { if (rgba) { - bilinear_interpolation_color(ibuf, rgba, NULL, x, y); + bilinear_interpolation_color_wrap(ibuf, rgba, NULL, x, y); } else { unsigned char rgba_tmp[4]; - bilinear_interpolation_color(ibuf, rgba_tmp, NULL, x, y); + bilinear_interpolation_color_wrap(ibuf, rgba_tmp, NULL, x, y); IMAPAINT_CHAR_RGBA_TO_FLOAT(rgba_fp, rgba_tmp); } } @@ -1342,10 +1342,10 @@ static void project_face_pixel(const MTFace *tf_other, ImBuf *ibuf_other, const if (ibuf_other->rect_float) { /* from float to float */ - bilinear_interpolation_color(ibuf_other, NULL, rgba_f, x, y); + bilinear_interpolation_color_wrap(ibuf_other, NULL, rgba_f, x, y); } else { /* from char to float */ - bilinear_interpolation_color(ibuf_other, rgba_ub, NULL, x, y); + bilinear_interpolation_color_wrap(ibuf_other, rgba_ub, NULL, x, y); } } -- cgit v1.2.3 From ca5d429bf9f324d8e9291c66dab400d2677834d7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 28 May 2009 06:34:56 +0000 Subject: grsaaynoel spent ~2hrs to figure this out, theeth, feel free to elaborate if the tip isnt quite correct. --- source/blender/src/drawview.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index 9b2f7fe53d9..50deea9e831 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -2321,7 +2321,7 @@ static void view3d_panel_bonesketch_spaces(short cntrl) uiBlockBeginAlign(block); /* use real flag instead of 1 */ - uiDefButBitC(block, TOG, BONE_SKETCHING, B_REDR, "Use Bone Sketching", 10, yco, 160, 20, &G.scene->toolsettings->bone_sketching, 0, 0, 0, 0, "Use sketching to create and edit bones"); + uiDefButBitC(block, TOG, BONE_SKETCHING, B_REDR, "Use Bone Sketching", 10, yco, 160, 20, &G.scene->toolsettings->bone_sketching, 0, 0, 0, 0, "Use sketching to create and edit bones, (Ctrl snaps to mesh volume)"); uiDefButBitC(block, TOG, BONE_SKETCHING_ADJUST, B_REDR, "A", 170, yco, 20, 20, &G.scene->toolsettings->bone_sketching, 0, 0, 0, 0, "Adjust strokes by drawing near them"); uiDefButBitC(block, TOG, BONE_SKETCHING_QUICK, B_REDR, "Q", 190, yco, 20, 20, &G.scene->toolsettings->bone_sketching, 0, 0, 0, 0, "Automatically convert and delete on stroke end"); yco -= 20; -- cgit v1.2.3 From b9d8a2716ae1fb85f2497352566b51b6073e038d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 28 May 2009 07:11:12 +0000 Subject: renamed python 'bookmark' attribute to 'useHighPriority', was renamed in the UI but not in python. --- source/gameengine/GameLogic/SCA_IController.cpp | 2 +- source/gameengine/PyDoc/GameTypes.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp index 84a6bfb8085..f2c3c83a2d9 100644 --- a/source/gameengine/GameLogic/SCA_IController.cpp +++ b/source/gameengine/GameLogic/SCA_IController.cpp @@ -244,7 +244,7 @@ PyAttributeDef SCA_IController::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("state", SCA_IController, pyattr_get_state), KX_PYATTRIBUTE_RO_FUNCTION("sensors", SCA_IController, pyattr_get_sensors), KX_PYATTRIBUTE_RO_FUNCTION("actuators", SCA_IController, pyattr_get_actuators), - KX_PYATTRIBUTE_BOOL_RW("bookmark",SCA_IController,m_bookmark), + KX_PYATTRIBUTE_BOOL_RW("useHighPriority",SCA_IController,m_bookmark), { NULL } //Sentinel }; diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index d951ec0c954..4f176c17af2 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -258,10 +258,9 @@ class SCA_IController(SCA_ILogicBrick): - note: the sensors are not necessarily owned by the same object. - note: when objects are instanced in dupligroups links may be lost from objects outside the dupligroup. @type actuators: sequence supporting index/string lookups and iteration. - @ivar bookmark: the bookmark option. - If set, the controller executes always before all other non-bookmarked controllers. - note: Order of execution between bookmarked controllers is not guaranteed. - @type bookmark: bool + @ivar useHighPriority: When set the controller executes always before all other controllers that dont have this set. + note: Order of execution between high priority controllers is not guaranteed. + @type useHighPriority: bool """ #{ Deprecated def getState(): @@ -2385,7 +2384,7 @@ class KX_MeshProxy(SCA_IObject): and have all collision primitives in one vertex array (ie. < 65535 verts) and be either a polytope or polyheder mesh. If you don't get a warning in the console when the collision type is polytope, the mesh is suitable for reinstance. - + @bug: This currently does not work. @rtype: boolean @return: True if reinstance succeeded, False if it failed. """ -- cgit v1.2.3 From 6ac072e1bd05d41ae0c713b9ab0c5b83477c2919 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 28 May 2009 11:04:45 +0000 Subject: BGE: no sleeping and lock axis physics options were not propagated to replicas. --- source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 6b904364fbe..3a3c817698b 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -700,17 +700,25 @@ void CcdPhysicsController::PostProcessReplica(class PHY_IMotionState* motionsta } } + // load some characterists that are not + btRigidBody* oldbody = GetRigidBody(); m_object = 0; CreateRigidbody(); - btRigidBody* body = GetRigidBody(); - if (body) { if (m_cci.m_mass) { body->setMassProps(m_cci.m_mass, m_cci.m_localInertiaTensor * m_cci.m_inertiaFactor); } + + if (oldbody) + { + body->setLinearFactor(oldbody->getLinearFactor()); + body->setAngularFactor(oldbody->getAngularFactor()); + if (oldbody->getActivationState() == DISABLE_DEACTIVATION) + body->setActivationState(DISABLE_DEACTIVATION); + } } // sensor object are added when needed if (!m_cci.m_bSensor) -- cgit v1.2.3 From 8c4620f3d3d5cb533f3d1bf5c526c6ffc0355aaa Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 28 May 2009 13:44:32 +0000 Subject: [#18840] Joystick sensor lag if(SDL_PollEvent(&sdl_event)) // if -> while fixed it removed 'm_buttonnum' was misleading, wasn't used as you expect. Added gravity to variable to world to be used by collada. --- source/blender/python/api2_2x/World.c | 23 ++++++++++++++ source/blender/python/api2_2x/doc/World.py | 2 ++ .../gameengine/GameLogic/Joystick/SCA_Joystick.cpp | 20 +++++++----- .../gameengine/GameLogic/Joystick/SCA_Joystick.h | 11 +------ .../GameLogic/Joystick/SCA_JoystickDefines.h | 1 + .../GameLogic/Joystick/SCA_JoystickEvents.cpp | 37 ++++++++++------------ 6 files changed, 55 insertions(+), 39 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/World.c b/source/blender/python/api2_2x/World.c index 354d8cda0b7..a209ec5a53d 100644 --- a/source/blender/python/api2_2x/World.c +++ b/source/blender/python/api2_2x/World.c @@ -106,6 +106,8 @@ static PyObject *World_clearScriptLinks( BPy_World * self, PyObject * args ); static PyObject *World_setCurrent( BPy_World * self ); static PyObject *World_getTextures( BPy_World * self ); static int World_setTextures( BPy_World * self, PyObject * value ); +static PyObject *World_getGravity( BPy_World * self ); +static int World_setGravity( BPy_World * self, PyObject * value ); static PyObject *World_copy( BPy_World * self ); @@ -259,6 +261,9 @@ static PyGetSetDef BPy_World_getseters[] = { "world ipo", NULL}, {"textures", (getter)World_getTextures, (setter)World_setTextures, "The World's texture list as a tuple", + NULL}, + {"gravity", (getter)World_getGravity, (setter)World_setGravity, + "Physics gravity setting", NULL}, {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ }; @@ -1136,3 +1141,21 @@ static int World_setTextures( BPy_World * self, PyObject * value ) Py_DECREF(value); return 0; } + +static PyObject *World_getGravity( BPy_World * self ) +{ + return PyFloat_FromDouble(self->world->gravity); +} + +static int World_setGravity( BPy_World * self, PyObject * value ) +{ + float f = PyFloat_AsDouble(value); + if (f==-1 && PyErr_Occurred()) + return EXPP_ReturnIntError( PyExc_TypeError, "expected a float or int" ); + + if (f<0.0f)f= 0.0f; + else if (f>25.0f)f= 25.0f; + + self->world->gravity= f; + return 0; +} diff --git a/source/blender/python/api2_2x/doc/World.py b/source/blender/python/api2_2x/doc/World.py index d8052c609cd..e81521b65d0 100644 --- a/source/blender/python/api2_2x/doc/World.py +++ b/source/blender/python/api2_2x/doc/World.py @@ -84,6 +84,8 @@ class World: @ivar ipo: The world type ipo linked to this world object. @type textures: a tuple of Blender MTex objects. @ivar textures: The World's texture list. Empty texture channels contains None. + @type gravity: float + @ivar gravity: World physics gravity setting between 0.0 and 25.0 """ def getRange(): diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp index 7c4ebb4c330..d83179d4f80 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp @@ -38,7 +38,6 @@ SCA_Joystick::SCA_Joystick(short int index) : m_joyindex(index), m_prec(3200), - m_buttonnum(-2), m_axismax(-1), m_buttonmax(-1), m_hatmax(-1), @@ -68,6 +67,7 @@ SCA_Joystick::~SCA_Joystick() } SCA_Joystick *SCA_Joystick::m_instance[JOYINDEX_MAX]; +int SCA_Joystick::m_joynum = 0; int SCA_Joystick::m_refCount = 0; SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex ) @@ -88,6 +88,9 @@ SCA_Joystick *SCA_Joystick::GetInstance( short int joyindex ) echo("Error-Initializing-SDL: " << SDL_GetError()); return NULL; } + + m_joynum = SDL_NumJoysticks(); + for (i=0; iCreateJoystickDevice(); @@ -155,12 +158,13 @@ bool SCA_Joystick::aAxisIsPositive(int axis_single) bool SCA_Joystick::aAnyButtonPressIsPositive(void) { - return (m_buttonnum==-2) ? false : true; -} - -bool SCA_Joystick::aAnyButtonReleaseIsPositive(void) -{ - return (m_buttonnum==-2) ? true : false; + /* this is needed for the "all events" option + * so we know if there are no buttons pressed */ + for (int i=0; im_joystick, i)) + return true; + + return false; } bool SCA_Joystick::aButtonPressIsPositive(int button) @@ -217,7 +221,7 @@ bool SCA_Joystick::CreateJoystickDevice(void) return false; #else if(m_isinit == false){ - if (m_joyindex>=SDL_NumJoysticks()) { + if (m_joyindex>=m_joynum) { // don't print a message, because this is done anyway //echo("Joystick-Error: " << SDL_NumJoysticks() << " avaiable joystick(s)"); diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h index 5822f8e8ff8..6324b898247 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h @@ -44,6 +44,7 @@ class SCA_Joystick { static SCA_Joystick *m_instance[JOYINDEX_MAX]; + static int m_joynum; static int m_refCount; class PrivateData; @@ -67,11 +68,6 @@ class SCA_Joystick */ int m_prec; - /* - * button values stored here - */ - int m_buttonnum; - /* * max # of buttons avail */ @@ -146,7 +142,6 @@ public: bool aAxisIsPositive(int axis_single); /* check a single axis only */ bool aAnyButtonPressIsPositive(void); - bool aAnyButtonReleaseIsPositive(void); bool aButtonPressIsPositive(int button); bool aButtonReleaseIsPositive(int button); bool aHatIsPositive(int hatnum, int dir); @@ -160,10 +155,6 @@ public: int GetAxisPosition(int index){ return m_axis_array[index]; } - - int GetButton(void){ - return m_buttonnum; - } int GetHat(int index){ return m_hat_array[index]; diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h b/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h index c7a9a5114df..70619ff337a 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h +++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h @@ -40,6 +40,7 @@ #define JOYINDEX_MAX 8 #define JOYAXIS_MAX 16 +#define JOYBUT_MAX 18 #define JOYHAT_MAX 4 #define JOYAXIS_RIGHT 0 diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp index 3ca8d7d2329..66193a2f4b9 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp @@ -42,7 +42,7 @@ void SCA_Joystick::OnAxisMotion(SDL_Event* sdl_event) m_istrig_axis = 1; } - +/* See notes below in the event loop */ void SCA_Joystick::OnHatMotion(SDL_Event* sdl_event) { if(sdl_event->jhat.hat >= JOYAXIS_MAX) @@ -52,30 +52,20 @@ void SCA_Joystick::OnHatMotion(SDL_Event* sdl_event) m_istrig_hat = 1; } +/* See notes below in the event loop */ void SCA_Joystick::OnButtonUp(SDL_Event* sdl_event) { m_istrig_button = 1; - - /* this is needed for the "all events" option - * so we know if there are no buttons pressed */ - int i; - for (i=0; im_joystick, i)) { - m_buttonnum = i; - return; - } - } - m_buttonnum = -2; } void SCA_Joystick::OnButtonDown(SDL_Event* sdl_event) { - if(sdl_event->jbutton.button <= m_buttonmax) /* unsigned int so always above 0 */ - { - m_istrig_button = 1; - m_buttonnum = sdl_event->jbutton.button; - } + //if(sdl_event->jbutton.button > m_buttonmax) /* unsigned int so always above 0 */ + // return; + // sdl_event->jbutton.button; + + m_istrig_button = 1; } @@ -84,22 +74,27 @@ void SCA_Joystick::OnNothing(SDL_Event* sdl_event) m_istrig_axis = m_istrig_button = m_istrig_hat = 0; } -/* only handle events for 1 joystick */ - void SCA_Joystick::HandleEvents(void) { SDL_Event sdl_event; int i; - for (i=0; iOnNothing(&sdl_event); } - if(SDL_PollEvent(&sdl_event)) + while(SDL_PollEvent(&sdl_event)) { /* Note! m_instance[sdl_event.jaxis.which] * will segfault if over JOYINDEX_MAX, not too nice but what are the chances? */ + + /* Note!, with buttons, this wont care which button is pressed, + * only to set 'm_istrig_button', actual pressed buttons are detected by SDL_JoystickGetButton */ + + /* Note!, if you manage to press and release a button within 1 logic tick + * it wont work as it should */ + switch(sdl_event.type) { case SDL_JOYAXISMOTION: -- cgit v1.2.3 From 0edb6e89be23c20f1b1e3521ea854e44829b4969 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 28 May 2009 14:01:10 +0000 Subject: [#18803] 'ShadeModes' dictionary and 'shadeMode' instance variable exported to Python API Ton was ok with adding Vladislav Turbanov (vladius)'s patch during the freeze. --- source/blender/python/api2_2x/Material.c | 49 +++++++++++++++++++++++++-- source/blender/python/api2_2x/doc/Material.py | 7 ++++ 2 files changed, 54 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c index cb2c81aba6e..ad4296d19d8 100644 --- a/source/blender/python/api2_2x/Material.c +++ b/source/blender/python/api2_2x/Material.c @@ -335,6 +335,20 @@ static PyObject *M_Material_Get( PyObject * self, PyObject * args ) } } +static PyObject *Material_ShadeModesDict( void ) +{ + PyObject *ShadeModes = PyConstant_New( ); + + if( ShadeModes ) { + BPy_constant *c = ( BPy_constant * ) ShadeModes; + + PyConstant_Insert(c, "CUBIC", PyInt_FromLong(MA_CUBIC)); + PyConstant_Insert(c, "OBCOLOR", PyInt_FromLong(MA_OBCOLOR)); + } + + return ShadeModes; +} + static PyObject *Material_ModesDict( void ) { PyObject *Modes = PyConstant_New( ); @@ -454,12 +468,13 @@ static PyObject *Material_ColorRampInputDict( void ) /*****************************************************************************/ PyObject *Material_Init( void ) { - PyObject *submodule, *Modes, *Shaders, *ColorbandInput, *ColorbandMethod; + PyObject *submodule, *Modes, *ShadeModes, *Shaders, *ColorbandInput, *ColorbandMethod; if( PyType_Ready( &Material_Type ) < 0) return NULL; Modes = Material_ModesDict( ); + ShadeModes = Material_ShadeModesDict( ); Shaders = Material_ShadersDict( ); ColorbandMethod = Material_ColorRampMethodsDict( ); ColorbandInput = Material_ColorRampInputDict( ); @@ -469,6 +484,8 @@ PyObject *Material_Init( void ) if( Modes ) PyModule_AddObject( submodule, "Modes", Modes ); + if( ShadeModes ) + PyModule_AddObject( submodule, "ShadeModes", ShadeModes ); if( Shaders ) PyModule_AddObject( submodule, "Shaders", Shaders ); if( ColorbandMethod ) @@ -541,6 +558,7 @@ static PyObject *Matr_oldsetTranslucency( BPy_Material * self, PyObject * args ) static int Material_setIpo( BPy_Material * self, PyObject * value ); static int Material_setMode( BPy_Material * self, PyObject * value ); +static int Material_setShadeMode( BPy_Material * self, PyObject * value ); static int Material_setRGBCol( BPy_Material * self, PyObject * value ); static int Material_setSpecCol( BPy_Material * self, PyObject * value ); static int Material_setMirCol( BPy_Material * self, PyObject * value ); @@ -620,6 +638,7 @@ static PyObject *Material_getColorComponent( BPy_Material * self, /*****************************************************************************/ static PyObject *Material_getIpo( BPy_Material * self ); static PyObject *Material_getMode( BPy_Material * self ); +static PyObject *Material_getShadeMode( BPy_Material * self ); static PyObject *Material_getRGBCol( BPy_Material * self ); /*static PyObject *Material_getAmbCol(BPy_Material *self);*/ static PyObject *Material_getSpecCol( BPy_Material * self ); @@ -1098,6 +1117,10 @@ static PyGetSetDef BPy_Material_getseters[] = { (getter)Material_getMode, (setter)Material_setMode, "Material mode bitmask", NULL}, + {"shadeMode", + (getter)Material_getShadeMode, (setter)Material_setShadeMode, + "Material shade mode bitmask", + NULL}, {"nFlares", (getter)Material_getNFlares, (setter)Material_setNFlares, "Number of subflares with halo", @@ -1495,6 +1518,11 @@ static PyObject *Material_getMode( BPy_Material * self ) return PyInt_FromLong( ( long ) self->material->mode ); } +static PyObject *Material_getShadeMode( BPy_Material * self ) +{ + return PyInt_FromLong( ( long ) self->material->shade_flag ); +} + static PyObject *Material_getRGBCol( BPy_Material * self ) { return rgbTuple_getCol( self->col ); @@ -1970,6 +1998,24 @@ static int Material_setMode( BPy_Material * self, PyObject * value ) return 0; } +static int Material_setShadeMode( BPy_Material * self, PyObject * value ) +{ + int param; + + if( !PyInt_Check( value ) ) { + char errstr[128]; + sprintf ( errstr , "expected int bitmask of 0x%08x", (MA_CUBIC | MA_OBCOLOR) ); + return EXPP_ReturnIntError( PyExc_TypeError, errstr ); + } + param = PyInt_AS_LONG ( value ); + if ( ( param & (MA_CUBIC | MA_OBCOLOR) ) != param ) + return EXPP_ReturnIntError( PyExc_ValueError, + "invalid bit(s) set in mask" ); + self->material->shade_flag |= param; + + return 0; +} + static int Material_setRGBCol( BPy_Material * self, PyObject * value ) { return rgbTuple_setCol( self->col, value ); @@ -3476,4 +3522,3 @@ static int Material_setColorbandSpecularInput ( BPy_Material * self, PyObject * return EXPP_setIValueClamped(value, &self->material->rampin_spec, MA_RAMP_IN_SHADER, MA_RAMP_IN_RESULT, 'b'); } - diff --git a/source/blender/python/api2_2x/doc/Material.py b/source/blender/python/api2_2x/doc/Material.py index b37fd660810..3b8148b3f11 100644 --- a/source/blender/python/api2_2x/doc/Material.py +++ b/source/blender/python/api2_2x/doc/Material.py @@ -69,6 +69,11 @@ Example:: - NMAP_TS - Tangent space normal mapping. - GROUP_EXCLUSIVE - Light from this group even if the lights are on a hidden Layer. +@type ShadeModes: readonly dictionary +@var ShadeModes: The available Material Shade Modes. + - CUBIC - Use cubic interpolation of diffuse values, for smoother transitions. + - OBCOLOR - Modulate result with a per object color. + @type Shaders: readonly dictionary @var Shaders: The available Material Shaders. - DIFFUSE_LAMBERT - Make Material use the lambert diffuse shader. @@ -246,6 +251,8 @@ class Material: @ivar mode: Mode mode bitfield. See L{the Modes dictionary} keys and descriptions. @type mode: int + @ivar shadeMode: Shade mode bitfield. See L{the ShadeModes dictionary} keys and descriptions. + @type shadeMode: int @ivar nFlares: Number of subflares with halo. Value is clamped to the range [1,32]. @type nFlares: int -- cgit v1.2.3 From bdfa07cddb4aaec98e761d2b06730fdf49a8365d Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Thu, 28 May 2009 14:24:16 +0000 Subject: Python API ---------- Bugfix: make bpy.data.meshes.new() work the same way as Blender.Mesh.New(). --- source/blender/python/api2_2x/bpy_data.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/bpy_data.c b/source/blender/python/api2_2x/bpy_data.c index d3499a79874..d2e80bc3611 100644 --- a/source/blender/python/api2_2x/bpy_data.c +++ b/source/blender/python/api2_2x/bpy_data.c @@ -404,6 +404,7 @@ PyObject *LibBlockSeq_new(BPy_LibBlockSeq *self, PyObject * args, PyObject *kwd) float color[] = {0, 0, 0, 1}; short data_code = 0; int user_count = 0; + PyObject *newOb = NULL; /* Load from file */ if ( ( self->type==ID_IM || self->type==ID_VF || @@ -594,7 +595,13 @@ PyObject *LibBlockSeq_new(BPy_LibBlockSeq *self, PyObject * args, PyObject *kwd) /* set some types user count to 1, otherwise zero */ id->us = user_count; - return GetPyObjectFromID(id); + newOb = GetPyObjectFromID(id); + /* if object is a mesh, set the new flag so memory can be deallocated + * later if the mesh is not linked to an object (consistent with the + * Blender.Mesh.New() method */ + if (self->type == ID_ME) + ((BPy_Mesh *)newOb)->new = 1; + return newOb; } -- cgit v1.2.3 From 17c51c6cb778aa584dee93c9bd70d1a0844d53ac Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Thu, 28 May 2009 22:26:28 +0000 Subject: Bullet Physics maxphystep = 1 is better general default to avoid vicious circle (graphics slower -> physics slower -> overall frametime slower -> graphics slower etc.) See difference in vault.blend --- source/blender/blenkernel/intern/world.c | 2 +- source/blender/blenloader/intern/readfile.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index d47f4efeb4e..41017cb0116 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -112,7 +112,7 @@ World *add_world(char *name) wrld->ticrate = 60; wrld->maxlogicstep = 5; wrld->physubstep = 1; - wrld->maxphystep = 5; + wrld->maxphystep = 1; return wrld; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index a99cb86f86b..8cfe3ea8ace 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8131,7 +8131,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) wrld->ticrate = 60; wrld->maxlogicstep = 5; wrld->physubstep = 1; - wrld->maxphystep = 5; + wrld->maxphystep = 1; } } -- cgit v1.2.3 From 39177018af16b208e41714d454a44c58a2eea0b7 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Fri, 29 May 2009 08:55:14 +0000 Subject: Revert commit 20478: instead of changing the default in blender, it's better to change the values for the demos that need it. --- source/blender/blenkernel/intern/world.c | 2 +- source/blender/blenloader/intern/readfile.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index 41017cb0116..d47f4efeb4e 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -112,7 +112,7 @@ World *add_world(char *name) wrld->ticrate = 60; wrld->maxlogicstep = 5; wrld->physubstep = 1; - wrld->maxphystep = 1; + wrld->maxphystep = 5; return wrld; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 8cfe3ea8ace..a99cb86f86b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8131,7 +8131,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) wrld->ticrate = 60; wrld->maxlogicstep = 5; wrld->physubstep = 1; - wrld->maxphystep = 1; + wrld->maxphystep = 5; } } -- cgit v1.2.3 From edcb9f88635a130dbf342ce5203b5357e306577c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 29 May 2009 09:22:24 +0000 Subject: workaround for strange python problem in the BGE and BPy API where printing warnings mistook the blender binary for a script - argv[0], Binary lines were printed into the console sometimes causing console beeps and corrupting future console output. Internal texts file on disk is not used it seems python warnings dont support this (even though exceptions do). The most common cause of this is passing a float as an argument to a method that took an int. get around this by setting __file__ in the namespace to the script name before executing the script, the file lines are not found but at least the output is not weird and confusing. Added read only 'mode' attribute to the python controller so there is a way to tell if its executing a module or a script. Updated docs to better explain execution methods. --- source/blender/python/BPY_interface.c | 6 +++++- source/gameengine/GameLogic/SCA_PythonController.cpp | 6 ++++++ source/gameengine/PyDoc/GameTypes.py | 17 ++++++++++++----- 3 files changed, 23 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index 1f35ebad9f7..72cc4f6cfde 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -2780,7 +2780,11 @@ static PyObject *RunPython( Text * text, PyObject * globaldict ) } } - + + /* Without __file__ set the sys.argv[0] is used for the filename + * which ends up with lines from the blender binary being printed in the console */ + PyDict_SetItemString(globaldict, "__file__", PyString_FromString(text->id.name+2)); + return PyEval_EvalCode( text->compiled, globaldict, globaldict ); } diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 52f6bece132..80e4f54c9c5 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -147,6 +147,11 @@ void SCA_PythonController::SetDictionary(PyObject* pythondictionary) Py_DECREF(m_pythondictionary); } m_pythondictionary = PyDict_Copy(pythondictionary); /* new reference */ + + /* Without __file__ set the sys.argv[0] is used for the filename + * which ends up with lines from the blender binary being printed in the console */ + PyDict_SetItemString(m_pythondictionary, "__file__", PyString_FromString(m_scriptName.Ptr())); + } int SCA_PythonController::IsTriggered(class SCA_ISensor* sensor) @@ -266,6 +271,7 @@ PyMethodDef SCA_PythonController::Methods[] = { PyAttributeDef SCA_PythonController::Attributes[] = { KX_PYATTRIBUTE_RW_FUNCTION("script", SCA_PythonController, pyattr_get_script, pyattr_set_script), + KX_PYATTRIBUTE_INT_RO("mode", SCA_PythonController, m_mode), { NULL } //Sentinel }; diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index 4f176c17af2..4ab175a8f6c 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -5205,8 +5205,15 @@ class SCA_PythonController(SCA_IController): Properties: - @ivar script: the Python script this controller executes + @ivar script: The value of this variable depends on the execution methid. + - When 'Script' execution mode is set this value contains the entire python script as a single string (not the script name as you might expect) which can be modified to run different scripts. + - When 'Module' execution mode is set this value will contain a single line string - module name and function "module.func" or "package.modile.func" where the module names are python textblocks or external scripts. + note: once this is set the script name given for warnings will remain unchanged. @type script: string + @ivar mode: the execution mode for this controller (read-only). + - Script: 0, Execite the L{script} as a python code. + - Module: 1, Execite the L{script} as a module and function. + @type mode: int @group Deprecated: getScript, setScript """ @@ -5222,17 +5229,17 @@ class SCA_PythonController(SCA_IController): """ def getScript(): """ - Gets the Python script this controller executes. + Gets the Python script body this controller executes. @deprecated: Use the L{script} attribute instead. @rtype: string """ - def setScript(script): + def setScript(script_body): """ - Sets the Python script this controller executes. + Sets the Python script string this controller executes. @deprecated: Use the L{script} attribute instead. - @type script: string. + @type script_body: string. """ class SCA_RandomActuator(SCA_IActuator): -- cgit v1.2.3 From 6ee8067189743f1feee960079a36fe4a31fadf30 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 29 May 2009 09:27:48 +0000 Subject: typo in message --- source/blender/python/BPY_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index 72cc4f6cfde..46cb6bbdf63 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -851,7 +851,7 @@ int BPY_run_script(Script *script) pyarg = Py_None; } else { if (!BLI_exists(script->scriptname)) { - printf( "Script does not exit %s\n", script->scriptname ); + printf( "Script does not exist %s\n", script->scriptname ); free_libblock( &G.main->script, script ); PyGILState_Release(gilstate); return 0; -- cgit v1.2.3 From cee915ab56ebc02f246b12ff263f9a30edb1c5c4 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 29 May 2009 12:26:47 +0000 Subject: NLA SoC: Start of UI Drawing Code for NLA Editor In this commit, I've only setup the drawing code for the channels list. Only the drawing of the 'active action' dummy-line has been tested so far. --- source/blender/blenloader/intern/readfile.c | 2 +- source/blender/editors/animation/anim_filter.c | 75 +++- source/blender/editors/animation/keyframes_draw.c | 2 - source/blender/editors/include/ED_anim_api.h | 1 + source/blender/editors/include/UI_view2d.h | 2 + source/blender/editors/interface/resources.c | 19 +- source/blender/editors/interface/view2d.c | 23 +- source/blender/editors/space_graph/space_graph.c | 2 +- source/blender/editors/space_nla/nla_draw.c | 480 ++++++++++++++++++++++ source/blender/editors/space_nla/nla_edit.c | 75 ++++ source/blender/editors/space_nla/nla_header.c | 76 +++- source/blender/editors/space_nla/nla_intern.h | 22 + source/blender/editors/space_nla/space_nla.c | 184 ++++++++- source/blender/makesdna/DNA_action_types.h | 11 +- 14 files changed, 902 insertions(+), 72 deletions(-) create mode 100644 source/blender/editors/space_nla/nla_draw.c create mode 100644 source/blender/editors/space_nla/nla_edit.c (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 192016f712d..2050e5da3ff 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5680,7 +5680,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); ar->v2d.scroll |= (V2D_SCROLL_RIGHT); ar->v2d.keepzoom= V2D_LOCKZOOM_Y; - ar->v2d.align= V2D_ALIGN_NO_POS_Y; + ar->v2d.align= V2D_ALIGN_NO_NEG_Y; ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL; break; } diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 69e4fbfb08e..f12e9a51f32 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -244,7 +244,7 @@ static short nlaedit_get_context (bAnimContext *ac, SpaceNla *snla) { /* init dopesheet data if non-existant (i.e. for old files) */ if (snla->ads == NULL) - snla->ads= MEM_callocN(sizeof(bDopeSheet), "GraphEdit DopeSheet"); + snla->ads= MEM_callocN(sizeof(bDopeSheet), "NlaEdit DopeSheet"); /* sync settings with current view status, then return appropriate data */ /* update scene-pointer (no need to check for pinning yet, as not implemented) */ @@ -359,6 +359,9 @@ short ANIM_animdata_get_context (const bContext *C, bAnimContext *ac) if (ANIMDATA_HAS_NLA(id)) {\ nlaOk\ }\ + else if (!(ads->filterflag & ADS_FILTER_NLA_NOACT) && ANIMDATA_HAS_KEYS(id)) {\ + nlaOk\ + }\ }\ else if (ads->filterflag & ADS_FILTER_ONLYDRIVERS) {\ if (ANIMDATA_HAS_DRIVERS(id)) {\ @@ -566,6 +569,13 @@ bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, s ale->datatype= ALE_NLASTRIP; } break; + case ANIMTYPE_NLAACTION: + { + /* nothing to include for now... nothing editable from NLA-perspective here */ + ale->key_data= NULL; + ale->datatype= ALE_NONE; + } + break; } } @@ -594,7 +604,6 @@ static int animdata_filter_fcurves (ListBase *anim_data, FCurve *first, bActionG if ( ANIMCHANNEL_SELOK(SEL_FCU(fcu)) ) { /* only include if this curve is active */ if (!(filter_mode & ANIMFILTER_ACTIVE) || (fcu->flag & FCURVE_ACTIVE)) { - /* owner/ownertype will be either object or action-channel, depending if it was dopesheet or part of an action */ ale= make_new_animlistelem(fcu, ANIMTYPE_FCURVE, owner, ownertype, owner_id); if (ale) { @@ -682,10 +691,49 @@ static int animdata_filter_action (ListBase *anim_data, bAction *act, int filter return items; } -static int animdata_filter_nla (ListBase *anim_data, NlaTrack *first, int filter_mode, void *owner, short ownertype, ID *owner_id) +static int animdata_filter_nla (ListBase *anim_data, AnimData *adt, int filter_mode, void *owner, short ownertype, ID *owner_id) { - // FIXME - return 0; + bAnimListElem *ale; + NlaTrack *nlt; + int items = 0; + + /* loop over NLA Tracks - assume that the caller of this has already checked that these should be included */ + for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { + /* only work with this channel and its subchannels if it is editable */ + if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_NLT(nlt)) { + /* only include this track if selected in a way consistent with the filtering requirements */ + if ( ANIMCHANNEL_SELOK(SEL_NLT(nlt)) ) { + /* only include if this track is active */ + // XXX keep this? + if (!(filter_mode & ANIMFILTER_ACTIVE) || (nlt->flag & NLATRACK_ACTIVE)) { + ale= make_new_animlistelem(nlt, ANIMTYPE_NLATRACK, owner, ownertype, owner_id); + + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } + } + } + } + } + + /* if showing channels, include active action */ + if (filter_mode & ANIMFILTER_CHANNELS) { + /* there isn't really anything editable here, so skip if need editable */ + // TODO: currently, selection isn't checked since it doesn't matter + if ((filter_mode & ANIMFILTER_FOREDIT) == 0) { + /* just add the action track now */ + ale= make_new_animlistelem(adt->action, ANIMTYPE_NLAACTION, owner, ownertype, owner_id); + + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } + } + } + + /* return the number of items added to the list */ + return items; } static int animdata_filter_shapekey (ListBase *anim_data, Key *key, int filter_mode, void *owner, short ownertype, ID *owner_id) @@ -881,7 +929,7 @@ static int animdata_filter_dopesheet_mats (ListBase *anim_data, bDopeSheet *ads, /* add material's animation data */ if (FILTER_MAT_OBJD(ma) || (filter_mode & ANIMFILTER_CURVESONLY)) { ANIMDATA_FILTER_CASES(ma, - items += animdata_filter_nla(anim_data, ma->adt->nla_tracks.first, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);, + items += animdata_filter_nla(anim_data, ma->adt, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);, items += animdata_filter_fcurves(anim_data, ma->adt->drivers.first, NULL, ma, ANIMTYPE_DSMAT, filter_mode, (ID *)ma);, items += animdata_filter_action(anim_data, ma->adt->action, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);) } @@ -946,7 +994,7 @@ static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ad if ((expanded) || (filter_mode & ANIMFILTER_CURVESONLY)) { /* filtering for channels - nla, drivers, keyframes */ ANIMDATA_FILTER_CASES(iat, - items+= animdata_filter_nla(anim_data, iat->adt->nla_tracks.first, filter_mode, iat, type, (ID *)iat);, + items+= animdata_filter_nla(anim_data, iat->adt, filter_mode, iat, type, (ID *)iat);, items+= animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, iat, type, filter_mode, (ID *)iat);, items += animdata_filter_action(anim_data, iat->adt->action, filter_mode, iat, type, (ID *)iat);) } @@ -997,8 +1045,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B #endif /* add NLA tracks */ - if (/*EXPANDED_NLTD(adt) ||*/ !(filter_mode & ANIMFILTER_CHANNELS)) - items += animdata_filter_nla(anim_data, adt->nla_tracks.first, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); + items += animdata_filter_nla(anim_data, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); }, { /* drivers */ /* include drivers-expand widget? */ @@ -1053,8 +1100,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B #endif /* add NLA tracks */ - if (/*EXPANDED_NLTD(adt) ||*/ !(filter_mode & ANIMFILTER_CHANNELS)) - items += animdata_filter_nla(anim_data, adt->nla_tracks.first, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); + items += animdata_filter_nla(anim_data, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); }, { /* drivers */ /* include shapekey-expand widget? */ @@ -1179,8 +1225,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads #endif /* add NLA tracks */ - if (/*EXPANDED_NLTD(adt) ||*/ !(filter_mode & ANIMFILTER_CHANNELS)) - items += animdata_filter_nla(anim_data, adt->nla_tracks.first, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce); + items += animdata_filter_nla(anim_data, adt, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce); }, { /* drivers */ /* include drivers-expand widget? */ @@ -1233,8 +1278,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads #endif /* add NLA tracks */ - if (/*EXPANDED_NLTD(adt) ||*/ !(filter_mode & ANIMFILTER_CHANNELS)) - items += animdata_filter_nla(anim_data, adt->nla_tracks.first, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo); + items += animdata_filter_nla(anim_data, adt, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo); }, { /* drivers */ /* include world-expand widget? */ @@ -1508,6 +1552,7 @@ int ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_mode case ANIMCONT_DOPESHEET: case ANIMCONT_FCURVES: case ANIMCONT_DRIVERS: + case ANIMCONT_NLA: items= animdata_filter_dopesheet(anim_data, data, filter_mode); break; } diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index cfbd6d2bced..144cd68f6df 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -412,8 +412,6 @@ void scene_to_keylist(Scene *sce, ListBase *keys, ListBase *blocks, ActKeysInc * /* get filterflag */ if (ads) filterflag= ads->filterflag; - else if ((aki) && (aki->actmode == -1)) /* only set like this by NLA */ - filterflag= ADS_FILTER_NLADUMMY; else filterflag= 0; diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 75c10f957cc..7629fc29352 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -131,6 +131,7 @@ typedef enum eAnim_ChannelType { ANIMTYPE_GPLAYER, ANIMTYPE_NLATRACK, + ANIMTYPE_NLAACTION, } eAnim_ChannelType; /* types of keyframe data in bAnimListElem */ diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index 7ff312151c5..c81ca909318 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -52,6 +52,8 @@ enum { V2D_COMMONVIEW_STANDARD, /* listview (i.e. Outliner) */ V2D_COMMONVIEW_LIST, + /* stackview (this is basically a list where new items are added at the top) */ + V2D_COMMONVIEW_STACK, /* headers (this is basically the same as listview, but no y-panning) */ V2D_COMMONVIEW_HEADER, /* ui region containing panels */ diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 1cb58c986d0..f0032809631 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -501,7 +501,10 @@ void ui_theme_init_userdef(void) btheme->tact= btheme->tipo; SETCOL(btheme->tact.strip, 12, 10, 10, 128); SETCOL(btheme->tact.strip_select, 255, 140, 0, 255); - + + /* space nla */ + btheme->tnla= btheme->tact; + /* space file */ /* to have something initialized */ btheme->tfile= btheme->tv3d; @@ -518,20 +521,6 @@ void ui_theme_init_userdef(void) SETCOL(btheme->tfile.scene, 250, 250, 250, 255); - - - /* space nla */ - btheme->tnla= btheme->tv3d; - SETCOL(btheme->tnla.back, 116, 116, 116, 255); - SETCOL(btheme->tnla.text, 0, 0, 0, 255); - SETCOL(btheme->tnla.text_hi, 255, 255, 255, 255); - SETCOL(btheme->tnla.grid, 94, 94, 94, 255); - SETCOL(btheme->tnla.shade1, 172, 172, 172, 255); // sliders - SETCOL(btheme->tnla.shade2, 84, 44, 31, 100); // bar - SETCOL(btheme->tnla.hilite, 17, 27, 60, 100); // bar - SETCOL(btheme->tnla.strip_select, 0xff, 0xff, 0xaa, 255); - SETCOL(btheme->tnla.strip, 0xe4, 0x9c, 0xc6, 255); - /* space seq */ btheme->tseq= btheme->tv3d; SETCOL(btheme->tseq.back, 116, 116, 116, 255); diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index f2fc2deefbb..639f83d0d09 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -207,6 +207,23 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) } break; + /* 'stack view' - practically the same as list/channel view, except is located in the pos y half instead. + * zoom, aspect ratio, and alignment restrictions are set here */ + case V2D_COMMONVIEW_STACK: + { + /* zoom + aspect ratio are locked */ + v2d->keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT); + v2d->minzoom= v2d->maxzoom= 1.0f; + + /* tot rect has strictly regulated placement, and must only occur in +/+ quadrant */ + v2d->align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y); + v2d->keeptot = V2D_KEEPTOT_STRICT; + tot_changed= 1; + + /* scroller settings are currently not set here... that is left for regions... */ + } + break; + /* 'header' regions - zoom, aspect ratio, alignment, and panning restrictions are set here */ case V2D_COMMONVIEW_HEADER: { @@ -245,14 +262,14 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) v2d->tot.xmin= 0.0f; v2d->tot.xmax= winx; - + v2d->tot.ymax= 0.0f; v2d->tot.ymin= -winy; - + v2d->cur= v2d->tot; } break; - + /* other view types are completely defined using their own settings already */ default: /* we don't do anything here, as settings should be fine, but just make sure that rect */ diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 74002f64187..ef42b009bd4 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -192,7 +192,7 @@ static SpaceLink *graph_duplicate(SpaceLink *sl) SpaceIpo *sipon= MEM_dupallocN(sl); /* clear or remove stuff from old */ - //sipon->ipokey.first= sipon->ipokey.last= NULL; + BLI_duplicatelist(&sipon->ghostCurves, &((SpaceIpo *)sl)->ghostCurves); sipon->ads= MEM_dupallocN(sipon->ads); return (SpaceLink *)sipon; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c new file mode 100644 index 00000000000..8b8ae7c5b8b --- /dev/null +++ b/source/blender/editors/space_nla/nla_draw.c @@ -0,0 +1,480 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation, Joshua Leung + * All rights reserved. + * + * + * Contributor(s): Joshua Leung (major recode) + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include +#include +#include + +#include "DNA_listBase.h" +#include "DNA_anim_types.h" +#include "DNA_action_types.h" +#include "DNA_armature_types.h" +#include "DNA_camera_types.h" +#include "DNA_curve_types.h" +#include "DNA_object_types.h" +#include "DNA_screen_types.h" +#include "DNA_scene_types.h" +#include "DNA_space_types.h" +#include "DNA_constraint_types.h" +#include "DNA_key_types.h" +#include "DNA_lamp_types.h" +#include "DNA_material_types.h" +#include "DNA_userdef_types.h" +#include "DNA_windowmanager_types.h" +#include "DNA_world_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" +#include "BLI_rand.h" + +#include "BKE_animsys.h" +#include "BKE_nla.h" +#include "BKE_context.h" +#include "BKE_screen.h" +#include "BKE_utildefines.h" + +#include "ED_anim_api.h" +#include "ED_space_api.h" +#include "ED_screen.h" + +#include "BIF_gl.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "UI_interface.h" +#include "UI_interface_icons.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "ED_markers.h" + +#include "nla_intern.h" // own include + +/* XXX */ +extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad); + +/* *********************************************** */ + +/* *********************************************** */ +/* Channel List */ + +void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) +{ + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + View2D *v2d= &ar->v2d; + float x= 0.0f, y= 0.0f; + int items, height; + + /* build list of channels to draw */ + filter= (ANIMFILTER_VISIBLE|ANIMFILTER_CHANNELS); + items= ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); + + /* Update max-extent of channels here (taking into account scrollers): + * - this is done to allow the channel list to be scrollable, but must be done here + * to avoid regenerating the list again and/or also because channels list is drawn first + * - offset of NLACHANNEL_HEIGHT*2 is added to the height of the channels, as first is for + * start of list offset, and the second is as a correction for the scrollers. + */ + height= ((items*NLACHANNEL_STEP) + (NLACHANNEL_HEIGHT*2)); + if (height > (v2d->mask.ymax - v2d->mask.ymin)) { + /* don't use totrect set, as the width stays the same + * (NOTE: this is ok here, the configuration is pretty straightforward) + */ + v2d->tot.ymax= (float)(height); + } + + /* loop through channels, and set up drawing depending on their type */ + y= (float)(-NLACHANNEL_FIRST); + + for (ale= anim_data.first; ale; ale= ale->next) { + const float yminc= (float)(y - NLACHANNEL_HEIGHT_HALF); + const float ymaxc= (float)(y + NLACHANNEL_HEIGHT_HALF); + const float ydatac= (float)(y - 7); + + /* check if visible */ + if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) || + IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) ) + { + short indent= 0, offset= 0, sel= 0, group= 0; + int expand= -1, protect = -1, special= -1, mute = -1; + char name[128]; + + /* determine what needs to be drawn */ + switch (ale->type) { + case ANIMTYPE_SCENE: /* scene */ + { + Scene *sce= (Scene *)ale->data; + + group= 4; + indent= 0; + + special= ICON_SCENE_DATA; + + /* only show expand if there are any channels */ + if (EXPANDED_SCEC(sce)) + expand= ICON_TRIA_UP; + else + expand= ICON_TRIA_RIGHT; + + sel = SEL_SCEC(sce); + strcpy(name, sce->id.name+2); + } + break; + case ANIMTYPE_OBJECT: /* object */ + { + Base *base= (Base *)ale->data; + Object *ob= base->object; + + group= 4; + indent= 0; + + /* icon depends on object-type */ + if (ob->type == OB_ARMATURE) + special= ICON_ARMATURE_DATA; + else + special= ICON_OBJECT_DATA; + + /* only show expand if there are any channels */ + if (EXPANDED_OBJC(ob)) + expand= ICON_TRIA_UP; + else + expand= ICON_TRIA_RIGHT; + + sel = SEL_OBJC(base); + strcpy(name, ob->id.name+2); + } + break; + case ANIMTYPE_FILLMATD: /* object materials (dopesheet) expand widget */ + { + Object *ob = (Object *)ale->data; + + group = 4; + indent = 1; + special = ICON_MATERIAL_DATA; + + if (FILTER_MAT_OBJC(ob)) + expand = ICON_TRIA_UP; + else + expand = ICON_TRIA_RIGHT; + + strcpy(name, "Materials"); + } + break; + + + case ANIMTYPE_DSMAT: /* single material (dopesheet) expand widget */ + { + Material *ma = (Material *)ale->data; + + group = 0; + indent = 0; + special = ICON_MATERIAL_DATA; + offset = 21; + + if (FILTER_MAT_OBJD(ma)) + expand = ICON_TRIA_UP; + else + expand = ICON_TRIA_RIGHT; + + strcpy(name, ma->id.name+2); + } + break; + case ANIMTYPE_DSLAM: /* lamp (dopesheet) expand widget */ + { + Lamp *la = (Lamp *)ale->data; + + group = 4; + indent = 1; + special = ICON_LAMP_DATA; + + if (FILTER_LAM_OBJD(la)) + expand = ICON_TRIA_UP; + else + expand = ICON_TRIA_RIGHT; + + strcpy(name, la->id.name+2); + } + break; + case ANIMTYPE_DSCAM: /* camera (dopesheet) expand widget */ + { + Camera *ca = (Camera *)ale->data; + + group = 4; + indent = 1; + special = ICON_CAMERA_DATA; + + if (FILTER_CAM_OBJD(ca)) + expand = ICON_TRIA_UP; + else + expand = ICON_TRIA_RIGHT; + + strcpy(name, ca->id.name+2); + } + break; + case ANIMTYPE_DSCUR: /* curve (dopesheet) expand widget */ + { + Curve *cu = (Curve *)ale->data; + + group = 4; + indent = 1; + special = ICON_CURVE_DATA; + + if (FILTER_CUR_OBJD(cu)) + expand = ICON_TRIA_UP; + else + expand = ICON_TRIA_RIGHT; + + strcpy(name, cu->id.name+2); + } + break; + case ANIMTYPE_DSSKEY: /* shapekeys (dopesheet) expand widget */ + { + Key *key= (Key *)ale->data; + + group = 4; + indent = 1; + special = ICON_SHAPEKEY_DATA; // XXX + + if (FILTER_SKE_OBJD(key)) + expand = ICON_TRIA_UP; + else + expand = ICON_TRIA_RIGHT; + + //sel = SEL_OBJC(base); + strcpy(name, "Shape Keys"); + } + break; + case ANIMTYPE_DSWOR: /* world (dopesheet) expand widget */ + { + World *wo= (World *)ale->data; + + group = 4; + indent = 1; + special = ICON_WORLD_DATA; + + if (FILTER_WOR_SCED(wo)) + expand = ICON_TRIA_DOWN; + else + expand = ICON_TRIA_RIGHT; + + strcpy(name, wo->id.name+2); + } + break; + + case ANIMTYPE_NLATRACK: /* NLA Track */ + { + NlaTrack *nlt= (NlaTrack *)ale->data; + + indent= 0; + + if (ale->id) { + /* special exception for materials */ + if (GS(ale->id->name) == ID_MA) { + offset= 21; + indent= 1; + } + else + offset= 14; + } + else + offset= 0; + + /* FIXME: 'solo' as the 'special' button? + * - need special icons for these + */ + if (nlt->flag & NLATRACK_SOLO) + special= ICON_LAYER_ACTIVE; + else + special= ICON_LAYER_USED; + + if (nlt->flag & NLATRACK_MUTED) + mute = ICON_MUTE_IPO_ON; + else + mute = ICON_MUTE_IPO_OFF; + + if (EDITABLE_NLT(nlt)) + protect = ICON_UNLOCKED; + else + protect = ICON_LOCKED; + + strcpy(name, nlt->name); + } + break; + case ANIMTYPE_NLAACTION: /* NLA Action-Line */ + { + bAction *act= (bAction *)ale->data; + + group = 5; + + if (ale->id) { + /* special exception for materials */ + if (GS(ale->id->name) == ID_MA) { + offset= 21; + indent= 1; + } + else + offset= 14; + } + else + offset= 0; + + special = ICON_ACTION; + + if (act) + sprintf(name, "ActAction: <%s>", act->id.name+2); + else + sprintf(name, ""); + } + break; + } + + /* now, start drawing based on this information */ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + + /* draw backing strip behind channel name */ + if (group == 4) { + /* only used in dopesheet... */ + if (ELEM(ale->type, ANIMTYPE_SCENE, ANIMTYPE_OBJECT)) { + /* object channel - darker */ + UI_ThemeColor(TH_DOPESHEET_CHANNELOB); + uiSetRoundBox((expand == ICON_TRIA_UP)? (8):(1|8)); + gl_round_box(GL_POLYGON, x+offset, yminc, (float)NLACHANNEL_NAMEWIDTH, ymaxc, 8); + } + else { + /* sub-object folders - lighter */ + UI_ThemeColor(TH_DOPESHEET_CHANNELSUBOB); + + offset += 7 * indent; + glBegin(GL_QUADS); + glVertex2f(x+offset, yminc); + glVertex2f(x+offset, ymaxc); + glVertex2f((float)ACHANNEL_NAMEWIDTH, ymaxc); + glVertex2f((float)ACHANNEL_NAMEWIDTH, yminc); + glEnd(); + + /* clear group value, otherwise we cause errors... */ + group = 0; + } + } + else if (group == 5) { + /* Action Line */ + if (ale->data) + glColor3f(0.8f, 0.2f, 0.0f); // reddish color - hardcoded for now + else + glColor3f(0.6f, 0.5f, 0.5f); // greyish-red color - hardcoded for now + + offset += 7 * indent; + uiSetRoundBox(15); + gl_round_box(GL_POLYGON, x+offset, yminc, (float)NLACHANNEL_NAMEWIDTH, ymaxc, 8); + + /* clear group value, otherwise we cause errors... */ + group = 0; + } + else { + /* for normal channels + * - use 3 shades of color group/standard color for 3 indention level + */ + UI_ThemeColorShade(TH_HEADER, ((indent==0)?20: (indent==1)?-20: -40)); + + indent += group; + offset += 7 * indent; + glBegin(GL_QUADS); + glVertex2f(x+offset, yminc); + glVertex2f(x+offset, ymaxc); + glVertex2f((float)NLACHANNEL_NAMEWIDTH, ymaxc); + glVertex2f((float)NLACHANNEL_NAMEWIDTH, yminc); + glEnd(); + } + + /* draw expand/collapse triangle */ + if (expand > 0) { + UI_icon_draw(x+offset, ydatac, expand); + offset += 17; + } + + /* draw special icon indicating certain data-types */ + if (special > -1) { + /* for normal channels */ + UI_icon_draw(x+offset, ydatac, special); + offset += 17; + } + glDisable(GL_BLEND); + + /* draw name */ + if (sel) + UI_ThemeColor(TH_TEXT_HI); + else + UI_ThemeColor(TH_TEXT); + offset += 3; + UI_DrawString(x+offset, y-4, name); + + /* reset offset - for RHS of panel */ + offset = 0; + + /* set blending again, as text drawing may clear it */ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + + /* draw protect 'lock' */ + if (protect > -1) { + offset = 16; + UI_icon_draw((float)NLACHANNEL_NAMEWIDTH-offset, ydatac, protect); + } + + /* draw mute 'eye' */ + if (mute > -1) { + offset += 16; + UI_icon_draw((float)(NLACHANNEL_NAMEWIDTH-offset), ydatac, mute); + } + + /* draw action 'push-down' */ + if (ale->type == ANIMTYPE_NLAACTION) { + offset += 16; + UI_icon_draw((float)NLACHANNEL_NAMEWIDTH-offset, ydatac, ICON_FREEZE); + } + + glDisable(GL_BLEND); + } + + /* adjust y-position for next one */ + y += NLACHANNEL_STEP; + } + + /* free tempolary channels */ + BLI_freelistN(&anim_data); +} + +/* *********************************************** */ diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c new file mode 100644 index 00000000000..d9d0e5528ae --- /dev/null +++ b/source/blender/editors/space_nla/nla_edit.c @@ -0,0 +1,75 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation, Joshua Leung + * All rights reserved. + * + * + * Contributor(s): Joshua Leung (major recode) + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "DNA_anim_types.h" +#include "DNA_action_types.h" +#include "DNA_nla_types.h" +#include "DNA_object_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_windowmanager_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" +#include "BLI_rand.h" + +#include "BKE_animsys.h" +#include "BKE_nla.h" +#include "BKE_context.h" +#include "BKE_report.h" +#include "BKE_screen.h" + +#include "ED_anim_api.h" +#include "ED_space_api.h" +#include "ED_screen.h" + +#include "BIF_gl.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "ED_markers.h" + +#include "nla_intern.h" // own include + +/* *********************************************** */ + + +/* *********************************************** */ + +/* *********************************************** */ diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index 0f6b77da6f5..0dcd3198db0 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -29,6 +29,10 @@ #include #include +#include "DNA_anim_types.h" +#include "DNA_action_types.h" +#include "DNA_nla_types.h" +#include "DNA_object_types.h" #include "DNA_space_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" @@ -37,26 +41,36 @@ #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" +#include "BLI_arithb.h" +#include "BLI_rand.h" +#include "BKE_animsys.h" +#include "BKE_nla.h" #include "BKE_context.h" +#include "BKE_report.h" #include "BKE_screen.h" - -#include "ED_screen.h" #include "ED_types.h" #include "ED_util.h" -#include "WM_api.h" -#include "WM_types.h" +#include "ED_anim_api.h" +#include "ED_space_api.h" +#include "ED_screen.h" #include "BIF_gl.h" -#include "BIF_glutil.h" + +#include "WM_api.h" +#include "WM_types.h" #include "UI_interface.h" #include "UI_resources.h" #include "UI_view2d.h" -#include "nla_intern.h" +#include "ED_markers.h" +/* button events */ +enum { + B_REDR = 0, +} eActHeader_ButEvents; /* ************************ header area region *********************** */ @@ -93,13 +107,17 @@ static uiBlock *dummy_viewmenu(bContext *C, ARegion *ar, void *arg_unused) static void do_nla_buttons(bContext *C, void *arg, int event) { - switch(event) { + switch (event) { + case B_REDR: + ED_area_tag_redraw(CTX_wm_area(C)); + break; } } void nla_header_buttons(const bContext *C, ARegion *ar) { + SpaceNla *snla= (SpaceNla *)CTX_wm_space_data(C); ScrArea *sa= CTX_wm_area(C); uiBlock *block; int xco, yco= 3; @@ -109,7 +127,7 @@ void nla_header_buttons(const bContext *C, ARegion *ar) xco= ED_area_header_standardbuttons(C, block, yco); - if((sa->flag & HEADER_NO_PULLDOWN)==0) { + if ((sa->flag & HEADER_NO_PULLDOWN)==0) { int xmax; xmax= GetButStringLength("View"); @@ -119,7 +137,47 @@ void nla_header_buttons(const bContext *C, ARegion *ar) } uiBlockSetEmboss(block, UI_EMBOSS); - + + /* filtering buttons */ + if (snla->ads) { + uiBlockBeginAlign(block); + uiDefIconButBitI(block, TOG, ADS_FILTER_ONLYSEL, B_REDR, ICON_RESTRICT_SELECT_OFF, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Only display selected Objects"); + uiDefIconButBitI(block, TOGN, ADS_FILTER_NLA_NOACT, B_REDR, ICON_ACTION, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Include AnimData blocks with no NLA Data"); + uiBlockEndAlign(block); + xco += 5; + + uiBlockBeginAlign(block); + uiDefIconButBitI(block, TOGN, ADS_FILTER_NOSCE, B_REDR, ICON_SCENE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display Scene Animation"); + uiDefIconButBitI(block, TOGN, ADS_FILTER_NOWOR, B_REDR, ICON_WORLD_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display World Animation"); + uiDefIconButBitI(block, TOGN, ADS_FILTER_NOSHAPEKEYS, B_REDR, ICON_SHAPEKEY_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display ShapeKeys"); + uiDefIconButBitI(block, TOGN, ADS_FILTER_NOMAT, B_REDR, ICON_MATERIAL_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display Materials"); + uiDefIconButBitI(block, TOGN, ADS_FILTER_NOLAM, B_REDR, ICON_LAMP_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display Lamps"); + uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCAM, B_REDR, ICON_CAMERA_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display Cameras"); + uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCUR, B_REDR, ICON_CURVE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display Curves"); + uiBlockEndAlign(block); + xco += 15; + } + else { + // XXX this case shouldn't happen at all... for now, just pad out same amount of space + xco += 7*XIC + 15; + } + xco += (XIC + 8); + + /* auto-snap selector */ + if (snla->flag & SNLA_DRAWTIME) { + uiDefButS(block, MENU, B_REDR, + "Auto-Snap Keyframes %t|No Time-Snap %x0|Nearest Second %x2|Nearest Marker %x3", + xco,yco,90,YIC, &snla->autosnap, 0, 1, 0, 0, + "Auto-snapping mode for times when transforming"); + } + else { + uiDefButS(block, MENU, B_REDR, + "Auto-Snap Keyframes %t|No Time-Snap %x0|Nearest Frame %x2|Nearest Marker %x3", + xco,yco,90,YIC, &snla->autosnap, 0, 1, 0, 0, + "Auto-snapping mode for times when transforming"); + } + xco += 98; + /* always as last */ UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index c544bd9a408..4d013db8be9 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -30,8 +30,30 @@ /* internal exports only */ +/* -------------- NLA Channel Defines -------------- */ +/* NLA channel heights */ +#define NLACHANNEL_FIRST -16 +#define NLACHANNEL_HEIGHT 24 +#define NLACHANNEL_HEIGHT_HALF 12 +#define NLACHANNEL_SKIP 2 +#define NLACHANNEL_STEP (NLACHANNEL_HEIGHT + NLACHANNEL_SKIP) + +/* channel widths */ +#define NLACHANNEL_NAMEWIDTH 200 + +/* channel toggle-buttons */ +#define NLACHANNEL_BUTTON_WIDTH 16 + + +/* **************************************** */ +/* nla_draw.c */ + +void draw_nla_channel_list(bAnimContext *ac, SpaceNla *snla, ARegion *ar); + +/* **************************************** */ /* nla_header.c */ + void nla_header_buttons(const bContext *C, ARegion *ar); diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index cdaabe9e9de..39888162a95 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -42,10 +42,16 @@ #include "BLI_arithb.h" #include "BLI_rand.h" +#include "BKE_animsys.h" +#include "BKE_action.h" +#include "BKE_nla.h" #include "BKE_colortools.h" #include "BKE_context.h" #include "BKE_screen.h" +#include "BKE_utildefines.h" +#include "ED_anim_api.h" +#include "ED_markers.h" #include "ED_space_api.h" #include "ED_screen.h" @@ -58,8 +64,6 @@ #include "UI_resources.h" #include "UI_view2d.h" -#include "ED_markers.h" - #include "nla_intern.h" // own include /* ******************** default callbacks for nla space ***************** */ @@ -73,7 +77,7 @@ static SpaceLink *nla_new(const bContext *C) snla->spacetype= SPACE_NLA; /* allocate DopeSheet data for NLA Editor */ - snla->ads= MEM_callocN(sizeof(bDopeSheet), "NLAEdit DopeSheet"); + snla->ads= MEM_callocN(sizeof(bDopeSheet), "NlaEdit DopeSheet"); /* header */ ar= MEM_callocN(sizeof(ARegion), "header for nla"); @@ -82,13 +86,15 @@ static SpaceLink *nla_new(const bContext *C) ar->regiontype= RGN_TYPE_HEADER; ar->alignment= RGN_ALIGN_BOTTOM; - /* channel list region XXX */ - ar= MEM_callocN(sizeof(ARegion), "area region from do_versions"); + /* channel list region */ + ar= MEM_callocN(sizeof(ARegion), "channel list for nla"); BLI_addtail(&snla->regionbase, ar); ar->regiontype= RGN_TYPE_CHANNELS; ar->alignment= RGN_ALIGN_LEFT; - ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM); + /* only need to set these settings since this will use the 'stack' configuration */ + ar->v2d.scroll = V2D_SCROLL_BOTTOM; + ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL; /* main area */ ar= MEM_callocN(sizeof(ARegion), "main area for nla"); @@ -115,10 +121,11 @@ static SpaceLink *nla_new(const bContext *C) ar->v2d.minzoom= 0.1f; ar->v2d.maxzoom= 50.0f; - ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); + ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); ar->v2d.scroll |= (V2D_SCROLL_RIGHT); ar->v2d.keepzoom= V2D_LOCKZOOM_Y; - + ar->v2d.align= V2D_ALIGN_NO_NEG_Y; + ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL; return (SpaceLink *)snla; } @@ -138,7 +145,13 @@ static void nla_free(SpaceLink *sl) /* spacetype; init callback */ static void nla_init(struct wmWindowManager *wm, ScrArea *sa) { + SpaceNla *snla= (SpaceNla *)sa->spacedata.first; + + /* init dopesheet data if non-existant (i.e. for old files) */ + if (snla->ads == NULL) + snla->ads= MEM_callocN(sizeof(bDopeSheet), "NlaEdit DopeSheet"); + ED_area_tag_refresh(sa); } static SpaceLink *nla_duplicate(SpaceLink *sl) @@ -146,15 +159,31 @@ static SpaceLink *nla_duplicate(SpaceLink *sl) SpaceNla *snlan= MEM_dupallocN(sl); /* clear or remove stuff from old */ + snlan->ads= MEM_dupallocN(snlan->ads); return (SpaceLink *)snlan; } +/* add handlers, stuff you only do once or on area/region changes */ +static void nla_channel_area_init(wmWindowManager *wm, ARegion *ar) +{ + //ListBase *keymap; + + UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STACK, ar->winx, ar->winy); + + /* own keymap */ + // TODO: cannot use generic copy, need special NLA version + //keymap= WM_keymap_listbase(wm, "Animation_Channels", 0, 0); /* XXX weak? */ + //WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); +} + +/* draw entirely, view changes should be handled here */ static void nla_channel_area_draw(const bContext *C, ARegion *ar) { - /* draw entirely, view changes should be handled here */ - // SpaceNla *snla= (SpaceNla*)CTX_wm_space_data(C); - // View2D *v2d= &ar->v2d; + SpaceNla *snla= (SpaceNla*)CTX_wm_space_data(C); + bAnimContext ac; + View2D *v2d= &ar->v2d; + View2DScrollers *scrollers; float col[3]; /* clear and setup matrix */ @@ -162,15 +191,20 @@ static void nla_channel_area_draw(const bContext *C, ARegion *ar) glClearColor(col[0], col[1], col[2], 0.0); glClear(GL_COLOR_BUFFER_BIT); - // UI_view2d_view_ortho(C, v2d); - - /* data... */ + UI_view2d_view_ortho(C, v2d); + /* data */ + if (ANIM_animdata_get_context(C, &ac)) { + draw_nla_channel_list(&ac, snla, ar); + } /* reset view matrix */ - //UI_view2d_view_restore(C); + UI_view2d_view_restore(C); - /* scrollers? */ + /* scrollers */ + scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY); + UI_view2d_scrollers_draw(C, v2d, scrollers); + UI_view2d_scrollers_free(scrollers); } @@ -189,9 +223,13 @@ static void nla_main_area_init(wmWindowManager *wm, ARegion *ar) static void nla_main_area_draw(const bContext *C, ARegion *ar) { /* draw entirely, view changes should be handled here */ - // SpaceNla *snla= (SpaceNla*)CTX_wm_space_data(C); + SpaceNla *snla= (SpaceNla*)CTX_wm_space_data(C); + bAnimContext ac; View2D *v2d= &ar->v2d; + View2DGrid *grid; + View2DScrollers *scrollers; float col[3]; + short unit=0, flag=0; /* clear and setup matrix */ UI_GetThemeColor3fv(TH_BACK, col); @@ -199,14 +237,38 @@ static void nla_main_area_draw(const bContext *C, ARegion *ar) glClear(GL_COLOR_BUFFER_BIT); UI_view2d_view_ortho(C, v2d); - - /* data... */ + /* time grid */ + unit= (snla->flag & SNLA_DRAWTIME)? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES; + grid= UI_view2d_grid_calc(C, v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY, ar->winx, ar->winy); + UI_view2d_grid_draw(C, v2d, grid, V2D_GRIDLINES_ALL); + UI_view2d_grid_free(grid); + + /* data */ + if (ANIM_animdata_get_context(C, &ac)) { + //draw_channel_strips(&ac, saction, ar); + } + + /* current frame */ + if (snla->flag & SNLA_DRAWTIME) flag |= DRAWCFRA_UNIT_SECONDS; + if ((snla->flag & SNLA_NODRAWCFRANUM)==0) flag |= DRAWCFRA_SHOW_NUMBOX; + ANIM_draw_cfra(C, v2d, flag); + + /* markers */ + UI_view2d_view_orthoSpecial(C, v2d, 1); + draw_markers_time(C, 0); + + /* preview range */ + UI_view2d_view_ortho(C, v2d); + ANIM_draw_previewrange(C, v2d); /* reset view matrix */ UI_view2d_view_restore(C); - /* scrollers? */ + /* scrollers */ + scrollers= UI_view2d_scrollers_calc(C, v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); + UI_view2d_scrollers_draw(C, v2d, scrollers); + UI_view2d_scrollers_free(scrollers); } void nla_operatortypes(void) @@ -250,6 +312,82 @@ static void nla_header_area_draw(const bContext *C, ARegion *ar) static void nla_main_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ + switch(wmn->category) { + case NC_SCENE: + switch(wmn->data) { + case ND_OB_ACTIVE: + case ND_FRAME: + case ND_MARKERS: + ED_region_tag_redraw(ar); + break; + } + break; + case NC_OBJECT: + switch(wmn->data) { + case ND_BONE_ACTIVE: + case ND_BONE_SELECT: + case ND_KEYS: + case ND_TRANSFORM: + ED_region_tag_redraw(ar); + break; + } + break; + default: + if(wmn->data==ND_KEYS) + ED_region_tag_redraw(ar); + } +} + +static void nla_channel_area_listener(ARegion *ar, wmNotifier *wmn) +{ + /* context changes */ + switch(wmn->category) { + case NC_SCENE: + switch(wmn->data) { + case ND_OB_ACTIVE: + ED_region_tag_redraw(ar); + break; + } + break; + case NC_OBJECT: + switch(wmn->data) { + case ND_BONE_ACTIVE: + case ND_BONE_SELECT: + case ND_KEYS: + ED_region_tag_redraw(ar); + break; + } + break; + default: + if(wmn->data==ND_KEYS) + ED_region_tag_redraw(ar); + } +} + +/* editor level listener */ +static void nla_listener(ScrArea *sa, wmNotifier *wmn) +{ + /* context changes */ + switch (wmn->category) { + case NC_SCENE: + /*switch (wmn->data) { + case ND_OB_ACTIVE: + case ND_OB_SELECT: + ED_area_tag_refresh(sa); + break; + }*/ + ED_area_tag_refresh(sa); + break; + case NC_OBJECT: + /*switch (wmn->data) { + case ND_BONE_SELECT: + case ND_BONE_ACTIVE: + ED_area_tag_refresh(sa); + break; + }*/ + ED_area_tag_refresh(sa); + break; + } } /* only called once, from space/spacetypes.c */ @@ -265,6 +403,7 @@ void ED_spacetype_nla(void) st->init= nla_init; st->duplicate= nla_duplicate; st->operatortypes= nla_operatortypes; + st->listener= nla_listener; st->keymap= nla_keymap; /* regions: main window */ @@ -273,7 +412,7 @@ void ED_spacetype_nla(void) art->init= nla_main_area_init; art->draw= nla_main_area_draw; art->listener= nla_main_area_listener; - art->keymapflag= ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES; + art->keymapflag= ED_KEYMAP_VIEW2D/*|ED_KEYMAP_MARKERS*/|ED_KEYMAP_ANIMATION|ED_KEYMAP_FRAMES; BLI_addhead(&st->regiontypes, art); @@ -294,8 +433,9 @@ void ED_spacetype_nla(void) art->minsizex= 200; art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; - //art->init= nla_channel_area_init; + art->init= nla_channel_area_init; art->draw= nla_channel_area_draw; + art->listener= nla_channel_area_listener; BLI_addhead(&st->regiontypes, art); diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 802f8d88c03..e41ab5ac492 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -288,9 +288,10 @@ typedef struct bDopeSheet { /* DopeSheet filter-flag */ typedef enum DOPESHEET_FILTERFLAG { /* general filtering */ - ADS_FILTER_ONLYSEL = (1<<0), - ADS_FILTER_ONLYDRIVERS = (1<<1), - ADS_FILTER_ONLYNLA = (1<<2), + ADS_FILTER_ONLYSEL = (1<<0), /* only include channels relating to selected data */ + + ADS_FILTER_ONLYDRIVERS = (1<<1), /* for 'Drivers' editor - only include Driver data from AnimData */ + ADS_FILTER_ONLYNLA = (1<<2), /* for 'NLA' editor - only include NLA data from AnimData */ /* datatype-based filtering */ ADS_FILTER_NOSHAPEKEYS = (1<<6), @@ -301,9 +302,11 @@ typedef enum DOPESHEET_FILTERFLAG { ADS_FILTER_NOWOR = (1<<14), ADS_FILTER_NOSCE = (1<<15), + /* NLA-specific filters */ + ADS_FILTER_NLA_NOACT = (1<<20), /* if the AnimData block has no NLA data, don't include to just show Action-line */ + /* combination filters (some only used at runtime) */ ADS_FILTER_NOOBDATA = (ADS_FILTER_NOCAM|ADS_FILTER_NOMAT|ADS_FILTER_NOLAM|ADS_FILTER_NOCUR), - ADS_FILTER_NLADUMMY = (ADS_FILTER_NOSHAPEKEYS|ADS_FILTER_NOOBDATA), } DOPESHEET_FILTERFLAG; /* DopeSheet general flags */ -- cgit v1.2.3 From 092b13ef3a1346daea10448a310b2529a749ff7c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 29 May 2009 13:33:33 +0000 Subject: the option for saving images as jpeg2000 was missing --- source/blender/src/editsima.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/editsima.c b/source/blender/src/editsima.c index 7fc76dd5202..34d31970127 100644 --- a/source/blender/src/editsima.c +++ b/source/blender/src/editsima.c @@ -2393,7 +2393,7 @@ void replace_image_sima(short imageselect) static char *filesel_imagetype_string(Image *ima) { - char *strp, *str= MEM_callocN(14*32, "menu for filesel"); + char *strp, *str= MEM_callocN(15*32, "menu for filesel"); strp= str; str += sprintf(str, "Save Image as: %%t|"); @@ -2402,6 +2402,9 @@ static char *filesel_imagetype_string(Image *ima) str += sprintf(str, "PNG %%x%d|", R_PNG); str += sprintf(str, "BMP %%x%d|", R_BMP); str += sprintf(str, "Jpeg %%x%d|", R_JPEG90); +#ifdef WITH_OPENJPEG + str += sprintf(str, "Jpeg 2000 %%x%d|", R_JP2); +#endif str += sprintf(str, "Iris %%x%d|", R_IRIS); if(G.have_libtiff) str += sprintf(str, "Tiff %%x%d|", R_TIFF); -- cgit v1.2.3 From dd9c9efde7d8fbc2247b6c6b3d15c5c76aa787b9 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Fri, 29 May 2009 13:37:51 +0000 Subject: BGE modifier: last minute commit to fix a nasty bug with modifers messing the alpha blend mode of the GE. Note the alpha sorting on modified mesh is not implemented so derived mesh should not have alpha faces (clip will work though). Incidently fixed a performance problem in GLSL where the derived mesh was possibly rendered multiple times. Modifier support is still a bit experimental and should not be used in production game. --- source/gameengine/Ketsji/KX_GameObject.cpp | 5 ++--- source/gameengine/Rasterizer/RAS_MeshObject.cpp | 26 +++++++++++++++++++++- source/gameengine/Rasterizer/RAS_MeshObject.h | 3 ++- .../RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp | 14 +++++++++--- .../RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h | 2 +- 5 files changed, 41 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index f75f611f9bb..04b1276569e 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -460,17 +460,16 @@ void KX_GameObject::AddMeshUser() { for (size_t i=0;iAddMeshUser(this, &m_meshSlots); + m_meshes[i]->AddMeshUser(this, &m_meshSlots, GetDeformer()); } // set the part of the mesh slot that never change double* fl = GetOpenGLMatrixPtr()->getPointer(); - RAS_Deformer *deformer = GetDeformer(); SG_QList::iterator mit(m_meshSlots); + RAS_MeshSlot* ms; for(mit.begin(); !mit.end(); ++mit) { (*mit)->m_OpenGLMatrix = fl; - (*mit)->SetDeformer(deformer); } UpdateBuckets(false); } diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index 1cb394aaff3..1dfcb0c512d 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -382,15 +382,39 @@ RAS_TexVert* RAS_MeshObject::GetVertex(unsigned int matid, return NULL; } -void RAS_MeshObject::AddMeshUser(void *clientobj, SG_QList *head) +void RAS_MeshObject::AddMeshUser(void *clientobj, SG_QList *head, RAS_Deformer* deformer) { list::iterator it; + list::iterator mit; for(it = m_materials.begin();it!=m_materials.end();++it) { /* always copy from the base slot, which is never removed * since new objects can be created with the same mesh data */ + if (deformer && !deformer->UseVertexArray()) + { + // HACK! + // this deformer doesn't use vertex array => derive mesh + // we must keep only the mesh slots that have unique material id + // this is to match the derived mesh drawing function + // Need a better solution in the future: scan the derive mesh and create vertex array + RAS_IPolyMaterial* curmat = it->m_bucket->GetPolyMaterial(); + if (curmat->GetFlag() & RAS_BLENDERGLSL) + { + for(mit = m_materials.begin(); mit != it; ++mit) + { + RAS_IPolyMaterial* mat = mit->m_bucket->GetPolyMaterial(); + if ((mat->GetFlag() & RAS_BLENDERGLSL) && + mat->GetMaterialIndex() == curmat->GetMaterialIndex()) + // no need to convert current mesh slot + break; + } + if (mit != it) + continue; + } + } RAS_MeshSlot *ms = it->m_bucket->CopyMesh(it->m_baseslot); ms->m_clientObj = clientobj; + ms->SetDeformer(deformer); it->m_slots.insert(clientobj, ms); head->QAddBack(ms); } diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h index 0a16c7fa0f6..e763d6e7c7f 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_MeshObject.h @@ -45,6 +45,7 @@ #include "GEN_HashedPtr.h" struct Mesh; +class RAS_Deformer; /* RAS_MeshObject is a mesh used for rendering. It stores polygons, * but the actual vertices and index arrays are stored in material @@ -130,7 +131,7 @@ public: RAS_Polygon* GetPolygon(int num) const; /* buckets */ - virtual void AddMeshUser(void *clientobj, SG_QList *head); + virtual void AddMeshUser(void *clientobj, SG_QList *head, RAS_Deformer* deformer); virtual void UpdateBuckets( void* clientobj, double* oglmatrix, diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index 3fe5e26abc3..83ba2778ad6 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -81,7 +81,7 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_ICanvas* canvas) m_motionblurvalue(-1.0), m_texco_num(0), m_attrib_num(0), - m_last_blendmode(GPU_BLEND_SOLID), + //m_last_blendmode(GPU_BLEND_SOLID), m_last_frontface(true), m_materialCachingInfo(0) { @@ -118,7 +118,8 @@ bool RAS_OpenGLRasterizer::Init() glDisable(GL_BLEND); glDisable(GL_ALPHA_TEST); - m_last_blendmode = GPU_BLEND_SOLID; + //m_last_blendmode = GPU_BLEND_SOLID; + GPU_set_material_blend_mode(GPU_BLEND_SOLID); glFrontFace(GL_CCW); m_last_frontface = true; @@ -288,7 +289,8 @@ bool RAS_OpenGLRasterizer::BeginFrame(int drawingmode, double time) glDisable(GL_BLEND); glDisable(GL_ALPHA_TEST); - m_last_blendmode = GPU_BLEND_SOLID; + //m_last_blendmode = GPU_BLEND_SOLID; + GPU_set_material_blend_mode(GPU_BLEND_SOLID); glFrontFace(GL_CCW); m_last_frontface = true; @@ -787,7 +789,10 @@ void RAS_OpenGLRasterizer::IndexPrimitivesInternal(RAS_MeshSlot& ms, bool multi) GPU_material_vertex_attributes(GPU_material_from_blender(blscene, blmat), ¤t_gpu_attribs); else memset(¤t_gpu_attribs, 0, sizeof(current_gpu_attribs)); + // DM draw can mess up blending mode, restore at the end + int current_blend_mode = GPU_get_material_blend_mode(); ms.m_pDerivedMesh->drawFacesGLSL(ms.m_pDerivedMesh, CheckMaterialDM); + GPU_set_material_blend_mode(current_blend_mode); } else { ms.m_pDerivedMesh->drawMappedFacesTex(ms.m_pDerivedMesh, CheckTexfaceDM, mcol); } @@ -1096,6 +1101,8 @@ void RAS_OpenGLRasterizer::DisableMotionBlur() void RAS_OpenGLRasterizer::SetBlendingMode(int blendmode) { + GPU_set_material_blend_mode(blendmode); +/* if(blendmode == m_last_blendmode) return; @@ -1122,6 +1129,7 @@ void RAS_OpenGLRasterizer::SetBlendingMode(int blendmode) } m_last_blendmode = blendmode; +*/ } void RAS_OpenGLRasterizer::SetFrontFace(bool ccw) diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h index 4d51a477d48..e3422394e9e 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h @@ -100,7 +100,7 @@ protected: TexCoGen m_attrib[RAS_MAX_ATTRIB]; int m_texco_num; int m_attrib_num; - int m_last_blendmode; + //int m_last_blendmode; bool m_last_frontface; /** Stores the caching information for the last material activated. */ -- cgit v1.2.3 From d5b27fabcc4f8289b9315248a16a22f7045d9363 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Fri, 29 May 2009 16:55:22 +0000 Subject: BGE: sensor object will now have Actor filter optional: new button 'Detect Actor' in physics settings indicate if you want the sensor to detect only Actor object or all objects. This way you don't need to set the scenery to Actor to detect ground for example. --- source/blender/src/buttons_logic.c | 7 ++++--- source/gameengine/Ketsji/KX_ClientObjectInfo.h | 5 +++-- source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 2 +- source/gameengine/Ketsji/KX_TouchEventManager.cpp | 1 + source/gameengine/Ketsji/KX_TouchSensor.cpp | 4 +++- 5 files changed, 12 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index a1fddfefb9c..9fb6ec4752b 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -3355,11 +3355,12 @@ static void buttons_bullet(uiBlock *block, Object *ob) if (ob->gameflag & OB_COLLISION) { if (ob->gameflag & OB_SENSOR) { - uiBlockEndAlign(block); + uiDefButBitI(block, TOG, OB_ACTOR, 0, "Detect Actor", + 110, 205, 100, 19, &ob->gameflag, 0, 0, 0, 0, + "Sensor should detect only the objects with Actor option enabled. Unset to detect all objects"); uiDefBlockBut(block, advanced_bullet_menu, ob, "Advanced", 270, 205, 80, 19, "Display collision advanced settings"); - uiBlockBeginAlign(block); } else { uiDefButBitI(block, TOG, OB_ACTOR, 0, "Actor", 110, 205, 50, 19, &ob->gameflag, 0, 0, 0, 0, @@ -3379,7 +3380,7 @@ static void buttons_bullet(uiBlock *block, Object *ob) //uiBlockSetCol(block, TH_BUT_SETTING2); } - + uiBlockBeginAlign(block); if(ob->gameflag & OB_DYNAMIC) { if (!(ob->gameflag & OB_SOFT_BODY)) diff --git a/source/gameengine/Ketsji/KX_ClientObjectInfo.h b/source/gameengine/Ketsji/KX_ClientObjectInfo.h index 74d463fbf20..077ac96f0ac 100644 --- a/source/gameengine/Ketsji/KX_ClientObjectInfo.h +++ b/source/gameengine/Ketsji/KX_ClientObjectInfo.h @@ -51,7 +51,8 @@ struct KX_ClientObjectInfo ACTOR, RESERVED1, SENSOR, - OBSENSOR + OBSENSOR, + OBACTORSENSOR } m_type; KX_GameObject* m_gameobject; void* m_auxilary_info; @@ -84,7 +85,7 @@ public: } bool isActor() { return m_type <= ACTOR; } - bool isSensor() { return m_type >= SENSOR && m_type <= OBSENSOR; } + bool isSensor() { return m_type >= SENSOR && m_type <= OBACTORSENSOR; } }; #endif //__KX_CLIENTOBJECT_INFO_H diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index cdba59dd9ca..297b15a2b78 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -1186,7 +1186,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, bool isActor = objprop->m_isactor; gameobj->getClientInfo()->m_type = - (isbulletsensor) ? KX_ClientObjectInfo::OBSENSOR : + (isbulletsensor) ? ((isActor) ? KX_ClientObjectInfo::OBACTORSENSOR : KX_ClientObjectInfo::OBSENSOR) : (isActor) ? KX_ClientObjectInfo::ACTOR : KX_ClientObjectInfo::STATIC; // store materialname in auxinfo, needed for touchsensors if (meshobj) diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.cpp b/source/gameengine/Ketsji/KX_TouchEventManager.cpp index 9603410c3ac..712a512995e 100644 --- a/source/gameengine/Ketsji/KX_TouchEventManager.cpp +++ b/source/gameengine/Ketsji/KX_TouchEventManager.cpp @@ -99,6 +99,7 @@ bool KX_TouchEventManager::newBroadphaseResponse(void *client_data, } break; case KX_ClientObjectInfo::OBSENSOR: + case KX_ClientObjectInfo::OBACTORSENSOR: // this object may have multiple collision sensors, // check is any of them is interested in this object for(std::list::iterator it = info->m_sensors.begin(); diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 509fc60e9f5..c06acd4a873 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -204,6 +204,7 @@ bool KX_TouchSensor::BroadPhaseSensorFilterCollision(void*obj1,void*obj2) KX_GameObject* myobj = (KX_GameObject*)GetParent(); KX_GameObject* myparent = myobj->GetParent(); KX_ClientObjectInfo* client_info = static_cast(((PHY_IPhysicsController*)obj2)->getNewClientInfo()); + KX_ClientObjectInfo* my_client_info = static_cast(m_physCtrl->getNewClientInfo()); KX_GameObject* otherobj = ( client_info ? client_info->m_gameobject : NULL); // first, decrement refcount as GetParent() increases it @@ -214,7 +215,8 @@ bool KX_TouchSensor::BroadPhaseSensorFilterCollision(void*obj1,void*obj2) // good candidate because they are transient. That must be handled at another level if (!otherobj || otherobj == myparent || // don't interact with our parent - client_info->m_type != KX_ClientObjectInfo::ACTOR) // only with actor objects + (my_client_info->m_type == KX_ClientObjectInfo::OBACTORSENSOR && + client_info->m_type != KX_ClientObjectInfo::ACTOR)) // only with actor objects return false; bool found = m_touchedpropname.IsEmpty(); -- cgit v1.2.3 From f5b3a00fbb89c4dc341f399add18ccd06a5b2759 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Fri, 29 May 2009 17:09:20 +0000 Subject: BGE: small performance problem: object set invisible at startup were still put in the DBVT, causing unnecessary culling. --- source/gameengine/Converter/BL_BlenderDataConversion.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index d9e93d41f34..385301b1105 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1338,8 +1338,9 @@ void BL_CreateGraphicObjectNew(KX_GameObject* gameobj, ctrl->setNewClientInfo(gameobj->getClientInfo()); ctrl->setLocalAabb(localAabbMin, localAabbMax); if (isActive) { - // add first, this will create the proxy handle - env->addCcdGraphicController(ctrl); + // add first, this will create the proxy handle, only if the object is visible + if (gameobj->GetVisible()) + env->addCcdGraphicController(ctrl); // update the mesh if there is a deformer, this will also update the bounding box for modifiers RAS_Deformer* deformer = gameobj->GetDeformer(); if (deformer) -- cgit v1.2.3 From b3ce0c6a49d2d9e90bbee2c5de2130b7c40c3186 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 29 May 2009 17:51:16 +0000 Subject: Last pre-2.49 commit part 1: splash c file and release number --- source/blender/blenkernel/BKE_blender.h | 4 +- source/blender/src/splash.jpg.c | 15187 ++++++++++++------------------ 2 files changed, 6157 insertions(+), 9034 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index aa2366661f8..cc2f9bd8334 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -40,8 +40,8 @@ extern "C" { struct ListBase; struct MemFile; -#define BLENDER_VERSION 248 -#define BLENDER_SUBVERSION 5 +#define BLENDER_VERSION 249 +#define BLENDER_SUBVERSION 0 #define BLENDER_MINVERSION 245 #define BLENDER_MINSUBVERSION 15 diff --git a/source/blender/src/splash.jpg.c b/source/blender/src/splash.jpg.c index d6999563d8a..f4d7279646e 100644 --- a/source/blender/src/splash.jpg.c +++ b/source/blender/src/splash.jpg.c @@ -1,9036 +1,6159 @@ /* DataToC output of file */ -int datatoc_splash_jpg_size= 288981; +int datatoc_splash_jpg_size= 196913; char datatoc_splash_jpg[]= { -137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 1,245, 0, - 0, 1, 26, 8, 6, 0, 0, 0, 8, 90,206, 70, 0, 0, 0, 1,115, 82, 71, 66, 0,174,206, 28,233, 0, 0, 0, 6, 98, 75, 71, - 68, 0,255, 0,255, 0,255,160,189,167,147, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 11, 19, 0, 0, 11, 19, 1, 0,154,156, 24, - 0, 0, 0, 7,116, 73, 77, 69, 7,216, 10, 22, 11, 33, 15, 29, 14,195,147, 0, 0, 32, 0, 73, 68, 65, 84,120,218,236,189,119, -152, 93, 71,125,255,255,154,114,206,185,109,171,118,213,165, 85, 47,150,132,229,222,177,177, 29,155, 0, 54,166,183,252, 32,201, -151, 64, 10,249,133, 18, 72, 32, 33, 33,149,150, 56, 13, 8, 37, 36, 64, 2, 4,211,193,184,130,109,140, 45,217,170, 70, 86,177, -186,180,146, 86,210,174,118,181,245,222,123,202,204,124,255, 56,231,222,189,187,146,108,131, 77,242,124,147,157,231,177, 87,123, -239,222,115,102,230,204,157,247,231,253,254,148, 17,206, 57,231, 0, 67,218,180,203,254, 33,192, 1, 2, 11,128, 65, 2,160,178, -247,157, 0, 11, 72,103,112, 2,192,226, 80, 88, 7, 74, 8,164, 19, 96, 35, 32, 6, 37,129, 0,107, 65,226,192, 57, 80, 18,139, - 64, 90,129,115, 32,132, 3, 97, 64, 36, 56, 44, 2,133, 67, 2, 10,144,136,172, 91, 56, 11, 2,112, 50,253,137, 77,123,159,118, - 22,156, 2, 33,113,217, 59, 0, 50,123, 11,199,248,171,245, 11,142,143,173, 62, 62,151, 93, 83, 0,120,217,248,106, 31,179,217, - 88,107,189,148,217, 29,126,246,214,216,199,218,188,154,108,222, 21,105, 95, 5,224,144,152,236,111,107, 51, 34,236,248,115,106, - 28,203,207,220,129,250, 85,211,103, 90,159,199,236,254,233,187, 22,225,116,237,165,244,125,153,174,153,218,114, 81, 19,230,120, -226, 26,178, 13, 47,213,198, 53,225,222,162, 54,159,160,240,198,251, 38, 44, 9,178,222, 67, 1,168,236,121, 59, 84, 58, 63, 46, - 91,185,206,203,134, 97,179,143,235, 73,143,185,113, 53, 52,188,230,100,195,186,146, 24,145,142, 75, 53,244,215, 53,204,145, 32, -174,191,227, 26,215,229, 84,155,106,255, 29,205,157,227,245,169,133,249,223, 59,255,103, 60, 15, 59,233, 5, 57,105, 95,226, 44, -251,211,211,220,167,113,159,158,244,172,245, 25,107, 64,100, 27,157, 3, 33,158,254, 86, 18, 16, 66,224,172, 69, 72,133,193,162, -133, 70, 0, 54, 14,145, 42, 6, 55, 6, 81, 4, 50,135, 20, 1, 88, 13, 42,221,184,157,115, 32, 5,194,101, 61, 16,233,102,153, - 2,186,192, 58,139, 20,103, 89,172,245,141,184,214,113, 1, 66,158, 49,192,179, 79,143,156, 0, 26, 96,145,245,255, 79,152,136, - 51,174, 39, 38,117, 68, 62, 7, 64, 63,215, 99,148, 13,143, 89, 52, 0,123,237,110,226,249,252,210, 54,206,165,120,134,235,214, -214,133, 56,251,101,196,211, 44, 60,217, 96, 58,184,108, 44,227,128, 62, 62,106,121,150, 47,129,104, 0,116, 57,193,170,200,174, - 35, 92,106,141, 8, 89,191,159,251,185,102,126,226, 43,178,193,160, 21, 19,134, 38,158,254,203, 55,213,166,218, 84,251,223,211, - 4, 63,203,134,115,142, 61,200,254,124,247, 61,199,126, 93, 39,230, 41,111,182, 19, 45, 8, 71,157,245, 10,146,172,243,178,142, -191,147,199, 34, 93,182,147, 91,131, 84, 18,162, 17,202, 91,126, 64,247,158, 45, 20,155, 59,153,119,193, 53, 48,123, 13,232,246, -148,235, 10,137,181,182,126, 63,151, 49, 32, 33, 4, 2,129, 20,181,225,218,172,127, 13, 32, 90, 99,236,200, 58,211,150,207, 64, - 94,157,224, 12, 88, 78,121,153, 25,103,171,128, 16,227, 91,187,153,196,164,107,192, 38,178,121,121,174,235, 97, 28, 60,228,132, -215,200, 20, 1, 92,202,117,149, 72, 25,187,157,188,152,158, 35,184,187, 6, 86, 46, 26, 22,154,155,200,103, 83,134, 44,152, 48, - 79,227, 12,221,158,115,128, 34,155,175, 51, 32, 80,200, 73,216,127,118,144, 84,147, 13,211,236,198, 66,212,250, 57,217,208,144, -231, 48,112,179,249,117,231,248, 50,100,170,143,112, 18, 37, 0,151, 52,124, 90,140, 63,111,167, 39, 40, 16,114,138, 20, 77,181, - 95, 72,179, 83,198,227,255, 43,207, 73, 60,155,231, 36,127,206,247,126,118, 18,167,207, 41, 79,158,193,122, 26, 44,138, 73,140, -205, 57,131,115, 22, 41, 36,162,246,134, 77,232,125,114, 19, 35, 59,214, 83, 42, 31,135,225, 99,156, 24, 59, 77,251,170, 97,252, -165,151, 32,131, 38,100, 80,196, 74,137,200,182,238,218,198,110, 51, 50, 38, 38,129, 65,125,139,109,176, 82, 38,131,143, 60, 99, - 60,207, 60,113, 98,146, 65,144,222, 75, 62,141,253, 36,159, 23, 64,101, 2, 32, 78,156,255, 9,151,118, 46, 27,183, 69, 54,202, -209,207, 21,208,207,232,135,155,192,130, 93, 3,163,118,103,168, 4,118, 18,160,217, 51, 45,189, 6,137,189,230, 70,120,214,138, -213, 36,215,128,152, 60, 41,217, 26,180,147,108, 27, 89, 55, 80,228, 51,170,100, 19, 4,162, 9,134, 98,134,254,231, 50, 0, 26, - 20,136, 41, 64,159,106, 83,237,127,111,115, 63, 59,230,254,156, 6,158, 60, 3,225,206, 9,234,245,205, 83,200,113,176,106, 0, - 46, 43,106,140, 73,142, 75,156, 13,131, 49,128, 80, 26,233, 98, 28,142, 4,137, 68, 35, 77,149,164, 50,138, 24, 27,162,100,202, -248,158, 98,232,232,147,244, 14, 13, 48,183, 60, 8, 43, 46,131,246, 46,172,202,147, 0,254,164,109,216, 25,144,154, 6,181, 64, -214, 89, 59,181,190,100, 67,148,207,202,160,177,103, 97,131,141, 82,238,196,167, 52, 25, 48,157,200, 88, 94, 38, 3,152, 6, 16, - 17,207,243, 3, 20,103, 99,175,147,140,136,231,131, 37, 78, 52,232,220, 68,192,204,222, 87, 13,138,132,171,205,139,203,140, 0, -225,210, 24,134, 6,230,237,196,184,219, 96,252,131,182, 65,221,145,103, 55,183,206,248,118,216,167,255,214,100, 6,157,155,116, - 29, 65,198,176, 93,131,188,239, 36, 66,100,198,137, 56, 27, 23,178,136, 44,134,162,129,155,215, 45,240, 70, 86,158,186, 33,108, - 93,129,152, 98, 82, 83,237,191,134,177,159,131,156, 8,251,243,179,191,169,246, 60,130,251,211,144,178,231,244,188, 27, 95,179, -147,200,201,217, 99,122,100,186,249,141,111,228,147, 37,106,217,136,117, 13, 27,172,152, 64,208, 82, 90,109, 19,147, 6,189, 41, - 64,121,204, 94,121, 62,173,243, 86, 16,234,102,194,106, 76,123, 94, 82, 12, 79,209,189,225, 46,250, 30,254, 54, 28,253, 41, 58, - 30, 36, 71,136, 36,193,217, 4,231, 28, 82, 76, 80,103, 51, 16, 25, 7,240,201,176, 32, 50, 98, 37,220, 68,134,231,206, 88,220, -118,210,127,181,247,245, 36,132,168,249,218,237,207, 45,129, 60,251,214,224,211, 22, 19,161,198,213,140,151,218,127, 78,254, 23, -111, 32,227,115, 63,153,221,166, 70,159,104, 0,182, 26,179, 31,255,153,246,123, 50, 80,219, 9,134,152, 60,139,229,235,206,120, -184,233,173, 92,227,239, 13, 38,153, 56,155,129, 35,220,184, 97,209,176,241,213,215,202, 25, 6,225, 68,167,141,203,198,145, 26, - 33,242, 44,179, 99,121,246,178,195, 84,155,106, 83,109,170,253, 12,120,224,228, 89, 80,248,217,237,255,194,217,216, 53, 50, 97, - 73,131,223,209,217,236, 58,141,140,177, 1, 16,133,196, 25,153,198,189, 43,129, 49, 6,165, 50,230,150, 24, 72, 70, 97,248, 40, -125,155,239,167,178,231, 97, 74,241, 16, 90, 66,130, 32,212, 69, 42,193, 52, 22, 93,117, 43,204, 94, 14,173,115, 64,230, 83,146, -133,196, 57,133,148,147, 54,205,140, 37,141,119, 16,192,155, 24,213, 94,103,113,114,130, 88, 33,200, 62, 91, 99,149, 25,211,114, -141, 24,208, 56, 70,105,234,159,116, 13,219,191,248,133,202, 46,181,200,250, 20, 72, 92, 35, 96, 77,112,135,216,241, 49,141,199, - 58, 62,199,251,214,226,235, 85, 6,216,114, 28, 16, 51,150,219,152, 37, 48, 57,118, 83, 77, 2, 56, 87,151,198,211, 88,141,113, -208,157, 56,247, 41,179,166,238,171,174,199, 48,144, 52, 24, 11,141,247, 73, 50,133, 72,215,179, 4,196,148,255,113,170,253,143, -103,232,207, 17, 36,158,241, 62,242,231,236,223,255,238,239,220,100,155,254,156,241, 69,245,128,100,123,246,103, 83,207,222, 58, - 23, 82,159,235,126,207, 22,212, 39,116,172,225,225,185,198,205,127,156,161,225, 50,255,163, 20, 96,162,236, 45, 63,253, 91, 27, -194,208, 17,146,109, 15,208,247,212, 58,188,202, 0,158, 11,177,214,146,120, 37, 6,104,101,254,133, 47, 34,127,222,165,208, 50, - 19, 84, 9,100, 14,231, 84, 93, 3, 63, 35, 29, 13,155,166,191,213, 65, 93, 78,100,223, 19,228,250,179,140,105, 18,160,115, 6, -176, 55, 94,191,214, 3,253, 11, 89,212,238,140, 7,100, 51, 16,155,232,199, 86,238, 76,198, 59,225, 25, 60,231,251,199,117, 80, - 23, 53,229,162, 62, 23,182,206,192,205,164,197, 84,235,214,100, 80, 55, 19,230,215, 54,128,175,156,240, 12,168,167,136,121,147, -192,219,214, 25,243,184,223,220,214, 95,175,129,186,174,207,133,100, 10,212,167,218, 20,168, 79,129,250,255, 59,160,126,150,249, -123, 94, 64,221, 69, 46,101,163, 53,208,202,152, 83,246,123, 42,113, 26,164,181, 32, 18,176,149,244, 74, 70,128,148, 25,248, 25, - 48, 46, 13,127,119, 97,134, 13,165,236,195, 6,194, 81,136, 71,225,240, 14,250, 55,221,133, 24,234, 65,187, 24,103, 5,137,206, - 51, 38,243,228,103, 46,166,243,242,155, 97,198,121,144,155, 6, 78, 98,133, 78,189,157, 22,124, 49,238,231, 54, 22,148,108,144, -169, 29, 96, 45, 66,142, 59,196, 29, 50, 75,137,147, 56, 28, 88,135,148, 13,254,225, 44, 93, 30,145,166,205, 57,151,249, 91, 45, - 56, 12, 90, 78, 18,130,157, 58, 83,177, 16, 13,177, 8,207,211,162, 56,215,247, 71, 72,112,198, 34,164,196,186, 4, 41,107,156, - 94, 61,231,251, 27,107,144,210, 98,176, 8, 52, 2,133,176,105,192,162,214, 96,140, 65,214,213,118,149,230, 11, 24,139,175, 50, -159,142,117,105, 95,164,196,102, 25,102,198,102,156, 63,203, 29, 23,103, 91,228,162,102, 36,166,160,110, 38, 27, 9, 13,171,209, -152, 4, 95,129,200,162, 40,157, 84, 36, 14,180,144, 8, 44,198,184,113,149,104,170, 77,181,255, 65,160,238,156, 67,100,155,159, -115,162,225,223, 14, 33, 92,154, 26, 12, 19, 94, 7, 89,255,253,105,191,255, 89,157, 7, 33,178, 10, 18,214,166,217, 71, 98,146, -242,250, 52,160, 94,235, 95,237,239,173,181, 72,249,252,131,189,115,233, 88,165,148, 19,250,121,182,241,215,254,238, 23,254,148, -108,186,199,213,230,192,217, 36,221,171, 45, 8,217,224, 50, 77,139,177,164, 88, 68, 86,151,165,190,183,141,207,115, 58, 46, 85, - 31, 75,109, 46,211,159,212, 95,171,141,183,246,220, 38,128,186,117,198, 77,244,153,218, 9,160,110,112,104, 23,130, 41, 67,111, - 55,163,125,135, 49, 73, 21, 33, 60,148, 82, 56, 83,197,154,152, 32, 8, 48,213, 42, 5,109,137, 19, 75,164,138,104, 47,143,141, - 42,200, 44, 31, 61, 48, 35,152,238, 45,140, 30,217,141, 78, 66,164, 48, 24, 35,112,126,158, 49, 2,146,214,121,204,189,230, 21, - 48, 99, 57, 20,218, 65, 21, 72,178,126,168,108, 94,172, 77,165,254, 36,177,120, 90, 78,152,148,218, 4, 84,163, 16,173, 53, 74, -142, 15, 56, 49, 9, 90,105,194, 48, 38, 8, 60,146,196,162,149, 64,136, 36,203,179, 15, 8,141, 69,169,244,154,113, 28,145,243, - 68, 67, 0,157, 26,103,151,174,129,193,138,231,206, 16, 93,195,215, 68,158,197,226,115,214,130, 72,199,167,164, 2, 97,169, 70, - 33,129, 31,156, 51, 21,236,103,109, 49, 9, 34,147,253, 85,102,139, 73, 9,198,186,116, 49,101, 11, 50,142, 12,218,215,117, 85, -195, 37, 9, 74,167,210,121,210,160, 45,168,108, 33,215,103,112,178,133, 90, 3,245, 44,136,206,101,156,155, 58, 83, 31,159,155, -200, 88,124, 5,198, 68,232,218,230, 35, 37,233,213, 27, 19,241,166, 98,209,167,218,255, 44, 80,111, 4,244, 26,168,215, 94, 27, -127,253,108, 6,128, 60,227,179,207, 4,206, 53,160,172, 1,199,211, 27,201,153, 98,102, 82,240,108,188, 79,109, 31,126,118,247, -127,102, 32, 79,146, 4,207,243, 72,146, 4,173,245,132,113, 54,254,108, 4,246,255,242,167,149,129,110, 18,199,104, 45,211,192, - 50,151,170,216,198, 56,194, 48,100,100,108,148, 83,167, 78, 17, 70, 17, 90, 9,194, 56,162,185, 84,100, 90,103, 7,131, 3,167, -241, 2,159, 74, 37,164, 82,169, 96, 13, 36, 73,194,220,185,115,233,152,214,134,231,121,233,245, 77,132, 86, 26, 71,109,111, 61, - 19,127, 68,226,156, 27,247,163,219, 6, 95,103,205,167,154, 64, 56, 64,178,115, 29, 39,183,255,132,104,176,155,162, 78,192, 42, -194,114, 5,229,171, 12, 80, 65, 88,135,195,224, 5,121, 70, 42, 33, 82, 41, 52, 2, 41, 37, 73,146,224,139,152,146,142, 17,225, - 8,210, 90, 76, 18, 33,116,128,177, 18,116,142,170,204, 83,205,181,209,185,250, 74,114,231, 93, 7,237,243, 65,248, 56,151, 78, - 82,189, 24,141,115,169,133,226,200,194,228, 93,186,216, 27, 82,234, 92,150, 47, 47,132,192, 56, 80, 82,213,140,165,236,243, 25, - 47,140,203, 89,100,159, 7, 58, 32, 6, 18,155, 22,193, 19,184,113, 81,216,157, 5,188,197,179, 75, 49,248, 89,129, 61, 5,196, -164,129,197, 10, 16, 62,137, 53,104,169,112,206, 97,196, 56,120,138,231,114,211,196,128,146, 24, 41, 8, 45, 4,153,248, 34, 5, - 16, 39,160, 37, 40, 89,103,204, 53,235, 84,103,198,141, 20, 16,199, 14,233,139, 44,200,205, 33,176,104, 68,122,109,169,198,131, -233,196,153,249,230,245,160, 70, 49,169, 2, 96, 67,150,133,115, 22, 92,140, 84, 42, 77,199, 16, 10, 43, 92, 22, 81,224,234, 50, -253, 20,164, 79,181,255,177, 50,239, 57, 0, 50,142, 99, 60,207,195, 24, 67,146, 36, 4, 65, 80, 39, 58, 66,136,103,193, 86,109, -166,196,233, 9,215, 79,149, 47,241,172,229,247, 70, 98, 5, 60,175,160,222,120,141, 36, 73, 16, 66,156,113,175, 90, 31,106,255, -254, 47, 99,234,137, 67,170,137,196,197,217, 4,132,194, 57,193,232,104,153, 35,221,199, 8,130, 28,173,237,109,148, 74, 37,132, -146,248, 26,134, 70,199,120,228,225,135, 88,188,116, 41,115,103,207, 70,121, 1,198, 56,242,121, 63, 21,195, 13,140,140,142,114, -178,231, 56, 45, 45, 77,116, 78,159,134,150, 34, 85,164,179,130,111,103, 3,117, 61, 17, 85,228,153,145, 96,198, 66,181, 76,247, -142, 45,112,242, 32, 37, 49, 64, 46,172,162, 98,104,245, 60,162, 80,164, 8,104,210, 7, 45,165,196,132,131, 20,124,143, 36, 74, -210,130, 52,214,225,249,138, 40,172, 34,181,196, 24,131, 69, 18,228,155, 49, 46,193, 38, 22, 97, 66,138,206,160,203, 85,250,158, -120, 16, 53, 60,198,236,203,110,130,210,116, 68,208,132,179, 58,221,184,133,194,216, 20, 76,156, 32,157, 60,192, 56,135,179, 14, -231, 44, 74,165,252, 85,101, 15, 85,139, 76,214, 72,117, 18,132, 16, 88, 11, 38,137,241,252, 2, 46, 73, 16, 42, 53, 18,132, 5, - 79,213,188,214, 2, 83,207,162,111, 40,150, 34,158, 79,110,216, 88,181, 76, 54, 34, 89,250,158, 76,125,217, 21, 82,195, 68,100, - 29, 16, 2,236,115,205,149, 23, 54,117,214,219, 90,254, 96,214, 35, 99,210,133,234,107, 98,151,122,189,135, 12,140,133,112, 96, -207, 49,164, 2,103, 35,150, 45, 94, 72, 46,128,130,159,206,103, 78,166, 30,121,155,100,154,148, 18,103,248,131,206,236,174, 60, -227,183,198,160, 69, 33,210,231,164, 61, 15,144, 24, 9,213, 4,148, 22, 89,160,156,192, 26,131, 81,224, 79,237,253, 83,237,127, - 48,168,215,152,168,115, 46,147,125, 5,158,151, 86,231, 84, 74,213,153,245,179, 7,244,244,186,233,231, 82,249,124,252, 90, 98, -156, 4, 61, 35, 67,149, 19,250,247,124,178,229,218,181,226, 56, 70, 74,137,214, 26,107,237, 4, 25,190,241,111,255,171,153,186, - 84,162, 86, 97, 26, 50, 85, 65,123, 30,214, 66,111,239, 41,122,142,157,100,245,154, 53,120, 94, 74, 22,173,133,145,209,152, 67, -135, 14,112,255,253,247,179,106,245, 74,102,204,236,194,207, 7,132, 85,135, 14, 4,253,167, 99,170,213, 42,113, 28,211, 92, 42, - 49,123,222, 18,142,247,116,227,121, 99,116,118,182,102,216, 96, 56, 87, 28,145,174,111,162, 89,126,144,155,192, 22, 73, 3,222, -132,143,149, 62, 66, 23, 64,134, 56,171, 72,140,193, 10, 15,235,251, 84,194, 8,229, 28,121, 95, 34,156,193,218, 56,171, 79,238, - 8,180, 34, 73,170,200,196,100, 85,217, 52,232, 28,177,145,196, 81, 22, 91, 46, 32,144, 6,108, 66,206, 73,148,179, 84,246, 60, -194,241,129, 30,102, 93,249, 82,152,181, 28,145,111, 67, 90, 13,120, 72, 5,161,129,200, 64,197,129,231, 65, 32, 83,111,176, 6, -146, 36, 70,107, 15,107, 45,214,166,146,141, 20,181,200,114, 69,236,192, 73,141,243, 53,101, 7,190,246, 80, 14,132,201,152,112, - 70, 82,149,102, 34, 11,108,152,159,218,148, 62, 39,166, 60,121, 1, 55, 24, 13, 34, 11,206,139, 17,196,104,198,128,200,129, 87, -133,214, 92, 42,160, 40,245, 60,220, 91,164, 76,221, 58,139, 47, 37,214, 36,120,126,186, 80, 70, 19,199,152, 22,124,251,225, 61, -124,253,238,159,176,107, 95, 55, 82,251, 88,107, 49,206, 98,109,153, 5, 51, 74,220,250,162,171,120,205,205,215,211, 17, 64,171, - 7,158,240, 64, 88,226, 56, 68,251,185, 51, 67,106,106, 81,245, 13,105, 27,194,101, 54,192,164, 8,122,225,200,148, 30,139,209, -146, 50,176,247,196, 24,159,254,244,167,248,141,183,188,137,139,150,204, 6,169,168,144,130,186,117, 32,137, 8,209, 60,114,112, -136,239, 61,186,131, 3,135, 15, 19, 37, 49,133,130,207, 53,171,151,113,195, 5,139, 57,127, 86, 27,152, 8, 43,116,125,243, 59, - 61,208, 71,107,123, 27, 34, 84, 16, 52, 72,158,217,195, 22,130,255,118,153,111,170,253, 47, 19,225, 51, 73,188, 17,160,157, 75, -119, 7, 33, 32, 49, 14, 41,107,190,228,172, 96,151, 74,141,255,154,191,247,233,175, 15, 74,201, 9,114,123,146,140,251,196,207, -189,204,107,239,187,186, 33,208,216,223, 70,105,252,185,180,154, 2,224,121,222, 4, 48, 79, 13, 27,123, 78,102,126,182,121,251, - 69, 52,147, 88,148,206,226,183,164, 64,123, 30,149, 74,133,158,158, 94, 60, 63,207,234, 53,107, 80, 30, 28,239,173,242,212,222, -125,244, 28, 59,193,161, 67,135, 56,120,248, 0, 77, 77, 77,136,157, 71,104,105, 57, 76, 53,140,233,239, 63,205,240,200, 88, 26, - 68,158, 36,169, 17,163, 4, 11, 22,204,199,247, 36,115,231,117, 97, 18,208, 74, 96,173, 78,159,205,217,202,118, 91,231,220, 4, - 80,151,227,155, 44,144,118,214, 85,224,224, 79,233,223,245, 24,163,167, 15,146,195,224, 11, 15,131, 32,113, 14,133,165, 73,198, -232,112,136,177,254, 30,114,218, 17,217, 84, 18,151,198,225,148,135,145, 1,137, 87, 32,246, 2,240,138,228,242, 45,196,113, 12, - 46, 36,169, 12, 33,163, 65,124, 27,163, 77,132,151, 5, 90, 85,188, 86, 78, 55,117,177,236,154, 91, 96,209, 11, 64, 53,225, 92, -158, 72, 72,156,132, 47,126,243, 30,126,176,110, 11,151, 95,113, 5, 87,190, 96, 5, 47, 88, 58,139, 60,160,156,193,147, 10, 99, - 13, 74,164,134, 3, 56, 76, 20, 35,131, 2, 21,160,231,180, 97, 40, 76,144,218,163,168, 97,110,147,164, 80, 75,116, 23,224,132, -164,154, 56,124, 45, 38, 69,207,203,122, 97, 89, 82,209,254,249, 97,235, 46, 21,147, 77,173,216, 79, 70,107, 71,128,199,118, 31, - 97,253,206,195,108,124,108, 35,111,188,233,106,110,187,225, 18, 60, 83,179,200,158,227,125, 77, 4, 74, 17,217,212, 47,230, 9, -136, 77,130, 83, 62,189, 17,188,237, 79,254,158, 13,123,123,176,126, 27, 82, 5, 36,213, 10, 78, 8,132,167, 64, 36, 8, 98,252, -120,140, 25, 90,242,143, 31,250, 0,231, 47,108, 33, 15,104, 97,209,186,241, 64, 23,121,102, 5,186, 9,197,142,106, 59, 86,106, -246,214,229,248, 36, 66,105,141, 65, 50, 6,236, 30,128,223,124,215, 7, 24, 25, 58,205,223,254,249, 7,185,122,217, 44,114, 90, - 16,106, 40, 38, 33,158, 14,216,214,115,138,247,124,234,187,172,223,211, 75,217,107, 2,237, 35, 92,140, 69,145, 11, 7, 8,108, -200,109,215, 95,197,223,254,159, 27,152,230, 43, 92, 82, 65,232, 60, 68, 35, 88,191,192, 88, 85,177,105,239, 46,194,106,149,229, - 43,150,179,176,169,128,139, 70,192,107, 2,220,243,182, 97, 77,181,169,246,179, 51,246,241, 2, 80, 38, 19,216, 92, 67,193,172, - 90, 0,112,237,204,140,103,179, 68, 39, 6,199,165, 70,130, 16,207, 70,130, 31,255,108,205,216,109, 4,217,231,219,248,173,221, - 43,142, 99,124,223, 63,171,234, 48,185, 31,191,248, 7, 50,174,122, 70, 81, 68,181, 90,229,248,201, 94, 60, 29, 48,119,126, 23, - 56,216,180,121, 15,247,253,240, 65,134, 71, 42,140,140,140, 80, 40, 21, 25, 28, 28,100,201,146, 37, 92,116,225, 37, 40,229,177, -103,207, 94,162,196,226,251, 57, 18,107,144, 66, 99,108, 12,214,144, 15, 52, 39,142, 31,230,198, 27, 95,200,101, 23, 45, 71,101, -226,120, 74,186,207,236,146,182,100,229, 93,235,111, 38, 52, 86, 28, 73,229,110,133, 90,120, 62,211, 58,230,210, 82, 29,192, 57, -139, 53, 30,194, 73, 36, 17, 58, 25,132,225, 30,236,238,245,228, 42,253,196,229,129,148, 9, 43,143,170,240, 72,114, 29,132,173, - 11,201,207, 89, 70,174,125, 38, 34,223, 76,222,207,103, 69, 64, 44,149,211,189, 48,124,156,145, 35, 59,209,195, 61, 84, 70,122, -105,201,123,168,112,136,150,145, 35, 28,126,232,155,116,197, 9, 44, 90,139, 8, 60,156,244, 83, 73,152, 28,235, 15, 13,179,174, -251,135,220,121,223, 67,124,228,125,191,205,133,139,103,224, 75,149, 5, 87,213,228,234, 36, 5, 7, 63, 32, 4, 6, 34,184,253, - 63,190,199,163, 63,221, 69,226, 96,249,188, 14,110,127,207,219,152,215, 36, 80, 73, 37, 43,154,162,201,233,134,224,173,134,148, - 58, 37,206,122, 4,201,207,189, 38,234, 7,156,136,198,162, 57, 16, 1,135,135, 13,239,251,200, 39, 56, 94,209, 72,107,184,126, - 56,166,127, 48, 97,110,179,158, 88, 53,237,231, 19,143,112, 42, 71, 28, 27,148,167,192, 89,146, 56, 70,120, 1, 67,192,187,254, -234,147,108,216,223,135,107,154,137, 41,151,209,201, 48,107,231,118, 80, 42, 4,140, 68, 85,158, 58,114,130, 49, 89,194,229,154, - 57, 86, 30,224,255,255,240,223,242, 55, 31,120, 39, 23, 44,106,167, 89, 73, 72,210,224, 68, 85,243, 53, 53, 40, 28,245,170,115, -181,133, 55,161,214,186,197,100,158, 33,173, 53, 97,156,128,231,115,170, 10,127,240,177, 79,112,180, 42, 80,126, 59,167, 67, 65, -100, 33,135, 35,177, 2, 79, 43, 30,223,123,148,215,124,228, 43, 28, 25, 43,225, 21,166,227, 85,135, 40,248, 80, 84, 17, 67, 21, - 65, 69, 21, 8,155,230,242,197,135,246,179,239,240,113,238,249,235, 55, 83,170,165, 47,202, 2,255,116,207,102,222,249,153,135, - 64,232,148,198, 36,247,242,214, 95, 94,203,231,126,231,197,207, 16, 13, 60,213,166,218,207,239,126, 59, 87,108, 78, 99,112, 48, - 64, 18, 59,180, 78, 65, 55,243, 24,166,241, 76, 98, 28,212, 27,255,253,108,128,178, 6,128, 73,146,160, 84,202, 0,163,208,226, -251,242, 25, 11,114,140, 51,122, 65, 28,155,134, 8,109,158,209, 32,120,182, 64, 62,249, 62,190,239,215,193,187, 49,104,176,102, - 92,212,254,182, 22,111,240, 11,109, 2,170,213, 42,163,163,195,244,247,247, 35,181, 98,116,116,148, 66, 73,179,119, 95, 55, 91, - 54, 63,201,250,199,183,144,203,183,144, 24,193,244, 89,243,137,146,152,249,109,211,105,239,156,137,246,243,236,217,179,135,216, -129,206,229, 49, 78, 96,156,197,224,144,218, 67, 43, 77, 37,170,160, 60,205,246,157, 79,178,106,229, 34,218,154, 61,158,174,230, -188,150, 13, 82,231,120, 63, 27, 11,104,130, 21,169,227, 94,182,206,133,164, 61,149, 95, 19, 73, 65, 57,112, 99,216,238, 62,142, -111,219,132,233, 61, 68, 43, 33,158,242,176,206, 17,203, 28, 97,190,131,166, 69, 23,209,182,232, 50,170,205,115, 24,243,155,209, - 77,237,132, 78, 16,104,129,139, 33, 63,171, 74, 80,233,165,121,225,106, 78,109,123,144,177,238, 39, 81,229, 62,242, 90,226, 37, -195,200, 50,244,108,249, 17,179,103,204, 2,191, 9,240, 83,182, 44,115, 84, 68, 9, 39, 53, 35, 73,196,112, 44, 24,142, 65,248, -128,146,196,169,216,143, 68,227,123, 18,108,202,217,133, 7,189, 35, 9,221,131, 49, 14,104,106, 10, 41, 27, 71, 37,180,148,130, - 28,214, 90, 98,169,137, 26, 38, 74, 9,137,170, 69,134,103,178,187,202,146,202,220, 89,190,166,166,225, 39,212, 75,186,156, 33, -217,215,114,176,173, 72, 67,190,146,154,251, 67, 64, 8, 84, 81, 12, 25,197, 96, 44,105,201, 23,168,196, 9, 74, 41, 18, 3, 90, - 73, 18,145,130,255,217,242, 23, 85,125,252,231,144,142, 72,239,129,167,210,185, 18, 18,223,243,168, 38,142,222,193, 42,219,183, -239,196,243, 59, 8, 43, 35, 92,184,180,139,119,188,229, 13,116,181, 6, 4, 58,237,103, 95, 4,255,124,199, 15,185,127,221,102, - 84,190,153, 99, 35,131,124,254, 27,223,225,175,222,253,235,248,198,209,162, 21,227, 85,221, 38, 84, 25, 64, 61,243,119, 5, 3, -196, 14,240,124,134,129, 63,251,135, 47,178,227,224, 73, 98, 93, 36,137, 35, 98,161,176, 46, 45, 9,235, 11,205, 96,108,121,215, - 23,215,115,180,156, 71,230,243,204,150, 35,252,198,107,175,226,178,243,151, 80,244, 4,221, 61, 39,248,234, 3, 79,240,253,109, -199,105,111, 42,241,232,238,211,252,213,215,126,204,135,223,112, 93,102, 69,157,226,130, 5, 93,188,239, 53,215,241,214,107,231, -209, 25,120,252,209,215, 55,243,169,123,158,224,245,215,172,228,250, 85,243,176, 38,139,171,124,190,138,255, 79,181,169,246,180, - 96, 47,144, 50,221,183, 70,134, 35,142,246,244, 83,173, 36,120,158,194,216,152, 5, 11,230,211,212, 36,120,224,129, 13,108,220, -184,145,203,175,184,136,171,175,190, 60,141, 11,106, 96,236,231,252,158,101,105,190,214,146,102,177, 56,248,209,143,214,179, 97, -195, 6, 46,187,242, 50, 94,116,237,229,147, 24,233,153,215, 72, 44,148,203,134,163, 71,143,146,132, 17, 96,209,158,164,163,163, -131,233,211,219, 38, 40,191, 78,156,253, 40,133, 70, 55,220, 4,247,155, 76, 83,150,173,131, 67,135,123,248,198, 55,190,193,187, -223,253,206,172,216, 25,117,223,127, 35, 81,177, 22,134,135,171,244, 28, 63,202,121, 43,151,156,209,125,247, 44,246,158,159,165, -157, 56,209, 67,165, 82, 97,233,210,165, 56, 1,167, 6,134,217,189,103, 63,119,126,255, 62, 90,218,166, 51, 99,198, 12,252, 32, - 79, 53,138, 81, 10,166,119,118, 48,109,122, 39,165, 82,137,187,127,240, 61,186, 22, 45, 78, 99,209,108,140, 53,224,231,242, 0, -148,203,163,140, 69, 85,250,251,122,152, 61,163,149, 25, 51, 58,105,105,246,198,173,189,115,116, 86,227,178,128, 8, 57, 46,183, - 43, 33,211, 52, 42, 28, 66, 10,180, 16, 8,151,234, 61, 90,120,104, 15, 80, 49, 84,250,113,123, 30,229,248,214, 7,240,134,123, -104, 22, 21, 92, 20, 19, 10,129,244, 10, 84,117, 43,122,225,101,176,248, 50, 76,251, 18,108,177,147,237,135, 79,242,228,198,159, -114,240,104, 15, 66, 40,102,183,183,113,225,210, 46,174, 92, 54,159,166, 82, 59, 29,205,109, 36,143,249, 68,123,215,161,163,211, - 96, 12,121, 29,146,244,239, 39,217,254, 19,244, 69,211,240,154,155,168, 0, 2,157,229,110, 59, 48,150,170, 21,244, 70,176,179, -167, 74,185, 90, 65, 8, 71,115,177,192,156,246, 28,179, 11,146, 64,130,103, 65, 68, 89,116, 38,154,196, 90, 20, 30,166, 92,197, -250, 57, 42, 8, 66, 41,217,120,104,144,163,167,134, 56,213, 55,130, 67,163,181,100,230,180,102,150,207,237, 96, 65,135,166, 61, - 59,224,205, 40, 75, 66, 90, 27,191, 22, 48, 81, 5, 6,170,176,227, 64, 31,199,134,135, 9,130,128,142, 32, 96,249,252, 78,102, -148, 82,223,175, 76, 18,180,150, 36, 86,146, 72,232, 30,130,222,193, 42,229,200, 80,169,198,180,183,182, 48,125,182,192,104,176, - 86,163,188, 28, 73,146,224,108,132,117, 9, 86,122, 84, 36,156,172,192,174,163, 67, 28, 57,213,207,192,233, 65,112,154,166,130, -207,130, 57,157, 44,153,221,206,236,146, 32, 79, 42,213,105,149,254,172,157, 84, 90, 5, 78,150, 97,199,158,227,156, 56,178,159, -215,222,114, 53, 22,129,167, 5,115,219,242,124,230, 99, 31,228,247,254,236,111, 57,127,237, 5,188,227, 77,175,161, 69, 67, 49, -112, 8, 19,147, 47,120,116, 36,130, 63,126,235,141,116,239,219,198,222,147,101,130, 92, 43,235, 55, 63,197,169,193,132,142, 54, - 72, 76, 26,219,128,144,103,230,160,187,113,147,198, 58,129, 20,181, 64,189,184,230, 76, 67, 42, 69, 44,210, 32,193, 15,127,225, - 62,238,223,180, 15,151,107,198,132, 33,129, 48, 88, 83,193,216, 40,139,165,208, 60,112,120,148,245, 91,159,164,109,206, 28,198, -250, 79,114,251,251, 95,207, 43, 47, 94, 0,140, 1, 30, 87,204, 95,201,235, 46,239,226, 21, 31,253, 1,223,219,124,144,160,216, -196, 55,215,239,224,253,111,184,142,102,160,234, 90,121,225, 82,203, 11, 87,188, 0,240, 25,169, 72, 62,242,182,235,248,212, 67, - 91,120,104,203,110,110,120, 65, 87, 22,140,249,204,155,229, 84,155,106,207, 78,169,155, 84, 43,188, 65,206,205, 80, 23, 99, 64, - 40,193,190,238, 94, 62,246,225, 47,128,200,129,168, 96, 93, 72,169,152,231, 29,239,120, 7, 35, 99, 69,182, 61,121,140, 85, 47, -184, 4, 41, 33,140,210, 88, 35,235, 32, 73,210,122, 19,245, 26, 97, 89, 30,181,115,105,114, 74, 20, 57,124, 95,164, 68,196,192, -208,152,102,251,238, 99, 44, 91,147, 16,101,125,179, 89,141, 39,237,101, 5, 55, 51,249, 55, 78,187,200,158,131,253,124,252,163, -159,100,237,234,149, 40,233,136,146, 10,151, 93,117, 41, 47,236,188, 4, 45,210,239,188,205,172,121, 9,184, 44,106,220,101, 85, - 36,107,125,212, 46, 83, 30,212, 56,225, 73, 12,120, 18,198,198, 52,155,183,237,197,200,241, 10,155,141,227,187,243,251,235,216, -254,212, 30,222,243,158, 95,229,192,161,211,252,221,237,159,224, 75, 95,250,123,172, 29, 63,183, 66,100,231,153, 52,158, 99, 97, - 77, 58, 6, 41, 83,252,211, 34, 77,229, 77, 3,147, 83, 63,190, 64, 65, 38,239,139, 90,180,125, 98,233,233, 57,138, 53,134,149, - 43, 87, 98,173,101,104,100,148, 31,252,224,110, 94,242,146,219,184,250,234, 10,187,118,239,167,125,122, 59,109,109, 45,204,155, - 63,155, 89,211, 59,153, 57,107, 26,194,193,177,158, 62, 78, 30,233,226,200,209, 99,180,180,182, 19, 38,134, 56, 49, 12, 30, 29, -197, 24, 67,160, 61,170,213, 50, 90, 91, 2, 95,178, 98,249,162,236,156, 12,135, 53,114, 60,234,126, 50,168,167,145,224, 38, 61, -160, 2, 80,181,205, 85,164,105,100, 34, 11,156, 16, 88,180, 2,146, 16, 92, 12,225, 32, 67,155,238,103,100,247,122,188,225,110, -138, 46,196, 19, 14,227,107, 34,145,167, 44, 10,228,102,174, 36,183,232, 34,220,140,243,232, 53, 37,190,250,157,135,249,218, 15, -127,194,201,177,152,170, 19,152,196,162,133,101,118, 41,224,198, 11,207,227, 93,111,121, 5,115,155,186,152,121,233,205,244, 14, - 30, 39, 60, 86,161, 20, 36,152,112,132,230,124, 66,207, 83, 27,153,191,248, 74,172,215,129,206, 23, 16, 50,139,128,148, 30, 85, - 45,120,226,192,113, 62,253,213,187,232,235,235, 99,120,176, 31,237, 73,130, 92,129, 5,179,166,243,146, 43, 46,230,182, 27, 46, -160,205,203, 30,166, 86, 68,214,224, 41,141,113,150,196, 41, 66, 37,232, 30,130,143,124,250, 11,236, 57,118,146,158,190,211,120, -104,140,113, 41,112, 11,193,156,142,102,110,125,209, 21,188,245,165,215,208,146,151,148, 45,236,220,123,136,200,228,176,206, 99, -225,226,105,108,222,118,128, 47,127,251,110,158, 58,220, 67, 25, 65,108, 13, 45,158, 79,215,244, 54,222,241, 43,175,225,133, 23, -204, 33,167, 53, 6,232, 75,224,155,247, 61,198,189,143,110,229,112, 79, 63,213, 40,149,140,148,144, 44, 89,182,148,151,222,242, - 18,156, 46, 80,173, 36,228, 60, 8,242, 57,170,206, 49,166,224,177, 39, 79,242,201,175,124,155, 3,199,123, 25,139,170, 68, 81, -130, 39, 61, 60, 37,193, 69, 44,235,154,193,175,191,250, 37,220,112,201, 10, 10, 10, 14,247, 86, 57,112,188, 23,163, 60,132, 16, -232, 82, 11,159,251,242,119,216,178,117, 43, 50, 26,228,230,155,175, 38,239, 11,132, 75, 40, 40,197,154,121, 29,252,227, 7,223, - 77,169, 84, 98, 94,179, 36,192, 32, 93, 76,161,232, 19,133,101,180,151, 67,106,201,149,107,150,211, 61,176,131, 74,104,241,208, - 28,236, 62,198,146,230,217, 72,255,105, 92, 3, 13, 68,183,150,153,144, 36,105,150, 68, 18,135,104,157, 30,244, 83, 5,190,242, -224, 19,220,113,223,163,132,185, 54,202,213,152,156,159, 67,152, 8,107,199,197,124,237, 18, 30,222,218, 77,161,165,200,200,216, - 24, 75, 23, 47,224,194,243,230, 66, 50,130,197,199, 74,141, 76, 66,164,159,227,213, 55, 95,201,119,182,245, 97,132,100, 52,146, -116, 31, 29, 96,245,220,118,202,210,144, 83, 5,254,225,174, 39,249,235,111,172, 99,168,191, 15, 89,204,163,173,100,112, 44,243, - 17, 58,139,203,210, 10,167, 92,234, 83,237, 23, 13,249, 14,135, 80, 18,227, 72, 21, 74,147, 39, 49, 1,127,244,167,191,207,191, -125,225,243, 28,239,233,230,240,209, 62, 12,121,144, 69,162, 72, 17, 91,120,236,241, 3,172, 91,183, 14, 33, 28,115,230,204,225, -150, 91,174,103,227,198,157,140,149,135,112,206,113,248,240, 17,194, 48,228,154,171, 46,229,242,203, 87,176,239,192, 16,119,223, -125, 31, 67, 67, 33, 99,229, 42,198,230, 16,186, 5,235,224,129, 7,158, 96,195,227,219, 40, 21,138,204,156,217,198,139, 95,124, - 61, 79, 62,177,131,161,209, 17, 22, 45, 89,204,238, 61, 7, 80,186, 25,207,107,225,247,223,253,107, 72, 5, 54, 43, 86,245,208, - 67,219,216,188,113, 19, 5, 63,224,134, 27, 94, 68,199,244,105,108,216,248, 40, 47,189,233,122,132,131, 31, 62,184,158,246,206, -217,204,156, 53,143,205,155, 54,224,170,101,246,236,221, 77,123,231, 76,222,244,230, 87, 48, 54, 10,235,215,111,102,203,134,109, -105, 45, 20,227,129,128,175,223,241, 32,123,247,238, 69, 74,205, 11,214, 94,200,141, 55,174,101,251,174, 3,156,236, 29,226,174, -187,183, 83, 42, 22,185,237, 85,191, 66, 98, 97,199,246, 3, 60,244,227,117, 84, 42, 21, 46,188,112, 45,215, 95,127, 9,247, 63, -248, 4,113, 28,179,111,207, 94,108, 18,115,195, 13,215,178,122,205, 2,148,148, 36, 36,104,169,137,147, 24, 45,211,172, 0, 79, -167, 21, 78,133,116, 88, 19, 35,133,199,169, 83,167,136,227,152, 69,139,151,146, 36, 17,163,163,163,124,247,187, 63,224,178,203, - 46,195,247, 60,110,186,233, 58, 86,175, 94, 77, 71,199, 52,180, 22,228, 2,178, 35,180, 13, 88, 71,215,220, 78, 94,246,210, 27, -248,209,131,143,176,117,235, 14,140, 3, 47,200,211, 92,106,194,211, 62,249,124,158, 92,224, 99,147, 50, 35, 35, 39,153, 57,189, -131, 40,142,240,148, 68, 42,125, 78,177, 80, 27,151, 32,148, 72, 79,169,170,249, 89,157, 32, 52, 2,169, 82, 70, 34,117, 38, 28, - 39,229,116,155, 61,185,135,254, 13,247, 49,218,189,147, 32, 26,162,168, 45, 94,226, 48, 54, 38, 22,130,138,167,169, 54,205,101, -214,146,139,137,155,230, 18,229, 90,184,227,222,205,252,195,215,239,166, 44,155,168, 82,196, 33,145,158,162,234, 98, 14,148, 99, -190,240,208,102,202, 78,242,103,191,113, 27,179,114, 51,153,126,222,181, 28,237, 31, 32,172,118, 83,240, 45, 81, 56,136,150, 5, -250,247,111,163,173,121, 14,126,190, 0, 54, 68, 72, 67,197, 9,186,203,240, 79,119,220, 75, 84,141,241,133, 37,112, 1, 54, 52, -140,134, 17, 7,135,143,177,101,255, 49, 30,219,181,143, 15,252,250, 43,241, 11,138,177, 56, 68,248, 16,155,144,208,198, 68,129, -207,161, 17,199, 31,222,254, 25,182, 29,236, 33,172, 26,124, 5, 45, 5, 71,190, 73, 99, 8,232, 57, 93,102,231,169, 42,187,255, -243,126,122,142,247,243,182, 55,223, 70,169, 25,222,253,145,207,112,178,236, 17,139,128,121,243,230,210,119,234, 36, 35,195,101, - 44,154,216, 89,208,121, 70, 43,112,170,251, 52, 31,253,215,175, 81,124,207,239,176,122, 94,192,104, 2, 31,252,228, 55,185,255, -241, 39,136,172, 4,167,211, 28,241, 48,194, 57,203,201, 39,182,179,110,199,110, 98, 20, 94,224,131, 8, 25, 11, 35, 42,202,231, - 75, 15,236,229,246,207,253, 7,195,177, 36,142, 99, 58,138, 57,102,180, 6,248, 82, 48, 92,174,208, 87, 53, 60,118,224, 20,123, -254,233, 43,188,243,215,222,200,171,174, 94,193,250,237,123,248,227,207,124,141,178, 42,224, 35,209, 90, 49, 52, 58, 74, 94,121, - 20,133,162, 50, 18, 83,201, 65, 46,159, 22,229,105,213,142,139,186,166, 99,172,195,154, 16, 45, 29, 57, 95, 34,136, 9,124,133, -148,146, 2,208, 90, 42, 98, 13, 40, 63,192, 79,210, 2, 10,137,149,196,137, 37, 80, 26,215, 16,125, 80, 47,249,154,157, 41,224, - 12,104,173,136, 99,144,190, 72,125, 73,158, 6, 19, 17, 41,159,173,199,225, 47, 63,253, 29,134,241, 65, 41,140,239, 83, 49, 33, -158,240,144,210,195,224, 97, 4, 40, 11, 5, 91,161,172, 75,248, 84,105, 82, 21,114, 46, 6,233, 48, 34, 72,162,223, 73, 35, 0, - 0, 32, 0, 73, 68, 65, 84, 43,210,249, 62, 6, 73,135, 27,166, 67,142, 49, 68, 9,172,135,137,210, 44,252,246,124,192,219, 63, -119, 47,159,189,123, 27, 31,126,227, 5,188,226,178,215, 17, 59,195,154,119,255, 27,158,159,230,197, 75,233,176,206, 77, 9,239, - 83,237, 23,236, 83, 31, 23,137,147,172,146,164,231,165, 5,191,164,242,217,179,251, 48, 99, 99, 21,180,239, 49,115,246, 44, 14, - 31, 58,130,211,128,214,220,241,205,245,252,224,206, 31,210,218,218,142,194,177,115,215, 81, 78,246,134,148,203, 85,246,236,217, - 3,164,209,213,142,132,109,219,246, 49,103,238,159,243, 55, 31,251, 2,131,195, 35, 44, 91,182,136,114, 53, 33, 54,146,106, 69, -241,181,175,109,229,158,123,238,161,179,115, 26,189, 39,134,217,180,105, 23,167, 7, 44, 3, 3,253,236,218,181, 3,165, 60,162, - 56,225,250, 95,186,137,176,154,176,115,103, 25, 72,112,210,209,115,226, 56,223,252,214, 93,188,234,149,175,196, 84, 35, 62,246, -209,207,240,107,111,253, 53,190,250,213,187,121,217, 75,175,199, 56,216,176,105, 23, 43, 87,230,113,182,149,175,126,229,251,220, -118,203,181, 92,113,213,213,124,225,223,239, 96,206,252,149, 28,216,127,136,238,238,110,110,123,249,203,217,187,119, 55,222,206, -237, 36, 6, 6,135,203,220,120,211,173, 88,163,248,220,191,252, 43, 58,223,130, 85, 30,113, 98,177, 22,154,219, 58,249,226,151, -254,131, 43,174,188,152,143,223,254,105, 94,247,154,219,240,115, 5,238,248,198,119,113,170,141, 77, 27,247,112,226,228, 81,222, -244,134, 87,178, 99,219, 79,249,242,151,190,206,199, 62,254, 94, 76,156,166,169, 25, 12,158,246,210,115, 43,164,196,154, 84, 65, -148, 74, 32,149,160, 90, 25, 97,104,184,159,165,203, 86,146, 24, 75,185, 28,113,255,253, 15,178, 98,197, 10,230,205,155,147,166, - 27,106, 88,208,213, 81,143,115,168, 17,107,147,164,241, 63,198, 89,140, 25, 99,201,162, 57,120,158,199,192,192, 40,126, 46,143, - 69, 82, 42, 53, 83, 40, 20,104,110, 46,209, 84, 12,104,110,202,177,255,224, 17,214,174, 89,150, 22, 76, 35, 78, 85,117,188, 51, -214,142,182, 98,188,128, 71, 26, 45, 46, 16, 66,226,213, 34,151,173, 65,145,160,108,152,202,152,123, 55,115,100,203,143, 40, 14, - 31,163, 88, 57, 73,209,211, 72, 19,167,197, 65,100, 90,118, 48,118,160,219,231, 66,203, 92,130,214, 25,236, 60, 57,198,103,238, -248, 62,229,220, 52, 70,171,224,148, 95, 47, 72,131, 82, 24,169, 9,165,230,174,199,182,243,178,171, 47,224,197,203, 59,240, 23, -159,143,183,107, 19,241,145,163, 40, 28,158,176,228,136, 25,233, 59, 70, 91,101, 16,213, 58, 11,107, 83,255,178,139, 19, 76,224, - 17,153,132,206,230,128,181,203, 23,209, 89,204,115,232,232, 49, 54, 31, 56, 74, 36, 60, 6, 98,195, 93,143, 61,193,244,150, 2, -111,120,195, 75,193,203,167,149,109,165,196,250, 1, 67, 6, 62,241,207,255,194,214,253, 61,148,173, 71, 62,200,241,242,155,174, -227,218,139, 23,211,156,247, 24, 46, 59,190,243,163,117,220,179,101, 47,163, 54,228, 27, 15,109,100,214,226,101,252,242, 77,231, -209, 31, 9, 6, 69,137,200, 41,134, 15, 28,163, 37, 39,184,120,245,114, 22,116,205,103,180, 60,198,186,173,219, 56, 50, 88, 5, - 47,199,238, 19,253,252,248,137, 93,204,156,190,150,127,252,236, 29,220,253,248, 78,134,140, 79, 73, 75,242, 56, 86,173, 92, 70, -215,172,153, 12,143, 12,176,125,247, 62,250,198, 12, 33,130,216, 65,130,193, 74,143, 19,195, 9,255,126,231, 3,156, 74, 2,140, - 14, 40,248,142,215,188,226,151,184,116,205, 10,156,177,244, 14, 13,243,149,187, 31, 96,243,174,221,152, 40,224,243,223,190,159, - 11,151, 45,162,191,154,208,107, 52, 85, 85,192,119, 6, 85,174,210, 18,104,206, 95, 52,143,217,249,249,120,164, 32, 44,100,234, -209, 54,113, 68, 65, 6, 24,225, 80,197,194,120,148,128,137, 65,165,113, 13, 9,112,106, 96,144, 56,206, 82,227,146,152,174, 57, -115, 51,151,142,110,240,101,141,151, 31,182,153,187, 34, 13,246, 72, 15,222,213, 94, 42, 3,106, 15,156,240,168, 40,216,123,202, -240,246,247,127,156, 49,124,138, 18,102,207,158,206,174,195, 39,209,158,135, 11, 99,156, 73, 83, 54,164, 3, 33, 45,151,204,109, -134,112, 12,209,220,193,206,131,189, 60,113,240, 20, 47, 94, 61, 15, 25,149, 17,202, 79, 11, 32,105,159,159,118, 15,114, 42,241, -208,190, 79,179,111,152,223, 57, 29,128,221,125,131,124,246,158,157,124,224,214,139,248,195, 87, 93,207,152,131,162,132,130, 53, - 84,101, 42,148,142, 57, 77,209, 85, 49, 50,199, 84,200,220, 84,123,126, 0,253,220,158, 93,137, 66,169, 52, 27,200, 36, 9,113, - 84,197,243, 60,190,247,221,111, 18,219, 10,206,193,177,227,125,105, 16,112, 18,131,244,120,240,161,117, 36, 70,113,213, 85,215, -131,139,185,243,206, 59,217,184,249,167,172, 89,189,150,106, 40,120,219,219,222,206, 5, 23,182,243, 23,127,249, 57, 78,156, 56, -193,147, 59,143, 49, 48, 80,229,202,107,174,229,237,191,117, 13,247,222,183,139, 47,127,249,235, 4,126, 19,247,221,251, 19,146, - 68,115,225, 5,151, 34, 21,220,249,253,251,248,241, 35,155, 56,127,245, 42,164,202,113,219,109,183,176, 98,197, 50,122,251, 6, -248,241,143, 28,247,221,127, 39,214,198, 68, 38, 45,142,114,221,117,215,113,227, 13,203, 48, 9, 60,190,113, 43,187,247, 30, 5, -145, 35,138, 83,247, 64, 98, 20, 66,230,113, 46, 0, 20,183,189,226, 38,132,132,135, 31,217,198,232, 72,200,230, 45, 79,242,154, -215,190,130,213, 47,152,129,159, 83,252,224,158,251, 16, 18, 46,185,244, 42,118,237,120,138,131, 7,142,162,148,102,100,100,132, - 37,203,150,130, 53,188,236,150,213,108,223, 17, 82, 9, 19,214,173,223,201,156, 57,139,120,241,139,175,196, 10,232, 63, 29,242, -232,186,205,248,202,227,230, 95,122, 49, 23, 93,180,128, 98,222,231,161, 7,126, 2,164,125,170,135,241, 58,139, 68,100,149, 60, -189, 44, 13, 55,205,231,217,183,111, 31,115,231,117, 33, 4,132,213,132, 31,222,255, 32, 77,165, 22, 22, 44, 88, 68, 18, 70, 76, -155, 86, 76, 9,138, 19,105,217,216,204, 77,160, 84,154, 66,232, 28,140, 12, 13, 51, 58, 60,192,138, 21,139, 88,117,222, 26,246, - 31, 60, 73,169,169,141,106, 24, 82,137, 66,134,134,134, 8,195,144,161,225,211,216,195, 21, 58,166, 53,115,244,216, 9,102,205, -106, 35, 80,100,199, 73,159, 77,126, 71,165,149,185,107, 14,225,236,204,116, 37, 44,214, 24,180, 82, 16, 87, 33,233,199,110,251, - 49,199,182, 62, 72, 48,214,139,136,199,104,245, 4,196, 9,214, 25,132,116, 8, 9, 57, 96,204,129,215, 52,141,196, 47, 32, 80, - 60,182, 97, 3,131,145, 96, 4,192, 87, 96, 19,172, 17,105, 14,123, 28,165,145,140,170, 64,217, 56, 30,216,176,137,203,150,189, -152, 25,126, 30,127,198, 44,226,147, 5, 76, 52,138,146, 30,213,177, 81,108,229, 52, 34, 26,166, 82,137,208,170, 64, 92,141,201, -229, 74,168,104,148, 85,243,166,241,190, 95,189,141,165, 51, 91,105,246, 52,137,242,248,238, 35, 91,249,212,127,126,159,227,113, - 66, 28,228,249,246,143,183,176,230,234,151, 16,225,227,108, 90, 92, 38,198,231,169,227, 99,172,219,182,143, 72, 55,227, 73,197, -154, 37,139,185,225,234, 43,233, 44, 26, 90,138,138, 89, 10,222, 50,253, 22,214,237,249, 28,161,149,140, 38,240,192,166, 29, 92, -115,237,121,228,115, 69,170,167, 43, 8,161,152,153, 51,252,206, 27,111,229,133,231, 47,166,181, 24,224,132,199,166,171, 86,243, -238,127,248,119, 78,140,134,128,226,169,195, 61, 60,121,104, 41,143, 63,185,135,178, 85,228, 60,159, 78, 85,229,119,127,229,213, - 92,123,241, 42,124, 34, 20,240,212,177, 83,188,255,147, 95,230,240,144, 69, 75, 31, 37, 37, 65,177,157,135, 30,125,156,131, 61, - 39,137, 69,128,112,134, 75, 47, 57,159, 43, 47, 93, 69,123, 94,211,220, 12,157,213, 60,175,205,189,140, 61,135, 14, 51, 24,194, -129,147, 67,220,245,200,227,116,118,118,162, 60,137,173, 14, 19,105,195,220, 86,143,119,189,242,102,126,233,162, 85, 20,176, 52, -123,105,158,126, 98,211, 92, 88, 47, 40,101, 65,249, 38, 61, 61, 79, 72,140,117,160,242,144,105, 59, 9,176,121,251, 83,120,158, -135,115, 48,123, 90, 11,109,165, 28,158, 20,227,117,165, 39, 49, 15,199,248, 1, 45, 66, 26,112, 85,132,203, 17,232,212,217, 85, - 5, 14,197,240,174,191,251, 23,122,171, 49,121,165,185,104, 70, 19,239,248,173, 55,240,198, 63,248, 40,177,145,120,210,225, 73, -131, 71,146, 6, 30, 74,199,165, 23, 47,103,213,220,199,216, 61,168,144,194,227,119, 63,249,125,126,240, 23,111,102, 89, 71,192, -168, 83,148,146,126, 70,163, 86,190,182,177, 59,149,160, 42,125,188,248,202,229,180, 53,165,253,218,119,180, 23,170,163, 44,158, -215, 14, 98,152,162,104,102,223,177, 94,202,158, 71, 83,232,192,149,201, 17,164,135,237, 76, 81,245,169,246, 60, 52,113, 46,183, - 84,118,106,161,179,227,126,112,107, 99,242, 5, 73,165, 58,204,151,255,227,253,252,240,129,195,124,233, 75,223,226,203, 95,248, - 22,175,126,205, 45,228,189, 34,149, 48, 97,180, 28, 98, 81,236, 63,116, 16,220, 24, 43,215, 44, 70, 73,159, 40, 42, 35,149,163, -173,189,153,150,102,232,156,222,204,137, 19, 39, 40, 87, 66,164, 39,233, 90, 52, 7, 43, 33,182, 21, 60, 47, 32,142, 19, 70, 70, - 70, 16,194,113,164,231, 32,137,137, 56,255,194, 21, 36, 49, 36,177,192, 10, 88,186,172,147,165,203, 3,146, 56,143,148, 17,239, -249,253,215, 18,134,224, 7,240,145,191,249, 60,185, 98,130,203,234,105,228, 75, 62,198, 24,180, 23,160, 60, 8, 19,240, 60, 69, - 24, 86,240,188,180,246, 9,170, 86,165,210,224,233, 60,163,163,101, 58, 58, 58, 82, 99, 95,134, 88, 52, 27, 55, 12,242, 79,127, -119, 59,183,189,252,101,220,114,235, 75,184,227,142,255, 68,137, 4,173, 28,206, 84,144, 14,148,115,248,194, 67, 57, 73, 75,177, -169,158, 2,214, 92, 42,161,132,192,154, 8,103,195,212,165,236,170,120, 74, 32, 44,196,198,225,121,153,158,104, 65,168, 84, 29, -105,204,221,183, 86, 96,157, 34,159,111,162, 90, 49,108,218,188,149,114,185,202,139, 94,116, 3, 82, 58, 90, 90,139, 41,225,204, -138,192, 36,177,197,243,130,212, 45,145,197, 35,196,137,201,228,251,144,150,230, 34, 3,167, 44,167, 79,157,102,207,158,180,166, -134,149, 73,166, 16,200,180,122, 94,104, 80,162, 76, 84,237,166,179, 99, 26, 82, 26, 60, 33,207, 5,234, 2,235, 82,127,177, 32, -171, 86,100,226, 52,109,203, 69, 16,134, 48,122,156,211,143,223,205,233,125,155,105,141, 7,200,187, 50,218,147,152,196,129, 83, - 72, 93, 0, 89, 33, 73,170,104,149, 21, 18,241,125,116, 80, 66,248, 1, 3, 67, 67,132,198,165,145, 90,217,168,124,161, 9,171, - 21,124, 95,101,135,182, 56,194, 40,100,112,112, 16,147,158,180,130, 95,106,166, 42,210,122,228, 54,137,201,249,154,177,177,126, -194,209, 1, 92,123, 12,164,229, 2,141,141,104,203, 41,110,187,254, 10, 86,205,105,101, 86,222,225,185, 52, 82,228,245, 55, 95, -192,182, 93,123,248,214,134,157,140, 70, 14, 95,195,147,251, 15,225, 5, 57,180,202,162,167,133, 98,111,247,113, 18, 89, 32,182, -105, 64,196,177, 99,199,249,228,167, 62, 77,123, 9,226,234, 24,190,159, 99, 40,214, 8, 99,144, 54, 33, 52, 9, 71, 78,158,228, - 68, 95, 90,121, 78,249, 30,210, 26, 46, 93,181,148, 23,174, 93,198,188,102, 65, 78,134, 72, 95,114,209,242,217, 44,154, 51,139, -211,251,123,176, 73, 66,136, 98,119,247,113,122,135, 43, 56, 85,194,132,101,110,188,225, 18,174, 89,179,136,233, 58,162,228,129, -246, 4, 29,211,102,243,214, 55,188,154,191,252,231,175, 96,240, 9,163, 24, 33, 61,158, 58,112,132,208,128, 83, 10,225, 44,123, -158,122,138,127,252,167,167,104, 10, 4, 81,162,112, 50, 96,212,130,139, 35,148,240,137,147,132,125,135,123, 80,185, 38,156,245, -240,114, 10,101,203, 92,117,225, 26,174,121,193, 98,166,251, 9, 77,249, 2, 66, 56,180, 39,145, 66,146,184, 52,128, 69, 9,144, - 94, 90, 6, 56, 13,223,207,170, 86,217,212,111,182,253,152,225,112,239, 32,137,110,161, 32,225,226, 53, 43, 41,105,155, 6, 87, -158,237, 32,151,115,236,108, 73, 28,163,180, 71,236, 4, 21, 9,127,246,137,239,176,245,192, 9,180,146,180,170,136,223,122,195, -173, 76,247, 33,175, 29,214, 58,156, 73, 80,214,166,233,114, 2,156, 16,180, 6,154,247,191,250,114,126,245,111,127,136,107,110, -231,192,233, 65,110,126,255,191,240,135,175,187,142,183,223,184, 22,188, 25,124,240,142,159,178,101,239, 49,114, 77, 57,242,218, -242,123,175,188, 62, 11,206,243,120,201,218,197,172, 61,111, 49,111,255,226,102,142,246, 85,232,143, 3, 62,123,239,189,180, 5, -179,248,214,129,227,252,145, 45,224, 39, 9,129, 39, 39,157,154, 55,213,166,218, 47, 0,229,107,178, 45,105, 64,152,112,134,176, - 58, 66, 33,223,204,142,237,195, 28,237,222, 15, 73, 68,115, 83,137, 66, 62, 32, 10,199, 40,248,154,133, 93,115,217,191,175,155, -166, 98,192,181, 47,188,142,190, 83,199,217,185,243, 41, 42, 46, 36,240, 28, 90,197,196,177, 70,201, 8, 41, 29, 77,205,121,172, - 11,121,224, 71,247, 50,191,235,181,236,222,245, 20, 38,137,208, 10, 22, 45,154, 73,119,247, 65, 10,249,128,171,175,190,129,222, -222, 94,118,238,220,135, 81, 18, 19, 87,113, 84,241, 84, 74, 2,181, 76,203,120,231,114,233,129,203,237,109, 69,246,237,221, 5, -238,106,170, 85, 56,112, 96, 31,215,188,112, 62,149,234, 8, 99, 99, 41,184,245,247,159,102,229, 74,143, 48, 42, 19, 4,105,104, -188,115, 41,216, 39, 73,196,204,153,211, 57,120,240, 0,107,214, 92, 72,121,116, 12, 99, 98,250,250, 78,178, 98,197, 10, 94,251, -218, 75, 25, 29, 5, 33, 19,172,173, 16,120, 62,213,106, 57, 13,183,141,202, 72, 97, 41, 21,242, 28, 62,124,136, 74, 5, 60, 31, - 54,109, 92,207,188,249,139,233, 59,217, 75, 98,170,105, 86,151, 74, 21,102, 33, 64,214, 79, 6, 21,245,115, 64,210,131,173,210, - 2, 88, 90, 75,202,229, 42,125,125,253, 28, 60,116, 47,109,109, 29, 28, 63,126,130, 75, 46,185, 4, 99, 12,109,109, 77,169, 1, -160,108,189,100,121, 90,198,215, 97, 13,120,158, 32,138, 44, 39,123,123,136,227,152, 85,231,157, 79,185,108,216,188,249,167, 12, - 12, 84, 48, 66, 32,149, 68, 40, 85, 79,207,147, 66,161, 3,143, 56,118,236, 63,112,132,181, 23,172, 34,159,203,147, 16,115,182, -132,189,212, 91, 46,210, 0, 32,132, 35, 49,105,244, 31, 34,171,139,222,191,135, 19, 15,221, 73,216,187,159, 22, 55,134,231, 98, -132, 80,148, 13, 8, 29,160,188, 2,213,112, 12, 79,136, 52, 47, 81,164,190,248, 48, 54,228, 69,170, 88,116,182, 79, 67, 38, 89, -253, 85,153,158,127, 30, 87,171, 20,242,121,202,233, 47, 20, 2, 69, 62,169, 48,163, 24,224,197, 17,184, 8,146, 52, 10,209, 56, -139,214, 10, 79, 43,180,141, 9,135,250, 9, 60, 69,146,196, 36,194, 97,133, 37,239, 37, 44,237,154, 65, 62,167,201,229, 20,129, -148, 24, 1, 5, 96,233,162,249,232, 45,123,144, 70, 17,155, 42, 39, 79, 30, 39, 14,171, 96, 18,148,116, 8, 18,202,229, 50,198, - 41,164,151,195, 90,199,169,145,144,211, 35,195, 56, 51, 66, 78, 75, 92, 28,129,246,235,210,181,175, 12,213,145,126,162, 56,162, - 92,141, 16, 34, 64,226, 88, 50,127, 14, 77,249, 28,202,135, 32, 40,164, 15, 21,200, 7, 30,202,165,114,177,242, 61, 78,158, 30, -196, 42, 31,151, 24,218,138, 57, 86, 45,158, 79, 83, 78,210,148,211, 52,229, 36,145,117,120, 2, 94,116,241, 66, 62,161, 98,170, -113,153,124, 46, 32,113,112,122,112, 4, 99, 37,210,211,184,176,194,192,224, 40,229,161, 16, 27, 85,113, 86, 18, 4,121,198,170, - 21,148,214, 20, 68,130,150,134, 83,189,167, 88,176,240, 60,226, 80,227, 21,138,120, 81,200,202,185, 11,104, 45,228, 41,229, 32, -151,243, 51, 54, 94,203,141, 77, 23,187,161,118, 58, 80, 38, 67,101, 7,187,104,161, 24,115,240, 31,223,185,143, 56,215, 76, 78, -121,184,209, 62,110,185,254, 74, 2, 91,165,232, 21, 82, 75,178, 17,252,156, 64,138,122,157, 35,210,148, 73, 31,129, 64,251,146, -136,180,216,206, 31,127,226, 78,238, 93,191, 29,167, 61, 74,241,105, 62,242,190,119,178,114,102, 27, 20,129, 36, 66, 74, 31, 63, -171, 24, 40,132,200,206, 97,151, 40,147,240,166, 43, 86,209,243,250, 83,188,239,107, 63, 69,181,119,112, 98,172,151,119,126,250, - 30,238,219,180,135, 37,139,230,242,175,223,222, 64, 16, 20,168, 14, 12,241,185,247,190,156,133,157,173,152,120, 20,229,121,152, -106,149,135, 63,244, 42,222,249,217, 31,240,237, 77, 91,153,217,217,201,198, 63,121, 19, 85, 17,242,155,159,221,192,238, 61,123, -185,120,197,146, 44, 47,216, 77, 56, 76,102,170, 77,181,231,213,175, 94,171,237,224, 68, 22, 13, 46, 16,194, 81,200,105,162,184, -194, 71,254,250,195,248,129, 66, 41,203,255,247,166, 87, 51,208,127,138, 64, 27,132, 29,227,215,223,252, 42, 62,251,153,127, 99, -227,186,135,216,186, 97, 61,113, 28,211,210,210,204,156,185, 51,176,102, 24,103,134,201,251,121, 92, 82,197,217, 81,138, 69,193, -210, 37,243, 57,116,232, 16, 31,253,171,219,201,231,243,120,194,129, 29,230,215,127,245,229,124,234, 83,159, 98,227, 99,143,179, -101,195, 86,140, 77, 40,148, 74, 44,152,183, 16, 79, 91,180, 20,105,244, 56, 96,195, 56, 53,254,133, 65, 8,205,171, 95,249, 74, -254,252, 47, 62,198, 31,188,247, 99,140,142, 84, 89,186,108, 41,183,220,122, 5,143, 60,122, 23,127,254,161,191, 39,142,108, 90, - 61, 45,174,226,121,134,176, 58,132, 34, 59,240, 83,132, 72, 25,241,203, 55, 95,199, 23,190,244, 69, 14,236,221,195, 83,123,118, - 17,104,195,154, 85, 11,248,206, 55,255,147, 15,125,232, 95,233,237, 59, 14, 34,194,211, 43,152, 59,103, 6,251,246, 31,230,163, - 31,251, 50,171,207, 91,141,246, 44,215,189,168,139, 77, 91,230,241,187,191,247, 39,180,181,183, 96, 76,196,255,185,233, 45,124, -233,223,191, 90, 79,135,211, 66,214, 75,239,214,170,116, 70, 81,130,239,231, 82,182,238,210, 66, 60, 90,167,233,127, 39,122,143, - 51,115,246, 12,142,247,164,198, 69, 53,138, 56, 61, 52,192,210,229, 11,234, 6, 0, 78, 97, 77,234,114, 20, 66,160,132, 70,121, - 41, 67, 31, 28,234,199, 57,195,140, 89, 51,177, 8,118,239, 62,204,192,192, 24, 78,248, 4,129, 79, 24, 87,178,131,108,162,250, - 33,100,158,244,168, 68, 85,202,229,144,227, 61,167,104,111,235,202,234,167,158, 37, 79,189, 86, 58, 87,146, 30,227,167,165, 73, -153,203, 72, 47,246,224, 54,142,109,184,151, 92,165,143,230,120, 24,233, 18,132,150,140,185, 28, 81,169,149,182,105,179,200, 5, - 62, 35, 7,118,131, 77,125,234,113, 28,167,150, 79, 84,198, 79,210,156,197,107, 46,191,152, 69,119,175,227,169, 83,163,196, 58, - 7, 66, 35, 61, 73, 37, 10, 65,105,164,231, 97, 43,167,153, 81,244,184,254,138,139,241,227, 50,232,136,104,224, 4, 90,216, 44, -157,192, 18,197, 9, 46, 47,209,129, 79, 24, 86, 50,210,104,113,194, 17, 35, 24,173,134, 40,237, 17,217,244, 84,175,154, 23,119, -180, 26, 18, 27,139,115, 18, 65, 66, 75, 41, 79,239,169,211, 40,178, 35, 90, 19, 67, 83,224,163,133,161,146,132,104, 21,176,120, - 97, 23,171,151,205, 71,203, 10, 62, 6,149, 88,164,239, 19,233,128, 48,172, 80,148, 6, 95, 88, 74, 90,224, 7, 26, 51,106,240, -133, 67,216,132,156, 18,120,222,248,121,238,190, 74,243,220,147, 36,193,147,130,106, 37, 34, 63,167,152,254,174,114, 84, 43, 85, - 78,143,142,224, 23, 2,164,159,246,187, 86,250,113,120, 4, 34,147, 32,132, 79, 20, 69, 56,103,104,111,107, 65,136, 94,146, 36, -161,152,203,113,209,234,165, 44,232, 40,225,147,160,132, 38,177, 14,229,231, 49, 54, 1, 83, 70,153,152,153,237,237, 24, 79,161, -165, 34,170,134, 20,148, 34,231,105,124,169,211, 34, 19, 89, 64,142,204,172, 60, 95,137,236, 72,214,148, 50, 24, 39,145, 82,225, - 92,132, 16, 62, 85, 1, 59,143, 84,185,235, 39, 27, 9,117, 30, 89, 25,226,165, 87,173,101,209,236, 86, 90, 60, 67, 92,173,224, - 21,243, 13,172, 35,205,163, 19,147,150,161, 64, 17,167,181, 93, 25, 5,190,241,240, 1,238,252,201, 70,180, 46,162,109,153,119, -188,225, 54, 86,207,105,163,217, 87, 84,178,231, 45,132, 32, 10, 35,124, 63,151, 6, 14, 73,151,158,180, 46, 64,197,101,222,251, -234,107,153, 55,163,153,223,252,151, 31, 82,206, 79,195,247, 44,223,223,118, 10,251,196, 9,154,253, 2, 29, 69,201, 71,127,251, -165,188,233,242,149, 36,137, 3,165, 83, 23, 80, 80, 32,239, 28,159,127,215,109,212,170,252,153,244,184, 35, 54,125,124,105, 90, -235,199, 89,164, 74,171, 37, 78, 81,245,169,246,220, 90, 22, 87,242, 52, 69,172,156,115,104, 37, 49, 22, 22, 46,152,199,187,223, -253,219, 32, 60,164, 74, 72, 76,200,162,133,115,104, 46, 66, 95,191, 99,233,226,233,204,154,219, 65,123,123,142,143,127,244, 29, - 28, 62, 52,202,240, 80,132,214, 30,203,151, 55,209,125,100,140,242,216, 13,116, 45,152,129, 0,222,248,186,219,184,245,229, 17, -243,230,207,228,178,139,223,204,246,237, 39, 9,188, 2,173,173, 77,244,247,158, 98,230,172,118, 58,103, 72, 62,254,209, 63,224, -232,209,144,193,193, 81,180,150, 44, 95,217,198,145,238,132,145,145, 43, 89,208, 53, 29, 45, 96, 97, 87, 59, 31,248,227,247,164, -234, 92,150,108,222,218,226,243,247,183,255, 49,219,159, 60, 78,169, 84, 98,206,252, 38,132,130,143,127,236, 47, 56,114,176,151, -233,157,211, 25, 30, 25,166,181,181,153, 32, 7,127,242,193,247,166, 32, 43,225,213,175,122, 25,165,166,118,166, 77,211, 44, 91, -242, 65, 78,159, 30,226,237,191,249,122, 14, 28, 60,196,130, 5, 1,183,127,252, 79, 57,118,252, 20,157,211,167, 49, 58,118,154, -214,230,128,105,211,138,252,195,223,127,156,158,227,167, 88,180,176,147,133, 11, 59, 65,194,239,191,247,205, 28, 62, 82,225,244, -233,211, 92,176,118, 54,198,192,107, 95,247,114, 10,249, 60, 66,192,252,249,115,121,239,251,222, 89,247, 62,215, 0,221, 24,131, - 68,165,233,110,164, 37,107,195,204, 93,188,108,233, 10,230, 47, 88, 66, 88,141,152, 59,119, 46,195,131,131, 41,160,171, 90,105, - 91,129, 84, 41,143,118,134,122, 14,222,232,232, 48,195,195,131,104,173,105,110,106,165,183,127,140, 3,135,142,165,217, 57, 66, - 83, 13, 67,132, 39, 17,194,166, 69,118,172, 72,139, 13, 57, 65, 79,207, 81,186,186,102,208,219,219,203,234, 85, 93,231, 60,161, - 83, 91,145, 50,245,196,105, 60, 98,176, 33,132, 39,169,108,248, 22, 67,123, 54, 81,168, 14,146,151, 14,165, 45,149, 56, 97,204, - 21,168,148,102,224, 47,186,130,220,252,133,216,158,167,136,213, 97, 2, 10,216,172,172, 96, 18, 69,184,129, 30, 84,229, 20,152, - 14,186, 58,155,249,237,215,191,132,191,250,204, 87, 25,116,142,145, 68, 98, 85,128, 83, 18, 76,140,239, 28, 37, 97,184,254,202, -139, 88, 50,103, 58, 45,193, 24, 12, 31, 99,248,200, 78, 74,113,136, 20,169, 21,101,117,128,213, 5,100,174, 37, 61, 85,200, 26, - 60, 1, 85,231,232,173, 38, 60,178, 99, 63,215,156,191, 0,161, 36,161,133, 68,166,204,239,225,173,187,176, 34, 32,144,130, 92, - 2,115, 59,166,177,111,223, 33,180,144, 84, 93, 90,162,101,193,140,118,252,120,132,160,224, 19, 69,163, 44,234,108,225,205, 55, - 93, 78,123, 46,100, 90, 73, 19, 86, 29, 85, 52, 91, 14, 30,103,245,121,179, 40,141,166,105, 14,195, 10, 92, 20,162, 84, 33, 53, -140, 76,132, 38, 65, 59,145,214, 34,183, 18, 95, 42, 92, 98, 80,202,195, 9, 71, 98, 45,179, 59, 90, 41,120,130,209, 48, 65, 4, - 5, 30,218,180,131, 95,190,225, 42,138,121,234,192, 23, 2,159,255,246,157,140,233, 34, 97,172, 40, 72,131, 22, 9,243,231, 76, - 71,203,125,196,153,187,100,238,244, 86,222,254,210,171,153,230, 25, 28,146, 16, 65,127,146, 6,102,116,228,161,232, 67, 20, 89, -238, 90,255, 83,148, 24, 65,233, 28, 97, 82, 65,104,133, 84, 65, 26, 12,169, 64,169,244,148,189,172,178,116, 42,227,100,234, 2, - 34,181, 82,165,147,196, 2,250,128, 63,253,228, 23,168,200, 28, 24,203,140,162,226,181, 55, 95, 75,158, 16, 79, 64,161, 88,204, - 78, 84,163,225,200,218,134,163,107,157,203,246,180, 4, 41, 53, 35,192,250,189,131,252,229, 63,127,129,114, 34,104,146, 35,188, -229,149, 55,114,235,213,107, 41,169, 42, 77,185, 22, 98, 1, 82,106,162,196,210,164,189,241,243,147, 77,106, 97, 27, 87, 5,207, - 99,221,254, 33, 62,250,189, 61,132, 65, 7,206,140, 16,133, 6,103, 37,186,169,128,169, 86,169, 84,243, 20, 11,157, 56,151,160, -204, 8,161,200,103, 85, 2, 83, 63,166, 49, 14,135,194, 9,149, 62, 83,192,216, 4, 41, 92,250, 69,178,226, 28, 14,209,169, 54, -213,126, 30, 96, 63, 35,216,164, 94,175,187, 86,161, 77, 74, 40, 53, 9, 86,191,160,115,194,218, 83, 89,168,202,244, 14,193,244, -142,185, 89,172,135,197, 34, 89,176,176, 52,193, 79, 63,111,126, 17, 95, 21,211,131,160, 28, 44, 92,216,129, 67,144,216, 20, 72, -207, 95, 51, 3,157, 93,122,238,140,142,250,119, 53,208,176,168, 43,192,118, 5,245, 74,117, 93,243, 53, 74,205, 68,101,229,106, - 11, 5, 88,181,106, 54,182,150,217,238, 82, 97,214, 89, 88,189,102,214,132,106,119, 45, 37,104, 62,111, 58, 74, 65,199,244,230, -116,140, 6, 86,175,156,159, 25, 50,176,112,193,244,250,215,107,126, 87,145,174, 5, 69, 0,206, 95,189, 0, 99, 97, 90, 7,180, -182,117,224,128,153, 51,218,145,153,202,216,209, 33,232,236,232, 68, 0,171, 86,207,206,206,155, 23,204,239,202, 51,191, 43,159, -238,173, 2, 22,118,181,212, 79, 66, 43,150, 52,171,215,116,213,207,118,240, 60, 47,221, 83, 82, 93, 30,178,125, 86, 41,197, 96, -223, 0,109,109,109,233,193,100, 21,203,216, 88,133,177, 74, 21,131,165, 82, 41,211, 84, 42,164, 85, 39, 93,237, 96, 44,133,181, - 73, 70,208, 6, 25, 28, 26,194, 90,203,252, 5, 11, 25, 30, 9,121,228,177, 13,196,214, 3, 41,136,108,140,210, 2,227, 76, 86, - 7, 67,226,156, 65, 42,205,208, 64, 63,109,237,205,228,114, 30,203,151, 47,169, 27,124,103,203,171,213,178,118,218, 23, 54,149, -188,199, 78,112,242,209,239, 98,246, 63, 70, 49,236,195,195, 98, 35, 71,132, 34,201,181, 17, 21,103,209,178,248, 18,212,130, 75, - 48,197, 34, 74, 25, 42, 79,110, 34,103, 5, 57,169,112,113, 76, 33,128,209,129, 35, 68,221, 59,240,219,103,208, 18, 20,185,229, -138,149, 36,209, 43,249,247,239,221,207,225,129, 17, 70,179,114,172, 5,207,103, 86,107,145, 27, 46,189,152,215,222,112, 9,109, - 98, 24,226,211, 36, 59, 30, 37, 31,158, 74,207,114, 7, 16, 30, 86, 7,120,205, 51, 48,186,136,149, 30, 2, 69, 18,197, 80, 40, -146, 72,197,119,126,244, 40,109,210,113,221,218, 85, 76,107,153, 70,119,223, 32, 95,188,235,126,158,234,238,197, 26,141,118, 17, -231, 47,155,199,170, 69,115,120,116,195, 22,162,196, 34,253, 0,233, 44,139,103,181,179,118,201,108, 30,217,223, 71, 33, 40,242, -196, 19, 91,249,241,156, 86,110,184,114, 41,224, 81, 45, 59,190,123,207,143,184,235,209,199,184,108,237, 26,126,245,198, 43, 88, -185,116, 49, 86, 66,193,207, 97,134, 98, 34,226,250,201, 65, 74,164,233, 16, 90, 42,162, 16,124,175, 86, 40, 7,136, 66, 22,205, -108, 99,217,156, 14, 70,186, 71, 24, 30, 29, 99,207,145,144,191,254,231, 47,115,235,245,151, 49,111,102, 59, 54,138,121,104,195, -147,252,104,253, 19, 12, 85,211, 3, 77,243,165,128,234,232, 32, 47,186,226, 98,238,125,120, 43,135,250, 43,132, 85,203,143, 31, - 94,199,197, 51,255, 47,123,239, 29, 38,201, 85,159,251,127, 78,168,170,142,147,211,134,153,205, 43,105,119,181,171, 44, 20, 73, - 2, 99, 25, 99,146, 1, 25,219,216, 36,219, 96,204, 5, 95,204,181,125,125,109,192,198,228,100,146, 1, 95, 16,112, 65, 34, 11, - 36, 64, 8, 16, 8, 33, 1, 22, 32,105,147, 86,155,195,236,238,236,204, 78,236,233, 80, 85,231,156,251,199,169,238,233, 89,173, - 34,248,254,236,231,167,122,158,121,170,167,167,167,170,171,234,156,243, 77,239,247,125, 75, 92,178,105, 45,185, 92,200,225,147, - 51,188,255, 83, 95, 98,110,118,150,231, 61,241, 60,158,116,241, 57,172, 89,221, 79,104, 27, 4,210, 81, 79, 83,194,192, 3,217, - 22,148,238,188,135, 45,156, 88,156, 50,111,169, 6,100,111, 74, 77, 13,248,226,247,118,241,139, 61, 71,145,185, 14,130,180,202, - 51, 46, 63,143,179,134,123, 40,202,148, 64,123,183, 36, 49,134, 32,200, 48,226,153, 65,111,210, 59,122,249, 62,137,192,203,186, -222,117, 96,142,191,252,199,119, 83, 73, 4,145,130,171,206, 63,139,107,174,186,132,206,160, 78, 87, 62,196,185, 6,185,176, 64, - 35,169,147, 43,245, 19,207,206,121,161, 29, 37, 61,255,181, 5,165,114,252,120,215, 81,126,231,205,159, 35,161, 64,221, 9, 86, -118,215,249,251,151,254, 38,187,246,140,243,209, 91,239, 98,218, 69,104,153,240,156,127,190,150,151, 63,101, 61, 31,121,249,179, -209,166,154, 93,170, 91,184,228, 83,138,156, 77,173, 62,178,116,255,227,246,252,241,237,215,190,185, 83,246,139, 28, 71,235,213, - 19, 22, 73, 20,219, 22,176,121,225,227, 94,178,121, 65,105, 65,147,164, 14,165, 29,161,150, 52, 26, 9, 81,228,215, 38,139,193, - 26, 67,144,209,105, 75, 41, 48,169, 7,233, 53,201,106,172,245,138,141,214, 26,100,134,187, 66,136, 76, 4,198,167,202,149,206, - 86, 8,231,144, 34,196, 24,207,225,144,117,173,162,240,226, 91, 77,188,149,179, 6,173,156,151,215,146, 26,103,133,167,188,117, - 96,140, 7,164,121,150,105, 47,198,101, 50,175, 67, 0,206, 38, 40,225,144,104,164,242,217,208, 36,129, 40,200,238,155, 77, 61, -186, 28,129,196,120,190, 79, 1, 6, 15,228,117,194, 59, 48,169,243,220,186, 65,155,146,100,156,164, 68, 97,118,223,154,220,234, - 34,171, 33, 59,207,167,113,228,200, 81, 46,188,224, 66, 70,143, 77, 50, 49, 62,141, 19, 32,133,166, 50, 55,207,212,236, 12, 14, - 15, 54,110, 52, 18, 42,149, 10, 51, 83,211,158, 58,118,118,198,183, 31, 14, 13,209,136, 45,149,185, 58, 59,118,238,161, 86, 79, - 17,210,119,131, 41, 33, 72, 76, 76,148,243,216,128, 32, 8, 16, 66,130,177,212,170,115, 44, 25,234,163,175,183,196, 64,127, 55, - 54,171,239,159, 54, 82,199,165,104, 33,193,166, 96,230,169,222,125, 43,141,125, 63, 39,168,205,163,130, 0,105, 83, 82, 45,169, -171, 18, 73,231, 74,202, 27,159,138,236, 95, 75,208, 49,136,202, 73, 8,150, 33,186,187, 97,226, 36,202,197, 32, 13,194,212,137, -210, 49, 78,236,248, 49,203,122,122, 17,171, 67,150,132,253,188,248, 73,231,112,217,134,213,236, 58,120,132,189, 71, 71, 73, 19, -203,138,193, 37,244,119,150, 89,183,118, 57, 93, 98,150, 30, 29,195,222,109, 76,236,188,157, 14, 55, 11, 50,245,131, 7, 65, 35, - 85,168, 66, 31,170, 52,136, 44,228, 72,172, 35, 44, 20,153,183,142,196, 89,166,141,229,223,110,184,141,175,126,255,151,224, 20, -243,198, 49,103, 12, 86,228, 8, 69,204,242,142,144,223,187,250, 10,186,131,196, 3, 34, 84,128, 49, 49, 5, 13, 75,242,154, 55, -190,252, 37, 76,254,203, 39,185,239,232, 36,227, 97,129, 15,223,244, 93,174,191,243,199, 68, 97, 64, 90,135,177,227, 39, 48, 50, - 96,242, 39, 63,199, 86,199,249,235,215,190, 6, 74,218,115, 38, 11, 69, 46,202, 97,149, 32,182, 54, 99, 49, 18, 45,166,162,164, - 81, 39, 16,158, 4, 54,231,234,172,234, 10,249,179, 23,252, 54,255,227, 3,215, 19,167, 48,211, 48,252,224,238,221,252,124,215, - 17,130, 32, 32, 73, 18,230,170, 13, 18, 66,164, 20, 68,133, 60,141,234, 20, 26,199,112, 95,137,231, 63,249,124, 62,126,253, 77, -204,134,157, 28,171,166,188,237,250,155, 25,248,206, 29, 32, 12, 39,103,103, 57, 58,211,160, 36, 97,230,134,111,210,221,219,197, -210,225,126, 66, 29, 33,172, 34,148,138,208, 26,164,105,224,164,193, 72, 65,139,229,222, 65,147,212,214,102, 99, 58, 37,197,185, - 20, 35, 20, 41,146, 3,147,150,127,249,212,245, 16, 21, 8,226, 26,155,135,251,120,201,111, 63,141,176, 62, 79,190,179,136, 86, - 1,177, 1, 21,168,197,152,119,103, 91, 53, 38,200,168,116, 5, 28,173,193,155, 63,250, 25, 38, 69, 14, 33,171,156,179,110, 5, -175,255,163,231,211, 97,171, 20,149, 32, 10, 2, 44, 48, 11, 88, 41,136, 77, 74, 49, 95, 32, 78, 29,181, 24, 82,237,125,132,137, -249, 6,175,252,240,215,153, 21, 61, 88, 53,197,250,222,144,155,255,250,117,172,232,211,112, 41,188,236, 41,231,240,242, 15,223, -200,109, 7,103,232,140, 10,124,226,198,125,212,147,239,240,233, 63,123,250, 35, 95,119, 31, 87,105,123,124,251, 15, 15,218,205, - 41,181,118,239, 84,186, 7,196,246,114,193,240,187,133, 37,125, 33,173,175,125, 64, 17,138,150,167, 26,134, 1,105, 86, 71, 6, -231, 13, 45,144,166, 14, 41, 21, 58, 3,135,185,140, 16, 74, 88,239,144,171, 44, 7,157,166,177,151, 61,118,169,183,125,210,147, - 94, 59, 12,214,106, 42,115,150, 35, 71,142,176,113,227,136, 7,247, 9, 31, 13,239,185,255, 8, 35, 35,203,201,135, 30, 4,236, -161,116, 98,177,255, 34,124, 61,218,171,177,137,172,230,109,144, 82,177, 99,251, 17, 86,174, 92, 78, 46,231, 51,136,198,165, 8, - 17,128, 21, 68,129,167,233,129,196, 27,105, 19,123, 22,186, 48,196,186, 20, 41, 36,210,166, 8,169, 73, 18,131, 21,150, 80,103, -107,144,213,190,108, 39,124, 59,109,243,158, 55,234, 41, 81, 46,132,172, 11,172,153, 74, 95, 49,178,134,234,188, 97,102,186,138, - 53, 10,169, 21, 74, 73,194, 48,199,142, 29,247,209,209, 81, 32, 80,138, 98,161, 76,161, 80,162,167,183,159, 40,159, 99,205,154, - 53, 40,173,185,239,190,251,233, 27, 24,228,235, 55,222, 76,169,220, 69,160, 67,223,174,108, 13,198, 56,194, 48,194, 89,135,150, - 94, 91, 69, 33,185,127,207, 46, 70,134,151,160, 20,156,117,230, 58, 15, 77,147, 18,151, 93,211, 3,140,186, 16, 25,220,199,247, - 17,112, 96,231,189,116, 39, 13,242, 90, 96,141,164, 66, 68,146,235,194,245,174,166,103,221, 19,112,131, 27, 81,189,203, 8,100, -128,151, 10,235, 97,201,186,115,152,153, 60, 68, 18, 59, 52, 18, 27, 55,232,200, 7,196,179,135, 57,252,243,155, 25, 81, 2, 6, -207,164, 51,234,101,203,210, 34,171, 58,150,146,156, 59,236,131,181, 70,131,142, 32, 64,184,113,100, 58, 3, 7,182,114,228,206, -111,211,101,231,209, 73, 21, 43, 52,137, 83,168, 92,145,196, 21, 25, 88,178,146, 36, 43, 60, 23,180,163, 24,207, 18, 21,202, 68, - 81,192,240,210,181, 28,217,119,136, 90,181, 78, 61, 53,136, 32, 36, 18, 16, 73,203,250, 21, 3,188,224, 25,151,114,241, 89, 35, - 40,173, 40,153,121,122,100, 13,164, 36,170,159,164,232, 42,140,172,236,229,141,175,184,134,143,125,225,235,236, 25, 29,103,170, -214, 96,236,100, 29,107, 45, 90,132,168, 64,211, 91, 10,185,104,195, 70,254,232, 57, 79,241,244,180, 49,228,109,157,193, 40, 66, -186, 20,109,235, 20, 11, 17, 54, 73,145,249, 0,147,164,228,148,166, 63,111,233,209, 13,226, 56,166, 59, 72, 97,126,138, 43,207, - 91,197,223,252,233,239,243,217, 27,111, 97,215,254, 3, 52,172, 99,110,190,142,115, 53,164,132,174, 98,137, 13,235,215,179,115, -231,118, 42,181, 9,202, 65, 66,135, 54,148, 92,202, 43,158,123, 37,229, 40,228,115,223,253, 9, 71,166,230,169, 86,171,236,173, - 76,163, 67,129,147,130,238, 82,158,161,206, 2,207,123,194, 21,108,222,112,134, 39,103, 17,150, 46,215,160,150, 54,232,204,167, - 68,162,129,114,198, 91, 86,233, 1,112,194,137,140, 71, 50, 3,191,100, 50,176, 82,120, 93,247, 41,224, 45, 31,248, 56,115,214, - 27,254, 14,149,240,138,223,253, 45, 58,180,165,175, 88,244, 34,181, 82,161,164,247,226, 91, 78,175,104,234,198,219,108, 17,240, - 17,250,156,128,215,255,227,199,217, 53, 58,195,108, 42, 88, 51, 60,194,171, 95,243, 74, 76, 0, 50, 23,146,132, 48,110, 32, 23, -248,154,187, 12, 11, 24, 11,243,113,234,241, 13, 26,106, 2,242, 18,222,115,221,119,217,113, 34, 69, 7,134,161,156,228,243,175, -187,134, 21,189,138,122,165, 65, 20, 54, 88,179,188,204,173,111,189,134,107, 62,112, 35,215,255,108,156,124, 23, 92,119,235, 47, -120,225,185,195,252,214, 69,222,251, 91,114, 0, 0, 32, 0, 73, 68, 65, 84,103, 44, 94, 93, 30, 24,178, 63,192,184, 63,110,216, - 31,223,126,253,155,225,244,253,235,238,180,188,229,167,111,194, 88, 48,251,237, 98,102,105,150,118,151,178, 37, 77,149, 69,215, - 18,165,165,143,210,179,233,111,172,244, 37, 41,165, 60, 77,109,243,168, 34,244, 56,166, 76, 8,204,100,103,215, 40,164, 16,236, - 63,120,140,247,188,251,131,252,239,127,123, 7, 14,208, 89, 38,248,159,254,233,221,188,225, 13,111,224,156,205, 75,113, 86, 98, -156,244,211, 43,227, 53, 51,105, 86,106, 16,180,176, 55, 14,213,210,172,122,203,155,223,203,255,252,187,191,225,236,141,189, 94, - 24,170, 13,212,102,129, 52, 21,132, 58, 4,155,128, 12, 9,132,204,250,194, 67,223,169, 99, 51,221,141, 64, 97,109, 83, 38, 54, -123, 95,251, 53, 78, 8,157,161,224, 5, 81,206,103, 8,164,178, 72,165, 50, 41, 84, 47,211, 60, 57, 51, 77,146,120,192,184,203, -152, 81,247,238,221,207,178,101,131,156,123,238,133, 94,103,164,237,113,186,140,214, 54, 78, 29, 75,150,141, 48, 53, 53, 67,103, - 71, 15,251, 15, 31,165,187,119,128, 48, 87, 32,169,123,158,143, 64,105,230,231,231, 17,194, 49, 95,173, 48, 59, 59,203,224, 64, - 31,165, 98,158, 21,195, 3,244,247,148,252,243, 51, 38,115,168, 78, 19,169, 59, 20,245, 70, 66, 46, 84, 32,115,116, 47, 89, 77, -188,127,154,200, 84, 65,134, 84,163, 1,212,178,141,148,215, 95,130,233, 25, 33,215, 49,128, 83, 33, 58, 12, 60, 93,172,236,166, -180,230, 92,234,123,126, 73, 50, 94, 71,216, 4,165, 19,156,105, 80, 86, 49,241,196,118,198,127, 56, 78,215,138, 11, 8,206,184, - 16,122,150,210, 81,238,241,143, 34,137,161,216,128,120, 14,142,237,165,177,103, 59,211,251,183, 83,106, 76, 34,109,156, 33,176, - 37, 82, 68,204,212, 28,165,149,203,161,171, 7, 89, 46,162, 37, 60,243,178, 45,172, 95,218, 75, 37, 73, 65, 40,250,250,151, 48, - 54, 54,193,174,189,251,152,153,155,167, 94,175,211,219,221,201,198,117,107, 24,236,233, 96,197, 80, 55, 93, 57,133, 16,240,151, - 47,186,138,231, 95,185,153,216, 57, 10,161,160,156,171,146,211,130,167,156,187,140,117, 75,255,128,157,247,239,103,239,161,163, - 28,157,152,204, 34, 86,193,202,229, 75, 88, 53,212,207,153, 43,150,211, 95, 8, 41,135, 1,132,240,206,191,122, 5, 19,149, 6, - 38,174,177,118,168,132, 78,103, 9,243, 69,143,174,199,208, 33, 53,127,250,220,167,240,219, 79,186,152, 70,146,210,223, 89,166, -183, 88, 32,116,240,252,203,151,179,101,228,185,108,223,123,152,237,123, 14, 48, 83, 79, 72,147, 6,253,229, 2,155,206, 88,195, -170,225,229,140,141,157, 73, 45,110,160, 92,202,234,193, 78, 58,100, 76, 57,212,252,254, 51,158,192, 69,155,215,115,224,232, 9, -118,239, 63,192,201,217,105, 82,155,208,217, 81,102,120,112,144, 53, 75,251, 57, 99,176,135,238,188,166,224,224,137,103,159,193, - 7,255,234,229, 84,226, 58, 53, 51,199,218, 85, 67,228,100,138, 70,251, 72,192, 57, 63, 0,197,194,138, 97,147, 4, 29, 4, 24, -107,136, 37, 92,247,237,123,184,115,215, 40, 85,151, 35,176, 85,158,251, 27, 79,224,252,181, 75, 40,170, 24,137, 32,140,162, 86, -105,112, 81, 18,219, 45, 32,122,155, 91, 3,248,219, 15,125,147, 59,246,141, 51,111, 3,148, 86, 88,149,231,109, 31,189,158,162, - 73, 80, 54, 69, 69, 57,143, 76,117, 16,203,136,122,154, 7, 41, 73,195, 60, 31,255,194,151,249,206, 55,225, 37,207,124, 10, 79, - 58,103, 29, 31,254,238, 61,148,242, 67, 84,106, 39,249,243,103, 95,196,185,203,122,168, 55,234,144, 11, 73, 26, 13, 18, 18,114, - 90,240,153, 63,255,109,246,191,241,163,220,117, 60,197, 6,101,174,189,109,231, 98,163,222, 44, 17,180,107, 90,158,198,128, 63, - 30,181, 63,190,253,250, 55,197, 98,185,163,118, 73, 40,211, 38,182, 37, 50,222,248, 76, 80,234, 20,152, 71, 83, 5,209,100,170, - 46,214,196, 72,149,227,228,201, 58,179,115, 85,134, 71,122,152,152,152, 69, 43, 71,119,119, 39,135, 15, 78, 83, 44,150,153,171, - 76,177,122,117, 31,147,179, 41,198, 38,244,244,228, 57,122,108, 10,151,228,153,155,155, 99,211,230,126,102, 43,134,147, 39, 79, - 50, 60, 60,196,201,201,154,255,159,145,165, 72, 9, 58,136,104,196,176,243,190, 41, 14, 29,218, 71,148, 15,185,242,201,103, 35, -116, 9, 43,188, 67,254,131, 91,119, 80,173,215,232,237,237,230,252,139, 87,179,115,231, 97, 58,242, 93,236,216,126, 31,113,154, -240,244,223,184,148, 92, 4, 59,118,236,231,240,161,227, 52, 98, 65, 84,232,197,184, 34, 51,115,240,131, 91,239, 64,170,136, 51, - 55,108, 98,229,170,136,109, 91,143,177,102,205, 18,118,236, 58,204, 96, 79,158, 37, 67,125, 76, 77,195,109, 63,186,155,196,198, -172, 93,183,146,179, 55, 12,176,117,231, 24, 43, 87, 13,178,111,223, 9, 6,251, 58,153,158, 26,103,223,190,125, 32, 5,195,203, -150,179,122,245, 42,114,145, 68, 42,235,115,149, 30, 84,132,177,153,134, 5,150, 19, 39,142, 99, 81, 56, 39,125, 38, 91, 42,246, -238, 61, 64, 16,230, 25, 89,177, 14, 41, 37,149,121,139, 49,134,169,169, 41, 76, 98, 73,140,161, 90,169, 80,173,215, 61,176, 87, -104,250,250, 7, 57, 54, 62,201,236,236, 44,221, 97, 30, 37, 36,214, 56, 70, 15, 29,166, 90,171, 80, 46,151,232, 40, 23,233, 88, - 54, 4, 46,161, 84,136, 56,103,203, 58,223,126, 14, 40,241,224,212, 87, 90, 2, 81, 20,120, 87,201, 5, 44,217,114, 37, 7,171, - 85,230,167,246, 35,164,166,188,230, 60,138, 43,207, 37,238, 94,141, 43,118, 35,180, 34, 12, 20, 38, 73, 81, 90,130,204, 65,199, -114,250, 54, 92,194,193, 31, 77, 80, 74,167, 40, 75, 71,146,250,134,126, 77,157,180,106,153,216,113, 59,246,208,110, 92,199, 0, -229,161, 21,232, 98, 25, 29, 72,226,153, 19, 84, 78, 28,164,113,226, 8,185,250, 28,121, 27, 19,186, 6,129, 22,164, 86,147,138, -144,154,139, 72, 59,151,177,108,227, 37,204, 21,123,200, 21, 75, 24,155, 50,220, 91,102, 73,231, 58,234,245,122,198,200, 31,194, -112, 55, 87,108, 89,141, 19, 10,155,198,104, 44,210, 89,114,161,166, 24,133, 96,189,130,208,198, 21,125,172, 95,214, 67, 45,142, - 17, 2, 10,145, 65, 42, 75, 1, 56,107,176,196, 72,233, 76,204,121,155,168, 26,131,193,115,169, 11, 99,232, 10, 3, 92,163, 65, - 62,146,132,202, 79,185,139, 55,172,194, 24,136,227, 58, 74, 37,228, 2,141, 80, 25,148, 82, 9,108, 90,231,156, 53,203,217,176, - 74,146, 26, 95,167, 42, 4,142, 98, 0,113, 18,115,230,146, 34,171,135, 54,114,213,197,155,152,174,167,228, 67, 77,144, 54, 80, -214,215,191,206, 28, 88,129, 68,208,168, 85, 41,228, 3,180, 86, 8,235,232,201, 11,206, 91,217,195,198,165, 93, 36, 23,156,201, - 92,173, 14, 82,160, 36,104,107, 40, 42, 40, 69, 94,156, 39,138, 96,249, 80,137,161,222, 18,213, 36, 37,150, 9, 82, 9,242, 74, -162, 90,218,195,222,162,183, 43, 26, 5, 65,144,169,185, 41, 14, 76,194, 7, 63,251, 21,230, 9,201,107,197, 72, 87, 7,191,243, -164, 39,208, 21, 26,114,205, 99, 52,193, 27,214,139, 48,156,154, 29,108,213,166,157, 39,175,184,229,182, 31, 97, 40,147,115, 14, -105, 83,142, 31,222,207,152, 53, 72, 43,136,130,136,106,173,225,181,147,165,102,174, 22, 19,150,123,112,214,208, 48,150,125,135, -143, 49,105,102,184,250,146,243,136, 13,212,194, 62,100, 26,147,203, 5, 92,117,206, 6,176, 16,161,113,105,131,185, 48, 36,103, - 27,216,121, 73, 80,208,252,229, 51, 46,227,154, 15,221,132, 46,245,113,199,253, 71, 57,189,206, 93,155,145,111,215,180,124, 60, -106,127,124,251,127,106,228,219, 95,219,214, 88,109,206,171,135,194,207,251,232,215,131,173, 44,112,247, 61,219,248,226, 23,190, -206, 7, 63,242,102,190,240,197,155,192,166,188,234,207,254,128,183,189,243,131,188,240,133,215,240,133, 47,124,142,247,125,224, -239,248,228,167,191, 76, 16, 40, 94,245,234,231,243,230,127,122, 23, 47,250,221,151,112,237,181,215,242,166, 55,255, 45,247,222, -251, 75,110,249,246,119,120,255,251,223,196,255,249,220, 13, 20, 75, 33,171, 95,250, 92, 26, 73,150,244,211, 1, 55,125,243,219, -140,140, 44,231, 27,215,125, 17, 35, 95, 78,108, 37,137,213,188,237,157, 95,102,110,102,150,179,183,108,230,134,111,124,137, 74, -227,185,124,242,127,127,140,114,177,196,213, 87, 63,147, 27,191,117, 11, 19, 83, 85, 46, 60,111, 35,239,123,255,135,184,236,138, - 43,145,178, 72,108, 97,106,182,193,251, 94,251, 94, 46,188,232,124,148,174,243,217,235,222,194,123,223,247,143,188,253, 29,239, -163, 84, 42,176,114,197, 82,174,188,226,124,250,250,251,120,239,123, 63,137, 37,224,172, 77,107,120,251, 59,223,207,107, 95,243, - 90,222,241,142,119,210,221,219,205,240,240, 50,214,174, 90,201, 55,111,252, 26, 79,121,234, 19,113,206,241,197,235,110,224, 13, -111,248,239,108,218, 56,132,117,170,197, 2, 39,132,207, 82, 54,245, 41,102, 42,115,148,138,157,158,143,223, 38,204,207,207, 51, - 49, 49,193,166, 77,155, 8,131, 60,247,237, 60,204,248,196, 24, 38,117, 56,233,213,106, 44,190, 94, 46,148,194,153,132,114, 87, -142,124,161,192,200,200, 8, 91,183,237,160, 82,169,130, 9,112, 66, 80, 42, 20, 88,178,100, 5, 82, 90,207, 30,168, 13,197,124, -158,243,207,219,136, 18, 94,184,198, 90,159, 37,113,182,169, 24,121,106,250, 61, 77, 64, 43,172,144, 72,157,135,145, 77, 12,133, - 29,164, 83,199,176,214,146,239, 89, 70, 18,148, 9, 75, 93,200, 32,204, 90,222, 44, 4,154,134,133, 80, 42, 68,216, 9,171,158, - 64,120,228, 56,201,222,219,136,147, 10,132,129,111,205,114, 33,194, 73,116, 58,139,156,107,160,171, 99, 36,199,182,210,208,154, - 36,109, 16, 98,209, 46, 69, 99, 9,149, 64,217,212,171, 12, 53,234,200, 48, 71, 77, 40,230,130, 14, 58,215, 92, 68, 37,191, 12, - 93, 26,196,164, 30, 24, 97, 76,130, 12, 3,180, 46, 16, 74,159,136,105, 56, 75, 49,175, 72, 83,135, 82, 33, 73,163, 74, 49,151, -195,164, 9, 74, 24,148, 86, 30,220,144,213,147,186, 66,223, 75,238, 1,131, 54, 99, 35,130,238, 92, 64, 98, 82,114,121, 77,146, - 36, 20,195, 28, 46,246,194, 55, 97, 49,204, 2, 89,131, 16, 10,173, 4,129, 53, 20,242, 57, 82,153, 35, 21, 14, 33, 36,169,115, - 8,147, 18,232,128, 8, 73,232,124,118, 40, 12, 20,198,212, 49,105,157, 48,136,136,109, 74, 73,120, 35, 88,138, 52,214, 66,152, -211, 8, 39,112, 50, 68, 75,207,109,222, 81,240, 53,158,196,164,144,225, 99, 34,101, 8, 67,135, 22,146, 14, 34,116, 36, 72,140, -195, 74,145,241, 15,164,168, 0,210, 76, 30, 77, 9,232, 12, 53, 78,104, 82,231, 80,120,109,102,140,201,248,216,155, 70,221,100, - 96, 54, 47, 65, 91,145,240,119,255,114, 45, 83, 54, 79,106, 12,229,116,134, 87,253,238, 31, 50,220, 29, 17,138,132, 48, 95,242, -234, 69,194,122,206, 3,235,239, 13, 45, 50,135,133, 90,125,179, 92, 24, 72, 8,171,147,116,229, 28,169, 5,147, 36,148, 35,131, -177,134, 80, 22,137,107, 53,122,149,196, 38, 53,156,128, 40,151,163, 98,231, 16,104,148,179, 40,231, 40,235, 8,109,125,154, 47, - 47, 28,177,153,167, 28,194,242,174, 46,112,117, 42, 88,242,198, 59, 80,214, 58,136,242, 56, 83,103,120, 89, 9,235, 28,121, 37, -152,170, 38,190,134,184,200,104,159, 6,173,212, 52,238, 82, 62,110,216, 31,223,254,131, 82,239, 15,102,208,155,101,246,224,148, - 44,251, 2,108, 78,192, 3, 36, 82, 69, 22,249,215,227, 6, 58,212,108,220,184,133, 79, 76,127,158,241, 19,176,237,222,125,204, -215,234, 60,231,121, 80,173,165,172, 90,187,134,169,217, 42, 19, 83,176,107,247,113, 42,243,243, 60,235, 56, 84, 19,201, 25,103, -175,167,163,187,131,125, 7,142,114,232,208, 73, 38,167, 45, 63,255,229, 20, 99,199,235, 60,237,105, 23,144,113,120, 97,157,195, - 73,195,107,254,242, 26,180,134,233,106,133, 59,127,122, 23, 78,105,142,140, 29,231,238,123,118,240,202, 87,190,146,254,161, 94, - 70, 79, 76,112,251, 29, 91, 73,109,129,151,189,242, 37,156,123,238, 10,156,200,113,207,214, 29,220,118,251,221, 60,225,178, 39, -241,146,151, 62,147,196,193,205,223,187,147,201,169, 89,116, 88,230,146,203,174, 68, 4,150,173,187,238,225, 71, 63,254, 5, 74, -107, 94,246,210, 63,224,194, 11, 86,147, 26, 56, 54, 54,205,206,251,182,241,254,127,121, 55,189,131, 80,169, 77,240,195,219,127, - 70,177,216,203, 31,189,228, 26, 46,190,120, 37,239,123,239, 23,185,234,233,207,228, 15, 94,114, 21,194,194, 15,191,255, 83, 76, -186,192,207,145,182,128,104, 50,171,169,123, 97,175,190,222, 65,238,187,111, 15,133, 98, 7, 93,157, 61,220,183,107, 7,221, 61, -157,244,246,246, 18, 69, 69, 14, 30, 62, 70,189, 1,185, 92,129, 70, 18, 19, 6, 17, 88, 60, 81, 27, 14, 41, 4, 83,147, 51, 56, -103, 40, 20,114, 60,249, 73, 87,178,103,239,126,226,154, 5, 41,136, 66,141,181, 13, 58, 59, 11, 12, 13, 12, 49,180,100,128, 82, - 33, 79,190, 16,100, 57, 25,135, 49,158,132, 76,200, 7, 3,202, 41,225,217,188,130, 8,135, 36, 73, 33, 24, 92,139,234, 28,194, - 25,223,167,155, 47,118,128, 82, 89,187,132,239, 77, 72, 51, 89,214,196, 58, 66, 25, 64,121, 41, 75,158,248, 44,198, 42,199,152, - 25,139,201, 41,131, 72,235,104, 11,194, 38,148,116,136, 51,117,100, 82,161, 20, 40,170,149, 42, 93, 81, 4,169,245,242,123, 74, -144,164, 46, 99, 51, 19,200,168, 76, 5,205,124,208, 73,126,228,108, 10, 43,183, 96, 58,150, 17,149,122, 16, 82, 98, 82, 79,174, - 34, 1, 43,188,200, 8,120,194, 22,208, 4, 10,140,179,228,114, 33,150,132, 64,123,228,166, 77, 29, 34,123, 45,113, 45, 51, 99, - 44,104, 41,177,169, 71, 65, 59,225,133, 70,132,116,228,163, 0, 97, 13, 66,129,144, 2,147, 24,100,224, 21,148,156, 19,104, 33, - 17, 90,225, 82,139,210,178,213, 38, 18, 74,129,208, 81,203,136,105,177,224,108, 43,173,176,153,188,173,202,234, 72, 90, 58, 79, - 45,168,200,190,153,106,233,171,183,168,210, 17, 72, 21, 82,207,230,111,132, 68, 43, 65, 18, 67, 46,151,225, 35,148, 96,231,129, - 19, 28, 62,114,144,167, 95,121, 33,102,161,209, 4,229, 32,204,234,221, 66,138, 86, 5, 79, 9,133,108,119,249,133,197,101,231, -175, 2,159,190,121, 43,119,108,223, 77,172, 58, 41, 6,112,245,133,231,241,196, 77,107, 41, 5, 13,114,161, 70, 8,215,146, 35, -117,206,249,251,224,188,151,218, 4,145,202,246, 84, 60,160, 12,252,240,134,127,229,100,205,223,255, 36, 1,161,140,215,179, 55, - 1, 65, 0, 50,109,214,228, 97, 78, 56,158,253,103,111, 6,175,187,198, 27,255,226,213, 60,113,221, 0, 75,138, 16,106,159, 24, - 49, 78, 97,157,102,102,110,150,129,178, 33,213, 5,112, 1, 36, 22,171, 34, 66, 55, 15, 82,112,178,154,128, 14, 73, 49, 20,114, - 94, 79,210,181,229, 49,189,131,114,170,129,111,201,202, 61, 32,106,127, 80,185,233,135, 72, 0, 60, 44, 10,250,209,252,207,227, -219,127,233,205, 57, 3,214,250, 12,223,163,249, 63, 92,171,237,242,116,162, 48,206,128,208, 16,134, 17, 73, 10, 3, 3, 1,203, -151, 47,231,123,223,253, 17,103,159,189, 5,235, 20,223,252,214, 15,232,236, 44,179,100, 9, 12, 12, 45,231,187,183,252, 59,103, -110, 56, 3,107,224,150,155,239,164, 92,234, 97, 96, 0,206,185, 96, 51,199,142,158, 96,235,182,251,121,209,139, 94,204,189,247, -110,229,240,161, 81,206, 88,191,214,183,187,138, 44,138,108,155, 58, 75,151, 46,103,108,124,150, 52, 77, 25, 30, 30, 70,106,205, - 79,126,114, 7,169,243, 32,175,181,171,207, 96,247,253, 59,136,162,128,212,128,203,186, 98,102,231,170,156,189,114, 93,182, 54, -129, 84,174, 85,199,190,241,198,111,146, 82, 99,201,146, 37,116,118,118,210,104, 36,228,179,158,115,165, 97, 98,114,138, 48,159, -163,191,223,175, 27,253,253,131,140,143,143, 82,109,212, 40,149, 10,158,193, 50, 53,116,117,247, 97,155,126,148, 80, 72,169,125, -125, 63, 35,154,241, 83,221,162, 84,144,245,158, 43,150, 47, 93, 74,154,194,158,221,251, 57,121,242, 36,179,179,179,108,222,188, -153,174,174, 30,118,237,218, 77, 28, 39, 4, 65,142, 56, 49, 8, 20,113, 98,112, 78, 16,133,121,146,180,129,144, 94, 60,109,116, -244, 24,165, 82,129,139, 46,216, 0, 54,230,224,129, 81,138,197, 34,131,131,253, 44, 91, 62, 68,103, 71,212,234, 42,176, 38,205, - 88, 5, 13,169,177, 4, 65, 0, 46,115, 54,180, 58,141, 81, 71,163,131, 5, 4, 93,168, 3,191, 40,231,203,126,241,109,162,235, -196, 2, 11, 24,194,107,130,183,234,137,105, 10, 58,130,242, 18, 6, 47,125, 54, 71,239,237,102,230,208, 54, 74,114,154,200, 86, -209, 2,156, 73, 17, 72,172,210, 52,156, 37, 8, 52,214, 38, 56, 33,209, 82,225, 76, 76, 96, 45, 90,133,196, 42, 98, 78, 20,168, -230,251, 41,172,216, 66, 52,188, 9,215,185, 20, 93,238,193, 74,233, 13,113,214, 67, 40,132,205,210,199,222, 90,170,118, 35,146, -181, 96,180, 95,182,212,162,173,114, 37, 91,131,207, 75,226, 57,148, 22, 45,199,197, 89,131, 50, 6,147,214,176,105, 29,165, 52, -168, 18, 82, 10,132,240, 76,104, 45, 10, 18, 1, 34,240,141, 36, 97,219,252,114, 25, 73,120,147,123,184, 53,239, 92,144, 93,131, -255,158, 13, 4, 78,122,109, 95,153,181, 66, 27, 22,128, 32,243,206,147,216, 68,169,111, 59,137,181,175, 73, 91, 39, 8, 5, 84, - 67,127,252,162,128,122, 10,247, 31, 57,201,137,177, 57,234, 49,232, 64,146, 10, 79,134, 90, 84,254,255,154,196, 60, 77, 99,159, -147, 16, 58,188, 97, 23, 22,156,192, 72, 73, 29,216,115,210,240,137,235,111,160, 65, 72,136, 99,176,160,121,217,243,126,139,188, -169,146, 11,242, 24,151,146,207,174, 5, 39,176, 78, 96, 81,164,194, 31,191, 9,230,177, 9,228,148, 63,151,115,142,156, 18, 56, -147,101, 93,128, 88,164,132, 42,197, 88, 71,162, 3,159,177, 8, 44,210, 26,148,210, 28,143, 65, 59,139, 69, 16,185,148,156,153, -163, 67, 20,233, 82, 26,109, 53,196,117, 82, 89, 96,114,102,138,219,239,217,195,186,165,155, 41,204, 85,145,185,144,212, 25,116, -172,104,212,170,228, 58,186,185,241,135,247,122,145,151,184,206,240,178,238,133,250,121,102, 81,157, 93, 0,205, 45, 68,240,238, - 65,163,118,155,189,167,132,120,160, 54,118, 59,240,201, 45,200,209,186, 22,112,176,125,192,156,138,126,178,167, 7, 65,181,127, -149, 71, 97, 4,254, 99,252, 3,251,171,194,189,255,127,108,204,125,134, 71, 8, 69, 98, 82, 2, 21,180,250,155, 31,201, 45, 91, - 80, 99,151,139, 7,131,243,104,117,161, 61, 33,152,175,255,250, 63,157,181, 97, 13, 55,125,243,171,188,236,101,127,138, 73,225, -203, 95,253, 18, 23, 93,120, 14,214,192,150, 13,155,185,229, 91,223,226,197,127,240,108,130, 32,226,115,159,253, 26,151, 95,126, - 25,194,194,170,225,101, 92,251,201, 47,115,197,229, 79,230, 9, 23,159,201,255,252,187, 47,210, 63, 80, 98,112, 8,246, 31,152, -163, 84, 42,225,140,231,141,208, 2,210, 24,182,221,187,141,161,190,126,118, 58,199,244,216,113, 4, 49, 87,255,230, 85,108,218, - 92, 6, 11, 63,251,201, 56,218, 53, 72,147,196,211,205, 58,131, 51, 49, 75,150, 13,179,109,219, 14,158,246, 27,155, 73, 13, 8, -147,210, 85, 14,177,166,193,159,255,249,115,201,229, 33, 78, 96,239,158, 10, 90,251,238,152,195,199,102, 49,198, 48, 48, 56,140, - 67,177,117, 91,149, 13,155, 10,108,223,182,135,161,161, 65,180,174,121,213, 70, 11,197, 82, 23, 91,183,238,230,153,207, 60,135, -185, 89,191,222, 90,146,214, 44,105,114,180,203,140,109,206, 19,111,249, 64,111,104,160,135, 72, 43,102, 42,243,116,119,246,144, -212, 45, 19, 19,147, 36, 73,210, 42,121,212,227, 6, 81,152,207,218,246, 20, 73, 90,203, 2, 26,197,212,201,105,170,213, 42, 61, -157, 93,236,221,179,159,179,214,143,112,198,218, 97,242,121,207, 3,208,124, 78,205,239,160,148,206,108,148,246,205, 13,217, 35, - 63,157, 65,207,128,114,100,198,241,148,233, 46, 52, 78, 60,184,102,116, 51,213,211,130,251, 11,188, 57, 27,222,196,210,142,110, -170,219,251, 57,186,245,199,164,110,154, 40,173,161,201,162, 80, 44,214, 37, 72,235,144, 74, 98,156, 32,182, 62, 77, 79, 16, 81, - 21, 33, 21, 27, 34,123, 87,210,181,114, 19,225,224,153,232,254, 85,136,142, 62,156, 14,179,126,200,172, 47, 25,151, 93,100,123, -136, 41,179,133,114, 97,191, 48,252,109,107, 17,106,103,227,241, 93,224, 77, 19,109,152,218,117, 23,201,252, 73,116, 62,207,220, -216, 36, 99,251,142,144, 36, 49, 97,104, 41,246,244,145,203,231, 41,245, 14,128, 84,148,251,150,144, 24, 8,117,130, 46,150, 72, -146, 6,129,206, 35, 58,186,145, 50, 68, 16, 32, 50,148,162,203,144,223,173,123,157, 17, 76, 36,113,138, 13, 53,239,249,208, 39, -216,124,246,217, 92,113,229,197,220,250,163,237,252,252,238, 95,242,186,215,252, 62,223,187,237, 30,110,250,254,143,201,135, 1, -207,123,250,147, 56,255,252,117,188,230,175,223,195,178,229, 75,153, 63,186,151,151,191,252,149,252,240, 23, 59,249,247,187,126, -193,250,161, 78, 94,251,218, 63,230,134, 91,110,101,197,138, 21, 36, 1,196, 41, 92,251,229,155,217,122,223,110,250,187,202,188, -242,101, 47, 33, 95,130,191,253,219,247,208, 55,208,207,212,201, 9, 46,189,232, 66,126,235,105,151,211, 27,250,104, 94, 72, 77, - 29,152,198,235,203,143,207,167,168,176,136, 52,134, 23,189,240, 69,158, 74,178,144,167, 17, 64,164, 2,106, 52, 65,244,130, 36, -115,163,106,192, 7,175,253, 22, 95,252,234, 55, 40, 23,202,252,197,159,188,148,223,188,228, 12,116, 0, 90, 9,156,181,228,165, - 32,240,122, 70, 16, 9,148,243,169,132,154, 48, 32, 20,161,241,206, 87, 26,215,233,205,231,188, 80, 66,160,160,158, 80,144,130, -178,178,132,196, 8, 52, 27,250, 4, 91,199,231,152, 87,142,119,124,237, 46, 46,189,104, 3,103,116,229,113,113,140, 14, 37,164, -134,160,220,197, 77,119, 31,227,243,119,238, 36, 23,116, 82,155,159,231,201,103,109,196, 53,163,239,133,105, 77,147, 49,195,225, - 11,108, 62,221,229, 30,152,146,111,143,216, 31, 48,151,236, 35, 10,198, 31, 89, 84,214,102,148,197,195, 27,111,119,202,254, 63, -118,107,103, 71,123,164,251,255, 66,198,215, 90,140, 53,109,125,218,191, 30,141, 62, 33, 4, 71,127,114, 19,247,124,231,107,236, -221,181,143, 3,115,130, 87,190,229,221,172,223,178, 5,147,166, 40,173, 31,195, 65,155, 15,220,208,104,196, 68, 81,216, 66,140, -107, 13,203,150, 13, 16, 5,112,193,121,235, 9, 67,248,204,181, 99,172, 89, 61, 68,164, 97,233, 96, 23,152, 42,151, 95,186, 25, - 1,124,246,147, 21, 70,150,245, 35, 12,156,179,233, 44,254,173, 94, 97,243,198,181,244,247,193,210, 37,157,172, 88, 49,140, 20, -240,133,235, 62,207,166, 77,155, 88, 49,178, 18,225, 26,188,238,181,255, 72, 16,229,153,159,157,231,143,255,232, 26,110,255,209, -247,233,233,202,243,194,223,125, 38,239,126,247, 91,216,176, 97, 3, 7, 15, 30,228,220,179,207, 33,109,204,146, 15,252,138,156, - 36,179,228, 66,195, 21, 87, 92,192,187,222,245,125,222,254,207, 31, 98,124,124,156, 80, 27,122,187,115,172, 93,187,148, 55,190, -225,173, 12,175, 92,194,182,109,219,120,225, 11, 94, 12, 46, 69,200,148,123,238,189,155,109,219,182,241,250,255,246, 42, 46,189, -236, 66,254,245, 99, 31,162,175,175,143,227,199, 71,185,230,154,103,241,253, 91,191, 70,154, 86,145, 2, 46,189,228, 66, 62,254, -177, 79,242,166,127,184,150,202,252, 52,214,198,190, 3,192,248,104, 95,102, 81,186,104,245, 17,250,239, 23, 4,130,174,174, 18, -249,124,142,254, 36,101,112, 32, 97,215,174, 61, 76,207,206,248,250,187,212, 24, 99, 40,228, 75, 24,227,163,116,207, 28,234,199, -251,244,244, 36,113, 28, 51, 50,178, 28,107, 99,150, 12,246, 83, 44,120, 5,201,166,141,110,174, 33,242, 49, 82, 81, 11,103,172, -243,145,153,100,209, 30,197,105,223, 95,180, 95, 88,157,172, 3,103, 99,148,114,224, 26, 48,115, 28, 51, 49,202,177,157,191,192, - 77, 29,193, 77, 31, 39, 76,102,137, 68,130,114, 73, 43, 66, 49, 72, 92, 80,160, 70, 64, 93, 22,144, 93,203,201, 13,174,166, 48, -180,138,124,239, 8,182,208, 73, 80,236, 70, 4, 57,172, 19, 11,229,204,230,226,233,126, 13,158,178,180, 56,103, 72, 39,118,115, -224,238,123, 57,188,125,148,195,251,183,115,252,196, 62,226,216, 18, 91,205,196,137, 10, 51,149,163,108, 58,115, 13,133, 40, 79, -169,152,103,211,121, 23,210,179,100, 41, 97,185, 19, 41, 21,197,101,235, 16,206,128,169,226,226, 4,169, 53, 42, 80,232,176, 68, - 80,238, 65,151,123, 16,153,132,159,179, 11,198,221,101, 17,237,245, 55,125,143,207,126,253, 59,188,239, 35,111,231, 85,175,122, - 19,207,121,206,179,233, 27, 26,228, 45,111,125, 43,127,241,234,215, 49, 49, 62,206, 87,191,242, 5,222,255, 47,239,226, 15, 95, -246, 58,126,243, 41,151,241,130,167, 92,192,124,173,202,107,222,244, 65,254,233,173,111, 35,156, 27,229,188,243,206,226, 61,159, -186,129, 67, 71, 70,121,207,223,189,138,175,127,245, 38,110,190,229,118, 94,246,170,255,198, 15,238,248, 25,199, 78, 28,227,237, -111,121, 37,207,188,250,247,120,241,115,158,205,146,165,203,121,207, 71, 62,197, 7,223,251, 14, 46, 95,219,133,136,107, 56, 21, -210,208,138,143,126,231, 62,222,245,169,235,169, 19, 97, 13,172, 92, 54,196, 43,174,121, 30,133,116,142,142,188,246,134, 55,210, -184,164, 65, 20,104, 18,227,159,107,119,103, 7,183,222,249, 11,254,245,139,223,162,225, 2,130, 92, 68, 80, 29,231, 95,255,246, - 21, 92,185,105, 21,161, 77, 61,223, 60, 25,173, 34, 42,107,165,243, 2, 45,169, 51, 40,169,124,135, 74, 38, 5, 59,129, 98,243, -239,255, 3, 83, 38,162,203, 84,121,235,107, 95,202,211, 54, 13, 49, 16, 89,172, 8,249,183,239,254,146, 55,124,225,167,228, 69, -131,233, 90,200, 72,215, 73,222,249,188, 45, 92, 52, 48, 76,106, 44,177, 19, 92,127,223,126, 62,120,211, 61,156, 12,123, 40, 40, -133,170,215,216,250,222, 63, 97,121, 87,174,125,165, 93,192, 2,180, 94,251,253, 66, 29, 75,156,242,121,179, 16, 55,181,208, 43, - 15,101,208,229,131,219,230, 83,253,134,182,163,201,211, 70,221,246,215, 96,181,228, 35,152,239,167,236,127, 93,219,163, 61,239, -162,117,234,145,186, 67,143,161,194,157,122, 12, 78,115,107, 84,230, 64, 42,162, 66, 33, 51,244, 46,147, 41,126,184,124,136,227, -129,144, 81,191,205, 28,216,202,207,191,244,113, 78,142, 79,112,248,240,113,246, 29,154, 96,223,100,133,115, 47,190,146,127,250, -228,167,192, 42,144,230,193,247,173, 33,160, 30,232,209,101,248, 39,135, 35, 77, 28, 58,240,165,192,217,138,225,208,129, 81,206, -218, 48,130, 49,176, 99,199,110, 86,175, 89, 73,177, 20, 80,173,192,254,253, 7,216,120,246, 74,156,133,237,219, 14,178, 98,197, - 10,202,157,254,152, 59,119, 28, 98,213,170, 17,114, 57, 56,112,240, 40,165, 82,129,238,238, 46, 14, 31, 62, 74, 46,151,163,163, -163,139,189,123,247, 82, 46,117, 82,107,212, 89, 58,180,148,114,167,102,231, 78,127,156, 98, 9, 78,140,205, 51, 53, 53, 69, 62, -202, 49, 60,220,199,253,247, 31, 98,100,229, 32, 97, 24,114,242,228, 28,105,234, 88,186,180,147,169,169, 6,199,142, 30, 98,205, -154,117,236,190,255, 0,171, 86,174,164, 84,130,253, 7, 38,168,214, 43, 12, 14, 14,210,223,155,231,158,123,246,114,198,153, 43, -153,157,155,162, 82,169,178,122,213, 8, 56,216,183,215, 71,196,107,214, 44, 37,202,195,246,237,247,177,126,253,122,162,200,183, -187, 77, 77,194,225,209, 19,132, 97,200,219,255,249, 77,188,249, 45,127,199,202,149, 61, 30,231,155, 36, 25,113,150,108,249,238, - 45,199, 90, 44,252,158, 24,152,153,169,242,245,111,220, 68,127,223, 16, 97,174,132, 16,126, 93,180,214,162,117,136, 16,130,185, -185, 25,106,245, 57, 26,181, 26, 67, 75, 6, 8,164, 96,227,198,117, 12, 13,116, 32,197,226, 96,224, 87,197,231,104, 95, 59,245, -218,172,167,238, 91, 19,238, 65,247,210, 71,217,178,169, 12,163,179, 5,198, 35,226, 85,113,128,229, 93, 75,176,211,199, 72,198, -246, 82, 31, 63, 76,125,102,130,184, 58,231,107,186, 89, 67,191, 46,118, 16,116,244,211,221,179,148,176,103, 57,170, 60,132, 45, -116,226,242, 29,168, 48,135,208, 89,178,223, 37,224, 52, 34, 67,104,187, 95,201,176,103,241,139, 48, 56, 59,199,225,219,191,199, -214,219,127,198,145,195, 71,136, 41,113,248,224, 81,190,253,179,159,177,188,183,204,108,195, 80,140,138, 28, 57, 57,195,222,137, - 95,130,128, 40, 84, 12,255,251, 47, 89,214, 61,192,170,145, 1, 46,184,252, 50, 6,109,130,138, 58, 9,202, 37,208, 17,181,153, - 25,130, 92, 9,228, 12,114,242, 56, 74, 57, 10, 61,195, 4, 93, 3,200, 66, 9,156,194, 88,135,117, 14,161, 36, 87, 95,253, 84, - 62,112,253,183,184,238,134,159, 50, 57, 53,197, 83,159,178,133,207,223,112, 39, 97,185,135,111,222,242,125, 36,150,233,169, 89, -246,238, 61, 78,108, 36, 23, 94,124, 25,195,195, 3,132, 57,197,115,159,255, 34,222,241,222,247,115,205,213,151,115,246, 5,103, -209,209,211,133, 56, 54,138,149,112,207,182,157, 60,233,233,191,201,218, 77,131,156,180, 87,112,195, 63,189,153,217,216,147, 51, -108,217,180,145,117,103,109,228,109, 31,187,142,227, 51, 85,166,230, 75,244,231,115, 24, 37,216, 61,110,248,216,245, 55, 48,235, -114,158,135,152,148,163, 99, 39,248,199,119,127, 0,237, 18,164,112, 72,169, 61, 33, 5, 9, 38,110, 16,230, 11, 8,107, 56,107, -245,106, 68, 80,162,174,202,152,176, 72, 37,105,208, 29, 21,249,249,221,247,112,241,186,165, 68,185, 96,129, 76, 67, 41,140,179, - 45, 58, 69,207, 51,231, 89,172,132, 18, 24,227,103,149, 9,192,146, 34,101,136,179, 18, 39, 21, 86,248,150, 29,233, 28, 47,127, -242,102,190,255,139,173,220,188,117,130,245,233, 28,203, 70, 39,248,240,219,238,229, 67,185, 60,182,216,201,177,217,132, 70,234, - 40,133, 33, 81, 56,207, 9, 19,240,249,255,241, 59, 44, 43, 43, 95, 30,146,237, 41,204,182, 60, 88, 51,205,238,156,247, 57,132, - 88,168,185,180,162,245, 5, 28,114,115, 92,186,135,136, 70, 31, 50, 86, 61, 77, 90,221,158,178,151, 15, 72,223,255, 26, 12,235, -163,221,255,186, 13,251, 99,217,255, 7, 24,244,102,253, 84, 58,203,142,239,125,155, 79,188,255,189,220,179,251, 0,179,243,243, -232, 32,160,167,163,135, 63,121,237,235,121,214, 31,253,225, 67, 24,246,135, 46,122,184,140,126,121,235, 55, 63,205,252,124,149, -202,204, 44,179, 51, 21,170,105,130, 22,142,155,191,243, 77,110, 91,183,142,239,222,179,131,168, 16, 60,182,104,189,229,152, 72, -130, 64,146,166, 49, 66,134, 20,114,138, 51, 55,120,114,152, 48,128,205,103,175, 67, 74, 15, 14, 43,151, 36,155, 54,174,244,181, -120, 96,211,198, 21, 52,147, 18, 73,106, 56, 99,253, 8, 58,107,150, 90,179,106, 41,169, 73, 81, 10, 86,173, 26,242, 28,110,169, -101,203,230,117, 94,150, 57,177, 4, 89, 11,204,186,181,195, 30,185,157, 66,111, 79,145,222,222, 34, 90,251,114,223,198, 13, 35, -152, 44, 91, 58, 52,216, 65,106,124,125,190,163, 67,211,219,181, 14, 33, 96,203,217, 43, 91,190,245,218, 53,125,164,105, 79, 70, - 84, 3, 91, 54,173, 65, 72, 75,190,191,155,222,206, 18, 18, 72, 19, 88,187,166, 11,108, 87,198,250, 6,103,111, 60, 51,171,251, -195,125,219,119,115,237,103,174,163,175,111, 41,123, 15,236,231,201, 79,185,146,145, 21, 61, 45,246,234, 32, 80,217, 60, 94,240, -219,155, 21,183,246,228,156,214,208,219, 91,224,137, 87, 94,202, 15,111,187, 3,103, 53, 66,133, 72, 17,226, 50,105,212, 70,163, -134,181, 41,165, 98,142,225,145, 37, 24, 27,179,118,221, 42,122,123, 59,188, 3, 97,109,139,137, 84,182,129,223, 30,171,113,215, - 77, 76,188,115, 30, 28,214, 84,234,106,178,253,156, 46,141,215,190,151,138, 86, 74, 92, 88,155,233,118,104,140, 10,145,170,128, -232, 47, 34, 59, 7,137,250, 86, 16,197,243,116, 26,139,179,146, 70, 42,136, 83, 67, 20,249,116,133, 83,138, 32, 95,130, 32,143, - 17, 26, 21,134,132,185, 66,118, 97, 89,108, 35,154,175, 29, 2,135,117,226, 33, 47,218,209,222,111, 44, 22, 5, 86,126,221,174, - 51,246,211,239,112,228,190,237,252,228,142,109,236, 63,112, 24, 25, 20,160, 49,206,214, 67, 7,152, 75, 28, 7,167,230, 9,148, -102, 98,238, 36,115,113, 66, 53,145, 40, 41,136, 26,142, 74,109,138,237, 7,199,233,188,127, 23, 63,219,190,157,203, 46, 60,135, -243, 47,127, 26,206,106,250,134,135, 41, 12, 12, 51,127,120, 7,209,208, 90, 26,243, 21,148,210,196, 99,163, 48, 49, 69, 84, 40, - 80,238,235, 67,119, 14,102, 41,158,132,128,128,231, 62,235,217,124,234, 51,159,227, 79,158,247, 27, 68, 85,232, 43, 6, 20,148, -226,165, 47,249,125,250,203, 17, 98,230, 57,244, 13,245,145,147, 49, 56, 67, 20,248,104,246, 25, 79,191,146,203,175,186,146,191, -124,213, 75, 25, 26, 25, 38,194, 17, 37, 49,182, 6,253,189, 3,108,223,187,151,167,234, 43,185,127,223,253, 12, 13,101,188,202, -169,195,164, 41,249, 76,119, 37,113,224,148,102,222, 56, 18, 5,239,248,208, 39,152,172, 11,172,202,145,164, 6,173, 3,230,235, - 13,148,138, 80, 58,231,249,208,157, 0,167, 40,228, 59, 80,121,152,174, 86, 81,206, 32,162, 50,229,206, 94,164, 60,206,108,101, -134, 92, 33,130, 70,131,161,254, 1,164,148,164,109,137, 37,159,210, 84,160, 84,235, 93,145, 21,149, 60,216,206, 97,179, 73,150, -216, 6, 66,105,172, 51,196,198,144, 98, 73, 92, 66, 65, 57,172,181,124,226,185,103,240,229,198,189,108,191,235, 46,198,167,231, -153, 20, 69,106, 21,137,155, 56, 68, 63,154, 90, 80,166, 98, 75, 92, 48,216,203,239, 93,117, 30, 23,150, 2, 26,243, 21,194, 92, -222, 47,100, 50,107, 69, 20, 2, 97, 29, 78, 72,255, 94, 43, 61,239, 22,210,217,226, 20, 11, 44,218,250,134, 31, 38,126,150, 15, -102,119,218, 14,103, 31,178,250,108, 31,182, 46,253,112,243,247, 87, 55,196,191, 82, 32,220,246, 37,254,115,165,226,149, 18,252, -228,115, 31,225,255,124,244, 95,217, 61, 54,197, 68,181, 65,221,120,102,177,234,124, 76, 37, 22,124,246, 83,159, 65,135, 37,174, -254,189,223,125,140,105,119, 69,117,116, 39,149,185, 10, 73,163,206,220,124, 21, 36,204, 84, 27,140, 87,235, 56, 33,152,155,159, -230,210,179,214,242,181, 91,126,192,240,250,181, 62,123, 42, 89,188,127,152, 91,168,180,162, 17,199,104,173,178,172,131, 39, 45, -105,164, 9, 74, 42,226, 36,245,130, 49, 70,160,181, 34, 78,234,132, 65,208, 58,182, 37,245, 77,116,169,239,139, 9, 2,133, 49, - 94,247, 34, 77,211, 12,131,100, 48, 25, 57,139,210,138, 56,110, 16,134, 17, 42, 51,232,141,122,236, 1,203,102, 1,162,101, 76, - 10, 86, 96,164,194, 89,135,146, 11, 80, 63, 73,138,196,115,206, 91,147, 32,101,208, 26,102, 38,141,209, 90, 18,100, 64, 54, 37, - 0,109,179,108,177, 33, 12, 61,129, 76, 16, 40,146, 52, 33,208, 1,113,156, 16,133,129, 47,255,102,231,218,178,121, 29, 47,251, -227,223,195, 56, 77,169,220,201,200,112,151,159,246,206, 35,121,125, 11,155,151,121, 22, 25, 75,142, 79,137,183,219, 22,155, 49, -239, 5, 12,143, 44,229,210,203, 46,226,216,209, 9,234, 13, 16, 66,123,245, 58, 33,176, 46,165, 80,200,225, 76, 29,129, 97,221, -250,149, 12, 47, 27,192,186,133, 32,224,161,240, 22,143,218,168,187, 54, 75, 39,192,215,209,219,232,251, 30,110,223, 92,235, 84, - 22,205,136, 12, 28,230, 50,160, 87,146,106,114, 97, 55, 34, 44,129, 73, 49,137, 33, 69,226,136, 50,104,155, 65, 9,135,115, 14, - 35, 32, 80,154, 32,171, 35,165,214,120,207,197,217,236,194,229, 66,218, 61,235, 31, 60,157, 35,220, 2,159,100, 75,152,179, 41, - 66, 5,173,218,185,115, 80, 63,177,139, 31,252,219,251, 65, 68,220,242,189,219,169, 91,159, 46,169,205,204, 50,122, 98,154, 35, -211,147,204, 37,198, 43,136,137,148,212,224,117,222,141, 1, 37,168,167,150, 0, 47, 38, 83, 53,150,216, 77,113,240,155,183,177, - 99,235,110, 46, 56,111, 3,235,227,243, 40, 78, 77,208, 61,178,142,100,242, 40,165, 21, 27,153,159, 56, 14,141,121,114,229,152, - 52,134,233,137, 41, 24,221, 71,231,242,245,232,206, 78, 66,224, 5,207,184,162, 69, 25,242, 0, 0, 32, 0, 73, 68, 65, 84,140, - 31,124,251, 27, 60,251,105,151, 83, 14, 44,207,191,234, 2,166,143, 29,229, 77,127,249, 26,148,141,121,197, 11,158,201,111, 63, -235,217,116,136, 26, 37, 81, 37,194, 49, 54, 62,198,255,250,235,127, 96,106,190,193, 69, 91, 54,177,105,237, 42,142,237,222, 69, -209, 86, 41,105,120,229, 31,191,152,255,249,246,247,241,162,223,121, 57,171, 86,173,226,175, 94,245, 50, 74, 22,194,180, 70, 65, - 43, 84, 2,170, 62, 75,135, 76, 81,206, 18,132,146,123,183, 31,100,251, 47,127, 65,164,251, 8, 34,131,178, 49, 46, 73, 73,173, - 33, 12,242,212, 26, 53,242, 90,163,133,246, 84,190,243,179, 8,160,164, 36, 1, 14, 29, 87,120,217, 11,174,225,208,225,125, 28, - 58, 62,139,116, 53,158,116,225, 70,158,120,241, 5,216, 56,129, 92,174, 77,109,221,225,172,197, 89,147, 77, 28,209,194, 56,184, -140,163,217, 37, 41, 86, 42,250,117,194,116,125,138, 78, 36, 37, 81, 69, 89, 67, 50, 63,207,220,232, 61, 76,111,187,139,241,251, -119,176,116,244, 0, 34,172,115,172, 96,152,139,167, 73,165, 66,228, 11,232,158, 14,130, 66,158,129,206, 28,231,108, 26,161,220, - 25,114,226,248, 81,226,249, 25,250,151,143,144,239,234,197, 89, 3, 82, 33,164,196, 9, 79,243,235,108,102,236, 93,102,106,133, -122,224,132,115,130,172, 87,178, 53, 6,165, 16, 15,106,122,197, 67, 4,146,238, 65, 28,128, 71, 51,189, 31,233,252,253,181, 26, -247,255,194,155, 53, 41, 82,105,142,221,251, 99,174,125,211, 27,217,126,112,140, 74,156, 82, 75, 13,213, 52, 37, 16,138,154,117, - 4,129,102, 62,110, 48, 57, 51,205,157, 63,248, 33, 79,125,238,179,136,114,209, 99, 58,231,253,183,223, 64,210,136, 73,147,148, - 80,107,142, 79, 87,136, 83,131,113,142,186, 49,164, 14, 26,115, 51, 60,235,170, 39,114,221, 87,111,226,140,243,207,121,120,215, -238,148, 20,144,179,130, 40,244, 40, 90, 99, 61, 19,156,181, 41,174, 86, 99,207,142,109, 28, 62, 58,202,192,208, 82,182, 92,124, - 9,198, 38, 94,210,218,166,104,169, 48,158,211,205,175,155, 89,182, 52,142,235, 25,176, 79,120, 94,118,147,144, 90,227, 69, 80, -124,162,159, 48,212, 88,107, 50, 17, 20, 77,148,145, 63, 5, 81,228,235,230, 38, 37, 80,130,212, 90,164, 85, 56, 41,176,169,245, -234,158,162, 73, 93,235, 48,214,160, 84, 86,162,203, 96,234, 90, 11,140, 77,189, 64,147,214, 56,103,125,144,102,241, 56, 41, 33, - 51,235,149, 16, 4, 2,103, 83,162,200,131,120,147, 36,241,116,183, 8,132,131, 13, 27,214,144,216, 54,121,139,204, 49, 80,205, -121,207, 98, 98,169,102,224,235,178,117,192, 57,239, 32, 88,151, 18,105,205,170, 21, 35,104, 25, 48,122,116,140,184,145,146, 47, - 21, 16,153,221,178, 54,166,220, 89,100, 96,176,135,165, 75,250, 61, 40, 91,184,140,115,127,113,116,222,142,183,120, 76,211,209, - 61,152,155,240,136, 23, 15,187,144, 2, 76,155,189, 74, 65, 54, 81, 50, 20,167, 72,253, 93,111,181, 2,169, 22,138,254,129,253, -193, 11, 78, 65,147,194,176,105,140,253, 77,207,232, 70,155,186, 32,242,244, 6,221,185, 24,236, 52,105,165,206,196,206, 29,148, -250,122,153, 58, 49, 67, 87, 95,137, 92,127, 47, 95,253,199,247, 50,122,248,110,254,125,207, 49,186,187,151, 49, 57, 57,206,241, -233, 89,226, 84,112,124,190, 70,146,196,196, 38, 69, 10,129,209,130,185,212,210, 48,134, 46, 4,171, 13,212,181,224,144,117,212, -180, 68, 57,199, 18,173,232, 8, 21,185, 80,242,228, 77,203,184,236,178, 43,232, 29, 92,141, 80, 17, 29,157, 57, 74,131,203,232, - 58,243,124,102, 14,238,167, 49, 59, 69,169,183, 27, 21, 4,136, 32,194, 38, 13,194, 92, 25, 93, 42,162,251, 87,146, 90,144,214, -144, 38, 9,168,188,247,151,141, 23, 86,136, 27, 53,162, 66,158,106, 61, 37, 10,181,239, 17,215, 1,117,163,168,213,125,250, 90, - 7, 77,239, 47,245,131,206, 58, 80, 57,172,131,122,173, 78, 46, 23, 17, 40,129, 73, 98, 47,176,224,188,198,187,179,150,146, 74, -177, 38, 65, 68, 69, 42, 41,204, 37, 48,223, 0,215,168, 18, 4, 26, 25,104,170,117, 79, 99, 43, 21,196,141,148, 82,161,136, 73, - 18, 47,176,227, 44,145, 14,176, 73,140, 14, 35,156,150,220,189,117, 27, 82, 74,206, 61,107, 61, 37, 19,147,211,146,176,148, 35, -201,198,141, 20, 77,108,143,203, 28, 69,227,129,107,206, 33,172,197,212, 26,132, 66, 48, 89,111, 48,109, 4, 34,140, 8, 82, 67, - 78, 41,228,137,253,196, 7,183, 51,119,112, 23,199,238,219,193,225,125, 7, 57,118,232, 8,199,143,143, 81, 67,210,221,219,195, -192,178,165,132,133, 18, 8,232,232,237,163, 60, 52, 76,170, 67,114,165, 34, 61, 75,135, 41,117,117, 51,184,108,132,190,101,203, -219,106,231,190,198,223,140,220, 69, 83, 21,174, 57, 78,165, 90, 92,111,119,109,181,120,209, 54, 41, 79, 13,139,155,204,122,238, - 52,166,190,169,161,157, 45,211,139, 58, 12,221,105, 82,213,255, 41,162, 92,251,255,241,249,127,213,235, 55,173, 53,227,251, 31, -250, 95,252,228,150,239,179,247,248, 52, 99,149, 42,181, 70, 74, 61, 53,212, 18, 67, 61, 49,212,141,241, 45,190,249, 2, 67,221, -125, 92,118,225,165,188,228, 53,175,102,253,185,155, 30, 37,142,199, 27,168,159,125,226,111, 24, 27, 61, 70,117,190,194,232,161, - 19,220,189,247, 40,227,149, 58,227,149,152, 70,234, 29,138,212,250,121,145,143,138,124,237,198,155, 79,107,216,125,248,164, 78, -147,166,241,231,137, 27,117,194,200, 27,221,209,159,221,198, 63,255,237,223,179, 99,255, 33, 78, 84,106, 8,161, 8,163, 60,207, -120,242,211,121,235, 39, 63,138, 51,214,183,145, 73,209,202, 57, 91, 99,145, 90,249, 84,190,244, 70, 54, 77, 19,207, 42,218,182, -181, 4, 88, 76,230,156, 75, 47, 55, 13,160,179,118,177, 52,105, 32,149, 66, 74, 65,154, 26,180, 14, 73, 51,177,151,214,113, 76, - 29,157,245,197, 57,235,127, 60,210,219, 98,210, 56,203, 56,168, 83,108,135, 60,133,225,209, 98,156, 69,101,244,214,214, 56,164, -242, 86, 36, 35,217, 91, 92,222,178, 32,164,111, 15, 52,214,103, 49,104,203, 29,156,206,238, 53,253,217,212, 26,148,244,130, 49, -141,134, 33,204,169,172, 92,225,159, 67, 16,156,210, 5,155,117, 24,121, 2, 25,219,114,146,108,246,218,163,237, 31,251,184,214, -191, 74, 81, 62,107,133,199, 58,183, 0,183,119, 94, 85,166, 89, 43,245, 98,178, 46, 99, 87, 91,168, 81, 58,231, 9,253,197,169, - 94,138,115, 8,169, 51, 28,122,179, 23,124,225, 59, 42,225,251,159, 61,249,138,163,157, 83,201, 97,188, 68,168, 57, 1,137,161, -114,116,148,227, 59,247,208,191,122,152,185, 19, 19,216, 56, 70, 21,123,184,243, 51,159,164, 90,171,112,243, 47,142,210,213, 89, - 98,124, 98,150,123, 15,141, 98,165, 0, 17,144,198, 9, 71, 76, 76,167,133, 1, 41, 57, 39,118,244, 38, 41, 27,115, 17,203,243, - 17, 93,197, 60,249,188,239, 93,188,119,108,134, 35,206,113, 93,163,193,129, 56,197,132, 10,187,109,148,131, 99,223, 98,245,242, - 37, 60,225,130,243, 25, 90,125, 25,113, 67,115,244,142, 91,232, 89,119, 54, 46,137,153, 60,184,143, 66, 87, 47, 97,169,140, 48, -117,140,148,152,217,132,120,246, 30,116,152, 35, 77,235, 4, 65,158,168,171, 15, 17, 22,112,129, 34, 49, 13, 10,229, 34, 73,146, -208,155,151, 72,105, 51,242,127,139, 50,142, 66,212, 28, 24, 22, 35, 28, 40,137,148,254,199,153, 4,225, 32,137, 32,208, 41, 73, -146, 16, 70, 33, 14,175, 37, 46,108,138,148, 22,129, 65,230, 35,226, 56,166, 67,106,242,210,226, 66,139, 11,241,200, 81,165,176, - 37,139,200,178, 40, 46,116, 88, 59,231,219,249,164, 6, 39, 73,109,141,168, 28,145,186, 4, 33, 4, 79, 63,103, 45, 10, 65,220, -168, 82,202,229,145,129,198,248,218, 79, 91,160,231, 90,160, 93, 45,188,250, 90,243,125,130, 16, 16, 12, 22,243, 12,182,121,179, -233,212, 24, 83, 51,199,152, 58,122,136, 99, 71, 39, 24,155,174, 51, 54, 93,225,248,124,157, 25,227,249,230,143, 77, 76,144,226, - 24, 90,225, 53, 3, 38,143,141,147,159,171, 81, 30, 90, 70,206, 58,130,210, 44,197,114, 25,155,212,177,141, 6, 50, 12,179, 18, - 84,150,126, 7,132, 18,184, 52, 1,165, 23,250,215,155,133,181, 22,211, 28,167, 45,245, 60, 16, 43,101, 31,162,178,190, 72,127, -171,205,243,126, 48, 96,219,127,154, 56,247,215,128,126,255,127,143,158,247,235,138, 98,126,252, 32, 63,250,240,223,179,107,247, - 1,166,231,107, 84,234, 13,234,141,148,134,177,204,199, 94,121,209,137,108, 25, 23, 62,170,143, 77,138, 53, 41, 7,119,239,121, -212, 70, 29,231, 72,230,103,169,213,170,224, 44,105, 35,230,240,248, 52,197, 40, 96,255,100, 5, 99, 45,169,131,122,106,209, 2, -140,128,233,249, 57,158,245,204,167,113,211,183,190,199,218,115, 54,159, 98,208, 31, 36,123,226, 20,105, 90, 39,140, 66,102,246, -111,231,218,191,121, 61, 63,220,113,128,189, 19,115, 24,103,136,141, 35, 80, 18,165, 21,247,110,187,135,209, 61,135, 88,186,114, - 4,165, 20,206, 38, 52,117,190,164, 14, 49, 73, 3, 21,232,214,218,174,181, 23,157,146, 82,182, 12,184,231,221, 0,165, 84,171, -189, 75,103,249,118, 99, 82, 92,234,208,161,198, 26,143, 39,208, 82, 98,140, 65, 43,207,241,238, 0, 41,189,178,101,115,206, 8, -217, 86,206,178, 22,165,245,226,150, 63, 33, 50,103, 34,108, 25,116, 95, 22,144,109, 54,202,207,209,230,212,108,170,181, 25,107, - 90,198,219,217, 20, 37,101, 22,125,171,236, 59, 59,212, 41,188, 1,174,173,245,181,105,136,181, 12,252,181, 75, 65, 46,183,192, - 43,175,181,119,181,146,140,104,203,101,122, 26, 62,158,149,109,237,140,139, 13,185,115,238, 87, 2,203,233,118, 90,208, 71, 56, - 30, 23,166,178, 0, 75,208, 18,237,104, 49, 26,181, 3,142,132,106,113,217,185,108, 50,218,182,116,135, 58,101, 32,182, 95,135, - 18, 89, 49,199,145, 57, 7,190,110, 41,156,108,153, 0,143, 3,104,234,125, 59,132,157,198, 85,235,204,143, 29,165,114,114, 26, -231, 96,239, 93,247, 16, 72,193,217, 47,120, 46,223,125,247,219, 57,114,248, 24, 95,185,245,199, 12, 14, 12,114,124, 98,146, 61, -227, 39,188, 76,168, 81, 76, 41,131,142, 19,222,145, 11,120, 98,127, 39,198, 88,238, 60,124,146,243, 71, 6, 80, 57,205,201,185, - 26,227,141,152,208, 58,162, 80,177, 97,100,128, 13,104,174, 74, 18,210, 52,229,231, 19,211,124,122,124,158, 31, 39,134,241,122, -157, 37,157,154,176,220,137,169,165,140,108, 60,131,198, 92, 66,109,110,146,174,213, 91,152,222,253,115, 76,117, 22,171,243, 48, -126,130,206, 85, 27, 9,162,136,160,187,151,201,251,238, 37,236,233,103,122,207, 78,146,233,113, 10,157,157,132, 93, 3,132, 81, -142,252,224, 50,159, 66, 18, 26,100, 4, 78, 33,148,203,200,101, 84,118, 95,253,189,177,217,163, 8, 50,132,191,140,124,170, 48, - 23,250,201,104,101,230,113, 26,127, 60, 43, 66, 18, 64,134, 25,179,180,147, 72, 37,113, 50,192,146,195,137,212,183,174, 57,217, - 18, 63,240, 24, 49,225, 17,236, 72,239,140, 73, 65, 36,179, 76,140,179, 40,227, 25,247, 80,190,127, 86,102, 19,210,207,133,228, -148,241,213, 54, 64,154, 96, 44,231,201,112, 90,147,202, 89, 38, 15, 31,225,248,209, 49,198,231, 98,142, 79,206,114,116,186,194, - 84,173,193,108, 61, 97,214,194, 64,127, 15,229, 92,132, 85,154,147,213,132,142,238, 60, 81,169,147,185,106, 29, 55, 55, 75, 84, - 42, 97,226, 70, 86,103,243,145,128,141,235, 8, 29, 34, 72,113, 82, 45,212,160,149,202,202, 64, 77, 28,199,226,137,231,154,153, - 6,225, 22, 9,194,120, 39, 75,183,141,107,153,165,238, 44, 66,234,133,116,184,245, 52, 67, 66, 8,140, 77, 72,173,196, 9,137, - 68, 33, 51,109,234,150, 67,156, 53,167,120,181,173, 95,213,176, 45,224, 76, 30,233,188, 95,252, 89,249,168,246, 11,174,155, 56, - 77, 6,191,237, 51,174,173, 36,216,158, 9,105,223, 63,130,239,253, 96,215,209,124,118, 19,219,127,196,157,215,125,156, 67, 7, - 71,153,154,174, 48, 62, 83,165,158, 26,230,211,132, 90,195,248, 58,174,241,207, 84,226,141,140,148,146,114,161, 64,210, 72,232, - 27, 26,202,164,171, 31,172,118,126,186,228,130,166,178,255, 46,226, 90,221,163,209,103, 42, 20, 2, 69,189,145,146,164, 6, 39, - 28,181, 56,201,180, 24, 4,198,120,231,114,170, 50,207,243,158,245, 91,252,124,239, 1,100, 54, 32, 4, 15,125,110,165, 3,126, -248,161,191,231,134, 47,223,192,253,199,103,152,168, 53,176, 88, 20,130, 80,249,206, 18,141, 99,174, 94,229,214,175,220,200,139, -223,240,231,222, 8, 74,111, 23,100,160, 61,120, 76,103, 37,167,182, 86,190, 32,227, 7,177,153,155,213, 52,230, 50, 80,200, 76, -161,177, 9,126,181,206,183,231, 57,219, 4,145,250,110,145,102,107,160,143, 98,205, 41, 70, 96,129,158,213,225,141,166,115, 18, -169,116,107,174,120,162, 43,237,255,158,201,210, 74,157,137, 83, 53,107,225, 77,184, 11,139,179,187, 94, 47, 61, 75,235, 43,111, -237, 69,179,148, 38,188, 28,108,134,200,166, 73,212, 34, 88,140,156,147, 66,103, 92, 35,114,145, 99, 46, 69, 6,128,206, 72,197, -112,210, 43,131,182, 57,249,194,137, 22,200, 69,176, 48,166, 91,199,114, 15, 63, 9,221, 41, 31, 18, 66,160,147, 95,161,126,230, - 19,188, 11,175,101,155,145,182,217,119,180,139, 62, 47, 31, 80,207, 51, 44,238, 32, 95,188, 92, 72,175, 39, 43, 78,249,140,112, - 45,184,146,197, 27,116, 21,159, 64,146,224, 26, 53,226,217, 89,106, 83,211,204, 29, 31,101,110,102,150,217,227, 39,185,236, 53, -175,226,167,159,252, 44, 59,126,241, 83,254,125,207, 73,100,208,197,190,209,227, 28,157,157,165, 30, 39,204,104, 69,174, 90,231, -229, 22, 94, 56,210, 75, 56,216,205,177, 35, 19, 36,206,177,121,245, 0, 59, 39, 43,156, 24, 51, 76,165, 9,145,116, 32, 21,121, - 4,149,212, 34,156, 99, 73, 62, 79, 42, 44, 70, 74,222, 52, 56,200,241, 74,149, 91,199,170,124,253,151,187,185,164,234,216,180, -118, 45,163,187, 66,198,142,140,209, 63,188,142,227, 91,127,137,107,156,192,137,165, 20,187,138,136,194, 18,102, 71,143, 80, 92, - 50,140,153, 56, 73,207, 89,231, 51,189,103, 7, 93,107,215,115,248,230,123,113, 82, 32, 10,157,212,227, 58,211, 71, 15,210,185, -114, 45,133,222, 65,156,246, 2, 42,173,197,142,197, 64,171,230, 61, 83,104, 16, 58,115,196,188,241, 23,109,218,204, 34, 3,176, - 52, 25,236, 84, 83,125, 73, 45, 28, 83, 10,129, 21, 1, 26,151,233, 53,235,197,207,109, 1,160,209,122,254, 74, 74,164,149, 77, - 41, 36,140,108, 91,226, 93, 54, 9,157, 56,165, 1, 91,208,174,231,230, 23,133,133,188, 12,206, 98, 27, 13,166,166,103, 24, 29, -159,226,196,228, 12, 19,149, 42, 39,171, 13, 78,214, 13,166, 88,166,187,163,140,210, 1,249,222, 62, 58, 7,135,168,202,144,169, -241, 49,250, 59, 67, 86,173, 91, 65, 71,119, 23,249, 82, 39,131,195,203, 25, 90,189,150,168, 80,160, 22,199, 30,172,103,235, 16, - 68,254, 91, 56, 95,250,145, 89, 77, 93,120,145,105,191,160, 72, 50,165, 38,219,154,136, 18,185,216,240, 72,221,138,165,154, 32, -121,175, 23, 45, 23, 77, 41,145,229, 3,109,155,151, 46,149,194,166, 14, 99, 44, 46,181,132, 90,130, 82, 24,227, 85,179, 81,153, - 18, 30,143,210,168,180,207,193, 71,160, 13,239, 78,153,247, 15,174, 10,246,112, 6, 93,114,170, 43, 47, 30,108,145,105, 7, 33, -102,191,187,246,247,197, 99, 44,231, 55,219,135,164,224,200, 15,191,200,142, 91,111,228,232,209,163, 28, 28,157,224,248,108,149, - 56, 53, 36, 54,211, 46, 87, 62,146,141, 19,139, 75, 93, 22,177, 67, 20,104,180,144,132,161,102,233,250,213,158,130,249, 81, 98, -239, 79, 28,217,237,203, 85, 73, 74, 61, 78,232,239, 42,177,235,232,164,103,163, 52,150,196,250,115, 55, 18,131,193,101, 81,171, -224,192,137, 99, 60,239, 73, 87,114,253,143,127,148, 25, 44,245,160, 75,244,252,145, 93,124,227,173,255,157,173,247, 31,100,251, -209, 41,180, 16,164,169, 37,146, 10, 99, 45, 74,121, 37, 54,133, 35,167, 52,163,163,135, 73, 91,134, 75, 47,130,139, 52,127,111, - 7, 91, 54,159, 99,154, 38, 72, 29,128, 82,212,230,166,185,255,206, 31,115,219,247,110,230,192,190, 3, 32, 21, 91,206, 59,143, -231,189,226,213,116,244,247, 47,190, 31,109,201, 38, 63, 78,213, 34,231,206,102, 22,120, 17,110,192,101,236,213, 72, 4, 41, 66, -168, 69, 2,174, 2,215,226,108, 95, 12, 66, 59, 61,137, 83, 51, 85,191,176,136,202, 83,189,191,197, 70, 85,180,138,239,109, 8, -241,102, 0, 98, 90,246, 73,136, 38,100,214, 34, 90,140,127,109,129, 74,123,143,220,175,224,141,183, 98,218, 44,251,128,117,232, -198,175,208, 16,210,158,104,108, 38,196,156, 92,184,125, 15,134,224, 21,143,226,156,139,208,186,217, 13, 20,153,186,112, 96,102, - 48,187,239, 96,251,103, 62,197,166, 87,191, 30, 85,234,163, 49, 62,134, 80, 1, 73,181,194,190, 29,251,153, 61,122,136,181, 79, -188, 2,109,107, 76,143,141,113, 98,198,114,120, 38, 70, 41,203,108,173,193, 68,189, 65, 49, 73,121,147,113,188,240, 9,235, 17, -133,136,153,217, 58,197,114,142,189, 56, 62,119,108,154,101,192,110, 7,197, 66,142,176,152,103,223,236, 60, 69,101,168, 38,150, -126, 96, 28, 40,204, 85,216, 28,104, 58,149,226,115,211, 99, 44, 85,146,171,187,186, 40,205,228,184,245,246,173,236,156,152,224, -146,165,199, 57,247,146,115,168, 76,141,145,214, 13,129,171, 83,175,156,100,118,236, 56,185,206, 94,130, 82, 9,113,236, 48, 38, -174,114,226,151, 85,130,158, 65, 26,219,182, 97,115, 93, 36,141,152,169, 61,219, 24, 56,247, 10,102,166,103,177, 58,244,108, 69, - 46, 33,174,213, 72, 11, 29,139,238,119,251,115, 17,109,206, 85,147, 22, 86,138,197, 9, 76, 3,139,212,213,116,219, 3,144,205, - 76,115,107,194,103, 90,196,206,115,202,167,109,142,156, 56,221,212,145, 11, 99,193,181, 47,235, 89, 42,172,148,201, 48, 58,215, -206,228,230,192, 88,223,101,235,108, 86,178,201, 12,187, 53,212, 39,142, 49, 57, 53, 73,181, 50,199,108,101,158,217, 90,157, 21, -235,215,161,195,128,241, 99,199, 40,151,138, 12, 12, 14, 81,236, 40, 33,145,200, 48, 71,119,103,153,101,203,135, 41,150, 59,233, - 27, 94, 78,239,202, 53,228,242, 57,140,115,212,146,216, 79,112,171, 17, 74,131,136, 17,132, 30,221,107, 13,210,202, 44, 43, 33, - 23, 34,200,204,179,183,109,102, 74,156,102, 28,167, 44, 80,221, 34,252,189,109,142,235,176,249,191,206,247,218,136, 12, 25,141, -147,152,212, 75,225, 6, 74, 97,141,243,156,254,169, 33,149,158,178, 57,109,102,179, 30,197,218,224, 30,197,252, 6, 78, 43,247, -121,186,107,124,172, 9,131,135, 67,226,139,199,184, 62, 61, 24, 48,191,169, 19,126,240,134, 15,113,248,222,187, 24, 61, 60,202, -254, 67,227,212,141, 33, 10, 36, 39, 43,117,172,131, 64, 43, 58,149,164,154, 26,202,145,226, 88,156,160,149,196, 57, 63, 14,138, -249, 60,229, 98,145,176,167,139,198, 41, 4, 68, 11,233,143,102,144, 39,218, 65, 76, 32, 32,153,157, 66, 72, 65,163,222,160, 24, -133,236, 60,120,156,185,216, 32,156,163,158, 90,148,128,212, 90,111,208, 51,182, 75, 44, 68, 90,115,203, 79,239,228, 47,158,253, - 2,222,241,181, 47,129,179, 62,240, 57,213,160,239,184,131,239,127,244,109,252,116,235, 94,172,243,180,168, 70, 10, 2, 45,136, -148, 38, 54,222, 17,109,162, 56, 6,123,122,152,155,155,161,122,218, 60,202,233,193,155,105,154, 34,180,166,114, 98,148,239,124, -228,189,124,229, 43, 55, 48, 62, 59,207,120,173, 65, 35,177, 52, 50,231,244,166, 31,222,193,215,190,116, 35,239,250,244,103, 25, -217,116,230,233,154, 61, 22,157, 79, 60,132,253, 80,178,125,190,233,182, 78,210,133, 79,251,168, 87, 46, 68,192, 45, 7,177,221, - 61,104,163,124, 62,237, 40,122, 32,229,238,194,115,180,109, 15, 55,251,177,110,225, 51, 25,186,182,137,169,105,102,246, 22, 71, -218, 60,128,184,234, 65,141,247,195,124, 70,100,199,106,126, 74,127,239,159,207,162, 86, 79, 72, 27,134,122,236,211,180, 42,146, -190,170,231, 22,162, 41,219, 92,112,164, 67, 10, 7, 86, 96,141,223, 7,128, 12, 37, 34,200, 4,186,140,243,117, 72, 99,193, 64, -146, 58,106, 85, 71,218,180, 40, 70, 32, 13, 4, 54,139,198,243, 22, 23, 64,190, 44,137, 10,158, 67,221,103,241, 29, 78,250, 20, -134,176, 6, 29,150, 89,186,241,106, 54, 61,253,141,255,151,176,247,142,179,236,186,234, 61,191,123,239, 19,110,168,212,213, 73, -106,169,149,213,146, 37, 89,150,179,141, 45,108,112,192,198, 96, 12,198, 4, 99,114, 52, 96,242,204,131, 55,192,131, 97,224,241, - 97,200,240, 48, 25, 51, 24,143,193,198, 96, 27,131, 19,248, 25, 99,108,225,164,172,150,186,213,234, 86,231,234,234,138, 55,156, -176,247, 94,243,199,218,231, 86, 9,222,231, 51,127,244,167, 90,234,170,123,111,221,123,206, 94,107,253,210, 34,158,254, 44,213, -133, 11,140,214, 90,142,124,205, 27, 41, 15,221, 76,216, 88, 71, 36, 99,186,186,198,169, 7,143,115,255,103, 62, 71, 35,145, 55, -124,237, 55,243,196, 63,255, 13, 79,156,186,200,123,191,240, 24,251, 22,151, 56,189,118,153,237,170, 97,185,106,185,247,139,111, -101,122,112,153,122, 99,139,122, 92,243,240, 67, 79,176,226,225,157, 65,184,253,202,189, 60,122, 97,141,243, 34, 44,182,129,218, - 89, 34,194,177, 86, 88,180,112, 49, 66,153, 14,216,127,242,158, 43, 67,224,178,133, 11, 81, 56,187,190,198, 80,224, 25,115,139, -220,245,232, 6,247,212, 39,184,250,166, 67,244,183, 61,198, 26,150,246,238,231,228,189,159,225,217, 47,187,139,237,209,152, 11, - 71, 31,100,188,185,198,222,195, 55,114,197,237,119, 48, 88,218,207,120,229, 28,139,135,174,135,162, 96,114,233, 60,147,149,243, -236,191,237, 14,189, 88, 45,248,170, 5, 17,134,120,254,228, 23,110,165,169, 54,104, 91,193,123,161,173,132,232,133,182, 22,188, -135,166, 17,154,102,199, 22,104, 51,195, 96, 8, 75,139, 80,244, 12,153, 53,184, 12,202, 82, 59,220, 24, 68,125,244, 65,168, 38, - 66, 85, 9, 62, 8,185,131,178,111, 40,114, 67,150,171,205, 67, 82,118,123,219,234, 5, 31, 69,102,141,175,179, 42,188,201,157, - 81, 15,170, 75, 40,117, 98,103,250,125,147,172,145,105, 34,193,130, 7, 31,244,226,115, 86, 53, 63,209,128, 45, 12,174,176, 52, -151, 2,143,158,242,108,143, 34,227,137, 80, 54, 66,216,206,112, 65, 88, 30, 8,147,177,112,225,232, 67,244,156,101, 41, 97,212, -193,193,218,113, 75,181,199,112,110, 96,200,250,134,114, 78,179,243,163, 24,197,178,131, 16,188,224, 74, 21,215,152, 96,200, 27, -176, 99,232, 77,161,140,150, 65,190,200,220,242, 45,212,163,179, 76, 70,231,217,116,129, 81, 17,137, 70,200,157, 97, 46, 88, 6, - 88,140,131,105, 97,136, 3,139,157,115,184,197, 28, 83,170, 45, 71,210,123,226,130, 65,198, 80,136,193,230, 57,253,189,119,178, -103,255,115,152,222,251, 33,216,184, 72,214, 58,172,100, 56,167,147,110, 4,164, 48,208, 51,180,139,134,182,167,135, 79, 81,131, -155, 58,108, 48, 16,157,190,191,226,176, 70, 87, 9, 22,203, 55, 96, 92, 15, 63, 58, 15, 97,186,115,248,204,206, 60,229, 28,213, -115,109, 49,229, 30, 36, 86, 24, 95,237,112,147,169, 32,206,224,107,231,118, 53,218,233, 49, 66, 72, 9,138,122, 6, 32,154, 28, - 56,131, 85,163,236, 18, 32,106,128,203,127,154,186,173, 77,252, 99, 7,163,166,174,208, 25, 76,190,160, 34,169,118, 59,209, 63, - 78,191, 90,171,212, 72,183,148, 72, 28,224,119,120,201,238,169,141,112,206,237,227,204,185, 85,206,156, 62,195, 19,167, 87,217, -152, 54, 92,216,154, 48,110, 2,185, 49,204, 15, 10,100,218, 82, 7,161, 95, 58,181, 73,109,142, 57,191, 49,130,104,200,178, 17, - 87, 47, 95,137,111,166,132,119,254, 23, 88, 58,128, 29, 46,129,117,200,100, 27,191,117, 25,218, 10,105, 38, 72, 91,167,247,196, - 34, 65,105, 23, 59, 92, 96,202, 18, 54,179,132, 54, 80, 53,129, 75,219, 53, 18,133,237, 38, 16, 69,155, 89, 47, 50,107,218, 66, -242, 27,183,162, 91, 53,223,251,177, 15,242,162, 31,255,118,238,190,225, 44,109, 94, 49,206, 38,152,178, 33, 74, 75,217, 95,228, -193, 79, 28,228, 11, 15, 61, 65, 20,225,244,250,136, 34,119, 84,109, 36, 51,142,126, 47,103, 32,134, 81,237,201,140,161,141,176, - 61, 29, 51, 55, 24,178,249,209,151, 34,205,152, 64,139,151,144, 86, 95, 91, 98, 47, 16,179,128, 43, 33, 90,165, 6,104, 23,248, -196,159,205,243,207,159, 61,195,137, 75,155,156, 29, 85, 56, 3, 77,208,143, 43, 75,130, 59,137,129,245,241, 38, 31,121,219,219, - 41,246,252, 14,181,213,223,175, 73,205,186, 94,114, 70, 81, 49,129, 44,203,112, 24, 92,180,244,157, 99,206,229, 12, 76,129, 51, -150, 73,221,178,222, 84,108,214, 45,147,160,219, 26,173,129, 72,164,110,161,109, 18,109,104,211,231,157, 66,233,103,170, 43,129, -126,207, 96, 51, 61, 87, 36, 10, 89,174, 89, 24,193, 67,221,118,187, 43,244,140,202,114, 69,136,186,186, 92,150,202, 8,147,236, -111,173, 7, 95,107, 82,186, 73,180,162, 85,119, 46,121,169,154,113,155,146,212, 69, 32,180, 66,235,149,246, 40, 51, 40,250,150, -133,161, 33, 47, 44,121, 6,189, 57, 71,191,231,232,149,234,193, 47, 10,200, 75, 71,153,232, 12, 35,129,141, 77, 79, 53, 9, 68, - 47, 84, 85, 36, 68,216,218,136, 84,211, 72,227,133,108,189,217,160, 65, 24,213, 42, 75, 43, 50, 67,158, 22,151,248, 8,161, 78, -107,203, 50,212,118,144, 38, 60,223, 64, 86,148,132, 88,145,139,114,178,101,207, 96, 34,196,100, 81,232, 26,166, 42, 10,117,186, -255, 9,234, 10,203, 49,228,141,129, 92,151, 14,216, 18,108,207,226, 75,163, 34, 47, 49,184,204, 17, 98,160, 55, 88,230,139,190, -242,183, 56,116,227, 23, 67,243, 24,225,228,191, 98,122, 7,137,102,155,213, 99,247,112,197,107,190, 10, 66,139,196,192,248,242, - 26,103, 31,124,136,123, 62,249, 73,126,249,111, 63,202,133,234, 9, 54, 30,254, 20, 15,124,226, 83,188,239, 19, 31,103,121, 97, -153, 83, 43, 23,152,120,207,202,196,115,246, 69,183,176,210, 4, 56,187, 74,214,115,220,243,216, 10,111,207,134, 44,239,159,231, -234,181, 13,142, 87, 13,167, 19,105, 54,148,128,153, 6, 46, 69,141, 64,149, 8, 91,104,102,250, 9,224, 90,224,178, 8,171,192, -161,204,112, 54,194,150, 8,159,218,222,228,121, 83,199, 93,143, 4,206, 14,238, 35, 92,123,144,167,221,124, 29,231, 79, 27, 46, -173,158,100, 50,185, 1,231, 96,105,239, 60,253, 50, 50, 89,125,130,135, 63,248, 40,131,189, 7,233,239,217,135, 60,246, 48,251, -175,189,129, 61,215,220, 76, 51,153, 48,186,180, 74,111,239, 50,205,165, 21,222,240,220, 23,241,204, 91,143,240,245,223,241,109, -124,231,207, 28,229,247,254,251, 13,180,227,117,154, 86, 24,215,224,235, 72,104, 58, 72,207, 80,213,130,151,136,115,234,103, 12, -193, 98, 91, 40,173, 33,235, 65,191, 52,180, 38,224, 10,131,111,180, 41, 8, 2,190, 20, 38, 94,104, 69,200, 44, 84, 1,138,204, - 48,200,211,148,157,138,174,110,168,139,122,145, 39,145, 72,102, 53, 94,177,138,144,245, 45,209,107,198,190,177,144,101,194,216, - 90,138, 92,111, 76, 9, 6, 73,129, 22,173,236, 40,227,109,169,185, 4,189, 62,180,214,210,154,192,212, 70,198, 81,152, 4, 97, -161,167, 31,132,193,144, 91, 97,169,103, 24, 56,195,162, 24,114,111, 40,140, 97,185,111,145, 2, 70,185, 16, 11,129,129, 16, 74, - 8,198,226,114, 67, 68, 8, 77,196,228,250,123, 56,103,200, 60,216, 6,178, 40,100, 88,202,148,199, 16,170, 85,218,208, 48, 37, - 48,118,145, 9,162, 57,205,187,186,119,113, 22,151,131,233,129,153,131,208, 7, 91, 68,218, 86,176, 46,217, 99,188,193, 70,139, - 4,240,153,103, 58,122, 20,191,126,150,162,222,166,232,132,162, 68, 68,148,211,180,153, 35, 90,136, 86,139,161, 53, 49,125,143, -219,105,138,130, 36,106, 63, 49,210,206, 18,167,171,152,124,142, 24,234,157, 25, 68,189,122,233,176,144, 89,118,191,158, 86, 27, - 59,255,158, 40, 7,118,241,169,138,106,248,164, 49,232,160,241,167,230, 70, 72,199,173,117, 54, 34,219,201, 95,172, 22,243,110, - 8, 73, 13,197,108, 97, 84,148,110,121,195, 12, 25, 53, 9, 90,148,182, 81,199, 77,210,115, 64, 23,223,155, 14,222,142,155, 20, - 63,107, 28,186,169,202, 2,155,131, 43, 57,245,196, 25,206,159,185,192,227,103, 86,217,158,180, 76, 26,207,160,200, 16,244,204, -105, 93,142, 72,205,234,229,117, 70, 77,224,192,129,189,188,233, 13, 95,206,235,191,249,155,184,230,200,157,204,205, 47,146,247, - 10,144,134,118,125, 29,147,101, 42,124,242, 77,154,210,116,139,138, 49,218, 92,249,241, 6,147,207,189,159,246,220, 81, 76, 48, -216,189, 87, 19, 46,110,232,185,151,193,165,245,109,114,107,216,106,125,242, 72,119, 5,105, 39,100, 11, 68,205, 69,137,223,109, -218,150,191,248,216,253,124,209, 29,119,226,227,163,216, 76, 19, 91,114,147, 81,173, 9, 31,191,231, 97, 54,155, 70,105, 55,132, -210,169, 14,233,154,133, 1,235,211, 22, 99,160, 47, 14,103, 51,214, 39, 83, 50,231, 40,203, 18,241, 53, 38, 3, 27,117,171, 36, -206,129,139, 24,103, 20,193,138, 30, 17,135,149,130,119,252,130,240,222,207,221, 75,139, 97,210,122, 36,170, 6, 32,138,230,136, -116, 75, 81, 22, 6,125,170,198,211,134, 72,127,184,136, 84,107,196,168, 13,139, 72, 82,218, 59,176, 81,155, 64,211,234,176,208, -115,142,210,100,244,200,113,100,250,126, 89,155, 18, 38, 53,191,194,166,194, 92, 53,187,250, 70,146,192,207,170,166, 40,207,100, - 70,113, 73,147,168, 91, 5, 2,245, 53,196, 29,200,104,246,125,179,173,115,169,248,167,203,168,109, 32, 43,210,153,100,180, 52, -198, 84,232,109, 0, 87, 66,222, 99,230, 14,202,146,174, 54, 81,239, 16,116,137, 86, 89,232,191, 73, 43, 76, 42, 24, 90, 33,179, -134,210, 25,122,133, 37,179,134, 86, 32,115,150,126,225, 48,153, 22,208, 24,133, 65,223, 81,148, 6, 39, 58, 68,133, 16,152, 27, -194,120, 27, 70, 85, 36,155,100, 13,193, 7,198, 54, 82, 22, 6, 95, 64,204,180,107,154,182,122,120,196, 86, 29,237,214,166, 67, -190, 21,174,190,250,102,174, 59,242, 28, 30,190,247, 35,172, 95,190, 76, 22,160,231, 45,214,136, 38,128,165, 55, 56, 68, 93, 32, - 66,166, 16,111, 72, 40, 73, 12, 6, 49, 6,151, 67,155, 9,189,210, 48,205, 18, 67,148,101, 88,215,226, 6, 87,240,210, 87,253, - 22,135,111,124, 25, 34, 91, 8,171,152,202,227, 22,246,178,254,240,253, 60,246,137, 79,178,124,235,109,106,251,154,172,115,233, -177,163,156,184,247, 94, 30,248,183,207,242,143,255,122, 31,127,254,199, 63, 79, 94,206,113,242,190,135,184,231,158,251, 56,191, - 53,161, 9,134,173,182,101,141,156,127,122,198, 65,154,224,105, 71, 21, 49, 4,222,241,200, 5, 30,190,254, 90,214, 39, 19, 62, -115,226, 52, 7,128,190,129,101,103,216, 12,194,195, 62,114,251, 85,251,248,233,175,127, 45, 55,221,241,116,150, 15, 30, 98, 97, - 56, 71,150,151, 52,147, 41,227,201,152,245,245, 85, 62,246,119,239,227,255,249,231, 79,114,110,107, 76, 1, 92,229, 12,247,133, -192, 19,245, 54,139,255,242, 0,175,186,125,194,158, 47,253, 18, 30,253,240,167, 57,116,232, 0,163,211,151,184,246, 57, 87,225, -174,185,134,182,105, 25, 95,218, 38,182,171,108, 79, 85, 20,149,247, 74,214, 79, 63, 65, 94,244, 89,190,249, 86, 98,244, 44, 46, -239,229,240,158,189, 92, 51, 44,152, 76, 43, 78,221,247, 4,217,224, 31,249,254,159, 58,193,175,255,252, 94, 66,222, 96,123, 66, - 91,107, 97,245,181, 42,175,197, 9,193,171,231,222, 71,176, 65,200, 90,104,141,161,159, 89,178,168, 19,188,247,218, 1, 10,208, -132,136, 71,136, 78,187,217,128,126,174,193, 11, 25, 58,185,123,152, 21,234, 40,162, 98, 59, 81,132,192,228, 90, 40, 76,145, 66, - 43, 45,136, 51,184,204, 80,103,208,203, 35, 85, 64,215,229, 2, 94,244,113, 67, 58,216,156, 83,120,203, 57, 67, 5,228,133, 48, - 65,152,182, 66, 27, 5, 31,133,133, 5, 75, 59, 0, 19,245,240,243, 49, 45,196,113,176,144, 43,154, 98,172,224, 1,143,110,146, -170,197, 96,140,144,231,162,157,153, 36, 97,161,168,197,198,215, 66,142, 34, 74,185, 64,137,224,162,197, 54, 19,170,245, 51, 84, -210, 48,113,145,177, 4,154,168,147, 73,204,146,224,198, 9, 18,162,138,113, 44,196,220, 96, 82,227, 97, 51,104,125, 36, 79, 66, - 70,151, 11, 49,179, 68, 99, 65, 70,196,118,140,195, 17, 77,166,147, 90, 84, 94,221, 56, 75,148,136, 9,201,166,152,144, 4, 35, - 70,139,156, 86,123,149, 6, 25,187, 83,168,173, 33,212, 35, 76, 51, 86,104,223,217,148,117,175, 78, 21,125,220, 93,108,105,106, - 98, 5, 93,106,180,195, 35,198,196,247,219,153,162,216,216, 36, 6,116, 58, 26,237,164,220, 37,199, 75, 87,188,157,157,217,122, -164,227, 89, 76,103, 37,178, 51, 37,250,110,133,206, 83, 38,124,163, 83,187,132,105, 90,252,144,237,130, 38,255,131, 27, 33,165, - 1,202,174, 93,164,198,128,159,223,207,209,199,207,178,190,178,206,153, 11,107,196, 68,169, 44, 12, 6,108, 53,158,245, 11,231, -105,218,150,125,123, 23,121,205,235,190,140,111,249,241,159,102,110, 97, 15,121, 57, 76,175,202, 67,172,244,249,155, 41, 18, 61, -121,175, 79, 12, 30, 95, 87,233, 87,142, 72,132,208,140,137,193, 19, 67,192,152,140,252,217, 95,195,220, 75, 23,168,143,126,146, - 51, 79, 60, 76, 83, 87,216,220,210, 84,158,237,170,161,137,138,134,138,209,230, 36,179,150, 16,133,208,189, 79,178,195,111,119, - 84,228,163, 39,143,243, 79,199,191,130, 23, 29,121, 16,103, 12, 98, 4,103, 44, 11,123, 60,197, 53,219,156, 63, 58, 97,105, 33, -227,235,191,248, 14,206,156,142,172,110,142, 24, 77, 91,230,162, 36,181,122, 61,219,166, 56,169,107,150,151,135,144,251, 29,187, -165, 19,196, 68,176, 49, 61,182, 94,175,177,181,108,172,181,252,233,191, 29,199, 89, 75,102,244, 30, 52, 6,218,168,197, 9,209, - 84, 72, 99, 12,173,111, 25,244, 6,108,108,172, 50,127,125, 9, 34,228,121, 58, 67,130, 94,223, 86, 89, 46, 76, 84,228, 47,243, - 74, 59, 21,214, 81,152,140,194, 57,166,120,154, 54,232,115,101,154,110,222, 33,143, 10,201,119, 72,159, 94, 2, 94, 55,132,211, -245, 38, 49,189,198,152,134, 75,103, 19,117, 24,180,232, 75, 90,166,213, 93, 90, 88, 67,202,135, 81, 23,170, 40,238,159,162, 51, -180,185, 16,144,144, 26,122,155, 16,207, 92,109,108, 93, 49,183,105,232,113, 86, 48, 22,250,125,237,155, 99,212,228,187,182, 18, -188, 19,164,232,132,195, 73, 4,155, 25, 50,231,112, 46,215,137,201,233, 80,157, 13, 19, 76, 32, 66, 16,143,175,161,204, 13,121, - 33,100, 83, 67,214,208, 18, 77,164,152, 19, 50,103, 48, 14,124, 52, 68, 34,209, 25, 2,122, 90, 69, 49, 52, 29, 55,227, 29, 89, -209,167, 55,188,130,105, 12,140,166,129,126, 63,249,210,141, 65,210, 94,218,188, 7,117, 4, 91,232,197,232, 34,152,214, 32, 25, -216, 90, 59, 22, 6, 66, 86, 26,178,121,144,220, 17, 76,100,110,105, 63, 47,125,245, 91,185,242,154, 23,170,102,190,131,254, 87, -238,163, 61,191,194,229, 7, 30,102,237,252,136, 97, 49,199,205, 95,247, 93,196,205, 21, 66, 61,101,229,216, 9,142,125,250, 83, -228,146,243,216,218,101,190,242, 59,255, 11,147, 51,247,178,122,234, 44,159, 60,122,130,202,195,202,104, 11,159,101,124, 7,129, -103, 93,185,196,137, 83,171,172, 93,218,230,183, 87, 71,220, 7,196, 39, 78,113,211,190, 69,110, 52,112, 65,116, 59,218,151,223, -117, 11, 63,245, 63,126,147, 61,131, 33,217, 96,200,214,229, 75,140,214, 55, 8,173,103,123, 99, 99, 70,146, 88,231, 88, 94,218, -203,155,126,232, 71,248,182, 31,248, 97,198,219, 91,188,235,175,254,146, 95,252,171,191,231, 48,112, 33, 68, 38,206,242, 39, 15, - 61,206,133,255,251, 79,120,230,171,190,152,122,178, 70, 49,200,112,197, 60,195,131,135,136,245, 20, 87, 46,176,112,240, 8,117, - 5,197,222, 27,241,155, 35, 36, 11,108,156,124,156, 98,110,158,141,179,231, 56,246,224,231, 57,179,177, 77,175, 92,228,242,104, -131, 7, 30,190,135, 79,127,254, 35, 76, 46, 30,227,155,191,239, 19,252,209,111, 60, 23,147, 41,124,237,167,130, 87,201,186,138, - 27,131, 54, 11, 81,192, 78,146,228, 36, 66, 49,136, 84,173,174,140,141, 94,243,162,131,104,131, 23, 80,145, 91, 52,218, 45, 64, -145,241,107, 0, 0, 32, 0, 73, 68, 65, 84,118, 43,112,218,118,102, 62, 72,110,198, 36, 84, 73,112,191, 0, 85, 35, 20,214, 82, - 22,170, 36,142,198, 96,156,222,125,206, 66,211,202, 76,119, 18, 68, 8, 77,178, 15, 53, 96,243,136,175,181, 59,110,163,118,195, - 54,234, 4, 19, 69,168,131, 80, 24,133,197, 66,166,232,131,180, 26, 98,225, 68,179,153,219,180,140, 65,140, 54, 38,164,215,170, - 29,100, 36, 24,237,154, 29, 22,147, 25, 66,212, 66, 89, 20,144,167,199,207,141, 37,143,134, 44,113,253, 98, 35, 65, 82, 83,145, -226, 36,179, 36, 94,176, 78,167, 15,107, 13,226, 74,218,220,208,184,168, 80, 94,209, 61,183,195,182, 49,173,221, 77, 7, 96,166, -135,154,201,116, 5,101,231, 90, 51, 93,225, 10, 50,171, 91, 54,130, 52, 74, 81, 1,152, 86, 97,118, 43,105, 4, 49, 6,137,162, -105, 92,166, 75,202, 98,166,218, 39, 65,121, 98, 93, 10,240,208,194, 42, 49,125, 99, 76,113,209,214, 60,133,215,235, 92, 0,200, - 46, 62, 84,216,121,109, 51, 8,221,165,229,198, 97, 23, 40,160,106,101, 9, 65,127,175, 44,201,139, 37, 5, 69, 69,233,242,165, - 18, 69,180, 83,176, 99, 8, 24,151, 99,202, 82,121,158,164,118,198,154,157,176,172, 14,162, 79,112,189, 72,196,206, 20,215,150, - 99,107, 53,151, 47,173,113,242,236, 69,130, 24,246, 46,207, 99,215,183,184,255,248,105,110,187,229, 6,126,234,221,239,224,170, -155,110, 99,113,223,149,137, 98,168,211,215,118,135, 3,141, 50,243, 38,153,174,209,136, 66, 94,150,196,182, 33,180,158,224,189, - 54, 36,137, 27,215,133,105, 45,213,198, 10,238,240,157,220,120,219,151,176,120,236,179,124,238,125,111,231,204,153,115, 20, 69, -201,218,120,147, 38, 66,227, 67,138, 53,213,137,215, 97, 8, 49,221,109, 70,102,130, 46,155,138,229,125, 15, 63,204, 75,238,186, - 2,169, 47, 32,198,144, 91,139,117,134, 31,122,211,213,216, 8,198, 23,212,219, 55,176,190,122, 22,107, 28,131,178,194,175,141, - 17, 34, 33, 68, 46,111,110,115,118,115,139,150, 57,124,189,142, 41,123, 72,107, 33,171,241,161, 38, 70,173,126, 46, 6,221, 91, - 33, 22,235,132, 3, 87, 26,230, 74,199,229, 73,203,176,204,152, 43, 29,155,149, 87,157, 79,231, 74, 74,162,181,214,123, 6,189, - 30,227,241,152, 94,177, 68, 61, 61, 55, 19, 63,135,116,118,132, 36,208,137,169,192,155,194, 96,177,244, 93,166, 91, 60,137,212, -190,165,117, 30, 31, 2, 18, 68,239,151, 4,125,219,168,200,151, 75,211,117, 76,240,127, 7,214,216,180,110, 58, 47,244, 90,180, - 70, 27,138,174, 95,109,252, 14, 37, 30,196,208, 47,211,240,158,237,210, 26, 57,102, 10,251, 78, 24,148,149,224,189, 65,130,204, -154, 0,137, 10,219, 71,160, 87,104,237,204, 11,109, 90,138, 76,155,129,208, 66, 51, 21,154, 86,105, 38, 31,146, 31, 63,209,253, - 89, 97,200,196,146, 21,118,182, 72,202, 96,116,159,136, 19,162, 4, 76,114, 4, 5,167,215,100, 95,244, 60,206,140, 17,196, 69, -242, 76, 39,153, 24, 12,193,234,137,111,178, 78, 85,231, 16, 47,196, 24,104,188, 32,177,229,190, 7,238,231,216,177,199,217,222, -222, 36,136,238, 19,216, 51, 0, 31, 12,109,173, 28,155,235,165, 22, 57,151, 4, 77, 24,178, 92,232,205, 25,218,145, 32, 83, 33, - 22,224, 6, 22,227, 2,115, 75,135,121,229,107,223,198,190,131, 55, 34,140,117, 87,176,233, 65,253, 32,241,196,231,105,207,175, -210,100,123,184,226,235,126,144,225, 35,159,229,226,195, 15,165,211, 66,152,110,141, 88, 57,119, 22,241,142, 63,252,224,199,249, -127,223,243,135,248,245,199,137, 18,184,120, 97,149, 51,107,219, 8, 22, 31, 35,249,184,225, 87,238,190,149, 11, 23, 55,120,232, -228, 42,191, 51,109, 57, 15,204, 37, 14,232,242,234, 38, 79, 0,255,227,103,222,204, 87,127,203,183,131, 24, 46,157,125,146,245, -186, 66, 46, 95,158,165,218,185,178,196,182, 81, 69,102,198,146,149, 61,172, 49, 76,199, 35,182,215,215,168, 71, 35, 94,254, 37, - 47,227, 53, 47,255,114,126,255, 29,111,231,237, 31,251, 55,214, 67,228,101, 71,174,228,213,223,251,245, 28,127,248, 12,151,206, - 93,226,218,171,151,192, 9,177,173,200,230,250,184,201,148,172,191,136,247,158,176,189, 70,185,119, 15,229,226, 30, 22,174,214, -188,230,107,159,121, 23,111,216,191,159,111, 31,246, 88,221,156,240,152, 57,207,231, 46,158,225, 80,209,227,185, 71, 47,240,244, -215, 94,193,145,219, 94,199,131,159,253, 91, 29, 42,106, 84,100,149,220,133,157,119,192,165,110,177,173,132, 94,207,224, 91, 67, -175,103,104,235, 72, 20, 69, 92, 66,171, 73,127, 62, 64,104,181,219,141, 73, 89,215, 54,130,239,233, 94,116,241, 80,244, 65, 50, -213, 84, 4,151,110,144,160,103, 96, 75, 68, 48,148,165,121,138, 90, 53,122,189,238, 36,106, 65, 55,209, 42,199,214,193,115,149, -222,168,226, 77,167,125,209,127,119,250,216, 86,244,134,182, 61, 67, 86,130,140, 5, 9,122,208, 70, 11,141, 49,108, 69, 97,222, - 42,197, 16, 17,178, 12, 90,167, 83,253,206, 4, 40,152, 66, 82, 49, 87,189,170, 84,202, 11,155, 76, 40,172,198,135,154,168, 5, - 71, 2,136,141,248, 4,151,154,216, 57, 62, 20, 97, 48, 8, 89, 94, 80,236, 61, 12, 7,150,216, 54,199,240,166, 1, 99, 40, 10, - 75,219,128,139, 2,181, 26,145, 93,110,136,118,167,248, 25,103,210,166, 56,157,206,109, 74,158,154,201, 97,130,193,181,224, 45, - 88, 28, 89, 48,233, 16, 79, 42,243, 16,149, 79, 55,154,130, 40,214, 66, 72,238,210,153,240,118,199,158,179,123, 42,238, 32,113, -147, 10,214,172,176,207,178, 36,118, 10,244, 78, 53,213, 72, 93,237, 56, 74,160, 77,233,124, 54,217,247,210,207,248,248,148,197, - 21, 51,213,211,110, 49,153, 73, 81,189,105,242, 82,181,122,142,155, 59,132, 29, 30, 32,142, 47, 16, 38, 43, 79,145,233, 25,211, -169, 6,147, 21,203,170,245,149, 20,162,210,246, 23,185,116,242, 44,235,155, 35, 92, 94, 48,140, 19, 76,219,112,231,221,119,243, -139,239,251, 69,141, 9, 38,130,132,212,244, 4, 32, 79,205,131, 48,155, 84,186, 24,225,214,235,210,142,182,214,180, 14,159,174, -225,168,132,178,205, 50,181, 70, 90,147, 14,251,136,203, 11,229,119,167,171,236,187,238, 86, 94,243,127,188,149,219, 62,251,207, -252,248,247,254, 32, 15,157, 60,199,118, 16,230,135, 61, 6,189, 94,178,235, 70, 93, 67, 28,162,194,215,117, 96, 84,251,167,136, -199,142, 29,123,156, 83, 43,119,115,227, 85,141,246, 29,141, 7,105,177, 86,239, 37, 99, 35,167,158,108, 89,219,216, 36, 68,131, - 88,195,252,194,128, 67, 7, 15,112,123,153,115,228,214, 35, 44, 45,239,229,202, 43, 14,179,231,138,171,136,197, 55,144,247,134, -100,206, 18,253, 20, 95, 62,192,197,199,127, 89,197,170,109, 80,221, 71,102, 9, 18,248,139,183, 31,230, 27,191,233, 52,149,247, -236, 91,232,177, 84,102, 60,177, 89,165, 94, 75,135, 28,137, 41, 71, 29, 69,155,138,124, 41, 81, 11, 73, 63,111,205,172,248,199, -104,158, 34,240,149,174,137,177,145, 90, 60,181,109,169,130,135, 76,212,230, 23,165, 3,130, 8,187, 24,155, 78,175,227,131,210, -124,214,165, 13,117,233,236, 8,102, 7, 49,246,162,197,182,155,144,109,166,246, 81, 81,131,211,140,117,138, 41, 76,212,228, 9, -197, 11, 80, 77, 81, 93, 81, 38, 72,169,214, 94,151,165,243, 74,116, 80,200,156, 73,189,166, 97,208, 83, 36,211, 5,195,148,136, -212,122,153,149,125,232,149,134, 44,179, 12, 6, 57, 46,119, 20,118,135,133,114,174,107,210, 45, 54,179, 72, 12, 51,123,156,111, -132,152, 6, 9,165,187, 13, 89,136, 65,187, 3, 27,117, 65,124, 84, 78,221,183,137, 19, 51,134,195, 87,221,200,104,107,147,147, -103,206, 43, 25, 63,133,186,110, 89, 51,235,216,104, 40,251,122,224, 55,173, 33,239, 25,250,165,193, 68, 37, 44,242, 60,137, 31, - 10,245,253,217,132,201, 15,150, 12,161,111,136, 46,178,239,202,155,120,237, 55,254, 21,195,249, 62,216, 57, 36, 84, 88,119, 21, -178,254, 41,196,142,224,252, 69,252,198,132,242,101,223,139, 60,248, 65, 62,243,243,111,225,163, 31,250, 60, 63,254,137,127, 69, - 38,155,136, 88,214, 78, 60,193,197,147,103,248,194,137,147,172, 3, 47,120,229,215,209,172, 60,192,185, 7, 31,226,223, 63,127, - 31, 77,154, 60,182,179,140, 15,236, 27,176,229, 3,239,125,240, 44,127,158,138,178, 69,121,242, 38, 10, 63,250, 93, 95,195, 79, -252,242,175,176,118,254, 28,151,207,159,197,101, 25, 89, 81,168, 64,185,141,196,198,211, 54,141, 78, 9, 38,195,250,150,163, 15, -222,199,233,211,151,120,236,248, 41, 14, 44,239,229, 25,119,221,194,149,251, 15, 49,109,166,156, 61,125,140, 47,123,206,115,216, - 87, 14,185,170,127,153,103,191,252, 85, 92, 56,191, 70,181,181, 69,152,142, 16,209,221,236,177,109,240,147,192,242, 53,215, 81, -141,183,137,146, 81, 93,186,128,245, 43,132,173, 57, 76,185, 64, 8, 48,186,188,194,125,107,155,188, 98,121,145, 59, 69,120, 69, -107, 40,135, 75,252,253,116, 74, 91, 44,240,248, 39,254,141,215,125,253,159,114,239, 61,239,129, 4,249,180, 19, 45,184, 33,253, -183, 45, 82,193, 13,130,199, 80, 85, 66,127, 62, 13, 65, 86,225,250,105,197, 44,232,199,164,169,119, 58,209,139,214,138, 80,103, -134,222, 80,200, 58, 33,154,232, 99,135, 6,237, 38, 51,189,142,136, 59, 9,170, 98, 32,223,165,196, 55, 65, 39,234, 40,202,235, - 58, 23,201, 18, 46,230,130,168, 82, 92, 96,210, 10,193, 26,134,206, 16, 5,109, 12, 91,161,241, 80,213,144,109, 6, 36,207,158, -146,199,209,138, 22,217,220, 9,141, 3,162, 77,139,135,116,234, 17,103,104,130,208,203,181, 80,155, 68, 61,196,132,209,185, 76, -167,127,201,148,134,178, 78, 32, 9, 94,186,250,165,225, 63,202, 37,182, 64, 97,119,156, 45, 46, 51, 56,167, 81,150,196, 6,231, -210,207, 97, 48,185, 37,166, 14,223,137,193,120,161, 91, 73, 63,139,219, 48, 26,130, 99, 19,158, 40, 70, 72,249, 74,250, 58,140, - 90, 6, 77,155, 44, 95,173,204,224,116, 99,220, 46,191,124,103, 91,116,105,200,220,101,135,233,166, 79, 99,119, 38,249, 78,162, -214, 97,143,105,225, 80, 55, 53,207,214, 53,119,102,157, 46, 88,202, 71, 76, 57, 79,182,120, 3, 97,122,137, 56,185,160,223,145, -200, 83,233,138,162,236,240,224,106,179,216,101, 61, 74,217,219,118,183, 96, 46,157,196,166,156, 39,223,123,152,122,251,220, 46, -235,147, 73, 77,131,155,249,139,109,226, 68,201,244,125,176, 38, 50,170, 27, 54, 54,214, 89, 93, 89,227, 25,207,127, 22,175,251, -201, 95,163, 24, 44,164,230,194, 35,226,255,131,222,127, 55,230,106,118, 12,206,161,213,155,196,166, 52,176, 76,147, 24,197,215, -122,120, 23,125,133,182,189,215, 4,179, 44, 71, 82, 34,155, 30,200, 50,139,227, 14,147, 85,174,187,253,153,252,237,253,143,179, -121,249, 2,107,103, 30,227,207,223,250,135,252,235,231,238,101,117,125,155, 38, 42,199,154, 91,199,129,189, 75,220,122,227, 53, -124,237,235,191,130,235,142, 28,161, 88,186,146,185,193, 60,189,197, 2,179,177, 78, 61, 26, 19,154, 74,197,190,163, 13,154,237, - 41, 33,180, 20,131, 30,207,127,221,213,188,236,123,175,192, 58,253,172,234,181, 53,166, 91,219,100,189, 62,213,246,136, 54, 70, -166,147,150,233,164, 69, 38, 21, 12, 26,236,161,107, 25, 44, 95, 75,187,117, 5, 55,191,240,245,172,157,249, 93,198,231,255, 2, - 23, 74, 76, 16,172, 53, 44, 45,192, 59,223,126, 13, 63,242,125, 43, 92,179, 56, 96,216,203, 89,153, 92, 96,218,198, 4,193,235, -122,109,162,164,107, 46,210, 27, 22,184, 13,125,159, 93,146, 91,204,106, 77, 7,121, 27, 33,146,178,215,141,167,138, 66, 37, 45, - 53, 45,222, 6,234, 86,169,193,232,117,128, 80, 65,175,246,134,117,212,162,108,157, 38,101,198,180,208,142,160,136, 73,221, 48, -219, 89, 30,146,112,219,238,146,219, 91,209,199,204,157,114,214,153,219,113,160,101, 74,253, 19,125, 87,232,101, 86,120,189,215, - 65, 47,247, 90,248, 69,160, 40,181,136,231,153,138,132,123,185, 54,159,177, 17,250,206, 80,183,134, 97, 79, 40, 74, 75,191, 52, -236,219,231, 24, 12,114,138,210, 18, 66,196,137,230,241,207,132,167,185, 37, 6,141, 71, 15, 62,204,146, 87,189,143,120, 47, 52, -173, 48,173,132,108, 97,113, 15,235,155,107, 73, 93,160,208, 92, 74,232, 36, 36, 56,100, 90,175,211,196, 49, 49, 70,170, 9,212, - 83,161,169, 83,250, 87, 38,100, 37,184,220, 80,244,161,215,235,222, 80,155,160, 12,205, 31,118, 78, 40, 10,131, 9,162,123,179, - 35,152, 92,120,245, 87,255, 1,215,220,252,202,116, 19,237,129,205,135, 48,195, 62,114,246, 30,112,145,250,161,251, 40,143,124, - 17,217, 53, 87,115,254,143,126,140,139,235, 57,147,108, 1,187,124,128,114,120, 24,169, 87,184,252,192,125,156,124,224, 33, 30, - 61,126,130,127,127,248, 20, 31,254,151,119, 83, 95, 60,202,229, 83,103, 88, 63,119,129, 39, 87, 46, 49,215, 43, 57,189,181,205, -139,197,242,194,187,174,231,143,255,233, 65,126,171,141,148,169,208,108, 9,124,219,171, 94,192, 47,254,193, 31, 16, 98,195,233, - 71, 31,194,185,140,188, 44,145, 24,180, 51, 12,129,182,169, 84,213, 79,192, 72,198,116,227, 34,191,251,182,119,243,226, 87,124, - 57, 63,243,238,247,176,103, 56,207,100,242, 4, 43,127,253, 65, 74, 23,249,218,103, 61,141,175,123,249, 75,120,236,201, 83,172, -173,156,230,165, 95,245,197,156, 57,126,150, 60,107,217,191,199,177,111,120, 3,147,106, 66,219,212, 12,134, 67,178,114,158,201, -250, 58, 89,111, 64, 89,182,244,175,191,158, 96, 74,164, 25, 35,211, 77,196, 12,152, 95, 88,224,175,222,245,199,252,248, 27,190, -139,231, 45,207,113,201, 7,110,205, 45,255,237,138,235,248,248, 31,252, 58,242,149,175,102,223, 51,158,201,243,239,126, 51, 31, -249,219,223, 83,111,186, 8,161,214,225, 67,178,148, 32, 25, 20, 82, 55, 81, 63,115,223, 64,147, 10,203,120,156,174,129,144, 20, -160,162,197, 83, 34,140,167,202, 85, 21, 34, 84, 19,163,208,117,170,167,173, 87,197,103, 91, 43,124,216, 54,250, 24,115, 61, 40, - 10,165, 92,194,236, 6,146, 29, 17,182,239,214,244,104, 18, 92,158, 89,196,105, 17, 11, 41,145,201, 58,133,233, 50, 3,197,188, -197, 6,131,247, 90,100, 70,235, 2,251, 84, 39, 16,210, 2, 49, 31,132, 44,135,169, 23,114,235,200,156, 22,242,152, 41,250, 96, - 19,196, 27,208,194, 76,130,239,172, 19,124,147,106, 68,166, 58,147,144,105,179,146, 37, 15,170, 14,181, 66,110, 21, 58,175,144, - 25,117, 53,171, 55,193, 83,175, 30,199, 7, 7,251, 18,214,232,181,203,207, 10, 51, 11,226,201,141, 34, 4,186, 80, 70,179, 23, -148,206, 48,255,193,223, 99, 83, 51,145,138,131, 23,104, 4,155,224, 89, 43, 38, 77,228,130, 88, 13,202,177, 34, 42,112,234, 2, -156,140,106, 89,172,221, 85, 72,163,164, 45, 16,187,178,248, 5,140,117, 72, 76,187,238,125,220,105, 10, 82, 65, 19,217,153,186, -103,163,142, 49,196,122, 29, 9,245,204,134,104,102, 31,114,178,237,237,122,110, 99, 93,202,248,239,184,240,217, 43,208,112,142, -244,250, 76,102,241, 27,167,144,201, 42,161,222, 74, 54, 46,153, 69,132,118,250, 56,235, 84, 13,143,117, 58, 64,100,202,179, 84, -171,107,220,241,210, 87,240, 93,111,253,161, 93,169, 93,241,127,225, 95, 54,187,204, 84,105,236,139,169,234,180, 45,226,125, 18, - 60, 69,140, 53,132,170,194,100, 57,174,232,233,171,142, 42, 56,118,101,174,141,186,247,184,178, 84,191,181,247,216, 4, 37, 27, -227,112,253, 66, 21,243, 97,139,133,249,130,133,219,239,226,231,126,255,237,255, 63, 22,190, 9,248, 6, 25,111,129, 84,132,203, - 99, 98,235,177,121,193,248,242, 6, 98, 51,218, 70, 23,165, 12, 15,237,167,156,159,167, 92, 92,192, 71,207,232,194, 42, 96,168, - 71, 35,242, 94,143,118, 58,197,139,162,114,153, 19,136, 53,121,175,100,188,185, 73,176,231,136,117,195,210,225,195,180,245,148, -229, 67,111,102,239,225,239,225,210,189,111,212,248,109,180,216,236, 93, 10,252,225,219, 14,240,201,183, 93,201,116, 82,115,255, -217,117,206,108,215, 20,206, 81, 7,161,103, 83,225, 9,129, 94,175,199,100,244, 4, 14,163, 62,252,116, 14,205,118, 33, 57, 29, - 50,186,186,225,241, 76,196,224, 91,143,199, 83, 73,160,145, 72,227, 85,227,211,250, 72, 8, 66,221,166,233,217, 11, 69,174, 14, - 30,159, 38,108, 73, 8, 99,150, 27,157,220,237,142, 19,205, 38, 26, 78,218, 29,247, 88,240, 9,193,204,244,123, 99,242,233,118, -180,151,143, 42,114, 11,169, 70,182, 45,180,233, 92,244, 65, 41, 0,155, 94, 3,162, 19,122,102, 13,115,115, 42,126,203, 4,188, - 19, 70, 83,161, 63, 20,150,250,150,222,208,144, 21,150, 94,223,145, 23,142, 44,183,100,121,218,237,238, 50,140, 53, 56,211, 81, -161, 26,226,214, 38, 97, 83, 12,234, 72,154,214, 48, 30,193,214,166,144, 69, 81,149,179, 73,111,138,136, 81, 43,130, 49,216, 92, - 39,169,213,245, 21,170,137,168,114,175, 21,218,182,155,242, 18, 26, 37,106, 17, 48,105, 33, 75,111,152,209,120,149, 35, 26, 47, - 24,171,211,122, 89,104,254,112,219, 52, 92,127,228,229,188,252, 69,255, 59,244,175, 6,179, 87, 87,160, 62,241, 30,152, 86,152, -253, 87, 80,159, 58,129,223,188,204,240, 75,191,147,237, 79,254, 53,241, 66,133,121,238,119,179,254,222,191,230,125,127,248, 78, -126,242, 35,239, 64,154,243,172, 63,241, 24,199,239,185,135,203,231, 79, 49, 87, 88,158, 52,194,117,119,126, 17, 76, 87,121,228, - 95,254,133,195, 55,222, 68,227, 35,219,211,134,113, 35,252,252,173,251,185,255,193, 39,249,141, 58,204,148,142, 39,163,240,174, - 95,253, 9, 94,255,221,111,225,204,195,247, 99,179, 28, 87,148, 42,249,105,107,130,215,101, 35, 93,142,177, 6,161, 8, 54,214, -188,225, 71,126,133,239,249,214,239,226, 61, 31,252, 48, 55, 93,181, 68,148, 1,139,115, 57,203, 11, 11, 56, 50,222,243,224, 9, - 62,242,240, 35,188,238,206,167,113,203,117,123,153,142, 3,253, 50,208, 95,216, 75, 27,182,216,220, 94, 97,245,232, 57,174,127, -230,115, 88,240, 45,217,124,142,219,179, 76, 51,222,162, 88,220, 67,181,190, 73,180,125,168,215,201,230, 15,224, 66, 69, 61,218, -228,230, 23,191,156,191,121,242, 81, 94,114,205, 45,244,128,255,185, 57,230,233,167,206,240,188, 43,175,228,170,207, 61,200,123, -158,125, 59,223,252,200,189,124, 40, 21,117,155,233,180,222,137,134,130,128, 43,244, 51,148, 92,139,113,219, 66,150, 11,211,198, -208, 76,186, 65, 72,240,105,204,118, 70,152, 52, 9,149,169,192,206,235, 5, 61, 69, 24,204, 25,170, 74,163, 17, 59,245,174,247, - 59, 16, 82,219,194,100,162, 34,177,178,103,102,130, 21,151, 58,230, 72,103,111, 50,234,209, 13, 49,249, 67, 82,231, 46,201,139, - 42, 42, 38,201, 10,109, 38,136,250,179,155, 19, 97,113,230,231, 21,245,214, 39, 2, 44, 90,104, 99, 36, 56,139,203,133,128,138, -244,130,232, 20,159, 59,187,139,199, 85,117,191, 41, 13,161,209, 70,206, 59,131,207,186,205,212,250, 53, 4, 16, 39, 24,137, 4, - 23, 53,180, 35,109,148, 83,102,209,166, 53,142,130,177, 1,103,156,114,245,201, 18,216,182,130, 53, 14,201, 34,180, 6,103, 59, - 41,174,153,153,222, 45, 38,137,221,118, 18,166, 58,222,219, 24, 81,197,173, 81,184,218, 36,222,218,118,153,221, 73, 40,215, 21, - 96, 99,221, 83, 98,109,165, 91, 39,219,133, 24, 36, 37,150,201,236,108,229,100, 39,166,211,228, 46,237,150,186,226,107,172,234, - 14,100,214, 52,164, 28,129,122,155, 24, 18,174,152,186, 31,109, 86, 34,146,208, 3,133,244,211,148, 29,211,166,171,174, 43,180, -118,198,145,235,255,223,121,221,198, 52,196,182,221,161, 3,118,160, 13,141,240,141, 9,255,140, 9,250, 77,104, 66,239,105, 47, -225,233,207,125,109,250, 61,118,212,251, 34,230, 63,103,239, 75,216, 41,236, 18, 18, 54,171,150, 29, 1, 76,111,128,241, 45, 18, - 2,226, 3,249,160,175,127, 79, 18, 65,155,229,218, 84,164,166,200,185, 92, 97,253, 16,177,189,222, 78, 42, 89, 39,167,110,106, - 66,219,204,172,128,161,190, 76,104,181,137,200,251,125,112,249,108,201,150, 30,226, 77,154,113, 35,190,105, 48, 8,205,164,162, -218,222, 6, 31,112, 69, 70, 49, 55,207,242,193, 27,201,123,229, 12, 11,158,172,174, 17,124,132, 24,152,191,226, 10, 98, 12,180, -227, 9, 69, 81, 82,111,109,145, 21, 5, 54,119,180,147, 9,153,181,140,206,157,162,222,220,192,229, 37,115, 7,247,211,214, 21, -142, 30, 87, 60,247,125, 76,206,191,155,209,185,223, 35,196,140, 24,107,178, 44,231,198,155, 15,113,236,177,115,236, 27,246,185, - 56,105,102,203, 78,156, 85, 1,104,153,229, 44, 46, 44,226,195, 10, 34, 41,210, 58,161,115, 62,125, 30, 70,221,152, 20, 78, 41, -185, 42, 70,130,169,241, 81,181, 43,209, 70,154, 86,240, 49, 42, 29,152,132,188,154, 27, 47, 20,133,222, 66,105,231,150, 94, 78, -165,162,207, 62, 33,130, 33, 9,242,250,189,100, 97,171,147, 85, 61,232, 61,109,163,138,221, 76,145,108,106, 46, 53,151,157,148, -194, 65,211,166,159, 65,233, 73, 17,157,222,155, 70,169,170,106,170, 3, 44, 81,245, 30,253,158,165, 44, 44,101,169,168, 69,222, -128,153,139, 44, 45,233, 57,147,151,208,212,134,162,116,106,109, 43,108,130,253,133,188,232, 50, 60,180, 33,174, 90, 79, 12, 17, -239, 61,209, 7, 66,240, 84, 85,164,105, 35,155,219,194,100, 2,217,249,211,235,202,179,185, 20,133, 24, 59,195,190, 22,240, 68, -107,145, 37, 72, 35,203, 80,185,125,148,153,133, 63,118, 30,121, 50, 14, 94,113, 19,189, 50,231,252,202,163,120, 2,101,161, 31, -222,252, 96,142,107,111,124, 22,235,171,199,121,214,243,127,143, 43,246, 44, 19, 42,131, 43,247,194,228,126,252, 23, 62,137, 59, -112, 37, 50,191,196,214, 7,254,130,254, 93,175,164,247,244, 47,231,242, 71,223,199,133,179,176,253,233,223,230,224,211,111,226, -198,165,156, 23, 60,227, 48, 7,239,188, 11,191, 57,102,253,228, 89,154,209, 6, 11,195, 57, 30,120,114,133,215,191,226,133, 64, -100,245,196, 41,174,186,241, 58,166,213,132, 65,174,249,103, 87, 57,195, 11,174, 88,228,229, 31, 59,199,145,125,123, 24,251,192, -209,141, 45,158,252,212,223,177,247,224, 97,206, 30,125, 8,151,229,202, 99,250,134, 24, 34,209,171, 15,188, 43,228,221, 48, 51, -152, 95,224,187,190,231, 71,145,225, 60,127,255, 63, 63,197,207,253,228, 15,242,151,239,248, 19,122,100,108, 95, 94, 97,109,187, -226,170, 27,110, 98,208,179,124,230,145,135,217,211, 11,220,121,203,109,212, 4,246, 29,190,149,245,181, 13, 30,123,248, 81,174, - 58, 48,199,158,229,125, 56, 83, 96,203, 2,223, 52,228,195,140,250, 66,205,224,160,195,149, 37,206, 22,136, 29, 96,164,198, 13, -230, 9,213,148, 48,217, 34, 47,123, 60, 32, 13, 87, 46,238, 97,126,107,140, 17,225,241,211,103, 24,112,134,219,231,231,248,248, - 11, 95,193,139,159,113, 35, 31,114,143,239,236,219,241,169,171,141, 59,252,180,201,244, 66,175,107,157,162,155, 58,113, 85,173, - 22, 63,151,233,141, 50,157,234,141, 16,147,106,117, 60, 86,161, 86,145,153, 78,218,160, 95,157,242,212, 89, 97, 40, 68,109,145, -210, 26, 26,132,194, 26,154, 86, 39,125,151, 26,128,224,181, 97,192, 26,164,133,214,106, 93,179, 34,184,196,115,251, 86, 93, 24, - 89, 1,101, 58,246, 15, 31,180,156, 89,139, 24, 35,172,120,184,122, 20, 89,207, 45, 89, 31,100,170, 69,218,166, 3, 35, 0,158, -142, 35,215, 6, 33, 47,204, 44,169,206, 26,125, 61, 22,213, 13,116,249,203,173, 17, 92, 38,196,220, 16, 50,143,105,244,170,247, - 70, 69,122, 85, 38, 84,168,128,208, 98, 84,224, 22, 76,242, 98,167,176, 12,103,240, 24,172, 68,104, 2,209, 25,140, 81,206,187, -117,202,231, 71,117,231,167,253, 3,233,144,235, 4,152,102, 39, 41,139, 46,168, 39,206,186,136,196,111, 88,157,242, 69, 84,108, - 71,216,149,198,216,113,230, 9,146,238,172, 81,178, 43, 16,195,186,180,132, 46,238,172, 95,206,220, 44, 12,200,116,214,183, 84, - 96,101,150,138,149,242, 40, 58,136,223, 89, 36, 54,179,162,101, 18,133,208, 37,232,118,211,184, 32,216,108,144,148,236,237,142, -188, 59, 38, 46,213,116,162,188, 93,141,195, 44,130,208,164, 13,122, 41, 8,168,227,249, 19,253, 98, 51,221, 74,150,237,189,146, -165, 87,255, 8, 38,207,119,144,128,255,101,208,136, 36,232,202,236,202,183, 84,202, 68,234, 70,159,219, 26,245,196, 55, 21, 38, -207, 16,175,175, 49, 84, 13,110,216,135,214,167,215,105, 83,174,183,190, 23,116, 49,202, 33, 32, 77,163,191, 98,227,211,211, 4, -218, 74,171, 74,148,136, 52,109, 58, 75, 35,206, 90,218,105, 5,166, 81, 8, 59, 97,198,161,241, 72,108, 84,159, 16, 2,177, 85, -126, 57, 43,251,184, 57, 75,150,231,148,215, 47,147,245, 7,248,241, 8,155,229,140, 46, 94,160,169, 91, 6,123,246, 80,204,207, - 35,161,165,217,158,226,202,130,106,123, 68, 62,232, 19,154, 6, 67,160,191, 48, 71, 53, 30,211, 95,232, 83, 14,123,108, 28,187, -151,106,243, 26,246,223,114, 43,235,199,142, 82, 44, 46,209,219,247, 90,122, 7, 94,195,229, 7,222, 68,211,172, 80,150, 3,124, -200,169,166, 13,227,198,147, 91,141,142, 45, 18, 37,151, 57,199,194,220,144,195,215,222, 64,221,110,144, 37,232,154,160, 13,159, -147, 68,221, 97, 41,156, 90, 91,187,198,167,245, 66, 48,202,199,199,104,152,250, 72,140,208, 84,145,105,165,136, 26, 70, 27,113, -141,179, 37,233,115,152, 41,218,179, 76, 11,116,232,202, 92,158, 10,118,178,204,182,181,106,100,156,130,107, 52,162, 52, 92, 86, - 36,126, 61, 42,122, 23,155, 14,158, 87, 68, 46,115,250,247,182,130,232,101,214, 88,251, 6,234, 74,127,118,110, 8,101,105, 40, -114,167,195,131, 85,103, 72,177,207,205,182,210,181, 45, 20, 61, 75,145,155,153,106, 62,119, 59,104,128,106,142, 4,223,120, 70, -155,170,225,168,155,128, 15,129,182,137, 76, 39,194,100, 18,217, 28, 69, 46, 95,142,100,211,105,196,100,144,149,122,115,228, 9, -247, 15,162,240, 72,219, 36, 88, 62,232, 74, 60, 9,201, 3,152, 96, 55,107, 4, 95,235,247,181, 62, 50,218, 92,101,146, 67,221, -122, 21, 37,228,144, 25, 67,175, 63,228,170, 67,175,228,238, 47,125, 63,194, 89, 70, 31,255, 32,253,235,174, 7,223,135,139, 79, -194,210, 33,194,218, 89,166,143,222,199,226,183,252, 95, 52, 39,254,157, 75,255,244,143,156,252,232,199,120,193,143,125, 15,151, - 23, 39,124,250, 47,223,207,135,142, 94,228, 27,127,225,199,129,140,233,234, 10,213,180, 34, 47,122, 60,249,216, 73,222,255,224, - 73, 78,188,247,207,160,222, 98,114,121,133, 61, 87, 29,228,204,195, 79, 48, 40, 11,206, 24,203,111,247, 29,191,246,249,227, 28, - 3, 22, 86,215, 57, 1,108, 63,246, 9,170,170,101,107,253,146, 46, 11,104, 91, 66,208, 93,229,130,222, 76, 49, 65,129,182,131, - 29, 17, 38,107,151,184,247,194,148, 91,110, 60, 76,225, 28, 31,254,192,223, 83,108, 54,252,205,103, 62,206,202,246, 8, 4,110, - 59,119,158, 3, 87,236,229,251, 94,124, 59, 55,151,142,159,253,173,183,209, 78, 90, 94,253,197,207,230,214,167,223, 64,237, 43, - 6,229,126,130,159, 66, 61,197, 79, 39,216,126, 73,172, 44,243,135, 14, 80,173,174, 83, 46,238,101, 58, 10,170,211,241, 45,113, -186, 74, 86,244,176, 18,136, 89,201,198,201,227,156,223, 92,231, 7, 95,243,114,254,230, 31,254,133,131,133, 99, 62, 8, 31, 30, -143, 57,186, 61,226,182,181, 1,223,112,205, 13,252,217,254,199, 73, 49,204,248, 76, 47,116, 9, 32,233,226,105,131,170,208, 61, - 80, 77,212, 78, 81,228, 42,254,241, 94, 97,238,182,237,120,172,132, 28, 11, 84, 21, 76, 75,232,207,165,230, 47, 79, 69,211, 24, - 77, 68,179, 32,165, 81, 56, 91,146,186, 53,128,183,134,208, 64,183,232, 73,140,138, 62,172,213,231,235, 39,154, 32, 72, 82,212, -103, 10,207, 71,159,184, 48, 47, 92,251,188,130,207, 29,171, 24, 55,134,245, 8,219,103, 34,253, 59, 44,193, 26,165, 21,218,164, -138,109, 85,117,238,173, 96, 82,147,146, 57, 51, 83,178,250,144,108,124, 65,146, 40, 69,223, 15, 21,238, 65,139,161, 18,117, 96, - 20, 70, 5,127, 21,145, 41,145,137, 68,234,168, 54,193, 50, 55, 41, 3, 91,249,227, 40, 86,213,252, 33, 98,188,194,252,226, 5, - 83,234,137, 23,136,184, 34, 65,236, 30, 92,127,158, 80, 7,172, 76,149, 67,150, 78,231, 22,113, 9, 10,235,178,179, 73,211,249, - 78,238,175, 65,188,186, 87,204,172,222, 42, 94, 40,206, 97, 93, 42,248,187,114,172,159,146, 35,155,184, 94,146,210,182, 19,119, -105, 83,191,195, 51,203,110,143,187,176,203, 11,206, 14, 2,144, 38,121,161,155,140,227,236, 49, 58, 37,191,117, 5,110,238, 32, - 38,159,199,111,156, 64,226, 36,109,198, 75, 15, 29,163,234, 65,186, 8,177,110, 41, 71,202, 95, 55,236,108,120, 52, 89,182, 19, -238,149,233, 61,186,240,165,223, 65,113,205, 29,179,233,188, 83,247,119,121,225,122,165,119, 54,184,176,227, 85, 18,159,160,172, -134, 48,153,224,122,125,117, 2, 68, 65,188,162, 4, 82, 53, 10,134,148, 37, 12,242,153, 3,192,164,125,221,138, 38, 40,229, 33, -109,171,239,101,136, 41, 96, 69, 55,142,197, 16,212,157,144,101,170, 59,136,186, 29,205,132, 0, 46,199, 24,139, 43,115, 92, 86, - 18,234,169,126,222,206,226, 6,253,212,139, 69,252,180,194,149, 96, 51,139, 49, 66,185,103, 47,174,223,131, 44, 35,108,110,169, -243,100,115,157,232,133,222,242, 2,189,165, 69,178,254, 28,147, 75, 23,212,163, 25, 12,121,145, 19,234, 6, 19, 2, 54, 43, 65, - 34, 69,175,196,100, 25,205,100,196,100, 99, 13, 31, 44,142,192,242, 45,183, 51,221,216,192,143, 39,152,220,178,255,174,191, 97, -124,241,221,124,254,109,239,226,210,197, 85, 30, 61,179, 70,192,144,103,142, 54,209, 19, 18,133,185, 94,143,185,193, 28,115,123, -106,154,218, 43,159,222,245, 79, 33,233, 42,146,214,163, 75,185, 11, 65,136, 46, 16,124, 42,124, 34,180,168,157,218, 71,165,245, - 98,212, 73,218,153,157, 1, 37,164,224,179,216,104,248,139, 73,104, 64,103,180,192,130,245, 59, 34, 56,164, 75,199,131,105, 3, - 69,169,195, 79,219,202, 12, 9, 40,138,212, 75, 90,109,144,163,133,118, 42, 73,179, 99, 20, 21,116,170,112,151,132, 32,180,109, -146,160, 68,221,242,102,157,195, 26,209, 69, 51,185, 54, 9, 34, 58, 64, 97, 5, 35,234,191, 23, 4,103,147,240, 82, 4,107, 21, - 98, 15,109,100, 90,123,182,214, 61,227,198, 19,188,208,180, 17,103, 97, 52,137, 84, 85,100, 52, 82,248, 63, 11, 41, 12, 70,140, -190,248,180,164, 74,133, 81,149,116, 34, 79, 18,141,164, 89, 4,201,139, 28, 18,167,144,103, 10,223, 54,211,200,133,213, 75,244, - 7,122,184,229,185,193,181, 22, 50,225, 37,175,124, 39,251, 15, 60, 11,145,136,156,249, 2,205,198, 54,115,215, 62, 31,121,224, -253,152, 27,159,198,248, 3,255,200,226,221, 47, 96,254,174, 47,225,252,175,253, 32,199, 62,254, 40,207,120,227, 87,240,130,183, -124, 7,159,250,137,255,202, 35, 23, 90, 46, 4,225,145,211,107, 60,239, 53,175, 36,108,111,177,114,236, 81,104,167, 24,155,113, -234,252, 37,138, 97,193,222, 67,215,225,155,138,225,158,101,154,209,101,178,172,207, 32, 47,113,219, 35, 94,121,211, 1,238, 62, -190,194, 28,176, 10,252,234,119,127, 13,249, 96,158,209,214, 5,130, 68, 66, 83, 37, 75, 79,183,153, 43,204, 20,190,221,228, 38, -201,235,120,234,248, 9, 76,209,103,190,183,200,245, 87, 31,192,212, 53, 31,248,194,103, 88,217, 26,205,250,255, 39, 46,172,178, -239,210, 26, 91, 14,126,175,137,204,103,150, 26,184,249,142, 91,120,236,216, 81,174,222,191,128,115, 57,123, 14,236,165, 40,231, - 40,134,243,244,247, 44, 83,111,111,147,103, 22, 47,142, 80,169,103,195, 20, 37,185, 53,148,123,174,102,227,248, 61,100,131, 5, - 92, 90, 97,123,233,209,123,249,221, 15,124,148,155,126,248,187,249,227,119,190,143, 51, 43,235,220,208,207, 57, 81,181,124, 97, - 50,225,210, 99, 39,120,195,202,126,254,250,234,203,140,125, 36, 86, 96,134,201, 11,153, 46,246,182, 78,122,167, 86, 63,103, 27, - 96,154,146,147,156, 23, 85,190, 39,142, 61,132,157,112,133, 34, 29,194, 49,236,184,125,212, 91,222,229,198,107,182,129, 49, 42, -136, 9,146,248,113,195,172,211,141, 2,210,168,130, 51, 6,205, 67,144, 20,188, 17,173,217,225,222,188,166, 63, 89,160,200, 21, -146,190,246,160,227,232,147,158,104, 12,103,199,194,211,114, 67, 99, 19, 92,236,128,244,186,197,106, 94,122,110, 80,193, 80,170, - 21, 89, 42,130, 38, 68,196, 89,221,168, 20,226,204,242,231, 18,116,239, 50,168, 48, 52,201, 21, 48, 13,194,166, 13,140,129,224, -146, 66, 60, 53, 7, 74, 63,136, 78,230,193, 64, 43,170,242, 23, 65,252,142,130, 58,100, 65, 55, 67, 89, 33,230,170,114,207,172, - 83, 7, 64,183, 88, 65, 34, 6,167,112,123, 18, 34,170, 47, 49, 9,226,186,132,182,108,158,108,184,151, 48,185, 4,190,210,169, - 61,144, 60,254, 42, 5,181,166, 51,134,147, 66, 99, 84, 85,171, 30,242,164,104, 8,250, 94, 25, 31, 21,245,143,162,188,119,231, -109,199,166,180, 72,153,193,242, 70,146, 96, 46,134,153,160, 78, 11,103,212,205,125,214,238, 20,234, 78,117,153,244, 12,210,214, - 72,155, 82,235, 66, 80,104, 57,241,238,198,216, 89, 19, 19, 19, 60,221,137, 20, 49, 86, 21,191, 73, 68,100,173, 1,155,131, 43, - 88,126,227,207,165,253,223,102,150, 3,222,113,248,154,160,224,159,186, 88,222,184, 20, 19,214,133,107,120,226,116,170, 80,186, -247, 51, 21,190,201, 82,192, 79,209,219, 29,218,175,124,148,181,105, 18, 79,141,134,213,205,126,186,208,200,206,252,255, 49,132, -116,158, 4, 76,158, 67, 93,105,230, 64, 12, 10,211, 59,135,181, 25, 89, 79, 19, 78,154,201, 22, 89,222,195,230, 57,110, 48, 68, -218, 22, 49,130,248,128,205, 75,124, 53,193,149, 5,249,220,162,118,234,109,139,223,220,164,173,166,100, 69, 65,104, 35,217,160, -164,232,247,201,122, 3,218,177,158, 79,177,246, 72, 12,180,117,131,137, 94, 17,166, 40,248,122, 74,211,180, 52,163, 9,193,246, -201,231, 15, 17,170, 77,157,140,215, 55,200,135,125,154,237, 49,229,112, 64, 51, 30, 49, 56,240,122, 94,248,163, 95,193,187,127, -238, 45,124,234,129,227,244,246,239,155, 45, 25,113, 9, 73,233,149, 61, 14,238,187,138,229, 67,219,108, 62,105,245,172,109, 83, - 14, 69,167,159, 48,221, 94, 4, 65, 98,130,230, 61,248, 54, 82, 37, 24, 60, 26,213,204,212,181,204,196,117, 89,102,186, 94, 46, -105, 52,148,154,202,156, 54,187,157,127, 92,183,185, 41,210, 99,172, 78,210, 38,169,199,155, 78, 16,156, 65,147,118,136,249,105, - 90, 14,105,181, 37, 45,114, 67, 81, 38, 5,124,208,159,173, 42,125,236,188,132,249, 57,189,214,170, 73,114,144,213,187, 32,121, -209,166, 46, 26, 13,213, 41,186,160,171, 78, 28,235,245,189, 23,137,196,160,209,192, 38,165,184,182,141, 77, 12, 74, 36, 52,129, - 54, 4,166, 19,161,105,130, 42,248,173, 90,134,183,183,132,233, 40,173, 76,171,235,157,123, 44,179, 59, 77,124,119,168, 85, 19, -161,109,244, 80,239,151, 10, 33,100,185,126, 95,145,195,160,151,225, 10,181,250, 52,233,205, 14,181,118, 79,161, 53, 4, 31,249, -150,239, 62,193,190,253,207, 36,198, 6,204,113,194,230,132, 98,113, 8,231, 62, 73,220,188, 0,151, 30,133, 56,129,173, 75,156, -123,235, 79, 51, 58,181,194,243,127,224, 13, 44,190,241,167, 57,254,215,127,202,169,245,192,202,185,115, 92, 56,125,134,165,195, -123,113,115,203, 76, 86,206,209,159,235,177,176,119, 63,155, 43,151,249,236, 19, 43,188,252,217,183,128, 68,170,205, 77,218,118, -170,211, 11, 19,134,203,115,124,239, 48,231, 93, 23, 54, 82,158,190, 97,255,158, 33, 63,246,235,191,206,165,115,167, 9,193,211, - 86, 83, 61,216,108,183, 94, 81, 33, 56,233,160,177,168, 65, 18, 49,180,132,186, 33, 26,203,246,230,134, 30,114,227,134,237,245, - 21,206,174,235,227, 31,113,240,117,153,229,181,206,224, 36,242,233, 38, 50,200, 44, 23,125,228,101,175,124, 33,205,120,147,245, -141,109,246, 44,205,177,176,127,145,193,220,128,114,121, 30, 99, 60,182, 95, 40, 34,217, 31, 98,138,130,122,243, 50,229,124, 73, - 49,191, 31, 63, 89, 99,122,241, 17,250,251,175, 35, 31,238, 35,214, 99,242,249, 37, 6,123,174,100,253,212,227,252,192, 47,254, - 42, 15, 94,188,200,167, 79, 63,202,226, 13, 65, 62,172, 12, 0, 0, 32, 0, 73, 68, 65, 84,215,242,121,129,219, 50,199,253, 34, -124,116,180,206,183, 93, 58,192, 0,171, 80, 84,151,248, 22,180, 67, 21, 3, 77,163, 23,106,244,224,219, 29,207,112, 93,105, 39, - 91, 79,187,125,231,162, 16, 84, 18,125,133, 0,117,155,130, 29,124,242,124,219, 29, 68,213,167,107,169,219, 99,108,108, 82,168, - 38,126, 43, 19, 81,200, 53,161,158,161, 85,125, 7,214,224,172,166, 25, 22, 3, 24, 12,148,243, 74, 66,107, 66,136,220,245,226, -156,249,158,197, 3,151, 34,216,147,145,254,192, 80, 46, 90, 66,110,177, 61,139, 45, 84,148,233,173, 81,238,219,130, 36,120,220, - 38,242, 45, 26, 81, 38,220,104,248, 77,140, 66,219, 4, 90, 31,240, 68,106,137,108,167,201,124, 43, 6,214, 8,108,182,162, 69, - 62, 38,170, 32,169,211, 99,242, 91,135,168,194, 31, 9, 66,108, 2,177, 9,216, 86,104,167,113,182,166, 82,140, 32,185,193,228, - 16,226, 4,105, 39,152, 40, 73, 25,172, 80, 46,105, 5, 38, 81, 15, 8,131,138,243,180,230,170,160,203,149,243,184,229,171, 83, - 49,211,201,210,206, 44,103,187, 54,157,205, 50,235,101, 38, 57,158, 65,243,221,198,198,238,243, 16,147,158, 37, 5,163,116,161, - 52, 33, 50, 51, 70, 38, 94,218,216, 4,151,239,218,214, 96,173, 78,164,177,245, 59, 30,235,110, 87,125,108,241, 27, 39,105, 55, - 79,164,137,220, 37, 10, 96, 39, 80,102,103, 97,159, 75,121,252, 70, 41, 1,179, 51, 26, 75, 34, 58,197, 56,204,112,145,125,111, -250,239,152,172,252,207, 91,224,140, 81,232, 38, 76,119, 40,135,212,236,236, 80, 17,138,157, 74, 53,217,181, 87,200, 96,242, 28, - 83, 20,152,188, 80,213,104,247, 11, 11, 80, 79,192,183, 72,219,236, 74,207, 75, 66, 59,163,209,191,106,153,236, 38,243, 28,155, - 59, 92,174,118, 55, 87,228,250,167,215,195, 21, 61,178, 34, 35, 27,148, 90,208,167, 19,242,225, 28,249,158, 37,220,194, 18, 56, -135,160, 73,122, 18, 90, 32,144, 15, 23,200,231,247,232,175, 51, 30,225,199, 99,124, 53,193, 90, 75, 91,215,152, 76,233, 26, 91, -228, 90, 52,188,167,218,220, 82,126,190,141,186,168,200, 56,117, 9, 20, 25,211,241,132,118, 60, 98, 58,154,210, 54, 21,205,230, - 10,100, 37,245,246, 22,163,139, 43, 84, 27, 91,184, 94, 70,187, 61, 82, 43, 95,219, 96, 92,206, 55,252,210, 31,241,254,123, 63, -203,217, 11,171,108, 77,107,122,101, 65,140, 66,175,232,177, 60, 55,207,141, 71,142,112,242,228,111,226,125, 76, 58, 23,161,174, -132,105,173,133, 90,247, 67,105,100,109,167,161,137,181, 16,188, 66,244,222,107,144, 85, 12, 16,155, 36,164, 11, 66,227,181, 56, -234,144,169,245, 39,250,164,237, 73,103, 83,136, 9,237,235,166,249,164, 94,199,164, 44,136, 92,185,119,147,205,216, 39, 13,217, - 74,103, 92, 91,119, 60,250, 14, 18,102, 50, 69, 27,178, 28,134,125, 67,175, 48, 44, 12, 45, 75, 75,134,193, 64,135,194,122,154, -132,116, 77, 84, 20,210, 40, 12,223, 17,254,209, 11,117, 29, 25,143, 34,211, 58,224,219,180, 54,219,123,170,218,227,219, 72, 12, -129,182, 81,238, 28, 34, 77,163, 63, 83,183, 48,158, 68, 38,211, 72, 83,193,180,214,166, 7, 59,235,115,119, 18,114,186, 67,215, -102,202,177,250, 86,161,245,185,133, 33,183, 63,253,185, 28,186,106, 31, 36, 27,219,220,176,199,115,159,119, 7,215, 30, 90, 98, - 56, 52,228,185, 33,182, 90, 4,166, 99,200, 40,248,254,159, 88,161,236,245, 16,217,192, 52,247, 83,127,242, 31, 57,246,151,111, -199,111,173, 17,139,121,206,127,248,239,161, 14, 44, 62,235, 38, 78,255,213,187,121,236,157, 31,227,250,239,252, 30,122,175,254, - 63,217,122,215,127,227,145,127, 59, 65,187,189,205,149,119,221,193, 29,175,122, 21,207,186,235, 6,192,210, 76, 38, 44, 94,117, - 13,109, 27, 57,250,248,105, 62,125,234, 44,183, 28,222,175, 29, 60, 66,189, 61,102,241,138, 67, 64,159, 24, 45,223,115,203, 1, -126,117,212,144, 27,184, 24,133,223,249,185, 31,226,226,209, 7,213, 6, 50, 25,165, 0,126, 45,230, 18, 3, 18, 84,136,160,127, -215, 14, 74,154, 22, 95,215, 52,213,132,151,126,253, 55,113,219, 77,135, 25,109,174,114,126, 90, 81,236,191,146, 55,205, 13,248, -153,185,130, 27,129,149, 24,217,194,176, 97, 96, 79,102, 56,237, 35,111,252,234,151,240,210,231, 63,147,227, 39, 79,179,127,113, - 72,108, 3,153, 53,236,189,246, 90, 92, 97,232, 45, 93, 9, 33, 80,206,207, 43,196,101, 12,109,109,241,227, 17,227,149,147,184, - 98, 14, 59,119, 16, 63, 89,163, 88,152, 99,238,240, 45, 52,155, 23,241,211,117,242, 94,159,102, 58, 97,243,204, 41,230,251, 67, -222,243,224,195,156,127,244, 11,188,191, 13, 60,111,113,145,127,168, 91,222,122,121,133, 63,186,238, 43, 97, 87,161,118,187,166, -109,100,103,154,110,130, 22,248,182,214,155,162,169,181,232,182,181, 30,206,214,105, 1, 84, 97, 92, 42,102,201,150,210, 52,146, - 54,199, 36, 56,189, 86,158,201, 25,181,121, 89,209,102, 64, 15, 91,161,170, 52,157, 78,149,242,250,179, 77,173, 29,115, 8,201, -239,105, 20,218,239,231,202,139,229,168,111,188,152,131,131, 87, 90,230, 10,104,157,225,145, 11, 65,169,129,158,161, 55, 48,228, - 3, 48, 67,139,237, 27,108,143, 89,202, 85,183,125, 78, 82,242, 85, 76, 9,121, 49, 17,114, 18, 52, 4,199, 55, 26,194, 83, 25, - 97, 20, 3, 99, 34, 91, 68, 54,162, 70,195,214,187,182,199,153,168,139,134, 44,157, 78, 44, 65,232, 81,136,109, 36, 84, 59, 7, - 80, 59,141,132, 38,106,129,148,168,194, 69,163,106,117,135,193,120,189,142, 53,101,171, 43, 74,102,102,137, 50, 41,245,209, 25, -155,166,248, 26,191,122,156, 48, 78,141,166, 73,220,117,194,165, 59,139,154,236,222, 62,181,123,149,169,145, 93,139, 59, 82, 49, - 55, 59, 75,104, 76, 74,105,195,176,195,241,238,252,230,187,162,206,192,100,217,172, 40, 26,103,211,218, 78,221,198,161,145,183, - 9, 93,112, 86,209,130,184,139, 6, 48, 59,107,149, 59, 30,155, 20, 45,219, 33, 28, 70, 80,171, 24, 70, 53, 48,214,144,237, 59, -204,242,215,254,236,172,152,119,123,170,187, 53,159, 18, 70, 90,208,109,130, 34, 99,212,201,126, 54,165,163, 42,247,224, 19, 47, -159, 97,172, 42,143,245,100,111,244,102,136,237, 44, 46, 87,154, 90, 95, 83,166, 1, 62,177,109,102, 33, 53,161,170, 8,211,177, -114,233,193,235,159, 54,133,185,116,209,184, 81, 8,117, 77, 59, 25,235, 32, 50, 25,211, 86, 53,245,104,139,102, 60,194,229, 37, -214, 88,164,245, 72, 53,198,111,173,107,188,105, 83,205,236,115, 18, 90,218,205,117,218,173,109,218,241,152,208,212, 68,177, 52, -211,138,208, 4, 92,166, 11,138,178,254, 28,237,104, 76, 61, 30,107, 99,100, 13,190,110,176,198,224,131,199,228, 37,126, 90,107, -163,230,122,184,225,162, 38, 68, 58, 67, 59,221, 38,250,134,106, 99,141,208,180, 52,227,154, 40,134,208,122,124,163,175,127,178, -186,194,226,112, 31, 39,182,183,121,221, 87,188,156,199,158, 92, 97,208,235, 51, 63,156,227,250,107,143,112,224,170,147,169,135, - 76, 13,115,173,121,235,146,226,111,197,128, 79, 75, 81,186,189,227, 33,165,194,145,201,108,235,163, 79,121, 16,190,101,166,211, -176, 78,245, 48,157,201, 2,204, 14,170,156,156,142,157,162, 34,198,157,239, 13, 33,109,147,116, 26, 62, 19, 83, 98, 92,167, 55, -106, 91,245,162,183, 77,202,250,104,147,203,196,232,218,218,193,208, 48,236, 65,127, 96,152,155, 55, 44, 44, 25, 22, 22, 45,101, -207, 48,215,215,188,139, 60, 55,184,220, 98,115, 67, 81,102, 9,241,210, 83,162,242,176,185, 21,168,107, 73,195, 79,160,174, 61, - 33, 68,218,170,165,170, 91, 66, 8,196,224, 9,109,164,174, 52,106,183,245,145, 73,165, 5,190,154, 10,147,113, 84, 81,111,151, -143,225, 18, 4,106,173,134,119,152,212, 37, 77,182, 37,169, 86,245, 80,113,244, 24,230, 7,136,213, 49,178, 76,240,173, 97,126, -104,232,247, 2,229,208, 99,250,157, 15, 93,223,189, 94,182,135,239,255,161,251, 48, 97, 85,111,202,141,251, 89,121,215,123, 25, -238,159,227,134,151,190,152,242, 37, 95,198, 35,111,249, 94,174,253,170, 87,194,158,131, 60,242,243,255, 27,231,238,189,200,203, - 62,244, 81,204,210,179,169,238,253, 3,238,253,219,127,229, 69,191,244, 59,252,209,247,255, 0,123,202, 5,254,224, 93, 31,226, -223,142,126,128,250,252, 25,140,141,108, 94,184,200,147, 71, 31,229, 83, 15, 61,202,168,109,185,243,182, 35,248,233,136,188, 55, -100,186,185, 77,222,159,195,152,150,103,220,118,132,183,254,246,167, 40, 83,202, 80, 3, 60,231,121,207, 99,245,194,121,242, 44, -195,229, 69, 58,138, 83,126,177, 64, 76,197, 92, 59,108,237,162,124, 80,217,127,127, 97, 15,219,151,206,115,215,157,183,242,209, -143,126,146, 35, 79,222, 79,252,216,152,163,192,253,192, 4,184,193, 25, 78,196, 72,175, 95,176,218, 70,190,229, 43, 94,192, 75, -239,190,155,207,126,226, 19,152,216, 82,184,146,197,165, 69,174,184,241, 8,133, 43, 40,231, 22,177,121,137,201, 28, 33,142, 85, - 72, 85,228, 20,195,156,106, 20,152,219,219,163, 13, 61, 98,211, 80,109,172, 19,155, 17,249,226, 85,184,193, 18,237,116,132,177, - 27,184,222,242,108, 63,113,136,158, 43,142,220,206, 7,222,241, 86, 94,243,198, 55,243,179,203,123,248,231,205, 77,190,227,195, -239,231,247, 95,241,229,188,249,228, 63, 40,229,218,232,133,220,229, 48, 75,218,135,219, 65,200, 29,140, 43,113,182, 72,108,150, -123,236, 45,212, 83,109,178,219, 54, 9, 72,102, 55,150, 22,164,144, 4, 69,109, 43,184,158,153,165, 61,229, 70,139,120, 7, 99, - 6, 15,153,211,206,188,179,155,248,169,144, 13,212,153, 97, 51,157, 80,141,232, 13,110,103, 89,204,194,115,190, 36,231,253,111, -247, 76, 60,172, 8, 76, 30,243,244,239,200,136, 61,136, 77,202, 53,243,170,170,213,237, 67, 6,103,162,110, 79,179, 66,136,102, - 6,155,103,201,207,218,166,220,123,159, 34, 98,125,171, 30,255, 70,132, 41,170,248,143, 14, 82,234,247, 46, 65, 91,218,136,151, -226, 35, 5, 21, 17,198, 68,101,248, 20,162,170, 48,153, 65,140,197,244, 83,162, 90, 72,194, 56,175, 80,117,244, 22,187,123,165, -179, 40,156, 29, 53, 22,112,215, 74, 82, 33,110, 93, 74,161, 39, 73,247,145, 84,241, 97,107,131,119,125,232, 49,190,255, 55,190, -149,237,227, 99,194,250, 57,157, 80, 76,183,140, 65,215,186,234,155,156, 28, 0,146, 22,242,164,211, 79, 15,139,180, 18, 67, 52, - 73,207,152,157, 32, 28, 17,193,186,157, 84, 55, 73, 57,209, 42,160,179,179, 56,217,221,203, 90, 98, 12, 56,231, 52,137,171,131, -241,173, 69,162,217,201,134, 15,201, 56,220,165,127,152, 4,205, 23, 69, 10,233,177,136, 49,100,123,175,101,233, 53, 63,252,148, - 61,233, 59, 95, 83,119,136,164, 34,222,169,254, 19,170,224, 39, 90,232,103, 11,114, 83, 3,145,151, 80, 87, 79,125, 60,152, 5, - 60, 72, 85,165,197, 92, 45, 38, 10, 34, 1, 55, 24,208,172,175,171, 63, 59,203, 48,198,210,140, 54,144,144,220, 7,214,225,130, -167,217,174,136,226,241,117, 75,240, 26, 26, 19,117,156,196,228,142,188,236, 37, 4,102, 10, 49,226,186,230,193,101,196,166,193, - 55, 53,214, 56,166,211,203, 68, 31,112,121,142,177, 14, 95, 85, 26,186,147, 26, 36,133,109,133,114,126,145,122, 99, 77,209, 33, -137, 88,151,225,155, 6,231, 12,190,213,165, 56,190,173,241,211,134,122,218, 18, 37,195, 82,225,138, 66,151,118,133, 64,179,189, - 9, 2,211,205, 13,122,139,243,224,114,213, 14, 56,176,101,137, 17,139,224,185,252,248,227,252,230,219,222,205,235,223,240, 46, - 94,253,218,111,226,245, 47,123, 9,183,221,126, 4, 99,126,155,194, 42,125, 17, 90,245, 85, 75, 48,120,148,239,110, 66, 18,206, -122,168,219,136, 9, 66, 48, 6,211, 19, 98, 43,148,165,230, 78,100, 33,125,175,147, 46, 46, 64,151,198,164, 73,222,100,202,139, - 59, 35, 52,109,242,194,239,218,168,106, 19,141,156, 59,104,140,106,102,186,152,134,206,183, 30,162,210,128,130, 70, 73,199, 8, - 3, 39,248, 96,176, 94,117,103,136, 33, 26, 85,248,231, 61,221,123,210,235,165,184, 86,107,168, 26,131,117, 90,228,243,220, 80, -230,118,230,119, 15,162,126,242,173,141, 64, 61, 17, 69, 39, 8, 12,250, 70, 81, 72,107,152, 78,116,175,130,179,205,108,219,219, -157,207,255, 38,158, 46,142,170,110, 48,214, 81, 79,107,182, 55, 71,124,248,131,255,194,120,180,162,121, 36, 13,216,162, 48,244, - 74,171,220, 98, 18,192,153,228, 70,177, 14, 74,181, 95,114,121,117,147,207,253,251, 63,115,254,236, 26,133,181,244,122,134, 38, - 86,156,124,242, 97,196,141, 89, 88, 50,204, 47, 89,134,115,150,235,174,185,147,183,252,215, 99,200,165,207, 17, 46,159,134,199, -222,203,229,127,252, 0,143,127,250, 56,195,215,124, 7,249,129,101,214,254,244,183,105,234,150, 98,121, 47,143,255,210, 79,113, -225,115, 39,121,217,199, 62, 13, 75,119,225, 47,254, 13, 91,199,206, 51,124,250, 23,113,255,223,189,135,187,223,252, 3,124,225, -244, 57, 94,180,228, 40,247, 30,100,251,210,121, 12,134, 51, 71, 31,225,228,241,227,172, 85, 21,181, 15, 92,117,237, 85,196, 54, -224,219,134,222,160, 96,251,210, 38,203,135,246,114,205,193,189,124, 60, 29,164,222, 26,110, 63,180, 76,172, 42,252,104,155, 32, - 26,116, 16,131,199, 55, 26,241,232,235, 6, 95,213,248,186,162,169,107,154,186,193,183, 21,109, 85, 83,206,205,243,180, 87,191, -129,249,225, 18,119,255,251,191,242,173,235,231, 57, 61,157,240,158, 20, 18,210, 0, 79,203, 12,143,164, 60,225,181, 73,195,139, -111,189,158,175,251,234, 47,227,201, 19,167, 56,117,246, 60,165,115, 92,119,248, 10, 14, 92,123, 3,139, 7,247,177,112,211, 17, -202,125,251,177,101,142,205, 74, 98, 61,157,165, 81,185, 34,199, 56, 24, 93,218,160,186,124, 17,169, 71, 44,221,252, 28, 92,127, - 63, 25, 99,242,193, 34, 46, 43,105,182,183, 8,211,117,220,112, 64,181,118,153, 88, 55,255, 31, 89,111, 30,111,249, 85,150,249, -126,215, 90,191, 97, 15,103,159,177,230, 49,149,169,146, 0, 73,128, 4, 8, 1, 2, 36, 32,162, 68, 16,101,144,182,113,164, 5, -135,110,212, 30,108,187,111, 59,227,112,181,239,245,210, 40,173, 92, 80, 27, 69,188,128,104,163,128,128, 64, 66, 0,153, 50, 15, -149,154,135, 83,167,234,204,103, 15,191,105, 13,247,143,119,237,125, 10,229,243,201, 39, 64, 42,167,234,236,179,127,123,173,247, -121,159,231,251,208, 52, 13,175,126,243,143,114, 96,182,203,199, 54,214,185,228, 61, 51, 38,225,167, 62,253, 73,238,216,127, 43, -170,150,193, 67, 59,201,106, 78,210, 59, 62,154, 72,148,200, 78,130,129, 85,223, 22, 81,243, 49,242, 48,222,167,215,149, 72,246, - 33,114,152,235, 10,106, 27, 40, 10,145,201,148,138,185,241,228,138, 30,111,189,157,170, 10, 99,169, 44,126,254,122, 59,174,241, -213, 34,111, 27,161,174, 37, 29, 29, 85,210, 72,149, 82,242,240, 92,115,196,160, 77, 96, 4, 28, 63, 47, 24, 59,221, 9,146,117, - 79,164,148,200, 71, 87,245,184, 76, 36,213,106, 98,248, 36,126,184, 88,182,139, 70,188, 21,160,203,176,240,140,106, 79,237, 3, - 5,129, 50,145,172,169, 27,131, 82,196,211, 69, 74, 60,228,213,248,128,143,133, 36, 99,217, 48, 81,232, 41,141,201,140, 56,211, -157,252, 90, 21, 20,198,199, 8,140, 23,208, 74,162,141,176, 28,226, 46,118, 59,239,237,227,144, 60,158, 66,153,236,177,181,102, - 27,171, 21,127,239, 83,167, 47,243,248,200,243,246, 55,190,159,221,247,190,132,160, 35,191, 50,184,168, 58, 71, 99,155, 10,223, - 86, 75,169,148,150, 29,121,216,182,201,133, 32,151, 5,226,190,124, 60,142,203,197,207,203, 1, 61, 38,194,133,201,237, 46,210, - 85,199, 14,230, 16, 13,110, 26,111, 61, 42, 25, 79,255,105,140,152, 77,192,218,209,132, 23, 51,242,217, 20,202,100,130,150,213, -106,178,183, 54,115, 7, 38, 7,186,250, 54, 42,157, 34,132, 50,202, 28, 70,154, 54, 84, 18, 61,217, 89, 84, 23,106, 72, 90,114, -216,199,198, 48, 97, 3,103,114,139, 51, 10,149,104, 92,221,196,230,145,177,185,168,137,203, 96,217, 99,201, 26,199, 80,175,174, -224,170, 18, 99,132,250,101,203, 17,174,182, 17, 20, 34,111,170, 98, 99,157,114,176, 69, 51, 28,197, 55, 88,192, 53, 13,245, 96, - 32, 18,107, 0, 91, 85,216,186, 1,235, 80,193,225,157,195,213, 53,245,230, 6,245,160,143,171,106,234,178,192, 21, 13, 90, 41, - 92, 93,211,140, 70,184,178, 70,167, 50,158,102, 89, 78,210,238,144,118,218,146,228, 9, 30, 95, 55, 40,101,228, 2,225, 3, 42, - 75,241, 68, 70, 69,101,177, 62,144,228, 25,154,146, 36,207, 5, 9, 94, 59,108, 85, 83,110,109,208,191,116,129,225,197, 11,244, - 47, 92,164, 30,141,112,206, 98, 7, 67,170, 75, 43, 52,229,144,224, 3,157,249, 89, 70, 43,151,120,254,139, 95,197,153,243,199, -201,146, 30,215, 31,253, 52,153, 75, 72, 66, 2,181, 33,212,154, 80,169,184, 2, 84,219, 41, 28, 47,117,179, 62,210, 32,199, 57, -178, 36,135, 52, 27,171,200, 97,194, 83, 31, 7, 34,172, 19,239, 87, 24, 67, 5, 67,192, 90,181,237, 3, 53,227,211, 92,126,236, - 70,109, 87, 77,187,237, 71,101, 91, 9,136,180,184,177, 90, 88, 71,181,146,184,161, 25,183,192, 25, 35,251,241,118,166,232,118, - 52, 83, 29,195, 84,207,208,155,214,204,204,106,118,238,208,180, 91, 9,237,182, 33,205, 19,180, 54, 88,175, 41,202,192,176,111, - 25, 21,158,254, 48, 80, 87, 94,140,111,214, 81,215,142,173,141,134,245, 53,199, 86,223, 49, 24, 88,234,202, 81,214,150,213,229, - 51,124,229,254,191,225, 99,127,249, 1,254,254,227, 31,231,236,137, 51,252,227,103,238,227, 37, 47,186, 75,134, 48, 39,166,117, -221,203, 91, 98,183,215, 50,105, 91, 43,178,132,138, 36, 39, 21, 27,172,154,202,177,181, 54,196, 68,165, 46,213,138, 94, 79,209, -234,136,101,127,172,142, 93,123,253,119,240,134, 31,121,128,176,241, 77,124,109, 9,205,144,203,255,240,143, 92, 56,222,231,224, -157,183, 64,251, 8,193,180,120,226,239,190,201,158,155,175,101,227,171,247, 51,213,155,226,101,159,252, 20, 42,221,207,234,187, -238,226,161,159,255, 63,120,236,179, 15,113,234,145, 83,124,237,115, 95,224, 35, 63,245,211,124,103,167,224,182,107,247, 67,214, - 97,122,231, 62,234, 66,177,121,121,133, 4, 71, 89,213,120, 96,166, 55,141,141, 89,218,153,131,251,241,174,161,189, 99, 39,102, -102,150,119,253,187,123,153,159,157, 98,213, 5,238,126,230, 53,156,123,226,113, 41, 76,168, 42,188,141,187,242,186,164, 41, 71, - 52,213, 72,246, 73,101, 69, 83, 85, 84,131, 33,182,177,228,187,119,147,110,110,242,161, 93, 59,120,217, 13,183,243, 39, 23,150, -121,159,135,203, 46,208, 37,240,140, 52,193, 0, 39, 60,172, 1, 87, 95,189,159, 15,189,247,183,121,251,191,126, 29, 23,206, 95, -226,161,111,125,139,217,142,225,198,163,135,184,225,246,219,216,121,237, 53,244,174,190,129, 52,203,193, 53,248,122, 68, 48,134, -108,170, 75, 83, 84,216,170,166, 42,234, 40,149,228,168, 68, 28,108,163, 75,103,176,141,220,170,155,141, 75,180,119,238,197, 21, - 53,205,176,194, 36,109, 58,123,246, 80,172, 45,147,166, 41,131,181, 21,190,248,229,207,241,136,135,183,204, 76,243,201,178, 98, -183,119,188,174,156, 17,137,120,204,214,184, 2,200, 48,169, 11, 6,242,248,121,231,162,106,216,212,146,251,244,110, 59,222,134, -223,174, 94, 13,113,170,109,138,192,168, 63,193,100, 19,130, 18,143, 69,205, 68,246,110,236,182,236, 53,198, 59, 38,241,115, 60, -203,174,108, 7, 85,177,202, 80,131, 17,179,201, 88,253, 85,120,124,227,184,241,133, 9,237, 84,225, 2, 92,182, 96,159,178,242, -181,210, 64,229,197, 17, 91, 79, 92,173,146,115, 85,113,154, 13,102,251,112,146,102,209,200,237,142,107,215,166,146,181, 64,223, -122, 6, 4, 74, 37, 85,193,186, 21,192,200,107,148,165,178, 34,208,140,235, 23,245,246, 1,172,197,145,151, 76, 25,232,165,132, -110, 70,218, 78,208, 90, 75,105, 67,228,196,155,216,206,164, 99,173,113, 48, 26, 31, 77,104,218,232,109,172,234, 21, 57,103, 61, -105,251, 16,166,126,136,239,127, 55,236, 19,178, 17, 71, 95,118, 39,253, 62,140,122,240,219, 47,253, 41,118,189,227,103,197, 35, - 18,136, 74, 84,204,188,163,233,220,246,114,146,249,253,223,222, 75, 77,216,118,153, 71, 80,140,196,237,116,156,222,153,148,188, -140, 73,113, 97,252, 67, 87,223,238,142,159, 68,208, 98,108, 84, 41,169,183, 37, 26,225,226, 94, 39,186,228,245,164,221, 13, 19, - 39,249,177,162,230,229,215,169,206, 12,115,247,190,243,138, 67, 60, 78,213, 52, 4,202, 24, 29,136,157,152, 65, 73,156, 98, 44, - 69, 5, 7, 42,182,217,251, 74,114, 73, 38, 19, 0,131,143,144, 25,235,176,131,129,172, 9,210, 52, 42, 6, 78,148,136,248, 61, -106, 99,240,117, 77, 51, 28,224,157, 69, 27, 77, 83,150, 52,195, 1,245, 72, 88,240,222, 74,220,173, 25,141, 36,166,134,172,121, -170,173, 1,213,214, 0, 91, 84,168, 36,193, 24,131,171, 27, 92, 35,183,107,231, 60,245,168,198, 22, 21,174,174,113, 69,133, 43, - 43,108, 89, 17,108,131,119,241,159, 85, 21, 38, 49,180,102, 58, 36,173, 22,105, 39, 39,153,234,202,125,168,170,105,202, 66, 86, -136,222,211, 20, 67,124, 93,161,148,162, 30, 22, 84,197, 8,215, 52,248,198,226,157, 80, 88, 90,221, 46, 77, 81,226, 71, 21,190, - 28, 68,197, 73, 46, 5,163,149, 85, 58, 59,118, 98,235,134,186, 63, 32, 40, 69,213,223,100,243,196, 9, 70,151, 46, 81, 15, 7, - 4,101,112,161,161,165,115,254,224,227,127, 66, 86, 46,209, 73,218,194,165,183,160,173, 38, 13,154, 60,209,164, 90,147,199,247, -127, 29,149,170, 49, 60,198, 33,123,118, 19, 83, 48, 62, 38,175,136,110,117,125, 69,165,249,100,155,228,227,234, 75,122,193, 68, -249,139,221, 10,121, 91,214,202, 74,111,123,138,198, 59,248, 43,106,208, 39,102,224,224,196,115, 4,130,169, 30,127, 46, 54, 86, - 24,238,227,135, 93,199, 72,157,214,208,105, 43,186, 93,205,244,180,102,110, 62,101,118,198,208,202, 76,124,102, 20,182,241, 84, - 35,199,104,232, 25, 14, 5, 28,227,199,151,222,198, 51, 42, 44,253, 45,203,230,150,103, 99,195, 49, 24, 58,170,210, 81, 23,150, - 86,103,150,197,243, 75,212,101, 96,233,220,101,102,123,243, 44, 94,184, 44,230,186, 70,212,200,224, 3,250,186,235,111,101,207, -194, 28, 89, 34,150, 24, 29,111, 42, 42,104,116, 16, 20,231,120, 13, 20, 44, 36, 94,209,150, 53,210,228,246, 52,158,124,246,237, -190,157, 87,222,251, 33,124, 24, 81,159, 59, 71,117,254, 18,201,212, 28, 11,175,252, 94,124,107,154, 36,203, 81,116, 56,251,158, -223,198,162,152, 58,120,128,133,151,191,134,221,255,238, 87, 80, 51,207,101,235,175,254, 53, 15,127,109, 64,117,240, 14,254,233, -179,223,224,186, 35,211,252,251, 79,253, 37,191,241,119,239,103,125,179, 98,107,247, 60, 20, 35,234, 98,192,198, 37,145,224,203, -210,137,169, 11,176, 91,235,184,186,196,214, 13, 73,154, 99, 27, 75,146,230,116,123, 45,174,185,237, 57,188,250,230,163,148,192, -139,159,125, 3,139,103,207,202, 14,171, 24, 81, 13,134,241, 13, 94, 80, 13, 10,234, 97, 73, 85,148,212,131, 45,108,211,160,102, -167,177,143, 62,194,215, 95,253, 3,188,247, 95,255, 91,254,124,117,192,205,192,177,218,241, 61,185, 38, 85,112,219, 76,135, 19, -121,194, 49,160,234,182,248,205,183,126, 15,191,243,203, 63,199,234,233,179, 56, 2,223,250,242, 63, 49,219, 10, 60,231,134,107, -184,233,121,207,102,223, 77,207, 98,225,198,103,146,228, 45, 76,187,141,202,166, 99, 91, 80, 0, 82, 66,109,169,215,214,104,101, - 48,179,119, 7, 73,162, 72, 59, 59,168,251, 67,140,118, 36,227, 88,143,130,106,109,137,124,126, 15, 73,111, 14, 91, 12, 32, 40, -146, 78,143,193,165, 11,116,231,230,184,234,232,173,188,237,123, 95,193,199, 55,182,152,215,176,156,102,188,239,248,147, 28,237, -237,146, 12,243, 21, 77, 28, 46, 66,104,188, 31, 67,180,162,233, 43, 98, 98,131,151, 93,160,141, 82, 85,170,132,139,174, 67,220, - 61,149,178,131,110,130,228,187,155, 90,136, 79,206, 69,167,231,184, 47, 36,132,137, 89, 46, 73,193,199,210, 32,111,196,241,222, - 32, 82,185, 23,144,154,244, 73, 71,247,168,106, 71, 25,223,202,173,126,204,129,126,254, 11, 12,121, 10, 3,224,228,185,200,228, -143, 77, 74, 46, 62,249, 54,182,211,197, 0,209,164,251, 88,212,239, 48,249,122, 90,199, 80,171,150, 74,146,178, 17,233,188, 64, -166,117, 43,145,113,178, 68, 9, 53, 10, 69,162, 12, 36,102,187,117,204,164, 96, 4,232,146,118, 53,102, 42, 37,157,221, 73,123, -118, 39,170,211,198,116,212,246, 58,123,204, 92,159,128, 90,197,145, 62,169,147,116,209, 24,166,148, 76,188,241, 53, 12,113,175, -168,252,182,185, 53,184,192,223,126,238, 56,111,250,245, 71,120,240,115, 95,231, 53,119, 29, 34,177,240,247,235,176,254,193,255, -155,108,255,117,242,181,227,164,238, 26, 79,152,210,252,210,207,255, 26,143,159, 57, 78,122,232, 22,217,247, 58,105, 13, 11,147, - 4,155,152, 9,189,210,248,200,108, 80, 17, 22, 51,158,238,253,184,138, 77, 69, 34,221,248,122,160,181, 92, 10,198,197, 48,106, -236,130, 87,219,255, 60,198,182,148, 78,100,183,171, 53, 42, 53, 40,157,160,149, 35, 52, 35,113,185, 27,131,202, 90,204,127,255, - 47,253, 11, 67, 92, 8,245,246,212, 29,148, 76,232, 65, 95, 97,224,115, 87, 40, 18, 86, 14,116, 87, 67,222,149, 14,116, 39,134, - 64, 87,143,112,101,129,206, 90,232, 86, 46, 64, 25,219,108,147,240,242, 92,166,228,170,192,213, 69, 92,121, 40, 92,213,224,189, -195, 53, 2,138, 25, 3,197,109,105,105,202, 74, 76,147,214, 77,126,125,210,202, 49,105,130, 73, 83,188,147,169, 88, 25, 69,210, -238,136, 19, 62, 81, 36,173, 20,188,199,121,139, 78, 19, 73, 31,132,128,201,115,210, 78, 70,123,118,134,180,211, 22,216, 77,196, - 63, 6, 91, 99,203, 18, 87,202, 45,218, 22, 5,174, 42,113,222,161,116, 66, 57,232, 83, 87, 21,182,146,192,182,192,133, 44, 62, -194,112,154, 81, 9,174,194,214, 21,182, 24,160,108,131,179,150,225,198, 6,231,238,255, 34,155,167,142, 51,184,112,142,193,197, - 37,130, 49, 56,235, 25,109,108, 80,174,247,169, 7, 91,248, 70, 28,179,229,102,205,179,223,240,101, 76,147,160,109, 74,104, 52, - 9,154,169,150, 97, 42,211,100, 74, 86, 80, 38, 34,150,199, 67,130,137,224,171, 36,147,207, 31,235,174,248,203, 10,193, 52, 82, -111, 73,140, 52,159, 37,169,244, 79, 40, 35,215, 77,231,133,110,153,106,105, 72,243, 94, 97,155,136,138,213,178,122, 28,163,171, -125, 84, 86,205, 36,129, 35,111,153, 52,189,226,110,105, 34, 42, 86,203, 80,210,205,132,217,174,180,124,142,180, 82,133,209,138, -169,174, 98,102, 42, 78,232,137,196, 90,173, 13, 20,165,165, 28, 53, 12,135, 13,163,129, 12, 13,201,216, 48,108,161, 63,242, 20, - 67,207,230,166,103,208,247,140,250,158,205, 53,199,198,134,101,115,211,225,157,166, 59,181,139,178, 12,204,206,238,196, 5, 35, -170,134,141,119, 84,193,254,147, 24, 37, 21,145, 18,170,215,226, 50,108, 2,237, 86,143,178,168,193,149,212,181, 16,186,188,146, -253,102, 51, 38,232,148, 65, 96, 32, 93, 67,183,179,147,123,223,252,113, 66,216,192,157,253, 2,131, 71, 30,100,254,229,247, 82, -157, 63,137,125,226, 43,244, 47,175, 51,191,103,134,234,242, 87, 57,246,192, 5, 76,222, 37,187,229, 14, 66,177,132,154, 63, 74, -249,197, 95,228,137, 47,109,113,121,195,211,255,232, 39,120,219,175,255, 27,102,239,125, 53, 15,253,200,155,248,223, 15, 45,243, -177, 51, 27,124,224,231,222, 78,181,190,132,202, 90,244, 47,175,210,212, 14,163, 26,102,166, 91,176, 4,105,154, 82,141, 6,100, -237, 46,173,222, 52,229,168, 1,163,153,222,177,147, 36,171,249,206,187,110,103,126,118,134,147,199, 79,112,245,161, 3, 12,214, - 87,105, 59,135,201,107, 48, 34, 75,185,186,142,241,149,132,116,126,142,193,151,190,204,217,119,127,144,227,149,227, 62, 64,237, -219,133, 94,188,204,237, 63,250, 22,166,223,255, 65, 30,168, 60, 47,186,225, 90, 62,177,120,158,123,158,113, 29,239,250,177, 31, -164, 77,130,245,125,134,181,167, 51,151,242,228,131,143,160,221,136,219,159,127, 27, 87,223,126, 27,115, 71,174,161,189,176, 19, -157,183,168, 71, 35,116,154, 96,178, 60,230,130, 29, 73,175,199,240,216,211,236,124,214, 13, 44, 63,117,150, 98,116,150,164, 53, - 67,179,181, 38, 49,150,106,132,105,207,163,156,197,149, 3,124,210,166,187,243, 0, 77, 57,160, 26,246,201,123,211, 36,121, 27, -167,193,214, 13,253,197, 11,188,247, 35,159,224,167, 94,251, 42, 62,254,241,207, 49, 21, 2,247, 45, 95,230, 87,239,185,151, 19, -143,254, 13,185, 6, 23,205, 98, 54,230,194,205,216,213,108, 2, 76, 38,121,249, 96,108,154, 9,125, 19,111, 37,215, 30,116, 32, -109,171,120,211,149,137,178,142,178,243, 56, 18,105,146,184,186, 29,179,223,163, 35,126,108,160, 11, 58, 78, 92, 62, 54,194,141, - 33,114,209, 52,101, 98,132,200, 54, 50,161, 87,181, 60,172, 58,149,247,226,142,195,134,214, 55, 45, 85, 21, 56, 81,192, 53,103, - 29,106,151, 70, 5,201,204,183,186,219,172,115,239,181, 84, 44,186,128,201,229, 66,161, 98,224,216,152,104,206, 49,146,143,183, - 58, 76,226,118,227, 66, 7, 98,212, 74, 39,154, 12, 79,102, 20,237,222, 60,157,222, 12,211,105,139, 94,167, 7,171,139,120,183, - 14, 9,178, 54,200, 53,173,206, 28, 33,237,224, 66,137, 15, 77,116,126,199,153,216, 74,102, 87,181, 64,213, 49,121,213, 8, 1, - 79,155, 49,190, 85, 77,142,125,163,213, 36,138, 22, 38,192, 26,169, 66,125,225,109, 71,120,100,253, 24,239,248,228, 69, 62,252, -218, 67,124, 50, 79,217,151, 53,188,249,231, 63,195, 63, 60,248,223,185,240,161, 99,114,104, 70,185,242,255,250,253,251,248,219, -165, 17, 31,248,157, 47,114,250,190,215, 82,159,121, 56, 26,254, 34, 10, 86,171, 24,111, 83, 49,102,167,198,237, 64,242,130, 68, - 0,141,138,149,169,202, 36,223,102,202, 11, 99, 72, 78,132,234,248, 24,127,147,252, 56,219,108,117, 47,113,175, 16,119, 60, 65, - 75, 20,207,199, 94,120,185, 1, 6, 22,222,240,223,254,217,238,220, 94,113,180, 95,161,181,134,177,118, 18,182, 43,229,198, 55, - 33, 65,137, 9, 80,134, 32,221, 11,229, 8,173, 99, 25, 75, 34,151, 10, 95, 85,242,125,155, 68, 98,137, 10, 66, 89,136, 41, 45, - 54,179,121,231,226, 58,193, 16,170, 74, 34,132,145,251,238,109, 29,219,181,100,247, 11, 90,242,202, 89,134,181, 37,137, 78,100, -135,110, 20, 89, 39, 39,239,117, 37,123, 95,139,204,239, 98,134, 52,233,116,101,221, 99, 12, 38, 77, 8,206,145,246,102, 32,120, -252,152, 71,175,228, 82,228,170, 74, 46, 14,206, 98,135,210, 54,231,106,201,163,215,182, 18,101,175,106,100, 13,149,104, 70,133, - 40, 16,198, 64, 57, 44,192, 59,188,183,184, 98, 72, 93, 88,178,222, 20,222,116, 48,137,166,216,184, 76, 93, 13, 73,179, 46,166, -181, 73,146, 38,164,237, 54,206, 59,194,250, 58, 93,147, 80, 23,107,100,157,150, 92, 32,250,150,231,255,208,151,248,251,247,220, -138,115, 10,167, 60, 6, 65, 53,155,120, 65, 17,229, 72,161, 18, 47,211,120,144, 73, 91, 79,252, 36, 66, 37,141,253, 57,209,106, - 33, 0, 24,163,101,179,146,198,218,111,115, 69, 33,139,148, 10, 6, 76,182,109,228, 13, 49,161, 98, 35,159, 67,112,216, 74,152, - 43,118,123, 61,168,227, 10,186,149,203,159,133, 88,246,148,181,228,179,168,149, 73,220, 76,123,137,206,134,184, 46, 51, 89, 66, -150, 27, 25,128, 52,132, 90, 58,207,203, 26,138,194, 81, 22,194,131,111,181, 33, 73, 99, 76, 50,136,241,109, 88,137,171,125, 88, -200,159,163,170,161,174, 21, 73, 2, 95,250,194,103,184,229, 57, 47,230,142,231,245, 88,190,188,201,231,254,225,179,168,160,248, -210,253, 95, 2, 15, 85, 19, 15,245,227,199, 30, 36,224,132,100,165, 99,224,222, 43, 6,163,130,225,166,139, 31,208, 1,231, 53, -174,145, 60,177, 67,202, 45,170, 81,160,213, 54,216,198,243,214, 55,127, 10,138,115, 40, 10,138,175,127,145,133,187,190, 19, 22, - 14,162,142,125,153, 39, 31, 56, 73,113,169,228,236,234, 69, 14,253,224,143,177,232,115,204,200,145,230, 41, 79,255,254,251, 56, -242, 99,154, 47,253,222, 39, 88, 58, 63,226,218,217,134,231,253,213,239,176,248,151,127,202,255,248,201,119,177,213,155,227, 84, - 89,243,244,176,164,117,232, 0,118,216,103, 84,245,177,117,201,204,194, 60, 39,159, 94,228,204,202, 38, 11,237, 4, 92, 73,171, -211,197, 54, 53,182, 49,152, 76, 83,244, 75,178,169,156, 44,107,177,231,153,215,242,250,235, 15,242,161,191,248, 59, 46,173,173, -147, 77,245,168,170, 6,109,228, 80,245,182, 65,161, 72, 15,236, 39,251,214, 67,124,241,221,127,206,197,202, 49, 55,157, 49,170, - 28,255,230,167,126,152, 63,121,247,251,201, 14,237,225,177,175,222,143,189,241, 8,111,190,237, 6,174, 61,116, 45,223,151, 84, -236,123,206,173, 44,158, 91, 99,117,112,153, 61, 87, 95,195,233,135, 31,102,125,233, 2,161, 90,231,101,175,124, 9, 87,223,113, - 7,211, 87, 63, 3,101,140,168, 27, 73,134,162,166, 25,246,201,103, 23, 68, 98, 43, 11, 2,138,206,222, 61, 84,155, 91,116,102, - 59, 84, 91,144,228, 6,103, 83,146, 86, 23, 55,106, 80, 70, 14,183, 68,137,100,220,212, 67, 97, 92,175, 95,166,169, 43,166,119, -236, 33,233,116,105,250, 91,244,246,237,167,174, 10,222,253,215,159, 68,191,244,133,124,236, 11, 95,231,205,173,140,254,195, 79, -147,181, 98,237,245, 21,134,172,208,196,143,196,200,100,215,177, 17,205, 36,178,219, 22,185, 42, 76,118, 80, 42,141, 44,139, 56, -205,103,177, 15,216,123,145,187,196, 77, 44,180, 36,109,226,108,165, 21,169,130,202,199,126,241, 58, 82, 63,199,208, 23,167,176, - 73,160,147, 70, 74,148, 2,171,130, 84,160,102,224,106,133,175, 98,141,104, 16,249,206,123,207,237, 47, 50,124,230, 83,150, 38, -192,169, 99,158,253, 59,226, 52,158, 72,221,107,240,210,249,220, 54, 98, 14,181,196, 82, 6,163, 4, 33, 27, 87, 10,214,136, 58, -235,107, 41,172,105,188,196, 58,107, 39, 68,197, 36, 13,164, 10,118, 29,188,142,151,188,246,231, 57,120,237, 97,212,234, 34,126, -184, 33,251,238,188,141, 73, 83,108,146,176,181,121,129, 83,223,252, 63,105, 66,160,170, 22,241,141,194, 82,145,182,164,210, 85, - 41, 69,162,181, 72,203, 25,132, 68,190, 47, 67,116,182, 71, 62,127, 80,146,117, 39,254,221, 71,246,186,224, 92, 77, 36,189,201, -255,183,115, 71,143,153, 84,243,252,157,158,159,254,187,179,124,224,245,215,241, 19, 31,127,154,222,188,226, 29, 47,122, 39,191, -251,217,223,102,253,163, 31,151, 60,181,130, 87, 62,119, 15,159,248,196, 73,246,183,224, 79,126,225,183,120,253, 75,159, 33, 19, -241,216,101, 52,238,171,140,234,193,196, 43, 31,188,192,216, 98, 10, 64, 25,164,215,221,185,109,222,251, 63, 71,171, 79, 40,255, - 74,190, 7, 32, 4,131,158, 56,227, 19,180, 17,105,222, 68, 71,188,242, 54,114,141, 3,243,223,255, 95, 81,105,190,157, 61, 15, -225,159, 29,232,209,149, 72,126, 69,231,151,146, 79,222, 73,103,124,132,142, 55,101,124, 0, 28, 85,127,147, 36,154, 62,130,173, - 81, 89,142,175, 74,185,204,164, 25, 1, 43,198, 89,231, 8,182,150, 29,102, 99,177, 69, 25,179,255, 1,226,231,137,168, 94,141, - 24,215, 76,140,226, 89, 1, 31, 36, 19,204,109, 32,201,114,146, 52,141, 49,118,143, 78, 83,153, 76,139, 2,147,166, 49,227,239, - 38,148, 53,239, 28,105,187, 43,151,237, 36, 65, 27,131,173, 44, 58,203, 81,198,224,155, 50,254, 88, 44,174, 22,164,168, 10, 82, - 95,109,139, 82,192, 89,155, 3, 92, 85, 97,189,103,106,186, 71, 83,138,103, 72, 57, 71, 57,170,164,178, 54,213,184, 26,134, 91, - 5, 83, 51, 93,182,214,251, 36,173, 64,119, 58, 35,244,102,240,206,179,185,178,140,173, 10,102,174,186,138, 93, 7,175, 99,225, -234, 35, 52,195, 62,235,231,206,147,117, 90, 36,121, 14,222, 99,171,138,245,179,235,188,234, 29, 15,243,225,247, 28,141, 85,186, -177, 8, 9, 69, 43,141,249,115,194,132,253, 19, 33,231, 18, 43,139, 70,221,178,140,157, 35, 70,238,118, 58, 17, 70,138,214,219, -184, 1, 29,182, 27,114,165, 57, 49,140, 59,132, 98, 1,139,184, 65,108, 52,252,198,176,131,207,245,233,210, 0, 0, 32, 0, 73, - 68, 65, 84,180,225,197,178,166, 60,147,120,111,154, 43,122, 93,104, 79, 41,242, 92,172, 22,206, 10,235, 34,111, 43,166,114, 73, - 7,248, 70,104,155,218, 5,186, 61, 67,167,107,196,188,151,200,239, 89, 55,129,225,192,209,196,156,124,203, 64,107,218,144,183, - 21,137,150, 4, 76, 89,203,217,219, 12, 3,131,126,196,215, 6,168, 76,144,234,234, 68,241, 93,175,125, 9, 31,254,243,143, 80, -141,228,242,210,196,213,195,249,211, 23,169,107,177,136, 4, 2, 73, 89, 69,242, 91, 4,202,160, 69,114, 13,193, 82, 21,226, 70, -214, 65,246, 9,202,199,210,248, 16,205, 10,137,161, 42, 61, 63,247,142,175, 98, 47,157, 32,185,225, 86, 88,254, 22,189,215,191, - 19,255,181,143,161,155,139,244,171, 41,206,157,223,160, 92,188,200,212,141,215,114,241, 47,223,199,243, 94,124, 53, 7,110,186, - 1,242, 14,197,229, 45,158,252,159,239, 99,243,244, 37,246,229,138,219, 63,243, 69, 62,250,140,219,217,117,207,171, 57,107,218, - 84,195,146,129, 74,201,128,131, 55, 62,151,102,109,145,122,109,141,222,194, 78, 46,158, 56,193,163,199, 79,208,206, 18,218, 77, - 66,214,234,210,148, 3, 92,200,152,153,221,137,173, 3,199, 31,249, 2, 55,190,236, 59, 41,150, 23,233,206,206,145,183, 90,188, -241, 13,247,112,234,233, 69, 78,159, 62,195,212, 84,135, 78,187,133, 78, 51,194,204, 52,187, 70, 5, 79,254,248,187, 57, 95, 52, -220, 50, 55,197,109,135,186,252,167, 83,151,233, 3,159,126,247,251,121,245,139,159,197, 27,223,248, 50,102,247,221,192,176, 40, -233,111, 12, 41,251,235,204, 28,185,137,147, 15, 29,163,187,208,102,231,193,253, 92, 62,123,158,213,139,103, 88,191,180,196,221, -175,185,155, 61, 55,220,202,244,213,215,145,244,102,169, 54,214,105,237,216, 73,211, 31, 82,108,110,208,221, 53, 79,221,223, 68, - 39, 25,245,214, 22, 73, 59, 39,201, 18,134,203, 43,228,211, 29,234,114, 64,210, 78,209,202, 71, 90, 85, 71,104,112,214, 82, 85, - 5,169, 74,208,153, 37,105,101, 76,239, 62, 64, 83, 85,120, 13,126, 52,194, 22, 5,245, 86,159,217, 35, 87, 83, 23, 67,126,255, -243, 15,240,192,174, 93,156, 93,217,224,229, 42, 33,205, 69,222,206, 35, 67,195,232,128, 79,162,251,217, 73,211,208,184,136,203, -143,219,199,226, 33,153,152, 88,109, 24,163,109, 70, 65,187, 45,183,211,204,199, 1, 46, 50,213,179,108, 92,150, 34, 80, 26, 21, -119, 83,130,130,140, 14,214, 49,180, 34,246,187,171,248,112,142, 15, 90, 31, 39,120,165, 21, 73,166, 80,133,244, 14, 36,241, 82, -146,169,192,252, 46,205, 76, 27, 86,251,112,161, 10, 92, 95,121,138, 41, 21,121,224,210,188,228, 9, 4, 29, 80,120, 57,132,162, -196,236,226,225,165, 77,196,222, 70,243,152,143, 49,155, 52,198,200, 82,224,246,151,253, 16,175,252,222, 31, 71, 95,120,152,102, -115,137,230, 91,103,161,221,149, 3, 43, 56,116, 85, 16, 82, 41,242,152,239,236,102,254,117,127,193,153, 19,159,226,252,201,255, - 69, 72, 69,190, 11, 62, 16, 50,131, 50,178, 22,208, 38,224, 18,201,213,147, 72,113,131, 28,164,219,165, 97,147,245,176, 15,177, - 13, 76, 38,183,177, 68, 63,166,173,121,231,249,183,111,188,133,255,252,254,111,209,235,192,239,254,237,211,252,198, 27,111,230, - 63,253,175,135, 89,202,224, 23, 95,251, 11,252,218, 95,255, 17,235, 31,125, 31,222,121,158,121,221,110,118,182, 78, 50, 8,138, - 39,206, 91, 84,214,146, 55, 4,227,254, 92, 29, 25,235,102,155, 1,175,174, 44,103,185, 34,114,167,244, 4,250, 2,219,200,220, -224,213,182,153,109, 12,150, 49,102,187, 98, 53, 18,229, 68, 17, 50,232,116,220,175,173, 64,137,195,123,230,158, 31, 71,119,102, -255,217, 65, 14, 74,197, 54, 60, 21, 99, 26, 42,222, 16,199, 59, 42,154,237,165,171, 45,227, 13, 82,190,143, 96, 45,205,160,136, - 30,184, 10,237, 61,250, 10, 58, 30, 10,124, 53,154,212,211,142, 1, 50,214, 54, 52,195,130, 16, 99,121,226, 61, 24, 95, 92,228, - 66,166,244,248,117,113,104, 99, 72,162, 82, 48, 78,213,108,167, 6,100,100, 12, 77,141,115,141,100,199,199,187,230,162,148,250, -107,239,208, 90,227,154, 18,229, 83,146,212,196,206,120,189,221, 85, 31, 2,182,174,101,231,110,173, 24, 84,235,154, 96,107,154, -170,162, 41, 42,234,162, 68,107, 69,214, 50, 52,117, 33, 68, 57,239,177,141,197,123,135,247, 30,157,164, 20,195, 17, 73,158, 49, - 26, 22, 4, 52,202,246, 49,233, 30, 60,242, 30, 48,237, 12,175, 51,178,108,142, 11,143, 61,204,250,233, 19,132,114, 64,123,207, - 1,182,150, 46,178,112,228, 26, 76, 43,199, 57,139, 43, 71,172,157,245,188,225, 39,159,228, 79,223,125, 29,105, 38, 48, 24,117, -197, 78,220, 24,145,178,157,247,162,156,120, 38, 84,194,170,218,110,123, 36,200, 1,172,181,218, 86, 1,199,124,244, 8, 8,204, - 82,185, 12,140,149, 64,252,246,138,106,156, 65,143,220, 38,156,147, 36,142,142,191,206, 71, 48, 86,158, 67,214, 81,180, 59,138, -110, 75, 62, 63,116, 8,228,153,162,215,213,194,116, 79, 21,229, 48, 48,218,144,182,203, 52,215,164, 45,185,200,121,239,105, 42, - 79, 93,138,121, 41,139,221,234, 83, 93, 67,167,165,133, 21, 20,155, 50,141, 23,211,108, 93,201,106,179,140,107,239,224,228, 50, -161, 85,224,194,217, 21, 90,237, 57, 6, 91,107,226, 9, 10, 2,174,145,202, 93,249, 62, 76, 10, 73, 81, 9,122, 79,167, 50, 49, - 57, 43, 22,123,226,100,210,148,145,151, 27,155,178, 18, 45,100, 45, 49,201,122,222,241, 31, 63, 79,122,233, 17, 72,247, 17,150, -142,161,246,220,206,229, 63,250, 73,230,239,121, 51,229,137,251, 56,247,192, 38, 11,185,226,201,194, 65, 51, 32,243, 21, 43,195, -192,201, 15,127,142, 23,239,152,167,240,154,103, 61,239, 40,199,191,120,138, 67, 47,188,142, 79,188,236, 21,156,168,115,206,127, -254, 1,246, 78,117,120,170, 17,248,195, 45,151, 54, 81,131,243,148,253, 62,197,214, 22, 91,253, 45,106,231, 73, 84,206,226, 86, -193,205,251,103,105,202,130,180,213,193,110, 13,113,182, 97,184,126,153,195,207,184,153,188, 59,197, 96,169,161,179,107, 31,245, -214, 58,249,158,221, 60,239,166, 27,121,230, 90,197,218,137,199, 56,246,244, 25, 46,158, 91,228,192, 31,125,148,143,172, 13,152, - 55,176, 59, 55,252, 98, 89,179,126,182,226,157,183, 93,195, 61,223,255,106, 14,220,250, 2,150,143, 61,196,220,245,207, 98,115, -109, 64, 85, 59,202,114,200,204,129,195,172, 46, 46, 98, 90,154,238,244, 14,202, 81,201,242,241,167, 72,155,134,151,190,226,133, -236,191,229,118,166, 14, 31, 37,153,153,167, 90, 89,166,181,123, 47,213,202, 42,213, 96,200,212,174, 5,202,173, 1,157, 29, 11, -244, 47, 46,209, 20,125,166, 15,236,143,141, 83,176,118,226, 56, 83,123,246,144,180, 51, 70, 43, 5, 73,171, 34,168, 60, 22, 64, - 56,210,124, 22,103, 43,130,171,105, 74, 23, 15,224, 64,185,114, 9,211,233,145, 78,117,168,215, 55, 40, 55, 55, 72,123, 61,108, - 83,241,245,203,151,185,247,192, 62,190,114,225, 20,102,110,140, 98,221, 54,180,201, 52,173, 38,229, 91, 99,138,224,120,127, 69, -244, 94,140,119,167, 70, 9,152, 33,137, 38,148, 73, 14,212, 8,166, 53, 77, 35, 97, 78,111,155,188, 26, 63,110, 54,146,168,153, -247,219, 53,134, 42,129,212, 51,233,231,246, 94,162, 30, 10,137,145, 36, 65, 80,176, 58,145,137,199,228,177,226,194,105,130,243, -220,124,171,225,254, 47, 57, 86, 45,156,125,194,179,243,182, 4,221, 86, 36, 65,154,142,146,200, 19, 31,197, 41, 92,101,177, 88, -198,130, 73,164, 29, 9, 19, 72, 81, 20,209, 60,235,141, 38,113,142, 59,238,249, 9,238,249,158, 55, 18,150,142,227, 31,255,130, -124, 16,134,184, 20,171, 7, 34,193, 26, 37, 45,133,237,120,240, 52, 53, 6,205,225,125, 47,225,208, 51,222,202, 55, 62,243, 3, -148,197, 50, 73, 42,101, 53, 33, 26, 79, 67,252, 80, 11,122,188,175,142,238,124, 37, 23,107,167,182,217,235,168,168,152,196, 49, - 69,206, 65, 61, 57,116,116,112,124,228,147, 79,176,191,151, 80,244, 45,223,104,224,121,159, 63,198, 61,183, 44,240,247,143,173, -114,223,186,227, 63,188,246,109,252,234,187,222,194,232,241,227, 56, 20,207,158,111,241,217,149,146,203,193,161,146,156,208, 52, - 66,114, 51,250, 74,158,138, 76,206, 90, 77,154,217, 38, 25,250,176,205,171,143,187,140, 43, 38,117, 53,105,136, 83, 99,234,107, - 60,136, 38,229, 46, 17,231,170,146,100, 12,149,141,189,228,134,224, 60,237,231,188,154,116,223,209,127, 65,110, 87,255,172, 98, -246,219, 90,214,130,142, 19,122,172,238,243, 77, 52,227, 65,112, 66,145,243,214,226,198,220,209,104,134,243, 74,176,157, 62, 68, -201, 41, 42, 8, 42, 74,232, 62,196,184, 43,110, 18,215, 15, 77, 13, 73,130,117, 78,154,219,140,222, 30, 7,149,198, 43,217,165, -251, 70,246,238,184, 32, 62, 18, 87, 76,154,238,148, 50, 36,121, 75, 50,253,182,193, 58,185,240,248,166, 34,155,234, 17,172, 24, -239,210,172, 37, 82,124,154,225,202, 34, 18, 3,165,134, 51, 77,115,138, 81, 33, 81,195, 68,190, 94, 81,213, 40,173,169,155, 70, - 48,164,222,209,233,204,179,181,188, 66,171,219,161,238,247,197, 48,103, 45, 42, 81, 84,181,228,164,141,115, 4,101,104,154, 17, -173, 36,101,109,105,149,206,252, 2, 89,119,134,133, 35,207,228,194, 99, 15,114,242,107,247, 97,171, 62,221,233, 89,118,223,120, - 51,197,250, 58,221, 29,251, 81,105, 70,218,105,211, 50, 9,214, 90, 6,203,107,108, 45,101,252,224, 79, 30,227, 67,127,116, 29, -218, 10, 45,210, 7, 37, 83,167,151,203,125, 99,161,113,242,126, 72, 76, 60,112,195,152,215, 30, 97, 79, 42, 18,146,163,169, 77, -238,134,177,191,196,200, 75, 62,238, 42,137, 96,196, 73,116,118, 12,205,170, 43,249, 90,206, 49,137,163,134, 40, 70,101,169, 34, -203, 36,253,149,183,199, 37, 84, 82,118,214,238,106,166, 58, 26,147, 40,178, 84,250,209,117, 15, 76,166,232,116,117,140,223,130, - 87, 90,248,252,113,149,105,180,162,219,214,116, 59,137, 56,247,189, 39, 53,154, 38, 56,188,149,194,171,178,146,201,222, 85, 97, -194,175, 47,134, 66,103,221,183,235, 16,251, 95,125, 13, 69, 37,164, 66, 13,252,233, 7,254, 76,158,203, 16, 34,254, 26,146,225, -150, 44,241, 91,221, 64,226, 21, 69, 21,198,151, 88,185, 60, 58,121,184, 76,156,210, 74, 23, 72,219,144,182,224, 7,126,244,127, -176,239,224,126, 54, 62,253, 53,124,181, 66,239,230, 27, 73,221, 38,121,190,139,100,215,126,190,254,203,159,231,234, 91, 14,177, -120,205, 81, 70,143, 46,242,194,223,252, 37,126,229,214,215,177,235,250, 67, 60,227,232, 85,172, 28,127,154, 60,235,208,186,233, - 89, 76, 61,103,137, 47,127,233, 81,158,238, 43, 92,221, 48, 55,211,195,245, 50,190,114,108,145,231,236,152,161, 59,157,147,237, - 56, 64, 58,186,192,202,133,199,164,207,253,242, 34, 89,203, 48,213,202, 56,180, 48, 29,107, 99, 29, 58,213, 40,147, 97,146,148, -164,213, 34,216,138,188, 55,207,104,125,139,116,170,203,242,241,199,217,255,204, 91,184,124,234,107,220,240,221,175, 97,223,133, - 75, 84,131,130,206,207,255, 20,207,124,226, 4,201, 76, 78, 50, 61,203,155,106, 75,107, 97,129,193, 96,196,210,177,227,156, 59, -241, 20,179,123,118,161,242, 28,107, 55, 81, 73, 70,103,122, 39, 43,231,207,146,181, 82,230,246,236,166, 28, 14, 88, 58,113,156, -133,133, 54,187,111, 61,204,145, 59,239,166,117,240, 40,186,213,194, 14, 70, 56, 91, 99, 71, 91,100,243,243, 84,155,155,162, 33, -105,216, 90,188, 72, 83,150, 12, 23, 87,233,238,152,197,228, 93,121, 32,122, 59, 40, 55, 54,233, 44,204, 98,178, 22,213, 96,141, -180, 21, 72, 58,179, 20,163,138, 52, 53,212,253,117, 76,103, 6,109, 45, 38, 49,242, 48,229, 45, 66,204,114, 36, 83, 93,217, 79, - 90, 71,146,229, 52,117,201, 95,156, 58,201,239, 79,237,156,236,142,148,151,134, 36,231,182,153, 36,232,109,148,107, 98,174, 88, - 77,134,111,223, 57,137, 92, 25, 98, 64, 59, 86, 14, 26,249,159,217,248, 13, 30,165,180,128, 60, 72, 62,182,168, 69, 42,231,132, -195, 60,102,152,140, 37,182, 36, 85, 19,160, 4, 42,238,189,188, 48,143, 67,236, 42,110,130,228, 67,147, 76, 81, 13, 3, 59,246, - 41, 82, 3,149,131,203, 91,176, 43,139,223, 71, 84,156, 18,195,196,164, 34, 7,139,112,253, 85,144,107,125, 80, 1, 85,202, 65, -222,210, 30,139, 71, 39,109,222,250, 31, 63,206, 44,151,112, 79,252, 19,164, 25,206,122,124, 83,196,201, 69, 30, 22,145,195, 19, - 92, 51, 64, 85, 67, 89,181,196, 0,174,246, 53,106,180,201,109,119,253, 15, 78, 60,244,126, 86, 46,124, 82,234,196,147,152, 65, -199,160,146, 22,215,223,249,243,212,126, 68,189,120,138,102,241, 12,195,111,125,115, 34,193,143, 93,215,202,203,109,106,242,218, - 92,209,129,174, 18, 8, 62,225,193,197,134, 37, 7,123,115, 56,144,194,239, 94, 40,249,247,121,194,238,174,166,223,120,238, 91, -181,252,222,111,252,127,188,243, 63,191,141,226,241,175,241,195, 47, 62,196,103, 63,124,140,229,149, 13, 76,166,104, 10,143, 78, -146,137,180,174, 99, 46, 92, 77,250,221,245, 21,241,181, 49,240, 69, 79, 14,106, 53, 30,163, 98,138,102, 27,132,176, 29,187, 83, - 19,117, 92,161,243, 25, 57,224, 93, 33,184, 85, 98,219,154,115,180,174,189,141,169,155, 95,142,143,113,184,111,143,174,197,184, - 95, 24, 23,251,142,165,141,184, 91,247,110,187, 70, 85,169,152, 52,105,226,196,220, 96,155, 42,254,121,149,144,215,162, 14,235, - 3,184,200, 2, 85, 74,163,241,248,218, 99,235,134,166, 28, 97,178,150,236,205,189, 19, 71,121,108,171, 67,107,124, 85, 16,210, - 20,227, 77,116,250,139,212,236,106, 41,137,177,214, 10, 15, 28, 19,223,247,114, 25, 51,169,198, 86, 37,137,110, 75,171,154, 70, - 90,219, 8,216,209, 96, 82, 58,163,131, 69,167, 61,225,194,107, 8,190,217,230, 10, 16, 68,146, 55,154,208,136, 26, 81,151,141, -112, 24,210, 12,215, 4, 18,163, 37,103,221,202,169,171, 90,126, 44, 90,163,242,148, 4,205,104,176, 69,146, 38,226, 51,178, 13, -105,167,203, 96, 80,162,178,134,144,228, 4,147,176,244,212,195, 4,223,144, 79,119,241, 3,135,205,166,216, 88, 60,143, 27,149, -156,122,236,113,246, 94,115, 45,123,174, 63,202,212,158, 93, 36,105, 74,103,126, 26,215, 56,154, 17,188,249,109,199,249,224,123, -174, 35, 4,197,104,232,240, 45, 38,211,185,119, 16, 74,185, 77,215,245,182,154, 71,172, 5,103,172,224, 53, 1, 59,254,172,106, - 34,130, 32,139,159, 79,201,216, 29,175, 36,170, 23, 87,124,147,172,120,196, 71,123, 55,238, 87,152,244, 29,201, 68, 62, 30,100, -198,245,169,137,162,221,150,164, 74,158, 41,242,220,144,231,129, 68, 43, 92, 18, 83, 48,109,141, 74,197,167, 98, 98, 19, 38, 90, -209,238,106,156,149, 76,123,158, 8,114,217, 68,242, 91, 81, 53, 56,171,168,155,192, 96, 8,195, 81,116,228,199, 20,209, 56, 69, - 89, 55,129,255,249, 63,255, 4,109,100,119,158, 68, 80,149,142, 97,144, 36,141,143,150, 6, 61, 24,200, 77,160, 46, 53,163, 81, -160, 30, 41,170,161,196,143,196,198, 47,205, 89,120,105, 63,218,185, 71, 72, 67, 47,123,213,143,112,235, 29,111, 34,172, 29,195, -109,110,113,246, 27, 15, 74,140,103,176,193,204,235,223,192,197,247,252, 28,189,217, 89,170,141, 11,116,253, 58,223,255,179,111, -229,255,121,197, 15, 51,154,155,227,241,229,130, 37,223,194, 45, 92,205, 85,247,190,146,165, 47,127,131, 39,191,121,146, 77,159, -178, 82,212,156, 24, 20, 60,188, 82,242,199, 15,157,230,109, 71,119,243,179,183,238,229, 25,251,118,224, 71, 35, 76,222, 65,249, -148,102,107,133,189, 87, 93, 77, 43,209,204,228, 9, 47,120,198, 33, 6,253, 45, 65, 19,118,167, 8,214,146,117,102, 98,195, 18, -152,188, 77, 49,232, 99,140,102,255,179,158,207,168, 95, 96,218, 45, 6,235,107, 20,163,146,166,217,128,164,131,106, 43,102,246, - 31,193,168,156,129,202,185,112,122,145,162,168,112,102,138,222,252, 2,105,119, 71, 44,165,111, 24,108,141, 24,110,174,114,241, -177, 19, 28,186,238, 0,101,229,185,124,234, 36,135, 15,239,230,250,231,191,136,107, 94,250,157,180,246, 93, 43,123, 50,147,177, -121,246, 28, 58, 75, 73,102,246,176,246,248, 19,180,119, 46, 80,172,173, 74, 23,179,247, 12, 47,175, 49,189,111,129,203, 79, 29, -167,220, 92,163,216, 88, 37,237,165, 20,107, 67,236, 96,157,238,142, 30,206,181,113,205,128,128, 33, 56, 69,103,215, 30,218, 11, - 7,169,215, 46,115,249,169,135, 88, 59,119, 18,149,180,164, 66,179, 41,240,206, 98, 76, 6,105,142, 45,227,237, 93, 39,180, 84, -202,207, 44,159, 37, 36, 81,222,201,100,101,153,102,226, 32,205,243,237, 28,104,222,138, 12,248,200,108, 55,122,108, 28,145,253, -123, 24,163, 91,237,118,237,234,184,150,215, 24,137,167, 37,241,220,171, 27,145,156,172,133, 81,225, 9, 74,240,142, 4,113, 86, - 71,229,149, 86, 14,157,182, 60, 40,237,232,118,199, 68,188,107, 44,140,209, 70, 28,235, 89,166,162, 39, 4, 76,170, 33,211,116, -219,242, 48,172, 54, 72,100, 38, 17,249, 44, 49, 74,242,223, 78,204,104, 58, 64,158,233,232,118,151, 67, 66, 43, 69,146, 24, 34, -161,150,155,159,247,131,252,204,175,124,156,153,141,135,176, 75, 23,176,214,209,244, 55,104,250,171,216,162,194, 15,251,132,152, - 57, 38,120,194,112, 83,178,193,117,137, 27,108,224,134,171,216,205,203, 52, 75,103,113,203,103, 9,139, 79,113,205,209,215,115, -221,115,127, 11,221,120,180, 5, 26, 5,214,113,205,181,111,199,246,251,164,170,199,212,141,175, 96,199,119,253, 59, 14,252,194, - 31,162,210,100, 34,229,106, 37, 53,118, 99,159, 90,184,226,147, 78, 46, 41,114,248,254,192, 75,175,162,147,192,226, 8,134,241, -112,255,227,115, 3,246,105, 67, 10, 44,100,240,231,199,134,124,254, 79, 62,132,233, 76, 51, 53,211, 99,198,192, 82, 31,216,185, - 35,178,224, 99,188, 45,102,211,199,184, 83, 49,195,233, 8,139,245,219, 45, 50, 99,103, 83, 36,209, 4, 47,178,178, 23,119,163, - 28,158,113,242,159, 68,220,140,200,149, 58,159,198,116, 22, 80, 38,137, 46,120,153,215,147,157,135,232,189,248, 45,219,209,185, - 43,136,113,219,179,121, 29, 15,240, 38,122, 0,212, 54,250,117, 92, 53, 23,164, 82,203,149, 37,161, 41,113,182,194,150,101,156, -184,197,222, 28,156,196,207,130,146,245,150, 78, 82,233, 64,247, 50, 48,160,163,201, 79,169,184, 87, 23,199,184,196, 4, 29, 42, -145,242, 14,211,106,139, 47, 32, 32, 84,202, 88,190, 29,156, 37, 24, 81, 32, 2, 96,203,146,162, 63,144,174,245,184,138,208, 99, -198,169,146,229,111,136,113, 63, 41,131, 73,176,229,136,164, 59,141,175, 75,180, 54,130, 14,214,137,112,234,189,167, 25, 13,164, - 28,196, 57,156,119, 84,197, 8, 91,187, 8,252, 25,167, 12, 50,170,225, 8,111, 61, 78, 69,182,184,243,104, 99, 24, 12, 7,164, -121,134, 49, 10,147, 27,188,171,241,117,133,233,182, 9, 73,198,197, 39, 30,101,229,244, 49,116,171, 69,107,126,129,249, 67, 87, -177,112,248, 58,218,221, 30,197,218, 18,143, 62,244, 13, 78, 63,246, 16,107, 23,206,176,113,238, 20, 27,103,207, 64, 8,116,230, -230,232,237,217, 67,181,181, 73,214,158,229, 95,253,228, 73, 10,159, 80, 27, 65,113, 43,179,141, 44,150, 34,169,109, 84,181,109, -228, 98, 57,254,220,241,209,172,235, 99, 93,170,115,219,117,168,227,238, 18,233, 37,146,127,175,169, 67,252,107,220,213,190,237, - 33, 26, 31,162, 19,117, 72,143, 43,141, 5, 36, 99,162, 66,157,154,104,148, 51,144,166, 65, 94,159, 84,250,211,179,142,162,219, - 19,154,156,214,210,226,230,172,199, 36,134, 78, 59,165,221, 50,100,169, 38,205,140,164, 38,130, 20,160, 5, 23,168, 11,207,214, - 86,160, 42, 34,228,202,110, 11, 79,227,203,134,183, 80, 70,140,119,154, 68,106,161, 21,212,172, 15, 33, 38, 65, 3, 85, 21,208, -245, 80,178,124,213, 8,170,129,194,149, 10, 59,146,191,154, 38,106, 28,113, 74,218,189,123, 39,187,118,238, 97,118,110,154,215, -188,233,183,176,253,199, 8,143,124,150,108,166, 75,119,255, 85, 44,223,255, 5,137,131,176,131,222, 85,251,112,157, 29, 44,149, -123,185,238,237,111,228,233,207,125,129,229,149, 33,155, 94,179, 84,212, 44, 94, 94,231,232, 59,126,137,211,247,127,131,211,223, - 60,193,165,149, 13,212,230,144,205,202,115,243,174, 89,102, 58,109,190,242,219,239,224,251,238,190,133, 71, 31, 58,201,140,171, -112,202, 80,108,174,227, 29,204,239,221,203,226,233,147,220,112,221, 33,246,206,204,113,248,240, 62,218, 51, 61,105,204, 73, 12, -206, 54, 12,214, 47,137,219, 41, 70,119, 58,211, 11,180,122, 61,234,122,192,218,226, 34,115,251,118,179,181,186, 33,178,249,158, - 3, 12, 86,214,232,236, 62, 72,227, 36,243, 91,148, 5, 42,203,200,102,230,201,186, 25,214,167,108,174,109, 81, 12,134,232, 52, - 37, 81,150,186,134,169,217, 22, 13,134,229,167, 30,229,134,231,220,192,129,103,221,204,194,245,215,144,237, 62,132,158,154,130, - 36,163, 90, 94, 70,249,130,214,222, 35, 12,207, 60, 77,119,247, 60,253,165,139,116, 22,230, 25,174,172, 73,143,120,150,114,249, -212, 57,252,168,100,245,233,147,108, 46,158,166,169, 70,168,182,162,218,170, 25,109,173,146,166, 26, 91,105,108,177, 76,210, 89, - 96,253,228, 19,212, 91,203,180,230,230, 56,120,251, 75,233,204,204,179,121,225,164,100, 89,131,162,236,111, 81, 55, 53,190, 46, - 48,121, 78, 93, 22, 40,109,240,193,209,233,205,242,170,239,253, 25,201,116,198,202, 63,157,196,195, 59,153, 48, 64,136,145,235, -201,132, 62, 46, 79, 72, 98,125,170, 74, 4,181, 56,110,113, 51,169, 28,144, 89,174, 72,218, 10,157,171,137,103, 74,105, 97,247, - 57, 27,235, 18, 35,253, 33,104, 53,201,185,155,100, 60,165, 11, 29, 42,207,132,202,228, 35,237,169,172, 61, 77,228,244,143,123, -217,199,224, 21,157,200, 67,117,228,160, 60,140,125, 15,106, 61,200, 37,199,139,100,109,188,162,109, 12,218, 75,213,176,142, 93, -238, 74, 73, 9,133, 73, 4,198, 98, 8, 60,227,142,159,230,174,187,191,151,240,212, 87,176,131, 77,108, 57,196,217, 82,192, 34, - 85, 65,104, 10,233, 5, 40,183, 8,222, 18,219, 81, 9, 85,131, 43,135,212, 91, 43,212,171,107, 84,203,139, 56,223, 80,157, 63, -134,187,120, 26,127,230, 17,230,167,122, 92,123,199, 31, 96,106,135,169, 29,211,179,183,224, 75, 69,240, 37, 94, 41,170,167, 31, -160,124,236, 51,152,206, 62, 14,254,230,103,105,221,120,135, 76,227,248, 73,130, 64,212,240,232, 71, 80, 97,242,122, 66,224,232, -161, 29, 28,157,203,216,244,112,215,188,240,196,119,165,240,224, 80,242,200,179, 26,110,154,133, 95,255,220, 69,118,222,126, 11, -173, 78,139,110,166, 73,123,138,223,250,149, 15,202, 89, 56,238,103,143,209, 64,117,133,148, 62, 62,200, 39, 53,177, 38,146,224, -162,236,172, 98,191,184, 50, 18, 75,187,210, 52, 55,169, 37,141, 95, 39,248,128, 43,150,177,195, 37,188,173,163, 97,206,160,210, - 14,179,223,253,206, 43,170, 83,249, 54,115,156,236,209, 93, 36,252, 68,183,229, 21,147,252,228, 80,151,246, 14, 92,211,224,234, - 10,103, 27,236,104, 68, 83, 21,226,182,111,106, 49,170,122, 31, 65, 57, 78,128, 45,209,240,102,109,141, 43, 43,201,144, 91,217, -207,187,186,150, 60, 59, 74,170,112, 3, 17,233, 41, 95, 31, 45, 9, 0,193,154, 54,210,129,237, 60,182,172,112, 78,254,187,143, - 80, 27,111,173,224, 92, 91, 29,249, 99,155,120,154, 25, 77,210,238,160, 77, 34,127,142,170, 36,157,234,226,155, 82, 26,224,226, - 26, 65,141, 3,214,193, 99, 7, 5,222, 90,225,245, 55, 13,213,230, 16, 29, 2,202, 5,234,202,146,229, 57, 65, 67, 93, 54,241, -107, 54,114, 40, 26, 69, 89,148, 88,103, 41,183, 6, 36, 89, 34,253,221, 74,177,177,182, 65,127,125,133,209,250, 26, 23,207,157, - 33,239, 45, 80,141, 10,138,245, 21,234,209, 0,103, 71,108,156,126,156,181, 11, 23,217,218, 92,167, 53, 53,197,204,158,189,180, -231,231,153, 61,116, 8,101, 12,182,174,168,182,250,232, 36,161, 30, 85,224, 19,126,226, 63, 92,164,213,157,149, 11, 57,146,166, - 26,179, 42,136,165, 70, 62, 74,230,206,199,234,239, 56,136,140,255,185,155,168,128, 19,100, 67,140,160,137, 95,193,196, 0, 68, -237,226,196,191,125,191,155,228,219,253,132, 91, 17, 89, 53, 99, 37, 82, 9, 92,166,213, 18,169,189,219, 17,192,154,209,219,160, -195, 44, 19,112,149,191, 2,180, 28, 8,104,163,201,115, 67, 18, 63,191,148,150,181,141,179, 30,219,120,234,218, 83, 85,158,245, - 45, 47, 77,145, 74,190,142,242,219, 7,251,248,153, 75, 51,152,155,155,229,245,223,251, 90,222,248,134, 31,228,222,239,122, 45, -211,211,179, 2, 7,243,241,210, 50, 6, 39,186, 70, 83, 85,176,185, 5,131, 1, 52,141,162,169, 20,161, 84, 36, 78,145,122, 69, - 18,196,124,211,223, 88,231,252,169,147,252,204, 47,255, 13,132, 53,154, 79,253,191,232,171,110, 98,243,159, 62, 41, 93,176,209, -129,105,186,135, 41, 23, 79, 66,154,115,253,205, 7, 89,127,248, 97, 92, 93,243,239,239,251, 34,139, 27, 67,214,234,154,207, 63, -116, 2,197, 20,166, 41, 57,120,221, 1,172, 54,220,191, 82,242,123,239,124, 37,126,115,147, 59,205, 22,203,159,255, 12,155,231, -206,113,235,141,251,249,186,215,164,182,194,164, 57, 62,139,153,191, 90, 49, 55,191,139, 29, 51, 93,166,166,218,100, 83,179,148, -163, 1, 73,146, 98,235,154,249,189, 7,169, 70, 91, 56,103, 73,242, 54,193,104,146, 86, 27,103, 29,157,118, 78,111,223, 65,134, -203, 43, 76, 45, 28,192, 55,150,114,216,167, 42, 6,216,186,100,184,186, 70,162, 53,115, 7,175, 98,249,244, 57,242,169,105, 26, - 11,237,110,134,173, 45, 73,106,208,173, 30,235, 23, 46,112,244,249,215,210, 63,127,129, 3, 87,237, 98,215, 53, 55,209,217,181, -139,214,158,171,208, 89, 11, 84, 66,168,106,134, 75,151,152,127,246, 29, 44,125,249, 75,116,119,238,100,241,177, 39,232,238,156, -193,121,133, 43, 43, 86, 78,159, 99,216, 95, 39,159,202,241, 90, 97,171,138, 80, 90, 92, 53,130,166,226,220, 19,143,208, 20, 91, - 4, 45, 31, 76,195,229,203,120,187, 65,107,102, 7,222, 5,182, 46,156, 37,232, 4, 76, 78, 61,216,148, 10,191, 86,139, 44,239, -162,179, 22, 1, 69, 83,148,228,237,142, 32,129,147, 4,219, 52,188,238,135,126, 89,164,170, 40,181,143, 33, 66, 4,200, 19,201, -105,130, 76,238,201, 54, 34, 92, 46, 2,145,171,236, 98,127,177, 54,113,194,137, 3,147, 31,231, 77,195,182,201,206, 55,114,235, -246,241, 97,156,124, 78,251,109, 85, 54, 49, 76, 32, 51,114,187,141,187,123, 45,183, 84,145, 50,253,182,177, 37,246,114,168,232, - 67,208, 41,236,186, 46,161, 21, 91,151, 86, 47, 5, 92, 51,150, 45,229,198, 77,144,120,166, 74,228, 64,212,136,171,125,130,116, -209,138,219, 95,246,123, 60,231,217,207,195,159,121,140,166,182, 52,195, 18,183,185,130, 27, 20,184, 66, 84, 16,223, 52,132,186, -148,104, 84, 83,224,135,107,132,122,128, 31,173,203, 5,160,232, 99,203, 13,170,205, 21,134,143,124,133,226,242, 37,134,103, 30, -167,185,124, 30,123,230, 81,122,186,230,224,115,127, 15,106,207,174,249,239,198,214, 37, 1,141,219,188, 68,125,236,126,234,167, -238,163,248,236,239, 16, 46, 63,202,174, 31,249, 47,244,238,121,203,228, 18, 36,147,113, 68,176,106, 45, 50,127,162,162,194,173, -177, 42,240,182,215, 60,139,131, 93,197, 71, 46, 85,220,212, 78,112, 30, 14,181, 96, 65,195,238, 92,148, 8,151,195,131,239,251, - 11,118,191,252, 22,234,161, 39,247,129,191, 63, 61,100,107,121, 53,106,148,126, 66,136,155, 20,174,168,113,168, 88,111, 87,162, -142, 75, 78, 98,102, 61,140, 49,182,225, 10, 74,221,184, 12,197, 95, 81, 52,163, 20, 42,203, 81, 8,218, 80,167, 9, 42,107,163, - 76,194,220, 27,254,235,191,152,202,183,101,119, 27,221, 79,181,132,142,175, 36,136, 16,119, 74, 46,214, 15, 90,129,180,184, 98, -132, 45, 70, 52,163, 82,140,103, 72, 27,163,171, 43,188,179,132,186, 17,117, 97, 92,183,218,148,248,218,226,138, 42, 78, 76, 86, - 86, 72,241,160,111,170, 10, 91,215,232, 84, 99,178,244,138,170, 66,201,236,155, 52,145, 85, 73,144,114,168,224, 3,206, 71,215, -124, 93,225,227, 78,203,141, 31,130,200,203, 87, 17,176,227,108, 45, 90,113,240,248,224,132,107,145,102,148, 91,253,137, 73, 12, -109,228, 34, 20,215, 47,182,150,150,174,180,149, 83, 14, 6,212,117, 77, 8, 37,163,193, 72, 10, 67, 92, 77,177, 53,160,169,107, -202,162,162, 41, 10,154,170,164, 26,108, 82,110, 14,229,107, 56, 79,127, 48,146,131,210,180, 72,167,218,108,172, 15, 56,123,226, - 24, 54, 24,150,207,157,100,184,186,136, 81, 13,182,222,164,101, 2,169, 47, 24, 85, 21, 83,115,123,217,113,224, 8, 58, 73, 25, -173,111,176,122,226, 56, 43,199,143,115,233,161,135, 56,249,153,143,177,113,234, 24,174,182,108, 45, 46,178,124,226, 56, 63,250, -246, 39,185,238,250,123,177, 74, 38,107, 33, 69, 70,143, 23, 34, 55, 55,177,167,188,137,101, 45, 89, 22,239,106,113,125, 23,133, - 16,154, 42,160,116, 28, 24, 98,235,160,181,210,196,214, 52, 49,240, 80,199,152,155, 17,105,125,156, 65, 87,241,239,214,201, 90, - 79, 7, 49, 1,231, 45, 77,158,137, 4,159,166, 74,178,231,209,119,166, 9,210,117,129, 64,156,172, 11, 88, 43, 43, 15, 99, 20, -153,145,175,129,145, 88,237,112,104, 25, 13, 27,138, 65,195,104,228,104,154, 64,183, 5,211, 83,138, 78, 75,186, 45,210, 36, 76, -252, 43,198, 68, 22,150,133,239,184,231,229,124,245,129, 47,243,231,255,235,207,120,224,129, 7,120,233, 75, 94, 46, 9, 1, 27, -136,188, 34,130,135, 4,167,112, 94,246, 14, 74, 41,172, 14,100, 70,145,101,122,130,145, 76,140,162,165, 19, 84, 89,115,203, 93, -175,100,126,247, 53,156,127,247,219,217,113,244,106, 86,255,225, 19,236,124,213,171, 88,121,106,149, 19,159,254, 42, 11,175,253, - 1,216,122,130, 29,111,252, 25,248,236, 55,249,218, 95,125,145, 67,175,126, 1,173,253,251,120,240,111, 63,134,221,216,162,233, -118,168, 19, 8,163, 19,236,191,231,110, 62,246, 43,127,200,170,243,188,251, 93,111, 38,153, 81,156,169, 19,158,218, 80,180,251, -203, 28, 91,222,164,212,134,155,231,102,160, 61,205,112,237, 20,213, 96,157,233,217,221,244, 55, 87,216,181,119, 39,215, 94,181, - 7,133, 39,203,115,210,212,160,179, 14,205,214, 50,105, 43, 35,109,181, 32, 24,146, 84,147,119,218,168,164, 69,176, 57,189,107, - 14, 83,172, 13,104, 79,247, 40, 7,235,116, 23,118, 83,142, 2,105, 18,232,206,207, 97,203,128,201, 52,107,139,103,105, 79,119, - 88,191,124,145, 60, 77,241,180, 25,246,215, 9, 86,209, 20, 67,166,122,134,206,236, 46,102,231, 58,236,124,214, 77,212, 13,100, -179,179,177,209,169, 69,168, 75,138,213, 21,102,174, 61,204,230,201, 19,204, 93,123,152,213,179,231, 73,117, 67,190,235, 8,231, -239,255, 34,105,110,176, 85, 77,111, 71, 15,215,120,234,194, 50,220, 28, 82,109,173, 80,187,134,218,167,100, 89,155,102, 88, 82, -108,109,160, 76,142,171,106, 2,107,244,215,135,164, 89,155,170,172,184,244,200, 87,153,222,123, 21,249,204, 46,202,173, 45,218, - 89,142, 43,134, 36, 65,170, 91, 77,158, 99,109, 77,127,105, 13,141, 99,106,239, 94,140,201,184,237,206,215,243,149, 47,124, 4, -199, 21, 25,114, 7, 73, 30, 61, 62,106, 98, 80, 70,197, 72,114, 26,129, 52,227,156, 40, 65,164,245,186, 22, 7,102,150,201,164, - 60, 62,204, 85,116,176, 54,245,182, 76,159,197,232,138,201,133, 80,167,157,252,230,117, 9,173,116,156, 51,149, 93,121,154, 9, - 67,193,185, 64,170, 21,141, 11, 84, 54,200,141, 89, 11, 71, 65,155,136,164, 13,129, 44,147,201, 59, 79,225,204,229,192,156, 82, -152,212,147, 68, 86,179,119,226, 33, 48,169, 84, 61,170, 36,110, 98,227,180,249,220, 23,253, 6, 87,237,217,133, 59,245, 4,110, - 52,164,174,170,104, 28,107, 8, 20,242, 33,221, 88, 84,171,133, 81, 38,210,214, 32,232, 20,191,177,142,171, 11,188,243, 52,155, -155,216,193, 8,156,151,194,164, 44,199,110,100,212,155, 27,116,182,214, 81,104,166, 15, 31,197,223,242,159,169, 7,139, 52, 43, -125,212,220, 60,118,241,105,108, 83,145,237, 62,140,173, 43,138,207,255, 33,249, 13, 47, 98,246,158,215,145,236,188,154,245, 15, -191,139, 48,222, 73, 71,180,179, 48,221, 5, 51,139, 14, 24,165, 8,214,243,171,111,188,149,255,244,231,223,226,161,129,101, 46, -129, 22,176,171, 45,171, 9,235, 96,103, 10,239,189,239, 44, 79,125,236, 61,108,182,226,207, 55,131,223,252,155,135,249,245, 31, -191, 59,102,207, 67, 52,201,153,137,188, 25,198, 6,186, 43,235, 77,199,101, 39,113, 71, 29,198,184,217, 52,145, 41, 94, 93, 81, -126,237,199,124,249, 56, 81, 71,127, 73,136, 32,238,217,239,254,183,168, 36,219,222,153, 95, 9,153, 25,219,153, 93,132,199, 4, - 32,237,108, 79,229, 33,196, 58,175,134, 80, 75,145,138,171, 42,154, 98, 64, 61, 28,146,164, 57, 58, 49, 18, 3,171, 27,172,173, -100, 63, 26,207, 86, 99, 82,108, 85,224,154, 90, 36,238,104,157,182, 85,137,175, 36,238, 22,108,192,186,134, 52,207, 9,181,149, -172,146, 0, 13,208, 90,201, 69,193,104, 18, 45,187,118, 91, 85,147,239, 69,214, 73,105, 68, 37,199,213, 74,128,224,154, 9, 30, - 87, 69, 23,125, 8, 65, 80,179,206,209, 84, 37,157, 78, 75,208,181,200,206,223,228, 25,182, 9,232, 44,195,141, 68,145, 75,218, - 45, 70,235,235, 52,117, 77,119,174,195,230,165,101,108,211,208,106,117, 24,110,245,165, 57,204, 59,188,109,240,182,198,214, 53, -245, 96,139, 98,171, 79, 85,215, 76,237,152,195, 7,141,117, 22,237,193, 54, 21,167,142, 61,206,198,168, 97,247,238,221, 12, 55, - 87,152,153,217, 79, 43, 79,153,234,117, 40, 86,215,248,204, 63,126,133,222,238,125,188,252,165,119,112,244,249,207,102,110,239, - 62,178,249, 57,116,167, 3,209,252, 8,207, 65,121,135, 74,106, 90, 7,247,128, 50,248, 0,247,124,199, 31,145,183,167,121,226, -209, 63,149, 72,104, 34,206,120,173, 96,232, 3,174,158,244,224, 8,245, 55, 78,180,182, 17,210,175,109,182,135, 15,141,146,131, - 86, 75, 58,102,188,246, 27, 79,251, 54, 34,168, 37,247, 30, 38,241, 56, 27,219,119,211, 24,141, 75,148,162,147,106,218,137, 38, - 51,210,196,214,110, 25,146, 84, 38,227, 81, 25,177,216,117, 32,235,104, 18, 39,151, 42,103, 21, 73, 34,211,185,139, 43,172,166, -244, 84, 46, 80, 14,229, 57, 74, 51, 69,187, 45,229, 68,164, 10, 61,128, 94,207, 75, 17,218, 56,125, 20,205,126, 90,139, 89, 61, - 73, 20,203, 43,151, 80,192,229, 75,151,112, 22,202, 66,100,120,173,182, 49,182, 73,166, 52,181,147, 26, 75,145, 70,117,172, 30, -149, 23, 39, 49,154,116, 92, 86,161, 28,111,249,185, 15,177,244,193,183,211, 12, 45,173, 61, 71,176, 35,104, 61,239,167,113,159, -123, 11,243, 71,246,242,224,219,255, 21, 7,191,239,245, 44,124,199, 15,225, 7, 31, 65, 31,190,158,229,115,125, 54,207,158,225, -115, 31,189,159,255,246,186,103,114,241,198, 87,242, 35,191,242,123,176,177,194,234,250,136,165,188,203,109, 7, 61, 51, 71, 15, -240, 7, 63,253,251, 52, 83, 29,254,203,143,221,197, 7,254,224,239,200,186, 45,210, 0,231, 83, 5,137,165,169,161,211,237,210, - 84,142, 86,150,145,166, 41, 33, 56,218,221,105,178, 86, 11,165, 53,222,214,209, 77,171,232,204,206, 50, 90, 95,101,122,239, 97, -242, 25, 88,126,250, 73,188,114,184,114,192,214,198, 58,211,123,247,160, 76,155,186, 44,105, 79,207, 96,235,130,186,240,148,197, -144,110,222,195, 59,168,138,154,166,232,211,238,237,167, 24, 88,138,254, 38,123,175,186,142,165,147, 27,204,204,229,236, 61,122, - 35, 33,159, 66,117,102,104,169,128,233, 78,131,145, 29, 87,136,230, 43,211,221,193,234, 19, 15,112,245, 43,239,102,233,145, 71, - 56,252,226,187, 25,156, 62, 77,103,126,142,106, 80,144,229,134,114,107, 36, 18,141,181, 40,223,160, 13, 92,120,242, 52,117, 83, -177,176,119,158,162, 40,176, 77, 13, 42, 39,184,134,164,149,145, 38, 83,184,224,200, 90,179,244, 87,197, 31,160,149,103,246,224, -245,216,202,210,212,142,164,151, 81, 14,135,180,117,138, 78,115,122,187, 23,104,134, 67,124, 85, 18,210,148,183,254,204,123,249, -242,125, 31, 83, 33,186, 12, 0, 0, 32, 0, 73, 68, 65, 84,153,132,213, 67, 52,157,248,152, 77, 79,244,246, 13, 89,199, 29,212, -132,132, 20, 77, 33,227,174,128,241, 33, 46,239,151,128,183, 42,170,180,106,194,153,118, 99,174,187,147, 55,244, 24, 66, 22,227, -186, 36,185,236,188, 26, 43,187,167,196, 43,129,211, 68,163,221,152, 59,159,197, 28,185, 55, 17, 67,107,137,188,124, 69,146, 69, -182,188, 87, 12, 43,145,210,141, 17,224, 3,185, 66,121,143, 70,163,114, 35,135,159,242, 82,234,162, 3,187, 15,188,152,171, 14, - 92,141, 63,254, 45,108, 57,148,184,147, 29,197,178, 25,135, 15,154, 80, 15, 68,242,180, 21, 46,237,196, 46,235,145, 52, 68, 85, - 35,108,127, 72, 83, 21, 52,253,130,102,115, 64, 57,170, 49, 54, 96, 90, 41,105, 39, 35,171,166,168,214,214,152,113,142, 78, 8, -204, 30,185, 17,119,224, 78,182, 30,250, 85, 58,123, 15, 81, 46,157, 36,153,158,159,212,126,251,206, 14,236,234, 25,212,249,175, - 51,117,219, 11, 25,124,225, 16,205,165,179,178,247,136,211,221,248,192, 80,241,245, 32, 4, 84,106,104, 5,248,137, 23, 31,230, -189,247,157,225, 92, 9,207,154,146,201,167,142, 63, 43, 11,156, 45, 61,217, 20,100, 86,138,122, 20,240,116, 63,224,154, 33, 73, -222,139, 95,119,194,126,141,252,150, 49, 41,238, 10, 98,219,196,203, 23,198,140, 95,145,161,221,118,171, 70, 8,210,141, 78, 52, -150,133, 32, 77,110, 81,195,151,253,235,179, 95, 69,178,227,224,191,144,219,183,255,227,228, 79,222,148, 98,222,203, 58,219,124, -208,232,120, 15,197, 0,215, 84, 82, 44,227, 44, 85,191,143, 45, 11, 1,189,100,224,154, 26, 95,121,217, 69, 7, 4, 8, 20, 57, -248, 33,245, 52,163,161,188,151,243, 28, 69,160,169, 74,234,225, 16, 99,210, 88, 88,211,196, 38,189,248,156, 87,226, 15,144,239, -139,216,168,214,144,180, 51, 92,211,208,212,117,100,174, 39, 49,101,225,241, 54,136,127,195, 24,172,109,100, 39, 15, 88,107,133, - 26,169,196,128, 42,117,183, 18, 13,116,117, 51,169,135,182,213,128,150,153, 70,103, 25, 58,149, 11,146,206, 83,113,178, 59,143, -206, 19,124, 8,216, 96,208,121, 70,222,235,177, 57, 40, 8,186,193,151,130,154, 21, 84,172,116, 91,148, 69, 1, 42, 48,216, 88, -151,182,200,170, 32,203, 59,172, 46, 94,228,212,210, 37,208, 25,123,118,204,176,115,231, 52, 11,123,119,147,230, 57,243,121,202, -142, 35, 7,184,253,206,119,147,204,206, 69, 71,117, 1,245, 16, 46, 15,161,221,129,246, 84, 92, 6,143, 11, 31, 70, 40,103, 33, -107,163,243,140,208,154,226,101,175,248,125,246, 29,124, 41,127,253,209, 31, 38, 87, 26,219,120, 6,131,237,149,223, 88, 28, 74, -140,144, 34,147, 54,152, 60, 76,176,252,227,157,250,216, 69, 47,117,172,219, 62, 30,157,202, 35,154,164,242,121,230, 35,224,102, - 60,237,107, 45,195, 74,158, 41,178, 68, 98,108,179,115,154,118, 91, 72,149, 19,226,113,108,143, 43, 99, 83,154,247, 48,229, 3, -117,237,105,183,132,164,216,201,212, 36,106,215,184,152,143,111,196, 36,220,237, 40,186, 29, 35, 43,206, 0,182,114,196,193, 95, -136,121, 13,147, 38, 75, 31,132,249, 49,246, 36,237,221,179,135,165,165,139, 44, 44,236,137,208,156, 88,143, 93,111, 39, 54,205, -179, 14,116,126,105,140,116, 50, 42,186,251,140, 38, 83, 6,131, 72,149, 45, 45,175,230, 15,254,226, 7,216,217, 89,229,248, 7, -254, 26,125,240, 32, 59,158,255,124,178,231,124, 31, 79,255,194,157, 44,159,221,100,253,209, 83, 60,252,228,101,182, 54, 87,184, -254,222, 55,179,241,240,167,105,210,253,124,228, 47, 63,203,115,239,189,155,187,158,183,151, 11,223, 56,206,169, 66,179,122,254, - 12,223,125,195, 78,254,234,195,159,225,206,187,158,195,119,191,233, 78,126,253, 39,223,203,115,223,240, 93,172, 93,190,204,165, -115, 75, 92, 90,216,205,197,229, 13, 70, 70,115,120,231, 44,223,243,246,183,241,244,253, 95, 97,126,239, 46, 22,207, 92,166,216, - 90, 99,106,122,150,149,229,203,236,156, 51,236, 60,124,132,116,106,150, 36,107, 81, 13,135,228,221, 22,105,123,138,225,234, 6, - 1,143,201, 12, 89,107,154,106, 88, 49,183,127, 23,253,229, 13,230, 14,236, 97,245,204, 69,108, 83, 17, 84,160, 59, 51,197,230, -202, 38, 51,187,119, 80,143, 60,101, 57,224,210,233,147, 52,229, 6,123,174, 61, 66,146,103,116,167,122,212,253, 62,189,238, 20, - 71, 95,248, 92,124, 50, 69,107,118, 7,224, 73,122, 11, 52,235, 43,152,222, 12,120,133, 29,246,105, 45,236, 96,180,116,145,106, -115, 72, 61, 58,199,174,163,183,162,146,156,245, 83,103,240,174,102,180,185, 14, 42,208,153,157,163, 24,148,140,250,235,232, 52, -101,125,105,139, 39, 30,123, 24, 99,107, 70,245,144,165,227, 23,113,186,162, 26,246, 9, 62,176,177,178, 76, 89,142, 24,108, 46, -163, 66,139,225, 96,147,197,147, 15, 11,177, 42,155, 66,235,132,172, 59, 3, 90,211,221,177, 83,228, 79,219, 68, 96,130, 84,188, - 6, 20, 89,158,115,230,248,131, 92,186,112, 76, 76, 30,209, 77,153,165, 99,162, 91,124,152,198,184, 68, 45, 0,134,241,129,159, - 42, 72,178,113,108, 68,145,183,162,179, 61,102,202, 61,219,120,216, 16, 43,214, 90,121, 28,204, 34, 77, 77, 93,225,172,111,165, - 42, 26,244, 68,238,210, 17,204,162,144,189,145,138, 13, 74, 65, 9, 23,186,170, 3, 73,186,221,238, 22,162, 19,230,228,137,192, -104, 24,240, 5, 92,125,189,161, 51,165,201,123, 74,156,162, 68, 58, 92,158,196,245,131,236,221,243,246, 12,119,189,244, 87, 9, - 23,142,209,172,175, 75,230,191,216,194,142, 10,130,119,114, 16,120, 71,104, 42,240,134,224,170, 72, 87,211,132,122, 68, 40, 74, -145,120,203, 17,205,214,136,209,218, 38,229,160,166,236,215, 12,251, 53,222, 4,170,178,145, 2,161,173,130,114,109,149,180,149, -144,230, 45,204,206, 61, 84,107,155,180,231,103,169,206, 60, 78, 58, 63,143, 78, 51,116,107, 90, 82, 29,157,121, 76,104, 80,121, -206,212,221,255,134,254,231,254, 76,166,185,216,223,174,148,154, 56,201,213,183,103,188,216,177,208,229,252,210, 6,173,178,225, - 72, 7,150, 74,168,227, 57, 92,198,237,135,137, 69,104, 54,186,139, 27, 7,111,122,238, 94, 76,222,217,142,174,197,203,131, 30, -239,205,199,193,236,224,197,233, 31,145,175, 97,210,157, 62,110,146,139,174,117, 45, 61,235,147, 28,187, 22, 99, 89,208, 70,186, -189,209, 36,179, 59,152,125,249, 91, 39,203, 81,249, 61,220,118,213, 22, 33,118,163,215, 49,235, 30,205, 29, 49,162,134, 14,132, - 74, 14,112, 91, 22, 40, 5,213,214, 38,182,169,241, 77, 45,160, 22,192,149,163,137, 91,156, 68,203, 65,232, 45, 33,238,189,189, -107, 98,164, 77,156,235,245,104,136,139,165,222, 98,172, 76,196, 71,225, 99, 57,142,150,182, 58, 91,203,138,108,172, 46,120,107, - 99,135,142,149,122, 86,231,165, 99, 62, 49,177,255, 90, 97, 76, 58,121, 77,131,147, 18,151,241, 26, 37, 4, 41,156, 26,171, 50, -206, 73, 15,122,136,106,145, 73, 51, 76,187, 37,124,249, 98,136,111,106,170,162,192, 86, 5, 77,213, 80,141,162, 81,206, 90,112, - 53, 85, 37, 82, 62, 1,188,247, 98, 98, 12,144,207,204,144,119,218,212, 77,141, 78, 12, 58,214,220,174,173,174,240,191, 63,249, - 5,250,181,227,166,195,123,121,246,237,183,114,237, 45, 55,115,205,190,221,236,159,235,209,155,157,198,228, 25,122, 12, 86, 79, - 51, 98, 41,136,144, 92, 66,132, 78, 40,189,253, 35,116, 78, 62, 72, 90, 29, 81, 37,234,146, 80,151,236,216,115, 11,215,222,240, - 26, 30,126,240,125,216,184, 47,174,170,109,116,181, 54,144,119, 20, 89,220,171,167,153, 20, 61,185, 32, 7,121,146,170,137,177, -110,156,204,113,126,242, 22,141, 32, 26, 89,183, 5,183,173, 68,134,200,195,200, 82,145,193,123, 61,205,194, 78,205,204,140,161, -219,137,240,110, 37, 3, 71, 8, 66,176,220,234,123,182, 54, 3,101, 37,151, 4, 23,225, 71,157,150, 70, 25, 35,106,119,116,224, -215,165,195, 57, 72, 51, 77,167,147,144,165, 58,170, 13,158,218,130,171, 61,235,107,158,205, 13,113,193, 55,205,118,198, 94, 56, - 26,138,165,165,139,220,241,130, 23,241,130, 23, 60,159,185,249, 93,252,195,167,255,145,254,160,144,215,105, 28,171,180,144,120, - 47,102, 16, 99,140,192, 67, 82, 69,199,104, 82,163, 72,163,147, 53, 73, 20, 11, 59,246,112,211,157,175, 96,241,191,191,129,206, -117,207,100,126,119, 15,175, 15,161,235,243, 12,186,207, 99,225,197,211,228, 79,126,153, 81,107,154, 79,125,234, 81,190,139,132, -221,183,221,205,177, 95,123, 15,215, 61,251, 22, 30,253,230,227,252,216, 7,254,144, 79,127,240, 69, 92,119,231, 97,154,191,117, -252,250,175,253, 17,199, 6,129,159,253,212,223,240,199,175,124, 21, 87,223,115, 23,223,124,248, 24,183,119, 2,239,250,198, 34, -116,187,108,109, 21, 52, 1,126,232,229,207,133,160,201,242, 22,163,173, 1,117, 53,160,219,107, 83,214, 53,189,169,156,217,233, - 25,242, 78, 23,239, 28,217, 84, 15,191,178, 74,112,129,209,198, 58,190, 25,210,153, 57, 72, 93,214, 88, 59, 36,201, 12, 73,187, - 71,112, 22,147,180,169,135,155,244,186, 11, 76,205,205, 80,142, 60,155,203,171,108, 44, 95, 34, 49,255, 63, 93,239, 29,101,233, -117,151,233, 62,123,127,233,228, 83,185, 58,231, 86,183,114,176, 36,203,114,144,131, 44, 99, 28,193, 38,216, 88, 6,204,192,128, - 23, 44,102,102,153,176,128,203, 0,151,112, 49, 3,107, 76,158, 11,115,125, 49,120, 8,182,193,152,224, 36, 39,217,150,101, 89, - 86,206, 45,181,212,185,114,213,137, 95,218,225,254,177,247,119,170,196,112,123,173, 94,213,221,117,186,234,212, 9,223,254,133, -247,125, 94,183, 19,170, 69,150, 19,175,120, 53, 81,103,150,135, 63,243, 37, 78,222,122, 13,205, 43,174, 64,231, 57,241,212,172, - 83,109,106, 77,216,110, 98,181,113, 7, 58, 18,157,246,220,184, 86, 27,242,193,144,160, 86, 35,169,199,132,237, 25,150, 31,121, -144,114, 60, 32, 72, 66,116,105,216, 56,251, 44,251,174,185,158,241, 96, 68, 62,204, 48, 38,229,241, 71, 79, 19, 48,102,117, 35, -103,116,113,157,115, 43,171, 28, 93,155, 97,105, 77,113,169,191, 65, 18,213,105,214, 34,246,205,207, 49, 51,247, 2,211,211, 11, -100,217,136,116,248, 8,173,214, 20,251,175,127, 25,155, 23,207, 96, 6,238, 66,213,154,159, 33,138,155, 8, 44,209, 84,205,119, -118, 80,150, 37, 63,242,159,254, 7, 15,254,192,222, 73,156, 97,101, 53, 22,161,111,128,194,138, 81,238,247, 80,102,155, 69,130, -113, 35, 32, 2,183,254, 43, 50,119, 72,218, 76, 16,132,149, 34,219, 29,244, 81,232,198,194, 65,228,149,157, 98, 59, 57, 73, 38, -174, 58,173, 40,116, 2, 40,149, 37, 12,173, 35,104, 5,146, 0,141, 13, 4,177,103,194, 43,237,175, 27,218, 1,145,240, 58,173, -210,194,174, 26, 44,251, 93,154, 26,131,157,115, 7,183, 1,108, 36,144, 72, 55, 93, 80,206, 64, 21, 7,112,243,171,126, 25, 46, - 60, 69,177,178, 74, 57, 30, 96,178, 20, 53,206,220,197,175,200,157,122,217, 0, 38, 71, 16,186, 43, 77,233,252,199, 46,130, 83, - 97,242, 28,147, 41,138,222,144, 81,191, 36, 27, 21,140,122, 37,218, 56, 76,164, 54,134,233,121, 69, 49, 46,104, 77, 43,120,240, - 33,100, 92,163,129, 97,238,245,239,164, 56,245,109,146,185, 5, 8, 19,100,210,130, 90,151,144, 24,155,116,177, 73, 27,214,207, - 33,186,251,152,126,207, 47,179,241, 87,191,230, 14, 7,107,156,197, 44,148, 30,226,179, 99,103, 98,220,104,252, 71,239, 56,201, -127,255,235, 7,220,218, 55,112,106, 90, 35, 33,214,174, 91, 47,128, 92,121,237,132,132,253, 13,136,218,211,254,112,222,134,196, -136,202,115,174,156,218,123, 2,160,177,206,246,102,140,113, 97, 80,193, 54, 2,214,101,147,187,132, 61, 43, 93,250,153,155, 5, - 86,163,120,131, 13, 34,164,132,233,183,255,236,191, 43,138,171,130, 94,172, 85, 19,133,147, 53, 6, 17,239, 24, 17,161,160, 40, -252,120,218,169,169,243,126,143, 60, 29,185,179,197, 51, 68, 85,158,110, 71,248, 90,139,201, 75,116,158,185,215,134,209, 14, 70, -165,156, 69, 78,105, 69, 64, 60, 97, 7, 24, 44, 90, 41, 4, 22, 85,184,113,185,115,138,132, 94, 4, 85,184,187, 39, 37, 90,149, - 46,218,182,250, 9,132, 11,234,149,113,197,193, 55,110,202,164, 75,132, 13, 8, 43,175,147,206, 41,199, 46,114, 53, 12, 36, 97, - 82,115,130,182,172, 32,108, 72,202,209, 8, 17,133, 36,205,182, 75,102,179, 22, 83,164,174, 88, 41,114, 84,150,250, 93,121, 78, - 49,204,156,157,206, 24,198,195, 49, 90,185,221,153, 12, 2,226,122,205,123,237, 19,247,117,208,132, 73,136, 49,134,225,104,200, - 84,167,205,235,110,184,129,119,190,249, 45, 68,166,132, 86, 11, 99, 21,245,233, 41,207,127,246,138,177, 9, 73,197,159,160,113, -228, 99,106,171,220, 98,207,104, 53, 62,210,176,170,228,139,212,215,110, 62, 50,118,176,206,174,238, 33,126,230,231, 7,124,252, - 99, 63,204,195,223,254, 24, 82, 64,173, 30, 82, 20,138, 48,114,235,182,192, 99,163,221,119,179,142,117,225,213,238,186, 66, 18, - 40, 38,233,109,213,171, 73,238,204, 98, 23, 19, 16, 35,198,184, 6,214, 59,251,168,213,161,221,146,196,177,159, 64,102, 22,173, -133,163,182, 5,110,127,174, 53,164, 62,199, 92,149,142, 74, 87,171, 89, 2,233,192, 50, 86, 88, 66, 4,202, 24,172,149,212, 18, - 75, 28, 6,212, 26, 1, 82, 88, 74,165, 41,180,196, 42,195, 40,181,164, 35, 71,166, 43, 51,247, 51,168,204,101, 98, 68,145,155, -122,174,175,110,242,143,159,252, 7,183, 99, 47, 96,156, 90,167,220, 55, 30,190, 67,245, 61, 67,129, 84, 2,109, 45,181, 80,210, -138, 67,154,194, 61, 96,145, 20,228,170, 68,149,150,247,255,241,221,164, 95,254,111, 52,231,118,147,116, 15, 33, 35, 65, 48,123, -146,167,126,233,101, 28,251,241,191,229,238,159,123, 23, 87,126,231,109,172,254,203, 71, 28,192,254,254,191, 35,188,241,245,236, -185,236,175, 56,253,200, 58,255,235,158,135,121,223,102,143,153, 67,251,248,163,223,255,159,140,115,195, 19,189,140, 51,131,156, -103,255,236,143,153, 61,122,156,207,222,127,138, 63,253,196, 31,242,193, 31,251, 0, 63,248,206,203,185,251,190,199,120, 48,203, - 88,108, 36,200,110,147,236,194,115, 36,237, 6, 91,107,107, 4, 73, 68,216,232, 98, 41, 49,170, 36,238, 52,145,141, 14, 69,154, - 33,194, 4,105, 3,130, 64,144,143,198,116,247, 30, 70,171, 18, 33, 29, 84,163, 24, 14,124, 55,155, 16, 53,219, 36, 73,135,206, -226, 2, 82, 54,233,191,240, 56,163,229, 75,220,240,230, 91,208,166,205,249, 71, 78,211,238, 46, 32,227, 26,155,231, 46,113,237, -107, 94, 65, 99,126,129, 98, 60, 38,233,204,184,215,116,163,195,232,252, 25,218,115,215, 81,174, 92, 32, 94,216, 11,249, 8,163, - 10,146,118,155,115,223,186,159,249,163, 11,140, 55, 11,106,221, 5,202,254, 6,166,204, 93,247, 66,192,250,217,179, 28,187,249, -165,140, 55, 50,132, 77,233,204,205,115,241,153,231,232, 54, 35,166,167,246,209,235, 11,206, 62,243, 52,237,122,196, 70, 47, 71, - 74,201, 84, 28, 83, 90,193,233,165, 77,190,117,234, 2,253,178, 32, 17, 33, 97, 36, 17, 4,116, 63,249,101,222,244,249,187,248, -190,159,252, 0,205,122,141,233, 93, 11,136, 80,162, 84,142,213,130, 40,142,118,228, 46, 7,180,187,179,180,186,115,244,183,214, -220, 53,165, 74,192,196,137, 70, 28,144,197, 79, 83, 61,236, 65, 86,187,213, 42, 56,203, 95,240,210,220, 5, 46, 72,159, 96, 25, - 38,214, 49,155,165,152,196, 98, 11,223,225, 27, 49,209, 21, 57, 8,132, 15, 14, 18,222,163,154,212, 5, 74, 59, 82, 86, 18,184, -177, 87, 32,157, 80, 44,144, 16, 8, 67,174,157,181, 3,143,175, 69,187, 10,254,224, 62,201,189,143,105, 86,183, 28,126,164,217, - 9, 16,129, 65, 89,176,198, 37,190, 25, 4, 81, 3,210,145, 37,136,166,153, 10,219,148, 43,207,162,210, 33,122, 56, 64,103,153, - 83, 42,151,165, 83,180, 87,104, 86,173, 17,148, 72, 12,218,108,251, 98,172, 86, 24,173, 40,199, 99,242,145, 98,176,146,177,214, - 47,200, 50,205, 11, 35,133,212,150,151,221,176, 23, 49,219,101,102,183, 96,125,101, 76,250,244, 50, 97,251, 81,100,103,150,198, -169, 47, 19, 95,241,125,216, 11, 15,161, 11,141,104,204, 34,103, 15, 66,212,112,187,216, 32, 33,104,181,176,107,207,209,188,230, - 38,210, 43, 94, 70,250,196,125,238,208, 53, 59,184,230,222,250,102,124, 9, 47,131, 0, 35, 4,223,113,162,203,215, 78,247, 80, -118,155,191, 95,161,210,199, 59,248, 3, 2,248,169, 59,174,216, 6,171, 80,237,197, 61,215,221, 31, 10, 19,235,152,177,219, 7, -181,168, 50,209,141,247,170,251, 8,218, 29,225, 45,198, 71,150,138, 48,113,207,127, 28,130, 12,169, 95,247, 6, 23, 4,179, 99, -143,238,184,238,129,239, 88, 42,181,187,131,189,184, 3,222,239,209,141,114,228,180,193, 96, 2,141,209,217,152,180,223,119,207, -155,181, 72, 27, 33,173, 70, 25,231,131, 23, 17,148, 74, 77, 4,108,214,195, 18,180,111, 13, 93, 64,141, 36, 40, 21, 50, 10, 38, - 65, 44,194, 26, 31, 88, 99, 9, 66,103,193,211,186, 32,176, 33, 97,152,120,208, 73,137,209,206,206, 87, 9, 9,101,224, 0, 60, -166, 44, 17,177, 3,223, 24,109, 8,163, 8, 97, 52,121,233,108,106, 86, 88,108,169,145, 81,132, 9, 3,212,120,140, 41, 75,100, - 24, 56, 61,141, 42,145,214, 64, 91, 32,195, 24,132, 69,101, 25, 69, 58, 70,229, 57, 89,191,231, 2, 98,178,124,194,166,151, 34, - 96,156, 14, 17,196, 8, 97,145,113, 52, 9,215, 9,194, 0,227, 8,251,140,199, 25,221,118,157,183,220,254, 29, 4,132,164, 43, - 23, 9,209, 4,181, 16, 89,139,160, 62,237, 42,105, 47,146,156,168,107, 67,207,138,174, 78, 24, 17,186, 60,226, 64,186, 55,179, -159,212,108,243,129,212, 14, 5, 45,219,224, 11, 93, 98,135, 61,222,249,198,255,198, 91,222,252,251,220,127,255,223,242,153,127, -254, 53,180,217,152,140,192,181, 79, 44,116,248,106,247,186,180, 62,125, 80,123,241,172,246,126,117, 83,108, 83,142,149,241, 17, -203,202,227,167, 11,175, 31,154, 52, 25,130, 40, 22,212,234,130,118, 71,208,108,184,100, 73, 93,184,176,167,176, 38,145, 30, 53, - 91,133, 63,233, 18,108, 4, 53,159,113, 16, 70, 78,155, 35,173, 68,107,103, 69,172,215, 3,247,122, 15,188,200,206,175, 38,181, - 54,164,169,102,208, 55, 12, 71, 78,116,167,189, 84,164,226,212, 91, 31, 25, 29, 74, 71,153,147,129,155, 52,222,241,250,215,243, - 79,255,242,249,201,164, 33,144, 14, 28, 23, 74, 44, 34, 20, 68, 72,162, 64, 82, 23,146, 90, 32, 73, 36,132,161,164,208,154,151, -189,253,135, 72, 90, 37, 23, 31,121,130, 93,111,249,110, 54, 63,253, 89,166,223,255, 65, 46,253,253, 47,208,185,234,141,124,233, -199,223,193, 87, 30, 63,207, 45, 63,241, 19, 36,139,109, 46,223,123,132,108,239,229,180,250,151,216,115,235, 53,236, 91, 62,199, -235,110,185,158, 95,125,239, 79,240,253,223,251,122,222,223, 10,185,249, 21, 55,242,200,215, 30,230,195, 95,120,140,183,253,204, - 31,240,206,151,156,224,225, 11,107, 60,251,205,111,241, 91,159,125, 16,128,227,115, 29,154, 81,192,189,203,125,126,124,113,142, -124, 48,116,202,205, 81,143,124,184,133, 42, 51,162,164,134,202, 71, 52, 27, 83,110,231, 39, 37,233,230, 58, 81, 35, 70,198, 77, -162, 36, 69, 21, 5,148,134,250,204, 46,198,235,103,105,206,117, 65,132,180,231, 58,140,183,122,104, 97, 64,198,100,227, 1,221, -197,125, 52,234,109,146,233, 67, 92,124,252,105,172, 29, 17,119,119, 65, 16, 48,123,104, 63, 65,156, 32,194,132,250,226, 52,217, -234, 37,194,250, 20, 2, 73,251,200, 21,152, 52, 37,158, 93,196,166, 99,210,173, 77,176, 26, 25,198, 76,239,217,131, 26, 43,106, -141,132,120,102, 23,203,143, 61, 77,210,106, 32, 73,232,175, 45, 49,189, 56, 79,109,102,150,179,143, 62, 72,189,221,165,191,153, - 97, 44, 28,191,106, 63,131,141, 1,131,165, 37,114, 47,194, 88,217,220,164,159, 22, 28, 91,232, 32, 13, 52,195,128,250, 84,147, -180,172, 81,175,197,148, 38,160,208,138, 94, 90,240,199,255,240, 25,254,224,239,254,153, 43,247, 29, 98,207,226, 52,111,122,253, - 27,185,253,125, 63, 72, 50, 61,133, 16,241, 54, 45,219,229,141, 50,221,157, 33, 29,174, 97,119,128,101, 34, 33, 73, 2, 40,170, - 78,204,147,145, 18,151, 61,130, 18,150, 2,119,152,171,210,189,209,108, 32, 38,133,185,195, 14,251,160,152,220, 18,249, 93,119, - 32, 60, 77, 46,113, 59,175, 73,135, 93,184,157, 46, 2, 18, 81, 5,193, 56, 77, 71,105,182,173,107,206, 78,226,166, 0, 81,104, - 25,165, 78, 44, 23, 37,206,187,174,149,165,185, 40,217,232,107, 74, 11,115,137,227,187,107,229, 41,110,184, 93,101,228,145,173, -113, 44,185,238,150,159,134,165,179,168,113,138, 30,141, 48, 58, 71,149, 37,182, 84,232,241, 16,157,187, 3,196, 8,141, 29,100, -132,173, 38, 38,146, 48,220, 68, 37, 49,129,207,135,212, 74,161, 83,197,104, 35,101,163,151,179,180,165, 56, 53, 86,188,123,119, -147,253, 71,219, 48, 76,177, 79, 13,137,195,148,147,183,158, 36,189,238,118, 78,125,250, 46,130,224,110,194, 91, 95, 75,124,233, - 27,196,175,252, 49,138, 47,254, 17, 38, 12,177,131, 53,119, 72, 89,231,251,150,187, 47, 35,156, 90,192,246,206, 51,247, 67,191, -197,185,159,123,237,182,117,192,248, 80, 21,172,143, 85,149,219, 23, 89,224,208, 85,135,249,231,167, 30, 98,108, 32,247,231,127, - 44,157,143,221, 55, 76, 72,224,103,239, 56,193,137, 99,123,125, 48, 11,147, 46, 91,120,192,201, 36,153,205,167,171, 89, 49, 73, - 15,152,116,233, 24,177, 99,175, 34, 39, 30,108,227,253,223,248,240, 23, 25, 68, 32, 66,100,152,208,188,250, 53,158, 95, 47,119, -116,232,198, 97, 96, 43,176,140, 75,255, 64,231, 46, 69,205, 71,200, 97,203,194,165, 46,142,134,238,177,208,198,217,200, 4,104, -173,188,221, 53,242,214, 50,141,140, 35,103,251,242, 25,230,166,116, 98, 18, 33,165, 91,225, 76,172,113, 26, 35, 2, 68,197, 1, -192, 89,212,172, 41,182,187,119,107, 40,139, 2, 19, 66, 24,248, 3,210,128, 49,202, 39, 10,150,238,103,182,118, 50,113,208,165, -235,246, 43,226, 74,149, 76,103,149,246,235,192,128,192, 79,211,172, 86, 46, 89, 79, 65, 62,238, 57,143,134,204,105,239, 90, 68, - 21, 99, 39,162,203, 82,242,254,192,197, 72, 43,133, 42, 74,175,212,215,110, 39, 31,134,238,121,179,110,245,164,138,194,223,182, - 4, 18,130, 80,178,177,186,194,213,199, 15,114,229,245,215, 81,174,110,162,202,146,100,102, 22,185, 48,231,188,170, 97, 88,145, - 95, 92,232, 67, 28, 67,173,182,131, 26,229,159,239, 42,128, 92,250, 57,121, 24,111,211, 84,194,200,253,189,138, 89, 19,114, 91, -126,238,109,136,194, 91, 17, 19, 83,240,242,151,125, 15, 47,127,217,247, 82,104,131, 54, 5,229,120,147,126, 58, 98,117,245, 73, -150, 47, 62,202, 83, 79,252, 43,253,173,101,148, 30, 97, 52, 40,237,172,171, 70, 90,132,215, 7,137, 0, 84,238,235, 63, 95,131, -120,233,149,127,205, 11,130,216,173, 5,107, 9, 52,154,174,248,178,214, 53, 21,101,225, 66,174,172,177, 24,229, 10,192,178,112, - 44,250, 73,120,140, 79,104, 19, 82,120, 13, 64, 21, 5, 28, 98,132, 75,165,180,184,175,103,180, 35,185,230, 99, 67,175,103,217, -234, 89,210,177, 37,245,147, 69, 97,157, 96,175,194,230, 86,137,216,210,155, 59,132,129, 47,124,225,243,132, 98,123, 45, 81,150, -194,133,113,189,244, 88,235, 87,132,117, 10,191,110, 18, 50, 95,175,209,137, 2, 98, 9,153,133, 82, 4,188,255,247,254, 14, 53, -122,156, 72, 37,200,225, 11,180,222,249, 65, 70,159,251, 93, 46,158,137,184,231,115, 95,227,154,215, 94,199, 21,111,123, 23,127, -254,179,191,196, 91,255,243,251,248,181, 15,126,148, 59, 63,240, 35,132,231, 31, 70, 30,188,140,167,254,215,199,121,122,105,204, -129,110,192, 43,223,252,122,230, 14,206,243,225, 63,250, 4,229,174,253, 28, 60,121, 25,135, 22,102, 72,154, 17, 31,185,239, 73, - 94,119, 98, 15,199,235,146,229, 81, 70,163,213,224,224,158, 57,164,128, 55,189,250, 58,106, 73, 72,173,187,200,218,249, 11,196, - 73,131,124,220, 71,134,130,108, 52,230,154, 27,175,167,190,251, 48,189, 75,167,105, 76,207, 96, 84, 73, 16,198, 46,173,172,204, - 9,146, 26,197,176, 79,144,212,208,165,243,160,134, 81,157,149,103,159, 97,254,232, 97, 46, 61,250, 0, 73,171, 69,148,212, 72, -186, 93,134,107, 91,164, 91,107,204, 30,216, 71,107, 97, 55, 66, 7, 68,173, 6, 97,210, 36, 72, 34, 76, 81, 16,214, 26, 4,141, -166,123, 17,214,155,216,210,101,179,247, 94,112,135,118,125,102,142,188, 63, 32,237,245,176,166,164,189,107, 1,163, 5,171,207, -156, 34,136,107, 44,157, 58, 69,210, 74, 16, 2,198, 27, 61,242,209,128, 48, 14, 57,251,212, 41, 58,179, 13, 52, 1,198, 6, 44, - 93,184, 72, 81, 22, 12, 83,197, 70, 58,102,186,158,240,194,218,128,149,225,152,102, 28,145, 27, 77,102, 97,125,152,210,207, 82, - 10,165, 89,104, 39, 28,152,237,114,112, 97,154, 48,148, 44,111,109,242,192, 99,143,241,145, 63,251,115,158,251,234,151, 24, 62, -191,196,204,222,221,180,102,166,253,138, 75,115,232,216,141,124,253,139,255, 47,219, 86, 99, 73,136, 91, 95, 6, 1,132, 72,234, -194,229,125, 55,165, 32, 48,110,172, 94, 26, 55,206,117,128, 23, 71,129,147,194,113,147,171,144, 22, 33,221, 53, 65, 26,225,216, -202, 62, 19,125,231,123,185, 34, 58, 25, 33,168, 69,174,219,143, 34, 87,108, 26, 51,153,210, 86, 71,199,100,116, 38,181, 79,134, -179, 85,183, 46, 64, 9,106, 53,201,167,191,232, 30,155, 43,247, 8,230,143,135, 19, 81,158, 43, 12, 92,245, 16,200,128, 40,110, -112,205, 21,239,166,120,238,105,138,205, 53,116, 54, 66,101,110, 7,107, 83,231, 43, 46, 55, 7,168,113,134, 30,102, 46,239,220, -199,116, 26, 3,118,152, 97, 77,137, 29,231,152, 66, 81,228, 5,195,205,130,139, 43, 57,223,220, 44,185,115,119,157,153,169,144, -213, 39, 55,168, 91, 77,173, 41, 88,209, 33,203,253,156,217,251,190,197,193, 59,110,101,105,121,139,160,236,147,116,103,145, 51, -187, 16, 83,123,208,231, 31,199,148, 41,100, 61,236,120, 29,179,185, 68,177,124,154,104,122, 17,153, 52, 64, 12, 9, 22,175, 34, -123,252,171,219, 35,119,233, 14,114,225,105,112, 66, 84, 12, 76, 23,162,116,207,147, 23, 56, 51,130,145,217,126,252,173,132,161, - 15,227,249,197, 55,158,224,250,203,247,110,239, 97, 42,219,156,183,150, 9,223, 25, 73, 79,233,168,146,222, 28, 39, 32,152, 20, - 16, 21,197, 77, 72,223,165, 84,128, 26,255,239, 50, 8,182, 65, 52,129, 96,250,237, 31, 32, 72,234,147, 61,250,246, 46,189, 10, -106,241, 18,103, 91, 98,243, 17, 24, 71,188,179,133,179, 84,232, 60,163, 24,246, 40,179, 12, 83,150,104, 93,250, 3,178,192,250, - 21, 73,224,169,120,202,104,119,176,170, 2,229,119,202, 8,227,226,124,109, 21, 56, 99,183,189,238,149, 69, 15,235,246,221,202, -161, 94,133,167,231, 85,185,233,149,144,202, 26,141,206,221,110,189, 2,170, 72,225,194, 89,156,183, 93, 99,173,203, 76, 15,130, -112,130,204, 53,165,154,196,215, 58,175,185, 70,202,112,130, 80, 54,218,177,217, 3, 9, 81,171, 65,210,110,131,209,148, 89, 78, - 57, 30,146, 15,135,110,252,158, 23,190, 96, 9, 38, 76, 0,235, 85,252, 65,163,134, 53, 18,171, 21,217,104, 72, 89,228,200, 32, -160, 63, 74,185,113,111,151,163, 87, 94,142,218, 26,128, 95, 41,202,197,121, 39, 49,143, 99,159,234,228, 53, 12, 97,224,247,114, -254,160, 14, 42, 19,121,205, 9,227, 26, 13,104,118, 92,172,109,179, 13,173,105,104,116,220, 30, 61,174,185,185,114,245,255, 42, -139, 13,219,248,233,237,195,222,221,255, 64, 64, 40, 35,106,245, 14,157,246, 44,187, 23, 79,114,236,216,107,184,229,229,255,145, -219, 94,255,115,220,242,242,159,100,223,161, 87,176,181,190,204,250,250, 11,190,243, 14,209,198, 76, 44,148, 2, 55, 30,172,178, - 36,170, 61,187, 20, 2, 25, 66,189, 38,104,183, 36,187,118, 7, 52, 27, 78,152, 88,100,142,255, 32,172, 75,242, 21,129,131,188, -140, 6,134, 44,243, 67,138, 72, 48, 53, 37,105,181, 66,234,141,144, 40,116,111, 42, 33, 3, 39, 62,175,154, 39, 43,176,218,146, -102,134,209, 80,209,235,107, 86,150, 52,189,158, 97, 60,116,117, 79,153,131, 45,157, 56,216,120,106,156, 8, 28, 10,187,212,142, - 44,153,151,126,200,161, 39,131, 48, 2,225, 26,164, 48, 10, 36, 81, 0,109, 25, 48,157,212,152,138, 67, 4,150,126,174, 25,150, - 37, 55,124,199,247,131,216, 34, 28,157,165, 40, 83,104,180,120,252,119,239,100,243,137,167, 17, 71,110,231,238, 7, 78,115,240, -101,215,114,239,239,253, 54,223, 92, 86,220,153,150,252,242,127,121, 39,119,125,224,231,121,197,251,190,155,244,233, 71, 40,116, -206,251,127,245, 55,184,229,173,119, 18,196,127, 78, 99,113, 47,221,227, 87,240,200,179,231,185,212, 75,249,167, 71,159,229, 79, -126,244, 59,185,110,166,201,123,127,253, 35, 28,157,239,144, 90, 56,125,105,141,135, 47,174,210,207, 20, 7,143, 28,192,138,132, - 90, 45, 64,107,141, 12, 67,226,122,147,241, 96, 11,171,115,106,237, 14,101,218,167, 61,183,135,184,222, 65, 21, 91, 4,113, 76, -218,223, 98,220,219,162,179,176,155,165,103, 30,231,192,245,183, 50, 92,190, 64,109,106, 6,107,114,166,119, 45, 48, 88,221,100, -238,224, 81,106, 83, 93,134,235, 27, 52,166, 23, 24,110,172, 51,189,111, 63,181,118,147,184,209,100,180,122,137,206,241,203,201, - 46, 93, 32,238, 76,161,243,129, 27, 69,201, 16, 17, 55,176,105, 58, 49, 91, 7, 97,157,176,214, 36,239,111,185, 52,187, 81,138, -206, 55,152,185,236, 50,158,191,251, 27, 68, 53, 65, 49,202,104,180, 91, 12,215,214,136,234, 33,129,174,147,180,106,172, 95,218, - 96,110, 97,202,167, 60, 41, 8,224,240,241, 19,180, 47, 61, 71,115,121,192, 96, 52, 36, 18,112,108,161, 75,174,224,249,245, 30, -153, 82,180,106, 53, 26, 73,128,214,174,195, 25,231,138,113,174, 16,129,228,224,252, 2,215,157,184,220,161, 14,107, 53, 54,251, - 35, 30,120,248,219,108,172, 44,113,229,173, 47,229,232, 77, 47,101,102,255,110,142, 93,254, 82,140,149, 8,223,189,132,129, 27, -133,199,129,192,148,238,160, 14,128,196, 72,175,110,118,105,106, 97,100, 49,210,239,114,133,192, 6,219, 62,210,192,103, 13, 27, -237, 32, 28, 88,235,104, 87, 21, 48,198,191, 24,141, 87,167,235,210, 65, 40,176, 78,215, 17, 71, 46,212, 34, 16,214,219,225,172, -139,106,245, 41,107,198,106,136, 64,102,222, 3,239,213,177, 97, 34, 9,107, 1, 66,228,148, 6, 78,157, 54,156, 52,130,160,244, -251,127,101, 33, 49,132,177, 67,207,214,154, 45, 24,172,161,211, 33,106,232,178, 3, 76, 81,160,211,148,162, 63,198,140,125,182, -244,184,244,168, 82, 65, 80,139, 8, 76,140, 40, 45,162,208,132,141, 8, 50,229, 20,183,163,146, 97,191,228,204, 72,241,170, 86, -200,222,169,128,103,159,216,100,215,222,136,251,210,128,143, 70,123,201, 6, 41,209, 3,171,220,181, 53,224, 95,215,190,200,235, -222,125, 59,231, 7, 43,212, 87,158,167, 49,179,151, 96,247,149,132,115,167, 41,215, 94,192, 6,145, 27,223, 54, 19,244,112,131, -241, 99,119,209,188,250,118,132, 93,160,117,253,205,244,254,177,142,205, 51,103,209,242, 49,185,198,216, 23, 17,182, 68, 16, 2, -130, 31,127,251, 75,248,229,191,249, 54,143, 15,161,111, 97, 70, 66, 97,161, 38,225, 23, 94,127,140,107, 46, 63, 48, 17,196, 57, -213,123,176, 77,115,147, 46,162, 88, 4, 1,198,163,117, 93,129, 21,249,239, 37, 29,102,183, 2,250,132,161,183,195,137, 29,158, - 36,144, 81,228, 86, 24, 6,136,106,200,214, 12, 65,107,122, 71, 16, 76,181, 75,215, 59,146,215,220,206,220, 22, 41, 89,127,139, - 32,138, 29, 31, 61,207, 92, 0,139, 49, 20,131, 1, 86,130,202, 75,127,168,217, 9,152, 7, 99,220,126, 60, 8, 8,164,116, 76, - 0,227,147,254,124,253,224,216,244,214, 63,134, 62, 98,200, 56, 6,185, 53, 10, 27, 72, 7,141,113,168, 56, 87,114,228,214, 7, -244,104,172,149,152,194,121,218, 85,225, 80,156, 50,136,156,247, 94, 56,250,153,145,194, 69,163, 74,247,184, 41,149, 19, 68,117, -239,216,113,128,146,216, 11,223,140,210,110,204, 91,102,174, 8, 49,150, 60, 29, 19, 37, 9,137,192,139,220, 44,229,120,132,201, - 75,144,130, 50, 47, 48, 24, 23, 21,235, 39,228,177,159,140, 25, 29, 98, 74,103,101,211,214,123,171,179,130, 76, 7,220,120,112, -158,221,251,230,208, 27,125,176,146,176,211, 66, 76,117,157,108,220, 79, 83,136,130,109,242,148,244,135,120, 92,115, 35,178,138, - 96,181, 51, 49,111,162,224,242,107,147,234,223,236,206,162,137, 29, 93,254,164,188,247, 12, 2, 60,249,202,227,134,241,194,208, -201,247,209,147,196,189, 90,173,201, 21, 87,222,206, 21, 87,189, 30,107, 36,247,126,253,111,249,135,143,253, 60,163, 98,153, 48, -138, 80,185,170,112, 11, 62, 83,193, 9,242,171,167, 63,148,142, 24,215,108,249,107, 93, 32, 8,132, 96,122, 78,144,110,105,167, - 76,199, 96,180,165, 40,141,243,206,251,140,148,216,143, 21,195, 96, 66,104, 34,140, 4,198, 72, 74, 12, 2,227,139, 8,135,140, -205,198,154,193,150, 98,125,205,208,219, 50,164, 35, 55,109, 84,213,170, 32,112, 57, 21, 81, 92,193,114, 44, 83,179, 51,220,246, -202, 87, 17, 6, 17,127,249, 87, 31,227,166, 27,111,226, 27,247,220,231,136,119, 22, 10, 3,113, 8,178, 22, 69,116,235, 77, 58, -113, 76,183, 22, 18, 73, 39, 60,208,194, 50, 42, 21,175,251,129,247, 50,190,255,159,160,215, 71, 54,219, 20,107, 23,144,151, 46, - 80, 59,118, 19,250,225,207,112,231, 91,111,227,167,254,235,135,185,253,206,239,226,229,187, 18,222,242, 99, 31,228,227,159,255, - 54,241,236, 12,247,127,241,219,116, 79,222, 72,163, 51,197, 55, 63,252, 71,124,249, 95, 63,198, 61,207,109, 48,200, 10, 46,108, -110,241,252, 90,159,123, 95,184,200,161,185, 54,191,241,209, 47,240,127,188,235,181,148,129, 32, 53,174, 26,110, 55, 26,164,133, - 98,166, 22,211, 93,220, 75, 54, 28, 49, 88, 95,163, 63,216,162,191,113,134,124, 60, 98,216,223,228,200,225,131,164, 89, 70, 32, - 67,199, 59, 23,110, 79, 28,214, 59,244, 47,157,167, 53,213, 65, 70, 53,154,173, 6, 65, 24,210,152,238, 32,172, 65, 21,138,214, -194,110,202, 52,167,214,237, 16,213, 91,164,189, 62,131,165, 23,152,221,191,135,233, 67, 71,137,219, 83,156,249,214,253,204, 95, -117, 3, 38, 27, 17,214,125,238, 57,134,160,222,152,160,127,116,158,186,157, 87, 16,146,141, 50,100, 0,197,176, 32,153, 93,100, -184,180, 78,107,126, 22,140, 97,188,182, 65,210,108,144, 14, 54, 8, 27, 9, 69, 30, 17, 69, 17, 65, 28,162, 21,140,251,235,136, -208,179, 3, 10,141,202, 20,185, 30,209,104, 52,152,157, 89,224,234,253,211, 92,190,111, 55,227,172,160,180,154,125,211, 45,246, - 77,183,105,132, 1,105,169, 25,228, 5, 82, 66,179, 22, 48,211,106,176,216,105,163, 85,206,202,234, 5,206, 92, 56,199,165,165, -101,162, 72,114,237,137,147, 28,185,226, 4, 75,207, 60,198,218, 83,207,176,126,246, 28,195,245, 77, 94,254,154,247, 98,148, 15, -239, 17, 14,226, 96,148,247,162, 3,210,186,138,185,180, 48, 86,150,145, 50, 46,222, 80, 88, 63, 14,183,212, 99, 63, 50,151,194, -237,175,125,119,102, 13,224, 89,240, 46,177, 77, 76, 38,195, 70, 11,103,229,240, 29,127, 84,115, 20,167, 32,148,132, 65, 0, 70, - 78,198,159, 65,228, 46, 8, 90, 57,143,185, 46, 42,107,138, 64, 24,233, 67, 90,220,213,172,221,132,129,134, 51, 75,134,209, 39, -198,220,247,235, 35, 62,255, 27, 99, 62,253, 91, 41,255,250,107, 99,254,225, 23, 7,124,228, 71,183,216, 23,190, 13, 59, 26,160, - 70, 35,116,158,162,139, 12, 53, 26, 81,108,245, 81,131, 49,121,111,200,120, 35, 99,184,145,211, 95, 29, 83, 2,227,141,148,241, -218,136, 98,144,161,138,130,188, 55, 70,143,114,116,145,131, 18,104, 3, 23, 83,195,145, 86, 64,111,117,140,110,199,156, 29,196, -188,252, 47, 63,203, 95,126,232, 67,252,221, 95,124,152,191,127,226, 97,150, 78,221,207, 29,247,109,242,153, 63,252, 4,139, 55, -190,137,222, 67,223,162,236,173, 99,207, 61, 64,244,146,183,184, 39,192,231,141,139, 90, 13,209,154,114,187,207,199,190, 8,131, -101,236,120,153,249,247,253,222,100, 52, 92,161, 90, 43, 22,114, 83,250,135, 0, 0, 32, 0, 73, 68, 65, 84,139,240,123, 92,183, - 44,183, 52, 27, 49,191,251,190, 91,249,241,107,230,120,233, 66,131,154,132, 17,240,230,227, 51, 92,119,229, 1, 55,186, 55,248, -221, 46, 88,109,144, 97,128,149, 94,152, 86,169,218,149,222, 22,209, 9,235,243,187,205, 68, 16,230,208,132,174,219, 50, 30,251, -110,101,224, 70,250,198, 96, 69, 56,161,107,116, 94,125,231,164, 59,223, 30,187,151, 59,200, 68,213, 71,151, 17,110,242, 28, 83, -102, 20, 89,138, 74, 29, 48,165, 72,199, 40, 85, 82,164, 57, 74, 41,180,247,179, 91, 31,218, 98,171,157,249,142, 68, 57, 7,132, - 49,232, 66,161,173,174,160,183,126, 63,235,151,182,104,175, 72, 87,152,162,192, 26, 55, 54,119, 7,170,246,227,107, 87,232,168, -178,160,204, 51,202,162,112, 20, 58,165, 93,166,121,150, 83,102, 57, 34,156, 92,241, 61,140, 71, 16,132, 17,218, 23, 5,198,223, - 63,173,220,154, 65,198,177,243,146, 91,103, 59,182,198, 16,134,193,164,168,118, 93,121,138, 42,114,178,204,233,120, 8, 66, 4, -225,196,125, 34,172, 65,249,172, 81,107, 45,166,122,125,231, 99, 84, 97,200,211,140,249, 70,141,221,123,218,148,155, 91, 78,221, -223,136, 17,205,150,107, 77,227, 58,212,235, 80, 79, 92, 18,225,212, 44, 76, 47,194,220,110,152, 90,132, 70,219,141,216, 43, 60, -176,221,118, 68,108, 63,119,147,120,193,109, 76, 90, 85,232, 73, 47, 14,220,249,251, 69,207,249,206,143,213,237,119,236,242,253, -200, 95, 84,129,233, 30, 78,116,235, 43,191,159,223,249,253, 23,248,192, 47,220,141,181, 53,180,177, 24,237, 32, 48,210, 55, 30, - 21,120,166, 10,156, 10,188, 67,199,104, 73, 24, 75,234,173,136, 56, 14,104,118, 2, 58, 51,174, 37, 86,165,211, 13,229,185,107, - 52,170, 17,190,179,245, 90,194,192,167,245,121,193, 80,229,214, 84,202, 80,228, 37,233,168,100,220,215,108,108, 24,250, 91,134, - 52,133, 34,151, 20,153, 32,203, 5,218, 10, 87,194, 74,183,206,244, 8, 3, 94,125,219,107,184,235,243, 95, 32, 31, 43,172,178, -236,221,181,119, 18,101,237,182, 69, 62,163,161,219,158,165, 85,107, 64, 0,129,176,136, 64,146,233,146,177,177, 4,141, 54,173, -181, 71,144,181, 14,170, 54, 69,104, 46, 66, 33, 97,102,145,123,190,248, 8, 87,191,247, 93,220,243,192,227,188,253,196, 30,222, -255,139,127,194,190,203, 14,146, 4,130,175, 60,115,142, 63,253,212, 55,184,235,147, 95,162,125,240, 8,175,250,201,239, 39,153, -110,242,201,223,249, 85,214,115,205,111,254,237, 23,249,245,127,250, 58,239,126,195,141,156,221, 26,146,142, 75,102,219,117,254, -228,179,223,230,199,110,189,138, 75,253, 17, 7,186, 13,230, 26, 53,110, 62,114,144,119,220,242, 18,186,179,187, 16, 82,178,181, -182,198,220,194, 65,202, 77, 65, 99,106, 26,107, 2,146,122, 64, 92, 75, 16, 65, 72, 84,111, 32,164, 35,202, 33,161,214,158, 34, -233,238, 34, 8, 2, 90,243,251, 49,101, 74,189, 51,235,200, 66,227, 33, 86, 4, 96, 11,154, 11,123,209,133,162,236,103,236,189, -246, 6,186,135,142, 82, 12,182,216, 60,115,134, 35,183,222,138, 74, 83,116, 58, 70,151, 41, 32,136,154, 13,108,225, 32, 20,202, -239,240,210,205,117,159,152, 84, 34,162, 6,186, 24,210, 59,123, 30,173,123,204, 92,118, 29,203,143,159, 34,168,135, 12, 86,215, -221,142,196,104,242,209, 38,113,171,134, 20, 33,207, 63,113,138,246,116,147, 98, 92,112,241,217, 39, 9,107,134,116,148,163, 70, - 67,194, 70,157, 84, 89,246,238,153,227,208,225,131,156,220,189,151,221,173, 58,135,230,231,105,197, 9,141, 40,228,232,124,151, - 19, 11, 51,212,162,152, 82,187,139,122, 45,138,216, 55, 55,195,108,103,138, 99,135,143,210,157,105,211,170,213, 89,223, 90,166, - 72,135, 28, 58,121, 21,237, 93,115,232,209,144,209,218, 18,239,188,243, 87,221,138,204,184, 68,162, 88, 66, 61,116,118, 39,173, - 44,121,105, 40,148,166, 44, 13,169,182,228,214,146,123, 49, 71, 82,131,169, 41,151,106, 36, 35,127,232,250, 14, 93, 87,193, 93, -218,141,147,208,118, 50,186,174, 48,136, 65,236,170,219, 40,118,187,238, 36,145,196,158,144, 22, 4,206,110, 25, 73,235,210,217, -132,139, 42,117, 60,104,225, 46, 24,210, 34, 98, 8, 99,167,200, 22, 6, 46,155,130, 15,238,131,107, 11,248,216, 61,154, 83, 25, -172,148,176, 97, 96, 93,195,134,133,179, 5,204, 92,125, 2,181,186,234,246,162,186, 68, 13,135,232,193,136,114, 51, 37,235,143, - 25,174,103,244, 86,199,244, 55, 50,250,131,130,245,243, 3, 54, 55, 82,198,253,156,254,218,152, 97, 47, 39, 31,149, 12,251, 57, -249, 70,142, 86,154, 40, 22, 36,210,249,137,219,215, 95,203,250, 74,206,241, 15,253, 33,229,165,167,217,236,109,176,190,124,158, -229,211, 79,161, 85,128,181, 57, 63,179,217,160,255,177, 79,161,195,144,252,133, 71, 49,197, 24, 46,220, 71,237,229, 63,128, 77, - 71, 16,184,240, 16, 17, 70,136, 90, 27, 19,214,200,206, 60, 6,131,117,226, 3,251,144,141,174,211, 38, 88, 23,166,226,246,167, -194, 55, 58,254, 34,232,189,229, 86, 91,222,254,154,147,188,108,223, 52,203, 10,110,158, 18,252,224, 91,174,247, 66,198,192, 77, - 83,220,166,209, 23,100,142, 97, 33,170,121,189, 1, 25,199, 30, 76, 99,156,144,205,143,145, 61, 32,221, 55, 99,118, 59,112, 70, -134,147,166,205,218,234, 96,138,145, 73,139,120,118,175, 87,202, 91,175, 8, 87, 47,198, 13,138, 42,105,205,161, 88, 13, 46,232, - 68,231,169, 43, 88,132,160,204, 51,215, 57,121,234,155, 53,218,255,172,158, 91, 17, 5,152, 82, 81,230,142, 38,135, 23,222,105, - 63,230,118,135,188,246,159,115,192, 29,229,113,174,214,163, 99,181,135,113, 27,255,209, 90,129, 21,110,122,104,180,115,153,216, - 64,186, 34,194, 23,252,166, 44, 28, 95,222,234, 29,207,139,239,164, 67, 57,129,206,148, 74,163, 75,229,247,225,133,155,128,120, - 33, 90,149, 69,163, 74,103,227, 11,147, 4,100, 64, 89, 22,168,220, 97,105,173, 21,136, 48, 70,132,129, 59, 2, 45,152,162,240, -116, 60,151, 87, 97,138, 18,165, 21,101, 89,146, 15,134,152, 60,101,109, 88,114,203,201, 5,202, 94,134, 16, 17,162,221, 65,182, -187, 80,111, 67,187, 11,173, 22,116,186,238, 32,159, 94,128,198,148, 27,177, 91,175,106,173, 14,235, 10, 41, 92, 61,201, 62, 72, -121,251, 57,180, 59, 70,235, 98, 91,126, 94, 41,189, 38, 29, 60,219,106, 90, 25,110,155,195, 39,183,209,219, 33, 19,102,135,211, -163,130,107, 88,243,162,129,193,145,163, 55,241,161, 63, 93,230,251,127,224, 67,232,204, 16, 6, 14,124, 84,229, 11, 73,191, 97, - 9, 35,103,161,141, 35, 65,189, 33,105,182, 66,106, 53, 73, 82, 23, 36, 45,137,140, 37, 50, 18,100, 5,228,169, 37, 77,221,218, - 79,122,141, 95,224, 15, 88, 83, 90,111, 2, 16,219,241,205, 86, 84,148, 6,167,154,207, 45,101,234,198,236, 54, 21,148,169,197, - 22, 16, 90,139, 48,158, 17, 35, 93,131, 99,133,131,217,200, 64,144, 13, 70,216, 82, 16, 26, 73, 64,128,212,222,173,226,250, 37, -226, 0,100,175,220, 98,107,180,129, 65, 83,150,154, 92, 43,134, 90,147,150, 57,215,222,246,157,148,151,150, 89,126,240, 62,204, - 56,225,220, 93,255, 72, 84,183, 52,246, 95,207,242,185, 37,254,233, 47, 63,195,204,104,133, 47, 61,118,154,160,222,224, 43, 15, -156, 66, 38, 17,135,187, 53,238, 59,183,198,215, 46,110,114,233,155,223,228,155, 95,122,156,135,158,190,196, 37, 29, 49,213,169, -243, 23, 63,251,125, 92, 62,213,224,190,111, 61,193,117,115, 45, 10,107,185,108,113,134, 47, 61,123,145,165,141, 30,227,210,240, -213,115,107,244,250,125, 78, 95, 90,230,207,190,252, 13,138,108, 68, 89,106,134,253, 33,129, 44, 9,187, 53,172,209, 4, 73,196, -226,226, 2,241,212,188,143,132,148, 88, 93, 18, 55, 59, 88, 93, 16, 36, 13, 70, 27,151, 40,198,125,194,122, 29, 17, 38,244, 87, -151,233, 93, 60, 75,107,118, 22,173, 74, 90,211, 83,147, 61,223,252,101, 39, 33,168, 99, 74,141,202, 75,186,251,247,162, 74,231, - 75, 45,198, 41, 97,123, 10,163,220,142, 77,151, 5, 4, 49,229,104,192, 96,121, 9, 33, 74,178,193,128,250,116,139,241,250, 10, -173,133, 25, 78,127,237, 91, 28,188,233,106,202, 65,223, 83, 61, 3,122,171, 43,196,205,144,180, 55,166, 51, 93,167, 53,189,200, -197, 83,171,132,122, 64,123,110, 22, 17,116,176,229,136,246,116, 7, 17,198, 12,179,146, 44, 75, 81,121, 73,156, 72,180,212,236, -222,115,152,118, 43, 70, 88,195,254,153, 25,218,141,132, 78, 82,167,149, 68, 92,190,103,145, 67,115,211,204,212, 19,138,162,224, -244,165, 21,158, 95, 94,102, 60, 26,208,106,212, 24,231, 99,180,209, 24,171,200,179,148,165,103,158, 64,149,138, 40,105,209,157, - 89, 36,170,205, 96, 52,148,133, 11,243, 41,149, 19,118, 88,227,198,180,153,133,220,192, 88,185,191,203,200,153,156,107, 53,151, -202, 38,195, 10,245,106,125,119,180,221, 57, 26,225, 42,229,220,211,157, 76,197, 40, 9,182,185,206,181,154,160, 61, 21, 16,199, - 2, 25, 72, 87, 61, 11, 55, 5, 16, 59, 24,228,218,227, 25,109, 53,210, 23, 18, 34,127, 45,176, 22,253,100,201, 75,114,120,186, -128,115,133, 19,246,141, 53,100,198, 77, 26,172, 15,150,155,158, 73,152,154, 75, 40, 7,125, 23,206, 81, 58, 68,111, 49,202, 41, -138,146,108, 84, 50, 28,150, 12, 71, 37, 91,131,130,205,158, 98,101, 37, 99,121, 37,103,249,226,136,141, 94,193, 86, 63,103,125, -101,196,120, 88,146,141, 75, 84, 90,146,102,134,169, 80,208, 27,228, 12,108,200,133, 49,204, 28, 60,198,160,183,193,211, 15,124, -141, 32,170,129,129,180,215, 99,233,209, 7,120,248,244, 99, 76,189,230, 50,172,109, 81,172, 47,163,214,150, 48,131, 30, 50, 10, -137, 15, 94,239, 29, 19,174, 51, 22, 65,132, 8, 99,215,121,172,158,193, 14,206, 50,247,227,191,191,157,255,110, 28, 66, 85,248, -176, 14, 55,166,244,227,120, 5, 34, 10, 57,253,244, 57,254,244,193, 11, 28,110,194, 7,222,249, 82, 7,237, 8,165,219, 97,248, -174,222, 17, 57,252, 14,117,135,114, 89, 72,167, 4,223,238,212,229,118,180,159,117,202, 36,233, 21,240,214, 88,132, 12,221,251, -198,250, 29,123, 20,185,145,189,213, 36,135,175,223, 97, 95,171,186, 45, 31,159, 85, 29, 6,214,184, 59,174, 50, 87,140,171, 18, - 93,184,189, 49, 22,242,241,144,178, 44,156,210,188,202, 73,199,249,176,173, 50,158,131,174,124, 33,105, 38, 9,109,186, 40,182, - 57,242, 90,185,255,175,141,199,174,110, 11, 12,181,246, 99, 94,163,125,118,186,118,234,116,233, 59,108, 85,122, 5,182,197, 86, -123,113,237,172,174,198,123,213,177, 46,175,221,104,227,155, 75,175,208,247, 10,112,107,220,254, 95,107,141, 86,238, 99,153,167, - 62,190,211, 9,222,140,113, 59,124, 25,133, 68, 73, 29,137, 64, 41,237,224, 73, 82,184,194,162, 84,238, 85, 96,220,251, 79, 41, - 15,190,209, 26,165, 10,242, 81, 74, 57, 30, 3,112,105,179,199,187,110,187, 18, 85, 90, 68,173, 14, 83, 29,100,189, 1,157,105, -152,157,133,233, 25,152, 89,132,230,140, 39,246,137,237,231, 98,162,117,240, 66, 72, 27, 84,129,231,147, 52,185,237,219,248, 14, -222,226,111, 87,133, 36,136,237,120,177, 42, 83, 96,167, 7,205, 86, 33,234, 85,109,224,179, 86,181,242,241,142,213,115,226, 47, - 38,238,201,193,162, 38,245,129,245,232,226,215,190,225, 71,249,147,191, 92,167,209,156,115,215, 17,237,149,240,214, 91,235,107, - 14, 60,211,104, 73, 90, 45, 89, 5, 9, 34, 3, 55,229, 10, 67,231,137,207,115,203, 48,181,228,165,247,168,151,147,183,150,211, - 23,225,198,251, 66, 86,171, 70, 23, 36, 37, 3,137, 20,146, 48, 22,212, 99,111,161,211,174,108,150,149,102,136, 10,185,236,155, - 31,227, 72,155, 90,129, 40, 53,115,211,115, 72, 4,115,211, 51, 8,173, 8,132,152, 88,218, 42,222,147, 28,103, 35, 12,138,220, -104, 70, 86, 51, 82, 5,125, 85, 50, 84, 37,111,253,161,255, 76, 20,149, 60,252,169,175,177,118,246, 60,243,223,249, 99,228,203, -207, 98,206, 61,197, 59,190,247, 59,248,253, 79,222,207, 45,119,190,157,107, 15,204, 65, 58,230,225,245, 49,223,117,116,145, 91, -246,207,241, 93,251,103,120,211,155,223,202,239,127,232, 35, 92,216, 82, 92,243,138,107,177, 8, 78, 47,109,176,188,214,167, 27, -199,252,205,125, 79,211,173,215,152,111,214, 57,191, 57,224, 88,183,201, 86, 86,114,197,124,135, 43,103,218,172, 12, 82,186,245, -152, 46, 48,222, 88,159,100, 56,219, 64, 16, 69, 53, 54,150,206,177,177,114,145,214,236,110,242, 44,155, 92, 40,194, 86,135,193, -218,138,123,115,234,146,184,214, 32,136, 19,100, 88,199,154, 18,149,141,153, 61,112,136,218,244, 28,121,127, 72, 99,110,129,116, -107,139,184, 51, 69, 57, 94,135,184,142, 26, 15,137,234, 13,226,230, 20,101,158, 35, 66,167, 14, 13,106, 45,172, 46,208, 74, 17, - 68,206, 7,177,113,230, 89,226, 36,162,117,224, 4,229,120, 68,115, 97, 55, 27, 47,156, 67,214, 58,108,156,123,142,184,153, 48, - 88, 93,114,150,186,168,129, 41, 44,189,181, 62,232, 17,139,199,143,114,233,249,101,214, 46,156,101,239,137, 67,168, 66, 48,189, -119,158,153,189,151, 99, 3,195,194,129,235,161,236, 51, 59, 63, 75, 82,111, 19, 38, 53,180, 42,153,153,157,166, 21, 74,174,186, -226, 8, 87, 95,115, 53, 47, 57,121, 57,194, 10, 6,105,129, 64, 48,221,106,113,248,192, 46,254,195,123,126,148, 59,223,254, 61, - 92,125,104, 55,253,173,117,214,150, 86,104,213,107,204,205, 77, 83,230, 25, 65,173,142, 16, 6, 41, 35, 90,115,179, 0,220,252, -138,119, 16,132, 16, 7,110, 55, 90, 0,169,215,154, 40, 11,153,118,163,119, 35,183,249,204, 66,122, 34, 92,224,118,222,218, 79, - 78,101, 84,189, 63, 45,202, 88, 39, 68, 50,174,126, 15,132,215,201,196,126,127, 21, 58, 36,108,229, 13,149,145,123,165,106,107, - 17,218,237, 47, 69, 53, 30,243, 66, 57, 97, 65, 11,247,181,101, 0, 73, 32, 8,194,128,232, 51, 25, 79,254,125, 78,207, 58,239, -117, 97,182,201, 76, 77, 79,179,219,200,161, 52,130,184, 91,131,173, 45,138,225, 22, 38, 47,177,133, 27,173,234, 82, 81,140, 74, - 70,155, 57,253, 97,201,198, 86,201,218, 72,115, 97,168, 56, 51,208,156,235,151, 60,181, 82,112,126, 45,227,210,122,193,217,181, -130,173, 97,201,120,172,208,185, 34, 80,150,213, 18,134, 86,114,233,185, 51,196,187,103,248,236, 95,253, 54,191,244, 11,255,133, -191,249,187, 63,228,135,127,248, 29,156,127,242, 62,178,113,198,197,243, 91, 44,191,231, 6,212, 74, 31,177,120,148,244,210, 5, -138,213,115,232,241, 0,115,233, 9,226,107,223,136,168,207, 19, 76,237, 67,212,166, 92,216, 73,144,160, 85, 73,217,223,130,222, - 10,241,124,215,251,176,171,184,211, 96, 2,165,153,136,212,164, 68, 68,130,180, 63,224,119,239, 62,195,238, 6,252,212,237,151, - 81,239, 54,189, 24, 46,112, 98,183,138,233,110,181, 83,130, 87, 7,120,213, 49, 97, 39,130, 67, 17, 8, 55,146,246, 64,148,109, - 83,176,167,205, 9,235, 10,140, 64,120, 62,185,246, 23, 94,119, 64, 53,175,189,221, 95,120,203,201,136,221, 29,228,218,103, 2, -123, 22,187, 42, 80,121,134,206, 29,167, 93,107,151, 96, 81, 22, 25,217,120,236, 88,234, 86,251,241,185,195,109,105,163, 49,147, - 75,165,197, 88, 71, 81,211, 69,129,241,148, 54,140,193,250, 23,172, 16,129,191,127,206,118, 86,117,238,214, 26, 63, 17, 8,208, -166, 68, 43,141,136, 2,100,176,237,211,183,218, 17,237,140,113,240, 24, 35,172,243,190,107, 63, 86,247, 17,180, 70,104,255,216, - 8, 7,150,177,222, 49, 81,186,251, 84,173, 10,116,145,161,243,194, 1,113,172, 70,107, 55,238,183, 24,202,116,236,198,242, 62, -158, 76, 43,131,214, 26,235,149,248,214, 24,103,123, 11,164,183, 59, 42,138,116,140, 46, 10, 4, 26,147,101,108,245, 7,188,230, -138,131, 52,218,109,231,159, 79, 18, 68,210,132, 61, 7, 96,113,183,239,202,167, 29, 64,162, 10,117,216,185, 47,255, 55,128, 35, -119, 37,208, 59,254, 77,191,120,252,238,222,245,254,243,193, 54,164,162,226, 72,111,159,228, 59,114,191,183, 15,234, 73,234,158, -246,216,181,234,183, 86,219,183,175, 14,124,227, 37,226,136, 29, 93,187, 32,169, 53,248,189, 63, 62,203, 43, 95,245, 67, 4,161, -179,109,135,194, 53, 18,129, 15,161,106,181,221,250,208,189,132,141,159, 82,185, 98, 48, 8, 44, 74, 65, 58,134,108,236, 85,239, - 94,220,111,164,192,148,174,192, 49,147, 44, 33, 65,224,223, 7, 50,144, 68, 81, 64, 20, 74,146,154,195,200,134,225,182, 97,192, - 26,183,242,148,222,230,239,235, 66, 4, 16, 91,248,252,231,190,196,203, 94,118, 43, 83,237, 46,183,191,250, 85,124,253,203, 95, -246,156, 5,231, 4,154,168,240, 95,114, 89,237, 87, 64,160,133, 70,134,150, 76, 43, 70,214, 96,163, 6,111,254,190,239,161,127, -239,167,208,131, 26,247,127,225,110, 58,243,139,212, 15, 95,206,220,190, 33, 73, 52,195,117, 7,142,240,254, 95,253, 51,174,217, - 59,195, 64, 89, 86,135, 41, 11,211, 45,222,247,238,215,114,174,111,104, 55, 52,159,127,232, 5, 14,236,154,198,102, 25,255,231, - 39,239,102, 61, 87, 92,183,111,150,171,102, 27,140,117,200,129,153, 22,159, 57,117,129, 80, 72,222,112,213, 65,190,126,102,149, -203,247,206, 48, 74, 75,142, 52, 18,214,141,101, 74, 88,254,227, 79,188,151,149, 75, 75, 88, 99,201, 70, 35,130,208,178,181,220, -167, 28,109,114,197,181, 87, 18,181, 58,190, 99, 8, 72,234, 45, 70, 27,107, 52,231, 22,200, 7, 3,234, 83,179,200, 32, 96,180, -181, 78, 20, 71,168, 76, 17, 53, 26, 4,113, 76, 62,216,162,179,103, 63,195,213, 37,116,150,210, 89, 92, 68, 36, 53, 2, 41, 41, -211,177, 59, 68,179, 33, 97,173, 78,216,108, 81,110,109,145,247,215,168,205, 46,130, 85,140,214, 86,105,116, 59, 68,141, 46,227, -165, 51,100,195, 30, 73,171, 75, 16, 64, 54, 76,217, 58,115,134,122, 39, 97,180,177, 78,148,212, 25,110,244, 24,111,108,177,112, -116,154,233,197,131, 12, 54,251,172,157,237,209,153, 42,209,186,198,168,183,132, 54,146,213,231,215,104,181, 53,181,238, 17,244, -224, 57, 74,186, 36,186, 73,166, 46,145,180,118,145,171, 49,139,139, 71,217,236, 95, 98,102,254, 8,141,122, 3, 83,244,185,249, -218,151, 50, 28,110,162,140,166, 22,180,201,139,148,194, 20,116,102,231,120,249,107,222,196,190, 3,123,216,123,228, 36,141, 90, -131,153,197,189, 52,219, 13,116,105,153,218,187,143,246,238, 5, 84,169,216,127,248,106,190,244, 47,127, 0,198,145,154,180,113, - 96, 5,131, 69,249, 63, 23,108,103,115, 36,137, 83,141, 86, 48, 41, 85,229, 99,187, 19,215, 89,123, 60,177,201,137,179,173,231, -107, 11,159, 16,231,148,165, 81, 44, 28, 69, 46, 22, 52,234,210,165, 44, 9, 39,156, 27,167,118,242, 10,151,129,152, 36,171, 25, - 99,145,213,181, 95, 89,106,117,201,240,175, 51, 30,120,208, 48,180,142,156, 54, 48,219,197,191,211, 10,184,223,120,120,205,109, - 47,221,207,173,175, 56,193,248,236, 69,138, 97,223,141,118, 71, 41,253,149, 49,233, 32,103,208, 47, 25,142, 53,107,153, 98, 57, - 55,188,144, 26, 30, 30,104, 86, 70,154,168, 21,115,255,166,230,124, 95,177,186,158,209,138,164, 11,131, 48,110, 45,112,110,168, -104, 27,184,120,177,199,238,171, 15,241,183,143,220,203, 83,151, 44, 3,181,159, 93,157,148, 79,220,123, 15,223,187,103,138,225, -207,255, 20, 89,163, 78,231,242,125,132, 55,191,157,213, 79,125,148,250,238, 57,130,198, 12, 65,123, 26, 25, 24, 68,107, 47,197, -217,111,123,111,206,246,216,209,150, 5, 65,189,142,236,204, 49,184,247,179,216,178,244,129, 42,248, 56, 86, 79,107,171, 96, 45, - 82,242,219, 31,189,143,101, 13,239,188,188,195,141,215,157,112, 99,200, 32,156, 60,169, 21,254,213,197,160,110, 7,170, 72, 31, -219,231,246,193, 21,223,125,251,243, 21, 50, 86,200,192, 91,234,196,132,101, 94,125, 94, 4,145,183,207, 5,200,184, 78,243,250, - 59, 42,212,208,142,195,194,108,195, 74,208, 96,114, 76,158,163,211,145, 35,191,149,238,176,211,218,160,202,220,139,222,152,216, -254,140,111,211, 68, 53, 41,160,250,156, 99,204, 27,163,221,232, 92,149,110,239,110,236, 68,245,110,169,118,237,218,123,203,131, -237,160,152,106, 88, 81, 42,164,103, 61,104,173, 16, 30, 7,237,178,207, 37, 70,105, 23, 63,156, 56, 27, 91, 16,248, 17,122, 21, - 41, 43, 92,224,140, 85,190, 96,193, 56, 81, 92, 89,122,187, 85,129, 46,245,132,137,224,164, 66,210,197,191, 90,139, 8, 3, 84, - 58,246,141,142,117, 29,190,114,197, 68,153,103,147,233,152, 49,214, 77, 6,112, 88, 92,165, 44,229,120,200,104, 48,228,196,222, -121, 78, 28, 63, 72,169, 53, 54,174, 17,205,237, 66,238, 63, 12, 83,211, 78,189, 94, 29,230, 59, 15,223,137,181, 97, 7, 26,152, - 29,110,135, 23, 29,214,114,199,159, 5,255,251, 47,187, 99, 52,239, 5,113,213,193, 61, 97, 86,235,237,164,189,234,144,175,164, -235, 90,111,223, 14,177, 61, 37,168,220, 24, 94,184, 43, 38,201, 55,219, 48,163,107, 95,242,102,118,237,185,156,135,239,251,123, -194, 0,162, 68, 80,175, 9,230,230, 37,211,211, 33,205,182, 59,228,139,204,160, 75,151, 41,161,177, 20,169,101,148, 58, 27,154, - 82, 21,222, 90,208,110,185,177,125,163, 17, 18,215, 36, 81, 40,157,211,162, 74,240,243,247,171,210,253,169,210, 50,236,187,157, -250,112,100,200,203,202,130,234, 10,156, 40,220, 94, 94, 72,239, 48, 42,198, 5, 79, 60,250, 52,143, 63,248, 16,207, 61,253, 52, -195, 44, 71, 8, 65,233, 27, 26,132,247,223,231,202,144, 81,146, 91, 69, 63,203,217, 40,114, 6, 42,229,186,219,222, 76,239,139, - 31,229,107,159,248, 38, 7,110, 62,206,147,143,174,242,241, 63,255, 36,233,150, 37, 56,249, 54,202,205,175,210,109,228,252,230, -247,191,150,127,124,232, 12, 69,191,207,254,118,131, 39,122, 5,151,202, 58,151,134, 41,191,243,137,187, 57,179,190,193,255,245, -183,159,227,240,209,253,220,245, 11,223,203, 66, 28,243,119,247, 62,201,245, 55, 92,193,231, 78,157,229,101, 55, 28,227,182,131, - 11,132, 1,252,227, 67,167,153,105, 36,148,163,156, 72, 64,207, 26,116,169,216,219,172,177,114,254, 28, 83,115,243, 40,235,118, - 83,121,218, 99,247,209,195, 76,205,204, 18,134, 9, 65, 20, 81,235, 76, 19, 68, 9,218,104,218,243, 11, 96, 12,233,160, 71,153, -143,220,197, 12,137, 12, 19,226,102,141,108, 99, 19, 91,150, 14, 6,129,160, 49,213, 37,172, 55, 8, 59,211, 96, 37, 42, 79,253, -139, 75, 83,159,223,199,120,117,109, 98,127,168,117,103, 80,227,145,195, 73, 14, 71,212,231, 22, 56,251,173,251, 41,243,140,169, -189,251, 81,121, 65,212,172,179,250,236, 11, 44,158, 56,204,120,181,207,226,241, 35, 12,215,214,208,101, 70,109,170, 77,173,189, -135, 65, 63, 99,253,194,144,188,191, 68,103,118,218, 51,178, 53, 97, 18,211,153, 77,168,181,219,200, 32, 99,102,223, 73,154,237, -105,166,103, 27, 46, 25, 72,128, 52, 33,163,180, 79,171, 51,195,212,226, 94,122, 27,231,185,250,134, 91,201, 84, 74,158,143, 89, - 92,220,205,137, 19, 87, 49,191,184, 15,155, 21,244,215, 87,120,252,193,111,112,234,137, 71,209, 69, 65,173,211,101,118,255, 30, -146,198, 20,179, 7, 14,208,217,179,219,103, 9, 75,102, 23,246, 19, 69, 1,214, 3, 97,178,210,146, 21,144, 42, 24,151,214, 89, - 29, 61,181,201,217,108,156,231, 82,250,102, 75, 88, 55, 26,207, 51, 55,186,159,228, 35, 23,144,101, 22,171, 32,203, 45,121,110, - 80, 10,138,220,215,243,210,129,110,162, 72, 76,160, 52,129,181,168,220, 32,180,161, 44, 12,101,105,209,133,139, 46,180, 5, 4, -218, 98,149, 69, 88,227, 24,245,255, 92,240,236, 41,195,186,129, 94,225, 2, 93, 74,175,223, 73,173, 91, 23,172, 21,176,169,220, -200,107,156,193, 45,175,188, 2,250, 61,116,153, 59,224,200,214,128,114,152, 83,140, 10,250, 91, 5,131, 84, 51, 40, 13, 27,133, -229,254,158,230,149,173,152, 15, 94, 61,205,255,120,237, 34, 63, 53, 27,240,179, 93,248,149,155,246,240,131, 63,252, 29,124,105, - 67,243,248,165,148,193, 88, 17,134,208, 18,130,199,134,154,212,194,102,170, 41,149,228,240,209, 69, 14,236,154, 97,247,122,193, -135,209,220,245, 11,255,157, 23,226, 24, 41, 37,167, 62,122, 23,157, 3, 87,177,113,113, 11, 53, 24,145, 95, 58,141, 94, 95,194, -244, 86,137,246, 29,195,246,135,152,116,132, 30,244,209,163,190,203,127,175,119,209,233, 24,178, 33, 97,119,207,118,255, 52, 49, -182, 58,225,169,211, 51, 4, 60,120,207, 19,124,107, 8, 87,207, 8,238,120,245,141,110,164,239,163, 67, 69,224, 58, 10, 91, 45, - 28,125,241,100,253,238,210, 10,233, 61,234, 85, 39,239,186,119, 33, 92, 97,134, 12, 16,200, 73, 49, 49,217,171, 87, 93, 49, 18, -171,148, 63,252, 13,178, 61,187,227,114, 91,249, 13,245,228, 32,175, 98,248,116,230,194, 88,116, 89, 78, 14, 87,129,197,148,142, -188,102,114,135,222, 53, 74, 99,148, 59, 44,173,210, 19,245,187,245, 1,219, 50, 12,157, 98,223,143,205, 43,134,186, 53,238,208, -176,198,125, 13, 93, 20, 62,253,206,139, 15,171, 46,213, 35, 79,101,228, 52, 1,214,218,237,236,115, 32,136, 66, 39,154, 11, 61, - 38,217, 90,130, 56, 66,134,161, 99,179, 91, 8,163,196,129,132,148,241, 57,236,214, 91,240,180,167,147,233, 29, 59,123, 77,158, - 23, 46, 61, 78,104, 2,191,184,181,101, 65,153, 23, 20,163, 17,101,233, 52, 28, 54,176,216, 42,217,196, 56,225,158, 46,180,187, -198, 89, 8,194, 8, 91, 20,196,181, 58, 11,157, 54, 87, 31,222, 67,150, 43,172,140, 73, 14, 28, 65, 28, 60, 12,221, 41,136,167, - 17,180, 28, 81,133,232,223, 28,196,226, 69,162,197,255,253,151,249, 55,183,253,255, 57,204, 69, 53,145,217, 49,149, 49,126,172, -111,118,172, 58, 38, 29,123, 85,153,123,193, 39, 62, 68, 66,121,202,140,217,121,215,140, 27, 21,250,255,111,209, 47, 74,250,171, - 62,222,124,203, 59,184,245,182,247, 16,197, 78, 52, 23,198,174, 41, 17,194, 89, 99,203,194, 82,102,134,108,236,138, 9,235,179, -203,181,246, 54,182,216,137,254,163, 90, 85, 11, 91, 2, 79,155,195, 59, 40,172,144,206,217, 35, 33,196, 53, 58, 66, 8, 2,105, - 29, 39, 62,118,105,145, 85, 60,172,242, 68, 71,180,139,136, 54,165,224,246,215,220, 1, 37,124,223,247,190,135,119,189,235, 61, -220,121,231,157,252,192,187,239,228,189, 63,112, 39, 74,111,235, 16,180,118, 15, 71,112,195,201,248, 87,148,177,110,167, 46, 12, -169,214, 20, 70,243,129,223,252, 56,203,159,254, 75, 46, 46,143, 89, 58,125, 1, 35, 12,167, 95,216, 32, 93, 91, 98,255,238, 69, -212,236, 49,198, 15,125,158,217,189, 7,121,249,145,221, 76,231, 57,193,174, 5, 26, 73,204, 47,253,213,103,184,230,200, 46,142, -205,119,249,198,179, 23, 25, 40,195,112,179,207,119,191,229,118, 62,241, 47, 95,230,252, 32,227, 93,111,127, 29, 15,125,235, 81, - 62,249,224,179,188,243,150,171, 56,117, 97,157,133, 78,157,165, 65,202,173,199,246,112,122,109,139, 68, 72, 54,210,156,149, 97, -198,247,188,241, 86,166, 22,119,179,118, 97,133,178,204, 48,101,128,149, 25,217,176,207,101, 87, 93, 77, 99,215, 62, 8, 92,119, -144,116,166, 41, 6, 3,162,118,151,205, 51,231,168,183, 35,100,220,246, 30, 90, 67,210,108, 17,212, 18,226,233, 5,108, 54, 66, -132, 49, 42,203,136, 26, 45,100, 24,144,109,172, 32, 68,128, 20,154,176, 59,207,224,220,243,180,118,239,162,232,245, 8,106, 13, -194,102,155,222,217,231, 73, 90,117,242,193, 24, 53, 26, 49,218, 88,102,239, 75,110, 38,239,109,249,176, 7,203, 51,247,126,147, -195, 55, 92, 65,153, 9,172, 78,233,175,167,196,137,101,115,105, 29,107, 54, 8,226, 38,131,181, 13, 58,211, 1,245,169, 57,122, - 91, 2, 97, 54,168,119,102, 41, 75, 9,118,236, 10,142,233, 61,206,202,213,108,178,118,254, 41,100,216, 32,105,181,156,166, 32, -146, 68, 73, 23, 25,105,142, 92,253, 90, 30,249,250, 63,179,111,247, 33,102, 23,230, 73, 26, 9, 38, 43,105,204, 76, 81,228, 67, - 14, 28,187,156,189,251,143,208, 93,220, 75,210,108,208,232,182,152, 57,113, 5,145,144, 52, 23,102,177, 86, 56, 22,187, 16, 60, -252,237,207,210, 91,187,128, 49, 78,197,157, 27,207, 18, 17,219,103,133,177, 96,132, 37,240, 49,172, 80,129, 26, 4,133,218, 86, -149, 10,239,101,246,113,207,206,115,233, 15,109, 85, 90, 84,233,172, 35, 81,236, 88,238, 73, 82,221, 15,208, 74, 80,228, 6,155, - 91,207,174,152,176, 33,221,255,205, 28, 49,202,104, 72,238,183, 60,250,117,205,165,212, 29,228,198, 79,126, 59,161,131,171,212, - 66, 24, 41,152,142,221,225, 30, 4,174, 8,121,215,143,220, 70,211,148,164, 27,155,168,205, 45, 76, 94, 48, 88, 79, 25,109,164, -172,247, 75,214, 70,138,181, 84,243,229,213,146, 15,191,118,145,235,143, 5,180, 15,159,224,225,167,123,220,253,244, 58,207,245, - 53,143,158,238, 81, 62,254, 44,111, 57,220,226,172, 77,120,108,109,204,174, 88,114,104, 42,226, 43,203, 5,161,177, 92,234,182, -184, 42,148,252,167,164,224,221,175,186,154, 93,211,243,252,233, 87, 95, 96,113, 38, 96,163, 52, 92, 90, 47,144, 65,192,177,151, -159,224,185,175,220, 71,123, 33, 70, 90, 71,112, 11, 91, 29,100, 82, 35, 62,112, 21,201,194, 97,146,107,110, 35, 8, 20,118, 60, - 70,198, 17, 65,123,150,160,222, 34, 95, 93, 71, 93,124,222, 89,119,124,199, 82, 73,116,180,177, 72, 93,242,193,207, 62, 75,183, - 6, 63,125,199,229,212, 91,173,237, 64,150,192,121,106,173, 31, 19, 59, 17,151,152, 36,208,137, 48,242, 34, 36,137,181,218,117, -246, 21,124,198,122, 8, 75,169, 17,145, 11, 60, 17, 85,200,180, 16, 78, 44,225,211, 94, 68, 28,249,108,128,128,218,209,151, 16, -239, 57,238,151, 60,118,219,190,102, 12, 86, 23, 8,235, 14,110,157,141, 40,199,174, 75,183,214, 96, 61,118,182, 24, 14,156, 72, -204,175, 5, 92,202,169,242,208, 29,124, 49, 2,129, 12, 93,174,187,144,104, 79, 31,195, 88,215,249, 34, 95, 52,162, 21, 30,160, - 32,195,192,217,238, 42,106,154,181, 19, 21,183, 12,228,196,234, 55, 41,120,140,179,160, 89,227,173, 87,210,145,197,170,216, 89, -225,253,254, 66,138,237,226,196, 90, 63,174, 55, 88,229,138, 4,177,163,251,157,156, 99, 81,101, 35,117,201,123, 50,112,201,128, -129, 20,222,215,110,209,218,169,248,221,234,217,108, 7,214, 25, 60,132, 70,161, 74, 69, 45,146,220,116,104,142,220, 4,132, 83, - 51,196, 87, 92, 5, 11,123,160,209, 65,200,182, 19, 63,238, 64,243,190,184,232,218, 17,187, 88,253,126,209, 33,254,239,141,229, -255,189,238,124, 7,172,188,234,196, 39, 42,202,127,211,145, 79,254,236, 11,168,210, 11,114, 38,227,121,187, 77,182,155, 60, 96, -225, 14, 86,130,240,107,149, 23,167,253, 25,163,185,238,198,183,242,133,207,126,144, 48,180, 52,107,146,110, 71,208,234, 6,149, -163,221, 77,251, 51,215,101,151,202,137,127,135, 67, 75, 58, 50,120,105, 21, 97, 40,168, 37,208,108, 74, 26, 77, 65, 32, 5,194, - 74,194, 80, 78, 44,187,122, 71,168,139,181,134, 82, 89,178,145,166,223, 55,100,169, 33, 75,183,119,255,129,112, 9,113,210, 75, - 75, 78, 61,243, 28,214,194, 67,143, 60,201, 3,247, 63,200, 67, 15, 62,204,183, 31,124,152,167, 79,159,102,156, 22, 8,105, 41, -212,118,202, 92,112,195,201,228, 87, 20, 6,133,255,166, 82, 82,107, 77,241,246,183,189,133,193, 87,238,226,250,119,189,139,175, -127,238, 81, 46, 12,250,236,219, 61,205, 47,127,250, 33,222,125,251,141, 44, 63,250, 56,135,238,248, 14,206,124,245,110, 6, 79, - 62,194,212, 85,215,211,147,117,182,242, 49, 87,239,158,227,127,222,243, 56,131, 81,202,127,125,227, 75,120,244,244, 37, 30, 59, -191,198,241,153, 58, 11,161,101, 53,213, 60,254,196,115,252,196,219, 94,201,151,191,253, 12,247, 60,127,129,249, 86,131, 70, 28, - 49, 80, 78, 65, 26,135, 33, 55, 30, 90,192,140, 82, 86, 10,205,187,223,112, 3,105, 33,177,104,242,116,140, 21, 5,131,245, 30, -197, 40,229,208,241, 3,132,237, 41,234,173, 46, 50,105,160,149,101,253,236,105, 26,221,105,202, 97,143,246,254,227,232,124, 68, -214, 31,160,138,140, 48,169, 81,230, 99,116,158, 19,214,155,200, 40,166,216,220, 32,153,158, 65,103, 57,113,179, 69, 57,206, 40, -198,155, 36,157, 41,132,113, 45,122, 85,205,235, 34, 99,180,180, 68,123,255, 62,116,238,222, 40, 97, 0,245,233, 57,134,171, 27, - 4, 81,200,198,185,101,226, 80, 50,119,244, 56,151,158,122,218, 5,100,140, 7, 4, 81,157,241,242, 22,135,111,186, 30,149, 89, - 86,159,125,129, 67,215, 95,197,249,103,206,179,117,225, 28,221,185, 58,130, 6, 90,101,206,183, 45, 36, 83,251,175, 68,101,125, - 54,206, 60,207,160,127,145,118,103, 23,195,205, 85,106,173, 58,173,246,110, 6, 91, 43,236, 57,126, 45,217,198, 18, 74,148,204, -236, 61,196,212,194,126, 22,143, 94, 78,103, 97,158, 50, 31, 18, 98,104, 78,117,153,222,187,151, 93,151,157,164,189,127, 23,182, -180, 36,221, 58, 82, 5, 68,157,182,127,241,111,239,204, 30,188,247,159, 92, 24,134,113,105, 71, 74,187,131,178,114, 15, 87,233, - 73, 81,228,128, 8,198, 56,209,136, 86,206,239, 43,253,206, 60, 12, 69, 21,200,229,119,178, 16, 75,151, 87, 44,132,160,212, 56, - 69,170,117,157,122, 28,187, 96, 5,109,192,150, 6,157, 85,222,242,237,208,152, 80,128,205, 93,236,161,202, 32,236, 91, 86, 62, -173, 56,147,185, 55,218,150,130,102,224,128, 42, 67,227, 84,161, 74, 67, 39,134, 65,233,238,127, 43,132,225, 8,126,228,231,223, - 10, 43,203,228,155, 61,116,127,132,210,154,209,218,152,222, 86,206,198, 72,145, 42,203,131, 27,138,127,248,192,117, 52, 59, 17, -163,155,223,199,167, 62,250, 57, 6,171,107, 28,121,211, 27,217,247,186,215, 50,115,236, 0, 47,188,112,145, 39,159,237,115, 44, - 42,232, 16,176,146,212,216, 21, 41, 74, 33, 89, 26, 42, 94, 57,234,113,234,204,152,123,198, 49, 31,191,235, 49, 30,123,242, 28, -113, 83,112, 38, 55,100, 90, 16, 9,104,212,106, 76,207,181, 57,245,212,121,226,205, 77,108,153, 57,166,125,173, 78, 92,159,193, -108,173, 17,236, 58,142,136, 27, 4,179, 71,137,247, 28, 66,118,247,194,112, 9,139, 32, 63,117, 47,197,250,170,247, 60, 79,194, -199,189,177, 75,240, 23, 31,191,143,199, 82,203,141,243, 9,175,124,233,229, 62,180,185,178,158, 85, 33, 45, 46,239,209,218,170, -219, 54,147, 93,253,196,179, 46,133,255,138,219, 80, 26, 59, 25,191, 51, 25,253, 79,226,251,188, 42, 90,134,161,239,122,221,237, - 90,215,191,158,176, 51,231, 71, 60,162,146, 15,123,170,152, 87,186,151, 5,101, 81, 56, 5,119, 89, 32,133,116,239,195,178,164, - 44, 92, 26, 25,214,135,170,104,229, 64, 51, 82, 76, 64, 51, 24, 8,107,177,155,160, 43, 61,177,177, 85,234,120,172, 19,210, 73, - 41,221, 97, 17,120,101,190,181, 46,158,181,138,137,245, 98, 54,225, 15,106,163,118,164,129, 84,145,197,165,246, 84, 61,207,181, -183, 14, 99, 90, 21, 88,210, 7,200, 24, 23, 41,232,190,183, 54,254,188,114,187,127,167,144, 55,254,251,224, 44,108,126, 42, 50, - 41, 50,172,251, 25,221,125, 50,254,103,223,158, 38, 88,235, 4, 48, 86, 56,177,160, 48, 22, 83, 22,100,185,230,230,110,128,110, -116,169, 29, 57, 74,120,242, 42,152,154,131,168, 14,182, 62,177, 20,110, 31,126,190, 43,174,166, 39,149,120,209, 7,194, 76, 14, -212, 73, 87,110,255,157, 3,253,223,142,233, 43,239,185,218, 22,191,189,104,204,206,139, 15,247, 42,138,204,236,216,155, 27,189, -173,126,175, 48,113,136,109, 1, 29, 59, 95,119, 30,130,244,111,198,240,149,165,176,209,152,229,212,211,159, 35,169, 9,194,216, - 9,217,146, 72,210,108, 70, 78, 27,228, 87,143,214, 64,161, 12, 69,106,201, 82, 71,111,147,184, 49,125, 84, 19, 46,115, 61,112, - 26,147, 40,144,126,229,226, 0, 50,149,208, 24, 99, 49,165,113,162,244,212,208,219,212,164, 67, 40, 75, 75, 86, 56,199,145, 16, -130,208, 8,172,242,218, 36,225,174,171,175,125,205, 27,121,230,153,231,208, 24,146,122,147,215,221,241, 6, 30,127,252,113,167, -117,242, 67,174, 50,119, 38, 32, 71,230,146, 22, 29, 26,180,208,204, 47, 46,178,245,153,191,128, 56,161,117,104, 15,135,103, 98, -174,152,159,231,211,207, 45,243,202,189, 83, 92,118,237, 53, 92,255,234, 91,120,250,163,127,205,254, 55,188,107,107,151,232, 0, - 0, 32, 0, 73, 68, 65, 84,133,107, 63,240,211,108, 12, 71,124,250,190,199,248,139,111, 60,201,190,233, 26, 11, 81,136, 38,160, - 39, 66,126,238, 29, 47,231,192, 84,139,191,249,242,195,220,120,211,213,164,163,140, 7,206, 46,179,180, 53,100,247, 92,135,147, -179, 93, 78,175,110, 49,204, 10,108, 89,114,105,115, 64,145,229,204, 41,205, 74, 94, 50, 91,143,105,116, 23, 24,111, 93, 64, 74, - 67,156, 52,193, 74,218, 51, 51,200, 80, 18,215,234, 68, 81,140,136,234, 96,225,133,111,125,149,164, 22, 98,138, 49,141,217,121, -140,202, 80, 89, 74, 82,171,209,152,154,162,204, 51,106,237, 14,227,245,101,194, 70, 29,140,165, 54, 61, 75,186,185, 78, 24,199, -136,168,198,104, 99,157,198,204,156, 27,253,105,133, 78,115,172, 41, 72, 55,151, 65, 59, 88, 68,177,185,138, 16,154,149, 83,207, - 48, 92, 57, 69,186,185, 76,153, 13, 81, 69,206,202,115,103,216,117,217, 33,206, 63,250, 8,187, 78, 28, 39,235, 59,170,220,210, -153,231,232,236,107, 83,100, 57,131,181, 53,102, 14,236, 98,227,194, 57,130, 90,147, 70,219, 32,137, 49,102, 72,210,156, 33,205, - 10,202,113, 78,148,212,233,173,156,167, 61,123,128,122, 61, 65, 54, 26,180,166,103,208, 26,182, 54, 78, 83,111, 69, 52,218, 51, - 68,211, 51,204,204,239, 70,155,156,230,204, 20,157, 61,123,168,207,206, 50,179,255, 40,135,110,124, 37,157,185, 61, 68,205, 25, -108,156, 16, 4, 1,157, 67,199, 49, 74, 19,182,219,152, 34,197,106,231,135, 85, 69,193,117, 55,189,217, 97,152,133,131,115, 90, -207,105,175,180,201, 21,251, 93,226,226,172,149,134,180,112,137, 74,133,114, 99,199,234,154, 30, 8,167, 42,109,182, 4,113,130, -183,243,185, 47, 20,121, 43, 70,153,187, 74, 83,249, 40,195, 66,121,128,138,127,223,106, 13, 70, 25,164,133,192, 87,207,186, 16, -152,212, 82,140, 44,229, 63, 40,206,103,238,126,142, 20, 44, 36,176,233, 23,255,177,191,246,200,192,253, 91,102,220,247,204, 13, - 12,129,176,149, 96, 50, 47,156, 74, 66,140,214, 12, 54, 51,122, 67,197,214, 72,113,113, 88,240,170, 27,247,145, 52, 2,254,229, - 83, 75,252,223, 63,242, 43, 92,247, 61,111,228, 53, 31,249, 40, 39,223,253, 30, 14,191,234, 21, 28,127,243,219,184,227, 15,254, -128, 87,252,230, 47,115,239, 48,100,121, 88,176,124,105,196,115, 27,138, 91, 22, 98,214, 35,201,111,245,224,108, 2,101, 54,160, -214,130, 52,129,213,210, 50,178,176, 97, 12,103, 21,140,145,140, 71, 57,195, 66,178,150, 89,210, 48, 33,218,123,146,238,137,155, -160, 24, 96,211, 1,143,255, 63, 31,228,233,255,240, 10, 55,251, 19, 16,212,107, 4, 39,223,142,200,135,164,207,158,218,142, 60, -173,124,201, 90, 33,133,228,235, 95,121,148,127, 92, 51, 28,172,195,143,190,229, 58, 63,237,246,234,117, 15,246,216,217, 39, 86, -254,115, 25, 4, 19, 82,144,173, 68,120, 59, 83,119, 42, 72, 75,245, 77,119,248,205,237, 68,193,236,198,249,214, 88,231, 79,199, -199,228,118, 23, 60, 28,166, 82, 67,107,199,254, 54,218,101, 5,148, 94,225,142,197,250,139,180, 83,147,151, 20,105,138, 49,202, -113,180, 13,200, 80,122,158,123, 48,241,246, 58, 82,169,231,209, 91,215, 45, 27,173,188, 82, 88, 78,172, 87, 19, 56, 78, 24,110, -107,181, 38, 34,174,202, 15,237,221, 23,149, 23, 31, 59, 17,216, 77,132,114, 94, 7,224, 84,252, 98,242,248,107,165, 38, 95, 10, -175,196,119, 73,108,190,187,173, 86, 31, 81,228,178,196,165,179,190,133,158, 15,128,135, 7, 9, 31,158,226,138, 21, 95, 12, 84, - 42,127, 15,210, 81,202, 56,113, 99, 37,192,210,250,255, 35,236,205,163,109, 77,235,250,206,207,243,188,195,126,247,116,230,225, -158, 59, 15, 85, 69,205,163, 69, 1, 37,197, 12, 34,216,198, 9, 67, 18,210,145,132, 21,117,117, 47,237, 94,203,213, 49,246,178, - 77,186, 77,162, 73,107, 86, 52,157,164, 87,130,137, 24, 65,204,138, 70, 81, 64, 81,153, 4, 10, 40, 10,168, 42,168,233,214,157, -239, 61,247,204,251,236,225,157,158,161,255,248, 61,239, 62,167, 64,210,139,117,185,247, 86,221,161,206, 57,123,191,191,233,251, -253,124,209,218, 81,121,248,238,227, 61,244,137,211,116,238,187, 31,125,235, 29, 48, 59, 43, 74, 47,159,189,140, 17,112, 80,216, -237, 33,241,226,161, 21,249,244,238,173,254,127, 86,240,127,197,180,223, 60, 69,124, 16,211,249,102,213,222, 76,228,230, 96, 74, -175, 43,166,121,205, 58, 88,220,154,216,200,166,128, 55, 55,188,186, 98,154,112, 50,253,115,236,116,181,239,125,253,109,255,165, -214, 26, 30,125,253,251, 2, 47, 67, 73,160,148, 87,100,157, 88,106, 75, 91, 17,181,229, 73, 87, 85,158,114, 2, 54, 87,212,165, - 68, 15,235,176,173,136,188,167,152,120,242,220, 83, 77,124,152,234, 29,198, 91, 76,105,169, 3,101,178,174,106, 76,104, 72,108, - 56,223, 88, 47, 91,200, 68,100, 22, 68, 38, 4,199, 56, 61,237,121,156,247, 60,241,196,147,188,249,173,111, 38,106,117,121,221, -155,223,202, 39,254,226,207,176, 42, 92, 31,108, 24,168, 28,232, 86, 26, 30,208,177,199,107,143, 87,142,187,238,127, 21,118, 52, - 98,246,212, 49, 62,241,191,254, 44,127,254,149,151,184, 50,216,103,117,245, 8,175,188,101, 13, 91,143,248,215,239,251, 57,206, -239, 68, 92,250,230,101, 62,243,233,103, 73,142, 30,229,214,149, 30,111,120,197, 89,126,239,235,151,249,224, 47,188,151,163,253, -140, 79, 63,123,133,185, 35, 43, 60,112,106,145,207,157,191,206,191,250,189,207,240,119, 95,119, 39,215,135, 57,255,246, 15, 63, -203,255,248,170, 87,240,194,250, 14, 15, 30, 95,228,210,222,144,187,151,230, 40,173,231,145,181, 37,230, 23,122,220,118,124, 25, -167,224,241, 63,251, 20, 71, 95,113, 15, 85, 62, 65,121, 43,204,226, 50, 39, 47, 10,180,210, 84, 69, 49,189,181,157,184,231,126, - 58,139, 71,105,205, 44, 98, 77,133,142, 83,178,153, 89, 72, 19,156,243,180, 58, 29,188,215,244, 22,151, 80, 73, 27,111,107, 84, - 18,147,164, 89, 32, 67,201, 29, 47,158, 61, 74, 61, 30, 19,105,240,174, 98,188,181, 67,127,245, 56, 58, 78,168,171, 2,239, 61, - 81,210, 34,235,246, 89,185,229, 1,180,142,200,102, 59, 92,121,250,121,250, 43,109,177,163,237,142,152, 12, 70, 84,149,167, 59, -127,140,196,183, 88, 57,115,148,124,152,227,156,195,152, 17, 78,205,146,239,238,179,116,242, 52,101,105, 72,219, 61,172, 85,184, -218, 16,165,194,200,118,182,164, 24,110,176,122,226, 21,248, 73, 73,167,159,114,255,235,255, 58,174,154,144,245,150, 25, 13,110, -114,252,158,135,217,186,113,145, 94,127,153,213,115,119,176,112,226, 36, 88, 71, 57,222, 35,237,100, 68,177,102,225,236, 25,218, - 51,179,224, 99,116, 20, 81,237,238,163,179,152,114, 82, 99,204, 68,148,158, 58,162,215,159, 39,205,102, 41,236, 33, 62,114, 18, - 64, 8,225, 69,100, 67, 58,155, 9, 27,177, 50, 63,224,174, 91,215, 96,186, 15, 38,186, 56, 86,116,250, 18,127,154,245, 53,105, - 38, 34,146, 86, 44,111, 14, 13,168,144,155, 78, 45, 2,187, 52,172,132, 19,175,208, 86,163,141, 48,228,155,160, 3,107, 20,157, -167, 44,151, 39,114, 43,175, 28,204,198,176, 89, 66, 91,195,208,192, 92, 44, 47,252,202,192, 98, 10, 71, 90, 48,151, 64, 47,208, -154,178, 36,198,199, 82, 80,156,117,184,210, 81,148,146,143, 92, 90,120,113,199,241, 99, 63,253, 70,126,247, 23,191,204,139, 27, -187,188,120,251, 26,119,191,247, 39, 73, 82, 81,232,235, 88,209,238,116,136, 76, 78, 43,139,121,213,143,191,143, 47, 31, 57,197, -185,196,241,228,192,161, 21,188,247, 92,151, 94, 12, 87,107,184,102,100,147, 80,132,216,211,161,131,125,171,216,247,112,115, 84, - 98,116,202,206,230, 21,230, 86,103, 56,246,200, 99, 44,191,242, 53, 48,222,160,186,254, 18, 73, 84,241,125, 63,245, 27,108,173, -143,177, 79,126, 8,218,115,144,239,130,217, 65,157,122, 39,222, 74,112, 73,163, 55, 82,104,240,154,107, 95,127,129,247, 63, 55, -100,185, 5,239,188,123, 85, 38,179, 40, 80, 0,189, 11, 19,119, 16,178,133,102, 0,231,130,181, 56, 20,203, 80,216,155,184,213, - 38,114,118,186,178,158,114,230,221, 84, 12,166,149, 58,152,166, 26,218,150,115, 33,238, 52, 14,108,121,115,240,128,119, 33,254, -212, 7,106, 91,240,197,123,107,241,166, 2,107,112,166,196,216, 16,182,226,154,108, 77,135, 53,246,224,166,170, 52, 81, 72,150, -147,245,184,232, 10,234, 58,140, 62, 46,192,100,130, 13,173, 41,128,234,176, 32, 78,224,237,242,251,173,220,232, 27,196,156,111, -110,182, 32, 73,140, 38,220,244,157, 23,188,107, 81,139,197,206,185, 32, 52,148, 70,196, 20,225,254, 29,166,109,103, 2,243, 29, - 97,132,120,156,228,212, 39, 17, 58,213, 16,203,215,195, 6, 11,158,136, 29,237, 1,182, 54, 52, 37, 62,184,130,154,143,181,209, - 10, 88, 83,163, 21, 76, 42,203, 67, 75, 29,226, 51,183,146,222,113, 55, 44, 31, 17,144, 12,201,183, 21,244,230,107, 44,172,128, -102, 66,111, 86,228,230,192,135, 58,181,179,125,167,226,237,254,138,159,251,208, 28,216, 67,119,244,176,246,115, 70,190, 25, 43, - 2, 28,107, 2,181, 37,168,220,203, 92, 10,183, 58, 44,150,115, 82,212,203, 74, 10,187, 9, 69,222,148,193, 51,235, 14,130,214, -253,193,199,214,108, 34,226, 88,196,142,119,223,247, 63,200,243,169, 29,145,117, 98,178,150, 14,144, 44, 77,218,210,232, 84,145, - 79, 60,195, 93,152, 12, 33, 81, 50, 73,215,185,104, 73,170,250,224, 25, 99,166, 22,122,143,173, 29,101,109, 25,236, 85, 12,135, - 53, 69,105,168,106, 75, 93, 89,137,195,245, 30, 99, 60, 74, 55, 11, 9, 37,247,124,171,228, 25, 20,150, 14,206,195,229,107, 87, -121,254,252,121,126,240,135,126,144, 79,252,249, 39,185,185,177, 67,101,228,239,244, 62, 0,149, 37, 28, 73, 79,173,129,193,209, -194, 61, 15, 61,192,232,234, 53,102,206,221,194, 3,223,251, 24,239,254, 71, 63,207,229, 43,215,120,230,197, 75, 36,113,196,198, -139,207,241,217,245,130,229,123, 31,226, 31,253,167,143,242,127,126,224,163,124,229,241,175,242,187, 95,191,200,147, 47,190, 68, - 85, 27,222,244,115,255, 47, 15,223,178,198, 39,190,113,137,127,252,159,255,148,163,115, 61, 58,145,226,133,107,219, 44, 44, 45, -242,214,227,243, 92,217, 29, 19,197, 9, 71,187, 45, 42,107,233, 42,197,196, 88, 78,245,219,124,121,125,155, 43,195,130,225,238, -144, 94, 20,243,103, 79, 60, 79,177,179, 78, 89, 26,140, 41, 68,204,102,133,233, 76, 64,104,154,170,160, 24,238, 17, 37, 29,242, -221, 77,246,174, 93, 98,176,126, 89,110, 85,206, 16,233, 8, 13,196,237, 46,202, 91,162, 78, 15, 95, 87,210,253, 89, 79,220,105, -227,234, 66, 84,240, 71,143,227,139, 49,155,207,189, 64,212,237, 17, 37, 41, 89,127,134,114, 56, 20,166,179,145, 53,220,104,119, -143, 40,129,108, 97,149,221,203, 87, 41,199, 53,147,237, 77,214,110, 57,205,197,175, 62, 67, 57,218,225,218, 11, 95,193, 81, 49, - 30,110,211,157,239,224, 76,155,122, 82,144, 15,247, 73, 59,125,118,183,111,146,102,226,135,150,247,100,140,181, 5,237,222, 12, - 73,214, 99,255,198, 37,122,115, 43,164,221, 14, 42,234, 97,117, 65,220,234, 50, 25,109,210,159, 63, 70,127,105,133,185,165,163, -108, 62,255, 28, 73, 43,161,191, 48, 67,156,164,216,188,100,102,229, 24,206, 87,180, 59,179,116, 86,142,179,127,253, 6, 90,235, -112, 47,172,137,162,136,186,178, 18,217, 23,117,166, 57,220,222,195,242,218,157, 18,144, 96, 14,132,172, 77, 30,131,157, 58, 85, - 60,181, 5, 99, 4, 15,107, 2,106,179, 44, 61, 85, 45, 41, 70,113, 72, 97,140, 91, 34,130,107,183, 52,173, 76,216,238, 42, 81, - 68, 40, 90, 33, 27,162,157, 41,210, 84,178,136,211, 52,194,107, 77,214,210,164,177,166, 21, 41,116, 13, 73,228,165,216,148, 30, - 55,241,236,189,224,233,103, 33,231,221, 11, 65,174, 27,139, 13,175,165,225,114, 17,222,223,192,184,134,157, 90, 26,128,194,192, -137, 76,226, 26,189, 85,248, 96, 94,247,133, 65, 41, 17, 8,214,193, 18,167, 82,207,149, 17, 60,183, 7,255,234, 51, 31, 99,231, -234, 5,116, 20,145,245,231,185,244,252,147,124,248, 3,255,140,107, 23,191,201,194,202, 42,187,181,230,103,251,123,216,180, 69, -221,239,243,205,155, 57, 71, 86, 82,254,214,177, 54,251, 78,152,235, 35, 96,228,229,199,185,135,125, 5,198, 41,150,143, 44,240, - 7,239,255,109,222,248,198,219,184,253,251,190,143,197, 7, 30,130,189, 43,184,241, 62,245,104,159,129,173,176, 64,103,166, 77, -113,245, 69, 40,247,161,213, 71,153, 18,149,236,178,252,247,127,125,154, 1,222, 88, 9, 7,215, 55,248,165, 47,108,224, 99,120, -245,145,140, 71, 30,188,109, 90, 8,154, 41,177, 33,129, 53, 64,160,198, 87,172, 84, 3,151, 81,211,130,217,144,216,228, 14,227, - 56,112,185,201, 52,220,252,131,105,161, 80,210,188,121, 43,197,116,122,134, 49,246, 16,160, 38,152,114, 93, 19,211, 41, 35,138, -242,158,122, 50,164,174,202, 32, 58,107, 97,141,197, 22,146,124,225,157, 17, 98, 92, 19, 32, 18, 30,100,205,116, 46, 76, 18,143, - 55, 14,175,253,212,190, 54, 93, 87, 7, 45, 0,232,144, 83, 82, 29, 82,234, 75, 67, 74,104, 50,228,125,225, 14, 9, 7, 15, 32, - 52,206, 57, 9,252, 49, 70,154, 93, 27,126, 30,128, 52, 77,113,247,138,176, 41,240, 97,186, 62,160,160,201, 58, 74, 86,189, 4, - 56,142,156,169, 85,200, 90, 87,211, 27,126,147, 30,103,173,108, 2, 60,128, 49,225, 38, 31, 44,118,225,155,113,158,219, 50, 75, -118,230, 44,209,209,227, 48,211,131, 78, 87,176,175, 62,249, 14, 5,189, 57,178,153,151,217, 10, 15,204,223,223, 73, 40,231,255, -138,169,253, 32,236, 71, 68,113,135, 0, 53, 13,135,215,218,131,130,236, 12,211,123, 95, 25, 38,240,218,200,247, 69, 57,165,120, - 6,150,182,124,220,101,142, 31,141, 26,171, 78,152, 50, 10,166, 55,193,170,154,166, 13,126,171, 18,222, 89,195, 91,223,249,127, - 17, 71, 18,200,210,235, 69, 68,137,150,231, 86,124,176,128,202, 43, 24,142,133,177,225,173,162, 46,196,178,214, 92, 7,116,128, - 17,213, 65,255,103, 45,212,149, 99,176,103,216, 88,175,217,221, 51,140,246, 45,249,200, 80, 20,134,162,116,148, 97, 51,105,140, -111,184, 57,242,231, 25,168,173,167, 54,240,174,119,255, 45,126,244,111,190,135,247,188,247, 61, 60,242,154, 71,208,177,226, 29, -239,252, 94,254,230,223,126, 15,170,209, 54,133,141, 39, 10,226, 72,201, 65,223, 91, 71,109, 21,177,246,156, 57,182, 68,244,216, -155,217,250,250,227,124,249, 99, 95,167,158,187, 78,235,214,187, 57,126,233, 37,190,247,135,223,200,199, 62,240, 71,188,226,236, - 26,191,252,219, 31,227,201, 27, 91,220,190, 60,199,149, 97,193,127,120,207,235,248,212, 51, 87,249,216,115, 87, 57,183,208,227, -119,190,244, 60,191,252,131,223,205, 47,252,215,207,242,153, 56,226,103,223,124, 63, 31,124,252, 89,126,229,247, 63,203, 47,254, -216, 91, 73,127,247,147,252,206,227,207,242,158,239, 58,203,175,125,254,121,222,120,118,141, 63,121,113,157,119,220,115,154,203, -123, 35,134,133,225,141,183, 30,227,179, 47, 94,231,210,229,117,102,151,214,184,126,225, 58,155,219, 91,116,122, 51, 84,251,134, -124, 50, 17,193, 76, 49,161,237, 60,189,165, 35,140,110,174,179,116,238, 14,198, 59, 59, 44,159, 56,134, 45,115,226, 44,147,104, -186,124,130, 87, 17,206,121,210,118, 15, 51,217,199, 84,181,184, 40,211, 4, 21,162, 13,147,217, 69,234,193, 54,237,185, 30,182, -168,208, 73,130, 41,199, 68,190, 21, 54, 80,134,209,198, 38,155, 23, 46,115,242,222,123,184,252,181,175,211,155,155, 97,239,202, - 13, 98, 85, 19,165, 29,188, 87,244,230, 23,153,236,110,210,238,118, 25,237, 12, 89, 58,186,194,112, 48, 34,207, 75,156,141, 37, - 97,169,244,116, 22, 59,236,173, 15,233, 47,119, 40,203, 26, 48, 98, 51, 52,150,108,118,158,237,171, 79,210, 95, 58,137,138, 20, -227,193,117, 90,237, 57, 70, 59, 27,204,173,157, 97,126,249, 4,206, 25,116, 75,147,181,123, 88,239,152, 12,246,169,139,130,253, -173,171,204, 31, 59, 78,218,155,165,191,182,202,240,230, 58, 81,106,169, 75,133, 55, 37,217,194, 18, 94,131, 78, 82,234,170, 38, -109, 69, 56, 11,113,226,121,237,155,255, 6,207,126,227,243, 76,137,159,225,253,226, 67, 16, 8, 86, 88,237,205,117, 76, 59, 80, - 78,201,166, 54,146,247, 96, 89, 74,156, 96,214,209,248, 72,147,198,160, 50,168,115,143,110,123,234,218, 17, 39, 98, 71, 73,194, -116,151,180, 52, 81, 18, 84,214,177,166, 82, 34,128,138, 99, 5,149,199, 86, 13, 28, 77,177,244, 13,195, 87,114, 41,210,165,149, -111, 90,203,154,189,165,101, 90,111, 74, 82, 55,112, 85,102, 98,177,182, 21, 78, 38,250,124, 52,146,253,127,228,160,170, 81,153, -216,184,162, 72, 48,183, 19, 7,131,170, 67, 10, 60,117,122,153,185, 52, 35,207, 50,162,168,195, 7,126,237, 31,242,133, 47,127, - 9,235,225,227,159,250, 10,183,124,215,107,248,153,245,231,248,200,139, 3,198,115, 61,108,105,249,210,216,114,110,175,230,209, -187,102, 73, 20,252,235, 75, 57, 29,160,163,229,243,166, 16,191,252,108, 10,147,209, 22,239,120,199,157, 28,125,228,181,180,143, -172, 17,233, 10,175, 35, 76, 49, 65, 37, 17, 73,171,205,171,129,149, 51,243, 50,233, 76,118,195,243,114,140,143, 83, 90,167, 78, - 16,205,174,226,247, 55,169,106, 75,226, 45,191,242,137,151,216, 86,112,123, 27,254,206, 59, 31,146,134,174, 41,234, 65,145,221, - 76,119, 58,100,160, 79,173,104,145, 62,120,152, 43,125, 40, 35, 93,152,239,186, 17,139,121,139, 10,140,127,165,227, 48, 64,134, - 98,173, 27, 27,114,132,115,149,196,112,171,230,230,111, 67, 13,141,192, 22,162, 94,183, 86,114,217,131, 63,217, 24,137, 84,117, - 90,240,178,174, 42,131, 61, 75,138,173,210,209, 84,144, 54, 21,199, 25,135,234,164, 68, 13,213,205, 26,185,167,219, 6, 12, 35, - 19,186,138, 29,182,116,168,112, 59,215, 73,160,246,225,113, 85, 80, 77, 39,137,164,134, 5,144,143,111,210,218,124,131,198,245, -161, 57,113, 88, 39,217,232, 56,135, 78,210,233, 58, 63, 10,242,230,230,212,224,157, 17,154, 37, 97, 59,100,108, 16,148,202,122, -223,167,145, 52, 12, 62, 58,164,186, 15,125,143,115, 34, 36,181, 34,186,243, 78,238,242, 77,196,158, 19,223,105,184, 38,196,232, -170, 96,241,212, 25, 88, 92,130,118, 10,105,231, 0,242, 18,136,111, 47, 95,189, 31,190,161, 55, 98,180,195, 43,115, 23,178,212, -195,118,198,127, 39, 81,220,183, 20,249, 70,229,238, 15,221,193,155, 45,141, 53,161,169, 9,147,181, 57,244,115, 31,226, 91, 61, -146, 73,234,226,131, 7,145, 51, 80, 11,198,215, 7, 65,162,206,186, 33,171,189,148, 19, 21, 72,145,143, 99, 80, 9,158, 26,165, - 15,154, 25,165, 53, 11, 75,103,105,183, 99, 58,189,136, 86,170, 2, 22, 91,190,183,178,240, 33,109, 9,216,105, 92,120,170, 2, - 12,158, 44,134, 52, 21,198,134, 69, 6,142, 68, 11,210,119, 50,246,212,214,177,187,107, 24,140, 28, 12, 60,157,174,162,151,202, -122,190,200,101, 35, 40,197, 91,133,169, 93,145,133, 5,140,117,130,192,127,255,251, 63, 48, 93,213, 79,161,123,234,224, 37, 17, -150, 99, 33,150, 26,116, 26, 69,196, 74, 19,121, 69,172, 52,206, 66,123,238, 94,218,173, 54, 31,251, 79,127, 65,103,110,142, 15, -255,193,159,210, 27,141, 57,183,188,194,199,127,239, 83,228,147,146,135,239,191,133,170,170,232, 37,154,167, 54,118,121,242,202, - 54,127,113,126,147, 59,110, 63,195,114, 39,225,202,206,136,126,164,248,229,143, 61,206,191,122,247,163, 92, 88,223,225,227,207, - 92,226,181,167,150, 72,241,252,199, 63,250, 34, 63,240,216,221,140,119, 6,140,218, 93, 94,125,124,137, 78, 55,227,142, 35,115, -124,245,234, 22,221, 36,101,127, 82,210,153,233,115,231, 98,135,122, 92,114,237,194,115,100,115,139,204,204, 31,165, 44, 42,234, - 90,222,252, 62,146, 46,176, 26, 15, 25,174, 95,165,189,176,194,246,197,243, 84,227, 33,233,220, 17,226, 52, 69, 71, 17,163,173, - 13,188, 43,177,165,248,251,108,152,210,147, 86, 27,208,140,119,182, 4, 40,163, 53,213,206, 77,246, 46, 95,101,246,204, 57,168, - 11,198, 91,155,164,221, 62,222, 89,242,189, 93,108, 93,160, 35,205,201,187,239,100,120,115,151, 88, 27, 76,229, 32,178, 44,157, -190,149,193,205, 13,162,212,115,227,133, 75,248,196, 48,222, 47, 81, 84,212, 14,246,215,111, 82,215, 67,172, 29,208,202,186, 36, - 45, 67, 93,165,232,164, 34, 82,109,138,114, 72,148,206, 2,145,172,175,235,146,172,187, 34,171,113, 21,209,154, 89,228,212, 61, -223, 77,148,212, 20,227, 1,229,120,159,164, 55,139,169, 75, 90,157, 57, 48,142,217,181, 85, 84, 26,227,108,142, 43,157, 76, 58, - 74,194, 54,214,159,187, 76, 49,222,167, 46, 36,170, 48,109,183, 81, 90,124,225,242, 62,117,212, 85,205,109,119, 62, 42,153,229, - 33,109,209, 29,228, 42,136, 50, 51, 52,221,205,251,205,132, 27,106, 89,129,169, 69,232,134, 13,197,189,144,199,135, 15,249,158, -226, 73,215, 36,169,228, 11, 39,169,208,154,226,200, 7,180,179,208,158, 60, 78,172,110, 77,214,171, 86, 68, 78,110,239,186,112, -236, 93,242,108, 23,176, 91,138, 77,205, 0,173, 72, 20,238,203,153, 8,249,250, 49,100, 33,209,205, 42,121,241, 87, 86,132,116, -206,135,155,123, 28, 80,116,173, 20,213,138,137, 35, 69, 18,107,102,219, 26, 29,193,133, 63,126,154,139, 14, 30,121,229, 93,148, -163, 1,117,145, 83,141,246,249,232, 39,191,196,218,202,157,124,238,230,105, 80,154,159,123,225,113, 62,244,213,109, 54,146,136, -207,108, 78, 80,198,178,239,224,165,157, 10,149,192,171,239, 91,228,127,191,115,134, 19, 45,205,134,129, 93, 7, 67, 15,111, 90, -136,249,177,187,230,120,211, 59, 30, 96,245,161, 87,209, 59,119,142,246,114, 15,148,193, 22, 57,222, 86,196,173, 54, 89,148,240, - 47,254,233, 91,232,220,118, 26,157,205,201, 46,176, 28,131,169, 81,213, 8, 95,109,177,244, 55,254, 15, 65,137,122,199,207,255, -246,147, 92,168,224, 88, 2, 63,245, 78, 1, 64, 53,247, 87, 81,179,135, 67,111,220,172,185,165, 16, 79, 87,235,214, 78,149,195, - 83,174,118, 28,208,165,145, 20,148,233,221,188, 41, 14, 86,124,141, 30, 65, 93,249, 16,177, 39,194,180,120, 58,181,121,107,240, - 69, 62, 85,197,131,147,156,245, 72,135,194, 44, 15,245,120,138,151,181, 56, 83, 73,254,121, 19,212,130,158,222,200, 69,224, 33, -250,129,230, 69,169,211, 84, 10,165,115,184, 0,200,137,116,132, 78, 68,208, 4, 26,173,117, 16,168, 73,138,154,156,197, 67,222, -186, 86,216,128, 90, 61, 36,166, 6,219, 8,235, 36, 71, 94,208,181, 58,220,255,197,139,175,211, 24, 21,136,138,214,123, 73,141, -115, 70,144,178, 97,155,225, 3,109, 94, 69, 26,103, 28,166, 62, 8, 90,240,222,227,141,232,121,228, 44, 36,236,121,140,132,138, - 88,107, 37,218,213, 57,129,206, 56, 41,228,206,186,224, 96, 80, 24, 21,113,118,190, 3,253,190,252,185,105,235, 16,127,221, 3, - 21,222,151,225,222, 92,133,111,223,178,114,247,223,186, 86,215,255,125,129,251,183, 21,244,239, 96,109,107, 80,178,211,137,253, -144,146, 61, 82, 7, 34, 78, 1,167, 31, 20,120, 99,164, 25,176, 14, 95,213, 2, 9, 50, 6, 87,228,216,253,125,204,112,128,175, -106,108, 94,134, 91,123,216,122,140, 71, 7,127,214,183, 9,230, 60,183,221,249, 14,218,237,136, 36, 9, 5, 61, 86,211,224, 24, -135, 19,175,122, 8,113,201,173,163, 48, 30,175,157, 76,214, 65,124,111,131,205,183,178,142,178,114,236,237, 90, 54, 55, 45, 91, - 91,150,141, 45,203,214,166,229,250,186,101,107,203, 49, 26,138,189,215, 84,210,238, 89, 3,117, 41, 77, 67, 97,164,129,170, 11, - 97,131,136,190, 72,148,241, 13, 30, 63, 77, 15,233, 91,213,193,243, 53,110, 71,154, 81, 41,112, 8,173, 97,113,110,129, 56, 89, -167,246,150, 55,254,208, 15,242,233,143,124,130,239,123,221, 93,108,230, 53,159,255,242,121,126,226, 87,126,138, 79,254,155, 15, -242, 23,207,221,228, 53,103,151,185,246,228, 62, 71,218, 17,221, 94,155, 63,127,230, 18,191,249,185,111,240,163,247,156,226,157, -119,156,224, 87, 63,253, 77, 22,250,109,190,120,101,135,127,254,174, 87,243,235,159,120,154,213,149,121, 30,213,138,199, 47,239, -240,196,249,155,188,235,209, 59,248,195, 47, 62,199,143, 60,118, 23,191,250,145,199,121,236,174, 51, 92,222, 30,134,164, 36,207, - 98, 47,225,146,142, 89, 93,238,211,137,219,236,108, 94, 67,199,154,118,187,197,104, 8,137,242,212,147,154, 36, 49, 36, 89,135, - 36,107, 81,142,118, 73,187,125,162, 56, 34, 74, 91,228,123, 3, 58,237, 21,188,181,116,214, 94, 65,181,189,137, 78,192,149, 69, -240,144,182,185,246,228, 23, 56,249,170, 71,169,134, 19,226, 94, 31, 95, 37, 56, 91,161, 85, 76,212,235, 99,182,119,200,122,125, - 76, 53, 98,188,125,131,164, 53, 79,148,182,240, 46,102,247,250, 58,107,119,156,226,218,211, 23,201,250,154,218, 20, 76,214, 39, -232, 72,209,233, 45, 65,189, 69,183,155,160,146,121,118,174, 93,195, 26,143, 27, 79, 88, 88, 89,166,200, 75,218,115,139,220,120, -238, 37,150,143,119, 41, 93, 77,210, 89,160, 30, 12, 48,213, 38,174,101,217,187,121, 25,180,199, 84, 5,237,217, 89, 34, 29,177, -191,125,157,180,189, 72,146,143,233,173, 30,193, 26, 67,149,239,177,116,244, 52,237,185, 89,138,193, 30, 90,139, 8, 42,237,204, -162,146,136,209,214, 22,147,205, 13, 86,110,187, 27,231, 42,242,193,132,228,200,172,116,251,214, 18,197, 41,120, 43, 14,129, 56, - 33,214,138, 31,125,235,219,121,254,202,243,124,241,233,243,211,109, 91,124,232,197,171, 36, 80,141, 72,123,156, 11,201, 96, 90, -133,219,162,162, 54, 80,228,144,181,193, 20, 30,157,138, 71, 83,200, 87,144,117, 84,152,124, 32,107, 43,210, 76,160, 41, 90, 67, -229, 28, 70, 43,185, 21,162, 80,169, 40,230,125, 14, 45,231,136, 47,123,158, 43,229,191,197, 43,232, 42,216,179,144,134, 97,192, - 88,249,185, 53,208,138, 3, 35, 57, 88,243,186, 17, 12, 3, 58, 54, 42, 45,168, 56,224, 87, 99,162,128,121,138, 19,133, 25, 58, - 86,186,138,207,127,230,235, 12,128, 59,111, 63, 73,177, 47,241,158,152,156, 61, 11,127,248,213,111,240,203, 43, 17, 63,240,170, - 87,242, 47, 62,127,137,167,252, 13,226,194, 50,246,138,182,130,235,132,105,127,232, 56,115,207, 12, 15,174,205,179,118,124,155, -237,237,156, 52, 82,204,246, 90,204, 28,153, 97,238,150, 83,204,221,118, 7,237, 99, 39,200,150,103, 33,213,184,237, 77,124, 89, -226,124,141,142, 82,204,120,200,241, 31,254,219,140, 95,248, 10, 81,175,143, 47,135,226,139, 78,218, 33, 65,171, 67,235,248, 93, -124,248, 47,174,240,145, 23,175, 19, 71,112, 91, 15,126,242,123,238, 97,102,166, 47,170,118, 4,168, 34, 91, 80,133, 15,156,124, - 20, 7, 5, 53, 22, 15,162,196,117,170, 3,198,182, 23,144,191, 15,185,233,132,175,157, 68,241, 29, 82,206,155, 32, 20,115,117, -112,142, 88,228,208, 34,222,107,239,100, 61,110,118,215, 73, 22,142,224, 85, 5,196,242,235,146, 36,112,203,139,144, 57,110,195, -148, 43,163,136,248,204,229, 99, 16,107, 24, 18,100, 98, 85, 0,232,132,164, 53,107,136,226, 20, 31, 5, 76,108, 99, 59, 11,118, - 60,101, 68,140,215, 52, 52, 74,201,180, 52, 21,194,105,143,175, 61, 74, 9,177, 45, 78, 82,168,101,107,164,130, 37,138, 52,150, -116, 52, 26,129,188,159,110, 15,148,245,144, 52,154, 18, 63, 37,210,249, 58,136,235,106,137, 20,244,181,136,192,188, 22,100, 40, -206, 9,242, 88, 49, 21,191, 41, 35,106,121,231,101,184,142,104,154,160,144, 86,232,152, 38, 59,250, 16,172,162,163,136,204, 26, - 90,179,115,242,166,141, 35,185, 77,171,228,192,129,160, 14,243,249, 15, 21,108, 26,205,128,123,121, 1,126, 89,172, 26,223,193, -195,126,248,215,248, 67,152,216,230,255,204,203,127,153,179, 47, 87,189, 55, 58, 9,117,232, 80,124,160, 24, 59,216, 24, 4, 65, -143, 55,181,232, 24, 42,131,179, 5,170,182, 40, 21, 67,156, 96, 71, 35,162,222,140,112,141,226,112, 31,140, 98,177, 75, 70,233, -203,236,109, 15,191,230,231,121,242,241,143, 3,154,184, 89, 6, 52,205,149,151,103,156,113,142,210,136,200, 77, 71, 65, 70, 24, - 88, 29,104,133,173, 61,149,177, 2, 47, 43, 96,127,207,178, 55,176,228,185,199,148, 80,228,142,105, 86, 75,165,200,199,225,124, - 25,190, 53, 0, 25, 23,222, 87,214,203, 6, 52,214,112,223,189,247,242,224,125,119, 31,144,117,129, 15,254,214,127,166,110, 44, -190, 7, 9,149, 41, 45, 85, 81, 7, 69,225,194,194, 18,155,255,237,131, 44,220,114,146,211, 63,248, 70,230,239,185,135, 63,254, -192, 31,240,153,175,126,149,145,138, 56,255,181,175,241,224,247,191,129,232,249,155,188,239, 55, 63,202, 98, 22, 51, 42, 12, 30, - 77,165, 21,119, 47,207,240,204,141, 93,156,142,248,181,247,188,158,255,242,103, 95,229,223,127,246,155, 60,177,218,231,123, 31, - 60,195,135,191,240, 44,167,143, 44,112,247,234, 12, 95,185,116,147,249,185,179,188,246,129, 51,124,237,234, 54, 63,254,182,135, -248,203,167, 46,177, 55, 24, 49, 40, 74,238, 94,157,103,125, 84,176, 21,197,164, 74,113,254,133, 23,152, 91, 61,198,112,176, 67, -153, 23, 68,174,162,246, 50, 25,216,114, 36,113,144,104,146, 86,139, 40,201,168,203, 18,147, 15,177, 85,129,247,142,238,226, 50, -118,188, 31,162, 31, 59,232,180,205,254,165,231,233,174,157, 96,238,232, 81, 72,250,224,135,232, 40,102,184,125,141,229,219,110, -101,124,243, 58, 42,214, 36, 89,202,230,133, 11,180,123, 29,146, 44, 35, 74, 18,226, 36,227,250,243, 23,209,170,194, 90, 77,153, -231,244,230,231, 25,141,247,177,101,194,112,112,137,217,181, 91,209,164,168,164,195,214,181, 75,236, 94,218, 96,238,204, 12, 43, -167,110,163,156,140,169,138, 9,197,112,151,254, 92, 74,111,249, 40,155,151, 55,200,102, 58,224, 43, 58,115,199,133, 70,228, 28, -206,213, 36,157, 89,140,171, 73,186, 61,218,115, 75,180,186, 5,221,185, 37,174, 63,251, 36,139,199,110, 69,199,109,202,201, 22, -203,179,119,160, 72, 40,134,155,100,189, 57,186, 75, 75,244,151,142,224,156, 33, 61,119, 43,237,185, 62,163,237, 45, 58,243,243, - 2,188, 48, 86, 30, 88, 65, 84, 20,199, 49, 90,195,220,204, 60, 15, 47, 29,227, 77,119, 63,196,179, 23,126,149,193,222, 24,244, -193,251,173,209, 18, 17,208,173, 81, 36, 47,240,198,229,169,163, 64, 56, 50,114, 91,143, 90, 26, 91, 43, 8,120,196, 40,130,220, - 41,201,118,198,139,117, 43,112,190,173,149,238,222, 7,114,140,211,160,236, 33,125,118,237,121,241, 9,203,118,121, 40,181,209, - 67, 59,146, 27,117,132, 20,109,239,165,160,119,244, 84, 63, 53,197,221,102, 26,142,165, 80, 94,187,137, 74, 84, 88, 47, 39, 56, - 59,162,221,137,137,149, 34,139, 52,243,153, 38, 29,229, 28,157,209,124,254,207, 62,207,223,122,199, 15,179,113,115,140,141, 60, -191,243,163,119,113,174,117,138,199,213, 9,126,226, 23,255, 29, 51, 9, 24, 37, 19,120, 91, 43, 46, 79, 74, 22, 58, 45,198,133, -129,200, 83, 86,158,217, 83,203,180,151,230, 56,237, 28,222, 69,164,189, 30,237,133, 21,210,163,199,104,173, 28, 37, 93, 93,130, - 86, 11, 63,218,198,185, 28, 87, 21, 33, 22,212,160,108, 37, 78,142,213,115,224, 12,110,180, 7,105, 42,146,135, 60, 66,233, 20, - 98,197,211, 62,165, 5,156,238,192, 79,188,253, 94,102,103,251, 1, 14,166,167,225, 36, 42, 0,100, 36, 62, 85,135,226, 43,235, - 72, 23, 48,175, 81,152,114, 85,227,211,214, 97, 61,219,212,248,131,205,189, 8,200,180, 14, 2, 73, 2,137, 77,225,172, 21, 43, - 28, 14,156, 20,103, 29,126, 94,109, 92,164,125,238,254,105,172,170,169, 75, 18,239,208,173, 12, 21,197,184, 60, 15, 43,247, 92, -242,225,117, 68,156,166,228,195,145, 76,184, 1,101, 59, 21,240,185, 90,190,134,198, 17,121, 37,192,150, 88, 86,217, 62, 8,234, -180,142,167,112, 22,240,248, 40, 14,174,228,176,150,215, 42, 20, 26, 29, 68,127,160,147, 88, 86,220, 77, 24, 72,176,147, 73,230, -185, 15,162,209,122,202,195, 23, 78,128,154, 90, 61,124, 16, 32,218,170, 10,201, 44, 34, 22,244,166,134, 72, 99,170, 90,222, 83, -173, 86, 80,213, 7,156,178,150,105,181,185,191, 11,178, 20,156,138,208,205,103,221, 29, 8,228, 26,167, 0, 74, 97,117,196, 82, -190,143,141, 23,136,188, 19,161, 89,154, 74, 81, 53,145,200,173,189, 2,101,190, 37, 46,213, 77, 69,139,130, 42,251,239,212,241, -111,155,204,213,183, 76,244,135,115,210,221,161,109,124, 88,253,153, 74,110,222,198, 4,249,182,159, 10, 16, 15,120,238, 94,198, - 81,107,166,103,147,198,159,238, 66, 68,114,227, 38,176,181,216,247,116, 43, 35,153,111, 99,198, 57, 42, 46,208,173, 12, 63, 42, - 80, 89, 39,220, 14,191,221,118,215,235,159, 70, 5,184,133, 53, 54, 52,129,242,186,177, 86, 84,234,182,161,187, 21,146,119, 51, -181,198, 39, 42,184,239,100,226, 30, 27,203,112,224,216,222,118, 76, 10, 79,153, 75, 6, 59, 70,238,231, 10, 37,122,165, 58,104, - 3,235,112,206, 52, 18,179,106, 67,248, 85,208, 83, 98, 61,220,123,231, 93,124,232, 67,191,131,113, 22, 21,123, 34,127,144,165, -174, 17,180,172,114, 16,189,225,238,254, 47, 12,139,154,202, 89,140,119,188,254,173,239,166,119,241, 37,246,138,121,242,103,254, -136,254,137,121,110,123,224,117,252,208, 15,189,157,211, 89,202,169,147,171,252,211,255,240, 39,156, 95,191,193,171, 79, 44,113, -101,119,204,106, 43,162,221,235,242,240,173,183,240,165, 11,151,169,173,227,252,230, 30,159,126,238, 58,127,253,209,219,121,244, -228, 2, 55,183, 6,124,228, 27,215,248,145, 87,222, 74, 43,210,108,143, 75,238, 60, 50,207, 71,191,126,129, 88,107, 92, 89, 51, -172, 29,189, 68,115,255,173,107, 88,227,105,165, 41,155,251, 19, 34, 5,115, 89, 66, 84, 22,220,250,192,131,108,111,222, 68,199, - 49, 69, 97,184,118,241, 10,143, 60,246, 40,217,252, 18,214,137,162, 43,157,157,197, 59,133,142, 99,146,206, 60,202, 25,162,172, - 29,194, 58, 10,162, 36, 65, 39,169, 88, 61,226,136,209,205, 29,102, 79,158, 96,255,202,121,218,243, 75,216,178, 98,188,113,157, -206,242,154, 68, 20,230, 57,213,164,162, 28,237, 97, 43,195,120,103,147,133,147,107,120, 82,242,221, 93, 22,207,158, 97,231,226, - 37,188,181, 36,169,166, 46, 13,163,193, 54,237,110, 6,222, 96, 77, 68, 81, 84,212,227, 29,226,246, 42,118,114, 21,218, 29,234, -137,195,185, 10,103, 99, 58,179, 41,206,181,201,247,115, 76,109,105,117,193, 89, 77, 20,183,104,247,231,196, 18, 99, 61, 89,119, -158,186, 30,179,116,244, 22,198, 59,235, 20,249,144,165, 83,119,144,205,206,113,245,155,143,147,181,103, 88, 58,123, 43,189,149, - 37,246, 55,111,210,158,153, 71, 41,205,220,177, 53,170,124,140,171, 43,112, 80, 14, 71,120,107,105,117,187, 68,137, 76, 72, 30, - 35, 15,122,173, 36,192,162, 24, 51,124,226, 35, 84,186,197,219, 78, 45,240, 71, 79, 63, 55, 21,158, 38,161, 75,213, 10,142, 46, -175,242,166,215,188,134, 43, 55,111, 82,215, 85,112, 83,136,104,196, 5,239,185, 87,146,186, 38,140,101, 81,194,107, 45, 94,118, -103, 37, 75, 61, 78, 20,105,248,247, 34,174, 10,226,165,138,105,172, 99,100, 65,229,158,100,232,169,158,179, 60, 51, 16,193, 89, - 29,114, 31, 38,225, 13,144,132,116,198, 88, 75,241,206,253,129,160,100,223, 4,251, 72, 4, 75, 9, 60,120,174, 79,231,216,178, -228,166,187, 26, 95,212,228,163,138,106,191,164, 54, 30,109, 61, 55,107,120,118,219,242,202,239,185,157,183,221, 86,178,248,197, -223,160,253,129,223,230,191,253,241, 38, 31,254,220, 11,124,245,207,159,160,223,215,172, 59,207, 40,132,222, 68, 74,177,231, 20, - 75,237,152, 19, 29,197,169,147,179,244,102, 5, 55,220, 89, 90,162,213,155,163,189,178, 74,231,228, 25, 58,103,206,145, 29, 63, - 69,188, 48, 11,157, 20,202, 17,126, 50,192, 85,114,111, 37,146, 93,155, 86, 74,172, 93, 73, 18,138,146,158,122,152,181, 22,101, -143, 79,225,228,194, 42,187, 95,248, 28, 63,253,174,251,105,181,146, 41, 36,102,106,229, 10, 60,120,149, 70,135, 82,174,154,127, - 39,223,235, 0,153, 17,165,245,129, 23,219, 7, 76,105, 51,173,123,231, 15, 18,184, 8, 94,234, 72, 75, 52,105, 3, 76,105,104, -115, 74,133,182, 76,152,242,188,108,237,124, 0, 0, 32, 0, 73, 68, 65, 84, 42,105,209,185,237,225, 16,111, 90, 72,134,189, 49, - 68,105, 26, 66, 87, 36,100,197,154, 74, 86,247, 74, 68,113,166, 42,195, 3, 47,164,170, 1,105,214, 10, 76,122,225,159, 71, 90, - 5, 53,127, 52,213, 0,248,233, 64, 25, 50,224, 21,211,236,119,172, 11,126,100, 23,108,210, 82, 32,117, 67, 90,242, 34,238, 83, -177, 96,119, 93,136,108, 37,248,231,157,245,178,161, 80,138, 36,138,209, 58, 88,211, 84, 32,199, 5, 97,158,175,202,112, 6,177, - 7, 49,175, 86, 88,242,141,184,209, 53, 66, 71, 77, 40, 0, 70,254, 59, 66, 60,172,142,162, 67,214, 59, 63,253,188,248,233,157, - 76,136,118, 11,245,144,164,215, 7,239,132,104, 23,199, 83,123,162,220,170,125, 24, 13,237, 1,150, 85, 55,158,112,243, 29, 6, -241, 67, 19,120,211, 77,163,190,229, 23, 29,198,202,234,160,120,175, 15, 56,238,166, 22, 19,118, 85,203,125,174, 42,229,199,101, - 41,150,198, 34,135,186, 14,100,196, 3, 0,141,183, 54, 20,118,135, 55, 6, 95,215,120,107,166,130, 65,241,131,203,231, 57,106, -117, 4, 97,236, 29, 58,107, 99,243, 9,202, 90, 84,175, 31, 94, 39,209,203, 62,184, 40,210, 92,191,252, 95,168,171, 29,156, 19, -143,191,169, 28,181,113,228, 19,199,112,228,217,219, 11,138,116,201, 44, 34,235, 74, 49,141, 82,104, 37,106,250, 90, 26,143, 37, - 39,125,123,203, 51,158, 32,118,184, 66,200,156, 85,117, 32,232,199, 40,124,165, 72,188, 70, 91, 69,236,229,189,226, 14,148,124, - 98,227,213,176, 48,191,200,246,214, 38,214,148,196,250,192, 1,104, 2,250,190, 73,162,141, 94,117, 87,231, 23, 70,149,193,160, -169,106,207,163,223,253, 6,110,237,246,249,226, 7,126,159,217,187, 30,197,238, 95,101,239, 51, 31,100,251,179,127,130,169, 21, - 39,142,180,249,234, 51,235,112,203, 29,252,193,231,158,224,204,226, 2,175, 62,189,204,133,107, 55, 57,127,109,157,168,213, 98, - 82, 86, 44,247, 50,242,202,240,252,198,128,212, 43,190,235,212, 50, 11,221,140,143, 61,117,153, 27,195,130, 71,206, 29,225,169, - 75,155,220,181, 50,195,141,221, 17,243,189,140,157,193,152,187,207, 28,229,147, 95, 61, 79,167,157,178, 61, 41,153, 73, 19,246, -243,154,251,142, 47,113,254,165,235,156,186,235, 4,113,156, 97,140,220,237,246,110,110,112,236,216, 60,199,238,123, 13,227,205, -107,204, 28, 59,139,138, 51, 76, 62, 18,129, 87,218,150,160,135,170, 38, 74, 83,116,214, 70,121,141, 51, 18,150,144,116, 50,108, -149,163, 85, 68,156,181, 80, 90,179,123,229, 18, 51,171, 71,216, 58,255, 34,202, 67,214,239,113,254,243,159,103,241,244, 26,144, -162,124, 77,107,118,137,205, 11, 23, 81,113,204,112,107, 27,107, 5,138, 81, 85,134,170,170,137,116,202,252,234, 42,187, 55,118, -201,243,117,210, 86,135, 86, 39, 67, 69, 25,198, 84,116,103, 22,153,236,111,208,153, 93,102,127, 99, 11,175, 12,222, 24,146,110, - 15,111,170,176,174,139,232,206, 47,160,116, 74,123,102,150,253,157,235,104, 29,209,106,119,105,247,231,169,170, 28,147, 23, 28, -187,231,126,138,253, 93, 54, 46,126,147,197,163,167, 88,189,227, 94,210, 44,163,204,135, 88, 91,179,118,199, 61, 12,214,175,211, -234,245, 25,109,239,145,116, 50, 90,157, 14, 81,214,193, 57, 67,146, 68,196,113, 34,197, 3, 33, 34,121,231,169, 6,215, 25, 62, -251, 37,146, 44,198,213,142,209,205, 75, 92, 43, 42, 9,239, 10,111,219,251,206,222,202, 79,190,237,135, 57,154, 36,188,241,212, - 41,254,228,133,111, 76,239,236, 26, 37,164, 57, 47, 63,110,167,144,182,228,213,152,182,244, 52,157,173,129, 68,197,137, 34, 75, -181, 32,103, 35, 77,164,161,158,120,121, 30, 4, 17,174,114,224, 74, 71,188,231,249,250,215, 28, 27, 53, 83,122,218, 56,172,175, - 82, 45,161, 51, 82, 88, 97, 96, 68, 28,151, 70,242,107,230, 91, 7, 48,172, 91, 59,176,178,214, 99,237,222,179, 76, 54,119,161, -168,240, 85,133, 29,149,216,194, 76, 7,133, 23, 10,199,157,137,226,221, 75, 3, 62,252, 75,159,226,211, 95,220,227, 11,123,154, - 42, 82,184, 8, 70, 49,108, 27, 97,226,239,251,192,155,215,138, 36,142, 88,142, 45,119, 46,181, 56,178, 54, 75,255,232, 42,237, -197, 37,162,246, 44,237,149, 35,180, 79,221, 74,118,236, 20,241,242, 42,106,166, 47,221, 72, 89,224,139,137,172, 19,243, 34,160, - 88,195,202, 88, 71, 65,101,238,167, 48, 24,149,102,168, 72, 60,235, 42,105,131,182, 44, 31,187,139, 87,236,124,102,234,181,110, - 64, 27, 13, 67,124, 26,182,226, 57, 88,195, 42,166,241,170,226, 39, 63,224,102,235, 40,136, 18,194,125, 91,135,248,214,198,222, -164,195,244,115,240,247, 53,240,143, 38,209,173, 17, 99,185,240, 49, 4, 91,148,175,233,221,251,198, 48, 61, 74,206,183, 10,103, -163,102, 59,208,100,152, 91, 83,163,163, 24,103, 13,245, 36, 15,196, 58, 1,201,104,173,137,146, 88, 50,199,195, 58, 57,138, 98, -116, 28, 17,105, 45,161, 42, 54,248,171,155,167, 31, 7,130, 63, 97,213,135,213,245, 33,244,102, 20,178,187,149, 86,146, 20, 24, - 69, 83,127,191, 53, 70,148,248, 38,196,183, 86, 34,118,139, 18, 1,221,168, 36, 10, 91,227,208, 16,132,226,228,144,134,193, 59, -137,114,117, 83,198,187,155,126, 14,197,154, 30, 78, 28, 8,169, 78, 55,160,155,208, 12, 43,229,131, 86, 1,177,249, 58, 66, 8, - 77, 88,191,199, 17,157,209,206,212, 46,166,194,231,131, 64, 2,124, 25,208,165,185,157, 59,127, 32,100,115,246, 91, 10,250, 33, - 26,156, 58,184, 55, 79,163, 84,191,109,253,238, 15,221,211,141,116,231, 62, 40,220,155, 66, 94,150, 7, 1, 45, 13,101,175,129, -229,148, 5, 62, 12, 51, 1,137, 40,155, 36,165, 14, 53, 47, 72, 97,119,114, 98,113, 38, 88,238,194,153, 41,202,218,232,180, 37, - 13,113,218,194, 78,198,232,158,164, 95, 54,194, 64, 21,160, 91,162,132, 79,185,122,249,163,161,129,130,201,200, 49, 30, 58,242, -202, 49,216,151, 59,120, 89,202,157, 59,138, 37,217, 45, 73, 21,113, 16,213, 17, 94, 62,251, 3,199,230,134, 39,159,248,208,171, -120,202,176,148,144,105, 94, 4,167,218, 42, 18, 52, 29, 52, 29, 21,209, 66, 97, 14,105, 24,180,130, 8,129,109,189,246,177,215, -242,192,125,247,114,207, 61,119,115,247, 61,247,113,239, 61,247,241,196, 19, 95,159, 10,230, 84,208, 19,198,165,177, 88,175, 56, -121,242, 86,138,124,135,108,116,153,151,190,248, 18,179,186,199,159,252,218,127,230,117,127,247,175,177,246,246,247, 18,149, 3, -174,254,199,255,194,199,126,227,203,220,179,112,146,223,248,203,199, 33,138,169,117,196, 7,158,188,192, 15,220,182,198,137,153, - 22,159, 95, 31,241,244,122,205,137,197, 57, 30,108, 69,252,233,249,117,158, 84, 3, 74,165,232,225,121,245,217, 35,248,218,240, -155,127,249, 77, 30,123,197, 49,250, 89,202,169,190,101, 60, 41,184,101,101,134,103, 47,174,243,214,251,207,241,151,223,188, 76, -156,182,168,172,167,155,106, 94,218, 24,208,110,167,236,111,108, 19,103, 25,160,152,140, 38,228,149, 33, 65, 97,202, 9, 73,214, -145,233, 91, 41,161, 49, 57,133,169,114,162, 36,166, 28,237,147,246, 79, 96,234,240, 48,168,192,150, 5,113,183, 77,218,202,100, -237,220,233,227,202,130,221, 11, 23,200,122, 45,178,110, 70,171,223,102,231,234, 58,115, 71,142,178,115,249, 34, 43,183,221,199, -222,181,139, 68, 55,174,179,117,229, 60,253,133, 37,188,133,164,213,162,178, 21,219, 87,110, 48,115,100,142,172,223, 99,227,202, - 21,122,243,115,108, 94,186, 73,178, 20, 99, 74,139,181, 57,249,126, 65,210,217,166, 59,187, 68, 62,222, 39, 73, 34,122,157, 25, - 74,165,168,135, 19,234,122, 64,146, 46, 81, 84, 99,242,253, 13,122,243,231,136,146,152, 56,105, 73,234,147,110, 99,234,154,229, -147,183,113,243,252, 83,212, 69,193,100,119,155, 72, 41,226,172, 79,177, 55, 4,111, 41,246,118, 81, 58,166, 46, 74,170,193,136, -206,220, 60, 43,231,206,177,123,237, 50,179,107,107, 50,201, 68,169, 52, 36,113,138,181,150, 52, 77,228, 70, 27, 41, 38, 55,206, - 51, 28, 12,233, 44,175, 80,232, 49,111,234,204,241,165,237, 33, 62,128,103,140,243,188,251,225, 55,176,125,227,138,216, 93,119, - 54,136,155,116,196,192, 66, 54,129, 44,167,156,128, 25, 90, 29, 39, 23, 54,109,233,247, 35, 92,192,201,166, 94,238,130,101,225, -165,227, 13,214, 14,237, 21,190,114,104,231,101, 37, 31,238,189,234,138,101,163,130,110, 34,171,244, 81, 24, 42,218,145,120,211, -173, 15, 43,119, 15,203, 45, 41,230,214, 65, 79,195,184,146,194,110, 60,244,187,154,199, 63,121,129, 87,190,239,251,136, 34,141, -109, 73,225, 76,103, 82,226,157,136,158,177, 12,246,225,150,182,226, 27,185,231,167, 63, 58,224, 61,119,118,216,223, 40,136, 75, - 24, 57,207,142,241, 76, 60,140, 61, 76, 66, 44,137,241, 48,118,158, 62,112, 91, 47,226,232,114,135,222,210, 12, 89,127,129,108, -102,145,236,248,105,146,165, 21,244,236, 34,244, 58,178,238,172, 10,168,114,252,100,132,173,114, 92,153,139, 79,121,106, 47,107, -188,224,200, 58, 55, 10,115,157,169, 65, 59,116, 58, 47,239,236,214, 28, 94, 45, 72,242, 86,160,152, 57,235,209,113,184, 81,198, - 7,182, 69, 29, 86,197,226, 4, 11, 92,241, 38, 26,202,137, 40,174, 41, 56, 82,236,157, 40,228,157, 23,143,185, 53,232,144, 31, - 46, 5,223,162,226, 88, 78, 29, 28,162,176,133, 66,238,188, 67, 43, 11, 42, 66, 97,177,147,125,156, 49,168, 88, 54, 9,182,174, -209, 73, 58, 45,158, 58, 73, 73, 59, 29,172,173,240,101,129, 69, 60,227, 77, 98,163,214, 26,175, 35,226, 36,150,166, 71,213,225, -254,169,112,182, 34,206, 18, 89,165, 6, 97,155,173,205,180,135,113, 58,232,194,144, 73,186,121,192,187,160,124, 86, 78,164,197, -206,134, 25, 63,172,222, 81, 30, 99, 44,174, 18, 69,189, 41, 75,140,147,201, 17,149, 16,225, 66,118,188, 59, 64,198,123, 11, 58, -104, 0, 28, 88, 91, 19,197, 73,176,248,217, 41,236, 71,225,167,195,175,115,193,239,223, 8, 16,195,154, 63,138,195,230,196, 49, - 21, 24,250, 96, 47,180,182, 34,210,201,180, 72,215,227, 33,186,215, 11,193, 53,242,251,146, 40,158,230,185,139, 34, 60,188,161, - 85,124,192,127,110, 38,106,107, 27,214,243, 1,181, 77,249,111,185,177,235, 32,172, 83, 7, 29,118,147,174,214,172,221,157,196, -193, 82,215,210,193,231,121,176,172, 21,184, 60, 71,181, 18, 48, 6, 87, 84,168, 52, 70,107,209,102,184,170, 66,167,226,170,105, -154, 21, 9, 20, 34,144,249,106,108,195, 65, 8,241,206,222,129,171,106,220,100,136,139, 37,230, 87, 39, 9, 36, 41,218, 89,252, - 96, 23,181,116,228,144,234, 95,130,123,156, 53,204, 47, 63, 70, 62,246,164,137,216, 18,247, 7,150,189, 61,139,177,142,124, 44, -231,179,218, 31, 90,108, 52, 58,194,248, 0,211, 90, 15, 29,131, 93, 79,145,135, 41,189,150,181,125,179,154,111, 2,228, 60,138, - 86,164,192,200,247,189, 68, 99,106, 79,229, 60,198, 90,148, 22,187, 91, 28,174, 56, 31,252,173, 15,160, 34,153,168, 28, 80,212, -211,240,196,105,255,100, 29,232,202, 27,140,179,228,227, 29,138,114,196,140, 77,120,238,194, 22, 79,220, 92,231,137, 27, 99,254, -248, 3, 31,231,194, 31,126,146,171, 79, 95,227,196, 99,111,228,187,126,228,157, 60,248,174, 31,224, 39,223,114, 23,223,123, 98, -158,119,156, 93,224,150,163, 75,108,150, 53,255,254,137,139, 44,116, 82,222,124,118, 25,106,199, 11,219, 35,222,114,106,153,133, - 86,194,151, 46,111,241,212,198, 30, 30,168,149,231,199, 95,127, 23, 69, 81,242,169, 75, 91,228,237, 54,115,115, 61,158,219,158, -160,210,136, 43,219, 35,238, 63,115,132,213, 94,202, 94, 93, 17,197, 9, 46,139,185,144, 91,158,248,220, 87,209,145,163, 24,239, - 17,197, 30,167, 52,149,169,112,222, 18,183,103,209, 89, 23,103, 42,177,185,196,145,100, 8,231, 19, 58,139,171,120, 60, 81,148, -128,245, 68,237, 30, 73,183,135,138,219, 20,195, 33, 73,167,199,120,253, 10,166,202,153, 89, 93,166,213,155,161,202, 39,164,221, - 30,163,205, 45,242,241, 46,115, 71,142, 49, 25,108,211,155,159, 67,165,179,204,205,205,177,116,226, 36,163,193, 46,222, 59,116, -148, 50,186,185,193,218,153, 51,140, 6,187, 88, 91,147,244, 58,168, 36, 35, 78, 91,212, 6,210,172,143, 78,103,240,213,182,196, -142, 70, 25, 73, 47, 65,183,122,184, 81,137, 87,178, 18,236,204,205, 16,235, 25,234,114,159,241,254, 6,173,206, 12,117, 93,226, - 48,180, 91,109,242,253, 77,218, 11, 11, 84,229,152, 52,237, 48,220,184, 70, 54, 51,195,236,210, 9, 70, 27, 55,240, 56,138,253, - 93,230,214, 78, 72,248, 68,162,169, 70, 35,136, 60,173,110, 15,188, 36, 15, 69, 90,139, 48,172,121,129, 55,221,184,135,226,234, -243, 92,123,252,203, 88,175, 72,226, 12,250,243,180, 7,226, 17,143,128,133, 78,135,201,104,130,170, 39,120,111,217, 92,223, 66, -133,120,211, 88, 73,193,208, 22,108, 1,213, 4,138,137,103, 52,176,228,133,195, 76, 60,147,137, 5,237,228,243, 16, 43,218,109, -153,160, 76,160, 35, 53, 89, 15,218,202,218, 29, 11,149,245, 84, 10, 54,118,101,205,253, 82, 14, 87, 10, 89,187,143, 29,236, 84, -144, 91,249,111, 24, 59, 41,230,185,147, 58,214,137,165,216, 30,235,200,243,121,100, 96, 96, 60, 23,215, 43,201, 81, 12,159, 3, -157,197,196,105, 76,167,155,208, 75, 99, 86,231, 18, 78,117, 99,214,186, 17,221, 4, 94,204, 61,157, 44,102,162, 97,228, 21, 70, - 41, 10, 20, 37, 98,147,243, 10,170, 84, 51,113,240,214,142,225,161, 51,125, 78,223,119,134, 99, 15,127, 23,139,175,126, 45,179, -223,253, 54, 90,175,184, 29,189, 56, 3, 20,176,119, 13,182,175,225,246,110, 96, 7, 59,216,124,140,203, 71,248,224,103, 22,222, -186,168, 95,189, 62, 80,138,123,219,124,181,226,144, 42, 33, 77, 84,161, 87,248,201,185,101,178,219, 31, 58, 16,184,133,198, 64, - 10,189, 66,163, 2,110, 85, 26, 46,225, 76,203,109, 93,169, 38,221, 77,138,185, 40,226,133,235, 78,152, 50, 9, 83,161, 82,209, -212,210,229,141,153,230,170,171,102,138,114, 1, 20, 20,192, 48,202,135, 31,187, 90,234, 66, 93, 99,139, 97, 72, 67,137, 2,254, -181, 10, 19,171, 76,198,186,213, 22, 21,123,156,136, 47, 56, 8,171,148, 82,104, 29,211,157,157, 37,233,117, 15, 68,101, 74,161, -163,132,164,213, 22, 49, 90, 36,249,241, 83,210, 94, 8,219, 16,182,166,155,194,113,252, 97,230,186, 11,197, 67,107,162, 56,146, - 70,202, 56,208, 2, 20,177, 86,238,215,117,145, 79, 9,119,246,240, 45,218, 57, 92,101,194, 61, 60,216,145,234, 58,132,192, 4, -212, 43, 97,171, 96,195,246, 66, 41,137,239,156, 78,243, 1,221, 29, 52, 16,206,155, 3, 43, 93,243,191, 0, 76,170,107, 59, 93, -241, 59, 37,226, 57,111, 45,118, 82, 96,138, 9, 85, 62,193,212, 5,245, 96,135,106,103, 11, 70, 3,152,140, 68, 17, 94, 79,130, -133,172, 10,208,151,234, 80, 94,121, 37,107,114, 27,252,227,254,144, 95,221,219,151, 39,169, 53, 43,123, 87, 7,171,218, 33, 90, -156,179, 7,160,152, 60,135,201, 16, 63, 26,224,203, 2,133,195, 12,246, 48,227,137, 88, 24,247,247, 48,147, 49, 84, 53,190,174, -177,121, 33, 27, 8, 43,141,131,107,196,128,193,254,167, 2,204, 72,249, 70, 34,233, 3,216,199, 96,138, 2, 55, 30, 75, 3, 17, - 39,232,197,229,151, 5,187,248,201, 8,182,183,167,228,192,118,123, 9,235, 60,101,110,201, 39,142,209,190, 99,119,199,113,227, -154, 99,107, 3,198,195,240, 41, 10,182,250,170,106, 78,136, 80, 86,142,114,226,200, 11,207, 36,135,253,161,151, 0, 42, 43, 44, - 28, 83, 11,177, 14,171, 80, 33, 51, 67, 43,232,164,138,110, 28,209,141, 53,153, 86,116, 18, 69,150,200,217,178,209, 49, 58,235, - 41,107, 57, 51, 26, 39,223, 55,226,204, 41, 50, 34,108, 42, 99,235, 61, 73,234,216,218, 93, 71,227,233,222,246, 16,175,248, 46, -197,187,126,229,251,249,189,159,248, 89,254,237,151, 94,228,183,158,253, 36,111, 56, 62,203, 71,158,187,201, 63,248,161,215,242, -204,141,167, 57,125,114,133,135, 31,125,128,231, 94,186,202, 27,206,174,240,141, 27, 91,252,216, 99,119, 51,174, 29, 79, 95,217, - 96, 38, 82, 44,205,164,124,242,218, 54,195,188,100,190,221,102,125, 92,178, 89,108, 49,223,110,241,149, 27, 47,113,100,190,199, -253,167,150,121,230,242, 22,235,147,138, 59,150,103, 24, 43,207,182,205,217, 28, 71,172,206,116,184,179,219,226,234, 94,193, 78, - 81,176, 58,211,230,249,235, 59,188, 90,165,120,213,194, 89,137, 41,180,149, 40, 53,189,149, 67,133,111,248,192,113,130,210,137, - 60,168, 90,125,204,254, 54, 58, 77,209,145,162,216,217,162,206,115, 58, 26,226, 78,155,106, 60, 32,155,153, 99,243,226,121,150, -207,156,229,133,207,126,154, 91, 31,125,140,107, 79, 61,141,110,105,138,193,152,180,221,101,255,242, 58,253,213,121,182,175, 94, -103,110,101,141,107,223,188, 76,167,147,209, 93, 90,224,202, 83, 23, 57,251,224,221, 92,123,225, 34, 85, 49,162,149,181,217,223, - 94, 39,202,192,121, 67, 49,153,128,218, 35, 77, 61,179,171,167,168,203,148,114,176, 77,127,101,142,225,214, 30, 73,150, 82,238, -239, 16,181,219,100,189,101,174, 63,255, 28,243,199,150,136,116,194,104,103,157,181,179, 15,179,123,243, 89,116,156,128, 82, 12, - 55,214,177,117,205,104,111, 3,175, 45,221,217, 53,210,153, 30, 42,213,148,227, 49, 62,240,180,139,189, 1, 11,167, 78, 51,188, -113,147,201,246, 46,113,146,200,138,211, 67, 49, 25, 81, 23, 19,230,150, 87, 14,108, 75, 97,189, 30,107,153,230,242,205, 77,178, -118,196,220,109,103,240,191,255, 53,212,172, 60,187,142,247,231, 41, 39, 99, 34, 44, 9,138,141,241,136, 52,168,218,227, 96,123, -115, 78,216,240, 88, 79, 61,129,220,123,108, 71,203,196,150, 40, 20,154, 56,213,164, 25,100,237,132, 36, 6, 83, 59, 90,145,194, -185,136, 36, 18, 18,153,115,158,202, 59,233,253, 29,220, 68,214,236, 39, 58,176, 87,201,155, 35, 15,176,176,149, 4, 38, 30,250, - 41, 88,167,216, 46, 60,186,134,249, 12,226, 22, 92,201,161, 23, 54,192,223,220,243,180,198,134,193,214, 46, 81,146, 80, 15, 71, -168, 52, 35,233, 84,244,142,244,130,133, 11, 90, 89,196, 67,145,108,199, 63,117, 33,231,157,183,119,200,199, 14, 27, 59, 38,181, -164,202,149,120,118,209,108, 20,142,119,173,182,248, 59,223,127, 59,167, 95,247, 32, 11,119, 63, 72, 52, 51, 47,221, 73, 89,227, - 7,151,241,102, 50,181, 22,121,149,224,181, 64,135,132,146, 22,204,255,222,225, 76, 40, 56, 74,139,144,208, 40,188,146, 98,170, -130,210, 91,244,110, 17,180,102,136,151, 31,224,127,249,158, 55,241,113,167,248,233, 23, 47,209, 5,161,150, 77, 89,238,178,118, -245,138, 67,109,126,216, 2, 52,188,109,149, 4,191,183,132,183,200, 10, 93, 77,197,201,205,134, 64,148,230,225, 22,175,226,198, - 68, 29, 20,230, 77,253,116,193,250,168, 15, 30,190, 1,210, 65, 32, 57,150, 87,158, 39,190,227,149,224, 3,146,184,174,240,214, - 76, 55, 1,104, 77,164, 91, 1, 50, 83, 79,167, 94, 21,124,243,196, 17, 90,123, 92,160,103,201,160, 24,116, 8, 72, 3,162,117, -132, 11,129,193, 74, 71,225,174, 29, 10,245, 20, 83, 43,183,120,165, 84,184,207, 26, 72, 35,153,170,148,216,154,168, 17,226,157, - 1, 83, 87,210,136, 52, 22, 41,239,195,246, 43, 10,108,115,113,216, 4, 9, 97, 16,161, 73,128,139, 68,214,134,207,183, 14,244, - 54, 29,133,207,249, 1,129, 85,104,179, 33,211,157,176, 95,117, 90, 16,162,234,224, 12,162,148,220,232,181,142,193, 90, 92,172, - 5, 97, 26, 43,236,104, 2,253,126,208,167, 84, 48,218,147, 30,170,149,202,118,195,246,160,229,100,106,143,226,131,169,124,234, - 4, 8,104,216, 40, 9,103, 11, 29, 62,190,224, 51,159,158, 50, 14,111,232, 27, 95,125,168,126, 58, 58, 80,133, 21, 99,236,254, - 8, 91,149, 97,250, 14,201,122,117,133,106,165, 96, 42, 76, 94,160,226,132, 72, 75, 19, 23,153, 8, 84,140, 15, 52, 58, 63,205, - 86,247, 47,211, 22,136, 82, 93,194,113,240, 21, 42,169,228,246,158,231,168,254, 76, 0, 86,244,240,206,192,112, 8,219, 91,112, -233, 42,254,238, 59, 81,139, 75, 36,105,151,186,138,113,153,195, 20,142,193,190,103, 52,134, 97, 14,229, 68,174, 6,161,180, 76, - 11,174,181, 1,132, 5, 24, 45,233,148,249,196, 81,215,161,167, 14,162,125,121,121,202, 38, 35,110,150, 27,141, 20, 62,108,203, -146, 72,113, 16, 39,115, 32, 72,205,235, 32,135, 64, 28,122,141, 22,209,187, 41, 10, 98,218, 92,196, 94, 43,137,123,211,160,156, -166,211,155,199,181, 75,134, 23,159,225,149, 63,252, 58,146, 94,159,127,252,137,175,241, 19,255,243,223,228, 47,255,193,175,147, -160,184,180, 55,226,215, 63,247,204,244,235,216,209,144,197, 9, 95,190,188,205,184,182,244, 98,205,177, 94,202,137,133, 25,254, -218,237, 39,232, 70,240,153, 23,111,176, 89, 58,246,198, 5,214, 24,110, 89,154, 97,115,103,200,239, 93,217,228,236,242, 28,111, -189,101,149,175,221, 28,130, 82,108, 77, 42, 78,207,205,179, 50,119,147,205,170,102,101,105,158,157, 97,202,238,164, 98,223, 58, -158,121,234, 89,206,158, 61, 65,173, 68,185,170,147, 22,174,174,104,205,174, 30,172, 15,241, 68,105, 70, 61, 28,136,133,170, 46, -240,120, 76, 57, 1,171,104,205,204, 50,220,218,161, 61, 95,147,102, 25,187,235,235,116,102,250,120, 3,227,221, 29, 90, 89,139, -201,254,144,124, 52, 32, 77,186,180, 98,197,104,119,192,104,176, 67, 54,219,165, 24,237,179,175, 29,198, 79,152, 91, 92,102,111, -125,135,164,229, 41,234,154, 56, 74,217,185,114,157,213,179, 43,196,173, 53,146,120, 76, 28,119,240, 46, 33,223,189,193,145, 51, -183,224,125, 74,158, 15,101,109,170, 82, 84, 58, 64, 69,125,170,226, 26,189, 46, 56,163,104,117, 34,176, 41,113, 71,138,250,169, - 7,239,226,242, 51,127, 78,127,229, 20,229,222, 6,113,156,176,176,118,134,124,119, 11, 87, 91,230, 78, 29, 37,237,116, 80, 90, - 9,222, 54, 73,193, 41,121, 8, 89, 71, 54,211, 15,180,173, 68,132, 62,129,134,149,100, 93, 17,217,120,137,117,117,117,152, 72, - 38,251, 44,158, 60,198,112,123, 64,178, 58,135, 51,142,181, 36,226,186,117, 36, 10,206,204, 45,224, 76, 65,172, 45,182, 44, 24, -216,130,182, 82,152,224,205,117, 86,238, 65,222,122,116, 44,183,162,220,133,113, 77, 67,145, 40,210,150, 34, 73, 53,113, 34, 55, -118, 29, 43,178, 56, 2,167,197,143, 94, 6,203,142,145,217, 77, 43,133,137, 61,203, 71, 20,209, 11,158, 43,185, 24,100, 26,161, -108, 28,193,182,133,173,137,252,253,247,173,181,121,253,253,139,252,200, 15, 63,194,147, 95,122,158, 95,254,205,175,115,108, 22, -250, 73, 88,209, 71, 48,208,240,226,227,231,185,245,254,179,212,197, 4,103,106,162, 94,151, 22, 30, 95,148,196,169, 34,205, 13, -105,166,105,197,154, 91,231, 99,190,112,173,164,211,143,217, 24,122,198,214, 49,114,138,101, 15,127,239,225,101,126,244,191,254, - 49,201, 98, 13, 87, 47,224,214, 47, 99, 7,187,248,225, 64, 44, 80,182, 20,159,183,146,181,180, 87, 26,180, 9, 55,104,145,175, -202,228,235,197, 14,134, 15, 28,239, 8, 76,130,143,133, 24,166,106,131,143, 82,148, 78,209,221,101,116,103, 14,235, 45, 23, 30, -255, 40,255,250,227, 79,112, 28,120,246,233,175,241,170,183,188, 5,115,241,233,169,182,201, 91, 27,238,199,118,154, 28,230, 27, - 43, 67,152,178,189, 49, 16,133,123,122, 19, 8, 18, 80,158,222, 25,233,114,100,239, 47, 73,110,141,221, 72, 53,150, 46, 41,162, - 62,216, 35, 60, 90, 50, 20,132,237,139,142, 99,156, 49,232, 56,198, 91, 79,241,252, 23,233,222,241, 32,168,136, 72,199, 84,174, -198,155, 74,232,113,206, 4,209, 83,130,210, 81, 72, 97,147, 38, 70, 28, 98, 65,148,161, 98, 81,199,251, 92, 68,126, 81, 44,247, -251,192,102,240,166,154, 50,195,157, 59,216, 56,120, 99,241,145,150, 48,149, 0,118,113, 97,203,228, 76,133, 47, 37,100,133, 36, -149,169, 49,172,197, 61, 14,231,165,184, 88, 35,194,142,131,220,121, 31, 8,119, 33,165, 77,107,148,181,146,225, 30,232,115,178, -149, 86,211,201,210,163,160, 62, 8,150,105,104,112,205, 68,175,144,102,217,151,181, 52,228, 73, 60,253,103, 40,127,128,178,245, -146, 23,175, 52, 24,107,195,246, 66,220, 11,186, 81,194, 56,133,247, 21,182,180, 56, 29,163,109, 77,100,186, 2,165, 73, 93, 48, - 66,171, 3,194,137, 59, 20,188, 18, 16,181, 52,167,160,195, 74,119,117,200,162,214,192,247, 27, 95,152, 11,147,127, 93,225,135, - 67,170,193, 46,166, 10, 44,246,128,243,197,131,170,170,131,188,122, 43, 80,160, 40, 73,165, 40, 54,218, 64,235, 69,131, 84, 75, - 70, 64, 19,127, 43,104, 97, 43, 74,248,160, 77, 80, 86, 50,234, 85,154,200,250, 47, 77,153,222, 8, 77, 77,253,197, 47, 18,245, -123,178,181, 10,205,109, 20, 39,114,210,156,200, 10,125, 50, 22, 59,154, 9, 65, 85, 10,217, 44,106,237,167, 30,113,135, 20,115, -173, 69, 20,103, 92,248,186,134, 15, 95,251,166,176,171,112, 94, 9,171,119, 39, 89, 6, 85,228,136, 93, 32,212, 77,157, 12, 18, -196, 84, 91,143,241,112,203,185,179,188,246,181,175, 36,205, 50,172, 87,228, 69,197,127,252,205,223, 66, 7, 70, 81,195,123,138, - 21,146, 40,163,195,223, 26,247, 50, 94,252,226, 19, 60,255,251,159,226,150, 89,184,113,179,166, 44,114,218, 45,197, 32,202,120, -255,151,159,231, 27, 59,251, 66, 43, 10, 39,166, 78,150,177,152, 40, 30, 60,121,132, 79,189,120,141,185, 52, 98,175,118, 92,185, -186,197,248,165,155,172,246, 51, 30, 88,158,227,193,153, 54,145,130,167, 55, 71,108, 12,199,220, 50,223,229,109,183,173,240,249, -235, 67,126,239, 27,215, 89,238,164,236, 21,134,149, 44,225,123,238, 61,197,205,209, 38,145, 83, 12,205, 14, 38,118,232, 56,226, - 68, 39,230,197, 75, 79,178,186, 60, 27,214,180,134,178,168,192, 20,210,181,235, 8, 48,168, 36,149,104,194,172, 67,212,238, 80, -238,108, 17,247,103,193, 90,242,225, 54,233,236, 34, 73,164,240,214, 16,101, 61,182,207,191,132, 59,177,130,138, 60,123, 87,174, -115,252,190,251,184,248,149,167,232, 47,206,176,191, 57,100,118,237, 8,155, 87, 55,233,205,182,176,214,146,101, 25, 30, 77,130, -162,174, 61,219,151,110, 64,188, 67,127,246, 36,181, 27,208, 95, 60,137,194,145,239,238, 17,117, 28,197,100, 68,150, 69,180,142, -156, 68, 69,154,178,168,193, 64,154, 41, 38,163,125,210, 36,163,172,198,212,166, 38,235, 47,178,179,126, 9,167, 82, 76, 61,196, -251, 57, 34,157,224,234,146,118,127,150,200, 69,196,237, 30,149,169,137, 90,109, 6, 55, 46,144,182,187,244,215,142,163,188,165, -213,235,225, 76, 65,150,205,210, 89,153,103,120,253, 6,221,249, 69,218,115, 51, 76,246, 6,242, 32, 86,130,158,140,146,132,186, - 44, 14,238,162,190,133, 11, 28,246,114,176, 75,123,113,158,253,237, 77, 22,150,103,153,140, 74, 30, 56, 62,203, 53,187, 75, 26, -105,142,247,231,160, 42,240, 89,130, 31, 15,185,126,125,155,172,163,169,189,248, 56, 29, 94, 32, 50, 74,161,157,172,144,156, 85, - 20,149, 71, 37, 80, 20,142, 86,169,104,117,132,159, 30, 39, 17,113, 28, 76,107, 70, 77,211, 88, 76, 41, 27,102,109,229, 88,237, - 12, 84,177,162, 8,154,152,110, 12, 57,178,118, 79,128,141, 49,252,234,251, 30,230,213,175,185,157, 52,203,200,139,146,225,222, -128, 87, 62,116,142, 15,221,113,148,127,254,239, 62,205, 83, 87, 39, 44,245, 96,179,130, 94, 15, 62,242,167,223,224, 31, 62,118, - 7,227,253, 25,212,100, 52,189, 47,183, 42,139,142, 75,146,196,208,238, 38,244,231, 91, 44, 15, 42,206, 29,201,216,221,173, 97, - 53, 35,237,104, 78,158,156,227,142,159,251, 37,146,219,222, 66,245,229,223, 98,242,169,111,162,235, 33,166,242,148, 58, 34,238, -247,137,211,150,124,238,243, 28,159,102,104,231, 32,109,201,165, 83, 69, 83,192,138,194,203,180,110,188, 76,180,141, 3, 40, 40, -110,209,145,132,242,116,230, 80,157, 69,116,103, 14, 63,217,198,235,121,142,221,253,118,250,192,145,118,204, 63,251,203, 13,222, -127,250, 89,122,169, 70,187,112,219, 12, 54,174,102, 5,233,172,147, 98,232, 36,227,218, 71, 81,160,202, 57,129, 58, 73,133, 22, -241, 82,227, 67,244, 77,146, 89,184, 55, 59,185,187,170, 38,151,119,122,234, 53, 77,130, 73,104, 36, 2,132, 38, 4, 82, 55,141, - 69,113,237, 5,240, 50, 33,122,107,131, 77,204, 6, 14,130,199, 86, 5,206,121,226, 36, 22, 52,103,243,128, 87, 58,188,134, 83, -217,106, 40,136,166,113,168, 86, 44,144, 49,193,231, 47, 55,111,157,196,216,170,154, 82,220,124, 16, 87, 73, 16, 99,160,216, 89, - 47, 25,220,210,209,200, 68,223,136,177,234, 90,138,120, 67,136,115, 34,234,116,161, 17,147,251,130,199,225, 66,227, 28,132, 95, - 40,188, 82,210, 68, 52, 73,106,110,154,156, 19,126,111, 72,153,139, 91,146,181,110,106,116,154, 4,146, 99,133,178, 26,111,106, -209, 4, 25, 67,148,181,130,112,172, 41,116,130,106,214,234,224,254, 92, 79, 10,116,127,134,168,149,128,171,209,173,118,152,208, -147, 80,252,197, 97,226,202, 9, 9, 14,232,136, 54, 34,110,238,231, 28,162, 78,185, 67,183,245, 38,232, 38,140,173, 58, 4,242, -124,155,203,205, 30, 96,127,241,208,237,161,244,134, 20,216,178, 10,155,145,112,242, 9, 77,158,172,250,165,192,249, 78, 38, 52, -169, 38, 46,215,134, 39,139,113,248, 42,128,119,108,141,173,173,252, 56, 8, 23,133,169, 20, 20,242, 42,156, 62,154, 79,120, 20, - 76,232,237, 14,254,200,170, 32,115,103,103,167,135,105, 83,213,232, 68, 36, 46,229, 4,124, 13,206, 6, 65,162,133,118, 42,212, -204, 56,134, 86, 11,201, 89,215, 18, 5,109, 45,216, 90, 78, 78,170,209, 70,218, 80,204, 27,137, 66,152,172,149,149, 51,166,115, - 48, 14, 34, 64, 83,195,164,118, 82,164,131,182,197, 43,143,143,224,161, 71, 30,225, 67, 31,254,175,124,239, 59,223,206, 31,127, -244,163, 60,242,202, 87,161,131, 48, 79, 5, 56,164, 3,116, 75, 71, 68, 74, 19, 57, 33, 45,169,108,158,241, 48,231,251,223,245, - 22, 58,183, 61,192,205, 90,179,180, 60,203, 31,126,224, 15,248,123, 15,158,193, 58,197, 7,255,229, 63,199, 3,255,228,239,191, -151, 44, 77, 88,237,180, 89,159,148,252,238, 83, 23, 68,173,167, 20,166, 54,244,163,152,227,237, 20,172,227,241,107, 91,252,201, - 75, 55,249,220,181, 93,172, 49,204,198,154,235,227,138, 79, 95,219,231, 88,183,197,155, 79, 47, 48,223,201, 88,238,164, 28,233, -244, 88, 59, 25,145,249, 8,172, 10,177,114,138,118,236,104,199, 21, 93, 93, 96,203,130,186, 50,232, 36,101,243,230, 14, 81, 28, -139,237,203, 91, 92, 85,132,219,149,248, 12,109, 49, 65, 37, 9,147,245, 75,232,172, 29,146,149, 44,105,191, 47,170,216,186,102, -126,237, 8,221,249, 53, 58,115, 51, 20,249,132, 50,175,168,242,138, 40,120, 72,243,113, 78,149,239, 19,183, 50,108,109,177,206, - 49, 25,238,210, 91,156,103,119, 99,147,153,181, 5,242,145,167, 48,155, 56,111, 73, 90, 9,186,213, 33,207, 7,204, 45, 29,163, -154, 24,140,201, 81,169,162,174, 93,232,224, 61,113,167, 43,147,180,146,117,120,111,126, 1,155, 39, 76,246,111,176,180,118, 11, - 42, 78, 41,134, 35,116, 42, 22,166,172,191, 72, 54,211, 71,121,199,112,253, 10, 51, 43,107,108, 92,124, 6,235, 42, 58,243, 43, - 24,103, 80, 17, 20,163, 17,237,197,101,204,100,194,236,209, 19, 12, 55,215,241, 22, 76, 57,193,228,101,120,193, 57,129,204,196, -145,144,213,218,109,121,208,215, 53,120,207,222,238, 58,173, 94,143,186,168, 40, 38,251,104, 20, 11, 71, 87,200, 74,104, 59, 77, -154,246,136,179,182,228, 3,143, 38,104, 7, 93, 47,241,129,190, 14,129, 31,141, 96, 42,208, 31, 35,192, 26,233,106,139, 60,224, -158,173,220,186, 27,197,113,172, 21, 81, 75, 30,140,214,129, 75,128, 68,161,188, 34, 9,208,142,170,171,232,167,242,236, 25, 91, - 73, 92,139,181,252, 57,183,175,182,121,219, 95,123, 61,227, 81,201, 96, 48,160, 44, 10, 34, 15,206, 23,216, 8,254,222,219,239, -228,103,222,126, 11, 51, 10, 94,209,147,223,247,133,231,134, 36,113,141,142, 52, 58,237, 16,165, 45,226, 94,135,120,190, 71,186, -212, 35, 91,108,211, 89,233, 49,127,164,207,201, 87,204,178,118,124,150, 59,239, 95,224,193,183,222,193,235,255,201,255,198,189, -255,233,207, 72,102,250,108,252, 63, 63,193,215,254,229,255,205,207,252, 79,255,134,215,188,247,183,120,223,207,125,136,141, 39, -190, 66,185,113,141,106,127, 11, 59,222, 23, 64, 79, 93,137, 8,206,203,195, 72, 68, 85,213,129, 34,218,131,199,224,234, 66, 94, -163,129,153,142,206, 80,233, 60,186,183,130,238, 46, 19,197, 45,204,250,139,212,209, 10,241,145,135,232,116, 59,252,216, 59, 31, - 99,175, 48, 92,217, 41,216,217,217,160,247,186,119,227,194,233, 66, 4,206, 74, 30,124,193,223,229,140, 13,119,220,134,211, 30, -130,120,236, 1, 22, 85,110,153, 33,182,212,251, 0,250,144,201,223, 53,196,171,218, 30,220,130,235, 16,110,226,100,211, 96,195, -189,221,155, 48, 89,213,149,248,189,235, 10,234, 10, 87, 78,240,196,225,227,116, 83, 17, 82,148,180,228,190,239,131,207, 60, 20, -152, 70,136,167,163,136, 56, 77, 14,110,253, 48,205, 92,215, 81, 36,122,129,180, 37, 5,217, 7, 95,121, 29, 88,238, 62, 76,200, -113, 44, 31,147,151, 61,169,119, 22,235,228,118, 93,151,165, 76,228, 78,244, 13, 62,210,232, 56, 22,144,142, 82,248, 88, 77,129, - 47, 90, 19, 66, 99, 74,172,169,197,230,230,229,107, 87,215,149,164, 61,218,208, 68,132,175,169, 11,138, 43, 23,254,135, 86,152, -178,144, 51,131, 21,239,147,243, 6, 91,214,216,170,192, 58,115, 40,240,198, 5, 85,127,211,160,136, 66, 84, 26,163, 10, 21, 39, - 20,163,241,180, 1,243,206, 73,210, 91, 28,129, 78,136,211, 76,162,167,149,130,218, 98,170,160, 45,113,149, 84,180,166, 32, 55, -223, 92, 35,158, 11,183,247, 58,248,179,170, 82,138,180,171, 2,182,181, 58, 20,172, 67,168,142,114,134,160,170, 96,105,137,246, - 76, 87,108, 89,121,142,207, 71,184,241, 24,183, 55,192, 15,247,113,131, 33,126, 52, 66,249, 26,229, 76, 56, 71,200,223,239,172, - 76,226,120,135, 67, 62, 78,107, 15, 53,103,214, 6,184,145,147,247,145, 13, 77,218, 33, 37,191, 82,177, 52, 95,105, 74,122,242, - 52,250,200, 17, 84,146,224,189,167, 44, 70, 20,227,130, 58,119, 12,255, 63,178,222, 52,220,178,172, 46,243,252,173, 97,239,125, -134,123,206, 29, 34,226, 70, 68,102, 70, 78, 36,100, 36,144,100, 2,138, 32,147, 34,106, 41,216,165, 45,106,149,104, 85,151, 72, - 57,181, 67, 89,104, 89,213,143,150, 90, 5,109, 59,149,138,218,150, 15, 34,206,221, 45, 98,129, 72, 41,130,136,128,128, 80,200, -144, 9, 57,147, 25,145, 49,223,233,220, 51,236, 97, 77,253,225,191,206,185,129,245,129,135,124,200, 36,242,220,125,207, 94,235, - 63,188,239,239,157, 36, 98,254, 81,147,131,202, 40, 6, 61, 77, 63,231, 80, 20, 86,144, 72,130, 71, 72, 43,185,192,108,150, 31, - 89,119,228,248, 91,154,231, 10, 35,197,138, 78, 95,104,217,239,218,196, 65, 19,216,171, 3, 93, 76,168, 36, 26,129,152,235,100, - 31, 19,243,249,130,182,149, 0,179,232, 3,167, 78,110, 11,133,120, 25, 37,159, 57, 74,218, 90,193,196, 22,136, 79, 46,185,192, -177, 83,219, 92,250,212, 63,176,215,246,121,215, 35, 87,121,213,151, 63, 15,213, 95, 99,199,148,124,244,252, 37,254,253, 79,255, - 12, 0, 63,254, 27,111,230, 88,175,160, 9,158,185,139,252,214,191,251, 65, 38, 77, 71,139,230, 41,235, 67, 42,149,168, 19,108, - 84, 37, 27,189,146, 69,231, 56,119, 48,227,177,131, 57,199,183,214,121,202,169, 77,198,192,133,131, 25, 15,237,183, 52,206,115, - 98, 88, 81,151, 5,123, 15,223, 79,231, 20, 46, 15,159, 18,138,210,106, 6, 24, 78,216,130,249,227,255, 3, 69,228,248,198,128, -217,116, 42, 95, 82,155,213,146, 90,163,139, 18, 95,207,197, 83, 90,244,209, 74,209, 63,118, 35,161, 89, 80,142,198, 76,175, 92, -164,157, 77,241, 77, 71,187,168, 89,204,230, 76, 46, 61,193, 98,127, 66,244,115, 92, 93, 83,246,123,180, 77, 75,202, 21,104,215, -122,188,139,184,214,225, 67,160,212,138, 54, 56,246,159,220,193, 47,174,209,239,143, 40,236,128,118, 86, 83,246,228, 96,211, 8, - 6, 53,120,159,199, 62,134,217,222,101,180,113,152, 84, 64,208, 68, 95, 3,100,116,132,220, 0, 0, 32, 0, 73, 68, 65, 84,134, -118,190, 79,213, 47,241,221,140,225,104,141,122, 90, 19,124, 67,217,175, 88, 28,236, 81,141,199,236, 95,122,130, 27,158,245, 28, - 46, 61,246, 0, 87, 30,251, 12, 33,120,186,214,113,236,198, 59,105,155, 41,147,203, 23,177,182,162, 26,244,169,214, 6,148,195, - 49,186, 52, 20,189, 30,139,201, 62,202,150,244,199, 35,124, 23,153, 93,187, 44, 62, 92, 99,113,109,141, 49,134, 72,196,228,228, -162,221,135,207, 99,251, 67,198, 91, 35,186,197, 33,138,142,245, 91,182,121,218, 98,192, 90, 84, 12,135,107, 40, 21, 72,198,176, -127,105,151,202, 24,134,104, 74, 52,165,201,248,194, 36,163,115,225,183, 43, 90, 47,214,142, 16, 35,222, 39, 66,138, 24, 43,222, -116,163, 19,133, 81, 40,157, 50, 26, 58,229, 29,148,236,162,172, 86,226,229,244,194, 9,154,118,114,153,103, 29, 23,133,129,115, - 51,120,219,175,191,150,107,147, 22,187,117,156, 84, 86,146,142,229, 58,156, 15, 20, 69,226,196, 93, 39,121,202,115, 78,242, 61, -255,236,121,124,246, 64,196,109,143, 28, 6, 38,211, 22,149, 34, 74, 42, 17, 84, 81, 98,198,107,216,254,144,226,248,136,225,169, -117, 54,110, 57,206,232,150,211,108, 61,243, 54,110,123,237,247,112,235,127,252,121,214,158,242, 84,210,167,255, 59, 87,254,244, - 77,124,254, 61,239,227,151,254,224,113,254,102, 39,177, 23, 19, 31,184,236,121,199,155, 62, 67,243,228, 99,248,131, 93,162,111, -133,126,182,228,108, 43,115, 20, 83, 26,243,193, 28, 3,169,149,132,175,100, 45, 73,151, 36,211, 71,245, 54, 81,253, 99,152,241, - 49,204, 96,131,212, 44,104, 47, 62, 70,216,126, 17,122,243, 78, 66,215,224,186,150,255,244,230,223,229, 98,130, 83,165,230,141, - 31,217,101,241,209,119,161,202,225,234,194,138, 62, 44, 87,200,226, 87, 95, 42,172, 17,132, 85,202,123,229,180, 26,157,166, 85, -215, 38,226,188,124,138, 44,177,177, 57,206, 52, 45, 71,218,164,163, 56,191,180,244, 76,235, 44,252,139,196, 36, 49,170, 41,166, -188,247, 86,248,131,107, 40, 37, 9,129,228, 92,246,213, 96,250,186,231,115, 36, 57,142,171,188,119,109,139,163,145,113, 18, 28, -108, 12, 17,141, 48,209, 83,215,202,164, 35, 8,251, 61,248,124, 9,102,116,173, 20, 40, 33, 15, 25, 98,214, 50, 52,153,123,145, -240,109, 71,202,133, 79,202,255, 92,178,178,127, 79, 93,155,215, 40,249,207,244,185,155,244, 94,138, 37,239, 69,216, 21,147,216, - 19,131,187, 46,207, 61,235, 15, 98,166,161,117, 25, 33,219, 57,185,184,148,228, 80,248,186, 93, 21,123, 74,105, 17, 44, 42, 37, -221,124,138, 34, 28, 84, 41,103,197,135, 28,245, 42,133,148, 83, 66,225, 11,157,203,130,189,235,241,168,128, 23, 33,178,238, 9, - 78, 55,164, 28,119,234,115, 32,202,210, 6,152,215, 32, 43, 85,214, 82, 32, 23,157, 92,218, 62, 95,236, 33,239,205,235,249,209, -101,222,181, 48, 57,128, 69, 45,127, 86,175, 15, 27,155,244, 7, 3, 6,253, 10, 91,183,152,182,198,204,166,232,201, 20,189,187, -131,154,207, 81, 62,160,109,145,181, 35,136, 67,161,115,194,208,136, 34,184,140, 81, 58,246,144,194, 17,103, 32,175, 46,150,224, - 32,212,117,107,128,149, 96,191,148,118,249,198, 27,225,216,137, 21,243,222,185, 5,222, 37, 90, 23,233,186,200, 98,145,240, 78, -161,162, 32, 90, 43, 35,123,111,197,145,157,223, 59,133,247, 90, 54, 12, 46,209,182,114,185, 39, 45,117,142, 90, 74, 19,148,236, -202,151, 54,223, 37, 24,175,243, 34,168,235,188,136, 34,151, 82, 6, 89, 3,197, 28,210, 2,143,126,254, 33, 76,101,184,255,179, -159,225, 91,191,245,159,113,238,220,147,130,249, 54, 34,252, 93,126, 30,107,115,152,124,138, 73,156, 11, 56,238,255,228,227,248, -113,143,181,238,239,136, 58,242, 7,239,254, 16, 79,169, 20,238,244, 45,220,188, 57, 38,170,200,187,223,242, 38,254,233,191,254, -110,250, 42,113,188, 80,220,253,220,187,177,253,146, 24, 97,218,180, 28, 54,137,187,214,215,168, 99,224,252,188,203,100,174,130, - 19,131, 62,243, 16,249,196,133, 29, 66,132,123, 78,140,232,138,130, 91,250,154,253,198,243,192,197, 3,254,207,127,245,229, 28, - 60,254,215,132,164,136, 81,198, 22, 86, 43,170,168,217, 42, 44, 91,214, 80, 68, 79, 59,185, 68, 81,141,153,215, 53,218,150,104, -219, 35,165,128,233,245, 73, 40, 92, 61,161, 87,108,229, 84,166,136,111, 22, 36,215,209,223,218,228,218, 99,143, 99, 13,108,220, -114, 51, 23, 63,115, 63, 49,118,140,142,159,225,220,103, 30,228,204, 51,207,114,245,241,203, 76,246,174, 98,251,199,113,126, 70, - 17, 54,177,202,211, 46, 90,154,102,194,250,214, 41,218,249,132,216,122,110,190,251, 44,135, 87, 47, 98,123, 5,139,131,171, 88, -187, 73, 83, 79, 24,108,110, 51,216,220,160, 62,156,146,116, 71, 55,169, 81,195,150,114, 48, 34,122,141,238, 59,209, 51, 20, 61, -217,101,199, 6, 99, 78,114,225,177,251,184,237,158,103,179,216,111, 73,177, 37, 37, 69,179, 56,192,205, 22,212,135, 59,204,247, -246, 40, 74, 75,185,118,156,122,247,128, 98,109,200,230,205,183,103, 85,113,230, 72, 39,240,243,134,209,182,193, 22,134,106, 48, - 34,225,241,141,167,158,207,176,121,212, 21,130,135, 0,193, 7, 76,145,171, 72,228, 89, 29, 94, 57,160, 11,142,222,168,162,155, -238,163,138, 68, 81,173,241,252, 23, 63,157,199, 30, 57, 71,104,102, 16, 26,146, 81, 92,120,226,128,173,129,102, 70,162,210,138, - 16, 85,182,229, 36,220,242,157,242, 71,165,169,107, 21,131, 65,214, 49,101,120,178,226, 58,230,117, 86, 95,163,147,132,197,104, - 57,133,140, 75, 84, 94,209,120,197, 51,110, 87,156,127, 48,173,152,199,151, 14,225,221, 63,245, 85, 76, 99, 73,168, 15,104, 30, -249, 20,221,229, 29,186, 69, 39,123,170, 78, 48,181,213,201, 77,250,103, 78,210, 31, 22,188,225,123,239,229,255,120,227, 39, 89, - 31,192,235,223,240,151,188,225,245,223,196,206,249,107,104,101, 81, 85,133,238, 10,162,181, 24,163,233,143,135,152,193, 0,165, - 10,122,207,121, 57,122, 84,192, 35,159, 36, 54, 45,126, 50,161, 26, 24,110,123,225, 93,252,220,109, 27, 92,248,220, 21,246,175, -213,220,112,178,226,230,151,222,138, 62,125, 59,109, 35, 10, 97,165, 75, 84, 33, 99, 76,149, 2, 41, 26, 72, 78, 70,237,209, 11, -116, 39,211,230,232,173,163,138, 1,216, 1,170,215,199, 14, 71, 40, 93, 16,174,158,199,233, 53,212,237,223,128, 10, 53,209, 45, -208, 86, 83,148,235, 20, 39,110,224,238,155, 78,208, 92,219,229,195,143,238, 49,187,122,137, 51,223,242, 90,118,223,249,251,153, -105, 45, 35,241,228,151, 81,183, 17,101, 69,123,161,148,116,162,164,152, 5,113, 98, 97, 74,193,231,236,111, 17, 61, 98,116,238, -232, 83,182, 18,201,216, 91,101, 81,159,204, 31, 89, 89,218,146, 79,171,220,118,188,135,194, 74, 71,229, 4, 84,115,240,129,183, -177,253,170,239, 62, 18,178, 69, 73, 95, 36, 72,199,153,186,150, 16,142, 46, 72,181, 74,112, 23, 5,188,213,154,128,128,102,146, - 11,168, 74,138,178,216,205, 69,240,150,129, 59,137,163,216,205,152,213,124, 33,248,172, 37,145,203, 89, 72,117,130,182,141, 41, -171,252,139, 76,165,139, 81,138,161,182,203, 96, 27, 77, 82,138,208,116, 89,146, 16,100,213,177, 76,113, 51, 70,180, 3, 75, 86, -125, 18, 1, 98,136,203,207,159,208,201, 98,173,206, 17,155, 74, 16,202, 62,228,238, 58,161, 11, 69, 12, 10,141,124, 6,101,133, -110,167,146, 67, 45, 51,234,139, 50,199,184,202,216, 25,101,161,107,233,186,128,239, 60,218, 77, 81,101, 41,163,107,215, 9,138, - 55,230, 44,101,165, 86,174, 32, 49, 90,199, 35, 90,172,190, 14, 17,155,215, 44, 43,172,236, 10,239,154,189,129,182, 16,159,160, -239,160,117, 71, 88, 86,215, 17,234, 57,170,109,208,253, 65,190,229, 2,156, 58, 65,169, 18,122,177, 32, 46, 22,164,186, 38,228, - 16, 22,213,239, 99, 6,107,232, 94, 95,138, 81, 0, 31, 36,130,214,123,188, 77, 89,163, 18,196,130,232, 5,223,251, 5,193,113, - 74,180, 28, 43,112,146, 53, 95,152, 68, 71,129,170, 74, 82,225,178,249,194,242,224,125,239,101,177, 72, 28, 78, 35,147,125,185, -176, 85, 94,129,169, 32, 86,210,136,116,233,206, 75,110, 68, 8,146,165,238, 59, 37, 3,142, 78, 86,132, 75,198,142, 50,226, 51, - 95, 2,129, 76, 82,121,181, 36, 29,187, 54, 10,111,178, 64, 89, 11,127, 32, 70, 17,229,250,236,228, 65,193,179,239,190,139,199, - 30,253, 44, 15, 61,252, 16, 15, 62,244,144,108, 53, 76,174, 67,175, 99, 0,217,202, 26,172,146, 20,161,206,123, 92, 59,227,197, - 47,249, 18, 94,255,214,247,113,174,113,148,253,138,107,179, 5,213, 28,182,143, 59,126,232,219,190,145,135, 30,122,156,251, 62, -241,247,252,233,175,252, 18,191,250,166, 55,113,223, 99,143,241,216,125, 15,240,200, 3, 15,112,251,198,144,131,174, 35, 69,197, -253,147, 25,165, 49,140, 74, 1,102,204,186,200,110, 59, 99,173, 44, 24, 90, 75,169,225,252,172, 35,106,205,165, 69, 98,221, 42, -206,108,142,184,233,184,230,240, 81,131, 79, 98,187,209, 57,164,163,208,154,129, 54,140,108, 65,169, 20,113,114, 30, 61, 60, 65, -220,186, 73, 32, 28, 89, 17,155, 98,194, 20,122, 37, 10,114,245, 28,136,248,122, 70, 87,215,148,195, 33, 59,143, 63,202, 29,207, -127, 1,205,100,194,226,112,202,250,246, 49,166,123, 19, 81, 89,215, 13,245,116, 10,193, 97,108, 69,232,162,116, 32,185,163,177, -166,164,105, 14,233, 50,243, 57,164, 9,193, 37,208,158,168, 60, 90, 7,208, 22,183,168,179,109,165,162, 57,152, 50,222, 62,193, -254,165,115,244,199, 5,211,157, 75, 12,143,111, 17,154,128,173, 44,135, 59,187,244,215,199,248,208,177,121, 82, 60,198,100, 16, -200,112,235, 52, 87,207,221,199,228,202, 69,140,177,236,156,123,128,254,104,155,254,218,136, 75,143,125,154,170, 26, 83,142,135, -184,121,195,112,235, 4,101,191, 66,151, 5,107,227,117, 14,175, 94,226,196,109,183,226,141,167,157, 46,164,235,172, 74,146,247, - 12, 54, 55,105,103, 11,214, 54,198,196, 38,224,219, 26, 91,148, 50,134, 13, 13,251, 87,119, 81, 81,225,219,150,148, 2,126,222, - 96,123,138,225,230,136,167,127,241, 51, 9,126, 33,200,202,206,243, 15, 23,103, 60,251, 41, 5, 77, 12,216,164, 88, 90,162, 67, - 94,181,249,108,157,138, 94,222,105, 95,136,127,179,174, 19,245, 44, 49, 24, 44,163, 45,229, 96, 42, 10, 77,155,167,120, 70, 93, -247,142,122,208,181,162,106, 34, 91,103, 11,110,127,162,227,225, 90,206,154,167,159,234,243,204, 23,127, 49,123,243,130,246,177, - 15,210, 60,246, 36,244, 43,116, 81, 80,148,106,165,232,141,251, 51,234,217,156,234,142, 91, 40,202,130, 55,190,238, 94, 94,254, -115,159,228, 23, 63,118,192, 79,183, 11,121,225,181,100,125,235,129,193,134,138,254,120, 64,177,185, 73,185,117, 10,182,239,128, -246, 50, 92,201,235,158,102, 65,240,142,242,196, 54,232,136, 25,141,184,235,121,207,146,100, 46,101,240, 78,196, 98,118, 67, 44, - 82, 90, 27,180, 42, 86,192,139, 20, 90,217,159,107, 72, 46, 8,137, 79,151, 36,221, 67, 39, 75, 82, 61,172, 53, 24, 29,137,211, -125,226,236, 16,119,226,121,216, 19,119,146,218,125,146, 82,104,221,199,244,202, 85,199,241,159,223,240,227,188,250, 95,252, 0, - 99, 5,127,244,217,125,126,224,239,223,131, 42,171,149,152, 74, 97,114,108, 99, 60,234,142,115,251,150,194,210,147, 45,123,120, - 81,188,103,206,110,182, 94,165,156, 47,169,172, 21, 22,188,202, 33, 45, 43, 74,232, 18,164, 34, 29,167, 90, 90,144,242,200, 91, -103,242,156, 92, 66, 21,110,247, 60, 40,131, 45, 45,190, 19,173, 75, 86,194,201,200, 88, 41,146,119,248, 28,198,100,138, 66,252, -237,185,229,137,203,236, 75,173, 40,135, 3, 17,155,121,143,239, 58, 18,146,240,103,139,146,174,157, 11,233, 46, 83,242, 66, 43, -157,106,112, 45,160,178,152,143,213,133,142,151, 11, 61,100,190,248,138,182,178, 36,154, 37, 36, 65, 46,255,189,168,100,221,160, -140,112,232,245, 50, 45, 61,169, 76, 96,245,248, 54,119,150,202, 80, 20, 50, 21, 11,241,136,222, 22,189,132,169,196, 78, 68,105, -177, 21,144, 77,210, 10,173, 44, 9, 25,249, 43,173, 4,146, 2, 66,203, 76,160,136,116,115,135,173, 74, 76, 81,226, 6, 35,186, -195, 67,232,149,232,182, 33, 52,141, 64,184,188, 39, 25, 47,191, 63,155,247,228,230,186,244,180,229,232, 60,250, 35,118,123, 92, -134,205, 92,143,126,205,255,108,204, 24,215, 37,233,206,183,194, 75,246, 30, 22, 11, 82,211,224, 58, 71,218,219,165,220,216,144, -181, 74,240,176,190,137,141,137,176,191, 79,208, 22, 19,199,164, 65, 31,181,185,129, 30, 14,242, 26,200,147,148,232, 29,150,177, -179,218,115, 93,188,108,214, 45,164,165, 19, 99, 41, 46, 92,178, 7,174,251,172, 95, 16,228,178, 60, 88, 4, 90,100,140,230,143, -223,242,131,172,141, 18,237, 2, 90,119,221, 20, 43, 66,200,129, 42,209, 72,224,138,178,160, 27, 48, 54,225, 26, 88,212, 9,215, - 66,219, 40, 90,119,221, 88, 32, 55, 40,154, 35,231, 72, 17, 21,149,210,232, 32,105,111,201,228,198, 39,175,113, 74, 45, 86,220, -194,200, 99, 44, 43,197,254,254, 14,155, 27,199,216,217,219, 21,199, 96, 54,175,196, 28, 81, 15, 75, 57, 68, 52,148, 70,227, 99, -148,189, 38, 37,167,159,123,150,111, 95,192,238,100,143,127,255,142,191,227,145,183,255, 23,222,240,179,191,199,159, 60,240, 56, -237, 7, 63,198,199, 31,122,148,173,251, 63,199, 35,191,250, 38,142,141, 6, 92,154,204,248,225,255,245,149,252,246, 59,222,197, -118, 1,235,101, 73,136, 9,171,161,245,129, 89, 23, 8, 9, 74,163, 80, 49,114,176,104, 40,141,102,173,148,125,110,207, 40,206, -110, 22,204, 27,207,115,159,251,108,246,239,251, 24, 74, 67,161, 12, 67,155, 8,120, 42,147, 24,107,195,168,180, 84, 74, 98, 58, - 59,109, 96,126,153, 58, 53,242, 29, 52, 86, 68, 44,209,163,109, 9, 9,218,233, 62,209,121,202,181, 33, 16, 40,202, 10,146, 98, -188,117,140,181,147, 55,114,233, 51,255, 64, 12,129, 75,143, 61, 68, 81,142,241, 93,205, 98, 90, 83,207, 14,136, 81,210,139,108, - 81, 81, 55, 51, 82,242, 68, 5,221, 98,129,170, 3,137,146,182,222, 99,109,235, 24, 41, 42, 22,135,231, 24,157, 56,142,171, 27, -250,235, 27,204,246,247, 24,142,215,177,166, 0, 93,224, 92, 77, 10,154,114,173, 15,177,132,208,163,157, 95,193,246,199,146,177, - 16, 3,174,233,168,170, 10, 55,155, 98,251, 35, 38,215, 22,204,246, 46,131, 74,180,179, 9,182, 55, 68, 37, 75,215, 76, 73, 70, - 81,104,152, 53, 13, 23, 62,249, 73,220,188, 97,227,228, 41,194,109,103, 24,159, 56, 73,217,175, 56,188, 22,185,246,216, 57,182, -110,190,145,241,240, 6,186,182, 89, 69, 77, 21,189, 33,245,116, 15, 24,175,252,196,166,167, 9, 62,224,187,154,245,205, 30,174, -157, 19,242,174,210, 43, 13,170,135,214,150,212,213,146,150, 25, 35,113, 50,229,193, 73,199,115, 99, 65,105, 52,101,136,204,209, -132, 24, 8, 6,186,152,147, 53,163,164,164,153,108,203,136, 17, 92,151, 68, 16,146,147,172, 18,137,152, 43,216,148, 68,109, 26, -140,236,167,172, 86, 18, 19,171, 20, 58, 25,170,144,120,222,151,150,204, 62,208,113, 45,192,241,245, 74,196,120,186, 32, 92,219, -193,174,245,137,189, 18,237,142, 50,160,147, 5, 51,168, 72, 33,224,174,236, 80,157,218,102,182,179,195, 7,127,228, 94, 94,251, -230,251,249, 47,255,245, 3,252,208,107, 94,196,244,176, 21,117,183,169,176,163, 1,118,115,147,242,244, 25,216,124, 10,184,171, - 80, 47,136,179, 41, 49,149, 68,215,144,124, 35, 29,207,250, 22,106,208,224, 67,160,107, 35, 26,193,127,162, 51,221,204, 74,119, -128, 86, 71, 60,111,151, 57,211, 62,146,148, 37,154, 10,204,128,164, 75,208, 6,173, 28,116, 17,127,176,131,179,155,196, 51,175, - 68,219,132, 91, 92, 69, 25, 77,185,182, 38, 7,181,234,227,189,195, 90,203, 15,127,247,235, 56, 85,105, 10,165,248,163,143,156, -231, 95,221,187,205,246,215,127, 51, 59,239,250,111, 71,179,215, 37, 8, 95,229, 40,205,148, 91,157, 37, 92,134, 28,183,154, 15, -166,180, 82,193,103, 11,157,202,202,156,224,115, 68,232,117, 62,111,150, 99,119, 81,161, 39,144,177,110,238,244, 66, 43,184, 85, -133, 34,249,134, 56,117, 82,224, 14,214, 73, 7,251, 43,227,173,210,150,232,154, 85,102,249, 18,194,162, 84, 22,200, 45,135,230, -222,101,135,158,168,151,201, 2, 48, 91, 20,116, 93, 71,215, 52,217, 11,126,189,160, 77,166, 9, 62, 7,199,104, 43,162, 39,153, - 72,228, 53,133,145, 66, 68, 60,249,215,229,195, 47,199,189,217,143, 30,186, 70,166, 11, 17,130, 74, 88, 99, 49,214, 19,163,193, -216, 60,165, 8,224,157,151,145,121,219,161,181, 37,196,128,166,144,119, 42, 23, 11,218,106,218,133,207,201,113, 82,172,216, 40, - 59,113,159, 18,102, 57, 85, 73,146, 83,255, 5,211,141,144, 8,190,149, 73, 75, 4,125,250, 38,234, 43,159,199, 20,199, 73, 49, -224,235, 6, 91, 85,164,162, 32,216, 78, 58, 72, 99,164,242,206,220,254, 21,107,125,101,216,207, 23, 55, 81,114, 72,149,254,199, -254,181,235,214, 34, 42,231,157, 39,104, 90, 82,118, 50,164,224, 73,222, 17, 90, 79,237,246, 40, 74,147,169,142, 74, 52, 15,155, -199, 81,131,145,172,131,172, 89,145,247, 72, 66,117,140, 42,255,251, 37, 88,143, 16,175,203,104,191,238,175, 37,174, 61, 19,252, -174, 3,220, 37,165,190, 32,135, 61,165, 47,204,125,215, 90,243,215,239,124, 51,147,201, 12,231, 20,157,151, 36, 72, 19,151, 97, - 50,154,164, 16,145,175,138,120,149,208, 49, 65,153, 72, 45,212, 13,204,231, 18, 90, 21, 82,150, 24, 44, 31, 93,167,208, 3,113, - 2,169,168, 40,141,166,175,160,175, 52,198, 66,235, 34,139,124,177, 47,195,233, 98, 74, 84, 54, 7,201,100,101,251, 45,183,222, -202, 29, 79,189,131,249,194, 9,208, 38,192,239,255,222,239,225,227, 10,244, 40,147,223, 42, 83,162, 92,230,112,206,167, 19,110, - 62,123, 3, 47, 24,157,224,193, 79, 61,204,119,156,219,225,119,222,242,255,113,178,222, 97,205,183, 60,114,238, 9,250,189,138, -255,252,195,255,134, 63,121,215, 59,121,248,220, 5,214,250, 61,222,250, 87,239,229,216,198,152,218, 7, 44, 48,233, 26, 78,143, -250,148, 72,164,107,235, 61,195,210, 50, 44, 44,209, 7,118, 93, 32, 42,205,180,115,236,183,145,121,235,112,157,231,103,158,255, - 12, 14, 62,246, 4,125, 93,112,188, 76, 40, 7, 65, 43, 42,149,216, 48,150,161,150, 75, 61,146,104, 67,100,230,193, 25,131, 41, -251, 68,215, 18,189,199, 20, 21,221,236, 64,124,144,116,196, 88,160,154, 58,143,244, 74, 38,151, 46,161, 10,197,181,135, 31, 96, -126, 56,197,205,106,226,226, 2,246,134, 49, 11, 63, 39,250, 68, 81, 85, 34,116,200,149,121, 97, 43,234, 60, 57,112,174,165, 24, - 88,140, 82,196, 73, 36,248, 5,197, 96, 64,209,245, 73, 62, 81,216, 30,205,236,128,126,111,147,102,190, 7, 3,241, 91,117,237, - 4,116,193, 98,239, 42,189,225, 24,215, 88,186,174,197, 28,214,104,213, 82, 84,199,233, 22,251,148, 91, 55, 48,221,157,208, 45, -206,211,223, 28, 51,219, 59, 32, 68,203,225,206, 5,250,195, 99,152,168,248,208,219,254,144,219,159,251, 28,206, 62,251,171, 57, -247,224, 95, 16, 93,199,243, 95,253,189,232,194, 50,191,186, 71, 49,236,227,154,142,162,234, 51, 92, 63, 70,125,120,192,232,216, - 73, 52, 48,189,118,133,141, 83,167,101,234, 80, 13,240, 33, 96,139, 2,175, 34,222, 37, 76, 97,153, 93,120,152,155,158,126, 43, -190,153,160,226, 66,118,155, 69,159, 96, 74, 18,134, 20, 21,214, 38,124,242, 52, 7,115,174,229,103,165, 51, 48, 38,198, 68,176, - 66, 95,114, 42,175,218, 50,161,210, 26,176, 58,209, 58, 69,229,229, 80, 8, 46,146,186,132, 75, 74,162, 94, 99,196, 42, 25, 69, - 38, 13,177, 80,180,141, 28,194,117, 94,173, 18, 20,107, 70,241,138,231,245,248,111, 31,107,112, 49,192,218, 22, 92,219,147,112, - 13,219,147, 42, 94,105,116, 33,167,129, 10,121,112,155, 81,153,201, 20, 20,227, 17,151,247, 14,120,243,119,156,101,251,245,159, -225,251, 94, 61, 39, 37,147,133, 68, 5,197,104, 68,117,226, 6, 24,157, 1, 93, 47,151,209, 40, 83, 16, 46, 95,164,107, 27,244, - 96,132, 42,123, 36,215,202,184,188,244, 24,235, 51, 37, 44, 11,133,181, 70, 85, 85,246,132,123, 57,232,156,140,171, 99, 74,226, -195,181, 35,185,208,149, 66,227, 80,201,147,166, 53,222,121,218,147, 47,132,209, 77,232,112, 32,113,181,253, 1,213,218, 16,211, -235,145,114, 40,199,249,251, 63,206,243,239,125, 41, 91, 64, 89,106,186, 40, 49,157,159,216,109,121,233,103, 62, 33,130, 32,239, - 50,145, 44,161,205,242, 18,203, 35,231, 36,137, 61, 74, 41, 34, 26,165,151, 7,100, 58,194,202,106,155,213,213,113,213, 1, 41, -142,208,170, 43,174,187, 86, 71,164,182,148,211,223, 8, 71, 97, 48, 65,101,210,168,168,196,253,254, 85,202,237,141,236,183, 54, -196,228,209, 74, 62,111, 12, 62,251,226,179,103, 62,120,138,178, 20, 5,190,119,242,217, 98,123,164,200, 86, 57,177, 76, 73,218, -156,119, 78, 38, 29, 41,137,108, 57,134,213, 78, 58,230, 32,150,232, 85, 30, 79,135, 76,208, 83,196, 46, 23, 57, 33, 17,147, 91, - 37,160,165,236, 55,143,222, 19,156,147,200,212, 37,114, 20, 67, 8, 73,216,239, 62, 18,112,160,156, 76,109,130,196,167,198,144, - 81, 97, 62, 97, 10,179, 10, 59,137, 64,234, 4, 19, 29,242, 68,193, 22, 34, 2, 54, 86,211,181, 14,235, 51,119, 62, 4,202,194, -202,115, 86, 34, 4, 84,222,147, 58,135,183, 89, 98,160, 13, 93,227,114,244,107, 90, 9,235,146,115, 36,107,136,214,160,151,221, - 57, 25,118,180,188,208, 77,145,173, 6,133, 60,219, 24,101, 63,110,138,236,151,191,126, 52, 31,143,144,176, 89,165, 30, 22, 51, - 9,184,137, 75, 78,187,120,198, 33,224, 66,118, 22,248, 32,209,207, 36,130,149, 12, 3, 99,141, 76,115, 66, 32, 32, 83,160,116, -221, 78, 60,173, 98,112,213, 23, 66,237,114,145,160,254, 81,156,171,216,200,244,117, 20,188, 47,188,208,131,247,212,139, 41,191, -245,139,255, 59, 69, 63, 55, 26, 57,125, 77,231, 66, 33, 70, 17,150, 22, 54,225,146,184,131, 82, 18,110,129,107,210, 74,240,219, - 1,174,201,185, 52, 94,172,111, 6, 8,157,198, 20,138, 66, 41, 97,163, 40, 77,233,197,198,187,240,137,224, 69, 77,151, 77, 48, -216, 36, 29,186, 82,240,212,179,119,242,200, 35, 15,240, 23,127,249,223,185,116,229,154,104,145, 50, 11,168,238,178, 11, 77, 29, -185, 8, 53, 81,225, 98,164, 77, 34, 50,232, 46,127,154,251,126,247, 77,168,233, 35,108,109, 84,188,246,117,255,154, 87,124,203, - 55,241,251,159, 56,199,253,251,115, 14,162, 98,238, 61,223,245, 31,127,138,183,191,247, 3,164, 24,120,229, 75, 94,196,221,103, -159,198,108, 94, 51,212, 80, 32,163,144, 39, 14, 22, 92,107, 58,106, 39, 47,164, 54,150, 39,103, 53,155,163, 1,199, 6, 61, 54, - 74,193, 34,222, 60,176,156, 94, 27,114,227,250, 26,189,131,115, 24, 85, 48, 40,123,140,202, 34,143,234, 53, 27,214, 50,178, 22, -171,100, 71, 21,151,169,191, 6,102,205, 2, 91,245,228,144, 78, 9,116,174,198,115, 80,140,181, 34, 46,177,101,159,107,143, 61, -130,247, 11,118,207, 61, 74,115,184, 79, 74,158, 84, 4, 54,110,184, 91, 48,148,206, 51,219,223,229,202, 35, 15,227,218, 9,222, - 69,186,110, 38,254, 90, 99,233, 22, 45, 49,192,238, 19,151,104,235,171, 12,143,157,192,181,226, 7, 13,222, 97,236, 26, 77,179, - 79, 81,245,240, 62,224, 22,135,232, 98,128,247, 29,193, 37,170,181, 33,218,244, 56,184,188,131, 82, 53,166,200,185,207,214,210, - 45, 26,148,174,113,237, 28,219,243,152,202,178,152,204,209, 54,208, 76, 46, 51,223,191,194,197, 71, 62, 11, 90,179,219,193,253, -159,190,159,143,253,213, 95,241,233, 7,206,241,169, 79,124,138, 7,254,242,175, 80,109,131, 53, 45, 69,242,152,194, 50, 24,143, - 81, 86, 20,159,222,119,216,178,202,202, 88, 41,237,170,193, 80, 48,154, 25,149,136,149, 29,225, 71,223,249,155,140, 78,157,201, -239, 75, 68, 43, 39,106, 98,211, 35, 42,133, 42, 4, 32,131,210,120,231,104,178, 26,217, 69,241,141, 7, 36,248,160,203,194,143, - 46, 74, 84,225,202,246,154,213,238,190, 77, 52,179,196,124, 17,153,215, 9,231, 5, 22, 18, 50, 10, 58, 68,169, 72,157,151,100, - 44, 95,130,171, 20, 93,246,209, 86, 81,113, 76,105,190,247,139,134,124,215,115, 55,152, 79,107,226,193,133,172, 76,145, 84, 36, - 93, 89, 84, 89, 96, 55,215, 41,207,108, 11,250,219,104, 25,141,106, 75, 49, 28,211,239,247,216,141,150,183,254,211, 83, 28,255, -231,111,231,196,241, 10,221,171, 40,214, 70,152,225, 24,214,214, 97, 56,130,102, 6,109, 71, 74,133,164,213,141,199,148,163, 17, -106,113, 64,216,187, 8,245, 28,229, 23,152,148, 48, 70, 99,141,198,246,250,152,126, 31,211,171, 50, 46, 53, 18,219,142,216,186, -204, 15,143, 36, 44,193,110, 18,181,184, 51, 84, 59, 35, 45, 22,184,107,215,152,181, 99, 38,199, 95, 78,180,125, 98,115,141, 24, - 28,182, 87, 81,141, 6,232, 66, 97,203, 33,190,142,188,234,233, 79,227, 89,247,190,148, 91,250,134, 65,169, 87, 16,161, 83, 61, -205, 27,222,241, 57,220,133,243, 28,255,250,255, 45,115,215, 83,206, 60,207, 99,243, 44,220, 90,142, 45,197, 35, 29, 51, 15, 61, -136, 13, 45,102,111,118,240,146, 79,176,130,139,116, 89, 5, 31,115,152, 70, 90,133,173,144, 25,231, 41,211,197,162,115, 25,182, - 34,144,153,163,157,125,100,250,177, 63, 71,233, 98, 21, 1,172,150,177,122,121,239,189,132,196, 44, 47, 52, 85,150, 89,217,190, -220,215,179,194,167, 46, 69, 99, 33,143,248, 37,128, 69,138, 13,188,144,202, 82,254,185,209, 25,143,170,142, 70,249, 49,118, 34, -186,210, 10,215, 52,120,223, 74,151, 29, 34,193,119, 34,188, 92,212,184, 78,152,244, 62, 4,156,115,180, 77,135,247,157,172,171, -124,135,243, 14,215, 9,155, 35,116, 45,177,109, 9, 94, 10, 10,223, 53, 57, 97,178, 35,120,151, 71,252, 45,193,121, 98,134,172, -196, 32, 43, 7,223,118, 52,243,154, 20, 60,174,109, 8,205,130,208, 44,112,109, 35,207,195,117,196,174,197,117, 78,138,141,174, -147,213,184,209, 56,231,178,234,190,149,103,208,118,194, 64, 8,162, 38, 23, 85,150, 23, 91, 97,200,207,195, 24, 40, 74,185,192, - 11,147,101,213, 57,162, 49,100,213,123,138, 71, 93,114,200,220,246, 28,196, 66,219, 16,219,134,176, 88, 72,224, 77,219, 18, 91, - 81,199,167,182, 35, 54, 93, 22, 3, 42,186, 69, 67,219,200,243, 13, 49,208,117, 14,239, 28, 46, 63,147, 20,151,244,196,116,132, -138, 93,238,254,149,150,105, 79,186, 46,220,102,217,153,231,184, 91,181,196, 14, 7,255, 63,133,179,197, 24, 49,214,240, 93,175, - 56, 75,219, 40, 22, 53,204,106,152,215,146, 47,211,116, 34,232,245,153,238,215, 56, 57,227,234, 46,230,238, 60, 81,183, 48,157, -103, 38,252, 18,221,154,129,122,202, 41,116,210,152,160,136,157, 98,144, 52,253, 88, 80,122,145,171,187, 54,209,185,136, 3,154, -152, 8, 38,127,255,140,252, 58,208,240,172,187,159,137, 66,241,226, 23,190, 72,202,166, 60,156,104,253, 81,237,210, 69,145, 49, - 56, 15,230, 37,119,175,255,100,136, 17, 23, 69,221,121,118,188,206,165,199,247, 25,247, 29, 79,252,245,223,114,108,187,226,215, -126,228, 23,185,231,217, 79,103,182,104, 57, 85, 90,116, 12,172,245,250,164,232,169,130,231,237, 31,251, 20,149, 74, 28,204,107, - 14, 58,199, 51,111, 61,195,238,193, 33,167,215,250, 12,140, 34, 42, 77, 85, 24,118,234,142, 74, 41, 46,205, 59, 22, 94,248,205, - 79,219, 28,112,176,232,232, 98,226, 59,190,250,133,108, 29, 60,158, 93, 43, 82,121,250, 36,145,119, 3,109,216,176,134,129,182, -226,161,142,158,253,224,217,139,158, 98,125,139, 23,126,205,183,160, 76,129, 91, 76,209, 90,246,109,221,108,130, 46, 44, 73,137, - 80,197,213, 51,180, 49, 12,214,199,196, 38, 82, 14, 53,243,195, 78, 42,103,101, 72,174, 65,151,235, 12,214, 74,162, 75, 40,171, -177,182,207,124,127,143,132, 99,182,243, 36,253,241,166, 8, 95, 98,192, 90, 67,183,208, 52,211,115, 84,163,173,204,174,238,208, - 85,129, 86,150,249,254, 30,229,208,128, 31,178,179,243,121, 70,155,235,168,168,209, 21,132,185,166,191,185,198,222,185, 61, 90, -127,141,209,214, 9,230, 59, 7,216,194,112,184,183, 71, 53, 50,216, 98, 3, 55,159, 81,141,143,241,228,131,247, 81,174, 25,166, -251, 19, 38, 87, 46,112,234,216, 41,206,156,172,216,220,220,226,236,109,183, 48,180,142,197,254, 21, 62,255,177,143,177,152, 52, -248,105,195,230,173, 39, 8, 59, 51,202,141,117,180, 53, 4,215, 17, 92,195, 96,188,197,225,229, 11,148,189, 30,166, 40, 51,148, - 66,112,152,221, 98, 78, 89, 20,252,194,207,191,150,103,223,126, 43, 90,151,210,212, 42, 81,100,232,178,135, 45, 42, 82,116,178, - 55, 84,208, 92,153,240,231, 15, 79,120,193,205, 5, 7, 42, 49, 79,145, 41,145, 6,104,151,121, 33, 86, 70,240,214, 66, 89,229, -134,192, 42,202, 82, 34, 8,173, 86, 88,171, 41, 75, 77,116,162,126, 14, 81,130, 75,162, 79,196, 54, 23, 7,141,140,184,146, 83, -152, 0,253, 78,211,247,138, 94, 48,156,184,227, 22,122, 55,220, 72,216,191, 72,119,245, 26,244,123, 96, 13,166,234, 81,156,188, -137,242,212, 41,220,181, 43, 82,245, 91, 5, 69,129, 46, 7,232,254, 16,188,167,219,219,231, 25,119,158,224,205, 31,184,200, 77, -182,229,222,231,220, 73, 23,193, 14, 70,216,205, 83,224, 69,205, 27,187, 5,177,145, 67, 43,117, 78, 58,218,178,135, 29,140,208, -131, 33,166, 63, 68, 21,149, 64, 66,114,140,173,140,187,237,138, 84,182,242, 72,167, 18,170, 33,201,140,242,136,122, 65,170,231, -164,230,144,174, 46,153,108,189,128, 56,220, 70, 49, 39,210, 81, 12, 43,202,209,152, 98, 56, 64, 27, 69, 53,188,129,183,191,241, - 13, 60,255, 37, 95, 71,218, 63,224,116,169,151,113,224, 34,254,202, 97, 16,135, 93,228,155,159,181,205,214,139, 95,192,236,211, -255, 35,239,148, 85,206,230,200, 30, 92,179, 84,226,235, 60,225,144, 86, 65, 93,151, 24,165,242,206, 93, 45, 17,150, 62,174,180, - 1,218,154,149, 64,108, 25,225,154,212, 50, 77, 60,171,235, 51,160, 70,160, 49,113,149, 19,162,180, 34,206, 14, 24, 63,255,149, -132,197, 30,166,215,199,150, 61,217, 41,251,142,110,118, 72,104,107,130, 11,171,236, 16,171,151, 33, 76,118,197,108,195,251,149, -117, 47,248, 72,116,173,216,191,150,160,153,140,105,139, 73, 29, 69,107,166, 72, 76, 2,104, 74, 41, 9,221, 12, 1,237, 72,244, -102,200,104, 82,228, 29, 90, 66, 94, 84,194,119,142,206, 57, 66,144,139,179,115, 78,184, 45, 49, 91, 21,151, 57,238,185, 32,136, - 89,109,143,145, 84, 49,177,211,101, 79, 62, 50,177,113,173, 32, 81,131,143, 25, 32, 19,178, 72, 48,160, 82, 20,107, 92,126,238, - 33,137, 79, 94,161, 8, 62,160, 98, 32,116,142,164, 12,182, 87, 74, 26,229,165, 75,244,198,107,178,103,215, 22,219,175,208, 85, - 79,246,241, 90,184, 4,203,213, 4, 74,229,139,188, 18,227,115,182, 11, 18,243,116,235,186,137, 12,174, 61,234,126,243,109,150, -234, 5, 42, 68,252,225, 4, 92,135,171, 23,184, 70,222, 19, 82, 32,248,112,132,156,205, 33,224,106,121, 35,243,143,226,215,181, - 94,193,124,150,197,167,220,104, 41,187, 52,146,144,248,150, 41,128,249,194,143,136, 96, 19, 99,177,101,129,237,245, 81,131, 33, -186,215,203, 88, 54,123, 29,167, 33, 48, 59,216,227,173,191,249,115,162,135,208, 57,183, 66,229, 31, 41, 41, 98,210,171,188,139, -152,217, 14,162, 19,146,207, 52,155,231,212,181, 28,118,167,181,112, 54, 44, 90, 2,193,180,128,180, 42,163,233, 41, 67, 79,105, -138,252,227,204,218,192, 34, 68,130,150,117, 87,204,255,238,100,100, 50,160, 20, 12, 71, 99, 94,246,210, 47,103, 99,115,139,167, -222,113,150,167,222,121, 15,103,207,222,195, 51,158,121, 15,159,254,212,167,143,134, 35,153,222,107, 93,146,164,161,194,200,152, - 98,209,182, 84,235, 91,124,228, 67,143,179, 56,119, 64,120,207,251, 81, 3,195,188,105,153,207, 23,116, 42,114,211,198,136,247, - 62,177,195, 86,169, 57,123,108, 72, 82,137,211,163, 62,105, 58,165,208,224,154, 6,131, 98,183,233,100,220,133,226,210,188,225, - 91,190,232,110, 62,252,185, 7,177,202,224, 98, 98,175,150,106,109,179, 87,225,149,229,120,119, 21,101, 12,198, 68,108,180, 84, - 38,209,115,158,190, 41, 24,105,168,172,197, 68, 25,123, 52, 49, 49,143,129,218,123,238,121,250,189, 40, 99,240,237,130,178,191, - 70, 74, 50, 78,182,189,138,122, 58,165, 28, 38,186,206,163, 73,204,118,247, 81, 58,210,122, 71,115,105, 70,215,117,160, 42, 98, -187, 71,215, 25, 66, 56,196,218, 10, 59,218,164,153, 94,194, 7,104,166, 7,244,199,183, 80, 13, 78, 50,185,246, 56,235, 39,110, - 39,118, 17,179, 81,176,152, 46,240, 49, 16,124,135,107, 59,218,110,202,112,180,142, 39, 80, 88,137,174, 52, 69,162,153, 56,194, -241, 26,165, 11, 74, 93,114,112,248, 36,235, 55, 31,163, 24, 86, 12, 55, 70, 36,103, 24, 30,219, 34,161,232,171, 26, 75,133,143, -141,124,147, 26, 88, 44,246, 40,202, 27,217, 56,113,146,110, 49, 97,127,103,202, 45,103,215, 40,170, 30,166, 88,103,189, 72,140, -142,111,178,113,203,151,112,203,243, 95,192,238, 67,159,229,252,199, 63,206,248,216,109,108,108,111,161,181,198,246,215,184,250, -232,195,156,184,237, 14, 6,199,142, 17, 67,164, 93,204,169,250, 3, 20,138,182,158,161,139,146,166,158,145, 10,248,245,247,254, - 5, 63,250,202, 87,160,155, 30,237, 96,131, 50,200, 97, 99,250, 21, 69, 5,116, 53, 77, 29, 48,165,162, 80,240,241, 39,106, 78, -220, 92,209, 36,249,146, 6, 18, 81,165, 85,130, 80, 92, 6, 63,229,213,150,201, 76, 99, 5,212,117,162,172, 18,195,158, 6, 11, - 97, 17, 41, 10, 45, 83,201, 76, 77,245, 46,187, 83,130,168,224,241,138, 34,194, 32,104,246,246, 59, 30,255,228,147,124,235, 43, - 74, 38,151, 21,102,208, 39, 86, 21, 84, 37,229,137,155, 49,227,117,220,133, 71, 73,157,151,184, 81, 31,243, 43, 20,165,219, 27, - 15, 49, 23, 3, 79, 94,152,240,193,239,191,139, 59,127,241,115,156,220, 90,227,197, 95,247,114,185, 29,157, 3, 21,136,237,156, -176, 88, 16, 93,155,115,178,243, 1,163,149,132,117,144, 8, 49,174,196,195, 41,137,158, 4, 93,228, 67, 68,172, 75, 41, 65, 50, - 61,146, 29,130, 42, 73,237,148,208, 46, 72, 77,135, 15, 37,211,241,115,136,131, 33,101,154,147,156,228, 64,247,198, 99,202,181, - 53,208,129,193,230, 13, 92,252,220, 39,248,170,123,159,198,126, 23,184,167,103,112, 49, 31,242, 25,206, 82, 26,139, 91,238,125, - 83,194,161,233,158, 60,135,234,175, 19,231,147, 85,144, 71,200,130,210, 24,162,196,145,202, 13,191, 82,183, 11, 82, 56,173,210, -207,148,214,196, 37, 94,117, 57,251,212,162,197, 16, 23, 67,238,252,211, 81,113,158,114,210, 91,204, 9,104, 42, 8, 67, 51,146, -187, 45, 93,226,103, 7,178,142, 48, 90,158,175,217,146,142, 93,137,192, 48, 69, 69, 8, 66,223, 51,218, 16, 82, 86,235, 27,133, -210,165,136,168,108,135,175,157,184,175,156,147,207,148,225, 38, 81,235,163,209,109,182,197,173,216,154, 64,200,118,191,164,174, -243,195, 7, 71, 8,203,216,207,110, 57,215, 88, 93,236,193, 7,220,162,198, 39,136,206,163,172,193,117,200,119, 44,136,141, 19, - 47,177,169,178,118, 1, 31, 60, 58, 74,232, 84,236, 58,108, 89,138,245,205,100,155,150,147,194, 47, 37,217,157, 7,101,133,152, - 57,172,232, 92,182,115,197, 32, 46,133, 32, 93,158,192,163,178,165,141, 68,153, 23,177, 73, 41,201,126, 80, 71,224,156, 24,132, -198, 70, 97,101,236, 29,162,100,252,100,251,161,228,119,106,185,196,151,193, 47, 8,167,127,197, 71,237,132,151, 26, 98, 71,108, - 26, 89,109,233,204,250,175,107,252,124, 46, 46,151,186,206,223, 18, 45, 84,191, 37,227, 52, 38, 20, 45,170, 44, 68,159, 17,128, -104, 69,144, 25,132, 49,162,162,151, 93,191,213,215,197,246,202,248, 41,105, 89, 93, 44, 99,117,117,206,156, 71,231, 34, 50,105, -140, 17, 81,106,140, 33,219, 26,175, 75,118, 75, 71, 0,166,217,199, 63, 46, 14,155, 32,156,254,216,202,123,164, 76, 94, 39,170, -132,242, 74, 70,234, 42,163,140,115, 1,178,104,164,163, 79, 89, 21,188,148,165, 84,133, 32,157, 85, 82,148, 58, 83,252,156,241, -190,203,176, 0, 0, 32, 0, 73, 68, 65, 84,194, 43,104, 82,196, 38,112, 33, 50,243,145, 46,239, 44,179,150, 18, 99, 98,126,150, - 98, 18,248,232, 71, 62,202,135, 63,242, 17,190,232,185, 47,224,111, 63,240, 97,252,117, 24,253,112, 93,184,222,146,168,105,190, -244, 25,195,159, 84, 38, 98,148,166, 52,154, 83, 55,222,204,163, 31,124,140,227, 39,183,104, 85,143,247,126,250, 18,111, 61, 55, -231,165, 55,173,241, 85,223,254, 26, 62,250,200,195,148, 27, 39,248,137, 31,251,183,124,205, 87,188,140,123, 94,240, 66, 78,140, -215,249,228, 3,143,114,243, 77,167,153, 28, 30,242,138,103,222,202,109,125,205,164,110,241, 33, 49, 42, 20,227,170,226,177,171, - 59, 52, 57,170,209,104,197, 23,111,175,177, 85, 26,146, 41, 57, 61,172,120,229,211,182, 51,100, 34,255,226,150, 24,196,148, 88, -215,134,126, 81,160,181,140, 96, 28,145, 58,120, 22, 42,241, 69, 47,255,122, 78,156, 60, 67, 12, 30, 83,245,104,243, 23, 42,120, - 65, 42,246, 71, 27, 76, 46, 94, 70, 27,131,115, 18, 86,208,214, 75, 74, 85,143,114, 96, 57,184,188,143, 46, 2, 68,131, 86,208, - 53, 45,133, 53,153, 90, 37, 66, 9, 93, 24,209, 90, 40, 39, 57,202,133, 70, 57, 69,240,142,162,234,179,119,245, 2,227, 99,219, -116,139, 89,102, 96,123, 98,236, 40,170, 30,169,179,152, 94, 34,118, 13,168,138, 20, 26,148, 50,204,247,246, 81,101, 75, 89, 14, - 73,201,113,176,115,128,214, 19,250,107, 39,112,237, 2,173, 52,205,162, 99,122,240, 56,253, 65, 65, 85,142, 73, 42, 98,204,128, -170,239,232, 15, 78, 51, 61,120,146,205, 27,238, 96, 49,109,241,177,165, 26,109,112,227,179,159,203,240,216, 9,202,209, 16,165, - 11, 98,244,128, 97,176,181,193,254,197,243, 20,213,128,114, 48, 0, 68, 33, 92,244, 42, 20,210, 73, 78, 15,175,242,158,119,252, - 6, 74,193,135, 62,247, 48,201,246,185,251,233,119, 17,236, 38, 73,139, 0, 72, 43,177,206,185,230,144, 39, 62,117,129,191,184, -212, 48,233,224,105,183, 88,102, 49,209,229,247,116,185,251,210,121,130, 87,100, 87, 83, 81, 72, 2,155,181,146,168, 37,231,136, -162, 42,116, 22, 6,201,151,212,116, 9,213, 66,108, 19,190, 78,248, 69,130, 69, 66,117,208,219,131,143,127,174,227, 93,143, 53, -252,191, 23, 60,229,230,136, 87,126,245,115,233,218, 22, 55,217, 69,247,122, 20, 39,111,198,172, 31, 35, 28,238,224,118, 46,161, -172,149, 78, 79,139,184,200, 12,214,209,131, 17,248, 57, 97,239, 16,155, 18,131,241, 26,204, 23,124,223,219, 30,231, 5,199, 27, -206,190,228,197, 68,211, 35,206,247, 8,211, 67, 73,127,114, 29,201,101,102,117, 78, 74, 91,102, 60,163,244, 10, 69, 74,202, 16, - 36, 85,200,129, 90,183,164,168, 73,197,128, 84,140, 32,116,146, 84, 54,217,165,155, 5, 38,189,103, 50,173,158,130,173, 16,150, - 65, 37, 99,246,114,109,140,173, 74,122,227, 49,213, 96,155,239,255,170,151,241, 61, 63,250, 51,156, 41, 52,107,153,183,191, 12, -199,170, 10,205,229, 58, 48,220, 88,227,218, 97,205,168,208, 52, 62,241, 13,247,156,164,127,106, 76,239,204,115,104,158,120, 96, -213,165,163, 37, 11, 96,133,192, 90,165,108,229,174,154,235,236, 7,153,178,166,178,224, 45, 59,218,164, 51, 90,230,212,174,168, -114,113,245,255, 85, 41,253,163, 93,168,202,251,231, 44,212,138, 29,218, 90, 6,103,159,135,238, 91, 98,219, 81, 12, 70,171, 29, -170,107,230,184,102, 46,222,239,232,177,166, 16,220,177,213, 50, 57,202,148,186,224, 59,124,211,137,166, 35,248,236,237,150,159, - 33,116, 50, 34, 86,214,224,154,154,148,121,233, 49,196,156,201, 29, 4, 64,147,243,186,189,247,196,214,225,187, 46, 7,171,200, - 42,193,181, 45, 33,143,136,125,231,233,188,163, 93, 52, 52,141,140,221,149, 17, 59,220,146, 60, 18,149, 4,220,172,146, 77, 67, -204,103, 19, 43,200,130,136,172,101, 28,238,186, 14,223,121,233,206,151,145,177,217,190,151, 98,194,117,157,196, 35,167,152,159, -113, 22,172,134,101, 78,121, 68, 87, 54,163,114, 21,236, 92,161,223,239,161,141,197, 20, 6, 91, 86, 20,101, 41,235,180,194, 74, - 97, 84,100,175,191, 81, 80,246,100,244,190,140,103, 85, 72,231,158,124,206, 2,181,121,167, 46,157, 57,206,225,235, 57,110, 62, -197,237, 79,104,231,115, 66, 39,207, 40,180, 45,161, 94,208,205,231,132,224, 87,251,113,149,161, 60,194,102,136,171,236,250,101, -240,139, 74,226,249, 95, 5,215,132,220, 6, 47,163, 97,151,209,100,234,136,226,183, 76, 17,206, 58, 96,116, 81, 72,209, 80, 88, -138,181, 17,202, 20,168, 94, 63,211, 17, 11,252,222, 46, 74, 41,186,239,252, 17, 62,220, 63,192,235,150,232, 21, 97,105, 63, 67, -216, 24, 74,201,180,203,102, 4,246, 18, 73,237,162,184,247,124, 39,235, 65, 41, 54, 69, 16, 39,191, 31,149,167, 59,153,235,174, - 20, 49,202, 8, 95,165,196, 34, 70,225, 8,216, 92,211, 40,209, 97, 44,245, 1,203, 1,134,207,100,185, 39,207, 63,137,213, 71, -143,128, 36,225, 46,225,122,104,223, 50,132, 49,165, 12,152, 39,178,223,181,108,140,198,252,218,187, 31,228,106,244,220,185, 49, -230,228, 96,206, 3, 97,192,191,253,201,255,139, 87,221,113,154,233,206, 21,126,246, 39,127,154,241,160,207, 62, 48,176,150,157, -201, 33, 23,247,247,185,125,251, 56, 63,247,190,127,160, 95, 20,108,247, 11,142, 15, 43,214,171,130, 51, 27,125,254,246,243, 59, -171,148, 33, 31, 2, 15,238,206,184, 99,107, 64,232, 58,214, 7, 61, 82,215,162,178,186, 51, 37, 75, 21, 35, 67, 99,233,105, 69, -105, 68, 60,160,148, 37, 21, 9,147, 20,198, 42,130,131,227,167,111,198,183, 53,189,241, 49, 66,211, 16,157,167,115,141,132,185, -132,192,193,229, 39,105,155, 57,237, 98, 66,217, 31,210, 54,158,162,170, 56,220,219,165,168, 6, 76, 47, 93,166,191,118,140,217, -222,195,244, 54,207, 80, 47, 22,148,189,117,177,162, 77, 59,102,147,171,108,108,223,134,155, 75, 26,217,222,197, 3,250, 3,133, - 74,199,153,205,119,233, 13, 12, 93,187, 96, 56, 94,163,171, 91, 20, 5,157,239,208, 41,162,117, 65,215, 54,204, 14,119,100,247, -106, 43,124, 23,169, 6, 61,202,106, 72, 50, 61, 22, 7, 87,209,202,210, 31, 30,163,215,239, 99, 10,139,119, 30, 31, 58, 76, 89, - 48,185,112, 69, 82,219,204,128, 24, 53,166,128,114, 45,161,108, 15,221,211, 52,243,146, 43, 23, 63,206,230,201,167, 17, 66,192, - 47, 90,140, 6, 95, 88,202,162,207,225,181, 75,140, 78,156,166,158, 30, 98,203,138,170,191,198, 98,239, 42,229, 77,183,210,206, - 91, 6,235,107, 66,191,138,158,178,223,231,145,143,126, 4,107,143,192, 80,127,243,153,251,249,224,167,238,231,127,249,178, 47, -227,249,207,124, 6,221,252, 0,231, 12,113,177,160,187,188,207, 31, 60,112,128,210,112,185,133,223,251,112, 3,121,186,157, 45, -148, 20,121, 93,217,183, 2,139, 89, 98,165, 43, 43, 30,244, 99,107,137,106, 0,253,245,200,211,238, 76,108,223, 86, 48,232, 67, -175, 50, 20, 5, 88,151,112, 83,136,179, 68, 61,129,243,127,223,241,247, 79, 68, 22, 30,174,101,151, 77,105,225,175, 31,222,161, -212, 17,108, 69,177,190, 78, 72, 80,172,159,192,215, 83,194,206, 69,136, 74,198,198, 70,132, 94,145,132, 42,181, 4,139,248,128, -202, 93,245,212, 7,126,236,149,183,115,113,242, 0,175,248,133, 79,240,186, 79,190,129,159,125,219, 27,233,246,206, 19, 38,251, - 82, 21,135,110,213,225,165, 40,111, 87,202,187,100,146,147, 64,148,176,132,161, 68,208,217, 47,171, 75,146, 46,228,165, 93, 76, -112,251,215,232,230,145,217,214,115,232,250, 39,168,170, 72,207, 6, 76,207, 98,122, 21,197,176, 71,209, 95, 67,105,195,214, 45, -119,242,167,191,244,179,124,231,235,126,158, 27, 20, 60, 61,119,231, 75,182,180,213,154,153,243, 96, 13,127,246,214, 95,225,174, -175,252, 6,230,243,134,219,111,120, 42,119, 12, 45,163,141, 53, 6,167,206, 80,221,251, 42, 14, 62,248,167,178,119, 76, 9,240, -226,137, 95, 74,219, 67,144, 75, 59, 11,160,150, 30,109,117, 29, 31, 62,118,110,165,204, 17, 6,121, 92,137,167,142, 6,246,114, -241,172,118, 1, 25,154,178, 12,149, 17, 4,150,149,174, 61, 7,202, 28,252,237, 31,115,236,107, 95, 77,219, 77,100,197, 99,123, -114, 80, 21,213, 81,142,246,210, 40,166, 88,121,179,117, 81,146, 92,139, 86, 22,159,139,249,235,139,170,172,199,147,189,127,235, - 80,218, 16,150,151, 74,240,171,164, 53,239,226, 42,117,204,183,173,168,172,151, 57,232, 25, 22, 19,124,148,137, 75, 4,159,109, -115,174,115,116,203,169, 72,136,244,135, 61,193,148,146, 80, 73,225,210,209, 92, 89,101,165,184,107, 58,180, 45, 72,218,137,184, - 16,157, 51,189, 5,133, 26,131, 76, 4,180,206, 78, 5, 39, 40, 46,231,164, 80,201,209,234, 2,112,210, 26,223,133,124,231,138, -248,217,119, 29,198, 24,137,130,141,200,222,190,147,201,108, 92,238,194,163, 4, 38,129,202,180,168,252, 31, 93,200, 5,191,140, - 36, 43,147,116,233,174,203, 42,120,225,146,154,194, 18, 0,211, 54,164,206,211,214,139, 76, 15,204, 47,185,235,136,243,185,232, - 67, 26, 71, 84, 26,213,151,209,191, 41, 45, 38, 67,134,150, 16, 33, 41,186,141, 56, 35,140, 69,100,232, 58,139, 90,245,106, 6, - 46,107, 34,105,109, 5,197,155,137,136, 41, 55,130, 90,166, 25,248,128,118, 14, 63, 95, 80, 84, 3,152, 78, 81,235,199, 72, 46, - 48,189,114,137, 63,254,162,151,240,141, 47,122, 57, 47,122,201,171,120,231, 59,222,140, 50, 73,198,231, 49,235, 3,151,231,149, - 6, 79, 92, 45, 2, 72, 9,215,201, 14, 59,184, 92,112,101, 11,191, 79,162, 94, 79, 62, 72, 83,230, 19, 70, 65, 71, 18, 34,102, -130,218, 10, 92,139, 66, 46,114,169, 83,146,200, 25,114,186,173, 86,208, 6,217,128,196, 8,195, 99, 27,188,232, 69, 95, 70,175, - 55, 98,127,111,202,123,222,251,126,174,238,236,211,249, 37, 95, 39, 81, 88,176,201, 68,116,138, 68,165,240, 33, 50,153, 29,240, - 21, 47,255, 50, 94,246, 93,223,197,199, 62,240, 97,222,252,182,191,224,159,127,213, 23,243,254, 7,175,241,148, 81, 69, 10,142, -201,228,144,187,182, 55,232,247,122,204,139, 1,183,109,173,241,193,251, 31,225,177,157, 57, 87,175,237, 50, 64, 51, 44, 45,187, - 77, 71,101, 44,231,167, 13,107,253, 1, 90,193,237,163, 62, 13,137, 46, 42,214, 43,203,133, 69, 32,162,184,231,212, 56,251, 12, -101, 76,165, 59, 79,161, 10,214, 74, 37,135, 35, 98,210,143,161,203,122, 22,137,145, 52, 10,214, 70, 27,153,165,236,196,119,107, - 37,176,194, 53,115,138,106, 64,115,120, 64, 97, 53,182, 88,195,165,200,228,218, 46,131,181, 10,173, 43,218,217, 33,190,107, 40, -122, 11,122, 27, 55, 66,236,216, 61,255, 4, 39,110, 57,131,107, 21,182, 63,160,185,224,136,199, 61, 41, 53, 4,215, 49, 28,143, - 88,204,118, 40, 71, 96, 88,142,167, 42, 18,158,182, 62,100,109,125, 27, 55, 23,133,114,136,157,164,196, 21, 21,190,107,233, 13, -123, 76, 39,251,180,179,203, 4,223,209,236,206, 48,131, 25, 93,221, 39,118, 9, 51, 40,232,143,142, 83, 31, 54,244,251,155,130, -153, 61,181, 65,125, 8,235,219, 91,212, 51,133,119,115, 10, 61,198, 84, 2, 85, 89, 59, 81, 65,186,139, 20, 44,135,251,143,177, -127,249, 56, 55,204,159,129,210,154,201,229, 11, 12, 55, 55,136,193,179,251,249, 71, 25,159,216,198,148, 37,213,112,157,216,212, - 25,167,217,195, 53,135, 25,166,161,120,231,239,255,199,108, 99,146,247,219, 42,233,162,223,254,190,191,225, 79,254,234,111,120, -222,217,219,121,233, 51,111,199,246, 6,212, 68,238,159,194,241,129,216,213,186, 92,193, 58, 17,134,174,226, 1,181,150,247,115, -217,204,121,192, 56,249,179,167, 53,116, 1, 10,147,248,244,125,142, 50, 57,150, 92, 5,179,196, 44,102,219,244,161,135,118,149, - 34, 39,126, 78,159, 96,221,192,197, 3,199,222,147,231,137,186, 79,113,242, 6,226,238, 46,170, 40, 73, 59,123,248,195, 41,102, -109,176,186,172,196,150,155,208, 70, 68, 89, 97, 49,149,201,203,180, 67,147,184, 54,233,248,213,111,127, 58,225,119, 63,203,207, -191,247, 60,175,124,203,239,241,194, 23, 61,155,182,203, 28,241, 37,105,203,103,140,106, 12, 43, 75,210, 23,192, 47, 84, 30,249, -106, 39,187, 74, 23, 72,218,225,166, 51, 38, 15, 61, 65,119,211, 75,224,212, 29, 20, 69, 98, 80, 68, 76,105,209,101,137,233,247, - 40,122, 21, 49, 70,198,219,167,217, 61,119,142,179,189, 83,204,125,228,108,207,224, 67,202, 23,122,202, 81,216,134,115,181,227, -167,191,239,155,248,134, 31,252,126,162,170,152,238,239,163, 85,193,253,143, 63,200,135,191,227,203, 41,110, 56,197,240,230, 59, - 8, 69,155,249,239, 57,184, 36, 42,146,142,162, 28, 86,228, 68, 55,241,178, 11, 54, 54,174, 70,199,132,144,243,215, 83,254,251, - 75, 82, 86, 14, 33,201, 49,172,202,232,163, 61, 55, 2, 7, 81,198,172, 60,197,171,221,105,148, 85,132,178,226,152,168, 31,189, - 15,211,235, 19,163, 35, 58, 81,124, 75,176,141,116,244, 41,127,142, 16, 3,189,178, 66, 27, 67,138,126, 5,191,137,161,147,137, -157,174,100,207,163, 88, 37,175, 97, 12,100,132,108, 74, 33,187, 0, 34,193,137,184,204,119, 14,231, 28, 42, 36, 65,179,250,144, - 83,225,178,166, 24,129,232,196,184,188,188, 29,193,121,218,214, 81,183,173,212, 71, 70, 81, 20, 21,174,109,196, 49,160, 20, 42, - 28,217,241,162, 15, 43,111,121, 74,178,223, 47, 85, 73,138,162,248, 38, 38, 66,134,172, 68, 31, 49,133,145,157,238, 42,156, 37, - 16, 67,162, 91, 68,180, 21,143,179,242, 6,111, 20, 42, 72,254,186,139, 17, 91,150,132,228,192,151, 24,165, 81, 4,146,235, 8, -109, 67,232,186, 12,170,202, 98,179,234,127, 82,143,229,248,213, 60, 69,233,156, 8,224,180,206,203, 99, 25,115,211, 54,164,197, - 2, 83, 86, 96, 10, 82, 76,216,144, 48, 74, 2,123, 34,129,160, 13,244,251, 40,239,177, 77, 77,152, 76, 9, 87, 61, 29,138, 88, - 22,164,178,196,150, 21,182, 95, 97,123, 37,198, 90, 84,217,195, 68, 35,110, 7, 83,162,146, 71,121, 45,110,137,148, 25,247, 25, -250, 67, 92,226,143,211,106, 93, 36, 29,114, 66,235,128,194,146,122, 67,252,162,166,218, 30,128, 46,121,232,103,127,138,183,254, -250,155,184,122,113,151,111,184,249, 86, 70,223,245,109,124,221, 11,238,229,221,127,254,219, 36,163,104, 73, 36,189,156, 80,201, -247,217, 57,209,118,173, 88, 4,203,181, 96, 56, 2,214,233, 32,118,253,180, 28, 86,229, 70, 57, 88, 37,143, 45, 69, 92, 86,152, -248, 0, 61, 3, 86,201, 95,107, 19, 69,139,152,207, 57, 67,134,219, 24, 8,121,210,249,178,151,189,140,247,191,255, 67, 60,254, -196, 21,182,143,159,228,203,190,252,101,252,254, 31,254, 73,174, 57,197,223,238, 28,216, 36, 95, 85, 20,158,104,225,224,224, 50, -167,191,246, 89,216, 59,239,229,159,124,201,151,114,230,150, 51,196,249, 21, 62,250, 15,127, 66,213, 27,242,119,251, 29,255,242, -107,254, 9, 55,156,190,129, 63,251,179, 63,227,217,219, 3,174, 78,230,212, 74,243,190, 55,190,150,250,218, 46,151, 47,239,241, -246,191,251, 60,159,185,176,195,194, 59,122,166,224,179,151,174, 97,148,226,161, 73, 45, 7,170, 46, 56,232, 34,195, 66, 99,147, -226,169, 39, 55, 37, 97, 41,163, 42,181, 49,104,149, 80,169, 16, 63,102, 10,171, 17,148, 85, 70, 94,246, 38,210, 55, 6,213,213, -168,245, 99,162,196,238, 90,140,173,114,130,146, 34,116, 13, 40, 75,209,215,180,179,134,197,162,145, 3,217, 84, 20, 85, 73, 59, - 59,160, 90, 59, 65, 61,189,132,102,132,174, 20,163, 19,103, 56,220,185, 70,181,118, 12,215,204, 24,172,143,233, 22, 83, 22,211, - 67,170,193, 6,221, 98, 66, 89, 13, 80, 33,161,171, 42,115,160, 61, 93,221,178,216, 63, 96,122,237, 60, 91, 55, 62,133,182,174, -133, 20, 85, 40,138, 94, 65,219, 30, 82, 13,183,105,102,123,160, 10,124,104, 41,215,199,212,139, 43,244, 21,180,173, 33,249,125, -240, 70,176,173,229,154,252,178,140,165,232,105,130,131,195,189, 75, 12,215,101, 23,218, 53, 10, 83,204,233,154, 14,165, 46,210, -227, 12,183, 60,243, 43,184,241,158,231, 48,185,114,137,241,182, 80,239, 54,111, 60,195,149, 71, 31, 97,227,198, 51,116,243,154, -201,229, 39,216,190,243, 25, 52,211, 67,122,235,235, 56, 87, 75,199,101, 75,234,249,132,233,206,149,163, 61,104, 92, 2,164,196, -158,166,108,226, 83,143,124,158, 7, 31,126,156,161, 86,156, 80,134, 31,122, 97,143,104, 20,141, 78,236,167, 72, 71,100, 22, 3, -139, 32,158,221,140,218,167,237,178,235, 40,192,225, 34,143,174,144,151, 97,238,229,127, 15, 73, 46,237, 37,148, 43,223,151, 84, - 89,168,162,145, 51,104, 92,193, 86,161,120,229, 77,125,238, 94, 47,248,131, 7, 38, 52, 30,126,227,119, 63,200,191,249,225,111, -100,182, 31, 49,253, 57, 74, 73,152,177,202,241,161,171, 3, 53, 95,184,170, 40, 73,205, 76,186,183,126, 73, 58,104, 72,117,141, - 93, 27,114,101,222,241,203,223,122,150,111,190,239, 26, 63,254,107,239,227,253, 95,249, 60,194,242,128,117,121,156,188, 28, 11, -166, 40, 29, 97,182, 10,165,156, 58,162,146, 65,245, 42,180, 54,184,174,101,241,196,121, 14, 30,190, 76,216,190,151,242,185,175, -161,234,201,238, 80, 85, 22, 91,150,216,170,192, 84, 21,201,104, 76,191,199,241, 27,110,229, 71, 94,245,106,222,242,151, 31,227, -169,149,102,164, 53, 77, 76,121, 92,155, 24, 88,195,197,133,227,236,233,117,254,159,119,254, 10,131,237, 27,104,234, 64, 57,176, -184,121, 75, 61,155,243,185,159,251, 65,238,252,146,187,216,124,198,179, 96,124, 12, 93,174, 73,199,156, 34,113,233,231, 77,234, -200,135,189,180,163, 5,143, 41,138, 47, 28,155, 39,241,160, 47, 3, 90, 84, 86, 26,171, 44,214, 90, 66,173, 69, 5, 31, 80,166, - 88,121,130, 99,184,142, 50,151,228,187, 21, 99, 64, 23,178,191, 47, 54,143,115,227,247,254, 50,232, 5,101, 81, 10,251, 60,249, -213, 76, 53, 52,221,170,104,146, 67, 76,203, 20, 99, 25, 27, 27,211,170,107, 75,153, 21,158, 50, 1, 47,154, 4,222,203, 74,108, -117, 65,166,140, 79, 13,116,117,141,111, 61,222, 7,105, 28,242,222, 60, 44, 3, 88,178, 16, 68, 58,244,220,169,119,145,206,121, -234,133, 88, 14,101, 71,107,133,206,168,197,235,174,180,132,229, 68,231,240, 33, 98,141,166,109, 90,116, 97, 81, 49, 95, 80,249, - 29, 95, 18,197, 36, 34, 85,138,137,164, 10, 33, 98,102,214,168, 50,134, 24, 60, 46, 70,138, 21, 78, 76,173,214, 34,166,144,177, -187,107, 26,138,170, 71, 55,159,162, 80, 24,163, 9, 41,137,146,190,169, 69, 85,190, 76,130,139,233,186,125,186, 17, 53,234,178, - 28,211, 26,218, 57, 76,229,204, 18, 75,138,207,106,215, 72,152, 79,161,109,193,181,164,166, 65,181, 29,152, 66,242, 68,208,216, -232, 72,166,192,143, 70,196,162,148, 64,153,224, 73,179,133, 64,155, 22, 29,126,127, 66,173,243, 37, 61, 24,208,219, 28, 83,172, - 13,209, 69,129, 49, 45,202, 24,180, 41,208, 70,173,138,196,184,154, 55,155, 92,164, 41, 17, 34,166,152,233,196,145,160, 44, 41, -104,134,235,219,232, 96,248,157,111,253, 38, 62,252,222,191, 99, 13,248,138,187,206,114, 60,174,241, 69,111,253, 35,210,179,239, - 97,216,214, 98, 25,204,209,183, 90,169,108, 75,204, 25,232,185,120,142, 57,183, 92, 37,145, 21, 56,249,113,133,250, 22, 33,120, -133, 45,142, 26, 34, 49,131,136,119, 61,230, 21,129,206,246, 51,140, 88,179, 75, 43, 96, 27, 33,199,165,163,102, 70, 29, 5,222, -185, 32,127,246,197, 75, 87, 72, 17,158,188,112,133,103,229, 33, 74, 74, 73,164, 10,121,227, 99,147,142,132, 20,137, 42, 72, 58, - 19, 29,189,211,219,116,215, 30,228,221, 63,240, 99,252,252,135, 46,112,239,153, 17,159,217,217,231,238,219,206, 16,234,154,183, -254,249,187,121,124,214,240,162, 91, 78,241,161,139,123,188,228,158, 91,249,251,191,125, 35,204, 12,255,225,229,223,201,133,197, -130, 59, 54, 45,111,120,243,191,227, 53, 63,252,171, 60,112,121, 23,109, 20,133,181,172, 15, 44, 79, 89,239,241,228, 76, 8, 72, - 73,105,110, 88,235,113,156, 5,198, 90,146, 15,185, 58,149,151,202, 42, 45, 72, 73,159,178, 93, 86,163,162,198, 36, 24,235,130, - 16, 3,139,195,150,225,150, 35,184, 22,223, 74,249,228, 59,135,177,138,102, 94,227,125, 64,227,104,155,134,230,112, 23,101,123, -236, 92, 60,199,104,243,180,136, 93,154, 22, 87, 55,172,159,188,137,217,222,101,170,209, 58,138, 77, 57, 39,186, 6,223, 52,152, -162,164,155, 7,186,250, 73,122,107,219, 44,230, 59,162,206, 77,138,122, 58,165, 26,110,176,152, 28, 50, 58,121,140,217,222,144, -118, 49,165,107, 29, 73,245,240,147, 93, 52, 21, 36, 77,215,206,115,212,165, 37, 56,135, 46, 75, 74,182,232,247,251,236,236,205, -232,173, 53,116, 11, 7,122,129,155,174, 49,157, 94,101, 48, 26,176, 12,192,114, 78,209,214,115, 48, 21, 85, 15,246,175,236, 80, - 13, 43,122,189,147,140,142,157,194, 86, 5, 87, 30,252, 12, 39,239,184,139,201,165,243,108,220,120, 59,211,189, 61,241,245, 86, -125,174, 62,242, 16, 55,222,117, 55,237, 98, 38,251, 70, 52,174,107, 40,171, 18, 21, 11, 30,252,200,187, 48, 73, 98, 33, 67, 16, - 81, 72, 81, 66,211, 66, 53, 40,242, 78,207, 75, 42, 80, 82,116, 86,236, 23, 78,139,206, 33, 22,203, 98, 64, 99,109,148,253,210, - 64, 58,177,141,101,194,167,130, 27,147,188, 12,202,202, 11, 84, 26,197,230, 64, 51,180,208,175, 44, 93,128,221, 93,216,191, 22, - 49, 13,168, 38, 49, 46, 52,183, 12, 13,199,140, 97,168, 13,184,132,137,154,217,172,225,161, 26,134, 61,248,253,247,125,158, 31, -125,157, 96, 56,237,218, 8,124, 45,213,191,206,151,142,213,168,100, 64, 39,204,218, 6, 74, 57,226,116, 15, 93,245,100,100,187, - 21, 8,243,134,164, 91,236,176,207,238,180,229,238, 59,182,248,191, 79, 15,105,166, 11, 33,143, 45, 41, 15, 41, 43,155,147, 36, - 52, 97, 75,138,181, 30, 54, 57,156,247, 68, 52,126, 86,179,120,244, 28,147, 7,158,100,113,165, 99,252, 53,223, 72,245,202, 87, - 99,122, 5,170,153, 67, 81, 97,109, 15, 59,232,163, 11,141,178, 37, 49, 58, 78,221,254, 52,222,245, 91,191,205,107,126,248, 23, -216, 2,158, 86, 25, 17,193, 93, 7,203,232, 92,224, 92,231,248,173, 95,124, 29,247,126,229, 87, 51,157, 76,241,109,196,148, 61, -230,151,174,225, 98,197,231,127,230,187, 57,245,212, 77,142,221,253,116,198,103,239,149,168,226,202,162,139,190,216,210, 98,166, -192,173,132,112,153, 34, 23, 36, 47, 93,112,164, 2,244, 80,198,172,172, 69,203,165, 94, 34,137,102,195, 7, 86,224, 46,147, 35, - 92,149,149,130, 96, 5,244, 90,242,224,229,119, 78,206,119, 79, 49, 81,108,157,226,204, 15,252, 90, 86, 51,107, 76, 89,226,155, - 6, 59, 20,168,148,171,231,194, 44, 88,170,160,179, 96,207,150,229, 81,135,238,221,106,164,156,150, 45, 84, 74, 25, 20,179, 12, - 13, 11,226, 88,200,121,241,193,119, 66,157, 11, 65,108,107,221, 50, 16, 4, 82,116,130,115, 77,113,101,149,138, 49, 18,157,199, -123, 79,231, 3,157,243,180,117,135,143, 17,163, 21, 49, 37,140, 18,107,146,111,192, 90, 47,170, 4, 45, 68,204,174,113,226,234, - 89, 52, 34,158, 51,134, 24,193,150, 89,117,191,244,250, 7,233, 12, 77,144,201, 64,200, 2, 97, 99,132,147,230, 91,135,107,161, -176, 90,212,218, 57, 98, 85,119,134, 94,191,135, 55, 6, 82, 67,212, 26,187,244,207, 71, 97,215,119,139, 5,201,187, 37,239, 49, - 63, 78,125,116,137,131, 48,219,149,146, 11,126,178, 79,247,248, 57,166,151,206, 83, 55, 45,214,121,236,104, 3,115,234, 4,101, -191,135, 73, 90, 68,162, 57, 89,110,153,236,167, 18,232,164, 73,190,197,186, 78, 98, 70,109, 73,212,150,116,172, 34,166, 45,146, - 18,173, 66,108, 29,113, 94,211,237,238, 50,123,242, 34,206, 90,138,181, 49,229,177,177,252,247,160, 39, 73,115, 89, 7,162,146, -146,174,216,213, 25,150,164, 86,142,131,232, 35,110,209, 48, 88, 63,206,252,202, 5,222,251,203,191,193,223,124,228, 83,244,123, - 21,235, 91, 99,158, 59,222,100,115, 50,231,139,239,251, 8,234,216, 9, 73,221, 28,172, 97,171, 33, 93, 59,147,120,243,188, 29, -146,239,106,202,180,193, 28, 10,148, 95,127,114,232,161,134, 21, 74, 86,235,165, 2, 94, 6, 30,254,186,108, 10,157,192, 37,176, - 36,140,149,144,150, 66, 73,161, 98,205, 17,201, 54,100, 64, 95,206, 28, 90, 58, 45, 9, 17,182, 54, 79,241,248,227,151,217, 58, -113,138,214, 41, 58,119, 20,115,189, 12,213,179, 62, 70,146,246, 96, 19, 85, 63, 81, 86, 17,223,238,241, 59,223,244, 61,188,255, -252,156, 31,255, 15,175,193, 63,246, 48,111,254,220,123, 72,159,127, 18, 83, 22,124,237,179,239,228,171,191,237, 95,242,187,191, -246, 95, 57,115,106,196,235,255,224,167,104,222,246, 39,244,158,250, 84,110,191, 97,204,167, 31,238,232, 79, 34,255,226,219,126, -130, 63,124,203, 79,240,211,175,127, 11,151,103, 53, 23,230,158,133,247,124,114,183,225,120,223, 48, 50,129,203, 77,228,204,200, - 18,201, 47,158, 18,178, 89, 82, 96,242, 24, 48, 38,181,138,106, 68, 75,103,223,211,134, 53,173,105, 85,129,217,216, 34,117, 13, -244, 6, 88,171,105,235, 5,190,105, 40, 7,107,212,251,251, 12,198, 35, 22, 51, 71, 53,232,211, 45, 10, 66,138,180,211,142,237, - 27, 75,234,137, 33, 41, 1, 51, 40, 18,139,201, 30,229,112, 76, 8,130,186,117, 93,141,247, 30,181, 56,164, 28, 85, 68, 87, 49, -157,237, 81, 31, 28, 80, 86, 3,186, 46, 80,148,134,197,100, 31, 76,160, 62, 92,208, 46, 38, 24, 51,144,139, 37, 41,130, 11,148, -131,200,147, 15, 92,101,243,244, 62,221,162,199,249,207,221,207,217, 47,125, 58,245,161, 66,235, 5,109,125,156,182,222, 99,235, -228, 41,186, 54, 81,216, 17,135,135,251,244,134,107, 76,247, 15, 24,172,175, 51,221,219,197,104,159,227,137, 59,166, 87, 14,233, -141, 71,162,214, 44, 26,124, 91,211,214, 51,138,162,135,169, 74,138, 97, 31,239, 28,135, 23, 47,209, 95, 31,115,225,254, 79,115, -211, 51,158,197,124,111,159, 16, 29,163,227,167,240, 93, 45, 47, 68, 2, 85, 68,222,251,155, 63,190, 74, 88, 36,219, 82, 9,160, - 10,205,250,120,141,255,159,172, 55, 15,151,244, 44,235,252, 63,207,242, 46,181,156,125,233,211, 75,122,205, 74, 2, 89, 32, 11, - 19, 89, 4, 2,200, 14, 6, 84, 24, 64, 68, 81,208,203,153,193,223,184, 33, 63,103,126, 14,200,140, 58, 8, 81,217,100, 80, 81, - 35, 75, 36, 64, 68, 4, 5, 66, 8, 97,201,190,118,200,210,123,247, 57,125,182,170, 58, 85,245,110,207, 50,127, 60,111,213, 9, -254,114, 93,157, 43, 87,119,231,116,159,170,183,158,251,185,239,251,251,253,124,165,140, 89, 62,181, 18,148,154,202,147,201,144, - 9,110,113, 56, 37, 40,156,195,214,191, 22,177, 45,234,168,181, 80, 40, 81,127, 88,100,120,224,149, 9,187, 37, 45, 37, 54, 3, -213,144, 52, 83,193,220,130,102,247,146, 32,201, 5,233, 38,200,174, 68,230, 14, 10,129, 47,125,192, 34,250, 48,213,185,119, 37, - 99,163, 78,195,236, 20,158,211, 71, 79,133,148,188, 56,136,123,100,154, 34, 34,129,168,131, 63,132, 10,140,112, 41, 4, 85,103, - 29,226, 56,196, 85, 70, 42,216, 80, 26,113, 24,121,214, 33,206,195, 97, 73,185, 58,160,115, 98, 5, 85, 11,225,108,105,160,178, -184, 42, 99,106,162,201, 48, 47, 88, 91, 91,230,240,145, 77, 30,127,108,141,231, 94,124, 14,246,196, 89, 84,220, 68,159,115,144, -214,107,174,103,114,118, 1, 95, 12, 16,174, 10, 84,188,201, 38, 58,137,145,113,176,221, 89, 83, 50,189,184,192,218,137,227, 92, -189,247, 42, 78,117,135, 28, 72, 67, 49,183,126,164,213,135, 88, 73,150, 51,195,235,159,127, 25,191,253,193,255, 65,158,103,116, - 55,214,209,209, 4,118,152,145,117, 12,118,237, 4, 39, 63,254,223, 88,188,244, 92, 22, 47,191,136,169,139,175,132,214, 84, 29, - 19,101, 17, 73, 3,151, 13, 65,171, 49, 40,198,139, 81,118,123,120,131, 36,174,238,216,235,168, 85,191,141,220, 28,199,125, 2, - 66,132,130, 62, 82,188,203, 58, 3, 94, 72, 25, 28, 6,245, 74,205,213, 82,221, 16, 28, 82, 67, 87,240, 8,161,217,243,174, 15, -214, 5, 45, 3, 36,209,196, 28,101,119, 13, 95,133,144,234,192,235, 49, 99,123, 85, 32,189, 17, 8,125, 74, 80,244,138,186,179, -241,200, 36,170, 71,231,182,158, 50,200, 26,158, 19,196,157, 40,112,121,129, 19,190,238,238, 60,101, 81, 98, 42, 75, 81, 4,231, -142,113,102, 76,219, 51, 85, 21,158, 89, 19,128, 52,101, 21, 70,243,101, 89,146, 15,203, 96, 7,118,225, 34,228,188,163,212,160, -173,166,114, 5,206, 70, 53,222, 84,224,235, 86,170,170, 42,132, 11, 29,178,146, 9, 85,150, 35, 76, 84, 31,240, 2, 99,220, 24, - 0,100,172, 12, 64, 22, 25, 32, 59, 69, 30, 46, 25, 35, 1,160,209,245,254,121,164,222, 18, 6,169, 68,189,246, 9, 69, 95, 37, - 1,161,173,176, 88,235, 41,250,125, 76, 89,133,247,218,243, 20,209,153,216, 22,188,200, 8,134, 67,232,172, 51,188,255, 65, 86, - 79,157,193, 61,121,138,185,211, 43, 40, 1,214, 58, 76,102,232,165,154, 98,207, 14,212, 69,135,136,102, 38, 81, 58, 13,140,119, - 31,154,177,112, 7,115,248, 42, 68,170,142,232,148,194,107,164, 16, 40,165,176,194,227,227, 20,215,106, 18,205,205,144, 14,135, -216,193, 22,102,189,139, 57,186, 73,134,100,144, 36,200, 86, 3,217,108, 35, 35,137, 18,186, 22,208,185,122,226, 98,113,149,165, -202,250,180,167, 23,168, 10,199,223,190,231,131,108,148,150,168,221, 96,106,102, 18, 45, 4,251,178,130,243,175,216,199,229, 95, -255,215, 31, 35,203, 5,244,112,140,207,125, 88, 23,214, 91,213,194,109,127, 6,172, 15,170,248, 17, 60, 73, 70, 96, 75,129, 80, -225, 91, 21, 62,116,211, 74,249,113,241, 31,193,249, 70, 49,194,210,213, 72,132,154,140, 89,179,145,208,163,140,164,167,196,210, -139, 64,153,174, 47,150,240,205,111,124,147,171,174,126, 30,215, 92, 59,193,202,234, 22, 95,253,151,127,163, 54, 67,132,188, 1, - 73,157,147, 34, 9,132, 28, 25, 20, 1,165,235, 35, 15, 92,197, 47,221,113, 43,191,212,156,133,193, 38,203,159,254, 24, 55,182, -103,184,251,193, 39, 40, 17, 60,176,178,193,167, 62,244, 33,190,246,240, 49, 58, 63,248, 33,229,189,247,242,127,222,250, 97,222, -245,195, 63,195,148, 37,151, 46, 77,242,130,171,207,103,198, 87,236,127,237,123,121,227,185, 75, 28, 27,150, 44, 15, 13,150, 64, -208, 42,135, 33,177,248, 96,203,115,193,124, 28, 44, 4,210,133,221,220, 72, 13, 90,119,118,193, 18, 18,198, 23, 35, 33,142,170, -133, 65, 73,229, 73, 35,143, 74, 91,193, 75, 74, 16, 37,108,156, 93,101,254,156, 24, 21,199,168, 36,166, 92, 41,208, 73,201,160, -159, 33,133,169,125,157, 37, 85,222, 71,197, 41, 81, 58, 69,145, 15, 49,182,196,150,134,170,200, 16, 50,193, 20, 97, 37, 80, 22, - 25, 74,165,193,206,146, 91,108,229,217, 56,251, 56, 58,158,199,155, 38,131,172,143,116,142,210,228, 33,199,184, 40, 25,244,115, -162, 72, 6,136,194, 80,176,116,238,110, 78, 63,121,140,197, 61, 19, 68,147,243, 20,195, 2,103, 42, 84, 67,209, 57,187, 74,119, -107,133, 5,183,155,205,149, 83,204,238,156, 99,171,179,137,181,146, 40,106,210, 89, 89, 33,106, 53,217,216, 56,205,252,210, 34, -174, 28, 34, 27, 45, 42,171,241,110,200,116,123, 31,113, 99, 18, 91, 22, 28,186,230, 57, 12, 55, 58,180,231, 23,176, 69,142, 78, - 19, 78,222,127, 23,207,120,249,171, 57,122,247, 93,180,102, 23,104, 78,205,145,247,123, 68, 73, 74,210,108, 81,149, 67, 86,238, -191,141, 97,119, 53,216, 71,159,178, 23, 50, 2, 76,225,232,103, 37,121,209, 15, 5,189,222,107, 27, 5,165, 11, 1, 16, 78,134, -253,150,169, 25,224, 94,212,174,169, 90,248, 49,202, 83,240,245,120,105, 44,172, 37, 8,172, 34, 5,202, 10,180, 3,170,160,226, - 20, 69, 48,187,139,202, 67, 37, 67,168,130, 23,193, 62, 98, 61,145, 22, 60, 81, 4, 36,177, 7, 14, 76,194, 39, 62,242, 53,126, -243,189,215,147, 13, 11,164, 20,136,246, 4, 58, 78,145,177, 10,157,170, 10, 69,198, 87, 67, 84, 20,141,255, 82, 94,133,206, 82, -170, 8,175, 4,102, 80,160, 82, 73,154, 38,188,255,107,199,153,122,228, 70, 62,240, 39,111,101,227,196, 25,204, 48, 99,216, 27, -146, 31, 95,231,170,191,121,128,173,194, 97,129, 6,208, 16,240,254,111,159,230,142, 47,254, 37, 34,109,133, 61, 67, 57,132,162, - 31, 24,238,113, 19, 17,107,116, 18,132, 65, 72,129, 78, 99, 38, 91,179,252,214,127,124, 39,127,251,205,251, 56,144, 72,118,199, -146,202,109,119,231,137, 86,172, 14, 43, 14, 44, 78,240, 55,159,253, 0,243, 7, 14,210, 61,187,130,119, 18, 73, 68,222,219,160, -176, 9,254, 7,159, 99,227,123,255,198,222,231, 94,202,228,185,251,153,186,248, 42,226,165,131, 97,132,172, 19, 16, 26, 61, 53, -139,235,173, 5,126,122, 18,215, 32, 16, 89, 11, 89,195,251, 22, 52,113, 46,140, 61,125,200,176, 30, 3,158,172, 29,103,128, 59, -231,145, 66,134,203,210,152,199, 29, 18,231,194, 30,221,214, 2,183,250,107, 58, 17,196, 95, 56,132,208,232,169, 57,100,156,224, -124, 86, 79,231,131,205, 48,154,156, 9,248, 87, 99,198,106,100,129,168,195, 0, 66, 1, 10,214,174, 36,168,204,139, 2,103,171, -177,242,222,215, 5, 37,164,166,249,177,186, 90, 18,194,176,205,112, 48,158,212, 89,239,169, 76,133,171, 92,216,231, 11, 63, 78, - 37,179,198,140, 17,198,210, 4, 2, 89,101, 45, 85,229,200,141,197, 24,131,183, 97, 87,158,120, 48,133,165,148, 5, 90,171,218, -130, 23,236, 86, 78,202, 64,175, 27,137,168,180,164, 26, 14,131,104,111,152, 99,149, 66, 72, 73, 85, 22, 8, 20, 74,171, 90, 8, - 88, 39,231,213,175, 97,150,149,196,177,198,214, 40, 94, 87,154, 58,230,222,162, 84, 68,145, 21, 97, 43,235, 29,210,106, 84,172, -235,244, 65,133,208,150, 34, 11,224, 28,111, 70,176, 32,247,227,196,215,209,127, 8,139, 61,115,150,254,177, 83,200,147,107,204, - 31, 63,133,137, 99,156,210,200, 72,224,253,144,238,242, 6,233,242, 58,199,190,120, 59,170,149,144,156,179,200,196,213, 79, 39, -221,191, 7, 45, 53,178,149,128,147,168, 56,208, 84,162, 58, 69, 77,200,209,123,169, 81,222, 97,172,195,101, 67,188, 83,200,137, - 73,104, 54,145, 83,179,196,166, 66, 84, 5, 62,203,177,121,133,233,108,226,133,164, 82, 1, 42, 35,149, 70,214,173,106, 36, 52, -135, 94,248, 90,238,248,171,191,225,139, 55,255, 51,211,115, 83,161,118, 32,152, 72, 52, 7, 87,183,120,254, 95,223,192,206, 55, -253, 2,166, 24,160,147,214,118,184, 75,157,248, 87,217, 90,109, 62,178,231,121, 80,113,184, 80,151,101, 24,163,123, 81,175,142, - 70,238, 63, 31,246,235, 82, 5, 55,143,123,138,103,156,209, 61,201,135, 72,242,168, 30,175,187,250,210, 32,106,181,122, 28, 5, -202,166, 29, 9,243, 2, 48, 51,100,226,136, 48, 41,125,233, 79, 94,199,189,247, 61,198, 93,247, 63, 66,183,155, 81, 84,126,220, - 52,249,122, 50,160,195, 48,114,244, 97, 11,190, 60, 39, 45, 85, 17,225, 87,110,231,230,235,223,205,233, 77, 71,191, 91,240,160, -143,184,242,242,115, 57,118,116,149,153, 86,202, 75, 47, 63,151, 63,248,237,183, 35,146,103, 16, 79,157,230,170, 95,189, 30, 35, -230,185,232,130, 57, 86,238,239,240, 11, 55,124,153, 43,118,205,240,156,189, 51,244,171,138,103,238,221,197,151, 30, 57,198,158, -137, 6, 8,199,122, 22, 70,164,147,113,196,190, 25,129, 19, 1, 27, 43,189, 15,209,155, 85, 61,230, 27,169,101, 17, 4, 40, 80, - 1,117, 30,173,112, 2,227,193, 12,135,248,214, 84, 96,112, 59,135,138, 27,236,186,224, 2, 60, 6,123,118,149, 98,160,177,222, - 82,244, 11,116,172, 41,122, 3,138, 34, 11,240,152, 50,167, 17, 55, 48,213,144,200, 37,244, 59, 61, 38, 23, 11,170,178, 36,157, -104, 0, 2,157,104,140, 13,170,213, 50, 43,104,180, 35,112, 83,160,166,177, 85,143,220,135, 55,182,200, 60,198,244,208,113, 3, -235, 37,141,118,194,230,250, 58,173,201, 54, 38,119,152,108,131,169,169, 25,178,173, 45,166,231, 38, 49, 53,196, 64, 71, 19,120, -239,104,166, 83, 84, 89,142,138, 91, 60,116,251, 93,236,187,228, 0,166, 42,112, 46,194, 11,141,201, 50,180, 74,233,111,230, 12, -183, 42,162,102,198,212,236, 78, 76, 81,208, 61,123, 18, 33, 37,187,206,127, 6,131,181, 14,233,100,139,225,198, 26,121,150,147, -117,206,178,255, 89, 87,115,226,222, 7,104,159, 45, 33, 43, 0, 0, 32, 0, 73, 68, 65, 84, 78,207,225,173, 37,235,174, 17, 55, - 2,109,110,216,221,164, 61, 63,199, 23,127,251,122,172, 16, 40, 29, 14, 47,231,192,202,109,164,115,111, 56,192, 26, 72, 61, 68, -178,206, 54,175, 31, 36,175,130,194,215, 56, 31,162,139, 24, 79, 63,235, 91,234,182,162,115,228,154, 10,241,133,161, 80,107, 33, -144,149, 36,146,161,200, 75, 47,240,185, 64, 20, 2, 42, 16, 86,160,108,173,174,118,117, 68, 33,146, 97,110, 56, 89, 4, 65,201, -176,130, 70, 4, 87, 75,131,205,107, 10,154,110, 32,132, 35,217,185,132,217,234,134,238, 93,212, 73, 93,222, 35,157, 27,147,170, -198,123,240,102,132,207,115,162,201, 41,178, 78,151, 7,143,116,185,245,201, 1, 59, 5, 88, 31, 34, 59,135, 27, 61,242, 35,235, - 76,202, 24,239,225,156, 72,214,235,164,112,225,153,143, 4,215,188,250, 23,185,243,230, 63,199, 39, 41, 34, 13, 22, 34,153, 70, - 40,173,144,113, 18,220, 27,120, 22,246,236,230,139, 31,249, 56,239,124,239, 39,152,251,119,163,118, 87,239,224,140,245,172,231, -134, 63,122,239,219,121,241, 91,222,196,218,153,101,122, 43,103,177,101,176, 73,154, 34,172,137,138, 47,252, 57, 54,242, 28,124, -229,115, 72, 22,231,153,184,232, 10,226,133, 61,224, 6, 16,165, 8,149,140,119,212, 30,129, 80, 97,146, 36, 70,113,169,163,116, - 49,227,240,114, 59, 54,117, 36,201, 19,181, 28,120, 4,116, 17, 90,133, 93,117, 18,215,212, 57, 81,119,253, 34, 20, 51,251,227, - 22,164,192, 42,175,163,117, 1,169, 29,122,110, 39,225,138, 95, 23,147,202,141, 61, 58,178, 38, 32,142,232,107,222, 86, 97,138, - 32, 25, 39,155, 33, 37, 82,199, 33,244,196,213, 2, 56, 27,212,227,225, 22, 17, 58,109, 81,139,213,140,171,168,178, 33,206,187, -144,151, 46, 36,182,202,234,241,183,161, 40, 3, 72, 37,136,244, 61,198,133, 93,173,112,225,191, 77, 93,200,171,210, 4,210, 91, - 81, 5, 27,102,164,137,156,192, 82, 81, 25,144, 90,132,226, 45,101, 64,180,214,144, 30, 83,133,145,186, 40,131, 69,196,251,208, -233,171,186,168,187, 26, 56, 35, 77, 88, 61,152,202,225,109, 69, 89, 21,200,210,144,180,154,108, 13, 43, 26,205,136,170,170,106, -158,125,184,246, 24, 27, 92, 9,162,204,177, 62,162, 93,230,200, 29, 83, 53,174,216,225, 9,106,248,188,215, 27, 39,236, 61,133, -191, 90,219, 26, 69,168, 50, 3,143, 25, 12, 41,163,132,137, 39,158,160,108,164, 8, 99, 64,170, 64,212,203, 10,166,103,218, 68, - 73,194,142,115,118,163,141,199,157, 58,139,185,249, 86, 78,246,243,208, 20, 36, 17, 19,105,204,153,162,196,123,207,201, 65,201, -102, 86,144,180, 27,244,107, 0,217,228,204, 4, 59,118,206,114,241,179, 47,163, 61, 53, 73, 50,217,100,176,217, 37,154,104,225, -210, 4,145,198,136, 70, 11,105, 13,145,171,159, 45, 93,107, 61,172,199,148, 37,141,169, 69,150,158,253, 18,254,233, 55,255, 51, -199, 31, 61, 66,115,102,146,245,210, 50, 23, 41, 46,136, 27,204,167, 9, 87, 29,191, 3, 61, 61, 71,213, 91, 39,105,182,255,127, -225, 46,185,247,148,198,109,107, 5,235, 2,107, 75, 63,214, 24, 89, 87, 11,217, 70,176,195, 81,236,179, 14,143,108,157,141, 20, -146, 35,235,206,217,121, 31,196,198,245,161,167,117,189,127,175,127,159,212, 53, 30, 86, 9, 18,229, 49,110,188,165,194,141,180, - 72, 30,110,250,252, 77,236,217,119, 30, 47,125,233, 75,233,244, 10,238,186,231, 65,142, 31, 59, 94, 71, 2,215,187,122, 9, 58, - 85,226, 41,126, 98, 16,145,167,236,220,206,109,191,254, 30,118, 93,112,128,217,164,133, 50,142,143,254,253, 93,220,246,131, 39, -105, 54, 18,174,145,154,207,127,251, 65, 62,242,123,191,134,239,253,128,219,223,241, 70,214, 23, 46, 99,223, 55,254,149,171, 94, -253, 82,254,230,159,111, 96,231,204, 4, 46,109,178,187,153,208,235,111,113,108,101,141, 11, 38, 27,116,189, 8, 81,128, 90,209, -246,158,118, 20, 97, 35, 79, 89,239,175, 34,165, 81, 54,236,165,168, 71,129,158,240, 74,134,108,229,192,120, 54, 56,140,183,228, -120,242,110,151,230,228, 84, 32, 42, 9, 79,177, 57,164, 61,183,192,198,201, 99, 68,105, 19, 83,230, 40,149,112,230,232,163, 76, -207,239, 66,234, 6,237,169,148,238,250, 6, 69, 86, 18, 55, 51,138,225, 22, 73,107, 10,225, 21,121,191, 3,162,193,176,115,150, - 70,123, 17,107, 10,164, 19,108,109,174,210,154,158,101,107, 99, 3, 33, 4,189,213,101, 34,157, 32, 34, 75, 20,105,172, 16,244, -123, 67, 22,118,183, 66, 74,161,142, 80, 34,197,228, 21, 90, 89, 76, 5,241,132,198, 84, 45,100, 62, 0, 4,121,230,233,247,142, - 49, 53, 51, 79,101, 52,167,143, 61,204,228,212, 30,136,160, 40, 74,176, 49, 69,177,130, 80, 13,108,213, 71,233, 38,195,225,128, -214, 76,147, 34,107,208,223,234,113,206,193, 43, 88,220,115, 46,233, 84,155,198,212, 44,195,126,135,214,194, 2, 27,199,143,209, -158,155,167,177,255, 60, 78, 29,126,148,221, 79,187,132,206,201, 83, 52,102,102, 80, 81, 3, 99, 45,162, 16, 36,205, 6,223,253, -243,223, 66,138,186, 59, 54,163,155, 43, 99, 79,102, 88, 35, 7, 43, 97,164,160, 33, 61,137, 24,221,182, 97, 88,163, 92,188, 18, - 88,227, 17, 81,189,103,114,225, 48,147,245, 72,203,215,153,196,193,206, 28,168,112, 42, 22,196, 66, 16, 35,136,157, 64,150,160, -242,144, 30, 38, 11, 31, 14, 63, 35,106,192,195,200,162, 20,188,237,199, 54,135,156, 41,183,131, 16,230, 53,236,152, 77,120,236, -147, 95,226,252, 95,122, 5,185, 3,157, 38, 68,179, 59,194, 39, 73, 55,198,185,220,194,215, 50,253,122,180, 45,164, 67,136, 8, - 95, 25,116,156, 98, 81,180, 91, 45,126,255, 51, 63, 96,113, 2,250, 37,220,252,233, 91,121,205,219,174, 35,239,231, 52,167,154, -108, 61,112,138, 75, 38, 52,143,119, 74,148, 24,237, 47, 67, 2,221,161, 84,241,172,215,252, 42,119,221,242, 17,244,196, 4, 66, -203, 80,216,147, 24,107, 42,166,230,119,113,228,158, 59,121,241,213,175,103,179, 48, 28, 76, 85,184, 24,249,109,105, 86, 26,105, - 78, 14, 74, 94,113,245, 69,188,239, 35, 31, 32, 55, 21,107,167, 78, 99,139, 16,163,107,243,156,138, 6, 60,248, 29,186,223,253, - 23,102,159,113,136,185,243,247, 18,207,237,160,125,193,165,232,233,133,176, 63, 81, 65,201,227, 69, 18,116, 20,171, 39, 67, 26, -152, 84, 53, 66,187,142, 96, 69,213,170,237,250,134, 50,126, 14, 66, 42, 85, 0,159,212,157,150,144,245,103, 84,226, 75, 91,179, -222,109, 13,173,222,142,130, 28,217,186, 66,219, 83,107,138,189, 3, 23,196,118,122,114,110,172, 84,199, 58,168,134,148,221, 77, -156,169, 72,151,246, 4,181,118,237,217, 14, 25,218,150,198, 84,187, 22,161, 57,204,112, 11, 41, 37, 82,234, 0,209, 49, 99, 67, - 56,190,166,176,133,192,177, 80,132,109, 89, 91,246, 76, 96,243,251,170,196, 25,139, 45, 11,138, 60,216,211, 16, 1, 44,163, 99, -133,181, 46,196, 97, 90, 31, 10,186,179, 24,107,168,188,165,116, 22,227, 92,232,220, 48, 88,225, 81, 73, 20,198,250,182,246,166, -187,144,121,110, 77,184, 20,216,154,109,128, 7,170, 32, 58,180,120,124, 85,143,206,173,175, 53, 7, 18,105, 3, 58,217, 24,195, -160, 55,164,191,209,165, 69, 69,107,239, 94,250, 67, 19, 70,184,248, 96, 93,171, 9,128, 46,219,126,190,109, 55,131,165,169,241, - 1, 47,165, 36,142, 19,242,254, 22,182,170,208,222,143,147,238, 24, 79, 54,202, 48,170,171, 42,138,188, 64,173,174, 7, 97,154, -177,184,202,129, 15,216, 90, 91,120,242,162, 79, 28,151,184,225, 42, 86,192,106, 81,177,101, 29,103, 26, 9,198, 67, 49, 28, 34, -178, 28,165, 53, 81, 26,209, 90,156, 33,198,177,182,182,197,206, 52, 66, 56, 65,214, 25,240,248,114,135,239,125,239, 17, 42, 36, -251,118, 76,243,154,159,125, 33,214, 25, 68,179,129,111,181, 80, 19, 9,210, 59, 68, 21, 44,136, 33, 66,192, 81,229, 57,205,137, -121,118, 60,255,167,120,248,159,190, 12, 58,230,120,127, 72, 9,236,108,198, 44,110,102, 92,244,182,151,179,247,131,127,130, 93, - 94, 67,103, 67,116,171,189,173, 29, 96, 27,201,208,235,244, 41, 76, 88, 49,121, 41,144,210,143,133,139, 35,254,148, 15,157, 48, -198,131, 54,181, 78,196, 4, 55,151,146, 2, 87,131,168, 70, 83,229,224,210,169,159,249,218, 38, 39, 71,225, 86,120, 10,235,145, - 90, 80,121, 72,194,227, 48,190, 95, 69, 42,156, 1,145,132, 74,130,243,134,195,143, 62,194,163,143, 31,227,226, 75,175,225,133, - 47,124, 33,189,173, 62,247,223,127, 63,135, 15, 31, 30,221,111,209,145, 82, 68, 24,168,125,115, 94,192,145,175,127,138,133,133, - 93,252,207,207, 63,138, 94,152,229,104,167,207,109, 95,250, 51,222,245, 95, 62,128,214,224,163,136,199,143, 46,147,157, 62, 70, -188,117,150,125,207, 62,200,190,230, 44,221, 97, 65,123,115,157, 67, 59,167, 73,251, 57,155,131,140, 71,150,123, 76,181, 82, 10, -107,217, 55,147,208, 93, 29, 50, 29, 9, 86, 7, 37,115,177, 98, 50,133,161,205, 41, 81, 68, 46, 98,162,142,168,123,138,102,103, -252,194,139, 17,112, 65, 41,132,213, 88, 87, 50, 44, 29,199, 31,189,135,153, 93,187,145,222,160,226, 22,241,142, 9,214,143,159, - 96,102,105, 23,235,167,206, 80, 20, 57,131,173, 62,105,220, 68, 42,144,137,199, 21,150,108,171,194,187,138,124,107, 19, 25, 53, - 40,250,155,164,147,115,116,151, 79, 51,179,235, 0,203, 39, 54,136, 14,164,224, 84, 16,128,200,136,206,242, 25, 84, 28,177,185, -118, 22, 37,125,240,101, 17, 4, 28, 85, 94,209,235,117,217,177,103,145,162,172,144,194, 99,170, 10,231, 4,189,124,147,233,217, - 57,122,107, 91, 72, 28, 69, 57, 68, 69, 45,146, 84,177,190,226,104, 52,115,148,146, 56,215,160, 50, 57, 81,163,205, 86,119, 35, -236, 73,109,133, 47, 37,150,138,134,246, 36, 81,147,181,141,101, 90,173, 54, 73, 60,131, 82,146,205,181, 99, 44, 52, 46,160,119, -118,153, 40,105,176,121,236, 24, 69,153,163,250,125,178,147,199, 57,231,138,171, 56,121,223,157,204, 31, 56,111,236, 83,141,146, - 36,172, 9,206, 30,225,129,127,252, 56,194, 11,180,240, 20,206,147,123, 79, 37,160, 26,171,159,194,191,198,225, 77, 66,144, 72, - 73, 74,240,158, 23,194,163, 74, 17,124,151, 58,156,245, 35, 23,148, 24,141,242,107,218,146, 29,249,134,149, 8,123, 53, 91, 51, - 47, 44,164, 74,160, 43, 16,165, 64, 88,143, 42, 36,210,168,122,135, 62,114, 64,203,177, 16,234,158, 78, 69,233, 32,173,161, 87, - 87, 77, 70, 65,168,162, 4,143,125,226, 22,206,125,199,235, 48, 86,224, 68,132,158, 89,194, 14, 7,117, 55, 18, 60,211, 78, 10, -192, 32,163, 24, 39, 35,132,205,234, 40, 74,197,226, 76,202,179,222,114, 35,237,102,240,139,122, 5, 31,253,251, 7,121,222,243, - 47,100,106,105,150,245,149, 62,115,151,239,229,242,123,215,184,117,253, 12, 7,163,167, 0, 32, 4, 84,206,115, 40, 81, 60,243, - 21,239,228,129, 91,255, 6,149,166,148,121, 70, 43,105,145,164, 17,191,242,138,183,112,203,189, 79,114, 40, 85, 44, 37, 50,240, -241,235,215, 44, 86,146,141,204,144, 36,130, 91,110,252, 35,246, 95,113, 25,157,213, 85, 92, 97, 49,121,129, 29,230, 24,213,196, - 13,114,202, 47,253, 25, 78,122, 14,190,226, 90,226,217, 41,212,244, 60,141,115,206, 67, 36,237,176,239, 86, 2, 92, 5,186, 13, - 8, 76,191,194, 14,186, 72,169, 3,209,205,213, 72,206, 58,251,124,164, 80,151,245, 28,207,153,170, 22,201,185, 32, 56,244,129, -197, 61,158, 45,142,246,166,118,148, 83,109, 17, 94,213,100, 54, 95,219,206, 70,222,159, 80, 80,133, 14,196,181,113,119,238, 69, -176, 63, 84, 38, 64, 93,172, 33, 63,123,154, 97,119,157,201,253,231,193,198, 90,152,176,168,144,213, 30,197, 73,248, 26,128, 41, - 50,164,212, 72, 29,161,164,170, 59,156, 58,190,212, 86, 65,144, 70, 80,160, 91, 28, 85, 21, 68,117,190, 78,104, 51,101,137,177, - 65,201,110,173,197,216, 58,112, 5,143, 29, 86, 40,173,176,245, 24,222,121, 95,255,222,138,188,176,129, 39,225, 28,194, 57,164, -208,184,122,212,110, 17,148,117,178,155,179, 22, 99,131,216,205, 26, 59,222, 43,135,180,185, 16,187, 42,148,168, 59,189,112, 33, -138, 84,184, 92,142,246,178,130, 16, 55,187,210, 27, 48,167, 5,241,233, 51,100, 19,211,232, 56,236,165,181, 50,232,122,246,171, -116,224, 48,200, 56, 70, 15, 11,220,176,192, 54, 83,226, 58, 92, 40,138, 20, 91,189,173,122, 98, 82,227,201,252, 83,124,235,214, -133, 86,180,223,167, 18, 10,238,188,143, 92, 72,232, 15, 81, 94,241,192,153, 85, 78, 14,114,172, 84,148, 82,114,182,159, 49, 28, - 20,136,122, 85,100,159, 18,206,218, 72, 52, 81,164, 72,202, 64, 72, 89,237,103,224, 60,137,146,244, 77,157,186, 39, 97, 50,141, -104, 55, 98,132,144, 12,135, 37, 31,253,208, 63,242,211,175,188,146,189,151, 28, 10,187,226, 56, 66, 54, 26,200,134, 12,182,208, -162,196,185, 24,165,155, 44, 60,247,167, 88, 89, 61, 77,235,194,243,248,210,239,188,143,115,230,218,204,122, 73, 99,189,207, 79, -125,237,239,105, 94,122, 57,213,145, 99,196,147, 83, 40, 61,138,232, 86, 63,150,216,230,189,167,180, 6,139, 71, 73,106,200, 89, -237,182, 82,132,169,234,168, 91, 55,161, 73, 81, 58,188, 76,120,129,173,195,137, 70, 49,168, 74,201,176, 22,144, 16,215,116, 77, -148, 39,141,195,209, 19,169,218, 72, 48, 66, 30,235, 32, 28, 30,189, 21, 66,143,181,184,232, 72, 16, 89,207,174, 3, 7, 57,112, -232, 34,178, 92,241,195,123, 30,226,171, 95,253, 6,214, 11, 94,245,234, 87,115,248,145,195, 97, 85,234,235, 78,221, 56,137, 33, -124, 88,139, 18,214,166,167,120,206, 47,191,144, 95, 47, 62,199,247,159,236,114,227, 45,127,197, 86,123,142, 55, 94,114,128, 91, - 30, 61,202,225,147,103,185,224,208, 94, 68,103,131,244,218, 55,144,124,235,239,136,174,120, 25, 31,126,249, 59,249, 95,247,124, -156,210,127,133,118,154,226,243,156,211, 50,140, 72,103, 82,205,230,192,224,164, 36,141, 4,173, 8,180,176, 60,239, 57, 23,114, -254, 75, 94,134,207, 50,146, 10,154,141, 41,116,148, 82,174,173, 98, 58,235,216,173, 46,101,103,157,188,211, 65, 84, 37, 54, 74, -144,213, 16, 83,101, 24,103,169,240,124,251,107, 55,243,140,231,188,148,120, 98,138,124,171,139,200,130,120,173,172, 2, 51, 57, - 73, 19,178,238, 38,179,187,247,210, 91, 95,197,148, 21, 58,105, 82,230, 25, 81,210, 64, 72,131, 43,160,183,213, 35,105, 42,108, -213, 34,207,215, 89,220,119,136, 97,111,131,164,217,194,123, 71,214,235,227, 40, 41, 7, 61,240, 38, 20,222, 78,135, 52,149, 68, - 19, 41, 42,134,249,165, 37, 28,138,170,168,208, 81, 69, 97, 74, 26, 58,102,107,163,199,228,244, 4, 82, 8,162, 52,161, 63,232, -131, 16,108,172,175, 50, 49,221,224,216,147,199,153,223,177,128,148,142, 97, 30, 60,241,101,158,208,219, 88, 38, 73, 21,158, 18, -165, 21, 91,101,143, 88, 71, 40, 27,161, 92,139,164, 49,207,147,143,254,128, 11, 47,125, 1, 85, 94,176,126,230, 8,231, 93,249, -147,108,158, 60, 70,220,106,114,246,209,251,217,119,197,181,156,125,252,113,218,115, 59,200, 54, 59,120, 41, 73,219, 19,100, 91, - 61,166,151, 22,184,241,205, 47, 0, 47, 48,120,134, 6,250, 46,164, 13,149,120,172, 12,234,119,107, 71, 42,208, 58, 87,216, 65, - 4,164, 58,240,189, 99, 36, 77, 21,124,152,214,133,100, 54, 33, 61,165, 21,193,158, 93,250, 49,135, 60,140,227, 5,170,206,213, - 86, 94,160, 13,164, 66,162,173, 66,149, 97,209, 20, 85, 2,149,213,105, 5, 70, 34,234,112, 23, 33,130, 21, 72, 57,195,137,188, -254,128, 88,152,143,224, 39,246,214, 20, 50, 27,196, 84,143,127,242,102, 14,253,244, 11,240,139, 51,216, 2,100,163,137, 47,182, -112,149, 8, 38,149, 72,131,106, 33,156, 69, 84, 37, 94, 7,149,252,142, 93, 11,252,252,175,127, 26, 81,103, 92,140, 78,169,169, - 57,248,181, 95,255, 60,159,190,233, 93,180,251, 25,149,111,243,187,239,188,150, 29,159,188,131,247,124,255, 20, 7, 35, 57, 62, -212, 36, 80, 90,207,193, 68,113,217,243,222,194,231, 63,246, 30, 46,184,252,105,124,241,163,159,226,221, 31,190,137, 61, 2, 14, - 38, 18,251,148,189,185, 70, 80,122,199,233,204,240, 71,191,253,102, 94,245,142,183,179,113,118,153,206,242, 10, 38, 43,177, 89, -137,181, 96, 84,139,252,171, 55, 98,142, 61,194,204,101,231, 49,115,254, 30, 84,187,141,156, 90, 34,158, 93, 68,197, 41, 74,219, - 96,233,171, 10,104,205,130,110,129, 76, 49,107,167,194, 46,182,190,216,132, 49,197,200, 95, 94,231,169, 11, 17,246,208,117, 20, -166,171, 28, 50, 82,181,117,175, 30,185, 72,182, 61,231,227,184, 86, 66,218, 27,193,247,238,107,197,249,200,203, 35,116,109, 9, -244, 46,216, 11, 61,152,238,122,237,103, 12,133,223,149, 69,176,165,233, 8, 51,204,232,157,120, 18,161, 85,184,132, 14,131, 75, - 70,213,251, 84,239, 29, 58, 74,169,202,124,140,177,213, 90, 96,109,157, 54,231, 61, 38,203, 72, 90, 77, 68, 20,225,234, 72,211, - 32,174, 10,226,184,170, 52,193, 57, 83, 25,170,170,192,228,101,216,169,214, 92,117, 91, 83,236,108, 61,126,175, 10, 67,229,130, - 80,174,178, 62, 40,255,133,192, 11,135, 41, 76, 77,220,139,193,135, 2,145, 87, 65,145,109,109,216,130, 87,198,162,130,115, 60, -164,115,141,215, 19,224,141, 32,210,114, 60, 17,241, 50,208, 55, 93, 13, 1,210,141, 20,155, 15,201,135, 57,157,254, 6, 81,236, -104,236, 92, 64, 87, 30, 37, 13, 90, 43,162, 81,208,142,117,196,182,198,194, 22, 21, 36, 97, 94, 28,233,132, 52,218,162, 26,228, - 68, 19,205,122,170,225,182,125,164,181,246,192, 12, 6, 56,231,169,214,123,172,123,193,201,238,144, 51, 69, 73, 30,107,202,202, -146,247,251,232,118,139,103,191,234,249,156,247,250, 87, 48,125,233,179,144, 50,240,213, 85,212,196, 12,187, 88, 23, 49, 60,246, - 16, 55,188,251,189,148,199, 86,152,197,160,109,137,112,154,190,146, 56,169, 40,140,161, 33, 5,222, 73, 26,210,211, 80,154, 11, - 23,167,249,250, 45,119,243,246,171,159, 14, 58, 70,232, 40,156, 22, 58,130,164,129,104, 58, 68, 89,162,100, 11,117,249, 85,252, -105,148,210, 53,158, 11,119, 76, 51, 45, 96,165,128,159,223, 56,193,224,236, 9,170,179,171,193,234,167,131,221, 79, 74, 21, 26, -131,177,142,192,209,235,118,201,109, 22, 40,166, 46,104,186,180,216,182,155,133,172,128, 64,147, 19,110,123,175, 30,136,139,212, -232,214, 80,216, 35, 25,206,180, 70, 4,145, 10,255,159, 80, 53, 67,192, 67, 36,221,216,223,174, 35,208,113, 56, 48,242, 98,123, -226, 56,114,127, 26, 91,191,149, 6,118, 45, 45,241,173,111,126,135, 83,103,187,100,133,199,186,240, 92,220,254,157,219, 2,178, -191,190,140,107,173, 36,177,151, 88, 95,139,211, 28, 44,175, 30,231,201, 7, 54, 57,123,226, 12,239,248,200, 13, 60,118,203,231, -208,170,100, 71,211,241, 51,207,187,130,219,190,123, 23, 15, 45,159, 37,190,242, 5, 48,220, 96,250, 89,207,224,137, 91, 62,202, -115, 47,156,102,237,214, 91,121,227,203,159,198,111,124,244, 54,158, 62,215,196, 13, 13, 11,141,152,205,202,176,163, 25, 49,232, - 21,172, 34, 25, 86,142, 75, 38, 12,123, 46,122, 46,235, 15,159, 65, 74, 73,167,211,195, 84, 71,144, 66, 33,227,144,181, 92,150, - 18,167,231,240,243,139,117, 83, 16, 68, 54, 18,201, 4,158,139,237,128,199,143,221, 79,190,181, 73,212,108, 99,202, 62,205,169, - 5, 84,210,196, 20, 37, 19,179,115, 20,217,128,214,212, 44,195,225, 32, 96, 1,243,156, 56,210,117,182,120,133, 23, 26,100, 73, -179, 61,201,160,215, 37,105, 79, 97,205, 16, 31, 57,146,246, 36,101, 62, 64, 74,205,196,204, 36,249,112, 64, 26,167, 20, 69, 65, - 26, 39, 68, 11,237,154,167, 12, 54,207,177, 6,182, 54,215, 65, 54,113, 6, 36, 2,137, 34,110, 78,146,103, 21,222,105,124,217, - 71,136, 8, 83, 25,164,138,201,178, 33,179, 11,243,108,172,109, 48, 61,221,160,215,205,137,210, 10, 95, 9,250,189,138,170,176, - 88, 57,164,217,108, 34, 69,204,176, 42, 17, 42,166,215, 95,195,186,138,246,196, 36,155,171, 39,201, 6, 29, 22,247,156,199,217, - 39, 31,161, 44,134,100, 3,197,194,254,167, 81, 22, 57, 46,207,200,138,156,180,221,162, 61, 61, 71,111,125,133,153, 93,123,185, -225,103, 47,160,225,130,101,169,178,158,190,245,228,214, 83,138, 64,123,139,106,178, 92,164,131,192,201,123, 81, 71, 98, 11,180, -146,164, 50,208,171,172,243,104, 32,243, 62,192, 97, 68, 24,209,134, 38,209,227, 92,157,225,174, 5,190, 10,133, 56,242, 2,233, - 5,145,135, 68, 75, 34, 43, 72,100, 40,230,110, 40, 80,165, 64,148, 33, 46, 21, 83,175, 89, 71, 43, 64, 47,120,120,121,192,114, - 5,145, 15, 43,192,197, 52,240,197,125, 13, 42,242,222,163,164,224,200, 23,190,201,190,151, 61,135,104,247, 2, 86, 64, 85,166, -232, 20,156, 13,123, 1, 95, 5,107,154,136, 27,136,178,100,215,129,253,188,255,125, 55,242,221,227, 67, 22, 27,144,104,232, 85, - 97, 26, 96, 44, 44,204,193,219,223,252, 9, 62,251,229,255,135, 19,135,143,178, 21,195, 91,222,126, 21,115,238,123,252,218, 15, -207,132,253, 58,219, 14,161,202,122,246, 38,146, 55,254,242,251,112, 64, 90,239,205,171,122,101, 65, 29,243, 24, 75,193,153,204, -242,234,103, 95,196, 31,124,226,143,168,172,101,245,196,201,128, 12, 45, 42, 92,110, 67,244,237, 99, 63,160,251,111, 95,162,189, -127, 7,231,188,238, 90, 84,163,137,108,183, 17,233, 28,186,213, 66, 10,139,212, 22,100,132, 31,118, 16,173,105,188,110,131,106, - 32,244, 28,167,111,248,217,241,238, 54,200, 86,228, 24, 32,237,107,184,199, 56,132, 69, 4, 27,148,212, 50,136,234,148, 10,162, -183,177,221, 71,142, 59,251,145, 78, 2, 33, 2, 27, 94,248,237,156,239,218, 47, 62, 10, 13, 9,241,169, 22,145, 68,148,103,143, -134, 91,152, 28,227,194,112, 56,100,210,192,103, 57,189,211,167,137,218, 45,210,137, 22, 89,119,139, 56,141, 81, 73,130, 20, 97, -130,166,180,194, 20, 5,101,158,133, 67, 54,138, 17,101, 80,191, 59, 2,188,195, 57, 95,167,194,217,113,252,104, 85, 57, 60, 22, -107,130, 69, 45,192,100, 42,172,183,136, 74, 96,188, 9, 16,148, 58,232,195, 88, 75, 85, 84, 20,165,165, 48,150,178,242, 24,239, - 2,235, 95, 73,170,202,162,211, 80, 44,156,177, 84, 88,156,146,120,235, 66, 3, 98, 66,199, 46,132,160,172, 3, 73, 70, 30,251, -162,176, 36,105, 18,180, 0,222, 17, 41, 31,130,130,156,161,244, 1, 3,155,101, 37,173, 86,147, 65,111,139,125, 51, 77,202, 66, -144,245, 75,242,173, 1,105,146, 80, 33, 80,198, 34,136, 49,206, 17,137,138, 88, 69,200, 90,200,231,117, 24, 17, 11, 33, 72, 91, - 45,178,238, 38,173,197,153, 26,162,100, 33,170,199, 81,222, 65,101, 49,253, 28,133,228,142,110,206,177,188, 12, 84, 52,227,200, -187,125,158,243, 51,207,227,249, 31,255, 24,186,213, 2, 98,108,182,133, 43,134, 99,148,174, 53,107,164, 75,231,112,244,223,190, -204, 85, 63,251, 59, 44,237,217,197,244,197,255,129,139,207,191,144, 99,199, 78,208, 95, 62,204,197,203, 39,185, 4,139,205, 74, -196,116,139,126, 97,240,214,211,140, 60,189,202, 50, 59,217,224,200, 55,238,230,252,159,123, 57, 62,138,144,113, 4, 42, 25, 51, -219,141,245,204, 93,126, 37, 15,127,230, 83,108, 25,207,249,139, 83,200,193,128,199, 15, 94,194,119,207,187,152,127,124,250,179, -248,193,209,199, 89,123,242,112, 16, 95, 74, 21, 86, 54,226,169, 36,228,240,181, 54, 86,207,140, 37, 5,163,143,131,146,146, 72, - 8, 76, 45, 72, 68,132, 24,214,250,216, 8,157,244, 72,115,228, 60,206,212,236,117, 21,130,170, 90, 82, 50, 17, 73,144,142, 33, -161,251,142, 42,135,243, 97, 42,167,164, 39, 86, 34,172,186,106, 45, 19, 46, 48,230, 71, 5,157, 16, 58,138, 51,130,219,191,125, - 7,235,125,106, 58,224, 40,133, 14,206,174,174,133,115,214, 7,134,135, 78,133,194,196, 50, 8, 59,156, 68, 70,158,179, 79, 62, - 76, 47,187,128,235,191,254, 53, 40, 51,190,250,255,221,201, 31,222,242, 0, 23,237,153,162, 97, 42,158,136,166, 88, 60,184,147, -199, 30, 58,203,149, 47,189,134,104,233,233, 44,158,247, 8,135, 94,247, 22,212,161, 75, 89,251,224,159,112,222,108,147,153,137, -148,189,165, 99, 79, 43,101,178, 40,185,103,163,207,116, 67,211,207, 13, 66, 64,187,149,114,250,248, 49, 54,215, 58, 28, 63,181, - 66, 51,209,180, 91, 45,156, 80,172,108,108,177,214,233, 50, 63,217,100,162,221,166, 44, 77,253, 98,133, 17, 91, 20,215,227, 64, - 37, 73,212, 57,100,253,140,217,125, 9,141,246, 60,182,202, 17, 50, 38,110,164,244,179, 77,148, 82, 68,105,194,112,229, 44,141, -137, 38,249,233, 1,115, 75,243,208,235,209,104,207,208,239,108,177,113,234, 56, 51,231,236,162, 49,145, 98,170,130,188, 7, 71, -238,253, 87,246, 63,253, 82,170, 82, 32, 35,203,214,102, 31, 99,251, 32, 44, 85,230, 64, 26, 26,173, 73,112,146, 60, 51, 97, 71, - 28, 9,188,136,217, 92, 93,103,102,190,137,179,154,202, 22, 8, 29,200, 65, 85,153, 33,170, 10,165, 82,202, 60,199, 58,135, 80, -208,221,236,145,245, 51,166,166,155, 52, 39, 26,148,213, 16, 27, 68,222, 24, 91, 18, 71, 49,152,138,138,146, 94,111, 64,150,195, -210,252, 34, 62,181,164,141, 9,116,212, 36, 31,150,156, 61,254, 36,173,153, 57,218,211, 51, 52,166,102,201,186,235,244,214, 10, -226,180,197,196,220, 34, 81,218,100,237,196,113,102,119,237,230,230, 63,125, 39,229, 96, 64, 44, 3,209,173,235, 60, 67, 60,185, - 11,233,106, 78, 62,101,213, 89, 65, 42,195,222, 71, 85,146, 72, 43, 34, 33,137, 28,196, 82,210, 20,130,161,115,116,132, 37, 22, - 4,166,113, 72,225,164,244, 4,100, 46, 18, 85, 6,229,123, 3,129,116,129,135,220, 20, 33,105,173, 33, 36,202,200,240, 28, 90, -129, 44, 61,210,132, 23, 65,212, 6,247,169,253,115,172,116,183,248,198,247, 78,241,240, 0,214,109,173,203,115,112, 81, 67,143, -169,104,163,207,225, 8,193,125,236,159,110, 35,153,110,208, 59,103, 7,151, 93,247, 19,224, 12,221,181,205,176,131,149, 30,239, - 36,182, 44,104, 54, 82, 94,115,253,255,230,190, 45,195,158,118,128,226,196,163,122,228, 2, 24, 71, 1, 86, 84,188,233,250, 63, -229,255,124,250, 93,172, 60,113,140, 50,137,121,233,207, 95,205, 95,171, 31,240, 75,223, 59,205, 66, 29,169, 59,246,174, 58, 88, -140,229, 88, 9,187,157,201, 28, 46, 52,171,153,225,192,226, 20,255,112,243, 7,152, 63,116, 62, 27,167,207,224, 75,131, 41, 42, - 92,110, 48,186,129, 63,250, 32, 27,183,220, 68,107,105,130,189, 47,121, 38,205,197, 25, 72, 18, 72,167,112, 58, 69,107,135,180, - 57, 74,198, 8,155,225,187,155,200,233, 93,208,218,137, 72,102, 64,165,244, 31,248, 30,174,170,130,131, 96, 4,140,175, 15,147, -113,152, 71, 77, 12, 19,163,147,162,166,197,141,196,133,130,186,155, 87,117,254,184,219,254, 62, 71, 22, 33,165,234,149,149,144, -219,151,134,250, 0, 20,117,176,134,212, 18, 95, 57, 92,145, 17, 94,229, 98, 28, 67, 28,186,169, 90,219,225, 28, 43,135, 15,179, -231,210, 75,137, 90, 77,210,118, 43, 8,101, 85, 16,117,153, 42, 64,105,108,145, 99,173, 33,138, 34,140,202, 40, 43, 19,130, 63, -128, 34,207,198,241,219,214,134, 8, 88, 87, 21,152,194,142, 67,118,170, 42, 16, 41,173, 13,179, 22,161, 21,194,123, 34,111, 40, - 74,135,169, 66,231, 95, 85, 21,149, 9, 33, 81,227,192, 50,107,208,169,162, 50, 97, 10, 33,234, 92,114,237, 3,190,212, 84, 22, -235, 29, 85,173,194, 31,141,124, 61,193, 38, 53, 51, 49,193,106,167,135, 3,154,141, 24,231,204,216,105, 86,122, 40, 75, 67, 85, - 57,140,119, 56, 29,236,111, 11,137,224,225,174, 36,218,216,162,152,242,196, 90,145, 68,154,254,176, 64,105,201,188,144,104,101, -200, 79, 46, 19, 77,182,107,225,162, 67, 11, 71,172, 99,242,206, 26,222, 31,172, 89, 2,110, 59, 74,213,134,214,176, 28,244,113, -101, 73,122,222,185,196,247,220, 79, 6, 60,227, 39,159,201, 11, 63,244, 63, 16,105, 74,126,230, 56, 81,179, 21, 28, 30,163,203, -157, 80,120,111, 72,167,118,242,228,183,191,202,107,222,249, 62,174,189,234, 90,246,238,158, 35, 31, 12,120,211,243,247,242,173, -251,135,124,255,135, 75,220, 59,181,151,239,118,142,241,250,255, 48,195,220, 35, 71, 57,251,216, 73,228,252, 36,162,114, 76, 68, - 96,163,136,251,239,124,156,139,127,185, 25,124,225, 42, 10, 30,117, 45,240, 78, 32,116, 74,116,209, 51,185,233, 39, 95,198, 69, - 75,211, 36,214,114,230,167, 95,197,196,185, 23,114,201,147,103,248,156,157,224,182, 79,255, 53,215,188,254,167,233,173,156, 9, -238, 12, 89, 91,114,198,180, 56,143,210,154,251,238,185,157,184, 6,205,104,198, 86,251, 80,203,141, 64,200,218,166, 86, 91,210, -188,171,129, 50, 54, 88,218, 70, 84, 55,141, 68,123,208, 94, 50,161, 52,109, 69,224,119, 16,192, 54, 90, 5,194,160,138,182, 17, -176, 81, 13,175, 49,118,155,236, 39,124, 16, 7, 75, 31, 52, 74,105,141,129, 85,206,147,213,128,197,235,174,187,142,175,253,203, -215,131, 69,238, 41,148, 95,245,242,171, 91,255,205,169,240,192, 41, 21, 98,227,172,183,188,252, 23,255,152,120,215,229, 28,249, -239,111,229,107, 95,188,139, 63,250,175,175,229,212,195, 39,249,149, 63,252, 29,162,229, 83, 28, 76,224,196, 67, 15,114,205,235, -223, 5,102,141,170,179, 69,243,188,105, 88,125, 18,223,222,199,195, 63,120, 8,132,228, 71,171, 29,146, 68,177,163, 21,115,207, -234,128,185, 52,102,232, 28, 10,207,190,169, 22,157,110,198,218,198, 38,214, 11, 54,134, 5, 79,156,222,224,241, 51,171, 12,134, - 3,180,146,156,221,202, 57,190,182,193,233,141, 45, 86,123,125, 78,111, 14, 56,178,178,198,163,167,206,114,124,173,203,201,149, - 14,135,143, 47,115,197,229, 23,112,206,211, 46,166,123,242, 40, 83, 59,247, 81,100, 3, 6, 27,235, 12,122,125,226, 56, 38,207, - 10, 6,195, 1,147,147, 83, 40,169,104, 78, 76, 83,100, 21,195, 65,159,222,218,105,230,246, 44, 81, 14, 43,132,104, 49,236,173, -210,156,110,161,226, 41,132,176,216, 74, 98, 77,216,123, 97, 44,147, 51,243,248, 74, 17,199, 18,107,160, 44, 11,146, 36,166,223, -239, 16,197, 49,145,142,113,214, 49, 53, 51, 71, 20, 69,148,133,161,204, 75,156,179, 84,182,194,228,134,193, 32,199,122, 67,191, -179,133,179,134, 78,175, 32,142, 53,157,205, 1,222, 25,138,162,160,170, 12,206, 9, 42, 27,118,173,195,204, 49, 49,181,200, 68, - 99,146,115,118,159,139,140, 60,113,212,164,219, 91, 71, 75,193,194,206, 3,196, 73, 66,107,102,134,193,230, 6,101, 54, 64, 8, -135, 78, 82, 90, 51, 59,112, 64,247,236,105,166, 22,119,242,240,247,191,192,247,191,240,177, 90, 49, 11,185,247,116,235, 31,185, -247,148,158, 58, 30, 50, 32, 10, 83, 5, 10, 73,106, 5,169, 16, 76,106,201,172,148, 76, 40, 69, 44, 20, 81, 29,179, 89, 57,208, -245,238, 91, 56, 17,108, 28, 72, 90, 74,145,120, 65,138,160, 45, 5, 13, 47, 73,189, 8, 63,143,164,233, 20,109, 33,137,209, 8, - 27,168,170,210,201, 26,214, 22, 84,211,101,162,121,207,205, 71,249,250,143,182,216,240,208,241,161,232, 86, 14, 38, 35,168,156, - 99,103, 83, 49,213,208, 99, 13, 70,240,222, 6, 81, 77,227,220, 67,252,218,135,110,231, 63,253,213,119,121,228,174, 71,249,169, -107, 14,129,181, 52,218,109,100,222,167,101, 28,131,141, 13,222,242,250,203,184,227,235, 15,115,188,158, 40, 84, 35, 59, 94, 72, -138,164, 89,127,136, 50, 99,184,243, 43,119,241,186,119,188,132,238, 74, 7,209, 74,216,251,140,157,188,121,103,131, 47,220,125, -134, 45,239, 73,159, 18,182, 50,182,104,242, 84, 29,153,103,173,112,124,240,255,125, 27,191,255, 23, 31, 32, 43, 75,134,235,155, -152,172,196, 12,134, 24, 26,152,179,167, 25,254,195,159, 49, 56,250, 8,123, 95,114, 57,243,151,236, 37,158,158,128,214, 36, 62, -153, 8,110, 16, 10,148,116, 68,173, 38,194, 6,194,151,154,217,133,156,216,141,143,167,195, 68,138, 69,142,191,255,141, 99, 80, -197,216, 59, 51, 26,187,143, 5,112,163,250, 62,242, 37,110,143,135,199, 45,142,120,138,243,105,244,255, 56, 55,254,229, 16, 77, - 58, 98,188,251,113,196,106,192,207,214,236,246,209,151,181,134,246, 21,207, 71, 53,154, 1,217, 91,133,124,113, 83,150,216,170, -160, 44, 10,178, 94,143, 39,238,190,135,131, 87, 92,142,136,146,224,239,151, 18,165, 35,170,108,128, 45,194,110,188,202,139,218, -205, 96,235,192,149,224,136, 9, 4, 95,135,175, 12,101, 89, 6, 59,107, 89, 5,248, 76, 81, 82,228, 57,166, 42, 40,134, 5,101, -101,199,169,114,179,110,136,233,117,233,148, 46,168,190,109,232,236,135,153, 9,142, 15,107,195,190, 93, 8,154,192, 30, 95, 50, -111, 42,166,171, 2,223,233, 83,102, 37,157,229, 13,182, 54,250,156, 62,221, 9,127, 78, 94,134, 32, 21,130, 50,122,247,142, 5, -142,158, 89, 14, 84, 52, 31,156, 29, 82, 5,254,120, 81, 57, 42, 99, 41, 43, 75,105,130, 48, 78, 27,195, 82, 83, 82,148,134,163, - 61,199,161,182, 38,235, 15,113,205, 36,104, 24,132, 32, 51,134,103,165, 9, 13, 28,190,151, 83,157, 58,141,237,110,161,167, 39, -145, 73, 10,214,224,140,163,189,107, 9, 17,169,144, 97,175,158,194,123,207, 50,178,147, 43,228,221, 30,213,218,128,153,213,211, - 20, 78,241,130, 27,126, 7,155, 13,177, 69,137, 78, 26,168, 40,169,229,219, 98,236,170,112,214, 80,244,135, 60,250,157, 59,185, -249,174, 7,248,169, 23, 93,203,222,102,132, 22,103,121,236,240,143,104,165, 5, 23, 93,124, 30, 59, 91, 13, 30,249,209,227, 12, - 58, 25,127,124,248,123,236,216, 59,199,173,255,240, 21,210,102, 76,130,167,161,160, 95, 84, 92,254,178,231,226,132, 64,214,185, -247,163,252,116, 41, 99,212,206,189,124,255,189,239, 35, 79, 83,222,221, 27,240,205,187, 31,226,224,204, 4,215,253,204,155, 56, -245,196, 41,238,185,243, 46,222,248, 75,111,167,232,119, 80, 73,138, 78, 82,148,142,183,131,134,234,231,250,195,239,255, 79,172, -109,172,212,156,253, 32,220, 77,180, 68,233,176, 30,171, 76, 29, 94, 36,130, 80, 23, 2, 60, 70,178,109,214,112, 38,232,193, 90, - 90,208, 84,138, 9, 45,104, 39, 97,114, 83, 67,164,209, 18, 18, 37, 80, 64, 26,135,204, 11,173,196, 56, 59, 39,252, 8,150,109, -172, 64, 59,129, 54,130,216, 8, 94,251,234,159, 97, 98,122, 1,132,102,144,101, 60,114,248, 71, 65, 35,161,106,143,122, 45,116, -214,101,108, 48,206,146,196, 97,172,173,133,195, 8,137,219,121, 25,247,252,198,139, 56,243,196, 10,175,185,238, 34, 78, 62,246, - 36,221,178,228,167,127,238,183,248,244, 63,254, 29,207,191,254, 77,188,237,218,103,132,111, 46, 59,134,109, 45,177,242,119, 55, -176,227, 13,191,200,137,219,111, 98,110,113,142,187,159, 56,195,179,118,207,225,164,226, 88,119,200, 84,172,208, 4,232,194,148, -134,210, 75,238, 58,190, 50, 22, 21, 73, 4, 70, 8,132,135, 44,210,144, 89,140, 51, 52,227, 4, 47, 4,153,177, 8,130, 90,185, -178,142,202,134,108, 99,107, 13, 71,143,159,230,234, 40,166, 57, 55,143, 49, 5, 42, 74, 73, 26, 41,222, 91,154,179,211,193, 34, -180, 12,121, 94,161,211, 38,107,203,235,100,189, 13,102,166, 39,145,102,103,136,230, 83, 26,239,115,162,116,130, 34, 47,176, 69, -129,104, 53,209,245,254,197, 27,135,208, 2,235, 10,166, 22,230,233,173,175,146,229, 25, 81, 28,208,144,147,147,139, 68, 73, 0, - 51,120, 25,209,237,173, 81,149, 10,124, 69, 86,100, 72, 19, 81,102,125,116,148,176,185,185,197,212, 84,131, 65, 94,146,146,146, -196,146,126, 81,161,188,162, 55,204, 73,162, 56, 48,140,177,120,165,136,244, 36,147,147, 17,101, 86,145,180,155,156, 90,126,140, - 61,187,246, 49,191,251, 92,146, 36, 13,251, 78,192,186,130,147,143,222,199,190,139,158,137,212, 49,157,213, 83, 44,205, 46,145, -117,215, 17, 90, 51,185,176,147,147, 71,239,230,150,143,254, 30, 66, 10,202, 90,197,102,132,167,231, 60,165, 11, 20,185, 49,162, - 80, 6,229,178,179, 65, 68, 23, 35,152,209,130, 89,169,104,138,144, 15, 44,165,192, 10, 79,229, 37,109, 25,246,233,206,215, 15, -155,135,180, 22,195,201, 90, 69, 26,185,240, 30,107, 33, 72, 76,216,173, 55,133, 32, 54,146,246, 57,251,152,187,244, 42,150,255, -233,243, 97, 34,235, 67,182,250,163, 91, 25, 31,186,179, 79,210, 8, 53,166,170, 87,237,186,152, 39, 13,255, 0, 0, 32, 0, 73, - 68, 65, 84, 46, 64, 41,208,179,240,185, 99, 61,222,164, 21, 75,173,104,108,137,164, 46, 48,253,199,143,240,213,191,127, 59, 79, -222,251, 40,205, 68,226,187,125,178,227,171,156,126,236,104,237,175, 14,230,211,101,231,248,212,159,191,129, 55,255,250,103, 57, - 81,133, 63,167,165, 97,232,194,222,126,163,130,182, 14, 54,186,141,188,228,177,191,248, 12,231,190,253,181, 44, 31, 63, 77,148, -166,180,174, 62,159,175,239,157,231, 15, 62,114, 7,159, 62,181,197,129, 68,109,139,224,252,118, 45,141,149,100,232, 37,247,125, -255, 51,244,139,156,147, 63,122, 2,111, 2,209,206, 37,147,216,245, 46,217, 87,254, 2,107, 50, 22,174, 58,159,169,115, 22,195, - 78, 58,110,224,117, 18,186,196,178,143,112, 6, 41, 99,164,146,152,245, 19,168,169,121,226, 93, 23, 64,123, 15, 94, 36, 1,191, -220, 60,143, 35,191,247, 6, 16, 42,236,217,145, 53, 25,180,238, 88,234,136, 82, 95,123,150, 69, 61,178, 14,202,119, 59, 42,195, -224, 3,203, 94,198,186, 46,210,245, 97,103,106, 65, 94,189, 31,118,198, 33,234,221, 48, 35,252,236, 72, 57, 25,141,188,122,126, -236,123,223,252,250,141, 44,190,225, 87, 97,123,113, 49,182, 90,153, 50, 8,152, 38,230,102,184,255,107,255,194,149,215,255,108, -216,137, 87, 85,173,196,206, 41,243,140,114,152, 5, 58, 89, 94, 82,149, 65,212, 22, 34,101, 3,199,220, 25, 67, 81,228,129, 30, - 87,134,120, 83,147,231,148,101,137,113,150,188,168, 48,245,247,156, 85,134,103,205, 73,170,147,235, 60,126,214,144, 77,107, 90, -174,196, 88, 75, 67,105, 86,125,142,203,195,124, 97, 82,194,211, 68,198,130, 52,148,195,138,181,129,161, 95,193,176,178, 40, 32, - 49, 33,116,100, 30, 65,177,145, 99, 61,156, 57,185, 65,225, 28, 75,251,118,112,247,169,135,144, 73, 74,210, 0, 21,171, 32,180, -171,121, 12,149,181, 65,253,110,195, 62, 63, 31,165,132, 25,195,108, 43,102,169, 5,135,215, 12,151,204, 70,172,244, 7,108,169, -152,169,118, 3, 83, 89,230,180,196, 84, 54, 8,181,188,160, 92,239, 80,126,239, 94, 92, 28,211,190,248, 16, 82, 43,108,105, 16, -177,197, 85, 37, 50,142, 65, 36, 53, 10, 45, 4, 22,249,202, 98,132, 68, 25,216, 20,158, 63,121,206, 47,242,182, 63,249, 53,118, -191,228, 37, 33,225,206,123,164,175,159,167, 26, 53, 43,116,130, 93, 91,225,245,239,185,129,183,189,249, 87, 56,120,254, 12,159, -254,200, 71,248,137, 93,187,248,201,231, 94,203, 11,126,227,125,252,207,223,123, 59, 79,123,250, 46,238,189,127,158,123,143,108, -240,181, 15,127,144,171, 94,253, 58, 62,112,234, 1,110,120,218,213,168, 72, 82,120,104,181,162, 16,163, 92,214, 78,141, 26,150, -227,157,161,181,255,105, 84,171,167,185, 13,248,231,181,206,120, 90,244,233, 47,254, 51,215, 60,239, 74, 46, 59,180,159, 91,191, -251,157,237,164, 72,169,235, 21,145, 24, 79,148,172,181, 40, 37, 57,115,226, 48, 90,134, 96,179, 17,175, 95, 73,137,178,130, 88, -133,102,165, 52,182, 46,232, 30, 99, 71,187,244,240,218,186, 26, 32,227, 44, 20, 21,248, 36, 4,147, 9, 17,154,157,209,115, 29, - 17, 26, 36, 98,168,180,196, 43, 71, 85,143,253, 81, 96,140, 32,174,215, 90, 74,128, 52,193, 17,132, 23,124,229,179, 55,193,244, - 28, 51,115,187,120,213,203, 47, 71, 40,205,223,254,253,141, 88, 31, 60,238, 35, 75,155,180,202, 34, 35, 16,113, 56,176, 99,163, -208, 86,112,226,177, 47,211,125,224, 71,180,159,251, 42,174,248,157,255,204, 93,183, 29,230,238,229, 30,175,188,112,129, 19, 55, -125,140,203,119,206,241,161,219,238,103,253,190,191,198, 14, 11,116, 75,227, 47,126, 3,174,183,202,161,107,246,161, 60,204, 52, - 99, 38,167,166, 56,221,205,216, 51,219,164, 17,199,244,202, 96, 1,105, 41, 56,220,205,233, 13,115, 54,242,146,204, 58,250,101, -184,141, 26,239,201,138, 10,235, 42, 26, 58, 14, 34, 17,239, 80, 94, 48,145, 42,210, 56,162, 29,167, 52,226,136, 94,127,200,149, -151,156,203,207,189,251,221,148, 89, 78,212,104, 33,117, 68, 49,236,210, 90,220,131,183, 6,161, 34,138,173, 1,105,179, 5,206, - 96,108,133,160,160, 61, 51, 15,113,130,136, 21, 34,110,132,112,134, 50, 39, 74, 83,162, 56, 66, 74,201,176,191,133,208, 33, 30, - 54, 78, 27, 68,122,146,126, 55, 35,105,107,144, 17,147,179, 83,164,205,132,214,228, 52,101,153, 83, 86,158, 94,167,143,142, 68, - 16,141,120,139,177,193, 51, 61, 24, 12,192,195,153,229, 77, 10, 91,209, 31,228,120, 36,155,189, 33,131,172, 34, 73, 83,166,103, -166, 41, 76,196,122,127,128, 19,158, 40,137, 72,149, 68, 74, 67,164, 98, 38, 26, 49,179,173, 54, 87, 93,117, 29, 7, 46,126, 54, -173,118, 11, 33, 29, 18,193,230,250, 9,148, 74, 56,247,178,107,169,202,156,229, 99, 15,178,227,224, 69,100,189, 14,173,217,121, -162, 70,155,108,176,202, 39, 63,240, 54,114, 31,148,237,165,244,100,202, 51,116,158,130,208,149,142,226,110,149,222, 22, 55,135, - 99, 54, 80,252,230,148,100, 90, 9,218, 74, 18, 75, 73, 34, 4,145,133, 4,205, 36, 17, 77, 36,169,208, 52,149, 98,202, 43,102, - 81, 44, 10,205, 2,138, 5, 52,243, 40,118,168,136, 57,175,152, 66, 51,233, 21,169, 83,156,115,221, 27,185,242,134, 15,177,255, -181,207,225, 89,127,249,119,236,122,229,203,216,249,138, 87,115,164,211,227,253,119,246,137,210, 80, 72, 19, 5,155, 6,250,118, -187,145, 28,184,160,252, 28, 90,184,241,190, 77,246,253,194,107,183,185,137, 53,209,140,162,226,240,167,254, 9,121,170, 67,239, -238,227,156,249,250,247,233, 62,118,164,246, 96,215,170,122, 64, 68,138, 39,110,188,149,143,189,227, 50, 58, 67,104, 72,200,235, - 49,191,100, 59, 69, 73,213,183,244,162, 95,241,163, 79,126,137,165, 3,251,168,178, 12, 25, 73,170, 93,179,252,254,123,175,227, - 75,175,184,128, 83, 69, 72, 56, 75,235, 8, 71, 87,199, 56,158,206, 12, 55,127,230,143, 57,115,236, 4, 91,167,151,201,215,214, - 49,133, 36, 95,239,210,249,171, 63,166,248,218,167,216,113,205, 1, 14,189,246,217,204, 28, 92,130, 56,198, 37, 19,160, 35,188, - 41,240, 85, 15,170, 45,164, 48,184,225, 58,213,234, 25,228,196, 60,122,225, 92, 72,118,212, 62,228, 28, 49,177,155,229,191,254, - 67,204,198, 25,156,173,130,237,166,134, 5,248,145, 97,188, 62,232,188,117, 79,105,193,125, 29,230, 82,207, 33, 17, 99,134,190, -175, 2, 92,102,100,121, 11,116,184, 17, 16, 38,216,116,168,147,192,130,211, 74, 32,132, 27, 99, 97,195, 5, 32, 88,197,132, 16, - 12, 30,252, 54,208, 8,157,188, 36,120,170, 93,133, 49, 21, 69, 54, 8,207,100, 77,235,184,243,139,159,163, 53, 51,135,138,147, -208,213, 23, 5, 69,191, 31,186,116, 99,194,247,231, 3,178,212,217, 16, 58,109,171, 18,140,193, 57, 83,255,188,197,150, 21, 85, - 97, 66,140,106, 89,142, 30, 21,132, 16,204,182, 52,115, 69,143,219, 14,119,120,104, 96,152,104, 70, 65,249,238, 96,163,159,113, -158,246, 60,173, 28,242,226,104,192,117,141, 33,123,218,142,194,122,250, 78, 80, 33,209,145,100,113, 34,101,126, 34,101,223,108, -202,174,169,152,189, 19, 49,187, 90, 49,251, 38, 19, 14, 76, 38, 92, 58,223, 98,162,211,101,169,112,248,213, 46,230,244, 58,221, -227,107, 12, 55,183, 40,242,176, 10, 48, 38,232, 85,156, 11,176, 31,137,103,203, 75,250, 70, 50, 59,157,112,104, 38,193, 9,207, -227,155,142,253, 30,162, 65, 70, 54,200,217,161,117, 96,126, 24, 31, 66,104, 74, 71, 85, 88,114,227, 24,102, 57,103, 30, 56,204, -198,234, 58,222, 90,172, 9,107, 11,138,178,142,110, 13,246, 62,231, 65, 36, 9, 88,136, 69, 88, 19,236,153,159,226,216,191,220, -142,108, 38, 53,142,215,109,231,148,215, 23, 99,107, 74, 14,223,123, 23,115,139, 75,232,184, 96, 70, 27,238,184,251, 9,126,255, -139,223,226, 5,191,241, 62,148,132,223,122,223,167,152, 88,218,203,174, 11,175, 32,137, 4,247,220,255, 40,177, 86,244,142, 31, -225, 93,135,239,161, 2, 78,173,116,120,205,239,254, 60,249, 86,191,206,106, 16, 99, 5,170,119,144,236,222,207, 58, 37,255,220, - 78,126,204,115,190,119,215, 78,148,140,120, 98,179,195,206,185, 26, 48, 35, 85,157,220, 39,217, 30, 51, 5,145,220,233,147, 71, -176,182, 34,213, 2, 93, 11, 19,163, 40, 56, 38,210, 72, 18, 9,133,150,130, 36, 10, 29,182,173, 47,170,149,169,133,108, 46,156, - 31,101,157,111,110,106,164,171,212,130,138,224, 6,146,117, 90,237, 40,202, 85, 68, 32, 99, 16, 81, 16, 18,187, 17,144,166,118, -137, 90, 27, 58,117, 97, 4,177, 21, 36, 78,112,104,255, 94, 14,237, 63,143,221,187,247,208,239,117,185,239,190,251, 66,212,171, -170, 63,147, 8, 44, 2, 93, 26,135,142,194,158, 44,138,130, 88, 73, 3, 63,250,238,103, 56,117,218,242,171,255,241, 23,120,242, -150,143,209, 55,130,165, 29,115,196,133,103,179,191,201,175, 94,119, 13,127,241,242, 23,209,123,240, 9,242,134,102,231,179,247, -176,246,200, 3,152,217, 73,166, 95,244, 38,102, 62,243,223,153, 76, 20,143,156, 88,163, 91, 89,158,209, 78,177,110,147,245,210, -132,238, 77,122,142,231,134,102,172,105, 9, 73, 83,107, 68, 4,145, 84, 68, 74,147,198,146,162, 10, 0, 8, 45, 71,168,204,240, - 66, 78, 79, 52,168,140,231,177,227,203,220,240,191,126,147, 43,126,230, 77, 20,155,107,232, 36, 70, 39, 13,178,173, 14,210, 75, - 54,142, 62,130,138, 19,210,102,131,214,236,116,200, 61,238,247, 17,214,176,255,162, 11,120,242,161, 39,152,152,110, 49,236, 14, -176,206,208, 72, 99,148,138, 41,141, 37, 31,100, 76, 47,237, 96,216,219,194, 25, 77, 57, 60,203,212,194, 18, 82, 69, 84,213,128, -178,232,208,154,106,209,237,156, 33,146, 77, 58,249, 26, 85,213, 39,203, 54,145, 40,250,155, 25, 81,170, 48, 70,210,237,108,210, -158,156,100, 56,200, 80, 72, 78,174,245,152,158, 72,168,140, 35, 82, 49,248, 96, 11, 27,246, 6,148,149,225,210,243, 46,227,254, - 71,238,161, 42, 60,139,115,123, 56,247,252,167,147, 54, 96,117,249, 56,237,169, 89, 34, 37, 49,101, 78,234, 65,234, 20, 17,197, -152, 50, 99,215,190, 11, 64, 73, 54,151,143,147,180, 90,204,239, 60,200,112,227, 12,211, 59, 15, 81,102, 3,154, 83,147,252,238, -175, 60, 7, 41, 60,214, 75,140,243, 88, 27, 70,126,149, 15,153, 90,255,126,202,106, 76,120,232,194,152,213,161,188,162, 33, 20, - 13, 20,137, 80, 40, 23,108,110, 94, 72, 26,120, 34, 41,112, 14, 38,241, 68, 85, 16,110,164, 46,220, 58,181, 20,200,154,208, 34, -234,248, 68, 89,139, 76,148, 80, 52,150, 63,199,202, 7,191,197,220,197, 23,145, 29, 57, 65,241,248, 26,223,252,234, 17,254,242, -184, 99,186, 9,185, 9, 54,144,118,180,173,244,108, 72,200, 70, 1, 48, 53,209, 45, 23, 80,220,123,123,237,141,222,150,162,123, - 27,186,191,226,236,198, 24,247, 52, 98,111,136,154,193, 28,148, 48,225,107,119, 78,102, 92, 48, 5,107, 38, 28,106,137, 12, 69, - 60,119,176,167, 5,119,118,224, 29, 23,199, 72, 37,176, 89,206, 99,159,252, 2, 7,222,242, 90, 54,151, 79,160,180,162,240,138, - 67,175,124, 6,119, 95,178,147,183,221,112, 59, 63,202,131,160,210, 17,210,229, 94,124,249,161, 96,161, 60,121,134,254,242, 26, - 50,223, 68, 61,250, 15,204,205,193,226, 11,206, 71,183,154,160, 21, 34,141,113, 66, 5, 13,153, 45,240, 85, 81,147,192, 12,190, - 40, 48, 38, 67, 79, 47, 18, 45, 29, 68, 78,157, 3, 50,197,231, 27,200,198, 4, 98,230, 34,214,191,122, 19,189, 59,110, 9, 3, - 64, 25,108, 97,206,186, 96,201, 20, 98,236, 63, 20,255, 46,172,107,219, 76, 29,162, 85, 69,125, 73,242, 53,179, 61,132,185,140, - 38, 28,129, 13,143,243,227,225,136,148,146,209,120,194,213, 42,121, 33, 71,112,143,218,187,107,131,156,216,123,193,202, 63,126, -136, 29,175,124, 43,248, 12, 91,149, 72, 29,118,203,198,133, 41,128, 20, 10, 17,197, 12, 59, 29,126,120,211,223,114,229,235,223, -138, 41, 50,156,173, 48,101, 21,166,120, 66,133, 72, 75,111,234,168,214, 17, 7, 62,236,244,157, 9, 29,250,200,179,142,183, 56, - 31,136,117, 78,120,180,116,108,246, 75, 94,122,225, 60, 63,252,246, 81, 14, 15, 42,118, 44,204, 18,121, 79, 36, 29,179, 91, 93, -246, 41, 19,130,205,154,142,137,249, 6, 73, 51, 38,207, 44, 26, 67, 85,228, 76,181, 34, 38, 38, 82,100, 35, 70, 8, 65,220, 74, - 41, 51, 67,175, 55,192, 35,208, 90, 97, 60, 76,204,182,112, 6,138, 60,167,242,130,114,104,112, 74, 48,204, 42,150,123, 3,214, -149, 38, 78, 34,172,175, 45, 85, 4,161, 90, 28, 41, 58,121, 65,145, 27, 46, 57,119,134, 7, 86,114,156,133,147, 91,138,153,212, -240, 80,103,192, 11,231, 38,176, 33, 77, 36,116,149,165, 9,178, 9, 32,154,104, 50, 63, 63, 71, 58,191,147,188,183, 73, 51, 89, -164,202,135, 68,113, 82,103,137, 26,220, 32, 7, 83,225,134, 5, 40,136, 19,197,188, 17,108, 85,134,162,159,227,170, 10, 44,200, - 58,106, 86, 8,139,247,181,162,220,123,182,182,182,216,185,184,196, 48,239,114,231, 29,143,210,127, 74,224,119, 64,128,123, 92, -177, 69,231,212, 41,202,170, 98,239,174, 25,140, 49,232, 70, 74,255,241, 71,120,253, 55,190, 74,241,201,255,141,140,226, 80,134, - 71,139,227, 17, 99,213, 89,212,142,221,220,247,229,207,242,170,103, 61,157, 47,125,235,206, 49, 52,230,205,175,120, 46, 39,123, -107,108,116, 87,249, 47,215,191, 10,239,202, 64,145,148,122, 60,110, 31,253,163,180,230,209, 7,190, 79, 18,213,128, 37, 31, 0, -104, 82, 9, 34, 33,136,164,128, 72, 80, 88, 73,110, 92,157,172,247, 84,155,239,104,244, 94,127, 79, 53,228, 93,136, 48,158, 87, -202, 81,137, 32,162,171, 45,237, 88,231,208,162, 22,201,250, 64,145,115, 2,156, 23,219, 81,175, 54,224, 2, 68, 9,174, 6, 2, -189,232, 5, 47,230,174, 35,167,248,246, 61,247,241,196,137,147,148,214, 32,253,136,251, 16, 60,245, 74,130,174,188, 71,121,143, -214,170,246, 15, 42,164, 87,108, 30,126,152,119,124,253, 75,244,127,248,101, 62,252,187,159, 34,154,108,115,253,158,105,110,121, -224, 4,229, 99, 9,239,254,208, 47,242,111,159,248, 12,131,116,150, 23,189,242, 50, 78,124,231, 4,123, 95,246, 58,142,223,116, - 35, 7,246,247,185,230,133,151,113,242,179,247,113,118,152,241,234,103, 95,194,185, 7,247,176,214, 43,249,252,163,167,168,156, -199, 56,193, 76,171,201,116,156, 80,185,112,200, 69, 90,209,136,131, 39, 52,214,138,217, 86,155, 94,150,225,113,104, 39, 66,230, -174, 18,129, 1, 93, 90,190,242,173, 27,105,236,216,141, 27,108,161,146, 20, 33, 4,213,214, 6,113,163, 69,180,103, 31, 58,190, -144,213,199, 30,160, 24,244, 65,104,226, 56,194,198, 17,113,115,146,214,204, 2, 66, 28,161, 28, 12,105, 47, 44, 48,216, 92,163, - 44, 75, 92,153,131,138,145, 10,170,114,192,244,194, 12,221,245, 62, 84,130, 97,175, 79,156, 52, 40, 7, 21, 29,183, 73, 62,236, -209,152,156, 98,184, 53,100,208,219, 34,203,135, 20, 69,193, 70, 63, 99,162,221, 32,177, 9,121, 86,162,163,136, 65, 63, 40,115, -143,173,118,208,145,196, 88,143,146,154,173, 44,167,157,166, 52, 98, 77, 97, 4,194, 9,246,156,123,128,243,159,118, 13,165,233, -176,181,181, 76,175,119, 2,107,103, 88,220,117, 0, 37, 37,206,148, 76,239,220,205, 32,223,162, 49, 53, 77,220,156,160,216,234, -178,190,124,140,249,221,231,178,184,255, 60,250, 27,107,120, 83, 49,181,231, 32,142,138,185,165,221,252,215,159,191,104,124,160, -226, 61,218,134,157, 94, 8,248,169, 15,189,145,208,211,109,139, 69,172,169,111,154, 54,228,150,199, 34,120, 47, 35, 25, 30,252, -209, 40, 89,218, 48, 30,108, 33,105,215,169, 70,202, 65, 44, 66, 0,143,240,160,188,216,206,241, 30, 41,175, 69, 24, 15,124,248, - 31, 54,184,245,196, 89,102,121,136, 45,160, 47, 64,181,198,137,165,196, 34,140,244,135, 38,116,228,169,222,246,196,182, 85,248, -187,102, 22, 94,116, 32, 98,229,158,213,113,176,136,168,211,157, 70, 25, 79, 35,188,233,104,145, 37, 68,157,173, 78, 45,125, 21, -142,120,105, 63,151,188,251,197,244,110,252, 3,244, 68, 16, 43,185,186,222, 47,198,112,166, 8,237,194,243,246,205,143,201,101, - 46,207,121,226,227, 55,178,247,173,175, 97,176,185,134,140, 36, 78, 57,184, 96,137,207,125,232,181,152,173,156,108,125,139,211, -255,151,172,247, 14,183,236, 58,235,251, 63,107,173,221, 78,189,253, 78,185,211, 37,205,140,172, 81,239,150, 92,130,141,108,112, - 9, 53,224,184, 1,191, 96, 48, 24, 98,155, 80,108, 76,208, 15, 28, 48,196, 63, 74, 48,198,166, 5, 23,146, 95,176,193,198, 20, -199, 13, 99,185,224, 34,201,150,213,187,102, 52,154, 59,115,235,169,251,236,182,214,202, 31,107,237,115,175,200,163, 71,207,140, - 30,221, 57,115,206, 62,123,175,247,125,191,239,183,156,221,230,225, 39, 55, 56,254,226, 23,240,232,135,223, 75,135, 9,251, 22, - 66,154,115, 29,226,127,115, 2,173, 4, 66,133,136, 36,154, 78,208,232,220,105,205,141,243,186, 54,147,177,179, 10,142,154, 68, - 11, 43,132, 51,251,145,201, 50,214, 20,216,124, 11,217,222,131,156, 59,200,230,103,255,158,205,191,123,159,175,207, 78,190, 86, - 23,104, 99,236, 20,206, 20, 94,174, 35, 3,159, 89,238,247, 4,194,115, 18,132,112,228, 56, 39, 66,116,132, 42, 43, 37,178,118, - 64,243,198, 49,194, 95,111, 97,188, 75,159,177,211,235, 46, 96, 26,175,108,189, 27,157,197, 32,133,194, 98, 25,223,245, 41,170, -219, 94,141,181, 26,213, 72,168,170, 18, 83, 58,235, 83, 21, 37,144, 79, 16, 82,209,232,180,121,250,193, 71, 57,248,224,221, 44, - 28, 58,134, 12, 3, 71,122, 43, 43, 66, 18,183,202,215, 22, 25, 6, 80,228,126,106, 55, 8, 83,250,240,151,210, 33, 16,202, 5, -173, 68,113, 76,165, 53,166,128,216, 90, 94,113,229, 34, 49, 99,238, 59,159, 51,152,104,222,120,168,193,114,219, 96,199, 5,165, -181, 68, 11,115,100,169,139,200,154, 93,110, 99, 44,140, 77, 73,186,157,179,119,223, 12,139, 7,231,221, 80,217,233, 50,217,238, - 19,207, 45, 81, 78, 82,130,141, 45,154, 11,243, 88, 93, 34, 27,109, 26,179, 93,170,201,152,188, 63,162,152,140, 9,195,136,206, -254,253,136,168,193,112,117,141,103, 30, 95,101,109,123,204,150,129,243, 74,178, 53, 41, 72, 2,225, 76,137, 10,139, 18, 78, 67, - 61, 31,195,147, 35,232, 34,160,138,152,211, 35,102, 2, 73, 94,104, 68,238, 60, 41, 2, 32,150,206,160, 38, 12, 20, 82,192,184, -204, 16,107,155, 36,179,179,142, 47,146,103, 4,113, 12,233, 24, 59, 28, 65, 89,185,179,214, 72, 98, 21,112, 34,209,108, 93,117, - 41,131, 39,158,112, 33, 57,149,241,209,185, 1,214, 72,144,214,163, 11,154,206,124,135, 11,219,235,232,234, 8, 23, 95,126, 41, - 65,244,119, 46,239,221,111, 85, 86,246,238,165, 85,132,168, 64,179, 61,236,113,217,141, 55, 82, 20,133,219, 39, 71,145,139,169, -158,237, 98,172, 64,201,208,167, 10, 50,109, 62,101,203, 57,194,189,231,175, 62,203, 31,188,251,157, 92,253,161,191,100,107,173, -207,137,195, 7,144,157, 3,156, 91, 19,172, 62,242, 41, 94,250,186,247, 49,220, 58,239,160,123,233,121, 54,187,244,233, 82, 10, -222,251, 91, 63,141, 52,142,128, 23, 10,233,207, 3,199, 13, 74, 2, 9,185, 64, 89, 77,160, 36,161, 53, 62, 70,213, 27, 49,121, -116, 71, 42, 47,163,173,197, 32,214, 17,228,148, 84, 4,161, 0, 91, 58,162,180, 54,200,132,169, 52, 23,175, 12,173, 35,170,235, -108,131,188,116,188,162,208, 58,169,156,209,240,222,247,255, 9,186, 61,199,252,254, 3, 92,126,245,181, 84,198,242, 55, 31,251, -216,148,145,111,189,221, 67, 96, 43, 73,134,123,200, 43,105, 41,173, 37, 40,192, 40,133,169, 6,188,243,117,191,202, 75, 94,254, - 60,110,254,158,151,176,246,197,207,113,237,107,190, 23,145,110, 51,122,244, 30, 78, 46, 4,252,252, 95,127,137,239,122,249, 73, -170,170,226,153,187, 30,100,255, 53,167, 88,253,240,111, 82, 69,251,232,175, 93,224,200, 92,151, 59,238,124, 0, 49,217,228,218, -131,179,124,252,145,115, 24, 9,165,112,129, 17,113, 4,199,230,218, 24,235,157,155,140, 35,134, 24, 99,177,166,100,190, 29, 51, -211,154,165, 63,153,144,166, 35,138,178,224,242, 83,167,120,227,239,253, 22, 85,225, 4,131, 86, 58,167, 46, 51, 25, 19,182,102, -157, 65,141,174, 40,210, 49, 69,150,209,232,182,137, 91, 45,176, 21,205,206, 12,219,107,155,164,195, 49, 51,139,243, 20,195, 62, - 84,153,211,245,202,156,214,220, 12,163,222,136, 78,123,129,126,111,155, 94,185,129, 41,115,154, 75,179, 88, 3,227,254, 22, 73, - 91,177,122,102, 27, 99,122,200,160,201,160, 55,230,220,133, 45,138,178, 96,152, 85, 68, 17, 4,185,166, 44,114,202,170, 34,208, -130, 74,107, 38,185,101,115,148, 50,223,142,105,198, 13,214,122, 67, 2, 21, 96,204,132, 80,133,100, 70, 51,183,220, 34, 8, 19, -206,158,255, 38, 86, 27, 22,151, 15,209,233, 46,209,234,204,145,166,155,232, 34,227,192,241, 43, 41,242, 1,179,179, 7, 64, 40, -178,113,159,184,217,102,255, 69,151, 49,187,239, 16,227,254, 38,217, 36,229,200,229,215, 82,228, 41,237,206, 60,255,233,245,151, - 78,141,124, 80,142,205, 94,177, 19, 52, 0, 59,217,192, 74, 91,140,116,146, 13, 25,236,196,158, 10, 11,137, 15,212, 9,144,126, - 58, 99, 58,113, 41, 4, 77, 41,137,118, 73,117,164,111, 16,148, 16, 83,120,115,135, 96, 37,167,198, 66, 86,192,247,157,156,231, -205,255,245, 21, 60,250,217, 59,184,247,204, 4,162,132,123, 78,111,242,141,199,123, 40,207,208,215,218, 21,216, 72,193,164,114, -239,173, 33,221, 20, 61,209,112,249,156,226,214,189,115, 14, 27,247,211, 25,117, 50,178,244, 93, 52, 62,192,198,251,123, 91, 43, -166, 6, 83, 22,216,243,202,215,114,224, 71, 95,202,237, 7, 95, 68,222,129,141, 17,252,216, 69, 49,127,123,206, 65,146, 43,157, -144, 59,206,149,124,224,223,159,164,234, 13,188,172,203,255, 93, 86,240,244, 7, 63,206,193, 87,189,140,209,120,132, 82,110, 90, - 28, 11,133,157,107,195, 76,131,131,135, 23, 57,124,243, 49, 76,185, 70,112,240,160, 75, 33, 52,238, 52, 48, 83,115, 12,233, 14, - 76, 93,185,137,220, 90,103,147, 90,149, 46,106, 56, 72, 8,103, 23,145,113, 11,217, 94,194, 70,109,108,217, 67,169, 38, 34, 88, - 34, 88, 58,204,249,255,245, 65,250,126, 66, 87, 82, 98,164,157, 50,107,173,176, 83,178,208, 78,230,184,242,112,186,240, 12,110, -191,142,168,167, 49,233,124,220, 69,253, 34,248, 44,121,124, 92,107, 32, 17, 70, 56, 79,113, 97,189,233,139,215,176, 23,218, 53, - 89,222,175,221, 33,159, 21, 66, 74,180,214,110, 58, 9, 66,206,188,235, 71, 57,250,107,127, 77,185,241, 40, 65, 24, 17,180,154, -200,113, 74, 96, 52, 86,135, 72, 99,209,121, 70,119, 97,158,207,254,233,127,231,149,111,126, 11, 82, 69, 4,205, 22,229, 96, 72, - 89, 20, 68,141, 24,148,116, 83,166,111, 74,116,225, 60,206,221, 51,160,128,220, 17,237,162, 4, 93, 76,156,249,139,177,156,216, -151,112,232,232, 18, 79,222,181,206, 75,175,221,199, 27,143, 46,178,124,234, 24, 36, 9,229, 96,200,214,163, 79,144,143, 53,147, -241, 26,237,153,132,112,182, 69,255,194,136,116, 80,112,240,212, 49,230,246,205, 18,181, 91,152,176, 65,145, 22, 84,149, 70, 37, - 17,166,200,104, 47, 45, 18,207,205, 98,170,146, 32,105, 32,195, 24,155, 79,136,103, 58, 88, 61,161,181,188, 64,208,108,160,146, - 6,173, 61, 11, 92,188,184,200,202,104,196,100,179,207,183, 31, 57,199,184,217,102,144, 85,156, 30,101,196,113, 64, 32, 5, 54, -208, 92,178,183,205,183, 31,238, 49,182, 33, 77,163,144, 26, 6,227,148,142,145, 40, 35,144,198,157,239, 82, 8, 2, 33, 8,141, -219, 23,207, 70, 49, 89, 9,166, 40,176,121, 65, 17,134, 4,205,142,115,216,211, 26, 43,124, 84,177,178,148, 85,197,226, 76,155, -175,223,117, 31,179,221, 38,182,200, 48, 37,168,178,112, 74, 5, 43, 65, 57, 37,132,169, 42,142, 95,117, 53,137,252,159, 72, 85, -146,218,130,119,190,225, 53,252,210,123, 62,128, 49,176,103,113,145,223,121,231, 27,249,232,231,190,194,230, 48,101,111,187,193, -115,110,184,153,141,181,117,135,242, 4, 46,106, 85,180,155,211,120,179,250,172,168, 37,248,170,221,102, 52, 26,240,229, 59, 31, -226,203,255,112, 55, 66, 47,115,241,241, 43,201,180,224,233, 39, 87,249,196,231,191,200,167, 63,252,110,138, 34,163,154,164, 68, -173, 25,148,216, 49,157,113,205, 93,197,234,217, 51, 96, 52, 66, 74,231,181, 17,128,182,138,210, 39,168, 5, 74,209,138, 13, 19, - 35, 25, 87,142,235, 32,113, 50, 52,107,167, 73,192,222,159,193, 53,137, 8,136, 34,208,194,184,192, 36, 64,250, 33,198, 10,231, -176,169,212,142,139,159,149,222, 7, 4, 55,236, 26, 11,105, 1, 38,179,228, 26, 26, 86, 35,180,100,229,216, 69, 52, 22,247, 49, -187,103, 15, 91,163,148,211,103,207,186,115,217, 75,189, 17,174,177, 8, 98, 37,168,188, 6,175,208,130,208,184,135,185,178,112, -230,254,175,146,107,201,139,223,245,155,132,247,127,149, 95,249,147,207,243,203, 31,123, 25,119,127,252, 9, 62,252, 55,159,225, -178,189,243,188,242,170,139, 24,158,189, 64,167,157, 50,124,252, 1,178, 27,175, 37,156,219, 71,220,153,229,186, 27,143,243,181, -175, 63,198,147,153, 38, 21, 93, 46,172,111,113,113, 43,224,161, 81, 73, 97, 5,179,113, 3,161, 97,146, 22,204,182, 91,196,205, -136, 86,179, 67, 85, 89,186,221,134,243, 67, 14, 66,182,123, 61,154,177, 68,218,132, 23,253,192,109,220,246,150, 95,196,228, 57, - 42, 40, 48, 66,161, 84, 76,149,143,145, 97, 19,173, 51,138,225,128,184,221,161, 50,134,197, 67,199, 41,139, 49, 97, 12,189,213, - 49,179,123,150,232,148,134,168,221,102,110,105,137,167,183,251, 72,109,232,118,218,116,218,139,100,217,144, 36,209,100,249,132, - 56,110,177,185,250, 52,115, 11, 49,229,176,135, 8, 90,216,124, 66,191, 63, 97,115,115,131,195, 43,115,108,156,223,102, 56,170, -216, 26,164, 78,106,231,245, 75,214,192,214,120, 76, 35,142,216, 30,166, 52,226,152, 39,206,111, 50,211,138,136,195,144, 39, 47, -108, 19, 71,130,134, 80,168, 64,176,157,231,204, 52, 20, 39,142, 95,193,147,143,223, 75, 24, 40, 14, 28,190, 12,157,167,132, 81, -130,165, 32,237,109,113,197,243, 95,193,100,210, 39, 9,230, 73, 22,150,200,210, 17,243,251, 15, 48,234,109, 17, 69, 9,217,160, - 71,149, 78, 56,112,226, 10,250,107,231,137, 26, 49, 63,255,227, 87,161,118,181,130, 86, 11,148, 39,192, 41,111,103,136,151, 68, -160, 65, 70, 46,210,207,159,193,211,208, 0, 41, 37, 10,199,206, 5,151, 50,100,141,211,130, 27,169,156, 50,202, 57,132,251, 4, - 40,129, 84,238, 95,140, 69,212, 44,232, 58,207,220,155, 56,184,157,173,147,151,124,249,157,127,201,151, 47,228, 60,255, 80,204, -210, 66,131,155,143,132,236, 31, 72,254,126,195, 16,120,233,136,244, 33, 8, 19,239,220,134,117, 59,239, 43,230, 66, 94,117,201, - 60,181, 9,187,245, 19,169, 13,234,112,118,166, 15,150,144,194,235, 82,133, 15, 46,113, 69, 94, 0,123,126,240,185,124,235, 77, - 63,198, 71,206, 67,167, 35,249,167,159, 60,198,207,255,207,199,176, 22, 94,113,164,205,108, 0,207,223,223, 34,238, 13,221,231, -145, 59,113, 35, 72,183,191,123,230,163,159,226,226,159,248, 97,214,207,156, 65,121,253,181, 48, 10,194, 16, 17, 75,207,174,174, - 35, 19, 5, 54,112,210, 24,180,241, 49,154,222,230,212,104,172, 39, 45, 97, 53, 34, 72,156,158, 30, 16,113, 7,145,204,123,221, - 96, 15, 58, 11,200,230, 44,193,193,147, 60,241,107,111,165,220, 58,239, 57,183,198, 91,207, 58,180,171, 54,204,144,214,186,223, - 89,235, 39,108,124,186,151,115,125,179, 53,217, 77,186, 98, 45,172,159,188,167,242, 37, 15,197,123, 16, 0,109,167, 9,124,117, - 76, 41,222,223,191,214,212,226,189,181, 69,160,124, 72, 9,211, 8, 87, 42, 39,227, 58,253, 27,175,229,208,219,254,148,254, 83, -247,187, 76, 0, 89, 59,214, 90,103, 85, 42, 93,227,179,188,178,194, 63,188,247,143,248,222,183,190,153,193,198, 26, 42, 12,168, -202,130,162, 40, 9,148,162,240,161, 51,218, 47, 59,171,202,249,164,155, 74,251,156,120,139, 21, 6, 81, 40,146, 36, 98,159,181, - 92,122,114,129,100,207, 62, 46,249,206, 69,186, 23, 29,119, 44,250,241, 8,213,234, 18, 14, 6,228,163,148,242,244, 51,116,150, - 58,116, 23, 58,200, 86, 11,181,149,179,116,116, 47, 43,207,187, 5, 81, 78,168, 38, 3,140, 8,168,250, 35,130, 48, 68, 72,137, -234,206,184,156,236,164, 69, 20,199,160, 43,242,254, 6, 81,119,150,192, 26,130, 70,236, 53,246,190, 25, 86, 1, 54, 16, 52,104, -211,218,179,194,117,157, 22,214,104, 86,159, 89, 39, 57, 93,210,201,241,204,123,215,156,141, 10, 77,217,180,152, 64,160,138,136, -213,113, 78, 16,198,180,124,138,142,136,220,234, 37, 84, 18, 21, 74,148,118, 4,200,208, 66,214,219, 38,140, 99,196, 40,132,110, -142, 53, 62, 66, 21,215,148,219, 32, 32, 47, 45, 69, 89, 50,211,136, 56, 55,158, 80,165, 99, 23, 31, 93,149,136, 32, 2, 81, 98, - 9,156, 15,145,181, 68,179,243,236, 9,250, 12,122, 19,116,127, 31,123, 14,205,241,193,223,122, 27, 58,140, 41,242,140,239,123, -253, 47,242, 71, 31,254,119,124,238,142, 47,243,137,223,127, 51, 89, 89,250,231, 71, 32,140,244,196, 49,229,149, 21,202, 15, 1, -202, 19,120, 13,237,131, 71, 81,141,152,215, 94,183,135,159,249,189,247, 51, 63, 59, 71,183, 53,139,180, 16, 87,235,252,237,239, -191,149,189,199, 47, 98,212, 91, 39,106,116, 60,226,164,166,152,185,148, 2, 33, 66, 62,240,190, 95,117, 94,238,214,155,101, 25, -119,198, 5, 62, 42, 55, 22, 2, 17, 74,194, 92, 58, 27, 94,164, 35, 99,214,216, 95, 45,241,196, 21,106,233,215,120, 90, 26,114, - 3,102, 82,208, 8, 4, 13,225,194,175,164,240, 70, 66,222,184, 47,140,220,112, 85, 63, 79,120,125,122, 89, 89, 50, 45,200, 11, -203,196, 64,128,230,112,119,142, 7, 31,125,148,167,238,184,131,210,152, 90,109,186,163,171,175, 83,225,190,235,150,214,237,198, - 26,111,143,231,116,113,129,117,251,128,113, 62,230,198,185,125, 28,125,221, 59,248,165,171,158,207,211, 90,176, 39, 42, 56, 54, - 60,195, 99, 91,150, 55,255,151,159,102,237, 11,255,204,133,237, 9, 55,254,151,247, 99,198, 21, 15,253,241, 31,179,247,186,107, -153,123,222,139, 8,179, 33,107, 27, 5,131,237, 17,107,219, 61, 46,127,206, 73,132,169, 88,157, 84, 28,223, 59,207,193,133, 54, - 43, 75,179,196, 65, 76, 20, 74, 86,150,151, 40,202,138,197,249, 6, 65,152,176,185,182,206,242,114, 27,171, 21,198, 84, 28, 90, - 89,228, 7,127,243, 15, 96, 50, 6, 93, 32, 84,128, 46, 83,175,233,116, 19,145,201, 82,146,197,189,232,172,112, 14,104,129, 68, -133, 13,202,116, 12,166,162,217,157,243, 63, 11, 58, 55, 72,160, 61,211,162, 49, 51,199,176,183, 73, 24,196,108,111,109,209,233, -118,217, 62,183,198,241,203,142, 48, 30,104,230, 23,231, 24,174,110,145, 52, 91, 60,244,192, 25,174,187,226, 8,253,126,201,120, - 82, 48,202, 11,202,170, 66, 27, 71, 68,233, 38, 33,131,180, 64,107,195,184,116,222,211,231,251, 41, 82, 24, 26,113,194, 90,191, -160,180, 21, 74, 73, 90,113,196,218,160, 32,138, 44,215, 93,122, 25,141, 86,147,113, 58,228, 57,151, 61,143,241,112, 29, 83,102, -236, 59,114, 9, 79, 61,124, 55,167,110,254, 46,100,226,166,184,214,252, 2, 2, 65,107, 97, 17,163, 43,132, 54, 52,102, 59,152, -210,210,104, 53,233,159, 59,139,108, 54,249,173, 95,122, 57,214,119,127,117, 34,144,246,187, 39,233,155,197, 66, 56,198,122,237, -214,233, 80, 90,225, 85, 79,194,219,158, 58, 98, 92, 55, 20,116,131,128, 4, 65,136,147,172, 97,119, 10,163,244, 14,101, 46,172, -195, 23,115,156,105,141, 35,102,225, 25,207, 59, 43,219, 41, 56,107, 53,157, 78, 66, 38,224, 19,207,100,252,221,147, 25, 31,123, - 34,229,222,177, 95, 17, 24,199,122,111,121,216, 61,116,182,243, 44,197,240,198,147, 93,158,187,183,227, 33, 53,233,139,181,123, - 8, 93,126,189,244,166, 19, 98, 42, 29, 17,211,234,179,107,217,135, 32,191,247, 11,188,228, 61, 79,112,104, 6, 62,244,250, 83, -188,227, 35,143,240, 72,102, 57, 53, 27,242,255,156,154,231,216,108,204,222, 78,228, 58,228,250,239, 18,210, 29, 20,245,252,107, -161,255,208,227,204, 95,123, 37,197,104,228, 6, 91,101,157,181,169, 21, 16,184, 85,139,131, 50,188,180,198,175, 33, 48, 26,131, - 43, 68, 22, 23, 94, 33,195, 4, 17, 53, 29, 44, 15,144,204, 34,195, 24, 33, 75,148,178,136,184, 67,178,176,159,124,125,139,211, -239,122, 59, 58, 29, 78,249, 4,194, 74,207,254,221, 57,132,106, 62, 65,189, 39,159, 22,234, 58,191,217, 7, 41,137,105,248, 13, -211,233,123,247,114, 84,120,187,211, 29,121,144,123, 14,165,144, 72, 85,175, 55,158, 45,127,179,149,246,168,205,142,233, 13,182, - 38,225, 73,108,150, 50,248,234,167, 88,190,237,135, 72, 55,207, 83, 22, 5, 0,197,196, 49,215,133, 39,240, 25,173, 9,195,144, -167,190,117, 55,199,111,184,137, 81,175,143, 41, 43,116,233, 16, 14,167, 69, 47, 93,214,186, 17, 88, 93,248, 59,205, 49,231,173, -146, 40, 37, 88,232, 52, 56,184, 52,199,141,183, 94,193,236,161, 3,132,115,203, 68,179, 51, 4, 11, 7, 60,147, 63, 67, 70, 77, - 44,142,203,130,214,180, 22,154,132,137, 34,221, 30,145,142, 10,226,249, 57,230, 47,121, 14, 86, 79, 40,242, 28, 25,181,209,101, - 73,153, 77,136, 23,151,137, 59,115, 78,199,220, 8, 93,211,143,147,215, 69,179, 11, 72,165, 16, 88,162, 86, 27,173, 13,197, 36, - 69,181,187, 68, 73, 11,213,153,131, 42,167,181, 56,131, 82,146, 70,171, 65, 87,103, 4,210, 93, 80, 19, 72, 46,108,229, 60,210, - 43,105, 6, 1,157,208,113,162, 54,171,156,253, 65,128,180,130, 72,130,148, 1,129,132, 64, 72,148,148,200, 56, 36,104,181, 9, -219, 77, 38,101,238,125, 3, 2,146,164,233,136,132,163,148, 50, 43,168, 38,154,254,118,138, 61,243, 4, 66, 56, 31,228,199,250, - 35,110,248,129,239,192, 22,154, 32, 73, 28,129,113,122,101,221, 63,249,164,228,101, 47,190,129,223,123,239, 95, 99,146, 54,221, -153,101,150,246, 30, 99,125,173,224,225,199,214,120,250,238,111,240,223, 62,242,183,252,252, 43,175,230, 39,110,255,117, 6, 27, -235, 59,217, 50, 22,144, 33,234,220, 83,200, 32, 64,181,218,200, 32,244,212,110,129,214,150,246,197,151, 67,210,228,182, 87,190, -128,255,248,154,151,112,219,149, 7,120,225,149,123,248,169, 31,121, 9, 63,251,214, 55,144, 44, 46, 49, 25, 14, 9,130, 16, 21, -198, 68, 73,130,138, 98,132,116,207,109, 85, 85,100,147, 17,191,251,235, 63,225,184, 55, 66, 80,149,110,191, 45,164, 67,182,218, -202,113,189,164, 16,100, 90, 51, 46, 52,149,112, 28,133,170,180, 94, 38, 41,166, 8,167, 64,144,132,130, 40, 16, 52, 26,150, 32, -112, 13,105, 0, 4,129,112, 28, 38, 97,157, 85,121,224,215, 8, 82,120,233,176,207,217, 48,194, 21,244, 76, 80,100,144,149,130, - 66, 59, 46,207, 13,183,220, 66,212,104,128, 82, 76,202, 9,101, 85, 57,122,129, 71, 75, 29, 17, 15,212, 43,111,110,223,110, 48, -110,151,170, 5,162,242, 29,177,133,225, 96,141,171,142,220,192, 51,247,124,154,163,139, 33, 43,227, 9, 47,250,229, 95,224,255, -127,255, 95,243,147,111,251, 49,190,245,201,207,241,149, 71,206,241,169, 59, 30,231,135,126,241,199, 72,191,241, 1,242,228, 4, - 11,179, 57,241,177, 83,164,171,247,243,212, 3, 67,134,105,198,153,141, 1, 55, 95,117,130,108,146,115,241,225, 99,156, 93, 61, -239, 29,215, 42,150,230, 59, 72, 25, 50, 28,245,137,195,144,193,112,200,210, 98, 3,140, 98,212, 31, 50, 51,147, 16, 43,197, 27, -254,226, 67, 48,238, 99,109,134, 8, 91, 84,217,216, 31, 10, 26, 25,197,148,195, 1,241,204, 28,186,200, 41, 39, 41, 85,149, 19, -198, 9,166, 52,232,188,160, 57,187, 64,153,167,148,185,102, 50,114,187,247, 56,142,136,154,109,134, 27, 23, 88,185,244, 82,158, -184,251,126,158,115,227, 41,202,204,178,184, 60, 67,145, 85,116,103,219,100, 99, 77,220, 76,184,112,110,147, 35,203,109,242,202, - 57,169,173,111, 15, 64, 88, 98, 41, 40,140,179, 6, 28,149,206,152,162,170,156,164,165,168, 44,163, 60,167,219,104,144,151,150, -141,241,152, 32, 52, 48, 80, 0, 0, 32, 0, 73, 68, 65, 84,102, 28, 16, 5, 1, 69,161, 48,162,224,200,210, 2,251,150,246,177, -182,189,198,137,139,159,139, 10, 53,253,173, 85,142, 92,124, 13, 79,159,190,135, 35, 39,174,161,187,188,136, 64,146,180,187,140, -182,214,105,206,205, 18,119, 92,194, 91,220,110, 49, 94, 95,199, 26, 67, 62, 73, 89, 56,120,144,245,143,255, 55,110,186,254, 69, - 60,185,181, 74, 62,233, 79,211,207,204,206,122,213,217,193, 90, 55, 64,217,192,117,141, 82, 56,194,135, 12,156, 33,130,244, 36, -183, 40, 16,196, 8, 58, 66, 49,215,157, 39,148, 1,210, 86, 83, 56, 27, 33, 93, 78,120,157, 21,108,221, 6,182,238, 36,167,100, -244,250,128,247,204,103,124, 74, 90,189, 83,218,223,138,121,238,222, 38, 47,216,219, 64,148, 37, 51,129,224,251, 14, 52, 57,210, - 16,140,115,205,176,182,169, 22, 78, 98,246, 11,167,230,152,107,196, 88, 41,166,218,244, 58,252,199, 76,255, 14,143, 44,120,235, -207,154, 12, 88,239,232,118,254,156, 32,219, 46,184,124, 94,241,154,231, 44,144,246, 38, 28,159,143,248,142,253, 77, 94,114,108, -198,125, 38,159,229, 61, 13, 74,150, 98,170, 19,181,187, 25,186,165,134,170,162,121,244, 48,186,202, 60,100,231, 35,134,119,233, -122,157,115, 4,211,194, 70, 32, 16, 54,112, 5, 92, 5,142, 21, 40, 5,216,202, 25,201,134, 13,132,117,217,226, 42,108, 18,206, -238, 33,144, 9,103,254,236,253,244,239,252, 23, 55,109, 83,107,204,253,247,189, 75, 33,239, 98,226,133, 39,206,213, 42, 52,103, -155, 43,148,112,105,103, 90, 35, 3, 53,157,198,169,195,123,106, 59, 83,185,163, 80,243,216,227,142,159,185,127,109,199,130,151, -110,170,241, 54,177,214, 90,132,242,217,144,218, 21,146,157,130,224, 61,228, 17,232, 34,103,240,197, 79,208,185,250, 86, 68,163, - 73, 62,232,131,174, 8, 91,109,138, 73,134,209, 21,129,103,195,235,178,162, 72, 71,116, 23, 22,200,125,248, 75, 62, 73,137,146, -136,108, 48,112, 5,220, 24,207,204,118,161, 41,142, 97, 92,113,120,223, 2,151,221,116, 13, 43,207,185,152,246,225,195,136,214, - 12, 34,112,211,161, 8, 99,100,220, 68,200, 16,157, 13, 17, 65, 19, 84, 3, 73, 73,228, 92, 96,153,228,176,121,182, 79,115,177, -205,220, 37, 39,209,249,132, 60, 29, 1,146,201,198, 5, 68, 24, 19,207, 45,128, 82,168, 40, 65,132,161,227, 38, 78, 70, 4,157, -166, 35,156, 89,141, 12, 66,180,174, 45,107, 13, 70, 8, 23,143,106, 42,116, 54,113,190,245,185,139, 18,110, 46,204,211,104, 69, - 84,165,115,162,123,116, 61,103,125, 82,209,136, 20,115, 97, 72, 34, 20,231, 38, 99,150,226,192,165,131,121,103, 0, 41, 37,202, - 72,130, 40, 64, 53, 26,168,102, 76, 16,183, 73, 77,234, 73,171, 6,153, 52,144,214, 80,109,246,168, 82,151,172, 54,234,101,244, - 31,121,144, 66, 72, 18,107, 57,211, 75, 57,245,221, 55, 32,100, 64, 16, 69,200, 64, 97, 85,136,173,109, 15,180,163,173, 70,221, - 57,126,248,229, 55,241,255,253,246,239,242,197,251,159,162, 27, 53,185,246,208, 60,127,250,119,159,228, 51, 95,253, 26, 31,254, -207,255,158,159,248,245,119,178,181,250,204,212,160,168,150, 84, 90,169, 80,103, 31, 71, 5, 33,178,229,195,123,164,131,183,172, - 21,180, 46,189,134, 98,178,205,104,227, 60, 54, 74, 88, 60,116,152, 3, 39, 78, 18,182,186, 20,185, 91, 31, 8, 41,145, 42, 68, -133, 17, 97,228,214, 29,210, 55, 32,198, 24,214, 31,127,140, 79,254,253, 95, 76,227, 83,149,116, 30,238, 8, 8,141,164, 25, 6, -132, 82, 82, 26,152,148,174,168,103,149, 37, 47, 93, 97, 22, 8,146, 40, 66, 87,134, 64, 56, 57,156,146,130, 40,128, 56, 22, 59, -210,125, 63, 68, 9,101, 16, 46,249, 24,229,109, 99, 69,192,212,132,200, 84,238,188, 45,115, 24,167,144,149,160,181,131,228,173, -129,135, 31,124,128, 97, 58, 97,126,113,145,155,159,123, 19, 87, 92,126, 37,247, 62,112, 47,198,251,104, 72, 1,177, 16,168, 87, -220,212,185, 29,225, 33, 83,235, 13,234, 49,104,109,185,254,165,111,226,216,169,171,249,171,255,252,251,188,240,215,110,167, 85, -156,163,183,122, 1,221,235,113,195,187,255, 43, 79,253,249,159,240,161,199,198,188,234, 5,199, 81,231, 31,231,200,109, 63,200, -211, 95,249, 39,154, 75,123, 41, 39,134,229,151,126, 15, 79,255,203,191, 48,236,103,228,133,230,222, 39,207,114,213,137,139,121, -236,244, 25,246,238, 89, 36,207, 82,102,219, 13,154,141, 6,101, 89,177,216,237, 18,199, 17, 73,156,160,164, 98,110,113, 22,107, - 4,231,159, 62,203, 79,254,225,187, 9,227, 14,186, 24, 35,195,192,105,184,189,148, 66,132,177, 59,132,226, 24, 93, 86,148,233, -152,168,211, 65,185,147, 18,139,165, 42,114,170, 73,138,140, 98,167,185, 45, 44,189,181,103,104,206,207, 50,220,220,102,229,228, -165,156,249,214,253,216,124,200,145,171,174, 98,243,244, 51,196,141, 38,186, 40, 64,134,232, 74,179,189,222,163,149,104,154,115, -139,228,105,202,102, 63, 35, 14, 74,207,214, 10, 49,166, 4, 25, 48,206,220,228, 30, 72,129, 18, 33, 27,131, 49, 75, 51, 29,198, - 69,197,168, 40,104,132, 18, 33, 20, 73, 24, 19,169,128,102,162, 88,236,116, 9, 19,197,201, 35, 55, 48,179,167,195,185,167, 30, - 96,113,254, 40, 85,144, 17, 7, 13,246, 30, 59, 78, 16,132, 72,169, 24,109,175,147,180,219,180,231, 22, 48,214, 80, 76,198,152, -162, 36, 27,143,193, 26, 22,143, 94,196,219,111,185,129,199, 79,175,113,205, 37,123,185,246,138, 91, 57,117,221,243,249,230,157, - 95, 36, 82,146, 10,183, 51, 47,189,132,173, 46,240,214,203, 86,168,137, 31,254, 41, 13, 36, 72, 35,136,165,160,169, 36, 51, 65, -196,158, 61,151,160,108,137, 40, 50, 23,226, 41,148,223,173,219, 29, 50, 74, 13,209,214, 58, 76,243,236,228,174,105,226,163,119, - 50, 19,194,195,110,222,244, 36, 80,146, 75,102, 98,226, 64,242,233, 11, 25,247, 14, 42, 44,208, 82,208,142, 4,215, 47,196,252, -204,115,230, 9, 2, 71,180, 82,222, 56, 89, 8, 59,157, 2, 69, 13,141,251,105, 84,214,113,190,176, 19,193, 42,133,151,110,213, -204, 85,193,114, 43,112,159,195, 90,218, 81, 64, 59, 9, 92,202,149,112,254,229, 83,100, 66, 10,143,102, 56, 2, 96,109,101, 44, -132, 43,144,229,198, 22, 10, 65,114,240,128, 39,168,249, 11, 80, 84, 96, 42, 68,224,155,128,202, 78, 47,152, 83,153,233, 58,197, -104, 7, 62,193, 5,118,216, 34, 67, 37, 9,201,220, 30, 2, 25,177,254,217,207,178,249,185,207,184,253, 59, 96,234,239, 64,236, - 56,188, 77, 39,235, 90,146,102,157,157, 37,214, 67,145, 82, 76,141,182,132,181,211, 12,240,186, 33,178,186,242,135,182,221,197, -139,176,187, 58, 52, 92,179, 36,236,212,104, 71,170, 29, 8,126, 26, 18,227,225, 0,231,149,238,146,196,108,157, 7, 80, 95,157, - 64, 78, 85,234,147,251,254, 5,206, 62, 74,243,196,213,152, 48,162,154,164, 84, 89,238, 81, 17,144, 97, 64,220, 76,216, 90, 61, -207,194,202,126,138,225, 8,109, 74,143, 22,120,233,157,117,205,133, 83,115,104, 26,141, 6,233,120, 68, 59, 10, 57,121,213,113, -102,142, 30,113,168,146,115,223,194,154, 18, 17,197,200, 32, 1, 21, 34,163, 8, 51,238, 97,100,140,213,160,204,152,112,102, 22, -173, 53,147,137, 97,107,109,192,161,155,174, 35,234,180, 64,134, 84,227, 30,218,104,140, 8, 49,229, 4,213,104,146, 44,238, 71, -133, 13,178,193, 22, 65, 35, 38, 8, 66,170,178, 64,231,133,107, 98, 42, 77, 89, 20,148,165, 91,137,228,163, 1, 65,232,214,138, - 66, 69, 24, 83, 82,142,115,100, 28, 99, 10,141, 8, 2,162, 56, 33,140, 35,170,209, 4, 81, 84, 8, 41,104,202,136, 56,144,140, -139,156, 40, 18,116,140, 32,148,202, 5, 39, 73, 73,168,132, 59,151,146,136,160,153, 32, 27, 49,121,169,209, 38, 71, 72,129, 12, - 36, 74, 5,216,116,228,204,184, 84, 64,158, 87, 12,158, 56, 77, 98, 13,218,194,153,113,198,202,101, 43,180,151, 23,144,161,247, -101, 87,106, 7,185,177,245,206, 90,163, 26, 45,222,248,147,175,229,182, 43,247, 34, 70,167,121,252,233, 71,248, 15,175,122, 49, -239,124,231, 91, 56,114,245, 53, 12,182, 54, 80, 82, 96,181,240, 43, 24,183,171, 70,133,200,179,143, 33, 35,133, 76,154,206,221, -111,202,126, 15,105, 94,122, 45,233,246,211,206,139, 64,212, 81,192,218, 19,234,106, 79, 4,129, 80, 1, 97, 24, 17,196, 9, 50, -136, 92,136,145,113,169,118, 95,255,237,223,224, 27,103,191,233,206, 26, 43,188, 9,140, 68, 89,119, 46, 4,129,139,248, 30,231, - 21,131, 66, 51, 46, 12,165,182,228,133,155,232, 23, 23,230,152,155,153,101, 50, 74, 17, 88, 66, 37,136, 66,103, 17, 43,149,117, -134, 85,214, 5,245,152,192, 34, 34,151, 94,105,132,147,124, 10,143,151, 91, 47,129,171, 85,133,121, 6,105,102, 41, 10,175, 62, - 66, 16, 9, 56,126,244, 16,135, 15, 31, 97,121,207, 30, 70,233,136, 71, 30,123,132,245,245,117,183, 38,245, 76,145, 88, 9,212, - 43,158,219,190, 61,168, 15, 66,109,156,232, 94,192,145,203, 94,204,119,188,246, 93, 20,217,136, 91, 94,126, 37,250,220, 5,246, -188,250,231,120,248, 55,223,206,119,254,197, 7,201,123, 19,162,187,239, 96,105,121, 31,159,186,231, 73,126,230,163,255, 72,254, -208, 29,100,131, 77, 78,127,251, 25, 22,246,205, 19, 69,150,152,156,135,191,245, 52, 27,195,140, 94,154,243,163,175,123, 57,255, -248,133,187,156,211,218,100,194, 76,179, 65, 51,105,160, 2, 69, 89,148,180, 26, 49,139, 75, 75, 88,109,232,111,109, 17, 39,138, - 23,126,255, 43, 88,185,233, 5,216, 60,245,138, 98,137, 41, 29,209, 69, 70, 77,116,145, 81, 14,251,168,184, 65,149,101, 4,129, - 79,241,242,169, 68,147,222, 6,205,185, 57,132, 74,144, 74, 48, 25, 12,105,118,103,136,162,144,184,221, 36, 78, 98,130,164,193, -250,147,103, 89, 57,121,132,124, 92, 34, 3, 73,145,102,132,141, 38, 82, 41, 38,233, 4, 65,198,252,222, 67,244, 54, 7,148,121, -198,246,246, 54,115,221, 14, 69,110,152, 84, 57,203,179, 93,182, 71, 5, 89,145,211, 12,221,195,212,207, 75,150,187, 9,227,194, - 50, 42, 11,154, 65, 64, 24, 4, 84, 70,208, 14, 99,180,173,232,196, 49,243,179, 29, 46, 59,118, 19,179,251,102, 89, 61,253, 32, - 81, 56,203,210,145,131,244,206,159,229,232,229,215, 78,117,197, 85,145,146,246,134,204, 44,239, 33,153,159,161, 72, 83,226,164, - 73, 85,230, 8,109, 88, 60,124,140, 15,188,233,213,132, 42,228,196,108,194, 95,125,246,110, 46, 94,108,210, 49, 5, 55, 95,123, - 61,119,222,255,109,140,183, 56,212, 98,167,150, 8,229, 32,110, 41, 28,154,166,237,142,196, 73, 10, 8,149,164, 33, 4, 77, 41, -152, 15, 35,218, 81,128,200, 82, 2, 91, 77, 73,111,214, 75,226,100,189, 47,223,149, 68,101,237,110,149,148,157,190,176,240,147, -114,189,219,221,209,212,237, 76,144,123,154, 1, 55, 45, 53,248,206,149, 38,223,177,183,201, 11,246, 54,249, 55,251, 91, 92, 62, -159, 96,172, 47, 72,187,222,172, 20,181,173,233, 14,219,213,238,138, 23,222, 97,231,213,164, 48, 59, 77,252,218, 49,166,112,175, - 41,165,244,124, 3, 53,125, 21,235, 11,144,172,181,175,162,158, 96, 93,193,151,190,153, 17,222, 13,162,220,216,160,123,233,165, -136, 40,242,117,208,173,133, 68, 16,122,148,162,242,138, 3,207,188, 9,164, 55,252,241, 58, 96, 99, 48,101,137,148, 2,213,108, -210,152, 93,192,110,142,216,248,212,103,232,221,121, 23,101,175,231,139,164, 95, 49,248,172,116, 16, 59, 19, 57,174,224, 78, 27, -142,169,132,191,150,242,249,221,250,238,107, 23,120,215, 45, 85,147,247, 92,225,118,129, 94,117,140,170,255, 25, 41,119,252,180, -107,152, 93,187, 56,214,218,165, 11,127, 15,139,218, 43,119,122,197,235,239,206,250,117, 77,205,113,112,255, 79,103, 35,244, 35, -119,147, 12, 46,208, 88,218,143,154,153, 67,151, 21, 65,183, 67,160, 66,132, 18, 36,157, 54,233,120, 76,103,118,158,241,214, 54, - 50, 8,168,180,147,196, 18, 40,202,178,112,188, 6,107,157,149,172,148, 92,119,235, 85,204, 30, 63, 6,102,130,144,129, 75,149, -211,165,227, 48,200, 0,209,104,185,235,161,115,108,218,167,178, 33, 84,154,176, 21,163, 58, 51, 84, 52,216,190,208, 39,156, 91, - 96,233,216, 65,176, 21, 85, 49, 65,143, 55, 49, 38, 68, 4, 1, 86,103,174, 9,146, 18, 61,218,198, 84,153,219,231, 75, 87,184, -141,129,201, 48,165, 44, 74,170,202,146,143, 71,148,217,132, 42,205, 72, 55, 54,220,127,143,251, 14,113,168, 10,100,148,184,204, - 8,143,166,196,205,132,125, 43,139, 28,234,134,148,195, 18,237, 9,136,149,174,216, 46, 53,135,226,208,123,124, 88, 23, 13,108, - 32,138, 2, 84, 20,163,154, 17,178,217, 34,153, 89, 98,187,119,222,125,135,218, 16,196, 17,166, 63,164,200, 74, 4, 1,197, 56, -163, 55, 76,105,247, 55,105,198, 49, 74, 41,182, 78,159, 99,229,197,215, 59, 55,195, 40,152,174,183,236, 14, 4,230,125, 14, 44, -101,165,153,217,187,159,203,110,186,137,235, 94,240, 60,150,143, 28,161,168,140,147, 33,138,192, 31, 7, 78,156,109,234,197,159, - 10, 17,143,221,135,138, 18,135,150,120,211, 12, 33, 20, 50,105,145, 28, 57, 73,186,113,122, 42,173,116,247,140,156,122, 41, 88, - 15,137, 75, 21, 16, 70, 77,231, 38, 23,132, 83, 89, 91,245,169,207,242,129,127,248, 19,158, 73,157,155,169, 84,158,204,107,220, -180, 29, 7, 46,183, 34, 43, 13, 91,105,197,184, 48, 84,198, 48, 41, 44, 69,229,206,207, 80, 40, 38,147, 9,121, 94, 18,133, 18, - 97,161, 17, 58,137,175, 8,133,147, 14, 27, 55, 84,170,216, 34,195,218,112,201,165,178, 9,223, 1, 89, 13, 69,233,119,233, 5, -228, 57,164, 41, 20,133,107,130, 3,227, 50, 49, 94,255,195,255, 14,101, 12,223,190,247, 30,238,190,231, 94, 46,172,175, 59,166, -190,159,143, 2, 1,177,146,168,151,221,210,186, 61,178,138, 0,103, 77,103, 44,204,239, 63,201,247,191,229,111,176,147, 45,226, -217,125,136,249,121,194, 68,115,238, 11,159,166,125,233,101, 44, 63,239, 86,190,252,170, 87,242,119, 15, 12,120,252,158, 71,248, -141,255,241,123,252,217,155,222,194,115,174,233,178,239,166,235,185,239,147, 95, 71,156,121,140,246,161,131,236,189,234, 50,238, -254,196,151,233,149, 26, 43, 3,158,184,247,126, 78, 28, 62, 4, 85, 74,210,104,162,148, 34, 9, 3,132,177,236, 93,217,135, 8, - 36, 85,153, 57, 91, 85, 93,113,252,178,227, 92,255,227,111,194,166, 35,103,144,128, 65, 37, 29,143,246,134, 20,131, 30,194,135, - 63,148,163,129,219, 79,169, 96,234,101, 92,101, 5,201,204, 60, 58,207,177, 85,142,138, 26,160, 75,130, 36, 38,159,164,116,150, -246, 59,136, 39,108, 48,217,218, 98,225,240, 97,178,241,136,114,146,211, 93, 88, 98, 50, 30,121,247,170,148,217,197, 61,140,182, - 71, 20,197,132, 65, 47,101,105, 62,194,170, 54,189, 94,159,149,125, 51, 12, 83, 75, 86, 24,132,201,105, 39, 9,163, 82, 48,223, - 84, 20, 70, 49, 46,114,218, 81, 72, 20, 68, 68, 65, 76,158, 87, 68,161, 68,163,233,196, 49, 87, 93,114, 37,221,165,101,242,162, -207,100,156,114,242,218,231,113,250,145,187, 56,118,234, 6,138,241, 16, 21,132, 8, 5,131,181, 13, 58,243,203,204, 28, 88, 33, -189,176, 74, 60, 51, 75, 89, 20, 84, 89,198,252,129,253,252,218, 79,190,136,199,214,159,228,231,126,229, 61,156,125,248, 94,190, -251,182,239,224,191,127,228,147,220,250,226,151,178,231,242,171,184,249,248, 65,238,184,243,107, 88,229, 53,147,158,220,102,167, -218, 98, 65,229,167, 56, 33,107,231, 47,215,201, 54,172,100, 78, 72,102,165, 32,206, 70, 68, 85,133,139,214, 17, 83, 9, 28,194, - 57,239,249,147,222,237,215, 37,222,147, 93, 76, 89,162,211, 26,235,249, 13, 98,183,227,152, 47,190,211,237,237,244, 53,220,172, -231,224,239, 29, 54,189,144, 59,178, 43,118, 21,171,122,100, 20, 72,191, 14,216,217,163,215, 5, 67,248,149,129, 48,255,186,204, -136,105, 51,226, 10, 38,207,218, 49, 11, 33,188,116,139,233, 7, 23,114,167,137, 97,103,128,197, 90,193,248,193,135,233, 92,250, - 28,108,171,133, 53,181,254,196,233,170,119, 55, 50,198,136, 41,132,111,173, 32, 8, 67, 84, 51,161,209,108, 99,183, 83,122,119, -124,157,193,221,223,102,244,196,105, 76, 94,236,192,248,158,209,104,167,214,172, 59,252, 1,215,180,137,233,148,172, 2, 63,249, - 75, 57,109,136,166, 5,190, 54,134,113,111, 6, 17,184,152, 58, 99,245,180,112, 27,171,221,245,241, 59, 78,177,123, 95,110,236, -174,164, 94,127, 15,217, 29, 95, 92,233,179,166,107,184, 85, 32,118, 60,185,189, 94, 87, 40,151,200,231,174,167,153,218,201,154, -241, 8,125,230, 33,212,233,251,104,245, 87, 73,182,158,166, 57,188, 64,179,119,129,230,246, 25, 90, 27, 79, 49,187, 56, 79, 26, -182, 49, 69,233,101,115, 46,250,211, 26, 31, 23,235, 45,131,247,236, 93,226,192,229,151, 32, 66,137,136, 91,211, 6, 11, 79,160, -148,141, 6,194, 58,193,164, 41,114,202,225, 22,229,164, 36, 8, 3,130,174, 51, 0, 42,211,140,167,239,185,143,249,195,251,232, -204,207, 96,202, 49,198,184, 0,155,108,216,119, 33, 42,217,144,114, 82, 32, 48,100,253, 13,168, 12, 85, 49, 33, 27,143, 41,134, - 19,210,113, 74,127, 99,155, 50,207, 25,110,110,145, 13, 6,100,163,148, 42,207,157,190, 95, 8,210,254,152, 48,136, 41,243, 28, - 43, 32, 31, 12,200, 6, 35,103,121, 59, 30, 67,101, 72,230,231, 9, 76,142, 20,130, 86,148, 48,204, 50, 54,139,156,163,205, 6, -129,117,242,183, 72, 10, 2, 33, 9, 3, 73,216,140, 9,146, 38,170,213, 36,156, 93,100,245,236, 83, 68,177,147,142, 69,113,130, -204, 11,170,188,116, 40, 69, 94,145,229, 48,121,228, 81,150,102,218,156, 43, 11,236,160,100,241,133,167, 80, 6,100,160,144, 65, - 56,101,168,215,197,221,178, 11,129, 17,194, 69,215, 86,149,215,181,239,172,108, 4,214,135, 11,213, 77,172,117,201,108, 79,222, -143, 74,154,168,102, 11,171,164,143,105,149,200,230, 12,201,193,139, 24,111,157,113,176, 60,187,154,106,239,153, 80,223, 99, 74, - 69,200, 40, 33,140, 18,100, 24, 67,101, 40, 77,133,185,253,119,248,131,213, 47,161, 75,135, 70,137,218,250,213, 63,206, 70,184, -103, 73, 36,109, 70, 69, 69, 90, 84, 76, 10,231,236, 87, 84,142, 88, 90, 20, 37,101, 81, 17, 7,138,216,203,102,149,132, 32,176, -222,225, 77, 56,228, 83, 9,100, 4, 65,232,152,239,177, 55,162, 65, 58,175,248, 70,210,112, 49,191,133, 37, 43, 92, 65,119, 52, - 7,225, 16, 82,229, 28, 55, 31,186,231,155, 12,122, 91,204,237, 89,230,250,155,111,230,248,137, 19,220,119,255,131,211,126, 57, - 80, 78,149, 36,181, 5, 17, 88, 34, 33, 72,148, 34,110,182,120,213,219,254, 25, 61,122, 6,107, 53,249,246,121, 68,235, 48, 98, -227,107,252,227, 47,191,135,163,175,251, 85,178,123, 62,197,124,171,228,120, 51, 36, 93, 88, 96,207, 11, 94,200, 86,127,204,252, - 21, 63, 8,139, 7,185,232,210, 54,119,126,227, 12,102,227, 41,250,103, 46,208,233,198, 52,132, 96, 61,117, 94,206, 13, 81, 18, - 34,137,226,136, 86,179, 65,216,104, 18, 53, 19,198,233,152, 42,175,136, 26, 49, 97, 51,166, 55, 24,113,235, 27,223,132, 30,143, - 48,198, 56, 27,219,164,141, 46, 11,132, 80, 84,233, 8,163,115,103, 80, 49,153, 16,196,177,151, 87,184, 91,165,156, 84, 68,173, - 6, 86,107,210,237,109,170, 50,199,228, 99,194, 48, 32,110,118, 88, 60,116, 17, 85, 89, 98,133, 98,188,177,198,254,203, 78,178, -125,230, 25,218,115,115, 44, 29, 57, 74,111,125,205,201, 96,168, 88,218,127,144, 81,111,224, 96, 28, 21, 51, 59,211,100,126,229, - 40,166,146,172,236,159, 71,151,150,118,210,160, 27,133, 44,118, 26,204,180,230,104, 5, 22, 33, 67,146, 40,102,161,157,208, 77, - 18,246, 47, 44,129, 81,164,186, 96, 92,100, 36, 65,192,129,165,101, 58,157,121,132,132,116,216,103, 97,121,133, 97,239, 2,243, - 11,135, 40, 38, 3, 31,112,165, 25,109,109,147,180, 59,204,236, 91,100,178,185, 70, 99,105,145,170,170,136, 27,146,249,125,203, -252,225, 79,125, 23,195,222, 6,132,130, 95,122,215,235, 57,112,229, 41, 70, 42,225,103,126,234, 71,248,223, 31,254, 75,154, 71, - 79, 97,198, 41,175,253,217, 95,199, 71, 93,251, 48, 2, 71,246, 80,190,144, 6,245, 1,235, 13, 19, 2,220,141, 21, 41,136,173, - 99,132, 6,214,151,115, 63,117, 91,233,101,223,218,238,120, 51,120, 35, 18,140,120, 54, 12, 92,167,121, 25,166,185,213,211,233, -217, 23,231,154, 69, 42,216,241, 40,183, 53,129,149, 93,198, 80, 62,198, 85,238, 58, 73,220, 36,233, 52,211, 83, 43,211,218, 53, - 78,236, 16,186,234,215,180,117,232,251,174,148, 49,166, 19,248, 78,153,183,254,240,112,147,151, 39,220, 73, 87,236,165,159, 72, -157,201,133,220, 41,140,190, 1,176, 18,206,127,244,227,140,190,240, 21,146, 32, 38,153, 93,164,177,247, 0,241,236, 2, 97,163, -131, 8, 99, 84, 20,211,104,197, 52,163, 16, 81, 65, 92,105,138, 7,158,160,247, 15, 95,224,220, 71,254,158,245,127,254, 50,197, -120,132,174,229, 8, 72,183,134,242,230, 2,182, 94,144,123,244,162,214,227, 11,235, 99, 84,237,179,137,140,181, 26, 97,234,248, - 86,163, 30,254,122,200, 64,121, 65,173, 83, 74, 96,156,227,156,156, 46, 77,132,207, 81,247,247, 64,229,167, 44,255, 58,211, 88, -214,154,124,199, 14, 91, 30, 99, 92,115,230, 27, 33,103, 66,227,223,159,118,136,130,209, 53,115,179, 38, 36,121,237,187, 5, 51, - 25, 35,210, 33,182,183,137, 24,111, 35,179, 20, 81, 86,140,238,252, 60,123,142, 29, 67,132, 33,152,146, 42,203,208,121,233, 38, -244, 34,159,250,191,239, 63,178, 7, 17,198, 16, 38, 16, 52, 61, 9, 2,100,152, 32, 67,185,147, 47,142, 6, 83, 32, 27,109,178, -222,134, 67, 98, 66,133, 41, 11,202,254, 6,149,214,116,230,102, 49,101, 78, 57, 25, 81,165, 27,110, 85, 97,115,172, 46, 65, 5, - 4,145,162, 28,245, 17, 65, 72, 81,102, 20,147,140,124, 48,100,212, 31,208,223, 26, 80,228, 21,233, 56, 37,155,100, 12,135, 25, -163,254,152,173,245, 62,195,113,198,133,115, 91, 20,149, 97, 56, 28, 50,236, 13, 25,109,110,144, 79, 38,164,163, 33,195,254,128, -241, 36, 39,203, 50,180, 41,153, 95,154,231,224,225, 5,150,246,183,105,197, 17, 74, 6,104,191, 38, 50,194, 41,154,172, 48,158, -139, 89,185,142,184, 2,107, 43,130,112,134,116, 48, 96,178,213,103,188,213, 71, 7, 18,202, 2, 83, 20, 52,218, 77,218,203, 75, -108, 84,154,204, 90,148,182, 84,163, 49, 91, 79, 60, 77, 54, 26, 80,166, 41,186, 72, 49, 69,134,169, 10,199, 19,168,252,250,200, - 48,157,218,153, 54,199,245,253,227, 31, 86, 15,239,216, 90,181,130,191,103,139,220,237,254,240, 5, 93, 56, 57,100, 50,179, 48, -117,131,179, 86,187,103,219,122,225,120, 93,208,125,113, 7,135,182, 9,165,220, 97, 23, 40,182,127,246,231, 56,183,127,150,188, - 50, 88,229, 28,225,140,117, 62, 13,149,177,100,165, 97,148, 27,210, 82,161,154, 29, 10, 33, 73, 11, 77, 86, 26,202, 90, 65,100, -221,123, 12, 37,206,105, 46,112,111,181,242,183,188, 68, 58, 72, 93,187, 84,203, 48,112,207, 95, 24,185,157,186,244, 77,123, 28, -133,116,219,109,172, 81,206,208,175,128,170,180, 84,149,123, 14,149,176, 4,214, 53,100, 39, 47,190,136,147,151, 94,198, 37,151, -156,160, 42, 74,158,124,234,180, 51, 36,210,126,213,229,165,166,129, 17, 22, 93, 66, 32, 20, 21, 5,255,225, 55, 79, 99, 71,167, - 81,170,225, 72, 37, 97, 68,181,189,197,249, 51, 99,126,234,211,127,128,213, 79, 35,155, 51, 60,244,208,136,243,195, 30,239,187, -255, 81, 62,249,234, 87,243,179,111,255, 17,254,252,251, 95,205, 15,252,214, 91,216,251,188, 23,115,236,241, 85,190,244, 39,255, -192,141, 63,189,200,203, 94,125, 27,189,223,253, 8,103,183, 13,179,157, 14,127,251,181,251,248,237,255,248, 26, 62,249,181,111, - 82, 86, 21,189,237,109,230,186, 77,202,137,101,189,159,114, 52,154,193, 20, 49,111,120,231, 47, 83, 25, 67, 16, 52, 48, 38,199, -138,157, 12,104,171, 75,208, 21, 66, 4,232, 34, 67, 72, 23,101,170,194, 0,157, 87, 46,130,211, 20, 24,155,160,203, 28,155,231, -116, 14, 30,167,154,140,221, 97,129, 64, 68, 77,236, 48,101,184,182,202,190, 43,175,102,227,225, 71, 64, 42, 26,243,139,172,222, -247, 16, 18, 73, 49,153,176,231,162,163,172, 63,179,206,194,254,125, 12, 54,122,116,103, 23,168, 90, 13, 38,227,140,118, 91, 49, - 25, 43, 22, 23, 23,216,234,107, 90,121,159, 72, 45,177,209, 31,178, 56,211,196,152,144, 48, 78,232,141, 32,140, 91, 28, 63,114, - 25,143,159,255,103,164,112,134, 63,141, 36, 98, 60, 54, 16, 54,200,243, 1, 70, 27,230,150, 87, 72,135, 27,116,103,150, 48,166, -196, 68, 1,101, 89, 16, 37,109, 58,123, 22, 16, 42,112, 4,234, 36, 6, 51, 33, 74, 58,252,229,219, 95,195,198,249,115, 46, 17, - 74,187,233,251,189,159,254, 32,111,126,197, 27, 88,186,252, 58,206,191,239, 67,152, 34, 99, 99,125,204,169,203, 15, 80, 25, 23, - 9, 88,231,110,200, 26,169,113,196,108, 52, 14,142, 50,214, 71,155,122, 15,247,142,130,216, 56, 11, 89, 91,251, 26, 90,247,251, - 58,216,195,238, 2, 87,157,108,203,122, 77,248, 78,100,103, 61,130,215,224,235, 78, 10, 24,254, 65,221,193,202,119,179,167,173, -135,204,217, 69,188,219,237, 2, 49,109, 44,180,192,122,103, 39, 60,113,111,186, 19,174, 27, 6, 95,248,108,205,250,158, 18, 91, -236,174,230,163,102,246,219,233, 52,234,199,213,233,158,182,126,239,102, 10,244, 59, 72, 77, 5,206, 18, 21,229,119,201,194, 50, -121,250, 28,171,207,124,220, 31,112,138,160, 21,123,105,159, 64,104,131,173, 74,116, 94,120,248,218, 31, 32,120, 7, 55, 81,175, - 50,132, 7, 65,236,212, 92,199,133,169, 40, 95,235, 93,232,196, 20, 0, 8,188,153, 16,142,149, 62, 45,174, 82,248,108,241, 41, -241,223,193,129, 8,159,133,110,166, 13,178,240, 50, 64,163,119,125,135,194, 31,204,210, 69,141,202,192, 53, 52, 83, 54,187, 20, -211, 98, 45,188,169,135,216,181,125,169,155,139,186,176, 79, 29, 56,118, 33, 57, 94, 13,231, 14,233,157,155,192, 93,229, 74,239, - 32, 5,224,253, 41, 44,193, 99,223, 36,238,236,165, 20,150,114, 52, 68,107,111,150, 99, 53,101, 86,177,111,207, 12,243, 39, 47, -193, 20, 5, 76,250,136,184,242,136,137,132,168,233, 38,116,173,177, 85,142,176, 6, 83,102,152,178,194, 58, 11, 53,103,242, 80, -142,208, 85, 69,107,182, 3, 85,202,100,107,136, 48, 14,141,172,170, 2,101, 52,149, 73,177,194,241, 96, 76, 54,114, 81,154, 66, - 81,166, 25,195,222,144,237,245, 33,253, 97, 78,156, 4,104, 3, 10,203, 96, 48, 33,155,228, 72, 96,116,110,196,210, 98,131, 42, - 47,166,169,110,162, 55,162,211,113,103, 51, 34, 68, 6,129, 35,153,142,198,142, 63, 80, 89, 26,221, 22, 43,251,231,201, 86, 13, -147,202, 16, 84,134, 72, 8,140,128,170, 82,236, 2,192, 28,105, 47,205, 80, 71, 46, 35,253,214,167, 16,203, 49,162,183, 69,216, -237, 80,233,138, 80, 24, 84, 43,100,118,255, 2,102,118,150,115,253,161,203,172,239, 52, 56,253,161,207, 49,251, 43,175,163, 72, - 71,136, 48, 34,244, 49,211,110, 98,246, 92,120, 21,184,103,223, 91,165, 9, 79,220,152,174,121,208,110,154,181,181, 50,163,142, - 0,214, 14, 65,171, 57, 29,190,233,180, 90, 35, 91, 45,236,104,136, 54,154,192, 59, 18,214,247,164, 53,210,157, 31,218,122,174, -136, 99,251, 11, 31, 4,211,191,251,171,112,239, 19,124,240,176, 83, 71,153, 18,239, 64, 40,208, 62,147,188, 20,160, 75, 67, 86, - 77,232,157,126,134,113, 86,144,230,198,121,167,216,169,235,197, 84,184,145, 21,213, 52,168,165,134, 23,181,118, 23, 56,142,160, - 17,187, 92,117, 25,184,124,118,231,108,227,204,188,242,162,162,215,219,102,156, 26, 76,102, 49,133, 69, 26,167, 96, 64, 8, 66, -227, 24,245, 45, 41,216,179,184,196, 99,143, 63,198, 35,119,220,193,184, 50,228,254,156, 82,210,157,213,210, 63, 76,234,182, 27, - 26,183,135, 82, 33,172,230,135,254,223,111, 17,137, 12, 33, 2,103,214,159,143, 16, 74, 81,244,214, 89, 56,126,130,251,255,236, -247,233,200, 13,190,254,123,127,196,245, 47, 62,193,167,191, 50,224,133, 63,254, 90, 58,219, 15, 18,180, 34,110,121,247, 95,240, -169, 31,254, 30,102, 14,236, 99,255,169,203,176,197,152,115,247, 62,140,221, 56,195,185, 39,214,120, 36,131,211,253,140,131, 51, - 9,159,191,243, 33,110, 57,117,156,205, 81, 74, 51,138, 89, 88, 90, 34, 43, 12,157,134,224,200,165,167,104,116,219,156,120,225, -243, 29,137,160, 24,131, 12, 80,210,105, 91,109, 85, 97,242, 9,214, 90,202, 73,138,138, 99,148,140,177, 86,184,189, 83,224,110, -164, 32,110,160,226, 6,227,181,243, 44, 28, 63, 73,186,190,238, 37, 65, 22, 21, 37,156,127,224, 62, 26,115, 29,102, 14, 28,166, -119,230, 9,242,126,159, 61,207, 57,201,246,153,179, 4, 73,204,112,109,147, 99,215, 95,205,234,163,103,232,206,118,201,198, 25, -141,110, 7, 83, 26, 71,162, 51,150,102,187, 67,163, 25, 80,104, 75, 51, 50,204,118, 22,233,206, 47,177,119,105,158, 70,212,101, - 97, 97,145,202, 86, 8,173,217,191,255, 8, 75,123, 86,184,247,209,111,250,169,212,210,109,118,185,238,242, 27, 9, 27, 32,164, - 38, 76,186,204, 46,204, 98,181,128,200, 25,110,116, 22, 23, 8, 84, 76, 16, 75, 90,115, 75, 24, 12,157,165, 57,132, 13, 9, 26, -109,254,247,251,222,193, 93, 95,252, 12, 69, 77, 74, 83, 14,182, 51,128,138,218, 92,119,233, 73, 26,213,128,229, 19,151,243,228, -167,255,134,197, 99, 23,113,102, 48,228,153, 11,103,119,100,104,190, 0,123, 98,120, 13, 82, 19, 89, 39, 93,107, 88,193,130, 84, - 44, 40, 69, 91, 5, 36, 72,130,169,188, 73,120, 98, 85,125, 80, 72, 31, 4,226,160,204,186,200,107,111, 71, 90, 79,192, 53, 57, -207,213,166, 29,194,218, 46, 79, 20, 31, 50,194,179,166,252,218,163,172,222, 7,215,133,214,201,171,124,106,152,172, 77,227,124, -135, 47,120,150,209,205, 20,250, 83, 59,159,193,237,136,119,246,225,198,248,120,209, 93, 70, 57,212, 69,107, 58,201,123,231, 53, -185, 3,221,163,228,180,129,169, 89,248,120, 27,200,122,239,111,141, 99,127,187,123,185,192, 22, 5,186, 40,208,229,191,202, 44, -223,253,231,252,231,182, 98,151, 71,155,113,223,245,148,145, 46,197,179,152,238,136, 93, 59,115, 47, 37, 68,136, 41, 3, 93,212, -112,183,221, 97,168, 83,155,198,120,178, 31,181, 81,141, 39, 14, 78,247,234,117,203, 81, 91,254, 42,249,236, 21, 74, 77,198,171, -181,240, 74, 60, 91,254, 86,127,223,102, 23,217,193,218,103,185,126,213, 95,190,173, 25,151,236,164,200,185,230,206, 76, 63,175, -245, 13, 65,126,254, 41,186, 87, 60,151,209, 96,224, 78,105,173,153, 76, 82,242,209,136,108, 50,230,226,139, 86,232,238, 95,198, -244,207, 59,254, 66,205,191,145,210,217,204,234, 12,170, 12,116,134,169, 52,182,210,216, 60,101,184,186, 74,107,105, 17, 97, 10, -202,209,128,178,180,100,227, 33,161,205,176, 58,163, 42, 43,108,153,163,179, 2, 99, 5, 85, 81, 34,195, 16, 43, 4,249,112, 68, - 54, 74,209, 6, 70,189, 17,107,231,182, 57,243,204,128, 65, 89,209,235, 21, 60,120,174,207,211,235, 67, 30, 89, 27,113,102, 84, -241,205, 11, 35,198,165,102,117,123, 66,145,151,156, 89, 31,179, 61, 44, 24, 79, 74,214, 55,199,108,246, 38, 84, 69, 65,145,151, -200, 64, 81, 20, 37, 32,169,180, 96,156,166,206, 57, 10, 16,121, 70,104,156,221,105, 44, 29, 25, 44, 8, 3, 26,157, 22, 65,171, - 67, 48,211,198, 38, 93,198, 97,192, 96, 48, 64,102, 35,180, 10,136,162, 8,225, 61, 75,130,184,225,144,149,110,151, 39,239,252, - 54, 51,141, 6, 97, 40,232,175, 14,152,185,234, 40, 66, 73, 84, 16, 57,102,185,220,145, 71,214, 4,216, 29,206,197,180,133,223, -185,159,141,247, 30,112,113,140,174,129,211,238,153, 82, 79, 62,136,106,205, 32,226,216,239,212,193, 84,134,230,145, 75,177,121, - 78,154,110, 56,254, 76,125,239, 24,235,164,130,149,198, 26,131, 82, 49, 97,220, 32,108,117, 93, 20,112,105,185,235,138, 91, 56, -249,186,215,241, 59, 95,251, 75, 39, 97,171,117,230, 53, 26,101, 65, 91,215,112, 84,218,144,229, 21,147, 66,163,117, 61,201, 51, -101,172, 72, 95, 72, 3, 1, 97, 80, 35,117, 76, 11,127,162, 4,173,166,164,213,132, 40,118,177,220, 88, 8,189,191,187,173, 32, -203, 44,233,200,144,142, 12,194, 8,178,137,128, 74,130, 17, 40,227,178, 34,186, 74,210, 10, 36,183,222,122, 43, 50,137, 81, 65, -192, 40, 77, 41,170,202,103,187,187,243, 52, 16,238,188, 86, 47,189,185,125,187, 48,134, 87,190,229, 31,153,157, 95,112, 29, 62, -194,101,146, 11,133, 41, 38, 4,141, 38,195, 45,195,242,201, 69, 76, 60,203,224,203, 95, 36,220,187,192,139,126,252,245, 60,246, -199,239, 36, 90, 57, 64,107,101,133, 71,222,246,195,156,248,233,183,178,250, 87,239,103,245,155,247,178,117,118,155,243,207,140, - 57,122, 52,102,107, 96,120,106, 44, 56,151,150,204,198, 1, 15,246, 83,204,214, 58, 7,143,173,160,117,136, 38, 67, 9,193,202, -209,253,220,125,231, 3,188,226, 13,175, 66, 53,218,128, 33,236, 44, 32, 84, 72, 53,234,123, 88,207, 82,229, 25,101, 62, 65, 42, -137,214, 21, 50, 74,176,218, 96,242,146,176, 25, 33,163, 6,217,246, 38,213,120, 76, 50,219, 70, 70, 45,119, 72, 91, 77, 62,232, - 81,230, 19, 22, 14, 29, 36,234,204,177,245,212,147, 72,165,232,236,217,131,206, 50,138,180, 96,120, 97,157,165,131,123,153, 12, - 71, 84,121, 78, 99,166, 67,220,108, 48,220,234, 51,179,103,150, 34,203,105,119, 58, 68,141, 14, 81,123,158,222,153,117,154, 93, - 75,119, 97,145,238,220, 60,243,199, 46, 71,143, 54, 88, 58,116, 20, 81,142, 89, 90, 92,224,212, 53,207,227,238,175,125,145,178, - 28, 16, 5,146, 32,136,184,233,170, 91,105, 36,146,206, 92,135, 81,175,207,193, 75,142,163,141, 37, 8, 21,147,254,132,125,151, -156,192,218,130, 32,112, 33, 51,205,197, 69, 16,150, 70,107, 30, 66,203,104,123,149,255,245,174,255,196,216,251,112, 27, 47, 79, -203,188,169,201,225,195,199,232,246, 6,252,225,123, 63,198,203, 94,245, 61, 52,230, 98,146, 80,178, 77,204,131, 15,220,141, 10, -220,158,173,174, 89,202,223,164, 74, 72, 66, 36, 77, 33,105, 9,193,172,144,236, 13, 2,230,164,139, 74, 13,165, 68, 90,185,211, - 77, 91,235,119,197, 94, 63, 91,241,172,189,217, 20,250,181, 30,110,157, 14,196, 98,202,145,178,187,217,116,117,113, 48,187, 10, - 10,255, 87,110,169,159,186,107,104,221, 21,170,233,110,127,202, 36, 23,211,181,219,180, 65,176, 59,123, 92, 91,239,200,167,198, - 42,181,190,218,117,250, 18,225,167,225,122,111, 47,166, 36, 63,233, 11, 86, 93, 56,167,100,239,233,126,223,187,215,213,204,224, -154, 24,168,205,142, 78,155, 29,216, 81, 74,137,214,214, 79,212,118,250, 89,166,129, 43,211, 24,211, 93,187,233,186,113,120, 22, -111, 65,185, 98,172,148,231, 45,212,250,125,118,116,233, 59,238, 63,254,146,200, 93, 60, 0,187,219, 42,203, 39,222,213, 64,196, - 14,131, 93,248,148,181,233,190, 93,219,157,240, 0,177,235,215, 90, 25,225, 67,159,237,174, 34,204,116,159,111, 92, 67, 35,118, -125,137,117, 99, 50, 37, 47,214,231,247, 78, 8, 79,109, 52, 48,181,255, 69, 82, 62,246, 77,194,227,215, 50,220,220, 36,105, 54, - 25,110,110, 80,228, 57, 75, 51,109, 46,123,201,139,168,122,171,211,176, 25,215, 1, 6,136,168,133, 45, 70, 80,229,216,106,226, - 97,228, 10, 83,229,232,116,200,250,227,143,178,112,228, 8, 54, 79,201, 54,215,169,202,140,205,167,215, 8, 85,133, 82, 56,244, - 16,156,132, 22,227, 52,243, 85, 69,158,142, 41,243,146, 65,111,194, 36,205, 89, 95,237,113,110, 51,229,220, 32,231,194, 48,231, -174,115, 67, 54,210,146,213, 73,197,189,253,130,103, 38, 37,131, 18,182, 74,195,106,102,120,178, 95,176,154, 86, 12, 11,205, 83, -195,130, 97,238,146,189, 54, 70, 37,141, 64, 50,153, 20, 36,145,194, 10,201,184, 63, 2, 93,145,230, 37,219,163, 28, 91,104, 34, - 99,221, 62, 93, 41, 34, 43, 73,162,144,168,221, 34,108, 52,144,205, 54,133, 74,216,170, 10,218, 71, 79,177,246,237,127, 33, 74, -154,232, 74,211,153,105, 58,167, 64,165, 80, 42,164,189,184,151,187,255,233, 75,236,157,109,210,203, 74, 68,168, 48,167, 7, 52, -174, 63,234, 84, 83, 42,152, 62, 31, 86,136,233,176,224, 8,154,169,132, 28, 0, 0, 32, 0, 73, 68, 65, 84,203,114,103,149, 38, -118,206, 9,180,147, 26,218,186,168, 27,143, 16,101, 25,242,244, 35,168,206,140, 83, 55, 9,225, 92, 67,141,160,117,244, 82,244, -104, 72, 90,246,145, 74,237,202,113, 48,110, 24,173, 42,103,172, 21,183,136, 90, 45,130, 56, 66, 69, 93,190,114,197,181,236, 59, -122,144,211, 75, 9,159,121,228, 46,114,237, 13,177,148, 11,114,113,230,131, 98,154, 74,236,238, 81, 73, 24, 70,100, 89,181, 43, -105, 80, 76,213, 23,113, 20,208,233, 38,142,119,130, 69, 41,247,208,132, 18, 58,137,100,177,163,104,249,130, 30, 4,214, 33,102, - 62,243,162,172, 28,161,111, 60,180, 20,153,132, 66,184, 12,117,237, 24,239,210, 10, 66, 41,233, 68, 17,157, 70,204,125,247,223, -199,104,156,178,188,180,200,181, 55,222,196, 21, 87, 95,193,125,247,221,139, 12,156, 22, 94, 10, 73,172, 4, 50, 48,240,162,215, -253, 17,203,251,143, 97,138, 49, 53,136, 40, 60,129, 71,168, 24, 93,106,226, 86,196,214, 5, 69,243,154,155,185,248,123,175,231, -220,183, 31, 35,185,245,117,180,226,130,206, 53, 55,210,125,254, 15,209, 73, 42,246,188,240,229,220,240,231,159, 96,223,201, 46, -151,254,219, 23,243,188,231,207,112,224,187,111, 98,238,208, 60,139, 73,192,188, 48, 76,252,129,113,102,123,140,209,134, 81,182, -141, 52,146, 60, 79,217, 92,239,115,252,248, 1,146,238, 28, 66, 69, 8, 25,160,171, 2,132,165,202, 75,116, 58, 64, 23,169,107, - 62, 12,148,227,161,131,200,170, 28, 99, 53, 50,114,135,226,224,233, 51,180,150, 87,136,103,186,132, 51,203,140,206,157, 69, 79, -134, 20,233,144,238,129,195,116,246, 30, 68,107,201,240,194, 5, 58, 75,203,140,183, 6, 32, 20,218,184,116,158,165, 35,135,144, - 81,194,176, 55,102,118,239, 30,154,115,243,164,195,138,206,236, 44,197, 80, 51,187, 52,135, 8, 21,107,231,207,144,141, 55, 56, -120,242, 4,113,208, 64,197, 22,173, 20,197,214, 42,179,251,247,179,176,114, 49, 38, 31, 18, 5,154,193,198, 83,156, 56,190,194, -165, 7, 14,115,253,241, 75, 56,181,255, 0,251, 22, 22,105,116, 2,132, 85,172, 28,186,152,116,216,167, 51,191, 68,158, 78, 88, - 60,112,144,246,210, 28,166, 84, 68,173,136,112,102, 30, 25, 42, 58, 11,203, 88,233, 18,131,200,115, 7, 23, 97,153,120,211,160, -220, 39,129, 69, 81,192, 45,167,174,165, 26,110,240, 11,191,241,118,130,185, 46,171,159,255, 52, 34, 73, 88, 91,127, 6, 17, 56, -163,178,192, 79,232,177,179,111, 38,176,146, 72, 72,186, 74, 48, 39, 4,139, 74,178, 23,201,156, 80, 36, 82,144, 72,137,170, 33, - 89, 95, 56,167,149,153, 93,147,216, 84,241,100,255,111, 6,250,174,179,223, 65,129,150,103, 69, 45,152, 29,178,215, 20,179,221, - 93, 28,234, 61,251,174, 49,190,118,144,219,165,178,218, 41, 98,245, 20, 88,239,244,252,110,177, 78,121,171, 33, 62,247,179,214, -179,249,107, 56,218,127, 38,229, 57,182, 74,236, 10,129, 17,117, 76,146,219,164, 5, 62, 17,206, 10,223, 32,236,104,197,181,103, -220, 27,237, 72, 56,214, 79,215, 22,175,229, 22,194,169, 35, 37, 24,140, 79, 27,243,134,243, 53,140,237,119,164,181,139,157,245, -221,141, 84, 62, 44,165,206, 50,159,202, 15,236,174,204,115,235,141, 91,172,223,147,179,195, 68,183,222,205,110, 10,129,251,207, -110,156,209,139,172, 27, 16,111,222, 93, 75,230,116,169,119,190, 67,191, 83, 23, 22, 31, 53,229,161,242,210,165,216,200,192, 47, -254,234,247, 84,195,180, 66, 98, 43,127,205,181,222,213,149,153, 29,145,175,223,203,187,247,227,154, 36,180,223,197, 91,231, 37, -111,189,219,152,245, 73, 99,234,243,255,131,229,197, 5,170,178, 68, 10,193,133,181, 77, 14, 93,180,226, 77,126, 42,170,237, 53, -202,254, 26,229,230, 42,214, 84,216, 50,197,150,153,147,127, 88,192,148,232, 34, 69,103, 61,198,171, 79, 49, 94, 91, 71,216,138, - 50, 29, 81,101,125,198, 27, 91,244, 55,122,152,170,112,172,121,173,169,138, 18,141, 70,231, 21, 84, 57,249, 36,163,204, 42,178, -202,146,142, 11, 46,172,246, 56,187,145,178,214,207,176,194,242,149,243, 35,206, 23,154, 71,211,138,243,185,101, 37,137,249,174, -189,123, 57, 53,211,225,134,197, 5,174,152,155, 97,100,224, 92,105,184, 63,173, 56,155, 91,190, 53, 40,249,226, 90,206, 83,227, -138, 47, 61, 61,164, 63,202, 25, 14, 82,138,116, 68,179,233,140,186, 2, 36,137,132, 65,101,200,180,161, 48,150,172,172, 92, 1, -173, 85, 28, 82, 34, 21,100,227,140, 82, 24,148, 45,177,203, 39,153, 12,183, 24,143,134,244,251, 67,116,230,108, 86, 69, 96,136, - 67, 56,126,203,181,172,110,246, 17, 8,148,146, 60,243,196,147,152,123,207,145,230, 99,138,241,136, 98, 50,161,202, 38,152,162, - 64,151,165, 91, 91, 84, 37,214, 84, 24,227,166,104,170,202,125,183, 85,181,179,118,161,118,124, 52,160, 66,236, 51, 79,184, 70, - 75, 56, 25,103,253,221,139, 48,116, 35,174, 53,238, 59,211,213,212, 22,220, 84, 21,182, 40,166,247,132, 10, 3, 84, 16, 18, 36, -115,156,127,211,155,217,234,111,209,110,207,241,158, 59, 63,138,149,126,133, 35, 93, 1, 13,172, 59,215, 90,145, 66, 41,233,181, -225,130,133,133, 37,246,238, 89, 33, 14, 67,103,168,132,112, 83,185,245, 86,187,157, 22,237,168, 69, 86, 57, 98,167,182, 2, 97, - 37,205, 56,164, 21, 73, 26,129, 32, 82, 78, 30,167,252,128, 64, 33,176,149,196, 26,193,112, 32,152,100,130,178,112, 43,187,192, - 72, 90, 10, 98, 4, 1, 46, 91,163,219, 76,136,162,152,229,253, 7, 56,122,209, 49,150,247,238,103,107,179,199, 61,223,188, 7, -101, 5,232,218, 4,204, 98,133, 32,248,183,111,252, 11, 14, 92,116,163,227, 8, 71, 93,215, 58,120,137, 77,141, 97,170, 40,225, -252,227,143, 34,163, 14, 95,249,229,119,112,195,109, 71, 72, 90, 25, 73,178,198, 63,253,253,131,252,232,237, 87,179,241,209,183, -147, 92,123, 35, 52,247,112,215,111,191,141, 19,175,126, 7,233,249, 71, 9,247,104,170,198,113, 50, 30,100, 38,236, 33,165,228, -225,173,148,163,173,136,254,112,196,250,154, 51,111, 57,123,126,149, 35, 7,247,242,213, 59,239,227, 63,191,251, 29, 24, 25, 33, -116,133, 10,155, 84,222, 29, 43, 72, 26, 20,195, 62, 50, 40,145, 81, 19, 19, 40,162, 96,150,170,114,240,182,201,221, 94,175, 74, -199,204, 30, 57, 76,145, 14, 17, 82, 81,172,175, 34,164, 98,178,189,201,242, 21, 87, 50, 58,127, 30, 21, 72,178,193,144,184,213, -102,227,177, 39,233, 44,206,162,243,140, 32, 78, 16,113,196,246,249, 53,198,189, 13,142, 94,119, 45,235,143, 63,193,120, 48, 32, -110, 5, 84,185,197, 72,227,180,247,195,156, 75,175,190,140, 50, 55,228,153,165,181,184, 72,190,118, 63,182, 41, 33,154,167,204, - 50,198,155, 79,112,228,212, 53,228, 89, 73,210,158,103, 50,234,177,176,180, 68,179, 59,199,201,197, 61,232,170, 96,239,209,171, - 25,108, 12,152, 89, 92,228,233, 39, 31,193, 84,112,240,178, 43,104,204,118, 80, 42, 98,238,240, 10,217,120,194,204,226, 60, 97, -224,204, 65,164,117,246,106,186,116,251,182,202, 63, 19,133, 47,232, 26, 69, 20,183,184,232,232, 33,190,244,197,175,112,245, 13, -115,100, 15,125,131,203,223,250,219,160, 20,131,173,191,114,204, 85,107,161,112,222,219, 66, 10, 66, 43,104, 37, 1, 11,243,243, -136,209,136, 86, 86, 50, 35, 4,221, 72,209, 14, 4,137,144, 46,227,156,218, 93,204, 78,235, 71, 61,113,213, 93,248,179,228,107, -245,115,107,205,206,207,212,123,219,186,120,138, 29, 45, 91,189, 41,181,214, 78, 37, 98, 53,116, 44,107,239, 90,249,236,132,181, -169,183,188,223,231,154, 26,206,171, 11,243, 20,145, 16,211, 2,137, 39, 11, 90,179, 19,249, 34,165,147,147,201, 93, 82,185,250, -173, 73, 47,221,115, 69,174,142, 37,101, 26, 24, 83, 19,234,172,216, 21,100, 82,239,171, 13,126, 31,110,167, 5, 83,248, 15, 38, -119, 89,174,154,250,215, 93,205, 76,173,183,159,174, 39, 60,147,220,122, 19, 31, 93, 89,103, 71, 43,189, 44,173,254, 46, 48,211, -235, 99,173,143, 61,149,174,113, 53, 83, 68,221, 71,172, 42, 57,221, 47,214, 25, 1, 72, 7,239,153, 74, 79, 53,234,118,218, 52, - 89, 15, 55, 90,207, 20,175, 3,180,204,191,106,198,172,247,146,247,112,185,117,210, 56,231, 39, 47,156, 94,223, 95, 79,247,193, -141, 87, 17,236,110, 48,216,249,194,216,209,247,214, 77,137,177,181,215,134,207,104,215,110,223,206, 87, 63,198,226,209,203,104, - 92,124,156, 35,203, 77, 86, 78, 94,204,248,161,111, 80, 13, 86, 49, 18,200, 50,144,154, 36,155, 16, 31, 60, 49, 85, 43,160, 34, - 96,130, 41, 82,244, 56, 35, 29,244,153, 12, 39,152,116,132, 46, 38, 20, 85,200,104,235, 60,162, 50,228,233,152,102,123, 6, 99, - 4, 69,161, 29, 12, 95,148, 76,134, 19, 44,146, 73, 1, 89,110, 25,140, 51, 10, 3,227, 76,179, 85, 26, 62,242,120,143,110,224, - 2,143,154, 50, 32, 84,130, 84, 74,238,232,245,168,202,138,197, 73,198,177, 56,225,165,139, 11,168, 32, 96,179,204,120,172,159, -114, 94,231, 68, 74,176,150, 27, 2, 9,247,108, 78,184, 82, 73, 90,147,146, 78,199,208, 76, 98, 42, 11, 81, 28, 16,181, 18,242, - 52, 39, 43, 13,137,247, 34,177,194, 17, 39,141,245,105,141, 24,204,255, 33,235,205,163, 45,189,234, 58,239,207,222,207,120,230, -225,206,247, 86,221, 91, 73, 77,169,164, 82,153, 99, 2, 9, 36,160,128, 50,168, 56,161, 66,139,104,183,118, 59,188, 78,221,175, -195,171,104,175,229,194, 94, 54, 78,171,181,105,193,110, 20,151, 12, 34, 40, 74, 16,136, 96, 32,129,204, 33,115,170, 42, 53, 87, -221,249,222,115,207,248,204,123,191,127,236,231, 12,101,255, 81,171, 32, 44,110,238, 61,231,220,103,239,223,247,247,253,126,190, - 74,145, 38, 33,151, 58, 9,242,210, 6,135, 14,185,236,236, 73,156, 74, 9, 18, 11, 25,249, 72, 75,113,251, 91,223,204, 31,127, -245, 49,110, 45,149,232, 42, 69,193,115, 56,253,137, 7, 57,114,237,187,136,104,231,239, 99,254,123,155, 35, 99,135, 23,101,172, - 28, 94, 32,243,232,205,200,236,166, 71,127,107,173,208,182, 11,167, 94,134,122,221,196,151,173, 73,178,161, 52, 69, 51, 42, 29, - 93, 56, 65,153, 21, 85,154, 25,102, 61, 2,203,117,144, 72,220,250, 28, 91,127,249, 17, 30,252,200,255,225,218, 99, 71, 88,155, - 47,211,123, 53, 26, 61, 62,124, 75,224,216,146,138,107, 96, 51,122, 88,120,164, 53,177, 16, 70,245,232,236, 98, 97, 0, 51,227, -150, 66,243,253,196, 73, 74, 28,133,198,189,158,171,147,101,223,197,119, 4, 5, 55, 53,101, 46, 22,216, 66,147,196, 32, 51,129, - 74, 33,214,138, 48,132, 56,209,132,145, 1,191,233, 84, 80, 4, 44,164,145,232,209, 72, 45, 8,227,148,126, 24,241, 67,223,243, -189,172,173,175,243,216, 51,207,178,186,182, 74,148,166, 88,249,179, 76,229,175,115,170, 21,246,190,195,119, 27,214,115, 94, 49, - 99,170, 10, 83, 44,219, 39, 25,180,145,133, 18,253, 43, 87, 40,150, 43,232, 36, 98,254,230, 55,240,204,195, 95,167,178,176, 4, -178, 75, 81,131,163,187,156,251,210, 99,220,241,193, 63, 4,107, 0,131, 29, 68,103,157,221, 83,151, 56,127,174, 75,249,249, 7, - 57,114,243, 53, 92, 63, 27,112,233,147, 61, 58,169,133,239, 75,138,184,148,125, 88,107, 39, 44,213,235,108,109,247,248,246, 55, -220,141, 44, 21,232,183,214, 41, 79, 47, 17,108, 92, 64, 43,141, 91, 46,229, 89, 63,207,200,124,105, 10, 74,144,166, 61, 44,183, -132,214, 22,144, 96,251, 69,208,144, 6, 1,105, 48,128, 76, 97, 21, 76, 51, 91,101,126,158,141, 23, 94,193,182, 20,133,169, 41, -138,141,105,122,155,155,148,155, 53,220,114, 21,165, 52, 73,208, 35, 25, 4,128, 96,106,126,129,221, 11,231,137,163,152, 65,107, -135,233,229, 5,250,173, 54,126,177, 68, 18, 11,132,206,144, 5,159,160,211,165,187,183,135,214, 1, 75,199,110,161,219, 82,116, -119,206,163,173, 26, 59, 59, 91,212,231, 86, 40, 87, 75, 8, 75, 50,127,253, 45,204,107, 73,123,115,147, 82,173, 65,191,183,199, -250,217, 87, 57,250,218, 55,209,217, 94,229,174,239,127, 23,142,111,147,236,117,232,246, 6, 12,118,183,152, 94, 89,166, 88,113, - 40, 20, 61, 84,166, 13,124,194, 53, 31, 98, 33, 76, 46,114,184,239, 9, 50, 51, 81, 42,157,241,223,255,235,135,120,225, 67,191, -207,218,171, 87,184,241,194,243,212,190,235, 71,200,226, 30,150,244, 57,245,226,211,163,200,152, 51,236, 18,215,218, 52,176,105, - 65,210, 25, 80, 10, 18,234,150,160, 42, 44, 74,194, 72,119,182, 16, 6, 39, 60,169,144, 14, 87,169,234,234,230, 78, 49, 58, 25, - 76, 4,106, 24,133, 26, 26,139,133,209,162,198, 36,182,171,236,241,227,137, 95,231,187,222, 9,191,220, 88,214, 30,197,176,184, -234, 50, 97,228,230, 92,154, 31, 30,190,218, 56, 93,135,206,122,115,192,229,213,163,114, 88, 80,147,155,193, 36, 99, 16, 78,166, - 71,195,172, 26,181,151,233,209,107, 54,148,182, 13,151,122,210,192, 55,121,167, 25,201, 5,249,160, 58, 84, 27,204,197, 70, 98, -228,244, 97, 59,218, 48,158, 51,148,232,117,126, 1, 26,202,247,227,135, 75, 94, 99, 58,228,211,232,225,247, 54,129,126, 69,140, -100, 70,114, 52,165, 74,149,145, 51,135,253,233, 50,143, 19, 40,243,150, 73,203, 71, 91, 22,164,161,185, 28,137, 92,189,203,149, -138,209,123, 40, 13,104, 67,101,198,241, 59,202,242,231,147,245, 36, 4, 71,165,217, 40, 42, 56,169,230, 76,220, 82, 70,142,233, - 73, 51, 36,121, 23,187, 49, 99,142,211, 10,163,157,186,158, 80, 27, 68,174,216, 76,188, 1,233,153,231,241, 94,125,129, 3,239, -124, 23, 74, 70, 68,187,219,172, 63,246,117,138, 75, 11,148, 26, 62,131,237, 54, 73, 16,226, 76, 45, 34, 11,197,220, 12,224,161, - 11, 51,100,187,187, 36,131, 46, 73,183,203,244,210, 2,105, 28, 16,245, 35,122,123, 93,130,126,196,102, 43,162, 94,151,244,219, - 3,210, 84, 16,199, 41, 66, 42,194, 78, 76,123,187, 79, 34, 37, 65, 0,171,155, 61, 94,184,210,229,114,144,242,173,221,144,189, - 20,246, 87,125, 22, 27,117,234, 37,143,106,169, 64,193,181,113, 93,155,162,239,160, 51, 77,156,165,236,244, 67, 46,182,123, 68, - 91, 93, 86,108,155,239, 90, 88,100, 59,137,120,104, 99, 3,157,147, 44, 3, 5, 27,221,148,185,178,131,234, 71, 20, 10, 14,142, - 20,216,104,202, 69,159,237, 94, 64, 69, 75,148,210, 68,217,176, 44, 75,163,165,133,176,109,186,187, 61,116,165,142,176,125,102, -166,170,124,226,193, 53,166, 27, 53, 10,117, 69, 81, 72,170,137, 66, 74, 23,183, 92,199, 22, 9,223,254,125,111,226, 27,127,255, - 32, 11,213, 2,139,215, 44,115,230,149, 51,244, 62,254, 24,233,191,187, 27,217,235,153,115, 68, 74,236,171,122,203, 65,122, 2, -249,111,219,125,115,147,173,206, 87,163, 58, 77, 65,132,232,126, 23, 81,111, 26,245, 47,206,192, 49,132, 70,187,214, 64,245,187, -224, 58,208, 78, 76,213, 41,114,132, 13, 86,153,198,182, 61,132,130,226,242, 50, 23, 63,248, 1,190,249, 27,127, 72, 54, 85,230, -214, 91,238,226, 61, 39, 63, 78, 39, 76,200, 50,141, 99,131,101, 73,106,158, 69,201,178,113,165, 32, 22,166,169,207,182, 28,220, - 68,163,226, 62, 83,149, 6, 54,154,118,183, 71,146,105, 98,165, 81,169,185,136,244,250,129,113,168,231, 34,148, 84,154, 88, 37, -166, 12, 75,152,202,112, 41,161, 82,172,210,235,133,249, 74, 38, 35, 77, 37, 97,148,209,235, 67,156, 8,102,202,101,226, 65, 66, - 18, 37,160, 53,177, 18,230,210,137,166, 27,135,164, 74,241, 63, 63,250, 23, 52,234, 83,236,223,183,196, 93,119,222, 78,140,230, - 19,159,253,140,105,216,204,221,244,104,114,147, 93,150,128, 93, 32,237,108, 98, 21, 74, 72,203, 37, 13, 3,236,114,141,164,211, -161,187,125,133,198,210, 2,189, 43, 29,166,175, 63,129, 95,242,233,188,248, 25,104,239, 80,105, 8, 90, 79, 61,197,244,190, 38, - 76, 29,131, 23,254,142,153, 91,111,226,153,143,254, 5,213,197, 3,156,168,183,120,238,233, 43, 20,122,139, 52, 78,220,137,165, - 46, 16,105,141,210,146,141, 48, 99,163,157, 50,211,240,233,165, 41,150,208,156,120,237,173,244, 90, 45,202, 83, 51, 36,131,129, -201,234, 23, 74, 72,233, 19,110,175, 81,152,219,143,138, 18, 52, 22,105,216,198,173,214, 81,169, 66,165, 49, 78,209, 80,131,210, - 48,196,178,109,116,166, 41, 52,166,209,105,132,219,152,102,245,201,167,176, 93, 69,161, 49,139,101, 91,100,113, 72,150, 68,120, -149, 34,253,214, 30,105,212,167,177,188, 66,210, 11,137,195, 0, 28,155, 66,177,132, 16, 1,115, 43, 43, 92,122,229, 12, 65,175, - 79,146, 68,180,183, 2, 28,171, 79,127,111, 11,215, 45, 48, 59, 63, 67,154, 54,233,236,172, 51, 24, 64,117,110,133,242,212, 2, -133, 66,137,213,211, 79, 81,154, 94,164, 88,157,167, 49,187,132, 87,111,112,236,219,191,139, 52,142,200,162,132, 65,123,151,222, -246, 14,181,153, 5,202, 83,101,250,107,155,172,157,190,200,220,177,107,168,212,235,148,166,106, 8,157,145,102, 10,219,118,137, - 6, 29, 74,110,133, 88, 64,183,189, 67,146, 83,223,162, 12, 44,199, 34,201, 50,126,239,125,255,153,167,255,219,251, 81, 94,133, - 21,209,103,234,246, 59, 16,210,198, 82,235, 60,241,216, 21,132,101,110,210, 89,106, 36, 40, 91,152,105,209,206,192,138, 51, 68, - 18, 80, 22,146,146,101,254,248,128,173, 13, 89, 78,163, 13, 61, 65,169, 49, 65, 74, 77, 28,100, 67,136, 60, 54, 94,125, 25, 84, - 70,188,119, 33, 63,216,245,104,199,107, 36,228,124, 23,127, 21, 63,118,130, 67, 51, 68,148, 42, 51,211,203,145, 25, 45,159,124, -149, 30, 41,181,195, 97,143,137,189, 43,121, 17,141,214,102,223,165,244,196,238,117,130,128, 37,135, 46,238, 76,231,197,110, 35, -151,218,196,154,127,130,152, 38,198, 18,188,200,229,248,161, 44,174,153,104, 64,155,160,174,105, 61,194,219, 24, 51,225, 68, 52, - 76, 79,168, 28,122, 66,113, 24,250, 11, 70,164,186, 28, 50, 55, 84, 71,134, 7,250,200,213, 46, 38,238, 5, 19, 85,179, 82, 72, -195, 15,200,115,226,210,146, 19, 77,109,122, 28,213, 67,129,146,104,219,206, 47, 12,217,196, 46, 91,143, 92,249,194, 50,211,222, - 72, 14,159, 48,189,201,252, 53,209,122,226,226,164, 39, 46, 93, 90, 33,176, 70,200, 88,178, 92, 41, 24,195, 11, 70,153,241,145, - 36, 59, 68, 18,234,241,223, 82, 76, 92,178,212, 4,169,110,130,132, 39,164,141,206, 50, 22,223,251, 35,236, 62,250, 44,141,202, - 9, 54, 95,120,134, 83,207,236,113,230, 75, 87,216,104, 39,188,243,254,121,230,111,180,144,207,126,141,202,161,155,145,149, 42, - 90,122,166, 8,198,109,208,239, 94, 36, 76, 37,211,251,230, 72,194,140, 32, 52, 19,238,160, 51,160,181,219,229,197, 65,159,219, -239, 90, 32,234, 71, 36, 10,226, 32, 37, 73, 21,137,109,211,221,139,232,116, 19, 94,221,234,115,166, 27,115,166, 27, 83,240, 92, -238, 60, 50,207, 76,173, 74,173,232,211,172,215, 40,149, 74,212, 42,198,183, 99, 57,198, 7, 17, 70, 33,105, 26,209,235,247,216, -109,237,113,105,109,151,167, 46,108,176,140,228, 7, 14, 92,203,195,107, 87, 8, 8,105, 69, 25,115,197,140,118, 98,211,143, 67, -210, 52, 99,170, 94, 50,114,175,214, 68, 66, 18, 42, 77, 24,103, 72,223,193, 74,205,155, 33,180, 70,184, 30, 23,174,188,202,204, - 98, 3,219,115,217,217,220,224,231,127,233,167,249,243, 63,250, 16, 63,120,223, 77,172,118, 58,248,243, 83,216, 89,132,140, 3, -180,157,241,109,111,253,118, 62,245, 15,255,194, 84, 28,179,120,226, 58,206, 94, 94,227,229, 83, 47,114,207,131,179,116,223,114, -132,218, 32, 15, 98, 11, 57,118,222,230,192, 35,109,139, 28,192,146,127, 94,149, 50,239,191, 54, 7,187,182,108, 56,119, 18, 44, -219,124,222, 51,141,178,243,221,123,166,241, 74, 85,178,221, 29,212,252, 12,233,160,143, 93,208,104,140, 1, 84,197, 25, 58, 78, - 96,186, 70,113,121,153,111,189,249,123,216,248,214,203, 76, 93, 51,207, 77,135,143,243,103,189,231, 9,147,212,244,203,231,251, -115, 35,115, 27,108,178, 37, 36,174, 48,175,151,133,160, 90,144, 20, 60,159,106,109,150,181,244, 18,133,204,165, 21,165,244,226, -140,212,102,244,123,225, 72,115,225,206,253,150,164,153, 34, 82,130, 72,155,233,190,234,248, 20,203, 77,130,222, 38,105,144, 17, - 7,130, 32, 81, 12, 66, 65,191,175,241,109,155,130, 91,160,223,137, 73, 50, 77,162,243, 97, 68, 24,159, 84,152, 25,130,221,181, -215, 92,203,254,125,251, 88,152,155, 37,137, 66,206, 94,190,156,175,156,134,170,158,185,144, 27, 75,161,229,160,194, 54,118,117, -218,212,238,165, 9,168,140,116, 16,144,134, 61, 26,139,166,226,211, 42,248, 72,167, 64,187,171, 72,171, 55,179,243,240, 23,240, -143, 46,243,202,223,126,154,198,161, 69,226,147, 95, 71,150, 23,232,156,251, 23,142,188,237, 77, 60,250, 23,159, 98,249, 61,247, -113,227,254,253,124,237,179, 39,233,159,127,140, 98,185,192,238,222, 14,221,205,148, 56, 85,188,161, 82,162,213, 14, 72,116,200, - 29,183, 28, 67,105, 40,148,107,164, 73, 4,253, 30, 78,209, 80,226, 84,166,176, 11, 21,146,126, 31,203,245, 73, 7, 1, 94,173, -153,203,130, 10,219,247,205,154, 38, 10,112,252, 18,189,173,117,138, 83, 85, 52, 25,178, 82,165,119,229, 50,182, 99,211, 92,217, - 79,208,105,227, 58, 30,231, 31,127,156,198, 82, 3,116, 9, 21,103, 88,150,197,206,165,243,236,156, 89, 99,238,224, 18,245,133, -253,172,158, 58,137,214,154, 43,167,206, 35, 85,196,204,252, 62,162, 32, 32, 41, 41, 26, 51, 51, 44,223,113, 43,187, 23,119,184, -124,230, 44, 58,203,176,236, 2,197,114, 17,157,180,232,237, 72,108, 15, 14,222,118, 31, 89, 78,198,218, 58,127,146,238,250, 69, -252,230, 28, 74, 89, 84,230,167, 89, 62,113, 39,165, 74,149, 36,142, 56,245,240,147, 92,120,254, 57, 86,110, 56, 65, 18,165, 76, - 47, 78,209,222,222, 5,160, 58,211, 64,105,141, 99,151,205,112,105, 73, 26,243, 43,230, 63,231,168, 68, 75, 72,254,228,247, 62, - 68,114,230, 91,236,217, 14, 79, 61,242, 60,191,245,241, 63, 65,207, 47,147,156,254,103,220,195,111,230,211, 31,255, 13,148, 54, -152, 88, 68,222, 18,164, 5,142, 6, 79,152, 28,122, 73, 11,106,182,196, 71,226,102,198,100, 35,243,135,164,237,150, 72,163,158, -153,203,242, 73, 89, 90, 2,149,234, 17,108, 2,161, 17,110, 21,167, 58, 79,214,221, 25,159,111,195,195, 80,142, 11,100,134,146, -248,228,126, 92,140, 26,144, 24,237,114,133, 30,138,245, 10,153,229,166,175, 97, 20, 70,138,145, 36, 60,202,186, 14,243,215,249, - 87,204,178,177,140, 62, 2,202, 24,125,121,228,224, 30,221, 71, 84, 46,197,231, 49, 21,161,135, 82,182,188,218,193, 45, 52, 58, -205, 15,201, 97,123,221,200,141, 61, 54,248, 9,173,134,202,114, 46,241,235,113,129,133, 96, 44, 55,139,113, 27,218,240,159,105, -196,196, 20,170,209,105,190,130, 24,114,180, 70, 69, 45, 50,143, 15,229,146, 92,146,215,157,142, 88,248, 98,228, 43, 27, 54,213, - 13, 39,122, 35, 59, 26, 21, 3, 1, 58,234,161, 99, 53,234,202,213,249,164,111,126,223,134, 6,181,177, 84, 63, 60,188,181, 34, - 39,179,141, 95, 39, 61,241,158,140, 82,105,217,152, 85,128, 52,123, 72, 3,154, 25, 67,124, 70, 7,251,196, 14,126,210,168,167, -134, 55,191,225, 6,103,152,163,183,229, 68,140, 82, 49,247,131, 63, 67,177,228, 83,252,225,187,233, 60,252, 49,178,126,135,157, -118,194,233, 78,198, 55, 90, 25,207,127,238, 50, 63,250,106,151,187,223,161, 16,197, 50,238,212, 62,180,116, 72, 6, 3,176, 75, -164, 74,144, 96, 19,247, 6,216,165, 50, 73,148, 18,132, 10,219,119,217,237,197, 52,171, 37, 6,221,144, 65,144,152,135,121, 40, -216,222, 28,208,238,197, 60,115,177,207,229, 32,226,100, 39,101, 43,202,184,117,121,134, 27,246,205, 50,219,168,177, 48, 51,203, -220,210, 34,141,169, 89, 10, 85,115,160, 59,174, 71,154,166, 36, 73, 66,220, 31, 16, 70,125, 6,253, 30, 51, 51,109,154,141, 45, - 54,167, 27, 92, 90,221, 97,243,226, 6,247,206, 47,242,200,214, 26, 21, 55, 35, 73, 97,179, 23, 50,229, 25,179, 90,166, 52,174, - 99,145,101, 18,105, 11,186, 89, 74, 21,153, 19,206, 64, 91, 18,105,217, 72,203,103, 47,106, 51, 43, 4,210,118,233, 7, 61, 54, - 47, 92,224,221, 63,253, 62,254,254, 35,127,197,253,119, 30,101,187,221,103, 81,218, 72, 97, 35,138,130,222,214, 26,191,249, 59, -191,192,207,252,218, 7,233,126,234,243, 84,139, 5,240, 11,124,225,171, 95,227,157,149, 42,187,247,217, 84, 6,166, 17,112, 24, - 37, 27,117, 44, 8,129, 22, 78, 46,196,229,151,123,149,229,229, 69, 26,188, 50,250,217,199, 16,229,138, 41, 54, 26,245, 54, 64, -166,205, 80, 19,111, 94, 38,142,250,168, 44,193,169, 79,163,211,148, 44, 85, 72, 39,195,153,173,179,251,247,159,227,153, 15,124, -152, 66,179,206,192,119,184,126,118,129,203,215, 78,243,216,227, 95, 50,145, 71, 33, 70,166, 94,157,235,136,105,170, 40,250, 18, - 71, 88,164,194, 72,228, 37,199,166,106,107,156,104,139, 41, 95,227,227, 16, 43, 77,156, 14,239,235, 25,142, 52, 83,186,200,164, - 49, 75, 10, 53, 68, 30, 16, 41,141, 11,244,163,136,240,242, 6, 73, 63, 67,133, 6, 46,211,141, 4,189,208, 12, 16, 65,148,112, -105,107, 23, 21,155,108,125, 38,140,202,130,206,167,245,252, 25,121,229,220, 57,214,207,159, 51,141,139, 82,211,205, 52, 73, 78, - 5, 29, 54, 87,106,192,214,241,128,108,176,135, 93, 44,161,146, 1, 42,236, 35,221, 34, 72, 72, 7, 61,210, 48,194,118,205,101, -185, 52,179, 72,235,210, 57, 44, 15,202,135, 78,208,218, 93,229,190,159,253, 97, 62,254,107, 31,227, 77,247,220,138, 78, 19,236, -163,247, 83,219,247,207, 60,255,229,167,184,229,125,239,195, 46,245,176,117,200,103,158,111,113,251,225, 38,211,186,195,180,101, -110, 20,243,243, 13,164,157,210, 10, 67,250,253, 30,119,222,127, 15,221,110, 23, 95,153, 78,111,183, 81, 34, 9, 7,184,165, 10, - 58, 73,176,202,101, 6,123,171, 8, 89,198, 45,186, 99,215,114,238,186, 20, 82, 97,151, 43,168, 36, 67,135, 41, 94,173,201,230, -139, 47, 83,168, 27,134,115,121,126,150,221,243, 23, 41, 47, 52, 9,251, 3, 74,245, 42,110,161, 70, 58, 24,224,150, 37, 97, 27, -138,165, 34,254,177, 35, 84, 23,103,120,245,241,103,233,111,174,113,240,174,155,232,109,183, 73,147,152,181,111,125,139,149,227, -135,105,206, 79,211,217,221,225,217,175, 60,200,171, 79,175,226,198, 91, 28,127,235,107,200,130, 34,131,110, 8, 66,224,121, 18, -183, 60,139, 82, 41,131,141, 43, 68, 73,128,237,250, 44,158,184,139, 56,138, 89,184,238, 6, 44,203,226,226,183,158,198,241, 75, - 28,186,235, 14,166, 14, 44,113,236,254,123,144,104,250,237, 14,157,221, 22,245,185, 38, 89,150, 97,123, 30,225,222,158, 1, 96, -168, 10,153,180,169, 52,167, 41,148,171,164,237, 54,223,254,218,251,120,207, 79,254, 34, 47,125,228,247, 16,126, 13, 90, 17,239, -255,252,167, 9, 55,159, 71,189,120, 10,237, 20,248,234, 63,125,156,110,175, 67,150, 51,122, 70,174,238, 12, 92, 75, 80, 6,202, - 8, 42, 66, 80,194, 28,234,150,144,166,170, 85, 9,252,230, 10,182, 95, 34,220, 57, 79, 22,116, 71,210,244,176,206, 80,107,198, - 57,226,168, 69,180,125,154, 44,236,230,230,173, 9,186, 24,227,138,182, 76,233,124,167,207,168, 95,152, 97,165,171, 30,146,153, -212,232,128, 54,207,117,149,223,208,213,132, 73,100,120, 72,112, 85,179, 24,121,173,162, 16, 18, 50, 70,140,115,173, 53, 89,110, - 2,203,134, 66, 94,222, 2,101,217,140, 27,201,180,201,120,139, 92,110,159, 88, 42,143, 91,231,134, 19,177,252, 55, 2, 99,254, -218,100, 10, 44,103,194,131, 48,148,207,197, 24,137, 58, 50,167,137, 49,144,111,168, 98, 12,249, 56,195,152,152,210,250,106, 94, -250,208, 40,168,229,168,211, 89,140,202,106,134,101,104, 26,169, 76,188, 72, 41, 51, 45,139,209,190, 58,207,176,231,239,157, 16, - 58,135,253, 8, 84,156, 50,146, 57,254,173,108, 62,220,153,142,250,107,245, 40, 13, 49,146,206, 71,123,246,252,224,158,168,218, - 53,167,187,152, 32, 0, 50,118,218, 15,123,191,198, 18, 77,190,226,209, 87,193, 11,196,176, 68, 36, 39,220,233, 9,117,196,157, -191,150,202, 93,175,135, 44, 35, 91,125,133,157,103,158,229,241,135, 55,248,244,133, 14,155,177,102, 79,105, 46, 13,224,177, 71, -118,249, 47,235, 79,241,195, 63, 91,197,233,244,137,250,109,236,218, 2,221,205,117, 50,219, 99,111,171, 69,213,243,136, 90, 45, - 90, 23,175, 16,201, 34, 81, 47, 32, 65, 18,105,193,238,192, 98,119,179, 79,150, 9,206,172,118, 73,210,148,135, 46,118,120,165, -155,208,116, 28,246,226,140,123,175,157,227,230, 35,251, 88,154,155,103,105,113,153,133,229,125,148, 26, 13,188,106, 21,207, 51, - 40, 83,105,217,104,161, 73, 6, 33, 89, 28, 17, 12,122,244,219,109,122,237, 10,182, 95,192,247,125,138,174,195, 86,173,204, 75, - 39, 87,185,167, 57,207,191,238, 94, 97,198,183,105, 7, 9,221, 56,165, 28, 90,248,126, 66,165,228, 96,101, 26,207,150,116,251, -154,204,210, 6,180, 50,230, 53,147,101,154,173,176,199,145, 84,161,165,164,213,237, 81,235, 23,168,164, 9, 63,250,255,252, 60, - 31,253,131, 15,242,198,219,175,167, 32, 36, 83,117, 27, 41, 37,118, 65, 82,168, 20,249,197, 31,122, 51,127,244,201, 47,242,122, -191, 64,140,162,234, 56, 60,240,192, 3,188, 85,190,149,157,215,239,167, 26, 58,230, 96,183,204, 1,175,100,222, 22,168, 53,200, -156,147,154, 95,230, 76, 84, 57, 67,183, 46, 65,187, 11,197, 10,194,245, 70, 62, 27,149,195,105,132,235, 17,109,111, 34,202,154, -191,122,219,251, 40,215, 74, 56,229, 34, 5,219,161, 27, 39,244, 90, 29, 60,149,112,221,242, 10,210,245, 56,222,104, 82,184,233, -122,254,224,185, 79, 97, 33,176,108,105, 46, 16, 82,160, 50, 65,166, 76,225,150,231, 74,108,105, 83,244,108,100,146, 17, 89, 80, -116, 44,170,158, 71,217, 43, 82, 84,138, 29, 45,105,245, 83, 66, 11, 28, 27,226, 68, 97, 75,129, 47, 53,210,134, 32,213, 57,223, - 3, 50,105,120,239, 90, 65, 26, 43,210, 48, 34, 11, 5,189,129,162, 31, 64,144, 64, 26,155, 65,195, 64,106, 82, 92, 41, 13,203, - 64,154,222, 2, 71, 26, 21, 32,199, 74,225,153, 64, 11, 97,254, 71, 43,131,250, 54, 9, 90,195,146,183, 16, 88,191,253, 59,191, -246,219,194,114,140, 99, 52,127,218,233,200, 20,132,216,158,131,237, 58, 72,171,128,229,186,132,187,121,179, 89,169,140,237, 56, -116,182,186,180,119, 99,238,123,239,189,212,222,252, 43, 4, 15,127, 8,239,200, 27,232,190,252, 16,225,246, 54, 91, 15,126, 5, - 93,154, 37, 9, 35,118,207,174,114,101,125,143,247,252,192,173,124,249,185, 45,110,157, 46, 97, 85,170,236,180,251,196,177,226, -250, 67, 75,172, 28, 92,193, 45, 86, 40, 79, 79,147,244, 91, 56,165, 26,150,229, 96, 21, 10, 56,165, 26, 89, 16,225,150,202, 72, -203,194, 43, 85, 16,150, 67,150, 4, 8, 36,118,193,199, 46, 84, 9,118,119,240,106, 37, 44,175, 76,220,238, 98, 73,137,202, 50, -252,106,141, 52, 78,112,203, 30, 2,151,206,234, 42,221,237, 85,202,179, 13,194, 94,136, 78, 51,202,179, 83,232,252,161,184,187, -182, 70,119,125,135,230,190, 89, 90, 87,182,105,173,175, 82, 46,149,185,253,123,223,134,237, 87,121,229,209,231, 89, 57,182, 2, -177,195,226,202, 12,197,233,107,185,248,252, 51, 88,133, 2,171,175, 94,164, 49, 87, 37,232, 37,168, 44, 66, 10, 69,177, 57,139, -235, 85,168, 46, 45, 83,158, 91,100,230,218, 67,132,221, 46, 90,105, 22,174, 63, 70,109,110,150,104, 16,128, 22,236, 92,184,194, -233, 71, 31, 99,249,248,113,106, 51, 77,180,178,145,182,139,227, 90,120,133, 2,174, 95, 48,102,142,216, 92,207, 14, 31,187,153, -215, 31, 58,194, 93,111,255, 97, 30,249,245,159, 37,138, 50,250,238, 62,190,227,183,126, 21,101, 39,120,251,111,193,154,154,166, -181,113,133, 63,251,240,159, 16, 27,144, 20, 89, 30,181,178,181,160, 96, 9,166,132, 96, 74, 74, 42, 88,121, 54,210,198, 21, 50, - 47, 9,147,185, 1, 41, 54,249,206,168, 99,118, 96,121,206, 89,101,195, 98,152,241, 67, 67,163,200,162, 62, 74,167,185, 52, 45, - 70,251,100, 61,177,111, 21, 98,156, 95,159, 76,181,141, 6, 49,205,213,217,229, 17,244, 77, 92,213, 20, 38, 70, 18,242,120, 42, - 24, 70,211,134,110,243,161,155, 78, 11, 61,226,213, 15, 39, 1, 41,100,222, 96, 38, 71,138,239, 85, 44,107, 57,177, 54,144,114, - 36,253, 15,139, 95,134, 59,242,209,225, 55,113,190, 15,115,239,195,159,121,116, 74,235,113,204,108, 36, 85,171,137,184,159, 24, - 99, 55,135, 40, 90, 70,188,118, 57, 62,192,196,184,198,117,248,255,211, 66,143, 86, 3,106,212,147, 35, 17,210,194, 46, 86, 81, - 73, 56,118,210,231,223,159, 30, 81, 97,204,109, 64, 13,247,250, 8,180,206,198,239,153, 20,100, 57, 8, 10, 97,176,154, 99,249, -155,209,251,141, 54,208, 14,105, 89, 35,167,254, 85,105,134, 73,131,220,200,136,164,242,248, 97,110,122, 27,197,238,245,168,227, -102, 88,222, 49,132,219,140, 98,111,163,136,160,249,227, 52,103,169,223,114, 7,225,133,151,145, 8,190,250,167,127,205,103, 94, -110,113, 57,214,108, 37, 38,115,177, 29, 42,222,118,253, 60, 55,190,254, 54,254,246,211, 79,240,191,255,250, 49,102, 85,159,172, -183,195,250,234, 46,131,141, 77,194, 94, 72, 18,199, 88, 58, 99,175, 27,208,221,222,101,103,163, 71, 63, 81, 12,194,148, 94,183, -199,149,141,128,179, 91,125,158, 89,235,240,212,122,192,185, 64,209,180, 45, 6,169,192,118, 37,223,115,247,245,172,236,219,199, - 53,135, 14,179,124,248, 16,213,153, 57,202, 83,211,184,133, 42,205,185, 25,102,151,103,169, 54, 74, 72,219, 67, 99,225, 20, 10, -216,158,131,101, 25,168,144, 37,165, 49, 51,162,208,105,140, 93, 45,177,182,213,225,136, 95,226, 82,216,195,181, 37,105,126, 25, -174,184, 14, 66,153, 67,167, 27,105, 6, 81,194,156, 16,148, 29,155,122,209,199, 47, 23,177,107, 85,148, 87,229,155, 39,159,231, -134, 91,239, 4,101,115,230,236, 43, 36, 81,159,162,239,227, 21, 60, 94,247,221,223,203, 23, 62,247, 0,213,178, 67,213,113,177, -135,108,245, 56,225,218, 19,199,104,157,187,192, 11,235, 59,204,187,150,137,195, 74,201,171,167, 78,113, 34,173,211, 95, 40, 34, - 10,158,145,251, 39, 46,187, 66,143,213, 23,200,119,252,105,130, 46,213, 80,127,243,127,144,141, 6,194,245,176,139,101,148,237, - 34, 29, 7, 97, 91, 40, 45, 40, 46,174,208, 59,253, 10,238,194, 62,174,252,205,103,137, 43, 69,162, 52,163,110, 89, 68,105, 70, -169,104, 83, 42, 22,232,100,138, 69, 97,227, 31,157,227,211,123, 15,211,139, 82,131,126,213, 57, 61, 78,107,146,252, 51,104, 33, -169,149,125,106,158, 75,197,181, 71,213,205,190, 45,153, 46, 55,153,153, 93,130, 44, 99, 48, 8,217,139, 19,130,212, 68,231, 68, -238, 24, 42,122, 46, 40, 69,154,131,155, 44, 71, 96, 91,138, 74,217, 56,235,117, 44, 72, 34, 65, 47,144,180, 3, 77, 16,107,130, -216,168,118,230, 64, 7,199,113, 40,122, 46, 89,102,204,143,158, 20,248,210, 60,151,133, 4,199,177,177, 48,190,169, 12, 72,101, -142,160, 21,134, 90, 39, 1, 71, 8, 92, 41,177,222,255, 27,191,248,219, 66, 90,134,174,164,149,137, 16,216,142,217,175,150,154, -121, 76,199, 66, 88,146,160,211, 38,238,237, 33, 93,143,181,211,175, 50,125, 96,129,126, 63,229,220,183,214,241,218,207,114,242, -193, 47, 18, 93,126,217, 84, 37,118, 59,220,242,190,247, 98,245, 46,224,215, 10,156,126,113,149,207,158, 15,241,251, 1, 42, 81, -196,245,230,232,119, 59,140, 34,126,244, 71,223,129, 87,110,224,248, 22, 94,181, 9, 73, 64,101,126, 5,165, 83, 44,199,193, 46, - 86, 8,219,187,120,149, 50, 78,161, 48,186,237, 59,126, 1,165, 18,195,124, 23,166, 97,200,169, 77, 19,119, 91,164, 42, 38,108, - 13, 40,214,171,248,211,139,156,251,250,195, 52, 87,230,233,237,236,208,223,218,197, 18, 26,183, 88, 68,136,132, 52, 73,168,204, -206,209,186,180, 74,208,238, 17,118,219, 84,107,117,132, 82,180,214, 54, 57,120,203,245,236,191,237,102,206, 61,243, 18,171,175, -156,230,248,235,239, 32, 28, 36, 12,250,138, 44,234, 81, 46, 23,184,230,198, 19, 20, 43, 85,102, 22, 86, 72,130, 14, 94,209,194, -182, 93,252, 82, 19,167, 88,199,118, 37, 65,123,143,120,123,141, 36, 52,173, 72,142,239, 35, 29,139, 98,173,167,112, 97, 8, 0, - 0, 32, 0, 73, 68, 65, 84, 65,161, 94, 33,142, 34,150,142, 28, 98,233,134, 99,172,157, 62,141,214, 22,210,146,216,190,100,227, -236,101, 16,208,111,181,241,202, 37,132,101,118,145,205,133,101, 30,251,192,175, 18,124,243, 1,206, 94,220,227,208,253,239,224, -216,237, 11,216, 43,199,177,202,243, 36,171,223,196,146, 14,191,254,171,191, 64, 42,242, 67,201, 50,135,158,173, 48, 96, 25, 91, - 50,141,164,110, 91, 84,133,160,108,217,184, 58,111,116, 18,134,197, 45,133, 48, 17,146,184, 99, 30,240,154, 17,176, 1,157,147, -227,198, 96,178,177,139, 93, 79, 78,173,122,116,238, 12,255,202,148,185,221,170,220,220, 38,198, 9,101,115,112,143, 40,174, 98, -244,176,151, 19, 92,119,131,105, 29,243,229, 39,129, 52,227, 28,253,208, 60, 37, 38,128,113,227,157,245, 48, 95, 43,135,211,229, - 4,192, 37, 23,226,141, 75, 61,151, 20,196, 48,119, 63, 52,236,253, 91,231,126,238, 48,214,185,107,125,136,239, 50,107,107, 49, -193,159, 31,127, 79,195,181,197,196, 45,101,204,144, 23,147,223,141,202, 31,244,250,170, 76,249,176,137,110, 24,249, 27, 87,220, -230,165, 23,150,121, 29,220,153,163, 88,149, 37,116,184,103,222,207,225,235, 60,188, 36,169, 49,147,123,248,122,146,141,205,134, -195,206,116,203,146,227, 4,129,190, 58,195,110, 78,222, 28, 34, 50,148, 14,244,152, 40, 55,250,186, 19, 73,135,225,101, 70,228, -178,236, 24,176,163, 38,112,189, 19, 62, 74, 49,217, 35, 48, 94, 5,136,145, 59, 89, 18,239,109,225, 87,109,118,207,156,167,126, -195,173,244,158,125,136, 51, 23,219,156, 26, 36,196, 26, 86, 7,138,223,125,215, 61,252,220, 47,254, 4,181,233,121,110,190,251, - 53,188,230,190,187,121,228,233,115,124,229,225, 83, 68,237,144,118, 59,164,191, 23,176,111,169,102,202, 88,178,140,238,238,128, -193,222, 0, 59,131,146,128, 44,206,144, 90,178,177, 51,192, 65,208,142, 51,227,113,145,176, 23,165,188,237,142,107, 56,122,237, - 10,251, 87,174,101,113,229, 26,106,179,243, 20,155, 77,188, 74,157,185,253,211,124,238,243,103,248,143,191,247, 34,207,159, 47, - 34, 6,125,238,126,221, 10,189, 94,130,109,155, 67, 70, 10,200,210,108, 20,221,203,146,132,120, 16,144, 22,124,218,107,123, 32, - 5, 59, 81,200,116,209, 37, 78, 83,202,182, 77, 16,165,163,207, 83, 18, 39,148, 21,212, 29,155,122,177, 64,161, 81, 69,150,203, -196,118,129, 39,206,191,194,177, 99, 55, 98,251, 37, 94,126,254, 5, 6,131, 14,181, 74, 25,223, 47,160, 84,202,107,223,250,118, -158,126,252, 41,210,193, 30,115,205, 6, 90,155,202,220,176,219,229,245,111,127, 11,159,254,199,127, 49,180, 73, 91, 82, 16,146, - 29,165,121,225,149, 87,184, 46,112,240, 60,143,120,190,136, 37,205, 37, 99, 24,137, 28, 70, 80, 81,166, 22, 91, 23, 74,232, 7, - 63,143,104,237,129,239, 99,121, 5,172, 82,133, 76, 72, 44,219, 54,205,156, 8,252,198, 60,189,243,167,112, 15, 30,229,235,127, -250,231, 20,202, 46,190,208, 12,178, 20,169, 96,177, 92,193,206, 52, 43,169,228,142, 15,255, 15, 62,243,212, 95,146,196,218, 76, -206,185,123, 51, 82,138, 68,235,145,105,214,177, 36, 85,215,102,218,119,168, 22,124,124,203, 2,101, 98,189,245, 98, 1, 59,139, -233, 15,250,116,194,132,189, 48, 37,206,212, 8, 82,227, 57, 54,174,237, 16, 70, 9, 41, 26,219, 54,171, 53,199, 23, 20,220, 60, -138, 20,155, 42,213,118, 79, 27,198, 64,170, 71, 10, 84,152,239, 64,155,229, 18, 69,215, 35, 8, 34, 44,204, 97,238,143, 34,180, - 54,182,235,208,207,155, 18,135, 9,153,100, 72,225,205,237, 11, 14, 2, 87, 88, 88,239,255,205, 95,250,237, 44, 26, 96, 21, 74, -102, 39,150, 4, 6,173, 87,240,137, 59,123,100, 73, 64,212,109, 19,180,118,113, 92,135, 66, 99,154,213,231,190,197,190, 99, 71, - 80, 74, 96,219, 80,155,219,207,246, 70,204, 64, 84,177,183, 95,228,236,115,231,232, 81,166, 32, 52, 86,121,138,176, 53,224,145, - 39, 46,115,172,104,241,244,118,132, 55, 61,205, 94,167, 71,173,232, 18,102,154,155,143,236,227,198, 59,111,163, 80, 41, 81,158, - 89, 64,232,140,202,226, 62,178, 52, 69, 8,133, 83, 40, 99, 57, 30, 58,202,112,170,101,242,132,246,104, 18, 83,113,136,223,156, - 53,149,133,221, 61, 86,159,125, 18, 21,133, 88, 50, 99,234,198,155, 81, 97,200,149,103, 95,160, 62,215, 36,232, 4,144, 12,168, - 46,204,225, 22,171,212,246,237, 39, 9,193,150, 54, 27,167, 95,102,250,208, 33,118, 46,110,224,184,130, 65,208, 65,219, 54,142, -237, 50,117,205, 1, 54, 78,158,195,182, 5,243, 7, 15,243,202, 55, 31,199,241,108,108, 87, 83,155,159,193,169,212,233,236, 5, -132,131, 62, 41, 80,170,206, 16,116, 59,164, 97, 23,171, 80,102,250,218,131,244,215,215,192,177,240,106,211,184,165, 2,213,233, - 69,146, 56, 36,234, 7, 88,158, 67,101,106,138,114,189, 74,208,235,112,241, 27,207,113,224,206, 91,104,111,110,225, 20,125,250, - 59,187, 84,154, 83,168, 44,163,220,108,144, 69, 9,142,107,161,180,133,101,105,162,141, 11,124,226, 51,223,224,190,183,191,133, -197,107,160,242,198,159, 64,122, 21,146,206, 11, 88, 86,133, 63,255,227,247,179,186,189, 67, 42, 76,237,170,204,165, 93, 71, 8, -106, 82, 50, 37, 5, 77,219,166, 44, 5, 37,203,194,149,134, 66,101,137, 97,235,152, 28, 73,236,140, 8,116,114, 60,145, 78, 72, -234, 67, 23,230,164, 11,126, 2, 36, 55,246,142,141,176,173, 19, 69,103,140,255,203,232,128,158, 96,181,203,225,196,110, 89, 57, -207, 89,140,158, 19,163,129, 58,159,162,173,188,187,154, 28, 42, 99,184,230, 98,244,192, 31, 30, 46,150, 61, 38,161,141, 90,219, - 70,113,182,201,137,126, 2, 40, 35,204,207, 41,175,162,159,137,171,212,129,209, 58, 98, 52, 60,231,187,123,235,106,150,174, 30, - 65,235, 39,242,251,114,108,180,211,136, 17,179,131,188, 88,102, 4,120,203, 21,134,177,124, 63,254,250, 66,202,171, 74,102,204, -206, 29,132, 93,130,164,135, 10,118,199,253,242, 35,236,171, 24, 25,226,132, 37, 71,230, 62,105,203, 9,182,192,132,218,144,199, - 5, 5, 99, 0,205, 88,185,144,232, 44,127,120,139, 49, 60,102,136, 3, 21, 67,138,215,100,155,223, 36,142, 23,113,149,201,106, -120, 97, 48, 49,124, 61,193,146, 23, 87,173,117,134,255,254,225, 71,172,127,242, 21,138, 69, 23, 89,107,208,152, 74,185,240,248, - 73,158,107, 69,236, 4, 25,191,244,131,247,242,203,191,251,235, 68,177,198, 47,213,241, 43,117,108,183,200,107,223,120, 47, 55, - 28,191,150,226,229,151,184,249,216, 12,199,239, 60,202,129,227,203,148,188,148,154, 29, 83, 47, 73,230,106, 22,149,220, 61,189, -111,190,194, 92,205,165, 34, 4, 85,105, 26, 13,215,195,148, 48, 51, 27,134,239,188,247, 56,251,151,246, 51,181,176, 64,115,105, - 31,165,122, 19,219, 47,177,239,224, 18,223,249, 19, 15,177,112,203,221,252,192,119,220,200,187,126,232, 24,127,241,245, 46,255, -240,169, 23,120,247,143, 92,207,160, 23,154,181,143,210,100,105, 76,154, 42,146, 56, 34, 73, 82,146, 36, 38, 9, 66,172, 90,157, -210,110,143,245, 44, 4,165,153,175,120, 20,124, 7, 33, 52,165,130, 79,119, 16,162, 99,133,175,160,233, 88,148, 92, 7,191, 84, -192, 42, 86,112,106, 13, 30,122,249, 5, 14,236, 95,166,210,156, 97,245,210, 37, 86, 55, 46, 83,112, 44,138,190, 71,161, 84, 34, -142, 34, 78,220,123, 31,187,177,226,220,179, 79,177,111,118,198,172,129, 92,135,176,211,225,221,239,253, 33, 62,250,153, 47, 81, - 68,225, 89,146, 4, 8,133,195, 75,231,206,210, 62,121,145, 67,161,143, 93, 43,145,212,139, 40,161, 16, 89, 78,233,203, 20,110, -181,142, 44,248,196, 95,251, 26,242,217,231, 16,165, 26, 20, 60,236, 98,209, 0,195, 44,137,116,236, 17, 17,209,241, 75,244, 46, -156,193,159, 95,225, 11, 31,254, 75, 18, 32,214, 25,237, 32,166, 31, 71, 68,113,194,205, 55,221,200,107, 62,250, 97, 78, 5, 87, -120,230,209, 47, 19,101, 70, 61,180, 44, 73,148,154, 10,213, 40,205, 35, 99, 66, 82,242, 44,166,138, 30, 11, 37,159,170,227, 80, -118, 92,124,203,198,150,146,146,109, 33,226,132, 56, 78,217, 14, 98,118,131,136, 40, 85, 72,219, 39,206,160, 31,198, 4,113, 66, -152, 41,178, 33,250, 90, 8, 28,199, 12, 42, 58,129,116, 32,105, 15, 20,189, 88, 19,132, 57, 31, 35,197,124, 15, 57, 49,210, 76, -244, 9, 74,101, 70,210, 23, 96, 73, 77,164, 5,177, 82, 36, 42, 35,201, 49,181, 82,152,202,236, 88,129,146, 99, 78,133, 35, 36, -101,199,194,214, 42,195,242, 43,100, 65, 7,233,186, 88,126,201, 76, 25,202, 76, 36,221,181, 43,148, 26, 83, 88, 69, 15, 97, 57, -196,253, 30,251,111,189,157,112,111,151,213,211,103, 57,116,247,173,244,183,123,132,231, 47,210,143,225,228,165, 57,110, 62,177, -204, 35, 15,124,129, 96,163,197,197,213, 14,219, 3,193,169,150,102,126,102,138,165,154,164,219,143,152,170,248,248,174, 77,205, -119,184,227,238,219,113,107, 21, 10,229, 58,126,125, 10,199,177, 77,245, 30, 25,150,231, 33,165, 75, 18, 15,240,103,102,140, 76, - 72,140,229, 21,201,194, 30,110,165,137,229, 87, 8,247,118, 81,153, 98,176,181,205,202,205,183, 27,252,159, 87,226,252, 87,190, -204,226,137,155,208, 73, 31,167, 84,167, 82,109, 32,132,131,214,154,126,186,203,246,217,115, 8, 33, 89,125,249, 12, 71,239,187, -157,221, 75,155,172,157,185,192,212,156, 13,194, 37,234,238, 49,184,178,201,161,123,111,161,208,168,162,132, 77,103,175,205,161, - 59,238,164,181,182,129, 86, 1,189,110,159,160,183, 75, 99,102,154, 44,117, 80,105, 66, 24,246, 40, 53,151,144,150, 77, 26,245, -217, 57,245, 18,197, 70,141,222,214, 58,193,206, 6, 73,177, 65,210,218,163,121,195,113, 28,191, 0, 90,241,248, 39,255,142, 82, - 99,138, 82,189,202,242,107,110,227,149,175, 61,204,129, 91,111,229,242, 75, 47,115,240,246,155, 9, 58, 3, 42, 83, 77,218, 91, - 91, 84,155, 13,227,232,182, 83,116,166, 57,248,227,255, 47,203,127,248, 97,102, 22, 37,205,119,254,127,232, 96,139,157, 71,254, - 28,213, 78,248,179, 79,125,142,173,214, 54, 73,238,240,214,218,212,121, 75,192,145,134,114,100, 99, 50,234,174, 16,216,194, 48, -156,229,100, 85,169, 52, 15,224, 97,236, 74, 78, 72,159,198,245,153,203,203, 19,112,239, 49, 80,110, 28,115,146,195,226, 20, 61, -161,163,107, 38,204,115,249,180, 47,115,185, 86,101,227,105,108,130,209,110, 21,124,172, 98, 13,111,122,142,242,177,219,177,171, - 13,188,185,125, 72,199, 99,112,233, 52,253,147,207, 16,173, 95, 34,219,221, 32, 13,251, 99,142,187, 99, 27,134,183, 26,246,170, -155,134, 40, 33,228, 85,212, 58,149,154, 73,116,184, 50, 96, 66, 49, 24, 85,132, 90,121, 22,126, 88,249, 34, 38, 32, 53,249,164, - 41,135,166,175,161,100,142,206, 39,233, 9,127, 65,254,191,139,188,142,110,216, 76, 54,220,219,139, 9,179,217,144,109,143, 53, -142,112, 11,105, 12,139,195,237,250, 8,194, 35, 84,190,107, 27, 82,239, 50, 4,146,116,239,188,233,132,215, 99, 87, 59,202,236, - 25,181, 54,230,186,225,207, 32,212,144, 13,111,141,100,121,133, 54,134,201,202, 28, 42,238,160,226,192,212,172,146,229, 20, 63, -157,151,248,100, 38,254,150,141,107,218, 38,248, 53,249,171,161,198,171,152,188,132,103, 8,145, 25, 94, 94, 64,143,118,242, 67, -137, 95, 77, 24, 33,135, 81,128,177,106, 33,198, 18,188, 48, 92,250, 96,125,141,185,155,222, 64,124,246,171, 8,105, 26,231,246, - 77, 85,248,221,191,254, 8, 27, 39, 79, 81,108,204,162,148,196, 70,226,186,187,252,218, 31, 63,141, 85, 63,206, 47, 28, 94,225, -134,183,221,138, 40,151, 8, 46,156, 66,167,109,186,219, 45,194,126,198,234,165, 62, 8, 73,146,251, 28,164,237,178,116, 77, 19, -107,173, 7,190, 71,217,247,248,234,122,155, 78, 6,113,172,168,206, 77, 83,153,155,199,111, 52,112,170, 53,188,122,131, 87, 78, -247,137,166, 14,146,158,127,128,183,189,231, 23,168, 87,102,120,250,212, 75,252,230, 7,215,121,240,211,143,113,231, 27,111,160, -175, 53,110, 92,196, 45,148,113,156, 62,174,237, 98,219, 22,182,235,226,251, 46, 90,165,180, 44,135,253,110,153, 64, 12, 40, 90, - 30,113,152,129,212,116, 6,177,185, 88,164, 25, 33,146,190,210,196,121, 91, 26,105,138, 4,162, 48, 34, 78, 2,148,202, 88,152, - 94,226,201,231,158,160,221, 27,208,233,180,113,253, 2,181, 89,151,254,222, 54,135, 78,220, 76,239,208, 17, 86, 31,253, 34, 11, -115,139,200, 36, 4,199,103,243,220,171,124,244, 35, 31,224,143, 62,240, 63,120,249,212, 69,102,171, 37, 44,173, 73, 28,159,245, -189, 54,127,246,137, 79,115,205, 23, 27,220,116,253, 81, 22,239, 60,142, 62,186,140,108,214,136,211,136,175,255,215, 63,224,235, - 15, 62,195,111,254,248, 91,200, 42, 53,132, 43,145, 74, 32, 44,199, 88,216,180,147,127,222,141,199, 35,222,221, 70, 58, 54,165, - 70,131,223,250,252,223,115,230, 99,127,197,110,171, 69,169, 82,102,106,121, 63,229,230, 52,229,125, 11,176,127,153,191,251,157, - 31,164, 27,165, 88,210,194,150, 38,110,150, 14,125, 54,249,239,172,196, 16, 53,125, 75, 26, 34,155,109, 83,116, 29, 74,150, 38, -201, 50, 60,199, 70, 73, 69, 63, 54,159,169, 76, 11, 82,173, 9,163,144, 94,152,152, 4, 74,106,250,209, 73, 20, 41,224, 88, 26, - 39,134, 1, 18, 39, 3, 18, 8, 83, 65,185, 88, 37,205, 2,194, 48, 52,149,224, 35,150,188, 34,142, 35,108, 9,110,222,141, 30, -229,151,249, 36, 47,185, 74,148,194,205, 73,117, 38,154,104, 68,128, 97,216, 71,106, 3,185,241,132,192, 22,110, 25,157,132, 88, -213,105,116,154, 17,119,182,201,210,216,236,108, 28,143,198,242, 65, 44,199,163,115,249, 60,138,144, 98,189,206,246,171,103, 76, -219, 80,255, 10,110,241,141,188,240,252,195, 36,131, 14,199,110,187,141, 27,239,184,157, 23,159,124,158,180,121,144, 45,183, 64, -227, 90, 69,213,114, 40,174,111,177,214,234, 34,201,184,118,186,130,237,120, 20, 10, 14,126,193,227,200,237,183, 35, 61,135, 66, - 99, 6,149, 13,160,208,196,171,214,209,137, 2, 71,160,194, 24,215, 47, 24, 44, 97,148,228, 15,175, 20,183, 62, 75, 58,232,162, -146, 20, 41, 5,131,237, 61,234,251,151, 16,149, 26,131,115, 23, 73,122, 23, 57,240,186,251, 57,245,207, 95,100,255,109,199,113, -138, 21, 58, 87,214,232,236,110, 82,105,206,146,244, 3, 44,219,198,107, 52,105,206,245, 64, 11, 54,207,175, 51,183, 52,197,226, -177,131,188,252,208,147,172,220,184,159,198,189,247,146, 12,224,149, 71,159, 65,235, 14,142,231,209,217, 9,232,237, 92, 97,223, -161,131,212,166,102,169,148, 61,164,128, 80,151,120,233, 95,254,137, 82, 83, 35,132,135,112, 28,108,223,165, 58,181,136,112, 11, - 76,223,112, 27,126,189, 78,119,117, 21,167, 88,129, 36,161,187,189, 71,156,198, 92,119,255,253, 20,234, 85, 30,255,212, 39, 88, - 59,247, 42,199,223,240, 29, 92,124,241, 69,246,221,112,140, 51, 79, 62,195,193, 59,110,165,223,233, 82,108, 54, 25,116,187,248, -149, 50,150,101,163,165,192,183,109,190,251,119,127,153,194,177, 59,105, 63,253,113, 8, 35,178,160,202,255,252,228,255,166,219, -217, 38, 27,230,174,179,220,219, 38,133,201, 86,106,193, 68, 61, 54,182, 48, 76,119,169, 20, 82,218, 19,135,179,190,202,189, 62, - 54,114,141,161, 95,150, 87, 66,197,253, 9, 74,249,216,185,109, 74, 99,198,173, 97, 66,140,161, 34,210, 54,117,149,195, 9, 81, - 90, 22,118,125, 6,171, 84,196,155,221,143, 59,181,128, 55, 53,139, 59,183, 76,233,186, 19,248,243,203,216,229,170,249, 97, 76, -213,219, 48,223, 6, 2,166,120, 67,190,176, 50, 25,147, 36,136,136, 86, 47,177,251,208,231,216,125,248,243,164,237,173,145,201, - 18, 38, 46, 24,122, 88, 65,171,243, 82, 6, 61, 74,228,128,200,205,101,185, 98,192, 24,228, 98, 14,157,252, 23,123, 66, 98, 54, - 80,150,137,104,158,154,184,233,104,125, 85, 41,141,152,236, 52,151, 19,109,102,195,111,112,178,210, 85, 12, 75,114,196,200,105, - 43, 25,187,203,199, 57,118, 49, 81, 80, 51, 94, 19, 24, 63,192,132,169, 77,233, 9,222, 59,163, 55,116, 88, 28, 99,184,254, 19, - 76,118, 13,194, 41, 99, 87, 23,136,119, 99, 80,131,156, 29, 63,198,184,106,161, 12, 11, 60,159,224,149,210,227, 11,136,154,200, -208,231, 74,129, 82,106,244,207,196, 8,187,155,211,239,242,150,174,255,139, 29, 63,250, 62,175,222,217,142,243,133, 67,206,189, -133, 59, 87, 39,217,184, 72, 32,230,216,215, 44, 50, 27,236,241, 15, 47,126,145,238,230, 38,126,185,142, 86,198, 57,122,246,197, -243,188,255, 51,125,222,126,255, 61,216, 69,201,210,160,130, 53,127, 24,221, 95,163,119,241, 50, 73, 63,162,183,218,103,115, 45, - 32, 72, 53,169,176,217,222,139,113, 54, 67, 22, 14, 52,112, 60,143,185,165, 41,170,245,140,242,118,151,138,103,241,196, 70,143, -175,126,254, 81,138, 39,183, 88, 40,121,200, 12, 92,199,197,241, 11, 36,190,207,125,131, 2,143,127,249, 52, 63,118,231,113, 62, -253,248, 11,124,229,203, 95,227,248,173,119,176,214,122, 24,175,218, 32,232, 5,200,156, 47,110, 73,129,176, 13,193, 80, 72,137, -229, 88,164,105,159,226,190,105,156,243,171,180, 52,108, 12, 34, 74,182,249, 29, 12,226,140, 72,231,201, 17, 9,177, 82, 38,214, - 21,133, 16,135,184,105,194,177,107,174, 97,245,210, 69,174,127,205, 27,153, 89, 88, 32, 19, 16,164, 9,123,221, 14,213,106,153, -160,221, 50,107, 49, 75, 82,244, 60,156,239,254, 49,182,191,240, 9,166, 27, 83, 56,169,194,118, 28,214, 79,189,196,127,250,143, -239,230,139,159,251, 50,127,245,165,199, 56,210, 40, 83, 20,208, 78, 5,243,149, 34,253, 56,224,129, 71,159,160,241,232, 19,164, - 65, 76, 31,232, 0, 33,240,147,223,117, 55,118,115, 26,157, 68,134, 33,239,251, 72,219, 38, 75, 53,218,181,242,196, 71,138,237, -149, 72,130, 14,210,117,232,189,252, 28,181,215,189,141, 67,175,158,100,237,197,151, 17,174,109, 94, 23,203,194,159, 95, 96,163, -179, 65,107, 16, 96,185, 21, 42,181, 25,162,222, 38,105,210, 39,201, 76,125,170, 49,108,154, 9,215,206,125, 34,113,222,118,232, - 9, 11,219,151, 57, 59, 2, 34, 29,227, 90,150,201,254, 11,179, 46, 12,162,212, 60,125,180,194,119, 11, 52,170, 21,182,246,118, - 9,147, 4,165,192,181, 36,105,100,224, 54, 82,131, 37, 92, 74,126,133,221,189, 1,105,206, 20, 25,154, 87,173, 33, 48, 82,152, - 46,119, 5, 68, 10,243,125, 10,176, 20,184,150,105,189, 36, 71,195,107,105, 8,149, 50, 87,236, 44, 76,114,201,149,121, 25, 12, -210, 34,235,238, 16,118,246, 40,206, 44,146,109, 95,161,184,120, 16, 29,244, 9, 90,155, 12, 86, 47,209,220,127, 13, 42,142,136, - 6,125,108,199, 38,106, 13,184,243,221, 63,199,233,175,126,137,195, 55,157,160, 60,187,192, 75, 95,123, 4,207,179, 57,127,230, - 28,175,127,253,237, 60,246,205, 39, 89, 56,188,159,147, 47, 95, 34,138, 19, 28,173,120,211, 61,183,113,126,117, 11,219,177,200, -178,152,163, 55, 30,197,171,148,241,234, 83,168, 48,160,216,156,193,114,124,210,104,128,215, 88, 32,238,108,226, 84,234, 70,214, -176,108,164,239, 16,182,182,240,171, 83, 6, 5,232, 21, 32,235,163,177,241,138, 69,220,153,101,210,246, 14,197,169, 6,122,170, -193,185,135, 30, 98,233,198, 99, 88,210,225,212, 87, 31,194, 41,216,204, 93,187, 15, 45, 28, 46,189,248, 44,251,174,191,142,184, -215,197,171,149,105,173,111,225,217, 22,139, 71,143,242,236, 87,190,193,183,125,223, 91,232,172,181, 89,127,229, 85, 18, 37, 89, - 90, 90,196, 41, 45, 51,232,182,144, 42,101,121,101,129,185,163, 7, 57,247,252, 75, 44,221,120, 19,173,181,109,202, 21,135, 55, -252,135,159, 97,247,213,231,136,130, 61, 44,207,197,178,109,226, 20,236, 82, 17, 97,219,196,221, 62, 89,150,210, 58,247, 10,243, - 71,142,179,114,199,225,252, 16,201,216,189,116,133,123,222,251,227, 68,131, 1, 89, 24,113,228,238,111,163,179,179,199,210, 13, - 71,233,181,218, 20,170, 53, 44,169,209,126,193, 20,216,104, 65, 26,132,120, 37,159,226,205,119, 18,159,250, 6,193,238, 26,181, -187,127,144, 15,254,254,143, 33,195,128, 76, 10,132,101,136, 71, 89, 62,113, 26,239, 83,142, 72,196, 72,237,182, 28, 17,154, 71, -156,112, 67, 80,203,109,150, 67, 51, 23, 99, 63,210,240, 28, 40, 44, 28,167,114,236, 38, 90,207,127,133,120,253,202, 24, 17, 59, -220,140,170,241, 67, 89,144, 31,228,105,134, 64, 99, 23, 74, 76,189,241,157, 76,221,251, 86, 74, 71,175,199, 46, 54, 16, 34, 5, - 29, 95,181,139, 55,185,171, 20, 21, 13, 80,123,189,252,240, 48, 11, 37,145, 35,219,180, 54,225,123,157,154,130,148,168, 59, 32, -137, 83, 44,191, 72,243, 45, 63,194,220, 59,222,135, 44,148,217,248,236,255, 98,253,179,127, 62,150,247,135, 23,148, 33,139, 37, -151,158,135, 45,118, 6,124,146, 31,228,154,188, 1, 78,142, 50,209,114,248,179, 9, 3,118, 17, 35,211,215,248, 92,214,232, 81, - 52, 14,105, 25, 71,253, 40,122,173,199,134,238,188,126, 84, 58,121,169,204,112,228, 31,154,202,165,145,220,135,204,245, 17, 19, - 94, 48,230,167, 51,110, 61, 19, 82,130, 53, 62,228, 71, 63,203,232,114, 54,169, 93, 15,213,139, 33,230, 90,142, 46, 26,228,180, - 53, 33, 64, 37, 3,162,141,211,160, 34, 99,152, 28,102,221,135,147, 75, 94, 18,163,242, 94,116, 41,134, 19,127, 94, 30,147, 95, - 84,192,152,222,132, 37, 39,204, 83, 19,126, 3, 49,222,209,143,217,219,121,181,174,148,230,114, 38,255, 77, 53, 32, 19,166,140, - 97,107, 93, 40, 80,131, 54, 89, 97,134,163, 55, 76,243,158,218, 60,165,197, 35, 12,182,174, 32,181, 32,205,160, 54,211,224,109, -255,238, 9,126,249, 7,106,252,236,111,255, 20, 63, 80,105,243,190,143,253, 39, 82,233,210,122,233,121,130,173, 14,209, 78,140, - 95,240,176, 85,128,159,192,197,221, 62, 47,183, 98,106, 69,135,230,194, 2,210, 17,108, 95,218,102, 99,183, 79,165,224,113, 96, -166,196,226, 84,145,245, 86,159, 43,221,117,206,119, 44,250, 9,220,208,172,113,235,220, 33,230,103,102,185, 17, 65,225,214,251, -208, 74,240,254, 59, 94,199,218, 71,255,132,195, 90, 33, 45,151,127,125,224,175,169,222,125, 11,206,177,107, 80,158, 71,226,228, -141,123,113,146,215, 28,107, 28,203, 6, 7, 92,203,161, 42,108, 28,161, 89,235,197,148, 93, 7, 87, 66,106, 65, 81, 72, 82,173, - 73,149,166,159,101, 12,186, 17,165, 48, 36,236,237,114,255,241, 59,248,212, 55,191,140, 37, 5,245,153, 38, 39,142, 29,227,202, -197,243,148,125,151,237,214, 14,142, 95,192,143,139,168, 82, 1,165, 51,210,126,155,210,119,190,139,221, 7, 62, 78,179, 92, 67, -164, 14,150,231,177,187,126,153,251,222,116, 55,119,223,115, 27,191,243,193,143,114,170, 61,224,230,169, 10, 61, 45,137, 51, 69, -106, 59, 8,169,185,235,219,110,228,139, 15, 63,205,116,169,200,247,188,237, 62, 22, 87,150, 72,162, 0,167, 90, 6,215, 50, 0, - 32,219, 1,225,230,207,125, 43,255,168, 72,210, 65,128,148,146,184,211,129, 74, 25,103,118, 26,231, 66, 9, 81,240,113, 42,101, - 42,203,251,176,111,186,137, 15,253,252,155, 9, 83, 77,181,232,129, 80, 36, 73, 68,152,170,209,129,106,196, 46,243,252,179,164, - 32,136, 50, 2,215, 68,202,164, 4,207,118,176,133, 67,150,197, 40, 97, 14,244,162,237,224, 88,210,192,183,108,129,157,106, 18, - 5, 37,207, 65, 43, 77,146,100,230,235, 74, 65, 22,155,242, 28, 43, 53,112,156, 36,138, 89,223,218, 32,136, 98,226,156,175,161, - 39, 38,109,165,135, 81, 54,147, 6,210,194, 32,191,237,137,178,168, 52,111,207, 12, 51, 67,142,211, 35,211,161,153,210,101,126, -176,219, 89, 48, 64,186, 14, 96, 81,154,154,165,183,122,158,210,210,126,218, 23,206,208,190,244, 42,139,215,159, 64, 54,155,108, -159,127,149,168,189, 67,109,113, 63,169,210, 20,166,170,116, 55,214, 89,188,254,102,122, 59,219,156,125,230, 89, 26,115,117,206, - 61,119,146, 91,238,190,133,213,139,107, 28,188,118, 31,245,217, 37, 42,231,247, 32,147,220,116,253, 1,206,110,172,177,111,126, -154,205,237, 62, 85,207,231,166,239,120, 19, 86,161,140, 91,170, 98, 53,103, 80, 74, 99,249, 5, 44, 52, 73,167,133,180,108,178, -168,143, 93,110,130, 74, 8,219,219, 56,149, 10, 72,155,214,169,231,168,237, 91,161,183,187,134,101,121, 84,150, 87, 72,218,219, -156,127,242, 81, 42,205, 41,122, 91, 91,236,191,249, 56, 94,101,138, 51,143, 60, 70,125,170,201,204,117,215,128, 93,226,137, 79, -126,142,235,238, 57, 70, 18, 68,196,225, 46,210,171,144, 69, 49,149,133, 6, 59,107,187, 28,186,229, 24,216, 54, 81, 52,160,185, -255, 16,113, 18,144, 70, 49,253,118, 66,175,181,137,180, 99,234,251, 87,120,242,159, 31,166, 49,227,242,244, 23,254, 9,187,228, - 35, 16, 52,231,150, 40, 54,150,169, 52,150,185,248,210,163, 56, 5,135, 66,165,129,235, 85,136, 58, 29,220, 82,137,169, 67, 71, - 40,207,207,115,242,171, 95,102,251,236,181,212,151,247,161,194,152,250,202, 62,178, 52,163, 80, 42,146,120, 30, 47,125,245,235, - 76,173,172, 48,208, 25, 94,177,200,238,229, 43,212,230,102,145, 5,223, 76,215, 42,197,171,148,208, 89, 74,229,232,189,156,126, -236, 95,169,220,255,179,252,202,143,223, 71,217, 30,230,172,117,190,127, 49,123, 28, 75,230,196,198,212, 48,131, 11, 57,254,213, -202,121,206,214,196,196,165,134,128,153,201, 93,171, 26,231,150,205, 65,230, 96, 23,235, 56,245,121,132,182,242,157,114,190, 11, -150,218,100,144,243, 3,102,216,209,109, 21,202, 76,191,225,123, 89,126,239,127,198,169, 55, 65,245, 77,145,134, 86,136,116, 55, - 47, 78,183, 25, 85,175,169, 20,146,132, 44,138, 80, 73, 66, 50, 8,200,146, 20,157,101,249,164,102, 33,164,129,217, 27,254,116, -136,202,210, 60, 43,110, 99,107,135,104,144,128,236,161,213, 54, 83,239,248, 15,204,127,223, 79,241,236,187,239,200,167,243, 9, -163,219,208,121, 61,140,197,101,122,180,167, 23,185,188,109, 24,171, 58,175, 40,205,247,186, 74,140, 90,170,212, 68,198,126, 20, - 33, 19, 98, 20, 83,211,169,154,112,115,231,191,184, 74, 95, 21, 75, 83,153,249, 62,172, 97, 76,107,184,143,103, 12,221, 49,189, -228,150,137, 5,145, 23,172, 40, 19,191, 19,142,217,231, 26,151,184,206, 73,140,122, 36,199, 15,191,158,161,203,137, 81,197,170, - 30, 26, 14,149, 50,149,167,195,226, 22,244,136,224, 38,116,140,206, 18, 19,152,201, 17,187, 6,131,171, 70,149,174,134, 86, 39, -242,140,186, 24,209,255,180,206,167,142,201, 13, 76,166,175, 54, 4,202, 9,190,126,166, 48, 27, 80, 61,230,233, 15, 99,108,250, - 42,204,224, 24,212, 59, 44,177, 65, 35, 11, 21,154,223,243,211,200, 82,137, 76, 59, 92,190,210,227,135,254,248,163,132,123,107, -196, 58, 37,222,235,163,131,152,189,127,248, 60,159,186,225, 10,197, 39,182,120,224,206,253,124,219, 15,191,150,116,250, 48,173, -199,255,133,237,231,206,176,115,170, 77,173,225,210,109,117,233,117, 98, 46,238, 37,124,107, 59,164, 86,242, 56, 48, 87, 97,230, -218, 37,194,214, 14,155, 91,125,206,182, 6, 12,146, 62, 71,166,139, 52,202, 30,199,246, 55,185,209,181, 73,146,140, 51, 87, 90, -144,181,249,199,167,190,201, 32,214, 28,157,174, 33,180,195,173, 71, 15,226,123, 69,202, 71, 14,144,102, 26,169, 52, 78, 63, 96, -239,203,143,208,251,196, 63,163,164,166, 95,116,105, 45,212,232,215,125,118,163, 62, 36,230,243,223, 15, 35, 44,207,102,133, 50, - 47, 7, 45,124, 33, 17,150, 77, 39, 78, 64,105, 74,185, 32, 19, 8, 77,172, 20,253, 56,161,210,110, 83, 40,149, 56,184,255, 8, - 49,130,168,215,193, 45, 10,110, 58,126, 23, 47,191,242, 18,181,160, 68, 16,198,116,247, 90, 20,138, 62,126, 92, 36,179,108,211, -106,215,235, 80,248,206,119,209,250,210, 39,153,118,235,232, 52,195,114, 37,253,110, 23,203,178,249,131, 15,252, 10,171,103, 47, -242,167, 31,251, 7,182,183,219,212,242,251,242,134,148, 60,249,236, 73,126,234,231,222, 75,117,118,150,176,189, 71, 36, 4,110, -185,132,112, 29,243,112,178, 29,147,116, 44, 56,166,197, 80,106,195,131, 79, 35, 84,100, 84,161,164,187, 3, 59, 27,216, 11, 75, - 56,165,151, 16,197, 50, 94,181,129,187,176, 72, 80, 44,176,185,181,141, 18,154,118,183, 69, 26,236, 97, 9, 99,142, 75,242,223, -107,203, 54,209, 58, 91, 8, 35,201, 59, 30, 89,170, 70, 23,111, 71,216, 8,105,126, 86, 71, 74,124, 97, 81,114,108, 42,142,197, -174,144,216, 90,140, 46,148,189,126,159, 84,245,208, 90, 99, 11,137,163,193,209,130,178,180, 40, 74,129,163, 37,142, 11,123, 97, - 58,242,129,196,106, 2, 1,109,153,153,201, 32, 32, 12,190, 89,105,176,109, 49, 4, 60, 18,100,195,120,174, 38, 19,210,176, 69, -242,223, 21,215, 38, 55, 24, 11,124, 91, 96,171,184,135,116,234, 72,207, 39,139, 6,120,181, 41,200, 20,142,101,177,120,227,109, -196,189, 61,138,139,135, 9,182,118, 41, 45, 31, 36, 9,251, 20, 74, 21,130,189,132, 44, 25,176,183,211, 39,106,109, 50,232,172, -163,212, 20,123,219, 87,168, 79, 31,197,241, 93,102, 23,230, 25,116, 82, 42,205, 26, 51, 11, 85,188, 66,149, 90, 99,134, 84, 43, -150, 92,159,133,107, 86,240,107, 83,184,149, 6,105, 20, 34,165,133,180, 52,194,175, 17,111, 95,196,109, 46,229, 57, 86, 7, 21, -247,145,182,141, 87,109, 34,252, 18, 89,111,143,250,129, 67,108,190,244, 34, 83, 7, 86,232,172,158, 5,181,159, 75,143, 63,206, -129, 91, 78, 16,135, 1,179,135,142, 16,246,218, 92,124,234, 9, 28, 55,197,169, 54,136,162, 4,221,223, 99,233,208, 97,226,126, - 68, 18, 68, 36, 42, 65,102,130,176, 51,192, 45, 25,146,150, 87,159,229,242,211, 47,176,215,106,241,220,215, 31,224,134,187,238, - 97,237,244, 38,157,206, 42,213,114,141,253, 71, 14,243,228, 23, 31,101,122,214, 71,227,112,224,186,107,113, 75, 53,206,189,120, -150,147,143, 61,204,129, 91,111, 96,122,225, 6,174, 57,126, 39,189,237, 85,122,253, 93,122,187, 23, 40,213,230, 24, 4, 3, 58, - 27,107,184,149, 50, 39,222,254,253,196,131, 62,151,158,120, 2,219,245,169,237, 95, 98,231,194, 57,144, 54, 11, 7,175,225,134, - 55,190,222, 76,241,185, 4,101,229, 19, 77, 18,101, 56,174, 36, 85, 70, 46,215, 8, 99,152,187,238, 53,252,247,159,188,207,236, -197,213,248, 33,173,148,145,223, 44, 97, 10, 92,108, 45,240,129,130, 45, 40, 8,129, 39,229,168, 85, 73, 49,222, 33, 15, 31,216, - 66, 14, 39,193, 28,154, 34,141, 60, 45, 37,100, 42,161,123,246, 49,130,181, 51, 36,189,213,220,240,164, 70,117,165, 90, 41,164, -107,163,211,148,226,242, 81, 14,252,244,111,210,184,243,245,102, 18,207, 2,116,180, 99,196, 99,219, 67,216,230,130, 57, 26, 35, - 85, 98, 92, 37,105, 74, 22,132,132,221, 14,105, 16, 16,247,243, 67, 93,107,146, 40, 54, 10,178,235,225, 88, 78, 94,147,104,154, -226,178, 52, 70, 91, 26, 71, 15, 76, 12,202,114,112, 42, 21,146, 40,163, 56, 53,203,209,255,246,183,188,244, 95,222,153, 79,183, -106, 92,224, 61,196,191,218,198,148,153, 42, 53, 50, 6,106, 53,198,146, 42,198,197, 36,195, 83, 41,203,193, 41, 67, 36,106,150, -169,177,180,207,213, 60,247, 28,113,135, 86,227, 62,100, 24, 79,184,228,101, 61, 98, 20, 9,188,186,232, 70, 43,140,171, 56,255, -247,169, 92, 66, 17,150, 89, 9, 24,227,159, 26, 93,170,204,222,124,236, 34, 39, 79, 67,104, 97, 46, 2, 74,231,187,148,225,215, -207, 1, 59, 74,229,197, 45,106, 72, 4, 51, 95, 79, 13, 47, 13, 19,116,188,145,217,223, 45, 33,156, 34, 42,234,152,247,113,164, -255,235,171,144,238,227,197,224, 88,148, 25,245,170,103, 67, 27,161, 30, 27,243,180, 2,219, 50,148, 65,165,242, 90, 87, 43, 55, -209,169, 17, 89, 15,165, 81,150,241, 22, 56, 86, 66,251,210,121,236,114,145,226,194, 18, 89,201, 33,125,254, 28,197, 75,109,252, -176,111, 58, 37,194,152,197,170, 67,151, 1,119,253,200, 29,100, 86,157,172,179, 75,166, 92, 58, 27, 1,237,118, 66, 22,107, 54, -119, 66,122,169,166, 29,164,220,121,160,193,226,193,121, 14,220,123, 15,171,143,126,147,199,159, 56, 75, 63,131, 78,170, 9, 82, -197,233,157, 62, 83,221,144,112, 16,177, 48,223,192,111, 20,185,229,248,126,210, 36,225,104, 48,160,189,221, 35, 82, 25,253, 36, -229, 11,223,122,130,189, 56,195, 67, 51, 85, 40, 49, 83,174,176, 80,157,166,233, 87,104,204,215,233,197, 17, 89, 16,210, 60,121, -153,166, 18,148, 4,188, 72,200,158, 39,233, 71, 9,158,107,177,144,249,164, 25, 20, 11, 6, 81,106, 91,146,118,148,208,180,114, - 41, 89,105, 34,173, 73,200,136,227,152, 66, 20,145,181,214,241,181,160,215,235, 32,133, 3, 57, 41, 16,169, 25,244, 7,244, 92, - 15,191,181,135,180, 61,138, 8,164,229, 32,109, 80,189, 14,254, 27,191,159,157,231, 30,161, 17,133, 38,115,158,223,177,246,118, - 54,169, 78,149,249,221,247,255, 28,113,152,208,221,110,145,165, 9,197,106, 13,183, 94,165,179,177, 69,191,219, 69,250, 30,210, - 2, 37, 4,194,115,144,174,141,180, 29, 82, 13,150,227,147,197, 3,200, 64, 75,101,138,101,148,137, 20, 8,199,162,255,244, 55, - 40, 52, 23,176,167,155,168, 84, 83, 88,156,199, 57,124,152,191,254,253, 95, 34,203, 89,236,190,149,129,150, 36, 74,145,164,106, -180, 6, 26,126, 22,147, 76, 33, 44,159, 74,109, 1, 63,235, 34,148,145,195,133,206,176,148, 70,145,230,196, 57, 11, 79, 66,193, - 54,248, 91, 45, 52,105,190, 94,211, 40,108,242,201,218,177,145, 2,202,150,100,214,181, 41, 72, 11, 91, 10,156, 72, 16,196, 96, - 9, 53,138,254, 78,170, 91,153, 82,164,142,157,195,179,200,159,171,230,179,175,164,113,186, 15,239,207, 74,155,221,189,145,222, - 13,129,206,206, 76,119,123,217, 18,216,118,161, 76,218,221,197, 46,213,200,130, 62, 78,181, 74, 22,133, 8,203,124,241,226,210, - 33, 58,231,207, 48,104,111,163, 69,140, 74, 67,234,251,143, 32, 44, 73,105,106,145, 87,191,254, 41, 14,222,121, 23,205,125,251, -121,252,179,127,207,107,223,250, 54,158,127,228,113, 10,190,199,225,187,239,229,155,255,248,101,138,149, 10,205,153, 26, 74,165, - 68, 65, 68,173, 81, 38, 25, 4, 28,190,255,141,216,190,103,202,224,171, 21,210, 94, 15,175, 57, 75,188,183,142, 83,107,146,133, - 93,164, 99,163, 6,187,200, 82,141,184,189,141, 59,189, 72,214,221,165,191,187,141,235,187,204, 30, 60, 74,208,110,209, 60,124, -130,104,119,139,165, 19,199,137,131,128, 44,138, 8,217, 34,234, 71,168, 36,164, 80, 41,211,219,222, 38, 28,108, 80,168, 31, 32, - 37, 66,119, 83,226,168,143,237,122,132,131, 46,182,107, 83,172, 52,136,250, 1, 59, 87,214,233,239,238,162,195,152,239,248,241, -159,100,231,210, 58, 91,235,231, 41,184, 9,215,220,116,136, 87,159, 59,203,226,242, 44, 43,199,143,224,120, 37, 90,187,219,156, -126,225, 50,113,247, 18,135,111,184,141,222,218,121, 86,219, 59,184,181, 5, 26, 51,215, 50,213,156,165, 56, 51, 15,182,139, 91, - 40, 18,236,237,208,186,112,153, 96,253, 49,220,114,133, 27,191,251, 29, 35, 46,114,169, 94, 37, 14, 19, 46, 60,247, 10,211, 7, -246,225,149,203,216,150,100,253,194, 37,166, 87, 14, 16,246,218, 56,110, 17, 33, 4,105, 20,210,110,117,152, 90,154, 39,203, 82, - 35,101, 23,138,184, 90, 35,226,152, 52, 71, 23, 74,161, 17,169,217,205,216, 8, 74, 66, 24, 12, 44,130,138,176,240, 1,207,202, -163, 79, 98, 88, 67,104,242,220, 74,168,225,233, 50,118,186, 79,164, 83,164, 4,149, 69,164,253, 43,230, 67, 41, 4,146,220,109, - 46, 37,144, 81, 58,116,156, 27,126,239,111,112,106, 77, 16, 49, 90, 13, 16, 58, 5, 44,132,107,131,244, 70, 83,157,121,240,135, -166,205, 41,137,200, 6, 3,130,214, 30, 81,191, 67, 50, 24, 48,216,235, 18,135, 17, 89,146, 97,185, 30,210,241,205, 1,155, 23, -104,184,165, 10,210,114,205, 21, 88,130,148, 46,105,148, 16, 71, 17,118, 65,226,230,113, 48,173, 20,229,235,110,193,169,214, 73, -186,221, 60,167,174,199, 50,121, 94,145, 58, 97,245, 27,215,133, 78, 72,225,195, 95,236, 49,115, 69, 95, 69, 61,147, 66, 76,144, -209,204, 65,175, 50,179,159, 87, 74,231, 44,133, 97, 47,123,142,195,157,204,160, 51,238,110, 31, 50,237, 71,190, 5, 57,118,228, -143,200,122,195,204,118,158, 38, 94,148,182, 0, 0, 32, 0, 73, 68, 65, 84,251, 31, 70, 0,133, 45,242,238,232, 9,170,156,158, -196,251, 90,198, 68, 42,195,252, 50, 48, 70,180, 10, 41,141,199,197, 26,198,215, 38,156,234, 19,169, 6,195, 30, 6, 97, 91,216, -229, 25,132,244,136,163,214,168, 79,110,212,164, 49,145,130,208, 66,152,254,137, 92,209,144,185,173, 95,107, 53,194,200, 94,149, -150, 0, 84,146,230,251,242, 92,103,207, 84,206,131,103,196,205, 39, 87, 12, 74,203, 7,200,220, 10,193,238, 73, 94,252,218,191, - 18, 70, 5, 74,223,236,192,110,192,160,219, 33, 88,223, 36,237,247,217,217, 60,135,187,208,229,134,127,255, 58,100,253, 58,186, -143,127,158,213,135, 78, 50,243,134,183,114,252,189, 77,158,253,131,143, 49,232, 68, 28, 58, 84, 99,167,163, 57, 58, 87,167,180, -188,128,223,156,162,115,246,121,158,121,236, 52,157, 68,179, 25,102, 68,128, 43, 5,145,134, 86,170, 73,219, 17,171,157, 45, 22, - 42, 22, 11,139, 53, 26,115, 85,170,251,102,152, 93, 89, 4, 20,105,183,207,237, 82,112,241,244, 26,189, 40,101,189, 29,177, 30, -236,114,106,119,131,110,168,216,215,172,114,164,218, 64,196, 62,194,178,232,235, 4, 29, 37, 28,201, 44,156, 64,114, 37, 9, 57, -163, 98,254,127,174,222, 52, 88,210,243, 60,207,187,222,229, 91,123, 63,251, 58, 11,102, 0,204, 96, 39,192, 5, 20, 69, 10, 36, - 37, 89,178,181,132, 74,201,137,229,216,177, 85,113, 82, 86, 41, 37,197, 81, 92,145,108,171,168, 42, 39,182, 99, 87, 28,197,150, -146,170, 84, 24, 45,137,164,148, 98, 75,138, 40,201,218, 40, 71, 92, 32, 18, 32, 8,112, 6,192, 96,128,217,231,236, 75,247,233, -245, 91,223, 55, 63,222,175,251, 28,240, 7, 10, 63,230,116,159,211,221, 95,127,207,251, 60,207,125, 95,247,112, 50,102, 49,246, - 25, 23,134, 36, 79, 65, 86,177,156, 56, 96,201,176, 48, 28,231, 5, 65,146, 17, 78, 82,194,241,136,188,204,241,148, 34, 75, 38, -168, 0,252, 90,131,245,197, 14,147,180, 32, 12, 44,195,209,144, 48, 12, 8,106, 53, 60,207,195,247,131, 74,152,169,177,163, 17, -241, 83, 31,163,247,222,107,180,122, 71,120, 97,195,105, 89,180,132, 82,208,239,118,221,180, 41,244, 80, 86,147,149, 25,121,255, - 4, 85,139, 16,165,165, 44, 75,215,141, 70, 1,194,211,200,192,195, 42,141,177,106, 70,172, 68,148, 88, 35, 40,139,212, 5,196, -228, 37, 82, 8,186,119,110,144,117, 79,220,232, 93,122,120,139, 11,164,205, 54,175,252,249, 31, 32, 5,248,158, 27,103,167, 69, -193,168, 52,213,206,220,206, 26,134,180,176,160, 12, 73,158,211,235,238,211,140, 64,132,117, 55, 97,212, 62,210,175, 83,142,187, - 32,138,217, 97, 49, 47, 45, 70,216,153,199,220, 86,235, 49, 91,117,238,198, 24,151,200, 38, 4, 53, 79,209,212, 10,140, 96, 50, -155, 52, 85,247, 78, 97, 65, 41,103, 85, 44, 93,211, 19, 4, 62, 38,207, 48,198,162,113,104, 88,161, 44, 69, 53, 24, 44, 43,236, -114, 57, 43,238,110, 45,167,112,122,139, 80, 56, 75,161,250,217,159,254,137,207,234,198,156,139,210, 11, 99, 16,110,228,161,188, -208,141,189,131,136,163,247,222,166,185,188,140, 31, 71,180, 46, 63,199,195,175,191,140,176, 9,147,193, 24, 83, 22,164,201,128, -147,253, 99, 46, 62,247, 12,119,175,223,100,126,109,145,205, 43,151,184,246,242, 43,180,230,154,204,175,172,226, 5, 62, 42,140, -104, 52, 27,212,219, 45,218, 43,171,204, 93,122, 2, 21,213, 49, 38, 71,232, 0, 29,198,206,115,172, 60,132, 95,119,192,147,178, - 64,214,231, 17, 22, 84,220, 38, 57,218, 5,155,163,164, 36, 92,222,196, 26,139,142, 35, 76, 94,144,143, 39,152, 34,163,182,126, - 1,155,150,236,223,122,143,189,247,110,176,114,233, 34,214,122,140,246,247,217,120,250, 89,110,189,252, 21,180, 42,152, 12, 6, -248, 97, 72, 58,204, 16,162, 96, 60,236, 49,232,117, 17, 66,226,121, 33, 18,193,226,197, 53,142,182, 14,184,245,250, 77, 86,215, - 58,156,123,252, 18,147,193, 24, 85,230, 92,121,233, 19,100,133,229,104,247, 0,147, 65,103,174, 77,173,174, 88,188,124,145,205, -231,190,157,246,194, 5, 36,138, 60, 77, 40,139, 28, 73, 53,238, 25,244, 17, 90, 19, 47,204,211,190,112,158,213, 39,174,184, 11, - 38,153,176,115,243, 54,126,232,225,199,117,242,108, 66, 16,199,188,251,197,175,112,252, 96,155, 11, 47, 60,203, 55,255,221, 31, -179,120,249, 17,210, 52,193, 10,240,195, 24, 63,138, 40,210, 12,233,249, 44,111, 60,194,171,191,250, 63,210, 16, 18,109, 28,139, -115,108, 33, 85,150,162,218,109,215,164,160,109, 37, 75, 90, 80, 19,210,165,176,121,158, 75,139,138,231, 9,218, 43, 80,100, 88, - 91, 84,187, 90,183,107, 63, 43,146,179,211,172,115,121,134, 53,110, 5,168,138, 79, 94,117, 82,193,242, 38, 47,252,210,151,216, -248,171,255, 5, 50,136,176,228,136,170, 0, 34,170,113,155,240,192,122,213,137,161,132,236,132,178,223, 39, 63, 62,100,180,189, - 69,111,103,139,238,206, 22,131,253, 67,250, 7,199,156, 28, 31,145, 12,135,244,187, 93,198,195, 1, 69, 81, 80, 22, 22, 35,148, -219, 65, 11, 5, 90, 83,228, 5, 69, 97, 16, 94, 64, 89, 22,228, 89, 74,212,153, 35,170,213,241,155, 53,130, 90, 92,237,211, 21, -131,111,126,217,129, 86,180,156, 37,167,217, 51, 42,252,105, 1,158, 46,107,103, 74,107,123,170,184,158, 38,189,113, 22,172, 83, -217,200,190, 53,233,102,150,206, 86, 77, 94,164,112, 74,122, 41,229,108, 52, 61,195,220,138,211,238, 98,170,115,152, 86,185, 89, -176,206, 20,184, 35,171,169,193, 44,203,186,226,198,155,211, 2,239, 52,133, 6, 85,141,212, 69,117, 82, 83,186,229,118,253,101, -250,254, 76,244,170, 88, 75,229,222, 27,161,164,187, 17,201, 51, 2,182, 74, 0, 57,101,210, 11,161, 1,141, 77, 78,176,249,164, - 98,243, 87,113,180,149, 13, 77, 40, 57, 59, 44, 57,224, 79,117, 0,210,114,118,221,205, 66,130,102, 4, 62,113,202, 24,224, 12, -169, 72,158,217,215,203, 42,192,166,154, 68,204,127,234, 51,228,227, 17,131,131, 35,146,131, 99,190,251,135,127,142,114,114,143, - 98,114, 66, 81,166, 28, 93,251, 38,135,199, 47,163,194, 45,174,252,216,143, 98, 11,159,236,214,203,236,125,241,235,100, 39, 99, -130, 90, 78,124,249, 57, 22, 30, 95,163,115,105,153,104,169, 78,251,252, 10,181,243, 27, 40,237,147,116,187,220,191,181,207, 48, -117, 19,165,162,116,234,229,145,177,164, 70,146, 20,134, 80, 8,188, 64,146,230,134, 52,205,201,250, 35,119, 96, 77, 7, 46, 29, -178, 30,162, 60, 31, 95,150,212, 2, 65, 67, 9, 86,231, 99,214, 58,117, 66, 41,216, 31,166,188,113,124, 68,183,232, 51,204, 50, - 36, 18,137, 34,142, 60,114,105,241,101,192,146,181,172,214,154,104,207, 82,144, 19,249,154,195, 73, 78,102, 45,243, 90,161,164, -219, 31, 99, 33, 23,130,204,237,209,168, 55, 34,250, 6,106, 43, 75,120,129, 71,150, 20,212, 25, 80,211,130,222, 40,197,247, 53, -158,114, 66,194, 32, 12, 80, 74,163,124,207, 29, 80,181, 70, 2,254,234,121, 82,169,177,123,119,208, 81, 92, 45,173,197,140,143, -160,148,114,247, 4, 79, 35,148,231,238, 41,158, 70,120, 10,161, 61,164,246, 80,158, 70,104,237, 30, 90,111, 99,172,160,200,199, -152,100,130,205, 18,202,116,132,244,125,151,200, 89, 93, 11,201,176,135, 49, 80, 91, 89,197,187,120,137,163,116,200, 87, 62,255, -127, 16, 42, 73,224, 73,198,185,101, 84,148,140,115, 67, 82, 77,240, 50,131, 67,173, 78,187, 93, 99,241,108,201,114, 45, 96, 46, -244,137, 61,143, 90,123, 29, 21, 45, 82, 78, 78, 40,138,140, 36,207, 57,201, 50,246,199, 41,221,164, 32, 47, 75, 50, 99, 40, 13, -206,106,118, 38,201, 49, 80,146,134,167, 88, 12, 61,154,202,113,252, 71,153,225, 36, 55, 36,198, 86,143,113,233,112, 66, 57,167, -141, 11,110, 54,120,210,226, 41, 80,194,237,201,207, 38,224,216,106,167, 62,213,139, 40, 41,208, 72, 98, 37,104, 42,201,188,239, -177,236,123,104, 25,213,177,165,101,124,176,141, 16, 37,218,175,225,215,155,149, 13,200,146, 13,123, 80,102, 68,157, 14,186,189, -204,201,123,111,211, 90, 94,165,185,113,158,238,157,123,120, 8,214,174, 60,197,219, 95,248, 99,236, 82,135,141, 39, 30, 39, 25, - 12, 56,218, 61,100,113,113,129,250,226, 50,195,147, 1,221,157,125,214, 47, 95, 32, 27,141,105, 44, 47,210,121,228,113,172,201, -177,194, 67,199, 77, 39,132,201, 51,247,117, 13, 27,228,131, 67,116,216, 68,132,173,234, 38, 35,201,142, 30, 96,179, 20,127,229, - 60,121,239,208, 37, 48, 77, 70, 72, 13,119, 95,254, 50,243, 23,207,131, 73, 57,122,117,155,163,155,183, 89,121,100,149, 39, 62, -245, 41,142,239,111,179,117,253,117, 46,126,248, 35,220,121,229, 53, 54,159,184,138, 10,155,220,253,250, 53,118,239,188,201,210, -250,227,236, 62,220,194,215,146,165,139,143,224,215,235,156,236,247,145, 10,238,189,117,155,124,220,229,242,179, 79, 83,155, 95, - 99,210,237,227,251,117,154,107, 23,216,187,247,128,225,241, 17, 74, 7, 28,238, 30,144, 79, 44,147,222, 77,194, 78,135,247,174, -221,198, 11, 98,188, 40,162, 72, 83,194, 70,135, 64,199,248,243, 75,168, 32, 32, 57,233, 67, 89,112,124,239, 30,175,253,250, 47, -163,194,136, 39,190,251,135,216,120,234, 42,215,255,228, 11,172, 94,126,156,230,194, 34, 69,154,242,212,119,125,146,116,156,112, -243, 43,175,176,249,252, 51,148, 89,202,112,175,203,226,133, 77, 74, 83,186,105,135,246, 42,207,178,229,153,143,126, 55, 91, 95, -250, 61,172,146,238,116,106, 44,148,206,111,238, 41,119,243,109,104, 65, 67,104, 98, 41,136,173,196, 71,160,173, 70,215, 26,196, - 43, 23, 25, 38,125, 76, 62,174,106,131,156,237,127,207,218,202,222,223, 72, 86,133,176, 74, 41, 83,192,227,255,248,151,152,255, -216, 95,170,244, 90, 6, 65,138,176, 57,179, 52, 22, 33,193,106, 87,200,205, 8,202,148,108,127,159,254,254, 46,201, 96,200,240, -164,199,168,219, 37, 73,146,106,164, 13,121,146, 82,100,133,139, 70,204,156,157, 47, 73, 83,124,191, 65,216,236, 16,197, 49,121, -158,147,231, 41, 20, 96, 68,233,224, 54, 90, 34,149, 36,172,215,177, 24,106,237, 86, 53,221,207,153,255,228,103,184,255,185,127, -226, 94, 67,201,204,147, 46,236,169, 74,118, 26,128,129, 21,213,244, 66,204,210,222,166,244,178,233, 78, 89,202, 41,250,210,141, -126, 69,149,176,118, 90,134, 78,189,236, 83,120,155,235,147, 43,124,234,172,243, 20, 51, 60,234,217,136, 89,123, 54,145,236,172, -184, 14,183,173,154,118,224,167, 54, 50,135,144,116,135, 20, 57, 59,132,157,242,218, 93,247, 92,100,125, 39, 76,154,198,175, 86, - 46, 9,183,255,113, 40, 89, 33,220,254, 94, 10,135,217,244, 91,231, 40,179, 1, 34,233,206,110, 64, 14,219,154, 97,211,163, 25, - 43, 94, 78, 17,190, 51, 2,158, 99,230, 79, 83,248,166,169,111, 83, 19,238, 12, 53, 59,227,254,115,154, 34,119, 86,228, 94, 69, -198,114,118,170, 96,170,160,122,156,245, 81,135, 62,101,173,195,222,221, 63,226, 35, 47,252, 48, 54,185,139,148,146,189,123,215, -233, 63,124,157,224,188,225,201, 79,126, 15,178,181, 14, 40,198,175,255, 33, 39,119,183,144,145, 38,140, 3, 14, 94,123,139,250, -179,159, 32,122,228, 42,241,227,207,147,110,221, 97,176,119,200,248,248,132,236,164, 79, 16, 47, 81, 15, 7,104,113, 68,203,151, -180,227,128,187,189, 9,135,169,165, 95,173,171, 10, 5,157, 90,192,113,127,140,231, 7,200, 40,100,175, 59, 97, 53,158, 99, 50, - 24,131, 53, 52,150,219,120,161, 69,107,143,218,124,157,180, 55,161,204, 74,106,235, 13, 86,218, 25,253, 81,200,113, 82,242,214, -225, 9,115,126, 31,141, 71,195, 52,240, 77, 64, 61,212, 20, 72,250,105, 78, 18, 24,140,112,132, 49, 9,100,165, 37,179,134, 88, -104,252,202,207,172, 42,208,210,168,204,217,126,112,143, 15,175, 95,224,149,173,187, 60, 90,187, 74,115,169,193,157,111,148,180, - 26, 53,162,208,103,111, 48,198, 24, 67,150,103, 76,198, 67, 71, 25, 21, 18, 29,213,240, 61, 13,194, 77,212,188,149,243, 36,141, - 37,204,141, 47, 83,143,106,148, 56, 55,138, 27,158,148,110, 71,173,165,187,134,166,200,216,106,180,237, 52, 52, 78,196, 70, 16, - 35,130,192, 57,155,138,156,201,220, 10,163, 68,178,126,245, 73,196,141, 63, 39,235,117, 17,181, 26,210, 56, 40,154, 49, 37, 50, -240,208, 43,171,220,251,210,239, 83, 26,208,190,165, 40, 97, 82,150,244,179,146,194, 88,242, 42, 15,192, 84,190,117,107,166,131, - 65,199,111,207,138,146,188, 40, 41, 75, 75, 54,238,161,199, 35, 76, 49,193, 88,247, 92,101,169, 40,166,194, 79, 37,240, 50,137, - 17, 46,121,176,180,167,238, 32, 91, 97,175,157, 5, 85,186,144, 44, 89,169,224,173, 75,197,244, 4,100,249,153,239, 70, 21,136, - 16, 74,133,172,194,167, 60, 33,201,173, 33, 85,130, 36, 55, 20,103,181, 34,210,209, 90, 84, 21,213, 26, 42, 69,203, 19, 68, 82, -162,126,234,239,254,245,207,102,195, 46,245,249, 21,188,206, 18,101,150,114,255,245,151,161, 40,137, 58, 11,140, 15,247,152,187, -248, 24,202, 15,200, 71, 67, 70,135, 7,156,236, 61, 32,108,182,232,239,239,210,217, 56, 71,127,127,151,243, 31,248, 48,163,238, -128,254,209, 30,202, 15, 9,162, 58,210,247, 73, 39, 35,194, 56,162,209,104,209, 90, 89,164,190,188,134, 84,154,104, 97,197,217, -151,116,128,212, 1, 66, 71, 8,114,132, 14,201,199,125,146,253, 59, 4, 11,143, 96,178, 30, 82, 8,138,201, 0,207,171,225,205, - 47,210,123,239, 6, 65,179,142,181, 37,163,227, 67, 14,110,220,228,220, 7, 63, 72,214,235,211,219,217, 35, 8,224,252, 7,158, -199,143, 91, 36,131, 1,163,131, 35, 54,159,126,186, 2, 3, 40,210,241,144,162, 40,184,246,197,107, 60,246,236, 26,209,252,121, - 30,126,243, 22,207,125,207, 39, 40, 82, 75,145, 25,144, 5,111,191,250, 14,129, 26,209, 94, 90,166,187,191,205,164, 63,230,224, -254, 61,178,116, 72,255,168,203,222,237,247,168, 55,107,188,253,202, 53,218,173, 38,158,158,176,178,186, 65,153,103, 80, 72,146, -241, 24,145,236,209, 94, 90,192,147, 49,199, 15,222,102,116,176,199,241,189,119,105,173, 94,192,175,215, 88,125,236, 81, 46,190, -248, 49,100, 16,225, 71,154,221, 27,239, 49,127,225, 2,111,254,225,231, 89,127,226,105,172, 2, 63, 12, 65,120, 44, 94,216, 32, -108, 52, 56,184,187,205,226,197, 13,132,167, 9, 60,207,141, 86,171,142,172, 52, 37,171, 87,159,231,206,239,124,206,133, 10, 88, - 75, 42,220,255,141, 0, 45, 4, 53, 37,233, 72, 69, 83, 74, 26, 82, 17, 75,133,150,210,105, 84,130,128, 98,124, 66,222, 63, 60, -221, 45,219,211,253,238,217, 6, 73,169, 83, 18,218,180, 51, 18,194,210,122,242, 67,124,232, 55, 94, 37, 62,119,185, 26, 3,231, -136, 98,186, 87, 21,103,186, 64, 9,101, 74,217, 63, 36,217,223,102,235, 27,175,114,247,218, 53,246,238,223,227,112,103,135,254, - 73,143, 36, 25, 83, 20, 57,166, 40, 40,203,156, 50,203, 41,173, 65, 10, 75,146,100, 40, 63,164, 44,115, 71,166, 50,133,131, 98, -120,202,197,211,122, 18, 47,168,163,124,141,146,130,176,217,193, 15, 3,252,118,135, 40,212, 8,237, 97, 45,232,184,206,206,111, -254,194,108, 44,103,167,101,253,125,158,123, 7,191,152,122,233,173, 53,103, 58,246,111,129,235, 76,165,227, 46, 20,242,116,220, - 93,165,165,205,108,111,213,238,221, 78, 73,104,138, 89, 62,186, 16, 2, 43, 79,129, 45, 82, 77,179,194,207,196, 87,138,179,130, -178, 83,175,255,116, 5, 34,206,226,104,207,240, 2,164, 60, 19,105, 58,245,135, 83,249,228,121, 63,187, 93, 76, 5,127,211, 53, -195,244,103, 37, 8,175,137,215,218,192, 76,142, 48,101,114, 58,189,168, 16,188, 24, 51, 27, 57, 74, 33, 42,206,254,140, 11, 55, - 59, 16, 58,177,229,116,236, 62, 29,118,152, 51,180,184, 25,228, 0, 59, 61, 53,158,233,218,167,186, 4,170,164,193,105, 68,171, - 16,150,112, 99,157,246,115, 31, 39, 75, 51,142,110,190,197,202,198, 83,136,180,207,123,127,242, 91, 12,186,175,176,241,209,101, - 86,190,231,251, 80,139,151,176, 71,239, 48,126,247, 13,134,119,239,114,248, 78,151,198,249, 14,197, 56,103,238,137, 11, 4,237, - 21,100,220,194, 78, 18,138,110,159,124, 84,146, 77, 36,195,221,156, 47,253,246,203, 60,126,126,158, 34, 29, 50, 26,101, 36,133, - 65,121, 30, 74,128, 39, 44, 65,224,161,148,102, 56, 76,136,180,100,121, 62,166, 63, 46,104,180, 98,198,227,148,192, 55, 4,161, - 66,218,156,120,177, 93,101,129, 23,212, 23, 27,132,157, 22, 65,172, 9,180,162, 28,165,132, 18,174, 46,183,200,114,203, 82, 67, -129, 54, 28,164, 9,131,204, 81,213,186, 54, 99,161, 1, 77,237, 70,193,161,167, 25, 23, 5,117,165,232,248, 26, 95, 56,251,107, -224, 73,180,146,248,210, 21,198, 16,195,237,193,136,185,165,121,130, 56,230,238,245,215,241, 61,133,239,105, 90,161,207, 40, 45, -240, 3,133, 86,218,113, 12, 4,248,129, 95,225,128,181,227,135,148, 37,218,147,168, 71,174, 50,216,219, 38,200,199,136, 32, 56, -189,166,165, 64, 8,215,173, 75,173,176, 72,183,234,243,181,251,198,121,218, 77,128,234, 45,132, 21,228,113,200,176,179,136,149, -138,180,223, 39,104,175,208,252,232,247,225, 47, 46, 99,183,223,115,209,218, 90,129,146,212, 87, 47,226, 63,122,149,207,255,202, -191, 96,251,238, 77,180,148,140, 51,195, 40, 47,153, 20,182, 2,208,184,245, 85,110, 64, 73,229,152, 10, 37,196,158, 36, 86,146, - 80, 75, 58,190,166, 30,250,104, 91, 98,243, 20,112, 63,159,203,136, 50, 94, 96,191,223,103,144,164, 46,155, 66,224,248,241,211, -240, 21,156,226, 61, 86,130,118,224,177, 90,139,168, 43, 15,139,229, 36, 41,220,225,194, 90,114, 99,201,172, 19,198, 9,225,158, -167,230, 41, 98,165,137,148,197,147,130,154,148,196,213, 89, 53,183,150,242,204,100, 14, 33, 48, 2,148,117,174,165, 72, 10, 22, - 3,197,178,231,209,212, 26,245, 51, 63,249,119, 62,219,216,120,134,253,183, 95, 65,218,156,209,222, 46, 11,155,231,136, 23,151, -208, 65,136, 53, 6, 29,197,152,210,210,189,123,143,209,209, 33, 43,143, 95,198,175,181,241,107, 13,186,247,238,208, 92,223, 96, -120,124, 76,127,239, 0,207,211, 68,205, 8,161,125, 38,195, 33,113,171, 73,125,161,205,240,168, 71,125,101,137,108, 52,164,189, -121,209,125,209,131, 90, 37,248, 49,148,195, 19,100, 24,131, 80,216,113,159,104,101,141,236,248, 16, 97,114, 6,219,119, 8,154, - 77,250,219,119, 8,231, 86, 33,205,208,157, 5, 6,119,111, 18,119,154, 12,119,142,153,187,250, 4,249,201, 9,113,163, 65,231, -194, 35, 8,169,145,126,200,241,253, 7, 72, 79,115,112,119,139,195,251,119,232,237, 30,186,125,173, 84,136, 20,154, 75, 49,195, -147,130,116,116,130, 48, 5,147,108,136,231, 69,108,189,187, 71, 35,130, 39, 62,249, 18,255,238,151, 62,207, 51, 31,187,128, 31, -205,177,188,185,134, 36, 96,255,206, 45,206, 93,189,192,238,182,101,243,156, 98, 50,177, 14, 55,184,186, 64,158, 73,202,178,164, -221, 9,169, 45,204,147,229, 30,245,205,199,169, 47,172, 35,188,128,197,139, 87, 72,122,199,244,182,238,211,221,221,165,181,186, - 73,103,101, 25, 21,248,180,215, 54,144,158,100,126,243, 34, 15,223,250, 38,115,235,231, 72,135, 19, 12, 41,199,247, 30,210,152, -159, 67, 5,158,227,239, 43, 53,179,250,228, 89, 89,249,189, 45, 65,163,195,173, 95,251,151, 88, 3,185,132,212,194,184, 18, 48, - 73, 4, 53, 37,104, 90, 73, 75, 40, 34, 4, 30,138,176, 54,135, 40, 11, 68, 54,118, 90,134,105,172,165, 16, 72,169,102,241,154, - 51, 69,183,168, 20,205, 51,175,177,187, 33,159,251, 91, 63,197,227, 63,243,175, 79, 71,165,229, 0,178,209, 25,236,105,101, 99, - 26, 15,201,123,123,108,191,254, 26,183, 94,123,149,251,111,189,201,241,193, 1,233,120, 76,154,101,110, 85, 92,173, 15, 76,149, -122,160,181, 66, 88,139, 18, 2, 37,221,151,217,148, 6,173, 53,198, 22, 20, 89,138,177,101,133,254,117,163, 97, 37, 36, 58,240, - 81, 65, 72, 88,171, 97,181,166,227, 91,202,183,175,161,214, 54,144, 90, 99,173,229,228,181, 47,146, 29,110, 79,229,109,174,187, -158, 6,180,216,211, 92,117, 91, 85, 78,113,182,168,114,246,165, 85,143,153, 69,142,158, 90,179,196, 25, 13,130,157,122,196,171, - 93,249,251,246,241,226,108, 39, 95,165,176,153, 51, 25, 38, 83,204,140,176, 51,235,215, 20, 22,115, 26,228,114,186, 87,159, 37, -197, 33, 16, 94,224, 34,115,229, 41,142,117,250, 58,102,190,123,113,198, 73, 40, 78, 19,182,102, 51,192,170, 91, 16, 38,165,152, -116,177,197,176,186,169,155,234,181,159,241,192, 35, 78,163,118,207, 38,181,157,129, 9,113,150,127, 48,133, 25,205,108,106,118, -182,134, 48,165, 57,197, 6,203,111, 57, 97, 86,215,182, 21,118,182, 32, 17,128,142, 2, 26, 31,248, 56, 50,108, 80,230, 67, 22, - 23,150,216,254,210,175,162,162,123,172,127,228,131, 52, 94,248, 56,102,210, 71, 80, 80, 28, 29, 50,217,223,119,113,173, 69, 6, -147,140,193,195, 62, 81,251, 89, 38,247,187, 52, 31,121, 12,123, 82, 98,242, 22,121,226,243,205,255,247,139,188,241,229,183,248, -228, 75, 87, 56,238,238,113,243,222, 17, 71, 73, 73, 90, 77, 31, 66, 79,184,204,140,188,192,179, 37,101, 97,152,111,187,107, 51, -110, 5, 20, 69, 78,103,121, 17, 83,102,204,173,181, 41,210,140,230,249, 11, 88,105, 9,219, 13, 68,105,208, 81, 72,109,101, 13, - 89,142,208, 90, 18,215, 2,138,194, 82,100, 5,213,154,151, 88, 27,106,177, 69,123, 14,204, 21, 87,186,135,208, 83,164,101,137, -174, 14, 86,115,113, 64, 40, 37, 94, 85,204,125, 95, 19,123,154, 88, 43, 94,239, 77,152,251,192, 21, 22, 22,231,216,187,119,143, -189,219,183,104,212, 99, 60, 79,161,165,163,203, 25, 36, 82,187,236, 0, 91, 58,225,168,246,131,138, 98,168,170,245, 12,216, 52, -135,185,101,210,246, 42,102,247, 14,158, 22,224, 5, 14, 53, 44, 65,248,142,229, 46,164, 67,144,219,202,179,149,151, 37,214,143, -136,154,115,100,245,136,174, 41,209,198,197,106,155,162, 36, 79, 82,234,173, 22,165, 12,105,126,251,247, 19, 54, 66,134,247,111, - 49,216, 59,102,227, 63,253, 49, 0,254,232, 55,126,145,222,225, 14,194,194,164, 40, 25,100,134,172,180,192,233,168, 28, 41, 9, -252,144, 52, 75,241,181, 99,188,251,190, 36,214, 30,115,113, 64,221,243, 8,148, 66,226, 4,162,105,150,147,251, 77,250, 89,193, -238,241, 46,198, 24,124,229, 81, 15,124,202,162,112,158,243,234,240,174,133,160, 30, 72,230,194,128,245,102, 11,191,204,176,165, - 97, 84, 88,210,210,184,172, 0, 99, 49, 86,184, 73,134, 83, 21,209,110,214, 88,109,206, 35,242, 33, 30,142,251, 46,133,194,106, -205,184, 52, 51,206,188,154, 81, 51,221,222, 94, 33,168, 43,201,162,214,204,123,138,134,167, 81,159,253,217,159,250,108,145,116, -177,101, 65,125, 97,137, 50, 77, 65, 88,130,133, 11,236, 95,127,133,198,234, 58, 71, 55,111, 80,150, 9,131,157, 29, 22,206, 47, - 83, 63,247, 52,111,253,222,111,179,125,227,117,148,231, 97,198, 3, 22, 31,127,146,241,241, 9,173,149, 21,172,129,157,119,223, -101,245,242, 5,198, 39,125,252, 56,102,225,194, 69,132, 16, 68,115,139,232,184, 6, 74,161,162, 38,229,168,143, 12,155,238, 6, -229, 69,148,201, 8, 29,215,193, 42, 84, 24, 97,139,156,104, 97,141,180, 63, 32,106, 55,145, 94,132,110,181,217,127,237,235,196, -243,115,110, 47, 83, 26,162,229, 85,202, 36, 99,235,250,117,218,155,107, 36,131, 49,239,124,233, 47,200,250, 71,132,245,144,241, - 96, 76, 28, 6, 12,142,143,104,180, 27, 68,173, 58,249, 4,194, 72, 49, 56, 58,161,181,208, 32, 77, 75, 58,139, 13,130,230, 28, - 90, 40, 54,159,126,156,111,252,209,171,188,240,177, 39, 89,127,246,195, 20, 89,201,238,189, 29,238,221,188, 75,179, 41,104,204, -157,163,187,181, 69,107,190,197,160,123,136,149, 22, 73, 73,239,240,128,214,114, 11,191, 94, 35,207, 36, 81,115, 5,101, 11,182, -175,125,141,254,222, 13, 6, 7,199, 60,242,209, 79,209,222,220,100,235,218, 43, 4,181, 22,249, 36, 97,251,173,119,104,174, 44, - 16, 55, 26,196,173, 38,163,238, 9,221,123, 15,121,235, 11, 95,224,241,111,255, 24,227,193, 0, 63,170,161,195,128, 34, 51,232, -106,247, 56,153, 56, 60,100,158, 21,168, 40, 64, 43,201,209,181,175, 50,218,189, 71,102, 44, 35,229,138,187, 5,180,128, 16, 73, - 75, 72, 26, 66, 17, 11, 69,224,215, 8,162, 14,214, 76,170,252,108, 59,131,151,156,197,165, 79, 39,177,114,118,219,172,110,184, -202,229, 54, 63,250, 15,126,129,245, 31,250,209, 74,189, 60,192, 78, 14,177,121, 62,235, 6,177,134,114, 60, 98,178,191, 77,247, -238,109,182,111,222,100,247,193,125, 38,227,145,219, 69,102, 25,101,158, 33,172,179, 34,153,178,196,243, 20,121, 81,128, 45, 41, -138,156,210,148,212,163,128,164, 44, 41, 77,201,168,215, 69,135,117,130, 40,162,168, 40, 89,158, 31,225,249, 30,194,243,209, 81, - 4, 64, 16,213, 16, 65, 72,156,244,225,230, 55,241,151,214,144,139, 75,179,132,191, 50,207,233,191,242,103, 78, 41, 62,197,189, - 86,122,129,233, 72,119,134, 36,149,156,137, 60, 61, 83,236,166, 34,174,106,173,207, 20,178, 51, 27,191,159, 13,115, 57,203, 87, - 63,131,215,157,238,166,167, 59,242,105,188,170, 18,239, 3,203, 76,177,183,150,138,238,103,207, 28, 50, 92, 42, 13, 50,104, 84, - 94,255,170,183,151,142,206,104, 77,126, 42,218, 57,243, 1,139, 51,175, 71, 40, 89,101,183, 11, 48,242, 52, 22,246,253,211,126, -231, 76, 96,106,189, 63, 45,224, 83, 40,207,244, 26,154, 22,225,217,241, 66,201, 83,133,251, 20,192, 83,169,251,165, 58, 19,254, -161,228,153, 20, 64,197, 41, 58,206,173,116,102,172,248,138,150,232, 62, 31,229,222, 87,229,209,254,142, 31,161,246,220, 75,152, -116, 68,122,124,128,121,243, 75,216,248,136,246,229, 75,132,235,231,156, 48,137,128,124,251, 14,233,254, 3,108, 50, 97,114,208, - 71, 71,138,178, 40,104,159, 95,160,126,126,137,225,253,140, 27,191,254, 5, 66, 95,177,123,231, 33,127,252, 11,191,201,242,188, - 96,113,197,242,213,111,190,203, 56, 73, 25, 76, 74,226,154, 71, 97,220, 65, 58,181, 2, 91,150,196,194, 18, 41, 65,187, 25,177, -220, 9,136,162, 0,169, 4,121,110, 24,246, 83, 55,113, 42, 38, 8,105, 73, 71, 3,226, 86, 19,237,215,177,210,160,252, 16, 91, -166, 88, 83, 82, 38, 41, 58, 12,153, 12, 19,234, 53,207, 29,218,243,146,126, 82,226, 11,156, 6,166, 44, 81, 74,146,100,153, 11, -247, 16, 48, 31,249,244,210,130, 21,207,195, 87,174, 96,212,124, 69,224,121, 60,148,146,219, 43, 29,158,248,244,139,212,195,144, -127,243, 27,191,131, 60, 57,100,126,177, 77, 45, 14,136,234, 13,116, 37,246, 10,226, 54,121,153,187,216, 96, 33, 81,190,154,165, -227, 10, 81,117,236,211,233, 78,197, 17, 40, 22,207,147, 10, 5,189, 61,180, 0, 17, 71,160, 93,103, 47,167,102, 15, 37, 72,138, - 2,171, 3, 26,107, 23, 25,248,138,126, 62,113, 17,169, 2,138, 60,199,162,171, 41,145, 70,123, 30, 73,247,152,249,103, 62, 72, -231, 67, 47,177,252,210,247,204,172, 98,119,111,188,206,189,119,174, 33,112, 57,228, 89,225,242,205,157, 63,221, 98,133, 98,105, -105,133, 86,187,197,104, 60, 64, 25, 23, 87,237, 41, 73,203,211, 44,134, 1,205, 32,196,151,202,161, 91,171, 85,219,120, 56, 96, -239,248,144,180, 40,240,149,164,221,108, 83, 15, 2, 38,201,132,194,184,231, 23,184, 66,219, 9,124,174,158,187,204,230,226, 26, - 50, 29,129, 49,140,139,130,110, 90,208,203, 74, 70,165,197, 15,154,188,176,241, 2, 63,244,237,127,141,255,228,211,159,225,197, -181,143,178, 17, 63,193, 83,143,126, 39,123,135, 55,144,197,136, 90,163, 69,161, 4,105,146, 97,113,205,140, 16, 2,173,221,247, - 85, 33,240, 17,204,121,138,165,192,163,237,105,106, 90,185,216, 86,165, 36, 81,107,158, 34, 75,193, 26,162,185, 21,210,195,109, -226,249, 69, 78,118, 14,128,146,246,185,203,120, 94,141,160,217,226,240,237,215,241,131,152,149, 71, 54,241,162, 58, 94,173,198, - 55,127,255,247,217,124,234, 81,182,223,125,151,168, 22,178,249,228, 85,210, 52, 39, 8,125,230, 47, 93, 37,237,247, 41,210, 4, - 79,187,177,167,210, 62, 38,155,160,235,109, 76, 50, 68,214,218, 80,184, 96, 22,119,101, 4, 20,131,125,167,202, 47,114,124, 95, -161,226,121, 76, 54, 33, 57, 62, 98,241,202, 21,118,223,248, 6,107, 47,126, 27,181,204,114,120,237, 85, 14, 31,108,177,184,185, -198,164,215,229,250, 31,253, 49,235, 87,174, 16, 4, 43,188,241,133, 47,209, 88,210,216,246, 42,243,235,235,236,223,191,195,130, -202,232,108,174,147, 28, 13, 17,162, 4, 60,154,243,117,154,171,143,208,219,222, 39, 47, 18, 14, 31,236,241,216, 11,143,211, 90, - 95,228,238,235,239,112,239,230,219,100, 19, 73, 58,220,229, 3,159,248,110,182,222,217, 37,170, 67,191, 63, 32,140, 98,198,253, - 30,225,230, 42, 94,212,164, 62,215,153,249,145,203,172,143, 53, 33, 79,126,223, 15, 35,131, 26,197,184,207,221, 47,254, 17,173, - 11,143,178,120,254,113,134,199,199,172, 63,121,133,214,104,137,225, 65, 15,177,164,176,101,206,197,231, 63, 0,192,230,115, 79, -147, 37, 57,139,231, 55, 57,217, 59,164, 62,191, 64, 16, 85, 59,168,204, 34,173, 65,133, 17,161, 86, 46, 21,171, 44,121,226,111, -255, 52,219,111,124,177, 58, 11, 22,104,227,138,185,181, 22,173,221,126,199, 17,208, 4,148, 99,210,193, 54,210, 22,136,105, 82, - 31,118, 22,220, 80,230,133, 99,133, 76,215,150, 85,199,110,167, 5,198, 88,174,252,179, 95,103,225,195, 47, 97,108,129,152,236, -185,226,160,156, 69, 5, 33,161, 72, 33, 47,200, 70, 3, 70,135,135, 28,110,239,208, 59,216,167, 44, 10,108,158, 83, 20, 57,121, - 81, 58, 79,184,112,214,178, 73,146,162,211,148,143,125,248,131, 52, 58,115,200,241, 8,211,159, 56,213,123,123, 14,121,233, 42, -121,123,158,131, 91,111,243,181,223,252, 55,248,181,208,217, 61,242, 9,134, 26,100, 41, 70, 73,132,246,241,155, 77,130,209, 49, -234,238, 13,104,118, 80, 65, 12,121,138,245,124,108, 94, 48,255,109,223,195,189, 95,248,135,216,202,143,110,166, 81,115,114, 42, -246, 23,167, 5,187,218,119,155,217,254,253,244,192, 99,103,190,107, 78,227, 69,229,116, 74,124, 6,226, 82,217, 13,169,252,232, - 74,156, 73,133, 59, 99,216,158,118,243,166,180, 51,193,158, 59, 48,152, 74, 33,238, 64, 56,214, 0, 74,206,246,228, 42,158,195, -107,159, 39, 63,186,131, 73,186, 85,231,158, 82,154,108,246,188,198, 58,134,128,153,230,196,207, 94,139, 58,205, 66, 47, 45, 66, -249, 24,147, 51, 37,229,184, 75,164, 74, 99,155, 41,238, 45,198, 8, 78,227,237,220,223, 42, 85,224,132,176,213,126,213,177,239, - 29,104,105,170, 81, 64,186,247,114, 10,193,177,198,204,208,186,148,103,243,122,237, 76,160, 57,243,222, 79, 83,220,166, 7, 49, - 83,233, 55,164, 32, 94,217, 36,126,250, 99, 48, 62, 36, 79, 70,232,228, 16, 61,215, 37, 90,186, 68, 49, 73, 40,114,141, 85,117, - 14,255,252,183,104,172, 95, 64, 6, 13,132, 13,240,130, 35,132, 23,160,124, 65, 54, 25, 51,120,112, 29,191, 85,242,216,127,252, - 12,247,255,244,109,182,223,237,243, 93,127,243, 50, 95,253,211,111,176,211,205, 41, 61,197, 73, 90, 80, 6,154,222, 40,119,176, - 18, 91, 82,243, 20,120, 2,133, 98, 96, 21, 53, 9, 73, 90, 66,154, 48,206, 74,254,228,225, 24, 48, 92,238, 4, 60, 60, 86,124, -224,114,147,213,185,144,225,225, 17,126,109,136,144, 10, 47,148, 4,205, 57,138,100, 66, 99,173, 73, 89, 40,250,199, 71,100, 35, - 67,187,237,209, 29,166, 88, 5, 99,107,209, 82,162,181,160, 63, 73, 17, 8,146,162,164, 89, 11, 72,139,130, 70,228,243,236,147, - 11,172,198,138,219, 38,162, 27, 53, 72,227,136,197, 40,164, 53, 72,248,220,255,244,203,220, 62, 74,248,204,167,159,166,217,174, -227, 73,137,231,251, 40,169,144, 97,132, 23, 73, 50, 27,146,110,237, 35,215,234, 40,223, 35, 29,141,220,244,170,116,105,141,178, - 44, 81,158,135,180,194, 77,192,140, 0,147, 99, 90,115, 76, 22, 86, 92,156,237,254, 3,130,100,140, 23, 70,206, 46,106, 53,227, -195, 62,162,179,132,141, 58, 28,235,130,178,204,156,120,190,116,150, 69, 59, 77, 63,195, 50,233, 62,116,135,191,194, 50, 58, 58, -166, 54, 63, 71, 81,148,238,224, 1,116,218,115, 4,202,185, 46,181,144,248,194, 98,148,164,200, 12, 82,192,252,210, 34,115,173, - 57,182,118,239,145,231,238,179,210, 21,159,223,171,214, 81,194,150, 88,171, 48,198, 77, 35,203,188, 64, 80, 34, 37,172, 47,156, - 35, 41, 50, 14,142,247,201,147, 9,145,150,179, 48, 36,137, 37,212,138, 11,171,231, 88, 90, 88,165, 24,239,163, 61,141, 10,214, -216,104, 47,242,216,194,179, 60,114,233, 81,100,161, 56,218, 57, 96, 56, 72, 57,218,219,231, 88,245,137,163, 6,163,254, 14, 39, - 59,199,252,165, 79,253, 87,204,207, 55,248,191,127,231, 31,209,239, 15,170,104,233,234,171, 80,233,102,164, 4,105,160,230,185, - 78,189,174,192, 87,202,117,243,255,240,167,254,238,103,165,246, 73, 78,122, 40, 79,161,149, 66, 55, 58, 12,119,183,104,158,191, -204,225,245,111,176,246,226, 75, 20,253, 1,147,126,143, 98,124,194,238,205,183,217,124,246,105,218,231, 31,197,148,160,195,136, -185,213, 85,188,160,134, 48, 5,101,150, 35, 61,133, 23,196,172, 60,253, 44,199, 91,187,236, 92,127,157,206,234, 10,209,252,178, -219, 13,248, 49, 38, 75,156,232, 32,172, 65, 89,184, 19,182,210,160, 98,204,164,143,106,204, 83, 12,187,238, 48,215,156, 35, 59, -222, 67,215,155, 88, 11,253,237,251, 52, 86, 86,209, 97, 72,210, 31, 80, 76, 50,206,125,228, 69,118,111,188, 77,127,119,151,203, - 47,126, 27, 24,195,209,214, 46,100, 22,115,248,144,230,198, 2,147, 81, 74,232, 69,120, 90, 99,200, 73, 38, 5,163,227, 99,148, -103,177,182,100,112,120,204,253,183,110,177,176,220,166,181,190, 76,154,101,116,183,247,216,190, 59, 64, 23, 71, 40, 17,176,190, - 25,209, 90, 59,207,253,155, 15, 81,118,136,181, 62, 90, 59,193, 78,216,168, 83, 38,134,100, 50,100,112, 50,196, 24,131,145, 62, -181,185, 85,138, 36,225,248,221,183,208, 81, 76,231,145,199, 24,119,187, 88,161, 72, 71, 93,252, 90, 11, 47,240,241,227,136,193, -225, 33, 74, 41,164,138, 56,217,223,165,185,184, 80,217,152,132, 11, 41,177,178,138, 18,117,194, 15, 63, 10,157,127,125, 90, 0, -172, 37,152, 91,228,198,255,249, 47, 73,149, 32,197,160,172, 64,149,206, 42, 21, 35,104,162,168,161,136, 42,216,140, 82,226, 52, -143, 76, 56,139,213,148,239, 46, 4,239, 71,132, 86,193, 42, 83,165,245, 51,191,248,121,230,158,251, 40,198, 38,136,180, 11,126, - 13, 17,212, 29, 12,166,200, 65, 64,126,210, 37, 79, 38,140,246,247, 56,126,184,195,184,223, 39, 75,179, 74,161, 94, 84, 32, 25, - 11,148, 76,134, 14, 48,241, 93,159,249,126,174, 62,255, 44, 97,105, 40,143,186,228,147,132, 34,201, 72,135,137, 27, 5, 74,167, -240,111, 92,190,202,213,239,254,203, 76,142,119,216,186,113,147,184,217,114,187,191,169, 2,127,110,145,150, 73,177,111,189,134, -141,106,196, 75,171,200,213, 53,103,236,196, 34,189, 0, 25, 68,152, 44,161,127,237,213, 89,199,104,207,128, 88,202,242,212, 83, -250,173,209,240, 83,255, 62,226,253, 81,171,211,241,183,152,213,186, 51,221,182,169, 34,103,205,153,214,183, 18,184,185,115,128, - 56,165,196,205,118,229,167,145,180,239,139,151,253,150,137,246,148, 18,105,243, 17,101,210, 59, 5,248,188,143, 26,247,126,235, -219, 44, 60,103,250, 59,170,110,123,134, 2,150,166, 66,222, 78,163, 85,191,101,175,125,198, 25,225, 84,241, 18,161, 93, 40,135, -205,211,211,189,247,244,119,152,179,161, 57,204,184,249,238,117,201,247, 61,159,144,170, 58,196,216, 51, 58,129, 10,242, 83,141, - 38,103,147,129,138,204, 39,172, 32,184,240, 36,205,231, 63,137, 48, 99,138, 73,138,188,246,235,168,102, 3, 83,230, 20,131, 62, -123, 91, 61,186,119,110, 51, 28,166,244,222,121,143,206,165,117,252,133,117,228,229, 79,161,149, 65,170, 9,163, 7,135,148,153, - 96,248,240,132,175,253,193,235,156,136,140, 15,126,236,121,190,246,229, 47,113,255,168, 96,144,150,228, 5, 12, 51, 80, 88, 6, - 73, 65,164,221, 8, 54,210,146, 64, 73, 78,140,170, 14,109,130,122, 77,115,104, 32,199, 23, 0, 0, 32, 0, 73, 68, 65, 84, 60, - 44,248,221,251, 3,234,158,228, 19, 27, 49,207, 95,104,179,218, 82, 8,207,226,135, 62,218,151,152, 36,113, 43, 0, 33,208,161, - 79, 52,191,130,240, 60,198, 7,123,180, 86,151, 42, 7,137,160,213,169, 65, 90,224,107,133,242, 53, 7,195,132,113, 94,178,212, -174, 17,249, 18,223, 19,152,188,164, 95, 88,158, 88,171,179,208,138, 89,244, 13, 23,188,130,243,102,204, 47,125,254, 21,254,232, - 43,111, 18, 7, 18,223, 87, 92, 90,234,208,170,135, 21,194,187,134, 31, 69,132,245,182,139,220,142,234,228,233,136,165,222, 14, -157,249, 6, 38,172, 57, 11, 98,133, 71, 46,138,220, 29,110,181,118,247,189,162,192, 72,167, 49,177, 88, 74,161, 40, 23,214, 72, - 91,203, 76,226, 22, 99, 47, 34,245, 66,204,202, 6,114,101, 21, 81,243, 29,141,173, 44, 93,206,120,145, 99, 74,131,201, 12, 74, -187, 67,112, 89, 22, 96,170,247,197,143,241, 27,117, 60,223,101,121, 80,228,220,248,234,159,178,127,235,117,154,190,118, 28,244, - 42,162, 52, 53,110, 12, 95,148, 37,135,199, 71, 28,245, 71, 8, 43,136,125, 15,129,165, 17, 72, 22, 34,159,133,192,167,174, 53, -129,214, 40, 85,209, 26,133,164, 40, 75,210,172, 32,208,210,137,200,203,148, 70,123,142,110,146,209, 79, 75,178,194, 29, 36, 67, - 33,249,207,127,226,167,249,190,191,242,227, 92,124,246,123,169,197, 47, 18, 54,175,114,238,209, 15,243,200, 83,143, 48,233,229, -228,137, 96,119,235,152,238,241, 17,145,223, 33,235, 91,182,222,221,166, 63,114,150,241,253, 59, 7,236,239, 30,242,228,227,223, -201,230,242, 21, 30,244,110, 48, 46,114, 23,237, 90,245, 97,190,112,187,244, 57, 79,179,236,123,204,123,154,166,246,240,164, 69, - 75, 79,161,226, 6,229,222, 67,252,214, 38,200,144, 98,212,199,175,185, 78,102,243,197,143, 67,105, 41,243, 49,229, 36,161,182, -186,204,194,218, 5,164, 23,208, 63, 60, 96,255,157, 27,228, 73, 2, 24,180,167,137, 91, 29,218,171,235,120,177, 59,137,149,165, - 33, 57,222, 99,243,233,171, 68,139,171, 8,237,185,147, 80,158, 32,131,176,234,127, 20,144, 99,139, 2,225,197, 96, 50,100,220, -198,166, 67,135,129, 21,146,108,255, 1, 94,107,145,180, 55,100,176,115, 7, 51, 30, 17, 61,250, 56,197,104,130, 31, 69, 72, 45, -121,248,213,175, 50,218,222,230,210,167, 63,206,193, 59,119, 41,210,148,160, 22,176,118,229, 60,194, 94,196,228, 9,254,124, 78, - 54,129, 81,255, 24, 63, 47, 17, 6, 22,214,150, 93, 16,189, 47,233,119, 7, 60,246,161,199,241,235,203,236,189,251, 46,245,185, - 58,195,147, 49,118,210,167,190,216, 68, 17,176,118,229, 2,183,190,126,147,108,208,197,171, 27, 4, 33,141, 86,131,122, 39, 34, - 29, 38,120, 81, 72,153,105,210, 65,159,163,209, 45, 26,115,171,212,151, 47,176,254,244, 83, 40,241, 52,101, 81,114,120,239, 62, -173,141, 13,130, 90, 76, 50, 88,100,176,127, 64,212,168,163,116,128, 45, 74, 60, 63,158,141, 54, 15,239,111,209, 94,154, 99,231, -221, 59,172, 63,249, 4,147,193, 9,121, 63, 33,174,207,225,215, 60,246,239, 60,100,233,226, 6,195,163, 94,117, 56,208, 88,165, - 88,184,250, 65,142,223,122,133, 80, 40, 66, 97, 40,181, 32, 1, 2, 43,221,110,109, 86, 49, 78,239,148,114,154,103,173, 92,199, - 52, 29,105, 26, 99, 92,225,159,218, 84,170, 74,117,229, 31,253,175,180,175, 62,143,201, 7, 8,155, 64,216,170,212,210, 25,102, - 60, 0, 41, 41,251, 3,134,199, 71,152, 52,225,224,254, 67,250,199,199,140,135,125,138, 18,138,116,130, 45, 45, 69,150,160,148, -226,164, 59,224, 67, 47,189,200,163, 31,255, 54,184,123, 23,115,251,144, 50,113, 99,249, 50,205, 73, 71, 35,242,172,196, 71,225, -117, 18,132, 30, 32,187, 71,216,122,131,103,126,240,175,241,216, 39,255, 50, 95,252,220,255,194,176,127, 66, 51,136,201,133,100, - 49, 16,120, 59,119, 73,194,186,139,145,213, 62, 52, 26,174,186, 20, 5,214,142,177, 42,224,220,223,254,111,217,255,147,255,135, -188,119, 52,195, 69, 90, 91,113,221,171, 34,235,196,216, 83,123,155,173,188,250,167,162,180,153,242,124,218,176,150,165, 83,252, -170, 10,194, 51,165,186,205,242,219,205, 25,129,221,105,140,226,105, 10,171,251, 61,166, 0,229,201, 25,102,247,116,133,111,103, -135, 46, 91, 26,108,181,215, 52,147, 1, 38, 25,184,241,245, 25,143,183, 19,235,169,170, 3,183,223,226,181, 59,189, 22,166, 68, - 57,103, 15,203,103, 99, 25,107,156,237,207, 22,230, 52,164,198,158,218,237, 78, 45,126,110,231,110,146, 12,200,171,157,187, 61, -179, 62, 56,203,181, 63, 21, 12, 88,170, 48, 23,113,122,112,177,101,121, 6,144,127, 54,231,190, 34,225,201,234,239,154,101, 7, - 72, 84,115,142,250, 99, 47,224, 53,125,242, 99,200,222,250, 19,188, 0,242,188,192,164,130,227,126,136,231, 11,110,191,249, 14, - 91,183, 14,248,195, 55,186,252,252,149, 13, 66, 83,146,223,252, 11,100,216,164, 40, 67,196,220, 18,227,157, 67,240, 21,163, 97, -193,181,131, 29,158, 92,223,161, 20,150,126, 82, 98, 44,140,178,146,113,105, 89, 16,146, 64, 11,226,192, 89,254,188, 80, 82, 34, -240,139,130, 56, 10,200,242,130,193,216,240,103, 91, 3, 30,105, 5,204,105,193, 70,199,195, 11, 44,173, 86,232, 86, 72,121, 78, -153, 27,252,192, 7, 83, 56, 65,232, 73, 15,161, 53,198, 58,219,153, 64,145, 13, 70, 24, 33, 17, 5,212, 27, 30, 40,141, 82, 62, -187,189, 20, 45, 36,105,101,100, 54,182, 36, 14, 60,242,209,152,163, 73,193, 5,225, 8,116,198,228, 8, 3, 63,240,244, 50,159, - 27, 37,164,133, 64,107, 15, 95, 75, 26,205, 22,126,228,227,199,117,119, 95,148,150,218,242, 6,253,222, 8,132,207, 32,135,205, -193, 1,243,131, 3, 70,243,155,140,189,134, 91,133, 72, 67,153, 87,238, 10,173, 29,251, 95, 56, 48,144, 82,194, 1,102, 76,225, -198,245,158, 70, 6, 53,164,210,120,161,143, 45,115,164,242, 40, 75, 67, 89,150, 20, 89, 89,133, 31,149, 85, 84,180,116,239,135, - 20,100,201, 0, 93, 20, 12, 15,183,208,113, 72,103,115,195,137,222,246,182, 24,237,220,102, 49,114,185,239, 77, 93,226, 75,152, - 20,166,186,252, 5,163, 81, 66, 90, 58,144, 82, 28,213,152,111,183, 25, 84,141,163, 22, 98,102,183, 21,213, 36, 76, 9, 80, 24, - 66, 37,153, 11,125,114,147, 82,146, 33,226, 6,182,185,132,232, 13, 41,203, 33,182, 2,120,157, 63,119,129,103, 54, 94,226,104, -111,159,147,123, 39,236,239,110, 97,169,193, 80,209,125,227,132,116, 56,226,221, 55,238,177,120,174,193,194,194, 10, 15,223, 59, -228,246,193, 3,164,167,144, 24, 26,145, 79,232,121,196, 65,147,238,222,128,250,194, 42,127,227,123,127,158,255,253,247,254, 30, -253, 97, 23, 20,232,106,133, 82, 71,177,160, 21, 45, 1, 17, 2,101, 12,210, 74,212,207,253,220,207,124,118,240,240, 46,141,213, - 85,242, 65, 15, 85,107,146, 28,238, 17,117,230, 40,178,140,221,183,175,115,239,155, 95,199, 26, 67,109,110,158,228,228, 24, 99, - 75,154,107, 27, 28,188,253, 22,139,143, 92, 34,110,213,169, 53, 91,120, 97,200,168,123,132,246, 4,241,226, 18, 97,107,129,193, -206, 14,243,151, 30, 3,161, 80,126,128,144,202,141,243,138, 28,169, 29,120,198,205, 31, 53,152,188, 42,234, 37,229,100,128, 45, - 82,172,201, 73,123, 93,194,249, 5, 80, 13,122,183,175,211,222, 56, 71,109,121, 13,225, 5, 12,247,246,185,245,149, 47,178,124, -229, 81,210,126,202,155, 95,124,153,181,203,203, 24, 35,185,119,237, 29,172, 77, 56, 57, 60, 96, 60,238, 97,132,198,100, 2,108, - 65,103,117,149,213, 43, 87,137, 91, 11,140, 6, 19,116,168, 9,234,243, 92,127,249, 85, 26,157,144,254,193, 17, 81,173,201,209, -126,143,251,215,111,176,180, 22,178,124,126,147,184, 51, 79,150, 20,148,121,128,192,178,254,216, 26,158, 8, 80,113, 68, 54,154, -208, 94,233, 32,253, 22,153,173,145,140, 38,120,162, 68, 43,205, 99, 47,253, 32,227,163, 3,190,250,185,159,231,220,135,190, 3, -161, 37, 39,219, 15,240,227, 6, 32,209,190,239, 10,155,246, 93, 65,181, 37,121,154,209, 89, 89, 38, 25, 78,248,242,175,253, 50, - 27, 79, 61,203,238, 59, 55,153, 63,183, 73,216,104,114,244, 96, 11, 29,170, 74, 21,108,136,106, 53, 55, 26, 5,140,144, 68,237, - 5,238,254,217,111,161, 45, 68, 72, 2,225,178,215,106, 8,154, 72, 98, 79,163,109,149,151,110, 79,187, 62, 99, 79, 45, 81,211, -105,170,115,160,156,102,157, 75, 41,120,236,167,255, 21,203,159,254, 15, 48,217,145, 11, 83,208, 53,119, 91, 46, 50,202,113, 31, -147,141, 41,198, 99, 70, 7,251,116, 31,110,209,219,217,229,164,219,101, 50, 28,144,167, 46,102, 16,235, 40, 14, 38,207,233, 29, - 28,243, 87,255,155, 31,103,105,121, 1,123,247, 46,101,175, 79, 49, 78, 40,211, 9,197,120, 76,210,239,147,244, 71,206,243,175, - 20, 18,225,252,173, 82,129,167, 65,107,180, 20, 92,250,216,167,216,220, 88,101, 41,142,216, 60,191, 65, 20,250,160,124,172, 41, -241,107,117,252,249, 5, 88, 94,134, 60,131, 52,135,178, 68,148, 5, 86,106, 86,127,240, 71,217,250,191,254,231,106,226, 97,206, -236,177,229,183, 36,167,217, 89, 33,158,254,147,197,204,114,190,237, 20,114, 49,131,184,216, 25,180,103, 42, 98,179, 51, 14,191, -156,137,228,206, 90,204,166,145,177, 0, 74,139, 89, 7, 47,196, 41,209,206, 89,212, 42,152,141, 18,239, 43,134, 83,247,194, 44, -191,173,234,208,103,235, 1,233,246,236,214,184, 27,231,116,156,125,154,167,251,173,227,136, 83,240,208, 44,222,117,170,160, 63, - 67,147,155, 21,118, 99,177,166,152,117,247,179,100,186, 51, 42,247, 41,184, 99, 86,236,207, 68,239,218, 51, 89,235,103, 61,234, -239,143,186, 61, 37, 29,206,108,127, 66, 16,110, 92,166,253,237,255, 33, 58,176,228,199,135,248,251,127,128,209, 62,101, 2,147, - 44,224,104,239,152,253, 59,119,185,125,125,151,126, 46,216, 78, 12,143,119, 2, 86,175,172,144, 15,114,172,176,148,101, 70,113, -212,101, 50,204, 25, 30,229,244,146,146, 91,253,146,149, 50,100, 72,202, 32,117,215, 71, 93, 43,140,181,120,190, 98,119,236, 10, -188,212,138, 48,210, 20, 66, 16, 6, 26,173, 20,195,204,240,141,189, 17,155,173,128, 64,192,188, 47, 88,105,251, 52, 90, 53,218, -235, 43,104, 95, 98,179, 20,173, 5,126,232, 52, 69,121, 50,118,152, 96,156, 72, 80,135, 49, 38, 47,208,113,132,146,146,193,113, -223,129,101, 82,203,131,221, 30,135,227, 20, 93,217,157, 22,219, 1,218, 66,127,152,208,207, 13,151, 22,107, 44,215, 43, 30, 68, - 37,176,253,139,251, 61,222, 60, 28, 83,243,125, 86, 59, 53, 94,120,246, 81, 60,207,167,222,158,115, 34, 54,107,112,188,202,146, - 32,106, 98,172, 97,110,116,136,231,149,206,159, 62,233, 83, 63,222,166,174, 64,205,173, 80,106, 69,153, 23, 20, 89,142,168,214, -119, 82, 41,132,144,213,244,209,119,223, 93, 37,240,124,207, 77, 32,165,116, 60, 7,137,211,205,148,134,162, 40, 93, 93,208,218, -233, 97,108,225,166,186,158,118,143, 49, 57, 89, 54,193,243, 34, 26, 43,171,236,253,254,175, 16,174,156,227,107,191,245,139,212, - 76, 70,211, 87, 40, 33, 72, 75,195,241,184, 32, 49,206,218, 87,154, 18, 91, 13,130,148,150,164, 69, 6, 38,163,230, 41,230, 3, -205, 66, 61,164,238,105,103,251,147, 46,199,141,210, 93,203,158,168, 48,201, 24, 38, 89,201,118,183,199,110,127,200, 48,117,174, - 30, 37,225, 95,252,196,111, 50, 26,116, 25,110, 39,164,233,132,230, 66,135,251,215,238,161,180,162,123,216, 39, 25, 37,100,233, -132, 48,142,104,207,197, 52, 91, 33,251,123,123,116,179,251,172, 52,226,202,209,100,217,222,217,194,179,154, 60, 43,233,141,123, -124,226,153,255,136,215,222,253, 93,148,118, 8,218, 88, 73,230,148,100,197, 83,116, 2, 77, 67, 73, 60, 33, 29, 50,118,118, 26, -151, 26,175,181, 68, 49, 56, 65,120, 30, 22, 69,153, 78, 72,142, 15,169,139,132,181,199, 46, 83, 91, 88,160, 54,183, 68,123,237, - 28,119,191,250, 23, 44, 92,190,204,184,119,204, 96,247,128,160,217,100,184,119,192,220,198, 57, 26, 43, 27, 72,237,147,244,143, - 49,249,132,164,119,136,244, 3, 84, 16, 84, 95, 80,131,210, 10,107, 10,215, 1,232,200,221, 88,131, 6, 54, 79, 49,217, 0, 21, -197, 14,130, 19, 55,137, 58, 75,216,210,208,125,251, 21, 22,158,120, 6, 83,228,116,239,190, 75,247,230,235, 8, 81,114,249,163, - 31,103,116,120,196,123,175,190,193, 11,159,254, 48,173,245, 43,220,122,229, 13,154,205, 26,243,171,203,140,246, 79, 72,118,182, -208, 50, 97,225,226, 34, 27, 31,120,158,198,202, 26,251,247,182,217,121,247, 22,113,163, 70,109,113,149, 91,111, 63,164,233, 71, - 68, 81,131,249,181, 22,199,187, 99, 70,135, 7, 60,243,226,211, 44,157,223, 36,153, 88,118,110,223,161,119,212, 69,202,140,245, -203,171,100,185, 79,175,223,163,183,187,205,198,179, 79,128,110,227, 47, 62, 78,122,124, 64, 35, 28,208, 94,232,176,254,204,167, -185,249,167,127,200,171,191,242,207, 89,126,226,105,254,240,159,253,125,234,237, 54, 91,215, 94,195,143,106, 40, 45,200, 39, 99, -146,225,132, 60, 75,209,158, 79,212,104, 51,216,223, 35, 25,141,153, 91, 95,166,181,180,132, 45, 44,233,120,226, 10,254,104, 80, - 9, 82, 44, 73,119, 72, 84,171,147,167, 5,189,157,125,138, 44, 71,150, 5, 75, 31,124,137,166, 23, 48, 39, 60,218,202,167,141, - 98,222, 42,234, 82, 19, 42,133, 42, 29,228, 64, 84,102,137,153,239,220,156,142,126,165,100, 54, 38,157, 58,163,148,148,108,254, -205,191,199,242,119,254, 16,166,232, 34,188, 58,136,154, 43, 92,249, 24, 51, 25, 80,142,135, 36,253, 33,163,131,125,142,238,223, -163,183, 87, 21,244,209,128, 60,207, 92, 80, 66, 89,146, 37,185,179, 34, 41,143,191,241,207,255,123,252,193, 9,230,238, 3,202, -222,128,114, 48,161, 28, 13,201,122, 39, 36,199, 93, 38, 39, 61, 76,145,186,155,133,181, 20,227, 33,233,238, 14,249,206, 67,216, -221,133,145,139,194, 36,155,224, 9, 73,208,104, 32,194, 24, 58,115,168, 40, 34,136,107,232, 90, 13, 86,150, 92, 81, 56,238,186, -199,140,135,208,237, 34, 6, 39, 72,223,231,145,159,252, 31,192, 26,164,117, 68, 57,107,157, 2,223, 20,229, 44, 12,110, 26,254, - 34,236, 41,222, 73, 76, 49,166,102,250, 30, 58,203,204, 52,168,196,150,149,163, 96, 90, 96,167, 49,234,165,157,237,139,167,161, - 48,179, 84,182,234, 96, 49,253, 55,107,237,108,223,109,166,191,219,158,218,193,172,117,147, 0,236,140,247, 59,243,123,219,106, - 47,111,170, 85,129,244, 22, 8,230,175,160,195, 22, 84, 33, 44,152,234,231,102,221,205,105, 24,222,236,191,234,176, 55,195,182, - 22,230, 52,233,206, 48, 59, 72,204, 20,240,150,247,173, 45, 40,221,107,112,175,123, 10,197, 19, 51,205,221, 12,151, 53, 77,186, - 19,103,108,107,179,247,204, 84,253,192,212,239, 62,189,118, 29, 94, 52,220,184,130,191,186,234,118,145, 91,175, 98,181,162, 40, - 27,140,109,196,193,206, 33,201,201,128,254,225, 8,221,108,224,251,138,143,174,197,200, 34,227,198,239,126, 13, 99, 18,138, 44, - 67, 9,203,240, 40, 33,203,224,176,155,112, 52, 54, 24, 43, 56,232,141,169,231,117,246,135, 9, 90,107,110,157,164,172,182,125, -118, 78, 50, 46, 46, 4, 14,161,108, 45,251,189,132, 44, 43,120,120, 56,225, 75,183,123,220, 57,201, 88,108, 4,228,133, 33, 43, - 12,151,151, 99, 58, 11, 13, 60, 95, 32, 60, 5,126, 68,216,233, 32,181,118,169,128,217, 4,178,130, 98, 56, 66, 9, 15, 63,110, -224, 69, 49,126,179,129,174,133,179,192, 35, 99, 4,129,182,212,125, 65, 39, 84,164,133,161, 59,201, 25, 39, 37,190, 47,241,124, - 73, 45,244,153,175,233, 10, 77,102, 40,242, 2,107, 5,191,125,227,136,197, 32, 96, 99,161,197,243, 79,158, 39,110, 54,136,234, -209,108, 2,228,249, 62, 58, 8,145, 74,163,149,225,193,245,111, 18,215, 34, 76,225,174,179,105,210,152, 61,216, 34,124,253,255, - 99,238,157,175,179,232, 91, 58, 75,115,120,145, 79,153,103, 36,163, 1, 69,158, 97, 41,157,152, 15, 55,237, 49,184,157,185, 41, - 75,138, 34, 37,155, 36, 20, 69,225,174, 79, 83,160,125,143, 70,123,209,161, 87,125,237, 86,180,214, 56,232, 74, 28, 18,132, 2, - 47,242,120,240,202,203,116,191,244, 5,228,252, 42, 38, 29, 16, 43, 69, 40, 20,129,148, 8,227, 14,130, 74, 88,116, 5,108,169, -152, 59,164,105, 74,146,140,157,234,168, 48,228,165, 33,207, 10,138,124, 22,161,230, 38,208,210,249,202,125, 37,171,104,106,133, -176, 5,201,120, 4,198,141,240, 3,101,249,175,255,206, 63,161, 40, 74,138,220, 98,201, 57,217, 75, 8, 26, 13, 86, 30,217, 68, -123, 62, 71, 15, 15,201,179,140,122,179, 65,187, 21,145, 76,142,120,237, 27,111,210, 75, 13,176,194,131,129, 96,187,215,163, 59, -206, 57,127,245, 28,194,247, 25, 39, 35,212,164,100,103,255, 30,223,255,226,223, 39,176,174, 75,143,133, 96, 94,107, 26, 74, 17, - 9,137,135,112,161, 73, 70,160,126,230,167,126,236,179, 94,224,163, 26,171, 60,252,242,159,208,185,124,213, 65, 55,202, 2,161, - 52, 65, 20,179,244,196,115,136,176,206,248,240,144,225,209, 30,201,112, 76,222,239,209, 63,216,161,223, 61,113, 70,249, 48,196, - 98,136,230, 90,248, 81,141,254,238, 54,218,247, 81,218,195,150, 57, 97,103,201, 41,117, 85, 8, 69,130, 8,106, 80,100, 8, 47, -194,230, 35,178,222, 30,202,143,201,123,123,168, 90, 11, 12,148,201, 8,148,100,184,119, 23,105, 75, 26, 23, 63,200, 96,235,182, -251, 96,181, 79,235,209,103,233,221,187,199,171,191,243,111, 89,190,180,129,200, 82, 54, 63,242, 34,183, 95,126,133, 90,189,198, -226,197,115,236,223,123,128,239, 7,120, 97,140, 14, 74,154,107,231,120,248,206, 77,142,183,119, 81,218, 77, 15,122,189, 99,238, - 94,191,195,193,187,223,224,219,127,228,251,153,244, 83,252,120,142,187,215,222,100,105, 99,142,160, 22,177,115,103,151,210,100, -140,142, 6, 52, 23,157, 34,116,119,235,136,163, 7,119, 88,185,176, 78, 50, 73, 49, 54,101,212,155,160,205,152,214, 82,131,168, -181, 66,251,210, 71, 72,135, 19,134,219,175, 49,255,216, 11, 92,250,196, 15,112,112,251, 58, 81,125, 25,169, 53,111,252,193,191, -229,234,119,124,154,173,235,215, 9,234, 77, 38,131, 1, 97,189,134, 23,132, 28,220,121, 23,173, 67,164, 80, 44, 63,246, 56,251, -247,238,114,245, 19,223,198,201,254, 62, 71, 15,247,144,158,156, 49,193,157, 98, 86, 99,203,140,162, 44,240,131, 24,237,107,118, -255,240, 55, 81,227, 17,190, 16, 46,152, 64, 57, 64,129,143, 66, 9, 39,242,144,246,253,106,238,169,231,125,150,206,101, 69,117, -210,118, 5, 98,225,147, 63,192,229,255,242, 31, 99,242, 99,132,174, 33, 68, 0, 34,133,164, 75, 49, 28,144, 14, 78,232,239,237, -210,219,218,162,183,189,203,104, 52,100, 60, 26, 51, 25, 12, 41,171, 34,121,202,246, 46,200,135, 41, 63,248,223,253, 44,188,125, - 13,115,216,163, 24, 14, 41, 39, 19,242,225,128,180,223,103,210, 27,146,167, 19,119, 77, 10,129, 20, 18, 79,107,108,150,145, 15, -251,244,183,238, 98, 7, 99,194,197, 5, 8,131, 74,152,151,159,250,199,106,117,228,120,130, 73,134,168,160,134,188,112, 17,178, - 28,187,179, 77,121,124,136,244, 35, 24, 15,177,189, 46, 54, 12,104, 60,245, 33,246,254,224,215, 41,198,195, 42,159,220,206,130, - 77,167,156,102,113,166,141,181,239, 27, 39,115, 38,200,229,253, 49,160, 2, 49,227,235,219, 51,140,231, 41, 29,235,253,196,180, - 51,227,233,106, 8, 63, 67,211,136,211,224, 25, 41,167, 67, 0,241,190,128, 20,135, 96,172,194, 93,228, 25, 82,144, 61, 5, 5, -233,134, 83,255, 23,163,221,169,145,254,125,203,121, 59, 93,199,156,161,217,185, 83, 94, 37, 0, 52,230, 76,103, 95, 37,212,153, -211,132, 58,196, 89,235,218,169, 72,144,106,210, 35,181,152,237,214,167,135,253,233,123, 45, 43, 47,180,168, 80,187,167, 10,121, -102,180,191,217,182, 64,156,177, 12, 10,139,191,176, 74,235, 67,223, 75,184,190, 70,222,235, 82, 92,251, 85,100,220, 32,235, 15, -217,127,112, 64, 58,201,233,238, 30, 50,238, 77, 80,166, 96,117, 41, 98,161, 41,104,118, 60,130,133, 38,195,189, 49, 38, 53,244, -183, 78,232,110, 15,200, 75, 56,233,166,188,186, 59,230,197, 15, 60,198,185,143, 61,141,127,229, 18, 58, 31,243,230,219, 15,153, -111, 5,236, 14, 11,186,105, 73,164, 64,107, 69, 89, 88,134, 89,137, 18,130,135,227,146,229, 78,140, 39, 93,100,167,167, 37,155, - 45,159,139,155,117,226,249, 54, 74, 25,194, 86, 27, 63,170, 99, 61, 69,216,106, 98,134, 3,188,168,133,212, 6,225,105,116, 16, - 83,102, 9, 69, 50, 38,157,140,145,218,167, 72, 83, 76,146, 83, 20, 25,227, 65,142,181,134, 97,238, 70,239, 75,117,159, 86,205, -169,209,251,227, 12, 63,246,121,126,185,142,174, 62,131, 81,110,249,249,175,110, 97,138, 18,169, 36, 31,126,234, 18,235,231,214, -137, 26, 45,234,157, 14,158,214,232,192,195,243, 67,194,206, 60,113,103, 1,191,222, 70, 39, 93,214,203, 30,153,177, 85, 17, 49, -167,224, 41,107,177, 89,138,216,191,135,188,247, 14,209,240,128,120,105, 25,175,214, 64,248,158,235,224, 75,231, 96, 41,242, 18, - 91,228, 24,225, 86, 89,133, 41, 41, 10,215, 69,219, 34,199,139,107, 68,237, 5,178,241, 9,166,152, 32,164,193, 11, 3,215, 12, - 74,152,244, 79, 56,220,122,200,193,237,155, 68,181, 38,106,251, 30,222, 83, 47,240,205,223,249,223,104,104, 85,177,216,161,155, -228,244, 51,195, 56, 47, 41,171, 3,173,113, 8, 5, 23,136,165, 4, 30,146,186,175,152,211,154,197, 40,160,166,149, 83,191,139, - 51,185, 14, 74,161,116, 72,150, 77, 40,172,211, 78, 28, 21, 32,116, 76,154,140,241,148,228, 71,190,243, 39, 73,242,132, 34, 21, -100,227, 33,155,207,174,178,253,102, 31, 41, 36, 7, 7, 7, 44,172, 52, 73, 79, 82,246,118, 14,208,254,132,183,175, 31,113,109, -247,144, 79,127,104,135, 70,123,192,176,216, 97,175, 91, 48, 24, 75,190,114,227, 27,220,207, 95,227,217,213,143,178,191,183, 71, -189,214,164,214, 92, 70,137, 46,197, 96,135,182, 84, 44,123,146, 78, 88,163, 89,111, 33, 43,235,162,210, 2,245,211, 63,249,163, -159, 13,154,115,236, 92,123,133,149,103,159,103,124,180,143,246,124,178,113,159,100, 48,196, 74,129,210, 62,199,119,110,226,213, -106, 72,229, 1,150,122,103,158,230,194, 2, 11, 27, 27,196,173, 22,233, 56,113,251, 18, 37,241,235, 29,154,235,231, 56,124,247, - 29, 22, 30,125, 2, 29, 53, 42,240,139,196,154, 2,233,249,167, 40, 77,169, 41, 78, 14,240,219,115,152, 44, 67,135, 77, 76,158, - 56, 47,100, 62, 66,121, 17, 65,163,131,244, 20, 7,239,188, 65,173,213,196,111, 52,177, 6,246,174,191,202,245,207,255, 25, 31, -255, 91, 63,132, 80,154, 90,187,195,173,191,248,170, 75, 84,203, 18, 78, 14,247, 8,107, 77,252, 90,157, 90,187, 73, 92,107, 51, - 30, 28, 51, 60,232,115,114,124,192,100, 52,226,250,203,175, 82,164, 93,222,249,250,117,190,243,135, 94,228,104, 39,165,179,214, -225,193,219,123,116, 58, 17, 11,155,235,220,190,177,195,225,253, 55, 56,127,229, 50,101, 2,205,229, 14,219,119,118,105,196, 30, -151, 95,120,150,131,135,125,154,205,136,218,194, 18,217, 36,101,112,210, 39, 55, 49,195,147, 9,135,183, 94, 35,235,109, 19, 47, - 94,228,202,119,253, 0,152,146,133, 75, 79,240,141,223,250, 21, 62,248,195,127,157,238,221, 59,188,251,239,191,200,179,159,249, - 12, 15,222,120,149,249,245,243,220,125,253, 27,132, 81,157, 60,207, 43,171,142,196, 15, 66,230,206,109,114,124,255, 33, 11,231, - 54,220,205, 43, 8,232,237,236, 51,191,185,234, 4,103, 89, 73, 84,143,193,106,146, 65, 31,161, 61,194, 48,166,255,218,159, 33, - 10,131, 39, 37, 26,137,178, 10, 37,156,175,222,225, 65,245, 41,235, 76,128, 49, 37, 90,169,106,183, 36,145, 82,224, 55,214, 16, -218,195,171, 71, 60,247,175, 63,239, 10,186,215, 64, 8, 31,203, 24,210, 1,217,241, 49,147,238, 17, 39, 59, 59,140,142, 14,233, - 29, 30, 49, 25, 15,201,210, 9,101,150, 83,148, 37,101, 89, 98,203, 2, 42, 66, 85, 45, 8,248, 43, 63,247, 15,224,141, 87,177, -189, 97, 85,208,199,228,253, 33,105,175, 71,218, 63,193, 20, 5, 20,185, 43, 92,133,193,230, 19, 55, 53, 48,134,116,216, 35, 79, - 71, 36,163, 30, 50, 43, 9, 86, 54, 32,208,144,164,144,101, 14, 67, 27,134,160, 61,202,131,125,116, 24, 32,215,207,195,225, 33, -101,247,136,116,235, 33, 55,254,233, 63, 97,252,202,171, 4,245, 24,127, 97, 30,163, 20,171,159,249,207,120,248,107,255,234, 76, - 90, 29,179,244, 54, 23, 71, 91, 21,146,233, 78,187,114, 12, 8, 59,197,180, 86,163,111,121,182,216, 58,182,187, 43, 92,178, 82, -123,159,197,193,158,254,236, 84,120, 55, 85,214, 78,193, 46,103, 93,104,162, 82,141, 79, 11,182, 61,205, 45, 61, 21,186,137, 51, -145,169,149,128,175,138,119,161, 76, 70,148,227, 67,132, 41, 78,189,239,179, 83,201,116,164,125,122,224,152, 6,175, 8,115,170, -202,183,156, 25,171, 59, 39,221, 76, 36, 56, 93, 29, 76,255, 96,123,230,125,152, 30, 68,100,229,111,159, 30,104, 68,149, 54,101, - 75, 51,123, 13, 51,191,253, 25, 12,239, 76, 10, 50,221,119,136,233, 33, 71,160, 26,115,180, 94,252, 62,188,154, 79,126,114, 72, -254,246,239, 67, 28,113,244,112,151, 65,119, 68,154,102, 12, 15, 78, 40,203,146,149,115,243, 68,117, 77,115, 46,162, 53, 23, 35, -132,102,247,221, 99, 70, 71,125, 90,155, 77,172, 45, 24, 14, 75,114, 32,247, 91,124,255,207,252, 56,209,230, 26,178, 94, 99,253, -185,231,184,242,161,171,244, 15, 15, 25, 15,199,212,180,224,126, 63,231,222, 48,163,192, 34, 61, 15, 35,160, 21,249,156, 36, 41, -131,180,164, 17, 40, 86,155, 1,143, 44,215,240,125,141,212, 78,215, 17, 47, 47,163,180, 71, 62, 30, 81,228, 41, 94, 92,171,240, -187, 2, 91, 22,104, 63, 36, 27,118,145,158,143, 80,154, 52, 43, 0, 73, 50, 28,211, 63, 30, 3,150,113,102,104,250,146,166,175, - 8, 35,143,249, 88,147,102, 37,239, 28, 39, 60,182,212,224, 92,211, 67, 43,201,155, 7, 41,159,253,247,119,153, 36, 5,245, 32, -224, 7, 95,250, 48, 75, 27, 27,120,194, 18,215, 98,130, 90,157,168, 53, 7, 66, 98,202, 2, 29,132,132,141, 57,188,168,206,228, -164,207, 98,189, 32, 27, 12,206,196,253,150,213,122, 71, 85,215,170, 99, 68,152, 36,197,108,223,230,255, 39,235,205,191, 36, 75, -239,242,206,207,123,247,123, 99,143,220,215,170,202, 90,187, 90, 85,213,251,162,214,214,218, 90,107,131, 64,131, 25,195,193, 24, -105,102,108, 60, 22,155, 48,231,128,193, 26,251,224, 25, 97,207, 97,236,115,134, 49, 96,192,204,193, 99, 4, 70, 8,109, 52,146, - 90, 75, 75,234,150,122, 95,106, 95,178, 42,247, 53, 50,246,136,187,190,239,252,112,111, 68,100,219,127, 64,102,101, 86,222,184, -239,251,125,190,207,243,124,244,205,235,152, 27,203, 56,189,125,138,229, 50, 70, 46,143, 93, 44,166,255, 63, 73,146,249, 32,116, - 12, 75,199,241, 92, 92, 55, 71, 24,245,120,253,185, 47,112,251,149,111,227, 20,198,169,109,110, 81,223,217, 98,235,246, 50,123, -183,111, 17,244,251,184,133, 18,110,121,156,138,151, 71,107,214,185, 19,117, 88,127,225,105,138, 86,106,248,142,165,228,160, 31, -211,149, 58,113, 34, 73,148, 36,136, 21,177, 74, 5, 11, 33, 82,165,210,182, 52,114,134, 70,201,177,152,112, 61,114,134,129,173, -155,232,218,232,146,109,186,147, 96,228, 8,252, 22,113,146,208,141, 5, 78,245, 40,249,226, 4, 23,142, 63,198,147, 15,255, 50, - 55,175,172,208, 63,104,224, 22,139, 24,186, 65, 80, 87,228,202, 54,219,171, 7,105,203,101, 47,102,237,246, 22,243, 75,147,236, -110,183,184,124,103,151,223,251,219,143,113,230,177, 71,185,239,189,239,224, 29, 79, 60,194,227,239, 58,194,125,247,187, 36,189, - 58,127,248,252,101, 26,157, 91, 76, 89,199, 88,223, 94,133,216,224,241,247,124,130, 59, 23,255, 11,227,166,206,152,105, 82,173, - 78,227,218, 69,132,223, 28,174, 4,245,223,250,245, 79,125,102,247,198, 69,186,187, 53,198, 78,158,164,185,124, 13, 97, 89,120, -149, 9,246,175, 95,198, 43,231,216,120,237, 21,170, 11,179,108, 92,186,200,237,215, 95, 70, 83, 33,110,121,156,214,206, 38,221, -131, 90,154,161,211,109,204,188, 75,229,244,189, 4,141,125,162,126,159,242,226, 9,174,127,251,105, 38, 78,156, 68,169, 36,125, -225, 9,145,186, 89,179,134,174, 36,232,164, 5, 6,154,137,102,229, 16,186,133, 72, 66,100, 18,165, 89, 89,187,204,193,181, 87, -177, 61,143,252,204, 28,134, 87,198,111, 28,176,123,245, 50,243,247,220,143,165, 41,202, 71, 23, 8, 58, 33,183, 95,124,145,198, -250, 26,186,104,145, 43, 78,211,173,173, 81, 91,190,195,216, 98,145,194,212, 28,237,122,139,126, 43,228,230,149, 91,236, 44, 95, -102,102, 97,142,205, 91, 53,146,246, 26, 15,188,253, 2,222,228, 41, 26, 91,171,140, 47, 29,103,127,117,157,241,185, 9,174,188, -124,139,176,182, 73,101, 12, 42,115, 11,216,185, 50, 55,223,184, 78,210,111, 48,115,234, 8,181,173, 3, 38, 22,102,176,189, 34, -245,189, 26,221,102, 31,191,219, 39,108,238,144,244,219,180, 26, 77,172, 98,145,211,239,251,113,116, 77,176,119,123,141,177,197, - 25,194,190,100,235,202, 21,238,253,209, 31,195, 27,155, 33,137, 66,138,147, 83,200, 56,166, 52, 57,193,246,181, 27,204,223,115, -158,230,230, 38,253,102,147,201,227, 71,105,109,111,146,190,127, 19, 52, 77, 67,211, 12, 44,199,193, 27,171,208,218,218,198,176, - 45, 12,215, 33, 14,186,216,165, 18,221,189, 61, 74,199, 78,178,246,151,127,136,150,229,177,211, 22,247, 36, 59, 68,180,116, 31, -173,101,135,133,166,167,134, 56, 67, 31, 94, 38, 6, 47,120, 73,130, 12,187, 60,252, 23, 47, 35,244, 62,194,240, 16, 88, 40, 2, -146,198, 14,157,141, 85,122,141, 26,141,221,125,154,187,251,116, 90, 45, 2, 63, 72,225, 58,137, 76, 95,220, 50, 73,169, 90,137, -164,215,237,115,108,118,158,199,126,233,151,225,181, 31,162,106, 13,162, 78,135,164,215, 33,104,182,240, 15, 26, 68,221, 54,178, - 31, 34,131,104,196,103,151, 17,132, 9, 68, 33, 97,175, 71,228,119,209, 45, 29,195,180,240, 59, 13, 28, 51,143, 49, 49, 5, 82, - 34, 59,157, 84,198, 46, 87,210,195,164,151, 66, 98,180,185, 5, 26,127,242,199,124,239,231, 63,205, 43,159,251, 2,173,131, 6, -235,203,183,217,252,202,183,176,191,253,109, 10,247,188, 5, 99,233, 36,113,179, 65,235,242, 43,135,135,205, 76,113, 86, 12, 2, -102,106,144, 77, 23, 35,128,202,168, 94, 78,140, 0, 48,140,106, 94, 7, 99,167, 28, 24,235, 6, 52, 52,149,161,152, 6,133, 44, - 89,167, 58, 98,176,239, 62, 68, 68, 19,135,138, 99,134,135,166, 24,242,208, 15,145,236,179,131, 87, 28,114,206, 51,228,207, 15, -254, 89, 41, 71, 40,221,129, 1,110, 0, 71, 81, 74, 12,191,126,196,176,207,158,143,195,178,122,170,197,141,126, 62,245,230, 22, -194, 33,122,245,240,207, 51,136,174, 9, 45,253, 25, 6, 74,198, 0,154,195,168,122,115,196, 73, 31,229,255, 68,118,163, 16,140, -190,135, 61,181, 64,233,161, 15,163, 27, 33, 50, 12,233,191,242,119, 96, 41,246,239,212, 8, 98, 65,216,245, 81, 10, 76, 13,188, -162,129,174,235,232, 42,192, 0,188,177, 28,126,163,199,254,158, 79,107,183,203,234, 74,159, 40, 78,216,235, 73, 78,222,127,146, -249,199,222, 69,212,237,141, 76,131,186,193,137,119, 62,206,198,203,175, 48,230,194,137,233, 60,167,166,242,204, 85,139,140,121, - 90, 90,144, 36, 83, 26,162, 46, 52, 22,171, 57,138,142,134,231,166, 89, 70,203,214,241,138, 30, 7,119, 86, 17, 90,156,238,159, -181,148,244,167, 9, 32, 17,132,157,110, 42, 93, 11, 29,195,205,147, 72, 69,212,233,209,111,180,232, 55,122,132,126, 52,236,214, - 47,228, 77, 12, 67, 67, 87,138, 56, 81,116,253,132,213,110,194,163,139, 69,166, 43, 14,127,240,210, 14,223, 89,235, 82,180,109, - 44, 29,206, 47,205,145,119, 13, 92,219,160, 52, 62,134,101,154,233, 69, 52, 9,144,113,152, 81,211, 44,204, 66,137, 94,109, 31, -199,210,177,140,144,222,214,206,240,178,155, 38,113,178,238, 0, 41, 65, 31, 1,139,132, 38, 72,226, 4,165, 18,146, 94,135,112, -253, 22,114,249, 34,234,198,235,104,235, 87,209, 54,174, 98,236,173,145,108, 94,161,121,249, 57, 86, 95,122,154, 23,190,251, 69, - 94,120,225,235,236,108,222,198,213, 96,108,238, 46,162, 56,198,208, 83,165, 75,211, 52,220, 98, 9,195,205, 81,154, 63, 69,240, -204,151,201, 29,189,139,207,253,231,207,226,169,136,188, 97, 96,106,130, 32, 86,212,125, 73, 63, 81,132,113, 72, 55, 82,132, 50, - 99, 96,100,162,147,134,192, 18, 26, 5, 75, 99, 58, 95, 98,204,245,168, 84,166,113,115,101, 84,208, 29, 90, 73,164, 18,132,189, - 70,234,241, 74, 4,230,216, 81,204,252, 52,170,215,101,105,230, 35,188,246,194, 27, 20, 10, 37,208, 97,243,234, 38,165,241, 50, -166,229,208,239, 69,180, 27, 61,226,110,196,246,157, 61,252,176,143,102,134,188,118,121,147,223,252,211,247, 83,154, 59,146,158, -131, 73, 76,216,237,226,135, 49,113, 16,115,223,163, 15,240,196,133, 37,126,231,139,223,225,109,115,119,147,179, 43, 36,232,244, -187, 77, 78,189,229, 73,226,245,167, 41,154, 6,182,110,129,223, 65,197,254,112,211,166,255,234,207,255,204,103,170,199,207, 50, -118,252, 36,237,245, 53,138, 11,139,172,191,244, 3, 18, 5, 83, 39,206, 18,135, 1,149,217, 57,116,203, 67,200,132, 19, 15, 62, - 66,229,200, 18,219,151,222, 64,119, 60,114,227, 19,233, 75,186,177,207,212,133, 7,184,250,165,191, 97,242,204,105,146, 48,162, -189,181,202,204, 91,222,146, 86,188, 22,198,144, 65, 15,205,118,135, 70,156,164,215, 64,152, 14,194,180,144, 9,244,118,110, 99, -122, 57,100, 20,160,123, 69, 52,187, 74,119, 99,153,210,252, 44,122, 97,156,164,211,225,218,183,190,193,214,245,215, 56,241,240, -163, 68, 65,148, 70,171, 12,135,171, 79,127,139,233,227,199, 48,117,131, 99, 15,191,141,253,219,171,156,121,252, 29,204,221,245, - 0,227, 39,238,166,190,177, 67, 20,198, 52,182,235,176,219,225,196,169, 41,188,201, 9,130,221, 46, 51,139, 21,142, 60,120, 31, - 65, 71, 49,123,234, 20,123,107,219, 40, 41, 89,189,181,134,163,133,228, 74, 30, 71,206,223, 75,123,191,203,250,237, 85,108, 25, - 99,121, 58, 81,208,103,127,103, 5, 43,231,177,179,177,207,206,218, 6,145,191,207,236,145,105, 44,183,192,228,217,199,152, 92, -186, 64,109,117,149, 36, 8, 57, 88,221,166, 83,223, 99,108,225, 24,249,169,113, 76,199,163,182,178,193,220,217,147, 68, 97,196, -254,234, 29, 52,221,196,116, 29,114, 99, 85, 76,199,196, 43, 87,104,239,239, 19,247, 35,202, 71, 23,113, 11,121, 52, 76,182,174, -223, 96,251,234, 13,166, 79, 46, 17,246,251,180,246, 14,168,204,206,209,219,220, 66, 25, 6,142,231, 96,123, 30,154,237,177,254, -231,255,119, 42,149,102,221,217,186,174,167,205, 95, 25, 82, 85, 37,153,225, 42, 78,208, 13, 99,100,154,139, 85, 58,121, 1, 66, -197,156,252,149,127, 75,241,244,105, 16, 58, 66, 56, 40, 18,146,230, 38,141,149,101,234,107, 27,212,247,246,210,189,121,175, 67, - 24, 4,196,161,159,101,144,229,208,236,164,107,130, 86,167,195,163, 15,220,195,233,159,249, 36, 92,250, 1,106,239,128,168,217, - 33,233,116,240,235,117,124, 63, 76,119,112, 81,140,150,196, 68,221, 46,186,105,164,238,239, 48, 36,234,244, 82,158,122,191,151, -174, 80, 12, 11,205, 49,176, 60, 23,191,221, 36, 63,189, 0,158,131,106,119, 82,199,121,185, 12,182,141,136,211, 58,217,110,125, -159,111,126,228,239, 81,171,120, 84,114, 57,238, 95, 58, 67, 59,232,176, 34,251,212,187,125,106,255,233, 47, 24, 51, 19,166,127, -241, 55, 89,251,211,255, 43,221, 51,139, 17,184,101, 24, 9, 59, 60, 40,102,210,250,176, 42,117, 56,160, 14,118,202, 42,155,222, -197,208,212,165, 29,154, 92,165, 84,188,169,158, 69,140,128, 49,131, 23,144, 58,100,178, 19,135, 48,174,169,177,114, 48,176,106, - 8, 61,159,237, 91, 51,198,251, 97, 89, 61,131,174, 28, 46,192,145,114, 16, 95, 60, 92,189, 58,248, 58, 49,146,211, 7,215, 1, -205, 70,232, 78, 74, 86,203, 80,173,163,134, 55,134,207,153, 56,124,241, 24,200,238, 67, 68,219, 40,171, 55,194,201, 50, 58, 44, -130,139,136, 0, 0, 32, 0, 73, 68, 65, 84,168,179, 62,248, 65,249,206, 32,113, 49,116,208, 15, 11, 1,228,208, 19, 2,233,100, -111, 86,166, 41,220,247, 78,116, 67,161, 91, 14,254,230, 50,253,230, 6,126, 87,209,237,135, 4,109, 63,237,217, 46, 57,136, 68, -165,135,151, 70,106,220, 82, 9,150, 99,224, 86, 43, 88, 57, 11,221, 54, 48,138, 30, 86, 62, 71,115,127, 31, 67,139, 41, 46, 30, - 71,166,187, 8,250,245, 58, 23, 63,247,103,140, 79,186, 76, 46,205, 83,156, 24, 99,230,244,113,102,239, 62, 78,117,172, 72,193, - 54,176,117,157,188,109, 80,114, 76, 60, 71,167, 90,117,201,149,115, 68,126,128, 83,204, 17,246,250,152,174, 77,208, 9,240, 59, -109, 12, 59, 45,150, 73,194, 84, 82,151, 73, 72, 18,197, 24,142,135,210, 12,146, 80, 34,209,209,221, 28,253, 70,139, 36, 78,208, -205, 84, 89,179, 61, 11,164,194, 72, 9,170,236,116, 34,148,105, 99, 42,193,255,254,252, 54,187,173, 16, 67, 40,234, 61,159,163, -211, 19,204, 85, 11,204,204, 77, 83, 40, 22,112, 60, 15,183, 84,193,178,109,164, 82,232,186,158,149, 93,229,176, 28,151,160,219, - 99,188,168, 19, 55,182,137,235, 7, 35, 15,142,202, 90,100,212,200,152, 57,120,134,147, 88,142, 60, 17, 3, 14, 69,150,120,144, - 65,128, 10,122,196,157, 38, 65,187, 65,232,247,104,245,125,218, 42,166, 27,198,104, 89,179,218,236,201, 71, 8,250,221,116,101, -163,137, 84, 49,116, 61, 44,211,164,114,244, 44,221,167,191,200,226,199,254, 1, 79,253,245, 31, 48,102, 89, 20,244, 20, 59, 29, - 39,138, 94, 24,211, 11, 34, 90,145,164,151, 12,160, 46, 35,115,171,161,137, 20,192, 98,104, 76, 57, 6, 37, 77,226,234, 58,102, -226, 35,146, 48,101, 41,160, 82,150,123, 18,129,210,211,250,237, 56,198,111,238,178,178, 49,198, 43,175, 94,225,174, 15,174,241, -248,199,223,206,149,167,246, 9,101,143,201,217,113,208, 4,221,122, 72,183,221,102,111,101,155, 90,167,129,109,232, 52,155, 1, -103,223, 99,243,214,143, 63,153, 94, 94,227,144, 36, 14,144, 74,162,226,152, 4, 69, 24,132,140, 77, 77,241,225,243, 39,248,163, - 47,124,151,211,147,199,232,251, 1,248,130,233,227, 11, 56, 42,193,104,223,198, 72, 34, 68,226,103, 43,211,244,111, 96, 56,165, - 50,194,202, 17, 55,246,112,242, 46,253, 90,157,169, 83,119,177,123,253, 13,220,156, 75,237,214, 77, 22, 30,124,132,205,215, 94, - 99,242,196, 81,122,205, 38,189,253, 61,138, 19,227, 20,103,230, 56, 88, 93, 37,234,245,152,187,247, 1,154,183,151, 57,246,232, -195, 4,141, 58,118,121, 28,183, 84,161,223,170,227,150,203,196,221, 54,186,109,167,110, 88, 51, 71,210,111,142, 98, 67, 88, 36, -157, 13,114,147,115, 4,205, 3,172, 82, 25, 52, 11,229, 55, 82, 7,164,233, 16,181, 90,220,126,238, 89, 38,230,102,169, 44,222, -143, 94,157,225,230,215,190, 70,105,122,130,231,255,242,175,120,203,187, 31,101,251,242, 13,102,207,156,100,245,149, 75, 76,157, - 62,138, 89, 24, 99,229,165,203,172,126,245, 34,174,103, 83,223,222, 5, 91, 82, 58, 51, 78, 32, 33,175, 27, 28,125,240, 60, 73, -208,166,189,219,194,200,151,217,184,185, 74,183,213,164, 89,235,160,197, 61,156,138,205,248,226, 34, 91, 43,219, 92,124,238, 69, - 30,249,224,195,196, 93, 23,219,149,212,107, 17, 11, 75, 5, 20, 6,177, 47,113, 36,156,126,244, 2,205,253, 16, 97, 79, 32,123, -109,132,105, 80,153, 90, 96,237,181,151,137,227,136, 56,236,163,155, 30,149,249, 89,202,147, 99,152,182,205,218,197, 43,204,156, - 56, 65, 18, 70,180, 54,182,104, 30,108,115,254, 3, 31, 98,127,101,141,210,212, 4,147, 75, 75,212, 55,182, 72, 46, 94,199, 42, - 58, 40,191, 75, 28,166,101, 52,175, 61,245,117, 22, 46,156,195,246, 60,110,191,248, 60,205,205, 26,119, 61,254,104, 26,111,115, - 93,132, 46, 40,222,117, 47,237, 43, 47, 35, 85, 74, 68, 84, 34, 53, 55,141,202, 64, 52, 52, 5, 50,155,188, 68, 38,229, 10, 51, -173,136, 69,128, 85,169, 50,253,196,143,163,100, 27, 77, 43,161, 84,159, 96,127,133,221,203,151,233, 53,154,244, 58,109,250, 81, -132, 74, 36, 73, 28,167,196, 49,203, 64,134,169,185,101, 32,175,182,155, 45, 62,250,193,247,227, 62,246, 94,184,249, 34,236, 30, - 16, 55, 59,196,237, 22,129, 76, 8,247,246, 17,175, 94,198, 88,222,100,125,175,193,213,126,128,117,100,150, 40,150,196,181, 38, - 75,199,166,153, 58,179,128,233, 24,217,207, 45,211,246,170, 36,141,192, 72,191, 75,239,250,117,188,123, 46,164, 83, 82,183,141, - 30, 70, 96,187,224,229, 16, 81, 68,239,198, 85, 90, 69, 15,219, 48, 24,119, 61, 10,213, 41,142,180,155,236, 70, 1,243,165,113, -174,170, 45, 42,255,241,207,153,219,171,113,238,119,255,130,215, 63,245, 99,164,229,203,153,204, 61,112,133,101, 19,102,106,216, -146,195, 70, 56, 45, 59,113,213,155, 86, 26,153, 52, 63,112, 27, 14,138,223,196,168,169, 78,161,134, 85,175,135,209,110,137, 28, - 29,106,195,154,216,129, 15, 66,100,102,188,108,106,178,138,147,232,206, 20, 81,235, 6, 50,236,101, 81, 58,134,198, 59, 53,168, - 0, 83,135, 47, 36,163,230, 60,153,229,231,211,226,161,140,237,158, 72, 72,196, 48,202,103,152, 70,250, 77,165, 28, 85,201, 30, -166,213, 13,255,141,180, 9, 79, 73,144, 42,201, 46, 7, 35,167,127,122, 39, 73,208, 50,133, 72,100, 13, 98,131,110,252,209,110, - 62,203,198, 75, 9,186, 62,220,173,203, 68, 13,235,113,213,176,247, 61,129,230, 58,154,229,131,150, 67,245,235, 56,167,238,165, -245,229,103, 16, 86, 9,132, 70,126,162, 76,208,241,137,163,152,176,211, 69, 55, 0,105, 98,154, 17,253, 86, 31,211,214,209,133, -201,244,131, 15, 49,107, 87,232,212, 27, 72,203,193,239,251,180, 55, 55, 89,126,234,175,209,221, 66,150,197, 55, 56,253,182, 71, - 9, 58,109,132, 80,196,113,136, 87,172, 16, 52, 26,228,242, 57, 90,236,224,104,138, 78, 44,209,101,146, 78,186,166, 65,216,233, - 99,154, 38,221,122, 27,149,196,148,167,198,176, 11, 58, 81, 47,224, 96,117, 23,219,243,176,139, 54,166,174,163, 59, 69,132,140, - 80, 82, 96,122, 69,116, 23,194,122,139,218,202, 38, 65, 18, 35,116, 65, 20,164, 49,173,126, 55, 4,161, 17, 69,138,141, 90,159, -134,150,163,157, 36,252,187,215,183,152,176, 12,198,115, 46,154,109,241,224,220, 12,243, 83,101, 22,102,199,176, 77, 19,195, 48, -176,189, 28,118,161,152,118, 94,244, 90,232, 78,234,176, 55,242, 37,208, 76,208, 76,156,178,141,127, 77,162,226, 4,161,235,233, -223, 64,211, 51,246,130,202,158,145,244,221, 18,199, 25,211, 94,101,172, 0, 93, 79, 13,209,114, 20,123, 28,122, 64, 18, 69, 24, -167,123,239, 48,202,192, 60, 9, 72,191,143,145, 52,211,181,145, 76, 99,211,134, 97,227,150,202,233,179,216,216, 65, 34,216, 55, - 5,229,252, 24,166, 30,163, 9,137, 46, 4,102, 22, 51,211, 52, 72, 80,196, 3,243, 37,105,177,141, 97,100, 26, 79,102,238,140, -101,132,134,133, 12,123, 72,149,174, 18, 52,109, 80, 58,165, 48, 13, 7,211,174,146,180, 15,112,251, 61,156,156,195,255,244,226, -151,168,111,220,198, 45,151, 80,178,193,221, 31,221,225,198, 51, 26,221,102, 23,199,134, 40, 80,105,177,146, 16, 52,131, 26,152, - 69,198,143, 86,249,201,127,122,142,111, 92,120,136, 99,191,250,115, 28,251,251,159, 68, 4,221, 84, 69, 53,140,212,135,166, 98, -162, 56,225,220,219, 30,197,182,191,204,106,103,131,179,211,231,105, 52,247,216,221,107, 48,125,230,227,176,243, 44,154, 10, 51, -209, 76,165,103, 37, 2,253, 95,254,171,223,248, 76,216,105,162,100,130,233,149,208, 77,131,168,219,102,230,252,253,108, 93,124, -149,185,243,247,176,250,202, 75, 28,121,240, 17,182,111, 92, 71,201,136,177, 99, 39,208, 29,151,246,246, 46,110,169, 68,117,113, -145,110,109, 31,205, 48, 83, 87,170,110,208,221, 89,199, 44, 86, 82,105, 43, 87, 34,233, 53,209,109, 23, 25, 6, 8,211, 38,110, -237, 99,150,171, 96,148,144,189, 3,140, 92, 33, 53, 66, 17,163,121,229, 52,231, 44, 65,168, 0,163, 80,101,237, 7,223,101,242, -216, 2,149,211,231,192,180,217,191,244, 58, 55,159,251, 1,157,230, 46, 39,238, 59, 75,208,245,153, 61,123, 23,245,237,125,146, - 56,192,205, 23,185,246,236,247,232,214, 91,228, 44,157,124,185, 72,228,199,116, 54,151,113,221,144,177,153,227, 68,177, 79,236, - 39,228, 43, 5, 4, 26,171, 55,110,226,119, 59,248,221, 30,150,161,152, 57, 58, 67,161, 58, 78,109, 99, 31,191,151, 80,118,250, - 28,185,255, 62,148,114,104, 55, 3,226,160, 67,113, 98,154,181,171,183, 40,143,229,153, 63,117,140,110, 59, 96,125,101,135, 78, -125,139,168,239,163, 91, 14, 97,107, 27, 79,235,225, 57, 17,174, 17,210,220,222,193,118,203, 4,237, 14, 94,181, 76, 99,125, 3, -171,144,103,234,216,113, 90,245, 26,211, 39, 79, 33,163, 16,191,221, 35, 9, 35, 10,213, 34,205,237, 93, 38,142, 31,101,127,101, -149,245,107,183, 56,251,248,187,184,253,226, 11, 44, 61,240, 16,203, 47,190,128,227,229, 49, 92,135,210,204, 52,182,103,147, 68, - 65, 86,249,234,226,142,143, 81,251,238,151, 17, 3, 89, 76,141,250,188, 53, 61,165,136,104, 12,202, 64,178,252,181, 32,195,224, -106, 8,153,112,230, 95,252, 17,206,204, 24, 2, 15,232, 19,215,183,232,239,237,209,222,221,165,213,168,227,199, 50,251, 96,203, -116,186, 8, 99,146, 40, 26, 26,104, 64, 35, 10,250, 60,249, 83,127, 31,243,194, 91, 97,229, 53,216,216, 34,106, 52,137,162,144, - 96,255, 0,249, 23, 95,196,185,181,138,234,244,184,217,234,113, 45, 10, 73, 12,147,104,175,137,236,180, 73,116,141,221,122,143, - 59, 87, 55, 89,126,245, 54, 99,147, 30,229,249, 41,164, 6,154, 99,160, 25, 54,186,109, 17,244,125,114, 83, 25,167,186,219,197, - 40,148, 32,151, 26, 51,241, 3, 26,175,189,196,141,191,121,138,234,241, 5, 22,159,120,156,194, 71, 63,128,102, 8,186,215,110, -177,126,103,133,133,201, 25,110,180,118,168,172,237, 49,177,184,196,254,222, 13,194,102, 99,100,214,226,112, 55, 58, 25,220,229, -112,133,238,161, 3,157, 81,212, 10,161,208, 7,253,239,255, 93,231,251,168,180,134, 55,247,216, 28, 42,102, 25, 57,231,135, 65, -248, 97, 58, 44,251,225, 52, 19,149,116,145, 65, 35,147,245, 15,187,247,134, 11,246, 33, 26, 54,245, 8, 28,186, 36,104,226,112, -172,157, 81,183,204,232,194, 34,147, 24,149, 68, 67,243,220, 48,206, 55,216,109, 31,202,217,143,242,252,218,161, 60,251,232, 98, - 35,134,185,248, 55,121,234, 70,168, 85,109, 4,190, 17,186,137,183,248, 32,154, 83, 37,238,236, 28, 90, 51,140,190, 94,106,130, -130,102, 83,124,248,221, 96, 59,136,184,139, 86,154,229,224,217, 47,128,230, 17,107,130, 40, 76,144, 97, 64,236, 71,105, 46, 60, - 78, 21,131,118, 39, 98,127,187, 79,208, 11,233,238,117, 48,117,133,158,183,211,100, 80,177,138,166, 36,197,249,227, 20,103, 22, - 40, 76, 47,224, 78, 76,144, 31,155,194,111,236, 98,154, 58, 65,183, 69,127,107,143,206,238, 6,171,151,239,224, 55,234,220,188, -186, 73, 16, 68, 84,199, 60, 44, 75,224, 90, 2, 37, 36, 73, 16,160,105,130, 56, 74,200,143, 21, 49, 45,155, 94,167, 71,175,222, - 70, 51, 13,176, 45,164,210,136,253, 24,175, 90, 37, 17, 6, 8,145,121,103, 98,194, 86,135,126,187, 67,167,222, 39, 8,211, 92, -119,156, 72,100,172,232,250, 49,107,141,136, 85, 63, 61, 36,110,212, 26,228,116, 29,221, 52,177,109,155, 35, 99,101,166, 10, 14, -211,149, 18, 94, 33, 79,113,108,140,226,196, 20,186,101, 18,118,154,200,216,199,176,109,116,195,196, 46,141, 99,230, 11, 68,189, - 30, 65,171,129,109, 72, 52, 97, 17,108,175,164,135,247,144, 81, 46,135, 38,206,244,243, 46,135,207,153,200,226,146, 74, 42, 72, - 36, 74,207, 98, 10, 89, 91, 92, 34, 37,145, 74,232,199,146,118, 18,211, 8, 99, 18,169,200, 25,130,130, 97, 82,191,125,133,163, - 15,189,155,253,189, 61, 44,215,195, 45,149,176,220, 60,222,196, 44,230,234, 45,198, 22, 22,249,253,255,247,119,161,181,207,152, - 46,241, 52, 29, 93, 66, 40,161, 17,197,236,246, 34, 14,252,152,126,146, 22,201, 40,169,134,157, 79,186, 72, 33, 44, 21,199,102, -204,113,169,218, 6,121, 35, 35,220,105, 3,180,241, 0,125, 28,167, 67, 80,210,197,208, 36, 73,228,243,209, 79,125,130,243,143, -188, 31, 37,187, 8,173,192,212,201, 18,107, 47,220,198,113,115,128, 65, 16, 41,252, 32,102,127,239, 0, 63,150,148,244, 42,199, -198, 95, 98,251, 87,127,155,251, 30, 45,240,229, 63,252, 14,213,251,150, 40, 46, 46, 16, 6,221, 52,167,175, 84,134, 97, 54,240, -253,136, 7,239, 91,226, 43, 95,185,194,233,233, 57,132, 81,192,175,213, 16,142,205,244,241, 7,137,215,158,201,230, 11, 49,252, -108, 25,181,155,151, 49,189, 34,157,189,109,220,177, 73,108, 47,135, 83,153,228,242, 83, 95,226,232, 67,247,177,117,233, 18,199, - 30,125, 27,203,223,251, 46,147, 75,199,208,109,135,205, 75,151,210,138,188, 66,158,252,228, 36,119, 94,124,142, 19,239,127,146, -254,246, 54,110,117,140,176,211,166,114,236, 20, 73, 18,161, 59, 78, 42,167,187,121,146,160,143, 94,168,226,239,108,224, 76, 76, - 1, 22,168, 36,205,171,235, 58, 36, 17,122,105,142,168,185,141, 48, 44, 14,150,175, 51,121,230, 60,219, 47,125,151,197, 7, 31, - 68,179, 61,214, 94,122,150,184,219, 70,232, 54, 83, 71,142,146,171,122, 84, 22,151, 8,122, 1, 55,127,248, 50,249, 74,158, 92, -165,202,234,197,107,148,199, 39,104, 54, 91,168, 72,103,229,230, 77,246,214,235, 88,166, 32, 55,121,140, 78,187,205,236,201, 19, - 52,118, 26,180, 27, 93, 14,182,106, 88,150, 34,137, 34,242,174, 70,101,118, 6,116,131, 78,187, 79, 4, 40,233,115,226,209,183, -209,220, 62, 32,146, 54,157,102,139,241,233, 10,175, 60,243, 60, 83,243, 5, 44, 71,167, 94,111,177,177,188,131,169,251, 8, 36, - 73,239,128, 27,207,188,202,196,226, 12, 70,126, 18,167,112, 20, 75,104, 52, 47, 61, 75,125,251, 14, 39,223,250, 30, 58, 7,117, - 38, 79,157,230,213,175,126,129, 7,159,252, 73, 10,213, 18,142,231, 80,219,216,102,108,118,134,157,229, 91,248,205, 26,147,199, -142,243,234,151,159,226,200,125,247, 50,121,244, 40,245,213, 21,206,190,255, 67,236, 45, 95,227,216,125,247,177,119,103,141, 19, - 15, 93,200, 58,203, 61, 0,122,141, 30,185,178,160,120,247, 67, 67,201, 85,104,218,144,221, 77,118,131, 70, 42,132,153, 54, 43, - 33,147, 52,114,168,167,190, 7,123, 98,138,242,125,111,165,124,239, 91, 81,170,135, 32,128,160,139, 76, 98,226,192, 79, 95,138, - 41,183, 19,169, 18, 84,146, 32,227, 8, 41,227,108,194,147,196, 36, 20, 76,135,247,254,244, 79,195,194,113,168,223,130,237, 93, -226, 70,139, 4, 65,248,253, 31, 98,189,244, 58, 98,122,130,168,222,226,249,155, 91,236, 36, 33,158, 97, 51,147, 47, 98, 78, 58, -220,220,221,102,171, 86, 39, 78, 18, 22, 78, 30, 99,254,222, 51,220,238,244, 41,117,218,216,133, 82, 90, 57, 42, 99, 52, 32, 9, -218,132,219,219,152,149, 50, 50,240, 81,173, 38, 98, 98, 18,242, 69,216,217,165,252, 35, 63,193,143,124,224, 71, 40, 78,207, 97, -152, 38, 26, 80,120,242, 71,153,249,157,223, 33,172,237,242,195,191,247, 19,140,109,215,184,104,237, 49,247,119,223,229,194,207, -127,150, 31,254,214, 79, 14, 73,160,104, 3, 65, 88,141, 78,160,172,125, 79, 14, 36,194,172,225, 44,237,125, 31, 72,142,138, 68, -105, 41,254, 81, 30,222, 55,171, 55,153,211,222,156,199, 30,185,231, 15,231,207, 7,198,183, 97,145, 93,102,234,145,253,122,182, -135,207,246,219,242,144, 69,237,240,164, 63, 4,206, 64, 18,143,186,229,101, 34,209, 76, 15, 52,137, 10,195, 97,148, 14,237,208, -215, 25,114,132, 50,207,234,116,133,161, 15,227,108, 42,115,183, 15, 12,110,169,111,240, 77, 55,151, 67, 61,249,114,120, 59, 26, - 24, 2, 71, 90,253,200, 85,173,233,105, 90, 90,137,180,195, 97,232,104, 80,135,194,244, 34,109,117, 11,252, 0,101, 89,105,231, -133,222, 70,151,138,137,247,124,130,155,127,245,123,136,194, 56, 42,140, 81,104, 88,158,147, 78,235,253,136, 94, 61, 76, 35, 88, - 8, 26,205, 4,207,134, 91,175,222, 97,166,221, 71, 24,130, 48, 78,200,205, 47,210, 15,214,169, 28, 59,131,225,120,136, 88,161, -100,130,110, 26, 52,110, 94,163,223,108,113,176,215, 99,245, 78, 13,165, 67,161,101, 83,169,184, 68, 97, 72, 28,248,184,142, 69, - 97,204,163,211,234,225, 84, 43, 8,221,196,182, 29,140,106, 21,133, 98,236,196, 20, 36, 49,221,237, 59, 8,153,224,148, 39, 56, -184,115,139,131,237, 61, 44, 77, 79, 85, 77,173,135,223,236,226,119,124,250, 97,140, 64, 16,199,138, 36,150, 68, 49,180, 3,201, - 78, 23, 86, 98,157,253, 94,196,238,254, 30, 5,199,161,154,115, 88, 44,231,169,120, 14, 11, 83,101, 74,197, 60, 57,215,165, 56, - 54,150,173,250, 44,132, 76, 11, 96, 84,166,170,152,249, 74, 10,112, 49,108,162, 32, 78,243,244,147, 30,245,253, 21,100, 20,167, -127,219, 65, 66, 97, 16, 69,204,128, 58, 42, 73,147, 17, 74,142,168,126,168, 44,201, 16,142,250, 27,148,148,200, 12,135,154, 5, - 46, 81, 89,212, 22, 5,186, 82,136, 36, 98,253,226,247, 56,241,224,123, 9, 99, 73, 55, 12,184,254,210,247,136, 54,183,184,186, -179,193,205,205, 85, 38, 60,157, 99, 57, 7,195,116,208, 85,202, 9, 16,154, 65, 18,245, 9,135,109,196,105,123,102,160,146, 33, -231, 72,144, 30,224,182,235,224, 21, 74,200,184, 59,170,109, 84,105,203,168,146, 58,194, 72,123, 2,146,168,141, 46,192, 49, 12, -188,169, 57,222,251,179,191,129, 34,129,216,228, 95, 47,204,243,173, 86,151, 71,239,125, 27,239,124,252,231,112, 93, 19, 41, 67, -226,160,139, 55,229, 83,197,164, 99, 56,120, 79,125,149, 47, 45, 88,252,155,103, 27,124,106,204,160,126,176,199,156, 38, 82,152, -153, 0,221, 74, 65, 49,138,180,217,243,196,253,119, 99,235,223,160, 17, 65,222,233,161, 57, 41, 12,231, 64,159, 96,233,209, 15, -112,240,194,215, 82, 15,107, 6,150, 49,220, 82,133,176,215,161, 48, 49, 67,107,103,157,158, 46,232, 55,155, 76,159, 92,194,244, -198,152, 58,237,177,119,237, 42,229,233, 73, 26,219,155,184, 94, 30,195, 16,216,213, 50,213,165,187, 88,123,254, 89,142,222,255, - 16, 59,175,191,204,250,229,215,152, 60,122, 20, 33, 96,242,196,221,232,142, 11, 2,194,118, 3,187, 50,153,202,122,177,194, 46, -151, 51,110,117,144,238, 86, 98,159,164,211,198, 26, 95, 36,172,109, 18, 52,183,176,139,227, 76,156, 62,141,127,176,203,216,209, -227,200, 36,225,245,191,254, 43,250, 7,187,204,157, 61, 65,191,213,162, 56, 85,101,226,196,113,154, 59,251,236,222,188,205,248, -194, 12,232, 58,245,213, 45,132,101,240,204, 87,190,197,252,130,134,229, 46,208, 57, 56,128, 56,100,233,244,113, 44,153, 96,150, -199,121,227,249, 23, 73,194,144,234,228,100, 54,149, 87,240, 59,125,186,205, 54,190, 31,209,239, 54,105,180, 34,186,187,107,156, - 56,183, 68,179,209,196, 48,109,250,173, 62,197,130, 77, 47,180,177,157, 10,165,170,134, 97, 58, 52, 15, 20,115,115, 46, 66, 47, -209,106,119,113, 39,143,114,238,158,247,176,118,229, 69, 54,175,191, 65,113,108, 28,183, 56,197,185,143,253, 35, 46,127,235, 11, -188,254,181,167, 56,254,240,195, 56,185, 60,253,250, 1, 43,175,190,134,233,234,236,223, 90,163,182,185, 66,216, 62,141, 91,204, -241,198,183,158,230,130, 93, 98,236,200, 34, 50, 12, 48, 45,151,149,231,191,207, 61,243, 71, 24,159, 61,142,148, 29,220, 98,142, -214,222, 1,245,213, 93,198,143,205,162, 89, 38, 42, 10, 48,242, 51,232,134,192, 42,143, 17,182,234, 56,197, 69,208, 53,162,250, - 90,202, 56,214,245, 76, 54, 86, 24,133, 34,229,115, 15, 50,254,246, 15,144, 95, 60,137, 53, 62,133,140,125, 48,243, 40, 25, 32, -146, 0,132, 1,186,129, 64, 16,118,187,105,113,142,174, 19, 51, 32, 71, 73,164,130, 56, 74, 15,216, 94, 20,112,124,106,138,115, - 63,242,163, 48, 54, 13,126, 3, 54,183,145,141, 38,210, 50,241,127,255, 79,112,226, 24,230,167,241, 27, 13, 94,184,178, 74,207, -177, 80,173,144,192, 17, 92,186,190,204,226,217,227,204,190,253, 1,238,255,240, 7, 88,124,255, 71, 49, 11, 21,180, 76,101,144, -150,195,222,255,246,243,105, 65,132, 74, 64,197,104,166, 67,111,103,157, 98,169,132,140, 2,162,131, 61,172,165, 19, 8,195, 70, -121, 46,118, 33, 79, 99,245, 22, 34,142,200, 85,199, 49, 28, 7, 35,243,122,152,213, 9,222,254,141,111,179,247,181, 47,115,249, -227,255, 51,205,160,205,228,151,190,131, 83,158,166,127,176,157,190,180,146,180,255, 92, 74, 53, 50,158,137, 17,229, 20,117,248, -180, 85,135,118,197, 98,120, 16,101,131,122, 86,232,124,216, 80,167, 14, 69,180, 50, 70,123,246, 82, 28, 77, 24,217,222, 82, 31, - 53,217,201,172,152, 95, 12, 77, 75, 35, 93, 93,101, 7,164,200,170, 98, 7,165, 55, 50, 86,195, 3, 49, 53,202,165, 47,112,205, - 42,145,244,246,210,159, 83,170,225,126,127, 40, 24, 36, 98, 88, 66,131,150,150,232, 16,201, 65,230, 14,221,114, 82,185, 86,118, - 16,137, 68,105, 3,162,223, 64, 41,146, 35,102,125,246,179, 13,248,243,106, 72,117,147,135, 10,104, 64, 70, 9, 66, 83,248,171, - 47,164, 50,163, 76,227, 73, 3, 8,141,166,143,214, 19, 9, 33,228,167,210, 70, 70,153, 66,103, 74, 15,124,148,252, 15,190, 76, - 55,144,152,194, 68, 15,211,158, 4,163, 23, 18, 4,208,172,247,176,149, 6,161,194, 18, 2,221,214, 41, 20,114,172, 93,217,166, - 48,150,167,217,106,163,173, 54,152,190,123,137,168, 83, 71, 24, 22, 81, 20,145,244,186,216,249, 42, 70,190,140, 30, 73,220,138, -206,249,233, 50, 81, 63,164,215,234, 97,186, 22, 38, 80,153,157, 68,115, 11,180,118,119, 41,204, 79, 19,197, 49,238,196, 20,134, -227, 98,231, 10,152,150,139,110,234,132,173, 3,242, 39, 30,162, 91, 91, 39, 22, 6,238,220, 9,130,102,131,214, 65,157,126,187, -141,101, 66,212,143,210,142,135,104,208, 87, 32,233, 7,146, 68,193,118,104,178, 44, 13,252, 36, 98,162,148,231,212, 84, 21, 75, - 55,176, 76, 13, 83, 41,202,158, 65,177,144,163, 88, 46, 99, 26, 34, 77, 28,153, 38, 78,169, 76,212,109,163,180, 16,195, 45,129, - 46, 80, 73,132, 85,152, 34,236,245, 48,115, 57,170,229, 18,230,108, 14,255,107,119, 16,104,200, 36, 73,159, 17, 61,205,144, 11, - 93, 31,169, 49,195, 34,133,193,229, 82,189,217,240,152,173,102,146,204, 4, 42,101, 58,201,203, 56, 91, 17, 42,129, 35, 5,150, -145, 62, 3,183, 95,122,142,111,124,251, 59,108,246, 99, 90,113,202, 71, 87,164,117,169, 69, 91,199, 82, 2, 83,165, 59,114, 93, - 8, 52, 43, 79,161, 48,137,222, 14, 81,173,126, 42,108, 33,233,135,217, 36,156, 93, 11,141,172, 90, 56,104,183,233,170, 24,189, -232, 66, 2,137,144,104, 50, 53, 15, 11,211, 68,201,136, 20,175,160,178,181,143,198,217,223,252, 19,164, 76, 16,154,198,191, 40, -205,241,179,247, 24, 76,237, 91, 20, 91, 87, 17, 94,137,208,247, 49, 29, 19,229,107, 28,236,245, 25, 47,107, 28,220,218,226,238, -121,193, 71,175,134,124,238,161, 60, 79,189,208,225,215,238,191,143,216,247, 73, 6, 13, 77, 34,206, 8,148,169,153,166, 83,111, -243,240,219,103,217,191,209, 70, 68, 6,186,159, 80,157,240,217,221,232,113,230, 71,127, 25,227,202, 75,196,157, 90,182,190, 3, -163,119,176,141, 34,193,202,151,144, 97,200,244,185,123, 72,252, 0, 33, 18,100, 28, 19,245, 2,250,141, 6, 73,212,102,238, 45, - 15, 82, 95, 91,165,182,182,193,233,119, 62,198, 75,159,255,255,120,228,103,255, 23,118, 94,125, 17,175, 92,230,220, 59,223,133, - 48,109,204,177, 89,130,253,109,146,200, 71, 88, 30,134,153, 78,225, 8, 19, 65,130, 18, 2, 25,251,168, 56, 38, 14,250,105,158, -221,205, 17,119,218, 8, 13, 10, 75,231,136,155,181,204, 40, 18, 83, 91, 93,227,250,115, 47, 48, 54,237, 49,118,250, 40,150, 11, -249,241,121, 52,225,176,121,245, 58,237,253, 58, 94,193,197, 41, 21,217,190,181,198,157,235,183,217,186,179,204, 93,199,171,156, -121,223, 19,188,248,149,103, 56, 50, 63,193,196,241, 83, 52,155, 29, 94,123,237, 10,187,119,190,205,244, 92,158, 35,119,157,195, -205,121, 40,211,224,242, 43, 23,145, 81,135,137,217, 89,122,245,132,229,107, 55,153, 42,107,220,243,142, 71,104, 55,218,196, 81, -182, 79,141, 67,252, 68,163,177, 85, 99,122, 82, 49,117,236, 2,175,125,239, 18,133, 2,180,250,130,176, 31, 81, 61,114,154,214, -206, 30,187, 23,255, 12, 69,159,114, 57, 71, 18,117,217, 91,123,131,215,158,249, 34, 31,251,167,255, 26,103,124,138, 31,252,249, - 31,115,242,225,199,185,247,195, 31,231,250,179,223,229,216,133,251,169,173,110, 32,208,217, 91,187,197,221,239,120, 31,110, 33, -199,254,198, 58, 83, 75, 71,232, 54, 58,108, 92,191, 72, 28,197,108,191,241, 18, 74, 56,148,143, 76,227,183,186,116,246,182,232, -182,218,200,219, 49, 42, 17, 32, 66,138,243, 51,104,152,228,207, 61, 72,251,229, 87, 40, 44, 61, 76,220,171,145,116,118, 80,177, -143,233, 21,168, 60,244,118,142,254,236, 47, 35,195, 48,189,153,155, 22, 74,165, 21,174, 2,133, 89,174,160,226,198, 0,162, 14, -129, 79,220,239, 17, 54, 91,144, 36,217, 7, 38,165,113, 75, 37, 73,178, 73,168,213,233,114,238,212,113, 78,127,228, 35,144,175, -164,148,133,205, 21,212,238, 62,137, 97,210,255, 63,255, 61, 94,177,136, 40,231,145, 93,159,151,175,172,210, 16, 26, 42,231,113, -123,121,147, 39,254,199,143,114,230,147,159,196, 91, 56, 74,210,235,145,244,251,132,245,125,146, 94, 23,195,113,211,120,143,144, - 76,127,230,255, 97,231, 55,126, 14,189, 80, 0, 20,166,109, 16,182,235, 72,223, 71, 24, 14,113,191,135,213,105, 65,105, 12,149, -243,134, 13,107, 42, 78,136,195, 16,195,177,178,233, 68, 31, 26,250, 38,222,255, 17, 30,122,234,115,172,253,195, 95,165,157, 47, -114,225,236,199,120,246,123,191,151, 85,168,103,116,133,108,215,139, 54,138,165, 41,169,210, 56, 19,135, 90,210, 6, 49,173,204, - 25, 44,178,136,217, 64, 60,214,244, 97,226,125, 48,220,167, 59,237, 1,181,141, 55, 31, 96, 3,231,120, 90,167,122,104, 15,173, -105,233, 33,171,178, 93,251,208,178,159,154,186,164,212,208,180, 84,137, 81,135,164,248, 84,182, 23,160,153,216, 19,103,209,237, - 28,253,205, 22, 42,238, 49, 80, 82,133,174,161, 68,202,160, 38, 67,226,106, 98, 84, 4,131,174,129,202, 36,203,252, 36, 40, 73, -212,236,140, 34, 3,100,232,186,204,175, 33,213, 96,197, 35, 70, 57,124,141, 12,224,145,153,247,244, 65,156, 45,243, 32, 72,137, -166,194,244,128,208, 51, 71,126, 42, 69,164,128, 24,153, 86,196,106, 99, 99, 32,204, 44,171,111,164,129,229,164,207,226,199,126, -133, 55,254,253, 47, 34, 75, 83, 40, 37, 73, 98, 69, 24, 74,186,189,136, 72,104,248,237,148,124,168,123, 58, 84, 42, 88, 37,143, - 9, 91,167,189,219,167,180, 56, 71,109,167,193,218,149, 53,142, 22, 39,104,238,214,208,188, 98,122, 25,209,192,174,204,160,156, - 42,218, 88, 23,250,109, 10,139, 37,170,154,137,146,138, 68,234, 68, 73,140,142, 64, 86, 12, 52,215,193,144,138,110,167, 79,201, - 43, 17, 71, 18,153,244, 73, 58, 17, 73, 24, 35,194, 6,154, 59, 78, 20,133,224, 90,168,196,196,118,170,180, 86,111,211,108,164, -145,207, 36,142,211,169, 51,129,126,164,216,232,166,135,153,143,194, 18, 9, 5,207, 74,127,125,161, 81,201, 89, 56,186,206,252, -252, 52,158,231,144,132, 1,142,231, 80,168, 20,177, 92, 27, 33, 4, 97,191,141,102, 8,116, 59,135, 97,187,104,166,141,176,108, -100, 28, 16, 7, 1,154, 97, 35, 12,157,254,126,135,176,213, 4, 45,243, 90, 32,136, 51, 67,153,166,228,161, 90, 98, 45,189, 96, - 11, 61,125,238, 7, 20, 66, 70,135,190,202,194,226,105,107, 93, 58,105,106, 8, 44, 77,160, 39, 10, 93, 79,205, 95,177, 2, 41, - 35, 18,153, 62, 35,102,134,148,208, 18,129,101, 11, 28, 4, 57, 67,199,214,116,172,236, 50, 33,136,233, 30,108, 17, 5,157,180, -249, 78,131,110,148, 41, 70,135, 10, 34, 7, 45,141, 58, 2, 91, 31, 60,167, 50, 53,138,154,138, 68, 37,136, 56, 64,104, 18, 97, -230, 73,226, 48, 83,184, 18,116,215, 69, 33, 57,184,254, 2, 83, 68,252,215, 61,197,175,111, 36,228,180, 3,190,212, 9, 80,102, -140,138,116, 86, 87, 54,184,211,221,102, 99, 31, 74,249, 51,188,186,162,168,127,250, 12,191,255, 31,174,114,215,135, 31, 97,226, -244,121, 26,107,215,211, 24,167, 16, 72,165, 33,101, 66, 18,167,202,106,191,235, 51,119,108,140,155,175,246, 41,229,102, 16,178, -207,205, 55, 94,231,216,185, 7, 88,190,180,193, 35,191,245,103,188,254,207, 62, 52, 20,183,244,223,252,245, 95,252, 12,113,130, - 55, 57, 3,177,143, 55,123, 55, 7,215,223, 32, 63,179,200,234, 43, 47,209,218, 89,103,252,232, 34, 99,139,167,104,111,175, 99, -216, 38,149,185, 41,132,225, 48,123,234, 12,151,190,254,119,228,138, 22,229,249, 19,180,246,182,112,203, 19, 36,126,151,160,211, -192, 29,155, 32,108,212,176, 10, 85, 64, 67,169, 40,189,145, 5, 29,244,252, 68, 42,249, 69,126,154, 23, 44, 84, 73, 58, 45,208, - 98,132,102,112,237,107,127,131,166,195,197,111, 62,141,101,105, 76,204,205,112,226,173,239,194,116, 11,244,235,109, 58,141, 61, -100, 44,233, 53, 59,120, 37,143,177,133, 69, 90,251, 7, 92,250,246,243,232,116, 88, 60, 90,230,174,247, 62,193,242,203, 87,152, - 60, 58,135,145, 31,231,245, 23, 46,242,205,191,251, 14, 57,217,231,252,249, 37,166,143, 30, 35,137, 4,141,221,117,246,182,118, - 41, 23, 61, 74, 99,101,130,126,196,198,237, 45,206,158, 61,194,244,201, 19,188,254,253, 23,232,244,246,179, 78,147,152,126, 63, -162,117,208,195,214,118, 57,114,239, 61, 92,127,249, 26, 66,196,180,106, 53,188,162,135, 87, 61, 70,237,246, 27, 40,127,131, 32, - 9,208, 77, 19,221, 46,160,219, 85, 12,195,195, 52, 52, 94,251,214,223, 50,187,116, 31, 75, 15, 62,194,197,111,127,141, 82,117, -146,118, 99,151,137,133, 99,212, 54,214, 40,142,205,208,109,109,177,246,250, 37, 38,143,157,102,243,230, 21,170, 83, 41,255,123, -127,117, 21,221, 50,185,243,234, 15,232, 52, 34,138, 5,155, 36,214,120,227,153,239,161,128,234,244, 4,166,235, 96,218, 54, 94, -121,156,208,111, 83, 60,114,130,189,111,252, 87,226,222, 1,225,193, 29,236,106,149,179,191,254,187,204,255,248, 63,164,116,254, - 97,148,166,208, 61, 15,161,155,105, 95,185,105, 98,184, 30,154,233,130, 33, 33,232,129, 93,130,160, 69,220,105, 81,191,115,155, -230,126,141,110,167,131, 31,250, 4,126, 64, 18, 37,233,190, 85, 38,116,186,125, 30,189,247, 12, 75, 31,122, 18,188, 66,218, 26, -184,117, 13,117,107,133, 88,105,244,254,195, 31,225,149, 61, 52,215, 65,118, 3,174, 95,186,205,102, 39,164, 99,233,212, 54,118, -248,165,245,139,204,191,239, 9,226, 94,143,164,211, 70, 70, 81,106, 92, 49,237,244, 48, 55, 82, 2,156,208, 77,136,122,120, 15, - 63, 78,247, 27, 95, 68,203,121,104,166,133, 76, 20,134, 91, 68, 51,116,226, 56,194,202,229, 17,165,234,112, 42,236,236,111, 99, -216, 46,134,101, 99, 88, 54, 66, 51,135, 69, 42, 3,247,186,185,120, 4,231,158, 83,244, 62,255,119, 4,221, 22,133,179, 23,168, -111, 92,229, 77,245, 48, 3, 96,203,224,224,210,196,155,202, 87,134, 9, 44,109,244, 53,135, 25, 40,111, 42,172, 25, 58,205,213, -112,194, 30,192, 91,180,161,187,124, 32, 81,171,161, 47,252,240, 20,164,105, 34,243, 76, 28, 82, 14,132,134, 89, 94,194,112,139, - 36,126,253, 77,104,221,129,139, 92, 8, 3,103,234, 46,204,226, 28,193,222, 45,226,238,110,214, 82, 55, 50,189, 41,161,165,117, -157,111, 94,248,103,174, 53, 53,148,239, 85, 18,147,244,106,217,238, 92,164,159,115,165,165, 17,186,172,214, 86, 28,186, 83, 12, - 23, 13,135, 98,111, 35, 78,252,168,150,120, 96, 90, 26, 24,253,100,118, 9,210,117,145,101,242, 5, 82,104, 24, 81, 72,245, 67, - 63,149,254,110, 81,144, 42, 56,137,196, 44,140, 33,194,128,229,231,159, 37,138, 53,250, 45,159,218,110, 7, 63,129,110,164,129, -101, 98,219, 22, 94, 57,143, 55, 49,142, 81,158,193,154, 57,134, 87, 41, 98,229, 10, 76,156, 58, 67,110, 97, 9, 41,108,122, 93, -159,110,171, 15,186, 67,125,191, 65,167,211, 67,105, 22,186, 83, 6,221, 68,233, 14,126,164, 82, 22,183, 31, 33, 52,131, 88,232, -196, 81,136, 83, 40,165,127, 43,195, 36,242,125,116,161,240, 10, 21, 66, 63,192, 15, 98,122,245, 58, 43, 55,215, 56, 56,104,162, - 37,146,107, 55,214,104,180,125,158,189,180,197,114, 61,228,210, 65, 76,221, 23,108,118, 36,187,161, 96, 59,208,233, 9,131, 62, - 38,166,105,224, 90, 6, 5,219,102,190, 90,160, 90,112,152, 26,171, 48, 62, 94, 37, 95,112,169, 78, 78, 80,157,157,194,205,121, - 56,249, 60,185, 74, 5,195, 50, 17, 50,101,157,203, 48,133,165,232,186,131, 83,153, 72, 47,241, 82,146, 43, 21, 49, 84, 31, 33, - 34,218,175,189, 74,212,235, 29,154,186, 15,251, 35, 6,237,127, 73,214, 64,152, 12, 27, 12,149,208,210,203,115,198, 84, 80,153, - 28, 47, 73, 47,194,137, 84,116,101, 12,138,180,242, 84, 3, 79,164, 61,250,253, 68,210,136, 99,250, 82, 17,196,233,179, 98,153, - 96, 11,141,138,169, 51,227, 90, 76, 88, 6,121,211,192, 53, 52, 18, 63, 36,136,122,180,195,132,126,156, 16, 36,138,110, 44, 9, -149, 34, 81,163,202,107, 67, 23,120,186,160,106, 27, 76,185, 38, 37,203,192,213,116, 12, 93, 75,219, 54,181,140, 94, 40, 5,154, -102, 64, 28, 32,116, 29,103,234, 8, 19,239,253,137, 52,106,232,119,249,227,127,247, 31,249,236,175, 61,204,221,119,246,249, 71, - 99,138,218,145, 15,224,234, 26,141,122,151,102,237,128, 86,175,141,103,120, 36, 73,194,196,194, 1,191,240,185,235,124,252,215, -254, 87, 62,246,217,223,166,183,187, 74, 18,135, 68, 65, 68, 18, 71, 64, 66,228,135, 41,240, 74, 66, 20,129, 72, 34,110,189,220, -165,152,203,113,208,110, 83,116,171, 68,161, 32, 10,250,148, 38, 79, 48,123,223, 60, 7, 63,252, 38, 66,215, 49, 84,216,165, 56, -179,128,110,151, 40, 45,156,166, 95, 91, 67,119,108,234,235,183, 89, 60,119,129,131,219,215, 40, 30, 61, 71,103,237, 38,160, 97, -121, 30, 65,183, 79,243,230,117,226,192,231,248,249,243,228,151,206,112,243,233,191,229,232, 61,231, 8,251, 93,146, 40,196, 45, -148,169,223,188, 76,117,233,174,244,182,231,251, 88,133, 18, 42,232,163,231,170, 16, 7,217,164, 20,224, 76,157, 32,110,238,160, -100,136, 85, 61,198,238,203,223,231,236, 7,158,100,229,135,223,231,193, 39, 63,196,171, 95,253, 54, 71,206,123, 52,118,119, 88, -125,233, 21, 12,221,164,223, 92, 35,191,112,130, 94,175, 67, 20, 88, 52,106,151, 48, 12,131,249, 19, 39,233, 30, 44, 51,115,242, - 52,183, 95, 75, 97, 51,237,102,139,229,139,119,232, 52, 14,248,209, 39,223,134,155, 47,163, 57, 22,134,237,209,174,183,113,242, - 37,194,126, 31,221, 50,136, 67,197,254,214, 62,167,239,154,162, 50,183,192,235,207, 93, 66, 71,103,126,118,150,110,183,207,214, -214, 50,182, 81,194, 54,116,202, 51,227,172, 95, 91,166,215,233,210,239, 52,153,156, 41,144, 72,141,230,173, 87,169, 76, 85,105, -213, 65,225, 99,229, 92,122,126,132, 69,156,146,165,128,137,165,187,120,238,243,127,196,253, 79,252, 15, 44,222,117, 47,107, 87, - 95, 71,215, 5,175,127,231,107,140, 79, 29,197,239,182, 16,216,212,247,239,224,150,198, 65, 41, 94,127,230, 59,156,127,219,219, - 89,186,112, 31, 43, 87, 94,229,206,218, 62,227, 93,131, 91,175,125,159,249,165, 11,140, 45,206, 97,217, 6,149,106,149,158,159, -130,110,130,214, 46, 50,129,226,252,113,164, 12,153,255,192, 71, 40, 61,240, 46,140,188,139, 48, 12,148, 16,232,174,155, 82,189, -178,162, 9,188,252,136,241,103,228,161,187, 5,118, 30,136,137, 59, 45,218, 59,155,180,247,246,211, 14,119,165,136,130,136, 56, - 78, 15,116,153, 36,244,250,125,222,254,200, 5,166,223,249,190,212,117,174,123,224,239,195,157,117,226, 40,161,255,215, 95,192, - 69, 34, 28, 23,217, 9,184,125,249, 14,161, 40,208, 10, 15, 48,198,114,252,194,237, 54,173,149,215,160,219, 69,183,173,116,178, - 20,122, 38, 57,235, 41,125, 77, 79, 51,247,172,230, 80,152, 0, 0, 32, 0, 73, 68, 65, 84,154,161, 35, 52, 29,173, 48,142,115, -254, 62,226,173, 53,100, 20,162, 99,224,239,108,225,205,204,164, 44,129,102, 10,109,192,176,209, 84, 48,220,235, 42,153,100,197, - 42,113,250,189,133, 64,249,109,132, 91, 4, 32,247,246,119,176, 63,255,251,184,125,193,252,220, 61,220,122,225,175,145, 50,149, -198,135, 56,214, 33,155,252,240, 36, 34, 14,237, 18, 25,230,136,213,160, 70, 54,155,168,117, 93,203,224, 42, 34,107,106, 27,165, -200, 7,231, 41, 42,221,193,167, 94,179,108,159,174,254,155,166,183,236,224,147,177, 76, 39, 92, 57,180,144,165, 28,251,126, 13, -165,226,204,173,156,213,208, 26,163, 26, 91, 21,199,132,205,109,162,230, 22, 73,175,150,113,172,147, 81,157,109, 42,184,102, 78, -252,244,135, 17, 70, 22, 61, 83,114, 88, 70, 35, 4,168,200,199, 26, 91, 32,246,155,168,208, 79,187,250,197, 64,133,144, 89,132, - 45, 61,164,213,127,123,176, 15, 14,244, 67,221,239,114,176, 87,215, 70, 94, 16, 50,114,157, 18,234, 16,237, 53, 85, 61,244,249, - 5,192, 66,169,110, 74, 10, 28, 16,220,194,144,234,189,239,165,244,252,119,217,221,217,195,111,133,180,252,132, 86, 47,164,214, - 3, 76,157,106,209,102,226,228, 17,244,124, 21,105,121,196, 65,140, 81, 57, 66,208,106, 18,246, 99,122,221, 38,186,233, 18,163, -163,116,141, 48, 8,211, 88,165, 72, 35,174,189,198, 1,213,201,113,116,219, 78, 65, 32,165, 73,250,237, 38,189,126,144,130, 56, -188, 28, 66, 73,122,173, 14,126, 16, 98, 89, 6,223,127,238, 34,126, 4, 55,214,247,232, 39, 9,145, 74, 13,101,251,189,136,188, -109, 96, 8,145,162, 72,133,192, 64,195, 49, 4, 13,116, 76,221,164,160,107, 40, 36,227,249, 28,113, 28,147,115, 44,114,182,137, -169,107,228, 60,151, 66,222,163, 90, 44, 80,154,153,198, 45,228, 65, 74,108,199,194, 45,229,177, 44, 11,205,180, 49,108, 11, 25, -249, 72, 33,208,140, 8,221,114,176,171,227,152,110, 14,132,134, 95,175,163,229, 99,114,227, 21, 58,155, 27,196,190, 63, 52,135, -166,207, 91,250, 89, 28,182, 23,102, 8,220,193, 69, 86, 12,203,148,146,145, 77, 68,201,108,167,157,209,255,148,194, 52, 12,236, - 72,195,212, 33, 38,229,156, 91,217,141, 87,136,148,128,102, 32,177,132, 64,211,193, 54,210,140,121,209,214, 41, 26,105, 43,156, - 45,180, 33,135, 93, 83, 2, 71, 8,114,198,224, 3, 50,242,169, 72,149,118,181, 91, 66,203,238,163,153,172,158,128,148, 6,104, - 86, 42,173, 75, 57,186,128, 70,221,244,226,153, 68, 76,255,216, 63,206,146, 27, 80, 88,120, 11,255,228,119, 62,205,187,255,217, -191,229, 46, 3,190, 19,195,167,207,174,114,234,253,111,165,182,125,135,114,174,194,108,212, 39,142, 19,106,157,144, 83,191,245, - 9,190,254,213, 31, 39,108,214,104,111,222, 66, 38, 41,231, 35,138,251, 72, 9,177, 31, 16,249, 62, 65,144,178, 79, 18,108, 58, -141, 38,186,230,160, 44,147,241, 66, 30,175, 92, 38,110, 6, 4,185, 60,237, 70,159,252,209,247, 99,143,253, 1,113,115, 23,163, -219,232,162,153,251,208, 11, 9, 58, 7, 52,182,247, 17,244,200,149, 39,105,109,239, 96, 88, 14,171,207, 62, 69,109,109,135, 35, - 23, 78, 97,184, 37,154,155,251, 88,174,199,220,249, 7, 73,146,132,253,203,175,178,120,254, 30,154,187, 59,184,133, 60,150,227, -224, 55,107, 84,151,238, 66, 41, 13, 21,251,232,166,145, 46,190, 52, 45, 53, 4,196, 61,100, 20,225, 76,157,162,113,227, 69,108, - 47,135, 59,115, 12,127,247, 54,197,185, 73,234, 43, 43,204,190,229, 2, 43, 47,189, 76,197, 49,112,244, 22,205,173, 29,102, 78, - 29,101,231,230, 42, 78,113,138,203,223,252, 27, 30,253,248, 79,179,246,198, 77, 52, 29,122, 82,209,172,245,176, 53,141,253,237, -253,108,247, 97,178,183,182, 69,169,234,113,225,161,211, 88,133, 50,126,207, 7,169,216, 89,223,165,215,106,145, 47, 56, 20,198, -198,145,194,224,206,181,155,204, 31,153,166,178,176,200,229,151,111, 96,153, 33,199, 47,156, 99,127,175,195,173,171, 43,156, 58, - 61,201, 65,179, 15,154, 34, 10, 20, 59, 91,187,168, 68,113,228,196, 34,181,237, 3, 66,185, 75,161,156,163,219, 11, 64, 68, 76, -206,206,211,106,133,104,102, 30,165,192,112,114,216, 78,145,221,181, 59, 44,158,126,132,215,159,249, 38, 71,206,158, 67,211, 45, -188, 92,153,239,127,245, 15,249,200, 63,248, 52, 7, 43,215, 9,163, 22,134,101,145, 47, 22,105,237,239,210,106,236,178,113,237, - 42,249, 74,133,110,189,133, 0,114,197, 60,211, 75, 15,161, 11,147, 92,161,192,230,173, 91,252,151,223,251, 93, 62,254,137, 95, -160, 50,158,195,171, 76,113,176,181,143,101,107,156,253,151,127,128,158, 43, 98,122, 94, 26, 3, 51, 12, 52,219, 29, 18,190,140, - 92, 41,213,182, 80,169,100,153,106,212,233, 75,219,176, 32,242,105,111,109,208,171,215,210, 28,186,148, 68, 81,156, 18,212,162, - 36, 61,208,123, 62, 23,206,157, 96,250,241, 39,192,176, 65,119,211,197,241,234, 50,178,213, 38, 90, 93,199,184,177,130,113,250, - 8,221,181, 77,154,187, 77, 26,137, 69, 83,118, 57,254,158,135,121,199,231,190, 66,251,206,235,104,186,129,212, 70,125,243,106, -224, 45,215, 70, 68, 57, 49,176,119, 43,144,157, 6,197, 31,249, 57,246,126,251, 83,104,150,131,238, 88, 68, 65,139,216, 47,129, - 82, 36,221, 46, 70, 28, 33, 12, 51, 45,253,112,210, 15,109,218,233, 46,145, 38, 4,187,155,252, 31,159,254, 55,108,134, 19, 24, -202,231, 87, 62,245,126, 78, 60,246, 54, 22,254,243,159,210,124,242, 19,116,151,151, 57,246,246,159,100,249,187,127,142, 76, 4, - 66,207,246,204,131,222,245,193,139, 67, 2,250,200, 85, 39, 68,182, 47, 84, 35, 3,157,200, 38,229, 1, 42, 52,165,175,137, 44, -170, 37,135, 19,188, 20, 98, 72,130,147, 89,163,218, 64, 94, 31,148,214, 12,246,244, 50,251, 94,114, 96, 82, 82, 67,180, 57, 73, -191, 5,196,163,124, 56, 3,230,187, 24,186,203,147, 94, 3,149,132,153,131, 93, 27, 88,231,135,253,222,130,236,247,205, 84, 1, -149,225, 38,211,223,119,132, 98,213,157, 18, 70,126, 38,189,204,247, 58, 35,191,193, 97, 70,124, 70,188, 27, 85,195, 29, 70,207, - 13,186,169, 14,101,246,147,129, 77, 64,140, 82, 7, 50,147,239,135, 24, 98, 45,155,234,117, 32, 91,167,104, 90, 58,109, 10,133, -144, 18,169,153,156,124,223, 79,112,240,185, 63, 32, 33, 34, 76, 36,189, 48,161,229,199, 76,184, 69, 22,142,206, 33,240,168,239, -246,169, 55,118,105,119,122, 92,120,240, 45,204, 28, 63, 65,109,115,149,146,151,103,127,107,135,126,171,201, 55,127,120, 13,199, - 50,121,241,214, 14,237, 32, 38,103,233,108,181, 2, 10,158,149,150,136, 72,197,241,201, 18, 66, 9, 30, 58, 62, 67, 20,165,127, - 87,191, 31,209, 10, 35, 58,189,128,118, 16, 18,100,238,239, 36, 99, 9,152,134,192, 48, 77,102,139,233, 69, 86, 67, 97,234, 58, -142,161,163,235, 58,101,207,165,215,239,163,235, 26,158,101, 50,110,154,140, 87,138, 88,134,142,155,169, 13,149,241, 42,186, 16, -228, 74,249,180,172,165,144, 67,202, 8,167, 88,192, 52,245, 97, 28, 81,215,181, 52,105,164,178,149,145,151, 67, 8, 3,221,182, - 83,213, 78, 37,216,158,135,151, 55, 16,142, 75,251,218, 10, 73,167,151,254,223, 27,163, 72,166,146, 41,127, 64,101, 49,229,244, - 25,214, 56, 76,238, 25, 40, 49, 41,198, 56, 77, 42, 12, 46,116,166, 18, 36, 73, 76, 65,211, 81,104,105,252, 76,168,116,101,161, - 43, 28, 36,142,174,147,179, 36,177, 84,233,222, 92,165,145, 53, 75,128,171,235,216, 42, 61,228, 69,146, 62,142,186, 18,152,153, -100,149,168, 84, 9,136, 37, 67, 95, 74,222,245,152, 29, 27, 39,236,214,137,101,156,246,196,107, 38,110,113, 18,225,183, 17, 42, -204,178,223,135,153,196,217,103,213, 48,179,207,184, 64,197, 13,238,255,165, 95,225,107, 63,243, 73, 86, 95,250, 91,222,255,249, - 23, 88,188,251, 2,141,237, 14,149, 35, 99, 52, 27, 45, 42, 90, 9, 25, 24, 84,171, 61,190,251,251, 29,106, 87,126,143,179,239, - 61,133, 68, 67, 42, 69,208,143,233,181,122, 72, 32, 14, 66,186,157, 54,237, 70,151, 40,182, 81, 74, 35,214, 99, 98, 76,252, 94, - 64, 37,159, 32,163, 58, 19, 75,169,210,188,119,103, 13,161, 29, 99,233,151, 63,207,181,127,254, 24,134, 91,200,145,155, 63, 67, -227,246, 13, 10, 19, 51,236, 47,223,161, 50, 61,137,229, 89,172, 94,188,204,145, 11,247, 51, 86, 44, 49,121,236, 56,206,228, 34, -151,191,242, 55, 88,182,206,244, 93,119,209,109,214, 56, 88,185, 67,101,110,150,218,202, 50, 99,139, 71,216,187,115,147,137,227, - 39,176, 11, 5, 48, 28,164,223,131, 68,161,123,185,180, 76,196, 42, 16,182,235, 88,197, 49,116, 91,176,119,233,135,140,159, 56, - 65,127,103, 3,146,152,253,229,155, 20,198,198, 40, 45, 30, 99,247,218, 37,170,243,179, 20, 31,184,159,176,219,101,172, 20,177, -125,235, 54, 74,104,108,221,184,201, 19,159,252, 57,186, 93, 7, 55,151, 39, 78, 20,205,221,109, 98, 25,145, 68, 62,158, 76, 49, -127,123,155,219,148,202,121,230, 79, 29, 39, 78, 52, 26,181, 22,126,183, 77, 20,197, 4,221, 62,227,243,179,196,113,204,141,107, - 55, 81, 97,192,220,252, 4,149,133, 57,126,248,245,151, 49,180, 38,103,238, 63,199,234,202, 62,175, 60,251, 34,239,126,226, 97, -238,220,222,135,168,206,196,201,147,220,188,180, 73, 16,111,114,236,248, 49, 14,106,109, 14,246,235, 20, 42, 58, 97,162,227,119, - 58,228, 10, 46,251, 59,125,172,194, 52,126,163, 69,109,235, 13,102,142, 61, 64,113,226, 56,157,102,157,110,179, 5, 90, 66,125, -111,151,184,223, 68,159,115,176,243, 54,181,205, 53,252, 94, 23,153, 36,248,189, 46, 63,248,198, 87,120,248, 61, 31,166, 89,223, -231,251, 95,255, 10,154,237,113,246,236, 61,152,150, 73,191,223,162,118,113,157,243, 23,142,209,218,214, 56,121,239,189, 8, 1, - 59, 43, 55,216, 94, 53, 57,247,104,129,169,241, 24,213,220,196,174,142,167,209, 34, 1,194,178,209,109, 39,117, 19,203, 4,189, - 88, 97, 8,207, 30, 4,168, 49, 33,106, 34,204, 28, 32, 9, 15,210,151,153,223,234, 18,248, 62, 50,145,196,129, 79,146, 12,242, -212,146,217,241, 50, 39,159,252, 56,152, 38,104, 54, 2, 23,213,184,130,218,220, 33,146,144,252,229,231,113, 79, 30, 65,250, 62, -215,223,184,195,118, 0,228, 29,124, 19, 62,240,185,175,208,219,184,132,102,165, 5, 26,233, 78,245, 80,149, 27, 90, 38,179,234, -195, 61,172,208, 4,194,208, 81,210, 0,211,194, 57,127, 47,201,214, 58,154,230,161, 37, 9, 73,191,151, 50, 44,122, 93,232,182, -161, 84, 77, 95,242,186,142,140,211, 11,137, 76, 34, 12,179,196, 39,127,230,159, 99, 29,121,148,159,250,169, 39, 89, 88,154,224, -149,231, 95,231,160,246,183, 60,244,228, 7, 49,127,236,113,196, 11,111, 48, 55,123,158,101,245,231,169,137, 77, 13,220,110,135, - 38,205, 36,203,102, 43,145, 21,196, 41,148, 54, 34,171, 13, 95,126,234, 48, 90, 85, 12,177,173, 90,214,222, 54,136,147, 13,121, -230, 66,141,250,230, 85,230, 70, 23, 98,120, 97, 56,108,198, 31,100,122, 53,109,212,210,166,146, 40, 91, 13,100,121,250,225,169, - 56, 90, 11,168, 36, 96,144,131, 27, 68,144,148, 38,134, 43,132,100,128, 68,205,166,247, 52,170, 62, 56,216,229, 48, 7,159,248, - 29,250, 91, 55, 80,113, 55,141, 58,101,117,175, 82,100, 83,153,174,141, 76,112,195,156,126,122, 40,171, 67,148,183, 33,183,126, -160,100, 12,208,183,186, 24,225,107, 17, 67,165, 64,161,136,147,212,205, 76,212, 67, 25,102, 58, 39,170,236, 96,143, 37, 26, 33, -185,153, 35,188,229, 61, 63,206,237,151,158, 67,119,118, 41,244, 98,238, 46, 86,209,132, 96,188, 92,162,185,215,100,125,115,143, -253,182,207, 78,187,199,211,207, 93,101,166,154,195,146,224, 39, 49, 81, 44, 65, 51, 88,237, 4, 4,137,196, 52, 52,102, 11, 14, - 57, 67,231, 72,222,195, 48, 13,116,180, 84, 53,208, 77,138,174,139,136, 20,158,145,114,191,157,156, 78, 41,231, 18,151, 19, 90, - 45,159,131,110,151,118,146, 50,185, 53,160, 96,167,211,163,165,219,196, 73,186,231, 55, 53,157,130,107, 81,114, 29,250, 81,194, - 76,201,163, 31, 68,184,150,201,248, 88,133,124,161,128, 33, 37,229,169, 49, 44,199, 65, 70, 49,229,201,137,116,165,150, 17,206, - 76,203,204,228,241, 24, 72,136,251,109,146,160,135,153, 43,160, 91, 22, 8, 13,221, 76,189, 42,186,227,161, 84, 66,123,107, 3, - 79, 11,112,139, 83,244,250,109, 58, 87, 95, 76,149, 51, 77,101,208,162, 67,151,188,236, 82, 53,128, 22,169, 44,226, 33,196, 40, -105, 65,114,232,226, 54,168, 6, 86, 18, 37,193, 80, 2, 79, 75, 63,227, 81, 28, 15, 99,161, 73, 34,112,117, 69, 94, 19,180, 16, - 96,164,189,236,150,158,186,228, 83,150,133,196,208, 4,154,144,195,139,144, 20, 18,137,164, 31, 43,130,129,169, 53,187, 76,107, - 40, 92,215, 38, 33, 38, 14, 66, 52, 87, 67, 34,137, 67,159,208,111, 97, 4,221,148,117,161,143,146, 39, 42, 78, 50,213, 64,207, - 10,146, 4, 16, 33,147,128,160,118, 64,103,239, 6,223,249,163,171,216,253,199, 56,245,143, 79,242,131,255,116,149,220,148, 71, -113, 54, 36, 94, 55,184,190,125,135,199, 30,123, 11,245,131, 58,203,207, 79,241,236, 95,174,227, 21, 35,112,125, 98,115, 23,221, - 12,232,199, 17, 81,146,208,110,152,216,133, 62,179, 83,112,208,242,112,250,103, 57, 53,239, 81,239, 7,236,117, 12,142, 29, 29, -163,211,185, 73,113,252, 94, 52,161,209,222,111,179,229, 25,156,250,213,207,162,255,171,223,254,205,207,200, 56, 98,229,229, 31, - 96,231,115, 88,182,131, 91,173,226, 22, 42, 40,191,135, 91, 78,141, 19, 66, 55,185,254,173,111,210,105,213, 40, 77, 78,224, 20, - 75,244, 14, 14,200,143, 79,176,242,234, 43,204,156, 57, 69,115,115,131,242,236, 12, 50, 8,113, 38,103, 81,113, 72,216,239, 96, -229,138, 4,157, 58,134,155, 75,247, 53,150, 3, 73, 72,212,110, 96,234,169,123,210,158, 60,198,181,167,191,204,226,189,247, 32, - 12,139,245, 23,158,197, 41,120, 84,142,156, 96,235,141,215, 80, 73,196,234, 27, 87, 9, 90,251,244, 26, 93,238,126,252, 62,148, - 49,198,193,202, 26,181,237, 93,214,151, 87, 88,189,122,133,137,156,228,254, 15,126,144,246, 65,135,213,171,203, 20,171,130,227, -231, 30,160,223,243,105, 55, 90,116,219, 29,118, 54,119,137,194, 54,221,102, 29, 41, 67,106,219, 93, 10, 78,194,189,239,126, 39, -177,178,248,193,211,207, 83, 45, 88,156,126,224, 44,173,253, 54,107,119,154, 92, 56,183,192,242,237, 45,106, 91,155, 44,221,189, -192,237,235, 91,180,235,219, 44, 45, 77,147,160,179,186,188,141,107, 43,226, 40,194,239,116, 9,162, 62, 97, 40,137,149,160,125, -208,162,219,220, 69,211, 29,252, 86, 11,195, 40,160, 52, 65,179,182,131,229,184,196,126,143,205,245, 13, 12,195,192, 48, 13,110, - 95,191,202,252,145,227,244,123, 45,116, 12,182,247, 55,217,186,157,130,105,166,102,231, 9,251, 29,238,172, 44,179,116,226, 12, -141,218, 46,154,238,178,189,189, 67, 99,191,206,214,237,155,156,125,228,173,172,222,184,197,217,179,243, 76, 47,150,177, 11, 85, -204, 66, 33,157,240, 12, 3,205,113,208,172,148,152, 39,116, 13, 61, 95, 30,141,116, 34, 27, 23, 18,153, 78,218, 81, 15, 12, 7, -213,107,210,222, 90,167,185,185, 69,189,182, 79,175,219, 35, 12,125,162, 1,189, 76, 41,108, 1,239,252, 39, 63,159, 74,238,154, - 1, 42, 7,180,225,202,235,196,205, 46,193, 51,223,193,234,116,209,139, 46,173,149, 77,110, 6,138,104,172,196,238,250, 54, 63, -189,186, 78,127,231, 26, 66, 51, 80, 66,207,164,112, 61, 59,115,180,116, 66, 19,105,219, 88,122,176, 15,112,141,122,186, 95,243, -242, 8,161,112,238,186,159,214, 83,159,231,255, 39,235, 61,131, 37,205,238,243,190,223, 9,111,232,183,211,237,155,230,134,201, - 51, 59,187, 0, 22, 11,236, 46,136, 68, 1, 32, 64, 2,140, 32, 9,138, 42, 6,155,146, 37,154,148, 69, 37, 75,162, 44,127,177, - 68,149,100,203,102,149, 75,150,168, 18, 85,182, 40,209, 2, 45, 75, 44,217,148, 64, 73, 96, 0, 19,210, 2,139,197, 98,243,238, -236,196, 59,115,115,232,219,249,205,231,248,195,121,187,251, 14,141,170, 45,236,236,204,237,219,115,187,251,156,127,120,158,223, -163, 91, 11,168,192,167,204,113, 34, 46, 45,240,155, 11,136,246,162, 91,129, 20, 41,217,164,143,144, 26,191,217,230, 91,191,241, -239,248,213, 63,218,226, 47,255,217,159,100,115,221, 80,247, 51,222,251,129,235,124,237,165,251, 92,187,176, 72,237,195, 31, 34, -253, 87,191,129, 94,104,208,141, 15,201, 6,199, 51,155,215, 76,121,115,102, 87, 46,206,120, 71,167, 98,183,105, 84,168,197, 62, - 18, 70, 50,139, 75,149, 60,178,163,180,149, 50,247,236,159,155,118,167,226, 76, 87, 59, 83,224,203, 41,209,198,177,229,177,246, - 81,101, 62,103,172, 98,103,147, 91,166, 88,214,105,202,197, 20, 14,115,182,184, 56, 99,208,151,179, 85,195,116,186, 32,207,240, - 8, 42,207,114,145, 32, 40,206,160, 93,237,188,126,152, 21, 33,213,252, 69,137, 51,124,249, 71, 9,116,238,247, 31, 65,200,207, - 39, 13, 83,255,112,181,111,119,211, 16, 75,235,218, 53,234,207,124,175, 59,120,243,164,138,110,243, 33,143,177, 42,192,166, 57, -182, 40,208,170, 73,212, 92, 68, 9,197,202,242, 34,239,250,224, 51, 68,117, 31,109, 45,245,208, 39,242, 20,139,205,128, 31,250, -200,147, 92, 88,105,241,216,197, 69, 86, 27, 53,214, 87, 58, 52, 61,201,123,206,119,216,108, 6,108, 54, 2,214,162,144,165, 70, -141,205, 78,131,205, 78,131, 86, 20, 80,247, 3, 86, 58, 13, 90,181,136,165, 78,139,122,224,225,107,141, 53,165, 67,210,250,154, -186, 47, 73,139,130,181,118,157, 80, 73, 22, 66,143,102,232,211, 14,124, 34,223,167, 17,120, 44,215, 35, 30,191,112,142, 70, 84, - 99,169,221, 98,109,185, 67,179, 94,103,161, 17,113,225,252, 58,126, 16,176,180,186, 68,179,211, 36,234,116,104,180,219,212, 59, - 11, 14,247, 92,102, 40,111, 10, 68, 42, 17,149,237, 84,106,133,246,125,116, 24, 34,148,135,148, 10, 29,212,240, 90, 29,130,122, -199, 5, 37,109, 63,164,222,233,208,106, 9, 84, 51,164,251,149,151, 24,189,254, 85,108, 94,206, 2,153,108,117, 92, 8, 33,102, - 60, 5, 23,128,226,156, 14, 51, 6,194, 60,214,207,125, 84,206,190, 39,171,162, 85, 75,137, 18,211, 92,115,139,146, 10, 97,220, - 10,168, 4, 98, 99, 72, 75, 75, 77, 73, 58,129, 19,198,105, 33,104,106, 77, 39,208,212,149, 64, 27, 23,153,154, 23,150,164, 40, - 57,141, 11, 14,179,130,126,110, 24,229,150,114, 26, 60, 3,148,121, 78,154, 76, 8,165,165,169, 21, 43,129,162,233, 41,106, 38, -199,211,174, 40,195, 74,164,223,192, 22, 41,194, 90, 39, 36, 22, 30, 11, 31,254, 94,130,115, 29, 76, 50,161,204, 14,216,250,242, -203,124,249,151,238, 48,220, 91,229, 29,127,162,205,209,237,152,254,201, 33,135,119,142, 57, 62,200,168,249,112,255,232,128,225, -142,129, 60,192,212, 6, 28,246, 78,233,103, 9,253, 1,220,218,143,233, 29, 53,121,115,119, 72,220,111,115, 26,167, 20,227, 22, -223,124,107, 66, 49, 58,199,149, 27,151,168, 47, 42, 30,220,223, 33, 43, 11,242, 33, 12,187, 57, 23, 31,191, 76,173, 81,103, 52, - 26, 96, 75,201,234,187,159, 65,253,197,159,248,254, 95,144, 66, 83, 76,134,232, 80, 51, 25, 12, 93,176,213,242, 38,182,200,105, - 92,122,156,157,151, 94, 98,210, 61, 33, 29,140,184,250,204,123,200,226, 17,217, 36,197,154,130,248,244,148, 11, 79, 62, 9, 66, - 50, 62, 57,166,113,110,141,176,115,142,209,254, 67,252,230, 18,118,220, 67,212,218,136,108,132,240, 27,152,204,141,110,164, 86, - 8, 99,241, 91, 11, 72, 63,164, 72, 39,172, 92,187,142,201, 74, 94,254,205,223,224,234, 7,222, 71, 58,236,209,223,221,163,177, -188,140,240, 66, 76,146, 80, 20,146,248,112,135,171, 31,253, 8,233, 40,225,104,107,143,124, 28,179,114,110,137,167, 63,242, 97, - 46,126,240,227,220,121,241,117,162, 86,196,198,229,199, 88, 92, 90,197,104, 77, 81, 26,210,113,194,225,206, 1,109,223, 39,242, - 60,162,134, 70, 6, 33,218,131,139, 79, 60,206,246,214, 46, 59,119,183, 81, 69,204,165,119, 93,165,123,112,202,238,246, 62,161, - 7,189,193, 9,233, 32,229,210,213,101,122, 39,167,132,158,226,169,111,123, 22,107, 61,110,190,177,139, 20, 3,150,150,218,180, - 23, 86,217,222, 58, 37, 25, 14, 25,199, 19,226,225,128, 34, 27,146,230, 5, 66, 90,148, 23,144,229, 3,242, 60, 69, 8, 75, 26, -143,233, 15,199,180, 90, 75,156, 28,238, 17,250,117,142, 14,143, 40,227, 9, 39, 71,135,188,241,230,107,180,219,231,184,125,231, - 37,150, 23,214,185,121,251, 13,174, 93,123, 7,121,150,114,120,184,207,147,239,125,150, 23, 94,124, 14,145, 21, 44, 44,157,163, - 22,213,216,186,117,135,143,125,242, 25,214,174, 93, 70, 4,181, 74,221,109,144, 58, 64,250,161,179, 46, 89,231,135, 20,181,214, -153, 91,193, 58,107,152,148,149,154,185,172,102,180,134,228,248,128,209,254, 62, 39, 59, 59, 76, 70, 19,138,220, 85,148, 38, 47, - 16, 72,134,195, 49,159,254, 75, 63, 3,209,130, 59, 64,173, 70, 8, 15,122,183, 41,111,221, 39, 75, 19,204,191,249,247, 4, 23, -215, 41, 6, 67, 94,127,249, 62, 59,131, 33,111,189,253,128,255,102,235, 69,108, 62, 60,163, 26,179,238, 66,151, 46, 39, 64, 84, - 1, 42, 98, 30, 65,230, 40, 86, 66,128, 41, 16,131, 46,191,240,211,255, 45,127,247, 31,124,150,209,131,251,124,251, 99, 11, 20, -194,160, 61,159, 34,201, 17,158,143, 16, 18,237, 7,168,181,243,110, 13,226, 7,140, 14,183, 17,202,163,179,121,153, 31,251,177, - 63,199,147,207,124,128, 31,251,153,239,229, 95,255,147, 95,230, 7,254,139, 31,161, 57, 56,225,251,126,230,207,241,251,159,251, - 26, 79,190,247, 26,147,131,135,232,251,251,132, 87,174,115,124,251, 27, 85,119, 45,230,177,167,213,197,236,238, 59, 87,229,255, -255, 82,196,206, 52, 42,178,202,254,118, 93,171,249, 99, 0, 26, 59,219, 81,207,137,109,211,223,171,212,235, 21, 18,110,230,109, - 63,131,172,181,143, 36,182,157,177, 18, 85, 8, 87, 42, 44,108,165, 90,154,251,208, 43, 21,242,236,192,174,246,219,198,216, 25, - 2,214,206,160, 50,211,219, 94, 59,111,123, 53,198, 21, 66, 84,164,183, 63, 6,198,153, 38, 94, 73,129, 8, 34,188,198, 34,228, -153,219, 93, 50,231,221, 51, 77,162, 19,243, 90,115,110,249, 19,103, 92,127,103,146,237,170,167,163,181, 36,188,241, 1, 26, 79, -126,104,150, 2,232,212,118, 18,164, 66,218,156, 60,158,144,199,110, 66, 83, 76, 6,180, 22,106,172, 94, 88,195,150, 37,202, 15, -176,101, 73, 88,243,168,215, 35, 46, 95, 89,101, 97, 99,157,197,213, 69,116, 16,112,254,202, 38,171,203,109, 86,151, 91, 44, 54, - 3, 22, 26, 53,150, 91, 17, 23, 46, 45,179,210,172,209,168,105,234, 81, 72,189, 22,112,110,177, 69,189, 22,208,136, 28,244,197, -215, 30, 69,150,224, 41,137,167, 37, 89,146, 16,133, 62,157, 86,192,242, 66,139, 72, 10,218,245,128,186,239,187, 14,188, 29,177, -177,178,200,242, 98,147,213,181,117, 22,151,151,169,213,106, 52,154,117, 2, 79,179,188,177,202,194,234, 18,245,102, 19,237,121, - 52, 23,151,241, 61, 7,153,209,190,118,232, 80, 79, 35, 17, 46, 64, 5,129, 41, 10,130, 86, 19,229, 59,184,140,210, 1, 58,170, - 35,181,135, 14,107,248,173, 37,188,122,147,163, 87, 94,192,196, 99, 58,155,155, 68, 13, 40,242, 33,135,191,245,235,228,167,125, -231,132, 48,115,130,226,108, 10, 85,218,185,206,227,145,178,140, 57, 6,121, 54, 36, 50,206, 53,129, 91, 47, 9,241,104,146,160, -170,114,204,133, 20,213, 69, 12, 73,233, 86, 6, 13, 37,232, 4,154, 80,184,241,122, 67, 43, 22, 3,143, 80,106,116, 53, 89,202, -141,227,188,247,139,130,163,196, 48, 46, 93, 65, 96,177, 21,226, 87,160,112,141, 72, 36, 37, 11, 90,177,228, 41, 58,202, 35, 84, - 46,229,205,150,224,213,151,169,173, 94,197,100, 9, 38,139, 17,198, 2, 5,157,143,252, 32,193, 90,141,120,119,135,255,240,243, - 95,229, 11,255,234, 24,169, 36,141,134, 96,117, 77, 17,179, 72,214, 63,118,159,181, 50,195, 76, 20, 39,113,215,217, 37,165,226, -244,164,160, 30,182, 17, 72, 50, 51,161, 29, 44,128,134,205,232, 28, 37, 9,163,114, 68, 47,237, 81,144, 80,211,109,108,156,113, -251,246, 14,232, 26, 45,189, 72,171, 86,163, 22, 45,115,237,233, 13,234,203,117,202, 73,201, 96, 56, 32,233,129, 94,188,112,145, -201, 96, 72,123,253, 2, 97,187,205,253, 23, 62,199,230,103,126,156,187, 47, 60,199,226,250, 58, 15,190,254,101,122,135,123,180, -151,155, 44, 93,185, 68,111,119,159,214,114,135,104,245, 28, 20,110, 15,178,127,235, 13,206, 63,245, 1,214,223,253, 94,138, 52, - 99,116,176,141, 95, 11, 41,227,145,203, 69, 79, 99,132,242, 16, 18,210,211, 19,106,171,107,238, 98,247, 3,240, 66,226,195,251, -120, 81,155,222,246, 93, 14,239,222,227,169,239,254, 4,111,253,209,115, 60,249,221,159, 32,233, 13, 56,221, 59, 98,251,230, 91, -132, 53,197,210,210, 26,239,252,115,127, 22,252,136,131,219,175, 49,238,245, 56,255,248,101,148, 31,112,122,220,229,246,235,191, - 67, 84,143,240,234, 75, 46, 57, 14,201,112,175, 75,150,197,216,220,178,113,249, 2,194,211,152, 92,112,180,117,139,206,178,194, - 15, 60, 94,125,254,155,140, 79, 71, 52,154,138,206, 98,135, 60, 25, 19,143, 39, 68, 53,159,120, 52, 98,253,194, 58,229,186,192, -164, 5,173, 78, 13, 99, 37,119, 31, 60, 96,208, 29,209, 63, 61,230,189,223,118, 9,165,155,228,153, 96,125, 99,157,195,195, 46, - 39,167, 39,148,229,136, 56,147, 28,159,244,136,116, 70,107,233, 42,136, 4,165, 61, 70,195, 33, 65, 24,185,149, 95,225, 49, 24, -109, 83,150,146,188,136,185,191,179,141,148, 1,146,152,237,189, 93, 58,157, 54,175,222,124, 25,165, 20,127,240, 71,191,205,234, -218, 6,199,221, 46,195,223,249, 77, 30,187,244, 14,254,159,223,250,119,188, 55,181, 92,187,116,129, 31,254,169,239, 69,132, 53, -240, 3,180,167, 49, 69,137,174,133, 8,165, 92,220,229,116, 90, 18,134,243, 52, 14, 97,157, 61, 77, 77, 59, 60, 5, 36, 32, 61, -204,228, 20,140,101,120,116,204,168,215,195,106,207,121, 42,129,194, 88, 10, 83,240,157,223,243, 81,104,175,128,246,171,177,148, -198,210,135,237, 93,231, 91,255,221,223, 35, 56,191,140,205, 11, 6,187,199, 60,156,100, 12,211,130,239,249,155,127,154,112,245, - 50,121,119,123, 14, 87,153, 18,239,164,194, 8,235,134, 7,210,161, 70,231,163, 59, 7,169,240,149,229,187,190,251,103,249, 19, - 63,252, 87,248,212,227,134,175,188,125,135,201,173,151,249,235, 63,244,110,242,194, 9, 19,109,158, 99, 3,143,244,228, 24,109, - 10, 16,218,121,106, 5,216, 34,195,154,130,214,226,227, 44, 52, 45,167, 91,119,248,103,191,246,207, 1,248,239,255,201, 63,229, - 67,159,252, 56,225,194, 37, 6, 71,199,116,254,210, 95, 96,248, 95,254, 28,157, 27, 79,187,231, 81,117,204,211, 11,231, 17, 7, -153,176,206,207, 45,167, 23,225, 20,196, 98,103, 22, 55, 99,173,139, 57,126, 36,162,148, 71,212,236,115, 53,248,153,240,146,105, -155, 62,179,126, 49, 91, 69,184,125,250,163,105,104,179,245,197,217, 8,214,202,151, 46, 85, 88, 9,232,242,106,114, 35,230, 52, - 60,229, 70,241,101,105, 17, 82, 35, 85,128, 41, 38,149, 13, 79,205,118,140,186,185,142,240, 2,242,254,125, 68,153, 87, 75,124, - 59, 63,240,109,101, 1, 84,211, 36, 13,133,215, 88, 67,232,128, 98,116,122,166, 88,179,143, 68, 0, 79,215, 64,182, 52,179,233, -194,156,222,231,126,182, 74,200,106,202, 48, 5,232, 88, 84,180, 52, 53,209, 87,223,207,175,126, 64,185, 11,140,242, 35,188, 32, -192,143,106, 44, 95,190, 68, 49,236, 81, 95, 59,135, 16, 37,249, 36,198, 22, 57, 66,182,240,163, 16,164,162, 72, 29, 5,179,190, -180, 64, 89,150,110, 76, 95,150,140,122, 3, 58, 69, 65,150,228,148,105,134,177, 80,230, 25,105,156,145, 23, 78, 15, 97,173, 2, -235,172,121, 6,131, 18, 1,201, 36,165,217,140, 96,173,141,148, 30, 69, 81, 96, 41, 89,106,183,200,203,210,249,166,243,140, 90, - 88,163,179,186, 10, 88,194,122, 11, 47, 12, 40,203,204,189,174, 69,129, 10, 2,164, 84, 4,145,143, 45, 74,130,102,132,146,146, - 98, 50, 4,163,144,158,166, 76, 83,172,180,100,131, 83,106,157, 37,231, 76,200, 98,252, 90, 29,139, 65,121, 1, 66, 40,116,173, -134,174, 53,240,106, 13,108, 81,224, 71, 13,130, 70,141, 48, 2, 25,212, 48, 73,128, 45, 42, 63,121, 81,206, 35,131,172,197,170, - 51,204,227, 89, 78,130,153,227,145, 43,125,132, 53, 85,143, 48,195, 44, 75,103, 45, 44, 43,199,201,116,127, 93, 41,241,167, 70, - 16, 89,217,206, 26, 90, 83, 90, 8,113,123,116,163, 33, 85,134,154, 84,120, 8,199, 84, 80, 18,100, 13,202,161,203,174,168,130, -123,106, 66,208,212, 2, 83, 74, 74, 99, 92,173, 87,173,111,252,138, 49,239,219, 42,147,188,218,191,251,158,194,152,148,228,100, -139, 34,238,207, 37, 31, 70,114,250,245,231,248,237,127,252, 18, 55,191, 50,162,177,146,210, 90, 78,193, 36,172, 60,246, 52, 94, - 35,226,233,252, 47,240, 92,244, 63,145,142,250, 68, 13,205,233,164,199,165,165, 21,188,154, 32,233, 11, 34, 45, 25,103, 41, 4, - 37,202,106,222,249,228, 18,223,252,198, 14,169, 63,166, 93, 91,162,155, 28,209,241, 87,216, 88,188,198, 82,171,197,189,221, 29, - 54,151,158, 96, 16,247,184,124,227, 34,175,189,249, 69, 30,219,248, 32, 91, 47,191,200, 51, 63,252, 41,186, 15,250,104,161,232, - 29, 14,208,147,193,144,164,223,197, 26,143,173, 87, 94, 98,113,125, 21,147,231, 36,221, 19, 14,135, 61,252, 70,139,229,181,101, - 22, 54,207,243,240,213,215, 88,190,116,153,201,112,200,194, 99,239,230,237, 47,252, 14,195,222, 33,207,254,232, 79,114,122,251, -109, 26,171,231, 56,188,245, 42,235,239,124, 47,113,191,135,202, 19,106,171,151,153, 28,237, 81, 91,232, 48, 57,222,199,111, 52, - 40, 83, 39, 34, 75,250,110,116, 28, 45,180, 57,188,115,151,198, 66, 29, 79, 90,116,212,226,242,123,222, 69, 50,140, 57,184,123, -143,173, 87,222, 98,227,218, 58, 79,252,224,143,146,119, 7,116,183,183,121,240,250,171,132, 81,131,139, 55, 46,225,181, 23,185, -253,194,203, 20,233,136,122,179, 65,158,166, 12,143, 79, 64, 5, 12, 7, 67,108,158,210, 59,233,146,142,187, 72,191, 65,232,151, - 4,181, 14, 11, 43,231,200, 40,217,221,218,101,117,181,193,187,159,126,154, 36,206, 72,178,132,126,127, 72,156, 22, 12, 78,251, - 76,198,251,148,118,200,185,205,203,108,239,158,178,253,224,109, 54,214, 58, 40,173, 24, 14, 83,206,111, 54,192, 70, 12,227, 49, -147,126, 70,145, 25,178, 44, 39, 73, 50,242,162,192,148, 49, 87, 47, 52, 80,202,103,107,111, 27,229, 55,240, 68, 73, 20, 54,221, -170, 47,239,115,243,238,155,116,218,154,135,187,175,179,126,174, 77, 18,231,244,123, 59,156, 63,127,157,237,157,155, 44, 54,159, - 96, 60,121,147, 86, 99,145,254,100,196,228,222,109,122,147,132,183,146, 33, 55,239,239,114,227,234, 83, 60,220,191,197,223,254, -197,191,201, 56,203,209, 81,232,198,204,121,142, 14,195,106, 60,236,186, 21,237, 5,110, 68,206,153,228,171,178,156,207, 57,221, - 73,232,108,136,249,136, 50, 75,137,123, 39,196,131, 62, 88,220, 62, 93, 73,242,212, 89, 20, 67,237,179,244,238,167,156,109,109, -230,163, 42,161,191,135, 57,238, 82,228, 25,188,245, 54,226,210, 38,229,120,204,205,123,135,168,166,143, 25,142,120,255, 47,254, -115,178,211, 59,213,184,190,116, 22, 40,233,158,171,148, 26,137,117,148,186,233,206,214,184, 21,129, 53,146,176, 25,240,255,254, -226, 63,230,195,159,254,243,124,236,253,143,113,233,156,207,119,159,174,240,197, 55, 46, 97, 70,175, 96,234,139,120, 90,146, 22, - 25,182, 12, 40,226, 17,244,123,136,206, 50, 82,249, 72,161, 48, 66, 66,105,232, 15, 15, 9,228,101,174,190,251,221, 28, 14,122, -179, 14,227,151,254,183,127,200,255,248, 47,126,135,222,193, 22,173,149,101,228, 51,239, 66, 25,129,108, 46,144,143,122,206, 75, - 62,189,160,167,105,105,103,104,113, 98, 10,118, 17,103,236,108, 22, 76,165,157,159,118,178,162,178,127,207, 95, 19,135, 86, 45, -167,226, 55,139, 67,249, 82,221,151,213, 40, 94, 41, 49,167,211, 21,211, 34, 96,122, 57,139, 51, 5,135, 83,247,206, 46,218,234, -185, 26,172, 43,108, 68,165,111, 47,166, 59,248, 51, 54, 61, 11,210,107, 99,172,193,152, 49, 66, 74,138,202, 35, 79, 97, 17,233, - 0, 59,201,177,133, 43, 12,164,117,143, 43, 42,221,128,208,129,123, 47, 25, 23,240, 99,115, 67, 25,143, 48,197, 49,182,200,220, -225,110,108, 69, 38, 19,238,189, 56,163,244,149,103, 84,246, 83,202,142,152,141,232,203, 98,186,111,175,238,113,164, 3,223, 96, -221, 46,221, 15, 33,141, 93,183, 46, 37,232,208,229,132,183,219, 52,180, 19,241,146, 47, 3, 25,101,156,224,213,234,116,174, 52, - 40,227, 9,104,141,181, 5,170,222, 64, 55,154,144,142, 40,146,196,233, 49,132, 4, 95, 98,165,199,164,223, 39, 29, 78,220,197, - 93,134,232, 70, 78, 54,206, 0,229,114, 76,112, 35,247, 34, 78,240,235, 17,237,118, 8,198,115, 3, 19, 37,104, 46, 45, 80,164, - 73, 53, 22,118,197,166,146, 18,229, 5,120, 65,132,212, 10, 47, 10,208,126,132, 45,221,238,219, 20, 37, 74, 74,172,176, 40,207, -131,192, 67,216, 18,229,215, 28,205, 50, 79,145, 86, 34,130, 0,147, 37, 72,169, 41,134,189,202,190,169, 81,202, 3,233,118,195, -202,247, 80, 97, 29,191,189, 68,127,235, 14, 90,123,248,245, 6,205,134, 64,105, 87, 60,244,191,246, 42,233,241, 81,149,178,103, -231, 16, 68, 41,177, 69,129,240,228, 44,159, 88,216, 41, 76,168,186,100,237, 52, 53, 87,206,180, 23,211,194,210,158,161, 33, 98, -203, 10, 13,236, 62, 15,211,211, 72, 75, 65,205, 74, 39,156,149,146, 64, 73, 60,233, 82,239,146,194,224, 43, 65, 32, 92,231,237, -215, 86, 80,181,101,138,242, 54,158, 25, 18, 74, 65,199, 19, 8,235,126, 86, 9, 37, 69, 41, 80,202,137,240,180, 21, 4, 82,208, - 82,130,154, 18,104, 3,138,210,101, 97,148, 5,118,210,115, 86,202, 42,192, 71,135,171,116, 55,255, 60, 47,125,254, 46,253,227, - 1, 23,158,108,209, 63,200,169, 7, 37, 75, 43,239,227,219,159,253, 71,116, 38, 47,146,141, 66, 62,181,248,211,252,171, 87,191, -139, 35,241,105,174,174,105, 14, 7,135, 52,194,136,123,219,247, 56,223,190,128, 73, 50, 78, 71, 49, 27,231,150,121,245,230,235, -124,250, 83,223,207,103, 63,255,219,188, 99,105, 21, 79, 55,232, 4, 75,156,246,247,152,140,186, 92, 88, 95,133,124,204, 56, 61, -162,187, 27, 35,133,226,153, 79,222,224,149, 47,188,198,221,231,111,227,121, 17,214, 64,212,140,144,101,150,177,114,253, 9,198, -189, 30,139,231, 86,105, 44,175, 80,140,251, 52, 23, 23, 56,247,216, 53, 86, 47, 95,160,181,126,129, 44,205,104, 44, 46, 18, 52, - 91, 44, 94,112, 89,233,227,238, 33,207,254,200, 79, 50,216,190, 79,216,106,241,224, 91, 47,176,114,241, 18,170,190, 72,210, 61, - 33,108,118, 40, 38,167,132,205, 22, 50,172,147, 15,187,232,214, 18,131,221, 45,138,116, 66, 17, 15, 72,250, 39, 16, 46,115,122, -255, 30, 65,179,195,218, 59,222,197,209,219,183,105,158,191, 66, 62, 30, 81,111, 52,120,250, 19, 31,231,218, 7, 63, 68,188,183, -205,238, 27,111,240,210,239,253, 1, 81, 75,210, 89, 95, 33, 45, 4,111,191,248, 26, 39,251,219,116, 86, 59,104,173,233,172,174, -162,188, 26, 15,223,222,225,171,159,255, 67, 94,253,202, 87,104,120,134, 11,151,174,225, 41,201,202,198, 85, 38, 73,201,193,209, - 62,119, 94,125, 21,145,245, 89,218, 92,228,193,246, 30,247,238, 63,224,237, 87, 95,225,244, 96,159,219,111,190,137, 77,143,185, -116,233, 26, 69, 82,146, 38, 99,122,199,167,124,199,199,190,157, 75, 87,159, 32, 43, 34,146,201,152,102,103,129,126,191,207,225, -246, 9,133,153,128, 54,212, 26, 30,151, 54,214,233,212,151,105,132,109,210, 84, 48,154,228,216, 66, 16,169,128,162, 44, 72,242, -148, 97,156, 32,181,160, 55, 58, 33,141, 3, 60,134,236, 31,158,114,127,103, 11, 35, 20,175,188,245, 22, 81,205,227,171, 47,191, -202, 82, 59, 98,231,228,132,192,243,232,142, 99, 2, 79,179,208, 12,121,241,222,109,110, 92,239, 47,154,189, 0, 0, 32, 0, 73, - 68, 65, 84, 90,224, 95,254,250,103, 25,231, 14,166,130,117,112, 21, 21, 56, 4,175,144, 18,169,117,213,161, 7, 21, 83, 80,205, -213, 85, 74, 87, 55,133, 7, 4, 78,218, 90,164, 96, 11,146,227, 35, 78,238,111, 49,158, 76,156,122,212, 66,145, 22, 20, 73, 66, - 60,202,248,196, 39, 63, 4, 65,139, 89,110,168, 21, 64, 6, 7, 7,148,227, 9,249,214, 22,202,211, 8, 83,178,243,198,125,134, - 11, 11,244, 30, 28,242, 39,255,227,175, 98,178,163,234, 16,102,166, 94,118,103,133,235,166,133,212, 8,237,205,199,240,179, 74, - 58, 71,249, 30,255,240,223,253, 30, 31,126,255, 19, 92,222, 12,248,197, 95,248,171,124,230,207,252, 20, 55,174, 7, 12, 83,131, -205,115,164, 18, 72,139, 99, 78,219, 18,115,122, 50,223, 51, 75,144, 24,208,154, 82, 22,188,113,171,203,157,123,111,241,153,239, -251, 30,119,152,120, 48, 49, 17, 23, 46,249,124,235,185, 55,157, 74,247,199, 63,131,217,218, 38, 90,220,152, 43,208,153,101,178, - 58, 30,246,153,101,183,153, 38, 87, 85,207,123,218,129, 78,215,199,211,238,211, 78,211,171,230, 16,249,121, 62,250, 25,194,170, - 41,237,124, 84,125,134,139,238,186,250, 51,217,234,198, 96,138,178,250,190,165,155,184, 32,153,166,166, 58, 47,177,193, 22,147, -249, 1,107, 77,117, 24,155, 71, 70,164, 22, 67,153, 14, 40,211,211, 89,126,246,252, 47, 96, 41, 39, 93, 76, 58,170,130, 88,230, -148, 58,191,115, 25, 85, 91, 65,183, 54,145,126,228, 30,215, 26,164, 52, 20,227, 67,108,230, 32, 38,214,148,211, 24,152,185, 15, -157, 57,124,126,214,196, 25,215,177, 79,167, 9, 83, 0,151,157, 22,146,194, 34,253, 26, 50,219,155, 23, 1, 83, 49,160, 80,160, -130,153, 24, 76, 5, 33,209,242, 42, 65,187, 67,184,236, 52, 39,254,210, 2,181,197, 22, 94, 43, 34, 88, 94, 34, 88,108, 83, 91, - 92,160,182,208,196, 15, 20,210,215,120,141, 8,169, 93,108,177,174, 57, 91,104, 16, 53,168,119,154, 4,205, 8, 29,248, 4, 97, - 64,212,106, 82,107,214,240,107, 1,126,168,241, 61, 77, 80,215,212, 91, 53, 60,237, 17, 68,154,168, 85, 35, 12, 20,194,196,132, - 97,141, 90, 20, 17, 69,154,122,163, 69, 45,138,104, 84,143, 17, 70, 33,126,224,187,100,178, 70,147,176,214,192,247, 53,186, 86, -195, 15,125,119, 57,121, 26, 41, 36, 38, 75,240,107,110,188, 46,176, 40,173, 8,155,109, 60,223, 67, 7,117,148,246,241,194, 16, -169, 60,116,212, 64, 69, 53,164, 23,226, 69, 77,148, 95, 39, 27,141, 73, 7, 67,130, 64, 16,117, 26,248, 81,192,224,104,196,233, -243,191, 77, 57, 73, 49, 69, 81, 37,174, 85, 93,123,233,222,203, 54,183,149, 61,114, 42,144,155,231, 24, 88,203,140, 36, 56,207, - 21,102,134,133,157, 90, 25,167,238, 17,169, 42,113, 36,142,104, 40, 75,240, 4, 52,180,162,165, 20, 13,169,136,164, 36,148,130, -150, 22,212,112, 34, 59,167, 27, 72,201, 71,187,136, 60, 38, 64,208,242, 20,107,190,102,197, 87, 52,181,164, 38, 36,129,114,123, -251, 0,129, 47, 32, 16,174, 91,215, 21, 83,193, 90,233, 66, 10,167,211,175,233,223,213, 90, 98,235,241,246, 27, 47, 33, 2,133, -212, 5,129,239,179,180,209,164, 29, 61,195,143,254,181,191,202,226,141,111, 98,174, 10,204,149,152,236,114,206,103,158,253, 60, - 31, 82,255,128,123,221,101,162, 32,224,246,221,109,150,162,115, 36,105, 12,228,172, 54, 86,144,101, 72, 22,215,121,233,197, 55, - 88,240, 22,120,227,248, 38, 53,161, 73,138, 4, 99, 5,158, 47,105, 46, 23, 68, 65, 6,101,201,131,195, 99,124,219,230,197, 47, -252, 1,101,174, 73, 99,159,163,237, 9,158, 14,156, 6,238,100,251, 1, 97,107, 1,207,211, 52,150,154, 68, 75,107,236,188,246, - 34,155,239,126, 31,101, 26, 83,100, 49,183,190,254, 53,214, 46, 95,101,245,198,117,186, 91,135,228,241, 9,216,144,119,126,244, - 35, 12, 30,220,169,198,186, 26,223,247, 9,150, 54, 41, 38,125,106,157, 37,144, 30,194,228, 8,229, 81,164, 57, 65, 84,195,228, - 41,237,141,139,140,142,118,137, 22,150, 81,181, 54,253, 7, 55, 89,189,126, 17,155,167, 32, 44,181, 86,147, 50,203,200,146,156, -120, 18, 99,165,100,239,185,219,100,233,144, 65, 55,101,121,173,201,210,230, 69, 78,247,142,232, 29,141,185,245,226,171,124,232, - 59,159,166,209, 89,165,119,124,202,112, 56, 98, 50, 78, 56,222,235,226,201,130,143,126,247,119,145, 22,134, 87, 95,124,141,181, -245,101, 30,222,219, 34, 30,229,116, 79,118,184,126,227, 34,237,214, 10, 55, 95,190,141,201, 18, 40, 97, 99, 99,131, 7,187, 61, - 66, 74, 46, 94,127, 7,119,238, 60,228,198, 99,215, 72,146,156,203,143,109,114,235,222, 67, 70,131, 35,106, 94,139,181,181,101, - 70,227, 4,207,143,232,159,198,100, 73, 78, 88, 15,137, 99, 67, 81, 88,116, 93, 98,100,141,221,195, 30, 74,122, 44,175, 44,147, -100, 57, 81, 36,209,218,112,212, 27, 98, 10, 15,137,101,175,123, 72,171,222, 36,207, 6, 32, 82, 14,123, 6, 45, 37,195,137, 38, -244, 83,142,251, 6, 97, 71,244, 70,117,154, 53,159,221,254, 8,133,229,175,253,228,247,241,211,127,227,175,208, 31,246, 80, 94, - 48,143, 57,245, 61,247,218, 72,229, 20,163, 65, 4,126, 80, 45,181,196, 31, 83,101, 9,119,153,207,198,182, 67,151, 92, 52, 26, -209,123,184,197,225,238, 30,147,241,132,210, 24,183, 79, 79, 50,148,214, 44,157, 91, 32, 88, 89,129, 90,219, 97, 57,167, 99,207, -124, 2,195, 1, 70,121, 20,255,241,183, 8, 54, 86, 73,211,148,109, 36,233, 96,128,108, 71,172,125,252, 71,221,200,214,130, 65, - 84,217,226,194,117,209,158, 3,203, 24,227,118,205,170,116,161, 21,115,101,152, 0, 47,226,252,245,247,208,207,250,236, 28,222, -229, 87,126,231,247, 64,194, 15,255,216, 79,241,224, 63,254, 26,181,155, 95, 71,214, 27, 72, 79,186,241,178,209,100, 7,187,212, -174, 62,238, 46,237, 90, 68, 62, 78, 73,199, 61,126,252, 83,223,229,236, 88,221, 19,126,233, 87,255, 37,207,125,253,157, 76,134, -125,254,246,223,248,235,220,187,185,199, 36, 27, 0,224,111,108, 16, 23, 57,171, 79,127,156,209,246,155, 21, 88, 67,204, 70,115, - 74,206,148,111, 21, 32,115, 74, 67,171, 4,104,218,193, 52,164,146, 85,184, 69,149,126, 86, 58, 75,145,157,134,170,152,105, 26, - 92,181, 31, 47,173,179,208,137,185,178,125,122,201, 97,166,223, 99,170, 40,158, 14, 90,166,246,175, 0,175,177, 9,241, 9, 38, - 31,206, 4, 77, 83, 27,221, 52,135, 89,206,211, 51,221,101, 56,251,143,184, 34,205, 90,202, 82,204, 71,169, 98,254,156,157, 38, - 64,162,180, 27, 53,171, 90, 19, 21, 45, 81, 38, 3, 76,210,163, 76,123,143,132,181,204,140, 69, 83,157,192, 89,180,173, 57, 99, - 89,156, 82,119,203,202,102, 87,169,253, 43, 82,253, 60,242,179,194,214,230,217,128,162,168,129,244,221, 79, 46,205,193,171, 57, - 4, 89,149,185,169,188,128,168,179, 68,158,197,120,190,196, 38,125,192, 67, 26, 87,148, 42, 99, 48, 69,230, 8, 4, 70, 80,230, - 49, 22,133,244, 3,202,188,112,214,184,178, 4,165, 81,214,128, 39, 17,198, 81, 24, 75, 85, 34,141,161, 20, 25, 2,137, 31, 10, -132,118,157,191,197, 77, 16,164,239,158,131, 49, 22, 67, 6, 72,194,118,141, 44, 78,221,138, 69, 24,180, 23,184, 9, 91,165,189, - 80,218,115,132, 53, 21, 96,202, 2, 79, 54, 16,194,204,200,121,166, 40, 80,158, 87, 77,179, 50,130,122,131,124, 60, 66, 9, 39, - 68,148, 94, 29,237,249,238,253,225,251, 72,169, 80,158,143, 12,235, 40,237,161,181, 7,214,224,213, 35, 70,183, 95,230,252,119, -126, 7, 74, 37, 24,165, 24,223,126, 64,178,191, 85,161,253,207, 20,167, 83,101,251, 60,127, 21,107, 42,210,159, 41,177, 56,194, -223,236, 76,153, 65,104,102,161, 1,213,142,154, 25,226,116,170,217, 96, 38, 43,169, 66,144,140,112,171, 2,155,186, 98,186, 90, -183, 88,161,102, 66, 61, 41,160, 24,159,206,136,117, 90, 10, 26, 82, 82,104, 69,146,151, 52,164, 32, 20,144, 85,190,255,192, 10, -106, 66, 18, 2, 53, 36,190,117,105,149, 82,134,142,171, 80,230, 51, 81,157,168,246, 0, 81,179, 67,139, 38,201, 56,197,243,224, -220,165, 69,198,221,152,235,159,124,158,193,151,123, 68,151,150, 16, 97, 76,124,152, 80,148,150,188, 99,169, 7,219,188,251,225, -207,240,133,250,223,167, 69, 64, 24,120,140,226, 2, 99, 36,131,226,132, 5,211,100,152, 14, 57,236, 55, 89, 8,154,100,102,192, -114,184,202, 48, 31,177, 20,118, 56,154,156,112,255,230,128,239,253,228, 71,121,251,193, 31,242,142, 43,239,229,254,246,155, 36, -195, 77,130,150,166,179,236,115,241,169,107,244,238, 31,177,125,247, 1,210, 87,134,253,219,175, 19,117, 22,201,211,148,231, 63, -247,239, 89,186,124,129, 36,142,233, 29, 28,145,197, 57,107,151, 46,160, 66,205,209,189,123,116, 31,222,103,243,217,143, 48, 60, -222,229,222, 55,191, 78,180,224,240,178,187,175,189,194,226,197, 11,228,163, 30, 73,239,132,176,179, 76,124,122,226,170,122, 44, -201,241, 54,126,163, 67,239,206, 27,160,124,234,203,171, 72, 93, 67,133, 33, 39,111,191, 73,231,250,147, 12,186, 61, 48, 5, 7, -247,182, 56,185,247, 22, 69, 26, 19, 70, 53, 14,182,182, 72, 70, 35, 60,173,169, 5,150,205, 39, 30,163,183,115, 76, 60, 78,201, -146,132,103, 63,252, 12,181,206, 57,118,183, 15,232,117, 15, 73,243,130,227,189, 3,164, 72,248,142,239,249, 14, 70,147,130,155, -175,222, 38, 12, 52,195,193,128,241,104,196,225,254, 54,215,175,159,103,249,220, 5,238, 61,216, 39, 27,101, 44, 46,173,178,114, -254, 34,167,147,132,227,131, 3, 30,127,199, 19,252,209,239,127,139,100,114,200, 36, 31,114,120,212,229,230,205,219,188,250,226, - 75,188,227,241, 43,180,151, 22,216,218, 58, 66,251,138,126,191,207,198,198, 18, 11,237, 53, 6,221, 2, 83,133, 44, 36,113, 66, - 82,140,105, 52, 37, 65,173, 36, 41,198, 96, 83, 38,241,144,163,227, 99, 14,142,250,196, 89,134,210,130,193,100,196,214,209, 14, -253,137, 32,240, 66, 90,145, 32,206, 82, 14,123, 3,162, 40,224,206,222, 30,237,198, 2,227,180,203,254,233,152,201, 36,225,211, - 31,123, 31, 63,253,215,126,158, 97, 50, 70,121,190, 35, 28, 89,131,212, 10, 89,117,184, 40,137, 14, 35,135, 96, 18,242, 12,237, -163, 60,163,137, 14,206, 36,128, 85, 93,102, 50, 97,114,116,192,209,238, 62,201,104,140,181, 78,221,159,199, 25,217, 36,166, 63, -204,120,223, 83, 87, 32,108,184,112, 30,230,254,106,226, 62,101,119, 64,145, 36,168,106, 15,185,245,210,219,236, 30,118,153,236, -159,240,125,191,254,127, 80,166,135,142, 50, 53,181,183, 88, 23,106, 32, 61,141,212,161, 19,179,120, 33, 74, 5, 72,165,167,210, -239,234, 18,177, 8, 60,182,247,118, 73, 6, 5,126, 1, 27,237,186, 11,127,202, 82,158,223, 61,114,227, 59, 37,241,124,141,148, - 10,169, 21,249,176,239, 70,190, 64, 99,113,141,178, 72,232,239,108,243, 23,255,246, 95,231,111,254,239, 95, 66,141, 6,220,254, -198, 87,249,210,115, 95,225,104,208,167,168,213,249,214, 87,111,177,185,177, 52,107,162,139,122, 72,163,179, 49,255, 49, 90,123, - 54,115,101,118,129,115,134, 8, 55, 75, 84,155,238,126,103, 66, 56, 49, 35,110,157, 21, 21, 77,249,241,114,122, 96,202, 71,133, - 97,211, 29,253, 76,140, 54, 37,176,137,105, 80, 70,197,166, 55,128,201,200,227, 46,182,116, 97, 21,166,156,122,196, 57,147,202, - 34, 64,132, 51,246,235,116,180,234,242,218, 67,144, 53,183, 31,158,222,247,230, 44, 24,166, 18,190, 86, 93, 13,214, 82,198, 61, -146,163,215, 49,105,151, 98,114, 92, 93,144,118,214,169, 77,113,176, 98,250, 94, 43,167,171, 9, 59,243,161,159,209, 77, 50, 3, - 17,159, 13,194, 17, 98, 86,196,136, 74,236,231, 41, 77, 49, 56,153,251,241,253,192,141,243,109,233,254, 62,210,145,227,168,208, -212, 66,129,244,106,168,176,142,246,131,217,244, 69,105, 55, 25, 50,121,142, 41, 74,242,225,128,124, 60, 1, 99,201,199, 67,242, - 36,195,230, 41,214, 24,202,188,160, 72, 83,138, 52,195,152,188,218,213,186,203, 89, 42,141,192, 58, 91, 90,224,161, 61, 73, 16, - 5,136, 34,135, 34, 70,121,154,112,161,141,223, 90, 64,107,229,236,112,210,128,114,186, 5, 97, 92,116,177, 84,202, 93,206, 82, -160,180, 70, 74,131, 84,158,163, 85, 74, 77,216,106,163,180,231, 82, 21,133,194,164, 49,126,189,142,214, 1, 90,106, 23, 92,228, - 7, 72,237,163,148,143,242, 66, 4, 10, 47,168,161,163, 22,165,129,248,104, 15, 19,167,172, 93, 94, 67,133, 18, 21,212, 25, 29, -158,208,123,225, 15, 41, 51, 59,183,106, 87,175, 49,214,206, 94, 83, 51, 29,183, 87,179,118, 81,101, 11,219,162,172,112,176,198, - 77,177,108, 21,251,236,246, 18,179,130, 88, 88,241,200,180,136,210, 86,239,127,137, 68,160, 5,168,178, 32,172, 18,216, 60, 37, - 81,149,125, 81, 85,175,191, 48,174, 0, 18,182,226,191,151,130, 64,184,238, 60,210,138,186,148,212,180,131,247, 4, 66,208,240, - 37, 77, 45,232,120,138,154,150, 46,153,205, 74, 52, 32,170, 24,211, 89, 1,105,220,122,170, 24,222,163,179,180, 78,107,177,198, -197,199, 55, 64,198,156,123,252, 41, 78,190,254,143,216,122,213,231,155,255,188,207, 27,255, 58, 39, 62, 82,140,239, 73,198,135, - 2, 93, 23,132, 53,195,183, 23,255,152, 19,209,100, 84, 28,179, 88,111, 34,149,101, 41,106, 16,231, 7,248, 66, 49, 72, 15, 16, - 54, 33,146, 10,137,101, 49,168,227,107, 69,232,123,104,227,243, 59,159,255, 26,161,182,212, 90, 30, 55,158,184,129, 31,122, 68, - 30,220,121,169,203,214,203, 47,114,239,245,111, 16,202, 6,178,190,188, 65, 45,240, 41, 76,206,222,157,219,172, 46, 47, 18,181, -151,185,249,165,223,231,214,243,191,207,219,207,127,137,250,202, 58,219,175,188,196,194,250, 42, 23,158,126, 15, 59,223,250, 6, -203, 87, 46,112,229,253, 31,102,210,239,179,247,246,155,108,188,235, 73,250, 59, 15,176, 69, 66,173,189, 64,255,225,109,138,116, -136,242, 92, 12,168,242, 53,101,105,104, 44,173, 96,243,216, 89,166,172, 33, 27, 13,185,240,109,239, 35,237,245,217,254,198,115, -132,231,206,227,105,195,218, 59,159, 33, 30,197,188,254,141, 23,168,133, 30,203, 23, 54,144,126,157,230,210, 34,167,251, 39, 28, -239,239, 18, 15, 7,228,217,128,113,214,103,255,193, 67, 76, 62, 38,140,154,236,222,222,230,100,103,151,199,158, 56, 71,111, 56, -230,230, 27,183,200, 38, 3,194, 90,141,209, 32,231,228,240,152,243, 27, 45, 22,207,173,243,240,222, 46, 38,203,105, 47, 45,178, -183,127,204,221,187,183, 57,220,187,205,179,223,246, 4,183,183, 79,104,132, 17, 42, 86, 28,236,238,211,235, 30,177, 82,247,249, -204,143,252, 0, 59,251, 67, 30,110,239,209,106, 71,108,223, 63,194,146, 34, 66, 67, 78, 74,107, 41, 34,168, 7, 51, 2, 86,111, - 16,115,210,239, 51,152,164,148,185,117, 73, 67,169, 33, 43, 53,141, 70,224, 62, 16,198,146,151,150,243,157, 14,135,167, 93, 16, -146,253,222,128,220, 20,148,214, 50,137, 83,172,205, 57, 56, 77,232,212, 35,186,147, 17,223,249,190, 27,252,220,223,250,121,134, -241, 8,165,221,207, 25, 3, 82,121, 72,165,145, 90, 59, 92,123, 16,129, 23, 86,135,244,244, 84, 52,103,180,169,254, 35, 23,186, -165, 4, 99,200, 7, 39, 12,142,142, 24,245,251, 88,235,148, 37, 69, 90,144,103, 57, 22, 75, 43,144,116, 54,215,161,177,228,192, - 38, 83, 11, 19, 22,122,167,148,113, 74,185,127,128, 18, 2,155,103,156,140, 51, 68, 45,224,176, 52,172,126,199, 15, 97,146, 81, - 53,146, 59,179,202, 23, 56,244,171, 23, 32, 84,224,118,237,202, 67,106, 15,132,118, 99, 58,227, 72,105,233,240,128,159,248,240, - 53, 94,125,243, 33,227, 96,131,102, 61,156, 61,212,246,201, 41,248, 62,104,133,244, 61,119,233, 88, 67, 17,143,161,215,197, 0, -126,189, 67, 89,166,148, 69,134,242, 61,190,254,127,255, 45, 30,255,254,159,231,205,175,223,229,239,253,157, 95,230, 63,252,235, -223,228,240,225,132,207,255,238, 23,121,239,159,120,255,236,177,131, 63,245,189, 52,147,234,242, 59,131,156, 20,149, 16, 72,158, -233,102,166,163, 59, 83,216,217, 24,210,150,243,217,123, 89,184,139,215,148,213,101,126,166, 91,177, 8,202,194, 9, 2,221,158, -114, 10,161,153, 50,215,231, 88,117, 83, 86,151,237,153,112, 55,201,124,252, 89, 38,125, 23,138, 82,233,126, 85,224,160, 60, 83, -131,131,210,129,187, 8, 13,179,128, 23,119, 96, 75, 84,208, 68,183, 86, 64,202,202, 23, 62,247,143, 99, 28, 34,214,150,102,230, -134,156,174, 24, 76, 50,193, 20,238,242,118,145,204,210, 29,222,165,117,251, 94, 30,153,198, 86,135,191, 75,211,154,142,120,197, -180,101, 51,213,142,220, 50,255,181, 57, 75, 38, 18,243,237,133, 45,220,202, 1,121,198,139,207, 28,134, 34, 85,165,161, 43, 17, - 94,132,240,220,133, 41,180, 43,252,132,114,239, 57, 83, 58,141,129, 83,137,107,202,120, 76, 54, 26, 97,173, 68,228, 19, 76,154, -145, 77, 38,148,133,197, 20,105,101,183, 20, 40,191, 62,211, 1, 80, 58,123,159,181, 37,148, 25,214,148,152,220, 56,173, 0, 78, - 4, 40, 40, 33, 29,224,249, 10, 37,133, 99,145, 91,139,244,156, 50, 92, 5, 30, 74, 41,164,113, 4, 51,165, 21, 74,251, 40,207, -125,198, 29, 53,207, 67,122,202, 77,112,108,230,214, 3,202, 71,133, 53,132,112,206, 23,165,157,255, 92,215,106,168, 90, 13, 85, -115,118, 54,132, 34,235,159,112,244,234, 11,120,229,132,230,133, 77,148, 53,216,122,131,209, 27, 15,152,220,127,203, 13,132,242, -114,246,249, 19,118,154,123,239, 86, 52,114,106,101, 44, 93,102,136, 53,165,155, 36, 80,197,173,150, 78, 20,234,206,253,233,216, -190,116, 29,125, 21,225, 42,166,209,197, 85, 17, 96,171,115,113, 38, 1, 49, 6,129,197, 87, 2,105, 45,170, 82,186, 43, 33, 81, - 83, 87, 70,233, 50, 6,166, 26, 13, 97, 44, 90, 64, 36, 21,117,173, 9, 42, 50, 93,164, 5, 53, 41,104,123,146, 5, 45,105, 40, -129,175, 60, 60,191, 70, 89,164,149,112,212, 48,253,112, 90,220,243, 52,147, 17,235,107, 33,231, 46, 94, 36, 29, 37, 68,205,203, - 92,255,248,191,224,225,243, 32, 85,193,234, 85,193,210, 26,200,216, 21,223,158, 22, 68,107,150,122,203,178, 33,182, 97,244,101, -210,216,227,100,116,132, 45, 11,164,244, 8,131, 37,180, 16,148, 20, 72,169, 89,111, 95,116,239, 71, 21, 18,248, 62, 43, 81, 7, -173, 3, 58,205, 69,218,225, 18,175,189,241, 26, 15,239, 28, 48, 30,116,105, 93, 94,160, 30, 88,238,189,116,196,224,180, 73,191, -223, 67,142, 78, 79,201,211,156,193,238, 93,206, 63,241, 14, 54,159,121, 22, 89, 91, 32,238,119,121,199,251,191,157,201,233,125, -162, 78,147,245,199,222,137,246,235, 72,165,209,126, 72,145,150, 20,121,194,248,164,143, 31,120, 32, 33, 90, 90,197, 91, 58,207, -131,151, 94, 2,147,185, 16, 0, 63, 98,184,191,227, 70,219,184,136,207,108, 56,100,120,180,135, 80, 26,169,125,176,146,254,238, - 3,158,250,201, 63,195,201,157,219, 92,120,239,251,120,251,203, 95,226,238, 43,175,243,228,251,158,100,243, 93, 79,241,224,205, -155,244,142,118, 93,164,232,233,152,163,135, 15,217,187,253, 54,146, 2,223,247, 8,194,144,162, 16,156,118,123,140,198, 19, 54, - 46,175, 49, 24, 38, 28,108, 31, 80,230, 49,157,213, 14,131,209,132,227,227,125, 54, 87,155,172,159, 63,207,105,119, 72,183,219, - 67,251,146, 7, 91, 15,216,223,223,229,237, 91, 91, 44, 45,250, 28, 28, 29, 18, 15, 39,156,191,222,162,151, 55,248,214, 55,223, -226,226,230, 18, 65,167,197,151,158,251, 38, 39,199,123, 8, 27, 83,148,240,214,157, 3, 30,220,217,226,181, 23, 94,225,230,107, -111,242,202,139,175,113,239,214, 45,146,108,196,120,226,178,119, 61, 37, 49,101,129, 16, 25, 69, 57,198,215,128, 52, 52, 35,143, - 97,146,176,223,139, 89,106, 42,222,218,237,114,101, 99,153, 52, 31,163,181,166, 63, 25, 59, 88,130, 84, 44, 54, 61,238,239,239, -178,125, 50,230,131,143, 95,228,239,252,226, 63,224,180,127,234,192, 17,148, 46,187, 94,123, 72, 41,221,193,100,140,139, 84,245, -107, 21,241,235,172,201, 68,254,177,255,159,142,214, 12,144,130,133,164,223,115,235,143, 60, 67,106,237,208,133,113,140, 64, 50, -202, 44, 63,244,195,159,160,204, 75,240,235,238,107, 28, 15, 9,202, 24,142,143, 41,129,226,222,109,212, 66,157,193,206, 17,251, - 89, 78, 60, 74,248,224,207,254,168,203, 38, 62, 19,160, 50,237,190,165,144,179, 96, 21,161,106,243,220,112,165,170, 67,162,196, - 88,247,225, 30,157,246,249,238, 31,253, 24,175,188,244, 28,186,118,145,191,247,247,255, 30,190,118, 95,123,237,198,187, 24, 21, -214,209,171,148,116,235,126, 41,145, 90,144,239,108, 33,161,234,204, 28,143,186,251,240, 14, 79,127,234,227, 60,255,235,255, 11, -255,246,247, 95,229,213, 91, 71,252,234,191,253, 42, 95,124,254,109,126,246, 51,239,161,181,178,228,158,103, 89,162, 31,123, 12, - 37,170, 66,131,185, 63,219,206,254,157,185,231,218,158, 77,106,179,115, 84,172,120,116, 31, 62,235,142,197,217, 78,232, 76,247, - 94,133,186,216,169,226,216, 90,231,100, 56,155,129, 42,170, 67,205,216, 71,126,166,204,227, 91,220,104, 60,234, 16, 44, 63,134, -172, 45, 86,187,123, 40,139,152,178, 24,131,156,238,189,153,121,206,139,241, 33,217,201,125, 23,175, 91,150,213,110,188,234,172, -149, 87, 37,253,217, 89,232,138, 19,246, 25,164,112, 90, 2, 49,125, 30,214, 84,200,223,106,242, 32,253,185, 24,111, 10, 40,145, - 85,218, 92,117, 96,219, 10,179, 38,228,244,159, 41, 11,190,234,206, 77, 37,202,156,190, 6,101, 73,113,122,136, 73, 97,198,210, - 53,166,210,109, 76,187,245,194,177, 15,180,155, 10,161, 20,194, 11, 17,211,240, 17, 41, 41,211,216,141,216,189, 0,171, 52,101, -154, 80, 36, 25,249,104, 72, 54, 74,176,105, 73, 58, 30, 99,226, 12,210, 20,144,148,121, 1, 57,148,147, 33, 54, 47, 16, 86, 57, -150,183, 45,192, 20, 46, 49,112,120, 68,214, 63,162, 52,105, 69, 93,171, 80,193, 89, 82, 81, 30, 37,168,105,150,183, 69, 6, 62, - 74, 73,215,169,123, 94, 53,242,150,200,208,119,159,111, 91,186, 81,177,201,145, 72,100, 16,162,148,135, 14,130,202, 26,106, 80, -126,228,162, 98,181,231,192, 50, 65, 13,229,135,120,245,246,236,253,118,242,214,235,152,222, 30,139, 23, 22, 81,190,135,149,146, -193,173, 83, 78,191,250,219,148,113, 86,193,101,196, 89,243, 68, 37, 12,156,221,123,179, 59,112,206,127, 63, 3,245,175, 58,245, -153, 79,220, 86, 66,209,242,204,251, 29, 42, 77, 74,245,125,166, 19,169,234,247,148,116, 30,116,183,235,150, 21, 70, 89, 56, 42, -164, 49, 8, 97, 43,250, 98, 89,233, 9, 4, 82, 90,148,148,180,151, 46,176,180,184, 65, 77, 86, 1, 48, 72,218, 90,178, 32, 37, - 77, 37,241,149,162,181,246, 24,205,245, 27,136, 10,195, 76, 57, 95, 83,201,105,238,130, 41,184,241, 67,223, 65, 24,106, 86, 47, -173, 96,226, 18,191,248,207,188,231,113,205,250, 69,193,249, 15,182,136, 22,157,160,111,150, 80,156, 89, 58,215, 74,108,164,248, -169,206,151,216,203, 20,185, 21,148,129, 33, 10,107, 24, 3,107,245,243,180,194, 21, 10, 50,186,227, 46, 74,212,200,243,156, 66, - 23,108,108, 92,224,252,133, 85,154, 77, 31, 21, 6,108, 54, 58,164, 22, 50,147,176,245,205, 29,118,183,183,104,132, 17,107, 23, - 42, 60,241,207,253,196,247,255, 66,220,139,105, 47, 55, 80,126,141,230,230, 69,190,246,107,159,229,169,239,252, 40,175,125,241, - 75,188,247, 99,207, 16,158,123, 55, 90,195,214, 43,175, 85,192,249,140,131,155,119, 89,127,231,227, 12,247,247,169,181, 90, 20, -233,144,124, 18,187,142, 36,233, 19, 45, 46, 16, 54, 22, 49, 69,129, 23,248, 72, 41, 24, 29,239,226,215, 34,226, 65,159,230,202, - 50,166, 44,185,247,226, 11,180, 22, 23, 8,106, 17,111,124,225,247, 88,186,116,158,221, 55,223,192, 22, 41,231,175, 95, 97,249, -250,227,220,122,238, 27, 4, 94,192,242,230, 26, 89,146, 49,232,141,200,178,132,230,194, 34,101, 54,160,189,188,206, 96, 48,100, - 50, 24, 96,109,140,239, 9,178, 60, 99, 60, 28,226,133, 30,218,243, 56,222, 63, 98, 50,234,115,249,202, 5, 22,206,109, 48, 28, -198,116, 79, 6,100,113,193,238,206, 67, 60, 41, 25, 76, 6,108, 46,181,104, 55, 58, 12, 38, 41,199, 39, 9,233,120,159, 78,167, -205,249,149, 85,114, 36, 59, 15, 15, 25,246, 79,241,149,161,209, 92, 96, 56,201,105,215, 61, 54,207,157,103,105,101, 25,223,143, -104,182, 23,176,192,112, 28,147,102, 57, 39,195,132,211, 81,140, 16,150, 73,106,208, 66,178,115,116,202, 97,175, 79,111, 52,166, - 55, 46, 8,125,205,106,167,201,131,147, 99,178, 76,177,185,210, 98,231,120, 68,179, 38, 56, 29,166, 36,121, 65, 51,170,113,121, -181, 77,119, 20,243,111,254,205,175,208,237, 30,227, 55, 90, 78, 21, 45, 36,210,243,171,202, 93,185,177,159,175,209, 65, 29, 2, - 61,111,233,230, 33,222,103, 46,117,111,222,169,139, 24,202, 18,147, 77, 24,239, 62, 36, 27, 77,208,126, 64,150, 21,140,187,125, -242, 44,163,212, 33, 63,240, 35,223,133,182, 37, 94,163, 9,171,143, 65, 49,172, 44,113, 62,100, 99,204,131,251,228,113, 70,249, -249,223,197,175,135,220,189,181,205,113, 90,176,123,208,231, 71,254,211,231,176,121,143,179,128, 52,119, 34,184, 29,174,242,124, - 80, 81,181,239, 53, 80,102, 96, 5,121, 60,166,200,139,170,122,119,193, 32,231, 46, 93,226,255,252,165,127, 68, 41, 27, 92,190, -124,158, 31,255,248,199,248,239,254,242,159,231,155,111,220,103,225,244,132,115,107, 77,172,212,238,125, 89,105, 63,202, 56, 33, -184,250, 4, 0,195,195,135,149, 32,172,196,148, 57, 87,159,125, 63, 63,245,167,191,159, 31,250,216, 19,124,226,253, 79,240, 35, - 63,241, 81,174, 62,243,212,236,178,198, 90,240, 60,228,115, 47,178,127,244, 38,229,120, 80,213, 29, 98, 6,102, 49, 22,215, 49, - 61,202,154,155, 57, 7,173, 16,143,236, 33,207,210, 86, 4,103,144,169, 21,185,109,122,193,157,149, 64, 60, 10,126, 97,238,229, -159, 5,202,156,249,154,202, 7, 63, 45, 64,132,210,144,141, 41,227,211, 89,119, 60,141,134,157, 62,190,169, 14,204,210,156, 25, -233,159, 37,217, 76,159,138,196,117,161, 98,214, 48, 59, 39, 64, 21,183, 58,205,220,150,106, 74, 29,171, 38, 27, 58, 66,213, 90, - 20, 89, 90, 81,238,206,216,223,236,163,210, 9,161,107, 8,191,137, 41,146,234,219,139, 51,113,178,184, 44,247, 51,170,126, 25, - 4,180, 63,240,131,200, 64,131,205,207, 76,166, 20,152,100,254,107, 83, 49,255, 77,230, 46,221,120, 88, 37,193, 25,103, 21,204, - 75, 76,158,145, 15,251,228,147, 9,101,146, 58, 61, 68, 37,210, 43,115,151,203,173,181,194,148,149,228, 75,234,170,160, 18, 78, -164,106, 12,182, 18,151,229, 89, 94, 77, 70,242, 89, 17, 34,181,194, 15,235,206, 50,232,251, 8, 33,208,202,175,116, 74, 18, 47, -136, 80,126,205,217,127,165, 68,105,175,162,227,185,224, 43,237,121, 46, 80, 44,112,105,107,202,243, 93,247,170, 52, 82, 41, 84, -232, 68,129, 82,107,164,212,232, 32,116,191, 14,107, 72,229, 83,196, 99,132, 16, 28,124,241, 63,177,126,121,153,246,213, 43, 96, - 10,116,115,153,135,191,254, 89, 70,183, 95,113,194,212,194,204,223,159, 83,173,198, 84, 9, 63, 47, 45, 43, 59,167, 56,115,220, - 8, 39, 58,179,115,206,192,108,216, 98,206, 56, 23,170, 98,151,234,194, 22,178, 90,237, 76, 33, 67, 21, 37,113, 6, 28,170,254, -151,231,174, 0,180, 66, 84,107, 37, 59, 43, 4, 76,233,138,122, 83, 26, 10, 96, 52, 30, 49,201, 83, 74, 11,145, 20,116, 60, 77, - 91, 75, 58, 90, 17, 41,137,167, 52,118,220,167,204,198,160, 61,164,174,187,247,198,244, 57,217,146,115, 63,248, 95,113,188,227, -177,112,126,145,172, 27,179,250,108,130,250,131,207,178,254,129, 5, 26,151,107,228, 61,131, 31, 4, 76, 30,164,120, 13,129,201, - 36,202,119,140, 10,191,237,166,179, 79,202,151,185,169, 62,205,242,226,128, 56,206, 48,185,162,222,177,140,147,140, 65, 50,224, -218,242,117,148,148, 28,199, 39,104,219,160,200, 4,147, 73, 12,170, 96, 56, 73,184,116,249, 60,199,199, 99, 60,105, 80, 42, 98, -146,156, 82, 11, 23,169,181, 26,164,189, 9,178,181,216, 96, 97,115,133,246,230, 37, 22,175, 61,193,233,131,135, 60,249,241,143, -146, 38,150,199,222,251, 20,173, 11, 31,230,185,255,235, 87, 24, 28, 29,176,126,237, 18,163,211, 17, 89,239,136,181,235, 55,152, -116,247,168, 45, 45, 81, 22,150, 90,107, 5, 29,106, 78,183,110,179,116,229, 42, 97, 99,145,116,124,138,181,134,162,200,145, 94, -141,160,214, 0,173,209,202, 33, 69, 81,146,209,193, 54, 82,123,188,250,251, 95, 96,251,245,175, 83, 95, 88,164,127,124, 76,103, -227, 60, 69,150,178,253,250,235, 78,220,210,136, 56,218,221, 39,203,114, 78,118, 14,161,136, 29, 10,208, 90,122,221, 46,241, 96, -194,237, 55, 94, 99,239,206, 77,250, 39,219,152,210,208,239,245,201,226, 9,251, 15,183,201,211, 24,223,143, 72,242, 33,131,225, -144,211,211, 49, 69, 94, 50, 26, 15,240, 60,205,113,127,200,100,156,177,188,218,102,247,120, 72,239,120, 72,146,118, 49, 86, 51, - 28, 29, 83, 91,108,240,214,237, 29,132, 76,105, 55,235,248, 65,147,131,147, 1,221,211, 46,168, 49,189,248,148,251, 15,119,184, -253,224, 33,111,222,126,147, 36,233,145,231, 57, 39,195,152,227,193,144,193, 36, 33,203,115,164, 76,184,127,116,130,212, 1,151, -215,207, 81, 15,106, 32, 33,240, 5,111,108, 29,243,228,249,117,122,241,152,222,104,200,201,104, 72,228,251, 85, 96, 68,206,113, - 63,225,245, 7,135,252,231, 95,255,101,142,186,135,248,205,166, 27, 49, 73,129,244,220,248,205, 17,155, 36,194, 83,104, 63,132, - 90,240,232,229,113,166,247,155, 94,234,243, 0,141, 24, 76,129, 45, 74,204,100,128,174, 69, 68,205, 58, 97,189, 78, 16, 4, 88, -156,114,248,234, 19,239, 96,105,165,131, 65, 58, 95, 58,198, 29,142,211, 50,125,220,199, 12,199,152, 60, 67,164, 25,217, 32,102, -127,152, 96,148, 70, 47,212,240,151,207,185, 14,172,156,239,219,168, 14,194,105, 87, 37,102, 19, 4, 85, 5,197,100, 21,171,189, -122,126,101,137, 84,138,222,209, 9,159,251,205,127,198,231,127,227,151,185,243,246,152,111,220,201,216,186,117,202, 43,175,237, -243,123,111, 62,196,247,148, 19,159, 85,182, 61,129,165, 24,143,176,201, 24,128,168,221,161,204, 38,148, 69, 70, 60,232, 51, 60, -220,174, 64, 72, 55,184,252,190,247,160,107, 17, 38,207,102, 86,156,169, 40,212, 6,154,149,239,252, 76, 5,104,145,179,187,168, -180,206,159,108,170,110,220, 84,170, 94, 91, 81,219,138,105, 60,173,177,148,213,138,120,122, 89, 26, 4, 69,233,168, 87, 69,105, - 42, 33, 21,238,207, 78,143, 78, 49, 15,106, 41,193, 29, 90, 83, 49,153,113,193, 47,102,166, 43,158,198,225, 86, 7,106,133,103, - 45,211, 33,233,248, 16, 83, 45,178,173,156,107,214,103,125,189,156, 3,108,236, 25, 74,222, 25,183,163,155, 20,216, 98, 30,143, -202, 25,146,158,177,143,164,185,153,114,102,222,171,158,108, 65, 49,233,129,205,171,141,144, 2,229, 87, 7,248,153,100, 59, 9, - 82, 71, 72, 47,154, 7,131, 84,147,130,105, 23,111, 77,181,175,157,238,228,211, 9,148,105, 5, 0, 58, 75,252, 49,143,234, 8, -164,196,154,172,122, 86,210,173, 7,170, 2, 70,215,154,136,208,173,198,100,208, 66,122, 62,218,247, 9,130, 8, 41, 61,132,242, -240,234, 77,188, 48,194,106, 15, 25,212,240,194, 58, 74, 72,132,242, 80, 94, 8, 40, 74,227, 58,120, 83,150,179,207, 25, 82, 66, - 89,160,132,197,175, 71,174,187,242,125,164,210, 40,175,230,132,108,202, 9,195,100, 16,162,131,208,253, 60,202, 2,169, 61, 20, -162, 2, 51, 89,144,218,185, 59,166,235, 12, 83,186,243, 64, 42,164,246,209,129,143,242,125,148, 31, 84,103,132,135,208, 62, 66, -249, 72,165, 40,147, 9,195,157, 7,116, 86, 27,180, 46, 94,160, 76,135,232, 86,135,201, 16, 38, 59,183,177,101, 94, 77, 47,166, -175,225,124, 26,244, 8, 73,105,166,115, 17, 51, 77,136,177,204,246,232,143,134, 29,205,127, 57, 61, 50,140,177,243,199,159, 10, - 17,171,120, 94, 41, 57, 83, 84, 87,143, 91, 26,135, 45,158,110,100,170,169,199, 20, 74, 53, 77, 32,156,217,209,226, 49, 94, 25, -211,246,148,131,252,104, 69,167,218,167,135, 74,224, 97, 49, 19,167,255,144, 10,252,112,137,218,242, 53,164,174,185,201, 81, 53, -113, 58,247,241,191, 68,247,254, 9,201,192,210, 88,252, 8,151, 63,249, 11,180,195,182, 43,236, 82,129,215,241,176,189, 24,191, -229, 10, 90, 45, 65,120, 22,213,112,217, 88,141,205,146,118, 52,161,158,127,133,102,115,145,123, 7, 59, 20,118, 76,154, 27,180, - 9,200, 76, 65, 81, 72, 10,155, 19,232, 6,237, 70, 64,115, 65, 83,230,138,100, 0,101,110,216,217, 61,230,220, 66,128,239,215, -176, 36, 88, 91, 32, 67,159,120, 60,225,112,239,109,116,125,249, 2,195,253,125,252,198, 18,249,120,140, 45, 10,103,189, 74, 39, - 20, 70,241,194,231,126,131,149,245, 53,186,187, 59,152,245, 13,234,245,136, 98, 60, 65, 4,146,225, 97,151, 90,179, 73, 99,109, -157,201,104,200,164, 59, 96,233,226, 5,164, 10,217,126,229,121, 54,222,245,148,211, 76, 29,109,147,215, 59,180, 86, 55,201, 77, - 78,184,176, 76,220,239, 67,232,115,254,241,199, 57,188,245, 22,215,191,237, 3,156,191, 24,113,112,119,139,181,203,231,233,238, - 60, 36,140,106,244,143,186, 24, 91, 50, 58,156,208, 92,168, 99,140, 34,140,106, 4,141, 54,199,123,123,152,162, 79,152, 27,142, - 30,118, 1, 67,103,113,141,135,119, 31, 34, 57, 69, 9,205,176,127, 66,163,222, 96, 56, 73,185,127,111,139, 39,116, 7, 63,108, - 81, 22, 41,241, 36, 1,145,146,149, 48,142, 83,164, 44, 72,108,193, 56,201, 25, 13, 19,142, 78,122, 92, 92, 95,231,206,253, 1, -245,230, 30,218, 26,138, 60, 99, 97,105,209, 37,249, 76, 50, 90,117, 77,145,193,209,209, 41, 71,253, 30,203,109,143,141,213, 5, -250,227,146, 52,117, 59,176,139, 43, 45,198,105, 65,119,148, 32,164, 79,205,179, 60, 60,238, 50,152,132,156,235, 4,152,177,161, -230,107,114, 51,228,104,152,178,177,228,179,223, 75,185,126,110, 25,223, 11, 80,114,192,165,181, 21,126,235, 91, 55,249,226,175, -254,207, 12, 7,167,120,141, 14,194, 42,164, 31, 33,131,192,249, 68,139,178,250,208,148,110, 71,234,135,103, 46,112,121,166, 67, -159, 3, 60,132,240,170,174,200,141,207,203, 65, 15,213,104, 96,138,156,160,217,162,136, 19,204, 73,143, 44, 77, 41,133,100, 97, -229, 34,223,246,201, 15,144,220,121, 11, 17, 4,176,176, 10,196,204,149, 78, 6,226, 24,147,102,152, 52, 65,154,146,222, 65,151, -211,188, 32, 87,138,133,197,229,217,233, 63,179,177, 76, 43,114, 28, 3,154, 34,193,202,176,130,173,184,253,126, 58,232, 98,138, - 12,155,231, 24, 36,210, 72,172, 41,241,163, 54, 69, 30,243,197, 47,252, 26,159,249,244,127,205,246,164,206,173, 39, 63,196,107, -111,223,228,103,255,226, 7, 72, 78, 78, 97,101,205,217,100,170,139, 66,136, 18,115,176,135,184,116,157,214,198, 53,186,247,111, -186, 92, 2,161,200, 77, 7,173,189,233,189, 69, 57, 60,165, 28, 12, 80, 89, 9,187,135,152,147, 35,204,209, 9,114,119,151,203, - 31,253, 32,197,245,111,112,176,243, 26, 54, 25,186, 12,102, 49,183,178,185, 75,130,153,221,108, 38,103, 96,122,224,184, 87,203, - 24,167, 2,158, 70, 82, 10, 43,102,123,122,206,106, 26,229, 25, 76,156,181,213,184,211,130, 22,179, 3,241,172,254, 81,136,121, - 49,103,140,169,148,248, 98,198,167, 55, 85, 90,220,180,197,158, 90,196,230,174, 52, 15, 33,138,249,174,218, 80,105,221,197,204, - 78, 55, 99, 5,153,106, 44,170,166, 20, 60, 89, 17,235, 92,145, 57,237,212,197,116, 74, 97,114,103, 65, 19, 2,164,166,118,254, - 89,116,125,129,241,157,175, 64, 57,158, 99, 96,173,168,132,118, 2,165,230,225, 57,238, 15,200, 89,218,151,172, 48,183, 6,200, - 78,246, 41,198,125,116,187, 89, 85, 5,211,106,203,141,201, 41,178,170, 48, 40, 16,214, 21, 62,174,224,113,157,189,244,163,170, - 43, 52,168, 90, 11,226, 9,202, 15, 17,194,171, 82,186, 10, 40, 10, 20, 26,148, 68, 76, 38,149, 7, 31,164, 95, 67,151, 5, 70, -104,242, 81, 31, 76,233, 52, 45,182, 64,123, 53, 84,160,137, 15, 15, 80, 81,132,210, 10, 45, 20, 74, 75,247,119, 17,211, 2,219, - 67,120,145,222,125,159, 9, 0, 0, 32, 0, 73, 68, 65, 84,227, 52, 40,207, 5, 1, 97, 42, 77,137,219,197, 43, 63,152,129, 93, -148, 31,206,114, 18,164,175,177,133, 68,120, 26,165,124,132,244, 93, 84,177,116,151,190, 10, 35,132, 12,176,165,161,180,134,184, -219,165,255,246, 75,188,243, 19, 31,195,107, 53, 40,147, 9, 34, 92,160,247,149, 47, 82,156,236,187,215,144,121, 42,224,148, 2, - 39,148,172, 68,109,103, 46,235, 41,252,168, 42,106,197, 12, 34, 84,189,111,102, 81,190,213, 62, 94,201, 10,159, 60,125, 91, 59, -237,137, 67,106, 84,222,242,210,204,164, 16, 83,251,156, 96,110,122,112,155, 27, 51, 39, 38,154,194, 77, 83,166,106,123,107,144, - 22, 52, 37,117, 33,105, 89, 75,233,107, 66, 37,104, 9, 65, 4,132, 21, 97, 83,148,153, 43, 10, 12,152, 50, 35,235,237, 80, 22, -177, 3, 28, 89,193,202,167,126,130,221,175,221, 33,137,123,120,222, 34,106,237, 4,113,107, 7,239, 74,131, 98, 98,176,190,198, -116, 45, 54,115, 92, 8, 1, 8, 31, 60, 35,200,115,139,167, 5, 54, 0,213,241,248,232,224,183,121,110,248, 93, 28,166,123, 92, -238, 60,198, 78,119, 7,159,144,122, 80,103,152, 13, 41, 69, 70,123,161,134,240, 74, 10, 12,190,134,113, 92, 18, 5, 77, 76,110, - 41,253, 4,169,234,244, 71,125, 90,245, 26,194,194,189,219, 47,112,225,202,187,209, 73,239,128,165,171, 87, 72, 70, 67,246,111, -223,161,136, 99,151,119, 17, 68, 36,189, 46,231, 54,206,177,251,224, 54,173,133, 6, 34,175, 59,108, 94,227, 34,227,238, 14,235, -239,122,150,209,225, 14,119,158,255, 34,235, 55, 30, 39,108, 53,168,111, 92,229,224,229, 23,216,124,234, 89, 76,150, 80,152,132, -198,230, 99,100,189, 67, 70, 39,123,248,245, 38, 40, 73,119,231, 33, 69, 58, 98,245,242, 21,150,175, 95,225,222,215,191,194,181, - 79,252, 48,119,191,252, 28, 43, 23,215,153, 12, 39, 20,185, 96, 50, 25,162, 80,100, 89, 66, 28,131,144,117,250,221, 83,242,131, - 30,253,211, 33,151,111,156, 35, 25,149,196,227, 49, 23,175, 92,160,127,210,101,253,252, 58,147,100, 66, 94, 38, 96, 45, 74, 75, -246,143, 78,176,197,132, 60,109,177,247,224, 33,165,209,156,246,251, 68,161,143, 18,146,238, 40, 99,185, 85,144, 76, 18,151,221, -173, 45, 11,173, 38,163, 84,176,180,188, 68,146, 40,106,141, 8, 37,235, 12, 70, 46, 69,231,225,193, 1, 23, 55, 22,232, 15, 83, -130, 80,209, 41,107, 72,173, 56,233, 23,156, 14, 39, 12,227,132,178,204,104,212,124,178,178, 36, 45, 37,113, 42,104,213,107,120, -122, 76,111,156,209,136, 20,105, 81, 80,148,130,165,118,147, 55,238,238,114,253, 92, 68,127,104, 8, 60, 9, 70,179,178, 84,103, -235,116,194,175,254, 15, 63,199,181,239,249,113,108, 20,161,164,130,244, 16,122,125, 24,143,160,151,186,139, 53, 90,128, 75,215, - 65,228, 85,138,144,225,145, 83,121, 70, 46, 19,179,177,187,181, 14, 6, 68, 90, 41,122,105,185,241,177,242, 65,107,146, 52,101, - 48, 24,177,184,126,129,115,171, 23, 81, 20, 20,149, 58,203, 54,218,136, 60,169, 30, 87, 67, 81,192,160,135,201,115,202,209, 24, - 81, 20, 78, 20,164, 20,133, 49,252,192, 63,251,251,148, 19, 7,177, 48, 51, 53,180,156, 69,106, 90,105, 41,178, 24,237,215,156, - 33, 44,207, 40,147,161, 19, 36,149,165, 75, 83,178, 10, 51,141, 4,181,160,148, 79,102, 12,191,245,165,207,177,251,234,107, 28, - 60,216,229,198,179,127,138,198,133, 43,156,254,211,191, 75,176,184, 92,141, 94, 93, 39, 33, 61, 77,190,243,144,240,210,117,132, - 31, 34, 27,117,100, 1,227, 23,191,193,254,183,126,133,131, 47,124,145,252,164, 79, 62,152, 80, 88,195,106,216,164,211,106, 17, - 54, 23,232, 44, 45, 34, 60,143, 36,153,176,186,123,204,227, 31,250,147,220,168,255, 25, 94,248,220,255, 74,127,247,214, 60, 51, -125,202, 67,159,225,206,221, 33,163,245, 60,177,202, 24,135, 91,145,103, 4,140, 98,182,143, 7, 83, 89,218,148, 39,102, 35, 93, -236, 92,133, 44,254,152, 23,120,150,254, 86,117,203,166,202, 87,159,122,129, 93,163,122,102,164, 41,166, 8,215,234,170,158,125, - 49,232,218, 50, 94,235, 60,249,233, 61,138,180, 63, 39,204, 85, 3,212,105,128, 10, 82, 84,130,121,119,144,138,170,235,146,213, -216, 93, 76, 17, 59,118, 30, 29,235,158, 71, 89, 21, 88, 2, 97, 12,164, 67, 10, 83,128,205,102, 7,249, 52, 8,198,101,170,187, - 75,193, 9,203,166, 99,222,121,203,103,101,229,105, 22,130,194, 66,118,120,139,112,227,124,245, 30, 79,171, 49,170,116,122,143, - 51,133,149,149, 10, 33, 66,108, 22,187,176, 29, 63, 68,232, 26,178, 72, 81, 81, 27,170, 68, 71, 91,100, 72,223, 93,188, 38, 77, -209,174,194,192,228, 57,214, 15, 17,227,145,155,202,196, 99,172, 9,176,201, 24,169, 61, 74,155, 80,243, 61, 74, 35,241,106, 1, -182,200,241,234,117,188,168, 1,121,138,174,213,145,210,175,152, 77,174,211,148, 97,221,189, 39, 80,136, 50,115, 83, 12, 23,169, - 86,197,125,106,140,117,246, 73,199,118,112, 83, 10, 29,132,110,114, 33,132,203,235,144, 10,161, 20,202,247, 29,239,189,178,176, -217,210,184, 85,214,160,135, 41, 50, 58,109, 15,127,105,133, 50, 27,162,106, 77, 70,123, 19, 6,175, 60,135, 41, 11, 55, 81,157, -199,236, 85,162,119, 59,131, 39,157,213,107, 76,167,109,103,187,234,105,128,212,180, 64,179, 21, 93,208, 37, 67,150,110, 21,117, - 38, 99, 96,234,118,112,200,217,114,110,187,156,193,157,204,108, 63, 36,230,190, 55,151, 12,119, 70,196,103,167,159,133, 18,148, -176, 40, 1,129, 20,116,124,129, 44, 20,190,128,150, 86,248,149,220,198, 83,103,147, 3, 13, 69,124,236,186,124,139,227,100,148, - 5, 27,159,250, 27,188,246, 31,254,144,168,189,134, 8, 59,180, 46,253, 22,188, 92,184,105, 79, 46,177, 99,131,236, 14, 49,227, - 2, 59, 17,168, 69, 73,218,119, 25,238,218, 23, 20, 6, 68, 41, 40,253,146,149, 85, 72,239,126, 22,169, 55, 25, 23, 41, 30,138, -126,218, 67, 74, 69,230,101,110,147,169,224,100, 18,211, 12, 36, 73,238,206, 80, 99, 50,162,176,197, 81, 55, 65,216, 46,185,201, -232,246, 51,210, 98,151,115,139, 79, 48, 56, 62, 68,119,206, 95,163, 40, 75,250,123,123, 80,102, 52,150,150,232,237,237, 34,114, - 67,125,161, 77,173,209,228,198,234, 42, 94,212,224,230,151,127,151, 75, 79,159, 35,137, 71, 52, 87, 54,185,253,194,243, 8,202, -255,143,175, 55, 15,182, 45,203,235, 58, 63,107,173,189,247,153,207,157,223,156,249, 94,190,247,114,172,202,154, 11,173,162,168, - 98, 40, 64,170, 40,198,102,114, 64,233,208,198,182, 91,109, 20, 67,180,181,187,137,208,144,104, 21, 27, 9, 67,237, 70,176, 1, - 81,161,105,170, 81, 40,192, 34,145,130, 42,107, 34,179,200,204,202,204,247,242,229,155,239,124,239,185,103,222,211, 26,250,143, -181,246, 62,231,166,134, 47, 34, 35, 94,228,187,247,140,123,175,223,239,247,253,125, 7, 54, 47, 93, 97,253,226, 21,100,179,195, -240,254, 61,226, 94,151, 50,205,144,194,161,186,109,108,150,209,232,173,145, 14,247,201,173, 32,105,197,140,143,247, 56,255,216, - 21, 84, 20, 49, 59, 57, 6, 52,118, 50,166,152,205,184,253,194, 11,172,109,173,114,243,139,175,163,146, 25,101,158, 33,163,132, - 56,110,145,230, 25,195,225,140, 78, 67,115,246,204, 26, 78, 11,156,130,110,167, 73, 89,106, 26,157, 46,227,241, 36,144,118, 10, - 58,205, 21,182,247, 14,137,148,229,145, 75,231, 16,178,131,179,146,225,100,134,196,145,230,142,210,164, 92,189,176,193,225,193, - 17,175,126,249, 14,105, 89,178,181,182,198, 74,175,197,108, 86,176,186,210,160,191,190, 74,207, 9,238,222,221,166,200, 13,202, -149, 92, 59,115,129,151,110,236, 50, 60, 62,230,210,133,132,205,173, 51, 62, 32,193, 20, 52, 86, 87,185,116, 86,210,136, 20,243, -194,144,229,154,251,123, 3, 14,134,115,180,107,114,113,115,141, 59, 7, 3, 16,109,238, 29, 28,210,116,154,107, 87,207,241,111, -127,245,231,120,199, 7,191, 30, 21, 37,252,151,254,184,249,125,120,112, 11, 70, 99,152,164,216,121,134,214,218,235,173,231,115, -230,163, 41,113,167,205,218,187,222, 71,242,214,167, 64, 5,109,119,229,181, 42,195,169,237, 18,207, 18,245,179,141, 63,184,202, -140,114, 62, 71,246,253,222,186, 44,102, 28,221,187,207,232,248,132, 50,215,156, 93,191,200,245,119, 63,134, 62, 57,174,153,197, - 34,234,131, 61, 89, 18, 74,151,144,121,119, 44, 59,207,144,206, 75,115,140,181,188,177, 55,164,117,245, 42,102, 58,172,163, 84, - 61,108,237, 89, 54,206, 56,140,149,144,249,201,200, 23, 55, 67, 62, 26, 81,140,199, 88,165,160,221, 70, 52,187, 16,183,188,254, -190,209, 34,201,230, 40,231, 40, 70, 25,231, 30,127,154, 11,207, 60,139,201, 11,204,100,234, 39, 23,163,195,242, 87,251,134, 77, - 42,242,227,125, 26,198,123, 40, 60,255,177, 31, 96, 54,152, 51,193, 96,155, 17,237,110,155, 82, 66,178,209, 35,182,130,161, 82, -172,172,118,105,182, 91,168,213, 85, 84,220,162,217, 72, 80, 43,125,220, 96,132,179,154,103, 62,244,167,248,236,191,254, 95, 78, - 29,108, 66, 46,123, 96,123,210,152,117,139, 3,172, 42,164,206,217,154, 53,238,130,221,102,101,157, 90, 29,112,126, 95,233,106, - 77,183, 88,142, 43,173,236, 93,235,131,215,213,222,236,182,182, 79, 93,172,238, 79, 65,159,114, 33,138,112,110,241,220, 81,163, -239, 63, 47, 61,247,133,119,105, 50,170, 14,233,154,159, 39, 69, 45,207,115,117,130,220,146,234, 44,236, 95,109,165,193,167, 94, -198,135,207,201,144, 29,188,178,120, 33, 1,240, 81,145,194,106, 11, 97,202,151, 98,169, 41, 49,212,121,236,214,121, 59,208,202, -231, 32, 82, 2,123,112, 19,196, 55, 6, 18, 93, 8,163,183, 62,169,174, 10,119, 65, 42, 68,228, 29,236,156,247,173, 70,181,218, -126,106, 78,218, 80, 24,112, 99,140,209, 68,221, 53,191, 27,151, 10,215,104,251,231, 45,141, 79, 58, 12, 30,250,121,154,161, 74, -139,158,207,124,200,145,106,208,238,218, 0,153,227,237,169, 29, 52,251, 27, 62,203, 94,249, 6, 19,169,192,104, 95,208,101, 32, -239, 85,106, 1, 21,227,138,204, 59, 44,138,216,107,228,109,137,117, 58, 16,223,124,240,145, 39,146,122, 11, 94, 41, 99, 47, 97, - 21,139,152, 93, 25, 37, 72,229, 73,114,217,201, 17,217,201, 9,227,123, 55, 56,119,237, 18,205,205,107,216,124,134,140, 90,152, -184,199,254,255,243, 47,153,222,124,209,167,146,185, 5,146,230,163, 73, 67,147, 22, 26, 68,196,194,223,223, 5, 35, 37, 31, 47, -188, 36,193,172, 17,167,165,239,191,206, 50, 8,153,236, 98,105,221, 19, 60, 24,150, 67, 98, 8,196, 79, 17, 44,164, 45, 11,251, - 99, 91,153,221,224, 35, 86, 43,162,158,148,146,128,245, 17, 57, 17, 8,154,146, 40,242,175,169, 33, 33, 10,114, 57,225, 92,208, -212,251,166,201, 91, 39, 7,110,140, 19,180, 47, 63, 3,162,164,217,239, 34, 38, 83,116,118,141,118,255,187, 48, 89,215, 51,248, - 51, 7,165,193,102,142, 98,236,112, 29, 73,126,100, 81, 45,144, 69,165,133, 13, 19,252,138, 32,159, 73,190, 97,245, 75,220, 25, -125, 20,237,246,105,198, 45, 12,142, 65,126, 64,170,215,233, 52, 91,232, 18, 98,213,192, 24,111, 55, 25,197,138,121,166,153,206, -167, 88,147,115,113,237, 60,227,124, 66,102, 4,243,244,128,245,245, 51,116, 59, 87,136,172,179, 28,222,127,192,209,206, 14,102, - 62, 67,207,103,172,157, 89,199, 26,199,195, 91,183, 88, 63,115, 6, 99, 36, 14,205,197,199,159,101,176,243,128,222,122,151,193, -238, 1, 82,103,156,123,226,113,186, 91, 23, 56,186,123,143,214,106,143,249,104, 68,118,178, 71,255, 93,239, 11,223,152, 33, 75, - 83, 14,111,191,202,245,247,125,136,227, 59,183, 80, 73,159, 78,167,131,192,145,207,198,168,182, 98,235,242,101,178,217, 20, 99, - 10,148,115,244,206, 93, 96,118,248, 69,158,252,202,183,176,123,235, 14, 82,164, 52, 91,109,102,227, 25,189, 94,204,153,179, 91, - 28, 13,142, 41,180,164, 44, 50, 90,189, 54,233,124, 76,220,236, 80,150, 22,107, 82, 54,214,207,241,252,139,183, 16,110,198,149, - 75,155, 88, 18, 28, 49,105, 58,195,160,105, 40,197,221,251,187,156,221,234,209,223,216,228,109,239,255, 10,222,246,161,175, 97, -235,177, 39,232,172,108,144,180,186,252,215,254,184, 32,225,114,165,102,116,239, 53, 62,249,111,254, 21,159,255,244,103,185,191, -127, 68, 20, 39,204, 75,135,146, 5,253, 78,131,193, 56,197,170, 38,143, 95,218, 98, 48,153, 49,156,150,236, 28, 76, 24,100,134, - 79,252,198, 47,243,236, 7, 62, 76, 28,199, 75, 44,244, 60,144,157, 18, 95,120,167,247, 96,247, 33, 12,167, 48, 75,209,227, 25, -229,124, 70, 49,153,145,229, 57,243,241,140, 34, 47,152,207,114,178,194,177,178, 63,164,255,197, 47,112,225,235,190, 26,217, 85, -139,168, 77,109,160,213,129,222,150,215,235, 58,237, 91,227, 66, 99,116, 73, 57,157,208,194, 82, 24,195,108,111,159,233,104,140, - 46, 11, 26,205, 14,205,181, 45,162,166,194,142, 74,136, 85,240, 41, 21, 1,246, 15, 21,194, 20,216,162,192,105,141,203,115, 76, -166,217, 29,207, 40,130,112,174,209,223,196,148, 35, 47, 85,171, 72, 54,198, 31,200,206, 58,208, 37,102, 62,247, 38,119,189, 62, - 78, 72,116, 36,112,217,156,217,107,175,145, 63,247,251,228, 47,191,193,225,112,202,248,120, 64,164, 28,147,105, 70,233, 28, 9, -144, 89,203,197, 78, 31, 37, 4,162,221,162,181,177,194,123,255,193, 15, 97,243, 18, 89, 10,127,163, 70, 2,147,167,112,176, 11, -231, 31,229,145, 31,248,110,254,227, 79,252, 12,221,110,215,171,245, 13,244, 84,132,179,112,109,101,221,167, 68,105, 77, 62,155, -209,156, 78, 73,206,245, 73,186, 29,172, 80, 20,135,123,196,221,199,232,180, 87, 16, 50,198,153,178, 46,216,110, 57, 84,204, 6, - 35,154, 96, 86, 99,141, 79,124, 90,196,134, 46,254,205, 35,173, 11, 98, 25,136, 90, 63,109,194,244, 93, 27,204, 86,196, 51,150, -163, 76, 43,226, 92,120,174,234, 97,151,136, 73, 66, 8,191, 19,175, 16,147, 96, 98, 83,181, 32,249,232,126,152, 30,117, 45,153, -243,251,224, 0,167, 42,177,228, 0, 23, 16,210,165,148,174,234,185, 22,104,130, 69, 18, 14,235, 72,214,211,254,194, 54,193,121, -109,176,168,204,104,252,174,188, 78,119, 83, 11, 70,180,239, 9,156, 47,226, 44, 8,126,126,207, 12, 86, 27,180, 92, 15, 31,132, - 62,125,211, 70,173, 96, 71,236,173,136,133,179, 88,167, 1,133,108,182,145,237, 13,191,255, 70, 34, 68,138,176,150,168,237,176, -101,134,144,125,191,191, 15, 81,161,178,200,189,101,108, 89,250, 98, 47, 98,156, 76,176,206,219,232,198, 42, 33,233,119,209, 89, -129,108,196, 56, 43,176,145, 14,171, 16,237,249, 40, 85, 18, 97,216,131,139, 72,121,181, 73,210,198,149,153, 15,203,137,146, 69, -230, 18, 14,131, 9,142,206,129, 50, 40, 37, 82,248,180, 75,121,202,129,209,223,163, 66,197,168,164,237, 53,249, 81,194,236, 96, -135,236,232,144,163, 87, 94,230,177,103,175, 16,181, 54,188, 31,124,255, 44,135,159,254, 2,147,151, 63,143, 73,103, 11, 20,164, -170,147,214, 46,154,169,160,228,168,190, 15, 91, 17, 46,229, 82,138,158,117,167,214, 69, 34,246, 77,154,168,194,131,156, 79, 19, -172,213, 17, 85,183,105,141, 79, 95, 52,186, 54,184, 9,164,148,192, 29,177,245, 78,191,110, 46, 23, 36,251,250, 90,175,221, 29, -181,231, 25, 68, 97, 71, 31,203,160,103,199,145, 52, 59,160, 11,148, 12,215, 27,206,123, 13, 72,207,182, 23, 72, 48, 37, 79,252, -229,159, 98,116, 56,164, 72,231, 68,137,196,154,231,137,229, 33,101,218,240,239,115,174,209, 7, 37,101, 10,195, 99, 71, 91, 88, -178,210,209,108,122,178,169,201, 89,132, 34, 73,135,234, 90,244,177,224, 35,173,159,226, 51,238,251,217,104,206,152, 12,115, 36, - 17, 89,121,194, 74,183,133, 19,134,149,149,136, 44,205,105, 42,133,112, 77, 30,166,247, 57,223,191, 64,171,221,102,144, 78, 88, -219, 76,176, 7, 5, 78,181,185,247,240, 37,218,205, 51, 68,147,227,125,142, 31,220,163,219, 86, 60,242, 21, 31, 98,176,253,128, -163,135,251,196, 13,199,250, 90,159, 39, 62,252, 81,182,159,255, 28,243,163, 93,202, 50, 71,185, 28, 87,182,233,109,173,210, 63, -243, 52,186,200,217,125,253, 53,138,201,152,205,235, 79,114,227,243,159,163,215,142,152,143,199,100,195, 3,154,107,103, 49,105, -134, 48, 57,233,224, 8,149, 68,228,211, 49,249,108,204,124, 24,211, 92,237, 17, 33, 72, 39, 51,198,119,238, 48, 29, 28,208,238, -119, 24,239, 30,176,117,121, 11,129,165,221,109,211,233,109, 48, 60, 30,161, 53,180,186, 77, 6,195, 9, 71, 59, 59, 52, 59,138, -102,167, 69, 18,173, 50, 63,201, 49,227, 25,141, 56,166,217, 89,229,104, 48, 1,173,185,242,232, 25,180,141, 72, 90, 61, 14, 14, -238, 49, 30,205, 65, 42,222,255,237,223,202, 95,253, 83, 63, 72,119,245,236,155,138,181, 5,155,227,202,147, 37,182,142, 12, 48, - 88, 96,204, 22, 25,166, 44, 67,225,154, 17, 27,203,199,254,228,159,229, 59,255,194, 95, 97, 50, 62,225, 83,191,250,175,248, 63, -127,242,103, 80,157, 21,102, 5, 36,113,151, 68,193,241,116, 76, 59,105,241,112,247,144,127,253,111,254, 57, 31,250,206,239, 95, - 42,228,206, 79,205, 66,128, 75,252, 65, 93, 30,194,221, 27,112, 56,132,233,156, 98, 58, 37, 31,142,200, 39, 19,230,227,169, 39, - 93, 25, 13,210, 31, 80,177,116,232,200, 49, 57, 57, 33,203, 50,242,223,252, 36, 23,223,249, 12, 81, 51, 10,122, 98,237,223, 67, -249,101,178,147, 19, 58,223,240,237,200,196, 65,153, 97,102, 19, 47, 57,209, 37, 58,159, 51, 59, 25, 82,230, 57,243,217,156,179, - 87,159,165,213,239,162,164,173,111, 42,143, 14,235,165, 29,172,246,251,244,201, 20,107, 45,122, 58,193,164, 41,119,198, 41, 70, - 42,230,145, 34, 89,105, 51, 63, 24,133,100, 7, 31, 12, 97,139, 18,103, 44,106,243, 44,210, 89, 92, 89,112,244,137,127,199,228, - 55, 62,201,237,231,190, 72, 54,158, 48,205, 13,101, 44, 41,155, 77,154,237, 6,177,140, 88, 89,237,145,105,205, 74,175,143, 49, -134,141,118,207,231, 43, 55,218, 68, 2, 82,231, 24,236, 29, 81,236,236, 19,109,109,248,131, 80,121,173,172,104, 72,244,206, 54, -242,236, 5,158,253,161, 31,225, 23,127,236,159, 35, 58, 77, 26, 78,146, 40,104, 11, 65, 94, 20,236,140,135,172,196, 13,214,186, - 43, 28,151, 25,173,121, 74,199, 1, 86,225,242, 25,170,213,195,108,111, 35, 46, 94, 34,105,118,201, 38, 39,254,250, 17, 21,129, -206,213, 0,165, 13, 7, 97,149, 35,141,181, 75,100,180, 42, 91,122, 73, 3, 46,150,161,117,106, 95,245,186,136, 85,123,238,200, - 79, 59,200,208,180, 40,185,224, 76, 84,177,239, 85,113,183, 11,150,178, 43, 23, 59,239, 10,213,116,181,254,184, 92,164,182,133, - 67,176,202,128,175, 3, 97,168, 96, 84, 79,254,243, 59,210,144,181, 18,200,110,214, 56,164, 53, 33,104, 35,188, 24,183,120,207, - 86, 19,228, 91,149, 95,252, 34, 4,167,242,251, 23, 75,159,129, 56, 5, 53, 44,233,171,170,166, 36,184,140, 37,171,231, 65,152, - 83,146,205, 48,178,250, 14, 37,138,193,148,160, 34, 92,225,247,231,241,218, 69,223, 64, 33, 49, 90, 35,172, 67, 53, 12, 14,141, -140,155,193,217,207, 34,172, 69, 68, 77,156, 41,176,186, 68,168, 18,167, 34,148,118, 68, 40,223, 20, 68, 49, 46,216,180, 58,102, - 1, 50,215, 62,145, 78,167,136,164,133,209, 37, 82, 8,100,164, 64,135, 73,215,250, 73, 81, 4, 69, 6, 50, 66, 54, 34,255, 60, - 1,159,142,227, 6, 78,250,215,226, 81, 26,133,140,125,184, 11, 42,242,236,118,165, 16, 81, 28,222,114,140,108, 52,145,145,194, -106, 67,122, 50, 98,240,234,139,136,249, 49,205, 94, 11,135,193,166, 94, 42, 58,187,243, 42,249,104,232,137,158,118,129,248,200, - 10, 38,183, 11,169,100,229, 96, 88, 59,250,202,197, 30,155,240,119, 89,135, 12,121,191,122,127,205,138,192,167, 88,254,125, 87, - 27, 51,185,224,187, 94, 95, 37,225,121,156, 10,188, 33,231, 39,242,197, 26,170,202, 93,247,166, 91, 38,228,158, 83, 25, 28,133, - 24,216,234,250,137,131, 87,178,168,155,186, 18,107, 23,121, 2, 46,240, 76,108,144, 4,182,214, 47,162, 83,197,108,103, 66, 54, -155,179,126,246,173,156,127,239, 63,129,121,130, 56, 46, 48,218, 49, 63,246,141,222,116, 4,174, 16,228,115,139,206,160,140, 67, - 80, 91,238,208, 86,120, 94,177,116, 20, 25,152, 6,244, 79,118, 56, 41, 30,208,113, 9, 69, 89, 98,173,166,223, 94,161,215, 77, - 40,180, 64,246, 74,244, 36, 2,233,104, 10, 67, 36, 21,177,106, 17, 91,135, 70, 51, 58, 40,200,116,193,168, 56,160,223,124,140, - 11,103,207, 16,169,168, 73,171,213,164,187,181,198,231,126,245,227, 60,241,174,119,177,182,181,194,249,103,223,197,189,207,254, - 62, 47,255,230,191,163,213, 95,231,194, 91,222,195,193,237,215,104,116, 87, 61,116,209,233, 49,120,248,128, 7,175,190, 74,171, -165,120,230,107,191,129,227, 91, 55, 40,103, 99,158,250,232,159,224,198,167,158, 99,243,242, 35, 72, 64, 91,205,153,235, 79, 51, - 62,218, 37,110,182, 57,217,217,161,221,235, 49, 57, 57,100,235,177,199,120,248,218,171,148,218,177,186,177, 66,158, 78, 56,127, -237, 41,238,189,250, 50,143,188,229, 26,233,120, 70,210,106,115, 50,154, 81,102, 41, 89, 58,163, 44, 11, 14, 30,236, 48,207, 50, -138, 82,241,250,205, 91,188,247,171,190,154, 78,103,133,147,193, 1, 73,175,195, 92,195,112,120,204,227, 79, 92,196, 32, 24, 30, -141,249,252,239,253, 14,255,253, 95,253,111,249,240,159,249, 97,218,253,245, 83,157, 94,109,186, 98, 50, 47,131,145, 45,136,187, - 11, 98,153, 9,255,102, 76, 96,104, 75,100,164,112, 46, 33,234,180,136,140,195,229, 5,217,100, 0,243, 57, 95,243,117,255, 13, - 95,243,145,239,227,159,254,189, 31,229,255,251,181, 79,146,180, 18, 74, 3, 69, 86,240,182,119, 62,205, 11, 47, 12,222,244,252, - 65,227, 45, 60,243,219,137, 12,183,127, 19, 30,108,195,100,134,158,229,164,163, 17,211,163, 1,101,150,249, 16,142,124,142, 53, - 26, 37, 21, 6, 11,133, 65, 90, 65, 19,201,180, 48,216, 56,102,184,187,135, 82,142,213,243, 91, 65,247,107,176,133,161,204,230, - 12, 15, 78, 24,255,246,255,204,123,127,226,239, 83, 78,119, 49, 69,225,117,190,121, 70, 62, 58,241,211, 70,171,237,253,162, 27, - 45,148, 48, 96,148,135, 33,133,196, 10,179,216,211, 87, 44,176, 44,197, 21,198,239,219,181, 97,146, 26,178,234,190,237,123, 3, - 28,107,140,191,153,140, 65,108,158, 69, 21, 25,233,206, 30,111,252,200, 15,242,218, 39, 62,141, 53,150,125,237,136,251, 77,186, -237, 54,110,125,149,178,240,164,195,190,138, 73,130,225,196,102,171, 75, 98, 45, 42,137,233, 70, 13,156, 16,204,203,156,181, 86, -151, 66,103,160, 75,250, 43, 29,166, 55,110,179,126,225,108,152, 6, 45, 46,142, 80, 74,145,239, 63,160, 35,254, 40,157, 51, 23, -105,118, 26, 72, 4,185,179,222, 13, 48, 48,126, 27,218,114, 51, 31,241,142, 70,131,149,164, 73,107,165,143,213,154,241,157, 47, - 19,119, 59,116, 31,125, 28,157,231,196,101,201,218,211,127,132,157,207,255,122,176,211, 20, 65, 71, 28, 60, 83,194, 33,100,157, - 91,178, 54,119,245,100, 33,100,197,105,175,184, 68, 34, 88,195,134,130, 92,123,157, 11, 8, 54,179, 11,175,149, 10,154,244,255, -110,172,173, 73, 74, 85,226,153, 49,214, 19,177,146, 46,182,152,248,129,187,114,169, 91, 50,151, 95, 40,143,170, 67,217, 87,105, - 83,101, 99,191, 57,160,189, 98,156,171, 69,118,124,189,234,116, 65,202, 22,174,111,129,172,194,183,131,253,175, 8,135,177, 67, -196, 21,218, 96, 23,145,235,209,194,227,157, 32,219,172,156,100,221,178,197,130,240,148, 9, 47, 91,119, 24, 44,178,213, 89, 80, -171,165,242,247, 46, 81,120,125,145,191,215, 84,140,203, 83,176,150,168,127,214,219,201, 6,147, 19, 5, 96, 98,172,107,161,180, -129, 68, 5,229,133, 37,110, 52,253, 61, 64,130,206, 51,191,211,181, 32, 27, 26, 17, 12,126, 80, 81,200, 5, 23, 68,173, 14, 56, -129,108, 72, 68, 38,112, 58,242,201,114,145,183,254,197, 73,172,176,222, 74, 66, 74,239,158, 88, 53,121,161,169,145,210,235,215, -133, 19, 97, 34,151, 88,157, 6, 66, 92,208,176, 11,130,172,213, 59, 71, 10, 25,249, 53,158,192,179,222,165, 68,167, 41, 69, 54, - 39,219,187,203,163,207, 60,130,179, 57,196, 45,162, 78,147,249,209,140,114, 52, 90,152,250, 24,106,215,192, 42,126,200,177, 68, -144,100,169,201,171,215, 64,178, 18,177,215,114,245,106, 37, 84, 53,148,117, 84,113,128,212,101, 8,125,161,146, 43, 26, 27, 84, - 11,126,125,101,140,169,175,123, 92,149,137,224,234, 35,199, 46,157,225,222, 99,158,218,146, 86,224,155, 15,169,146,112,191,149, - 97,104,243,196, 60,167,211, 83,187,252, 74, 69, 43,165,244, 28, 7, 44, 87,126,224, 71,217,123,229, 30,141,118,147,254,214, 22, - 73,127, 21, 97,143, 96, 38, 41, 83, 40,103, 97, 53, 36, 64, 68,142,194,128, 29, 67,158, 57, 68, 11,108,211, 23,113,153, 64, 57, -113,152, 22,148,198,107,252,167, 78,241,177,198, 47,241,235,217,223, 32,118,175,208,146, 93,214,250, 61,226,182,197,229,142, 94, -175, 69, 46, 35,144,154,155,251,175,113,101,227, 73, 86,215, 27,108, 31,108,243,200, 35, 23, 57,217, 46, 24, 20, 35,250,205, 45, -114,123,200,253, 7, 19,162,217,201, 9,179,201,156,209,225, 46,151,159,120,156,249,116,202,232,248, 16, 77,196,100,156, 18,185, - 25, 91, 79, 63,206, 27, 47,252, 1,145, 82,244,215, 87,201,178, 49,118, 56, 32, 29, 79,184,246,246,119,144,158, 28, 32, 84,194, -246, 27,247,120,231,215,125,152,123,207,127,142, 66,107,230,131, 1,113,107, 5, 99, 53,199, 15,246,105,118,219,216, 50, 39,155, -167,156,125,228, 60,195,131, 3,159,205,158,105, 92, 57, 97,227,202, 59, 56,217, 59,102, 58, 60, 96,125,235, 28, 89,154, 50,157, -102,204,230,115,142,119,119,176,102, 74,167,187,129, 84,130,149,181, 21,204,177,225,100, 52,163,211,217,224,112,247, 22,157,230, - 22,237, 94, 23, 43, 27,164,179, 25,221,126, 27, 84,204,205,151, 95,229, 3, 31,251, 40, 63,250, 43,191,249,159, 21,242,218, 69, -205,229,160, 51, 80, 77,132,234,122, 7, 53,140,207, 99,118,102, 49,165,251, 48,110,159,227,157, 36,136,164,225, 25,174,137,130, - 78,151,104,109,157,150,144, 32, 98,116, 54,227,175,253,139, 95,226,207,238,222, 97,251,245, 47,113,184,243,144,141, 11, 87,121, -219, 7, 63,186,152, 66,132, 8,238, 87, 32, 68,240,109,183, 67,184,253, 10, 12,198,184,105,202,252,214, 29,202, 79,255, 39,216, - 63, 64,142,198,100,163,148,195, 84,211,126,230, 50,103,190,226, 89,210,225,208, 95,132,185, 65,137,136,164,215,193, 72, 72,179, -140,168,149, 48, 27, 79, 61,170, 96, 45,113, 28, 97,203,146,147,221, 99,242, 44, 39, 63, 58,198,205, 6, 94,122,152,166, 52,214, - 54, 48,243, 49,113,183, 79,123,101, 78,145,149, 52,226, 4,235, 20, 91,103,187, 80,206,192, 88,108, 89, 32, 91, 93,223,117,227, - 29,161, 48, 6,210,185, 15,125, 72,115,136, 34,202, 82, 47, 73, 95, 36, 46,203,112, 73,130,236,244,176,119, 95,167,252,241,159, -228,225,191,250, 4,251,101, 73,188,214,231,145,115,155, 72, 33,216, 42, 75,102,165,227, 76,220, 96,160,115,246,165, 67,161, 88, -141, 99,250,113,147,212,149,196, 56,166,182,160, 85, 40,166, 46,103,150,231,116,146,132,163,217,136, 22,160,165, 32, 78, 26, 28, -127,225, 85, 54,191,254,171,252, 62,189, 98, 95,199, 49,229,100, 6,147, 1,244, 55,120,242,173,215,216,127,237, 30, 68,130,212, - 64,230, 28, 13, 45,136, 59, 77, 34, 35, 24,102, 51,154, 14,138,209,128,217,209, 54,142,136,205, 75, 87, 16,171,125,226, 76, 99, -165, 64,149,182,214,231, 46, 75,174, 93,248,139, 11, 19,172, 13, 17,143,203,228,160,229,162,186, 72, 97, 13,123,241, 69,220,121, - 77,242,170, 98, 89, 79,217,241,213, 59,109,113,106,186,175,224,206,164,115,142,184,123,142,236,248, 70,136, 80, 93,250,185, 80, -128, 23,145,171,139, 36, 76,191,111, 20,117, 3,178,248,165, 90,148, 95,191,120,161,100,125, 64,218,165,245, 65,197,198,175,244, -201, 82, 46,246,253,158,212,231, 97, 73,112, 88, 23, 14,244, 58,195,157,234,131,171, 35, 63,157, 19,196,221, 75,136, 72,160, 39, - 15,113,186,218,215, 58, 18, 33,188,119,187,168,113,227,160,142, 84,149,166,193, 23,118,227, 85, 27,170,221,247, 97, 47, 4, 52, - 78,133,223,137, 98, 36, 22, 33,122,158, 80,151,207, 17,173,134,111,189, 34,131,213,222,231,221, 57, 65,212, 78,208,101,233,245, -224,141, 4, 85,104,159,162,102, 28, 74, 52, 3,255, 36,241,153,220,137,196,217, 18, 33,155,254, 53,139, 64,120, 83,141, 64,253, -240, 68, 93, 17, 41, 63,133, 86, 59, 14,235,188, 57, 16, 22, 33, 20, 34,138,124,193,143, 26, 72,233, 3,153,162,184,137,136,124, -152,139, 76, 26,254,103, 80, 72, 25,121,178,105,145,225,102, 35,174,191,231,113,214,174, 63, 29,138, 91, 3,173, 20,179,215,191, -236, 45,118, 27, 45, 92, 58,175, 17, 30, 74, 23,246,209, 98, 97,161, 16, 38,113,183,236,217,143, 91,124, 15,238, 77, 10,218, 37, - 82, 71,213, 32,178,212,148,214, 4,185, 42,207, 32,100,167, 91,107,130, 90, 34, 40, 74,150, 72,162, 78, 46,249, 92,212,182,203, -225, 62, 67, 98,169,130,101, 26, 52, 87, 46, 82, 76,143, 48,197,120,233, 51,117, 85,176, 92,205, 13,144,149,236, 48,240, 19, 84, -163, 77,123,235,157, 60,184,241, 18, 78, 59, 86, 47,157, 97,186, 7,205,238, 46, 28,196,252,250, 47, 77,153,247, 5, 61, 11, 42, -134,196, 65,187,233,175,178, 86,199, 81,104, 15, 14,198, 93,152, 28, 58, 92, 95, 48,219,119, 56,233, 48, 2,140,112,180, 69, 65, -146,126, 28,215,124, 47, 43,113,147,194,150,136,121, 68,163, 89, 96,242, 14,131,116, 64,175,209,231,124,251, 81, 58, 23, 75,138, -227,152,157,209, 49,173,102, 15,109, 28,173,200,123, 20,196, 46, 97,170,167, 68, 59,175,223,231,236,229,117, 58, 43,215,185,241, -153,207,242,216, 59,223, 66, 58, 16,232,201, 49, 34,146,244,214,207,115,244,240, 33,217,116,192,123,190,245, 59,121,240,165,151, -217,184,112, 9,135,226,224,230,107, 40,145,211, 63,115,145,147,237,123, 52,154,138, 60, 45,136,227,132,213,213, 14,243,241,128, - 44,203, 57,247,248, 51,236,188,250, 7,156,187,254, 44,113, 35,161, 44, 10,134,251,187, 56,225, 72, 7, 71, 30, 50, 41, 29,217, -108,194,225,254, 17,235,151, 54,153, 12, 82,198,131, 33, 70,107,178,241,148, 70,172, 72, 58,107, 76,166, 5,206, 25,138, 60, 35, - 77, 83,239, 5,162, 58,164,243,140,213,190,192,186, 6,243,249,156,102, 75,113,116,239,132,139,215,175,242,227, 63,249, 5,111, -210, 96,171, 27, 95,212, 59, 29,132,169,111,110,226,190,159,146, 93, 17,236, 13,203,197,169,104, 75,223,233, 39,141,224,172,218, - 90, 50,111, 81, 65, 87, 93, 29, 57,133,215,209,235,148,236,193, 46, 73,158,114,253,234, 51,188,245,131,223,190,144,234,212, 5, -221,158,118,117,155,221,129,219,119,161, 48,228,159,254, 12,249,175,253, 22,210, 65, 89,148,220, 59, 24,242,198,116,202,200, 88, - 30,230,134,246,127,124, 30,254,211,139,252,201, 63,243,205,158,156, 99, 5, 73, 59, 66, 0,253,245, 46,243,189,153, 39,188,165, - 25,206,104,202,194,144, 68, 18,103, 52,243,201, 24, 93, 20, 12,179,140,241, 43,175,208,186,180,133, 53, 37, 81, 4, 18, 69,103, -243, 60, 46, 32, 11,205,241, 58, 82, 40, 26, 61,133, 57,206,188,159,179,113,225,166,177,190,241, 49,193, 36,166, 44, 60, 27, 55, - 18,168,102, 66,174,245, 66, 53, 5,216,110, 31,247,227,127,159,227,159,249, 56, 69,145,179,250,232, 5,206, 60,117,153,104, 48, -225,164, 40, 72,139,146,169,182, 12,203,130,193,201,140,225,217, 53,208,154,153,117,116,149,224, 36,205, 72,164, 68, 10,193, 56, -203,152, 22, 5,170,165,120, 48,153,211,140, 37, 81, 20,113, 50, 57, 97,173,187, 66, 34, 21, 78, 8, 38, 71, 83, 31,215, 42, 43, -120,214,239, 94,137, 20,246,193, 61,196,211,107,124,203,207,253, 60,255,251, 19,239,226,226,198, 10,189, 72,144, 4,104,142, 34, -103, 43, 82,148,121, 70,167,183,202, 96, 58,225,226,163, 87, 41,243,130,236, 96,223, 91,110, 54,123, 68,165,161,181,126,142, 90, -161,227,150, 78,181, 55,235,181, 69, 85,216,100,109,131,105,171, 53,239,146,127,124, 77,178,171, 32,116,199, 34,153,108,233, 57, -106, 88,159,197, 78,126,137,144, 92, 19,149,172, 45,201, 71,219,152,114, 30,206,172,211,177,176,184,211, 36,168, 90, 22, 36, 23, - 59,235,122,105, 94,189, 58,177, 56, 20,165,148,254,241,194,228, 94,161, 4,213,195, 27,227,234, 9,212,218, 42, 31, 94,176,100, - 51,239,185, 0,149,198,189,114,215, 11,171,165,197, 58,193, 17, 53, 55,105, 94,124, 39,102,118, 76,121,178,131,136,108,125,220, - 11, 37, 48,163,253,128, 34,133, 72, 95,169,168,131,230,101,236,239,103, 39, 16, 73,219, 19,231, 68, 20, 92,231,148,103,202, 43, -175,255,182,206, 67,237, 56,235,155,140, 72, 66,169,113, 50, 70, 38, 17,182,152, 17, 53,219,152,178, 12,133, 89, 16, 55,123, 32, -115,255, 90, 35,176, 58, 15,209,179, 37, 81,163,129, 41,114, 80, 77,207, 39,140,188,220,206, 26, 27, 82, 9, 5, 22, 19,214, 16, - 50, 72, 12,189,101,155, 80,193, 92, 42, 72,202,148,108,249,124, 7, 17, 8,119,206,161,154,173,128,248, 72,100,210,244, 82, 63, -229, 13,113,204,124,194,224,193, 29, 18,155,114,246,237,239, 64,245,124,179,162, 58, 43,100,199, 99, 70, 47,124,138, 98,184, 15, - 21,212, 95,249,250, 75, 25,120,177,129,255, 33, 22,150,190,190,184,219,186, 42,214, 18,206, 10,209,145, 94,127,238, 97,245,165, - 66,190, 84, 76,141,181, 11,181,132,240,147,186,171,136,107, 98, 97, 62, 83,173,164,150,159,195,201, 69,152, 82,245,122, 43, 41, -101, 61,253,235,156, 98,122,132, 43,167, 75,167,180, 88,200,240, 2, 73, 84, 73, 81,199, 39,135, 11,150,205,175,252, 14, 6,219, -135,244,207,246, 41, 38, 25,131,219, 59, 36,157,117,172, 59,196,190, 40,249,199, 59,142,223,253,137, 53,238,254,251, 9,251, 99, -199,116,106, 25,167, 94,144,180,253,170, 96, 92, 64,167, 3, 89, 9,239,123, 70,176,158, 67,124, 65,112,247,174, 96, 56,176,236, - 13, 45, 43, 74,241,145,222,203,252,108,246,181,108, 53,189,186, 39, 79,115,250,107, 61, 70,131, 41,137,108,112,247,228, 54, 23, -251,151,120,241,229,187, 88,155,146,153, 49,179,201, 37,156,212,116, 26,125,166,197,196, 7,243,216, 46,209,245,119,191,149,147, -253, 61,246,238, 62, 96,243,220, 25,132,106,208, 88,221, 34,155, 12, 56,184,125,147,205,243, 31, 36, 59, 25,114,254,242, 21,246, - 94,123, 17,213,136, 40,117,196,225,189, 91, 92,125,247,251,152,156, 28, 49, 58, 56,160, 72,199, 60,242,244,179,236,190,126,147, - 98,158,113,246,234,121,164, 74,152, 12,142,200,211, 25, 27,231, 47, 51, 62,220, 99, 54, 74,208, 69,202,201,222, 33, 43,107, 91, -104, 99, 56,222,185,199, 59, 62,252, 97,242,201, 16,155, 77,136, 27, 9,195,227,135, 88, 93, 82,102, 25, 42, 17, 32, 91,228,185, -102,120,180,143,177, 41,137,106,250, 44,239,118, 66,158, 23, 36, 70,144,151,150, 44, 47, 41,242, 57,217, 60,227, 71,126,225,227, -116, 86,207,132,194, 73,189,147,242,215,171,241,251,107,157,131,106, 33, 84, 3,231, 74,156,208,193,197, 76, 19, 22,148, 33,154, - 52, 9, 87, 97,128,240, 92,180, 56, 12,193, 55, 2, 54,199,229, 41, 78,107,172,209,228,227, 49,217,104,204,202,227,207, 18,183, -186,225,117,232, 55,249,173,203, 69, 72,199,209, 43,240,198,125,202,189,125,210,127,246, 83,222, 15, 56, 74,120,248, 96,143,123, -179, 57, 15,140,229,100, 86, 48,153,101,220,210,134,205, 72,113,177,211,226, 71,254,143, 95,228, 7,191,241,221, 92,125,242, 49, - 76, 44,137,218, 49,178,211, 66, 74,111,176,211,176, 80,104,135, 46, 10,100,105,201,102, 41,197,120, 66,212,148, 68, 17, 28,124, -246,121, 46,127,247, 71,200,199, 19, 58, 23, 46,162,226,216,203,123,226, 6,249, 52, 37,105,245,233,116, 87,253,116,149,229,152, -172,192, 5, 18, 20,182,244, 5, 93, 56, 40,203,160,108,243, 97, 24,113,171,205, 88, 27,148,138, 24,204,115,190,235,210, 6,179, -119,191, 31, 29, 69,180,174,158,135,225,148,241,108,142,117, 48, 46, 74,102,218, 11,172, 87, 34, 65,175,213,227,226,215,127, 13, - 47,253,202,175, 19,117,154,172,136,136,173, 40,225,124,111,111,211, 5,170, 0, 0, 32, 0, 73, 68, 65, 84,133,181,102,135,172, -204,137,162,216,231,214, 59,216, 72,188, 71,126, 44, 96,173,213, 36,182, 37, 58, 47, 33, 82, 76, 71, 83,156,246,251, 90, 41,164, -215,203, 10,129,106,196,232,253,109,146,167,223, 78,255,242,117, 54,128,149, 68, 65, 97,105, 39,138,195,194, 91,184,108,196, 13, -206,116,250,116,186,235,236, 77,142,217,127,112,151,254,234, 38,205,118, 23, 61,155,135, 73,117,147,249,112,175,222,151, 59, 22, -209,169,117, 94,138, 19, 53,187,124,113,248, 44,236, 99,173, 91,212,157,101, 24,219,167,182,217,197,164, 36,150,131, 98, 22, 78, -106,174,138,159, 20, 11,168,190,102,211, 11, 48,179, 99,223, 0, 4, 45,121,165,115,246,201,112,178,246,171,151, 65,138,230, 4, -111, 66, 3, 64,196, 45, 95, 96, 93,177,100,137, 91,189, 38, 87, 67,247,226, 20, 18,230,187, 18, 33, 65, 42, 21,108,126, 67,209, -103,161,147,175, 80,128, 58, 66,214, 85,187,220,160, 73,175,137,120, 2,103,166,100,219, 95,196,228, 19,164, 50,254,243, 80,213, -113,236,130, 34, 35,174, 48,100,127,223, 46, 91, 36,219, 48, 90, 9, 9, 50,248, 57,168,200,163, 77, 34, 2, 97, 16,113, 18,184, - 4,206, 75, 53,163, 40, 32, 33,222,224, 68, 88,135,136, 26, 88,109,112, 90,215,158,236, 86,167,126, 32,136, 98, 98,149, 80, 90, -141,195, 17, 37, 45,116, 54,243,246,182, 14, 74,147, 19,137, 6, 68,222, 48, 72, 96, 17, 86,121,129,138,242,134, 39, 62,133, 77, - 6,178,152, 70,132,215,234,139,118,132,144,222,125,206,255, 12,200, 70, 19, 91,228,126,146,151,193,105, 79, 69,100,131, 99,166, - 59, 15,152, 61,188,205,229,235, 23,145,237,166,103,255,203, 22,170,211, 71,223, 59, 36,223,223, 70, 79,102, 62,159, 32, 88,192, -214,237,184, 89,114,137, 11,146,204, 5,183, 66,212,205,172, 88,114, 61,172,164,141, 50, 56, 28,186,176, 91,175, 84, 15,149, 98, - 98,217,122, 81,132,198, 87,197, 50,144,234,130,226, 59,100, 34, 72, 1, 90,219,133,210,194, 44,149,104,203,130, 88,233, 22,255, - 79, 10,129,205,125, 58,161, 91, 74,133, 19, 66,248,115, 65, 46,124, 33,188,210,196, 6,146,161,227,236, 7,127, 8,215,204,216, -123,238, 46,237,110,143, 98,110, 72, 26,146,120,148,243,167,126,232,136, 95,251,196, 38,233,254,132,100, 83,162,134,150, 86, 91, - 16, 43,193,234,170,101,107, 5,118, 30, 6, 53, 98, 36,184,241, 26,164,202,115,139,159,120, 12,250, 23, 5, 87,159, 16,148,115, -139, 56,144,188, 39,253,121,138,254, 95, 64,234, 57, 38, 41, 73,244, 42, 55,183,223, 64, 83,208, 80, 9, 39,233,128,205,228, 60, - 37, 51, 82,189,206,225,236, 33,155,253,139,148,186,160,211,104, 80,154,148,203,103, 19,162,157,215, 95,199, 9,135, 18, 2, 27, - 55, 57,126,176,205,241,206, 61,122,103,206,115,237,173, 79,179,121,245, 73,246,127,231,183,144,113,139,166,115, 36,173, 22,243, -241, 9, 43, 91, 91, 76, 78,142, 40,211, 49,221,181, 51,244,174, 63,206, 31, 62,247, 28,143, 60,241, 40, 81, 35,166,152,251,100, -174, 34, 77, 57,122,227, 53,180, 49, 20, 89, 70,171,219,101,180,255,144,254,218, 6,131,147, 99,202, 50,229,202, 83, 79, 98,202, -156, 44, 45, 57,243,216, 21,118,110,189,129,206,230, 56, 33, 57, 57,188, 79,212,136, 49,185, 96,176,119,192,238,206, 49,237, 46, -108,172, 55,137,155, 49,198, 8, 76,145, 35,104, 51, 29,205,121,253,245, 59, 92,127,230, 26, 63,242, 47,127,109,105, 42,150, 75, - 94,194, 38, 16,104, 76, 32,204,116,194,207,149, 1, 51, 12,112,187,245, 25,212,254, 78,241,233, 97,126,113, 39,151,226, 42,157, -151,112, 97, 64,231,152,249, 28, 61,159, 82,166, 57,147,189, 29,214,159,126, 23,155,151,223, 26, 30, 63,171, 13, 96, 42, 19,139, -122, 21, 32, 44,238,193, 11,240,240,128,244,133, 23, 48,191,240, 75, 52,174, 92, 98,239,229, 59,188,124, 52,228,190,117,156,236, - 31,211,232,119,120,207,119,124, 61,215,190,229,163, 52,182,206,178,253,252, 31,240,137, 31,255,103,156, 59,180,252,219, 79, 62, -207,223,122,235,117, 68, 28,211,104, 55,145,173,132, 70, 51, 38, 51, 14, 25, 71, 20,101,137,203, 11,114, 93,112,238,242,117,110, -237,221,199,234, 38,205, 68,240,202, 39,127,143, 71,190,253,195,152, 60, 67,182, 87,144, 88, 76,153,227, 76, 65, 89, 20, 52,154, -107,180,207,108, 34,173,198,232,194, 79, 92, 78, 19,171, 40,232,127,131,107, 84, 89,128, 51, 65,210,101, 17,205, 4, 41, 37,155, -137,228, 35, 79, 61,134,179,142,251, 7, 67, 10,109,136,142,198, 76,108, 73, 39,137,233,136, 24,103,141,119,136, 18,208,238,245, - 33,157,177,247,241,223,224,201, 51, 27,180,156,164,223,108,114,166,217,246,174,108,229,156,134,146, 40,233,136, 20, 68,182,164, - 20,150, 36,142, 56,153,142,233, 52, 26,204,129,121,150,209,235,247, 3,177,207, 64,164,234,180, 51,148, 66, 89,129,158,141, 73, -166, 67, 84,127,131, 39,190,237,107,121,249,183, 63,141,139, 34, 26,153,165,196,242, 88,171,195, 88, 23,172, 21, 5, 73,187,205, -197, 70, 35,200,149,164, 87,110,116, 58,184,201,148,150,146,164, 39,251, 53, 17,204, 5,150,184, 19,193,172,165, 58, 15,141, 91, - 76, 30,194,213, 82,160,138,186, 81,177,230,149, 18, 75,135,156,173,137,106, 82, 44,249,252,188, 25,218,100, 41, 58,181, 78,109, -171, 14,209, 80, 84, 3,223,184, 78,134,115,162,222,241,215, 43,242,106,122,183, 75, 29, 68,128,128,125,104, 77,177,152,132,164, - 55,255,192,202,154, 25,191,188,107, 71, 84, 50, 36,223,104, 56, 25,161,162, 38, 78,143,107,151, 53, 39, 23,208,173,215,174,203, -133,141,110, 48,203, 65, 46,244,208,214, 90, 76, 49,247, 59,229, 83,105,110,254, 83, 54, 22,138,237,155, 64,236, 97,238, 26, 38, -178,222,144, 73, 23, 1, 26, 16,126,143,110,141, 47,240,214, 6, 34,157, 14,111,204,135, 11, 89,157, 7, 71, 62,143,130,121,243, - 26,129,211,101, 40,126, 22,231,180, 15, 71,113, 51, 31,166,146, 68,128,242,196,183,184,225,247,184, 70, 19, 37, 49, 70,128,213, - 5, 74,120, 29,185, 51, 6, 37, 84, 88, 49,232, 32,113, 20, 64, 85,176,109, 45,215,243, 10, 4, 21,172,118, 19, 84,212,240, 95, -131,140,194,100,175,124, 32, 78,156,132,230, 82,122,110,203,206,125,230, 7, 15, 73, 15,119,105,191,251, 42, 50, 78,112,170, 69, -212, 89,167, 40, 12,102, 50, 68,182,251,216,244, 94, 29, 38,180,168,212,226,148,223,160,117,167,221,228,172, 59,221,188, 89, 28, -178,130,228, 77,128,159,116,224,148,104,235,155,202, 48,121, 59,177, 36,139,115,149, 36,205,213,211,186, 53, 11, 46,138, 16, 34, -160, 61, 44, 60,225,171,166, 32, 16,237,170,230,178,134,229, 23, 1,137,167, 44,103, 43,195, 90, 47, 5,117,167,222,170, 16, 94, -230,184,254,254,143,176,255,250, 3, 86,175,173,176,178,117,150,230,106,147,249,104, 76,154,221,227,230,191,216, 98,208,222,161, -125,117,131, 98,156, 19, 53,188,182,188,114,103, 52,165, 64,173,192,121, 13,243, 28,146,134,100,171,227,232,172,249,158,113,119, -219,145, 25,159,225,222,237, 9,100,228,120,195, 94,230, 92, 54, 71,107,201,246,254,152,241,241, 61,148, 76,208,214,178,218,218, -100, 86,100, 88, 44, 45,213, 37, 18,134, 76, 37, 36, 56, 10, 83, 48,183, 57,202, 54,200,138,146,104,116,240,144,222,218, 42,187, -219, 59,108,157, 93, 99, 58,119,108, 61,114, 13, 83, 78,201,178,130, 91,159,251, 2,198,192,193, 27, 95,226,201,175,250, 99, 12, -238, 63, 36,207,114, 86,206,172,146,142,166,180,186, 45, 78,134, 39,104, 20,107,231,207,242,198,141, 59, 92,127,251, 51, 12, 14, - 70,108,246, 26,116, 86, 55,152,142,142,152,142,166, 72,233,232,244,218, 52,155, 45, 92,121,196,240, 56, 71,158, 63,143, 60, 60, - 33,205,115,116, 97,216,191,123,151,102,183,205,124, 56, 64,196,138,102,171,231, 89,163,194,209,217,232,179,145, 58,110,221,122, -131, 78,167, 67,174,231, 8, 27,209, 91,105,211,104,247,249,242, 75,175,243,225,239,253,110,190,227, 47,255,237, 80,112, 23, 80, -187,255,178,181, 47,194, 38,236,200, 85,107, 65,166, 17,194,195,199, 85, 39,175,226,128,138, 71, 1, 94, 95,100,100, 19,244,152, - 30,186, 47, 48,211, 9,122, 62,161, 72,115,138,201,132,124, 62,229,252, 31,249, 48, 82,169, 0,229,155, 37,255,233, 70, 45,211, -240, 47,209,194,253,231,113,247,247,152,255,135,223,198,253,222,103,104, 60,113,141, 59,159,127,153,207, 31,141, 56,152,102,116, -214, 58,252,224,231,126,131,141,119,189,159,114, 58,164, 28, 28, 81, 22, 5, 79,124,211,199,120,235,247,124, 63,247, 62,247,105, -254,202,183,124, 63,163,233,156, 51, 87,183,252,174, 95, 41,154,205,132,116,152,122,152,181,112,193,162, 87,112,248,234,151, 88, - 89,105,161,115,131, 81,146,221,225,136, 50,205, 60,227, 87, 70, 94,230,230, 44,229, 60,163,200, 50,186,235,171, 52,187,109, 48, - 3,108, 90,153,243, 8,159, 3, 96,116,216, 89, 6, 34,139,241,236,245,106,189,209,139, 99, 86, 87,123,160, 34, 38,195, 49, 9, -222, 43,251, 32,205,185, 51,203,217,136, 45,205,134, 33,234,244, 24,140,199,100,165,230,104, 50,101, 29, 71,222,237, 48,158,229, -180,162,136,145,118, 12,202,146, 97,154,145, 26,195,106, 28,115,182,211,227,254,248,132,139,253, 53,172,140, 57,204, 50,164,240, -113,181,194, 41, 10, 39, 17, 90, 83,160, 60,107, 86, 9,124,134,163, 87, 51,200,196,179,129,221,206,125,108,119,133,111,248,169, -255,155,231, 54, 31, 97,101, 45,162, 21, 50,150, 75, 99,233,202, 6,205,102, 19,213,110, 83,142, 70,104, 87, 34, 10, 71,220, 72, -208,217,140, 36, 89,197,106,195,100,247,206,226, 10,177, 75, 68,239,192,128,175,190,243,138, 20, 87, 77,175,181,229,230,146,251, -187, 11,251, 69, 33,133, 15,177,112,139,168, 83,106, 93,176, 91,218,133, 47, 29,118, 65,223,107,195, 80, 89, 17,136,148, 13,150, -176,206, 45,183, 1, 56, 20, 2,111,108, 33,107,141,188, 59,109, 77, 47, 18, 68,156,224, 76,182,176, 91, 93,134,252,195, 94,216, - 97,234, 93,118, 61,101,201,197,132, 23,247,206,129, 0, 61,154,156,210,204, 35, 2,107, 95, 44,199,182, 85,139, 78, 7, 70,212, -100, 56, 41,229,127,193, 85,127, 73,238, 38, 28,150, 78,176,247, 92,172, 48, 80, 73,136, 97, 13, 31,112,212, 8,175,109, 89, 31, -111,169,157,114,108, 96,159, 71, 14, 71, 89,179,241, 92,184,230,253, 32, 96, 65, 58,156,213, 1,158,174, 24,233, 49,182, 40,188, -155,155,181, 40,153,120,227, 24, 21, 3, 51, 40,115,164,106,224, 2,228, 46,133,159,230, 93,109,176, 18, 66,141,130, 33,141, 95, -205,120,180, 66,169,200,207,234, 42, 66,196, 17, 82, 38,222, 90, 86, 72,191,190,168,185, 3, 62,215,188,152, 76,152,238,110, 51, -186,115,139, 78,148, 18,173,120, 3, 26,213,221,164, 44, 83,230,119,247, 41,199, 67,116, 58,173, 75,183,173, 34,255, 42,205, 97, -213,148, 45, 93, 19, 50, 56,199, 45,172,139,235,211,182, 46,210,149, 75,164, 39,131,202, 69,188,174, 93, 90,221, 84,247,136,240, - 44,117, 21,121, 73, 96,101,102,180, 28,146,228,236, 50, 4, 95,221, 59, 11, 34,202,169,134, 68,138,211,230, 10,222,177,231,148, - 12,174,138,119,117,110,129,132, 85, 32,216,149,239,248, 91,188,241,249, 93,212,182, 67, 59, 67,115, 61,225,202,187,175,242,226, -111,126,134, 89,255,143,178,217,248, 18,194, 21,200, 86,147,120, 69, 99,157,161,204, 65,233,202, 34, 87, 64, 34,188,148, 23,137, - 83,142,124, 12,169, 51,232, 92, 16,197,158, 41, 63, 31, 42, 26,194,113, 44, 62, 64,119,122,130, 18, 93,206,182,207, 50,179, 51, - 18,209,160, 33, 59, 28,207,143,233,197, 29,226,168, 65,164, 4,186,176, 72, 4, 90, 65, 34, 18,178,116,194,253,249, 45, 86,178, - 53,162, 86,171,137, 53, 17,231, 30,189,130, 46, 13,227,189,155,232,233,128, 11, 79, 62, 75,153,101,236,221,123,141, 44,179, 60, -241,150,107, 28,222,124, 17,151,172, 83, 22, 57, 58,106,113,254,153, 11,244,210, 17,230,206, 13,236,100,198,217, 7,175,115,117, -173,135,184,253, 58, 27, 39, 3,246,174, 60,205, 81,154, 33,102, 25,141,222, 38,227,221, 87,145, 23, 47, 99,242, 33,206,244,105, -247, 91, 76, 7,187, 88, 35,145, 19, 69,127,107,139,205, 71, 47, 51,216,190,141, 65, 82,140,118,232,172, 93,163, 76, 39,126, 66, -182,176,249,200, 58,173,110,131,135,219,219,140,134, 25,231, 46,172, 83,228,142, 23, 94,120,137, 31,254, 71,255,136,167, 62,240, -205, 11, 39, 45,183, 76,132, 11, 5,189,158,192, 85, 24,167,244,162,160,139, 37, 99, 12, 33,192,197,167, 77, 20,170, 61, 56,198, - 59,176,233,130,114, 56,160, 72, 51,138,241,152,124, 50,197,152,146, 75, 95,249,141,225,226,200, 67,122, 25, 1, 10,108, 46, 17, -227,194, 18,117,247,101,236,157, 29,230,191,243, 28,252,254,103, 73,174, 94, 96,255,165, 27,220, 73, 83,110,236, 15,248,190,191, -255,215,120,203, 15,255, 93,210,221, 91, 76,239,220,192, 41, 85,107, 66,117, 81,146,239,109,179,246,232,101,254,249,243,159, 98, -247, 39,127,140,139,141, 38, 78,249,174, 61,110,196, 40,229, 11, 44, 74, 97,245, 12,135,226, 19,255,246,151,153, 25,201,126,169, -121,170,223,225,250,219,159,197,100, 57,182,200, 65, 54, 64,103, 76,118, 31,178,253,250, 45,102,105, 70,191,209,244,233, 81,101, -177,136, 95, 12,211, 42,101,233,161,201,224,105,109,141,193,100,121, 72,250,146,108,158, 89,161,183,210,241,210,184, 44,103,152, -151,140,178,146, 88, 41,214,227,152, 8,104,162, 24, 37,138,168,211, 34, 63,246,114,154,151, 78,198, 52, 58, 77, 34,165, 56, 46, -194,202, 34,131, 50,220,178, 3,163,185,157,207,105, 75,201,170, 41, 72,203,146, 73, 94,176,209,106,115,148,101,100,214, 82, 88, -203,181, 70,130,138, 37,148,166,158,100,144,145,159,218,181, 69, 68, 10,125,116, 68,252,164,160,185,113,150,203,143, 93,160, 28, - 77,201,173, 33,146,130,177,214,108,246, 59,172,196, 9,147,195, 61,164, 74,232,109, 93, 12, 55,190, 37,234,246,145,205, 4, 17, - 41,138,108,242, 38, 35, 3, 63, 33, 87, 44, 92, 23,164, 60, 62,246, 64, 46, 65,156, 62,174,181,102,156, 71,114, 41,209,141, 83, - 41,122, 34,200,139,108,181,243,174, 77,249,196,169, 61,190,151, 7,201, 0, 55, 6,168, 91,136, 83,153,216, 66, 73, 28,130,214, -198, 53,112,150,252,228,246, 41, 8,221, 85,134, 49, 42,162,117,225, 25,132, 74, 72,183, 95,168, 7,248, 83, 68,120, 33,176, 86, -215,135,125,101,149,235,161, 90, 89,147,245,116,122,132, 45,230,245, 62,191,142,135,181,161, 1, 9,154,126, 23, 38, 63,161,150, -104,214, 54, 4,127,176,164, 26,168, 62, 51, 37, 49,149, 2, 32, 22,184, 44,199,217, 24, 33,231,139, 49, 77, 73,127,173,186, 16, - 60,164, 18,127,223,171,200,195,184, 50, 10,200, 91,208, 9, 74,127, 22, 8, 20,184, 34, 92,223,101, 56, 31,140, 39,160,225, 48, - 58, 13,217, 0, 1,133,113,133,127, 63, 81, 32,183, 25,237,137,118, 81,140,211,165,215,157, 55, 59, 1,214,207,252,121, 36, 67, - 66, 28, 32,156, 65, 56,133, 80,139,148, 59,240,209,176,194, 74,255,184, 34,132, 54,201, 8,217,108,162,100,236,175,111, 21, 33, -149,195, 73,137, 41,189,228,110,186,255,128,114,116, 76, 49,216,229,250,135,222,225,213, 12, 46, 38,146, 9,217,241, 14,227, 87, - 95, 32,219,223, 70,207, 83,156,168,140, 95,100,240, 86,119,245,103, 95,147, 56, 67, 15,100,150, 60,255, 43,148,200,138, 83,194, - 96, 20,139, 92,129,138,149,230, 25,253,174,118,168,171,174,163, 42,225,207, 4,249,217, 50,171,221, 45, 53,190, 21, 9,211,123, - 48, 44,252,252,157, 13,141,108,125,223,248,179,194, 4,155,218,224, 78,179, 88, 27, 4,249,156, 19,182,118,181,243,170, 30, 65, - 99,101,131, 34,135,246, 86,131,241,195, 49,235,143,175,112,124,247,136,181,115,109,162,120,133,230,209,103,248,206,175, 11,231, -159,237,208, 88,203,136,100, 73, 90, 58,156, 22,136, 72,208,110,193,120, 71, 96,170, 70,195,129,206,253,181, 93,102,160,172,207, -111,111, 68,142,251,197, 58, 13, 49,103,148,206,120,246,202,163,232, 76,161,102, 6, 84,139, 8,137,148,138,205,213, 21, 52,134, -118,212, 34,158, 77,217, 25, 13,209, 69, 19, 71, 70, 28, 39,116,146, 51, 76,139,125,162,210, 25,186, 20,244, 86,207,112,114,184, -207,219, 62,248, 65, 26,107,125,112,138, 47,254,198, 39, 88,219, 56,195,185, 71,187,140, 6,115,214,207,183,137, 55, 46,113, 38, - 73,177,191,246,113,182, 63,249,187,188, 60,204, 81,207, 92,193,116,122,136,205, 51, 20,247, 30, 96,157,166, 57,155,113,254, 51, -159,229,189, 23,207,241,202,147,111,227, 68,103,244,215,207, 49, 60, 28, 16, 69, 49,153,206, 40,139, 28, 33, 99, 30,222,252, 50, - 87,222,246, 30, 30,188,246, 10,235, 23, 30,163,221,223,160, 56, 62, 36,207, 5,173,114,130, 45,225,230, 11,175,176,119,176,203, -249,243, 49,253,173,115,116,251, 13,202,178, 75, 94, 58, 30,222,223,229,127,248, 59, 63,198, 83, 31,248,230,218, 20, 97,193, 31, -174, 98, 25, 43, 41, 90, 35,156, 68,202,239,212,145,225, 38,143, 3,244,238, 22,208, 28, 22, 33,162,197,206,219,185, 96,167, 58, -193, 21, 37,233,224,152,124, 58,161, 76,115,140,209, 76, 15, 15,121,226, 99,223, 27, 46,233, 12,244,212,187, 14, 36,171, 64, 28, - 30, 35, 11,240,127, 4,131,155,184, 47,223, 32,123,240, 0,247,220,239,209,186,126,133,253,155,247,185, 49, 51,124,234,246, 30, -127,253,203,255,145,254, 83,239,100,254,224, 85,127, 32,199,145,159,238, 42,159,103,233, 3, 81,116, 81,224,230, 41,143,254,165, -191, 1,255,225, 23,161,213,244, 33, 56, 81,132,104, 38, 36,205, 6, 46,245,190,198,247,238, 62,228, 53, 7,131, 89,202,230, 74, -135, 23,178,156,189,223,253, 12, 31,200,178, 32, 27,211, 20,135, 59, 28,223,185, 31,220,184, 4, 82, 40,146, 24, 72, 11,116, 86, - 96,180, 65, 74,111, 38,130, 46, 22,120,176,181, 88, 93,250, 3,217,249, 28,227,232,194, 57,196,120,196,124, 52, 99, 48, 47,185, - 57, 79,131,206,180,196, 80,249,213,148,136,147, 33, 89,112,159,203, 71, 83,222,254,109,127,140,226, 15,254,144,219, 39, 67, 90, - 81, 68, 23, 69, 87,249, 27, 46, 51,150, 86,146, 48,213,154,134, 16, 60,210,238,243,242,201, 17,189,134,143, 82, 61,211,104, 83, - 58, 71,233, 28,177,148, 24,133,151, 32, 69,137, 63,145,226,216,127,191,145, 64, 25,133,153,158, 16, 15,246,177,107,231,248,139, -175,188,202, 15,181, 86,120,242,226, 22,211,249,156,220, 26,114,109,216,158, 79, 97, 50,230,242,218, 38,197, 60,245, 82, 36, 33, - 64,101,168,102,131, 89, 62,198,148,101, 24, 8, 68, 61,100,214,198, 29,161, 40, 75, 65, 13, 39, 46, 35,231,166, 42,196,149,142, - 61, 68, 79, 11, 81,201,145, 93,125,240, 88, 81,249,185, 7, 35,157,144,195, 46,171, 29,122,216,133,219, 55,193,242, 34,172, 2, -164, 12,100, 50,227, 95, 79, 57, 63,198,217, 18, 19,252,231,121,211,107,113, 70, 83,142,247,188,243,154,209,139,130, 30,194,131, -252,196,164, 79, 53,192, 44, 65,249, 42, 90, 16,170,108, 62, 11,172, 99,129, 16, 17,136, 38, 48,175,247,153, 34,200,162,194,229, -180,208,237, 87,178,191,208,184,212,125,247,146, 99, 94, 64,114,253, 96,159, 79,113, 54,171,173,109, 43,215,182, 96, 80, 31, 20, - 44,118, 65, 98, 80,106,137, 37,223, 8,127, 15, 68, 62, 99, 60, 33,171,242,120,168, 44,117,147, 38,182, 24, 47, 30,190,244,193, - 74, 86, 91,132, 43, 3, 42,163,124, 47,145, 77,188, 1, 76, 8,187,145,194,251, 61,136,184, 21,210,231,132, 71,201, 66,210,161, - 80,194, 55,101,194,235,204,177, 2, 25, 69, 97, 37,144,212,104,128,140, 61, 4, 47,100,228, 97,229, 56,241,234, 20, 7,229,100, - 72, 62, 30, 49, 63,216, 6,151,114,225,202, 58, 43,151,175,250,166,178,185,142,166,160, 24,166, 76,111,252, 39,202,169,241,205, - 84,133, 84, 84,234,138, 37,104,154,165, 41,187,190,122,237, 50,241,145, 58,202,119,153, 91,178,140,228,171,138,253, 30,184, 31, -181,121,141, 91,106,210,170,137,188, 62,119,171, 2, 29, 26,225,165, 72, 97, 28,167,118,242, 81, 80, 85, 84,215,158, 91,206,164, -180,167,165,107, 24, 87,251, 44, 32, 93,205, 93,145, 42, 66, 24, 77,163,219, 98,180,125,130,146,138,193,173, 33, 70,231, 28,189, -242, 26, 78, 23,232,179, 63,204,123,187,223,143,222,209, 8, 17, 97,202, 6, 91, 87,114,134, 47, 24,162,196,231, 49,228,218,175, -181,179, 19, 40,123, 14, 81, 64,158, 11, 82, 45,136,157,192,150,146,182, 42, 57, 22,231,249,173,217, 55,240,150,205, 13, 30,140, - 15,233,175,182,184,123,103, 64,183,223,165, 52, 26,155, 43,114,230,156,187,250, 8,119,182,111,178,126,225, 26,249,109, 80,170, - 69,167,145, 48,205, 10,230,122,204,172, 60,102,179,251, 24,209,165,107, 79,176,254,232,117,246,111,191,129, 83, 13,238,190,242, - 26,207,124,240,171,216,191,247,144,115, 23,183,184,254, 71, 62,200, 43,207,253, 14,105,156,242,246,198, 25,242,231,126,129, 87, - 95,122,133,131,169,165,247,141,223,200,133,175,248, 26,202, 50, 34, 61,222,165,211,105, 48, 60, 60, 96,125,107,141,233,164,160, -113,245, 49, 62,243, 59,159,228,209, 95,249,127,137,174, 60, 73,244, 61,223,204,237,223,253, 52, 73, 75,146, 52,219,228,101,193, -252,232, 33, 81,179,199,157, 63,252, 2,231,174, 61, 73, 49, 31,241,240,230, 45, 54, 46,158,167,209,233,115,114,112, 68,145, 69, - 88, 89, 82, 72,197,104, 92, 82,202,125, 86, 86,206,177,121,118,133,223,255,189, 63,228,111,254,228,143,243,182,175,251,246, 83, -144,187,171,152,217,149,123,148, 41,194,132, 94, 65,109, 69,229,242, 81,121, 21,134,130,174,170,203,227,212,132,238,170,223, 41, - 51,108,154, 83,206,199,228,163, 17,217,108,134,206,114,198,187,251, 60,245,157,127,124, 81,208,203, 33,228, 25,196,141,176,223, -140, 60, 20, 47,138, 64,137, 29,195,141,215, 41,140,163,252,233,159,167,245,228,101,238,127,233, 85, 94, 59,153,115,251,246, 46, -255,235,240, 54, 81,156,144,239, 63, 88, 16,115, 2,132, 36,157,195, 10,137,147,193, 15, 59,116,130,163, 89, 78,171,215,171,209, - 75,233, 28,104, 11,145,103,229, 22,179,148,247,255,249, 31,224, 3,127,235,135, 25,126,249, 5,254,175,255,241,175,113, 51,181, - 28, 25,195,224,179,159, 37,186,116, 9,138, 49,195,253, 61,140, 46, 72,154,109,172, 61, 65, 38, 13, 34,229,176, 69,134, 41,116, - 40,220,213,231,170,161,212, 16, 71, 62, 47, 59,176,159,227,181, 30,174,116,180,214,123, 76,239, 60, 96,102, 44,115, 99,120,180, - 21, 99,157, 36,213,154,150,148,104, 7, 67,109,112,113,196, 74,156,176,159,102, 92,217, 88,225,165, 95,249, 13,146, 94,139,110, - 20, 49,214,150, 92, 57, 70,218,223,244,165,181, 52, 10,131,116, 18,148, 34, 66,208, 79, 18, 86, 26, 93,134,217,148,161,206, 73, -173,245, 70, 45, 22,222,253, 77,239, 69, 31, 15, 80, 91, 21,252,106,125,252,104,168,188,214,148,184,135, 15, 16, 27,231,136,154, - 45,254,202, 39,254, 13,127,231,155,190,151,235,171, 29,214, 58, 29, 86,218,109,134,217, 12, 1,236,165, 83, 54, 7, 59,196,113, - 76,103,243, 28,178,209,160,177,190,193,151, 95,252, 77, 63,181, 85,192,248,178,189,230, 18, 78,236, 76,181,184,115, 11, 61,119, - 48,119, 89,252,140, 11,123,210,255, 44,109, 21,107,189,143,181,179, 14, 25,203,122,130, 17,203, 58,246,112,216,185,101,131,152, - 42,199, 71, 56,140, 94,154,128, 36, 20,243, 17, 74,152,224,209,190, 48,225, 48, 1, 10,117,214,161,167, 3,239,113, 45,150, 14, -108, 83, 89,225, 46,217,193, 46, 75,245,170, 44, 14,107,130,115,218, 34,208, 67, 32, 72, 86,175, 16,119,206,145, 29,126, 9,167, -103,117,250,156,172, 28,233,196,194,181, 78,212,112,237, 2,137,168, 10,189, 13,174, 58,145,148,245,122,193,215,106,189,208, 21, -214,112,186,215,123,123, 40, 61, 15, 59,244, 42, 10, 76,159, 86, 44, 4, 36,207,185,210,103,173, 7, 85,140,168,173,128, 13, 34, - 86,200, 82, 98,101, 28,144,192, 48, 89, 91,227,139, 71,236,139,135,138,171,253,120,112,190,179, 37, 50, 94, 4,185, 0, 72,171, -125,166, 65, 21,227,171, 2, 82, 24,156,230,164,140,252, 36, 30, 71,254,186,137, 98, 47,101, 85, 73,237,238, 38,156,192,169, 24, -178,140,124, 52,100,124,255, 54,229,244,132,134, 40, 56,251,236, 51,158, 29, 31,175,160, 26, 17,227,123,251,228,123, 15,209,243, -130,226,104,175, 78,210,115,213,117,235, 76, 8,147,113,117,146, 90,125, 29,134,244,192, 40, 92,203, 53,209,210,248,162, 91, 41, - 29, 85,197, 73, 10,176,188,177,118,201,133,206, 45,174,123,170, 70,216,157,138, 6,172,224,118, 92,152,202,151,236, 16, 22,222, - 67, 11,248, 93, 27, 91,255,127, 17,248,144, 98,201, 82,182,234,170,189, 82, 35, 40, 26,196, 34, 89,144,192,236,183,121, 6,133, - 37,105, 52, 49,197,140,184,189, 66,147, 38,197,124, 74, 57,154,179,254,244, 87,208,254, 98, 7,189,215,195,150, 57,236, 27,122, - 61, 69,220, 48,152,202, 97, 81,251, 41,189,204, 2, 49,213, 9,138,212, 81,196,146, 21, 97,152,202,132,159,207,190,149,121,126, -137,149,104,155, 94,167,141, 24,245, 25, 28,204, 17,141,146,102,175,197,228,160,164,223,145,152,163,146, 7,183, 14, 72, 75, 56, -112, 3,134,147,130, 86,220,166,112, 26, 21, 9,122,226, 44,163, 50, 71, 88,131,204,115,199, 23, 62,241, 9,110,124,230, 51, 76, - 14,118, 16,162, 96,188,115, 15,231, 36,103,175, 63,195,254,221,135, 60,245,177,143,240,149, 77,203,171,255,240, 31,242, 7,251, - 19,220,135,191,149,179, 63,240,231,217,122,215, 7,153, 31, 30, 51,188,247, 42, 78,151, 20,165, 37,138, 91, 88,217, 4, 25, 49, -220,222,102,229,226, 85,142,254,252, 95, 38,251,210, 23,225,183, 62,133,232,173,145,207, 14, 17, 81,140, 53,138,246,202, 22, 73, -179,197,206,253, 61, 76, 62,197,148, 26, 21, 21, 28, 61,188,237,153,162,113,204,206,253,187,158, 41, 42, 21,187,131, 41,206, 26, -166,179, 57,247,239,220,227,175,255,196, 63, 56, 85,208,235,189, 90,237,250,107, 66,225,142,253,127,213,212,238, 22, 68, 30,170, -124, 99, 89,217,169,198, 75,251,185,165,130,174, 51,138,195, 61,102,135,123, 12,183,183,153, 15,135,216,162,100, 62, 25,179,245, -246,119, 18, 53, 90, 30,114, 47,134, 48, 29, 67, 81, 4, 19,133, 70,176,148,157, 46,158,243,222, 13,116,102,152,255,244, 79,211, -184,116,142,193,107,247,184, 59, 76,121,120,123,151,255,110,116,151, 40, 73, 48,243,153,159, 32, 2, 91,155, 40, 70, 68, 18, 39, -131,195,221, 18, 14,170,243, 18, 61, 56, 98,250,228,123,144,211, 9, 78,151,120,106,159,243,110, 99, 97,129, 85, 74,199,116,127, -143,185,106,243, 87,127,229, 23,121,186, 37,152,118, 59,252,189, 31,253, 9,214, 46, 61, 10,186,192, 26, 71,103,125,213,103, 64, -231, 37,173,254, 10, 82, 79,177, 89, 73, 89, 20,148,185,198,164, 57,170,213,129, 60, 95, 72,218,132,223,249,137,102, 3,217,235, -163,250, 61,244, 96,196, 78,154,241,198,112,198,217, 78,194, 73,110, 56,201, 11,134,165,225, 97, 81,114,172, 53, 7, 90,179,175, - 45,163, 60, 39,199,241, 70,154,113,229,169,199,200,157, 99, 98, 44, 78, 64,110, 29,169,117,204,140, 69, 59,193,106,220,224,106, -183,207,149,238, 26,119,230, 83,218, 42, 38,211,154,113, 81, 50, 42, 75, 86,163,132,110,146,144, 22, 5,107, 23,207, 98,103, 41, - 20,165,135,220,195,212, 43, 2,156, 27, 69,138,114,251, 30,236,111, 3,240,216, 31,251, 14,254,233,209, 3,222,247,109,223, 68, -223, 56,218,165, 37,154,149,184,113, 70,156, 90,116,225, 16,153, 65, 21,150, 70,183, 3,243,130,243,127,238, 47,122,201, 92,181, - 23,117, 75,218,219,170,160, 90,183, 32,245, 84,225, 17,225,132,172, 6,164,138,180,179,144,143, 45, 14,217, 26, 68, 90, 98,182, - 87,174, 95,206, 45,195,148,139, 6, 65, 4, 75, 90,177,228,209, 45, 68, 21,221, 89,101,192,155, 48, 25,157,246,112,168, 38,127, - 63, 57,229,161, 88,185,165, 44,117,175, 93,183,122,241,252, 53, 81,174,154,188,148, 96,177, 0, 93,138,104, 21, 2, 91,102, 20, -179,135, 88,147, 5,151,178, 5,172, 47,165, 92, 50, 41, 9,166, 38,132,105, 95,219,186,105,112, 97,167, 90,229,216, 99, 12, 14, -139, 30,222,247, 38, 38,182,130,210, 61,193,172,142,235,115, 58,164,178,121,207,119,191, 7,177, 11,202,180, 11, 77,129, 13, 76, -232, 64,128, 18,213,148,143,171,247,243, 54,188, 24, 83,204,195,227,134,247,173, 68, 77,188, 21, 81,236, 7, 11,103,131, 10, 64, - 34, 85, 99,209,185,201,168,230, 33, 84, 48, 58, 72, 68,220,244,197, 59, 10, 25,235,177, 87,225, 40, 21,123, 59, 88, 21,251,239, - 82,121,120,222,225,124,240, 71,153,162,103, 51,230,131, 3,210,147, 67, 54, 46,109,210, 62,115, 14, 23,121,147,165,217,241, 33, -243,219, 55,153,220,124,145,242,228,152,114, 60,193,230,153,191, 76,173, 91,242,106,115,181, 77,176,245,195, 60,165,117,104,187, -200,181,215, 14,202, 80, 76,171, 72,225, 16,219,224, 77, 86, 74,187,152,154, 43, 55, 68, 23,108,147,195,189, 96, 43, 20,164, 34, -188, 73, 78,121,196,187,165,101,126,229,117, 96,157, 55,137,178, 46,252, 23,158, 88, 84,247,151, 89,250,123,136, 62,174,238, 35, - 83, 25,217,132,235,198, 45,201, 64,133,115,216, 60, 69, 8, 75,212,108, 49, 61,153, 34, 98,139, 41,189,226,163,187,185,193,209, -253, 67,210,254,117,138, 61,135, 62, 82,148, 99,139,217,139,104, 70, 18, 51, 17,216, 20,204, 56,132, 17, 42, 71,150, 57,138,194, - 97, 21, 36,218,242,235,246, 3,252,204,236, 59,176,162,164,231,246,184,212,123,140, 89,225,249, 58,211, 60,197, 24,195,254,158, - 65, 27, 9,165,247, 33, 24, 14, 51,166, 19,205,254, 65,138,138,161, 21, 75,110, 28,190,196,195,201, 29, 70,122,202,133,238, 89, - 82, 61, 34,154, 14,142, 56,119, 97,131, 71, 63,250,205,152,116,226, 13, 73, 38, 99,242,163,251,236,140,199,188,229, 43,159, 97, -246,179, 63,206,239,254,246, 23, 89,249,214,111, 33,215,150,220, 20,216,189, 59,176,118,201, 67,145,214,144,143, 7,204,142,119, -233,172,175,177,251,198,235, 12,119,239,179,126,238, 12,142, 24,179, 95,146,254,233,239,101,246,119,255, 41,238, 47,252, 0,101, -233,176,165, 38, 73,154, 62,143,216, 10,206, 94,186,204,157, 23, 95,224,194,147,207, 18,119, 26, 28,223,124,200,163,207,172, 48, - 25,231,164, 69, 70,170, 61,203,252,120, 92,112,165,212,108, 31, 30,113,237,233,183,241,206,175,255, 78,156, 43, 16, 34, 57,253, -229,139,210, 51,179,133,162, 22,132, 58,177,216,153, 85, 84, 93, 91,165, 67, 68, 32, 34,196, 41,233, 75,245, 39,135,116, 74,113, - 50, 32,155, 76, 40,103, 25,174,208,100,227, 49,243,188, 96, 54, 56,225,169,111,249,227,158, 76,147, 30,194,201,145,127,220, 78, - 27,162, 38, 2,133, 51, 71,190,248, 37, 61, 24,110,227,238, 60, 36,189,255,144,228,228,132,172,209,224, 15, 31, 28,240,198,253, - 67,254,196, 75,191, 67,210,106,163,167,147, 5,110, 36, 36, 82,200, 96,212,228,189,146,173,211,254,159,140,163,217,237,208, 72, - 34,244,172,205,254,116,198, 90,184,249, 85, 98,136,227,188,150,193,171, 56, 70,117,187,232,241,148, 86,191,199,235,183,238,242, -183,255,253,207,242,125, 31,250, 94,110, 76, 44,131,135,247, 88,123,252,154,247, 53,207, 11,134,249, 1, 18,104,118, 87,136,220, - 14, 38, 43, 40,231, 5,198,106,132, 41,144,205, 38, 20, 33,161, 77,137, 5,251,182,219,242,198, 29, 77, 69,212,110,112,245,220, - 58,147,135, 71,124,234,112,124,202,148,101, 25,118,211, 97, 74,107, 4,206,192,157,251, 59,196, 81, 68,137, 35, 15,185,226, 74, - 10, 46,198, 77,180,133, 39,251,155, 28,101, 51, 30, 76,134,204, 49, 52,149,162,163, 18,154, 81,132,212,154,189,188,160, 27, 41, - 30,187,118, 30,185,178,234, 15,218, 72,249,168, 76, 25, 33,172,241,121,226,218, 32,210,194,195,142,111,220,192, 53, 18, 88,221, - 34, 94, 63,195, 87,255,204, 47,224,246,246, 96,120,130,213,101, 96,107,135, 9, 41,137,188, 0, 53, 78,176,206,177,213,237,157, -214,203,214,210,111,199, 82,234, 69,125,176,185, 55,193,239, 34, 16,133,234,157,119, 40,196,146,101,159, 23,183,208,146, 59,177, - 20,238,178, 84,208,101,216, 87,214, 10,141, 69,241,173,246,148, 66, 46, 69,105, 86, 63, 90,113, 80,224,148,118, 93, 10,150,246, -141, 11,159, 17,177,212,180,136, 72, 44,189, 7,111, 3, 90,219,120, 7, 89, 18,129,229, 46,234,180, 56,131,158, 62, 12,108,110, -183,240,248,182,224,162,197, 69, 82,155,240, 24, 91, 39,122, 85,169,109,213,155,151,145,168,173, 71,145, 18, 21, 26, 94, 87, 69, -173,170,224,247, 94,145,238,170, 47, 71,186,176,134, 51, 11,200,164,134,117,151, 36,173, 38,156, 17,200,154, 14,230,172, 9, 89, -240, 30,249,177, 70,163,148,194,226,157,222,164,140, 48, 69,225, 93,241,150,209, 62, 23, 54,205, 81, 28, 32,238,200, 55, 44,198, -248,181, 80, 80,128, 8, 21,123,227, 24, 41,145, 66, 5,232, 93, 32,226, 24,169,188,107,156,138,226,176, 67,151,254,123, 87,177, - 47,144,133,166,152,140,201,198, 3,138,233,132,200,229,180,250, 43,136, 56,193,210, 66,207,198, 76,111,190,196,252,246, 29,242, -221,123,148,211, 25,198, 58, 92, 94,134,107,204, 83, 39,117,224,124, 88,231,208,222,125,130,200,128, 97, 97, 68,148,227,136,131, -198, 60, 51,126,116, 81,161,105,118, 54, 0,120,206,219, 27, 83,179,221,253, 4, 91, 27,208,212,158, 13, 11,210,114, 69,130,171, -214, 54, 98,121,183,238, 22,236,247,106, 5, 83,223,111,102, 49,145,187, 37,102,124,245,249, 87, 54,180,111,246, 89,168,155,230, - 74,138, 23, 9,202,116, 68,210,117, 36,205, 30,182,144,180,207,173, 32,163,136,131,123,187,204, 70, 95,226,222,234,159,230,202, -244, 31,211,109,207, 73,167,138, 50,135,142,141, 56,153, 25,116,100, 60, 63, 33, 5,237,252,103, 41,173, 64, 72,203,111,159,249, - 17, 46,232,148,193,254,171, 92,232, 93,227,100, 54,231, 36,155,178,213,238, 34,109,196,246,104,159,102,210,102,163,233, 61, 80, - 84,226,144, 22,218,205, 38, 77, 90,200,100,204,209,120,128, 18, 9,177,106,146,235, 57,171,205,156, 76,107,148,108, 32,147,102, -131, 52, 53,220,121,225,121,222,120,241, 85,238,191,250, 26,123,119, 31,144,166, 37,111,253,240,123, 56,248,223,254, 6, 47,127, -233, 53, 58, 31,253,102,102, 81, 11,155,206,201, 78,118,232,174,156,225,232,254, 13,156, 43,152, 13, 15,152, 79, 14, 88,189,112, - 9,169,154,148, 90,211, 93,221, 4, 23, 81,228,115,230,179, 41,114,255,144,213,159,248, 81,230,255,228,103,105, 94,184, 70, 62, -159,130,181,140, 7, 7,168, 40, 97,227,252, 25,186,155,107,140,142, 15, 72, 84,139,254,217,117, 70,251,123, 56, 96,109,173, 67, - 44, 12,115,157,179,218,111, 32, 68, 76,123,101,149,191,244, 79,126, 14,107,211, 37,169, 88,229, 6,164,125, 65,175,181, 66,225, -104, 20,122, 41,120,164,172,195, 3, 60,254, 18, 5,136,220, 45,177, 45, 45,206,206,160,152,163,231,115,242,241,132,114, 54,103, -126,114,204,244,100, 72, 94,148,204, 15, 15,121,215, 31,255, 51,254,177,230,187,176,183, 7,243,212,119,232, 73, 12,244,112,118, - 2, 69, 26,240,160, 28,182,239,147,151, 80,254,210, 47, 67,191,199,203, 95,190,199, 40,203,120,255,223,252,115,172,190,245, 43, -209,243,233, 2,116, 13,204, 98, 91,225, 72, 21, 68, 21,188,151, 91,171, 43,188,248,220,115,124,245, 71,254, 18, 95,251, 93,255, - 19,179,193, 9,244, 86,113,210,161,164, 34, 78, 34,175, 21, 77, 98, 84,156, 96,180,195, 88, 31,123,185,178,210,229,249,219, 67, -126,232,219,222, 71,137,224,227,255,226, 95,163, 58,125, 84,148,160,117,137, 46, 75,162, 86, 15,213,106, 64, 49,195,100, 37,233, -120, 78, 49,247,118,178, 34,105,122, 52, 66,235,133, 91,172, 84,200, 86,203,147, 65,210,156,168,239, 37,131, 23, 90, 13,122,177, -242, 61,212, 18,196, 40, 68,165, 13, 16, 20,118,161,123, 86, 81, 84, 45, 80,124,207, 16,138,213, 73, 89, 48,178, 57,191,127,176, -205, 75,163, 1,251, 58,231,184, 44, 56,202,114,146,176,131, 44,177, 88, 9,145,118,188,235,123,190, 5, 45, 21,162,223, 71, 8, - 79, 44,242, 46, 89, 6, 49,155, 35,210,153,159, 10,138, 2, 59, 25,193,246, 61, 24, 28,122, 95,122,103,224,236, 89, 56,119, 6, -217,111, 19,157, 59,131, 58,179,137,220, 88,133,126, 31, 26, 13,232,118,145, 43,171,168,102,155,111,248,131,111,242,237,196, 0, - 0, 32, 0, 73, 68, 65, 84, 33,155,239,251,112, 96,250,138, 37,237,197,178, 4,200,249, 3,116,217, 44, 99,121,106, 95,134,205, - 43,121,142,228,212,142,218, 46, 77, 34,203,116,221,186,248,202, 37,153,206,114, 7,181,120, 9,117,225, 22,203,108,120, 81, 41, - 56,151, 80,170,165,223,115,246,180, 73, 88,253,218,173,245,211,141, 91,144,142,107,157,156, 76,144,255, 63, 93,111, 30, 37, 89, -118,215,119,126,238,189,239,189,216, 51,114,173,172,234,170,234,234, 77,106,169,105,181, 22,104, 75, 72, 72, 66,128, 5, 6,219, -224, 1, 45, 72, 24,121, 60,172,246, 0,182,135,193,216,230, 48, 11, 94,176,199, 11, 54, 48,246, 88,216, 99,123, 12,104,192, 30, -140,125, 96, 0, 33, 22,129, 16, 13,162, 37,181,122,175,174, 53, 43, 43,247,216,227,173,119,153, 63,238,125, 17, 81, 61,166,207, -233,211, 75,101, 85, 84,101,188,184,247,183,124,191,159,111, 99,109, 49,178,240,227,212, 37,114,207, 89,235,119,155,245,239, 33, - 48,205, 23, 65, 48,178, 78,129, 99,177,222,169,187, 53,161,150,220, 61, 23, 38, 1, 98, 33,206,115,216,217,204, 23,235,193,234, -134, 82,139,156,248, 69,155, 86, 7,115, 47,140,206, 53,236,101,121, 62,184, 69, 82, 72,232,212,173,198,133,243, 99,233,173, 87, -161,115, 14,197, 80, 28,213,187,135, 16, 33,106,254, 43,205,130,197, 86, 19, 31,169,170,181, 95, 81, 72,225, 11,227,184,225,153, -237,210, 51, 31, 68, 32,197,169, 40,241, 63,150, 52, 17, 42, 66, 68, 13,144, 49, 66,198, 33, 29,205, 97,116,201,236,238, 30,211, -187,183,145,213,140, 86, 2, 81,183,227,135, 22,105,202,240,217,223, 39,125,229, 11,164, 55,159, 65,159, 29, 97, 42,131,115, 2, -227,108,208, 13,121,175,120,169,125, 71,174, 29, 84,193, 21,154, 89, 71,110, 44,153,131,153,241,248,216,153, 49,140, 52, 76,181, - 35, 55,190, 56,205, 42, 71,105,253, 25,229,132,160, 48, 33,139,209,201,133,162,221,217,208, 93,215, 22,182,176,186, 16,225,124, - 19,193, 62,103, 3,111,222, 90,135,113,206,115, 14,194,103, 64,155, 21,116,109, 93, 40,175, 6, 2,185,165, 47,125, 1, 51, 10, -239,167, 93,164, 25, 46, 3, 94,252,151,249,103,232,228,133, 87,152, 29, 77,112, 34,166,187,211,161, 42, 11,102,147, 1,219, 15, - 94, 64, 79, 83,102,233, 69, 94,236,253,115,126,254,185,239, 34, 31,119,104,152,130, 68,196,180,144, 20,195,136,116,232,161, 51, - 14, 40,140, 36,146,134, 95,144,223, 74,115,126,157, 52, 45, 56,215,189,140,209,130, 78,187, 75,171,211,224,206,224,140,145,153, -210, 80, 13,154,162, 69,183, 39, 25,100, 99, 78,134, 99, 54,122,231,124,200, 13,142,193, 36,103, 82,140, 24, 22, 35, 98,169, 72, -162, 22,115, 93, 81,153,146,194,102,200,108, 50, 67, 74,152, 13,142,153, 28,239,115,238,210,121,154,173, 54, 79,252,233,175,228, -248,123,190,139,253, 70,151,249,229,215, 51, 23, 5,170, 42,184,240,192, 21,186, 59, 15,145,229,154,249,228,152, 70,187,205,100, - 56, 97,118, 54, 97,255,217, 79, 34,147, 22,107, 27,155,172,157,219, 69, 91, 75, 20,197,244, 54,183,233,108,159,103,120, 60, 97, -253,235,223,206,244,149,151,176,182, 66, 59,139,206, 11,210,201, 8, 21, 9, 58,253, 11, 8, 17,115,188,119,155,254,230, 54, 85, - 41,176,101, 73,187,155,112,249,202,101, 30, 58,183, 69,167,221, 97, 56,154,241,247,126,225,183,125,154,142, 32,248,190, 87, 78, - 46, 91, 45,241,149, 50,136,162,156, 89, 98,140,116,232, 46,117, 16,202, 41,229,211,208, 22,135, 91, 77,122,203,124,112, 75,158, - 81,140,134, 20, 89,202,124, 48, 66, 27,139, 54,154, 50, 77,233, 93,126,128, 70,103, 13,167, 15,225,246,109, 63,118,215,149, 31, -187,199, 1,106, 81,141,234, 86, 25, 6,119,177,251, 71,100, 55,110, 16,151, 37,119,174,221,225, 8, 56, 43, 43,222,252,119,126, - 18, 61,217, 91,185, 10, 22,143,120, 16,162,185,133, 15,185, 70, 40,166, 39, 71,124,203,255,244,179,188,227, 29,239,229,253, 95, -247, 97,222,254,237,127, 23,217,235,226,170,202,163, 34,163,216, 83,168,156,247,243,175,111,111,176,185,185, 73,187,215, 71,107, -139, 46, 50, 30,122,255, 55,211,199,241,107,159,123, 14, 98, 69,149,165,139,244,171, 40,110,121, 26, 95,145, 98,117,201,104, 56, - 69,151, 94,131,110,198, 3,116, 16,199, 17, 70,157,178,209,196,197, 49,214, 25,156, 46, 97,125,147,217,217,132,212,216,197,200, - 77, 59,139,113,222, 36, 84,177,224, 71,160,195, 30,215,214,106,113,159,168, 78,163, 78, 88, 66,144, 58,139, 14,190, 2, 33, 4, - 70, 56, 26, 82,209, 75, 98, 42,107,209, 66,114, 50,159,115,174,211,226, 27,255,183,191, 78,213,136,137,250,235, 68,253, 13,228, -122,215, 95, 16,217, 12,178, 20, 97, 28, 66,123,176,136,108, 68, 94,252,166, 20, 20, 51, 24,159, 66, 58,129,217,153,143,123,189, -255, 17,216,217,133,254, 58,116,187,208,108,222, 51, 86,174, 73, 88, 95,242,147,255, 33, 92, 30, 43,221,195, 61,166,222,101, 72, -133, 91, 90,127, 23,113,169, 43, 32,212, 37, 96,198, 44,213,191,222,114, 38,238,217, 45,215, 60,108, 27,118,201,190,203, 95,130, -105,220,202, 11,249,213, 67,144, 67,132,200,209,186, 59,175,147,173, 22, 95, 47, 91, 72, 17,175,208,191,220,171,126,159, 43,222, -229,250, 64,174,151,174,198,119,191, 73,239, 2,113,239, 60, 46, 92,164,181,103,216, 11,255,150,234,118, 81,143,109,130, 58,206, - 89,235,213,244,206,135, 7, 57,233,150,118,105, 89,179,191,221,114,173, 33,237, 61,138, 41,151, 79,188, 40, 79, 36,203, 66,190, - 30, 21, 44, 61,112,161,138,176, 43, 70,253, 32,124,112,225, 89,168, 75,203,197,239, 13,255, 92,219, 16, 22, 35,213, 10, 80, 42, -200,185, 84,248,181,149,100, 69,121,232, 39, 69,216, 96,237,242,147, 9, 81, 39,149,169, 16,203, 41,149,199,190,170, 8,169, 66, -218, 90,236,121, 15,170,209,242,209,170,113,130,140,252, 88,222, 23,102, 14,153, 52,125,103,170, 13,122, 54,103,122,116,151, 98, -116, 68,171,225,216,121,232, 50, 81, 18, 97,116,196,228,250, 51, 76,127,247,183, 72,175, 94,167, 56, 58,161, 74, 51,180,214, 94, - 31, 96,125,129,141,133,204, 56,180,129,202, 89,114, 39, 40,181, 35,119, 48, 46, 44,163, 82,144,250, 33, 23,103,133,101,160, 35, -230,218, 39,213, 74,231, 24,229,134,212, 90, 52,160,141, 99, 86, 90, 74, 43,168,140, 69, 56, 67,165,125,204,242, 98,228,237,238, -205, 66,192,248,149,161,199, 75, 4, 5,123,229, 22,105,135,216,149,245,149, 91,137,231,168,137,222,193,223,142, 93, 89,117,213, - 63, 47, 4, 27,213,150, 58,159,107,224,252, 57, 22,124,242, 14,137,209, 16, 87, 16,199,130,181, 11, 93,170, 50, 99,116,109, 64, -146, 52, 40,166,115, 26,155,231,201, 38, 99,154,106, 78, 71, 74,126,121,240, 67,252,206,254, 59,233,183,115,154,145,162,165, 36, -177,147,100, 90, 98,157,163, 43, 43,126,197,189,143,158,201, 25, 78,115, 14, 50, 79, 84, 93,235, 53,144,192,124, 58,163,172, 50, -250,170,131, 16,146, 97,126,202,209,208, 7, 95, 13,203, 51,110, 14,175, 17,183, 45, 81, 35,103, 61,217, 33, 51, 37,218, 85, 68, -170, 65, 67, 53, 40,203,148, 65, 53,164, 23,109, 17,201, 40, 38,157,150,116,155,130,164,177, 1, 68,180,238,219, 70,125,226, 23, - 56,185,120,145,193, 76,240,150,111,122, 31,179,227, 99, 78, 14,238,112,124,247,128, 40,150,168,164,143,214, 17,101,122,194,229, - 71,223, 68, 58, 59, 69,207, 15,200, 38,199, 56, 39,152, 15,207,152,143, 79,112,186, 64, 53,123,180, 90, 45,140,145,240,240,235, - 72, 38, 39,148,198,210, 74, 34, 82, 33,169,170,156,227, 59, 55,217,185,255, 81,210,193, 85,122,231, 47, 50, 60, 58, 36,238,118, -184,254,252, 13,156, 48,108,239,236,240,123,207,222, 97,255,112,159, 79,223, 61, 9,159,201,114, 65,102, 91, 50,221,115,127, 89, - 71,201,146, 61,185, 24,213,213, 59, 65,185, 28,199, 69, 75,124,228,226,160,196,128,205,112,197, 28,167, 13,243,131, 3,178,209, -144,114,158,146,167,115,102,195, 49,218, 88,198, 39, 39,188,247, 91,190, 3,231, 70,176,119,155,242,244,152,168,211,241, 85,186, - 16,144,172,129, 29,251, 79,138, 12,246,149,189,219,148,165, 65,255,250,199,145, 73,204,254,112,198,254,157, 19,190,237,214,139, -216,236,208, 95,252,149,246, 73, 65,118, 5, 34,142,103, 76,251, 7,212,248, 17, 81,172,248,220,167, 62, 71,178,213, 99,167,183, -207, 63,250, 55,255,132,191,248,190,191,192,207,253,210, 39,249,240, 87,191,131, 60, 77,137, 34,229, 43,197,188, 32,105,183,120, -211,123, 62, 64,236, 26,124,237,155, 46,243, 3,127,243,123, 41,175,221,100,214, 59, 71,188,209,229,214,254, 25,122, 58,163,156, -142, 65, 91,180,174,144,194,231, 50,187,116,142, 78,115,210, 73,138,164, 98,243,220, 54, 78,231,126,127, 7, 8,163, 49, 54,120, -193,133,196, 26, 48,243, 12,241,200,253, 76,178,140,125, 3,153, 3, 77, 64, 71, 90,238,217,117,173, 30,141, 46, 28,168,149,214, -139,145,180, 14, 51,178,134,144,232, 32, 90,110,202,152,150,148, 16, 43,186, 81,194,104, 58,103,110, 45, 31,248,240, 55,240,200, - 87,124, 57,217,224,148,168,217, 36,238,118,161,221, 66,198, 13, 95,112, 69,145, 95, 27, 56,139,104, 37,190, 27, 82,254,240,164, -202,160, 12, 8,224, 60,245,207,202,100,128,171, 12,244,214,161,179,238,163,107,165,128, 42, 95, 90,100, 16, 94, 8,133,227,161, -143,124, 47,215,254,245,143, 45, 81,154, 11,192, 76,189,196, 91,250,114,107,134,110,221,217,215, 98, 54,108,216,103,202, 90,231, - 85, 91,204,194, 35, 17,116,138, 94, 30,237, 22, 35,239,122,108,191, 8,115,177, 75,184,199, 98,151, 29, 88,219, 50,144,186,144, - 75,116,113,221, 5,251,164, 55,139, 53,101, 40, 20,150,247,160,170,253,188,171, 25, 10, 74, 44,212,231, 70, 59, 84,228, 95,212, -148, 83,116,122,138,208, 85,240, 90, 47,119,231,206, 2, 81,195,167,104,185,124,197, 10, 96,131, 8, 80,172, 68,121,174,120,137, - 87,192, 57, 78,248, 46, 79, 70, 50,176,227,125,177,203,112,184, 68,196,214,137, 47,194, 6,229, 90, 30, 46,251, 87, 45, 83,169, -131, 95,130, 66,126,209,185,135, 51, 68,151,158, 70,104,204,194,130,230,172,246, 98, 55,235, 47,250, 69, 71,238,252,196,193,217, -202,211, 42, 77,137,160, 25,146, 9, 45, 18,231, 51, 0,162, 40, 4,150,196,200, 72, 98,141,244,190,245, 40,246, 83, 6, 25,194, - 69,164, 31,187, 35, 37, 50,110, 46,118, 46, 34,124,222,106,237,133, 46, 50,138,201, 25, 39, 47, 60, 67, 54, 60,230,202,123,191, -148,245, 7, 46, 99,136, 81, 89,206,217,111,254, 58,233,221, 67, 42, 43, 48,165,166,168, 12, 6, 71, 4,164,198, 63,115, 26,239, - 28,201, 67, 23,108,156,163,114,130, 76,107,166, 70, 18,227,104, 57,199,160,242,160,160, 68, 58, 26,194,161,132, 99,162, 29,218, - 65, 59, 86, 72,231, 72,129, 36,146,180,140,246,207,180,132, 56, 76,114,106, 0, 82,141, 64, 86, 11,221, 66,248,118, 91,139, 18, - 98,225, 2,113,206, 46,179, 98,220,210, 9, 97,141, 11,104,124,183,120,254,234,134,221,216,101, 84,172, 39,200, 89,191,158,145, - 75, 7, 7, 43,209,189,117, 2,157, 0,230, 7,175,208,126,243, 59, 57,189, 53, 32,150, 29,218,235,125,162,110,204,252,100,196, -133,203,151, 41,244,140,195,235,123,184,246, 38,151,214,166,220,189,246,165,252,235,171,175,225,235,207,253, 91, 92,101,144,153, - 47, 46,158,173,214,120,165,241, 77,116,149, 36,161,100, 54, 29,224,162, 38,182,178,156,142,231,104,235,208,206,209,137, 55, 41, -141, 38,145, 45,182,251,231,184, 59,191, 78, 85,105,148,104, 16,203,132,163,201, 17, 45,149,176,182,158,208,155,110,210,105,182, -209,182,192, 10, 69,166, 51,242,106, 70,149, 84, 68,186, 42,137, 99,191,227,216,186,124,137,171,207, 93,229, 29,253, 51,110,124, -246, 5,246,174, 29,242,224, 95,248, 46,110,124,246, 25,140, 51,148,233,140,116, 62,198, 84, 51,182,207, 53,104,174,157, 99, 62, - 56,161,187,187,137, 74, 58, 76, 6,138,102,145, 83, 25,131,140,155,172,237, 92,100, 58, 60,165, 44,114,182, 46, 92,225,232,230, -117,100, 35,194, 9,133,208, 37,185,153, 17, 53,122, 76,142,239, 32, 68,139, 59, 47,127,134,118,255, 28, 2, 71, 85, 85, 52, 58, - 27,108,157,219,224,183,159,122,158,183,175,175,113,251,248,140,127,252,209,127, 65,220,238, 7, 24,132, 12,187,244, 90, 41, 91, -121,170,153, 82,161, 67,183, 43,192,236,101,202,143, 87,185, 74, 79,151, 66,222,211,165, 47, 12,209,186,192,230, 5,249,104, 64, - 62,155, 80,165, 25,233,120,138,214, 21, 42, 74,184,251,202, 75,124,205, 15,253,109, 28, 41, 76, 78, 73,159,125,137, 10, 67,167, -217,240,218,151, 94,207,131,102,202, 65,120,189, 4, 70,199,216,147, 33,249, 96, 76,124,116,202, 81, 90, 48,140, 21,235,143, 61, - 68,231,226, 67,152,217,221, 48,254, 90,218, 70,132, 88,142, 27,151, 29,186,197,104,223,229, 68, 18,156,182,124,230,153, 47, 48, - 41, 74,126,227,227,191, 64,245,166, 47,230,207, 55, 19,136,114,100, 35,241, 29,163,112, 24, 33,121,203,155,223,198, 27,206, 93, -228,115, 55,134,252,201,247,255, 85, 62,241, 31,127,130,155,215,110,241,208,151, 60,198, 51, 31,255, 3,102,227, 51, 76,165,177, -101, 69, 57,155,145,172,111,250,103,190,200,189, 24,207, 56,138,193,152,246,187,222,136,158, 77,137,218, 29, 68,164, 48, 69, 30, -196, 72,145,247,126, 23, 62, 64,166,121,223,121,118,118,182,152,141,166, 20,186, 68, 91, 77,110, 5,107,210,167,140, 13,131, 26, - 86,134, 4, 57, 39, 4,133,214, 92,220,236,115,245,120, 64, 34, 34, 76, 29,244, 1, 52,164, 36,145, 18, 45,252,184,112, 52, 43, -152, 59,205,195, 23,206,241,238,111,255, 70,174,188,253,237,148,227, 17, 69, 54, 69, 52, 19,212, 90, 15, 90, 13, 84, 28, 35,156, -197, 89,131,203, 52,162,209,244,223,208,178, 66,226,173,104,228,133, 95,157,184,145,239,196, 27, 45,207,250,143,154, 32, 13,228, - 83,200,231,222,223, 28, 41,104,173, 65,171,227,133, 84,245,144, 72,107,238,127,223,183,115,253,255,252,177,149,144, 22,127,128, -219,250,253, 12,150,183,122, 55, 94, 11,235,164, 88, 38, 8,212,135, 77,157, 59,110,107, 85,121, 16,191, 9,185, 20,163,201, 85, - 79,124,109,125, 91, 85,195,175,136,239,236,170, 82, 94,213, 69,111,200,182,119,122, 69,169,111,125, 38,130, 91,209,143,213, 19, -137,208,169,203,240,226, 14,159, 82,230,240, 73, 92, 11,166,183,113,184,108,176, 56,165,197,202, 30,211,135,179, 68, 52,187, 23, -177,213, 4, 83,100, 11,251,218, 66, 3, 16,246,243,224, 16,166,214, 28, 56, 95,208, 32, 16, 81, 40,124,165,247, 64, 91, 43, 80, -202,249,125,181,179,168,110,127,105, 75,195,132,253,121,181, 92,199, 57,179,244,191, 59, 29,196,180, 44,213,242,248, 24, 98, 84, - 12,104,172, 41, 80,180,177, 43,251,124, 17, 10, 3, 41,193, 56,187,248,222, 58,194,254,220, 89, 48,213, 2,217, 42,163,196, 39, - 44, 74,223,133, 99,212, 82,120, 79,132,140, 37, 66,196,136,164, 17,166, 45,126,159, 46, 98, 5, 81,228,105,123, 81,178, 16,215, - 9, 17,138, 31, 7, 46,207, 40,135,103,100,131, 83,142,174,223, 96,107,163, 69,123,107,195, 23,156, 70, 50,120,234, 87,201,142, - 78,200,210, 28,129,196, 58, 75,101,172,119,210, 56,199,180, 50, 62, 6, 55,140,219,199,149, 35,150, 10,227,252,106,236,160,240, -151, 99, 39,130,125,173,252, 36,214, 25, 58, 18,180,115, 52, 66, 97,186,214,140, 73,181, 37,195,227,109,219,214, 96,176,254,162, - 87,146, 50,168,230, 5,203,124,131, 26,166,228,140, 67,135, 9, 83,141,140,173,173,110,198,172,248,211,196,146,192, 88, 63,235, - 11,142, 83, 16,126,152, 48, 25, 92, 21, 96, 10, 88,132,105, 81,107,117,130,192,112,193, 33,139,252,123,155,157,190,130, 27,188, -145,214, 90,139, 42,183,100,243,156,236,176, 96,125,119,131,168, 39,153,239, 23, 92,127,110,143,118,187, 75,243, 74,204,100,146, -243,230,119, 62,206,175,126,246,239,115,107,246, 18,167,233,103,201,229, 38,136, 14,102,118,141,203,151, 31,166,105,251,164,185, - 38,165,192, 10,135, 84, 77, 58,145,196, 25, 73,110, 11,122,241, 58,169, 59,230,206,120,192,176, 60,193, 57,199,249,238,195, 40, - 20,174,204,233,237,182,120,241,246, 11, 24,167,104, 42,112, 82,163, 92,143, 68, 68,100,206,145,149, 19,164,148,146,233,240,148, -115, 15, 60,200,217,222, 1,143,188,229,181,156,252,231, 95,227,206,167,191, 64,245,192,163, 84,211, 33,163,211, 35, 48, 51,156, -148, 68, 78,145, 52,186,148, 85, 70,163, 41, 49, 52, 24,223,221,103,116,188, 71,164, 4, 85, 85, 49, 31,157, 16, 9, 65,153,166, -224, 44,189,126,143,241,217,152,162,156, 19,197,146,181,254, 14,103,135,135, 52, 58, 29, 58,107, 91,148,186,201,246,197, 93, 30, -121,226,237,236, 94,126,136,233,112,200,185, 43, 87,176,214,209,221,218,100,107,103,155, 95,253,244,139,124,239,119,188,143,247, -188,239, 47,134, 29,151, 14,116,182,149,238,206,133,157,185,138, 87,148,239, 53,187, 56,252,152, 11, 94,213, 56, 89, 26, 96, 87, -137, 84,162, 2, 93, 97,117, 73, 62, 26, 80, 76, 39,164,103, 3, 38,131, 33, 70,107,170, 34,231,116,111,143,139, 79,188,145,184, -145,224,138, 1,246,197,151,185,123,227, 22, 74,134,200,192, 40,134,230, 58,184,233,130,178,134,173,224,206, 30, 58, 47, 40,158, -249, 60, 69, 89,241,242,201,136, 23, 94, 57,228,131,191,249, 27,152,244,174,183,182,216, 21,174, 50, 94,212,181,200, 24,118,190, - 19,176,206, 51,201,103,227, 41,175,123,219,147, 28,157, 78,121,236, 77, 79, 2, 80,154,130,184,181,238, 71,225, 81,180,176,186, - 52,146, 6,162,191,193,122,115,192, 63,253,216, 63,197, 76, 63,195,163,175,123,146,159,248, 39, 63, 65, 94, 20,124,207, 95,251, -171, 28, 3, 71,207,127,142,164,215, 35,238,180,124,151,219,104, 34,112,152, 52,167, 42, 60, 53,107, 62,158, 19,117,123,216,162, -192,150,117,192, 75, 16, 22,233, 18,100,228, 83,223,202,130,252,240,128,238, 7,190, 22, 51,246,150,165,221, 56, 66, 8,152, 88, - 75, 34, 5,141,176, 83, 63,211,134,115,219, 27, 56, 33,104, 37, 9,173, 70,226,253, 11, 66,162, 84,140, 74, 18,156,129,227,225, -140,211,209, 20, 25, 43, 30,125,236, 33,190,227,199,127,152,191,254,211, 63,193,251,255,197, 63,224,252, 27,159, 96,126,122,140, - 46,115, 92,233,195,101,148, 20, 62,154, 82,250,104, 92, 17, 53, 60,214, 52,157, 65, 54, 67, 8,227,105,101,186,246, 95,105,159, - 7, 80,204, 97, 54,132,201, 0, 38,167, 65, 19, 33, 32, 73,252,248,125,109, 29, 90,237, 48, 50, 44, 23,133,165, 84, 17,173,221, -139,136, 40,241, 99,214, 21,143,184,116, 98, 49, 92, 23,175,166,161,213,187,238, 48, 58, 92,118, 35, 43,232,215,133, 26,190, 54, -190, 47,247,241,203,103, 70,220,219,149,175,236,160,173, 91, 2, 58, 22,162, 82,213,160,177,118, 9, 25,183, 61,204,102, 69, 97, -236,244,202, 18,189,198,235,174, 32, 66,157, 91, 90,187,109, 29,247, 90, 91,137,140,187,183,203,173, 39, 12,214,147,176,252,158, -220, 97,202,177,239,228, 87,180, 0,245,142, 92,170, 14,201,198,195,200,184, 29, 94, 63, 28,255,193,162, 73, 16,253,201,208,172, -202, 88, 64,188, 70,114,223, 91,137,183, 31,245, 41,130,181, 76, 62,192,130, 22,209,171,126, 41, 31, 56,240, 85,189,204, 95, 10, - 7, 66,208,146,183,145,234,240,158, 41,239, 2, 8,121,245,206,104,191, 11, 55,218, 7,186,196,145,167,189, 69,181, 50,213,143, -231,157,211, 33, 5,174,118,229,132,231, 65,169, 48,162,247,164,191, 5,131, 60,138, 80, 81,140, 84,177, 47, 70,163, 6, 34,106, - 16, 37, 77,132,168, 99, 86, 61,135, 2,153,120, 95,191,146, 84, 89,198,252,112,159,233,193,190,199,156,110,247,104,174,173, 83, -229, 37,197,213, 47,176,247,171,159, 96, 60,155,249,166,192,106,210,202,199,241, 58,163, 57,211, 48, 49,144, 26, 40,157, 99, 88, - 89, 6, 21,156, 84,142,153,113, 92,157, 87,156, 20,134, 51,237,216,171, 20, 39,133,101,174, 29,211,210,176,159, 27,198, 90, 48, -214, 2, 27, 55,184,155, 26,142, 75,203,221,194,112, 86, 90, 10,227,208, 50, 34,115,146,105,229, 69,177,165,118, 56,225,155, 47, -129, 92, 12, 85, 23,151,116, 88,187,212,158,116,171, 77,216,189,135, 49,186, 14,251,112,107, 23,217,239,218, 44,105,132, 54, 60, -228,214, 45, 87, 75,181,214, 66,212, 19,219,122,251,130, 13,181,157, 93, 60,163,206, 57,202,193, 62,122,158, 50, 57, 30, 50, 62, - 61, 67,103, 57,243,209,144,211, 59, 35,210,233,148,225,241,152,254,214, 38,155,151,250,156,220, 41, 88, 91,111, 80,100, 57,179, -225,243, 92,234, 39,244,154,219,124,217,165, 39,104,186, 17,177,106,211, 86, 29, 78,139, 19,214,215,214,233, 55, 54,216,237,239, -144, 68,254,117,215,215,219,116,154,125,214, 55, 21, 69, 94, 48,215, 35,206,183, 31,164,153,108, 48, 46,206, 88, 75,186, 24,231, -184,115, 56,100,174,231,148,100,140,210, 25,121, 94, 49,200, 15,153, 84, 19, 10, 91,145,217, 12, 41,165, 96,251,252, 46,147, 73, -202,104, 56, 98,247,250,231,152, 76, 13,229,253,151,216,120,248, 49,110,127,246,147,236, 94,185, 66, 85, 66, 44, 37, 90, 40, 26, -205, 22,198,148, 56, 93, 98,180,166,181,181, 78,171,211, 33,238,244,136, 90, 29, 84,188,198,108, 52,160,200,135, 8,149,160,162, - 38,131,131, 35, 78,247,174, 18, 69, 17,233,124, 68,153, 71,156,222,125,133,102,183,197,238,165,115,244,207, 93, 68,170,152,147, -189,219,116,250,187, 28,190,252, 57,144, 62,209,232, 79,191,247, 77,188,124,103,196,127,251,163,255,202, 11,198, 48, 94, 65,186, - 18,134,130,208,126, 28, 42,227, 48,114,179,203,133,139, 9, 42,247,170, 10, 22,150,120,225,125,172,131, 30, 22,164, 56,157, 98, -179, 57,213,217, 25,249,104,200,252,244,140,114,150, 97,139,156,233,104,200,124, 56, 97,124,124,202, 27,254,204, 55,224,210,155, -136,195,125, 14, 63,127,149, 70, 84, 33, 35, 31,248, 71,171, 1,113, 15,202, 52,236,227, 52,140,206,112,131, 17, 58, 45,112, 55, -111,178, 55, 73,153, 71, 9, 59, 15, 93,164,177,117, 95,176, 39,153,133,136, 67, 32, 80, 73, 76,212,108,250, 76,100,192, 25,159, - 65,110,141,245,241,166,214,209,237,245, 89,151, 3,100,212,231,139, 95,115,137,243, 91,155,104, 93, 65,171,137,108, 38,222,114, -133,127, 80, 90,187, 59,252,171,159,255,101,134,243,156,255,242,135, 79,115,229,178,227, 95,126,226,243,236,236,108, 50, 27,204, -125,237, 83,105,146,102,155,164,221,245,137,122,147,153,199, 40, 90,141,177,150, 86,183, 73,210,235,224, 76,233,119,171, 58, 96, - 97,171,210, 95,238, 58,120, 95, 98,127, 88, 69,107,107,180, 46, 95,100,231,173,143,115,115,154,113,228,180, 79,182,196,113, 22, -246,174,221, 70, 66, 91, 9, 14,206,134, 97,106,105, 56, 62, 25,176,214,106, 50,205, 50,198,163, 49,107, 81,196, 59,191,244, 13, -252,157,255,244, 47,249,209, 95,253, 25,126,224,167,255, 57, 95,245,125,223,137,181,150,244,244,132,233,245, 27, 84,211, 49,174, -210, 8,107,137, 59, 77, 90, 91, 91,200, 70,211,119,183,205, 54,162,213,242, 41,114, 73, 3,209, 95, 71,172,111,250,203,121,107, - 11, 46, 92,240,162,184,126, 31, 26, 9, 52,154, 94,232, 24, 75,127,145, 55, 19,223,185,199,161, 75,151,126,180, 43, 84, 8,213, -168,153, 6,225, 98,250,138, 95,123,201,239, 64,131, 5,186,214,134,173, 50,168,239,189, 29,195,255,179, 43,187,227, 87,137,221, -156, 91,238,208,107,177,156,183, 27, 5,107, 91,224,101, 47,172,108,139, 76,235,165, 74,248, 30, 68,157,117, 56,157, 83,101,103, -216,106,182, 68,180,134, 67,213,213,118,186,112,104,186,213, 37,104,168, 66,252,254,183,137, 84, 18,171,189, 59,192,106, 27, 16, -173,254, 80, 94, 96, 70, 23,187,126, 23, 46,119,141,201, 78,124, 12,173,168, 51,215, 89, 76, 39,146,222, 5, 90,151,159, 68, 53, -183,239,141,155,115,118, 33,140, 91,134,131,248, 14, 63, 94,191, 68,231,209, 47, 39,217,188,226, 47, 63, 86,130,215,157,243,148, - 72, 39, 22, 26, 21,108, 8,112, 34, 0,116,236, 61,100,149,122,159,192, 98, 76, 98,204, 82, 64, 23,148,239, 68, 50,140,226, 3, -149,174, 38,227, 24, 63, 17, 20,206,226,170,124, 65, 92, 20, 50, 10,171,153,160,132, 87, 10, 21,171,176,194,137,124,209, 18, 69, -126, 93,132,244,151,186, 16,158,170, 41,133,183,183, 57,231,255, 41, 5,182,210, 56, 99,152,220,189,201,232,224, 22,167,215, 94, -100,247,252, 6, 59, 15,221,135,106, 70,224, 36, 39,191,242, 43,140,202,138,162,212,104, 13,198,250,177,118,161, 45,169, 17, 28, -230,142,153, 22,148, 22,166, 5, 28,102,142,195,194,113, 82,192, 89, 41, 24, 86,112, 90,193, 64, 11, 70,165, 33,183, 48,169, 12, - 7,153,101,104, 4,131, 10,230, 72,110, 79, 43,142,114,195,141,185,229, 40,183, 68, 2, 6, 21,156,150,142, 65,105, 49, 62,117, -134,184,209, 68,198,141,133,235,194, 46, 36, 79, 50, 20, 90,203, 65, 43,245,145,191, 98,167, 52,182, 22, 94,250,169,142, 49,203, -209,187,209,193, 66,103,184,183, 64,174, 87,126, 65, 33,239,140,143,125,181,193, 91,191, 96,204, 7,159, 91, 49, 59, 64, 87, 5, -210,101,100,147, 49,189,115, 59,180,187, 13,210,225,136,253,231,110, 97,243, 53,214,183, 34, 70,135, 57,113,210,224,190, 7, 30, - 32,157, 57, 46, 92,184, 66,164, 18, 46,116,174,240,204,241,179, 60,121,254,109, 8, 33,121,241,240, 38,179,172, 96,111,116, 11, -156,226,116, 62,160,210,142,215, 63,122,133,219,195,155,180, 99,201,100,236, 39,158,145,104,130,112, 52, 68, 66, 83,182, 40,163, - 49, 46,136, 62,155,209, 26,137,104, 49,175, 38,156,229, 67,198,197,136,220,122, 91,104, 81,205,136,230,195, 17,150,146, 13,169, -136, 26, 22,119,253, 42,217,149,251, 56,184, 61,231,145,104,206,249,215,191,133, 60, 27, 19, 69, 49,179,233, 16,128,249,104,204, -218,214, 57,172,140, 56,187,246, 5, 58, 27, 27,196,237,117,166, 39,135, 36, 73,129,148, 9,243, 98,132, 64,210,238, 54,136,146, - 46,157,254,156,164,247, 4, 85,225,237, 31,107, 59, 27, 8,167,121,229, 15, 63, 69,119,189,131,140, 19,206,246,143, 89, 63,223, -163,217,218,192,153, 71, 57,255,240,253,188,242,251, 39, 28,220, 61,230,233, 91, 47,172,236,189,245, 74,202, 89, 8, 99,113,185, -255, 80,214,164, 40, 25,170,113,173,253, 56, 94,231,225, 67,212,168,231,149, 11,202,219, 2,106,168,167,216,108, 78,126,118, 74, - 57, 25, 81, 76,166,100,195, 49,121,158, 51, 57, 27, 80,166, 25, 89, 94,162, 90,109,226,102, 7,119,116, 13,119, 60, 0, 59,163, -187,222, 36,138, 35,111,159,234,111,121, 27,156, 14, 8, 85, 93,193,108,140, 45, 43,140, 53,152, 87,110,114,152,149,188,124,251, -148,239,249,194,199, 49,233, 1,117,254,166,183, 64,249, 17, 91,212,232,120,107, 88, 92, 80,230, 41,198,106,172,118, 88, 99,208, -218,139,136,142, 14,142,249,216,143,253, 0, 95,249,151,254, 25,127,243,195,239,231,116,118,194, 11, 95,120, 30, 26,109, 80, 21, -210,129,180,142, 88, 10, 6,121,202,198,214, 6,195, 51,255, 62, 78,143,238, 82, 88, 73,145,231, 40, 21,115,165,211, 34,203, 74, -154,189, 14,197, 28,146,102,139,108, 86, 34,149,247, 6, 87,179, 28, 87,149,188,237,187,191,149,217,205, 23,188,133,167,142,105, - 84, 10, 97, 53, 46, 28, 98,245,114,204,132, 46,245,177,111,255, 16,119, 78, 70,124,242,233,151,217,221, 88, 67,104,237, 45, 51, - 64,153,229, 30, 98, 17, 69,196,145,224,228,108,202,204,102,172, 95,220,225,251,255,242,135,184,244,206,119, 33,123, 93,168, 12, -229,225, 1,213,193, 62, 70, 91,204,124,238, 63,192,202,239, 7,101, 20,211,236,181,137, 54,251,222,207,171, 36,178,221, 65, 36, - 9, 20, 25,194, 25,232,118,124,119,164, 34,104,182,189,231,102,225,109, 9, 38,112,229,188,167,184, 38,208, 9,233,187,187, 36, -246, 43, 27,153, 4, 33,213,255,127,183, 92,179,201,147,254, 6,127,234,211, 7,252,234,123, 30,164, 28,156,133,128,151, 37,188, -195, 45, 80, 43, 44, 49, 87, 78, 44, 50,162,235, 47, 18,242, 85, 17,170,118,105, 43,115,247, 34,208, 61,122,150,101,246,116,205, -200,174,219,109, 33, 86, 71,241,203, 9,180,201,198, 97,212,201,226,207,180,188,183, 87, 80,160,181, 88,179, 30,143, 74,137,106, -248, 66,190, 24,222, 9, 59,252, 37,114,211, 45,128,109,129,120,167,124,191,107,141, 63,144,101, 0,219, 44,244,107,218, 45, 45, - 71,198,146, 15,110,162,179, 33,182, 24, 44,199, 26, 43, 81,176,181,189,192,139, 20,125, 81,174, 7,183,153,255,209,255,131, 16, - 51,132,138,194, 74, 33,196, 38, 47,216, 21,181, 58,207, 46, 5,180, 78,135, 11,158,101,103,175,171,229, 24, 37, 92,230, 86,107, -156,213, 88, 93,134,105,199, 10,121,174, 14, 13,178, 6,103,117,104,248,125,252,171,211, 21, 52, 59,184,106,142,136, 19,132, 93, -126,102,188,190,194, 23,134, 50,105, 32,163,166,127,147,149, 12,220,119,129, 12,141,136, 11,196, 29,161,130,231,222, 58, 84, 34, -200, 7,167,164, 71, 7,204,238,238, 51, 63,186,203, 67,143,236,208,221,222,193,170, 4,187,119,149,195, 59,119,253,221,232,156, -167,174, 25, 75,105, 33, 71, 48,170, 96,164, 5, 13,225, 72, 12, 28,151,134,253,220, 81, 72,197,154,132,204, 10,206, 42, 48, 72, -140, 49,172,197,146,185, 54, 84,198, 98,156, 68,148,142,221, 38,220, 73, 13,149,241,128, 31,101, 45, 15,183, 21, 7,153, 65, 73, -201,134, 16,172, 53,154,148,214,130,106, 32, 99,133,174, 74,138,188,164, 29, 75,140, 80, 40,103, 22, 41,110,245,196,196,185,149, -162,116, 37,244, 72,226,215, 49,102, 17,243, 26, 46,240, 85, 98,114,189,134, 10, 99, 44, 19,232,131,254,249, 93, 73,112, 89,181, -120, 44,108,155, 10, 83, 76, 57,217,123,133,238,230, 58,187, 23,238,231,228,246, 45,102,131, 17,142, 22,194,197, 56, 41,104,174, -197,112, 34,232,239,238,144, 21,103,172,245,183,233,180, 13,141, 19,197,236,214,148, 52, 43,248,100,246,123,108,198, 91, 30,228, - 99,155,236, 36, 13,172,116,140,230, 51, 94,115,223, 38,163,236, 14, 61,177,195, 75,103, 47,242,240,230,107, 88,211, 59, 88, 55, -162, 33, 91,184,216, 43,141,142,199, 3,156,136,136,149, 33,145, 77,206,138,187, 8,169,232, 38, 93,210,106,134,197,210,109,173, -113, 60, 59, 34,210, 85,138,138, 37, 39,123,123, 60,241, 37,143, 50,253,195,223,160,106,172, 49,161, 65, 20, 75,116,225,200,103, -103,172,237,220,207,201,193, 13, 54,118,119,153,158,230, 68,177, 36,205,231,236,190,230, 77,168,184,135,171, 74,132,140, 40,210, - 49, 66,118,168,202, 25,231,175, 60,236, 63, 27,198,210,108, 38,168, 42,226,232,250,139,108, 93,186, 72,156, 40, 38,163, 25,136, -136,116, 60, 65,235,107, 52,154,107, 56,109, 25, 30, 95,167,209,220,102,126,114,136, 54,142, 55,188,245,203,233,110, 95, 9,171, -190,114, 17, 14,224,156, 94,142,212,180,198, 73, 25,132, 42, 33, 53,202, 84,200, 36, 9,169,107, 26, 27, 88,205,175, 26,122,134, -238,102,142,203,230, 84,227, 33, 8, 71, 62,157,146,142,134,228, 89, 70, 85,100,100,243,148,201,104,202,254,237, 67, 62,248, 63, -255, 15, 56,119, 2, 2,210,179, 51, 98, 89,208,234, 95, 34,185,116,209,139,168, 90,235, 80,205,150,229,103, 89,194,104,228, 35, - 89,243,140,179,233,148,145,136,152,173,183,188,133,109,122,199, 11,120, 66,181, 47,148, 66, 37, 13,136,155, 8, 98,156, 48, 11, - 64,131,181, 14,171,181, 87,108,106,135, 49,154, 7, 30,127, 51,255,228,219,191,146, 31,248,232,127, 38,142, 28, 63,250,161,175, - 12, 64, 29,175,184,141,140, 34,233,180,248,228, 31, 62,207,251,222,251, 21,252,222,239,254, 14,113, 20,179,254,218, 39,113,159, -124, 25,139, 34, 77, 51,190,250, 79, 60,142, 81, 2,149, 52,144,149,247,243,219,162, 66, 70,202,119, 24, 74,176,182,187,133,153, -157,133,224, 23, 19,198,185, 22,165, 75, 28,126, 74, 98,240, 86, 21, 33, 21,178,213,192,100, 5,103,175, 92,229,189, 63,248,221, -188,238, 83,127,192, 71,255,217,199,112, 64,187, 21, 19, 43, 69,105, 52,179,212,171,245,183, 46,238,240,221, 63,249,195, 92,248, -202,175,242, 83,143,219, 55, 49,131, 51,202,227, 99, 76, 61,230,199, 97, 10,179, 98, 55, 22,168,126,143,102,191, 79,180,190,230, -111,146, 36, 70,196, 49,194, 24, 47,138, 11, 93, 58,113, 2,237,182,191,156,107,117,117,200,174, 70,135, 21, 77, 21,198,177, 54, - 8,172, 36,254,251,105, 90,158, 33, 31,133, 61,171,248,175, 49, 13,150,151,188,213,134,175,248,165,231,248,127,191,116, 55,164, -110,173,248,194, 87,125,226,171,162,157, 32,254, 90, 96,221, 88, 54,208,110, 65,211,122,213,197, 22, 14,167, 69,148,106,160, 15, -214, 83,100, 33,253, 78,191, 78,255, 18, 65,179,177,160,118,173,126, 26,106,198,182,100, 9, 1,113, 43,211,234,149,236, 87,103, - 13, 58, 61,193,204,142,253,235,215, 62,116, 41,150, 97, 42, 43,145,156,245, 72,212,143,139, 3,251,189, 22,233,173,128,148, 68, -224, 30, 8, 89, 97,138,211, 48, 69, 11, 74,113,181, 48,251, 47,118,247,184, 90,123, 2,152, 57,197,248, 37,146,173,139,120, 89, -230,171,246,232,139,194,198,188, 74, 36,183,226,142,177,218,191,191, 90,251,226, 79,251,213,215,226, 89, 89, 88,164, 86, 86,119, -145, 79,100,115, 1, 21, 44,132,242, 52,201,240, 57,146, 42,246, 84, 58,159,230,227, 57,238, 66, 97,133,244, 95,139,167,214, 73, - 17,123,209,166,138,253, 69,238, 25,187,203,209,188, 16,254,123, 38,189,135,221, 58,135,114, 80,205,230, 76,142,238, 50,220,187, -133,208, 5,189,139,231,104,238,236, 32, 42,203,209,111,253, 38, 99,109,208, 40,176,144, 75,135, 2, 10, 43,152, 88,201,153,113, -164,193, 75,237,172,225,110, 1,103,218,103, 55,116,163,136,253,180, 36,181, 96,133,165,173, 20,185,245, 92,220,180,244,239, 31, -198,113,144, 25, 42,227, 66,214,186,102, 59,145, 92,207, 12, 13, 9,187, 77, 73, 33, 18, 14, 11,195,197,110,147,172,210,204,171, -138, 78,179, 65, 65, 65, 43,106, 33, 93, 21, 38,145, 2, 33,188, 59,102,153,252,230, 22,122,162, 58,176,104, 17,198, 18,186,118, - 23,220, 49,118, 21,205,108,150, 5,169,149,110,137,171,117,158,238, 38, 36,203,162,218,214,209,189,126, 34, 37, 4,136, 98,136, -204,115, 78,110,158,240,192, 23, 95, 98,112,247, 22,107,219, 23, 48, 85,131,114,158, 50,156,222,164,215,219,161,211, 45, 56,188, -125, 13, 51, 75, 24,244,198, 92,188,178, 77,107, 67, 97,110, 37,236, 54,119, 41, 44, 24, 52,157,100,141, 68, 38, 40,169,188, 14, -162, 41, 56, 57, 27, 51,154, 38, 8, 21,115,127,251, 1,158, 61,250, 60,137,104,209,136, 27,228,100, 52, 27,142, 92,151,164,105, - 65,225,206, 80, 82,177,219,219,161, 76, 13,109,149, 96, 85, 78,228, 32,142, 44,211,124,130,177,218,171,223,173, 54,104, 28,173, - 59, 55,185, 57,207,153, 12, 13, 27,187,187, 88, 45,153, 79,166,204, 7, 71,116, 55, 46,176,117,225, 65, 42, 61,231,129, 39,158, - 36,207,115,154,125,159, 68, 51, 62,218,199,150, 99,162,198, 14,147,241, 45,182,239,219, 66,235,152,107,159,123,138,238, 70, 31, -109, 59, 20,179, 83,146,102, 7, 23, 25,162,214, 58,150, 41, 18, 31, 46,219,232,172,211, 94,219, 66, 42, 65, 49, 78,121,237,219, -191,154,215,191,231, 27, 81, 8,144, 49, 81,170,153,189,248, 2, 58,105,209,220, 90,163,217,223,244,222, 79, 87, 33,132,196,234, - 18, 25,247,144, 40,178,241,128, 60, 51,244,207,245, 73,141,225,198, 31,237, 51, 60, 58,226,202,253,155,220,255,216, 5,255,225, -149, 18, 92, 99,197,238,147, 66,158, 82, 78,198, 88,227,152,159,156,144, 78, 38,148, 69, 69, 54,159, 51, 29,142,153, 12, 71, 76, -179,130, 89,150,113,238, 53,175,129,219,207, 67, 81,144, 30,141,232,238,108, 19,109,108,194,230, 14, 52, 59, 94, 89, 91,156,250, -137,129, 9, 73,110,147, 25, 38,207, 48,195, 33,119, 38, 57, 87, 71, 5,223,243,203,255, 7,118,126, 16,170,207, 42, 8,144, 44, - 82, 6, 82, 20,113, 24,127,250, 92,121, 93,250,175, 49,206,121,133,111,200, 7, 30, 31, 13,248,186,111,254, 48,239,126,207, 87, -112,231,234, 53,222,248,230, 55, 80, 12,247, 66, 84,164, 66,160,105, 52,218,252,230, 31, 61,205,180,213,229, 59, 62,240,223,241, -249, 87,238,240, 7, 79,125,134,215,158,247,163,176,217,254, 17,223,240, 77,223, 64,119,115,139, 42, 47, 49, 69,137, 46, 74,100, -163,177, 8,149,168,138, 42,136, 29, 92,122, 0, 0, 32, 0, 73, 68, 65, 84,228,126, 91, 4, 22, 39, 5,214, 84, 8, 35, 3, 24, -196, 75,178,157, 54, 40,165,112,107, 29, 16, 17,102,150, 18,183,187,204,207,142, 56,255,198,215,241, 35, 63,247, 79, 25,222,188, -197, 75, 79, 63,195,232,100, 64,255,194, 46,111,122,255,159, 35,121,240, 97,212,206, 6,204, 82,152, 5, 42, 95,158, 5,106,154, - 87, 26, 91, 33, 16, 78, 34,187, 9, 66,117, 81, 66, 34, 27, 9,178,219, 65,182,154, 30,239,219, 80, 75,178, 77,179, 13, 73, 4, - 89, 10, 91,219,254, 50, 95, 68,235, 6, 42,159,209,190,240,178,222,150,231,163, 62, 37,162, 17,121, 4,174,168, 15,119,159,145, -237,109, 86,161,187, 19,138, 63,238, 47, 25, 69,200, 72,177,249,230,119, 48,120,250, 83,172, 28, 33,225,110, 8, 98,161, 90, 9, -191,240,200, 46,100,105,129, 80,183,162,248, 94,180, 37,110, 65,149,171, 59,112,183,218,166,220, 67,158, 11, 59,220, 16, 4, 35, - 86,132,151, 50, 68,163, 10,249,170, 92,152, 21,136, 7,117, 6,251, 10,113, 75,212,140,237, 58, 68, 35, 8,206, 68, 36, 67,110, -246, 74, 81, 80,231,190,175,230,193, 47,216,242, 43,187,114,177,196, 74,136,149,200,215,213,144,153, 90, 24,231, 45, 74, 34,100, -193,215,223, 85, 25, 14,102, 67,180,118,238, 85,194, 56,177, 82, 25,217,165,109,205,133,244,181,192,174, 95,136,219,156, 12, 8, - 89,235,167,120, 53,216, 92, 46, 71, 36, 74,197,104,242,112,105, 71, 88,225, 1, 89,126,250, 30,242,207,133,243, 99, 83, 34,108, - 62,241,163,116, 41, 3, 28, 5,143, 41, 85, 98, 97,189, 21,113,228,173,106,113, 12, 72,100,210,240, 94,110, 17,172,183,194,131, -187, 80,114, 97, 35,180, 78,131, 41,201,166, 41,147,211, 33, 59, 91, 77,214,207, 95, 64,117,186,228,183, 95,225,230, 75, 55, 65, - 72,178,210,250, 12, 38,167, 16,218, 48,183, 48,118, 17, 67, 99, 49,206,144,107,203, 28, 56,171,124,182,124,106, 28, 51, 43, 24, -235,101, 46,122,101, 93, 32,202, 89, 50,163,193, 42, 58,177,160,116,144,133,253,182, 2, 14,115,203, 90, 18,145, 72,201, 73,105, -153, 84, 25, 23,218, 9,221,180,100, 32,224,254,205, 13,238,142,207,216,109,183,112, 72,210,178,164, 19,199, 56, 28, 85,101,151, - 44,255,176, 23, 55,214, 5,244,129,183,142, 58, 81,131,255,220, 66, 26,165, 67,224,145, 9, 32,122,183, 8,148,113, 24, 27,224, - 70, 42, 40, 27,196,146,105, 47,101,205, 97, 16, 11,203,167,195,161, 44,200, 27,255, 5, 46,126, 45,197,244, 4,135,224,210, 99, -143,240,210,239, 61, 75,163,181, 70,207, 73,250,219,125,142, 15, 78,232,117,250,156, 76,206,136, 39,125,110,189,120,130,165, 96, -158,101,108,182,207,113,107,116,147,181,230, 22,243,114,206,133,173, 45,198,197,156, 75,235,151,120,230,240,105, 58, 81,135,162, -172,208,102, 78, 33, 35,238,107, 95,228,110,118, 23,105, 37, 89, 53, 67,170, 6,251,227, 67, 18,213,194, 24, 75, 97, 75,174,158, - 93,245,128, 32,213, 70,216,138, 66, 87,100, 26,230,213,156,205,214, 26, 81,127,231, 2,167,123, 87,113, 8,116, 46, 40,207,198, -100,133, 98,237,145, 47, 34,157, 77, 17, 38, 99,253,194,253, 72, 37,201,103, 99,250,231,238, 35,157,156, 32,162, 53,142,238, 60, -207,214,133,215,146,205,134,180,123,125,132, 44, 81, 81, 23, 41,124,149,183,126,225, 97,158,251,244,111,243,214,175,251, 83, 68, -234, 1,140,213, 40,249, 58,202,249,140,168,211,167,245, 80,159,178,172, 48,233, 41, 27,231, 47, 99,178,130, 63,251,131,255, 43, -110,124,130, 61, 57,165, 56,153,144,231, 57,229,108,202,236,238, 62,131, 59,251,236,221,216,231,206,225, 30,111,255,208, 7,120, -242, 35, 31,193,216, 12, 21,245,248,201,191,241,253,252,247, 63,250,207, 22, 7,234,102,171,207,143,255,195,143,242, 85,127,238, -189,188,112,237,144,255,244,209,143,179,177,214,225,235,191,238,173,188,225,109, 15,175,140,239, 52, 84, 21, 58, 79,169,178, 57, -217,104,196,244,232,132,170, 40, 24, 28,159,144,207, 50,198,147, 9, 71,167, 35,166,211,156, 47,253, 51,239,134,217, 9, 12, 78, - 49,163, 49,211,233,132,237,251,239, 67, 60,250,152,255, 5,219,155, 96,166,203,174,207,104,152, 77,188, 72,203, 57,138,147, 51, -166,214,145,106,195,246,235, 31,167, 26,159, 5, 63,187,194, 58, 47, 92, 65,104,148, 46, 22,115,215,249,201, 1,101, 81,224,140, -197,212,187, 59,150,161, 25, 50,138,152,158, 13,177, 50,230,210, 23,189, 1, 55, 57,195, 6,235,143,104, 40, 84, 21, 51,159,156, -242, 35,223,251, 17,254,199, 31,251, 41,126,248,167, 62, 70,154, 13,121,227,229, 45,254,237,143,255, 93, 78, 79, 6,168, 88, 50, - 27, 77,104,108, 93, 36, 61,221,167,200, 74,102,147, 9, 70,247,253, 37, 39,124, 58,148, 73,203,133, 20, 75,212,169, 37,214, 96, -173, 68, 26, 9,202,225, 74,159,134,167, 26, 13, 76,101,208,206, 17,117,155,232, 44,199,148, 37,250,240, 46,253, 71, 30,228,109, - 95,250, 36,116,186,126,111,173,141,247,132, 87, 51,127,113, 86,165,255,127,210, 23, 12, 36,209, 2, 31, 42,146,132,168,217, 70, -181, 19,100,175,231,119,222,245, 37, 94,119, 95, 73,228, 47,240,102,203, 95, 76, 91,219,190,107, 50,198, 95,228, 58,236, 79,203, - 18,170, 42, 76, 96,195, 36, 64,197, 97, 17, 30,123,255,250, 98,255,106, 87, 46, 87,113,239,104,250,143,233,216,157,181,188,254, -175,252, 47,124,234, 35, 95,181, 80,128,175,166, 65,214, 49,145,171,169, 85,171, 2, 95, 87,147,218, 2, 42,213,173,118,231, 11, - 62,186, 91,228,167,223,147,232, 38, 86,224, 44, 43, 23,162, 14, 5, 65,221,213,187, 16,175,229,156, 67, 68, 98, 57,186,151, 43, -171, 2,227, 22, 68, 83, 63, 42,183, 75,166,188,172, 71,150,222,243, 43,194,191,215, 19,135,149,134,107, 1, 79, 18, 53, 4,238, - 30,194,158, 64, 96,125,112, 71, 24,227,215, 63, 55,224,227,239, 9,155,169, 45,127,117,242,151,179, 14,167,252,247,184,249,218, -183,174,232,106,228,202,200,195,132,136,229,200,179,223, 23,157, 90, 21, 38, 47,181,141,173,244,144,153,218,143, 30, 98,153, 93, - 80, 7, 58,235, 64,185, 0,124, 1, 39,165, 79, 97,171,147,214, 88,102,197,251,245,128, 55, 81, 59, 87,225,156, 95, 17, 10,229, -188,160, 82,128, 83, 17,182,210,200,164,137,140, 19,111,119, 11,188,120,225,156, 79,121, 19, 18,153,180,125, 70,123,179,237,167, -149, 70,163,179, 20,157, 77,209,233,132, 70, 83,210, 91,107,210,218,222,162,156,206, 57,249,196,199,153, 91,235, 25,228, 64,105, -125,153,111,156,247,162, 79,165, 34,119,142,188,244,221,105, 26, 60,229, 38,112,211,167,198,209,105, 40,138,176, 50, 49,120, 97, -226,188, 52,126,205,164,252,133, 91,104, 71,101, 44,218,250, 16,147, 94,236,225, 81, 51,237,104, 40, 73, 51,145,164,165,225,101, -109,121,100,123,157,155,227, 9, 93, 1, 66, 53, 72,203, 41, 45,233, 29, 42, 86, 87, 72, 21,176,177,194, 97, 92, 40,220, 22, 41, -170,110,165,220,125,149, 22, 51,252,152, 91,224,225,188, 79, 94,174, 76,144,124, 26, 96,237, 20,185,103,216,178,140,148,149, 53, -171,221, 34,230,119,104, 48,231,120,239, 54, 55, 94,185,197,198,133,243,172,223,215,230,248,230,148,110,167,199,205,107,175,208, -235,239,176,113, 97,155,225,209, 4, 71, 73,145, 90,140,171,216,234,156,103, 90, 12, 72, 84,155,118,220, 98,127,118, 72, 99,199, -226,246, 74,142,103,135,220,215,190,196,141,233, 30, 13, 41,105, 69,107,164,213,132, 88,181,145, 78, 50,175,198, 72,183,201,222, -240, 54, 82, 40, 74, 91, 44,158,231, 66,231, 20, 38,199, 4,159,233,102,171,203, 81, 58, 64, 2, 7,105, 74,132,176,116,214,183, -153, 76,142, 81, 58,103,247,221,239, 96,114,253,144,207, 61,243, 28, 79,254,153,119, 99,123,125,178,201, 16,161, 98,162,164, 65, -158,141,104,180,250,100,195, 19,122,235,155,140, 79,206, 22,201, 77,186, 76, 17, 56,202,172, 96,109,235, 28,167,123,207,241,250, - 39,223,130,201, 50,226,110,143,241,225, 1,211,163, 61,218,219, 91,172,239, 92,194, 20, 21,210,166, 20,182,193,175,255,187,159, -226, 71,126,251, 6,213,179,191,139,109, 94,196,174,245,176, 73, 3,125,122, 76,158,143,152, 78, 14, 24,102,135,204,220, 25, 83, -155,242,143,127,232,111,240,227,111,124,140,254,149,199,233,108, 38,252,196, 95,250,111,152,255,209, 47, 81,161,200,211,138,239, -254,107, 63,200,135,255,242,251,249,206,223,250, 46,190,231, 7,191,143,163,225,235,185,241,210,203,252, 95,191,248, 20,127,105, -247, 34,247,237, 64,163,219, 5, 87,226,178, 25, 38,205, 40,198, 99,102,167, 39,204, 67, 80,203,116, 56,196, 26,199,232,116,132, - 20,130, 34,157,241,158,143,124, 8,119,227, 69, 68,119, 13,115,114,198,252,108,140,120,211, 55,120, 49, 94,171,239, 61,195,179, -249,210, 31,171, 53,174, 40, 60,175,185,219, 69,207,102, 12,141, 37,105, 40, 26, 59,231, 73, 15,246,253, 89,163,226, 0,245, 16, -216,170, 68,151,133,247,106, 86, 37,249, 44,197, 86,149,111,158,130, 32, 10,183, 4,140,184,176,195, 22, 14, 92,146,208,190,123, -136, 56,183,133,204, 43, 76,240,122, 8, 44,107,247,237,242,239,254,213, 63, 34,159,122,159,125,163,221,229,224,246, 62, 56,136, -226, 24,180, 96,173,219, 99,114,253, 57,242, 60, 16,179,176, 56, 25,227,148,103,164,151,185, 31, 89,187, 0,206,192, 46, 71,177, - 88, 25,226, 12, 29, 24,135,108,199, 88, 33,176, 81,132,117, 94,245, 42,211, 28,164, 67, 87, 57,242,236, 12, 57, 25,122, 29, 66, - 20,249,147,187, 44, 61, 79, 94,107,108,161,253,152,177,233, 67,108, 84,187,141,136, 27,168, 78, 27,177,181,233,187,112, 25, 14, - 92, 93, 43,152,165,255,181, 34,229,237,104, 88,127,129,231,185, 63,208, 43,227,131,118, 42,141,203, 11, 31, 73, 91,195, 41,164, - 0, 27,252,201, 86, 66, 85, 96,164,143,178,148,194,122, 41, 71, 85, 95,250,226,143, 29,191,223, 11, 13,179,172,189,246,113,255, -190, 10,183, 12,159,144, 43, 0, 12,199, 34,217, 78, 4, 17, 97, 77, 49,245,151,163,191,176,101,232,124,157, 93, 38,182, 73, 81, -243,221,173,247,150,135, 17,124,125,233,249,166, 69,248,142,176,134, 99,138, 37,148,131,149,255,246,171,227,240,218, 43,126,114, - 17, 70,221,214,218, 37,218, 51,128,104,144, 75,100,104, 29,232,226, 66,235,228,139, 18,235, 61,244,181,103, 30,135,138, 85,216, -143,122,223,249, 82,215, 18, 18,215, 2,184, 71,170,101,102,182, 39,181,249,175,151, 98, 5,133, 91, 31,224,138, 48, 77,240,191, - 94,247, 13, 95,185,164,146, 16,133,253,185, 93,130,104,106, 91, 2,209, 50, 6,153, 87,137, 8,131,112,209, 25,179,146, 30, 82, -239,209, 53,206,133,128, 40,173, 67,224,155,231,217,135,144,123,164,178, 1, 10, 84,103,180, 7, 88,140, 82, 11,109,133, 71,222, -250, 81,188,104, 68,193,170, 23,225,242, 50,200,134, 34,132, 48,225,235,253, 4,164,134,208,212,197, 12,214, 49,190,123,199,127, - 70,162, 22,155,151,118,112, 82, 97,246,111,242,194,103,175,162,149, 68, 35, 40, 12, 20,214, 75, 67, 82, 35,201, 44,164, 66,144, - 25, 75,170, 29,145, 18, 76, 87,191, 21,210,227,112, 35, 33, 40,173, 37,137, 21,121,169, 57,201, 42,186,177, 36, 81,146,210,248, -201, 97,110, 12,165,177, 68, 66,208, 75, 20,137,242,207,223,184,178, 52,180, 97,144, 91,218, 81,196,253,107, 29,110,143, 82,214, - 99,193, 90,167,131,182, 22, 25,181,188, 46,198,250, 25,120, 85, 21, 68, 98, 73,132,139,164,183,179,217, 5, 47,126,249, 25,169, -183,169,245,143, 45, 88, 68,245,103, 34, 88,225,132,112, 44, 82,124, 67,202, 95, 93, 68,219, 90,203,225, 21, 65,190,128, 85, 75, -107, 92,103,239, 23,121,165,249, 46,146,164,195,248,248, 20, 20, 12,143, 71,116, 94,247, 0,229,116,196,157,131,148,141, 43,125, -154,253,132,209,105,225,237,119, 90, 17, 17,211, 78, 98,182, 57,207,172,156,241,248,246, 27, 72,135,115,142,198, 19,206,109,107, - 78, 71, 51, 18, 25,177,209,220, 97,174,103, 36, 81,194,126,122, 3,109, 13,145, 84, 84, 84, 68,170, 73, 66,147,169, 29, 16, 9, -133, 20,138, 76,196, 56,145, 50,213, 19, 58,170,203,233,108,202,184, 26, 33, 69, 68,105,115,162, 50,203,144, 74,177,126,254, 1, -236,157,103,153,255,222,103, 40,146, 22,219,231, 47,147,103, 19,108, 41, 73, 58,109,138,108, 20, 44,104, 27, 76,207,134,148,229, -156,181,222, 54, 39,123, 55,144,170, 68, 87, 5, 22,239,215,204,102,115,138,116,192,230,165,199, 56,124,229, 51,152,202,241,236, -167,159,226,209, 47,126, 11,173,173, 93,122,235, 61,202, 44,227,217, 79, 61,205,246, 37,193,133,135,222,194, 95,249,233,143,227, - 14,158,163,210,107,180,182, 55, 72,243, 57,213,233, 41,246,240,152,249,243, 95,224,244,230, 45,174,189,114,149, 27,195, 17,175, - 12, 38,124,243,159,124, 39, 27,175,121, 35, 81,183,203,205,159,255, 49,250, 15, 62,200, 28,129,108,247,232,236,110,243, 31,159, -122,154, 23,127,241, 23,120,236,207,125,144, 86,191,197, 55,126,224, 91,184,126,173, 69, 58,159,241,244, 83,159,229,103, 62,241, -191,243,183, 62,250, 51,144, 77,201,135, 67, 76,150, 50, 57, 57, 33, 61, 27, 83,102, 57,179,225,152, 50, 43,217, 63, 60,229,228, -116, 4, 18,222,241,222,183,195,141, 47,192,193, 33,174,215, 37, 31,207, 88,123,221, 67,144,116,252,165,210,108,249, 11,166, 40, - 86, 76,145, 26,225, 4,170,223,198,206, 75,214,222,252, 36, 15,253,135,143,243, 23,111, 63,197,228,218,139,136,164, 17, 14, 12, -237,225, 50,132,232, 78,151, 98,180,241,123,116,237, 60,253, 75,219,112,134,201, 96, 39,170, 99, 18, 61,169, 9,103, 16,214, 18, -105,239,213,151,202,160,164,192, 6,218,153,148,130,209, 96, 64, 54, 73,209,186,194,152,129,231, 49,227, 80, 42,162,213,104,210, -223, 90,227,120, 58, 7, 41,233,111,244, 57,218,159,123,206,185,140,136, 98,133, 46,131,131,192,134, 81,101,164, 22, 31, 30,231, -156,191, 52, 1,226,200,119,129,149, 93,118,139, 42,194, 68,150, 40,105, 98,165,194, 86, 21, 74, 54,160, 44, 3, 26, 86, 45,172, - 68,214, 10,172,148,158,136,215,237, 17, 41,229,149,234, 27,155, 75, 59,162,241, 83, 22,226, 38,184,102,136,133,138,189,165,200, - 90, 63,114,183,214,219,236,242, 28, 74,237,139,172,154,138,102,188,125,177, 78,117,176, 70,163,171,202, 39, 77, 57,223, 51,198, -205, 18,213, 41, 17,113,139,184,239, 85,201, 43,196,149, 63,246, 46, 95,168,225,149, 34,138,218,196,107, 27,148,163, 97,128,142, -112, 79, 71,190,104,248,133, 8,197,146, 88, 92,166, 53,188,102, 65,153, 51,203,188,232,250, 94,114, 33, 66,213,213, 59,245, 90, -140,182,218, 5,215, 99,251,112,153, 47, 2, 99, 88,205, 48, 15, 16,153,123,181,122, 65,108,180,196,212,222, 43, 80,115,139,149, -164, 87,173, 7, 91,102, 61,117, 55, 43, 19,132,197,248,116, 37,223, 58, 20,132, 66,250, 65,169,173,252, 5,173,132,196, 86,225, -146,175, 11, 7,229, 95, 72,212,129,107,209, 50,151,123, 25,199,234, 95,173,113,223, 3,247, 38,228, 81, 99, 95, 11, 16,141, 48, -118, 23,254,159, 11, 49,164, 88,241,232,233,229,191,139,197, 22, 61,160,106,125, 36,177,179,122,193,178,194,130,171, 50,159,254, - 85, 71,210,106,207,255,246, 5,149,245, 58, 1,194,101, 92, 3, 81, 8,208, 35, 43, 86,242, 19, 98, 47,180,245,118, 20,255,254, -135,142, 93, 42,181,208, 43,200, 40, 98,126,118, 74,220, 72, 48,211, 17,229,120,140, 43,230,172,237,238,224,170,138,179,167, 62, -205,200,122, 34,227,188,114, 20, 78, 82, 57, 75,101, 64, 19, 49, 9,214,178,188,178, 84,120, 53,124,105,161,157, 68,164, 69, 69, -183, 17, 17, 1, 89,101,233,181, 98, 38,185,102, 84,104,146, 72,210,140, 35,140,117, 84,214, 50, 41,189, 77,184, 23, 73, 90,177, - 66, 74,201,172,212, 94, 20,231, 96,230,160, 21, 43, 58, 82, 50,169,204,226,153,239,196,134,180,208,108,181, 19,132,131, 70,179, - 65, 62, 27,227,240, 65, 48, 50,248,222,107,103,165, 16,254,226,247,110, 28,223,212,152,160, 19,145, 44,221, 30,181,199, 93, 5, -122,156,146,171, 92,135,149, 52,196, 5, 18,121,153, 78, 87,183,239, 54,232, 3, 34, 41,137,219, 23, 40, 77,147, 68,194,173,155, - 87,137,163, 22, 81, 44,185,246,244, 53, 46,191,238, 10, 55, 95,184,197,237,231,166,172,111, 52,185, 59, 60, 96,187,117,129, 36, -138,169,108, 65, 20,181,169,178, 41,231,186,231,232,181,218, 92, 61, 57,230,202,198, 5,158, 59,122,158,102,220, 98, 93,173, 83, - 70, 67,210,124,194,102,123,141,110,209,231,180,186,131,118, 9,214,141,105,169,136,185, 24,210, 80, 17,133,201, 24,229, 35,226, - 72,145, 22,217, 98, 21,150,155, 2, 37, 19,156,209, 24, 83, 33, 77, 85,162,136, 56,184,118, 13, 57,205, 24, 94, 63,225,129,115, -155,220,124,233, 6,141,214, 58,211, 89,206,241,141,103,232,109,157,167,209, 94,103,120,114, 6,202,210,110,245, 72, 7, 35,122, -155,107,168,164,233,119, 48,147, 49, 81,220,164, 42, 38, 24, 36,210,142,136, 90,219,216,106,200,165,215, 60,196,254, 75,207,210, -104, 75,242,172,100, 54, 58,225,161,199, 47, 35,101,151,225,237, 23,216,186,244, 8,163,207, 62, 67,235,254,203,232,170,128,201, -140,252,165,107, 28, 62,245,251,220,121,233, 21, 62,251,204,203,252,254,173, 35,158,186, 51, 96,239,120,198,151,189,255,131, 60, -249,216, 91,248,135,239,251, 50,110, 94,127,153,131,235,183,200, 39, 83,239, 44, 85, 48,220,187,203, 83,127,249,131,124,240,130, -226,223,127,236,223,147, 78, 14,217,217,222,224,190,203, 15,240,153,143,255, 60,235,253, 62,217,245,231, 60, 84, 69, 23, 76,143, -143,168,102,115,230,179, 9, 69, 81,112,122,120,202,243,175,220,226,238,241, 25, 42,130,114,150,243, 21, 31,250,122,236,254, 29, -210,131, 67,242, 91,183,152, 31,159,113,241,139,159, 8,187,214,134,223,215,148,249, 34,169,137,176,139,115,177,132,102, 27,167, - 29,218,106, 30,123,224, 34,207,190,241,203,113, 59, 91, 84,211, 49, 85, 58, 69,151,153,231,173,151, 5,166,204,208,101,133,173, - 74,140,174, 48,186,240, 96,150,192,102,118,214,248, 52,170,224,145,117,206, 82,101, 25,241,214, 14,195,223,252, 21, 84,183,231, -245,131,113,128, 85,216, 80,165,134,135, 58, 74, 98,159,242,132, 92,228, 12, 75,225,169, 70,204,167,100,211, 9, 73,163, 65,210, -106, 81,164,211,144, 86,232, 80,177,164, 42, 53, 85,154, 47,226, 39, 87, 34, 71, 66,214,113, 56,254,234, 44,238,197,235,198,136, - 70, 11,209,106, 33,122, 93,108,156, 64,162,112,173, 6, 86, 70,184, 72,225,162,196, 23, 70,205, 6,178,213, 36,218,222, 70, 94, -186,140,120,232, 65,120,221,227,240,192,195,208,237,133,203,192,248,215,104, 52,252,223,173, 70, 8, 88, 9,201, 91,217,204,191, - 23,233, 12, 38, 51,152,167,216, 34, 71,151, 26, 83, 86, 56, 93, 98,139, 18,157,166,148,211, 9,217,100, 68,122, 54,160, 24,142, -201, 38, 19,178,233,140, 98,158, 82,204,198,148,179, 9,182, 44,176,198,132, 34, 65, 47,146,188,238,133, 22,189,234, 66,175,163, - 67, 3, 84,102, 57, 79, 95, 13,104, 97,249,172,120, 78, 37, 14,187,180,223,184, 85,155,217, 42,135,221, 45,253,183,238, 85,123, -245, 21, 65,158,171, 71,146,172, 16,252,238,217, 17,172,196, 12,200,165, 18,216, 11,178,196, 50, 62, 97, 53, 28,190,222,103,174, - 40,221,197, 74,222,118,125, 24, 47, 46, 68, 37, 22,136,218,218,206,182,240,235,215,138,102,231, 67,107,235,139,123,153,191, 80, - 23, 33, 75, 4,173, 53,238,222,220,237,216, 23, 23, 62,115, 69, 18,239,190,198, 11,209,176, 1, 40,227, 49,168, 11,124,180,211, -247,238,214,235, 64,116, 17,135, 46, 62,120,215,195, 40,222,233,106, 37,129,200,248, 98,218, 89,156,214, 56,157, 7,199,141, 47, - 22, 69,146, 44, 68,112, 34, 82, 8,153, 4, 66,173,170,201, 58, 75,210,160,138,189, 18, 94,197,136,196,139,227,234,157,177, 16, - 50,140,152, 3,119,195,225,225, 51, 82, 97,138, 2,148, 68, 41,137,144, 80,206,102, 76,143, 14, 80,145, 64, 24,235, 45,113,211, - 33,195, 91,119,169,132,244,195, 41, 39, 60,209,209, 41, 78, 43, 1,113, 68,102, 5,149,119,130, 3,206, 3,157,128, 88, 9,148, - 16,196, 2, 26,145,164,211,136,208,218,175,254,180,133,139,221,132,134, 16,228,149, 33,215,134, 94,162,216,108, 69,180, 27, 49, -149,129, 73,161,201,141,199,188, 74,130,109, 95,192, 76,107, 78,178,140,147, 52,227, 44,173,184, 58,158,147, 11,255,251, 40, 80, - 12,211,140, 82, 40,156, 74, 32,104,138,164,106, 32,101,200,140,176,254,121,169, 81,198,118,213,126,184, 80,200, 47, 81,199,102, - 37,179,120, 73,175, 92,113,158,172,232, 53,234,211,204,215,164, 33, 73, 79,248,102, 74,173, 63,194, 99, 95,244, 14, 82, 55,229, - 92,191,205,243, 55, 95, 4, 45,177,241,140, 63,250,244,231,216,184, 20,113, 50,191,203,100,150,210,111,244,112,210, 50,171, 10, -246,166,215, 57,156,220,194, 34, 25,228, 3,116,231,152,245,181, 38,163,236,148,146,220, 35,116,197, 1,103,147, 83,250,237,152, -211,236,132,211,242, 24, 41, 91, 88,171, 17, 56,114,166,148, 85, 70, 97,166,104, 91, 48, 46,207, 56, 74, 79,177,206, 82,154,130, -169,158, 82, 5,230,180, 20,138,202, 89,162,217,208,155,234,155,189, 14,179,129, 64, 61,126, 63,167,198,146,116,122,204,166, 19, - 98, 37, 48, 66, 50,184,245, 50,141,254, 46, 73, 34, 40,178, 20,129,101,255,165,103,217,186,255, 62,242,249,136,206,218, 38,145, -136, 16, 18, 42,157,129,104, 50, 62,190,203,206,133,139,228,105,151,184, 33,217,186,252, 8,174,180,204,167,167,116,183,118,153, -156,222, 97,235,226,131,156,238, 93,245, 86,185,163, 9,235, 73,131,106,239, 46,217,205, 59,220,250,244,239,114,182,119,131,105, -154,243,194,193, 25, 47,140, 39,180,154, 13,186,237,132,195,178,207,103,111,191,204, 7, 30, 95, 99,255,230, 30,113,119,157, 70, -191, 79,247,202,107,152,238, 93,103, 94,182, 72,183,224, 99, 95,128,190, 56,225, 19,191,254, 59,188,229,173, 95,195, 89, 10, 31, -253,215,255,156, 23,238, 92,231, 31,124,219, 71,120,219, 23,191,149,215,189,245,113, 68,175, 67,239,242, 67, 76, 39, 41,251,215, - 94,226,165, 23, 95,166,181,217, 71,209,100,146,101,188,238,205,143, 32,231, 99,104,247,104, 93, 80,100,131, 1,121,154, 99,187, - 61, 95,101,199, 17,152,194,119,233,206,103, 20, 46,124,193, 34,194,234, 20,107, 43,162,107, 47, 35,139, 41,235,189, 38, 7,239, -254, 70,182,126,237,103,177,183,239, 32, 59, 29,136,194,110, 55, 88,171,108, 61,162, 12, 20,188,186,131,164,102, 34, 91,111,111, -179, 89, 74,227,252,125, 60,251, 3,223,207, 75,159,250, 35,206,253,173,111,227,202,187,222,229,213,255, 34, 70,200, 10, 41,240, - 35,253, 70, 28, 72, 78, 22,225,108,136,237,116, 24,173, 17,198,226,242, 12, 83, 25, 58,253, 46,196, 13,146,102, 68, 85,134,160, -150, 58, 22,209,249, 49,178, 92,216,127, 2,235, 60,164,152, 73,165, 60, 50, 54, 4,210,248,145,173, 32,106,198,184, 74, 34, 90, - 94,188, 38,164, 66, 54,125,162, 91,212,246,137,103, 72,225, 69,105, 81, 4,221, 53,239, 13,143,130, 82,189,242, 99,121, 4,126, -134, 40,228, 82,229, 98,131,126,161,204,161,200, 96, 58,135,217,204,255,217,202,202, 91,239,194, 62, 91, 23,165, 7,134, 24,139, -169,252, 42, 1,107,194,127,107,108,101,124,151,222,106, 83, 21,254,242, 74,218,221,176,143,175,115, 37, 3, 75, 61,176, 18,254, -107,234,119, 55,155, 32,218, 93,223,112, 5, 98,154, 91, 97,161, 72,193,138,112,109,165,235,116,120, 76,112,232,209,189, 32, 42, -168,214, 9,226,184,122, 87, 29, 52, 93,102,201,210,172, 67,207,238, 25,173,215,161, 21,132,247, 77,172,122,228,101,184, 72,238, -217, 61,251, 46,167, 62, 20,197, 34,219,244,222, 96, 23, 27, 82,197, 22,197,128,242, 57,227, 43,243,120, 86, 34,179,131, 6,196, -219,215, 68,180,140,198, 18, 44, 11, 53, 33, 86,208,236,181,175, 61,164,124,121,229,248, 82,208,167,154,155, 88,151, 33, 85, 17, -188,240,154,205,175,253,190,197,196,167,142, 90, 22,171,217,176, 11,122,207,189, 69,205, 50,204,197,250,145,187,144, 1, 6,164, -125,231, 45, 20,198,152,165, 87,111, 97,177,243, 69,128,167,198, 73,164, 82, 88,161, 16, 90,250, 11,182, 38,245,213, 34, 60, 43, -188,160, 79,184,133, 61,205,163,121,189,174, 70, 58,131, 12,211,131, 5, 61, 14,139,211,126, 31, 47,132,243, 42,251, 56, 33,233, -116,152, 28,221, 33, 43, 75,210,241,152, 43,175,221,161,209,223, 34, 59,218,231,100, 86, 96, 81, 20, 56,230,218, 82, 74, 73, 20, -197, 20,149,163, 20, 17, 22,131, 14,116, 0, 21,169, 69,184,137, 18,146, 86, 92, 71,221, 66, 39,137, 40,141,161,212,134, 43,253, - 38,177,148,100, 84,228,198,208,111, 70,228,218,127, 47, 51,109,130,130,193,209, 75,212, 50, 51, 29, 47,176,203,173,163,112, 14, -109, 29, 36,130,216, 74,102,133,215,184,216,134, 96, 51, 73, 88,143, 37,202,106,154,145,247,249, 23, 69,142,214,118, 65, 88,174, -141, 10,139, 28,245,224,250,112,117,114,224, 74,177, 42, 86, 92, 38,171, 25, 67,220,155,113, 20,214,239, 53, 45, 49,172,188, 2, - 94, 22, 7,231,158,252, 42,158,254,204, 9,187, 27, 91, 60,253,242,211, 72,169, 56, 60, 61,224,190,139,231,184,212,234, 50,216, -155,208,109,198,156,140, 79, 57,191,118,129,146, 25,155,231,123,156, 93,135, 70, 35,102,156,142, 56, 43,142, 40, 15, 54,112,149, -101, 80,206, 41,117, 65,212,156,161,138,132,204,206,168,102, 57, 39,243, 9,141,168, 69,166,231,180, 84,147,202,165,160, 65, 59, -195,221,233, 49, 56,168,156,161, 52, 25,177,146, 20, 90,211,138, 19, 4, 21, 70, 84,148, 53,249,220, 89, 15, 51, 25,221,184, 78, -235,171,223,205,253,207,190, 76,222,104,240,216,249, 38,179,179, 33,221,205, 62,136, 45,140, 43,169,138, 9,186,204,104,117,214, - 41,210,130,141, 75,247,209,104,119,104,118,214,177,149,163, 44,231,200,188,203,228,108,204,206,149, 29,142,111,237,211,236, 14, -233,110,236,146, 52, 55,153, 12,166, 76, 15,175,178,125,229, 10, 14, 69,123,253, 28, 88,203, 99,239,252, 26,108, 62, 36,217,185, - 8,101, 78,126, 58,226,238,211,159,101,112, 50, 96,154,101,236,141,166, 12,203,130,172,210, 76,202,130,191,253,129, 15,242, 83, - 63,247, 75, 60,152,192,241,100,138,222, 19,116,183,182,105,245,214,176,191,255, 27, 72,213, 97,247,225, 39, 56,219,252, 19,252, -232,163,159,231,103,204, 19,220,185,117, 72,210,123,158,119,189,253,113, 94, 28, 31,112,119,127,196,159,255,251,255,146,203, 79, - 60, 76,188,242, 6,223,247,214,247,240, 37,192,123, 7, 39,252,221,111,249, 86,230,243, 57,198, 90, 62,252,157, 31,192,124,254, -115,168,221, 93,100,163, 67, 99, 83, 16,175, 85, 36,189, 62, 20, 97, 84, 55, 43,252,152, 79, 91,127, 40,135, 67, 72,103,115,152, -205, 17, 78, 96, 7,103,116, 47,158,131,193, 20, 51, 50, 28,127,217, 55,177,246,111,254, 30,241,246, 38, 98, 52, 10, 29,191, 12, -126,111,150,144, 10,235,194,120, 93, 4,167,156,195, 22,133,247,124, 54, 26,252,220,123,222,203, 90, 35, 98,237,194, 6,255,247, -207,254, 10, 63,244,103,191, 30,115,122,230, 31,230, 88,162, 98,133,212, 6,147,168,240, 0,175,140, 63,157, 65, 23, 21,107,253, - 14, 85, 81,178,182,189, 73,231,220, 57,140, 21, 68,113,228, 47,196,164, 5,162, 68,151,245,132,160,134,110,172,124, 88,234,147, - 91, 9,132, 86,139,241,165,140,226, 5,133, 43, 74,154,168, 36, 65, 37, 9, 50,248,190,101, 20,249, 14, 93, 37, 75,184, 75,187, -179,100,247,231, 83, 47,154,187,231, 54, 9,159,212, 34,243, 95, 83,148, 30, 62, 84,105,152, 76,176,101,133, 77,115,156,112, 84, -243,148, 50,203,112,214, 83, 96,116, 81,121, 97,116, 80, 50, 43,165, 48,198,171,222,141,241, 17,171, 78, 72,172,174,136, 34,181, -136,180, 92, 28,202,212,133,150, 89, 26,190, 95,221,169,223,185, 13,157, 30,206, 26,170,249, 28, 91,102,247,228,140,227,196, 2, -120, 33,156, 93,168,225, 17, 46,188,239,158,233,238, 86,253,229,181, 42,222, 9,132,114,139, 46,218, 31, 92, 98, 49,210,182, 97, - 55, 88,119,208, 82,137, 16,142, 97,125, 76,234,202,253, 37,213, 42,212, 35,236,244,195,228,102,209,129,215,162,203,154, 45, 47, - 87,252,236, 44,253,226, 30,232, 97, 3,143,124,165,243, 95,168,216,195,234,160,170,131, 92,196,189, 63, 87,134, 92, 22, 89,119, -226, 75, 49, 32, 34, 20, 50, 17, 11, 53,180,138,194, 26, 66,168, 32, 78,247, 47,210,125,226, 93,248,176, 80,185, 28,187, 59,231, - 71,239, 53, 3,126,113,233, 23,222,173,178, 96,196,251,157,185, 80,202,231,177,107,141,171, 10,255,157,137,226,149, 56,103,229, -197,111, 97,244, 47,149,192,234,192,153, 8, 23,180,139, 20,194, 69, 62, 48, 72,249,239,157, 53, 25,113,179, 7, 42, 70, 38, 13, - 28, 42,112,230,141,255, 6,184, 42, 8, 22, 67,212,106, 20,121,178, 31,222,207,174,211, 12,149, 52,112,206, 81,149, 37, 73,103, -141,108, 52,192,204,230, 88,163, 73,250,235, 36,253, 13, 78,126,251, 55,104,196, 49, 69,102, 73, 34,137, 17,146, 84, 59, 90, 74, - 34,132,229, 44,215,200, 40, 66, 25, 19,224, 63,126, 63,175,132, 67, 69,138, 72,107, 98,229,255,108, 74, 9,250,205,132,105,174, -233, 55,125,146,229,225, 84,179,221, 78, 48, 22,182,154, 17,198, 25,122, 66,161,132, 47, 26, 11,227,200, 42, 75,105,125,215, 46, -125, 29, 67, 67, 73, 34, 33, 49, 14, 82, 99, 57,152,103, 92, 94,107,251,145,186,112,164,101,137, 18, 80, 86, 26,105, 42,156,173, -130, 81,193,221, 19,141, 84,135, 29, 45,215, 76,203, 26,203,203, 20,195, 12,177,174,235,196, 50,138,184,166, 19,218,160,150, 95, - 72, 51, 88, 41, 4,156, 23,148, 70, 74,112,124,144,147, 52, 18, 94,190,181, 71, 83,180,233,118, 36,243,114,196, 31,190,112,200, -206,198, 14, 27,221, 54,103,217, 25, 13,209,230,230,240, 54,165, 26,240,112,231, 60,183,103,119,216,181,231, 56,206,206,120,160, -115,153, 27,195, 61,118, 91,235, 76,138, 33,153,206,200,210,148, 88,120,254,192,116,182, 79, 35,234, 80, 21,158,243,146,153,156, - 72,106,166,186,164, 29, 65, 34,125,228,121,105, 50,180,179, 76,179, 10, 37, 20, 78, 91, 42,163,177,133,159,187,106,103,137,148, - 4,155,192,214,133,243, 28,221,218, 99,242,210, 29,204, 96, 72,235,145, 71, 25,220, 25,210,234, 40,226, 40, 33,138,219,224, 44, -113,179,203,240,240,132,179, 59, 47,114,254,161, 7,144, 81, 66, 57,159, 97,172,160,211,239, 97,157,160,127,238, 62,108, 81,210, -238,172, 49,184,123,151,141,139,175,161, 42, 44,197,124, 64, 89, 76, 72,218,109,146,246, 54,201,100,202,225,237,231,120,104,253, -109, 20,147,129,135,126, 88,199,228,115,127,200, 44,157, 49, 76,125, 64,199,184, 52, 20, 70,147,196, 17,178,178,140,218, 45, 14, -175,222,162,219, 78,120,230,104,204,238, 44,167,219,122,153, 86, 43,226,116,111,143,167,159,125,153,159,255,229,167, 88,123,236, -107,120,235, 55,124, 27, 63,252,224,255,199,215,155,135,219,121,221,245,189,159,181,214, 59,236,241,236, 51, 75, 71,131, 37,121, -146,226, 33,142, 29,103, 32, 36, 77,194, 12, 33, 55, 12, 33,185, 52, 4, 66,128, 2,133,134,161, 64,128, 66, 9, 5, 2,148, 66, -105, 33,109,161,132,249, 50, 93,232, 45,195,101, 10, 16, 39,220,140,144,216,177,157, 56,150, 45, 89,211,209,145,206,180,231,253, - 78,107,232, 31,107,237, 65,208,139,159, 71,126,100, 89,218,103,159,173,247,125,215,111,248,126, 63,223, 38, 91,171, 13, 30,254, -130, 87,226,146, 26,127,242,219,127, 70, 81, 20, 60,240,210, 23,209,239,142,105,183, 83,116, 94, 80,159, 12, 16,209, 16,150, 26, -180, 86, 79,240,206, 63,253, 51,254,240, 39,126,144,254,115,151,144,221,125, 70, 85, 69,109, 48, 36,138, 20, 81, 20, 77, 31, 23, -254, 33, 63,201,102,156,103,103, 42,112, 33, 76,194,104,236,112, 12, 69,142,152,100,208,108,177,127,233, 58, 73,171,137, 80,146, -229,173,101,170, 55,125, 23,213,125,183,211,248,129,183, 17,109, 29, 71,143, 38,216,209,192,143, 98,101,228, 71,239,214,224, 74, -141,209,214,243,160, 91,109,100,163,197,213, 63,248, 93,254,246,167,222,205,198,198, 50, 29, 33,248, 64, 63,227,159,221,123, 7, - 84, 30, 10, 35,140, 63,253, 84, 28,225,134, 19,226,141, 21, 76,222,157, 61,213,189,231,221,146,143,199,156,186,231,118,140,133, -230,218, 10, 73,171, 67, 85, 22,184,170,192,150, 26,181,188,142,123,246, 25, 84, 44,201,123, 19,210, 86, 52, 59,208,230, 64, 77, - 19,132, 61, 17, 82,249, 66, 68, 42,133, 75,107, 68,137, 66,160, 80,177, 64,198, 53,207, 15,136,253,152, 93, 70,177,239,204,229, - 20,229, 41,252, 97,109,244,173,170,243,105,110,187, 79,105,240,249,211,163,161, 23,215, 5, 96, 9,186, 64,231, 37,174, 42,113, - 86,163,243,146, 98, 48,162,202, 50,191,127, 19,194,219,207,117,232,242, 17,152,105,180,237,108, 68,237,191,158,169, 42,162,180, - 65, 20, 71, 1,166, 18,172,108,102, 81,116,245,255,243,207,230, 49, 68,226,163, 62,111, 60,242,167,183, 50,212,103,249, 66, 33, - 13,112,177,163, 88,240,163,207,136,165,130, 5, 49,155,152, 5,190, 76,243,218,221,148,143,174,196, 45, 41,100,211,208, 20,235, -220,156,179, 97, 66,103, 30, 20,197, 86, 51,203, 59,159,109, 23,229, 66,209, 68,176,183,201,133,233,130,195, 39,220, 45, 40,138, -103,226, 60,231, 64, 59,127,249,235,176,134, 49, 94, 43,160,166, 54, 56, 53,215, 8, 76,233, 93,179,188, 37,233, 47, 1, 27, 42, - 10, 37,231, 10,114,107, 29, 24, 57,243,233,251,213, 67,215, 23,149, 10,176,146,218,169,251, 16,210,122,114, 28,229, 2,112,102, - 65, 8, 63, 3,198,216, 57, 50,214, 84,158,117,175,226,192,111,159, 11, 9,173, 45, 17, 34,194,149,102, 14,181,178, 97,183,110, -188,128, 85, 37, 45, 28, 5, 66, 58,156, 86, 56,109,144, 50,242,121,242, 98,154, 55, 56,125, 61,135, 20,102,193,129, 35,131,192, -112, 62,202, 17, 73,125,129,132,167,231,218, 3,231, 16,170, 49, 31,255, 75,168, 47,175, 19,199,146,124, 84,160,226, 24,198, 3, -134,219, 55,232,149, 26, 43, 35,191, 47,151,142,220, 69,232,202, 18,167, 9,185,182, 68, 18, 98, 68,200, 50,247,215,131, 18, 30, - 48,227,163,142,161,158, 42, 98, 41,208, 56,142,182, 19,234,113,196, 48, 47,103, 87,126, 35,241,154,154,186,138,200,141, 97, 92, -106,202, 80,116,233, 48,234,169, 69,130, 56, 92, 95,169, 18, 24,103,200,180,191,224,163, 52,226, 48,171,136, 5,228, 38,102, 45, - 86,180, 2,176,221,184,202,251,214, 3,105,208, 5,218,219, 44,161,109, 97, 26, 53, 29,175, 79, 47, 90, 37,230,178,159,169,222, -196,136,133, 24,231,233,118,244, 22,184, 83, 16,150, 34,194,202, 32,194,104, 77,169, 35,138,162,139, 41, 7, 28, 89, 63,202,167, - 47, 92,100,167, 24, 19,197, 17,189,237, 17,141,184,201, 65,126,200,177,246,109, 12,139, 1,153, 45,248,205,143,125,138,251,150, - 79,241, 76,247, 34,107,245, 37,174,101,215, 24,150, 61,238, 94, 57,193, 39, 14, 62, 21, 4,121, 48, 98, 68, 74, 68,110, 10,172, -179, 36,145, 79,246, 76, 4, 12,245,152,126, 49,228, 96, 82, 81,186,138,202, 24,140,211, 62, 91, 37, 76, 63,141,177, 84, 97,245, -227,107, 24, 73, 20,213,234, 36,173, 14,229,224,144, 43,195, 49, 15,189,250,126, 50,149,160, 79,220,142,123,246, 6,186,214, 66, -132,253, 72,146,166, 68,178,134,147,251, 28,189,243, 12, 73, 99,131,253,203, 79,209, 57,122,156, 90,125,153,170,208, 12, 15, 15, - 80, 82,120,224, 76, 93,209, 62,245, 60,250,123,123,228,131, 93,214, 78,220,201,201,123,238,231,242,227, 79,240,212,163,127,201, -201, 19,171,188,228,141, 95,195,185, 87,126, 57,253,203,159,196,140,115,202,113,206,120,255,128, 43, 79, 62,197,225,120,192,193, -254, 33,131, 50,103, 80,148,196, 74,208,232, 28,225,129, 7, 31,224,145,103,119, 73,149,100,167, 63,164,159, 21,108, 31, 60,193, -111,252,197,223, 51, 78,143,241,186, 47,123, 51,223,245, 31,190,131,123,206,110,208, 73, 43,218,107,203,172,222,113, 39,221,222, -136, 63,255,173,247,240,161, 79, 94,225,101, 15,223, 71, 90,143,113,198,144,141,115,100,145, 33, 6, 87,161,101,161,170,225, 84, -142,115, 9,175,251,222, 31, 97,231, 55,222,137, 25,143,105,108, 30, 69, 74, 65,209,237, 98,178,146,165, 19, 71,125,119, 56, 21, -194,184, 0,159,176,102, 94, 78,230, 25, 54,207,124,245, 20, 75,210,187,110,193,120,236,186, 0, 0, 32, 0, 73, 68, 65, 84,231, -230,239,254, 9, 13,235,168,199, 49,101, 81, 48, 92,170,179,243,201,231, 40, 63,231, 45,172,109,172,176,249,165,175,162,246,217, -175, 32, 58,117, 26,217,244,140,117,132,194,150,154, 98, 60, 98,124,254, 89, 14,254,239, 63,228,153,247,254, 61,153,181,140, 86, -150,200,242,146,103, 5,244, 39, 57,175,249,234,255,147,236,224, 0, 89,171,251,231, 69,161, 17, 88,186,215,118,184,240, 7,191, -199,139,222,254, 93, 20, 87,175, 99,180,193, 24,131,173, 42,116, 89, 82,140, 15, 81,241, 41,154,235,235,168, 90,221,143, 55, 99, -201,112,231, 10,107,119, 63,196,232,195,143,208,238, 52,217, 62,127,157,187, 94,124,123,248,182, 13, 50,142,112, 24,223,149, 76, - 91,192,192,232, 86, 82,162, 34,137, 74, 18,127,115,138,200, 19,222,162,196,251,203,147,122,160,186, 45,140,209,179,114, 14, 22, - 55,118,154,118, 17,252,193,118, 54,214,245,128, 29,129,155, 76,176, 69,233,247,101,149, 14, 65, 28,134,170,204, 41,122, 3,116, -145,161,203,210,247,175, 50,128,102, 8, 73, 91, 82,205, 19,212,132, 64, 88,235, 59, 52,225,225, 70,126,191,237,102,118,153, 91, -128, 37,206,254,111,187,116, 0,145, 68, 33, 56, 2, 62,253,159,255, 45, 22,129, 13,233,116, 76, 21,238, 51,248,203, 66,224,234, - 84, 28, 55, 13,242, 17,139,196, 26, 66,124,173, 8,135,158, 8,231,123, 16, 13, 89, 23,114,161,153, 91,215,194, 81,162,194,193, - 61,221, 47,206, 4, 93, 11, 84, 60,187, 0,163, 89,100,219, 76,235, 8,177,112, 6,185,185, 64, 58,124, 54, 83,245,114, 72,156, -179,115,213,252,220,202, 23,188,233,193, 90, 39,167, 80,153, 89,252,219, 12,153,227, 99,131, 67, 11,229, 66,170,220, 52,254,213, - 91,251, 2,149, 78,250,244, 54, 41, 36, 66, 89, 58, 47,123,227, 34, 40, 63, 28,232,225,157,171,152,121,230,173,157,171, 1, 77, - 1, 85,129,195, 34,226, 26, 78, 23, 51, 69,188, 51, 57, 18,111, 87,171,198,125,100, 92,247,201,107, 81,226,247,238, 42,242,207, -128,164,229,143,237,170, 64, 36, 49,198, 22,193,153, 81,120, 44,236,116,237,226, 34,172,214,200, 40, 37, 80,240,195,161, 31, 68, -132,214,204,175,161,176,135,183,101, 17, 10,175, 96,159, 11,145,214,214, 58,140,113,168,122, 13, 83, 20, 8, 83,146,245, 71,216, -201,132, 73,111, 68,174,167,133,176,194, 25, 65, 81, 84,244,181,165, 29, 37,224,160,172, 12,113, 44,105, 36, 49,218, 24,198,133, -247,213, 79,180, 37,150, 98, 6, 8,170,165, 10,133,163, 59, 49, 12,243,146,103, 14,199, 28,105,213,168, 41, 73, 86,105, 98, 33, -136, 35,191,207,157,186, 54, 34, 37,168, 41, 57, 35, 46, 24,235,125,228,131,210,160,132, 36, 17, 6,129, 99,162,253,232,219, 24, -195, 70, 77, 35, 19, 73,229, 52,202, 86, 36,104, 18,233,119,251, 46,172,149, 28,238, 22,160,145,148,129,237, 62,195, 48,135,221, -249,172,250, 20, 11,181,147,152,137, 79,253,170,200,139,225,212, 2, 29,194, 3, 1,189,232, 78, 37, 45,162,219,223,196,181,107, - 87,232,222,232,114,249,234, 33, 71,214, 45,203,109, 47,180, 60, 63,188,201,158,174,184,187,125,156,220, 76,120,114,255,105,182, -106,109, 70, 85, 73, 39,142,120,162,247, 44, 27,201, 38,221,226,128,161,169,184,163,189,204,249,193, 83,172,197, 75, 92,201,111, - 18, 9,133,115,130, 74,120,135,203,196,102,148,165, 14, 86, 80, 67,169, 43, 74,167,209, 70, 83,216,146, 72, 56,148,242,137,121, -214, 58,132,172, 16, 83, 43,116,104,172,192, 17, 57, 32, 27,244, 64, 43,170, 68, 48, 41, 43,246,175,108,147,212,234,108,156, 62, -193,222,238,136,113,211, 11,178,138,137,164,209, 89,103,121,115, 11, 93,120,117,118,218, 94,101,220,219, 39, 45, 75,132,104, 16, -215, 83,116,153, 35,165, 64, 53, 36,181,198, 10,217,184,162,177,182, 70,150,229, 60,247,222,191,230,255,120,251,143,240,198, 59, - 94,112,203,195,176, 42,251,228,189, 67,204, 96, 64,111,152, 49, 28, 15,233, 29,118,153, 88,203,165,222,136,205,102, 13, 45,224, - 35,187,187, 52,151, 82,218, 43,235,220, 28, 25, 12, 57,215,171, 9, 63,246,182,111,231,181,223,248, 54,146, 68, 17, 71, 5,163, -254,136,126,111, 72, 73,141,246,201, 19,244, 7, 99, 46, 62,126,158,229,186,224,193,187, 55, 57,186,182,140,176, 37,217,104,194, - 48,207,104, 79, 6,180,237, 5, 88,189, 23,198, 35, 40, 13,178,115,198,167,228,188,241,109,240,200,239, 64,187, 1,237, 37,210, - 56,166,251,196, 69, 58,175,120, 0,198, 19,175, 4, 17,248,177,180,214, 97,206,104, 65, 87,232,241, 48,124, 22,117, 76, 94,145, - 30,221, 32,115, 48, 44, 42, 70,189, 9, 53, 41, 88,170,199,196,245,132,201,198, 18,187, 10,250,191,251,151,216, 95,248,127,136, - 87,188,160,108,255,112,192,110, 85,177, 12, 68,206,145, 72,129,109, 55,232,119,218,116,139,146, 65,169, 61,244, 54, 82, 60,124, -114,139,250,242, 42, 21, 2,167, 60,100, 98,202,175,190,237,246,187,121,231,247,255, 59,142,189,248, 65, 86, 30,120,152, 73,111, -132, 45, 11,116,165,105,180,106, 28, 94,185,204,243, 62,251,179, 64, 58,226,102,155,114,212, 39,109,164,244,175,239,176,113,231, - 41,132, 84, 94,120,110,133,199,101,138,185,154,218, 25,188, 71,125,225, 0, 82,113,130,177, 6, 21, 53,124, 28,173,246,118, 48, - 31,124, 17,251, 81,123, 28,133, 49,189,245, 35,246,105,239,175, 75, 31, 93, 25,120,230, 82, 4, 4, 41, 18,148, 64,143,198,179, -192, 17, 33, 5,182,204,209, 89,225, 71,204, 74, 80, 78,114,202, 81, 31,147, 23, 88, 93, 98, 75,237, 35, 57,162,200,163,119, 69, - 24, 97, 91,139,139, 21,210, 5,245,172,243,176, 17, 57,245,177, 6,181,143,147,206,227,111, 23, 15,115, 59,133, 89,252,227,125, -250,212,206, 38, 34, 69,213,235,205, 14, 25, 33,194, 3, 8, 55, 31,185,179,216, 96,139, 91,226, 73,165,243, 15, 40, 25,162, 62, - 23, 23,130, 83, 70,186, 91, 32,156, 79,107, 0,187,128, 83, 21,179, 67, 59, 8,211, 66,170,153, 8,103,158, 13,175, 51,141,158, - 12,122, 48, 66, 72,152,255,117,237,110, 25,221,207, 87,208, 33,198, 85,204,167, 1, 98, 65, 77, 44, 52, 16,205,225, 57, 78,134, -105, 67,168,217,166,224,152, 41, 38,150,120,170,213, 80,200,116, 3,103,199, 56, 61, 14, 62,125, 49, 83,146,251,142,213,175, 64, -166, 54, 56,172,163,245,208, 23, 45, 88,217,220, 2, 52, 38,154, 23,223, 51, 36,112, 8,224, 54,193, 90,103, 23,132,159, 50,242, - 5,162, 13,172,246,217,247,171,103,108, 6, 33, 20, 78, 9,148, 51,254,112, 87,137,215, 93,136,224,146, 48,102,238, 62,176,115, - 65,164,191,204, 42, 36,177, 47,214, 45, 97,183, 46, 17, 70, 5,141,138,197, 57, 63,157,179, 86, 35,130, 93,212,123,211,141, 47, -224,164, 68, 56,131, 43, 11,207,133, 16,130,214,114, 11,138, 9, 66, 42, 42, 11,149, 19, 72, 33, 73, 34, 5,202,162, 43,199, 40, - 43, 64,137, 16,207,224,104,165, 49,227,202, 97, 38,150, 72, 74,143,122,181,130, 72, 40,180, 55, 31, 16, 71,146,205,102,202,167, -246, 70,156,234,212, 56,177,220,160, 55,174, 40,181, 65, 59, 40,171, 18,171,125, 6,123, 25, 0, 78, 94, 32,234,175, 20,141, 69, -135,172,115,132, 13,162, 61, 75,174, 29,101,170, 80, 73,194,164, 48,140,157,162,150, 72,150, 27,117, 98,107, 16,182, 2, 91,249, -189,121,136, 28,182, 83, 74,156,155, 23,198,114, 86, 24, 65, 36, 4,122,150,238,182,224,128,112,211,214, 93,206,215, 65,161,192, -150, 66, 32,164,194, 90, 75,218, 57,194,218,171,191,149,157, 27, 41,227,124, 64,205,246,232,246,174,243,188, 83,183, 83,230, 17, - 39, 78,172,178,115,179,207, 75,206, 62,143,237,253, 62,191,251,236, 71,233, 87, 19, 16, 17,253,114,192,233,230, 73,127,201,197, -130,189,114,159,187, 91,199,185, 52,222,161, 19, 43,210,200, 81, 34, 48,182, 34,145, 17,145, 18, 20, 38,199, 57, 67,102, 10,154, -202, 48, 40, 50, 34,169,208,182, 10, 79, 67,175,251, 41,173, 65, 27, 59, 43,250,116, 32, 35, 10, 4,149, 53,179,130, 38,202, 6, - 61,146, 36,165,146, 57,182,148,196,175,126, 21,247, 28,222, 96,188,115,192,176,236,226,154, 45,170, 68, 18,199,117,146,218, 50, - 68,222,214, 20,165, 41, 7, 23,182, 73,234, 19,234,173, 13,172,213,104, 3,217, 96,224,171,221,162, 79,123,125, 9,235, 34,138, -236, 38, 73, 45,230, 21,111,254,118, 58, 91,103,124,184,105, 85,248,221,149,113,168, 52, 37,138, 35,138,124, 76,118, 99,151,253, -237, 29,114,173, 73,155, 13, 14, 15,187,108, 53,106, 44,181, 83, 62,252,236, 21,254,228, 23,254, 11,159,250,244, 14,247,223,113, -140,139,103, 31,230,205, 95,248, 48,111,252,174, 31,196, 53, 20,213,184,139, 41,115,118, 46,222,160,215, 47, 72, 91,109,150, 87, -150, 57,236,246,201,187,125, 46, 95,188, 64,163, 94,227,182,141, 22, 27, 29,199,104, 48, 33,191,177, 79,111,231, 6,207,151,123, -208,220,135,218, 50, 90,198,216, 44, 35,121,232, 56, 66, 36,144,180,112, 71, 79,248, 11, 99, 52,128, 40, 33, 43, 52, 43, 83, 14, -167,158, 70,187,150, 97,222,233, 51,150,201, 51, 92, 81, 16,175, 44,251,155,124,255, 0,171,225,254,175,123, 61,191,244, 99,191, -204,177,147,171, 28,228, 21, 3, 99, 25,219,156,150,148,104,107, 41, 99, 73,235, 72,135, 78,171,197, 40,203, 72,215,154,136,220, -112,224, 28, 43, 82,112,169,172, 56, 40, 12, 53,105,168, 43,197,122,228,200,140, 99, 60, 28,241,205,239,252, 30, 38,251, 7, 36, -107,171,126, 84,133, 67, 88, 75,163,209, 96,112,208,227,243,215,219,252,234,191,249, 25,190,242,251,191,133,206, 61,247, 51, 25, - 14, 25,246, 7,156, 58,125,146,209,213, 29,108, 49, 33,105,180, 17, 82,161,179,130,201, 36,163, 49, 25, 67,156,160, 90, 45,234, -195, 49,253,113, 6, 34,116,157,206, 34,173,131, 40, 4, 41, 74,159,107, 45,241,187,113,101,133, 31,181, 43,229, 71,173,137, 79, -159, 34, 73, 67, 39, 51, 29,105, 87,254,146,212, 65, 93, 28,194,119, 92,248,255,179,206, 54, 73,160,178, 62, 29,174,172,188, 64, -204,248, 74, 95, 32,112, 85, 69, 62,202, 48,217, 4, 61, 30, 98, 70, 99,116, 49,241,161, 13, 14,100, 18, 17, 37, 13, 84,163,134, -178,201, 44, 23,219, 38,113,208, 64,132, 49,188,240, 10, 96,127,215,155, 57, 26,116,202,181,159, 5,114,252, 19,224, 25,103, 25, - 93,185,228,195, 60,102,152, 88, 49,239, 18,103, 96,153, 48, 98,118,142,230,177,219, 89,125,254, 11, 89,125,225,139,193, 88, 6, - 23,159,162,251,233, 79,145,109, 95,160,234, 30,248,215, 80, 10,129,153, 13, 44, 36,115,111,183, 53,115, 15,187,176, 11, 94,110, - 21,210,204, 4, 51,207,248,236,207,203,169,181, 44, 60,229, 2, 74,118, 22,129, 26,102,152, 51,203, 92,152, 18,139,208,109,223, -114,136, 79,159,162,194, 34, 2,212,221,153,133,213,128, 37, 0, 98,110, 5,127,120,133,187,244,163,123, 5, 34,174,145,172,223, -141, 25, 95,163,234,143,103,120, 88, 59, 21, 2, 42, 22, 96, 61,222, 58,152, 28, 61,131,170,165,248,199,102,216,167,187,248,214, - 50,196, 11, 2,194, 23,173,194, 24, 93,123,149,186,208, 11, 39,128,156,165,170,121, 4,172,245,177,169,214,121,130,101,210,242, -157,189, 0, 23,213,231, 7,184,138,230,161, 81,206,161,162, 20, 67, 25, 10,223,114, 70, 2, 52, 70, 35, 93,224, 14, 84, 5, 42, -109,250, 34, 25, 60, 77, 78,120, 94,188,119,146, 68, 30,195,173, 36, 34,173,133,240, 39, 13,198, 33,226, 4,149, 38,216,170,160, -221, 73,169,183,155,184, 84,210, 47, 52,101, 40,150, 70,218,209,110,198, 48, 42, 61,137, 78, 64, 77,137,128,153,118,164, 9, 68, - 70,134,201,143, 37,175, 44, 73, 61, 33,142, 4,163, 66,163, 90, 49,251,131,156, 84, 41,106,145,100,185,150,210,172, 71, 92,233, -231,236, 79, 42,142,119, 82,138, 10,198, 78, 19, 43, 15,136,242,246, 56, 67, 21, 10,212, 41, 56, 47, 81, 94, 43, 36,164, 32, 22, -146, 84,249,146,174,176, 22, 35, 19,100,164, 16,210,226,116,137,146, 80,234, 10, 25, 2,174, 92, 40,132,221,130,208, 77,178,112, - 95, 45, 28,246, 50, 92, 96,206,134,200, 94, 49,159, 20,205, 24, 1,179,169, 84,132,192, 82, 91, 57, 70,243,249, 95, 67,175,172, -241,220,197, 30, 42,142, 40, 51,203,181,139, 59, 28, 89, 62,194,242,122,139,235, 59,251, 40, 89,167,158, 26,210,180,197,241,141, -101,254,205,209,231,113,225,234,179, 92,232,109,115,126,188,205,163,131,167, 40, 74, 67, 28, 69,212,101,141,139,227,109,140, 43, -185, 58, 57,240,133,183,179, 76, 76, 73,129,183,165,149, 78,147, 72,133, 20,142,189,108,132,113,142, 68, 74, 10, 91,145, 42, 69, -102, 12,101,101,169, 48,180,226, 4,237, 44, 58, 40,252,149, 20,196,194,147,251,150,146,134,143,195, 45,179, 17,227,222, 77,146, - 90,135,102, 99,137, 79,156,191, 66,231,215,254,128,214, 23, 62,204,234,139,158,199,166, 75,136,182,111,114, 37, 54,136,202,114, -241, 35,239,231,220,203, 95,137, 74,218, 44,109,172, 80, 91,218,162,202, 53, 69, 54, 32, 77, 19,180,171, 51,190,121,131, 56,133, -246,250,253,244,111,238,115,223,171,191,140,187, 94,254,154,217,216,177, 40, 11,138,220, 43,196,227, 8,204,164, 32, 74,235,216, -186, 96,210,239, 83, 91, 91,102,120,233, 2, 67,173,217,155,100,156, 94,170,179,223, 27,240, 5, 95,250, 90, 58,155,199,185,187, -209,225,249,169,224, 45, 95,251,235,168, 78,155, 97,111,143,131,139, 93, 70,253, 1,163, 97, 69,189,179, 74,220, 74,152,228, 5, -131, 73,142,156,140,217,190,112,141,189,131, 33, 7,227,125,206, 28,107,163,145,236,236,116,185,116,237, 58, 87,119,122,220,251, - 57, 91, 56, 21, 51,122,246, 41, 92, 99,137,228,200, 41, 24,236, 65,231,184,127,223,205, 21,191,251,213,134,254,223, 61,198,250, -131,231, 32, 27,207,163, 19, 69,136,239,180,129, 36,167, 43, 76, 54, 65,198, 10, 81,107, 82, 29, 28, 32,106, 41,206, 22,172,189, -248, 33,222,252,195,138,119,255,216, 47, 35, 74,195, 94, 44,104,198, 49, 69,228, 11,250,178,240, 54, 19,121,216,163,210,254, 48, - 26, 78,253,151, 73,132, 22,126, 76, 55,168, 44, 55, 74, 67, 34, 5,159,113,223,157,124,245, 15,252,107,138,241,144,100,101, 25, -153,166, 94,224,147, 21, 48,201,169, 73,193,240, 96,143, 19,247,223,205,248, 19,159,230, 23,223,249, 46,190,250,219,191,142,244, -204, 93, 84,147,156,254,206, 21,198,227, 17, 66,196,200, 56, 66,231, 99,178,238, 1,198, 56,118, 47, 60,197,217,242, 53,190,195, -142, 36,131,131, 49,213, 48, 71,182, 26,126, 71,171, 75, 80, 53, 31, 60, 1, 62,105, 42,246, 2, 51, 17, 9,159, 93, 30, 62, 39, -169, 34, 68,156,250, 7, 95,165,131, 61,202,120,236,173, 94, 80, 30, 91,237, 5,135,110,190,199,118,214,226, 38, 25, 14,139, 45, -253, 68,164,202, 60, 62,215,134,177,165, 45,114,108,158, 97,242, 9,186,219,163,220, 63,164,218,239, 81,105,131,106, 55, 81,173, - 22,172,134,131, 47,149, 62,147, 27,188, 42, 63, 18,184, 50,128,125,148,158, 31, 8,129, 79, 62, 79,233,181,243, 93,243, 63,241, -143,140, 34, 62,241, 67,223,228,209,182,210,239, 89,231,142,238,233,174,219,139,147,134,173, 35,252,230,190,229,198, 83, 7,152, - 79,254, 5, 95,124,209,240,166,239,252, 54,142,191,252,117,164, 67,120,238,202, 1, 71, 4,156,232, 12, 57,255,239,191,149,241, -149, 11,179,192,149,233, 30, 92,132,113,253,148, 64, 71,232, 96,253,200, 59, 28,204,204, 19,135,229, 66,182,186,239,118,152, 45, -246, 23, 49,173, 44,168,224, 67, 21,177,208,169,251, 52, 55,233,220,188, 75,183,204,137,117, 1, 49, 43, 3, 52,103,166,233,159, - 2,103,172,152, 5,189, 76,255, 45, 16, 8, 59, 33,191,249, 40,194, 22, 11,224,154, 69, 78,126, 96,127,199,114,166, 44, 95,255, -178,119, 4,222,187,143, 94,118, 97, 23,187, 16,121, 51, 29, 61,248,209,185, 84, 80, 45,134,241, 24,132,174, 22, 57,190, 88, 36, -206, 86,216, 42, 40,104, 84,132,164, 54, 67, 4,169,184, 22,162, 65, 43,255,185, 68, 9,174,200, 17, 88,111, 61,139,162,217,251, -115, 1, 57,235,117,105,222,199,142,211,179,252, 4,144,222, 57,128, 15,169,178, 65,101, 31,165, 41,149, 46,102,176, 33, 39, 5, -174, 50,144, 68, 20,253, 67,170, 73,134, 84, 17,122,156,131,174, 40,246, 15, 25,143, 75,114, 20,218, 58, 38, 82, 82, 71,144, 70, -138, 82,130,214,150, 72,121, 81, 91,101,172, 79, 60, 11,163,231,178,244,211,171,188, 40,193, 70, 84,149,225,202,225,152, 84, 73, -206, 31, 12,169, 44, 12,243,130,188, 76, 57,179,210, 96,171, 25,163, 29,140,179,138, 72, 66,169, 45, 89,165,201, 45,212, 35, 95, - 60, 21,214,206, 70,228,133,241, 48, 25,140,195, 8,141,182, 18, 37,194,116, 64,151,212,141, 34, 21,150,178,178,148, 78,147,134, -221,143,156,130,118,132,155, 14,154, 66, 81,231,110, 49, 46, 76,119,205, 83,125,138, 96,158, 49, 32,165,152, 23,152,224,139, 78, - 28,141,229, 99,172,125,230,183,112, 56,132,231,174,238,121,154,160,128, 74,143, 24,246,187, 28,223, 92,103,235,220, 42, 55, 47, - 14,216,186,237, 4,137,108,160, 26, 29,138,209, 16,131,100,167,119,192,185, 7,239,225,206,226, 46, 30,222, 27,145,226,216, 31, -246,121,102,255, 2,143,236, 61,205,118,214,167, 48,150,152, 9,157,180,134, 82, 30,221,173, 3, 79, 63,215,134, 67, 83, 98,173, - 65, 74, 69,170, 20, 19,171,137,132, 96,179,150, 18,219,132, 87,158,219, 68,152, 58,227, 73,201,176,212, 24, 4, 78, 73,246,243, -130,155,121,159,145,246,230,196,227,173, 51, 68,197,184,192,138, 26,169,148,140,199,125,114, 33,121,233, 15,124, 29,246,137,167, - 41, 62,249, 81,220,131,175,166,115,230, 12,199, 14,110,178, 61,233,115,230, 5, 47, 66, 23, 26, 40,104,174,174, 50, 58,232,209, -191,254, 12,171,167,110, 99,112,120, 19,168, 88, 61,121, 6,107, 38, 76,186,187,124,222,183,253,248, 44, 58, 52,171,124,238,176, - 49, 62, 14,213, 26, 67, 81, 57,170, 66,211, 72,155, 68,171, 53,110,124,242, 73, 26,141, 38,119,157, 56,194,222,238, 13,206, 45, -111,241,200,149,235,152,213, 45,190,241,219,223,206,206,238, 14,173,163, 27,196,245,132,237, 27,123,232, 75, 87, 24,246,199, 20, -149,161,214, 92, 34, 93,170,211,237, 29,112,216, 29,178,185,190, 70,119,239,128,222,225, 33, 7,251, 93,174,119,135, 92,185,177, - 71,167,190,201,126,191,224, 35, 79, 62,199,249,103,158,161,187,115,153, 63,187,222,230, 11, 95,190,133, 56,113,138,216, 88, 38, - 7,123, 44, 35,168, 63,224, 15,117,115,254, 9, 92,103,157,201,246, 13,198, 2, 58, 27,235,222, 62,165,148, 63,208,197,162,101, -197,143,187,165,144,136,122, 11,147,103,216, 60,247, 21,172,209,216,188,224,216,231,188,146, 31,252,202, 55,248,208,154,238,144, -189, 39,158, 68, 40, 69,125,109,157,165,141, 53,212,164,242, 93,139,115,184,202, 50,220,221,131, 34,103,251,217, 11,116,247,123, - 16, 69,108,221,113,154, 99,119,222, 65,173,213, 34, 90,234, 80,228, 19,162,213, 53,127,227,231, 57,228, 5, 20, 57,145,177, 84, -163, 1,201,225, 30,175,254,201,159,227,195, 47,126, 25,175, 62,182,206,239,252,236,187,121,205,155,223,192, 93, 95,244,185,252, -231,239,252,126,190,249,123,222, 66,229, 28,137, 49,184,162, 96, 60,232,163, 77,197,164,187,195,228,176,143, 72,235, 36,233,152, - 40, 85,216,188, 32,106,213,112, 81,132, 19, 18, 41,195,142, 87, 41,132, 10,177,145, 74, 33,100,140,140,124,144,133, 19,218, 7, -193, 40,233, 71,155,206,120,239,247, 52, 50,212, 4, 91,218,244, 80,178, 94,167, 96,243, 2, 83, 25,172,213,184,224,151,245,124, -144,138, 42,203,144, 66,249,145,164,211,216, 73,134, 29, 15, 40,119,119, 41,119,246,169,122,125,156,246,202,229, 42,235,134,156, -110, 15,238, 64, 42,164,244, 15,104, 34,131,179,106,230,163,198,201, 89,212,232,148,243,230, 57,219,206,219,141,166,251,254,127, -130, 36,151,237,109,211,253,196, 71, 80,105,157,120,117, 19,226, 6,205,227,167,153, 28, 14,145, 82,177,247,212,163,212, 19,201, -119, 63,126,147,107,250, 26,167, 54,150, 89,111,166, 92,233,102,252,204,255,252, 45, 62,240,177,199,248,161,159,124, 7, 71, 86, -215,184,124,169,224,201,254,144,222,225, 1, 47,122,243,175,241, 89,175, 58,197, 51,239,252,102,110, 60,242, 39, 11, 7,112, 16, - 18,205,215,231, 76,237,209, 56, 49, 87,159,107, 55, 35,255,201,160,222,118, 97, 98, 48,101,176, 76, 31,150, 98, 58,207, 55,206, -115,221,157, 67,204,152,235, 83,203,226,124,226,237,228,130,130,120,250, 62,172, 91,200,120,247, 34,187, 25,254, 75,122,180,108, - 20,135,174,123,150,240,230,192, 14,103,107,111, 25,205,237, 70,211,215, 83, 42, 20, 43, 66, 34,155,171, 52,206, 61, 28, 2,159, -220,194,225,206, 92, 20, 55, 5, 6,133,145, 46,214,132, 67,116,238, 13,116,186,240,157,177, 89,132,207, 72, 16,202,111,249, 85, -144, 83, 11, 9,198, 95,147,200,200,179,223,141, 3,157, 97,116, 53,179,117,138,194, 66, 36,176,149,241,143, 7,227,176,145, 35, - 10, 33, 66, 70,107,226,122, 43, 48,200, 35,156,244,110, 19, 27,190, 47, 39, 45, 82,251,229,177,197,122,241,102,173,134,197,139, - 92, 69, 90, 39,219,223, 1,107,137, 27, 9, 81, 42,201, 46, 95, 36, 15, 96,164, 10,168, 42, 75,175,176,172,180,107, 76,122,222, -133, 97,140,161,211, 72, 25,230, 21,121,128, 23,201,160, 53, 81, 82, 80,139, 36,251,147,146, 90,164, 48,165, 97, 96, 43,122,133, -161,157, 72,180,129,237, 94,198,206, 32,167, 21, 43, 54, 59, 77, 42,231, 80, 82,178,148, 40, 26,177,162,151,107, 70,165,246, 35, -120, 55, 93, 22, 57, 74,231,131,168,148, 16, 36,210, 23,136, 54,128,177,198, 37, 92,177, 21, 35, 5, 43,177,163, 35,131,112, 82, -204,147,254,102,102, 10, 57, 95, 4,137, 32,174, 20,145,215,149,168, 16, 59, 60, 53, 21,204,177,175, 65,172,233,252,239,169,175, -157,100,227,101,223,196,225,176, 98,104, 37,251,215,187, 24,107, 88, 61,186, 68,189,153,240,216,223, 62,193,198,250, 18,141,206, - 50,166,172,177,116, 36,161, 86,111,208,187,153,177,212,105, 80,182, 87,105, 52, 37, 85,166,217,219,185, 65, 81,106,164, 45,121, -110,127,159,227, 39, 78,241,210,141,101, 30, 58,243, 18, 18, 7, 55, 6,135, 92,175,174,240, 87,151,159,224,234,160,135,148,146, -134,138, 89, 77,235,220,222,108,178, 25,183, 57,190,180,201,122,125, 25,107, 13, 7,163, 33,107,205, 54,105, 11,122,195, 49,245, - 52,225,198, 65,143, 36,105,208,138, 29,207,246, 14,137,180, 98, 47, 27,147,198, 45,180,200,105,171,136,213,250,105, 34,149,214, - 16, 86,115,184,125,157,110,175,199,145,163, 91, 60,146,103,156,155,140,217, 60,121,140,242,111,255, 18,115,230, 78,142,223,251, - 50,250,143,127,144, 82, 9, 38,131, 46,131,131, 79,113,228,204, 61, 44,173,175,210,218,120, 25, 85,214, 99,253,248, 50,221,189, - 27,104, 51,228,200,169,123,121,248,203,190,117, 86, 77, 77,138,146,178,208, 20, 89,137,174, 42,162, 88,129,182, 68,145, 64, 73, - 77,111,208,162,117,100,133,157,143, 61,197,206,206,132,194,122, 72,194, 7,174,221,160,185,121,138,175,250, 23, 95,207,216,228, -196,157,101, 42, 20,105,189, 78,167, 35,217,126, 46,135,180,198,210, 82,141,209,104,204, 96, 52,166,127, 56,224,250, 94,223,123, -234, 15, 45,127,247,228,121,142,172,172, 80,100,125,122,221,155,252,245, 71,246,185,227,196, 17,234,162,224, 96,251, 57,234, 42, -227, 39, 63,118,141, 7,143, 88,148,117,196,181, 58, 34, 78, 40, 75,203,201,187, 95,140, 77,154,252,250,119,255, 87,190,250, 87, -127,156,246,169, 99,180, 95,112, 15,140,250,129, 57, 30, 45,220,248, 83,210, 90,160,188, 9,129,209, 6,221, 31, 6,180,170, 68, -196, 49,209,234,138,159,121,222,188, 65,179, 86,131, 83, 43,116, 78,159,246,213,183,177,208,235, 97,179, 46,165,241,234,109, 93, -104,210,118, 27,219,104,114,250, 5, 29,110,171,140, 7, 91,196, 10, 42,141, 30, 14, 17,113, 68, 92,171,133, 67,209,248,135,117, - 44, 16, 81, 29,161, 53,205,219,142, 19,111,172,147,191,255, 47,121,235, 47,253, 44,191,254,245,223,206,195, 71, 86,248,179,223, -248, 61, 54, 30,253, 4, 15, 55, 90,168, 86, 29, 65, 9,174,134, 72, 83,172, 54,152,202,144, 68,142,253,243,207,176,182,126, 28, -181,179,139, 41, 13, 66, 89, 92,101,144,169,242,221,139, 84,168,216,195, 52,100, 82,247, 62,116,231, 61,187, 34,242,163, 72, 39, - 67, 32,134, 46,189,109,204,122,175,188, 11, 7,187,127,200, 78,187,114,131,201,114,108, 89, 98,139, 10, 93,230, 94, 8, 63,243, -251, 18,124,241,194,119, 82,206, 98,198, 19,220,100,136, 25,140,176,253,204,199, 57, 52, 86,144,169, 34,105,181,137,234, 9,149, -177,200, 68,249,236,239, 48, 5,240,118,163,208,186, 58,231, 21,229, 34, 4, 64, 44, 60, 60,188,194, 86,254, 3,114,203, 63, 26, -188,251,137, 74,164,200,158,254, 4,247,124,247,187, 56,184,182,203,205, 75,151,217,217,221,229,218, 83,187, 12,199, 19,158, 61, -184, 73,146, 46,241,103,159,190,198, 91, 94,250,124,126,230, 39,127, 24,217, 92, 65, 38, 49, 66, 68, 60,242,190,255,143,207,254, -250,239,228,191,191,235, 23,248,150,111,249,122, 78,180, 98, 30,185,178,207,243,207,222, 78,191,183,203,239,253,222,144,151,127, -251,187,249,188,239,235,241, 55,175,123, 0, 83,228, 11, 8,216,169,117, 39,104, 29,166,239,105,138,162, 93,196,194,134, 46,102, -218,149, 79, 61,241,146,233,231, 49, 79, 68,115,102,225,207, 46, 44, 42,167, 10,250,233,131, 86,168,105, 22,246,212, 87, 46, 22, -124,231,204, 56,237, 8,129, 12,114, 49,103,167,194,192,121,231, 37, 3, 17, 76,170, 91,131, 92, 84, 34, 49,198,205,240,185, 66, - 56,150, 95,241,166, 25, 55, 96,190,192, 22,115, 11,192,244, 30,181,102, 38,138,196,234,105, 30,172, 47,204,103, 45, 96,216,157, - 75,137,140, 19, 76, 85,122,145,188,209,222,182,102,181,167,190, 9, 17,212,240, 18,135, 9,201,132, 17, 72,139,209,165,239,238, -141, 15, 62, 18, 82,225, 68,229,215, 83, 74,225,148,242, 91, 29,225, 97, 41, 82,197,190,192,136, 20,166, 44,252, 90, 43,173,225, -202, 18, 45, 53, 42, 78,166,251, 14,144, 9,174, 44,177,177, 68,232, 18, 85, 75, 65,197, 52,218, 49,205,213, 85,246,254,254, 81, - 34, 97,209, 66, 33, 36,228,133, 65, 24, 71, 77, 73, 90,141,132, 81,158, 19, 71,138, 81, 86, 96,172,223,151,207,102, 26,129,162, - 86,134, 9, 70,105, 12,147, 80,116,215, 99,197,168,244, 12,135, 78, 44, 16, 66,177,147,105, 46,143,122,156, 94,105, 97,170,138, - 49, 16, 73, 65, 43,150, 40, 17,209,203, 43, 42,227,166,112, 94,106,193,255, 58,195, 70, 79,157,133, 64,238, 28, 74, 67, 75, 56, -198, 62,175,138,166,128,250, 20,223,176,248, 87, 57, 93,249, 4, 65,165, 80,120,119, 75, 56,180, 9, 78, 12, 43,131, 49, 34, 16, -230,156,244, 60,136,135,223,246,110, 62,245,232,115, 92,190, 62,166,204, 44,234,176,164,210, 35, 90,203, 13,164,148,236, 93,238, -161,164,229,200,169, 83,232,178,164,202,156,119,237, 68, 13,154, 43, 9,147,193,128,173,179, 91, 28, 92, 61,100,251,194, 5, 92, -165, 88, 90,235,112, 80, 56,238,190,227, 54,150,214, 91, 52, 59,138,107,207,237,225, 74,203,102, 35,166,186,226,248, 87, 15,189, - 12,164,166, 24, 86,116,150, 26, 92, 59,220,231,206,187,215, 57,255,169, 93, 80, 21,157,173, 26,174,140, 16,106,204,206,160,143, - 28, 59,164, 90,193, 85, 41,133, 53, 92, 31, 14, 88,173,173,114,119,103,131,237,108,151, 35, 13,201,197,201, 54,210,149,156, 89, -123, 53,131,106, 66, 52, 25, 31,210,108, 29,197,202, 33,155, 39, 78,210,219,189,206, 53, 35, 57,123,114,157, 39,222,253, 39,156, -124,203,107, 57,254, 69,175,163,251,129,247,113,239,201,179,124,250,230, 53, 76, 26,177,122,226, 46,134, 7,219,148,147, 62, 42, - 78, 73,219,171, 88, 36,157,245, 85, 54, 78,221,203,185, 87,127, 5,206, 57,186,131, 9,217, 56,167,158, 74,198,227,146, 86, 43, -161, 44,253,158, 50,173,123,232, 66, 49, 49, 76, 38, 25, 89,121,134,214,201, 79,210,188,126,133,131,155, 61,164, 84,220,249, 25, -159,205,179,251,154, 23,188,244,126, 14,179, 18,153, 38,140, 6, 99,226,162, 68,138, 8, 13, 68,145, 67, 23, 37,101, 53, 70,202, -156,173, 35, 41, 31,122, 98,207, 91, 90,148, 98,216, 31, 48,234, 31,242,216, 19, 79,177,185,210,160, 55, 46, 24,142, 70,232, 73, -198,234, 82,139, 81,175, 75, 15,120,235,255,251, 36,191,240, 26,139, 56,210,160,117,242, 52,217,246, 69,196,100,200, 71,254,237, -191,229,171,127,246, 95, 19,103,125,116,149, 19, 9, 59,139, 85,117, 73, 26,238,132,169,224,107, 33, 64, 34,142,176, 89,134,213, - 21, 42,138,112, 81,140, 76,107,200, 78,123,134,166,116, 82,133,216, 79,227, 51,223, 39,149,183,175, 53,154, 72,145, 19,201, 8, -149, 56, 72, 35,255,170,193,106, 19, 53, 26,168, 70, 72,124, 10,147, 2,161, 66,135, 81, 26,168, 74,175, 70,119, 22,213,106, 34, -147,148,218,210, 10,160, 88, 63,125, 55, 47,122,227,159,243,193,223,253,115, 30, 62,185,198, 31, 93,185,198, 43,163, 26,227, 43, - 55,125,124,109,200,145,182, 14,210, 90,130,137, 12,187,231, 31,101,253, 85,255, 12,241,228,199,188,115,207, 74,162,162, 68, 52, - 91,200, 72,161, 66,103, 46, 3,123,221,227, 48,167,231,158, 12, 65, 22,126, 76,105,221,188,155,117,214,191, 87,111,133,210,158, -113, 95,149,152,188, 66, 23, 5,182,242,224,152,169,218,121,209, 23,110,157, 9,208, 62,135, 43,114,156, 46,113,113, 3, 26, 22, -181,169,136,140, 69, 68, 49,170, 86, 71, 53,235, 8, 83, 81, 7,116,150, 83,185,128,139, 53, 37,200,186,239,114, 3,157,207,119, -131, 54, 32, 97,131,245, 77, 42, 16, 33,220,101, 58,135,175, 55,254,183, 7,250,116, 71,252,161,223,255, 99,158, 59,127, 13,153, - 56, 6,186, 98, 52, 25,113,181,219, 99, 55,203, 56,204, 51, 62,121,245, 6,239,252,146,207,228,159,191,229,205,108,239,238,209, - 58,162,136, 92,155,193,254,117, 30,123,251,119,243, 7, 15, 39,124,245,135, 63,200, 75, 94,241, 50,238,187,227, 20,198, 70,252, -205,123, 63,194,233,115,103, 57,113,246, 40,105,170,168,109,110,242, 69, 31,218,225, 67,111,251, 10,246, 63,240, 87, 51,165,249, -172,193, 14, 7,178,196,211,231,164, 10,108, 25,175,110,155,251,117, 23,130, 86,230, 72,218, 41, 78, 54, 40,209,197, 20,155, 46, - 22, 24,239,211,115,113,145, 54, 39, 8, 89,170,222,191, 29, 58,164,233,252,120, 74,241, 18,211,181,134, 12,187, 81,225, 31,254, -216,169,170,125, 30, 74, 99, 29,243,208, 27, 49, 21, 78,250, 76,118,107, 45,237,151,188, 62,184, 36,236, 2,116, 71,131, 75,110, -245, 46,217,194,127, 19,118,150,181, 25, 10, 6, 21,166, 11,118,161, 75, 23, 65, 91,229, 49,182, 84,101,248,121, 28, 44,124,190, -131,183,166, 64, 8,239,224,112,120,162,155,173, 12,186, 42,188, 0,211,132,240, 35, 33, 23,132,149, 97, 90, 98, 12, 70, 23, 33, -192, 68,250, 41, 86,158,249, 80,151, 50,243, 69,150,246, 66, 60,103, 43,168, 45, 5, 17, 86, 4, 56,186,207, 93,228,226,251,222, -139, 41,199, 36,245, 58,113, 35, 97,220,237, 49,182,142,102, 36,153, 84,146, 90,236, 40,180,134, 88, 81,139, 99,162, 72, 50, 28, -103, 44,213, 98,198,149,166,168, 12,145, 12, 49, 41,161, 40,170,130,224,179,212,150, 68, 10,250,149, 33,215,126, 58,147, 42, 65, -229, 4,185,246,228,187,205,118,130,115,176,181,178,196,181,110,159, 81, 97,102,250,141, 86, 45,102,156,235, 96,189,156,138, 32, - 37,105,152,188, 68,210,175,125, 42, 7,165,131, 84,192, 64, 7,179, 2,248,164,180,112,203, 41,235, 80, 74,204, 60,234,206, 57, - 98,233,141,180, 83,106,227,212,192, 40,220, 66,182,122,112, 34, 78,215, 85,103,191,226,109,156,127,242, 18,249, 56, 98,233, 72, -141,124,100, 24,119, 71, 68,113,141,221,107,125, 58,171, 37,147,193,144, 59,159,119, 23,147,126,159,230,202, 50,235,103, 54, 57, -184, 56,164, 24,107,156, 21, 52,150, 86,217,191,176,207,104, 52,160,185,122,156, 19,103,182, 80,105,201, 90,239, 24,231,159, 60, -143,209, 21,135, 59,138, 60,155, 96,156,132, 82,176,177,185,193,133,107, 87,184,227,212, 81,150, 55,235,236,223,232,114,229,224, - 38,141,231, 18,242,210,208,106,214,217,187, 92, 34,100,201,141, 97,151,165,165,148,213,149,132,114, 20,113,163,219,231, 70, 62, -224,174,213,219, 56,200, 14,209,194, 67,141,182,179,125, 98,167,121,213,201,215,114, 51, 43, 88, 74,214,136, 6,189, 30, 78, 53, -121,230,233,139,220,251,192, 41,150,143, 30,167, 93, 22,188,111, 80,242,166,159,254, 30,220,214, 73, 62,246,109,223,193,185,239, -251, 94,104, 44,113,223,198, 26,127,247,145,143, 80,196, 5,237,229, 99, 12,122,219, 36,174, 66,119, 51, 58, 71,206, 96,227, 77, -206,189,234,245,104,107,216,219, 31,208, 61, 24,145, 38, 17, 84, 33, 9, 8, 77, 61, 73, 65, 56,198,227,194,251, 1,157, 65,151, - 37,214, 90,186,171, 47, 39,127,240, 14,218,119, 14,104,201,132,131,253, 3, 30, 90,118,200,118,147,196,193,112, 98,200,171,156, -201,245, 17, 50, 74,208,249,132, 98, 82, 80, 26,195,254, 65,159, 27, 55,119, 57,127,237,128,165, 86,131,188, 28,241,201,103,119, -176, 85,193,184, 42,168,181,106,152, 42, 71,233,130,222,225, 77,180, 83,180,154, 41,166, 92,103, 83,246,216, 27,245,120,195,251, - 7,252,187, 47,251, 28, 70,127,243, 55, 28, 22,130,131, 71,222,202,235, 91, 9,241,242,231, 50,217,126,206,251, 64, 99, 31, 62, -162, 76, 16,124,153,234, 86, 34, 74,128, 54,152,202,251,172,163,122, 13, 89,171,249,174,176, 86,131, 56,193, 69, 65,253, 45, 85, -240,242, 26, 92, 81,131,184, 4,215, 70, 58,129, 84, 49,241, 34,107,220,186,144, 15, 62, 37,171,137, 25,226, 82, 40, 21, 30,232, - 50, 0, 92,162,160, 50,118,115,235,142, 21,144,214,112,163,125,190,248, 55,126,159,115, 95,254,219,252,252, 27,190,129,213, 52, -226,209, 70,202, 23,252,202,123, 16,223,243,118,232,238,123,232,131,117, 40,169,208,166,226,240,218, 69,172,250, 66,164,130,164, - 38, 57,184, 62,230,196,221,117,164,242,169,105, 72,133,136,164,255,108,144, 51, 88,139, 23,128,105,108,145,123,207,254,140,197, - 24,192, 30,186,194, 21, 30,135,107, 75,127,144,235,178,240,234,122,235, 66,218,221, 60,117,204,137,249, 3, 90,104,129,147, 97, -116,175, 34,207,209,215, 26,153,214,145,113, 50,139,207,116, 82, 98,176,136, 56,198,140, 39,200, 72,226, 74, 21,168, 97, 14,106, -202, 11,136, 76,229,105,126, 1, 87,234, 45, 69, 11,169,108, 74,249,208,148,112,200, 11,149, 44,168,221, 93,240, 82, 91,250,187, -219,252,245,187,126,149,215,255,252, 47,242,139,111,253, 42, 70, 7,123,236,220,216,230,218,225,128,237,113,206,213,113,206,137, -229, 21, 94,124,108,153,251,206,220,198,133,103,158,225,200, 93,119, 97,141,161,214,170,243,115,111,249, 17, 62,231,117, 45, 94, -254,203,125,206, 54,224,189,127,251,126, 78, 31,125, 3,171, 53, 73,243,182, 77, 70,147, 49,231,182,154,212,133,224, 19,151, 5, - 23, 63,252,113, 94,248,230, 31,166,247,241, 15, 96,242,108, 70,132,147, 98,193, 2, 36,189,240,111,150, 3, 62, 77,181,114,183, -142, 49,157,155,219,132,164, 18,225,165, 22,114,206,167,214,110, 59, 23,216, 17,246,155, 11, 73,227,225,225,189, 80,228,216, 57, -150, 83, 50, 71,193, 10, 57,127, 31, 42,158, 94,207, 50, 36,174, 5,183,128, 5, 25,232,110, 18,225,159,218, 11, 73,115,233,233, - 23, 16,175,157,192,185, 17, 66, 24, 15,147,177,121,168,175,245,172,128,156,237,213,103,211, 30,237, 51,205,157, 70,218,153,185, -206, 95,103, 81,140,171,138, 25, 19, 94, 68, 53,108,158, 99,171, 50,164,167, 37,193,238, 24, 32, 55,210, 97,116,225, 69,157, 85, -229, 63,150,108, 20,240,176, 2, 75,132, 80, 17,214,250,213,143, 53, 26,167, 53, 50,138, 61,215, 34,146, 8,107,188,141,114,218, -101, 86,149,183, 30, 90,129, 49, 21, 74,198,216,170,196,165, 77, 76, 85, 33,156,101,220, 61,224,224,202, 85, 82,105,216,184,239, - 36,221,167,158,162, 55,240,137,115,186,210,164, 50,193, 68,145, 71,217, 23, 37,170, 22, 35, 42,168,199, 49,145, 18,164, 90, 81, - 88, 67, 30,166, 48, 38,180,194, 54,220,115, 82, 64,101, 45,101, 56, 80, 3, 37,192,239,198,149, 96, 57,137, 89,174,215,105,165, - 9,113,146,240,226, 59,215,120,252,226, 37,118,179,210, 75, 21,173,161, 30, 43, 74, 99,209,193,218, 38,132,165, 52,222,187,206, - 64,133,124, 0, 0, 32, 0, 73, 68, 65, 84,238, 28, 68, 66,134,195,216, 49,177,142, 36, 72, 29, 12,130, 84, 8,164,199,230, 7, -107,219,130, 53, 82, 44,136, 55,109,128,209, 44, 58, 49,166,197,235,172, 85, 87,196,141, 58,162,113, 47,113, 62,192, 13, 53,221, -235, 37,181,182, 35,203,198,172,109,181,216, 58,115,130,195,189, 46,107, 71, 78,161, 75,205,218,230, 49,210, 90,139,241, 94, 69, -231,228, 38,147,221, 33, 85,165,169, 74,197,242,177,219,200, 46, 62,131,173, 52, 87,206,111,211, 94, 90, 66,169,152,229,205, 19, -108,108, 52,153, 12, 10,246,119, 98, 58, 91, 41, 34,214,148, 99,104,181,150,120,230,252, 85, 38, 58,167,157, 46,113, 91,103,139, -222,112,194,198,122,135,178,212, 52,150, 28,245,250, 50,133,214,236,116,187,212, 88, 70, 87, 21, 74,212,184,107,233, 52,224, 24, -150, 3,138,202,177,159,103, 44, 71,142,135,182, 94,199,176,170,144,148,212,136,137,202,194, 80,140, 71, 36,181, 22,189, 94, 70, -164, 44,141,118,131, 88,165,188,231,143,255,130,211,151,118,184,253,141,175,161,105, 51,116,225,200, 91, 75,188,228,133, 15,242, -247, 31,255, 40, 69, 49,166,189,188,133, 21,150, 70,107,141,193,254, 77, 62,251,155,127,140, 82,107,250,195, 17,187,219, 55,169, -215,107, 40,235,152, 76, 42,242, 73, 73, 99,109,137, 40,130, 97, 63, 15,247,166, 35,207, 43, 76,128,209,235,108, 72,156, 68,180, - 55,150,105,164, 49,245, 68,240,188,123,238,240,157,252, 56,163,187, 63, 96, 56, 30,121,226,143,174, 24, 77, 74, 31, 34, 51,201, -233, 13, 51,158,124,238, 6,182, 28,211,235,245,217, 61,136, 25,101, 99, 38,163, 9,121, 54,194,106, 67,166, 4,251,131, 9,105, -173, 70,165, 75, 42,145,224,132, 35, 51, 17,159,251,138,175,225,173,159,117, 39,255,227,255,250,175, 60,252,194, 23,178,251,220, - 53,234,249,132, 87,124,207, 55,145, 95,189,132,177,190,107, 52,210,143,241,234,203,203, 62,241,107, 74,223,176,198,123, 97,173, - 7,161, 40, 21, 33, 83,137,104,119,112, 81,120, 18,198,137,207, 87, 78,147, 89,136, 6, 40,136, 44, 46,173,135,238, 33, 28,198, - 85,229, 15,112,227,115,217,133,244, 54, 53,226, 38, 68,211,177,182, 13, 62, 84, 59,135,147, 24,227, 59,127,107, 64, 79,227, 41, - 67, 44,216, 56,247,140,233,103, 30,227,206, 23, 62,204,127, 50, 25, 79,252,220, 79,240,235,111,255,113,126,186, 56,228, 55,222, -255, 65,162,135,239, 67,137,132,164, 81, 11,170,114,112,122, 76, 81,106,162,180,230,109,110,135, 61, 78,218,101,172,177, 40,235, - 17,150,222,178,164, 17,178,156,141, 56,173,212, 88,230,156,250,121,116,231,252, 48, 55, 69,137, 41,125,134,187, 49, 85,128,122, - 4, 16,141,156,166, 98, 5,107,144, 83,254,251,181,122,142,126, 50, 94,105, 46,164,223,157, 11,169, 60, 81,142,128, 94,117, 38, -216, 87, 44,198,106, 52, 96,148,240,153,239,214, 97,202, 18, 21, 55,102,113,140,126,141, 16, 7, 27,152, 87,215, 11,229, 95,215, -151,252,254,128,135,197, 49,180,152,249,191,255,231, 79,253, 56,210,165,124,240,151,126,147, 55,253,251,159,230,155, 31,184,159, - 27,192, 94,169,233, 21, 21, 75,181, 58,159,188,177,199,119,188,244, 44,207, 92,190,204,243, 86, 87,200,134,125, 84, 28,177, 55, - 30,242,170,175,253, 82,222,243, 35,239,224,237,231,234,236, 21,240, 23, 23, 46, 82,142,123, 92,187, 52, 70,173, 29,229, 5,247, -220, 77,173, 22,243,251,191,253, 62,126,237, 63,125, 39,181,193, 37, 62,122,152,241,146, 99,235,252,192,241,153, 61,119,182, 77, -118,139,201, 86, 11,200,216,105, 40,134, 12, 29,243, 52, 89,205,163, 61, 23, 66, 94,108,136, 81,117,254,247,218, 50, 80,227,194, -200,197, 46,236,238,103,201,129,102,186, 7,159, 10,249,230,234,100, 23,152,239, 50,140,199,167,133,135,213, 46, 56,207,252, 74, -192,105, 17, 6, 37, 30,210, 35,165,167,102, 89,227, 41,137,126,130,238,104, 61,244,197, 64, 21,118,233, 11, 28, 80, 91,205, 15, -113,100, 80, 78,121,239,184,239,170,213,108,131,226,215, 62,218,127,237, 40, 9,140,113,231,139, 72,194,107, 9, 48,122,130,136, - 82, 63,189, 80, 9, 70, 23,254, 62, 20, 18, 87,100,161, 64,183,152, 60,243, 52,193, 34, 3, 43, 80,181,166,159, 36, 9, 31, 82, -100,170, 2, 81,105, 68,195,239,211,197,116,106, 37,101,112,225, 73,255,107,186, 64, 70, 41,200, 8,213,234,120, 59,105, 57, 65, -168, 24, 51, 24,161,164,164,204,198,104,109,168,213, 18,134, 31,122,156,126,229,139, 85, 17, 37,104,237,197, 14,173, 36, 69, 43, - 73, 85,150, 56,225,136, 99, 65, 36, 37,214,249, 66,187,210, 6,107, 28,198,120,253,103,101,236,212, 52, 65, 97,230, 3,111, 41, - 5,145, 16, 52,106, 94,208,181,214,172,179,181,218,225,200,218, 42,107,157, 21, 78,158, 62,197,221, 71, 54,248,163, 15,255, 61, -215,243,146, 88, 64,161,141,247, 78, 71,114, 6,245, 81,211,226, 47, 32,100,173,117,212,149, 96, 57, 17,172,199,138, 78,228,104, -135,191,186, 72,121,172,181, 13,133,170, 10,186, 6,107,195,106,198,205,181,141, 11, 89,132, 88, 17,190,206,116,192,103, 53,247, -127,195,143,176,115,121,128,139, 18,210,142,164,234, 27,198,189,156, 40,174,177,119,229,144,237, 11,215, 88, 94, 91,103,237,220, - 49, 76,233,169,125,113, 35, 69,198, 13, 92, 1,189,131, 67,150,150, 55,168, 92, 73,218, 20, 68,212, 32,177, 72,231,168, 47,215, -105,172, 75,184, 98,217,221,238,145,103, 3,138,145, 99,247,146,225,216,185,117, 90, 13,201,232, 80,179,220,222,224,244,102,155, -245,147,109,178,195,146, 71, 63,241, 52,166,148, 92,218,189,206,169,181, 19, 12,134, 25, 59,195, 30, 43,141, 13,198,147, 9,251, -213,128,219, 86,155, 52,235,203,124,250,242, 51,220,156, 12,144, 98, 64,172,114,238, 95,125, 41,121, 89, 98,170, 62,206, 84, 40, - 85, 39, 58, 56, 24, 98,172,100, 82,104,174, 93,217, 99, 60, 41, 57,178, 28,113,244,212,109,220,108,173,178,186, 89,240,188,151, -127, 22,215,126,244,135,168,127,213,215,179,182,188,204,248,176,224, 37,159,255, 37, 60,250,193,247,115,233,234,167, 56,113,231, -253, 12,246,118,120,213, 55,189,131,172, 40, 40,171,130,108, 48, 36, 77,107,232,178,100, 92, 84, 36,161,233,233,247,135,196,177, - 66,196, 2,165, 45,165,177, 8, 97, 81,145, 63,236, 90,237, 58,181, 68,209, 61,236, 99,132,131, 90,157,214,230, 26,195,225,152, -157,221, 30, 7,221, 46,131,193,136,122, 45,101, 56,202, 73, 19,135,116,146,189,110,151,231,174,237, 51,201,114,106,162,228,142, - 83, 71,248,216, 99,207, 80, 25, 77, 82,175,129,140,201,178,140, 66, 66, 18, 69,228,147, 49, 74,197,216, 74,179,177,118,132,215, -189,230, 53,124,230, 3, 39,184,248,222,255, 78,189,179,201,229, 27, 7,196,105,157, 77,233, 48,151,175, 80,184, 2,116,137,170, - 53,112,147, 17, 66,249,209, 63, 69,129, 18, 62,156,193,155, 4,195,147, 43,173,249, 10, 63, 78,124, 68,104, 80,178,186, 40,116, -230, 34,160, 71,171, 18,116, 17, 60,177, 22,202,106, 30, 26, 34,196,220,138, 83, 75,253, 78, 58, 12, 87,157, 49, 48, 30, 67, 89, - 32,180,159, 8, 56, 29,230, 86, 82, 5, 69,173, 67, 37,113, 32,113,133,196, 40,169,112,148, 96, 71,136,120, 4, 7, 7,220,255, -133,175,227,167,190,245,123,121,242, 39,126,148, 15,252,143, 63,228,243, 63,227,133, 56, 99,144, 72,226, 36,246,112, 6, 11,195, -253,125, 54,154, 77,210,218, 16,147,151,232,108,140,176,210,135,172, 52,234, 8, 93,133, 67, 84,207,118,207, 66,120,150,187, 51, - 83, 40,143,127,239,214,104, 76,158, 99,242, 18, 83,149,232,170, 12,106,224, 41, 60,213,112,107,250,136,223,201,139,105,152,139, -155, 67, 79, 32, 36,109,169,128, 86,181, 65,192,101,237, 45,235,111, 87,105,132, 82,225,225, 32,253,238, 55,196,200, 98,116, 64, -127, 26, 68, 20,205, 58,253,106, 50,161,182,188,238, 5, 82,211,157, 38,206,255,157,222, 98, 97, 51, 84,253, 46, 7,191,250,107, -124,237, 79,255, 23,222,241,218,215,146, 77,198, 36,117,193,227,123,125, 76,163, 65,191,170, 24, 25,195, 74, 84, 99,185, 22,241, -244, 94,159, 70, 43, 97,112,243, 6,173,122,138,210, 21,173,141, 45, 62,227,203,223,200,133,167, 47,241,137,223,250, 45, 46,200, - 58, 95,248,138,135, 57,126,242, 12,175,107,103,156,125,248, 69,212, 86, 59,168,180, 78,241,204,111,242,219,223,242,121,156,251, -174,159,226,217, 79, 61,198, 93,247,190,152,222, 70,147, 78,228, 66, 92, 41,225, 32, 14,226,178, 41,124, 67,120, 18,157, 92, 64, -100,138,127,208, 89,179, 16,185,234, 66,177, 56,157, 96,203, 25,176,134,224,120,152, 69,100, 48, 93, 77,139,104, 14,174,145, 98, -129,255,110,167, 7,124, 24,216,155,224,127, 23,115,127,188, 23, 54, 5,103,194,212, 2, 24,136, 55, 86, 76,209,182, 30,218, 40, -163,136,100,243,204, 34,124, 62, 88,213,170,185, 15,157,192,159,189,133,209, 31,242,207, 77,128, 21,217,160,151, 8,133,251, 60, - 58,207, 67,143,172,246, 33, 64, 82,133,140,135, 56,153,125,131,118,202, 89,144, 18,103,236, 12, 53,108, 60,223,212, 23, 83, 85, -133, 49, 5,194, 73, 4,222,174,134,148,200, 90, 13, 21,165, 65,207, 80,161,162,122,192,159,250,201,165, 4, 34,229,131,153, 76, - 81, 16, 55, 58, 62, 73, 80,151,104, 99,184,249,196, 71, 41, 39, 57,235,155, 29,184,118,131,107, 87,119, 81,105,141,200, 57,164, - 17, 51,228,176,136, 36, 18, 75,187, 85,103,191, 59,198, 9, 63, 21, 74, 19,137,205, 29,147,202, 80,153,208,143, 56,139,118,222, - 79, 31, 71,146, 76,251,251, 45,146,130, 72, 72, 34, 33, 56,218,106,177,181,182, 76,103,169, 77, 4, 36, 66,178,180,178,140,238, -119, 89, 46, 38,188,225,142, 77,222,123,249, 38,143, 13, 75, 64,160,177, 72, 51,189,206, 66,138, 26, 98,150, 71, 16, 11, 65, 59, -130, 37, 5, 74,122,246,125, 34, 5,117,101,145,206,206, 60, 35, 22, 23,120, 2,204,220, 54,102, 65, 35,178,176, 63, 10,147,169, -185, 87, 93, 41,129,213, 29,172, 24, 48,234, 22, 88, 13,221,131, 30,235, 91, 29,180, 81,140, 14, 71,172,108,172,114,255,171, 31, - 96,255,185, 30, 73,189, 78,173,185,140, 48, 22,109, 36, 69,175, 75,107,227, 8,181, 86, 74,107,181, 77,119,123,143,214,198, 10, -203, 91, 13,174,127,250, 38,221,235, 7, 92,123,122,204,250,209, 35, 12,118,246,169,116,194,137,123, 79,146, 23, 57,163,189, 28, -235, 12,157,227, 9, 71, 79,158,101,247,250, 30,159,250,208, 13,162,216, 80, 79,154,164,105,202,125,207, 59,202, 74,235,118, 30, -127,236,227, 12,116,159,150,173,179,210, 86,220,230, 58,184,178,206,123, 47, 63,142, 17, 57,235,201, 42,205,122,198,241,250,195, - 12,114, 77,167,166,168,201,117,218,174,194, 88, 71,116,125,119,200, 94,127,196,241,205,117,250, 3,201,246, 32,231, 96, 92,177, -180,182,196, 49, 10,222,255,216,227,220,251, 23,127,196, 97, 5,247,175, 55,184,241,219,191,204,250, 87,254, 11,108, 89,242,226, -207,252, 12,142, 93,220,226, 3, 31,251, 16,159,255,214,239, 70,196, 41,121,127,128,146,130,254,160,164,221, 72, 72,155,117,174, - 93, 29,177,180,222,225,198,246, 14,203,203,203, 12,251, 35, 84,146, 96,157, 69, 77,211,115, 98, 71, 82, 75,176,122,137, 76,143, -216,188,173, 69, 62, 28, 50,214, 19,182,175, 29, 80,107, 88,140,201,217,223,239,162,141, 37,142, 45,189,222, 33,135,195,156, 73, - 62,225,218,141, 30,207, 63,119,140,253,253, 93, 38,149,230,177, 39,159,197,106, 77,156, 40,170,162,162, 42, 43, 70,101, 73,108, - 42, 70,227, 49,245,102,139, 92,107,138, 42,225,182,211,119,115,112,254,175,160,190,196,179,215, 51,210, 90, 74, 26, 71,228,101, -197,237,199,214, 25,149, 67, 12,130,168,172,112, 41, 8,109,193, 85,216,108,130,172, 55, 16, 42,153,119,111, 42,242,248,210, 40, -241,135, 89, 90,247,191,110,140, 31,185, 11,229, 61,217,206,122,138, 85, 17,104, 86,101,229, 45, 94,211, 7,138,153,211,160,132, - 13, 1, 14,218,115,229,167,198, 79,107, 13,110,146,227,240,202, 88,132, 66,198, 17, 34, 82,190,162, 55, 96,171,224,153, 15, 72, - 48, 23,172, 37, 32, 49,227, 2,161, 20,217,126, 23,158,126,134,123,191,246,173,156, 43, 52, 38, 31,120,114,150,128, 72, 73,140, - 18, 68,105,196,193,181,231, 56,122,100,139, 36,218, 99,104, 29, 85, 86, 33,236, 4, 91,149,144,110,134,179,214,219,155,166, 7, -160,144,210, 7,192, 24,131, 11,135,190,173, 42, 76, 89,162,243, 18, 83,100, 94, 1,175,253,225,234,152,251,194,255,145, 24,205, - 77,161,114, 34,136,217,172,199,120, 47,122,144, 93, 16,207, 97,231,145,152, 24,132, 51, 88, 17, 66,114, 98,137,116, 50,144,155, -252, 4, 67, 23,133, 31,129,162, 60,111,219, 90,202,108, 68,218,234,132,115,197, 45, 4,160, 40,239, 76, 24,143,124,241, 86,139, - 40,174, 92,231,189, 95,252, 50,154,119,157,229,232,203, 94,201,119,255,183,255,198,179, 31,255, 59,222,244, 37,111,160,189,214, -102,123, 82, 82, 58,136,163,152,237, 94,159,219,151, 27,124,114,167,203,199,174,236, 50,121,239,147,232, 40, 66, 9,193, 70, 51, -225,115, 31, 56,203, 90, 59,230,117,255,241, 87, 56,123,249, 16, 55, 28,210,223, 29,112,246, 69,207, 71,233, 9,233,238, 62,157, -149,152,183,191,235, 87,102,171,137, 59,239,121, 1,223,244,207, 95,203,239,255,229,159,242,245,167, 18, 95,224,136, 57,120, 70, -202, 91,125,225, 98,202, 90, 23,255, 32,162,117,145, 95,111, 93,216,179,223,154,140, 17, 88, 45,179,244,190,153, 55,125,170, 80, - 14,157,186,138,230,248,205,233,199, 54,227,189, 59, 79,244,154,174, 2,230,177,169,254, 32,183,214, 6, 98,216,212, 6,103, 23, -144,158, 30, 73, 44,156, 64, 24, 77,253,142,135,111, 77,231,112, 14,138,161,255, 90,105,228,211,215,204,116,109, 35,230, 74,190, -169,193,110, 1,224,227,172,246, 99,232,106,154,128, 56,245,243,251,238, 80,197,117, 76, 85, 66, 62, 66,166,190,176, 51,101,142, - 84, 94, 20,106,180,198, 21, 19,108, 49,133, 35, 73,116,145, 19,213, 82,176,150,114, 60, 68, 70, 53,172,169, 72,219,171,190,144, -173,169, 48,137, 83, 56, 83, 5,171,163,247, 13, 90,109,189,168, 83,150, 88, 83, 33, 84,226,167, 9, 42, 66, 10, 71,247,202,101, - 26, 75,109,226, 52,161,113,246, 44,201, 71, 31,165, 20, 2, 17, 75,156,148,180, 99, 73,149, 27,180,241, 41,139, 96,104,181, 18, -246, 14,199,140, 68, 78,187,158, 32,201, 1, 73,105, 42, 4,144,107, 19, 70,241,142,194,194, 72, 27,164,244, 35,242,122, 20,113, -180, 93,103,125,169, 73,187,158,178,181,212,166,222,108,176,186,190,129,233,118,145,229,152,164,154,208, 74, 99, 94,119,122,157, -232,185, 27,124,108,104,209, 86,204,238,163, 56,136,229,100, 64,223,166, 82,210, 80,158, 11,111, 5, 36, 82,176,164, 4, 41, 6, - 51,141, 64, 14,133,104, 20,180, 22,206,205, 45,152,254, 58, 20,179, 75,203,134,241,252,220,214,230,245, 15,214, 9,234, 27,203, -140,159,221,163,213,110,114,229,233,235, 72,149,160, 11, 65,125, 53,226,206,251, 55,233,172,111, 49,184, 94,208,217, 88,225,250, - 51, 55,184,253,197, 71,216,191,112, 72, 92,151, 52,150,155, 56, 85,195,149, 5,195,110, 31, 83, 56,138, 98,200,100, 82,178,180, - 92, 99,119,251, 10,197,208,177,111,186,116,142,109, 82,142, 75,174, 62,113,133,245,179, 71,105, 44,213, 24, 31,104,198, 87, 74, -174,247,174, 35, 83, 75,107, 67,114,247,185,115, 60,243,161, 43,236,237,239, 97,246, 98, 62, 54,121,132, 88,165,156,105,222, 78, -226, 98, 30,187,126,158,182, 74,168, 71, 13,234, 74,226,100, 19, 68,143,207, 59,247,165,228,149,228,224,198, 33,157, 99, 9,101, -183, 73,175,184,201, 65,222, 71,189,228,204,218, 59, 18, 25, 83,218,138,118, 51, 13,142, 34,193, 65,111,200, 67,189,107,220, 47, - 51,174,125,252,113, 30,252,209, 31,227,194,127,124, 23, 71, 94,251, 90,244,159,252, 30,209,114, 29,142,156,160,115,215, 61,220, -253,224, 43,104, 29,187,139, 73, 54,158,141,246,154,205, 6,135, 7, 3,246,110,116, 57,255,233,109, 76,158,241,244,249,155,228, - 69, 73,179, 17,133, 84, 47, 77,187,149, 50, 25,103,148,121, 69,149, 23,196,105,204, 82,171, 70,164, 20,195,113,206,229,221, 62, -177,114,100,163, 30, 31,255,212,101,118, 14,123, 20,197,132,221,195,190, 79, 30,211,154,221,131, 30, 91,107,117,198,227, 49, 69, - 81,130, 48, 28,236, 30,250, 17,158,129,126,127,196,184, 40,104, 39,130,122, 12,141, 36, 38,118,154,147, 27, 91,124,197,151,124, - 45,205,231,254,144,102,217,229,216,177, 19, 60,126,126,155,229,118, 11,107, 29,147, 73,198, 3, 15,222,201,114,236,253,131, 34, -140,201,228, 82, 11, 97, 52, 34,174, 17, 55, 91, 62,232, 33, 10,135,121,218,128, 90, 19,146,212,139,232,210,250,156, 52, 38,148, -143,104,204, 51, 40,114, 92,150,205,172,103,174, 10, 9,111, 85,229,127,132,145, 59,214,122,129, 78, 94, 32, 76,133,203, 10, 76, - 85,121, 21,110,165,177,214,160,203,130,162, 55,162, 26, 79,168,170,146, 98,146,227,180, 70,151, 21, 58, 47,200,179,140,114,148, - 49,233,142,200, 6, 35,198, 7, 67,202,201, 4, 93, 86,152, 74, 83,105, 77, 85, 85,100,215,182,161, 18, 36, 71, 59, 56, 12,253, -107,215,152,116,251, 56, 39, 80,113, 66, 62,206, 56,126,251, 25,242,171,151, 24,151,142, 6, 67,156,242,153,198, 46,207,177,210, - 43, 98,103,130, 41,230, 4, 54, 91, 85,184,178,192, 86, 26, 29, 34, 79,117, 81, 96,195,154,192,133,244, 44, 55,165, 62, 45,182, -233,179,159,138,249,106, 98, 10, 75,177,198, 43,151,141,157,199, 42, 6,104,141,179, 6, 43, 76, 56,156, 4,214, 88, 92, 36,253, -123, 84,254,192,178, 98, 30, 21,235, 2, 33, 67,132, 46, 14,231,136,106, 13, 68,148, 18, 53,151, 16, 81, 76,148, 52,188,161,119, - 50,196,149, 25, 34,237,112,240,215,127,202, 31,191,254,179,136, 79,221,198,229,195, 62, 87, 31,121, 63,159,126,236,113,190,225, -123,126,144,102, 59,101,164, 45,218,249,132,170, 68, 74, 26, 82,112, 48, 14, 1, 69,149, 35, 55,126,146, 34,162, 6, 73,251, 54, - 54,142, 61,143,135, 95,253,122,126,254,247,222,195,122, 34,121,240,161,123, 56,118,230, 54,232, 31,114,116,240, 52,107,235,130, -120,107, 19, 26, 77, 15, 71, 2,170,178,228,181, 95,254, 6,190,241,251,126,148,159,255,173, 71, 40,202, 62,227, 75, 79,135, 21, -245, 60,176, 69,202,127,208, 57,187, 69,196,109, 0,207,200,160,102, 95, 88, 47, 76,133,110,211,238, 93, 46,248,197,167,145,190, - 51, 79,252,180,128, 8, 14, 2,177, 80, 77,204,116,157, 66,204,208,177, 98, 26,193,234,194, 33,238,230,191,119,102,195, 51,132, - 73,195,116,155,228, 11,213, 40,109,179,242,249,255, 18, 17,155, 57, 65,206,148, 80,142,110, 85,190, 99, 23,214,100,122,198,253, - 71,151, 1, 9, 28,138,101,163, 3,154,182,154,253,121, 27,114, 4, 92, 72, 98,115,186,196,232,114, 6,191, 49,227, 30, 50, 74, -113,214, 82, 13,122, 56, 99,208, 89,134, 46, 51,108, 85,160, 39,125, 84,220,244, 93,187,209, 68,245, 38,113,163, 73, 92,107,134, -207,218, 79,178,156, 82, 33,101, 47,172, 36,172, 9,141,130,242,131, 0, 21, 33,107, 45,140,214, 20,251, 55, 24,237, 92,229,137, -247,189, 15, 81, 85, 8,103, 56,221, 18, 92,126,118, 27,109, 12, 38,170,209,173, 44, 54, 78, 17,186, 66, 75,143, 72,150, 74,160, -164,228,112,148,205, 2,230,178,202, 50,174, 12, 89,101, 48, 8,178,202,131,156,198,149, 35, 55, 26,231, 36,145,132,165, 52,229, -182,149, 54,103, 54,214, 56,190,117,132, 51,183,157,162,179,186, 74, 85, 24,138, 97, 15,101, 52,170,223, 99,115,173,131, 46, 10, -170,124,194,237, 34,231,169, 81,133,137, 34,234,145,164, 19, 73, 82, 41,168, 43,159, 4,183, 20, 71, 52,163,144,238,105, 29,113, -192,204, 24,135, 47, 78, 66,144,203,108,152, 35, 22,210, 86, 23,221, 30, 82, 44,232,104,255,161,219, 2,148, 84,200, 70,139,162, -246, 32, 86, 74,110, 94,238,147,180,196, 76, 15,145, 68,138,165,206, 42, 69,158,211, 62,185,194,100,191, 71,109,105,147, 40, 78, -137,211,148, 81,111,192,225,245, 62,245, 78,157,195,107,187,244,247,250,200, 90,131,165,149, 26,147,126, 78,255,198,117, 38,227, -130,165,246, 58, 27,167, 54,112, 70,146,212, 18,170,162, 2,227, 88, 90, 95,162,114, 3, 14, 14,135,220,118,199, 17, 46, 62,115, - 21, 89, 37, 28, 30,244,105, 29, 23,172,110, 45,209,142,107,244,134, 5, 91,203,109,154,109, 73, 51,109, 51,158, 12,169,165, 53, -164,176,108, 54,151,184, 52, 60,207,191,250,236,127,201,100,236, 72,235,208,108, 52,153,244, 43, 46, 29, 94, 36, 78, 5,227, 2, -162, 71,159,219, 71, 41,137,146,126, 76, 51, 44, 43,164,136,120,227, 81, 73,219,142,209, 22, 26,177,229,202, 79,253, 48,186,190, -129,217,222, 38,189,251,118,246,255,242, 47, 56,114,215, 3, 56, 37,137, 54,206,160,173, 65,235, 16, 88,159, 74,164,117,172,174, -181,216,223,237,209,136, 37, 89,105, 73,210, 26,203,157, 22,147, 81,206,225,225,132,173,173, 53,118,111, 14,136, 34, 65,150, 85, - 51,142,243, 48, 47, 73,227,152,122,163, 78, 75, 25, 70,131, 9, 89, 53,228,163,143, 61, 70,156,182, 57,121,116,153, 60,175, 24, - 40, 73, 35, 73, 40, 75,205,179,151,123,228, 69,137, 37,162,168, 74, 42, 39, 40,199, 99,106, 53, 15, 69, 89, 86,130,209,168, 64, -213, 82,106,245, 6, 34,105, 83, 95,189,131,151, 60,255, 40,255,225, 55, 46,240,138, 23, 61,159,189,131, 46,149, 49, 20, 89, 70, - 61,245, 68,165,103, 47, 92,231,220,234,201, 25,177,204, 78, 50,228, 82,219,239,184,106, 41,196,225,199, 52, 19, 50, 74,102,252, -238, 41,121,108,198,131,215, 85, 80,167, 23, 62,140,161,172,252,129,173,171,144, 6, 21,246,206,102, 14,249, 64, 72,204,116, 36, - 31, 0, 44, 54,236,207,157,128,106, 52, 65, 23,165,247,113, 75,137,170, 74, 92, 18,161, 43,131,138,188,168,203,175, 23, 53, 85, - 81,162,173,197,148, 6, 61,246, 23,191, 74, 19,100,146, 18, 37, 41, 73, 59,101,220,189, 73,178,179,138,216, 40,137, 19, 69,220, -106,192, 56, 67,164, 9,189,157, 61,162,173, 59,137,196, 95,147,141, 74,138,245, 26,234,160, 71,180,182,130,201,250, 68,101,129, -104, 84,176,190,236, 31, 78,113, 4,122,234,239,182,152,188,132, 80, 68,216,162,240, 59, 68,103,231, 96,145, 41, 9,220,253,131, -108, 68, 37,131, 55,217,132, 24, 80, 21,124,215,198,239,188, 93, 0,199, 8, 47,163,245,138,106, 55,235,222,109,240,147, 59,169, -252, 94, 15,112, 78,226, 42, 19,148,223, 83, 75,149,195,149, 21, 54,114, 84,147, 1, 56,133,200, 11,162,134,193, 84, 21,202, 5, -189,194, 36,243,255,189,121,154, 71,222,246, 21,124,226, 61,239,161,185,113,130, 75, 87,247, 56,210, 90,225,119,246,183,249,224, -223,126,152,211, 27, 45, 42,107, 25, 20,126,148,153, 74, 69, 77, 73,110, 78,114,198, 14, 54,235, 13, 94,114,246, 33,206,156,190, -139,229,118,135,102,187,193,102, 43,194, 53,155, 60,245,201,199,121,197,217, 99, 60,255,190, 59, 73,155, 53,250, 59,215,120, 32, -222,166,115,246, 12,118,243, 4,182,214, 36, 94,248,140,226,255,197,213,155, 7,219,150,221,245,125,159, 53,236,233,140,119,126, -115, 79,106,169,213, 45,169, 37,132, 0,129, 6, 16,177, 24, 92, 54,132,193, 14, 41, 48,132, 50,118, 72,217, 84, 65, 82, 84, 18, - 87, 25,112, 18, 87, 57, 9, 6, 59,184, 40, 87, 18, 28, 67,153, 33, 49, 97,176, 83,152, 50,131,176, 53, 32, 52,160,177, 39,117, -191,238,126,227,125,239,142,103,220,211,154,242,199,218,231,156,219,168,170,235,117,247,187,245,250,222,163,189,215,250, 13,223, -239,231,155,166, 8, 33,184,126, 99,143, 31,251, 91,223,193,143,254,240, 79,240,161,127,241,211,124,241,127,255, 73,206, 63,245, - 71,145,138,214, 61,195,171,174, 59, 94,154, 98,189,229, 89,119,220,235, 72,209, 77,131,238,253, 10, 73,187,242,182,115,129,204, -181,137,103, 93,165,146,198,121,233,166, 88, 18,106,197,184,239, 84,235,221,178,127,213,161,139, 21,156,198, 11, 54, 12, 79,177, - 9,182,233, 4,117,171,203,124, 13,170, 25,109,197,241,125,232, 58,112, 95,131,112, 49,238,216,196,191, 23, 73, 55, 38,240, 49, -238, 53,180, 85,252,225,117, 26,181, 24,171,233,217,170,248, 14, 22,239,226, 46, 91,136,168,144,119,117,217, 89,216,196, 38,175, -219,182, 72, 20,166,110, 80, 89, 44,176,189,105, 9, 88,156,105,240,245, 18,231,226,247,101,154,134, 36,203,144, 90, 97,235, 57, -217, 96, 4,105,130,112, 45, 82, 6,140,239,108,107,136,104,101,171, 43,124,144,232,254, 40, 78,194, 46, 68, 33, 6,231,153,222, -123,141,217,237,155, 44,231, 11, 46, 63,114,153,172,159,240,240,133,155,156,216,248,156, 39,182, 37, 85, 41,165,115,152, 36, 35, - 84, 53, 65,102, 4, 23, 72,180,140, 29, 47,129,243, 69,131,247,129,218, 58,108,103,195, 13, 65,176, 52, 46,130, 50,145, 72, 41, - 24,101, 9,123,189, 30,143, 93,222,167,208, 9, 41,146,178, 44, 57, 63, 61,101,180,189,141, 38,193, 47,166,108,239,109, 81,158, -157,177,172,230,152,197,148, 68, 10,126,248, 74,202,239,156, 88, 94,111, 65,168, 24, 16,147,117,183,174, 39, 96, 58,212,244, 64, - 11,164,146, 24, 31, 88, 74, 79,218, 25, 20,122, 74,160,187, 66,210,119,107, 0,191,162, 39,178,225, 50,188,177,246, 23,235,128, - 22, 41,163,149, 45,205, 51, 72, 61,119,254,252,156, 98, 91,144, 15, 6,204,155, 26,165,161,181, 22,227, 90,134, 87, 14,176,149, -160,109, 20,187,143,245,200,198,138,118, 18, 8,141,163, 24,246,105,102, 21,197,120,136,208, 5,253,113, 10, 4,250,195,148,229, - 36,103,188,147, 51, 63,171, 81,211,146,230,172, 66, 14, 18,246,110,236, 50,185,119,194,253,231,239,241,229,195,155,124,211,123, - 62,200,205,231, 94, 71,164,138, 68, 23,100,105, 66,121, 63, 62,215,179,249,156, 32, 2,119, 78,207,169, 92,201, 40, 29, 33, 69, -194,121, 61,231,176,188, 79, 79, 41,254,251,111,255,113,150, 50,160, 50,199,108,186, 96, 58, 45, 81,137, 97,111,188,197,201, 98, -138,150, 18,253, 96,217,208, 75, 52,147,186, 37, 85,208, 79, 18,166,203, 5, 31,122, 92,110,242,148,131, 96,118,231, 14, 7,111, - 63, 32, 49, 75, 78,110, 61, 36,219,222,165,126,120,159,252,218,123, 34, 84,160,105,208, 50,198, 26, 90, 19, 72, 82, 9,121,202, -238, 86, 15,170,130, 59, 15,231, 56, 91,241,199,159, 60,229,175,126,227,147,228,137,224,244,116, 70,175,159, 71,129,115, 7,195, -240, 93,212, 95,221, 90,132, 78, 25,237,140,248,216,167, 95,162, 92,158,114,126,120,139,225,214, 1,207, 77,206, 56,216, 27,197, -209, 86,154, 96,237,130, 94, 1, 90, 43,108,211, 34,218,146,173,113, 15, 79,193,116, 58,103,171,151, 83, 86, 93, 85, 83,213, 32, - 4,109, 61,231,111,254,224,119,240,123,255,219,127,197, 19, 55, 30, 97,220, 43,232,231, 57, 91, 69, 10,222, 83, 86, 37,214, 88, - 62,253,249,175,240, 77,215, 11,122, 87, 15, 64, 73, 68,170, 8,203, 42, 42,169,107,131, 42,204,102,215,170,211,181, 53,171,139, - 6,138,104, 72,219, 9,201, 86,167,152,117, 49, 89,204,196,203, 60,254,126,236,224, 67, 7,229,217,112, 16, 99,220,128,171,154, - 40, 34, 91,143,244, 26, 92, 83,225,202,154,208,169,120, 69,158, 19,100,129,176, 14, 23, 26,130,211,241,115,117,116,208,255, 56, -218, 84, 90,198,203,173, 75,218,146, 46,144,228, 25, 66,105,178,193,136,234,228, 1,195, 71,159, 37,248, 47,196,168, 71,149,144, -245, 6,168,112, 74, 45, 50,242, 68,224,173, 33, 27, 95,166, 33,224, 79, 79,208,123, 7,248, 50,226, 88,243,126,129, 72,195,134, -194,229,163,253,204,181, 49,241, 45,116, 94,225, 24,148,178, 73, 71, 91,143,215, 47, 72, 9,226,124,211, 95,192,180,134,142,175, -189,177, 27,209,113,205,131,220,116,241, 32, 98,194,157,119, 4,181,202, 40,151,221, 40, 56,116,207, 90,204,174,247, 29,248,198, -119, 33, 26,190,174,186,110,211,227,233,108, 75, 86,224, 45, 76, 39, 51,178,254, 14,229,225, 3,126,247,175,125, 11,141,117,100, -251, 87,104,188, 65,101,125,126,241,181, 59,156,215, 13, 91,131,130,179,218, 32, 69,100,108,251, 16, 11,231, 97,158,115, 88, 26, -254,254,119,127, 23, 79, 63,245, 52,105, 30,191,183,175,220,121, 72,223,181, 44,252,136,179,123,231,164,162,225,241, 27, 55,176, -193,240,250,139, 47,243,126,255, 21,178,119, 63,141,237,143,227,129,181,156, 67,190, 5,106,240,134, 78,184, 95, 20,188,237,137, -109,254,245,111,253,115,158,251,194, 39,248,174, 31,251, 41,228,143,253, 67, 62,254, 3,239,237,106, 28,223,193, 99,186, 93,235, - 42,171, 60,128,235, 60,226, 43, 58,221, 42, 52,236,194, 21,222, 57, 16,196, 70,229,190, 98,177,116, 95, 47, 85,135,236,148, 97, - 93, 28,188, 97, 61,205, 74, 83, 26,185,249, 43,234, 87,100,185,199,103, 85,136,168, 7,240,110,227, 58, 91,187, 32,173,239,194, - 96,162,196, 62,149,174,131,226,248, 77, 70,188,143,228, 55, 42,131, 15, 13,162, 93,118,145,198, 9,194,214, 81,223, 33,117,199, -111,215,120,215, 70,206,186,109,227,216, 29,139, 68,197, 12, 11,157,225,218, 6,103, 13, 66,200, 53,146, 87, 8, 17, 45,103, 34, -193,154,146,224, 70,248,122, 17, 59,251, 54,106, 70, 98,113, 18,211, 18,131,157,226, 85, 31,169, 83,146,222, 40,218, 37,189,141, -144,166,149,197, 46, 68,220, 45,222,163,242, 2,209, 54,168, 36,199, 27, 75, 8, 49,102, 52,116, 88,219,233,221,215,185,251,197, - 47, 51,216, 30,211,248,128,152,206, 40,182,123,180,222, 99, 85,198,153,129, 52, 9, 40,165,104, 22, 6,175, 53,153,247,152,110, -117,146, 37,138,186,117,241,140,239,220, 6,182,123,143, 28,129,210,172,212,238, 81, 29,211,207, 82,180,146,140,243, 34,194,117, -180,164,109, 34,229,174,156, 76,168, 23,115, 30,221, 26,144, 10, 56, 45,167,180,243, 41,169,138, 5, 72,170,224,123, 14, 20,191, -250,208,114,212, 58, 82,173,104, 2,164, 33, 32,181,160,144,158, 76, 74,132, 15,140,101, 96, 43,137, 77,216, 64, 16,249,244,248, - 72,101,236, 10, 80, 27,181,193,107,129,231,106,120,167,244, 38, 49, 16,113,193,161, 17, 31, 28,116,190,141, 16,125,122,151, 22, - 44, 39, 75,174, 60,186, 75,121,214,114,255,245,219, 60,241,212, 35, 56, 19, 39, 37,161,241,164,189, 1, 82, 11,172,145, 88, 11, - 78, 74,124, 99,105,130,228,242,227,187,220,126,254, 62,179,163, 37, 66, 11, 76,227, 24,108,141,113,174, 33,205, 60,249, 80,163, - 24,208,202, 37,105,218,167,182,134, 80, 25, 46,101,251,124,249,139,207,145,168,148,189,237, 29, 66, 86,210, 98,121,243, 87, 95, -225, 43, 95,190,135,210,158,190, 30,211,147, 5,173,232,227,172,195,203,150,161,144, 76, 84,194, 79,253,245,159,224,228,236,148, - 36,205,152,157, 45,152, 47,150, 88,103,120,254,236, 53,246,251, 59,212,174, 38,208, 67, 91,231,169,132, 99,209, 90, 6,169,198, -122,199,110,218, 85,212,162, 27,167,117, 38,254,135,207,125, 22,191,152,161, 14,174,225, 31,189,134,104, 26,156,202,112,109, 36, - 40,181, 77,217,189,248, 50, 30,168, 2,198, 91,125, 78, 14,193,183, 75, 62,255,229,219, 60,118,109,204,173,215, 15,217,221,237, -147,230, 3,234, 38,224,154, 24,240, 46,112,164, 72,172,119,221, 7, 26,119, 90,151,247,115, 78,213,144,124,116,149,135,135,183, -216, 26,247,121,240,218, 17, 72,141,119, 18,171, 20, 7,227, 17,139,243, 19,146, 34,103, 62,175,152, 83,145, 21,125, 22,141, 37, - 53, 75, 18, 33, 98,184,136, 12, 12,122, 57,223,252,225, 31,161,254,204,207, 51,220,190,132, 94, 24,170,166,226,165, 87,207,169, - 27,195,254,168,199,116, 89,197, 81,177, 8, 28,221, 61,226,250, 32,135,222, 0,185,183, 75,152,205, 8,178,192, 87, 75,154, 96, - 72,183, 47,117, 36, 57,223,201,126,163,161, 55,168, 46,125,204,217,206, 66, 35,227, 37,223,182, 81,212, 86, 71,235,150, 51, 45, -190,110, 8,109,187,137, 89, 5,188,144,235,212, 42,223, 68,164,170,109,106, 92,211, 68,114,218,108, 66, 88, 44,177,203, 22,177, - 61, 68, 13,134, 36,163, 45, 40,122,177,166, 80, 17,201,180, 74, 26,139, 74,231, 16,109, 53, 62, 16,180, 68, 10,137,202,162, 50, - 95,107, 77, 16, 93, 16,204,164, 70,247, 50,250,227,113, 7,206, 0,169, 21, 77, 89, 35,165, 66, 10, 15,233,101, 84, 58,197,169, - 45,218,147, 99,212,214, 54,161,173, 8, 71, 15, 72,246,246,187,145,172,140,222,223,182,163,100, 57,183, 94,234,134, 46, 39,254, - 13, 89,201, 65,188,113, 63,122, 49, 40,197, 69,227,106,232, 60,254, 43, 70,123, 88,237, 62,141, 95,239,215,195,202,141, 16,124, -119,105,117,191, 23, 34,214, 52,172, 2, 34,130,239,184,220, 17, 2,130,214,209, 98,173, 84,204, 43,246, 26,100,142, 49,129,220, - 57,116,235,249,216, 63,255, 73,158,255,253,223,103,116,249, 10, 46,120, 26, 82,254,244,116,193, 39, 30,220,161,167, 53, 82, 8, -170,214,146,104,133,115,142,210,195,126, 47, 99, 90,183,140,250, 35,126,241,251,190,143,108,156, 51,153, 60,224,245,155,115,206, -231, 53, 3, 37,225,250, 37,110,221,122, 64,235, 12,111,186, 52,230,120,177,228,252,240,132,119,154,135,140,223,172,176,105, 31, -185,156, 34,149,142,236,240, 98, 7,149,239, 94,240,115,199, 34,103, 32,224,171,158,121,156,201,249, 93,254,143,191,247, 55,248, -158, 31,250, 73,190,245, 35, 19,254,236,199,190,153,217,243,127,126, 33, 2,125, 19, 28,179, 78, 82, 91, 55,235, 29, 71,207,118, -194, 53, 21, 46,208, 98,195, 58,151, 58, 92,160,133, 9,177,106,208, 3, 23, 83,106,196,133,100,182, 88,204, 93,208, 28, 10,129, - 16, 43,152, 80,183, 11,245,157, 34, 78,132, 24,219,218,165, 24,107,213,133,186,116, 43,147, 56,250, 54, 23, 8,224, 43,161,104, -178, 65, 55, 59,143,111, 75, 96,134, 28,236, 19,108, 11, 42, 33,216, 26,172, 69,100, 61,130,105,241,190,233, 46,228,121,252, 30, -117, 15, 87, 77, 8,197, 24,215, 44,240,117, 73,208, 25,202,153,248,238, 42,133, 43,151,241,191,209, 54,216,122,129,107,218, 8, -156,106, 23, 49, 68,168, 19,114, 6,231,208,189, 1, 2,137, 78,114,116,175,223, 41,221,227, 37,164,178, 2, 93,244,208, 89,142, - 53, 38, 82,234,156,143, 1, 49,222,199, 68,183, 14,197,140,247,216,186,225,222, 75,175,240,240,193, 41,193, 7,150,117,195,246, -163,187,120, 97, 24, 72,201,131,214, 16,178,156, 10, 73, 83, 53, 20,189,148,233,188, 34, 43,114,122,210, 83,182,150, 52,137,147, -139, 89,235, 72, 47, 84,208, 33,132,136,141,149, 81,104, 38, 16,140,243, 12, 45, 21,189, 52, 97,177, 44,217, 26, 13,105, 91, 71, - 89, 47, 89, 44, 75,182,135,125,246,243,132, 93, 44,199, 47,191,136,245,129,180, 40, 16,213,108,109,241,149,222,243, 55, 46, 39, -124,124,226,120,190,140, 33, 83,121,183, 30, 13, 66, 50, 80,130,221, 20,114,225,217,210,130, 44, 4,180,140,124, 5, 41, 69,236, -206,187,245,206, 42,137, 57,138, 55, 55, 73,128,157,121, 96,157,186,184, 89, 13,197, 2,179,184,252, 8,217, 32, 33, 75, 18, 70, - 55,174, 50, 61,170,200,250, 57,245,210, 49,222,221,165,109, 90,130, 12,140, 30,217,231,181, 79,124,137,222,193,136, 84,194,233, -221,115,132,128,249,164,101,255,145, 17,147, 7,231,204,206, 30, 80, 20, 99,118, 47,237,146,245, 21,229,121,201,236,161, 97,235, -218, 8,215,120,154,178,102,247,234,152,151,190,112,139, 94,145, 82,150, 2,227,107,246,246,247, 80, 40,150,101,197,163,111,126, -148,155, 95,190,195,253,155,103, 44,150, 11, 50, 61, 6,150,204,236, 2, 21, 2,214,183,228,137,224,112, 49,231, 39,191,253,111, -115,120,122, 68, 81,244, 88,206,151,244,147,140, 48,176, 52, 6, 46,183,123,248,208, 99,222, 30,177, 83, 20,104,227, 3,109,219, -117, 20, 66, 49, 55,150,247,111,203,120,246, 10,177,238,230,116,140,148,230,244,206, 43, 20,181,192,251,134,237, 31,254, 31,169, -170, 37,189,188, 96,190,152,179,152,215, 36, 50,224,131,100,123,103,132, 76, 4, 37,142,157,157, 33, 55,111,222,226,109,143, 12, - 56,121,112,194,161,182,156,205, 6, 92,191, 17,200,219, 6, 80, 88,231,168, 90,199,206, 32,163,106, 26,236,188,193,122,207,114, - 89,209,180,134, 7, 71,199,188,227, 45, 87,249, 98,179,228,248,244, 12,219,206,216,219, 30, 32,244, 16,172,227,244,252,140,233, -100,130, 63, 79,216,218, 25,177,152, 76, 88,180,150,173,126,206,108,114, 78,210, 31,145,164, 41,198,181,124,240,125,223,201, 19, -211,223,225,112, 94, 49, 26,245, 89,204, 78,146,225,185,113, 0, 0, 32, 0, 73, 68, 65, 84,208, 66, 48, 84,154,147,208, 32, 37, -164, 82, 33, 18, 79, 42, 51,238,221, 95,178,125,117, 74,238, 61,114, 16,227, 76,195,116, 14, 89,134, 88, 24, 26,125,134, 74,163, - 14, 0,217,237,232, 0,146,110,100,222,217,162,226,152,221,196, 75,217,216,184,135,110, 90,172,181,208,117, 9,161, 67,104,174, -179,129, 67,204, 31, 86, 33,122, 85,221,108,137,175,150,184,201, 57,246,238, 3,154, 69, 21, 61,218,167, 19,178, 71,174, 32,211, - 44,122,233, 67,124, 89, 54,150,176,248,247, 74, 43,186,168,243,152, 85, 44, 21, 42, 77, 80, 73,142,202,114,100,146,162,138, 2, - 87, 86,228,131, 29,134, 59, 45,105,175,199,226,124,134,232, 60,247, 33, 73, 34,209, 14,135,244, 1,151, 40,228,206, 46,246,252, -140, 48, 28,224,141,197, 31, 31, 35,199,195,120,217,120,113,193, 39,188,138,187, 92,113,195,195, 38,150, 60,108, 46,229, 55,252, -111,213,169,139, 0, 54, 22, 9,200, 8, 0,138, 41,183,241, 82, 70,132,104,237,235, 46,183,149,167,117,173,189,187,112,121,248, -136, 83,139,159, 67,215,185,199,142,202, 98, 77,139, 74, 10,210,241, 54,164, 5, 89,222,199,182,134, 95,250,151,191,202,239,127, -254, 37, 14, 46, 93,230,219,126,224,123,152,124,254,203, 60,184, 55,231,213,101, 96, 98,106,118,139,140,210,198,238, 71,119,147, -167, 84, 43,178, 32, 24,224,120,203, 83, 79,241,214,167,223,202,159, 60,247, 34, 94, 40, 68,210, 35,209, 25,211,243, 83, 70,143, - 93,227,181,227, 51,166, 75, 71, 63,109,152,212, 99, 62,243,185, 23, 57,157, 76,248,190,247, 13,168,210, 75, 20,229,130, 16, 28, -121,154,227, 80,248,182, 69,134, 6, 33,178, 53, 32,101,126,255,140,197,141,109,194,225, 9, 55, 30,191,138,217,247,252,241,111, -253, 2,239,185,127,151,175,249,185,223,229,249,255,245,239,114,244,145,223,125,131, 39, 27,186,177,235, 10,234, 18, 54,202,117, -157,116, 49,143, 93,193,181, 22,192,177, 25, 60,173,214, 37, 65,136,152,179,174, 86,214,184,120,191,226, 58,192,140,239, 86, 74, -146, 55,120,215,133,250, 11, 25,240,221, 40, 53,118, 89, 1,108,236, 24, 67,135,186, 21,158,232,158, 17,129,252,107, 62,176,122, - 72, 46,128,159, 76, 39,196, 83, 49,255,192,153,184, 19, 95,158, 34,117,190,254,103, 84, 22, 39, 22,166, 92,123,242,108, 89,162, - 18,137,107,107,154,243, 51,146, 65,131, 43,231,248,110,133, 69,162, 35,205, 13, 58,150, 66,156, 16,152,249,180,211, 9,121,156, -119,113,213, 17, 20,193,148,200, 36, 71, 72,133, 16, 41, 66, 74, 20,160,179, 12, 91, 85,208, 27,196,247, 83, 41,140,137,241,192, - 74,107,218,106,129,146,129, 32, 6, 4,211,162,148, 6, 41, 48, 29,152,198, 57, 71,227, 60,163, 94, 2, 72,122,253,148, 36,207, -232,245, 51,182,140,224,176, 54, 52, 94, 66, 18,133,194,169, 74, 48,198,144, 20, 25,165,105,200, 19,141, 51, 22,213,237,165,165, -128, 92, 43,106, 27, 87, 90,178,211, 70, 37, 82,162,132, 96, 81, 55,228, 74,241,252,225, 17,239,204,115,178, 92,208, 58,207,168, - 87, 32, 77,197,163,163, 33,139,233, 41, 33,237, 49,238, 15, 49,179,135, 17,171,159,166, 96,236, 58, 29,240,253,219,138,167,250, -158,187, 85,244,162,247, 59, 49,101, 42, 60,133,130,173, 68,146, 74, 80,157, 16, 46,116, 80,153, 24, 58, 40,214, 69,232,134, 58, -184,153, 20, 73,249, 6, 74,243,122,197,227,125, 20,216,229, 59,215,152, 62, 92,114,120,231,144,183, 62,243, 54, 94,123,245, 22, -136, 24,141,171, 18, 69, 47, 27,224,109,192,151, 51,208, 67,252,204,113,178,188, 75,146, 15,104,231, 53,215,158,190,132, 78, 53, -211,123, 21,193,164,132,190,228,238,203, 71,140, 70, 5,147,147, 9, 91,251, 99,206,238,156,226,131,160, 46,107,132, 10,184,202, -227,146, 40,178, 83,133,164, 89, 56, 46, 61,153,241,196,229,183,242,255,253,246, 71,121,250,137, 71,168, 22,158,201,180,229,234, -182, 65,107,197,229,100,159,215,206, 94,229,188, 61, 99,106, 26,254,242,179,207,112,124,126,202,214,126,159,201, 98, 78,115, 58, -163,182,150, 98,164,185,255,234, 49,253,194,114,237,198, 62,215,203,171,252,236,199,126, 22,109, 59,191,104,166, 4,149,179, 88, -239,249,235,151,244,198,186, 19, 98,164,166, 95, 41, 11,125,160, 60,254, 10, 5, 79, 32,146, 2, 91, 85, 52,245, 34,134, 0, 44, - 74,166,141,165,215,239, 99,157,165,173,106, 76,235,144,120,118, 71,125,238, 47,151,124,241,230, 29,244,157,187,188,255, 27,222, -206,114,145, 67, 94,176,168, 27,148,138, 86,143,211,211, 37, 90, 11,180, 86, 72, 66,212,136,248,192,141,107,151,152,204,206,105, -173, 97,208, 75, 57,183, 57, 47,222,122,192,168, 63,161,151,233,117,148,163,166, 97,118, 90,145, 36, 9,153,178,228, 26,138,131, -125,206,102, 19, 48, 5,223,255, 87,254, 10,251,211,223,231,104, 86, 81, 20, 57, 54,120, 70, 69,129,169,107, 78,102,243, 24,103, -232, 60,227, 97, 15,116,194,142,177,188, 60, 95,112,112,239,152,189, 3, 71, 64,144,110,141,145,222, 19,230,115, 84,154,194,241, - 9,236,236, 16,242, 20,237,116, 28, 61, 10, 1,173,137,163, 62, 23,153,229,182,105, 9, 85,213, 93,228, 38, 42,101,173,237,130, - 62,136,163,245,245, 24,186,131,156, 4,135, 68,224,156, 35,180, 38,142,237,210, 28, 89, 12, 81, 87, 83,114, 27, 80,137,194,216, -104,103,112, 77,131,232, 57,164, 74, 17, 50,116,105, 89,172, 36,162, 72,161,241, 2, 20, 18,151,202,168, 34,149, 10,149,165,232, -193, 16,161, 53, 66, 73,234,243, 51,210,253, 49, 58, 63, 35, 29, 12,112, 39,103, 8, 37,177,198,145,164, 49,121,230,164,106,248, -211,143,254, 25, 31,126,239, 87,147,100, 26,215,235,211, 46,150,104, 85,195,214, 8,113, 54,137,193, 46, 58, 89,143,112,215, 64, -151, 85,230,177, 91, 69,195,190, 49, 36,101,149, 46,135,232,148,253,171, 11, 58,184,206, 51,221,169, 96, 87, 9,106,221, 8, 61, - 8,214,227,245, 55,254, 21, 29, 78,171,125,232, 74, 40, 21,130,195,117, 88, 95,107, 44,222, 11,210,124,128, 46,118, 24,110, 95, - 66,160,249,185,255,235, 55,120,120,126,138,151,146,171,227, 20,219, 46,121,248,192, 50,218, 30, 96, 94, 63, 98, 54,183,156,149, - 37,198,249, 24, 86,177, 66, 87, 10, 72,148,164, 31, 44,123,215,159, 68,140,199,124,242, 43,175, 51, 26,141, 25,245,250,204,107, -203,189, 7,183,184,178,183,197,225,100, 74,235, 51,110, 29, 29,241,216,254, 0, 53,159,241,210,107,175,176,156,156,195,123,158, -196,171,235,216,122,129,202, 51,172, 0, 91,205, 72,189,239,110,196,232, 51,158, 28,221,225,124, 89,243, 96, 58,231,250,104,192, -236,248,140, 98,119,196,254, 51, 79,114,243,246,199,240,255,116,201, 87,253, 79,191,204, 23,255,254, 15,115,252,145,223,217, 40, -211,217,132,167,191, 49, 56,101,147,173, 46, 59,135,133,232, 88,237, 74,117, 35,252, 16, 99, 47, 87,105,108, 82,139,245,129,186, -138, 83,149, 82,108,132,119,116, 12,122, 45,214, 99,120,239, 34,230, 19, 23, 34,174, 87,172,124,242,171,208,236,176, 14,124,193, -197, 68, 64, 41, 68,156,178,143,158,216,228,163, 95, 20, 86, 10,129, 76,114, 92, 85,226,189, 33,180,237,230,226, 15, 49,213, 79, -166, 81, 16,231, 76, 29,131, 88,130,199,204, 30,226,210, 94, 44, 10,125,131,109, 20,206, 52,132, 16, 48, 45,113,149,211,205,119, -189,141,248, 98,157,230, 88,211, 68,205,140,239, 82, 5,157, 7,225,226, 94, 94, 37, 8, 33, 81,121, 4,205,184,182, 65,234,232, -254,113,243, 25,161,191, 90, 47, 69, 17,103,219,148,132,214,226, 18,240,211, 83,132, 46, 72,250,163, 88,108,170,148,249,189, 87, -209, 73, 74, 91,183,212, 82,112,249,145,125,212,114,201,173, 87, 14,241, 46, 48, 30, 13, 32,179, 28,213,142,105,229, 81,105,252, -188,140, 3,149,196,125,122,180, 20, 10,116,151, 77,159,233, 88,176, 25, 39,186,132,194, 85, 56, 10,180,214,161,165,164,178,150, - 55, 95,185,204,210, 24,206,230, 75, 2,241,191,117,105, 48,192,232, 20, 39, 53,151,158,120,132,246,244, 40,118,213,189, 33,182, -173,227,252,100,181, 16, 23,176,155, 72,118,147,248,234, 59, 65,156, 20,116,239,173,146,155, 33,205,234,189,117, 93,236,110,184, -112,145, 59, 31,208, 98,163,225,240,126,109, 80,192,119,107, 35,183, 90, 31, 5,129, 37,176,251,214,175,225,214, 39,207,240,198, -243,250,235,119, 48,181, 65, 37,112,251,244,140, 15,160,201,135, 3,142,239,223,161,158,143, 16, 50,193, 72,203,242,212,112,249, - 77, 99, 78,170,150,197, 81,139, 21,115,204,194, 50,186,180,205,226,116,193,104,191,135,115,142,237,131, 45,202,101, 25,215,121, -222,147,228, 41,243,233, 18, 47, 53,251,143,229,220,123,112,196,245,199,159,226,165,151, 94,224, 43, 95, 57,101,111,112,141,221, -237,130, 73,125, 70, 95,143, 24, 23, 5, 75,183, 96,231, 74,131,114, 61,182,203, 29, 2,158, 66,215,252,230,103,255, 3, 63,253, -159,253, 56,147,147, 19, 8,150,198, 47,113, 86,209, 52,134,169, 59, 39, 93, 38,180,175, 28,115,227,201,107,124,251,155,223,135, -214,221, 15,111,124, 64, 11,201, 65, 79,115,144,138,117,194, 81,232,246, 94,206,116,149,144,140, 74,213,244,237,239,138,112,133, -186, 69,229,138,182,174,241,206,176,189,221,163,169, 27, 36, 22,103, 60, 58, 13, 72,225,200,251, 41,198, 89,242, 60,229,193,131, - 91,220,190,183, 71,109, 12,227,126,159, 52,207,232,247, 10, 90,179, 68, 8,137, 9,130,156,100, 13, 24,185,180,183,195,249,233, - 57,231, 70,240,174,103,159,225,232,232, 20,113,251, 22,253, 34, 67,168,148,166, 90,112,116,126, 28,133,118,206,144,101, 41,153, -212, 40, 5,167,167, 15,185,188,127,192,123,174,239,242,173,239,188,206,209,221,127,143, 43,182,232, 21, 57,130, 40, 66,203,122, -209, 35,252,228,141, 75,220,185,191, 96,247, 96, 76,211,198,150, 33,104,201, 3,155,225,142,231,156, 15,123,136,172, 36,104, 65, - 50,220,194,205,230, 36,219, 59, 72, 12,162,170,160, 95, 96,140,143, 41,101, 29, 63, 60, 52,113,212,238, 77,139, 93, 54,120,211, -198, 93,137,139,213,124,236, 44, 67,167,118,221,136, 60,164, 88, 39,233,198, 14,214,154,117,154,147,202, 82,188,216, 34,217,150, -160,227,104, 76, 16,240, 77, 73,217,152, 85, 32,215,102, 15, 42, 55, 50, 80, 33,117, 84, 50, 11,133, 20,186, 11, 93,209,232, 94, - 63,142,196,118,118, 89,126,233,139, 24, 15,217,193, 21,146, 60,199, 53, 6,215, 90,164, 78,215,111,143, 18,130,225, 86,159, 82, - 42,126,251,207,190,192,254,214,144,247, 60,126,153,162, 87, 96,155,150,242,232, 12,149, 74,116,146, 34,146, 28,153, 38,200, 44, -141,113,160, 50,238,243,227,178, 61, 38,219, 5, 47,222,144,194,181,190,216, 59, 10, 93,140,145,245,235,228,182,176,206,196,246, -107,220,172,119,161, 91, 53,116, 74,119,213,165, 89, 5,143,235, 62, 11,223,225, 63,125, 55,118,247, 86,224, 86, 24, 90, 20,217, - 96,135,193,248, 50,181,131,127,241,123,127,196,171,231, 37,147,170, 68, 18,104,218,192,118, 95, 51,204, 45,159,189, 19,248, 79, -159, 25,179, 59,204, 88, 28,149,180, 33,138,119, 50, 9,214, 9, 18, 21,247,247,169,179, 60,246,230,167,112, 91, 99,202,214,177, -183,183, 67,146, 38,148,109,205,253,243, 51,100,104,153,183, 53, 85, 25,232,229, 22,220,156,233, 60, 58, 37,124, 83,114,188,156, -114,255,240,148, 43,251, 39,140,149, 32, 29,143,112,198,210,206, 42,242,182, 3, 12, 73, 77,162, 21,251,251,215,248,161,247,190, -155,231,111,190,196,224, 81,232,169, 62,253,162, 69,246, 91,134,215, 46,113,178,188,197,167,255,187,191,195,215,252,163,127,201, -151,127,234,135, 56,250,200,239,110, 44,224, 23,214,224,235,177,249,138,228,231, 5, 65,119,251,246,149, 94,193,119, 79,215,202, - 37,198, 42,159,190, 43,160,132, 64,200,139,221,245, 38, 68, 38, 90,214,194, 5,233, 68,119,250,202, 85, 32, 7,107,242, 93,167, - 83,219,120,232, 87, 73,112,182,219,201,227,129,250, 66,112, 75,135,138, 85, 41,193,214, 4, 95,197,125,113, 83,145,166,219,224, -108,212,118, 4, 8,174,193,213, 22,148,140, 97, 75, 54, 90, 44, 93, 93, 33,116, 70, 8, 14, 59, 63, 39,116,206, 23, 41, 28,182, - 54,168,180,136,207, 84,221, 96,170, 41, 74,236,198,201,155, 45,163, 7,221,117,170,106, 28, 58,209, 4, 21,161, 68, 4,133,146, -161,203, 94,151,164,233, 8,103,154,142, 41, 16, 21,238,206, 71, 95,189,200,243, 11,105, 38, 27,252,180, 80, 10, 87, 47,153,157, -157, 99,140, 65,135, 12,103,162, 18,186,108,107,154,218,225,165,166, 81, 25, 89, 38, 25,167, 1,211,122,208,129, 4, 25,153, 2, - 62,134,175, 84,198,197, 46, 86,119,140,253,206,141, 96, 99, 6, 77,236,226, 87,121,227, 50,106, 79, 78,102,115,198, 69, 78,166, - 53,137,150,148,117, 73,126,229, 17, 78,207, 79,184,254,232,155, 16,206,146, 36, 41, 62,239, 81,150, 75,188,247,248,149,222, 97, -165, 92,239,214, 95, 74,117,197, 3,113, 79,142, 18, 88, 31,214, 93,125, 16,108,194, 89, 58, 13,135,191, 0, 7, 52,145,103,211, - 65,130,196, 58, 1,123, 37,162,148, 93,175, 32, 58, 21,157,241, 57, 87,223,114,137,207,124,250,203,236, 45, 27,134,151, 10,166, -247, 65, 13,166,244,183,182,169,171, 9,161,113,180,193,145,229, 26,172, 32, 36,146,166, 46,113,203,115,142,143,103, 20,195, 61, -138,222,128, 52,149, 44,167, 37,139, 73,131, 46, 36, 90, 42, 78,239, 78, 80,153, 38, 9, 9, 62, 83, 20, 38,229,196,223, 7,117, -153,241, 65,134,208,138,118, 33, 17,164,124,238,179, 47,224, 91, 88,154,192,177,187,203,229, 98,159, 87, 78, 14,121,199,238, 85, - 94,187,119,194,162, 93, 82,228,158,220,246, 72, 84,202,253, 91,247, 73,123, 2, 82,195,214, 65,143, 23,159, 59,132, 89,140, 93, - 45,219,150,153,121, 13,110, 6, 62,240,236,135, 81,227, 34,253,153,135,203,150,218, 70, 98,211,175,189, 77,163,100,172,148,195, - 90,133,189, 34,249,116, 47,163,132,199,254,135, 95,137, 57,175,173,165,156, 47, 49,173,165,223, 75, 40,178, 4,211,212, 32, 21, -243,201, 28,129,165,109,226, 97, 60, 59,159,114,231,238, 93,238,222,191,131,181,130, 22,199, 78, 63, 35,120, 75,211, 52, 40,225, -217,217, 42,104, 26, 67,162, 2, 77, 19,253,147, 69,162,144, 66,145,104,143,111, 61,214, 90,150, 38,238,154,166,179, 57,214, 89, -180, 72,105, 90, 75,154, 14,168, 91,195,188,170, 72,210, 30,223,252,129, 31,226,127,249,137,239, 96,203,220,163,106, 44,105,214, -163,109,107, 82,169,226,158, 46,215,152,198,163,180, 98,180,219,227,232,172, 98,127,111,132, 74, 82,218,166,197, 91,135, 38,240, - 66,229,185,124,246,144,108,127, 59,118,143, 62, 64,150, 97,167,209,218, 16, 92, 76, 36, 66,198, 29, 91, 48, 6,187, 44,241,101, -141,169, 74,236,178,193,212, 45,206, 24,130,105, 55,124,237,238, 81, 13, 46,114,148,215, 93,165,232,186, 74,235,214,126,225,208, - 33, 43, 87,100, 78,143,236,194, 32, 36,182,109, 17, 82, 98, 67, 64,106,133, 44,122, 93, 1,214,189, 36, 74, 33,208, 72, 45,209, - 58, 69, 38, 10,169, 19,100,146, 34,147, 12,153, 21,164,195, 1,233,181,235,220,250,103,255,140,108,239, 50,234,145, 45,146, 36, - 35, 88, 75,181,172,152,158,157,179,253,196, 51,100,247, 95, 98,114, 86,146,236,239,243,202, 11,159,103,123, 60,166, 55, 28,112, -167, 50, 28,149, 6, 65, 96,148, 38, 40,161, 98,158,114, 55, 70,113,206,226,155,206, 14,228,162, 43, 32, 4, 79,176, 93, 44,101, -103, 67, 11,206,227,125,164,136, 69,253,144,143, 23,118, 7,196, 8, 54, 22, 68, 62,128,247, 46, 78, 40, 58,200, 71,112,177,210, -143, 16,144,248,231,186, 16, 63, 75,135,199,219,128,115, 30,103, 29,174,141, 95, 99,172, 67, 37, 61,138,164,199,253, 7, 39,252, -230, 23, 94,224,143,158,123, 1, 47, 4,121, 34,153,215,150,195,227, 25, 85, 93,161, 83,201,237,147, 57,253,188,224,250,158,134, -249,146,101,213,242,202,164,236, 84,225, 18,235, 61,195, 68,145, 42,201, 25,138, 71,223,252, 4, 46, 72,246,183, 6,244,123, 5, - 62, 88, 70,125,133,176,150, 73,213,144,165,154,179,249,130,179,233, 4,239, 44,139,186,165,170, 26,188,107,105,234, 40,136,121, -247,229,130,178,172,201,138, 12, 91, 45, 56,189,245, 58,253, 43,111, 38,219,221,143, 9, 94, 1,102, 15,111,179,223, 10,254,195, - 39,254,132,107,227, 17,185,240, 12,119, 34,201, 44,221,218,161,184,180, 79, 59, 57,164,253,242,243, 60,253,247,254, 41,183,126, -245,159,116,128,150,141,135,125,253,235,122, 82, 39,215,251,117, 17, 54, 22,161,205,215,108,188,192,171,209,168,214,162,139,118, - 21,107,194,238, 90,203,215,213, 98, 34,108,138, 56,209,165,200,197, 88, 81,162,115,161,243,174, 9, 41,214,216,130, 24,211, 26, -214,217,218, 66, 64,255,224,128,226, 29, 31,238, 38, 22, 81, 63,178,214,182,120, 23,117, 42,193,225,154,136, 7,246,214,226,109, - 75, 48,150, 96, 91,188,169, 8, 72,130,111,105, 38,167,221,200,222,226,218, 26,145,102, 93,154, 96,183, 42,240, 1,239,109,244, -163,183, 45,174,169,215,252, 2,103,154,181, 31,218,117,224, 24,180,140, 29,186,206, 16, 90,162,117,142, 72, 83,116,150,198, 31, - 47, 43, 34,240, 40,216,117, 24,140, 88, 81,251, 58, 60,178,206,251, 56, 23,213,209,222, 24,170,243, 83,206, 94,253, 10,159,254, -131,143, 32,180, 38, 79, 21,184,150,235, 59, 3, 68,211,208, 4,143,146,154,172,159, 99,173,235, 38,111,130, 52,203,200, 18, 73, -154,104,180, 86, 28,159, 46,162,216,205, 6,150,173,193,134, 64,101, 3,141,245, 52,206, 71,106, 91,119, 61,106, 41,216,201,114, -188, 16, 36, 90, 48,238, 21,148,141,197, 89,203,141, 43, 87,105,172,227,242,213,235,244,139,130,164,169,112,243,115,150, 85, 69, - 91, 47,241,166, 93,255,255, 37, 47, 20,101, 43,181,186,238,214, 62,234, 2,162, 56,172, 24,255, 97,227, 98, 93,215,143, 98, 99, -115,148,114,195,129,127,195,243, 43, 55,105,193,206, 95,208, 28, 95,122, 47,195, 27, 91,188,246,153, 7, 56, 85, 83,164, 57, 47, - 29,127,158,239,249,214,111, 67, 13, 83,218, 89,137, 42,122, 36,217, 0,188, 39, 29,244,176, 75,139, 74, 18,202,101, 69,179, 48, -244,119,247,201,199, 41,121,175,192, 46,151,212,173,199,151,134,214, 26,218,198,224,188, 35,223, 43,232, 13, 50,178, 97,143,118, -230,185,245,218, 67, 84, 57,224,246,205,123, 4, 37,233,231, 3,102,229,146,253, 43, 57,253,180,143,179, 22,143,231,116,121,204, -100,210, 50,107,150,156,182,199,236,247,251,156,182,167,164, 18,102,147,138,190, 74,169,171, 37, 15, 95,159, 33,165,103,209,148, -148,166, 34, 87, 26, 39, 2, 91,186,199, 51,239,185,129,254, 39, 63,250,125,120,231,152,215,130, 15,191,235,113,238,252,159,255, -115,124, 39,216,228, 34,116,164,128, 56, 25,237,132, 44, 94,167, 88, 99, 48, 85, 75,235, 2,137,148,180,141, 93,151,238,109,217, -160,165,197,182,129, 60,147, 44,149,164, 95,228,108, 13,122,204, 23,115,158,123,225,121,198,251, 3, 94,186,115,135,183, 94,191, -138, 9, 10,231, 53,245, 97,203,214,168,160,172, 35, 18, 84,137, 64, 89, 89, 90, 99,200, 84,206, 97,179,164, 50,112,117,103,135, -147,217,148,195,214,210,203, 82,202,202, 34,101,134,105, 91,156, 3, 45,114,156,213,124,221,215,190,147,219, 95,248, 61, 72, 10, -124, 57,195, 59, 67,154,166,152,166,197, 89,203,149,253, 61, 22,147, 99,250,163, 1,163,237, 29,182,134, 37,217,160,160,109, 61, -178,244,180,141, 39, 73, 19,122, 46,229,163,147,148, 15,191,248, 50,234, 93,111,195, 54, 13,109,219,146, 40, 73,123,120, 72,126, -176,135, 60, 62, 69,247,234, 24,202, 96,163, 37,199,219,208,229,131,119, 9,100, 43,113,182,243, 23, 60,215, 93, 47,226, 76,215, - 98,171,120, 40,116, 22,170,176,105,135,226,225, 41,187, 40, 77, 64,120, 71,219, 54,216,186, 34,200, 4,149,234,181,229,103, 5, -219, 8,178, 19,196, 41, 21,199,223,169, 68,166,189,104,215,145, 9, 34,201, 81,189,130,236,202, 53, 22,159,248, 56, 92,185, 76, -126,227, 90,140, 40,205,139,232, 57,109, 59,139, 79,146, 96,173, 37,209, 41, 22,131, 70,176,123,229, 82, 20,198, 40,137,183,142, -135, 77,197,235,231, 11,242,214,240, 88, 46,217,234,231,144,102,209,119, 74,196,112, 74,170, 72,225, 91, 45,194,100, 23,194, 16, -111, 96,130,176,235,128,156,200, 99, 95,249,210,227,161, 31,156, 32,208,196,174,220, 70, 33,162,239, 70,118,126,133, 47, 93, 51, - 99, 58, 17,156,245, 56, 25,119,252,182,109, 49,166, 65,202,130, 17, 45,254,214, 39,169,151, 75,254,205,244, 10,139,164, 96, 80, -228,136, 32, 72, 20,164, 42,144,105, 71,162, 19,142,207, 27,188,245,204,203, 41, 31,123,121,204,251, 14, 70, 60,126, 54,231, 43, -167, 25,147,166, 69, 74, 65,162, 52,103,198, 80, 27,199,187,222,249, 44, 58,141,221,219,194,120,148,171, 57,158,198,145,240,225, -121,201,176, 16, 44,150, 37, 14, 71, 85, 55, 12,115,197,178,110, 57,107,226,110, 63,193,243,235,183,103,124,219, 75,119, 24, 29, -204, 40,219,154, 98,107,196,217,241, 41, 87,191,250,219,224,228, 24, 70, 91,200,222,144, 98,231, 18, 95,250,252,167,185,220, 75, - 73,202, 37,147, 86,147,188,126,194,246,229, 45,194,108,142, 45,114,250,111,126,138,163,207,127,150, 27,159,255, 20,239,253,181, - 79,243,241,239,125,251, 38,238, 84,176,206, 51,223,236,184,253,186, 67,218, 92,236, 98, 13,249, 88, 61,143,225, 2, 68,198,117, - 28,241,176, 58,176, 87, 25, 56,157,122, 57,248, 21,209,110,163,167,243,157,253,136,213,110, 84, 69,177,156,191, 64, 10, 19,171, -117,160, 88,217, 16, 65,205, 22,107,245,118,252,230,116, 23, 38, 19,119,230, 36, 61,124, 57,235,184,235,128,107, 8,206,211,150, - 75,132, 16,104,157,224,154, 10,153,232, 53,223,192, 17,240,166, 38,204, 44, 66, 42,172, 16,104,157, 18,221,105, 41,182,141, 20, - 68, 99, 27,180,210, 81, 49,222, 86,232,193,184,227, 61, 58,130,153, 32, 85, 30,221, 60, 73, 18,223,127, 37,208, 43, 34, 79,103, - 21,115,182, 99,165,121, 79, 16,209, 33,162,178,116,157, 40,231, 58,210, 98,168, 5, 94,229,136, 60,167,156, 28,227,132, 98, 80, -164, 28, 92,218, 33,197, 98,103, 51,188, 82,228,253, 1,203,218,161,165, 98,188,157, 51,169, 28,200, 6,231, 60, 82, 43,132, 22, - 12,100, 74, 32,160,144, 24,103, 89, 54,142, 60, 81,204,156,197,134, 64,145,200, 78,107, 18, 47,224, 34,209, 52,206,226, 17,228, - 73,194,253,201,148,237,126,159,171,151, 46,177, 8,142,199,246,174, 80,182,150,177,150,148,179, 9,211,249, 12, 91, 45, 9, 38, -226,153,149, 8, 56,161,112, 4,146,176,166, 87,128,128, 54, 4,212,122, 99,210, 81, 9,229,198,111,177,138,240, 93,173, 84, 54, - 23,255, 38, 15, 98,181, 74, 88,233, 52,252, 70,182,211, 5, 7,117,142,133,100,151,231, 62,246, 2,243,102,206,233,236, 33, 47, - 30,222,225, 15,239,126,158, 31,255,145, 31,227,244,120,138, 19, 18,133,102,251,137, 33,147,155, 11,178,177, 70,157,120, 22,103, -231,248, 32, 17, 42, 33, 29, 56,238,190,112,155,247,127,255, 55,114,255,149, 91, 20, 67,205, 98, 49,103,119,235, 18,167,135, 83, - 70,251,125,122, 3,205,178, 62,103,127,231, 58,121, 33,240,231,142,251,167, 15, 24, 15,118, 34,109, 48, 64,191,200,176,218, 80, -183,115, 84,136,164,204, 52,237,209, 56,203, 91, 47,111,241,185,123, 11,206,231,142,105, 99, 89,154,150,151,102,159,226,250,118, -143,164, 72,201, 70, 30, 97, 19, 42,155, 80,132,140,198, 25,182,146, 1,183, 23,247, 72,255,164,135,250,222,175,127,251,207,136, - 32,121,230,171,223,199,244, 55,126,150, 96,234,181, 15,149,117, 37,212, 85,210,132,104,235,234,247,217,249,206, 31,137, 35, 39, -111,113,198, 49, 95, 44,233,167, 10,103, 12, 77, 85,227,156,165, 72, 53,182,110, 72, 50,133,240, 96,155,138,219,183, 14,121,253, -222,125, 14, 79,238, 51,204,115, 70,131, 2,231, 45,211, 69, 76, 42, 58, 62, 95, 48,155, 45, 73, 84,130, 8, 49, 31,100,185,168, -152, 47,150,180,214,177, 92,204,201, 19,133,113,134, 23, 95,187,141,241,158, 69, 99, 80, 50, 86,163, 73,170, 49, 70,144, 38,154, -237,173, 43,252, 23,223,255,221,148,119, 63, 25,249,201, 93, 22,183, 82,106,157,249, 44, 69, 64,161,233,111, 15,208,105,138, 18, - 18, 47, 99, 85,238,234,150,178,169,177, 38, 18,153,108,128,223,123,233, 1, 79,135, 37,195,235, 87, 99,199, 30, 4,206, 27,218, -233, 2, 15,180,117,133,115, 46,122, 86,109, 84,178,175, 65, 44,235,131,167,243, 68,135, 21,112,197, 93,176,118,109,212, 31, 97, -165,130,213,157,208,172,139,134,140,236,108, 31,209,165, 93,103,226,133, 36,201,178,216, 1,116, 68, 59,209,205,177,164,210, 72, -173,145,137, 66,164, 41, 42,203,144,105,142, 42,122,168, 60, 71,102, 5,186, 63, 64, 95,189, 70,123,120, 72, 32,176,243,161, 15, -226,234,115,116,150,211, 78,166,156,159,156,211, 44,107,174,189,235,235,241,207,127, 2,235,115, 30,158,221, 67, 15,123,228,195, - 1, 82,170,245,207,170,165, 36, 79, 83, 92,128, 59,149,225,229,211, 25,199,103, 51,134,193,146,154,128,178,150,224, 28,109,221, - 96,171, 26, 91, 86,216,186,198, 54,109,156,198,139,128, 55,113,245,224,157,195,181, 46,146,181,240,184,214,226,140,197, 89, 19, -225, 57,173,193,182, 46, 2, 55,172,195,154,248,245,214, 88,156,245,216,198,198,176,160,214,208, 54, 13,245, 98, 65,109, 60, 53, - 3,220,222, 91,121,242,235,191,141,249, 31,254, 2,214, 24,102, 33,225, 5,185,199,116,217,160,116,130, 74, 82,170,198,114,178, - 40, 81, 74,209,239,247, 72,148, 64, 38,154,126, 18,225, 25,247,221, 22,195,158,231,186,140,236,129,101,107,144, 4, 70,219,123, - 60,241,248,155,176,210,209, 88,137, 23,129,214, 5,140,135,197,114,201,188,170,104, 28,236, 12,114, 30, 78,231,216,166, 5, 37, -169,202,138,170,110,176,222,210,203,146,152,160, 21, 44,255,238,214, 57,223,126,173,207,249,233,148,135, 15,206,105,235,154,241, -104,159, 98,180, 75,178,189,133,201, 10,178, 36,229,231,255,155,191,203,193,112,128, 48,158, 52,120,178, 92, 83, 87,113, 50, 64, -150,161,139,156,193,141, 71,152,255,249,159,113,229, 47,127, 31, 71,255,254,255,198,204,206,215, 49,166, 23,242, 93,214, 81,174, - 23,247,219, 43,117,250, 10, 9,123, 49,183,125, 85, 75,174, 10,255, 21,151,155,117,184,198,198,170, 40, 59,111,250,133,112,183, - 11,171,162,149,158,189,187,188, 67,156, 18, 6, 17, 34,178,120,149,202,149, 72, 70,207,126,144,244,153,111,233,198,238, 29,155, -214, 55, 81,123,209, 86,248,106,134, 55, 77,164, 25,202,128,111,218, 88,164,212, 21, 58, 43, 8, 82,197, 11, 8,240,245,178, 67, -215, 90, 8, 26,169, 20, 65, 37,248,106, 30,199,232, 34,165,173,170, 56,122,111, 22, 68,101,138,196, 57,135,115,158,172,215, 39, - 88,143,243, 45,190,169, 17, 66,161, 84, 74,104, 27,210,254, 8,153,228,232, 44,139, 31,102,146, 70,113, 99, 80,132,142,216,230, - 2, 4, 19,153, 19, 58, 45, 98,225,238, 61, 82, 41,116, 49,138, 9,106,222,243,241,223,248, 53,122, 69,142, 82,138, 71,159,126, - 11,137,112, 92,223, 46,176,137, 70, 39, 41,122, 52,164, 50,150, 98,123,135,182, 83,225, 75, 64,234,149,114, 44, 48,157, 85,140, -135, 25,179,101, 67,105, 45,181,245, 36, 90, 98,186, 56, 99,211, 77,191, 6, 89,130, 18,130,210, 56, 70, 69,206,172,110,201,147, -148,235,151, 15,200,242,148,113,111,128,105, 27,118,181,224,228,222,109, 22,179, 9,178,173,208,174,225,180,149,248,173, 75,156, -184,130, 44, 47,232,105, 58, 4,111,196,251,226, 60,234,226, 4,231, 47,240, 15, 86,166, 9, 37,228,230, 25, 96, 29, 0,184, 22, -116,110, 28, 24,188, 97,239,190,202, 77,143, 72,224,130,183,124,215, 15,242,241,223,251,115,110,205, 14, 57,111,231, 28, 53,231, -252,213,175,122,130,167,159,250, 58, 6,143, 12,169,143, 23, 20, 91, 3,206,110,157,208,219, 30,114,118,111,134,194,163,139, 49, -109,217,224,129,179, 59, 39,177,161, 49,158,201,221, 51,170,105,195,206,229, 62,231, 15,167, 52,229, 18,211, 64, 89,159,211,239, -109, 19, 18,143,105, 82, 50, 52,211,170, 98,123, 56, 98,186, 92,112, 88,158,162,181,102, 40,135,124,238,214, 45,106, 91, 97,156, - 39, 21, 9, 18, 69,173,102,108,101, 48,200, 10,234, 86, 16, 66, 75,233, 42, 62,117,244, 10, 31,188,241, 12,137,110,104,131,100, - 94,214, 56, 95,225,188,199, 57,199,206, 40,193,186, 28,245,183,255,210,215,252,204,162, 18, 60,114,253, 26,139,255,248, 59, 81, -183, 36, 55,209,194,178, 91, 91,178, 74, 49, 82, 18,149,247, 40, 62,240,221, 72, 5,166,106, 40, 23, 37, 69,166,163, 5,204, 52, -120, 23,189,136,229, 50,134, 26,164,169,194,180, 13,229,188, 65, 6,199,151, 94,184,201,100,126,194,124, 81,241,216,149, 45, 26, - 52,137, 10, 12,123, 41,214, 89, 76,219,178, 40, 75,172,245,164, 90,210,212, 21,129,192,209,201, 57,199, 39,167,156, 78,230,212, -117,131,237,186,221, 94,146, 81, 20, 41, 73,146, 48,155, 87,241, 48, 17,138, 39, 30,127, 27, 95,123,101, 74, 53,159,160, 18,141, - 49,182, 3,100,120, 18,169,129, 8, 98,233, 13, 11,116,150,162,180, 98,107,119,140,173, 13, 4,183, 86,177,122,235,168,170,134, -170, 53,236,142,135,188,108,122, 52,175,188,200,254, 56, 35,221,218, 5,157, 34,211, 40,130,145, 58, 69, 56,135, 72,147,248,128, -106,213,237,144, 54, 44,243,181,149,250, 47,252, 26,225, 27,126,125, 82,174,173, 25,155,216,171,238,207, 88, 85,247,118,125, 28, -202, 52,141, 99, 77,173, 98,168,137,214, 8,165,162,218,182, 91, 95, 72,157,163,242, 28,149,247,144, 89,129,208, 57, 42,235,161, -178, 12, 85,244,144, 89,130,204, 50,242,189,203,208, 91,162,243, 62, 82, 37,148,231,167,204,142, 78,104,141,224,234,179,239,161, -253,236,159,176,245,228,179, 60, 88,156,224,131, 35,205,139,181, 92, 58,120,143,179, 22,211, 26,188,181, 49,238, 52, 75,241, 82, -113,232, 5, 71, 94,112,212,182, 44,171, 6,202,186, 3,241, 24,124,217, 66, 89,225, 23, 75,204,188,194,150, 21,166,170,177, 54, -142, 38,189, 15,145,164,215, 29,160,190,117, 81,120,232, 34,173,206,183, 45,166,137,225, 48, 77, 83,211,180, 13,229,162,162,110, - 3,139,144,114,102,122,204,146, 61,236,240, 6, 77,255, 58,249,206, 21, 6,163, 49,124,228,231,112,229, 2, 33, 37,159,110,119, -185,107, 36,231,149, 97,216, 75, 25, 23, 5, 6,176,166, 65,137,192,172, 52, 52,198,241, 96,186,160,159, 75,206,203,150, 97, 34, -120,104,251, 76,250,151, 80, 59, 7, 12,247, 15, 40,118, 14,112,105, 31,124, 25,105,131, 74, 81,154, 8,225,113,206,113,188,104, -168,235, 26,112,180, 94,196, 73, 89, 85,225, 90,131, 74, 52,141,115, 56,239,177,206,145,136,232,113, 23, 2,254,213, 43,231,108, - 59,203,181, 92, 48,153,204,145, 77,131, 74, 70, 76, 6,239,130, 76,211,207, 5,234,193, 43,204, 95,189,201,222, 78, 31, 39, 98, -104,199,210, 88, 70,189,132,157,235, 87,113,206,144,247,134,216,182,100, 84, 9,210, 55, 61,197,217, 39,255,224, 66, 55,124, 1, - 19,208,121,212,130,124,163,226, 24,177, 81, 22,111, 70,170,155,233,158, 92, 7,187,196,157,122,132,243,109,138, 0,121, 33,126, - 53, 42,221, 87, 20,187, 78,178,177,154, 26,200, 46,211,190,147,195,203,110,207,186, 34,214, 57,227,185,244,253,255, 53,114,235, -145, 77,132, 28, 46, 18,229,108, 75,112, 17,131,108,206,239,119,172, 1,179, 70, 58, 59,223,129,100, 68,138,107,107,130,109, 54, -249,232, 50, 33,152, 26,145,165, 56, 18,100,112,200, 36, 39,136, 52,190,126,237,178,123, 87,193,153,101,231,203,114, 72,153, 18, -130,237, 10, 32, 25,137,131,180,209,117,210, 27, 35,176, 8,157, 33,132, 70, 41, 21, 93, 34,182, 93,127,226, 90,197, 85,135, 76, -114,108, 91, 34,117,134,148, 73, 55, 81,139, 63,180, 46,250, 60,124,238,243,188,118,243, 54,185,148, 36,166, 34,147, 48,206, 52, -173, 74, 49, 73, 70,227, 65,229, 41,174,232,145,246,242, 46,210,214,163,133,196, 58, 67,107, 44,214, 57,182,122, 57,139,186,101, - 86, 26, 90,239, 41,148,234,246,210,130,214,123,164,144,235, 36,181, 94,154, 82, 59,199,181,173, 45, 46,237,109,115,121,119,143, -186,174, 41, 23, 75,250,137,224,193,225, 3,164,173,240,117,137, 12,150, 31,127, 93,115,122,237,125,252,210,115,175,242,233, 42, -227, 63,150,125, 62,153,188, 27,245,117, 63,200,213,171, 87, 72,207, 94,195,153, 6,169, 58,150,196, 58,229,175, 59,243,214,186, -142, 77, 96,203,234, 57,187,152,126,204, 27, 58,249,141, 77,147, 55, 80,254,193,155,150,226,209,255,132, 90,204,184,121,243,136, -211,102,198,237,197,109,138, 12,222,251,212, 7, 25, 28, 36, 52,115, 79,177,155,178, 60, 51, 4, 4, 59,215,182, 57,186,125,206, - 96,212,199,122, 34,188,171, 42,153,206,166,184, 54,242,244,241,150,195, 87, 79,169,103, 19, 78,167,150,203, 55,118,121,120,103, - 74, 93, 55, 36,233,128, 23, 95,252, 10, 79, 60,253, 56,205,185,229,108, 57, 99,156, 15, 99,192, 89, 88,242,200,165,235,220, 63, -190,135, 84,146, 94,210,103, 60, 54, 32, 13,109,153,240,112, 81, 98,252,130,214, 90,230,126,137,113, 13,123,201,136, 63,190,247, - 89,222,123,227,113,116,175, 36, 75, 82,164,149, 28,213, 83, 70,253, 12,229, 21, 65, 10,244,116,214,146,168, 1, 3,225, 56,234, -240,132, 17, 88,214, 57, 63, 93, 88, 87,213,161,203,210, 32, 8,130,105, 48,174,193,187,128,116, 13,190,245, 72, 37, 56, 63, 47, -201,147, 4,111, 27,132, 72,112,120,202,101,141, 18,129,162, 16, 72,235,185,180,119,137,147,217, 67, 78,230, 19, 62,254,153, 47, -240,174,119, 62,139, 27,142, 73,116,228,110,151,203,134,135,103, 15,233,247,115,118, 6, 79, 51,236,231, 92, 26,123,142, 31, 88, -110,222,126, 29,231, 12,123, 59, 59,104, 45, 24, 37, 57, 50,192,178,170,105, 77,203,206, 96, 64,217, 54, 56,235,216, 26,141, 81, -245, 41,214, 6, 92, 89, 33, 21, 36, 42,141,135,166,243, 40, 33,113,222,144,102,105, 20,183,185,120,234,244,250, 57,203,133, 71, -203,248, 51,229,121, 18, 15, 43, 45, 80, 42, 35,203, 18,142,147, 39,249,215,159,185,199,123, 71,175,243,142, 15,126, 3, 77,136, - 36, 40, 79, 64,104, 29, 47,180,174, 26, 13,193, 35,186,177,242,186, 67,239, 50,187, 67, 88,203,142,187, 17, 28, 93, 36,104,231, -175, 20,157,194, 59,200, 11,123, 76, 25, 47,244, 78,200, 39,147,206,244,219,157,190,241, 32,140,204,119,149,234, 40,130,241, 14, - 57, 72,215, 23,184, 72,122,136, 36, 69, 8, 69,208, 18,157,166,208, 90,148, 78,208,143,143,105,103,119, 73, 6, 67,204,226,156, -242,228, 60, 94, 66, 34, 37,201, 60,166,172,217, 30,140,104,108, 69, 90,228,241,133, 83, 42, 10,240, 66,136,135,120,183,171,246, - 54, 80,154, 42,118,186,189, 30,105,150, 17, 4, 76,155,134, 7,214, 96, 91,139,181, 54, 82,247, 86,214,191,224, 80, 38, 96,189, - 37,235,148, 82,158,200,236, 49, 54, 90,213, 26,239, 16, 74,241,224,100, 74, 16,146, 36, 73,232,247,122,228,249,128,241,246, 22, - 89, 86,144, 13, 51,116,150,199,145,124,211,224,109, 75,189,156,129,159,211, 79, 46,113,245,209, 3,142, 78,239,175,115,194, 79, -157, 96,214, 24,108,240, 44, 90,199,163,185,100,177,104, 48, 33, 80, 54,150,121,211, 98, 61,236,245, 84,180,221, 40,193,188,170, -185,178, 51,224,213,135,231, 17,170,209, 56,106, 83,209, 19, 18,211, 41,126,155,170, 98,119, 60,192,250, 16,191,127, 31,153, 3, -189, 44, 97,178, 44,169,154,134, 97, 47, 99, 54,175, 81, 93,144,142, 39,238, 25,165, 16, 36, 90,225,101,206, 46, 13,191,126,175, -226, 87,239,182,188,237,177,183,243,206,242,237,124,239,232,221,188,107,208, 99,250, 48,176, 55,114,188,231, 7,254, 22,191,254, -139,191,194, 83,143, 95, 38, 87,130, 69,235, 41, 50, 73,235, 3,237,217, 4,185,181,141, 55, 53,121, 49, 98,246,240,117,182,191, -241, 91,215,145,226, 43,121,236, 74,154, 37, 9, 81,236,230, 55, 89,234,161, 27, 24, 17, 88,143,192,161,139, 73,125, 67,199,221, -125, 77, 71, 94, 93, 9,157,112, 27, 15,188,179, 43,164, 67,247,111,100, 71,160,115, 29, 23,220,117, 86, 38,221,237,209, 59,177, -221,138, 50, 87, 72,133,126,236, 27, 35,190,149,110,241,238,234,120, 72,137, 40, 84,116,117, 25, 57, 11,222,227,219, 6,239, 74, -208, 69, 20,197, 89,129, 16, 45, 36, 57,222,182, 8,215,196,224,148,224, 17,197, 0,223,148,247, 51, 43,242, 0, 0, 32, 0, 73, - 68, 65, 84,184,242,148,116,235, 10, 33,180,216,118,142, 84, 41, 62,221, 38,132, 25, 82,121,172,139, 50,110,153, 22, 88, 27, 45, -105, 73, 86, 68,133,123,150, 35,149, 70,137, 64,168, 78,113, 89, 31,105, 82,146,241,238,106, 46,140,171,107, 2, 14,149, 36, 56, - 99,144, 42,190, 31, 42,237,227,157, 67, 40, 73,154,102, 52,139, 9,249,246, 85,156,109,217,127,228, 17,158,152,206, 72, 8,140, - 15,182,233,185,154,122,182, 64,236, 29, 32,181, 68, 38, 45, 82,100, 40,233, 49,141, 69,106, 69,150,166,216,214,144,231, 57,214, -149,140, 6, 57, 0,195, 34, 37, 79, 27,218,218,147, 36,146,212, 10, 22,181,237, 68,147, 33, 34,160,133,102,105, 29,151,135,125, -188,132,189,237, 45, 22,229,146,170,110, 24, 13, 10, 22,101, 69,176, 6,235,106, 82,111,184, 53, 47, 57,216,186,194,107, 15, 95, -227,210,246, 22, 94, 8,166,243,134,171,201,156,201,228, 30,175,125,213, 95,226,224,253,127,147,131,234, 62,254, 87,126, 20, 95, - 70, 43,175, 87,155, 0,107,181,138,243, 85,241, 25,243,221,243,176,210,117,117, 91,181,232,172, 88,101,168,175,116, 29, 29,230, - 0, 54, 52, 68,128,147,251, 47,210, 75,251,204,219, 25,231,237, 49,253, 20, 62,117,251, 14, 73,154,115,242,202, 9,229,178,198, -222, 94,144,102, 61,170,243, 5,253,113,138, 41, 45,173,141,152,218,186,154,147, 13,135,200,153,141,128,154,126, 74,222,207,176, -117,203,241,137, 97,188, 3, 89,161,169,235, 6, 23, 2, 85,117, 15,242, 25, 7, 55,182,121,249,139,175, 49,220,234, 38,182, 54, - 80,132,148,179,163, 51,198,217, 8,227, 13,105, 97, 57,159, 52,188, 50,189, 75, 95,231,221, 61,144,179,176,199, 16, 2, 89,103, -191,148, 8,126,254,147,127,192, 15, 62,249, 14, 92, 49,164, 63,204,176, 19, 75,226, 37, 58,111,169, 93,133, 92,204, 61, 87,175, - 94,142,177,128, 62,172, 43, 35, 79, 84, 34,226,227,235,232,217,188,192,182,106,209,161,197,148,115,218,229, 2,223,214,180,203, - 37,245,178, 36, 81,130,197, 98,193,217,241, 57,229,124, 78, 51,155, 50, 59,159,112,118,116,138,173, 43,122, 3,133, 78, 36, 46, - 8, 70,189, 49,139,102,193,195,163,135, 24, 91,161, 92, 67,226, 13, 73, 48,236, 14, 50,180,111,185,125,239, 22,141,131,198, 6, -230,243, 57,119,239,223,225,149,215,239,112,248,240, 1,173,169,113,109,195,178, 42,241, 30,170,170,142, 10,251,172,199,193,214, - 22,166,154, 83, 87, 83, 26, 99,162, 32, 86, 38,212, 85,221,165, 42,123,132,247,104, 41,177,101,220,141,123, 23,131, 63, 84,166, - 73, 19,137,116, 1,213,212, 76,143, 30, 16,130, 97,123,220,163, 63,140,213,122, 46, 96,103,103,135,127,123,162,249,135,191,244, -239,104,207,207, 80,213, 18, 83,198, 46,211,151, 21,174,110,240, 77, 25, 33, 51,166,137,159,177, 53,113,234,225,221, 26,186, 18, -130,141,170,109,225, 34,237, 35,152,168, 8, 55,209,238,230, 59,193,215, 74, 80,227,227, 15, 19,147,151, 86, 12,235,176,202, 48, -234,192, 46,214,118,116, 58,139,112, 29, 84, 69,201, 40,138, 75,179,216,149,167, 9, 34, 85,200, 52,235,210,202, 60,140,118,241, -237, 9, 58, 31, 18,116,130,171, 27,170,178,100,114,116,202,240,224, 50,110, 94, 17, 92, 75, 50, 24, 32, 80,104, 17,255, 92,209, -141, 70,181,142, 68, 44, 73,180,218,101,121,198,176,200,233, 23, 61,180, 78, 16, 50,238, 18,211, 36, 97,212, 43, 24,101, 5,227, - 44,103,216, 43,200,211,156, 36,207, 72,210, 2,122, 61,100,111, 64,157,166,204,132, 98,142,230,220,195, 92, 72, 74,169,112, 73, - 74, 29, 36, 73,158, 51, 30,244,217, 25, 13, 41,210,132, 97, 47, 69, 5, 79, 38, 2, 50,196,110, 77,117, 46, 10, 99, 13,214, 59, - 72, 53,143, 60,253, 12, 39,255,207, 79,111,212, 53, 14, 94, 93,198,150, 96,148,165,236,244, 51, 22,214, 97, 45, 28,140,251,180, -222, 50,200, 64, 97, 72,117, 39,152, 34,208, 6,207,253,233, 18, 27, 98, 1, 44,148,192, 7, 73,109, 28,198, 58,164,138, 97, 20, - 15,206, 23,204,150, 53,247, 39, 11, 4, 80,213, 45,121, 10, 34,120, 50, 25,152,151, 45,222,199, 95,173,139, 41, 99, 85, 19, 45, -166,169, 12, 36, 26,178, 44,101,183,223,231,201,203, 7, 92, 57,184,206,179,111,126, 20, 77,203,235,183, 94, 96,123, 63, 22,131, -249,104,136,150,241,125,177, 74, 83,187,184,110,162,137, 34, 68,109, 90,196,108, 25,169,138,211,179,117, 11,190,233,132,226,169, - 24,121,241, 93,112,198,106,148,228, 55,221,117,108,199,195,218,246, 42, 69,167, 66, 38, 82,201, 86,255, 62,178,223, 87,161, 49, -241,207,117, 62, 96, 93, 39, 17, 13,235,236,211, 78, 4, 25, 57, 13,126,101,175, 19, 81,103, 17,124,216, 32, 90, 93,252,126,228, -155,158,236,226, 98, 67,135,134,237,146,100,124,244,158, 7, 27, 34, 18, 54,184, 8,143, 81, 9, 65,198,110,117,125,209,119,153, - 0,222, 11,130, 76,241,214,116,172,121,139, 72, 83,100,222,195, 46,142,240, 62, 38,199, 5,211, 32,180, 66, 39, 25, 42, 43, 80, -163, 43,136,172,223,217,125, 91,148,146,216,118, 9,193,162,147, 20,213,137,225,100,214, 71, 9,221, 5,192, 52, 17, 56,213,133, -184,168, 52,141, 66,217, 21, 6,205, 26,112,241,172,176,203, 57,109, 27,227, 93, 77, 83, 33,165,230,242,179, 95, 75,154,231,164, - 69, 15,223, 84, 24, 47,145,131, 62, 6,143,151,113,218,166,139, 4,107, 3, 58,145,100, 74,147, 20, 25, 50,209, 36, 66,146,106, -141,240,129,202, 88,182,199, 57,125, 45, 73, 84,108, 50, 90, 23, 97, 77,161, 91,145,212,214, 83,228,241, 29,159, 52, 13,251,195, - 62,101,185,196, 89,203,217,217, 41, 47,223,188,201,225,195, 67, 44,240, 66,155,242, 41,125,192,115, 97, 72, 82,244,240,182,101, -217, 90,174, 95,122,148,191,243,131,255, 57, 31,122,255,187,105,219, 7,252,155, 95,251,121, 94,251,226, 71, 25, 61,253, 46, 30, -251, 87,183,216,255,142,255,178,203,213,232, 2,249,194, 10, 74, 20,159, 7,239, 46,192,149,214,248,237, 40,178,147,157,206, 70, -174,126,211,211,221, 91,221, 63,186,168,241,192, 67, 17,224,225,217,109,238,213, 39,212,182,162, 52,129,134, 22,233, 28,166,106, -192, 10,150,243, 18,231, 2, 58,113,188,250,133, 91,232,190,198, 54, 21, 65,105,182,119, 47,225,132, 39,235,165, 20, 59,125, 46, - 63, 49,192,122,131,151, 45,198, 85,152,202, 50, 63,157,147, 10, 77, 47, 41, 72,208, 96, 83,190,244,209,231,177, 1,202,202,114, - 58, 59,198, 73, 71,170, 52,165, 45,217, 29,142, 72,180, 64,120, 79,109, 29,200,192, 40, 41,200,165,164,177, 53, 90, 10,122,170, - 96, 91,141,113,222,160,132,166, 39, 83,126,249,149, 47, 49, 59,187,141, 43, 53,151,178, 62, 30,207,237,147, 25,214,120,244,123, -158,185, 66, 93,157, 80, 77, 35, 13,201,251,139,139,138,104,117, 16,254, 66,208,130, 13, 56, 23,225, 39, 13,146,224, 28, 77,105, - 65, 75,172, 9,104,237,169,102, 11, 38,115,195,246,184,136,197,119, 34,105,235, 6,133, 36, 17,150, 39,246, 6,188,210, 31, 80, - 55, 13,211,122, 70,145, 73,238,220,127, 64, 89, 90,118,119,182,200,100,224,225,201,156,170,109, 56, 63,159,176,191,179,199,194, - 72,250,233,144,183, 92,123, 27,127,237, 59,159,229, 67,207,126, 3, 39,159,253, 18, 63,242,255,254, 22, 87,182,182, 56,158, 85, -108, 13,135, 36,170, 71,158,102,120, 59,167,169, 39, 8,191, 77,161, 53, 66,203,184,119,207,211,136,146, 69,161, 19,213, 85,124, - 54,174, 12, 82,133,109, 29, 74, 18,247,243, 89,130,240,150, 94,162,233, 15, 10,122, 91, 91,209, 71,218, 90,166,211, 10,173, 5, - 7, 69, 66,165, 15,248,199,127,240, 18, 31,120,116,155,111,121,207,147, 44,230, 77, 4,211, 52, 13, 65,107, 68,154,197, 29,120, -199,179, 22,184,181,181, 35,194, 80, 86, 97, 19, 29, 60,197,118,225, 21, 62, 42,226,227, 94, 49, 30, 86, 2,191,169, 64,137,151, -130, 76,244, 58,213, 73,172,128, 51, 62, 30,116,206, 6,164,202,214, 28,120,180,138,153,239, 73, 26, 5,102, 73, 26,173, 31,206, -160, 84, 14,201,156, 80, 5,228,120, 4,120,166, 15,238,115,247,245, 91,204, 22, 21,143, 14, 71, 52,119, 95,142, 64,136,225, 8, -111, 13, 94, 4,130, 9, 72,169,163,239,182,139,139, 12, 42, 65, 75,135,215, 62,174, 73, 8,104, 37,144,137,234,152, 2, 81,224, -166,210,206,179,228, 37, 74,122,188,181, 52,157,183, 94,152, 54, 98, 91, 69,192, 6, 79, 47, 79, 49,198, 69, 88, 79,136, 28,209, -188,139,150,157,207,151, 20,189, 30,117,213,146, 36, 5,222, 89, 84, 58, 32,120, 67, 99, 97,177,168, 98,236,170,173,184,118,112, -149,244,240, 11,204,108,220,225, 11, 21,187, 78,165, 36, 34, 64,191,167, 73,181,162,109, 91,180,140,105, 85,169, 18,216, 46, 26, -246,124, 58,101,145,101, 92, 30,245, 73,180,192,181,134,198, 58,132,116, 32, 20,153,214, 44,219, 22,213,229, 71,183, 46, 78, 90, - 38,139, 37,227, 34, 37,201, 18,188, 77, 56, 58, 43, 17, 34,224,133, 68,227,105,101,212, 19, 96, 34,139, 58,116,226,174, 32, 32, - 87, 81, 39,210, 56, 79, 89, 87, 40,233, 41,219,138,207,189,240, 50, 95,247,181,239,102,119, 91, 16, 51, 72, 4,147,202, 49,170, - 91, 26,239,184, 60,200,121,252,250, 21,150,213,140,166, 49, 32, 43, 20,130,162,183,141,176, 96,103,103,172, 6, 65,114,227,170, -140,173,143,164, 11,215, 8,235, 36,179, 85, 42, 91,116,193,108,162, 89,141,139,161, 47,206,121,212, 74,177, 46, 66,215,241,117, -153,237, 68,214,247, 90,188, 4,107, 5,115,236,176, 68,215,137,123,240, 2,161,233,222, 5, 8,210,175,133,118, 8,129, 84, 80, -188,229,131,113, 34,133,136,246,175,238,155, 14,182, 2, 31,112,245,140, 96, 27, 68,210,239, 50, 22, 0, 85,196, 8,213,164, 7, -194, 98,171, 9, 42, 31, 19,154, 37,198, 59,146,254, 22,222, 84,177,104, 70,162,242, 33,118,233,177,205, 98, 61,221,178,203, 83, -164, 78, 99,102,186,155, 33,147, 12, 97, 61, 42,235, 35,243, 17,162,173,145,201, 16,225,107,132,140,138,124,215,212,232,188,192, -155, 58,126, 70,105,130, 74,123, 29,115, 33,218, 96,157,235,242,211,139, 30, 50, 40,156,171,226,249, 80,149, 81,204, 90,196,103, -126,251,250, 13,250,253, 62,229,217, 9,106,184,205,150,136,252, 10,215, 90,194, 48, 1,171,176,203, 5,249,112, 72,179, 88,224, -140, 69,167, 10,159,106,240,129,204,107,236, 32,199,206, 43, 16,146, 68, 75, 6,137,194, 7,176,193,163, 36,180, 94,144,105, 21, - 39, 84,203,134, 31,254,208,123,185, 90, 12,232, 63,243,205,244,190,234,155, 24,188,233, 45,140,242, 5, 31,253,237, 63,228,165, - 47, 60, 79, 49,251, 83,252,103, 62,206, 91,191,233,219,249,199,191,252, 57, 30,251,250, 39,241,211,146,175,125,251, 59,120,242, -205,143,241,155,255,246, 55,249,226, 75, 47,172,197,145, 31,251,210,167,248, 7, 63,247,223,242, 11,255,224,151,248,254,159,250, -135,236,190,229, 77, 60,255,143,126, 50, 78,106,226, 53,211,105,158,162,214, 64,117,147, 28, 65, 44,156,157,141, 64, 35,239,197, -154, 60,185,202, 41, 80, 43,234,156,239,136,168, 68,171,228,233, 75,159,160, 85, 79,145, 37,146,198, 75, 90,107,249, 96, 95, 80, - 54, 83,130, 22,108,239, 15,121,248,106,137, 23, 21,103,199,135,228,197, 21,210, 94,138,144,142,249,116,138, 36,103,113,188, 96, -247,202, 1,167,183, 31,160,243, 17,242,255,231,234,189,163,109, 79,207,250,190,207, 91,126,109,183,211,239,185,117,238,189, 51, -163,233, 51, 26,212, 53, 52, 33, 36,138,132, 36,140, 5, 54, 77,150,192, 33,203, 88,113,192,198, 1,199,216, 75,134,100,101,145, - 64,176,157,229,144, 4, 34,123, 17, 69,150,196,162,153, 80, 12, 26, 6,132,122, 27,205, 72, 26,141,238,244,219, 78, 63,187,255, -234, 91,242,199,251,219,251, 92,249,175,185,107,214,217,229,156,189,223,242, 60,207,247,251,249,250,138,184,215,161,168,142, 89, -223,234, 49, 25, 21,164,253,140, 36,141,131, 61,219,172,179, 55, 62, 98, 99, 43,163,155,109,114,120,189,228,230,244, 58, 86,192, -185,141,140,105, 94, 51, 49, 83,214,163, 45,106,115, 76, 87,118,217, 92, 75, 24,206, 37, 55,199, 99,182,178, 53, 74,142,200,115, -133, 50, 10,141, 66, 74,129,242, 13,191,127,253, 37,190,255,108,143,210,166,236,150,199,120, 28,195, 60, 71,253,200,107,238,123, -223,249,123, 95,193, 71,126,255,143,185,231, 91,190,153, 52,233, 82,238,220, 96,145,251,176, 88,196,214, 5, 79,225,162,191,150, -221,118, 23,182, 55, 96, 62,203,151, 60,226,170,174,153,207, 10,234, 58, 8,197, 70,163, 25, 85,211, 16,139, 96, 33,202,167, 19, -226, 88, 34,140,225,133,157, 17,135,163, 33,214, 22,148, 69,195,198,250,106, 72,230,169, 29, 89,183, 67, 55, 85, 40, 4, 55,246, -199, 20,211, 35,238,188,237, 28,214, 11,126,238,189, 63,194,111,253,222,127,230,155, 38, 79,226,199, 35,190, 52,115, 68, 73, 68, - 95, 74,162,120,133,243,219,103,216,219,127,158,155,187, 59,188,233,161,219,184,180,149,208, 84, 77,107, 7,243,196,113, 28, 18, -123,218,185,160, 74, 51,226, 78, 6,214,145,245, 59, 20,211,130, 52, 14,126,236,166,169, 1, 79, 36, 21,107,219,167,200, 58, 25, - 74,235,176, 41,217,160,200,143, 84,216, 96, 86,178,132, 43,251, 19, 62,243,236, 53, 94,121, 97,157, 88, 42,154, 22,139,234,155, -128,127, 93, 84, 50,193,146,213,210,230,104,121,206, 33,235, 48,180,222, 23, 10, 16, 33,218, 3, 63,248, 48,195,198, 42, 78,188, - 29,173,133, 38, 56, 64,218, 11,128, 12, 63,227,101, 11,124,104,161, 54, 42,138, 81,105, 55,196, 69, 70, 17,190, 14,184, 75, 33, -130,210, 94,159,190,192,149,199,126,143,205, 59,239, 8,208,151,104,149,233,179,143,243,197, 71,255,134,253,157,125, 86, 55, 79, - 81,161,216, 62,120,150,106, 58,103,229,225,111,230,202, 19, 31, 67,122, 25,124,222,214,130, 8,118, 49, 33,130,247, 91, 74,129, - 51, 22, 87,215, 97,227, 86, 10,165,212,137,118,160,229, 61, 10, 21, 54,101,215,138, 5, 5, 46,184, 24,156, 11, 7,105,219,120, - 50,173,191,223,218, 32,246,168,139,154,198, 89,148,104,173,124,132,131,175,155,118,209,145, 14,227, 13,235,152,141, 39, 88, 17, -161,101, 67,217,120,238,188,116,145,226,209,127,183,204, 0, 89,200,190, 63,157,119, 41, 92,192,225,198, 58,194, 32,216, 90,233, -128, 16, 28,207, 43,202,186,161,170, 27,166, 69, 67, 39, 22,116,210, 24,213,182,184,105,115, 11,180, 12,235,228, 56,175, 16,210, - 97,105,187, 41, 82, 96, 77, 0,231,148, 85, 67, 28, 9,134,147, 57,117,109,201,210,136,105, 94,147,166,113, 91,221, 7,181,126, -164, 61,214, 4,134,132,117, 80, 91,135,144, 17,157,238,128, 78,255, 52, 38, 74,121,237,195, 15,242,186, 71, 94,137,238,137,101, -180,231,103,254,253,127, 64,100, 9, 85,101,217, 74, 18,198, 47,222, 32,202, 18,214,182,214,137, 59, 25,145, 78, 24,156, 57,139, -144, 3, 14, 62,249,251,228, 47, 62, 29,198,231,126,209,169,243, 45,223,253, 86, 59,218,201, 1,190, 32,144, 45, 4, 74,110, 1, -106, 21, 33,107,125,145,216,118, 98, 51,106,187, 1,174,181,201,202, 19,171,219,173,204,152,133,250,201,187,214,126, 79, 8,226, - 88,206, 73, 23, 78,183,246, 77,157,251,169,223, 68,101, 29,160, 90,120, 29,192, 22, 97,140, 80,230,120, 23,232,142,193, 11, 30, - 98, 61,141, 13, 85,184, 51, 53, 94,234, 48,211,110, 67, 76,164,140,218, 10,191, 65, 39,157,208, 69,104, 19,220,108, 57, 15, 20, - 69,239,113,166, 14,243,238,184,139, 74, 58,224, 45, 42,235,163,146, 46,190, 46,113,213, 28,153,246, 81, 81,140, 80,129,201, 32, -163, 24,111,218, 11,164,210, 33,186,151,150,107,186, 60,234,194, 60,221, 85,161,179, 87,205,231,164,171,107,225,162,222, 90, 67, -165,140, 41,143,118,185,250,133,207,145,246,187, 12, 86, 58, 36, 77, 78, 61,158, 66,154,208,168,164,237,200, 69, 84,147, 17,200, -160, 37, 40,243, 28,107,108,208, 68,169,136,217,108,142, 80,130,227, 97,206,254,180,164,104, 44,227,198,161, 60,204, 77,232,182, - 92,157,148,124,255,203, 95,198, 47,253,236,223,231,204,229,115,244, 78,245,233,187, 25,189,181,237,144, 41,145,118, 57,255,192, -253,148,118,157,175,154,187,249,133,223,252, 85,158,250,179,255,200,199,175, 92, 35,234,111,115,122,125,192,197, 11,219,252,251, - 15,252, 54, 87,119,119,120, 56,129, 95,124,215, 15,240, 19,111,121, 19,111,190,231,110,222,240,240, 55,241, 51,191,254, 75, 12, -138,211, 60,242, 15,255, 62,199,127,242, 33,236,116,132,211, 41, 19, 43,145,221, 77, 68,127,149,104,176,134,140, 50,180, 56,217, - 75,164, 4, 39,195,231,177,152,167,187,246, 59,215, 78, 57,151, 26, 15,215, 90,179,227, 44,227,249,188,203,141,201, 49,147,106, -130,244,240,217,241,140,159,252,182,119,162, 59,138,114, 18, 48,231,197,116,198,225,141,125, 54, 46,220, 17,236,182,190,102,239, -197,125,138, 73,205,233,151,157,163,154,143,105, 74,112,214, 50, 63,170, 41,103,115,154,218,146, 37,146,209, 40,199, 56, 67,212, -173, 88, 57,221,103, 58, 44,152, 53,115,142, 39, 71,232,184, 97,125,181,203,209,209, 52, 0,214,148,224,112, 56, 38,149, 41,185, -153, 51,175, 10,188,132,105, 94, 50,107,230, 40,233,113, 54,103, 99,160,217,159, 21,104, 41,233,169, 14,145,212,228,182, 96, 16, -117,185,153, 15,121,248,212, 25,178, 56,226, 32,159,210,137,186,168, 55,221,126,238,125,174, 46,120, 97,127,204,248,224, 69, 46, -189,234, 17,206,124,235, 27, 25,126,254, 19, 75,244, 99, 16,105,251,165,104, 78, 8, 69,241,245, 39,233,190,230, 13, 24,211,112, - 52,156,129,169,153,142, 70, 8,225, 49, 77, 69, 83,228, 84,166, 14,115,189,178,162,105,185,230,145,244,104, 28,197,172,226,165, -195, 99,106, 87,163,132, 39,209,146,218, 40,234,150, 46,213,237,246, 24,116, 52,231,183, 6, 88, 15, 23,182, 86,233,247, 87,248, -127,255,224,143,113, 54,226,251,238, 76,201,213, 38,127,120,229, 42,167,251, 61, 78,109,223,197,122, 55,229,139, 95,249, 24,243, -188, 96, 86,195,187,223,244, 32,216,138, 56, 77,240,214, 34,125,136, 29,148, 90,225, 81,161, 58,147, 2, 37, 2, 85,205, 55,205, - 9,208,196,154,224, 41,183, 22, 25, 69, 36,105,140,142,117,104,103,251, 80,213, 89,107,169,202,138, 44,214,104, 37,232,102, 17, - 90, 40,254,244,203, 47, 48,159,140,184,107,107, 21, 97, 29, 85, 93, 35, 90,127,186,179, 46, 96, 93, 9, 33, 39,190, 54,173, 27, - 52, 28,232,139,252,230,101,182,117,171, 6, 62,249,127,183,228, 63, 47,212, 75,250,132,133,238,252, 2, 51,219, 94, 18, 92,192, -101, 10,165,145, 73,134, 87, 42, 36,164, 89, 27,126, 77,219,144, 14,182,120,236,253,255, 35,119,127,215, 59, 16,211, 67,228,202, - 25,134, 95,251, 52,143,126,228,119,152,142, 39,164, 27,235, 68,120,238,180,115,200, 71,100,167,206,115,100,114,246,110, 60,191, - 96,195, 45,161, 16, 74,170,192, 53, 80,234, 4, 32, 35,101, 72, 96, 16, 96, 93, 16,189,185,150, 32,225, 8,213,185,183, 38,100, -196,183, 65, 47,150,144,197,238,188,167,105, 76,120,140,181, 84, 38, 76,207,188, 49, 88,235,136,180, 38,210,154, 88, 74,250,189, - 46,113,156,128, 12,177,153, 42, 74,201,243, 41,181, 75, 16,190, 6,229,233,102, 43,156,250,234, 7,151,153,237,162,189, 0, 73, - 4, 95,168,186, 68,177, 34,141, 99,146, 52, 65, 32,233, 38, 17,147,178,166,106, 44,243,170,164,106, 12,131, 94,196,120,150,115, -122,173,135,245, 65, 49,156, 69,138,218, 6,134, 66,109, 12, 71,227, 25, 66,122,180,146,212,214,161,112,140,166, 5,117,211,208, - 56,193,112, 94, 5, 58,161, 16, 20, 77,192, 25,143,242, 50, 84,163,222, 17,171,182,234, 21, 22, 41, 66, 11, 82, 43, 69,164, 99, -210, 56,230,226,109,247,242,154,123,239,230,155,191,249,155,168,237, 58, 46,246,244, 50,197,181,199, 63,197,199,127,247,247, 25, -244, 58, 36,145,100, 99, 53,101,109,125,133,149,211,171,168, 52, 37,234,116, 24,108,159,163,185,122,147,245,135, 31,225,197, 15, -255, 90, 8,222,241, 39,234,115,207,201,124,124,105, 87,111, 55, 78,213,206, 56,151,131,247, 91, 84,242,139,246,209,146, 39, 47, -110, 9,108, 89,122,212,197, 82,211,230,220,201,236, 29,119, 98, 85, 10,250, 21,185,212,149, 44,159, 79,158, 68,178,166,183,221, -203,230, 91,222,139,247, 21, 66, 54,225, 65,205, 60, 8, 47,188,199,206,143,176,229, 28, 84,132, 41,167, 88, 17,227,209,152, 98, - 26,116, 36,237,172, 56,140,182, 60,194, 24,108, 51, 71,182,226, 80,231, 5,182,152, 34,210, 62,206,217, 16,181, 44,131,216, 52, -140,207,154,246,119, 48, 64, 72,192,179,249,184,205, 99, 23, 1, 69,107, 27,188,241,168,172, 27,132,118,117, 56,236, 93,157,163, -180, 38,234,172,181, 74,254, 22,243,210, 94,106, 93, 93, 6,199,135,115,184,186, 65,170, 96, 65,179,141, 65,202, 8,213,233, 51, -190,126,149,249,222, 14, 73,164, 88,205, 34,142,142, 38, 88,231,240, 73,140, 21, 65, 32, 43,226, 8, 83,228, 1, 3,140,162,152, -151, 52,117,141,241,130,170, 8,130,185,107,135,115, 26,227,152, 52, 1,207, 52, 51,158,198, 57, 70,149,225,189,111,120, 57, 63, -250, 67,111,161,194, 18,109,172, 19,111,174,211, 23, 2, 81,121,234,222,105,108,146, 81,140,103, 36,253, 46, 95,252,248,231,249, -194,147, 47,241,190,255,243,127,225,255,122,255, 31, 82,151, 51,162, 40,226, 19,159,253, 20,227,217,132,135, 98,120,160,175,248, -129,127,252,223,146,245,186, 88,111, 73,226,132,191,253,154,111,231, 31,253,175,191,200,219,223,246,115, 52,175,251, 59,252,235, -191,249, 42,143,201,203, 92, 63,243, 58,110,158,122,144,228,117,111, 99,124,231,183, 83,220,255,189,196,223,241,110,146,239,124, - 15,219,111,125, 55,151, 94,245, 32,243,171,207, 81,143,143,195, 87,183, 29,251,217,197,197,180, 29, 25, 59,183,200, 49, 17, 20, -243, 9,205,153,251,248,252,139,207, 98,125, 77,225, 12,195, 58,231,159,252,224, 79, 81,152, 9,147,195, 9,105,111, 64, 81,228, -140,134, 53, 23,239,187, 64,103,144,113,227,217,107, 36, 73, 15, 83, 87, 8, 41, 48,141, 64,198, 21,213,204, 82, 86,193, 45,166, - 35, 73,149, 19, 46,228,221,156,106, 46, 64,151,156,189,184, 65, 49, 44, 57,152, 77,169, 42,195,254, 81, 65,156,120,122, 93,201, - 60,175, 24, 87, 35,114, 59,195,217, 0, 6,234,233,140,185, 41,168, 76,206,164,153,144, 27,203,184, 10, 99,195,126, 20,147,196, - 53, 17, 17,185,105, 16,194, 82, 88,199,188, 46,176, 70,209,209, 9, 26,133,250,103,111,251,214,247,117,210,136, 59,183, 79,241, -174,223,250, 67,222,253,234,203,168,222, 38, 81,183,199,228,249,103,151,184,190,112,249, 22,139,152, 7, 92, 83, 33, 46,221, 75, - 35, 4,179,233,140,107,251,199, 84,101,193,100, 50,103,158,231, 76, 11,139, 20,142,209,116, 78,130,225,104, 92, 32,176, 8,227, -208, 26,102,147,156,235,251, 67,202,166,194,121, 71,162, 20, 90, 69,196,145,103, 54, 47,169,139, 25,251,195, 34,204,191,149,226, -185,221, 3, 14, 14,247,184,182, 55,230,238, 45,197,221,162, 32,142, 50,190, 56,209,156, 93, 91,227,218,181, 23,120,235,229, 57, - 31,121,252, 37, 54,186, 25,149, 79,121,251,195,103,218, 69, 39, 72, 98,133,179, 54, 16, 92,101,219,106, 93, 38,249,132,148, 40, -211, 24,210, 88, 82, 22, 13, 90, 9,162, 56,180,196,180, 86,232, 54, 54, 81,181, 1, 13,182,169, 3,143,186, 53, 93,174,246, 59, -164, 81, 68,150,104, 86, 59, 49,187,227, 57,143, 61,253, 18, 85, 62,229,142,205,117,164, 16, 84,141,129,198, 4, 30,181,255, 47, - 50,129,157, 91, 76,196,195, 38,103, 93,251, 51,139, 42, 93,158,248,206,111,145,205, 47,218,152,190, 13,185, 94, 86,234,237,220, -222, 57, 31,252,224, 81, 22, 20,192, 77, 0,192, 56, 4,206,212,100,253, 77,254,226, 35,255,134,249,108,194, 67,223,241,157, 28, - 61,243, 20,227,171, 79,243,169, 71, 63,202,202,218, 26, 27, 90,114,103, 49,229,188,111,200,203,156, 81,212,229,154, 45, 57,218, -127, 17,165, 99,124, 85, 47,227, 32,105, 69,150,194,133,249,160,104,189,241, 75, 37,150, 95, 80,226, 92,107, 77,241,237, 97,221, - 6,187, 88, 75,211, 82,174,156,117,216,198,224,108,136,106,245,132, 46, 0, 62, 8, 55,235,170, 94,130, 41,180,146,116,123, 61, -210, 52, 13, 33, 42, 77, 73,146,246,169,138, 60, 8,236, 26, 3,190, 2,169,121, 88, 30, 97,142,174,134,185,112,139, 26, 93,180, -116,159,168, 58, 20, 78, 44, 85,227,162, 85, 67,119, 99, 77, 85,215,212,117,197,112, 90, 48,203,131,240,175,159, 42,164,212, 24, -227,104, 92,176,231, 88, 23,230, 98,147,217, 60, 84, 22, 66, 98,172,195,184,112, 80, 5,176, 78,176,223, 41, 37,168,141,193, 25, - 19, 14,126, 41, 72,212,162,178,149,232, 72, 18,169, 40,104, 56,210, 40, 40,166, 93,195,109,231,239,225, 91, 94,251, 8,119,220, -117, 23, 62, 78,192, 23,172,159, 89, 33,139, 4,127,240, 47,127,158,114,116,136, 23,130,245, 52, 37,182, 6,210,136,222,198,128, -206,202, 42,235,235,235, 36,221, 21,188, 17, 36,151,207,178,255,167, 31,110,233,109, 39,213,242,146,242, 38, 8,109,240,150,236, -198, 45, 21,208,146,180,235, 69,216, 35, 90, 40,149,184,197,106,180,224,138, 47,158,191,237, 52, 47,193, 32, 50, 4,149,133,116, -173,197,207,112,194,147, 15,161, 59,126, 1,254, 70, 44,196,131, 90,176,246,198,159,160,123,207, 43,195,188,222, 54, 96,171, 86, - 62,111,176,245,124,153,172,214,148, 57,141,177,216,198, 96,138, 9,206,121, 76,219, 53,115,197, 4,154, 50,216,171, 16,168,180, -131, 45,115, 28, 2, 91,229,173, 42, 91,227,202, 57, 58,235, 35,116, 8, 92,209,217, 32,248,223,171, 25,190,202,113,206,134,110, -143,142, 16, 50, 66,168, 24, 29, 69, 97, 77,136, 54, 17,176,169,136,186,107, 33, 68,166,237,186, 9, 29,135,131, 63,216,139, 16, -198,225,156,193,212, 13, 74, 71,152,170, 33,238,117,131,117,216,250,128,164, 22,193, 47,221, 76, 70,204,110,188, 64,119,101, 64, - 87, 75,142,142,167,148,101,141, 19, 26,171, 34, 68,146,182,227,174, 24,169, 35,188, 14,196,186,170, 40,113, 45, 86, 88, 74, 65, - 81, 89, 6,189, 46,243, 60,240, 70,106,231, 48,222,115,231, 70,159,159,253,241,183, 81, 54, 21,233,234, 74,120,237,201,156,248, -104, 8, 94,144,187,117,102, 81,134,169, 13, 87,175,143,152, 22, 19,180,172,233,117,215,249,149, 95,253,167,124,234,177,231,120, -226,107,143, 51,171,231,188,243,129,243,252,221,239,124, 45,239,248,153,127,200, 93,223,252, 70, 14,158,125, 10, 91, 22, 28,222, -188,201,115,215,111, 96,202, 57, 47, 61, 59,228,221,239,121, 19,127,249,235, 63,207, 61,233, 17,155,253, 20,125,246, 33,158,191, -182,199, 74,175,203,205,227, 41,147,249,156, 27,123, 67,242,170, 97,214,189,157,205,183,252, 24,247,254,228, 63, 98,243,194, 5, -142,191,252, 56,166,204, 17, 58, 66,182, 90, 9,191,216, 31,219,241,145,240,142,203,175,248, 62, 62,241,213, 43, 52, 84,236,206, -102,204,172,225,191,127,215,187, 57,184,113,157, 40,142,136,210,132,124, 56, 35, 78,186,228,195, 9,179,233, 33,179, 81, 65,127, -101, 13,231, 42,154,162,161,170, 2,249,116, 60, 28,161,123, 37,151,239,185,204,225,205, 67,166,197, 28,173, 98,198,147, 10, 73, -197,206,126,142,170, 4,207,239,223,192, 88, 67,166, 58,120, 33, 72,164,102, 86,207,192, 70,236, 21,187, 32, 4,141,109,200,162, - 4,171, 42,250,113,138, 49,158, 88,166,116, 85, 74,110,114, 26, 91, 81, 56,207, 32,210,188, 52, 31, 81,186,154, 72,106,140,183, -236,215, 37,155,145, 34,147, 41,113, 87,160,222,243,205, 15,190, 47,235,119, 72,164,230,223,253,197,167,121,243,229, 45,110, 94, -125,137,187, 30,249, 22,246, 63,251,201,147, 52,171,118,247,243, 16, 50,130,149,162,252,250, 19, 28,157,185, 23,111, 43, 14, 71, - 83,174, 29,140,105,140, 35, 86, 1,239,153,104, 71, 93, 55,140,103, 21,117, 93,112, 60,171, 88,233, 40, 34, 12,137,132,227, 81, -205,172,153, 83,215, 53,101,227,232, 37, 25, 89, 18, 49,159,215,204, 75, 75,166,225,230,225,136,227,225,156, 98, 94,209, 88,195, -212,193, 63,191, 63,225,233, 43, 59, 92,188,239, 85,252,155,143,126,140,143,126,250,243,252,226, 59,191,133,213, 24,174, 31, 79, - 25,230, 13,169,234,240,253,223,254, 48,166,156, 18, 69, 18,211, 24, 18, 37,169,170, 18,225, 28,170, 13, 42, 8,220,117,215, 42, -252, 5,182,118, 72, 76,235,139, 12,138,110, 79, 8,143,144, 94,130,181, 97, 50,104, 13,243,121, 25,136, 83, 66,162, 22,248, 85, - 23, 32, 40,131, 44, 98,189,147,113, 84,214,124,250,249,107, 28, 29,143, 57,149, 37,100, 73,184, 40, 84, 77, 29, 90,115, 50, 84, - 13, 46,244,143,218,247,211,182, 63,197,178, 94,106, 45, 28, 39,190, 34, 33, 67, 37,235,221,130,187, 29, 14, 70,219,182,240,173, -109,130, 83, 65,197,193, 86,101,105,173, 95, 13,206, 88,176,144,246, 55,248,208,111,254, 18,113,156,226, 61,104, 51,231,197,167, -158,102, 58,158,208,189,122,131, 83,135,187,164,182, 98,223, 10,158, 17,146, 35, 45,153,187, 38, 92, 10,140, 37,142,163,192,131, -175,131,114,125, 1,139, 8,216,205,118, 54,102,195,223, 82, 72,129, 80, 42,176,209,111, 21,182,220, 66,131,114,173,218,218, 90, -123,226,225,119,225,177,214,121,132, 10,127,103,103, 45,221,206, 10,221, 78,143, 78,183, 79,191,191, 78,191,223, 39,146, 17,198, -148,232, 36, 69, 18,225,189,192, 24, 67, 99, 74,140,107,120,208, 29, 33,247,190,178,196,159, 46, 90,197, 11,241,215, 13, 6,204, -101,192,230,102,113, 76, 22, 37,156, 91,239,208,120,200, 27,203,225,120, 14, 88,230,179,130,178,178,164,177,102,165,147, 96,189, -199,250,192,231,143,148,164,110, 60,149,105,130, 63,222,153, 86, 96,230,131,205, 69, 11,140,135, 78, 44,176,214, 16, 73, 73,214, - 73,192, 89,146, 52, 38, 47, 26,138,218, 46, 79, 63, 41,131,238,163,241, 10,143,103, 99,253, 2,231, 47,220,205,153,237,115,156, -191,112,134,198, 58, 54, 54,207,145,173, 36,116, 18,193, 71,255,213,175, 32, 98,141, 22,158,110, 71,179,213, 95,199,198,176,182, -182, 66,191,147,146,245, 87, 40, 94,186,202,197,159,248, 25,190,244,222,239, 9,246, 79,119,171, 83,242, 36,190, 82,180,216,208, - 96,183,116,223, 32, 84, 90,180, 57, 23,100, 48,209,218,223, 78,230,152, 45,225, 79, 44,241,135, 97,198,174,196,178,250, 95,166, -182,181,195, 80,239, 67,222,185, 88,204,217, 57,137,227, 13, 98,187, 64, 17,147,253, 53, 46,253,227, 15,226,125,131,240,121,184, - 29,216,166,197, 46, 27,156,105,104,230, 67, 92, 83,225,172,164,153, 77,177, 77,129, 55, 97,116, 99,202, 57,166,152,128, 9,172, -135, 32,208,171,240, 66, 45, 59,117, 34,138, 67,248, 11, 46, 84,217, 72, 92, 85, 32,116,132, 19, 50, 92,198,141, 1,157,130, 80, -136, 40, 11, 29, 0,103,240,213,156,186,152,160,162,192,131,192, 59,124, 93, 5,234,220, 34,108, 9,129, 51, 21, 82, 42, 68,156, -162, 85,180, 28,109,184,178,162,169,114,164,142,105,202, 28,143, 71,199,113,139,181,174, 80,105,135,184,179,194,222, 51, 95,165, -155,198,116, 6, 43, 92,189,113,192,212, 43,138,105, 65,101, 66,244,171, 16, 42,240, 53,154, 6,157,100,193,110,171,194, 72,172, -170, 42,156,151,188,176, 59,100, 56,171,104,156,163, 48,142, 72, 41,142,102, 21,191,241,222, 31,194,175, 13,216,184,243,110,180, - 4,198, 19,220,124, 74, 36, 37,126, 94, 51, 58,125, 63,199,121,131,242,142,131,209,148,167,159,223,229,169, 47,127,145,126, 54, -224,244, 29,119,240,182,239,121, 51, 47, 93,217, 33, 47, 29,159,123,230,171,124,247, 35, 15,178,158, 40, 26,107,201,199, 67,166, -195, 35,158,185,114,133,151,246, 14,217,157,228, 60,246,197, 47,240, 51, 63,251,211,188,255,223,254, 26,155,171, 61, 46,136, 33, -247,137,235, 92,190,251, 1, 62,241,204, 14, 54,207,177,192, 86, 71, 33, 84,130,119, 13,163,113,206,100,210, 80,110,221,206,189, - 63,246,147, 92,124,205, 35,220,252,171, 63,195, 53, 53,173,178,231, 27,146, 5,113,158,217,179, 31,231, 82,106,184,204,156,207, -204, 4,165,111,248,169,111,123, 19, 59, 55, 71,164,157, 8,175, 43,166, 71, 51, 64,135,200,233,172, 79, 83, 88, 58,171, 41,101, - 97, 65, 52, 76, 71, 35,108,109, 73,226,152, 56, 21,140,246,142,217, 61, 24,210,235,117,217,216, 88,101, 62,159, 50,154, 84, 20, -126,202,222,100, 68,166,250,148,174, 98,179,183, 70,154, 90,134,243, 57,222,122,166,245,152,198, 55, 68, 34, 65, 74,137, 86, 22, - 48, 68, 90,208, 75, 36,120, 67, 63, 73,169,173, 33,214, 9, 10,207,176, 42,169, 93,141,113,166,117,145, 8,182,146, 21,166,166, - 38,119, 51,206,117, 79,163,222,113,239,229,247,105, 1, 89, 18,241,161,143,125,145,203, 29,205,197,237, 13,182,182, 54, 64,105, -102,215, 94,106,115,213, 79, 64, 52, 33,135,195, 35, 76, 67,148, 79,184, 26,175, 51,157,231, 24, 99,153,206,115,240,158, 72, 88, -174, 29,140,153, 22, 53,113, 4,101, 99, 89,141,195,130,238,118, 98,180,247,236, 30, 78,169,157,227,250,193, 1,177,150,100,157, -152,249,188, 34,234,164,212,198, 82, 91,136,180, 38, 75, 34,182, 86, 82, 58,145,102,179,215,161, 20, 43,188,174,111,249,209,223, -253,107, 92, 99,121,253,253, 15,241, 61, 15,174, 50, 53,158, 55, 63,116, 7, 7,179,156, 66, 20,124,246,201, 35,222,254,250,203, - 33, 49, 71, 10,170,162,194, 87, 5,166,168,130,162, 23, 31, 14,109, 99, 23, 6,218,160, 58,111, 17,166,206,123, 18, 37, 2, 24, -196,133,195, 86,202, 48,187, 53,214, 34, 77, 19, 16,181, 74, 17, 41, 21,112,165, 22,172,113,212, 13, 84,141,197, 91, 79,162, 34, -230,141,229,201,253, 17, 79,221, 60, 68,213, 13,107,177, 38, 22, 18,239, 66,218, 18,206,182,182, 29,219,230,140, 47,206,115,185, -172, 36,219, 20, 20, 78, 58,117,126,153, 67,238, 90, 43, 88,192,160, 26,124,139, 67, 13,105, 82,182,245,143, 91,108,221, 48,216, -188,141,137, 25,243,187,239,255, 85,186, 89, 39,120,116, 17, 92,127,230, 57, 70,251,251,236, 93,189,206, 80, 73,134,131, 62, 71, - 89, 23,211,201,136,164, 68, 52, 97,195,196,186, 0,114,201, 75,148, 53, 40,225, 67,229,220,210,235,148, 8,109,244,197,235, 98, -204, 45,244,167, 69,245,215,238,159,214,133, 96,151, 22,231, 42, 1,165, 36,170,229,113, 75,165, 90,130, 89,216,208,163, 72,209, -235,108,144,165, 25,221, 78,151, 88,170, 32, 2,244,193,126,104,189, 65,203,136, 69, 82,235,241,112,138, 18,150,135,242, 23,136, -230,215, 79, 46, 18,178,245, 70,183,137,122, 66,128,215, 17, 87,155, 20, 99,125,216, 44,179,132, 78, 28,135, 67,198, 58,242, 50, -231,104, 18,224, 66, 69,109, 16,210,115,126,173,135,113, 96,140, 69, 43, 69,109, 61,105, 44,153,230, 5, 78, 70,152,170, 32, 82, -130,188, 12,179,192,198,184,240, 61,196, 83,150, 77, 96,128, 43,201,112, 30,208,185,206, 58, 6,221, 44,140, 50,148, 38,175, 26, -146, 72,161,149, 98,181,191,129,148, 9,235,167, 94,198,160, 63, 96,101,208, 37,206,250, 65,248,183,214,144, 63,255, 20, 87, 63, -245,121,238,190,243,101, 92, 56,123,142, 83,167,206,178,122,246, 52, 82, 58,206, 92, 56, 71,154,164,204,174,223,100,251,109,127, -151,175,253,203, 31,193, 84, 69, 16,226,201, 91, 8,146, 66,156,132,226,112, 98, 29, 90, 92, 42,253, 45,168,206,165,205,181, 85, -191,135,202,136,147, 8,214,165, 87,238, 36,210,117, 33,240, 94, 36,231,249, 19,131,241, 18, 42, 18, 18,115,253,242, 51, 90,196, -183, 10, 25,114,214,183,222,241,223,209,121,217, 43,240, 62,111, 47,216, 14,202, 41,182,152,225,138, 49,245,236, 24,239, 37,182, -174,169,198,135, 45, 94, 88, 96, 26, 71, 61, 63, 38,202,214,208,113, 39, 0,162,156, 15,225, 71, 74, 7, 38, 59, 30, 47, 19, 92, - 85, 98,203, 28, 91,215,148,199,161,149, 31,245, 86, 48,197,140,252,112,159,102, 50, 10, 30,248,121, 25,214,108, 85,225,133, 32, - 78, 58,237,253, 69,225,234, 57,166, 14,157, 66,103, 27,132,107,139, 7,165, 16, 4, 37,189,243,174,165,202,133,238,148, 20, 33, - 40, 6,194, 44, 92, 10,133,169,130, 90, 95,224,145, 42,240, 64,170,227, 67,142,159,251, 58,137, 22,172,110,246,184,190, 59, 68, -197, 26,149,165, 65,124, 53,171, 80,105, 15,157,100, 24,107,169,203, 28,180,194, 58, 71, 62, 43,153,205, 43,106,235,216, 29,231, - 56, 15,211,202,128, 16, 36, 58,160,167,127,252,135,222,136,204, 58,248, 42,103,246,252,179,212,243, 57,243,163, 33,126, 58,163, -172, 36, 87, 2, 12, 54,152, 0, 0, 32, 0, 73, 68, 65, 84,244, 25,242, 38,103, 90, 54,236, 31,142,121,254,218,117,134,199,199, - 28, 28, 30,241,224, 3, 15,163, 19,195,246,218, 22,145,169,153, 55, 9,255,251, 31,254, 17,191,243,151,159,225, 84, 49,228,182, - 51,155,236,222,184,193,151,159,122,158,167,246,142,169,156,103,119,114,192,223,254,222,255,138,255,251,253,255,154, 78,150,114, -110,125,133,141,181, 14,217,222,215,120,251,183,191,146,171,209, 41, 58,190, 97, 90, 89,202,170,161, 70,210,139, 21, 81,162,233, - 36, 9,199,163,154,102,176,201,253,239,126, 15,171,219,231,217,255,212, 99, 1,159,108,220, 18,102,179,240,182,119,168,249, 90, - 25,241,165,220, 81,123,195, 79,188,254,187,216,219, 61,164,211,233,114,120,237,136,193,198, 26,197,124, 78,156,197,140,167,135, -116,178, 30, 59,215,174,146,245, 51,180,147,140, 14,135,164, 73,138,204, 28,215, 95,220,101, 50, 41,113,210,224,244,156,222,106, -151,249,145, 33,201, 34, 6,114,149,221,226,144,110,146, 81,211,176,153,174,242,226,209, 46,181,171, 48, 62,112, 0, 42, 91, 48, -136, 7,237, 69, 87, 48,174,103, 20, 77, 65,211, 88,198, 77,205,106, 87, 6,224,143,210, 68, 45, 16,191,241, 53, 78, 4, 59,116, - 79,103,204,108,142, 22, 49,221, 56,225, 48, 31,162,203, 34,231,120,191, 97,181,223,231,238,181, 30, 31,120,242, 37, 94,243,178, -115,236, 92,189,198,230, 93,247,176,251,201,143,209, 6, 40,161, 90, 21,161,111,161, 16,206, 3,207,125,141,181,222, 22,211,116, - 13,237, 44,194, 89,246,143, 27, 92, 47,230,220,106,151,162, 54, 96, 27,110,142,115, 70, 82,112,247,246, 58,154, 20,175, 37,231, -214, 58, 60,250,149, 27,172,247,123,228, 69, 73, 39,142,200,189,163,152,229,244,186, 25, 43,221,152,173, 65,151,162,108,168,106, - 71,183, 63,224, 85,247, 62,196, 71, 63,243, 24,191,254,252,243,216,220,146, 70, 49,239,121,227,253,140,134,215, 80, 8,242, 74, -242, 19,223,118, 31,222,193,199,158,188,194, 47,255,167,155,252,243,183,110, 50,153, 6,245,115, 97, 61, 62,207, 41, 5, 36, 89, -140,107,119, 38, 87,213, 1,216,208, 52,161, 69,109, 45,218, 59, 74,171,137, 19, 77,147,151, 97,198,174, 84, 8,208, 0,156,146, -244,146, 4, 47, 4, 90, 75, 34,227,105,128, 40, 74, 49,149,161,106, 36,211, 42,144,214,156,151,104,103,241, 78,240,137,107, 35, -254,244,153, 3, 98, 41,120,228,252, 58,247, 93,216,162,179,214, 3, 33,169,218, 12,102,233, 29,210,132,136, 34,169, 84, 72, 91, -211,106,153,170,181,216, 12, 67, 30,177, 93, 38,150, 45, 54, 68, 47, 66,234, 29,166, 2,209, 96, 99, 79, 22, 39,168,213, 85, 30, -125,244, 3,236, 94,187, 78, 47, 75,153, 29, 15,233,109,172,227,204,156,186,172,131,168, 79, 70, 80,149,228, 67, 75,175, 91, 19, -247,250, 52,120,170,170, 70, 56, 79, 89, 5,168,135, 82,138, 81,225,136, 36,196, 81,104, 13,187,210,208, 0, 74,235,246,194,100, - 90,159,104,232, 34, 8,130, 72,209, 33, 66,148,165,247,120, 19, 42,217, 88,133, 86,181,104, 99, 51,149,142,113, 24,116, 45, 81, -202, 98, 27,143,245, 6, 33, 42,164, 72,177,206, 5,197,185, 51, 40, 29, 83,150, 69,104,233,107, 75,213, 52,236,237, 13,121,205, -195, 47,167,251,153, 15,134,138, 84,139,165,186,214,183, 81, 78, 42,110,233,129,222,115,142, 41,206,245, 40,234, 26,107, 51,108, -213,160, 87, 66, 56,203, 84,107, 16, 17,177, 18, 28, 87, 53, 74, 88,166,243,138, 89, 94,208,237,116,195, 37,198, 6,220,166,117, -150,126, 63,229,104, 92,210,160, 41,102, 21,107,221, 56,124,247,128, 44,139,131, 56, 49,210, 84, 69,133, 51,158,126, 39,165, 40, - 10,180, 82,204,139,130, 52,138, 41,235,134,110, 26,161,162,144, 83,128,136, 57,179,125, 9,237, 44,167,214,122,156, 58,181, 65, -111, 16, 81, 55, 57,183, 37, 61,126,246,173,111, 98,115,243, 44, 43,171, 41, 43,253, 85,234,114,196,100,118,196,185,219, 47,160, -140,101,124, 52,225,129,255,250,159,240,228,207,253, 0,182,154,183,247,155, 5,220, 37, 28,162,238,150,138,124, 73,136, 91,230, -162,183, 34, 54, 31,196,161, 11,222,103,152, 22,133,128, 14,107,253, 18, 23, 27, 58, 69, 98, 9, 18, 89,140, 92,150,182, 36,121, - 75,179,191,173,250,157,109,231,232,162, 85,190,251, 80,136, 47,170, 18,223, 8, 80, 26,239, 10,132,176, 33, 54,181,174, 90,225, -101, 0, 70, 57,231,168,139, 41,190, 54,120,149, 98,171,144, 77,225,188, 65, 70, 43, 84,211, 17, 50,206,208,113, 23,225, 26,172, -151,184,186,128,162,164,206,199,148, 71, 55,105,138,138,227,107, 47,178,118,238, 60,229,232, 8, 91, 91, 80, 17,194,215, 12,175, -237,179,114,102,155,254,169, 77, 38, 7,135,152,162,160,191,117,134,178,152, 19,167, 29,186,107,107,196,131, 77,210,213,245,224, -222,168,139,176,134, 93, 96,186, 11,161,241,182, 10,114, 25, 33,112,229,148,198,166, 97, 4,104, 29,198, 52,184,198, 33,163, 36, -172,235,186,164,193, 35,210, 30, 54,159,163,178, 53,116,154,226, 93,131,214, 93,136, 59,244,187, 25,165, 13,234,117, 45,194,243, - 28,237,238,227,182,207, 18,119, 6, 28, 31,204, 24, 30,220,160,219, 79,217,221,159,144,164,154, 27,251, 35,114, 43, 80,248, 16, -161, 42, 21,195, 60, 71, 74, 73,172,192, 9, 75,125,116, 68, 57,155, 83,215, 13,243,107,123, 8, 47,185, 33, 36, 87,138, 43,232, -149,140,126,111,192,120,156, 51, 29,207,216, 92,137,233,233, 41, 7,215,111, 32,216,100, 88, 10,182,206,156,226,229,119,221, 67, - 94, 20, 60,255,245,143,241, 11, 31,121,140,237,255,244,113,222,124,207,121,190,186,115,204,216,120, 4, 18, 7, 28, 29, 13,153, - 89,199,238,180,228,218,254, 49,103,215, 82,206,221,121,137,151, 62,246,167,188,247,135,127,152, 95,249,168, 97,154,151,164, 29, -143,136, 35,234,126,135, 27, 55,199, 76,102, 53,167, 55, 50,108, 28, 51,153, 37,108,124,231,247,240,230, 87, 63,194,159,255,216, -119,127,195,197,115,161,169,243, 64,105, 91, 0, 18, 2,185, 82,176,178,190,130,138, 90, 59,176,115, 72, 25, 83,231, 57,211,227, - 25,106,160, 40,231, 53,105, 50, 34,146, 93,210, 44, 98, 88, 29,113, 97,253, 60,218,121, 26,103, 49,222,177,150,244,152,236, 79, -152,154, 57,174,178, 24, 17,113, 54,219,194, 41, 88,151,171, 92, 29,221,228,220, 96,131,121, 81,113, 88, 29,161,165,160, 23,247, - 64, 86, 8,103, 73,100, 23, 85, 75, 38,102,134,181, 53, 74, 40,246, 70,138,126, 26, 97,124, 73, 47,145,216,185, 38,178, 17,153, -240, 56,229,169,189,161,171, 58, 24,103, 24, 85, 97, 53,234,114, 62,225,194,153,203,184,166,228,252, 74,198,149,209, 20, 99, 12, - 7,251,123,156,218,222, 64,119, 7,152,233,100,217,162, 12,183,240, 96,198, 95,196,220,173, 63,241,215, 76, 55, 47,243,185,238, -109, 12, 18, 65, 89, 86,124,226,197,156,237,181, 30, 73,154,146,198, 49,101, 3,219,171, 93,148,176, 36,218,129,104,232,117,122, - 72, 33,233, 36, 25,171,189, 14, 69,222, 16, 69,154, 78, 20,225,173, 33,159,207,184, 81,206,185,109,115,133,243,253,211,244,179, -152, 95,254,141,255,153,181,193, 42,167,210, 14,141,242,188,229, 85,175,102, 51,155, 50,105,178, 16,148,226, 12,101, 21,230,228, -175,191,184,197,237, 87,159, 96, 60,124,132,180, 19, 97,132,196,219,132, 89,221, 64, 93,227,227,184,165,178,121,108,221, 96,203, - 28,169,117,128, 23,216, 32,120,138,227, 8, 23, 71, 8, 45,177,243, 18,148, 67,232,160,240,137,149,194,213, 13,198, 4,236,161, -214, 97,142, 44, 45,168, 88,163,163,136, 52, 54, 88,107,176,206, 81,212,161,253, 39,148,166, 19, 37, 40,173,120,226,184,225,119, -159,122,130,149, 36,226,161,211, 43,188,252,226, 41,182, 54,122, 33,135, 88,197,120,165, 48, 62, 0,107,100,211, 78,225,149, 10, -162,178, 54,238, 18, 23,108, 99,222,134, 20,183, 19, 70,114, 32,201, 65,240, 43, 63,191,251, 28,147,175,142,137,163,140,245,173, - 45,166,163, 25, 68, 49,179,249,156,195,225,152, 63,255,194,243,124, 97,127, 66,233,190,145,200,212,143, 37,111,127,232, 50,223, -241,208, 29,108,172, 13, 40,154, 16, 3,171, 8,168, 78, 35, 4, 77, 99,201, 58, 49, 73, 26, 72,122,117, 99,105,106,215,118, 15, -218,121,187, 7, 41, 27,156, 87,203,168, 69,219, 30,226, 14, 90, 53,190,192,183,214, 50,223,178,224,109,155, 42, 37, 34,139, 47, - 61,101,145,147, 68, 10,165, 66,155,209,227, 41,124,137,245,150, 65,214, 97,231,104, 68, 28,119,121,235,247,126, 15,211,223,251, - 85,220,226, 96,113,224,164, 88, 6,239,132,196,206, 86,165,237, 4, 93, 97,233, 39, 10, 33, 19,138,186,102,208, 9,255,237,198, -154, 56, 18, 92, 88,239,145, 23, 57,251,135, 99, 42,231,169, 92,205,254,104,202,165, 52, 35, 81,146,162,117, 51,208,210,206,188, - 51,116,210,132,169,117, 28, 76,115,122,113, 68, 28, 69, 24, 99,153, 20, 21,145, 20,164, 73,204,188, 40, 73,156, 71,235, 8,239, - 44, 74,180,173,249, 40,232, 48,148,177,164,105,138,138, 83,106,159,176,125,219, 69,164,150,193, 47,111, 12, 89,154,112,253, 79, -254, 31, 46,174,107,146, 53,197,193,225, 21,170,178, 71,218, 77,217, 58,117,138,170,154, 99,215, 54,217, 92, 95,225,139, 63,253, -221,203,106, 91, 44, 18,176, 22,155,157,245,220,130, 87, 95,178, 93, 67, 28,106, 27, 87, 32, 79,232,146,178, 85, 22,203,150,245, -105,141,111, 85,241, 30,225,195,115, 75, 47,240,141, 15,135,187,187, 37,111, 76,156, 84,247, 11,111,178, 91,200, 70, 22, 14,207, - 22,164,134, 91, 68,111, 6, 60,114,231,246, 7,192,207,195,251,240, 17,184, 60,164, 32,150, 83,154, 98, 74, 83, 85,184,186,194, -214, 5,214,120,234,170,192, 87, 53, 78, 8,108, 61,193, 89,129,180, 53, 42,222,164,202,115,118,158,252, 52, 10, 79, 61, 31, 51, - 59,156, 50,220, 57, 66, 41, 73,210, 9,249,244,113,175,131,169, 67,194,162,183,161,171,116,248,194, 77,118,174, 92, 67,120, 67, - 81,122,226,231,119,112,141,167,179,218, 37,237,198,116, 86, 6,116, 55,183,136, 87, 55,233,174,111,134,125,196,181, 26,142,170, - 12,174,162, 40,105,133,125, 96,171,121,104,143, 19, 66, 96,240, 13,166,202,113, 46,176,227, 93, 93, 64,214, 37, 74, 51,148,130, - 74, 64,220,233, 34,146,148,102, 62, 35,235,117,200, 71, 51,132, 23,116, 87, 87, 16,211, 41,149,105,248,242,227, 79,176,182,190, - 74, 94, 86, 92, 63,152,112,116,101,151, 56,142,201,235,138,163,162, 14, 93, 32, 1, 89, 34, 24, 23, 21,221,172, 67,101,114,254, -242, 47, 62,201, 27,191,253, 85,220,216,223,195,180, 40,102,135, 33, 90,189,141,191,184, 17,241,196,141, 79,112,251,217,109, 54, -183,206,179,185, 50,224,116,175,160, 39, 27,198,165,163,154,236,113,184,171, 49,117,197,238,200,240,234, 7,238,224,244,106,198, - 23,206,156,225,207, 31,251, 48, 77,221,240, 59, 95,122,129,173, 94, 23, 75, 24, 89, 93,220,190,135,221,171, 47,162,148,160, 65, -240,236, 81,193,229,221, 9,235, 91, 51,182, 95,123, 15, 79,254,201, 31,241,175,222,245, 30,126,251,211, 37, 85, 81,147,102,125, -156,245, 52,166,102,116, 56,103,111,199, 98, 81,220,113,231, 89,110,187,176,194,197,211,171,188,253,255,251, 44,127,252,206, 55, - 82,207,198,173,126,202, 47,199,130, 99,155,144, 72, 79,227, 13, 47, 61,125,141, 11,119, 62,192, 83,159,121,138,122, 62,164,183, -210, 39,238,121,154, 92,144, 69, 29, 76,211, 48, 62,218,227,236, 29,247,224, 75, 71,238,142,177,185,164,105, 38, 88, 47, 25,116, - 53, 47, 30,239,145,206, 61,162, 86,148,166,162,151,116,153,204,142, 24, 68,171,244, 87, 27,132, 46,201,102,171, 28,229, 99,186, - 81,196,154, 90, 97, 92,142,209, 8,140, 51,164,145, 38,175,102,236,151,251,120, 60,169, 78, 88,139, 87, 41, 76,195,246,170,102, - 86,193,124, 46, 81,210, 19,171,152,142,140,105, 48, 24, 32,147,154,153, 41, 41,108,201,217,206, 69,212,143, 62,116,225,125,194, - 84,244, 87,215,248,248,151,159,229, 51,251, 99,222,113,215,105, 34,173,217, 88, 91, 37, 90,219, 96,242,220, 51, 1,110, 34, 60, -206,223,194,216,109, 87,167,243,130,181,114,196, 93,211, 27, 28,186,136, 27, 37, 28, 78,167, 92,121,225, 42, 27,169,102,181,223, -165, 19,135,170,246,252, 90,134,162,161,154, 55,124,238,217,107, 28,143,143, 57,189,222, 39,214, 10,173, 97,173, 27,145, 8, 79, - 22, 7, 85,231,197,245,109, 14, 71, 83, 62,241,196, 23,120,244, 11, 95,228,246,179,167, 57,187,190, 66, 20,197,220,127,246, 60, - 63,248,200, 25, 70,199,147,144, 89,238, 61,190,174,136,210,148,175, 60,250, 41, 54,234,156,237,151, 63, 64, 41, 67,100, 98,164, -130,229,200, 25, 75,211, 24,180,112,237,191, 27,132, 9, 76,227, 52,210,116,146, 24,169, 20,101, 94, 6,152,134,177, 68, 42, 84, - 49,214,134, 69,168, 84,219,246,109, 69,107, 82, 4,177,157,144,193,170,160,165, 68, 75,129, 84,178,245,154, 43,178, 36, 66,183, - 27,121, 22, 71,116,187, 29,214,122, 93, 86,147,132,211, 27,107,168,164,199, 81, 19,113,100, 18,142, 74, 71, 81, 52,152,249, 12, - 97,109,192, 94,154, 6, 87, 53,152,178,192, 86, 53,174, 44,177, 85, 73, 83, 20,248,170,229,160,231, 21,182,110,104,170,154,195, -233,148,157,227,125, 94,216,191,201,193,225, 14, 58, 78,232,118, 59,109, 5,237,168,235,138,131,195, 17, 95,127,113,135, 79,124, -125,135,207, 30, 76,232, 68,154,126,172,232,196,154, 84, 73, 58, 81, 24, 45,124,238,234, 33,127,248,248,115,252,209,231,190,198, -150,246,172,196,193,190,100, 93,123,225, 16,237,252,181,157,157,170,118,170,234, 76, 27,141, 42, 66, 57,230,234, 32, 8,180,198, -226,125,152,157, 91,231, 90,128, 72,123,155,182, 54, 36, 23, 89,131,105,154,165, 15,213, 25, 67,213, 18,215,162, 40,198, 52, 21, -121, 17,196,148,221, 56,102,247,232,152,127,241,123,143,242,182, 87,190,130, 7, 47,158,167,252,147,255, 35,216,159,148, 92, 98, -143, 23,226,194,118,178, 17,170, 73, 4,178, 37,144, 29,202, 62, 7,141,167, 50,158, 78,154,132,158,136,148,116,180,226,112, 90, - 50,153,207,153, 55, 22, 45, 5,147,217,156,202, 24, 46,172, 15,232,103, 49,133,113,116, 83, 77,217, 24,198,121,195,246, 90,151, -163,227,201,210, 51, 59,169, 42,172,179, 72,103,137,116,208, 29,152,133,175,219, 59,148, 16, 52,117,128,206, 68,177, 14, 1, 19, - 82,145, 38, 17,113,156,176,209, 91,225,206,219, 95, 70,214,233,176,189,190, 70, 22,167,108,111,173,177,117,118,149, 43,191,252, - 35,108,187, 49,171,118,206,106, 95,179,114,250, 20,189,126,130,156, 28,208, 60,251, 36,230,169,207, 48,123,250,241,144,225,176, - 64,128, 47, 71, 56, 75,254,240, 50, 49,109,209, 38, 95, 84,207,203,244,172,133,231,124, 17,229,238, 79,172,109,139, 4, 54,215, - 2, 13, 23,175, 35,244,242, 35, 92,102,101, 11,213, 86,229,183, 42,231, 91,214,247, 55,192,224, 57,177,211, 9, 39, 80,189, 77, -182,127,248,159,134,139,152, 45,161, 30, 7,120,140, 49,248,186, 12, 28,246,114,134,179,142,166,172,176,141,161,201,115,140,169, - 64,165, 33,242, 51,206,240, 50,101,231,241,143,179,255,149,199,217,249,218, 11, 76,118,247, 25,239, 79, 24, 31,140,209, 73, 68, - 28,197,237,124,222, 48, 61, 26, 99, 27,152,142,107,106,227, 56, 60,204,137, 34, 21,218,229, 42,198, 24, 79, 89, 90, 38,179,154, - 42, 47,145, 8,102, 7,199, 76,118,246,153,238, 92, 99,182,127, 19,149,118,208, 89, 31,233, 13,118, 62, 10,186, 3,213,162,164, - 85,180,220, 63,108, 29, 68,180,182,182,173, 85,152, 0,162, 17, 10, 83, 22,161,109,161, 98,116,214, 99,255,107, 95,197,151, 51, -210,254,128,249,188, 96, 54, 41,200, 86, 6,200, 56,120,232,173, 51, 88, 15, 7,135, 99,174, 31,143,153,215,161,197,126, 84, 20, - 28,150, 13, 90, 4,135, 65, 22, 71,228,117, 67, 55, 77,152, 23, 21,185,113,124,252,233,155, 60,251,220, 77, 46,173,101,100, 64, -185,119,204,243,215,115,126,229,243,207,243, 23,207, 94, 9, 76,117, 21, 99,203, 57, 85,149,115,109,231, 6,222, 89,210, 68,112, -102, 99, 13, 39, 34,174,239, 28, 6,247,201, 60,231, 21,247,110,114,102,181,203,197, 59,191,157, 79, 62,254, 9, 50,233,152, 86, - 13,198, 65, 95,195,229,251,191,131,195,157, 43,220,188,254,117,180,144,244,133,103, 75, 11, 78,173,101,168,213, 21, 78,159,217, -230,218,231,159,228, 29, 63,247, 15,120,236,111,158,161,219,203, 24,230, 53,137,175, 40, 28,108,118, 21,215,199, 5,227,153, 97, - 58,202,201, 75,141, 79, 34, 94,243,174,119,243,236,239,126, 8, 91,149, 75,176,154,247,158,210,105,190, 82,192, 43, 83,201,155, - 47,223, 73,173,123, 76, 14, 15, 89, 93, 95, 99,116, 52,225,112,239,128, 51,151,122,220,120,241,144,193,250, 10, 89,154,240,217, -207, 62,193,202, 74, 76, 61, 83,148,118,198,234,106,143,114,218,144, 14, 98, 38,227,154,178,105,152,149, 13, 91,155, 33, 33, 47, -209, 93,230,182, 98, 82,229,140,134,129, 63,114,148, 31, 81, 90, 67,105, 75,250,186,199,180, 26, 17,199,146,209,124, 78, 97, 11, -180, 20,196, 42, 98, 37, 30, 48,172,199,156, 91,233,112, 99, 84,144,106, 65,211,120,166,198,112,170, 23, 81,218, 54,108, 71, 38, -193, 88,228, 21, 66, 10,122,170,131,126,242,133, 61, 94,125,207, 69,164, 55,196, 74, 98, 1,107, 44,167, 54, 7,120,219,208,221, - 88, 63, 89,244,238, 36,108,193,217,176, 9, 43,187, 80, 96, 11,164, 49,188,238,248, 10,175, 7, 26,173,177,235,158, 35, 53,227, -243, 69,197,169,110,194,186,182,140,166, 51,230, 99, 3, 77,194,225,254, 53, 94,119,199, 25,102, 78, 80,229,115,124, 20, 98,232, -144, 80, 55, 53, 79,239,236,242,216,240, 43,232, 40,230,182,173, 13,206,108,174, 81, 54,158, 44,201,184,107,208,227,237,175,185, -204,100,120,136,150,193,251, 92, 55, 53, 81, 28, 51,124,252, 75,188,252, 76, 23,113,249,110,138, 84,145, 24,143,243, 53,213,172, -106, 75, 2, 67, 62,157,112,124, 16,226,242,174, 31,141,249,171, 23, 14,121, 46,175,200,180, 98, 35,139,120,243, 61,231,249,238, -135,110, 15,169, 68,135, 99,188,137, 72,147,136,106, 17, 15,218,138, 94, 34,173, 17,206, 81, 91,131, 23, 18, 69, 72, 36, 82,178, -157,219,162,136, 84,216,188,157,131, 40,210, 8,169, 2,104, 66, 40,162, 36, 38, 75, 18,148,142,232,164, 41, 58,214,196,113, 76, -146,165, 8,173, 41,156, 96,102, 29,229,108,142,112,150, 78,175, 75,146, 37,216,186, 14, 1, 40,166, 33,233,174,176,191,243,165, -144, 88, 38, 60, 82, 71,168,246,208, 80, 73,196,170,150, 52,181,165, 28,207,168, 11,141,138, 52, 94, 64,150,165,225, 66,226, 4, -155,157, 24,129, 64, 73, 22,217,152,203,121,166,117,158, 78,164, 90,207,177,226,195,159,127,134,242, 83, 95,231,199, 95,123, 7, -175,190,231, 18,214, 41,156, 51,248, 82,162,163, 58,108, 68,237, 99,149,150,237, 38, 30,118,105, 29,183, 21,156,146, 88,111,161, -109,255,249, 86, 17,239,140, 9, 27,179, 11,227,157, 0,239,104, 15,244,166, 65,120,208, 74, 51, 47,114,180,112,196, 74,242,169, -103, 94,224, 79,159,122,129,162,177,156, 95, 31,240,173, 23, 54,184,246,232, 7,218,195, 18,180,247,120, 36, 82,182,222, 13,231, -219, 0, 18,177,212, 36, 32, 29,198, 57, 94, 46, 15,184, 26,109, 51, 42, 43,170, 34, 39,213, 93, 76, 99,136, 35,205,102, 63,230, -197, 93, 79,170, 37,163,210,210,137, 34,142, 39, 57,135,147, 25, 74, 43,210, 68, 19, 73, 69, 36, 21,153, 14,164, 50, 29, 41,172, -175, 81,145, 6, 83, 3, 26, 35, 5,186, 85,243,107, 17,210, 80,100, 11,114,209, 89, 76,150, 6,224, 13,173,198,162,170, 66, 55, - 33,138, 18, 6,157,136,203, 91, 25,167, 6, 25,107, 43, 17,253,110,135, 76,141, 49,163,131, 32,238,244, 53,234,120, 15,134,187, - 44, 44,254, 82,122,236, 45,121,214,194,139, 37,229,109,225, 32, 8,249,232, 18, 47, 61,194,250, 37,143,221,223, 98, 53, 11, 22, -183,246,125,249,160, 19,147,139,121,252, 34,177,205,180, 62,114, 25, 8,123, 74,137,144,238,216,250,211,229,178, 43, 19, 94,119, -145,159, 45,110,185, 44, 88, 21, 64, 56,139, 33,188,115, 65, 37, 47,165,167,115,230, 14,100,148, 66,115, 4, 77,129, 43,203,112, - 49,169, 26,154, 98, 78, 61, 31, 99,157,160, 41,230, 56, 84, 8, 94, 17, 18, 83, 6,184,148,238,174, 80, 28, 31,113,229,163,127, -132, 51, 30,215,212,224, 29,121,110, 72,187, 26, 29, 43, 98,229,233,100, 32,117, 66, 36, 61, 99, 91, 19,101,162,181, 79,194,230, -230, 38,211,163, 41,137,246,116,186, 17,199,141,197,150,134,141, 94, 76,156, 74, 48, 13, 82, 71, 52,198, 32, 43,205,228,230, 49, -179,195,191, 65,117, 98, 46,191,234, 17, 6,167, 54, 17,173,229,109, 49, 95, 16,113,135,102, 62, 70,232,184,181,248, 85, 72, 84, -200,144, 88,240,117, 0,124, 77, 61, 62, 32,233,111,161,180,198,213,225,111,108,242, 57, 85, 89,226,134,135,152,198, 32,181, 38, -209, 9,195,241, 33,211,218, 96, 26, 67,101, 44,227, 58,112,223, 21, 39, 66,196, 97, 94, 6,222, 69, 89,211,248,176,238,210, 84, -243,213,221, 99, 62,245, 59,135,104,192,246,215,185, 86,212, 36,206,114,113,109,133,110,167,195,214,122,143, 68, 41,134,163, 93, -198,147, 35, 6,189, 51,224,224,224,104,159,158,235,178,119,120, 64, 57, 47,241, 98,206, 51, 47, 21, 60,116,239, 25, 86, 87, 75, -182,255,217,111,240, 47,255,167,127,128, 38, 4,130, 85,241, 25,126,240,123,191,159,127,241,171, 63,207,197,126, 15,229, 60,107, -169,162,163, 60,147, 27, 7,172,108,174,147, 63,120,142,181,188,230,153, 63,250, 32,255,205, 79,255, 29, 62,240,193, 79,115,122, -189,143, 49, 9,195,253, 67,102, 42, 97, 53, 81,212,249,152, 58,118, 28,238, 29, 49, 25,231,140, 46,109,240,214,223,127,140, 63, -123,231,155,168,198,199,203,177,210,170, 54,108,197, 17,127,111,107,206,244,197,199,137, 87,239, 8,123,112,127,133,188, 26,178, - 58,232,242,229, 79, 61,195,217,115, 23,152, 21, 83,182,206,196,108, 60,191,198,225,206,132,173,179,155, 28, 92,217,231,165, 43, -123, 20,212,172,102,231, 2, 50, 59,138,241, 94, 98,100,193,196, 86,104, 63, 64,107,131,241,129,202,231,109,201,122,186,198, 81, - 53,102,179, 19, 97,108,142,195,115,156,231, 40,239,145, 40, 58,186, 67,237, 26, 6, 41, 88, 41,216,200, 82,174, 30, 31, 35,125, -151,178,158,177,154,117,185, 54,217,225,114,127,155, 73, 33, 24, 54, 5, 25, 49,137,142, 16,206, 49,181, 67,212, 15,221,183,253, -190,151,221,126,137, 56, 77,249,216,147,207,113, 80, 86,220,222,209,172, 38, 9,107,155,235, 40, 45, 57,250,218,149,160, 44,189, - 5,166,191,112,178,250,214, 82,229, 90, 5,172,247, 97, 17, 42, 23,188,185,157,111,251, 46,110, 30,143,184,173, 31, 49,159,206, -184,113, 60,101,165, 40,217,254,204, 31,240,242,230,152, 59, 71, 55,121,200,207, 16,103,239, 98,123,173,207,249,254, 42, 55,110, -236,128,173,184, 62, 45,201,210, 14,247,157,219,166,151,198,108, 14,122,156, 95,233,241,250, 59,206,243,186,151,109, 83,207, 15, -144, 82, 35,188, 65, 8, 80, 66, 96,170, 10,189,190, 6,167, 78,227,176,184,170,193, 54, 65,220,229, 93, 8,255,192, 4,140,105, -145, 87,220,220, 31, 49, 44,106,210, 72, 49,175, 26,134,181,101, 90, 91,254,230,197, 3,254,195,231,158,229, 11,207, 93,231,109, - 15, 94, 36, 22, 48,156,230,100,145,194, 90, 27,236, 90, 11, 65, 81,155, 63, 44, 91,107, 26,206, 44,173, 20, 56, 23,178,148,165, - 12,106,107, 2,167, 92,181, 21,176,148, 26,133, 39,137, 99,192,211,233,118,233,100, 9, 73,183, 75, 28, 69, 36,177, 10,246, 58, - 28, 73, 36, 73,179,152,172,219, 33, 74, 19,226, 36, 67, 41, 77, 85,220,164,202,131, 47, 52,210, 49, 81, 27,142,160,100, 56,192, -227, 52, 69,199, 17,113, 18, 33, 37,216, 38,132,161, 52,141, 9, 52,169, 88,243,129, 39, 95, 36,213, 42, 68,180,202,246,115,108, - 43, 48,219, 42, 76,172,135,123, 79,173,209,215,158,243, 43, 25, 47, 29, 78,168,139,156, 94, 44, 67,229,109, 12,222, 52, 72, 9, -145,148, 40, 21, 70, 0,162, 37,147, 45,152,225,214,216,118,110,232,131, 88,201,187,208, 5,105, 59, 40,161, 66,113, 88,231,169, -138,154,249,100, 74, 81, 84,225,226, 86, 7,112,207,104, 50,225, 63,126,254, 41, 62,244,249,167,121,122,239,152,126, 26,161,149, -228,117, 61,184,124,240, 84,176, 66,106, 17, 0, 38, 11,101,151, 18,109,182,243, 34, 17, 74,180,110, 41, 25, 80,148, 8, 50,103, -121, 65,172, 96,157, 39, 55, 14,173, 66, 42,184,240,158, 72,122, 20,158,157,113,206, 44, 47,112,222, 98, 29, 52,166,230,204,218, - 10,169,146,228, 85,131,245,142,198, 58,242,202,160,148, 70, 73, 69, 89,134, 92,233, 52, 73, 16, 66,144,215, 13,149, 49, 88,130, -120,206,249,182,231,236, 44, 90, 8, 34,165,112, 62, 0,144,186, 89,140,107,106,238,189,253, 62,206,172,159,162,147,198,172,116, -186,220,247,224, 93,156,190,208, 33,223,185,202,141, 63,249,237,101, 70,249,162,230,110, 83,102, 91, 20,171,248,134,249,184,229, -150, 84, 54, 47, 2,153,107, 33,140,187,101,206,237, 57, 49, 97, 44,198,109, 39, 24,209, 5, 8,177, 77, 82, 19, 39,169,108,254, -150, 8, 87,111,218,139,191,227,150, 80,162,197,252,188,125, 75, 45,231, 93,184,147, 96,153,133, 74, 92,200, 32,178,148, 26,122, -247,125, 11, 43,175,124, 3,206, 26,168,115,188,148,216,217,144,106,114,136,169, 74, 76,213, 80, 77, 70, 1, 82, 84, 86,152,124, -134,169, 13,217,230, 57,170,124,198,238,147, 95, 96,239,171, 79, 48, 59, 58,166,202, 75,154,188, 33, 74, 4, 43,171, 25, 49, 13, - 23, 46,245,136,149, 33,203, 52,189,174,132,166,166,183,158,145,104,193,160, 23,227,202,154, 78,228, 24,172,199, 36,137, 66,120, -232,247, 18, 18,229,233,119, 97,125, 35, 33,138, 37,162,105, 88, 93,141, 73, 19, 65,150, 10, 38,195,146,186,178, 28,190,248, 60, -219, 47,187,171,157, 45,180,128, 31, 23,184, 24, 33, 51,194, 33,116,140, 43, 75,164, 14, 22, 84,107,170,150,244, 25, 4,155, 74, -106,172,151, 76,174,189,192,100,103,135,211,151, 46, 96, 77,195,193,254, 30,194, 26,242, 89,201,141,131, 33, 47,237, 29, 51,175, - 13, 71,243,130,113,217,112, 92,213, 84,198, 97, 60, 52,158,160, 61,104,193, 44,165, 49,148,141,165, 52, 1, 30, 37,219,239, 96, -162, 3,135, 63,177, 5,103, 55, 78,177,185,117,158,184,219,199, 10, 73, 93,214,140,166, 51,174,237,238,112,126,251, 20, 82, 39, -172,244,187, 28, 28, 13, 41,173,194, 84, 37,123, 55,175,113,249,226, 54,195,241,136,166,168,216,218, 26,208, 79, 28, 15,221,255, - 38, 62,255,197,207,176,210, 95,225,220,165, 7,185,237,212, 25,174, 63,247,105, 86,157, 65,227, 57,155,106, 82, 47,136,156, 35, -139, 36,131,243,167,137,215,215,153,125,233, 10, 23,223,244,102,110,220,156,208,137, 5,101, 94,115,148, 87, 28,238,239, 80, 25, - 79,175, 27,179, 63,173,136, 35,197, 90, 47,102,146, 27,102, 70,240,186,119,253, 48,207,124,232,253, 97,228, 7,120,175,120,121, -214,208,145,142,124,178, 79,114,238,213,108,157, 61,197,100, 60,167, 46, 11, 78,157, 57,203,206, 75,215,217, 58,127,134,227,253, - 3,202,202, 49,154,140,137, 84,130, 23, 21,249,108, 78,182,174,240,133,102, 52, 25, 50,172,230, 8, 39, 89, 95,233,227,242,140, -170,178, 28,149, 7,236,205,135,100, 50,163,168, 74, 10,103, 2, 86,155, 6, 47, 60, 85,109, 25,153, 81,123,209, 21,156,238,247, - 72, 84, 66,213, 52, 28,149, 51,148,215,236, 76,231,244,163,140,181, 30,104, 17,113, 56,159,160, 69, 28, 96, 65,102, 70,170, 18, -188,144,173,248, 14,238,220, 24,160,222,241,178,211,239, 59,115,122,155, 65, 55,229,175,158,124,142,207,237, 15, 89, 83,138,251, -207,172, 81, 57,201,106,191, 75, 51,159,147, 31, 28, 45,131,194,150, 43, 90, 44,211,151, 79,200,178,237,173,219,121, 88,187,255, -229,124,224,153, 33,231,187,130,103,118,135,188,180,127,204, 35,179, 29,182,175,125, 25,135, 68, 88,207,224,155, 94,203,255,176, -171, 24, 63,247,117,110,219,121,134,189,233,132,104,109,147,157, 89,197, 74,191,199, 61,219,171, 92, 58,181,194,165,205, 1, 15, -156, 94,227,225, 75,103, 72,234, 33,117, 62,100,101, 48, 8, 2, 15, 33,104,170,146,178,106, 16,206,163,188,131,186, 9,115, 59, - 88,122,158, 77, 19,216,233, 18,143, 86, 17,107,171, 61,206,157, 94,227,244, 74,135,245, 68,161, 27,195, 56,175,153, 3, 29, 45, -233,105,201,184, 52,252,230,231,158, 99,247,120,196, 91,238, 61,207,164,168, 9, 38, 35,219,146,139, 78, 2, 90,228, 2, 3, 43, -229,137,176,199, 59,104,154, 16,141,110,220,210, 59,233, 26,131,214, 26,209,250,232,165, 86,193, 74,227, 66, 43, 95,223, 74,210, -194,163,180,250, 70, 47,177,247,204,199, 19,240, 5,163,227,171, 72, 17, 2, 33,108, 99, 65,171,165,106, 28, 1,174,110, 78, 34, - 47, 91, 17, 83, 80,226,134, 47, 83, 63,139,249,200,151, 94, 36,211, 10,169, 90,146, 87,251, 58, 11,107,145, 16, 2, 45, 52, 15, -175,167, 12, 18,205, 90, 22,113,182,151, 6,230, 71,221,144, 70, 26,173, 36, 90,171, 54,186, 55, 0,102,156,181,248,198,134, 56, - 90,235,176,110,145,186, 6,166,170, 49,206,227, 27,139,177,134,170,170, 40,203,154,162, 40,153, 23, 37,101, 17, 66, 35,106, 99, - 41,170,154,225,116,206,147,215, 15,248,237,207, 61,197, 95, 61,183,195,172,170,201,226,136, 88, 5,120,135,117,240,222,179,154, - 76,130,214,242, 36, 32, 28,240,173,222,193,138,240,247,181,214, 47,219,195,139,239,178,243,193, 77,112, 62, 50, 60,103, 51,172, - 11, 80, 36, 5,120,111, 73,149,194,123,207,193,120,142,181,150,188,108,176,206, 49,154, 87, 92, 88,239, 81,153,160,242,118,173, - 7,212, 24, 67,154, 40,226, 56,162, 40, 10, 34,173, 66,104, 17, 80,213, 13,206, 7, 22, 65,109, 2,227,189,117, 37, 6,139,165, -115,225,178,167, 21,117,211, 32,132,103,144,116, 89, 77, 58,188,226,129, 7,120,228,251,222,192,250,118, 2, 2,158,253,223,126, -129,252,230,243,203, 51, 51, 28,208,225,247, 81,203, 17, 3,203,207, 20, 23, 32, 25,126,249,179,126,121,192,123, 43,194,154,241, -254,196,151,126,130,114, 71,222, 10,128,243, 39, 57,216,170, 93,243, 11,229, 60,237, 76,125,153,139,189,248, 28,236, 55, 42,224, -189, 59,201,195,110, 49, 12,225,192,111, 78,218,247,139,215,114, 30,186,119,220, 75,255,222, 7, 17,102,142,175, 10,108, 85, 97, -170,130,166, 40,176,182, 14,109,103, 3,229,228,144,122, 54,195,202, 4,157,246, 56,124,225,235, 60,243, 87,127,206,252,240,144, -249,104,136, 4,250, 29,197,217,179, 25,107, 43,138, 44, 19, 68, 90, 32,133,110,137,141,224,156, 14,126,246,218, 18,175, 12, 48, -101, 73,210,139, 73, 6,221,214,150, 25,230,193, 90, 75,178,126,130,212, 17,211,131, 41,120,200,186, 49,117,105, 66,124,116, 28, -147, 68, 96,171,146,233,216,144, 31,239,210, 63,125, 26, 41, 90,135, 71,148,224,165,196,215, 21, 58,206, 66,122,153,142,112,206, -162,226, 4,172, 65,199, 25,222,134, 11,175,140,123,140,119,119,185,246,228,227, 12, 58,154,193,230, 38,135, 55,110,114,227,230, - 17, 55, 14,167,188,112, 52,227, 96, 94, 49,171, 45,123,243,146,113,105, 40,141,197,180,151,116, 99,109,160,119, 6,145, 11,181, -179, 40, 41,241, 94,208, 88, 71, 39,137, 88,237, 36, 40, 33,169, 77,232,160, 37,113, 4,243, 99,100,127, 64, 28, 71,212,214, 82, -214, 51,168,115,182,215, 87,216, 59, 58,100,115,125,192,254,241,152,170,246,116,211,136,201,112,143,157,253, 3,180, 52,156,219, -222, 96, 56,157, 50,158, 85,244, 98,205,230,170,226,237,223,247,247,168, 26,201,245,155, 59,236, 28,231,124,215, 27,223,194, 87, - 63,251,103, 92,236,119, 89,143, 37,171,189, 20, 29,105,180,247,108,158,217, 68,119, 7,248,221, 33,167,222,240,157,188,120,117, -140,144,112,115,239, 38, 43, 89,196,254,222, 14,171,157, 20,109,115, 98, 29,209,235,245, 56,181, 30, 35,189,103,181,167,153,161, -120,249, 59,254, 22, 47,252,222, 7,131, 2, 94, 90, 82,239, 22,174, 74,142,163,117, 78,223,118, 27, 85, 61, 99, 54, 42,168,108, - 73,154, 38, 12, 71, 67,226,158, 39,138, 18,154,178,102, 56, 30,179,186,217, 97, 58, 44,241, 77,132,143,107,170,194, 97,156,160, -147, 36,236, 21,199,220,121,231, 22,199,163, 10,239, 36,133,157, 97, 81,164, 58, 65, 8,137,206,102,100, 73,204,225,100,200,126, -121,128,150, 17,131, 56, 99,173,155,209,233, 6,157,205,184,204, 41,155, 2, 41, 52,206, 91, 6,137, 36,209,130,227,162,192, 88, -219,142,188, 45, 18,205, 86, 47, 35,146, 26,111, 21, 86, 52,204, 75,208, 85,210,225,153,155,135,108,108, 12,216,153,228,212,214, -243,210,164, 96, 52, 47,121,106,255, 25,148, 82,108,221,119, 31,199,207, 60, 19,132, 70,183, 36, 48, 45,111,241,136,147, 22,253, -130, 26,229,224,175,229, 6,159,249,250, 23,137,210,138,239,136, 75,214, 34,255, 13, 49,163,151,126,224,111,241,159,191,240, 28, -159,252,242,215,248,240, 29, 49, 10,199,157,179, 29,110,228, 67,234, 83,151,217, 94, 27,112,126,165,199,122, 26,177, 50, 57,194, -124,226,147,152, 50,167,115,241, 34,245,197, 75,124,255,175,125,136,126,172,121,213,109, 91,188,233,254, 75, 92,222, 90, 67, 71, -146, 44,137,192,123,140,113, 20, 77,168, 72,105, 43, 23,225, 91,176,137, 11,106,106,103, 29,157, 36,230,210,217, 45, 46,108,175, -241,173,211,130,159,250,227, 47,177,145,106, 12,225, 0, 88,137, 20,143,190,120,204, 95,255,214,163,124,248,157,175,194,233,240, -133,215,145, 11, 2, 18,123,114,152,139,182,177, 37,151,241,145, 44,209,167, 90,122,106,239,177,141,197, 9,133, 49, 37,198,216, - 80,173,107, 21,152,203,197, 28,111, 67, 16, 73,148,132, 10, 59, 4,108,132, 67,223,122,143, 45,231,228,243,130,186,170,112,245, - 14, 90, 36, 32, 61, 90,197,161,157,105, 67,224, 11, 4,193, 18, 74,133,249,160,103,233,163,199, 75, 36,150, 88,192,213,163,233, - 73,186,150,151, 24,104, 85,208, 98,137, 35,137,148, 32, 85,154,215,220,113,138,162,177,100,113, 20,222, 19,158, 88,105,188,244, - 96, 29,166,106,176,141, 67,171,197,140,181, 85,236,123,217, 86,228,150,198,186,165, 72,174,106,106,154, 42, 8, 62, 68, 27, 49, - 42,148, 8,155, 29, 81, 80,147,123, 79,164, 12, 23, 55,215,248,183,159,252, 58,171,169,102, 32,195, 88, 96, 97,153, 82, 66, 16, -197,138,245, 88,225,112,212,141, 67, 70, 2,237, 85,232,168,180, 34, 66, 33, 5,214,123,164,110,201,104, 1,238, 30,148,216, 46, - 4,152,116,235, 25,119,235,148,167,125, 74, 89,214,116,180, 34,150,146, 94, 44,136,188,230,238,173, 62,166,169,201,171,134,198, - 52,100,113,151,235,135,199,156,223, 62,139, 55,150, 36, 86,164, 89, 76, 83,215,225,194,105, 13,105,150,210,212,205, 50,253, 80, - 9,137,214, 34, 96, 60,105, 72,163,136,121, 85, 83,153, 6,235, 53, 37,150,110,146,224,157, 35,214, 49,175,184,243, 97,190,237, -117,111,228,117,111,248, 22,146, 21, 77, 83,148,204, 84, 77,210, 84, 28,126,246,163, 45,245,241, 22,107, 90, 59,192,182, 45, 97, -144,101,164, 67, 96, 1,208, 70,135, 10, 68, 64, 40, 59,183,172,200,157,240,203, 52, 53,121, 75, 4,107,235,186, 97,241,148,246, -150,214,188, 17,254,196,234,182, 24,191, 44, 42,117, 1, 77,221,114, 1,190,129, 43,223,210, 8,219,199,120, 31,198, 14, 65,112, -218,238, 53, 46,164,196, 73, 5, 42,237,130,200, 0,141,183, 5,214, 26, 92, 99,104,230,163,208, 37, 52,130,114, 54,165,154, 77, -208, 73, 15,209, 84,204,255,127,198,222, 51,198,178, 52,189,239,251,189,225,132, 27, 43, 87,117,117,156,153,157,176, 51,228, 70, -114,185, 32,119, 73,237,146, 10, 54, 73, 16,150, 41,138, 38, 8, 75,176, 44,128,176, 45,152, 95,228, 15,134,236, 47, 14,132,224, - 4,138,146, 41,201,166, 1, 38, 88, 6, 37, 80, 98, 16,204,180, 36,119,185, 75,114, 3,185,105,118,114,232,158, 14, 85, 93,249, -166,115,207, 57,111,242,135,247,189, 97,150, 48,236, 30, 96,186, 81,221, 85,117,235,158,115,222,231,121,254,207, 63,140,231,156, -125,249,139,156,189,249, 38, 90, 40,100, 30, 53,192,189, 50,122,203, 95, 93, 76,209, 69, 39, 6,156, 76,106,242, 1,100, 10, 76, - 29, 80,170,193, 26,152,207,230,108,170, 28,215, 66,125, 57,167, 28, 6,132,131, 16, 36,189, 65,142,169, 45,161,245,180,141,161, -110, 3,189, 66,115, 53,242, 88, 39,153,207,107, 70,213,148, 96, 49,152, 36, 0, 0, 32, 0, 73, 68, 65, 84,178, 44, 33,128, 6, -154,139, 43, 94,253,157,223,225,230, 7,158,103,120,227, 73,122, 91, 57,152, 22,153,119,240,206,160,179,156,224, 13, 82,119,112, -198,197,100, 56, 51,143,103,172,212,248,118,134, 8,150,147,135, 39, 28,126,228, 91, 40, 50,197,239,126,238, 27, 60,106, 98, 99, -104, 66,252,125,230, 29,185,202,232,228,209,231,162, 50, 81, 37,147, 73, 13, 66,144,105,137,150, 26, 45, 5,211,214,224,129, 77, - 85, 82,230,154, 78,166,201,179,140,190, 53,137,228,107,113,121, 73,247,226, 62,199,189, 27,152, 16, 48, 22,182,250, 37,168,104, -188, 51,157,205,209, 4, 58,133,224,248,232, 46,103, 23, 99, 62,244,236, 13,246,246,250, 84, 77,205,238,193, 30, 15,143, 78, 49, -141, 33, 47, 58,228,121,203, 39, 62,250,126,254,202,199,190,147, 63,127,241, 21,142,143,207,185,211,209,116,132,199,181, 30,223, - 56,124, 38, 17,153,198, 77,231,132,254, 12,217,235, 70, 95,143, 0,151,163, 41,211,185, 97,124, 81,113,239,254, 49, 95,121,249, - 1, 91, 91,219,252,149, 79,124, 23, 27, 5,152, 22, 90,111,120,116, 50,229,246,193, 6, 87,253, 62, 31,248,201,127,192,151,127, -250,191,199,165,227,205, 6,208, 66,243, 83,159,254, 93,254,229, 7, 63,201,219, 47,191,193,193,205, 91,140, 46,198,212, 77, 69, - 87,111, 83,208,229,244,244, 8,219,194,222,206, 22,247,222, 60, 65, 40,199,233,116,204,118,103,200,230,102,143,250,212,208,248, - 25,130,154, 55, 31,188,193,216, 7, 14,251, 7,204,236, 12, 41,114,230,182, 66,235,128,240, 37,143, 70,231, 56, 15,154, 12, 21, - 36,141,109,217,144,154,249, 60, 32,136, 50,233, 92,101, 20, 42, 71, 16, 19, 34,223, 30,157, 33, 4,116,101, 73, 47, 69,242,206, -109, 77,213, 56,118, 7, 25, 77,235, 49,198,147,103,160,127,238, 51, 47,242, 83, 63,250,239, 32,148,226,112,208,103,167, 51,166, - 65,240, 91,223,120,135, 31,255,203,223,197,191,253,163, 63,227, 71, 63,249, 97, 42,183, 92,181, 46,137, 51, 36,105,208,210, 23, -101,241,144, 91,207,240,217,231,248,244,139,175,243, 83, 59,147, 4, 73, 67,147, 32, 78,137,162,119,109,143,119,190,242, 53, 62, - 52, 40,249,169, 59, 3,138,155, 55,104,239,191, 65, 0,110,216, 57,215, 31,189, 4, 15,211, 33, 4,204,211,132,233, 29,132,183, -238, 17,222,184,203,158, 82,140,157,231,183, 94,121,192,191,122,241,254,146, 86,179, 85,104, 10, 37,248,192,225, 38, 47, 28,108, -242, 29, 79, 92,163, 95,228,116,202, 12, 21, 52, 99,219,208, 54, 6,188, 67, 46,116,224, 33,122,114,239,110,246,150,208,159, 64, - 96, 67, 52,209, 40,149,192, 35,248,137, 95,251, 50,255,221,119, 63, 77,111,216,167,231, 59, 75, 31, 77,111,147,255,186,140,134, - 22, 34, 37, 84, 41,169,162,213,110, 34, 20,134,214,198,108, 99, 29, 13,113,250,131, 33,117, 53, 37,184,150,121, 93, 83,118,250, -204,171, 41,214,212,136, 76,209, 41, 59,232, 34, 67,201,140,166,154,226,133, 98,107, 48, 96, 58, 57,167,163,107,122,221, 97,154, -192, 3, 14,207,172,137,246,143,190,170,227,100,152,103,177, 64, 10,145,244,186,177,248,122, 31,137, 56, 27,253, 30,191,241,135, - 95,163,151,165,168, 74,191,130,223,150, 80,170,140, 48,118,235, 60,215,247,119,152,183, 22, 37,245, 18, 86, 95, 28,210,113,255, -158, 26,166, 32, 81, 11,221,191, 90,145,232,252, 34,130,214, 5,164, 8,116,242,146, 94, 25, 63,110, 83, 1,208, 82, 46,227, 21, -189,139,164,187,188, 44,249,227, 55, 30, 44,229, 86, 97, 57, 5,198,198, 75, 34,216, 43, 20,222,184,232,175,173, 5,194, 11,188, - 12,132, 54,160, 11,181,220,253, 74,145, 24, 89, 74,196,200, 96, 45, 86,177,142, 38,190,206, 15,203, 83,102,157, 59, 60,152,182, - 92,140, 3, 87, 34,208, 17, 27, 12, 59,154,107, 27, 5, 23,211,146,203,241,140,169, 16, 12,123, 3,142, 46,207,121,242,154,167, -241,158,100,178, 71,145, 69,180,196,152, 24,185,218, 41,115,230,141,139, 70, 70, 74,161,165,100, 92,213,108,111,244, 24,205, 42, -110, 31, 30,242,232,241, 9, 90, 70,232,125,107,235,144,167,111,189,159,253,193,144, 23, 94,120,158,155,215,247, 48,110,194,134, -188, 67,222, 53, 20,206,114,244, 59,255, 50, 78,216, 42,196, 61,245,186,174, 92, 45,118,209,139,132,171, 68, 56, 12,139, 92, 0, -191, 42,214, 11, 35,163,119,201,216, 22,156,131,149,227, 92,240, 41,145,109,137, 10,176,148,176,173,112,247, 85,147,239,151,134, -112, 17, 29,201,178, 24,246, 18,117,248,169,145,244, 81, 46, 23, 29, 87, 5,214,166, 6,192, 38, 41,173, 76,177,173,245,140,249, -189,175,224,235, 9,184,121,244,100,168,174, 16, 65,210,206,166, 52,117,154,110, 76, 75,109, 42,108, 40,184,184,255, 58,199, 47, -125,131,126, 47, 71, 43,135,171, 91,202, 94,129,148, 57,179,139, 57,251,195,146,250,106,140, 14, 53,123,101, 73,115,117, 70,222, - 43, 35,148,111, 29, 50,120,230, 86,210,220,171,200,164, 66, 58,197,124, 30, 80, 2,154,198,113,117,217,198,128,167,243, 57, 69, -167,196, 9,193,168,110, 56,191,170,105,173,195,122,199,238,176,192,155,134, 94, 55,227,106,220,240,250,209,132,219, 7,125,202, -151, 94,197,163,144, 50, 39, 43, 52, 42, 19, 41, 82, 57,146, 75, 69, 30, 39,121,231,106,100,158, 19, 42, 19,209, 47,111,233, 12, - 6, 12,118,182,153, 94, 94, 97,174, 95,227,112,103,128, 25,213, 52,198, 49, 49,150,218, 5,246,203, 18,143,136, 80,123, 0, 41, -212,114, 45,162, 51,193, 86,191,207,172,110, 56,158, 84, 20, 74,211, 43,115,106,103,176,206, 51,246, 13,147,209,132,126,158,163, -148, 36,211,154, 97,161, 9,206,115,125,144, 51,170, 13,151,109,195,188,201,152, 28, 95,209, 41, 11,174, 46,175,200,139, 30, 82, - 79,121,234,230, 13,170,214, 49,170, 45,123, 10,118,134, 57,165, 86,220, 57,220,230,114, 60, 3, 17,152, 91,207,236,178,198, 52, - 35, 58,189, 33,207, 62,123,131, 63,253, 12,108,119, 10, 74, 2,173,117, 20, 78,163, 92, 92,185,137,198, 32, 58, 37, 8, 73,219, - 90, 76,109,121,227,209,140,251,175,189,130, 55,151,216,186,230,224,233, 59,108,170,138, 65,103, 11,235, 12,123, 91, 61,130, 82, - 76,230, 13,179, 22, 94,248,196, 95,230,203,255,244,127,193, 87,213,242,254,181, 24,156,135, 95,254,195, 95,224,199, 62,241,183, -248,202, 87,254,140,178,200,217, 63,216,231,232,222, 25, 35,123,193, 86,119,155,251,151,199,100,189,156,126,217,197, 4, 79,107, -102,248, 60,112,122,117,193,185,157,112,189,123, 8,149,230,106,100,152,217, 41,247,253, 17,221,188,135,214, 30,193,144,139,217, - 57,175,158,127,157,219,189,167,232,103,201, 91, 3, 79,161, 50, 94,122,124,143,110, 54,160,163, 21,115, 87,179, 87,238, 48,109, -199, 12,203, 30,243, 6,114,169,232,170, 14,165, 46, 40,114, 79, 33, 20,231,205,148, 78, 40,208,114,147, 11,123,197, 97,103, 31, - 23, 26,244,199,159, 60,224,236,242, 10,239,174,241,141,243, 49,231,115,131, 2, 62,121,103,135, 87,239, 31, 49,113,150,135, 15, -207,169, 2,204,109,146, 0,173,217,142, 71, 50,212, 34, 54, 47,186,174, 73,173,185,175, 55,121,120,122,202,249,208, 47, 55,117, -113,197, 28,232, 12, 59, 92, 77, 42,182,103, 45, 97,119,147,239,254,200,211, 76,103,134,226,253, 31,226,254,203, 47,211,206, 42, - 82,204,114,244, 91,111,109,108, 34,218,248,128, 11, 31,167,238,109, 5, 39,109,116, 65,218, 92, 60,248,137, 8, 53,247,129,223, -127,235,148,223,126,243, 20,254,248,245, 72,210, 2, 14,251, 5,127,253,153, 61,190,247,185,219,232, 82, 71, 91,210,228,183, 94, -100,138,174, 82,244,243, 56, 29,250, 0,150,176,204,227,149, 4,166, 14,254,203,207,190,201, 47,254,240, 71, 24,205, 42,116,166, - 80, 82,147,134, 95,132,147, 75, 94,129,148, 10,169, 2, 34,203,144, 34, 32,132,164, 44, 52, 54, 33, 5,101,145, 33,125,195,112, - 56,192, 57, 67,145,119,144, 42, 68, 35, 27,107,240, 77,197, 85, 53,161,219, 27,226, 77, 67,183,211,229,226,106,196,127,241,139, -191,202,171,231,147,248, 51, 9,216, 40, 52,251,189,146,103,118,135,124,252, 61,135,236,109,246,217, 26,246,201,148, 68, 38,104, -223,185,168, 19,175,109, 74,201, 74, 63,159, 0,222, 56,159, 80,234, 8, 45,187, 36,113,146,114,117,112,139, 4, 81, 91, 23,184, -172, 44,131,110,134, 32,114, 4, 98, 72, 68, 72,159,235, 8, 54, 26,222, 40, 25,187,233,152,152, 20, 8, 54,162, 12, 33,196, 41, - 39,134,184,136,101,178,156, 82,113, 15,239,146,166,125, 1,225, 7, 21,141,142,122,121,135,127,241,213,183, 25,230, 49,229,205, -133, 16,217,187, 41, 76, 68, 74,120,111,145,226,103, 67,252,249,156,243, 72, 98, 67,227,189,143, 19,159, 20,160, 3,194,199,160, - 14, 41, 37,206,196, 85,132,179, 81,225, 33,210,122,251,123,196, 17,191,162,247,160, 53,209,135,222, 25,240,146, 97,145,113,107, -216,227,168, 59,101, 82, 53, 40,225, 25,148, 5,151,227,105,242,140,119, 4, 33,177, 46,250,251,187, 0,219,131, 14,117,237,168, -154,154, 66, 65, 46, 53, 38,120,122,157, 46,179,105,205,147,215,159,230,124,116,198,118,255,128,110,145,211,235,245,217, 26,236, -240,236, 19,183,184,121,176,203,173, 59,135,108,237,247, 24,118, 54,217,217,183,204,231, 21,133,128,187,191,252, 63, 71, 95,130, - 69, 71,155,158,143,165, 42, 81, 71, 82,218, 10,119, 73, 10, 5,239,211, 20, 29,145, 14,145, 24, 68, 33,136,213, 84,239, 87,147, -185, 8, 43, 7, 64,155,144,249,133, 51,160, 84,105,109,144,234,191, 82, 97, 17, 58,152,154,189,152, 75, 40, 69,160, 49, 97,137, -154, 57, 27, 63, 55, 36, 4, 48, 57,236, 46, 19, 84,149,142, 67, 96, 76, 50, 76, 19,255,204,129,200,192, 55,120, 51,197, 25, 67, - 83,141,104,235, 22,111, 90,230,163, 75,130, 26, 82,238,223,228, 51, 63,255,243,248,227,123, 92, 43, 61, 91, 58,163,110,106,178, - 96, 80, 87,115,144,134,173,224, 81, 35, 65,185,216, 31,214, 45, 93, 13,180, 45, 42, 64, 39,139,207,113, 71,186, 20, 61,237,216, - 85,177,200,138, 0, 20,158,186, 5,131, 68,236,120, 26,107,104,230, 1,183,217,227,230,126,135, 76, 9, 76, 20,203,112,122,210, -208,214, 53, 85,235, 65, 42, 30, 93, 54,212,174, 98,243,236,203,220,120,230,136, 27,239,251, 16,253,162, 76,228,218, 16,145, 54, -239, 9,182, 69, 21,121,228,182,200,144,120, 65, 14,221,221,196,215, 21,146, 14,163,211, 83,180, 80,228, 90,225, 61, 12,181, 64, -155, 64,109, 61, 82, 75,186, 42,174, 17, 42, 99,201,181,102,103,216, 39,211,146,119,206, 46, 57,175, 26, 60,208,235, 20, 40, 1, -165,212, 52,196, 51,113,163,204, 41,180, 78, 22,200,241,222,200,242, 28, 49, 62, 39,219,186,201,205,110, 75,107, 97,236, 36, 42, -215, 20, 89, 70,219,204,168,102,158, 87,222,124,132,199, 48,175, 20,111,189,115,194, 19, 55,110,209,217,241, 4,165, 40,202, 30, -135, 91, 29, 26, 7, 15, 78, 4, 13, 57,253,174,160,223,237, 50, 28,116, 41,164,162, 80, 1,229, 2,166,106,144,133, 38, 43, 53, - 97,102, 40,222,251, 28,147, 81,195,217,168,166,154, 92,114,118,113, 74,183,107, 25,159,143,216,234,151,200, 96, 80,120, 50,237, -113, 6,102,227, 10, 93,104,118,119,123,145, 44,236, 37, 31,250,207,254, 62, 95,248, 31,255,155, 72, 34, 77,125,232,123,202,130, -127,246,165, 63,231,111,124,252,251,185,118,120,192,213,213,152,199,199, 71,168, 60,199,212, 45,199,211, 83,114, 85,226,108,205, -227,217, 21,219,221, 14, 79,238,236,240,198,217, 99,164, 44, 56,232,110,240,120,122,204, 70,103, 72,225, 2, 90,149, 92,213, 21, -186,212,132,144, 97,204,156, 65,161,233,214, 61, 6,185, 70,101,158,110, 54,224,104,122,193,173, 97,206,101,221,163,167, 51,114, -153,225,149, 71, 98, 24,228, 69,228,111, 17,200,101, 70,169, 36,131,142, 39,151,154,135,227, 17, 90, 68,159,255, 71,151, 19,114, -169,177, 97, 70, 38, 75,244, 78,175,207,193,181,107,252,227,127,243, 41, 6,133, 96, 43, 83, 52,214,243,184, 17, 60,165,115, 62, -241,225,247,243,226,231, 62,139,180, 44,189,201,125, 8, 81,115, 41, 67, 60, 27, 76,124,128, 77,128, 66, 56,254,198,223,253, 17, - 70, 95,125,137, 79,124,242, 54,199,243, 3,142,206,175, 24,108, 14,184,254,220, 83, 28, 8, 75,171,186,100,155,123,252,210, 63, -249,231,124, 84, 43,132,243,184, 60,167, 23,106,158,120,239,211, 75, 40,120,120,243, 26,191,252,171,159,227,227, 31,250, 48, 95, -255,226,231,145, 2, 84,202, 66,151,192,199,114,207, 43,141, 88,134,160,248, 37, 73, 39, 22,143, 92, 10,242,181, 32,168, 16, 2, - 15,167, 13, 63,243,229, 7,252,204,151, 31,240, 19, 47, 28,240,253,223,122,135,121, 99,200,180,166,204, 20, 66, 36, 23, 57,151, -108, 46,223,237,191, 17, 53,209,214,243, 3,255,231,159,240,111,126,244,163,244,178, 12, 27, 92,218, 9, 10,132,136,187,111,161, - 98,168,130, 13, 2, 23,162, 91, 26, 50, 18,180,202, 76, 97,172,197,154,150,217,188, 66,138, 10,149,201,232, 72,214,122,138, 60, -103,208, 45,144,178,160,109, 45,243,209, 5,156, 60,230, 51,175,188,201, 63,188, 95, 49,204, 37, 27,185, 90,238, 44,141,247,220, - 27,205,120,245, 98,202,175,191,250,232,155, 52,230,138, 92, 41,158,223, 29,240,220,181, 77, 62,254,212, 33, 91,219, 27, 24,153, - 17,106,147,148, 12, 62, 38,170, 45,172, 57,137,123, 97, 23, 22, 44,228,216,144,117,181,224,127,253,131, 23,249,169,127,239,163, -156,141,167,209, 19, 63,133,111, 68,105,146,194,137,136,199, 70, 67,146,248, 96,197, 41,221, 39, 34,161,136,147, 59, 2,161,228, -178, 9, 11, 8,124,146,220, 44, 24, 88, 62, 56,164, 44, 24,246, 11,254,236,222,163,168,147, 94,196, 1, 39, 46, 71, 36,244, 8, -122, 90,241,124, 87, 36,147,164,232,219, 46, 23,190,207, 58, 78,135, 50, 21,155,104, 77,224, 35,107,216,249,104,118,146,194, 99, -228, 66,228, 33, 4,189,219, 79,240,239,254,249,203,252,250,240, 54,210, 24,142, 47, 43,122, 90,178,211, 41,144, 67,199,197,222, -128,171,170,193,121, 73,169, 51, 26,211,198,125,163, 15,200, 96,240, 66, 98,210,168, 42, 5, 20,153,160,200, 98,142,183, 84, 34, -238,141, 69, 96,119,123,139,139,241, 21, 79,221,124,129, 7,231, 21,251,251, 59,104,225, 24, 12, 55,217,221,223,161, 59, 24,114, -176,155, 51,232, 14, 25, 94,147,204, 47,198,200,174,231,141,127,241, 51,145, 8,183,220,111, 7,132, 93, 16,225,226,234,229, 93, - 94,234, 33,238,175,227, 30, 61, 69,152,134,176,102,247, 42,214,164,110, 43, 13,185,124,215, 14,124, 97,126,180,246, 76,172, 37, -173, 5, 34, 43,158,212, 24, 70,136, 63, 90,193,134, 16, 61,228, 67,186,159,130,128, 96,211,215,138,181, 46,249, 19,196,201,221, -154,200, 39, 83, 33,250, 11,196,191,148, 4,107,161,157, 99,167, 99,124,107,177,243, 6, 91,215,180,179,105,204, 58,232, 12,249, -244, 47,254, 50,217,213, 49,223, 58,152,196,198,101, 60,141,197, 91,130,200, 98,216, 17, 90, 98, 76, 68, 5, 98, 51,146,116,251, -137,219,176,104,150, 22,206,120,113, 75,225,215,108,241, 5,185, 14,228,137, 40,176,171, 5,147,155,183,120,243,254, 25, 18,131, -207, 37,214,120,156, 20,156,143, 90,174, 90,143,117, 2, 21, 34, 87, 98,103,187, 71, 57,232,113,122, 60,163, 24,188,141,200, 11, -134, 59,187,132,224, 16, 42,143, 77,104, 46, 9,198, 18,156, 65,138, 16,109,184,123, 3,236,124, 78,127,107, 64, 38, 3,243,217, -140,218, 58,246, 54,186,100,121, 78,221, 24, 38,181, 89, 94, 83,227, 19,129,222, 7,178, 60,163,219,237,128,210,228, 74,113,163, - 53,209, 9, 79,169, 24, 17, 12, 84, 77, 75,109, 93,242,188,144, 12,180, 66,167, 6, 80,105, 73, 41, 3, 46, 11,156, 95, 25,106, - 99,233,150, 29,166,117,139,111, 44, 27,195, 46, 77,219,240,204,147,251,156,158, 92,209, 56, 79,230, 21, 1,199,241,197,148, 97, -167,160,223,203,113,120, 30,157, 53,204,106, 65,167,219,167, 91, 72,166,179, 49,147,121,197, 86,209,163,200, 21,193, 5,118,186, - 61,118, 95,184, 67,214,217,160,208, 61,228,238, 22,223,120,253,146, 94,230, 49, 74, 82, 29,191,193,241,201,107, 28,238,238,144, - 23, 25, 55,183, 10, 10, 37,169,166, 83, 26, 11,206,100, 20, 54,199,247, 51,156, 53, 76, 38,129,195, 15,126,219, 18,177, 90, 72, - 45,159,208,134,175,170,130,191,251,191,255, 35,254,241,143,252, 61,238,142, 47,200,116, 78, 85, 89, 6,131, 46, 94,102,156,159, - 92, 50,169, 12,131, 28, 46,231,134,142,174,177, 4,250, 82,224,131,229,172,154,128,147,140,204,156,218,215, 88,103,226, 46,222, -205, 9, 65, 50,171, 27,118,179, 33, 71,213, 49,133, 84,220,222,220, 66,166,243,123,144,119, 0,207,245, 93,205,209, 69, 14, 78, -112, 92, 95,162, 5, 40, 20,187,157, 1, 85, 91, 99,140,226,168,185, 98,160, 59, 84,205,140, 27,189, 45,242, 44,227,222,165, 97, -208,201,105,141, 71,119,132,229,242,193,219, 60,189, 81, 80,202,125,222,183,215,231, 98,214,240,225,155,219, 60,185, 59,100,124, -244,128, 34, 88,198, 11, 15,104,214,117,164,177,176, 19, 4,173,143,109,207,214,238, 22,125,209,208,249,192,211,144,229,108, 74, -201,243, 69, 1, 90,227,172, 99,126,255,156,199,175,190,202,141,239,216, 97,112,243, 22,191,246,230, 59,104, 15,223,123,176,201, -145,202,232,110,148,232, 60,231,205,139, 25,213,189, 83,126,240,125,135,252,254, 27, 15,121,230,219, 63,194, 31,254,233, 23, 48, - 46, 78,204, 66, 64,129,163, 43, 53,149, 95,249, 81, 47,109,126,215,236, 46,229,162,224, 11, 65, 38, 23, 5, 7,190,114,217, 32, -191,241,144, 31,248,200,243,252,225,215,223, 98,100, 26,254,234,115,183,150,187, 61, 23,194,242,162,175,162, 46,226,231,239,228, -154,191,249, 43, 95,164,159, 9, 42, 23, 73,115, 54,188,219,180,197, 3,255,219,181,140,162,208,209,117,174,219, 65,117, 10,178, -110, 23, 61,232,147, 23, 25,253,188, 36,151,150,151, 46, 26, 90, 23, 53,241,247, 70, 51, 62,253,230, 17,199,211,154,202, 4, 62, -214, 21,252,205, 13,216, 11,176,145,107,220,194, 23, 61,125, 15,153,138, 92, 39, 25,116, 44, 62,102, 3, 24,231,105,172,231,115, -247,207,249,236,253,115,254,143, 47,190, 73, 33,225,187,111,108,242,125,207,220, 96,119,107,128, 73,185,237,139,139,235,136,144, -183,100,193,126, 15,100,233,189, 56,153,205,121,233,193, 9,207, 28,110,209,186, 16,175, 5, 2,239, 18,166, 26, 34,178,177,176, - 14, 85, 16,215, 17, 90, 69, 56, 62, 77,230, 54, 56,100,154,212,145,130,186,141,144,161, 34,160, 69,108,174,130, 3,113,239,117, -234,203, 49, 63,123,119,198, 48,139,254,231,137,194,144,118,211,130, 28, 65, 38, 21,251, 68,247, 58, 37, 3,198, 64,150, 69,126, -135, 49,209,235, 31, 4, 74, 69,175, 5, 73,188,198,107, 33, 97, 32, 2, 54, 77,233,229,225, 77, 46, 79,207,105,166, 45,223, 85, -156,242,105,177, 65,222, 52, 52,117,134,151,129, 94, 33,185,179,217,225,248,178,195,212,150,156, 92, 94,146,101, 29,130,143,105, -128,181,141,137,132,222, 47,140,236, 60,247, 38, 13,193,218,232,129, 96, 28,185,138,154,128,203,217,140, 82, 41,154,160,216,221, - 26, 80,148, 93,158,218,221, 98,115,103,147,155,123,219,108,110,118, 17,193,163,132, 66,183,115,102,174, 65,190,252, 58,143, 63, -243, 27,137, 39,145, 28,220, 18,210, 16,156, 79,206,121, 97, 89,132, 73, 50, 62,111, 83,144,138, 19,203,160,181,133,219,223,242, - 57, 89, 16,102, 18, 95,193,165, 68, 53,181,240, 17, 88, 16,235, 22,140,120,183,198,190, 88, 51,169,114,206, 35,149, 76, 95, 70, - 36,143,119,177, 10,133, 89,172, 79,210,173,231, 12,132, 4,201,167,237, 8, 88,176,137,239, 32,157,160,122,240, 70, 76, 79, 51, - 45, 88,131,171,167,216,121,133,157, 87,113,199,159,111,242,246,151,254,132,243, 7, 71,124,104, 27, 92,155,130,145, 68,140,196, -245, 62,114, 41, 22,238,119, 90,137,132,196, 69,216, 31, 9, 50,136,196, 59, 16,233,117, 36, 50,223,178,203, 93, 52, 62, 34,161, -113,130,157, 23,174,211,182,125, 30,156, 84, 96, 90, 92,153, 45, 3, 85,155,185, 71,105, 73,110, 64, 43,207,176, 83,146,119,114, -242,188,164, 40,186,140, 47,198, 60,120,229, 33,198, 8,204,211, 13,219,215,111,197,235,102, 91,112, 38,250,197,203, 2, 65, 75, -230, 90,130, 15,212,163, 75,154,113,197,222,243,207, 51,185,156,178,183, 51,196, 65,244,125,215,130, 65,174, 80, 89, 70,211, 90, -122, 90, 99, 67, 96, 50,111, 40,116,204,119, 55,245, 28,132, 35,242,111, 5, 33, 56, 50, 41,217, 30, 14, 80, 90, 49,111,154, 72, -168,243,158,198,218,229,110,197, 58,135,105, 44,123,237,152, 89,183, 79,215, 5,166,141,167,144,150,188,219, 35, 88,131,107, 26, -222,124,251, 17, 69, 81, 46,239,195,106,222,144,229,138,199,151, 45,131, 78,193,131,218,210, 45, 58, 12, 6, 29,202, 76, 50,157, - 54,220,184,126,200,231, 47,106, 62,124, 35,103, 54,155,179, 49,236, 50, 40, 36,221,205, 33,202,130,191,115,192,222, 51, 31,229, -143,127,239, 62,253,142,226,149,211, 11,218,233,155,220, 62,216,194,152,192,222,176,139, 48, 35, 6, 29, 65,211, 26, 70, 70,113, - 57,158,112,227,112,147,233,116, 70,161, 5,151, 99, 65,111,211, 83,110,237, 48, 59, 59, 95,214,179, 3, 29, 40,145,188, 51,155, -242,104,250, 58,153,206, 80, 90, 33,179,138,217,220,208,216,192,188,109,216,217, 29,112,124, 60, 99, 30, 26,174,239, 13, 56,153, - 84,244, 59, 37,199,211, 41, 79,244, 15, 57,105,174, 40, 85,142, 15, 45,150,140, 81,117, 74,153,117, 80,100, 92, 27,244, 25,205, - 27,138,224,168, 92,197, 43,231,143, 81, 40,206,199, 51,180,204, 57,173, 79, 25, 63,152,178, 93,246,152,184, 57,153,210,104, 52, - 61,149, 49,107, 91,140,183, 40,171,233,208, 37,120,201,110,177,201,104, 62, 99, 58,109,145,228,156, 76, 91,110,246,247,209, 23, -111,221,195,189,121,151,171, 0, 99, 34,220, 92, 0,231, 95, 31,241,226,215, 95, 66,231, 18,149, 11,122, 74,188, 43,129,105, 21, -185, 25,161,181, 82, 11,164,131,231,118, 6, 28,125,230, 75,244, 14,118, 16, 59, 27,200, 34,135,209,132,233,163, 51,142,207,174, -216,222, 57,224,252,238, 67, 58,252, 57, 31,123,223, 11,252,209,107,119,169, 28,124,237,157, 11, 14,180,228,147,147, 46,227,137, - 33,207, 37,131, 76,243,226,249,136,173,160, 57, 12,135,188, 60,143, 7,143, 92, 56,126, 6,248, 54,105,249, 90, 80,180, 74,160, -124,192, 9,193,101,235, 16, 33,234,252,114, 33,151, 30,214, 90,172, 24,185,173,247,124,219,193, 54,167, 87, 99,158,187,115,141, - 31,253,133, 79, 49, 11,129, 65, 57,228,102,175,228,203,231, 83,186, 42,237, 2, 89,139, 56, 79,144,183,245,129,173, 66,113,213, - 24,132,140, 83, 73,182, 30,116, 1,236,107,193,253,214,163, 77, 74, 20,155, 38,107, 72, 41,144,233, 32,150, 2,126,107,236,248, -253,234,221, 29, 65,169,162,212,108,187,212, 12, 10,129, 23,134, 34, 4,178, 68,238, 16, 9, 49,145, 41,105,140,176,242,233, 86, - 50,166,182, 73, 86,141,152,150,171, 84, 56, 7,252,222,253, 43,174, 55, 21,223, 51, 80,148, 34,162, 44, 50,133,170,196, 73, 56, - 68,169, 23, 43, 52, 64, 10,193,102, 39,231,167, 63,253, 10,191,240, 31,125,130,179,203, 73,156, 60,141, 69,248, 72,142,155,183, - 45, 34,229,195, 55,173,229,114, 86,227,130, 96,220,180,156,215,150, 73,221,114, 86, 71, 95,125, 2,156, 86, 13, 46,192,191, 63, -204,185,233, 42,240, 96,189, 79, 18,202,168,167,254,111, 47, 2,189, 76,226, 72,211,102, 84,157, 71,102,177,140, 54,174, 93, 45, -201,132,133, 0,173,245,100,153,194,217, 16,237,188,165, 72, 54,174,129, 5,183,223, 18, 15,218, 54, 77,162, 66,186,248, 94, 6, -200,247,110, 70,171,216,227,115,178,157, 30,135,213,140, 27, 82,240, 80,150,140,167,154,173, 92, 35,133,103,168, 36,251,165,228, -201,206, 22, 38, 28,243,178, 19,220,217,232,114,247,114, 10, 46,160,117, 32, 87,113,143,121, 49,107, 99,124,167,138,161, 22, 72, - 73,161, 37, 70,128,118,146,221,189,111, 97, 86,157,241, 45,239,121, 63,231,211,154,243,121, 77,175,169,232, 21,129, 44, 88,188, - 9,228,217,140,241,131,154, 66,156,242,226, 79,255,125,124,114,122,243, 11,162, 95,194,191, 23,211,179, 72,227,112, 32,128, 91, -133,179, 96,150,115,120, 92, 19, 45, 27,225,149,118,121, 97,219,206, 90,170,154, 79,220,137,176,226, 39,190, 43,177, 45,176,144, -175,145,252,250,227, 10, 2, 1,210,198, 85,140, 77,197, 58, 72,177,218,241,167,255, 9, 1, 65,250, 4,235, 11,236, 26,177, 78, - 74,176, 65,192,116, 14,174,194,215, 51,218,201,152,106,116,137,109, 26,234,217,148,144,245,169,199, 23, 28,221,125,135, 45,221, -208,157, 94,224,228,194,178, 54, 16,212,130,105,159,154, 12, 23, 48, 65, 32, 67,114,122, 83, 34, 90, 6, 3,184,101, 96, 60,214, -132,181,136,216,216, 32,121, 4, 69,158, 81,234,156, 92, 43,154, 90,241,218,163, 11,234,113, 69, 94,168,213,116,161, 36,158, 40, -203,210, 82, 48,220,219,197, 52,142,157,189, 45,154,121, 67,145, 43,122,221,146,211,179, 17,211,175,204, 41,250, 93, 54,118,119, -208, 89,137, 84, 42,162,133,206,198,247,190,109, 98, 56,140,241,200, 60,167, 74,249, 20,167,167, 23, 52,109,131,113,177, 57,207, -133,164, 24,228, 72,149,211,237,248,168, 48, 9,176,187, 57,192, 11,133,113, 30, 95, 4, 26,227, 80, 58, 5,218, 68, 23,125,156, -141, 42,149,110,174, 16, 34,167,181,134, 80, 69,238,145,150,130,178,236, 81,230, 57, 93, 5,199,231, 30, 43, 2,195, 66,225,101, -134, 84,158,203,203,138,172,232, 96, 29,108,117, 58,220,185, 54,224,106,102,121,243,254, 99,158,189,181,135,243,129,199, 23, 53, -253,178, 96, 82,213,108,109,244,217,232, 23,100, 66,242,214,203, 95,227,245, 54, 99,103, 88, 80,246, 74,134,133, 98,243, 96,139, - 50,239, 35, 59, 61, 54,159,121,138, 63,253,218,132, 78,238, 57,185,152,243,133, 63,249, 93,234,182,101, 39,203,216,236,150,108, -119, 51,114, 33, 56, 61, 61,102,127,111,159, 78,107,216,222,202,145, 62,174, 69,242,126,129,198, 49,110, 4, 59, 47,188,159,249, - 31,253, 65,116,235,244,240, 76,222,112, 43,235, 81,200, 46,111,125,230,215,248,206, 31,252, 9, 94,124,233, 17,135, 55, 6,188, -242,218, 9,189,162, 71,109,230,104,209,229,164,185,224,185,253,235, 60, 60,157, 80,102,154,147,217, 57,133,204,232,109, 25,122, -167, 5,142,192,182, 30, 32,155, 49,149,179,140,234, 17,185,204,105, 92,195,118, 47,167,200,115,122, 77,206,189,233, 3,158,217, -220,197, 57, 24,116, 13,143,166,145,143,101,156,165,106, 27,182,139, 30,221, 50,163, 54,241,243,174,102,138, 54,204,217, 27, 14, -208, 58, 48,169,224,157,241, 21,183,123,251, 12, 59, 37, 51, 83, 99,228, 24,237,137, 19,237,150,128,203, 16, 15,114, 33, 96,228, -161, 43, 98, 52,117,208,130, 66,197, 3,222,167, 98,146, 8,178, 75,157,171, 76,240,204,139,175, 63, 64, 7, 7,175,189,179,212, -200, 46,136, 49,141, 9,184,215, 31, 51,243,160, 30,125,137, 66,194,237, 66, 97,124,136, 69, 37,192, 87,175,102, 52, 2,204,108, - 69,132, 2,193,139,159,251, 2,183,178, 85,140,179,247, 96, 5, 52, 30, 62,162, 29, 58, 49,205, 37, 48,216, 41, 99,150,176, 11, -220,247,112,214, 88, 38, 65,240,168,106, 49, 46,158, 82, 91, 2,126,251,149,119,120,102,216,231,199,126,230, 95, 35, 9,244, 4, -252,219, 23, 95,103, 67, 43,254,234,193, 6, 15,170,154, 71, 85, 75,161, 4,237, 98, 82, 17, 43,171, 43,227, 61,106,221,191, 90, -172,161, 24, 34,240, 66, 38,120, 96,124,210,208, 39,107,204, 84,168, 72,251,230,223,156,122, 30, 59,232,232,149,142, 88,132, 88, -168, 8, 49, 24,165,113,158,183,234, 24,237,121, 71,195,235,109,124,239,197,218, 33, 28,190, 73, 58,180,248,220,120,180, 70,233, -218, 18, 84, 13,144, 75,248,205, 43,199,119,102, 14,157, 96, 98,183,234,214,112,196,201, 38, 90,115, 46, 62, 63, 18,233, 54, 59, -154,159,254,191,254,128, 31,202, 91,126,242, 34, 80, 39,184, 82, 74,104,191,201, 98,246,255,235,151, 18,160,165,160,155, 89,156, - 51,139,188,151, 37,121,241, 87,166,129, 81,136, 48,117,156,176,253,114, 39,171,164, 32, 19,130, 82, 70,190, 68,198,154,149,177, - 15, 8, 21,167, 76, 66, 32, 83,169,144,120,143, 79, 83,155, 75,250,233, 0, 96, 3,109, 86, 64, 94, 64, 61, 35,212, 45, 20, 57, -230, 98,134,239,229,124,232,228,146,179,253, 67, 92, 93, 99,219,140, 66, 11, 74,229, 41,133,228,187,119, 53,121, 21,184,222, 90, - 30, 90, 75, 47, 19, 92, 85, 45,141,141,138, 8, 37,147, 17,141,148,120, 17,232,104,137, 12, 2, 99, 29,131, 34,231,188,109,144, -230,152, 15, 60,241, 28,165,110,217,217,235, 83,217,150,110, 38,208,161,161,144, 1,230, 30, 55,179,180,231, 15,121,249,159,255, -131,149, 44,108,141, 64,138,136,129, 66,209,130, 53,217, 8,251,176,156,228, 9,137,241,159,166, 77,145,138,182, 99,137,198, 39, -214,123, 42,246, 34, 65,229, 94, 44, 89,245,193,175,200,120,126, 13, 49,193, 71, 53,130, 88,147,173,201,197,142, 62, 53,139, 33, -164,224,158, 20,224,179, 92, 29,167, 23,160, 84,140, 42,144, 2,188, 2,145,160,241,184, 2, 16,209, 44, 38,239,226,171, 57,118, - 54, 78,198, 49,129,217,227, 71, 24,145,163,135, 3,190,241,251,159,226,213, 87, 31,240, 61,183, 59, 8,227,163,188,208,173,180, -241, 66, 70, 72,127, 49,124,202,116, 63,120,191,104,138, 86, 94, 28, 11,163,156,165,165,110,162,242, 71, 90,134,160,171, 99, 46, -196,116,208,103,236,123,244,122,138, 66, 43,180,238, 49,187, 28,131,212,145, 13,222,209,232, 18,242,162,192,121,141, 55, 6,149, -105,218,241,148,102, 50,198,204, 43,186, 90, 33, 11,205,232,209, 57,253,237, 19,246,158,184,137,105, 44, 90,105,130,240, 96,155, -216,232, 6,137, 49, 35, 92,107,233,151, 10,233,163,207,187,150,106,233,158, 40,180, 70, 10, 29, 37,173, 89,150,226,157,227,228, -177, 32,202, 77,109,155, 60,242,109, 50,198,178,104,169,233,246, 75,138, 44,163,215, 41, 81,185,198, 26,199,214, 32, 70,172, 26, -111, 81, 90, 67,128,218, 7,254,210,134,229, 83, 87,145, 60,215, 90,195,120, 6,239,185,189,203,108, 50,103,106, 29,167,151, 83, -206,175,198, 92,223,219, 64, 73,201, 59,199,231,108, 14,186,236, 13,187, 60, 60, 31,211, 41,251,160, 43,130,200,185,121,237, 6, -255,213,207,253, 12, 55,118,118,249,149,251, 51,254,243,247, 31,210,100, 37,219,215,174, 83, 92,127,130,205, 15, 63,205, 23,222, -216,160,241, 35,180, 10, 84,163, 11,238,221,123,133,195,195,235,132,224,232,246,114,182,135, 5, 90, 53, 88, 99,105,155,134, 78, -166, 24,148,130,160, 2,181,113,204,235,134,221,161,162,192, 51, 56,188, 30,221, 5,211,121,227, 60,124,127,191,225, 83,179,140, -219,210,113,254,213,207,178,123,240, 45,188,115,111, 68, 39,203,233,246, 21,219,110,192,235, 71,143,233, 75,205,107, 39,239,160, -133,224,112,227, 26,245,216, 48, 49, 13,254,178, 69,233,140, 59,187,125,198, 35,199, 27,163, 75,134,249, 22,221,188,203,220,183, - 12,242, 28,107, 97, 82, 55,160, 12,153,204,120, 48, 26, 35,164,194,186, 62,251,157, 33,153,150,140,230,115,186,186,228,202, 84, -140,140, 32, 19, 42, 42, 41,236,132,198,195,248,124,206, 48,239,113,101,230,108,102, 3, 30,206,206, 80,226,128,139,166,161, 84, - 18, 61, 81,130,107, 8,242, 94,134,154,180, 75,211,148, 45, 21, 15,202, 49,112, 16, 64, 43,129, 13, 2, 77,124,208, 93, 8,100, - 66, 70,216, 78,196, 9, 63,164,226, 46, 61,152,202,167, 66, 43,176, 10,188,134,172, 4, 59,243,241,144,202, 5, 38, 8, 54, 8, -212, 8,132, 13,212,233, 80, 40, 3,204,210,179,216, 15,130, 41,208, 33,230, 40, 47,138,142, 74, 68, 46, 45, 2,103, 46, 94,148, - 5, 44, 59,173,106,204,172, 70,134, 8,255,222,208,154, 60,207,248,246,221, 30,115,107,168, 91,131,179, 41,113,183,154,178,225, - 61, 31,233, 68,198,181,192, 83, 32,185,209, 54,148,166,225,102, 6, 35, 31, 24, 3,231,233,123,228,233,181, 89,160, 47, 83, 65, - 36,162, 4, 50, 21,191,142, 20,220, 53,158,183, 77,226, 1, 36, 40, 90,138,200,156,213, 2, 38, 65,112, 22,100,132,105, 67,148, - 18,121, 32, 83, 34,241,139, 98,133, 82,222,242,200,196, 98,252,173,185,224, 77,155, 14,161, 16, 18,108,188, 34, 45, 46,127, 19, - 44,181,195, 44,201,233, 97, 13,114,133,218,122, 30,154,120, 96,134, 52,161, 47,186, 18, 25, 18, 20,157,144, 17, 31, 60,141, 39, -154,162, 56,207,105, 81,242,211,151, 13,117, 88, 28,224,241, 51,115,249,255,179,154, 47,195,185, 4, 90, 72,250,222, 18,222,221, - 19,241,199, 77,224,203,173, 88, 78,146,203,200,206, 52, 34,230,196, 73, 61,151,146, 2,143, 98,245, 53, 23, 19,160, 74,211, 86, - 16,145,221,237,130, 64,234,144,180,228,139,120, 80,133, 81, 5, 25, 32,219, 6,156,197, 85, 53,182,118,168, 66,209,142,106,102, - 74,240,241,203, 11, 94,218,219,228,242,106, 66,183,204,152, 86, 53,123,131, 77,244,221,175, 98, 2, 92, 87,142,111, 84, 53, 87, -243,150,166, 49,164,122, 74,191,204,104,173, 35,147, 81,226,103,156,195,167,230,228, 98,222,224,156,165,236,108,115,255,252,156, -239,121,110,147,185,107,216, 40, 20,155,178,229,193, 27,119, 9,192,199,190,243,125,140,191,244, 41,222,254,245, 95, 90,178, 23, - 23,158,249,114, 33, 19,117,145,172,233, 23,138, 4,181,154,182, 69,170,218, 11, 15,252,133,172,116, 25,214,178, 48,161, 73, 28, - 7, 17,179,132,146, 85,108, 44,236,139, 95,110, 97,245,154,214, 88,107, 28,186,165,110, 61,248,176,132,246, 23, 77,237,226,235, - 6, 23,150, 31,183,172,238,221,214, 69,235, 97, 36, 56, 19,215, 5,164,226,187,104, 86, 84,183,139,111,231,248,217,136,234,241, - 17,179,203, 51,234,233, 12, 57,216,101,124,118, 78, 61,153, 50, 80,138, 77,115,177, 44,212,203,201, 60,120,132,147,203, 55, 77, - 36,148, 75,132,176, 36,231, 17,226,251,150,250,188,165,164,207, 89, 31,125,238,133, 32,223, 28,176,243,158,235, 4, 74,206,173, -165,181, 5, 97, 58, 69,117, 10, 66,104,233,237,236, 83, 12, 58, 52,149, 65,151, 37,211,139, 43, 74,153,211, 54,142,222,102, 15, -211,182,120, 23,147, 31,171,209, 24, 77,244, 32, 23, 22,218,217,132,201,197,136,178,223,165,183,181, 27, 51,194, 67,204,150,176, -213, 60, 78,212,141,139, 68,213, 78,201,193, 83, 79,114,255,193, 9,163, 89, 67,166,163,204, 84,169,232,102,103,156, 37, 24,129, - 40,242,180, 66,136,164,130, 60,151,108,234,184, 22,113,214,209,182, 54,122, 35, 40, 77,191,223, 91,118,120,190,109, 49,117,139, - 49, 38,229,217, 11,108, 27,195, 75,124,107, 9,222,240, 61,174,229, 43,161,207, 36, 43,217,218, 28,242,240,254, 25, 66, 8, 54, - 7, 5, 51, 51,227,224,218, 54,199, 23, 99,118, 55,182,184,182,221, 99,110, 61,111, 31, 95,144,103,113,247,127,227,176, 96, 62, - 27,115,122, 42, 57, 57,127,196,179, 55,111, 50, 42, 7,252,250,169,231,199,191,235, 26, 59, 79,223,193, 30,222,224,255,254, 82, - 31,153,207,217,236, 74,204,188,230,143,191,248, 71, 12, 58, 25, 77, 51, 97,175,191,203,245, 97, 31,231, 5,221,197,106,210,182, -232,188,164,109, 98, 12,107,167, 91,160,144,132, 68, 60,147, 9, 65, 11,107,135,206, 13,101,249,145, 65, 36,248, 78,238,127,141, -237,219, 31,164, 40, 2,247, 30,157,177,121,176,199, 19,187, 61,238,127,241,140,157,193, 6, 29,163,120,229,242, 81, 36, 7,122, - 79, 33, 2, 39,147, 25, 55, 7, 27, 72,109,241,162,165,175,251,120,111, 25,118, 59,148, 54, 67, 8, 75,235, 91, 90, 95, 51,110, -166,244,178, 62,214, 89,148,128,153,153, 71, 75,104, 9,221, 76, 80, 22,138,147,137,197, 5,135,193,242,120,118,138, 22, 57,135, -221, 29,198,237,140,137,169, 40, 85,137, 36,112,208,217,230,188,157,242,244,246, 1,119, 71,199,232,235, 82,160,210,158, 76, 47, - 28,142,210, 36,211, 77, 15,105,222,141,110,103,121,154,110,144, 34,222,104, 36,166,171, 12,232, 32, 83, 24,125,192, 7,205,184, -182,156, 10,120,182, 27,205, 59,156,139, 32,184, 42,162,109,167, 23, 33,154,217, 55,129, 78,218,251,117, 22,190,209, 4, 58,105, -247, 54, 39,176, 45,160, 80, 48, 72, 94,227,142, 72,158, 1,184,103, 88,178,113, 23, 77,185, 90,184, 93, 45,122, 0,103,105, 43, - 75,195,124, 57,149,200,181, 34,184, 11,140,150,164,159,128,109, 91,238,174,253,187,174,132, 82,192,126, 82,186, 84,136, 91, 0, - 0, 32, 0, 73, 68, 65, 84, 66, 45, 10,163,128,184,223,206, 86, 26,219,176,118,136,233,181,221,186, 16, 17,245,180, 30,230, 62, -254,121,150,224,116,147, 8, 57,209,127, 60,213,188,180, 42,112,206,241,181, 54,122, 56, 47,190,167, 2,156, 84,177,137, 90, 22, -178,144,164,103, 43,162, 20, 98, 49,148,165,163,109,225, 12,151, 14,219,158, 86, 60,178,142,158,136, 77,203,138, 55, 16,225,184, -165, 30,121, 73,122, 10, 52,214, 82, 40,197,220, 58,142,194, 42,134,115,157,119,176, 52,222, 33,252,191, 23,245,101,129, 14, 20, - 10,188,115, 75, 75, 88,128, 51, 7,191, 81, 45,246, 61, 98,165,163, 23,209, 9, 32, 79,197, 92, 11,200, 4, 28,168,176, 12, 16, -137, 59,154, 20, 60, 34, 35, 18,101,157,143,228, 58,145, 10, 68,130,130, 5, 42, 54,127,222, 16,218, 64,200, 52,243,241,156,188, - 87, 32,149,143,110,111, 82,176, 93, 20,232,190,196, 93, 77, 56, 34, 48,182,144, 5,193,247,234,147,120,221,125,124,127,206,219, - 26, 19, 2, 23,179, 26, 1,244, 50,201,196,199, 37, 70,174, 37, 77,235, 40, 51, 73,157, 8, 24, 74,122,134,221, 33, 91, 29,193, - 51,215,174,195,124,198,217,201, 35, 94,126,120,143,147,209,152, 32, 4,255,245,223,250, 59,188,253,243,255,144,217,195,183,227, - 91, 38, 19, 9, 46, 89,177,106,185, 34,137, 10,159,238, 67, 25, 31, 6, 17, 4,206, 71, 34,100,112, 1,181,240, 92, 79,150,185, -137, 11, 21, 7,103, 27, 25,234, 98, 45,219, 97,201,130, 79,255, 45,167,251,101, 97, 23, 75,242,236, 58,171, 52,164, 70,207,249, - 85, 20,171,124, 23, 10,147,200,116, 97,205,231, 61, 53, 27, 54,193,237,222,196, 7, 61, 1, 8,241,158,116, 45,225,242, 33,205, -197, 41,118,124, 73, 59,155, 80,207, 29, 58,243, 76, 31, 31, 49,186, 28,243,209,189,168,115, 22,136,101,211,235, 9,232, 60, 14, - 33, 66, 18,117,230,114,237,158, 21,107, 40,215,178,233, 16,233,245, 39, 47,132, 60,167,215, 47,217,184,189,143,216,186,206,232, -114, 66, 59,157,163, 7,125,124,167, 75, 91, 77,176,243,154,118, 58,194, 89, 67,127,103,135, 32, 52, 66, 73,172,149,152,147,115, -154,241,132,106, 50,165,211, 45,201, 11,205,213,101, 69,107, 12, 50, 68, 94,136,105, 90, 70,247,143,184,184,255, 14,251,183, 15, -184,249,194,183,196, 92, 11, 27, 7, 36, 95,205, 9, 66,163, 85, 65,152, 55, 60,124,229,229,216, 36, 6, 73,174,114,130, 16,201, -172, 40, 26, 65,233,162, 64,101, 89,204,122, 79,221,191, 86, 10,155,220, 27, 27, 31,232,244, 59,113,144,207,116,140,167,109,154, -168,212,233,118, 40,183, 59,241,253,183,142,249,188,166,109, 91, 76,235,176,222, 66, 99, 8,182,229,219,155,135, 84,173,227,179, -245, 45, 6, 58,163, 51,216,224,114, 90,211,205, 36,211,203, 10, 25, 28,184, 57, 71,103,130,186,177,116,138,140,241,164, 6,198, - 84,173,231,253,239,253, 16,255,236,151,126,150,103,111, 29,114,176,115, 64, 89,150, 92,109,221,224, 23, 31, 31,242,100,126,135, -236,184,207,238,102, 96,179, 12, 8, 83,243,224, 98,194, 43,223,248, 60,166,109,120, 98,123, 64,167,200,233,118, 51,182,186,154, -201,220,176, 29, 26,102,115, 75, 71,180,228, 69, 78,145,199,247, 68, 11, 71, 47,203,145, 62,112,245,246, 91,139,203,188,146,121, - 2,229, 98,253, 35, 21,255,195,239,253, 43,254,167,255,224, 63, 38,208,242,226,107,143,232,116,114,250, 61,197,229,252,138,173, - 94,159,253,222,128,105,235,201,181, 36, 71,209,214, 87, 60, 28,143, 56,154, 94,177, 83,246,184,178, 83,158,232,239,129,112,228, - 37, 84,179, 72, 64, 22, 65,177,153,109,161, 37,116,178,140,185,117,148,185,160, 54, 45,239,140,170,232, 45,208,198,117,130,105, - 51,206,154, 17,215,203,125, 90,215, 50,119,211, 72, 34,207,187, 12,186, 30,211,102,140,219,154,190, 46,121,245,252, 46,183,135, -183,209,125, 41,209, 58,178,197, 99, 46, 53,116, 4,236,164,213,219,118, 71, 33,213, 74,132, 42,114,150, 7,237,226, 81, 95,218, - 62, 38, 50, 78,112,129,189,142,230,210, 56,180, 86,120, 31,208,105, 26, 13, 82, 70, 72,207,248,248, 48, 38, 66,155, 84, 17,226, - 21,153, 88, 74,200,130,141,240, 72, 55, 8,188, 76,196, 25,177,154,216,102,201,226, 80, 39,109,130, 15, 43,194, 14,169,251,118, -107,147,235,162,174,249, 53,147, 14, 31,224,154, 74,114, 61, 9, 3,224,106,173, 22,185,197, 68, 34,120,215,148,171, 82,195,160, -196,154, 41,135,120,215,249,196,158,134,108,113, 82,136, 88,208,209,139,221,188,160, 14,129,209, 34,234, 50,201,145,220,114, 55, - 30,101, 52,138,200,198, 95,188,110, 23, 2, 22,104,130,227, 82, 74, 38, 62,238,200,109,154,170,220,218,129,236,150,147,187, 95, - 57,255, 37,184,219, 5, 16,193,243,219,227, 8,187,103, 66,166, 34,183, 40,200,126,117,200,177,144,232, 37,170,160, 15,120, 25, -213, 5, 46,188,155, 24, 72, 88,241, 45,132, 88, 43,240,225, 47, 14,234,136,248,243, 60, 95,104, 30, 58,143,242,145,125,174, 36, -252,163,169,120, 23,251,241, 93,205,131, 76,171, 1, 17,200,133,160, 43, 5, 27,210,211, 63,184, 78, 83,199, 28,108, 18,251,221, -170,200, 14, 11, 22, 50, 29, 95,139, 74,100, 62,149,224, 87,145, 18,239,188, 15,184,214,161,114, 69, 61,139, 25,243,198,120, 54, -138,104,244, 16,106, 65, 71,148,220,159,107,254,122,103,138,183, 30,103, 98,213,114, 46, 48, 5,106, 99, 49, 78,112,109,184,201, -217,116, 70, 95, 88,178, 82,211, 24,139,198, 51,119,142,169,133, 50,211,244, 50,133, 8,138, 39,118, 15,120,127, 87,242,187, 95, -254, 52, 71, 87,231, 60,185,183,205, 43,199, 23,220,220,221,162,151,247,184,109,142, 56,185,255,214,242,190,115, 54, 65, 25,137, -101,110,213, 2, 98, 95,113, 70, 2,145,229, 46,214, 76, 97, 16, 33,238,184,191,137,209,238,237,106, 98,119,126,245,156,136,176, - 38, 85, 19,188,139, 49,172, 82, 14,251, 98, 21,135, 88,217,190,146,246,230,173,143,164,214,197, 16,224, 21, 72, 23,215, 32,248, - 5,244, 30,150, 4,187,133,198, 40, 36, 70,190, 82, 2,183, 16, 68, 36,246,121,121,243, 5,234,211, 7, 52,147, 41,190, 26, 49, - 31,205, 16, 50,167,157, 77,120,237, 79,190, 68, 46, 21,218,182, 24,187,138,112, 21, 34,222,187, 38,153, 34, 57, 23,207,155,133, - 34, 96,209,224, 44, 59, 0,201,146, 92,184,104, 90, 50,169,232,109, 13, 24,220,222, 71,119,182,153,142, 42,130, 44,200,202, 62, -147,147, 99,108, 85, 71, 31, 8,235, 48,147, 43,218,218,145,247, 58,120,227, 17, 82,114,254,230, 93,170,218, 98,188,160, 54,129, -147,199, 87, 52, 77, 67, 89,230,224, 2,181,247,248,218,208,154, 11,198, 87, 51,242, 94,151,171,199,103, 60,249,193,111,167,157, - 77, 8,120,100, 94,160,140,195,204, 44,170, 23,213, 47, 66,101,188,243,224,140, 94,167,196, 89, 67,150,231,168,162, 64, 40,133, -206,114,116,166, 17, 82,208,214,113,114,247,214, 51,183, 49, 53, 82, 41,133, 12, 30,156, 71,169,156,174,206,176,210,147, 17, 48, -206,225,154, 26,188,141,118,197,173,193, 88, 7,214,146,203, 64,158, 73,240,130,198,198,247,104, 83, 5,190,215,158,240,175,231, - 61,116, 53,162, 95,118,153, 54,129,129,132,166,246,156,204, 90,164, 56, 38, 47, 11,166,162,160,169, 43, 58,101,201,213,249, 37, -175,189,250, 85,180,178,244,135,215,120,226,230, 1, 94,245,217,217,220, 97,115,119,200,238,160,160, 55, 40,217, 24, 20,216,214, -112,121,113,201,221,215, 95,231,106,124, 65, 55, 87, 24, 23,184,177,213,101,160, 37,133, 10, 80, 40,122,101, 78,235, 26, 10, 93, -226,189,197, 25, 65,167, 8,200,160,112,206,208, 17,112,250,202, 75,203,251,219, 39,194, 84, 88,205, 16,200, 96, 57,116,129, 95, -249,252,167,248,240,193, 83,116, 50,205,233,213,140,202,214, 92,223,216,228,149,199, 15, 48,210, 35,131, 96,187, 51,224,178,169, -233, 42,141, 18,138, 76,100, 92,204, 27,186, 34,227,180, 30,225,103,240,236,254, 6,247,235, 43,158,222,223,196,187,156,171,153, -225,241,252,132,157,124, 7,227, 13,213, 60,112,222,142,217, 80, 61,114, 33,105,105, 80, 30, 92, 80,248, 0, 15,171, 99, 10, 93, -178,171,186, 24, 44, 33, 24,198, 51, 29,165,222,210,160,181,166,173, 29,133, 46,208, 74, 8,138,110, 12, 8,201,100,172, 74,123, - 1, 74,160,219, 85,104, 29, 61,138,157, 15,201,224, 36,185, 40,166, 73,200,167,100,178, 16, 2, 34, 75, 85, 48,139,133,231,154, -241,220,175, 29,123,185,100,160,227, 54,212, 37, 29,115, 80,130, 66,197, 98, 49,151,208,211,177,160, 71,134,229, 34,230, 81, 80, - 38, 88, 88, 38, 73,154, 74, 91,118,235, 2, 23, 62, 78,105, 65,164, 50,180,176, 66, 93,236,153, 5,100, 62, 70, 58,134,176, 34, -249,132, 53,153,219,117, 17,215, 5,119,100, 60, 35, 75, 96,206,154,215,117, 82,191,248,181,194,229,215,135, 77,193,242, 80,123, - 23,178, 44,226, 36,184,173, 86,132,162, 40,171,142,220, 4, 1, 12,145, 56,235, 35,132,157,166, 29,189, 44,120,171, 5,253,126, - 38, 41,196,170, 72,223, 55,158, 2, 24,136,176,160,190, 39,118,255,202, 10,212,167, 41, 37, 36, 50,163, 88, 35, 52, 19, 60,153, - 0, 37, 2, 61, 9, 83, 15, 51,239, 25, 35,105,188,164,101,221,166, 59, 94,227, 32, 98, 86,115,176,129, 38,217,127,213,118,117, -237, 23, 69, 65, 39, 25,205,194,106, 84,165, 93,164, 18, 98, 29,117, 95,254,185,147,101,108,217,134,119,128,115, 11,207,222,216, -161,215,235,178,249,202,125,174, 88, 5,113, 47,118,250, 75, 11,218,228, 77,239,131,167,113,112, 48,136, 9, 83,166,169, 17,198, -162, 50,137, 49,142,188,147,199, 24,211, 69,103, 38, 33,182, 75, 50,106,217,165, 79, 50,170,120, 95,197,181, 76,100, 91, 23, 89, -100, 10,207,109, 19, 39, 89,231,184, 52,142,241,172,230, 37, 15, 31,187,117,157,199,143, 31, 17,108,196, 62, 46, 29, 24,231,216, -234, 12,217,216, 56,224, 39, 15, 79, 49,231,199,220,147,134,111,228, 37,149,208,108,117, 61,181,181,104,239,169,154,150, 78,166, -248,107,246, 62,159,127,241,130, 55,155,156,255,228,137, 3,182, 38,143,121,179,204,152,207, 27,126,236, 47,253, 0,231,127,242, -171,113,255, 47,214,211, 17,215,200,108, 54,221,131,110, 37,193, 90,176,216, 69, 88,101,161, 47, 32,236, 4, 94, 69,158,193,194, -175, 96,109,106, 89, 44,205,215, 63,180, 14,201,171,116, 47, 6,151,158,163,196,121, 16,201,116,198,165,103, 46,194,243, 17, 89, -241,196,130,238, 83, 83,216, 59,220, 69,231, 25,118, 58, 79,246,180, 13,205,168,138,104, 65,234,152, 77, 72,134,127,139,181,130, - 11, 84, 15, 95,165, 61, 31, 96,170,154,234,114,130,173, 5,217,214, 46,103,111,191, 69,153,133,200,171,104, 99, 78,128, 79,197, -220, 17,121, 61, 74,129,113, 43,222,202, 98,213, 44, 18,187, 95,234,116, 47,219,119, 63,203,101,167, 32,223,232,210,125,242, 26, - 74,247, 48,173,199,180, 45,205,249, 49,151, 87, 83, 66,240,168,142,102,118, 50,166, 40, 51,108,144,216,121,203,252,236, 60,170, - 66,148, 34,203, 37,186, 17, 88, 31,144,214, 81,185,154,170,118, 84, 6, 58,165,198, 27, 79, 43, 28,194, 6,230,115,131,156,205, - 48, 62,112,247,139,159,231,246, 7,191,141,230,234,108,213,236,183, 83,212, 96,131, 91,207, 63,143,175,103,188,239,217, 91,188, -125,255,113, 12,228,113,150,224, 44, 58,228, 72, 37, 9, 38, 62,255, 4, 79, 38, 5,178,147,163, 27,104,155, 54, 54,251, 2,242, - 60,134,129,204,171,138, 44,207,200,181,140,196, 68,107, 49,243,121,108,190,211,126, 51, 16,112,198,162,172, 37, 83, 50, 54, 19, - 4,108, 11, 7,205,148,131,225, 53, 94, 63, 59,231,120, 52,163,208, 18,107, 27,202, 60,231,178,106, 8,120,148,202,104,155, 64, -183,215,103, 58, 25, 83,246, 55,233,150,154, 39,110, 60,201,176,200, 16, 89,201, 70, 87,179,181, 57, 96,103,208,199,121,207,181, -237,130,170,106,184, 58,189,160,174,103,124,254,207,191,128, 20, 22, 33, 50,158,216,223,100,163,215,163, 83, 40, 10, 1,181,115, -140, 70, 99,246,119,247,168,230,134, 92, 7, 6, 3,137,177,208, 31, 10, 76,211,160,189,164,190, 56, 79,207, 73,248, 11,104,227, - 2,150,127,166, 80,252,236,215, 94,199, 30,156,242,220, 51, 31,224,254,213, 21,219,221, 62, 71,211, 49, 83, 63,143, 54,210, 50, -227,193,244,156,221,206,128,105,219,226, 66,195, 65,111, 72, 38, 36,162,145, 84,173,199,227,121,227,116,196,118, 89,112,116, 49, -165, 9, 48, 53, 19,114, 89, 50, 55,177,238, 58,239,232,169,130,110,174,240,161,225,250,176,207,253,171, 43, 14, 58, 27, 76,140, - 96,183,236,211, 58,195,105, 51,102, 35,235, 96,189,163,114, 13,224, 41,117,135,163,201,132, 59,189,155,156, 77, 79,209, 66, 73, - 36, 30,239,227,133, 20,192, 80,130, 46, 2, 42,207,210, 62,149, 36,191, 73, 18, 37, 18, 75, 53, 72,100, 18,185,106, 82,193, 79, -190,201,185, 10,168, 0,109,235,208, 33,112,209,196,135,106, 43,147,203,112, 13, 43,225, 97,229,105,129,107,221,148, 17, 14,204, -109,160,117,129, 78,218,137,231, 11,218,121,234,248, 33,164, 67, 67, 80,170,164,149,231,155,138,198, 98,130, 94,176,117, 19, 82, - 64, 90, 43,108,175,177,217, 93,218,217,147,208,137,124, 45, 10,210,125, 83, 33, 95, 35,197, 46,235,174, 23,235,138, 0,177,252, -222, 66, 64, 41, 23,123,246, 21,227, 56,136,213,174,251,118, 38,185,112,129,145, 91, 59, 68,197,218,201,156, 14,208, 92,197,239, -251,216,120,242,149,111,203, 95,128,180,195, 10,108,127,183,188, 78,132,245,243,122, 89, 28, 14,181,224,145,137, 16,238, 16,159, -166,175,213, 78,209,173, 53, 11,126, 97, 32, 20, 64, 90,203,166,142,239,107,235, 69, 28, 26, 69, 76,148,107, 67,160,151,171, 40, -209, 91, 54, 25, 43,116,214, 47, 28,225,132, 96,232, 12,119, 61,244, 5, 12,180,224,235,143,206,241,156, 51,148,113, 77,209, 44, -147, 64, 23,177,160,105,122, 74,126,227, 33,192,200, 5, 74,103,153,207, 42,230,117, 77, 46, 65,185,168,139, 23,198, 32, 92,160, - 37,160, 22,214,176, 65, 32,164, 95,131, 90,211,222, 52, 77,102,193, 5,140,181,140,172, 89,194,199,193,195,133,129,243,201,148, -231, 51,201,221,185, 96,187,114, 84,109, 65,199, 86, 4, 60, 67,233, 24,234, 28, 91, 85,252,157,239,185,206,221,223,253, 42, 65, -192, 46,115,190, 79,206,147,109,176, 64,139, 72,226,147,189,248,134,188,113, 58,227,211,166,228,135,191,237, 35,220,124,227,143, -112, 33,240, 67,157,192,111, 86, 5, 63,244, 29, 7,252,217, 23,166, 17,202, 94, 76,180,235, 38,111, 97, 61,169, 52, 54, 95,146, - 85, 7, 40,146,140,107,185, 3, 15, 43, 20,197,248,149, 61, 43, 98,165, 17, 95,185, 21,164,123,210,177,230,178,152, 34,192,195, -162,136,135,229,115,183,244,177, 72,198, 51, 34,164,231,197, 65,247,218, 30,239,253,225, 31,164, 79, 1, 23, 21, 15, 94,122,141, - 60,147, 12,158, 30,128,214, 84,179, 57,221,142,224,236,193, 93, 46, 31,159,208, 78, 12,222,212,216,228,100,233,108,226,165,104, - 73,123, 53,198, 25, 75,211, 88,218,170,101, 30, 78, 17,193, 50,154, 57, 94,232, 26,218,214,167,115, 40, 34, 73, 33,169, 77,188, - 18,120, 27, 77,109,124,146, 46,170, 44,157, 91, 2,108,106,156, 22,176,132, 20, 18,149, 73,188, 9, 20,123, 67,220,220, 96,154, - 11,234,121,131,187,156,112,213, 18, 59, 35, 27, 48,211, 8,245, 74,225,113,181, 33, 24,143,171, 90,124, 8,152, 54,166,160, 21, - 58,238,239, 91, 39,208, 54,202,201,140,177, 92,153, 64,175,140,254, 5, 42,211, 17,255, 76,215,239,232,245,183,233,111,111,210, -219,220,194,155,232, 37,111,173,161,158, 92, 98,102, 19,106,233,216,222, 30,240,232,100,132, 76, 54,159, 58,207,163, 89,146, 15, - 4, 31,221, 31, 89,200, 86,173,139, 33, 69,153, 78, 67,142, 32, 56,139,144,138, 76,128, 8,113, 95, 95,230, 25, 94, 73,140,146, -180, 54,126, 12, 17,163, 96,109, 8,132,224, 32,165,191, 57, 31,243, 45,166,206,243, 49,115,206, 85,111, 19,213,233,210,180,150, -211,171, 11,202,204,179,191,127,141,203,139, 17,103,163, 43,118,134, 27, 49,204,138,192,110, 71,114,251,214, 62,111, 61, 28, 33, - 16,244,105,216,218,221,100,119,152,163, 51,193,198, 70, 78, 64, 48,159,141, 57, 57,123,204,235,111, 63,224,205,187, 95, 39,215, -146,253,237, 1,253,162,160, 87, 40, 10,145,188, 16, 16,116,242,156, 73,213, 34,116, 96, 80,150,212, 77, 75, 89,102, 52,181,101, -123, 16,120,248,133, 47, 47,167, 58,181,230,111,194, 55,197,254, 62, 52, 25, 27,210,242, 65,127,130,122,252, 18,221,124,151,227, -217, 37, 51,107,217, 46, 75,206,234, 57,133, 2,139,227,120,118,129, 72, 3,219,189, 81,195, 97,183, 79, 99, 44,141, 55,236,150, - 67,164,116,244, 10, 73,238, 60,178,118, 52, 72,172,247,244, 51,207,227,122,194,173,254,144,185,209, 92,212,147,104, 86,244,184, -198,225,105,236,152, 39, 55,187,188, 51,174,200,181, 98, 39,235,112, 94, 27,246,122,158,204,106,206,231,115,198,102,204,115, 27, - 79,130, 52, 56,147,161, 75,173,146, 93,163,164,212,241,103, 45, 5,200, 66, 46,201, 4,121, 90, 46,123, 31, 25,199, 98, 1,237, - 41,129, 20, 49, 70, 84, 10, 17, 11,124,122,119,180, 18,104, 47,185, 97, 3,141, 15,108,132, 40, 3,115, 6,138,168,168, 71, 10, -197,117, 7,119,141,103,236, 98,151, 93,183,158,214,194, 36,113,125,186, 33,254, 33,147,209,250, 83, 47,164, 73,110,181,183,206, - 20,108,166,165,157, 77,159,103, 67, 44,222,101, 4, 14,222, 85, 88,236,218, 84,191,128, 91,220,154, 6, 63, 91,131,123,213, 74, -197,178,202,251, 78,223,247,250, 58,148,191,174,120, 89, 52, 0,196,104,218,176, 56,108,215,216,229,122, 77, 30,120,144,252,206, -155, 5, 47,104, 65,128, 74,200, 73, 41,160, 35, 99,151,239, 72,232,196,250,129,190, 86,221, 23,210, 34,191, 38, 75, 82,146,101, -210, 90, 88,179,252, 68, 64,145, 94, 87,177, 86,223, 22, 92,132, 44,253,124,198,191,251,103,103,141, 91,224, 60,148,139, 34, 16, - 2,219,105, 83,227,157, 67,126,211, 10,125, 97, 47, 42,101, 4, 24, 50, 34,105,112, 32, 97, 83,197,195,226,154,142, 13,228, 61, - 39,208, 30, 42, 4,115, 31, 8, 66,190,203,158, 52, 19, 17,243,168, 93,224, 35,157,156,174, 15,204,198, 85,100,128,203,216, 48, -102, 73, 35, 43,147, 92, 41,184,200,134,150,233,162,122,239, 81, 8, 12, 16,132,199,250, 40,123,180,206,209, 18, 39,219, 54, 73, -190, 76,128,199,117, 96,183,147, 83, 58,203,110,174, 25,141,167,124,228,201, 67, 94,190,184,228,238,195, 19, 4,158, 15,247, 52, -159,169,227,162,230, 75,243,136, 2, 12, 4, 20, 58,170, 53, 22, 13,167,146,160, 17, 84, 33,112, 95,246,200,167, 21,127,239,125, - 55,249, 79,191, 36, 40,139,146,235,193, 99,235, 9,213,212, 83,249, 2, 53,159,163,242,184,134, 89,152, 24,137,181,155, 64,138, -133,254, 58, 21,215,164, 70, 17,169, 57, 12, 73, 43, 46,215,186,128,144,136,150, 98,225, 44,183, 38,137, 36,196,176,149,224, 23, -118,175,107,100,146,133, 66, 98,193, 37, 72,215,150,165, 47,124,242, 18, 72, 68,205,167,126,240,251,121,246,123,191, 11,127,239, -140,179,151, 95,225,236,232, 33,183,159,122,130,118, 84,113,254,232,138,121,219, 98,125, 67, 61,245,168,162,164,183,243, 52, 59, - 55, 21,157,204, 50, 58,122, 76,101, 26,182,158,187,129,111,231,228,210,227, 70, 35,174,170,138,171,177,193,169,130, 48,185,207, -217,253, 75,202, 92,147,203,200, 81,113, 73, 13, 32,149, 88,122, 54,200, 54,173,100, 44,232,100, 93,103,140, 64,138,176, 36,236, - 45,238,253,120,175, 69,212, 70, 15, 10,218,139, 41,162,231,176,151,115,194,184,102,148,235,200,230,119, 62,186, 30,214, 30,103, - 28, 34,143,238,134, 82, 6,204,188, 69, 21,139,208,121,143, 80, 80, 32,216, 20,112, 62,141, 67,143,129,104, 32, 83,187,165,225, -138, 22, 2,167, 36,185,240, 92, 94, 76, 80, 82, 97,235, 58,146, 9,171, 25,190,153, 51, 25,143,217,216,221,103,252,224, 30,215, -110,246, 49,243, 22,145,103,132, 16,162,132, 45,249, 78, 56,103, 81, 82,160,148, 70,107, 65, 99, 60,214,216,200, 77,209,146, 76, -197,220, 9,145, 72,148,193,185,152,195,110,160,113, 22,219,218,116,157, 93, 92, 47, 56,135,118, 22, 91, 27,108,221,196,124, 3, -107,144,214,160, 2,236, 95, 30,179,119,243, 58,111, 60, 58,103,115,216,165, 16,146,110,222,229,226,252,140,157,205,109,246,182, - 54,152,205,198, 24,211,112,253,240, 16, 31, 60,199, 23,115,182,134, 93, 6,221,130,214, 4, 38, 85, 67,118, 49,226,206,173, 13, -132, 7, 51,155,114,245,248,136,251,143,142,120,235,157, 55,208, 50,160,148,166, 40, 58, 12, 74, 77,169,161,173, 13, 6,168, 91, - 75, 85, 77,168,188,227,112,187,131,242,146,128, 66,187, 64,183, 20,132, 22,134,201,104,203,175, 41,135,214, 61, 88, 22,176,188, - 1,190,175, 23,201,225,246,242, 33,207,248, 99,142,175,189,143, 87, 79, 47,105, 93,131, 35,112, 58, 31, 49,200,122,140, 77,195, - 48, 47,144, 8,186, 82,115, 81,207,145, 66,208,248,134,113, 59, 35, 19,240,206,228,130, 92, 9,106, 99, 25,230, 61,206,154,115, -182,203,109, 6, 42,227,181,209, 57,187, 89,135, 76, 74,174,204,156,141,162,160, 35, 74, 38,198,240,133,147,199, 60, 59,220,228, -104, 54, 99,220,214,145,236,237, 50,250, 89,193, 65, 55,231,237,201,132,147,234,138,146,146,143,188,255,105,116, 46, 5,153,210, -160, 45,185, 16,108,138,120,179,105, 37, 17, 42, 90,114, 70,167, 37,159,164, 50, 9,102,149, 17, 87,246,248, 20,215,185, 80, 15, -199, 3, 29, 41,144, 90, 35,115,129,180,142, 34, 4, 10,226, 52, 20, 18,139,212, 7, 24,148,146,231, 20,212,141, 79,211,161,160, - 77,123,176,121, 8, 24, 4, 61, 29,187,253,220, 36,182,178,143, 7,229,183, 46, 18,177, 0,175,210,225,189,134,237, 46,229,111, -139,125,123, 88, 48,162,197,170, 48, 45,162, 41,211,191,105,129, 78, 88, 21,174,197,116,233,210, 86,218,133,192, 32,192, 38, 96, - 82,220,235,138,124,182,130, 39,197, 66, 98,181,248,158, 11,178, 79, 8,209, 11,126, 77,134,230, 67, 36,225, 45, 86, 27,141, 32, -238,103, 89,105,204, 59, 18, 38, 30,138,133,214, 94, 44,226, 67, 87,135,180, 95, 67, 31,252, 90, 1, 89, 52, 17, 36, 23,172,197, - 73, 62, 84,130, 34,177,242,181, 88,241, 13, 22, 48,239,194,183,123,241,119,118,237,198,215, 50, 34, 26, 83,191,118,214, 47,216, -194,172,136, 81, 98,237, 65, 81, 98, 69, 62, 92, 20, 1,149, 10,102,103,177,251, 20, 17,186,223, 20,145,135, 33, 69, 12,222, 80, -184,212,108, 9, 50,153, 94,179,138, 15,156, 14, 13, 15,141,224,102,202,241,214,106,105, 76, 28, 77, 86,164, 72,150,167,177,234, - 36, 5,124,186,127, 19,210,147,236,108,103, 62,174,135, 92, 16,204,147,171, 96, 99, 61,173, 3,139, 68, 57,199,101,227, 9,214, -208, 76, 90,154,195, 93,178,202,242, 86, 19,155,183,188,173,176, 65,243,233, 63,248, 44,103, 13,144,101,220,218,238,112,247,114, -188, 36, 58,106, 17, 40,100, 44, 38,189, 76,179,239, 45,243, 82,242,183,255,201, 47,114,123,163,195,157,205,130,211,179, 41,127, -251,153,235,252,222,151, 94,225,147,255,225,143,243,185,127,250,115,232,164, 14, 81, 62,229,154, 39, 79,245,104,235, 27, 93, 22, -189, 17, 75,249,154, 16,160, 85,186, 23,146,135,187, 75,234, 0, 17, 86,156,137, 32,226,123,176,152,214,109,154,180, 23,251,117, -193,202,117,110, 9, 81,250,119, 7, 54, 46,217,247,132,212, 20, 8,130,148, 60,247, 3,127,141,247,124,242,227, 52,175,223,231, -232,165, 87,113,237,152,247,126,232,131, 28,189,122,151,217,172,198,249,216,104,217,185, 36,224,104,218, 54,106,174, 31, 91,218, -198,160, 50,133,247, 37, 15, 62,119,140,192, 32, 59,224, 56,229,246,173, 46,173,151,180,102,142,153, 27, 64,208,203, 52,182,154, - 97, 23,158,241, 10, 76,136, 3,198,226, 30,180, 33,170,117,204,226,172, 10,158, 32,227,123,182, 8,168,145, 42,224,124,188, 62, -193,122, 52,208, 86, 6,115, 57, 39, 76, 91, 68, 39,163,177, 49, 32, 40, 32, 9,173,101, 60, 54,177, 72,166,251, 85,166,104, 83, -146,250,197, 25, 31, 9,201, 2, 10, 9,155,101, 12, 56,178,134, 8,223, 35,176, 38,146, 26,149, 86,100,104, 92,128,249,188,101, -122,114,204,206,157,167,240,117, 69,104, 13,222, 70, 75, 92,223,206,200,178,156,141,219, 7,132,224,201, 18,135,192, 59, 23,101, -119,153,198, 11,141,144,209, 67, 62,248, 64,161,117,204, 71, 15,145,168, 44, 4, 56, 99,113,174,198, 59, 79,240, 46,134, 46,153, -184,192, 51, 62, 25, 24, 37, 47,138, 96, 45, 77,107, 16,182, 69,123,143, 78, 46,116,145,247, 16, 21, 69, 7,221,156,163,110,159, - 60,239,114,125,127,131,163,139, 43,138,172, 67,219, 26,124, 16,116, 7,155, 81,249,208,214, 60,121,253, 0,131, 39, 56, 79,142, -228,218, 94,151,186,105, 40,115,197,233,197,152, 15,221,186,201,171, 95,255, 6, 95,123,243,109, 38,213,156,203,203,139,255,167, -173, 55,139,185, 44,187,238,251,126,107,239,115,238,248,205, 53,116,117,117, 85, 15,100,179, 73,118, 55, 77, 82, 34, 41, 41,178, -131,200,130,109,129,146,163, 56,182, 3, 25,201,147,135,228,197, 48,242, 22,192, 72, 0, 7, 1,132, 32, 49, 2, 56, 64, 28, 32, - 72, 30, 98, 32, 49, 2,200,177,149, 4,142,141,216,134, 45, 89,110,137, 18,217, 20,155,100, 15, 98,143,213,213, 93,227, 55,223, -233,156,179,247,202,195, 94,251,156,125,139,124,104, 84, 87,213, 87,223,119,239,185,231,236,181,214,127,253, 7, 14,231,187,116, - 26,120,238,104,135,219, 71,187,104,215,177,220, 4,156, 19,150,235, 14, 46, 58,246, 14,106, 38,147, 9, 49, 68,246,167, 98,195, - 7,220,251,225,219,252,193,127,243, 63,243,205,191,253, 55,249, 39,255,229,175,167,192,163, 98, 64,138,197,217,244, 83,163,205, - 64,182, 38,125, 78,111,253,232, 77,100,247,144,143,214, 45, 87,198, 19,162, 84,156,183,151, 92,159,205,232, 66,228,162, 93,114, - 28, 34,179,106,204, 65, 61,161,139,129,203,110,133, 23,101,175, 26, 83,185,228,163, 33,210,114,173,218,227,147,203, 53,141, 54, - 84,226,120,220, 94,226,196,179, 91,141, 56, 91,109, 88, 85, 45,179,202,161,109,224,120,179,230, 11,215,102,188,123,188,164,211, -196,205,136, 90,243,193,249,130,219,243,107, 28,238,120,174,237, 79,248, 23,223,121, 29,255,231,110,238,254,173,122, 84,209, 68, - 88, 57,225,138,115, 76,156,163, 26, 85, 84,163,202, 44, 27,197,220,147,132,202, 37,199, 20,231,147,247,119,134,124,162, 40, 77, -163, 44,219,200,163, 54,242,168, 9, 92,116,202,152, 68,168,242, 62, 77,217,181,145,147,215,109,228, 34, 40, 77,167,108, 52,185, - 70,101,220,186,114,208,138,244,186,240,206, 58,232,214,165, 52,174, 25,233,215,220,100,120, 43, 4,206,100, 23, 94,172, 91,182, -137,200, 27, 27, 29,151, 38,126,231,210,164, 39,217,196,198, 68,228, 42,194,169,133,153, 56,251,254, 25, 13,200, 73,179,207, 10, -236,219,255,143,140,116, 86,219,215,213, 38,233,170,141,145,157, 53,216,117,126, 93,164,235,231,114,145,179,194, 88,219,251,168, -237,245, 76,132,212, 56, 56,225, 80,132, 25, 32, 81, 88, 2,141, 57, 92,121,187, 62,158,244, 51,188, 8,222,165, 34,231,179,110, - 59,191, 6, 25, 20, 1,206,246,210, 94,132, 93,148, 77,110,162,160,176,225, 77,135, 82, 38,145,251,226, 90,229,239, 55, 23,216, -119,176,206, 42,136,126,122, 30,254,171, 25,190, 62,255,157, 55, 15,126, 95,188,166,218,193, 85,159,175,181, 41, 47,236,123,123, -179,139,201,159, 91,122,159,246, 30,237, 26,140,236,253, 95,153, 56,155, 94,205,124,199, 73,111,206,211, 7,212,152,190,189, 39, -125,149,146, 44, 10,199, 51,107,102,132, 20, 48,227, 17, 38,192,101, 80, 26,187, 79, 87, 33,112,222,116,212, 18, 57, 95,111,112, -154,246,234, 51, 34, 63,183, 83,241,149, 43, 19, 94, 26, 9,135, 26,113,251, 59,188,113,186,228, 52, 42,199, 1, 30,117,202, 73, - 80, 46, 58,225,221, 85,219,187,158,213, 40, 85,219,161, 65,121,247,124,201,111,191,243, 46,223,122,237,117,254,189, 63,254, 53, - 62,190,123, 55,145, 37,227, 16,206,226,116,104,154, 84,123, 70, 92,223, 76,133,194,109, 49,147,222,138, 75, 49, 68,172,250,237, -130,157,253,222,123,254,137,234,214, 90, 38,146, 38, 98,223, 55,127,153, 92, 50,104, 40,174,188,244, 10,175,252,165, 95, 69,239, - 62,228,222,219,239,178,124,252, 41, 47,254,252,207,243,201,155,239,177, 88,175, 18,148, 27, 35,109,215, 17,124,164, 89,182,104, - 5, 93, 27,104,218, 64, 27, 35,171, 77,203, 58, 68,214, 33,176,136,202,170,141,108, 52, 57,226,197,174,193, 35,136,175, 56,189, -104, 57, 91,118, 28,152, 47,123,206,166,240,214, 64,187, 30, 25,147, 94,217,145,237,134,123, 3,159,252,222,123,132, 34,217, 61, -199, 38, 33, 46,235,211, 85, 82, 19,120, 79, 23, 52, 73,225, 90,101,121,154,140, 95, 66, 84,166,117,122, 14,157, 36, 2, 98, 66, - 51, 5,109,181, 95, 89,120,159, 26,177, 90, 32, 57, 35,155, 61,175,106,242, 53,176, 11, 93,143, 42, 54,155,200,201,189,135,236, - 77,149,233,238, 30,205,201, 35,218,203, 51,206, 31, 62, 76,170, 6, 25,113,245,198, 30,159,188,247, 9,203, 77,135,160,172, 55, - 9,114, 79, 71,106,178,112, 86, 43,206,196,180,154,112, 81, 9, 49, 32, 81, 83,131,103,156, 41, 98,164,109, 59, 98, 8,196, 16, -240,161,163,234, 26,170, 60,141,183, 13,210,181,248, 16,241, 49, 38,159,245,216, 81,199,212, 16,136, 8,254,224,136, 79,163,227, -188, 13,180,102,145,188,110,215, 84,126,204,200, 41,171, 54,240,217, 27, 87,145,218,211, 52, 29,243, 81,141,119,194,184,114,108, - 90,165,219, 52, 76,198, 35,118,230, 59,108, 46,206,249,206,155,111,243,201,131, 99, 86,151,231,124,122,255, 19, 86,235,199,188, -252,252,109,254,216,173,171, 60,117,184,203,166,105, 8, 33, 16,186,196, 81,152,212, 35,110, 94,221,199, 73,100, 50,174, 80, 51, - 74,185, 58,134,255,246,111,252, 58,237,164,226,217,143,238,240,226,207,125,157, 59,127,244,110, 79,240,237,213, 66,118, 27, 79, - 93,100,110, 75,165,160,233,172, 60,211,138, 95,190,253, 44,110,178,199,221,139, 51, 46, 99,195,211,211, 41,155,216,242,120,157, -108, 99, 39,174,162,118, 85, 34,129, 91, 34,163, 71,184, 8, 27,206,154, 21,149, 8,119,150, 39, 92,198, 13, 99, 73,220,158,189, -177,239,155,206,147,110,201, 78, 85,179,232, 90, 58, 85, 42, 28, 23,221,134,183, 78,206,104, 98,199,254,104,202,172, 74,233,157, - 87,231,158, 24,106, 62,186, 56,197,109,166,124,243,231,190, 70,229,157, 80, 87, 21, 23, 46, 50, 22, 24,169,226, 39,224,146,199, - 38,117, 45,125, 28,147,171, 60, 26, 34, 21, 41, 12,195, 87,142,208,164,182,184,217, 4, 84, 19,140,187,235, 93,234,131, 99,196, -197, 68,213,242, 34, 84, 35,143, 88, 98,155, 56,199,153,166,253,235, 20,165,237,210, 9, 46, 81,169, 68,217, 15,137,153,186, 38, -145, 52,162, 77,139, 23,166,231, 62, 32,145, 93, 84, 5,121,130,128, 85, 46,215, 51,220,172,113, 72,131,172, 34, 4, 55, 28, 80, -173,194,210, 52,249,121,146, 82, 82,145,215,152, 38,157, 43, 2, 7, 58, 64,236,117,185,107, 87,251,189, 51, 6,127, 9,199,231, -208, 27,147,199, 6, 85,106, 43,186,229, 10, 39,144, 31,110,237, 73,125,253,110,211,118,208, 71,214, 17, 95, 74, 54,130, 25,204, - 83, 6, 61, 46,131,223,247,214,117, 72,175,113,215, 16, 18, 85,101,164,112,142, 14,235,134,188, 95,114, 3, 19, 58, 43, 8,170, -252, 26,141, 71,116, 5, 88,199,180,130,208, 98,221,208,152, 59,221, 70,122, 85, 89,226, 97, 20,241,159, 94, 6,121,158,179,107, -233,205,241, 79,101, 64, 58,110, 34,220,143, 22, 64, 99,187,226,202, 94, 67,239, 42,104,211, 70,101, 63,203, 85, 66,237, 92,255, -185,103, 98,152, 56, 51, 15,201, 26,109,147, 53,132, 80, 42, 34,212,114,224,197,116,214,230, 9, 78, 98, 94,183,168,249,248, 39, -121,231,129,131,139,243, 51,142, 73,107,140,214, 9,181,201, 19,127,243,209,130,167,108, 66,108, 84, 9, 44,184,110, 42,134,170, - 48, 34,218,173,224,107, 7, 51, 70,149, 99, 26,225,116,221, 81, 79, 43, 22,151, 13,175,206, 42,166, 59, 99,252,166, 99, 18, 59, -158,254,252,231,248,248,205,119,210, 94,219,165,239,211,230, 53, 73, 10, 36,237, 19,251, 50,161,208, 25,145, 49,216, 84,223,103, -154, 27,195, 91,237,208,141,221,160, 93,247,174,200,161,239, 27, 31, 25,116,233,150, 64, 40, 36,175,137,158,124, 26, 51,251, 94, -169,167, 51, 94,254,143,126, 25,150,107, 86,199,143, 88,159, 61,230,165, 63,249,117, 46, 62,190, 79, 39, 9,173, 10, 49, 49,178, -131,198, 20, 12, 84, 57,218,182, 65, 5, 46,215,129, 46, 38,155,217,182, 11, 52, 17, 54,157, 50,157, 37,135,200, 7,199, 27,158, -186, 86,247, 83,250,186,129,163,221, 49,122,188, 32,214,102, 93,108,145,187, 98,112,171,235, 17,178, 33,122, 55,102, 45,188,203, -112,155,246,233,113, 93, 43,212, 68,212, 11,235,243, 53, 26, 83,194,141, 55, 78, 9, 10,109, 19, 9, 33, 57,174,197, 16,105,219, -148,203, 46,153,132, 23, 6,242, 67, 14,197,113, 85,106, 45,188,131,253, 90, 57,219,164,193,194,197, 20,203,204,184,162,114,138, -174,215,236,140,199,116,157,178, 57,191,224,220,125,146,252,223,215, 75, 30,126,112,159,201,222, 57,207, 63,123, 13,109,158,225, -167, 63,127, 21, 89,195,120, 58,167, 81,229,237,143,238,114,190, 90,115,177, 8,136,171, 24,215, 85,207, 27, 9,109,151, 26, 11, -151, 2,135,212, 38,116,231, 61, 94, 35, 83, 73, 40, 68,219, 54,104,211, 37,239,249,174, 35,134, 14, 66, 96,100,132,132,218,252, - 43,208, 2, 25, 84,101,255,209, 93, 14, 14, 62,203, 97,229,185,243,120,201, 83, 71, 59, 52,205,148,211,213,154,123, 23, 13,211, - 90,120,243,227, 79,248,202, 11, 55, 8,157,112,122,177,164,174,107,154,186, 99,226,132,229, 58,176,183,218,240,242,149, 67,254, -249,107,191,203, 91, 31, 63, 74,171,151,208,129, 56, 70,117,205,171, 55, 15,185,125,117,135,177, 68, 98,215,177,110, 2,171, 54, - 48,114,158,131,221, 57,203,213,138,221,201,148,102,181,161, 30, 9, 7, 71, 35,254,249,127,247, 63, 50,242,233,121,252,157, 15, - 62, 97,242,195, 15,249,169,191,250, 23,248,131,191,255, 27, 61, 23,196,185, 65,241,164, 3, 39, 21, 47,194,158,139,252,204,164, -101,245,240, 29, 70,251, 47, 37,217,159,119,188,123,121,154,126,110, 85,179, 8,129,153,119, 76, 70,201, 9,112, 19, 58, 38,190, -226,113,187, 98, 44, 21, 83, 87, 83, 57,184, 49,222,195,139,208,198,150,139,208,178, 92,119,116, 26,168, 84,232, 52,210,106,139, -119,202, 89,183,224,176,154,226, 17, 14, 76, 19,127,178, 89, 48,245, 53, 27, 85, 62, 92, 4,158,158,116, 92,153,142,121,239,242, - 46, 95, 95,125,158,106, 50,173,146,235,152, 23,174, 3, 19,241,184,145,117,119, 57,166,201,129,243, 14, 49,108,214, 89, 90,131, -118, 9, 54,161, 85,198,222, 89, 17,140,140, 85, 19,113,206,198,187,168,137,180,225, 67,242,175,214, 42,237,104,124, 20, 42, 36, -121,143,123, 59, 84, 29,132, 32, 84, 30,198, 10,123,170,108, 72, 83, 42, 33, 21,188,181, 8, 39, 10, 87,205,200, 37,246,169, 11, -153, 41,157,246, 82, 82,176, 30, 2,131, 12, 47,186,148, 74,149,189,172, 23,230,160, 54,137,106,187,245,129,116,119,213,193,216, -220,214,122,137,143, 12, 80,123,236,137,109,105, 90,201,196,188,188,127,142, 5,196,158,209, 5, 74, 73,157, 29,150,254, 39, 16, -218,120,130, 41,174,166, 76,184,170, 74,103, 86,155, 61, 35,223,224,237,153, 53, 6,174,216, 97,103,147,143,174,223,159,166, 98, -224,141,233, 95,149, 18, 99, 63,164,111,229, 66,239,138,239,175, 2, 79,219,123,159,148,156, 3,155,204,235,226,250,120, 35, 42, -230,213,196, 70,210,122,163,247,132, 47, 38,124, 45, 16, 11, 12,125,169,157,210, 70,225, 34,166,139,214, 23, 67,251,251,172, 59, -207,187,208,140,172,100, 14, 67,229,156, 89,144, 70, 43, 94,105,159,222,134,228, 55,158, 59, 46, 49,235,216,188,162,201,127, 37, - 26, 45,112, 33,221, 79, 25,125, 8, 36, 82, 95, 48,214,161, 24,215,164, 85,237, 13,112, 84,225, 60, 42, 83, 73,132,191, 85, 17, -150,211, 35, 34,162, 44, 66,100,213, 6,150, 40,139, 0,159, 25, 59, 70,151, 27, 46, 98,228,131,243,134,151,214, 11,106, 47,124, -235,245,215,137, 33,153, 26,229,224, 19, 87, 24,183, 84, 67, 47,102,190, 2, 58, 72, 17, 37, 21,111,188,105,175, 81, 92, 76, 82, -199,172,180,200, 62, 11,217, 71, 62, 90, 31, 0, 0, 32, 0, 73, 68, 65, 84,124, 38,244, 69, 80,251,189,122, 63,196, 68, 16, 63, -100, 40,244,123,249, 72,178, 93,117,138,212, 19, 70,235, 51, 88, 41,231,199,199,156,156, 94,194,244,144,229,250,152,150,192,170, -217,176, 89, 53, 56, 21,186,208, 17, 66, 68, 93,250, 89,109,103,208, 57,202,178, 9, 61, 65,179,114, 46,117,206, 68,234, 74, 88, - 44, 34,211, 73,197,102,221,178,142, 74, 19, 34, 58, 25,211, 53,107,124,149,190,151,183,247,158,154, 83,237,229,156,125,163, 25, -139, 4, 58, 73,104, 71,236,178,243,162,237,218, 3,132, 16,136, 1,246, 38, 21,113,221,166,248, 98,132,118,221, 17, 84,240,146, - 38,247,208, 69, 98,151, 10,166, 87, 69,187,100, 99,151,209,185, 96,200, 72,237, 29,161,237, 24,137,178, 83, 11,235, 46,210,137, - 80,121, 77, 50,172,174, 98, 92,121, 66,179,198, 85,158,211,123, 15,113,116,204,166, 21,114,121,194,243, 55,166, 60,247,211,175, - 48,189,246, 28,250,225, 99,226, 3,135,171, 91,226, 76, 25,143, 70,124,233,165, 87,184,188,243, 35,226,166, 67,247,119,249,206, - 59,239,115,209,192,108, 50, 74,158, 13,149,103, 84, 37,199,187,208,117,180,155, 13,177,235,168, 80,188, 42, 93, 23,240,109,160, - 11, 29, 93, 27,112, 49, 82,197,148,199,238, 53, 13, 94, 81,211,125,100,118,162,198,101,114,232,197, 57,183, 94,152,243,209,163, -115,174,204,199,220,125,124,194,181,189, 29,102,181,227,185, 91,135,124,116,178,100,236,107,222,252,240, 33, 95,126,225, 58, 59, -227, 49, 65, 3,151,203, 53, 93,229, 25, 57,152,184,128,196,134,215,223,122,135,201,168,194, 69,225,252,114,205, 98,181,224,149, -103, 14,121,233,198, 62,243,113, 77,219, 69,186, 54,176, 94,183,172,214, 27,246,247, 15,216,171, 97,111,238,168, 98, 71,215, 69, -170,122,204,219,255,219,255, 78,124,255,125,110, 77,107, 68,224,173,243, 21,191,252,212, 1, 59,111,190,199,205, 87,190,192,221, -239,191,217, 59, 41,150, 92, 43,197,130,173, 68, 13,249, 76,234, 2,191,217,176,104, 87, 4, 75, 56,108, 66, 32, 84, 53, 93, 84, -206,187, 53, 15, 54,129, 89, 85, 83,225,144,232,185, 57,157,114,222, 54, 4, 13,140,125,197, 50, 52, 92,116, 29, 51, 95, 51,247, - 21,171, 24,168, 36, 69, 22,206,188,163,141,129, 38, 6, 98, 84,238,111,150, 28,212, 9, 53,239,136, 76,157,167,213,150,243,174, - 99,207,215, 28, 55,107, 30, 53, 13,207, 76,246,217,108, 22,248, 95,123,118,255,111, 57, 28, 75, 85,246,213,160,163,218, 81,187, - 42,249,253, 90, 2,151, 0,149,175,122,114, 78,237,146,179,152, 51,141,171,243,206, 36,103, 9, 14, 22,163,210,247, 80,179,201, -154,134, 73,210,177,148, 1,222,205, 83,151, 51, 72,117,236, 96, 68,122, 88,198, 34, 28, 10,169, 73,112, 98,251,251, 52,217,141, - 12, 98,207,147, 92, 45,169,144,120, 39,246,103,244,210, 22, 47,218,239, 0,189,193,252,181,164, 93,139, 26,129,171, 6,174, 56, -120, 90,224,154,253,190,246,146,160, 94,103,215,199,126,173, 37,173, 33,114,129,169,220,176,162,200,113,160, 9,130,177, 63,115, -121, 53,144,254,253,200, 57,170,254,181,219,117, 21,199,200,156,233,188,189, 39,143,244,144,187,104,186,190,149, 24,156,111,176, -240, 68,132, 49,121,210,117,189,199,181, 43,160,245,158,115, 96,123, 85,135,176,148, 68, 20,203, 43,138,173,221,183, 93, 91, 87, -236,234, 15,141, 84,151,215, 5, 34,219,176,123,101,215,213,219,207,170,141,104,153, 36,120,112, 32,176, 67,250,117, 79, 18,235, -125,150,153,215, 69,250,151, 24, 44, 63,246,194,218, 10, 83,134,255,115,231,236, 4, 11,228,128,185, 23,118,237,250,247, 15,100, - 79, 10,148,222, 61, 44,218, 58, 41,195,238,209,188,209,123,104, 54,239, 93,123, 14,196,128,232,116, 10, 75,107,228,206,186, 68, -162,219,241,210, 95,183, 78, 19,122,225, 12, 57,137, 8, 27,155,248,157,221,255,249,126,119, 69,179, 71,209,216,100, 6,249,185, - 17, 65, 37, 38,211, 37,177, 38,192,217, 33, 34,189,204, 51,193, 80,222,160,190,236,229,222,239,187, 51, 89, 80,182, 67, 87, 6, - 95,227, 84,128,196,144, 47, 39, 3,154, 66, 17,195,235,101,176, 72, 77, 94,234, 6,237,187,116, 93,131, 33, 58,153,164,186, 90, -173,168, 46,143,105, 46, 31,113,255,225, 61, 86,139, 21, 15,126,244, 54, 93,136, 44,151, 75,150,103, 75, 98,108,233, 98, 67,212, - 14, 25, 57,226, 38, 77,221,222,140, 98,188,192,168,182,117, 96, 45,212, 36,255,241,113,157, 14,254, 86, 97, 84, 9, 77, 80, 46, - 55, 29, 77, 39,232,122,205, 58, 70,154,144,114,196, 91,235,106,187, 66,205,226,236,158, 17,123, 24,242,125,144, 17, 61, 3, 19, -251,166, 58,118,145, 54, 64, 37, 62, 73,123, 5,154, 54, 18, 99,100,101,166, 70, 85,239,204,151, 63,107, 75,121,203, 81,182,153, -123, 99, 95,239, 43, 65, 59,237, 99,130, 35,233,153,174, 36,249,207,139, 36, 40,190,174, 60,116, 1,223,182, 92, 57,156, 32, 26, -169,187,134,207,124,227,103,240,251, 87,208,198, 65,211,208, 92,172, 89, 94, 28, 51,217,219, 69,198, 83,154,197, 37, 50, 59,224, -252,211, 59,140,199,115, 94,120,254, 5,102,205, 25,143,239,159,176,227,148, 81, 8,184,118,131,111, 26,220,106, 69, 88,172,136, -235,134,184,222,176,186, 92,209,174, 55,208, 52,208,118, 72, 23,168,236,138, 84, 98, 48,189,173,180, 18,135, 40,221,205,206,200, -200,117,136,124, 60, 63,100, 60,169,137,161,101, 50, 30,211,117,145, 85,219,113,190, 94,115,117, 54,198,123,199,180,246,156, 45, -147,161,205,233,229,130,197,106,195,164,114, 60,181, 59,226,246,245,235,156, 93, 94,242,207,190,253,125,230, 46, 89, 4, 55,237, -146,227,197, 37,191,248,133,103,248,204,205,171, 76,199,158,179,203, 13, 15,207, 87,156, 44, 87,204, 71, 19,118,119,230,220, 58, -218,163, 18,184,247,224,148,113,132, 31,253,175,127,151,227,247, 63,100, 35,112, 99, 62,230,131,139,142,155,211,154, 80, 59,228, -114,205, 31,251,153,111,240,246, 15,127, 48,168, 67,164, 80,234, 60, 65,140,207, 5,255,176,121,196,254,100,159,247, 55, 99,130, - 83,188,140, 24,251,154, 24, 55,120,169,248,217,171,175,240, 82,181,225, 81,187, 66,188,231,164,221, 48, 98,132, 35,114,214,172, - 24,185,154,131,186,230,188, 93,211, 1,149, 56,246, 42,207, 42,116,204,252,184, 31,166,246,235, 49,215,199, 83,118,235, 58,169, - 85, 68, 88,134,142,141, 53,219,139,152,248, 19,183,166,187,172,186, 22,183,154, 80, 73, 16, 84, 34,187,226, 24,213, 32,211, 10, -239, 42, 66, 8,120, 73, 58, 42,223, 7,168, 43,222,167, 92,174, 16,186,100,226, 97,169, 70, 17, 24,121,215, 23, 92,186,152, 24, -152,201, 96, 57, 17, 79, 80, 36, 42,170,177,183,128,221,248,204,146, 77,120,111,212, 52, 45, 70, 11,238, 8, 65,168, 28,116, 81, -184,230, 19,147,254,130, 4,155,173, 20,118,141,221, 35,214,125, 43, 66,109,251,189,206,246, 86, 89,131,235,122,253,180,193,108, - 6, 90,143, 60,236,154,231, 53,213,224,107,173,198, 14,207,112,120, 52,137, 87,134,161,179, 0,215,121, 99,207, 27,137, 77,123, -105,159, 24, 44,154,255,254,199, 13,106, 68,237, 64, 48,121, 73, 93,216,118, 6, 29, 60,213,123, 29,165, 85,220, 96, 29,114,204, - 86,177, 12,211,177,160, 5,129,170, 72,214,210,109,195, 28,103, 5,118,165,121, 90,211, 30,174,206,214,172, 90, 56,132,169, 17, - 4,131,193,221,165, 60, 46,115, 14,194, 79, 98,228, 23, 82,189, 50,178,179,112,253,181,247, 59, 68,232, 86,154, 52,206, 83,159, -180,254, 39, 58,188,102,201, 12,250, 60,165,102, 83, 28, 39, 91,242,148,172,119,246, 94, 18,148,107,220,111, 53,109,106, 52, 29, -116,204, 19,167,166,146,234,140,204, 40, 81, 7, 11,211, 46,153,203, 84,170, 76,172,248,174,128,139, 78,217,171,210,189,157,185, - 3, 42,131,229,106,242,155,215,129,144, 89, 56,170,229,247,210, 50, 40, 45,214,209,144, 1,107,140,150, 12,215,218,153,165,105, -225,175,212, 31, 59, 57,105,172,255,254,133, 7,190,115, 37,121, 81,251,192,161,188,214, 8,237,246,235,234,101,111,197, 33,166, -106, 36,215,194, 19, 72, 11,187,216,124,207, 86,146, 73,165,240, 7,191,255, 30,149,255,128, 73, 93,113,126,209,208, 86, 53,135, - 59, 31, 51,155,214, 76,118,167, 73,222, 55, 26,209,109, 90,180,117, 68, 2, 85,149,248, 60,155,203, 6, 63,118,172, 54, 29,123, - 59,137,232, 53, 25,215,104, 8,140,188,167,139,202,129, 75,231, 80,140, 30, 79,228,218,124, 70, 8, 13,235,166, 75,197,127,232, - 91,122,100, 72, 92,118, 20, 76, 46,151,130, 82, 85,233,139, 98,199,150,100, 16, 67,105, 40, 34,157,187, 54, 77,227,138,169,121, - 84,112, 18, 77,246,152,204,126,180, 17, 66, 48,131, 39,151, 82, 10, 53, 67,125, 42,196, 54, 38,119, 63,227,184,212,146, 16,152, - 70,211,154,167,242,105,213,160,109, 3, 84, 84,149,231, 98, 29,104,207, 79, 97, 54,229,232,169, 91,232,254, 62,122, 25,147,219, - 92,229,211,121,184,114,236, 44,215,184,217,140,216,181,200,120, 66,179,129, 16, 26, 22,167,143,217,191,245, 28,254, 7,239,209, - 94,122,186, 24, 7,103, 76,107,100, 37, 68,196, 26, 90, 40, 26,123,179,254,142, 50,112, 56,176,179,206, 57,233,137,152,217,148, - 40, 10,248,213,130, 31,220,121,192,231,158,127, 26,191,233, 96, 58,230,112, 84,177,232, 58,238, 31,159, 49,118, 48,159, 84, 56, -129, 77, 80, 58,148,182,221,112,124, 82, 51,171,110,176,216,192,155, 31,188,197,184,118,120, 34,235,118, 73, 12,129, 89,237,120, -124,126,193,254,172, 78,100,190,174, 99,185,105, 89,173, 54, 76,171, 49,175,222,190,193,199, 31,188,207,143,254,224, 13,110, 60, -252,144,179,216, 20, 14,162,202,249,122,201,207,222,152,115,255, 50,242,112,185, 97,181,233,152,252, 95,255,140,175,254,251,191, -194,119,255,193,255, 67, 78,229,205, 3,105, 44, 29, 72, 25,206, 79, 5, 62,215, 61,224,223,253, 89,207,255,249,189,192,253, 14, -102,206,241,125,119,155,231,103,123, 60, 27,239, 83, 93,124,192,159, 1, 22,177,226,141,234, 58, 43, 39,204,170, 25,227,198, 51, -173, 60, 77,232,120,106, 60,227,128,134,103, 71,202,199, 11,199, 39, 45,156, 54, 75, 34,137, 95,163,116, 56, 28, 47,213,135,252, - 92,181, 98,191,106,185,235, 43, 94,107, 59,212, 7, 54,209,211, 70,120,220, 42, 55,252,156,175,124,238, 54, 21,149, 39,198,200, -142, 42,212,158, 74, 28,161,235,250, 3, 68,109,119, 38,189,121, 75, 52,107, 71, 33, 86,201,242,206, 27,220, 30,205, 34, 21,146, -115, 92,154, 32, 20, 85,103, 80,166, 38, 29,116,116,228,111, 56,118,137, 97, 26,173,235,110, 99, 26,173, 29, 74, 75,218,135, 85, - 36,187,200, 77,132, 29, 15,123, 81,120, 96, 39,250,218,152,240,153,121,221, 9, 61,139, 62,168, 36,136,216, 76, 54,212, 78,194, -154,244, 48,102, 25, 71,232, 64,170, 33, 27, 58, 74,214, 47, 90,134,178, 77, 97,222,167,155,186,202, 78, 68, 36,253,120,200,135, - 89, 46,138,246,122,186,172,127,213, 66,206,101, 19,146, 26, 92,231,220,144, 99,237,164,152, 14,236, 80,245,110, 96,164,111, 17, -163,242,222,219,200,101, 91,190,233, 78,135,162,156, 11,189, 75, 19,121,173,195,251, 11,154, 12,108, 78,115,168, 9, 67,166,122, -180, 59, 57,107,151, 51,156, 95,194,241, 82, 76,156, 53, 67,200, 76, 14, 3,201,135,191,127,130, 63, 32,229, 78,189,128,206,243, - 67, 84,185, 97, 69,209,198,180,243,175,172,121,171,172,249,240,121, 71,172, 73,127,235, 84, 18, 81,199,185,190,113, 82, 45,229, -254,150,208, 85,178, 93, 13, 50,244, 46,169, 56,188,221,179, 65,237,192, 50,155, 83, 15,180, 46,177,194,167,249,189,218,231,218, -136,224, 66,114,182,187, 80,237, 85, 6, 3,159, 34, 85,187,206, 56, 13,101, 65,118, 12,242,177, 76, 34,220, 19, 88,202, 64,164, -140, 10,109, 27,153,140,164,160,139,104, 79, 6,139, 90,124,246,206,118,201, 49, 53,198, 82,236,126,196,144,141, 12, 47,246, 72, - 70, 70, 49,138, 66,237,101,152, 48, 67, 97,174, 36,170, 67,152, 75,230, 70,152, 33, 84,230, 84,228,162,159, 81,145,179, 46,242, -193,122,131, 15,176,211, 53,124,186, 6,213, 53, 94,206,105, 52,113, 48,214, 49,145, 34, 27, 6,174, 73,120,194,127, 33,228,148, - 69,148,218, 9,123,206,177, 55,242, 76,106,207,205,195, 57, 83, 17, 62,248,244, 33, 7, 46, 21,116,162,210,201,224,128,104, 30, - 61,212, 12, 43,178, 92,213,210,170, 86,183, 89,253,214, 16,229,207, 73, 69,104, 67,100,100,193, 50,185,201,205,102, 75,209,138, -116,232, 44,175, 62, 26, 50, 36,105,175, 30,109,192,137,125, 3,150, 72,116, 41, 30, 57, 25, 59, 5, 28, 26,148,186,118,140,170, - 72, 8,208,109, 90,170,218, 39,100,201, 85,196, 85,203,236,250,211,189,201, 12,209, 27,227,189, 5, 55,162,221, 44,169,186, 25, -170,145,205,201, 5,211, 43,251, 52,203, 13,110, 44,140,199,202,149,163, 61,206, 30,157, 80,227,240, 6,161,247,197,216,222,183, - 47, 62,227,220, 8,149,196,201,222,180,165, 24, 93, 59, 77,107,147,218,194, 94,228,236,140,209,120,135,215,223,250,128,207, 28, -204,249,249,112,204, 15,143, 94, 96, 62,159,161, 97,202, 98,189, 97,177,110,112, 50,162,197,179, 51, 27, 51, 25,239,176, 89,158, -243,193,253,115, 94,121,105,202, 31,125,252, 9, 59,149,163,242, 35,118,240,116,245,136,105,213,242, 91,127,244,136,191,242,167, -160, 11, 77,207, 33, 57,185,220,112,251,208, 35,247,223,227,141,127,244, 15,121,222,208,188, 32, 3,210,152,145,183, 59,167, 11, -158,187,178,199,253, 79,150,184,153,231,241,102,197, 87, 15,175,243,109, 77,207, 76, 62,163,202, 1, 76,115, 74,161, 14, 86,199, - 59, 71,112,231, 94,224,184, 77,196,222, 27,147,200, 95,254, 19, 31,242,189,223,169,233,206,218, 94,194, 58,211,142,229,178,229, -251,237,154,202, 7,214, 93,210,137,237, 75,197, 21,239,248, 19,163, 19,104,224, 66,103, 76,165,166,209,192,216,124,250, 85, 59, -246,253, 24,207, 25, 87,184,100, 20,148,207,146, 50, 36, 78, 36,240, 48,180, 28, 84,107,142,170, 11, 94,253,252, 47,241,135,223, -253, 46,149,183, 32, 12,169, 61,222, 37,237,165,115,201, 46, 37, 31, 12, 98, 58, 94,130,237,217, 36,193,231,201,242, 49, 26,188, -231,112, 33,117,160,174,210,148,139,220, 73,175, 91, 85,159,152,201, 18,149, 80,199,254,144,203, 48, 88,244,138, 55,241,184,184, - 72,140, 48,245, 41, 88, 36,154,149,149, 86, 41,194,145, 42,133,204, 28,171, 16,253, 16,253,216, 5,225,210, 96,231,169,153,232, -148, 33, 37,105,135, 43,201, 99, 93, 7,239,107,231,146,172,167,179,169, 78,236, 31, 85, 22,187,154,167, 80,103,164,186, 28, 61, - 30,204, 42, 51, 31,158, 89,182, 22, 53, 57,158, 85,126,208,162, 71,172, 27, 22,151,136,118, 86,156, 58, 29, 66, 47,250, 0,173, - 98,146,206,134, 55,244,250,117,221,130,135,156,237, 10,209,237, 46, 50,203,147,156,125,142,217, 9, 84, 92,250,194, 78, 6,103, -176,126,207,111, 48,108,106,201,135, 7, 27,209, 94, 46,183, 46, 50, 47,134,181,193, 80,160,137, 9, 54,215,194,245,172,223,175, - 23, 14,124, 63,246,239, 13, 38,175,116, 40, 88,185,200,143, 51,188,239, 6,213, 67,246,187,239, 97,103, 75,113,203,211,167, 98, -201,129,246,208,227,211, 97,236, 43, 71, 23, 98, 58,148,109,138, 13, 6,201, 39,155,227,212, 33,183, 93, 42,226,181, 75,118,196, - 77,201,240,215,196,193,136, 40,173,170,161, 8, 74, 99, 97, 63,137,100, 57,228,120, 71, 67,187, 50, 3, 59,218, 5,201, 43, 11, - 41,204,138,156,131,221,152,222,243, 44, 14,166, 67, 49, 14,142,114,253,125,145, 81,170, 76, 18,180, 2,175,230, 1,239, 68,141, - 64, 40,253,189, 62, 16, 51,181,160,116, 14,254, 6, 57,160, 73,204,214,184,180,147,197,136,163,153,152,168, 58,160, 63,117,206, -144,208, 33,131, 97,236, 97, 71,225,104,148, 96,112, 85,232,218,244,124, 52, 49,173,101, 42, 75, 12,172, 99, 82,118, 56,151,254, - 44,115, 39, 50, 47, 37,216,222,187,209, 52,197,222,211,192,186, 11,140, 29,156, 94,174,250,117, 80, 24,167,117, 72, 39,137,120, - 22,157, 20,104,146, 20,254, 13, 41, 39, 32, 39,209,161,153, 93, 97, 68, 85,221,246,190,119,198,206,204, 41,143, 89,226, 39, 12, -159, 77, 20,187, 31,205, 15, 33,230,168, 99,151, 78, 0, 17,233,165,147, 77,167,248,218, 17, 68,232, 4,218, 78,233, 72,254,181, - 93, 23,241,222,225,124, 76, 73,131, 26,137, 93, 10, 92,153, 77,119,137, 59,187,200,250, 18, 90, 69,169, 32, 42,193,193, 58,116, - 56,173,208, 78,232,214, 27,214,171,200,228,224,136,139,143, 63,162,174, 61, 77,219,178,174,199, 44,227,112, 51, 72,129,202,185, -162, 88, 15,233,142,219,126, 23,189,179,102,164, 63,223, 40,207, 28, 15,203, 32,252,112, 5, 31, 93,222, 99, 58,154,242,239,156, -223,197,199,150,175, 94,252, 97, 82, 77,248,154,227,233, 33, 15,235, 41,241,230,211,104, 50,210, 96,209,117,188,243,112,193,115, -135, 87, 65, 28,161,105,185, 49,159, 39, 4,108, 62, 97,177, 94,178,214, 17, 79, 31, 93,229,127,250,167,111,240, 23,190,241, 44, - 62,180,204, 93,224,214, 92, 16, 55,226,185,207,222, 30,172, 20,204,227, 36,216, 42, 52, 39, 12, 86,192,199,143,206,249,133, 47, - 63,195,119,223,122,204, 93, 7, 47,190,254, 6,211,201,140,229,114, 73, 83,160,141, 89,208,145,209,178, 14,216,219,131,221,107, - 32, 53,124,251,125, 56,239,224,133, 29,184,125, 0,151,199,208,174, 90,212, 21, 9,134,182, 74,156, 24, 71,104,234, 29,129,200, -190,192, 23,125, 75, 27,210,103,112,232, 86,188,232, 39,124, 63,182,204,164,226, 84, 91,118,253,148, 25, 13,215, 36, 38,100,220, -158,135, 91, 62,112, 12,236, 41, 44, 34,220,244,240,170,252, 19,218,182,166, 66, 5,169, 52, 73,211, 36,226,240,137,205, 41,158, -168, 70,227,178, 67,177,167,202,136, 16,218, 46, 21, 71,155,214, 53,167,126, 72, 28,224, 24,243,218,118,142, 68,170, 67, 44,225, - 77,168, 17,162, 11, 3, 59, 59, 38, 2,208, 88,180,152,170,134,120, 73, 68,104, 80, 90, 47, 76,173, 56,140, 85, 25,171,177,142, - 21, 86,149, 82,217,135, 48, 47,111, 52,155, 74, 92, 49,233,120,155, 66,146,117,101,130,171, 43,211, 57, 85,222, 28,167,156,117, -176,118, 88, 71,236, 70,206,158,240,190, 15, 62,178,212, 47,240, 86, 73,130,104,138,116,180, 98, 19,237, 6, 9, 36, 13,108,107, -242,150, 11,115,247,218, 69,217, 97, 56, 68, 66, 1,249,248,173,225, 82, 6,121,146, 21,207,170, 48,205,200,205,129,194, 64,104, -176,207,208,185, 1,206,175, 52, 29,162, 93,150,150, 37,179,169, 45,243, 25, 87, 22, 91,123,224,243, 13,223, 20,123,247, 57, 48, -210, 33, 62, 83,216, 70, 23,226,147,196,191, 76, 44,236, 25,214,130, 22,133, 59, 71,171, 22, 36,108,246, 81, 86,118,232,102,142, -135,239, 73,117,244,106,133,168,195, 78, 91,179, 65,139,100, 86,119,122,208,189, 79,174,113,206, 13,171,148, 60,181,122, 73, 38, - 71,106, 69,100, 25, 97,233, 5, 31, 18,236, 94, 27,202,130,105,217, 61,218, 27, 23, 85,146, 21, 17,186, 53,169,231,215, 26,178, -241, 76, 28,174,129,232,160,202, 64, 97,105,197,162,211,116, 15, 87,209,166,193, 14, 92,157, 77,132,172,240,218,148,149,239,173, -104,247, 82, 79,250, 42,194,132, 74,158,129, 56,147,109, 25, 95, 2, 87, 4,175,232,128,182,248,194,116, 41,203,195,186,220, 64, - 90, 17, 76,113,199, 67,211, 87,134,183, 72, 49,185,227,134, 4, 55, 52, 61,119,249, 62, 81, 96,238,134,162,161,190,240,153,135, -173,207,154,110, 72,108,219,210,205,219,174,127,142, 90, 26,158,145, 17,213,194,111,236,135, 69,151, 6, 5,103,250,252, 46, 14, -141,160,160, 67,254,129,125,243,152, 99,133,237, 30,113, 50, 68,203,170, 17, 18,181,183,226, 77,124,135,124,191,101, 85,138,203, - 25,137,226,232, 66,250,217, 21,105, 47, 31, 68,210,127, 86,116,218, 46, 36, 23,187, 24,211,174,218,200,154, 82, 9,109, 19,104, -103, 21,225,228,152,230,228, 4,223, 86,184,170, 38, 32,156,159, 47,160,142,172, 86, 27,244,252,132,205, 38,176, 94,119,140,231, - 51, 54, 93,131,211, 41,237,229, 5,171,233,156, 15,215,214,164, 12,219,188,158,104,233,123,182,183,246,163,144, 24,122, 22,187, -164,109,143,246,108,118,113,136,240,189,148, 26,246,175, 48,175, 91,254,197,157, 11,206,180,229, 27, 71, 7, 28,156,124,146,188, - 70,101, 72, 91, 28,105,203,245,243,251, 92,143, 16, 30,126,192,247, 71, 83,238, 78, 15,121,230,233, 27, 60, 59,159,243, 31,254, -217,111,242,247,255,239,223,224,233,153,176, 55, 85, 36,180,184,230,130,163,205, 37,179,110,195, 81,179,100,252,254,130,247, 63, -120,131, 7,159,125,145,166, 30, 81,171,242,213,103,246,184,123, 25,248,197, 95,248,183,184,243, 91,175, 33, 85,186,242,206, 12, -121, 92, 70,224, 76,182, 20,230,115,174,204, 79,185,123,222,176,222, 44,153, 95, 57, 96,181, 94, 34, 53, 52,164,220,136,176,232, - 88, 3,183,106,144, 49,132, 67,120,233, 69,248,237, 63, 20,100,164,188,250, 5,224,189, 68, 63,248,220,243,240,246,191, 74,131, - 31, 33,153,162,229,231,250, 21,127,198, 59,237, 12, 47, 13, 81, 19,226,131, 40, 7,186,160,203,171,177,168, 60,205, 5,151,126, -194,134,138, 51, 93,179,139, 48,142,158,219,254,130,209, 20,218,101,122, 86, 47, 28,248, 26, 62,109, 82, 83,220, 5,168,142, 4, - 31, 90,170, 30, 87, 55, 83,151,160, 93, 79,123, 22, 73,174, 91,206, 22,229, 98, 7,176,104,239,176,222,159,218,206,168,228, 49, -164,221,181,102,154,117, 97,121,168, 49, 18, 53, 90,162,147,237,180, 37, 61,132, 41,230, 49, 38, 57, 73,200,141,114,218,167, 59, -211,209,122,201, 16,200,144, 64,166,177, 40,184,185, 8,196, 1, 22,170, 76, 51,234,158,200,249,238,161,112, 59,137, 84,212, 10, -151, 21,155, 98,202,204, 55, 35,174, 56,232,138,189,183,207,133,193, 37,246,111, 46, 92, 46,155,227,216,161, 89,187, 36,243, 19, -171,150, 19,133,163,204,180,215,194, 0, 67,210,235,142, 49, 31,150,217, 99,125,216, 79, 71,217, 54,248,210,162,136, 86, 36, 56, - 79, 36,145,133,156,233,229, 51,246,234, 76,126,215, 70, 88, 59, 11,217,208,212, 77,102, 19, 25,149,129, 5,159,119,242,253,190, -152, 33,115,251,168, 64, 21, 68, 11,199,180,226,235,188, 22, 12,245,226,250,215,217,229,206,253,120,241, 47,217, 41,193,193, 28, -161,147,161,202,187, 94, 59, 47,125, 88,137, 35, 29,170,209,238, 71,151, 67, 90, 44,210, 83,109,111, 48,164,206,165, 67,171, 11, -209,220,214,146, 85, 40, 70,178,108,128,115, 77,177,163,149, 42,181,125,255, 0, 44,172,176,186,173,207, 96,200,227,206,216, 93, - 46,100,153, 89,159, 45,232, 43, 25, 80, 36,239,100,139, 25,159,175,103,229, 6, 27, 87,151,227, 71,157, 77,199, 69, 80, 80, 14, - 67,201,211, 73,249, 89,104, 31,185, 59, 88,186,198, 66,199, 29,237, 0,170, 44,156,133, 66,221,213,233,182,129, 80, 86,192,139, -232,150, 77,173,133, 24, 39,226,148, 49,229, 93, 1,233,151,188, 10,111,107,140,122, 52, 16,210, 74, 71,175, 88, 10, 89, 92,113, -191,219,125, 93, 46, 58,251,112, 37, 55, 60,168, 99, 47,140,173, 49,172,179,172, 44,199,137,155,199,129,235, 17, 42, 43,246,121, -165,227, 6,191,231, 88, 24, 50,249,130, 63,146,205,122, 52,216, 26,203, 94,112,180,208,153,254, 1, 40,252, 0, 8,209,160,223, - 20, 71,157,213, 4, 53,174, 87, 17, 84,226,146, 9, 14, 16,219, 36, 23,118, 26,204, 9, 81,113,157,114,126, 17,232,170,134,205, - 7, 15, 56,127,124,204,229,229,165,169, 19, 2, 46, 8,163,113,205,167,159,108,216,223, 29,227,234, 49,209,213, 44,219, 5,199, - 23, 75,198,139,142,249,238, 46,163,195, 61, 62,110, 98,239, 93, 81, 89,193,246,110, 32,201,142, 10,178,164,151, 33,153,207,153, - 97,146,100,197,131,157, 75,162,112,184, 91, 67,115,194,225,243, 47,241,231, 14, 61, 63,120,231, 45,206, 31, 62,226, 20,229,219, -157,240, 76,165, 60,180,161,161, 65,120,250,169,219,252,238,221, 79,121,121, 54,226, 79,191,248, 89,226,115,183,248,219,191,249, - 59,252,218,175,252, 10,127,231,191,254,207,121,189,122,138, 95,110, 63, 37,154, 49, 85,206, 15, 80, 39, 44, 37,173,195,110, 76, -198,140,191,255, 38, 46, 42, 31,118,194,239,253,224, 93,254,105, 55,226,175,255,197, 95, 66,221,107,140,167, 19,220,168, 66,196, - 51, 59,216,199,213,158,157,163, 67,118,175, 95,101,178,187,139,171, 91,214, 39,103, 28, 47, 79, 56,125,188,226,133, 87, 31,241, -249,167,224,219, 63,130,135, 43,229,232, 10, 92,236, 8,171, 99,229,119, 91,184,177, 3,191,246, 69,248,222, 59, 80, 79,149,229, - 6,218,247,225,203,215, 96, 83, 65,104, 96,127, 31,154, 13,108, 86,219, 74,160,169, 68,118,165,194, 81,243, 40,174,104,169,217, - 85,104, 93,205, 84,155,190,150,206,104,249,156, 58,206,213,243, 32,206,241,174,225,155, 87, 47,210,115,110,241,229,135, 35,240, -107,120,169,134, 23,191, 1,247, 34,252,189,223,133,199,247,172, 46,253,230, 31,191,173,162,130,247, 62, 25, 76,152,113,139, 72, - 98,179,187, 30,127,147, 65,247, 29,213,246,143,253,246, 21,141, 17,241,206, 92,137,204,173, 42, 70,211,111,134, 68, 22,242, 36, - 9, 66,134,126,132, 36,137,195,140, 28,212,136,116, 46, 89,193,198, 24,211, 14, 44,127,141,164, 66, 87, 89,209, 89, 27,219, 94, - 25,216,199, 98,114,166,153,237, 71,114,113,206,211, 74,206, 20, 39, 22,161, 76, 38,197,131,109, 87, 45,205, 89,212,206, 32, 69, -243,161,110,181,136,186, 20,233, 59, 86,124, 34,199,196,152,152,209,157,166,169,163,138,219,112,142, 47, 36,100, 81, 6, 22, 89, - 40, 96,193,193, 33, 78,183,114,127,179,103,186,151,109, 67,144,152,167,143, 62,250,148, 33,199,218,214, 6, 29,131,190,190, 69, -105, 67, 42,152,143,227,118,202,154, 43, 44, 99, 51, 97, 74, 11,191,113,117, 48,142,176, 87, 76,152,177, 32,214,148,214,161, 79, -250, 7,184, 18,134, 47,164,131,121,114,210,130,165,173,110, 91,250,215,217,245,150, 98, 74,115, 5,233,236,200, 11, 99, 51, 69, -138,182,234,224,137, 29,160,154,106, 32, 90,113, 70,135, 92,237,126,186, 50, 22,251,105, 72, 82,198, 24,149,218,214, 69, 65,149, - 85, 76,107,136,114,154,140,133,119,191, 60,145, 88,167, 69,192, 16, 69, 92,173, 74, 74,165,235,205, 96,138,154, 48, 17,216,103, -216,225, 59, 82,103,142,203,174,123,186, 93,104, 92,134, 82,135, 84,187, 60,141, 33, 50,172,117,156,177,220,173,145,238,225,230, -162,152,150, 90, 74,141,244,249, 15,253,250,160,128,106, 93, 89,148,251,107,169,101,116,129,101, 51, 12,133, 91,139,103, 47, 20, - 13,114, 44,214, 65,250, 4, 89,171,191,166,193, 2,108,138,134,198,101,143,121,129,105, 37,204, 19,147, 17,103,202, 4, 12, 97, -163, 63,219,204, 50,215,222,176, 20,205, 98,254, 28,242,144,227,178,119,132,105, 88,189,157,131, 33, 24,159, 32,251, 68,184, 1, -134,114,162,253, 36, 31, 98, 25,180, 68, 31, 7,219,217, 51,182, 54, 34,202,198,226,108, 91, 59, 59,130, 53,152,121,253, 23, 66, - 58, 55,174, 28,204,216, 4,229, 96,103,194,254,222, 46, 46, 4,218, 77,195,168,114,172,150,107,198,147,154, 54, 4,154, 46,208, -118,145, 81,237, 89,172, 59, 30,174, 90,150, 81,121,247,241,146, 40,137,240, 57, 20,112,233,163,181,123, 85,137, 12,196,199,140, - 0,250,114,231,158,125, 53, 50,247, 64, 6,226,234, 38, 42,159,180, 38,227,140,195,243,157, 27,197, 87,159,189,206, 81, 83,241, -238,230,130, 63,117,251, 26,187,123, 71, 84,251,115, 94,124,225, 51,196,157, 49, 65,225, 47,253,247,127,143, 87, 63,247, 37,254, -218,171, 71, 28,183, 74,236, 26,186,197,130, 14,101,134,242,255,126,231, 93,126,246,139, 47,242,229, 47, 62, 15,178, 78, 33, 54, -179, 25,218, 53,252,167,255,224,117,254,135,255,224,167, 9,109, 76, 76,175,106,148,116,246,171, 85, 98, 53,111, 86,168, 38, 77, -202,157,127,253, 61,238, 60,190,228,243,183,158,227,218,139, 31,242,123,191,213,242,105, 11,199,192,157, 13,236, 78,225,178,129, -233, 12,254,230, 95,133,147,111,193,183,222,132,187, 45,236,239,192, 51,192,222, 1, 28,237,193,238, 4, 62,188, 11,223,249, 20, -158, 57,244,172,238,133,190,177,142,192,194, 85,252,197,159,234,120,235, 93,248,116, 3,127,230,167,225,206,189,100, 88,117,185, - 72,255,205, 39, 48,159,193,179, 7,176,218,164,115,230,116, 41,184, 29,225,173,143, 35,218,194,205, 93,152, 77, 97,231, 16, 78, - 47,225,185,231,210,121,117,109, 23,254,229, 63,130,170,107, 99,218,237,196,206, 44, 79,179,182, 53,251, 70, 15,123, 85,177, 39, - 81,140, 77,140,177,217,197,187,244, 0,231, 24,209,220,217,229,246,207,110,138,204,158,173,164,100,236, 40, 26, 98,255, 32,137, - 75,112,181, 71,241, 57, 22,209,219, 30, 20,139, 50,181,105, 37, 63,112, 89, 27, 92,229, 18,100,238, 1, 9,174, 76, 55,159,198, - 68,210,235,209,131,173, 41, 32,253, 44,205,133, 82, 6, 13,171,214,185,219, 54, 66,149,237, 41, 85,134, 93,183,183,226, 29, 67, - 68,213, 37,130, 68,149, 26, 11,215, 71,180,166,201,165, 39, 19,161, 91,251,246, 12,211, 58, 51,246, 8, 5, 75,220,217,142, 54, - 7,100,136, 29, 56, 72,177,143,181, 41, 82,101,219,132, 70,117,128,212, 70,182, 19,239, 44,165,170,118, 73,106, 54,118,112, 63, -235,246,227, 48, 93,107, 97, 64,146, 93,229,118, 44,193, 79,101, 43, 62,187,215,252, 11, 3,212, 26, 10, 41,156,150,178,186, 30, -105,208, 45, 84, 67,217,102,105,171, 14,147, 83, 46,228,209, 96,204,188,190,232,175,155, 77, 75,121, 47, 44, 78,136, 33,246, 76, -188,124,157,189,232, 22,139,187,143,137,213,100, 39,235,156,112,177, 9,201, 23, 65, 64, 66,100,156,201,154,118, 47,117,164,169, - 61, 50, 20,181,232,134,195, 63,234, 19, 44,245, 66,243,223,103,143, 23, 44,117, 74,212,168,248,218,214,212, 27,163, 39, 51,232, - 85,123,116,163,111, 20,182,138,187,246,240, 56, 3,233,186,231, 75,196, 66,250,166,197, 7, 84,198, 2,244,191, 47,120, 41,165, - 97, 80,138,238, 29, 14,245,252,231, 93,102,219,235,112, 61,164, 48,127, 82, 67,137, 92,225,218,151, 95,155,152,247,190, 20,225, - 48, 90, 56, 20,198,242,190, 46, 50, 18,242,189,217,228,215, 29,210,138,101,251,122,202,118, 0,142,108, 27,210, 72, 65, 62,205, - 22,204,131, 5,174,121,115,104, 50,124,200,185, 12,174,216,213,151, 72, 89,214,253,151, 10, 2, 41,208, 28, 45, 26,187,145, 75, - 22,220,181,147,254,190,246,181, 17,232,188, 16,187,228,177,128, 75, 65, 87,143, 30,157,179,136,202,189,199, 23,168, 62, 68, 80, -206, 34,220,239, 96, 99, 13,249,142,104, 58, 39,251, 85, 92, 38, 80,106,218, 47,219,189, 17, 72, 5,216, 91,244,172,195,140,117, -242,116,110, 82,192,188, 27,206, 30, 61, 29,233,251,120,251, 0, 98,217,168, 1, 43, 21, 46,163,246,195, 79, 96, 32, 22,127,249, -202,156, 47,132,150,199,103, 11,174,187,142,197,233,134,187, 15, 63,226,203, 95,124,137, 31,190,241, 22, 85, 93,115,120,176,199, -127,246,242,231,208,121, 77,115,118,198,229, 15,223,102, 62,174, 24,183,145, 43,183,174,242, 27,175,253,136,163,163, 61,190,244, -252, 45, 94,251,246, 31,242,139,191,250, 77,238,127,247,117, 78,127,255, 13,254,139,111,223,101, 19,133,199,143, 94,225,195,127, -245, 59,248,209,136,157,195, 57,174,170,122,233,230, 24, 37,224,216,156, 47,184,115,177, 65,124,197,229,179, 23, 84,103, 45,237, - 12,154,179,244,117, 47, 76,210, 71,190, 43,240,215,126, 13,218,199,240,240,177,121,116,212,176,211,130,159, 39,164,195,249,116, -192, 94,153, 65, 92,194,248,170,176,145,225,253, 7,133, 63,251,243, 29,247, 31,193,102, 12,183,174,129, 27, 65,215,193,253,199, -105,157,121,222,192,247, 78,224, 63,254, 85, 24,159,193,233, 73,106, 40,158,122, 90,217, 92, 42,127,254, 87,110,114,249,254, 61, -222,249, 65,228,214,139, 48,158,142,184,121,181,225, 98,147, 38,247,247, 62,130,201,204,234,107,232, 66,154,204,125,218,125, 59, -163,228, 70,183,173, 57,234,101, 85, 33, 29,168, 98, 55, 36, 33,152,131, 89, 50,172,201,147,145, 26,155,204,147,138,161,196, 68, - 84, 11, 93, 34, 42, 73,140,125,247,239,197,210,159, 44,255,219,229,131, 79, 7, 22,186,216,174,186, 63,160,141, 4,150,137, 60, - 61, 51,220, 75, 63,197,122, 49, 15,230,108,255, 57,240,192,250, 7,203, 25,228, 94,134, 90,144, 15,150,172, 51,245,105, 26, 19, -211, 14,119, 58, 96,114, 25, 54, 87, 73,222,240, 99, 77,254,242,229,132, 29, 13,211, 78, 59, 54, 73, 15, 69, 62, 4,243,196, 96, -144, 99, 20,161,178,194, 19,237,129,118,182,151,175,200, 30,230,177,159,132, 52, 79, 18,174,156,232,135,131,164, 43,166,229,169, - 89,205, 46,116,240,131,151,168, 60, 69,193, 8, 38, 71,103,234,192,114,215,193, 53, 78, 11,184, 61, 22,112,187, 22, 68, 48,151, -101,125,197,196, 90, 66,240,190, 32,125, 61,153, 54, 87,234,228,133, 1, 94,118,206, 98,107, 53, 82, 33,108, 98, 34, 18,121,115, - 77, 91,199,228, 0,230,141,201,152, 15, 92,162,166,181,134, 73, 37, 85,134,233, 83,138, 10,161,154,214, 77, 27,155,188,147,133, -237, 96, 14, 20, 37, 49,123,235,130,163,145, 27, 65,220,128,216,212,197, 46,154,156, 59,222,219,142, 26,226,243, 4,187, 54, 35, - 66, 82,120,169,119,214, 56,118, 89,181,208, 65,109,141,170,211,159,224, 80,100,104, 67,249,231,133,175,138, 93,203,216,243, 36, -122, 35, 25, 41,136, 82, 79,124,219, 82,247, 30, 98, 97,183,154,243, 17,114, 17,163,224,207,144, 44, 73,125,230,166,232, 0,187, -247,153,240, 37, 65,243, 73,238, 75,145, 91, 80,198, 26, 87, 86,120,163,161, 95, 89,109,145,253, 18, 36, 59,221, 89, 99,224, 10, - 8, 34, 35, 92, 72, 94, 93,216,179,108, 63, 44,111,167, 50, 97,208, 27,243,181,215,133,216, 17, 34, 70,232,205,207,156,147, 97, -221, 80,122, 44,100, 94,140, 47,114,232,183,197,206, 57, 16, 73,251,152, 98, 33, 80,145,252,223, 51, 67,176, 54,163,151, 32,137, -175, 51,117,142, 35,148, 46, 14,217, 12,215, 21,174,214,106, 9,106,208, 21, 55, 68, 40,116,250,173,216, 74, 98,208, 80,244, 50, - 95,183,133,172,201, 22, 95, 33,147,233,122,137, 94,225,101,145, 51, 33,162, 53,161, 77, 84,206, 3,156,134,193,156, 43, 22,166, - 93,175, 61, 92,240,219,186, 96, 82, 57,174,213, 53,239, 63, 56,102,207,193,244,221,119,121,241,230,117,166,126, 66, 56,126,204, - 87, 63,255, 28,107,133,197,225, 17,191,254, 15,255, 77,127,238,200,155, 15,249, 79,110, 31,176, 63,134,223,255,255,254, 37,179, -233,132,245,102,195,225,151,190,204,254,171, 95,226,127,249,133, 37,247,190,247, 67,214,213,156, 55,206, 55,140,234, 72,125,188, - 68, 66,100, 82, 37,124,107,213,180, 56, 95,177,232, 34, 11, 17, 30, 44,214, 60,243,218,138,207, 94, 73, 7,228,205,153, 41, 85, -234, 52, 45,207, 38,112,252,238, 28,255,212,130, 79, 23,176,119,148,248, 46,143,143, 83,113, 95, 52,214, 96, 46, 97,114, 8,215, - 15,225,104,174,188, 31,134, 70,111, 54,203, 94, 44,240,240, 12,254,237,159,129,243,187,233,153,152,213,233, 76,152,143,224, 41, - 67,100, 42,129, 56,130,105, 35,184, 78, 25,207, 96,245,224,152,195,151, 15,184,249,224,152,176,128,189,195,134, 22,184,125, 11, - 30,190, 11,227,155,240,204,103,160,234,140,245, 81,105, 0,241,118, 67, 70,243,197,182, 46,178,170,172,179, 29,124, 67,213, 41, -177,141, 6,207, 27,188, 24, 99, 63, 33, 57, 39,168,153,253, 7,115,103,138,153, 88, 97,134,209, 78,211,215,246, 19, 24,113,216, -127,199, 28,245,169,253, 65, 66,145, 72, 90,217, 65,169, 93,222,155,217,100,208, 31,142, 25,194, 78,198, 14, 89, 63,239,122, 8, -108,120, 40, 53, 67,120,229,195,106, 6, 54, 33, 23,221, 98,210, 8,110,128, 17,213, 13,218,245,138, 36,185,203, 9, 86,195, 40, -149,186,167,141,233,163,131,237,125, 51,235, 56,179,100,181, 96, 72,247, 7,143,151,173, 98, 27,140,109,235,202,172,107,201,121, -233,249,112,209,194, 8, 35,177,114,139, 21, 44, 53,105,226, 94,106, 50,147,240,110,136,152,205, 48,123,182, 28,245,108,239, 47, - 51, 43, 93,139, 3, 53,239,139,181, 64, 14, 74, 25, 91,175,153, 46, 14,185,210,218,215, 61,113,128,244, 19, 86, 94, 7,101,137, -145,153,172,100,104,185, 50, 73, 90,107, 59,241, 40,105,226, 78,204,243,244,193,230,226,236,141,204,152, 8,157, 89,150, 34,253, - 30, 57, 23,196,243, 64,111, 48,226, 93, 33,188, 55, 66,156,151,225,243,117, 38,170, 29, 95, 0, 0, 6,177, 73, 68, 65, 84,153, -247, 96, 71,228,200, 13, 54,164, 79, 54,195,206, 96,222,160,131, 51, 94,158,128,157,152, 81, 90,113,224,123, 51,175,185,208,194, -125, 79,161,109, 19,105,138, 2, 54,231,201,235,151, 11,174, 69,201,230,166, 40,145,113,242,231,148,213, 2, 58, 52,108,113, 32, - 70,150,222, 4, 90, 6, 93, 20, 30, 4,131,250, 34, 51,203,181,247,160, 79,156, 5, 29,214, 47, 70,232,140,197,110,189, 92, 73, -100,164,226, 73, 25, 81,223, 24,201, 96, 15,156, 11, 75, 85,174, 9,172,102,111, 98,226,136,236,122, 35, 50,186,226,123,229,201, -156, 18, 18,183,102, 78,183,191, 46,186, 60, 60, 36, 94, 79,176, 95,105, 82, 32,144,203,166, 70,174,120, 15,101, 82,157, 3,143, - 35,228,251, 67,180,164,250,144,235,118, 45,195,123,236,101,196, 86,228,199,168,169,100, 82,131, 82,249,172,141, 79,252,151, 46, - 19, 37, 17,102,182, 55,104,236, 89,108,237,194,119, 54, 8, 80, 72,186,134,196,190,129,213, 78,161, 56,233,139,183,157,113,149, - 13, 56, 35, 55,116,226, 82,160,103, 62, 19, 9,179,244, 19,184, 18,183,215,126, 33, 14,240,123,101,134, 62, 15,186, 77, 47, 95, -252,189,179, 21,225, 71,159,210, 69,184, 86,193,245,186,226,235, 55,175,241,226,222, 14, 27, 77, 40, 68,254,184,255,206, 71,167, -160, 48,169,224, 86,237,249,199,255,213,223,229,218,222,148,175,188,252, 25,158,255,202,171,236,124,249,101,214,247, 30,240,131, -241, 46,143,238, 63,102,228,182,117,230,109,132,165,182,125,163,187, 7, 92, 92,192,157, 6,158,221,135,147, 75, 56, 89,109,175, - 12,223,252,116,197, 11, 59, 66,125,164,172, 3,156, 63,132, 77, 7,255,250, 99, 56, 94,195, 47, 41, 28,206,161, 91,194,245,219, -240,143,223, 8,169, 22, 89,243,246, 39, 95, 78, 80,251,227, 5,172, 60,116,199,240,254, 3,104,218, 36,231,236, 52, 69, 2,239, - 78, 97,189,132, 79, 63,129,218, 24,225,235, 21, 28,220, 80,218,227, 6,247,226,156, 27, 47,192,163, 79, 96,118, 5,214, 43,152, -205, 18,163, 59, 25, 36,129,252, 31, 95,127, 74,243,142,220,155,251,153,144, 66, 7,156,243,116, 33,244,140,228, 65,150,152,164, - 63, 33,116,198,236, 28,160,166, 72, 50,249, 16, 81,243, 68, 54,242, 18,195, 8, 25, 67,138,240,203,198, 54,138, 49,179,131,246, -105, 18, 90, 64,210,146,163, 82,173,234, 68,131, 94, 67, 72, 59, 45,177,187, 83, 25, 96, 61,177,131, 92,109,186,214, 66, 27, 76, -180, 66, 87,102,120,228, 46,221,228, 41, 25, 53,200, 93,119,126,112,187, 98, 2, 14, 20,154,236,226,112,225,137,157,106, 44,172, -103, 99,145,101, 30, 24,200,118,226,182,119,142, 20,222,195,165, 33, 70, 57,129,247,122,246,130,188, 87,234,221, 7,232, 92,249, -177,243, 95,147, 76, 43,191,134, 42, 90,236, 43,195, 26,192,214,151, 73,218, 84, 90, 39,234,118, 1, 46, 9, 81,108,203,192,183, -138,192,147, 80,164,176,173,133,245, 67, 61,121, 34, 15, 94,182,118,243,153,153, 44,133,123, 92, 32, 57, 14,142, 36, 89, 22,147, -249, 32,121,167,108,190,215,222,154, 42,113, 73,186,168,249,144, 39, 77,243,103,161,104, 54, 10,203, 88,213,196,225,200,213, 56, - 40, 91,133, 53,232, 96,246,162, 91,217,204, 67,163, 40,100,100,102,187, 65, 45,171,121,223, 72, 62,113,221,118, 53,161, 44,206, -100,111, 84,210,115, 51,228,137,175,237,111, 71,209,193, 97,239, 39, 76,190,133,179,114,239,104,168,229, 53,182,226,220, 19,235, -182,123,149,129,192, 87, 76,115,177, 32, 11,150, 90,231,158, 5, 31,117, 59,242,184,252,148, 11,144, 65,101, 59,105,209, 11, 3, -217, 47,135,212,196,237,245, 65, 43,201,246,120, 94, 9,243, 58,121,176,247,226, 29,111,236,116,187, 80,149, 31,220,245, 50, 31, - 33,102, 35, 35, 55, 20,102, 41,214, 1, 94,205, 41,200, 48,213,188,222,160, 88, 21,136, 69, 83, 43,210, 19,231,242, 42, 5, 82, -106, 92,134,194,123,165,134, 75,124,145,172,139,207, 97, 57, 99,147,252, 69,151, 8,194, 73, 85,108, 83,186, 33, 56, 49, 36, 52, - 39,239,225,179,156, 54,104,236,135, 5, 10,178,107,118, 71,244, 61,178,177,157,156, 24,202,207,214,158,141, 32,169,201,196, 6, - 15, 91,178,226,220,118, 19,153,185, 40,119, 54,202, 42,123,121,196,129, 63, 16,116, 72,122,212, 2,146,215, 66, 23,175,197,170, -197, 65,127, 70,149, 95, 91,254,191,148, 94, 6,246,141,159, 31,123,110, 31,236,240, 40,194,221,199,103,204,221, 48, 84, 92,196, - 66,162, 9,204, 12,189,244, 21, 91, 67, 76,121, 79,150,228,205, 45, 51, 26,133,211, 56, 32,161, 19,159,134, 58, 9,195,247,201, -213,241,212,234,203,151,175,195,215,174,195, 59,247,225,225, 26,126,241,153, 52,165, 63,184,128,239, 60, 74, 77,209,216,195,159, -127, 41, 33,139,237,169, 99,103, 63,114,103, 1, 93, 39,236, 79,149,229, 5, 28,222,132,189,125,184,118, 13,190,245, 86, 90, 5, -140, 42,168,230, 32,191,241,181,235, 9, 61,244,201,218, 52,183,202, 94, 48,143,244,225,102,197, 2, 31, 36,187,100,185, 12, 33, - 25,171,218,165, 29, 80,234,164,109,146,209,228, 15, 47, 34,132, 24,140,157,155,136,105, 82, 84,170,100,221, 24,183, 18,235,165, - 36, 25,153, 92, 76,159, 56, 88,242,169,170, 97,123, 39,230, 92,102,209,219,238, 53,232, 86,225,204,210,154, 50,193, 41,147, 97, -156, 47, 60,128, 25,220,229, 52, 14,135,184, 22,108, 96,108,170, 42, 3, 92,144,193, 94, 52, 75, 94,122, 56, 62,107,171,117,219, -189,170, 12, 70,225, 9, 91,194,242, 6,115, 79,160, 22,169,129,210,173, 9, 42,239, 11, 93, 81,101,123, 66,150,237, 61,181,232, -128, 71, 85,146,172,180,113,216,157,161, 67, 49,239, 39,249,254,115, 41,175,229, 86, 2,108, 95,204,159,168,203, 67,136, 87,182, - 47, 85,221,154,204,134, 98, 52,124, 3,145, 31, 47,236,137,249,238,250,127,159, 15,231, 65, 78,101,145,172, 35, 25,156,214,158, -112,180, 19, 55,232,237,212, 37, 50,230,178, 63,128,148,177,184,158, 4, 74,138, 55,232, 63, 23, 45,118,241,177,248, 92,243,212, -175, 5,172,148,247,205, 90,248,238,111,191,163,237, 38, 73,133,159, 96, 76,153,126, 55, 33,169, 0,106, 39,125, 33, 26,106,154, -246, 36,176, 30,110, 31,170,245, 54, 9,110,171, 65,226,199,246, 31,174,220,169,231,221,179,219, 54, 30,114, 79, 56, 6,254, 24, -156, 94, 24, 17,121, 43, 74,177,159, 4,211, 10, 42,199, 16,187,178,185,165, 64,230,158,124,205,102,145,219,175,204,194,118,228, -176, 74, 42,236,136, 48, 31, 75, 47,175,116,102,179, 43,144,236, 89,213,164,147,110,224,130,244,235, 30, 95,250, 32, 72,239, 73, - 33, 5, 10,229, 58, 37,110,202,142,116, 48, 55,113, 98, 65, 41, 81,251,125, 60, 49, 38,139, 79, 91, 65,148,198, 72, 93,220,190, -207,147,219, 95,186,243, 70, 73, 34,146,154, 23, 67, 89,186, 80, 72, 94,109, 32,106, 99,249,204, 15,188,230,220,108,230,117, 87, -136,165,185,149,157, 39, 61, 39, 71,173,120, 13,135, 72,230,231,244,232, 69,206,211,144,180, 47,207, 9,152,249,190,168,156,112, -222, 40,239, 54,197,115, 97,136,107, 44,134, 18,236, 94,118,102, 31,157, 7, 8, 95, 52,114, 99,243, 47, 88, 3,247,109,218,207, -235, 30, 39,112,203,184, 61,209,250,172,141,253, 58, 49, 95,139,172,184,233, 52, 17, 76, 37,194, 42,192,165, 14,231,196,145,201, - 54, 93,253, 99, 57, 96, 91,247,115,110,176,195, 19,145,222,103, 93,138,158,190,124,242,172, 83,184,237,179,103, 69, 66,143,238, -218, 25, 82,206, 62,149,189,255,103, 76, 38,125,170,112, 18,135,219,106, 92,240, 89,246, 5,174,249,193,233,110, 21,225, 1,105, -202,143, 10,215, 4,158,114, 48,217,133,255, 31,241, 38, 60, 68,184, 86,227, 95, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130, +137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, + 0, 1,245, 0, 0, 1, 26, 8, 2, 0, 0, 0,135, 56, 89, 17, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 11, 19, 0, 0, 11, 19, + 1, 0,154,156, 24, 0, 0, 0, 4,103, 65, 77, 65, 0, 0,174,211,164,123,114, 68, 0, 0, 0, 32, 99, 72, 82, 77, 0, 0,110, + 39, 0, 0,115,175, 0, 0,246,112, 0, 0,129,232, 0, 0,107,215, 0, 0,226,170, 0, 0, 48,131, 0, 0, 21, 42,251,118,133, +113, 0, 3, 0,167, 73, 68, 65, 84,120,218, 98,252,255,255, 63,195, 40, 24, 5,163, 96, 20,140,130, 97, 7, 0, 2,136,133,138, +102,253,249,249,253,223,203,235,127, 63, 63, 99,150, 50,102, 19,148, 28, 13,220, 81, 48, 10, 70,193, 40, 24, 64, 0, 16, 64,140, +212,106,191,255,249,241,237,247,230,124,150,143, 55,128,236,255, 12,204,127, 52, 35,217,204, 18, 89, 88,217, 70,131,120, 20,140, +130, 81, 48, 10, 6, 4, 0, 4, 16, 19,181, 12,250,255,242, 26,164,112, 7, 85, 26, 12,127, 89,174, 45,249,190,171,121, 52,124, + 71,193, 40, 24, 5,163, 96,160, 0, 64, 0, 81,173,124,255, 39,168,248,155,153, 7,216, 25, 0, 35, 16,193,246,116,255,151,205, +165,127,190,127, 30, 13,229, 81, 48, 10, 70,193, 40,160, 63, 0, 8, 32, 70, 42,206,175,254,120,126,243,239,193, 54,150, 79,119, + 17,141,122, 6,134,191,156,162, 76,206,237,156, 82, 26,163, 97, 61, 10, 70,193, 40, 24, 5,244, 4, 0, 1,196, 72,245,245, 51, +159,143,205, 99,189, 50,159,225,255, 63, 68,211,158,145,229,183,106, 16,183, 69, 50, 11, 39,207,104,136,143,130, 81, 48, 10, 70, + 1,125, 0, 64, 0, 49,210, 98,125,228,143, 59,135,255,238,111, 96,250,247, 3,218,134, 7,227, 63,156, 18, 44,110,237,156,146, +234,163,129, 62, 10, 70,193, 40, 24, 5,116, 0, 0, 1,196, 72,163,245,239,223, 95,221,251,191,187,138,225,243, 35,132,208,127, +134,191, 76,236, 76, 86, 37,220,186,222,163,225, 62, 10, 70,193, 40, 24, 5,180, 6, 0, 1, 68, 84,249,254,237,195,235, 63,119, + 14,253,120,126,249,255,159, 95,196, 27,205,252,235, 51,215,251,179,176, 38, 60,130,248, 99, 90,194,111, 18, 60, 26,244,163, 96, + 20,140,130, 81, 0, 7,255,254,253,251,254,253,251, 71, 48, 0, 50, 88, 88, 88,254,252,249,195,205,205, 45, 36, 36,244,245,235, + 87, 70, 70,198, 31, 63,126,124,251,246, 13, 82, 98, 75, 72, 72, 8, 11, 11,179,179,179,227, 55, 19, 32,128, 8,151,239, 31, 46, +237, 96, 58,209,195,252,247, 27, 68, 61,156, 96, 64,110,153, 99, 99,162, 9, 33,217,243,255,175, 94, 18,191, 77,218,104,140,142, +130, 81, 48, 10, 70, 1, 16, 0,203,244,135, 15, 31,242,241,241,241,242,242,242,240,240,176,177,177, 1, 11,244,143, 31, 63, 29, + 63,126, 76, 89, 89, 89, 76, 76,140,131,131,131,133,133, 21, 40,200,196,196,248,239,223,255, 47, 95,190, 60,124,248, 0, 88,244, + 75, 73, 73, 1, 5,113, 25, 11, 16, 64, 4,202,247, 95, 63,127,124, 91,224,203,242,247, 43, 3, 35,169, 14,254,143, 89,214,255, + 71,106,201,255,145, 48,231,245,106, 97,225,228, 29,141, 90,234, 2,120,132,226,137,245,145,224,134, 81, 48, 10,134, 74,179,253, +237,219,183, 79,158, 60, 49, 48, 48, 0,230, 23, 96,217,253,251,207,223,175,223,126,222,185,255,114,223,190,189, 26,106, 10,110, + 46,118,236,108,172, 64,193,191,255,254,255,252,249,231,219,143, 95, 63,126,254,225,229, 98, 23, 18,228,190,127,239,174,176,176, + 16,176, 33,143,203,112,128, 0, 98, 33, 42,183, 34, 10,107,244,236,202,136,209,110,255,143,213, 0,140,246, 60,243,243, 19,159, +151,199, 50, 59,212,240, 41,153,140,198, 49,229,229, 41, 16,124,248,250,227,194,131,215,144,178, 85, 79, 78, 88,128,155,131, 9, + 88,215,195, 0, 29,138,111,136, 51, 46, 60,120,245,225,235, 79, 32,131,166,110, 24, 5,163, 96, 24,128, 63,127,254, 60,120,240, +128,149,149, 85, 87, 87, 23,152, 65,158,191,250,120,227,206,139, 7,143,223, 60,124,244,252,209,131, 91, 92, 60, 2,191,152,127, + 10, 8, 63,248,249,235,239,171,183,159,190,125,255,245,251,247,223, 63,192, 98,254,255,127, 54, 86, 22, 89, 25, 17, 1,142,239, +114,114,114,120,204, 7, 8, 32,194,227, 51,223, 30, 95,250,115,105,197,175,175, 31,153, 88, 89,177, 20,240,159,158,177,124,125, +140,117,180,230, 55,155,240,127, 1, 57, 14,126,201,127,191, 62,253,120,243,148,237,219, 35,198,255,127,224,101, 61,220,214,127, +186, 73,130,246,233,104,166, 94,186,241, 96,235,249,187, 14,186,138,198,106,178,108,108,172, 67, 40,182,110, 61,120,190,243,226, +125, 75, 85,105, 11, 61,101,186,213,255,139, 14, 93,155,186,235,226,165, 71,111,145,197,229,132,121, 34,173,212,178, 93,245,132, +120, 57,153,153,153,169, 82,194, 66,138,239,210,165, 71, 58, 35,173,244,229, 69,153,192, 0, 34, 14,172, 93, 74,150, 28,222,124, +238,222,199,111,191,144,221,144,238,172,147,235,174, 15,116, 0, 92,241, 40, 24, 5,163, 0,152,101,222,189,123,247,250,245,107, +110,110,110, 89, 89, 89, 96,153,125,226,236,189,157, 7, 46,189,127,243,250,243,231,215, 92,220,252, 95, 62,127,144, 85,212,178, + 50, 86, 97, 98,102,190,126,251, 57,166, 9,192,220,244,246,213, 51, 39, 71, 43, 27, 19, 5, 22, 22,236, 57, 11, 32,128, 40, 90, + 63,243,238,236, 70,166, 83,253, 76,255,126, 34, 23,237,255, 25,152,126, 75,219,115, 24,132,115,202,232, 48,179, 32,250, 7,127, +190,127,249,126,125,231,239,115, 11,152,127,188,130,171,133,216,253, 95, 59, 86,208, 41, 23,217,228,221, 71, 47,120, 78,218, 1, + 84, 35,192,198,116,170, 45, 86, 73,142,192,105,101,249,147, 86,223,253, 8,114,134,151,158, 98,150,191,245,128, 68,216,179, 23, +175,108,107,150, 62,253,250, 27, 88, 7,206,138,177,143,243, 50,167,138,177,223,190,255,216,126,241, 1,144, 33,203,207, 97,166, +169,112,238,230, 35, 35,117, 68,141,253,254,203,119,183,182,245,151, 30,189,193,165,157,143,147,109, 83,145,151,145,146, 56, 11, + 48, 9,128,155,210,148, 56,230,222,203, 15, 22,181, 43,128, 37,248,166, 34, 79,123, 45, 89,160,153,192,130, 27, 40, 14, 44,244, +221,219,215, 35,151,236,200, 64, 71, 70,104,115,177,183, 8, 63, 55,196, 13,163,121,123, 20,140,240,146,253, 45, 24,176,177,177, + 1, 73,126,126,254, 63,127,254,157,188,240,224,232,241,211,156,236,156,255, 25, 25,248,248,132,128,170, 24,153, 89,228, 36,249, +213,212,213, 46, 93,127,241,247,239, 95,244,130, 27, 12, 94,191,122, 42, 38, 38,157, 20, 97,205,195,141,125,162, 21, 32,128,200, + 60, 63,242,231,151, 15, 95,143,204, 96,190,179, 1,109, 64,230, 55,135, 4,139,117,177,136,166, 45, 22,155, 56,121,120,141,130, +255,104,186,127, 62, 56,137,241,246, 6,148,246,254,149,197,159,132,228,248, 12,252, 81, 4,193,133,255,135, 95,127,127,252, 36, +188,104,231,196,205,167,103, 94,129,102,128, 21, 5, 7,108, 64,255,223,191,255, 79,128,133, 59,246, 33, 42,242, 1, 23, 39,135, + 36,203, 95, 96, 92, 78,221,124,156,155,153,177,107,193,246, 21,237, 25,240,132, 18, 58, 97, 43,114,225,174, 41,201,207,199,201, +250,233,251,239,235,207, 63, 66,251, 87,223,127,249,245,109,219, 80,224,110,162, 34, 5, 47,142,201, 3,192,186, 36,124,226, 86, + 72, 33,254,235, 23,176,171,248, 27, 98,218,131,215, 31,145, 11,119, 62, 14, 86, 77, 41,126, 32,227,228, 61,168,195,174, 60,121, +231,211,179,229, 96, 77, 0, 40, 25,140, 22,241,195, 11,124,249,250,243,238,253,215,112,174,178,162, 40,176,172,217,181,239,218, +177, 83,119,173,204,148,221,156,180, 72, 50,141, 72,141,104,150, 74,136,241,137,139,241,145,231,254,187, 15, 94, 47, 94,113,162, +161,194, 23,191, 93,250, 58, 50,212, 10,177, 7, 15, 30, 0,179,143,146,146, 18, 48, 47,112,115,113,223,186,125,107,253,150,163, + 60,252, 18,146,114, 26,192,252,241,255, 31,168,248,224,229,227, 84,146,224,224,224,226,218,176,105,167,172,130, 38, 19, 19, 51, +184, 76,135,244,128,255,255,254,253,243,199,143,111,111, 95, 61, 23, 17,147,150,145, 20,192, 85,184, 3, 1, 64, 0,145, 83,190, +127,123,245,240,235,166, 34,182, 31, 79,209,196,127,113,201,243, 4, 77,229, 20, 16,129,150,245,191,127,239, 61,121,109,203,165, +251,130,220,156,206, 26,210,214, 70,234,172,172,172,192, 82, 94,208,163,234,237,215,183,204,207, 14, 51, 32,141,204,255, 62, 54, +225,151,134, 43, 27, 7,215, 80,175,155, 25, 24,168, 63,202,204,195,195, 13, 36,181,100,132, 22,108, 59,166, 41,129,168,192,128, + 5,235,225, 27,207, 32,108,115, 37,145,206, 96, 35, 57, 17, 94,200, 80, 12,176,180,109,220,120,110,205,153,135,144, 34,190,115, +243,185, 37, 89,194,224,201,119, 50,155,240,255,254,253, 75,153,181, 7, 62, 4,244,231,207, 95,160, 8,100,192,189,100,201, 97, +120,225,158,235,172,145,239,162, 9, 25,141, 1, 86, 51,115, 15,221,156,176,251, 26, 80,252,234,211,247,109, 27,207,212, 4,154, +193,135,227, 71, 75,198,225, 1,128,101, 95, 67,199, 38, 68, 90,229,102, 47,201,117,255,242,237,231,197, 43,143,245, 72, 47, 19, +137,212, 8,177, 84, 95, 71, 22,194, 37,163, 34, 65,216,248, 5,100, 35,166,248,186, 45,231, 47, 93,121, 2, 44,247, 33,118,173, + 95,146, 69,149,150,251,163, 71,160, 45, 65,106,106,106,192, 44,240,225,195,167,109,219,182,187,123,122, 91,218,114, 94,185,245, + 76,132,159, 75, 84,136, 71, 94, 86, 68, 86, 74, 72, 12,152,145,153,152,158, 60,121,250,248,169,230,227,167,207,249,248,133,254, +254,253, 3, 90,237,242,229,211,175, 95, 63,216, 56, 56,129, 36,232,156, 94, 22, 38,125, 29,124,227,239, 0, 1, 68,114,249,254, +233,206,201,159,123, 27, 89,126,189,133,159, 63, 0,201,169,255,152, 56,184,220, 26,224,133,251,142,227,151,171,150, 29,188,250, +250, 43,164,204,235,220,126, 65, 73,248, 64, 95,180,189,151,149, 46, 80,132,223,179,238,203,202,184,255,159,159,195, 87,212, 48, +254,254,242,253,226, 6, 54,243, 40,244,226, 18, 44,255,236,229,155, 77, 39,110, 60,124,253,241,195,247, 63,192, 48,146, 17,226, +246, 48, 86, 53,209, 84, 64, 81,248,255, 63, 90,211,249,205,187,143,107, 14, 94,220,113,249,193,213, 7,175,222,126,251,197,201, +194,172, 32,193,239,162,167,152,236,106, 44, 39, 41,130,203,131,251,207, 92,223,116,234,214,201,187,207, 56,216,217, 12, 20, 36, + 2,205, 84,109, 13,212,208,212,220,188,247,116,221,137,235, 79,222,125,251,241,239,191, 32, 59,179,162,164,160,135,129, 18, 59, + 11, 19, 3,194, 9, 8,135,188,251,240,105,241,222, 11,155,207,220,186,251,242,227,151, 95,127,217,153,153,100,132,185,237,117, +149, 18,157, 13, 52,228,196,177,186,225,240,133, 91,221, 27,142,223,124,242, 6, 24,201,103,102, 22,114,115,178,255,255,255, 79, + 78,148,159,143,157, 77,150,159, 3,174, 76, 78,152,247,112, 93,144,119,247, 22, 55,109,169,238, 48, 19, 96,115, 0, 84,131,130, + 27,200, 92, 92,255,166,196,219,157,184,183,238,201, 59, 80, 20,236,188,242,244,205,199, 47,146,172,172,204, 96, 64, 70,186, 44, + 89,114,104,203,185,251,136,226,254, 63,180,112,191,255,234, 35, 92, 60,200, 72,182,192, 85,139,157,157, 29,216,241, 4,218,194, +195,195, 80,233,111,242,236,227,143, 85,167,238, 1,101,231, 28,188, 81,234, 5, 29,136, 31, 45,223,135, 31,104,168,240,155, 62, +239,192,203, 87,159,128, 45, 98,204, 38, 57,164,105, 31,232, 99,120,236,228, 93, 96, 33, 14, 26,235,187,255, 26,216, 52,118,115, +212,178, 50, 87, 6,106, 89,191,249, 60,144,251,229,235, 15,252, 26,149, 21, 68,129,138, 25,161, 54,250,162, 41, 6,214, 46,174, +142, 90,192,230,252,209, 83,119,131,124, 12, 33,226,192,166, 61, 68, 4,200, 5, 22,217, 64,110,102,146, 61,208,174, 93,251,175, + 1,185,112, 19, 22,175, 60, 1,233, 19, 0,107, 23,160, 94,160,212,139, 87, 31,129,165, 60, 15, 23,123,108,132, 37, 80,252,226, +149, 39,187,247, 95, 3,106,132, 84, 39, 64,147,129,238,129,248, 2,232, 60, 98, 26,248,207,159, 63,255,251,247,175,162,162, 34, + 48,253,191,123,247,121,203,230,205, 22,150,182, 92,156, 60, 62, 46,122,198,186,114,194, 66, 60,156,236,108,192, 60,138,200,224, +114, 50, 1, 30, 44,187, 15,177,158, 61,127,233,223,191,191,156,156,188, 28,220,220,188, 2,194,156, 92, 60,204,204, 44, 64, 67, +190,125,122, 46,196,139,175, 12, 7, 8, 32,210,202,247,183, 71, 23, 49,156,155,197,252,255,247,127,120,201,206, 8, 45,201,254, +233,196,112,203,104, 66,148,205,219,124, 36,119,217,209, 63,255, 81,230, 82,239,189,249, 18, 48,113,107,223,235, 15, 57,254,182, + 44, 92,252, 76,214,229,127,182,231, 35,183,123,127,156, 91,204,143, 92,190,195,116, 55,175, 60,184,229,234,211,111,127,144,202, +205,255, 12,245, 27, 78,133,153, 40,205,206, 13,224,225,230,100,192, 54, 38,178,225,224,185,180, 57,187,223,124,255, 3, 23,249, +240,231,207,139, 7,111, 79, 60,120,219,189,229,108,178,163,118,103,130, 59, 23, 39,199,149, 91,143,138,151,236,131, 40,200,182, +215,156,184,227,252,193, 7,239,224, 21,215,161, 59, 47, 39,237,185, 20,107,174, 50, 51, 55, 0, 50,205,251,237,251,143,210,153, +155,231,159,184,251,231, 63, 74, 83,189,112,233,225, 72, 3, 89, 72,117,196,136,228,156, 61,167,174,166,204,218,249,252, 11,210, + 16,211,159,127,175,159,125, 60,255,236,252,148, 93,231,107,253, 76, 43, 34,157,129, 98,215,110, 63,154,180,227, 60, 68,222, 68, +134,175,120,245,201,239,127, 65, 70,136,177,130,134, 50,148,229, 65,211, 15, 42, 10,210,152, 99,112, 6, 10, 98,155,138, 60, 37, +249,216, 57, 57,217,129, 37, 59,164, 96,133, 53,177,255,120,235,203,207,220,127, 13,194,189,244,232,141,168, 0, 47, 43, 43, 43, + 25,133,251,194,131, 87,167,238,186,132, 85,118,211, 89,196,113,114,121,206,154, 64, 7,112,112,112,192,157, 1, 76,205, 21,126, +198,144,242, 29,216,156,223,114,254, 65,144,185,218,232, 16,205,240,108,200, 63,120,253,245, 43,168,224,134, 20,193,240, 66,115, +221,230,115,144,193, 19, 96, 51, 25, 88,250, 3, 75, 67,228,246, 50,144, 61, 67, 49,166,161,125, 19, 80, 28, 88,142,127,249,250, +147, 24,141,174, 14, 90,144, 2, 23,194, 5,202, 46, 94,121, 60, 54,220, 18, 88,224, 2,219,218, 5,153, 46,139, 87, 28,135,148, +239,192, 66, 31,210, 27, 0,137,248, 26, 1,171, 19, 96, 37, 4,113,225,221,251,175,130,124,140,128, 12,136,177,144,202, 6,200, + 0, 42, 0,150,233,112, 23, 2,221, 48,189, 99,147,181,153, 50,208,100, 96, 65, 15,148, 2,218, 5, 49, 25, 88, 1,196,133, 91, + 94,188,250, 4,168,101, 70, 95, 12,254,240,249,241,227,199,151, 47, 95,128, 45,119, 96,201,241,225,227,247,189,123,246,106,104, +104, 9,139,138, 3,115, 3, 7, 59,171,162,156, 40,214,172,247,239,239, 95, 29, 85, 33, 6, 70,147, 55, 31,190,113,114,112,178, +179, 51,179,179,177,240,114,177, 11, 10,112,241,242,112,178,177,168, 61,125,250,148,143,143, 23, 87,163, 13, 32,128,136, 45,223, +255,124,255,252,102,107, 51,235,179, 3,200, 99, 16,240,214,234, 95,102, 94, 94,195, 16,136,202,107,119, 30, 23, 44, 63,250,251, +223,127,140,129, 11, 16, 40, 91,126,196,217, 80, 77, 83, 78,156, 79,205,234,205, 9,117,198,247, 55,225, 6,177,252,124,253,245, +209,101,110, 57, 93, 84, 61,255, 87, 93,124,140,106, 6, 20,172, 58,115,239, 85,219,242,189,173, 73,152,174,221,114,248, 66,228, +212,237, 63, 65,110, 96,100,103, 98,140,183, 86, 51, 82,149,254,246,227,215,154, 99, 55,142, 61,120, 3, 20,159,182,247,202,155, + 79,223,151,151, 71,124,250,246,115,207,181,167, 16,255,156,186,253,252,211,159,127,140, 12,140, 98,236,192, 70, 38,227,115,104, +221,240,127,241,201,219,156,140,235,166, 21,133, 3, 57,153, 19,214, 46, 59, 15, 63,116,225, 63,114, 51,116,249, 5,136, 56, 35, +220,153,199, 47,221, 9,155,180,245,235,239,127,224, 81,105,230, 76, 7, 29, 69, 25,145,175,223,126,110, 63,123,103,207,205,231, +127,192,181,148, 0, 47, 87,134,143,229,235,119, 31,230, 31,185, 6,209,184,140,137,241,199,223,127, 88,189,140, 89,190, 3,227, +213, 88, 89, 18, 88,140, 66,216,144,214, 49, 92, 86,128,135, 3,121,122, 0, 14,136,111, 62, 67, 22,204,164,207,217,135, 75,246, + 8,108,128, 72, 90,144, 75, 78,132,151, 13, 12,128,181, 8,196, 25, 64, 82, 69, 82, 72, 86,152,231,241,219, 47,160, 0,185,253, +194,207, 88, 9,232, 90,200, 32,210,104,153, 56,156, 0,176, 0,133, 23,244, 72,205,234,171, 64,210,218, 92, 5, 52,226,177,249, +220,209,147,119, 32,131, 42,153, 73, 14,192,102,123, 73,237,106, 96,209, 12,108, 89, 3,203, 86,160,154,146, 92, 55, 96,123, 25, + 98, 14, 46,141,192, 18, 22, 88, 58,127,248,248,109,247,129,107,235,183,156,135, 91,228,230,164, 13, 25,162, 57,118,242,206,213, +235,207,176,186, 48, 54,220, 2,100,242,126, 80,187, 27,168, 12, 88, 31, 0,221,192,205,205, 14, 52, 31, 50,200,115,233,234, 19, + 72, 19, 30,168, 0, 84, 43, 92, 97, 0, 86, 18,144, 90, 4,232, 72, 96,245, 3,169, 51, 94,190,254, 4,233, 88, 0, 45,133,152, + 0,113, 45,126,112,251,246,109, 89, 89, 89, 72, 69,178,103,239, 30,126,126,126, 57, 5,101,118, 86,102, 46, 46,156, 77,174, 47, +159, 63,127,253,250, 85, 94, 94, 86, 67,147,247,193,227,183,192, 86,211,207, 95,127,190,127,251,253,233,235,143, 79,159,127,188, +125,247, 21,216, 8, 20,230,251,251,236,217, 51, 25, 25, 25,172, 25, 10, 32,128,136, 42,223,191, 62,190,250,121, 71, 45,203,183, + 39,240,102, 59,122,225, 45,166,195,193, 39, 8, 97, 47,216,119, 1, 81, 60,161, 15,180, 48, 0, 91,254, 51,183,159,158,144,238, + 3, 50, 71,222,238,255,187, 27, 40, 85,220,211,139,176,242,253, 63,242,102,168, 24, 51,165, 66, 31,115, 5, 41,225,223,127,254, +158,190,253,172,124,201,129,171, 47, 63,128,198, 82,110, 62, 91,115,232, 66,136,157, 1, 82, 89,248,255,231,207, 95,213, 75, 15, +252,132, 86, 48,255,235,253,140, 43, 98, 60, 32,230,231,248, 89, 59, 87,205, 59,124,239, 21,208, 11,171, 78,223, 73, 63,123,131, + 13, 82,239,129,213,126,250,253,207, 65, 73,164, 38,204,206,214, 64, 21,216,198,220,118,236,138, 95,255, 38,136,236,146, 83,247, +250,126,252, 60,113,245,254,178,243, 15,161,243, 72, 2, 92,221, 49,246,198,106,210,188,220, 92, 79, 94,189,159,186,227,236,172, +131,215, 81,154,238, 12, 12,213, 75,246,126,249, 13,154,248,102,101,100, 92, 91,224,103,103, 8, 61, 91, 45,199,223, 38,162, 99, +197,186,243,160, 97,141,170, 21,135,162, 29,244, 25,144, 22,149,255,248,251, 63, 88, 95,182, 60,208, 90, 78, 82, 8,127, 33, 8, + 31, 79,135, 47,127, 68, 83, 15, 41, 85,225,229, 47,164,112, 39, 41,211,222,127, 5,154, 59,133,176, 53, 37,249,225,211,182,240, +242,253,195, 55,104,131, 75, 70,128,139, 25, 6,224,117, 12,144, 1,228,202,193,202,247,171,207, 62, 0, 11,119, 82,235,152, 81, + 48, 36,192,250, 37, 89,187,246, 93, 3,182,100,129, 5, 52,100, 64, 3, 82,150, 65,134,203,129, 36,124,184, 28,210, 40,230,225, +102,151, 16,227, 7,150,239, 16, 17, 37, 69,148, 6, 44, 46,141,192,194, 93, 95, 71, 6, 82,230,194,199,103, 26, 58, 54,115,195, +230, 24,121,184, 57,136, 26,118,255,250, 19,121, 74,246,216,201,187,221,147,119, 2, 27,248,129, 62,134,144,230, 57,150,105, 48, +152,201,220,220,236,164, 6, 14, 36,217,115,113,113,253,248,249,231,204,153,179,191,127,124, 55,178,119, 2,230, 90, 62, 62, 14, + 60, 90, 94,189,126,253,235,247,111, 97, 97,225,119, 31,190, 61,120,242,246,227,167,239,127,254,252, 67,148, 48,224,130,248, 31, + 3,247,159,219,247, 69, 68, 68, 56, 57, 57, 49, 13, 1, 8, 32,194,229,251,155, 83,235,254,158,232,103,254,247, 3,169,112, 71, +202,153, 96, 38,139, 0, 98, 40,252,244,189, 23,200,187,157, 48,139,147,211,183,161,237, 95, 86, 65,201, 95,168, 42,152, 62,191, +196,104,241, 51,184,169, 75,204, 45, 10,101,129, 45,181,244, 18, 17,210,146, 23, 87,207,159, 9,110, 22, 51,172, 58,122, 29, 84, +190,255, 71,140,123, 95,189,251,228,242,107, 68,185,166, 34, 33,188,251, 20,162, 22,209,148, 20, 4,150,239, 16,181,235, 78,221, +138,176,212,132,219,228,168, 34,177,165, 33,134,131, 3, 26,226, 94, 86, 58,102,107, 14,157,122,252, 30, 52, 44,243,247, 63, 48, +184, 87, 31,191,254, 31,230,249,133,121,190,230, 58,208, 21,238,154,188, 60, 83,178,101,223,126,249,177,230,236, 61,120,208,220, +121,248,244,200, 3,232,108,164,180, 0,199,207, 63, 12,187, 79,223,132, 59, 67, 70,136, 7,226,243, 47,191,254,110, 63,115, 75, +156, 19, 62, 94,241, 63, 88, 79,110,113,121, 36, 11, 11, 81, 85, 47,254,185,202, 35, 55,159, 35, 26,215,194, 60,164,238, 51, 66, + 94, 48, 3, 44,220, 23,167, 88,155, 52,111,195,172,185, 49,235, 27,116, 23,194, 18,204,147,247,223,128,193, 8,153,152, 29, 45, + 16,135, 25, 0,150,185,144,150, 59,242,114, 14, 96,155, 23, 88, 70, 67,134,197,129, 69, 57,176,129, 12, 31,129, 65,148,155,224, +193, 16, 96, 19, 24, 88,118,195, 7,196,137,209,136, 92, 91, 0, 53, 2, 27,215,224,181, 46,175,228,100,132,224, 53, 4,242,128, + 62,154, 22,160,107,129, 85, 5,100, 76,233,197,235, 79, 64, 27,129, 13,124,100, 91,144,245, 2, 29, 9, 52, 25, 40, 11,116, 18, +100, 16, 31, 94, 51, 17, 3,126,252,248,241,230,205,155,237,219,119, 8,139, 72,190,121,245, 74,223,192, 24,152, 79,248,120,241, + 21,238, 79, 30, 63, 6,146, 26, 26, 26, 95,191,253, 58,124,242, 22,176,193,142,200, 52,192, 28,197, 8,109, 52,255,254,245,235, +238,203,247,198, 70,191,177,150,239, 0, 1,132,175, 16,249,253,243,199,139,173, 93, 28,143, 54, 51,161,103,103,216, 40, 51, 60, +123, 35,229,104, 14,118, 86,164,145, 27, 44,128, 29,118, 41,235,223, 63,127,208,178, 57,211,223,175,152, 99, 0, 33,150, 26,104, +133,157,130,148,168,145,172,208,201,135,160,129,242,235, 15,208, 87,254,159,190,255, 2,153, 27, 54,125, 39,142,162,145,225,202, +227, 87, 12,150,154, 8,149,150,234,240,194, 29, 2, 4,249,121, 24,192,229, 59, 52, 5, 63,120, 1,174,143, 24, 85, 5,216,225, +133, 59, 28, 68,217,106, 3,203,119,248,224,213,211,183, 8,191, 60,120,255,221,187,123, 45,174,112,190,247,236,181,184,146, 56, + 60,104, 35, 28,244,137, 44,220, 9,228,183,135,175, 31,189,133, 94,158,229,170, 41, 9,105, 74, 19, 95,184, 35, 47,152,225,227, +100,237, 10, 53, 17,230,197,183,186,233,201,135,111,184,164, 62,126,135, 78, 63, 60,125,255, 13, 62, 70, 52, 90, 32, 14, 51, 0, + 95, 69, 3, 25, 7,135,176, 51,147, 29,186, 39,237, 60,122,242, 14, 16, 65,138,126,101, 69, 49,140,118, 49, 59,164, 52, 71, 94, +135, 67,140, 70, 56, 0,150,236,245, 29,155, 50,138,150,124, 5, 13,226,139,133, 5,154,236, 63,124,163,164,118, 53,104,236, 1, + 71,173, 16,228, 99, 4,236,106, 0, 75,106, 96,169, 13,238, 34,200,172,223,124, 14, 50, 94, 4,239, 40, 0, 59, 34,192,158, 1, +100,248,222,205, 73,235,216,169,187,153, 69, 75, 32,141,247,204, 36,251,233,243, 14, 18, 31, 56,175, 95,191, 22, 19, 19, 99,102, +102, 83, 82, 82,253,249,243,199,215,175,159,248,248, 20,129, 29, 93, 92,195,158,111,223,190,101,102, 97, 17,229,227, 7,230,217, +107,183,158, 2, 11,119,112, 83, 9, 60,223,249, 15,178,156, 4,218,120,250,246,237, 51, 80,246,225,211, 79,130, 2, 88, 86,136, + 2, 4, 16,206,114,228,199,135,215,239,183,212,176,189, 62,251, 15, 92, 91, 32,236,102, 98,255, 39,105,206,252,244, 16,114,193, +254,255,251, 59,184, 2, 11, 21,169, 61,144,241,175,255, 88,134,144,129, 28, 7, 45,104,111,235,239,183, 79,255, 81,135,111,254, + 51, 48, 97,182, 12,181,101,177, 44, 50,225,231, 1,150, 53,160,162,231,215,159,191, 48,197, 80,245,159,191,126, 39,106, 9,250, +127, 96,220,127,135,116, 49, 32,190,208,149,151, 64,175, 2,152, 64,251,191,224,103,170,253,248, 5, 29,145, 23,192, 86,241, 42, +139,242, 51,192,215,240,252,255,127,239,237,199,255,255,255,163,173,150,100,196,114, 42, 15,195,183,159,191,145,122, 58,255, 85, +196,248, 41,207,108, 64,171,167,236,188, 8,231, 38,216,168, 64, 22,191, 19, 57,177, 9,212,158, 58,107, 15,124, 97,204,210, 84, + 91, 61, 57, 97,172,115,179,214,234,146, 71,110, 61,135,148,221,192,234, 68,131,139, 11,173,236,254,240,245,199,229,199,111,145, +171,141,209,194,125, 56, 1, 96,209,220, 80,225,135,204, 5,150,197,192, 82, 18, 88, 62, 66,150,165,207,232,139, 1,182,148,191, +124,249, 9, 41, 70,129,236,192, 47,134,202,224,209,152,216, 8, 11, 8,219,202, 92, 25, 50,228, 2,212,242,226,213, 39,130, 26, +209, 44,133, 40, 6,154,192,195,195, 14,180, 23, 40, 50, 29,168,247,254,107,160, 57,192,154, 6,216,244, 6, 22,202,112,245, 64, + 75,129, 34, 64, 45,202, 74,162, 64,195, 33, 85, 11, 80, 87, 79,115, 40,196,106,136, 22,136,153, 64, 17,160, 2,136,153,160,181, +146, 96,247, 64,150,202, 64,204,193,116, 12, 38,248,254,253,251,159, 63,127,128, 45,241,159, 63,255,255,254,253, 91, 86, 70,230, +253,187,215,192,182, 22, 46,245,159, 63,129, 0, 48,183, 10, 10, 10, 60, 3,173, 71,122,133,104,174, 3, 75, 20, 38,164, 65,239, +255,255,158, 63,125, 32, 35,171,242,230, 45,246,107, 80, 1, 2, 8,123,249,254,241,246,201, 47, 59,235,153,127,189,249, 15, 29, +144,129,102,200,191,108,130, 60,158,237,204, 76,140, 95,159, 30, 68, 46,131,127, 61, 60,129,168,120, 61, 77,167,238,190,240,254, +251,111,172,253,120, 1, 14,150,100, 55,232,129, 51,191, 31,159,102, 70,205,235,127,153,185, 49,138,247,255,143,223,127,177,192, +112,225,171,119,208,129, 96, 78, 54, 52, 47,252, 23,224, 67,220, 18, 37,207,195, 86, 21,110,135, 43, 28,133,161, 29, 73,232, 82, + 24,110, 14, 22, 28, 21, 1,116,149, 16, 23,176,107, 2,118,239,171, 79, 88, 58,125,159, 80,123,130,178, 66,252,112, 95,152, 43, +137, 39, 56,232,224,114,134,142,172,232,207, 47, 95,225, 5, 60, 55, 39, 27,229,185,238,194,131, 87, 75,143, 66,135,131,130,140, +228, 20, 68,249, 32,115,158,196,180,223, 33, 11,102,150, 28,129, 14,106,117,134, 24,235,201,137,128,143,175, 99,193, 28, 29,242, + 49, 84,232, 4, 79, 79, 1, 65,211,198, 11,139, 50,156,129,157, 74,228,115, 11, 38, 35, 85, 51,163, 96,248, 1, 96,105,142,185, + 52, 80, 28,117,195, 17,164,124,196,207,134, 27, 66,140, 70,172,150, 34,139,192, 21,136, 99,200,194,205,129, 51,160, 42, 97,110, + 22,199,240, 5,166, 94,100, 54, 86,199,160,140,115,190,127, 47, 36, 36,196,204,204,242,231,239,143, 79, 95,126,126, 2,118, 98, + 25, 89,190,126,253,202,195,195,131,150,239,128,213,192,215,175, 95, 62,188, 7, 77, 46, 42, 40, 40,124,254,242,243,224,177,155, +127,129, 77,162,127,240, 28, 7,106,191, 67, 51, 49, 35,195,199,247,239,132,132,196, 57, 56, 57,180,213,165,176, 90, 13, 16, 64, + 88, 74,180, 87,135, 23,253, 57, 61,141, 9,180, 8,146,145, 17,105, 44,230, 47,191,170,128,127, 47,183,136,212,231,151, 15,209, +199, 85,126,189,255,116,105, 27,159,158, 23,144, 45, 38, 34,184,182, 40, 48,160,123,237, 39,112,107, 23, 89, 37, 15, 27,243,226, + 12, 15,105,113,208,105,103, 31,159,220,100,124,126, 10,237, 88,178,255, 60, 98,152,237,247, 89, 59, 79,135, 58, 24, 32, 91,183, +255,204,181, 11,207, 63, 65,218,201, 38, 42, 82,240,186, 12, 58,140,174, 33, 3,103,191,252,250,203,215, 84, 93, 66, 84, 8, 89, +175,190,138,140, 16,172, 47,115,236,194,109, 44,189, 12,228,233, 3, 72,147, 28, 28,162,182, 26,114,199,238,131,246,100, 62,252, +240,125,243,145,139,190, 54,250,200,106, 39,111, 61, 9,107,236,131,128,129,130, 24, 59, 19, 3,100,154,247,237,199, 47, 41,158, + 40,149,212,241, 75,183,101,197,132,100, 36,160, 7,191, 29, 60,113, 9,201, 9,148, 54,111,129,109,228,180,217,123, 32,108, 62, + 14,214, 60, 23, 77,200,186,120, 98,198,103,128, 94, 56,112,237, 49,124,193, 76,181,143,110,184,185, 18, 59, 24, 96,234, 5,138, +232,203,139,234,200, 8, 93,121, 2,234,192,237,186,250, 44,119,209,145,246, 8, 75, 49, 1,232,130,173,201, 59, 47,180,111, 60, + 3, 87, 15,116,204,104,129, 56, 10, 70, 26,120,249,242,165,190,190,254,171, 55, 95,158, 62,127, 15,204, 66,204,204,108,175, 63, +126,253,248,241, 35, 48,143,252,255,247,239,215,239,223, 31, 63,126,248,252,249, 51, 48,223,127,255,241, 3,152, 79, 37, 36, 36, +126,124,252,248,237,219,247,139,160,147, 9,254,193,198, 18, 16, 99, 50,224,113, 0,208,208,194,143, 31, 95, 36,164, 20,197,132, +121,132,133,184,177, 90, 13, 16, 64,232,189,245,151,135, 22,252, 57, 57,145,225, 31,100,133, 59,164,120, 3,141,150,254,149,115, + 19,139,158, 3, 44,220,129,162,188,226,242,191, 56,164,254,195,198, 68, 32,232,235,145, 73,127,190, 66,219,212,182, 6,170,167, + 58, 18, 61,181,100,224,181, 7, 59, 19,163,151,182,212,177,166, 24, 79,107, 80,153,248,231,247,175,175,251,251, 24,254,255,133, + 89, 0, 41,158,255,115,202, 24, 98,182,157,247,222,122,145,216,179,242,210,205,135,111,222,190,127,240,248,249,170,221,167,226, + 39,109, 2,251, 21,228,198, 72, 91,109,244, 14,163,130,180, 55,172, 58,253,241,239,127, 80,199,202,243,183, 64,139, 94, 62,127, +254,178,124,215, 73,191,238,117,170,217, 83,235, 23,238,120,242,226, 45,162, 98,248,255,159, 64,169, 10, 14,218,104,103,163,255, + 48,197, 9,211,183,205,221,118,226,201,179,151,175,223,188,187,118,251, 81,214,164,181, 43,193, 75,107, 96, 6,253, 23, 17, 22, +136,180, 80,131, 24,124,231,205,151,212, 9,107,222,125, 0, 13,237,125,255,241,115,237,190, 51,190,157,107,244,139,102,181, 47, +219, 3,228,194, 45,248,255,159,129,242,161, 11,160, 11, 39,237, 56, 15,223,104, 26,111,173,172, 40,198,207,198,198, 70,204,170, +115,200,106,200,240,137,208, 73,212, 96, 99,185, 20, 59,117, 72,225,206, 10,222, 27,133,169, 5, 40, 56, 53, 1,209, 67, 90,125, +250,190, 81,205, 26,143,142,141,110,109,235,185, 19,166, 85, 44, 63,134,172, 88, 67,146,111,116,243,234, 40,160, 22, 0,175,136, +127,130, 44, 2,228,226,153,134,197, 4,164,170, 39, 15, 72, 74, 73,253,250,253,247,197,139, 15,144,116, 15,204,134,108,236,188, +215,174,223,184,116,233,226,181,235,215, 95,189,122, 5, 44,180, 5, 4, 4, 21, 20, 21,245,244,244,116,116,116,128, 69,191,136, +136,200,250,205,187,158, 60,127,135,220,108,135,150, 44,160, 85,241,160,124,247,224,238, 53,126, 65, 81, 96, 13,161,173, 38,197, +198,138,125,236, 1, 32,128, 80, 68,191,191,123,241,251,244, 12, 70,212,145, 98,208, 57, 55,166, 89, 98, 86, 49,200,135,133,177, +235, 71,254, 61,209,131, 58,200,244,250,213,186, 98,225,192, 62,118, 30, 80,211, 88, 89, 86,124, 83, 99,194,155,119, 31, 30, 61, +127, 11, 44, 24,164,197, 5,132, 4, 5, 16, 29,150,125, 83, 24, 95,157,249,143,122, 49,200, 31, 14, 9, 14, 73, 21,228,178, 6, +194, 96,101,100, 88,120,236, 38, 16, 97,186, 62,220, 72,222,217, 76, 7,101,244, 29, 76,205,202, 13,180,175,154,127, 27,178,230, +250,254,107,163,138,133,138,188,108,239,190,255,249, 4, 90, 93,196,240,245,247,191,230,141,167, 36,249, 57, 51, 2,236, 49,122, + 11, 56,134,103,192, 64, 75, 65,162,208, 85,191,127,247, 69,160,216,135, 31,127,210,231,238, 70, 87,139, 90,112,245,166,120, 93, +126,244,250, 12,120,244,121,254,145,235,203,142,221,144,228,102,125,251,253,207,103,160, 51,192,214,117,109, 62,229,160,171, 96, +169,171,194,192,192,192, 64,165, 81,233,251,175, 62,182,109, 56, 13, 97,107, 74,242, 23,184,106, 65, 22,164, 19,211,120,255,240, +245, 7,176,225, 15, 89, 48, 99,174, 36,218, 29,102, 10,212, 11,223,143,138,235,144, 35, 35, 37,137, 73,177,214, 53,107, 78,125, + 2, 15,202,125,250,254,235,216,237, 23, 88,205,215,146, 20, 24, 61,159, 96, 20, 80, 11, 96,158, 28, 0,228, 54, 84,248, 17,127, + 86, 12,169,234,201, 3, 76,140, 76,175,223,124,254, 7, 89,120,248,159,225,247,239, 95, 15,239,223,150,150, 18, 51, 52, 52, 70, + 62, 28, 23, 88, 0, 0,123,222,191,255,252, 21, 19,151,254,248,225, 29, 23,183,216,211,151, 47, 4,133,196, 64,197, 57,120, 44, +133,145,137, 9, 88,154,255,249,243,235,215,207, 31, 31, 63,189, 19, 16, 18,227,230,226, 85, 83, 6,205,115,224,178, 26, 32,128, + 80,202,247,191,239, 30, 50,252,251,245, 31,105,133,251, 95, 78, 9,110,231,106, 97, 77,244, 19, 25, 5,205,130, 95, 94, 88,204, +244,253, 37,114,177,198,248,234,252,235,249, 65,188, 78,149,252,218,206, 16,113, 17, 33, 1, 32, 66,214,248,227,211,251, 55, 59, +218,153, 31,237,193, 44, 68, 89,212, 60, 89, 88,177, 12, 61, 79, 12,183,108,217,118,254, 25, 98,200, 27, 90, 14, 38,152, 41, 77, +206, 11, 65, 8,254, 71,108,112,149, 20, 21, 60,209,157, 86, 50,119,235,242, 99, 55,127,128, 71, 72,238,127,250, 9,113, 37, 27, + 35,163,171,150, 84, 85,160,149,149,145, 22,102, 9,142,165,108, 71, 93, 10,212,150,228, 9, 36,167,236,185,248,251, 63,202,106, + 37,113, 46,214,106,111,131,188,213,167,145,117,243,241,114,239,106,138,175, 91,178,123,222,129,171,223,254,252,253,249,247,255, +131, 79,136,198,130,189,146, 72, 71,162,187,169,150, 50,102, 71,129,194,145, 25,248,105, 48,157, 33, 70,144, 13, 71,196, 52,222, +129,122,193,167,149,189,133, 84, 12,211, 99,205,129,101, 58,164, 98, 0,181, 24,254,253, 67, 41,223,193, 34, 64, 0,153,179,141, +179,211,178, 82, 17,239,220,114, 30,216,126, 71, 54, 51,200, 8,116, 56,198,186,115,208, 21,177,102, 74, 34,163,231, 19,140, 2, +208,102, 84,240, 73, 3,144,197, 42,144,165,138, 60, 92,236,152,130, 12,224,243, 97,128,229, 47,176,149,253,242,245, 39,136, 44, + 68, 25,114, 27, 28,162, 29,249, 8, 26,200,225, 1, 18,162,124,144,153, 91, 30, 30,118, 72, 75,223,205, 81,139,135,155, 29,190, +148, 19,222, 15,216, 5,222,230, 13,180, 8,104, 50, 80, 22, 50,233, 10,153,230,133,203,194,151,222,195,101, 95,192, 14, 99, 0, + 74, 65, 38,150,177,250,247,205,155, 55, 12,204,252,144, 82,132,137,153,249,225,195,123,160,205, 63, 74, 26,255,254, 51,126,255, +241,251,251,247,223, 64,167,126,251,254,243,231,239,191, 63,190,253,254,245,251, 15, 80,150,149,233,139,140, 4,251,155,247,140, + 31,222,191, 17, 18, 22, 7,230,182,159,192, 50,253,195,155,111, 95,190,112,112,113,241,240,242,139,139,203, 0,115,167,144, 0, +151,158, 6,190,202, 9, 32,128, 80,206, 7,254,249,249,253,235,153,110, 12,255,255, 66,138,236, 63,130, 58,162,161, 19,184,248, +133,176,234,124,125,112,214,239,211, 51,177,155,170, 21, 41,230,154,207,130,177,220,226,243,227, 27, 31, 54,149, 48,127,199,178, +187,236, 63, 35, 43,127,252, 6, 30, 17, 73, 88, 10,120,123,233, 22,180, 80, 48, 1,175, 68,108, 89,178,107,231,185,187,215, 62, +252, 16,101,103, 54,144, 17,204,243, 54,247,118, 64, 92, 12,114,236,204,149,175,224, 69,120,146, 98, 66, 58,234, 10,112,241,143, +159, 62,175,218,127, 97,243,201,107,111, 62,126,101,103,101, 81,147, 22,206,244, 50, 55,208, 70,244, 18,222,127,248,116,230,202, + 29,152, 69, 42,104,107,140, 46,221,184,255,242,205, 7, 8,219,193, 92, 7,190,128,228,212,149,187,141, 75,119, 95,120,244,238, +203,239,127,178, 60,108,182, 90,210, 13,241, 30,252,188, 60,135,207, 64, 15, 3, 80, 83,144,146,151, 65, 44,251,121,250,252,213, +188, 61,231,143, 94,190,243,225,243, 79,110, 78, 22, 85, 41,145,120, 39, 3, 75, 68, 5,195,240,250,237,251, 11,215, 31, 64, 42, + 18, 75, 67, 13, 30,110,114,206, 89, 3, 70,229,196,237,231,202,151, 29,133,112,115,157, 53,138, 61,116, 57,193, 0,190,161, 20, +143,222,148,153,187,225,115,170,144,115, 40,129,237, 14, 70, 80, 81,204, 4, 61,136,226,255,255,163,183, 94,192, 21, 8,112,179, +235,203,137,118, 69,219, 64,198,109,254,128,218, 21,160, 67, 37, 15,223,124,246, 15, 60,104,104,161, 44, 10,108,209,219,118,108, +131,180,235,165, 5,184, 14, 87,122,114,115,115,115,113,113, 1,221, 51, 90,196,143, 88, 0, 44,124, 23,175, 60,190,120,102,114, +207,228, 93, 64,110, 73,174, 91,108,250,220,216,112, 75,172,130,211,231, 29,232,105, 9, 5,150,170,235, 55,159,131,200,114,115, +179,103, 38,217, 67, 74,118,200, 41, 99,192,178,117,221,230,115,153, 73, 14, 64,197,192,246,248,250, 45,231,191,124,253, 1, 20, +223,181,239, 42,196, 4, 96,201, 27,232,107, 4, 52,193,202, 92,197, 10,124,210,128,155,147, 54,216, 37, 87, 75,115,221,129, 10, +128,138, 33,219, 80,103,244,197,100, 20, 45,129, 44,199,132,156, 51, 3, 89,103, 9, 84, 0,180, 2,168,184,123,242, 78,136,172, +156,140,208,230, 29, 23,225,230,224,233, 7,156, 60,121,138,131, 71,252,255, 63,102, 96, 38, 2,150,223,103, 78, 31,211, 55, 48, + 17, 23, 23,254,250,245,199,179,151,159,254, 35, 95,117, 7,107, 89,243,240,114, 11,243,253,126,250,236,229,249,203,143, 88, 88, +216,127,253, 2, 54, 83,255,243, 11, 8,241,242, 9, 49, 51, 49, 3,219, 85,192, 12,205,193,198,106,102,168, 32, 37, 33,128, 39, +168, 1, 2, 8,165,253,206,206, 43,200,233, 88,245,249,240, 52,166,191, 63, 25,229, 44,197, 61, 42, 57,120,113,106, 22, 48, 9, +123,113, 97, 25,211,175, 79,152,227, 18, 12,215,150, 61,191,187,155, 85,209,134, 77, 82,155,131, 87,240,231,215, 79,191,222, 61, +253,253,236, 34,195,171,139, 76,224,254, 1,150,242, 69,217, 3, 94,184,131,107,111, 97, 87, 49,148, 75,167,122,115, 66,122,113, +123,195,202, 4,251,234, 20,126, 62,222, 84,127, 91, 32,194,165, 17, 88,160,187,218, 24,225,146,213,211, 80,196, 42,110,166,163, +188,181, 29,203,245, 29,174, 54,134, 88,213, 75, 75,138,213,198,186, 51, 48,184,227,178, 72, 84, 88,208,213, 70,144,138, 35, 51, +210,130, 92, 73, 54,170,196, 55,222,129,101, 55,188,112, 7, 2,180,125,170,152, 0,174, 0, 88,166,179,179,179, 67, 90,250, 64, + 91,128,164,139,158, 34,124, 17,228,212,253,231, 63,193, 86, 82, 5, 25,129,206,139,167,202, 49,244,163, 96, 72, 3, 96, 57, 56, +125,222, 79, 96, 75,252,226,149,199,192,214, 49,100, 87, 17, 46, 65, 80, 67,254,222,107,200, 49, 94,199, 78,130,142,124,113,115, + 68,153,114,131,236, 98, 5,201,130,207, 12,128,156, 39, 3, 44,235, 33, 91,144, 32,130, 37,185,238,144,194,247, 18,248,140, 48, + 96,161, 12,169, 33,128,229,242,139,215,160, 18,204,213, 17,114,160,205, 99,200, 49,100,144,227, 19, 32,166, 1,155,234,192, 66, + 31,210,144, 63,134, 36, 11,172,105,144,205,193,227, 95, 81, 81,145,139, 87,110, 9, 9, 75,112,113,242, 92,184,112, 74, 84, 92, + 66, 80,144, 31,152, 93, 94,190,249,140, 88, 66,205,136,180,151,232, 63,195,151,207, 95,255,255, 99,229,229, 98,119,119, 54,191, +112,253, 57,176,253,203,196,196, 2, 89,255, 46,192,207, 33, 41,198, 47, 46,202, 7,186, 29,141,208,130, 5,128, 0, 66, 31,149, + 23, 54, 14, 4, 34, 98, 34,137,149, 27, 88, 52,214,127,222, 90,140, 60,120, 13,207,181, 76, 63, 94,255,189,190,254, 59, 16, 97, + 31,154, 70, 25,244,248,203, 45, 43,233, 81, 58,154,238,225, 69, 45, 25,197, 31,250,200, 76,176,145, 48, 31, 23,242, 81, 48, 4, + 45, 37,207,169,144,253,168,144, 82, 27,178,133, 10,190,131,233,194,131, 87, 61,219,161,167,146,241,113,176, 38,217,170,193,143, +183, 28,141,229,145, 12, 32,235, 14,119,237,191, 6, 57,120, 96,221,150,243, 16, 17,172,130, 64,238,203,215,160, 66, 63, 54, 2, +116,146, 23,232, 40,246, 92, 25,172,102, 66, 6,118, 32, 67, 55,144,130,152, 1,188, 56, 29,237,248, 95, 96, 49,141,118, 22, 2, + 16, 64,142,178,145, 16,227,135, 44,105,135,159, 64, 0, 89,125, 15, 93, 55, 9,222, 37, 11,151,197,106, 14, 86, 32, 43, 43,251, +235, 47,199,181,171, 55, 94,253,123,254,243,231, 15, 5,121, 37, 81, 97,158,171, 55,159,131, 15, 27, 64, 61,112,246, 63,116,157, + 12,176, 9,244,236,217, 11, 65,126, 14, 83, 83,197, 95,127, 88,238, 62,120,197,197,205, 38, 43, 41, 36, 43, 37, 40, 36,192,205, +196, 68,108,249, 0, 16, 64, 20,237,147,228,215,114,252,241,182,224,247,241, 9, 88,202,108, 28, 69, 57, 38,248,203, 33, 38, 28, + 52,145,149,147,103, 52,221,159,185,247,242,222,203, 15, 33,230,170, 12, 36,222, 76, 13, 89, 51, 3, 63, 11, 62,193, 74,217, 90, + 77, 2, 62, 47, 74,164, 81, 31,231,164,253,248,241, 3,216, 30,135,143,179,163,105, 4,150,227,138,101,107, 32,236,133,137,150, + 64, 43,128,230, 35, 55,198, 33, 39,225, 64,220,243,254,203,247,232,105,136,249,231, 28,103,117, 33, 94, 78, 34,167,121, 71,193, + 8,104,194,203, 66, 70, 84, 24, 64, 71, 69, 30,183, 2,159, 35,134, 85, 16, 88, 94, 79,159,119, 0,216, 82,182, 54, 3,157, 71, + 6, 41,244, 33, 3,238, 40, 67,169,224, 51, 3, 32,131,251, 64, 18,126, 96, 47,176,201,143, 89, 19,192, 15, 51, 96,128,157,142, + 80,146,235,198,195,205,142,124,109, 8,100,160, 95, 2,122,128,229, 19,160,105,112, 43, 32, 0,114, 80, 1,220, 28,124, 77, 97, + 86, 86, 49, 17,254,191,154, 90,192, 2, 93, 64, 80,228,247,175,175,207, 95,177,125,251,254, 11, 71, 94, 6,109,171,124,253,250, +197,207,159,223, 5, 4, 68,174,221,122,161,167, 37,173,166, 36,198,205, 5,236,136,147,124,178, 55, 64, 0, 81,186, 15, 94,220, + 54,238, 29, 23,223,151,125,109,140,255,127,147,161,253,175,168,137,136,103, 21,143,132,226, 48,107,128,227, 23, 4, 22,112,152, +106,128, 34,119,158,191,191,247,234, 35,100,127, 16,100,145, 9, 68, 25,164, 64, 68,187,213, 26,185,148, 68, 27,153,201, 7,175, +153,193, 85,184, 35,159, 16, 0, 63,145, 6,104, 35,176,101,205, 1,236,239,177,178, 2,203,113, 92, 93, 4, 56,155,137,153, 9, +126, 20, 48, 80, 35,230, 69,219,169,179,247, 62,122, 3,221, 83,167, 41,201,151,108,171, 6,239, 76,140,150,239,163, 0,210,202, +134,140,129, 64, 14,236,197, 37, 8, 41,166,245,181,101, 32, 37, 59,228,148,130,197, 43, 78,232,129,231, 66,129,236,140,162, 37, + 12,224,115, 8, 50,147,236,119,237,187, 10, 84, 3,108,233, 67,198,229,239,222,127,133,124, 54, 25, 4,184, 57,105, 53,180,111, + 2, 86, 21,144,114, 25, 98,102,102,209, 18, 32, 9,233, 37, 64,148, 29, 61,117, 23,114,191, 7,176,106,233,153,188, 19,210, 63, +136,141,176,128, 15,197,184, 58,106, 1,197,225,230,224, 7, 66,130,220,252,124,156, 31, 62,126, 23,228,231,186,119,239,246,187, +167,127,153,153, 89, 33, 87, 53, 65, 14,147, 1, 45,127,100, 2,173, 90, 4,102,197,143, 31,222,254,249,245, 75, 86, 86,249,255, +255,127,210,146,252,236,108, 44,236,108,100, 22,212, 0, 1,196, 72,149,205,226, 95,158, 92,123,191,163,233,255,219,155, 36, 20, +130,236,130, 92,182, 69,162,198, 62,195,111,116, 37,125,246, 30, 39,109,217, 16,115,149, 53, 39,239,236,189,250,120, 90,162,195, +218, 83,119,102,239,187, 42,200,205,158,226,168, 5,148,242,234,220,164, 32,202,123,255,245,167,169,137, 14,235, 78,221,221,123, +245,137,146, 24, 31,144,237,217,185,209, 80, 94,180, 57, 20,180,112,165,103,235,249,125, 87, 30, 43,138,241,181,132, 89, 10,241, +112,120,118,108, 4,178,129,165,127,176,153, 74,170,147, 14,100, 48, 4, 82, 80, 2,139, 93,183,182,117,240,198,251,180,104, 51, +111, 67, 5, 46, 46, 46,200,142, 83,204,146,183,116,201,225, 41,187, 46,242,115,177,181,133, 89,196,218,106,194, 7,196, 33,139, +100,240,164,135, 63,127,254,240,167,204,130,176,151,166,218, 58,233,202,115,114,114,162, 53,225, 25, 48,166,106,249, 56, 88,151, +164,218, 24, 42,138, 67,156, 52,218,126, 31, 5, 12,168,151,222, 65, 86,164,192,155,207,104,130,200,108, 72,179, 29,222,126,231, + 6,138,220,127,205,195,195, 14, 57,102, 0,178, 48, 6,126, 64,194,139, 87,159, 32,199, 21, 32, 11,194,151,232, 64, 14, 30, 0, +157, 76, 0, 51, 25,104, 8,100,193, 12, 68, 61,176,194,128, 47,212,129,200,162, 89, 1,105,227,191, 0,119, 23,128,213, 73, 79, + 75, 40,242,170, 30, 60,224,237,251,175,235, 55,237,227,231, 23,230,229, 23, 64,140,185,131,134,221, 65,163,157,239,223,190,249, +249,243,135,148,180, 60, 51, 51,147,166,170,132,172, 52, 69,211,114, 0, 1,196, 72,173,195, 64,254,252,254,253,118,223,180,159, +151,150, 50,252, 35,220,144,255, 43, 97, 45,230, 91,199, 45, 36, 54,252, 18, 46, 48, 60,103,238,190,216,181,249,236,149,206, 72, +157,242,229, 69, 94, 6,138,162,124, 49,211,118, 79,140,181,121,240,250, 83,255,142, 75,151,218,195,228,242, 23, 39,216,105, 36, +217,105,124,248, 6,186, 28,117, 83, 17,104,223,175,147,182, 76,222,162,195,247, 95,125,218, 84,236, 53, 97,199,165,121, 7,175, + 79,138,179, 93,119,250,238,131, 55,159,183,148,248,112, 39,205, 44,244,208, 87, 16,225,201, 95,114,244,112, 93,144,153,138, 36, +228, 36, 94,180, 53, 51, 26, 18,124, 53, 62,122,240,105, 85,208,234, 23,164,137, 15, 96,153,190,229,252, 3,228, 13,165,235, 11, +220,157,116,228,113,237, 93,194, 44,223,185, 19,166, 65,216,203,210,237,156,117, 21, 48, 87,194,128,220,179,237, 92,249,242,163, +112,145,142, 96,195, 72, 75, 85, 96, 77, 0,233, 28,140, 14,190,143,130,225, 1,128, 5, 61,176,147, 33, 33,198, 15,236, 37, 88, +153,171, 64, 38, 90,137, 44, 34,128,185,250,192,161,147,192, 6, 21, 19,232, 26, 38, 38,112, 33,252,239,247,239, 95, 63,127,252, + 20, 17, 17, 19, 17,149, 4,182,180, 52,213, 36,228,101,132, 40,108, 12, 1, 4, 16, 11,181,124,203,194,202, 42,238,158,255,195, + 50,238,199,189,163,223,110, 31,248,241,244, 50,243,207,151, 40,190, 98,226,248,203, 35,195, 41,111,198,165,238,194, 43,175,199, +204,194, 50, 92, 35, 62,217, 81,187,114,229,177,158, 45,231,222,127,253, 25,107,165, 50,113,231,101,160,224,188,131,160,165,147, + 31,190,253, 60,115, 23, 20, 44,126, 6,114,122,178, 66,192,194,174,208, 83, 31, 88,172, 39,216,169,219,107, 72,202,139,240, 64, +198,103,128,173,126,160,136,157,186, 4,176, 72, 13,156,184,243,247,111, 80,149,105,167, 46,110,167, 46, 9, 44,223,223,126,250, + 6, 20, 7,234,133, 92,143, 7, 31,153, 1,130, 27, 47, 62,197,204, 57,130,203, 97,214,170, 18,104,149,249,161,235, 79,109,213, +165,168,181, 38, 29,232,158,226,197, 7,145,111,122, 2, 22,238,225,230,202,144, 29,176,163, 51,171,163, 96, 56, 1, 96, 63, 3, + 50, 85, 0, 63,212,140,216, 54, 53, 35,163,138,162,232,207, 95,198,143,159,189,253,139,116, 85, 6, 19,104,148, 20,212, 98, 3, +230, 18, 53, 21, 9, 5, 89, 97,202, 29, 9, 16, 64, 84, 46,100, 57,248, 4, 57, 12,124, 4, 12, 64,163, 46,223, 62,125,248,253, +249, 61,195,159, 31, 12,204,172, 12, 44,108,236,124,194, 28, 92,220, 35, 33,226,129,241, 87,236,101, 80,187,250,100, 93,128, 49, +176,176, 6,182,154, 5,184,216,122, 35, 44,120, 57, 88, 62,125,255,173, 32, 10,186, 32, 27,114, 98, 16, 80,101,146,189,102,156, +181,170, 97,205, 26,125, 89, 33,232, 21,178,255,255, 43,136,240,158,127,240, 6, 88,135,159,127,248, 6,200,134, 76,120,254,131, + 93,137,245, 31,124,247, 41, 80, 22,152, 28,144,215,204, 16,238, 54,253,251, 43,139,122, 78,133, 20, 63, 7,181, 14,116, 4, 26, + 18,218,191,101, 51,210, 29,173,144,194, 29,216,108, 31, 45,220, 71,193,112, 45,226,201,214,171,174, 44,206,204,196,248,248,197, +123,134,127,136, 33, 26, 96, 59,139,139,131, 77, 78, 90, 8,207,150, 84,146, 0, 64, 0,209,176, 17,205,197, 39,192,192, 39, 48, +210,162, 28, 50, 87,153,226,168, 51,247,192,181, 68, 59, 13, 96,211, 56,217, 65,235,193,155,207, 38, 13,160, 91,144,234, 3,141, + 11,220,245,128, 12,102,208, 74, 66,230, 71,239,190,218, 54,175,255,240,245,167,131,166,148,190,156,200,197,199,160,227, 38,128, +218,155, 66,204,226,102,236, 21,204,152, 15, 44,220,231,167, 57, 66, 90,214,144,213,135, 96, 43,160, 5,229,129,107,143,225,195, +238,196,149,193, 12,181,190, 6, 87,159,126,184,246, 12,180,105, 43,200, 72, 46,204, 76,137,188,102, 59, 51,236,132, 72,100, 80, +233,111, 2,236, 16,124,252,254, 75, 75,138, 31,114,234, 36,164,229, 78,210, 50,158, 81, 48, 10, 70, 2, 0, 54,120, 52, 84, 37, +128,136,166,182, 0, 4, 16,227,232, 97,220, 84, 7,144, 85,225,127,254,252,129,159,148, 11, 20,249,253,251, 55,176,165,140,124, +195, 17,100, 84, 4,114, 40, 40,164,133, 14, 95, 54, 3,159,237,132,104,193, 60,176, 5,168, 23,114, 90, 47, 80,239,207,159, 63, +127,253,250, 5,100, 16, 46,148,193, 0,104,212,145,155,207,121,216, 89,180,165, 5,208,174,195, 38,208,252,255,251, 23,232,139, +239,223,191, 67,252, 5,215, 8, 95,222, 3, 20, 63,115,231,217,155,143, 95,205, 20,133,129,130,240,187, 88, 71, 11,247, 81, 48, + 10, 6, 4, 0, 4,208,104,249, 78, 19, 0, 41,154, 33, 59,149,208,150,166,192, 11,107,172, 82,152,226,200, 37, 62,242, 74,115, + 72,243,249, 47, 12,224, 90,212,136,220,177,128,235,130,219, 8,217, 80, 74,100,249, 11,175,183, 32,181, 14,230,133, 33, 16,151, + 0,235, 0,240, 24, 34, 19, 92,193,104,225, 62, 10, 70,193,128, 0,128, 0, 26, 45,223,105,216,138, 71,227, 98, 93,192,142, 75, + 28, 89, 10,235,193,235,200,106,136,140, 68,100, 93,200,245, 4,241,229, 47,164,214, 65,174, 48,208, 22,207,192, 21, 32, 87, 39, +163, 96, 20,140,130, 1, 1, 0, 1, 52, 90,190,143,130, 81, 48, 10, 70,193,240, 4, 0, 1, 52,218,188, 26, 5,163, 96, 20,140, +130,225, 9, 0, 2,104,180,124, 31, 5,163, 96, 20,140,130,225, 9, 0, 2,104,180,124, 31, 5,163, 96, 20,140,130,225, 9, 0, + 2,104,180,124, 31, 5,163, 96, 20,140,130,225, 9, 0, 2,176,118,117,185, 81, 3, 49,216, 30,207, 18,170, 5,212, 10,169, 21, +143, 32,245, 14,125,230, 0,189,112, 37, 94, 56, 70, 15, 0,136, 7,170,182,187,219,204,159,241, 79, 38,100,187,162,170,160, 43, +237, 36,217, 76, 60,182, 99, 71, 43,229,179, 63, 60,130,184,131, 34,227,139, 73,236, 13, 79,172, 79, 61, 70,116,238,192,233,204, + 64,171, 92,138,182,170,103,116,144, 69,152,198, 16, 34, 89,133,110,144, 81,113,117, 72,198, 29, 20,208, 80, 30,204,197, 56,248, +184, 42,121,105, 51,126,216,137,247,196,155,243, 40, 12,132, 41, 0,171, 16, 64, 17, 64,186, 3, 1, 35, 16, 80, 99,196, 72, 42, + 75, 17,123,100,156,124, 50, 65,103,129,108, 84, 31, 60,232,170,220,170,204,171,167,239, 78, 55,233,254,110,187,113,203,188, 89, + 68,183,150,112,223,106,134,246,241,236,211,245,183,107, 81,186, 40,161, 98,105,162,179, 72,242,162, 83,232, 96, 23, 57, 68, 39, +236, 82, 3,187, 13,202,138, 30, 99,248,112, 78,119,219,180, 25,121,147,218, 46,215, 84, 91, 46,106,175,152, 72,204, 39,235,183, +151,159, 47,190, 92,125,221, 53, 24, 83,189,125,216, 61,196,154,153,115,196, 55,235, 33,138,189,226,113, 22,205, 40,106, 37, 20, +203,181,165, 86, 46, 44,102,138,225,226, 25,113,132, 58,215,216,153, 0,104,155, 83, 74,109,252,249, 75,238, 73,201, 6,182,212, + 47,203, 96,184,204,102,116,188, 78, 51,179,124, 29,255,103,159, 23,244,183,143,222,215, 15, 52, 52, 46,185,213,167,195, 70,214, + 56,162,215,153,115,237, 51,249,185,241, 54,235, 0,199,195,241,205,120,115, 8, 6,250, 55, 8,129,214,160, 65, 72, 45,191,162, +213,201,250,253,143,219,239, 97,177,104, 95, 5,177,155,223, 99,128, 23, 5,137, 80,159,161, 63,238,217,130,143,246,157,248, 65, + 66,248,105,142, 96,152,243, 97, 95, 60,130,135, 53, 31, 56, 13,231,197, 28, 5, 21, 44, 97, 17,189, 9, 57, 30,222,160,229,255, + 65,203, 74,191,208, 56,190,230, 92, 6,182,250, 59,196, 37,222,215, 55, 62,103, 74,106, 50,244,172, 12, 81, 75, 57,104,165, 99, + 92, 53, 6, 57,200, 37, 23, 5,226,230, 36,225, 88,242,152,114,105,169,214,162,197, 34, 77,211,223, 82,106,246,183,168,197, 11, +213,252,199, 26,105, 24,235,104,247,198,147,174,233, 51,192,163,121,114, 87,235,121,140,122,214,159, 82,220,108,194,244,124,233, +180,159, 83,168,203,218,248,151, 56,255,159, 15,239, 71, 41,190,156,240,223, 2,176,118,110, 75, 13,194, 64, 24,206, 38, 80, 28, +171,118,250, 2,190,255,147, 57,163,142,227,133, 83, 75,115, 90,255, 93, 18, 74, 75,209,206, 88, 46, 40, 16,200, 97,249,247,219, +189,160, 9,253,135,236, 60,233,213,104,108, 82, 67,147,169,175,180,194, 93, 72,161,165,142,170, 2, 42,220,141, 98, 93, 87,136, + 0,104,157,252, 31, 70,192, 11, 16, 43,241,137, 81, 24, 66, 0,173, 99, 20,246,224, 21,229, 20, 81, 31,212,128, 82,202, 42, 49, +224,207, 8,181,208, 8,184, 38, 44,155,240,189,149,182,219, 86,181,171,215,165,222, 1,113, 26, 12, 80,224, 12,201, 20, 0, 84, +230,239, 29, 17,150,178, 60,139, 95,185, 63, 95,178,188,204,235, 73, 69, 38,145, 19, 20,235, 67, 64, 69,208, 99, 22, 68, 2,173, +232,116,226, 34,139,211, 21, 93,105,178,119, 26,163,156,217, 62,211,235,103,191,243,236,115, 62, 64,234,153,129,239, 28, 48, 78, +240, 66,166, 37,216,108, 31, 95,222, 63,208, 99,234,236,125,231, 54,235,110,187,110,159, 30,220, 93,135, 16, 97,124, 32,223,219, + 94, 72, 45, 54,110,156, 4,170,148, 2, 6,192,232, 79,150,136, 2, 21,247,112,161, 52,124, 2, 79,251,232,251,183,175,126,239, +163,196,146,196,202,119,253, 74,158,107, 72, 67,211, 48,110,162, 99,112,187,192,247, 51,162,241,140,194,127, 82,158,174,230, 50, + 45, 67,156,110,193,247,185,167,141, 8,113,199,197,118,104,121, 32, 60, 26,132, 23,140,112, 10,119, 90,228,175,113,116,197, 32, +146,248,215,244, 54,156, 54,116,129,236,133,134,213, 99,225, 33,195, 26,196, 86,207,240, 90,157, 93,118,121,107, 42,212, 37, 26, +216,226,194,234, 63, 36,233,142, 29,115,183, 66, 3, 58, 18, 64,211, 43, 12,166, 65,246,230, 90,193, 58,152,174,219, 10, 7,174, + 89, 9,248,187,149, 63,236, 3, 92, 40, 69, 15,182,131,238,201, 11,241,113, 1,186,132, 56, 37, 91,154,142,180,228,102, 53,202, +202, 78,230,242,224, 84,242, 41, 26,248,206,195,113,214,228,112, 84, 47,188,181,165,118,119,248, 38,241, 9,181,131, 46,170, 84, +253,244, 28,241,191,164, 50, 75, 18,181,179, 48, 57,215, 36,223, 40, 41, 57,219,126, 4,160,237,236,118,219,134, 97, 40, 44,209, +178, 21, 44, 77,209, 92, 20, 69,175,251,254, 79,182,162,197,150, 22,133,227, 72,234, 57,164,228,120, 75, 92,108, 24, 6,228,194, + 8,162, 31,155,228,225, 39, 35, 18,255, 21,219, 97,170, 77,136,239,211,251, 21,113,111, 39, 27, 83, 99,173,252,183,125, 67, 83, +240,211, 54,107,242, 48,241, 64,183, 48,113,135,176, 7,233, 66, 15, 15, 24,232, 12, 4,122,254,164,131,166,211,137, 92,214, 44, + 26, 64,242,157,166,140, 98,217,214,213,255, 90,139, 44,117,101,137, 92,217,185,134,232,114, 17,196, 82, 36,151,135,187,199,231, +159,223, 83, 37, 48,227,116, 91, 65,228, 36,116,124,120,171, 73, 60,183,240, 88, 47, 92, 50, 52,227,101, 62, 1, 76,204, 85,231, + 70,234,160,182, 58,189,103,227, 95,157,236,153,246,107,136, 87,126,103, 25, 46,138,199,228, 67,113,183, 67,153,188,123, 17,246, +131,209,115, 10,195, 80,110,121,198, 46, 26,158,238,159,246,120,104,200, 28,125,116,187,111,161, 31,186, 24,152,187,208,255, 22, +147,220, 97, 94, 61,122, 28, 71,255,246, 81, 78,199,244, 49, 10,230, 5, 74,233,178, 14,226, 37, 50,107,166,124, 2, 51,187, 17, +249, 40,104,202, 19, 62, 99,205,101,137, 84,115, 86, 4, 43, 44,227,203,117,199,243,115, 37,114,191,224,145,253,102,127, 24, 15, + 88, 59,124,237, 69, 81, 54, 83, 30,103, 56,186,202,230, 95,139,251,108,210, 93,127,115, 80,111,132,117, 78,154,141,254,234,101, + 37,228, 37,253,202,220,126,125,196,182, 48, 93,123,239,105, 12,200,235,187,184,127, 29, 95,203, 31,136,187, 95,140,182, 38,238, +107,124, 71,195,213, 86, 89,195,161,243,215,177,125,222, 38,167, 43,236,166,247,205,178,114, 33, 49, 53,138,170, 78,139,110, 95, +179,141,119,170,243, 98,149, 93, 92,165, 57,161, 31,219, 29, 73, 77,114, 21,225,157,173,206,245,160, 13,240, 92,232,161,173,253, + 48,244, 27,110,115,142, 17,215,240,224,237,246,230,240,246, 99, 10, 16,246, 35,219,101, 83, 92, 34, 18, 59, 11, 44,234,238, 75, + 94, 46, 81,102,129,231,220,213,141, 16,203,136,202,196, 96,203, 13,222, 43,150, 83,146,192,251,217,166,150,185,123, 28,225,165, +223,196, 16,209,250,152,142,174, 84, 81, 33, 9, 89,237, 97,109,215,250, 40,231,236,184,174,236,114, 1,230,191,185, 83,249, 63, +204,190, 28,229, 83, 0,210,174,174,183, 65, 24, 6,198, 14, 33,208,105,147,214,255,255, 7,167,189,172, 85, 55, 10,133,100,103, + 59,176,174,172,104,218,222,248, 8, 4, 18,231,124,119, 82,146,255,226, 59,134,238,251,101,156,123,191,236,195, 92,250,213,176, + 93,126, 83,166,185,148,254, 38,205,182,186,134,138, 81,123,224, 9,231, 98,204, 84, 58,129, 94,208, 93,214,163, 2,222, 4,188, + 40,134, 6,207,141,105, 28,186, 14,168,167, 52,120, 4, 11,197, 91, 65, 49, 69,153, 81,178, 92,146,213, 97,225, 59,148, 74, 1, + 62,175,239,230, 25,110,209,145,135,238, 56,201,218, 95,134,197,105,153, 48,154, 44,115, 37,237,103, 43,205,110, 23,119,231,177, + 83,150, 59,235,104,214,149,195,228, 49, 93,187, 95, 35, 33,251, 89, 58,107,208,139, 64,100,219, 83,151,138,187, 67,150,196,204, + 45,194,143, 77,175,253,199,203, 56,156, 82, 6,195,105,218,230,169, 9, 72, 19,129,232,161,117, 65, 60, 22, 26,197,238, 73,210, + 82,158,234,218,215, 81,248,211, 4, 98, 46,106, 65,124, 25,169, 38, 49,200, 56, 78,107,162, 11,142,135,124, 30, 38,175,249,111, +146, 26, 69, 45,212,236, 37, 63,129,234,160,116, 29,115,238, 69,163, 44,138,154, 19, 43,231, 33,253, 98,109, 64,180,240,196,133, +134,124,197,100,249,185,171, 16,181,163,195,249,109,141,218,145,227, 32,219,240, 94,109,236,158,206, 27, 81,142, 43, 59,223,118, + 83,183,228,143,181, 50, 88,170, 56, 94, 78, 55, 92,120,253,194,232,155, 97,234,215,137, 42, 25, 9,254, 45,169,183,132,183,197, +226,105,246,181, 0,238,235,207,222, 0,247,185, 48,121,199,107,177,183,145,249,188,113,211, 66,192,239,123, 50,197,132, 41, 66, +196,156, 25,173, 56,187,153, 39, 21,170,126,197, 66, 77,165,146,248,124, 84,116,185, 42,113, 21,217,182, 15, 59,105, 74, 97, 27, + 10,174,160,252, 50, 7,219,171, 23, 41,222,107,197, 65,124, 25, 95,135, 42, 52, 21,176,189,137, 77, 27, 98, 11,189,251,188,223, +247,125, 15,122,239, 44,138,113, 9,225,137,136,175,100,213, 84,113,124, 73,141, 22, 65,104, 81,239, 78,205, 94, 3,249,210, 4, +226,172,166, 12, 0,185, 0, 40, 40,233,148, 59,158,253, 22,249, 30, 92, 34,103, 83,194, 57, 27,142,251, 4, 56, 17,199, 38, 75, + 73,187,167, 3,152, 11, 33,179,157, 82,179,251, 14,241, 54, 22,242, 79,200,158,239,107,160,199,248, 8,222, 67,155,182,204,223, + 16,255, 38, 16, 63, 5, 32,237,218,118,212,134,161,160,207,177,177, 67, 83, 88, 86,187,251,208,174,250, 59,171,254,255, 3, 18, +234, 31, 84, 60,236, 74, 1, 2,142,227,158,139, 3,161,161, 66,109, 17, 2,201, 14,160,216,115,198, 51, 99, 37,208, 40,226,255, +172, 18,133,163, 7, 93,172, 11,164, 53,154,123, 96,240,115, 50, 93,196, 30,114, 0, 14,121,136,209, 94,129,133,196,228, 98,219, + 36,142,153,241,253, 74,124, 85,249,224, 67, 53, 35,222,202,121,177, 92, 81, 27,145,123, 86,166, 45,234, 57,171, 13,155, 17, 78, +192,203,124,105, 6,164,153,178,168, 8,208, 16,208,138,252, 56, 95,109,169, 64,188, 92,126, 41,241, 16,200, 60, 18,111, 70, 81, + 11,102, 85, 47,129,105,177, 19,128,106,114, 39,231,169,106, 29, 21, 67,157,204, 57, 14, 8, 16,246,129, 50,223,108, 81,164,155, +139,130, 57, 95,109,140,252,174,181,207,139,151, 67,220, 7,231,248,105, 89, 66,189,199,195, 54,238,126, 52,219, 77,251,241,179, + 37,169, 77, 93, 52,124,190, 66, 7, 4,189,132,135, 54, 53,187,190,105,242,174,205,167, 8,178, 7,129,132,219,120,164,174,220, + 69, 76,137,211,117, 78,146, 58,123, 58, 66,140,144, 18, 43,165, 16,204,106,129,143, 43,248, 92,227,211,131,123,124,176,203, 26, + 42, 82,239, 78,247, 61,140,247,174, 10,220,178,255,216,211, 96,164,226,101, 53,110, 63,211, 66, 54, 19,185, 58,161,155,242,254, +101,249,181, 25,224,123,131,249,120,237,203,119,243,232,241, 17, 81, 28,192,152, 19,105,204,105,157,232,114,154, 70,216,159,176, +162,246,158,235,255,143,162,228, 31,170, 5, 70,225,140, 25, 8,177,182,117, 98,151, 5, 99, 27, 54,101, 85, 24, 85, 62, 78,220, +227, 72,173,195,232,224,171, 16, 28, 6,229,116,237,248, 50,220,154, 20,184,125, 34,103,114,103,204,219, 75, 23,158,117,176, 26, + 92,101,246, 18,172,216,146, 88, 10, 31,194,240,183, 50,160,117,197, 79,227,100,159, 7,173,210,183,212,159,196, 52,133,244, 85, +186, 72, 26, 42, 31, 17,131,238,168,212, 45,113,187,167, 74,167,154,119,244,106, 3, 73,155,215,215,111,111,111,223, 55,235,245, +241,120, 48,195,125, 82,179, 38,178, 84,227, 44,186,122,217,141, 99, 53,196,203, 12,125, 21,199,171, 18,227,171,233, 39,117,104, +173,202, 71, 46,101, 46, 72,221, 89, 83, 54, 80, 28,227,220,213,193,122, 82,141,154, 56, 8,143, 19,193,119,146,252, 92,100, 4, + 92, 44,118, 63,198, 63,148,117,244,247,105,197,123,124,169,158,175,231,228, 63,193,181,204, 55,183,192,163, 45,228,131,219,174, +253, 91,114,167,199, 47, 1, 72,187,154,158,182,129, 32,234, 89,123, 29,190, 76, 26, 69, 92,104, 46,237,161,234, 63, 40, 2,196, +111, 65,226, 88,137,191,192,143,236, 9,142,160, 30,170, 40, 45, 18, 10, 65,155,181,151,121, 51,187,182,137, 8, 4, 53,137,162, + 85,108, 89,222,221,217, 55,111,222,139,214,255,133,239, 42,200,180,180, 93,218,193,168, 26,163, 54, 13,166, 39, 72,164, 42,154, + 3, 33, 33,119, 75,252, 72, 16,240, 87, 94,114,161,102, 44,169,177, 42,211, 83,150, 91,213,222,254,176,250,180, 61,216, 61, 63, +191,184,185,185,158, 63, 62,146,110,171,155,224, 71, 7, 94,212,248, 58, 6,186,204, 96, 30,119,239, 42,182,237, 30,151, 90,121, + 50,118, 18,184, 7, 69,124, 74,186,160,150,208,122,147,201,175,109, 24, 80,150,245,178,165,165,152, 21,121,128, 86,104, 29, 93, +200,254, 65,107,121, 80, 84,131,249,135,245, 35, 36, 39,200, 64, 64,248, 83,124,151,158,195,241, 52, 28,212,100,141, 57, 24,140, +127,207,167, 51,183,184, 93,252,253, 53,255,115,231, 31,102,217,226,201,134,157,225,214,225,184, 58, 28,237, 14, 7,150,115, 99, + 46,102,169,188, 37,111, 48,168,229,102, 96,185,184,225,142, 19,131,248, 19, 99,189, 35,231,184,226,228,194, 21, 3,107, 32,184, + 83,105,193,244,147, 72, 74,182, 12,124, 45, 14,230, 0,186,194, 81,108,156, 67, 5,203,179,195,213, 87, 46,201,203,121,159, 69, + 19, 75, 94,181,216, 86,157,217, 73,138,152, 33, 51,212,213, 60,212, 39,212, 34,177, 21,124, 26,131,251,187,110,210,187, 71, 13, +152,190,245,189, 74,124, 69,154, 87,112,255, 50,254,122,191,248,215, 63,228,131,111, 54, 86,252,179,104, 93,110, 10,238,244, 82, +178, 88, 2,220,179, 21,216,141,208,219,179,166,214, 41, 57, 41,192, 94, 21,220, 87,150, 24,173, 23,240,137, 58, 68, 90,215,145, + 62,184,247,117, 97, 74, 89,165,187,115,147, 50,128,202,170, 88, 26, 33,110,100, 97,164, 13, 94,166, 28, 78,126,141, 13, 74, 13, + 4, 94, 97, 90,238, 36, 69, 53,144, 61, 40,135,227, 85,192,160, 44,162,187, 5,143,171,118,170,209,232,224,243,100,242,227,232, +232,231,213,229,247,227,111,167, 39,103,247,211, 7, 62,141,241,195, 57, 15,216,173,235,180, 15, 7,136, 53,170, 79, 94,226, 4, +172, 96, 88, 55, 16,239,241,236,118,241,107,173,152, 78, 5, 24, 16,204,187, 38,246,152,218, 61, 57, 16,190,203,134,175,235,197, +103,195,113,206, 82,178,150,169, 67,219,148,103,121, 30, 11,220,201, 42,197,209,145,177,198,214,161,121,203,171,232, 62,189,180, + 28,221,225, 78, 45,126,219,169,242,248, 87, 73,243, 81,112,231,215,179, 0,148, 93,205,142,211, 48, 16,246,216,177, 77,178,151, +237,238,133, 69, 21, 66, 28,120, 5, 88,222, 6,238,188, 22, 55,224, 6,207,129,216, 11, 55,144,184, 32,177,170, 40,205,255,143, +119,126,236, 54,116,219, 10,218, 42,138,148,168,137,237,153,111,190,153,111,148, 28,197,119, 56,245,139, 54, 7,145,215, 9,166, + 11,187, 77,196,156,157,157, 0, 27,151, 86,153,100, 1,180,184,130, 65, 36,114, 6, 35,133, 96,136,156,128, 82, 47, 10,192, 20, + 1,164,151,198, 60,127,241,242,245,155, 87, 31, 63,124,194,149, 24, 49,233,194,181, 86,105,165, 19,195, 20,144,137,214, 20,101, + 91,202, 50,157,201,144,143,155, 84,231, 15,177, 80,200,204, 67,130, 59,168,220,230,203,203,229,186, 94,203,164, 75,205,157, 45, + 32,202,232,209,199, 52,204,231,201, 80, 47,139,126,180,184,170,154,234,250,217,245,183, 95,223, 39,182,148,199, 23,203,146,202, + 42,212, 27, 19,162,240, 67,131, 67, 64, 71,172,110,166,225,247, 72, 36,253,107,249,243,166,249,113,171, 55,165, 29,148,213,103, +222,231,222, 23,206,231, 72,216, 41,212, 17,172, 91,116, 7,206, 69,173,213,142,116, 40,237,172,121,144,241,190, 6,199, 61, 48, +185,179, 62, 83,206,138, 20, 13, 62, 51,120,189,182, 87,101, 21,214,101,104, 59,232,135,208,247, 10,169,253,166,154,234, 90, 87, +245,212,212,161,105,160,109, 71, 28,222, 48,170,166,157,106,126,244, 36,222,113,131,252,127, 32, 17, 75,100,213, 16, 31, 65, 54, +113,152, 14,120,169,243,226,162,234, 74, 41,190,225,188, 32,225,162,147, 82, 31, 67,136, 61, 21,146, 56,255,199, 7,105,248, 24, +254,170,138, 60,185,124,186, 98,200, 30,227, 27, 42,145, 38, 23, 9, 73,247,237, 19,193, 61, 9,215,187, 72,243,143, 55,224,141, +231,240,124, 32,159,216, 43,128,220, 39,239, 41,121, 5, 56,224, 65, 17,115,157,201, 49, 87, 72,190, 13, 7,149,249,251, 52,127, +219, 42,179,117,177, 19, 46, 57,235,147,129, 35,240, 63, 83, 83,119,253, 14, 42,177, 25,174,201, 32,104,111,229, 49, 70, 59, 72, + 67,208, 33, 82,118, 97,244, 59, 16,103,183,202,100,159, 73,149,166, 6, 53, 45, 60,137,191, 74,167,163,180, 13, 18, 12,164,113, +130, 11,176, 38,115, 8,240,196,224,189, 71,123, 7, 93,149, 85, 97,207,160, 86,239,223,190,187,249,242,121,181,186,253, 83,110, +186,182, 30,168,169,107, 16,185, 95, 74,187,194, 4, 53,111, 40, 11, 48,172,209,102,232, 34,198,227, 63,218,156, 40, 75,128,135, +139,171,117,189, 1, 37,109, 19, 51, 1, 31,194,162, 56,239,250,142,129, 35, 88,100,152,198,245, 99,199,152, 32, 21,170, 48,167, +240,232,109,108, 34,211, 30,144,242,196,193,188, 2,185,135,233,167,161, 24,102, 18,142, 62,158,129,165,120,112,202,170,143, 29, +186, 19,128,181,107,219,105, 27, 8,162,107,175, 77, 76,160, 16, 90, 85,170, 68, 4, 31,129, 16,170,212,255,127,225, 1,161, 42, + 42,175, 60,244,162,146, 66, 11,137,119,215,246,238, 50,103,198, 38, 23, 97,139,135, 70,138, 18,105, 19, 95,103,207,158, 57,115, + 52,126,197, 63,147,108,173, 64, 67, 27, 21,169,253, 37, 16, 91,250,220, 18,246, 78,216, 83,109,226,198,156, 64,160, 95, 26,227, +234,182, 31, 46,211,120, 89,249, 53,161, 87,134,251, 68, 48,182, 67,191,188,248,252,133,134,190,205,102, 68,100,173, 53,166, 44, + 77, 85,250,186, 70, 23, 67,226,215,156,231,176,187,137,213,159,142, 92,240, 49,193,132,169, 0,145, 64,189,140, 7, 51, 33, 35, +194, 53,100,231, 44,189,105,104,138, 90,197, 1,243, 70,240, 43, 85, 84, 84, 78, 64, 74, 13,118,160,166, 71,211,189, 98,119,246, +253,134, 78,136,165, 40,209, 29,161, 68, 57,239,254, 54,246,222,151,115,229,154, 52, 84,193, 19,177, 57, 64, 8,166, 68, 78,137, +100, 52,129, 49, 50,112, 25, 7,180, 71, 51,183,201,104,113,146,104,102,133, 41, 18,118, 23, 59,244, 7, 58,223,230,248,211, 71, +138,248,187, 63,247,163,108, 84, 58,186, 14, 4,226,113, 81,133,148,179, 84, 13,162, 15,255, 0,167,192,184, 20,180, 18,240,227, + 68,162,171,195,210,212,129, 17, 28, 58, 62, 23,224,124, 76,170, 8, 79, 14,141,228,193,206,127, 46,104, 29,173, 80,119,229,166, +148,220, 7,147,222,116, 96,147,253,247,191, 31,127, 69, 88, 50,164,155,177,134, 56,202, 69,172, 77,247, 75, 28,118, 23,236,143, + 14,150,238,169, 79,162,161,141,240,109, 74,215,235,156,161,223,127, 34,163,103,167,231, 87,183,151,111,116, 38,172,185, 3, 52, +203, 53,216,209,225,238,209, 63,243, 80,228,133,173,237, 86, 24, 20, 26,161,104,188, 77, 55,129,120, 64,121,239, 28,150,185, 15, +110, 61,172, 94,124, 53,177, 7,220,165,154, 42,156,105,203, 44, 57,112, 62,241,117, 11,210,106,254,110, 89,101, 54, 5,247,149, +199,119, 37,171, 35,249, 20,255,108,218, 58, 5,146, 14,179,146, 22,205,249,187,206,248, 67, 38, 50, 75,244,178, 11, 97, 89, 28, +192,177,229,255,137,136, 54,168,178, 49,205, 38, 96,206, 70, 57,218, 76, 19,189,161, 15,226, 54,249,100,242, 97,122, 50,189,254, +122, 93,225, 89,117,198, 88,179, 44, 9,226,157,107, 92,141, 89, 95, 33, 28, 19, 92, 28,126,105, 38,130,112,222,208,108,135, 37, + 56,198, 98, 60,126, 55, 62,188,155,255, 88,152,146,136,191,165, 68, 53, 32, 23,199, 2,161, 60,119, 78,245, 98,126,173,137,224, +224, 90, 35,219,107,253, 53,138,125,114, 12,217, 82, 56,233, 40, 14,230,148, 98,144, 13, 27, 94, 26,245, 95, 58,163,246,121,114, +226,155,211,223,190,195,120, 22,128,179,107,219,109, 34, 6,162,246,172,179,155,180, 84,130,114,121, 64, 60,151,127, 71, 60,240, + 35,252, 0, 74,121, 67,173, 16,106,213, 36,221,100, 55,182,135, 51, 30, 59,187,185,148, 2,175,145,236,100,215,227, 51, 51,231, + 28,199,238,239,140,185, 39,103, 25,250,142,108,179,205, 73, 62,199,142,104,227,212,212, 86,132, 20,180, 63, 36,184,131, 46, 43, +120, 35,221,150, 38, 97,151, 86, 74, 57, 19, 46, 96,111,148, 27,136,222, 77,207,231,243,111,139,251, 59,140,194,132, 88,162,179, +122,214,245,155,144,101,141,157,188,145,139,161, 44,237, 28,150, 59,249, 51,210,117, 33,251,242,197,171,135,246,158, 51, 95, 70, +122,121,134,146,251, 33,178, 26,120,115,248, 14,239, 20, 96,157,171, 0, 74,122, 81,178,152,179, 19, 99,125, 88,245, 75, 60, 20, + 37, 81,184, 49,168,154,195, 67,216,172, 66,255, 51,172, 86,110,219, 91,158,157, 77,102, 84,219, 64,242,207,233,108,106,107, 27, + 11,112,180,237, 58,145, 55,201,104, 61,149,168,199,251, 18,143,227,108,226, 2,197,169,171,154,137,186,212, 43, 35,234, 79,192, +182,232,186,237,135,247,111, 62, 94, 93,125,250,252, 5,184,139, 87, 28,196,244, 24,177,133,240, 56, 78, 89, 32,182,226,200,244, +253,196,162, 65, 96, 84,235,248,109, 81,110, 2,195, 46,160,181, 56, 53,121,235,229,254,167,232, 36, 21, 8,187,201, 17, 80,231, +154,154,209,180,230,243, 0, 82,202, 40,101, 40, 68, 68,244,203,118,185,235,114, 57,221, 6,149, 85,183,253, 72,197, 86, 67,114, +160,167,149,202,199,110,241, 7,254,164,160,194, 94, 32,211,115,172,206,215, 4,238,116,168, 80,169, 79,226,201,177,227,190, 1, +224, 94,220,207,135, 91, 23,160,128, 14,135, 70,148, 84,202,109,158,158,227, 54,131,220, 69,156,233, 44,115, 68,137,156,212, 99, + 83,181, 88,233,151,202, 64,169,172, 89,163,147,173, 61, 53,146, 77, 89, 35, 62, 81, 8,154,177,160,234, 6, 71,199, 30,184, 15, +174, 71,117, 53,114, 33, 99,212,232, 86,144,189, 24,154, 21,248,181,152, 51, 42,158, 37, 0, 23, 15, 90,177,199,105, 87,144,120, +239,116,121,187,228, 45,171, 71, 77,168, 88,230, 83, 98,136,233,192, 64, 34,216, 77,172,186,117,251,253,122,142, 2, 14,225, 43, +246, 93,239, 83, 27, 25,147, 16, 36,157,226, 69,115,254,216,181, 90, 11, 34,188,157, 10,118,114,175,111,117,121,241,246,110,241, +235,242,245,187,155,219, 31, 24, 80,215,117,191,101, 36, 19, 47,213, 9,208, 8, 49, 31, 80, 56,245,253, 6,115, 97,250, 34,153, + 14,106,182, 2,196, 81,188,208,206,246,198,102,204,241,252, 79, 65,125,140,227, 35,242,136, 21,209,194,254, 36, 59, 13, 31,139, +130, 77,103,255,197,121,252, 91, 0,202,174, 96, 55,106, 24,136,218, 78,156, 52,169,118,123, 64,173,144,168,170,126, 1, 7, 46, + 32, 16,159, 2, 71, 36, 14,253, 39, 40,240, 55,156,170, 94,138, 84,137, 74, 21, 72, 72, 75,183,180,155, 52,113,236,233,204,216, +241,110,183,155, 72,236, 94,179,145,157,216,111,222,188,121,179, 30, 34,239,114,224,199, 50,178,130, 85,227, 99,223,218,192,186, +136,208, 69,154,167, 34,205,100, 22,248, 4, 80, 5, 68, 11,124, 9, 9, 62, 95, 98,166, 66, 84,174, 90,184, 10,115, 34,194, 55, + 70,212, 96,175,244,116,176,235, 64,104,220,108,215,255,174, 16, 89, 16,172,246,166, 79,127,207, 46, 17,229, 58, 99,216, 22,226, + 2, 21,146,209,152, 73, 9, 92,200,172,116,162, 96,101,192,170,143,184,156, 54, 96, 66,120, 83, 43, 95,122,241,202, 54,125, 9, +227, 96,119,103,119,167,152,254,252,115,177,238,116,115,206,199, 18,199,193,136,231,196,137, 3, 91,190,110,154,219, 91, 76, 3, +165,157,219,197,175,118, 94,165, 93,155,118,197,148,124, 47, 79,240, 33, 88,205, 55, 0, 99, 73, 91, 82,148, 15, 74, 28, 32,210, + 99, 0, 22,181, 9, 74,101,174, 85,150, 39, 5,130,123,161,114, 77, 96, 75,158,121, 39,155, 6,200,195, 76, 5, 67,120,253,252, +197,217,143,243,139,203,217,251,119,111, 79, 79,206,190,159,156,150,121, 65,145, 39,129, 73,166, 29,137, 91,228,133, 57,220,127, +182,168,171,217,213,245,209,199, 15, 72,127, 62,125, 57,206,182, 20,198, 25, 36, 42, 9,105, 86,142,140,146,214,222,225,128, 26, +154, 23, 6, 46,220, 43, 9,185,224,241, 37,105,220, 91,222, 19, 10, 62,122,210,138,163, 13,217,116, 53,139,239,131,136,217, 95, +174,236, 67,163,228, 38,209,121,116,245, 3,216, 71,209, 65,110, 34,230,201,128, 75, 13,150,249,165, 24,183,178,149,186,172, 77, +229,135,143,119,107,104, 65,226,242,209,173, 53,113, 82, 29,116, 32,150, 34,125,111,136, 85, 15,201, 14,162,103,106, 96,227,225, +242, 82, 10,128, 81,113, 92,173, 56,208,195, 31, 44,247,249, 28, 46,142,201,214,100, 94,255, 93,233, 60, 88,191, 1,107,100, 16, + 81, 62,242, 65, 37, 98,103,161,140,158,125,213,187,161, 98, 53, 53,229,119,237, 13, 40,178,231,230,155,144,221,243,184, 52,176, +120, 17,128,222,123, 37,131, 99,178,135,117,230,235,224, 27, 0,101,108,110, 98, 35, 93,202, 81,129,130, 1, 65, 55, 62, 93,100, + 51,166, 37, 7, 48, 85, 66, 59,204,207,145,177,183,141,161, 83,107, 12, 31,148, 67,185,164,175,245, 39,100, 14, 99,210,195,198, +104,146,127,147,172,204,183,203,114, 27,175,120,249,234,205,254,193,193,183,175,159, 17,248,233,204,156,190, 1,199,231,193,192, +238, 57,158, 37,203, 45,114, 29,202,189,198,136, 17,200,176, 29,218,254, 79,111,196, 90,169, 99,156,118, 7,149,155,153, 16, 44, + 11, 54, 62,192,208, 74,115, 3, 8, 14,143, 12, 99,227,159,123, 1, 88,187,150,221, 38, 98, 40,234,235,121,230, 81, 2,130,150, + 6,149, 37,252, 5, 44,128, 21, 95,133, 34,190, 0,149, 63, 64,130,111,224,177, 68,176,101,133, 64,165, 84,180,145,186, 32,148, +180,204, 35,227,177,205,189,215, 54, 9,105, 42, 90,137, 89,101, 17,201, 51,158,251, 56, 62,247, 28, 77,124,174,226,238,197, 35, +139, 72,202,249,226, 32, 88,221,252, 57, 46, 23,132, 62, 53,190, 32,209,214,118,230,132, 71,100, 91,213, 68, 56, 32, 14,141, 85, +148,200, 36,141,179,110,220, 93,239, 92, 51,160, 39,234,232, 87, 91, 74,146, 51, 37, 62, 41, 49,189,233, 85,136,170, 44,146, 52, +163,102, 46,204,120,178,199,159, 57,106,153, 53, 35, 17, 35, 48, 15,239, 24, 51,175, 96,145,242,246,240,214,238,225,142,147, 96, + 58,217,185,176, 62,242, 60,213, 5,182, 86, 77, 42, 83,101,137,125, 27,244, 46, 31, 87, 39, 62,234, 53,162,131, 75, 95, 14,119, +121, 68, 36, 23, 21,170, 22,147, 23, 90, 50, 90, 89, 70,241,204,185, 89, 39,209,129,104,162,167, 99,248, 94,139,182,137,116,127, +144, 15,146,172,151,247,123,157, 84,240,192,223, 77,124,173,230, 89,167,208,164, 6,149, 34, 67,236,172,233,230, 19,247,225, 36, +142,123, 22,217, 96,212,147,217, 54, 10, 83, 5, 60,174, 12,183,134,213, 76,127, 59,216,223, 88,191,105, 69,231,213,155,215, 69, +101,238, 63,120,248,225,227,222,143, 41,118,170, 72, 25,114,238,178, 2, 89, 92,189, 50,120, 52, 26,237,238,124,125,242,116,251, +206,221,123, 8, 51,159, 61,127,129,248,147,232,108,214,108,102,105, 92,211, 6, 67,198,105, 77,235, 3,245, 94,109,161, 52,122, +173,155, 28,157,152, 36,202,112,183,165,213,122, 30, 88, 38, 76,255,255,250,146,136, 9, 76,130, 9, 68,188, 34,208,234,197,162, + 90,252,135,139,244,145,105,175,104, 10,121, 74, 95, 24,184,239, 21,150,215, 78,148, 87,186,134,127, 65,170,146,139, 59,120, 10, + 46,136,160, 72, 95,168, 86, 57,155,220, 60, 25, 59,165,166,147, 18,231,231, 31,212, 99,192,156,221,186, 0,150,124,109,167, 88, +126, 59, 15, 56, 95, 37,104,199,201,202, 99,167,213, 79,123,246, 35,132, 99, 44,248, 42,207,119,137, 59, 86,169,138,135, 84,142, + 88,159,139,219,131,237,219,103, 4,229,206,188,184,203, 40,248, 88, 3, 29, 47,231,208,158, 40, 61,112,189,128,107,108,180,108, + 94, 93,184,164, 43,241, 78,109,224, 68, 15,224,116, 6, 49,171,110,120, 53,214,199, 96, 82,131,162,159, 88,229, 49,138, 26, 69, + 76, 12,123,154,176,201, 42,219,182,215,215, 54,199,147,125, 55,117,195, 67,164,112, 85,218,178,142, 6,159, 27,155, 0,254,211, +100,121,222, 31,109, 63,126,247,246,253,198,203,205,162, 56,198,229,111,244,183, 62, 31,124,194,213,140, 66,124,213,224,142, 54, +172,162,207,211,110, 61, 43,109, 72,111, 10,212, 16,172, 60, 45, 75, 85, 83,158, 71, 37, 11, 23,128,236, 43,200,197, 28,178,154, +150,213,139,116,252,130, 96,123, 41, 90,108,107, 46,156, 79,191, 5, 96,237,218,117,155, 8,162,232,188, 60,235, 93, 39,107,227, + 6, 81,162,196, 5, 37, 66,162, 69,249,203, 84, 72,252, 0, 82,148,146,130, 10, 55, 52, 72, 20, 40, 36, 18, 5, 18, 85,112, 66, +192, 89,239,107,134,251,152,125, 57,177, 0, 9, 55,182,247, 57,218,157,189,123,238, 61,231,204, 12,248, 85,121, 55,184, 55,118, + 99,221,245,164,224, 84,224,202,140,198,164, 15,111,115, 36, 1, 73,198,218,235,194,229, 21, 32, 30, 81, 17,109, 37, 84,240,150, +226,115,192,196,163,227,123,130, 70, 52,200,112,205,163,201,195,212,166,107,159,193,246,170,113, 53, 99, 60, 36, 75, 3,201, 95, +113,102, 59,248, 66,193,165,137, 54,197,218,179,246,208,133, 81, 10, 90,136, 1, 75,174,127,173,168,247, 97, 73, 61, 40, 50,141, + 12, 12, 79,224, 96, 85, 94,230,176, 51, 82, 52, 94, 22,228, 96,110,228,249,226, 42,251,161, 24,191,176, 63,174,165,113,189, 15, +179,158, 82,225, 2,254, 71,214,226, 21, 23,245,133,251,118, 25,175,226,137,217,139, 98,184, 8, 22,186,135, 48,117, 13,249,187, +118,216, 96, 72, 89,116, 52, 50,147, 68,237, 39, 40, 85, 76,172, 49, 8, 92, 84, 94,184,178,148,176,242,234, 58,163,114, 55, 0, + 6, 88, 40, 55,104,244, 81,101,197,197, 44,249, 51,203,159, 63,125,246,100,113,240,254,195,199, 7,179,249,226,112,241,230,237, +242,240,241, 65,154, 78, 35, 27,157, 95,124,142,198,163, 56, 18,147,177,129, 12,128, 59,236,209,139, 35, 72,238, 95,159,156,158, +157,125, 90, 46,223,157,127,249,234,157,134, 3, 42, 28,126, 0, 27,111,180,178, 86,206, 98, 51, 77,245,222, 68,199, 54, 20,123, + 43, 36, 85, 93, 78,205, 33, 54, 11,111, 64,107, 17,104, 83,200,173, 33, 10, 70,218, 42, 84, 85,214, 67, 78,233,127,206,217, 52, + 79,230, 57,164,213, 28,188, 6, 97,209,239,148, 90,250,191,242,144,223, 75, 91,213, 4,216, 9,254,132,234,147,222,114,250, 48, +236, 69, 51,148, 83,189,198,200, 63,157,234, 14, 59,218,213, 7,136, 13, 17,157, 67,144,165,229,141,177,100,199, 28, 44, 93,232, +150,161,145,193, 97,130,192,144,170,224,122,240,138, 82,125,192,166, 68, 79,251, 40,216, 91,170, 24,182, 83, 17,146,244, 17, 50, +168,100,232, 55, 86,219,137,113,229, 17, 46, 4,211,102,166,175,159, 33,108,212,174, 98, 42, 20,119,160,179,199,163, 68, 52,146, + 86,228, 70,105, 27,239,130,226,153,199,197, 40,202, 12,189,170, 21,133,121,250,113,115,187,194,208,134,193,156,217, 58, 38,216, +144,108,194,253, 49, 8, 41,136, 39,155, 77,182, 47,211, 87,199, 47, 81,109,226, 69, 81,228,223,111, 46,107,114,188, 99, 0, 65, +149,179,167,244,168,158,198,179,219,124,221,225,230, 0, 43,195, 19, 95, 65, 14,135, 23,192,121, 41,123,148,134,188,239,237,188, + 77,117,195, 97,198, 72,170,215,187, 4, 79, 98, 40,244,242,216,127,252,150,140, 10,187, 22, 4, 39,223,247,135, 11,195, 14,178, +127,252,252, 22,128,178,171,233,109, 26, 8,162,158, 93,219,217,117,210,164, 52,144, 10, 21,161,246, 23, 0, 23, 14,156,250, 55, +144, 56,240, 87, 11, 8, 9,193, 1, 9,144, 80, 47, 21,135,138, 38,180, 81,210, 88,113,252,205,204,236, 58,118, 29,140, 32,202, + 41,167,120, 61,243,102,230,205,155,217, 63,227, 59,212,205,163,166,125,212,242, 25,201, 27, 92, 4,183,232,140,102, 70, 9,141, + 39,151,149,137, 89, 12,209, 96,110,173, 68,215,229,131, 2,211,195,224, 76, 53, 55,169, 69,225, 12,213,254,125, 53, 94, 36,203, +146, 8, 22,193, 83, 7, 64,157, 16,126, 25, 85,135,175,192, 40,189, 73, 56,234,154,235,229, 44,184,111,217, 67, 50,150,145, 30, +113,167,180,104,184, 6,201,119,204,126, 26, 3,244, 86,205,195, 44, 42, 62,132,116,109,184, 50, 74, 46,229, 41,194, 90, 9, 3, +189,135, 63, 12,245,232,228,240,248,250,246,166,146,211,147,211, 96,210,125,114,112,252,117,113,113, 33,102,208, 47,134,190,246, +129,164,254,202,119,181,239,154,204,168,231,121, 1,113,131,174,177, 96,223,245, 2, 61,250, 53, 11,147, 76, 32,112, 23, 25,228, +169,243,112, 50,121,253,234,101, 63, 80,211,233,205,106,181,198, 83,113,153,112, 71,252,165, 51,112,100, 76, 20, 77,217,147,242, +217,147,167, 31, 62,126, 66,208, 61,125,241,252,203,183,207,247,134, 65,154, 71,143,142, 14,227,245, 98,185,188,238, 41, 23,237, +100, 29,151, 81,148, 77,231,225,219,179,247,103,111,222,205, 87,235,171,217,252,199,229, 21,190, 38, 12, 25,113, 86, 68,148, 15, +229, 73,198, 29, 86, 12, 65, 64,114,206, 77, 92,226, 55, 78,208,172, 49,234, 22,190, 43,194, 37,230,125,144,111,111, 13,172, 86, +114, 24,229,232,238,254, 25,154, 26,183, 78,219,226,135, 1,118, 86, 14,116, 81,135, 70, 33,211,101,166,152,188, 67,231,232,108, + 59, 71,106,201, 19,219,221,152,127, 67,124,147, 20,187,194, 43,203,114,103,236,136,104,129,131, 96,188, 78, 67,177, 19,201, 96, +167,105, 6, 14,252, 5, 20,238, 14,169,218,214, 3,128,227,116, 14,199, 10, 81, 75,119,156,166,140,103, 27,255, 42,224,110, 6, + 91,209, 8, 50,150,118,135,173,236,204, 76,101,212,112, 79, 69, 36,102, 63,194,138,219,132,213,188, 49,143, 42,133, 45,111, 37, +240, 4,133,161,104,152,123, 49,125, 87,150,201, 26,121, 11, 57, 29,201,101, 28,225, 75,191,175,250,147,189, 7,105,158, 62, 30, + 31, 97, 5, 31,103, 27, 81, 63, 44,145,171,148,228,160,155,199, 49,223, 2,153, 36, 84,175,243,128, 53, 33, 1,207,175, 66, 94, + 13,201,151, 30,186, 10, 21,238,146, 23,155, 80,155, 66, 41,125,126,254,253,231,244, 18, 83, 1,140, 10,155, 56,226,101, 38,180, +166,195, 44,220,176, 27, 10,192, 25,232, 97, 24,221,194, 93,124, 47, 44,245, 14, 10,221, 89, 74,146, 71, 3, 84,239, 17,154,113, +180,171,111,196,232, 64,195,248,172,220, 5,209,156, 84,239, 54, 54,237, 13,210, 34,105, 25,137, 22, 65,198,238, 96,144, 29,255, +186,246, 52, 87,198,255,247,249, 45, 0,101, 87,215,218, 68, 16, 69,187,179,179,217,205,102,155,208, 98,240, 65, 33, 66, 41,133, + 10, 86, 5,233, 75,133, 62,180,254, 95,127, 68,245, 65,223, 90,164, 20,124, 82,168, 69,100,211, 52,219,253,156, 25,239,199,204, +102,219,198,168,144, 64,178, 33,201,102,103,230,204,185,247,158,115,179, 10,223,109, 9,188, 53,175,117,106,170,235,241, 8,198, + 64,216,238, 95,178,239,193,150,133,151,210,184, 66, 68, 71,246,239,181, 6,119,182,191, 41, 91,143,183, 14, 8,174,112,110, 70, + 27,227,248,209,143,252,138,190,147,160,157, 25, 60, 35, 60,142,190,118, 61, 36,236, 3, 2, 24,237,236, 76,118,166,194,184,194, + 78,192, 93,198,224,224,206,147,157,217,237, 53, 41,100,216,188,209,170,116, 93,160,224,105,170,253,182, 50, 47, 49, 25, 63, 75, +179,212,167, 29, 28,126, 84, 86,222,166, 55,191,140, 37, 80, 72,222, 71,253, 97, 79,246,222, 95,158,124, 51,211, 72, 96,122,189, +170,176,229, 75,153,155, 10,211, 32, 88,212,143,251, 50, 10, 2, 32,239, 40,224,241, 33, 60, 84,123,187,219, 71,135, 7, 23, 95, +207,134,137, 28, 64, 96, 22,194,254,177, 86,212,243,217, 44,125,249,106,247,248,240,237, 32,238,165,211,159,192, 65, 66, 84, 16, +145,149, 21,251,116,248, 18,199,167,217,127,179,119,126,241,165,170,179,215, 47,158, 95, 94,125,207,139,108,123,107,114,242,225, +227,187,163,227, 79,159, 79,235, 74, 81, 28,141,215, 50,144,178,168,235,178,105,146,126, 72, 13, 62,208,159,218,163, 53, 0,180, + 38, 64,203,160, 24, 0,199,136,112,117,194,108, 47, 10, 93, 86,168, 46,214,220,246, 12, 22, 55, 58,147, 26, 92,107,198,174, 44, +198,247,123, 78, 84,211, 81, 1,119,153,187,177, 13,159,240,245,200,143,181,227,194,171,163,214, 21,224,190, 20,175,255, 61, 12, + 30, 39,143, 53,101,111,239,157,255,159,178,164,162,147,141, 36,113, 83,203,139, 23, 68, 7, 78,166,192,196, 14, 28,148, 15,125, + 45,110, 35, 49, 79, 71,147,107,236,119,134,207,162, 32,230,100,206,195,179,165,126, 47,198, 21,132,169, 90,228,137,101,177,197, +146,127, 59, 92,120, 44,238,142,133,203,154, 46,134,198,243, 90, 41,164,109,225,225,132, 94, 11, 87, 32, 51,119,228,109,214, 37, + 34, 72, 33,195,144,205,138, 21,156,102,146, 53,208,198, 53,113, 18,162, 21, 77,178,244,217,111,223,194,236,158,174, 15,208,234, +121,113, 3, 48,158,229,243,188, 41,124,118, 29, 97, 56, 79,238, 68,106,104, 7, 40, 82,107, 76,195,210, 13,209, 94,145, 87,155, +124,235,172,106,177,103,189,145,108, 82,139, 39,197, 83,131,116,245,126, 81,149, 64, 1, 1, 4,146,112,125, 58, 79,105,159,224, +207, 65, 8,129,217,173,240,110,202, 58, 55,174,209,152, 97,191,121,199,159, 10, 48, 10,113, 3, 23,180, 59,219,179,215,233,181, +101, 69,225,198,161, 28, 35, 59,191, 68,138, 88,100, 0, 73,152,148,170,254, 27,171,192, 13, 71, 27,117, 23,223, 1, 73,171,142, +217,117, 88, 42,160,103,245,218,255, 59, 90,127, 11,192,218,245,252, 38, 17, 68,225,153,217, 89, 24, 22,136, 16,240,212, 30,236, +201,214,154, 52, 53, 30, 76, 60,120,178, 73,227,127,106,226,213,255, 65,189, 52,106, 82,237,165, 52,254,234,193, 72, 67,128, 89, + 22,102,240,125,111,102, 87, 32, 52,209,196, 61,193,134,100,119,225,189,239,253,250,190,199, 22,124,175,254,194, 57,217, 4,247, + 64,123,135,237,184, 5,207, 69,249,225, 51,149, 41,143, 90, 67,113,178,239,202,254,145, 14,109, 15, 17,147,133, 50,127,240,209, + 30, 9,116,121,218, 14, 8, 67,107, 94,221,205,122,163,197,212, 82, 78, 36, 19,199, 59, 26,209,213, 89,186,136,233, 28,223, 97, + 11,113, 11, 99,108, 87, 49,113,183, 82, 48, 65, 51, 69,184, 72,248,219, 54,119,102, 46,167,240,159,207,115,216,159, 96, 30,239, + 82, 69,139, 68, 84,212,135,187, 7,195,241, 80, 5, 61, 63,207,205,232, 10, 35, 59, 12, 9,137,243,174,223,234,107,173,237,124, + 22, 26,205,130,139, 82, 50,191,247,211,193, 72, 22,153, 50,161,185,239, 89, 77, 71,112,105,180, 38,120,133, 20, 15,226, 60, 84, + 10, 97,117, 26,153,215,195,131,195,231, 39, 39, 31,206,222,218,124, 74,209, 6,179, 86,143,103,255,113,253,243,205,187,179,193, +213,215, 71, 71, 71, 47, 78, 79,123,189,222,151,171,239,195,209, 84,107,209,206,210, 86, 38, 27,117,130,224,252,241,241,241,224, +242,242,215,240,102,239,222,158,243,233,249,231,193,211, 39,207, 94,190,122,189,191,255,160,223,233,126, 60,191,208,184, 30,221, + 90, 32, 89,192,193,160, 25, 75, 37,197,146,180, 38, 26, 70,180,140,106,102,178,109, 18, 10, 45,244,188, 99, 11,122, 2,249,177, + 73,233, 99,130,253, 22, 95,168,165,210, 54,183, 51, 36, 75,130,203,229,114,224,183,190,132,208,175, 80, 0,214,137, 70,248, 97, +154, 26, 41, 9, 87,160,243,127,237, 74,254,199, 35, 21, 41, 85,229,182,152, 56,112,224,208,183, 51,144,182, 46,178,180, 81, 79, + 27, 5,248,206, 91,146,250,174,233,206, 86,180,130,213, 38,153,242,173, 42,145, 52,106, 34,110, 91, 81,144,202,218, 4, 77,222, + 5,239, 44,162,128, 89, 16,196, 19,118, 84,190,176, 2,238,190, 34,164, 9, 30, 54,240,216,109,227,222, 34,117, 32,114,246,162, +140, 16,157, 15,147, 24, 15,214, 83,148,232,203, 42,117,143,232, 94,158, 20, 1,217,229,159,146, 55, 42,152, 96,164,137,136,162, +238,168, 95, 73,194, 11,208,109,165, 8,196,246, 36,168,244,248, 36,123, 46, 82,187, 74,242, 18,217,241,200,244, 57, 6, 4,117, +171,140, 53, 0, 86,105,212,120,245, 8,153,155,194, 91, 21,198,188,187,189, 29, 91,216,176,102,149, 82,186, 57,156,126, 30,123, + 42,192,229, 69,112,249, 0, 1,178,218,107, 3, 22,150,237, 52, 59, 84, 7,144,131,119,178, 78,173,222, 24, 79,110, 8,217,181, +170,221,223, 57,184,248,246,137,105,145, 14,241,130, 37,176, 16,207, 96, 32,230,185,143, 27,103, 33, 45,211,228, 75, 44,171,253, + 3, 27,236,239, 91,231,150, 82,115,192,158,201, 21,137, 89,187,222,170, 68,235,160,168,185,194,111, 41,106,215,138, 88,136, 34, + 87,106,223,141, 18, 47,184, 29,129,187,252, 11, 97,224,214,227,183, 0,156, 93, 77,111,211, 64, 16,245,238,198,235,143,124,148, + 38,148, 34, 84,181, 10, 20,232, 1,129, 56,194,129, 3, 7, 36,110, 72, 92,248,183, 92,144,184, 21, 85, 8, 33,160,173, 20,160, +106, 32,164,169, 19,215,137, 19,219,203,204,236,174,147, 64, 11,136, 28, 44,203,145,214,178,189,158,157,121,243,222,243,159,226, + 59,255, 69, 7,129,182, 65,186,111, 78,134, 95,180,149, 44,128,183, 40, 39,118, 56,205, 99,122,192,184, 21,101,165,104, 85,162, + 44,115, 76,154,205, 77,225,130, 16, 31, 20,110, 18, 25,172,178, 38,131,203,254,234,151,248,136, 78,132, 17, 30, 89,219,218, 18, +130, 50,118, 19, 83,148,102,227, 18, 13,214, 36, 36,218, 95,136,104,185, 4,248,193, 92,152, 76, 39, 48,179, 96, 9,157,102,233, +205,245,237,211,100,200, 75,173, 52,211, 70,119, 69, 63, 30, 32,105,150,116,181, 48,210,230,218, 86,146,158, 9,139,223,192,165, + 38,179,132, 86,114,117,255,250,189, 31, 81, 15, 1, 41, 37,122,197,176, 39, 71,205, 48,108, 84,189,208,171,212, 3,191,185,226, + 54,235,114,181,238, 55,194, 10,228,197,161,143,193, 86,122, 21, 95,186,180,163,164, 40,238,222,185,229, 48,236, 12, 31, 28,116, + 28,238,109, 92,221,236,124,253,166,208,155,198,133,153, 31,141,162,247, 31,222, 29,118,246,183,219, 91, 79,159, 60,222,184,182, +222, 61,238,246, 6,195, 56, 70, 95,176,254,233,100,231,246,206, 73, 52,250,124,116,124,169,177,114,163,221,126,249,234,245,163, +135, 15, 62,238,127,218,221,123,251,226,249,179,221, 55,123,221,238,247, 60,119,170,161,159,166, 25,172, 56,200, 88,163,133, 17, +187, 28, 57, 30, 80, 28, 74, 90, 22, 6,142,112,145, 52, 6,183,208, 21,172, 42, 69, 45,228, 1,172, 34,146,249, 30,148,101,220, +149, 12,146, 7, 40,109,137, 45,156,149,241,189,180, 75, 45,185,139, 48,197, 61,215,203,150,114, 82,252,171, 21, 94,129,248, 56, + 83, 89, 32,130,140,212, 61,252, 98,115,199,255,142,239,210,145, 57,121, 17,177,191,232, 96, 85, 5,129, 90, 87, 17, 36, 74, 45, + 31,172, 77,136,184,117, 62,122,163,133,224, 11, 80,143,161,216,194,229,144,183, 86, 97,223, 70, 70,224,123,161,173, 71, 23, 64, +157,242,213, 45, 10, 43, 14,208,227,228,197,108,185,121,192,184,205,220,155, 97,107, 50, 27, 83,187, 18,137,167,186, 81, 43,156, +115, 24,162,176,173,122, 53,122, 32,132, 21, 18,120, 86,168, 50,149,228,108, 89,146,162,172,114,126, 33,178,219,224,174, 12, 50, + 99, 19,252,185,130, 73,147, 84, 42, 90,198,129,108, 89,193,140,213,140, 48, 34,112,164, 91, 34, 98,163, 45,165, 40,196, 59, 70, +173, 88, 90, 23, 96,246, 6,181, 40, 39,165, 5,142, 64,251,162, 92, 12,224,156,113, 26,235,182, 97,174, 45,192,176,241,163,109, + 9,224, 38,144,154,177, 48,114,117, 8,131,150,162,168,244,119,219,199,211, 4,130, 59,214,156,156, 87,101, 45, 74, 6,173,218, +218,232, 44, 58,137,251,227, 52,161,210,159, 42, 2,139,191, 83,211,206,208, 0,244, 60, 78,103,105,177,156,191, 59,115, 39, 37, +174,173,158, 45, 65,143,145,249,146, 57, 0,195, 16,168,226,148, 33,142,196, 46, 83,173,200,179,146, 99,227,118, 85,204,215, 11, +246, 59, 93,103,185,246,117,156, 5,219,209,127, 87,125, 95,244,251, 41, 0,105,215,210,218, 68, 20,133,239,185,115,103, 38,233, +164,212, 39, 86,171,105, 65, 20, 20, 92, 84, 93, 72,161, 46, 4,221, 21, 87,118,231, 66, 87,138,255, 79,112,105,193,250,162,106, + 16,138, 40, 22, 31,168, 24, 42,109,226, 76,102, 50,147,153,235, 61,231,220,153, 76,165, 86,193, 36,171, 36, 12, 19,114,239,121, +124,223,119,190,251,247,248, 62,254,205,150,240, 1,158, 77,163,126, 13, 2,167, 53, 34,105, 8,193,241, 22,247,112,172, 29, 13, +128, 29,187,146, 4,119,240,136, 62,171,166,136,124,151,214,182,194, 83,110,211,109, 76,184,254,164, 63,249,125,240, 99,148, 15, + 25, 42,203,117, 94,254,179,118,224,128, 98, 62,175, 3, 33, 11, 46, 61, 44,208, 46,237, 75,240,188,116,195,245,230,219,243, 27, +155,239,205,146,234, 69,219,130, 89, 30, 90,187,142,117,126, 87, 84, 97, 59, 84,116, 32,191,111,154, 59, 64,142,151, 85, 99,164, +147,145,192,129,178, 23,245,135, 58,163,154, 6,190, 54,186,173, 64, 29, 48, 29, 96,160,130,134,218, 63,165, 38,154,138,189, 53, + 52,202, 29,228, 40, 67, 22, 34, 73, 81,125,130, 66,233, 28,178, 20, 22, 46, 45, 62, 95,235,156, 57,117,110,237,229,155,163, 71, +102,110,223,188,117,255,193, 74,148,232, 33,193,223, 73,162,227,184,248,242,109,243,241,211,206,139, 87,235,199,166,143, 47, 45, + 93,159,157,153,253,248,185,187,245, 51, 52, 57,230,100,251, 68,171,233,191,125,247,193,116,175, 23,206, 95,124,248,232,201, 92, +123,206,245, 26, 43,171,207, 60,207,191,119,231,238,229,133,197,229, 27,203, 87,175, 92,235,188, 94,223,248,212,141,145,230,214, +131, 97, 17, 14, 70,253, 56, 15,163,172, 23,101,113,172,163,129, 48,137,143,134,189, 11,133,234, 29,129,245,187, 98,249,133, 76, + 83,244,146, 76,135,105,191,159, 48,231,145, 23,192,241,221,244, 37,166, 37,226, 24, 36,172,181, 38,238, 69, 94,120,158,244, 1, + 83, 46,174, 88, 76,138,212,162,142,172,105, 12,236,129,113,239,234, 22, 0,255,224, 97, 96, 26, 36, 95,161,208,180,248,131,140, + 77,218,146,106,159,137,215,229,119, 42, 78,200,238, 43, 71, 40,189,115,248, 80,153,244,231,248,156, 6,156, 26, 92,169, 25,171, +169, 5,119,102,162, 78, 79,159, 13,147,144, 84,201,240,187,214,102,207,190, 69, 11, 22, 46,217,155, 73, 51, 20,155,241, 4, 7, +123, 21,194,142, 11,201, 49,142, 14, 34, 67, 81, 77, 81,145,189, 26, 71,206,164,169, 37, 8, 50,173, 15,214,142, 49,250,210, 63, +193, 14, 34,137, 50,184,107,182,113, 29, 23,239,204,145,178,108,134,252, 93,232, 83, 73,201,134,170, 34,109, 93,148, 36,239, 60, +155,254, 84,181,243,184,132, 39,167, 10, 62,195,129, 16, 27, 50, 17, 64, 85,176,227, 2, 31,236, 96,189, 39,217,254,209, 70,191, +202, 26, 3, 51, 35,105,183,200,226,151,158,185,245,137,173, 8,233,146, 54, 64,199,199, 44,217, 14,183, 76,113,158,225,180,107, + 18, 39,177,185, 6,159, 99, 64, 58, 1, 60,254,192,158,230, 32,138,177,114,151,232, 33, 0,168, 41, 14,109,225,137,120, 4, 5, + 28, 0, 41,106, 57,190,168,207,130,225, 27, 78,101, 9,196, 58,255, 67,193,225, 56,139, 37,195,209, 37,150, 99,122,230,169,224, +224, 32, 13,235, 62, 23,122,183,201, 62,168, 13, 58,253,127,112, 55,143, 95, 2, 48,118, 53,173,109, 3, 65,116,165,213,151,147, + 34, 55,182, 27,210,128, 15,134,166, 61, 4, 10,133,158,147,223,215, 63,210,107,233, 49,135, 66,219, 63,208, 30, 76,211,148,210, +224, 66,177,169, 19,199,150,237, 68,150,118, 53,221,153, 89,201, 50,197, 33, 96, 12,198, 70,200,236,232,205,236,204,123,111,189, +135,211,147,161,230,247, 75,228, 39,147,195,125, 15,100, 65, 27, 64, 73,117,135,137, 6,197,206, 90, 2, 20,234,104, 28,207,224, +176,117,215,180, 81, 91, 89,152,178,139,103,102, 94,220,110, 47, 76, 2, 44, 58, 81,124,153, 39,168, 46,203, 86,180, 45,214,220, +157, 35, 46, 7, 94,214,148,228,190,148,201,237, 12,120,117, 92,230, 92,227,155, 42,216, 90, 64,153,120, 74,139,244,235,239, 47, +100,146,232, 83, 80,150,254, 51,152,174,137, 18, 86, 54,226, 61, 22, 84,155,210, 28, 75, 81,142,120,183, 17,186,189, 39,189,243, +225,133, 64, 33,168,151,235, 28,165,181,142, 28,200,145, 66, 91, 94, 31, 83, 1, 26,233, 65,174,156,176,106,225, 75,108, 92, 38, + 6, 86,149,249,107,206, 82,233, 32, 64, 11, 76,131, 25,113,220,234,247,127, 30, 61, 59,126,113,116,124,246,233,243, 96,240,102, + 50, 95, 54,130,192,220,110, 32,189,176, 17,118,218,143,247, 59,237,110,183,123,120,248,180,213,222,107,198,123,167, 39, 61,147, + 42,222,190,123,159, 44,210, 31,191,254,188,126,245, 50,185,205,210,203, 97,150,102, 7,157, 78,255,252,219,243, 94, 47, 10,131, +179, 15, 31, 13, 36, 92, 77,174,199,227,201, 77, 50,251,123, 61, 93,209,120, 52, 80, 58,244,125,230,251,208,147,140, 94, 61,100, + 73,143,240,229, 16,145,253, 46,195, 93, 43,159,110, 96, 64, 48,203,139, 85,174, 35,179, 37, 19, 92, 69,225, 68,131,116,100,128, +138, 97, 61,173, 71, 8,172,133,165, 34,179,147, 31,231,127,105,117, 97, 7,236, 91, 9,224, 84,252,186,250, 94, 46,101, 28,198, +243, 77,201,107,174, 83,147, 68, 93,177, 33,114,131, 13,161, 16,126,156,175,166,213,227, 84, 89, 42, 26,160,209,100, 64,134,122, + 99,180,144, 91,155, 95, 34, 31, 91,103,114,237,184, 80, 17, 99,172, 91,108,201, 9,182, 77,216,139,209,119,129, 85,188, 91, 19, +211, 66, 13,156, 11,250,214, 51,120, 81,129, 57, 88,147, 58, 91,142,151, 77, 30, 96,176, 11,253, 72,171,156, 79, 11,168,161, 59, +148, 7,136,216, 43,187,246, 14,109,179,145,129,156,142, 49,216,190, 35,114,107,210, 38,214,126,160,132,220,206,117,249, 96, 15, +222, 90,151, 89, 1, 44, 4,163,139, 11, 0,255,128, 11,118,210, 35, 10,155,135,128,166,155,194, 14, 93, 45,184,187,108, 61, 98, + 25, 56,210,243,216,158, 15,235,165,114,146, 73,147, 52,186,166, 20,162,242,196, 64, 76,119, 5,158, 92, 32,205,147,236, 80,151, + 6, 44, 77,110,173,143, 32,217, 6,106,254, 20,150,137,251,173,131,200,223, 25, 92, 13, 22,249,146,184,203,208,220,109,141,103, + 35,238,232,178, 30, 17,149, 75,150,244, 14,101, 0, 99, 11, 0,202,140, 79,105,134, 20,113, 2,118,194, 71,113,163, 57,186, 25, +130,216,176,190,150,200,254,169, 22,151, 44,166,106, 5, 62,114,207,116, 74,254,150,118, 25,118,209, 39,114,154,233,244,110,177, +114, 44,155,100, 43,125,190, 46,215, 40, 30, 12,238,247, 11,157,254, 9, 64,217,181,244, 54, 13, 4, 97,239,218,241, 38,174, 21, + 68,169, 66, 3, 77, 15, 32,213, 82,169,184,112,226,128,128, 3, 87,132, 56,115,225,192, 15,226,136,248, 41, 92, 80, 65, 21, 45, +162, 82, 35,144,250,226, 17, 17,210, 42,208, 40,196, 81,227,247,178, 51,187,107, 59, 77,133,192,151, 28,226,196,113,188,243,216, +111,190,249,230, 31,245,129,249,108, 55,135, 88, 27,192, 62,129,128,140, 15, 12,250,224, 77, 32,192, 32,148,130,253,126,132, 43, +103, 46, 17,119,154, 23,223,200, 20,225, 8,198, 95,132, 32, 18,198, 97, 67, 71,170,194, 75, 46, 47,180, 14,122,123, 41,108,130, + 82, 9,189, 43, 10, 45, 52,217, 79,162,132, 32,156,106, 72, 78,164,174,252,131, 47,247, 22,189,221,222,238,234,242,202, 97,239, + 64, 82, 98,138,178,153, 10, 48,230,245,197,107,221,147, 46,229, 50,157,129,240, 99,106,101, 5,111,201, 59, 26, 28,251,193, 40, + 74,211,253,163, 67,216,150,154, 8,247, 83,195, 38,230, 32, 25,251,110, 76, 35, 38,124,195,169,184,195, 73,202, 64,231, 52, 75, + 24, 69,138, 23,220,188, 99, 91,226,245,217,211, 39, 78,205,125,254,226,101, 40,220,191, 65,231, 47,212,197,251, 39,195,225,230, +230,135, 7,247,238,190,122,189,222,104, 94,185,184,208,120,191,221,190, 84,119,239,223,185,253,248,209,195,213,155,107,253,126, +255,221,198,219,157,118,251,243,215,206,104,236, 79,130, 56,132,129, 70,188, 90,177,122,199, 93,183,118,171, 49,239,174,120, 94, +171,117,181,217,188,188,243,241, 83,231,123,103,206,101,140,210,245,141, 55,113,156,136,165, 26,101,196, 97,149,154,100, 50,160, +145, 85, 69, 58,106,129, 45, 38,224, 13, 9,146, 9,210, 83,241,171, 56, 17, 46, 91, 88,144,200,223,197,201,204, 38,182,105, 56, + 21, 82,175,177, 52,177,190,233, 84, 10,181, 84, 81,131, 79, 25,223,212, 33, 46, 21,198,129,204,227,248,217,230,155, 98, 1, 51, +152,164, 19,208, 34,180,207, 46,208,226,179,231, 58,250, 81, 56,154,245, 84, 36,119, 86,133, 96, 22,207,189, 57, 47,100, 0,140, +178, 67,100,128, 86, 67,167, 25, 22,145, 1,165,177,168, 13,219,118, 96,244,242,146,226, 92,129,162, 8,159, 53, 7,154, 10,191, +177,146,196,117,156, 0,233, 68,249,221, 57, 22, 68, 84,115, 10, 47, 77,116, 50, 51,201,184,209,109,164,180,100,146,164,212,127, + 36, 47,156, 38,161,156,111, 80, 78,222, 37, 64,172,241, 22, 69,243,144, 88, 76, 14,220,136,248, 75,242,187,252,155, 39, 40, 4, +197,168, 84,243, 85,140,100,205,177,161, 90,236, 93, 42,232, 98, 79, 32,205, 65,100,170, 70, 1, 96, 30,175, 90,187, 85, 97,150, + 27, 74,165, 64,177, 36, 13, 85,107,165,184, 99,214,149, 47,138,247,146,130,221, 98, 82,150,201,205, 62, 65, 73, 94,113, 38, 14, +177,129,150,190, 68,246,136, 59,149,234,141,165,181,173, 47, 91,170, 6,152,105, 16,131,203, 88, 10,240,237,143, 95, 93,138,220, +125, 92,176, 48,227,105,224,255, 84,131,192,148,194,112,134, 23,212,141,187, 74, 47,143, 75, 1, 62,174, 88,191,232, 78, 16,250, +141,162,104,152, 13,117,108, 80,131,137,228, 51, 53,207,115,185,154,213, 74,198,129, 63,197, 26, 72, 66,162,158, 18,252,147,217, +148, 5, 20, 38,115,102,143,155,253,103,230, 46,150,116, 90, 26,124, 86, 62,254, 8,192,217,213,173, 54, 17, 68,225,157,157,217, +217, 77,118,179, 73,136, 9,165,181,132,226, 11,120,231, 15, 22,177,106,193, 55, 17, 47,124, 49, 5, 95, 64,173, 16, 36, 84, 5, + 11, 94,137, 94, 20,105,174,180,154,182,110,178,217,217,233, 58,231,204,204,238, 54, 13, 10, 66,110,146, 16,152,221,236,156, 51, +231,124, 63,103,217, 95,140,212,124,230,220, 18,161,183, 32,171, 77,236, 72,238, 64, 30,106,196,218, 26, 3,230,192,149,100,204, +158,146, 13,184, 92,184, 70,254,239,152,252,141, 85,140,171,181, 72, 42,193,115,202, 61,202, 27,140,183,121, 24,251, 13,206,184, +112,196,228,236,104,250,251, 4, 48, 49, 36, 9,238, 94,127,244,101,242, 25, 80, 74,204,187,216, 55,144,129, 31, 98,142,145, 70, + 44,141,122, 54,141, 3,194,113, 91,168, 51,238, 2,197,114, 0,147,226, 57,161, 96,216, 88, 87,171, 57, 5,157, 61,188,165,134, +213, 75,174, 13,182,210, 44, 85,127,230, 52,249,165,109,134,168,230,216,210,218,128,169,194,121,183, 56,242, 25, 87, 25, 60,135, + 73, 57,170,120,113, 3,238,170, 15, 84,237,217, 12,136,199,224,129, 21,194,201, 50,249,228,241,211, 91,219, 59,207,159,189, 88, +100,153,202,117, 91,195,205,205,171, 27,123,163,177, 90,194,238,131,251, 47,247,222,222,187,179,189,190,190,241,122, 52, 86,215, +244,245,240,219,120,127,255,224,195,199,227,239, 63,226,184,213, 31,116, 61, 14, 78, 6,179,121,194,168,140, 90,192,120, 41,100, +254,112,231,238,237, 27, 55,215,250,107,175,222,140,222, 31,124, 74, 51, 49, 75,103,184, 31, 65,239,122,165,227,117, 59,126, 28, +146,168,201, 35, 31, 32, 83,200, 88, 5,184,143,121, 72,128,240, 28,163,149, 5,136, 24, 54, 21,220, 21,145,229, 52, 47, 84, 62, + 24,176, 70, 63, 80,161,157,116, 28,122, 56, 57, 61, 62,155,107, 83,248,115, 45, 54,195,170, 54,244, 67,196, 36,235, 6, 69, 96, +239,163,110,144, 92,237, 41,102,158, 37,237,238,203,221, 0,143, 81,197, 74,173,246,101,235, 91,242,111,198, 58, 89, 98, 34, 46, +253, 46,242, 99, 41, 69, 20,196, 34, 23,122,127, 98, 89,153, 91,207, 28,181,120, 6, 21, 39, 48,124,164, 1,253, 77,207,148,144, +138,127, 2, 43, 22, 40,103,189, 40,219, 94,150, 35,150,108, 96, 77,216, 79, 65, 94, 68, 46,147,213, 47, 84, 24,164, 26, 2,167, +121, 33,231,246,178,104, 93,145, 68,170, 65, 48, 58,184, 83,203, 92,174,232, 49,213,139,252,245,229, 88, 51, 24, 98, 24, 10,218, + 64,198,184,180, 27, 48, 74,143,236,192, 50,151, 90,223, 2,176,158,118,173, 1,171, 49, 25, 44, 91,246,214, 69, 18,219,238,232, + 22, 70,152, 9,238, 4,188, 97,169,198, 84, 93, 52, 81,197,189,213,139,186,113,179,149, 44,146,114,114, 84,165,102,208,148,120, + 71,159, 16,243,159,201, 9, 6, 74, 98,173,123, 45,130, 73,156,202, 56, 22,181, 78,122, 64, 83, 97, 40, 95,240, 96, 32,201, 90, + 14,123,195,233,108,106, 3,185,174, 69,108, 84,181, 54,178,165, 34, 82, 79,241, 83,113, 35, 14,219,153, 16,149, 50,210, 33,171, +186, 27,101, 46,182, 53, 22, 33, 53, 54,177, 44,165, 35,157, 70, 47,205,231,203,179, 16,160, 25, 40,109,207,147,252, 31, 28,101, + 66,229,170,175,254, 8, 64,217,181,172, 70, 17, 68,209,170,126, 78,143,227, 68, 76, 16, 4, 87,113, 31,226,206,224, 31,184,112, +161, 65,240,155, 92,138,127, 97, 4, 23, 17, 21, 84, 36, 11, 31, 8,126,129,138, 9, 24,204,144,153,204,164,223, 83, 15,239,189, + 85,213,221, 51, 14, 1, 7, 50,139, 33, 52,221, 93, 85,247,222, 58,117,207, 57, 23,213,239, 77,231,114, 18,245,145, 87,134, 61, + 51,230,249,208,227, 77,115, 34,145,115,213, 11,122, 53,202,239,203, 0, 89,151, 33, 51,157, 76, 92,197,154, 75,110, 29,222, 72, + 69,178, 49, 42,211,228,246,226,251,238,252, 30,198,224, 92,136,161, 98,107, 8, 74,134,116,124,226,247,226,254,172,156, 65,141, +249,230,219, 43,233, 90,221, 77,110,195, 1, 32,112, 77, 49,203,119,160,128,133,105,101,146,157,194, 13, 86, 53,178, 58, 77, 87, +107,224,135, 15,239,220,127,118,176,103, 33, 87,207, 28,251,208,137, 19, 77, 71,248,175,195,209, 33, 26,101, 32,123,195,110,177, +209,179,142,241, 28,198,131,211,161,177,230,199,114,170, 98, 6,181,112,156, 4, 48,115, 37,197, 74, 20,214,241, 45,145, 23, 81, +157, 4, 19, 90,145,177, 39, 79, 31, 95,189,178,145,102,147, 48, 66, 66,199,245,107,235,211,179, 9,196,154,237,173,173,159,191, +142,178, 34,125,190,255,242,193,189,187,131,126, 2,143, 85,207,229,209,239,209,159,227,147, 15, 31, 63,173,175, 93,190,185,121, + 99,103,231,246,238,238,163,116, 58,125,247,254,245,219,131,207, 66,212,121,149,239,189,216,159,204, 82, 40,237,171,106, 78,238, + 39,136,236, 51, 15, 95, 59,188,177, 52, 83,129,167, 32, 31, 69, 33,209,202, 20,196, 83,200,183, 80, 98, 35,249, 3, 13, 82, 52, +139,173, 64,179, 55, 12,131, 62, 44, 66,205,242,168,136, 20, 75,197,252,199,201, 56, 19,226,172, 40,185,140, 75,145, 97, 28, 20, +102,191,108,202, 30,252,147, 11,196, 85, 58, 96, 68,160, 39,234, 34,224,255,180,186, 55,192,165,174, 85,217, 13,139, 75,242,217, +250,194,126,246, 85, 27,210, 46,189,154, 67, 40, 47,170,204, 28,231, 54, 84, 35,163, 98,230,116,158, 73, 56,136,241, 36,134,152, +146,114, 10, 33,206,165,164, 53,222,133, 65, 28, 68,195, 20, 81, 29, 75,118,240, 22, 66,115, 91,113, 47,236, 81,232,235, 82,152, +148, 4,173,192,133, 39,249,184,221,198,183,101,154,215,141, 8,116, 45,204, 38,219,155,183,190,126,255,226, 83, 45, 75,145, 75, +117,120, 3, 6,201,128,104,184, 49, 78, 71, 62,250,122, 17,114,175,157, 39,164,137, 59,164, 10,176,122, 1,163, 76,174,123, 56, + 87, 56, 58,188, 88, 59,146,170, 11,214,214,173,213, 98, 52,126, 87, 56, 80, 91,163, 3, 3,112,120,172,117, 32, 52, 93, 45,134, +202, 78,123, 98,109,204,147,205, 90,243,141, 97,147, 89,116,237,160, 65, 5, 35, 24,109,217, 9,104,197,192,140,231,184,202,116, + 75,224,165, 36, 65,165,144,121,171,121,142,181,154,100,141, 18,164, 70,178,174, 34, 92,209, 52,123,106, 79,114,122,203,164,218, +163,116,227,207,108,114, 24,252, 16, 7,232, 42, 51, 8,250,165,168,132,172,181, 53,225, 52,114, 59,176,200, 97, 25, 41,115,200, + 74,236, 67,236,121,131,220, 67, 85, 37,111, 32, 30, 7, 66, 40, 7, 75,180, 41, 27,110,123, 0, 83,171, 60,231,220,229, 33, 55, +249,233, 46,212,180, 56,213, 86,123, 21,231, 94, 64,242,124, 43, 69,150,150, 36,104,254,203,165,114,233,243, 87, 0,198,174,239, + 53,106, 32, 8, 95, 54,217,187, 36, 71, 91,104, 45,130, 62, 88, 20, 5,159, 44,130,254,207,165,226,115,241,221, 55, 17, 20, 31, +172, 15,197,223, 40,229,234,213,222, 37,217,219,100,215,249,102,118,115,169, 74,245,249, 2,201,205,238,206,206,124, 51,243,125, +255,198,103,232, 83, 76,219,176, 64, 5,228,124,100,110,190, 69, 37, 10,136,225,220,254,184, 81,220,164,120,177,234, 86,138,243, +121,242, 26,152, 98,245,194,171, 64,215, 53,140,195,172,249, 50,127, 33,252, 20, 49,145,243,210,172,146,177,230, 53, 2,129,133, +173, 24,116,177, 91,249,246,121, 51, 79, 97,224, 78, 99, 91,251, 72,213,130,131,218, 32,144,244,220, 66,235,184, 9, 62, 96,145, +161,224, 26,121,146,104, 89,218,214, 60,121,254, 20, 56, 27,239, 27,174, 80,225,177, 66, 79, 76,107,240,238, 88,235,165,101, 3, +223, 58, 12,218,109,151, 91, 58,155,124,156,125,226,211,131,206,176, 51,189,184, 54,206,203, 92, 79,115,157,101,224, 98,164,196, + 64,103, 35,173,189,212,167,132,247, 15,193,174,210, 47, 95, 31,183,246,216,116, 73, 66,206,216,154,233,230,238,251,207,167, 99, +157, 63,218,127,120,112,120,200,179, 89,238,238,222,222,245,157,141,182,179,116, 2, 44,231,133, 20,105,223,187,127,231,241,131, +253,205,178,120,118,116,244,246,221,201,215,111, 95,150,117,173, 88,167,230,197,171, 55,214,182, 89,154, 22, 19, 13,149, 84,139, +185, 15, 50, 69, 69, 87, 41,143,203, 81,208, 84,228,240, 18,100,147,201, 4, 97,154, 83, 14,236,193, 35,128, 75,211,146, 98,250, +164,107, 64,109, 54, 91,154,239,103,243,165,181, 23,149,107,232,218,241, 38,232,159,193, 85, 87, 65, 87,129,129, 99, 72, 97, 96, + 78, 24,230,173,105,105, 6,245, 70, 57, 57,210,183,174,254,216,115,229,120, 99,177,250,201, 93, 7, 73, 18, 69,112,134,147,250, + 67, 29, 15, 57,180, 41,230, 56, 92, 31,224, 39,140,165,176,108,147,191, 98, 75,135, 43, 25,162,109, 25,251,214, 88, 96,228, 11, +222,249,214,216, 38, 28, 64, 68,145,122, 69,137, 93, 68, 96,124,156,165, 92, 11,211,121,119,193, 56, 76, 15, 1,145, 95,104,161, + 94,238, 3,141, 76,146, 12,133,221, 35,144,129, 11,172,178, 53,183, 69,102,157,239,123, 49,130, 52,249,173,221,219, 31, 78, 79, +146,129, 71, 8, 92, 25, 56,241,206,152, 70,245,125,196,100,210,203, 28,174,189,221,114, 93, 80, 56,153,102,193,253, 70,207,174, +152,201,229,111,243, 1, 67, 85, 61,121,153,228, 73, 42, 18,135,249, 72,249, 40, 18, 59,145,124, 70, 5,230, 13, 78,179, 25,162, + 22,218, 63, 57,177,126, 56, 60, 37, 23, 84,188, 12, 36, 11,145, 0, 86,245,179, 78,162,170, 28,134,162, 2, 6,173, 82, 95,175, + 42, 90,108,152, 11, 28,166, 64,102,100,126, 61,101, 23, 79,209, 5, 61, 15,204,150, 17, 29,128, 49, 64, 82, 85,252,155, 78, 36, +250,160, 49,230,126,203,225, 98,225, 84,166,100, 21,146,252,249, 98,198, 77,253,163,122, 85,143, 6, 75, 25,248,223,241, 52,111, +114, 23, 35,117,168,117, 50, 23, 9, 23, 31,248,103,137, 44,217,104,151, 26, 92,227, 11,161,166,224,214, 29,131,201, 58, 83,237, +211,205, 12,142, 27, 83,228,194,108,200, 77, 56,118, 24,220,244, 42,128,233,149, 46,254,255,101,141,127, 9, 64,216, 21, 43, 55, + 17, 3, 81,105, 37,221,217, 23, 76,108, 39, 36, 41, 66, 5, 13, 52, 20, 52, 20,252, 2, 29,159, 74,197, 31, 48, 20, 80, 48, 24, +147, 2, 8, 76, 10, 27, 59, 25,231,236, 59,203,210, 29,218, 93,221,141, 29, 72, 40, 51,158,156,207, 35,105,181,251,246,237,123, +250, 54,164, 78,242,116,115,251,162, 4,105,114,120,149, 92, 86, 82,184,182,194, 78,215,147,211,238, 41,154, 31,185,202, 34, 45, + 31,112,164,166,130,117,136,245, 36,165, 66,109, 80,172,190,226, 14,224, 33, 82,204,223,177,159,174,133, 78, 65,119, 49,155,132, + 69, 72, 84,221, 50,108, 6, 20,222,163, 49, 87,106,183,240,253, 94, 19, 85, 88, 33, 33,143,169,190, 17, 70,139,167,140,226, 17, + 55,125,162,249, 46,111,196,253,108, 96,148, 94,218,156,100,206,144,105, 31, 30,156,128, 62,238, 31, 93,229,151,143, 79, 30,125, +189, 24, 27,208, 79, 31, 62, 25,157,143, 80,176,223,152, 80,169, 76,175,103, 81, 52,146,146,154,239,229, 68, 62,240, 67,147, 38, + 90, 68,151, 26,192,134,100,120,230,218,162,162, 69,162,132,147,149,219, 8, 84, 29, 64,245, 46, 69,179, 25, 97,197,109,102,224, +104, 56, 56, 59, 27,191,120,254,236,224,240,222,201,113,246,250,213, 75,239,224,203,248,147,117, 46, 23, 20,144,233,210, 41,243, +213,155,119,239,223,126,252, 16,202,128,197,117,105, 11,223,239,118,122, 89,218,235,136,193,158, 70,243,238, 74,135,219, 12, 49, +116,148, 95, 3, 27, 2,143,171, 20,173,140, 65,249, 73, 92,130, 13,142,215,214, 93, 13,247, 59, 38,211, 10,175, 48, 15,222,169, +139,201, 98, 81,186,217,178, 44,200,161, 24,107, 43,194, 3,105, 83, 86,108,235, 81, 97, 69,144,176,139, 49, 94,117,178, 61, 10, + 66,238, 66, 31,183,136, 28,197, 56,105,133, 79, 43,191, 17,117,218, 40, 68,111, 11, 27, 32,108, 13,216,141,191, 97,207,205, 51, + 35,174, 41,243,194,159,133, 95,253,253, 61,209,106,135,206, 27, 27,197,132,133, 88,217, 60,188,112,102,122, 43,242,231,107, 69, +154,182,217,199, 97,123,144,227,184,160, 1, 11,191,251,220,176,130, 41,161, 79,156,164,214,161,236,115,222,209, 8,171,118, 8, +239,240,172, 5, 30,203,110,210, 57,232, 29,254,156,157, 15,247,134,243,229,156,168,162, 6, 35,146, 36, 24, 31, 53,138,160, 13, +166, 76,252,250, 49,253, 6, 91, 74,241,173, 16, 36,165, 39,114,244,235, 51,240,124,119, 93,253, 91,184, 77,202,121,254, 27,162, +119, 49,243, 94,234, 72, 98,145,172,195, 0,255,149,108, 35, 54,187, 9,233, 14,101,205,248, 27, 21, 52,231, 8,155,153, 44,211, + 45, 91, 42, 26,119,215, 4,217, 61, 10,242,128,137, 38,103, 60, 52, 46,233, 35, 22,126, 21,141,102,164,220, 22,162,137, 3,131, +154,224,120,205,148,121,217, 2, 23,225,159, 19, 79,243, 70,204,225, 9,199,124, 63,237, 95, 22,243, 72, 91,147,216,181, 70,112, +144,162, 48, 52, 14,168,209,250,174,201,142, 21,241,183,253, 13,161, 22,174,205,106,202,239, 9, 74, 45, 55,101,212, 35,167,160, +162,200,114, 27, 97, 58,142, 30, 21,130, 16,160,146,124,189,136, 65, 31, 23, 53,100, 60,177, 75, 31,206, 9,130,147,110,131, 19, +164, 82,236, 98,140, 24,211,249,125, 10, 91,110, 35,112, 17,218,111,201,229, 81,235, 38,188, 28, 34,185,212,251,145,109, 93,213, +124, 42, 90,219,222,187, 67,188, 1,195,179, 20,119, 91, 19,255, 17,128,175, 43,233,109, 26,136,194,158,113,236,113,156, 61,169, +148, 86, 21,112,229,196, 9,137, 67,111,252, 19, 46,252, 88, 36,174, 8, 84,168,144, 40, 32,150, 80,106, 39,113,237,204,100,152, +239,189,241,146, 64,145,162, 28, 34, 43,150,229,153, 55,111,249, 22,244,223, 45,157,204,157,137, 80, 35,159,211,236, 13, 41, 58, +154, 58,117,167,146, 97,228,161,182, 46,189,169, 22,201,156,243, 96,226, 18,193,119,155, 27,120,124, 62,240,234,224,148, 29, 54, +206,152,197, 66,233, 93,201, 56,142, 84, 26,165,131, 40,149, 20,123,191,108, 62,223,153,194,237,216,172,200, 52, 75,131, 6,181, +111, 75, 96, 7,201,192, 69, 48, 91, 43,219,121, 60, 61,165, 13, 76,133, 13,216,164,186,182,133, 68,107,216, 64,126,136, 71,249, +211,116, 18,194,108, 67,184, 87,187, 45, 54, 22,223, 91, 11,113, 33,113,227, 78,120, 52,232,237,233,236, 76,131, 4,107,152,194, +205,247,114,143,147,135, 27,237, 98,162, 9,225, 70, 93, 6,198, 4,132,140, 1,186,188, 42,145,227,186,104, 30,199,112, 39, 81, + 42,140, 84,160, 98, 9,197,130, 68,186, 0,253,236,233,147, 55,239,222, 62, 60, 63, 95, 46, 79, 39,163,233,124,126, 50,159,192, +100,242,242,234, 35,152,119,152, 73,131,202,133,133,190, 23,217, 26,182,194,131, 52,142,250, 73,166,205,143,245,246,250,102,179, +202,203,117,181,211, 37,114, 29, 73,162,235,176,162, 37,243, 42,100, 88, 46, 60, 9,209, 15,228, 80,138, 89,164,150,113,218,219, +201, 60,179,249,109,244,254,251,237,229,215,226,195,234,247,175,109,149,163,232,224, 6, 27, 19,131, 45, 33,106,246,204,239,195, + 40,219, 4,112, 70, 5,156,204,149, 38,137, 59,231, 52,188,194,189,140,234,255, 43, 69,188, 29, 53,222, 25,205,131,163, 23,207, + 95,190,190,122, 53, 12, 71,218, 86, 93,132,128,173,195,205,209,153, 48, 84, 99, 98, 21,121,145,178, 72, 68,214,143,232,197, 33, +105,214,170,176, 15,220, 11, 76, 31,221, 43,138,132,119, 60,199, 77,117,163,246, 69,165, 84,163,141,193,202, 34, 36,136, 68,142, +205,255, 48,220,145,110,135,107,178, 99, 68,224,115,177, 39,236, 17,234,209,142,147,105,177, 91,179, 85,174,203,234,250,113,234, +150,249,207,252, 27,129, 26,239,120,111,224, 98,223, 57, 23,212, 93,177,182,174,209, 31,204, 30,185,154, 93, 30,144, 72,133,109, + 57,175, 45,252,188, 46, 50, 90,250,119,235, 83,223,132, 93,239,188, 1, 20,233,168, 63,114, 11,194, 11, 52,222, 35,118,211, 0, + 36, 67,154, 83,169, 94,100,246,154, 60,120,137,213,207,144, 47, 84,126, 88,251, 49,123, 32, 83, 44,238,145,129, 12,109, 82,201, +146, 30, 52,173, 10,188,232, 0,174, 65,220,151,172,245, 20,120,211, 38,234,179,147,239,135,183,156, 9, 9, 34, 73,150,124, 44, + 4, 37, 67, 30,110,249,214, 31,239,110, 79, 35, 21, 39,147,121, 86,228, 52,142, 32, 40,170,151,108,195, 67,212, 2,114,123,223, +122,163, 50,128, 16, 45, 24,145,153, 67, 89, 36,119,223,197,112,177, 41,215,238, 95, 46, 30, 95,124, 90, 93,147,128, 49, 23, 95, +251,134,152, 26,122, 6, 39,126,134,212,147,169, 82,149, 98, 76,221,224,116, 36, 15, 2,144, 86,142,146,169,139,254,181, 49,113, +199,220, 51, 16,203,201,217,182, 92,183, 58, 62, 7,211,204, 86, 55,168, 73, 53, 88, 12,238,136,247, 36,142,205,255,196,223, 76, +145,238, 39,145,177,233,152, 86,222, 55,181,250, 35, 0, 95, 87,182,219, 54, 12, 4, 69,145, 18, 69, 95,177,141, 32,125,104,130, +162,255,255, 41,237, 39, 20,104,129, 62, 4, 9, 98, 1,137,101, 73,214, 65,118,119, 86, 18,164, 38,237,179, 97, 90,162,121,204, +206,238,206,176,191, 7,205,216, 62, 59, 82, 88,138, 61, 19,207, 83, 99,179,230,148, 41, 11, 33,157, 14, 10, 56, 93,177,217, 92, +128,254,140,201,238,215,247, 80,236,106, 89, 75, 63,224,236, 81,220, 33, 3, 27,142, 0, 50, 33,130,180, 22,214, 90,172,173,134, + 32,174,182,187,108,187,207,118,142,205,203,253,247,231,111,125,212, 53,140,125, 91,238, 67, 1,155, 9, 38,184,159, 66, 11, 57, +184, 39, 43, 2, 8,101, 32,117, 19,140, 8, 27,209,232,201,224, 86, 13, 93, 30,228,118,232, 22,161, 65,232,211,131,187,169,155, +146,211, 62, 20,174,199, 41, 36, 70, 53,175,123, 20, 54,105, 62, 99, 3,200,101,110,106,238,209, 64, 77,127,241,105,251, 92,175, +155, 88, 37,206,152,186, 11, 54,161,175, 4, 32,104,230, 73, 36,209,144, 89, 2,134, 62,209,200, 94,113,123, 46,107, 31,209, 52, + 60,124,190,123,124,202,233, 26,168, 59, 47, 25, 27,130,200, 70, 27,231,108, 94,122,130,252, 53,142,210, 43,171,127,169,215,170, +161, 57,117, 54,181,214, 88, 10, 95,141,127, 43,219,186,106, 8,182,115,173,162, 86,142, 85, 81,252, 6, 90,243,206,199,187,196, +126,217,178,247,252, 91, 27, 74,223,159,170,230, 92,113, 8, 49, 57,168,198,112, 49, 76,149,187,116,197, 32,229,227,105,166, 92, +213,149, 30,174, 7,108, 52,200, 98,196, 17, 12, 16, 34,246,160,132, 28, 49,180,246, 2,176,142, 28, 58,220,237,180,181, 55,151, +230,188, 60,160, 3,243,194, 20, 77,251,193,137,180,141,122,205, 72,220,167, 51, 25, 34, 89, 80, 70,219,150,238,239,145,155,153, + 86,215,195,241,235,239,252,215, 56,160,119,201,166,110, 47,255,170,157,247, 31,129, 26,194, 10,173,191, 70,163,159,226, 42, 93, +211,171,214, 93, 41,151, 52, 5, 78, 4,129, 49, 35,239,171,120,130, 40, 4,132,209, 73,152,245,129,125, 19, 79,246,179,209,224, + 18, 64,111,141,186,123, 91, 94, 47, 75,193,175,193,237, 75, 30, 44,101, 91, 40,223, 14,172,206, 44,135, 55, 62, 54, 86,218,226, +247,233, 50,119,169, 43,170,215,169, 50,114,190,239,100,181,131,217, 12,163, 61,189, 66,231,210,194, 46,254,111,151,238,105,219, +142,213, 57,130,174, 53,146,169,210, 15,168,244,140, 72, 17, 84, 4,249,121, 48,230,210,100,142, 82, 98, 20,128, 72,197, 25, 28, +168,135,172,196, 96,147, 16,208, 69,194, 39,184,156,227,216,113, 74,165,124, 89, 72,207,170,184,199,199,131,134, 48, 87, 46,249, +187,253, 39, 99,244,143,167,159, 96, 53,187,134, 81, 6, 43,130,116,190, 63,236,142, 47, 69, 94, 55,215, 46,136,181, 54, 67,143, +126,106, 97, 7, 89,207,172,186, 80, 51,113,152, 43, 55, 4,206,138,233,149,221,228,151,211,113,125, 75,241, 92, 81, 21,244, 54, + 20,186,209,141, 72, 79,145,159, 95, 88, 75,158,221, 44, 13, 69,108, 35,196,230,177,232, 44, 98, 2, 7,164,149, 84,143,209, 26, + 62,172, 14,172, 90,168, 88, 82, 91, 2, 40, 63,203, 77,210,179,152,119,127,241,188, 6, 38, 68, 11, 68, 51,114,247, 18, 22, 12, +247, 77,180,212, 22,149,212, 65, 12,190, 81,205,188, 68, 62, 28,255,255,221, 22,127, 4,224,235, 90,118,155, 6,162,232,120,108, +143, 29, 2,173, 68, 0,129,210, 5,240, 35,252, 4, 59,190,176, 43,126,130,127, 64, 98, 9,237,162,165,162, 44,226,216,181,103, + 60,220,115,238, 56,177, 83, 84, 41,202,194, 74,236,100,124,125,231,190,206, 57,201,191,207, 74,118,118,105, 43, 89,182, 52,181, + 67,135,152,133, 10, 88, 5,153,195,225, 87, 11, 83,188, 91,109, 93, 86,128,192, 33, 42,224, 88, 43,185,164, 55,129,215,148, 44, + 24, 27,184,108,145,224,130,207,235,149,117,149, 67,240, 14, 6,231,162,186,235,110,126,220,127, 23,227,104,129, 73,241, 28, 14, + 76, 61,112,121, 95, 87, 47,218,135,134, 32,101,182,240,117, 24, 32,225, 81, 45,169, 64, 24, 82, 51,189, 3, 79,151, 45, 64, 4, +246,230,227,213,237, 47,151,103,219,151, 23,127,155,123,121,176,196, 4, 47, 54,219,117,189,186,190,187,130,127,167,197,203,239, +251,242,233,243,229,183,175,137, 24, 1, 54, 39,238, 20,179, 86, 35,139, 52, 99,217,223,190,190,217, 53,185, 36, 3, 83,221,209, + 40,179,165,246,238,224, 52, 11,104,109, 24,168,241, 33,185,117, 37, 80,182, 0, 1,217, 18,208, 8, 6, 17,114,185,117,141,245, +114,165,245,222,254,222,247,146,137,238, 7,223,116,195,174,237,129, 56, 53,161,100,117,133, 18,194,176,220,182,235,201, 48,131, + 92,161,235,199,188, 42,153,200,203,195, 48,200,110, 81,120,115,142,122,190,123,123,126,230,184,183,216,177,104, 67, 3,138, 78, +142,134,177,139, 15,145, 3, 98,181,197, 28,171, 46, 52,129,168, 71,111, 84,188,216, 48,152, 39,155, 7,238,150,198, 86,145, 3, + 87, 9, 19, 31,146,151, 8,102, 33, 66,148, 6,193,159,215,103,178, 30, 18, 49,201, 54,191, 31,154, 41,146, 8, 39,168,188, 67, +105,229, 32,124,152, 27,231,205,192,129,116,207,227,137,241, 92,238,221, 67,104,151,184,190,255,103,160, 51,178,163, 92,207, 64, + 68, 73, 45, 78,166,133,154,160,254,133,120,140, 88, 78, 69,114, 18,181,245, 97, 64,126,254, 97,155,217,197,229,226,177,121,240, +212,176,131,138,254, 80,178,247, 68, 75, 73,123,116,174, 40,197,139,101, 83, 26, 65, 69,209,156,128,158,248,136, 39,114, 18,199, + 72, 81,124,220, 60,123,181,235,154, 49, 38,229,144, 5,243,217,210,173, 79,197,126,173,178, 51, 46,139, 49, 9, 96, 82,104, 35, + 55, 90, 25, 55,140,175, 83, 27, 20,193, 56,208,231,234,177,145, 13,155, 84,126, 87,242, 9,101,200,102, 35, 52, 45,149, 50, 56, +114,160, 46,242, 12, 96,201,131, 91, 71, 57,148, 55, 20,248,166,153,226,118, 70, 33, 29,188, 50,142,235,146,185, 90, 12,192,211, + 10, 37, 58,148,147,117,190, 27, 70, 15,173, 2,162,148,201, 20,198,194, 34,180,108,240, 93,206, 50, 46,217, 74,181,182,192,178, +106, 32, 12,210,149, 78,174,190,235,247, 58,139, 1, 15,141,167,193, 91, 32, 90,122, 9, 46, 65, 58,141,169,202,192, 30,236,168, +251,183, 28,105,250, 86, 3,236,145,242,173, 18,108,106,135, 35, 83,132,219,164,229, 52,179,192, 71, 35, 2,169, 54,163, 41, 99, + 22,151, 73,107,156,209,238,197, 35,108, 98,222,110, 49, 85, 89,181,132, 19,198, 83,239,159,252,251,251,205,135,235, 63, 63,195, +147, 52,245,255, 4, 32,236,218,118,156,134,129,168, 93,219,113,210, 84,105, 65,148, 21, 32,132,120, 66,226,255,127,132,229, 5, + 1,143, 72,187, 11,165,187,109,210,184,185, 56,222,153,177,147, 52, 45, 21,234, 75,164, 38, 77,218,142,199,115, 57,115,206, 68, +159,143, 95, 8,122,121,174, 57, 57, 21, 46, 9, 82, 44, 44, 76, 33,147,164, 42, 6,242,126,212,237, 38,126,189, 84,171,188, 46, +141,109, 4, 58,116, 52, 8, 47,251, 0,158,107,230,200,172, 28,237,240, 74, 67,164,163,101,146, 70,105, 42, 99,193,186, 47,219, + 91,211,228, 89,186,220, 28, 54,141,173,176,235,136, 50, 54,180,119, 14,226, 52,124, 28,170,158,133,142,208,168,237,139,185,161, + 35,203,242,133, 32,206, 99, 17, 33,150, 17,108, 14, 94, 84,193, 15,193, 5,242,233,114,141, 65, 60,149,113,218,110,145,204, 15, + 85, 9,239,146, 88,187, 35,213,158,118, 53,127,185, 45, 31, 33,147, 0, 39,221, 68,197,189,218, 31, 49, 55, 33,137, 15,106,241, + 51,231, 7,229, 2, 47, 38,101,181, 82,107, 30,107,220,123,144,151,177, 67,202,117,248,158, 17, 74,136, 67,140,207, 22, 26,219, + 55, 77,197,247, 7,145, 99,209, 7,119, 18,112,167,166,106, 42,219, 86,214,206,181, 72, 53,210,123, 64, 10, 3,102, 94, 26,212, + 23,131,203,225,153, 76, 3,155, 5,166, 14, 45, 18, 38,123, 10,108,200, 33,106, 83, 85, 69,142,108, 59,169,210,112,237, 74, 39, + 75, 72,141,112,220,140, 43,167,141, 45,168, 14,131,176, 35,238, 36,100, 17,222,125,123, 34, 55,193,164,233,140,103,109,198, 40, +221,218, 84,103,101, 93,192,199,250,232,221,121,124,195,196, 85, 5,217,201, 68, 37, 68,161, 30,236, 94,132,102,233,100,190,218, + 93,193,242, 82,224,175,124,154,201, 78,120, 81, 66, 96,196, 66, 83,139,247,170,138,184,252,184,170, 93,197, 70,152, 55, 62,131, +196,219,170, 36,138,243,106,127, 70, 51,121, 77,245,180,199,180,204,216,136, 1,193, 6,251,205,242,237,195,238, 46,139, 87, 16, + 13,124,191,251,118,138, 69,246,244,114, 74,234,166, 61,178,161,140,114,178, 50,248,191,240,203,231,164, 52, 66, 17,240,180, 25, + 10,179,190,141,116,237, 39,162,246,231,196,191, 99,126,233, 72,111,178,247,239,228,125,103, 68,185,218,183,151,123,185, 15, 42, +160,184,208,216, 68, 5, 18,170,168, 82,225, 20,195, 49, 8, 68,136,127, 81,114, 60,166, 96, 91, 80, 58, 27,100, 46, 60, 42, 82, +132,154,182,176, 1,202,138,200, 21, 48,228,186, 61, 6, 88, 98,215,203,245, 49, 10,222,135, 5,200, 4, 9,232, 5,136,100, 24, +134,101,193,215,193,218,241,124,212, 20,155, 99, 6,217, 82,240,222,208,202,195,131,206,189, 95,127,248,121,255, 3,110, 71, 89, +239, 12,178, 92,108, 37,163, 17,227,206, 32, 72,155,169, 39, 24, 68, 51, 93,196, 41,248,116,184,221,195,238, 15, 71,228,171, 93, +167,107,211, 29,119,229,211, 98,158,217,186,134, 39,205,205,254, 85,182,222, 20,191, 63,189,249,252,245,215,173, 71,114, 83,162, +218,190,123,241,241,209,252,245,163,248,219,242,169, 39, 99,119, 93,144,246, 30, 81,247,103, 35, 72,124,240,192,189, 25,192,249, +144, 67, 72, 25, 97, 76,201, 7,174,234, 75,120,240,248,215,159, 72,107,249, 17, 8, 54,104,106,187, 11,133,247,255, 98,228,253, +105,207, 2,240,117,117,189, 77, 3, 65,208, 62,251,226, 56, 73, 77,138, 68,137,224,161,240,142,148,255,255, 35, 10,127, 0, 33, +132, 64, 85, 3,253,160,197,181,207, 62,223,177,179,123,151, 56, 38, 66,170,242,210, 40,142,157,189,189,217,189,157,153, 73,126, + 79,255,169,245,210,201, 4, 91,104,137, 70, 51,107,197,160,148,247,103, 30,121,100,244, 92,229,103,155, 98, 67,121,167,177,232, +248, 50,133,117, 64, 28,225,193, 81, 34,167, 0,160, 36, 76,161, 80, 20, 26,174,209, 26,141, 26,245,237,233,243,205,243, 13, 24, + 30, 9,100,223,144,193, 68,255,223, 11,177, 88, 98, 46,138,169,114, 11, 69, 92, 3, 16, 74, 62,216,248,210,247, 2, 1, 58,199, +212,162,228,113,184,153, 42,181, 42, 87,111,170,215, 63,238,175,105, 23,218, 94,110,239, 30,111,239,255,220,162, 4,145, 66, 20, +135, 79,193,212,145,169, 64,160,120,118, 20,110,138, 50,221,170,238,107,225,226,162,160,202, 93, 91,213,143, 51,131,251, 6,101, + 58,149,102, 20,197, 39, 45, 10,185, 89,174, 55, 29,251,118,176,137, 7, 4,204, 50, 73, 79, 3,187,151, 18, 38,200,148, 43,139, +130, 86, 94, 11,117,140, 97, 6, 21, 30, 36,214,206,119,173,117,116,155,218,235,118, 72, 97, 33,233, 19, 99, 59, 99, 44,125, 68, +145, 35, 26, 29,123,199,247, 61,193, 28, 79,123, 20, 61,174,190,235, 8,178,116, 22,127, 77, 99,127, 55,125,109, 48,124,166,149, +175,178, 66, 89, 61, 75,211,245, 28,104, 70, 74, 19,203,234,224,220,148, 97, 73, 50, 39,170, 31,232,221,192,107, 27, 29, 53,170, +160,185,138, 21, 15, 74, 31,188, 40, 93, 36,254, 85,243,170, 54,245, 30, 59,164, 83,202,245,112,108, 67,124, 26,226, 10,252, 91, +134,129,197,241,230,225,153,249,237,215,139,243,119, 23,239, 63,126,189,162,159,254, 98,249,234,103,189, 43,245,146, 65, 77,200, + 52,180, 61, 16, 62,168,249, 76, 53,202,146,254, 95,176,111, 58,122, 48,150,241,226, 35,250,253, 65,212, 1,191,135, 3, 91, 30, +208,206,243,156,130, 19, 7, 53,137,167, 75,183,246,121, 89,188,160,231, 61, 62, 25, 29, 41, 3,251,100,106,213, 45,163,236,184, +202, 75, 30,121, 76,247,107,122,250, 13, 85, 80, 91, 10,154,126,234,224,127,234,133,195, 16, 61, 52,194, 93,248,104,253,203,254, +122, 50,175,238, 89, 37, 64, 44, 28,178, 76,179, 43, 49, 48,117, 14,249, 32,122, 5,238,201,104,215,201, 5,151, 48,123, 21, 67, +146, 37,222, 43,246, 56, 42,137, 21, 0,173, 21,195, 62,166,216,244, 7,110,134, 67,145,131,155,232, 88, 31, 89,198,147, 2,114, +154,138,207,227,165,153,237, 89, 78,113,146, 92, 82,166,101, 98, 5,215,109, 2,207,157, 52,103, 44, 20,191, 6,244,102,113,190, + 9, 73, 72,186, 28, 1,156, 15,151,219, 79, 95,174,184, 42, 18, 5, 3,191, 89,191,189,190,251, 46,228,128, 24,129, 40, 71,165, +226,168,202,245,147,169,187,161, 21, 2, 19,219,170, 58,173, 11,194,112,220,106, 4,135,187,135, 45,165, 56, 84, 98,205,210, 83, + 59,155, 87, 4, 20,118, 15, 59,194, 99,117,223, 38, 97,194, 59, 98,156,163,223,215,141,155,132, 11,189, 48,131, 25, 14, 97, 32, +203, 5,131,156,129, 44, 60, 6, 58,254,152,112, 38,221,207, 80,215,186, 36,114, 53,228,223, 85,121,254,208,252,146,238, 95,122, +154, 93,117,162, 99, 35,111,250, 43, 0, 97,215,178,219, 68, 16, 4,103,102,223,118,214,198,113,156, 40,201, 45, 39, 46,136,136, + 3, 7,190,158, 3,127,128, 32, 55, 16, 8,132,130,140,157,248,181, 30,239, 99,232,234, 30,239, 90,216, 18, 81, 14, 81,162,181, +156,241, 76, 79,245,163,170,186,248,174, 79,202, 88,239, 65, 73,112,176, 65,181,119, 70,195, 15, 33,179, 21,196,100, 29,140, 6, +199,227,134,134,130, 74,116,155,221,102, 97, 90,122, 17, 56,105,198,154,189, 48,116, 50,136,147,210, 69,121,154,246, 76, 66, 59, +230,211,236, 97,229, 22, 97, 16,206,215, 51,220,231, 20,226, 9,214,121,173,247,102,152,141, 10,168,254,219, 86,171,154, 89,133, +218,120, 29, 63,169, 28,170,113,255,188,110,236,118, 87,162,228, 7, 24, 98, 64, 47,245, 45, 35,202,187,144, 51,134,172,239, 76, +171,129,208,111,226, 55,119,175, 62,127,127,136, 76,248,238,229,219,247, 31, 63, 0,188,243, 48,231,253,221,235,111,191,127, 60, +109, 23, 80, 23,225,178,106,197, 87,183, 40, 88,170,160, 42, 71,197, 82,209, 27,135, 65,118, 89, 85,180, 4, 9,122, 17,176, 99, + 5,178, 70, 49,154,115,142, 90, 21,117, 19,248, 86,180,102, 59, 73, 24,201,210,170,220, 76, 46, 34,138,183,168,228, 64,172,166, + 40,154,181,221,174,119, 59,218,165,121, 63,154,228, 89, 36,227,234,104,225,214,118, 91, 33,143,230, 95,173, 45,161,144,184,224, + 62, 40, 5,124,122, 53,107, 45,189,204,134,110, 36, 8, 62, 66,231, 29, 16, 7,231, 88,165, 73, 99, 98,183, 89,171,249,170,170, +108,147,169, 96, 16,224,223,239,153,144, 46, 24,250, 0, 55,174, 0, 75,184,214, 48,193,193,177,195,179, 53, 28, 18,240, 49, 72, + 66,236, 43,100, 12, 37,235,125, 17, 35, 11, 51, 41, 95,166,156, 72,182,106,239,199,226, 72,109, 1,113,143,199,149, 62, 42, 27, + 30, 6, 65, 8, 36,107,186,222, 10, 62, 33,126, 54, 35,141,123,118,231, 13,137,246, 65,188,165, 20,249,109, 73,136,137,249, 50, + 39,105,222,210,182,114, 57, 40,227,203,150,140, 41, 70,222, 57,232,169,139, 56, 76,243,100, 56, 91, 79, 59,114, 95, 39,162,128, +235, 57,142, 99, 49,156,105,103, 68, 29, 51, 42,216, 43, 85, 31, 14,171, 12,123, 47,158,139, 39,125, 36, 51,210, 9, 29, 75, 29, +161, 5,109,238,136,149,238, 36,178,186,241,224,114,190,252,163, 15,227, 59, 47,245,213,224,122,186,122,236, 56, 4,218, 19,166, +216,207, 70, 14,166,230, 94,130, 17,145,223,136, 57,165, 81, 24, 70,220,121,162,116, 48,134, 43,169,239,133,166, 16,162,214, 35, + 19, 93,230,201, 69, 63,152,156,197, 89, 4,110, 7,192,145, 81,144, 51,218,213,171,162,126,222,170,185,117,207,133,158, 90, 12, +213,114, 59,157,161, 56,219,211, 54,226,149,166,188, 73,147, 39,178, 58, 35, 49,161, 29,119, 19,188, 76,127,188, 25, 93,127,121, +252,170,184,206,137, 93,167, 56,190,115,148,151,130, 76,201, 58, 50,182,222,209,183, 55,135,208, 18,113,133,149,138,229, 59,203, +114,202,138,230,128,201, 93, 38, 36, 42,179,141,104,165,112,201, 28, 58,180, 24, 59,227, 9,102,173,246, 81, 91, 2,119, 51, 25, + 92,173,236,114, 99, 55,172, 92,139,146, 42,246, 91, 89,240,179,210, 45,231,137,111,166,180,182, 69, 20,167,187,188,243, 8,103, +187, 14,115,248,108, 81, 32,249,191,142, 8, 34,211, 68, 71,131,224,194,121,111,252,107,241,147,171,106,129,152,125, 59,255,148, + 59,233, 98,255,223,175,191, 2, 48,118, 53,189, 77, 3, 65,212,107,123,215,137,211, 52,105, 75, 69, 20,218, 94,123, 64, 66, 66, +226, 39, 32, 14,156,248,155, 61,112,224, 79,112,226,130, 84, 9, 14, 8,113, 64, 21, 45, 65,224, 58, 78, 98,239,218,203,188, 25, +111,211, 15, 33,161, 94,218,170,173,210,216,158,125, 51,243, 62,250,250,254,176,141, 85,234, 62,204, 9, 83,154,184,231, 42,245, + 3,181, 68,138, 61, 51,181,212,116,116,176, 90,149,188,123, 71,151, 51,213,187, 71,163, 57, 76, 89, 91,224, 66,195, 28,119, 58, + 24, 7, 9,210,164, 35,100, 98,232,202, 94,127, 92,156,111, 64,115,142,172,111, 38, 59, 7,139,226,202, 69,141, 16,156,124, 72, + 93, 17,245, 68,220, 75, 66,152, 50,197,196, 95, 20,111, 22, 32, 76,178,221,132,221, 45,192,231,166, 99,153,106, 68,130, 14,145, +138,133,166,226, 78,183, 53,125,194,123,252, 73,190, 59,219,123,252,253, 18,154,166, 9,225,208,166,162, 99, 41, 51,131,117,189, + 62, 61, 58,253, 81, 92,253, 90, 46, 28,107,178,197, 52,154,179,126,173,197, 22, 9, 35,113,186,177,102,211,121, 89, 23,157,169, +203,172,132, 97,151,109, 21, 75, 21, 26,139, 51,152,202,236, 48,139, 51, 77,149, 23, 90,201, 21,114, 10,124, 16,207, 18,166,198, + 57, 55, 76,146, 71,249,240,170,107, 58,182,234,243, 48,230,109, 43,122, 41, 13,138, 44,213,246,249, 52,159,140,147, 84,131,192, +110,157,183, 72, 10, 6,193, 43, 51, 9, 61, 74,141,139,202, 37,129, 15, 13, 21, 43,221,134, 43,203,239, 56,184, 53,212, 29, 81, +117,174,157,175,241,136, 68,218, 68,212, 39, 88, 11, 1, 20, 29, 81,155,186, 19,171, 44,106,172,156,109, 76,155,238,164,113,158, +154,220, 24, 57,168, 26,203, 97,243,108,194,141, 42,239, 48,144,199, 60, 45, 49,107,137,188,241, 50, 57,161, 10,146, 58,239, 30, +110, 62, 5,139,220,205,114, 10, 35,197,116, 56,155, 30,127, 93,124,166,139, 56,210,227,202,150,234,159,246, 71, 42, 8, 67,182, +155, 33, 38,192,192,133,181,236,241,190,186, 87, 55,217,234, 25, 91,214, 12, 33, 45,120,251,117,146,219,118,163, 65,197,115,188, +186,236,115,116,111,194,140,160,216, 72,244,147,253,147,111, 63,191,132,152,151,196,223,157,105,246, 33,118, 2,109,183, 80, 41, +190,157,248, 17, 5,226, 47,135,230, 50,102, 19,184, 42,162, 2, 33,208, 49,195, 50,211, 25, 28,123, 32,200,188, 57,249, 90, 21, +188, 21,212,214, 64,205,208,247, 96,255, 16, 30,177,109, 22,135, 68,167,241, 32, 49, 14, 91,168,168, 15, 54,194, 0, 52,229,175, + 37, 99, 73,227, 17, 1, 90, 39,156,110,176,110, 34,236, 5,245, 30, 99,246,216, 40,189,175,211,217, 88,159, 76,243,227, 67,115, + 48,201, 16,226,204, 99,103,134,201, 80,186,120,145, 49,203,152, 34, 98, 47,198, 54,186, 94,186,139, 63,221,101,161, 23,117,180, +168,109,204, 35,101,223,135, 4,138, 39,113, 44,204, 11,214,172,198, 97,112,177,149, 28,135, 5,157,160,255, 78,134,239,104,219, +249, 74, 1,197,163,191,180, 84,250,115, 51,124,249,252,213,217,251, 51,239,133,245, 16,202, 2, 54,177,135, 69, 85, 56, 56,241, + 42,161, 70,201,202,146,126,100,111,188,255,187, 42,144,254,198,116, 49,250,197,161, 25,117,173, 93, 49, 67,180,183, 25,231,255, + 81,166, 46, 12, 37, 64,131,167, 94,154,206,189,141,165,199,186,238, 71, 55, 97, 60,233,165,109,242,138,254,212,186, 89, 13,210, + 65,213, 44,111, 39, 31, 16,214,217, 88, 92, 89,163, 7,116,170, 85,125,206, 95,199, 31,236,183,168,212,253,233,138,239, 94,191, +120,243,238,195, 91,234,169, 92,228,158,206,159,125,186, 56, 15,113,222,219,120,178,126,233,138, 50,204,154,220,255,171,242,127, + 5,160,235, 90,150,147, 8,162,104,207,123,152, 33, 72,120, 24,130,198,108,140,223,144,242,195,173,114,229, 66, 23,110,253, 1, +173,148, 1, 9, 68, 66,128,129,121,244, 76,123,207,237, 30,153,160, 73, 85,166, 88,144,240,232,158,251, 56,125,238, 57,255,137, +239,214, 51,222,218, 78,115,116, 16, 61,154, 19, 5, 45,215,118, 55,187, 53, 58, 59, 37,248,108,207, 7, 73, 70, 0, 71,232,198, + 93,152, 28, 42,209,246,218,227,120, 76, 87,170,248,124,219,215,118, 74,244, 46,151,233,253,175,228,254, 49,125,192,253,192, 99, +226,102,105, 33, 26,206,173,150, 14, 23, 74,155,176,215,179,215,156,165, 59,173, 14,232, 74,240,253,226,205, 92,169,113,127,156, +236, 55, 57, 4,245, 81, 80, 49,211, 11, 66,240, 28,214,161,102, 12, 29, 94,199,245,225,151,135,114, 94,211,114, 41, 88, 8,232, +207,129,146, 88,241, 95, 73, 70, 5, 11, 72,187, 74,141, 78, 20, 85,241,102,112,113,117,126,245,225,219, 71,215,243, 74,156,244, +182,179, 50, 77,101, 78,251,182,213,145,241,144,182, 76,150,231,106,135,115,101,149, 82, 89, 43, 21,128, 76,136, 1, 8,200, 94, +195,236,212,245,232, 97,165,241, 77, 86,239, 17,246,167,197,212,245,125,128,156, 92,235,100,178, 40,192, 62, 42,227,208, 59,235, + 70,173,208, 97, 67, 44,214,172, 22, 50,240,236,118, 20,218, 40,168,243,209,104,116,253,254,122,216,239,125,254,242,149, 50,209, +247,155,159,147,219, 91,215,243,217, 55,187, 76, 51,153,236,101,206,245, 78, 16, 88, 1,200,154,212,158, 43,207, 19,212, 30,100, + 82,108, 19,177,217, 85, 90,220,102, 79, 25,133, 62,109, 33, 99,215, 9, 41, 28,176,240, 26, 40,165,244, 11, 33,110,197,160, 60, +159, 76,153, 9,114, 97, 68,155, 27, 20, 46, 38, 71,158,100,249,142, 58, 8, 10, 26,227,238,232,102,249,195, 62, 46,210,141,118, +136,101, 14,102,155,225, 76, 29,177,196, 66, 47, 74,139, 29,189, 68, 39,164,133,166, 93, 84,210,206, 25,156, 12, 38,143, 19, 29, + 42,168,247,162,118, 88,203,147,169,122, 0,226, 52,234,109,247, 43,206, 58,172,187,219, 60,118, 84,199,133,188,198, 94,232, 63, + 83,208,203,181,114,239,209,105,170, 16,181, 22,152, 49,105,172, 89, 26,205,200, 94,147, 55, 44,230,199, 83,137, 19,245, 41,242, +254,222,204, 13,255, 25, 32, 87,121, 57,120, 59,123,156,102,114, 79,129,226,188,251,106,182,156,218, 60,246, 64,105, 51,246,226, +117,186,122,170, 30,168, 71, 76,173,195,208,149,168, 69, 94, 12, 62,163, 80,139,235,124,163, 88,216,139,203,118,125, 88, 74,109, + 30, 2, 58, 74,115,234,132,168, 84,135,199, 11,149, 86, 80,170,176,232, 74,187,208,163, 91,117, 20,248,175, 95,196,239,206,194, +139, 97, 28, 4,142, 6, 18,176, 66, 26,240,193,133, 39, 76, 57, 87, 49,238,129, 83, 41,186, 82, 89, 0, 44, 69, 86,250, 58, 95, +139,187,149, 59, 75,220, 85, 81,229,178, 52, 83,163,160,252,162,129, 84, 79,165, 17,254, 46,184,225, 59,131, 21,169,211, 7, 76, + 56, 37, 11,250, 2,158,101,136,144, 30,198, 17, 24,183,139,245,188, 98, 43, 55, 54,164, 54, 78,123, 6,163, 49, 29, 33,222,180, +201,201, 12,163,232,123,153, 85,228,240,156,211, 86,127,149, 62, 20, 84, 37, 89,198,199,134, 3,118, 89, 35,239,135,172, 13, 78, + 38, 26, 31, 28, 28, 80,193,167,221,203, 74, 13,170,225,165, 57,125, 24,150, 37, 44, 6,153, 75,124, 24,239,136,131, 56, 73, 19, +254,158,208,224,178,253, 90,165,221,166, 40,197, 82,127, 32,142,161,123, 32, 84,189,246,203,197,246,206,181, 52,111, 66,127, 34, +132, 91, 54, 8,111,146,251, 43, 90, 73, 40, 98,254,195, 92,120,238,231,143, 0,116, 93,237,106, 19, 65, 20,221,217,239,221,100, + 99, 99,147,210, 20, 74, 43, 84,193, 31, 5,169,130,224, 27,136, 15, 33,232,203,168, 79,164,207,160, 22, 17,127, 8, 42, 90, 69, + 83, 76, 90,226,214,205,126,207,120,239,153,221, 77,137, 52,255, 66,126,236,236,102,246,206,185,247,158,123,142,230,207, 24,151, +140,178,196,149, 2, 99,170, 61, 49, 4,139,182, 19, 68,138, 51, 22, 85,167,251,191,127,235,193,219, 47,175, 45,216,239, 54, 54, + 46,202, 12, 93,191,230,238,135, 9, 73, 54, 19, 32,218, 97,189, 46, 28,218, 92,218,208,186,100,208,149, 97,176, 40,116, 77, 70, + 53,130,239,178, 97, 16, 69,254, 32,206, 99, 91,172,234,254,252,254,219,222,176, 63, 60, 93, 76, 61,118,229,214,196, 90, 46, 30, +162, 89,196,147, 23,119,246, 15, 63, 79, 63,217,138, 97,252,192,139, 70,209,230,214, 96,244, 99,126, 66,155,198,129,115,163, 3, +225,247,107,193,128,197,226, 49,153,169,181,230, 32,103,166,186,130, 32,227,119, 85,211,229,110,238, 28, 28,127,123,207,102, 76, +104,220, 75, 30, 26, 20,147,104,231,235,217, 9, 84, 10, 40, 96, 75,155,194,168, 93, 14, 55, 5,215,136, 20,247,148,226, 88, 20, +165, 85, 21, 38, 33,123,194,117, 4,154,199,253,201,175,100, 90, 50,180,180,102,214,194, 12, 92,237,236,206, 82,154, 20,147,141, + 58, 41,233,114,214,246, 70,132,177, 35,204,158,216, 22, 37,168, 33, 19,234,121, 63,221,187,123,244,248,201,211,189,219,135,132, + 2,103,223, 63,142, 39,187, 23,243,217,139,103,207,223,188,251, 80, 85, 86, 14,244,157, 51, 59,175,102, 6, 43,106, 87,116, 75, +244,232,195,158, 17,122,116,184,169,116,105,164,153, 72, 50,150,151, 40,180,211,170, 2,234, 47,104,129,132,112,202,208,224,110, + 57,125,173, 56,115,145,204,130,111, 64, 16,106,242,141, 20, 8,170,103, 70,167,150,205,125,234, 10, 50,235,142,237,103, 85,106, + 94, 57, 97,183,238, 52, 77, 15,249,122, 56, 58, 95,206, 91,141,114,254, 55,125, 39,168,170,188,231, 71,152,245, 23,114,229,176, +129,158, 63, 39,130, 65, 59,205,212, 68, 13, 74, 13,233,208,221, 27,223, 56,255, 51, 35,120, 37, 90,130, 64,183, 14,223,241,147, + 50,209,139,247,108, 15, 58,148,249,255,238, 75,186,208,106, 94,170,106,210, 2, 92,215, 99,217, 90, 30, 75,233,164,181,120, 41, + 4,255, 43,152,120, 52,237, 51,176,182, 49,182,171,233,139,220,246, 12,189, 40, 43, 19,138,157,174,227,210,246,214,158, 51, 92, +242,195,232,118, 89,151,151,219,194,109, 3,192, 92,227,222,116,241,157, 91,166,144,221,164, 7, 78,183, 44,235, 2,109, 76,225, + 96,234,157,125, 93, 44,238, 57,247,253,200, 84, 41,237, 88, 23, 90,189,156, 50,155,246,142,239,238,110, 4, 7, 91,189,253,237, +190,227,182, 2,124,252,150, 64,159, 79, 11,115,115, 63,202,113,252,192, 13,250,102,175,111,219,190,176, 61, 5, 75, 82,238,210, + 83,150, 90,228, 69,182, 76,226, 56,253,187, 72,147,139, 44, 79,227, 11,245,243,204,251,189, 12,166, 89, 97, 1,172, 50,150, 55, + 44, 28, 91, 66,151,161,117,140,105,243, 51,176, 29, 81, 8,208,108,247, 82,187, 45,203, 58,135, 29, 7, 95,136, 83, 48, 9, 94, +141,130, 24,117,199,159,129,183, 44, 60,226, 69,211,216,111,254,223,186,157,212,165,223,182, 55, 38,211,197, 41, 39, 28, 24,120, + 96,185, 50, 77,162,209,180, 74, 93,106,105, 27,163, 58,170,202,118,187,128,153,175,217,193, 10, 3,204, 85,133, 72, 77,176,157, + 18, 47, 48,124,154,201,100,169, 33,185,108, 41,150,224,107,210, 93, 60, 60,122,244,234,248,101, 67,183, 2,226, 22,114, 37, 13, +177, 54,122,214, 14,108,137,174, 3,171,186, 83,176, 27,231, 90,189, 44,114,221, 81,231,234,207, 63, 1, 24,187,150,157,184, 97, + 40,106, 59,118,226, 56,201, 4, 24, 94, 2,132,212,130, 42, 42,212, 85, 63,128, 31, 40,127,209, 69,165,254, 41,203, 34,245, 11, +232,131, 82, 24,152,247, 76, 98,167,247, 94,219,211, 17,101,209, 93, 22, 8,101,198,119,174,239,227, 60,130,190, 88, 18,148,148, + 66,144,249,201, 93,178, 38,212,231, 21,148,178,180,176,182, 65,170, 42,124,245,212, 96,122, 15,244,155,251, 27,116, 63, 39, 98, +243,202,100, 6, 61,154,253,117, 26,149, 30,113, 60, 12,167,197,172,206, 50,114,220,118,116, 94,214, 75, 62, 33,184,195, 67, 19, +169,245,242,213,140,209,197,180,157,121,123,235,136,121, 15,214,169, 39,123,167,191,134, 63,115, 85, 64,202, 35,102,154,247,247, + 8, 86, 50,247,163, 59,248,245, 40, 90,223,195,129, 46,230,211,253,205,221,233,124, 10, 85, 1, 52, 22, 34, 50,105,209,191,139, +181,164,196, 17,134,119,190, 15,117,193,159,129, 81, 82,179,208,115,125,123,252,225, 9,131, 34, 86,153,117, 94,223, 14,111,233, + 56,221,220,182,147,133, 29,207,218,225,152,119,211,106, 48,224, 15,131,238,110,192, 21,223,251, 61, 26, 47, 45,105, 66, 73,181, +180,243, 97,243, 8, 47, 0,229, 63,119, 66, 85,203,188, 34,238, 72,130,218,108,132, 35, 99,169,132,230, 46,233, 25,165,241,237, +165,206,164,201, 83,142,176,250,110,103,171,119,121,249,225,227,167,207,208, 78,184,249,119,206, 22, 79, 15,183, 95,175,175,142, + 79, 78,123,133,190,254,114, 85,247,116, 89, 72,244,249, 86,180,117, 38,110,150,107,125, 49, 37, 89, 39,145,159,213,184, 84,118, +101, 1, 93, 8,250, 76,149,218,188, 63,127,155,184,238,225,105, 36,152,130,214,212, 24,104, 78,151, 10, 49, 26,137, 55, 69,203, + 16,254,131,145, 13,207,144, 53,224,232, 3,235,145, 10,237, 6, 97, 27,193,128,197, 71, 30,109, 92, 88,174, 76,235,220, 26,219, + 6,229, 82, 87, 10,101,124, 13,218,232, 35,166, 69,174,246, 10,197,136, 23, 13, 4,204,162, 89,136,104, 73, 1, 33, 73, 82,121, + 45,165,123,184,197, 90,191,248,132,207, 97, 32, 12,220, 50, 88, 12, 66, 14,110,103, 18, 27, 54,233, 80,179, 26,158, 36,129,249, + 81, 38,172,151,111, 64,115, 66,101, 5,198,222,179, 73,123,144, 35, 97, 46, 83,169,103,208, 28,110, 31,163, 87, 39, 46, 52, 49, + 22,196, 90,114,247,146,123, 61, 83,119,228, 64, 43, 88,244,121,236,216,217,225,249, 8,170, 31,228,178, 98, 29, 64,104, 64, 44, +107, 81,162, 93,144, 74, 97, 32, 38, 68,149,206,181, 58, 23,178, 48,210, 41, 5,243,120,152,238,175,208, 0,102,118,149,164,196, +218, 69, 18,166, 36, 7,100,137,235, 46,172,208, 53,121,135, 25,201, 77,170, 42, 5,205,114,162, 21, 60,139, 50, 73, 15, 10,243, +110,167,190,120,213,191, 56,235,191, 57, 44,183,106, 76,237,240,219, 80,208,209,102,105,154,226,172, 38,193, 5, 26,124,149, 85, +177,119, 84,238,191,214,187, 71,162,232,219,164,156,217,100,222,176, 49, 52,133, 75,135, 86,189, 86, 54, 66,243,172,202, 54,118, +138,254, 65,181,125,100,170, 45,173,217, 70, 62,169,213, 44,117,186,237, 52, 14,226,133, 31,118, 5,104, 77,180,228, 92,177,185, +240, 15,182,203,254,148,244,197, 86,170,106,109,112,210,115,113, 64,193, 98,115, 70,179, 33, 22, 8, 25, 46, 94,175,252, 69, 33, + 35,202,214,227,217,196,219, 4,113, 30,111,107, 95, 59,115, 14, 49, 76, 16,203,142,173,188,197,131, 47, 74, 24,170, 33,147, 13, + 93, 72, 55,113,174,128, 83,123,231, 29, 64, 40,173, 53,158,147, 76,171, 84, 75,240,162,160,188, 72, 43,193,160,141, 1,197,101, +139,226,197,225,223, 5,115, 15,254,130,212, 82,164, 73,241,127, 65, 50,225,117,159, 19,157,186,255, 87, 34,251, 35, 0, 93,231, +210,219, 52, 16,196,113,123,237,172,227, 36,117, 9,180, 69,180, 85, 91,160,164,128, 56,161,150, 51, 31,132, 3,220, 17, 7, 14, + 72,240,105,144,224,163, 32,113, 69, 80, 68, 81,197, 75,106,147, 86, 52,164,228,101,199,187,222,101, 30,118,226, 84,226,152, 72, +177, 20,123, 61,143,255,204,252,198,119,102,144, 79, 60,103, 60,193,133, 73,146, 59,173,166,154,105, 18,160,241,191, 49,243, 34, +255, 9,158,210, 66, 92, 67,209,142, 90, 74, 24, 67,161,209,147,105,204,112,177, 46, 13,193, 43, 85,251,141,219,140,150,134,227, + 33, 74,102,150, 58, 12,105, 65, 51, 35,252, 51,118,160,243, 43,190,221,162, 3,204, 22,221, 96,240,120,193, 76,124, 63, 57,140, +194, 38,132, 63, 9,153, 0,103,198,243,161,247,140,122,111, 93,198,209, 88,179,189,214,250,113,250, 19,226,193,170, 47,177,189, +145, 70,106,139, 21,239, 40, 23,150,215,132,154, 98,210,146,161, 55,240, 56, 91,171, 59, 39,189, 78, 53,104,128, 71, 97,222, 39, + 60,251,165,229,213, 68,103,131,184, 7, 23, 88, 95, 92,111, 4,209, 65,103,127, 37,186,218, 27,225,186,119, 48,203, 16,100,117, + 71, 29,156,252,198,240, 57,132,196,182,234,133,144, 70,107,140,238, 61, 10,225,221,122,221,213,129,128, 63,158, 76, 72, 82, 36, +123, 19, 72, 52,208, 84,158, 66, 79,166, 84, 6,135,232, 94,107,251,209,147,199,119,247, 30, 58,142, 84,163,206,231, 15, 31, 55, +175,111,189,121,253, 54,172, 6,231,189,120,119,247, 65,212,168, 97,164, 19, 59, 4,143,196, 80, 70, 40,238, 87, 23, 57, 99, 27, +110,119,170,183, 54, 55,238,180,214, 50, 92, 96,100, 15, 14,191,101, 86, 62,127,250, 12, 30,250,139, 87, 47,187,253, 62, 70, 59, + 89, 26, 53,196,224, 79, 34,226,138, 20,209,192,254,165, 93,199, 19,242,158,112, 2,180,172,212, 82, 21,243, 61, 34,126, 58, 90, +246,208,175,199,122,228,150, 30, 3,216,215,212, 41,247,252,130,111, 71,180,250,212,228, 87,132,208, 38,231, 20,197, 58, 14,249, +178, 51,233, 6,149, 80, 77,254, 0,155, 85,144, 69, 28, 67,232, 88,192,194, 4,193,181,251,200,166,199,118, 58,205,134,217,163, +118, 55, 76,207,125,206,161, 77, 45, 92, 24,196,125,131, 21,117,159,210, 20, 85,126,183,120, 0,187,204,164, 52,142,170,201, 5, +244,253,168, 19,138,118,247,248,162, 32, 99,121,237, 48, 10, 55,144,141, 78,112,189,156, 17,249,148,190,149,190,132,207,237,238, + 17,184, 67,143, 86, 82,243,210, 1, 82,171,104, 30,159, 26,147,120,139,100,226,196,132,255, 18, 37,208, 20, 10,208, 52, 54,124, + 17,219, 46,114,136,143,113,153,199, 78,163,226, 30, 1,148, 2,220,122,231,134, 62, 56,108,240, 13, 8,115, 69, 93, 18,178, 34, + 25,110, 44,134,183, 87, 22,110, 92,171, 99,162, 75,122, 72,154, 25, 41,112, 17, 60,154,117,172, 73, 81, 84, 7,153,118, 16, 86, +154,171, 94,237,146,114,196, 56,209, 73,127, 56,153,192,185, 80, 62, 81, 0,176, 68,153,231,181, 22, 77, 4, 47,109, 2, 15, 1, +151, 8, 46, 55,214,154,225,210,184,113,126, 26,253, 62, 94,105,171,163,243,168,157,164,240,162, 49,213,149,103, 1,140,157, 51, + 81,112, 35,206, 70,103, 92,208, 67,225,131, 42, 22, 97, 80,221, 89,222,252,244,107,159, 12,252,148,196,104,243, 25,245, 57,120, + 52,247, 17, 22,177, 2, 87, 62,139,105, 52,143,194, 74,176, 15,221,113,143, 12, 46,195,128,105, 65,135, 49,227,100,104,221, 98, + 10,214,157,141, 53, 48,154,211, 35,202,189,114, 85,170, 18,236,104,179, 54, 87,172, 16, 16, 21,108, 93,185,121,112,252, 69,250, +149,251,183,246,222,127,125, 71,223, 27, 94,193,152,203, 78,214,130,135,206, 50,164,147,194,205, 81, 58, 43,163,179,237,255, 6, +193,113, 73,114, 64,217,228, 69,134, 16, 89,218,140,101, 29, 41, 42, 52,164,157,205,251,130,255,134,240,255, 4, 96,236,106,122, +155, 6,130,168,215,246,218,113,154, 15,170, 38, 77, 91, 36, 10,162, 23, 78,136, 11, 23, 62, 46, 72, 32,161, 82, 84,113,132, 75, + 37,248, 33, 32, 78, 61,114, 0,241, 91, 16, 18, 20, 90, 9,144,224,130,132,138,144, 16, 81,155,146,180, 33,181,155,250, 99,215, +241, 50,179,187,118, 83,224,192,185,177,147,106,103,119,222,206,188,121,207, 46, 42,247,146, 7,141,204,187,145,145, 42, 61, 88, + 67, 28, 27,176,181, 41,141,184, 86,169,151, 18, 33,153,121,148, 48, 69, 94, 50, 84, 55,158, 76, 72,126,155,170,161, 99,116,100, + 68, 13,117,194,199,186,126, 7, 80, 88,138,223, 50, 42,200,165,170,117, 54,110, 56,174, 50, 30, 94,192,165,145, 82,166,167,208, + 17,241, 64, 72, 78,213, 91, 41, 79,208,243, 65,155, 87, 8, 69,169, 51,198,180,171, 52, 27, 75, 86, 21,155,181,198,174,223, 67, +238,128, 97, 70, 44,150, 77, 78, 75, 10, 42,104,131,191,217,250,236,246,160, 99,232,169, 13,145,106,102, 32, 22,210,234,110,125, + 55,216,163,182,227, 71,251,243,173,179, 61,191, 11,144,233,222,221,251,151,150,174, 61,121,180,186,241,254, 37,164,244,237,254, +182, 71, 7, 51,181,147,167, 26,167,183,246, 95,195,230,130,109, 15, 48, 65, 38, 60, 76, 93, 56, 51, 93,155,105,239,111, 17,194, +225, 84, 65,255, 79, 54, 28, 12,178, 93,206,241,234, 98,144,152, 1, 86,101,152,201,144,153, 38,231, 71, 9,155,107, 53,187,123, + 97, 18, 39, 15, 86, 86,110, 45,223,113,106, 45,248,239,118,190,127,110,127,219,156,158,107,193,246,107,183,187, 15, 31,175,190, + 93,123, 69,233, 84,191, 63, 2, 36, 54,140, 15, 32,248, 28, 8, 4,219,177, 57,122,188,114,134,109,232,178, 83,250, 21,248,140, + 25,139,215,111, 46,222, 94, 10, 6, 3, 88,193,103,207,159,126,248,248,169,215,235, 92,185,177,124,241,194,249, 23,111,214, 97, +195,114, 44,219,152,149, 42, 9,120, 8,215,102,120,155, 84,207, 29, 73,104,108,241, 44,182,137, 91,152,177, 99,185, 39, 19, 76, +164,174, 3, 32,146,132,236,176,136,187,131,100, 56, 30,125,174,229,100,154,216, 75, 10, 43, 52, 19,219,128, 84,169,239,146,236, +136,147, 46,183,179, 5, 89,188, 96,239,166, 90,190,180, 48, 72, 19,135,120,184, 43,228, 51,162,150,203,242,243, 35,225, 33, 60, +204,229,124, 0,252, 21, 86,100,114, 98,114,253,203,154, 50,121, 64,225,232,177,115, 6, 41, 79,163, 44,135,125,178,129, 47,200, +229,115, 87,223,125,221, 16,220, 48,201,177, 34, 9,172, 14, 22, 88,217,161, 82, 81, 52, 81,238,202,194, 61, 41,180, 89,180,156, +207,162,148,240,144,133, 38,202, 73, 33, 70,175,186, 53, 63,246, 97, 57,224,212, 38, 88,160,107,254, 12,118,144,149, 4,104,195, +114, 35, 35, 33, 25, 25,155, 67,213, 53,147, 44,247,198, 82, 84, 26,249, 50,169,147, 40, 65, 16,202,157, 98, 19,194,118,109,211, + 5,228,142, 62,153,212,179, 80, 18, 3,128, 1,172,196,153, 74,121,161, 49,177, 48, 91, 61, 81,161, 72, 55,132, 59, 75,108,200, + 66, 34, 98,252,146, 99,123,232, 30,137,117, 29, 93, 26,168, 55, 41,236, 41,226,132, 49,139, 67, 38,219,252, 2, 62, 70, 75,110, +201,149, 51, 34,232,238,128,137,148, 37, 44,100, 60, 12, 89,196,211, 56, 73, 34, 17, 35, 13, 7, 78, 7, 74,237,169,249, 70,117, +218,171,183,203, 63,250,206, 78,169,141, 70, 70, 82,191, 59, 85,186,144,202,211, 67, 11,239,232,225,104,162,228, 47,180, 42, 28, +227,108,179,179, 41,242,241, 81,114, 52, 29,244, 71, 7, 5, 23, 77, 57,161,231, 19,201, 2,208,128,231,122, 1,154,181, 41,194, + 51, 38,209, 90,169, 58,132, 56, 20,138,221, 42, 29, 61, 45, 41,143,165,154,224,249, 48, 68,165, 84,131, 60, 19,132, 62, 60,235, + 57, 30,242,115, 88,134,137, 19, 30,143,134,242, 7,226, 78,134,251,183,188,252, 73, 61, 17,101,190, 42, 91, 65, 16, 3,150,180, +130,134,181,153,112,202,240, 11, 99, 17, 33, 61,225,175, 90, 12,132, 1,188, 33, 87, 3, 24,227,251,252, 99,112, 66,140,155,155, +170, 88, 82, 12, 52,243,191, 29,157,126, 11, 64,217,181,172, 70, 17, 68,209,174,238,234,119,247,188, 53,131, 73, 52, 9, 4,141, + 10, 14,110,220,184, 16, 87,226,210,133,248, 21,238, 93, 9,234, 23,184,114,225, 87,232, 70, 3,162, 8,162, 34, 6, 84, 4, 29, + 33,234, 68,124, 48, 73, 72, 39,243,232,119,123,239,173,202, 76, 7,220, 72, 22,129, 64,146,238,233,174, 83,247,220, 58,247, 28, +233, 63,211,114, 15,145,153, 6,220, 64,156, 83,107,169,102, 55, 45,221, 0,158, 59, 41, 32,160, 56,104, 16,159, 98,172,124,176, + 86,150,251, 76, 7,170,165,140,121, 58,220, 78, 37,186, 56,182,102, 10, 20,131, 88,150,102,233,190, 85, 51,126,183, 13,151,161, +132, 60,221,215, 41, 8, 90,135, 79,193,119,170, 68,175,138, 35,181,249, 24,181, 33,184,126,162,116, 76,131,142,136,200, 53,183, +145, 83,178,138,140,181,160,133, 41, 70,153, 84,188,151, 74,175,191,145,103, 25,190,207, 76,243,128,205, 3,102,161, 11, 20, 86, +249, 98,199,106,250,173,237,193, 14, 92,141,107,187,137, 8,247, 34, 70, 34,114, 45,134,225, 48,136,134, 81, 28, 37, 41,128, 42, + 84,145, 69,231,244,217,133,206,202,218,139, 87,189,141,175, 88,251, 51,160, 20,209,206,104,183,183,213, 35, 68, 3,154,236,216, +134, 55, 8, 7,128,129, 77,127,102,115, 15, 21,172,163,120,128,242,243, 34, 25,211,112,102,172, 36, 35,150, 39,116,142, 28,166, + 34, 85, 24,159,116, 12,127, 47,227,240,159,110,221,188, 13,165,157,105, 89,215,111,220,217,221,238,119,223,191,109, 31, 93,250, +240,250,121,251,216,210,226,201,115, 94,189,181,250,240,193,194,226,242,102,127,123,118,126, 33,137,179, 43, 87,175,117, 63,173, +107,204,238,111, 6,182,101,135, 33,188,100, 69, 28,231, 71,231,230, 59,103, 58,239, 62,118,147, 36, 61,117, 98,249,209,227, 39, +119,239,221, 95,125,250,236,243,151, 31, 91,193,168,102,251,231, 47, 94,214,178,241,218,155,151,245,138,171, 98, 41,161,192, 85, +193, 34,137,195, 20, 83, 54, 21,209, 58,147,182,114, 20, 89, 89,200, 99, 55,172, 38, 16,138,194,100, 4,251, 28,192, 75, 94, 76, +135,146, 4,203, 54, 53, 83,238,193,249,164, 23, 33,222, 6,212,141,168,170, 78,211,152, 36, 92, 43, 5, 33, 89,186,153,231, 73, +121,146,154, 18,141, 19,118,192,132, 82,149,199,157,100,228, 42,222, 84, 64, 61, 49, 40,219,240, 26, 81, 26,254, 14,126,109,244, +191, 17,166,112,234, 67, 22, 69, 49,117, 74,151, 29, 36,234,233,105,251,217, 15,223,255,172, 71, 69, 66,186,113,106, 59, 11,220, +215, 68,143, 21, 97,130,180,134,232,245,134,228,149,230,135, 68,219, 21, 8,110,140,112,175,144,220, 91, 17,159,150, 48,214,206, +242,204, 50, 44,184,224,189, 48, 96, 2,198, 25, 96, 49,199,123, 84,217, 1,187, 24, 49, 68, 68,131,167,226, 71, 98, 82, 28, 73, + 39,113, 58, 29,221,157, 96, 27,225, 22,176, 66, 93,115, 77,236,198,120,150,201, 53,187,106,176, 37,223,187,116,124,230,194,202, +225,185,150, 5,107, 57,132,170, 1, 59, 12, 5,137, 35, 85,139,107,152, 0, 99,233,136,221,220, 16,225, 74,122,115, 78,171,207, +166,153, 58, 30,133,227, 33,188, 35, 64,209,116,207,179,170,190,109, 87, 29,238, 59,170,103,171,174, 13,164,149,123,142, 89,243, + 60,216, 48,129,192, 86,108, 3,106, 87,116,215,192, 72,108,241,133,234, 1,167,233,213, 61,151,239, 40, 3, 30, 80, 59, 74,220, + 95,193, 38,121,182,136,219,166,110, 54,253, 6,142, 62,208,199,151, 83,162, 86, 33,105, 51,107, 3,147, 80,217, 48, 26,203,126, +233, 68,192, 35, 48,101,146,170, 85,194, 31,142,244,197, 10,209, 27, 92,214,160, 64,248, 20, 25, 11,129,199,206,176,234,179, 34, +213, 80,245,192, 9, 55,152, 42, 45,104,152, 99,216, 56,179,138,180, 30, 86, 95,154,144, 58,222,208,116, 67,183,162, 36,148, 70, + 40,180,193, 6, 35,244,142,158,169,180,187, 63,187,162,172,119, 12,151, 18, 14, 36, 22,199, 25,192, 67, 34,203, 94,145,228, 93, +242, 36,128,135, 86,158, 56,133,223,229,220, 64,239, 98,202,110,101,255,210, 12,151,117, 71, 89,241,127, 81,125,127, 5,224,235, +218,122,154, 8,162,240,204,238,236,165,237,214, 45,136, 21,138, 37,104,176, 40, 20,208,200, 95, 48, 24, 66, 98, 98,244,135,234, +131,145,120,123, 55, 68, 99,162,196, 40,250,128, 23,140,129, 80, 96, 75,247, 62,158,203,110, 11,137, 49,105,250,210, 62, 76, 59, + 59,115,190, 57,243, 93,138,253, 61,167, 99, 72, 25,126, 13, 79,167,229,216,110,213,246, 78, 6,129, 48,216, 43, 73, 70,121, 68, + 58, 20, 41,165,252, 39,187, 94, 14,219, 27,146,227,177, 41,204, 73,150, 85, 74,138, 50, 35, 27, 59, 87,182,114,137,183, 65,182, + 5, 76, 60,162, 70,124,153, 22,102,176,178,195,148,214,220,228,220,159,222,111,246,195,130,193,192,234,197,106, 73,164, 94,163, + 32,161,137,153,139, 51,189,126,143,140,204,138,240, 72,246,171, 35, 58,129,132,178, 52,136, 78,145,252, 78,121,240, 99, 94, 3, + 86, 90, 76, 1, 32, 38,211,211, 68,118, 24,244,200, 58,198,110, 54, 46, 7,131,126,132,244, 19, 74,230,213,104,129, 75, 43, 89, +180, 47, 93, 9,146, 48, 76,208,117,107,251,243,199,215,143,159,126,218,217, 14,163,160,248,145,154,187,248, 38, 96,254,229,246, +242,126,176,127, 60, 56,154,111,117,126, 30,238, 1,166,214, 24, 7, 60, 96,122, 37,124, 17, 30, 29,223,105, 36,102,108, 86,243, + 10, 60,233,166, 42,212, 70,232, 58,137,215,230, 53,128, 87, 66, 60,122,248, 0,118,251,238,242, 66,197, 76, 94, 62,123, 18,135, +125,101,136,238,202,234,248,212, 53, 24,248,151,247,111, 54, 55,159,111,109,109, 45,117,187,240, 75,215, 54,238, 79,207, 45, 54, +253,202,236,108, 11,234,209,250,250, 26,140,169, 90, 81,139,243, 51,182,147,183,219, 87,223,190,251, 16,229,217,234,202,173,111, +187,187,219, 59, 95,211, 36,115,108,171, 14, 64, 78,229,235, 27,119,125,175,250,234,197, 83,128,159, 97, 66,138,167,152, 51, 23, +209,126,141, 32, 55,143, 92,151, 73,100, 8, 95, 49, 76, 14,239,154,120,194,140, 18,152,231,103,170,191, 49,132, 72,142,114, 19, +242,204, 27,110,241,220, 92,206,168, 13,194, 18, 11, 99,148,153, 96,162,178, 81,100, 0,172, 96,127,100, 79, 71, 74, 75, 64,175, +155,172,244, 33, 24,181,228, 70,196, 74, 3, 38,215,162, 72, 69, 77,209, 5,112,158, 69,118, 39, 6,179,100,236,116,139, 24, 86, + 41, 56,164, 17,101, 64, 91, 40, 69,203,101,201,210,162, 8,104, 28,117,179,222,132,163,147,201, 29,188, 50, 98,137,165,136,212, +169, 86,196,232,224, 99, 41,115,103,244,237,217, 59,157, 86,231,199,193,119, 70, 40, 68, 96, 47, 28,120, 17, 1, 82,158,112, 17, +164, 65,208,136,174, 16, 12,121,206,177,106,100, 93,101, 20, 47, 77,204, 5, 69,254,213,132, 80, 12,233,154, 38, 1,118,211,179, +237,186,107,215, 92,229,217, 78,203, 85, 27, 55, 38,239, 45, 77,141,121,170, 31, 3, 2, 74, 72,111,145, 19,205, 12,233,109,142, +165, 96,198,209,210, 15,213,219, 72,127,199, 37, 50, 62, 45, 26, 45,145,228,209,105, 20,133,216, 92, 70,183,144,154, 3,239, 80, + 81, 49, 67, 64,145, 78,192,166,250,230, 42,225,218,162,234,138, 9,207,108, 54,106,147, 99, 19,126,205, 87, 86, 12, 15,119,148, +114, 18, 12, 22,113, 56, 30,248,126, 77,245,245,137,121,156,178, 1,113, 41, 60, 31, 93, 11,102,200,208, 74, 83,168, 51, 41,133, +173, 94,159,234,236, 7, 7,232,246,149,231, 71,125, 12, 12,230, 93,157,157,160,116,121, 91,193,180,105,173,203,139, 26, 93,224, + 2, 88,149,167,200, 71, 44, 60,237,121, 98, 88, 52, 4, 51, 14, 21,139,182, 81,252,195,225,172, 73,118,114, 17, 53,184,140,122, +229, 2, 20, 93,118, 8, 23, 35, 66,167, 32, 96,119, 66, 92, 43,246, 38, 47, 68,196,240,103,224,249,140,138,244,205,233,133, 95, +135,123,229, 7,236,174, 89, 40, 51,100,193, 98, 28,234,207,112,239,138,211,240,140,235, 45,160, 40,178,176,194,196,105, 41,207, +103,111,201, 81,239, 69,158,109,123,234,243,180, 5,253, 95, 57,223, 95, 1, 24,187,146,221,166,161, 40,234,241, 37,118,236, 56, +131,211,129, 86,128, 90, 6, 1, 82,213, 20, 16, 18,116, 81,181,116,201, 31, 32,196,191,176, 97,199, 79, 0,223,208, 77, 23, 72, +172,144, 88, 80, 9,137, 74,176, 64,165, 69,109,131,227, 56,174,199,216,230,222,251,236, 54, 8, 33, 33,101,149, 68,206,224,247, +206, 59,119, 58,167,170,175,114, 23,204,178,182,133,217,192, 40, 9,252,208,163, 28, 29,234, 95,139, 92,203,189,186, 65,231,101, +146,226,111,215, 28,161,116,173,181,205, 89,216, 30,176, 64,177,193,128, 10,110, 92,161,168, 44,166, 97,111,105, 46,150, 57,153, +243,240,164,188, 44, 21,241,168,103, 81,128, 59,237, 78,170,217, 2, 83, 51,195, 36, 2, 62, 8, 11,130,215,109,168,112, 43,186, +103,195,150,102, 1,185,150,184, 16, 13, 37,214,169, 9, 82,153,107,207,157,184,199,107, 75,125,128, 44, 67,195,188,170,159,248, +105,140,170,235, 92, 91, 9, 62, 16, 14, 0,160, 18,110,232,245,151,251,142,239, 28,187,167,172,166, 89,134,229, 5, 99,178, 49, +161,168, 63, 75, 71,225,200, 54,102,198,225, 24,144, 15,182, 2,196,131,176,247, 2,148,170,224, 35,182,124, 8, 8, 14, 9,213, +208, 12, 8, 0,224, 37,171,209,209,213,250,205,197,219, 63, 71, 71,240,115,239, 45,223,119,206,220, 48, 13, 96,177, 13, 2,167, +217,212,229,230, 68, 99, 50, 79,203, 34,176, 87,150, 84,186,162,212,153,124,240,125,255,240,112,127,173,191,250,230,245, 91,187, +119,105,125, 99,251,211,199, 15, 55,250,143,232, 40,143, 94,189,124, 49, 14,124,169, 72,159, 61,127,250,110,119,103,117,237,110, + 26,143,116, 77, 77,146,177, 51, 56,218,218,126,124,253,218,114,171,213,220,220,220,218,219,219,155,181,231,190,236,127, 6, 92, +235,175,220, 9,252, 81, 28,143,102,218,166,213, 84,245,186, 28, 5,241,195, 7,235,246,149, 91,239,119,119, 28,207,237, 88, 6, +128,131, 34,160,154,124, 67,151,130, 48,133,205,197, 68,141, 74,163,120,122, 99,239,151,218,192,213,153, 38,170,162, 21,149,219, + 78, 53,189, 81, 22,210,170,194, 32,194,116, 94,137, 59,118,245, 94, 60,137,243, 82,158,123,218, 12,154, 55, 32,240,134, 95,137, +225, 12, 50, 3, 58,108, 27, 61, 56, 29,207,187,233,145, 85, 41, 12,137,114, 21, 28,112,209, 24,149,158,164, 29, 39,102, 25, 14, +213,201,152,220,207,176, 77, 22, 66,138,108, 2,132,149,219, 72, 9,149,209, 39, 57,236,201, 90, 77,151, 69, 70, 82,145, 60,222, + 20,184,105, 17,117,205, 70,112, 55,153, 92,231,217, 93,120, 26,187, 83,224,106,216,189,131,158, 88,100, 27, 73, 56, 76,223, 3, +118,202, 47,127,240,237,228,107,165, 77, 56,157, 63, 45,254,200,151, 34, 22,112, 41,200,115, 79,180,233, 71, 33, 94, 24, 51,149, +102, 69,185,136, 3,210,140,213, 72,174, 18,144, 26, 14, 49,214, 96,178,169, 1, 19, 87,219, 10,219, 88, 92,120,178,210, 93,154, + 55,125,184,121,201,132,198,162,115,110, 53,129,204, 29,211, 50,168,123,131, 48, 7,228, 2,207, 59,170, 79, 89, 61,161,119, 25, + 35, 74, 8, 78, 35, 68, 98, 36,147,240,103,169, 10, 6, 44, 65, 36, 56, 99, 97,224, 6, 71,158,115, 48,114, 15, 61,239,135,159, + 57,129, 22,197,104,216,163,169,130,173, 11, 11, 29, 54,223,177,235, 53, 83, 16, 49,177, 51,201,203,141, 46,201,245,150,165,137, +137, 55,204,195, 60,151, 46,140,146,170,172, 41,153, 37, 64,136,125,217,190, 58, 36,114, 54,244,135, 89, 89,158, 40,184,141, 33, +183,165,109,155,246, 89,228,243,228, 94, 94, 46, 54, 42,153, 17,232, 99,248,174,155,196,254,138, 70,205,176,140,102,132, 40, 95, +240,132, 6, 31,113,215,107, 58, 64,252, 56,244, 36,178, 5,135,160, 51,206, 18,160, 14,192,212,169,109, 72,134,203,206, 54,231, + 1, 88, 24, 67,255, 91, 42,111,200,117, 84,172, 75,187, 70, 55, 34,247,243, 10,189,164, 74, 61, 23,187,237, 79,199, 39,240, 53, +104,214, 15,104,132,148,243, 60,100,145, 87,170, 65, 23, 86,175, 40, 60,167,214, 82,120, 27,196,151, 69, 46,136, 83, 66, 43,162, + 88,252,203,255, 76,152,114,131,154,114,163, 20,255, 79, 2,254,183, 0,140,157, 73,111,211, 80, 16,199,237,103,199, 75,234,214, + 9, 89,154,110,180,168, 82, 43,214, 3, 66, 2,149, 19, 28, 64, 8, 85,112,226,171, 33,193,135,224, 2, 23,132,196, 25,169, 7, + 84,130,104,170,170,165, 37,233,146, 38,141,179,218,207,113,108,102,230,217, 73,133,122,224, 26,201,142, 18,217,243,254, 51,243, +159,223,140,253, 51,202, 37, 70,129, 28,163,124,105,239, 26, 86,162,229,240,159, 73, 60, 85,137,113,213,146, 44, 95, 69,125,194, +187, 12,134, 3,148,189, 56, 90,164,198,168,226,177,255,135,177, 4,154, 35,143, 81,195, 19,220, 93, 4, 98, 34, 16, 61,180,100, +156, 73,122,180,246,248,164, 89,243, 2, 47, 18,243, 57, 18,210, 39,200,229,138,151, 88,198, 20,129, 96,176,180,173,178,132,124, + 70,188, 11,200,188, 92,238,118,250,206,108, 6,228, 88,223, 31,114, 68,165,147,205, 6,222,127,184, 9, 72,117,184,173,101, 88, +231,157, 38,164,111, 71,141, 26,210, 45,162,192,227,144,119,138, 37, 70, 2, 92, 23,221, 94,190, 91,169, 85, 66, 57, 30,161,236, +241,110, 15,171, 85,202, 88,181,136,159, 48,159, 43,129,116, 2,241, 30,162, 24, 15,206,187,141, 83,231, 56, 36,219,220, 73,231, +108,198,204,228,166,243, 27,235, 15,127,157,236, 50, 99,196, 17,243,169, 96,170,131,171,151, 36, 67, 87, 76,141, 65, 96,181,140, +148,110,232,237,118,247,180,222, 57,216, 63,172,236,237, 15, 6,252,162, 94,111, 59,173,251, 27, 79,132,167,237,203,167, 15, 78, +187, 87, 40,206,191,220,124,253,238,237,251, 23,155,175,134,190,151, 93, 88,153, 78,155, 95, 63,127,220,254, 81,238,247,252, 63, +181, 51,144,154,181,227,189,210, 92,166, 86, 61,208, 12,233,214,218,141,102,203,169, 55,154,144,224,115,238, 95, 95, 92,152, 47, +149, 52,205, 92,189,121,239,247,238, 79,167,217,122,254,236,233,214, 86, 25,125, 31,144, 68,235,138,199,225,129,151,252,136, 19, +148, 7,143, 69,114,170, 5,132,211,195, 96, 74, 2, 35,174,170,203,201, 38, 91,198, 82,112, 84,153, 41, 19,222,165,229,220, 42, + 50,227, 8,150,228, 38,176, 26, 4, 88,211,160,195, 37,134, 71,180,152,189,142,173, 59,178,163, 8, 46,141, 88,104, 57,217, 80, +138,182,184, 81, 20, 79,205,179,100,115, 72, 84,152, 46, 66,114,169, 50,109,198,180, 57, 86, 72,133, 55, 60,202,152,185, 62,239, + 19, 48, 66, 34,248, 68, 56, 99,102,125,212, 22,145, 24, 89,130, 40, 72,245, 80,124, 46,225, 65, 93,202,173,116,112,145, 27,233, +100, 66, 74, 88,186,101,233, 83,100, 46, 8,196,226, 80, 66,109, 69,120, 96,140,130,120,106, 84,138, 12, 53, 13, 7, 25, 36, 13, +240,185, 48, 78,142,165,170,136,238, 52,143,202,146,162, 66,194,154,164,161, 61,105, 34,224, 89,236,165, 96, 44,153, 91,164,203, + 25,113, 63,136,202,167, 96,124,199,135,196,210, 85, 75,215,204,148,154,215,244, 55,119,150, 54, 31,148, 32,228,122,156, 44,133, +116,132,137, 14, 1, 18,153, 84, 69,135, 12, 6,197, 59,241,126, 25, 54, 69,209,127,160,233, 18, 36,130,169,180,228,129, 52, 10, +112,234, 20,210, 55, 13,183,235,193,223, 60,104, 94, 28, 85,170, 59,245,209,119, 55,127,168,204, 85, 89,225, 88,201,213, 34,123, +207,213,203,103,225,246,142, 83,254, 86,237, 85, 26, 5,215, 87,151, 51,210,122,209, 88,202, 21, 37, 22,116, 56, 31,134, 81, 44, + 96,101, 51, 99, 26,158,219,234,224,186, 1, 57,102, 22, 81,178, 23,207, 35, 97, 36,119,122, 23, 73, 15, 85,252, 79,194,195, 70, +182,105,196,204,132,124, 4,153, 8,174, 15,182, 77,219,245, 7,209,164, 98, 33,231,173,252,192,239, 99,107,136,154, 88,184, 24, + 4,171,222,248,229, 25, 43,235, 17,181,134, 42, 91, 56,240, 40,108,153,130, 88, 69,155, 91, 12, 52, 1,226,142,117, 84,103,112, + 31, 59,109,123,104,127,196, 96, 53, 99,216, 93,222,195,253, 57, 72,117,143,178, 83,215, 80,104, 39,184, 71,218, 4,167, 66,108, + 17,193, 97,214,158,107,187, 14, 92,130,157, 36,204, 2,208,170,175, 43,162, 23, 26,107,112,116, 55, 96,246,128,200,166,128, 92, +136, 73,225,157,220, 65,227, 0, 40, 95,177,141, 50, 97,223,179,148,162, 83, 49, 83,254, 79, 9,255, 87, 0,186,174,165, 55,137, + 40, 10,207,147, 25,102,128, 14, 72, 41,173, 90, 91, 31,216, 70, 19, 27,211, 69, 83,141,137,169, 27,119,166,191,194,165,137,255, +193, 95, 97,226, 35,113,107, 52,190,182, 70, 55,181,137,209, 90,187,210, 84, 74, 95, 52,165, 64, 41,243, 0,230,225,121, 80, 74, +109, 36, 44,128,192, 4, 46,247,222,243,221,115,190,243,125,210,137,231,199,222, 12, 33, 31,214, 97,119, 99,238,123, 27, 44, 9, +157, 16,156,248, 63, 87,191,110,207,169,232, 7,109,219,117, 34,242, 64,141,196,128,126, 9, 5,105,228,234,164, 88, 73,130,147, +110, 65,151, 26, 25,246, 68, 44, 77,221,196, 99, 53, 49,174, 23,127, 47,176,174,176,161,197, 49,223, 29,137,153,248, 41,249,240, + 8,228,180, 28, 23,171,121, 98,247, 52, 66,231, 90, 30, 30, 0, 5,112,241, 65,107,168,184,179,118, 0, 72,144,152,148, 62,210, +239, 66, 67, 55, 31,220,189,175,160,115,170,108,234, 9,248,218, 19,167, 11, 73, 35, 65, 12,162,208,195, 90,118,200, 84,253,128, +118,136,165,226,114,214,202, 49,110,181,204, 52, 4,109,192,246, 41, 45,153, 50, 82, 12, 60, 97, 5, 1,144,220,168,108,149,235, +155,128, 82, 3, 74,220,147, 66, 15,209, 77,209,165, 86,173, 54, 43, 13,167,241,114,241, 53,172,245,150, 23, 53,109,164, 1,178, + 38,137,200, 89, 42, 18,103, 32,195, 13,114, 39, 8,229, 98,169, 12,127,196, 90,105,245,205,187, 87,174,221,164, 49,238, 8, 84, + 6,135, 7,211,215,175, 22, 87,127, 85,171, 59, 45,207,134,253,167,177,189,182, 89, 44,109, 87, 14,190, 47,173,188,255,240,246, +211,231,143,143,159, 62,243,125,216,151, 53,212, 50, 85,144, 65,175,200, 82,219, 11,109, 39,112,188,112,118,230,198,252,252,189, +149,159,139, 48, 74,151, 39, 71,175, 77,141,207,221,185,173, 40, 90,171, 21,214, 27,254,250,182, 27, 80,230, 68, 21, 1,240, 41, +154, 18,227,115,111, 76,210,123,158, 65,241, 88,130,245,106,229,174,140, 45,118,136, 17,239, 5,246, 13, 23, 70,102,207,174,216, +173,131, 62, 66, 20,102,223,198,114,231,101,122, 28, 67,155, 23,108,142,135,167, 91,181,117,207,111, 82, 41, 69,162,158, 6, 36, + 65, 37,227,233,158,255, 40, 29, 29, 12,148, 7, 21, 36, 88, 93,189,233, 87,222,223,225, 45,120,223,173,242,193, 25,201,230,138, +238,117,108, 90,219,234,133,225, 9, 31, 45, 7,133,134, 87, 83,240,108,100, 96,241,134,198,156,152,251,152, 47,207, 36, 6, 75, +149, 63,240, 83, 6, 12, 43,155, 24,178,140, 12,250, 61, 5, 94,205,174,117,193, 72, 36,113,241, 1, 46, 4, 83, 78,238,241,216, + 36,209,243, 29,159,148, 68, 1,197,179,185,244,145, 71, 53, 25, 64,192, 43,176,245, 43,152, 17,140, 98,138,156, 49, 51, 28,129, +186, 37, 66,150, 58, 32,205, 22,184, 72,218,200, 88,134,101,168,216,121,143, 95,141,154,248,200, 79, 24,169,192,137,184,165, 41, +106, 92,213,100, 41,150,151,181,135, 55, 39,231,166, 71, 59,136,214,113,251,166,123, 79,247, 55,130,145, 85, 1,149, 35, 93, 18, +199,153,187,131, 2,246,124, 77, 14, 8,102, 10,207, 87, 66,168,114, 63,171, 34,147, 13, 89, 88, 47,239,126, 93,222,248,225,159, +245,199,103,140,193, 49, 57,102,162,109,140,160,234,178, 6, 1, 47,157,205,157,185, 88, 24,190, 50, 85, 29, 24,127,177,224, 62, +127,244,165,248,228, 27, 64, 0,225,214,165,115,179,133,209, 60,178,218,200,237, 14,249, 42,249, 66,110, 36,174,135, 20,112, 81, +182, 94,183, 0, 17,147,159, 8,171,118,176,209, 55, 17, 40,152,120, 30, 96,147, 35,121,215, 49,233, 72,236,144,199, 25, 78,167, +182,119, 24, 8,249,227,209,158,187, 75,149, 84, 12, 78, 72,150, 64,201,132, 14, 91,101,107,200,251,231, 10, 57, 66,125,187,221, + 28, 73,231,187, 53, 24,170,220, 38,245, 36, 73,229, 32,205,148, 84, 28,162,234,193, 30, 92, 34, 99,100, 5, 84, 1,217,103,145, + 45,246,154,173,219, 40, 50, 40,245,213,135, 0,184, 0,132, 37,227, 20, 37,159, 62, 11,255,172,174,155, 1, 81,185, 40, 57,237, +187,237, 86,159, 65,203, 17,207,209,193,250,252,209,205,212, 83,138,164,252, 75,152,228,137,195,153, 40,129, 91,133,112,242,183, + 79,180,107, 8,194,113,145,232,227,177,225,175, 0,100, 93,201,107, 26, 81, 24,159, 69,199, 25,141, 26,107, 26, 19,173, 70,141, + 9,165, 59,165,165, 80, 2, 9,180, 20, 66, 14,189,244,208, 67,255,154,254, 59,165,135,210, 36,167,208,148,134, 64,123,105, 33, + 75, 33,193, 75,160, 8,198,106, 93,102,156,205,153,215,239,251,222, 51, 38, 4,101, 46,138,206,242,222,251,150,247, 91,174,230, +239,242,196,105, 82, 24,151,132,163,105, 3,141, 23,216,197,238,200,248,141, 61, 19, 97,145, 37, 95,247,244,145,199,110,121,226, +115,142,238, 12,137,150, 37, 9, 55, 85,111,228,198, 52, 61, 21,207, 4,226,167,228,226, 76, 9,166, 13,207,173,224,229,249, 30, + 97,108, 20,117,162,166,143, 92, 83,236,149,178, 0, 30, 88, 40, 4, 44,121, 64, 70, 56, 3,207,250, 85,101,108, 94,128,252, 17, +148, 96,127,253,108,163,213,107, 57,100,132, 70, 74, 71,210, 76, 50,155,210, 19,219,191,118,168, 47, 2,211, 82,235, 15, 7,191, + 27,167,239, 86,223, 30,156, 29,248, 36,172, 75, 58, 92, 98,219,135,238,241,200,114,237,124, 38,223,177,218,186,102,180,205, 14, +226, 49,252,161,237,217,112, 61,165,108,209,116, 77,200,225, 80, 16,129, 41,235, 79, 94,213, 27,117, 56,131, 48,148,117,242, 2, +132, 59,182, 56, 87,251,211,109,224,184, 71, 38, 43, 42, 19, 56,209, 0,231,157, 10,153, 59, 51,116, 5,247,125, 49, 78, 40,134, +134, 26,127, 19, 67,142,144,171, 51,134, 11,229,194,253,219, 75, 63,247,119,156,254,249,222,222, 46, 12,166,181,213,231, 15, 31, + 61,206,229,102,203,213,197,239,223,190,124,250,248, 97,107,115,211, 30,154,134, 30,197,181, 75,138, 88,142, 31, 55,210,213, 74, +109,255,199,193, 96, 40, 21,243, 75,182, 39, 31,158,212,201, 41, 36,124,177,182, 50, 95, 40,124,221,221,125,185,241, 6,170,242, +227,195,227,106,117,249,243,214, 54,162,200,253,208,246, 71, 80, 84,194,196,119, 29,151, 83, 6, 33, 42, 59,158, 53,155,206, 15, + 49, 47,198,180, 3,117,109, 8, 7, 65, 26, 35, 92,232, 10, 31,188,166,106,220, 59, 24,147,195, 48, 72,104, 83, 84,198,137,232, +223, 49,219,112, 76,105, 73,116,224, 99,236, 82, 15, 26, 22,238, 41, 88, 85, 47,114, 19,172,151, 47,181, 4,167,244,164,229, 97, +180, 24,113,212,141,196, 93,161,233,168,136,109, 0,164,184, 49, 54,159, 45, 81,117,133,125,222,158,245,207,208, 12,170,240, 80, +119,136,144, 93,129,176, 34, 83,184, 37,146, 98,187, 22, 71,176, 67, 61, 23,215,226, 29,171, 69,128,135, 24, 97, 73, 37,168,241, +141, 24,106,146,148,178, 11,166,221,189,108,245,192,207,138, 83,222, 73,116, 51, 28,243,117,197,200, 65,222, 64, 60,233,251, 80, + 17, 98,135, 23,106, 98, 23, 29,133,144,218, 29,139,198, 4,100,147,224, 90,252,138,224,222, 58, 30,138,190, 72, 99, 89, 3,133, + 34,158, 74,146,215, 81, 53, 76,192,250,174,169, 73, 73,126,255,102,165,188,254, 64, 50,221, 8, 90,110, 17,208,145,210,119,137, +212, 89, 20, 92,149, 17, 52, 25, 71, 16, 12,226,203, 16,191,128, 32, 65, 8,126, 17, 41, 87,148,146, 25,242, 75, 14, 9,108, 79, +106,142, 65, 96,245,122, 39,245, 70, 63,121, 47, 95, 89, 30, 90,158,231, 99, 75, 1,170, 61,149,210,123,136,185,161, 28,113, 60, + 84,135, 41, 85, 74,133, 98,110,234, 70,230,168,233, 29,237,156, 86, 84,166, 61,189,101,164, 19,137,190,107, 13, 29,210,214, 99, + 42,228,171,190,220,236,120,252,134,195,133,227,200, 97,130,209,197, 59,234,156,101,178,148,175,197,162,122,199,236,222, 45,221, +113, 71,190, 77,197,250,216,155,133,145,230,157,200,205,133,227,171, 44, 92,148,133,130,189,104, 60, 8,196, 61,110,119,209,199, + 48,133,106,115,139, 16, 48,154,221,115,193, 77, 85, 34,233, 68,186, 61,104,162, 71,131,112, 75,151,225,175,203,179,229,191,102, + 11, 33,249, 92, 99, 11, 73,118,241,155,169,185,129,215, 23,163,143,186, 71, 28,217, 51,254, 59, 73,215, 18,141,206, 25,196,253, +161, 99,162, 61, 0, 60, 80,212, 7, 37, 49, 10,153,177,137,135,188, 88, 87,147, 70,154,116,113, 3,190,198, 34,155,132,170, 10, + 54, 97,247, 50,248, 14,129,202,184,127, 72, 97, 58,158, 65, 70, 57, 6, 24,233,162,103,114, 85, 14, 82,102,215,252, 64,224,240, + 95, 0,170,174, 99,183,137, 40,138, 78,121, 83,222, 52,119,167,201, 41, 44,128, 69, 16,160, 0, 18, 66, 32,177, 2,137, 95,224, +159, 34, 62,132, 44,144,224, 15,144, 40,155, 16, 33,164, 36, 36, 81,148,132, 20, 67, 20,143,237,169,246,152,123,239,123,118,156, + 85, 22,142,173,177,124,203,185,237,156,169,248, 46, 75, 96,217, 18, 29,141,121,188, 98, 57, 16,144, 52,109,240,188, 6,109,210, +162, 77,155, 30,169, 58, 12,212,155,140,216, 99,109,248, 27, 26, 37,234,100,128,142, 76, 0, 3,159, 7,216,190, 24,228, 25,201, + 48,138,183,102, 57, 46,220, 10,169, 96,217,127,156,190,136,144,159,138, 49,221,183, 43, 37, 30,196,131, 72,187,254, 69,149, 86, +117, 17, 32, 18,100, 8, 2, 59,138,224, 50, 19,229,212,246,241, 78, 63,141,158,222,126,244, 39,108,107, 84,149, 71, 89, 20,198, + 61,108,207, 50, 29,208,122, 37,168,198, 89, 82,113, 43, 59,167, 7, 96,193,189, 52,194,202,189,200,185,233, 70, 89, 44, 72,133, +144, 93, 99, 52,236, 70,221,165,153,229, 78,212,105,213, 22, 33,157,166,200,122,134, 9,167, 19,247,134, 52,203, 26,229, 69,189, +217,170, 7,205,173,253, 45, 40,118,241,182,222,176,231,170, 11,144, 96, 44,211, 90, 93, 92,221,251,187, 71,196,170, 67,112, 22, +197, 45,108,131,192, 22,138, 60,168,156, 43,220,129, 88,175,218, 76,119, 29, 53,112, 53,223, 81, 33,238, 19,197, 78, 97, 89, 35, + 67, 31,236,110,255,220,216,248,176,185,185, 9, 9,200,247, 52,219,214, 30, 60,123,179,114,103,109,103,235,219,187,245,245,195, +227, 83,240, 13,195, 68,130,179, 44, 45,146,100,216,237,165,229, 74,233,225,189,251,159,191,124, 5,131,159,159,109,150,203,193, +193,254,126,181,204, 45,134, 26,138, 58,202,176,164, 79,158,191, 62, 59,252,245,233,227,251,246,197,249,201,201,137,101,138,214, + 50,160, 32,189,217,168,246,122,113,150, 97,228, 2,244,225,154,165,139,110,187, 32,146,153,235,163, 4,121, 54, 88, 0,156, 31, +210,184, 5,187,112,116,201, 35,112, 44,218,235,100,126, 51,222, 22, 65, 86, 16, 60,131, 26, 76,111,241,142,136, 1,162, 17,204, +132,113,168,169, 55,198,114, 22, 67, 46, 51, 66, 52, 83, 99,201, 17,233,152,146, 63, 97,173, 68,226,233, 96, 93, 87,253,203, 52, +237,195, 35, 50,102, 72,138, 76, 34, 43, 35,106, 19,201,156, 83,230, 21,155, 57, 89, 46, 58, 54, 26,113, 69,224,238,184,169,179, + 12,155,179, 88,248, 79,182, 39,146, 12, 55, 62,123,228,255, 85,183, 6, 79,162,141, 41, 11, 6,228,126,194,234, 77,195,116, 44, + 15,224, 11, 20, 4, 37,175, 2,117,186,112, 34, 58,143,146,138,240, 34, 5,102, 5, 30,131, 10,219,158,171, 44, 48,102, 2,150, + 18,215,118,115,229,249, 56,141,165,109,211, 31, 58, 70,102,182,129, 50, 76,158,101,233,186,243,106,101,233,229,219, 23, 74,224, + 40,117, 87, 9,251, 44, 31, 20, 66, 7,140, 72,225,132,212,170,205,152, 11,121,201, 54, 81, 99, 61, 71, 6, 12, 98, 6, 85, 57, + 84,173,173, 91,138,239, 97,196,200,145, 53, 41,199,215, 32,172, 38, 71, 7,199, 87,198,202,242,221,181, 36, 1, 92,207,185,205, +137,139, 18,215, 17,136,235, 3, 43, 57,220,189,209, 24,247,125, 39, 40, 89,220,159,157,169, 49, 63,248,254,227,140,255, 62,171, + 62,158,183,234, 30,132,248,110, 63,193,181,122, 69, 13,106,172,127,148, 92,230,153, 46,245,165,197, 42,250,200, 53,185,103,123, + 17,194, 35,165, 81,110,236,158,238, 57, 60, 0,199,188,232,180,145,157,148,134,174, 82, 29,123, 60, 51,119,108, 31, 37,107, 5, + 93, 70, 33,195,195,120,146, 49,225,151, 22,225, 76,164,123, 76,245,181,160, 6,128, 44,205, 82, 49, 4, 66, 30, 80,141, 57,150, +139, 48,130,232,129,225, 31,225,171,135,113, 7, 64, 0,120, 99,192, 75, 17, 54,130,208, 34,255,133,231,195,241,106, 22, 4, 42, +215,118, 1,142, 13,229, 77, 31, 45,129,145, 97,147,166, 32,182,127,112, 98,135,119,115,120,114, 2,230, 15,192,177,196,203,113, +222,159, 72, 16, 99,101, 95, 12, 33, 19,200,161,145,208,107,153, 58, 38,165, 21,148, 92,178, 33,224,158,113, 39, 76, 58,116, 69, + 40, 4, 94, 71,215,212,208, 55, 67,252,164,139,174,141, 27, 56,255, 5,160,234, 90,122,154,136,162,240,188, 58, 29,166, 67,103, + 58, 76,121, 52, 5, 27, 4, 76, 8, 46, 48, 46,252, 17, 26,126,158, 91,118, 46,220,185, 49, 36, 36, 74,162,166, 49, 49,138, 26, +116, 97, 88, 65, 11,109, 74, 31,211,121,191, 60,231,220, 59, 69,119, 20,210, 91, 50, 61,247, 60,191,239, 59,165,127,151, 37,254, + 43, 26, 49,229, 8, 69,206,157, 90, 19,165,189,105,220, 95,173,160,150,130,196,151,199,228,108, 38,202, 56, 65,144, 15, 84,101, +141,246,145,230,139, 21,177,236, 86, 50,117, 54,241,159,254, 41,251, 27, 60,147, 39,219,207, 70,238, 32, 35,233,104, 70, 88,205, + 16, 84, 83, 97,178,253, 82, 89,246, 22,229, 14, 67, 66,169,177, 21,214, 2, 25,113, 66, 24,198,172, 92,153,141,239,128,136, 29, + 68,115,219,176,193, 41, 39,104, 76,148,194,139,226,206,198, 14,148, 87,240,114,226,187, 41,113, 23,219, 43,173,150,181, 49,246, +238, 80,216, 5, 83,245,124,228,222,249, 73, 4, 57, 26,156,214, 31,247, 73,255, 40, 51,107,214,138,233,248, 17,210,106,210,130, + 49,152, 49,137,128,211,130, 48,104,212,108,171,214,128,168, 0, 65,133,117,150, 32, 41, 0,251,208,117,243,248,203,235, 77,117, +235,244,253,219,150,181, 62,242,199, 72, 22, 9,230,240,239, 71,105,124,121,115, 9,135, 31,180, 15,122,238,141, 93,109, 4,170, +143, 12,218, 12,140, 65,138,163, 98,230,101, 49,145,130, 20,177, 18, 39, 69,154, 42, 65,136,162, 75, 56,166, 86,114, 77, 45,166, + 51,239,170, 55, 64, 95,130,211, 88,101,230,102, 63,207,127, 45,201,217,163,253,189, 87,199, 47,175,123, 61,184,126, 94,144,122, + 94,234, 67,244,195,221,176, 56,172,180, 45, 99,119,103,251,211,231, 46,216,252,178, 97,116, 58,155, 23, 23, 23,146,172, 10,133, +124,125, 51,252,118,254,253,197,243,163,206,222,227,238,217, 73,183,251,177, 63,188,243,253, 44, 14,243, 48, 97,219,157,242,166, +181, 12, 33,106, 48, 28,163, 59,203,101, 68,172, 39,129, 32,148,228,114,190,167,184,168,202, 85,120, 62, 84, 66,138,170,178, 4, + 49,131,161,131,165,114,228,190, 96,171,137,165,111,166,204,133,164,178,242,156,174, 86,165,160,230, 27, 56, 71,156,134,241, 69, +140,247,178,217,172,185, 44, 45,122,214,100, 99,136,244, 87, 20, 8, 46,144, 41,242,209,100,129, 26,228,135,157,167, 19,127, 12, + 23, 27,217,170,148, 74, 75,140,211, 65,221,237, 21,195,129, 83, 33,231, 66, 34,146, 0,121, 46,220,195, 70,154,199, 72,164,138, +125, 76, 30, 73,163,134, 87,159,164, 68,197,193,183, 34,175,148, 11, 62, 43, 36,168, 40, 58, 17,199, 54, 28,200, 24, 66,132,161, +164,153,144, 66, 65, 48, 15,102, 24, 6,200, 66, 9, 24, 85,214,191,240, 69,104,102,140,235,113,121, 15,223, 13,103,132,249,225, + 19, 87, 15, 87,190,229,229, 76,146, 57,119,174, 36, 3,101,150,174,194,143,194,209,110,251,129, 80, 12,191, 78, 85,165, 46,183, + 20, 97,234, 75,112, 45,176,189,136,145, 86,198,173,188,210, 18,132,154,154, 94, 81,101,112,254, 1,122, 56,220,217,139,254,189, +170,202, 91, 15,133,154,134, 54, 29, 37, 69, 24, 69, 73, 28, 5,145, 59,157, 14,102,149, 90,115,255,221,135,211,147,179, 55,231, + 63, 62, 13,110,251,150,225,216,182,195,144, 43,216,194,193,213, 57,144, 24, 33,253,213,106,154,216,229, 80,180, 90,221,180,157, +198,159, 91, 63,251,125,213, 60, 92, 83,151,117,101, 28,204,163, 24, 30, 88, 69, 83,197,121,126, 57,114,249,176,130,230, 85,120, +149,160, 70,196,118, 76,202,232, 14, 97, 28, 65,238,156,144,239, 86,213,106,211, 92,175,170,170, 7,158, 81, 36,105, 42, 68, 45, +167, 80,190,167,212,109,132,192,140, 74,109, 36,212, 10, 1,160,174,213,145, 97,144,166,166,110, 33,136,150,234,119,182,194, 16, +158, 33, 85, 12,197,154,185,230,197, 30, 36, 94,115,248,210,179, 4,130, 58,124,108, 93, 55, 69,234, 70, 72, 52,177,133, 27, 10, +135, 4, 4,221, 89,181, 86,103,161,219,118, 54,109,189, 49,241,167,140,233,137, 18,124,232,247, 10, 38, 32,161,107, 6,181,223, +120, 40, 42, 97,251, 92,213, 95,197,226, 47,129, 15,229,110,138,229,167,100,190,166, 97,251,225,172,184,239,127,112, 65,127,169, +148, 15,144,184, 28, 82,201, 2, 70,161, 96,179,101,181,198,254, 68, 92,236,238,229,110,189,248,159, 16,122,239,244,255, 10, 64, +215,213,181, 54, 13, 70,225, 36,107,146,166,105,218,181,101,117,248, 49,217, 7,202, 84,100,122, 57,212,255,224,141,176, 63, 32, +120,233,223, 17,188, 16,118, 33,168, 12, 84, 20,239, 68, 4,117,162,136,222,136,204, 58, 97,186,181,107,103,219, 52, 31, 77,150, +214,231,156,211,180, 42,200, 46, 27,218, 44,121,223,115,158,243,158,231, 60,207, 40,190, 51,101,120,228,180, 90,118,202,118,198, +209, 85,163, 23,185, 37,167, 18,114, 67, 44, 81,198,218, 80,188,119, 72,130, 78, 15,169,178,136,177, 31,240, 76,123,124,175,236, + 85, 72, 26, 94, 9, 15,171, 23,115, 37,147,144,144, 65, 14,197,169,246,157,164, 40,128, 89,209,135,146, 93,126,234,232, 25,236, +195,174,223, 17, 42,101,234, 51, 75,199,223,168,124,177,255,137,145, 74,180,226, 12, 79,216,198,146, 93,166,137,224,220,151,154, +154,135,182, 7,149,124, 21,232,137,205, 84, 89,190, 78,149,115, 30, 90,245,164,195,151, 28,178, 50,246,176, 27,184,251,189, 3, + 94, 25, 40,133,156,178, 83,233,248,184,255,161, 27,244,218,126, 87,204,237,240, 41, 32,127,195,109,162,162, 76, 82, 21,116, 30, +181, 85,243, 86,190,159, 68,109,191, 77,119,194,100,218,185,153,147,141,118, 19, 43, 53, 68, 89,224,186,153,186,113,111, 99,189, +222,220,181, 76, 11,165, 64,181, 56,211,246, 58,220, 43, 35, 36,150,168, 67, 36,228, 11, 11, 43,181,250, 86,100, 97,165,211,222, +195, 23, 35,135,120, 33, 9,108,227, 26, 27,149,176,174,101,137,234,160, 2,178, 33,183,122, 1,234,123,149,149, 96, 20, 17,248, +198, 15,247,195,126,181, 58,123,253,198,205,103,143,159,172,223,125,128,167, 14, 96, 71,248,134, 85,141,120,158, 5,161, 1,149, +129,185,186,122,121,235,235, 14,123,227,232, 11,243, 75,175,223,190, 71, 29,150,179,244,108, 70, 65,233,126,109,109,205, 41,207, + 62,186,127,187,177,223, 66,100,232,246,146,110, 47,140, 34, 42,242, 45, 4,143,188,177,184, 48,255,225,211,103,224,128,132, 93, +161, 44,179, 40,214,173, 50, 73,158, 53,109,236, 10,192,196,178, 51, 67, 77, 14,106, 80,199,147,106,115,210,243,255,203, 39, 82, +112,200, 64, 76, 92, 20, 26, 4,103, 85,110,177, 11, 82,197,144, 90, 8,176,100,213, 75,231, 24,137,157, 18,171,198,237, 86,154, +160, 84, 51, 9, 45, 48,133,116,223,104, 98, 67, 97,167, 10,131,132, 72,249, 48,151, 91, 97,185,232, 48, 48,140, 28, 48,149,129, +154,132, 70,177, 2, 4, 2,109,212,108,163,223, 33,248, 74,179,163, 9,114,131, 4, 95, 53, 53, 73, 86, 5,109,164,210,178,216, + 47,142,153,231,214, 28,225,193,146, 93,193,117, 65, 28,250,248, 99, 81, 42,110,237,150,152, 35, 63,210,135, 26,112,141, 49,230, +141,226, 75,162, 65, 63,253, 71, 88,212,141,165,153,254, 48,238,156,136,149, 76,141, 14,158,136,231,167, 83, 23, 68,207,234, 58, +178,233,213,211,199, 77,115,250, 85, 56,247,189, 30, 47, 94,180,149, 78, 71, 11, 9,163, 35,253,171, 76, 47,182,116,195,177, 45, + 59,111,146, 78,117, 20,135, 8,105,228,131, 71,128, 6, 15, 33,123,108, 94, 41, 88,116, 55, 97,148,120, 97, 47,236,251,158,223, +106,181, 95,126,220,190,243,240,214,211,205,231,123,187,181,218,143,218,230,151,119, 47,222,108, 28,122,241,242,210,121,195,208, +137,219,130,187,144,225,146,169, 76,185, 82, 82, 17, 13,168, 47,131,219, 50,138,133,226,246,158,107,124,251, 57,189,114,196,210, +166,162,166, 7,140,129, 75, 45, 67,107,236,246, 3,246, 44, 20,253,143,145,197,199, 32, 22,227,199, 32,246, 83, 46,245, 80,206, +220,221,128,184,137,216, 98,178,218, 69, 63,229,210,185, 43, 59,173, 29, 44, 12, 10, 62, 4,151, 7,210, 99, 95, 62,113,182, 69, + 50,100, 20, 49,184,137, 74,228,105,228,123,212,178, 26,169,118, 15, 1, 85,219, 94, 27,160, 45,224, 19,224, 49,106, 64, 86, 67, +220,192,155,194, 82, 65,134,176, 76,155, 78,216,152,143,159,144,208, 69, 12, 4, 32, 46,234, 26,107,173,201,225,190,112,198,241, +181,184,152, 85,162,232, 5, 22,172, 2,144,156,104,215,201, 75,198, 67,150,110,241,216,117,117, 98,199,138,152,198,217, 93,155, +224,151,161,250, 47,151, 74, 99,162,213,104,205,160,182,251,229, 31,164, 70,237, 67,110,105,168, 36,143, 51, 24,252,175,191,250, + 91, 0,182,174,101,167,137, 40, 12,159,153,182,211,150,222,176,157, 66,169, 96,116, 97, 98, 98, 34, 94, 18,227, 19, 16, 13, 27, + 19,195, 11,152,116, 33,239, 66,124, 0,221,248, 24,186,118,131, 11, 55,236, 64,162, 40, 4, 16, 42,148,206,116,102,206, 48, 29, +255,239, 59,211, 66,140, 93, 54,105,166, 61,167,231, 63,255,229,187, 24,252,187, 50, 13,126,243,189,229, 63, 58,215,232,128,174, + 57,250, 19, 96,160, 65, 38, 80,230, 71,149,141,115,165, 62, 90,104, 45,221, 95, 90,222, 63,221,147,123,213,199,146,225, 73,121, + 94,161,240,103,226,140,103, 24, 13,169,211, 91,136,228,175,156, 17,252,178,214,188, 81,115, 54,103, 89,126, 93,223, 59,245,130, +129, 53, 81,203, 51, 76, 24,201,170,238, 45, 62,184, 24,157,195,183,133,218,208,198,163, 17,178,168, 80, 58,176, 44, 74,148, 79, +129,146,230,140,133, 97, 64,161, 96,211,151,231, 69,154,208, 18,227, 10,160, 96, 27, 86, 98,125,166,222,109,118,247,251, 7, 3, +184,250, 38, 52,148,161,249,168,145, 55,162,195,186, 49,250, 77, 12, 51,135,248,219,174,187,116, 60, 56,234,222, 88,148,139,240, +240,252, 24,132, 47,174,161,148, 81,242,176, 86,181,237,199,195,111,187,219,135, 39, 7, 18,247, 53,164,171,163, 4, 94,127,146, +150,143,243, 18,164, 32,140, 26,203,155, 58,150,252,218,207, 85,109, 57,114, 65,136,131, 23,211,133, 85, 30, 89,206, 21,236,196, + 14, 66,200,129,114,248,100, 1,137, 9,210, 83, 74,190,146,164, 51, 41,109, 45, 17,250,123,189,158,108,224,198,198,219, 39,203, +143,126, 31, 29,146, 1, 4,151, 51, 41, 2, 99, 13,145, 72,137,210, 82,222,174,191, 89, 95,121,190,178,246,234,229,234,234,139, +203,200,223,252,178, 89, 42, 66,157,103, 20,232,133,246,252,218,235,158, 74,226, 15,239,222,159, 14, 35,170,158, 36,142, 5, 49, + 50,227, 23, 93, 47,149, 67, 95,127, 63, 56, 46,228,138, 40,225,211, 36,148,224, 72, 31,191, 28,232, 8,154,172,245, 84, 2,162, + 92,243,246, 20,244,165,172,127, 39, 63,153,201,193,149, 63,140,129,227,102, 0,115,146,210, 76, 47,213, 6, 68,157, 82, 51,102, + 19, 13, 54,110,108, 24, 9, 25, 86,120,138,169, 65, 83,148, 5, 57,185,157, 28, 3,164,132,104,100, 32, 26,236,157,196, 17,242, + 71,184,155, 40,243,171, 60, 34, 72,180, 42, 24,139, 81,146,159, 89,152, 97,204, 65,108, 39,179, 93,181,232, 66,147, 71, 35,254, + 82,187,141, 57,180,233,193,153,144,181,141,136,236, 78, 67, 29, 82, 49, 31, 9, 32, 27,186,152, 21, 74,254, 30, 3,105,135,196, +168, 51,187,128, 64, 64, 10,222,164,233,152, 41, 41, 77,241,144, 36, 82,165,110,173, 37, 15,146,192, 41,231,168, 84,152,169,148, +170,236,127,142,217, 53, 70,242, 14,164,163, 92, 87,146, 95,217,246, 67,215,141,231,159,158,169,162,231,235, 91, 69,219,105, 39, +170,239, 81, 95, 14,245,164,236,110, 77, 62,223,106,170, 74, 37, 9, 2, 95,210, 99, 13,155, 83,128, 39, 81, 17,230, 27,157, 91, +232,237,228,225, 63,144, 72,106,227,123,222,112,180,181,189,251,241,243,167,177,246,238, 86,213,157,138,234,150, 85,203, 81,146, +224,124,221,217,146,220,254,241,242, 51,167, 4, 73, 3,167, 40,197,118,193, 41, 22,154,157,166,197, 6, 0,135,153, 96, 78,215, +103,235,191,246,207,111,187,150,186, 89,117,250,163, 32,146, 75, 84,149,202,185, 31, 59,103, 3,169,158, 33, 89,236,200, 6,115, +193, 1,148, 77,148,233,254,211, 69,146,140,113,170, 37, 0,109,160,249, 83,108, 35, 98, 0,188, 97,254,231,201, 30, 46, 96,122, + 66,169,107,153,195,201,217, 17, 9,121,108,237,210,106,208, 6, 27, 54,202,166, 65, 22,181,177,168, 86,108,162,144, 4, 37, 89, + 27,148, 14,105,226, 0,138,156,111, 86,220,139,232, 34,146,136,103, 43,183,214,246, 34, 15,109, 70,147,145,103,176,190, 41, 85, +223, 64,251,240,106, 87,219, 82,247,215, 74, 53,176,216, 36, 25, 45, 55,180,113,112, 37, 34, 70,195, 90, 97,170,161, 96, 93,119, +251, 2, 0, 97, 18,205,101,255,165, 68, 8, 33, 1,146,102, 62, 88, 42, 19,174, 79, 39,221,201, 9,168,113, 42,149, 97,113, 14, +223, 10,244,200,200,245,252, 55,196,255, 21,128,173,171,233, 77, 34,138,162,143,199, 48, 51,204, 76,219,225,171, 20,144,166,209, +218, 68,170, 13,154, 24, 22,174,220,187, 48,113,227,143, 48, 49,254, 30, 55,174,252, 39,186, 48, 90,211, 90,154, 52,214, 47,154, +212, 82, 45, 20,152,150,129,129, 25,207,189,111,160, 93,184, 35, 16,224, 13,188,185,247,156,251,238, 61, 39,158,111, 66,158,225, +244,193,230,244, 9,249,199,107,247,135, 61,117, 14, 25,171,127,104, 38,231, 24,213,182, 76,137, 11, 36,244,231,233,161, 58,160, + 86,225,117,202,234,158, 82,168,150, 24, 42,110, 80,147,173,166,123,106, 96, 79, 92, 53,121,198, 31, 59, 39,159, 92, 69,145, 82, +249,103, 18,119,187,183, 86,255,219,107,227,147, 79, 7, 39,227,208, 87, 58,250,185,197,194,122,113, 3, 17, 36,140,139,167, 9, + 62,190,227,238, 99, 33,139, 11,203,160,204, 12,199, 98,107, 96,101, 63,153,140,253, 35,227, 41, 21, 53,169, 72, 1,129,142,210, +117,164,244, 49,219,140,226,127, 48, 12, 43,201, 52,128, 71, 21, 41, 52, 43,205, 13, 32, 38,252,202, 19,110,108,225, 16,128, 8, + 11, 6, 62,226,242, 14, 57, 57, 52,110, 63,220, 59,218,199,167,151,115,149,220, 98,174,227,117,169, 49, 92,242,225, 13,195,210, +128,165,175,184, 44, 16, 2, 71,212,202,119, 59, 67, 42,218,164,132,230,228, 72,249,207,214, 83,174,173,217,105,205,208, 9, 23, + 21, 28,195, 77,107,102, 58, 1,236,172,169, 33, 74,141, 46, 68,215, 19,184,245, 77, 93, 24,228, 79, 37,134,151,147,198,131,198, +211,103,207,177,164,223,173,195, 87, 47, 95,124,250,240,190,211,237, 33, 32,144,248, 72,136,248, 78,125,157, 1,200,119, 48,254, +254,173,185,253,241,221,231,237, 15,251,123,187, 59,187, 59,167,103, 39, 32,218,193, 36, 26, 92,250,247,235, 91,143, 30, 63,105, +125,109,190,126,243, 86, 76,129,208,185,194, 9, 34, 63,162, 72, 0, 34,190,236,218, 7, 63,142, 61,207,167,115, 48,170, 12,178, +255, 54, 39,233,155, 43, 27,157,193,153, 99, 46, 78, 25, 86,207,231,173,229, 53,163,178,153,175, 47,109,207,140, 5,202, 53,148, +137,185,146, 24, 21,155,139,110, 9,183, 7,240, 65,196,174,156,202, 27,145,247, 82, 50, 49, 87,102, 98,125, 46, 32,116, 82,107, +137, 61,122, 8,212,146, 96, 40,141,116,234, 90,146, 14, 66,211,100,171, 77, 37,104,118,153,139,117, 14,232,118,155,130, 44,107, +188,108,122, 39, 80, 27,137, 64,243,110, 14,216, 18, 14,171,217, 90,173,183,207,219, 51,147,208, 25,214,226,165,131,174, 89,122, + 26, 17,146,166,142,185,222,170,156, 57,165, 82,206,102, 14,141,239,202, 91, 89, 63, 24,202,184,195, 93,169,226, 9,226, 28, 72, +231, 19,154,146, 3, 73,197, 82,195, 48,136,251,187, 56,217, 45, 57,110, 16,128, 10,203, 74,174,210,243,122, 64, 12, 84,120,148, +212,161,193, 71,187, 4,253, 86, 50, 21,223,191,208,137,151, 72,236, 1,106,140, 20, 99,211, 46, 21, 55, 26, 74,170,232,232,168, +123,235,142, 35, 58, 93,178,121,156, 40,135,113,109,169,144, 23,107,235,194,202, 68,125,176,202, 62,181, 65, 6,156,199, 8,176, +200,229, 66, 89,184, 11,216, 76,184,188,201,185,215,233,122,157, 94,255, 75,115, 95,246,142,171,166, 40,234,194, 73,138,108, 82, +100, 82,194,209,168, 91,171,217, 58, 88,205, 87, 55, 55,235,248,201, 77,195, 48,112, 49,102, 42, 95,206, 3,104,144, 10, 77,138, + 36,137,241, 64,205,126, 95,180,142,179,181, 69,205, 15,131, 62,225, 27,211, 73,201,182,252,213,239, 71,241,191, 59,225,122, 11, +141,139,143,184, 37, 22, 79,214,170,155,120,213, 27, 94,148,178, 37, 63,240,177,203,170,217, 27,150,137,235,208, 71,228,161, 26, +225, 49,190,161,182, 90,235, 93,118, 9,106, 96,179, 38, 73,229,190,228,150, 1, 56,116, 36, 14,145,168,100,171,212,180,198,131, +185,105, 61,237,218,153, 5,219, 69,182,182,116,199, 54, 44,132,111,229,195,198,174, 36, 52, 80, 25,242,201, 63, 8, 61,130,123, +196, 27, 11, 43,241,198, 30,179,182, 68, 24,251,243,197,199, 66, 10,103,196, 26,202, 92,130,193, 58,241, 58,238,175,252, 82, 97, + 48, 60, 31,141, 71,138,225,113,241, 38,154, 41,152, 70,179, 25, 39, 25, 93,233, 75,203,235, 92, 54, 8, 3, 37,196, 50,227,174, +244, 30, 26,124,100,221,242,235,109,147,115,249, 0, 46,211, 19,227,156, 21,100,254, 19,226,255, 9,192,214,181,244, 54,113, 69, +225, 51,111,123, 30,241, 35, 9, 49, 45, 9, 1,129, 68, 23, 21,226, 87, 84, 72, 44,250, 7,250,219,186,233,166, 82,119,236, 80, + 85, 41,234,162, 45,139, 22, 68,204, 83,164, 96,203, 4,219,113,226, 25,123, 60,206, 60, 57,223,185,118, 77,171,122,101, 89,215, + 99,107,238,157,243,252,206,247,173,249,197,180,149,120,124,154, 47, 91,254,182, 95,250,104,109,161,161,161, 74, 40, 21,184,197, +101,214, 14, 77,112,113,168,188, 82,124,182,150, 11,247,205, 6, 72,131, 28, 64,255,234,218,215,175, 79, 95, 32,244, 16,126, 53, + 99,237, 0, 27, 94, 59, 90, 76, 42, 82,140, 87,255, 35,225,118,181,125,109,112,222,127, 55, 58,225,159,225,173, 26,156,245,240, +228,192, 56,150,227,104, 52, 91, 68, 10, 67,106,232, 27, 39, 38,141, 74,103, 56, 27, 34,192, 17,131,160, 28,174, 80, 96,115,218, +149,233, 6,254,117, 33, 33,129,232,119,113, 84, 5,137, 12,191, 22,224, 24,161,188, 77, 34,186, 4,112, 90,184, 12, 29,195, 69, + 48, 88,138,136, 17, 27,244, 12, 53,119, 81,178, 43, 59,205, 47, 70,225,199, 28,148,104,169,234,164,113,236,118,244,252, 8, 3, + 53,134,209, 59,235,245, 39,125, 97,206, 44,111,236, 29,142,163, 51, 62,106,149,190,166,153, 40, 74,187,238,222,216,187,249,250, +244,165, 38, 37, 85,190,124,224, 25,230, 37,137, 82,137, 14,234,235,165,158,161,212, 32, 58,174,200,199, 65, 17,174,137,102, 8, +216, 95,193, 74, 69,101, 97, 64,169, 41, 39,142,191,239, 63,120, 64, 91,222,211,159, 31,158,188, 58,254,241,135,239,163,240,220, + 6,160, 5, 1, 62,129,225,168,148,100,133,109,152,246,248,113, 55,203, 65,184,202,145, 31, 63,150,150,133,126,164,105,150,173, + 64,187,119,247, 54, 81,222,253,235,143,186, 93, 52, 27, 22,186, 73,149, 54,135, 68, 33,210,208, 70,221,234,245,199,195,179,144, +119,155, 31, 8,199,244,219,126,112,122, 62, 80,251,117, 50,124,169,163,230,190, 92, 51, 22,192, 74, 62,235, 61, 81,150,157,211, +184,188, 74, 93,203, 19,186, 96,152,242,150,191, 27,138,212, 14,123, 23,223,105, 76, 19,160, 87,129,165,193,168, 11, 31,149, 90, +145, 39,251,237,131,160,238,119, 7, 93, 5,110,175, 27,117, 54,154, 18, 14, 24,241,114, 94,173, 74,249,134,242,225, 37, 80,243, +215, 57,163,194, 49, 48, 29,215,118,121,113,195,107,145,212, 82, 5,224,204, 73,116,118,187,115,231,237,240,141, 0, 16,149, 38, +116,241,101,243,160, 63,121,239, 73,245, 15,115,231,201,244, 34,158,136, 4,250,103, 8, 4, 57, 95, 40, 67,148, 69,156,204, 92, +199,173, 89,108,229, 23,255,209,159,226, 59,201,215, 73,179,148,159, 82, 19,252, 65, 84,201, 88,175,208, 78,233, 66,145,168,244, +152,116,232,220,208,138,148, 15,212,155, 89,234, 58,245, 28,226, 49, 72, 35, 48,205,153,165,166,174,111,192,116, 18,152,153,154, +157, 36, 51, 93, 21,101,165,182, 11,154,107,189,234,236,223,163, 92,255,237,247, 71,191,254,249,232,239,193,224,238,246,119, 87, + 58,141,234, 98,202, 91,110,147, 22,248, 30,221,186, 67,123, 87, 41, 92,144,227,193,170,150, 66, 16, 38,231,179,170,146,217, 52, + 12,226, 43, 20, 56, 64,212, 27,122,154,230, 23,243,203, 50,137, 14, 93, 26,165,212,141, 41, 46,169, 99,209,129, 67,135,232,206, +210,226,156,126, 57,250,233,254, 55,223,250, 30, 12,185, 97,152, 54, 7,190,190,101,100,194, 3,140,212,202,158, 77,162,229, 60, +110,237, 52,199, 67,155,198,115,106, 58, 91, 91,181, 50, 98,119, 75,150, 91, 42,201,239, 84,177,252, 42,143, 45,108,157,138,240, +170,219, 63, 6,110,149, 72,230,213, 97,236, 62, 92,124, 80, 35,211,188, 5,251,187,215, 57, 7, 58, 25,191,123,246,254, 56,112, +125, 37,170,196,247,161,210, 87,242, 9,252,226, 27,152,164, 49,135, 98,187,222, 78,114,137, 90, 25,223,252,182,191, 13, 92, 47, + 85,211, 56, 84, 82,100,106, 94, 37, 95,105,198,107, 66, 40,132,203, 41, 37,144,149,204,129,148,131,180,226, 31,213,110,188,225, + 24, 31,131,159,151,139, 53,122, 4,133,130,173, 96,103, 18,141,228, 43,108, 78,139,221,198,222,199,233,233,122, 38, 68,145, 16, +107,245,154,183, 16,213, 48, 94,213,246, 90,170,243,247,153,226,134,166,112,114,255, 22, 66, 80, 31, 42, 99,169,134, 75,170,117, + 72,160,198, 41, 48,254, 10,204,236,134, 38,126,179, 70,189, 62, 9, 64,213,181,244, 52, 17, 69,225,219,153,206,163, 83,218,210, +148,214,130,202,195,136, 26, 9,198,196,196, 7, 6, 22,198, 13, 18, 19, 19,151,254, 52,183, 46,116, 97, 2,198,224,206, 68,127, +132, 11, 19,131, 38, 45, 88,152,210,233,180,157,206,116, 94,158,239,220,105, 17, 54, 44, 40,147,222,185,247,158,243,157,215,247, +101,248,157, 96,187, 28,254,166,245,145, 39,244, 99, 31,205,221,204, 61, 79,159, 53,208,144, 79,145,210,132, 73,223,146,199,183, +183, 8, 68, 96,140,115, 86,240,189,144, 35,200, 50,236,132,190, 19,168, 90,171,108, 95,152,182,132,229,143, 2,186,168, 57,101, +181,126, 99, 20, 12, 37,213, 80, 54,207, 11, 61, 32,184, 92,215,115,232, 97, 60,200, 78,199,210,129, 5, 44, 84, 64,120, 16,177, +128,162,212, 73,130, 43, 69,140, 54,101, 6,201, 45, 47,172,144,169,165,239,193,222, 12, 22, 32,207,127,229, 74, 55,178, 75, 6, +200, 76,164,242, 51,140,206,214,173, 71, 65, 50,105,206, 55,237, 65, 47, 64, 31, 32, 76, 43,221,180,142,115,154, 50,137,249, 0, +243,114,162, 89,109,246, 71,110,136, 44,129, 98, 21,224, 12,232,229, 52,170, 77,122, 84,173, 84,103,174, 21, 65,176,142, 71, 88, + 85, 49,165,100,161,119,245,122,247,205,185,109,119, 7,221,144,213, 66, 50, 37, 2,132,159, 9, 8,205, 71,142,116,210, 32,141, + 75,209,167, 98,229,149,185, 66,174,108,169, 53, 75, 95, 40,104, 37,138,124, 83,130,224, 24,176, 81,225,105,210, 96,130,219, 51, +246, 65,227,232,209,246,248, 16, 74, 37,220,182,212,168,127,251,124,248,254,195,199,190,227, 31,253,110,133,254, 68, 39, 99,144, + 71, 20, 68, 40, 51,137, 83, 90, 27,194, 50, 93, 43, 24, 6,194, 41, 45,111, 25,154,206,122,155,150,161, 88,166, 82, 44,104,247, + 55,239, 85,203,197, 79, 7,251,127, 79,206,226, 36, 55, 30,135,163, 17,176, 35, 24,104,233, 12, 4,201,241,169, 11,182, 6, 36, +179,227,128, 43,159,233, 76, 22,129,211,162,220, 20, 78, 22,170, 76, 81, 39,249,191,172, 50,201,234, 28,116, 4, 23,231, 23, 93, +175, 79,104,143, 86,218, 29,158,113,217, 27,255,130, 28, 8,163,155, 76, 32, 8, 80, 5, 49,187,227,245,112, 97,184, 5, 94, 87, +244, 36, 75,172,251,108, 70,231,192,224, 33,121,241,209,202,101, 72,172, 60,134,221, 23,245, 74, 99,232, 15, 98,230, 81, 24,131, +225, 43,199,180, 36, 26,189,248,155,215,238,182,237, 63,229, 2,160,156,156, 51,162,152,195, 15,188, 90,169,225,122, 61,153,141, + 1,141,196,108,160, 48, 75,161, 96, 79,117,244,138,232, 17, 75, 64,251,208,108,203, 77,103, 78,166,233,116, 5,237, 39,136,108, +210,148,229,153,192,241, 59,137,163,156,184,208,183,144, 33, 75, 30,157,254,138, 4,114, 80,124, 65,120, 68, 16, 1, 13, 57,186, +170,141,130, 65, 42,185,147,210,105,219, 0, 95,101,130,252, 38,168, 32, 66,153,148,211,161,130, 29, 45, 85,150,158, 61,125,181, +255,229,237,225,215,119,194,235, 69,147,120,221, 72,214,159,108,134, 39, 61,122,157,104,179, 89, 93, 19,235,119, 4, 55, 30,164, +238,160,111,119, 8,216,227,168, 71,153,161, 55,139,149, 74,121, 94,148, 77,161,231, 21,103,124,106,247, 90, 93,199, 59, 57, 10, +199,238,129, 45,190, 15,197,207, 64,180,125,224,247,101, 10, 25, 85,225,167,162,213,179,159,111,239, 93,185,186,136,250,134,169, + 21,203,115,249,166, 37,180,156, 48, 17,194,196,238,200,235, 13,104, 27,117, 13,228, 13, 21,191,163, 22, 13,117, 28,201, 12,179, +127, 30,254, 56,238,114,179, 47, 87,207,152,109,140, 66,162, 88, 72,128,138, 62, 25,100, 23,177,177, 56, 60,181, 82,149,190,111, +163,220,136, 88,202,137,110,159,174, 26,228,179, 95, 60,216,109,219,237, 32, 12, 76, 2,157,220, 90,234, 5,158,153,215, 87,234, +107,238,208,121,249,112,175, 81,105,252,234, 28,209, 83,118, 54,182,139, 6,250,223,232, 20,109,111,236,180,206,143,105, 71,174, + 47,172,210,229,193,164,100, 22, 65, 33,142,144, 89, 24,218,236,170, 85, 13, 89,253, 85, 72,191,195, 89,190,172, 41, 19,179, 23, + 5,114,225, 17,234,183, 25, 98,133, 28,102,228,209, 47,208,212, 0,224,171,144, 31, 24,116,177, 28,254, 4,167,221, 48, 75,197, +138, 93, 56, 81,166,110,208, 90, 12,205,228,250, 77, 34,166,137, 74,217, 44, 64, 27, 29,161, 88, 40,100, 35, 9, 59, 26,105,224, +211, 75, 40,126,150, 7,185,220,152, 46,254, 75, 6,209,207, 63, 1,184,186,178,158, 38,162, 48,122, 59, 51,237,116,182,118,104, +139,108, 26, 18,136, 75, 32,110, 9, 49, 26, 19, 53,209,159,232, 47,241,133, 23, 19,125,247,197, 24,136, 1,138,128, 75,105,161, +208,101,166,237,236,227,249,190, 59, 8,241,169, 47, 77,151,123,231,219,207,119,206,149,127,215,170,176,177,213,214, 26,252,111, +153, 73, 22,185,157, 31, 74, 98, 94, 88, 81,152, 76,157,138,131, 42,178, 85, 91, 56,238,182,207,189, 62,101, 91,185,224,153,190, + 30,165,197,164, 72,130, 70, 11, 36,114, 73,129, 87,145,145,133, 57,109,212,186,233,162, 62,130,181, 92,140,207,175,138, 87, 50, + 98,150, 79,163,244, 26,169,101,202,205,126,217,111,131, 69,173, 52,105, 94, 44,183,206, 80,109, 73,170,166,245,197,123, 8,128, +146,215, 67,202,244, 12,125,188, 71,184,196,215, 76, 34,115,118,213,122,118,247,197,209,249, 15,201,216,159,211,170, 75, 89, 18, + 55,243,102, 67,102, 27,150, 23, 76,124, 42,202,124,215,158,171, 16,247, 93,213, 11,166, 81,134,236, 9,230, 83,225,242, 48,245, +102, 19, 90, 85,231,195,199,173, 76,145, 26,228,153, 63, 29,225,215,250,225, 4,214,136,242, 25,134,141, 68, 38,229,172, 8,127, +200, 54,104, 28,255,117,239, 75, 16,134,196, 38,150,230,248, 46,169,101,205,252,162,164,114,103,232, 4,213,226, 39, 68, 81, 51, +219, 31, 5, 89,160,102, 19, 53,153,168,121,164, 90,138,233,154,213,150, 99,184,166, 49,111,215,156,178,169,103,154,173,170, 53, +161,214, 52,205,212, 84,124,166, 90,208, 58,136,195,131,246,247,253, 61,252, 71,183,166,151,137,201, 49, 43, 19,211, 86, 22,195, + 29,226,151, 69,164, 82,204,120,137, 98,172,129, 32, 90,213,224,136, 21,135,140,154, 34,135,239, 37,187, 59, 7,159, 63,126,218, +111, 31,225,185, 66, 8, 97,126,157, 92, 87,242,166,169, 85,202,217,175,110, 52,131, 87, 79, 89,116,188, 16,172, 36, 63,133,243, +129,219,165, 6, 14,202, 36,214, 16,161,106,143,239, 68, 45,118,184, 5,113,192,149,114, 26,148, 9, 97, 84, 17, 89,136, 71,137, +243,229, 18,220, 43,241,101,114,181,251,120,245, 73,111,212, 41,118,202,255,241, 54,163,100,227,152,114,203, 93,134,107,131, 65, + 82,152,199,137, 19, 17, 30, 1,230, 36, 48,151,208, 31, 81, 96, 27, 53,156,240,234,252, 90,119,208, 33,221, 46, 24, 73, 28, 91, + 21, 11, 95, 71,172, 82, 89,218, 27,157,226,233,218,188,253,168, 55,232,112, 3,143,214,143,145,140, 15, 39, 3, 9, 43,160,190, +182,166,227, 51, 29,221,134,249, 95, 55,151, 20, 86,127, 78,105,213,121,169,177,236, 7,190, 66,210, 25, 4,127,148,244, 71,140, +199,164,137, 14, 78,131,132, 13, 88,158, 2,217, 6, 67,152, 67,110,241, 11,165,152, 70, 40, 87,172,230,130, 87, 97,137,117, 35, +102, 72, 62,155, 73, 86,209,116, 14,148, 20,216, 53,234,219,145, 81,147,150, 55, 53, 52, 98,218, 84, 66,202,204, 75, 76,120, 8, + 94,109,190, 78,210,224,195,246,251, 13, 91, 60,112, 69,179, 44,180,104,182,245,246,101,214,235,195,169,216,142, 37,158,110,137, +122,157, 56, 6,166, 73,230,249,195,254,105, 80,224, 35,165,174,122, 86, 42, 27,141, 90, 67, 53, 13, 81, 55,137,117,243,108,116, +216,235,143, 47,186, 71,253,225,246, 88, 72,244,181,199, 53,251, 67, 75, 88,170,152,102,162,227,137, 55,207,223,173,111,220, 71, +109,168,195, 69, 45,212,197, 28,247, 0,198, 81,114, 57, 78,162,144,192, 21,212,134,167, 8, 84, 29,158,104,142, 65,192, 95,220, + 56, 50,235, 65,248,237,184,175,240, 22, 18, 3, 0,100,171,189,144, 80,146,250,213, 18,169,132,211, 67, 9, 74, 55, 14,223, 29, + 19, 80, 82,225, 76,113,169,185,208,247, 46,194, 48, 24, 76, 7,166,110, 45, 53,150,162, 40,108,218,205,149,230, 29, 60,132,254, +204,183,116,243,248,236,100,185,185,252,231,252, 39, 46,107,191,211,190,240,251,139,245,133, 75,127,176,251,123, 7, 33, 1, 41, +136,107,187, 19,234,246,148,100,108,144,137,138,101,216, 9, 35,104,103,201, 12, 1, 80,146,204,112,227,150,124, 35,201,204,178, +183, 66,210, 16,165,177, 82,220,167,116,204, 76, 48,164,144,246,100,154,199, 43,141,219, 7,221, 61,138,191,162, 88, 63,150,163, +245,152,166,184, 5,142, 48, 32,220, 14,179, 43,164,185,236,226,231, 55, 70,170, 45,167, 53,225,145, 94,233,154,221, 62,183,245, + 26, 3,192, 10,181, 20,229,106, 20,123, 3, 34, 89,250,207,197,203,151,191, 2, 48,117, 37,189,109, 27, 97,116, 56, 34, 69,138, +146, 44,111, 73,106,217,112,146,214, 1,138, 54, 61,244,220,254,231, 30,218, 67,110,233,165,183, 2,205,226, 54, 70, 16, 32,105, + 44, 91,114,108, 75,150, 68,137,219,112,216,247,190, 17,141,222, 4,219,176,200, 89,191,229, 45,254,189, 59, 12,150,232,191,211, + 79,108,156,238, 30, 94,221, 93, 72, 77,133, 81, 57, 66,230,180,164,172, 88, 82,172,176,115,247,250,187, 5, 53,242, 42,111, 35, +191,103,116, 75, 31,108, 29,126, 89, 78, 88,151,113,233,132,218, 80,214, 61,186, 47,209,176, 24,159,227,168,139,252, 23,123,123, +167,187,127, 83, 79, 42,209,215,151, 4, 39,192,220, 20,196,132, 34,162,203, 93, 29,179,129,254,168,239,143,127, 28,253,245, 91, + 45,244,171,101, 45, 46, 57,214,126,152,188,151, 60,196,106,145, 4,118, 67,141,103,186,158, 79,100,245,120,139,116,241,251,223, + 47,145, 58, 85, 20,132,160, 78,200,138,160,120, 18,176, 59, 81,132,251,252,213,167,183,210,140, 81,152,108,188,209,233,231,119, +178,223,184,200, 56,247,142, 95,171,156,137,100, 11,159,145,109, 20, 98,142, 78, 35,180, 32,148,114, 13,235, 57, 69, 93,121, 85, + 30,183, 98,124, 62, 25, 62, 27, 79, 39, 56,155,240, 63,211, 89,218,139,251,244,183,106,121, 56,168,147,252,130,185,160,173, 58, +237,238,245,226,234,217,240,155, 89, 50,111, 43,196,212,241, 79,223,254,252,226,213,175,203, 76, 45,178,146, 99,209, 34,199, 49, +249,124,115,180,115,178, 54,183,198,155, 14,247,227,135,219,113, 63,234, 51,134,164,160,184, 54,134,148, 40,241, 5, 66, 54, 90, +173,123, 65,101,112,252, 25,196,221, 54,167,124,221,138, 56, 55,196,147, 94, 78,135, 61,143,170,200,148,113,171, 3,109, 67, 60, +144,221,136,204,226,167,108,148, 69,218,216, 20, 57, 91, 23, 33,144,176, 63, 42, 75, 66,128, 87,233, 94, 80,191, 31,165, 37, 75, + 67, 1, 5,215,168, 26, 96,241,130,121,149, 35, 3,192,174, 75,168, 55, 71,219,121,242, 20, 5, 20,204, 7, 36, 4,216, 56,190, +162, 76,144,231,180, 77, 87,217, 74, 20,123, 8,190, 50,100,247,165, 71,187,135,227,187, 75,140,243,217,232, 84,114, 21,249, 67, +237,227,128, 38,246, 92,211,118,249,249,211, 31, 78, 63,190,110,211,137, 74, 75,179,139,195,142,147, 1,103, 75, 81,225, 14,182, +190,208, 20,227,176,135,195,244,236,252,141,243,204,192, 33,184,214, 54, 8,219, 97, 29,166,121, 42, 44, 4, 22, 43,255, 25,189, +193,104, 48,201,243,188,173,112,144,149,171, 48, 8,240,157, 37, 45,144,124, 9,165,179,212, 20,123, 91, 7,211, 4, 33,136,247, +120,255, 24, 73, 24,145,145,148,137,151, 26,186, 50,126,205, 58,254, 86,180,189,204, 22, 13, 87,131, 37, 23, 82,231, 75, 43,170, + 6, 86,184,123, 37,222, 37,164, 6,138,230,150,161,235, 0,209,166,108,253,105,132, 11, 61, 92, 75, 14, 33,134, 7, 30,116,119, +146,245, 34, 47,210,198,166,194, 19, 22,106, 93,212,153, 34,252, 68,236,201,180, 72, 21, 72,248,131,131,250,232,193,241, 31,127, +254,114,220, 98, 11,116, 94,169, 8,239, 81, 38,138,162, 17,186,131, 81, 31, 14,213,193, 35, 85, 56,181,111,182,103, 93, 21,228, +222,119,148,176,136,100, 49,157, 45,191,186,233,168,189, 88,237,246,119, 6, 49,130, 24,227,119,102, 86, 27,101, 3, 33,130,227, +136,157,139, 26,120,215, 87, 93, 92, 48,228,180, 91,191, 31,249,200, 31,219, 1, 37,104,240, 18,215,169, 50,165,160, 43, 56,103, + 84,104,196,170, 88,182,144, 85,225, 88, 87, 81,136, 43,162, 93,150, 88,105,219, 81,180, 48,233, 70, 15,172,250,159, 34,161, 72, +138,139,121,233, 26,191,196,106,199, 68, 32,118,204, 12,242, 81, 44, 7,253,245,163,147,203,217,120,116,125,238,171, 0,145, 89, +160,131,172, 88,143,103,147, 39, 15,158,122,100,141,183,175,230, 19, 58, 10, 4,225,151,217,120,158,220, 61,220,198, 12, 78, 7, +157,193,243, 39,223, 93,220, 94, 34,200, 97,187,222, 86,171,108,121, 54,154, 98,204,247,250,251,217,221,186,214,206,192,134, 56, + 25,167, 16,216,208,164, 93, 95, 80,132,206,145,102, 17, 13,236, 42,208,190, 79,176,207,166, 5,106,239,153, 75,196,118,211,171, +224,242,246, 28, 1,184,164,236,133,171,244,117,130,120, 69,148,185, 67,220, 52,237, 96,247, 45, 77,133, 90, 55, 85, 25, 45,187, +218,121,253,110,160,188,114, 75,164,249,210,186,150,165, 20,106,106, 1,213, 84, 27,230,135,106,240,145, 94,221, 24, 87,220, 51, +165,254, 19,128,171,107,217,109, 26,136,162, 51,182, 99,143,237,166,177,211, 60, 90, 90, 90, 5, 80,213, 46, 64, 8, 16, 21, 18, +143, 86,172,224, 15, 96,195, 2,144,248, 52,190,130, 5, 27,132, 80, 69,139, 64,160, 42,208,138,182,105,210, 36,205,163,182,235, +196,142,205,189,119, 76,169, 88,103, 19,123,102,174,207,185,115,238, 57, 18,191, 39, 2,109, 13, 24,217,212,165,100,118, 72,130, + 36,118, 97, 20,133, 10,170,208,197,225,201, 33, 54,125,184,252, 75,137, 66, 70, 75,131, 0,231, 80, 84,150,137,244, 53,174,162, + 59, 7, 58, 33,198,197,124,209,195,214,161,186, 88,169, 13,130, 19, 98,193,158,173, 79,193, 99, 44,207,175,162, 59, 15,230, 51, + 68,217, 77, 85,166, 18,165,102,147,130, 82,188,250,209, 14,153,140,103, 12,197,194,171,170, 8,115, 43,165, 60,158,203, 6,158, + 98,235,230, 66,169,182,126,125,189,213,111, 39,147, 72, 24, 86,140, 62, 62,234,121, 43,171, 52, 93, 9, 66, 96,214, 73,181, 80, + 61, 13,189, 44,231,137, 67,225, 14,154,131,227, 73,102, 90,159, 57,209,203,228,117,156,111,154,196,133, 41,167,239,247,225,119, + 32, 46, 24,237, 6,135, 71,183, 49,129, 26,101, 91,184, 94,183,174,220, 22,134,240, 67,111,214,189,132, 18, 32, 85, 61,236, 30, +192,147, 75,208, 10, 64, 50, 8,125,242, 5, 53,224, 73,129,196,193, 62,184,115,117,109,167,249,163, 96,186,221,179,147,189,246, + 94,156,140,111,215,238,146,255, 81,223,202, 25, 69,203,133,215,127,173, 90,179,132,213,232,237, 67,205,248,210,175,127,172,239, +126,168,239,109,255, 62,216,105, 30,109, 29, 53,127,118, 58,245,227, 54, 67, 25, 60,192,144,132, 27,214, 56, 66,160, 81, 16,198, +140,101, 45, 78, 79,151,129, 1,152,162, 98,137, 89,203,188,236,216, 37,203, 40, 0,155,213, 0,101,164,192,145, 96,153,161, 82, + 5, 33,162,251, 24,155, 25, 28,157, 99, 85, 46, 68, 90,152, 74,243, 38, 0,168,148,143, 89,163, 17, 28,116, 3,148, 0, 1, 29, +144, 6, 78, 24, 84, 34, 28,211,189,183,252,160, 53, 60,166, 84, 13,110, 96,112, 16,240,117, 84,152, 9,205,212, 13, 51,142, 35, + 37,179,136,200,166, 60, 21,169, 75, 5,142,101, 58,154,162,160, 22, 77,213,232, 50, 10,171,161, 0,142,162, 81,114,160,140, 91, + 72,101,128, 60, 2,249, 39,107, 79,183,235, 91, 8, 91,165, 97,136,228,239,240,239,146, 17,154,124,163,229,150, 0, 44, 8,231, +214,157,154, 1,148, 4,235, 10, 75, 54,231, 94,238, 12, 91, 80, 85, 95, 60,126,245,249,215, 38, 74,181, 73,184, 62, 91, 92, 40, +231,203, 94,224,147, 53, 21,166,152,146,143,105, 40, 47,209,198, 24,168,139, 87,177, 64,227, 80,147,147,166,128,241, 81,212,129, +109, 35,140, 55,153,115,230,161,238,224,248, 5,222,107, 69, 60,253, 59, 77, 35,109, 36, 9,153, 0,205,157,100,129,205,168, 68, +116,237, 25, 31,246, 63, 81,235,135,171, 27, 65,136,113,232,240, 45,177,114,150,212, 2,194,126,184,177,116,115,159,124, 17,102, +157, 5,172, 11, 82, 61,146, 2, 26, 48,221,124, 9,246, 15,154,229,161,148, 10, 79, 43, 10, 35,121,162,115,254,104,229,222,167, +205,183,115, 90,244,222, 99,239,250,172, 57, 98,243,106,186,241,112, 45, 29,120,170,161,243, 91, 55, 89,169,140,224,253,108,204, +224, 27, 61, 56,237,181, 27, 97,132,137,186,177, 12, 73,162,221,174,219,142,165,229,114,182, 1,251, 27,248,105,243,176,221, 28, +122,195,110,251,187, 39,187,211,232,178,187,172,179,251, 46, 19, 10,107,141, 88, 47,100,207,159,189,116, 86,106, 12, 74,185,105, +200, 25, 45,244,149, 55,160,240, 42,120, 46, 53,156, 40, 82,108, 17, 28, 53,180,222,110,174, 82, 98,182,142,163,229,147, 73,208, +241,118,247, 79,189, 9, 70,188,103, 30, 9, 73, 26,115,186,111,165, 90,230,218,142, 63, 58, 35, 56,229, 3, 72,122,253,228, 13, +188,135,206,160, 11, 75,209,234, 53, 97, 53, 23,171, 75,167, 80,157,210,120,161,180,152, 55,243, 0,240,219,131,150, 31,162, 33, +112,127,216,173, 85,106,115,197,170,166,139,222,160, 3, 24, 25, 62, 12,182,110,125,253,253, 13, 88,184,108,179,200, 59, 30,178, + 32, 69,146, 9,135, 17,142,249, 76,190,140,178,247,113,152,100, 80, 94,182,106, 72,146, 66,162,185, 17,245, 12, 46, 94, 94, 42, +255, 18,213,101, 88, 1, 26,124, 6,177, 79, 94,167, 81,154,205, 45,203, 6, 15, 7,204,165, 80,255,129,157,123, 35,147, 89, 9, +229,250, 42,236, 66,101,151,170, 89, 57,118,171, 82,231,132, 76,147, 56, 77,111,164,255, 44,246,206, 29,235, 46, 32,245,255,154, + 51,231, 63,255, 17,128,171,107,105,109, 34,138,194,119,230,206, 76, 38,147, 76,154, 54,105,107, 66,171, 88, 43, 62,170,136,130, + 32,130, 43, 55,130,123, 23,186,240, 39,184, 17,252, 91,130,248, 3,196,133, 66,105,165, 20, 91, 20, 73,218, 36,109,218, 36,205, + 60,146,201,100, 50, 47,207, 57,119,162,226,174,165,139,134,185, 55,103,190,115,206,247,200,230, 51, 5,213,132,134, 8,225, 21, +166,217,197,194, 42, 83,154,191,160,196,172, 7,174,196,198,165, 27,126, 48, 17, 52,178, 98,206,224, 28, 35,208,140, 92, 30,229, +127,226,209, 48,140,181, 77, 72,193, 69,131, 29,109, 26,144,159,148,148,146, 11, 32,167,143,158,162, 12, 78,226, 61,167,203, 83, +121,206,100,158,231,119,208, 59, 19,123, 58, 69, 79, 50, 94,176, 44,236, 13,138,121, 19,147, 15, 25, 0,130, 28, 57, 77,255,209, + 54,161, 67,208,192,233, 53,206, 26,112, 78,112, 93,111,213,111,117,237,174,104,111, 69,128, 61, 58, 7,208,142,196,241, 71, 73, + 54, 0,196, 85,235, 60, 11, 18,143,132,246,233, 49,185,209, 99, 75,142, 6,134, 26, 20,238, 17,142,255,100, 9,138,175,162, 64, + 75,170, 57,158, 83,175,172,155,133,242, 8, 37, 15,236,116,120,210,119, 7,104,147,228, 57, 23,227, 11, 92,168, 38, 41, 96,121, + 84,106,144, 45,118,136, 98,229, 88,248,219, 96,242,118, 20, 53, 6, 13,248, 72,181,114,221,245, 29, 4,188, 36,244,232, 1,146, + 77,211,171,171,155,238,116, 4,189, 94,107,216,108, 89, 13, 57, 85, 55,106,235,137,102,193, 87, 7,254, 55,180, 35,110, 18,184, + 51,239,220,179,154,246,112,247,180,243,169,209,216,105,181,131,136, 89,179,240,116, 52,253,101, 89,159,143, 58,251,221,179, 15, +135,205,175,205,206,118,111,240,205,181,247,135,150, 21, 76, 31,175,215,234, 75,165, 69, 93, 95,206,231, 77,158, 51, 36,213,144, +148, 69, 85, 41,202,188,172,113, 3,250, 12, 85,129,239,176,174, 49, 93,225, 35, 59, 58,108,216, 29,219, 23,235,184, 88, 4,218, +211,152, 28,215,191, 50, 63,232,236,161,141, 23,221, 35,204, 92, 68,143, 83,124,225, 97,225, 19,252,244,121,162, 34,249,169,136, + 49, 26, 82,214, 48,236, 16, 37,154, 40,141,137, 89,178, 98, 46,195,177,248, 51, 47, 78, 66,161, 9,204, 84,202,217,124, 91,218, +253,185, 67,116, 20, 25,192, 93,125,113,205,134, 94,144,120,148,162,177,197,228, 24, 28,158, 38, 80, 37,161, 85, 39,112,195,160, +191,214,181, 2, 20, 2,149,107,223,143,246,161, 16,171,208,171, 16,130,178,198,195,187, 87,238, 6, 81,128,154, 38,137, 87,139, + 85,192,227,164,139,153, 9,130,185,136,124, 64, 5, 63, 6, 90,224,146, 4, 69, 91,180, 41,186,182,186,121,114,209, 22, 2,171, + 12,204,201,217,246, 33,175, 27, 4, 71,144,232,137,108,156, 52, 41, 81, 18, 33,166,105, 5, 30, 41, 97,176,184,180, 47, 90,102, +174,224,135, 83,192,167,208, 37,247, 0,114, 98,176, 89,114,238,118, 37, 12,192,225,128,132,162, 12, 68,146, 21, 71, 20,250,193, + 24, 61,124,209,207,133, 19, 51, 76, 86,144,172, 45,151, 52,237,209,245, 7,205,189,143, 83,137,189,183,217, 48,101,103, 49,187, +109,242,231,207,158,176,225, 88, 94,169,176, 7,247,241,169,123, 33,155,248,108, 18,206, 92,199,237,183, 67,226,182, 10, 63, 79, +161,216, 82,116, 67,209, 10, 37, 56,200,106,145,153,134,218,119,155,125, 39,114,251,214,120,210, 39,227,161, 75,156, 61, 95,100, + 91, 69,132,233,205, 49,203,151,170,175,223,188, 99,203, 11, 88,208,225,173, 0, 93, 3,252,144,227, 56,130,231,184, 94,200,204, +159, 20,201,222,254, 82,212,103,124,173,194,114, 42, 81, 61, 98,239,216,254,209,113, 38,200, 35, 98,100, 2,134, 72, 85,149,149, + 50,244, 46,216,184,144,164,139,218,190,122,165,214,183,251, 95, 15,190,180, 6,173,178,185,112,231,242,205, 90,101, 5, 14,101, +165, 88,237, 33,173,142, 3, 70,196,100, 5, 42,119,175,158,190,244, 67,191, 61, 56, 25, 78,112,151,118,239,206,195,238,105, 27, +110, 29, 60,228,213,165,213,115,187,247,238,197,219,155,107, 91,199,189,163, 73,232, 3,178, 12,162, 41,220,116, 47,128,151, 46, +135,195,154,204, 60,114,120, 23,201, 46,172,108, 44, 69,104,197, 30, 11,126, 59,116,216,108,158,201, 44,232,227, 44,253,223, 0, + 12,126, 47,151,170, 65,224,163,225,140, 68,166, 81,217,130, 38, 19,154,102, 67, 54, 38,200,179,132,122, 16, 76, 43, 80,105, 52, + 52,143, 80,201,100,123,238, 62, 60, 39,110, 73, 20,188, 70,110,111,114,154,196,236,175, 45,157, 36,255, 83,150,255, 89,210,254, +241,233,251,251,135,223, 2,112,117, 45,189, 77, 99, 81,248,250,117,109, 55,169, 19, 82, 82,104,161, 45, 3, 82, 85, 81,196, 2, +186, 64,108,217,176, 0,214, 72, 51,187,249,143,136, 29, 18, 11, 16,172, 16, 11, 52, 72,157,118, 4,105,147, 52,175,218,177, 29, + 59,142,109,206,119,174, 93,164,145,186,107,155, 38,245,185,247,188,190, 71,117,191, 51, 13,140,154,249, 4,146,170, 32,104, 59, +121, 45, 21,162, 87,222,218,184,192,167, 33, 68,118, 52,174,139, 87, 28, 35,142,105,251, 84,180,234, 16, 27,217,190,182, 19, 38, +129, 35,215, 42, 27, 7,186,185,212, 98,145,245,135,233,207,122,174,199,117, 13, 94,170,221,236, 36,192, 42,169, 12, 6,136,241, + 13,111, 43, 76,124, 0,101,160, 2,175, 92,247,244,218,210, 27,169, 13,246,211, 69,198, 86,235,185,218, 88,149, 21,232, 16, 0, + 30, 68, 62,179, 18,232,153,157,207,206,107,250,139, 74, 83,218,118,103, 59,162, 24, 42, 85, 26,199, 15,239,116,247,134,193,128, + 10,109,105, 73, 44, 47, 25,221,222,105, 92,247,177, 60, 4,242, 93, 65,173, 21,179, 92, 97,225,120,114, 69,109,160, 78,151,248, + 12,190, 95, 74,221, 27, 43, 7,122,207,116,158, 43,231, 29, 81,186,114, 45, 94,198, 76, 49,197, 18,220,115,219, 17, 87,241, 89, + 70, 13,124,185, 70,223, 77,147,157,141,221,139,224,162, 33, 27, 12,224, 67, 41, 96,234, 54,189,243,131,219, 15,190,157,125,189, +211,221, 15,146,160, 41, 59,195,249,112, 28, 47,150, 89, 97,177, 31,170, 45,133, 37, 97,151,172,252, 54,165, 48, 93,195, 10, 52, +241,229,248,191,147, 97,255,231,197,216,199, 41, 41,114,203,118, 60,207,166,156, 0,138,141, 54, 8, 23, 31,143,207, 38, 97,121, + 58, 90,245, 3,150,251, 74,139,112, 5,128, 76, 74, 61,120,110,100, 32,128,148, 73, 82,250,151,197,232, 34, 63,233,165,195, 32, + 98,229, 22,101,221,128, 98,215,212, 41, 16,243,166,235, 81,170,230,138,210, 96,145,141, 82,237, 36,109,203,181,177,239, 90,233, +138, 10,173, 87, 6, 12,108,144,133,241,130,169,129,163, 68,105,207,192,248,101,169, 44, 29,114,158, 44,171,127,154, 52,156,202, + 59,164,110, 28,149, 94, 43,189,132,212, 29, 58,195,147,112,116, 21,199,154,146, 35, 96,151,109, 96,153,229, 26, 79, 87, 27, 74, +205, 63,136,125, 93,233,253, 10,140,140, 4,174,224,117,106,152,226,116,209,159,246, 22, 84, 36, 66, 25,125,149,230,171,101,154, + 66, 78, 86,171,165, 29,113,248,114, 12,156,202,218, 75, 24,204, 97, 41, 13,139, 26, 2, 38,211,225, 51, 53,153,207,117, 37,151, +221,118, 91,209, 34, 20,191, 53,164, 48, 45,196,244, 83,183, 14,247, 30,142,253,145,231,224, 89,148, 44, 82,168,235,230, 50, 75, +166,193, 72,225, 59,181,106,217,128,133, 4, 11,206,176, 23, 20, 79, 89,111,111,236,196, 80,196,211, 20,121, 3,194, 97, 2, 51, + 58,248,123,148,226,225,173,253,203,211,247,212, 17,127,138, 69,131, 5,231, 30,183,188, 23,207,158,104,243,185,184,127, 32,238, +222, 21, 73, 38, 22, 41,234,247, 36, 75,102, 35,127, 50,200,212,166,178, 88, 85,146,126,192, 60,152, 86,163, 45,203,194,166,196, +126,179,221, 18,218,184, 55, 29, 71,225, 35,195,247, 68,241,120, 93,251,243,102,249,180,133,207,212, 91,136,239, 19,241,242,249, +235,195,191,255, 18,208,213,144,168, 5, 76,173,250, 82,197,187,142,130, 83, 56, 70, 49,155,140, 63,188,187,190,191, 37,186,109, + 36, 0,150,132,141, 78,166,239,143,207,141,218,225,186,100, 53,189, 21, 20, 47, 98, 38,235, 84,128,105, 58,224,105,150,109,182, + 54,233,110,117, 37,149, 28,230, 60,158,255, 59, 56,141,146,152,170,239,113, 52,123,117,244,178, 63,237,175, 59,205,205,246,214, +101, 56, 9,227,197, 96,114, 78,105,155, 98,207, 22,178,119,246, 67,112, 33,101, 75,247,222,214, 31,244,224,222,124,126,251,189, +247,207,152,231,108,123,221,221,105, 56,117, 88,243,156, 90,132, 56,141,143,238, 29, 81,180,100,160, 76, 34,114, 64,254,101,124, +173,162, 65,243, 76,171,184,213,217,189,140,102,170, 94,108, 53,174,165, 80,200,160, 70,150, 57,161,240,103,161,162, 59,132,120, + 36,156,210,240,171,235, 14,101, 76, 29,172,157,154,219,221,114, 58, 41,104,204, 53,231, 67,136,141,102, 23,198, 86,232,128, 69, + 81, 1,103,202,255,121,107, 80, 4,186,102, 3,164,151,202,198,242,138,243, 81,109,114,180,223, 75,214, 43,240,140,130, 30,171, + 41,183,248, 37, 0, 91,215,210,219, 52, 22,133,239, 77,237,248, 21, 59,113,211,166,106,128,210, 42,154,169, 16, 20, 74, 97,168, + 6,216, 49,252, 1, 54,236, 16,191, 1,161,249, 29,179,224,223, 32, 16,171,217, 50, 26, 13,176,128,153,161,165, 29,210,196,141, +237,248,109,199,246,156,115,110,194, 75, 72, 85, 23,145, 90, 63,114,158,247,124,223,119, 4,127,181, 54, 20,179,223,238,219,198, + 50,132, 45, 36,124,115, 9,226,187, 24, 77, 34, 9,153, 36, 97, 85, 25,133, 27, 27,232, 81, 10,209,246, 16, 26, 66,120, 24, 78, + 80,244, 98,154,122, 2, 23, 92, 9, 64, 4, 69,249,115, 43,155,126, 60, 1,155,134, 63,135, 90, 88,172, 33,134, 26,104,173,179, + 14, 14, 79,228, 88,164,131, 66,248, 67,160, 62,118, 6, 92,109,106, 55, 6, 55, 63,156, 30,124, 58,219,252, 36,192,198,231,116, +100, 52, 16, 9,213,150,249,178,110,171,138,177, 98,173, 34, 32,135, 84,250, 54, 87, 7, 49,138,202,242, 53,123, 61, 68,175,195, +218, 28,156,159,136,161,115, 25,167,150,110,249,161,183,187,181, 7, 55,127,166,187, 49,116, 63,138,104,126,121,235,234,251,209, +223,240, 92, 59,231,175,124,196, 15,139, 54,202,140,100, 53,158,103, 20, 94, 52,145, 36,217,212,173, 20, 82, 69,197, 44,195, 46, +201, 95,182,207, 94,114,105,232, 42,242,123,199,236, 14,253, 99,146, 91,169,197,202, 21, 93,213,243,178, 0,131,131,162,227,167, +193,141,135,119, 31, 60,251,243, 25,124, 17, 16,102,193, 20,178, 50,167, 98,132,128,247,146,220,179,214,178,178,104, 54,154, 80, +129,166, 51, 68,116,157, 68,113, 18, 87,126, 92, 6, 17, 11,195, 58,138,234, 52,135,208, 91, 39, 25,242,182, 27, 53,119,166, 33, +184, 66,111, 89,179,219,134, 5,253,148,170, 66, 96, 52, 84, 89, 70,121, 29,108,178, 52, 25,181, 48, 54, 44,184, 86, 12,169, 37, +137,101, 55, 40,156, 96,234,184,241,112, 18, 29,141,253,163,113,112, 52,154, 30,142,252,131,113,112, 60,241,195, 52,135, 50, 7, +209,122,184, 92,138,139, 52, 77,117,252,140, 72, 61, 56, 81, 36, 5, 90, 94, 54,230, 10,229,112,159, 43, 70, 15,149,152,208,194, +150,192,220,179, 50,179,141,110, 78,100, 99,113,208,140,144,252,178,248,245,222,227, 87,239, 95,215, 52, 81,199,141,111, 36,175, + 10, 53,212,172,202,186,173,158, 44, 73,208,158, 67,185,208,108, 42, 80,234,130, 31,234, 74, 43,157,197,109,181, 3, 78, 8, 21, +108, 75, 53, 51, 4,222, 48, 18,191,197, 22, 31, 73,219,137, 91,139,137, 10, 91,146, 80, 60, 75,129, 82, 23,126,247,236,126, 71, +239,224, 10,129, 89,145, 22,137,221,234,192,229, 48, 13,160,176, 98, 19,252, 28, 12,120,197, 92, 69,130, 94, 93,169,146, 78, 88, +184,106,103,227,218,233,116,172,224, 14, 59, 13, 66,179,166,104,126,228,238,108, 94,133,214, 77, 87,113,207,248, 92, 48, 71, 60, + 58,162,194, 82,246,165,110, 59,159,163, 12,224,157, 57,129, 67,192,105,200,255, 57, 1, 70, 57,253,224,244, 20,158,139,102, 60, +165,160,164, 67,214,217,221,216,243,194,137, 40, 21,137, 54,149,192,183, 43, 20, 37,169, 38,166,182,151,212,173,161, 75,185,125, + 97, 63,248,231, 57,196,191,223, 49,179, 96,124,191, 63,232,223,250,249, 18, 43,114,118,237, 10,179,108, 60,156,137,114, 22,103, + 12, 94,223,232,191,208, 27,205,104, 80, 76, 2, 15, 11, 61,250,170, 84, 12,139, 47,193,173, 32,118,149,157,233,246,211,226,237, + 48,144, 51,247,110, 43,187,220,170, 47, 90, 56, 61,255, 55,173,255,114, 88,187,221,123,244,219, 19, 54, 88,199,248,222,144,191, +163, 69, 43,145,128,160, 34, 79,158,190, 80,179,177,126,113,147,217, 26,126, 72, 91,125,227, 55,163, 63,142, 60,218, 57,142,202, +249, 11, 38,168, 24,113,114,161,220, 69, 7, 17,204,212, 90,167,177,151,100,113, 94, 20,144,215,193, 12,240,116,174,169,117, 76, +219,241, 28,232, 66, 81,156,165,154,157,184, 39, 12, 15,172,160,119,224, 99,223,249,101,239,206,203,119, 47,183,207,254,184,191, +189,127, 56,250, 96,233,230,240,244,196, 13, 61,248, 15,215,127,184, 14,245, 59, 92, 98,125,249, 28, 52,220,216, 44,214, 44, 72, +166,240, 66,240, 52, 21,251,115, 70, 4,186, 26,154, 9, 67,183, 42,140,108, 8,169, 66,249,107, 94,107, 8,190, 8,231, 11, 56, +234,249, 38, 3, 40,100,117,213, 50, 81, 48, 39,130, 71,192, 17, 11,137, 68,129, 81,164, 89,210, 64, 86,187,152,244, 96, 16, 72, +145, 86,205,191,216,124, 7,229, 84,138,194, 53,139, 53,132, 96, 12, 52,243, 43,191,129,195, 20, 21,110,105, 89, 44,132,225,139, +133,216,252,171, 16,255, 89,161,105, 14,237,226, 11, 9,154,255, 5,160,235, 90,118,219, 54,162,232, 80,156,161, 36,202, 20,109, + 61, 16, 41,118,100,187,134,171, 32,109,146, 38, 14, 16,167, 93, 4, 69, 16, 32, 89,120,145, 85, 22,253,149,162,251,254, 65,127, +161, 64,127,160,187, 46,186,233,174, 77, 28,164, 5,106, 55,150, 93,201,162,101,201,122,152,164,248,204, 61, 51,148, 27, 32,232, + 7,216,210,140,238,220, 57,247,206,185,231,100,243,171, 12,117,119, 68,177, 88,179,106, 82, 90,156,203, 54, 55,218,212, 69, 81, +130,140,151,166, 95,175,180,166,148,193,165, 6,136,208,197,114,169, 2,203, 49, 65,103,160, 32, 21,180,117,211, 40, 41, 37,101, +161, 67,104,250,229,227,111,246,143, 94,209,249, 33,120,245,240,211, 71,221,193, 73,214,201,215, 41, 0, 10,231, 51, 39,128, 50, + 46,254, 67,164, 6, 82,114,122,185,104,123,240, 80,158,131,255,158, 46,132, 10,180, 76,112, 89,241, 82, 41, 66,247, 30,189,232, + 15,123, 82, 35, 94,163,141,163, 95, 66, 22,182,209,106,101, 77, 8,163, 51,120,167, 58,155,178,241,157,100,144, 76, 82, 63, 50, + 83,118,152,114,184,244, 65,221, 81,207,143,230,135,253,195,207, 90,183,157, 73, 63,136,227,225,229,168,140, 36,105, 59, 99,135, +162,202,204, 91,182,105, 95, 64, 30, 54,173,149, 27, 82, 39, 50,157,199, 94, 42,141,153, 27,203, 77, 47,116,125, 60,109, 70, 4, + 75,193,141,137,161, 95,234,207, 93, 2,238,150,185,156, 7, 23,219,167,203,121,181,210, 32, 48,226,140,250,180,198, 39,119,159, +254,248,235, 79,101,179,188, 89,223,164,163, 74,169,156,130,169, 85,221, 64,235, 70, 58, 58,118, 6, 7, 94,224, 79,252, 17,221, + 91,180, 21, 86,209, 10,184,143,106, 73, 79, 5,199,194, 66,136,239,164, 65, 8,227, 61,170,115, 41,125, 11,193,235, 86,201, 48, +132,105, 24, 43,132,121, 10,186, 81,228,101,105,176, 89, 18, 26, 37,119, 56,254,240, 92, 65, 19, 24,200,167,178, 20, 45,130,178, + 47, 5, 32,161, 13,144, 74,253,133, 68, 21,151,148, 80, 68,136, 57,199,228,254,230, 87,157,179,163, 43,194,176, 96,162,108,174, + 40,255, 51,181,153, 20, 27,148, 47,138,130, 32, 54,204,234,100,160, 39,180,105,202,221, 91, 14,133,210, 37,151,240, 28,223,110, +222, 34,240, 78, 23, 60,102,143,153,248,171,251,150,227, 88, 42,138, 43,163,155, 12, 86, 1,152,216, 14,130,112,126,167,117,111, +226, 78, 84,123,148,190, 19, 21, 85, 84, 49,204, 35, 87,158,192, 56,207, 11, 48,100,136, 99,182,136, 9,180,254, 18, 53, 81,130, +117,192,145, 38, 13,219,171,237,238,240,196,245, 38, 99,255,162, 81, 89,205, 1, 43, 97,114,147, 86, 66, 53,184, 41, 76, 47,242, + 66,217,103,167,123,136, 22,127,103,125,135, 46, 6, 66,208,244, 5,250,227, 83,200, 52, 10,131,210, 14,129, 59, 23,163,140,113, +127,212, 3, 49, 6,207,104, 56, 26,176, 25, 73, 1,122,150,208,114,129,208, 24,135, 52,175,158,209,216, 50,154,165, 46,109,198, +192,175, 47,228,139,148,243, 77, 99, 41,123,136,214,168, 66,245,171, 86, 93, 85,177,178,233,148, 58,211, 83,233, 73, 34, 95,150, +160,212,203, 56,144, 59,122, 89, 43,102, 53,136, 61,206,153, 65, 71,210,176,227,200,255,250,243, 47, 71,189,215,109,109,250, 79, +196,143, 3, 86, 96,233,119,187,237,181,237, 22, 91, 50,217,253, 29, 36, 1, 2,239, 72,238,132,226, 47, 39,255, 30,186,238, 37, + 91, 88,233,128, 10,145, 42,189, 97,180,164, 69,201,206, 37, 73,145, 54,180,105, 27, 13,219, 26,248,191, 15,231,211,139,113,129, +177,195,203,228,239, 89,180,127, 70,120,213,252,246,251, 31,204,189, 39,178,151,205,255,103, 30, 30, 63,105,248,199,155,238, 47, + 63,223,184,247, 9,219,172, 49,211,192,169,143, 0,144,206,127, 59,222, 31,204,116,164,119,233, 51,151, 42, 63,151,204,123,143, +182,122,253,218,198, 12,103, 54,197, 28, 89,154,205,183, 43,107,103,193,243, 91,205,173,222,249, 41,237,205,238, 23,143,115,113, +252,246,228,207,170, 93,207,201, 33,166, 11,119, 68, 71,169,115,118, 76,127,126, 58,118, 14,186, 7,181,149,250,241,160, 67,177, +170,195, 65,220,104,220, 88, 7,133, 78,218, 41, 18,126, 87,194, 71, 20,240,207, 31, 60,235, 56, 71,106,210,136, 62,119,187,121, +115,226, 77,135,179,129,132,204,241,205,181,219,131,177,147, 74,130,188, 2,206, 32,196,203,198,134,212,203,131,159, 29, 40, 6, + 80,174,193, 3, 97,178,104,202,168,215,151, 80,186, 75,106, 82, 68, 40,107, 88,178,133,175,160,162,112,253,103,176, 11, 62, 17, + 38,212, 63,208, 31, 94, 56, 4,227,181,201, 50, 45,152, 6, 94,209, 34,175,176,187, 34,101, 45, 6,169, 62,202,242,218,123, 1, +248,186,182,157, 52,162, 40, 58, 55, 25, 97,160, 92, 21, 5, 21,176, 49,154,214, 86, 77,211,167, 38,125,105,210,164,111,125,244, + 11,250, 19,253,137,190,246, 11,218,175,232, 47, 52,209,216, 23,175,164,222, 96, 64,100, 96,152,129,185,156,238,181, 15,208,151, +166,111, 70,130,227,204,156,179,247,218,251,236,181,214,140,191,138,161,130, 49, 1, 53, 90,220, 80,178, 13,231,226, 33,177,244, + 62,182, 22,210,180,232, 60,223,165,229, 74, 15, 20, 34,250,132, 32, 41,180,137, 16,225, 32,242,153, 66,206,121,153, 29,118,104, +115,158, 52,143,233, 7,158,196, 82,236,254, 29, 6,231,119,222,118, 6,173, 88,178,253,217,215,137, 69, 24, 38, 60,232, 6,114, +129,105, 96, 48,145,207, 69,213,189,250, 65,215,237, 42, 98,110,124,131,114,155, 18,195,114,174,250,171,121, 52, 28, 13, 13,157, + 21, 48,248,194,107,133,218, 8, 29,246,248,213,211,215, 41, 35,217, 3,189,141, 82,140,193,252, 99, 33,101,221,148,153, 32,105, + 44,152,106,203,246,123, 33,207,104,209, 75,245,131,201, 74,174,210, 29,118,112,114, 26,141, 29,207,161,191, 64, 1,221,238,183, +165,138, 25,130,151,164, 57, 48, 61, 55,159, 46,218,131, 54,189,197,103, 27,187,251,245,253,211,251,211,247, 7, 31,206,111,207, + 8,177,114, 33, 34,214,139, 85,172, 60,183, 71,111,133,106, 67,103, 52,216,170,224, 60,249,164,121,228,120,125,182,177, 53,186, + 78,155, 50, 77, 33, 93, 44,231,203,116, 47,246,192, 94,202, 86, 48,126, 67,216, 65,139, 41, 95,250, 17,197, 32, 87, 24, 34,192, +233,166, 26,178,242, 61, 67,103,133, 66, 60, 40,158, 24,169,231, 39,169, 24, 24, 45, 17,122,146, 0, 77,202,208, 76, 61, 1,138, +182, 48,120,136,154, 64,242,130, 38,204,200,242, 5,186, 70, 65, 20,121,190,199, 60,118,192,199,188, 85,165, 26, 11,117, 41,218, + 82, 97,202,128,167, 48,125,246,187,115, 21,197,211, 97, 40, 90, 70,104,177, 71,236,175,194,220,139,244,226, 19,143,141,114,164, + 64, 27,194,125, 34,149,179,114, 67,175, 15,215, 74, 52,184,165,250, 4,104,201,116,167, 73,211, 66,115, 70,213, 41,123, 17, 4, + 70,123,103,198, 32,210,103,134,116,172,219, 21, 60,184, 29, 47,112,179, 86, 65,142, 66,210, 22,226,189,129, 79,243,169, 28,165, +100,250, 61, 65, 15,186, 74, 53,183, 70,245, 1,136,218,233, 18, 1, 40, 29,222,123, 84,107, 6,160,242, 68,176,223, 76,176, 70, + 60,237,243, 84, 34,133, 2, 95,195, 1,128, 11, 99, 22,208, 47,232, 95, 90,128, 36, 58,228,169, 9,227,219,206, 61,143,226,161, +207, 77,183, 9,221, 5, 76, 34, 3, 0,213,203,155,245,229,134,237,216,172,142, 32,168,132,197,244, 20,183, 17,168,140,123, 28, +118,117, 28,242, 91,148,245, 89,248,126, 10, 77,132, 58,183,199, 86,229,216, 49,206,114, 99,168, 99, 98,226, 45, 10, 9, 73,244, +134,221,132, 46, 5, 68,165,114,134, 54, 29,136,134, 46,182, 38, 59, 70, 9,221,244, 38,131, 66,102, 73, 4, 1, 60, 38,181, 80, + 21,147,189,250,206,218,114,121,124,249,243, 77, 73, 43, 26,218, 11, 45,254,116,248, 78, 73,166,149,218,138,178,181,141,182,204, + 40,224,195,213,137,232,245,250,183,151,120, 34,220,120,103,240, 46, 52, 73,216,199,155, 12, 22,173,140,145, 72, 38,226,216, 48, +116,101,189, 84, 90,205,231,156,224,184, 31, 53,219,143, 45, 47, 58,115,194, 70,227,229,231, 47, 95,179,135, 31, 57,115,235,255, +115, 13,186,190, 57,253,246,189,210,200,153,251, 13,140,229,152,186, 84,215, 84,252,241,245,143,230,185,235,105,108,230,203,242, + 31,216,147, 40, 46,205, 84, 72,224,151,141, 62, 34,182,205,150,241, 1,205, 17,230,249, 55,202,141,155,135,187,205,114,237,178, +213,164, 47,157, 92, 28,223,116,110,159,215,118,233, 91,244,136,168,238,217, 88,170,245,221,135, 1,206,216,243, 16, 35, 18, 49, +193,112, 74,165,208,200,130, 14,179, 90,162, 42,217, 29, 93,180,206,101,247,117,107,117,155,210,118, 54,153,189,104, 93,129,128, +202,151, 49, 12,147, 34,187,203,100, 52,138, 41, 84,222, 81, 1, 49, 14, 70,144,223,159,185, 48,177,102, 42, 48,163,116,158,147, + 89, 89,150, 67, 82,183,101,222, 24, 23,115,221, 83,161, 9,101,238,163,141,197,158, 49, 51, 4,207,164,245, 20, 45, 3, 54,212, + 53,211,139,105, 47,240,255,237,208, 17, 43, 99, 22,104,209,254, 66,251,185, 2,136,152, 69,121,117,166,226, 58,237,242, 72,230, +197, 31, 1,232,186,150,214,168,161, 48,154,247, 36,211,100,146,113,236, 60,250,152,150, 74, 21,139, 21, 44,184, 16, 10,130, 22, +116, 87, 23,138,110, 92,186,113,225,194, 95,228,194,181,127, 64,112,231, 31, 16, 41,130, 90, 41,214,193,169,125, 76, 38,105, 38, +201,228,225,119,190,155,218,110,132,217, 14,121,221,251,221,243, 61,206, 57, 85,124, 39, 88,192,173, 72,165,172, 56,178,216, 78, +160,195, 40,186, 80,237,160, 69, 21, 38, 1,243,116, 75,110, 24, 82,112,153,206, 88, 14, 59,216,150, 4, 84,133, 8,156,170, 26, +109,194,185, 44, 46, 88,135, 34,118, 65, 97,171, 6,159,110, 48, 46,131,104, 20,196,190, 38, 99,184, 85,135, 0,157,129, 65, 55, + 74,165,185,195, 96,214,234,244,199, 60,175,180, 94,134,254, 80, 8,111,158,155, 74, 73,165,169,211, 50, 52,113,132, 24, 53, 10, +179, 6,164,150, 11,214,191,212, 8,142,197, 73,124,232, 15, 9,149,255, 51, 53, 81,225,188,149,155,102, 61, 73, 18, 49,149,195, +248,189,208,117,115,235,230, 22,133, 81,202,209,232,121, 41, 84, 69, 20, 80, 44,155, 14,100, 66,127,174,221, 60,137, 40,190,235, +151,189,238,198,202,237, 76,202,224, 34,196,239,144, 82,141,126,123,153,114,151, 81, 68,107, 17,194,226,148,244,208,162,249, 61, + 26,238, 14,191,229,152, 53,207, 84,122,105,114, 70,171,205,115, 90,132, 67,157,154,157,150,211,185,230,252,224,100, 95,136, 93, +176,204, 3,136,178,204,126, 2, 23,118, 56, 30,202,138,118, 58,193, 20, 38,133, 33,219,114,172,154,117, 28, 29,112,179, 58, 39, +192,202,230,219, 28,135, 10,161,106, 36,140, 41,133,156,180,209,114, 48,217, 6, 29,121, 86,107, 72,115,101,148,148,211, 68, 78, +232,194, 16,205, 18,226,198,201, 37,137,110,219,215, 36,104,218, 85, 30, 63,204,105,100,124, 42, 77,133,191, 55, 84,182, 49,117, + 46, 87,154, 88,176,192, 5, 94,206, 50, 21, 3,246,185, 44, 87, 45, 35, 67, 53, 32, 21,169,192,144, 76,104,231, 21, 60, 85, 66, +233, 26,161,132, 89,183, 11, 55, 6,137,171,223,178, 58,235,182,199, 19, 2, 89, 10, 4, 58,208, 71, 41,206,156,216, 49,130, 85, + 84, 77,197,146, 5, 35,209,246,164,149,128, 34,140, 80, 25,174, 6,215,240,241,216, 40, 0, 93,113,212,122,139, 60,206, 34,186, +141,140,149,123,152, 81, 85,210,117, 87,186,171, 66,106,170,227,245, 8,249,198, 44,251,124,173,191,254,235,112,175,215, 92,160, +255,207,183, 22,252,112,100,193,124,135,112, 74,206, 27, 85,165, 71, 35,148,180,212, 94, 62, 14,142, 85, 12,128, 25,130,162, 65, +251,203,169, 55, 2,192,186, 35,225, 80,136, 19, 22,242, 41, 89, 33, 23, 13,203,243,195,163,132, 91,202, 24,180,128,154,133, 73, +159, 15,202, 39, 10, 29,120, 51, 93,151,146,188,176,215,156,199, 18, 98, 10,171,202,149,217,211, 36,154, 49,235,155,107,155, 95, + 7,223,133,184, 1, 69, 94,182,137,199,225,212,110,116, 34,118,254, 84,121,152,210,174,217,154,170,196,105,168,136,180, 31,110, + 31,170,167,217, 79, 31, 63,127,255,225, 93, 95,139,111,121,250,156,161, 92,221,126,136, 81,150,235, 87,164, 86,135, 78, 69, 41, + 73,241,139,226,116,127, 55, 28,253, 65,109, 38,203,133,182,171, 90,178,193, 25, 42, 69,104, 95,193, 92,208,113,233, 90, 38, 19, +246,164,197,102,167,227,117, 51,109,144, 74,186,221,126,241,228,213,246,203,215,250,218,170,148, 77, 36,208, 75,107,255, 13,238, +187,123, 95,222,188,109, 57,121,243,238,186,180,228, 73,182,193, 30,190,153, 68,208,115,120, 48,248, 24,237, 37, 1, 1, 93,230, + 42,194,188,133,144,117,156,167,162, 31, 32, 99,186,169,199,225, 24, 59,151, 98,250, 73,232,163,229,160,213,252,211,241,131,141, +123,148,124, 65, 40,144,201,134,139,173, 5,183,223, 83, 11,136,216,108,222,184,243,233,199,103, 16,155,243,242,209,253,103,139, + 94,103,231,231, 78, 16,141, 71, 19,159,222, 91,152,134,180,100, 66,216,236,168, 20, 64, 81,127, 15,142,208, 6, 47, 83,130, 92, +112,182, 16,148,123,228, 24,153, 80, 33,108,212,189, 9,179,216,166,220, 33,175,244, 6, 42, 55,155,210,177,154, 19, 8,108, 72, +244, 33, 40, 37,157, 78, 51,112,151, 48, 13, 41, 95,176, 43, 61,183, 33, 22, 43,151, 98, 41, 70,248, 8,213,129, 42,143,126,150, +107,186, 14, 42,141,113,138,202,100, 38, 42,213, 92,153, 43, 46, 26,174, 10, 83,224,139,142,198,242,185,199,163,124, 38,101, 84, +121,250,210,214,171,224,124, 89,153,197,254, 21,128,170,235,251, 77, 26,140,162, 45,180,208, 66,233, 20, 24, 48, 39,137, 89, 71, + 88,102,162,211,196, 25, 31,244,209,196, 71,125, 48,153,255,158,137,255,128, 47, 38,190,249,104,212, 57,163, 47, 46,219, 18,167, + 83,167,163,165, 80, 90,218,175,212,123,238, 87,112,219,115, 23, 10,237,119,239,185, 63,206, 57,121,124,103,195,201,197, 54,103, +110,149, 74, 15, 32, 65,229,206, 12, 46, 46,167,170,165, 74,185, 84,229, 58, 26,248,157, 50, 36, 29, 87, 64, 33,176,243, 53,140, +200, 52, 35,148, 30, 23,204, 56,173,153, 86, 56,141, 40, 84,209,245, 82,182, 73, 69,117,105, 16,242,162,159,126, 24, 0,101,163, +193,146, 82, 57, 6, 25, 16, 33,196,181,142,227,243, 62,153,142,250, 84,109,218, 29,172,198,195,170, 13,119, 64, 7,140,158, 28, +226, 8, 23, 16,140,221,209, 59,131,166, 15,186, 74,148,134, 74,172,126,157,156,215, 5,163, 36,217,164,248, 50,241,230, 50,251, + 72, 81,251, 63,247,233,208, 74,159, 24,216, 12,177,193,215, 56,158, 80,124,255, 61, 60,181,208, 14, 75, 79,189, 95,135,167, 7, + 99,202,249, 50, 57,176, 30,197,253,235, 15,222,237,191,213, 53,222, 53,226, 86, 34,248, 89,105,218, 90,106,215,237,166, 23,120, +244, 69, 8,146, 16,102, 36,208, 29,199,185, 64, 60,189,191,172, 44,168,110,118,111,184,193,217,118,111,219, 27, 15,119,238,239, +124, 31,156, 64,171,139,181,179,232,182,111,247,238,140, 2, 63,136, 71, 27,221,205, 31,238,241,109,231,238,247,240,107, 25,203, +166, 2,114,172,186, 36,237,114,167, 80, 22,181,148,213,139, 89,179,102,214,107,229, 75,181,146,161, 83, 44, 40, 10,181, 24,205, + 50,185,144, 72,151,104, 8,203, 84,108, 37, 79, 31, 63, 59, 60, 60, 74, 98,120, 78, 34,175, 8,104, 44,171,172,218,215,176, 90, +116, 66, 46, 87,154,144, 85,194,114, 67, 42, 53, 43,218, 75, 87, 70,145,223,168, 52,130, 36,212,208, 21,201,103, 33, 18,159, 22, + 56, 44,102,202, 98,148, 74, 17,205,146, 63,114, 8, 18, 63, 1,100, 83,226, 52,130, 69, 56, 54, 81, 68,168,124, 58,157,208, 75, +104, 27,182, 20,104,173,163, 71, 17,242, 98, 66,238,100, 7,131, 27, 94, 52,160,255,180,202, 53,201, 73,158,147,131,102,185,231, + 17, 56, 69, 82,112, 49,147,202, 83, 26, 68, 30, 16,182, 70,147, 81, 12, 99, 68,236, 1, 6,161, 95,132, 91,111,252,237,207,145, +164,247,155,134,233,142, 6,107,109,199, 40,153, 84,143,138, 52,215, 8,147,100,194, 68, 76,177, 23,196,179, 95, 41, 25,152,242, +231,193, 9, 58, 21,151,160, 8, 93,167, 48, 96, 87, 80,187,176,142, 13,213, 65, 81, 65,153,187, 37,241, 54,209,140,183, 67, 52, +185, 12,134, 94,111,194, 66, 99,153, 14,175,202, 82, 20, 83,222, 74, 87, 27,171,178,184,244,199, 67,203,168, 50,107, 70, 93,109, +116, 7, 62, 22,132,150,237,118,195, 94, 38,112,192, 51,109, 33, 13, 82,192,243,162,207,130, 62, 23, 26,160,103,238,201,189,173, +187,206,205,237,151,175, 95,121,147,180, 97,215,215,159, 60,196, 79,212,239, 43, 21, 11,107, 51, 0,239, 66, 25,252,153, 28, 31, +208, 13, 84,154,171, 25,101,214,100,202,174,160,153,198,153,183,168,177,212,199, 44, 5,179,217,178,117, 58,245,116, 32, 44,147, + 66,124,163,219,234,107,166, 31, 69,199,103,127,245,233,236,114, 92, 40, 76,233,164, 41,160,170,234,218,130, 54,147,255,133, 99, +255,245,155,189, 23,207, 91, 45,189,253,232,150,178,209, 86, 74,198,220,140, 57, 37,200,160,124, 58,248,240,126, 52,152,133, 88, + 69, 72, 83,167,183,213, 89,238, 66, 13, 21,172,110,174, 0, 21,122, 88,129,224, 67, 77, 15,206, 99,238, 58, 43,160,163,147,178, +123,184,231,172,172,253,112,127,129, 24,136,201,138,177,189,126,235,227,215, 93,207,119,233,213,242, 39,227,141,110,159,234,108, + 42,160, 63, 31,125,137, 83,225,180,215,184, 1, 88,164, 90,217, 54,109,167,227,184,129, 59, 12, 71, 75, 70,141,192,160, 27,120, + 86, 25,154, 25,155, 87,175,115,201, 40,224,237,165, 42,206, 74,143,106,104,166,103, 22,208, 87, 80,211, 82, 65, 35,156,138,249, + 74,222, 37, 70, 20, 16,179,152,103,175, 60,228, 87, 51,211,168,208,155, 39,242, 80,249,191,193,178,232,156,168, 76,111, 12, 65, + 22,225, 97, 57, 15, 41,232, 5,139,193, 7, 79,228,122,164,148,164, 7, 83, 50, 19,231, 88,169, 11,120, 59,183,173,189,160, 82, +118, 65,249, 93,205, 85,154, 50,121, 69,181,108, 19,238,249, 39, 0, 85,215,182,212, 52, 20, 69, 79, 46, 77,210, 36, 45, 13, 80, + 90, 10,189,113, 31, 6, 69, 29,103,228,209, 71, 95,253, 31,253, 28, 31,252, 8, 95,157, 65, 7,152, 1,124, 16,185,136, 12, 84, +208,210, 52, 77,211, 52,151,198,189,247, 73, 6,228,177,208,153,180,156,179, 47,107,175,189, 86, 58, 95, 85, 85,131,100,155, 18, + 98,106,203, 92, 68, 7,170,242, 9,122,207,203,252,148,151,116, 11, 26, 91,186,183,108,166, 56,187, 81,219,234, 14,254,244,144, +210, 32, 38,153, 85, 27, 52,221,132,120,164,156, 58, 63, 12, 32,154, 67,136, 39, 86, 4, 57,230,208, 90,236,132, 54,221, 23,102, +235, 61,247, 30,190, 83,136, 50, 40,186, 29,249,144,127,224, 14,120, 35,151,106, 52,129,108,148, 99, 2, 31, 32,112,203, 52,208, +192,233,150,130, 98,244, 17,110,174,179,152,198,217,227,148,170, 70,171, 76,166, 86, 88,175,109, 66,127, 0,113, 89, 32,233,210, +129,111, 67,240,138, 57, 49,131,206, 11, 60,109, 81,159,226,123, 85, 50,145, 59,208, 38,104, 2,129,178,188,179,249, 10, 73, 29, + 81, 64,142,149,185, 8,213, 78, 68,110,199, 69,112,200,196,204, 23,113,104, 6,241, 26,121,126,184,122, 2,249, 28,234,240,105, +115,230,178,251,179, 49,179,108,123, 93, 56,176, 57,154,174, 80,152, 16,120,189,169,169,184,189, 9, 77,165,227, 15,110,238, 59, +163,200,151, 36, 9, 82, 72,125,174,233,122, 78,197,170, 85,173, 5, 8, 46,208, 25,132, 66,180, 56,179,208,152, 93, 26,134,131, + 65,120, 45,138,138,227, 6, 99, 82,230, 13,240,122,164,211,107, 10,104,168, 48,105,153,186, 70,218,100,154, 38, 26, 72, 86, 19, + 5, 69, 40, 26,146,174,192, 45, 70,164, 53,192, 94, 35, 62,220,219, 35,134,120, 14,137, 82, 88,204, 33,194, 8, 65, 4,206, 25, + 92, 27, 20,141, 71,135, 63, 65,201,233,136,155, 19, 99, 21,125,141,147, 4, 23, 52,232, 68, 22,140, 41, 98,139, 11,154,172,169, + 74, 94, 72, 73, 2,184, 97, 78,164, 15,145,172,216, 57,158,195,202, 83,243,152, 51, 76, 11,217, 50,147,164, 82,170,232,170,238, + 64,254,155,132, 92,172, 38,198,213,102,193, 27, 57,240,122,192,149,129, 19,206,163,148,196,204,181,146, 74,230,132,187,225,144, +179, 54, 30,179,146,105, 65, 63, 75, 83, 44, 2,169, 69,217,200, 27, 40, 86,165, 66, 35,163,143,130,225,211,230,115, 67,213, 41, +233, 86,201,201, 29, 79, 38, 4, 51, 11,165,166,194, 74,105,238,242,238,156,192, 31, 97,218,156,230,203,168, 28,188, 15,113, 64, +241,240,147,144,154, 81,171,188, 2,143, 13,129, 85,150,209,163, 25,202, 23,218, 98, 21,121,190,207, 58,229, 20,115, 71, 76, 50, +142,176,105,145, 17,103,200,161,153,114,156, 58, 24, 96,199, 20,109, 53,158,108,183,159,185,158,235,140,108,184, 11, 88, 4, 32, +220,132, 31,215,118,123,124, 45,204,243, 29,100, 25,197, 99, 45,167, 66, 37,205,245,113,199,161,151,144, 99,112,201, 40, 35,138, +157, 76,250,157,155, 55,239,222,183,203, 43, 7,199,103,155,171,245,218,235,109,166,201,172,213, 98,178,130,200,251, 40,102,131, + 33,187,248,238,219,221, 68,202,233,229,197,241,176, 31,193,253, 37,225, 64,137,251, 31,226,182, 21,212,252, 49,162, 52, 42,244, + 27, 5, 46, 36,139,244, 24,168, 26, 90,229,205,234,156, 18,248,223, 78,142,190,236,127,253,253,227, 76,177,135,122, 63,144, 28, +159,221, 13, 88,183,207,236,126,116,117,101,127,254,114,252,225, 99,231,104,119,227,197, 82,249,237, 75,214,174,193, 1,201,156, +224,136,140,233, 58,236,211,233,238,165, 23, 98, 89,193,234,165,122,239,111,231,252,234,196, 30,246,140,188, 9,217, 11, 42, 24, + 8, 41, 80,101,115,104,153, 75, 3, 22,117,107, 20, 14,177, 34, 84,141,245,133, 53, 72,176,191,238, 46,151,107,107,112,198, 32, +101, 94, 67,163,238,246,154,213,230,121,231,162,221, 88,157,175, 52, 10,106,254,240,226,208, 42, 78,195,111, 33, 92,244,220,238, +173,125, 11,255, 14,248,179,157,141,157,253,211, 3, 56,240,208,191,170,138, 6, 69, 12, 14,198, 24,131, 74, 14, 10, 43, 3,163, + 10, 46,109,195, 91, 36, 38,229, 20,117, 28,224, 26,191,174,154,158,239, 97,147,154,129, 46, 49, 21,254,180,138,195, 85,128, 80, +100,118, 28,134,240,252, 20,133,146, 12, 36,121,180, 92, 74,159, 7,122,250, 84, 49, 55,243, 83, 37,146, 72,156,100,154,192,148, +113, 37,146, 41, 14,254,119,196,123,224,200, 36, 15,130, 4,169,194,113, 38,181,197,151,167,216, 35, 33,110,198,135,213,255, 4, + 96,234,202,122,154, 8,163,232,108,157, 78, 59, 12,157,206, 84,169, 88,132,186, 32,242,224, 22, 36,196, 55, 95,124, 52, 38, 38, +250, 96,252,161, 62,187, 6, 37,241, 69, 19,162, 86, 92, 0, 11, 66,153,133,206, 62,245,158,251, 13,226, 43, 36, 76,152,249,190, +115,183,115,207,169,244,223, 75,230, 87, 78,184, 61, 87,148, 85,139, 62, 23,234,216,172,122, 74,199,148,222, 8, 65,152, 99,117, +232,125, 69, 20, 51,163, 17, 93,248,164, 72,207, 88, 51,132,251,117,214,124,231,249, 42,158,188, 60,119,179,231,246, 41, 66, 98, + 71, 30,241,224,236,133,153,133,131,209, 62,251,169, 40,173, 41, 39,140,143,130, 56,160,219,107,232, 6, 20,208, 21,117,156, 98, +243,219, 31,123,236,205, 35, 34, 17, 26,238,208,170,204, 35,222, 54,194,236,139, 85,129, 51,102,193,155,116, 50, 8, 70, 41,186, + 10,130,161,200, 57,163, 36, 26,250, 67, 31, 84, 75, 44,254,193,230, 9, 61, 53,165,218,153, 23,110,152,152,198,169, 76, 39,200, +232,123, 98, 99, 88, 86, 10,124,170,120,243,215,230,158, 55,164,175, 69, 21,147, 96, 56, 9, 31,230,110,187,119,235,210,234,208, +219,249, 19, 28,186,166, 91, 8,149,100, 9,134, 77, 66,101,148,128, 18,107,107,114,169,105,104, 80, 80,252, 32, 20,104,153,246, +131,181,135,131,223,131, 48,241,128,125,138, 74,207,162, 44,156, 14, 25, 85, 63, 40,249,203,188, 89, 55,235,245, 6,132, 50, 50, +240,127, 33,156,162, 96, 0, 69,175,226,211,240,189, 36,107,182,101,200, 74, 6,254, 39, 16,167,160,228, 9, 92, 73,153,189,223, + 16, 55,203, 89,219,146, 48,175,147,161,137, 93, 42,113, 33, 97, 2, 80, 42, 89, 50, 9,198, 89,206,224, 78,192,216,144,116, 85, +171,225,138,161, 3,138, 84,211,181,206,252,241,246,207, 59,115,116,145,178, 52,189,125,105,109,103,180, 77,153, 11,247,181,170, +113,145, 80,180, 83, 57, 55,160,247, 76, 71,188, 69,169,119,145, 68,217, 24,242, 97, 69,214,239, 46,218,102, 59,142, 99, 22,104, +149,153, 58,166, 11,234,183,194, 28,202,165,222,114, 24,121, 20,203,225,132,197, 29,109, 97,181,204,194, 45, 19, 42,230, 28,211, + 13, 40,187, 33, 4,175, 65, 33,177, 96,145, 78,136,138, 86,193,177, 58,231,104, 19,113,115, 70,176,161,166, 27, 45,186, 12, 84, + 85, 76, 53,108, 72,210,235, 84, 38,198, 96,206, 40,186,174,105,132,224,116,108,160, 54,197, 77, 21, 8,225,129,126, 35,159,179, +187,219, 7,191,184,153,138, 63, 30,177, 4,149, 60, 57,213, 21, 59, 81,132,231,234, 72, 42,141, 90,131, 78,102, 58, 73,233,229, + 19, 22, 55,245,102,175,115,193,139, 14,101,161, 43,200,231, 67, 72,141,243,220, 85, 18,246,158,220,151, 82,217,201,186,134,196, + 66,193,238,150,202,215,123,223, 31,130,203, 33,149, 20,159,226, 52, 22,166,107,106,229, 51, 87,233, 35,131, 73,153, 99,233,145, +126,235,163,133, 8,250, 17, 33,160,129,208,155,150,101,164, 41,114, 93,215,253, 96,116,219,234,246,158, 61,190,187,184, 54,123, +189, 35, 53, 50,105,202,128,160, 88,205,160, 82, 20,235,163,223,191, 78,118,191, 19, 0,209, 73, 78,188,195, 60, 14,197,170,141, +160,100, 66,119, 26,232, 14, 3, 98,138, 23,114,145, 80, 6,165, 55,166, 36, 97,129,109,168,208, 45,152,117, 58, 87,231,150,175, + 44,244, 59, 86,153,132, 59,219, 95, 62,127,220, 24,108,188,219,124,243,234,231,198,250,143,215, 47,182,222,190, 60,222,251,214, +191, 54,179,244,104,173,113,255,166,100, 57, 18,182, 92,149,147, 78, 64, 46, 81,189,184,181, 57,122,238,175, 31,133, 58,151,159, + 94, 28, 68,232, 95, 81, 70, 98, 80,112, 61, 12,142, 8,106,194,120,124, 66,132,174, 86,251, 85, 77,139,217,236,144, 42, 30,119, +218, 29,122,191,143,211,168,174,234, 65, 20, 82,254,228, 88,118,219,116,232,255,242,142,253,189,163,253, 56, 26, 63,189,247,164, +215,233,237, 30, 64,103,208,177,220, 59,151, 87,230,187, 11,142,233, 12,134,131,213,197,149,141,175, 31,110, 92,188,190, 59,218, +165, 0,223,182,218, 84,160, 99,122, 36, 35,129,192,164,174, 86,111,214,154, 65, 28, 78, 88,141,142,161,183, 96,171,171,242, 84, + 91,139,135, 76, 12,156,226, 39,101,149,207, 51, 7, 26, 86, 37,128, 24,204, 39, 42,136,175,180,140, 36,170,198,108,147,208,192, +255,103,198, 37,253,163,185, 87, 58, 3, 92,153,226,161,185, 60, 81, 78,204, 17,254,207,226,229, 83,102, 76,165, 20,172, 82, 78, +147,151,201,124,167, 79, 80, 60,109,180, 82,118,171, 23,205, 26, 66, 69,219,114,163,100,252, 87, 0,174,174,166,183,109, 43, 8, + 62,241, 75, 20, 41,209,180,100, 57,138,100,199,137, 45,171, 53,144, 4, 65,156, 54,237,169,232, 57, 40,208, 83,255, 98,129,254, +130,166,199, 94, 90, 4,200,161,183,198, 70, 80,212,138,157, 24,242, 55, 77,137, 95, 34, 59,179, 79, 50,130, 2,190,201,160, 68, + 62,190,221,217,125, 59, 51,139,248, 78, 70,121,149, 9,215, 70,119,105, 84,221,116, 5,225,149,190,231, 75, 83,140, 81, 31,247, +223,114, 3,106,153,170, 50, 69,100,172, 89,121,153,109,247,118, 1, 66, 73,154, 97,110, 88, 72,103, 78,174, 79,175,227, 75, 96, + 94, 18, 79,170, 28,128,235,120, 50,150,187,225,150, 32, 71, 75,218,217, 14, 49,178,155,229, 25,101,167,200,101,175,180, 98, 88, + 37, 60, 93,175,225,227, 43,144, 75,171,229, 17,220,242,169, 97,171,216,174, 37,243,115, 37, 54,158, 1,204, 14, 28,130,197,222, +234, 62, 64, 0,173,136,106, 77, 25,214, 68,200, 78, 45,211,209,134, 63,115, 49,153, 52, 69,126,186,100,207, 75, 42,107,147,189, + 84, 61,221,134,120,121,175,221, 39,202,230,232, 55,215, 89, 45, 92,110,213, 85,124, 49, 62, 59,202,196,134, 77,134,118,146,102, +131, 44,106,172, 10, 54,239,106,179, 13,172,205,225,153, 98, 86,167, 92, 79,194,235,154, 38, 94,145,119,227,191,251,237,193,110, +255,203,143,151, 39, 43, 94, 64,169,210,122, 64, 89,124, 27,175,239, 12, 17,243, 54,139,194,102, 27,161,109, 18,157,191, 28,125, + 19,180,130,139, 41,194, 71,181,177,190, 49,171,125,112, 29,171, 19,214, 75, 51,163,126,185,136,243,136, 8,166, 42,171,133,178, +249, 44, 41,239, 5,158,229, 88, 13, 26,186, 18,187,231, 72, 18,101, 37,116,254, 26,131,187, 24,254, 58,150,106, 84,158, 85,115, + 82,250,157,202, 56,154, 97, 77,147, 56,206,162,104, 22,145, 28, 84,113,242, 39, 78,167,184,200, 74, 99, 53, 41, 82, 93,184,220, + 95, 29, 76,133,126,130,149,106,183,186,120,110,211, 44, 6,120,111,185,161, 72,226,169,171,232,226, 50, 62,111,122, 33,195,171, +237,122,245, 86,150,207, 80,252,161, 46,254, 98,176,119,124,246,239,197,205, 36,244,215,240, 51,180,152,189, 62, 36, 48, 77, 27, +249,201,119, 26, 88, 17,230, 81, 90, 36, 35, 33,219, 28,118, 42, 88, 64, 14, 58,155,226,207,199,190,148, 37,222,207,105, 14, 68, + 90, 54,235, 1, 27, 98, 36, 85,165, 52,173, 19, 45,112,236,201,192, 95, 65,196,223,185, 63,250,231,244, 96, 45, 88, 71,238,176, + 57,149,235,227,154, 60,185, 80,213, 90,179, 59,218,220,179, 12,231, 54,142,196,255,130,130, 69, 88,190,126,123, 99, 74,114,202, +116,179,179,133,114,158,167,253,186,144,101, 29,193,159,172,169,185,182, 97,114,106,211,182,207,111,206,230, 34, 44,197, 46, 74, +179,115, 67,223, 2, 37,124,105,241,251, 52,172,166, 14,145,101,169, 27, 63, 38, 69,163,156, 82,198, 55,121, 28,101, 81,180, 54, + 74,112,107,198,102,119,235,197,206,254,209,228,200,208,116, 42, 85, 67,154, 7,160,183, 73, 41, 13,176, 1,125,199,195,213, 16, +200, 80, 55,164,244, 54, 74, 69, 85, 20,239, 22,229, 0, 16,199, 79, 14, 15,247,195,117,107,173,163,154, 99,101, 20, 40,109,148, +143, 60,238,177, 63, 51, 30,171,163, 67,149,204,120, 44,207,103,154, 7,189,135,108, 21,228,169,116,222,149, 30,214,100,124,231, + 24, 60, 67,188, 1,188,229,121, 53, 95, 68,225, 41,203,103, 41,207, 82, 97, 67, 61, 8,221, 81,191,247,124,231,209,243,225,238, +147,135,195,167,131,237,199,131,173,103, 27,143,190, 29,110,191,218, 31,252,248,210,251,234,169,234,246, 20, 32, 4,123, 15,213, +178,255, 76, 59, 47,117, 60, 86,191, 31,252,241,151,186, 82,169,111,121, 52,151, 18, 42, 41,110,141, 74, 62, 13,191,164,241, 97, +170, 22, 35, 45,165,102, 24, 22,181, 50,203,243, 74,200,100,243, 26,149,160,178, 98,193, 72,111,121, 1,254,128, 11, 91, 65,248, +254,244,253, 78,111,136,119, 28, 96,232,215,183,175,143,207, 62,238,239,125,125,240,225, 0, 72,255, 58,137,223,188,251, 51,154, +222,254,240,234,167, 95,126,251,121, 52, 24,158,156,127, 18,219,219, 57,234,197, 40,157,166,244, 95,164,247,186, 30,131,249,238, +241,247,167, 87,248,135, 12, 41,124,206, 3, 66, 7,143,165,144, 90, 83,203,227,152, 84, 7, 42,254, 63,163,190,212,233,197,154, +174, 7,189, 75,145, 51, 50, 62,179, 41,195,199,168, 98, 35,145,255,188,115,239,170, 72, 6, 10,117,216,185,211,160,251,204,200, +116,225,221,164,238, 66,250, 82,159,215, 92, 76,224, 18,105,185,134,155, 20, 72,149, 55,250,163,138,254,122,154,189, 74, 60, 81, +183,108, 68,167,255, 4,224,234, 74,118,155, 8,162, 96,143,123,246,241,146,216, 6,197,217, 8, 40, 82,144,128,136,237,192,145, + 11, 2,137,143,230, 4, 7,238, 28, 88,148, 64,130,137,156,197,142,226, 25,123,198,179, 81,245,218, 6,132,228,131, 15,118,156, +233,121,243, 94,189,126,213, 85,171,252,174, 26, 0,113, 91,221, 59, 9,107, 99, 46,170,123,158, 48,103, 42, 18,233,242,153, 72, + 6, 81,162, 75,246,172, 75,146, 31,170,202, 67, 35,147,167,104,106,128, 8, 77,147,101,154, 11, 99, 43, 86, 73, 41, 67,211, 1, +172, 23, 56, 17, 93,144,100,106, 94,175,156,217,132, 30,103,121, 54, 50,130, 55,205,110,254,168,241,137,254, 66, 33, 10,127, 45, + 20, 61,154,236, 24, 90,229,242,128,171,168,198, 86,148,140, 16,181, 22, 95, 54, 43, 74, 19, 23, 7,155,128,138,113, 42, 99, 19, +107,165,219, 71,115, 6,203,198,175,237,246,246, 38,179, 9, 73, 2,150, 18, 21,111, 10,193,151,194,180, 51, 36, 25, 60,132,200, +101,100,202,171,250,245,211,215,125, 17,115,111, 40,219,200,121, 1,237,106,170, 58, 2,214,244,103,121,130,101, 41,232,227,154, + 0,243, 36,185,176,107,164, 67, 67,102,108, 7,235,201, 34,246,133, 62, 36,206, 33,213,209,197, 17, 46, 24,104, 5,160,158,219, + 17, 20, 60, 33, 79,110,127,112,128,148, 52, 28,159, 34,203, 35,170, 80,231,206,174,135, 8,223, 82, 21,163, 25, 80, 94,142,132, + 18,184,206,132, 71,156,216, 38, 44, 42,210,222,211, 5,208,113,181, 0,170,164,237,110, 57, 64,102,243,156, 40,208,190,167,232, +218,193, 67, 33, 85, 51,208,157,168,129,167,213,119,172,208, 85,190,175, 26,153,155,228, 49,211, 78,101,101,101, 38,155,142,133, + 86,174,225,132, 32,130, 81, 8, 57, 45,104, 88,169, 48, 65, 57,117, 20,125, 37,172,167,208,166,185,221,212, 10,215, 80,158,155, +110,115,138, 84, 72,107, 36,242,179, 53,199, 42,129,232,210,120, 40,102,107,209, 26,110, 55, 34, 15,133,159, 41, 77, 59, 9, 5, +181,107,177,148,178,125,155, 46,122, 30, 73, 86,115,177,250,203,205,220,114,201, 19,227,240,185,142,194,118, 23,201, 87,213, 25, + 69,102,132,196,217, 80, 47, 31,188,154,101,241,116,118, 29,250, 17,123, 39, 69, 31, 33, 6, 59, 87,185,236,132,221, 56,187,185, +156, 94,177, 38,245,182,145, 82,247, 6,251,103,227, 19,155,211, 17, 92,115,141,122,188, 30,173,127,252,252, 30,200, 23,101, 79, + 47,189, 83,107, 50, 88,108,123,115,176,253,230,225, 43,223,117, 79, 46, 79,159,222,125,158,100, 28, 11,137,156, 78,109,186, 25, +113,163,211,129, 23,197,243,169, 88,109,214, 59,253,221,171,248, 82,206,232, 81,127, 10, 31, 16, 45,107, 30,126,244, 40,108,137, + 84,110, 76, 62, 23,198, 74,194,120,190, 75, 71,159, 70, 60, 33,197,115, 15,199,231,199, 34,173, 99,109,116, 54, 42, 74, 33, 38, +162, 82,171, 36,160, 75,124, 23,171, 13,136, 67,245, 15, 22, 51, 99,101,192, 95,210,142,246, 93, 43,173,231,231, 71,223,238,183, + 59,206,129, 60,112,200,197,192, 48,243, 76,253, 60, 81, 39,199,106, 58, 69,196, 48, 70,138, 28, 5, 36,236,111,150,105, 82,162, +175,146,134,215,182, 4,185,227,175, 57,220,149,117, 53, 48, 65,161,203, 84,123,190,106,182, 81,223,150, 47, 87, 4, 65, 92,135, +149,163,219, 86,131, 91,106,103,208,216,219,209,187,219,214, 96, 75,117,122, 74,183, 4,179,235,213,206,176,184,155,240,149,171, +209, 80,125,249, 84,126, 88,188, 59, 67,147, 84,180,201,185,154,227, 82,242,188, 8,252, 16, 9, 40,206,146,118,208, 4,220,198, +131,214, 12,155,189, 86, 31,111, 54,186, 91,179,116, 70,207, 78,139,251,168,145, 27,225,206,162,132, 35, 90,208, 16,143,227, 49, + 22, 31, 96, 43,108,117,240,255,141,175, 47,222,190,120,203,243, 19,117, 25,207,147,195,253,199, 63, 70,223,179, 98,209, 4, 48, + 93,204, 81, 41, 71,195, 97,175,115,251,209,221,195, 95,227, 33, 34, 6, 49,143,143,161, 60, 68, 65,136, 55,107, 81,151, 73,223, +170,191,254,250,130,155,130,134,143,141, 32,176,136,118,233,127, 43,101, 39, 10, 8,203,208,201,153, 35,214,202,250, 95,198,203, + 28,255,188, 78, 38, 79,238, 61, 27,223,140,213,106,188, 41, 60,106, 37,155, 96,150, 81, 73, 55, 38, 67, 70,225, 89,152, 55, 54, +247, 65,255,113, 82, 93,138,243, 88,245, 10,233,227,174,123,204, 78,198,239,227, 31,165, 73,158,161,107, 44,205,141,196,175,237, +111, 81, 97,211, 83,112, 62,244, 91, 0,178,174,101,183,105, 32,138,142, 95,177,157,196, 45,105, 74,218,180,148, 84,106, 3, 45, + 2, 85, 98,193, 2, 9, 22,176, 6,132,196,138, 63, 65,124, 15,236, 89, 32, 33,126,128, 5, 69,128,144, 88, 32, 30,229,209, 54, + 52, 47, 39,142, 95,227,216,225,220,107,167, 32, 33,101,145, 72,173, 19,123,102,206, 61,119,230,222,115, 10,124, 7,217,161,213, + 56,238, 0,160, 85, 78, 25,200,136,210, 44, 35,113,238,141,127, 19,155, 38,111,156, 4, 24, 50, 19, 52, 77, 57,172,101,103,170, +117,164,174,133, 53, 43,219,116,100,249,254,168, 16,107,245, 86, 70,117, 93, 70, 68, 71,198, 10,171,182, 38, 21,211,177, 72, 41, + 37, 98,233,203,217, 98,245, 12,230,157, 79,250,112,211,152, 5,152, 10,157,197, 60, 28,113,127,118,202, 66,157,234, 60, 75,159, +113,195, 40, 18,183,185,171, 51,166, 18,251,113,231, 26, 86,170,242,171,255, 19, 63,105,193, 92,224,166,127, 4, 0,157, 61,215, + 69, 68,213,229,169,109, 90,160,225, 25, 85, 25,102,234,169,121, 14, 29,195,146, 75, 31,136,234, 56,116,243,244,176,185,180,241, +254,235,219,206,168, 11, 38, 27, 38, 65, 46, 66, 2, 60, 50, 77,139,218, 80,211,152, 32,137, 68,110,103,123,187, 87, 31, 61,124, +252,236,213, 51, 64, 63, 57,208,115,223, 38, 56,104, 94,103,137,159, 26,167,211, 32, 9,145,199,144,248,159, 97,111,175,180,143, +199,199,152,127,152,184,195,192, 29, 4,174, 27,244, 49,134,128,158,235,151,110,222,187,245,224,221,231, 55,171,160,204, 41, 98, + 42,194,140,228,219, 85, 7,227,104, 18,101,177,100,141, 59, 62,128,138, 1, 63,200,161, 18, 50,155,170,149,203,248, 51,163,132, +192,163,112, 9,160, 22,166, 72, 51, 21,170,119, 68, 94, 38, 83, 4, 3,130,192, 80,167, 45, 41, 78, 63,241, 40,239, 92,187,127, +208,249, 70,232, 68,151,212,202, 86,153,205,196,253, 34,248,138, 66, 42,131,196, 87, 13,106, 23, 90, 91, 58, 31, 98, 53, 86,106, +174,223,199, 51, 1,193,153, 21, 14,195,116,174, 9, 16, 1, 95, 6,138,133,145,223,159,244,211, 52, 89,114, 26,146, 25,253,198, + 82,139, 74, 43,185,122,172, 98, 86, 47,183,246,240, 17,151,194,130,108, 55,119,115,153,176,235, 59, 55,142,135,157,252, 8, 7, +223,222,112, 26, 63,122, 7, 81, 20,146, 64,154, 16,139,213, 26, 86,120,119,116,226,197,222,214,218, 78,215, 61, 33,223, 75, 42, +141, 63, 59, 77, 18, 60,174,205,198,230,229,205,189,158,123, 50,101,125,202,161,215, 5,203,238, 12, 15,139,156,151, 7,218,143, +188,163,254, 33, 2,204,122,253,188,148, 17,200, 1, 11,255,170, 24,169,173,198,133,173,246,246,211,151, 79, 14,123,191, 48, 74, +101,211, 30,250,164, 66, 5, 52, 39,191, 35,100,190, 20,234, 50, 4, 63,224, 47, 80,182, 82, 34,203,142,225,100,192, 58, 7,234, + 89,103,133,195,124,181,164,105,185, 95, 15,254,183,108, 88,139, 78, 13, 88, 22,207,213, 40, 53,208, 29, 93, 87,248, 20,120,189, +182, 46,217, 44, 52, 73,162,146, 74,173,234,172, 83, 42,234,213,229, 43,173, 43, 35,127,148, 78,165,105,152,119,175,221, 5,238, +144, 46, 1,113,178,153,146,139, 38, 16, 38, 83, 70,139,245,101, 90,166, 55,141,170,110,167,117,123,155,118, 92, 1,193,169, 20, +174, 43,186, 93,225, 5, 34,198,240, 99,109,201, 76, 51,116,219,137,199,125,233,117,115,125, 87, 54,192,160,203, 25, 26,213, 50, + 80, 53, 27,205, 81,213,192,205, 38, 1,150,174,112, 28, 82,152, 65,222, 71, 46, 4,185, 22,161,198,175,211, 55, 90,113, 91,197, +190,103, 54, 71,246,252, 77, 34,134, 71,226,227, 59,241,201,219,127,109,168,149,213,138,110, 13, 38, 61, 93, 49,218,107, 23, 79, + 60,178, 78, 92,173, 53, 59,131,223, 35,170,167, 64, 22, 27, 72, 41,217,239,244, 92,156, 36,241, 52,172, 88, 11, 41,203,149,135, +113,132, 27,223,110,182, 49, 69, 39,145,111, 27, 54,150,124, 44, 99,207, 31, 25,212, 35, 25,239,108,236, 60,223,127, 97, 25, 22, +242,128,143,223, 63, 12,130,161,105,128, 61,128, 27,217, 94, 60,241,165,223,247,122, 95,142,191,208,177,153,152, 33,191, 4, 95, + 89,169, 55,151,157,229, 35, 18, 5,161,126,120,238,148, 83, 88,252, 89, 68,137, 76, 11, 19, 20,178, 6,204,247,205, 17, 32, 65, +103,229,188,248, 85, 20,117,249,167, 62, 92,108,222,167,170,152,114, 22,233, 15,166,212, 94,192,252,149, 55,137,169, 55,130,109, +240,244, 92, 43,146, 14, 59,169, 4, 19, 51,176,232, 36,253,215, 32,219,166,178,192, 84,167,174,120,194,146,138,205,154, 10, 90, +201,164, 74,129,228, 84,201,224,175,161,241,255,175,220,192, 85, 40,127, 4,160,234, 90,122, 27,167,194,232,141,237,216,137, 31, +113, 30,158, 16,245, 49,148, 17, 98, 58, 26, 9, 4, 98,131, 96,139,144,216,242, 71, 96,131,196,134, 95,134, 6, 49, 3, 18, 43, + 24,132, 10, 44, 42,230, 69,155, 54, 77, 91, 39,142, 93, 59,142,109,206,249,238,100, 24,164, 46, 34,181, 74, 19,249,126,231,126, +143,243,157, 67,124,151,151,150, 38,115,202,210,157,150, 47,163, 22,115, 83,115,131,214,115, 92, 22,203,186,191,172,154,182, 97, + 35,182,113,178, 51,182,243, 88,153, 90, 82, 86,107,187,109,145,216, 70,210,145, 80,211,177, 92,139, 87, 31,125, 41,222,222,189, +135,242, 7, 64, 47, 18,222,182,204, 64,218,226,100, 95,230, 50,154,232,185,253, 79,223,251,252,207,211, 35,211,120,121,159, 57, +162, 27, 44, 91, 86,173, 45,139,137, 9, 96,208, 9,136, 65,244, 25,210,204,186,198,146, 21,127,155,203, 38,126, 20,142,199,225, +120, 63,162,231,131,223, 13,211, 34,237, 88, 14, 62,109,219,114,226,236, 26, 17,117,240,198,193, 28,119,172,180,128,245, 62, 52, + 46, 30,156,237,211,197,169, 67,149, 23, 58,153,208, 84, 79, 88, 39, 11,100,169, 8, 53,124, 90,195,136,122,147,121, 58, 43,101, + 45,139, 22, 71, 84,188,179,147,229,234,209,227,135,101, 83, 86, 6,221, 65,201, 84,101,252, 88, 29,155, 89, 42,249, 60, 34, 71, + 46, 54,165,205,170, 76,231,201, 5,174, 25,219,114, 62, 58,252,228,235, 47,190,252,241,175,159,145, 21, 2,245, 76,187,189,204, +151, 63,252,246, 96, 24,142,163, 48,186, 74,231,166, 89, 0, 46, 0,238,125,223,172,196,180, 3,167,134,154,109, 85, 3, 12,236, +116, 12, 36,175,172,209, 77,117,123,212,107,145,194,104,108,138,218,148,208, 79, 42,138, 56,160, 68,201,215,213, 98, 89,230,249, + 6,143, 19,229, 59, 48,133,158,144,148, 61,170,143,167,199,180,179, 81,122, 17,161,149, 81, 98,211,208, 82,207,248,172, 33,187, +219,149,166, 97, 70,253,241,225,238,253, 63,254, 57,194,111,105,180, 43, 41,109, 67,186,180,237,217, 62,103, 76,108, 34,183,156, +182,171,183, 11, 6,221, 40,219,100,129,227, 41, 50,106,220,179,248,132,179, 28, 89, 92, 4,152,162,148,158,197,231, 22,135,165, +213,101,114,142,116, 30,201,218,139,249, 51,209, 25,230,238, 43,190,233, 13,203, 65,199, 11,252,111,190,250,246,193,163,239,246, +162,219, 25, 87,145,105,164,153,172, 98, 99,203, 33, 40,105,137,206,228, 46,206,226,233,197, 11,223, 13, 41,169,111, 57, 2, 92, + 70,223, 27,245,152,121,177,254,195,227, 64,204, 34,173, 70,134, 56, 91,158,227, 95,247,221, 62,254,242, 58,185,236,218,206,201, +213,201,147,231,199, 67,127, 68,166,160,209, 94,164, 75,192,122, 35,227, 98, 26,103, 7, 17, 64, 25, 87,218,206,112, 31,215, 18, +142, 25, 55, 42, 91,173,192, 13,165,179,132, 90, 42,147, 14, 57, 39,223, 2,155,134,246,109,199,133,135, 47,107,181,172, 91,225, +184, 0,200,210,139,190,210, 50, 38,192,169,142,169,217,217,181, 80, 78,169,166,135,163,181, 42, 86,167,215,211,189,193,206, 34, + 95, 14,186,131, 39,179,167, 0, 50,224,111,191, 59, 96,205,199,117,104,109, 88,223,208,190, 6,101,184, 73, 13,135,123, 97,111, +255,179, 67, 37,125, 76,137,235,182,138, 19,238,175, 22,133,202,129,241,202,223,191,235, 77,222,236, 4,163, 42, 91, 85,235, 84, + 42, 46, 50,252, 44,246,103, 72,184, 36,178,183,229,250,193,121, 66,206,148, 39,106,147, 43,223, 83,110,151,108, 25, 75,253,223, +100,238,245, 14,197,171,108,125,179,125,129,159, 27,117,254,183, 58,250, 93,165, 73,245,203,228,251,147,203, 44,191, 66, 44,208, + 2,182,222,204,227, 75, 42,208, 84,117,156, 46,134,193,208,239,122, 23,201, 92,247,162,107,170,164,148,120,154,178,145,207,134, +141, 78,251,222,154,220, 57,187,158,226,166,154, 45,102, 5,147, 6, 39,201, 19, 4,251, 48,136, 16,185,233, 77, 86,214,235,119, +118,238,246,131,161,103,187, 22, 7, 48, 14,222,173, 71, 2,119,182, 46,138,221,104, 15,111, 66,153, 95,128,210,102,237,121,195, + 15,223,255,248,167, 95, 31,238, 12, 38, 41,183,100, 11,225,234,212, 91, 21,154,218, 82,230,187, 7, 31,156,197, 83,189,200,215, +177, 92,100, 74, 69, 89,104,221, 35, 36, 13, 22,141, 85,165, 7,170, 90, 91, 65,175, 90, 4,242, 36, 67,213,134,216,134,158, 98, +116, 16,221, 56, 9,101, 83,104, 93, 80,109, 28, 42,180, 95,181,150,113,212,171, 21, 84, 61,118, 28,245,110,173,169,110,239,149, + 85,238,216,174, 45,114,229, 47, 69,164,183, 70,142, 91, 96,127,253, 89,232,209,226,127, 54, 79,248,197,191, 2, 48,117, 45,187, + 77, 3, 81,116, 60,177,157,247,163,133, 62, 64, 77, 33, 77, 17,148, 66,169, 74,169, 0, 33, 33, 36, 36,196,130,175,129, 61,223, +192,182, 75, 36,248, 13,196, 2, 1, 66,116, 7, 45, 47,137, 87, 32, 77,136,211, 36,126,213, 99,123,184,103,198, 21, 44, 42, 85, +149, 26, 59,246,157, 59,119,238, 57,247,156,163,254,140, 42,217, 20, 38,162,189,213,203,224,228, 37, 96,101, 1,206,138,197,216, + 61,144, 58,149, 34,138, 69,115,118,105, 56,113,180,151, 60,203,218, 45, 25,146,171,193, 70, 61, 11, 0,146, 37, 12,115,232,201, + 70,206,228,207,165,214, 6,189,164, 70,169,174,225, 41, 1,123,157, 8, 58, 12,232,150, 68, 20,199,223, 6,223, 4, 36,130,149, +234,175,212, 50,108,136, 68,237, 46, 69,127, 0, 90, 37, 19, 42,190,208,140, 81, 89,127,181,185, 62, 14, 70,116,173, 74,177,214, +156,106,246, 39, 61, 58, 37,237,143,122,253, 73, 95, 29,111,233,205,201,107,103,111,244,134, 93,138, 24,139,231, 41, 29, 80,141, + 38,149,196,141,201,205, 70, 13,140, 64, 58,185,211,222,158, 55,237,137, 63, 89,152,109,133,135, 33,246,149, 84,121,175, 24,236, +230,197,219,179,245,153, 31,131,239,148,244,233,230, 5, 88, 49, 0, 84, 76,219, 14, 37,122,253, 1, 21,232,169,214,146,102, 16, +111, 96,169,101,153,211,165, 41, 87,248,126, 18,168, 81,136, 84,217, 43,115, 90, 68,148,119,107,165,170,193,173,157,175,111, 40, +249,126,218,255,104, 23,242,181,114,125,173,181, 70,207,243,204,169,179,185, 2, 63,215, 94,145,204,236, 59, 93,206,209,151, 44, +230,109,103,226, 3, 82, 84, 14,149,138,251, 46, 53, 11,158,130, 63, 56, 20,205,169,154,114,148, 86,226,204,210,240, 69,110, 64, + 63, 16,161, 53, 44,108,224,210, 50,211, 82,158,214, 26,172,245,218, 51,231,130,200,135, 15,117,170,199,232,145,244, 53, 9,150, + 22, 73,166,227,175, 70,192,168,176, 3,122, 44,147,230, 76,107,231,243,107,100, 46,158, 43,216,165, 24, 40, 16, 84, 89,104, 41, +134,201,225,137,250,252, 92,227,228, 8,147, 92, 41,221, 4,244, 93,139, 53, 74,217,155, 75, 91,123,157,221,141,246,213,137, 79, +213,104,156, 51, 96,214, 72,123,219,202,194,106,103, 0, 91, 46, 19, 40, 8, 60, 54,209, 93,135, 72, 30,234,190,106,185,129, 62, + 8,231, 84,184,185,158,247,252,197, 51,186,174, 7,113, 58,244, 16, 64,202,228,134, 6, 47,109,211, 50,148,178, 46,253, 47, 37, + 71,120, 8, 75,182, 56,179,184,186,120,161, 63,238, 97,212, 27, 21,174,141,116,133,137, 39, 90,126,198,165,165,203, 94,232,135, +145,199,149, 57,116, 36, 4,125,139,181,211,235,251, 7,191, 40,203, 81,145,211, 40,214,220,192,213,180,123,165,222,170, 84,191, + 67,159, 42, 77, 52,217, 99, 65, 57, 49,140, 3, 83, 85, 78,244,153,211,229, 58,237,232,116,248,163,170, 31, 44, 97, 78,143,204, + 44,130,141, 38,149, 15, 56,174, 66,241, 64,191, 31,175, 76,175, 44,156, 31,184, 14,157,137,235,133, 90, 53, 95, 25, 3,189, 72, +116,211, 38,167,150, 18,133, 55, 70,180, 12,174,196,248, 0,253, 1,235,206,153, 76,131,111,218,116, 66,202,171,103,174, 43,158, +143, 77,219,180, 5, 66, 60,139, 34,113,165, 82,101,203,199,144, 0,192, 52, 42, 50,199, 97,110, 64,201, 61, 13, 67,163, 80,182, +102,155,128, 5, 97,111, 38,195, 81, 15,208, 16,250,239, 24,146, 5,178,129,222, 19,220, 93,209,118,183, 56, 20,193, 76, 90,246, + 30,243,198, 72,214,197, 18,163,232,249, 95,213, 42,203, 38,233,127, 53,123,114, 4,168, 10, 38, 7,236,203, 46,251,244,129, 37, + 62,219,205,191,121, 27,247, 99,159, 62, 30, 26,141,170, 43,171,156, 52,178,161,104, 47,242,105,171, 75,180, 54, 52, 8, 71, 16, +104,203,176,119,142,186, 71,139, 19, 28,184, 20, 93,201,189,173,187,239,126,188,111,205,181,189, 0,115, 42,219, 15,159,118,126, +127,125,181,247,210, 23,225,200,117,186, 7,221,206,159,239, 3,207, 25,123, 99, 14, 39, 9,177, 63,236, 66,237, 53, 5,205,131, + 66, 40, 7,158, 85,133,114,194,141, 91,119,238,111, 63,120,242,232,241,252,244,124,103,240,139,190,216,229,229,205,159, 16,143, +139,149, 90, 48,234,149,161, 55, 20,104,180,214,233, 45, 68, 10,113, 4,255, 4,109, 58,147,110,127,174, 14, 79, 2,161,117,193, +140,172,207, 62, 85, 57,118, 40, 66, 83,151,201, 80,196,194, 73, 20,226,195,112,103, 12, 45,240,253,152,134, 16,100,154,137, 70, +234,179,148,242,122,252,167,215,171, 70, 53,147, 88, 73,165,166, 82,128,220,165, 27, 64,233,145,119,241, 17, 16,153, 41,100,104, +211, 95,158, 17,151, 43,133,170, 26, 13, 6, 89,243,175, 0, 76, 93,203,110,211, 64, 20, 29, 59,206,195,113,147, 56,109, 18, 42, + 80,104, 34,160, 16, 65,121, 9,164, 34, 84,177, 96,203, 2,190,128, 31, 64,124, 6, 75, 62,130, 37,127,192, 10,118, 44, 88,129, + 80, 3,234,139,132, 66,157, 80, 59, 36,113, 28,143,159,220, 51,147, 84, 44,163, 70,181, 51, 51,247,204,125,158,115,134,239,154, +224,164, 46, 74, 65, 62, 41, 23,185,212,160, 66,182, 63, 22,194, 34,152,224, 16,215,198,200,181, 9, 1,150, 29, 58,233,146,171, + 18,127,163,195, 77,254,239,214,198,109, 40,182, 4,252,122,235,102,163,130,188, 7,253,195, 19,231, 87, 4, 82, 39, 63,141, 17, +242, 32,155, 86, 52,209, 47, 65,254,114, 16, 44, 74, 13,255, 53,247, 87,139,107, 64, 28,216, 26, 1, 38,136,136, 41,182, 10,209, +235,146, 74, 81, 77, 37,205,156, 78, 44,218,191,170, 96,125,179,198, 22,217,185,185, 82,211, 22, 52, 62,178,242,141, 84, 93,152, +198,130,171, 47, 38, 16,167, 35,101, 26,102, 73, 55,103,124, 82,202,149, 93,142, 49, 7, 93, 43, 60,184,246,112,223,218,123,124, +235,241,183,227,174,135,142,192,148,124,249,178, 81,221,237,127,237,219,189,138,177, 42,229,182,235,230,186,227, 59,192,133,230, +205, 47,195,221, 65, 60,114, 84,207, 83,231,118, 50,113, 66,119, 22,121, 26, 12, 50,237, 59,199, 58, 18,225, 80,119, 35, 19, 53, +242, 70,103,189, 99,185, 22,173, 55,109, 0,189, 9, 79,194,105,224,145,111,248,108,251,105,164,132,123,195, 35, 47,246, 43,101, + 83, 47, 24,221,195,238,206,189,157,243,237, 75,189,254,247, 85, 51,205,229, 88,168,250,177, 34,186,169,196, 13, 45,101,196,194, + 56, 9,120, 26,204,195,186, 94, 34,255, 43,159, 5, 51,122, 38, 1,245,152,151, 68,104,177, 64, 73,144, 12,150,222,129,108, 54, +153,216,228,195,103,236,241, 31, 47,152,129, 36, 61, 91,136,162, 88,131,183,171,172,150, 36,129, 15,170,137, 82, 9, 12, 9, 46, +144,251, 43,180, 50,131,241, 73, 6, 99,201,154,172,141, 99, 62,121, 49,124,132,125, 34,135,200,118,135,184,135, 10, 43,180, 17, +115, 62,167,211, 76,123,186,125,109,123,183,247,181, 89,111, 13,199, 22,198, 35,210,248,222,229,251,135,191,247,200, 89, 38,227, + 12, 69, 79,113,163,178,142,147,198,208, 86, 72,231,189,164, 87,232, 65, 11,214,138, 56, 38,107,148, 81, 27, 24,225,201,161,150, +204,215,192, 67, 81, 66,193, 8, 94,254,202,133, 78, 20,113,242, 42, 94, 61,127,253,253,184, 59,158,141, 15, 79, 14,185,144,208, + 35, 11, 36,244, 39, 8,243, 57, 60,175,173,214,157,254,176, 7, 30, 80,130,114, 37,179,181,113,163, 55, 60, 8, 19,242, 94, 40, +220,244,209, 15,151, 51, 40,132,162,184,112, 41, 41, 44,167, 71,176,129,228,251, 83, 80, 69, 31,154,144, 30,155,129,138, 64,200, +152,208,109, 1, 33, 30, 97, 7, 50,136, 17,200,149,190,120,242,242,104,208, 15, 34, 36,187, 40,252,221,233, 60,178, 39, 14, 42, +204, 76, 51, 87, 42, 63,237,222, 12,164, 90,146, 88, 46, 35,197, 76,104, 61,155,171, 23, 61,132, 2, 76,144,243, 8,197, 57, 65, + 61,169, 74, 13, 79, 69,217,168,181, 38,222, 95,107,244,123, 14, 42, 8, 2,119, 44, 70, 94,203, 78,147,192, 61,176, 59,155,117, + 86, 55, 0, 30,115,206, 70, 83,224, 59,231, 41, 15, 24, 69,135,229, 53,252, 46,160,187,199,133,198, 44,104, 92, 85, 85,226,123, + 14,157, 52, 26,146,236, 89,117,153,115, 87,145,150,137, 3,230,142,152,235,160, 7,134,206,114, 46,191,204,201,156,149, 79, 37, +202, 75,184,247, 89,122,202,172,125,182,219,101, 3, 11, 61,213,174,230,188,215, 63, 56, 78, 65,220,135,146, 55, 93,232,141,203, +235, 10, 67,249,130,108, 80,220, 95,130,157, 94,146,188, 82, 32,229,113, 94, 44, 20,105,169,133, 2, 31,108,153, 46,227,110,255, + 27,125,129,112, 67, 84,119,166,111,223,189,249, 97,253, 40, 66, 54, 89,221, 60,191,233,135, 92,207,233,173, 70,107, 50,159, 92, +189,176, 73,123,186,102,212,220,192, 13,192,164,196, 25,198,205,244,177,247, 23, 44, 91,206,168,164, 87, 63,127,252,116,124,218, +163,103,214, 86, 26, 71,195, 35,186, 87, 90,231,218,237, 90, 27,234,122,138, 82, 53,170,174,239, 70,146,215,100,217,242, 66, 47, +119,187,125,215,155,207,254, 76, 7, 96, 67, 18, 94,248,153, 94,122, 54,147, 67, 23, 95, 34,168, 83,213, 76,185, 96, 70, 98, 94, + 65,164, 92,138, 23, 27, 27, 99, 15,124,177,116, 68, 58,205,235,108,225,191,166,244, 32, 95,168,218,137,209, 18,201,152, 40,253, +127,137,190,178,136,200, 22,148,169, 76,168,246,165, 82, 22, 27,159,234,165, 26,100, 3,150, 20,242,152, 82,202,163,112, 29,136, +153,187,127, 2,240,116, 46,189, 77, 92, 81, 28,159,241,188, 31, 25,123,140, 31,184, 73,156, 0, 6, 81,136,148, 80,210, 77, 96, + 9,170, 90,169,173,170,170, 11,118,244, 43,116,215,175,194, 10,150,149, 10,130, 69,139, 68, 65, 8,196,162, 21,225, 33, 64, 21, + 37,113,192,141,242,116,157,216,206,140, 99,199,243,232,255,156,235,176,115,188,136,174,231,158,123,238,249,159, 57,231,119,100, +139, 94, 30,226, 1,106, 8,105,109,205, 25, 80, 37, 29,157, 55,215,204,134,212,180, 57, 26,140,173,169, 70,181, 80, 11, 7, 29, +238,215,143, 82,209, 81, 53,194,224, 51, 4,132,194, 97, 89,140, 26,161,233,180, 49, 5,222,216,174,130, 87,234,246,118,176,145, + 99,166, 15,171,237, 69,193, 76,245,179,215,239,159,137,177,199,220,245, 10,213,236,244, 9,113,147, 17,228, 97,121, 4, 18, 72, + 36,209,180,194,177,165,165, 81, 71,184, 99, 58,184,210,113, 60,152, 51,157, 58,186, 83,244,138, 8, 6, 29,221, 13,163,240,220, +244,231, 43, 27,203,248, 6,158,104,105,243, 29,223,159, 36,151, 68,247, 13, 87, 7,193,101, 83, 14,135, 2,207, 97, 8, 11,224, +227,171,242,178,199, 96, 55, 56,174,132, 21, 60,216,255,180,122,214, 54,220, 87, 31, 94,194, 29,219,186,189,199,241, 84,202,192, +111,252,147,114,118, 98,194, 31,111,153,189,135, 75,143, 17,146,178,199, 17,163, 6, 19,105, 4,230,163, 92, 57,149,155,226, 89, +146, 29,152,118, 70,163, 55,144,131,129,145, 81, 79, 21,142, 97,241,195, 52,250,102,246,171, 70,123, 13, 14,162,177,251,239,124, +237,252,194,249,133, 75, 63,125, 33,246,233,183,107,191,111, 53, 54,127,189,127,227,120,233,160, 31,165,175, 26,205,118,175, 31, + 16,127, 82, 96,141,137, 37, 64,149, 5, 9, 78,241,254,197,233,138,107, 27,240, 3,131, 3,202, 9,100, 93,107,165,223, 31,194, +119,211, 44, 86, 74,184,195,234,108, 53,213,195,137,213,238, 7,137,114,110,180,129, 83,197, 19,203,235,111, 69,248,224,153, 62, + 14,198,235,198, 75, 49, 69, 66, 81,181,130,119,116, 55,216,142,227, 24,138, 39,231,230,241,204,185,235, 39, 65,176,255,253,194, + 15,119,254,186, 5,107, 33, 4, 46,167,242,179,174, 63,238, 87,223,172,190, 80,152,127,165,202,170,105,216,157,112,103,252,200, + 84,217, 47,189,168, 47, 66,246, 79,150,166,222,111,215,161, 96, 12,221,204,123,165, 35,174,191, 88,127,106,106,170, 72, 2, 49, +247, 33,174, 85, 78, 47,111,188, 19, 65, 13,158, 63,244, 56,113, 90,162,254,119, 11, 87,126,121,116,253,203,249,111, 31,191,185, + 15, 45, 8,189,140,152,200, 80, 45,134,220, 36, 38,183, 52,107,138, 54,119,108, 30,246, 50,123,124,238,193,243, 63,102,166,103, +158,252,253,132,102, 16,200,113,201, 43,239, 4, 45,120,118, 75,115, 33, 92, 60,182,109,136, 24,196,221, 68, 1, 76,165, 96,208, +101,148, 33,131,120,168,209, 44,225,196, 43, 57, 89, 66, 70,167, 9,238,137, 14,115, 75, 4, 67,184,156, 45,239,244,118,185,125, + 41, 98,152,136, 98,171, 54, 46, 29,248, 43, 44,187,217, 94,243,172, 28, 92,112,142, 18, 56, 49, 98,112,149, 17, 97, 89,139,152, +107,149,220,209,102,167, 89, 45, 84, 27,205,134,170, 40, 97, 63,100,213, 78, 72,106,172, 51, 60,216,155,171,206,182,247,187,184, +168,182,186, 91, 17, 65,152, 85,172,179,213,109, 97,117,228,143, 9,134,140,219, 69,214, 53,217,212, 8,156,239,146,134,207, 92, + 60,251,117,177,249,231,133,159, 47, 75, 69, 91,234, 4,210,102, 83,106,182,165,246, 94,212, 13, 98,115,204,152, 60,195, 8, 50, + 57, 88,253, 39, 92, 95, 81,120,192,146, 66, 62, 60,163,169, 68,255,103,134,187, 70,241,187,174,177,139,231,111, 88, 47, 81,206, + 7,127, 90,142,148,247,165, 66, 94,242,115,244, 57, 99, 30,246, 55, 69, 82, 50,144,130,142,244, 95, 75,106,181,169,110, 39,138, +196, 24,136,244,182,121,243,109,119,160, 82,193,120, 60,234, 57,140,248,144, 16,141, 11,166,147,181,179,248,233,235,109,210,214, + 67,190, 32,113, 86, 17,176, 67,109, 77, 22,170,107,173, 85, 24,170, 99, 57,120, 58, 56,196, 67,154,206, 17,240,125, 18, 31,178, + 92,148, 31, 47, 95,189,187,120,207,247,242,176,165, 90,229,100,125,163,206, 41,132, 88, 55,108,236, 36,110,235,152,225, 16,204, +252,166,228,143,107,231,176, 71,148,138, 36,186,109, 60,230, 66,184,111, 83,198,129,107,217, 5, 52, 9,207, 25, 2,178,228, 86, +118,251, 29, 86,165,226, 29, 19,153,169,128,100, 83,243, 26,209, 53,168, 35,137,208, 17,220, 29, 2, 19,134, 86,144,169, 89,178, +151,145, 15, 51,243, 73, 82,251,228,116,125,115,233,227,155, 83,154,175,195, 51,249, 34, 74,227,200, 36, 21, 72,182, 36, 60, 95, + 40,225, 1, 54, 31, 61, 43,133,235,134,102,164, 60,252,143,106, 55,210, 8,238, 75,207,208, 68, 79, 68, 99, 92,212, 46, 54, 64, +176,151,184,132, 88, 84, 33, 29, 86,151,252, 47, 0, 83, 87,211,227, 54, 21, 69,159,237,216,147,100, 38, 83,135, 52, 31,157,102, +146, 50, 3,162,160, 86,165, 2, 33,212, 13, 11,216, 13, 27,196,142,191,208,223,135,132,144,168,212, 46, 88, 33, 42,102, 68,171, + 2, 29,165, 19,231, 99, 18, 39,182, 99,199,223,177,185,231,218,131,144,102, 21, 77, 62,222,243,187,239,157,115,223,189,231,148, +248,157, 5,129, 33,136, 67,176, 20,145,150,239, 2,200, 57,165,204, 79,113, 68,197, 89,186,114, 23, 68, 27,107, 90,157, 47, 25, +254,167,118,175, 64, 53,169,166, 85,209, 35, 46, 75, 44,222, 43,235,251,205, 7,131, 71, 51,107,218,107, 30,209,217, 0,175,203, + 52,216, 2, 54,102, 75,107,198, 53,165,101, 59, 75, 41,105,204, 39,248,127,133, 71, 52,204,198,158, 78,211,163,226,172,142,136, + 92,192,183, 79,134,104, 48,220,160, 88, 83,245,176,174,123, 91,167,223, 30,186,190,205,162,228,249,194,190, 38, 36, 78,113,235, + 65, 25,174, 84, 14,185,221,104,127,122,242,153, 31, 5, 9,172,232,193,154,115,214, 98,237,220,234, 60, 62,253,226,242,250,111, +182, 81,197,213, 25, 69, 62,173, 34, 10, 22, 66,208,244, 99,130, 52,132,225,178,144, 10, 73,100, 34,212, 25,148,235,229, 76, 22, +126,226,140,242, 75, 35, 54, 14,235,245,253,154,198,217, 94, 9, 1, 1,162,205, 74,169,146,198,216,138, 54,219, 74,174, 34,108, + 98, 41,245,119, 65,148, 39,126,236,141,109, 99,108, 77, 38,235,217,179,183,191, 94,204,255,186, 92,143,232, 88,189,178,141, 77, +232, 76,207,141, 87, 47, 46,246,104,220, 27,245,213,232,207,119,166,161,230,242,135,221,234,212,117,104,117, 33, 57,173,176,173, + 12, 91, 64, 20, 85,228, 52,198, 65,163,222,171,213, 8,223,107,169, 80, 19,161, 10,201, 14, 83, 43,136, 93, 63,134,250, 26,141, + 45, 76, 14,114,229,218,219, 20,192,159,177,210,206,218, 66,182,254,142,222,247, 2,135,254,101,225,206,246,112,115, 5,231, 99, +110,212, 70,167, 33,192,237, 46,182,189, 53, 29, 78,116, 12,211, 35,120, 56,120,252,203,197, 79,237,131, 94,169, 10, 0, 17, 32, + 4, 7, 92,173,235,122,183,121,196, 42, 2,240,164, 39, 72, 53, 89, 27,243,245, 20,115, 35,203,180,221,247,223, 27,236, 16, 93, + 91,203,133, 58,227, 54,246,136, 16, 87, 20,232,211, 29,214,154,244,138,237,175,105, 29, 64,194, 1,229, 1, 92,122,148, 97,127, +156,174,198,155,208,125,120,239, 17, 65, 87,154,213,182,222,165,195,142,152, 34,177,162,239,159,252,112,181, 28,105,156, 30, 49, +157,197,120,113,165, 41,112,243, 49,157,149,235,111,158,158, 61,125,126,254,124, 71,103, 44,250, 54,165,211,222,233,194,158,126, + 50,124,240,245, 87,223,156,191,254,131, 2,126,208, 30,210,143, 20,240,197,189, 85,136, 32, 85, 88, 30,245,164,251, 62,197,182, +190,223, 10,163,224,236,243,111, 21, 84,190, 70,183, 15, 90,232,137,203, 18,218,166,239, 54,239, 58,104,122, 66,194,155, 27, 85, +178, 32,132,107, 45,241, 18,248,186, 75,121,163,218, 8,146,232,184,117,236, 22, 85,158, 10,164,150,234, 90, 53,192,173,177,111, + 7, 54,205,246,189,238,112,229,154, 10, 19,117, 85,170, 4,252,184,102,214,124,106, 77, 52,102,129,184,209,137, 67, 90,213,208, + 57,136,188, 86,163,157, 64,137,161,212,192, 87,184, 69,169,166, 53,228, 44, 50, 55, 35, 51,137,238,188,113,155, 79,134, 8,121, +107, 43, 54, 62,225,247, 4,239,247, 21,130, 71, 21, 53, 94, 45,188,249, 63,172, 35,194, 53,118,236, 76, 93, 97,182,139, 36,123, + 33,224,174,241, 95, 69, 46,119,121, 34,128,216,232, 41, 62, 19,177,221, 10,203, 18,230, 18,240,124, 57, 17,203,169, 88, 24, 98, +110,136,241, 59, 49,155, 11,199, 21,113, 84,138,143,209,150,250,179,246,227,185,175,214, 43,167, 7,173,125, 69,213,213,234,253, +163,251,107,111,157,114,215, 34, 45,191, 65,187, 79, 35,221,112, 3,221,141, 3, 47,192, 61,205,222,119, 95,158,253,246,246,101, +130,155,106,162, 31, 17,129, 95, 11,218,238, 81,217, 37,157,137,143,143, 63,186,118,150, 20,152,191, 95,190, 92, 58,115,130,246, + 76,216, 81, 36, 66,192, 20,234, 26, 82, 22, 38, 97, 71,239, 4,161, 79,168,124,229,152, 39,189, 15,130,200, 31,118,134,166, 99, + 18, 51,160, 41,165,239,164,248,160, 15, 79,185,173,129,245, 63,136,245,194, 70,212, 11, 60,151,130, 34,142,196,205,214,153, 21, +198,103, 92, 9, 67, 15, 14, 91,115, 97,135,192, 77, 15,197, 13, 33,161,185,162,203, 15,180, 12,254,165,128,221,142,111,193, 9, + 67,193, 29, 54,231, 29,145, 15,227,105, 87,171,106, 21,217, 14,194,127,133, 32,116,126,227,183, 91, 86, 24,202, 76,122,112,253, +160, 65, 45, 3, 56,245, 72,239,155,238,146, 86,187,166,213, 98, 52,238, 73, 5,230, 40,101,135,111,178,239, 69,166,136, 94,250, + 87, 0,154,174,165,181,137, 48,138,206, 36,147,204, 76,147, 52,105,218,105,227,179,181, 62,208,162, 21,109,197,138,143,165,184, +208,157,232,143, 16,252, 41, 46,252, 3, 34,184, 85,144,130,149,130, 32,184, 83,169,134, 90,144,162,109,131,166, 49, 77,154, 78, + 50,153, 87,230, 17,207,189,223, 20,178, 9,132, 9, 51,115,191,251, 60,247,156, 67,252,204, 80,104,210,211,229, 88,133,196,159, + 42, 76,205, 79, 47, 52, 58,117, 73,192,119, 82,137,222,172, 19,218, 9,201, 85,194,105, 67,229, 11, 98, 94, 70,206, 14, 98,159, +203, 62,174, 2, 3,175, 97,214,197, 20,204,116, 14,108,215,130, 11, 40,228, 70, 97,254, 60, 84, 38,150, 33, 35, 63,153,205,232, + 92,144,198,162,181, 47, 90, 52,172,181, 70, 48,115, 28,131,123, 87, 31,108, 33,250,113,239, 15,166,140,251, 68,105, 60, 36,109, + 94,228,254,254,185,163,231,183,155,191,168, 11,150, 18, 93, 89, 65,207, 68,188,219,204, 4, 68,218, 30,120,247,141,206,174,237, +245, 4, 41, 61,169, 80,101,180, 48, 14,154,102,163,105,146, 40,140,104,121,148,137, 7,216, 45,231, 12,219,235,250,129,235, 34, + 26,249,253,144, 23,164, 73,220, 34, 10,188,216,139, 4, 1, 49,157, 13,185,175, 33, 5,103, 70,110,177,204,198,115,130,148,128, +119,139,101, 17, 49, 84, 37,133, 32, 90, 76, 99,224,143, 66,123, 66,228,238, 85, 73,215, 8,156,144, 73,227, 39,118,228,180,252, +131,186,213,248,178, 83, 93, 94,123,191,188,182,242, 98,249,213,106,117,165,186, 83,117, 3,155,230,170, 67,191,222,181,101,230, + 37, 87, 50, 56, 0, 60,241,130, 71, 80, 88,188, 60,150,178, 82,234,242,113, 99,198, 40, 26,227, 72,230, 16,222,149,113, 21,225, + 17, 87, 15, 71, 97,102, 3,218,130,238, 83,106,175, 70,204,142, 38, 39, 48, 43, 88,170,166, 49,102, 6, 53,141, 88,110, 22,249, +195,180, 49,219,117,205, 48,164,165, 33, 56,116,184,254, 74,241,104,219,110, 35,142,238,219, 45, 70,128,164,198,242, 99, 54,145, +185,203, 9, 48,142,176,246, 97, 65,203,163,214,193, 3,196, 19,222,235, 54,105,246,158,128,157,168,117,232, 12, 28,150, 81, 37, + 43,198,105,175,181,118,110,204,221,113,137,203,211,121,120,235,225,183,173,175, 90, 38,199, 41, 51, 13,108,120, 17, 31,197,165, + 84, 42,140,163,166,238, 59,214, 70,109, 29, 14, 29,111,191,135, 51, 35,167,116,133, 74,132, 90,115,123, 16, 17,220,240, 72,249, +248,147,251, 79, 23,238, 46,126,255,252,109,128,148, 44, 12,224,112,175,220, 95,220,253,185,235, 7, 78,177, 32,118, 97, 76,220, +255,169,201,217,183, 31, 95,227,133, 76, 79,157, 70,232,194,139,190,118,230,250,190,213, 98, 69,217,156,150, 86,225, 20, 17,105, + 98, 94,241,131, 53,194, 78, 90, 44, 86, 69,126,132,123, 37, 37,125,204,242,187,242, 80, 22, 50,103,149, 82,229,226,137,121,228, + 52, 61,167,167,103, 85, 54, 8,202,216,243, 89,125,175,187, 55, 99,204,208,242, 75, 28,149,114, 37, 26,215,179,126, 18,109,237, + 13,220,182,181,207,155, 89, 35, 41,150, 22,226, 58, 82,191,117,225,102,227,160, 33,224,128,156,210,134,248, 35,164, 5, 60,111, +164,141,110,246,236,140,182, 19,205,204,104,160,170,250,120,222,240, 99,111,199,114,151, 66, 69,154,155,144, 58,150,100,245, 37, +143,200, 17, 6,158,235,154, 45,167,221,112, 58,117, 18,146,149,197,132,239, 80,229,150, 46,199, 8, 72,133,253, 59,125, 88,178, +131,188,124, 38,161,252,101,120, 38,223, 19,211,131,161, 34,132,239,243, 60,201,243,105,132, 27,242, 38,242,144,217,109,211,188, +106,241,169, 32,119, 46, 70,197,194,203,239,239,158,175,127,120, 86, 93,125, 83,219,248,209,252,125,126,180, 82, 82,115,126,140, + 50, 52,238, 17,135, 93,200, 11, 38, 67,150,131, 28, 86,198,142,192,120,112,215,255,204, 61,179,111,206,157,188,132, 92,152,166, +169,172,222,133, 52,145, 92, 33,159, 71, 60,171,242, 72, 25,169,133,231,121,143,110, 63,254,219,254,139, 88, 14, 43, 90, 58,187, + 52, 85,158,172,181,254, 16,225,124, 24, 56,174,125,204, 56,177,185,187,105, 20, 39,154, 38,117, 84,250, 94, 31,246, 38,184, 24, + 37, 22,173, 65,224, 39,250, 7,234, 36, 68,122, 70,135,227,242,153, 59,232, 80,162,233,176, 89, 60,140,133, 72, 13,241,227,210, +164,135, 80,239,121, 61, 31,243,194, 51,147,249,112, 51, 77, 74,154, 25,244,180,104,248,136,132, 48,173,176, 67,231,142,180,162, + 48,152, 70,124,141, 89,252, 32, 45,112, 45, 28, 35,216,161,114, 51,134, 43,218, 17, 85, 19, 64, 59,102, 47,161,217,106,207,237, + 33, 56, 6,145,239, 39, 8,102, 1,229, 73,252, 58,142, 21,204, 0,105,147,156, 98,192,183, 36,253, 23,128,167,107,233,109,226, +140,162, 99,123,198, 99,123,198, 19,103,226,132, 36,118, 66,104, 77,128, 54,192, 2, 16,162,139, 10,241,216,118,211,178, 98, 19, +126, 13,255,160,255,160,187,170, 82,187,233, 47,168, 80,213, 42,170,154,182,180, 16, 33,226, 4, 59, 49,182,231,253,240, 60, 60, +189,231,126, 6,201,171,216,241, 99,230,222,251,221,199,185,231, 8,252, 76, 73,116,127, 4, 88, 16, 39, 27, 56, 25,102, 19,127, + 28,131,104, 27, 31,214,172,153,228, 69, 20,162,174,108, 94,191,243,233,157,163,179, 87,140, 40, 71, 53,192, 66, 82, 88, 54, 99, +150, 24,144, 3,243, 20, 69, 90,111,109,176,126, 83,192,156, 72, 8,187, 9,107,101, 8, 38,227, 2,224,179,134, 23,187, 50,104, +242,177,241,152,177, 62, 6,253,123,146, 70, 53, 62, 84,201,156, 77,173,125, 58,125, 91, 97, 54,189,124, 33, 22,157,138,226, 7, + 12,156,116, 11,147, 88, 22,165, 8,226, 44,106, 44,173, 90, 7,254, 93,208,103, 21, 69,163,174,211, 15, 72,241, 76,161,215, 13, +250, 43, 54, 3, 97,207, 50,213,194,140, 86, 66, 39,113, 6, 92, 29,213, 7, 81,198, 83, 85, 33, 91,196,109, 88, 92,219,142,185, +189,164,181,188,153,197, 59,136,165, 84, 46,176,200, 63,175,240, 28,146, 10, 61, 10,109, 56,228, 40, 22, 23,153, 96,192, 47,192, + 9,200,203,144, 98, 39,153,213,172,202, 80, 56,197, 13, 46, 45,102, 44, 48, 25,225,104,168,129, 33,219,144, 43,243,121, 57, 73, + 36, 39, 10,172,192, 29,186,246, 27,111,252,199,217,104,224, 5,118,146, 90,179,153,147,100, 65, 66,185, 9, 61, 80,135,210, 43, +165,121,201, 10, 19, 55, 74,100,181,249,251, 73,240,239,212,233,251,254,105, 16,141,163,184, 99, 92, 27,132,144, 55,251,114,247, +113,165,164,142,194,161, 82,110, 8,164, 19,136, 35,153,199,101,150, 6,128, 62, 20,232, 3,144, 35,181,244, 21, 0, 24,162, 41, +175,129,104,105,150,157, 57, 20,107, 64,151,182,187,126, 21,129, 91,202,155,106, 51, 2, 6, 67, 17,165, 15,175, 96,160,183,198, +109,211,144,238,233,205,157, 91,183,123,119, 95,246,255,210,106, 6, 58,250,101,153,156, 39,129,150,102,149, 98, 16, 35, 53,212, + 55,231,175, 40,217,255,231,228, 79, 74,231, 41, 77,254,237,232, 87,186, 40,171,198,218,211, 7,251,228, 13,189,245, 93, 64,101, + 98, 27, 1,183, 90,119, 3,123,255,171,253,254,217, 49,157,199,192,141, 84, 84,122, 80,189,213, 93,238,222,222,189,123, 62, 61, + 39,235,167, 0,253,226,239, 95,172,254, 68,145,101,179,185, 98, 7,246,131,251,143,126,248,238,123, 93, 51,122,221,203, 87, 54, +123,150, 59,217,110, 95,114, 98,119, 48,233,211, 15,255,230,139, 39, 35,123, 52,178,135, 32, 43,189,116, 99,111,103,239,229,187, +255,252,196,139,153,129,163,170, 52,232,228, 36, 35,169, 43, 53, 88, 69,154,117, 87,118, 32, 7,130,243, 9, 35,135,156, 47, 33, +217, 17,165, 11,126, 20,156,140,143, 45,111,196, 60,172,137,180,104,203, 2, 62, 75,145, 5,134, 81,100,100,225,109,163, 77, 86, +125,125,123,143,204,248,241,141, 71, 77, 88, 35,234,158,103, 15,159, 29, 30, 31,246,214, 62,233,152, 27, 99,151,174,124,225,133, + 14, 88,181,113,234, 0, 88,114,161,117,129,163,107, 5,164,220,121,198, 66, 64,197, 82, 99,153, 34,212,134,121, 49, 74,125,114, + 79, 25,156, 66, 81, 90, 46,228, 65,176,117,111, 75,242, 3,198, 71,198, 20,221, 65, 40, 13,230,183,132, 69,131,225, 40,101, 65, +215, 9, 16, 95, 73,180,255, 23,192, 27,249,195,136,149,146,119,245, 3,254, 29,248,200,130, 95,192, 45, 25, 65, 30, 81,250,200, + 70,190,208,130,146, 56,209, 64,250,114,176,218, 63,168,126,123,248,243,215, 63, 62, 63,120,255,214, 9,131,182, 82,127, 31, 77, +143,236,211,159,134, 71, 70, 77,239,233,109,114,174,152,123,179,162,225, 46,136, 93,157,208, 99,191,203,194, 4,128, 58,203,159, +118, 87, 59, 19,215,138,178,164,165, 25,148, 79, 76,252,169, 72, 53,221,208,171,171,208,147,160,240,247,122,240,186,161, 82,154, +136,145, 15, 5,110, 58,140, 81,253,215,154, 91,107, 59,172,167,230, 95,221,188, 70,239, 64, 85,126, 9,228, 40,169, 16,242,165, +111, 11, 5, 66,112, 35,170,201, 60,255,108,235,243,115,103, 72,230,135,201, 54,247, 21, 48,112, 82,213,148, 79,116, 33, 78, 7, + 20,205, 28,178,192, 57, 47, 23, 50, 27, 71,206,125,102,186, 58,101,250, 14,160, 83,172, 84, 77,205, 52,245,229, 20,235,129,188, +177, 7,127,103,200, 31, 26, 93,208,177, 52,117,147,204, 96,165,217, 46,164,197,122,182,192, 88,242,240,166,224, 98, 87,210, 85, +173, 81, 5, 39,127,103,121,131,222,128,170,189, 10, 87,108,116,199, 20, 89, 49,234, 75,116, 14,181,151,214,129,152, 44, 82, 48, +181, 41,128, 78,170,138, 26,231, 17, 55,165,231, 98, 2,251,191, 0, 76, 93, 75,111, 27, 85, 24,245,248,206,203, 30,123,198, 99, + 59,118, 43, 59,145,210,135, 16,136, 70, 72, 8,137, 13, 66, 98,129, 42,117, 95, 21,129,248, 3,236,145, 96,207, 63,224,143,116, +201,134, 85, 91, 80, 85,144, 16, 18, 77,219, 4, 42,146,224, 4,231, 81,123, 60, 47,219,227,225,156,239,218, 18,155, 40, 89,216, +185,115,239,157,239,121,190,115, 54,252, 4, 26,162, 47,139, 94,183,116,201,181,180, 30,120,165, 21, 88,166, 66, 25,178, 26, 71, +163, 40,141,102,121,196,152,116,133, 16,209,129, 45,158, 47, 83, 73,252, 89, 15,170, 35, 37, 51, 77,220, 38, 68,133,115, 56, 25, +131,124,248,134, 84,220, 96,224, 56,216, 66,100,206,162, 65, 27,145,102,139, 24, 6,174,144, 18,231,245,112,160, 73,133,112,179, +107,182, 7, 55,235,215,252,147,203,163,229,134,179, 16,143, 79,190,236, 69,170, 59,185, 48,184, 82,255, 45,250,126, 15,121, 25, +103, 86,149,181,187,181,139, 7, 78,243, 24, 71, 21,101,179,155,253, 91, 97,189,141, 35,199, 35,182,234,237, 73, 74,253, 41,167, +234,148,164, 72, 44,164, 31, 93, 25,132,156, 90, 20,117,109, 22,166, 12, 29,223,110, 70,146,201,157,128, 76,202,118,143, 47,143, +152,117,177,203,107,120,190, 10, 58, 86, 0, 79, 98,155,174,171, 92,167,138,144,197,181,201,180, 94,119, 89,171, 49, 5,172,172, +100,217,134,124,159,176,125,173,214,154,185, 70,181,162, 5,188, 11, 13, 90,210, 19,114, 92,142,226,212,165,146,255,163,100,132, +197,116, 36, 3,176,100,102, 81, 73,118, 36, 90,156,200, 99,105, 89, 11,131, 10,223,120,131, 79,227,228,245,249,155, 64,133,182, +193,238,161,135, 20,210,168,228,101,142,213, 37,139,196,119, 90,135,227, 67,248, 5,196, 41, 29,175,187,192,251,190,146,107, 32, +199, 94,136, 86,248, 59,195, 59,163, 41,226,187,178,219,236,226,184,113,189, 16,110,151,226, 75, 17,176,124,246,209,151,135,103, + 7,231,209,121, 41,132, 89, 88, 12,156, 4,110, 8,118,102, 69,136, 58,145, 42,196, 14,145,199,108,129,253, 28, 93, 28,177,133, + 40,202, 42,190, 23,132,205,246,150,223, 31,118,119, 24,230, 35,102, 90,102,142,213,248,224,246,135, 73,158,118,155, 29,215,169, +229,243,140, 32,232,124,246,243,254,163,227,241,223, 72,228, 79,175, 78,240, 70, 16, 98, 33,220, 65,207,246,159,230, 34,155, 32, + 58, 33,133,104,252, 58, 45,175,123, 52,254, 19, 95,184,219,187,121,255,147, 7,129, 27,196,243,248, 74, 8, 29, 29,133, 60, 70, + 77, 35, 66,161,103,217,196, 49,189, 87,255,188,252,246,139,111, 30,255,246, 8, 49, 93,219, 11,159, 31,255,129, 80,250,237, 91, +239,110,247,119,126,122,254,228, 96,116, 64, 56,141, 82, 91,254,117,118, 80, 57,255, 92,122, 86, 3, 47, 18,220, 79,178,156,217, + 85,170, 63,107,130, 60,152,146,160, 70, 36,149,210,153,163,194,227, 43, 68,250,253,112,128, 29,189,214,234,197,105, 50,100,101, +134,253, 52,153, 29, 37, 79,234, 32, 28, 18,224, 49, 29,167,121,246,106,244, 18, 59,153,137, 30,239,197,244, 50,206, 98,156,238, + 36,153,244,130,254, 52,158, 8,226,187,130,221,198, 29,222,233,236,156,145,184,152,147,200,131,246, 54,140, 90,179,214, 36,204, + 95,184, 81, 83,206,193,226, 18,100, 69,145,113, 12,213, 84,113,182,124,127,111, 80, 49,151, 8,225,203, 36,157,207,231, 11,178, +143,174,187, 80, 34, 44,186, 81,141,170,104, 44, 39, 46, 28, 47,168,134,107,211,154,107,155,238,152, 34,191, 39,229, 26,165,251, +217,213,255, 65,242,214, 68,119,242,147,197,227, 74, 13,159,245, 42, 63,212, 95, 60, 93,124,191,255,227,119,191, 62,236, 89,205, +175,223,187,247,213,222,167,159,191,245,241,221,193, 29,171, 52,126,191, 56,248,229,236, 69, 81,181,246, 90, 67, 26, 42,211, 78, +101,218, 92,114,107,218,250, 27,215,110,192, 89, 22,100,194, 48,224,152,177,141, 4, 79,211,135, 24,176,254,200, 38,109, 69,234, +105,137,109, 61,173,138,211,112,235, 13,219, 67,252, 46,162,204,116,172,233, 50,143,243,104, 60,249, 23,127,245,154,189,215,227, +191, 96,103,176, 82,191,238,195, 1, 8,171, 76, 44, 35,111,120, 51, 9,223,130, 79, 57,155,156, 82, 91, 64,106,212, 26, 84, 14, + 75, 29,214, 67,105,188,241,169,241, 59, 46, 21,108, 29,231,213,181, 56,163,204, 46, 73,123,156,185, 5,197,234,171,170,144,115, + 73,115, 14,103, 5,181,208,115,107,136,108, 76,166,239,165, 18,114, 45,139,201,188,133, 36,187,237,119,166,105,164,216, 99,180, +245, 68,210, 6, 33,201, 60, 26,134,123,187,187,125,250,230,228, 10, 97, 94,158, 90, 18, 43,138,237,224, 49,194, 48,194,120, 38, +121,164, 11,152, 50,254,183,198, 71,174, 5, 67, 54,252,239,255, 9, 64,212,213,244, 52, 17, 69,209,249,108, 59,211, 50,150,148, +106, 91, 74, 98,160, 64,136, 9, 70, 99, 84, 84, 18, 18, 55,254, 2,227, 74,253, 35,198,184,114,233, 63,240, 63,184, 54, 33,110, +116, 69, 32, 46,212,184, 48,109, 20, 41, 45, 12,195,116, 94,167,243,209,105, 61,247,190,130,187,134,164,101,230,189,119,239, 59, +247,235,156,203,249,166, 41,224, 9,171, 58, 80,115, 18, 13, 98,144, 60,102,118,217,179,115,161,118, 73, 23, 63, 48,154,169,229, +164,204,180, 84, 92,194, 97, 89,174,181,206,130,211,198,124,211, 27,121,105, 70,141, 4, 82, 25, 86, 38,146, 94,189,121,253,105, +119, 87, 99, 27, 72, 25,229,210, 76,255, 92, 69, 39,205, 54,146, 94,131, 57, 97,173, 99, 34,222,164,149, 99,189,249, 49,119, 55, + 82,151, 78,177, 48,135,231, 1,100, 34, 41, 53,190,245,240,134, 65, 24,200,176,176, 62,223,108, 84, 22, 61,129,187, 97,236, 9, +143,178,111,154, 14,231,178,190,184, 33, 70,130,233, 92,116,108, 57, 49,163, 77,229, 24,148,206,199,125, 34, 3, 28,252, 47,248, + 32, 68, 61, 64,247, 36, 13,193,213,150, 9,143, 89,113, 64, 67,251, 52, 76,133, 34,197, 54,153,196,176, 82,183,180,156, 66,219, + 5,104,170,206,254, 12,103, 25, 71, 83, 58,143,163, 52, 74,198, 82, 11,141,144, 27,235, 92, 76, 37, 27,222,148,220, 6,190,104, +231, 12,219, 50, 44,219,156, 3, 64,133,195,200, 27, 5,203,180, 1, 5,109,186, 48,168,250,101,112,165,210,100,246, 39,122, 96, + 53, 29,171,136,173,113, 87, 98,117, 19,196, 48, 25,204, 91,203,100,218, 71, 51,166,154,142,243,215, 13,250, 71,194, 59, 10,130, +163,129,127,226, 15,162, 56, 58,143,252,100,146, 30, 15,186,153,146, 16, 33,179,166,198,136, 85,112,162,213, 73,163,188,132,247, +178, 73,253,106,225,206,234,189,175,157,125, 46,252,147, 26, 42,226,253,132,217,135,238,174,220,239,249, 61,156, 92,192, 97,220, +181,197,124,233,249,206,203,131,246,190, 73, 19,148, 6,115,123,229,164,239, 0, 92,194,187,194, 23, 19, 61,249, 36,131, 17,206, + 19,156, 31,150,108, 7,176,215, 27,250,125,255, 88, 68, 60,244,203,203,129,253,237,244,126, 81, 66, 83, 55,176, 77, 42, 57,238, +172, 86,110,112, 21, 71,123,124,243,201,239,126,123,115,249,118,255,252, 24,103,191,234, 84,163, 56,188, 94,107,141,121,228,173, + 84,112, 0,234,227, 36,244, 71,131, 86,189, 21, 70,145, 47,220,178, 85,198,107, 81,205,156, 69, 24, 96,153,142, 81, 26,210, 24, +228,244, 92,184,103,194,197,135,131,159,123,238,192,133, 91,175, 87, 26,167, 76,153,251,183,219, 57,236, 29,222, 88,218,196,125, +128, 39, 15,163, 48, 76,137,116, 97,162, 82,179,124, 66,147,112, 41,246, 7,191,108,229,242,148,200,230, 86,103, 56,229, 2, 21, +252,165, 70, 38, 65, 22,141,168,231,141, 52, 25,145,200,184,153,231, 58, 91,204, 28,166,196, 35,207,200, 49,166,217, 58,172, 24, +238,108,147,238, 66,252, 82,156, 38,150,153,199,179, 97, 23,105, 10, 58, 22,163,120,244,104,227, 33,174, 31, 17,135,212,213,195, +102,226, 5,174,212,156, 13, 35, 33,165,201,137,167,158,154,221, 53,167,224,112,253, 44, 15,139,200,136, 56,136, 38,103,182,214, +174, 41,142,161,184, 3, 53,138,141, 74, 29,183, 99, 74,236,196,255,105,208, 52,166,160,145, 68, 59,218,204, 86,153, 96, 95, 99, + 1, 85,211, 80, 44, 93,177,114,138,101,112, 42,144, 19,241, 50,253,160, 48,126,159, 9, 67,179,253, 73,101,149,162,170,140, 11, +202,199,114,208,173,189,111,127,126,187,247, 97,245, 74,227,221,206,139,237,235,155,110, 28,138, 52, 65,112,120,171,186,178, 92, +172,126,233,119,126,156,181,177, 89,107,206, 85, 88,101, 66, 28, 78,148,231,194,243,195,255,246, 7,167,146,140,147, 39, 16, 85, +127, 24, 48,175,131,186,181,254, 0, 39,166, 31,156,192,167,226, 48,192,155, 39, 92,145,149,253, 84, 64, 9, 82,232, 14,128,143, + 41, 67,152,191, 72,215, 17,123,225,244,202,196,178,164,122,129,177, 99, 59,154, 11, 77,192,127,236,181, 68,181, 51, 39, 69,234, + 46,169, 36,149, 83, 89,171,143,147, 10, 49,167,197,166,178, 49,159, 42,172, 76,164, 46, 71,227, 53,245,194,207,147,117,103,207, +182,159,126,255,243, 77, 78, 99,242, 92, 61, 13, 57,194, 67,152,204, 84,152, 7,236,197,206, 35,132,215, 85,171, 80,154,179, 75, + 97, 72,125,186, 78,177, 76, 77,174,234,140,109, 84,246,228,194, 10, 68, 34,136,199,137,251,122,103,229, 82,246,221, 25,103,246, +120,209, 52,118, 43,220,230,200,216,122, 34, 3,139,139,226,168,157, 43,254, 19,128,168,107,233,109,226, 10,163, 51,227,121,121, +236,201,216, 33,137, 73,131, 28, 92,100, 8, 45, 11, 84,148,166,253, 15, 44,249, 35,172,186,234,170,252, 26,182,136, 5, 43,132, + 4,234,182,139,164,176, 65, 10,137,162,196,196,241,100,198, 30,207,203, 51,230,156,239, 58, 32, 69,222,196,178,238,243,187,231, +123,157,179,178,239,244,208, 23, 69, 74, 51,183,122,157, 85,237,142, 38,218, 2,138,169,113,165, 43,206, 10, 72,166, 88,197,136, +139,237, 23, 6,109,207,241,162,249, 53, 22,215, 22, 97, 9,190,114, 43,158, 37,179, 44,243, 15,239,222,147, 59,133,237, 19, 60, +232, 24, 55, 60,125,161, 58, 40, 69,166,135, 95, 75,201, 47,102,104,171,108,178, 62,232, 13,167,233,181,104,143, 80,213,147, 18, + 81,234,137,147, 0, 40,151,158,194,135,218,238,230,221,147,241, 23,178, 5,177, 15,182, 86,253, 22, 50,207,122, 28, 95,198, 82, + 2, 20,103,113,203, 38,155,160, 66,163,149, 40, 32, 87,100,244,199, 61, 33, 13,214,195, 59,191, 94,205, 46, 1,255,211,156,247, + 7, 48, 51, 41,102,210,111,169, 73,179,104,129,249, 50, 22,172, 47,215,220,174,129,211,222,193,205,100,247, 16,141,171, 84, 31, + 74,101,141, 16,165,147, 21,154,219,200, 22, 38,171,209, 2,190,197,237,183,201, 22,226, 0, 67,186,182, 71,188, 15,227,110,249, +109, 43,240,172,181, 22, 13,189, 50,238, 38,205,185,193,112, 61,110,131,101,185, 77,179,237,153, 77,151,171,230,152, 68, 59,166, +212, 45,195,107, 91, 86, 88, 97,189, 86,148,233, 76, 60, 80,131, 89, 7, 16,176,236,165,106,217, 23,189,177,164,204,146,178,152, +205,179, 56,205,163, 44, 11,147, 36,166,129,168,176,241,166, 97, 68,105,180, 63,248, 29,139, 19,101,209,121,120,158,107, 5,140, + 78,185, 92,120,174,255,112,231,151,211,201, 23,216,217, 48,153,224,160, 7, 78, 48, 97, 50,182,194, 48,143, 78,142,224, 7,112, +136,134,197, 42,221, 37, 21,161, 48, 57,223,109,147,212,179,225,100, 82, 58,169,148, 29,169, 85,198,156, 33,107,137, 84,140,142, +109, 38,132,189, 44, 4,182, 69, 30, 15,118,240,233,254,211,255, 79, 15, 85, 88,146,100,118, 13, 51, 47,242,203,104, 52,142, 71, +240,210,146,124, 62,216, 30, 38,233, 12,192,124, 81,169,162, 52,189, 39,209, 63, 56,194, 56,219, 81, 18,226,119,239,245,238,117, +125,255,120,116,140,147,230, 55,219,155,157,205,112, 26, 62,186,255,168,223,239,159,159, 95, 52,100,113,103, 73,242,247,243,127, +222,188,125,205,130,203,186, 96,161, 58,211, 24, 22,102,113,118,117,166,132, 46,117,106,156, 98,139,108,233, 69, 94,144,181,212, +110,181, 93, 63,240, 58, 73, 58,237,146,162,189,198,240, 4, 87, 74, 99,157,110,182, 28,143, 75,193,164, 52,153,190,155,166, 61, + 75,167,182,105,225,175,215,237,241,148,110,236, 22,139,124,248,211, 16,171, 4, 8,210, 96, 57,178, 6,155,181,127,255,201,225, +241, 17, 53,137,246,254, 0, 24,232, 52,233,212, 2,111, 94, 92, 95,112, 84,117,249,219,207,143,167,243, 89,224,181,169, 33, 91, +107,235,126, 0, 44, 66,133, 16, 38, 78,188,188, 74, 93,211, 38, 60,132,127, 32,165, 53, 59,155,123, 69, 54,249,115,119, 67,239, + 57,218,213, 53, 38,100,108, 15,151,101,158, 69, 99, 65,237,188, 93,170,211, 91,153,107, 67,248,106,117, 37,230,164,240, 59, 62, + 29,209, 89,111,187,228,130,119, 40, 25, 37,184, 94,253,247,123,112,152,206,227,170,163, 10,111,201,153, 83,191,106,125,248, 52, +255,156,143,255,250,247,101, 71,119, 95, 28, 60,187, 29,108,133,121, 22,207,231,152,203, 86,103, 35, 46,179,126,107,171,239,117, +223,143, 62,254,119,117,186,119,235,238,186,229, 45, 52,134,190, 31,236, 60,152,102,201, 36, 9,159, 12, 30,143,147, 80, 33, 0, +225, 71, 89,174,183,215,177,119,135, 39, 71, 56,168, 18,176, 94, 12,122,131,175, 84,230, 3, 32,243,225,178, 4,205, 53,120,123, +189,128, 45,196,138,143, 4, 48,159,118,188, 46, 15,134, 7, 64,129, 66,172, 65,184,166, 26,218,155, 34,213, 11,228,113,195,138, +241,131, 93, 93, 87, 1, 35, 44, 17, 3, 13,134,242, 95,225,239, 82, 32,129,230,222,169,165, 61,168,161, 91, 56, 57, 13, 97,213, +229,205,147,244, 38,190, 48,154,140,128, 0,120,215,249, 92,136,113,224,169, 51,229, 19,200,221,218,190,181, 83,214,176, 36, 54, + 54,143, 98,244,228, 44, 50,132,202, 48,199,177, 9,188, 64, 17,110,107, 18, 70,171,170, 27,175, 94,129, 74,201,165, 98,202,100, +253, 34,149,152, 2,232,218,141,116,159,170,167,252, 33,254,109, 8, 27,216, 55, 1,120,186,150,221, 54,202, 48,106,207,197,115, +181,199,227,164,177,154,184,165, 23,181, 84,144,110, 0, 41, 98,131, 68, 55, 93,116,141, 4,123,224, 33, 88,176,225, 49,120,132, +190, 2, 47,192, 2,137, 74, 85, 37, 72, 42,168,138,226,216,241, 37, 99,207,197,115,239, 57,223,140,217, 88,178, 51,182, 39,191, +255,255,251,206,119, 59,167,181,239,120, 42, 19, 58,245,254, 10,210,238, 72, 53,145,180,247,117, 59,185, 67,254, 25, 44,159,239, + 28, 68,233, 70, 82,198,242, 78,161,152,140,200,178,164, 54,218, 99,210,163, 89,193,172, 81,206, 66, 53, 16,125, 23,132, 63, 61, +225, 11,100, 46,253,200,187, 29, 34,174,228, 38,211,132,212,171,108, 40, 3,203,170,201,153,243, 21,128,154, 82, 66, 33,248, 63, +118,230,117,235,253,208, 22, 61, 25, 14,167, 72,117,212, 64, 66, 81,188, 89, 68,203,166,102,251,255,236, 5,238,137,116,178,156, +217,201,123,180,153,122, 46,165, 12,252,198,213, 94, 40, 83,145,255,241,248, 96, 82,203, 65,189,137,131,230,205,176,149,162, 56, + 8, 3,202,220, 22,155, 85,232,119, 88,130,206, 59,169,102,214,149,174, 71,113,149,230,117,178, 43,119,105, 37,217, 66,172,143, +106, 24, 64, 97,138, 65, 81,116,165, 41,170, 0,224, 27, 68,235, 68,226,166,129,240,165,235,192,160,195,120,244,196,239, 83, 39, +168, 43,212, 93, 76,242,200, 0, 33, 54, 2,251,145,217,149, 82, 53,100,127, 93, 17,179, 86,108,131,215,224,177,239,106,174,171, + 13, 7,186,107,235,174,163, 89,112, 15,166,226,185,154, 97,170, 22,190, 2,214, 5,206,132,242,219,100,231,209, 13,149,170,125, +176, 99, 54, 7, 88, 42, 21,248, 61, 15,178,109,144,135, 0, 8,127, 47,254, 93,167,210,107,164,214,186, 78, 21,233,123,135,247, +177,239,103,219,153,209,179, 70,214, 8,219, 17,214,156,119,218,213,238, 29, 61, 92,132, 51, 3,193,165,240,109,225, 86, 9,222, +201,106,132,165, 54, 97,100,129, 61,129, 76, 57,221,167,145, 87,146,188,158,204,103,169, 85,183,209, 67,151,242, 92, 75, 65,164, +176,232, 1, 95,210,115, 1,195,255, 91, 94, 2,199,219,166,219,228,190, 69,142, 91,207, 68,236, 16,150,154, 52,156, 86, 31,230, +158, 25, 73,126, 64,113,228,143,225,205,214,219, 85, 37,176, 42,203,147,231,103, 47,222,205,222, 33,224,189,190, 89,124,255,205, + 15,175,255,122,101, 81,176, 41,154, 45,230,139,197, 53, 48, 71, 67, 23,124,232, 30, 62,249,228,211, 63,254,252, 29,127, 5, 32, +128,165, 46,132, 44,243,216, 63,158,109,174,176,144,142,233,176,107,162,174,126,250,238,231,127, 46,207, 41, 12,192,122,104, 14, +224,140, 29,139, 43, 61,199, 3,178,249,250,244,171, 56,221,193,236,238,178, 84,149,130, 89, 71,130,140,201,104,226, 57, 3, 4, +224,165, 8, 95, 97, 87,108,146,224,192, 30, 78, 87, 83, 68, 60,211,245,213,217,163, 47,206,167, 23, 10,171, 92,140,105, 46,166, +111,147,116,135,117, 92,110, 87,128,105,107,202, 67,178,101, 80, 78,123, 63,140,195,121, 48, 23, 62,244,194,225,152,110,216, 82, +165,118,213,178, 83,220,241, 39, 0, 15,183,188, 91,240,244,186,162,140, 71, 39,225,110,153,102,212, 20,253,252,196, 55,238, 58, +180,239,105, 10,239, 31,175,103,249, 46, 86, 90,174,203,150, 60,178,229,170,108, 81,124,203,108, 72, 99,160, 11,109,228, 71, 7, +157, 59,163,206,192, 38,138,239, 73,149, 85,217,207, 55,213,123, 38, 90, 28, 36, 75, 33,210,127,227, 95,188, 76, 95,111,244, 90, +137,127,252,237,215,203,237,242,151,179,111, 31, 31, 78,174,227, 16,223,151,101,153,223,247,175,131, 85, 4,108, 93,150, 15,188, +113,152,236,206,183,239,223, 39,241,179,219, 79,128, 90,162, 36,254,242,227,207,182, 73, 52,191,153, 3,147, 81,182,147, 20,111, + 82,202, 21, 62, 40,192,240,241,112,156, 21,133, 80,118, 86, 87,171,203,161, 11, 19,148,184,150, 11,124,192, 24,200,180, 16, 6, + 5,241, 6,158,184,169, 15,197,121, 12,123,177, 12, 87,113, 30,137, 69,238, 72,231, 11,179,228,167,119,159,190,189,186, 16,133, +131,186,157,202,148,100,181,164, 74,171,227,209,201,120,120,148, 23, 69,223,114,132,127,176, 19,196,193,233,253,167,171,205,186, +225, 70,213, 72, 90,199,249,216, 82, 88,170,132, 60,159, 25, 88, 96, 35,223,241,147,156,138,128, 88,164,129, 61,196,209, 96,113, +149,103, 90,243, 7,126,195, 12,102,155,118, 94,151,158, 55,100,154, 58,227, 1,193, 93,121,166, 59,234,251, 64, 24,216,203, 77, + 86, 65,218, 86,100,137, 69, 34, 10,152,176,145,143,166, 20,118,145,214,162,237, 5, 8, 8, 31,216, 12, 74,201, 48, 80,203, 92, +179,231, 49,227,239,245, 65, 0,162,174,101,183,109, 35,138,142,248,126,137,146, 31, 98, 12,229, 97, 57,109, 12, 56,173, 54, 65, +128, 34, 64, 22, 70, 55, 45, 16, 32, 64,183,253,174,126, 71, 23,221, 21, 93,180,235, 44,210,160, 40,210, 85,147, 58,142,171, 56, +150,100, 81,162, 40,141, 36,138, 61,231,146,110,224,149, 1,154, 30,146,119,238,107,206, 61,231,127,255, 94,247,107,212, 39,154, +155,106, 32, 77, 85, 5, 28, 60,143,103, 11,168,136, 64,198,205,186,130,140, 18, 72,131,204, 61,172,228,198, 97,109, 21,116, 50, +244, 56, 36, 22,184, 17,162,168,199,141,148,227,213,132,120,233,122,142,244,176, 19,221,250,247,250,162, 98, 81, 45,168, 45,199, +102,189,235, 4, 48, 28,124,158,195,228,136, 44,204, 12,138,130,105, 89,229,228,130, 16,129,231,170, 7, 47, 71,213, 38, 7, 36, +132,155, 23,182,190, 46,244,151,119,251,184, 42, 39, 87, 81,236, 83, 90, 83,203,177,181,179, 94,105, 89,188,155,243,152,151, 40, +218, 56,138, 29,155, 7,176,170,166,186,196,166, 26, 33, 75,133, 35, 36, 79,136, 80,140, 45,245,124, 83, 20, 21,123, 39,220,153, +170,240,136,138,119,196,211,181,227,200, 12,241, 75,217, 68, 13,230,152, 62,189,185,217,244, 45,215, 71, 57,107, 89,162,194,233, +218, 13,184,105,120,124, 7,235, 48,101,130,133,153,190,208,153, 81,238,212, 40, 72, 56,128, 42,140,236, 32, 53, 61,221,182, 68, +130,239,146, 18,197,178,106, 62, 34, 70, 67, 75,213, 59,175,144,201,153, 6, 81, 37,184,191,225,217,130, 92,166, 1,201, 52,167, +148,204, 21,153, 51,137,118, 77, 94,131,181, 5,161, 25, 70, 8, 0, 44, 41, 96,103,210, 76, 68, 33, 98,145,242,222,144, 76,159, + 16, 35,120,142,124,186,200,198,217,236,125, 58,152, 46,211,221,160,221,246, 99,100,157,139, 98,153,173,230,221,248, 54,214, 49, + 72, 47,132,175, 87, 57,142,139, 13,112,208,238,222, 77,122,249,130, 35, 60, 27,169,101,132,199,134,162, 54, 20,163,193,163,154, + 86, 28, 52, 41,169, 42, 52,203, 68,158,177,237, 48,171, 7,207, 68, 77, 11, 70,130,143, 8,231,139,181,105,173, 17, 34,241, 48, + 34,198,100,146, 85,106,145, 57,182,135, 96,223,237,220, 65,202,182,219,108,227,143,142,187,199,248,239,212,183,154, 93, 85,132, +101,122,179,254,230,201,183, 47,255,122,249,176,119,178, 92,173,210,241, 4,183, 26,205, 70,204,199,203, 98,191,189,143,189,141, + 40, 50, 95,206, 38,249,245,239,175, 94,196, 97, 12,183,139,114,219,119,189, 4,105,126, 54,185,154, 94, 62,255,234,187,243,225, +249,110,188,151,102, 19, 56,217,159, 94,252,216,242, 91,227,233,112, 47, 78,136,173, 52,204, 8,165, 23,119, 53, 85, 64, 98, 47, +126,243,241,239,163,228,254, 36, 27, 91,108,217,119, 56, 49,159,167,240, 5,168, 74,167, 72, 20, 40, 26,158, 24,242,102,154, 94, +211,115, 92,148,225,211,124, 2, 95,118,208,190,117,124,251,225,135,209, 32, 10,155,100, 47,160,142, 77,185, 90,233,238,238,193, +108,145, 69, 48,163, 82,177,141,190,200, 43, 88,116,255,176,127,118,245, 15, 12,123, 43,186,105, 98, 27,196,146, 33, 20,145,227, +143,213,173, 70, 88,189,158,126,160, 97, 88,132,243,247, 15,246,155,159, 5,106,152,110,181, 94,164, 67,157, 77,101,174, 89,112, + 93,213, 12,254, 13,168,142,244, 33, 74,126, 56,107, 46,152,247,157, 80, 97, 13,134,167, 58, 45,149,116, 84, 20,169,200,248, 68, +167, 85, 40, 85,171, 64,155, 42,178,120,217, 47,254,248,213,157, 63,115,221,141,163, 31,254,248,249,183,139,215,223, 63, 56,125, +126,255,241,229, 34, 39,216,129,167,160,228, 36,240, 29, 55,240,131, 25, 18, 34, 60,209, 78,239,215,247,175, 47,243,193,201, 94, +239,244,243,199,131,116,132,154,254,237,224, 12, 25,192,215,143, 78,151, 75,141,164,219, 32,221,136, 3,207, 78,248, 79,161, 81, + 60,177, 83,103, 84, 72,144,242, 48,185, 55,156, 93, 17,144,190,217,238, 4, 49,114,255,164,149,224,227,134,142, 55, 95,230, 20, +212,149, 67,187, 53,231,150, 11, 4,108,138,204, 75, 24, 70,237,248,230,242,173,186, 65,136,203,240,141, 91, 54,170,148, 79, 78, +202,136,115,112, 16, 86,109, 97,143, 32, 62,117,173,159,246, 79,207, 63,158,173, 89,177,113, 72,138,163, 92, 84,100, 53,233, 67, + 12, 14,114, 63,123,244,236,221,240,156, 99, 74,172,135,232,188,246,227,100,169, 23, 54,158,129,140,170,126,139,115,239,219, 48, + 12, 3, 63,252,162,119,210,187,119,132, 36,118, 52, 25,219,228,235, 38, 56, 59,157,167, 55,212,241, 4, 87, 49, 79, 42,106, 76, + 35,143,118,109,138, 41, 71, 94,120, 51, 45,193,160,130,123, 35,103, 69,192, 32, 40, 81,242,192,178,110,225,151,117, 23,190,209, +248, 79, 0,154,174,166,183,113, 42,138,218,126,137,237, 58,142,157,198, 77,218, 50,109,153, 97, 58,154, 41, 20,144,102, 24, 36, + 4, 69, 8, 33, 86,140,216, 34, 24,193,130, 37,252, 4,254, 4, 75,126, 0, 27, 22,236, 16,235,145,216, 32, 62, 6,166, 72,101, +104,213, 64, 51,105,155,182,147,164, 73,252, 17,251,217,230,220,251, 50,187, 40,145,147,216,239,221,207,119,238, 57,115,125, 15, + 70,194,204, 27, 55,204, 11,102,205,149,114,158,225,242,225,130,227, 60, 86,163, 28,107,193, 11, 97, 66,220,129,119,111,188,133, +109,215, 31,245,120, 58,145, 88, 92,148, 78,130,100,238, 8, 22,198,164, 84, 14, 22, 14,215,223,112,155,216,235, 54,157,190, 86, + 25, 9,147, 43, 93, 79, 53,211, 68, 44, 63, 25, 28,193,236,156,251,164,154,242,179, 89, 50,159,175,226,202, 82, 77, 90, 81, 65, +196,188, 52,248,158,173, 43,219,176, 76,124,140,181,199,166,203,168,237,155,146, 88, 26, 57, 83,193, 18, 78,114,107,237,213,222, +160,203, 71,152,197,157,205,215, 79, 7,167,172,148,198, 50, 49, 52,206,146, 99,221,155,181,165,186, 67,198, 6,159,162,212,202, +217,144,170,116, 68, 41, 9, 22,105,168,121,217, 10,159,164, 57,122,197, 22,216, 63,102, 85, 95,128,121, 85,116,203,196,251,248, +121,170,160,103,169, 70, 25,111,170,150,137,180,201, 80,132,228,164, 5, 90,146, 88,173,100,205,188,162,204, 50, 61,205, 50,199, + 50,239,189,255,222,103, 31,125,178,243,198,155,179,180, 56, 56, 60,142, 99, 84,160, 21,166,147, 86,139,205, 89, 7,131,118, 24, +120, 43, 16, 81,240, 47,104,104,135, 42, 26,161,234, 56,106, 22,230, 26, 15,169, 26,117, 91,184,216, 14, 22, 99,170,241, 30, 2, + 19,145,195, 17, 88,147,177, 78,134,105,209, 60, 58,163, 66, 21,105, 35, 99,227,116,147, 57, 2, 69, 97,233,153,161,157,167,163, +147,232,252,224,226, 0,161,110,205, 95,195, 93, 6,245,224, 50, 25, 19,109, 83,158, 86,153,123,121,201, 15,234,166,143,141, 49, +140, 6, 48,134, 90,181,230,218,222,253,119, 63,253,243,240,119, 24,164, 32, 22,102,214,119,212,244,153,140,113,249, 36, 30,163, +206,101,138, 92, 1,163,162, 14, 30,205,133, 82,131, 50, 73, 97,212, 81,221,241, 92,146,233,160, 70,103, 78, 30,193, 89,116,131, +141,246,134,148,178,115,252,143, 96,115,133, 35,130,155,134,223,231, 25,110,146, 68,104, 56, 13, 44,109,167,219,137,103,211,163, +179, 78,148, 76,254, 59,233,188,114,227,246,249,160,207, 7,232, 36, 58,230,121,126, 33, 11,100,136, 6, 65, 66, 23,190,252,240, +139,135,251,191,194,168, 86, 23,159,107, 47,182,123, 23,199, 72, 71, 30,119,247, 80,148, 76,194, 49,129,190,100, 44,180,202,221, +205, 59, 40,233,112, 73,221,166, 39,138, 36, 17,169, 98,224, 6, 48, 87, 68, 97,131, 39,233,115,153, 51,155,105, 73,173,121, 67, + 95, 15, 54,112, 11, 9,201,164,104,196,187,199,244, 53,146,198, 82, 44,248,163,173, 43, 55, 95,218,216,126,242,180, 55,138, 70, +136,115,105,150, 92, 95,221,100, 58,132,226,131,215,238, 61,234, 60, 10,234, 75,253,203,126, 74,105,163,177, 96, 59,184, 65,210, +178,224,253,140, 80,100, 85,108,153,205,184,175, 82, 89,241,218, 97, 58, 29,135,195, 73, 50,150, 68,159, 34, 5,205, 79, 34,216, + 19,149,224,237,182,231,221,242,225,223, 9,247, 79,242,103,229, 51, 44, 93,201,217,122, 57, 79,219, 21, 51, 31,235,112, 8, 62, +115,165,158,204, 48,253,246,155,159, 30,254,176,155,252,184, 55,125,176, 31,224,146, 91,215,137, 11, 62,231,161,247,156, 91, 20, +102,133, 52,158, 70,177,246, 93,250,224,151,242,143,203,163,149, 70,227,224,236,240,171,159,191, 95, 93, 88,254,250,237,207, 47, +101, 18,229,210,183,173,126,239,162, 26,233,217, 68, 51, 83, 49, 24, 93, 36,101, 22,248,139, 75,181, 6,170,200,223,134,251, 71, + 81,244,241,139, 59, 79,134, 39,116,118,106, 17, 33,249,191,103, 93,196, 87, 86,157,160,134, 23,105,107,104, 74, 30, 84, 68, 60, +228,169,176, 58,174,229, 94,107, 95, 67,184, 13,179, 48,140, 67,152, 54,233,174, 20, 26,211, 76,153, 45,248,250,233,176,208,231, +192, 65,175,230,191,179,189,243,119,247, 49, 30, 5, 83,246,227,239, 87, 25, 87, 78, 56,213,101,175,149, 18,227,158, 84,204, 48, +120,224, 97, 60,193,235,101,162, 12,138,225,223,146, 52,222, 59,250, 11,123, 82,240,148, 26, 9,131, 81,204, 70,154, 40,104,186, + 30, 25, 91, 41, 59,167,135,138,118,119, 78, 36,167, 11, 36,181, 68,131,106,187,142,233,172,183,158, 31,132, 79,145,145,108,173, +223, 68,146,190,210, 88,105, 46,183, 94,190,186,189,187,191, 43,148,170,157, 58, 93, 85,109, 77,182, 73,223,106,160, 52, 41,149, + 68, 90, 89, 32,168, 76,146, 41,246, 88,193, 55,160, 32, 64, 40, 70,145, 72, 53,221,214, 36, 29, 83,175, 34, 47,140, 57,130,149, +120, 85,155, 78, 19,241,230,127, 1,136,186,150,222, 54,202, 40,234,241,140, 61, 47,207,140,227, 87,156, 2,117,172,184, 66,128, +104,137,120,137, 74,176,160, 80,196,138, 77,203,138, 29, 82,133, 4, 82, 55, 21,191,128, 53, 63,131, 29, 27,214, 44,168, 88, 20, + 4, 66, 16, 33, 4,164,137, 82,199,100, 28, 63,226,177,199,243,158,177, 57,247,142,213,100, 23,201,150, 53,243,221,239,222,115, +190,239,222,115, 54,248, 93,164, 62,238, 75,215, 39, 68, 36, 8, 8, 0, 75,156, 70,151, 54,128,236,228,151,146, 19,241,148, 85, +198, 74,253,233,241,196, 5,127, 36,199,109,106,201,164,224, 43, 22,114, 83, 56,161,200, 71, 69,164,202,132,101, 0,245, 6, 70, +198, 62,167, 41,167,192, 37, 85, 7, 86,145,196, 51,171, 52, 53, 35, 32, 23,208,145, 11,133,220,234,178,229,148, 77, 30, 12,213, +226, 11,202, 44,159,221,229,153,102,106, 1,198,218,140,249,214, 27,207,171, 42, 58,133,168,176, 89, 60,252, 97,193,240, 43,139, +208, 5, 27,160,251, 75,242,156,150,206,231, 35,240, 53, 58,223, 22,197, 92,243, 33,215,136,247, 99,207,245,157,140, 65,122,150, +155,111,225, 1,169,153,145, 6, 2,128, 49,179,117, 66, 80,154,139,163,170, 73, 85,171, 4, 2,131, 5, 46,151,133,138, 38, 42, + 37,214, 89,229, 57,239, 50, 29, 72,172,241, 31, 72, 91,156,114, 31, 22, 25, 97,179,177,110, 81,210,229, 50,160,180,161, 42,149, + 10,201,177,222,255,236,211,119,222,122,245,209,207, 63,110,153,242, 39,119, 63,110,152,250,209,241, 17, 16, 24,130, 66,225,203, +219, 13,200, 98, 58, 86,202,231, 34,168,112,228, 66, 65, 60, 78,202,151,231,116,122,130,236, 47, 51,111,144,144, 11, 8,174,224, +179,186, 42, 89,134,100,234, 34,249, 56,137, 69,230, 36,204,207, 41, 65,179,102, 96, 9,165, 92,166, 99, 29,153,202, 20,222,147, + 8, 34,131, 5, 83,145,145,164,162, 38, 22,116,164, 58, 15,136,126, 48, 25,224, 5,238,214,187,157,218,174,166,232,200, 53,143, +237,127,237,185,253,222,245,219,139, 96, 70,109,100,162, 56, 93, 78, 46, 92, 7,145,231,135,196,216,176,109,130, 40, 8, 18,239, +106,173, 67,170,106,100,238,168, 84, 84, 51,138, 66,153, 2, 38,238,182,246, 8,234,114,223, 61,138, 83,219,186, 34,235,178,239, +121,237,218, 51,115,223,137,179,192, 13,156,209,124,136, 44, 31,167, 33,202, 16, 54,149,161, 26,126, 76,243,129,205, 74,147,123, + 52, 69, 10, 69,186,143,166,235, 77,132, 56,176, 57,130,229,254,151, 15,156,153, 51, 30, 14, 17, 96,231,142, 61,153,141,177, 55, +170,122,245,218, 78, 15,249,247,215,195, 95, 18, 34,182, 2,216,244,145,253, 24,132, 0, 9, 23,175, 28,228, 18,117,200, 11,150, +228, 31, 85, 88,247,167,167, 43,182,162, 37,239, 58, 73, 10, 3,111,199,186, 66,201,177,176,182, 47, 6, 55, 95,188,121, 58,238, +243,130,172,235, 86,139, 58, 25,178, 12,175,165,215,234,197, 89,242,230,243,175, 61,177, 79,184, 37, 14, 57, 54, 13,146,112, 75, +171,150,197,242,193,201,193, 60, 88,132,177,191,223,221, 31,206,206, 1,249,169,255, 50,242,158,140, 6, 13,163,190,244, 23, 52, +252,203,230,132,219,102, 75, 41,201, 65,228, 81, 3,146,106,225,147,224,160,172, 55, 75,106, 61, 65, 28,212,180, 45, 77,214,118, +155, 93, 55,152,243, 48,132,216,176,218, 73, 76, 38,201, 47, 27,149,218, 43,181,194,212, 17, 8, 51,177, 74,209, 38,218,243,235, +195, 92,126,129, 71, 53,158,218, 80, 96, 23,201, 37, 20,165,111,190,251,163,239, 39, 86,203, 56, 75,226,147,179,201, 78,127,106, + 62, 87, 47, 60, 91,167,123,215, 36,101,216,174, 16,108,127,212, 63,250,246,183,213,172,247,123, 20,129, 38, 54,138,229,175, 15, +190, 63,116, 6, 15,110,220,105,234,166,237, 76,197,184,208, 17,187, 31,222,251,226,250, 87, 31,221,248,252,246, 11,119,223,221, +111,191,157,253,189,248,107,248,167,147, 44, 95,170,118, 31,158,253, 99,251,255, 53,138, 86, 93,214,144, 10,106,102,213,143,201, +125,155, 16,141, 80,220,104, 32,178, 23, 15, 34, 42,136,194, 60, 17, 97, 33, 80,246,102,222,108,186,152,210,168, 35, 9, 84,137, +249, 52, 43,211, 17,178,162,174,129, 42,133,238,181,237, 30,169,230,133,126,103,187,211, 31,157,118,219,123,227,197, 40, 23, 42, + 52,212,138, 86, 34,159, 22,199,189, 80,241,235,164, 59,147,230, 2, 0,124,187, 75,249, 7, 40,176,105,238, 76,150, 35, 98,224, +212,183, 93,206,211,160,200,122, 65,164, 85,153,198, 91,228, 48, 21, 92,109,117,125, 18,183,161,241,165, 55,246, 94,183,103, 54, + 31,175, 18, 54, 35,103,143,138,169,200,138, 31,122,235,226,218,241, 22,248,250,233,112,112,235,253, 91, 15,127,250, 97,225,186, +186, 86,161,139, 22,170, 25,185, 79, 67, 62, 39,155, 97,173,153,227,174, 80, 33, 12,150, 51, 65,153, 41,147,107,244, 7,199,231, +135,185,196,216, 50,162,194,230,129, 16, 11, 52, 26,141,212,202,190, 64,171, 18,176,127,154, 82,143,184, 32,252, 47, 0, 83, 87, +211,219, 70, 21, 69,103,198, 51,254,254,110,140,155, 73, 98, 82, 44, 69, 32, 33, 65,139,144, 64,170, 34,177, 66, 66,106, 65,170, +132, 4, 44,168, 88,176, 0, 9,137, 5, 43,132,196,166,172, 88,116,131,196,143, 96, 83,248, 7, 32,104, 11,162, 16,160, 78,105, +155,186, 4,181,174,227,248, 35, 30,219,227,153,121,246,112,206,125, 65,176, 77, 50,206,155,231,119, 63,206,125,247,158,115,236, +223,149, 84, 8,254, 63,149,138,112, 68,133,135,255, 42, 54,166,142, 1,210,164,169, 25,204,244,171,218,112,238,200,188,212, 98, + 9, 35,200, 37, 1,103,144,173, 83,246, 58, 16,206, 7, 74,217, 46, 73,196,147,178,146, 74, 18,158,149,226,202,104, 54,136, 69, + 33, 1,123, 7,135,235,171, 25,158,210, 50,178,194,245, 24, 74,125,143,248, 2, 6, 35,180,195,236, 48,131,203,114,156, 20,188, + 37, 62, 21,184,137, 87,172, 34,182,139, 35,171, 20,239,123,241, 77,231,156,172, 72,126,115, 8,130,234, 81,139,133,227,164,177, + 76, 0, 14,184, 27, 36,227,228,221, 94,232, 49, 99, 41,190,197,154,158,242,184, 51,169,152, 41,224,193, 84, 50, 39,234, 45, 4, +119,162,169, 29,154,199,212, 11, 5,101,168,124, 54, 93, 62, 65, 51,204,166,224,223,217,195,224, 56,114,179,202, 47,148, 77,236, +142,131,229, 81,253, 49,237, 24,142, 99,243, 66, 53,109, 21,241,112,214,201,103,141, 82, 46,174, 85, 18,197,188, 81, 44, 36, 63, +252,224,253,207, 47, 95,254,238,218, 79, 55,118,126,223,223,191,255,218,249, 87,106,149,252,205,221,150,222, 88, 70,234, 37, 13, + 58,109,219,128, 8, 76, 46, 84, 28, 4,134, 15,255, 17,152,179, 80,232,216, 89,181, 49,146,192, 32, 14, 47, 72, 82, 44,254, 9, + 95,107,108, 41,101,193,137,249,115, 90,165,193,161, 22,169,238,104, 61, 54,206,210, 37,120, 15,156,114, 10, 8,176, 88, 88, 38, +145, 73, 59,197, 44,227, 65, 62,135, 53,235, 91, 4,134, 0,101,197,115, 43,152, 89, 10, 40,152,220,141,177,177,215,223,155,132, + 64,208,166, 91,113,175,221,249,222,243, 39, 44,163, 71,115, 28,209,139, 47,189,253,245,143, 87,176,254,147,213,134,212,217, 88, + 21, 60,242,135, 11,146, 51,103,150, 66,181,200,228,215, 50,113,254,198,211,163, 34,114,235, 76,105,226,123, 60, 66,106,121,238, +245,115,157, 61, 64, 49,133,159,104,254, 90, 28,147, 9,172,194,102,192, 70, 78,192, 6, 53, 18,204, 81, 62, 45, 34,124,206,103, + 72, 79, 31, 84,114,181,237,167,183,111, 63,188,101,139,172,218,159,191,180,174,239, 92, 61,179,245,124,119,216,105,186, 91,176, +251, 49, 53, 26,167,221, 97,183,148, 43,241, 74, 31,223, 47, 14,184,112,112,123, 36,227,141,214, 87, 30, 31,122,196,203,193, 50, +168,229,106, 50,199, 88, 10, 2,228,140,120,205,147, 42, 34,213, 23,108,105,177,140,144,112,156,125,242,236, 96,220,247,102, 30, +144,205,106,213, 61,229, 62,209,168, 55,250,195, 3,156,187,253, 94, 27,177, 4, 72, 2, 7,204,161,182,165, 5,243,126,115,251, +194,206,189, 63,176,105,156, 4, 76, 16,159,225,245, 87,171,107,216,177,103,155,103,130, 48, 66,172,130, 1,107, 13, 79,210,207, +197,102,223, 59,156, 6,190,149, 16,238, 29, 21,224,191,187,149, 58, 37, 33,145, 78, 57, 41,108,160, 31,206,164, 77,128,233, 36, + 66,111, 49, 93,198,175,214,106, 27,163,233,240,153,114,161,122,186, 98,244, 70, 49,176, 36, 25, 71, 22,210, 66, 34,105,177,128, + 83,161, 26,182,116,161,230,152, 7, 26, 15,231, 83,173, 86,247,202,175,251,128, 93, 74, 69, 8, 71, 79,173,151, 27,245, 66, 18, +103, 8, 89, 84, 90,166,243, 22,182,241,195,223,187, 95,126,251,243,213,187,161,105,247,194,134, 23,249,153, 68,162, 55,241, 62, +187,241,205, 90,102,245,139,151,223,187,213,185,151,156, 21,223,248,228,146,251,233,115,230, 40,125,253,163,155,191,125,124,187, +253,213,193,134,123,106,243,157,211, 47, 84, 94,237,255,213, 82,246, 60, 86,198,206,240, 46, 14,221,139,245, 38, 86, 54,152, 30, +153, 90,215, 81, 59, 28,209,191, 93, 72, 65, 73, 11,105,193,168,109,142, 53, 49, 12,224,239,220,234,186,144, 32,153,198,191,157, + 32,154,218,100, 41,125,144,243, 32, 88, 61,225,182, 15,238,195,132, 15,199,131,209,116,208, 27,247,164, 6,192, 19,133,109,156, + 71,193,120, 54, 50, 68,186,153, 85,101,234,157, 8,221,158, 97, 62, 86,168,115,202,157,204,216, 99,161,132,228, 26, 74,153, 50, +253, 76,172,103, 98, 12,241, 81,100, 12,229, 16, 44,124, 55, 27,201, 72,104,241, 96,240, 80,247,212,172, 20,120,175,238, 5,222, +100, 62, 61,154,140, 97,115,192,190,192, 40,165, 82,117,179,177,249,214,165,119,187,187,157, 65,175, 55,143,194,153, 63, 69,122, +180,181,182,245,232,176,195, 34, 3, 75,157, 22, 89,166,133,105, 0, 24, 2,201,113,179,222,236,142, 30, 33,217,104, 31,180, 73, +179,200, 38, 11, 33, 98,210,186,191,134,197, 4, 72, 8, 19,225, 9, 54,176, 51,203, 80,107,169,255, 35, 0, 85,215,243,219, 54, + 25,134,253, 37,182,227, 56,182, 99, 59, 63,218, 77, 73, 96,168, 27,234,210,173,148, 78, 72,221,232, 1, 52,109,104,234, 16,218, + 14,136, 29,144, 42,237,194, 95,192,206, 92,198, 78,136, 11, 7,184, 32,224,134, 56, 48, 64, 28, 56, 32, 5, 16,104, 8,216, 58, + 74,164,137,117, 52,165, 67, 77,154,164,177,157,216,142, 99,123,239,251,186,157,134, 84, 85, 85,100, 85,249, 28,231,249,158,231, +253,222,247,121, 18,124, 63, 24,111,125,194,119, 82,151, 11, 0,148,255,175,200, 71,143, 47,120,108, 88,140, 46,190,188,212,119, +118,225,183,143, 70, 41, 1,172, 57, 43, 98,154, 7,219, 39,153,216,179, 15,119, 89, 83,181,149,179, 23,239,222,187, 3,170,235, + 96, 51,193,106, 21,104, 28,138,224, 72, 39,106,154,178,197,227,227,149,147, 93,171, 67,216, 58,193,162, 63,158, 94, 2, 76,163, + 15, 3,151, 68, 23,134,104,215,137,117, 52, 66, 16,134, 94,160, 26,118, 79,146,254,164, 80, 8,192,230, 16,240,229, 68,109, 1, +190,114, 92,106,223, 84, 30, 81, 27, 71, 56,241, 5, 25, 51,118, 3, 50,122,160,248,112, 46, 30,142, 93, 67, 53,247, 70,253,228, +133, 3,187, 54,252,106,228, 68,165,108, 78, 33,178,100,226,188, 46, 78,168,211, 40, 12, 24, 0,238,200,230, 6,195,120,232, 68, + 3, 39,116,156,104, 56,138, 92, 23,189, 8,128,104,199, 56,237,134,234, 82, 20,129,230,199,178, 36, 92,122,245,242,242,139,231, + 27, 63,221,145, 37,243,205, 43,171, 31,124,248,113, 16, 9, 81, 44,222,223,216,222,126,216,189,186,250,150,239,134, 63,223,250, +131, 67, 93, 6, 0, 29,165, 35, 26,127,230,176,204, 66,189, 1, 41, 13,187, 42, 89, 78, 98, 34,214,223, 89, 70, 0,169,148, 6, +233, 0, 75, 9,176,172,159, 98, 33,163,227, 92, 94,194, 73, 59, 42,136, 0,234,227,212, 56,226,181,156, 77,227,193,172, 44,228, +100, 30, 0, 29,228, 72, 14,233, 59,202, 5, 46, 25, 19,139,144, 11, 39,105, 68,113,136,211, 91,254, 56, 21,194,110,193, 98,135, +249,157, 97, 39,199, 36, 51, 87,180, 3, 43,199,171,176,121, 83,150, 5,158, 99,195,106, 47,157,185,252, 67,179, 81,210,202,245, +106, 29,168, 49, 44,220, 80, 75,240, 17,193,238, 59, 38,187, 80,228, 23, 60, 63,244, 71, 60,237,253,182,103, 93, 56,181, 50, 14, + 0,224, 60,120,148,215,111,175, 23,181,169,174,221,201,163, 97, 92, 68,145,188,252,180, 89,177,157, 30, 21,226,163,145,239, 0, +123, 0,170, 1,215,167,200,191, 8, 32, 84,147,243,160,230,215, 91,127,122,190,123,118,254,252,203,207, 45, 55,238, 54, 78,215, +151,154,173,102, 20, 5,176,175,143,124,219, 80,204,171,231, 86,215,254, 89, 95,198,233,208,109, 96,127,148,186,128,150, 68, 24, + 12,226,217,237,193, 14, 60, 51, 64,138, 45,207,162,142, 67, 76, 5, 89, 56, 50, 63, 28,143,122,131, 94, 16, 77,158,153, 62, 2, + 76, 31,125, 99,118, 54,218,131,238, 86,183, 53,165,151,225,255,119, 7, 93, 62, 98,187,253,246,192,219, 75,100,238,210,179, 75, + 32, 53, 74,249, 34,205,221,216,176,228,230,230, 61, 67,213,113, 66, 36,158,204,213,230, 64,173,251,190,223,183,251, 23, 78,157, + 91,123,176,102, 42, 6, 96, 13,178, 48, 57, 63,193,206,125, 97,182, 50,171, 72, 57,219,181, 50, 40,189, 4, 85, 82, 10, 90,241, +181, 23, 46,222,222,128,139,117,224, 64, 58,181, 21,157,168,214, 31,246,254, 43,105, 37,208, 52,176,101, 0, 43,179,157, 14,199, +103,235,130, 80,124,190,192,245, 44, 54,246,177,165, 59,201, 17,100,148,227,144,116,109, 83,160,248,129,103, 33,141,234,209,172, +229,205,198,125, 61, 35, 44, 30,206, 63, 93,208, 74, 74,214,144, 36, 35, 7, 84, 21, 8,187,200,121,105,238,199,214,111,239,125, +247,249, 23,183,254, 30, 56,162, 38,228,197, 60, 99, 71, 21,181,184, 56, 61,115,253,215,175,154,253, 7,215,230,175,164, 97,115, +115,216, 27,159,188,195,205,114,223, 31,253,229,221,247,175, 47,186, 39,231, 79,207, 77,250,254,219,159,222,248,236,163,111, 95, +127,233,149,153, 99,103, 6,155,127, 9,169,240,155,127,127,111,185,214, 74,101, 97, 20,208,228, 35, 21, 43,224, 38,152,170,110, +185, 54,188, 75, 93, 49,158, 42, 85,225,190,193, 31,240,185, 0, 26,216,158,147,212,202, 1, 79, 60,143, 58,115,180, 50, 35,167, +110,116, 63,228, 48,209, 16,227, 85, 39,254, 14,246,216, 96, 33,187,140,167, 35, 18, 77, 12,224,186, 21, 73,169, 22,107,112,195, +133, 84, 50,241,142,185,151, 69,213, 12,208,141, 10, 37, 13,108,156, 83,198, 33, 16, 85, 25, 65,170, 21,106,123,238,158,196, 3, +197, 18,112, 70, 97,223, 15,128, 28, 8, 88, 2,178,252,190, 75, 11,202, 7,148, 68, 21,179, 10, 75,241,240,128, 23, 99, 71, 51, + 98, 70,202,224,143, 12, 4,138, 23, 1, 64, 58,187,157, 66,156,255,250,230,151,195,225, 8, 71,127,168,224,211,238,183,129, 82, +151,212, 50, 60, 69, 68,182,185,153,195,199, 64, 16,103,121, 25,158,154,173,206,102, 76,222,147,232, 5,155,150,202,250, 33,208, +115,236, 9, 19,120, 58,250,194,210, 69, 81, 45,109,245, 90, 52, 93,133,111,244,145, 0, 84, 93, 93,111,219,100, 20,182,157, 38, +177,157,196,110,218,100, 77, 27,194,218,173,101, 91, 58, 13, 1, 97,211, 36, 24, 3,164, 33, 68, 65, 83,239,184, 68, 92,141, 11, +168, 16, 72,220, 33,110,249, 19,220, 76,227, 14, 9,144,248, 1, 84, 80,161, 74,213,152,186,117,237,150,118,235, 71, 58, 28,231, +195,137,227,143,248,227,229,156,243,166, 67, 92, 91, 74,172,215,246, 57,207, 57,231, 57,207,131,241,157,175, 53,137, 34, 59,177, +196, 69,236,140,171, 28,128, 62, 37,212,227, 21,255, 39,247, 60,234, 16,141, 82, 63, 19,136, 52,138,142, 31,112,214, 18,147,160, +222, 65,139, 97, 22,112, 57, 75,225,196,112, 15, 74,224,205,237,191, 73,114, 93, 34,158,162, 68,228,252, 96,102,162, 98,217, 4, +231,197,255, 10, 8, 8,238,216,231, 99, 35, 33, 76,114,164, 3,160, 18, 76,105,101, 39,176,249,130, 40,148,237,232,148, 36,107, +144, 33,198,164, 36,237,158, 96,105,231, 17, 3, 90, 87,199,253, 33, 74,152, 52,218,135,236,100,240,248,252,198, 69,238,114, 71, +110,177,233, 36,224,212, 4,250,236, 4,216,153, 25,184,131,185,169,179, 88, 88,224, 8, 5, 48,184, 74,227, 98, 7,106, 5,156, + 46,224,152,149, 41,170,108,123, 80,140, 75, 73,212,216,147,134, 36,133,199, 39,198, 56,100,143, 56,223, 22, 15,150,107, 0,114, +203, 44,192, 34,215,222,120,115,229,155,239,207, 45,190, 98, 30,215,181,108,118,241,226,197, 31,110,223, 33, 76, 33, 66,228,123, + 84,127,210, 50,141, 47,191,248,124,103,167,190,179,187,135,163, 86,244,198,196,250, 48,167, 72, 89, 53,161,103, 37, 53, 45,101, + 84,145, 22,135,169,149, 69,219, 37, 8, 67,227, 4,156,159,135,118,162,238,112,232, 3, 62, 25, 0,218,180, 3, 0,239, 16,247, + 29,151, 57, 14, 26,125,160,244, 71,140,140,192,140, 10, 97, 81, 84, 21, 81,149, 69,218, 62,165,124,136,146,241, 68,129,166,128, +128, 91,227, 17, 27,134,196,197, 36,185, 5,148,118, 85,196, 72,129, 64,218, 63, 55, 81,125,251,210,181,187,251, 27,144, 89,203, +122,217,242,172,172,162,245, 6,206, 97,107,127, 58, 95, 94,127,188,150, 78, 65, 68,102,244,188, 8,139,160,249, 92, 78,145,101, +220,250,139,163,233,124,197,193,126, 34,131,128,110, 88, 70,165, 48,235,135,174, 27, 56,173,222, 63, 18, 42,247,250,215, 47,189, +101,245,173, 24,133,143, 76, 61, 59, 1,129, 15,158, 23, 96, 94, 0,110, 70,167,145,160,253,252, 49, 52, 65,151,125,223, 75, 16, + 89,243,230,213,143,214, 30,254,105,118, 59,128, 3, 14, 90,135, 33,186, 81, 83, 41, 61,116,229,164,178,122,127,181, 90, 57,191, +186,181,138,246, 88, 97,164,171, 90,109,254,202, 81,251,168,239, 90,159,126,120,107, 99,251,175,119, 95,189,177,176,112,126,167, +190, 9, 7, 18,192,255,133,222,113,187, 1, 49,180,168, 77,182,251,166, 38,235,143,142, 30, 54,218,141, 66,174, 80,173,188, 84, +155,175,213, 27,143, 7,174, 61,153, 27, 79, 32,249,170, 11,216,105,169,182,100,116,159, 29, 52, 15,108,215,170,190,120, 1,222, + 25, 28, 21,146, 54,197,220,212, 25,148,178,121,125,105,243,233,253, 0, 73,165, 98, 41, 95,130,187,101,104,102,249, 12,125, 53, +132,248,131,215,222,135,127,244,163,160,217, 53, 50,114, 6,128, 33, 60, 45,136,254, 54,142,190,219,247,246,238, 70,196,138,245, +160, 52,141,131, 76, 74,221, 55,159,142, 37,248,139, 77,246, 32, 98, 60, 55, 83,133, 56,184,168, 8,197,171,167,132,110, 79, 8, +135, 34,146,210,194,231,126, 45, 88, 36,147,168, 2, 39,212,115, 79,160, 8, 41,252,146,101, 6, 78, 59, 62, 59,153,215,211,144, +250,229,220,152, 58,153,155,208, 94,152, 17, 10, 5,193,112,254,184,253,251,157,223,214,183,186,125, 47, 13,117,180,164, 64,224, + 17,181, 32, 42, 53,157,110,203,106,126,187,254, 75, 33, 85, 92,169,190,215,233,197, 31,255,244,157, 0,153,238, 58, 59,182,159, +124,246,227,173,242, 87,211,202,124,170,180, 92, 88,254,228,198,131,159,239,189,243,235,242,202,194,215, 11, 47, 95, 49,143, 54, +214,142,183, 91,158,121,121,170,154, 75,166,224, 76, 56,125,214, 13, 93,168,222,248, 90, 57,149, 92, 6,124,137, 5,189,216,115, +123,144, 95, 33,213,193,167, 13, 81,222,118,250, 80,193,231,115,249,203, 23,106, 15,246,183,144, 1, 24, 5,112, 73, 73,202,179, +167, 78,119,236, 78,196,197,226, 88,212,247,225, 51, 24,142,210, 25,106, 41,251, 93, 36,212, 18,163,134,123,101, 9, 12, 29,178, + 70,138,157,136,138,109,114, 3, 38,169,185,192,243, 61, 90, 5, 12, 78,156,121,121, 59, 43,230,133, 3,223,250, 31,207,142,163, +144, 9, 54, 64, 25,234, 46,112,230,229,104, 5, 72,160, 29, 71,212,116,194, 46, 51, 99,167,203,179,105, 89,217,221,219, 21,136, +116, 30, 6,216,153,161,171,145,229,208,162,165,128,130, 51,166,213,164,250,128,113,127, 77,180, 79,160, 31, 5,136, 0,112,164, +164,207,216,129,205,141,158,224,205,201, 41, 90,165, 56,215,236, 25, 72,210,199,172,147, 80,209,240, 32,250, 87, 0,162,174,231, +183,109, 50, 12,199,177,155,216,177,211,197,105,168, 19,218,245,103,146,174,104,131,181, 26,106, 37,166, 1, 18,112,217, 97,128, + 56,111, 28, 56,114,168,144, 56,193,161, 66, 8,193,145,191, 97, 2, 46, 28, 17, 98, 80, 33, 80, 55, 1, 98,168,135,137, 31,101, +109, 32, 93,211,102,249,109, 39,118,226,184,113,120,222,215,137,184, 59,118,236,239,251,222,247,249,222,239,121,159,103, 92,127, +167, 70,243,192, 93,110, 36,208,139, 29, 55,201,236,245, 59, 81, 73, 57,243,169,253, 71, 34,249,148,192, 33,115, 72, 82,217,108, + 81, 22,136, 71, 6, 18, 97,172,109, 66,101,153, 30,145, 94,252,128,114, 69,154,195,103,125,159, 12,217, 21, 34, 36, 74,145,185, +212, 66,221,105,112, 87, 43, 69, 21,203, 49,233,192,148, 93, 53,198,135,168,244, 7,216, 13,203, 27,142, 61,193,131,166,178,136, + 36, 83,219, 42,118,211,201,217,178,245, 88,100,158, 25,219, 72, 82, 7,252,144,169,108, 83,154,129,119,234,186,109, 95,240,195, +163,130, 35,123,150, 8, 62, 54, 37, 30, 27, 9,141,120,175,148,123,240, 51,175,207,149, 47,234, 2, 99,209, 77,203, 54,109,183, +131, 92, 5, 72,195,108,110,159,118,175,129, 63,166, 56, 20,197, 80,230, 73,133, 76, 54,200,147,108,136,164, 22,141,136, 64,211, + 49, 37, 12,104, 76, 39,174,196,108, 33, 91, 28, 54,183,100, 94, 49, 89, 92, 18,104, 50,146,218,243, 87,215, 7,174,245,249,103, +183, 23,231,231,117, 61,241,237,206,142,170, 42,106, 84,210,228,136,170, 68, 10,197,130, 50, 33,190,126,227,250,238,221, 31,241, +219,104, 84,226, 16, 47,176,196, 27,157,214, 34, 94,247,220, 80,219,246,129,204, 2, 29,136, 0,215,227, 98, 4,245,103, 86,159, +250,228,195, 15,222,221,218,122,227,213, 27, 87,214,214,129, 26,142,138,199,142,211, 35,170, 57,146, 53,213,110, 37, 77,145, 18, + 88,187, 36,225, 37, 32, 21,226,110, 93, 55,132,249,239,209,228, 20, 24, 99,142,253, 95, 88,234, 15,104, 89,142,144,255, 3,213, + 57,137, 6,205,253,204,162,247,111,253,168,112,114,128,160,150, 79,175,246, 6, 14,114, 12, 2,116,177,118,192,157,117, 78,234, + 92,202,236,180, 88, 65,133,182,154,192, 59, 72,252,164,239, 70,162, 18,253, 97, 24,207,237, 5, 59, 47, 32,145, 90,187,218,236, + 84, 49,172,115,169,249,186, 93, 39,233,165,168, 82,172, 20,177,145,202,101, 46, 84,172, 50,247,142,218, 44, 18,219,111,118,234, + 3,202,102, 68,212, 89, 74,231,186, 61, 7, 81,187,221,237,152,118,171,112,114,136,177, 91,207,175, 91,142,181,152, 94, 76, 39, + 12,108, 87,217,105, 93, 72,198,117,228, 12,204, 15,211,105,206, 36,103,218,221,118,126,102,101,239,240, 62, 98, 4,182,243,247, +247,127, 1,160, 46, 85, 74,165,114,137, 24, 83,124,162,142,153,134, 69, 82, 38, 82,227,179,128,210, 70, 42,157, 59,191,162, 73, +114,127,224,149,106, 71,185, 76,118,255,120, 31,241,119,251,173,143,126,126,176,187,182,116, 25, 11,242,184,250, 8, 89,117, 35, +119,101, 41,147,255,235,209, 31,147,114,220,233, 57,216, 44,111,230, 55,176,246, 42,173,202,195,211,135,118,143, 2, 19,110,142, +240,178,177,178,185,108,100, 77,199,194,103,193, 16, 61,110,158,218,125,123,117, 38, 79,156,104,215, 33,241,119, 46,254, 98,164, +241,217,175, 93,186, 90,109, 85,145,139, 37,129,220,131,147, 90, 82,215, 18, 92,186,117,169,133,146,252,103,158,168, 53, 15,231, + 50, 79,175,169,233,216, 69, 63,100,117, 66,158, 39, 32,126,112,173,131, 58, 87,153,124, 74,220, 5, 38,101,141, 84, 10, 25,244, + 16, 9,217,141,201,106, 76,155, 84, 21, 45,158, 76,234, 9, 93,143,171,114,171, 90,191,243,221,111,119,126,253,243,239,166,229, + 73, 18,210,136,203,214,136,114, 68,138,133, 21,196,247,136, 40,252,116,242,207, 15,167,123, 55,151, 95, 90,148,166, 94,219,126, + 31, 55,175,222, 50,213, 45,249,252,151,243,246,247,141,157,237, 79,191,249,234,118,225,235,221, 75,157, 23, 94,252,248, 90,233, +139,227, 55,239,189,243,222,115,111,103,197,244,131,198,222, 94,253, 96,122,114,246,162, 62,237, 0, 89, 80,201,195, 95, 54, 22, + 76,150,224,207,103,150, 25,219,136,153,169, 89,132, 20,140, 47,178,172,217,181,168,167,148,154,235,168,196,151, 62,103,220,253, +253, 30,137,123, 76, 68, 48, 46,125, 15, 16,193,173,154, 53,172,230, 87, 46,191, 92,170,151,117, 85,103, 66,187, 31, 30,215,214, +113,231,172,145,197,119,166, 15, 49, 28, 32, 50, 94,152, 93,105,116, 90,120,118, 32,238,140, 96, 50, 33,132,147,241, 20, 96,181, +174,233,115,211, 11, 77,171, 49,242, 62, 98, 25, 74,214,135,144, 12,221, 64,118,223,204,110,150,154,167, 62, 73, 35,248,129,181, + 19,174,139,201,113,114,112, 13, 75, 9,141, 76,174,249, 37, 2, 91, 62,170, 60, 80,119, 82, 72,168,213, 42, 44, 42, 67,189, 61, + 84, 65,227, 38,103,246, 51, 33,157, 77,106,123, 62, 27,208, 82,243, 57,190,242,141,255, 55,238, 16,134, 54, 21,133, 24, 37,243, + 69,152, 60, 53,179, 18, 10,144, 63,191, 36, 75, 20,132,254, 19,128,168,107,233,109,163, 10,163,227,199,204,248, 49,227,137, 75, +226, 58, 14,181,149, 16, 28, 72, 42, 72,129,176, 41, 80, 53, 45, 85, 85,161, 72, 45,170, 88,116,197, 2,248, 3,108,144,186, 97, +141, 96,135, 64,237, 31, 64, 66,172,144, 80,145, 88, 84,178,132, 84, 5,164,180, 2,161,196, 33,197,216, 78,237,196,246,248, 49, +227,121,223,225, 59,119, 18, 33,101,231,248,113,239,220,239,121,207, 57,223,137,127,143, 99,236,175,196, 78,180, 37, 99,220, 14, +125, 46, 33, 9,132,241, 76,102,150, 18, 43,174,167, 2, 30,151,192,129,253,140,147,199,224,224, 98, 34, 50, 92,207,225, 2,198, + 66,116,129, 35,252,239, 65, 25,215, 43,167,179, 33, 45, 23,171,116,202,167, 54, 24, 7,244, 9,175, 44,172,119,134,157, 4,118, +153,214,228, 71,199, 47,224, 55,244, 16,192, 97,126, 33, 55, 79,201, 56, 28,186,107, 11,156,152,225,184,166,105, 77,232,199,143, +172, 17, 55,194, 4,159, 56,194,231,150,179, 96,169, 88,213,167, 61, 42,234,161,199, 31,201,244,134, 17, 40, 52, 66, 12,161,104, + 98,130,175,202, 57,180, 89, 33,230, 71, 69,147, 42, 10,201,128, 7,201, 83,133,125,222, 54,194,176,189, 48, 37,165,185,156, 8, +110, 58,208,155, 75,192,204,146, 44, 43, 73, 9,203,101,148, 20,155, 83, 10,186, 40,205,248,197, 36,230, 88, 74, 73,242,242,130, +146, 78, 36, 37,192, 19,201, 53,131, 61,136, 17, 15,208,123,121,218,108,255, 90,171, 61,120,240,211,239, 59,127, 94,217,188,172, + 41,202,195,218, 67, 45, 43,203, 82, 60,149, 74,168, 28, 26,223,110, 62,189,118,245,210,212, 24, 63,235,180, 41,174, 95, 88, 93, + 25,143, 71,228,153,226, 33,216, 88,100,176,166,237, 27, 22, 69,209,208,243, 66,199,227,151,183,124,130,251, 25, 53,119,239,155, +175, 71, 35,227,222,253,251,181, 90,141, 54,245,253,173,247,238,124,112,179,213,170, 27, 70, 95, 83, 82, 32,119,203,113, 9, 19, + 47,232,255,163,202,131, 60,123,104,187, 32, 81, 80,196,150,192,161,142,229,178, 84, 46, 36,213, 12,149,150, 0,230,115,250, 1, +240,102, 62, 50, 65,124, 93,224, 50,107,202, 92, 63,212, 45, 83,162,138, 39, 24, 14,166,125,135, 57, 5,165,104,249,110,181,244, +242,144,210, 77,168,201,195, 12,192,197,224, 92, 97, 49, 33,250, 30,134,104, 83,228, 62,101,200,160,120, 82, 82, 96,141,135, 92, + 18, 92, 55, 7,197,153,210,135,239,126,252,111,183, 65,206,139, 10, 41,114,172,186,209, 91, 41,173,234,147, 62,213, 7,139,133, + 23,232,225,138,124, 42,214,210,217,229,131,206,190,166,228, 45, 80, 22,253,172,148,187,117,243,182,222,215, 91,199,135, 38,180, + 49,156,114,225, 92,127,116,244,246,218, 59, 61,253,136,162,142,154,202,114,101, 53, 65,149,213, 23,203,213,237,189, 71,244,240, +200,128,109,223, 53,109, 3,129, 52, 6,150, 95, 8, 90, 10, 24, 79,169,164, 44, 32,133, 52,206, 87,206, 63, 57,120,140,161,181, +142,221, 27, 30,147,125,130, 82,171,206, 22, 43,149, 65,175,187,253,215,163,163, 97,247,226, 75, 27,123,173,191, 41,162,107, 25, + 45,175,156,169, 31,238,190,182,116,225,108,190, 48, 52,135,228, 5,202,115,231,118, 91,245, 36,112, 74, 97,121,174, 34, 67,147, +160, 63, 54, 70,251,135,187,141,110,227,141,229,215,219,189, 38, 45,234,198,198,117,114, 37,150, 99,151,242,243, 18,168,236, 73, +203, 49,109,207,129,205, 3,115,229, 0, 16,198,216,115,234, 44, 5, 0,195, 54,114,105, 85,205, 40,148,237, 42,233, 44, 45,150, +246,219,117, 39, 19,167,247,188,192, 10, 27,154, 96, 77, 5,207, 22, 48, 43,142,113,250, 72, 68,204,140,224,104,113,222,143, 20, + 34,173, 18,218, 22,133,226,175,183, 16,247, 19,178,144, 43,164,139,163,105,231,224,159,206,111,251,205,157,102,247,216,113, 92, + 40, 82, 82, 73, 30, 88,136,226,184,148, 82, 82,226,188, 50,251,230,242,237,201,184,247,229,227,159,143,108,253,211,165,173,139, +151,239,100, 63, 41,220, 93,252,124,189,178,170,125,171,117,127,104,124,247,213, 23,182, 18,164, 85, 37,204,197,158,236,255,242, +106,124,115,235,163, 27,119,191,255,172,253, 71,176,117,229, 86,183,177,253,227,225, 78,144,144,175,207,175, 24, 30,196, 26,131, + 88,184, 88, 40,119, 6,228,151,103, 44,219,164,117, 33,155,182, 38,105, 49,189, 86, 94,123,166,119,128,241,141, 16,222, 28,210, +118,105,245,173,221,118, 93, 20, 1, 43,203,103,180,137,107,206,241,178,158, 50,128,250, 97, 61, 0,171,142,222,142, 50,136, 51, +126,192, 62,165, 35,167,101,181,254,248, 88, 68,203,146,178,147,106,189,189, 23, 8, 62,229, 99, 87,215, 55,169,158, 3,146, 39, + 4, 1,155, 78,237,196, 30,163,151,224,243,212, 51, 96,146, 36, 87, 75, 20, 12, 6, 28, 37, 8,112,106,116,129,143, 70, 31, 63, +211, 84, 61, 48,168,169,250, 60, 79, 2, 73, 59, 22, 37,240,145, 16,156, 64, 79,191,140,137, 73,158, 77, 70, 13, 40,142,199,255, + 40,233, 12,248,252, 46,180,151, 24, 5, 45, 29,183, 17,236, 84,151,239,164, 71, 30, 23,226, 39,252,165, 48, 98,240,224, 53,200, +141, 4,126, 41,191, 48,130, 96, 53,124, 47, 31,152,234,243,142, 92,236, 63, 1,136,186,150,222, 54,170, 48, 58,182,231,233,199, +120,236, 56, 78,210,214, 73,211, 4, 8,121, 64, 49,137, 72, 72,138,104, 68, 34,177,107, 37,216, 33,241, 7,216,128, 4,203,136, +101,197,138, 5, 27,118, 21, 72, 32,129,216,209, 5, 72, 93, 21, 4, 18, 72,108,218, 96,168, 90,199, 14,118,252,152, 76, 28,219, +241, 60, 61,230,124,247, 38,176,242,108,102, 60,115, 31,223,253,206,119,207, 61,231,255,248, 30, 48,191,199, 16, 35,233, 92, 1, +140, 87,216,169,216,192,184, 62,194,133,140,144,112,225,211, 69,143,198,175, 36, 42,125,183, 23, 39,111, 16, 78,229,230,118, 75, +231, 72, 0,159, 64, 38, 12, 83, 11,102,183,221,232,212,145, 5, 19,123, 50,100,147,217,166,227,136,154,146,196,191,147,134, 9, +227, 7, 33, 67,127,102,114, 65,145, 84,192,177, 32,112,125,228,169,140,105,131,199,106,178,194,249,215,108,253, 36,168,165, 74, +241,225,136,223,136,150,213, 78,207, 44,178, 82,100,106,156,129, 48, 36, 43,103, 73,243, 16,160,185,208, 37, 63,120,204, 98, 13, +238,194, 11,171, 10,176,133,111,187,125, 82,231, 17, 88, 23,178, 34,139, 38, 39, 73,128,109, 72,131,131,155, 54,176, 79,161,234, +143, 68,197, 28,133, 56,174, 18,137,211,171, 18,237,124,146, 98, 35,250,204, 17, 28,196, 92,172, 83,126,212,118,128,248,200, 4, +158,140,105, 98, 17,114, 47, 21, 35, 50,113, 93,163, 27,175,108,172,190,180,246,211, 47,191,191, 92, 44,206, 92,157,255,230,187, +123,126, 24, 11,135, 98, 56, 36, 51,134, 96, 40, 54, 91,157,226,139, 69, 93, 55, 30,252,252,235, 88, 54,243,201,157, 59,237,230, + 81,165, 90,137,199,101,182,239,202,217,244, 36, 66,131, 11, 13, 77, 0,244,128, 55, 16,134,235,107,215,111,108,110,236,237,125, + 84, 46,151,108,199,170, 84,254,250,241,254,247, 8,232,111,221,126,179, 84,250, 45,174,142,178,134,164, 40,120,103,182,183,207, +142,138,146,105,143, 24, 61, 87,146, 96,233, 28, 71, 27,204,166, 32, 18, 50,184,128,236,130, 84, 2, 41,237,166, 50, 20,209, 49, +153,119, 22,201,226, 73,226, 32, 66, 59, 57, 41, 73, 77, 73,186, 23,186, 41, 37, 89, 54, 31,211,190, 47,109, 96, 15,153, 20, 45, + 17, 85,177,210, 1, 18,109, 95,191, 89,110, 86, 25, 53,141,142,212,163,109, 47,101,175,216,222, 32,169, 36,208,192,219, 47,236, +224,145,102,215, 44, 85,247, 73, 87,139,220, 44,143,154,157,122, 58,105,152,157, 6,214, 9, 49, 38,159,116, 77,166,243, 76, 20, + 34, 0, 30,215, 35, 55,149, 78,255,248,217,203, 11,149,230,129,117, 98, 70,124,234, 50,204, 34, 76,212,190, 99,111, 46,173,207, + 93,154,211,147, 6, 16,200,211, 86,153,121, 4,142, 90, 39, 13,196,205,245,231, 54,144, 61,228, 51,185,106,171,162, 42,252,132, + 0, 86, 43,161,144,155,198, 8,150, 99, 50, 30,210,176,234, 91,203, 91,154,164,252, 99,214,242,153,137,222,160,139, 6,184,177, +178,105,157, 90, 72, 59,234,173,122, 72, 6,123,194,107, 75, 91,205, 78, 3,105,120, 78, 31,243, 61,183,102,214, 49, 87, 29,207, + 61,104, 84,250, 14,190,142,128, 75,215, 62,197, 88,160, 3,183,236,172, 40, 0,235,202,236, 50,176,217,226,244,226,159,135,251, + 24,146, 73, 37,213,238,180, 6,118, 15,111, 85, 24,191,114,208, 60,240, 92,218,178,222, 93,219, 93,157, 95,125,122,244, 4,152, + 48,175,143, 1,194,115,107,102, 12,101,132,254, 30,229,254,124, 66,249, 61,251,152,142,181,197,199,103, 4,111,234,213,113,146, +243,245,221, 8,134,113, 36, 60,183,226,248,207,101,143,205,236,144,157,186,160, 14, 69, 23, 89,115,251, 71,198,131,195,118,169, +237, 27,126,196,143,182, 43, 86,175, 31, 4, 54,153, 83, 34,166,227,130, 52, 48,145, 78,184,204,131, 48,165,200, 64,149, 53, 51, +218,234, 89,159,151,126, 88, 79,175,188, 55,255,118,225,238,205,187,111,124,251,213,227, 47, 63,252,250, 3, 97, 76,184,247,238, +167,106, 70, 43,232,147, 90, 76, 54, 68,189, 51,234,149, 30,221, 95,222,217,217,236,111,191,255,199, 59,123,211, 31, 95, 53,178, +159, 61,250,194, 10,195, 91,133,162, 59,114,152,140,107,250,108,208,183, 61, 55, 29, 79,158,185, 14, 86, 71, 96, 65,196,107,242, +116,100,206, 19,156,182,206,200,222, 84, 95, 61, 60,174,121, 8, 92,162,202, 76,186, 51,233,184, 81, 71, 54, 77,218, 6, 4,156, +159,191,188,232, 7,238,210,204, 18, 34,114,113,190,216,183, 7,105, 77,159,155,184, 70, 16,211,179, 73,117, 28,217,180, 63, 64, + 42, 9, 72,148, 55, 38, 30, 86, 31,178,106, 13,153, 51, 51,227,113,228,103,226,100,122, 10,121,192,235,183,118,159,148,254,206, +166,115,245,227,154,235,217,104, 51,159,164,103,137, 26,123,198, 8, 93, 92,196, 11,163,130,173,199,196,206, 50, 18,217, 9, 35, + 47,140, 24,207,155, 72, 34, 36, 87, 66,100,229, 17, 38,148,139, 85, 63,151,202, 1,125,146, 86, 29,137, 11, 5, 44,118,145,246, + 31,137, 68, 82,233, 34, 34,240,237,101,238,123, 52,186, 8,191,140, 3,103, 36,140, 76, 34,235, 4, 54,247,133, 62, 29,116,248, +202, 61,155,159, 5,208,161,244,116, 52,212,228,196,191, 2, 80,117, 45, 61,110, 83, 81, 56,126,219,113, 98,199,147, 76, 94,211, +206, 68, 73,218,162,233, 67, 29, 70,109, 89,148, 5,162,133, 5,170, 90, 16, 11, 36, 4, 21, 8,149, 31,192, 2,129,196, 14,186, + 98,207, 18,254, 0,176, 65,162, 11, 70,180, 51,160,210, 13, 98,129,170,233,148,210,150, 64,147,230,237,248,145,196,142, 19,190, +115,157, 5, 72, 81, 54,113,162,248, 30,223,115,190,115,238, 57,223,199,255, 71, 9, 60, 78,207,153,244,195,242, 97,160,251,164, +222,144,196,255,132, 92, 99,228, 5,191, 63,240, 6,110, 56, 66, 68,199, 82, 7,209, 36,134,238, 73,170,195,176, 28,134,254, 16, +192,120, 84,206,150,255,238,253,133, 96, 38, 80,165,152,234, 40, 50, 53, 0,240,164, 48,146,224,253,169, 27, 4,227,152, 57,129, + 21,172,133,253,230,221,161,215,143,153,114, 88,153, 53, 62,226, 68, 94, 51, 5,154, 22, 4,145, 58, 38, 9,145, 36,252,208,163, +122, 11,169,122, 82,188, 5, 16,195,191,141,167, 91, 73,248, 45, 12, 40, 50, 49,210,252,136,173, 12, 86,132, 81,248,135,164,239, + 17,248,142,111, 3, 10, 85, 10, 71, 25,225, 56,107, 34,103,195, 84, 1,163,225,102,162, 4,116,246, 64, 8,150,165,201,196,141, + 53, 11, 55,114, 21, 32, 56, 32, 93, 85, 96, 67,167, 34, 15,108, 75, 44, 73,115,154,108, 98, 22, 90,164, 52, 46,147, 18, 76, 3, + 57,190,144,209,113, 25, 71,180,252, 34,238, 46,106, 55, 91, 23, 94,188,144,183,204,221,221,189,114, 33,127,172, 82,210,241,169, +194,194, 59, 21,227, 66,172,196,106,161,196,113,202, 96,232,191,122,249, 74,238,112,245,210, 43,175, 33,148, 76,253, 8,158, 25, +176, 14, 48,220,212,197,252,138, 82,206,171,229,172,124, 8,239, 69,185,184,170,148, 10,105,219,238,192, 43,215, 42,229,143, 63, +252,224,250,245,207,206, 61,123,234,214,143, 55,176,216, 91, 39,143, 7,228,166,185, 40, 16,167, 83,234,176, 68,128, 15,169,194, +206,224, 63, 13,138,113,170, 44, 1,148,105,138, 72,205,118, 2,175,138, 11,100, 21,186, 42, 24, 73,209, 74,137, 25, 93, 50, 83, + 82, 10, 32, 89,151,205,180,156, 91, 81,114,150,102,192,117, 37,149, 72,155, 15,231,182, 63,115, 38,243,241, 83,239, 31, 83,205, + 32, 61,210,100,141,227,132,106,161,134, 47, 9,140,211, 21,246,106,245,219,140, 99,115,158, 78,166,147, 74, 82,150,181,190,219, +131,165,186,110, 23, 75,189,123,247,102,123,216,214, 20,221,159,122, 64,205,167, 54, 54,145,244, 34,168, 42, 98, 18,206,253, 80, +118,131,250,127, 73, 77, 34, 82, 69,117,251,200,153, 70,239, 49, 29,184,249,182,165,103,183,107,219,184,242,105,187,137,159,130, + 39,133,153,144, 95, 99,203,124,119,231, 70, 40, 17,189, 94,199,233, 22, 50,133,122,161, 2,251, 2,133,233,178,126,123,255,246, +227,246,163,135,173, 71, 28, 59,158,226,121,137,134, 33,167, 99, 4, 21, 36, 4,174,239, 88,186, 1,175,113,208,184,127,235,247, +189, 90,177,142, 12, 45, 8, 60,141,198,132,149, 98,166, 0,120,229,141,250, 43, 70, 14,169,245,137,245, 99, 0, 94,124, 20,193, + 35,231, 12,107,115,189, 94, 47, 86, 23,243, 89, 61,191,193, 47,162,103,214,142, 60,233, 55,115,169, 44, 96,192,213,151,223,174, + 22,215,219, 3,100,177,222,111,247,127,181,253, 62, 32,188,153, 52,168, 25,119,177, 56,115,252,172,194,102, 53, 15, 26,247,138, +230,234, 90,105,253,236,214,243, 7,141,253,175,247,190,129,167,128, 31, 41, 90,101,184,167,112, 22,107, 27,240, 37,171,184,150, + 91,123,233,244, 69, 82,206,153,248,108,235,207, 73,185, 3,187, 83, 76, 48,142, 95, 49,166,142, 17,165,132, 32,198,156,192, 75, + 8,200,238,154, 24,230, 96, 15,126,182,248,163,235,254,220,126,224,204,169,197,103, 72, 64, 45,225,207,129,214, 73, 30, 6,217, + 93,176, 96,145, 61,138, 21, 34, 73,144, 26, 80, 19, 11,145,149,229,157,230, 61,252,218,165,252,233,218,181,215,163, 59,137,119, +118,222,120,247,252,251,137,243,137,157,203, 95, 74,134,210, 11, 38, 31,253,242,213,155, 63,124,254,222,205, 47, 26,142, 31, 72, + 81,235,219,159, 46,126,242,156,156,200, 94,251,254,211,220,209,115, 21, 45, 63,245,123,246, 44, 84,121, 25, 62,217,153, 56,195, +201, 72,146,132, 17,137,110,211, 84,121,214,176,210,138,174, 8, 50, 30,152,173,234, 73,154,229,227, 72,104,129,137,101, 80, 44, +151,217,176,116,103,212,197,203,155,122,177, 34, 9,163, 94, 16,155,131, 39, 61,119, 0,131, 98,195, 62,108, 61, 8, 73, 7, 97, +220, 26, 18,239, 69, 54,185, 82, 47,214,169, 71,118, 50, 17, 89,221,198,245,109, 83, 53, 36, 54,113,189,236, 75,161,130, 12, 53, + 74,210,144,199,159, 45,108,147,190,211,195,163,178,121,248,196,213, 23,222, 2, 40, 65,210, 48, 34,102, 71, 30,207,115, 74, 78, +195,171,183,135, 29,172,106,222,200, 99,193,250, 78, 23, 57, 68,199,237, 16, 71, 51,163, 29,174,229,235, 29,187, 61,116,109,207, +119,224,131,108,151, 14,138,128, 87,200,233, 80,223,199,204,210, 50, 50,224,227, 2, 32, 76, 41,153,165,165,115,102,177, 60,169, +104,186,102, 80,123,149, 98,204, 72,215,112,236,142, 71, 18,167, 44,235, 37,108,188, 24, 54, 66,120, 11,200, 92,243, 24, 9,255, + 43, 0, 81,231, 18,219, 70, 21,133,225,241,204,120,102,108,143,223,140, 29,167, 78, 98, 27,112,211,135,210, 38, 66,109,104,171, +178, 96,195,162,251, 86, 72, 8,150,236,145,216,161,194, 10, 33,132,216, 32,129,216, 85,108,233, 2,129, 88,128,130, 4, 73, 33, + 18, 8, 85, 13,175, 22, 41,144, 38, 77, 98,123,226,140, 61,126,142, 61, 99,206,127,110, 18,182, 86, 20,123,230,222,123,206,185, +231,241,253, 39,241, 59,242,113,100, 95, 50,102, 86,102, 82,149,138, 54, 91,158, 2, 64, 69,198,255,191,186, 42,137,217, 67, 56, + 20, 43,158,167,139,176, 6, 77,209,192, 63, 18,233,131,254, 42, 79,123, 10, 69, 86,133,135,116,181, 70,167,206,133, 64,193, 1, + 5, 68, 34, 16, 29,253,162,167, 95, 58,134, 41, 72, 96, 50,160, 35, 88,232,171, 29, 95, 23,208,126,164,132,115,169,169, 40, 31, +126,225,188,101,110,117,138,233,230, 52, 42,117, 46, 99,197,144, 9, 96, 21,189, 32, 23,159, 2,143,226,196,119,177, 3,244,198, +128,103,198,163,105, 38, 34, 32,230, 57,236, 54,155,221, 6, 67,201,165,136,106, 84,139,243,244,214,142, 80,146,220, 95,126, 44, +117, 8,199, 3,233,112,191,231, 12,108,242,252,133,124, 12, 73,246, 48, 52, 78, 21,153, 46,107,178, 0, 9,112, 44,197, 99, 77, + 19,129,136,153,176,124, 2,186, 95,134, 92,161,105,181,155,231,206, 86,139,211,249,149,239,190,189,244,220,162, 22, 86, 30, 62, +122, 36, 6, 86, 37, 48,168, 71, 11,231,230,111,221,188,249,229, 23,119,251, 93,247,246, 59,183, 63,250,224,253,203,203,203,181, +189,189,205,199,219, 42,192, 0, 62,172,222,196,211,212,192,208, 2, 13, 2, 87,232,184,167,179, 28, 49,212, 43,215,174,223, 91, +187,103, 24,145, 87, 95,123,189, 80, 89,158, 57,149, 92, 89,249,230,116,245,188, 97,152,107,235,247,253, 32, 60, 26, 11,146,171, +204,147,176,104, 38, 99,224, 15,230, 22,121, 2, 22,121, 30,252,126,127,226,141,132, 21, 56,161,198,162,245, 50,170, 43,228,186, +196,244, 44,186,119,194, 33, 51, 42,199, 77, 89,143,135,104,207, 2, 77, 47, 43, 24, 75,153,248,169, 72,166,235,185, 20, 74, 96, +168, 4,245,101,217,140, 37,236,246,193,152, 98,124, 35,105,104,250, 65,171,174, 1,201,163,197, 80, 49, 75, 82, 20, 79,139, 14, + 55, 26, 10,165,227,105, 10, 75,233,127, 53,221,166,166, 40,221,161, 75, 71, 90,147,245,225,184, 71, 14, 8,242, 11,131,206,156, + 85,218, 59,124, 66, 7,241, 84,182,184,223,170, 53, 59, 14,237, 67, 70,120, 71,201,100,145,123,168, 20,202,213,217, 51,231,207, + 46,206, 94, 57,243,227,234, 42, 61,176,237,212, 85, 53,220,108, 31,166,204,228,142,189,235,141,135,116, 14,109,215,166,112,129, +126,228, 92,174,148, 79,231,246, 14,247,233,237,204, 62, 53, 71,159,208, 98,161, 91, 3, 5,243,209,152,149,175, 13, 57, 66, 1, +224,198,230,134,149,200,108, 53,182,105,163,210,215, 61, 51, 85, 94,255,107,157,155, 55, 96, 4,211,145, 52,153,111, 43,145, 77, +198,146,100,113,150, 42, 11, 13, 40,141,180, 74, 51,213,254,168,255,243,159,191,180,251,157,203,167, 47,209,181,198,233, 56, 10, + 72, 77,190,219,235,208,215, 21, 82,185,122,107,223,118, 26, 75,229, 11,220, 15, 51,174, 31,236,246,218,237, 17,116,131, 85, 7, +124,232, 97,198, 76, 53,187, 14, 61, 62,231,205,253,168,110,188,116,241,197,239,127,255,129,158,133,174, 29,180, 92,201, 72,138, + 98,186,106, 84,207, 95,155,146,250,125,201,243,112, 32, 66,204,140, 20, 35,239,193, 17,157, 91,164, 65,125,142,223, 39,190,178, +223, 72,212,188, 33,217, 54,207, 15,165,245, 68, 68,179, 31, 59, 46,217,247, 1,112,161, 32, 6, 12,233, 45, 48, 94, 75,204, 37, +210, 95, 68, 13,217, 82,102, 62,220, 88, 61,244,220, 79, 46,188,145,125,111,241,229,165, 87,118,123,205,207,239,222,233,124,250, +219,230,214,253,207,118, 86,239,252,241,213,243, 86,233,198,236, 69,223,239,127,252,240,235, 66,186,152,118, 58, 79,223,120, 33, +254,107,230,221,191,223,124,251,250, 91, 59, 79,254, 89,179,127, 90,204, 47,228,116, 90,190,137,114,196,235, 18,138, 23,161,100, + 60, 97,106,145,158, 55,240, 1, 43,245,234,206,129,176,187,162, 18,123,117,254, 42,189, 22,186,238,112, 48, 41, 89, 9,139, 22, + 5,199, 16, 58, 90, 18, 93,247, 81, 90, 31,244,122, 20, 41, 39,178, 1,167,186,233,225,135,128,135, 75,220,149, 23, 60,155,175, + 80, 32, 63,102, 14, 40,109, 69, 88, 15,116, 31, 2, 10,237,227,195, 16, 71,196, 37, 10, 26,234,181, 90,202, 68, 61, 70, 13,135, + 41,132,127,240,239, 3, 93, 55, 38, 96,158, 15, 5,131, 1,242, 35, 34,103,194,221, 42, 3,144, 36, 4, 20, 0, 21,184, 8, 2, +161,232, 86,125, 11,226, 80,116, 70, 56, 39, 51, 24,244, 65, 73, 11,184,131, 6,105, 55,139,174,173,176, 81, 18, 48, 42, 66, 13, +137,121,204,170,138,153,187, 1, 52,223, 25, 22, 77, 81,145,152,164,117, 33, 80,229,147,175,155,206, 22,221, 62,118, 69, 37, 87, +158,179,202,187,246,182,138,158, 23,255, 63, 1,184,186,150,222, 54,170, 40, 60, 51,142,103, 60,206,248, 49,142, 93,219, 33,105, + 66, 83, 2,106, 82,156, 38, 24, 90, 94, 82, 35,177,130,150, 42,225, 33,177, 0,177,227, 23, 32, 54,176,136, 4, 98,133,216,176, + 69, 60, 36, 40, 18, 72,236,129,136,174, 88,145, 84,170,211, 38, 21, 38, 77, 73,210,164, 52,126,140,157,153,241,204, 29,155,243, +157,113, 26, 9, 47,237,209,120, 52,247,222,115,190,243,250,190, 99,126, 2,166, 73, 11,108,200, 21,122, 97, 64,192, 72, 94,252, +175, 47, 30, 35, 6, 40,180,162,123, 29,185,103, 89,233, 4,190,116, 12,237,153,221,139,229,152,104, 83, 14,170, 58,221, 13,220, + 0, 97, 61,231, 40, 88,232, 49, 53, 86,248,161, 56, 32, 99,228,232,117,196, 84,221, 71,186, 10,101, 77,230, 4,238,191, 46,169, +223, 13, 43, 44,215, 98,141, 80,172, 84,168, 64, 14,144, 46, 92, 35,158,180,236, 70, 63,155,200,141,141, 81, 37,202, 85,181,126, +169,182,175, 78, 30,154, 43, 12,127,163, 85,144,101,206, 97,122, 41,184, 27, 98,226,114,138,233,210,122,186,110,215,253, 46,232, +139, 65, 51, 25, 8,178,149,199,242, 50,156,174,164,144,141,118, 65,214, 52,122,168,152,163, 29,197, 15,164,112,130,137,121,239, +122, 17, 41,100,148,131, 32, 26, 89,108,219,237, 30, 30, 18,188, 2,114, 5, 81, 73, 32,182,239,254,253,234,229, 87, 82, 73,237, +214,198,245,231,158,157,171,110, 92, 31,136,118,233,151, 66, 46,243,198,226,194,219,239,188,187,178,178,114,245,234, 15,175, 45, + 92,121,100,100,108,105,233,227, 98,113,120,246,220,185, 95,127, 91, 38,207,169,116,229,185,153,153,177, 17, 10,109,135, 76, 35, +147, 78,166, 83,233, 33, 50,148,170, 58,232,218,189,139,243, 47,223, 94,175,174, 85, 54,116, 77,157,156, 24,221,252,235,206,242, + 47,191,151,159, 58, 79,193,198,181,107,127, 12, 40,154, 7, 49, 75, 22,208,139,244,197,181, 9,185, 10,140, 98, 33,159, 78,199, +216,243, 17,183, 43, 96,241,101, 42,130,168, 18,143, 73,134, 14,149, 31, 45, 74,246, 93, 1, 37, 56, 88, 24,144,254,212,200,189, +233,178, 30,195,219,165,173, 96,181,157,152, 28, 5,165,159,164,180, 58, 77,114,127,130,167,148, 81,184, 96, 62,231,188, 89,192, +112,160, 28, 33, 76, 68,166, 54,202, 76, 12,244,183,123,245,189,108,170, 64, 23, 36, 33, 51,162,236,214,112, 74, 45,112, 7, 10, + 56, 17,214,143, 39, 67,239,249, 62,237, 46,211, 48, 79,229, 79,173, 86,255, 12, 39, 48,232,216, 72,224,216, 3, 40,161, 51, 73, + 8,183,229, 88,116,168, 38,138,143,223,220, 90,179, 69,231,202,194,226,193,214,131, 91,213, 27,240,220, 65,151, 32,158, 69,182, + 82,184,201, 88,162,137,156, 9,188,185, 43,108, 23,234, 31,117, 90,181,132,110, 96,234, 74,146,155,237,198, 80, 50, 71,171, 73, +248,122,216, 44,152,113,147, 32, 94,105,186,116,230,133,217, 96,223,174,181,234,244,101,209,204,251,194, 53,161,195, 23,146, 85, +245,200, 52, 20,211,133, 98,166, 80,217,170,144, 17,173,222,223,180,220, 54,164,224,232, 38,233, 66,219,105,142,102, 71, 76, 35, + 85,185, 83, 33,199,118,246,228,212,246,253,237, 23,207, 62, 95, 26,155,178,253, 78,189,241,224,201, 71, 75,171,155,171,218,128, +214,176, 45, 80, 98,161,107,203,245,122,130,160, 58,109, 81, 77,139,147,127,162,215, 63,126, 98,156,150, 96,167,126,239,230,206, +109,199, 61, 36,127,217, 66, 83, 47,217,106,155,144,200, 88, 36, 54,124, 33, 75, 17,175,132, 54,237,128, 89,124,251, 61, 5, 44, + 33, 25, 10,190, 75, 28,189, 33,229, 34,251,234, 63,181, 84,147, 14,114, 87,153, 28,157, 17,237,221,136,122,176,107,185,232,106, + 13,186,157, 0,172, 40,184,152,219,189,125,174, 66, 38, 52, 53,169,169,247, 92,235,235,245, 74, 89, 29,253,224,243, 47,157, 61, +241,214, 23,175,127,181,240,253,244,165,199,150, 63,253,246,147,245,159,214,106,155, 31,150,223, 44,229, 79,167, 6, 19,207,228, + 39, 39,226,249,207,110,252, 88,212,178, 47, 61,177, 88,126,122,110,233,231,143,222, 75,190,159,200,202,223,108,124,119, 38, 63, + 61,149, 34,207, 36,148,135, 77,127,120,208,110,108, 64,115,124, 8,203,135,106,209,202, 67, 77,101,166, 22,216, 65,170,196,213, +162, 42,161, 82, 88,121,116, 37, 58, 16, 79,227,206,150,140,145,225, 60, 1,184, 24, 13, 61, 81, 62, 61,107,129,208, 16,184, 46, + 44, 63,144, 93,250,183,117, 64,208, 90, 2,123,140, 78,155,209,233,128,191,150,249,200, 4, 43,202, 33,125,213,134,175, 69, 15, +131, 26, 85,105, 9, 2,214,113, 68, 11,124, 64, 15,230,245,142, 38, 49,195, 4,182,204,190, 19, 28,112, 50, 40, 23,115,137, 19, +109, 86, 22,242, 40,180,243, 58,243,165,249,234,126, 85, 65, 17, 11, 48, 13, 80,138,108,251,209, 36,173,211,177, 5,210, 50, 33, +225, 89,200,230,216,147,250,153, 97,164,102,125,223, 27,212, 19,227,185,241,157,218,182,204,211,121, 16, 96, 96,225, 59,100,255, + 24,185, 29, 58,237,253, 6,103,168, 88,119,226, 63, 1,168,186,150,152, 54,174, 40, 58,227,239,216, 30, 67,192, 9, 50, 4,146, + 56, 31, 84, 16, 69,141, 29, 27,178, 32, 49, 93,244, 35,138,136,146,108,163, 42,251, 46, 43,149,108, 82,177,236,170, 11,212, 85, +179, 38, 85,148, 69,148,168, 85, 86,173, 80, 22, 40,146, 17, 65, 36,229,107, 91, 20, 3,254, 96,123, 2,227,249,121,102,220,123, +239,155, 68,142, 87,150, 44, 91,227, 55,111,206,189,247,221,115,207,113,252, 61,152,181, 19, 35, 47,114,156, 51, 78,128, 99, 79, + 28,199,127,226,152, 78, 35,100,244, 12, 3, 50,152, 52, 97,131,147,111,109,232,143, 26, 58,126, 17,173,160,208,108,209,114,252, + 4,219,249,149, 92,123, 56,192,115,145,243,145, 88,229, 4, 21,174,217,135,244,166, 45,243,118,208,217,241,151,101,253, 10,198, +124, 98,240, 13,201, 17,252, 69,192,199,176,208,161, 99,182,104, 7,189, 65, 49,208, 97, 24, 42,227,235,211,162, 99, 82,208,162, +131, 2, 40, 2,144,106,211, 50,137,223,130, 82, 7,216,140, 38, 31,184, 50,218,244,224,169, 20,250, 7,241,104, 21,102, 32,227, + 30, 69,114, 32,192, 68, 79,157,197,225, 73, 23,239,119,135,252, 36,200, 14,247, 29,242, 92, 13,114, 27,131, 51, 77, 94,209,176, + 7,166, 53, 77, 69,181,116, 13,239,127, 67,179,208, 50, 21, 66, 14,145, 41, 73,118,193,117, 80,172,109,111,231,167,190,249,238, +194,249,193,145,209, 68,126,103, 55,155,223,131,159, 26, 25, 26, 25, 31, 27,127,241,252,249,194, 31, 79, 0, 67,103, 31,204, 62, +123,186,144,205,111,213,171,149,233,153,233,205,127,223,201, 39, 82,167, 40,222,153,153,158, 76,167,227,163,163,169,212, 88, 42, +149,156,152,152, 72,167,191, 76, 94, 75,220,184, 57, 25,237,141,214, 42,165,229,149,229,213, 55,171, 47,255,252,235,213,226,226, +123, 89,190,125,235,246, 81,181,252,238,237, 90, 72,244,251, 60,200,132,129,188,219, 70,225,190, 22, 74, 36,218,128,146,176,191, + 89, 0,230, 73, 63,135, 36,126,200,181,146,228,147,120, 82,125,131,154, 17,182, 56, 23, 20,248,112,144, 19,132, 22,100,238,157, + 97,151, 0,136,238, 67, 8,167,204, 7, 53, 54, 93, 22, 54,161,155,248, 20,185, 25,159, 22,106, 41,213, 84,164,227, 26, 84,202, + 60,146,250,145,156, 11,145, 98,242,234, 87, 59, 7, 91,128,218,221,225, 8,172,115, 87,168, 59, 87,202,161,148,188,199, 15,235, +143,157, 79, 82,252,208, 77,245, 98,244, 50,132, 97,193,231,133,149, 28,236, 27,204, 30,100,147,201,241,195,194,190,205,195,134, +110,156,141, 12,236,215, 11, 52,202,143,169,134,110,168, 98, 80,172,212, 43,195, 67,195,235, 27,107, 71,185,210,198,206,218,177, + 92, 71,255,191,227,106,250,243,116,177, 94, 74, 92,185, 58,149,250, 54,179,181, 66,214,242, 40, 39,103,162,250,180,238,167,150, +166, 77, 85, 12, 9,178,210, 6,230, 57,168,151,175, 15,141, 29, 73, 85, 83, 49, 50,175,151, 0, 94,139,210,225,233,142,110, 73, +174, 3,250,157,235,191,164, 55,240,220,156,108,109,206,156, 10,117,172, 23, 54, 6, 34,125,112,253,138,166,198,122, 6,106, 10, +148, 23,110,200,206,124, 8, 88,218,155,220, 42,154, 28,120,189, 80,215,195,147,187, 91,218,253,175,178, 87,172, 30,198, 47,199, +171,239, 43, 42, 94,134,151, 92,188, 61, 0,238,128,110,177, 51, 23,202, 82, 25,174, 48,228, 15, 24,228,108, 85,147,235, 10, 42, + 34,184, 1,231, 32, 90, 12,156,142,213,229,178,135,244, 9, 92,156,229,214,180,161,155,189, 16, 29, 16,223,145,237, 98,127, 96, +236,178,177, 14,199,218, 25,171, 52,130, 48,206, 16, 87, 75,112,203,112, 92,168, 44, 85,198,123,162, 69,125,247,168, 1,113, 5, + 79, 63, 77,178,166,101, 83,176, 77,250, 34, 44, 77,208,227,237, 12, 4,187, 4,215, 63,249,226, 79,177,123,241,249,175,191, 79, +220,203,170,251,143, 51,143, 78,230, 51, 63,255,253, 91, 70,206, 61,140,223, 13, 9, 62,169,121, 2,208,166,114,250, 23, 0, 76, + 82,109,161,176,116,223,159,236,250,241,210,175,191,252, 46,201,158, 31, 18,247,231,150,231,250,187,175, 76, 70,206, 73, 86,131, +231, 62, 10,157,225, 25, 5, 84, 90, 16,218, 81, 55,134, 92, 77, 44,106, 17,187, 90,156,195,239, 36, 62, 16, 96, 49, 58, 4,180, + 80, 76,159, 20,201, 28,219, 37,200,127, 67, 2,138,202,233,150, 33, 43,114,111, 87,207,250,222, 38,201,105,185,216, 60, 84, 0, +149,185, 3,228,224,134,220,107,166, 3,209,142, 85, 0, 14,159,245, 15,162,248, 29,239,118, 82, 94,219, 34, 76,195, 90,129, 71, +214,114,167,226, 40,150,147, 83, 4,131,122,167,197, 1,152,222,148,181, 6, 99,127, 32,152, 90,205, 92, 49, 71,129,181, 69,222, + 65, 28,236,124, 98,180,216, 76, 38,210,102,132,114, 7, 33,153,109, 57, 41,242,217, 16, 98, 33,227, 20, 1, 93,180,166, 82,168, +237, 83,147, 19, 83,223, 48,142,224,105,182,115,162,142,135, 25, 80, 40, 40,106, 3, 37,169,232,245,191, 0,100,157, 91,140, 19, +101, 20,199,167,157,233,116,166,211,206,108,105,103,219,221,101,239, 13,151,237, 46,186,113, 23, 9, 17, 65,197,196,196,196,196, + 4,125,130, 7, 72, 8, 47, 60,147,224, 27, 49, 38, 38,134, 7,222, 20, 48,250,174, 33, 75,216,125, 0, 18, 31,192, 44,137,194, + 11,168,172, 46,133, 58,123,235,253, 50, 59,189,204,116, 46,158,243,125,109, 99, 52,233, 67, 51, 15,115,253,190,243,253,207,249, +206,249,157, 62,255,157,182, 66,245,250,193,119,218, 46,175,135,127,167, 89, 40, 44, 69,194,186,140,227,245,108,189,215,107,178, +251, 47,139,236,194, 16, 68,211,207,208,172,103,230, 63,191,255,219,250,162, 81, 36, 53, 11,108, 31,126,134,248, 14, 86, 36, 39, +161,219, 11, 76, 95,134,179,136,117, 22, 45,215,166,182, 3,163, 6,132,178,198,208,190, 15,174, 61,180,103,180,108, 20,208,195, +165, 68, 53,207, 11,112, 2,165,157,196, 35,170, 42, 39,107, 70,197,117,104, 66, 36,140, 24,155, 24,127,132, 4, 77, 14, 78,147, +244, 33, 24,208, 22,178, 10, 40, 26, 2,231, 16,230, 55,193,167, 5,231,134,148, 67,176,160,111,195,130,168, 40,184,255,206,225, + 38, 39,171,132, 17, 49, 38, 96, 74, 60,140, 75, 68, 69, 42, 82, 32, 42,113, 74,152,147,195,156, 18, 9,192, 31, 49,128,173, 94, +120,222, 47, 10,254, 90,189,252,248,201,175,174,101, 73, 82,164, 86, 53,158,175,173,131, 85,221,218,222,120,248,243,195, 76, 38, + 3,207,152,154, 30,159, 75,207,222,184,249,237,208,160, 10, 55, 63, 59,115, 96,100, 88,253,227,249,211,102,219,124,176,250,232, +135, 91, 75,183,150, 86,150,151,239,222,185,115,247,254,189,251,203,183,151, 90, 13, 99,108, 98, 18, 91, 64,236, 29, 91,120, 99, + 49,181,111,198,178,156,106,205, 24, 31,157, 56,115,246,252,245,175,191,251,237,207,108,117,183,211, 34, 74,213, 70,147,221, 99, +250, 48, 36,170,130,113, 17, 4, 48,176,136,152,244, 19,158, 27, 46,219,216,105, 41,232,147, 4, 54, 36,120,114,196, 47,133, 24, + 73,196, 94, 22, 32,157, 97,157,224,131, 12,217,147,240, 89, 22,250,245, 56,228,120,135, 53,131, 9,105, 56, 20,144,234,205, 50, +184,150,116,240,201,226,128,217,105, 31, 61,250,214, 88,106, 84,203,110,192, 5,193,223,220, 42,108,130, 5, 18, 3,146,222,172, +128,126,223,170,104, 14,242,120, 5, 63, 38, 24,152,157,142, 3, 23,130, 47, 56, 2, 51,223,168,150,244, 98,114,207, 16,124,227, + 23,185, 23, 2, 43,204, 47,206,231,181,124, 76,142,183, 76, 67, 55,117,170,229, 97,229, 74,143,167,115,181, 2,140, 16, 49, 16, +138, 15,171,154,150,133,131, 83,137,201,205,130,214,176, 12, 89, 82, 74,122, 9, 68,235,218,246, 95,171,191,175,130,162,191,240, +193,185,204,206,203, 14, 70,172, 40,144, 20,165, 19,146, 49,177, 36,157,123,123,238,216,250,214,122, 82, 78,108, 20, 55,158,189, +122,102, 19,156, 19,216,157,244,196,204,223,185, 44, 88, 88,137, 15,229,107,249,215,210,139, 47,181,117,137, 23, 90,118, 27,140, +184, 16,148, 84, 57,174,149, 54,193,163, 63,124,112,225,253,215,143,175,174,253,178, 55, 54, 86,168,231,193,145, 5, 31, 52,196, +193, 68,148,170,205, 58,152, 9,184, 10,232,178,119, 79,124, 84,204,109, 86, 27, 85,212, 19, 62,102, 80,137, 7, 57, 94,224, 67, + 31,191,247,169,103, 90,229,221,138,209, 54, 68, 65, 74, 13, 79,101, 11, 26,169,191,198,217, 10,239, 10, 76, 24,120, 27,117, 4, +228,113,170,146,176,236,134,159,243,169, 12,183,255,157, 81,134,195,236, 40, 34,213, 40, 43, 16, 53, 27,238, 47,119, 65, 50,158, + 77, 98,234,216, 48,185, 21,229, 35, 71, 64,139,218, 78,203,114,188, 40,219, 42, 88,219, 58,110,169,123, 22,114,122, 93,162,213, + 72, 13, 10, 78, 25,140,234, 33,233,136,231,195, 2,127, 40, 22, 62,125,238,243,224, 72,226,212, 23,167,190,121,243,230,252,236, +220,247, 87,191,188,150, 93,249,236,240, 39, 81, 65,216,197, 34, 18,218, 23, 4,211,111, 22, 98, 83, 63,102,127,138,214,195,199, + 47,127,248,228,250,211,149,157,229, 75, 39, 46, 94,121,244,213,128, 60,120, 50, 62, 89,179,155,180, 28, 19, 23, 86, 76,250,193, + 54,141,245,118, 3,239,195,207,244, 58, 61,117,109, 8, 77,165,166, 48, 22, 48, 29, 60,207,131, 32,134,183, 17, 83,226,122, 75, +167,241,225,125,201,233, 76, 46,131, 45,170,125,222,118,121,135,128, 51,187, 39,162, 52, 55,171,131,153, 54,201,129, 36,104, 97, +166,215,192,142,148, 58, 58,168,237, 28,179, 92, 47, 15,132,162,224, 29,195,226, 17, 64,104, 18,149,219,222,174,169,155, 54, 97, +155, 35, 69,146,161,153,202, 30, 77,138, 39,119, 7, 71, 8,141,174,211, 43, 5,237, 54, 87, 37,228, 84, 55,200, 6, 19,114, 18, + 28, 68, 92,142, 8, 94,158, 6, 31,186, 15,215, 47,174,100,186,247, 67, 10,166,218,212,181, 81,229, 4,238, 47, 34, 4, 91, 6, + 63,152,100,123,251,167,147,169,138, 94,114,177,161,155, 69, 19,165,168,129,253, 71, 0,178,174,165,183,137, 51,138,206,140,231, +229,199,196, 30, 3,142, 1, 37,142, 16, 38, 5, 41,101,193,179, 82, 55, 93, 80, 9, 33,241, 43, 88,177,226, 23,208, 74,176,237, +166,226, 37, 80, 85, 85,221,176,236, 18, 85, 98, 81, 5, 65, 4,225, 13, 69, 9, 80,145, 0,121,121,236,248, 49,153,137,237,241, +124,156,123,191, 49, 41,173,149,133, 99,143,237,121,125,247,158,251, 58, 71, 77, 83, 33, 38,209,111, 82,182,168, 63,183,220, 72, + 66, 29,255,229, 35, 97, 6, 30,166, 79,190,180,242,170,242, 31,196,254,153, 78,230,127, 47, 10,154,173, 55,136,181, 39,142,182, +242,251, 42,147,195, 36,159,138,153, 99, 68,242, 89,114,142,120, 24, 0,104,156, 81,132, 7, 6,110,226, 27,136,188,190, 96,186, +123,133, 4,140,178,150,105, 17, 51,184,202,137, 8,161, 32, 0, 79, 41,218,168,187,179,229,175, 51, 99,220,240,107,216, 15,101, + 45, 71, 55,204,150,223,192, 75, 56,131, 56,119,111,151,231, 18, 18, 38,133,205, 31, 66,111,203, 17, 74, 79,167,138,179,129,251, +251,216,193,178,110,105, 3,161,133,189, 88,138, 39, 72,221,153,160, 31,209, 96, 53,211, 99, 99, 51,195, 20,108, 7,201,141, 80, +115, 33, 41,117, 0, 47,104, 36,251,216,239, 90, 48,147,186, 1,179, 75,195,223,212, 91, 75, 98, 73, 68, 2,168,106, 59, 10, 35, +216,177,159,175, 92,245, 60, 15, 80,238,229,179, 23, 55,126,251, 53, 8,187,212,178, 74, 67, 17, 68,168,105, 18,221, 24,150, 66, +255,210,229,203,127,191,124, 53,253,215, 29,183,184,109, 28,150,126,239,158, 74,165,162, 35,212, 74,103, 30,206,220, 59,127,225, + 34, 86,203,247, 39,190, 59,114,232,240,236,236,195,233,123,119, 83,196,227,129,245, 60,232, 70,162, 79, 5, 30,172, 37, 97,176, + 15,231, 94, 93, 2, 21,148,100,199,206,147,213, 39, 20, 39,245,193, 88,245, 26,208,131,238,161, 72, 29,224, 73,216, 21, 8, 83, + 2,120,117,238, 48,199,225,149,227,252,190,210,212,147, 15,143,240,105,110,213,162,113, 51,152,120, 55,227,206,125,124,133,192, + 6,145, 22, 34, 74, 22, 85,208,185, 30,152,116, 55,185,153,162,215, 94,131,175,101, 49,141, 77, 22, 82, 23,186, 98,142,237, 24, + 95,107,174, 96,157,155,186,121,184,122,228,209,252,236,120,105,162,209,241, 96,217,137, 96, 63,101,135,189,144,242,233,110,185, +209,169,101,109, 39,103,231,234,237,250,212,196, 20,206,219,252,210, 28, 37,229, 72, 39, 69, 45,111, 47,183,219,237,186,239, 21, +115,238,129,177,201,167,239,158,187,233,124,216,235, 53, 55, 27, 27,193,134, 96,221, 43,184, 1,108,108,165, 76, 39,237, 32,212, + 91,105,124,128,213,112,179,110, 74, 32,110,211,229,212,226,129,221,213,183,203,175,185,206,169, 2, 33, 77,148, 42,134,105,188, +175, 45, 2, 4, 26,186, 1,175,112,251,201,109,234,101, 20,184,196, 20,190, 77,238,222,215, 10,154,181,206, 58,182, 47, 56, 69, +199,202,141,100,156,153,249,251, 56,215,105, 59,131, 0, 20, 54, 8, 71, 71, 36,254,176,218, 41, 11, 55, 19, 83, 63, 17,198,236, +115, 63, 6,126,215,201,229, 87, 27,203, 60, 42,169,142, 22, 74,155, 92, 4, 38, 98, 34,149,200,103,176, 82, 28, 59, 27,139, 64, + 55,180,175, 6,169, 83, 23,143, 43,122,160, 52,154, 74, 55,160,137, 9,249,215, 31, 40, 68,230, 8, 92,209, 15,137, 5,111, 64, +242,166, 64, 51, 77,247,177, 87,182,210, 5, 63,104,192,134, 77, 22,252, 23,235,175, 91, 33, 53,118,244,184,127,134,117,127, 96, + 84, 72, 22, 25,102, 26, 87, 52,159, 54, 43,249, 17, 55,147, 51,148,232,232,254,211,127, 62, 14,206, 77,255, 36, 30, 8,239,247, + 91,223, 94, 59, 51,234,142,158,253,250, 68,160, 68,157,192,215,101,211, 23,181,155,233, 19, 78,233,199,251,127,188, 91, 93, 90, +152, 91,188,245,195,204,201,155,223,136,179, 98,236,151,106,102, 91,241,250,161,211,139, 97, 77,178,218,226,120,109, 59,221,241, + 59,240, 37,166,101,251,126, 59, 34, 61,107,110, 17,167, 92, 19,177, 96,145,182, 53,129, 54,213, 54,179, 81, 68, 4, 3,117,191, +142, 93,222,187,171,250,102,249, 31, 70,111, 84, 99,175,117,106,199,171,199, 86, 90, 43, 11,107,239,101, 73,153,197,166, 98,182, +197, 26, 95,163, 94, 82, 24,252, 55,118, 22,113,181, 92, 93,240, 22, 36, 89, 33,222, 7,186, 7, 90,199, 79, 80,211,161,102,110, +144, 63, 16,204, 39, 33,251,241, 18,112, 76,249,128, 1, 53, 18, 3, 92,110,119,100,179, 83, 44,137, 32, 82, 9,207, 79, 98, 52, + 53, 77,246, 25, 74, 25,221,225, 55, 48,251, 43,141,234,176, 20, 1,208, 35,105, 74,197, 52,158, 38,223,138, 36,121,112,204,234, +206,177,112,179, 5,191,187, 65,154,145,244,191, 24,134, 38, 67,182, 6, 77,251, 36, 0, 99,103,211,219, 70, 21,133,225, 59,159, +158,113,166, 78,226, 54,113,112,136, 81, 27,218,136, 15, 9, 33, 88, 32,164, 10,196,162,236,232, 2,177,131, 31,128,144, 96, 81, +132,144,202, 6,177, 67,252,137, 10, 33, 85,170, 88,116, 1,123, 54,165,129, 44,192, 52,105,212,144, 68,180, 41,216,241,216, 99, +143, 61,158,241,204,157, 59,156,247,222,113,183,224,173,173,201,248,250,230,204,123,238, 57,231,121,205, 50,136,178,114, 72,245, +255, 4,247, 39,239,230, 37, 71,157,105,115,149,173,207,223, 44,216,127,188,230,232, 66,138,236,242,129, 51,199,208,195, 72, 23, +196,112, 35, 19,137, 58, 44, 34, 45, 70,191, 43,233,206,146, 56,198,116, 7, 4,218, 88, 69, 4,204,169,195,225, 19, 53,116,244, +229,163,216, 89, 40,219,195, 97, 52, 80,217,128,114,190,115, 44,247,147,171, 31,125,253,253, 55,148, 35, 27, 24, 46,101,178,124, +145,207,185,167, 98, 26, 13,152, 76,159,186,195,199,189,176, 43,189, 16, 85, 2,128, 79, 66,213, 74,254, 37,184,252,232,216,177, +126,219, 29, 60,191,185,162, 89, 20,138,133,180,187,195,243, 25, 74,176,172, 46,107, 34,227,163, 56, 47,255, 62, 43,121,200,104, + 38, 81,100, 72,156,239,219, 83,248,123,115, 12, 55, 27, 66,126, 74,195, 73, 65, 14, 96,195, 63,167,193,202,242, 82, 26,243,207, +174,125, 62, 12,199,136,131,122, 1,138,128, 65,234,201,144, 67,139,146, 20, 68, 42,109,198,251,189, 32,232,251,191,238,108,163, + 44, 1, 95,112,225, 84,156,167,214, 26,235, 27,173,246, 31,247,170,182,117,105,179,121,253,203, 47,152,217,120,227,205,203, 15, + 63, 62, 62, 13,124,186,133,104,154, 43,107, 96,131,194, 40,206,212,209,213,139,125, 5, 3, 78, 3,165, 99,120,192, 21,113,138, +185,214,138,205, 92, 7,126, 38, 51,228,234,184, 85, 46, 80, 67, 38, 69,132,251, 65,237, 4, 50, 37,225,197, 40,143,246, 59,191, +211,143, 87,113, 42,113,146, 63,187,182,117,220, 61,138,146,136, 2, 89, 10, 39, 57, 78,130, 93,217, 22,184, 20, 59,165,201, 67, + 56, 25,234,186, 57,152,248,244,207, 66,162,120, 20, 7,180,252,142, 13,254,217,140,163, 11, 16,245,127, 33, 62,120,235,253,219, +119,111,175,214, 87,143,122, 7, 75, 48, 32,101,103,189,115,221, 97,231,221,215,223,251,238,167,111,109, 84,119, 5,201, 34, 29, +182,109,158,231,122,123, 64, 20,112,210,206,241,108, 26, 70,163,105, 18, 63,215,186,180,115, 48, 57,241, 79, 72,208,213,107,245, +246,163,123,141, 90,163, 23,246, 61,123, 33, 6,214, 24,172, 62,146,216, 47,182, 94,184,255,104,207,212, 13,186,200,130,229, 80, +220, 39,197, 77,169, 27,137,131, 28, 80,195, 34,229,220,180, 44, 30, 39, 27,141, 86,111,236,147, 96, 95,175,111,208, 35,199, 52, +173,246, 97,123,209, 61,147, 82,202, 95,100,180, 8,231,150,214,134, 81,224, 7, 62,237, 8,207, 93,190,176,250,244,206, 97,155, +246,240,219,175, 94, 9,147,241,221,221,237, 42,104,107,224,243,100, 89,102, 74,123, 23,207, 57, 67,234,239,208, 63,206,163,145, + 87, 93,180, 89, 49,140,104, 73,226,102,125,221, 31,247, 57, 79, 58, 65, 71,246,235, 22,146,218, 84,216,150,147,102,148,157,212, +195, 40,145, 71, 16,178, 44, 78,219,220, 49, 41,230,200, 35,120, 37,187, 25,152, 79,140, 27,185, 4, 23, 62,105, 61,208,244, 25, +159,140, 6, 65, 42,244,243, 11,158,159,157,146, 58,157,113,117, 38, 83,226, 93,132, 82,183,165,121, 50,109,137, 34, 76, 82,219, + 2,254,254,231,253, 31,106, 85,118,235,229,175,216, 43,236,198,135, 63,254,149, 13,174,109, 93,237,167,195, 52, 87,125, 62,243, +158,109, 77, 12,248,232,157,141,151, 62,237,110,179, 59,226,202,229,215,216, 77,198,122,236,153,234,230,126,250, 48, 18,146,238, + 39, 57,151,112,120, 95, 59,191,123,216,166,164,170,117,182,185, 23, 79,148,112,215, 20, 6, 86, 13,226,226,153,161,213, 97,155, +199,151,107, 43, 15,186,127, 54,151,215, 79, 6,143,143, 59, 71, 12,150,120, 38,105,126, 90,118, 90,255, 95, 14,118, 20, 54,187, +108, 1,100, 74,107, 51,199, 66,159,123,150,204,212,168,151,140, 96,170,235, 3, 95,249,254,223,251,110, 5,126,244,128, 32,201, +249,209,173,230,197, 59, 15,250,180,148,139, 14,109,149, 88,148,189, 45,114, 42, 68, 94,157,131, 5, 17,211, 37, 76, 3,161,187, + 23,246,100, 90, 9, 0, 36, 24, 45, 18,151, 86,199,137, 83, 86,115, 61, 74, 50,242, 44, 87,230,216,243, 26, 39,116,168,106, 79, + 87,129,110,209,173,205,178,116, 2, 79,237,185,221,183,226,196,104,106, 5,138, 0,117, 71,232,108, 33,135,101, 85,100, 37,157, + 74,114,228,116,140,100,241, 95, 1, 8,187,146,221,166,161, 40,106, 39,113,198,166,118, 76,155,164, 9, 67, 11,170,104, 85,132, +202, 12, 18,208, 10, 33, 1,130, 5, 18, 75, 16,123, 36, 62,128, 45,191,129, 88,176,101,203, 22, 4, 29, 16, 44, 17, 67, 85,212, +162, 22, 2, 5, 53,141, 3,169, 99,199,126,158,184,231, 61,183,168,176, 32, 89, 37,138,228, 33,126,247,157,123,238,189,231,196, +252,123,184,147, 59,137,118, 72, 17,252,255,181,165, 15, 45, 75,127, 81,245,255,188,182,189,120,229, 29,153,192,118,237, 53, 62, +162, 94,208,123,204, 38,152,131,153, 52,128, 6, 70, 41,185, 48, 84, 66,141,155,123, 36, 70, 49, 49,143, 67,249, 92,239, 55,226, +125, 42, 92, 9, 32,116, 3, 55,190, 99,241, 62,133,145,176,249,133,151,208,124,228, 30,158,244, 13, 69, 64, 45,174,172, 38,124, +116, 85, 75,241, 93,130, 12,133, 20,139,216,137, 18, 71, 2, 54,137, 65, 72,139,218,217, 59, 48,130, 57, 41,184,239, 5,174,237, + 79,238, 30, 80, 33,196, 12, 20, 76, 8,209,227, 13,155,244,199,113, 37,211, 4,125,100,116, 42, 12, 65,147, 65, 3, 45, 98, 92, +204, 94,108,201,201, 45,137, 94,232,160,248, 50,131,121, 56,136, 2,126,155, 98, 96, 48, 61,117,246,249,204, 11,194, 76,112,175, +229, 9, 41,244,135,157,192,115, 67, 15,106, 46, 96, 5, 93,215,107,172,172, 26,173, 86,207,178,138,125,133, 60, 37, 35,197,108, + 46,155,164, 53,223,179,214,251,242, 82, 38,143,211,223, 95,175,245,247, 37, 95,205,205,204,205,191,118,220,200,247, 96, 49, 28, +241,156,131,174, 51,135,190,120,176, 28, 89, 8,218, 96,102, 53,163, 64,214,145, 14,225,113,178,141,187, 77,130,138,241,125,144, +186, 46, 3,114,135,164, 32, 22, 26, 87,162, 23, 14,145,120,234, 67, 37, 64,145, 6, 77,243,158,211, 70,139, 24,157,107, 80,192, + 60,142, 74,200,157,226,118,165, 84,163,168,100,116,155, 90, 97,151,177,217, 76,167, 51, 21,109, 40,155,202,186, 1, 27,210, 43, +135,135, 39,127,180,191,115, 95,117,108,177,195,131, 35, 20,218,134,171,251, 62,172,190,255,210,252,236,193,136, 71, 25, 46,143, +180,205,230,228,254, 35, 20,190,103, 23,102, 25,115,180,130,126,116,244,228,173, 11, 55,223,173,190,163, 93,242, 91,235,107, 16, + 4,106,159, 78, 48, 42, 45, 43, 4,115,126,154,198, 98, 99, 81, 47,234,142,107, 17,112,182, 28, 84, 92,175,158,188,108,116, 58, + 90, 81,163,155,165,230,251, 15,212, 70,127,153,144, 39,164, 39, 97,176, 88, 62, 61,118,234,135,177,166,149, 6,147,138,178,242, +109, 41, 64,204, 74,213, 75,181,235,167,175, 20,246, 84, 75, 81,230,203, 70,131, 30, 39,216,233, 97,226,212,165, 19,107,118, 90, +103,198, 79, 77, 79, 78,117, 2,191,185,241,189,170,149, 7,213, 50,129,208,169,219, 55,140,165,181,245,205,141, 4, 92,123, 28, +203, 54, 63, 54,150,104,241, 13,233,117, 74, 28, 71,135, 14, 88,174, 93, 46, 14, 80, 84,109,117, 90, 37, 85,135,167, 68, 50,217, +115,123,149, 82, 21,205,112,138, 66,217,183, 86, 44,181,205, 54, 44,142, 3,159, 82,183,241,250,120,219, 52,120,165,154,242,200, + 14,212, 39, 19,242,152,146,219,125,177, 6,183,107, 68,118,193,100,114, 28, 35,192, 93, 24, 38,227,226, 42, 10,151,132,199,101, + 47,221,141,198, 51, 74,174,170, 72,197, 84,107,217, 92,219,236,161, 29,219, 19,141, 5,136, 15, 1,151, 43,229, 19, 45, 66, 95, + 92,134,218, 87, 74, 76,117, 80, 14, 35, 75,118,250, 77,243,241,147, 7,111,159, 29,171, 30, 26,219, 85,239, 48,238, 40, 34, 9, +227,110,248, 19,112,165, 14,121, 76,221,243,104,249,233,181,125,199,235,151, 14,222,127,120,255,110,229,222,203, 95,179,139,236, +211,157,137,105,202, 60, 76,167, 39,115,199,159,141,159,235,224,172,229, 16, 61, 87, 40, 33, 68,156,102, 10,233,146, 43, 90,149, +226,154,112, 2,234, 50,219,116, 76,163,219,166,223, 88, 12,178, 13, 34, 50,244, 23, 84,228,127,128,111, 18,229,106,185, 84,198, + 98,118, 40,230, 55,164,144,139,248, 19,252,247,184,182, 93, 87,138,175, 72, 48,200, 34,200, 3, 92,159, 24,133,124, 5,199,213, + 32,178, 26,198, 90,127, 94, 37, 20,130, 58,188, 44,204,103,161,156, 95,213,235,166,213, 17,225,239,220,196,249,207,205, 21,161, +129,185,213,220, 24, 70,241, 64, 56, 14,224,194,121,212,179, 88, 47,228, 45, 36,127,128,180, 20,251, 51, 71, 91, 99,153,244,182, + 61, 27,125, 89,144, 44,149,130,109,111,149, 29,108, 8,223,157,131, 72, 24,117,243,181,130, 86, 20,168,195,195,123, 66,249, 45, + 0, 89,215,210,211,198, 21, 70,231,225,121,120,198, 24, 63, 18, 99,130, 77,148, 84, 66, 85,138, 42, 37,108,218, 72, 81, 43,181, +139, 46, 42, 53,221,132, 95,208, 69,187,170,146,252,129, 72,253, 47, 89,103,145, 63, 80,161,180, 52, 44,250, 72, 8, 16,129,133, +113,138, 25,207,224,177,103, 60,111,251,246,251,190, 59,166, 40, 97, 5, 6, 12, 51,247,206,185,231,123,157,147,227,123, 38,252, + 47, 50,195, 46,209,119, 85,208,166,243,230, 72,246, 65,126,230, 61, 52,103,151, 1,251,131,159,189,152,195, 90, 91,190,101, 99, +194, 93, 16,223,127, 27,113, 30, 76,204, 96,217, 10,162,146,100,201, 44, 79,161, 32,130,207, 19, 65,188, 59, 19, 89, 60, 4,230, + 9,150,176, 89, 46, 50,198,213,101,168, 52, 86,160,189,135,128,203,200, 49, 29,239,218,140,196,212,197,148,166,203, 80, 29, 44, +155,134,145, 63,155, 79, 14,176, 75, 87,206, 9, 75, 94,122, 22, 88,185, 88,139,209, 8, 70,210, 53,211,241, 7,138,132,143, 78, +217,168, 15,131,209,110,207, 30,122,169, 41, 20, 42,170,114,179, 90, 54,100,165, 90, 80, 77,137,228,188,136,255,164,132,212,240, + 20,201,212,246,101, 40, 50,202,126,225,161, 78,192,202,255, 24, 4,113,104,248, 41,168,178,168,144, 91, 71, 17,184, 87, 81, 2, +204,234,117, 58,142,115, 78, 19, 19,240, 37, 75,162, 41,132,213, 97,146,133,240, 15, 69,233, 36,142, 61, 63, 75,179,233,153,229, +246, 78, 45, 56, 72,128,254, 71, 49, 28, 0,136,254, 34, 43,160,233, 13,119,205, 13,162,157,237, 23,207,159, 63,219,222,217,214, + 84, 86, 50, 72,176,128,190, 71,186,110,140,164,105,248, 28, 5, 83, 20,153, 75,240, 99, 27, 42,108, 3,156, 64,195, 54, 33, 8, + 77, 16,238,185,226,252, 12,101,150,138, 42,122,137,150, 53,212,200, 52, 52,169,164,162,171, 9,108,170,208, 71,217,184,213,250, + 13,160,222,181, 82, 83,196,214,186,108, 20,184,216,220, 66, 75, 20,165, 17,132,210,227, 0,245,214, 39,161,207,200,236,198, 13, + 71,134,162, 91, 67,203,246,157,107,149,229, 17, 26, 16,203, 16,153,157, 79,134, 94,224,102, 83,118, 60,232,220,191,251, 29, 14, +160,207,152,227, 89, 31, 53, 63,238,244, 59,127,119,255, 74,102,113, 1, 69, 49,213,195,254,219,223,247,183,147, 36,110, 86,155, + 74, 65, 65, 67, 37, 99,225,232,244, 16, 40, 66,187,126,253,199,251, 63,109,253,243, 43,202,143,136,146, 94, 40,114, 78,184,123, +252, 6, 62, 25,250, 3,184,240, 56, 13, 7,110,191, 94,198,185, 83,128, 1,224,227,157,211,163, 48, 10,116, 89,213,224, 87,100, + 29, 88, 66,251,202, 10,188,249,214,171,173,211,238, 49,176,123,107,100,173,181,214, 54,239,125,127,240,239,219,198, 98, 35, 74, +194,202, 66,237,143,131, 29,219,177,172, 65,111,165,222,234,218,189, 79,239,124,222, 63,123,167,219,217,222,187,189,132,152, 49, + 44,217,245,165, 85, 0,199,113,228,127,181,254,197,235,238, 46,220, 99,215,119,117,205,176,199,118, 99,241,106,148, 37, 81, 26, + 47, 45, 46, 65,200,111,141,207,224,245,205,111,127, 88, 41,213, 94, 30,236,212, 22,234,143, 31, 60,250,237,213, 11, 0,117,114, +155,139, 22,208, 73,202, 71,211, 22, 8,184, 36,225, 51,195,172,124,211,204, 51,175,128,239,210,188, 92,199,200,154,131,104,146, + 72,163,106, 41, 73, 39,161,231,124,168, 52,245,115,143, 29,237,186, 39,246, 36, 70,153, 64, 50,222,100,148,106, 16,114, 73, 97, +129,218,207, 17,217, 73, 10, 91, 70,215, 73,116,188,147, 21, 20,229,214, 51, 37,221,104, 87,110,215, 26, 89,170, 13,227,228, 74, +229,106, 28, 71,232, 84, 78,102,222, 88,201, 18,196,170,110, 60,221,127,217, 40, 55,191,124,248,245,147, 95,158,108,214,126, 62, +153,238,111, 5,127, 62,184,182,209, 71, 47, 7,234,230,150,242, 36, 44,158, 69,164,245, 82, 45, 85, 23,205,138, 31,248,128, 83, +192, 21, 96,239,222, 92,190,113,230, 58,156,180,154,197,146,174,105,126, 60,225,116, 12,109,199, 19,172,181,194,138,195, 53,140, + 67,207,139, 39,173,122,203, 40,154, 65, 18,222,106,125,130, 19,115, 35,180, 7, 73, 89,134,243,143, 18,119, 54,165,205, 47,230, +118,247,112, 87,186,118, 23,117, 86,232, 86, 81, 14, 7,187,245, 98,234,183,161, 44, 48, 23, 92,156,146,167, 43,188,136,198, 32, +142, 55, 12,147,144, 78, 50, 28, 16,108,215,219,220,208,102,198, 75,139, 36,229, 70, 46,183, 2,247,104,226, 31, 18,111, 42,164, +149, 41,105, 37,179,104,194,161,158,187, 94,231, 99,248,188,167,156,154,127, 36,233, 2,139, 69, 33,175, 56,139, 23,165, 75,124, +166, 1, 67,212,245,213,117,199,115,254, 19,128,173, 43,233,109, 26, 12,162,182, 99,127, 94, 99, 39, 77,186, 80,160, 75, 16,130, + 22, 40,168,148, 75, 17, 23,132,170,194,129, 51,226,194, 1, 9, 9,113,224, 55,244, 15,240, 83,144,184,115,171,170, 34,113, 0, +129, 16,221, 68,247, 36,109,227,186, 89,236, 36,174, 29, 51, 51,182, 43, 42,170, 86,234, 37,117,188,125,111,102,190,121,111, 94, +130,239, 97, 74,130, 60,131, 56, 82,211,114, 23,130,251,133, 16, 15,103, 54,164, 13,184,167, 56, 98, 77, 18,100,154, 74,246, 15, + 75, 38, 69,115, 56, 28,224,227,128, 49,228,249,173,248,178,255,203,244,211, 72,151, 80, 51,185,243,221,217,158, 41, 91, 62,229, +218,104,206,146, 86, 84,232,211, 45, 50,236, 20,197,247, 72, 49, 10, 6, 26, 74,140,244,151, 28,207, 78, 24, 87, 40,216,196,153, + 55,144, 57,162,151,102,167,129, 68, 89, 0, 47,162,249,103, 85,211, 79, 26,232,252,185, 22, 2,159,200, 90,105,200,170, 64,130, + 99,156,141,227,135, 93, 28,214, 26,241, 19,195, 51,101,231,168,220,112,183,142,156,223,149,230,190,221, 8, 0, 38,186,112,142, +161,201, 84, 75, 20, 46,233,202,112, 86,201,139, 82, 17, 93, 23, 5, 90, 85, 28, 67,218, 6,124,127, 47,131, 91, 46, 56,246, 0, + 78, 92,101, 16, 63, 56, 21,119, 95, 35,220,248, 6,136,151,132,147,250,113, 44, 99,147, 1,244,149, 40,171,225,152,110, 93,146, +178,138,164,201, 25, 83,145,113,162,164,206, 44,157,245,153, 56, 91, 70,135,194, 30,254, 55, 22,221,210,244, 36,146,188,114,232, +162, 43,147, 81, 33,252,240, 34,178,158, 3,234,176, 5,168, 6, 17,105, 60, 7, 64,179,162,240,186, 38, 49,114,161,194, 90, 15, +149,150,156,172, 8,186, 10,191,216, 85,211, 84,193,178,132,188, 33,105,122,198,208, 69, 93,197, 48,209, 67,237,126,207,239,112, +237,118, 47,242,185,160,121, 26,107,229,188, 54,138, 15,221, 78,211,212,114,134,154,237,248,174,144,176, 30, 0, 29,212,170, 83, +238, 55, 7, 14,142,203,177,109,102,236, 26, 6,127, 38, 71,166,152, 32,237,218,155, 10, 83, 80,214, 16, 69,111,159,190, 91, 94, + 89,242, 78, 93,141,105, 27,123,235,144, 4, 1,176, 70, 72,246,168,194, 49, 1,239, 70,139, 37,187, 89,243,124,156,249, 7,159, + 1, 0, 5,148, 28, 46, 92,190, 59,126, 27,150,122,195,109,118,131,110,213,169,124, 90,250, 56, 55, 61,191,117,184, 53,123, 99, +118,187,134,158, 12,166,130,183, 16,149, 77,228,158, 10, 49, 70, 97,104, 21,112,109,112,252,205,211,215, 43, 59,171,211,215,103, + 80,147,193,100, 40,196,225, 43, 32, 83,238, 55, 11,110,167, 14,231, 6,135,173,214, 43,240,178,237,219,229,189,195, 93, 72,219, +171, 39, 7,144,232, 65,121,119,191,116, 15, 46, 39,103, 88, 39,104,231,212, 88, 91,251,249,236,193,220,242,234, 87, 8,208, 19, + 35,183,198,138, 99,144,117,238,217, 21, 15,181, 51, 1, 19, 69,199,173,231,244,252,104,241, 74, 49, 87, 40,219,101, 56,103,159, +152, 96, 45,183,217, 14, 58, 80,162,193,138, 93,252,246, 25, 66, 17,220,190, 86,167,245,253,207, 15, 20, 60,194,107, 25, 4,147, + 35, 55,119,107, 59,240, 26, 15,229,175,118,131, 58, 78,254, 48, 6,172,199, 69, 78, 66, 97,106,108,185,148,110,160, 18,196, 83, +185,158, 33, 12,195,100, 22, 2, 54,127,186,234,108,253,114,182, 55, 28,167,222, 14, 2,140, 2,212,194, 69,209, 30,129, 51,113, +210,225,229, 97,136,236,162,198, 36,131,137,134, 44,235,140,161, 21, 0, 20,135,228, 79, 64,193, 36,108,113, 53,129,119,166,138, + 83, 86,223,248,129,189,141, 60, 88, 92,105,241,224,116,126, 80,181,150,182,215, 60,158,127,249,254,197,194,194,135,135,250,243, + 58,191,185,232,126,121, 85,122,212, 14, 91,124, 58,178,152, 50,214, 94,206,200, 73, 56, 43, 20,229,166,112,213, 1, 21,182,240, + 40, 13,197,132,226,161,214,170, 69,232,170, 26,230,179,125,240, 44,124, 36,106, 83, 38, 78, 57, 33,172,215, 99,247, 24, 34, 95, +136, 20,182, 0, 59, 52,184,215,225,149, 79,246,107,205, 26, 94, 27,122, 75,100,189,110, 59,177, 59,226, 98, 13, 87,143,182, 72, +132,196,177, 80,136, 93, 81,144,181,117,212, 60,228,163, 76,188,113,144,116,171,233,206,134, 49,169,145, 40,227,196,223,195,246, + 21, 57, 97,115, 94,187, 69, 6,150,233,254,115, 60,117, 44, 25,130,130,223, 82,208,250,176,181,203,159, 61, 30, 72,180, 67, 72, + 0, 2, 90, 8,189,116, 52,165,198, 12, 40,129,158,220,153, 95,175,172,209, 60,224,180,241,202, 37,246, 76,103,232,142,156, 72, +100,229,251,251,246, 30, 68,133,191, 2,208,117, 45, 61, 77, 68, 81,120,238,189,195, 76, 31,195,244, 33, 32, 32,181,138, 33,160, +129,132,128,184,209,141, 27,215,238, 93,185, 50,241, 47,184,117,161, 59,127,133,137, 59, 19, 55,110, 52,176,209,132,184, 64, 37, + 68,129, 0,173,138,208, 86, 94, 19,250,152, 41,115, 61,223,185, 45,190, 98,194,178,161,183,243,184,247,156,243,189,128,175, 66, +240,105,153,190,230, 87,249,127,242,231,222,125,186,223,233,255, 12,103,244, 63, 99, 25,241, 55, 24,123,122, 38,255, 97,114,240, +123, 19, 32,127,195, 93,229,127,102, 65,221, 69, 74,217, 5, 12,100, 23, 0,144,230,178, 97, 16,142, 31,236,218,180, 37, 34, 36, + 87,113,217,174,249, 50,176,118, 25,114, 27, 67,223,195,236, 82, 57, 94, 50, 91,163, 18, 9,108,253, 38, 3,104,191,244, 86,202, +156,150, 82,230,224, 90, 7,180,132, 94,164,182,136,210,118, 34,229,166,211,110,154, 30, 74,218,176, 29,229, 14,101, 10,223,130, + 13,122,142,181, 1, 57, 56, 50,129,158,107,170,144, 38, 7,175, 86,130,117,219,142,242,169, 20, 54,116,161, 83, 73,229,194,115, + 24,101, 81, 64,167, 1,156,236,129,203, 68,212,193, 1,206, 98,167, 12,118,233,118,152,109,174,148, 10,219, 49,251,151, 74,172, +193, 1,214,169,144, 46,203, 64, 11,215, 60,177,213, 54,171,165,250, 90,113, 55,221,113, 38,146, 90,217,146, 61,232, 4,235,112, +209,198, 32, 26,144,231, 51,198, 89, 27, 86,214,154, 25,191,154,147,175, 29, 24,233,128, 27, 9,136,152,137,146,108,182,236,114, + 30, 51,115,117,227,227,186, 85,231,204,115, 54,128, 22, 17,135, 31, 59,194,114,180, 14,246, 84, 51,182,246, 49,127,164,115,200, +167,242, 60, 70,182,125, 3,130,100, 44,162,167,125,210, 18,108, 21,144,112,220,193,236,240,215, 90,169,208, 87,172, 6, 53,139, +201,152, 9,183, 55, 12,235, 89, 47, 71,103,192,126, 80, 57,227,247, 83, 19, 16,115, 24,113, 15, 24,205,106, 36,119, 46,229,166, +202,213, 82,219,210,231,114,195,235,219,171,180,134,209,161,241, 48,106, 80, 9, 76, 31,246, 18,233,122,171, 94, 24,184,184,181, + 11, 89,255, 84,113, 42,104, 4,253,126,223,245,203,115, 79,231,159,249, 41,255, 75,181, 76, 85, 18,189,208,116, 45,206,102, 7, +168, 79,138,116,124,120,180,135,114,236, 36,162,155,120,247,246,189,249,183, 47,149, 22, 24,187, 75, 89, 57,216,205, 37, 51,153, +180,191,251,227, 59,221,141,217, 75,211,180,157,121,110,106,113,237,221,104,127,113,123,111,199, 79,122,116,177,111,205,220,124, +179,178,184,177,179,225,165,225, 44,198,177,203,140,148,161, 44, 80,125,153, 62,199,118, 75,213, 13,186,107,115, 99,211, 43,165, +213,176, 77, 79, 78, 79,206,203,228, 51, 3,203,165, 15, 51,163,179,239, 75, 31,111, 92,185,246,106,105,129,243,228,108,170,174, +147, 28,201, 77, 55,227,194,217,226,230,238,214,196,200,196,218,246,103, 91,186,172, 52,130, 24,216, 67, 98, 92,236, 32, 92, 79, +230,253,236, 65,171,118, 39,127,225,252,195, 49,203, 19,240,159, 57,110, 88, 17, 67,172,141, 8, 78,114,141, 16,127,199,161, 85, +143,226,102, 8, 69, 73, 11, 65, 52,207,151,202,149, 0, 96,145,113, 25,146, 92, 94, 42, 1,194, 37,103,193,112,120, 46,236, 5, + 65, 52, 16, 28, 29, 12,230,152,137,142,182,133, 49, 2, 3, 26, 4, 37, 20,181,142,173,188, 28,174, 7,231,247,227,118,130,211, +136,225,182, 7,135, 62, 49,222, 91,120,180,248, 98,179, 22, 47, 53, 23, 6,197,216,253,145,135,117,247,211,227,237, 39,175,111, + 61,168, 53,170, 70,199,110,114,107, 66,134,242,153,157,137,183,193, 75,244, 86,131,170, 97,194, 83, 75,199, 58, 66,204, 62, 32, + 21, 2,231,237,196,180, 26, 76, 70,209,177, 97, 28, 90,236, 16,203,227,111,182,110,228, 94,132,137,213,204,176,142,117, 7, 27, +235, 8,166, 90, 81,107,178, 56,185, 92, 94,161,254,192, 32,161,248, 14,252, 19, 43,227,250, 71, 72,210, 80, 45,104, 36, 89, 27, + 20, 35, 21,205,124,149, 25,167,240, 9, 97,198, 40,204,106, 17, 93,195, 90,219,226,116,209, 78,142,138,113, 33,238,148,142, 90, +158,134,240,153,140, 45, 30,233, 11,254,105,172,209,231,125,205, 17,238, 97,243,128,202, 50, 64, 26,138,225, 61,174,109,233,124, + 58,106,128, 60,150,134,172,207, 2,128,100,134, 77, 82, 83,249, 23, 70,205,159, 2,176,117, 45, 59, 77, 69, 81,180,247,158,222, +231,105,123, 11, 72, 17, 69, 3, 24,141,196, 71, 52, 24, 53, 14, 12,145,129, 63,224,192, 24,163, 14,156,250, 1,198,137,254,134, +126, 16, 26, 34, 76,140, 1, 42, 6,149, 71, 74,129,190,238,251,233,222,251, 28,168, 38, 36, 29,116,208,222, 54,247,158,179,206, +218,175,181, 36,127, 79, 36, 83, 62, 5,220, 13,213,192,210, 98, 49,252,128,137,107, 11,239,202,213,179,115,112,132, 42, 67,176, +254,239,117,106, 73, 86,149, 12, 29, 88,179,153,255, 95,187, 85,134, 39, 68, 81, 38,201,220,226,180, 50,173, 56,167,202,170,204, + 93,159, 40,212, 43, 39,241,140,200,124, 81, 5, 29,216, 4,132,117, 17, 4,107,185,140,135,196,184,174,184, 50, 44, 81, 32, 95, +126,228,101,121, 12, 39, 36, 16,204, 32,242,197,124, 28,208, 64, 33,150,143,138, 8, 24,239,104,142, 53,130,198,126, 74,233,237, +147,119,205,157, 77,146, 70, 72,117, 13,110,142, 22,192, 21,128,171,198,129,201,106,192,179,196,108,150,130, 38,167,112, 17, 13, +120,114,199, 59, 56,114,187,189, 32,216,237,186,135, 94,218,118,217,239,206,224, 87,215,219,104,121,187, 61,237, 79,183,239, 70, +128,140, 21,150,115,175, 31,106, 89,105,132,105, 13, 75, 7,120,171, 20, 37, 14, 92, 59, 78, 53,202, 2, 90, 12,237, 12,209,168, + 92, 37, 91,135, 20,211,162,128,119,213,138, 2,196, 31,109, 2,169, 89, 12,229, 77,244,156,146,233,133, 70, 51, 33,166,202, 96, +139, 36,176,147, 35,116, 36,196, 54,113,114,236, 35, 23, 94, 44,174, 38, 89, 9,207, 37, 84,243,151,189, 85,113, 74, 58, 51, 37, + 22, 33,148,167,190, 95,138,188, 60,140,242, 32,204,195, 16, 93, 6,177,136,141,121, 48,108, 24, 5,100,129, 31,178, 85,101,146, + 27,131,110,214, 13,212,126,112,132, 61, 57, 41, 58, 87,160,128, 40,245,212,170,172, 92,208, 48, 1, 68, 55, 21,171,134, 35, 27, +105, 18, 38,177, 99,143, 30, 14,218, 66, 43,207,212, 56,156,194,142, 93, 35,237, 10,224,227,134,165, 89, 85,203,177, 76, 27,159, + 84,154, 62, 91,120,202,117,254,101, 99,249,254,220, 3,192, 68, 56,178,220,176,111, 26, 54,236,127,224, 98,244, 52,179,231, 47, + 94,126, 93, 89, 70,151, 6, 12,151, 82, 64,103, 67,215,191,111,127, 91, 90,251, 76,226,224, 33,236, 77, 32,157, 16,195,249,161, +139,197,207,254,129, 86, 54, 6, 65, 15,158,227, 76, 99, 58,140,195,173,157, 31, 19,213,241,173,214, 22, 68,129, 26,182,168, 40, + 16,254,199,113, 0,104, 98,232, 0, 88, 12,168, 61, 38,151, 20, 54, 61,113, 17, 62, 6, 44,204, 13,220, 38,124,107,100, 98,191, +223,142,243,148, 2,237, 10,236, 19,128,140, 86,119,223, 48, 32,124, 51,239, 94,185,179,190,189, 14,171,235,252,216, 84,221,118, + 14,177,158, 92,132, 73, 0,220,112,241,250,194,230, 94, 51,140,130, 86,103,255,241,237, 69,128,114,244, 42, 49,249,205,233, 27, +240,255, 97,177,113,147,195,102, 6,160,132,243, 9,149,112,242, 20,238,210, 76, 99, 38, 73, 98, 52, 77,100,101,135,143,214,249, +120,152,186,243,103,230,249,189,172,228, 48,138,221,242,227, 61, 89,200, 55, 34,166, 35,112, 83, 72,201,198,210,217,218, 78,175, + 23, 36,178,250,136,188, 2,215, 21, 6,122, 12,231, 54,112,108,130, 28,178,116, 21,239, 69, 25, 21,130,209,126, 64,103,228, 28, +128, 61, 92,165,178, 34,157,148, 40,197,167, 38, 74,111,210,110,240,234,101, 55,232, 48,210, 88, 23, 70,134, 92, 55,154,157,189, +159,109,239,205,251,215, 31, 63,124,154, 50,175, 21, 90,127,201, 95,121,117,233, 97,146,123, 98,196, 69,178, 56,169, 99, 69, 34, + 39, 40, 20,147,204,158,155,237,249, 3,154, 45, 47,232,191, 35, 14,113,179,138,185,117,130,139, 84,228, 50, 4,232,146, 76,161, + 0,112,114,131, 16,148, 26,249, 96, 33, 51,178, 56,197, 78,189, 52,133, 16, 33,175,219,245, 71,183, 22, 86, 55, 87, 21, 85, 54, +203, 30,211,214,194,139,124,242, 26, 34,141, 90, 17, 25, 19,131,231,122, 37, 38, 73, 94,153,193,151, 85,142,226, 95, 44, 20, 89, + 1,217,235,129, 54, 65, 53,188, 72,158, 79,141, 93,240,226,129,160,190, 14,119, 76,102, 26, 6,118, 3, 34,112,219, 85, 44, 10, +210,111,101,216,194, 20,211, 80,149, 42,207, 8,101, 24,140,137, 25, 87,114, 13, 68,133, 68, 64, 42,180,240, 78, 19,180,174,205, +146,191, 2,240,117, 45,171, 77, 68, 97,120,238,153, 75, 50,105, 39,145,118,218,122,161,177, 22, 20,193,141, 11, 65, 5, 5, 23, + 62,130, 46, 93,235,202,157,224,198,167,112,225, 43,184,240, 17, 68,209,162,160, 40, 82,173,218,122, 75,109, 77,155, 78,115,153, +204, 37, 51,103,252,191,115,146, 26, 4,237,170,133, 36,164,201, 57,223,249,207,255,127,151,131,254, 59,147, 39,250,206,147,149, +123,134, 29,194, 38,235,241,140, 75,148,233,135,192,253, 63, 29,155,127, 84,223, 7,245,254,193, 76,120,178,113, 47,143,134, 4, +120, 20,155,236,135,203,127, 53,112,132, 82,108, 60,119, 46, 38,110, 3, 35,161, 42, 87, 64,128, 1, 8,215,101,140, 44,109,163, +130, 80,110,137,241,240, 44, 76,123, 44,205, 28, 12, 99,250, 88,147, 60,166,135, 1,190,249,187, 2,245,133,229,116, 79, 71,156, + 19,216, 73, 88, 6, 4, 28, 50, 80, 53,123,178,250,184, 23,131,245, 69, 43,159,158, 98,106,166, 36,105, 14,206,134,190,166,150, +218,253, 29, 90,255, 41, 34, 49,161,130,131,249,145,234, 34,175, 39,141,110, 93,191,243,242,237,115, 27,223,110,146,177, 1, 99, + 58, 45,144, 35,245, 19, 91,157,205,222,112,248,171, 63,216, 10,187,133,126,168, 57,216,107,165, 89, 51,140,127,118, 19,136,211, + 9,242, 36,165, 36,203,174,161,214, 77,189,110,149,234,102,105,138,126,183, 75,149,146, 50,229,168,150, 81, 24,180,137, 5, 57, +130,251, 13,100,160,176, 49, 17,227, 80,226, 62,104,156, 98, 84, 80,213,111, 91,138,227,208,181, 84,182, 44,197,208, 37, 75, 87, +109, 52,133, 16,233, 87, 49, 21, 75, 40, 74,169,192,230, 89,226,160, 2,241, 99, 50,162,131, 33,102, 73,154,247, 9,198,194, 60, + 77, 97, 93, 41,113,155,123, 75, 83,172,146, 76,101,123,217,144,142, 58,214,122,115,255, 75,208,139,179, 16,151, 17,158, 77,168, +194, 54, 0,221, 67, 25,220, 33, 58,252, 50,223,155,175,187,181,157, 96,155, 21, 66,141, 82, 32,142, 64,161, 98,100, 74,229, 91, + 96, 56,140, 84,213,184,118,249,218,202,234, 83, 97, 67, 22,244,118,184, 43,172, 76, 31,233,202,218, 10,231,115,230, 91,193,102, +146,196, 84,110,159, 58,118,122,183,211,130,201,112,184, 7, 12,201,115, 2,119,215,174,198,233,224, 88,163,113,225,236,165,245, +175,159,104,193, 84,204, 42,109,240, 90,217,131,200, 40,129,115, 17,202, 94, 58, 60,232,145, 89, 60,239,249,251,221, 93, 66, 34, +194, 11,122, 29,186,115,180,186, 45,250,223,151,230, 26, 51,211,254,242,252,210,183,237, 47,186,170, 94, 60,121,225,176, 55,243, +225,199,154,161,169,126,213, 47, 91, 54,157,220,182,110,157, 63,119,117,227,219,106,138, 49,184,126,180,126,100,183,211,134,197, + 99,212, 35, 28,255,184,181,230, 79,207,245,163,238,149, 51,151, 30, 62,123, 68, 7, 18, 21,254, 65,127, 15,121, 50, 81, 72,197, +123,173, 82,219,221,111,123,174,247, 99,167, 73,111, 50, 26,134,203,144,213,108, 10, 80,106,247, 2,145,128, 38, 99,228,227,210, + 62,239,192, 9,253,120,213,174,114, 95,229,125, 77, 83, 93,179, 66,117,101,158, 71,241, 48,176,116,135,245,182, 23, 47,207, 74, +117, 3,219, 72, 16, 88,184,206,125,164,190, 81, 4,128, 98,197,104, 69, 78,184, 92,118,236,247,223,131,189, 56, 85, 4,209,152, +207, 66,117,172, 25,212, 56,112,134,134, 15,148,170,200,197, 65, 6,144,194,211, 36,202,154,230, 89,230,225,233, 41,110,165, 94, +232, 60,160, 88,244,132,233,139,112, 97,152, 57, 31, 32, 67, 92, 43,208,108,169,210, 83, 27,179, 11,175,155, 27,111,218,155,183, +239,222,188,127,239,193,130,121, 82,214,187, 47,210,119, 55, 22,207,211, 13,111,220,190, 80,196, 45,159,137,234, 88, 98, 51,222, +108, 39,196,240, 38,133, 29,154, 80,157, 65,209,226,123, 62, 45, 12,158,222,199,193, 30, 70, 88,156, 63,204,120, 44, 49,227,163, + 54,169, 24,169,207,199, 29,111, 46, 28, 45, 4,215, 99,121, 97,185, 7, 93, 43,108,195,195, 52,124,245,249, 13,148, 56,136,109, +202,115,193, 85,225,216, 67, 69,223,226, 76,227,103,208,148,184, 71, 97, 49,134, 74,203,112,162, 12,220,121,215,169, 38,220,248, +119, 76,163,255,211,155,224,174,227,227, 6, 10, 97,183, 89,161, 27, 9,189, 90,171, 67, 27, 29, 54, 24,140,183,193,194, 36,140, +160,150,130, 48,133,224, 2, 36,119,137,147,189, 11,217,171,212,162, 52,242,189,185, 46,237,130, 63, 19, 86, 89,216,253, 42,210, +200, 50, 7,221,119, 42, 90, 81,230, 99, 36, 64,127,255, 22,128,176,107,233,105, 34,138,194,247,206,171,157,190,134, 78,203, 83, + 80,192,216,196,152,104,162, 4,194,194,133,113,105,220, 24, 92, 24, 55,250, 3,220,185, 55,241, 71, 24,127,145, 49, 46, 36, 68, + 8, 9, 72,132, 8, 5,108, 75,105,101,222, 83,234,119,206,109, 69,163,209, 93,155, 76,102, 50,115,207,227,251,206, 61,247, 59, + 23,245,119,237,143,243, 71,253,191,225,241,255,226,244,127,151,233,213,109, 77,105, 81,157,129,121,130,164,209, 86,192, 5,220, + 40, 61, 76, 76, 60,196,151,245, 99,117, 27, 95,112,208,220,114,113,135,223,118,115,185, 23,108,176, 3,253,235,120, 41, 54, 17, +210, 48,192,251, 1,218,120, 52,145, 89,137,103,224,241,153,132, 78,227, 99, 9,201, 92,242,153, 2,169, 82,112, 61, 68, 45, 5, + 27, 74, 4,211, 33,137, 49,141, 71,187,210,237, 72,102,157,148,121, 6,253,246, 6,194,247,195,197, 71,107,123,171, 36, 66, 68, + 50, 29,241,100,121,186,217, 57,230, 61,122, 16,204, 40,165, 20,156,250,137,159, 36,201,251,245,119,112,194, 4, 64, 4,246, 39, + 88,118,162, 23, 31,119,247, 45,189, 24,247, 66,199,174,152,134,117,226, 31, 81,141, 15, 1, 93,115,253,115, 47, 21,122, 39,238, +125,139,227,134,111, 28,135, 52,202,171, 13, 23,150,125,176,199,156,102,186,102,102,180,144,119, 76,179,100,100,179,125,163, 32, + 65,212, 77,252,176,117,147,140, 50,149, 41, 77,239,145, 81,208,163,142,151,132,222,118, 32, 70,199,141,214,132,188,172, 62,107, +187,139, 66, 22,161, 31, 65, 95,146,128,176, 65, 70, 69,170, 92, 44,212,148, 51,141,156, 5,140, 70, 26, 53, 21, 96,143,188,233, + 20, 13, 55,111,149,108,163, 96, 35, 67,200,172, 38,193, 54, 28,105,126,218,107,237,182, 61, 22, 24,226, 30, 54,118,161, 41,119, +198,201,150, 97,187,139,181,229,157,227,109,124, 90, 56, 42, 34, 84, 46, 67,147,246,166,202, 51, 69,155, 40, 20,214, 2, 48,121, +114,100, 26,128,221, 50,108, 63,246, 90,221, 22, 28,143, 66,191,208,166,170,151, 18, 18,226, 87, 37, 2,189,146,175,248,177,111, +103,237,218,244,245,174,223, 65, 24, 69,254, 88,185,247,184,106, 87,247, 91,251, 20,149, 12,152,120,180, 84, 91, 94,219, 92,221, +220,222, 16, 52,135,192,130,247, 58,116,224, 48, 36, 37, 39,238, 36,198, 13, 65,105,225,150,186, 26, 2, 71, 60,149,218, 99,176, +142,185, 76,254,217,253,167,158,127,214,244,218, 95, 27,123,159,235, 91, 85,103,108,102,252,138,236,165,103,129, 15, 91, 26,119, +198, 14,218,135, 49,139,106,194, 99,183,119,214,241,148, 59,215,110,239, 55, 15,130, 40, 2, 59,130, 61, 20,237,210,132, 59,118, +208, 58, 58,139,190,251, 97,216, 60, 59, 97,189,192,104,126,114,182,213, 33,141, 89, 63,138, 64, 84, 93,119, 98,229,193,147,221, + 47,219,120,169, 81,167, 74,133, 2,194, 95, 54,174,231, 17, 52, 2, 57,108,126,124,142, 10,208,189,116,170, 50,137,167,215, 79, +235,200,109, 72, 36,167,126, 27,248, 14, 15, 10, 88, 42, 7, 38,108, 90,166, 30,250, 55,238, 94, 22,115, 54, 59, 91, 95,168,198, + 43,217, 31,204,239, 25, 0, 64, 5,148, 37,192,185,176,204, 15,235,135, 97,122,174,168,155, 18,129,225,195,110, 36, 25,173,170, + 10, 61,206,214, 92,157,166,250,180,133, 79, 42,141, 66,198,154,169,140, 24, 89,227, 36, 36,173,167, 12,215, 96,126,138, 70,165, + 34,208, 61,187,157,192,223, 53, 80,150,229,218,194, 94,227, 32, 8,252,157,211,198, 70,179,241,242,213,139, 55,175,223, 94, 45, + 44, 8,163,251, 49,217,122, 62,187, 20,245, 61,238,111,254, 25, 66, 5, 55,245,151,184,103, 93, 6,164, 24,195,231, 74,104,231, +136,228,115,194, 56, 5,133,138, 18,178,110,133,217, 21, 30,191, 57,123,171,222,174, 3,171,148, 75,163, 72,171, 60,221, 71, 73, +146,139,193, 81, 81, 18,161, 26,161, 96, 42,206, 27,157, 38, 29,190, 81, 91,147, 82, 47, 23,203, 44,106,107,199,113, 2,202, 78, +144,142,199,107,192,157, 27,221,150,184,232, 95, 87, 82,142,192, 34, 36,126, 16,165,224, 79, 86,156,134,138, 37,177,252,193, 69, + 67, 11,255, 87, 19, 21,232,211, 3,161, 99, 89, 79,188,150,155,119,163, 56, 86,116, 3,136, 91, 14,229,158, 84,159,210,176,183, +142,232,133,161,153, 94, 28, 68, 52,243, 33, 29,212, 39,180, 33, 31,211,196,240, 96,144,186,188, 71, 57, 67, 69, 69, 41,126, 8, +192,216,181,245, 68, 13, 5,225,246,244,156,222,182,203, 46, 44,151, 69, 37, 68, 3, 49, 49, 33,190, 25,121, 48, 60,248,100,252, + 11,250,223,136, 15,198, 63,128,225, 73, 19, 19,226, 3,136, 18,215, 72,184,201,125,113, 47,176,221, 91,219,109,247,212,153,105, +217,213, 4, 18,225,137,228, 36,180, 11,103,230,155,153,111,190,143, 15,112,250, 77,155,165,183,254,168, 42,255,251, 21,223,116, +190, 71, 94, 45,195,230, 62,198,187,104,112, 70, 87, 17,216,194, 13,132,167, 12,250, 94,128, 89,253,159, 78,189,122, 43,253,242, + 58, 45, 17,155, 38, 78, 55,111, 99,139,219, 40,170, 35,147, 92,204, 32,100,119,163, 14, 10, 74,104, 2,194,111,143,245,145,204, +151,136, 84,166,142, 7, 73,131,133, 38,254, 49,246,241,209, 69, 68,145, 57,103,180,209,110,196,212, 60, 99,168,224,233,195, 95, +253,237,167, 55,112, 18,106, 34,114,172,245, 15, 42,251, 40,128,163,178, 17, 43, 95,239,214, 80,124, 45,196,105,137,138, 66, 43, + 82, 99, 80,226,233, 30, 58,225,146, 54, 29,181,201, 93, 31,151,176,202,238, 57, 57,184,226,194, 39,164,223,110,132,250, 68, 0, +218, 56, 45, 28,133, 74,167,223,215, 74, 77,247,232,178,229, 75,236,193,113, 44,147,149, 17,203,204,153, 98, 54,155,157,206,102, +108,219, 54,152, 54, 97, 24,245,160, 7,119,203,138,185, 1, 15,175,160,208, 37,132,236, 86, 68,185,197,147, 80,255,133, 34, 52, + 76,174, 11,124, 0,142, 38, 37, 40,218, 97,219,100, 95, 14,175, 17,177, 30,128,135, 16,185, 95,126,136, 12, 6, 0, 3, 80,149, +123,232, 13, 70, 31, 77, 4,129, 9,225, 36, 60, 97,222,214,167, 28,163,214,240,214, 15,174,160,190,135,242, 96,122,108,102,251, +188, 68, 8, 9,179,220, 97,245, 0,247,143, 66,239,199,241,247, 59, 99,247,234,205,106,140,114,172,240,240,186, 47,253,122,167, +106, 48,195, 68,235,109, 99, 97,230,209,246,201, 79,128,207,164,201,199,175,154,117, 90, 94,243,178, 86, 14,254,201, 33,250,163, +153, 34, 93,206,253,202, 30, 90,170,118,154,149,171,223,134,176, 80,131,215,180,150, 87,151, 31, 20,231,154, 94, 19, 64, 46,106, + 98,197,225,214,209,150,110,152, 36, 49,168,195,177,209, 76, 65, 8,126,117,209,240,195,224,245,243, 87,135,231,135,232, 19,194, +212,141,221, 13,184,213,109,180, 72,230,142,200,118, 17, 7, 64,193, 17,174,108,172,182,218, 46, 36,158,185,226,125, 67,229,133, +194,212,210,194,210,215,210,218, 73,253, 44,240,125,207, 12, 0,192, 62,125,248, 36,232,247, 54,118, 54, 29,203,209,163,248,184, +114,106, 26,118, 98, 63,244,114,241,197,202,231,247,123, 23,135,197,124, 17,110, 31, 36,120, 23,234, 51,166,204, 23,231, 23, 31, + 47,157,125,120, 7,191,174,224,140,230,103,167, 26,103,151,189, 78,203, 49, 51,144,126,202,245, 50, 68,162,114,173,156,119,178, + 58,227,185, 76,214, 11,123, 93,114, 8,131,220, 80,200, 21, 26, 45, 12,232, 92, 97,144,192,142,106, 71,132, 11, 89,199,111, 77, +142,221,157,152,154,254,181,191, 14, 53,102,135, 91,202,142,171, 60, 27, 71,144,222,215, 49,190,107, 56,250, 64, 70, 13, 31,184, +180, 81,183, 64,160,119, 65,235, 91, 21, 42, 51, 93, 99, 33,133,120, 25,167,179, 58, 70, 43,123,170,148,241,223, 23, 31, 96,142, +166, 90, 66, 32,161, 86,104,199, 29,183, 89,247, 0,247,100,112, 98,131,223,130, 37,128, 72, 21, 34,154, 20,166, 63, 62,123,121, +186, 11,159,210,199,210, 26, 3, 12,101, 32,146, 52, 21, 27, 71,160, 74,236,240,108, 11,181, 75, 77,162,236,147,138, 42,210, 14, +200,154, 12, 73,196,220, 50, 76,191, 31, 0, 32, 72, 92, 4,100,202,254, 80,201, 76,152,246,105,211,192,141,132,101, 50,122,235, +127,217,219, 20,156, 67, 73,238,187, 21,153,108,248,167,176, 93, 73, 61,137,224, 48,146, 41, 98, 73, 46, 96,215,163, 62,170,129, +229,112,237,177, 29, 52,137, 25, 41,227,116,208, 74, 38,115, 3,103,137,196,216, 16, 15,224, 20,132, 18, 9,242,106, 18,215, 11, +117,208, 13, 75,236, 61, 83,206,126, 34,235,151, 48,132, 36,192, 62,146,112,149,168,234,200,181,138, 91,213,200, 73,237,154,205, +151, 20, 27,248, 2,110,215,197,153,153, 12,135, 20,201,120,216,209, 86, 83,245, 1, 37, 49,199, 6, 32, 2,175, 82, 67,243,113, +245,143, 0,148, 93, 75,107, 19, 81, 24,157,185,119,102,146, 76,155, 54,141, 77, 95, 80,108,139, 40, 82, 90,172,138,251,130, 20, +220,248, 7,186,244,119, 8,254, 17, 17,212,181, 32,184,234, 66, 16,108,233, 66, 69,177, 47,171,180,208,103,210,164,143,188,230, +145,121,196,239,124,119, 82, 91, 17,209,101,102, 51,147,153,123,207,253, 30,231, 59,199, 56, 39, 83,234,255,134,236,127,167,183, +255, 39,236, 95,130,254,142,138, 36,208, 31,226, 4, 24,252,213,219,127,232,190,254,214,221,189,200,108,212,213,185,153,232,233, +116,252,168,124,244,204, 66, 48,187,152, 23,198, 42, 11,192, 31,183,237,225,189,199,130,118, 78, 34,178, 44,148,138,126,156,182, +178, 80, 41, 96,113,184, 14, 87, 73,156, 84,203,211, 19,119,190,239,173, 83,120, 5,249, 74, 97,112,191, 9,119,113, 2,151,139, +250, 58,165, 2, 77,191,238, 7,173, 82,112,136,168, 71, 4,138, 21,133, 2,166, 38,225,137,141,117, 8, 77, 63, 36, 29, 97,162, + 47,199, 93, 80, 93, 77,168, 9, 61,146,112, 93,141,208, 0,144,248,252,146,229,172,219, 34,202,219,160,171,214, 90, 49,221,128, +194, 67, 39,136, 8,140,138,177,246, 45,172,168,211,156,144,114,106, 48, 71, 15,175,103, 44, 2, 87, 3, 70,239,210,114,193, 80, +179,133,236,205,164,174,103,179, 40,127,107, 24,112, 70,132, 77,184, 3,105, 52, 35,116,227,170,135,240,199, 3, 41, 73, 4,129, +198,171,154,199,234, 88,140, 10,100,178, 22,154,168,166,122, 73,186,214,111,167,122, 76,203,245,227,165,181,163,163,134, 47,101, +218, 54,173, 74,189,184,121, 0,129,114,232, 92, 3, 22, 4, 48,218,115,108,195,110,248,141, 58,124,121, 66, 58,249,232,200,172, +121, 53, 24,234,182,188, 76,151,221,112,170, 20,158,187,129,215, 12, 28,202, 64, 83,194,156,155,153, 91,222, 88,162, 43,202,100, +167, 88, 61,116, 60,247,220, 6,157,163,120, 37, 62,138,192,140, 98,243,186,215,180,173,238,249,217,249, 39, 47, 30, 79, 94,157, + 36,200,238,207, 22, 40,252,167,252, 69,178,188, 76,169, 90, 36,220, 63,166, 45, 4, 89, 58,237,233,194, 51,137,161, 7,127,180, + 48,150, 65,189, 50,116,124,167,175, 43, 63,220, 55,188,185,191,129,213, 99,152,197,179, 82,198, 72, 15,230,134, 6,122,134,214, +119, 87,118,203, 59, 95, 55, 63,140,228, 70, 92,223,177,205,244,221,107, 51,139,171,139,159,183,190,140,246,143,210, 79, 24,225, +166,186, 11, 61, 87,104,253,213,156, 58,125,151,143, 27,159, 44,211, 74,155, 86,172,133,251,229, 67,104,137,211, 83,107, 50,155, +234,126,253,238, 21,189,118,195,150,251,229,131,241,174, 27,219,149,149,151,111,158,223,159,158, 53,112, 26, 5, 61,153,236, 81, +173, 98,154,169,135,247, 30,188, 95, 91,246,188,106,206,238,173,212,202,183, 39,110,237, 86,246, 40,107,161,248,157,130,189,238, + 20,242, 30,201, 72,194, 9, 80,171, 48, 48,196,181,230,182,103,118,109, 47,236,141, 63,186,169, 17,152, 70, 77, 30,171,227, 5, + 46, 56,132, 71,147, 30,134, 79, 90,175,137,106,244,234,233,219,229, 29,184, 38,104, 10,250, 58, 44,112,110, 64, 94,172,215, 42, +174, 30, 44, 45,165,200,103,109,153, 54, 79, 93, 39,196,217, 47,121,240, 22,153, 27,247,242, 89,209,150,125,220, 93,183,156,179, +167, 42, 80, 27, 20,204, 88,145, 17, 71,217,106,223, 55,181,192,210,140, 61,111, 39, 98,145, 28,193, 78, 85, 58,119, 65,245, 56, + 66, 58, 29,105,199,245, 99,218, 48,244, 55, 67, 33,198,243, 99, 63, 74, 91, 62,170,215,176, 1, 11, 49,194,129, 34, 76,172, 84, + 23, 48,222, 9,151, 79,118,147, 4,103,191, 29,199,231, 40,153, 4,221,202,225,136,190, 17,248,123,148,183, 24, 20, 20, 43, 87, +111,110,153,106,152,235, 10,195, 70, 84,199, 19,112,107,245, 23, 71,177,157,148,116,218,137,113, 90, 98,235, 77,121, 0, 20, 92, + 65,240, 53,242,217,126, 90, 54, 54, 70,228,154,106,182,203, 72,124,151, 84,110, 36,212, 88, 12, 51, 65,116,199,107,170,162,116, +164, 92, 2, 65,169, 96,243, 52,142, 98,206,217,248, 29,203, 37, 62,109, 47, 11, 1,136, 11,122, 55,137,161,117, 59, 62,107,158, +112,115, 5,151,126, 10,192,218,181,236, 54, 13, 5,209,107, 95, 59,177,157,135,147, 62,210,160, 6, 53,173, 64, 2, 86, 44, 88, +241, 9, 72,172,248, 1, 62,141, 47, 96,129, 16, 18, 32,182, 8,181,149,162, 46, 10,105,213,210,166, 33,143,230,221, 56,142,227, + 55, 51,115,157, 20, 4, 27, 36,126,192, 78,174,231,158, 57,243, 58,163,176,127,161,237,255, 21,226,127,123, 69,154,163, 34,188, +131, 27,189,101,170, 78,135, 44, 81, 58, 67, 59, 17,186,254,209,223, 32, 62,102,202, 74,224, 44,171,229, 1, 42, 81, 57,242, 87, + 42, 79,199, 37, 90,224,241,160, 34,161,112, 17, 67, 8, 31,134,225,178,194,141,198, 9, 23, 30,139, 21, 33,234,106,218,145, 37, +114, 48, 69,221, 76,169,122,127,122,205,104, 87,197,209, 69, 13,224,102,103,179,218, 28, 52,133,211,164, 49, 66,217, 71, 67, 80, +225,109,147,197,152, 26,253, 68, 59,166, 84,206,151,193, 61, 80, 34,221, 35, 81, 13,137, 90, 41,152,248, 59, 34,181, 20,208,176, + 50,214, 53, 17,197,169,213, 24,192,128,241,189,194,163,230,244, 28, 21, 39, 89,192, 3,120, 5,238,244, 38, 33,245, 72,161,197, + 12, 92, 44,153,167,233,123,206, 69,125, 41,172, 15,199, 58,119,113,146,147, 30,140,140, 70,198, 30, 14,240,111, 16, 25, 0,246, +223, 47, 22,171,249, 92, 1,171, 11, 89, 83,194,220, 11,112,121,148,227,103,193,204,241, 44, 41,158, 99, 23, 81, 64, 89, 34,154, +189,194,235,138,155, 7, 66, 3,184, 23, 7, 55,149, 77,113,224,143,182,227,239,127,239, 15, 45,112,158, 14,151, 82,158,103,207, +252,137,174,230,140, 84,174, 53,186,130,179,214, 84,109,238, 58,129,191, 0,128, 51,180, 2, 88, 60,254, 36,236, 88,225,147,217, + 72, 86, 20,242,197,112, 55,217,110,121,239,122,220, 61, 60, 59,128,203,112,167, 80,113,252,249,199,218,251,185, 55, 23,210, 5, + 3,171, 79,101, 52, 29, 92, 21,237,215,214,109,212, 36,137, 0,151,193,201, 25, 90,182,127,211,129, 79,144,210,244,183,251,111, + 54,138, 91,155,102, 9,133, 56, 66, 63,209, 98,141, 2, 85, 53, 82,146, 2,241,109, 62,179,182,240,236,148,162,128,165, 61,188, +251,160,222,248, 58,153, 13,189,128,186, 57, 89, 56,180, 6,192,178,205, 76,209,114,166,229,181, 74,103,208,128,208,219,118,167, +167,237, 19,143,182,223,192,175,153,185,182,198,213,157,114,181,209,109,112,206, 95, 60,125,254,250,243,187, 98,190,232,186,110, +103,220,110,223,116,101, 17,249, 73,114,107,212, 65, 85,219,200,223,200,172,195, 53, 69,201,217,216,203,166,205,246,168, 11,177, + 66, 33, 83, 0,194,190, 91,170, 86,228,226, 17,138,186,241, 47,103, 7,149,210,206,200, 26, 67, 40,224, 97,213,217,105,244,174, +198,246, 4,252, 49,192, 55,124,253, 31,131, 22,206,187,179, 8, 9, 7,147, 12,213,160, 46,239, 72, 76,191,135,129, 95, 63, 61, + 84, 32,212,195,137,144, 94,115, 24,109,191,250,148,122,249,140,161, 41, 77,152, 66,120,193, 41,179,141, 68, 0,240, 60,195,106, +221,139, 15,231, 71,245,222,208,113,129, 7, 96, 85,131,244,130, 66, 95,192, 67,210,130,181, 26, 60,164,116, 39,110,230,171,108, +228, 23,114, 52,181, 44,192, 85,128, 72, 21, 1, 50, 22, 98,108,162, 77, 13,204, 78, 33,171, 76, 43, 94, 52,179,176,184,162, 25, +243,133, 7, 55, 75,147,211,158, 23,106, 58,238,198,154,176,217,182, 86,217,159,123,102, 58, 31, 68, 46, 46,170,197,192, 55,111, + 26,153,147,206,101,110,189, 60, 31,245,113,136, 86,112,246, 40,194,138, 8,249,157, 39,247, 30,215, 46,143,225,202,109,153,165, +227,214, 55,146,131,163,125, 73, 1, 9,212,203, 44,192,108, 30,241,249, 56, 73,231,138, 33,220,248,182, 29, 3, 66, 55,197, 76, +155,125,183, 23, 45,241,145,203,136, 33, 40, 43,164,101, 33, 2, 24,206,110,100, 41, 94,201,210,222, 50,107, 81,248,165,149, 99, + 73, 71, 31, 29, 23, 60, 48,147,198, 33,231,180,162,217,174, 35, 88, 38,240, 27,176, 64, 63,116, 69,121, 52,150,150,210, 95,171, +161, 78,137,141,173, 49, 91,110, 64,103, 98,246,145, 45,197, 10, 4, 8,178, 68,145,230,143,150,147, 68, 14, 82, 74,134,255,209, + 59, 80,228,156,232, 48,254, 20,128,177, 43,217,109, 34, 8,162, 61,187,103,139, 23,217, 78,162, 36, 10, 72, 8,129,132,132,196, + 1,248, 4,238,124, 2, 23, 14,220,249, 8,126,129, 63, 64,226,130, 16,156,224,136, 34, 20,150, 3, 39,135, 4, 19, 98, 99,103, + 60, 30,207,234,217,122,168,234, 30, 39, 1, 36,196,197, 39,123, 70,158,169,126,253,170,235,213, 43,249, 31, 80,254, 63,205,171, + 56, 39,144,169,206,255,255,252,253,239, 47, 48,187, 65,156, 50,203, 82, 12,136,176,172, 30, 80, 75,184, 18, 86, 44, 47, 8, 49, + 47, 94,149, 89,146, 85,171,147,119, 41,198,153,132,133,120,118, 79, 62, 24,182, 18,121,167,210,170, 29,160,202, 80, 62, 82,169, +178,201,166,238,242,231,194, 93,195,208, 16,101,183,123,105,226,141,121,161, 3,226,213,141, 1,175, 61,220, 39,196, 74,198, 41, +175,112,125,177,109,117, 32, 53,166, 56,208, 78,165,216,222,153,226,123, 22, 11, 69, 82, 32, 24, 21,173,129,149, 22, 84, 45, 10, + 99,111, 68,152,148,150, 77, 74, 1,212, 5, 24,205,184, 29, 3,119, 64,101,169,111, 9, 36, 98,137,181, 72,212,162,211,180, 54, +110, 61,240,156, 66, 72, 85,201,192,245,140,103,140,171, 10,137,248,219,246,205, 9, 22,246,204, 99, 41,131,132, 37, 9,229,180, +102, 93,229,133,183,136,148, 77, 8,178,232, 24,182,247, 12, 88, 7, 19,161, 27, 13,224,224,189,230,218,186, 97,108,153,230,141, +205,158,109,104, 61, 67, 3,188,103,102,141, 66,138,107,157,194,219, 65,143,251,130, 2,222, 14, 70,193,225,137,239, 44,168, 27, + 5,154,108,221,187,121,255,213,254, 51,128, 63, 69, 52,128,196, 65, 48, 76, 23,147,146,157,119,226,248,108, 44, 82,169, 16,116, + 57,214, 33, 50, 73,132,199,149,251,177,111,234,118,156, 44,116,205, 6,186, 58,143, 93, 31,211, 79,148, 87,195, 51,153, 46, 70, + 56,135,192,108,209, 66,107,155,109, 47,246, 32,149, 6, 18, 29, 36, 11,143,117, 45, 54, 84,147,177, 84,172,163, 1, 88, 83,218, +129,159,234,154, 9,160,185, 63,120,127,117,251,250,254,224,131, 44,107,113,226, 75,146,166,235,198, 18,147,179, 42,202,162,182, +221,206,178,165,132,239, 8, 23,108,123,173,163, 53, 44,108,251,132, 48,192,177,121,151,199,179, 99, 21,123, 4,148, 44,207,134, +147,111, 29,187, 57, 15, 92,216,119, 85, 75, 53, 27, 56, 98,194, 82, 27,119,175,221,121,251,233,205,233, 98,210, 54,154,176,129, + 61,127,247,114,230,159, 90,200,187,203,110,179, 7,240,130, 73, 3,202,150,164,148,157,162,148, 5,237,119,250, 7,211,239,134, +170, 57, 97, 88, 85, 62,124, 71, 83, 53, 77,209, 79, 28, 28, 35,197, 44,162, 48, 99, 75,211,100,226,252, 0, 52,199, 33,203,130, +120,186,112, 0, 95,176,195,148,165, 44,112, 65, 55,114, 33, 96, 22,161,135,253,140,192, 36, 98, 15,239,146,151,104,231,193, 3, +152, 20,182,209,247,146,201,237,141, 43,110,184,247,232,241,139,135, 95,142,110, 61,121, 64,200, 6, 17, 61, 98, 68, 68, 21, 9, +236,207, 77, 70,162, 94, 15,246,158,238, 15,131,180,132,204, 67, 87,146, 96, 57,153,251,105,150,107,170, 44,217, 22,138,235,233, +121, 21, 81, 96,243, 60, 1,196,119, 90,205,205,158,149,228,233, 50, 46, 36,148,153,225,241,188,196, 26,228,169, 84, 73, 37,243, +137,226, 94, 43,104, 31, 45,202, 85,121, 50, 26, 82, 42, 65,118,149,164,115, 88,228,166,108,120,105,212,222, 89,131,144, 12,136, +219,111,160,235,125,203,178,187,118,107,232,133,144,168,194,223,159, 69,115, 93, 86, 58,221, 77,147,146, 99,119,140, 74, 25,166, +122,142,210,152, 21, 21,171,145, 59,141,178,100,153,101, 51,223,201,153,231, 23,158,232,210,210, 52,172,221,245,221,143, 71,159, + 69,194,193,189, 62,199,103,124,251,108,248, 27, 93,233, 68,242,105, 56, 21,200, 57, 21,135, 79,100,114, 2, 42,154,146,186,141, +137,252, 9,238,252,247,124,191, 32,194,118,119,203,241, 29, 8,117,248,215,192,253,191,254, 60,132,216,100, 13,116,245,178,139, +243,136,123,253,114, 59, 63,110, 93, 2,123, 98,193,165,155, 12,166,144, 66, 17,126, 48,134, 36, 84,134, 8, 44,151,132, 41,143, +107,144,175,170,218,255,145,105, 47,117, 69, 79,138, 68,168,197, 40, 43,101, 74,125, 71,158, 34,212, 0,249, 75, 0,194,174,101, +183,105, 40,136,222,235,231,181,227, 56,143,166,109, 26, 85, 69, 5, 1, 18,130,138, 5, 72, 72, 72,124, 1, 75, 86, 44,248, 26, + 86,108,217,241, 3,192,154,138, 85, 97, 85, 4,173,128, 66,145, 10, 40,133,190, 8,161, 73,154, 54, 79, 39,118,108, 51, 51,215, + 41, 20, 9,213,221,214,117,125,111, 50,247,204,204,153,115,180, 83,170, 39,167, 93, 58,214,202,163,255, 16, 25, 79,191,228,201, + 35,116, 27, 2,154,116, 1, 12,217,159,200, 46,175, 0, 13,246,254, 78, 23,142, 37,221, 21, 34,191,203,217, 1, 78,166,114, 36, +171,119,242,201,150,145,234,251,221,196,206, 68,246, 78,105,223, 33,203, 78,184,162,116,252,106,216,211,235, 26,170,181,249,171, + 60, 86,160,142,149,164, 63, 34, 45, 77, 98, 42, 25,197,147,153,233,141,189, 13,162,151,122, 62,132,190,113, 35, 4,118,102, 24, +162, 80,182, 55, 28,228,156,137,246,160, 29,199, 35,162, 43,114,105, 55, 19,224, 15,188, 76, 24,112,242, 22,103,164, 85,160, 48, + 97, 51,157,166,137, 40,253, 67,249, 26, 29, 29,186,117,234, 35, 88, 72, 75, 8, 5, 79,212, 13,249,104,132, 52, 71,148,195, 36, +237, 45,185, 28,170,154,228, 40, 40, 15, 47, 27, 80,128,198, 73,162,151, 73,194,176, 92,176, 8,118,139,216,239, 66,141, 52,108, + 81,249, 97,220,136,130, 70,181,254, 57, 8,209,139, 15,126,217,208,109, 91,164,116,221, 21,166,227,216, 89,161,151, 12,187,233, + 5,173,222,112, 24, 4, 52, 26,140,125, 27,149,153,240,200,222,160,249,108,229, 49, 37, 22,112,119,111,224, 7,144, 7, 24,186, +240,144,134,137,196,181,206,160, 13,255,102,198,201, 67,144,133, 60, 1,155, 72,184,174, 81,215, 3,100,132,224,107,232, 15,106, +157,253, 68,199,141,236,188, 33,146, 2,210,159,201,207, 86, 14,126, 64, 18, 45, 76,209,199, 94,119,224,218, 89, 47, 24,216, 34, + 3, 11, 43,139,168,105,145,246,208,152, 23,153,213, 29,239, 16, 14,143,233,236, 12,224,232,218, 81,213, 50,237,130, 59,185, 93, +219,138,208,174, 65,133,227, 51,136,131,115,197,243,111,190,190, 42,230, 75,205, 86, 67, 8,241,242,195,139,188, 83,208,208, 89, + 30, 82, 43,101,123,255, 91,218,116, 0, 33, 10,213,224, 56,139,168,180,122, 45, 13,151, 24, 3,238,252,228,153, 27, 23,174, 47, +174, 46, 46,189, 95,154,206, 20,114,169,172,107,187,181, 86, 13,206, 45,216,134,107, 11, 55, 39, 83,217,229,245,101,216,172,118, +165, 3,119,185,104,238,113,128, 68, 68, 28, 87, 54, 51,150, 3, 47, 5,175, 96, 25, 98,255,104, 31,107, 11, 33,121,103,171,234, +213,179, 11,195,145,255,182,252, 78,227,198,220,196,236,167,221, 47,230, 40,132, 40, 79, 67,244, 62, 86,232,232, 67,142,148,198, +104,132,180, 96, 18, 86, 68,103, 74, 22,102,108, 55, 73,134, 20, 20,192,130,239, 65,218,114, 11, 86,198, 25,109,173,180,118,246, +116,245,193,195,231,119,158,190,190,125,255,174,184,119,139,177, 18,211, 6, 40, 58,198,122,193,163,213,229, 39,107,112,168, 26, + 66,247,194,176, 94,107,175,174,111,247, 24,155,102, 44,199,152,113,197,140, 35,233,224,153,140,189, 2,218,176, 53,237, 82,105, +194, 18,106,187,143,190, 19, 38, 26,161,210,196, 18, 75,132,122,169, 20, 2,112, 0, 97, 59, 66, 54,206,225, 22,115, 68, 9,180, +194,170,135, 85,204,106, 24,207, 58,110,195, 59, 42,206, 95,102,216,145,237,230,140, 92, 61,168,151,212,139, 26,227, 62,169, 70, +146,150, 22,203,186,249,230,238,102,237,176, 30, 40,156,228, 4,162,144,230,105, 81,220,131,241,157,198, 46, 68,117,134,254, 77, +113, 62,157,135,143, 7,100, 93,229,159,101,216,169,181,239, 31, 17,185,147,104, 76,204,146,146,251,184,120,155, 4,156, 98,174, + 4,123,135, 85,120, 8, 6,227,112, 56,229, 78,213,186, 13, 41, 78, 64, 4,124, 73, 94,137,146,248,158,232,238, 32,195,146, 39, +193, 29,223,184,210,172,132, 18, 47, 51,249, 5, 68,160, 73,186, 5, 18, 83, 41,210,218, 19, 86,105,174, 48,183, 87,223,213, 52, + 13,114, 68,128,249,136, 3,232,207,242,228,249, 81, 60,150,175,180, 13,225,247,250,156, 39, 41,254, 49,108, 63, 86,167,116, 83, + 89,175,229,177, 19,140, 24,229, 31, 58,162,188,126, 11,192,216,181,236, 54, 13, 68,209, 25,143,199, 78,154, 58,233, 19, 20,218, +144, 74, 45,229, 81, 85,237, 10,129, 0,169, 95,128,216, 33, 54,108,249, 5, 88,118,193, 15,192,146, 31, 96,129,128,111, 64,106, + 43,168, 88, 32, 21, 9, 40, 15,145, 74, 33, 46,109, 30,173,155,216,177,199,195,189,215, 78,177,160, 18, 72, 93, 85,145, 44,207, + 36,103,238,185,115,238, 57, 39,232,223,255, 31,220,209, 29, 76, 71, 39, 54,106,248,191, 48,157,167, 75,128, 31, 68,157, 73, 28, +102,196,236,252,239,143, 27,127,130, 59, 44, 98,156, 56,201,240,212,145, 39, 41, 56,168, 5,207,211, 11, 7,134,102, 96, 17,161, +124, 30,240, 37,162, 40, 18,157,177,160,167,242,132,226,198, 81,162,163,105,220, 57, 25, 35,202,154,212, 15, 46,119,233, 78, 20, + 79, 69, 33, 44, 43, 23,163, 65, 71, 72, 55,177,241,177,103, 4,101, 19,198,128, 68, 8,180, 88,197, 32,255,128,218,187,165, 1, +150, 2, 79,170, 32,199, 34,137,186,113,141, 82, 38,203, 66, 9,189, 13,220, 64,135, 82, 71, 22, 14,174,114, 27, 77, 33,149,169, +148, 9,224,111, 25, 54,105,192,173,156, 9,149,149, 44,228,173,177,146, 44,149,196,136, 35, 70, 75,210, 25,198,241, 81,131, 9, + 96,205, 0,100, 74, 9,108, 99, 50, 82,111,226, 96,138,193,129,103,162, 80,153,212,201, 40,123,227, 36,207,199,188, 0,120, 62, + 84,234,240,103, 73,124, 0, 60, 7, 3,153, 76, 1,244,190,199, 84, 39,236,187, 61,239,251, 65,211,243, 2,203,180,240, 68, 73, +162,153,201,146, 36,201,106, 67, 23, 26,236,242,203, 62, 69, 63, 99, 79, 89,216,135, 93, 28,184, 80,116,255, 5,155,208, 11,188, +235, 23, 87, 72,150,142,101,145, 64,229,180, 72,157, 84,181,158,112, 38,160,254,197,233, 92,153, 35,208, 86,211, 99, 85, 88,189, +168,143,198,182, 64,200,224, 29, 96,133, 58, 94,167, 60, 94,118, 91, 63, 48, 27, 10,117,251,137,134, 53, 94,172, 46,254,108,187, +176,224, 11,149,165,253,195,253,179,167,171,219,245,143,176, 18, 65,216,167, 43,113, 14,108,221, 50,109,248,105,213,155,117,178, +163, 9,225,119, 37, 12,121,121,254, 42,112,240, 3,191, 35,128, 59, 42, 52, 4, 86,180,155,137, 89,138,162, 88, 18,192, 98, 74, +136,228,206,208,240,204,228,204,250,135, 13, 76,131,145,242,200,239,194,209, 50, 82,112,206,149,103, 67, 21,217,166,220,120,191, +190,227,214,150,231,150,191,184,223,128,107,195,139,163,241, 55,154,208,225, 64,163,231,123,149,241,169, 70,123, 23,216, 3,188, + 81,222, 26, 18, 92, 0, 51, 0, 84,130,157,168,237,214, 46, 76,157,175,237,238, 68, 90,181,188,246,124,121,174,209,118,251,176, + 2, 49, 54,151,224,203, 3, 95, 17, 56,120,170,147,232, 98,198, 82, 23,218, 24, 14,152, 56,142,132,105, 54,189, 38,148, 2,151, +206, 46, 0, 7,194, 28, 14, 88,193,222,193,232, 80,253,117,195,133, 98,248, 86, 55,114,246,186,107, 47, 55, 27,171,207,246,222, +108, 85,194,160,245,252, 29,123,250,105,237,213,118,207,198,166,121,136,169,170,186,218,236,222,223,239,220, 97,236, 38, 99,155, +140,189,149,198,153,130,237, 19,110, 41, 96,111, 64, 65,134,243, 75,149, 73,101,192,142,244,165,201, 29,211,204, 73, 19,131, 4, +200, 26,145, 66,123, 83, 85, 50, 39,192, 4,196,183, 76,163,148,183,109,102,213,246, 10, 17,154,214,152, 73, 12,131, 17, 25,143, +182, 94,220, 94,185,123, 99,246,202,234,147,213,123, 83, 15, 30,187, 15,171,165,202,181,226,169, 54,154, 9,243,126,136,166, 9, + 29,188,238, 22,126,164,198,139,163, 64,170, 90,168, 79,139,147,104,176,136, 74,117,156,231,128,237,212,209,244, 68,229,115,227, + 43,145,155, 36,169,142,236, 74, 98,157, 65,187, 56, 11, 37,240, 47,224, 76,201,148,106,102,104, 63, 62, 12,142, 88,106, 66,150, + 12, 9,252,158,192,209, 3, 71,118, 61,232,244,232, 52, 89,130,167, 82, 73, 62, 48,151, 78,141,216,142,197,135,124, 32, 42,229, + 93, 31,205, 62,139,133,162, 31,250,168,132, 73, 29,219,146,202, 51, 5,247, 68,164, 31,132, 1,229,235,241, 76,241,206,142,179, +183, 96,247, 61,106,220,211,160,142, 97,100, 71,127,136, 31,100,193,246,151, 0,156, 93,203,110, 18, 81, 24, 62,115,230, 74,153, + 97, 24, 64,104,135,166,169, 81, 32, 81,163,110,140,233, 19,212,133, 91, 23,190,129, 91,223,196,141, 91,215,125,131, 38,198,120, + 73,186, 41, 26, 99,211, 88,169,181,169,177, 26, 40, 45, 48,101, 6,152, 11, 51,227,255, 31,134, 58, 38,198, 24, 55,132,144,201, +153,195, 92,190,255,254,125,194,255,185,237,127,193,241,180,157,144,121, 37, 8, 93,242,123,118, 37, 78, 13,169,254,203, 73,211, +115,173,243, 30,121,142,137, 4,113, 85, 99,229,184,247,149, 75, 77,194,170,138, 6,136, 10, 56,130,163,198,104, 51,102,236,158, +241,196,159, 36, 8, 77,200,130,148,245, 81, 97, 61,188,232,198, 97,108, 65,104, 99, 67,166,224,133,113,192,188,235,104, 86,193, + 75,214,199,230, 36,234,122, 35,112,168,114,188,168,102,114,222,240, 12,204, 20, 68,136, 57, 37,111,251,231,179, 84, 95, 70, 82, + 49,188, 66, 74, 72,212, 66,129, 47, 3, 33,140, 57,137,209, 52, 98,160,205, 24,229, 89,242, 4,214, 6,236,103,119, 83,224,177, + 9,157, 98, 95, 29,135, 61, 4,204,124,103,100, 65,201, 8,140,175, 5, 98, 58, 8,135, 99, 81, 38, 34,141, 70, 99, 8,204, 99, + 38,212, 78, 21, 9,140, 0,110, 13, 0, 84,226, 25,141,234,148, 61,159, 18, 35,254,197,110, 7,194,104,235,241, 25, 9,144,218, + 23,213,142,100, 25,128, 3,183,225,186, 28,242,148,177, 74,181, 8,182, 5,137,116, 97, 39, 52,192,148, 25, 75, 53, 78,153,180, + 89,128,188, 22, 76,251, 2,251, 17,100, 17,123,194, 84, 37,159,149, 53,128,170,165,194, 42,152,207,195,118, 11,254,251,120, 98, +199,172,194,193, 18, 35,232, 67,108,125,124, 13,222,171,132,212,151,148,205, 53,132,112, 79,192, 67,247, 66,175,213,254, 84, 82, + 75, 0,121,125,231, 52, 98,212,112,125,231, 76,224, 4,107, 98, 41,130, 2,144,183, 84, 92, 6,212,171,150,140,214,247,125,180, + 86,162, 20,163,210, 33, 4,167, 16, 61,216,111, 15,154, 0,247,119,106,107, 61,231,212, 80,141, 78,191, 13, 86, 11, 34, 54,127, +108,129, 93, 1,152, 40,231, 42,221,225, 9, 28,169,102, 22, 38,174, 71, 5, 33, 12,130,156,174,189,218,121, 14, 23, 1,252,160, +206,176, 35, 38, 51, 57, 92, 70, 80, 77, 99, 17,222,195,129,211, 47, 27,166, 66,197, 51,187, 3, 86,204, 26,157, 55, 15,154,107, +141,187,123, 71,187, 62, 90, 93,126,125,237,222,198,139, 13, 56, 69,163, 90,215,113, 76,105,112,213,172, 89,174, 93,214, 75, 39, +131, 46,118, 52,147,248,198,229,155,246,200, 90, 52, 22,247,142,247,205,146, 9, 24,228, 79,125, 26,199,112, 41, 86, 43, 43, 3, +135, 86,244, 74, 81, 43,110,127,222,126,185,251, 6,158,213,146, 90, 4, 59,123,120,114, 8,206, 93, 89, 55, 40, 21,193, 20,253, +176,218,174,235, 13,163, 33, 82, 25, 97, 34, 20,236,191, 82, 80, 10, 29,171, 3, 23,211,118,157,124, 86,175,155,141,247, 95,222, +229, 53, 61, 8, 57,216, 73,173,160,117, 2, 11,165, 35,192, 89, 22,229,251, 88,134, 33,143, 9,121,178,185,179,190,213,122,116, +171,113,123,169,110, 46, 23,142,109, 7, 27, 69, 49, 20, 36,155, 46, 74,216,131,243,254,140,144,167,112,116,123,112, 77,207, 66, + 28,232, 79,177,102,120,221, 44,150,245,204,216,243, 36,158, 24,154,172,200, 60, 35, 46, 66,232, 15, 67, 14, 25,131,163,153, 62, + 68,146,199,198,199,155, 82, 69, 16, 11,217, 5, 23, 67, 94,228, 41,131, 79, 30,139,188,177, 72, 68,155, 76, 30,214, 30,144, 15, +248,134, 25, 66, 62,240,134, 5,108,188,167, 16,206,214,171, 87, 28,111,114,212,253, 6, 43,246,198,216,150,222,117,122,158, 15, +152, 15, 30, 4, 86,237,125, 4,249, 41, 83,122,159,194, 6, 74,218, 37,148, 84, 76, 36, 52, 56, 38, 46, 25,207,213, 71,211,244, +136,220,197, 24,254, 92, 32, 36, 1,165, 48,249,149,166,107,123, 81,204,165,122, 59, 46,126,227,230,203, 68,115,193,187,136,141, + 95,161,110, 80,244, 75,137, 40,205,186, 53,203,170,179, 70, 57, 86,172,238, 15,251, 6, 22,120,108,166, 19, 18,206,247, 57,171, + 19, 36,242, 79, 21,195,108,247,219,113,146,145,103,153,247, 4,220,227,164, 21, 50,169, 32,204,170,120,201, 40,236, 31, 49,248, +167, 0,172, 93, 77, 79, 19, 81, 20,157,143,190, 55,211,153,214,177,208, 22, 5, 41, 4, 82,196,104, 2,129,144, 24, 19, 87, 70, +253, 7,198,196,196,196,149,127,193,159,225,143,112,173, 11, 54,178, 80, 89,104, 72, 76,100, 99,162, 11, 62,228,187, 20, 90,106, +135,150,153, 55, 31,125,222,251,222, 76, 69,116,105,216, 16,210,148, 76,103,122,238,185,247,157,115, 46,230, 19,192,203,187, 74, +168,252, 87,112,151,191, 83,141,202,233,202,133,204,247,172,110,177,216,227,105,220,124,150,216,170, 28, 84,253,181,233,233, 2, +178,203,195,101,113,252,159, 6,150, 38, 69,242,124, 46,154, 44,205,170,218, 15, 43, 78,111,116, 34, 80, 74,248,251,239,185, 27, +129, 62, 18,249, 59, 66, 57,128,176, 77,224,105,238, 72, 27, 72,186, 13, 12, 99,200,213,254,217, 62,198, 5,235, 98,156,160,150, +157,145, 67,119,215, 34, 22,208, 76,220,235,134,211, 18,148, 83, 75, 43, 55,224,101,104, 67,139, 45, 1, 59, 35, 8,180,154,122, +171,133,117, 61, 70, 5,186, 73, 0,223, 81, 58,172,103,196, 34,111,145, 39,143, 98, 11,170, 57,121,224,236,130, 40,104, 60, 18, +145,141, 98, 63,106, 28, 74, 11, 7,222,124,205,243,196,195, 18, 69, 1, 50,131, 16,154,120,232,140,113,239, 48,222, 2,148,154, +200, 62, 16,222, 56,128,207, 93, 88, 62, 40, 69,130, 15,239, 21,196, 50,230, 25, 56,172, 66,116, 5,254,108, 26,248,202, 24, 5, +242, 28,190,186,103,141,232, 50,201,249, 44, 30,206, 85,130,216,219, 63,217, 27, 47, 87,143, 79,234,112,191, 20,164, 81,232,175, +179,241,124, 12, 93,223, 94,136, 19, 42,162, 27, 1,243, 68, 55,148, 52, 53,154, 80, 13,104, 41, 59, 6,104, 59,106,215,205,140, + 97, 80,203, 15, 58,112, 69, 51,227,179,208, 50, 3, 25,207,101,109, 52, 40,232,228, 20, 64,153,230, 58, 80, 77, 85,101,200, 41, +181,187, 46,192,186, 32,212,114, 35, 13, 55,168, 49,152,131,175,247, 62, 58,253,120, 60, 60, 48,122,228, 30,202,236, 56,248, 16, +133, 74, 74, 6, 3,200,173, 95,248,115,111,246,254,226,202, 27,138, 18,113, 83,196,134,224, 36, 27, 39, 13, 66,214, 38, 69, 11, +114, 33, 1,180, 61,151,204, 28,148,215,130,229,196, 17,208,244, 16, 40,179, 69, 12,139,152, 64,170, 15,154, 7, 4, 27, 34,232, +168, 52,145, 12,129,243, 3,185, 99,104,172, 60,214,112,155, 11, 83,243,145,166, 44,127,121, 15, 80, 56, 87, 93, 24, 31, 26,125, +187,186, 84,200, 15, 16,149,172,215,214,224, 18,138, 78,217,245, 93,198,124, 17,171,168, 86, 74,149,189, 6,238,229,185, 61, 61, +247,227,112,187,121,218,130, 43,128, 6, 2, 16, 60,159,205,139,131, 16,255,198,181,169,175,219,223, 71,160, 2,133, 94,253,231, +241, 88,185, 2, 87,182, 81, 91,179, 13, 43,236, 49, 61, 17,127,101, 30, 79, 15, 46, 31,124,250,188,223,168, 49,182,227,219,222, +153, 95, 83, 24, 78,111,252,232, 78,177,240,234,193,147,182, 79, 70,138, 91,223,154, 45, 0,248, 46,244, 57, 81,252,122,203,253, +216,246,163, 12,247,153,207,206,186, 81,200,158, 79, 94, 1,170, 97, 81, 58, 95, 41,234, 20, 19, 53, 10, 54,205,211,140,180,126, +136,252, 83,120,222,212,144, 67,185,228, 30, 6,171,138, 19,168,196,242,170, 3,184,151,157,188,161,232,123,205, 86,173,126,125, +151, 69, 20,115, 80, 80, 6, 48, 97,142, 62, 92,122,193,223,241,157,197,230,228,203,153, 15,115, 43,119, 87, 43, 79,111, 62,122, + 54,113,107,179,211, 40,230,156,136, 71,173,142,171, 96,226,147, 76, 41, 64,251,106,201, 41,175,215,183,241,223,193,157,192, 84, +125,180,149, 0,108, 6, 40, 74,102, 92,244, 25,184,193, 29,207, 84,133,253, 73, 74, 86,160, 14,241, 62,184, 75, 44,137, 47, 88, +124,184,194,251, 67,156,223, 88,222, 75, 44, 81,106, 42, 85,236,201,188, 74,193,180,120,114,218,140,165, 1, 74,178,199,188,234, +213,234, 70,125, 83, 76,117,228,129, 5, 23,234,101,180,106,155,196,132,138, 94,202,151,128,116,179,208, 63,111,224,225,231,102, + 50, 60, 89,155, 23, 75,145,102, 47, 13, 95, 17,219, 22,122,201,226,106,245, 15, 24,149,157,147,104,152,164,182,254, 31, 84,249, +151, 0,164, 93, 57,111, 19, 65, 20,246,158,222,245,181,235, 43, 81,226, 77, 16, 34,137,130, 76, 16, 2, 33, 10, 14, 41, 68, 40, + 69,126, 6, 18, 37, 5, 29, 93,254, 0, 53, 61, 53, 77,196,143,160, 0, 41, 21, 5,138, 40,156,144, 56,177, 19, 31,123,207, 94, +195,123, 51,190,160, 69, 74,225, 40,182,179,246,204,123,243,222,219,239,152,207,103,254, 51,185,255, 51, 85,225,169,121, 65,129, + 96,113,240, 66, 19, 58, 9, 45,254,123,130,124,179,120, 17,228, 78,103, 32,221, 28, 71,143,114,214, 29,122, 95, 64,132, 48, 80, +168,192, 38, 60, 18,215,181, 43,107, 70,194, 22,101,162, 36,182,104,246,202, 42,211,122,121,201,135,238,111,198,238,157, 50, 40, +224,161,161,155,252, 79,252, 60, 47,105,134, 59, 33,137,113,197, 13, 81,145,144,123,197,185,191,240,154,251,183, 31,186,129,157, + 87, 10,240,127, 96,195,122,145,131,124, 57, 52,202,192,197,195,210, 69,228,102, 45, 84, 44, 42, 54,196, 76,148, 33,110,155, 50, +137, 84, 28, 65, 74, 72,239,150,100, 93, 83,138,144, 45,100,153, 73,122, 72, 8,146, 71, 23, 3,124, 2,108,147, 40,140,155, 70, +165,144, 87,237,177,195, 60,186,181, 12,226, 15,239,105, 73,104,245,199,164,124, 89,171, 40,235,178, 84, 53,243,134, 78, 21, 49, + 61,120,249,226,253,187,183,175,158, 63,237,245,174,186,253,161,130,232, 17,129, 77, 52, 81,174, 6, 81,231,248,113, 16, 13,206, +146, 45, 69,223, 8, 9,107,118,156, 10,201,248, 3,109, 53,223,117,240,100, 18,103, 94, 72,137, 7,193,169,196, 41,185,113,110, +108,207,134, 0,210,164, 66,223,238,113, 18,177,174,160,191,185, 19,121, 36,130,102, 58,229,202, 84,170,156,199, 79, 65,163,108, + 46,129,132,229, 6,155, 9, 65,245,167, 32,102, 17, 14, 84, 12, 75, 56, 27, 74,176,250,221,225,197,155,253,215,223, 78,190,167, + 89, 18,165,164, 89, 94, 38, 49,146,197,224, 37, 17, 9,225,170, 33,221,223, 89,217, 26, 56,125,202,242, 59,230,213,156, 52,242, + 7, 57, 38,202,192,237, 35, 32, 6,247, 30,236,255, 30,156,110,174,110,247, 70, 23, 21,189, 10,139,162, 41, 58,170, 62, 49,184, + 95, 81, 45,186,161, 47, 73,114, 16,249,204,197, 87, 96,162, 59,105,156, 37, 42, 74,142, 32, 75, 19, 90, 49, 56, 72, 32, 81, 42, +178,226,248, 99,145,121,154,228, 85,117,236, 13, 60,226, 59,190, 61,112, 7,176,186, 59,235,109,200,254,110,232,178,225, 43,133, + 86,213,106, 88,149, 2,108, 30, 15, 26,142,179,235,243,206,101,199,170,175,233,186,214,179,175,143,127, 29,195,153, 7,223,117, + 89,171, 60,123,188,103,214,150, 79, 78,127,194,161,213, 94,107,111,180, 54, 86,107,173,122,165, 10, 95,230, 82,181, 1,155,237, +114,216,143,208,155,194,132,183, 10, 98, 2,125, 9,218, 70, 38, 81,119,116, 5,165,235,208, 27,187,136, 35,160, 67,111, 52, 68, +187, 9,116, 22,131,134, 65,100, 55,239, 52,170,236,110,229,142, 47,207,207,157,192,143,227,237,194,138,101,154, 77, 77, 43,201, + 2,156, 10,138,168,239,174,183, 51, 26, 12,179,158, 29,199,154, 36, 35,171, 29,193, 70,162, 33,235, 77,104, 12, 73,232, 18, 40, +235,179,157,122,233, 81,171,121,183,101,150, 11,162,101,170, 86,181, 80, 43,169, 69, 93, 68,225, 57, 89, 96,142,102, 60, 92, 69, + 70, 68,231, 82,218, 56,126,134,149, 80, 5,185, 86,212,214,234,198,143, 78,223,207, 72, 62,173,117, 67,166,112,139,117,153,236, + 6,228,203,217,215,195,143,135,159, 62, 28,117, 59,246,102,173,117, 52,250,124, 96, 61,145,133, 36, 64, 67,187, 0,253, 78, 81, +188, 23, 47,140,100, 81,156,166, 97, 26, 67, 95,130, 6,198, 80,194,208, 36, 68,119,155,200,168,212,237,192,137, 81,230,146, 50, + 50, 36,133,163,167,168,161, 95, 29, 44,200,189, 91,109,216,174, 24,226,188,178,159,227, 13, 22,105, 52,184, 89,115,217, 76, 84, +224,175,219,148,171,230,138,141, 62,230,116,170,238, 59,215, 75,160, 83, 60, 81,134, 90, 79,177,166,228, 29,226,135, 17, 97, 57, + 41,177,106,107, 46,154, 12,179,225, 61,194, 0,112,159,115, 52,167, 42,169,141,114,195, 97,246,232,188,182,159,102,118, 58,129, + 68,102,147,129, 61, 67,113,166, 76, 59, 33,157, 92, 30,115,201,204, 49, 61,126, 97,194,233,228,152,250,153, 24,162, 56, 83,184, +159,165,190, 63, 2,176,118,229,188, 77, 4, 81,120,103,111,239,122, 19, 7, 39, 36, 1, 39, 28, 49, 34, 4, 4, 40, 68, 52, 32, +132, 56,132,104,248, 7, 20, 8, 33, 16, 72, 8, 9,209,209, 82,210,240, 31,160,225, 39,208, 82,208, 16, 33, 8, 33, 66, 28,134, +156,142,157,100,109,239,225,217,147,247,158,119,131, 37, 90, 58, 75,182,155,167,153,119,205,119,252,159,252,254,111,174,151,250, +184,166, 98, 46,201,184,107, 6,194, 50,134, 51,235, 51,228,251,235,204,151,111, 91, 88,254, 95,113,247,171,252,217,154, 54,126, +208, 28,171, 38,180,192, 34,121, 48, 66, 52,164,191,236,178,254,122,131,193,163, 34,223,103, 20, 78, 96, 81, 75, 47,118,163,128, +248,105, 9,100, 16,218,224, 39, 93,244, 47, 79,123, 62,144, 89, 45,207, 73,111, 9, 66, 98,227,245,157, 21,184,216, 94,228,170, +178,234,161,141, 75, 76,156, 5,114, 31, 16, 51,133, 78,200, 56,149,189,195,204, 36, 10,174, 44, 73, 44,195, 81, 66,110, 45, 26, +138, 85,192,173, 55,130, 84,224, 94,198, 41,218, 39,163, 73, 11,214,108, 20,219, 19, 25, 52,231, 55,174, 95,126,253,234,229,237, + 59,247,102,170,213,133,133, 47, 27, 13, 84, 23,194,165,138,158, 64,139, 4, 55,154,115, 17,250, 69, 93,149, 12, 67,230, 60,118, +156,248,238,173,187, 15, 31, 60,217,217,233,140,142,142, 65,112, 23,151,190,232,106,106, 65, 9,209, 4,179,160,224, 70, 31,209, + 14, 2, 15, 66, 40, 48, 94, 23,106, 14, 27, 30, 42,186,142,139, 75,156, 84, 10,241,241, 24, 29,195,131, 0,181,254, 96,152, 38, +137, 13, 65,137, 52, 67,210,133, 72,212, 36,131,220, 54,252, 54, 26, 88,227,150, 70,151, 45,183,235,192,169,106,121, 8, 24, 32, + 50, 48, 27,177,198, 28,222, 9,168,132,147, 21, 51, 78, 35,134,106,170,170,142,212, 33, 92,248, 6,136, 68, 66,100,186,152,129, +138,133, 88, 97,242,199,218,167, 48,226,197,194,192,177,202,113,248,205,118,167,105,123, 54, 15, 61,232,211,121,232, 66,134, 9, +200,218,120,192,176,186,129, 7,231,221, 84, 12, 93, 49, 6,116,139,204,181,125, 72,160,144,127,235,237,122,199,109,109,181, 55, +225,228, 71,168,132,152, 64, 37,214, 20,210,154, 78, 16, 13, 69, 74,197,193,197,147, 87, 17,209,143,122,110,232, 43,104,168, 69, + 75,179,124, 68,145, 71, 72,170, 23,210,115, 51, 23,246, 20, 75, 60, 10,144,186,203,216,190,161,125,174,239, 13,154,131,103,171, +103,198, 75, 99,103,143,204,253,106, 46,151,140,226,150,107,155,186, 57, 53,122,184,217,217,158, 24,222,223,232, 52,206,207, 94, + 90,250,189, 40,202, 82,130, 68,100,180,104,215,100,213,135, 28, 69,124,150,117,123,253,107,109,113,101,189, 6, 13, 53, 92,220, +211,135, 79,205,255,248,240, 99,227,251,207,122,205,246, 90,155, 45,168, 94,108,203,217,166,214,145,205, 86,103, 87,183,215,166, + 39,142,114, 30,104, 16, 61,212, 70, 71, 36,173,144, 43,211,238,202,154, 84,202, 7,123,111,182,186,192,174,157, 40,124, 88,221, +172,251,190, 29,112, 83, 50,161,154,195,240,233, 71, 81,155,119,151, 29,247,242,132,176,212,249,246,126,109,227, 77,109, 25,254, + 48,102, 89,178,152,118, 99,246,205,230, 77,238,173,180, 59,237,144,151, 69,241,254, 92,117,122,220,152, 44,171,147,123, 10,229, + 1, 13, 2, 13,163, 74,230,239,218,243, 21,233, 77,195,248, 1,149, 12, 20, 89,130,163,104,106,178,165, 40,123, 75,133,233, 67, + 35,109,135,127, 94,109, 98,175, 31, 21,215,124,104,222,147,209,193,113, 57, 17, 23,154,203,243,141,157,167,207, 30, 63,127,244, + 98,206,188,178, 37,215,222,186,239,110, 78, 93,152,218, 95, 89,105,108, 36,132, 97, 39,125, 13, 34, 92, 39,232, 82, 13, 9, 49, + 76, 19,136,179, 19,184,168,193, 23, 7, 35,165,241,134,221,132,153, 6, 47, 36, 97,101, 98,114, 70,197, 73,139, 4, 50,235, 8, + 66, 55,195, 56,206,152,186,153,237, 40,235,151, 79,167,222, 51, 53, 20, 20,152,132,212, 48,100, 12, 33, 62, 59,207,239, 14,119, +224, 92, 77, 14, 79,182,225,204, 16,148,131, 12, 64,147,252,209, 46,155, 32,161, 98, 65, 87,142,198,191, 34, 57,208, 68,136,160, +135,118, 65,204, 68, 13,122,155, 4,145, 86, 49, 36,204, 23,186, 73,154,241,172,242,204,222,155, 4, 24,203, 31,180, 73, 19, 8, + 59,178, 74,249,128,237,182, 72,210, 61,238, 57,234,244, 18, 97,178, 11, 30, 79,201, 48, 61, 35,240,255,171, 63,144,254, 17,128, +179,107,105,109, 34,138,194, 51,147,233,157,201, 76, 94,109,146, 54,125, 88,165, 93,136, 72, 17, 81,172,182, 32,214, 87,233, 86, + 55, 21, 11, 42,248, 3,196,141,173, 20,164, 88, 65,173,184,241, 55,184, 23,172, 40, 8, 22,183, 69, 20,165,166, 47,219,180,177, +175,244, 97,147,180,201,188, 39,158,115,239,164, 15,209,141,155, 16,232, 36,157,204,204, 61,247, 59,231, 59,231,251,254, 51,190, +243,255,112,222, 19,246, 68,246,189,213,168,191, 98,125, 79,174,125,119, 86,122,247,175,229,109, 64,224,203, 33, 30,105,122,142, +217,210, 8,130, 55,161,193,136, 9,135, 77,253,178, 18, 6, 5, 49,136,158,105, 95,132, 83,254, 79, 2,101, 77,247,231, 24,216, + 40,105,236,156, 69, 89,139,152,139, 5,226, 68,148,117, 68,112, 59, 6, 34,184,133,198, 67, 53, 69,128,126,148, 72, 2,100,135, +160, 28,179, 45,119, 87,183, 30,192,172,232, 47,225, 28, 6,214, 25,253,146,164,243,144,240,226, 77, 38, 68, 12, 41, 36,136,205, +225,162, 36,163, 84, 19,236,193, 6, 26,165,113, 34,138,104, 11,126, 56, 32, 64, 34,170, 92, 21, 68,148,212, 80, 29, 25,232,191, + 63, 60,252,250,237,155,225,243, 29, 29, 93,157,157,147,147,227, 11, 75, 43, 2,246,246,249,168,212, 27, 70,106, 90,199,247,233, +134,189,149, 55,110,116,119,247,116, 95,123,252,252,233,163,161,161, 15, 35, 35, 83, 63,166,109, 75,235,104,107,189,213,115,141, +179,205,159,233,116, 36, 18,122, 50, 48,216,117,241,210,216,216,183,130,166, 73, 21,226,195,123,119, 31,244,245,114,142,145,156, + 72,134, 84,226,121, 17,150, 56,130,172, 25,236, 49,120, 91, 97, 61,163,198,139,102, 65, 76,132,240,164, 91, 6, 21,206,231, 25, + 47, 13,139, 48, 22,136,229,117, 8,247,232,192, 87, 52, 10,141,209,166,181, 92, 6,206, 11, 48, 56, 95,166, 45, 20, 57, 64,109, +211, 33, 60, 91, 87,219,187,211,153, 20, 54, 89,211,249, 41, 0, 37,177,112, 53,188,210,251,197,225,123,142, 75,101,102,183,182, +115, 21, 34,137, 6,226, 84,116,219,100,146,253,240,253, 40,137,199,227, 76, 10, 60, 2,104, 96,111,235,154, 99, 64, 8, 54,109, +171, 54, 82,187,158, 95, 69,181, 0,127, 88, 38,126, 88,156, 22, 29, 79, 3,168, 9,199,135,212,136,110,109,193, 74, 38, 21, 18, +196,253,233,197,113,216, 6,116, 75, 63,209,124,106, 97, 99, 14, 66, 70,209,196,246, 45,153, 40, 23,142,157, 75,206,127,207, 22, + 54, 23,215,210, 38,171,244,114,124, 78,219,164,228, 60, 36, 52,197,249,213,249, 68,101,237,151,217,175,240,156,100, 11, 89,248, +206,181,237,181,130,161,193,197, 49, 29,251,211,196,232,129,120, 35,100, 9,176, 36, 19,145,234,150,214,179,115,169, 41,195, 50, +152,150,138, 66,148,160, 63, 36, 17, 5,158,171,182, 35,167,199,230,146, 75,217,101,154,247, 48, 57,113,236, 94,135, 96, 65,127, +172, 54,159, 73,235,182,181,184,177, 4,185, 75, 88,141, 52,196, 27, 81,216,150, 94,200,186,104, 2, 50, 6,191,132,131,217,168, +195,108,228, 4,206, 86, 2,149,177,146,125,178,189,122,101,121, 61,171, 25,155,144, 57,186,188,102, 99,183,108,209, 49, 55,245, +162,102,185,151,235, 19,181,170,212,146, 80,131, 0, 15, 28,174, 70,133,147,241,197, 20,229,253, 76,102, 38,151, 85,124,165,155, +135, 27,158,117, 30, 61,211, 4, 57,133, 92, 21,146, 81,255, 25,128, 12,170, 3,179, 89, 79,222,115,107,166,212, 34, 19,152,131, +108, 16,146,200,128, 68,194,138, 88, 19, 82,234, 15, 69, 57,149,124, 28,157,213, 41,127,227,115, 69, 34, 28, 92,135,171,109, 91, + 1,222,255, 46,245, 57,230, 54,223,238,191, 62,216,247,226, 78,115,239,171,236,203, 89,123,238, 74,226,120,166,248, 43,175, 21, + 92,170, 4,201,232, 83,120, 69,139,106,116, 77,113, 96,173,224,229,197, 29,219, 53,232, 1, 5, 83, 75, 84,213,229,177, 11,197, + 13,202, 65,170,114, 81,100,147,183, 44,102,144, 10, 2,159,163,117, 12,175, 28,207,108,163, 93,234,207,231, 50,175,105,100,164, + 12, 90,188,132, 95, 33,233, 94,253,196,147,143,129,184,155, 3, 36,142, 13, 53, 88, 22,175,143,214,195, 7, 13,203,244,202,241, + 20,190, 56, 88,194,244, 76,243, 40, 84, 64, 2,204, 27,189, 19, 60,254, 22, 7,175,176, 3,136, 21, 24,202, 65,157, 86,120,168, +237, 10, 83,202,240,138, 66,110,153,190,133,212,100, 75,203, 99, 79,155, 83,250,195,242,180,156,106,112, 81, 53, 42,250,136,233, +232,140, 84,216, 23,221,105, 78,243, 91, 0,210,174,229,167,137, 56, 8,119, 95,221,110,119,183, 75, 31, 65, 42, 5, 33,160,145, + 24, 84, 66, 36,234, 69, 64,140,226,227,100,244,194,201,120,242, 17,136,120,211,120, 48,209, 68,244,226,133, 63,193, 43,241, 96, + 76, 60, 74, 68,145,132,248, 62, 17,163,162, 70, 44, 97,105,217,118,127,237,110,183,235,204,108,139, 32, 71,175,155, 38,237,110, +119,102,190,249,205, 55,223,247,191,249, 61, 72,238, 10, 20,111,164,178, 84, 54,171,128,113,155, 51,250,191, 8,157, 70, 24,188, + 28, 82, 34,188, 94,198, 85, 82,126,253,122,168,142,217,235,165, 41, 48,233, 5,100, 28,252,123, 60,113, 48,248,164,150,130,190, + 53,144, 80, 90,175, 19,126, 40, 56,117,227,188,186,105, 9, 23,218,186,165, 91,203,221,220,150, 2, 4, 24,128,185,182, 74, 2, +211,117,123, 92,191,209, 72,103,243,191, 2,225,164,218,198, 4,177,117,208,234,143, 19,232, 99, 56,125, 33,238,150, 47,224,246, +143, 31,215,101, 69,195,129, 41, 79,123,168, 34, 13,187,145,112,130, 98,115, 60, 57, 56,163,246, 0,202,181,203, 60, 96, 31, 0, +245,138, 92, 85,149,144, 83, 42, 12, 31, 31,104,206,164,239, 77, 60,152,155,127, 55,243,106,246, 80,223,193,193, 35,253, 31, 63, +189,177,214,204,176, 36, 85,171, 66,133,102, 61, 80,108, 28,215, 95, 94, 41,156, 59,115,106,108,116,252,238,196,253,169, 39,207, +160,163,142, 40,162, 36,250,169,132, 58,122,229,242,192,224,137,246,142,157, 83,143,159,246,245,246, 93,186,118,189,125, 87,215, +210,226,183,215,243,111, 19, 13,201,241,177,209,150,182,214,184, 38, 79, 79, 63, 47,227, 82, 32, 66, 20, 33, 48, 57, 39, 58, 38, +164, 29,228,224, 56,190,239,114, 17, 81,117,220, 50, 17,141,106,244, 95, 92, 28, 68, 2,131, 11, 41,134, 36,141,208,170,201,195, + 56,132, 48,243,162,114, 12,181, 57, 29, 59,152,177,184,232, 59,130, 93,202,151,236,103,230, 20,113,240,204,135,116, 57,134, 14, +180, 98,216,114, 44, 64, 94,128,157, 75,229, 34, 92,129, 7, 38,133, 37, 58,184,243,186,119,236,229, 56, 97,141,229,168,143,242, + 72, 74, 1,199, 24, 74, 56,130,134,165,196,148,128,247,187, 65,141,171,178,126,254,226,200,220,203, 89, 40,153,200, 61,117, 29, + 45,170,219,101, 40,127,229,116,178, 57, 95, 88, 1,228,187, 45,222,156,183,209,184, 3, 27, 20,242,177,132,175,131,223,147,212, +177,174,164, 98,141, 16,182, 80, 30,126,153, 63,113, 12,130, 45, 23, 61, 14, 12, 93,175,163,169,195, 70, 17,193,176, 67, 28,158, +222,206,125,138, 20,249,110,254, 32,223, 93,220, 62,132,110, 50,169,199,139, 78, 9,234, 77,158,229,224,198,151,114,217,133,133, +247,197, 18,131,236, 3,207, 7, 77,144,237, 28, 36,107,232, 99,156,170,155,205, 45, 3, 60,199,181, 4, 41,172,171, 6,170,204, +203,209,213,162, 5,207, 22, 42, 68,209, 45, 32, 99,138, 23,146,177,196, 26, 43, 88, 37, 64,247, 89, 18,135, 17,218,154,218,151, +204,223, 0, 54, 1, 63, 98,240,122, 37,145,198,241, 81,165, 97, 71,181,210,117,172,217, 48, 11, 80, 93, 92,215, 43, 84,156,197, +181,194,162,101,153,182,189,194,240,224, 98,100,119,203,254,180,150,208, 68,198,188,180, 30,231, 4,145,185, 78,131,168,124,252, + 97, 94,232,201, 60, 60,221,125,246,112, 91,122,187, 38,199, 68, 60, 58, 36,142,141, 88,211,227,219, 64, 38, 11, 2, 82, 64,206, + 0, 0, 5, 85, 6,228, 46, 25,106, 56, 5,245,160, 37, 25,106, 77,125,120,177,240,101,217, 2,180, 15,105, 26,130,209,180, 13, +230,121, 67, 61, 3,109,241,204,157,153, 71,195,253, 39,135, 15, 12,221,158,156,188,213,121,245,230,215, 27, 73, 45,214,103,100, +178, 54,178,251, 29, 98,102, 33,126, 71,114, 64, 5, 61, 70,188, 74, 88, 86, 33,195, 66,193,115,107, 18,237, 62,244,205,144,234, + 87, 89, 62, 24, 63,218, 16, 51,172, 72, 25, 60,160,144,163, 18, 9,117, 72,132, 70,106, 4, 73, 95,149, 85, 45, 18, 97,165,146, +196,139,123, 50,123,114,150, 73,187,172, 53,129, 94, 72,238, 65,206, 49,162, 6, 43,219,134, 98,224, 60,124,253,182,209,136,175, +202, 42, 44,216,105,162,197, 18, 4,213,144,113, 18,106,170, 88,182,104, 41,161,186,209,143,233,175,145, 4,132,145, 40, 30,237, + 30,130, 26, 26,208,224,235,212,124, 4, 56, 85, 58, 33,172,107,150,249,122,196, 32, 55,115,151,120, 31, 1, 29,180, 70,206,223, +224,150,193, 5,120, 0,194, 10,222,171,245,245,220, 16, 95,223, 6,170, 39,251, 63, 2,144,118, 61, 63, 77,195, 81,188,237,186, +181,221,186, 14,198, 6, 14, 80, 71, 2,122, 48, 70,193,120,224,166, 38,122,240,162,152,120,243,172,198, 72,188,155, 24,227, 95, + 32, 23, 15, 70,143,196, 68,227,205,139,122, 48, 38, 36, 4, 48,241,162, 16,144, 95, 1, 6,108,224, 88,217,186,174,237,218,111, +125,239,125, 7,193,196,155, 23, 46, 77, 51,218,244,251,222,231,189,247,121,159,143,252,255, 99, 85,146,253,100,110,232,137,255, + 82,111, 23,255,221,191,193,251,200, 58,172, 41, 9, 17, 67,236,112, 5, 92,204, 59, 98,172, 33, 30,114, 98, 18,209,164,141,182, + 33,124,155,137,228,195, 81, 55,198,131,103, 49,173, 61,145, 75,167, 97, 58,149, 72,246, 52,224,219, 4, 33, 46,121,242,197, 40, + 6,136, 15,174, 16,249,250, 47,103,192,240,200, 76, 69, 60,144,157, 68,219, 16,244,140,119,105, 13, 12,227, 27, 4,180,146, 89, +200,119,246,175,237,174,134,228,215,234,115, 82, 16,118, 36,252,144, 29, 81, 36,150, 2,137, 71, 71, 82,200, 78,168,112, 60, 66, + 42,159,144,163,237, 29,200, 69,163,155, 29,161, 30, 84,113,146,121,171, 10,233,126, 0,229,111,223, 28,129,139,151,175, 92,122, + 51, 62, 14, 15,214,147,203, 90,214,238,243,177,103,163, 15,239, 63,122,112,231,197,203, 87,155, 91,229, 80, 80, 16,151,136,114, + 29, 96, 91,181,118,238,204,217, 39,143,159,190,123,255,246,243,151,175,237, 70, 60, 26,193,217,168,215,100, 40,207, 29, 79, 74, + 49,229, 88,103,183,161,107, 34,243,154, 86, 69, 70, 57,249, 0,106, 5, 93, 13,202,165,245,158,222, 76,221,250,157, 74, 98,133, + 1,255, 24,220, 69,141, 46,116, 97,165, 19, 18,202, 49, 33,170, 10, 85, 43,176,189, 42, 87,226,195,153,125, 16,182,182,137,197, +208,117, 27, 34, 42, 99,160, 18, 47, 36,221,122,163,150,109,207,149, 42,155,150, 91,245,252,152, 17,111, 51,237, 61, 60,176,248, + 85, 99,129,143, 99, 12, 84, 16, 67, 5, 71, 87,114, 4, 20,237,179,181,104,194,245, 27, 74, 36,118,184, 4,143,186, 41,140,101, +141,182,149,226, 18,111, 71, 6, 68, 54,136,195, 81, 15,137, 26, 46,177, 40, 96,126, 89,129, 51, 54,152, 31,250,185,254, 99,165, +248,107,105,108, 30,222, 38,164,153,132,102, 12,158,190, 48,181, 48, 9,249,245,124,223,197,217,141, 89,192,197,144,100, 1, 16, +105, 81,205, 11, 93, 90,182,138,160,210, 32, 67,123,175,125,171, 2,149, 16, 54,211,153,255,109,113, 10, 80, 60,167,202,245,231, + 6,118,204, 34,228, 27, 93,209,104,116, 22,166,147, 29,142,219, 88, 46,173, 22,202,219, 88,163, 16, 5,138,107,155, 64,153, 83, + 52, 93,215,115, 42,161,233,248,126,132,172,180,211,186,177,111, 91, 54, 32, 83, 17,194,125,201,241, 92,120,174,182, 68, 10,162, +188,105, 87,195,136,132,110,142,204,217, 71,201, 26, 65,114,164,108, 42,171,200,234, 70,185,224,251, 77,195, 72, 1,106, 86, 99, +186, 22, 51, 79,228,250,138,187,219,144, 54,224,240, 47, 20,230,111, 13,143, 44,110, 45,205,109,204, 37,148,184, 30, 55, 60,207, +194,247, 27, 81,251,140, 64,232,105,239, 26, 58,121,163, 55, 57,184,150,254, 94,216,153, 92, 43, 77,108,250,203,149,150,232,235, +118,205, 62,213,145, 95, 40,238,180,163, 36, 33,160,123,200,131, 65, 38, 35,191,190, 55,156,238, 55,144,225,130, 61, 43,134,127, +125,116, 56, 67,109, 3, 68, 19,129,132,194,107, 80, 60, 82, 35, 29,237, 58,196, 22,241, 64,226, 77,249,136,164,169, 66,206, 16, +186, 51,107,159,230,102, 22,182, 20, 85,133,175,200, 67, 75, 14,219,247, 27,245,102,227,195,204,199, 1, 61,111, 10,149,209,171, +119,133, 9, 65, 23, 50,157, 41,121,199, 89,185,126,252, 26,156, 34,135,113, 19, 62, 50, 36,193,132,201,140,184, 1, 65,220,244, +246,155,152, 14,125, 42,119,241,171, 32,166, 24,235, 74,231, 54, 43, 91,132,247,153,200, 90,221,220,184,162,228, 51,249,217,194, + 44,105, 28, 31,168,213, 28,240, 56,124,190,253, 13,133,123,224,173,236,174, 54, 91, 92,118, 26,173, 51, 26,255,139, 28,187,137, +106, 84,203,165,123,106,219, 22,141,100, 4, 26, 30, 11, 22,237,235,137,173, 62, 10,183,131,197,170,172, 82, 43,147, 61,124,203, +243, 65,215, 82, 16,238,169,157, 67, 94, 18, 18, 55, 73,246,167, 23,167, 57,153,155,176, 17,190,186,128,183,240,209,127,202,128, +175,171,238, 84,225,119, 77,187, 76, 28, 13, 44, 62,168, 39,211,210,186, 57,220, 49,226, 6,173,212,116,128,152,134,174, 12,232, + 63,197,175,179, 35,246, 76,116,231, 31, 1, 56,187,182,215,166,225, 40,156, 52, 73,155, 91,155,182,116,183,202, 86,156, 34,171, +123,240, 70, 81, 68, 54,196,121,193,137,255,132,127,200, 94, 68, 17, 84, 80, 80,124,243, 69,193, 11,211,189, 56,196, 49, 95,124, + 18,113, 12,193, 9, 19,183,118,110,197,110,237,154,182,105,155, 54,105,227, 57, 39, 73, 39,236,205,151, 66, 33, 36, 77,154,223, +249,125,231,156,239,124,223,255,224,119,118,159, 98,187,179, 71,159,223, 87,225,247,191,249, 30,173,156, 15,210,105, 88,154, 17, + 52, 54,214,134, 91, 99,154,212,123,236,169,104,246,144,126,128, 36, 8, 66, 28, 35, 11,140, 40,160,174,138,172, 10, 90, 8, 50, + 66,156,165,166,185, 54, 4, 90,200,248,230,137,166,193,246,106,245,110,143,151,216, 53, 68, 94, 17,108,207,243,112,111, 0, 54, + 44,107,104,242, 71, 94,245,222, 20, 21, 29, 1,171,221, 33, 10,139,192,241, 22,246,228,217, 74,189, 76, 15, 55,192,248, 90,124, +216,218, 6, 68,202,186,228, 66,214, 23, 71, 33,172,206, 48, 49, 77,150, 36,129,212, 43,177, 98, 68,211,127, 14, 77,105, 34,251, + 80,145,216,176,202, 43, 18,167,138,232,108, 71, 19,158, 16,223,133, 43, 23, 46, 95,157,190,182,252,117,233,217,139,215, 72, 3, + 33,107,146,252, 78,229,231,106,246,252,228,197,195, 7,211, 43, 63, 86,117, 93, 15, 5, 1,181, 89, 93,219,154, 56,147,185,127, +251,230,226,226,194,189, 71,143, 17, 82,241, 2, 54,101, 58, 78,203,234, 86, 12, 51,149, 28, 78,143,141,207,207,191,123,191,240, +177, 89,111,140,166, 6, 55,114,191,230,230,222,192,213, 2,156,109, 84,244,221,157,194,171,217,217,245,141,109,203,230, 90, 45, +180,234, 6,200,100,217,144, 67, 0,148,118, 32,189,199,249,100,179,131,108,126,244, 62,238,184,192,131, 16,188,231, 56,211, 37, +179, 88,175, 48, 73,109,161,186, 89,119,251,253,176, 83, 82,229,164, 5, 81,158, 14,238, 4,121,140,155, 54, 26,234,162, 72, 3, +185,134, 49, 40,241,102,155,154, 28, 71, 19, 37, 11,121,193,174, 59, 26,196, 61,120, 90, 37,189, 8,136,123,184, 47,165, 55,116, + 88,240, 22, 73, 46,219, 88,103,181, 34, 82, 84,147, 34,229,122, 25, 80, 48, 0, 25, 36, 32,113,156, 20, 82, 4, 72, 8,154,213, +114,109, 23,197,181, 89, 39,174, 38,182, 43,121,194, 14, 28, 96,186,166,105,136,162, 18, 81, 34, 34, 47,122, 99, 35,240,223,112, + 60,128,101,242,186,107, 96,235, 59, 40, 69,149,184,137,106, 25, 44,186, 27,219, 86, 76,142,186, 37,221,173,242,150, 69,156,156, +176, 28,182, 44,248,133, 76,170,239, 32, 15,219,160,211,213, 20,173,160,227, 0,253, 80, 34,153, 25,203,100,255,108,168,162, 12, +151, 5, 48,158,219, 70,143,214,241, 84,122,189,144,117, 25, 86, 82, 80,169,154,181,254,200, 0,186, 70, 4,156, 67,201, 35, 37, +163, 12, 1, 8, 54, 9, 8, 51, 6, 10,245,224,186,134,224,149,223,205,183,108,171,214,168,194, 11, 15, 1,229,232,129,244,102, + 41,191, 83, 43,109,150,182, 52, 85, 83, 37,200,171,154, 54,201,252,194, 42, 62, 41,241,137,233, 17,212,140,140, 5,181,100,100, +108, 40,154, 73,168,147,199, 78,221,125,250,100,230,250,217,111,159,151,191,228,138, 55, 38, 78,151,171,109, 19, 27, 45,109,120, + 28, 39, 70,135,210,151,210, 82, 58,206, 40, 28, 19, 66,121, 63, 84, 18,230,221, 6, 89,192, 35, 64,225,228, 17,122,179,112, 56, +182,129, 1, 61, 40,192,163,134, 87, 87, 8,137, 2,175,138,172, 38, 49,169, 4,147,234, 47,124,248,254,114, 97,197,161,241, 10, +204, 86,177,246,100,197,248,145, 82, 27, 3, 0, 36,220,111,215, 62, 61,188,245, 96,233,121,118,109,245,247,212,224,212,157,220, +204,185,129,227,106,128, 53,176, 69,129,124, 50,248, 20, 67, 50,149,224, 80, 56,211,180,219, 98, 80,130,109,213,104,213,109,178, +242,192, 94, 21,128, 54,220,173, 13, 82, 96,151, 99, 74, 20,210,157, 14,113, 28, 10,144,229, 56,190,207,167, 43, 2, 76,122, 2, + 52,103,110,181,176,192,136,113, 5, 39, 54,252,225,214, 61,193, 89,207, 34, 21, 13, 20,139,181, 34,227,233,132,225, 59, 18,145, + 52, 27, 9,195, 29,183,159,212,147, 0,163,151,184,219, 43,126,119,200,194,137, 24,143, 1,175,160, 64,136,200,193,194,142,233, + 19,222,169, 98,227, 17,116, 48,228,195, 26, 33, 69,241, 78, 20,110,211, 52,224, 36,152, 46,211,229,124,231,144, 94, 3, 56,240, + 79,135,209, 3,150, 93,111,144,203,239, 11,120, 68,122, 60,255, 95, 1, 40,187,150,215, 38,130, 48, 62,187,155,157,201,102,204, +102,211, 52,109, 45,181, 84, 5, 21,170,130,130,120, 83,212,179, 23, 5, 43, 8,162, 66,233, 31,160,167, 94,188,136,103,111,158, + 60,136,248, 23, 88, 5,193,155,120,169, 47, 4, 61,217, 26,169,239,190,146,108,118,179, 59,187,147, 93,191,111, 54,143, 42, 69, + 16, 66,200, 33,155,108, 54, 59, 51,223,239,155,223,227,255,248,145,156,114, 69, 45, 79,254, 10, 89, 53,200, 22,202,225,118,147, +123,239,181,190,165, 71,212,173,242, 13, 24,117,168, 89,213,187,187,240,100,107, 67, 27, 13,204, 51, 77, 88, 38, 85,205,250, 48, + 84, 51, 11, 48,203, 51,164,175, 53,229,102, 75,186, 90,214,191, 84, 73,162,200, 82, 82,215, 52,201,156,251, 17, 37, 96,243, 29, +198, 51,178,224,181,129,183, 48,218,132,230, 75,158,104,102, 23,177, 92, 24,170,183, 55, 21,243,133,160,162, 7,251, 3,145, 65, +114, 24,218,171,253, 75,141,171, 20,180,105, 87,204, 71,116,147, 26,112, 7, 76,141, 86,120,137,123, 81,148,230,136, 34, 14, 64, + 33,134, 86,233,121,166,227, 46,161,178,156, 81,144, 4, 81,138,136, 82, 25,167, 34,136, 76,102, 84,157,161,181,141, 77, 33,164, + 97,154,138,205,137, 32, 45,150,226,216,145, 3,115,179,115,140, 89, 11, 11, 79, 95,188,126, 67, 13,122,230,244,169,153,243,231, + 23, 95, 46,222,188,117, 59,148, 49,165,166,114,127,140,115,232,247,159,248,190,176, 24,219, 59, 57, 81,251,250, 13,219, 32,166, +225, 20,185, 97, 36, 82, 10, 74,169,136, 58, 65, 8, 8, 88, 11, 66,153,224,217,101,172, 64, 68, 66, 82,185,107, 99,241, 0,247, +173,153,196, 94, 28,186,202, 10, 91,118,146,190, 82,187,207, 69, 69,177, 53,195, 58, 56,233,252,177, 23,163,120, 29, 14,175,184, +225, 38,252, 19, 20,128,138, 9, 32, 1, 37,102, 48, 74,179, 13,207,108, 55,186,108,149,221,160, 14,197,187,205, 29,158,231, 43, +235, 43,104, 75,171, 51, 3,169, 62,204, 67,181, 42, 57,113,240,204,243,247,207,138, 5,187, 21, 96,251, 98,196, 30,129, 35,235, +254, 6,128,232,122, 80,183,243, 14, 32, 57, 40, 99, 3,128, 2,212,114,145, 55, 45, 39, 71,119,195, 44, 21, 72, 95,205,149, 90, +197,174,166, 24,145, 97,213,126,126,130, 15,134,165, 98,205, 93, 29, 46, 86,225,157,237,208, 83,166, 99,137,158,234,200, 73, 53, +104, 1,189, 98, 36,156, 18,167, 59,218,194,131, 85,138,229, 48,197,202, 41,148, 40,174,160, 17, 20,191,202,184, 88,107,135, 65, +222, 52,131, 40,132,195,167, 70,167,150,126,124, 68,197,172,150, 43,219, 21,183,237,134,216,176,234, 84,236, 97,206,172, 47,235, +223,247,143,239, 91,107,174,194, 9,195, 76, 52,234,140, 53, 85,216,108,221,107,170,129, 72, 38, 43, 19,161, 20,152,172,109,151, +163, 72,192, 95,150,197,109,169,187, 17,190, 2, 39, 72, 76,148, 29,222,181,209, 90, 43, 50,254,189,241, 75, 17, 10,136, 34,182, + 34, 28, 12, 59,242, 90,181, 58,125,231, 56,105,182,136,240,137,140, 73, 35, 36,174, 79,190,110,144,217, 27,100,100,250,193,149, + 75,151,239, 63,158, 46,243, 50,165, 99,220, 26,138,197,245,115, 23,246, 93, 60, 74, 68,141,100,187,182, 50, 2,248,131,143, 24, +249,148,248,128, 5, 63, 82,194,230, 56,233,166, 54,232,189,161,105, 42,137, 71,222, 32,118,129,236,116,224,121,249,225,171,123, + 79,222, 25, 44, 87,130, 31, 12,215, 12,137,185,112, 71,193,225,123,150, 27,172,108,242,197,213,207,143, 86, 62,196, 75,235,243, + 39,239,238,103,135,172, 82, 99,230,237,217,249,195, 87, 5,160, 56,180, 7, 87, 61,234, 52, 41,114,238, 7, 62,101, 12,208,161, + 76,101,209, 42,181,132, 23, 70, 48,223,169, 92,140,108, 3, 22, 35,139, 53,228, 56,133, 30, 84,105,200, 87, 38,157,166,223,128, + 10, 12,150,234, 0,155, 45,125, 33,210,118,147,146,158,197, 86, 15, 84, 80, 89,246,143,102,244, 21, 67, 61, 67, 50, 37,167,130, +149, 9, 42,140,160, 19, 98,154, 20,145,153, 55,125,210,179,147, 31,240,106,180,116,172,180, 83,169, 19,210,190,207,109, 55,123, +178,255, 69, 9, 44,127,176, 58, 90,128,225,178,207,239, 40, 36, 4,139,155,105,152, 99,206,120,109,125, 89, 79, 0, 82, 23,252, + 72, 37,202,166,127,181,214,213, 54, 72, 55, 54,116, 64,248,209, 6, 42, 86,173, 23,158, 65,126, 11, 64,217,213,244, 52, 17, 69, +209, 55,157, 78,103,218,153,218, 41,165, 20, 33,104, 12,138, 75, 53,126, 69,141, 11, 23,186,193,165,226,222, 31,160, 43, 55,198, +196,157, 75, 55,198,165, 33, 38, 4,195, 66, 77,112,111,130, 49,145,104,226,130,196,148, 0, 90, 66,128, 66,161, 76, 63,166,211, +249, 30,239,189,175, 45, 96, 76,140, 9, 93, 81,166,228,245,190,123,207,187,239,220,115,254, 47,191,235, 10, 44,116,147,231,119, +225, 79,102,228, 63,147, 59, 63,192, 96,183, 36,136,122,118,175, 81,175, 53, 46,178,216, 1, 61, 97, 60,117, 72, 40, 93,194,194, +142, 54, 61,117,162,168,249, 78, 6,212, 24, 95, 9, 81,206, 43,121, 57, 33, 86,218,155,100, 99,200,168,159,133, 4, 34,216,132, + 62,231,173,242, 20,143, 19,213, 56, 31, 31, 9,251, 77,153,176,227, 91, 66,183, 34, 81, 56,112,100,176,210,216,140,161,155, 22, +255,178, 35,118,248, 94,227,175, 18, 61,216, 29,130,147, 68,224, 18, 51, 18,185,153,163,133,177,213,189,159,167,135,114,195, 71, +245, 29, 11,112, 18, 19,227, 16,136, 0,219, 5, 85,197,142,174, 97,250,109, 20, 70, 20, 1, 4,161, 89,149,132,135, 68, 15,221, +211, 0,202, 2,130, 67, 47,241,132,132, 53, 75, 18, 73,171, 0, 54,176,140,197,166,191,111, 96,226,206,221,235, 87,111,144, 28, + 89, 4, 89,224,253,236,236,244,204, 59,200, 5,154,138,104,212,243, 66,211,114,168,127, 25,242, 69,132,135,139,116,235,140,140, + 54, 72,193,200,135,196,202, 10,123,197,133, 55,162,197,152, 32, 74, 24, 64,240, 87,168, 72, 76, 58,217, 16, 18, 0,149, 28, 15, +247, 80, 96, 57, 81,155,132, 69,176, 83,200, 16, 66, 33,172,227,228, 26,228, 21,104,146,230, 96,179, 23, 67, 8, 82, 33,252,111, + 14,210,138,112,121,251,181,156,209,170,195,198, 27,206, 30, 7, 24,110, 57, 13,248,173, 44,194,105, 94,110,123, 38,137, 86,163, + 9,220,190,192, 41,229, 14,212,165,146, 20,100, 38,184,124, 8, 59, 32,121,239, 0, 73,237,212, 55, 31,204, 20,106,212, 70, 87, + 72,186,121,164,255,248,185,177, 51,223,138,223,183,234,235,113, 49,222,114, 90, 79, 38,158, 78,205, 77,149,182, 74,120,201,230, + 65,229, 75,112,212,127,113,236,242, 66,105,129, 60, 64, 80,255, 29,167, 78, 98, 97, 78, 29,128, 79,172,154, 59,183, 47,140, 87, +107,198, 82,121, 81, 79,101,143,229, 71, 22,215,138,163,133, 19,107,149,213,193,190,194,198,206,186, 28, 71, 55,197,179,163,231, +151,215,126,192,115,190, 20, 63,103,211,125,150, 99, 81, 23, 64, 80,149,148,235,123, 99, 67,167, 54,141,178,105,183,100, 60,184, +184, 90, 74,131, 69, 50,204, 90, 46,173,187, 56, 37,160, 86,205,170,101, 91,168,167, 86,223, 6,164, 10,245,204,118, 77, 23,139, +163,175,171,250,174, 89,149, 99,241, 76, 90,247,125,207,180,144, 99,135,246,119,130,160, 39,117, 0,176,165,202, 10, 44, 62, 14, + 7, 36, 20, 53,158,172,219,117,100,179, 96,233,202, 53,219,187,138, 24,131, 10,112, 43,174,221,124,121,141,121, 38,131,165,131, +111,202,178, 89,179, 29, 22, 87,230,151,216,219,245,250,243, 79, 95, 15, 70,111,158,177,138,179,205, 18, 6,155,159,100, 98, 2, + 53,200,224, 16, 7,201,221,118,153,227,225,143, 13,185, 30,113, 47,183,128,239,229, 22,204,236, 16,199, 50, 78,220,177,172, 10, +176,157, 85, 91,115, 47, 62,190,158, 43, 42, 41, 25,170,180, 36,137, 81, 24,107,120,126,217,116,151,107,205, 69,163, 5, 17, 4, +245,210, 9,220,137,225,251, 51, 31, 94,221,187,244,120,242,202,179, 7,191, 30,190,169, 77, 63, 58, 57, 94,182,247,248,141, 37, +249, 75,134, 92,239, 23,138,183,233,192, 51,144,226, 27, 16, 73,141, 38, 88,209,111,199, 39,245, 33,132, 28, 93,159, 38,128,158, + 41, 37, 93, 54,202, 88, 16,249,105,146,110, 73, 41, 74,195, 3, 26, 76, 29,178,110,151,250,209,113, 70,133,183, 42, 9, 69, 22, +147, 77,167,222, 17, 21,232,166,119, 64, 6, 27,123, 91,184, 53, 4,238, 2,200,184, 12,126, 16,113, 70, 77, 71, 84,146,245,110, +231,186,201, 48,147,202, 36,165,228,118, 3,202, 48, 33,124, 18, 79,233, 14,232,208, 16,141,192, 5, 16, 59,102,123,188, 17, 79, + 2, 51,240, 36, 81,147, 85, 64, 0,221, 36, 25, 29,234,135,119,179, 22, 53,144, 15, 25, 31,177,253,169, 31,124,253, 22,128,179, +107,105,109, 34,138,194,119, 94, 73,102, 38,143,154,144, 54, 47,109,105,107, 17,161, 10,238, 92,185, 41,184, 16,247,130,248, 19, + 92,184,209,149, 59, 55,130,250, 51, 44,232, 47, 16, 92, 41, 40,138, 82,169,186,210,182,182,181,205, 59,205,100,146,204,205,204, +100,198,115,206,157,216,170, 69,208, 93, 32, 97, 38,115,231,222,243,248,206, 57,223,247, 63,243, 77,199, 6,239,225, 33,133,192, +159,198, 29,127,133, 13,170,212,202,146, 51,243,205,126, 77,250,149, 11, 50, 68,156,221, 28,250,142, 20, 70, 76, 17, 26,211,169, +219, 19, 3,139,128, 77,148, 85, 41,237, 17,205,145, 10,126,163,232,138,158, 78,100,242,122,174,233, 84,219,163, 54,163,110,111, +164,162,244,135,148,230,251, 19, 31, 30, 10,124,255,103,131,125,128,157,139, 16, 98,196,192,232, 16,194, 59, 25, 98,150,228,127, +162,191,164,254, 23,133,251, 14,213,160,240,177,112,230, 69,145, 42,217,204,242, 66,161,193, 57,247,176,169, 53,166, 42, 66,111, + 49,158,192, 93, 7, 7, 7, 25,139,145,164, 49,140, 99,112, 43,115, 30,138, 54, 17,140,133,145,150, 38,242,197, 8,133, 35,229, + 41,142, 59, 65,148,153, 76, 40,149,147,165,194,116,113,228,121, 91, 91,187,123,213, 70,160,224,100, 40,236, 62,148,169, 12,192, + 79,224,100,127, 82,151, 77,176, 49,154, 8, 12,152,128,144, 80,102, 24,251, 22, 5,145,182,228,211,230, 36, 25, 7, 92, 80, 12, +219,225,128,187,152,112,122, 88, 12,197,247,160,197, 24, 63,224, 46, 14, 85, 33, 78,108, 38, 50, 88,243, 16,230, 56, 18,136,136, +192, 77, 73, 86, 73, 8, 86, 10, 34, 77, 75, 70,158, 18, 33, 29, 85,131,152,119,108,196, 76, 5, 57,152, 28, 60, 63,129,164, 39, +140, 62,183,112,150, 24, 89,222,100,133, 69,217, 48, 93, 86,241,199,110, 37, 95,217,111,237,235, 40,150,237,105,178,186, 88, 60, + 93, 59,168,114,151, 67, 14, 46,106, 89,144,123,101, 83,217,122,183, 10, 43, 15, 89, 45,220, 78, 7,187,167, 40,214,192, 66, 60, +199,110,247,221,161, 17, 51, 32, 95, 70, 74, 28, 62,128, 99, 9,238, 7,222,175, 64,135,136,173, 19,143,122, 41, 83, 30,184,125, +219,233,229, 83,211, 88, 15, 24, 13,178,201, 19,170,172,182,186,141, 83, 51, 21,203,182,110, 92,186,254,248,229,106, 41, 83,128, +229, 90,154, 59,251,102,253, 69, 34,110,204,164,243, 13,171,150, 75,229,251,142, 13,113,247, 98,113, 97,179,186, 1,171, 4, 49, +135,170,170, 96,125,138,185,226,148,145,254,180,253,217, 67,214, 92, 49,115, 19,206, 23,230,191,236,111,194,246,152,205,205,110, +212, 55,202,185,210, 94, 7,158,209,244,136, 31, 14,236,215,148,158,234, 14,123, 26,206,186, 97,107, 32,248, 39, 51,110,192,127, +131, 80,126,224,216, 75,165,165,239,173, 93,120, 40, 72, 83,234, 86,173,156, 45, 55,237, 58,118, 40,197, 99,248,122,229,160, 52, +146,110, 61, 88, 97, 57,151,217, 61, 72,226,152,195, 89,159,179,237,198,189,213,215,119, 63, 84,127,219,187,183, 47, 94,184,255, +234, 61,126,218,126,196,186,125, 44, 87,249,164,206, 10, 86, 30, 54,232, 72, 68,238,168,129, 22,249, 95,146,124, 36,249, 71, 21, +141,187,161,179, 66,134,165,147,157,167,107,151,239, 60,121,199,113, 80, 86, 35,122, 0, 63,248,219, 88,250,181,236,205, 78, 87, +123,118,245,225,249,231, 43, 99,189,126,165,184,108,249,195,115,115,103,222,126, 93, 19,148, 74, 20, 93, 33, 63,168,235,141, 28, +135, 79,207, 86,234,223,118, 32,216,161, 86, 21,156, 90,138,105,241,142,221, 22,148,186, 4,194,144,111,144, 36,151, 52,234,164, +136, 56, 90, 16,140, 99, 25, 13,214,112,128, 92,202, 74, 84,238,140,216,220,137,164, 70,142,234,133,164, 13, 65, 5, 5,180, 53, + 52, 30, 66,253, 26,144,117,173,239,124, 68,142, 88, 82,178, 27,147,228, 74, 16, 70,216,143, 0, 80,192,211,183,122,205, 35, 28, + 1, 17, 96, 78, 0,124, 40,234,209, 19,166, 51, 22, 30,250, 3,146,161, 34,226, 26, 9, 85, 92,124, 81, 53, 13,165,112, 34, 92, + 53,153,132, 58, 2,159, 71,224,117,212, 81, 50,105,205, 63,142, 17, 6,238,241, 67, 0,202,174,101,183,105, 32,138,122, 82,199, +175, 56, 73, 67,146,170, 21,173, 40, 69,162, 11, 96,135,196, 2,169,149,232, 26,126,129, 31,224,103, 88,177,231, 3,248, 3, 88, +176,236, 22, 16, 32,212,170,143, 52,105,155, 52, 77,234, 87, 50,142, 61,220,199, 56,229, 37, 16, 82,164, 40, 81, 60,153,177,231, +222, 57,115,231,222,115,254, 47,254, 46,254, 36,159, 93, 42,234,254,255,226,220, 11, 10, 95,156,227,177, 12,127,238,144,110, 21, + 6, 9,107,179, 96,134, 30, 68,238,232,216, 76,186,150, 42, 44, 21,215, 35, 8,226,132,204,116,217, 42, 30,145, 73,140,109,231, +109,119, 25,236, 42, 74, 67,214, 60, 17,226, 23,218,157,124,129, 90,158,135, 20, 48,249,100, 70, 68,149, 44, 40, 86,132,254,127, + 67,234,133,138,183, 38, 34,250,177,112,138, 84, 5, 72, 59, 13,149,115, 88, 2, 72,177,132, 53,120, 28,169,100,169,108, 90,147, + 20,211,138, 22,240, 48, 16, 80, 60, 0,115, 76, 44, 71, 69, 82, 3,213,160, 80,184, 18, 87, 6, 88, 39, 0, 65, 16,200, 86,168, +126, 55, 69,103,207, 50, 98,148, 62,197,123, 56, 18,211,233, 15,195, 47,123,157,253,131,238, 40,148,224, 59, 29, 20, 53,205, 40, +199,142, 20,131,241,246, 96,180, 20,190,144,208, 78, 10,123, 90, 4,230, 84, 16,133, 19, 42,163, 60, 25,240,245, 38,242, 25,148, + 44,100,164,193, 9,105, 45,136, 50, 71,152, 80, 81, 75,224,225,176, 82, 38,128,232, 72,146,218,159, 5,131,107,250, 77,128,225, + 53, 7,171, 85,245, 52, 21, 36,181, 37,224,114, 27,159, 7, 87, 44, 83,137, 25,124,195,104,165,238, 52, 12,228,228, 73, 88, 46, + 13,254,196,182, 61,223,174,142,163, 0,176,103, 44, 39,108, 38,196,225,204,180, 26,248,254,244,225,179, 79,199,159, 29,203,202, +178,212,177, 43,189,203,110, 34, 19, 54, 6,232,110,197,173, 69,147, 16, 92, 57, 91, 2, 67,123,120, 26, 0,231,225,226,171,248, +146, 37,144, 40,195, 61,231,163,245,134,223,186,189,116,103, 16,156,175, 55,215, 71,209,136,101,138,203,150,179,232, 34, 37, 8, +108, 5, 22,253,250,122,123, 99, 16, 12,166,114, 82,117,107,211,116,178,253, 96,251,240,236,232,120,112, 2, 99,135,214, 96,161, +236,156, 30,193,189,132,229,124,138, 39,165, 10,195, 59, 8,225, 85, 24, 71, 37, 98,156,246, 92,207,117,144, 77,172, 31, 12, 59, +253,174,231,250, 51, 98,252,167,236,232,124, 28, 95,101, 52,132,126,208,223,188,121,247,240,188,211,170, 54,131,120,236,217, 46, + 17,220,230,182,229,161,114, 76,142,217, 41, 21,199,191, 8,135,128,247, 37,169,206,129,213,215, 42,139,102,169, 12,174, 13,118, + 75,237,122,251, 34, 24,192,111,166,105, 12,107,175, 5,253,247,154, 39,225,240,177, 97,217, 59,203,168,166,205,154, 54,224,222, +234,238,214,198,210,106,237, 94,119, 20,244,130,177, 5, 27,113,148, 47, 86, 71,157,222,139,251,203,165,213,154,145,245, 12, 33, +209,155,171, 92,147,174,176, 53, 96,254,163, 64,111,238,130, 55,183,140, 42,188,108,163,225, 25, 55,124, 99,173,101,108,174, 24, +210,120,249,252,245,147, 87,239,186,179,124, 46,215,147,255,139,114,228, 99,178,187,167,118,223, 28,188,255,144,188,173,155,246, +154,219,138,179,228,112,208,193,211, 44, 4, 28,102,170,164,109,186,107,205, 91, 48,175,130, 56,120,180,179,181,255,245, 27, 96, + 0,196, 63, 84,203,146,200, 73, 38,120, 10,234, 76, 71, 82, 4, 82,173,234, 82, 52,189,202, 89,216,207,208,233,134,240, 97,165, +177, 50, 12, 71,218,248,181,156,147, 22,222,174, 88, 85, 48,191, 25,241, 11, 8, 93,244,196,150,132,225, 73,184,207,167,227, 51, + 14,101,227,193,184,223,160, 96,169,164,246,243,188,240,197,200, 93, 35,174, 11, 98, 53,251,161,184, 14, 52, 51,135,229,220,100, +212,156,175,146,146, 55,193, 75,192,227,131, 73,168, 51,226,185, 23,124, 38,192,180, 4,191, 8,230,229,218,193, 23,210, 23,134, + 30, 84,193, 56, 54, 7,252,223, 5, 32,237,218,117,163,134,130,232,245,227,218,222,151,119, 99,178, 33, 9, 75,136, 68,129, 20, +132, 20, 68, 71,137, 64,180,212,240, 35, 84, 20,252, 7, 53, 66, 52,116,252, 4,130, 34,136, 46,137, 18,162,144,216,121,176,187, +118,188, 94,191,152, 51,215,222, 36, 36, 13, 98, 91, 63,228,245,189,158, 57, 51,115,230,204,191,225,119,237, 58, 20, 63,203,174, +112, 34, 69,191,114,114,149,153, 49, 46,223,224,130,178,207, 95, 39, 19,166,181, 88, 62, 44,171,229,111,149,206, 66, 45, 69,128, + 29,135,185, 67,166, 48, 29, 77,150,194,104, 25, 54,197,206, 29,171,227, 53,189,163, 73,176, 23,237,161, 69,150, 11,255,220,245, +144,213,121,180, 66, 45, 30,253,220, 70,111, 20,159,178, 87,186, 86,251,178,180,165,141,190,190, 60,171,235, 24,154, 99, 53,226, + 36, 82,134, 62,199, 96, 12,141,137,181,197,131,149,135, 27,187,223,208,149, 77,246,218, 38,224,150, 26,186,129,166, 84, 93,239, + 56,214,114,191,103, 56, 22,194,111,180, 50, 19,174, 33, 84,196,218, 25,162,108, 52,173, 78,203,132,148, 58, 18, 74,240,109,170, +253,150, 54, 16, 97,115,218,192,122, 37,109,193,239, 84, 35,188,175,197,100,105,177,254,154, 9,213, 1,184, 7, 91,106,170, 73, + 40, 73, 10, 14,243, 81, 75, 55, 68,110, 35, 55,138, 67,142,212,108,137,225, 14, 73,130,127, 58,161, 0, 63,215, 1, 66, 68,225, + 88,104, 54, 7,185, 56, 1,242,151,186,110,217,232,170, 78,121, 0,218,217, 20,103,181, 27,242, 48, 24, 70, 9,136, 66, 72,207, + 34, 78, 46,149, 66, 63, 23, 72, 47,174,104, 89, 20,231,113, 34,127, 66,236, 18, 89, 7, 92,213,189,185, 23,191,234, 27,166,163, +166, 97,182,100,147,110, 55,129, 58, 13,148,212, 38,105, 36, 48,238,185,201,141,233,100,115, 27, 80, 55,201, 49, 50,151,137,215, +186,146, 4, 82,220, 5, 7, 6,183, 96, 50, 77,110,153, 50,101,193, 85, 86, 40, 68,105,148, 22,203, 52, 45,100, 51, 76, 72,158, + 41, 22, 0, 93,221,105,186, 97, 52, 46,149,140,132, 40,151,123, 3,127,184, 79,155,202,109,117,165,161,141,162, 49,249,194,181, +149,251, 4,198,151,189,165, 29,127,199, 6,235, 71, 50,200, 19,228,147,232,181,146,233, 95,154,235,211, 30,252,241,243,251, 92, + 11,101,225, 59,243,171,219,254, 54, 61,170,215,242,200,229, 80,160,176, 56,183, 16,140,142,231, 81,218, 61, 24,220, 88,217,242, + 55, 23,122, 55, 79,194, 19,197,126,160, 59, 64,230,204,144, 97, 60, 50,121, 42, 36, 5, 34,116,161, 75, 78, 43, 14,201, 31,128, + 98,203, 20,243,129, 55, 8,134, 62,183,207, 21,228,159, 48,221,183, 44, 87, 23,239, 82, 20, 53,205, 49, 91, 43, 75,167,224, 0, +232,194,145, 70,187,225, 30,133,254,211,238,173, 23,111,215,197,122, 87,248,199, 98, 52, 22,211, 41, 64,119,153,253,250,116,250, +252,221,231,141, 96,255,234,118,255,242,242,201,163, 55,207,196, 36, 22, 6, 87,216,105,183, 78, 83,192,246, 92,241, 53,116, 30, +252, 4,108, 34,108, 75,120, 77,192,246,221,240,195,235,143,175,222,127,205,255,123, 2,196, 61,247,246,227,254, 90,148,197,180, +184, 20, 57,121,205,222,102,176, 53,155,177, 45, 88,236,205, 49,101,187,237, 30,252, 14, 4, 19,102,184,183, 19, 92,154,218,190, +211,163, 57,209,100,140,190, 13,149,117,229,236,135,202, 93, 51, 57, 70,205, 29, 52,170,142,176, 10, 1,151,244,198,164, 46, 27, +210, 38,212, 2,248,204, 59,132, 62, 73,242,163, 71, 67,159, 7, 66,144,207,232, 31,134, 24,254,142,176, 26, 9,129,180,237,116, +207, 38, 97, 82,100, 74, 50,179,168,173,246, 76, 4,129,201,210, 21,137,116,150, 47,184,136,217,149, 98,113, 37, 75, 40,148,142, + 27,155,232, 74,155,178,230,204,148,213, 37,181,232,141,174, 4, 9,106,171,170, 20,252,206, 75,174,151,146,201, 76, 0,251, 35, + 0,105,215,174, 27, 53, 16, 69,253, 88,175, 95, 27, 59, 47,146,144, 64,162,141,136, 34, 34, 26,146,154,138,138,159,224, 3,144, +144,248, 14, 42, 26, 16, 72, 52,180,148, 84, 8, 65, 73, 5, 45, 5, 41, 16,164, 72, 66, 86, 81,246,101,239,218,227,241,112,207, +157, 89,118, 21,104, 16,210, 54,222,135,100, 95,237,204,156,123,239,185,231,252, 51,126,183,254, 40,206,160, 39, 97, 57,161, 27, +179,129,234, 37, 20,239,154, 52, 97,198, 17,100, 6, 38,207,158, 73,166,221,138,228,220,242,216,155, 2, 37, 20, 49, 57,135, 28, +195,127,119, 93,124,129,254,254,252, 98,110,174,135,233, 57, 79,247,145,151,226, 43, 66,137,145,200, 93, 3,227, 13,130, 87,166, +153,162,120, 90,169, 6,105,212, 82,151,186,166,179,157, 95,102,137, 76,219, 38, 40,109,227, 39,184,213,149,116, 61, 47, 51, 15, +202,239, 0, 16,180,128,245,150, 6, 38, 9, 18,127, 71,139, 45, 17, 12,173,148,236,143,198,203,161,215,190, 54,231,121, 4,128, + 26,145, 7,119,211,180,213, 76, 90,110,236, 67,241,156, 5, 74,109,143,211, 23, 20, 82,100,141, 66,205, 24,158, 95,149,168,125, +199, 13, 65,148,199, 76,233,120, 84,102,163,138, 66, 29,120, 78,236,123,177, 7, 92,197, 58, 79,112,183, 9, 92, 21, 5, 4,173, +220,148,142, 59, 23,143,214,100,201, 62,246,232,114,180,220,177, 45,217,190,204,146,141,134,211, 10, 40,110,204, 46, 70, 11, 80, + 69,244,142,143, 65, 68, 71, 66, 29,112, 62,164, 76, 3, 30, 57,253,193,120, 48, 20,218,154,103,178,224,116, 97,198, 54,225,225, +107,102, 29, 79,135, 27, 16, 15, 48,110, 84, 18, 45, 22,213, 40, 9, 23,152,238, 40,181, 38, 18,133, 46,108, 6, 85, 85,161,171, +201, 50,241,173, 32,169,153,252,160, 27,232, 77,180,230, 26, 66, 84,237,181,237,150, 31, 51,184, 14, 4, 6,149, 13,184,132, 71, + 37,166,171,192,100, 93,136, 9, 82,129, 38, 79,161,203,138,156, 86, 77,206, 19, 49,138,159,142,176, 63,120,205, 90,106, 15,254, +212,233,168,204, 27, 56,127, 61, 5,174,156,194,152, 34,251, 41,131,174,163,192,104, 36,240,222,233,119, 40,177,219, 88, 90,199, +192, 38,152,106,122, 12,194, 90, 77, 86,155, 77,255,180,123,124,214, 61,167, 28,236, 96,123,255, 71,231, 40, 47,178,131,157,253, +195,227,195,200,139,178,114, 88,214, 37,229, 55, 23,121,191, 20,227, 66, 20, 97,216, 74,163,100,115,185,125,145, 1,137, 83, 28, + 90, 97, 74, 27,253,238,198,110, 47,239,237,109,238,157,116,127, 66, 58, 92,140,249, 84,147,244, 56,116, 75,154, 33, 93, 85,178, +155,119,165, 98, 56,111, 67, 53,143,117, 38,192,230, 44,171,130,118,165, 27,107, 59,157,193, 41, 59,225, 53,232,211,188, 24,222, +222, 58,248,124,242,245,193,227, 23,119,101,115,101,235,170,181,144, 2, 47,125,207,242,119,223,238, 60,121,253,101,208,251,235, +186,126,254,240,158,221, 38, 20, 47, 24,173, 43,232, 16, 5,244,242,173, 57, 15,190,233,132,217,147,208,154,167,109, 61,177,174, + 83,102, 80,191,127,244,230,214,253,151, 31,142,252, 79,111, 63, 62,125,245,236, 63,247,119,218,208,111, 46,110,245,138, 97, 28, +205,157,247,206,224,100, 73, 56,189, 86, 83,176,224,216,148,133, 14,199, 25, 97, 72, 66,232,189,209, 0, 44, 78,201, 92,120,197, + 25, 10, 8,205, 66, 87, 99,107,173, 34,108, 27,227,163,122, 50,181,202,176, 89,114,233,156, 93, 92,121,241,151, 69,153, 87, 57, +212,190,164, 76,163,185, 82,148,188,210,171, 28,210,120,182,100,193,178, 33, 60, 6,100,109,106, 41,216,124, 41,227,172, 52, 99, +157,133,157,148, 61,229,184,224, 10, 55, 84,203,137,139, 42, 51, 48,181, 60, 71, 61,163, 93, 99, 50,139, 90,235,142,153,233, 29, + 83,186, 97,215, 41,102,197,216,186, 26,111, 10,224,179,149,117,110, 15, 78, 28,158,234,223, 3,162,202,168,140,115, 45,129, 86, +205, 47, 1, 56,187,150,221,166,161, 32,234,107,251, 94,219, 73,220,132, 52,113,210, 34,216, 20,177,168,212,138, 15,168, 84,129, +212,159, 98,203, 31,176,230, 43, 16, 27, 22,128, 42,117, 73, 5, 18,170,144, 42,186, 41,148,190, 75, 98, 39,177, 29, 39, 49,115, +230,218,164, 81, 87, 84,173, 90,117, 81,201,113,156,153, 51,119,206,227,158,248,125, 17,188,243,160, 96,152, 37, 3,178,248, 12, +222,226, 68, 46,148,239, 50, 14, 70,220,246,251,181, 88,117, 77, 24,150,243, 61,138,243, 41,141,220, 37,103,139,149,178, 85,170, + 86,182, 94, 74, 43,161, 20,180, 68,182, 3,178,150, 82,150, 84,166,116,112,200,171,142,162, 3,229,200, 40, 65,120, 38, 78,165, + 57, 25, 88, 55, 0, 42,107, 84,136,170,142, 79, 80, 72,147, 81,239, 20,247,114, 69,178,160,170, 45,211,107,203,235, 23,133,179, +205,252, 56, 74,135,190, 34, 42, 30,209, 48, 38,161,117,194,241,146,149,182,157,134,183,181,217,105, 53,189,225,120,146,140,141, + 48,206,232,103, 20, 79,211,153, 72,161,149,225,149, 21, 80, 88,174, 36,110, 38, 77,227, 84, 27,168, 81, 72,212,127,129,165, 43, +117,173,108, 74,229, 28,122, 66,155, 62, 0,244, 20,226, 5,153,124, 94,200,188, 90, 52, 24,199, 18,176,197, 54,112,240,130,251, +198, 19, 54,225,119,219, 18, 84, 12,233,111,112,238,113, 74,144, 13,199,217, 40,213, 32, 71,140, 39, 48,136, 76,245, 55,124,249, +176, 69,202,231,166,117, 26,111, 67,226, 20, 38, 61,193,177, 7,122,118,241,161, 4,137, 39, 72, 73,187,237,194, 90,188,179,250, +177,230, 95, 24,122,130,165, 85,186, 90,106,135, 26,139,107,131, 62, 51,215,182, 25, 22,220,246, 53, 54, 41, 34, 87, 76,206,174, + 7, 98,161, 89,170, 91, 95,249,121,115, 92, 10, 98, 1,195, 60,167,102,155,118, 4, 31,121,182,243,101,209, 96,133,154,193, 20, + 10,219,182,223,186,140, 46, 52,111, 97, 86,208,100, 11,193, 67,213,173, 13,147,161,201, 68, 9, 71, 57,190, 11,214, 77, 54,129, + 51,176, 37,228,132,131,226,164,148,155,143, 54,111,162, 63, 81,220,163,139, 77, 96,128, 3,118,212, 90,247,201,143,179, 67,105, +218,129, 31,116,154,193,225,201, 33,221,218, 65, 60,224,196,118, 85,171, 84,146,116, 76,173,131, 58,138,163, 60, 2,254,202,118, + 79,175,127, 61,108, 61, 70, 54, 47,155,190, 14,146,136,230,140,231, 27, 47,190, 28,237, 95, 15,192,255, 25, 33,246, 0,216,163, +225, 53,250, 73,143,179,130,161,174,160,145,212, 85,238,214,198, 86, 86, 21,187,159,222,211, 37,241, 53,139,246, 82,112, 22,158, + 47, 57,244, 42, 8,233,103,219,235,219,251, 71,159,233,214,117, 26,221, 56,237,217,121,250,250,235,135,126,150,254, 95,134,218, +222, 43,227,169,111,140, 6,156,197, 98, 96,209, 26,101,198, 77, 2, 90,114,213, 5, 96,175,123,134, 81, 49, 46,251,187, 47,223, +237,188,249,168,139,197, 3,175,121,240,118,111,117,103,253,222,149, 93, 25,118, 83,214,158, 45,175, 57, 82,210,212,176, 92,105, + 34,134,165, 90,191, 10,175,176,194, 42,206,137,208,203, 25, 94,204, 32,207,200,167, 77,191,117,222, 59,165,103,176, 93, 15,194, + 56,236,199, 97,177, 97, 35,120, 87,167,129,233,162, 3, 6,203,111, 13,240,254, 29, 97, 3,145,136, 89,219, 15,186,141,149,239, + 39,223,152,111,195, 34,193, 82,223,148,151,101,203, 18,115, 94, 13,255,151, 86,150,178,151,140,214, 97,232, 5,150,206,140, 42, +200,232,229,236,106,192, 54,131, 30,121,106,246,128,119,195,158, 16,115, 11, 98, 71,130,213,205,249, 45,122, 99, 61,117,165, 11, + 50, 68,166,121, 31, 58, 99, 10, 95,126,165, 49,202, 6, 19,244,155, 2,189, 47, 22, 94,115,174, 19, 42, 18,156,238,188,167, 57, +172,193,255, 10,192,217,185,235, 54, 17, 5, 97,248,236,205,235,245,122,125,193, 56, 49,137, 16, 18, 72, 52, 20, 41,128,130, 34, + 20,180,244, 32,120, 6, 26, 30,129, 23,224, 49,232,144,232,104, 35,133, 18,145, 20, 17, 72, 20,137, 19, 72, 28, 59,137, 55,242, + 37, 27,239,122,207, 50,255,204, 58,230, 34,132, 66,103,185, 58, 94,159,157,153, 51,231,159,239,191, 68,124,255,179, 57, 3, 78, +150,114, 98,125,126, 49,173,202, 8,176, 2,227, 92, 44,190, 50,250,197,118,105,142, 81, 87, 12, 47,196, 33,107,250, 91,151,198, + 80,118,194,139, 49,115, 33,188, 24, 71,102, 54,214, 41, 54,225, 54,235,103,216, 94, 64,217,158,237,162,156, 55,157,146,131, 56, +102, 24,110,195,175,181, 71, 59,253,168, 71,207, 31,134, 26,240, 29,194, 27,139,242, 71,229,248, 55, 11,173, 98, 59,230,241,229, +139,167, 47,213, 97, 6,210,127,171, 55,232,152,202,252, 55,177,120,174, 68,229, 43,120,199, 75,210,168, 92,172,141,147, 49,131, + 27, 21,230, 84, 45, 33,158,153, 15,110, 47,210, 2, 35, 10,162,104,125, 83, 37,230, 4, 65,209,100,170, 2,132,110,160, 76,168, + 73, 2,145, 39,224, 74,241,212, 65, 25,174, 45,166, 46,192,201, 27,192, 67, 3,141, 92,238,117,148, 44,203,167,160,130,227, 11, +206, 47,152,102,114, 49,214,171, 39,250,116, 66,233, 0,114, 98,215, 54,227, 76, 83, 6,156,164, 41,140, 1, 51,163, 85, 15,214, +183,118,167,144, 73, 66,245,149,155,195,107, 25,251,227,104,158,138,130, 75,128,121,169, 84, 41,232,212,232, 44, 40,214,233,245, +195, 42,114,191, 91,118, 77,148, 55, 71, 49,104, 1, 4,152,225,108,192,205,148, 12, 41, 18, 5,185, 73,112,161, 19,103, 50,114, +222,235,148, 4,148, 49,209,193,224,116,164,252, 66, 0,153, 13, 4, 63, 54,187,153,209,251, 85, 40,186, 69,170,196,155,149,197, + 36,137,143, 70, 80, 7,210,242,160,101,214,160, 15, 9,239,251,238,205,123,159,218, 31,105,105,215,106,173,254,232,228,140,133, +228, 28,226,231,198,142, 25,123,166, 95, 9, 26,167,163, 16, 54,223, 24,188,135,115, 38,229,229,165,250,210,238,209,206,139,167, + 47,223,175,189,251,222,223,183,185,223, 72,155,185, 92,244,207,146,200,115, 96,177, 66, 27,138,190, 92,185,177,178,185,189,185, +122,231,225,206,225, 54,149, 72,173, 70,243, 48,236, 13,198, 3,215, 41, 84, 75,213,189,227,118,201,241,233, 15,161,130, 61,240, + 42, 49,248,239, 81,173, 84, 25,199,240, 41, 12,188, 42,122,111, 9, 37, 12,171,236, 81,193, 24,209,158, 9,207, 66, 12, 86, 88, +102,169,192, 87,169,202,160, 24, 7, 39,163,225, 41,157, 18,104, 19, 21,192,169,228, 9,104,250,251, 77, 33,145, 2, 8, 65,105, +137, 45,141, 82,139,189,128,175,215, 22,223,126, 89,219, 8,191, 93, 54,206,190,121,124,255,217,235,231, 42, 48,160,186, 57, 25, +170,240, 92,245, 38,234,107, 95, 13, 38, 27,237,206,214,193, 96,161, 85,221, 63, 30,189,250,240,121, 79,205,207,232,174,114, 79, +214,183,203,171,203,255, 29,223,159,220,122, 68,137,106,161,222,236, 14,186,157,126,151,207,115,218,119, 61,250,141,227, 8,214, +178,210, 86, 86, 51,183,186,148, 39, 78, 32,157, 49,244, 20,112, 26,108,171,102,165, 73, 31, 65,110,224, 98,109, 10,157,171, 33, + 54, 82,217,108,128, 72,174,117, 36,124,194,103, 38, 77, 0, 13,101,223,164,217, 20, 59, 10,236,229,198,242, 65,216,201, 59, 32, +185,116, 64,110,104,181, 20, 58, 83,110,169,136, 66,152,150,209, 8, 26,116, 20, 75,185, 69,227,187, 62,148,184,249,164, 83, 38, +221, 72, 99, 6, 39, 99,168,118,142, 20,203,114,221, 60,100,125, 87,131, 86,119,216,201, 79,195, 90,154,239,194, 42,208, 98, 4, +152,215,143,250, 47, 83, 69, 63,169, 22, 77,238, 46,205,114, 65,174, 87,255, 33, 0,103,215,178,219, 52, 16, 69, 61, 51,126,228, + 85,167,109,162, 58, 45, 5,149, 20,132, 34, 33,241,150, 88,177,225, 3,248, 2,190,136,207,224, 7,216,178,102,209, 21,160,174, + 16,173, 4, 68, 17,105,104, 76, 30, 77,156,216, 78, 60,230,222, 59, 99, 55, 41, 44, 80,149,135,162,108, 18, 39, 51,103,238,227, +220,115,254, 23,223,255, 6,247, 52, 99,206, 48, 13,187, 74,111,128,154,120, 84, 40,149,198,170,151, 82,142,137,128, 5,162,128, +181,232, 98, 65, 84,224, 50, 71,203,158,212, 45, 58, 98, 17, 25, 44, 50, 22, 66,211,212, 81, 61, 61,213,226, 51, 66, 73,180,195, +137, 98,209,241, 0,139,220,225,112,183, 76, 64, 57,244, 5,197, 42,141, 35,236,106,193,245,195,126,103,246, 29, 78, 75, 8,136, + 36,178,169,144, 28, 25,168,190,110,170, 59, 41,120,144,164, 81,190,124,242,224, 29,182,180, 36,105,233, 85, 5,232,127,177,223, + 51,161, 51,122,205, 53,140,113, 50, 22,166,154, 21, 13,150,193,117,162, 26,182,165, 92,160,240, 78, 91,145, 52,178, 73, 80, 71, +207, 30,203,188, 29,140, 74, 44,164,235,136,165,112,114,245, 35,171, 14,193, 28, 52,210,196,137,240, 90,177,100, 88,203,243, 96, + 62,149,241, 48,138, 32,233, 9,162,100, 20, 68, 23,211,208,208,138,141, 43,229,179,178,243,226,201,227,112, 50,220, 48,249,110, + 13,253,126,142,142,145, 71,145, 96,215, 47,161,113, 17, 98, 68,162,237,147,234, 59,105,167,121,202,100,179, 66,149,193,170,229, +237,223,147,190, 82,213,200, 6,127,211,220,188, 77,234,110, 17,174,114,244, 42, 67,135, 17,115, 73, 14, 59,232,240, 69,121,113, +115,231, 16,130, 48,128, 63,134,190,134,162,238,122,253,113,175, 90,222, 26, 5, 3, 53, 29, 70,118, 92,248,120,122,248,236,243, +183,143,166,170, 65, 99,155,138,187,142, 59,137, 1,244, 49, 84, 39,211, 20, 77,191, 82,124, 89, 91,216,161,242,253,208, 37, 55, +220,144,119,247,238,157,118, 79, 72,214,251,114, 15,144, 76,136,132,160, 41, 74,226,134,187, 59,195,212, 27, 15, 81,200, 6,224, +231,253, 53,238,121,110,227,102,253,214,113,251, 19,124, 72,235, 70,235,108,248, 19, 93,148, 72,132,210,196,190,203, 18,158, 15, +188,230, 52, 64,123,222,179, 17, 42,143,123,110, 13,190,230,253,253,214,151,238, 87,127,236,171,156, 14,222,217, 42,109, 14,130, +225,237,157,131, 31,231,109,128,126, 84, 53, 32,210,106,185, 8,203,222,128,156,128,136, 67, 41,172, 94,128, 27,226,228,165,149, +194, 6, 74,166,112,177, 68, 9,127,184, 37, 84, 91,227,234,114, 1,200, 6, 23,195,253,250, 30,202,220,115,110, 90,130, 96, 35, + 73,245,168, 25,252,249,139,183, 39, 31,174, 7,181, 47,221,202,155, 87,207, 31, 61,104, 26, 11,102,116,225,248,155,189,126,127, +244,174,239, 95,153, 85, 47,217,144,157,232, 18,119,213,174,141, 34, 31, 22,166, 52,226,235,125,232,195,237, 59, 94,161, 58,151, + 49, 28, 78, 16,159, 37, 16,133,112, 93, 37,135,181, 4,104,219,238,183, 57, 38,160, 69,216,194,243, 88, 49,226,116,224,140,191, +252,102,163,227,119,164, 42,209,232,158, 38,114,184,146, 44, 72,161,127, 63, 39, 85,104, 99,107,206, 21,131, 35, 85, 58,179,228, +126,166, 20,191,164,109, 57,209, 34,230,108, 93,207,156, 93,114,101, 36,250, 53, 72,138,176, 19, 37, 7,175,250,181, 0,199,182, + 40, 33, 45, 56,103,163,167, 43,163,164, 57,199,140,101,142, 77,186, 66, 3,215, 43,200,115,130,103,200, 78, 53, 28,150, 87, 65, + 20,205,207,142,226,112,213,229, 98,205, 92,155,173,193,235,149,102,226, 31, 1, 40,187,150,221,166,129, 40,234, 25,207,216, 78, +210, 56, 9,105, 75,121,116,129, 84, 33,144,186, 67,253, 2, 62, 3,248, 14, 22, 44,248, 68,196, 2, 9, 54,133, 29,143, 64,132, + 19, 59,182,199,246, 12,247, 49,182,210, 82, 4, 72,149, 23, 85,226, 76,156,153, 59,231,222, 57,247,156,127,138,239, 55,202, 11, +120, 66,219,224, 30,226,255,188, 89, 73,240,155, 11, 44, 95,176,191, 43,192, 89,203,213,227, 84, 29,149, 46, 43,187,156, 83, 84, + 34,198, 32,193, 84,248, 77,194,135,117, 77,128, 93,146, 85, 48, 94,137,232, 1,243, 64, 75, 29, 99, 0, 84,240,154, 36,140, 19, +141, 85,154, 73,124,144,153,236, 50,251,192,253,111,120, 40,232,232,148,213,245,154, 62,100, 88, 46, 56,233,243,233,143,232, 79, +255,177,146, 96,189,169,202, 21,175, 18, 25, 92,227,214, 56,150,193,105, 93,131,185,128, 68,149, 31,233, 69, 14, 72, 30,152, 54, + 59,133,224, 29,177, 45,201,153,208, 27,240, 31,210,145,126, 60,215, 47,164,135,255,114,175,165, 98,160, 89, 57, 79,239, 65,142, +141,194,170,133,196, 77, 58, 26, 69,171, 93,193,146, 46,112,169, 13,118,230,121, 30,129,100,154, 47,124,166,154,162,108,163,126, +122,241,164, 42, 11,209,236,108,151,103,107,243,121,141,188, 28, 18,232, 11,200,137,169, 55, 44,232, 4,145,147, 28, 19, 28,109, +192,154,117, 60,127,187, 88,143, 81, 78,107,183,198, 56,140, 62, 39, 98, 8,241, 3,217, 22,238,196, 10, 4,104,173,133, 46,125, +232,192, 22,225,126, 73,245, 49,103,153, 0, 68,139,203,106,165, 59,210, 6,160, 39,137, 9, 21, 12, 2, 82,239,186, 46,170, 22, +158,100, 24,235,184,105,234,249,120,185,173, 51, 49, 48,207,130,190,130,227,155, 71, 68,172,146,227,244,112,149,173,234,182, 30, + 28, 41, 89,172, 27,226,184, 14,117, 81,231,190, 11,145,138,215,240,197,102,211,121,190,203,211, 81, 10, 35,132,217, 82,154, 82, +163,148,123,146,215,232,208,162,148, 58, 63, 61,127,123,249,230,238,252,244, 71,177,234,201,160,142, 40, 82,114,126,176,136, 97, +228,109, 7,183, 61, 89,220,249,186,254, 18,162, 90,156, 27, 69, 0, 32, 10,242,240,149,252, 35,194,125, 12, 50, 34, 68, 58,154, +231,104,214,136, 63, 99,154, 28,192,214,210,182, 13, 12, 12, 13, 41, 5,246,202,146, 87, 73,209,203,145,216,195,233,210, 88, 3, +136,164, 50, 37, 17,162,131,123,139,251,176, 11,162, 19, 23,110, 6, 6, 18, 23, 60,207,223, 59,189, 99, 35, 22,216,251,223,125, +127,159, 40, 5, 79, 40, 71,131, 0,155, 55,117,213, 53,219,198,236,200, 31,195,218,191, 91,248,156, 69, 73, 27,218, 85,101, 10, +122,109,172,208,222, 11,235,207, 40,179,131, 11,199,152,150, 81,226, 88,164,133,205, 30,222,126,252,236,197,243,215, 47, 95,137, + 99,241,191,241,125, 25, 77, 47,142, 30, 33,158,115,114, 54,154,110,170, 45, 17,189, 66,236, 83, 65,164,165,169, 85, 24,214, 10, +218,180,213,168,129, 17,112,145,132,203, 35, 48,164,134, 72,228, 48,223, 32,245, 1,248, 28, 80, 3, 7, 44,247, 7, 39,103,159, +190,125,100,251, 54,134, 44,128, 36,208,199,177,250, 41,253, 10,113,254,160,181,239, 59,191,137, 98,232,134, 22, 39,198,237,156, + 49,220, 74,151, 0,210, 0,233,163, 28, 10,167,191,130, 21,169,132,248, 67,228, 12,177, 65, 58,217,148, 27,175, 40,223, 91,185, +186, 1,179,247,139,110, 26,207, 10,179, 97, 33, 29, 54,133, 26, 69,147,188, 45, 38,106, 92, 92,117,200,232, 45, 74,174, 15,219, +238,149,116,126, 9,192,217,181,236, 54, 13, 68, 81,143,199,177,147, 56,202,171,161,161, 32,132,132,132,196, 22,169, 44,248,120, +144, 16, 95,192,130, 93, 17, 17, 80, 74, 72,154, 16,199,111,143, 61,220,115,199,118, 29,181, 27,144,186,171, 18,219,227,201,125, +156, 57,247, 28,231,159, 96,153, 46,242,174, 27,207, 13,171,163, 40,128,131,108,233,154, 49,199, 7, 11, 95, 94, 71,215,220, 83, +106,169, 17, 15,173,233,147, 9,169,182,148, 22,230, 70,101,115, 9,217, 81,142,228, 56, 44, 81, 26,243, 31, 20,169,192, 63, 4, +213,144,190, 49, 99,159, 79,209, 64,111,109,251,210, 85,255,185, 79,229, 47, 77,123,161,181,245,208,123,106, 63,233,128, 69, 75, +165, 92,222,166, 0,100,117,216,152,112,197,192,232, 52, 24, 49, 8,116,236,142,108,220,190, 44,219,163, 95, 14,208,141,138,218, + 80,161,216,109,210,182, 27,129, 12, 67, 13,169, 3,252,196, 91, 28,178, 45, 47, 40,183, 4,200,242, 0,112, 42, 7, 31, 21, 14, +133, 9,202, 14, 94, 72,197,134, 18,187, 40,167,146, 69, 14, 68, 89,178,184,139,221,155,140, 61,168,211, 22,229,212, 31, 76,125, +191, 80,217,197,242,124,243, 99, 21,236,213,175, 29,184,244,170, 0, 75, 66,179,164, 11,184,148,117,111,136,188,199, 79, 96,172, + 99, 88,224, 86, 48,225, 72, 72, 10, 70, 20,110,234, 23,100, 75, 93,149, 29,181,108,110,163,109,199,117,122,105,153, 24,160,155, +106,153,133,191,220,134,235,130,242, 31,242, 26,131, 37,186,129,178,132, 80,240, 18, 20,218, 84,167, 40, 91,144,254,254,132, 91, +211,222,184,142, 75,209, 25, 71,148, 42, 49,106,239,230,116,107,232, 80,115,173,152,127, 84,111,194, 56, 15,191,109,227, 81,127, +212,117,110, 96,130,115,213,199, 16, 50, 55,224, 26,205, 29,237,147, 92,229, 56, 56, 0, 83,130,121,110, 48,251,222,157,141,151, +187,227,198,239,251, 34, 1,248,170, 10, 21, 68,161,210,229, 54, 90,179,145, 11, 60, 65,151,179, 39, 81, 26, 82, 25, 53, 29,142, + 87,155,175, 14,172, 90,228, 49, 9, 60,183,151,194, 74,208,138,210, 68,195,136, 17,145,135, 91, 6, 92,139, 22,197,195, 8,238, +193,180, 66,204,240, 43,146, 44,166,125,171,108,176,102,103,254,236, 16,237,207,198, 11,138,104, 73,150, 60,157, 63,163,231,141, +178,184, 68,115,133,179, 67, 90,141,199,211,243,159,251,107,244, 28,121,161,100, 62, 27, 76,163, 52, 70, 63,216, 32, 54, 92, 79, + 26,223,105,186,220,224, 54, 61,246,113, 22,101,251, 66, 78,250, 30,194,189,133, 35, 90,216,138, 10,122, 47,185,211,243, 95,189, +120,254,225,243,167, 36, 77, 36, 40,197,208,179, 61,170, 34,133,211,139,190,202,211, 19,131, 55,140, 28, 43, 3, 45,160, 26, 80, +119,227, 66,177, 14,130,213, 97,115,184,125,247,241,253,219,215,111,254,163,126,207, 42, 53, 26,250,105, 4,219,116,218, 93,198, +186, 26, 50,133,172, 31,119, 76, 24,235,211,212,248, 20, 37,227, 33,204, 24,145,170,202,204,253,240,228, 19, 35, 39,130,182, 65, +102,226,102,207,150,143,230, 23, 95,110,174,232,127, 92,170,235,203,151,151, 55,251,245,245,238,123,141, 25, 50, 19,162, 13,232, + 54,135,101,166,195,213, 36,239,170, 59, 6,106, 14,228, 12, 71, 89, 24,145,112,253, 59, 88,115,217,110,215, 13,174,168,205, 88, +173, 19,158,250, 9,187,154, 22, 46,209,105,165, 27, 16,216, 60,170, 96,106,130,168, 17, 31,243, 29, 97, 17, 80, 82,159, 12,231, + 44, 81,135,136, 31,177,164, 48, 40, 33,213, 29,239,187,141, 72,229,189,136,223, 53,174,250, 43, 0,103, 87,178,219, 52, 20, 69, +253,158, 29, 59, 78,156, 57, 77, 65,180,180, 2,169, 72, 72,172,216,179,132, 21,127,193,199,241, 9,236, 88, 34,245, 3,144,232, + 10,165, 12,165,169, 51,217,113, 60,155,123,238,243,144,178,170,200, 50,147,146,231,235, 59,158,123,142,241, 31,242, 76,226,222, +206,170, 34,239, 45, 42, 73, 85,163,196,194,243,216,187,104,198, 20, 77,139,136, 17,222, 0,201,152,140,147, 1,185,101,243,186, + 48, 0,230, 17,117,151, 65, 47,187,237,138, 28,152, 27,187, 72,163,208,112,151, 76, 89, 10,182, 23,136, 24,163,245,206,104, 25, + 97,106,122, 84,236, 36, 88,129, 42,150,136,202,187,215, 74, 93,178,198, 30, 85,201,123,246, 0, 65,240,138,192, 71,237,211,178, +197,163,154, 45, 25,177,248,231,145, 7,230,101,125,164,188,148,119, 20, 70,203, 34, 59,164,138,150,124, 89, 26,134, 44, 79, 41, + 89, 91,155, 21,193,178,172, 62,152, 74,202, 24, 46,125,145,252, 41, 35, 51, 71, 2,250, 84,202,125, 98, 28,130, 46, 41, 79,165, +178,132,114, 94,186, 1, 54,251,125,146, 42,173, 40,105,181,144,109,181, 77,243,104,208,142, 2, 58,195,228,116,122,124,113,254, +184, 63,116,204,150, 17,218,246,119,207,101, 0, 25,224, 0, 88,247, 82, 89, 46,175,134, 80,138, 36,185, 39, 3, 46, 7,254, 47, +172,166,166,168,242, 10, 48,150, 97, 94, 82,170, 89,209,135, 29,123,192,204, 1, 69,195, 7,138,111, 74, 69,141, 39,213,164,221, +182,165, 47, 42, 19, 47, 23, 6, 44,179,107,235, 22, 22,243,196,191, 21, 30,175,249, 97, 34, 48,118,166,228,245, 32,153,107,144, + 83,219, 15,123, 99, 47,240, 52, 70, 38, 81, 81, 66,133,199,233,232,236,199,242,154, 92,222,172,127, 60,135, 64,163, 70,217,116, +201,183, 93, 90, 14,102, 51, 41, 15,189,212,205, 91,210, 97,105, 12,206,145,166,208,130, 32,217,177, 33,233, 12, 94, 21, 17, 57, + 8, 33, 46,102, 47,190,253,254, 74,209,229,217,209,243,109,180,221,250,107,180,219, 40, 92,165,113,175, 51,216, 4, 27,176,196, +164,133,110, 2,227,232,250,119, 26,183, 0,148, 94, 29, 29,198,160, 51, 32,139, 92,172, 23,237, 54,213,212,216, 3,200, 50,159, +171, 47, 80, 86,232,204,201, 51,114,198, 75,223, 77, 18, 80,196,121,225,134,158,217, 4, 91, 1,134, 65,208,159,165,200,143, 99, +250,197,113, 30, 14,157,137, 23,172,126,174,126,209,165,137,147, 72,210,165,143,139,254,100,120, 50, 61,153,223, 94,131,125,133, + 9, 91, 41,179,233,153, 84, 90,173,200, 46,158, 56,143,174,150, 55,172,229, 34, 85,130, 3, 45, 21,232, 5,242, 54,160, 20, 20, + 29, 95, 61, 61,251,240,254,221,203,243,217,199, 79,159, 39,166,109,160,233, 7, 64, 47, 86,240,216,241,196, 89,238, 38,113,152, +166, 95, 22, 55, 49,118, 59,180, 6,174, 39, 14,241,196, 70,127, 52, 32,251,232, 10,251,237,235, 55, 7, 89,212, 67, 31,126,186, +247,162,221,172, 55, 33, 75, 14,115,128,148, 84,119,194,148, 58,157, 9,231,125,106, 2, 4, 75,109,153,150, 99,245,111,253, 91, + 38,123,199,141, 66,230, 58,116,198, 84,183, 5,225,142,138, 88, 21,230, 40, 82,206,239,230,116,123,244,218,221,125, 20,210,219, + 46,175, 46, 25,254,161, 23,226, 64,155, 67, 37, 78, 60,145, 25,117, 70,235,157, 43, 16,158,239,233, 85,107,213,228, 82,245, 45, + 75,218, 25,118, 39, 85, 33, 81,168,239,200,107, 32,163, 86, 59, 21,209,228,211, 26,111,137, 97,124,198,253,193,198,179, 43,142, +131, 74,127, 85, 49,200, 0, 58,148,187,190,171, 20, 86, 21,123, 41, 29, 76,156, 69,106, 65,178, 33, 17, 43,253, 70,179,221,154, +215, 17,165,234, 14,253, 21,128,177,107,233,109, 34, 6,194,222,151,119,235, 36, 60,218, 82, 74, 75, 91, 65,149,182, 28,184, 33, + 33,241,111,249, 23,156, 56,163,114,227, 33, 30, 82,105,212,180, 18,148,100,147, 52,201,166,217, 93,219,204,195,217, 77, 17, 72, +149,114,136,162,200, 89, 59,246,204,120,230,155,239, 11,111, 99,214,197,191,216, 8, 22, 53, 85, 78,142,123,142, 29,140,112,130, + 24,206,219,192, 91,198,203, 56, 46, 0, 76, 79, 32, 94, 25, 91,106, 48, 4, 43,245,220,214,240, 6, 94,152,128,188,171,112,242, + 76, 53,255, 59,178,238, 98, 11, 14,137,137, 98,122,154, 37, 51, 44, 81,157, 80,140, 75,122,133, 72,126, 48, 70, 98, 41,140,225, + 90,113,107,144,165,162,166,161, 88,162,155,184,225, 96,151,235, 4,124, 22,236,255,124, 30,229,171,117, 61,177,122,161,241,149, + 19, 75,184,107,215,162,158, 52, 43, 8,201,238,209,164, 12, 43,252,217, 36, 82, 37, 54,173,104, 78,106,153,229,125,197, 16,111, +164,237,160,110, 92,143,212,254,192,210,107,146, 44,194,226,112,152,205,203,175,195, 9, 92,189,189, 40,246,176,175, 8,118,115, +112, 87, 73,137,204, 12, 94,195, 15,149,138,132,148,207, 15,158, 70, 82,199,129, 15, 70,127, 62,186,158,206, 74,188,121,184,132, + 45, 88, 99, 43,173,106, 6,205,208, 79, 18,178, 3, 62, 21,184,174,202, 65,154,247,137, 71, 37,208,142,167, 7, 57,253,168, 88, + 96, 29, 9,179,166, 43, 41,229, 55,105,255,161,116,173,229,127,158,193,186, 86,119,123,157,149,112, 5,243,206,158,173,160, 86, +215,121, 86,120, 8,197, 15, 57,225,225,110,171,148,210,162,249,239,111,236,119,123,103, 48,224,116, 54, 65,179,104,169,146,134, +197, 1, 95,197,141,146,216,165,206,251, 29, 24,113,150, 79,134, 89,196,155,108,103,125, 23, 44, 62,117, 12, 34,169, 36, 24,107, + 24,142,229,208, 88,232, 6,153,195, 61,184,213, 97, 46,101,140,217, 18, 44,204,194,143, 23,182, 28,101, 67,248,210, 52,159,192, +178,156, 15,206, 97,215,117,122,157,128,146, 57, 96, 92,148, 47,231,230, 26, 66,182, 7,205, 53,120,218,195,237,195,227,239,239, + 96, 15, 15,198, 41, 60,203,203,246,139,227,147,247,224, 15,168,164, 81, 34,127,145, 8,218,143,219, 74,170,211,203, 83, 8,201, +159,108, 28,124,185,248,108,168,148,146,163, 3, 45, 10,148, 48,180, 43,145, 2,187, 12, 46, 4,149, 41,177, 39, 62, 34,134,194, + 43, 54, 32, 88, 86,102,252,131, 64, 58, 9,240, 25,155,247, 30,254, 26,161, 16,249, 9, 17,106,162,118,152,231,184, 74,137, 67, +177,164, 2,189,137, 2,185, 26,223, 57,155,246, 33,132, 55,172,105, 81, 67, 1,240, 76,194, 58,252,184,188,248,214,233,126,186, +252,249, 97,240,123, 83, 54, 98, 31, 21,193, 84, 20, 53, 67,217, 74,100, 28,224, 85,120, 11,222,135,178, 87,228, 31,123, 72,159, +233, 81, 27,142,182, 55,100,236,164,136, 69, 83,236,108,111,153, 80,139,163, 4, 62,121,251,250,205,163,246,238,179, 87, 71,183, + 55,241, 6, 86,190,204, 74,226,237,130,165, 40,168, 65, 63, 71,209,156, 42, 60, 35,212,138, 64,105, 41,130,202, 96, 40, 69,148, +191, 8,127, 5,183, 87,234, 66, 11,189, 84,236,227,170, 40,193,192, 12,110, 43, 27, 44,240,112,130, 93, 0, 5, 2, 70, 44, 80, +133, 6, 51,102, 86, 7,174, 55,180, 66,202, 85,234,220,214, 17, 84,242,217, 37,254, 59,176,193, 42, 81,240, 0, 25,237, 49, 24, +236,126, 99, 45, 29,227,157,123,173,181,158, 78, 83, 91,145, 17,240, 37,192,165, 51,204,130,220,209,176,174,192,194, 37,240,201, +170,144, 26,254,222,234,222, 89,122,234, 90,161,184, 60,192, 86,204,212,186,164, 11,137,146,191,172, 52,103,248,221, 44,254, 8, + 64,217,149,244, 40, 17,132,209,234,110, 26,154,109,128, 65,150,113,152,209,120,240,247,250, 95, 60,121, 55, 38, 30, 60,168, 49, + 99, 98, 32,179, 36, 12, 3, 3,205,210,208,244, 86,229,183, 84,177, 68, 52, 17,110,144,244, 86, 93,223,250,190,247,114,255, 54, +235,127, 51,238,134,229,145,217,145, 73,176, 72, 11,212,146,206,165,208,173, 11,219, 20,222,177,107,224,240,163,193, 72,150, 70, + 85,121, 20,157,209,157,182, 89, 2,135, 46, 26, 9,220,109, 67, 72,102,105, 44, 13,143,134, 48, 96,131, 78,132,249, 41,236, 0, +103,141, 60,209,162,232, 34,249, 9,108,133, 89,188, 76, 36, 38,107,152, 11, 39, 33, 87, 32, 14,128,126,167, 3, 12,101, 60,161, + 50, 58, 94,186, 93, 76, 67, 57,112, 40,235, 68, 30,116,212,109, 54, 40, 13,205,105,195,202,186,204,236,204,100,165, 90,122, 69, +218, 60,212,192,242,146,135, 64, 82, 77,242, 44, 69, 38,180,176,183, 68,204, 95,113,155, 4, 14,248, 69, 39,203, 11, 79,202, 24, +226,192,167, 56,170,214,138,215,149, 26, 4,195,224,247, 96, 87,108,162,196,149,142,138,236,114,193,170,230,113,236, 11, 69, 51, +112,254, 46, 43, 86,171,219, 85,252,173,255, 8, 79, 44,197, 79,140,112,172,204, 43,169, 51,215,202,161, 76,137, 92, 6,176, 11, + 32, 42, 69,100,122,185,227,245, 46,138,151,191,130,159, 81, 22,130,177, 67,235, 97, 33,187,127,182,123,244, 22,152,206,208,225, +107, 36,127, 94, 47,159,195,239,243, 96, 74, 84,215, 5,154, 10,166, 66, 59, 56,221, 44, 43,185, 85,236,230, 18, 93, 59,124, 33, + 10, 11, 66, 31,197,178,115, 57, 42,152,168, 86,181, 61,223, 44, 88,198,230,118, 50, 96,150, 39, 11, 17, 65,158, 10,113,231,172, +163, 21,156,172, 83,107,143,252, 71, 72,143, 60, 68,193,218, 97,178, 94,134, 11,236,182, 42,245,240,124,103,248,244,144,172,220, +226,225, 65, 75,115, 47, 51,124, 23, 86,163,152, 47,129, 53,191, 60,239,205,214, 83, 68, 70, 38,155,132, 39,218,149,238,164, 5, + 91,196,158, 7,225,138, 95, 8, 76,151,136,148, 7,238, 18, 34,119, 88,144, 79, 55, 31,137, 38, 5,245,118,211, 40, 29,206,199, +184,194, 68, 24,194, 83,111,142,227,194,243,189,121,248,146,115,208, 57,117, 27,237, 84, 37,131,209, 64,154,205, 72,165, 18, 65, +116, 61, 60, 80, 96,195,109,246, 26,215,183,207,125,228,217,177, 84,183,254,210, 95, 78,225,104, 99,154,108,170,151,154,203,205, +124,232, 15,203,133,114,140,157, 9,156,106,176,109,253,126,218,130,134,206,212, 22,114, 8, 36, 57,203,210,183,205, 43,176,239, + 41,178,211,106, 13,104,146, 13,197, 59, 76, 80, 55, 53,251, 58, 25,188,123,255,225,243,253, 15,180,209,176,182, 16,188,227, 80, +133, 83,176,221, 70,228,189,168, 64,108,144, 39, 0,138,122, 85,169,125,159,140, 76,163,239, 56,118,135,243,138, 24,222,142,215, + 87,215,154,122, 88, 88, 65,176,122,211,189,248,175, 18,205,116,229,119,206,154,187,225,193,124,206,109,213, 90,253,167, 62,138, +215,199,219, 4,107, 92,130,245,211, 36, 51, 32, 97,158,139,211,121, 5,199, 75,179,112,190, 93, 40,147, 61, 31,105, 95, 96,225, + 46,220,203,185, 9,157,110,107, 19,152,106,183, 71,100, 53, 98, 17,250,132,142,144, 76,177,126, 8,156, 67,172, 29,216, 24,105, + 84,220, 48,226,214,125, 12, 93, 62,226,238,140,212, 61, 81,248, 99,188,156, 8,245, 7,182,154, 61, 9, 69,223, 58,158,179, 33, + 32,171,249,235,217,206,101,202,189, 54,183,186,159,221, 73, 42, 0, 25,190, 44,197,160, 76,235,116,224,105,142,160,246, 8,121, + 94,171,223, 2, 80,118,117,173, 77, 67, 97, 56, 57,249, 60,105,186, 78,187,110, 10,122,161, 14, 5, 81,113, 34,226,141,254, 11, +255,129,151,254, 46,111, 4,193, 95,224, 24, 40,136, 8, 94,201, 24,187, 24,115, 83, 54, 43, 93,211, 38, 77,210, 38,199,247,121, +223,100, 84,119, 37,132,194,218,174, 31,167,231,253,126,206,243,168,255, 34, 36,104,173,219,156, 59,119,186,117, 25,205, 2, 24, +131, 21,118, 84, 28,171,110,164,186, 29,167, 27, 57,218, 7,173,150,235, 25,218, 47, 62,253,233, 1,235,226,185,116,163, 60,232, +240,218,210,143, 1,157,238, 57,157, 2, 93, 1,101,158,152,250,186, 6,238,222,145,202,128, 9,103,128, 67, 97,250, 93, 70,149, + 56, 48,108, 62,231,143,116,186,145,110, 49, 54, 58,215,220,197,235,175,172, 11, 23, 92, 3,131,181,132,249,255,226,218,160,234, + 95, 94, 38,202,250,125, 39,148, 85,114,193,101,232, 94,104,197, 95,188, 26,181,214,181,120,176, 12, 65, 53, 77, 1,199,204,239, +104,168,218,242, 97,210, 34,133, 42,136, 68,118,158,207, 55,151, 40, 7,240, 93, 50,154, 72,203, 68,224,183, 6,152,247, 82,182, + 87,232,186,131, 72,107,199, 55,115,119,158, 59,245,204, 55,101,144,164,117,140, 26, 54,224, 61,100, 83,212, 59, 57, 29, 66, 78, +118,148,236,124,248,108, 24, 81, 78,222,252,254,181, 71, 87,163,205,110,213, 43,230,197,184, 72,102, 21,213, 1, 25, 5,194, 89, + 53,203, 23, 89, 86, 78,199,197, 40, 80,254,237,222, 29, 36,216,144,159, 86,180, 17, 37,100,247,194, 21,133,222,154,180,211,177, +180, 92,228, 90,227,108, 68, 30,211,112,247,205, 3, 9, 35,215, 25, 22,116, 76, 64,172, 81, 66, 59,147, 57, 54,240,221,178, 98, +194,130,219,208,214,224,164, 72,253, 74,135, 53, 83, 69, 9,144,148, 83,121,172, 88, 62, 47, 40, 9, 59, 25, 31,243,128,212, 80, +234,250,224,198, 67,230,105, 41,233, 21, 86, 59,125,153,178,180,154,187, 10,153, 29,133,186, 50, 19, 30, 44,200, 13,130, 27, 0, +232, 29, 6,104,194,125, 60,187,251,188, 0,117,165,154, 20,147,146,231,156,173,110,113,163, 96, 28,248, 96,106,123,188,249, 36, + 12, 52,197,227, 73, 62,193,140,142,109, 71, 65, 22,204, 29,244, 54,232, 71,184, 20,175,121,158,127,248,251, 16, 69,153,109,207, +242,169,246,180, 13,118,217,156,210,255,141,213, 43,190, 71, 91, 72,109,127,219,222,251,177, 39,115,118, 10, 84,145,175,203, 69, + 65,225,144,101, 25, 48, 2,161,112, 27,184,122,247,120,151,182, 28,217, 6,125,242,179,244, 44, 10, 99,246,223,118,172,227, 57, +231,230,100, 95,113, 16,147,209,196,186, 35,211, 8,158,242,160, 10, 54,136, 25,166,100, 47, 75,145, 62,240, 59,215, 59,125,176, +135, 3,127,140, 45, 5,122, 4,230,126, 6,167,187,109,232, 61, 18,144, 56, 80, 2,110, 21, 6,140, 14,217,162, 56, 43,242, 97, +158, 30,165,201,207,105,194, 34,233,166, 88, 44,214,189,112, 37,234,136,228,179,250,203,147,112, 10,106,205, 15,190,236, 15,167, +163,239,167,199, 71, 95, 15,232,177,247, 31,119, 94,191,123, 75, 15,109,109, 61, 13,245,106,139,195,248, 39,117,116, 35, 61,184, +117,243,222,203, 23,175,118,222,124,234,235,203, 14,134,219, 62, 55, 46,113, 98, 4,123, 3, 78, 1, 99, 24,230,186,198, 33,188, + 18, 26,122,232,203, 83,176,172,216,215,103,128,234, 50, 86,178, 54, 45, 32,189, 61, 16,218,234,105,154,101,203,106, 18, 97, 65, +196,183,165, 65, 37,134,213, 88,156, 12, 25,154, 99, 83,237,255,123, 10, 32,218, 74, 64,195, 12,144,172,161,243,165, 27,236, 74, +163, 44,108, 13, 39,167,117,219, 86,110,153, 8,204,210,187,215,204, 54,130,200, 84, 9,138,196,128,237, 82,226,110,221,240,251, +200,121, 44, 97,254,104, 40, 34,219,208, 36, 92, 6, 75,105, 40,131, 69,151,190, 52,223, 99,213,230,156,208,153,159,252, 71, 0, +190,174,165,181,137, 40, 10,207,157, 71,230,145,166,147,152, 82,155,166,150,210, 10, 90, 92, 88,116, 45,130,107,151,174,212, 69, + 17,113, 37,254, 68,151,190, 16, 81, 42, 72, 37, 82,106, 65, 72, 82,218,166,243,186,243,184,115, 61,231,220,153,105,170, 98, 24, +200,102, 66,230,222, 57,231,220,243,248,206,249,244,255, 91,118,114, 96, 85,123,209,188,113, 55,216, 69,114, 6, 25,174,193,203, +115,153,103,106, 22, 68, 58, 65, 17, 4,197, 12, 49, 9,165, 59,244,214,250,110,223,196,153,231,150,103,123,200, 30, 10,142,130, +180, 91, 26,130, 26, 77,156,130, 72,160, 63, 76, 65, 24,138,177,176,102,113,178, 84, 46,201,164,108, 62,101, 44, 84, 84,128, 97, + 41, 85, 25,181, 42,149, 77, 78,133, 65, 83,200,225, 81, 83, 17,135,249,169, 32, 68,193, 36,252, 85,148,106,152,120,221, 51,166, + 72, 14, 47, 85, 32, 40,210, 52,157,249,165,163,230, 83,226, 8, 14, 39, 46,242, 40, 79,216,188,215,242,111,251, 46,137,155, 93, +140,195,169,248, 19, 71, 89, 15,223,167, 81, 21,136,149, 21, 76,107, 72, 92,202, 75, 23,150,192,234,143, 34,159, 41,101,157,220, + 70, 50, 48,161,236, 44,120,149, 60, 23, 81,140, 87, 18, 67,232, 42,115, 14, 17, 41,235, 56,160,255,166, 99,107,176,215,110, 11, +172,138, 22,156, 77,190,125, 29, 69,113,106,176,170, 79,227,227,254,151,147,227, 89, 84,112,100, 50, 41, 65,149, 5, 9, 32,126, +229,154, 72, 69,202, 11, 88,127,208,179,122,139,102,143,158,154,113, 44, 9,162, 79,156,101, 41,209, 9,168, 73,206, 76, 65,129, + 28,195,198,209,246,248,114,192,217, 47, 51, 44,148,105,196, 81,213, 2,215, 31,199, 32,235,132,133, 34,178, 20,157,160,196,244, +115,253, 74,123,137, 0,130,186,234,176,213,213,248,200, 58, 6,130, 29,192,193, 62, 58,179, 13,219,214,237,171,254, 0, 92,227, + 15,223,223, 73,194,148,242, 44, 4,175,246, 47,161,213,151, 58,125, 67,107, 16,110,178,235,117,183,135,219,219,195,155,146,144, + 60,185, 72,127,140, 71,224,175, 97, 61,151, 68,192,165,177, 57,141,101,128,101,122,150, 7,135,205,225,244, 32, 77,147, 58, 29, +133, 92, 52,212, 13, 80,242, 52,155,204,198,160,165, 63,143, 15,219, 78,155,122, 0,116,175,213, 6,129,140,178,144, 38, 40,163, +106,128,204,103,121,134,252, 79, 32,252,166,233, 88, 14,200, 18, 28,234,235, 75,235,139,174,191,181,178,233,123,139, 60, 79, 58, +190,255,232,225,147,233,108,138,126, 34,188,211, 20, 15,188, 44, 79,207,249, 12, 17,186, 76, 15,227, 40, 74,130, 65,127, 5,194, +180, 73,128,156,230, 1, 79,184,160, 2, 35,229,108, 23,236, 54,102,135, 40, 37, 86,146, 3, 25, 23,217,181,238,170,192, 76,180, +172,132, 31, 73, 77,153, 58,163,104,246, 51,248,182,153,178,213, 5, 18,121, 8, 65, 25, 30, 56,198,226,148,143,195,104, 2,226, + 34,193,158,226,237,119,250,203,212,203,214,112,221,203,102,220,212,192, 29,108,220,189,190, 51,220,186,189,121, 99,109,103, 99, +217, 91,125,112,255,222,238,203, 93,216,144, 79,239,223,190,122,252,162,190, 19, 25,222,248, 57,255,252,122,111,173,115, 43, 58, +136,162,120, 50,122,179,247,252,233,179,163,253, 35,136,201,224, 77,128,138, 97,101, 72, 43,121,206,207,176,244,226,156, 68,167, +216, 56,202, 20,234, 28, 3, 65,223,237, 57, 45, 71, 72, 50,250,148,221, 80, 84,165,213, 25,160, 12,104, 99,151, 43, 29, 98, 23, +250, 89,149, 53, 27, 4,112,117, 79, 3,125, 20, 40,108, 22,230,244,221,158,106,203, 83, 0, 55, 56, 72, 18, 8,113, 9, 29,137, +245, 92,114,201, 60,167, 93, 99, 46,105,135, 5,253, 5, 83,255,142,155,153,203,130,240,176,178,185,170,231, 81,201,122,169, 58, + 84,137,163,146, 44,123,227, 54,194,219, 89,112, 58, 74, 9,176, 73, 72,178,249, 14, 29, 90, 71, 53, 57, 94,177,194, 54, 87, 89, + 79, 53, 43,231,108,255,111, 1, 8,187,150,221,166,129, 40,234, 25, 39,117,146,214,161,168, 45,106,171,116,211, 13,106, 97,195, +130,199, 31,176, 64,226,107, 96,201,247, 32, 54,236,248, 1, 36, 36, 64,149,186, 96, 1, 18,162, 82, 66,146,198,141, 83, 55,241, +216,142, 95, 99,238,195,118, 90, 30, 34,139, 72,150, 37,203, 30,123,238,251,156,243,255,250,123,187, 97, 41,132,216, 85,188, 34, +101, 77,166, 12,168,137, 20, 81,118, 77, 27, 5,154, 69, 82,181, 24, 32,246, 76,220,212, 53, 67,113,188,125,100,216,198,153,127, +166, 18,101, 73,140,140,114,137,211,138,216, 81,134, 79, 26,185,144,115,196,205, 23,220, 77,224, 57,112, 48,100,218, 66, 22,154, +154, 5,158, 60, 0,247, 23,105,100,149, 51,240, 8,129,245, 13,226, 65, 90,219,104,182, 97, 17,251,234, 44, 39,238, 80, 77,131, + 48, 16, 94,234,156, 69, 80,180, 40, 87,161, 76, 94, 68,173,231, 65, 90,186,198,111,173, 96,106, 29, 66, 60,149,165,217,159, 84, +104,255, 40,240,148, 14, 93, 34, 17,159, 22,215, 56,215, 48,189, 47,144,215, 2, 30, 34, 69,207, 33, 74,128, 67,229, 99,101, 85, +171,211, 85,167,160, 18,136, 97,171,140,203,220,144,112,101,156,105,129,135,223,234,182, 8, 60, 77, 2,135, 77, 36,251,237,104, +216,192,102,199, 2, 11,155, 90,230,218,254,222,174,191, 8,183,109, 91, 93, 76, 7,142,147,194, 89,140,201,112, 86,180, 43,111, + 99,115, 9,101,152,204,148,225,208,132,170,166, 34,186, 70, 2,116,120,125, 57, 74, 95,246,236,222, 87,207, 69, 62,103, 66,228, + 18,153, 76, 78,161, 50, 9,105, 11,206, 87, 69,103,125, 35,241, 19,190,235,130,114, 29,174,202, 35,219, 66,150,179,100,167, 32, +109, 19, 2, 58,240,204, 16, 38,193,126, 52, 71, 34,185,162,146, 81,148, 28, 79, 72, 67,235, 26, 18,140,133,248,165,130,195,169, +154,216, 45, 59,140, 20, 49, 50,104,242,190, 53, 89,194,234, 7,105,196,245,161,177,121, 52,247, 66, 15,179, 16,164,128,206,146, + 88,135,233,180, 33,132,168, 90,228,104,215, 32,130, 94,179, 90,102,123, 17, 35,184,212, 85, 46, 92, 32, 72, 34,222, 42,146, 76, + 6,246,117,139,180,211, 88, 95, 34, 15,187, 36, 65, 1,237,250, 83, 14,125, 28,223, 97,180, 46, 44, 84,147,106, 68, 99,111, 12, + 39, 44, 97,225,144,187, 16, 42,228,219, 94,246, 47, 6, 16, 3, 77,188,137, 90, 6,176,236, 87,222,229,219,119,175, 9, 7, 97, + 28,238, 30,158,254, 56,101, 10, 77, 30,222,107, 91, 45, 70, 38,143,102, 99,147,160,188,113, 22,223, 59, 56, 30,207, 70, 81, 18, + 50,128, 7,229, 65, 40,208,203,168, 0, 13, 55, 10, 15,123,180,123,183, 63,119,250,139,137,166,225,168,220, 88, 1,220,153, 42, +234, 50, 14, 43,168, 57,190, 20,141, 45, 34, 73, 64,127,225, 39,241, 68, 45, 24,102, 17,102,217, 30, 41,217, 34, 57, 62,225,170, + 88,210, 24, 2,135, 60,205, 49,129, 54,140,239,206,160,185,222, 50, 66, 35, 8,131, 79, 39, 39, 59,189,125,248,138,157,111, 67, +222,119, 79,238, 63,250,248,229,195,179,135, 79, 79,223,124, 62, 63,191,122,245,242,197,232,106,164,222, 7, 91,221,205,199,207, + 31,252, 28, 66,246, 99,220,217,216,185, 80, 83,216,177,224,109, 32, 72, 7,203,142, 44,192, 20, 62,224, 69, 80,198, 7,229, 92, +162,104, 73, 32, 57,131,169,118,117,197,201,168, 87,130, 69,101,131,177, 44,183, 49, 17, 87,113,163,237, 91, 87,104,110, 96, 42, +171,131, 91,157,205,115, 47,152, 5, 51, 26,231, 50,111, 20, 96, 11,198, 69,226,164,115,160,227, 41, 10,185,228, 92, 65, 33, 63, +128,138,143, 41, 50, 72, 49,243,185,232,109, 29, 12,221, 65,241,247, 54,158,168,205,181,172,171,243,162,180, 5,240, 71, 50, 21, +120, 8,217, 30,188,232,108,133, 12,103, 11, 81, 86,233,235, 7,215,198,170,195,168, 87, 83, 48,232,255,127, 9, 64,215,181,237, + 54, 13, 4, 81,175,247, 98, 39,118,156, 75, 19, 83,144, 2, 45,162,173,196,165, 82,145,144,248, 1,190,131,231,190,240, 13, 72, +124, 4, 2,250, 15,188,240, 1, 60, 32, 33, 33,161, 74, 60,128, 16, 42, 42,109, 41,162, 77, 75,107, 39,182,115,177,151,157,217, +141,147, 22, 17,229, 45,145,227,245,198,158, 51, 51,103,206,177,255, 87,141,153,245,184,199,137, 61, 71,216, 39,134,170,104,102, +154,128, 33,107,123,158, 8, 2,225,251,172, 38,136,139,117, 21,192,245, 11,172, 25,122, 33, 7,229,175,224,126,184,113,179,177, +162,174, 14,168,249, 80,167, 2,222, 47, 21,135, 8, 65, 28, 33,133,186, 13, 84,226, 76,161,122,195,108,176,174, 99, 88,216, 81, +249,163,112,137,203,137, 96, 64,120, 7,205, 84,117, 91, 1, 18, 1,154, 10,136,207,160,138, 23,169, 48,225,169,156,218, 38,187, +241,206,184,200,160,113, 8, 41, 41,116, 47,139,137,158, 26, 43, 80, 68, 95,163,120,139,169,108,131, 87,102,149,124,211, 43,150, +255,152,118, 88,217, 5,228, 62,107,196,206,220, 91, 46,127, 42,113, 64,217,179,231,229,252,141,115, 0,104,120, 1,100,158, 99, +208,151,214,238,197, 92,195,183, 76,232,202, 90, 34,136, 16, 20, 51, 3, 89, 80, 66, 39,178,230,177, 86, 96, 95,109,179,118,147, +119,154,180, 89,167,141, 0, 55,189,176,239,174,173, 93,105,119,154,181, 58,233,167,123, 63, 15,200, 48,162,195, 63,147,244,116, +144,156, 68,201,233,225,232, 91,143,124, 77,233,142,235,238,249,110, 79,176,212, 6,106, 7, 83, 63,194, 49,108, 3,170, 71, 3, +123, 14,154,145, 70, 51,219, 88,155, 19,139, 1,119,205, 19,156,151,254,193,209,224,212,130, 57, 5,123, 58,146,106,108,252, 60, +238, 83, 45,153, 12, 34, 10, 20, 48,172, 69, 37,178,224, 1,234, 3, 59,148,250, 85, 15, 59,233, 40, 8,139, 91,226, 59, 53,206, +156,203, 97, 19, 2,137,140,178, 56,199,113,129,213,107,171,100,122,173,112, 74, 32, 39,198,133, 71,107,188,234, 28, 8, 53,150, +209,254, 22,134, 37, 48,218,250,213, 0, 99, 38,200, 9,116,106, 29, 8, 24, 64, 66,151,235,221,245, 40, 59, 67,230, 28, 60, 15, +195,122,184,224,183,112, 37,197,131,213,135,234, 44, 4,119,150,194, 91,119,186,235, 10,218,227,248, 76,161, 64,185,246, 69, 70, + 9, 88,189,230, 92, 29,182,187,176, 84,115, 3, 76,250,101, 43,104, 91,230,114, 0,137, 81, 45, 56, 25,165, 57, 16, 60,126,224, +132,142, 37, 28,135,115,190,216, 90, 84,223,249,248,125, 91,171, 62, 24, 69,112, 34,227, 52, 78,210,164,159,169,180, 0,245,116, + 16,235,125, 62,248,162,130, 22,231,162,229, 55, 96, 86, 28,173, 32, 29,198, 3, 5,228,185, 80,123,119,156,244,223,238,110,239, + 36,199,177, 53,138,100, 22, 91,234, 89, 62, 76,173, 81,134,239,161,165, 22,204,226, 1,164, 62, 35,212, 97, 53,226,184,186, 99, + 9, 37,157,252, 60,203,122,131, 65, 54, 30,171, 48, 47, 40, 93,242,235,210, 76, 83,162, 25, 26,154,154, 17,155,135, 1, 84, 96, +122,251, 71,249, 9, 76,170, 15,172,243,128, 58,237, 9, 52,138,229,113,236, 83,241,108,243,233,251, 79,239,150, 27,107,111, 62, +188,190,253,232,158, 88,225,125,214,127,254,234,229,230,227, 39, 55, 54,186,234,188, 95,108,109,213,171,222,239,254,145,233, 96, + 25,176, 74,112, 27, 10, 24,198,134,191, 75, 81,113,170,136, 90,137,230,200, 22,134,214,162, 71, 62,115, 93, 85,201,165,161,130, +233, 20,101, 10,222, 13,233, 69,143,241,105, 25,240,139, 56, 94, 26,165, 1,180,136,248,117,118,168, 78,227,122,103,153, 16,235, + 2,236,198,177, 97,135, 85, 21, 42, 31, 79, 80, 13, 31,237, 0,165,174,203, 67,146,157,215, 42, 13, 40,103, 22,134, 72,186,223, +219,149, 37,120, 47,166,199, 50,239,130,232, 59, 30,188,223,140,157,168,113, 45, 71, 64,151, 99, 20, 85,175, 56,139,176,115, 62, +107, 25,150,154, 79, 37,253,124, 50,125,184,203, 57,150,154,156, 10,192,252, 21,128,176,115,235,105, 34,136,226,248,206,118,183, +179,151,210, 11,219, 66, 1, 67, 48, 2,194,131,138, 38, 42,137, 62,248, 1,140,241, 19,249, 98,252, 12, 62,251, 5,124,242,205, +248, 5, 36,129,128,130, 1, 75, 11, 69,177,181, 91,110,219,118,187,183, 25,231,204,236,150, 22, 18, 73,223,250,212,206,158, 61, +183, 57,231,255,187,225,126, 85, 30,213, 1, 70, 49,246, 90, 74,198, 34,101, 44,235, 37, 92,156,206,204,120, 36,232,130, 72,166, +172,145,180, 33,107,166,154, 53,152,193, 1,219, 59, 68, 40,208, 80,122,198,156, 30,199,197,131,243,159, 14,237,169, 17, 48, 45, +136, 12,123,104, 1, 31,214, 99,135,171,192,214,168,156,212, 49, 80,173, 3,155, 28, 20,165, 65, 32, 29, 40, 20,176, 29, 35, 88, +124, 16, 0, 66, 80,160, 77, 27, 42, 11, 21,106, 55,232,214, 58, 71,126,216,167,156,226, 20,145,192,202,151,255,156,254,134,150, +134,152,207,144, 98,213, 54, 1,147, 11,130, 0,221, 60, 15,249,159, 73, 34,154,215,198,221,192,245,163,254,117, 23,239,112,141, +226, 65, 52, 80, 83,152,151,108,145, 76,233,176,112,230, 85,204,161,136,199, 60, 54, 51, 63,178,115,180, 25, 95,171,199,250, 21, + 68, 36,194, 82, 44, 92, 41, 71,204,214, 0, 42, 11, 61, 28,118, 46, 32,250,136, 96,176, 40, 12, 88, 20,213,183,119,126,176, 26, +175,105,183,190,215,154,152,103, 22, 30,161, 44,199,238,199,171, 76, 82, 7, 14,150, 40, 82, 95,199,253,188, 9,253,149,208,207, +144,168,160, 32, 13,177,112,139, 52, 22, 83,187,164, 15,149, 24, 0, 16,233, 64, 88,149,192,122,129, 67,121, 70, 12, 55,138,188, +120, 23, 68,110,190,132, 39,236,149, 39,101, 78, 67,145, 85,145, 77, 25, 88, 99,174,106,126,106,177,210,216,227,232, 86,216, 15, + 96,190,146,121,121, 32,158, 80, 98,101, 96, 72,206,143, 60,199, 61,149,196,186,147,184,177, 78, 78,138,114,216, 55,229,181,209, +222,241,238,192,232,231,138,115,118,247,164,155,144, 16, 80,114,134,197,220, 68,251,188, 37,136,169, 78,207,137,162, 0, 13, 74, + 36, 42,185,196,237,157,185, 38, 54, 85,128, 78,184,107,213,181,116, 74,181,178, 37,203, 44,109,213,215, 5,201, 90, 92, 96,214, + 26, 85,118,248,174,215,179, 47, 90, 8,174,241, 13,216,113,199,152,165,228,229, 66,217,118,108,168, 81,184,189,178, 63,210, 11, +220, 74,115,151, 5,242,213,197,213,253,227,202, 47,251, 80,196,149, 91,214,108,227,188,225,123,253, 20,151,132,166,156, 97,203, +158,248,202,237,123, 27, 7, 91, 39,157,182,144, 90,203,234, 57,246, 74, 91, 99,197, 11,246, 98,195,205, 51, 50,116, 99, 42, 59, +201, 30,235, 97,179, 46,200,189, 57, 51,127,209,115,176,162,251, 48,177,238,233, 41,101,114,172,244,185,246,117,173, 93,185,102, +171,169,161,193, 46, 20,247, 99, 36,193, 11,138, 55, 78,131,209, 17, 12, 62,203, 16, 41, 18,105,187, 29, 77, 81, 44, 16,137, 70, + 15, 10,197, 58,232, 48, 35, 46, 5, 17,178, 88,130,149, 52,139,253,179,179, 51,245,205,234,163,149,251,126, 74,118,255,218,119, +115, 11,243, 11,119,124, 44,149,165,210,250,222,246,214,198,183,143,235,159,222,188,127,203,220,159,133, 38,198,176,181,180,188, +252,228,249,227,165,135,139,175, 94,191,124,241,244,153,148,145,154,155,205, 47,239, 62, 84,206, 14, 20, 62,200, 14, 93, 23,248, +132,188,249, 20,249,208,237,130,120,234,178,178,139,247, 54,113,218,232,137,109, 53, 26, 43,134,195, 20, 44, 15, 82,102,218,244, + 67, 64,220, 37,169,149, 0,107,199, 77, 12,129, 37, 41,232, 5,187,211,166, 67,121, 85,220, 9,148, 18,109,111,110,229,213,230, + 62, 20,154,104,116, 53,157,253, 16, 96,229,146,120,105,132,199,109, 13,107, 93,175, 67,248,203,105,119, 90,188, 99, 22, 35, 92, + 69, 38,159, 8,153,115,192,161,224,208, 93, 18, 1, 17,204, 1,141, 56, 25, 33,231, 33, 15, 84,177,184,169,240, 54,196,112,123, + 65,140, 1, 93,150, 35, 87, 32, 85, 3,105, 47,248,250,159, 0,116, 93,201,110,211, 64, 24,158,241,158,216,113, 26,135,210, 54, +106, 80,133, 20,169, 66, 84,156,224,192, 3,244,206,153, 19,239,193,133, 87,224, 45,184,113,129, 35, 18, 82,225,128,144,224,210, + 86, 66,168,164,180,162,169,210, 4, 55,177, 99, 59, 94,134,249,255,177, 29,167,161,183, 40, 81,226,120,153,249,183,111, 89,240, + 87,255,219,137, 95, 54,222,131,218, 78,206, 39,171,168, 0, 3,214,216, 13,187,230, 88,106,115, 22,251, 94,236,242, 93, 94, 35, +178, 46,233,134,162,171, 10, 36,233,142,110,105,154,129,217, 55, 13,147, 76, 1, 32,240,124, 56, 27,206,179,224,122,206,203,225, + 88, 42,166,243,112,123, 73, 90,104,129,137,113,130, 88, 99, 80,233,129,123, 3,120,144,233, 26, 32,223, 21,141,239,240,240,126, + 58,158, 79,230,233,140,160,181, 4, 50, 40, 69, 14, 18,167, 40,129, 91,144,231,217,106,211,157, 45, 97, 37,233, 10,214, 40, 63, +251,234,140, 34, 91,160,101,132,210, 3,187, 37, 72,200,139,137,235,226, 64,146,180, 18, 50,104, 69,126,141,145,100,231, 78,175, + 63, 58, 41, 14,135,121, 46,200,178, 96, 43, 12,166,216,160, 50,163,195,116,154,110,116, 28,144,253,149,169,170, 2,253, 75, 81, +232, 60, 6,131, 34,147, 41,145,159,216, 53,173,150,165, 13,150,189,253,122,172, 20, 56,170, 20,255,127, 92, 33,106,201,149, 23, + 9,182, 59,116,149,152, 42,113,180,182, 45,111,119,205, 93, 95,138,126,185, 71, 94,232, 34,213, 44, 43,106, 17,204, 70, 0, 9, + 4, 73,145,109, 58,188,132,244,195, 25,234,226, 8,170, 18,180,146, 55, 91, 91,103,163,223,130,118, 79,115,201, 38, 88,151,117, +163,209, 50, 91, 65,228, 95, 7, 19,254,217,230,218,214,165,123,129, 27, 23,236,143,134, 98,128, 6,100,201,138,206, 33, 76,176, +248, 45,221, 10,147, 16, 49,141,165,103, 13,166, 99, 20,219,118, 57, 79,138,224, 5,131, 24,163, 41, 6, 8,117, 65,235, 22, 3, + 10,210,146,219,117,199, 5, 11, 70, 36,103, 84,236,219,132,129, 23, 63, 67,219,106,142,167, 35,161, 25, 84,202,214, 96,228,100, +133,113, 58,100, 57,182,217,156, 4, 19, 89,180,227,168,180,179,126,191, 63, 60,145, 17, 52,198, 51,107,126, 9, 58, 78,119, 60, +189,242,163, 28,226,201, 15,179,255,104,255,224,248,128,255, 26,255,174, 59, 25,199,105,252,176,187,119,120,126, 40,161,122, 37, + 62, 73,172,183,209, 59, 31,157,193, 96, 57, 9, 91,245, 53, 30, 17, 51, 42,200,212, 64,219, 65, 23, 69, 8,171, 2, 79,202, 11, + 19, 93, 82,174, 38,127,223, 15,190, 21, 79, 93, 74, 22,175, 86,160, 22,112,167, 53,192,254, 50,169,104,249,166,120,231,227, 50, + 65,172,194,215, 77, 34,173,233, 70,215,106,238, 58,235, 31,135, 23,103,222, 52, 1,155, 98,182, 34,211,193,220,211,225,211, 7, +143,143,252,254,231, 55,239, 62,124,250,242,242,245,171,155, 11, 98, 70,126,124,255,121,250,231,148, 63,194,198,160,230, 14,220, +228,110,236,116,218, 79,182,247, 94, 60,127,118,197, 60, 94,158, 70,113,212, 80,237,203,233, 0, 61, 88, 99, 89,214,163, 12,236, + 25, 16, 20,159, 97, 55, 50,233,180,239,157, 3,118,150,148,156, 34,150,163, 78, 4,252,154, 73,148,174,210, 23, 73,185,233, 18, + 65, 60,161,172,132,211, 44, 51,236,203,190, 29,169, 8, 38, 46,203,202,102, 86,189,233, 5, 30, 26, 74, 1, 14, 95,240,203,197, +110, 37,148,138, 5, 94,233,134,233, 70, 1, 72,135, 5,100,168, 38, 3,190, 82,120, 75, 82, 9,177,166, 81,179,130, 40, 0, 65, +204, 98, 94,152,229,240,159, 84, 0,241,178, 60, 50, 45,146,247, 2, 65, 83,178, 53, 33, 2,254, 19,128,175,107,233,105, 34, 10, +163,183,115,103,110,103,250, 34, 8,150, 16, 19,218,232,134,132, 29, 91,183,196,196,248, 39, 88, 24, 23,238,220, 24,255,130, 11, +209, 52, 24, 19, 31,193,149,194, 86,255,132,110, 17,113, 67,170, 32, 41,208,118, 74,233,107,218,206,203,239,251,238,204,101, 40, +200,174,139, 54,205,204,157, 57,223,243,156,115, 29,190, 39,110,147,210,245,229,114,218,201,113,162,169,153,144,235, 17,215, 92, + 98, 40, 9, 69, 67, 86,168,155,154,153, 51, 50,144, 98,228,141, 92, 90, 88,150,110,154,186,133,125,252,192,243,176, 31,238, 67, +229,149,213, 13,248, 73,107,212,113,188, 46,196, 6,199,115, 6,110,143,236,205,201, 72, 3,201,106, 17,162, 98,161, 16, 18, 43, +158,161,253,226,194, 92,233,128,152,199, 41,202,251, 8,106, 40, 19, 20,194,193,201,158, 75,229,153, 71,205, 68,166,192, 61, 25, +225,194, 11,106, 61,255,195,247,212,132, 87,248,165,197,249,107, 24, 81, 81, 96,224, 19, 22,173,209, 95,179, 72, 51,145, 41,107, + 69, 4, 44, 83,100, 33,157,108,245,234,177,106, 49, 2,123,192, 60,137, 92,128,234, 28,135,117, 60, 45, 80,120,160, 48,155,247, +185,110, 64,253,130,210, 59,144,108,107,142,231, 58,174,159, 11,244, 28,210,186,253,210, 84,246,251,222,193,183, 63, 39,153,184, + 67,231,199, 75,156,242,189, 55,232,205,150, 16, 70, 47, 61, 83,246,169, 89,142,115,237,130, 64,153,216,208, 23,105,158,246,153, + 54, 64,154, 75,100,113, 18,219, 35, 32,131, 12,131, 7, 89,197,211, 96, 24, 31,113,193, 45, 56, 77,233, 77, 80, 42,222, 57, 62, +173, 97,237, 66,181,113, 44,187, 45, 7,169,220, 50,196, 16,149, 14,195,243, 92, 73,211,232,228, 85, 62, 33, 27, 32,200, 8, 91, + 40,150,247,235,191, 33,253,197, 47, 69, 52,190, 84, 42, 97,164, 25,119,212,145,228,199,181,104,133, 87, 24, 2, 50,238,179, 65, +155, 19,171,204, 32,251, 17,165, 11, 45, 77,224,134,227, 1, 84,134,163,241, 8,245,232,205,172, 52,209, 46, 22,230, 26,221,122, + 44,197,202,116, 46,166,178, 5,187,103,211,198,126, 20, 75,228, 86, 15,164, 26, 80,166,160,220, 60,117,168,149, 75, 27,132,174, + 70,231,164,124,179,252,183,121, 8,104, 14,103, 7,112,128,235,100,240,228,163,235,219, 44, 4,128, 48,244, 57,186, 92,209,152, + 37,140, 46, 28,174,111,126,122,254,200,174,145, 70,149, 84,116,208,102,242,211,118,223,214,153,148, 59,196,233,147,134,213,155, + 91,117, 59,235,207,222,214, 6,205,106,173,122,255,238,202,135, 47, 27,149, 79, 47, 19, 88,189,193, 22, 87, 89,243,144, 53,161, +226,217,103, 12,114,252, 29,198,126, 49,118,204, 88, 47,129,110,105, 2,125,151, 37,228,195,206,109,252,172, 2,220,208, 51,215, + 29,141,250,175,159, 60,127,188,246,148, 53, 28,199,110,195,213,218,173, 83, 55, 8, 62,111,110,189, 88,175,236,254,216,126,184, +250,232,200,110,110,190,127,119,111,229, 65,229,213,218,226,242,210,237,229,165,160,221,215,110,229,229,121,214,126,214,118,246, +118,251,195,225, 96,187, 11,241, 73,116,220,143, 95,223,140,161,152,241, 80, 95, 19,110, 1,110, 76, 97,191,195,163,154, 62,214, + 6,144, 74, 71,114,123, 17,171, 73, 89, 71,198,106, 26,209,208, 81, 58, 48, 69, 31,120,130, 1, 20, 94,177, 75, 40, 53,151, 46, +233,181,132, 90, 44, 70, 22, 94, 85,199,203, 53,155,120,201, 49,178, 6,100, 42,109, 87,200, 46, 89, 72, 65, 66,167, 37,140, 23, +117,111,100,102,144,212, 22,122, 41,169,248,122,193,118, 79,237,113,225, 88,158, 58, 51,129, 12, 88, 82, 48, 77,169, 26,168, 80, + 17, 40,205,248, 73,230,106,138, 56, 58,236,159, 0,132, 93, 59,108, 19, 65, 16,221,189,159,237,216, 65, 78,226, 72, 81,126, 10, +105, 80, 36, 26, 80,132,104, 34, 20,132, 16, 5,162,162, 70,244, 8, 72, 73, 65, 65, 67, 69, 1, 82, 10, 10,122, 10, 10, 40,160, + 39, 40,132, 46, 21,136,134,134,152,196,249, 97,199,159,179,125,119,235,221,101,118,118,247,236, 24, 36,236,147, 44, 89,150,239, +179,119, 51,111,102,222,188,241,254,203,140,148,118, 34,181,105, 69,193, 20,141, 69,157, 42, 58,183,115,239,164,107, 13,132, 26, + 3, 39, 18, 95,248, 16, 63,246,152,106,196,143,185,232,114, 14,145, 93,150, 6,137,155,128,243,139, 21, 31,142,131, 39, 0,219, + 63,149,155,132,179,107,176, 72, 49,154, 89, 61,226, 81, 76, 59,216, 41,239,154, 94, 5,219,131,234,250,252,160,182,135,140, 84, +229,193, 56,250, 78, 38,149, 14,120,156, 36,194,168, 68,112, 97, 60,187,208,121,209,129,128, 69,252, 93,101,160,125, 36,158, 66, + 91, 71, 90, 2,254, 16,216,167,196,186, 29, 99, 18,255, 89, 60,145,206,144,194,100, 10, 4, 9,153, 41,206, 29, 53,247,117,250, + 85, 17, 11,130, 28, 92,174, 12, 13,162,164, 29, 43, 5, 52,131,233, 85,203, 82,174,208, 4,195,100, 21,132,176, 68,137, 57, 26, + 41,125, 53,231,207, 99, 40,119, 4,118,159, 49,217,141, 68, 39,226,163, 35,206, 68, 54, 51,150,203,126,169, 84,148, 32, 54,198, +225,238,128, 50, 67,154,164, 75,108,123,155, 68,252,198,109,165, 55,139,158,203,179,149, 56,225, 36, 93,154,100, 92,103, 66, 89, +125, 18,115, 55,160, 65,216,165, 49,146,181,124, 87,165,104,136, 98,253,152, 14, 46,165, 30,103,106,224, 96,247,157, 90,179,218, +227, 76, 83,105, 1,216,194, 45, 11,134, 41, 27,168,185, 78, 56, 95,219,165,134,162,158,178,255,165, 51, 64,100,246,221, 0,246, +138,141,254,242,160, 94,193,196, 84, 58, 63,177,143,147,244, 68, 89,110,215,104,102,108, 58,140,219, 97, 28,194,223,157, 25, 41, +170,169, 26,182,194,161,136,249,169,178, 6,174, 38,216,220, 24,142, 16,101,203,122,188,215,236, 52,154, 81, 11, 66,240,152, 69, + 16, 80, 22,243,197, 78, 18, 50,197, 51,100,141,118, 29, 62,199, 71,199,155, 16,146,171, 67, 82,156,173,133,210, 66,185, 86,134, + 59, 80,205, 78,196, 25, 39,198,145, 11, 82, 57,217,247, 61,247,119,171,150, 0,248,192, 98,157,158, 12, 35, 0,184, 73,122, 84, + 63,196, 74, 53, 82,156,213, 29,238, 64,236,226,251,126, 39,106,195,137, 29, 54, 14, 75,197,201,130,151,219, 61,169,232, 50, 48, +132, 11,232, 70, 53,167,131,232,206,145, 72,242,155,151,110,173,172, 93,149,170, 37,136, 60, 90, 39,111, 94,188, 94, 60,187,190, +246,244, 62,122,240,152, 92,190, 75, 94, 17,146,153, 37,108,150, 52, 8,169,161,133,255,137, 91, 25,182, 29, 82,253, 74,228, 22, + 17,207, 16,241,231,136,169,197,162,242,140,235,197, 42, 85, 2,139,158,128, 95,212,151,253,219,143,239,164,210,216,219,249, 53, +179,180, 64,138,133,105, 50, 5, 95,222,168,174,240, 48,220,222,252,180,186,188, 60, 62, 89, 92,188,120,254,246,131, 59, 23,174, + 44,103,188,204,203, 39,207,183, 54,183,239, 61,126, 88,174,236, 46,205,159,155,159,158,187,190,122,141,180,200, 6,251,252,246, +253,187,143, 27, 31,230,198, 74, 61,214,203,120,217, 70,212,210,227, 77,185,126, 83,164,153, 83,253,140,105, 56,100, 58,107, 16, +177, 11, 45,107,225,162,228,169, 37,143,152,222, 59, 51, 93, 67,154,202,165, 51,240, 96,139,148,209, 70, 7,173,225,128, 85,236, +155,201, 83,154, 93,105,100,131,149,160, 20, 50,210,124,144, 7, 88,137, 34,228, 86,234, 29,249,249,180,175,212,222, 55, 61,240, +147,227,176,170,145, 1, 61,205, 93,119,184,158, 97,170,219, 26, 36, 60, 35,133,160, 84,107, 31, 39,130, 13,197,252, 42,212, 68, +132, 1, 11, 54,154,205, 55,149, 98,235,112,129, 48,125,253, 17,128,177,107,215,113, 26,136,162,227,177, 29,191, 18, 54, 43,130, +148, 8,196,163, 64,176, 20, 84, 20,136,138, 30, 68, 3, 45, 21,159, 64, 73, 9, 66, 84, 80, 33,241, 13,252, 2, 18,162,130, 98, + 87, 20, 72, 43, 45,176, 75, 4,217, 72, 72,187, 64, 30,218, 56, 78,198, 30,238,185,227,201, 26, 20, 30, 41,172, 20,113, 18, 59, + 55, 51,231, 62,206, 57,127,196,239,110,133, 41,176, 48,229, 48,132, 69,151, 79,113,224,249, 28,104,182,221,229, 30,151, 50, 79, +124, 86, 20, 8,100, 16,251,113,232,209, 42, 20,215,189, 4,210, 43, 24,132,131,156, 0, 28,236,164,136, 60,116,232, 38,121, 86, +160, 91,232, 28,204,210, 57,244,144, 97, 17, 74,129, 75, 11,253, 88,141, 11,238,137, 26, 71,115,174,201,242, 4, 42,174, 78, 97, +115, 96,123, 7, 88,211,233, 18, 74, 50,101,152,253,111, 75, 69,102, 93, 28, 26,121, 23,127,161,112,233, 10,181, 87, 44, 91,217, +233,184, 26, 29, 5, 15,226,151, 83,126, 39, 75, 73,177, 84,140,185,220,188, 9,169, 41, 71, 89, 43, 22, 51,252,196, 18, 52, 5, +142, 24, 81,112,202,182,145,228,198,191,203,200,149, 45,252, 32,236, 30,120, 26,106,148, 46,197,183,191,118,182, 93,196, 81, 70, +119, 11, 35,217,122,174,244, 36, 43, 38,169,234, 36,193, 90,189,241,226,211,231,241, 92,157,240,130,126,127, 23,170,135,140,133, +232,182,166,149, 66,141,201,204, 23,165, 89, 89, 41,215,196,166,112,235,176,127,178, 20, 99, 70, 2,117, 31,186, 55, 53, 87, 38, +129, 60,214,144, 53,175,179,217, 27, 20, 86,145, 53,103,139, 15,148,198, 76,233,144, 37, 61, 40,214, 9,174,134,126,168,104,141, + 39,212, 44, 89, 1,216,113, 40,193,224,169,157,220,116, 69, 28, 59, 2, 83, 24, 28,171, 75,125, 79,254, 7, 65,121,130, 59, 49, + 74, 91, 95, 75,201,124, 94,122, 93, 84, 75,234, 97, 35,155,165,163,233,200, 24, 93,182, 26,173, 61,216, 96, 90, 47,121, 8,226, + 67,144,203,114, 99, 17, 72, 38,147, 23,165,110,171,214,203,220,196,152,193,132,138,171,239, 6,113, 16,167,217,116,174,166, 64, + 20,218,169,121, 33,143,234, 83,106,114,170,247,173,103, 26, 36, 86, 49,220,204,142, 34,250, 40,179,170,135,216,158, 29, 88, 72, +230, 70,193,138, 62, 24, 77, 81,215,103,153, 73,158,142, 2, 31, 10,178, 0, 48,107,228, 97, 52,208,200, 56, 66,162, 48,161,171, + 77,231,236,235, 11, 82, 88, 3, 36, 47,233, 90,159, 80, 0,254,115,167, 47,188,236,191, 91,223,217,168, 70,219,151, 87,221,147, + 87,207,240,211, 35,226,218, 80, 60,181, 72,125,133,119,111, 7,149, 23,252,222,251, 66, 80, 56,211,226,240, 92,136, 39,119,133, +120, 12,230,137, 54, 53, 60, 60, 66,233, 81,246,189,159, 78, 2,202,182,163, 56,165,248,201, 14,238,220,184,125,255,217,163,241, +143, 97, 62, 43,154,181, 8,252,222, 56,106,174, 54,191,119,119, 47, 94,190,242,102,253,245,241,118, 71,185, 98,174, 20,193,253, +145,202, 30,222,123,176,245,246,227,173,235, 55, 55, 63,108,189,239,110,111,127,221,233,239,117, 23,192,232, 82,251,252, 74,210, +152,100,105, 51, 88, 25, 76,134,180, 37, 35,193, 23,202, 36,130,180, 28,172, 38,173,193,116,100, 84, 38,192,180,193,209,173, 32, + 49,205,158, 49,202, 58,244, 21,149,126,170, 40,109,168,173, 2,222, 98,129, 70,132,177,188,129, 21,150,204, 43, 51, 45,255,161, +149,111,223, 90, 91, 79, 56,254, 18,218,104, 5, 26,148, 93, 29,212,249, 87, 63,175,162,172,107, 66,210, 26,127, 6,110,148, 51, +114,181, 10,119,102,182,245,208,221, 15, 94,134,210, 3, 61,162, 82, 5, 94, 32, 81, 83,159,249, 41, 0, 95, 87,175,219, 68, 16, +132,119,247,110,125,119,118, 28,135,216,134, 20,132, 40, 17, 73, 67,129,120, 1, 30,129, 23,224, 45, 40, 41, 40, 40, 40,169,105, +104, 40,120, 0,168,160, 66,130,158, 34, 66, 74, 20, 68, 18, 34,172,224,252, 0,177,115,246,222,222,222, 50, 51,187,235, 88,178, + 21,203,178,236,213,157,239, 78,179, 59, 51, 59,243,205, 55, 49,187, 46,236, 62,113,222,253,167,235, 6, 21, 32, 52, 81,168,149, +178, 33, 99,235, 20, 30, 97,173, 8, 43,194, 75,144, 73,169, 68, 33,170,168, 38,144,199, 21, 91,198,209, 84, 46,141,202,106,245, +140,167,200, 99,136,204, 12,224,208,233,203, 98,152, 23, 72, 31, 56, 50, 35, 92, 69, 36, 52,216,198,117,235,237, 68,214, 6,122, + 80,195,191,129,227, 45, 86,239, 99, 40,223, 53, 34, 55,214, 83,240, 91, 31, 58, 96,158, 49,107,106,221,242,235, 19,169,209, 12, +185,102,208,236,172,149,182, 46,198,255,130,114,159,116,161, 98,209,140,181,156, 87, 92,102, 39,254,105,201, 74,184, 87, 25, 39, +235, 55, 55,119,123,219,161,156,192,185,111, 70, 76,104, 31,152,189,221, 89,255,117,246, 67, 18,101, 46, 56,149,145,173, 58,137, + 24,129, 56, 13,111,196, 34, 77, 76, 92, 94,130, 30, 30, 40,216,207,150,190,116, 26,161,220,124, 53,107,124,217,239,237,159, 15, +193,133, 79,154,252,193,198, 98,161,176,211, 30, 50, 77,106,163, 52, 89,197,178, 26,105,155, 27,204,181,230, 33,248,174, 3, 27, + 17,124,255, 75, 17, 27,137,100,244,104,201,155,146,129,120, 84,137,245,125,137, 68, 55,253,232,220,174,119,143, 55,186,242, 59, + 54,219, 65, 68, 13,237, 83,145,171, 94,184, 90, 17,138,191, 8,138,197, 19, 23, 32,229,226, 45, 75,101, 6,206,172, 66,133,139, +177,106, 41,226,213,206,234,225,233, 1,156,220,110, 44,159, 14, 79, 64,159,202, 40,198, 70,148,148,239,130,131,218,141,246,239, + 97,159,147, 9,116, 50,169, 92, 58,134,217,124,140,179,101,169,190,148,201, 12,105,200, 16,112, 50,116,124,194,110, 21, 55,211, +150,194,222, 35,129,106,146, 57,114, 87,187,214, 89, 67,236, 26, 13,215, 68, 76,225,221,106,154,109,194,243,105,112, 49,174, 10, +157, 23, 78, 82,221,214,173,134,108, 28,158, 28, 80, 15,113,182,223, 63, 20, 84,241,239,170, 89, 40, 74,111, 92,169, 11, 2, 25, +181, 82,186,112, 64, 81,225,219,177,225,245, 70, 42,207,169,156, 61,139,179,187, 43,155,223,126,110, 47, 38,117,100, 98, 16, 20, +204,101,188,187,176, 12, 15,117,167,179,182,119,188, 7,179, 3,230, 94,146, 36,127, 6,103,198,195,166,109, 64, 79, 68,163, 74, +213, 44,219, 61,218,241,204,184,225,222, 63,124,253,248,252,201,139,103, 47,159, 50,214,101,109,198,154, 36,230, 11,198, 54, 73, +174, 38,252,236,145, 37, 7, 67,176, 5, 39,173,120,198, 1,174, 41, 74,131,175,113, 85,166, 48, 34, 34, 42, 31, 33,195, 35,226, +215,239,222,192, 91,210,132,121,252,240, 81,179,181,240,234,253,219, 69,150,192, 98,188,176,249,214,253,123,197, 60, 38,218,207, + 59,159,102, 7, 65,208,237,133, 27,176,211,210, 90,247,139, 62,114, 85,163,138, 49,245,168,174, 96,170, 26,112,251, 36,182,106, + 18,212,112, 36,162, 38, 48,113,140, 22, 95,132,122,118,204,182,131,230,209,232,221, 9, 77,240,126, 67,224,106,158,165,105,174, + 6,156, 77,182,229,118,126,167, 54,231, 69,120, 56,138, 9, 54,129, 95, 71, 65,229,179, 80,129, 38,140,121, 15,197, 7,200, 3, +214,145, 79, 3,130,174,136, 29,231, 40, 9,130,238, 9,167, 93,225, 9, 34,186, 62,146,104, 86,106, 58,134,111, 61, 27,182, 99, +148, 39, 23, 30,183,131,134, 95, 49,185, 58,112,163,207,175,210,130, 51,255, 5,224,235,106,122,155, 6,130,232,238,122,215,113, +226,148,124, 52,130,182, 23,164, 2, 18,156, 57,112,230,231, 33, 33,254, 2, 55,254, 80, 47, 80, 36, 62,170,166,149, 19,167,110, + 99, 59,177, 99,239, 46, 51,179,177,219, 68,180, 82,110,137, 28,121, 63,222,190,153,125,243, 70, 62, 1,238,109,215,108,177,125, + 52, 37, 2,153, 75, 24,160, 27,140,104, 14, 98,119,147, 41, 92,107, 90,196, 8, 76, 12,112, 52,115, 22,181, 5,108, 81,149,174, + 37,199,126,112, 29,174, 96, 76,239, 86, 11,216,144, 58, 24,144, 57,170, 36, 47, 25,233,244,234, 36,206,215, 26, 80, 0,246, 2, + 3, 42,192,135,188,123, 18, 30, 79,250,227,105,118, 61, 95,207, 20,151,216,141,211,192,124,150,218,120,148,219,181,131,131, 73, + 90, 44,169,255,153,105,187, 15,218,157,137,181,123,205, 70,246, 61, 53,255, 55,169,190, 23,112, 60,120, 54, 15,236, 67, 57,219, + 73,172, 61,113,102,180,166,194,247, 87,223,207,186,227,100, 29,127,191, 58,107,221, 23, 30, 68, 72,172,169, 35,179,113,114, 9, +147,179,130,163,209,218, 62,205,200,239, 12,171, 19,187,194, 38,107, 35,189, 58,202,227,143, 31,142,109,136,157,158,152,167, 73, + 62, 47,120, 41, 46, 22,201, 89, 60, 11,164, 10,148, 88, 21, 37, 22, 45, 26,190, 65, 85, 59,246,209,238, 41,128, 16,148, 10, 20, + 21,219, 84,186,208,120, 31, 82,106,182, 70,202,132, 25, 27,191,169,224, 10, 26, 58, 47,104,233, 73, 18,222,212,154,163, 39, 28, + 54,227,228,121,198, 94,189,224, 82,133, 63,163, 2,129,157, 58,120, 96, 16,224,119,122,254, 32,201, 98, 90,117, 8,243,192,221, +145,223,162, 71,132, 19,255,233, 81,111,112, 52, 60,249, 21,157,195,255, 95,196,127,221, 88, 17,245, 39, 90,192,234,118, 54,224, + 7,209, 50, 98,174,247,223, 54,166,230, 7,221, 17, 96, 58,208,246, 89,138,184,191,200, 23,129,236, 82, 25,160,192, 11, 88,215, +218,134,163, 65, 49, 32, 38,192,179,239,117,194, 32,188,205, 19,167,216, 31,247, 38, 23,241, 31,107, 93, 25, 58, 16, 36,238, 46, +144, 90,247,142,173, 19, 8, 37, 79,156, 43, 35,157,192,230,250, 54, 34, 99, 72,140, 31,128,101, 72,169,202,114,173, 84, 80, 86, +107, 67,251, 46,240,187,240,134,128,236, 36,218, 99,188, 97,140, 40, 66, 23, 20,151, 8,158,150,185, 71,207,206,139,252,252,234, + 7,112,124,242, 16, 38,161, 61,133, 19,243,236, 6,248,224, 52,185, 68,102,131,213, 76, 41,154,202, 2, 5,223,164,219, 98,221, +166,177, 36,140,249,203,225,228,100, 48, 94,206, 51, 95,170, 26,171, 46,209,158,234,106, 58, 61, 61,125,227, 10,177, 1,120,241, + 51,102,236, 93,115,103,180, 33,196,135,207,130,230,216, 35,184,111,178, 32,123,222, 29,240,166,175, 15,159,207,238, 18,119,128, + 1,199,210, 70, 13, 59, 62,108,219,229, 77,242,249,203,167,163,247,111,191,242,111,253,209,208,192, 23,182, 83,213,218,183, 62, +217,169,146, 85,130,174, 31,243,113, 66,173,170,236, 45,210,155,180, 88,245, 59, 97,148,221, 22,212, 50,187,212, 21,108,240,194, + 84, 37,218,142, 98,204, 30,170,103,195,112, 4, 43, 26, 87,137,244, 5, 50, 60,201,177,247, 59,105,170, 76,205,181,178,228,210, + 13,228, 2,151, 96, 45,122, 1, 58,151,240,141,216, 58, 79,112,119,200,154,221,124,137,219,247,198, 54, 60, 31, 70,239,240,224, + 48,190,155, 11, 33,216, 78, 62,231, 33,251, 54,109, 26,222,101,202, 28,178, 27, 87, 35,181, 21,189,176, 70, 30,194,247,149, 20, +118,135, 67, 52,149, 34,110,129, 27,135,242,112,154, 82,140,246,152,118,227,158, 84, 54,138,121, 10,196, 49,220,199,240, 81,183, +250, 28, 2,250,127, 2,240,117,110,187, 77, 3, 65, 24,246, 17,187,118, 73,235,210,134, 86, 72, 84, 92, 32, 33,110,168,122, 5, + 18, 47,131,250, 60, 92,113,203,211,112, 91, 30, 0, 9, 16, 42, 74,149,150,182, 78,156, 16,175,215,217, 3, 51,179, 94, 31, 26, + 32,178,114,147,131, 44,123, 61, 59,251,239,204,247, 7,255, 14,238,221,230,106,203,118, 55,226, 59,201,169,132, 64, 34, 1,156, +228, 93,156, 43, 90, 93, 95, 25, 7, 41,109, 88,143,184, 31, 24,193, 59, 89, 96,150,117,153, 87,121,201,145,212, 92,212, 11,170, +124, 71,239,112,170, 16,129,169, 57, 76, 31,164,176,126,207,226, 17, 54, 4, 5,144,189, 60,220, 79,178, 36,140,215, 74,141,227, +199,177,151, 92,177, 41, 60, 68, 33, 57,127, 64,138, 9,115, 59,140,235, 28, 19, 28, 83, 26,101, 0,107,155,241,218,187,231, 20, +216, 15,235, 22,194,212,255,149, 17,130,113,113,196, 49,106,244,255,205,115, 7,191,237,127,214,255,243,166, 82, 62,160,229,187, + 36, 16,205,146,205, 8,231,208,234,191,170,165,136,116,176, 55,148,185,171, 37, 69,157,196,174,173, 3,186,206,129,194,240, 10, +163, 55,117,229,213,197,247,163,253,195,131, 71,123,183,188,150, 66, 37,158,255,233,226,242,235, 93,158, 4,126,234,107,183,250, +205, 96, 85, 68, 77, 41,228, 70,172, 2,218,192,137, 80,240,209, 33, 92,186, 40,172, 32, 67,144,206,138,203,109,108, 70, 87, 75, + 69, 55,207,244, 91,217, 3,114,239,146,144,242, 91,152, 63, 33, 85, 44,133,144, 77,100,212,138,171,167, 25,255,241, 75, 40, 42, + 46,241,137,180, 42, 69, 93,200,155,174,254,133, 34,101,228,195,147, 95,147,182,224,164,209, 78,193,230, 12,251,107, 92, 91,237, +128, 67, 27,251,200, 72,205,151, 82,216, 34, 8,199,232, 42,218,166, 14,228,250,162,138,213,220, 80,188, 33,230,190,126,254,230, +252,219,185,148,109, 15,154,182, 24, 39,184,107, 53,129,204, 92, 72, 6,235,178, 54,118, 2,240,208,228,236,214, 64, 37,117,243, + 77, 57,168,116,240,188,189,173, 44,142,226,201,221,196,222, 94,149, 70, 41,181,173, 67, 50,207,169, 72, 75,194, 64, 37, 44, 99, +184,147,238, 78,243,146, 12, 34, 76,175, 13,158, 39,249, 33, 34,179,200,146,234, 96, 45,234,140,210, 81, 81, 22,216,129,137,100, + 2,100, 35,179, 53, 71,190,138, 71,188, 7,172, 28, 51,173,224, 26,102,227, 21, 67,204,178,106,214,203, 6,187,212,208,154,124, + 43,221, 66,152,131,147,124,123,252,242,203,205, 79, 68,239,249, 77, 87,234,217,217,187, 15,239, 63, 26,137,197,217, 38, 29, 30, +198,208,132,100, 25, 56,155,214,109,233, 5,173,212, 96, 38,103,142,245, 81,246,250,125, 32,113, 24,156, 30, 61,153, 85,104, 81, +184,214, 93,211,157, 32, 25, 4, 22,163,187,212,169,198, 13,204,203, 65,176,145, 50, 70, 95,228, 62, 74,222,244,255,123,205,248, +226,243,245,226,111,159, 52,181,155,174, 31, 67, 18, 50,175,231,112, 28,100,175, 14,199, 39,107,153, 75,113,237,147, 81,161, 31, + 70, 16,211,208,179, 79, 48,129, 75, 37, 79,147, 53,135,212,162,132,132, 76, 49,156, 3,148,133,113,209, 14,135, 71,161,233,158, + 96,162,172,136,131, 67, 65, 8,179,103,110, 77,148, 28,107,174,167,250, 44,194, 38, 86, 27, 71, 86,213, 60,194,112, 28,143,159, + 77,243,203, 90,114, 87,187,195,237, 61, 71, 15,243,246, 1, 91,178,171,141,108,144,244, 27, 33,222,109, 66,148,220,152, 23,186, +157,116,132,128, 97,121,130,148,189,141, 68,247,143, 0,132, 93,203,110,211, 64, 20,157,135,237,113,154,135, 0, 9,177, 0, 20, + 84, 9,209, 29, 98, 83,241, 27,176,227, 59,248,138,242, 13,252, 9, 43,246,101,129,196, 6, 72,145,210, 86,130, 56,180,165,198, +137,237,201,120,134,185,247, 58,206,164, 65,144, 69,150,145,147,140,175,207, 61,247,220,115, 34,182,129,141, 91,179,102,190, 21, +112,209, 70, 39, 35,120,111, 75,188,175, 33, 26,145,251, 90,108,239,240, 38, 7,222,198,131, 60,223,126,246,101,191,159,236, 41, +217,235, 71, 74, 64, 24,158,127,158, 23,185,254, 13, 14,130,190, 7,180, 64, 69,107, 15,119, 86,240,177,104,227, 37,149,140, 71, +178, 39,146,161,130, 80,243, 94, 18, 39, 30, 87, 70, 50,209,214, 98,127, 38,123,241,240,137, 26,101,245,108,190,152,197, 44,118, +130, 12,242, 61, 68, 20,174,157, 96,152,157,175,194,194,202,238,182, 28,241,249,154,131,178, 1,158,222, 8, 77,209, 4,138, 92, +103,121,208,157,133, 35,211,191, 41, 30, 67,109, 59,121, 65, 97, 32,151,232,148, 49,155, 9, 54,239,124, 56, 89, 59,189,176,165, +179, 41, 3,174, 92, 19,180,162,102, 22,155,233, 59, 49,187, 61,136, 71,169, 28,128, 57,186, 57,254, 48, 57,247,157,105, 20, 93, +107,189, 0,158, 6,176,154,131, 40, 87,200,141, 50, 74,186, 8, 54, 37,106,235,219, 38,145, 74, 86, 64, 35, 11,149, 26,124, 56, + 33, 73, 17,124,193, 53,147,171,198, 87,123,153,160, 19,117, 9, 10, 39, 91, 65,159,200,246, 4, 64,123,133, 15, 52,227, 27, 41, +220, 47,211, 13, 80,240,195, 68, 26,143,152, 26,126,239, 86,244,227,218,198, 84,165, 57, 91,161, 11,140,149,104, 88, 64, 51, 13, +201, 64,129,131,137, 13,192, 90,232,138, 92,185,183, 71,210,174,160,116,173,110,131,204, 5, 63, 32, 82,242, 18, 68, 70,100,167, + 73,103, 31,240,245,100, 54, 33,157, 0, 11,218, 88,209,238, 88, 9, 84,195, 65,171, 59, 80,131,218,212,136,238,119, 83,184,156, +138, 20,180,104,116, 43, 91,119,185,184, 28,247,198,193, 19, 27, 7, 7, 0,192,181,227,237,108,182, 52,101, 5, 59,235,238, 59, +238,169, 90,108,208, 23, 53,253, 93, 92, 27,211,221, 66,166,213,186, 90,228,214,237, 32, 29,229,203, 95,105,172, 32,199,217,104, +109,141,104, 68, 35,121, 2,254,157,232,211,217,177,173,164,130,198,192, 68, 34, 36, 68, 23, 8, 79,225, 15,156,157, 94,100,175, + 95,190,154,206,207,223, 77, 63,209,213, 30,238, 63,189,127,240,232,232,237, 17, 54, 99, 9, 28, 26,130, 15, 75,124,127,182,254, + 86,103,140,101, 72,206,128, 7, 13,107, 15, 26,216, 75,108,142,243, 40, 73, 63,255,204,242,170, 84,177, 50,152, 81, 4,248, 16, +228, 90, 18, 53, 78, 54,125,188, 63,125,127, 76,174, 78,228, 66,143,145,244, 13,104, 95,172, 73,101, 84,253,175,196,255,251,245, +224,238, 65, 81,100, 23, 5, 36,169,206,175, 62,246,199, 47, 30, 62,127, 83,231, 95,196,226, 4,150, 32,253, 81,156,159,153, 42, +119,249, 9, 43,191, 66, 96,141,191, 42, 8, 94,107, 4,109, 59,145,195, 33,179, 29, 99,114, 83, 44,211, 10, 67,236,218,166,145, + 95, 45,209,173, 12, 6, 97,182,149,177, 7,213,128,115,215,177,120,157, 36,207,117,158,143,204,157,102,223, 44,245,133,124,139, + 25,184, 97,220, 99, 3,237, 93,128, 7,215, 66,152,176,196,139,128,131,176, 59,172,206,246, 67,163, 1, 31,242,142,144,106,171, +247, 31, 1, 40,187,126, 23, 39,130, 40, 60, 51, 59, 59,155,205,143, 75,206, 34,202,113, 90,121,255,128,133, 8,162,133,133,112, + 96, 99,119,141,130,255,129,133,149,141,157,165, 88, 88, 91,105,113,157, 28, 98, 97, 47, 54,114, 6, 69, 16, 4,201,137,130,230, +252,145,236,110,110,179,155,157, 25,231,189,153, 77,118, 35, 87,216,132,176, 11, 27,152,236,124,239,125,243,190,247, 61, 94,237, + 99, 90, 1,247, 42,178, 87,138,171, 56, 14, 25, 0, 7, 34,134, 34, 46, 68, 26,214,206, 9, 23,132, 27,160, 8, 89, 8, 98, 0, +143,107,202,114,176,180,210, 58, 7, 18, 26, 50,174, 17,182,114,231, 69,104,114, 39,102, 75,246,115, 2, 70,131,128,214,220,160, +170,201,246,253, 53,162,123,240,147,190,185,104,210, 48,159,122, 77, 42, 26,190, 58, 82,197,169,112,163,201,194, 97,114,224, 43, + 14, 16, 38,177, 55,159,228,168,162,100,170,190, 18,180,166,119,116, 62,242,165,173, 88,128,198,144,246, 28,162,228, 53,140, 46, +118, 16, 91, 88,118,254,171, 87, 39,199, 80,207, 58,194, 3,193, 71,171, 12,175,238,234, 3, 82, 83,183,110,118,158, 42,124, 15, + 25, 84,238,204,246, 24,215,159, 45,128, 97,211,126,147,172,183,120, 39,224,133,102, 89,166,198,185,138, 50, 19, 50,101,106,192, + 9, 3,128,198, 24,208, 21, 94, 40, 12, 19,130,100, 12, 38,189,194,105,165,106,163, 73, 82,160,244, 76,146,184,128, 40, 45, 60, +221,242, 76,166,175, 2,232,214, 87,179, 2,110,249, 84, 55, 36, 17, 84,207,230, 0,104, 62,177,186, 81, 88, 87,243,217, 69,147, + 44,225,177,182, 65, 68,204,133,146,148,156,238,138, 81,148, 17,104, 86,242,236,246, 55,172, 60,224,173, 56,143,113,170, 44, 69, +224,139,237,154,119, 26,157,126,239,228,183, 95, 95,149, 42,234, 53, 10, 74, 87,236,155,171,221, 26,152,102, 25,146,135, 13,201, + 64, 74,156, 2,141, 2, 22,163, 52,101, 53, 93, 90,236, 48,168, 74, 41, 57,205,166, 38,113,134, 55,143,130,185, 71, 60,139,177, + 95,130, 89, 45, 4, 71,124,119, 29,100,136,194,195,159,195, 37,199,162,122, 50,155, 16, 87,244,173, 24,228,162,129,184,180,146, + 58, 93,158,240, 19,189, 44,212,233,229,176, 8,115,231,119, 50, 54, 87, 14,163, 17,228, 32,102,137,132,192,118, 30,117,237,220, +213, 87, 31, 95,207,193, 62, 2, 30, 35,152,176,102, 89,212,190,147,204,110,123,102,165, 21, 10,233,160,201,150, 78,132,189, 36, + 75, 14,211,248,241,139,189, 39,119,239,235,205,222,238,179,231,219, 55,174,111, 93,186,176,125,254, 10,132, 21,218,128,176, 88, + 96,132,145,120, 94, 62, 45,163,205,103, 66,126,224,187,194, 74,237, 20,228,249, 11,129, 28,181, 66, 85, 32, 23, 82,114,195, 84, +136,199,149,108,122,160,212,132, 73,246, 94, 80,200,121, 63, 92, 39,109,254,126,240,214,153, 0,160, 70,154,129,155,141, 19,172, +157,237,117,191, 68,233,206,229,157,205,254,153,221, 55,123, 31, 62,237,255, 47,190, 31,124, 31, 60,186,243,244,246,131, 91, 56, + 60,135, 12, 7, 15,183,110,222, 91,219,232, 23,209, 69,146,197, 69,150, 4,201, 31,210,106, 42, 47, 79,223,189,148,163,161, 45, +206,168,163,169,134,201,149,169,156, 70,106, 50, 42,242, 88,154, 44, 6,145, 89,106, 77,171,147,123,220,159, 73, 23, 59,223, 13, +112,163,114, 89,171,172,156,209, 88,191,101, 93,247, 57,112,253, 70,229,105, 12,163,199,156,220,186,134, 42,156,214,189, 44,230, +218,171,182, 76, 96,101, 29,117,136,183,206, 29,172,116, 32,171,229, 37, 53,191,195,202,124,164,154, 40,244,175, 0,148, 93,187, +110, 19, 65, 20,157,153,157,125,248,145, 88, 78, 16, 81, 12,196,136, 14, 65, 17,164, 20, 8, 9, 92, 81,240, 49,252, 4, 5,127, +131, 16, 15,165,224, 81,208, 18, 33, 37, 18, 20, 41, 98,201, 64,129,147,152,216,235,199,122,215,243, 96,238,157, 29,123,227, 68, + 32, 74, 75,246, 74,222,157,189,115,230,220,115,207,225, 75,156, 78, 17,222,186,144, 60, 54,119, 3, 70, 70, 21,199, 86,105,104, +135,104, 35,112,137, 1, 80,197,193, 79,202,160, 70, 72,218, 8, 80, 95,152, 42, 17,104, 36,148, 48,207,195,167,116, 98,138, 41, +213,161, 71, 35, 86, 1, 99, 63,164,173, 56,241,172,115,128, 7, 69, 4,196,148, 80,250, 20, 29,202,140,205,124, 83,206,134,128, +134, 88, 8,173, 21, 86, 98, 6,249,120, 99,145,109, 86, 55,204, 79, 58,195, 54,167, 60, 48,103, 18,207,236,222,156,193,214,128, +185, 67,116, 49,204, 95,168,184,110,163,178,105, 45, 74,149,253,202, 72,197, 86, 52,189,248,190,210,133,170, 78,231, 27, 44, 59, +167,175,160,127,105,217,210, 75,198,128,153,195, 0, 26, 61, 23,225,158,122,206, 75,217,186,165,249, 82,197, 66,141,157,114,113, +254,120,234,132, 92, 49,176,221,220, 50, 83,137, 77,173,204,192, 17,209,252,201,100, 70,195,136,108, 40, 47, 69,113,137,129,199, +158, 71,106, 33,196, 6,131,108, 17,215, 14, 68, 8,227,198, 60,158,217,142, 22,157, 8,112,146,113,131, 12, 6, 80,195,227, 12, +208,106,185, 76, 1,170, 91,190, 66, 0, 35, 79,167,192,103,210, 18, 38, 84,102,146,148, 67, 90, 66,133,102, 45,162, 6, 36,121, + 96, 20,201,234, 53,118,120,204, 18, 97, 39, 80, 20,210, 80,108, 42, 18,230,110, 60,178, 34,214,176,136,140,167,163,239,199,147, +130,224,253, 98, 15,100, 46,238, 37,133,176, 61, 64, 98, 9,120, 69,128,132,133,155,253, 28, 80, 36, 65, 63, 30, 71, 36,233,101, + 45,106, 17,234, 8, 37, 70,211,145, 53,155,138,147,179,107,107, 55,186,131, 46,202, 47,116,243,234,173,246,201,145, 93,213,142, +125, 99,139, 6,187,182,199,111, 12, 74,202, 21,110,238,213, 80,110,166,129,229,243,234, 57, 69,169,151,255,148,180,181,193,148, +108,100,225,209,158, 72, 39,217,116,107,189,217, 57,233,188,223,255, 0,254, 54, 32, 20,130,235, 6,220,207,160, 39,236, 76, 73, +149,229,219,161,143,226, 5,190, 41,172, 16, 85,198,121,156,198,149,168,106, 46,222,238,247,158, 62,123,190,179,125,187,241,224, +206,187,221,221,135,143, 90, 93,146,213,130,245,129, 24, 1,114,178,245,221, 60,215, 6, 46, 38,251,186,175, 33,120, 79, 33, 65, +205,209, 33,189, 92,238, 12,180, 21, 76, 71, 69, 44, 92, 9, 67,108, 63,192, 81,221,128,113, 60, 61,224, 8, 6, 99,230,141,172, +149, 64,210,254,242,205,219, 50, 84, 0,187,140,225,144,194, 65,248, 69,165, 36,173,173,187,122,165,121,212,251,209,155,245,191, +126,250,178,255,237,224,222,227,237,255, 45,241,123,135,123,173,157, 39, 31, 63,191,194, 79,253,120,252,243,230,253,235,230,250, +226,247,170, 14, 86,171,245, 70,154,130,253, 66,180, 73,146,215, 47,228,217,169, 24,156,166,103,191,228,176,151, 77, 98,105, 14, + 88,200, 47,216,195, 16,120,159, 48, 63,149,137,212,121,178, 50,172, 87, 4,239, 78, 62,110,181, 42,194, 10, 80, 53, 30,190,208, +212,241,156,191,205,133,178,254,111,237,134,149,183, 4, 65, 37,133,196, 74,186,212,244,195,160,177, 10,196, 36,104, 89, 64,241, +212, 66, 43, 14, 99, 84,249, 46, 83, 48,118, 87,206,192, 92, 47,166, 88, 47,203,155,251, 35, 0,101,215,178,219, 52, 16, 69,231, + 78,198,113,210, 36,180,161,225, 33, 90, 20, 9,177, 1, 36,118,252, 5, 95,129,132,186,237,167,176, 71, 2, 9,248, 2, 36,150, +176, 98, 65, 23,168, 98, 67, 17,149,154,242,104, 85, 81, 53, 73,235,196,137, 61,142,205,156, 59, 99,199,137,202,130,172, 98,201, +177,146,204,248,250,204,153,115,207, 89,242, 39, 40, 37, 17,187, 77, 88, 69,115,102,142,251,231, 4, 18,147, 17,159,196,246,102, +236,254, 40,184, 88,161, 64, 99,244,173,122,141,141,210,116,102,155, 61, 8, 38,226,210, 69,170, 22,138, 84,197,241, 17, 86,120, +227,177,109,183,176, 81,210, 82,241,116, 87, 85,222,233,184, 86, 93, 1,117,163, 12, 48,196, 51,163,110,234,121, 6,169,242,170, +223, 94,141,175, 14,163, 62, 60, 91, 65, 59, 33,157,215,224, 72,237,124,223,168,104,213,165,162,245,154, 49, 90,211,111, 37,137, + 30,167, 33, 18,136,172, 71, 56, 89,115,165,204, 17,110, 37,158, 62,223,144,144,116, 9,125, 54,207, 57, 92,124,110,150,227,189, +138,213,157,253,187,113,253, 86,179, 61,157, 14, 42,100, 15,103, 73, 54, 91, 87, 21, 51,152,253, 92,135, 14, 91, 55,198, 84, 13, + 18,235, 62, 76,118, 57,148, 50, 29, 38,160,105,109,188,161,132,226, 2,190,204,102, 21,213,144,168,239,170,146,249,194,121, 53, +214, 61,107, 45,110, 38,181, 88, 83, 74,231,193, 59,224, 97, 8, 10, 86,251, 27, 26,158, 8, 19,129,229,145,132,204,209,156,149, +164,210, 0,243,118,221,220,181, 50,192,218,198, 64, 54,248,151,181,124,140,186, 25,162,134, 95,169,250, 34, 78, 48, 94,205,154, + 92,241,170,158,138,227,153,244,136,167, 35,145,102, 79, 55,155, 29,191, 0,201, 89,233,158, 22,172, 58,228,252, 46, 47,123,193, + 61, 86,170,186, 95, 15, 38, 23, 80, 58,167,182, 43, 86,218, 18,207,134,221,242,118,167,251,235,244,135,200,177, 86,202,176,145, +168,236, 6,229,114, 72, 74, 66, 99, 42, 53, 27,211, 81,255,216, 96,232,155,107, 27,177,214, 7,127,122, 68,142,208, 75,115, 80, + 84,148,248,235,173, 27,131,232, 66,199,145,189,181,124,207, 60,224, 84, 16,141,100,249, 38,202,243,116, 72,254, 99,231,158,127, +238,102,167, 59, 8,206,194,104,194, 9, 40,160, 21,127,158, 29,178,165,146,144, 52,199,109, 65, 60,194,178,194,229,148, 21, 41, + 66,248,144, 89,253,156,143,135, 49, 98, 97,204, 3,142,166,225,168,106,102, 70,205,207, 82,239,203,222,225,231,221,239, 65, 50, +126,180,241,176,221,233,138, 90,251,245,206, 75,144,238,123, 66,244,132,216,228,250, 94,180,219, 93, 17,226, 1,147,239, 22,215, +107,199,207,192,232, 62,199, 66,230,139,121,108, 52,143,119,210, 54,252, 58,199, 86,184, 90, 38,225,189,187,119,204,121,199,251, +189, 70,205,135, 6,183, 34,145, 49,134,221, 77, 14,139, 18,244,109, 24,190,223,125,229, 46,119, 11, 97, 75,207,159,189,120,186, +253,228,191,234,251,219, 15,111,182, 30,111,231,245, 93,156,238,189,187,223,221, 66, 34,202,192, 28, 12,245,254,121,118,114, 34, +143,126, 79,119, 62, 6, 95, 63,197, 73, 56, 67, 19,183, 54,211, 15,140,112,173, 57,137, 70, 89, 30,121,196,190,126,153,203,217, +179,177,241,214,129, 42, 71, 20,174,228, 59,103, 63,252, 57,140,158,179,130, 64, 39, 39,154, 47,228, 21,197,212, 98, 53,139,188, + 52,129,213, 94, 92,242,202, 66,103, 14, 40,151, 3,150, 1,205,163,132,163,251, 28,234,177, 19,117,198,174,184, 34, 41, 97,239, + 82,183, 41,229,170,150,165,109,129,229,215, 95, 1, 40,187,150, 30,167, 97, 32, 60,118,156, 87,211,150, 44, 91, 30,218,195, 2, +226,128, 56,112,225,176, 18, 87,142,252, 18,126, 19,119,126, 9,191, 1,113,219,229, 33,180,180,251,108,211,180,121,217,198, 51, +182,211,180,156,232,161, 82, 21,165,145, 44,103,102, 60,243, 61,196,144,157, 11,135,205,119,231,151,237, 28,148,176,198,177, 39, +244, 68,147,192,154, 41,189,177,234,176, 28, 36, 30,120,209, 99, 83,216,227,168,179,193,228,131,166,168,100,221,108,197, 14,181, + 23, 80,209, 62,249,160,168,175, 32, 18,187, 38, 87, 38, 20, 23, 51,201,131, 7,105, 16,231,241,136, 44,154, 80,130,188,104,218, + 44, 12, 51,243,104,180,145, 97, 91, 68, 83,233,147,241,105, 81, 47,205,234,117, 90, 40, 76,117,170, 81, 56, 24, 32,123, 14,189, + 19, 98, 0,135, 55, 72,216,100, 26, 76, 77, 80,138,147,104,173,202,197,246,119, 75,150,114, 46,246, 48, 37, 0, 6,214,128,142, +218, 74,137, 66, 74, 39,168,198,246, 33,148,236,112,180,189, 91,108, 61,236,239, 51,240,179, 11, 6, 93,189,140,201,167,117,221, + 53, 45,194,187,224, 41,249, 96,164, 30,209, 96, 62, 51, 14,227,136,111, 37, 43,129,143, 72,226, 8,225, 48, 12, 97,139,228,239, +106, 13,237, 96,221, 1,246,109,201, 24, 37,198,213, 35,140, 60, 71,169,182,233, 40,204, 71,136, 25, 94,213,232,229,201,172, 80, +140, 48,153, 82, 55, 74, 87,180,219, 77, 26,200,153,217, 94,170,236,112,206,103,246, 88, 18,177, 90, 42, 19,166,205,179,146,200, + 68,118,150,133,188, 33,107, 44,204,246,194,172, 29, 55,183,102,169, 8,200, 15, 55,127, 0,153,185,165, 5, 18, 22, 55,217, 21, + 59, 81,158, 94, 58, 84,132, 80,113, 56, 70,143,177,129,197,243, 49,105,212,244,228, 59,155, 21, 77,173, 93,214,165,217,234,121, +150,223, 22,183,187,142, 11,109,123,147, 15,126, 46, 46,104,101,131, 61, 14,235,176, 70,161, 63,154,141, 31,221,148, 55, 86,255, +213, 30,217,180,139,248, 4, 84, 97,124,190,252,131,252, 80,178, 87, 49,215,210, 56,219, 52,229,139,217,203, 31,215, 23, 30,210, + 3, 87,197,149,242,250, 37,216,118,111,183, 84, 16,234, 94,139,145,144,160, 22, 35,169,201,190,212,106,171,242, 61, 88, 28,121, +204,125,159,159, 99,233, 75,114, 5, 73,148, 38, 65, 82, 86,133,147, 66,195,111, 73,110, 7, 20,129,184, 57,224,166, 71,227, 28, +101, 41,233, 37, 39,191, 74, 4, 17,160,109,147,195,207, 57,229, 55,156,120, 9, 49,153, 30,173,155, 77, 38,158, 8, 22,117, 44, + 72,195,100,146, 60,140, 96,115,252,229,227,237,217,135,101,246,188, 61,121, 3,175, 25,188, 2,120, 11, 96, 34,243, 41,192, 51, + 71, 97,163,162,190,181,124,105,137,179, 94, 1,170, 10,106, 93,212,247, 43, 4, 96, 17,125, 23,155,132,220, 59,169,177, 45, 52, +239,207,222,153,219,190,254, 58, 47,160, 44,170, 50, 68, 8,163,216,202,141,236,227, 73,181, 65, 86,182, 72, 90,228,178, 85,179, +240,241,181, 92,252,111,124,191, 43,175, 39,163,172,255, 89, 45,190,137, 59,104, 46,101,245,233,115,115,117,169, 87,247,109,121, +215,110,150,235, 98, 94, 49,132,134, 41, 70, 6,204, 18,170,174, 33,139, 96,229,208,210, 86,103, 93,218, 90, 30,145,172,210, 65, +178,250,119,156,136,169, 76,246, 10, 47, 94,105,189,175,142,189, 19,182,143,141,202,109,101, 91,221,171, 81, 52, 89, 87, 37,223, +107, 58,242, 62, 2,113, 38,204,177, 27, 71,233,254,129, 61, 93,153, 57,180, 13,219, 73, 45,185,150,165,239, 77, 30,194,126, 58, +237,105, 80, 12,134,110,125,240,111, 9,255, 87, 0,202,174,156,183,137, 32, 10,207,236,225,117,124,132,245,154,200,137, 20,229, +144,194, 17, 10, 68, 5,252, 4, 58, 26, 42,106, 36, 34, 81,128,132,196, 47,128, 2,122,138, 72, 52,244, 52, 17, 13, 5, 8,137, + 42,101, 58, 66, 4, 66, 33, 36, 56,137, 29, 99,239,174,237,189,102,120,239,205,172, 99,163, 8,137,206,197,122,239,157,119,124, +223,251, 62,235, 44,229, 72, 62, 73,155, 97, 36,242, 78,248, 44,202,175, 91, 5,110,193,146,106,107,195,107,147, 16,103, 68,213, +104, 84, 71, 77, 21, 49,210, 42, 32, 65, 90,172,113, 48,215, 67, 82, 60,215, 93, 69, 53,227,110,209,112,135, 66,137, 83,101,166, + 65,219,192,149, 87,177,125,207,253, 36, 70,162, 2, 28, 39,197, 70,103,144,166,211,232,181, 97, 85,240, 67, 40, 12,146, 4, 78, +166, 81, 89, 62,240,191, 66, 6, 17, 35, 49, 4, 91,190, 24,105,232,241,141, 33, 10,156,188,163,141, 80, 14, 6,233,176,152, 22, + 28,163,228, 21,220,229,234,197,239,189, 29, 20, 12,202, 39, 98,228,152,241,222,136,214, 66,117,169,227, 85,235,173,222, 33, 63, + 3, 79,149,103, 78, 43,140, 48, 28, 83,147,237,148, 10, 35,162,154, 16, 18, 7,232,206,135, 68,110,120,121,151, 92,171,110, 88, + 71,153,152, 17,132,197,114, 94,181, 25, 4,206, 4,135, 94,176, 43, 7,217, 99,156,177, 48,197,219, 93, 32,219,164, 4,215, 26, +220,218, 51,105,100, 41, 99, 14,242, 79, 37,218, 89,153,134, 91,180,221,138, 61,140,196,206,126,255,184, 27,119,146, 83,208, 25, + 10,130, 90,197, 90,172, 79, 45, 54,166,252, 76,118, 3, 50,237, 69,145, 22,244, 36, 77,208,101, 11, 86, 88,195, 39,130, 95, 9, +171, 42, 35, 18,180, 91, 3,194, 0, 15, 5,119, 9, 46, 78,185, 44, 23,141, 84,240,132, 75,183,204,145,181, 41, 48,115, 47, 58, + 37,136, 34,131, 40, 68, 15, 70,165,214,162,199, 17,224, 77,136,145,186, 78, 79,197, 70,255, 57,217,236,238,207, 76,207,118,131, +118,156, 3, 87,249,164, 5,150, 96, 29,255,196,208,173, 48, 66,201,160,222,147,202,197,111,212, 74,212,181, 32,101, 68,250, 11, +225,166, 30, 83,111,251,176,184,103,231,202,181, 30,186,241,169,252,123, 98,154, 73,151,228,148,194,121,149,198, 73,216,130,125, +236,181,127,208, 10,107,144,156, 22,214,239,222,148,119,130, 22,143,252,212, 61, 57, 83, 48, 36,213,163, 8,174,176,140,244,106, +108,203, 92,168, 45, 53,131,230, 96, 24,106, 37,158,124,246,251,242,252,234,231,253,109, 66,222,176,175,211,143,134, 17,178, 19, + 32, 90, 35, 49, 84,146, 75, 10,185,207, 34,188, 53, 87,155,143,211,168,229,183,176,231,197,241, 41,155, 76,217, 52,234,152,166, +232,253,100,131,162, 60, 4, 88,216,239, 81,249, 75, 51,134,240, 10,136,248,198,194,213,247, 59, 31,218,195,117,198,215, 75, 67, +103,238,215,188,123,188, 18,190,117, 69,118, 77, 24, 55, 3,187,209,169, 55,196,162,199,174, 48,182, 9,187,220, 66, 56,205, 68, +195, 96, 50, 59, 19,237,237,111,198,165,217,137, 87,253,176,183,119,112,208, 11,124,184,226,223, 89,240,250,249,250, 67,238,212, +121,229,227,167,119,240,215,199,119,215,182,118,191, 60, 93,123,114,253,206, 45,184,189, 85,102, 61,187,255,168,108, 21, 77, 72, +240,104,161,104,167,199,176,143, 7,183,239,189,220,120,245, 95, 75,252,234,133,149,209,111,231,104,183,251,226, 77,212,252,217, +217,218,148, 38,201,196, 38, 81, 28,245,147, 56,164, 57,250, 12,181,226, 51,133, 9, 10,178, 99, 80, 55, 72,203, 64,230,164,151, +220,116,103, 52,227, 66,110,147, 42,113,226,147,186, 82, 98, 76,149,119, 12,158,148,226,239, 37,149, 67,180, 86,204, 58,121,170, +100,131,201,196,249,114,189, 21, 28,169,244, 78, 19, 42,169,210, 83,161, 93, 27, 82,141, 29,206, 26,117,138,213, 89,230, 68,123, + 85,139, 42,253,153,241,228, 93,254, 19, 13,252, 35, 0, 99,215,206,219, 52, 20,133,125,175, 31,113, 19,187,105,210, 86, 78,149, + 8, 84,202,163,168,176,241, 27,248, 9,140, 76, 12,176,179,192,200,191, 65, 8,137, 29, 88, 16, 11, 3, 98, 96,160, 67,169, 26, + 74,161,143, 60, 72,108,199,207,235,203, 57,231,198, 78, 37, 40, 98,139,146, 37,246,181,207,235, 59,223,247, 25, 23,128,131,172, + 50, 84, 82,237, 35,121, 47, 32,192,111, 27,117,174,204, 26,230,100, 50, 94,168, 38, 25, 91,123,244, 10,224,231,251, 84, 44,220, + 77, 75, 55, 33, 76,215,184,105,114, 27, 82,236, 36, 9, 4,202,138,193,185,163, 12, 24,142, 99, 80,178,134,199,228,141, 0,213, +103, 77, 71, 74,133,203,140,148, 73,155, 99,128,135, 43,108,112,131,168,140,184,237, 23, 21, 18,226, 29,100,177,164, 72, 92,203, +193, 57, 15, 51,140,130,252,223, 10, 98, 55,206,189, 79,148,142, 56,188, 52, 16, 43,225,172, 35,250,140,250,165, 73,129, 11, 16, + 29,109,189,235, 92,234, 7,251,172,100,183, 81,185, 36, 42,252, 67,150, 73, 24,174,108,136,106, 33,115, 1,163,170,253, 39, 11, + 52,246, 87, 66,154, 90,200, 34,121, 43,218, 21, 69,246,143,102, 18,172,154,166, 73, 44,113, 51,173, 91,103,155,107, 13,104,131, +252, 32,113,150, 80,236, 85, 41, 19, 16, 10,141,155,233,121,121,104, 56,126,161,159,114,202,218,130,204,105, 17,160, 51, 16, 12, + 34,215, 85,204,163, 73,193,189, 90,109,213, 49,250,131,240, 96,148,248,153, 12,168,247,206,206,139, 39,248,249,103,223,223, 60, +244,111, 95,174, 95,235,185, 80,242,132, 81,252, 43, 20,105,142,247,110,201,210,234, 57,116, 82,197, 56,214,102, 25,229, 39,139, +169,185,213, 90,157,133, 2, 39,248,182,137,100,124, 70, 40,194,233, 52,223,234,152,135, 3,116, 16, 55,240, 92,162, 52,175, 46, + 66,173,117,115,181,131,130, 18,246,134,225,181, 54,142, 6,135, 74, 53,200, 91,238,158, 76,127, 82,153, 82,206,190, 53,185,104, +113,121,197, 8, 97,114,225,209,139, 79,118,233, 80,171, 68,162, 36, 35,239,199,118, 99,101, 26,249, 42,208,171,178, 28,235,180, + 92,184, 53,103, 10,149, 50, 2,249,108,189, 73, 4, 87, 58, 36,111,101, 35, 74, 67, 63, 10, 28,219,197,194,156,132, 69,114,153, +213,204, 26, 54, 10, 34, 87,251, 19,232,165, 89, 54,102,184,211,101,152, 17, 4,148, 28,151, 68, 32, 32,182,156,246, 96, 50,208, +137,231, 2, 55,112,255,108, 15,173,227, 56, 20,187, 44, 19,139,101,148,221,163, 47,115,214,164,192, 84,143,102, 6,186, 37, 5, + 49,191,100,177,229,221, 56, 56,219, 35, 35, 14,196, 61,250,131, 62,195,105,155,238,218,110,129,144,120, 36,231,171,233, 92,165, + 59,101,138,160,220,202,154,245,229, 92,192,191,201,184,242,115, 36,204, 64,100,241,179,123,143, 94,223,125,245,224,201,227,143, +223,247,142,131, 97, 20,203,111,227, 15, 52,148,121,174,217,141,142,219,189, 37, 29,239, 71,119,188,155, 10,198, 67, 47,253,234, +247, 44,104,218,116,124, 95, 33,145,183,183,175, 91, 90, 14,245, 86,151,117,110, 94,217,218,217,217,238,245,188,246,157,171,250, +106, 19, 74,129,213, 86,107,205,235,116,154,221, 13,167, 13, 25, 52,207, 50,120, 76, 76,232, 58,152, 5,249,225,248,253,167,147, +201,172, 33,244,182,229,164,212,186,218,166, 21, 5,179,119, 47,223,222,127,250,144,226,251,255,218,112,183, 26,173,120, 52, 90, + 52,124,121,114,250,230, 69, 16, 76, 50, 45, 70,122, 35,220,192, 66,224, 72, 17,222,253,100,134,216,145, 76,181,130, 72, 31,164, + 82, 72, 72, 53, 5,196,210,213, 73,155,107, 82, 85,111, 49, 57,240,113, 99,201,118,167,228, 28, 0, 71, 28,102,225,133, 14,120, +218,159,155, 44,139,146,184, 12,238,115,120,137,228, 52,196, 40, 28,162,247,101, 73, 77,157, 75,228, 72,181,248,170,138, 14, 86, + 84,118, 20,132,242,179, 74, 39,138,136,101,240, 69,195,118, 32,132,142,103,195,115,112,126,169,153, 37,229, 63, 86, 61,126, 11, +192,216,185,181, 54, 17, 68,113,124,110,187,155,102,219,180, 73,106,226,165, 45, 6,197,162, 85, 68,170, 62,248,224,131, 95,193, +207,224,135,243,193, 87, 31,188,160, 32, 69, 95, 68, 4,161, 69, 36, 90,219,136,196,150, 52, 77,178,151,217,157, 25,231,156,217, + 77, 27,250, 82, 88,200, 13,178,201, 94,102,206,156,243, 63,255, 31,248, 19, 80,232, 90, 83,244,140, 26, 18, 95,114,100,235,112, + 15, 60, 10,225, 73, 67, 52,208,116, 91, 56,188, 55,115,178, 3, 72,172,218,233, 84, 57,145,191, 70, 50, 9, 18, 33,192, 40, 26, +237,147, 33,219,110,183, 86,216,178, 51,196,254,232,183, 13,216, 61, 80,227, 51, 31, 23,173,248,119,121, 8,198,223, 2,172, 11, +184, 15, 92, 81,194, 2,142,241, 46, 99,161, 7, 17,189,189, 24, 43,130, 71, 96, 93, 66, 83,149, 29,165,145, 96,226, 48,217,251, + 27,245, 83,149, 36, 42,145, 58,201, 92, 67,172, 41, 66, 51, 60, 0, 60, 7,104,111,142, 90, 20,251,189, 2,127, 63, 15, 89,120, +177,218,238,142,119, 10,151,155, 19, 75,119,164, 45, 57, 74, 92,217,222, 53,173, 72,184,234, 53, 32,123, 52, 73,212,100,198, 36, +104,198, 45, 8,219, 53,243,196,254,123,200,146, 35,100,214,103, 52, 73, 99, 59, 63, 53, 9,185,177,236, 95,187,180, 48,136, 84, +127,152, 77,164,246,184,177,155, 61,213, 99,168,247,195,128,142, 88, 57, 71,118,129,160, 68, 0,107, 5,139, 95, 56,195,217, 81, +205,199,240,214, 67,245,181, 2, 77, 48,105, 86,131, 78,221,235, 29,196, 63,143,146, 8,171,107, 17,234,155,147, 50,126,119, 55, +150,143, 37,183,121, 66, 46, 47,242,251,215,151, 86,218,161,141,130,250, 71,114, 56, 81,160,145,129,234, 31,141,177,159, 82,193, + 78,209,192,146,209,122, 21, 80,207,246, 69,110,192,169,185, 81,229,129, 61,133,130, 87, 3,250,113, 39,254, 55,134, 16, 74, 42, +152,150, 50, 5, 6,252,173,218,106,111,176, 87,216,162,162, 76, 72,187,174, 84, 20,174, 57, 87, 71,130, 58,150, 89,171,182,130, + 88,110,199, 89, 87, 83, 45,179,220,154,149,121,196, 82, 87, 10, 31, 53,230,155,137, 28, 75,224,255, 65,228, 14,188,212,178,151, +196, 20,142,122,184, 95,234, 46, 75,119,162,221,210,183, 88,161,163, 63,157,217, 88,189,213,237,119,239,117, 30,108,239,126,157, +200, 73, 1, 30,162,180,234,207, 31,199, 3,103,165,224, 56,166, 64,185,200,213,218,114,167, 55,216,199, 36, 64, 33,167, 55, 56, +112,219, 71,143, 10,136, 30,117,230,238,115, 85,118,138, 93,105,174,246, 14,118, 43,149, 80,202,132,226, 29,129,197,117, 3,166, + 29,208,167, 13,135,190, 94,169,167, 70,102, 89,234, 76, 43,139, 40,202,241, 16,113, 13, 13, 2, 53,240, 28,226, 14, 42,233, 67, + 70,156,249, 8,172,108, 47,182, 14,163, 33,116,193, 50,209,110,182, 52, 21,199, 81,150, 50, 59, 37,213, 55,106, 55,159,221,125, + 74,150,200,135,173, 47,207, 63,191,124,221,223,250, 17,125,135,235, 50, 63,176, 95, 90, 11,230,148,206, 61, 42, 1,179,128, 46, +152,161, 94,240,125,184,249, 80,216, 6,170, 7,158, 43,223,174, 35, 37, 76,132, 48,249, 84,124, 17,120, 81, 28,143, 70, 67, 27, + 51,123,129, 39, 4, 27, 78,134, 99, 76,229,207,145,224,113,187, 51, 82,233, 33,116, 33, 64,152,245,107,240,231,211,139, 55,236, +106,253,225,230, 38,166,128,206, 37,157,188,189,178,209, 94,184,240,118,251, 61, 58, 0,215,214,215,238, 72, 20, 97, 82, 68, 42, + 80, 36, 39,229, 50,121,178,254,232,213,183,119,176, 22, 2,222, 3,210,156, 84,201, 3,207, 93, 1, 85,155,211,157,137, 39,234, + 70,227, 90,249, 25, 58, 17,185, 75, 11,205,129,233,212,105,192, 1,153,167,157,168,244, 84, 10,247,236,136,234,220, 82, 77,161, +107, 40,192,145, 39,173, 72,122,138, 10, 33, 37,161,205,148,246,147,166, 68,127, 19, 51, 91,207, 51,133,236,135, 97,151, 59,213, +231, 26,220,139,247,254, 11, 64,217,181,228, 70, 13, 4,209,182,219,223,140,147, 56, 95,146, 33, 10, 32, 33,148, 8,150, 72,220, + 32, 11, 36, 86,236,184, 3,107,238,192,154, 59,112, 7,246, 32, 33, 36, 4, 66, 72,136,160,128, 80,130, 2,153,204,100,198, 99, +187,221,254, 52, 85,213,237,137, 19,178, 97, 22,179,178,108,181, 93,221,245,123,245, 30,158,239,180,194,186,229,195, 52,247, 63, + 87,208,182, 80,210,199, 33, 37,107,151, 7, 17,235, 85, 56,134,202,137, 49,195, 22, 8,230,104, 72, 71, 21, 95,147,193, 33, 33, +181,136,234,144,144,105, 94, 44,140,170, 86,130, 37, 27, 78,228,236,148,136,241,112, 43,186,196,133,135,185, 33, 3,115,114,240, +174, 16,194,219, 94,132, 38,227, 42, 44,225,249,112, 37, 88,176,227,240, 90, 25,228, 80, 77, 69,160, 81, 33, 68, 85,200, 38, 59, + 76,191,149,181, 20,117,129,147,205, 56,129, 95,233,153, 50, 42,162, 98, 0, 94, 33, 4,179, 34, 64, 40, 60,195,229, 68,146, 19, + 88,193,198,220,198, 81,113, 40,171, 84, 97, 91,168,238, 2, 94, 47,243, 66,156, 19,188,177, 78,166,207,216,149, 67,199, 90,123, +200,214,138, 84, 72, 52,131,149,113,207, 15,185, 55,157,156,132,182,117,119, 51,220, 94,239, 77, 69,125, 60,146, 35, 1,110, 78, + 69, 54, 22,255,192, 44,147,182,129, 15,193, 62, 50,106, 18, 8,160,209,164,184, 84,118,119,109, 93,174,197,108, 32,171,208,203, + 74,101, 57, 92, 45,123,124,119,117,110,148,200,239,195,108,130,226,199,200, 30, 3,139, 31, 43,132, 71,232, 99, 93,179, 69,134, +100, 28, 14,149,107, 54, 99,123,247, 70,188,115, 43, 30,140,139, 52,203,147,188,158, 20,104, 74,169, 84,130, 76, 41,164,204, 13, +130,219, 56,224, 61, 31, 63, 79,222, 88,162, 1,111,196,215, 34, 27, 14,125,176, 17, 89,169, 55, 95, 10, 33, 17,124, 80,160, 68, + 38, 43,145, 43, 74,219,172,225,189,135,191,133, 96, 49,151, 57, 77, 21, 88,252, 34,197,210,165,129, 52, 51,142,100,176,201,255, + 48,168, 50,195, 55, 76, 40, 29,108,225,144,142, 8, 41,250,182, 35,218, 88,223,180,168, 26, 66,112,123, 45,174,166, 58, 45, 19, +184,200,117,193,211,115, 89,151,253,184, 63, 76, 7,105,150,160, 0,136,101,201, 82,144,164,138,113, 15,112,243,208,239, 77,210, + 81,173,180, 80, 29,172,168,114, 29,175, 44,203,118, 2, 75, 19, 15, 41,159,251, 16, 74,195,226,226, 48,166,172,220, 98,109, 55, + 2, 30,236, 19,123,101, 20, 44, 8,153,234,132,216,198,166, 19,201,137,107,175,135, 32, 40,151,202,157, 58,119,214,140, 32, 92, +211, 57,224,168, 32, 6, 92,112, 5,164,194,224, 88, 57,184,132, 7,183,239,127,252,241, 73,243,111,225, 20, 43,110, 61,135,246, +158, 11, 38, 3,175,160,180, 32,184,113,114,108,124,174, 60,218,218,123,124,103,207,223,180, 89,193,198, 31,154,159, 91,246,235, +223,236,221,175,195,253,225,254, 80, 12,184, 31,185,107,247,242, 38, 56, 29,126,149,211,227, 42,159,168,100,112,131,207, 63, 92, +244,215,231,157, 36, 99, 7,121,242,118,252,170, 98,227, 76,158,228,229, 89,131,113, 72, 99, 58,115, 22, 95,245,182, 49,237,176, +231,175,241,126,224,172,157,201,247,203, 75, 71,195, 66,102, 86, 51, 21,226,128, 26, 45, 47,159,191,120,242,236,169, 7,113, 79, +121, 53, 87,101,247, 51, 67, 88,189,179,122,243,243,159,125,108, 9,187, 81, 63,190,174, 28,183, 77, 6, 77, 19, 29,249,225, 43, +129,156,180, 52, 62, 77, 39,123,101, 36,125, 76,200, 94,155,237,212, 1, 69, 41, 53, 3,179,177,218, 12,240, 40,117, 65, 82, 6, + 75,241,213, 12,213,216, 57,223,187, 28, 47,151, 98, 58,139,205,170, 40, 4, 72,225,182,134,154,104,194,140, 54, 19,101,231, 2, + 35, 90,253, 92, 83, 11, 24,253,135,150,215,106, 86, 50,190, 56,112,250, 95,135, 59,252,254, 10, 64,215,181,244, 68, 13, 69,225, +115,251, 26,218,153,206, 48, 12,143, 0, 38,110, 12,136,132, 5, 91, 19, 93,251, 23,252, 15,174,117,173,127,193,133,123, 23, 38, +110,248, 31,110,240,145,104, 76,120,133,196,240, 18, 4, 90,218, 50,189,189,173,247, 59,183, 5, 7, 48,179,106,102,210,105,111, +123,207,249,206,235,251,106,251,126,115,251,212,132, 4, 8,169, 81,192, 97,153,108,125,217, 93, 49,110, 51, 12,215,248, 65,161, +111, 1,194,190,224,252, 19, 44, 26,129, 52, 47, 92, 69,193,170, 58,108,132, 88,164, 6, 56, 5,174,162,237,181, 61,107, 44,145, + 23, 72,164,218,230,204, 26, 32, 96, 17, 90,160,192, 70, 91,125, 71,227,116, 7, 96, 55, 16,158,239,181, 4,164, 60,244,182,181, + 92, 6, 46,120,147,140, 76, 51, 59,113,237, 72, 14,210,104, 88, 22,187,231, 63, 36,201,172, 72,178, 66,155,154, 33,179, 16, 23, +149,184,146, 59,129,149,201, 73,114, 28, 4, 10,123,151, 92,174, 23,185,147,254,204,185, 58, 78,138,152, 43, 47,204,251, 38,174, +117,199,111, 88,246,255, 55, 69,142,166,224,155, 63,197,246,229, 71,138,120,129, 41,243, 29, 37,189,178, 92,158, 13,250, 61, 63, +201,228,126,148,107,192,171,111, 55,132,103,163,147,188,204,193,199, 8, 23,173, 56,212, 68, 87, 80, 77, 0, 94, 75, 21, 96, 76, + 92, 64,247, 68, 31, 38,138, 21, 30, 73,116, 29, 49,225, 89,227, 45,187,227,120,235, 71, 73, 2,206, 6,100,154, 38, 3,107, 42, +112,163,164,220, 78,165,233,120, 14,120, 98, 49, 64, 44, 65, 58,168,214, 88, 43,116,105,182,231,173, 46,244,102,166,194, 95,191, + 53,222,203, 79,211, 34,205, 81,115, 76,121,188, 92, 59, 67,151, 77,188,126, 3,186,190,118,179, 34, 85, 70, 4, 9, 5,241, 22, +128,163,152, 10,173, 40, 83,159, 55,228, 37, 68, 91,128,226,115,137, 84, 18, 19, 3, 25,114, 34,147,125,196,103,208,153, 60,142, + 79,236,209,190,153,145, 25, 65,186,181,156,213, 72, 39,177, 81, 16, 51, 27, 9,251, 72,152, 36, 88,141,152,244,143, 7,221, 65, +156, 70,243,253,249, 29, 40,108,112,150, 29,156,124,126,154,107,199, 84, 84,141, 68, 27,151,133, 48, 19, 3,133, 41, 97,143,185, + 94,219,239, 30, 71,135, 22,191,177,170,144,168, 55, 1, 2,162, 77, 14, 18, 84, 94,123, 16,246, 55, 14, 55,177,115, 85,221,194, +121, 53, 56,199, 89,116,219,106,102, 95, 52, 58, 89,156, 91,250,182,251,165,223,153,200,164,204,100,234, 92,123, 2,164,164,113, +229, 70, 85,154,111,193,164,108, 17, 3,240,215,216,128, 70,111,188, 57,114,184,217,192, 97,125, 27, 23, 96, 11,147, 94,157,150, + 47, 85,225,217,208, 62,227,213,181,140,148, 39,184, 70, 17,182, 10,125,205,113, 46, 75, 97,231,194, 30,146, 45, 43,247,126,184, +176, 52, 88,124,236,175,174,188,154,166, 21,190,166, 35, 16, 6,111,238,209,246, 25,173,239,211,250, 5, 69, 74,163, 45,122, 48, + 71, 15,167,233,105,159,150, 39,232,207, 54,173,125,165,247, 63,105, 47,165, 56,150, 50, 63,171, 10, 48,179,151,197, 80,200,210, +202, 79,124, 39,240,165,212,232,193, 86, 89,118,254, 61, 59,120,247,230,217,147,143,159,214,118, 78, 15,246,232,242,245,243, 23, + 47, 63,188,125,212,189,183, 21, 31,186,174,151,131, 73, 80,221,162,223,170,140,101,228, 62, 77, 4,118,161, 51,166, 23, 22, 74, + 65,158, 15,119,101, 25, 53,132,154,130,203, 80,131, 65, 1, 68, 25,154,234,146,213, 35, 88, 11, 68, 25, 42,170,154, 56,152,170, +170,186, 69, 61,130,196, 87,211, 29, 51, 50,113,193,230, 86,152, 70,142,154, 79,166,162,127, 78, 33,168, 42,239,226,109, 55, 15, +214,164,181,209,118,132,186,185, 5, 54,133,154, 32,168, 81, 82,102, 49,169,202, 8,122,115,153,150,113,165, 18,141, 78,179,223, + 10,178,209, 78,202,171,102,188,235,105,216, 59,140,251, 29, 36, 43,127, 5,160,235, 74,118,163, 6,130,104,119,187,237,246,216, + 51, 56, 9, 9,151, 32,144, 8, 32, 17, 1,226,128, 4, 7, 14, 92,224,146,191, 64,226,107,184,113,226, 3, 56,241, 5,156, 17, + 92,217, 36,144, 34,144,128, 32, 8,160,100,200,216, 30,175,211,110,170,170,123,150, 44, 72,115,152,163,213, 75,117,213,171, 87, +239,201,147, 36, 83,166,248, 59,157,126,138, 75, 8,246, 41, 30,216, 82,218,102, 67, 54, 16, 6,158,163,118, 77, 8, 69,229,100, +138,230, 79,189,196, 80,224,132, 65,182,230, 41,238,135, 18,189,156,242,118,136, 80, 15, 84,165,248,224, 98,143,137, 56,151, 22, + 80, 22,214,203, 76,178,128, 68,144,208,193, 38, 64, 10, 14, 87, 86, 58, 83, 56, 77,255, 70,119, 62,133,121,168, 24, 6,129,146, + 19,172, 49, 56,150,195,100,177,208, 9,215, 46, 63, 68,115,129, 10, 35,152, 80,202, 64,172, 35, 12, 59,146,190, 18,165, 13,167, +243,240,142,186,132,185, 63, 49,193, 44, 16, 48, 83, 27, 39,233,113,115,226,211,221, 49, 39, 88, 15, 43, 32, 88, 95, 45,141,209, +239, 13,193, 41, 78, 83,191,180, 78,172,239,203, 75,171,170, 31,123,163,172, 78,107, 13,121,110, 32,121,228,123,177, 52,144,113, +247,148, 84, 72, 33,231, 37,118, 94, 41, 1,163,192,136,206,215,116,107, 27, 58,183,218,166, 19,134, 53,228,158, 41, 16,253,229, + 89, 67,208, 77,221, 88,183,251,154,161,182, 39,108,216,198,122,143,235, 64,111, 31, 20,104, 28,138,176, 76,196,228,122, 24, 24, + 95,127, 41,234, 82,227, 90,143,171,246,251,110, 49,136,195, 36,150,185,105, 85,205,107, 97, 98, 40,115, 16, 4, 67, 46,252,152, + 52, 62,149,199, 14,234,110,133,139,170,129, 98,217,205,224,105,234,253, 22, 85, 55, 8,189,107, 27,252,205,103, 8,236, 72,232, +236,108,211,128,102, 47, 59,210,153,236, 28, 13,176, 67, 68,242,168,186, 30,183,179,118,221, 97,112,115,102,233, 62, 83, 1,165, +202,119,129, 24,101,236,184,154,131, 91,224,160,158,238, 47, 15,243,189,162,202, 35, 21,237, 12,119, 80,151,131,146, 42,248,206, +170, 41,140,243,154,154,143, 11,226,190, 65,192, 36,155, 14,228,101,213,249,234, 96,109,152, 15,233,121,246,238,108,222,126,241, +225, 37, 53, 56, 17,137, 28, 87, 35,120, 30, 32, 13,239,133,253, 12,246, 87, 59,119, 45, 27,220, 5, 81,200, 28, 49,153,155,186, +109,222,127,123, 7,219,145, 22, 35,120,164,165,224, 51,254,177,176,154, 82, 86, 35, 38, 76,198, 85,202, 28, 21,207,115, 93, 8, +219,145,112,127,102, 29,185,185,163,131,189,171,112,101,160, 24,178, 66,164,228, 57,131, 55, 8,142, 68, 18, 37, 41,182,184, 33, +122,232, 40,228, 69,215,194,151,193, 97,136, 49,245, 87,105,251,243,245,126,115,247,236,173,167,127,216,238, 62, 27, 5, 76,157, + 97,231, 18,118,243, 58,187,199,217,253,217,234,235, 67, 14, 6, 43, 87,216,131, 45,182,185,205,222,127, 98,123,127,253,180, 88, +203, 74,150, 52,108,121,194,178, 20, 74,233,243,233, 24,109, 0,225,215,171,181, 8,227,178,122,123, 53,220,122,248,234,209,246, +199,231, 23, 54, 46,250, 55, 46, 63,123,252,228,107,246, 99,169,151,180,228, 22, 97,105, 76,214,136, 9,222,185,200,199,198,152, + 66,250, 28,150, 40, 16,177, 81,142,144,224, 8, 21, 68,167,122,201,175,209,111, 44,170, 22,198, 34, 92,150, 78,198, 16,164, 0, + 99,141,240,166, 73,241, 20,140, 99,243, 65,211,121, 79,178,104, 75,162,222,234, 35,253, 51,116,134,241,195, 64,202,172,202,197, +127, 18,117,115,108, 22, 86, 56, 17, 27,207,184,247, 73, 8,227,202, 26,162, 29,114,231,153,128, 33, 85, 41, 47, 36, 6, 10, 92, +127, 76,132, 42, 83,210,106,192, 1,161,185, 91,198, 75, 59, 8,189,168, 89, 51,101,242,232, 5,228,209,176, 99, 76,250, 99,201, +230, 63, 1,248, 58,151, 21, 39,130, 40, 12, 87, 85, 87, 95,146,134,100,112,198, 11, 14, 56,130,139,128, 6, 21, 92,136, 43,223, +192,133, 15,224,202,119,240, 1,124, 11,223,198,133, 43, 69,241,130, 59,147,128,136,206, 48,104, 98, 58, 73,119, 87, 87,149,245, +159,170,206,164,101,116, 55, 67, 72, 72, 58,169,211,231,242,159,239,151,221,197,204, 93, 89,100,224,188,135, 1, 43,227,185,232, + 55,214,163, 0, 3,173, 1,160, 47, 43, 26,232, 79,168, 43, 68,162,251,200, 72,218, 12,247,147, 77,240, 6,253, 47, 85, 89,162, + 12,208, 1,213,173,193,108,195, 49, 95,245, 84,115, 56, 85, 32, 94,129, 10,224,254,116,103,186,138, 48,244, 43, 97, 2,217,200, + 72,246,180,238, 99,177, 27,175,158, 9, 81,161, 15, 67,186, 67,138,234,226, 12,146,195,189,221,131,217,110, 56, 17,190,152,218, + 50, 25,161,180, 60, 79, 10,226,125,119,167, 1, 19,156,119,232,160,195,252, 64,213,155, 74,111,218, 57, 9,198,164,146,251,182, + 31,227,127, 47,208,120,215,129,246, 26,186,234,216,106,120, 30,121,202,110,200,199, 40,196, 51,190,151,203, 52, 21,223,231,170, + 79, 81,170,151,136,253, 62, 39, 66, 15,191,136,153,165,165,205, 23,235, 62,105,165,108,217, 80,146,163,129,246,117, 15, 84, 45, +119, 11, 11,118,198,110, 72,118, 11, 5,142, 1,215, 85, 99, 6,204,127, 53,214, 3, 0, 61,219,192, 20, 90, 76,138,219, 71,195, +241, 97, 62,159,234, 5,211, 57,139,174,196,201,245, 75,233,236,247,186,166, 25, 60,176, 51,107, 59, 92,214,199, 39,171, 60,135, +234,198,189,179, 92,160,128, 40,149,201, 34, 92, 53, 77, 4,214,134,186, 21,181, 48,184,169,187,111, 65, 67,216, 35, 13, 75, 98, + 23, 58,113,172,134, 61,126,239, 70,242,118, 82,171, 70,248, 4, 21, 53, 66,208, 32,129, 3,234,254, 81,196,199,240,151,144,242, +131,148,120, 29,103,122,210,168,139,118, 50,161,148, 52,237, 16,164, 99,172, 67,146, 61,124, 33,145, 13,201, 59, 14,182,128,103, +155,169, 55,130, 22, 0, 16,123, 53,150, 53, 92,157, 41,133,213,214,238,238,243,133, 13, 13, 10, 19, 21,124,141,249,154,158,232, + 31, 62, 93,254, 52, 8,205,180,233, 74,166,222,149, 42,115, 23,220, 55,115, 41, 19, 84,240, 97, 68,102,201,150,188, 51,193,106, +165,151, 98,124,116,231,253,236, 93,144,193,111,239, 80, 45,150, 2,206,130,145,224,219,118,109,248, 64,161, 58, 17,228, 93, 66, + 85,165,143,240,156,250,202,144,123, 96, 60, 71,101,244,160,223,119,249,123, 81,174,168, 19,233,162, 97, 54, 47, 23,244, 92,119, +160,244,126, 62, 56, 93, 46, 82, 9,179,226,210,232,203,189,228,219,166,126, 36, 31,142,196,222,213,154,189,156,178,207, 61, 86, +221,100,211,140,125, 33, 90,112, 77,237, 59,176,106, 34, 84,123, 99, 6,137,141, 87,238,186,220,252,254,136, 61, 24,209,225,217, + 94, 68, 67,124,155,130,114,138, 21, 25,135,156, 68,147, 15,183,190,190,121, 60, 59,254,241,233,217,139,107,119,101,182, 84,207, +159, 60,125,245,241,245, 97, 54, 84,160,131,171, 24, 89, 99,156,112,236,185,164,192,181,185, 34, 61, 86,158, 78, 72,141, 61,137, + 69, 35,141,178,198,138,162, 92, 22,101,225,199,129, 30, 4, 70, 55,105,223, 33, 39, 24,184,166,230,155,135, 4,113,159,215,243, +214,178, 45,248,104,208,221, 96,107, 92,106, 2,142,226,188,114, 60, 7,138,185,248, 39,116,112,103, 89,210,116,182, 94,194,239, +147,250, 50,220,171,201,169,178,148,200, 79,184, 28,100, 23,246,210,131, 68,196,101, 93, 21,205,186,106, 84, 12, 29, 73,211,139, +212, 90,175, 42,189,242, 84,115, 50, 58,183,108, 27, 35,121,231,109,240,115,210,118,251, 31,184,241, 31, 1,248,186,186,222,166, + 97, 40,234,196,137,155,172, 99, 3,105,218,196, 3,154,216, 38,222, 16, 47,252, 4,254, 39,127, 0,241,202,127,224,137, 15, 9, +134,166,105, 15,160, 33, 13,214,181, 93,218, 38,177, 99,115,207,189,246, 84,198,152, 84,173, 90, 21,181, 81, 98,223, 28, 31,159, +123, 78,113,151,114, 70,118,231,197, 4, 24,103, 73, 31,208, 61,112,140,132,140,198,196,166,139,104,242, 17, 63, 1, 8,214,105, +200,122,252,224,114, 7,165, 5, 32,174,231,179,243,134,245,148, 62,198,152,101,137,156,194, 26,114,224,200,177,130,215,158,108, + 12, 15, 3, 66, 11,220,131,242, 77,133,219, 0, 52, 13,208,141,114,152, 83, 5,244,108,230,125,199,185, 63,165, 13,190,130,179, + 43,129,203,140, 22,113, 69,166,157,124,117,200,227,207, 4,149,218,169, 92,234,219,115, 92,132,203,192, 37, 62,227, 94,240,217, + 48,245,129, 93, 94,147,108,134, 94,215,139,137,226, 72,232,228, 35,132, 9,158,108,197,194, 45,135,247,212, 66,117,211,224, 38, +107, 52, 31,228, 84,248,217, 94,136, 56,146, 70,116, 30,174, 26,187, 77, 40, 42,135,252, 98,231, 65,185,181, 81, 90,216, 50,133, +229, 0, 35,135, 14,126,155,184,135,163, 2, 21,130, 46,241,194,178,243,127,240,120, 86,242, 70,207, 10, 97, 41,209,205, 74,224, +220,194,241, 95, 43,155, 69,145,235,112,108, 1,251, 99,238,142, 63, 95,238, 85,121, 93,102, 6,252,101,104,180,123,127,209, 78, + 90, 63, 75, 22,240, 84,232,171,107, 95, 79,236,190, 6,168, 32, 48, 4, 89, 62, 80,149,106,122,180, 39,214,236,236,213, 6,194, +164,250,124,128,126,230,209, 72, 61,220, 8, 51,171, 22, 61,253,171, 43,170, 29,160,221,195,184,206,159, 31, 20, 31, 79, 17,129, + 30, 52, 46, 2,179,161,216, 98, 25, 2,136,233,178,208, 8,191,141,116,115, 86, 22,101,207, 25,108,183, 88,205,176,214, 26, 24, +254,146,239,230, 49, 81, 52, 91,147,120, 9, 91,196, 19,118,182,154, 23,241, 24,159,197, 21, 3,184,103,116,191,201,232, 20,232, + 44,158,251, 56, 70,215,102,180,106, 87, 42,246,169,102, 4, 30, 61, 28, 31,240,213,199,223,191, 33, 48, 85,118,100, 65, 21,202, + 46, 28,194,241,202, 28,138, 45,209,127,154,204, 72,127,220,154, 22, 63,134, 51,211,167,159,206, 62,228,162,180, 18,211, 61, 42, +156, 62, 54,158,107, 38,107,180,116, 56,201,212, 99,125,103,164,158,248,152, 10, 22,149,109, 52, 99,227, 33,122,184,119, 48,109, + 46,151, 16, 97, 9,193, 28, 44,199,185,202,195,131,214, 13, 58,201,125,105,148,247,182, 27,151, 69,231, 58, 24,200,232,209,116, +222,108,142,243, 23,187,251, 52, 39,166,175,213,203, 67,117, 94,171,235, 47,170, 63, 82,205, 51,213,141, 99,222,203, 69,242, 44, + 57, 81,234, 77, 74,118, 20,220, 32,110,210,226,135,177, 9,155,120,117,184,165, 94,109,113,180,239, 79,245,235, 68,157,158,169, +221,223,106,100, 86,111,175,222, 13,167, 75,253,181, 11,174,233,251,197,211, 39, 71,214, 89, 66,121,142,239, 4, 93,201, 13, 51, +190,106,231,156,154,237, 59,201,230, 73, 81, 76, 94,130,144, 80,136, 49, 14, 99, 33,102, 98,195,152, 10,193,247,145, 50, 17, 0, +239, 19,146,143,111,209,144, 93,168,193, 88,214,253, 90,115,202, 61, 29,167,217,108, 57, 25,232, 28,255,235, 53,171,254,237,249, + 79,154, 20,222,176,148, 7, 47,138,123, 33, 52,245,182,217,217,173, 31,211, 96, 71, 0,157,109, 65,127, 14, 61, 26, 86, 85,196, +111, 52,213, 12,246, 53,219, 65,217,180,177,151,251, 20, 25,125,163, 27,190,195,233, 88,133,251,109,235,255, 8, 64,216,181,182, + 54, 17, 68,209,153,217,157,236, 38,186,166,248,104,227, 23, 69, 84, 16, 4, 63,249, 93,252,237, 34,136,127,192, 39,130, 72, 89, + 13,133, 24, 99,246, 49,143, 29,239,107, 98,138, 20,161,148, 66, 10,233, 54,115,239,156,123,239, 57,247, 64,210, 48,151,183,137, + 17, 16,214, 98,159, 45,154, 38, 3,233,181, 49,172, 95, 69,190, 34,142,118,104,253, 58,188, 4,184, 96, 86,195, 87, 89, 1, 22, + 67, 66, 59, 75,220,104,110,204,145, 89,232,108, 71, 39,181, 54, 62, 16,203,109,225, 45,176,171,200,239,171,181,135,154, 0,199, + 65, 56,248,174,169, 70,195, 44,139, 67, 39,180,154,196,222, 38,174,173, 52,150,214,113, 64, 61, 3,135,218, 77, 30, 34,176,221, +127,247,137,188, 65, 48,227,139,127, 83,190,189, 15,251,211,100, 5,217, 12, 83,188, 1, 4, 1,133,210, 62,254, 82, 82,100, 31, + 4,171,124,249,230, 62, 21,113, 34,116,190,164,165,162,209, 58,203,116,245,113, 44, 50, 47,144,127, 96,194, 59, 50,138, 89,136, +146,212,201, 92, 3, 28, 94,148,122,110, 11, 91,219,107,139, 18,192,215,249,102, 60,223,244,237,214,175,119,222, 13,126,116, 16, + 1,113,132,167,242,120,121,205, 13,228, 71, 93, 25,213,204, 52, 64,254, 10, 27, 38,200,255,130,103,231, 21,190,154, 90, 46, 29, + 69,221,142, 82, 74,153,147,123,159,241, 5,188,186, 14,169,157, 18, 96,209,117, 76,109,136,109, 64,222,164,203, 8,165, 36,235, +152,198, 26,171,211,118, 31,123, 63, 57,242,193,245, 33, 97,214,158,100,107, 69,173,211,188, 72, 85, 65,146, 87,212, 67,169, 91, + 53,166,163, 1,176,114, 84, 77, 13,159,145,234, 92, 26, 39,189, 58, 49, 23,219,136,170,123,173,109,113,157, 45,252,232, 56,193, + 1,177,203,197, 77,226,252,225,191,202, 83,138,148,236,246, 87,113, 65, 44,148, 2, 65,231, 36,222,126, 6, 42,116,239, 7,130, +196, 66,216, 85,236,229,136,231,135,177, 42, 98,220, 34, 49, 1,145,101, 71,138,220,239,208,224,244,108,185, 66, 12, 40, 68, 71, +170,168, 12, 89, 62,166,224,224, 94,149,161, 11,126,210,112,210, 40,137,243, 7,143,127, 80,101,235, 0,232,197,192,229, 84,141, + 97,160,141,246, 56,200,227,166, 57,186,136,148, 21,247,231,142,158, 65,190,157, 46, 87,131,239,120, 20, 3, 55,135, 34, 84, 97, + 50, 4, 49,148,227, 81, 86,194, 22,178,134, 91,240,134,163,134,227,104, 86,204, 72,176,170,140, 44,214, 80, 46,140, 61,100,124, + 37,106, 0, 56, 17, 46,132,130, 58,147,133, 62, 50,167,162,180,184,235,119, 1, 69,194,134,150,202, 96,210,113,209,108,253,248, +252,229,179, 27,143,213,230,131,178,239,212,221,207,202,188, 87,167, 95,213,157,159,234,199,133, 26, 44, 38,250, 94, 35, 34, 63, +152,208,150,116,210,234, 76,190, 58,112,248,224,119, 54,223, 84,251, 86,125,124, 61,149,159,252,195,206, 60, 93,232, 39, 27,245, +226,254,163, 87, 95,222,232,194, 25,168,232,235, 10,202,192,104,109, 52, 40,131,138,228,204, 14,103,108, 81, 55,221,208,241,102, +123,233,181, 37, 78,109,162, 4,156,166,220,103, 17, 34, 28,134, 54, 0, 21,220,187, 57,201,210,245,196,202,243, 60,177, 76, 98, + 73, 47,237, 27, 89, 18,250,191, 45, 2,151,183,177, 19,117,105,186,106,120,153,185, 21,250,210,146, 46, 34, 69,242, 57, 68, 17, +126,137,253, 22,204,124,183,231,103,247,154, 7, 85,105,135,224,246,190,255, 29, 6,100,127,160,195, 29, 68,185,131, 80,115, 56, +171,114, 81, 54,140, 20, 44,155,213,226,204,141, 36,171,202,206, 35,237,245,249,167,219,126, 21,143,231, 96,219,163,254, 8,192, +214,181,243, 54, 17, 4,225,221,189,243, 61,124,182, 0, 11, 9, 9, 69, 9, 21,146, 59, 68, 75,207,111,224,199,240,163,144, 40, +144,104, 40,104, 64, 2, 65, 3, 5,169, 40, 0, 41, 1, 18,236,139,239,177,187,115,204, 99,247,124, 81,220,166,200, 89, 62,239, +236, 55, 51,223,227,144, 63,129, 30,137, 62, 33, 46, 51,193,235,133,117, 70,218, 80, 94, 26,137, 81, 65,130,128,134,196,179,244, +137,183, 61, 29, 64,169,102, 96,156,193,219, 9, 58, 9, 41,178, 68, 39,152,202,212,133,158,206,147, 86,105,243,104, 76, 63,164, +156,224,144,171,196,145,249, 96, 72, 51, 68,144,142, 15,203,104, 60,106, 28,205, 84, 92,166,243, 85, 94, 54,236, 93, 78,125, 61, +107, 50, 47, 59,172, 66,110, 74, 95,156,118, 36, 38,172,215, 98, 36, 16, 13, 27,128, 41, 61, 25, 21,119,154, 31, 65, 20,184, 70, +187, 64, 61, 46, 87,195,247, 16, 48,251,254,149, 14,195,117,231,178, 81,207,200,195, 88, 49,118,229,250, 62,168,162,168, 0,224, + 86,214, 44,211, 97, 53, 51,139,138, 76,214, 46, 26,219, 52,126,219,185,173, 29, 82,214,170, 32,168,163, 51,100, 84, 99,105,176, + 78,176, 26,127,206, 25,214,116,211, 83, 70, 26,147, 54,184, 48,229, 92, 0, 1, 2, 59,190,137, 33,124, 18,204,212,237,151,195, + 33, 66,112,252, 17,216, 27, 28, 94, 31, 15, 42, 2,163,186,241,127, 52,126,177,248,233,249, 21,240, 83,176,142,231, 41, 34, 85, + 18, 55,108,189,190, 93, 26,124,250, 29, 74,252, 80,117, 11,136,235,201, 89, 30, 75,124,239, 55, 13, 22, 56, 90,154, 59,167,243, + 50,121,178, 54,111,191,116, 68,130, 85, 29,105,216, 82,242, 36, 33,171, 43,223,213,109, 47,238, 52,180, 0,129,125,142,189,158, +118,145,148,220, 96,125,212,108,227,135,169,187,141,240, 38, 22,249,188,105,119,114,201,138, 51,134, 4, 91,107,222, 64,174,143, + 30,126,251,121, 58, 26, 12, 32,250, 0, 58, 79,142,213,170,147, 46,139,236,236, 61, 23,220, 36, 67, 96,158,205,255, 97,211,198, + 92,125,186,114, 88, 93, 76, 12, 37,147,246,131, 45,243,146, 76,222,193,181,189, 51, 33,161, 41,225,134,142,103,200, 0, 29,249, + 6, 75,168,172, 12, 87, 64, 56,112,120, 73, 94,108,206,165,228,206, 8,253, 83, 67,142,181, 41, 97, 25,155,196,181,178,102, 80, +140,229,201, 68, 79, 49,182,149,158, 97,158, 21, 77,223, 33, 0, 79,204, 56, 47, 37,195,177,214,182,164,114, 99,207, 84,109,194, +248, 75,136,155,204, 55, 50,113,220,168, 69, 83,163,133,157, 65,139, 41,188, 44,125,110,178, 79,155,143, 47, 95,173,159, 62,127, +124,252, 76, 29,127, 87,234,181,122,241, 70,125,126,199, 5, 29,255,225, 82, 21, 11,181, 93,169,234, 72,149, 39,106,254, 64,109, + 23,216,140,171, 75,226,232,168, 26, 98,200,195,111,229,206,232, 13,250, 83,223,157, 67,105,251, 51,139,136, 68, 61,186,231,127, +125,205,222,255,248, 80, 44,138, 11, 60,153,120, 80,161,238,237,206, 98, 33,243,140,224, 7, 9,224, 83,127, 99,194,173, 30, 3, + 59, 98, 14,214, 16, 0,119,152,174,232,216,107, 14,180,157,186, 18, 54,179,144,219,165, 75,138, 65,228, 49,164, 52,112, 18, 14, +227, 92,125,216, 44,106,111,157, 46, 70,217,122,162,111,154, 78,114, 42, 78, 13,243, 33,248, 73,200,144, 44,176,166,251,222,240, +218,146,239,115,173,151,217,221,251,213, 73,166, 19, 68,159, 51,163,171, 36, 33,133,223,224,137,204,237,118,150, 24, 31,180,161, +132,184, 52,205,153,205, 0,244,247,240, 60, 74,254,179, 0,129, 22,127,205,118,239,198, 74, 32, 38,195, 77,124, 11,254, 11,192, +215,181,172, 56, 17, 68,209, 91,213,221,121,244, 36, 32,153,141, 11, 5, 9,130,139,193,141,130,184,213,189, 48,255, 34,248, 29, +238,252, 6, 23, 46,252, 5,151,226, 40,130,194,160,140, 12,194, 56, 34, 51,147, 76, 38,253, 72,167,186,202,123,110, 85,119, 18, +141,146, 93,210, 36,157,238,234, 91,167,110,157, 71, 76,127,187,164, 55, 45,154, 6,116,187, 52, 26,118, 99, 6, 29, 12,166,150, + 69, 93,138,255,145,145,129, 3,208, 80,218, 94, 79,199,189, 56, 77,240,164, 11, 27, 16,121, 29,181,133,138,180, 50,158, 75,222, + 88,120, 99,132,224,107,163,196, 3, 96, 73, 61, 22,130, 63,197,112, 95,142,186, 20,204, 73, 36,168,140,209,159,149, 14,137,245, + 84, 55,126,229,149,241, 45,204, 8,226, 87,116, 61, 39,139,204,109,154,247,251,140,189, 90,173, 41, 1, 2, 10, 80,141, 28, 13, +151,213,173,172,117,218,219, 29, 4, 76, 77,135, 42,140,188,166,178, 7, 75, 41,181, 25,207,189, 86,157, 92, 27,239,167, 67, 28, + 28,196,156,187, 61,186,158, 18, 8,206, 9, 40,201,147,204, 76, 11, 99,106,151,129,185,161, 96,208,167,113, 54,151, 75,180, 95, +178, 26, 53, 43,103,244,203,255,174, 86, 85, 84,227, 29,173,250, 17,163, 93,144, 38,249, 99,158,238,231,146,200, 81, 73, 17,247, + 38,128,173, 11,172,110,252, 21,116, 99, 17,248,159, 69,156,110,192,254, 89, 14, 27, 25,139, 93, 56,174,218,146,220, 78, 42, 19, +122, 99, 37,107, 28,190,212,211,194, 13, 59,122,167,163, 6, 49,226, 91,178,165,235, 56, 59,232,106,177, 62, 67,144, 8,223, 27, + 30,140,121, 97, 71, 35,253,248,110,242,246,235,112, 86,206,251,194,241, 88,168, 90,200, 2, 74,204,126,101, 77, 36, 13, 5,153, + 76, 4, 99,217,224, 24, 99,255,121,170, 80,216, 21, 85,193,227, 46,237,166, 14, 68,251, 74,251, 72,107, 29,114, 21,142, 78,143, +180,215,122,202, 67,105,144,228,136,174,109, 48, 41, 64,239,214,201,168,131, 62,163,147, 0, 74,207,139,171,156,207, 78,121,241, + 56,238,124,172, 19, 35,136, 9,237,163,202, 76,231, 23,126, 33, 40, 73,145, 8, 11, 20, 49, 17,250,134, 60,217,192,251,108, 81, +182, 81, 97,128,112, 60,150, 73,100,103, 88, 61,160, 57,197, 7,167, 73, 58, 23, 67,130, 72, 56, 57,194, 72,194, 50, 81,163, 75, + 25, 75, 20, 37,241,133,226,211, 44, 23,133,108,196,169,209, 96,247,231,229,169, 82,212,152,192,123, 65,157,242,155,201,178, 37, +160, 37, 19, 69,215, 74, 52, 95, 90,108, 49, 35,219,236, 88, 68,155,230,216, 62,201,152,231,181,197, 56,186,253,100,124,239,195, + 27,250,248,218,220,218,139,239, 60,160,253,135,180,159, 80,249,141, 14,222,211,171, 67, 58, 56,166, 31,159,240,144,236, 93,163, +167,247,233,209,152, 14,191,211,243,207,244,165,160, 89,129,235,217,139,169,159,208,216,209, 64, 83,150, 69,166,180, 39,230,252, +152,102, 47, 39,239, 50,115,242, 98,252,236,138,126, 93,152, 51,199,181, 2,198,240,208,131,161,168, 27,227,105,203,232, 74,129, +130,228, 53, 62,174,246,197,221,110, 56,166,139,181,154,228,230,250,152,179,214,208, 81,208, 58,200, 50,158,230,226,213,167,222, +230,129, 66,136, 91, 16, 48,169,237,122, 36,183,106,153,111,203,117,178, 43,199, 46,213,162,160,181, 3, 69,170, 26,252,239, 84, + 8, 92,106,251, 51,222,202, 5, 75,235, 78,212,191,185,115, 3,129,115,182,158,150, 92,183,160,206,201, 22, 89,110,242,220, 21, + 66, 92, 48, 75,104,207,133, 66, 17,126,153, 17, 93,135,191,211, 82, 59,121, 40,251,103,228,167,219, 36,143,120,110,135,221,106, +110,248, 91, 0,190,206, 37,183,137, 32, 8,195,213,143,153,248, 41,203, 4, 9,197,145,188,128, 45, 8,178,207, 18,229, 8,172, +184, 12,103,225, 0,236,184, 2, 44,216,177, 96,153, 21, 81, 4,177, 19, 63,198, 30,207, 76, 79,211,127, 85,207,216, 49, 8,175, + 60,150, 37,219,114, 79,117,117,213, 95,223,111,143,126,158,143,104,180, 54,213, 65,242, 62,176,131,176,241,230,229, 2,210,114, + 96, 54,234,214, 56,211,240,241,176,212,102, 87, 21,169,237, 12,147,158,193,152, 82, 18,178,241,240,202,198,131, 59,132,142, 16, +168,208, 44, 16, 68, 67, 78,102,183,107,148,157, 28, 43, 35,189,170, 26, 55,149, 36,193,226,175, 92, 17,150,239, 9, 76,135,116, + 71,217,112, 31, 38,198,246, 77, 55,188,109,199, 67,164,125,112,178,204,198,229, 4,252,161, 51,209,132,209,183,192,175, 6,151, +223, 84,103,218,174,115,228, 54, 52,152, 51,181, 23,178, 55,247,119, 60,103,155, 24,127,226, 32, 77,147, 64,121,173, 15,212,239, +245,158, 92,182,255, 28,214,140,180,198, 0,227, 46, 61,235,234,142,209,139,220,221,204, 86, 33,111, 92, 21,168,101,151,162, 73, + 87,116, 95,178, 77, 18,223,145, 33,170,110,124, 92, 83, 16, 17, 85,116, 10, 97, 42,120, 0, 91,222, 82,161,102,129,107, 77,164, +130, 72, 97, 52,111,254, 62, 73, 58, 82,225,137, 52,151,234,191,241, 93, 70,162, 51, 86, 18,208, 14,228,247,165,161,142,198,174, +211,179, 94, 57,189, 6,205, 45, 92,250, 20,221, 34,218, 22, 56, 98,169, 4,114,154, 10,182,174,186,116, 33,235,208, 73, 2, 45, +208, 18,126, 21,168,169,253, 90,212,211, 39,230,245,243,236,203, 15,231,234, 29,116,247, 33,186, 50, 58,177,146, 49, 61,101, 67, +162, 96,180,216, 22,169, 84,155,126,111, 56,223, 60,112,217,252, 31, 26, 73, 45,181, 9,195,102, 34,158,192,145,135,120, 28,221, +107,205, 71, 75, 45, 24,140, 72,253,110,236,199, 28, 7,119, 31,227, 34, 3,173,241, 44,124,238,168, 55,154,173,230, 18,112, 73, +237,133,198,232, 3,213,209, 98, 34,220,147,251,145, 42,175, 79,216, 60, 8,242, 6, 62, 20,158,143,207,230,171,123, 20,143,162, +144, 86,178,119, 47,221,166,168,103,142,186,118,207,112, 18, 37,177, 42, 86,247,140, 22,171, 53, 23, 1, 7,148,237,182, 33,103, + 15,171, 29, 85, 70,239,127, 47,111, 69, 97,171,116, 60, 76, 43,223,218, 20,200,254,136, 33,184, 52, 53, 48,179, 52, 44,251,146, + 34,166,143,156,107,223,142,215, 75, 67, 20,123, 1,234,163,111,245, 21,205,232,226, 21,217,202,254,188,243,159,215, 64, 47,233, + 11,154,188,163,222, 21,189,223,210,135,148,153,146,119, 52,156, 16,189, 96, 59,144,111,116,249,145, 78,111,232,161,160, 50, 71, + 72,182,150,166,138,206, 7,100,115,154,212,201,155,241,116,244,148,104,244, 50, 44,199,239,215,183,159,174,191,102, 89, 6,156, + 80,205, 19, 41,174, 44,145,109, 99,254, 72,192,246,136,196,204,158,142, 0,215, 24,163, 27,229,186,156,128,181, 29,118,134, 51, +244,195,218,201, 32,233,107,224,162,155,246,243,146, 69,188,113, 86, 40, 10,251,124,203,253,171, 15,149, 38,106,223, 11,117, 17, +206,210,166,193,135,132, 23, 17,230,169,191, 38,155,218, 98,140,122, 36,156,137, 95,149, 79, 98, 94,202,218,220,182, 55,103,189, +105,215,118,115, 87, 20,197, 38,175,214,219, 34,203,202, 13,102, 48,195,178, 66,207, 11, 86,101,146, 7,180, 96, 46,214, 70, 87, +254,160, 12,225, 31,149,250,143,165,247, 18,241,212,145,136,242,224,241, 71, 0,186,206,101,183,137, 32,136,162,213,243,176, 61, +227, 71, 18,136,147,176, 0, 34,196, 6, 20, 62,130,255, 99,207,255,192,146, 21, 11,132,132, 20, 33, 68,136, 44, 5,226,241,216, +238,121,117, 79,209, 85,221,243,112, 6,162, 44, 99, 43,242,180,171,187,111,221,186, 39, 24, 28,222,189,166,133,229,122,250,113, + 48, 45,148,220, 87,123,158,166,180,252, 90,158,184,113,132, 35,134, 94,107, 10, 2,164,198, 28, 97, 97, 71,214,237,158,147, 42, +235,148, 53,114, 23,120, 45,141, 28,155,102, 38,189,163,166, 96, 95,243, 38,116, 94, 10, 25,161, 77, 88,116, 97, 99,203,168,113, + 52, 11, 72,119, 14, 8, 56,169,142,198,177,185, 24,155,213,178,171,234, 69,104,190, 20,193,212,243,126, 84,169, 53,187,138,102, +160, 29, 7,105,142,216, 85, 51,191,135, 51,236,209, 54,154,226,142, 86,250, 4,199, 65, 19,173, 91,212, 13,126, 57,131, 36, 95, +194,133,203,115,182, 60,247, 86,160,135, 46, 51, 37, 30,225,179,133,152,120,240, 39,201,111,182, 42,227,224,115, 75, 73,155,240, + 11, 54,205,249,159,140, 40, 77,189, 86, 13, 39,207,148,163,140,241,225, 62,165,254,218, 15,132,205, 64,252,151,101,243,207,235, + 67,213, 37,239, 61,108, 49, 8,247,127,240,163, 26,141,181,224,221, 37, 2, 72, 52, 60,170, 49, 66, 94,125, 2, 39,128,210,220, + 51,180, 39, 25,255,100,170,252, 40,168, 99, 45,164,192, 74,120,143, 35, 90,161,133,134,185, 79, 86, 21, 27, 11, 97,174,104,185, +130,219, 13,158,204,188,183,111, 70, 31,191,168, 66, 7, 1, 73,227,252, 91,211,220,242,242,248,201,234,254,118, 58, 57, 74,179, +132,221,228,245, 54, 79,105, 95,228, 64, 45,135, 43,118,235,158,122,252,110, 4, 1, 45,184,155,111,193,238, 50,236,185,217, 78, + 97,115, 14,201,168,110, 14, 10, 62, 48, 11,150,117,171, 54, 41, 15,153,102,206, 97, 82,184,222,173,125,209,201,213, 77,220, 16, +109, 23,241, 40,150,133, 52, 7,151, 40,156, 73,115, 74, 17,206,146,152, 87,133,197, 97,120,108, 69, 79,247,155, 40, 28,203,114, +231,187, 29, 73,116, 24,176,218,165, 66, 91,191,158,223, 36, 11,136,182, 57,108, 91, 7, 86, 3,180,106, 11, 91,110,204,201,134, +175,166,244,220,230,147, 89, 65, 25,236, 21,180,130, 62, 12, 92,209,132, 13,122,126,243,251,103,155,221,215, 89, 57,186,231,206, +244, 84,100,221, 1, 41,108,238,197,203, 11,249, 11,190,190,215,209,165,191,188, 84,242, 56,188, 15,224,110, 5, 31, 62, 19,116, + 23, 94,153, 85, 7,250, 28,234, 51, 50,198, 92,229,180, 18,206,174,224,226, 29,188, 54, 53,105, 15,167, 18, 84, 73, 52,219,217, + 26,198, 11,184, 76,224,233, 9, 57,103,112, 5,215,223,224,211,119, 60, 79,231, 75,255,244,206,187, 46, 43,115, 34, 84, 21,113, + 10, 52,219, 38,168,174,207,227,133,249, 36,101,182,181, 30, 85,103,103,180, 45, 82,167,197,187, 33, 79,218, 25,178,164,161,164, + 58, 0, 45,167,229,209, 19,212,213,182,174,107,199,219,112, 40, 84,196,126, 95,114,112,236,173, 93, 90, 98,119,252, 65,241,144, +180,164,186,239,206,193,216, 42,192,255, 98, 94, 60,215, 63, 66, 22,105, 88, 91,155,134,139,121, 48,213,117, 41,139, 52,201,210, +125,181,163,202,142, 69, 73, 62, 56,205,101, 93, 91,213,161,151, 7, 9,220,113, 96,221,155,234,129, 66,248, 7,144,164, 55, 47, +130,226,144,152, 48,204,161,249, 43, 0,101,215,210,219, 52, 16,132,247,229, 71,156,186,105, 43, 82, 42, 85, 66, 21, 18, 82,165, + 86, 28,184, 33,129,196,157, 51,226,196, 31,224, 15,242, 7, 42,196, 25, 20, 78, 8, 9,149,240,168,104,201,171, 73,214,241,238, +178, 51,227,245, 3,114, 33,202, 37,142, 18,219,107,107, 60,243,205,124,223, 87,241,155, 90, 38, 30,156,176, 75,159,104, 3,152, +196, 84, 46,115,144,220,116, 6,247, 6,154, 62,181,225, 81,168, 74, 4,142,127, 2,142,217, 87,105, 36,146, 72,160, 63, 25, 36, +232,182,176,229,202,109, 8,221, 70, 51, 98,102,171, 54, 32, 17, 58, 16, 16,113,208,247, 33,157,123,228,230, 97,119, 66,136,190, + 76, 85, 20,247, 68,236,211,155, 65,156,165, 42,219, 75,250, 17,218,205,223, 26, 32, 42, 23,174,208,214,126,184,121, 95,152,245, +178,188,213,165, 94, 1, 50,111, 32,173, 68,116,206, 4,154, 91,235,234, 72,206, 26,145,136,234,172, 67,112,111,122,125, 33,109, + 23,132,178, 58,222,241,248,248,155,151, 81,178,154,216, 92, 45, 58, 12, 90,248,103,209,195, 59,220, 31,226,183,223,122,108,192, + 46,151, 18,234, 20,127,144,227,199, 53,171, 52,186,107, 65,225, 8, 19,240, 2,191,170,233,166,170,133,180,184, 32, 41, 19,225, +198,105,208, 1,116,109, 3,175,255,121,209,213, 73,106,207, 85,124,231,190, 6,199,147,153, 33,125, 59,194,117,233, 73, 62, 76, +101, 12,180, 28, 28, 14,144, 62, 20,130, 6,113, 28,169,157,152,101, 61, 49,209, 92, 91,151,198,190,230,147,154,185, 44,226,119, + 7,114,165,237,219,145,175,200, 64,133,210, 66, 53, 0, 59,201,179,131,171,233, 79,194, 45,241,150,176,177, 76, 4, 82,169,252, +202, 47,244, 12,235,167,142,166, 41, 57,150, 97, 7, 85,161,158, 29, 39, 55, 84, 78,193, 93,146, 24, 23, 63, 59, 62, 31, 93,126, + 68,197, 0, 72, 16, 1,242, 54,133, 37,189, 10, 44,190, 72,184,194,110, 17,118, 14,178, 36,156,157, 30,159,142, 46, 71, 18,135, +226, 9,216,165, 46, 14,150, 17,148,126,115,130,182,209,213,140,172,224, 90,102,191,232, 89,215, 56,254,176, 22,147, 85, 97, 11, + 42, 88,188, 82,243, 64, 86, 26,124,216,100, 21, 20,247, 29,111,236, 7, 42,124,134,162, 8,216, 45, 84,253, 6,148,241,151, 48, + 37, 17, 43, 48,158,142, 66, 43, 2, 31, 57,168,213,135,129,205, 71,214,163,131,163,239, 55,191,164, 76, 87,214, 60,217,127,250, +234,249,107,247,153, 93,188, 99,215,203, 57,223, 21,243,189,164,247, 88,125,186,199,150,135,108,124,159, 93, 99,119, 68,230, 16, +138,228, 14,182,255, 74,182, 65, 83,151,178, 4, 33, 10,163,225, 97,145,125,129, 63, 63,188, 96,195, 31, 11,185,156, 60, 26,176, +103,187,195,161, 73,226, 43, 22,237,179, 23,111, 94,130, 30,145, 89,104, 3, 30,239, 27,179, 6, 83, 86, 11, 74, 18, 62,224, 19, + 74,134,226, 37, 20,220, 45, 69,211,138,190, 95, 13,142,184,134,240,217,176, 26,221,201,240,100, 60,249, 42,156, 90,109,150,129, +199,228, 66,140,119,124,155, 68,140,232, 6,104, 85,207, 20,214,190,109,134,181,248, 5, 44,168,122,253, 43, 72,208, 20,240,172, + 51,213, 10,101, 36,204,204,224, 77,250, 96,247,172, 39,227,169,158, 77,215,147,105, 49,135,233,112, 88, 57, 84,238,192,200,110, + 88, 16,157,111, 28,160, 68,141, 0,251, 98,216, 54,192,170,235,226,192,245, 65,186,110,206,190,133,206,250, 71, 0,190,174, 96, +183,105, 32,136,206,174, 29,187, 78,155, 82, 43, 14, 41,160, 42,167, 34,224,194,137,111,224,111,225,196,141, 27,136, 3, 28, 42, +148, 67, 43, 84, 64, 72,105, 82,154, 82, 39,161,177,149, 56,217,101,103,102,119,157,210,170, 81, 79,105,235, 88,155,221,241,204, +188, 55,239,213,252, 25,142,116,220,115, 15,201,127,130,201, 51,214, 20,220,210, 81,212,166,137,218,166,104, 21, 33, 93,102,107, + 54,104,236,206,245,188,169, 98, 66,213,127,218,193, 43, 66, 8,121,141,150, 20,235, 66, 70,130,156,233,119,104,215,139, 38,206, + 49,255, 34,211, 82,137,238,101, 9,122, 70, 71, 33, 61, 57, 76,174, 55, 95, 45,183, 66,212, 51, 40,215,229,249,245, 80,113,159, + 79,155, 31,220, 39,107,158,138,215,190,187,162, 54,160, 59,233, 49, 17,155, 76, 89, 97, 55, 97, 33,112,247,157, 73, 59, 84, 18, +184,210,152, 73,205,238,215,156,112, 89, 22, 85,192, 97, 93, 58,189, 49,243,201,113,160, 95,117,196,180,168, 78,175, 22, 35,141, +126,123, 91,192,118,152,162, 13, 65, 27,194,125, 8, 99, 8,136, 6,163, 3, 71, 35, 86,158,186,238,182, 28,219, 48,112, 65,201, + 4,181,133,115,168,148, 55, 3,186,188,183, 15,115,255, 75, 57,244,213, 75, 5,104,176,133, 34,233,212,211,193, 54,217,189, 52, +219,147, 48, 94,105,114, 43, 19,202,169,125,175, 96, 59,194,181,174,180,104, 69,146,130, 56,214,219, 73, 3, 37, 39,243, 82, 55, +163,224,240,113, 48, 24,155, 2, 29,245,164, 49, 91, 71,178,249,156,150, 75,112,162,196, 3, 32,230, 24, 32, 65,101,189, 96, 66, +169,118,179,226,212, 80, 55, 23,140,227, 48, 81,168,231,195,157,107,201,195, 19, 28,220, 37,185,205,182,146, 7,231,249,136,250, +209,130,195,171,185,110,186,189,247,252,224,133, 41, 23, 72, 96, 84,109,150,234,183, 1,121, 86, 53, 24, 19, 46,138, 56,153,147, + 72,104,152, 29, 24, 39, 8, 18, 73,246,193,224, 1, 22,167,217,109, 83, 3,225,209,118,110, 26,179,134,148,109,225, 72,150,186, + 2,251,207,108,178, 34,153,106,101,171, 16,164,211,248,144,193,199, 80,250,193, 20,122, 66,217, 63, 32,135, 19,178, 93,197,137, + 86,246,183,164, 85,177, 61, 33, 93, 39, 42, 8,114,104,213,222,237, 76,139,217,110,210,170, 86,235,111,229,143,254,233, 73,239, + 81,239,229,235,189,103, 89,124, 50, 28,189,249,250,254,168,223, 61,251,216, 44, 62, 64,247, 51, 28, 30,193,211,239,208, 29, 64, +113, 12,205, 1,200, 75,120,146, 67, 54,133,253, 25,200, 33,164, 57,180,103,144,253,129,135,103,208, 42,161,251,107,150,253, 29, +164,203,162, 85, 70,213, 4,178,110,179,255, 73,189, 61,126,247, 19,190,152,175,178,194, 33,150, 74,169,133,201,225, 15, 58,189, +201,252,202,166,226, 96, 83,118, 82, 68,227,182,188,246,114,137,218,101,220,118,128,137,147,119,220, 89,216,164,158, 20,249,114, +101,142,252,210, 70,118,122, 95,215,220,112,237,202,104,197, 7, 83,212, 74,221, 54, 91, 86, 30, 90,243,196,136,155,193,221,121, + 59,137,218,156,201, 94,158,238, 93,200,186, 75, 38, 88,199, 69, 58, 55, 73,216,137,210,157, 70,250,123,126,121, 81,142,139,213, + 53, 78,212, 99, 88, 71, 81, 68, 22,202, 93,223, 2,123, 61, 5,207,213,154,193, 93, 15,169,255, 84, 45, 55,111,252,238,179,255, + 79, 0,210,174,101, 53,138, 32,138, 86,117,117, 77,247, 60,122, 28, 99, 38,100, 49, 66, 52, 43, 17, 55,126,128,138,191,230,222, + 47, 16, 68,220,187,116,229,218,128, 11, 23, 17,212,133,160, 4,141, 13,147, 4,157,208,207,170,174,178,238,173, 71,247, 4,116, + 99, 2, 9, 25,102, 38,116,210,125,251,220,115,207, 61,103, 11,191, 71,206,214, 18,198,163, 17,226,247, 17, 77, 35,187, 95,142, +226, 36,237, 58, 24, 29, 40,173, 16, 3, 50, 50,248, 61, 54,200, 29,198,176, 96,244,136, 91, 35,160, 3,130, 69, 25,137, 14, 48, + 16,189, 11, 24,203, 46, 30,193,214, 62,227,120, 11,177,134,156,161,203, 6,187, 27, 6, 33, 53, 6,197,115, 16, 67,242,157,100, +150,241,116,102, 62,227,113,211,129,140,104,194,226, 66,130,100,246,235,230,228,103,241,163, 33, 85, 33, 42,171, 42, 69,240,222, + 89,252,174, 66, 75, 51,176,134, 13,150, 97,182,162,187,140, 42,171,101,176,170, 33, 74,134,251, 38, 44, 56,242,108,119,105,212, +155, 87,249,238,202,122,200, 58,209,247,189,235,250,178,108,191,149, 96, 70, 39, 16,131,223,128,175,108, 66,249,148,177,101,194, +179, 17,195, 77, 84, 82,137,110, 93,214,167,170, 94, 35, 24,151,158, 56, 83, 94, 1,169,131,138,209,159,154,150,187, 79,188, 20, + 50,240,245,255,255, 97, 33,252,204,155, 71, 75,124, 36,245,131, 92,141, 25,176,115,152,252,210, 20,100, 49, 72,211, 39, 81,150, +198,133, 54, 40,158,153,255,144,196,177, 59,112,103,148, 94, 27,211,141, 0,228,187,151,113, 78,212,209, 71, 89,180, 28,183,114, +177, 17,133,123,134, 94, 76,118,215,191,115, 52,233,193,123,126, 63,213,128,191,254, 98,186,123, 94,156, 49,172,198,240,174, 26, + 11, 57, 13,181, 53, 98,142, 60,139,124, 2, 48,177,240,215, 10, 88, 36, 14,226,204,201, 96,106, 96,211, 86,152, 82,224, 96,226, + 63, 66,183, 44,186,215, 62,203,193, 41,144, 35, 52,170, 12,166, 1,254, 23,133,216, 16,236, 22, 80, 89,217, 91, 19, 14,116, 86, +248,114,243,243, 93,240, 10,254,196,252, 33,204,211,172,104, 75,102,143, 5,185,166,216, 81,231,129, 18, 12, 97,106,160,169,182, +238,168,136,250, 9,182,185,192,229,196, 24,139,154, 64,234, 55,176, 58, 73, 60, 50, 85,181,108, 42, 32, 49, 84, 39,236,105, 9, +207,137, 13,150, 80,230,138, 99,124,206,151,130,103, 59,139,131,135,171, 7,247,111,223, 26, 95, 82,178, 34,159,115,242,250,136, +188,249, 78,222,173,201,121, 3, 35,147, 71,251,228,197, 99,178,127, 72,142,143,201,211, 47, 36, 23,176, 3,149,226,220,200,224, +247,106, 35,105, 28,231,167,207,186,250, 61,149,210,244,168,185, 62,185, 73, 86,207, 15, 95,190, 18, 79, 62,144,183,157,108, 26, + 85, 73, 85,183,157,144,184, 40, 46, 33,103,131,122, 26,221,174,233, 59, 49,140,175,236, 3,228,174, 44, 0,128, 10,142,254,158, +122,155,133,199,202,174,232, 64, 67,169, 6,115,213, 43,246,142,238,186, 15, 55,117,171,250, 29,100,241,232, 1,203,225,123,137, +161,116,135, 16,152,234,131, 92,170,142,122,134, 55,162,190,190,155,239,203,233,222, 69,113,113,144,221,169,154,250, 87,123, 38, +164,169,236, 2, 97, 59, 16, 50, 18, 35,181,104,239,116,214,203,114,104,239, 54,110,103, 45,160, 68,187,194, 22, 4, 8,223,245, +130,209,191,169,224, 93,232,236, 31, 1, 72,187,122, 30,167,129, 32,186,187, 94, 39,113, 18, 69, 86,194, 73, 71, 56, 36,208, 65, +115, 58, 65,131, 68,201,255,160,165,226,255,240, 23,168,161,163,164,165,162, 2,164,147,128,230, 20,162,228,238,114,129, 96,159, +237,245,238,226,153,217,117,214,210,117, 52,105, 44,217, 27,127,204,206,188,121,243,158, 12,208,123,247,210, 11,183,104,196,166, +140, 64,117, 4, 55, 19, 29, 68,118,131, 72, 22, 77, 0,209, 71, 21,129, 38,134, 5, 51,165, 24,192, 35, 48,187, 53, 88,134,184, +138,201, 24,233, 95,216,218,143,222, 98,235,181,198, 22, 95, 4,141, 2, 3,173,187,102,253,205,103,172,181, 22,232,108,220,227, + 40, 49, 97, 77, 94,169,230,213,108,170,248,162, 86, 73, 4,142,125,101, 93, 95,148,107,200,183,180,147,115,104, 71,220,219,112, + 46,168, 18, 15, 68,103,185,163, 57, 48,240, 96,111,206, 86,221,224,199,114, 75,112, 23,251,156, 44,212, 13,183,251, 39, 65,183, +176,222,139,198, 11, 33,147, 36,157, 71, 43,169,234, 31,185,186, 64,128,133, 50,247, 33,139,211, 72, 78, 99, 57,234,247, 70,177, +188, 51,238, 13,123,114, 50,132,210,164,217,250,126,174,182, 31, 22,203, 63, 93, 12,136,210,246,216, 47, 91,251, 44, 59,196,115, +108,208, 71,101,255,145,194,135,118,175,202,131,242,116,149, 10, 47, 49,160,242,162,102, 55,104, 69, 7,152,110, 83, 98, 27,145, + 43,219,108, 81,253, 30, 75,251, 64,131, 76, 6,177, 0, 11,102, 54, 29,129, 42,192,209,132,111, 51,179, 43,204,189, 52,122,241, +132,127, 58, 83, 87, 59,137,156,111, 76,142,149, 25, 15, 70,155, 29,102,115, 72, 39,181,116, 91, 81, 12, 29,144,168, 34,227, 48, +128,134,197, 30, 35,255,220,125,112, 23, 62,184, 83, 63,243,244,232,228,124,179,160,225,195,176, 33, 6,252, 90, 93, 69,200,132, +181,236, 54, 75,202,110, 49, 99, 88,171,113, 20, 72, 74, 89,164,246, 32,231,157,251, 53,144,132, 42,201, 74,105,156,112,138,104, +186,212,201,228,180,180, 54,244, 59,128, 95,253,117,241,141,123,239,103, 80,107, 46, 51,233, 24, 50, 78,224,207, 11,136,123,197, + 30, 31,158, 4,177, 42,105,123, 1,165, 76,209,102,163,199, 7, 15,127, 93, 47,169, 7, 89, 84, 69, 94,230,212,104,110,206, 63, +159,222, 85, 70,103, 69,190,205,119, 53, 71, 97, 11, 97, 15,211, 89,145,169, 88,168,223,213,250,253,250,227,187,242,108, 48,121, +212, 59,121,252,244, 53,123,201,216,171,230, 65, 44, 88,113,206,170, 13,155, 63,192, 1,214,230,233,191, 97,227, 21, 43,150,172, + 44, 88,166, 96,111, 78,160,197, 33, 15, 19, 86,114, 49, 29,141,231,163,131,227,225,253,231,179,103, 66,170, 47,217,219,239,215, +159,107, 0,223,155,176,174, 52,238,179, 0, 74,212, 38, 29,207, 46,254, 94,210,204, 48,145,214,141,155, 68,165, 12,146, 14,112, + 55,169, 9,120, 30, 69,240, 22,165,161,190, 29,105,254, 2,117,134,108, 99, 57,137,147,118,237,143,109,103,196,211,219,242,177, +142, 18,164, 9, 66, 95, 23,118,119, 6, 26,122,239,235, 97,115,100,206, 48, 84,136,228,251, 41,131, 86, 34,131, 93,237, 46,199, +253, 52,225,241, 78, 95,130, 16, 23,146,100,180, 99,238,183,132,100, 27, 58, 64, 5,155, 10,136,181, 73,132, 37,189,239,170, 13, +255, 13,233,104,145,110,133, 13,170,247,174,118,113,199, 51,240,159, 0,172,157,203,110,211, 64, 20,134,231, 98,123, 28, 59,137, + 91, 40,148, 34,132,250, 12, 44,186,224,101,120, 45,150,188, 17,139, 34,129,144,168, 4, 41, 11, 92, 69, 33,205,165,137,237,177, + 57,183,113, 18, 82,118, 68,149,210, 38,145,162,218,137,231, 63,231,252,243,253,168,223, 59,222,212, 35,114,149,184, 68,210,124, + 55, 78, 15, 90,162, 84,123,234, 33,240,188,148,214, 34,211, 27,228,241,101, 42, 78,169,243,142,185,125, 32,189, 59, 93,131,136, +198,137, 43, 9, 8,197, 39,131,120, 66, 26,247,103, 26,230,177,200,126, 61, 90,106,180,224,179, 34,236,173,218,212, 56,139,187, + 55, 29, 8,121,107, 64,107,228, 99,151,131, 84,184,200,139,145,203,170,150, 76,161,157,158, 85,243,235,233, 53,252,181,110, 86, + 27,228, 71,194, 10, 0,143, 83,178, 43, 30,118,207,132,179,163,112, 66, 45,158, 58,172, 33, 76,219,119,225,255,186,184, 7,204, +147,218, 45,212, 93, 47,239,118,200,230, 80, 59,114,225, 86,251,238,121, 90,191,142,252,199,223,245,132,158,206,149, 58,193,204, +203,104,168,236, 48, 73, 78, 29, 66,196, 71,105,252, 36,115, 39,206,102, 41, 84, 61, 81,226,226,220,185, 79, 63,202,247,159,191, +221,134,134,120,179,227,138, 30, 32, 67,253,222,239,173,250,207, 55, 19, 10,133, 62,158,208,135,143, 75, 30, 38,186,103,212, 89, +128,195, 68,188, 55,244,174,230,137, 45, 82,139,128,255, 52,122,113, 26, 15,243, 36,207,160,218,210,117,203,243, 46,127, 59,199, + 10,250,217,200, 38,166,251,126,183,253, 50, 81, 15, 21,118, 20,224,187,155, 68,249,114,179,128,179,233, 91,137,221,234, 68,174, + 6, 39, 72,104, 27, 26,166,113, 25,222,121, 71,180, 72,173,131, 27,210,208,150,168,184,193,164,236, 96, 8,167,136,153,240,211, + 48,104,155,216,163, 58,148, 92,230,177,105,132,108,190,219, 23, 69,240,242,108,128,121,111, 20, 85, 75,189, 33, 70, 4,114,168, +136, 9,166,107, 88, 1, 60, 13,128,164,128,232,201,199,236,139, 39, 4, 25, 10,121, 78,142,226,117,130, 93,211,204, 42, 81,252, +127, 25,134, 10, 9, 6,153,186, 57, 66, 12,103, 20, 7, 86,204,184, 25, 70,219,243,226,124,186, 40, 99, 10, 84,143,177, 79, 19, + 9, 46,138,198, 21,160,139, 48, 64, 33,138, 87,219,117,229,153, 90,132, 65, 55,176, 58,100,241,200,166,133, 30,140, 47,206, 46, +167,131,194, 14, 47,151,239,222,116, 87,120,246, 51,242,203,242,161,225,129,242, 91, 90,242, 95, 42,117, 79,233,126,227, 80,216, +109,111,148, 46,213,215, 15, 51,187,248, 89, 46, 38,211,229,100,181,250, 85, 46,111,170,205,252,161,190,215,232,140,196,110, 91, +131,220, 60,124,127, 16,115,214,218, 10, 36,188, 56, 25, 15,100,123, 27,112,254, 34,193, 91, 65, 73, 4,230, 35,231,225, 50, 38, +132,239,186,253, 41, 40, 79,192,142, 63,207, 7, 26, 89,148,188, 54,255,220,149,218,245,197, 23, 95,220, 31,197, 69,246,158,105, +205, 33,166,120, 82,144, 70, 0,215,241,167,238, 85,164,220,108,125, 87,161,237,160, 33, 39,189,192,107,165, 21,114, 96,247, 16, +162,164, 17,124, 5,215,232,212,123,195, 44, 13,201,255, 59, 54, 71,122,190,168,238, 81,142,143, 83, 88,225,246, 71, 0,210,206, +103, 55,138, 24, 6,227,177, 51,127, 90, 90, 65, 85,144, 16, 72,112,225,130, 4,239,193,139,242, 62,168,234, 17,113, 0, 14,136, +138,110, 37,134,238,204,236, 36, 49,177, 29,103,103,197,194,133, 30, 87,234,238,106,147,120,190,216,159,127,110,214,112, 75,176, +122,114, 73, 26,178, 87,189, 27, 93, 72,246,255, 84,212,186, 55,178,147,147,113, 94,249, 92,119,125,147, 37,117,219, 48,237,202, + 47,249, 92,203,108,248, 69,211, 6, 5,104, 47,135, 44,137,131,187,124, 77,237, 80, 3,115,184,200,250, 50,101,199,197, 44,225, + 19, 68,140,200,179,131,138,102, 57,103,219, 37, 13,203,220, 34,191,214,123, 24,216,223,198, 30, 27, 41,207, 16,172,158, 93,229, +142, 44, 13, 97,228, 10, 52, 25,247,189, 91,116,234,251,232,216,151,235,177, 22, 84,205,104,161,211, 40,188,171,141,136, 96, 85, + 7,176, 38, 45, 88, 35,220, 64,103,243,114, 86,232,188,165, 87, 39,116,117,187,124, 57,204,110,167,130,149, 2, 53, 90,234, 10, + 69,241,201, 78,137,209,151,249, 87,126,253,252,201,187,205,240,254,251,205,242,247,121, 2,241,223,115, 6,254,251, 79, 11, 0, +104, 42,158,108,207,105, 35,149,180, 96,112,247,197, 40,205, 88,193, 43,254,140,238,102, 54,154, 95, 62,224, 93, 52,252,116,195, + 16, 18,142,188,220,224,250,206, 63,125,232,207,124,183,115, 56, 5,232, 58,124,246,184, 7, 63,127,221, 76,249, 42, 48,205,113, + 89,166,182, 99, 54,224, 24,178,202,102,251, 99, 90,129,146,176, 2, 51,196,242,167,230,105, 30,196,198,156, 31, 48,149, 42,194, +132, 91,162,120, 4,111, 14, 2,111, 94,188,189,254,124,125,228,164,107,139, 67, 1,209, 31, 13,238, 66, 63,113,174, 62,101, 52, +216, 32, 40,170,198,107,100, 23,255,140, 41,105, 1,108, 68, 6, 59,120, 80,128,153,175,229,214,234,170, 82, 24, 18, 55, 3, 61, + 58,185,216,150, 27, 6, 86,120,136,238, 32,105,202, 21, 9,102,147, 60, 17,202,211, 3,212, 9, 42,117, 35,117,239,232,188,157, +105,190, 87, 53,214,160, 98, 79,164,124,139, 94,173,191, 9,112, 14, 75,216,221, 43,103,148,228,146,145, 88,146,185,129,182,109, +194, 38, 53, 63,226,221,142,211,161,219,124, 65,107, 37,184, 95,200, 42, 7,203, 16,230,157,240, 65,106, 66,117, 92,107,178, 58, +205,252,210,253,186,113,151,225, 99, 67,159,226,242,141,166,219, 52,111,206, 60,159,127,134,228,115, 53,101,100,110, 69,100, 80, + 79,226,219, 67,142,244, 65,104,143, 82, 86,221,143, 86,138, 98,240, 81, 89, 94,232, 49, 84,195,159, 5,220,164, 6, 74, 48,193, +111,116,244,117,152,251,115, 63,187,125,254,189,184, 69,197, 96,126,228,217, 78,251,152, 75,198,224,173,111,154,200,220,207,149, +249, 66,102,180, 83, 88,191,220, 46,114,108, 58,157,120,180,119,148,236, 69, 50,233, 77,213, 0,179, 74, 14, 98,109,143, 68,131, + 79,136,228, 45,254,119,147,252,104, 62,254, 50,210,207,232,217,135, 40,224,195, 1,209,250,193,191, 5, 96,237,106,122,156,136, + 97,104, 62,166,153,233,148,118, 57, 45, 92,128, 69, 28,248, 13,252,116,126, 7, 66,218,203,114, 96, 89, 33, 10, 72, 91, 86,237, +124, 36,182, 73,236,100,102,202,114, 65,226,208,107, 59,105, 83,251,217,126,239,185,122,148,217, 36,220, 26, 81,245, 70, 64, 52, +162,197,180, 25, 22,101,138, 40, 36, 77,198, 43,201,104,183, 82,241,102,212,181,113,178,116,155,233,240, 32,201, 57, 36, 2, 65, + 66, 77,236,190,148, 18,175, 46, 11,122, 34,186,231, 94, 42,102,115,100,160, 12,143,181,150, 26, 45,134,135, 85, 26,196,153, 8, + 10,215, 85,227,184,165,239,108,124, 18, 60,248,174,169,220,214,173, 58, 8, 95, 79,123, 78, 29,169,195,195,183,135,206, 40, 12, + 66,122,231,165, 25, 86,233, 25,174,241, 96,106,100,153,162, 4,119, 53,147,220,153,203, 48, 49,158,230, 73,215,217, 90,237, 50, + 87,129,130, 13, 24,241,145,118, 22,222,182,116,119,239, 63,209,220,206,102,246,139, 78,163, 81,164, 19, 5,235, 57,192,196,227, +248,144,204,149, 86,171,214,165,105,141,231, 38,211,187,151,207,222,127,219,223,149,159,135,254, 29,125,227,127,138,242,190,168, +207,167,235,232,248,174,117,229,127, 30,207, 85,195, 12, 80, 31,250, 84,215,213, 3,116,201,225, 0, 6,102,194,141, 74, 63,177, +230, 6,240, 8,116,177,115, 87, 47,118,213,229,198, 37,183, 0,250,213,195,143,251, 30,210,222,245,158, 81, 62,178,175,121, 51, + 14, 91, 92, 8, 9,229, 86, 34,171,154,197, 86,247,213,229,213,237,247,207, 90,156, 42,108, 21,192,159, 59,201,167,215,135,219, +143, 52, 45,184,167,185,252,150, 2,157, 44,199, 15,212, 74,253, 41, 29, 97, 54, 50,237, 54, 79, 79, 99,231,195,176, 44,240,147, +231,137, 17, 77, 18,175,158,229,249,174,208,247, 35,168, 79, 61, 70,158,236,179,178, 61,127, 78, 86,229,128, 52,211, 51,202, 68, +154,164, 40,211, 36, 91,241,162, 43, 1,143,134, 5,129, 36, 30,147, 36,200, 61,126, 34, 21,179,106,169, 97, 84,230,196,175,155, +182, 15, 61, 27, 26, 43,153, 48,167, 7, 20,219,217,220,207,192,237,250, 34, 94,244,253,225,103,188, 96, 77,221, 62,244,189,228, + 33, 31,142, 6,172,247,107,163, 55,173, 13, 93,147,189, 7,166, 8, 78,133,184,229, 74,190, 15, 69, 38, 45,103, 56, 84,202, 71, +124,167,122, 74, 2,243, 1,232, 24,223, 51, 86, 57, 30,142, 3, 14,136, 49,131,251, 55,207, 95, 95,127,185,150,232,140,162,228, +225, 94, 58, 20, 72,199,243, 85,145,109, 73,151, 85, 4, 59, 58,171, 81,213, 34,184, 11, 76,132,153, 84, 51, 1,109,252,123, 50, +159, 99, 95,145, 60, 77,186, 36,189, 12,241,101, 98, 73,211,106, 83, 92, 88, 17,208, 98,151, 50,101, 13,163,201, 46,194, 69,241, + 80,234,140,120, 52,224,253,114, 73, 39, 36, 59,183, 60,247,168, 33, 55, 60,212,194,143, 30, 75,191, 69,149, 33, 30, 21, 26, 57, +150,168,108,138,164,151, 29, 56,102,229,252,194,251,252, 81,150,154,190,141,223, 2,240,118,101, 43, 78, 68, 65,180,247,155,137, +221,201,140, 50,243, 38,168, 79,226,187, 48,255,255, 11, 34,140,130,136, 8, 10, 49,147, 33, 29,123,189, 75,121,171,234, 86, 47, +130,175,230, 41,164, 59, 73,111,212, 61,117,170,206, 41,153,175, 61, 55, 99,137, 11, 26, 1, 88,255, 73,149, 61,107,116, 75, 83, + 34,153,244,225, 12, 2,227,160,154,130,123,182,201, 81,143, 6, 56, 44,203, 63, 59, 26,153,119, 86, 19, 91,142,240,108,138, 70, + 62,218, 56,114, 72,224,181, 21,159, 71, 94, 17, 51,252,255,156, 92, 23,208, 51, 68, 33, 63,238,147,131,220, 71,132,132,120, 36, +255,107, 69,130,170, 39,255,157, 67,251, 56,162, 62,214,144,171,102,112, 6, 93, 8, 81,201,212, 49,178, 19,239,230,210,121,140, +248,162, 5,136,123,146, 4, 36, 82,239,106, 40,161, 45,130,251,108, 93, 24, 45, 12,233, 22,151, 23, 80,110, 10,111, 43, 11, 3, +124, 48,110,226, 52,114,185,230, 58, 34,163, 6,226, 92,124,198,209,161,117,178,105, 70,237, 64,237,141,186, 82,133,202,147, 62, +133,106,183,125,147, 95, 29,117,167,215,247,233,191,189,146, 89, 12, 51, 31, 0, 8, 47,196, 92,252, 40,239,185,177, 71,209,214, + 39, 19,121,148,184,237,209,213,170,227,218, 78, 18,221,191,170, 94, 87,187, 47,223,235,135, 83,243,249, 56,124, 60,254,122,255, +178,187,127,247, 66,229,234,182,116,186, 55,143, 23, 51,140,208,251, 52, 30,181, 19, 81,169,154,235,141, 15, 11,123, 59, 67, 18, +188, 77,119,213, 93,221,162,149,163,135,184,223, 14, 95, 73, 31,136, 13, 45,101, 81, 62,117, 39,233, 13,134, 74,149,173,238,168, +198,137, 32,223, 58, 39, 37, 78, 8,182,236, 1,117,165, 88,183,203,232, 33,117, 34,129,167,128,139, 29, 56,219,231,191,187,243, +160,245,164,179,138, 67, 57,158, 37, 84, 49,107, 78, 83,140,238, 41,229,210, 41, 3, 44, 26, 26,132,150,188,184,171,199, 37,121, + 81,119,231, 88, 86,152,216, 5,101,243,165,187,164, 84,239,113, 76,144, 39, 50,223,129, 53,177, 60, 60,136,216,255,144, 37, 82, +207, 8, 18,238,105, 24, 3, 66, 99, 35,178,160, 79, 65,171,132, 64,242,168,172,240,135,165,173, 97, 99,150,155,242,250,112, 70, +163,227,115,123,241, 32, 26, 7,146,152,193,135,143,219,221,205,207,250,132, 46, 80,168,179,245,187,215,113, 95,152,205, 30,246, +225, 46, 59, 41,215, 79,165,123,144, 69,221,201, 86, 39,117, 32,212,178,231,141,211,195,144,248,117,186,215,113,111,160, 25,177, +166, 58,162, 14,223,186,135, 31,159, 44,149,171,201, 5,204, 3, 83,148,155, 90,105,141,129, 48,183, 80, 90, 28, 35,206,223, 98, + 88,135, 87, 2,233, 78,144,251, 42,184,195,223, 2,211, 24, 22, 13,145,176,112, 33, 93, 19,242, 97,185, 23,119, 42,152,184,107, +182, 18,114,255,152,238, 16,147,157, 17, 89,162,133,106,111,176, 44,230,220, 2,207, 7, 7, 39,155, 16,136,233,228,200, 21, 50, +165, 16, 15,171, 98,105,146, 44,234, 1,162, 58, 98,240, 30, 47, 60, 99,130,178,146, 82,185,132, 25,242,169,162, 40,107, 15, 8, +238, 92, 5,141, 63, 2,144,118, 45,187, 78,196, 48, 52,175,121,180, 21, 84,247,194, 2,137,231, 39, 32, 88,176,228,199,249, 9, +208,221, 35,196, 18, 46, 45,125,204, 52, 77, 50, 38,182,147, 76, 6,196, 2,177,233,166,173, 52, 79,251,216, 62, 62,199,212,168, + 71, 38,252,158,104,133,138,246, 11, 26,189,218,182, 15, 6,140, 56, 30,178,174, 41,178, 92,180,105, 85,172,182,251, 22,181,198, + 20, 61,154, 72,152, 1, 74,206, 30,235, 47,188,195, 30,184,148, 8, 73, 72,149,163,126, 53,208,128,217, 44, 25,203, 74, 4,220, +168, 82,214,246,102,213,234,206,232, 24,248, 90,180,172, 33, 53,177,120,135,157,112,222, 77,157,232,119,151, 29,111,193,197,164, +130,111,178, 12, 75,190, 63,214, 7, 65,206,211, 12, 85,207,169,153, 8,145,187, 82, 57,165, 97, 98,214, 69,242, 36,249,176, 44, +125,155,132,172,135,213,116,197, 38, 82,160,156, 94,110, 92, 15,242,238,120, 61, 45, 19, 41, 51,220, 59,218, 66, 54,177,160, 70, + 38, 65,172, 69, 76, 60,141,179,213,187,179,237, 26,179,238,204, 77,223,223,110,236,243,237,250,233,195,181,184, 31,203,144,243, + 95,113,247,255, 35,247, 63, 31,106, 14,247, 87,250,236, 8,212, 27, 49, 43, 66, 88, 58, 84,166,207, 31,104,163,104,164,196,246, +104, 18,239, 94, 60, 30,246, 82, 79,186,151,218, 64,248, 38,196,135,175, 39, 21,252,251, 55,207,158,108,123, 29,156,179,254,243, + 61,118,103, 61,193,158, 17, 23, 35,199,166, 65,107, 41,168,104,184,223,143, 56,145, 35,212, 76, 40, 21, 49,242,116,177,131,189, + 50,166,166,157,196, 16, 36, 73, 66,130, 76,108, 94,192,193,192,134,118, 71, 79,144, 40, 44,233,197, 36,116,172,241,143,134,140, +236,105, 37,105, 34,194,248,113, 56,246,221,202,249, 48,165, 37,109,160,182, 56,179, 22,121,221, 74,153, 6, 29,111,184,253,223, + 96,219, 48,196, 88, 63, 94, 70, 6,247,129,124, 65, 79,163, 37, 90, 1,100,234,187, 76, 38,224,132,113, 72,225, 38, 32,127, 32, +175,169,176,159, 36,170,229,179, 36, 48, 27, 70, 82,250,121,251,234,245,199, 47,159, 24,103,176,164, 25,187,131,197, 11,177, 31, +246,212,174,196,118, 13,217,150,225, 49, 17, 21, 68,162,227, 7, 51,128, 72,213,143, 62, 97,119,254, 17, 6,133, 59,194,152,141, +156, 2,242, 95, 83,224,164,149,221,220,120,241, 85,118, 15,213,168,191,124, 21,138,156,164, 17,131, 56,196,203,118,117, 63,189, + 63,128,143, 16,254,130,108,200, 9,167,139,244, 86,210, 9,229, 81,106, 50, 67,253, 45,184, 75, 72,125,153,217, 66, 47,225, 83, +224,214,167, 12,121, 31, 53,177,174,235, 46,138, 92,244,102,146, 45,117,145,141, 45,213, 82, 5,225, 43, 7,187,210,147,201,145, + 96, 9,222,103,138, 75, 37,196, 30,138, 76, 78, 62, 12, 30,193,225, 47,199,112, 88,171, 27,205,166, 80,132,151, 88,137, 3,230, +105, 22,148, 85,184,178,251,206,214, 67, 20,145,194,210, 23,129,143, 21, 45, 81,105, 42,131, 65, 88, 37,214,166,204,210,149,127, + 85,145,252, 37, 0,109,215,178,219, 54, 12, 4,185,148, 20,154,118,156,182, 48,218, 67,129,124, 64, 47,253,127,160, 31, 81,248, + 11,130, 4, 72,130, 38, 7,167, 72,244, 48,197, 71,185, 15,202, 82,140,162,167,250,100, 27,134, 45,193,228,114,118,119,118,102, +170,207,232,116, 26,254,161,229,133, 44,126,153, 17,105,244,197,214,212,121,255, 16,138,143, 52, 61,129,201, 52, 32,155,165,246, +216,186,242, 13, 77, 6,210, 32, 34, 46, 92, 15,129, 15,176, 34,135, 2,139, 49, 97, 49, 27,140, 83,195,144,182, 10,234, 0, 54, + 42,195,118,115, 89,217, 77,109,108,179,202, 63, 93, 3, 42,151, 13,201,215,192, 81, 60,230,219, 12,163,235, 66, 79,130,207,129, +240, 77, 33,232,203,177,161, 89,147,157,252,234,181,154, 41,154,128, 80,223,249,212, 89,202, 15,128,134,105, 98, 97, 82,147,144, +158,187,134, 19, 99, 5, 74,158, 36,233,227, 5,164,175,155,209,160, 48, 69,188, 57, 59,237,181, 16,149, 80,197,165, 71,245, 74, + 76, 81,141, 26,219, 81,145, 87,168,182, 72,247,172,158,234,246,170,169,158, 15, 57,178,120,243, 47,239,178,255,253, 8, 51, 5, +155, 48,195,107, 85,137,242, 80,246,185, 46,151,218,209,118,226,251, 29,232,101,126,126,255,208,221, 61,186,155,215,238,151, 26, +219, 2,249,127, 60, 12,155,245,243,247,111,159,141, 49, 95,182,238,246,224, 86,128,118,175,142,214, 68,231,213, 85,122,221,218, + 28,151,141,243, 67, 69, 99,129, 72,228, 74,101, 30, 20, 88,215, 33,195,217, 42,231, 64, 52,139,206, 4, 27,117,189,187,222,223, +237,169,116,198,168, 61,190,245, 57,178,199, 28,233,188,128,195,244,113,253,233,208,191,228, 5,140,205,119,225,196, 5,114, 97, +145, 98,206, 24,156,235,143, 84,161, 23, 42, 36,171,198,145,133, 86,141,118,240, 40,235, 11,107,187,142, 84,138,180,214,230, 47, +202,193, 29, 97,157,152,222,203,167, 99, 76, 19,160,226,145,119,246,224,212,172,167,194, 50,122, 50, 75,159,180, 76,234,115, 8, + 99, 57, 5, 89,207, 63,111,247,186,244,218,139, 5, 28,249,103, 41, 45,235, 86,178,250,152,241, 16,213,190,243, 69,132,199,223, + 79, 68, 52,192,251,204, 65,188, 61,246,137, 29, 30,129, 7, 21, 3,241,206, 72, 48, 34,142,249,191, 8, 51,108,158,102,200,119, +226, 89,135,229,155, 97, 10,250, 26,197, 75,124, 60, 6,229, 42,100, 24, 96, 86, 77, 96, 47,112, 94, 45,181, 25,234,192, 5,225, +146,198, 18,209,147, 40,147, 80, 55,238, 12,185, 19,148,134, 40, 45,243,147, 63,135, 4,181,248, 62,184, 47,232, 50,115,229,244, + 57,132, 95,132,248,180,104,192,158,117,104,223,205,139,114,137, 70, 21, 19,108, 93, 10,243,124, 98,101, 60, 9,173,111, 63,172, +118,149, 51, 35, 74,144,176,186, 14, 59, 77, 78, 71, 57, 20, 22, 95, 20, 79, 54,138, 48, 21,209,199,150, 73,134,164,144,151,205, +206,194,150, 86, 23, 90, 19,189,133,151,129, 12, 32, 96, 26, 63,250,203,227,143, 0,172,157,203,110,219, 48, 16, 69, 73, 61,104, + 75,142, 2,163, 13,242, 13,217,246,255,247, 69,151,237, 7,180,155,116,147, 44, 90,219,144,245,162, 72,150,119,134,148, 40,167, + 5, 10,180, 89, 57,139, 0,126,133,156,185,115,231,220, 34,217, 8,144,114, 17, 33, 66,134,165,156,229,124, 16,123,237,140,146, +197,174, 44,109,148,136,248,186, 43, 41,146,162,135, 4,135,156, 1,132,206,243,154, 32, 65, 24,140,152, 81, 90,153,156, 52,247, + 85,173, 54, 84,240, 46, 7,113,198, 43,140,100,115,205,177,134,167,192, 97, 45,119,254,168, 71, 36,117, 78, 73,105,206,250,142, +122,206,108,204,188,197, 51,236,116, 11,145, 11,102, 5,104, 94,188,217,188, 21,221, 36, 87, 51, 27,244, 90,244,104,186, 53, 53, +155,253,239, 1, 28, 31, 57,245,139,142, 67, 77, 5,151,240,206,109, 36,110, 26,138,213,229,168,172,246,141,174,191,135,190,143, +243,244, 7, 88,167, 14,101,175,163,161,180,185, 90, 78, 21,202,118, 98,190, 24, 89,139, 25, 4, 2, 33,191, 93,250, 2,242,238, +255, 49,179,255,251, 41,111,182,132, 3,153,120,120,230,228, 2,115, 9, 47, 97,145, 62, 79, 66,124,124,254,217,246,238, 69,160, +167,233,121,181,159, 30,124,250,122,249,240,244,240,174, 81, 93,167,238, 20, 50, 11,187, 9,127,117,165, 62,224, 60,136,247,135, +169, 82,143,175,215, 49, 2,247,163,100, 9,126, 22, 78,196,125, 85,251,175,223,217, 23,140, 46,160, 49,253, 55,242,243,243, 23, + 2, 12, 44,189, 51, 28,141,160, 90, 22, 74, 79, 44, 48,202, 65,119,254, 88,107,170, 99,175,251,193, 14,117, 89, 31,246,205,185, + 59, 17, 33, 61,160,101,227, 40, 77,114, 14, 55,138,109, 20,251,193, 85, 64, 27,166,185, 54,250,190, 57, 94, 78, 63,170,195, 93, +223, 15,206, 93,201,229, 18,198, 60, 1,108, 72,163, 3, 23, 52, 26,166,121,176,198, 71, 10, 59, 19,111,145,250,147,241,175,254, + 68, 44,179, 60, 74, 21,225, 37,147, 9,148,211, 12,237, 45,254, 53,217,120, 49,148,246, 87,228, 59,109, 90, 71,233, 43,116,121, + 57,202, 37, 9, 91,255, 68, 2, 48,132, 43,204, 28,172,207, 72, 62, 66,223, 36, 38,188,107,157,200,142,104,188,236, 6, 72,149, +152,142,223, 28,253,120,236, 91, 46, 12,206, 17,228,229,107,246, 17,224, 88, 44, 50,194, 17, 40, 9, 36,224,216,116, 71, 76,229, +101, 35,117,213,172, 67,136, 19,107,238,246,102,100, 72,122, 54,162, 63,227, 56,209,198,185,133, 93, 16, 3,127, 61,164,146,105, + 49,238,126,243,127,106,111, 55, 66,197, 27,234,100,152,205,230,107,205,106,163, 97, 34,124,106,254,178,124,157, 94,106,117,111, +167, 81,187, 16,116,188, 90, 45,131, 87,133,143,160,124,209,220, 73,127,246, 47, 83,139, 4, 67,193, 14,218, 50,175,154,226,177, +245, 55, 40,216, 21, 80,255, 74, 95, 16, 10,213, 98, 91,198, 56,145,142,123,111,127,126, 9, 64,220,213,172,182, 13, 4,225, 93, + 75,178, 45, 98, 55, 13,132,132,158,250, 2,165,239,208,158,250, 24,185,244,117,243, 12,129, 66,104, 32,113, 18,203,177,180,255, +221,249,102,181,218, 32, 67,142, 21, 58,104, 37, 97,176,100,207,206,206,124, 63,139,249, 76,149,173,195, 42,234,115,106,212,187, +164, 17,214,208,236, 68, 78,120,241, 59,104,122,145,230, 96,117,239, 77, 67, 90,234, 11, 48,117,164,247, 9,140,202,216, 53, 34, + 83, 80, 35, 37, 21, 61, 97,254, 13,227,244,132,108, 67,243, 72, 0,145, 43, 37,201,180,214,235,118,209,110, 87,103,155,134, 44, +105, 80,111, 34,187,215, 37,153, 9, 11,198,208, 6,114, 26,171,123,251,170,177, 6,132,232,141,229, 89,197,231, 82,154, 12, 57, + 62,203, 73, 71,129, 83,242,144, 53,220, 57,139,103,152, 26,133,221, 36, 5,149,153,136,204,249, 10,168,185, 2, 46, 81,141,248, + 34,118,225, 34,115,223,157, 27,142,129, 22,198, 82, 57,121,111,221,201, 70,165, 30,219,146, 10,137,109,135,183, 75,178,192,232, +231, 41,225,246,130,164,246,254, 6,115,103, 7,231,205,186, 80, 7,251,239, 91,153,184,217, 98, 47,175,250,247,195,188,221, 14, +234, 77,154,123, 24, 3, 89,252, 94, 91,236,164,142,105,205,182,173,191,124, 94,127, 90, 47, 94, 53,169,250, 48, 46, 83,129,228, +245,231,121,247,220, 61, 84,133,172,244,132, 15,195,255, 59, 70,228,167,195,142, 93,212,211, 2, 78,166,107,200, 26, 51, 83,134, + 82,167,193,196,199, 31,234,134, 12,164,122,163,190,125,253,222,155, 99, 60, 32, 45,245,224,118,221, 99,140,245,137, 71, 13, 83, + 44, 89, 80, 93, 38,100,106, 85, 95,110,175, 88,117,157,177, 42,218,234, 31, 63,127,221,220,252, 38,121,110,104,157,141,226,245, +158,157,223, 40,188, 82, 61, 62,249,130, 98, 56,122,202,145, 87, 1,166, 28,138,122, 22,222, 94, 23,220, 73, 30,227,114,112, 69, +233, 25,112, 7,153,185, 29,129,213,194, 70,150,102, 26, 6,191, 31, 58,227,252,178, 90,214, 77, 19, 63,218,162,220,141,154,169, +231, 92, 62,222,122,189,189, 2, 51,156,206,159, 73,234, 10, 35, 77, 26,252, 67, 90,120,149, 77, 84,255, 62,190,135,226,124, 74, +246, 15, 2, 10, 98,218,197, 8, 17,159, 3,129,217, 8, 26, 13,206,138, 0,195,208, 33,161, 67,111, 98,146,128,224,229,125, 78, +222,203,234,120, 8,147,140, 99, 81,136,246, 39,106,137,242,163,102,210,236,126, 57, 87, 73,151, 35, 79,181, 8,238, 97,206,127, +195,243,175,102,116,137,164, 84, 58,162,164,233, 80,153,131,178,221,166, 58,111,196,170, 1, 14,165, 66, 75, 17,190, 43,172,165, +200, 92, 14,196, 55,162,145, 53,112,179, 52, 69,157, 35,187, 86, 80,106,188,137,185,181, 83, 42, 28, 7,209,191,133,227, 62,188, +104,161, 86,162,149, 34,139,213,158,182, 35,249, 39, 0,117, 87,214,226, 68, 16,132,171,187,231,232, 9, 17, 65, 92, 88, 92, 17, + 31, 92,101,255,255,223,208, 55,241, 77,196,128,172,139,172,152,107,174, 76,119,219, 85,213, 53,135,155,252, 0,195, 60, 4, 38, + 9, 97,166,166,171,186,234, 59,102,253, 25, 37, 28,217,164,166,139, 71, 44,168, 91,232,158,235,117,146,108,198,213, 45,143,241, + 84,226,120,103, 74,156,124, 39,186,128,162,187,133, 49, 25, 78,211,193,170, 28, 35,155,190,227, 56, 94,125, 42,135,169,102,207, + 68, 6,136,244, 52,140,174,140,181, 89, 60, 42,107,138,120,145,226, 19,180, 46,202,204,168, 22,105, 2,106,204,248,241,195, 54, +211,223,126,111, 80, 71,121, 72,164, 54,199,154, 0,212,233, 83,158,183,191, 65, 45,134, 46, 11,146,226, 72, 27, 97,151, 5,166, + 24,203, 96, 93,207,184, 66,105,224,202,230,137,160,100, 51, 68, 61,158,186,221, 55, 14,114,212, 76, 81, 39, 2,208, 60,158, 3, +146,187, 25, 87, 40,155,121,122, 13,233, 9, 9, 44,218, 46,222,123,216, 34,115, 51, 73,200,255,250,181, 11,240, 12,194,107,128, + 7,145,181, 89, 83,194,139,215,225, 80,187,151, 87, 38, 86,225,119,215,213,254, 56, 52,253,169,246,105,114,139,254, 65, 30, 94, +132,147, 70,231, 65, 24,187, 26, 35, 80,141,192, 40, 40,226, 47, 14,244,180,225, 21, 72,155, 26,181,160, 83,171, 14,223, 84,133, +125,127,115,247,233,235,199,248,254,203,230,179,151,196,239,176,108, 39, 62, 21, 15, 99, 39,140,196,210, 69, 0,168,238, 37,241, + 96,134,102,145, 57,165,186,125,119,251,246,205, 77,204, 28,170,109, 25,131,239, 83, 82, 33, 12, 96, 82, 66, 76,100, 66,106,187, +115,199, 33,148,185, 93,149,177,136, 41,183,245, 35,102, 2, 55, 60,108,127, 25,147, 28, 6, 83,167, 66, 16, 35,196,223, 84, 48, +237, 98,152,186,137, 97,203,227,198, 44,164,106,157,171,244,109,183, 71,226, 9,120, 36, 24,105,232,145,193,170,201,103, 1,235, +225,251,237,125, 18,221,115,110, 55, 52, 58, 88, 60,227, 58,255,195,193, 7,227, 86, 36,156, 41, 11,226, 56, 98,245,146,185,133, +196, 78,167,254, 64,248, 25,235,155,218,187, 62, 48,143, 9, 49, 68, 72,126,139,139, 58,121, 69,224, 3,101,243,188,233,143, 33, +221, 26,201,157,105,156,121, 41,198,213, 18,205,125,134,130,175, 47,109,115, 21, 92, 42,235, 61, 9, 1, 2,252,171, 39, 62,105, + 3,203, 24, 64,192,139,147,210,186,153, 47,186, 79, 80,243,106,212, 69, 32,179,210,131,219,245,186,171,204,218,249,188, 69, 7, +143,142,126, 13,151,120,205, 29, 16,154,237, 17,174, 38, 46,155,157,130, 69,142, 11,130, 29,143,209,219,248,131, 15,253,171,213, +245,230,248,253,136,253, 75,140,151, 1,134, 2,244,185,127,178,152, 35,255, 21,128,185,171,233,109, 26, 8,162, 59,251, 97,187, +113,130, 67, 43, 85,162,133, 67, 36,238, 85, 47,252,255, 59,220,219, 67, 35,113, 0, 9, 40, 40,149, 21,226,250, 99,119,217,153, +217,117,146,198, 82,175, 88,123,112, 18,197,178, 28,103,252,230,205,155, 55,114,170, 72, 60,154, 93,120,154,233,188,227,212, 73, + 70,103, 86,110,103, 69, 84, 50,246,246,176,105, 65, 6, 40,115,214,160,115, 69, 27,168, 28,217,243,140, 91, 66,180,148,133,206, +206, 76, 94,154,188,144,153, 10,192, 65, 81,207, 74,200,158, 81, 42, 83, 20,225,115,224,175,106, 12,239, 58,128,116,199,186,221, + 14,165,244, 88, 82, 43,180, 89,100,217,221,230,190,238,107,194, 68,150, 70,244, 57, 16,169, 18,238,247,250,119,226, 79,211, 34, +101,103,196,221, 34,114,150, 40,143,244, 88,156,162,255, 21,115,239, 10,152,159,167,215, 52, 46, 87, 66, 50,140,148,254, 64, 58, +234,250, 39,203,163,243,194,147, 87,246, 22,235, 85,253, 20,242,133, 20,235, 51,218,201,105,167, 77, 87,191,163,112,214, 36,101, +241, 18,231,202,186,246, 53,211,246,255,127, 27,239,188,239, 84,212,249, 84,232,155,210,220,204,205,106,174,223, 26, 50, 13,239, +253,246, 57,100, 62,242,188, 42, 2,144,127, 99, 36, 99,141,177, 65,183,195,161, 25, 50, 13,215, 2,113, 68,145,186,153,153, 93, + 44, 46,108,170,210, 49,203,204,107,136,232, 4,129, 48, 14,184,196, 62, 59, 91, 63,111, 63,175,191, 96,109, 10, 83, 49,165,200, +151,140,122, 50,128, 27,101,174,150, 87, 30, 70, 85,245, 17,114,143, 56, 18,252,159,250,177, 42,151,204,184,134, 35,239,218,230, +221,251,235,187,251,181, 86,134,106,155,150,243, 6, 62, 43, 31,225,250, 65, 49, 49,182,196,226, 29,217, 14,237,102,187,249,181, +253, 57, 56, 6,236,196,225, 90,193, 3,137, 92,228, 85,188,139,212,117,148, 94,236,243,146, 56, 51,214,114,209,114,136,134, 28, +108, 63,136, 64,202,146, 65,186,149,238,118,117, 75,158,251,216,248,135, 77, 41, 44,153,140, 15, 65,218, 11, 40,137, 76, 30,221, +227,102, 88,199, 97, 0,125, 90, 54,193,249,209,247,116,175,146, 12,145,230, 65,136, 31,223, 80, 69,209,162,174, 29,144, 43,141, + 21, 49, 0,114,170, 68,203, 41,219,160, 30,252,240,146, 30,200, 72, 88, 51,122, 98, 17, 49, 25,248, 39,195,217,203,119, 97, 26, +188,191,108, 70,153, 0,251,209, 81,249,250,252,131,216,135, 78, 9, 39, 92,235,105,112, 79,174, 9, 76,178,243,144,206,144, 26, + 54,181,253,189,243, 79, 10, 66,158, 52,175,100,181, 16, 85,142,182,249,103, 56, 57, 70,168, 94,116,157,104,156, 28, 52,246, 43, +128, 23,199,250,238,244, 52, 15, 39,246,245,239, 67, 89,148,171,197,199, 75,121, 57, 67,223,191,240, 19,116,173,232,236,107, 65, +226,159, 0,212,157,219,110,211, 64, 16,134,247,232,198, 54, 36,170, 90, 46,168, 80,251, 0,240,246,220, 32,222, 3,245, 6,145, + 74, 61, 72, 64, 65,132, 38, 62,164,123, 96,103,198,179,182,163,136,251,222, 36, 87,145,108,199, 30,207,206,254,255,247, 3, 95, + 12, 28,240, 90,231,185, 59, 98, 30, 81,184,197,182,193,244,119,149,186,154,206,227, 32, 94, 7,115,164, 34,165,232,160,120, 21, + 85,140,202,129, 28, 65, 75,118,141,227,120, 81, 47,160,223, 47, 44,121, 52, 96,120, 3,174, 35,194, 33, 21,160,128, 4,133,101, +106,130, 22, 22, 90,248,202, 22,181,181,125, 90,102, 26,141, 20, 82,120, 38,210, 37, 40,117,209,135,221,237,110,221,248, 6,239, + 87,231, 97,106,228,112,186, 23,120, 45,155, 51, 95,148,152, 65,247, 57,177,132,228,195,120,114, 3,100, 86,146,252,136,121,179, + 92,220,135, 20, 62,118,169,137,137, 28, 82, 67,180,197,246,123,112,233,162,172,208,107,191, 52,242,175,243, 15, 51,105,205,224, +255,180,252,105, 89, 69,158,201, 86,185, 73,183,172,180,185, 48,250,201,251,199, 99, 40,231,151, 85,220, 21,211,114, 20,154, 30, + 59, 23, 46,151,230,195, 85,253,186, 50,123,231,107, 45,223, 95,158, 69,112,106,138,202,234,159,127,246,125,235,154,212, 74,112, +125, 79, 63,124,171,253,106,249,142,210,207,241,127, 36, 10, 47,197, 93,196,212,147, 54,253, 78, 28,122,136,233, 25, 27,123, 55, + 18,149,159,189, 58, 79,223,167,245,105,179,223,202,193,224,148,135, 61, 36, 63, 23,155,238,201,135,192,227, 3,201, 21, 34, 18, +103, 20,166, 51, 52,151,193,104, 80,133,158, 89,163,236,205,250,219,167,207, 31,141, 53, 29,232,229,129,229,235, 48, 13,157, 38, + 20, 4, 40,154, 24, 97,101,214,210,160,130, 1,231,251, 28,251,196,187,255,153, 19, 73,142,174,113,180, 72,140,100,201,251, 67, +131,189, 58, 3, 5,135,141,195,136, 97,236, 52,138,129, 44,143,219, 95,119, 20, 59,157, 14,191, 60,169, 91,215, 71,218,166, 37, +190, 3,160, 90, 79,148, 41,108,185,244,213,133,210,111,204, 21, 88, 22,221,100,163, 53, 23,119,207, 29, 61,149,200,231,123,225, +190, 8,191,190, 86,155,175,207,155,223,162,217, 6,152, 85,182,152,144,230,152, 23, 66,100,135, 56, 97, 48, 70, 57,177, 6,138, + 65, 9,115,144, 79, 52,237,223,229, 28,128, 62,227, 27, 30,210,123,229, 40,145,212,255, 89, 26, 28,203, 69,240, 12, 29,106,251, + 45, 66, 89,166,241,123, 71,157, 80, 81,138, 3,114,137, 28,111,189,152,143, 36, 96, 45,222,117,177,109, 33,207,184,247,144,179, +218, 18, 2,158, 54,135,209,228, 63,171,235,114,254,226, 73,239,204,199,238,135, 81,229,170, 72,111,136, 69,170,168,184, 14,144, + 97,220, 16, 57,126,174,255, 4,160,238,218,118,218, 6,130,232,222,236, 52,161, 33,240, 64,171, 74,136,103,254,255, 39,250, 13, + 21, 21, 79, 40, 34,144,128,130,154,218,216,222,221,238,153,153,141, 55,161, 72,188,242, 24, 41,137,156,216, 59, 59,123,230, 92, +220, 27, 40, 75,156, 85,140,112,122,192, 62,233, 99,251,226,183,167,118, 65,157, 65, 32, 3, 65, 95,105, 1,125,108, 52,104,233, +209, 37, 65, 56, 50,181,105,107,130,190, 17,140, 70,152,150,160,147,167,111,195, 61, 55, 85,205, 3,245,137,170,153,206,156, 94, + 84,224, 66,164, 42, 63, 73,235,167,118, 85,208, 22,242,104,231, 6,146,108, 56,168,216,251, 62, 54, 15,205, 83,186,146, 30,188, + 43, 38,188, 15,148,157, 77,208,171,140,165, 37, 86,155,158,124,225, 37,232,156,226,193, 71,120,195,195, 92,181, 95, 83,133, 33, +240,129,236,152, 45, 34,141,224,241,133, 66, 44, 82, 14,237,115,223,112,213,118,160,243,199,212,191,223,135,227, 44,152,194, 89, + 66,198, 44, 39, 25,171,209,185,252,217,204, 55,247, 0,166,145,105,251,130,188,164, 79, 92,220,247,124,121, 87,156,106,119, 74, +253,220,116,191, 54,221,204, 34,232,245,250,219,252,236,180,222, 13,221, 98,238, 42,235,174, 46,166,203,117,171,113,228,140,140, +209, 99,125, 26,112,179, 45, 35, 99,172, 15, 26,207,103,122,100,255,134,248, 95,146, 39, 91, 1,176,168,121,243,231,209,104,119, +230,234, 89,253,181,233,119,129,213, 24, 76,166,214,194,221, 72,239,155, 77,166,233,142,255,109,119,197,162,144, 39, 2, 83, 36, +143, 13,186,237, 91,227, 44,121,178,251, 47,243,217,195,122,149,138,105,247,250,250,253,252,199,237,242,183,167,225,165, 15, 25, +112,102,167, 20,237,133, 41,150, 61,142,241,224,227,218, 72,209,156, 62, 98,173,132,143, 70,105,226,130,102, 49, 54, 30,109,178, +219,140,233,164,233, 49,167,162, 73, 42,205, 99, 45,181, 62,150,246, 51, 46,244,189, 24,176,192,106,157,219,255,252, 87,193,138, +117,240,161,109, 59, 45,202, 80,203, 38,223, 17, 12, 70, 80, 83,225,130,181,125, 50,203,103,181, 62, 31, 46,199, 83,148, 42,152, +145,165,124, 26,181,254, 70,133,213, 82,109, 87,170,105, 83, 39,138, 72,209,244, 91,134,236,171,198, 56, 20,239,164, 97,239,182, + 38,110,221, 49,140,192,122,252, 64, 10, 77,134, 99,116,182, 94,137, 38, 47, 37,191,199,198,139, 26,239,222,239,253, 67, 97,146, +250,246, 13, 20,184, 34,226,178,226,146,180, 62,136,232,227,137,168, 14, 71,148,157, 28,143, 52,202,169, 14,220,141, 98,193,193, + 55,135,180,156,209,227, 86,143,155,135,201,198, 3,232, 86, 83, 35,123,215,220, 16,143, 30, 94,221, 3,154,119, 65, 80, 66, 17, +246,112,212, 23,254, 19,128,186,107,235,105, 16,134,194,180,192,128, 77,167,137, 38, 38, 62,249,238,255,255, 59,190,249,160,142, + 44, 14,156, 48,104,107,207,173, 20,182,236,221,215,101, 36, 43,131,175,167,231,124,151,236,172,139, 68,226,109,118,233,180,212, +251, 83,126,199,241,152,211,108,211,109, 10, 31, 26, 60, 82, 81,221, 1,247, 26, 60,123,129,229, 2,230, 23,232,157,225,161, 58, + 37,247, 2, 42,150,122,191, 31, 36,121, 69,124, 69,142,170,116,157,179, 57,152, 12, 2, 46,151,144,132,153, 85,104,112,112,178, +182, 72,179,155,188, 24,253,121, 79,219,147,246,165, 81, 11,161,198, 16, 34, 2,254,251,126,169, 3, 80, 48, 29,151, 94,106, 34, +180, 0, 80, 90,190,141,108,165,236, 2, 39,146, 59,232,154, 83,193,120,103, 14, 18, 52, 49,252, 84, 36, 55,158,192, 93, 71,190, +156, 26,237,137, 13, 8,204,115,196,107,255,139,145,188,177,116,227, 87,130,110,165,132,205, 23,210, 92,198, 88, 65,120, 4,214, + 66,114,239,240, 11, 79, 74,127, 98,241,254,175,193, 61,126,109, 86, 2,244,165, 72,121, 43,163,159,183,229,235,203,195,161, 7, +174,109,219,217, 34, 79, 55,155,226,241,174,234,122,155,181,195, 49,177,212,194,186,175,214,135,225,151,142, 92, 46, 17, 11,126, + 61, 51,241,116, 19,147, 98,102,197, 20,160, 31, 17, 30, 46,247,120, 87, 55,117,145,173,220, 72, 74, 82,133, 89,118, 88,108,240, +155, 8,201,127,178,247, 71,203,193, 66, 24, 53,161, 80,100,129,161,149, 81, 35,248,168, 20, 63, 77,147,175,114, 51,152,253, 80, +239, 14, 53, 40, 91,172,135, 56, 24,248, 35, 51, 18, 77,111, 33,144, 71, 26,231, 90, 98,129, 20, 15,116, 4,226, 81,225,237,130, + 24, 79,185,200, 41,151,102, 79, 6,201,199,138,200, 15,208, 28,210,236,165,163,196,148, 90,179,240,125,242,237, 66,166,178,191, +142,177, 94, 2,238,136, 37,132, 3, 12, 12,164, 48, 86,143, 35,164,112, 53,251,164,222,185,119,192,247, 49,106,101,168,249,184, +213, 6, 63,187,183, 62,249,250,208,199,111,219,159,160,211, 48,154,219, 36,107, 97, 53,134, 15, 81,150,121,140,212,150, 90, 84, +182,193, 12,192,242,120,243,202,196,201, 5, 62,137,185, 44,214, 86,241,255, 63,115, 1,156,183,101,162,168,194, 43,207,174, 91, +104,160,206, 26, 53,106, 49,238, 13,167, 10, 39,241, 80,203,106, 35,137, 78, 89, 17, 40, 7, 1,117,204, 29, 39, 22,172, 4, 40, +197,100, 37,141,141,199,222,205,220,140, 57,185,240,226,130,254, 4, 96,238, 90,146,155, 6,130,232,124, 36,217,198,113,156,176, +128, 69,170,114, 4,238,127, 21, 78, 0, 9,174, 34, 54,216, 18,210,204, 52,122,221,211,147,145, 41,168, 44,241, 94, 42,149,100, + 61,245,231,125, 10,190, 39, 5,195, 76,202, 81, 55,159,200, 68,113,196,111, 12,200, 94,142,119,254,118, 67, 45,168,138,209, 72, + 50,181,236, 49, 59,168,235, 88,190,173, 93, 31,231, 65,242,141,128, 45,169,151, 76, 66,167,113,167,100,253,206,187, 45,199,186, +118, 77,179,105,214,176,255,118,116,113, 67,234, 0, 9,131, 31,113,226,198,197,115,128,155, 55,230,169, 41,170,211, 38,106, 11, + 8, 65, 40, 27, 17,144,142,171, 64,117,225,118, 48,177,198, 81,160,217, 21, 13,106,206,209,206, 9,150,204, 17, 50,174,218,170, + 59, 35,141,139,110,217, 88, 9, 78,206,190,246, 56, 52,127,145, 78,161,143, 69,173, 0, 98,182,189,114,107,246,202, 21, 17,121, + 55, 71,196,241,126,213,105,207,155,253, 69, 50, 37,106, 62,207,214,218,249,107,241, 5, 69,217, 27,106,153,255,251,231,116,146, +190,210,124,146,119,160,222, 33,164,112,191, 93,125,122,124,127,119,127,243,249,240,125, 3, 62, 75,106, 26,234,186,246,254,166, +235,127, 78, 51, 74,180, 49,174,173,125,216,181,227,106,223,143,158,178,212, 25,245,106, 86,174,112,104,123, 38, 43, 50,231, 62, + 43,136,211, 2, 31,120,234,198,141, 27, 64, 20, 88, 14, 66,228,212, 3, 78, 49,214,143, 26, 25, 33,226, 73, 30, 17, 88,107,236, + 31, 73,204,164,246,120, 32,180,243,140, 92,222,231, 0,182,216,175, 48, 6, 24,240, 17, 18,138,224,205, 1, 86, 76,224, 49,108, + 96, 0,127,141, 0, 90,164, 1, 43,243, 89,130, 46,157,186,102,230,250,157,212,168, 3,127,101,182,246, 19,132, 76,236,183, 79, +188,160,150,236, 63,250,184,255,240,116, 60,248,236, 85, 45,254, 7, 66, 67, 4, 99, 25,188,119, 27, 36,131, 65, 36,163,133,252, + 43, 78, 99,150,115, 46,154,104,252, 24,155,203,217,159, 94,232, 16,131,241, 37,195, 40, 86,133,124,170, 17,127,190,172,175,223, +204,203,179, 57, 31,205,208,219, 48,153, 16,126, 76,151, 20, 66, 94, 48,203,125, 18, 91, 18,155, 39, 95,249, 65,169,198, 94, 11, +221, 66,123, 95, 16, 87,210, 98,150,126,189, 95,253, 7,233,155,150,108, 31, 91, 59,180,208, 95,231,251,117,141, 0,145,131,115, +211, 52,154, 55,191,140, 75, 55,152,171,131,168,118, 3, 46, 14,245,149,117, 59,181,182, 93,117,107,132,200,243,221, 21, 19,223, + 74,236, 42,235,195,164, 72, 95,228, 84,169, 12,185,110,215,187,249,216,227,112,170,175,234,183, 0,204, 93,205,110,218, 64, 16, +158,177,189, 6,219,145, 82, 72, 84,169, 82, 31,160,207, 80,245,237,163, 62, 66, 14,205,169,151, 84, 66, 77, 45,165, 2, 27, 88, +123, 55,158, 63,108, 83,200,185,156,124,192,128,176,118,246,219,153,239, 39,155,255, 56,225,250, 68,113, 52,138,234,225,210,203, + 6,148, 34, 81, 17,235, 88, 87,105, 85, 66,197,250,108,241,213, 33,128,213,171,141,126,198, 44,127,200,217,235, 52,149,193,101, +148,196, 75,106,190, 15,165,210, 33, 69,167, 2,217, 12,184, 52,205, 40,221, 13, 14,175,125, 29, 22,100,224,146,179,241,123, 89, +220, 20, 85,185,186, 91, 61, 61, 62,146, 73, 56,153, 20, 6,153,152,177,202,185, 23, 43, 74,115, 13, 83,195,112,140,230, 44,193, + 49, 63, 19,158,140,121,119, 24, 65, 72,163, 57,146,147,104,109,220, 59, 79, 57, 62,220, 84, 18,104,164, 96, 63,161,227, 49,141, +134,255,208, 25,159,208,183, 35, 81, 22,121,222, 23, 56, 3,173, 11, 67,238, 5,211,113, 88,134, 76, 89,203, 41, 77, 93,232,211, + 27,190,246,204, 87,115,252,206,143, 9,108,250,208,190,195, 10,248,239, 97,123,252,103,217,116,124,196, 1,250, 67,240,131,203, +110,171,252,243,253,205,122, 93,253,122,109,182,141,247, 30,179, 14, 51,215, 23, 11,247,105,189,232,182, 71,239,161,196,184, 42, + 93, 3,249,207,125,158,176,164, 69,117, 37, 1, 79,226,140, 1, 46,124,253,242,237,251,143, 7, 48, 37,116,156, 37,204, 91, 10, + 80, 84, 49, 9,106, 50,155,209,242,212,108, 3,196,140, 80,121, 19,242,240,195,197,245,204,229,157,184, 23, 3,176, 73,213,155, + 33,244,195, 18, 56,118, 34,203, 12, 36,215,228, 62,183, 92, 48,181, 60, 4, 85,247,128,236, 77, 66,243, 86, 31,125, 52,158,141, +240,208,134,183,102, 98, 53,140, 83,236,102, 13, 13, 97, 49, 48,144, 65,237,102,203, 16,161,245,135, 16,187, 17,121, 70,211, 76, + 13,167,108, 81,124,139, 31, 33, 21, 7, 47,220, 30,208,225, 2, 86,110,201,188,119,162,156,209, 61,199, 29,252,125,193,223, 71, + 15, 69, 52,134, 76,152,115, 34,199,254,198, 6,240,229, 25,118,117,114,216,117,251, 29, 12,207,114, 56, 81,135,168, 57, 87,113, + 66, 56, 12, 42,122, 55, 83,129,164, 88, 46,219,118, 43,105,116, 65,194,213, 97,218,146,191, 60, 77,197,235,229,243, 74,181,157, + 34,226, 75,225,117,151,110, 81, 78,187,228,254,225, 25, 57, 55, 78,118,157,247,153,153,241,204,179,183,112,101,227,183, 56,238, + 91,179,181, 66, 57, 92, 73,106,197,221,132,186,230,220, 58,209,252,143, 27,159, 50,165,236,187,200, 42,170,107, 13, 51,140,175, + 55, 1,120,187,146,221,182, 97, 32,202, 33, 41, 90,114,109,167,112, 14, 69,123, 73,111, 69,128,124, 73,144, 95, 11, 10,244,159, +218,123,111, 61, 20, 1,130,164, 11, 10,199,104,172, 72,150, 44,113, 88,207,144,180,150, 36,183,160, 71, 31,100,104,157, 25, 62, +190, 69,247,122, 27,141,188, 50, 64, 52,190,122,134,148, 81, 47,248, 38,155, 48,126, 70,121,147,151,176,157,168,108, 33,103,154, +149,219, 33, 24, 5,188, 99,157, 50,236,147, 97,157,207, 99, 18, 90,179,111,181, 84,100,242, 78,176,135, 98,229,242,110, 85,223, + 23,200,116, 91, 45,247, 19, 92,106,179,185, 94, 28, 29, 47, 63,156,158,158, 95,156,159,156,157, 92,125,189,250,116,249,113,245, +231, 23, 5, 51, 9,180,132, 11,197,151,135, 29,169, 36,211,157, 34,131,201, 47,110,165, 11,116,154,129,175,111,180, 90,141,219, +167,135, 52,143,193,246,233,232, 25,133, 67,124, 99,112, 97, 41, 79,107,154, 13,151,239, 25,223,224,210, 10,227,220, 68, 67,214, +131,155, 21, 87,127, 96,103,248,148,163, 7, 37,235,225, 21,144,117,133,161,239,128,202,253,254,131, 51,220, 56, 19,128, 91, 43, + 30, 72,227,250,191,129, 20,247, 66,127, 37, 59,135,209,142,148,235,247,144,129, 41,255, 89,139, 51,135, 91,180, 55,127, 55,235, + 93,219, 32,133, 57,217,182, 45, 42,152,166,250,120, 62, 41, 23,187, 55,211,196,168,228,186,208, 63, 55,188,237,200,118,235,243, +201,107, 66,240,235,242,237,209,187, 31,235, 27, 96, 6,241,231,111, 95, 72,246, 44, 93,240,245,139, 95,157,235, 51,223, 14,107, +230,104,225,219,155,164,163,100,242,192,109,233, 2, 95,123, 89, 48,162, 19, 83,162,159, 70, 21,209, 30,209,219,218,105,229, 34, +210,206,152,140,240, 62,166, 65, 82, 20,205,111,124,195, 86, 33,204,137, 91,136,199,190, 65, 28, 86, 30, 32, 33, 74,119, 48,248, +251, 34, 77,113, 65,216,175,194, 92,143, 17, 94,225, 12, 25,106,123,171,252,142,231, 16,145, 40,211,216, 32,209,194,224,147, 70, +191,166,233,171,135,109,193,234,114, 86, 9, 17,116,175,137,145,160, 36, 93, 13,155,234, 67, 83, 45,239,242, 89, 85, 47,161,168, +222,183,223,227,238, 81,210, 51,162,105,134, 42, 86,245, 91,152,124,189,173,238, 69, 93,226,174,102,147,115,242, 99, 13, 4, 81, +236,132,174, 17,120,193,128, 38,195,126,129,211,162, 71,190, 92,196,181,221, 8, 94,128, 24, 21,231, 15,127,146,233, 62,246,147, + 25, 86,233, 17, 26, 52,122,207,113,228,254, 47, 41,201,160,103,211,226,233, 87, 3,182, 37,157,109,102,210,253,217, 55,108,153, +254, 76,147, 24, 69,164,134,101,155, 7,233, 60,102,108,164,106,136, 34, 7,189,240, 61, 50, 7,128,167,234,144,235, 10,189, 29, +161, 67, 32, 6,121, 85,117,219,186, 71,183,233,159, 0,188,157, 49,111,219, 48, 16,133, 69,138,164,172, 56, 65,108, 20, 5,186, + 38, 75,208,108,221,186,247,207,119, 40,218,191,145,216,177,225,182,182, 68,209, 18,175,188,227,145,161,154,160, 40, 58,212,131, + 70, 66,178, 36,242,116,252,222,123,156,207,167,168,220,205, 29,234, 36,159,202,231,234, 99, 13, 14, 5,144,228,194,141, 13,239, + 38,216, 40,128, 66,225,118, 37, 85,109,156,247, 70,104, 52, 48,144, 10,171,123,169, 17,206, 33, 78,197,194,249,105,216,111,250, +237,198,109,119,118,219, 79, 39,204, 24,148, 49, 77,158,234,133,105,236,109,223,117,199,247,247,247,183, 31,111,222, 52,235, 83, +103, 15,223, 15,131, 35, 11,233, 49,252, 28,125,254, 34,241,198,133, 88,122,139,125,218, 20, 77,142, 60, 88,182, 0,123,243, 8, +130, 94,114, 28, 51,163, 50, 74, 68,227,142,104,233, 17, 59,238,117,146, 54,113, 6,114, 54,234, 35,110, 18,194,181, 28,207,167, +205,104, 91, 10, 80, 53,180, 94, 88,220,139, 64, 18,121,135,125, 84,110, 52, 95,147,116, 65,211,103,142, 49,242, 66, 75, 77, 89, + 59,148, 79, 77, 97,161,216, 27,246,173, 18, 26,228,126,242, 79,255,209,147, 64,164,181,189,108, 91,206, 98, 1,254,105,126,175, + 10,108, 38,143,239,159,217, 80, 64, 79,208, 26,133,213,199,193,225,135,123,141,233,115, 90,137,229, 66, 93, 46,244, 85, 45, 6, +104, 62, 63,200,173,149,188,165,133,255,107,221,168,139,147, 61,134,210,248,167,253, 33,146, 50,142,238, 49,174, 1, 90, 53,225, +145,136, 59, 40,249,105,135,132, 72,112,243, 46, 27,238,101,206, 38, 2,143,201,191,144, 49,115,207, 4,244,122,185,178,206, 21, +225,219,105, 86,240,153,183,137,162,161,168,228, 33,125, 27, 30, 35,148, 72,193,191,140, 13, 23, 41, 16,201, 45, 42, 47, 71,236, + 9,155, 54,248, 89, 59,157, 99, 67,170, 68,111, 9, 78, 23, 99,183,106, 54, 82,192,195,106,185, 10, 35, 59,140, 71,246,148,124, + 80,101, 62,111, 66, 98, 30, 79,199, 96, 2,120, 71, 94, 12,220, 24, 10, 47,163, 81,205,101,123,229, 66,213, 36,213, 66,212, 31, +228,250, 86,189,131,202,152,243,185,123,123,247,248,169,133, 36,205,203, 66,101, 89,200,157,240, 98,190, 86,234,219, 23,107,119, + 85,191,247,253,193, 15, 61, 56, 11,163, 35, 62,146, 22, 5,207, 51,198,188,181, 66,137, 16, 19,155, 15, 66, 57,199,165, 71,201, +151,201,162,133, 95, 22,136,231,166,204,124, 88,248,115,145,242,219,204, 14, 47,128,155,200, 34,229, 37, 70,164, 45,252,153, 82, + 24,170,235,118,229, 48,110,112, 20,179, 40,183, 87, 70,142, 4,106,142, 9, 68,232,136, 44,120, 69, 66,189,166,146,176,249,139, +215, 43,237, 32,139, 50,138,228, 69,171,231,149,161,126, 9,192,219,149,236, 52, 12, 3, 81, 47,113,186, 80, 64,112,226, 35,248, +121, 64,170,248, 6,254,128, 19, 7, 68, 15, 44,109,104,186,165,137, 61,120,102,108, 39, 41, 21,130, 11,247,180,105, 92,199,179, +188,101,178, 94,216, 1,122,231, 82,245,136, 17,197, 1,187,150,243,223, 69,136, 13, 30, 78,152, 59, 99,118, 81, 53,245,222, 22, +116,122, 98,135, 93,107,108, 12,174,154, 28, 69,180, 74, 17, 79, 11,119, 70,229,106,139,109, 67,167,152, 54, 73,160, 37,233,158, +252, 21,181, 15,233,153, 35,234,164,191, 99, 3,179,217,243,221,205,237,253,116,250,241, 49, 95,175,151,229,166, 36,255,104,122, + 43,124, 16,177, 12,181,165,129, 73,130, 92, 31, 32,122, 55,144,188,160, 67,171, 82,137, 67,192,100, 51, 69, 99, 34, 36, 83,221, +129, 73,175, 10, 66, 93,227,228,161, 60, 45,185,143, 81,213,224, 31, 79, 45,208,113, 91, 80,182, 46, 13,194,217, 92, 97,193,185, +127,124,164,134,181,110, 4, 99,173, 38, 3,180,195,242, 5,204,200, 64, 67, 86,129, 35, 52, 49,119,218, 39,234, 6,140, 53, 99, + 11,143, 85,243,254,191, 93, 20,136,124,205, 93, 20, 97,153,142,131,152,237,247,136,126, 15, 6,112,225,162, 59, 46, 5,219,176, + 80,225, 92, 45,125,124, 94,171,137,107,178,156,250,114,181, 26, 25,135,158, 13,210,157, 14,178,135, 23,253, 52, 39,249, 53,110, + 12,132,235,105, 27,186,114, 83,208,224, 23,217,226, 99, 50,200, 54, 1,141, 28, 77,133,242, 84,197,176, 56,115, 54, 68,151,141, + 0,209, 83,142, 88,182, 13,202,244, 82, 94, 30,185,228,125,185,139, 49, 67,165,150, 2,146, 27,135,136,243, 59,224, 36, 59,243, +193, 6,133, 19,164, 81,131,216, 9,162,156,213,210, 87,217, 56,126, 40,142, 14, 19, 1,135,146, 81, 50, 67,137,179, 6,215,198, +143,227,130,148,240, 41, 29, 68,117,236, 56,134,253,120,246, 32,131,249,106,145, 74, 76,151,126,101, 24,140,193,117,132, 40,214, + 5, 4,195, 83,246, 30,198,133, 66, 75,248,109,169,245,208, 95,117,157, 95, 93,100,147,215, 77,177,203,107,168,213,126, 85, 54, +226,210,111, 5,200,123, 18,214,118,222, 21,219,221,190, 45, 43,251, 41,253,202,215,149, 35,186, 67,156,213,198,196, 36, 50, 28, +145, 71,168, 42, 44,255, 73,237, 99, 78,227, 59, 57,123, 60, 19, 17, 57, 8,221, 32,104,123, 22,112, 36,123,135,223,159,236,199, +107,117,199, 62,143, 61, 10,230, 55,124, 86,136,229,182,136,244,186, 67,120, 87,180,132,153,208, 58,235, 57, 39,210,150, 29,234, +124,107, 43,186,221, 95,251,175,135,216,105, 23, 40,254,137, 29, 41,196,151, 0,188, 93,201, 78,195, 48, 16,245,146,164, 77, 41, +136, 11, 71,196,255,127, 9,191,128, 16, 18, 72, 8,164, 2, 66,173, 74,169, 27,199, 54,158,197,142, 19, 16, 32, 14,244, 86, 85, +221, 50,206,172,111,222,171,114,246,150, 20,166, 66,162, 39,150, 60,142,112,216,185, 36, 90, 82,106,150, 65,131, 29,206,166,134, +193,163, 39,168, 16, 96,194,148, 7, 50,110, 33,173, 52,112,107,246,164,153, 57,104,166, 32,145, 4, 44, 36, 17, 72, 17, 85,138, + 53,162,231,181,115, 13,224, 3, 84,136,165, 91,219,180,215,183, 87,135,119, 3, 27,170, 14,212, 59,122,215, 89, 27, 43,152, 14, + 4, 97, 2,173,125,132, 82,219, 40, 48, 36,152,177, 71,190, 72, 39, 73,232,140,146,116,252, 70,197, 36,171, 36,112,153,168,128, +201, 92,188,160, 46,135,169, 55,135, 7,207,208,182, 24,217,158,125, 71,162, 7,117,180,153, 10, 22,148,210,192, 98, 39, 26, 20, + 67,108,154,169, 46, 42, 57,107, 64,232,232,104, 70,250,207,226,164,129,228,221,128, 19,144,243,185,104, 67,184,127, 50, 55,251, +255,115,238,217,125,212,233, 71, 46,211, 83,157,128,231,135, 66,244, 85, 23, 60, 98,191, 9, 27,249,141,125,154, 64, 44, 19, 82, +173, 39,245,112,235,189,238,163,191, 90, 34,165, 90, 43,251, 70,171,104, 94,211,217,203,135,221,221,107,168,107,166,184,200, 57, + 10,165, 2,142, 73,141, 70,135, 28,228, 62, 48,111, 45,209,146, 69,129, 63,232,202, 43,150,129,144, 89,219, 67,100, 16, 65, 74, +219,139,225, 75, 88,173, 87, 42,223,201,126, 52, 64,107,103,139,141,217,192, 74, 72,146,127,160,197, 22,102,183, 33,172, 46,202, + 61,103, 25,217, 16,107,243, 80,165,114,154,142,157,156,128, 47, 84,134, 98, 38,174,220,228,233, 37,177, 90,198,188, 11,226, 46, +208, 61,106, 56,168, 10, 87,167, 4, 83, 65,177, 43,161,105, 50,190, 82, 85,141,177, 7,149, 71,123, 9,174, 66,176, 75,168, 93, + 65,249,198,159,215,199,103,245,233,227,219, 75,135,191,193,236,172,221,173,123,113,161,220,176,179, 58,233,122, 59,228, 4,146, +219,173,114,123,225, 12, 50,216,244, 36,139, 66,109,171,140,253,225, 70,177, 28,249,169, 12, 32,177,200,194,200,180,113, 12,129, +199,125,119,108, 82, 37, 3,202,193,158, 33, 7, 11, 70,221, 20,114,216,223, 63, 70,158, 29,155,212,126,114,122, 49,142,127,185, +157, 74,100,141, 66,126, 2,193,251,233,231, 11,199, 20,105,165, 59,206, 69, 65,208,117, 19, 47,215,223, 24, 71,138, 11, 17,202, + 34,219,255,244,223, 63, 4, 32,237,124,122, 19,134, 97, 40, 94, 39, 1,202,138,118,152,118, 99,199,125,255,175,179,203,166,221, +216,164, 73,101, 27,148,150,182, 73, 86,219, 73,147,180,236,143, 52,196, 1, 33,129, 16, 21,230,217,126,249, 61, 21,191, 30, 60, +223,158,175,143, 8,208, 96,235,104,166, 30,201,197, 35, 21, 62,149, 0,142, 21, 15, 76,190,230,103,104, 18, 78,233, 51, 86, 68, + 65, 35,116, 97, 48, 81,219,205,129,228,208, 5,104,210,179,248,121,209,182,139, 94,114,165,202,253,155,164,245, 45, 50,232, 12, +158, 64,196,225,140,238, 13,213,119,151,156,237,195, 12,189,175, 51,148,120,233,149,130,235,131, 97, 12, 54,115, 8,111, 0,151, +177, 6, 54, 4,172,186, 50, 32,217,125, 44,162, 89, 23,117, 53, 68,248,171,105, 61,189,193,250,142, 29,116,101, 8, 87,111, 17, +173,148,231,170,104,161, 34,205,182, 36,189,185, 86,144, 15,157, 48, 2,211, 56, 13, 2, 16,102,159,137, 53,216, 67,217, 60,236, + 78,207,218, 52,151,220,144, 42, 10,231,251,255, 77,249,247,145,126, 84, 34,253,125, 73,101,183,165,109, 65, 65, 69,121,156,171, + 52, 63,234,130, 44, 98,141,153, 84,120,138, 40, 92,112, 4, 11,107,127, 81, 90,221,203, 78, 29, 69,143,213,185,129, 51,232,219, +225,139,172,251,178,202,112, 3,143, 59, 80, 70, 9, 37, 21, 80,146,251,125,174,116,149, 80,197,170,216,235,150,147, 4,192,195, +171, 96,162,113,220, 35, 51,252,185, 10, 24,215, 91, 65,182,167,194, 80, 0, 36,126,138, 16,138,102,179,215,247,157,197, 38,147, +182,189,134,243, 66, 13,115,196, 88, 6,100,100, 0,134,160,173, 92,251, 27, 31,147,241,144,177,104, 24,198,232, 96,242,132,229, +139,149,144,114,104,140,105, 33, 76,152, 35,210, 37, 36,195,137,204, 64, 17,203,228, 76, 30,103, 23,206, 62,228,246,130, 0,215, + 87,155,122, 95,105, 16, 19,226,158,107, 44, 50,224, 98,124, 95,108,223,187,170,172, 63,113,112,216, 27,104,154, 19,149, 4, 36, +141,104,254, 89,166,171, 64, 70,217, 14, 90,224,227,128,231, 52,134,202,222,117, 20,196,169,161, 71,104, 44, 97, 17, 76, 90,221, + 82,243,158,113,139,213,187,155,237,106,153, 63,189, 60,242,225, 24, 79, 72, 14,101, 61,129, 14,153, 49,207, 34, 68,112,216,223, +103, 51,211,127, 24, 63,171,184,112, 91, 45,214,231,174,153, 75,120,238, 32,104, 64,239, 72,239,179, 46, 1,124, 83,169,163,175, +203, 78, 22,244,199,212,217, 98,190, 63, 97, 59,215,233,243, 85,179,249,155,139,250, 75, 0,210,206,109, 39, 97, 32, 8,195,157, +101, 41,148, 67,130,222,120,231,251, 63,146,222,170, 49, 98, 8, 70,208, 82,123,216,177,115, 90, 90, 90, 99,140, 60, 0,161,205, + 50,187, 59,243,255,223,239,207,239,207, 98, 77, 80,240, 23,182, 50,240, 60,134, 8,114, 97,230,196,165, 56,123, 20, 26,171, 11, +146,106,200, 25,102, 26, 96, 45,123,240, 5, 35,129,203,114,144, 4, 13, 71,241, 78,206,187,160, 54, 44,102,161, 57,168,243, 3, + 55,197, 39, 50, 54, 38, 80, 81, 77,172,106, 50,143,160,210,146,216,133, 96,106, 25, 21, 98,226,197, 54,107, 54, 37, 51,173,162, +229, 51,128, 35,157,190,224, 90,221,228, 92,223, 37,102,129, 14, 72,117,100, 57,153,101,144,158,164,173,210, 31, 85,190,102,185, + 11, 3,166, 33,206, 18, 25,174, 1,183, 62, 61,214, 95,158, 43,218,161, 12, 46,245, 89,154,204,103,126,157, 77, 55, 75,191, 72, +125, 83,134,237,238,116,255,112,188, 43,170,221, 88,203,204,219, 70,235, 58,232,221,255,159,217,107, 67,223, 76,185, 97, 66,194, + 30, 74,240,164,131,201,218,161, 39, 30, 28, 89,210, 62, 75,174,251,252,240,169,249,212,189,185, 22,135,243,216,110,252,205,100, +176, 46,193,118, 14,105, 88,181, 27,201, 28,112,202, 23,244,170,129,162, 14,101, 66,169, 40,135, 2,252, 28,110, 54,254,101, 71, + 35,137,134, 75, 15,244,164,186,202, 67,183,151,109,252, 12,238,118, 75,134, 6, 57,235,130, 8,190,232,159, 24, 79,180,216, 59, +228,232, 34,233,139,228,240,215, 75,177,161,199,144,229, 60, 32,106,131,160, 92,114,101,123, 37,202,207, 58, 35, 85,192,220,179, + 96,206, 23,134,200, 68, 20, 84,103,161, 90, 22,246,213,242,186, 14, 85, 81, 20,142,163, 16, 72, 31,105, 94, 90, 6,235, 58,161, +137, 79,248,239,202,241,156, 81, 53, 46,139,151, 10,204, 42, 91, 29,242,247,231,253,214,134,114,174,231, 7, 85, 0,123,123,219, +110,218,131,199,204,205,223,242,215,170,189, 31, 99, 73, 13,163, 34, 47, 23,169, 62,184,244, 97,188,142, 5,229,139, 24, 79,203, +119,130, 99, 30,154,138,154, 51, 72,244, 16,118, 55, 18,189, 91, 6,188, 40, 17,229,122,175, 9, 66,203,177, 99,174,230,169, 60, +237, 31,181,162, 40,210, 29,199, 90, 40,168, 18, 82,212, 44,108, 59,188,135, 46, 70, 56,249, 97, 6,139, 99,221,152,166,175, 99, +142,159, 83,117,114,195,246,152, 12,232, 1,179,116, 69,246, 8,141,115,142, 28, 89, 48,229, 21, 25, 96, 32, 74,117, 71,106, 52, + 12,133, 61, 56, 22,238,126,249, 3, 6,188,241,240, 23,127,204,183, 0,164, 93,201, 78,195, 48, 16,181,157,116, 71,130, 34,238, + 8,137,255,255, 36,184, 32, 84, 9,138, 82,138,211,198,177, 61,120, 22,167,238,130, 4,162,135, 30,122,232, 18,117,156,153, 55, +111, 41,248,145, 98,138, 12,230, 52,197, 66,218,184,128,127,175, 28, 21, 73, 97, 11,116,125, 77,106,192,211,255,202, 12,116,114, + 18, 95,104,193, 45,141, 42,180,222, 67,175, 81, 1,165, 91,121, 93, 85,136,227, 27, 86,106,144,241, 38, 90, 1,231, 21,168,172, +131,148, 24,224,161,197, 89,100, 78,126,144, 25,150,137,155, 6,197, 78, 18,203,113,240,101, 38, 32,175,146, 40, 89,198,220,249, +112,167, 80, 53,105,223,165,133, 71,136, 5,149, 30,129, 88,206,160,106,153,144,133,108, 41, 84,221,244, 17, 19,215,222,144,208, + 52,202,210, 75,198,179, 14,226,187,243,143,179, 73,179,237,215,212,247,116,160, 26,235,230, 16,166, 10,118, 59,191, 91,235,213, +214,189,108,186,215,204, 73, 48, 69, 46,210, 57, 98, 56,202,176,198, 63,187,248, 42,155,222,240,157,227, 86,169,235,154, 45, 16, +245,124,132,235,227, 61,164, 57,195, 44,200,237,205, 7,213,123,216,247, 97,235, 96,176,185,219, 11,193, 81,128, 26, 56,186, 83, + 31,149, 77, 93,240, 43,248,246, 16,179,109,228, 21,157,245,150,108, 16,107,143, 75,136, 49,102, 6,212, 99, 84, 71,192,166, 13, +203, 69,111, 56,171,123, 0, 11,243,132,112,240, 21, 58,218,119,106, 10,165,227,112, 48,226, 35,178,115,144,192, 47,204,151, 81, +167,216,203,197, 46,169,148, 76,193, 15,145,219, 24, 29,166, 99,158, 16,131, 36,221, 8,247, 38,103,117,130,248,219,210,173, 72, +196,223,186,172,112, 40,113, 93, 86, 86, 15,123,214,244,188,177,141, 97,195,108,125, 0, 75,115,109, 26, 6,125,116,137, 63, 1, + 95,121, 81,252,179,147, 89,243,213, 8, 53, 56,251,147,103,157, 22, 25, 40, 85, 66,217, 76,111,183,168,102,173,119, 31,123,219, +135,222, 58,235,252,106,233,103,222,162,124, 23,230, 92,204,178, 37,140,160,178,212,132,172, 98,163,242,246, 19,130, 27,167, 74, + 12,218, 98,249,225,107, 98, 69, 16, 36,129,131, 71,246,251,187,135,231,183,167,105, 61,105,211,249,200,250, 42,170,200,138,253, +127,148,108,185, 85,225,228,117,152,186,226, 64, 21, 4,125,222,188, 31,183, 19,191, 47,147,243, 78, 69, 95, 18, 69, 65, 49, 71, +224,210,165, 56, 13,167,163,113,215,119,252,157,211, 15, 73,141, 92,219,111,203,195, 29,179,227, 35,239, 48, 79,129, 76, 40,108, + 44,203, 83,190,224,244, 92, 88,189,254,245,100,231,199,183, 0,164, 93,201, 78,195, 48, 16,141,151, 16, 74, 23,132, 4,226, 11, +184,240,255,223,193,129, 15, 64, 8,196,173, 21, 40,105,155,205, 11,158,241,140,227, 84,149, 16, 32,245,208, 67,213, 42, 77,252, + 60,158,121,139,158, 93,173,103,167,122,254, 1, 57,131,230, 92, 54,133, 30,219, 52, 8,129, 47, 48,168,171, 3, 60,178, 40,200, +139, 29,122,233, 25,223,109,106,153, 72,168, 50,192,122, 0,199, 26, 73,208,161,226,179,111,156,197,228, 49, 96,206,199, 73, 0, + 57, 41,185, 36,202,131,123,109,189,207,214, 33,208,232,161,201, 57,141, 69,240,201,209, 81,241, 23,203, 35,106,181, 3,186, 67, +174, 6,188, 52,182, 61,169, 31,239,209, 40, 33,108, 31, 50,202, 2, 1, 50, 98,171, 42, 46, 67, 9,212, 56,177, 90,222,140,135, +157,198,188,205, 30,255,154, 0,196,131, 40,238,225,118,154,209, 95, 60, 46, 86, 79,109, 29, 45,195,194,110,244,178,183,227,190, + 29, 56,228, 72,227,231, 5,119, 96, 84, 94,145,102, 66,142,164, 43,137,159, 28,255, 81,185, 39,247,155,240,254, 86,136,235,210, +247, 66,142,133,168,148, 88,148,178,212,225, 70,202, 74,251,174,144, 43, 45, 22, 16,199,236,238,180, 62,118,110,123, 48, 95, 45, +140,199, 59, 86,222, 22, 63,233,200,211,136, 42, 82, 47, 20,155,194, 43,142,241,131,137, 43, 52,118,125, 19,202,116,169,151,208, + 91, 6,231,205,178,180,199, 74,148,149,232,186,202,218, 72, 74,151,132,237, 54,197, 96,171,156, 78, 16,151, 1, 56, 20,178, 11, + 52,173, 28,242, 53,245,121, 60,216,121,112, 39,228,197, 48,107,238, 49,161, 35, 6,159, 22, 18,109, 3, 3, 66,147,248,201, 50, +166, 39,238,141,163,177,154, 79,220,139,105, 69,170,100,136,239,167,226,157,246, 73,175,102, 64,195,121,144,201, 84, 7, 39, 95, +164,113,133, 52, 99,229, 56, 16,136,245,249,228,154,234, 4,177,253, 39, 98, 9, 22,254,114, 10,175,160,204, 11,104,224, 0, 57, +199,130,153,129,132,103, 29,118, 98, 63, 26,231, 90, 51, 28, 63, 63,214,109,109,106,112,117, 47, 54,112,208, 19, 41,169, 8,175, + 74,171,162, 15, 55, 45,156,197,154,237,195,229,230,121,247, 62, 14, 53, 50, 70, 49, 41,196,162,189, 89,162,153,226,105,248,109, +251, 10,213,177,233, 72,202,138, 93,164, 12, 73, 49, 63, 11, 29,222, 39,144, 97, 48,227,211, 23,115,103,104,203, 62, 41,222,133, +255,229,162, 56,233, 40,158,175,155,103,116, 75,113,194,190, 71,112,167,243, 8, 12,151,199,198,101, 57, 74,152, 70,120,246,236, +237, 43,117,213,217, 22,157, 35,221,201,248, 42, 71,243,101,181, 62,244, 77,206,109,251,155, 38,230, 91, 0,206,174,100,167, 97, + 24,136,122,161,164,165,133, 74, 17,234, 63,240,255,255,193, 7, 32,113,229,194, 38, 10, 52, 9,241,216,120, 54,215,109,138, 16, +220,122,107,156,216, 51,158,153,183,156,213,171,226,183, 6,213,144, 24,142, 6, 9, 85,155,223,238,133,211,228,200, 69,241,185, +177, 78,201,216,249, 90, 47, 69, 53, 23,215,142, 53, 63, 40,162,210, 85, 45, 10, 73,137,182, 2,174, 25,193, 1,104,190,237, 1, +100, 26,198,163, 21,170,132, 57,207,139,248,107, 17,191,102,105, 72,159,239,220,123,214, 48, 29, 84,147, 76,229,161, 74, 45, 26, + 75, 23,121, 67,116, 2, 65, 75,230, 68, 66,103,208,146,190, 7, 78,111,217,204, 33, 69, 9, 80,100,167,171, 45,126,191,184,110, +195,219, 22,251,175,238,220, 98,251, 17,136, 89,153,147, 6,128,125,238,135,155,118,221,135,229,253,184,163,178, 18,121, 76,189, + 98, 4,155, 74,167,201, 85,129,114,166,202,124, 94, 99,216, 76,111,193,255,107,209, 20,180, 34, 15, 60, 27,234,201, 44,157,219, + 52, 54, 56,215, 34,183,204,108, 33,215,213, 38, 32, 37, 37, 13,201,182,115,132,205,161, 71, 68, 51, 91, 45,252,250, 2,240,198, +150,198, 28,143,173,202, 23,251, 73,121,123,244,143,101, 59,250,234, 7,235, 19,128, 14, 96,103,244, 97,198,104,135,145, 91,174, +134, 76,136,204,199,118, 88, 95,197,174,243,151,139,205,238,235, 29,142,149,244,221, 41,218,139, 76,137, 4,101,156,191,103, 48, +233, 55,207, 50,105, 9,208, 17,228,193, 89,210, 26,205,240,166, 13,134,181, 97,164,254,100, 53, 25,245,190,209,126,137, 17,167, +185,226, 87, 49, 9, 50, 86, 76,216,108,170, 4,115,148, 92, 36,123, 50,113, 27, 20, 55,226,180,203,170,107,145,196,165, 92, 79, +214,227,112, 12, 4, 72,154, 89, 14, 44,167, 15,144, 33, 34,103,198,105,142, 52,105, 35,146, 84, 44, 6,244, 1,241,111, 49,244, +132, 62,102, 42, 84,234, 63,227, 3, 94, 79,108,142,242,115, 20,138, 66,250,172,147,215, 29, 70, 3, 47, 38, 62,229, 16,255,120, +251,122, 7, 99,135, 90, 33, 88, 88, 51,226, 30,216, 39, 85, 30, 40, 38, 39,228, 24, 87, 52, 35, 43, 46,161,172, 74,165,237, 43, +142, 83, 44, 5, 98, 77,223,143, 73, 93, 44,166,179,205, 63,157, 14,127, 26,102, 46,244,185, 41,116, 38,157,238,221,217,125,241, + 84, 37,128,130, 76,175,159,179,192, 64,122,216, 85, 16,154, 31,159,188, 67, 1,148, 28,229, 87, 99,200,229,116,248, 55,225,241, + 91, 0,202,174,109, 39, 97, 32,136,238,108,139, 20, 9, 70, 13, 6, 95,228, 19,252,255,127,241,133, 23, 53, 74, 52,202,213,214, +189,216,185, 45, 91, 68, 69,146, 38,132, 7, 90,150,237,116,230,204,156,115, 58,252, 85, 48,251, 29,249, 67, 79, 55,144,126, 78, +151, 33,166,208, 90, 96, 14,160,162,215,236, 84,203, 61, 29,100, 93, 80,155,147,134, 12, 88,114,157, 69,148, 2,162,237, 36,119, +138,154,222,142, 92,119, 8,177,211, 52,138,122, 28, 76,118,179,129, 63,149,131, 8, 26,226, 87,191, 87,122,137,116, 76, 84, 45, + 62,117,237,176, 98,215, 4, 4, 4,153, 82,220,178, 80, 38,172, 61,255,160,172,182,205, 54,136,201, 3,245,176,130, 79,100, 20, + 52, 16, 28, 94,247,150, 79,212,115,197,163,221, 95, 35, 75, 73,141,129, 15,231,239, 22,235,219,241,200,206,205,179,107, 80, 25, +213,132,101,166,137,184,161, 55,149, 70, 76,198, 49, 56,220, 87, 89, 9,150,102, 78,236,255, 43,178,180,207,250,212, 50,229,241, +196, 81,217, 59, 47,161, 79, 88,170,247,254,189,129,215, 54,180,211, 66,245, 10,211,183,176,105, 10,154, 67, 47, 46,134,184, 62, +163, 97,255,134,108,117,139,176,181,117,188,215,106,195,171,212,165,255,150,243,164,198,166,223, 9, 63,201,243,192, 41, 19,146, +193,253,218,181,207,188, 88,129,175,130, 89, 58,140,160,196, 36, 48,189,129,155, 92,214, 15,243, 55, 20, 39,165,100, 49, 38,115, + 11,232,232,202,228, 64,103,236, 50, 88,120, 64, 82,165,210,247,215,143,240, 54, 30,205,214,221,217,173,159, 4,106,143,242,228, + 64, 21, 12,128,233,120, 58,123,153,129, 0,146, 41,145, 84, 9,145,144,200,246,144,159, 71, 53, 49, 18,241, 74,167, 35, 57,156, + 39, 33,107, 42, 56,108,236, 92, 2,101, 13, 20,142, 89, 12, 18,233,216, 56,132,101, 4,248, 1, 26,164,137,137,242,233,147,108, +215,110,156,132,155,196,210, 81,203,240, 95,100, 4,162, 85,109,121,178,114,235, 79,242, 29,169, 73, 60,152,127,138,223,174,226, + 35,110, 80,191, 50,161, 66,239,158,246,111, 99, 29, 64,226,192,154, 98, 99,194,220, 64,179,178, 56,248,208,222, 28,152,191, 18, + 13,128,219,205, 94,204,206, 85,190, 77, 98, 73, 76, 45,178,144,185,133,132,184,115,178,137,185, 46,243,206,238, 90, 22,216, 39, +100, 38, 51, 71, 53, 71, 4,119,248, 99, 32, 69, 95, 87,103,147,249,226, 41, 67,189,225,247, 81, 28,189,194,184,175, 24,169,193, +221,101, 95, 33,247,120,113, 90,251,205, 79,181, 66, 62, 30,195,187, 26, 69,243,227, 97,159,159, 35, 35,195,151, 0,148, 93,201, +110,194, 48, 16,181, 77,128, 34,209,130, 10, 7,164,170,151,170,199,254,255,199,244,192,165, 61, 80, 37, 18, 72, 73,104,156,120, +105,102,198,118,236, 18,186,112,134, 40, 64, 60, 30,191,121, 75,224,207, 80, 30, 41,143, 26,243, 31,112,255, 56, 1, 97, 56,200, + 6,210, 9, 31, 2, 14,109, 72, 58,243,195, 8,232,133,193, 38,145,172,189,201,165,145,206, 92, 22, 27, 42, 13, 84,122,151,106, +175, 56,143, 83, 8,201,236,201,167,144,184,146,109, 60,209,231, 18, 77,243,248,102,216, 0,208,250,113, 2,201, 80,128, 42, 1, + 14,159, 57,121, 21,204, 91, 81,156, 8, 46,238, 8,253, 19,222, 72,152,167,120,222, 61,237, 63, 94, 41,215,120, 54, 91,117,147, + 2, 54, 3, 3, 32,111,135,199, 77, 78,102, 35, 66,156,154,118, 95,126,190,236,214,135, 99,157,159,155,202,234, 21, 51, 45, 51, +210,217,134,184, 59, 37,124,166,141,236, 36, 69,132,104,135,158,189,251, 39, 3,157, 69,146, 12,162,241,220, 1, 18, 40, 54, 51, +145,101,176, 69,182,157,169,149,110,113, 68, 86,145, 46, 17, 51, 15,239,165,218, 78,217, 89,234,165,176,165, 6, 91,151,237,122, + 1,242,163,206, 30,101, 51,197,223, 88, 70, 10,245,107, 99, 43, 51,194, 30,115, 95, 16, 53,113,108,142, 79,206, 13, 30,244,250, +250,189,192,158,175,108, 0,133,159,115,182,186, 85, 69,214, 54, 42,163,164,105,101,217,102,185, 57, 85, 39,154, 46, 70, 69, 42, +236,231,214,140,157,174,195, 51, 9,186, 77, 19,175,105, 18,114,184, 40, 31,238,111,211,140,173, 51,167,129,178, 38,175,114,135, +120, 12,148,140,132,219,136,101, 75, 68,235,129, 59,217,133,131,146, 38, 94, 65,205,145,200,143,231, 85,225, 39, 67, 44, 33,211, +120,171, 42,139,209, 24, 32,237,232, 47,254,184,125,120, 43,222, 49,141,160, 95, 58,194,255,218,214, 38, 24,145, 99,190,135, 94, + 93,248, 36, 74,191, 90, 81,197,131,153, 65, 8,122,235, 6, 62,210,247,239,164,201, 50,132, 58, 25, 89,235, 28, 66,197,112, 32, + 14,132, 54, 24,115,100, 78,133, 9, 14, 80, 37,227, 69, 41,235,131,110,149,214,210,128, 33,178, 70,251,125,133, 44, 34, 70, 86, +245, 60,242,105,142,156,205, 3,164, 31, 17,114,120,138, 49,143, 20,119,151,159, 65,137,163, 81,189,251, 37,193,137, 39,163,205, +225,122,134, 9,126,193,171,236,139,123,138,201,216, 49, 54,125,248,151,136, 61, 56,216,200,124,163,205, 92,222, 25,196,183, 37, +197, 61,126,255,112,222,228, 9, 84,111,237,245, 13,234, 47,175, 47, 1, 40,187,154,158,134, 97, 24,106, 39, 29,219, 64,124, 74, + 76, 66,156,184,140, 35, 71,254, 63,127, 3,137, 35, 66, 19, 19,218, 7,237,150,164, 53, 73,236,164, 25, 99, 8,122,159,218, 53, +181, 19, 63,251,189,199,252, 85, 38, 52, 35,246,234,124,120,248,149, 29,186, 99,121, 8,194,239,202, 64,188,100,233, 20,214, 73, +207,181,251,105, 3, 99,111,179,150, 1, 31, 86, 16, 75,140,149, 93, 32, 53,225,148,121,156, 56, 43,101, 3,143, 26,144, 72, 11, + 8, 53, 16, 85,148,195,137, 13,172, 72, 85,213,194, 80, 85, 98, 15,133, 82, 72,230,213, 81, 73,136,204,135,128, 53,198, 23,181, + 58, 42, 72,186,182, 30, 64,112,193,142,202,145,216, 16,203, 98,198,232, 5,154, 27,119, 82,169,251,235,179, 48,240,231,194, 48, +168,191,193, 40,212, 7, 50,120, 14, 5, 8,147,245, 72, 50,243, 19,139,182,106, 30,162,194, 3,222, 2,251,215, 32,189,243, 75, +128, 9,168,171, 65,117, 54,214, 35, 77,107, 7,181,237,222, 76,251, 66,240, 30,219, 3, 67,105, 6,168, 6,104, 1, 48,107, 97, +101,169,178,161,135,125,123, 90, 77, 46,142,181,214,239, 11,251,246,185,117, 69,111,167,253,231, 54, 3,137, 78, 53, 74,184, 60, + 79, 94, 30,133,202,137,142, 20, 19,137, 19, 54,237,107,136,177,250, 88, 85,236,170,210,197,190,136, 13,220, 63,236,129, 77,200, +134, 25, 89,245,191,175,135, 57, 80, 40, 11,194,149, 56, 13,138, 40, 65,106,216,246,123, 3,210, 55,140, 30, 51, 94,226, 31,193, + 88,135, 72,101,186, 42,130, 68,224, 63,197,193,147, 28,100,196,197, 87,228, 49,138,227, 8, 72, 7, 40,210, 83, 53, 22,102,217, + 73,243, 61,249, 2,247,106,241,225,209,182,206, 78,111,167,243,229, 60,232,231,101,159, 41,161, 86,101,235,143,157,156,149,115, +170,255,155,231,199, 23, 93,208, 5,112, 32, 84,113, 14, 45, 26,132, 70,140, 90,110, 86,129,164,228,191,113, 91, 15,111, 30,236, +221, 35,172, 27,218,232, 96, 43,180, 9, 88,188, 63,203,251,218, 83,213, 96,150,224, 22,117, 55,123,109,159,159,172,109,186,166, +118,174, 1,227,127,109, 88, 54,146, 71,224, 49,105, 62, 20, 40,121,194,114,145,118, 92, 15,177, 56,131, 99, 49, 70,253,243,169, +185, 36,177,254,129,246, 41,109, 87, 37,114,223,152,215, 2,123, 73,139,189,212,241, 7, 30,159, 84, 75,180,155,220, 75,209,131, + 67,230, 36,186, 80, 13, 11,209,170,171,113, 53,182,157,225, 76, 53,212,163,150, 28,253, 94,104,252,231,250, 18,128,178, 51,217, +105, 24, 6,194,176, 61, 73,151,180, 32,246, 69, 66, 32, 78, 72,108, 7, 36,196,251, 63, 1, 15,129,232,129,178, 21, 40, 33,139, +157,193, 30,175, 9, 20,149, 30,122,136,170,170,106,236,223,241,248,159,239,183,250,238, 45,194, 13, 91,180, 98,116,165,159, 47, + 62,148,248, 77,229, 35, 43, 29,143,107,248,113,121,203, 3,240,200,104,102,230, 98, 99, 4, 31,252,233, 81,107, 60,152, 59, 5, +173,249, 0,193, 15,102, 76,241,126, 22,129,203,238, 64, 83,124, 87, 2,159,154, 28,122,158,220,156, 92, 79,158, 39, 64,161, 13, +141, 45,241, 91,215,168,186, 88,139,202, 80,201,144, 83,219, 46, 74,144,121, 77,219,203, 20,137,196, 76,224, 48, 66,253,129,122, +159,125,213,165,148,167, 59,107,135, 27,227, 44, 77,212, 45, 83,147,178,135,132, 85, 35,173, 39,167, 57, 79,220,113,107, 63,130, +123,116, 58, 74,224, 63, 15,239,224, 78, 53, 71,140,109, 41,137, 79,146,222, 0,134, 41,188,213,106, 14,202,123, 33, 31, 8,171, +112,158, 13, 46, 55, 7,199,235,217,209,106,255,108, 99,120,177,154, 93,141,179, 45, 9, 83, 81, 79,132,122,118,147, 35,128,227, +253,209,230, 74,246, 53, 43,158,222,170, 41,109, 62, 32, 34,243, 45,239, 82,240,195, 84, 68,101, 28,109,183,231,218,186,163,203, + 98,186,117, 66,167,124, 73, 29,212,197,214,198,233,227,123,106,115, 54, 24,232,250,176, 51,240, 98, 43, 50,211, 57,119,209, 2, +211,117, 62,111, 91, 59,240,167,190, 75,227,208, 9, 97,155,136,173,249,201,218,244, 65,100,241,152,107, 88, 23, 92,101,183,146, + 16,196, 35,200, 68,224, 92, 4,113, 55,160, 47, 61,227,136,139, 77, 9,123,220, 49, 49, 66,106,100,140,185,213, 23, 43, 89,169, + 63,224,229,243,133, 89, 80,170,237, 1,179,125,179, 12, 93, 96,148,121, 62,106, 76,233,137,251, 2, 2,170,157,126, 33,168, 61, +133, 60, 54,182,242, 79, 54,122,220,235,111,127, 84,121, 46,139, 82,214, 82, 20,217,238,101,121,112,202,243,185,102, 62,169,255, + 94, 45,254,165, 62,100,231, 57,103, 57, 22,239,175,205,124,198,167,119,242,238, 86, 84,121, 83,207,177, 44,116, 24,179, 38,172, + 8,228, 81,240,109,220,121, 20,224,144,166,218, 30, 6, 44,186, 61, 62,235, 16,220, 91, 15,239,190, 42,192, 98,207,251,223, 84, + 2,110,137,131,224, 89, 35, 92, 51, 84, 18,183, 62,119, 37,126, 57,101, 15,248, 4, 92,208, 92,186, 80, 16,219, 54, 42,255, 18, + 20,104, 97, 62, 44, 80,196, 65, 31,195,222,136, 22,241, 38,254,218,241, 96, 69,141,135, 37,127,247,183, 0,148,157,207,106,219, + 64, 16,198,119,103, 37, 91,138, 28, 7,151, 6, 28,122, 44, 62,244,222, 23, 40,244,253, 15,133, 62, 64,105,155, 56, 16,155, 54, +141, 37,239, 74, 59, 83,237, 95,173,164, 38,164,198, 7, 99, 48,172,188,222,177,102,230,155,223, 39,172, 53,182,115,113, 28,110, + 21,255,185,224, 16,250,129,191,120,150,249,188, 1,157, 52,159, 33, 88,234, 50,158,208,241, 33, 29, 61,118,165,209,168, 15,195, + 81,163,151, 71, 38, 36, 36,238, 28,214,182,195,157, 52,136, 13,248, 56,229, 4, 14,242,238, 20, 89,222,181,137, 89, 33, 60, 19, +254,112,146,190, 61,220,153, 70,173, 16, 26, 17,130, 34,210,213,238,211,189, 89,102,185,214,253,223, 67,151,227, 35, 90,222,128, + 36,148,182,154,212, 50, 46, 45,215, 41, 51,250, 2,218, 75,245,253,120,106, 59,220,174,202,119, 87,171,237,170,184, 90, 44, 42, +200, 86, 4, 25, 65, 97, 10,249, 60,143,182,171,246,174,182, 75,188, 62,162,226, 80,207,200,121,207,221, 38,179, 36, 15,120,107, +226,187,216, 20,121,181,204,159, 90,218, 55,234, 1,241,142,177,143,197,242,211,251,141,168,184,206,250,213, 98,173,169,182,154, + 36,145,195,238,122,253,249,205,230,203,225,247, 79, 98,151, 29,237,182,235,155, 77,185,191, 63,125, 59,158, 31,109,190,142, 51, +137,228,255, 28, 12,175, 5, 18, 33,131, 49,218, 30,107,102,186, 16,208, 63,151,185,241,114,236, 51,158, 34, 23,199,147, 48,165, + 50, 31, 9,156, 52,100, 92,128, 79,253,175, 93, 56,177, 72,147,128, 63,229, 73,125, 37,141,239, 52, 25,146,114,158,171,200,249, +212, 22,109,118,153, 56, 77,217,157,186,125, 16, 20,165,225,158,123,171,118,175,125,140,193,157,147,143,229, 0, 65,214,197, 98, +251, 63,216, 50, 13, 53, 79,140,160, 26,235,152,224,253,200,250,235, 41, 22,165,182,129, 32, 49,255,115, 47,244,184,134, 96,222, +190, 44,215,181,161, 34, 91,136, 60,243,131,161,204,147, 43,121,131,234, 34, 43,251,239, 76,117,202, 96,179, 80, 86,215, 31,218, +155, 29,107,158, 88,171, 73,157,141,245, 80,211,160, 60,131,148,178,254,213,213, 7, 86,255,209, 15, 63,244,253, 87, 84,253,167, +207,168,140,254,157,180,178,176,204, 46, 46,138, 5, 35, 92,244, 96, 6, 26, 90,170, 44,110, 41,133,100, 41,204,127,193, 8,102, + 75, 99, 46,233, 11,197, 25, 61, 77,112,193,219, 5, 4,234, 20,119, 56, 65, 8,112,139, 48,243,158, 42,221,241,249,186,123, 0, +227,224, 88, 91, 57,161, 25, 15, 63,175, 74, 92,180,212,206,143,234,228,244, 80,200, 54,105,198,144, 49,155, 46,204, 4,255, 36, + 95,201, 32,235, 28, 31,251, 21,143,191, 2,112,118, 53,187,109,195, 48, 88,148, 28,197,104,131, 13, 5,138,157,182,167, 24, 48, + 96,143,209,103,237,131,116,192,238,189, 21, 24, 80, 52, 75,186, 38,141, 45,139, 44, 73, 73,142,236,116, 69,209, 32, 7,159, 12, +219, 34, 40,146,250,126,154,250,241,106,210,160,125, 85, 31, 89, 85,105, 48,207, 26, 79, 19, 61,149,230,181, 28, 83,101,207,140, + 68,206, 75,203, 88, 84,243, 85,231, 78,148, 83, 69,177,195,168,194, 36, 42, 80, 37, 11, 10, 23,185, 53,147,184,129,110,188, 49, + 38, 41,240,129, 10,145,138,176,152, 40, 79,176, 22,249,248, 43, 9,119,151, 11,155,179,129,218,223,232,140, 80, 96,197, 13, 36, + 29, 26,151,201, 23, 26, 6,206, 54,235,110,237,197, 65,112, 37, 53,143,120,224,164,140,129, 8, 30,100,150, 32,239,176, 84, 69, +155,189,132,182, 48,229,109, 18,210,210,116,255,143,226,175,205,246,102,179,245,198, 94, 46,151, 23,141, 96,208, 91, 47, 91,234, +243,128, 16, 67,167,144, 33,154,194,213,211,196, 70, 73,224, 38, 76,129,177,182,108, 0, 56, 13,250, 58,245,199,130, 90,105, 57, +111, 46, 92, 71,180,238,226,150,144, 43,247,239,222, 95,253,252,246,251,225,111, 12, 70,156, 50, 69,186, 82,222,159, 55,180,199, + 3,183,215,251,213,167,213, 15,127,126,221,239, 66,135,173,115,207,157,253,243, 24,118, 21,212,235,195,198, 35, 77,245,106,109, +105,185,249,239,213, 67,128, 87,229, 16,196,123,248,179, 55,103,158, 47,184,142,105,178, 34, 82,101,120, 77,163,225, 27, 20,219, +166,210,213,145,130,177,146, 52,145,142,216, 83,205,147, 69, 1,167, 79,159, 89, 72,156,220,207,218,243, 48, 4,241,174,161,153, + 88, 21,204,170,176,105,116, 85,223,126,132,200,148, 45, 4,142,157,195,209, 18,232,104,247, 88, 13, 1,142,116,120, 76,103,201, +122,176, 11, 25, 49,108,149,202, 11, 53, 70,218,229, 97,141,194, 33, 19,111,118,146,220, 99,141,182, 31,121,103,110, 65, 73, 56, +158, 10, 80, 65,234, 57, 75,168,167,221, 96,111,119,119, 95,253,151,165,243,157,235, 7,112, 92,149,211,102,141,216,131, 63,112, + 41, 98, 22,222, 58, 14, 92, 8,150,122, 1, 82, 62, 33,135,237,246,158,211,250,192, 93, 69, 8, 66, 60,228,192,143,169,145, 48, + 52,114,149, 12,197,170, 30,155,205, 2,132,148,152, 63,180, 77,167,114,105, 2, 6, 5,214,137,255, 65, 13,192,107,165, 14, 85, +180, 23,152, 67,101,114,251,132, 17,253,162, 29, 80, 58, 33, 40, 82,251,227,130, 22,116,192,200, 87, 58, 45,167, 16,230,112, 26, +170,103, 59,245, 35,243, 29,159,226, 94, 10, 26,107, 7, 68,251,214,182,241, 86, 47,210,135,254,180,142, 62, 8, 54,239,189,191, + 23, 1,104,187,150,156, 4,130, 32,218,221,243, 1, 52, 96, 12, 55, 48, 49,113,225, 25,220,235,202, 67,120, 75, 19, 19, 87, 30, +193,133, 23, 64, 65, 65,134, 95, 51,211,221,118, 85,245,111, 24,226,198,184,100, 3, 76,160,171, 94,189,126,245, 94,222,222, 63, +140, 45, 68, 31,155,253, 77,188, 62,101,100, 76,211,109, 1,194,213,125,227,111,107,157, 84,210,253,222,164,158,116, 94, 0,158, + 49,165, 33, 68,241,164,202, 83, 40, 54,167, 13, 41, 20, 20,176,204, 31, 8, 67, 77,192, 17,169, 36,138,112, 8, 15,254,200, 66, +251, 90, 0,239,149, 5, 49, 67,226,190, 36, 40,157, 18, 23,142,209, 91, 72,100,206, 59, 16,180,208,200,249,234,151,247,215,121, +189,189, 28,177,235,243,139,181, 28, 18, 75, 94, 55, 18, 45, 22,114, 72,244, 65,207,251, 61,211,118,138,149, 0,219, 13,225,241, +111,212,101,151,152,212, 97, 43,199, 26, 30, 86, 77,101,109, 1,179, 36,189,188,215,194,147, 43, 75,186,227, 96,146,151,233, 14, + 17,239,240, 6,169, 38, 60,128, 23,170,236,103,112,173,202,123, 34, 27, 20,121,181,107,118, 13, 56,192,217,143,123,184,185,154, +240, 10, 61,208,128,168, 16, 56, 66,213, 32,122,211,246, 0,111,164,121,155, 45,231, 13,128,142,113, 89,148,121,111,177,110,170, +157, 14,187,254,127,241, 46,214,254,248,209,152, 50, 36,223, 2,242, 75,245,158,118, 57,180, 82,113, 82,132,228, 77, 12,112,113, + 85, 76,120,253, 31, 75, 12,100,188,193, 32,247,112,209, 19, 54,142,191,224, 58,105, 0,168,132,114, 14, 33, 36, 15,231, 43,185, +114,107, 56,137,211, 97,122,220, 68, 71,246,200, 89,172, 90,188,123,235,230, 65, 79,228, 86,130, 28, 0, 84, 50,226, 48, 62,153, +234,177,243, 47,160, 69, 63,239,150,206, 93,149,119, 9, 32,116, 6,176,176,111,234,149,107,105,145, 9, 86,126,203,169, 61,254, + 27, 51, 91,126,196, 20,183, 24,106, 13,139, 73, 70,213, 89,206,119,172,153,170,197,184, 60,149,246,143,108, 11,186,146,166,250, +178,224,195,148, 27,157,151,232, 17,213,167, 24, 53,165,247,172, 70, 54,166,250, 84, 22,176,239,107,176,255, 81,144, 16,142,186, + 77, 82,241,152,176,135,213,229,202,211,251,241, 52,240, 40, 19, 92,133,221, 47,212, 12,137, 84,195,241,171, 86,209, 79, 58,250, + 72, 35,161, 92, 12,252, 46,253,254,232,246,238,254,249,233,113,190,152, 16, 25,143,192,239, 0,125,235,240,187, 67, 80,155,105, + 14,202, 50,111,219, 17,153, 22,114,136,224,189,204, 10, 6, 9,142,116,145,141,132,100, 49,216,218, 41,138,241,163,143,241,127, + 97, 62, 63, 2,176,118, 53, 61, 9, 3, 65,116, 63,192,130, 1,212,131,137,127,193,223,224,197,120,240,255, 95,141,119, 77,192, +128, 64, 11,133,118,103,220,157,217,217, 46, 31,145,152, 72, 54,132,148, 67, 75, 83,102,103,222,188,121,207,156, 59, 7,158, 44, +233,109,157, 36,140,135,139,163,185, 35,139,165,110,248, 43, 73,209,243,206,238,178,206,152,200,111, 59, 76, 77, 51,151,117,141, +130,143,135, 52,207,228,160, 74, 90,247, 8,208, 21,131,152,128,186,232, 3, 66, 45,252,152, 0, 98,180,159,103, 43, 6,126, 7, +140,114,221,196, 51, 11,166, 12,188,128,174,102,211,108, 22, 65,149, 80,189,175, 84,127, 48,117, 1,137,100,210, 39,237, 97,104, + 57,223,240, 91, 92,143,152, 54, 3,226,244,169,110,168, 7,119, 20,217,117,136,101,250,134,124,114,156, 20,152, 72,234,193, 99, + 50,108, 98, 5,174, 68,136,100,211,250,253,175,112,158,201,242, 20, 56, 1,139, 77, 28, 88,181,227,171, 64,238,223, 59, 66, 80, +149,122, 26, 94,223,221,247, 63, 22,213,102, 7,156, 39,214, 13,238,136, 55,225, 75,107,159,140, 65,235,102,235,237,155, 47,216, +149,122,124,152,140,134,197,114, 85, 55,117,211,254,199, 35,136, 89,186,122,149, 77,123,181,100,213,235,111,155, 99,233, 78, 12, + 42, 38,224,172,238, 26, 53, 90,212,183,129, 61,151,104,162, 57, 18, 62,252,231,150,132,211, 33,206,191,169, 40,187,206, 15,145, +192,126, 17,161,134, 4,233,164, 84,157,213,119,229,121, 11,206,139,152, 22, 58,202, 74,147,204,228,209, 44, 82,134,201, 74,119, +206,216, 92,105, 89, 16,117, 1,151, 76, 71,103, 7,153, 40,165,226, 84,116, 18, 91,215,241, 62,217,191, 47,106,215, 39,250, 99, +216,149,156,238,219, 98, 50,188,229,163,178,235,105, 29,247, 40,204,189,244,130, 36,171,225,191, 31,144,155, 9,121, 7, 6,198, +111, 40,223, 26, 5,164,108,220,124,187,237,103, 91, 90,211,215,182, 7,174,134,114,174,170,133,169, 86,182, 92,154,114,213, 86, +179,122, 59,109,170, 57,150,115, 88,127,249,111,113, 59, 15,110,171, 44,214,237,179, 35, 38, 71, 38,109,177,120, 7, 0, 15, 61, + 53, 76,236,141,105,209, 74, 48, 2, 72,211, 12, 0, 26,157,156,243,244, 73,120,202,146,206,163,132,151,126,251,101,224,208, 90, +251,252,242, 58, 26,143,143,117,234,186,204, 61,231,110, 24,154, 97,212, 71,113,240,108,112,199, 14, 70,150,115,153,130,183,253, + 54, 78,233,168, 97, 49, 74, 4, 27, 95, 15,161,186, 12,253,159, 9,193,127,127,253, 8, 64,219,181,228, 52, 12, 3,209,140,227, + 84, 41, 45, 5, 33,177, 98,129,196, 37, 88,112, 38, 14,128,196, 97,129,109, 68,127, 52,205,199,181, 7,123,198,118,156,210, 74, + 72,136, 46,171,170, 74, 27,103,252,102,252, 62,242,228, 54, 2,167, 55, 77,248, 77,147, 46,194,207,160,124,130, 40,109,128,148, + 95,159,121,148, 2, 33,128,201,199, 81,198,153, 22,132,155,238,230, 79, 64,241,195,209, 13,130, 90, 96, 18,245, 5,130, 65, 56, + 37, 3,223,222,133, 75,101,122, 14, 41, 0,165,103,229,187,138,192,252,103,183, 34,121,207,214,222,182,143,189, 5, 25, 62, 77, +229,244,105,126,187,173,171, 15,204,102, 25,212,210,229, 15,203,129, 18,103, 87, 99,110,215,181, 20, 89,163, 76, 78,147,166, 96, + 10,134,124, 70, 58, 9, 30,141, 34,252,105,228,253, 2,179, 60, 95,148,210,150,212,170, 87,141, 30,108,188,212,153,205, 28,142, + 87,243,192, 46,135,164,160, 71,102, 11,219,135,181,148,128, 72, 37,207, 54,207,238,142,221,223, 92,188,125,110,187, 78, 57,229, + 24,139,184, 40,236, 1, 92,228, 16,218,143,238, 20,190, 55,170,202,178, 71, 33, 31,238,174, 45,244, 88, 45, 91,215,133, 39,169, + 29,230, 15,245, 29,146, 96,113, 79, 9, 37,129,219,130,206, 28,103, 5,144,252,223,245, 69, 74,231, 98,236, 25,192,202,123,230, +194,155, 16,186,133,152, 82,170, 60, 24,227, 32,184, 84,191,193, 54, 69, 87,229,101,221,213, 33,153, 33, 50,173,195,119,179, 79, +237,232,188, 31, 6,102, 14, 77,232,125,108,171, 31, 27, 26, 6,213,232, 39,114,105,209,129,113, 36, 88,212,223, 82,126, 14, 14, + 2,107,195,156, 90,122, 10,128,219, 16,113, 32, 77,169, 64,182, 51,140,179, 76, 55,142,242,220, 15,219, 61,118,170,235, 45,202, +246,122, 90,198, 46, 62,228, 74, 7,103,158,209, 80, 1, 6,186, 62, 14, 26, 47, 11,202,157,165, 0,141, 17,242, 90,234, 94,235, + 50,159, 20, 80,232,174,166,189, 64, 31, 68,214, 75,131, 82, 30, 56,142,202, 34,119, 67, 38,239,251,173,113,182,192, 61,186,145, + 61, 11, 10, 44, 46,211, 6,211,100,162,116,218,252, 35, 93,149, 92,130,120,139,229,220, 28,225, 50,224, 68,132,240,156, 73, 14, +103, 9,129, 38, 41, 71, 17,185,219,171,100,141, 64, 66,139, 9, 54,203,237,254,235,245,229,121,179, 89,179, 98,102,124,164,115, +124,133, 22, 74,180, 90,195,249,246, 1,143,223, 26, 61,181, 13, 53, 88,233,107,185,171,226,198, 63, 47,230,107,189, 74,142,209, +241,255, 32,252,183, 0,164,157, 77, 83,194, 48, 16,134,119,211, 72,139, 40,234,205,209, 25,245,228, 95,241,255, 31, 61,170, 7, + 15, 58, 10, 67,129,126, 36, 89,147,221,132,182, 84, 28, 71,129, 11, 31,135, 50,180,203,126,188,251, 62,250,219,128,126,128,146, +245,171, 99,112,137,132,251,171, 40, 47, 39,108, 95, 83,159,204,163,156,143,235, 17,207, 96,165,130,143,100, 4,230,197,211,104, + 2,131, 12,153, 71,220, 87,137, 73, 56,180,188, 96, 21, 90, 97,236, 31,102,187, 90, 21, 57,206,179, 61, 21,137, 91, 7,231,245, +128,167,103, 55,231, 23,183,215,245,230,109,229,127,236, 66,163,237,146, 56,103, 27,222, 82,226,131, 87, 21,147,113,196, 98, 87, +160,219, 31, 44, 64, 4, 22,138, 64,196,106,211, 28,212,213, 44, 87, 19,245, 94, 54, 79,109,187, 29,250,175,226, 97, 77,149, 74, + 31,195,209,208,169,159,206, 79,210, 91, 5, 55, 64, 78,117, 86,100,122,134, 49, 93, 89, 84,245,227,203,231,186,106,182, 53,109, +195,190, 34, 28, 9,181,217,144, 38,220,212,246,181,181, 79, 0,119, 0, 15,247,151,211,147, 41, 53,213,106,181, 94,146, 45,147, +100,243,159,212,239, 93,139,201,240, 17,250, 71,142,120,172,194,195,223,167,153, 42,125,169,225,112, 30,118,151, 49, 52,141, 83, + 54, 42,147, 65, 9,136, 76,160, 78, 29,103, 9,142,110,136, 89,130,142,139, 20,241, 65, 44,122, 16, 27,116, 74,160,132,184, 52, + 45,176,133,152, 20, 72, 88,236, 87,208, 97,110, 79,221, 54, 85,114,224,219,117,218,145,246, 38, 85,137,191, 1, 48,166,184, 69, + 99, 86,140, 45, 35,217,177,138, 43,169, 73, 3, 16,144, 28,254, 52, 52,138,163, 60, 36,245, 75,180,207,144, 82,132, 71,180,187, +105, 84, 7, 47,219, 5,119, 75,105, 14, 64, 2, 38,118,130,183,198,193, 31, 31, 63, 49,161, 18, 13,190, 75,153, 2,211,234,194, +204, 39,181, 42,161,124, 6,165,253,107, 46,203,193,112, 14, 32,250, 75,219, 58,179,245, 97, 29,170,133,105,171,224,113, 96, 66, +221, 23, 45, 52,187, 5, 92,183, 55,139, 30, 91, 54,166,171, 79,229, 69,190,169, 54,210,114, 15,150,179,104,233,187,107,193, 65, +207,229,120,168, 67,199,193,162,127,106,212, 10,143,145,197,248, 50, 82,245,223,114, 93, 46,181,142, 5, 84,111,247, 94, 84,114, + 99,113, 20,253,208, 46,255, 65,191,136,195,193,128, 26,116, 94,121,169,197, 54, 58,250,161, 70, 60, 97, 74,158,136, 14, 39,118, +127,200,168,252,237, 75, 0,210,206,173, 39, 97, 32,136,194, 59,219, 90,138,183, 39,163, 24,245, 31,249,243,125,246,197, 16, 98, +162, 49,162, 66,233,182,187,118,110,187, 91, 69,193,248, 72, 10, 1,146,102,186, 51,115,206,119,114, 62,112,176,219, 3,162,118, +247, 18,227,247,132, 63, 84,121, 37,218,113,127, 36,155, 14,195,121,118,134,234,122,144,141,166,133,144,120,197, 41, 25, 49, 50, +222,176, 72, 19,212, 96, 84,215,149,223, 44,190, 80,114,118, 3,199, 20,179,197,142,180,146,252, 2,198, 52,190, 14, 39,209,168, +120,232,208, 41,210, 33,248, 38, 80,222,188, 60,111, 75,230,159, 28,151, 6, 90,203, 10,147, 13, 93, 42,149,209,216,234,172,121, +248,109,206,192,213, 81, 93, 77,236,253,235,234,129,176,192,189, 66,196,250, 61, 28, 76, 48,110,211,242,197,124,167, 83,248,169, +122,166,150, 36,126,183,190, 63,173,166, 23,245,193,188,129,185, 9,119,207,111,215,221,122, 56,222,172,135,106,142,189, 72,104, + 81,126,136, 15,210,101,107, 22,244, 64, 58, 55,230,246,230,114, 54, 59, 25,202,230,226,241,253,245,165, 89,145,231,214,253,187, +184,155, 44,215, 73, 90, 13,140,225,181, 53,105,102, 14,173,113, 30, 74, 11,103,147,178,117, 20,168,200,121,110, 94, 58,121, 38, + 18, 42, 25,157,198,235, 33, 9, 98,184, 78, 71,175, 18,179, 98,146,232,197, 68,171,145,215,187, 49, 29,222,189, 34, 31,133,223, +158, 9, 36,200,187, 28, 89,170,146,180, 13, 58,247, 6,149,124,248,109,102,246, 96, 82,165,143, 22, 7,201,218, 22, 66,142,108, +248,216,249,132,231,115, 43,128, 73, 14, 94, 66, 48, 16, 85,121,144, 71, 17,135,133, 83,127, 40,170, 28, 9,141,140,145, 5, 16, + 7,152,160,195,118,207,180, 98,144, 12,193, 36, 36, 71,149,130,165,175,165, 5,191,195,127,133, 11,176,170,119, 31,190,121,194, +224,190,162,238, 17,209, 52,220, 35, 64, 99, 36, 10,151, 29,250, 6,204,167, 91,225, 9, 39, 80, 38, 17, 10, 60,168, 43, 22,131, +170,175,108,229, 58, 23, 61,236,249,189, 3,116, 84,177,233, 66,216,180, 27,155,173, 59,126,148,103,143,237, 64,217,224,219,195, + 87,153, 31, 31,225,101, 93, 75,247, 69, 95,240,248,135, 53,219, 94, 80, 86, 25,238,237, 27, 84,116, 7, 25,187,136,211, 39,216, +178,236, 13,185, 40, 28,247,226,128,129, 89,141,206,223, 27,183,142,103,179, 66, 81, 7,194, 90,207,160,246,102,143,194,251,203, +186,139, 63,248, 41, 0,105,103,147,211, 48, 12, 68,225,177,155,166, 80,170, 10,177, 1,137, 61,135,224, 14,220,154, 43,176,237, + 14, 84,117, 83,241, 83, 32, 78,236,193,243,231, 36,109,165, 86, 66,234,174, 82, 42,165,201,243,204,155,231,207,213, 88, 65,176, +119,197,206, 80,121, 60,161,242, 46,157,233,216,168,202, 59, 87,118,159,219, 57,192, 58, 77,183, 70,184,255,169,196, 55, 89,113, +143,138,242, 75,176,151,118,230,111, 58, 94,200,233,165,242,177,176,244, 68, 44,120,122, 23, 93,170, 52, 64,229,229,113,176,115, +237,109,158, 70,215,245, 19,115,255,236,244,119, 50,209,126,117,162, 11, 21, 19, 37,174,193,253,240, 25,170, 51, 67, 14, 4,250, +208,125,184,175,235,155,171,233,243,230,227,109,112,219,218, 51, 58, 35, 63, 54, 34,211, 32, 42, 48, 29,226, 95, 13, 95,211, 89, + 6,113,215,194, 93,254,221,197,229,246, 51,172,227,247, 10, 96,251,222,229,126, 98,201,239, 83,195, 22,195,142, 91,141,134,175, +249,232,234,167,135,219,122,121,113, 85,195,111,211,172, 94,119,235,134, 32,198,173,181, 8,255,145,120,111,193, 77,217,225, 53, + 7,127,225, 97, 57,205,101,123,149,213,243, 43, 11, 82, 7,243,218, 47,230,254,101,227, 12,218, 39,126, 27,195,234, 64, 78,173, + 64,113,216, 20,129,168, 41, 26,254, 11,135, 85,147, 67, 60, 18,192,151,204,140, 46,234, 90,197, 11, 12, 11,212,123,119, 99, 12, + 33,150, 42,161,100,189,248,193, 75,149,156,113,173, 82, 95, 34,126,106, 55, 96, 25,189,246,202,223,245,121,111,194,153, 41,253, +215,232,184, 22, 23,118,253, 30, 30,113,109, 68,229, 25,201, 49,225, 43,139,196,115,167,153,160,167,228,155, 51,227, 64,241, 94, +194,180,101,142,182, 41,187, 12,156, 77,202,132,187, 65,219,123,163,208,202, 60,133,164,218,148, 91,219,150,208, 51, 20,226,173, +154,252,212, 71,166,132,208,253, 38, 50,119,155, 82,192, 24, 48,236,132, 73,144,139,126, 54,205,162,226,213,120,230,213,166,112, +184,234, 57,139,232,141,159, 10, 49,103,220,177, 24,199,126,117,156, 14,228, 11, 75,171, 54, 30,128, 71, 16, 71, 23,209,216,204, +244,231, 70, 95,150, 4,196,210,202,136, 16,197,212,151,222,136,167, 75,227,120,108,102, 9, 78,119,108,194,101, 94, 26,129,176, +230, 19,162,159, 56, 50,182,218, 48,217, 79,247,224,140,242, 60,185,147, 14,208,123, 53, 73,225, 22, 7,229,252,249,125,114,229, +171,144, 84, 90,254, 4, 32,237,218,117, 26,134,161,168,237, 56, 77,105, 90, 90, 30, 2,169,130, 31, 96, 65, 98,233,143,243, 13, +236, 12,140,176, 0, 18,207,161, 82, 74,234, 38,177,177,239,189, 78,156,144, 74,145,104,183, 86, 29, 92,199,199,247,117,206,233, +214,103,134,160, 60, 27, 26,203,123,190, 82,208,140,173, 81, 30,153,107,109,148,167, 1,155, 38,144,247,230,175,164, 60,135,122, +120, 60, 48,177,100,225, 28, 5, 55,125, 66,114,248, 43,231,135,128, 32, 32, 52,121,204,147, 52,159,125,203, 10, 5, 41, 77, 73, + 18, 33, 68,152,243,243, 91,110,152,210,181,195, 65, 44,216, 68,181, 29, 51, 72,129, 75, 64, 62, 9,241,239, 26,141,110, 9,194, + 72,250,209,158,184,148,201,101,154,220,127,255,188, 49,115,201,248,106, 50,191,185, 56, 93,231,234,246,249,229, 97,255,159, 26, + 72,188, 17, 62, 86,193,158,153,246,231, 35,223,177, 52,228,160,100,138,162, 84,219,226,124, 49,185, 58, 59, 28,125,154,187, 50, +127,183, 16,207,216,171,110,237,165,141,250, 87, 92, 92, 31,207,151, 39,179,116, 22,109,109, 56,159,233,167,143,205,227,215,102, + 13, 19, 65, 99, 88,218,127,234,131,156,236,174, 8,220,167, 76, 28, 9, 49, 79,226, 69, 18, 31,196, 46, 60,180, 89,179, 13, 2, + 1, 42,120,174, 98, 72, 94,121,221,180,226,232,106, 10,240, 17,128,187,107, 22,146,170, 35, 55,253,149, 81,222, 78,128, 64, 38, + 35, 77,166,153,202, 80, 15,163, 3,238, 93,254,167,215, 13,116, 42,232, 6,230, 41, 76, 68, 66,223,194, 96,253, 24, 14,163,240, +117, 36, 12, 65,240,242, 64,156,199,137,154,144,159, 2,156,104,152,216, 34, 47, 29,227, 61, 85, 65,217,177,161,116, 99,206, 1, +139,229,210,231,178,134,251,194, 16,247, 21, 40,238, 31, 71,232, 56, 99,119, 10, 88,186, 65, 45,171,241, 32,108, 56,132, 44, 34, +175, 7,247, 53,112, 38,109, 60, 46, 88, 84, 42, 45, 50,187, 99, 70,239,180,147,189,113,125, 9,184, 92,157,251, 66,101,207,129, +133,239, 82, 89,148,119,132, 38,247,116, 99,192, 67,183,155,243, 33,238,139, 59,113,211, 52,213, 67,246, 5, 1,166,106,123, 2, + 7,115,206, 61,220,178, 63,193,123, 83,165, 65, 49,115,210, 19,134,101,234, 64,138,174, 61,193,233,154, 47,135,227,133, 42,242, + 93,181, 29,174, 86,214,169,229, 73, 49,178, 88, 13, 94, 37, 76,129, 94,185,228, 18, 24,154,232,112,135,151,106,173, 70, 1, 53, +219,162,192, 26, 0,167,181,224, 8, 6, 13,164,212, 42, 44,122,208,149,211,100, 15, 53,184,219,215,175, 0,164, 93, 93, 79,219, + 48, 20,245, 87,211,148, 66, 80,217, 86,109, 8,137,189,193, 59,255,129,127,207, 95,216, 11, 82,167,105, 18, 44, 93,211, 54,137, +237, 59,251,218,215,113, 24, 97, 72,203, 83, 85, 85, 85,154,164,215,215,231,156,123,206,128,207,168,151,222,243,147, 85,254,253, +124, 90,254,114,172,255,243,109, 89,222,203,243,204,192,210, 38,255,110, 24, 52, 86,233,127,204, 99,215,110, 73,214, 46,200,106, + 12,166,124, 66,129,165,120,112,142, 8, 46, 90, 6,130,157,203, 25,152,190,214,155, 85,201,230,197,114,127,184,240, 26,182,168, +115, 73, 87, 35,148, 20, 65,177, 27, 81,201,224,206,188, 84,242,103,103, 78,101,244,104,108,227,246, 10,246, 84,203,240,126,114, +183, 58,127, 46,228, 81,247,143,166, 95, 51,126,119,122,126,123,245, 97,185,154,139, 78,222,203,203,242,241,199,131,209, 83,215, + 80, 38,247,238, 12,159,233, 51,112, 77, 17, 99,201,169, 65, 14, 31,110,152,221,105,120, 58,244, 39, 69,191, 62, 47,215,203,226, +102,219,126,171,119,155,182,109,124,194, 26,156, 49,190,146,179,139,162,248, 82, 45, 62, 85,133, 85,126,234,189,222,119, 69,169, + 54,207,250,233,185,169,181,110, 72,210, 99,216,127, 29, 65,252,126,130, 80,213,130,201,175, 85,121, 93, 45,174, 62, 86, 74,136, +239,245,113,219,105,208,230,151,209,203,146,181, 86,109, 15, 72,188,115,150, 6, 52,211,237,179,108, 40,238, 70,135, 13, 95, 10, +241,121, 67, 75, 55, 84, 7,247, 67,126,247, 77,204,201,142,195,157,150,196, 39, 0,127,225, 97, 60,214,106, 63, 0,136,158, 72, +190,110, 4,177, 7,144,183, 81,204,124,136,152, 60,100,145,103, 44,195, 40,198, 60, 30, 90,170,163,241, 69, 44,204,161,251,144, + 99,178,142, 88, 41,225, 71,115,133,171, 19, 34,153,119,199, 71, 45, 57,161,243,152,162,145, 48,153,152,106,134,157,105,224,165, + 33, 5, 13,161,222, 52,108,126,194,182, 33, 36, 82, 73,174, 93,147,107,249, 17, 58, 1,178,115,111,160, 69,144,159,216, 70,184, +204,226, 58, 24,220, 34, 91,156, 40,235,113,215,108,137,201,224, 47,134, 57,114,184, 42, 20, 48, 72, 12, 8, 55, 20,141,248, 79, + 25, 73,188,203, 48, 6,103, 96,162,184, 19, 5, 99, 96,104, 41, 57,177, 31,163,137,229,128,252,134,111,221,181, 91, 6,246,213, +179,177, 19,192,117, 62, 81,136,107,170,198, 5, 30,199,146,240,254,184, 62,218,173,135,232, 66,145, 70,154, 7, 95, 47,234,210, + 44, 49,249,190,159, 81,124,102, 60,234,229,158, 51, 37,200,138, 35, 51,229,134,247, 36,101,230,199, 31, 1, 72,187,150,157,134, + 97, 32,152,205, 67,109, 69, 3,180, 5, 33, 46,192, 13, 62,128,255,255, 13, 16,226, 7, 42, 4, 45,144, 38,109, 18,123,241,218, +187,142,211,132, 83,111,173, 26, 69,114, 19,143,237,217,217,153,212,191,203,106,208, 13, 15,199,182,153,167,168,227, 58,121, 19, + 4, 55,215,214,153,142,125,170,101, 35, 15,182,140,198,189,135, 50,137,233, 21,212,152, 17, 35,201,124, 43,106,103,168, 39,222, +104,199,102,114,126,146,184,180, 87,207,252,186, 28, 55, 74,131,219,213,229,235,142, 28,227,102, 69,244,180, 42,175,230,234,187, + 88, 82,186,148, 79,217, 70, 49,175,224,229,212,109, 81, 88,133, 55,209, 65,151, 60, 68,153, 61,192,215,178, 82,122,247, 71, 10, +228,139,227,183,114,111, 62,223, 66,102, 6,252,254,181,125,249,196,170, 33,101,250, 34, 73,111, 84,187,254,255, 81,225, 64, 61, +128, 1, 99,163, 2, 5, 85, 26,144, 57, 13,213, 3, 84, 81,181,155,140, 98,108, 51, 72,243,124,250,124, 49, 61, 80,156,173, 57, +102,227, 89, 70,249, 77, 13,154,213, 30, 63,246, 6, 63,204, 74, 64,214,253,230,159,218,253, 54,235,159,186,142,168, 72,112, 56, + 25,220,157, 1, 67, 70,248, 14,119,179,217,227,117,126,191,156,207,211,201,195, 42, 39, 83,217,166,216,150,219,202,154, 3, 46, +166,217,166, 0,218, 52, 38, 14,203,189,142,214,211, 11,124,158, 70,231, 64, 26, 24,156, 12,141, 19,226,238,180,223,153,181,210, + 13, 90,145,229, 2, 10, 14, 7, 86, 88, 2, 68,206,207, 26, 61,202,131, 20,182, 93,195,148,131, 39,140, 93, 48,145, 20, 93,149, + 64, 50,243, 54,208, 87,163, 67, 39,173, 68,191,223,145, 45,188, 99, 84, 8,120,227,222,131,102,253, 12, 53, 4, 81, 39, 26,145, +242,236,110, 37,190, 9,182,238,204,150,174,246,152,203,137, 25,212,214,212,109,219, 57, 8,201, 12, 46, 73, 19, 13,173,157,104, +108,146,115,158, 92, 38, 86, 81,102,214,173, 61,197, 24, 84,160,109, 96,172,141,221, 68,197, 29,194, 72,122,112,115, 85,141, 13, + 41,103,236, 15,182, 44,197,192,163,120,140, 62, 16, 91, 7, 18, 38,232, 80, 53, 2, 62,142,141,181, 99, 35, 14,100,230,250, 88, + 47, 1,195,194, 38,142,116,101, 98, 24,144,212, 15, 4,113, 68,149,246,246,238, 78, 66,213,111, 13, 67,232,195,160, 47, 12,135, +148,169,144, 16, 44,144,141,165, 94, 26, 89,147,196,212,118,200,211,151, 56, 21, 51,178, 56, 92,196, 93, 75, 91, 39, 11,183, 33, +240,162, 8,241,162, 19, 20,109,190, 99,240, 80,143,169,236, 70,161,255, 79, 0,218,174,102, 39, 97, 32, 8,207,110, 23, 10, 17, +149,244,100,226,201,131, 47,225,251, 63,130, 79, 96, 34,145, 16,130, 24,160,165,116,103,221,153,217,159, 82,196,139,145, 11,151, + 38,208,118, 59,157,253,230,251, 25,242, 35,109,207, 61,252, 31, 10,253,144,202, 45, 15, 82,172,242, 42,230,190,170, 40, 93,205, +128,186, 11, 9,216, 24,204,192,232,138,136,125, 7,184,108, 19,173,126,146,131, 89,201,237,147,231,205, 48, 23,131, 76,201,157, +126, 59,108,228,184, 26,224,117, 13, 47,147,175, 66,221, 29,173, 28,139,140,150,114,204, 96,160,246,135,228, 78,226,244,113, 0, +176, 0,235,136,185,194,118,144,243,181,101, 99, 53, 1,109,104,167,230, 22, 22,111,232, 71,113, 85, 31,177,113, 7,236,118,136, + 13, 9, 67,136, 52, 41,127,184,232,145, 41,109, 15,156,185,134,140,169,158, 71,124, 98, 31,154,184,202,183,208,169, 14,202,125, + 81,219,227,253,136, 8, 64,134, 87, 19,199,136,185,117,139, 53, 13,215,168,168,108, 59,152,142,117,235, 79,220,232,182, 61,125, +124, 54,171, 83,183,101,125,150,253, 27,236, 62,101,130,191, 47,238,149, 50,207,243,217,211,124, 90, 34, 44,150,123, 11,135,247, + 53,105,139,246,182,243,239, 57, 95,177,102, 6,110, 39,254, 46,104,177, 92, 78,110,136, 46,230,187,184, 20, 9,132,162, 64, 28, + 20,247,129,188, 69,210,138,122,139, 32,140, 31, 57, 27, 6, 98,243, 30,236,198,178,121, 95,234, 10, 85,228,223,132,230, 35,246, +229,161,198,115,178,188,224, 72, 2, 59,139,159,117,232,172,153, 55,207,235,217, 38, 39, 25,149,120,214, 49, 40,141,140,230, 77, +106,225, 37,216,136, 16, 63,212,234,130,109,172, 34,186,173,131,222,171,223,201, 42,151, 89, 57,241, 27,211,248, 21, 34,212, 40, +194, 15, 1,137, 81,236,103,232,149, 81,194,184, 56,217, 61, 15,253,124, 31, 80, 77,171,122, 92,236, 40,170,150,199, 14,225,242, + 74,141,247,215,139, 85, 34, 78,144, 25, 27, 38,198, 78,166,205, 49,135, 9,251,170,223,115,216, 76,177, 90, 93, 78, 38,195,232, +144,223, 7, 42, 58, 8,255,194, 79,185,160,205,184, 43, 36, 74,157,237,106, 6,195, 0, 60,223, 88, 13,167,186,238,210,140,255, +202,222,130, 42,137, 46, 71,170,104,108, 91,196,202,238, 59, 3,227, 68, 35,229, 30,170,199,245,102,169, 67,125, 55, 42,121,233, +147, 45,199,168, 57, 54,146,109,205,100, 54,166, 13,106, 50,144, 67, 38, 18,209,116, 4, 56,177, 50,123, 41,161,141,186, 92,204, + 51,194,171,159,111, 1, 72, 59,155,157,134, 97, 32, 8,123, 45, 39,208,180,252, 72, 72,156, 17, 92,120,255, 7,130, 75, 37, 14, + 20, 69,180,224, 54,142,237,197,235,181, 19, 7,210,170, 18,106, 15, 81,123,104,234, 70,238,238,102,230,155,196,159,233,167,205, + 14,254,138, 49,254, 83, 81,194, 25,183,118,225,228, 11, 48,119, 12,163,171, 27, 74, 19, 9,102, 82, 71,132,201,164, 7,219, 33, + 80,148,230,132, 19,110,128,236,177, 74, 50, 28,169,221,254,157, 38, 16,227,149,113, 47,252,245,114,241,109,198, 78, 46, 25,107, + 61, 14, 41, 82,105,102, 20,199,249,181,208,142,172,217,132,216,141,178, 63,217,209,134, 14, 44,117,199,148, 62, 42, 27,210,161, +251, 23,239,226,252, 36,236,170,182,117,118,227,253,150,242,137, 69, 45,201, 0,181,201, 99,150, 42,142,170,253,145, 75,123,230, + 43,229, 5,172,166, 8,142, 97, 74,224,114,220,113, 56, 73,109,188,113,190, 51,125,107,188,238,109,111, 9,251, 77,137,226, 16, + 74, 50,241,229,156,113, 98,183, 55,235,157,121, 19,180, 52,230, 31,195, 25, 14, 5,108, 34, 9,231,121,209, 60,221,172, 90,109, +215,173,254,212,198, 90,119,160, 20, 64,115,232,237,135, 54,225,184,243,238,182,145,245,162,126,109, 21,187,127,162, 27, 50,153, +224,252,175,226, 61,133,123, 10, 24,193,164,243, 23, 27, 76,177, 72, 99,213,148,237, 66, 69,131, 60, 41,217,208,151, 10,152,193, + 70,143,163,208,113,136,117,103,237,185, 44,202,138,204,105,194, 33,242,180,240, 84, 21,248, 2,118, 85,103,200, 76, 14, 50,198, + 76, 69,149, 56,116,139, 83,233, 93,241,228,190,146, 7,224,140,190, 74, 30, 47, 40, 64,245, 76,229,118,156,153, 4,137,163, 82, + 4,196, 69,204, 81, 77,226, 71,180, 7,215, 57,226,185,227, 18, 84,135,134,180,143, 52,141,177,209,238,213, 19,103,198, 26,218, +220,137,120,237, 40,182, 9,248,163, 60,187, 8,139, 14,189,236, 92, 32, 39,126,166,165,193,114,217,177,148, 7, 67,241,127, 48, + 24,110, 65,204,248,203,240,156,155,130,103,188,133,115, 58,145, 83,218, 25, 57,217,220,145,211,112,105,152, 16,129,160, 18, 84, + 69,218, 35,165, 42, 85, 17,161,182, 50, 93,167,164, 10,175,199,255,211,120,183, 58,205, 83,169, 85, 11, 45,108, 40,237,195, 15, +223, 92,174,194,178, 43, 38,220, 34,167,147,194, 69,213, 64,138, 34,192,161,252,125,184,123,220,238, 91,222, 28,175,170,171,200, +155, 60,122,194, 63, 2, 48,118, 29, 75, 13,195, 64, 84,213, 33, 38,148,225,192,145, 79,224,255, 47,252, 11, 3, 23, 24,202, 0, + 33, 16, 23,173,208, 22,201,138, 7, 72, 60,185,219,177,165,213,150, 87,220,222,158,253, 31,125,155,255,132,130, 15,204,226,205, +156, 38, 16, 43, 70, 2, 27,232, 68, 61,153, 41,211,191, 68, 44,188, 97,144, 2, 83,156,164, 59, 27, 35,207, 83,246, 21, 13,153, +177,130,252,124, 86,137,153,174,171,182,121,236,125, 90,188,142,192,214,217,140, 19,213,137, 32,247,103, 52, 59,111, 73, 38,103, + 78,173,126,234, 37,245, 6,212,159, 17, 1,200, 58,139,247, 70,117,104, 74,135, 64,195,135,170, 27,230,201,228,186, 77,135,120, +143,100,147, 88,209,160,108,245,102,194,111,161, 19,102,147,166, 10, 26,207, 26,188,132, 88,143,107,204,193,135,205,128,253,219, +165, 75,199, 73, 60, 35, 49,222, 77, 0,146,247, 66,183, 85,111, 81, 39, 96,208,112,238,205,166,235,215, 93,191, 33,231,230,144, +221,166,246,214,128,191, 6,247, 37,253, 46,149,185, 62, 61,249, 6,184,121,126, 77,207,115,161,236, 24, 76, 8, 14,201,241,164, +181,181,160, 65,210,177, 87,103, 11,127,255,230,186, 81,165, 21, 14,148, 31, 82,172, 98,171,236, 88,112, 77,220,119,213, 69,163, + 42,167, 99, 53,249,206,204, 63,123, 9, 37,220,138,201, 9,166,206, 82,116,177,244, 77,100,252, 87,130,108,152,106,242,202,138, +167, 36,251, 58,151,141, 32, 94, 78,218,152, 56,225,187, 35, 43,208,145, 58, 88,177, 16,148,216,158, 11, 1, 90,205, 88,136, 50, + 81,201, 70,110, 0,104,105,234,155, 56,223,188,177,162, 46,139, 12,178,128,221, 65,188, 47,118,241, 69, 24,217, 69,236, 44,238, +182, 65,140,192, 46, 77,232,245,118,101, 87,170,251,234,113, 52, 49,116,253,199, 56, 54,237,209,226, 93,111,129,135,171,196,121, +165,175, 65,123, 16,136, 75,172,217,142, 13,120, 63, 21, 55, 53,152,166,211, 32,109, 15, 53, 81, 83,139, 71,118,165, 30, 44,101, + 19,228, 12, 44,194,116, 36,231,161,108,157,206,239,192, 88, 15, 70,126,232,255,105, 74,135, 4,119, 93,165,237, 74,198,135,154, +128, 49, 8,130,196,161,187,113,222, 88, 84,170, 68,205, 5, 76, 70,155,102, 97,192, 30,185,166,117,109,107, 91,111, 27,132, 5, + 48,135, 74, 33, 67,172, 27,183, 56, 17, 69,121,159,116,118,162,210,126,176,105, 37,184, 84,235, 3,233,207,120,228,198,203, 81, +158,110,126,247,114,139,119,163, 87,241, 57,172,245, 46, 51,102,118,253, 8,192,216,181,236, 52, 12, 3, 65,175,157,166,208, 22, + 84,113, 4, 33,142,156,248,255,111,224,206, 63,112,226, 33, 84,154, 38,126, 44,222, 93,219,113, 72, 91, 56, 87,141,162,180,158, +236,206,236,206, 52,243,119, 29, 28, 3,199, 57,202,135,211, 9, 32,255, 23,160,103, 79,189, 64, 60,192,216, 38, 97, 82,230,179, +219,169, 22,155, 48,200,217, 92,186,152, 49,107,149,115, 89, 67,189, 43, 87,150, 78, 11,233, 21,203,228,102,241, 20, 46,215,193, + 90,133, 7,196,109,187,120,247,215,159,189,227,240, 88,141,101,231, 64, 37, 21,172, 96, 40, 5, 63, 41, 45, 6,126,134, 11,112, +162,221, 67,162,194,217,241,102,228, 73, 6,238, 58, 27,198, 75,207,110, 51, 77, 54, 67, 95,155, 8,238,205,253,102,249,246, 17, +143, 85,146,100,219,108, 46, 6,167,137,145, 48,109,179,218,105, 54,158,124,177,203,115, 53, 3,169,169, 52,231,126, 21,176,109, +244,192, 82, 97,124,112, 59,222, 59,108,201,234, 48,182,142,176,212, 16,156,239,173,235,156, 39,109, 54,227, 59, 86,124, 93,248, +199, 1,146,155, 89,177, 7,206,131, 49,143,219,205,203,190,127,238, 14, 33,125,228, 41, 64,194, 17,109,213,115,163,211, 42,108, + 1, 54,198,120,192,215, 29,253,198,158,137,100,113,150,144, 74,189,182,134,193,160,112,102,143, 36, 47,250, 95,195,163,179, 55, + 59, 72,216,113,154,178, 84,181,156,134,179, 83, 28,234,174, 64,234, 7,210, 84,181,130, 73, 91, 63,242,203, 5,232,171, 37,170, +248,151, 75,139,116,152,211,176,193, 20,113,144,165, 36,121, 45,176,159,150,143,151,103,227, 59, 73,233,134,180,158,115,108, 20, +101,122,115,165,188, 69,225,226, 83,217, 78, 89,198,146,147, 6, 10,167, 45, 14, 39, 64, 21,202,202,169,125,236,102, 53, 94, 45, +215, 96, 41,231,166,137,144,175,195,206,125,123,144, 42, 7,179, 5,177,207, 6, 51,158,120, 62,158, 59, 76,141, 49,212,188,112, +241,130, 40,243,166, 1, 85,205, 83,193,184, 93,148,193,221, 87,118,245,185,120, 31,231, 32,235,180, 38, 60, 1,238,248,119, 73, +121, 30,142,206,115, 50, 53,184, 39,159,127,153,157,226,212,207,134,157,253,165,102,231, 80, 56,226,109, 22,171,197,197,221,234, +118,219,222,104,173, 7,103,123,218,138,141,237, 43, 41,168,134, 25,174, 75,115,113,179,218, 70,232,143, 23,234, 54,195, 33,116, +189,235,191,236, 87,103,251,111,183,183,254, 96, 41, 26,151, 93, 24,179,121, 28,164,141,101,205, 7,211,201, 4,206,232,119, 61, +189,233, 31, 1, 40,187,186,158,198, 97, 32,104,175,227, 52, 45, 66, 21,226,238,196,235,137, 23,254,255, 51,255, 3,137, 95, 0, + 66,232, 78, 66,106, 8,181,215,183, 31,222, 58,164, 80,184, 62,166, 82,165, 52,241,122, 60, 59, 59,211,157,254, 27,252, 81,149, + 15, 75, 5,164,255, 14,207,254, 77, 58,222, 85,167, 51,111,116, 10,152, 44,222, 32,124,157,184,206,180, 61, 90, 40, 38,122,172, +163, 11,156,191,233, 33,125,148,156,114, 72,206,172, 51, 24,192,146,133, 63,253, 25,189, 43, 63, 34,125, 21, 30,105,113, 77,244, +148,178,111,204, 96,205, 12,210,195, 47, 88, 63,158,167, 78, 4, 24,189,201,149,193,215, 38,100,103, 89,163,106,197,165,137,210, +226,181,130, 23,174, 19,129, 13,127,122, 41,127, 3,184,109,132,171,243,248,123, 19,239,159,118,189, 20,196, 52,155, 87,154,108, +103,202, 95, 43,162,234,113, 33,216,178,215,214,238,216,162, 66,202, 72,119, 76, 55,156,202, 30, 66, 12,172,233, 92, 33, 15, 6, +172,185,107, 45,114, 16,151,118, 9,199,183,252,215,101,205,140,221,189,119, 61, 59, 13,225,189, 41, 53,149,150,161,123,185,137, +195,245,197,250,246,249,229, 78,212, 65,122, 84,122,145,189,152,182,156,129, 69,118,133, 64,203,218,149, 77,241,151, 14, 30,166, +254, 53, 51,230,145,226, 1,210, 82,225,242,164,240,240, 64,206,204, 43,149,159, 5,207, 91,146,210,199,111, 93, 29,154, 83,238, + 4,157,123,223, 89, 61,150,105,187, 37, 53, 44,128,155,119,198,186,174, 20, 99,180, 57,166, 38,245,178, 20,237, 58,237,227,171, +224, 10, 52, 69,167,132,234,147,231, 52,254, 75, 45, 34, 49,103,194,124,242, 34, 83,117,215, 32, 58, 40, 30, 63,211,134,204, 42, +102,235, 78, 53,246, 93, 97,187,249, 36,163,107,170,254,178,236,123,177, 32, 83,194,187,221,152,198, 9, 38, 2, 46,236,145,206, +126, 46,168,121, 78,250, 23,201, 20,168, 86,121,113,250, 17, 32,143, 74,203,219,175, 91, 55, 88,180, 7, 21,170,163, 57,136,248, + 5, 23, 98,229, 30,171,202,167,148, 22, 71,213,220,222, 77, 29, 52, 51,246,180,214,242, 41,130,229,255,129,102,249, 42, 60,231, + 56, 65,136,175, 68,217,174,233,137, 14,253,128,136, 76,203, 72, 2, 16,248,238,215,112,249,115,115,181,130, 21, 61,232,145,142, +208, 57,239,217,186,178, 28, 50, 37,247, 72,192, 43, 73,251, 14,169,244,199, 16,132,102,131, 14,227, 22,182,235,110,242, 57,150, +176, 26,211,235,232, 57, 46, 52,185, 36,240, 72,193,143,157,213, 92, 80,185, 9, 88, 18,236, 98,133,254, 19,128,177,107,219,109, + 27,134,161,162,156, 58, 78, 86,212,237,176,167,189, 15, 24,176,125,247,254,171, 29,246, 80,180, 40,146, 93, 18, 89,150,196,137, +164,110,173,219,164, 65, 30, 2, 35,177, 5, 59,162,168,195,195,115, 94,199,223, 79,236,109,240, 37, 34, 15,239,134,224,225, 61, + 95,131, 6,104,132,130, 77, 46, 46,150,247,208,213,120, 85, 98,238,186, 95,199,101, 18, 0, 26,208,179,190, 81,182,187, 32,169, + 62,253,200,128,222,121, 48,226, 49, 25, 31,148,206,180, 7, 80,213,230, 51, 79,169, 52,163,216,118, 50, 62,170, 65,219,117,136, + 43,178,236,163, 41,132, 73,222,125,204, 48, 75,159, 9,173, 91,221,197,132,253, 62,103, 94,148,245,163, 26, 59, 24,161,251,181, +179, 63,189,239, 57,238, 95,146, 34, 60, 13,221,100, 62, 76,247, 28,171,121,171,196,218,138, 71,202,107,155, 99,238,138,207,188, + 17,118, 45,134,125, 80,134,187, 98, 54,220, 93,215,105,137,143, 96, 29, 62,206,254, 73,185, 63,220,254, 58,229, 69,162,149,139, + 81,175, 73, 84, 23,146,204,192,128, 76,207,190, 34,223,251,225,203,199, 15, 63, 30,158,110,121,123,222, 53,127, 59,209, 39,152, + 20,254,230, 57,236,168, 57, 0, 63, 95, 15,119,102,227, 69, 6, 14,165,254,135, 92,198,246,169, 94, 88, 80,143,220,134,132,170, +197,144,107,147, 12, 62,215, 1, 15,133, 16, 40,253, 77,149,103,178,188,171,144, 20, 39,225, 68, 62, 8,133,182,152,214, 6,212, + 13, 45, 87,183,225,166,136,133, 23,164, 62, 21, 96, 67,241,177,204,193, 2,146, 13, 25, 93, 91,215,121, 86,124,159, 26, 49,219, +102,236,114,184,216, 94, 84,146,140, 79,153, 80,149,253, 56, 3, 68, 83,139, 30, 7,100, 79, 64,161,115, 92,213, 78,192, 58,159, +144, 54, 59,129,165, 85, 25,220, 23,145, 62, 12, 13,225, 50, 65, 78,242,188, 84, 69,226,113,201,234,131, 66, 11, 81,201,228, 28, +179, 50, 60,147, 45, 85, 53,165,194,106,139, 88,130,187, 87,111,123,107,132,115,161,190,169, 29, 98, 56, 27,152, 22,193, 93,229, +156,189, 35, 28,145,122,124, 99,170, 30, 67,243,184,185, 9,179,187, 32,246,134, 30,135,171,111,227,215,155,245,167,127,214,236, + 73,242,104,178,222,206, 97, 62,196,212,157, 72, 33, 50, 74,207,242,207, 73,126, 39,222,205,131,183,214,207,214, 77,115,136,153, +251,241,232,205, 95,119, 48,110,218,227,206,168, 3,145,250,136,118,185,202,124,249, 78, 53, 54, 50,203, 30,166,242,249,191, 0, +156, 93,203, 78,195, 48, 16, 92, 59,143, 62, 0,113,168, 42,129,196, 25,137,127,230,147,248, 5, 14,136, 19, 7, 4,162, 40,109, +146,198,198,179, 94, 59,155,182, 32, 64,170,122,202,161,137, 93,103,118,118,118,166,252,135,232, 69,163,120, 63,137, 21,254, 25, +155,255,150,175, 87, 16, 94, 42, 88,155,252, 55,164,170,141, 46,236, 98,170, 97,196,198,134, 43,238,245,229,245, 83,251, 56,168, +129,103,125,243,214,169,126, 44, 18,178, 33,254, 42,163,180,134,115,151,248,109, 10,241,108, 97, 7,231,176,120,214, 38,247,120, +146, 66,119,136, 52, 16,187,208,240, 31, 20,243,147,187, 52, 77, 87, 49,242,237, 56,229,131, 7, 92, 93,168,173,194, 43,228,182, +158,215, 93,251,128, 54, 39, 14, 80, 68, 78,183,238,185, 5,113,113,134,243,209, 44,241, 41, 55,180,239,144, 89, 47, 41, 31,217, +149,215,127,131,157,117, 44, 64,155,230,102, 93, 28,172, 77, 29,206,138, 71,218,195,195, 91,144, 93,242,211, 13,152,125,135,238, +174,237, 88, 83, 81,147,255,116,244, 78,251, 45,178,216, 36, 84,132,148,215,124,158, 67,206, 37,130, 87, 10,253, 90,117, 83,207, +137,238,230,203,213, 69,117,255,242,186, 81,180, 96,175, 74,192, 38,189,120,246, 41, 35,176,177,243,102, 64,164,145,119,153,132, +149,240, 91,177,137,209,182, 41, 71, 13,129, 99, 8,175,241,164, 33,151,204,183,188,207, 60, 48,208,232, 56, 63, 58,242, 79,134, + 78,142, 38, 30, 11, 39,132,197, 70, 76,106,202,170, 96,184, 62,149,111, 36, 10,130, 71,141, 98,161,137,227, 61,162,120, 25,245, +224,112,109,216, 32,185, 0,158,217,157, 58,166,179,198,140, 85,225,198,188, 86,196,211, 68, 34,167, 88, 71,132, 88, 13, 35,189, + 63,241, 89, 51,227, 82, 58, 61,104,195, 87,246,236,237,101,242,202,131, 99,247,209, 24,196,152,100,238,134,145, 50,146, 14,110, +132,237, 98,245,151,184, 13, 63,210, 41, 7, 39,187,182,160, 73,114, 85,118,249,203,113, 78,162,164, 87,135,187,201,130,156, 36, +131, 57, 64,238,254,111, 24, 92,111, 25, 79,191,109, 30,158, 56,220, 45,234,204, 34,102, 66, 21,182, 10,223,187,109, 19, 48,187, +177,229,213,226,102,189, 88,125,244,187, 77,251,198,134,201,212,240,202,198,125, 93,176, 47, 97, 82,196,226,134,129,201,195,186, + 27, 56,183,133,171,170, 2,244,112, 79, 67,135, 36, 69, 83,217,186,118,179,206,119, 3,245, 61,245, 97,211,204,168, 46, 33,160, + 68, 14, 46, 35,140,194,136,162,198,209,244,177,196,159,253, 37, 0,101,215,210,147, 64, 12,132,167,221, 23,130, 60, 54, 38, 38, + 72,188,120, 35, 70,255,179, 63,206,131, 23,212, 68,196,125,117,164, 51,157,217, 46, 2,234,133, 43, 75,129,233,215,175,223,163, +199,239,127, 16,192, 28, 23,189,192,111,114,154,243, 40,254,212,187, 68,142, 0,110,231, 84, 75,135,237, 19,215,172,211, 80, 41, +142,224,123,221,110,204,129,181, 53,250, 77,197, 63,246, 36,100,182,134,211, 58,121, 36,113, 54,114,203,121,189, 42,235,229,188, + 91, 44, 60,208,221,238, 44,152, 94, 7,193, 27,195,213,244,186,105, 26,235, 62,171,166, 5,182,138,208, 31,177,150,235, 77, 12, +163, 54, 16, 1,180,115,152,187, 98,180,206,138,170,109,223, 40,195,128,145,236, 2, 96, 9,233,173,201,110,210,108,255, 80,169, +247, 5,246,134, 25,236,107, 27,207,197,132, 38, 50,127,107,201, 56, 51,145, 98, 82,153,244, 54, 8,189,241,139, 36, 23, 21,186, +157, 87, 77,248,107,157, 10,186, 45,224, 70, 40, 29, 45,254, 78,132,165, 82,246, 41, 21,214, 72, 81,249, 5,125,216, 25, 33,247, +199,241,100, 85,230, 79, 47,239, 31, 81,176,229, 65,248,165,147, 85,170,233, 81, 31,198,217, 51, 78, 91,190, 38,215,152,105,213, + 62,134, 9,194,223, 96, 64,215,209,169,229, 8,132,143,108, 77,136, 90,215, 64,149,190, 8, 49, 7, 16,155,137, 66,233, 7, 30, +110,163, 56,224, 53,237,160, 49,203, 28, 1,245,178,227,168,190, 7,172, 38, 14, 12,142,189, 61,138, 87,179, 42,157, 48, 45,170, + 18,153,246, 4,212,101,137,161,250,224, 38,208,200, 44,116, 40,161,146, 16,245, 89,246,203,174,174,200,152, 3,145,235, 80, 94, + 43,135, 76, 25,132,126,218,240,234,136, 54,243, 17,195, 98, 41,230, 19,133,232, 83,153,198,137,203,248,112, 56,133,153,144, 55, +170,112, 71,185,172, 0,113,145, 73, 34,140,222,143,112,156,124, 60,220,117, 97,160, 27,100, 24,224,129,196,224,212,157,191,249, +183, 32,228,231,112,231,234, 55, 47,115, 73, 77,182,199,239,123,204,158,249, 48, 39,184,204,167,235,242,190, 44,230, 52,191, 97, + 82,140,139, 36,205, 44, 51, 56,158,217,202, 72,211, 78,237,137,206,202, 52, 97,237,141,243, 26, 54,147, 75,197, 73,131, 93, 48, +223,122,180,158,236,124, 65, 34, 50,221,223,145, 98, 50,135,220, 19,212,132,131,213, 25, 26,229,135, 27, 37, 49,191, 5, 96,236, +106,122, 18, 6,130,232, 78, 63, 86, 16, 84, 18,194, 13, 19, 61,251, 55,252,135,254, 62, 15,158,212, 4, 18,163, 64,139,237,236, +184, 51,187,179, 45, 20,212, 43, 73, 83,218,110,103, 95,223,188, 55,239,111,253, 12,156,194,227, 52, 32,109, 76,239,238, 15, 7, + 46,157, 67,241,255, 8, 23, 85, 37, 3,132,122, 33, 62,233,168,126, 14,244,135,188, 5,153,250,248, 34, 54, 35,200,224,132,113, + 34,237, 27, 66, 98,113,116, 81,238,111,156,117,136, 55, 99,186,157, 53, 13,181,213, 14,223,183,230,171, 53, 19,219, 44, 23,230, +102, 84, 60,191, 34,168, 59, 33,124,135,174, 62,223,252,161,215,224,100, 78, 7,227,194,157,228,123, 4,104, 52,150, 2,253, 29, +223, 80, 86, 57,123,100, 93,211,119,189,199, 89,110, 31,103,243,137,181, 59,135,171,106,143, 72,211, 18,166,182,240, 87,244, 89, +239,171,221,254, 67, 68, 56,173,122, 58, 26, 93,151,191,223,165, 52,122, 62,239,101,140,229, 61,177,141, 19, 74,164, 54,240,101, +220,200,192,181,252,220,106, 63, 43,216,137,173,148,233, 86,248,165,178, 55, 49, 38,113, 68, 78,207,130, 82,211, 11,197,242, 19, +173,239, 15,227,201,253, 98,244,244,178,222,104, 31,194,157,233,202,166,203,241, 39,173,203,203, 10, 57,107, 59,153,220, 99,120, +116, 36,115, 19, 16,151, 56,150,163,149,115, 12,225, 83,227, 81, 72,221, 84,185, 48,154, 39, 77, 55,123,146, 14,203,208,209, 40, + 90,232,106, 83,223, 58,117, 40, 39,210,143,196, 68,131,164, 7,133, 97, 8, 25,115, 55,153,235,249, 96,186,217, 27,130,226, 13, +191,164,148, 59, 8, 9, 78,188,120, 67, 8,147,246, 1,224, 55,117,135,170,218,197, 91, 10,154, 79,209, 41, 18, 76,151, 15, 19, +121,112,103,160,111, 43, 74,127,120,224,158,115,148,182,144,208,237,236, 88,164, 40,193,212,108, 12,119, 16, 54,126, 10,179, 83, +196,233, 81,139,119,224, 63, 10,100, 69,106,168, 26,164, 68,244,244,138, 59,198, 98, 23,143,106, 59, 5, 81,218,248,206,174, 52, + 51,120,116, 48,144,125,211,223,197,157,196,187,196, 93, 20, 41,238,156,220, 92,176,166,221,102, 44,181,160,219,171,229,114,122, +119, 1,217,166,245,152,175,174, 37,144,214,215,217, 34, 47,109, 89,230, 77,189,165,202, 49,163, 43,115, 44, 41,216,102,226,102, +134,142, 23,106,206, 29, 24,177, 75, 8, 26, 68,181, 39,251, 82,190,128,249,154,214,173,193, 82,242,214,130,129,161, 52, 23,227, +204,151,145, 13,240,176, 29,198, 96,168, 17, 37,202,225,240,105,126, 4,224,236,218, 90, 19,134,193,104,191, 68, 91, 87,111, 76, + 28,219,195, 6, 67,100, 47,123,217, 47,222,159, 27,140, 33,162, 67,172, 38,109,147, 44,183, 47, 77,171, 27,101, 62,137,136, 90, +218,126, 57,158,156,203, 95,248,189, 55,114,239, 37,144,135, 30, 68,124,219, 56,208, 42, 62, 5,175,130,111,120, 33,188,193, 66, +201, 1,222, 70, 36,188,238,213, 86,170, 21,211,143,139,131, 53, 17,232,145,145,103,245,253,188,158,164, 85,201,132,158, 76, 38, + 8, 69, 36,135, 90,158, 74,201,120,242,176,164,162,162, 71,238, 92,220,126,248,152,192, 10,170,110, 18,206,171,132,153,152, 37, +227, 23,173, 13,243,160, 68,196, 86,211, 72,206,145,217,171,228,168,228,134,177,207,130, 77, 6,131,215,187,233,122, 57, 91, 76, +244,136, 75,118, 5,255, 62,241,189,172, 11,219,174, 84, 90, 18, 35,100, 3,244, 52, 25,209,200,226,148, 68,241, 53,161,154, 32, + 69,247,157,192, 57,110, 33,128,178,102, 87,243,165,142,250,143,209,186,196, 39, 20,193,123, 0,224, 25, 70, 14,140,237,134,234, +227,112,244,246, 52,127,255,216,126, 73,195,197,195, 47,150,147,206, 99, 5,112, 30,222,250,222, 67, 2, 62, 89,197,170,249, 76, +158,149, 89,183,133, 77, 23, 10, 49,127,238,147,155,128,162, 78,221, 29,142, 24,137,139,186,231, 22,236,137, 23,161,225,175, 51, +220,155, 30,176,136, 1, 80, 73,191,110, 5,213,160,123,104,115,161,202,169,187, 32,218, 60,242,100,160,185,190,125, 13, 54,113, +246, 59, 92, 85, 0, 21,159,132, 92, 45,219,133,208, 34,107,108, 49, 65,137,216, 56, 63,227,146, 89,212,245,122,243, 40,180, 24, + 90,117, 69, 7,164, 92,206, 65,132,151, 33,136,230, 99,122, 68,181, 23,153,142,120,195,211,235,214,164,106,119,103, 91,145,201, + 42,148,226, 42,217,192,115,240,150,226, 14,114, 7,225,250,182, 46,152, 7, 21,109, 39,254,195,130,119, 89,157, 65, 46, 70, 16, +254, 41, 52, 34,119, 98, 39,146, 30,235, 84,195,118, 66,135, 68,195,246,116, 96,206,145, 90,207, 95, 86,179,103,125,180,251,211, +110,115,220,108, 79,219, 3, 63,156,203,130,137, 51,175, 25, 19, 37, 1, 50,162,153,254,249,103, 89,219,136, 80,220, 37,246,123, + 12,166,164, 83,248,254, 26, 23,213, 38, 43, 13,226,177, 91,134, 18, 50, 74,242,202, 42, 33,244,184,207, 97, 60, 25, 76, 23,233, + 44, 39,185,126, 63, 87, 37, 86,230, 53,174, 23, 68, 19,240, 35, 0,107, 87,211,147, 48, 16, 68,119, 91,218,130, 61, 20, 37,145, +131, 7,111,198,187,255, 63,222,253, 23, 30,136, 74,130, 33, 32,165,116,191,220,217,153,217,126, 96,130, 49,222, 56,208,210,108, +151,217, 55,111,230,189,249, 11,255, 62, 66,241,201, 79, 93, 55,142,135,240,157,143,178,252, 13, 17, 79, 70, 5, 29, 63, 72,179, + 25, 13, 77,179,116,174, 87,163,145,228,176,148,160, 94, 48, 49, 44, 31, 33,246, 18, 71, 63, 89,152,166,157, 56, 36,197,176,205, +110, 62,115, 11, 88, 34,219, 52, 64, 64,163, 92,210,159,188,173, 17,181, 10,113, 77,234,213,103,123,191,204,223,182, 54,205, 40, + 92, 6, 95, 8,127,151,246,160,196, 17, 84, 75,176,247, 27,212,126, 51,232,206,123,232, 27,151,248, 16, 72,240, 76,152,173, 72, + 27,113,122,223,169,151,221,118, 14,234, 86,127, 45,162, 79,120,168, 22,149,239,161, 92, 89, 15,215,249,162,129,176,101,218, 4, +103,183, 70,169, 84,204, 76, 21,181, 82,193,195, 28,131, 5,141, 14, 76, 81, 27,122, 58, 3,198,135,223,181, 28,250,243,158,169, +175,102,162,102,198,121,159, 99, 20,239, 19,130,165,152, 60,221, 85,207,155,221,171,118, 57,111, 9,125,201,120,210, 95, 91, 78, +203,189,241, 59,152,168, 91, 19, 14,113,127,228,236,213,166,214,199, 69, 81, 26, 48,229,100, 61,235,112,194,242,168,177,135,219, +101,153,186,197,186,160, 36, 3,174,144, 5, 75, 55,238,188, 22,209,144,128, 73,110, 59, 64,183, 54, 6, 74, 55, 82,184,216, 97, + 80, 72,144,134,163, 94, 34,215,131,243,154,114,107, 65,220, 73, 16,133,130,209,128,164,156,144, 28,165,164,100,204,130,147,227, +180,197, 28, 20,253,251, 3,222,179, 72,135, 15,138, 11,168,250,140,220, 8,243, 73,154,104, 27,150,242,187,177, 42,110,244,135, +197, 52,128,205,251,108,231,145,207, 22,102, 93,147, 2, 81, 69, 35, 6, 92,246,202,170,142, 49, 59, 2,118,217, 71,235,194,210, +162,118, 64,173,155,137,206,162,229, 46,184,155,115,235,149, 8,219,237,127,216, 86,199,165,136, 62,219,241, 45, 59, 72,202,147, +208,252, 36,153,150, 65,216, 14,241, 61,129,201, 10,233,195,252,241,118,122,163,204,105,181,251, 88,215,235, 47, 85, 59, 48,144, +113,153,204, 11, 7,102, 36,147,196, 40,211,250,239, 23,233,236,106,146,251,207, 32,189,231,214, 32,156, 43, 22,146, 77, 77, 62, +162, 80, 39,130,208,175,129,167, 64, 95, 8,155,138,244, 70, 86,141, 80,153, 44,202,162,186, 46,170,114, 50, 5,185, 89,237, 99, + 87,163,133, 10, 77,218,184, 38, 22,107, 59,248,178,190, 5, 32,237,124,118,218,136,129, 48,238,177,247, 95, 2, 8,165,162, 82, +197,149, 3, 18,188,255, 75,240, 12, 28,122, 42,130, 86,164,136,134,172,179,182,167, 59, 99,143,215,187,145, 40,168,183, 28,162, +172, 98,123, 63,143,190,153,249, 77,245,255, 75,227,139, 10, 57,117, 84, 75,135, 5,157,231, 51, 18,143, 71,183,139,196, 31,172, +242,124,228,244,116,178,196,156, 76,252, 88,166, 64,145, 95, 70,182, 78,216,186,253,183, 86,157,152,118,107, 73, 73, 28, 64, 99, +198, 91,151,218, 38,159, 95,169, 51,184, 98,155,236,153, 24,239, 4,122, 31, 55,147,136,228, 72,144, 14,111,221,197,169,190,252, +226, 31,127,171,218, 36, 36,206,224,253,121,235,126,236,199,104, 23,214,172,149,192,181,237,185, 70,176, 23,131, 34, 94, 9, 54, + 57,227,200, 44,120, 66,123, 56, 6, 45,108,233,243, 40,247,174,229, 74,146, 8,180,219, 75, 40,157, 27, 14,240, 51, 27, 17,138, + 2,112, 45, 2,189, 42, 24,238, 43,222,145, 3, 61,136,178,193,109, 58,205, 60, 91,129,133,126,199,223, 15,194,191,140,130,215, +138,191, 31, 85, 59, 74,127, 44,152,217, 40,115,117,177,178, 29,222,125,127,227,116,238,108,110,201, 59,111,224,181, 81, 86,159, + 4, 30,191, 41,110, 49,137,251, 75,255,112,111,233,223,212,135, 93,179, 94,107,168,230,110,195,162,125, 17,167,220, 40,138, 17, +156,174,240,130,189, 37,179,238, 74,101, 71,105, 18,138, 19,124,203, 94,214,252,163,184,172,140, 94, 68,145,147,100,234, 40, 10, +177,138,196,200,248,189,132, 81, 18,236,140, 74, 38, 43,221,196, 24,185,191,156,217,132,169, 41, 94,103,252, 48,202,153, 72,187, + 0,133,197, 63,203, 85,150,132, 53,126,126, 40,149,125,238,142, 46,135, 72,132,196,207, 21, 25,103, 79, 44,194,199,142,152, 86, +176,180,254,167,196,169, 0,160,130,122, 71,217,203,197,204,202,158, 71,251,228,105,185,152,138, 35, 61,228, 70, 86, 81,246, 49, +118,134,192, 5, 61,255, 50, 88,104,106,166,233,122,223,127,208,118,135,121,225, 0,191,125, 58, 15,137,164,222, 84, 77, 5, 51, + 21,212,181,174, 43,234, 67,130,155,205,237,166, 57, 63, 4,255,243,245,215,211,238,225,101,248, 51, 40,155,188,100,132, 6, 90, +136,221, 50,136,189, 59, 88, 82,249,182, 1,179, 87,113, 36, 40,239,133, 80,131, 18, 20,157,131,244, 52, 70, 20, 18,216, 57,160, +115,188, 20, 29,212,167,205,217,166,251,218, 85, 93,109,180, 29,252,224, 28,167, 91, 61, 46, 19, 18, 9,211,245, 87, 0,202,174, +166, 39, 97, 32,136,206,210,165,160, 73,193, 30, 48, 38,158,140,241,224,197,255,255, 27,252, 31, 28, 52,134, 64,173,116, 91,219, + 29,119,118,246,171, 88, 52,112, 5, 2,253,122, 59,251,230,205,123,242, 34, 40, 23,231,165, 48, 41,208,195,120,226, 38,213,216, +252,141,235, 24, 57, 25, 42,138,229,105,224, 49, 70,103, 38,231,241, 27,121,216,152,109,228, 43, 11, 11,244,160, 6,146,172,108, + 91,120, 41,136,251, 50,167,175,148,120,187,208,135,170, 63, 14, 86,121,132,176,144,132,107,141, 53,141,157, 83,231,130, 54, 81, +157,237, 82,215, 29,124,117,250,249,126,179,221,189,201,140,127,215,212,236,122,248,214, 53, 69, 78,186,113,198, 54, 25,247,101, +173,136,178,152,152,121,102, 3,157, 46,144, 38,122, 66, 66,166, 34,138, 99,200, 99,145, 75, 88,192, 78,191,253,229,169,120, 39, +137, 78,114,204,219, 4, 22,114,224,236, 36,136,209,128, 57, 75, 36, 1,175,124,217,210, 39, 87,170, 73, 98,161,174,237, 31, 11, +105,177,102,183, 81, 80,226,160,188,219, 20,175, 85, 85,206,108,248,173, 93, 33, 82,213,230,164,132,191, 4, 88, 47,203, 29,153, +137,105,215,184,177,143,126,219,238, 25,220,159, 76,117, 47,103,173,200, 48,217, 80,139,169,227,117, 30,170,214,232, 59,178,237, +174,109, 30,216,134,209,180,100, 96,196,217, 75, 50,216, 28, 96,122, 39,106, 16, 16,189,141,254,101, 47,217, 15,100,230,253,130, + 25,184,194, 30, 31,209,229,150, 56, 91, 48,193,139,141,141,165,177,131, 30,193,193,204,177,212,158,140,196, 95, 51,151, 56, 45, +233, 9,203, 0, 19, 77, 39,200, 46, 78,125,186,252,121,115, 69,178, 47, 39, 33,237, 79,196,209,131,137,131, 14,171,163, 14,176, + 14, 3,136, 68,240,158, 52, 48,112, 84,119,163, 72,144,221, 79,187, 96, 88, 78,124,179, 23, 82,103, 24,239,135, 57,224, 68, 60, +222,244,171,195,246, 92, 43,241,156,114, 47, 97,231,221, 94,240,102,185,106, 84, 99,213, 50,210,148,201, 12,238, 6,238, 31, 86, +143,171,188, 48, 31,168,213,225,253,248, 81, 17,184, 43,142,158,102,248, 50, 95,153, 75, 90, 12,108,216, 51,201, 31,209, 60,115, +164,148, 22,100,252, 32,156, 71, 17, 75,242, 88,232,213,219,193, 8,158, 83,115, 94, 62,168,189, 75, 71, 95, 99,167, 84, 83,183, +251, 34, 95,155,210,179,211,205,177,255, 52,111, 45,196,178,193,198, 86,105, 25,248, 97, 98,190,241,126, 4, 32,237, 90,118, 26, +134,129,160,215,118, 30,164,105, 65, 66, 42,119, 56,243, 11,252,255, 23,240, 11, 8, 36, 68, 91, 82, 74, 72, 98,227, 93,123,157, +164,105, 42, 30,215, 28, 18,201, 73,102, 71, 59, 59,179,250, 63,204, 29,230, 81,166, 27,171,213,167, 32,126, 26,250,163,228,128, +131,120, 26,196,130,173,132,145, 45, 98,210, 58,228,124,103,222,212,211,211,140, 76, 36,151, 2,151, 2,189,124,224,105,185, 55, + 3,109,243,248,105,125, 11,162, 32, 0,218,182,189,132,152,117, 14,200,172, 82, 56,159,158,107, 40, 37,144,112,186,107, 73,243, +240, 41, 31, 90, 6, 51,153,135,230, 61, 79,190,119,140,134, 9,183,185, 25,186,240, 74,203,252,151,134,190,145, 50,103,252, 67, +120,103, 83,205, 19,135,177, 36,252, 33,254,197, 14, 92, 63,146, 39,211, 61,206,230, 65, 88,135,247,192,190,209,136, 75, 37, 7, +191,109, 29,242, 52,220,163,161, 22,166, 22, 80,209,145,230, 97, 99,120,104,202,251, 47, 40,163,167,172,112,111,184,188,186,208, +217, 10,246,219,175,155, 82, 86,181,171,136, 38,177, 67,231,209,105, 91,221,125,158,190,218, 28,129, 79,113,230, 18,150, 77,177, + 16,246, 65,193,117,154, 86,160,158,160, 36, 45,221,116,220,217, 62,242, 60, 91, 59,148, 7,143, 38,220, 57,140,165,231,236, 1, +146, 66,247,128, 57,241,168, 59, 28, 83, 98,186, 31, 89,118,207,160, 60, 47,105,138,211, 62,228,128,145,177,179, 24, 70, 37,185, +125, 24,125, 79,190,251,238,183,189, 70,199, 73,100,184, 2,102,131,137, 6,251,164, 66,192,140,153,170, 4,246, 44,184, 51,176, +194, 4,214, 97, 12,130,140,236,196,132, 8,225,135, 62,170,145,124, 26,243,255,160, 47, 63, 33,250,222, 48,178,155, 81,136, 97, + 76,155,177,199,185, 64, 51, 59,133,102, 71, 33,141,133,223, 59, 46,163, 14, 66,136, 36,106,220,227,134,154,106, 2, 58,149,218, +241,119, 37,213,221,242,118,189, 88,215,142, 63,139,246,249,240,182,109,118, 7,100,238,134, 89,136,223,211,165, 50, 93,100,216, +216, 53,208,202,198, 54, 13,174, 53,175,242,164,232,148,106,218, 38,198, 91,199,152,126,202,146,192, 0, 20, 74,193,179, 38, 68, + 49, 25,242, 65, 97,226,143,251, 49,247,246,176,169, 55, 84, 49,221,173,241,192, 11, 81, 46, 85, 90,117, 27,146, 45,149,151,145, +252, 49,126, 11, 64,218,181,237, 38, 12,195,208, 56, 73, 41, 21,104, 12, 94, 54,105,223,176,255,255,172, 49, 33,110, 37,151,217, + 78,156,166, 93, 25,210,120, 68, 2,169, 52,201,177, 99, 31,159, 99,159,193,244, 71,201,248, 40,145,159,205,226, 43, 45,127,128, +169,146,106, 58, 0, 89, 46,230,206, 73, 3, 93,245,184, 99,149,110, 24,209,139, 39,194, 53, 16,130,241,205, 7, 86,209,237,125, +220, 87,116,139, 48, 94, 88, 18, 99, 65,228,194,112,169, 49,185, 34,229,135,165,214,129,102,248,193,103, 95,103,229, 50, 31, 82, + 41,113,211, 78,127,234, 82, 25,165, 90,254,104, 68,106,198,200, 80,107,194,238,158, 55,247,130, 31,219, 72,205,157, 23, 3,152, + 59, 79, 63,233, 37,228,244,255, 25,201, 27, 45,196, 69, 2, 12,190,147, 83,102,184,147,246,107,209,236,241, 84,104, 82,220, 33, + 72,128,174,185,152,156,196,116,169, 70,223,137,104, 90,201,202, 49, 12, 44, 24,223, 55,107,187,124,105, 62,118, 75, 42,254, 5, +127,245,100,219,236,165,188,163,230,180, 76, 63, 13, 28,155, 45,126, 17,227, 40, 77,253,235,204,146,195,224,123,194,220,164,233, +246, 24,120,162,101,227,183, 16,170,140,117,150,249, 58,140,195, 36,185,201,154, 36,147,196,125, 11,129, 47,153,187,192,196, 33, + 53,170,113, 77, 70,234,207, 15,103,214,255, 66,249, 10,226,197,145, 3,146,250,105, 40, 42,146,204,160,193, 35,109,178,122,130, + 25,200,217, 17, 74, 76, 18,221,225, 73,249,104,166,105, 85,206, 66,248, 93,138,153,217, 33, 80, 38,176,138,213,223,168,132, 21, + 6,153,198,145,218,135, 42,200, 94,194,228, 24,217,243, 65,116,233, 58, 18,171,238,159,143,113,144, 28, 40,227, 75,194,252,164, +137,182, 73,193, 61,222, 1,247, 39,103, 86,227, 3,178, 71,204,234,177,228,197,226, 73, 53, 12,172, 81,141,213, 45,238,234,183, +238,253,181,221, 57, 31, 22,198,124,157, 15,253,237, 4,148, 30,209,235,114,131, 22, 58, 46,160, 49,218, 34,196, 51,153,210, 58, +119, 61,134,243, 5, 47,253,253,185,109,186,100, 42, 96,228,234,169,216, 15,163, 37, 55, 68,182,214,148,154,115,200, 45, 16, 98, + 83, 67,238,172, 36,236, 6,214,184,167, 60,208,197,219, 26, 86, 96, 55, 7,247,205,237, 64,195, 79, 78, 60,215, 31, 1, 72, 59, +163,221,132, 97, 24,138,198, 33,165,168, 48, 49,177,135, 73,227, 15,246,255, 63, 52, 33,237, 21, 77,172,170,182, 54,206, 98, 39, + 78, 66, 88, 81, 37,250, 78, 31,104,123,227, 56,215,231,154, 7,203,246,251,127,147,171,161,134,245, 48, 84, 81,137,212, 86, 73, + 45, 51, 29,247, 31,131,188, 4,214,149,254, 5,166,107, 66, 34,253, 21,232,109,191,123,191,204, 4,153,166,210,146,150, 4,166, +133,117, 20,220,167,140, 49, 31,231, 95, 45,237, 66, 50,159, 32,161,116,183,156,198,151,110,254, 35,138,172,164,109,157,114,177, +147,245,208, 22,254, 69,205,126, 27,195,226, 30, 38, 93, 93,156, 5,133,150,159,171,224, 13, 34,254,119,185, 79, 32,101,125,140, +197, 6,162,165,219,122, 57, 6,102,102, 2, 7, 42, 65,177,201,112, 61, 15,121, 53,217,108,163,222, 72,217,113,160, 89, 83, 23, +226,155,155,216,193,167, 79,177,101,205,234,253, 15,105,195,178, 62,236, 59, 28,145, 88,106, 14, 46,206,117, 86,125,221, 16,202, +194,245,174,213, 97,119,248, 68, 95, 7, 33, 77,143,233, 76,248, 10,200,242,193, 53,225,141, 79, 20,177,185,217, 46, 97,235,198, + 19, 88, 20, 11, 36, 22,101,123,196,167,112, 63,217,229, 88,102, 81,115,156, 59,169,206,243, 50,203,171,120, 93,245,181,149,116, +151,162,107, 38,151,240, 42, 17,198, 66,108, 17,172, 84, 41,241, 66, 24,190, 70, 42,166,147,221, 42,128, 16,174, 3, 28,113, 73, + 10, 4,125,140,147,138, 17, 6, 16,250, 88,245, 94, 39, 69,102, 99, 94,232, 32, 31, 75,255,163,236,217,118, 36,124,122, 87,236, +188, 43,113,207,221,246,100,192,191, 21,119, 53, 83,185, 63,120,105,208,199,231,227,233,124,154,145, 56, 29, 8, 51, 60,202,100, +168, 39,163,125,241, 78, 97,146,187,102,255,178,121, 29,208, 62, 25, 26,200,139,233,122,132, 16, 53,225,192, 32,207, 95,128,175, +246,125,113,216,180,198, 11,189,238,199,190,159, 6,139,211,160, 39, 74, 80, 39,172,236,100,115,194, 38, 72,251,140, 0, 40,104, + 87,156, 25, 23,222,100,162,169,134,147,105,203,203, 0,107, 35,123,119,152,212,194,176,139,113,173, 55, 91,227, 6,251,205, 81, +142, 43,246,167,224,159, 0,172,157,203, 78,195, 64, 12, 69,199, 51,233, 12,161, 45, 2, 36, 88,148, 5,255,255, 79,172, 17, 66, + 2, 54, 72, 45,201, 60,136,237,113, 50,121, 16, 64,208,117, 43, 37, 81,227,216,215,185,231, 86,255,117,189,214,241,100,106, 86, +226,127, 75,160, 76,107, 99, 25, 20,171,182, 9, 94,126, 54, 92,166,145, 93,126,254,241, 34, 88,111,145, 18, 3, 55,181,219, 59, +247,240,244,134,220, 69,102,130, 16,124,228, 37, 86,135, 42, 60,250,230, 93,244,168, 73,203,236,133,217,203, 45,252, 73,142,204, + 74, 76,157,146,184,212,102,168,200, 93,217,197,198,121,151, 17, 66, 88, 88,173, 84, 33,255,131, 23,225,117,161,191,179,179,116, + 75,231, 79,240, 0, 76, 27,176,153, 45,133,163, 3,141, 8,233, 28,125,207, 92, 99,116, 31, 95, 16,137,155,182,137,225,168, 76, +171,226,165,172,227, 61,157, 8,228,152,103, 44,204, 72,190,246,200, 8,187,187,174,155,166, 69, 66,217, 71,120, 61, 33, 94, 6, +100,215, 90, 30,243,189, 82,183,245,197,115,218, 86,148, 91, 93, 56, 72,123, 35,211, 80,207,139,200,158, 40,178,134, 46, 85, 2, +200, 78,155,144,223,251,101,123, 68,118,172, 73,213,136, 98, 17,146, 36,163,193, 21,243, 53,189, 4,138,254, 3,166,171, 98,189, +178, 64, 42,141, 80,217,246,156,114, 2, 77,202,190,166, 62, 19,158, 99, 86,201,173, 13, 18, 22, 26, 56, 79, 82, 21,164,209,111, +111,138,181,175,193,114,243, 62, 86,102,162,228,110,143, 87, 20,105,144, 95,102, 79,213,201,236, 51, 41,238, 57,200, 35,183,119, +113,220,185,195,120,149, 58,214,100, 22,100,153, 69,214,222,159,232,181, 20, 83,178, 88,220, 85, 30,106, 53, 75,216,248, 23, 69, +208,169, 54, 96,141,238,238, 9,123,229, 14,206,184,238,250, 88, 48,109,244,148,110, 2,198, 84, 14,145, 50,109, 36, 40, 62,244, + 79, 63,252, 57,190,187,224,204,217, 6, 77, 52,221,232,239, 73,165, 81,123,187,231, 29, 43,228, 86,176,247,235, 38, 78,155, 64, +109, 8,157, 79,145,154, 36,206,198, 10,188,109,166,198,159, 23,224,217, 68, 24, 80,218,105,187, 35,172,205,238,232,143,134, 65, +119, 10, 62, 5, 32,237,202,118, 26,134,129,160,119,215,185,168, 10,170, 4,136, 7,254,255,223,224,161, 82, 57,218,230,176, 77, +118,125,196,129,164, 21, 80,245,161,170, 90,229, 33,246,120,178, 59, 59,163,255, 6,229, 87,203, 50,176,254,229, 82,222, 21, 92, +232,117,168,235, 70,113, 46, 83,180,169, 41, 26, 36,213,162,179, 9,116,209,251, 95, 49,219,105,163,214,187, 68,188,223, 84,221, + 64, 47,239, 93, 83, 20, 54,200,200,248, 2,123, 59,222,112,189, 53,246,232, 6, 15,100,231, 31,154,179,212,165, 52,177, 82, 79, +209, 23, 62,205,184,150, 66,222,165,236,206,124, 65,132,149, 88,243,213, 71, 48, 29, 90,149,108, 41,175,179,200, 4,235,149,188, +183, 82,112,167, 80, 8,194,147,207, 34,136,113, 34, 55,156,195, 11, 5,207, 92,224,136,206,189,116,255,206, 98, 80,219,104,110, + 53,107,133,141,166,118, 48,181, 5,161, 18,188,220, 62,216,110,193,139,103,200,200, 51,199,184,102,123,231, 14,159,253,237, 67, +185,219,148,175,251,142,200, 52,196, 77,109,157, 69, 9,250,215,163, 82,207,205,246, 80,220, 1, 27, 77, 64, 46,167,202,166, 49, + 81,185,153,244, 60,170, 41,102,149,252,144, 42, 17, 85, 22,236,185, 34, 49, 56, 46, 24,174, 4,212, 48,241,175, 33,163,206,126, + 83,218, 93,138,140,143,200,158, 44,105, 96,145, 94,192,236, 83,116, 28,136, 39,101, 72,102,176, 19,133, 7,165, 93, 52,209,137, + 17,113, 40, 70, 0, 58,228,202, 58,229, 69,210,128,153,207,134, 93, 67,110,192, 53,190,179, 22,221,201,179, 98, 19,184,131,200, + 49,221,100,157,157, 12, 29,229,119, 11, 32,254,235,132,210,196,228,188, 46,208, 78, 92,204,143, 47, 25,200, 12,208,220,124, 83, + 47, 62, 63,105,164,206,254, 43, 88, 12, 86,118,144,139,183, 79, 11,199, 71, 46,187,115, 67,181,224,128, 14,216, 53, 79, 4, 52, + 66,105, 61, 18,122,166,217,222,210,138,106,172, 10, 85, 27,180,106,120, 59,171, 78,216,143,245, 65,222, 98, 52,203,141, 46,159, + 71,110,132,131,159, 92, 91, 13, 37,209,120, 66,244, 98, 44,227,226, 30,231, 19, 3,188, 45, 29,167,103,105,177, 64,247, 3,112, + 8, 89,255,197,134, 69, 97, 83,178, 5,147, 69,107, 10, 44, 29, 65,111,142,222,213,252, 75, 0,210,174,100,167, 97, 24,136,198, + 75,210,146,166,149,232, 1,113,227,208,255,255, 3, 62,133, 43, 61, 0,165, 72, 45,212, 89,108, 51,139, 29,167,233,130,128, 30, +163,202,138,156,241,120,150,247,222,252, 49,126,255,177, 31,125,150,251,154,165, 90,205,165, 50, 79,178,192, 94, 81,193, 95,243, +236,163,197,253,177, 23, 72,136,205,254, 12,236,224, 35,209, 14,237, 47,191,188,102, 17, 68,173,238,170,233,234,190,122,124,250, + 80,140,137,240,169, 51, 13,171,189, 58,249,144,171,182,177,155, 56,234,232,236, 14,240, 23,168, 99, 61,154,101,200, 24, 98,200, + 12, 38,106,168, 34, 86, 78, 83, 40, 61,203,228,162,192, 76,208,161, 32,116,187,167,151, 57, 92,213,146, 28, 30, 39,166,146, 46, + 50,177, 64, 23,162,140, 71,153, 70,118,244, 96, 73, 75, 37, 80,197, 78,170, 57,181, 19, 26, 9,183, 11, 42, 98, 64,166, 50, 83, +200,144, 6, 83, 42,149,216,210, 44,201, 66,120, 91,203,218,116, 93, 4, 65,128,219,135,139,129, 68,117, 48,246,199, 36, 64,138, +174,115,111,219, 67, 81,169, 50,215, 20,236, 96,125,228, 51,178,168,248, 7,105,196, 10,146,161,106,185, 21,115, 48, 70,141, 98, +187, 26,171, 51, 24, 33, 18, 23,210,219,132,147, 9, 0,139, 48, 68,137,155,171, 99,165,199, 16,239,147, 39,178, 97,216,222,144, + 53, 31,156,123, 84, 58,232,169, 52, 67,180,184,240, 71,171, 6,240,119,150, 20,166,253, 0, 37, 32, 46,119,179, 71, 96, 69,194, +199, 48,115, 73, 72,150,140, 38,225, 48, 22,195,115,252,116,208,123,226, 16,222, 67,160,128,234, 4,178, 79, 3,236,149, 33, 0, +116,103,224, 95,101, 63,175, 56,153,129, 63, 62, 55,163,146,168, 11, 1, 78,228, 24,185, 88,153,137, 3, 79,162,160,163, 59,169, +189,252,182, 9,228,211, 88,196, 32,253,235,250,154,251,128,155,122, 10,196, 28,245,129, 79,146,236,255, 57,119, 8,192, 91, 91, +159,203, 9,152,147, 16,132,245, 8,243,142,156, 38,226,169,234, 82,221, 78,117,233,232,222,157, 32,111, 29,191, 51,184,254, 50, +207, 77, 86, 64, 76,190,144,179,169,190, 89,155,117,155, 25,216,227,198,181, 93,230, 38, 96,231,222, 63,127,189,108,204,251,206, + 30, 8, 64, 9,174,192, 54,206,192,129,179,136,157,234,224, 60,146, 94,168,160,201, 88,190,215,255, 96,137,164, 34,203, 33, 87, +110,113,138, 4,248, 7, 62, 14, 65, 76, 85, 32, 1,218, 17, 13,154,181, 40, 17, 95, 84,168,137,146,162,182,166,144,197,183, 0, +164, 93,201,110,194, 48, 16,181,157, 56, 11,164, 44, 7,212, 83, 15, 21,255,255, 61,189,245, 70,171, 74, 85, 11,180,108,137,237, +169,103,236, 24, 39, 44,221, 34, 78, 28,144, 49,120, 60,203, 91,254,213,159,249, 9,136,253,108,136,143, 36, 68,194,175,219,201, +165, 84, 95,226,185, 95, 6,154, 51,146,150, 60,138,242,188,215,252,215,109,122,251,193,196, 29,238, 29,254, 63,234, 86, 9,160, +247,144,148, 35,155,230,114, 62,171, 22, 43,243,240,188,205,165,208, 78, 80,175, 61, 10, 28,227, 38, 60,154,244, 94, 2,111,154, + 39, 47,209,121,177,173, 20, 52,182, 76,155,197, 55, 45, 78,156, 48,145,136,210, 73, 49,110,138, 42,193, 97,253,160, 16, 6,212, +170, 86,123, 6,191, 50,214,184,161,215, 56,229,163, 76,106, 16,133, 6, 68, 67,130, 88,145,101,111, 37,145,178,155, 39, 80,147, +202,216, 36, 69, 85,124, 41,108,146,130,174, 98, 20,107,248, 78,216,210, 4, 9, 29,101, 2, 54, 25, 31,164,124, 93, 39,107,165, + 55, 6,193, 45,193,109, 50, 37,233,118,187,129, 27, 13,139,183,195,176, 74,106, 80, 25, 78,102,177,246,119,151, 89, 73, 8,165, + 91,187,164, 98, 4,249,248, 29,131, 63,147,156, 20,219,221, 0, 92,128, 48,194,116, 36, 27, 13,139, 12,180,180,167,102,158,206, + 57, 77,160,107,182,122,238, 16,156, 84,161,109,184,183,144,191, 0,163, 14,200,188, 99, 25, 16, 56,198, 97, 62, 31,129, 40, 60, +163,149, 93, 21, 54,137,243, 63,136, 4, 21, 81,123,142,132,142,192, 27,207,193,105,139,134, 59,175, 7,106,248, 58, 55, 12,238, + 93, 12,224,106,250,137, 95, 66,211,125,228,134,211,166, 11, 93, 12,161,188,127, 9,241, 56, 77,238,200,241, 66,192, 32, 66,111, + 54, 11,236, 79,249,251, 9,182,135, 71, 77, 24,195,142, 76, 75,118, 74, 95, 98,151,147,247,243,243,186,239, 30,170, 56,253, 1, + 61,232,195,229,140,222, 39,239,232,215,225,216,170,200,105,194, 55,166,197, 12,251, 32,160,116,202,247, 92,203,212, 99,132,208, +214, 3,235,109,228, 25, 77,178, 81,153,204,215,205,114,167,118, 67, 89, 86, 73,150,163,244,200,242,245,243,101,171, 17, 29,239, + 90, 0,200,124,132,166,208,216,178,215,154,116, 51,209, 70, 8,251, 49, 50,132, 44,176, 69,179,118,251, 66,139,207, 9,249,225, +219,241, 52,174,161,117,122,118, 57, 78,228,237,233, 82,246,195,149,202,101, 38, 16,228, 7, 95, 2,176,118, 45,189,109,195, 48, +216,164, 44, 57, 93,147,181,197,150,174,235,101,247,237,255, 3,251, 35, 59,238,222, 94,138,162,113, 27, 63,100,113, 36, 37, 37, +118,237, 5, 25,176, 99, 14,137, 19, 68,162, 62,145,223,227, 63,232,155,254, 9,200,207,189,227,199,212,168,104,185, 68, 89, 79, +184,152, 26, 62, 55,138,123, 39,164,154,136,161, 70, 97, 11,135,123,223, 67, 1,119,224,126, 20,180, 35,207,208,187, 30, 77, 62, +163,222,231, 83, 81,220,187,234,251,221, 13, 88,247,243,151,210,222, 53, 23, 83,231,214,152,249, 97,242,177,252,198,223,193,126, + 43,139, 91,223, 51,158,125, 62, 99,178, 63,140,236, 98,202, 35,165,146,244,196,166,216,178,191, 50,184,253, 80, 53, 93,239, 51, +198, 63,135,130,109,114,191,155, 95,109, 42,119,187,182, 72,124,115,132,190,163,167,150,214,202, 21,107, 1,214,142,174, 45,215, + 98, 9,217,224,101,197,203,116, 99,101, 77, 59,131, 87, 85,121,105, 85,162,135, 12, 58, 24, 2,136,152,228,113,215,212,111, 77, +221,250,167,206,119,131, 44,160, 21,224, 78, 72, 68, 7,158,176,132,212,214, 47,158, 1,139,237,195,199,128, 91, 3, 27, 79, 43, + 3,219,149,105,204,102,103, 46,247,162,230,209, 72, 4,221,230, 16,195, 27,148, 48, 67,152, 82,228,178,234, 30,134, 99, 11,151, +178,224,126,161,207,144, 61,181, 82,219,157,142, 22, 92,177,121,147,169,103, 83,123,147, 88,104,194,180,110,192,216,182,107,178, +122, 23,186, 4,248, 87,170, 82, 24,149, 30,204,169, 52,194, 18,138,145, 99,135, 28,120, 41,223, 90,229,149, 3, 7,234,152, 65, + 33, 69, 70, 68, 43, 46,127,234,191,198, 68,158, 76, 54,238, 4, 56,253, 18, 4, 35,225,211,108,116,156,111,200, 33, 7,251, 29, +233, 70,179,226, 78, 52,219,189,112,106,214, 54,105,160, 77, 15,148,124,220, 80, 78,217, 78,164,166,201, 6,127, 23,124,186, 8, +222, 29, 90, 9, 60, 90, 14,103, 57,177,239,134,115, 32,105,134, 22, 12,168, 25, 84, 11, 39,210, 72, 30,106,241,249,226, 94,210, +103, 66, 7, 88,118,193,187,194,184, 32,246,145, 37, 67, 32, 99, 80, 99, 10,154,190,105,125,139,232,110,170,235,175, 23, 95,248, +247, 61,191, 62,188,245,175,123,241,159,169,189, 48,248,124,212,204,105,102,242,208, 82, 39, 79, 74,204, 65, 8, 3,106,144,155, + 52,118,108,116, 53, 74,179,165,116,255, 41,139, 82,225,160, 6,126,164, 38, 71,105,244,158,145, 44,222,178, 5, 23, 31, 26,124, + 50,181,180,255, 35, 0,107, 87,211,211, 70, 12, 68,109,143,157,221, 77,182, 37, 2,122, 40, 18,234,137, 35,255,188,255,165,231, + 30, 42, 36,144,232, 1, 33, 2, 37,108,146,181,103,234,177,189,142, 55, 9,208, 74, 28, 19, 69,201,106,179,126, 30,207,188,143, +143,153,175,254, 87, 33,159, 69, 73,178,244, 30, 72, 60, 7, 39,118,173, 75,104, 39, 16,253,160,251, 13,141,133, 84,121,120,139, +217, 92,111,160,214,132, 59, 75,215, 68, 83,169, 46, 76,125, 78,202,255, 91, 11,244,101,178,199, 89, 55, 99,239, 45,253,165,109, + 46,191,205,175,186,254,251,143,223, 30,235, 0,120,102,231, 80,197, 88,192,226,169,103,171, 27,255,109,191, 80,159,130,248,234, +184,219,188, 22, 41,238,227, 93, 56,118, 35, 77, 10,183, 59, 2, 99,132,150, 14, 62, 89,215, 26, 61,111, 42,213,117, 52, 16,105, +252,103,142,133, 56,231,154, 66,118,188,215,136,123,129, 55,130, 94, 18,235, 38,221, 85,110, 4, 1,156,181,250,116, 62, 53,192, + 42,230,135,165, 71, 86,235,143,108, 53,139,182,136,243,101,128, 93, 28, 12,147,128,148,135,117,163,213, 73, 51,105, 39,242,100, +198,166,214, 28, 8,169, 77, 83,105, 83, 25, 3,240,184,232, 30,255,172,174,238,159,231,203,238,161, 91,175, 28,105, 14,253,225, + 21,102,128,102, 19, 56,251, 12, 71,205,164, 2, 57,173,153, 28,252,210,214, 63,159,228,202,169, 59, 91,221,218, 64,238,244, 63, + 26,141, 7, 34, 35, 55, 74,121,252, 25,213,202, 28,163,132, 5, 67, 49,202,129,182,189,149, 49, 93, 4,139,113, 12,102,251,194, + 33,137, 34, 37,186,225, 48,204,195, 92, 16,148,228, 13,202,192,113, 64, 45, 52,138, 25, 56,208,161,112, 98, 84,164,148, 38, 28, +133,117, 1,166, 62, 11,165,104,119, 23,141,196, 98, 9,207,228, 91, 61,240, 38, 73,108, 51,251,104, 24, 25,237,111, 34,170,160, +117, 71,195, 30, 61,136,131,200,201,119, 41, 9, 5, 62, 51,178,231,144,235,156, 69,187, 3,238,180,189, 71, 99,163,244,212, 64, +122, 99,221,203,212, 24,150,219,101, 43, 15,209,118,113,239,242,168,104,161, 52,107,215,225,184, 96,143, 47, 35,184,239, 79,194, +255,241,112, 65,175,110, 77,241,132,225,107,117, 25,138,119,201,107,129,159, 87, 81, 67,219,232,214,185,141,197, 80,114, 3, 6, +193, 40,107, 35,253, 38,160,173,175,135, 60,196,171, 94,216,158,252,213,173,158,251, 5, 50,150,225,134, 77,125, 25,214,122,182, +243, 77,185,100,113, 46, 26,222,180,108, 6, 73,220,218,135,240, 60, 80,202, 10, 8,129, 42,161, 59,100,132,222, 4, 5,115,216, +251, 85,232,178,154,124,126, 21, 73, 36, 20,164,156, 28, 10,152, 74,198,232, 79, 89,169,250,175, 0,172,157,219, 78,219, 64, 16, +134,103, 15, 94,219, 52, 73,137, 43, 21, 33,138,122,150,120, 2,158,154,123, 30,130,187,222, 87,170,138, 90, 53, 64,192, 10, 34, +177,227,205, 78, 61,123,112,214, 38, 8, 42,245, 5, 34, 89, 25,205,206,254,243,239,247,255, 55,255,204, 63,157, 1, 38,106,199, + 24, 5,241, 60, 58,183,119,223,218,118, 22, 30,235,157,255,110,255,176,149,246,152,155,167,130,249, 73, 16,208,113,243,141, 94, +182,242,207,121,242, 86,164,133, 20,169, 16, 74, 50,158, 36, 37,232,179, 31,183,243,229, 90,145,175, 9, 60,150,218, 90, 46, 67, +252, 31,110, 85, 34, 34, 56,179, 63,192,199, 44,253,130,122, 6,122, 25,194,143, 86,207, 21,153,137, 4, 83,238, 77, 23,102, 14, +117,190, 54,229, 98, 53,205,149,219, 6, 79, 9, 35, 44, 78,167,197,201,241,254,197,236,250,124, 86,206,109,199,159, 0,124, 4, + 94,128,252, 14,205,189, 63,225,161, 29, 27,222, 43, 57,121,149,190, 59, 24,231,237,236, 81,233, 34,211,235, 58,105,136,112, 97, + 26,205,171,118, 84,231, 52, 61,230,100,234,133,145,148, 74,242, 81, 42,179,148,191,206, 84,150,171,198,208,251,186,203,219,234, +234,231,245,229,205,162, 92,214,111, 70,234,248,160,248,122,116,120,117,183, 92,213, 77, 91,206,169,108, 43, 27, 71, 9,222,213, +184, 64,174, 81,252,190,215,191, 30,176,164,122, 38, 54, 18, 5, 49,109, 8,163, 72, 34, 52, 8, 75,217, 98, 1, 41, 36,156,227, +174,251,118, 12,178,187, 23, 80,186,190,208,209,129,123, 9, 22,222,177, 23, 68,100,135, 31,128,167,134,119, 22,140,240,176,117, +107,128,137,154,201,176,189,227,179,230,232,184, 89,246,166,126,139, 32,102, 17,117,167, 99,206, 68, 84, 94,230,152, 91, 70,160, +227,194,115, 31,223,206, 88, 39,163, 99, 79, 83, 97,241, 5,195,129,199,236, 71,106, 10,134,115, 34,124,127,223,179,123,246,117, +224, 1,216,198,230,133,230,142,195,230,238, 18, 80,205,240, 39,120,144,204,125, 94,220, 46, 9, 22,159, 92,177,178,254,195,165, +225,240, 62, 56,102, 43,219,220, 95, 34,212,116,221, 63, 23,217,195,166,122,185,117, 27, 30, 37,213, 48, 15,104,116, 24,114,158, +216,191, 36, 21,147, 15,227, 79, 43,122,142, 68,130, 91, 99,176,214,213,158, 80,116,207,117, 88, 77, 27,135, 77,126, 1, 67, 11, +113, 67,123, 84,138, 91,178, 31,171,181,245, 56,134,248, 78,207,171,176, 6, 24,180,119, 96,107, 82,109, 47,173, 20, 36,192,156, + 3, 64,218,242,177,153, 30,104, 34, 10,158, 14,107,121,151,205,227, 32,164,238,181, 57,233,242,180,136, 73, 4, 35,102, 14,237, +125,137, 50,201,254, 10, 64,219,181,228,182, 13, 3, 81,146,162, 44, 25,141,154,192, 49, 96,160,117, 80,100,211, 77,209, 11,100, +159, 11,228,124,189, 68,183,201, 9,178,202,186, 64,145,116, 81,160,249,194,113, 16,219,144, 66, 13, 51,156, 33,101,210,118, 62, +155,122,229,133,252,163,169,225,188,153, 55,239,233,255, 17,190,223,188,102,165, 74, 99,187, 41,231,100,245, 55,163, 54,251, 2, + 89, 74, 36,234,149, 93, 34,111, 83,170,219,178, 19,155, 57,186,146,193,141,124,177,104,126,243, 97,192, 46,108,248, 71, 1,100, +153,198, 44,152,140, 15,124,173, 51,220,248, 70,121,232,100,163,206,155,251,130, 83, 1,143, 82,239, 57, 95, 22,243,151,122, 29, + 58,140,179,138,245,217,240, 77, 41, 97, 67,145,239,158, 70,154,228,189, 24,183, 98, 92,148,179,122, 81, 8, 59, 84,101,157,137, +227, 63, 87,167, 15, 15,119,225,226, 91,186,248,176,200,143,202,234,100, 58,153, 11, 40,132,220,145,121, 94,246,246, 63,239, 30, +124, 29, 77,110, 22, 83, 81,215, 77,173, 74,208, 45,108, 41, 60,213,196, 64,225,206,204,114,165,158,136,160,248, 17,247,111, 95, +151, 37, 2, 82,113, 57,173,207, 47,110,175, 39,143, 55,152,179, 55, 45,238,230,170, 95,124, 31,109,127, 27, 15,126,254,250,247, +227,236,252, 74, 56,186,239,208, 77,159,230,187, 59,131, 59,243, 97, 14,185,147, 3,112,117,123, 68, 8,109,143,155,163,248,204, +178,211,180,138,233,222, 68, 2,160,145,107, 22,245,146, 86,166,101, 4,158,216,139,170, 37, 96,163, 44,155, 95, 4, 33, 12,199, + 21,228,229,188,140,240, 98,185, 33, 65,180,145,161,115, 40,251,216,152,167, 1,235,114,214,107,249,198,187, 41, 25,193, 79,201, +184,138,172,140,224, 41, 88,110,187, 88, 47,132,202, 21, 57,233, 11, 53, 42, 24,153, 4, 33, 29,185, 57,197, 84,162, 99,141, 42, +158,109,103,246, 12, 4, 72,204,210, 96,193,213, 58,125, 19,187, 92,232, 78, 53,172, 59, 72, 98,135,188,142,127,212,166, 16, 25, +186, 17,147, 36,196,203, 85, 5,188, 72,215, 65, 46, 87, 24,108,210,244,133, 52,209, 73,168,144,239,148, 19,224, 71,174,114, 71, + 59,113,131,117,245,138, 81,240,104,235,211,245,236, 50,213,170,121, 45, 62,133,252, 26,179, 58, 85,245, 42, 99, 48,254,102,123, +213,151, 18, 33, 60, 89,138,205, 65,205, 12,230, 72,141,165, 79, 4,194,202, 26, 99, 5,104,242,250,144, 45,225, 34,178, 40, 4, +166,208,208, 65,217, 5,119, 47,233, 78,120, 29,232, 64,144,153,112,196, 60,227, 66,188,108,189,122,187,167, 45, 49,206,210,172, +192,233,171,110,236, 1,215, 6, 2, 9,183,241,241, 23,114,160, 71, 0,225,230, 19,221, 93, 7,174, 45,240, 44, 0,105,215,214, +146, 64, 16, 70,103,118,213,221, 53, 43, 72,187, 81, 18,228,131, 61, 20, 21,129, 81,253,227,254, 68,208, 99,143,209, 75, 4, 69, +153, 73,166,101,150,174,155, 59,251, 53,247,157, 49,139, 34, 89, 68,196, 21,193,111,102,206,119, 57,231,252,164, 15,156,207,231, +107,181, 90,189, 94,255,207,200,145,126, 84,171,213, 48,164,167,224,104,236,181,206,134,203,229,242,210,242, 82,167,211,254,210, +153,132,201,227, 10,223,255, 6,176,150,136,102, 27,203, 21,187,127,116,184,185,187,221,168,223,113,138, 48, 99,166,114,130,153, +124,102,157, 70, 87,216,149, 57, 34, 66,249,238, 37,202,184, 88, 85, 0,208,222,193,254,198,206, 86,243,190, 17,211, 47,129,212, +118,224,153,129,119,183,200, 96,181,204,101,181,197, 29,249, 93,163, 66,232, 19,244, 17, 68, 31,201,130,231, 15, 73,242, 10,132, + 94, 15,131,240, 42, 26,182,191,224,163,136,196, 37,112, 62, 8, 3, 5, 43, 78,118,189, 24,236, 86, 74,107, 51, 83,221,246,240, +246,105,208,163,247, 99, 84,200,209, 0,117,243,126,134,226,244,105, 47,195,234, 54, 57, 28,120,238,108,224, 6, 89,220, 27, 68, +215,141,238,217,229,227,201,101,235,162,213,125,232,135, 55,113,212,129,216,103, 36, 38,116,254,242,118,124,211, 60,125, 31,132, + 8,138, 8, 85,188,169,229,194, 42,246,231,187, 73,129, 41, 63, 58, 40, 35,138,234, 82,233,148, 9,117, 18, 9,169,177,129, 37, + 5,210, 81,154, 40, 32, 53, 63,229,112,186, 68,176,170,196, 2, 0,150,144,163,193,126, 49, 71,232,240,184,152,187,214, 12, 81, + 22, 65,186,139,104,120, 99,164,128, 40, 1, 19,186, 89,215,239,163, 29, 38, 90,214, 72,201,240,212,120, 65,120,196,224, 52, 32, +177,173,184, 33,227, 19,255,188,160, 64, 26,129, 40, 49,247, 84,158, 55, 73,145, 79, 58,246,131,173,244, 40, 77,150,144,193, 99, +146,146,141,166,253,105, 98,212,208, 19,131,180,172,128, 18,118,172,202, 20,140, 79,191, 91, 80,220,178, 71,183, 63, 53,161, 61, +240,215,177,152,196,104, 18,155,128, 61,203,149,245,195, 81, 95,229, 44,147,255, 84,108, 21,103,144,160,189,179,226, 12,199,112, +116,103, 92, 12, 86, 75,254, 28,125, 39, 26, 9,223, 29,240, 93,193,141,135, 17, 17, 42, 66,116,163,143,105,190, 75, 55,104, 66, +152,249, 6,199, 40,130,151,132, 20, 51, 76,123, 27, 48,130, 33, 63,167, 29,149,196,176,220,214, 69, 88,187,130,114,233,118,233, +255, 17, 35,225,246, 35, 92,106,245, 49,101,186, 18, 88, 42,155,252,118, 62,113,175, 38, 9, 63, 5,160,236,124,126,154, 8,162, + 56, 62,179,109,211, 31,212,154, 34, 24, 20,141, 23, 34, 9, 16, 96, 47, 16, 98, 98,252, 27,140, 73,213,131,164, 71,237,191,167, + 87,207, 38, 30,148,132,163, 17, 2, 9,193, 66, 0,221, 98,151,221,157,121,206,123,243, 99,167,203, 42,113, 51,105,246,176,109, + 38,179,221,183,111,102,222,247,243,253, 87,146,162, 2,110,191,223, 47, 68,252, 94,175,119,253,252,198, 35, 12,195,119,131,129, +238,206,122, 24,190, 29, 12,252,234,102,125,250,226,101,111, 97,241,113, 1,202,236, 11,211,111, 12,238, 62,246,160, 80,122,227, +224,165,155, 79,182, 94,245,223,172,132,235,214, 68,130, 57,218,151,129,222, 16,132, 12, 63,209,107, 1,132, 86, 70, 82, 13, 42, + 24, 47,121, 22,110,109, 62,223,126,189,180,182, 42, 41, 85,114,136,118,110, 84,163,240, 3, 23,199,171,243,172,182,192,130, 25, +194,163,119,168, 38,167,102,205,149, 74, 15,173,117, 74,204,137, 60,101,201, 81, 60,190, 95,111,222, 97,181, 11, 38,190, 51,113, + 82,246,173, 51, 6, 95,146,203, 49, 26,119,212, 30, 78,183,151,239,221, 62, 63, 79, 63,238, 14, 63, 31,168,244, 61, 81,129,189, + 85,197, 50,142, 70,149,181,235, 42, 87,228, 41,240,238, 20,239, 52,121,154,137,111,199,209,251,157,163, 15, 95, 15, 63,237,157, + 12, 71,209,129, 24, 15, 25, 50,232,103,131,160,203,216, 8,178,253, 36,254, 41,210,185,106,243,217,212,221,167,211, 43,139,179, + 27,173,246, 26,175,207,253,134, 38,141,143, 36,158, 26, 82, 28, 50, 18,103,171,225, 66, 77, 30, 97,150, 50,109,221, 96,221,128, +164,225,139,131, 99,140,147, 47,133,177,184,210,182,215,130,187, 96,100,195, 62,179, 96, 20, 43,184,183, 69,226, 34,223, 30,204, +119,237, 40,121,183,121, 59, 92, 91, 40,176,193,221, 40,188,221,114,188,238,178,215,192, 46, 38,112,248, 75,220,183,253,228,158, +199,175, 44,200, 52, 50,175, 28,199,217, 18,129,163,120,113, 48, 85,167, 26, 24,104, 74, 35,156, 98,151, 67,177, 49,107,116,228, + 52,253, 26, 62,149, 95, 35, 76, 13,162,249, 41,238,181,192, 93,230,182, 53, 12, 21,121, 34,184,187, 53,125,237,250,194,169,185, +127, 62, 51,210, 54,176,118, 29,158, 45, 44,207,131,187,156,180, 13,225,249, 80, 79, 60,242,224,109,168,252, 87,112,215, 18,197, + 7,221, 71, 45, 52,174, 47, 49,211,205,140,248, 25,187,208, 8,234,101, 55,174,124,145, 7,229, 29,149,198,173, 70,135, 42, 80, +131, 10, 50, 32, 33,198, 9, 61,102, 49,106,172,198,153,184, 76,175, 70,241,175, 40,185,136,174,162, 56,141,165,158,244,179, 10, + 33, 41, 2, 76,228, 85, 67,244, 6, 7, 67,241,215,132, 80,204,196,165,113, 30, 23,118,108, 13, 68, 93,146,131, 57,202,148, 64, +160, 6, 10,212,251, 36, 35,180, 52, 70, 23,122,208, 64, 58,214, 41, 5,125,178,232,209,247,200,153,158,209,139, 7, 68, 66, 40, +121, 53,195,248, 35, 0, 99,215,214,219, 52, 12,133, 99,167,105,147,106,192, 66, 82, 9,177, 50,132, 86,218,215,190,240,196,195, + 36,160, 63,118, 18, 2, 33,241, 63, 90,110,130, 20,129,196,117, 72,164,157,216,148, 52,113, 18, 27,251,248,210, 52,141, 4,121, +138, 83,247,216,178,156,147,227,207,159,191,243,111,124, 38, 12,195, 32, 8,162, 40,146,110,122, 54,155, 45, 22,139,213,106,197, + 99,112,115,239,121, 30,143,199,121,189,152, 23,226, 88,122,127,254, 47, 19,251, 79,167,211,197,124,158,166,105,227, 62, 8,195, + 1, 84,147, 69,115, 13,239, 12,221,126,255, 35, 52,202, 77,221, 12,130, 4,236,243,110, 4,208,161, 72,255,196, 63, 66,166,209, +250, 53,154, 76,178,116,211, 7, 35, 6,147,241,195,193,233,147, 71,111,230,139,231,103, 79,249,195,147,201,248, 34, 94,251, 97, +240, 57, 90,242,226,209,112,200,235,127, 90, 46,181, 40, 36, 58, 25,141, 54,105,246,243,219, 15,245,134,194,151,241,112,224, 63, +124,124,250,238,213,235,151,103,207,248,144,222, 27,223, 95,199,177, 48,242, 97,169,153,201,162,234,165,197,120, 57,196,157, 35, +208,120,253, 13, 75, 42,163,188,152,213,246, 87, 27,241, 72, 9,130,101,112,238,148,174,105,222,203,233,216,243, 14, 75,252,182, +224,206,183,101,157, 37, 63, 78,183,236,238,196, 63, 72,236,242,197,251,243,235, 93,231,193,221,208,239,123, 46, 70,220,167, 11, +165,123, 87,228,108,252, 67, 40,118,240,166,160, 95, 47,171, 95, 87, 21, 37,196,102,228,248,134,227,220,246,162,117,118,126,101, + 31, 31,244, 92, 33,148, 65,186,130,252, 89,102, 20, 19,220,233,117,253, 18, 13, 10,230,230,130,111,195, 8, 15,208, 75,222,226, + 53,145, 42,146, 38,157, 50,161,214, 6, 4,178,148,160,147,196, 16,101,190, 90, 45, 41, 42,102, 47,128,137, 59,104, 1, 67, 72, + 81, 95,144,242,250, 72, 3,142,134,165, 78, 65,245, 95,139,177, 48, 0,145, 21, 64,218, 16,115, 87, 40, 31,162, 76,231, 26, 82, +180, 25, 77,166,173,234, 81,176,101,240,158,214, 84,156, 38,198,175,118,145, 95,164,213,238, 88,219,218,203, 48, 45,183, 30, 90, +103, 3,215, 2,176, 10,160,135, 7, 50,251, 24,174, 39,230,144,252,123,140,218, 52, 6,244,201,169,154,171, 68,104, 63, 4,102, + 59,225, 77, 83,137,143,109,209,112, 10,199, 83,105,195,185,107,201,135, 38,241, 13,233,157, 3,173,130, 2,222,172,230,226,247, +229,148,117, 62, 28, 69,123,183,218, 2,121,179,220,249,127,231,110,250,244,253,226,139,213,150,127,162,209, 64, 70,155,108, 72, +207,113,243, 34,219, 51,139,149, 16, 60, 45, 73, 69, 48,144,202,165,183,101,172,147,148,196,166, 66,138, 93,136, 8, 49,254, 22, + 20, 57,201,153,149,116,177,195, 71,178, 35, 84, 8,145,228,177,240, 37,109, 69, 49,104, 11, 99, 91,133, 55,176, 5, 85, 67,253, +168,138,199,177,173, 56, 32, 20,171,211,227,172,220, 38,238,226, 67, 93, 74,126,176, 74,248, 44, 84, 10,176,102,104, 75, 78, 45, + 45,180, 17,102, 84,250, 96, 14, 20, 48,245,254, 10, 64,217,213,188, 54, 17, 68,241,153,217,165,171,165, 74, 64,176,146, 38, 55, + 79,122, 44, 26,221, 30,237, 77, 8, 94,196,163, 6,170,160, 32, 82,106,160,193,218,146, 82, 74, 32,133, 94,123,139, 23,193,115, +242, 55,180, 8,253, 7,252, 86, 76, 42,165, 31,177,106,210,124,236,238,140,111,230,237,236, 71, 66, 43, 46, 75,152, 44,201,100, +146,204,254,230,205,251,189,247,123,255,198,247, 82,169, 4,143, 0,193,197, 98,209,182,109,104,231,243,249,106,181, 10,248, 30, +109,227, 83, 56,182, 54, 55, 43,149,202,173,233,233,108, 54,251,112,102, 6, 81,216,158,154, 90, 43,151, 7,218, 15,114, 57,104, + 99,231,171,197, 98, 96,176,223,207,229,110,234,235,235,229,242, 68, 58, 13,246, 62,188, 17,174, 0,142, 3,190,227,167,212,106, +181,151,139,139,120,189, 48, 63,143, 16,143,183,242,139,165, 37,192,125,245,250,195,213,229,229,142, 92, 60,228,141,147,177, 51, +208, 27,156,141,122,227,243,251,143, 79,158,207,118,142, 37, 9,186, 82, 88,184,115,239,238, 53,251, 6,180,119,234,141,141,181, +117,232,229,241,220,108, 50,157,130, 43,219, 91,111,223,188,122,173,238, 45,185, 67,155,204, 92, 79,166, 38,224,252,241,125,231, +203,135, 79,143,230,158, 98, 39,165,194, 2, 44, 6, 72,173, 81,149,164, 8,199, 46, 23, 48,172,203,134,121,133, 88, 95, 61, 7, +204,240, 99, 53,215,199,180,157,110, 40,172, 39, 26,250,163, 57,159, 9, 53,233, 15,184,123,208,105,167, 70,172,219,231, 18,123, + 61,167,238,194,196,244,218,156, 91,140, 37,132, 56, 35,232, 24, 53, 92, 70,191,137,254,118,115,255,144,139,139,132, 60,187,122, +105, 50,121, 97,247, 79,119,175,237,254,246,200,187,163, 94,171, 39, 25,255, 95, 93, 79, 18, 58,138,158, 97,210,233, 36, 73, 8, + 73, 32,255,100,130,143, 90,166, 1, 0, 11, 80,205,217,104,207, 47, 51,100,186,220,114,121,162,239,177,174,215, 82, 38, 40, 10, +116, 9,233,248,147, 9,176,230, 89,107,156,137,110,171,191, 15,203, 5,134,177,115,205,111,106, 57, 14,223, 31,203, 41,165, 3, +117, 26,133,239,247, 82,154,253,156,139, 1,227, 29,203,151,197,100,220,117,212,135, 22, 73,140,137,165, 16, 47,136, 62,231, 34, + 90, 98, 52,220, 7,132, 65, 49, 52, 24,222,112, 16, 30, 27, 74,100,141,226,190, 18,136, 54,232,105,186, 6,145,152, 46,191, 48, +123, 8,241, 42, 40, 94,175, 1, 26,229,117,130, 58,198,194,121, 94,132, 0,192,255, 43,208,171,137,128, 81, 44,174, 52,174, 84, +115,162,155, 71,248, 14, 92,129,105,178,190, 32, 61, 15,115,142,130,156,175,136, 67,128, 48,237,210,161, 4,139,106,209, 32, 53, +151,137,129, 84,190,168,188,187, 16, 33,179, 26, 19,132, 16, 67, 57, 80,255, 23, 75, 31,223, 79, 49, 44, 75, 32,103,164,233,120, +206,233, 62, 46,149,246,207,201,201,217,106,128,233,125,167,111,153, 35, 18,180,193,198,106, 55, 83,231, 83, 22, 35,205,206, 17, +252, 96,240,125, 29,185,119,228,170,194,152,140, 82,119,177,236, 56,214,195,147, 58, 97,204,144,187,127,106,232,122, 33,134, 63, +108, 67, 21, 35, 35, 74,131, 12,193,151,162,153,239,179, 41, 58, 49,149,106,234,130, 5, 82,101,138,194, 81,113, 53, 92,132,180, + 98, 72, 86, 27, 40,129,227, 7,193,203,233, 1, 3,131, 45,199, 95, 1, 24,187,130,214, 38,130, 40,188, 51,155,164,113,211, 67, +139,130,135, 86, 65, 37, 93, 15,133,182, 8,197,154, 31,225, 69,196,147,120,240, 32, 10, 69, 60,229, 22,138, 87, 15, 94, 54, 6, + 68,196, 99, 61, 54,133, 80,210,122,240,228,201,123, 99,123,105, 49,130,130, 65, 67, 72,119,179, 59,227,155,247,102,103, 55,107, +136,230, 52, 25, 54,179,155,101,246,155,111,222,190,239,123,255,198,247,106,181, 10,244,188, 86,171, 1,130, 3,148, 3,160, 63, + 68,212,134,175,166, 13,141,118,187,253,126,123,155,226, 48, 59,205,230,193,254, 62,144,116, 26, 1, 64, 28,192,151, 24,183,105, + 67, 99,117,109,237,249,214, 22,128, 56, 12,101, 86,111,234,111,120, 30, 92, 58, 0,253,205, 74,229,244,228, 4, 64,252,233,230, +230,146,235,194,224, 0,229,112, 60,172, 13,112, 10,232,175,123,158, 57, 17,125,224, 48, 0,247,103,234,248,235,143,158, 60, 30, +198, 59, 3,184,113,173,157,221,178,235, 30, 29,118,168, 1,157,111,188,198,241, 97,103,189,178,177,188,186,242,182,222,128, 27, +116,239,193,253, 27,183, 54, 22, 46, 45,194, 5,212, 95,188, 92,184,188,120,251,238,157,143, 7, 31,190,157,118,105,222,239, 53, + 91, 87,151,202,199,157, 47,237,102,235,154, 91,134,158,119,175, 94,195, 32,137,109,134,149,240,120, 74, 72, 63,138,194,239,150, + 63, 99,217, 87,148, 19,140,248,161, 12, 25,101,207,146,125, 68,240, 18, 66,124, 44, 56,214,251,124,202,139,247,209, 73, 24, 22, +131, 30,208, 5,169, 10,168,175, 56, 78, 30, 75, 5,194,236, 59,139,162,189,254,175,174,140,210,228,103,121,222,249, 58,144,159, + 62,119,251,161, 28,132,176,175,228,121,181, 97, 84,110,165, 22,234, 52, 80, 25,204,208,101, 14, 11, 49, 40,113,186,162, 37,195, + 72,232, 89,132,165,241,148,179, 82,174,100,179,185, 32, 12,152,229,115, 25, 82, 8, 1,167, 33, 42, 45,133,240,229,240,183,240, +103, 11,206,185,252,197,254, 8,214, 50, 95,251,121,161, 81, 88,194,237, 48, 67,132,105,209,142,102, 48,218,191,129, 17,184, 71, + 20,177, 17, 49,212, 16,196,139, 88,215,164, 97,222, 74,228,101,127, 91,254, 38, 84,148, 37,105,145, 38,140, 47,198,201,187,250, + 11,241,139,221,137,187,168,233, 65, 91,248,185,157,174,246, 51, 53,207, 32, 13,241,220,138, 49, 57, 38,242, 26,229, 73, 80,193, + 19,174,156, 20,189, 99, 25, 11,122, 44,118,197, 13,193,231,227,111,166, 88, 70, 2,150,209, 54,197,222,200,113, 42,145,196,116, +107, 19,147, 73, 10,163,101, 19,222,210, 34,113, 90,162,152,230,155,250, 10,162,177, 76, 6,153, 90, 78,141,173,144,137,223,200, +255,145,206,228,184, 61, 81,167, 90, 80, 47, 36, 71, 25,177, 43,159, 26,182,205, 89,148,161,174, 79, 55,138, 2, 49,158,119,151, + 74,137, 67,223, 46,166, 75,178,248, 2,184, 75,112,222,185, 48, 87, 40,158,217,133, 65, 52, 4,112, 7, 46,175,116,198,168,170, + 14, 20,188,227,112, 76, 96, 84, 4,158, 29,202,158,164,180, 25,242,245,149,198,174, 57,196,125, 60,154,145,228,108, 93, 76,149, +188, 20,181,140, 25, 17, 92, 57,139, 17,128, 96,160,137, 49,157, 7, 57, 89,198,143, 15, 5, 39,107,147, 18,119,102,103,230,139, +249,162,136, 70, 63,253,222, 31, 1, 40,187,150,149,134,129, 40, 58, 51, 77,170,169,138,104, 5, 5, 65, 80,191,195,133, 15, 92, +136,186,237,119,184,240, 43,172, 63, 37,232,214,173, 47, 4,173,143, 77,139, 20,165, 53,109,103,198,251,152,153, 60,106, 17,179, +144, 80,201, 52, 49,241,230,220,123,207, 61,231,239,248,222, 30, 43,125,252,186,245,251,136, 97,175, 41,212, 98,253,164,221, 14, + 37, 23, 64,253,151, 87, 87,165,125,174,222, 60,183, 90,112,234, 28,250,249,182, 47,212,235,240,115,123,111,143,241,123, 88, 4, +118, 56, 82,195,249,192,177,176, 3,199,158,159,157, 29, 30, 31, 55, 26,141,102,179,201,248, 29,110,243, 75, 11,183,147,211,211, + 90, 82,187,163,149,243, 4,121, 81, 84,179,185,191,197,162,202, 66, 29,187,161, 91,187, 59,132,223, 91,240, 69,240, 73, 82, 75, +246,143, 14,224, 56, 64,250,142,167,204, 82, 33, 57,149, 99, 94,234,238,246, 38,215,255,119,100, 53,231,200,150, 37, 77,182, 43, +116,199,246, 86, 85,180, 30, 37,144,194, 61,153, 65, 34, 12,243, 26,217, 84, 47, 76,183, 6, 75,107,225, 75,246, 49,242,167, 16, +199,118, 70,131,233,138, 74, 42,106,104,177,234,253, 81,126,244,197, 71,170, 46,222,191, 80,170, 44, 66,145, 3,204, 25,113,232, +153,149, 87,221, 63,130,167, 42, 73, 30,129,204,177, 77,101,232,245, 25, 53, 87, 21,179,233,168, 7,185, 42, 90, 24,106,228,135, +197,104, 27, 7,201, 41, 36,176,130,236, 40,101,106,135,223,163,254, 76,117,102, 62, 90,238, 12, 95, 53,252,146,241,154,116,220, + 21,103,116,155, 53, 1,117,161,146, 96,217, 57,207, 7,119,130,232,108,154, 58, 98,115, 12, 55,183, 33,199,116,201,139, 98,238, +210,132, 86, 42,147, 31, 3, 45, 82,138,188, 97,133,241, 28, 53, 41,202,122,109,118, 18, 6,255, 99,106,181, 56,253,248, 59, 97, +140, 66,124, 32, 77, 42, 39, 39,134, 88, 56, 67,249,204,175, 12,227,167,190, 7, 87, 2,230,116,203,132,151,170,198,241, 95, 57, +153,245, 46, 73, 14,193,113, 49, 2, 75,210,189, 68,172, 48,121,169, 0, 19, 52,217, 3, 18,207,255, 73,164,199,236, 42,216,204, +123, 50,232, 56,123,173,148, 87,121, 25, 28, 43, 38,190, 47,255,177, 17,151, 92, 68,197,229, 16,194, 91, 59, 14,222, 21,189, 36, + 66,112,103, 55, 77, 74,148,229,218,210,230, 99,251,161,232,230,138,215, 85,193, 26, 75,140,110,168, 50,234, 14, 58, 75, 83, 43, +175,159,111,179,139, 27,176, 86,172,212,192,216, 41, 18,122,198,210,141,214, 76, 6,131,203, 76,169, 66, 78, 58, 72,154, 28,151, + 88, 98,195,242, 36,132,201, 58, 34,252,236,113,200, 38, 83, 27,234,215,106,223,140,176,153,177, 48,145, 45,233,137,101,198,237, +144, 66,188,242,150, 0,225,189,171,125,111,166, 42, 43,181,120, 14, 50,251, 94,218,237,235,111, 56,155, 31, 1, 56,187,154,222, +180,129, 40,184,187,150,249,176, 34,149, 6, 78, 81,114,107,213,220, 74,174,249, 17,252, 59,254, 8,201,141, 68, 72,173,108,170, + 40, 82,171,222,122,107,131,143, 1, 53, 68,114,176,189,222,205,190,247,188,187,118,155, 80,169, 28,144, 65,200, 94,153,101,118, +152,125,111,230,127,234, 35, 13, 73,119,176,235,142, 13,101, 54,180,122, 60, 30, 19, 46,195,203,211,211,171,249,252, 4, 31,211, +233,148, 62,227,142, 13, 10, 79, 38, 19,162,243,195,209,104, 25,199,116, 66,146,236,151, 73, 66,239, 39,113, 76,202,207,139, 60, +171, 31, 69,151,179, 25,232, 60,231,231,134,197,155, 43, 46,230,115, 55,182,116,117,119, 57,187, 48, 7, 31,207,206,204,243,247, +175,223,212, 95, 63, 2,196, 8,145,174, 82,115,124,147,124,217,220,175, 15, 71,195,219,100,121,116,114,108, 78,254,249,122, 1, + 75, 87,182, 75,239, 82,195,232,223,125,120,255,233,106,193,106,158,136, 81,174, 52,111,218, 77,142, 77,251,170,192, 78,190,140, +133,111, 57, 59,128,106, 19,208,148,143, 15,251,131,188,183,201,118,247,102,153,101,160,125,240, 6, 9, 10,108,204,105, 15,251, +167,204,151,244,128,198,196, 61,180,211,141, 2,209,237, 4,131, 40, 28,246,187,241,143,223, 63, 27, 55,228, 72,112,137,233,139, +102,146,150,134, 56, 40,206,253,108,113,197, 99,148,133, 66, 88,239,253, 86,112, 47, 72, 35, 67, 87, 92, 28,132, 42,218, 22,219, +167,226, 73, 50, 5,149,164,200,243, 11,220,189,201,149, 12,161,134,204,224,123, 32,192,199,134,149,170,144,225,155,110, 48,120, + 52,127, 84,184,219, 36,212, 30,198,241,244,194, 75,174,216, 65,138,248, 82, 49,202, 92, 66,237,157,217,221, 87,238,195,132,116, +219,217,255, 21,100,119,128,229,217,104,195,167,214,169, 3,173,110, 24,181,175, 25,104, 15, 31,212,194,175,191, 77,112,231,251, +106,130,161, 94,189, 78,119, 82, 45,195,164,218,139,140,214, 69,225, 70, 89,225,218,235,134,222,136, 20,242,254,154, 80, 52,205, +172,156, 34,216, 11,221, 67,218, 70, 57,249,242,254,122,213,109,102, 91,107,151, 95,216,106, 14,248,163, 50,134,210,143,149,135, +113,167, 53,181,170, 40, 93, 48,137,118, 65, 41,218,119, 48,192,158, 71,237,122,247, 15,113,102,143,201, 12,183, 14, 45,250,117, + 85,205,190,217,246, 13,129,108,206, 78, 46,115,115,233,213,230, 87,179,113,202,150,187,240, 82,131, 47, 0,180,253,193, 0, 43, +201,202,199,221,118,157, 13,163, 78,119,199, 50,236,101, 18,138,204,141,144, 26, 97,160, 51,248, 0,225,188,149,170,190,193,149, +172,209,153, 89, 88, 23, 4,238, 2,204, 6, 52,234, 51,176, 43, 27, 88,131, 22,221,142,214,171,124,160, 47,197, 10, 41,178, 33, +195,104, 79, 65,176,128,220,159,210, 86, 21,122, 23,200,135, 98,187,206, 75, 9,102, 9,160, 34, 62, 11,192,217,213,244, 52, 17, +132,225,153,217,210,118, 11, 20, 9,114, 37, 49,234,226, 79, 80,127,131,123,240, 32, 38, 92,140, 39, 19,251, 47, 56,248, 55,122, + 54,241, 66,244, 96, 66, 98,194,161, 53, 36, 36,141,120,106,226, 31, 0, 33, 17, 3,104,233,188, 59, 62, 51,243,206,126,148, 5, +163,123,218,180,187,221,118, 59,251,204, 51,239,199,243,252, 27,190,143,221,214,235,245,192,211, 1,211,249,190, 15,215, 0,235, + 1,202,253,126, 31, 8, 11,224, 78,211, 20,248, 14,228,197, 97,158, 92,151,247,113, 22,222, 5,245,238,116, 58,216, 7,142,227, +245,196,133,128,146, 36,217, 8,175, 15, 6,131,235,158, 60, 95,192,131, 57, 0, 83,194,112, 56,196,213,159,164,233,167,157,157, +188,248, 7, 27, 62,240,205,214,214,195,199,143,112,151,128,239,117,146,102,246, 81, 57, 24,141,238, 37,201,211,231,207,192,217, +191,142,190,236, 13, 62,127,124,255, 97,115,229,197,203,215,175,112,196,246,219,119,223,198,227,187,235, 9,232,252, 46,240, 61, + 56, 68,132,130,136, 66,222,118,246,217, 14, 12,205,103, 4, 79,172, 36,153,157, 12, 72,232,189,227,243,166, 18, 93, 41,215, 90, +237, 46,233, 67, 61, 61,181, 20,158,243,145, 77,103,178, 49,177,225,157, 40,182, 84,218,142, 10,112,135, 91, 45,219, 93,186, 16, + 71, 15, 86,227,184,211,222,255,126,129,193,186,150,209,177,235,112,235,138,168, 29,181,126,101,182,198,220, 38, 98,148,173,111, + 55,158,192, 11, 25,194,169, 94,148, 48,111,251,242, 43, 13,229,158, 81,114,146,191, 56, 65,181,192,220,233, 55,136,185,182, 26, + 73, 54, 29,239, 86,157,196,180, 87, 58, 39, 15, 45, 73,105,143, 64,148, 69,103,230,116,117,254,182,148,115,218, 90, 63,153,208, +141,204, 86,101,202, 57,210,208,236,162,146, 43, 74,130,130,128,119, 37,227,144,123,222,143, 90,114, 76, 13,100,179, 22,217,139, + 86,213, 16,252, 53, 37,193,194,255, 42,238,173,173, 80,140,106,192,221,220, 40, 26, 28, 66, 1,198,247,154, 74, 89, 72, 75,230, + 1, 25,195, 62, 62, 92,124,232,231,221,194, 85, 28,212, 94,138,170,234,128,170,180, 98,229,233,132,186, 17, 46,170, 38,168,179, +222,214,162,144,237,189,174, 57, 32,216, 29,115,220, 34,172, 83, 75,223, 60, 76, 76, 69,236,222, 92,209, 1,246,142, 89, 13,155, +129, 20, 84,223,117, 91,246, 62,253,203,255, 70, 85,229,123, 83, 63, 73, 76,203,119,129, 76,182,220, 94,156,156, 77,220,160,157, + 94,241,127, 47, 98,172,190,154, 69,169,198,143,203,147,249,230,210,209,249,225,253,248,142, 6,149, 33,174,204, 10,149, 76, 36, + 57,137,234,162, 95, 54,177, 73,222,153, 75,133,134, 88,119, 21,147,177,144,128, 93,189, 53, 56, 69,207, 97,119, 29,202, 40,137, +221, 60,120,253,159, 23, 92,101,174, 19,170,218, 41,198, 63,223,148,212, 55, 73, 92, 94,100, 63, 9,116,139, 89,136,249, 35, 0, +111,215,146,211, 48, 12, 68, 61,142,147,168,133,162, 34, 85, 32, 33, 88,178,226, 42,168,231, 64,176,165, 7, 40, 11,142,195,162, + 92,134, 3, 32,177, 64, 98, 17, 90,218,226,196,193, 51,254,196,137,131,248, 73,100,209,118, 81, 53, 74,226,153,190,121,158,247, + 6, 6,232, 58, 5,171,158, 65, 23, 63,216,206,190,158,205,116,226,190, 95, 44,216,191, 31, 16,245, 29,235,227,124, 58, 53,144, +252,226,234,242,118,126, 99, 62, 67, 67,198, 37,117,143, 99,101, 19,165,158,188,224, 1,240,241, 32, 55, 22, 60,130,221,179,234, +129, 18, 30, 57, 7,175, 96,197, 82,244,176,245,219, 97, 34, 78, 5, 20, 82, 62,149,106, 73, 79, 43, 39, 82,190, 32,127,184, 49, +138,210,184, 94,104,147, 44,153, 12,179,131, 81,122,118,180,243,184, 81,119, 15, 47,207,111,239,216,137,165, 49, 52,109,252, 42, +211,126,129,162, 37, 20, 87,155,174,116, 48, 25,143, 3,107,247,122,219,113, 40,220,100, 20, 11, 46, 80,120,163,120,206, 71, 80, +229, 43,249,186,213,245,110, 85,146, 33, 70, 89,186,145,108, 6,230, 27,250, 53,177,215,130, 42, 10,145,164,227,193,126,201, 86, + 75, 89, 80,163,133, 10,110,158, 93,175, 29, 20, 76, 33,234, 96, 59, 17,246,206,227,215, 52, 15, 70, 67, 30, 20,184,226, 32,144, + 56, 5,152, 61, 38,127, 67, 77, 83,199,109,252, 75,102, 32, 78,151,220, 17, 59,237,239,192,111, 86,172, 99,194,120,151, 24, 10, + 68,115,141, 41, 36,244,217,114, 0,132,211, 66,107,246,153,219,113, 29, 16, 46,113,102,247,156, 76,213,162,100, 34,191, 78,123, + 99,109,128,152,115,187,243,243,186, 83,153, 5,122,227, 62,147,119, 67, 26, 65, 3,240, 25,251,166,238,244,239, 50, 76,255,227, + 57,215, 96,104, 27, 6, 6,183,141, 46,128,229, 41, 19,153, 72, 83,200, 50,156,170, 36,134,201,222,241,238,201, 86,174, 89,181, + 89,203, 13, 33, 30,137, 61,136,181,193, 61,140,252,169,144, 96,148, 58, 88,208, 19,216,102,103,225, 24, 33,159, 97, 20,201,154, +220, 6,128,170, 45, 78, 87, 46,107,183,250,195, 61, 14,171,220, 24, 47,110,232,211, 38,231, 96, 41,144, 18, 95, 69, 44, 16,186, +101,105, 76, 70,127, 33,252, 67, 0,230,174,158,167, 97, 24,136,230,236, 36, 69, 98, 0,137,149,138, 1,248,255, 11, 27,136, 63, +192,159, 96,128, 5, 49,181, 34, 73,107,251,142,248,227,236,115, 74,133, 4, 12, 84,221, 82,169,146,229, 60,159,223,189,247,174, +253, 67,120,253, 39,159,185,174,191, 92,175,103,136, 31,135,225,241,254,225,197, 19, 62, 85, 6,108,184,185, 44,174,180,194, 58, +158, 35, 19,200, 83,192,138,223, 64, 6, 2, 60, 72, 6,161, 35, 13,186, 18,109,150,123,167, 16,117, 18, 30,116,219,200,244,205, + 79,223, 28,190,219,230,118,213,223,180,184,217,187, 9, 93,248,177, 58, 13, 36,227, 89,171,186,206,135,224, 92,159,119, 87, 23, + 39,176,234,239,158, 63,158, 94, 55, 62,180, 84,251,139,158,197, 40,131, 77, 40,160,169,104, 24,148, 60,214,138, 24, 34,142,248, + 8,102, 57,151,107, 64,132,148,233,136,198,193,100,183, 59, 28,173,115,251,102,135, 60, 30, 11,153,161,143, 95, 29,198,128,177, +255, 30,230,221, 61,237,135,190,107, 41, 36,224,130, 44, 4, 33, 71, 55, 87,248,142, 41,161,183,112, 50, 68, 44,232, 78,141, 62, + 76, 10,109,168,184,227,108,160,175,167, 54,231,116, 3, 88,228, 21,224, 17,250,229,152, 8,154,190, 66,118, 85, 63,249,182,108, +175,235, 95, 89, 33, 42,137,189, 78, 64, 53, 28,120,131, 42,101, 7,148, 65, 63,170,248,182,184,180,135, 34,158, 92, 18,219, 98, +161,228,108,235,188,194,178,208,230, 63, 78, 43, 78,165, 51,163, 50,214, 80,195, 25,253,169,111,140, 11,171, 57, 10, 31, 25,213, + 30, 28, 78,189,255,201,236,195,223, 1,213,242, 0, 28,133,110, 50, 51,137,224, 99,221,131,241,179, 91, 89, 99,148,246,211, 38, + 21,234, 17,182,150, 76,167,251,193,237,252,125,218,197,105,226,233,208, 50,100,149, 87,214, 96, 44,224,230,227,193, 54, 81, 95, +208, 24, 78,228,144, 4,154,101, 97,110,240,184, 70, 7, 70,164,101,228,134,193, 16, 28,159,250, 88,200,102,201,176,103, 92, 56, + 36,162,184, 62, 77, 65, 96, 19,143, 9, 41, 11,100,155,249,118,162, 63, 5, 32,238, 10,114, 26,134,129,160,189,182,147,182,161, +229,134,184, 33, 33,241,255, 55,240, 21, 14, 28,128, 67, 41, 18, 37,137, 99, 19,175,189,142, 55, 81,164, 34,144,120, 64,163, 42, +142,215, 51,235,153,217,223,226,247,127,175,239,146,187, 30, 60,183, 84,148,141,209,181,193, 82,144,193,250,132, 65,124,158,232, +157,111,150,126,214,163, 45,224, 12, 71,241, 50,210, 2, 73,210,101, 69,107, 54,110,145,157,134,135, 90,223, 27,120, 57,219,183, + 97,104, 20, 92,107,185,223,194, 85,109,110, 14,149,172,204,115,235, 30,159, 78,227, 25,160, 21, 32,118, 8, 90,171,220,161,142, +218, 17,242,191, 75,133,190, 82,144, 57,221, 71, 50,251, 87, 42, 24, 72, 33,131,182, 6,125,186, 88,199,140, 61, 28,251, 99,231, + 91,100,157,189, 77,157,150, 68, 72, 16,179, 43,145,140,118, 42,242, 33, 44,247,186, 49,219,166,222,189,119,175, 49,248,183, 24, +103, 52, 71,161, 20, 44,227, 41, 3, 50,254,127,231,202,188, 1, 71,146, 25,218,154,147,241,222, 51,157,181,203,131, 56,168,178, +151, 64, 50,234, 38, 57, 21,160,225, 69, 23,172, 34,240,111,227,226,202, 46,214,242,211,151, 63,159, 49, 2,201, 19,231,129,179, + 70,234,200,131, 40, 74, 62,157, 64, 98, 25,247,232,217,124,234,137,217,176,171,212,162, 39, 83,188, 34, 39,120, 46, 72, 52, 94, +102, 31, 77,185, 71,242,218,150, 82,153, 12,155,134,197, 84, 85, 70,173,214, 15,221,191, 42, 47,251,250,240,209,158,146, 6, 1, +234, 14, 43,251, 76, 37, 37, 83,243, 45,124,209,216, 81, 81, 90,104,173,116, 5,166, 18, 27, 19, 98,154, 54,183,245, 93,107,207, +126,104,237,208,127,141,133, 62, 96,246,145,227,250,207, 17,181,227,181, 28,238, 5,239, 80,225,106,147,200,221, 65,210,176, 71, + 37,217,224,167,172,130,208,163,183,147,149,140,238,132,133,118,116, 47,157,199,166,211,228,166,196,110,233,153, 97, 10,128, 11, +128, 21,168, 21,233,144, 52,104, 43,186,241, 57,223, 2,176,118,126,173, 13,194, 80, 20,207, 73, 20,103,149, 61,142, 61, 21,246, +178,126,255,207,209, 47,178,127, 48,104,215, 66,181,185,153,201, 77, 52, 70,109, 75,183, 62, 72,161, 80,131,232,207,220,147,220, +115,254,196,247,187,175,190,185,237,111,111,180,157,198, 68,159,153,229,251,101,195,232,126, 73,122,106,108,144, 80, 94, 92,138, +203,241,191, 71,239, 3, 68, 76,149,138,125,193,131,178,129, 8,253, 18,188, 37, 80,174, 20, 54, 43,245, 90, 23, 47,117,150,229, +234,171, 53, 31,173,126, 59,209,246,253, 71, 58, 94,219,213, 78,110,172,117, 71, 95,214, 89,127, 19,228, 82, 60, 61,202,170,196, +169, 53,187,163,249, 62, 72,235, 37,175,124, 67,144, 32,208,112, 53,192, 41, 19,238, 65, 85, 94,194,179,170,125, 46,154,124, 79, + 7,151, 39,192,193,143,220,207,201,209, 7,112, 69,159,234, 3, 42,227, 47, 85, 86,119,136,223,209,103, 40,216,221,208,228,168, +208, 71, 18,141, 29,186, 49, 19,184,107, 19,156,193,121,236, 52,128,135,198,158,189,227,136,165, 65, 73,160,228, 44,137,212, 51, +215,244, 56,119, 63, 72,220, 67,246,116,250,125,237, 86, 95,192, 61, 82, 39,154, 9,235,251, 24,232, 9,229, 67, 23, 82, 84,194, +153, 52,126, 47,146, 80, 68, 10,247, 51, 22, 30, 56, 51,161,188,152,207, 61, 31, 73, 97,179,112, 23,215, 82,179,177, 16, 93,245, + 95,159,204,177,126,204,119, 56,139, 24,139,120,133, 14,238, 15,202, 78,103,138,194,166,156,137,231,106, 93,162, 60, 54,123,210, + 77,199,119,109,197, 25,235, 1,169,181,230, 70,224,179,155, 75,132, 64, 70,234,219,155, 29,229,133, 30,212, 24, 46, 46, 13, 71, +170,194, 23, 52,241,164, 4,209,226, 12,239,144,225,119,128,223, 45, 27,114, 52,251,233, 27,130,107, 5,133,241,219, 30,215, 95, + 1, 88,187,182,220, 4, 98, 24,152, 9,137,208, 86, 69,170,170,222,255, 98,189, 0, 55,128,118,147,184, 49,137, 67, 94, 68,173, +138,248, 0, 62,176, 22, 99, 38, 94,219, 51,102,124,231, 91,149,165,222,244, 19,241,253,255, 75,114,241, 23,124, 31,106,154,191, +177,143, 14,226,219, 39, 96,118, 8,141, 90,132,186,253,156, 16,210,146,245,156,191,247, 16,175,147,138, 36, 98, 72, 89,168, 35, + 83,162, 85, 18, 75, 40,218, 66,169, 59,159,192, 61, 80, 89,190, 30, 99,145,142,134,231,192,226, 95,250,197,224,109, 59,124,188, +218,104,233,243, 76,187, 43,122,129,232,252, 36,223, 52,207,108,221, 34,199,120,135,107,184,236, 34, 52,224,171,228, 61,111, 28, +110, 96, 29, 2,250,102,139,143, 3,118,186, 8,195, 41,144,234,189,112,159, 23,204,188,242, 9,184, 7,209,172, 37,106, 22,185, +169, 62, 49,173,243,197,135,192,218,106,206,212,138,164,171,218,187,158, 75,193, 96, 81,157,239,222,209,208,108, 24, 38,190,241, + 56,152,177,198,250, 38, 56,111,231, 53, 38,102,168,189,128,226,117,181, 4,247, 14,148,231, 87,136,170, 21,129,246,236,174,185, + 75,106, 9,238,106,192,110,122, 82, 18,201,113,172,173,103, 9,176,213,233,160,153, 71, 16, 42, 93,147,196, 65,165,244,130,201, + 71, 58, 70, 52,239,215,230,219,103,109, 55,123, 58,153,247,111,119,117,238,203,251, 61,164,129,119, 30, 84, 99, 61, 0, 86, 17, +200,221, 35,170,221, 46,123, 86,242, 58,189,112,119, 47, 21, 22,152,252,146,144,206,170,174, 20, 55,115, 65,166,150,232, 64, 79, +121,128,212,106,178,217,148,209,255, 8, 48, 0, 40,178, 7, 34,138,237,230,163, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130, }; -- cgit v1.2.3 From 72205f45e4e4dfd14460d693ccda30f7677ae9be Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 30 May 2009 00:28:33 +0000 Subject: NLA SoC: Basic Strip drawing Implemented some basic strip-drawing code with some hardcoded colours. These colours will be made into theme colours at some point, but the aim is to use different colours as indicators of the 'state' of the strip (i.e. active/being tweaked, uses the same action as the strip being tweaked, selected, normal). This is not yet usable though... --- source/blender/editors/space_nla/nla_draw.c | 138 ++++++++++++++++++++++++++ source/blender/editors/space_nla/nla_intern.h | 1 + source/blender/editors/space_nla/nla_ops.c | 121 ++++++++++++++++++++++ source/blender/editors/space_nla/space_nla.c | 2 +- source/blender/makesdna/DNA_anim_types.h | 2 + 5 files changed, 263 insertions(+), 1 deletion(-) create mode 100644 source/blender/editors/space_nla/nla_ops.c (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 8b8ae7c5b8b..8da59ced436 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -83,6 +83,144 @@ extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad); /* *********************************************** */ +/* Strips */ + +static void nla_draw_strip (NlaTrack *nlt, NlaStrip *strip, View2D *v2d, float yminc, float ymaxc) +{ + /* draw extrapolation info first (as backdrop) */ + // TODO... + + /* draw 'inside' of strip itself */ + /* set color of strip - color is used to indicate status here */ + if (strip->flag & NLASTRIP_FLAG_ACTIVE) { + /* tweaking strip should be drawn green when it is acting as the tweaking strip */ + // FIXME: hardcoded temp-hack colors + glColor3f(0.3f, 0.95f, 0.1f); + } + else if (strip->flag & NLASTRIP_FLAG_TWEAKUSER) { + /* alert user that this strip is also used by the tweaking track (this is set when going into + * 'editmode' for that strip), since the edits made here may not be what the user anticipated + */ + // FIXME: hardcoded temp-hack colors + glColor3f(0.85f, 0.0f, 0.0f); + } + else if (strip->flag & NLASTRIP_FLAG_SELECT) { + /* selected strip - use theme color for selected */ + UI_ThemeColor(TH_STRIP_SELECT); + } + else { + /* normal, unselected strip - use standard strip theme color */ + UI_ThemeColor(TH_STRIP); + } + uiSetRoundBox(15); /* all corners rounded */ + gl_round_box(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 9); + + /* draw strip outline */ + if (strip->flag & NLASTRIP_FLAG_ACTIVE) { + /* strip should appear 'sunken', so draw a light border around it */ + glColor3f(0.9f, 1.0f, 0.9f); // FIXME: hardcoded temp-hack colors + } + else { + /* strip should appear to stand out, so draw a dark border around it */ + glColor3f(0.0f, 0.0f, 0.0f); + } + gl_round_box(GL_LINES, strip->start, yminc, strip->end, ymaxc, 9); +} + +/* ---------------------- */ + +void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) +{ + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + View2D *v2d= &ar->v2d; + float y= 0.0f; + int items, height; + + /* build list of channels to draw */ + filter= (ANIMFILTER_VISIBLE|ANIMFILTER_CHANNELS); + items= ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); + + /* Update max-extent of channels here (taking into account scrollers): + * - this is done to allow the channel list to be scrollable, but must be done here + * to avoid regenerating the list again and/or also because channels list is drawn first + * - offset of NLACHANNEL_HEIGHT*2 is added to the height of the channels, as first is for + * start of list offset, and the second is as a correction for the scrollers. + */ + height= ((items*NLACHANNEL_STEP) + (NLACHANNEL_HEIGHT*2)); + if (height > (v2d->mask.ymax - v2d->mask.ymin)) { + /* don't use totrect set, as the width stays the same + * (NOTE: this is ok here, the configuration is pretty straightforward) + */ + v2d->tot.ymax= (float)(height); + } + + /* loop through channels, and set up drawing depending on their type */ + y= (float)(-NLACHANNEL_FIRST); + + for (ale= anim_data.first; ale; ale= ale->next) { + const float yminc= (float)(y - NLACHANNEL_HEIGHT_HALF); + const float ymaxc= (float)(y + NLACHANNEL_HEIGHT_HALF); + + /* check if visible */ + if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) || + IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) ) + { + /* data to draw depends on the type of channel */ + switch (ale->type) { + case ANIMTYPE_NLATRACK: + { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip; + + /* draw backdrop? */ + // TODO... + + /* draw each strip in the track */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + /* only draw if at least part of the strip is within view */ + if ( IN_RANGE(v2d->cur.xmin, strip->start, strip->end) || + IN_RANGE(v2d->cur.xmax, strip->start, strip->end) ) + { + nla_draw_strip(nlt, strip, v2d, yminc, ymaxc); + } + } + } + break; + + case ANIMTYPE_NLAACTION: + { + /* just draw a semi-shaded rect spanning the width of the viewable area if there's data */ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + + if (ale->data) + glColor4f(0.8f, 0.2f, 0.0f, 0.4f); // reddish color - hardcoded for now + else + glColor4f(0.6f, 0.5f, 0.5f, 0.3f); // greyish-red color - hardcoded for now + + glBegin(GL_QUADS); + glVertex2f(v2d->cur.xmin, yminc); + glVertex2f(v2d->cur.xmin, ymaxc); + glVertex2f(v2d->cur.xmax, ymaxc); + glVertex2f(v2d->cur.xmax, yminc); + glEnd(); + + glDisable(GL_BLEND); + } + break; + } + } + + /* adjust y-position for next one */ + y += NLACHANNEL_STEP; + } + + /* free tempolary channels */ + BLI_freelistN(&anim_data); +} /* *********************************************** */ /* Channel List */ diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 4d013db8be9..3728ba2cbc8 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -49,6 +49,7 @@ /* **************************************** */ /* nla_draw.c */ +void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *ar); void draw_nla_channel_list(bAnimContext *ac, SpaceNla *snla, ARegion *ar); /* **************************************** */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c new file mode 100644 index 00000000000..f0e3bd5bca5 --- /dev/null +++ b/source/blender/editors/space_nla/nla_ops.c @@ -0,0 +1,121 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation, Joshua Leung + * All rights reserved. + * + * + * Contributor(s): Joshua Leung (major recode) + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "DNA_anim_types.h" +#include "DNA_action_types.h" +#include "DNA_nla_types.h" +#include "DNA_object_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_windowmanager_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" +#include "BLI_rand.h" + +#include "BKE_animsys.h" +#include "BKE_nla.h" +#include "BKE_context.h" +#include "BKE_report.h" +#include "BKE_screen.h" + +#include "ED_anim_api.h" +#include "ED_space_api.h" +#include "ED_screen.h" + +#include "BIF_gl.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "ED_markers.h" + +#include "nla_intern.h" // own include + + +/* ************************** registration - operator types **********************************/ + +void nla_operatortypes(void) +{ + //WM_operatortype_append(); + +} + +/* ************************** registration - keymaps **********************************/ + +static void nla_keymap_channels (wmWindowManager *wm, ListBase *keymap) +{ + //wmKeymapItem *kmi; + + + + /* transform system */ + //transform_keymap_for_space(wm, keymap, SPACE_NLA); +} + +static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) +{ + //wmKeymapItem *kmi; + + + + /* transform system */ + //transform_keymap_for_space(wm, keymap, SPACE_NLA); +} + +/* --------------- */ + +void nla_keymap(wmWindowManager *wm) +{ + ListBase *keymap; + + /* channels */ + /* Channels are not directly handled by the NLA Editor module, but are inherited from the Animation module. + * Most of the relevant operations, keymaps, drawing, etc. can therefore all be found in that module instead, as there + * are many similarities with the other Animation Editors. + * + * However, those operations which involve clicking on channels and/or the placement of them in the view are implemented here instead + */ + keymap= WM_keymap_listbase(wm, "NLA_Channels", SPACE_NLA, 0); + nla_keymap_channels(wm, keymap); + + /* data */ + keymap= WM_keymap_listbase(wm, "NLA_Data", SPACE_NLA, 0); + nla_keymap_main(wm, keymap); +} + diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 39888162a95..bf122227a8b 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -246,7 +246,7 @@ static void nla_main_area_draw(const bContext *C, ARegion *ar) /* data */ if (ANIM_animdata_get_context(C, &ac)) { - //draw_channel_strips(&ac, saction, ar); + draw_nla_main_data(&ac, snla, ar); } /* current frame */ diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index b20ec7ba37f..fe535b671f8 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -444,6 +444,8 @@ enum { NLASTRIP_FLAG_SELECT = (1<<1), // NLASTRIP_FLAG_SELECT_L = (1<<2), // left handle selected // NLASTRIP_FLAG_SELECT_R = (1<<3), // right handle selected + /* NLA strip uses the same action that the action being tweaked uses (not set for the twaking one though) */ + NLASTRIP_FLAG_TWEAKUSER = (1<<4), /* controls driven by local F-Curves */ /* strip influence is controlled by local F-Curve */ -- cgit v1.2.3 From 32d0533f78c63d5d95b693e1e6e65144203dc42a Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 30 May 2009 10:41:41 +0000 Subject: NLA SoC: More UI work + 'Push down' tool 'UI Work' * Added more drawing code for drawing NLA data * Made the operators for the 'channel-list' of NLA work. A special version of borderselect for the NLA channel-list (due to the different vertical order) still needs to be coded though. 'Push Down' tool The active action of each AnimData block, represented by the reddy/orange channel, can be added to the NLA stack as a new action by using the 'snow-flake' icon/button (probably need a special icon for this later). This will add a new NLA track and an NLA strip referencing this action. The AnimData block's 'active action' slot will then be left empty. (Unfortunately, there still seems to be a bug here, which I'll check on later) --- source/blender/editors/animation/anim_channels.c | 12 + source/blender/editors/space_nla/nla_channels.c | 336 +++++++++++++++++++++++ source/blender/editors/space_nla/nla_draw.c | 28 +- source/blender/editors/space_nla/nla_edit.c | 7 +- source/blender/editors/space_nla/nla_intern.h | 17 ++ source/blender/editors/space_nla/nla_ops.c | 44 ++- source/blender/editors/space_nla/space_nla.c | 17 +- 7 files changed, 431 insertions(+), 30 deletions(-) create mode 100644 source/blender/editors/space_nla/nla_channels.c (limited to 'source') diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index 9e0e50a8de5..a5f2acb591c 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -217,6 +217,10 @@ void ANIM_deselect_anim_channels (void *data, short datatype, short test, short if (ale->flag & FCURVE_SELECTED) sel= ACHANNEL_SETFLAG_CLEAR; break; + case ANIMTYPE_NLATRACK: + if (ale->flag & NLATRACK_SELECTED) + sel= ACHANNEL_SETFLAG_CLEAR; + break; } } } @@ -263,6 +267,14 @@ void ANIM_deselect_anim_channels (void *data, short datatype, short test, short fcu->flag &= ~FCURVE_ACTIVE; } break; + case ANIMTYPE_NLATRACK: + { + NlaTrack *nlt= (NlaTrack *)ale->data; + + ACHANNEL_SET_FLAG(nlt, sel, NLATRACK_SELECTED); + nlt->flag &= ~NLATRACK_ACTIVE; + } + break; } } diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c new file mode 100644 index 00000000000..658ce69cc10 --- /dev/null +++ b/source/blender/editors/space_nla/nla_channels.c @@ -0,0 +1,336 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation, Joshua Leung + * All rights reserved. + * + * + * Contributor(s): Joshua Leung (major recode) + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include +#include +#include + +#include "DNA_listBase.h" +#include "DNA_anim_types.h" +#include "DNA_action_types.h" +#include "DNA_armature_types.h" +#include "DNA_camera_types.h" +#include "DNA_curve_types.h" +#include "DNA_object_types.h" +#include "DNA_screen_types.h" +#include "DNA_scene_types.h" +#include "DNA_space_types.h" +#include "DNA_key_types.h" +#include "DNA_lamp_types.h" +#include "DNA_material_types.h" +#include "DNA_userdef_types.h" +#include "DNA_windowmanager_types.h" +#include "DNA_world_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" +#include "BLI_rand.h" + +#include "BKE_animsys.h" +#include "BKE_nla.h" +#include "BKE_context.h" +#include "BKE_screen.h" +#include "BKE_utildefines.h" + +#include "ED_anim_api.h" +#include "ED_keyframes_edit.h" +#include "ED_markers.h" +#include "ED_space_api.h" +#include "ED_screen.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "UI_interface.h" +#include "UI_interface_icons.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "nla_intern.h" // own include + +/* *********************************************** */ +/* Operators for NLA channels-list which need to be different from the standard Animation Editor ones */ + +// TODO: implemented borderselect too, since that also relies on ranges of buttons + +/* ******************** Mouse-Click Operator *********************** */ +/* Depending on the channel that was clicked on, the mouse click will activate whichever + * part of the channel is relevant. + * + * NOTE: eventually, this should probably be phased out when many of these things are replaced with buttons + */ + +static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, short selectmode) +{ + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + /* get the channel that was clicked on */ + /* filter channels */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS); + filter= ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); + + /* get channel from index */ + ale= BLI_findlink(&anim_data, channel_index); + if (ale == NULL) { + /* channel not found */ + printf("Error: animation channel (index = %d) not found in mouse_anim_channels() \n", channel_index); + + BLI_freelistN(&anim_data); + return; + } + + /* action to take depends on what channel we've got */ + switch (ale->type) { + case ANIMTYPE_SCENE: + { + Scene *sce= (Scene *)ale->data; + + if (x < 16) { + /* toggle expand */ + sce->flag ^= SCE_DS_COLLAPSED; + } + else { + /* set selection status */ + if (selectmode == SELECT_INVERT) { + /* swap select */ + sce->flag ^= SCE_DS_SELECTED; + } + else { + sce->flag |= SCE_DS_SELECTED; + } + } + } + break; + case ANIMTYPE_OBJECT: + { + bDopeSheet *ads= (bDopeSheet *)ac->data; + Scene *sce= (Scene *)ads->source; + Base *base= (Base *)ale->data; + Object *ob= base->object; + + if (x < 16) { + /* toggle expand */ + ob->nlaflag ^= OB_ADS_COLLAPSED; // XXX + } + else { + /* set selection status */ + if (selectmode == SELECT_INVERT) { + /* swap select */ + base->flag ^= SELECT; + ob->flag= base->flag; + } + else { + Base *b; + + /* deleselect all */ + for (b= sce->base.first; b; b= b->next) { + b->flag &= ~SELECT; + b->object->flag= b->flag; + } + + /* select object now */ + base->flag |= SELECT; + ob->flag |= SELECT; + } + + /* xxx should be ED_base_object_activate(), but we need context pointer for that... */ + //set_active_base(base); + } + } + break; + case ANIMTYPE_FILLMATD: + { + Object *ob= (Object *)ale->data; + ob->nlaflag ^= OB_ADS_SHOWMATS; // XXX + } + break; + + case ANIMTYPE_DSMAT: + { + Material *ma= (Material *)ale->data; + ma->flag ^= MA_DS_EXPAND; + } + break; + case ANIMTYPE_DSLAM: + { + Lamp *la= (Lamp *)ale->data; + la->flag ^= LA_DS_EXPAND; + } + break; + case ANIMTYPE_DSCAM: + { + Camera *ca= (Camera *)ale->data; + ca->flag ^= CAM_DS_EXPAND; + } + break; + case ANIMTYPE_DSCUR: + { + Curve *cu= (Curve *)ale->data; + cu->flag ^= CU_DS_EXPAND; + } + break; + case ANIMTYPE_DSSKEY: + { + Key *key= (Key *)ale->data; + key->flag ^= KEYBLOCK_DS_EXPAND; + } + break; + case ANIMTYPE_DSWOR: + { + World *wo= (World *)ale->data; + wo->flag ^= WO_DS_EXPAND; + } + break; + + case ANIMTYPE_NLATRACK: + { + NlaTrack *nlt= (NlaTrack *)ale->data; + + if (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) { + /* toggle protection (only if there's a toggle there) */ + nlt->flag ^= NLATRACK_PROTECTED; + } + else if (x >= (NLACHANNEL_NAMEWIDTH-2*NLACHANNEL_BUTTON_WIDTH)) { + /* toggle mute */ + nlt->flag ^= NLATRACK_MUTED; + } + else { + /* set selection */ + if (selectmode == SELECT_INVERT) { + /* inverse selection status of this F-Curve only */ + nlt->flag ^= NLATRACK_SELECTED; + } + else { + /* select F-Curve by itself */ + ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR); + nlt->flag |= NLATRACK_SELECTED; + } + + /* if NLA-Track is selected now, make NLA-Track the 'active' one in the visible list */ + if (nlt->flag & NLATRACK_SELECTED) + ANIM_set_active_channel(ac->data, ac->datatype, filter, nlt, ANIMTYPE_NLATRACK); + } + } + break; + case ANIMTYPE_NLAACTION: + { + AnimData *adt= BKE_animdata_from_id(ale->owner); /* this won't crash, right? */ + + /* for now, only do something if user clicks on the 'push-down' button */ + if (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) { + /* activate push-down operator */ + // TODO: make this use the operator instead of calling the function directly + // however, calling the operator requires that we supply the args, and that works with proper buttons only + BKE_nla_action_pushdown(adt); + } + } + break; + + default: + printf("Error: Invalid channel type in mouse_nla_channels() \n"); + } + + /* free channels */ + BLI_freelistN(&anim_data); +} + +/* ------------------- */ + +/* handle clicking */ +static int nlachannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + bAnimContext ac; + Scene *scene; + ARegion *ar; + View2D *v2d; + int mval[2], channel_index; + short selectmode; + float x, y; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get useful pointers from animation context data */ + scene= ac.scene; + ar= ac.ar; + v2d= &ar->v2d; + + /* get mouse coordinates (in region coordinates) */ + mval[0]= (event->x - ar->winrct.xmin); + mval[1]= (event->y - ar->winrct.ymin); + + /* select mode is either replace (deselect all, then add) or add/extend */ + if (RNA_boolean_get(op->ptr, "extend")) + selectmode= SELECT_INVERT; + else + selectmode= SELECT_REPLACE; + + /* figure out which channel user clicked in + * Note: although channels technically start at y= ACHANNEL_FIRST, we need to adjust by half a channel's height + * so that the tops of channels get caught ok. Since NLACHANNEL_FIRST is really NLACHANNEL_HEIGHT, we simply use + * NLACHANNEL_HEIGHT_HALF. + */ + UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y); + UI_view2d_listview_view_to_cell(v2d, NLACHANNEL_NAMEWIDTH, NLACHANNEL_STEP, 0, (float)NLACHANNEL_HEIGHT_HALF, x, y, NULL, &channel_index); + + /* handle mouse-click in the relevant channel then */ + mouse_nla_channels(&ac, x, channel_index, selectmode); + + /* set notifier tha things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_CHANNELS); + + return OPERATOR_FINISHED; +} + +void NLA_OT_channels_click (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Mouse Click on Channels"; + ot->idname= "NLA_OT_channels_click"; + + /* api callbacks */ + ot->invoke= nlachannels_mouseclick_invoke; + ot->poll= ED_operator_areaactive; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* id-props */ + RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", ""); // SHIFTKEY +} + +/* *********************************************** */ diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 8da59ced436..081064317d6 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -85,8 +85,10 @@ extern void gl_round_box(int mode, float minx, float miny, float maxx, float max /* *********************************************** */ /* Strips */ -static void nla_draw_strip (NlaTrack *nlt, NlaStrip *strip, View2D *v2d, float yminc, float ymaxc) +static void nla_draw_strip (NlaTrack *nlt, NlaStrip *strip, int index, View2D *v2d, float yminc, float ymaxc) { + char name[128]; + /* draw extrapolation info first (as backdrop) */ // TODO... @@ -125,6 +127,15 @@ static void nla_draw_strip (NlaTrack *nlt, NlaStrip *strip, View2D *v2d, float y glColor3f(0.0f, 0.0f, 0.0f); } gl_round_box(GL_LINES, strip->start, yminc, strip->end, ymaxc, 9); + + /* draw some identifying info on the strip (index and name of action if there's room) */ + // XXX for now, just the index + if (strip->flag & NLASTRIP_FLAG_SELECT) + UI_ThemeColor(TH_TEXT_HI); + else + UI_ThemeColor(TH_TEXT); + sprintf(name, "%d |", index); + UI_DrawString(strip->start, yminc+8, name); } /* ---------------------- */ @@ -174,17 +185,18 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) { NlaTrack *nlt= (NlaTrack *)ale->data; NlaStrip *strip; + int index; /* draw backdrop? */ // TODO... /* draw each strip in the track */ - for (strip= nlt->strips.first; strip; strip= strip->next) { + for (strip=nlt->strips.first, index=1; strip; strip= strip->next, index++) { /* only draw if at least part of the strip is within view */ if ( IN_RANGE(v2d->cur.xmin, strip->start, strip->end) || IN_RANGE(v2d->cur.xmax, strip->start, strip->end) ) { - nla_draw_strip(nlt, strip, v2d, yminc, ymaxc); + nla_draw_strip(nlt, strip, index, v2d, yminc, ymaxc); } } } @@ -601,6 +613,16 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) /* draw action 'push-down' */ if (ale->type == ANIMTYPE_NLAACTION) { offset += 16; + + /* XXX firstly draw a little rect to help identify that it's different from the toggles */ + glBegin(GL_LINES); + glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y-7); + glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y+7); + glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y-7; + glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y+7); + glEnd(); // GL_LINES + + /* now draw the icon */ UI_icon_draw((float)NLACHANNEL_NAMEWIDTH-offset, ydatac, ICON_FREEZE); } diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index d9d0e5528ae..ce9ae7de7a9 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -51,10 +51,12 @@ #include "BKE_screen.h" #include "ED_anim_api.h" +#include "ED_markers.h" #include "ED_space_api.h" #include "ED_screen.h" -#include "BIF_gl.h" +#include "RNA_access.h" +#include "RNA_define.h" #include "WM_api.h" #include "WM_types.h" @@ -63,13 +65,10 @@ #include "UI_resources.h" #include "UI_view2d.h" -#include "ED_markers.h" - #include "nla_intern.h" // own include /* *********************************************** */ - /* *********************************************** */ /* *********************************************** */ diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 3728ba2cbc8..37eb7774696 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -57,6 +57,23 @@ void draw_nla_channel_list(bAnimContext *ac, SpaceNla *snla, ARegion *ar); void nla_header_buttons(const bContext *C, ARegion *ar); +/* **************************************** */ +/* nla_select.c */ + + +/* **************************************** */ +/* nla_edit.c */ + +/* **************************************** */ +/* nla_channels.c */ + +void NLA_OT_channels_click(wmOperatorType *ot); + +/* **************************************** */ +/* nla_ops.c */ + +void nla_operatortypes(void); +void nla_keymap(wmWindowManager *wm); #endif /* ED_NLA_INTERN_H */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index f0e3bd5bca5..ea450a08475 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -54,17 +54,15 @@ #include "ED_space_api.h" #include "ED_screen.h" -#include "BIF_gl.h" - #include "WM_api.h" #include "WM_types.h" +#include "RNA_access.h" + #include "UI_interface.h" #include "UI_resources.h" #include "UI_view2d.h" -#include "ED_markers.h" - #include "nla_intern.h" // own include @@ -72,20 +70,46 @@ void nla_operatortypes(void) { - //WM_operatortype_append(); + /* channels */ + WM_operatortype_append(NLA_OT_channels_click); + /* select */ + // ... } /* ************************** registration - keymaps **********************************/ static void nla_keymap_channels (wmWindowManager *wm, ListBase *keymap) { - //wmKeymapItem *kmi; + /* NLA-specific (different to standard channels keymap) -------------------------- */ + /* selection */ + /* click-select */ + // XXX for now, only leftmouse.... + WM_keymap_add_item(keymap, "NLA_OT_channels_click", LEFTMOUSE, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "NLA_OT_channels_click", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", 1); + /* General Animation Channels keymap (see anim_channels.c) ----------------------- */ + /* deselect all */ + WM_keymap_add_item(keymap, "ANIM_OT_channels_select_all_toggle", AKEY, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); + /* borderselect */ + WM_keymap_add_item(keymap, "ANIM_OT_channels_select_border", BKEY, KM_PRESS, 0, 0); - /* transform system */ - //transform_keymap_for_space(wm, keymap, SPACE_NLA); + /* settings */ + WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_toggle", WKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); + WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_disable", WKEY, KM_PRESS, KM_ALT, 0); + + /* settings - specialised hotkeys */ + WM_keymap_add_item(keymap, "ANIM_OT_channels_editable_toggle", TABKEY, KM_PRESS, 0, 0); + + /* expand/collapse */ + WM_keymap_add_item(keymap, "ANIM_OT_channels_expand", PADPLUSKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "ANIM_OT_channels_collapse", PADMINUS, KM_PRESS, 0, 0); + + RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_expand", PADPLUSKEY, KM_PRESS, KM_CTRL, 0)->ptr, "all", 1); + RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_collapse", PADMINUS, KM_PRESS, KM_CTRL, 0)->ptr, "all", 1); } static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) @@ -111,11 +135,11 @@ void nla_keymap(wmWindowManager *wm) * * However, those operations which involve clicking on channels and/or the placement of them in the view are implemented here instead */ - keymap= WM_keymap_listbase(wm, "NLA_Channels", SPACE_NLA, 0); + keymap= WM_keymap_listbase(wm, "NLA Channels", SPACE_NLA, 0); nla_keymap_channels(wm, keymap); /* data */ - keymap= WM_keymap_listbase(wm, "NLA_Data", SPACE_NLA, 0); + keymap= WM_keymap_listbase(wm, "NLA Data", SPACE_NLA, 0); nla_keymap_main(wm, keymap); } diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index bf122227a8b..1313b4d915d 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -167,14 +167,14 @@ static SpaceLink *nla_duplicate(SpaceLink *sl) /* add handlers, stuff you only do once or on area/region changes */ static void nla_channel_area_init(wmWindowManager *wm, ARegion *ar) { - //ListBase *keymap; + ListBase *keymap; UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STACK, ar->winx, ar->winy); /* own keymap */ // TODO: cannot use generic copy, need special NLA version - //keymap= WM_keymap_listbase(wm, "Animation_Channels", 0, 0); /* XXX weak? */ - //WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); + keymap= WM_keymap_listbase(wm, "NLA Channels", SPACE_NLA, 0); /* XXX weak? */ + WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } /* draw entirely, view changes should be handled here */ @@ -216,7 +216,7 @@ static void nla_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_listbase(wm, "NLA", SPACE_NLA, 0); /* XXX weak? */ + keymap= WM_keymap_listbase(wm, "NLA Data", SPACE_NLA, 0); /* XXX weak? */ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -271,15 +271,6 @@ static void nla_main_area_draw(const bContext *C, ARegion *ar) UI_view2d_scrollers_free(scrollers); } -void nla_operatortypes(void) -{ - -} - -void nla_keymap(struct wmWindowManager *wm) -{ - -} /* add handlers, stuff you only do once or on area/region changes */ static void nla_header_area_init(wmWindowManager *wm, ARegion *ar) -- cgit v1.2.3 From aa4d64d7ff17d4557acd74540914de872a32ba81 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 30 May 2009 11:05:29 +0000 Subject: NLA SoC: Bugfixes for previous commit * Compile fix in nla_draw.c * Not totally correct yet, but now NLA-tracks get drawn too after action 'push-down' --- source/blender/blenkernel/intern/nla.c | 11 +++- source/blender/editors/animation/anim_filter.c | 77 ++++++++++++-------------- source/blender/editors/space_nla/nla_draw.c | 2 +- 3 files changed, 46 insertions(+), 44 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index d062a2ab14b..3356f599c59 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -427,8 +427,10 @@ void BKE_nla_action_pushdown (AnimData *adt) * as that will cause us grief down the track */ // TODO: what about modifiers? - if (action_has_motion(adt->action) == 0) + if (action_has_motion(adt->action) == 0) { + printf("BKE_nla_action_pushdown(): action has no data \n"); return; + } /* add a new NLA track to house this action * - we could investigate trying to fit the action into an appropriately @@ -436,8 +438,10 @@ void BKE_nla_action_pushdown (AnimData *adt) * changes in blending behaviour... */ nlt= add_nlatrack(adt); - if (nlt == NULL) + if (nlt == NULL) { + printf("BKE_nla_action_pushdown(): no NLA-track added \n"); return; + } /* add a new NLA strip to the track, which references the active action */ strip= add_nlastrip(nlt, adt->action); @@ -448,6 +452,9 @@ void BKE_nla_action_pushdown (AnimData *adt) adt->action= NULL; } + // TEMP DEBUG... + printf("BKE_nla_action_pushdown(): NLA strip added.. done \n"); + // TODO: set any other flags necessary here... } diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index f12e9a51f32..f1f2a31b9b1 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1334,22 +1334,18 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int /* scene-linked animation */ // TODO: sequencer, composite nodes - are we to include those here too? { - short sceOk, worOk; + short sceOk= 0, worOk= 0; /* check filtering-flags if ok */ - if (ads->filterflag) { - if (ads->filterflag & ADS_FILTER_ONLYDRIVERS) { - sceOk= (ANIMDATA_HAS_DRIVERS(sce) && !(ads->filterflag & ADS_FILTER_NOSCE)); - worOk= ((sce->world) && ANIMDATA_HAS_DRIVERS(sce->world) && !(ads->filterflag & ADS_FILTER_NOWOR)); - } - else { - sceOk= (ANIMDATA_HAS_KEYS(sce) && !(ads->filterflag & ADS_FILTER_NOSCE)); - worOk= ((sce->world) && ANIMDATA_HAS_KEYS(sce->world) && !(ads->filterflag & ADS_FILTER_NOWOR)); - } - } - else { - sceOk= (ANIMDATA_HAS_KEYS(sce)); - worOk= ((sce->world) && ANIMDATA_HAS_KEYS(sce->world)); + ANIMDATA_FILTER_CASES(sce, + sceOk= !(ads->filterflag & ADS_FILTER_NOSCE);, + sceOk= !(ads->filterflag & ADS_FILTER_NOSCE);, + sceOk= !(ads->filterflag & ADS_FILTER_NOSCE);) + if (sce->world) { + ANIMDATA_FILTER_CASES(sce->world, + worOk= !(ads->filterflag & ADS_FILTER_NOWOR);, + worOk= !(ads->filterflag & ADS_FILTER_NOWOR);, + worOk= !(ads->filterflag & ADS_FILTER_NOWOR);) } /* check if not all bad (i.e. so there is something to show) */ @@ -1391,13 +1387,17 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int } /* check filters for datatypes */ - if (ads->filterflag & ADS_FILTER_ONLYDRIVERS) { - actOk= (ANIMDATA_HAS_DRIVERS(ob)); - keyOk= ((key) && ANIMDATA_HAS_DRIVERS(key) && !(ads->filterflag & ADS_FILTER_NOSHAPEKEYS)); - } - else { - actOk= ANIMDATA_HAS_KEYS(ob); - keyOk= ((key) && ANIMDATA_HAS_KEYS(key) && !(ads->filterflag & ADS_FILTER_NOSHAPEKEYS)); + /* object */ + ANIMDATA_FILTER_CASES(ob, + actOk= 1;, + actOk= 1;, + actOk= 1;) + if (key) { + /* shapekeys */ + ANIMDATA_FILTER_CASES(key, + keyOk= 1;, + keyOk= 1;, + keyOk= 1;) } /* materials - only for geometric types */ @@ -1412,18 +1412,13 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int Material *ma= give_current_material(ob, a); /* if material has relevant animation data, break */ - if (ads->filterflag & ADS_FILTER_ONLYDRIVERS) { - if (ANIMDATA_HAS_DRIVERS(ma)) { - matOk= 1; - break; - } - } - else { - if (ANIMDATA_HAS_KEYS(ma)) { - matOk= 1; - break; - } - } + ANIMDATA_FILTER_CASES(ma, + matOk= 1;, + matOk= 1;, + matOk= 1;) + + if (matOk) + break; } } @@ -1432,19 +1427,19 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int case OB_CAMERA: /* ------- Camera ------------ */ { Camera *ca= (Camera *)ob->data; - if (ads->filterflag & ADS_FILTER_ONLYDRIVERS) - dataOk= (ANIMDATA_HAS_DRIVERS(ca) && !(ads->filterflag & ADS_FILTER_NOCAM)); - else - dataOk= (ANIMDATA_HAS_KEYS(ca) && !(ads->filterflag & ADS_FILTER_NOCAM)); + ANIMDATA_FILTER_CASES(ca, + dataOk= !(ads->filterflag & ADS_FILTER_NOCAM);, + dataOk= !(ads->filterflag & ADS_FILTER_NOCAM);, + dataOk= !(ads->filterflag & ADS_FILTER_NOCAM);) } break; case OB_LAMP: /* ---------- Lamp ----------- */ { Lamp *la= (Lamp *)ob->data; - if (ads->filterflag & ADS_FILTER_ONLYDRIVERS) - dataOk= (ANIMDATA_HAS_DRIVERS(la) && !(ads->filterflag & ADS_FILTER_NOLAM)); - else - dataOk= (ANIMDATA_HAS_KEYS(la) && !(ads->filterflag & ADS_FILTER_NOLAM)); + ANIMDATA_FILTER_CASES(la, + dataOk= !(ads->filterflag & ADS_FILTER_NOLAM);, + dataOk= !(ads->filterflag & ADS_FILTER_NOLAM);, + dataOk= !(ads->filterflag & ADS_FILTER_NOLAM);) } break; default: /* --- other --- */ diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 081064317d6..8ff9522358c 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -618,7 +618,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) glBegin(GL_LINES); glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y-7); glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y+7); - glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y-7; + glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y-7); glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y+7); glEnd(); // GL_LINES -- cgit v1.2.3 From 2e85686fe379f99c27944e3e4b5842d89e620f3b Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 30 May 2009 12:40:07 +0000 Subject: NLA SoC: Fixes (UI, evaluation?) * Fixed some bugs which meant that NLA-strips weren't getting drawn * Removed some debugging code * Fixed bug with Action-line disappearing after 'pushing down' actions * Fixed bug where Objects with no animation data showed up in NLA * Tried fixing a bug where NLA-strips were evaluated erratically. I have a feeling that there are some rounding errors I'll need to pay more attention to somewhere :/ --- source/blender/blenkernel/intern/anim_sys.c | 6 +-- source/blender/blenkernel/intern/nla.c | 3 -- source/blender/editors/animation/anim_filter.c | 12 ++++- source/blender/editors/space_nla/nla_draw.c | 63 ++++++++++++++------------ 4 files changed, 47 insertions(+), 37 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index f21fed416cc..652f733d553 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -627,14 +627,14 @@ static float nlastrip_get_influence (NlaStrip *strip, float cframe) strip->blendout= (float)fabs(strip->blendout); /* result depends on where frame is in respect to blendin/out values */ - // TODO: are the fabs() tests needed here? + // the +0.0001 factors are to combat rounding errors if (IS_EQ(strip->blendin, 0)==0 && (cframe <= (strip->start + strip->blendin))) { /* there is some blend-in */ - return (float)fabs(cframe - strip->start) / (strip->blendin); + return (float)(fabs(cframe - strip->start) + 0.0001) / (strip->blendin); } else if (IS_EQ(strip->blendout, 0)==0 && (cframe >= (strip->end - strip->blendout))) { /* there is some blend-out */ - return (float)fabs(strip->end - cframe) / (strip->blendout); + return (float)(fabs(strip->end - cframe) + 0.0001) / (strip->blendout); } else { /* in the middle of the strip, we should be full strength */ diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 3356f599c59..62500af85ff 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -452,9 +452,6 @@ void BKE_nla_action_pushdown (AnimData *adt) adt->action= NULL; } - // TEMP DEBUG... - printf("BKE_nla_action_pushdown(): NLA strip added.. done \n"); - // TODO: set any other flags necessary here... } diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index f1f2a31b9b1..ed526bd99a0 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -722,8 +722,12 @@ static int animdata_filter_nla (ListBase *anim_data, AnimData *adt, int filter_m /* there isn't really anything editable here, so skip if need editable */ // TODO: currently, selection isn't checked since it doesn't matter if ((filter_mode & ANIMFILTER_FOREDIT) == 0) { - /* just add the action track now */ - ale= make_new_animlistelem(adt->action, ANIMTYPE_NLAACTION, owner, ownertype, owner_id); + /* just add the action track now (this MUST appear for drawing) + * - as AnimData may not have an action, we pass a dummy pointer just to get the list elem created, then + * overwrite this with the real value - REVIEW THIS... + */ + ale= make_new_animlistelem((void *)(&adt->action), ANIMTYPE_NLAACTION, owner, ownertype, owner_id); + ale->data= (adt->action) ? adt->action : NULL; if (ale) { BLI_addtail(anim_data, ale); @@ -1388,6 +1392,8 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int /* check filters for datatypes */ /* object */ + actOk= 0; + keyOk= 0; ANIMDATA_FILTER_CASES(ob, actOk= 1;, actOk= 1;, @@ -1427,6 +1433,7 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int case OB_CAMERA: /* ------- Camera ------------ */ { Camera *ca= (Camera *)ob->data; + dataOk= 0; ANIMDATA_FILTER_CASES(ca, dataOk= !(ads->filterflag & ADS_FILTER_NOCAM);, dataOk= !(ads->filterflag & ADS_FILTER_NOCAM);, @@ -1436,6 +1443,7 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int case OB_LAMP: /* ---------- Lamp ----------- */ { Lamp *la= (Lamp *)ob->data; + dataOk= 0; ANIMDATA_FILTER_CASES(la, dataOk= !(ads->filterflag & ADS_FILTER_NOLAM);, dataOk= !(ads->filterflag & ADS_FILTER_NOLAM);, diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 8ff9522358c..28572704302 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -81,14 +81,13 @@ /* XXX */ extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad); +extern void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown); /* *********************************************** */ /* Strips */ -static void nla_draw_strip (NlaTrack *nlt, NlaStrip *strip, int index, View2D *v2d, float yminc, float ymaxc) +static void nla_draw_strip (NlaTrack *nlt, NlaStrip *strip, View2D *v2d, float yminc, float ymaxc) { - char name[128]; - /* draw extrapolation info first (as backdrop) */ // TODO... @@ -115,7 +114,7 @@ static void nla_draw_strip (NlaTrack *nlt, NlaStrip *strip, int index, View2D *v UI_ThemeColor(TH_STRIP); } uiSetRoundBox(15); /* all corners rounded */ - gl_round_box(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 9); + gl_round_box_shade(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1); /* draw strip outline */ if (strip->flag & NLASTRIP_FLAG_ACTIVE) { @@ -126,16 +125,7 @@ static void nla_draw_strip (NlaTrack *nlt, NlaStrip *strip, int index, View2D *v /* strip should appear to stand out, so draw a dark border around it */ glColor3f(0.0f, 0.0f, 0.0f); } - gl_round_box(GL_LINES, strip->start, yminc, strip->end, ymaxc, 9); - - /* draw some identifying info on the strip (index and name of action if there's room) */ - // XXX for now, just the index - if (strip->flag & NLASTRIP_FLAG_SELECT) - UI_ThemeColor(TH_TEXT_HI); - else - UI_ThemeColor(TH_TEXT); - sprintf(name, "%d |", index); - UI_DrawString(strip->start, yminc+8, name); + gl_round_box_shade(GL_LINE_LOOP, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1); } /* ---------------------- */ @@ -147,6 +137,7 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) int filter; View2D *v2d= &ar->v2d; + float viewWidth = v2d->cur.xmax - v2d->cur.xmin; float y= 0.0f; int items, height; @@ -185,19 +176,33 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) { NlaTrack *nlt= (NlaTrack *)ale->data; NlaStrip *strip; - int index; /* draw backdrop? */ // TODO... /* draw each strip in the track */ - for (strip=nlt->strips.first, index=1; strip; strip= strip->next, index++) { - /* only draw if at least part of the strip is within view */ - if ( IN_RANGE(v2d->cur.xmin, strip->start, strip->end) || - IN_RANGE(v2d->cur.xmax, strip->start, strip->end) ) + for (strip=nlt->strips.first; strip; strip= strip->next) { + float stripLen= strip->end - strip->start; + + /* only draw if at least part of the strip is within view + * - first 2 cases cover when the strip length is less than the viewable area + * - second 2 cases cover when the strip length is greater than the viewable area + */ + if ( (stripLen < viewWidth) && + !(IN_RANGE(strip->start, v2d->cur.xmin, v2d->cur.xmax) || + IN_RANGE(strip->end, v2d->cur.xmin, v2d->cur.xmax)) ) { - nla_draw_strip(nlt, strip, index, v2d, yminc, ymaxc); + continue; } + if ( (stripLen > viewWidth) && + !(IN_RANGE(v2d->cur.xmin, strip->start, strip->end) || + IN_RANGE(v2d->cur.xmax, strip->start, strip->end)) ) + { + continue; + } + + /* we're still here, so ok... */ + nla_draw_strip(nlt, strip, v2d, yminc, ymaxc); } } break; @@ -521,7 +526,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) /* object channel - darker */ UI_ThemeColor(TH_DOPESHEET_CHANNELOB); uiSetRoundBox((expand == ICON_TRIA_UP)? (8):(1|8)); - gl_round_box(GL_POLYGON, x+offset, yminc, (float)NLACHANNEL_NAMEWIDTH, ymaxc, 8); + gl_round_box(GL_POLYGON, x+offset, yminc, (float)NLACHANNEL_NAMEWIDTH, ymaxc, 10); } else { /* sub-object folders - lighter */ @@ -547,7 +552,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) glColor3f(0.6f, 0.5f, 0.5f); // greyish-red color - hardcoded for now offset += 7 * indent; - uiSetRoundBox(15); + uiSetRoundBox((1|2)); // only on top two corners, to show that this channel sits on top of the preceeding ones gl_round_box(GL_POLYGON, x+offset, yminc, (float)NLACHANNEL_NAMEWIDTH, ymaxc, 8); /* clear group value, otherwise we cause errors... */ @@ -610,16 +615,16 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) UI_icon_draw((float)(NLACHANNEL_NAMEWIDTH-offset), ydatac, mute); } - /* draw action 'push-down' */ - if (ale->type == ANIMTYPE_NLAACTION) { + /* draw action 'push-down' - only for NLA-Action lines, and only when there's an action */ + if ((ale->type == ANIMTYPE_NLAACTION) && (ale->data)) { offset += 16; /* XXX firstly draw a little rect to help identify that it's different from the toggles */ - glBegin(GL_LINES); - glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y-7); - glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y+7); - glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y-7); - glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y+7); + glBegin(GL_LINE_LOOP); + glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y-8); + glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y+8); + glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y-8); + glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y+8); glEnd(); // GL_LINES /* now draw the icon */ -- cgit v1.2.3 From c42eeddea491d6a79dbcc0b8b28386237085643d Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 31 May 2009 04:52:20 +0000 Subject: NLA SoC: Bugfixes + Improvements to 'Push Down' track-selection * Trying to save no longer crashes in some cases when the NLA Editor was open with some data. The sanity check added in filesel.c might be able to be backported to 2.5? (Elubie, please check) * NLA-track names now get drawn with the correct colours for identifying themselves as being selected or not selected. * Now the 'push down' functionality for actions will try to add the new strip to the last NLA track, provided it has space in the range required. * When new strips are added, they will only be allowed to extrapolate before/after if they are the first (time-wise) strip for the set of NLA data per AnimData block. This stops layered strips overriding strips that occurred in earlier tracks at earlier times. --- source/blender/blenkernel/BKE_nla.h | 3 +- source/blender/blenkernel/intern/nla.c | 156 +++++++++++++++++------ source/blender/editors/animation/anim_channels.c | 14 ++ source/blender/editors/space_file/filesel.c | 3 + source/blender/editors/space_nla/nla_draw.c | 11 +- 5 files changed, 142 insertions(+), 45 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 49796250633..ededd77a92f 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -46,8 +46,9 @@ struct NlaStrip *copy_nlastrip(struct NlaStrip *strip); struct NlaTrack *copy_nlatrack(struct NlaTrack *nlt); void copy_nladata(ListBase *dst, ListBase *src); -struct NlaStrip *add_nlastrip(struct NlaTrack *nlt, struct bAction *act); struct NlaTrack *add_nlatrack(struct AnimData *adt); +struct NlaStrip *add_nlastrip(struct bAction *act); +struct NlaStrip *add_nlastrip_to_stack(struct AnimData *adt, struct bAction *act); /* ----------------------------- */ /* API */ diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 62500af85ff..3efa823f9fe 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -215,19 +215,45 @@ void copy_nladata (ListBase *dst, ListBase *src) /* Adding ------------------------------------------- */ -/* Add a NLA Strip referencing the given Action, to the given NLA Track */ -// TODO: any extra parameters to control how this is done? -NlaStrip *add_nlastrip (NlaTrack *nlt, bAction *act) +/* Add a NLA Track to the given AnimData */ +NlaTrack *add_nlatrack (AnimData *adt) +{ + NlaTrack *nlt; + + /* sanity checks */ + if (adt == NULL) + return NULL; + + /* allocate new track */ + nlt= MEM_callocN(sizeof(NlaTrack), "NlaTrack"); + + /* set settings requiring the track to not be part of the stack yet */ + nlt->flag = NLATRACK_SELECTED; + nlt->index= BLI_countlist(&adt->nla_tracks); + + /* add track to stack, and make it the active one */ + BLI_addtail(&adt->nla_tracks, nlt); + BKE_nlatrack_set_active(&adt->nla_tracks, nlt); + + /* must have unique name, but we need to seed this */ + sprintf(nlt->name, "NlaTrack"); + BLI_uniquename(&adt->nla_tracks, nlt, "NlaTrack", '.', offsetof(NlaTrack, name), 64); + + /* return the new track */ + return nlt; +} + +/* Add a NLA Strip referencing the given Action */ +NlaStrip *add_nlastrip (bAction *act) { NlaStrip *strip; /* sanity checks */ - if ELEM(NULL, nlt, act) + if (act == NULL) return NULL; /* allocate new strip */ strip= MEM_callocN(sizeof(NlaStrip), "NlaStrip"); - BLI_addtail(&nlt->strips, strip); /* generic settings * - selected flag to highlight this to the user @@ -259,32 +285,54 @@ NlaStrip *add_nlastrip (NlaTrack *nlt, bAction *act) return strip; } -/* Add a NLA Track to the given AnimData */ -NlaTrack *add_nlatrack (AnimData *adt) +/* Add new NLA-strip to the top of the NLA stack - i.e. into the last track if space, or a new one otherwise */ +NlaStrip *add_nlastrip_to_stack (AnimData *adt, bAction *act) { + NlaStrip *strip, *ns; NlaTrack *nlt; + short not_added = 1; /* sanity checks */ - if (adt == NULL) + if ELEM(NULL, adt, act) return NULL; - - /* allocate new track */ - nlt= MEM_callocN(sizeof(NlaTrack), "NlaTrack"); - /* set settings requiring the track to not be part of the stack yet */ - nlt->flag = NLATRACK_SELECTED; - nlt->index= BLI_countlist(&adt->nla_tracks); + /* create a new NLA strip */ + strip= add_nlastrip(act); + if (strip == NULL) + return NULL; - /* add track to stack, and make it the active one */ - BLI_addtail(&adt->nla_tracks, nlt); - BKE_nlatrack_set_active(&adt->nla_tracks, nlt); + /* check if the last NLA-track (if it exists) has any space for this strip: + * - if so, add this strip to that track + */ + if ( (adt->nla_tracks.last == NULL) || + (BKE_nlatrack_has_space(adt->nla_tracks.last, strip->start, strip->end)==0) ) + { + /* no space, so add to a new track... */ + nlt= add_nlatrack(adt); + } + else + { + /* there's some space, so add to this track... */ + nlt= adt->nla_tracks.last; + } - /* must have unique name, but we need to seed this */ - sprintf(nlt->name, "NlaTrack"); - BLI_uniquename(&adt->nla_tracks, nlt, "NlaTrack", '.', offsetof(NlaTrack, name), 64); + /* find the right place to add the strip to the nominated track */ + for (ns= nlt->strips.first; ns; ns= ns->next) { + /* if current strip occurs after the new strip, add it before */ + if (ns->start > strip->end) { + BLI_insertlinkbefore(&nlt->strips, ns, strip); + not_added= 0; + break; + } + } + if (not_added) { + /* just add to the end of the list of the strips then... */ + BLI_addtail(&nlt->strips, strip); + } - /* return the new track */ - return nlt; + + /* returns the strip added */ + return strip; } /* *************************************************** */ @@ -404,7 +452,39 @@ void BKE_nlatrack_sort_strips (NlaTrack *nlt) nlt->strips.first= tmp.first; nlt->strips.last= tmp.last; } - + +/* NLA Strips -------------------------------------- */ + +/* Is the given NLA-strip the first one to occur for the given AnimData block */ +// TODO: make this an api method if necesary, but need to add prefix first +short nlastrip_is_first (AnimData *adt, NlaStrip *strip) +{ + NlaTrack *nlt; + NlaStrip *ns; + + /* sanity checks */ + if ELEM(NULL, adt, strip) + return 0; + + /* check if strip has any strips before it */ + if (strip->prev) + return 0; + + /* check other tracks to see if they have a strip that's earlier */ + // TODO: or should we check that the strip's track is also the first? + for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { + /* only check the first strip, assuming that they're all in order */ + ns= nlt->strips.first; + if (ns) { + if (ns->start < strip->start) + return 0; + } + } + + /* should be first now */ + return 1; +} + /* Tools ------------------------------------------- */ /* For the given AnimData block, add the active action to the NLA @@ -415,7 +495,6 @@ void BKE_nlatrack_sort_strips (NlaTrack *nlt) // TODO: maybe we should have checks for this too... void BKE_nla_action_pushdown (AnimData *adt) { - NlaTrack *nlt; NlaStrip *strip; /* sanity checks */ @@ -431,28 +510,27 @@ void BKE_nla_action_pushdown (AnimData *adt) printf("BKE_nla_action_pushdown(): action has no data \n"); return; } - - /* add a new NLA track to house this action - * - we could investigate trying to fit the action into an appropriately - * sized gap in the existing tracks, however, this may result in unexpected - * changes in blending behaviour... - */ - nlt= add_nlatrack(adt); - if (nlt == NULL) { - printf("BKE_nla_action_pushdown(): no NLA-track added \n"); - return; - } /* add a new NLA strip to the track, which references the active action */ - strip= add_nlastrip(nlt, adt->action); + strip= add_nlastrip_to_stack(adt, adt->action); - /* clear reference to action now that we've pushed it onto the stack */ + /* do other necessary work on strip */ if (strip) { + /* clear reference to action now that we've pushed it onto the stack */ adt->action->id.us--; adt->action= NULL; + + /* if the strip is the first one in the track it lives in, check if there + * are strips in any other tracks that may be before this, and set the extend + * mode accordingly + */ + if (nlastrip_is_first(adt, strip) == 0) { + /* not first, so extend mode can only be NLASTRIP_EXTEND_HOLD_FORWARD not NLASTRIP_EXTEND_HOLD, + * so that it doesn't override strips in previous tracks + */ + strip->extendmode= NLASTRIP_EXTEND_HOLD_FORWARD; + } } - - // TODO: set any other flags necessary here... } /* *************************************************** */ diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index a5f2acb591c..5d5be87801b 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -149,6 +149,13 @@ void ANIM_set_active_channel (void *data, short datatype, int filter, void *chan ACHANNEL_SET_FLAG(fcu, ACHANNEL_SETFLAG_CLEAR, FCURVE_ACTIVE); } break; + case ANIMTYPE_NLATRACK: + { + NlaTrack *nlt= (NlaTrack *)ale->data; + + ACHANNEL_SET_FLAG(nlt, ACHANNEL_SETFLAG_CLEAR, NLATRACK_ACTIVE); + } + break; } } @@ -167,6 +174,13 @@ void ANIM_set_active_channel (void *data, short datatype, int filter, void *chan fcu->flag |= FCURVE_ACTIVE; } break; + case ANIMTYPE_NLATRACK: + { + NlaTrack *nlt= (NlaTrack *)channel_data; + + ACHANNEL_SET_FLAG(nlt, ACHANNEL_SETFLAG_CLEAR, NLATRACK_ACTIVE); + } + break; } } diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index cbd1457e562..091319cd402 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -144,6 +144,9 @@ int ED_fileselect_layout_offset(FileLayout* layout, int x, int y) int offsetx, offsety; int active_file; + if (layout == NULL) + return NULL; + offsetx = (x)/(layout->tile_w + 2*layout->tile_border_x); offsety = (y)/(layout->tile_h + 2*layout->tile_border_y); diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 28572704302..1a289d8436b 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -296,7 +296,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) indent= 0; special= ICON_SCENE_DATA; - + /* only show expand if there are any channels */ if (EXPANDED_SCEC(sce)) expand= ICON_TRIA_UP; @@ -484,6 +484,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) else protect = ICON_LOCKED; + sel = SEL_NLT(nlt); strcpy(name, nlt->name); } break; @@ -621,10 +622,10 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) /* XXX firstly draw a little rect to help identify that it's different from the toggles */ glBegin(GL_LINE_LOOP); - glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y-8); - glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y+8); - glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y-8); - glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y+8); + glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y-7); + glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y+9); + glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y+9); + glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y-7); glEnd(); // GL_LINES /* now draw the icon */ -- cgit v1.2.3 From 33267f58581ea8f9d89028958c6e64a8d048d4db Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 31 May 2009 11:14:50 +0000 Subject: NLA SoC: Basic selection operators * Added click-select/left-right select and deselect all/invert all selection operators. For now, these basic operators will suffice (more advanced selection operators will be coded at a later stage). * Fixed a few bugs in DopeSheet found while coding the relevant tools for NLA. * Added custom border-select operator for NLA channels (since the standard one assumes negative direction channel order) * Added new API-method for NLA strips to check if the strip occurs within a given range, since this test needed to be performed in a few places... * Tweaked the NLA Editor View2D ranges a bit to give saner default sizing. This still isn't right yet though. --- source/blender/blenkernel/BKE_nla.h | 2 + source/blender/blenkernel/intern/nla.c | 31 ++ source/blender/editors/animation/anim_channels.c | 26 -- source/blender/editors/include/ED_anim_api.h | 27 +- .../blender/editors/space_action/action_select.c | 3 +- source/blender/editors/space_nla/nla_channels.c | 110 +++++- source/blender/editors/space_nla/nla_draw.c | 26 +- source/blender/editors/space_nla/nla_intern.h | 17 +- source/blender/editors/space_nla/nla_ops.c | 23 +- source/blender/editors/space_nla/nla_select.c | 440 +++++++++++++++++++++ source/blender/editors/space_nla/space_nla.c | 4 +- 11 files changed, 648 insertions(+), 61 deletions(-) create mode 100644 source/blender/editors/space_nla/nla_select.c (limited to 'source') diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index ededd77a92f..3c3abe11da3 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -59,6 +59,8 @@ void BKE_nlatrack_set_active(ListBase *tracks, struct NlaTrack *nlt); short BKE_nlatrack_has_space(struct NlaTrack *nlt, float start, float end); void BKE_nlatrack_sort_strips(struct NlaTrack *nlt); +short BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max); + void BKE_nla_action_pushdown(struct AnimData *adt); #endif diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 3efa823f9fe..cf115cb6faf 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -455,6 +455,37 @@ void BKE_nlatrack_sort_strips (NlaTrack *nlt) /* NLA Strips -------------------------------------- */ +/* Does the given NLA-strip fall within the given bounds (times)? */ +short BKE_nlastrip_within_bounds (NlaStrip *strip, float min, float max) +{ + const float stripLen= (strip) ? strip->end - strip->start : 0.0f; + const float boundsLen= (float)fabs(max - min); + + /* sanity checks */ + if ((strip == NULL) || IS_EQ(stripLen, 0.0f) || IS_EQ(boundsLen, 0.0f)) + return 0; + + /* only ok if at least part of the strip is within the bounding window + * - first 2 cases cover when the strip length is less than the bounding area + * - second 2 cases cover when the strip length is greater than the bounding area + */ + if ( (stripLen < boundsLen) && + !(IN_RANGE(strip->start, min, max) || + IN_RANGE(strip->end, min, max)) ) + { + return 0; + } + if ( (stripLen > boundsLen) && + !(IN_RANGE(min, strip->start, strip->end) || + IN_RANGE(max, strip->start, strip->end)) ) + { + return 0; + } + + /* should be ok! */ + return 1; +} + /* Is the given NLA-strip the first one to occur for the given AnimData block */ // TODO: make this an api method if necesary, but need to add prefix first short nlastrip_is_first (AnimData *adt, NlaStrip *strip) diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index 5d5be87801b..658bff73978 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -87,32 +87,6 @@ /* ************************************************************************** */ /* CHANNELS API */ -/* -------------------------- Internal Macros ------------------------------- */ - -/* set/clear/toggle macro - * - channel - channel with a 'flag' member that we're setting - * - smode - 0=clear, 1=set, 2=toggle - * - sflag - bitflag to set - */ -#define ACHANNEL_SET_FLAG(channel, smode, sflag) \ - { \ - if (smode == ACHANNEL_SETFLAG_TOGGLE) (channel)->flag ^= (sflag); \ - else if (smode == ACHANNEL_SETFLAG_ADD) (channel)->flag |= (sflag); \ - else (channel)->flag &= ~(sflag); \ - } - -/* set/clear/toggle macro, where the flag is negative - * - channel - channel with a 'flag' member that we're setting - * - smode - 0=clear, 1=set, 2=toggle - * - sflag - bitflag to set - */ -#define ACHANNEL_SET_FLAG_NEG(channel, smode, sflag) \ - { \ - if (smode == ACHANNEL_SETFLAG_TOGGLE) (channel)->flag ^= (sflag); \ - else if (smode == ACHANNEL_SETFLAG_ADD) (channel)->flag &= ~(sflag); \ - else (channel)->flag |= (sflag); \ - } - /* -------------------------- Exposed API ----------------------------------- */ /* Set the given animation-channel as the active one for the active context */ diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 7629fc29352..cdd8b5c368c 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -317,10 +317,35 @@ void ANIM_nla_mapping_draw(struct gla2DDrawInfo *di, struct Object *ob, short re /* Apply/Unapply NLA mapping to all keyframes in the nominated IPO block */ void ANIM_nla_mapping_apply_fcurve(struct Object *ob, struct FCurve *fcu, short restore, short only_keys); -/* ------------- xxx macros ----------------------- */ +/* ------------- Utility macros ----------------------- */ +/* checks if the given BezTriple is selected */ #define BEZSELECTED(bezt) ((bezt->f2 & SELECT) || (bezt->f1 & SELECT) || (bezt->f3 & SELECT)) +/* set/clear/toggle macro + * - channel - channel with a 'flag' member that we're setting + * - smode - 0=clear, 1=set, 2=toggle + * - sflag - bitflag to set + */ +#define ACHANNEL_SET_FLAG(channel, smode, sflag) \ + { \ + if (smode == ACHANNEL_SETFLAG_TOGGLE) (channel)->flag ^= (sflag); \ + else if (smode == ACHANNEL_SETFLAG_ADD) (channel)->flag |= (sflag); \ + else (channel)->flag &= ~(sflag); \ + } + +/* set/clear/toggle macro, where the flag is negative + * - channel - channel with a 'flag' member that we're setting + * - smode - 0=clear, 1=set, 2=toggle + * - sflag - bitflag to set + */ +#define ACHANNEL_SET_FLAG_NEG(channel, smode, sflag) \ + { \ + if (smode == ACHANNEL_SETFLAG_TOGGLE) (channel)->flag ^= (sflag); \ + else if (smode == ACHANNEL_SETFLAG_ADD) (channel)->flag &= ~(sflag); \ + else (channel)->flag |= (sflag); \ + } + /* --------- anim_deps.c, animation updates -------- */ diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index d4782418be7..f64cd0f707c 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -174,7 +174,7 @@ static int actkeys_deselectall_exec(bContext *C, wmOperator *op) deselect_action_keys(&ac, 1, SELECT_ADD); /* set notifier that things have changed */ - ED_area_tag_redraw(CTX_wm_area(C)); // FIXME... should be updating 'keyframes' data context or so instead! + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); return OPERATOR_FINISHED; } @@ -766,6 +766,7 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short select_mode, if (ale == NULL) { /* channel not found */ printf("Error: animation channel (index = %d) not found in mouse_action_keys() \n", channel_index); + BLI_freelistN(&anim_data); return; } else { diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 658ce69cc10..a839ccbf3d6 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -82,7 +82,115 @@ /* *********************************************** */ /* Operators for NLA channels-list which need to be different from the standard Animation Editor ones */ -// TODO: implemented borderselect too, since that also relies on ranges of buttons +/* ******************** Borderselect Operator *********************** */ + +static void borderselect_nla_channels (bAnimContext *ac, rcti *rect, short selectmode) +{ + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + View2D *v2d= &ac->ar->v2d; + rctf rectf; + float ymin=(float)(-NLACHANNEL_HEIGHT), ymax=0; + + /* convert border-region to view coordinates */ + UI_view2d_region_to_view(v2d, rect->xmin, rect->ymin+2, &rectf.xmin, &rectf.ymin); + UI_view2d_region_to_view(v2d, rect->xmax, rect->ymax-2, &rectf.xmax, &rectf.ymax); + + /* filter data */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS); + ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); + + /* loop over data, doing border select */ + for (ale= anim_data.first; ale; ale= ale->next) { + ymax= ymin + NLACHANNEL_STEP; + + /* if channel is within border-select region, alter it */ + if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))) { + /* only the following types can be selected */ + switch (ale->type) { + case ANIMTYPE_OBJECT: /* object */ + { + Base *base= (Base *)ale->data; + Object *ob= base->object; + + ACHANNEL_SET_FLAG(base, selectmode, SELECT); + ACHANNEL_SET_FLAG(ob, selectmode, SELECT); + } + break; + case ANIMTYPE_NLATRACK: /* nla-track */ + { + NlaTrack *nlt= (NlaTrack *)ale->data; + + ACHANNEL_SET_FLAG(nlt, selectmode, NLATRACK_SELECTED); + } + break; + } + } + + /* set maximum extent to be the minimum of the next channel */ + ymin= ymax; + } + + /* cleanup */ + BLI_freelistN(&anim_data); +} + +/* ------------------- */ + +static int nlachannels_borderselect_exec(bContext *C, wmOperator *op) +{ + bAnimContext ac; + rcti rect; + short selectmode=0; + int event; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get settings from operator */ + rect.xmin= RNA_int_get(op->ptr, "xmin"); + rect.ymin= RNA_int_get(op->ptr, "ymin"); + rect.xmax= RNA_int_get(op->ptr, "xmax"); + rect.ymax= RNA_int_get(op->ptr, "ymax"); + + event= RNA_int_get(op->ptr, "event_type"); + if (event == LEFTMOUSE) // FIXME... hardcoded + selectmode = ACHANNEL_SETFLAG_ADD; + else + selectmode = ACHANNEL_SETFLAG_CLEAR; + + /* apply borderselect animation channels */ + borderselect_nla_channels(&ac, &rect, selectmode); + + return OPERATOR_FINISHED; +} + +void NLA_OT_channels_select_border(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Border Select"; + ot->idname= "NLA_OT_channels_select_border"; + + /* api callbacks */ + ot->invoke= WM_border_select_invoke; + ot->exec= nlachannels_borderselect_exec; + ot->modal= WM_border_select_modal; + + ot->poll= ED_operator_areaactive; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* rna */ + RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); +} /* ******************** Mouse-Click Operator *********************** */ /* Depending on the channel that was clicked on, the mouse click will activate whichever diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 1a289d8436b..def49021160 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -137,7 +137,6 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) int filter; View2D *v2d= &ar->v2d; - float viewWidth = v2d->cur.xmax - v2d->cur.xmin; float y= 0.0f; int items, height; @@ -180,29 +179,10 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) /* draw backdrop? */ // TODO... - /* draw each strip in the track */ + /* draw each strip in the track (if visible) */ for (strip=nlt->strips.first; strip; strip= strip->next) { - float stripLen= strip->end - strip->start; - - /* only draw if at least part of the strip is within view - * - first 2 cases cover when the strip length is less than the viewable area - * - second 2 cases cover when the strip length is greater than the viewable area - */ - if ( (stripLen < viewWidth) && - !(IN_RANGE(strip->start, v2d->cur.xmin, v2d->cur.xmax) || - IN_RANGE(strip->end, v2d->cur.xmin, v2d->cur.xmax)) ) - { - continue; - } - if ( (stripLen > viewWidth) && - !(IN_RANGE(v2d->cur.xmin, strip->start, strip->end) || - IN_RANGE(v2d->cur.xmax, strip->start, strip->end)) ) - { - continue; - } - - /* we're still here, so ok... */ - nla_draw_strip(nlt, strip, v2d, yminc, ymaxc); + if (BKE_nlastrip_within_bounds(strip, v2d->cur.xmin, v2d->cur.xmax)) + nla_draw_strip(nlt, strip, v2d, yminc, ymaxc); } } break; diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 37eb7774696..448b823bd4b 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -17,11 +17,11 @@ * 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) 2008 Blender Foundation. + * The Original Code is Copyright (C) 2009 Blender Foundation, Joshua Leung. * All rights reserved. * * - * Contributor(s): Blender Foundation + * Contributor(s): Blender Foundation, Joshua Leung * * ***** END GPL LICENSE BLOCK ***** */ @@ -60,6 +60,18 @@ void nla_header_buttons(const bContext *C, ARegion *ar); /* **************************************** */ /* nla_select.c */ +/* defines for left-right select tool */ +enum { + NLAEDIT_LRSEL_TEST = -1, + NLAEDIT_LRSEL_NONE, + NLAEDIT_LRSEL_LEFT, + NLAEDIT_LRSEL_RIGHT, +} eNlaEdit_LeftRightSelect_Mode; + +/* --- */ + +void NLAEDIT_OT_select_all_toggle(wmOperatorType *ot); +void NLAEDIT_OT_click_select(wmOperatorType *ot); /* **************************************** */ /* nla_edit.c */ @@ -67,6 +79,7 @@ void nla_header_buttons(const bContext *C, ARegion *ar); /* **************************************** */ /* nla_channels.c */ +void NLA_OT_channels_select_border(wmOperatorType *ot); void NLA_OT_channels_click(wmOperatorType *ot); /* **************************************** */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index ea450a08475..167686c99f9 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -72,9 +72,11 @@ void nla_operatortypes(void) { /* channels */ WM_operatortype_append(NLA_OT_channels_click); + WM_operatortype_append(NLA_OT_channels_select_border); /* select */ - // ... + WM_operatortype_append(NLAEDIT_OT_click_select); + WM_operatortype_append(NLAEDIT_OT_select_all_toggle); } /* ************************** registration - keymaps **********************************/ @@ -88,14 +90,14 @@ static void nla_keymap_channels (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "NLA_OT_channels_click", LEFTMOUSE, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "NLA_OT_channels_click", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", 1); + /* borderselect */ + WM_keymap_add_item(keymap, "NLA_OT_channels_select_border", BKEY, KM_PRESS, 0, 0); + /* General Animation Channels keymap (see anim_channels.c) ----------------------- */ /* deselect all */ WM_keymap_add_item(keymap, "ANIM_OT_channels_select_all_toggle", AKEY, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); - /* borderselect */ - WM_keymap_add_item(keymap, "ANIM_OT_channels_select_border", BKEY, KM_PRESS, 0, 0); - /* settings */ WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_toggle", WKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); @@ -114,8 +116,19 @@ static void nla_keymap_channels (wmWindowManager *wm, ListBase *keymap) static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) { - //wmKeymapItem *kmi; + wmKeymapItem *kmi; + /* selection */ + /* click select */ + WM_keymap_add_item(keymap, "NLAEDIT_OT_click_select", SELECTMOUSE, KM_PRESS, 0, 0); + kmi= WM_keymap_add_item(keymap, "NLAEDIT_OT_click_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(kmi->ptr, "extend", 1); + kmi= WM_keymap_add_item(keymap, "NLAEDIT_OT_click_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); + RNA_enum_set(kmi->ptr, "left_right", NLAEDIT_LRSEL_TEST); + + /* deselect all */ + WM_keymap_add_item(keymap, "NLAEDIT_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "NLAEDIT_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); /* transform system */ diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c new file mode 100644 index 00000000000..5d9fe5f2a05 --- /dev/null +++ b/source/blender/editors/space_nla/nla_select.c @@ -0,0 +1,440 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation, Joshua Leung + * All rights reserved. + * + * + * Contributor(s): Joshua Leung (major recode) + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "DNA_anim_types.h" +#include "DNA_action_types.h" +#include "DNA_nla_types.h" +#include "DNA_object_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_windowmanager_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" +#include "BLI_rand.h" + +#include "BKE_animsys.h" +#include "BKE_nla.h" +#include "BKE_context.h" +#include "BKE_report.h" +#include "BKE_screen.h" + +#include "ED_anim_api.h" +#include "ED_keyframes_edit.h" +#include "ED_markers.h" +#include "ED_space_api.h" +#include "ED_screen.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "nla_intern.h" // own include + +/* ******************** Utilities ***************************************** */ + +/* Convert SELECT_* flags to ACHANNEL_SETFLAG_* flags */ +static short selmodes_to_flagmodes (short sel) +{ + /* convert selection modes to selection modes */ + switch (sel) { + case SELECT_SUBTRACT: + return ACHANNEL_SETFLAG_CLEAR; + break; + + case SELECT_INVERT: + return ACHANNEL_SETFLAG_TOGGLE; + break; + + case SELECT_ADD: + default: + return ACHANNEL_SETFLAG_ADD; + break; + } +} + + +/* ******************** Deselect All Operator ***************************** */ +/* This operator works in one of three ways: + * 1) (de)select all (AKEY) - test if select all or deselect all + * 2) invert all (CTRL-IKEY) - invert selection of all keyframes + * 3) (de)select all - no testing is done; only for use internal tools as normal function... + */ + +/* Deselects strips in the NLA Editor + * - This is called by the deselect all operator, as well as other ones! + * + * - test: check if select or deselect all + * - sel: how to select keyframes + * 0 = deselect + * 1 = select + * 2 = invert + */ +static void deselect_nla_strips (bAnimContext *ac, short test, short sel) +{ + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + short smode; + + /* determine type-based settings - curvesonly eliminates all the unnecessary channels... */ + filter= (ANIMFILTER_VISIBLE|ANIMFILTER_CURVESONLY); + + /* filter data */ + ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); + + /* See if we should be selecting or deselecting */ + if (test) { + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip; + + /* if any strip is selected, break out, since we should now be deselecting */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + if (strip->flag & NLASTRIP_FLAG_SELECT) { + sel= SELECT_SUBTRACT; + break; + } + } + + if (sel == SELECT_SUBTRACT) + break; + } + } + + /* convert selection modes to selection modes */ + smode= selmodes_to_flagmodes(sel); + + /* Now set the flags */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip; + + /* apply same selection to all strips */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + /* set selection */ + ACHANNEL_SET_FLAG(strip, smode, NLASTRIP_FLAG_SELECT); + + /* clear active flag */ + strip->flag &= ~NLASTRIP_FLAG_ACTIVE; + } + } + + /* Cleanup */ + BLI_freelistN(&anim_data); +} + +/* ------------------- */ + +static int nlaedit_deselectall_exec(bContext *C, wmOperator *op) +{ + bAnimContext ac; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* 'standard' behaviour - check if selected, then apply relevant selection */ + if (RNA_boolean_get(op->ptr, "invert")) + deselect_nla_strips(&ac, 0, SELECT_INVERT); + else + deselect_nla_strips(&ac, 1, SELECT_ADD); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + + return OPERATOR_FINISHED; +} + +void NLAEDIT_OT_select_all_toggle (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Select All"; + ot->idname= "NLAEDIT_OT_select_all_toggle"; + + /* api callbacks */ + ot->exec= nlaedit_deselectall_exec; + ot->poll= ED_operator_areaactive; + + /* flags */ + ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/; + + /* props */ + RNA_def_boolean(ot->srna, "invert", 0, "Invert", ""); +} + +/* ******************** Mouse-Click Select Operator *********************** */ +/* This operator works in one of 2 ways: + * 1) Select the strip directly under the mouse + * 2) Select all the strips to one side of the mouse + */ + +/* defines for left-right select tool */ +static EnumPropertyItem prop_nlaedit_leftright_select_types[] = { + {NLAEDIT_LRSEL_TEST, "CHECK", "Check if Select Left or Right", ""}, + {NLAEDIT_LRSEL_NONE, "OFF", "Don't select", ""}, + {NLAEDIT_LRSEL_LEFT, "LEFT", "Before current frame", ""}, + {NLAEDIT_LRSEL_RIGHT, "RIGHT", "After current frame", ""}, + {0, NULL, NULL, NULL} +}; + +/* sensitivity factor for frame-selections */ +#define FRAME_CLICK_THRESH 0.1f + + +/* ------------------- */ + +/* option 1) select strip directly under mouse */ +static void mouse_nla_strips (bAnimContext *ac, int mval[2], short select_mode) +{ + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale = NULL; + int filter; + + View2D *v2d= &ac->ar->v2d; + NlaStrip *strip = NULL; + int channel_index; + float xmin, xmax, dummy; + float x, y; + + + /* use View2D to determine the index of the channel (i.e a row in the list) where keyframe was */ + UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y); + UI_view2d_listview_view_to_cell(v2d, 0, NLACHANNEL_STEP, 0, 0, x, y, NULL, &channel_index); + + /* x-range to check is +/- 7 (in screen/region-space) on either side of mouse click + * (that is the size of keyframe icons, so user should be expecting similar tolerances) + */ + UI_view2d_region_to_view(v2d, mval[0]-7, mval[1], &xmin, &dummy); + UI_view2d_region_to_view(v2d, mval[0]+7, mval[1], &xmax, &dummy); + + /* filter data */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS); + ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); + + /* try to get channel */ + ale= BLI_findlink(&anim_data, channel_index); + if (ale == NULL) { + /* channel not found */ + printf("Error: animation channel (index = %d) not found in mouse_nla_strips() \n", channel_index); + BLI_freelistN(&anim_data); + return; + } + else { + /* found some channel - we only really should do somethign when its an Nla-Track */ + if (ale->type == ANIMTYPE_NLATRACK) { + NlaTrack *nlt= (NlaTrack *)ale->data; + + /* loop over NLA-strips in this track, trying to find one which occurs in the necessary bounds */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + if (BKE_nlastrip_within_bounds(strip, xmin, xmax)) + break; + } + } + + /* remove active channel from list of channels for separate treatment (since it's needed later on) */ + BLI_remlink(&anim_data, ale); + + /* free list of channels, since it's not used anymore */ + BLI_freelistN(&anim_data); + } + + /* for replacing selection, firstly need to clear existing selection */ + if (select_mode == SELECT_REPLACE) { + /* reset selection mode for next steps */ + select_mode = SELECT_ADD; + + /* deselect all strips */ + deselect_nla_strips(ac, 0, SELECT_SUBTRACT); + + /* deselect all other channels first */ + ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR); + + /* Highlight NLA-Track */ + if (ale->type == ANIMTYPE_NLATRACK) { + NlaTrack *nlt= (NlaTrack *)ale->data; + + nlt->flag |= NLATRACK_SELECTED; + ANIM_set_active_channel(ac->data, ac->datatype, filter, nlt, ANIMTYPE_NLATRACK); + } + } + + /* only select strip if we clicked on a valid channel and hit something */ + if (ale) { + /* select the strip accordingly (if a matching one was found) */ + if (strip) { + select_mode= selmodes_to_flagmodes(select_mode); + ACHANNEL_SET_FLAG(strip, select_mode, NLASTRIP_FLAG_SELECT); + } + + /* free this channel */ + MEM_freeN(ale); + } +} + +/* Option 2) Selects all the strips on either side of the current frame (depends on which side the mouse is on) */ +static void nlaedit_mselect_leftright (bAnimContext *ac, short leftright, short select_mode) +{ + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + Scene *scene= ac->scene; + float xmin, xmax; + + /* if select mode is replace, deselect all keyframes (and channels) first */ + if (select_mode==SELECT_REPLACE) { + select_mode= SELECT_ADD; + + /* deselect all other channels and keyframes */ + ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR); + deselect_nla_strips(ac, 0, SELECT_SUBTRACT); + } + + /* get range, and get the right flag-setting mode */ + if (leftright == NLAEDIT_LRSEL_LEFT) { + xmin = -MAXFRAMEF; + xmax = (float)(CFRA + FRAME_CLICK_THRESH); + } + else { + xmin = (float)(CFRA - FRAME_CLICK_THRESH); + xmax = MAXFRAMEF; + } + + select_mode= selmodes_to_flagmodes(select_mode); + + + /* filter data */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); + ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); + + /* select strips on the side where most data occurs */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip; + + /* check each strip to see if it is appropriate */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + if (BKE_nlastrip_within_bounds(strip, xmin, xmax)) { + ACHANNEL_SET_FLAG(strip, select_mode, NLASTRIP_FLAG_SELECT); + } + } + } + + /* Cleanup */ + BLI_freelistN(&anim_data); +} + +/* ------------------- */ + +/* handle clicking */ +static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + bAnimContext ac; + Scene *scene; + ARegion *ar; + View2D *v2d; + short selectmode; + int mval[2]; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get useful pointers from animation context data */ + scene= ac.scene; + ar= ac.ar; + v2d= &ar->v2d; + + /* get mouse coordinates (in region coordinates) */ + mval[0]= (event->x - ar->winrct.xmin); + mval[1]= (event->y - ar->winrct.ymin); + + /* select mode is either replace (deselect all, then add) or add/extend */ + if (RNA_boolean_get(op->ptr, "extend")) + selectmode= SELECT_INVERT; + else + selectmode= SELECT_REPLACE; + + /* figure out action to take */ + if (RNA_enum_get(op->ptr, "left_right")) { + /* select all keys on same side of current frame as mouse */ + float x; + + UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, NULL); + if (x < CFRA) + RNA_int_set(op->ptr, "left_right", NLAEDIT_LRSEL_LEFT); + else + RNA_int_set(op->ptr, "left_right", NLAEDIT_LRSEL_RIGHT); + + nlaedit_mselect_leftright(&ac, RNA_enum_get(op->ptr, "left_right"), selectmode); + } + else { + /* select strips based upon mouse position */ + mouse_nla_strips(&ac, mval, selectmode); + } + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + + /* for tweak grab to work */ + return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; +} + +void NLAEDIT_OT_click_select (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Mouse Select"; + ot->idname= "NLAEDIT_OT_click_select"; + + /* api callbacks - absolutely no exec() this yet... */ + ot->invoke= nlaedit_clickselect_invoke; + ot->poll= ED_operator_areaactive; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* id-props */ + // XXX should we make this into separate operators? + RNA_def_enum(ot->srna, "left_right", prop_nlaedit_leftright_select_types, 0, "Left Right", ""); // CTRLKEY + RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", ""); // SHIFTKEY +} + +/* *********************************************** */ diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 1313b4d915d..024b23c51b8 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -105,12 +105,12 @@ static SpaceLink *nla_new(const bContext *C) ar->v2d.tot.xmin= 1.0f; ar->v2d.tot.ymin= 0.0f; ar->v2d.tot.xmax= 1000.0f; - ar->v2d.tot.ymax= 1000.0f; + ar->v2d.tot.ymax= 500.0f; ar->v2d.cur.xmin= -5.0f; ar->v2d.cur.ymin= 0.0f; ar->v2d.cur.xmax= 65.0f; - ar->v2d.cur.ymax= 1000.0f; + ar->v2d.cur.ymax= 250.0f; ar->v2d.min[0]= 0.0f; ar->v2d.min[1]= 0.0f; -- cgit v1.2.3 From 011d91624ee0f0ced5462995faec16b2e6f44142 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 31 May 2009 11:22:11 +0000 Subject: AO render error, caused by bugfix after RC3 :( My bug fix to support AO with "Amb" texture channel changed code too that calls AO as a pre-shade process, when texture isn't calculated yet. This caused very first pixel in a tile to show wrong AO. Especially myself deserves a kick in butt for not testing the regression files for release binaries again! Error shows clearly... in the cornelius_passes .blend file. --- source/blender/render/intern/source/shadeoutput.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 869cca0f7d0..130cda9f107 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -1005,11 +1005,12 @@ static void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec) } /* pure AO, check for raytrace and world should have been done */ +/* preprocess, textures were not done, don't use shi->amb for that reason */ void ambient_occlusion(ShadeInput *shi) { - if((R.wrld.ao_gather_method == WO_AOGATHER_APPROX) && shi->amb!=0.0f) + if((R.wrld.ao_gather_method == WO_AOGATHER_APPROX) && shi->mat->amb!=0.0f) sample_occ(&R, shi); - else if((R.r.mode & R_RAYTRACE) && shi->amb!=0.0f) + else if((R.r.mode & R_RAYTRACE) && shi->mat->amb!=0.0f) ray_ao(shi, shi->ao); else shi->ao[0]= shi->ao[1]= shi->ao[2]= 1.0f; -- cgit v1.2.3 From 8deca3ecfce2b6727cde281374c26c39a472f685 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 31 May 2009 14:54:31 +0000 Subject: BGE: fix refcount bug causing crash with Object texture coordinates. --- source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index bc2d718203b..30057fc039d 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -715,8 +715,6 @@ void KX_BlenderMaterial::setObjectMatrixData(int i, RAS_IRasterizer *ras) if(!obj) return; - obj->Release(); - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR ); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR ); glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR ); -- cgit v1.2.3 From 8e882d0d6118d39d5533eff2d196be4bca4be889 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 31 May 2009 17:44:38 +0000 Subject: Bug in KX_GameObject.get() and ListValue.get(), wasn't checking if the CValue derived objects could be converted to a PyObject. so where foo is an int prop, gameOb.get("foo") == 0, would end up returning a CValue int proxy. This is more a problem for KX_GameObject since ListValues with python access mostly don't contain ints, strings, floats. This also wont break games from 2.48 since the .get() function wasn't available. --- source/gameengine/Expressions/ListValue.cpp | 19 ++++++++++++++----- source/gameengine/Ketsji/KX_GameObject.cpp | 9 +++++++-- 2 files changed, 21 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index c741a6d8809..a0d73c75d60 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -77,8 +77,13 @@ PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex) if (PyString_Check(pyindex)) { CValue *item = ((CListValue*) list)->FindValue(PyString_AsString(pyindex)); - if (item) - return item->GetProxy(); + if (item) { + PyObject* pyobj = item->ConvertValueToPython(); + if(pyobj) + return pyobj; + else + return item->GetProxy(); + } } else if (PyInt_Check(pyindex)) { @@ -575,9 +580,13 @@ PyObject* CListValue::Pyget(PyObject *args) return NULL; CValue *item = FindValue((const char *)key); - if (item) - return item->GetProxy(); - + if (item) { + PyObject* pyobj = item->ConvertValueToPython(); + if (pyobj) + return pyobj; + else + return item->GetProxy(); + } Py_INCREF(def); return def; } diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 04b1276569e..7f417b325c8 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -2758,8 +2758,13 @@ PyObject* KX_GameObject::Pyget(PyObject *args) if(PyString_Check(key)) { CValue *item = GetProperty(PyString_AsString(key)); - if (item) - return item->GetProxy(); + if (item) { + ret = item->ConvertValueToPython(); + if(ret) + return ret; + else + return item->GetProxy(); + } } if (m_attr_dict && (ret=PyDict_GetItem(m_attr_dict, key))) { -- cgit v1.2.3 From ae565b9bb39bf3fd6c87f3f3e145f4004e19a44b Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 31 May 2009 17:59:57 +0000 Subject: == Sequencer == This fixes: IPO pinning on sequencer strips was lost during Undo. --- source/blender/blenloader/intern/readfile.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index a99cb86f86b..596910ea5ae 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4091,12 +4091,14 @@ void lib_link_screen_restore(Main *newmain, Scene *curscene) } else if(sl->spacetype==SPACE_IPO) { SpaceIpo *sipo= (SpaceIpo *)sl; - - if(sipo->blocktype==ID_SEQ) sipo->from= NULL; // no libdata - else sipo->from= restore_pointer_by_name(newmain, (ID *)sipo->from, 0); + + sipo->ipo= restore_pointer_by_name(newmain, (ID *)sipo->ipo, 0); + if(sipo->blocktype==ID_SEQ) + sipo->from= find_sequence_from_ipo_helper(newmain, sipo->ipo); + else + sipo->from= restore_pointer_by_name(newmain, (ID *)sipo->from, 0); // not free sipo->ipokey, creates dependency with src/ - sipo->ipo= restore_pointer_by_name(newmain, (ID *)sipo->ipo, 0); if(sipo->editipo) MEM_freeN(sipo->editipo); sipo->editipo= NULL; } -- cgit v1.2.3 From e415fa27b019c1b00bdb443dbf39491de941aab1 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 31 May 2009 21:14:25 +0000 Subject: == Sequencer == This fixes dependency of scrub duration on mixbuffer size. (start audio with a mixbuffer size of 2048, let it play = initialize, change mixbuffer to smaller value, you will here 1 second of audio instead of a scrub) should hopefully fix [#18850] 2.49 scrubbing creates an echo --- source/blender/src/seqaudio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/src/seqaudio.c b/source/blender/src/seqaudio.c index fd70cbe1f08..f2f6bbadeb0 100644 --- a/source/blender/src/seqaudio.c +++ b/source/blender/src/seqaudio.c @@ -546,9 +546,9 @@ static void audio_fill(void *mixdown, uint8_t *sstream, int len) } audio_pos += len; - if (audio_scrub) { - audio_scrub--; - if (!audio_scrub) { + if (audio_scrub > 0) { + audio_scrub-= len; + if (audio_scrub <= 0) { audiostream_stop(); } } @@ -690,7 +690,7 @@ void audiostream_play(int startframe, uint32_t duration, int mixdown) /* if audio already is playing, just reseek, otherwise remember scrub-duration */ - if (!(audio_playing && !audio_scrub)) { + if (!(audio_playing && !(audio_scrub > 0))) { audio_scrub = duration; } if (!mixdown) { @@ -707,7 +707,7 @@ void audiostream_start(int frame) void audiostream_scrub(int frame) { - if (U.mixbufsize) audiostream_play(frame, 4096/U.mixbufsize, 0); + if (U.mixbufsize) audiostream_play(frame, 4096, 0); } void audiostream_stop(void) -- cgit v1.2.3 From 94af7242939ef8da07f63feb3d44981ca26beab5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 1 Jun 2009 05:43:58 +0000 Subject: YoFrankie bug [#18857] On start gives ImportError: No module named frankie_scripts GameEngine sys.path creation was broken because of a pesky slash at the end of each path name. Win32 sys.paths were also failing when running a game that switched between blend files in different directories On win32 for some reason making absolute paths from lib->name failed, work around this by using lib->filename. STR_String.h, cast to float to quiet compiler warnings. --- source/gameengine/Ketsji/KX_PythonInit.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index ff5a37801f4..3294789249d 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1508,10 +1508,12 @@ static void initPySysObjects__append(PyObject *sys_path, char *filename) char expanded[FILE_MAXDIR + FILE_MAXFILE]; BLI_split_dirfile_basic(filename, expanded, NULL); /* get the dir part of filename only */ - BLI_convertstringcode(expanded, gp_GamePythonPath); - + BLI_convertstringcode(expanded, gp_GamePythonPath); /* filename from lib->filename is (always?) absolute, so this may not be needed but it wont hurt */ + BLI_cleanup_file(gp_GamePythonPath, expanded); /* Dont use BLI_cleanup_dir because it adds a slash - BREAKS WIN32 ONLY */ item= PyString_FromString(expanded); +// printf("SysPath - '%s', '%s', '%s'\n", expanded, filename, gp_GamePythonPath); + if(PySequence_Index(sys_path, item) == -1) { PyErr_Clear(); /* PySequence_Index sets a ValueError */ PyList_Insert(sys_path, 0, item); @@ -1535,7 +1537,9 @@ static void initPySysObjects(Main *maggie) Library *lib= (Library *)maggie->library.first; while(lib) { - initPySysObjects__append(sys_path, lib->name); + /* lib->name wont work in some cases (on win32), + * even when expanding with gp_GamePythonPath, using lib->filename is less trouble */ + initPySysObjects__append(sys_path, lib->filename); lib= (Library *)lib->id.next; } @@ -2083,6 +2087,7 @@ void pathGamePythonConfig( char *path ) void setGamePythonPath(char *path) { BLI_strncpy(gp_GamePythonPath, path, sizeof(gp_GamePythonPath)); + BLI_cleanup_file(NULL, gp_GamePythonPath); /* not absolutely needed but makes resolving path problems less confusing later */ if (gp_GamePythonPathOrig[0] == '\0') BLI_strncpy(gp_GamePythonPathOrig, path, sizeof(gp_GamePythonPathOrig)); -- cgit v1.2.3 From 332279e12e93c3089addf4056ae05d93b753ed79 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Mon, 1 Jun 2009 09:01:29 +0000 Subject: == Sequencer == This fixes: [#18707] Syncing animation to audio (works fine in 2.45. It does not work properly in 2.48) --- source/blender/src/drawview.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index 50deea9e831..c0f4bc20ee8 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -3683,9 +3683,8 @@ int update_time(int cfra) static double ltime; double time; - if ((audiostream_pos() != cfra) - && (G.scene->audio.flag & AUDIO_SYNC)) { - return 0; + if ((G.scene->audio.flag & AUDIO_SYNC) != 0) { + return (audiostream_pos() == cfra); } time = PIL_check_seconds_timer(); -- cgit v1.2.3 From d1f7a2ceeeb711118d6172a3495f42a4a02718fc Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Mon, 1 Jun 2009 09:24:46 +0000 Subject: == Sequencer == This removes the need of using "-g noaudio", if only HD Sound strips are used. (In opposite to the RAM Sound strips, they don't need an initialized Game Sound Engine for obvious reasons...) --- source/blender/src/seqaudio.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/seqaudio.c b/source/blender/src/seqaudio.c index f2f6bbadeb0..e01928c7aee 100644 --- a/source/blender/src/seqaudio.c +++ b/source/blender/src/seqaudio.c @@ -629,7 +629,6 @@ static int audiostream_play_seq(Sequence * seq, int startframe) * 4 )); } if ((seq->type == SEQ_HD_SOUND)) { - have_sound = 1; if (!seq->hdaudio) { strncpy(name, seq->strip->dir, FILE_MAXDIR-1); strncat(name, seq->strip->stripdata->name, -- cgit v1.2.3 From 358ec00256bd91f29e14620f1c898f7e9e8e8305 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 1 Jun 2009 09:44:41 +0000 Subject: BGE bug fix: dynamically added sensor objects didn't have their physic shape synchronized with movement. --- source/gameengine/Ketsji/KX_BulletPhysicsController.cpp | 8 +++++++- source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 9 +-------- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp index e22edfd1306..748b0667061 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp @@ -92,7 +92,13 @@ void KX_BulletPhysicsController::SetObject (SG_IObject* object) gameobj->SetPhysicsController(this,gameobj->IsDynamic()); CcdPhysicsController::setNewClientInfo(gameobj->getClientInfo()); - + if (m_bSensor) + { + // use a different callback function for sensor object, + // bullet will not synchronize, we must do it explicitely + SG_Callbacks& callbacks = gameobj->GetSGNode()->GetCallBackFunctions(); + callbacks.m_updatefunc = KX_GameObject::SynchronizeTransformFunc; + } } MT_Scalar KX_BulletPhysicsController::GetRadius() diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index 297b15a2b78..51c41c0686d 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -1115,15 +1115,8 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, shapeInfo->Release(); gameobj->SetPhysicsController(physicscontroller,isbulletdyna); - if (isbulletsensor) - { - // use a different callback function for sensor object, - // bullet will not synchronize, we must do it explicitely - SG_Callbacks& callbacks = gameobj->GetSGNode()->GetCallBackFunctions(); - callbacks.m_updatefunc = KX_GameObject::SynchronizeTransformFunc; - } // don't add automatically sensor object, they are added when a collision sensor is registered - else if (objprop->m_in_active_layer) + if (!isbulletsensor && objprop->m_in_active_layer) { env->addCcdPhysicsController( physicscontroller); } -- cgit v1.2.3 From 617b45256ad9b6fca2e7fa2ff0a016b73ce31c7a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 1 Jun 2009 12:36:22 +0000 Subject: BGE Blendfile path bug (use for loading and saving the GameLogic.globalDict) the original blendfile path wasn't reset when loading new blendfiles. blenderplayer was ok, but running the BGE from blender would set the blendfile original path and never reset it on loading other blend files. --- source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 1 + source/gameengine/Ketsji/KX_PythonInit.cpp | 7 +++++++ source/gameengine/Ketsji/KX_PythonInit.h | 1 + 3 files changed, 9 insertions(+) (limited to 'source') diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 0e0377a7cb9..c3ff923b8fb 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -118,6 +118,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, BLI_strncpy(pathname, blenderdata->name, sizeof(pathname)); BLI_strncpy(oldsce, G.sce, sizeof(oldsce)); + resetGamePythonPath(); // need this so running a second time wont use an old blendfiles path setGamePythonPath(G.sce); // Acquire Python's GIL (global interpreter lock) diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 3294789249d..20009b7b846 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -2093,3 +2093,10 @@ void setGamePythonPath(char *path) BLI_strncpy(gp_GamePythonPathOrig, path, sizeof(gp_GamePythonPathOrig)); } +// we need this so while blender is open (not blenderplayer) +// loading new blendfiles will reset this on starting the +// engine but loading blend files within the BGE wont overwrite gp_GamePythonPathOrig +void resetGamePythonPath() +{ + gp_GamePythonPathOrig[0] == '\0'; +} diff --git a/source/gameengine/Ketsji/KX_PythonInit.h b/source/gameengine/Ketsji/KX_PythonInit.h index 3253ac8f711..8f102d13a18 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.h +++ b/source/gameengine/Ketsji/KX_PythonInit.h @@ -53,6 +53,7 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev void exitGamePythonScripting(); void setGamePythonPath(char *path); +void resetGamePythonPath(); void pathGamePythonConfig( char *path ); int saveGamePythonConfig( char **marshal_buffer); int loadGamePythonConfig(char *marshal_buffer, int marshal_length); -- cgit v1.2.3 From 2a3627e338516646d3e68f4db6147a80410bcf1f Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Mon, 1 Jun 2009 16:35:05 +0000 Subject: == Sequencer == This fixes: [#18507] Wrong audio mixdown Also: you can change output sample rate while blender is running and the audio device get's reopened automatically. Subframe-precision seeking was also broken for some releases... (shame on me) --- source/blender/src/hddaudio.c | 179 +++++++++++++++++++++++++----------------- source/blender/src/seqaudio.c | 16 ++-- 2 files changed, 116 insertions(+), 79 deletions(-) (limited to 'source') diff --git a/source/blender/src/hddaudio.c b/source/blender/src/hddaudio.c index 7175f140b09..bfddd29b198 100644 --- a/source/blender/src/hddaudio.c +++ b/source/blender/src/hddaudio.c @@ -216,6 +216,97 @@ long sound_hdaudio_get_duration(struct hdaudio * hdaudio, double frame_rate) } #ifdef WITH_FFMPEG + +#define RESAMPLE_FILL_RATIO (7.0/4.0) + +static void sound_hdaudio_run_resampler_seek( + struct hdaudio * hdaudio) +{ + int in_frame_size = (long long) hdaudio->sample_rate + * hdaudio->frame_duration / AV_TIME_BASE; + + hdaudio->resample_samples_in = in_frame_size * RESAMPLE_FILL_RATIO; + hdaudio->resample_samples_written + = audio_resample(hdaudio->resampler, + hdaudio->resample_cache, + hdaudio->decode_cache_zero, + in_frame_size * RESAMPLE_FILL_RATIO); +} + +static void sound_hdaudio_run_resampler_continue( + struct hdaudio * hdaudio) +{ + int target_rate = hdaudio->target_rate; + int target_channels = hdaudio->target_channels; + + int frame_size = (long long) target_rate + * hdaudio->frame_duration / AV_TIME_BASE; + int in_frame_size = (long long) hdaudio->sample_rate + * hdaudio->frame_duration / AV_TIME_BASE; + + int reuse_tgt = (hdaudio->resample_samples_written + - frame_size) * target_channels; + int reuse_src = (hdaudio->resample_samples_in + - in_frame_size) * hdaudio->channels; + int next_samples_in = + in_frame_size * RESAMPLE_FILL_RATIO + - reuse_src / hdaudio->channels; + + memmove(hdaudio->resample_cache, + hdaudio->resample_cache + frame_size * target_channels, + reuse_tgt * sizeof(short)); + + hdaudio->resample_samples_written + = audio_resample( + hdaudio->resampler, + hdaudio->resample_cache + reuse_tgt, + hdaudio->decode_cache_zero + reuse_src, + next_samples_in) + + reuse_tgt / target_channels; + + hdaudio->resample_samples_in = next_samples_in + + reuse_src / hdaudio->channels; +} + +static void sound_hdaudio_init_resampler( + struct hdaudio * hdaudio, + int frame_position, int target_rate, int target_channels) +{ + int frame_size = (long long) target_rate + * hdaudio->frame_duration / AV_TIME_BASE; + + if (hdaudio->resampler && + (hdaudio->target_rate != target_rate + || hdaudio->target_channels != target_channels)) { + audio_resample_close(hdaudio->resampler); + hdaudio->resampler = 0; + } + if (!hdaudio->resampler) { + hdaudio->resampler = av_audio_resample_init( + target_channels, hdaudio->channels, + target_rate, hdaudio->sample_rate, + SAMPLE_FMT_S16, SAMPLE_FMT_S16, + 16, 10, 0, 0.8); + hdaudio->target_rate = target_rate; + hdaudio->target_channels = target_channels; + if (hdaudio->resample_cache) { + MEM_freeN(hdaudio->resample_cache); + } + + + hdaudio->resample_cache = (short*) MEM_mallocN( + (long long) + hdaudio->target_channels + * frame_size * 2 + * sizeof(short), + "hdaudio resample cache"); + if (frame_position == hdaudio->frame_position || + frame_position == hdaudio->frame_position + 1) { + sound_hdaudio_run_resampler_seek(hdaudio); + } + } +} + static void sound_hdaudio_extract_small_block( struct hdaudio * hdaudio, short * target_buffer, @@ -240,40 +331,9 @@ static void sound_hdaudio_extract_small_block( if (hdaudio == 0) return; if (rate_conversion) { - if (hdaudio->resampler && - (hdaudio->target_rate != target_rate - || hdaudio->target_channels != target_channels)) { - audio_resample_close(hdaudio->resampler); - hdaudio->resampler = 0; - } - if (!hdaudio->resampler) { - hdaudio->resampler = audio_resample_init( - target_channels, hdaudio->channels, - target_rate, hdaudio->sample_rate); - hdaudio->target_rate = target_rate; - hdaudio->target_channels = target_channels; - if (hdaudio->resample_cache) { - MEM_freeN(hdaudio->resample_cache); - } - - - hdaudio->resample_cache = (short*) MEM_mallocN( - (long long) - hdaudio->target_channels - * frame_size * 2 - * sizeof(short), - "hdaudio resample cache"); - if (frame_position == hdaudio->frame_position) { - hdaudio->resample_samples_in = - in_frame_size * 7 / 4; - hdaudio->resample_samples_written - = audio_resample( - hdaudio->resampler, - hdaudio->resample_cache, - hdaudio->decode_cache_zero, - in_frame_size * 7 / 4); - } - } + sound_hdaudio_init_resampler( + hdaudio, frame_position, + target_rate, target_channels); } if (frame_position == hdaudio->frame_position + 1 @@ -347,36 +407,11 @@ static void sound_hdaudio_extract_small_block( } } + hdaudio->decode_pos = decode_pos; + if (rate_conversion) { - int written = hdaudio->resample_samples_written - * target_channels; - int ofs = target_channels * frame_size; - int recycle = written - ofs; - int next_in = in_frame_size - + (3.0/4.0 - - (double) recycle / (double) - (frame_size * target_channels) - ) * in_frame_size; - - memmove(hdaudio->resample_cache, - hdaudio->resample_cache + ofs, - recycle * sizeof(short)); - - hdaudio->resample_samples_written - = audio_resample( - hdaudio->resampler, - hdaudio->resample_cache + recycle, - hdaudio->decode_cache_zero - + hdaudio->resample_samples_in - * hdaudio->channels - - bl_size, - next_in) - + recycle / target_channels; - - hdaudio->resample_samples_in = next_in; + sound_hdaudio_run_resampler_continue(hdaudio); } - - hdaudio->decode_pos = decode_pos; } if (frame_position != hdaudio->frame_position) { @@ -390,6 +425,7 @@ static void sound_hdaudio_extract_small_block( * hdaudio->frame_duration / AV_TIME_BASE; long long seek_pos; + int decode_cache_zero_init = 0; hdaudio->frame_position = frame_position; @@ -435,8 +471,7 @@ static void sound_hdaudio_extract_small_block( audio_pkt_data = packet.data; audio_pkt_size = packet.size; - if (!hdaudio->decode_cache_zero - && audio_pkt_size > 0) { + if (!decode_cache_zero_init && audio_pkt_size > 0) { long long diff; if (packet.pts == AV_NOPTS_VALUE) { @@ -476,6 +511,7 @@ static void sound_hdaudio_extract_small_block( hdaudio->decode_cache_zero = hdaudio->decode_cache + diff; + decode_cache_zero_init = 1; } while (audio_pkt_size > 0) { @@ -514,22 +550,18 @@ static void sound_hdaudio_extract_small_block( break; } } + hdaudio->decode_pos = decode_pos; + if (rate_conversion) { - hdaudio->resample_samples_written - = audio_resample(hdaudio->resampler, - hdaudio->resample_cache, - hdaudio->decode_cache_zero, - in_frame_size * 7 / 4); - hdaudio->resample_samples_in = - in_frame_size * 7 / 4; + sound_hdaudio_run_resampler_seek(hdaudio); } - hdaudio->decode_pos = decode_pos; } memcpy(target_buffer, (rate_conversion ? hdaudio->resample_cache : hdaudio->decode_cache_zero) + sample_ofs, nb_samples * target_channels * sizeof(short)); + } #endif @@ -575,6 +607,9 @@ void sound_close_hdaudio(struct hdaudio * hdaudio) avcodec_close(hdaudio->pCodecCtx); av_close_input_file(hdaudio->pFormatCtx); MEM_freeN (hdaudio->decode_cache); + if (hdaudio->resampler) { + audio_resample_close(hdaudio->resampler); + } if (hdaudio->resample_cache) { MEM_freeN(hdaudio->resample_cache); } diff --git a/source/blender/src/seqaudio.c b/source/blender/src/seqaudio.c index e01928c7aee..03885292dfd 100644 --- a/source/blender/src/seqaudio.c +++ b/source/blender/src/seqaudio.c @@ -564,7 +564,7 @@ static int audio_init(SDL_AudioSpec *desired) obtained = (SDL_AudioSpec*)MEM_mallocN(sizeof(SDL_AudioSpec), "SDL_AudioSpec"); - + audio_initialised = 0; desired->callback=audio_fill; if ( SDL_OpenAudio(desired, obtained) < 0 ) { @@ -670,16 +670,18 @@ void audiostream_play(int startframe, uint32_t duration, int mixdown) sound_init_audio(); } - if (U.mixbufsize && !audio_initialised && !mixdown) { + if (U.mixbufsize && + (!audio_initialised + || desired.freq != audio_scene->audio.mixrate + || desired.samples != U.mixbufsize) + && !mixdown) { desired.freq=audio_scene->audio.mixrate; desired.format=AUDIO_S16SYS; desired.channels=2; desired.samples=U.mixbufsize; desired.userdata=0; - if (audio_init(&desired)==0) { - U.mixbufsize = 0; /* no audio */ - } + audio_init(&desired); } audio_startframe = startframe; @@ -706,7 +708,7 @@ void audiostream_start(int frame) void audiostream_scrub(int frame) { - if (U.mixbufsize) audiostream_play(frame, 4096, 0); + audiostream_play(frame, 4096, 0); } void audiostream_stop(void) @@ -721,7 +723,7 @@ int audiostream_pos(void) { int pos; - if (U.mixbufsize && audio_scene) { + if (audio_initialised && audio_scene) { pos = (int) (((double)(audio_pos-U.mixbufsize) / ( audio_scene->audio.mixrate*4 )) * FPS ); -- cgit v1.2.3 From 4c7a02f6a1d517f8af6e4cf9200c067e9c71cf78 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 1 Jun 2009 18:41:58 +0000 Subject: BGE: memory leak in Random actuator + make actuator truly random when seed=0 in the UI. When running the game, seed 0 is replaced by a random seed accessible through Python in seed attribute of the actuator. Other seed value will be left unchanged and will generate fixed pseudo random series. --- source/gameengine/Converter/KX_ConvertActuators.cpp | 5 +++++ source/gameengine/GameLogic/SCA_RandomActuator.cpp | 10 ++++++++-- source/gameengine/GameLogic/SCA_RandomActuator.h | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 2b832996c45..ea812a71fdd 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -954,6 +954,11 @@ void BL_ConvertActuators(char* maggiename, = (bRandomActuator *) bact->data; unsigned long seedArg = randAct->seed; + if (seedArg == 0) + { + seedArg = (int)(ketsjiEngine->GetRealTime()*100000.0); + seedArg ^= (intptr_t)randAct; + } SCA_RandomActuator::KX_RANDOMACT_MODE modeArg = SCA_RandomActuator::KX_RANDOMACT_NODEF; SCA_RandomActuator *tmprandomact; diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index 1bc4487b5bf..a722590dd10 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -58,7 +58,6 @@ SCA_RandomActuator::SCA_RandomActuator(SCA_IObject *gameobj, m_parameter2(para2), m_distribution(mode) { - // m_base is never deleted, probably a memory leak! m_base = new SCA_RandomNumberGenerator(seed); m_counter = 0; enforceConstraints(); @@ -68,7 +67,7 @@ SCA_RandomActuator::SCA_RandomActuator(SCA_IObject *gameobj, SCA_RandomActuator::~SCA_RandomActuator() { - /* intentionally empty */ + m_base->Release(); } @@ -81,6 +80,13 @@ CValue* SCA_RandomActuator::GetReplica() return replica; } +void SCA_RandomActuator::ProcessReplica() +{ + SCA_IActuator::ProcessReplica(); + // increment reference count so that we can release the generator at the end + m_base->AddRef(); +} + bool SCA_RandomActuator::Update() diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.h b/source/gameengine/GameLogic/SCA_RandomActuator.h index 310e8a7fbf9..59863589b60 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.h +++ b/source/gameengine/GameLogic/SCA_RandomActuator.h @@ -91,6 +91,7 @@ class SCA_RandomActuator : public SCA_IActuator virtual bool Update(); virtual CValue* GetReplica(); + virtual void ProcessReplica(); /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ -- cgit v1.2.3 From a3f097c646a4b91bfae7ddb7029597dfa41d35d8 Mon Sep 17 00:00:00 2001 From: Robin Allen Date: Mon, 1 Jun 2009 21:22:43 +0000 Subject: Bugfix for faulty noise function in bricks node --- source/blender/nodes/intern/TEX_nodes/TEX_bricks.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c b/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c index c9fa3528b02..80cbd6188ee 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c @@ -49,12 +49,21 @@ static void init(bNode *node) { node->custom4 = 1.0; /* squash */ } +static float noise(int n) /* fast integer noise */ +{ + int nn; + n = (n >> 13) ^ n; + nn = (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff; + return 0.5f * ((float)nn / 1073741824.0f); +} + static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) { float x = coord[0]; float y = coord[1]; - float bricknum, rownum, offset = 0; + int bricknum, rownum; + float offset = 0; float ins_x, ins_y; float tint; @@ -71,20 +80,19 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor tex_input_rgba(bricks2, in[1], coord, thread); tex_input_rgba(mortar, in[2], coord, thread); - rownum = floor(y / row_height); + rownum = (int)floor(y / row_height); if( node->custom1 && node->custom2 ) { brick_width *= ((int)(rownum) % node->custom2 ) ? 1.0f : node->custom4; /* squash */ offset = ((int)(rownum) % node->custom1 ) ? 0 : (brick_width*node->custom3); /* offset */ } - bricknum = floor((x+offset) / brick_width); + bricknum = (int)floor((x+offset) / brick_width); ins_x = (x+offset) - brick_width*bricknum; ins_y = y - row_height*rownum; - srand( (123456*rownum) + bricknum ); - tint = rand() / (float)RAND_MAX + bias; + tint = noise((rownum << 16) + (bricknum & 0xFFFF)) + bias; CLAMP(tint,0.0f,1.0f); if( ins_x < mortar_thickness || ins_y < mortar_thickness || -- cgit v1.2.3 From 62abe788c433e5579f413bad01d0ee563765657a Mon Sep 17 00:00:00 2001 From: Robin Allen Date: Mon, 1 Jun 2009 21:38:03 +0000 Subject: Fixed limits on translate node --- source/blender/nodes/intern/TEX_nodes/TEX_translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_translate.c b/source/blender/nodes/intern/TEX_nodes/TEX_translate.c index 0e903301789..cadd27612f4 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_translate.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_translate.c @@ -31,7 +31,7 @@ static bNodeSocketType inputs[]= { { SOCK_RGBA, 1, "Color", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, - { SOCK_VECTOR, 1, "Offset", 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f }, + { SOCK_VECTOR, 1, "Offset", 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f }, { -1, 0, "" } }; -- cgit v1.2.3 From 6a35302a54071bfd12df7d4a71e710d1e250b34d Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 2 Jun 2009 09:58:06 +0000 Subject: NLA SoC: Fixed merge errors. Manually copied over any files from 2.5 that were modified in a commit by Brecht between the time when I had done the previous merge and the time when the commit for that finally got through. --- source/blender/blenkernel/BKE_library.h | 1 + source/blender/blenkernel/intern/library.c | 6 + source/blender/editors/include/ED_object.h | 17 +- source/blender/editors/include/UI_interface.h | 9 +- source/blender/editors/interface/interface.c | 13 +- source/blender/editors/interface/interface_api.c | 11 +- .../blender/editors/interface/interface_handlers.c | 6 +- source/blender/editors/interface/interface_utils.c | 4 +- .../blender/editors/interface/interface_widgets.c | 6 +- source/blender/editors/object/editconstraint.c | 293 +++++++++++++++++---- source/blender/editors/object/object_intern.h | 3 + source/blender/editors/object/object_modifier.c | 2 + source/blender/editors/object/object_ops.c | 2 + source/blender/editors/space_image/image_header.c | 14 +- .../blender/editors/space_view3d/view3d_header.c | 24 +- source/blender/makesrna/RNA_enum_types.h | 1 + source/blender/makesrna/intern/rna_constraint.c | 2 +- source/blender/makesrna/intern/rna_object.c | 4 +- source/blender/makesrna/intern/rna_pose.c | 1 - source/blender/makesrna/intern/rna_sound.c | 16 +- source/blender/makesrna/intern/rna_ui.c | 2 +- source/blender/windowmanager/WM_types.h | 1 + 22 files changed, 341 insertions(+), 97 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index e598394cc60..ce182267b93 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -45,6 +45,7 @@ void *copy_libblock(void *rt); void id_lib_extern(struct ID *id); void id_us_plus(struct ID *id); +void id_us_min(struct ID *id); int check_for_dupid(struct ListBase *lb, struct ID *id, char *name); int new_id(struct ListBase *lb, struct ID *id, const char *name); diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index d0e4c1a15bc..90ab4e05d44 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -142,6 +142,12 @@ void id_us_plus(ID *id) } } +void id_us_min(ID *id) +{ + if(id) + id->us--; +} + ListBase *wich_libbase(Main *mainlib, short type) { switch( type ) { diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index c6277f319bc..3d0de795778 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -35,6 +35,7 @@ struct bContext; struct Base; struct View3D; struct bConstraint; +struct bConstraintChannel; struct KeyBlock; struct Lattice; struct Mesh; @@ -71,8 +72,20 @@ void ED_object_base_init_from_view(struct bContext *C, struct Base *base); int object_data_is_libdata(struct Object *ob); /* constraints */ -struct bConstraint *add_new_constraint (short type); -void add_constraint_to_object (struct bConstraint *con, struct Object *ob); +struct bConstraint *add_new_constraint(short type); +void add_constraint_to_object(struct bConstraint *con, struct Object *ob); + +struct ListBase *get_active_constraints(struct Object *ob); +struct bConstraint *get_active_constraint(struct Object *ob); +struct bConstraintChannel *get_active_constraint_channel(struct Scene *scene, struct Object *ob); + +void object_test_constraints(struct Object *ob); + +void ED_object_constraint_rename(struct Object *ob, struct bConstraint *con, char *oldname); +void ED_object_constraint_set_active(struct Object *ob, struct bConstraint *con); +int ED_object_constraint_delete(struct ReportList *reports, struct Object *ob, struct bConstraint *con); +int ED_object_constraint_move_down(struct ReportList *reports, struct Object *ob, struct bConstraint *con); +int ED_object_constraint_move_up(struct ReportList *reports, struct Object *ob, struct bConstraint *con); /* editlattice.c */ void mouse_lattice(struct bContext *C, short mval[2], int extend); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index cdb29ecf376..97c2da5297f 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -189,6 +189,8 @@ typedef struct uiLayout uiLayout; #define FTPREVIEW (35<<9) #define NUMABS (36<<9) #define TOGBUT (37<<9) +#define OPTION (38<<9) +#define OPTIONN (39<<9) #define BUTTYPE (63<<9) /* Drawing @@ -579,7 +581,8 @@ uiBlock *uiLayoutFreeBlock(uiLayout *layout); void uiTemplateHeader(uiLayout *layout, struct bContext *C); void uiTemplateHeaderID(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop); -uiLayout *uiTemplateModifier(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr); +uiLayout *uiTemplateModifier(uiLayout *layout, struct PointerRNA *ptr); +uiLayout *uiTemplateConstraint(uiLayout *layout, struct PointerRNA *ptr); void uiTemplatePreview(uiLayout *layout, struct ID *id); /* items */ @@ -592,8 +595,8 @@ void uiItemFloatO(uiLayout *layout, char *name, int icon, char *opname, char *pr void uiItemStringO(uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value); void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, struct IDProperty *properties, int context); -void uiItemR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int expand, int slider); -void uiItemFullR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int expand, int slider); +void uiItemR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int expand, int slider, int toggle); +void uiItemFullR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int expand, int slider, int toggle); void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int value); void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 0b094f0c8dc..e9a886375c3 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -679,7 +679,7 @@ static void ui_is_but_sel(uiBut *but) value= ui_get_but_val(but); - if( but->type==TOGN || but->type==ICONTOGN) true= 0; + if(ELEM3(but->type, TOGN, ICONTOGN, OPTIONN)) true= 0; if( but->bit ) { lvalue= (int)value; @@ -700,10 +700,12 @@ static void ui_is_but_sel(uiBut *but) case TOG3: case BUT_TOGDUAL: case ICONTOG: + case OPTION: if(value!=but->hardmin) push= 1; break; case ICONTOGN: case TOGN: + case OPTIONN: if(value==0.0) push= 1; break; case ROW: @@ -1509,7 +1511,12 @@ int ui_set_but_string(bContext *C, uiBut *but, const char *str) * custom collection too for bones, vertex groups, .. */ ui_rna_ID_collection(C, but, &ptr, &prop); - if(prop && RNA_property_collection_lookup_string(&ptr, prop, str, &rptr)) { + if(str == NULL || str[0] == '\0') { + memset(&rptr, 0, sizeof(rptr)); + RNA_property_pointer_set(&but->rnapoin, but->rnaprop, rptr); + return 11; + } + else if(prop && RNA_property_collection_lookup_string(&ptr, prop, str, &rptr)) { RNA_property_pointer_set(&but->rnapoin, but->rnaprop, rptr); return 1; } @@ -1989,7 +1996,7 @@ void uiBlockEndAlign(uiBlock *block) int ui_but_can_align(uiBut *but) { - return (but->type != LABEL); + return !ELEM3(but->type, LABEL, OPTION, OPTIONN); } static void ui_block_do_align_but(uiBlock *block, uiBut *first, int nr) diff --git a/source/blender/editors/interface/interface_api.c b/source/blender/editors/interface/interface_api.c index 3cb6678133f..2bbaee857d1 100644 --- a/source/blender/editors/interface/interface_api.c +++ b/source/blender/editors/interface/interface_api.c @@ -89,7 +89,8 @@ void RNA_api_ui_layout(StructRNA *srna) parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data."); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); - RNA_def_boolean(func, "slider", 0, "", "Use slider for numeric values."); + RNA_def_boolean(func, "slider", 0, "", "Use slider widget for numeric values."); + RNA_def_boolean(func, "toggle", 0, "", "Use toggle widget for boolean values."); func= RNA_def_function(srna, "items_enumR", "uiItemsEnumR"); parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); @@ -198,13 +199,17 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block."); func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier"); - parm= RNA_def_pointer(func, "context", "Context", "", "Current context."); - RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_pointer(func, "data", "AnyType", "", "Modifier data."); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); RNA_def_function_return(func, parm); + func= RNA_def_function(srna, "template_constraint", "uiTemplateConstraint"); + parm= RNA_def_pointer(func, "data", "AnyType", "", "Constraint data."); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); + RNA_def_function_return(func, parm); + func= RNA_def_function(srna, "template_preview", "uiTemplatePreview"); parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock."); RNA_def_property_flag(parm, PROP_REQUIRED); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index ce01bc19856..ec2f960dd14 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -364,7 +364,7 @@ static void ui_apply_but_TOG(bContext *C, uiBlock *block, uiBut *but, uiHandleBu if(value==0.0) push= 1; else push= 0; - if(but->type==TOGN || but->type==ICONTOGN) push= !push; + if(ELEM3(but->type, TOGN, ICONTOGN, OPTIONN)) push= !push; ui_set_but_val(but, (double)push); if(but->type==ICONTOG || but->type==ICONTOGN) ui_check_but(but); } @@ -566,6 +566,8 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut case ICONTOGN: case TOGN: case BUT_TOGDUAL: + case OPTION: + case OPTIONN: ui_apply_but_TOG(C, block, but, data); break; case ROW: @@ -2672,6 +2674,8 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event) case ICONTOGN: case TOGN: case BUT_TOGDUAL: + case OPTION: + case OPTIONN: retval= ui_do_but_TOG(C, but, data, event); break; #if 0 diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 16451ec4510..7c739adf1b9 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -268,7 +268,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind else if(icon) but= uiDefIconTextButR(block, ICONTOG, 0, icon, name, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL); else - but= uiDefButR(block, TOG, 0, name, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL); + but= uiDefButR(block, OPTION, 0, name, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL); break; } case PROP_INT: @@ -338,7 +338,7 @@ void uiDefAutoButsRNA(const bContext *C, uiLayout *layout, PointerRNA *ptr) name= (char*)RNA_property_ui_name(prop); uiItemL(uiLayoutColumn(split, 0), name, 0); - uiItemFullR(uiLayoutColumn(split, 0), "", 0, ptr, prop, -1, 0, 0, 0); + uiItemFullR(uiLayoutColumn(split, 0), "", 0, ptr, prop, -1, 0, 0, 0, 0); } RNA_property_collection_end(&iter); diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index f779022ece5..f4e3a7f2899 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1830,11 +1830,13 @@ void ui_draw_but(ARegion *ar, uiStyle *style, uiBut *but, rcti *rect) wt= widget_type(UI_WTYPE_NAME); break; case TOGBUT: - wt= widget_type(UI_WTYPE_TOGGLE); - break; case TOG: case TOGN: case TOG3: + wt= widget_type(UI_WTYPE_TOGGLE); + break; + case OPTION: + case OPTIONN: if (!(but->flag & UI_HAS_ICON)) { wt= widget_type(UI_WTYPE_OPTION); but->flag |= UI_TEXT_LEFT; diff --git a/source/blender/editors/object/editconstraint.c b/source/blender/editors/object/editconstraint.c index d0e487f98c7..b2cf3be6229 100644 --- a/source/blender/editors/object/editconstraint.c +++ b/source/blender/editors/object/editconstraint.c @@ -49,17 +49,27 @@ #include "BKE_action.h" #include "BKE_armature.h" #include "BKE_constraint.h" +#include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_global.h" #include "BKE_main.h" #include "BKE_object.h" +#include "BKE_report.h" #include "BKE_utildefines.h" #ifndef DISABLE_PYTHON #include "BPY_extern.h" #endif +#include "WM_api.h" +#include "WM_types.h" + +#include "RNA_access.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + #include "ED_object.h" +#include "ED_screen.h" #include "object_intern.h" @@ -589,55 +599,6 @@ void ob_clear_constraints (Scene *scene) BIF_undo_push("Clear Constraint(s)"); } -/* Rename the given constraint - * - con already has the new name - */ -void rename_constraint (Object *ob, bConstraint *con, char *oldname) -{ - bConstraint *tcon; - ListBase *conlist= NULL; - int from_object= 0; - char *channame=""; - - /* get context by searching for con (primitive...) */ - for (tcon= ob->constraints.first; tcon; tcon= tcon->next) { - if (tcon==con) - break; - } - - if (tcon) { - conlist= &ob->constraints; - channame= "Object"; - from_object= 1; - } - else if (ob->pose) { - bPoseChannel *pchan; - - for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) { - for (tcon= pchan->constraints.first; tcon; tcon= tcon->next) { - if (tcon==con) - break; - } - if (tcon) - break; - } - - if (tcon) { - conlist= &pchan->constraints; - channame= pchan->name; - } - } - - if (conlist==NULL) { - printf("rename constraint failed\n"); /* should not happen in UI */ - return; - } - - /* first make sure it's a unique name within context */ - unique_constraint_name (con, conlist); -} - - /* ------------- Constraint Sanity Testing ------------------- */ /* checks validity of object pointers, and NULLs, @@ -889,3 +850,237 @@ void childof_const_clearinv (void *conv, void *unused) /* simply clear the matrix */ Mat4One(data->invmat); } + +/***************************** BUTTONS ****************************/ + +/* Rename the given constraint, con already has the new name */ +void ED_object_constraint_rename(Object *ob, bConstraint *con, char *oldname) +{ + bConstraint *tcon; + ListBase *conlist= NULL; + int from_object= 0; + char *channame=""; + + /* get context by searching for con (primitive...) */ + for (tcon= ob->constraints.first; tcon; tcon= tcon->next) { + if (tcon==con) + break; + } + + if (tcon) { + conlist= &ob->constraints; + channame= "Object"; + from_object= 1; + } + else if (ob->pose) { + bPoseChannel *pchan; + + for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) { + for (tcon= pchan->constraints.first; tcon; tcon= tcon->next) { + if (tcon==con) + break; + } + if (tcon) + break; + } + + if (tcon) { + conlist= &pchan->constraints; + channame= pchan->name; + } + } + + if (conlist==NULL) { + printf("rename constraint failed\n"); /* should not happen in UI */ + return; + } + + /* first make sure it's a unique name within context */ + unique_constraint_name (con, conlist); +} + + + + +void ED_object_constraint_set_active(Object *ob, bConstraint *con) +{ + ListBase *lb; + bConstraint *origcon= con; + + /* lets be nice and escape if its active already */ + if(con && (con->flag & CONSTRAINT_ACTIVE)) + return ; + + lb= get_active_constraints(ob); + if(lb == NULL) + return; + + for(con= lb->first; con; con= con->next) { + if(con==origcon) con->flag |= CONSTRAINT_ACTIVE; + else con->flag &= ~CONSTRAINT_ACTIVE; + } + + /* make sure ipowin and buttons shows it */ + if(ob->ipowin==ID_CO) { + // XXX allqueue(REDRAWIPO, ID_CO); + // XXX allspace(REMAKEIPO, 0); + // XXX allqueue(REDRAWNLA, 0); + } + // XXX allqueue(REDRAWBUTSOBJECT, 0); +} + +int ED_object_constraint_delete(ReportList *reports, Object *ob, bConstraint *con) +{ + bConstraintChannel *chan; + ListBase *lb; + + /* remove ipo channel */ + lb= NULL; // XXX get_active_constraint_channels(ob, 0); + if(lb) { + chan = NULL; // XXX get_constraint_channel(lb, con->name); + if(chan) { + if(chan->ipo) chan->ipo->id.us--; + BLI_freelinkN(lb, chan); + } + } + + /* remove constraint itself */ + lb= get_active_constraints(ob); + free_constraint_data(con); + BLI_freelinkN(lb, con); + + ED_object_constraint_set_active(ob, NULL); + + return 1; +} + +int ED_object_constraint_move_down(ReportList *reports, Object *ob, bConstraint *constr) +{ + bConstraint *con; + ListBase *conlist; + + if(constr->next) { + conlist = get_active_constraints(ob); + for(con= conlist->first; con; con= con->next) { + if(con==constr) { + BLI_remlink(conlist, con); + BLI_insertlink(conlist, con->next, con); + return 1; + } + } + } + + return 0; +} + +int ED_object_constraint_move_up(ReportList *reports, Object *ob, bConstraint *constr) +{ + bConstraint *con; + ListBase *conlist; + + if(constr->prev) { + conlist = get_active_constraints(ob); + for(con= conlist->first; con; con= con->next) { + if(con==constr) { + BLI_remlink(conlist, con); + BLI_insertlink(conlist, con->prev->prev, con); + return 1; + } + } + } + + return 0; +} + +/***************************** OPERATORS ****************************/ + +/************************ add constraint operator *********************/ + +static int constraint_add_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob = CTX_data_active_object(C); + bConstraint *con; + ListBase *list= get_active_constraints(ob); + bPoseChannel *pchan= get_active_posechannel(ob); + int type= RNA_enum_get(op->ptr, "type"); + + con = add_new_constraint(type); + + if(list) { + unique_constraint_name(con, list); + BLI_addtail(list, con); + + if(proxylocked_constraints_owner(ob, pchan)) + con->flag |= CONSTRAINT_PROXY_LOCAL; + + con->flag |= CONSTRAINT_ACTIVE; + for(con= con->prev; con; con= con->prev) + con->flag &= ~CONSTRAINT_ACTIVE; + } + + switch(type) { + case CONSTRAINT_TYPE_CHILDOF: + { + /* if this constraint is being added to a posechannel, make sure + * the constraint gets evaluated in pose-space */ + if(ob->flag & OB_POSEMODE) { + con->ownspace = CONSTRAINT_SPACE_POSE; + con->flag |= CONSTRAINT_SPACEONCE; + } + } + break; + case CONSTRAINT_TYPE_RIGIDBODYJOINT: + { + bRigidBodyJointConstraint *data; + + /* set selected first object as target - moved from new_constraint_data */ + data = (bRigidBodyJointConstraint*)con->data; + + CTX_DATA_BEGIN(C, Object*, selob, selected_objects) { + if(selob != ob) { + data->tar= selob; + break; + } + } + CTX_DATA_END; + } + break; + default: + break; + } + + object_test_constraints(ob); + + if(ob->pose) + update_pose_constraint_flags(ob->pose); + + if(ob->type==OB_ARMATURE) + DAG_object_flush_update(scene, ob, OB_RECALC_DATA|OB_RECALC_OB); + else + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + + WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_constraint_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Constraint"; + ot->description = "Add a constraint to the active object."; + ot->idname= "OBJECT_OT_constraint_add"; + + /* api callbacks */ + ot->invoke= WM_menu_invoke; + ot->exec= constraint_add_exec; + + ot->poll= ED_operator_object_active; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_enum(ot->srna, "type", constraint_type_items, 0, "Type", ""); +} + diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 223f2190f4b..ce8bd7287f7 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -88,5 +88,8 @@ void GROUP_OT_objects_remove_active(struct wmOperatorType *ot); void OBJECT_OT_modifier_add(struct wmOperatorType *ot); void OBJECT_OT_multires_subdivide(struct wmOperatorType *ot); +/* editconstraint.c */ +void OBJECT_OT_constraint_add(struct wmOperatorType *ot); + #endif /* ED_OBJECT_INTERN_H */ diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 339d8bc8252..2e2c16ee6d6 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -368,6 +368,8 @@ void OBJECT_OT_modifier_add(wmOperatorType *ot) RNA_def_enum(ot->srna, "type", modifier_type_items, 0, "Type", ""); } +/****************** multires subdivide operator *********************/ + static int multires_subdivide_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index f2a020e69a6..9d8247522e1 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -101,6 +101,8 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_modifier_add); WM_operatortype_append(OBJECT_OT_multires_subdivide); + + WM_operatortype_append(OBJECT_OT_constraint_add); } void ED_keymap_object(wmWindowManager *wm) diff --git a/source/blender/editors/space_image/image_header.c b/source/blender/editors/space_image/image_header.c index 2accef990d3..9a61d3a7081 100644 --- a/source/blender/editors/space_image/image_header.c +++ b/source/blender/editors/space_image/image_header.c @@ -150,8 +150,8 @@ static void image_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); - uiItemR(layout, NULL, 0, &spaceptr, "update_automatically", 0, 0); - // XXX if(show_uvedit) uiItemR(layout, NULL, 0, &uvptr, "local_view", 0, 0); // "UV Local View", Numpad / + uiItemR(layout, NULL, 0, &spaceptr, "update_automatically", 0, 0, 0); + // XXX if(show_uvedit) uiItemR(layout, NULL, 0, &uvptr, "local_view", 0, 0, 0); // "UV Local View", Numpad / uiItemS(layout); @@ -234,7 +234,7 @@ static void image_imagemenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); - uiItemR(layout, NULL, 0, &spaceptr, "image_painting", 0, 0); + uiItemR(layout, NULL, 0, &spaceptr, "image_painting", 0, 0, 0); /* move to realtime properties panel */ RNA_id_pointer_create(&ima->id, &imaptr); @@ -338,12 +338,12 @@ static void image_uvsmenu(bContext *C, uiLayout *layout, void *arg_unused) RNA_id_pointer_create(&scene->id, &sceneptr); /* create menu */ - uiItemR(layout, NULL, 0, &uvptr, "snap_to_pixels", 0, 0); - uiItemR(layout, NULL, 0, &uvptr, "constrain_to_image_bounds", 0, 0); + uiItemR(layout, NULL, 0, &uvptr, "snap_to_pixels", 0, 0, 0); + uiItemR(layout, NULL, 0, &uvptr, "constrain_to_image_bounds", 0, 0, 0); uiItemS(layout); - uiItemR(layout, NULL, 0, &uvptr, "live_unwrap", 0, 0); + uiItemR(layout, NULL, 0, &uvptr, "live_unwrap", 0, 0, 0); uiItemO(layout, NULL, 0, "UV_OT_unwrap"); uiItemBooleanO(layout, "Unpin", 0, "UV_OT_pin", "clear", 1); uiItemO(layout, NULL, 0, "UV_OT_pin"); @@ -363,7 +363,7 @@ static void image_uvsmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); - uiItemR(layout, NULL, 0, &sceneptr, "proportional_editing", 0, 0); + uiItemR(layout, NULL, 0, &sceneptr, "proportional_editing", 0, 0, 0); uiItemMenuEnumR(layout, NULL, 0, &sceneptr, "proportional_editing_falloff"); uiItemS(layout); diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 5b8de93b542..2d623c9c33d 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -3359,7 +3359,7 @@ static void view3d_edit_curvemenu(bContext *C, uiLayout *layout, void *arg_unuse uiItemS(layout); - uiItemR(layout, NULL, 0, &sceneptr, "proportional_editing", 0, 0); // |O + uiItemR(layout, NULL, 0, &sceneptr, "proportional_editing", 0, 0, 0); // |O uiItemMenuEnumR(layout, NULL, 0, &sceneptr, "proportional_editing_falloff"); uiItemS(layout); @@ -4533,12 +4533,12 @@ static void view3d_sculpt_menu(bContext *C, uiLayout *layout, void *arg_unused) RNA_pointer_create(&sc->id, &RNA_Sculpt, s, &rna); - uiItemR(layout, NULL, 0, &rna, "symmetry_x", 0, 0); - uiItemR(layout, NULL, 0, &rna, "symmetry_y", 0, 0); - uiItemR(layout, NULL, 0, &rna, "symmetry_z", 0, 0); - uiItemR(layout, NULL, 0, &rna, "lock_x", 0, 0); - uiItemR(layout, NULL, 0, &rna, "lock_y", 0, 0); - uiItemR(layout, NULL, 0, &rna, "lock_z", 0, 0); + uiItemR(layout, NULL, 0, &rna, "symmetry_x", 0, 0, 0); + uiItemR(layout, NULL, 0, &rna, "symmetry_y", 0, 0, 0); + uiItemR(layout, NULL, 0, &rna, "symmetry_z", 0, 0, 0); + uiItemR(layout, NULL, 0, &rna, "lock_x", 0, 0, 0); + uiItemR(layout, NULL, 0, &rna, "lock_y", 0, 0, 0); + uiItemR(layout, NULL, 0, &rna, "lock_z", 0, 0, 0); /* Brush settings */ RNA_pointer_create(&sc->id, &RNA_Brush, s->brush, &rna); @@ -4551,12 +4551,12 @@ static void view3d_sculpt_menu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); - uiItemR(layout, NULL, 0, &rna, "airbrush", 0, 0); - uiItemR(layout, NULL, 0, &rna, "rake", 0, 0); - uiItemR(layout, NULL, 0, &rna, "anchored", 0, 0); - uiItemR(layout, NULL, 0, &rna, "space", 0, 0); + uiItemR(layout, NULL, 0, &rna, "airbrush", 0, 0, 0); + uiItemR(layout, NULL, 0, &rna, "rake", 0, 0, 0); + uiItemR(layout, NULL, 0, &rna, "anchored", 0, 0, 0); + uiItemR(layout, NULL, 0, &rna, "space", 0, 0, 0); - uiItemR(layout, NULL, 0, &rna, "flip_direction", 0, 0); + uiItemR(layout, NULL, 0, &rna, "flip_direction", 0, 0, 0); } uiBlock *view3d_sculptmenu(bContext *C, ARegion *ar, void *arg_unused) diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index 2262c73a9af..c679d9fc544 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -33,6 +33,7 @@ extern EnumPropertyItem prop_mode_items[]; extern EnumPropertyItem space_type_items[]; extern EnumPropertyItem region_type_items[]; extern EnumPropertyItem modifier_type_items[]; +extern EnumPropertyItem constraint_type_items[]; extern EnumPropertyItem beztriple_handle_type_items[]; extern EnumPropertyItem beztriple_interpolation_mode_items[]; diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index b0b9e2079f1..02429ffa4bf 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -1558,4 +1558,4 @@ void RNA_def_constraint(BlenderRNA *brna) rna_def_constraint_shrinkwrap(brna); } -#endif +#endif \ No newline at end of file diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 32af373862b..6baf5083d31 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -49,7 +49,7 @@ static void rna_Object_update(bContext *C, PointerRNA *ptr) DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_OB); } -static void rna_Object_scene_update(bContext *C, PointerRNA *ptr) +static void rna_Object_dependency_update(bContext *C, PointerRNA *ptr) { DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_OB); DAG_scene_sort(CTX_data_scene(C)); @@ -774,7 +774,7 @@ static StructRNA *rna_def_object(BlenderRNA *brna) RNA_def_property_enum_bitflag_sdna(prop, NULL, "transflag"); RNA_def_property_enum_items(prop, dupli_items); RNA_def_property_ui_text(prop, "Dupli Type", "If not None, object duplication method to use."); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_scene_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update"); prop= RNA_def_property(srna, "dupli_frames_no_speed", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLINOSPEED); diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 5aad710c712..8edcc4c72f4 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -82,7 +82,6 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_struct_idproperties_func(srna, "rna_PoseChannel_idproperties"); prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_sdna(prop, NULL, "constraints", NULL); RNA_def_property_struct_type(prop, "Constraint"); RNA_def_property_ui_text(prop, "Constraints", "Constraints that act on this PoseChannel."); diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c index 2aeb1b984fb..c6515385757 100644 --- a/source/blender/makesrna/intern/rna_sound.c +++ b/source/blender/makesrna/intern/rna_sound.c @@ -64,30 +64,30 @@ static void rna_def_sample(BlenderRNA *brna) prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_sample_type_items); - RNA_def_property_flag(prop, PROP_NOT_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Types", ""); prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_flag(prop, PROP_NOT_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Filename", "Full path filename of the sample"); prop= RNA_def_property(srna, "length", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "len"); RNA_def_property_ui_text(prop, "Length", "The length of sample in seconds"); - RNA_def_property_flag(prop, PROP_NOT_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop= RNA_def_property(srna, "rate", PROP_INT, PROP_UNSIGNED); RNA_def_property_ui_text(prop, "Rate", "Sample rate in kHz"); - RNA_def_property_flag(prop, PROP_NOT_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop= RNA_def_property(srna, "bits", PROP_INT, PROP_UNSIGNED); RNA_def_property_ui_text(prop, "Bits", "Bit-depth of sample"); - RNA_def_property_flag(prop, PROP_NOT_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop= RNA_def_property(srna, "channels", PROP_INT, PROP_UNSIGNED); RNA_def_property_ui_text(prop, "Channels", "Number of channels (mono=1; stereo=2)"); - RNA_def_property_flag(prop, PROP_NOT_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); } static void rna_def_soundlistener(BlenderRNA *brna) @@ -117,12 +117,12 @@ static void rna_def_soundlistener(BlenderRNA *brna) prop= RNA_def_property(srna, "num_sounds_blender", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "numsoundsblender"); RNA_def_property_ui_text(prop, "Total Sounds in Blender", "The total number of sounds currently linked and available."); - RNA_def_property_flag(prop, PROP_NOT_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop= RNA_def_property(srna, "num_sounds_gameengine", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "numsoundsgameengine"); RNA_def_property_ui_text(prop, "Total Sounds in Game Engine", "The total number of sounds in the Game Engine."); - RNA_def_property_flag(prop, PROP_NOT_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); } #endif diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index e1bc0de245a..9d3d961c18f 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -151,7 +151,7 @@ static StructRNA *rna_Panel_register(const bContext *C, ReportList *reports, voi PanelType *pt, dummypt = {0}; Panel dummypanel= {0}; PointerRNA dummyptr; - int have_function[2]; + int have_function[3]; /* setup dummy panel & panel type to store static properties in */ dummypanel.type= &dummypt; diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index b96089a05f1..09b81d69ac0 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -196,6 +196,7 @@ typedef struct wmNotifier { #define ND_MODIFIER (23<<16) #define ND_KEYS (24<<16) #define ND_GEOM_DATA (25<<16) +#define ND_CONSTRAINT (26<<16) /* NC_MATERIAL Material */ #define ND_SHADING (30<<16) -- cgit v1.2.3 From 8afd6a9dc54ea40e9f12e746d6e67430613776ec Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 2 Jun 2009 13:03:33 +0000 Subject: NLA SoC: Added basic info-text drawing on strips The format of these is still rather experimental. --- source/blender/editors/space_nla/nla_draw.c | 41 ++++++++++++++++++++++++++-- source/blender/editors/space_nla/space_nla.c | 4 +++ 2 files changed, 43 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index def49021160..78fc4174f95 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -48,6 +48,7 @@ #include "DNA_userdef_types.h" #include "DNA_windowmanager_types.h" #include "DNA_world_types.h" +#include "DNA_vec_types.h" #include "MEM_guardedalloc.h" @@ -128,6 +129,36 @@ static void nla_draw_strip (NlaTrack *nlt, NlaStrip *strip, View2D *v2d, float y gl_round_box_shade(GL_LINE_LOOP, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1); } +/* add the relevant text to the cache of text-strings to draw in pixelspace */ +static void nla_draw_strip_text (NlaTrack *nlt, NlaStrip *strip, int index, View2D *v2d, float yminc, float ymaxc) +{ + char str[256]; + rctf rect; + + /* for now, just init the string with a fixed-format */ + if (strip->act) + sprintf(str, "%d | Act: %s | %.2f <-> %.2f", index, strip->act->id.name+2, strip->start, strip->end); + else + sprintf(str, "%d | Act: ", index); + + /* set text colour - if colours (see above) are light, draw black text, otherwise draw white */ + if (strip->flag & (NLASTRIP_FLAG_ACTIVE|NLASTRIP_FLAG_SELECT|NLASTRIP_FLAG_TWEAKUSER)) + glColor3f(0.0f, 0.0f, 0.0f); + else + glColor3f(1.0f, 1.0f, 1.0f); + + /* set bounding-box for text + * - padding of 2 'units' on either side + */ + rect.xmin= strip->start + 2; + rect.ymin= yminc; + rect.xmax= strip->end - 2; + rect.ymax= ymaxc; + + /* add this string to the cache of texts to draw*/ + UI_view2d_text_cache_rectf(v2d, &rect, str); +} + /* ---------------------- */ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) @@ -175,14 +206,20 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) { NlaTrack *nlt= (NlaTrack *)ale->data; NlaStrip *strip; + int index; /* draw backdrop? */ // TODO... /* draw each strip in the track (if visible) */ - for (strip=nlt->strips.first; strip; strip= strip->next) { - if (BKE_nlastrip_within_bounds(strip, v2d->cur.xmin, v2d->cur.xmax)) + for (strip=nlt->strips.first, index=1; strip; strip=strip->next, index++) { + if (BKE_nlastrip_within_bounds(strip, v2d->cur.xmin, v2d->cur.xmax)) { + /* draw the visualisation of the strip */ nla_draw_strip(nlt, strip, v2d, yminc, ymaxc); + + /* add the text for this strip to the cache */ + nla_draw_strip_text(nlt, strip, index, v2d, yminc, ymaxc); + } } } break; diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 024b23c51b8..1bed72b82fb 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -246,7 +246,11 @@ static void nla_main_area_draw(const bContext *C, ARegion *ar) /* data */ if (ANIM_animdata_get_context(C, &ac)) { + /* strips and backdrops */ draw_nla_main_data(&ac, snla, ar); + + /* text draw cached, in pixelspace now */ + UI_view2d_text_cache_draw(ar); } /* current frame */ -- cgit v1.2.3 From a9c29cd4154fcc3933d59eb06d4fe20790298e88 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Tue, 2 Jun 2009 19:29:20 +0000 Subject: This commit fixes the following two coverity issues: CID: 475 Checker: REVERSE_INULL (help) File: base/src/source/blender/blenkernel/intern/cloth.c Function: bvhselftree_build_from_cloth Description: Pointer "clmd" dereferenced before NULL check CID: 476 Checker: REVERSE_INULL (help) File: base/src/source/blender/blenkernel/intern/cloth.c Function: bvhtree_build_from_cloth Description: Pointer "clmd" dereferenced before NULL check You'll notice in the code the var is actually set again a few lines down before being used so better to set it after you've made sure the pointer is valid. Kent --- source/blender/blenkernel/intern/cloth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index dbc94571cad..f74c96482e0 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -157,7 +157,7 @@ BVHTree *bvhselftree_build_from_cloth (ClothModifierData *clmd, float epsilon) { unsigned int i; BVHTree *bvhtree; - Cloth *cloth = clmd->clothObject; + Cloth *cloth; ClothVertex *verts; MFace *mfaces; float co[12]; @@ -198,7 +198,7 @@ BVHTree *bvhtree_build_from_cloth (ClothModifierData *clmd, float epsilon) { unsigned int i; BVHTree *bvhtree; - Cloth *cloth = clmd->clothObject; + Cloth *cloth; ClothVertex *verts; MFace *mfaces; float co[12]; -- cgit v1.2.3 From 903722299d19a061ec38ca9f17fccc8b389b95a7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 3 Jun 2009 04:12:59 +0000 Subject: BGE PyAPI fixes - CValue warning ShowDeprecationWarning("val = ob.attr", "val = ob['attr']"); had false positives because of python using getattr() internally. Only show the wanring now when a CValue is found. - Py functions that accepted a vector and a GameObject were slowed down by PySequence_Check() first called on the GameObject, though this would fail it would try and get attributes from the game object - ending up in ~8 attribute lookups each time. Avoiding PySequence_Check() makes ob.getDistanceTo(otherOb) over twice as fast. - Joystick hat events could crash the BGE for joysticks with more then 4 hats. - PLY Import failed on PLY files from Carve, added some extra types. --- source/gameengine/Expressions/PyObjectPlus.h | 2 +- source/gameengine/Expressions/Value.cpp | 9 +++++---- .../gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp | 2 +- source/gameengine/Ketsji/KX_PyMath.h | 14 ++++++++++++++ 4 files changed, 21 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 45797fe7975..369c00782cc 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -141,7 +141,7 @@ typedef struct { #define BGE_PROXY_PYOWNS(_self) (((PyObjectPlus_Proxy *)_self)->py_owns) /* Note, sometimes we dont care what BGE type this is as long as its a proxy */ -#define BGE_PROXY_CHECK_TYPE(_self) ((_self)->ob_type->tp_dealloc == py_base_dealloc) +#define BGE_PROXY_CHECK_TYPE(_self) ((_self)->ob_type->tp_dealloc == PyObjectPlus::py_base_dealloc) // This must be the first line of each diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 7f4ed388442..e6ef9733da8 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -555,15 +555,16 @@ PyAttributeDef CValue::Attributes[] = { PyObject* CValue::py_getattro(PyObject *attr) -{ - ShowDeprecationWarning("val = ob.attr", "val = ob['attr']"); - +{ char *attr_str= PyString_AsString(attr); CValue* resultattr = GetProperty(attr_str); if (resultattr) { + /* only show the wanting here because python inspects for __class__ and KX_MeshProxy uses CValues name attr */ + ShowDeprecationWarning("val = ob.attr", "val = ob['attr']"); + PyObject* pyconvert = resultattr->ConvertValueToPython(); - + if (pyconvert) return pyconvert; else diff --git a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp index 66193a2f4b9..53d3be35f92 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp @@ -45,7 +45,7 @@ void SCA_Joystick::OnAxisMotion(SDL_Event* sdl_event) /* See notes below in the event loop */ void SCA_Joystick::OnHatMotion(SDL_Event* sdl_event) { - if(sdl_event->jhat.hat >= JOYAXIS_MAX) + if(sdl_event->jhat.hat >= JOYHAT_MAX) return; m_hat_array[sdl_event->jhat.hat]= sdl_event->jhat.value; diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h index 00f7c5cad93..a7ce4bc6930 100644 --- a/source/gameengine/Ketsji/KX_PyMath.h +++ b/source/gameengine/Ketsji/KX_PyMath.h @@ -40,6 +40,7 @@ #include "MT_Matrix4x4.h" #include "KX_Python.h" +#include "PyObjectPlus.h" inline unsigned int Size(const MT_Matrix4x4&) { return 4; } inline unsigned int Size(const MT_Matrix3x3&) { return 3; } @@ -116,6 +117,19 @@ bool PyVecTo(PyObject* pyval, T& vec) return true; } + else if (BGE_PROXY_CHECK_TYPE(pyval)) + { /* note, include this check because PySequence_Check does too much introspection + * on the PyObject (like getting its __class__, on a BGE type this means searching up + * the parent list each time only to discover its not a sequence. + * GameObjects are often used as an alternative to vectors so this is a common case + * better to do a quick check for it, likely the error below will be ignored. + * + * This is not 'correct' since we have proxy type CListValues's which could + * contain floats/ints but there no cases of CValueLists being this way + */ + PyErr_Format(PyExc_AttributeError, "expected a sequence type"); + return false; + } else if (PySequence_Check(pyval)) { unsigned int numitems = PySequence_Size(pyval); -- cgit v1.2.3 From f6cac5bec7418b58fe250c65293e85a8f0095cb2 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 3 Jun 2009 11:22:49 +0000 Subject: NLA SoC: More Drawing Tweaks * Following user feedback, I've increased the separation between normal NLA-tracks and the 'action lines' to try and differentiate them more. This hopefully this will be sufficient, otherwise, I'm going to have to abandon the use of nice, generic channel-identification code for lists of channels... * Improved drawing of 'active' strips. - Now, the active strip (when NOT being 'tweaked') will be simply drawn as a yellow strip + a white border. - The active strip (when BEING 'tweaked') will now be greenish + a white border. The colour here may be tweakable, but we'll see... * Strip extrapolation modes (hold, etc.) are now visualised as rects with alpha and the same colour as the strip they belong to. * Selecting strips now makes them 'active' (and deactivates the others). Only one strip can be active at a time. Still need to figure out precisely how this will work with multiple AnimData blocks + NLA-'tweaking'. * Fixed view-matrix bug introduced in last commit for text drawing. For now, we'll just reset the view matrix after doing that, since it's not too acceptable to move these calls to the end yet, as they should get overlapped by some other editor features (such as the Current Frame indicator) --- source/blender/blenkernel/intern/nla.c | 19 +++++ source/blender/editors/space_nla/nla_draw.c | 116 +++++++++++++++++++++----- source/blender/editors/space_nla/nla_select.c | 28 +++++-- source/blender/editors/space_nla/space_nla.c | 2 + 4 files changed, 139 insertions(+), 26 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index cf115cb6faf..6235ec58d40 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -455,6 +455,25 @@ void BKE_nlatrack_sort_strips (NlaTrack *nlt) /* NLA Strips -------------------------------------- */ +/* Find the active NLA-strip within the given track */ +NlaStrip *BKE_nlastrip_find_active (NlaTrack *nlt) +{ + NlaStrip *strip; + + /* sanity check */ + if ELEM(NULL, nlt, nlt->strips.first) + return NULL; + + /* try to find the first active strip */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + if (strip->flag & NLASTRIP_FLAG_ACTIVE) + return strip; + } + + /* none found */ + return NULL; +} + /* Does the given NLA-strip fall within the given bounds (times)? */ short BKE_nlastrip_within_bounds (NlaStrip *strip, float min, float max) { diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 78fc4174f95..85bf733df87 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "DNA_listBase.h" #include "DNA_anim_types.h" @@ -87,37 +88,103 @@ extern void gl_round_box_shade(int mode, float minx, float miny, float maxx, flo /* *********************************************** */ /* Strips */ -static void nla_draw_strip (NlaTrack *nlt, NlaStrip *strip, View2D *v2d, float yminc, float ymaxc) +static void nla_strip_get_color_inside (AnimData *adt, NlaStrip *strip, float color[3]) { - /* draw extrapolation info first (as backdrop) */ - // TODO... - - /* draw 'inside' of strip itself */ - /* set color of strip - color is used to indicate status here */ - if (strip->flag & NLASTRIP_FLAG_ACTIVE) { - /* tweaking strip should be drawn green when it is acting as the tweaking strip */ + if ((strip->flag & NLASTRIP_FLAG_ACTIVE) && (adt && (adt->flag & ADT_NLA_EDIT_ON))) { + /* active strip should be drawn green when it is acting as the tweaking strip. + * however, this case should be skipped for when not in EditMode... + */ // FIXME: hardcoded temp-hack colors - glColor3f(0.3f, 0.95f, 0.1f); + color[0]= 0.3f; + color[1]= 0.95f; + color[2]= 0.1f; } else if (strip->flag & NLASTRIP_FLAG_TWEAKUSER) { /* alert user that this strip is also used by the tweaking track (this is set when going into * 'editmode' for that strip), since the edits made here may not be what the user anticipated */ // FIXME: hardcoded temp-hack colors - glColor3f(0.85f, 0.0f, 0.0f); + color[0]= 0.85f; + color[1]= 0.0f; + color[2]= 0.0f; } else if (strip->flag & NLASTRIP_FLAG_SELECT) { /* selected strip - use theme color for selected */ - UI_ThemeColor(TH_STRIP_SELECT); + UI_GetThemeColor3fv(TH_STRIP_SELECT, color); } else { /* normal, unselected strip - use standard strip theme color */ - UI_ThemeColor(TH_STRIP); + UI_GetThemeColor3fv(TH_STRIP, color); + } +} + +static void nla_draw_strip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2D *v2d, float yminc, float ymaxc) +{ + float color[3]; + + /* get color of strip */ + nla_strip_get_color_inside(adt, strip, color); + + /* draw extrapolation info first (as backdrop) */ + if (strip->extendmode != NLASTRIP_EXTEND_NOTHING) { + /* enable transparency... */ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + + switch (strip->extendmode) { + /* since this does both sides, only do the 'before' side, and leave the rest to the next case */ + case NLASTRIP_EXTEND_HOLD: + /* only need to draw here if there's no strip before since + * it only applies in such a situation + */ + if (strip->prev) { + /* set the drawing color to the color of the strip, but with very faint alpha */ + glColor4f(color[0], color[1], color[2], 0.15f); + + /* draw the rect to the edge of the screen */ + glBegin(GL_QUADS); + glVertex2f(v2d->cur.xmin, yminc); + glVertex2f(v2d->cur.xmin, ymaxc); + glVertex2f(strip->start, ymaxc); + glVertex2f(strip->start, yminc); + glEnd(); + } + /* no break needed... */ + + /* this only draws after the strip */ + case NLASTRIP_EXTEND_HOLD_FORWARD: + /* only need to try and draw if the next strip doesn't occur immediately after */ + if ((strip->next == NULL) || (IS_EQ(strip->next->start, strip->end)==0)) { + /* set the drawing color to the color of the strip, but this time less faint */ + glColor4f(color[0], color[1], color[2], 0.3f); + + /* draw the rect to the next strip or the edge of the screen */ + glBegin(GL_QUADS); + glVertex2f(strip->end, yminc); + glVertex2f(strip->end, ymaxc); + + if (strip->next) { + glVertex2f(strip->next->start, ymaxc); + glVertex2f(strip->next->start, yminc); + } + else { + glVertex2f(v2d->cur.xmax, ymaxc); + glVertex2f(v2d->cur.xmax, yminc); + } + glEnd(); + } + break; + } + + glDisable(GL_BLEND); } + + /* draw 'inside' of strip itself */ + glColor3fv(color); uiSetRoundBox(15); /* all corners rounded */ gl_round_box_shade(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1); - /* draw strip outline */ + /* draw strip outline - different colors are used here... */ if (strip->flag & NLASTRIP_FLAG_ACTIVE) { /* strip should appear 'sunken', so draw a light border around it */ glColor3f(0.9f, 1.0f, 0.9f); // FIXME: hardcoded temp-hack colors @@ -150,6 +217,7 @@ static void nla_draw_strip_text (NlaTrack *nlt, NlaStrip *strip, int index, View /* set bounding-box for text * - padding of 2 'units' on either side */ + // TODO: make this centered? rect.xmin= strip->start + 2; rect.ymin= yminc; rect.xmax= strip->end - 2; @@ -204,6 +272,7 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) switch (ale->type) { case ANIMTYPE_NLATRACK: { + AnimData *adt= BKE_animdata_from_id(ale->id); NlaTrack *nlt= (NlaTrack *)ale->data; NlaStrip *strip; int index; @@ -215,7 +284,7 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) for (strip=nlt->strips.first, index=1; strip; strip=strip->next, index++) { if (BKE_nlastrip_within_bounds(strip, v2d->cur.xmin, v2d->cur.xmax)) { /* draw the visualisation of the strip */ - nla_draw_strip(nlt, strip, v2d, yminc, ymaxc); + nla_draw_strip(adt, nlt, strip, v2d, yminc, ymaxc); /* add the text for this strip to the cache */ nla_draw_strip_text(nlt, strip, index, v2d, yminc, ymaxc); @@ -235,11 +304,14 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) else glColor4f(0.6f, 0.5f, 0.5f, 0.3f); // greyish-red color - hardcoded for now + /* draw slightly shifted up for greater separation from standard channels, + * but also slightly shorter for some more contrast when viewing the strips + */ glBegin(GL_QUADS); - glVertex2f(v2d->cur.xmin, yminc); - glVertex2f(v2d->cur.xmin, ymaxc); - glVertex2f(v2d->cur.xmax, ymaxc); - glVertex2f(v2d->cur.xmax, yminc); + glVertex2f(v2d->cur.xmin, yminc+NLACHANNEL_SKIP); + glVertex2f(v2d->cur.xmin, ymaxc-NLACHANNEL_SKIP); + glVertex2f(v2d->cur.xmax, ymaxc-NLACHANNEL_SKIP); + glVertex2f(v2d->cur.xmax, yminc+NLACHANNEL_SKIP); glEnd(); glDisable(GL_BLEND); @@ -570,8 +642,12 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) glColor3f(0.6f, 0.5f, 0.5f); // greyish-red color - hardcoded for now offset += 7 * indent; - uiSetRoundBox((1|2)); // only on top two corners, to show that this channel sits on top of the preceeding ones - gl_round_box(GL_POLYGON, x+offset, yminc, (float)NLACHANNEL_NAMEWIDTH, ymaxc, 8); + + /* only on top two corners, to show that this channel sits on top of the preceeding ones */ + uiSetRoundBox((1|2)); + + /* draw slightly shifted up vertically to look like it has more separtion from other channels */ + gl_round_box(GL_POLYGON, x+offset, yminc+NLACHANNEL_SKIP, (float)NLACHANNEL_NAMEWIDTH, ymaxc+NLACHANNEL_SKIP, 8); /* clear group value, otherwise we cause errors... */ group = 0; diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 5d9fe5f2a05..0626d9febe4 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -98,10 +98,16 @@ static short selmodes_to_flagmodes (short sel) * 3) (de)select all - no testing is done; only for use internal tools as normal function... */ +enum { + DESELECT_STRIPS_NOTEST = 0, + DESELECT_STRIPS_TEST, + DESELECT_STRIPS_CLEARACTIVE, +} eDeselectNlaStrips; + /* Deselects strips in the NLA Editor * - This is called by the deselect all operator, as well as other ones! * - * - test: check if select or deselect all + * - test: check if select or deselect all (1) or clear all active (2) * - sel: how to select keyframes * 0 = deselect * 1 = select @@ -121,7 +127,7 @@ static void deselect_nla_strips (bAnimContext *ac, short test, short sel) ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* See if we should be selecting or deselecting */ - if (test) { + if (test == DESELECT_STRIPS_TEST) { for (ale= anim_data.first; ale; ale= ale->next) { NlaTrack *nlt= (NlaTrack *)ale->data; NlaStrip *strip; @@ -150,9 +156,11 @@ static void deselect_nla_strips (bAnimContext *ac, short test, short sel) /* apply same selection to all strips */ for (strip= nlt->strips.first; strip; strip= strip->next) { /* set selection */ - ACHANNEL_SET_FLAG(strip, smode, NLASTRIP_FLAG_SELECT); + if (test != DESELECT_STRIPS_CLEARACTIVE) + ACHANNEL_SET_FLAG(strip, smode, NLASTRIP_FLAG_SELECT); /* clear active flag */ + // TODO: for clear active, do we want to limit this to only doing this on a certain set of tracks though? strip->flag &= ~NLASTRIP_FLAG_ACTIVE; } } @@ -173,9 +181,9 @@ static int nlaedit_deselectall_exec(bContext *C, wmOperator *op) /* 'standard' behaviour - check if selected, then apply relevant selection */ if (RNA_boolean_get(op->ptr, "invert")) - deselect_nla_strips(&ac, 0, SELECT_INVERT); + deselect_nla_strips(&ac, DESELECT_STRIPS_NOTEST, SELECT_INVERT); else - deselect_nla_strips(&ac, 1, SELECT_ADD); + deselect_nla_strips(&ac, DESELECT_STRIPS_TEST, SELECT_ADD); /* set notifier that things have changed */ ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); @@ -292,7 +300,8 @@ static void mouse_nla_strips (bAnimContext *ac, int mval[2], short select_mode) NlaTrack *nlt= (NlaTrack *)ale->data; nlt->flag |= NLATRACK_SELECTED; - ANIM_set_active_channel(ac->data, ac->datatype, filter, nlt, ANIMTYPE_NLATRACK); + if (nlt->flag & NLATRACK_SELECTED) + ANIM_set_active_channel(ac->data, ac->datatype, filter, nlt, ANIMTYPE_NLATRACK); } } @@ -302,6 +311,13 @@ static void mouse_nla_strips (bAnimContext *ac, int mval[2], short select_mode) if (strip) { select_mode= selmodes_to_flagmodes(select_mode); ACHANNEL_SET_FLAG(strip, select_mode, NLASTRIP_FLAG_SELECT); + + /* if we selected it, we can make it active too + * - we always need to clear the active strip flag though... + */ + deselect_nla_strips(ac, DESELECT_STRIPS_CLEARACTIVE, 0); + if (strip->flag & NLASTRIP_FLAG_SELECT) + strip->flag |= NLASTRIP_FLAG_ACTIVE; } /* free this channel */ diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 1bed72b82fb..39579ec96da 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -253,6 +253,8 @@ static void nla_main_area_draw(const bContext *C, ARegion *ar) UI_view2d_text_cache_draw(ar); } + UI_view2d_view_ortho(C, v2d); + /* current frame */ if (snla->flag & SNLA_DRAWTIME) flag |= DRAWCFRA_UNIT_SECONDS; if ((snla->flag & SNLA_NODRAWCFRANUM)==0) flag |= DRAWCFRA_SHOW_NUMBOX; -- cgit v1.2.3 From 541265328990d0b380686f46d3a288c04b39e6f5 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Wed, 3 Jun 2009 14:55:41 +0000 Subject: This is coverity issue: CID: 595 Checker: OVERRUN_STATIC (help) File: base/src/source/blender/python/api2_2x/sceneSequence.c Function: Sequence_setProxyDir Description: Overrun of static array "&((((self)->seq)->strip)->proxy)->dir" of size 160 bytes by passing it to a function which indexes it with argument "248" at byte position 247 Wasn't using the size of dir it was using the sizeof the struct dir is in. Fixed. Kent --- source/blender/python/api2_2x/sceneSequence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/sceneSequence.c b/source/blender/python/api2_2x/sceneSequence.c index afcc8e0588d..8bb8887f36a 100644 --- a/source/blender/python/api2_2x/sceneSequence.c +++ b/source/blender/python/api2_2x/sceneSequence.c @@ -727,7 +727,7 @@ static int Sequence_setProxyDir(BPy_Sequence * self, PyObject * value) else { self->seq->strip->proxy = MEM_callocN(sizeof (struct StripProxy), "StripProxy"); - strncpy(self->seq->strip->proxy->dir, name, sizeof (struct StripProxy)); + strncpy(self->seq->strip->proxy->dir, name, 160); } return 0; } -- cgit v1.2.3 From eafd2720f65224791a59e763c1a9de529dfe70d5 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Wed, 3 Jun 2009 15:14:09 +0000 Subject: Missed this one before. It's another coverity issue: CID: 477 Checker: REVERSE_INULL (help) File: base/src/source/blender/blenkernel/intern/cloth.c Function: cloth_apply_vgroup Description: Pointer "dm" dereferenced before NULL check Just like the others it assigned the value twice, removed the one that was before checking for NULL. Kent --- source/blender/blenkernel/intern/cloth.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index f74c96482e0..af42d612870 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -786,15 +786,14 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, DerivedMesh *dm ) int j = 0; MDeformVert *dvert = NULL; Cloth *clothObj = NULL; - int numverts = dm->getNumVerts ( dm ); + int numverts; float goalfac = 0; ClothVertex *verts = NULL; + if (!clmd || !dm) return; + clothObj = clmd->clothObject; - if ( !dm ) - return; - numverts = dm->getNumVerts ( dm ); verts = clothObj->verts; -- cgit v1.2.3 From e650251948790e4e2f3819810953b68eee9247c7 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Wed, 3 Jun 2009 15:24:42 +0000 Subject: coverity CID: 374 Checker: FORWARD_NULL (help) File: base/src/source/blender/src/toolbox.c Function: tb_do_render Description: Variable "ca" tracked as NULL was dereferenced. Moved check for null to include else statement. Kent --- source/blender/src/toolbox.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c index b675f6868f8..8da636f270f 100644 --- a/source/blender/src/toolbox.c +++ b/source/blender/src/toolbox.c @@ -1545,10 +1545,12 @@ static void tb_do_render(void *arg, int event){ ca= G.vd->camera->data; else return; - if (ca && (ca->flag & CAM_SHOWPASSEPARTOUT)) - ca->flag &= ~CAM_SHOWPASSEPARTOUT; - else - ca->flag |= CAM_SHOWPASSEPARTOUT; + if (ca) { + if (ca->flag & CAM_SHOWPASSEPARTOUT) + ca->flag &= ~CAM_SHOWPASSEPARTOUT; + else + ca->flag |= CAM_SHOWPASSEPARTOUT; + } allqueue(REDRAWVIEW3D, 0); } break; -- cgit v1.2.3 From 9b088acc676bed7f30851720358b00327905e85d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 3 Jun 2009 20:06:40 +0000 Subject: KX_MouseFocusSensor - bug reported by Micro27 on blenderartist vertical bounds checking for multiple viewports was inverted. quiet some compiler warnings and minor corrections --- source/blender/blenkernel/intern/fluidsim.c | 2 -- source/blender/blenloader/intern/readfile.c | 2 +- source/blender/python/api2_2x/sceneRender.c | 2 +- source/blender/src/fluidsim.c | 2 ++ source/blender/src/seqeffects.c | 4 ++-- source/gameengine/Ketsji/KX_MouseFocusSensor.cpp | 14 ++++++++++---- 6 files changed, 16 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/fluidsim.c b/source/blender/blenkernel/intern/fluidsim.c index b650f3a3e98..29c4e0f2fb5 100644 --- a/source/blender/blenkernel/intern/fluidsim.c +++ b/source/blender/blenkernel/intern/fluidsim.c @@ -36,8 +36,6 @@ #include "DNA_particle_types.h" #include "DNA_scene_types.h" // N_T -#include "PIL_time.h" // for PIL_sleep_ms - #include "BLI_arithb.h" #include "BLI_blenlib.h" diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 596910ea5ae..f0ec75dedd9 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4094,7 +4094,7 @@ void lib_link_screen_restore(Main *newmain, Scene *curscene) sipo->ipo= restore_pointer_by_name(newmain, (ID *)sipo->ipo, 0); if(sipo->blocktype==ID_SEQ) - sipo->from= find_sequence_from_ipo_helper(newmain, sipo->ipo); + sipo->from= (ID *)find_sequence_from_ipo_helper(newmain, sipo->ipo); else sipo->from= restore_pointer_by_name(newmain, (ID *)sipo->from, 0); diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c index a0087689885..dce9231cce5 100644 --- a/source/blender/python/api2_2x/sceneRender.c +++ b/source/blender/python/api2_2x/sceneRender.c @@ -663,7 +663,7 @@ static PyObject *RenderData_Play( BPy_RenderData * self ) #endif system( str ); } else - sprintf( "Can't find image: %s", file ); + printf("Can't find image: %s\n", file); } Py_RETURN_NONE; diff --git a/source/blender/src/fluidsim.c b/source/blender/src/fluidsim.c index 9c3116e53db..4be00b63ecb 100644 --- a/source/blender/src/fluidsim.c +++ b/source/blender/src/fluidsim.c @@ -89,6 +89,8 @@ #include "blendef.h" #include +#include "PIL_time.h" // for PIL_sleep_ms + #ifdef WIN32 /* Windos */ //#include "BLI_winstuff.h" #ifndef snprintf diff --git a/source/blender/src/seqeffects.c b/source/blender/src/seqeffects.c index 6b25499fe6b..1bffe25164c 100644 --- a/source/blender/src/seqeffects.c +++ b/source/blender/src/seqeffects.c @@ -1036,8 +1036,8 @@ static void do_gammacross_effect(Sequence * seq,int cfra, } else { do_gammacross_effect_byte( facf0, facf1, x, y, - (char*) ibuf1->rect, (char*) ibuf2->rect, - (char*) out->rect); + (unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect, + (unsigned char*) out->rect); } } diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index 74b5c923db8..fde10a493db 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -197,13 +197,15 @@ bool KX_MouseFocusSensor::ParentObjectHasFocusCamera(KX_Camera *cam) * division by 0.0...*/ RAS_Rect area, viewport; + short m_y_inv = m_kxengine->GetCanvas()->GetHeight()-m_y; + m_kxengine->GetSceneViewport(m_kxscene, cam, area, viewport); /* Check if the mouse is in the viewport */ if (( m_x < viewport.m_x2 && // less then right m_x > viewport.m_x1 && // more then then left - m_y < viewport.m_y2 && // below top - m_y > viewport.m_y1) == 0) // above bottom + m_y_inv < viewport.m_y2 && // below top + m_y_inv > viewport.m_y1) == 0) // above bottom { return false; } @@ -217,6 +219,10 @@ bool KX_MouseFocusSensor::ParentObjectHasFocusCamera(KX_Camera *cam) MT_Vector4 frompoint; MT_Vector4 topoint; + /* m_y_inv - inverting for a bounds check is only part of it, now make relative to view bounds */ + m_y_inv = (viewport.m_y2 - m_y_inv) + viewport.m_y1; + + /* There's some strangeness I don't fully get here... These values * _should_ be wrong! - see from point Z values */ @@ -229,13 +235,13 @@ bool KX_MouseFocusSensor::ParentObjectHasFocusCamera(KX_Camera *cam) * behind of the near and far clip planes. */ frompoint.setValue( (2 * (m_x-x_lb) / width) - 1.0, - 1.0 - (2 * (m_y - y_lb) / height), + 1.0 - (2 * (m_y_inv - y_lb) / height), /*cam->GetCameraData()->m_perspective ? 0.0:cdata->m_clipstart,*/ /* real clipstart is scaled in ortho for some reason, zero is ok */ 0.0, /* nearclip, see above comments */ 1.0 ); topoint.setValue( (2 * (m_x-x_lb) / width) - 1.0, - 1.0 - (2 * (m_y-y_lb) / height), + 1.0 - (2 * (m_y_inv-y_lb) / height), cam->GetCameraData()->m_perspective ? 1.0:cam->GetCameraData()->m_clipend, /* farclip, see above comments */ 1.0 ); -- cgit v1.2.3 From cf6ed235784c6b5658fe53a2e52199ac87263b5c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 4 Jun 2009 07:42:03 +0000 Subject: BGE small fixes - script template use new property syntax - Python could set the axis/hat to a negative index and crash blender (nobody complained) - Servo control UI had overlapping text --- source/blender/src/buttons_logic.c | 2 +- source/gameengine/GameLogic/SCA_JoystickSensor.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 9fb6ec4752b..6a14bbaec6c 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -1864,7 +1864,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh } uiDefBut(block, LABEL, 0, "Servo", xco, yco-152, 45, 19, NULL, 0, 0, 0, 0, "Coefficients of the PID servo controller"); uiDefButF(block, NUMSLI, B_REDR, "P: ", xco+45, yco-152, wval*3, 19, oa->forcerot, 0.00, 200.0, 100, 0, "Proportional coefficient, typical value is 60x Integral coefficient"); - uiDefBut(block, LABEL, 0, "Slow", xco, yco-152, 45, 19, NULL, 0, 0, 0, 0, "Low value of I coefficient correspond to slow response"); + uiDefBut(block, LABEL, 0, "Slow", xco, yco-171, 45, 19, NULL, 0, 0, 0, 0, "Low value of I coefficient correspond to slow response"); but = uiDefButF(block, NUMSLI, B_REDR, " I : ", xco+45, yco-171, wval*3, 19, oa->forcerot+1, 0.0, 3.0, 1, 0, "Integral coefficient, low value (0.01) for slow response, high value (0.5) for fast response"); uiButSetFunc(but, update_object_actuator_PID, oa, NULL); uiDefBut(block, LABEL, 0, "Fast", xco+45+3*wval, yco-171, 45, 19, NULL, 0, 0, 0, 0, "High value of I coefficient correspond to fast response"); diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index 16061d6fb6e..336529667d7 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -392,6 +392,8 @@ PyObject* SCA_JoystickSensor::PySetAxis( PyObject* args ) { } m_axis = axis; m_axisf = axisflag; + + CheckAxis((void *)this, NULL); /* clamp values */ Py_RETURN_NONE; } @@ -533,6 +535,8 @@ PyObject* SCA_JoystickSensor::PySetHat( PyObject* args ) { } m_hat = hat; m_hatf = hatflag; + + CheckHat((void *)this, NULL); /* clamp values */ Py_RETURN_NONE; } -- cgit v1.2.3 From 549d1d37420637cb307a1ca85f157392dbcc26ea Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 4 Jun 2009 15:44:43 +0000 Subject: Bugfix Loading font used a minimal string array (80 chars) and copied file name strings in it without size checks. Triple tsk! --- source/blender/src/buttons_editing.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 43fafeb387a..b4eddfde865 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -2919,7 +2919,7 @@ void do_fontbuts(unsigned short event) VFont *vf; Object *ob; ScrArea *sa; - char str[80]; + char str[FILE_MAX]; int ctevt; char *ctmenu; DynStr *ds; @@ -2988,8 +2988,8 @@ void do_fontbuts(unsigned short event) break; case B_LOADFONT: vf= give_vfontpointer(G.buts->texnr); - if(vf && vf->id.prev!=vf->id.next) strcpy(str, vf->name); - else strcpy(str, U.fontdir); + if(vf && vf->id.prev!=vf->id.next) BLI_strncpy(str, vf->name, FILE_MAX); + else BLI_strncpy(str, U.fontdir, FILE_MAX); sa= closest_bigger_area(); areawinset(sa->win); -- cgit v1.2.3 From aa0f4fb6940c61446173010863e6a4ce871d0eeb Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Thu, 4 Jun 2009 15:58:47 +0000 Subject: coverity issue CID: 488 Checker: REVERSE_INULL (help) File: base/src/source/blender/src/hddaudio.c Function: sound_hdaudio_extract_small_block Description: Pointer "hdaudio" dereferenced before NULL check Moved some init code that uses a pointer to after the check to see if pointer is valid. Kent --- source/blender/src/hddaudio.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/src/hddaudio.c b/source/blender/src/hddaudio.c index bfddd29b198..2aa434e4ac7 100644 --- a/source/blender/src/hddaudio.c +++ b/source/blender/src/hddaudio.c @@ -316,20 +316,22 @@ static void sound_hdaudio_extract_small_block( int nb_samples /* in target */) { AVPacket packet; - int frame_position; - int frame_size = (long long) target_rate + int frame_position, frame_size, in_frame_size, rate_conversion; + int sample_ofs; + + if (hdaudio == 0) return; + + frame_size = (long long) target_rate * hdaudio->frame_duration / AV_TIME_BASE; - int in_frame_size = (long long) hdaudio->sample_rate + in_frame_size = (long long) hdaudio->sample_rate * hdaudio->frame_duration / AV_TIME_BASE; - int rate_conversion = + rate_conversion = (target_rate != hdaudio->sample_rate) || (target_channels != hdaudio->channels); - int sample_ofs = target_channels * (sample_position % frame_size); + sample_ofs = target_channels * (sample_position % frame_size); frame_position = sample_position / frame_size; - if (hdaudio == 0) return; - if (rate_conversion) { sound_hdaudio_init_resampler( hdaudio, frame_position, -- cgit v1.2.3 From 8154de7045db47677a367875fd619cc389f6e8d4 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 4 Jun 2009 21:24:41 +0000 Subject: BGE [#18884] light in skinned object only work properly after running the action once. --- source/gameengine/Converter/BL_MeshDeformer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_MeshDeformer.cpp b/source/gameengine/Converter/BL_MeshDeformer.cpp index b49544050d1..d7012abe316 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.cpp +++ b/source/gameengine/Converter/BL_MeshDeformer.cpp @@ -143,9 +143,9 @@ void BL_MeshDeformer::RecalcNormals() RAS_TexVert& v3 = it.vertex[it.index[i+2]]; RAS_TexVert *v4 = NULL; - const float *co1 = v1.getXYZ(); - const float *co2 = v2.getXYZ(); - const float *co3 = v3.getXYZ(); + const float *co1 = m_transverts[v1.getOrigIndex()]; + const float *co2 = m_transverts[v2.getOrigIndex()]; + const float *co3 = m_transverts[v3.getOrigIndex()]; const float *co4 = NULL; /* compute face normal */ @@ -153,7 +153,7 @@ void BL_MeshDeformer::RecalcNormals() if(nvert == 4) { v4 = &it.vertex[it.index[i+3]]; - co4 = v4->getXYZ(); + co4 = m_transverts[v4->getOrigIndex()]; n1[0]= co1[0]-co3[0]; n1[1]= co1[1]-co3[1]; -- cgit v1.2.3 From 52b7c157a0c0d0bd1836be3149c683abf8bd1743 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 5 Jun 2009 00:51:36 +0000 Subject: getScreenPosition, Ray and Vect fixes: - fix for [#18867] getScreenRay error ... the Vector wasn't been added to KX_Camera origin. Therefore the Ray was always casted to the wrong coordinate when camera wasn't in [0,0,0] (where is obviously was in my tests :) - making the input parameter compatible with Blender/BGE window coordinate system (Top-Bottom). ... that will break scripts done in 2.49. Since this feature was added only in 2.49 that fix is OK. (and the fix is ridiculous. Note: the input parameter is normalized. That means it runs from 0.0 to 1.0. Some users found it confusing, but it allows to make a game compatible with multiple desktop resolutions.a --- source/gameengine/Ketsji/KX_Camera.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 1d6c5f77ae5..ba4d6e22872 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -1047,8 +1047,10 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, getScreenPosition, gluProject(vect[0], vect[1], vect[2], modelmatrix, projmatrix, viewport, &win[0], &win[1], &win[2]); - vect[0] = win[0] / (viewport[0] + viewport[2]); - vect[1] = win[1] / (viewport[1] + viewport[3]); + vect[0] = (win[0] - viewport[0]) / viewport[2]; + vect[1] = (win[1] - viewport[1]) / viewport[3]; + + vect[1] = 1.0 - vect[1]; //to follow Blender window coordinate system (Top-Down) PyObject* ret = PyTuple_New(2); if(ret){ @@ -1068,6 +1070,8 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenVect, if (!PyArg_ParseTuple(args,"dd:getScreenVect",&x,&y)) return NULL; + y = 1.0 - y; //to follow Blender window coordinate system (Top-Down) + MT_Vector3 vect; MT_Point3 campos, screenpos; @@ -1127,7 +1131,8 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenRay, } Py_DECREF(argValue); - dist *= -1.0; + dist = -dist; + vect += this->GetCameraLocation(); argValue = (propName?PyTuple_New(3):PyTuple_New(2)); if (argValue) { -- cgit v1.2.3 From d585a201e1f1494888c75f4391b30ae7e60d65d7 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Fri, 5 Jun 2009 03:40:58 +0000 Subject: coverity issue CID: 484 Checker: REVERSE_INULL (help) File: base/src/source/blender/imbuf/intern/anim.c Function: IMB_anim_absolute Description: Pointer "anim" dereferenced before NULL check again moving init code after check to valid pointer. Kent --- source/blender/imbuf/intern/anim.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/imbuf/intern/anim.c b/source/blender/imbuf/intern/anim.c index 42fe47cc5e9..3e09eb5e306 100644 --- a/source/blender/imbuf/intern/anim.c +++ b/source/blender/imbuf/intern/anim.c @@ -1046,10 +1046,11 @@ struct ImBuf * IMB_anim_absolute(struct anim * anim, int position) { char head[256], tail[256]; unsigned short digits; int pic; - int filter_y = (anim->ib_flags & IB_animdeinterlace); - + int filter_y; if (anim == NULL) return(0); + filter_y = (anim->ib_flags & IB_animdeinterlace); + if (anim->curtype == 0) { ibuf = anim_getnew(anim); if (ibuf == NULL) { -- cgit v1.2.3 From 010a9c0b00aa6c8ce8fdcb60c79d70d71f5c4022 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Fri, 5 Jun 2009 03:52:24 +0000 Subject: coverity issues: CID: 506 Checker: REVERSE_INULL (help) File: base/src/source/blender/src/editparticle.c Function: PE_mirror_x Description: Pointer "(edit)->keys" dereferenced before NULL check and CID: 507 Checker: REVERSE_INULL (help) File: base/src/source/blender/src/editparticle.c Function: PE_mirror_x Description: Pointer "(psys)->particles" dereferenced before NULL check No need to copy the memory if the pointer isn't valid. Kent --- source/blender/src/editparticle.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/src/editparticle.c b/source/blender/src/editparticle.c index d48b84789d8..f91b2a0d435 100644 --- a/source/blender/src/editparticle.c +++ b/source/blender/src/editparticle.c @@ -2844,13 +2844,16 @@ void PE_mirror_x(int tagged) new_pars= MEM_callocN(newtotpart*sizeof(ParticleData), "ParticleData new"); new_keys= MEM_callocN(newtotpart*sizeof(ParticleEditKey*), "ParticleEditKey new"); - memcpy(new_pars, psys->particles, totpart*sizeof(ParticleData)); - memcpy(new_keys, edit->keys, totpart*sizeof(ParticleEditKey*)); - - if(psys->particles) MEM_freeN(psys->particles); + if(psys->particles) { + memcpy(new_pars, psys->particles, totpart*sizeof(ParticleData)); + MEM_freeN(psys->particles); + } psys->particles= new_pars; - if(edit->keys) MEM_freeN(edit->keys); + if(edit->keys) { + memcpy(new_keys, edit->keys, totpart*sizeof(ParticleEditKey*)); + MEM_freeN(edit->keys); + } edit->keys= new_keys; if(edit->mirror_cache) { -- cgit v1.2.3 From c5b05fd4503359e929c501e3de61144d98f87e7b Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Fri, 5 Jun 2009 04:15:19 +0000 Subject: coverity issues: CID: 478 Checker: REVERSE_INULL (help) File: base/src/source/blender/blenkernel/intern/softbody.c Function: apply_spring_memory Description: Pointer "sb" dereferenced before NULL check and CID: 480 Checker: REVERSE_INULL (help) File: base/src/source/blender/blenkernel/intern/softbody.c Function: springs_from_particles Description: Pointer "ob" dereferenced before NULL check again moved assignment after check to make sure pointer is valid. Kent --- source/blender/blenkernel/intern/softbody.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index f63f6edf4b3..011660a7f8b 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -3075,8 +3075,8 @@ static void apply_spring_memory(Object *ob) int a; float b,l,r; - b = sb->plastic; if (sb && sb->totspring){ + b = sb->plastic; for(a=0; atotspring; a++) { bs = &sb->bspring[a]; bp1 =&sb->bpoint[bs->v1]; @@ -3546,9 +3546,9 @@ static void springs_from_particles(Object *ob) int a,k; float hairmat[4][4]; - psys= ob->soft->particles; - sb= ob->soft; - if(ob && sb && psys) { + if(ob && ob->soft && ob->soft->particles) { + psys= ob->soft->particles; + sb= ob->soft; psmd = psys_get_modifier(ob, psys); bp= sb->bpoint; -- cgit v1.2.3 From 5c21c176fa0a571f3ba47af8ad2c7906a5dc375f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 5 Jun 2009 05:18:07 +0000 Subject: NLA SoC: Operators for 'tweaking' strip actions (TAB-Key for both) In this commit, I've introduced the mechanism by which actions already referenced by strips used in the NLA can be edited (or 'tweaked'). To use, simply select a strip you wish to edit, and hit that TAB key to start tweaking that strip's action, and hit TAB again once you're done. What happens when you enter 'tweak mode': 1) The action of the active strip temporarily becomes the 'active action' of the AnimData block. You are now able to edit this in one of the Animation Editors (DopeSheet/Action, Graph Editors) as per normal (i.e. sliding keyframes around, inserting keyframes, etc.). The 'action-line' will therefore get drawn immediately above the active track containing the active strip, so that it's clear that that's what we're editing. 2) All the NLA-tracks (and all the strips within them) that occur after the track that the active strip lived in get disabled while you're in tweakmode. This is equivalent to travelling back to an earlier state in a construction history stack. 3) The active NLA track also gets disabled while in tweakmode, since it would otherwise interfere with the correct functioning of the tweaking for the action of interest. 4) The 'real' active action (i.e. the one displaced by the active strip's action) gets put into temp storage, and will be restored after you exit tweakmode. 5) Any strips which also reference the action being tweaked will get highlighted in red shading to indicate that you may be making some changes to the action which you don't really want to make for the other users too. Please note though, that this is only a rough prototype of this functionality, with some niceties still to come. i.e.: * NLA-tracks after the active track should still get drawn above the 'tweaking action line', but perhaps with different appearance? * Various tools will still need awareness of this to prevent corrupting operations from taking place. How to proceed is still undecided... * When exiting tweak-mode, the strip the action came from still needs some form of syncing with the modified action... there are a few tricky issues here that will need to be solved * Evaluation code doesn't totally take this into account yet... --- Also, fixed a number of bugs with various code (notably selection, and also a few drawing bugs) --- source/blender/blenkernel/BKE_nla.h | 4 + source/blender/blenkernel/intern/anim_sys.c | 15 ++- source/blender/blenkernel/intern/nla.c | 100 +++++++++++++++ source/blender/editors/animation/anim_channels.c | 12 +- source/blender/editors/animation/anim_filter.c | 118 +++++++++++++++++- source/blender/editors/include/ED_anim_api.h | 6 +- source/blender/editors/include/ED_screen.h | 1 + source/blender/editors/screen/screen_ops.c | 6 + .../blender/editors/space_action/action_select.c | 4 +- source/blender/editors/space_graph/graph_select.c | 2 +- source/blender/editors/space_nla/nla_channels.c | 2 +- source/blender/editors/space_nla/nla_draw.c | 81 +++++++----- source/blender/editors/space_nla/nla_edit.c | 137 +++++++++++++++++++++ source/blender/editors/space_nla/nla_intern.h | 8 ++ source/blender/editors/space_nla/nla_ops.c | 56 +++++++++ source/blender/editors/space_nla/nla_select.c | 3 +- source/blender/makesdna/DNA_action_types.h | 1 + source/blender/makesdna/DNA_anim_types.h | 11 +- source/blender/makesdna/DNA_scene_types.h | 1 + 19 files changed, 514 insertions(+), 54 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 3c3abe11da3..89e5f1af7e1 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -59,9 +59,13 @@ void BKE_nlatrack_set_active(ListBase *tracks, struct NlaTrack *nlt); short BKE_nlatrack_has_space(struct NlaTrack *nlt, float start, float end); void BKE_nlatrack_sort_strips(struct NlaTrack *nlt); +struct NlaStrip *BKE_nlastrip_find_active(struct NlaTrack *nlt); short BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max); void BKE_nla_action_pushdown(struct AnimData *adt); +short BKE_nla_tweakmode_enter(struct AnimData *adt); +void BKE_nla_tweakmode_exit(struct AnimData *adt); + #endif diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 652f733d553..dbc38d2fc7e 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -118,6 +118,9 @@ void BKE_free_animdata (ID *id) /* unlink action (don't free, as it's in its own list) */ if (adt->action) adt->action->id.us--; + /* same goes for the temporarily displaced action */ + if (adt->tmpact) + adt->tmpact->id.us--; /* free nla data */ free_nladata(&adt->nla_tracks); @@ -151,6 +154,7 @@ AnimData *BKE_copy_animdata (AnimData *adt) // XXX review this... it might not be optimal behaviour yet... //id_us_plus((ID *)dadt->action); dadt->action= copy_action(adt->action); + dadt->tmpact= copy_action(adt->action); /* duplicate NLA data */ copy_nladata(&dadt->nla_tracks, &adt->nla_tracks); @@ -595,7 +599,7 @@ static float nlastrip_get_frame (NlaStrip *strip, float cframe, short invert) scale = (float)fabs(strip->scale); /* scale must be positive - we've got a special flag for reversing */ /* length of referenced action */ - actlength = strip->actend-strip->actstart; + actlength = strip->actend - strip->actstart; if (actlength == 0.0f) actlength = 1.0f; /* length of strip */ @@ -630,11 +634,11 @@ static float nlastrip_get_influence (NlaStrip *strip, float cframe) // the +0.0001 factors are to combat rounding errors if (IS_EQ(strip->blendin, 0)==0 && (cframe <= (strip->start + strip->blendin))) { /* there is some blend-in */ - return (float)(fabs(cframe - strip->start) + 0.0001) / (strip->blendin); + return (float)fabs(cframe - strip->start) / (strip->blendin); } else if (IS_EQ(strip->blendout, 0)==0 && (cframe >= (strip->end - strip->blendout))) { /* there is some blend-out */ - return (float)(fabs(strip->end - cframe) + 0.0001) / (strip->blendout); + return (float)fabs(strip->end - cframe) / (strip->blendout); } else { /* in the middle of the strip, we should be full strength */ @@ -674,8 +678,8 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index NlaEvalStrip *nes; short side= 0; - /* skip if track is muted */ - if (nlt->flag & NLATRACK_MUTED) + /* skip if track is muted or disabled */ + if (nlt->flag & (NLATRACK_MUTED|NLATRACK_DISABLED)) return; /* loop over strips, checking if they fall within the range */ @@ -1104,6 +1108,7 @@ void BKE_animsys_evaluate_animdata (ID *id, AnimData *adt, float ctime, short re * - NLA before Active Action, as Active Action behaves as 'tweaking track' * that overrides 'rough' work in NLA */ + // TODO: need to double check that this all works correctly if ((recalc & ADT_RECALC_ANIM) || (adt->recalc & ADT_RECALC_ANIM)) { /* evaluate NLA data */ diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 6235ec58d40..84f98096364 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -583,4 +583,104 @@ void BKE_nla_action_pushdown (AnimData *adt) } } + +/* Find the active strip + track combo, and set them up as the tweaking track, + * and return if successful or not. + */ +short BKE_nla_tweakmode_enter (AnimData *adt) +{ + NlaTrack *nlt, *activeTrack=NULL; + NlaStrip *strip, *activeStrip=NULL; + + /* verify that data is valid */ + if ELEM(NULL, adt, adt->nla_tracks.first) + return 0; + + /* if block is already in tweakmode, just leave, but we should report + * that this block is in tweakmode (as our returncode) + */ + // FIXME: hopefully the flag is correct! + if (adt->flag & ADT_NLA_EDIT_ON) + return 1; + + /* go over the tracks, finding the active one, and its active strip + * - if we cannot find both, then there's nothing to do + */ + for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { + /* check if active */ + if (nlt->flag & NLATRACK_ACTIVE) { + /* store reference to this active track */ + activeTrack= nlt; + + /* now try to find active strip */ + activeStrip= BKE_nlastrip_find_active(nlt); + break; + } + } + if ELEM3(NULL, activeTrack, activeStrip, activeStrip->act) { + printf("NLA tweakmode enter - neither active requirement found \n"); + return 0; + } + + /* go over all the tracks up to the active one, tagging each strip that uses the same + * action as the active strip, but leaving everything else alone + */ + for (nlt= activeTrack->prev; nlt; nlt= nlt->prev) { + for (strip= nlt->strips.first; strip; strip= strip->next) { + if (strip->act == activeStrip->act) + strip->flag |= NLASTRIP_FLAG_TWEAKUSER; + else + strip->flag &= ~NLASTRIP_FLAG_TWEAKUSER; // XXX probably don't need to clear this... + } + } + + + /* go over all the tracks after AND INCLUDING the active one, tagging them as being disabled + * - the active track needs to also be tagged, otherwise, it'll overlap with the tweaks going on + */ + for (nlt= activeTrack; nlt; nlt= nlt->next) + nlt->flag |= NLATRACK_DISABLED; + + /* handle AnimData level changes: + * - 'real' active action to temp storage (no need to change user-counts) + * - action of active strip set to be the 'active action' + * - editing-flag for this AnimData block should also get turned on (for more efficient restoring) + */ + adt->tmpact= adt->action; + adt->action= activeStrip->act; + adt->flag |= ADT_NLA_EDIT_ON; + + /* done! */ + return 1; +} + +/* Exit tweakmode for this AnimData block */ +void BKE_nla_tweakmode_exit (AnimData *adt) +{ + NlaTrack *nlt; + + /* verify that data is valid */ + if ELEM(NULL, adt, adt->nla_tracks.first) + return; + + /* hopefully the flag is correct - skip if not on */ + if ((adt->flag & ADT_NLA_EDIT_ON) == 0) + return; + + // TODO: need to sync the user-strip with the new state of the action! + + /* for all NLA-tracks, clear the 'disabled' flag */ + for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) + nlt->flag &= ~NLATRACK_DISABLED; + + /* handle AnimData level changes: + * - 'real' active action is restored from storage + * - storage pointer gets cleared (to avoid having bad notes hanging around) + * - editing-flag for this AnimData block should also get turned off + */ + adt->action= adt->tmpact; + adt->tmpact= NULL; + adt->flag &= ~ADT_NLA_EDIT_ON; +} + /* *************************************************** */ diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index 658bff73978..59fb56f3c35 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -90,14 +90,13 @@ /* -------------------------- Exposed API ----------------------------------- */ /* Set the given animation-channel as the active one for the active context */ -void ANIM_set_active_channel (void *data, short datatype, int filter, void *channel_data, short channel_type) +void ANIM_set_active_channel (bAnimContext *ac, void *data, short datatype, int filter, void *channel_data, short channel_type) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; /* try to build list of filtered items */ - // XXX we don't need/supply animcontext for now, since in this case, there's nothing really essential there that isn't already covered - ANIM_animdata_filter(NULL, &anim_data, filter, data, datatype); + ANIM_animdata_filter(ac, &anim_data, filter, data, datatype); if (anim_data.first == NULL) return; @@ -151,8 +150,7 @@ void ANIM_set_active_channel (void *data, short datatype, int filter, void *chan case ANIMTYPE_NLATRACK: { NlaTrack *nlt= (NlaTrack *)channel_data; - - ACHANNEL_SET_FLAG(nlt, ACHANNEL_SETFLAG_CLEAR, NLATRACK_ACTIVE); + nlt->flag |= NLATRACK_ACTIVE; } break; } @@ -1474,7 +1472,7 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s /* if group is selected now, make group the 'active' one in the visible list */ if (agrp->flag & AGRP_SELECTED) - ANIM_set_active_channel(ac->data, ac->datatype, filter, agrp, ANIMTYPE_GROUP); + ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, agrp, ANIMTYPE_GROUP); } } break; @@ -1520,7 +1518,7 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s /* if F-Curve is selected now, make F-Curve the 'active' one in the visible list */ if (fcu->flag & FCURVE_SELECTED) - ANIM_set_active_channel(ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE); + ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE); } } break; diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index ed526bd99a0..32405571b57 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -343,19 +343,33 @@ short ANIM_animdata_get_context (const bContext *C, bAnimContext *ac) /* quick macro to test if AnimData is usable for NLA */ #define ANIMDATA_HAS_NLA(id) ((id)->adt && (id)->adt->nla_tracks.first) -/* quick macro to test for all three avove usability tests, performing the appropriate provided + +/* Quick macro to test for all three avove usability tests, performing the appropriate provided * action for each when the AnimData context is appropriate. * - * Priority order for this goes (most important, to least): NLA, Drivers, Keyframes + * Priority order for this goes (most important, to least): AnimData blocks, NLA, Drivers, Keyframes. + * + * For this to work correctly, a standard set of data needs to be available within the scope that this + * gets called in: + * - ListBase anim_data; + * - bDopeSheet *ads; + * - bAnimListElem *ale; + * - int items; * * - id: ID block which should have an AnimData pointer following it immediately, to use + * - adtOk: line or block of code to execute for AnimData-blocks case (usually ANIMDATA_ADD_ANIMDATA) * - nlaOk: line or block of code to execute for NLA case * - driversOk: line or block of code to execute for Drivers case * - keysOk: line or block of code for Keyframes case */ -#define ANIMDATA_FILTER_CASES(id, nlaOk, driversOk, keysOk) \ +#define ANIMDATA_FILTER_CASES(id, adtOk, nlaOk, driversOk, keysOk) \ {\ - if (ads->filterflag & ADS_FILTER_ONLYNLA) {\ + if (filter_mode & ANIMFILTER_ANIMDATA) {\ + if ((id)->adt) {\ + adtOk\ + }\ + }\ + else if (ads->filterflag & ADS_FILTER_ONLYNLA) {\ if (ANIMDATA_HAS_NLA(id)) {\ nlaOk\ }\ @@ -376,6 +390,18 @@ short ANIM_animdata_get_context (const bContext *C, bAnimContext *ac) } +/* quick macro to add a pointer to an AnimData block as a channel */ +#define ANIMDATA_ADD_ANIMDATA(id) \ + {\ + ale= make_new_animlistelem((id)->adt, ANIMTYPE_ANIMDATA, NULL, ANIMTYPE_NONE, (ID *)id);\ + if (ale) {\ + BLI_addtail(anim_data, ale);\ + items++;\ + }\ + } + + + /* quick macro to test if a anim-channel (F-Curve, Group, etc.) is selected in an acceptable way */ #define ANIMCHANNEL_SELOK(test_func) \ ( !(filter_mode & (ANIMFILTER_SEL|ANIMFILTER_UNSEL)) || \ @@ -713,6 +739,11 @@ static int animdata_filter_nla (ListBase *anim_data, AnimData *adt, int filter_m items++; } } + + /* if we're in NLA-tweakmode, if this track was active, that means that it was the last active one */ + // FIXME: the channels after should still get drawn, just 'differently', and after an active-action channel + if ((adt->flag & ADT_NLA_EDIT_ON) && (nlt->flag & NLATRACK_ACTIVE)) + break; } } } @@ -890,6 +921,7 @@ static int animdata_filter_dopesheet_mats (ListBase *anim_data, bDopeSheet *ads, /* check if ok */ ANIMDATA_FILTER_CASES(ma, + { /* AnimData blocks - do nothing... */ }, ok=1;, ok=1;, ok=1;) @@ -933,6 +965,7 @@ static int animdata_filter_dopesheet_mats (ListBase *anim_data, bDopeSheet *ads, /* add material's animation data */ if (FILTER_MAT_OBJD(ma) || (filter_mode & ANIMFILTER_CURVESONLY)) { ANIMDATA_FILTER_CASES(ma, + { /* AnimData blocks - do nothing... */ }, items += animdata_filter_nla(anim_data, ma->adt, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);, items += animdata_filter_fcurves(anim_data, ma->adt->drivers.first, NULL, ma, ANIMTYPE_DSMAT, filter_mode, (ID *)ma);, items += animdata_filter_action(anim_data, ma->adt->action, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);) @@ -998,6 +1031,7 @@ static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ad if ((expanded) || (filter_mode & ANIMFILTER_CURVESONLY)) { /* filtering for channels - nla, drivers, keyframes */ ANIMDATA_FILTER_CASES(iat, + { /* AnimData blocks - do nothing... */ }, items+= animdata_filter_nla(anim_data, iat->adt, filter_mode, iat, type, (ID *)iat);, items+= animdata_filter_fcurves(anim_data, adt->drivers.first, NULL, iat, type, filter_mode, (ID *)iat);, items += animdata_filter_action(anim_data, iat->adt->action, filter_mode, iat, type, (ID *)iat);) @@ -1036,6 +1070,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B if (ob->adt) { adt= ob->adt; ANIMDATA_FILTER_CASES(ob, + { /* AnimData blocks - do nothing... */ }, { /* nla */ #if 0 /* include nla-expand widget? */ @@ -1091,6 +1126,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B if ((key) && !(ads->filterflag & ADS_FILTER_NOSHAPEKEYS)) { adt= key->adt; ANIMDATA_FILTER_CASES(key, + { /* AnimData blocks - do nothing... */ }, { /* nla */ #if 0 /* include nla-expand widget? */ @@ -1151,6 +1187,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B if ((ads->filterflag & ADS_FILTER_NOCAM) == 0) { ANIMDATA_FILTER_CASES(ca, + { /* AnimData blocks - do nothing... */ }, obdata_ok= 1;, obdata_ok= 1;, obdata_ok= 1;) @@ -1163,6 +1200,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B if ((ads->filterflag & ADS_FILTER_NOLAM) == 0) { ANIMDATA_FILTER_CASES(la, + { /* AnimData blocks - do nothing... */ }, obdata_ok= 1;, obdata_ok= 1;, obdata_ok= 1;) @@ -1175,6 +1213,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B if ((ads->filterflag & ADS_FILTER_NOCUR) == 0) { ANIMDATA_FILTER_CASES(cu, + { /* AnimData blocks - do nothing... */ }, obdata_ok= 1;, obdata_ok= 1;, obdata_ok= 1;) @@ -1216,6 +1255,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads if ((ads->filterflag & ADS_FILTER_NOSCE) == 0) { adt= sce->adt; ANIMDATA_FILTER_CASES(sce, + { /* AnimData blocks - do nothing... */ }, { /* nla */ #if 0 /* include nla-expand widget? */ @@ -1266,9 +1306,10 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads /* world */ if ((wo && wo->adt) && !(ads->filterflag & ADS_FILTER_NOWOR)) { - /* Action, Drivers, or NLA for World */ + /* Action, Drivers, or NLA for World */ adt= wo->adt; ANIMDATA_FILTER_CASES(wo, + { /* AnimData blocks - do nothing... */ }, { /* nla */ #if 0 /* include nla-expand widget? */ @@ -1327,6 +1368,7 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int { Scene *sce= (Scene *)ads->source; Base *base; + bAnimListElem *ale; int items = 0; /* check that we do indeed have a scene */ @@ -1342,11 +1384,25 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int /* check filtering-flags if ok */ ANIMDATA_FILTER_CASES(sce, + { + /* for the special AnimData blocks only case, we only need to add + * the block if it is valid... then other cases just get skipped (hence ok=0) + */ + ANIMDATA_ADD_ANIMDATA(sce); + sceOk=0; + }, sceOk= !(ads->filterflag & ADS_FILTER_NOSCE);, sceOk= !(ads->filterflag & ADS_FILTER_NOSCE);, sceOk= !(ads->filterflag & ADS_FILTER_NOSCE);) if (sce->world) { ANIMDATA_FILTER_CASES(sce->world, + { + /* for the special AnimData blocks only case, we only need to add + * the block if it is valid... then other cases just get skipped (hence ok=0) + */ + ANIMDATA_ADD_ANIMDATA(sce->world); + worOk=0; + }, worOk= !(ads->filterflag & ADS_FILTER_NOWOR);, worOk= !(ads->filterflag & ADS_FILTER_NOWOR);, worOk= !(ads->filterflag & ADS_FILTER_NOWOR);) @@ -1395,12 +1451,26 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int actOk= 0; keyOk= 0; ANIMDATA_FILTER_CASES(ob, + { + /* for the special AnimData blocks only case, we only need to add + * the block if it is valid... then other cases just get skipped (hence ok=0) + */ + ANIMDATA_ADD_ANIMDATA(ob); + actOk=0; + }, actOk= 1;, actOk= 1;, actOk= 1;) if (key) { /* shapekeys */ ANIMDATA_FILTER_CASES(key, + { + /* for the special AnimData blocks only case, we only need to add + * the block if it is valid... then other cases just get skipped (hence ok=0) + */ + ANIMDATA_ADD_ANIMDATA(key); + keyOk=0; + }, keyOk= 1;, keyOk= 1;, keyOk= 1;) @@ -1419,6 +1489,13 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int /* if material has relevant animation data, break */ ANIMDATA_FILTER_CASES(ma, + { + /* for the special AnimData blocks only case, we only need to add + * the block if it is valid... then other cases just get skipped (hence ok=0) + */ + ANIMDATA_ADD_ANIMDATA(ma); + matOk=0; + }, matOk= 1;, matOk= 1;, matOk= 1;) @@ -1435,6 +1512,13 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int Camera *ca= (Camera *)ob->data; dataOk= 0; ANIMDATA_FILTER_CASES(ca, + if ((ads->filterflag & ADS_FILTER_NOCAM)==0) { + /* for the special AnimData blocks only case, we only need to add + * the block if it is valid... then other cases just get skipped (hence ok=0) + */ + ANIMDATA_ADD_ANIMDATA(ca); + dataOk=0; + }, dataOk= !(ads->filterflag & ADS_FILTER_NOCAM);, dataOk= !(ads->filterflag & ADS_FILTER_NOCAM);, dataOk= !(ads->filterflag & ADS_FILTER_NOCAM);) @@ -1445,11 +1529,35 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int Lamp *la= (Lamp *)ob->data; dataOk= 0; ANIMDATA_FILTER_CASES(la, + if ((ads->filterflag & ADS_FILTER_NOLAM)==0) { + /* for the special AnimData blocks only case, we only need to add + * the block if it is valid... then other cases just get skipped (hence ok=0) + */ + ANIMDATA_ADD_ANIMDATA(la); + dataOk=0; + }, dataOk= !(ads->filterflag & ADS_FILTER_NOLAM);, dataOk= !(ads->filterflag & ADS_FILTER_NOLAM);, dataOk= !(ads->filterflag & ADS_FILTER_NOLAM);) } break; + case OB_CURVE: /* ------- Curve ---------- */ + { + Curve *cu= (Curve *)ob->data; + dataOk= 0; + ANIMDATA_FILTER_CASES(cu, + if ((ads->filterflag & ADS_FILTER_NOCUR)==0) { + /* for the special AnimData blocks only case, we only need to add + * the block if it is valid... then other cases just get skipped (hence ok=0) + */ + ANIMDATA_ADD_ANIMDATA(cu); + dataOk=0; + }, + dataOk= !(ads->filterflag & ADS_FILTER_NOCUR);, + dataOk= !(ads->filterflag & ADS_FILTER_NOCUR);, + dataOk= !(ads->filterflag & ADS_FILTER_NOCUR);) + } + break; default: /* --- other --- */ dataOk= 0; break; diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index cdd8b5c368c..dcaabb4b369 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -107,6 +107,7 @@ typedef struct bAnimListElem { // XXX was ACTTYPE_* typedef enum eAnim_ChannelType { ANIMTYPE_NONE= 0, + ANIMTYPE_ANIMDATA, ANIMTYPE_SPECIALDATA, ANIMTYPE_SCENE, @@ -162,6 +163,7 @@ typedef enum eAnimFilter_Flags { ANIMFILTER_ACTGROUPED = (1<<6), /* belongs to the active actiongroup */ ANIMFILTER_CURVEVISIBLE = (1<<7), /* F-Curve is visible for editing/viewing in Graph Editor */ ANIMFILTER_ACTIVE = (1<<8), /* channel should be 'active' */ // FIXME: this is only relevant for F-Curves for now + ANIMFILTER_ANIMDATA = (1<<9), /* only return the underlying AnimData blocks (not the tracks, etc.) data comes from */ } eAnimFilter_Flags; @@ -254,7 +256,7 @@ short ANIM_animdata_context_getdata(bAnimContext *ac); void ANIM_deselect_anim_channels(void *data, short datatype, short test, short sel); /* Set the 'active' channel of type channel_type, in the given action */ -void ANIM_set_active_channel(void *data, short datatype, int filter, void *channel_data, short channel_type); +void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int filter, void *channel_data, short channel_type); /* --------------- Settings and/or Defines -------------- */ @@ -308,6 +310,8 @@ void ipo_rainbow(int cur, int tot, float *out); /* ------------- NLA-Mapping ----------------------- */ /* anim_draw.c */ +// XXX these are soon to be depreceated? + /* Obtain the Object providing NLA-scaling for the given channel if applicable */ struct Object *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale); diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index c2beb34e7b5..e3b6572c03a 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -118,6 +118,7 @@ int ED_operator_node_active(struct bContext *C); int ED_operator_ipo_active(struct bContext *C); int ED_operator_sequencer_active(struct bContext *C); int ED_operator_image_active(struct bContext *C); +int ED_operator_nla_active(struct bContext *C); int ED_operator_object_active(struct bContext *C); int ED_operator_editmesh(struct bContext *C); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index be952558b6c..db1a39ed056 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -164,6 +164,7 @@ int ED_operator_node_active(bContext *C) return 0; } +// XXX rename int ED_operator_ipo_active(bContext *C) { return ed_spacetype_test(C, SPACE_IPO); @@ -179,6 +180,11 @@ int ED_operator_image_active(bContext *C) return ed_spacetype_test(C, SPACE_IMAGE); } +int ED_operator_nla_active(bContext *C) +{ + return ed_spacetype_test(C, SPACE_NLA); +} + int ED_operator_object_active(bContext *C) { return NULL != CTX_data_active_object(C); diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index f64cd0f707c..d8ed3fd1068 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -862,13 +862,13 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short select_mode, bActionGroup *agrp= ale->data; agrp->flag |= AGRP_SELECTED; - ANIM_set_active_channel(ac->data, ac->datatype, filter, agrp, ANIMTYPE_GROUP); + ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, agrp, ANIMTYPE_GROUP); } else if (ale->type == ANIMTYPE_FCURVE) { FCurve *fcu= ale->data; fcu->flag |= FCURVE_SELECTED; - ANIM_set_active_channel(ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE); + ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE); } } else if (ac->datatype == ANIMCONT_GPENCIL) { diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index bb923ca6f95..21320b60ead 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -722,7 +722,7 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short select_mode, s /* set active F-Curve (NOTE: sync the filter flags with findnearest_fcurve_vert) */ if (fcu->flag & FCURVE_SELECTED) { filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); - ANIM_set_active_channel(ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE); + ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE); } } diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index a839ccbf3d6..8db85ffa0b1 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -349,7 +349,7 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh /* if NLA-Track is selected now, make NLA-Track the 'active' one in the visible list */ if (nlt->flag & NLATRACK_SELECTED) - ANIM_set_active_channel(ac->data, ac->datatype, filter, nlt, ANIMTYPE_NLATRACK); + ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, nlt, ANIMTYPE_NLATRACK); } } break; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 85bf733df87..6c4c64ea272 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -137,7 +137,7 @@ static void nla_draw_strip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2 /* only need to draw here if there's no strip before since * it only applies in such a situation */ - if (strip->prev) { + if (strip->prev == NULL) { /* set the drawing color to the color of the strip, but with very faint alpha */ glColor4f(color[0], color[1], color[2], 0.15f); @@ -563,15 +563,20 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) else special= ICON_LAYER_USED; - if (nlt->flag & NLATRACK_MUTED) - mute = ICON_MUTE_IPO_ON; - else - mute = ICON_MUTE_IPO_OFF; - - if (EDITABLE_NLT(nlt)) - protect = ICON_UNLOCKED; - else - protect = ICON_LOCKED; + /* if this track is active and we're tweaking it, don't draw these toggles */ + // TODO: need a special macro for this... + if ( ((nlt->flag & NLATRACK_ACTIVE) && (nlt->flag & NLATRACK_DISABLED)) == 0 ) + { + if (nlt->flag & NLATRACK_MUTED) + mute = ICON_MUTE_IPO_ON; + else + mute = ICON_MUTE_IPO_OFF; + + if (EDITABLE_NLT(nlt)) + protect = ICON_UNLOCKED; + else + protect = ICON_LOCKED; + } sel = SEL_NLT(nlt); strcpy(name, nlt->name); @@ -636,18 +641,29 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) } else if (group == 5) { /* Action Line */ - if (ale->data) - glColor3f(0.8f, 0.2f, 0.0f); // reddish color - hardcoded for now - else - glColor3f(0.6f, 0.5f, 0.5f); // greyish-red color - hardcoded for now - + AnimData *adt= BKE_animdata_from_id(ale->id); + + // TODO: if tweaking some action, use the same color as for the tweaked track (quick hack done for now) + if (adt && (adt->flag & ADT_NLA_EDIT_ON)) { + // greenish color (same as tweaking strip) - hardcoded for now + glColor3f(0.3f, 0.95f, 0.1f); + } + else { + if (ale->data) + glColor3f(0.8f, 0.2f, 0.0f); // reddish color - hardcoded for now + else + glColor3f(0.6f, 0.5f, 0.5f); // greyish-red color - hardcoded for now + } + offset += 7 * indent; /* only on top two corners, to show that this channel sits on top of the preceeding ones */ uiSetRoundBox((1|2)); - /* draw slightly shifted up vertically to look like it has more separtion from other channels */ - gl_round_box(GL_POLYGON, x+offset, yminc+NLACHANNEL_SKIP, (float)NLACHANNEL_NAMEWIDTH, ymaxc+NLACHANNEL_SKIP, 8); + /* draw slightly shifted up vertically to look like it has more separtion from other channels, + * but we then need to slightly shorten it so that it doesn't look like it overlaps + */ + gl_round_box(GL_POLYGON, x+offset, yminc+NLACHANNEL_SKIP, (float)NLACHANNEL_NAMEWIDTH, ymaxc+NLACHANNEL_SKIP-1, 8); /* clear group value, otherwise we cause errors... */ group = 0; @@ -709,20 +725,29 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) UI_icon_draw((float)(NLACHANNEL_NAMEWIDTH-offset), ydatac, mute); } - /* draw action 'push-down' - only for NLA-Action lines, and only when there's an action */ + /* draw NLA-action line 'status-icons' - only when there's an action */ if ((ale->type == ANIMTYPE_NLAACTION) && (ale->data)) { - offset += 16; + AnimData *adt= BKE_animdata_from_id(ale->id); - /* XXX firstly draw a little rect to help identify that it's different from the toggles */ - glBegin(GL_LINE_LOOP); - glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y-7); - glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y+9); - glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y+9); - glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y-7); - glEnd(); // GL_LINES + offset += 16; - /* now draw the icon */ - UI_icon_draw((float)NLACHANNEL_NAMEWIDTH-offset, ydatac, ICON_FREEZE); + /* now draw some indicator icons */ + if ((adt) && (adt->flag & ADT_NLA_EDIT_ON)) { + /* 'tweaking action' - not a button */ + UI_icon_draw((float)NLACHANNEL_NAMEWIDTH-offset, ydatac, ICON_EDIT); + } + else { + /* XXX firstly draw a little rect to help identify that it's different from the toggles */ + glBegin(GL_LINE_LOOP); + glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y-7); + glVertex2f((float)NLACHANNEL_NAMEWIDTH-offset-1, y+9); + glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y+9); + glVertex2f((float)NLACHANNEL_NAMEWIDTH-1, y-7); + glEnd(); // GL_LINES + + /* 'push down' icon for normal active-actions */ + UI_icon_draw((float)NLACHANNEL_NAMEWIDTH-offset, ydatac, ICON_FREEZE); + } } glDisable(GL_BLEND); diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index ce9ae7de7a9..f7053957667 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -68,6 +68,143 @@ #include "nla_intern.h" // own include /* *********************************************** */ +/* General Editing */ + +/* ******************** Tweak-Mode Operators ***************************** */ +/* 'Tweak mode' allows the action referenced by the active NLA-strip to be edited + * as if it were the normal Active-Action of its AnimData block. + */ + +static int nlaedit_enable_tweakmode_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + int ok=0; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the AnimData blocks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_ANIMDATA); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* if no blocks, popup error? */ + if (anim_data.first == NULL) { + BKE_report(op->reports, RPT_ERROR, "No AnimData blocks to enter tweakmode for"); + return OPERATOR_CANCELLED; + } + + /* for each AnimData block with NLA-data, try setting it in tweak-mode */ + for (ale= anim_data.first; ale; ale= ale->next) { + AnimData *adt= ale->data; + + /* try entering tweakmode if valid */ + ok += BKE_nla_tweakmode_enter(adt); + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* if we managed to enter tweakmode on at least one AnimData block, + * set the flag for this in the active scene and send notifiers + */ + if (ac.scene && ok) { + /* set editing flag */ + ac.scene->flag |= SCE_NLA_EDIT_ON; + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + } + + /* done */ + return OPERATOR_FINISHED; +} + +void NLAEDIT_OT_tweakmode_enter (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Enter Tweak Mode"; + ot->idname= "NLAEDIT_OT_tweakmode_enter"; + ot->description= "Enter tweaking mode for the action referenced by the active strip."; + + /* api callbacks */ + ot->exec= nlaedit_enable_tweakmode_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/* ------------- */ + +static int nlaedit_disable_tweakmode_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the AnimData blocks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_ANIMDATA); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* if no blocks, popup error? */ + if (anim_data.first == NULL) { + BKE_report(op->reports, RPT_ERROR, "No AnimData blocks to enter tweakmode for"); + return OPERATOR_CANCELLED; + } + + /* for each AnimData block with NLA-data, try exitting tweak-mode */ + for (ale= anim_data.first; ale; ale= ale->next) { + AnimData *adt= ale->data; + + /* try entering tweakmode if valid */ + BKE_nla_tweakmode_exit(adt); + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* if we managed to enter tweakmode on at least one AnimData block, + * set the flag for this in the active scene and send notifiers + */ + if (ac.scene) { + /* clear editing flag */ + ac.scene->flag &= ~SCE_NLA_EDIT_ON; + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + } + + /* done */ + return OPERATOR_FINISHED; +} + +void NLAEDIT_OT_tweakmode_exit (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Exit Tweak Mode"; + ot->idname= "NLAEDIT_OT_tweakmode_exit"; + ot->description= "Exit tweaking mode for the action referenced by the active strip."; + + /* api callbacks */ + ot->exec= nlaedit_disable_tweakmode_exec; + ot->poll= nlaop_poll_tweakmode_on; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} /* *********************************************** */ diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 448b823bd4b..a7188a7cccd 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -76,6 +76,9 @@ void NLAEDIT_OT_click_select(wmOperatorType *ot); /* **************************************** */ /* nla_edit.c */ +void NLAEDIT_OT_tweakmode_enter(wmOperatorType *ot); +void NLAEDIT_OT_tweakmode_exit(wmOperatorType *ot); + /* **************************************** */ /* nla_channels.c */ @@ -85,6 +88,11 @@ void NLA_OT_channels_click(wmOperatorType *ot); /* **************************************** */ /* nla_ops.c */ +int nlaop_poll_tweakmode_off(bContext *C); +int nlaop_poll_tweakmode_on (bContext *C); + +/* --- */ + void nla_operatortypes(void); void nla_keymap(wmWindowManager *wm); diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 167686c99f9..057e4b05656 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -65,6 +65,51 @@ #include "nla_intern.h" // own include +/* ************************** poll callbacks for operators **********************************/ + +/* tweakmode is NOT enabled */ +int nlaop_poll_tweakmode_off (bContext *C) +{ + Scene *scene; + + /* for now, we check 2 things: + * 1) active editor must be NLA + * 2) tweakmode is currently set as a 'per-scene' flag + * so that it will affect entire NLA data-sets, + * but not all AnimData blocks will be in tweakmode for + * various reasons + */ + if (ED_operator_nla_active(C) == 0) + return 0; + + scene= CTX_data_scene(C); + if ((scene == NULL) || (scene->flag & SCE_NLA_EDIT_ON)) + return 0; + + return 1; +} + +/* tweakmode IS enabled */ +int nlaop_poll_tweakmode_on (bContext *C) +{ + Scene *scene; + + /* for now, we check 2 things: + * 1) active editor must be NLA + * 2) tweakmode is currently set as a 'per-scene' flag + * so that it will affect entire NLA data-sets, + * but not all AnimData blocks will be in tweakmode for + * various reasons + */ + if (ED_operator_nla_active(C) == 0) + return 0; + + scene= CTX_data_scene(C); + if ((scene == NULL) || !(scene->flag & SCE_NLA_EDIT_ON)) + return 0; + + return 1; +} /* ************************** registration - operator types **********************************/ @@ -77,6 +122,10 @@ void nla_operatortypes(void) /* select */ WM_operatortype_append(NLAEDIT_OT_click_select); WM_operatortype_append(NLAEDIT_OT_select_all_toggle); + + /* edit */ + WM_operatortype_append(NLAEDIT_OT_tweakmode_enter); + WM_operatortype_append(NLAEDIT_OT_tweakmode_exit); } /* ************************** registration - keymaps **********************************/ @@ -130,6 +179,13 @@ static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "NLAEDIT_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "NLAEDIT_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); + /* editing */ + /* tweakmode + * - enter and exit are separate operators with the same hotkey... + * This works as they use different poll()'s + */ + WM_keymap_add_item(keymap, "NLAEDIT_OT_tweakmode_enter", TABKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "NLAEDIT_OT_tweakmode_exit", TABKEY, KM_PRESS, 0, 0); /* transform system */ //transform_keymap_for_space(wm, keymap, SPACE_NLA); diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 0626d9febe4..2e3d5572711 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -300,8 +300,7 @@ static void mouse_nla_strips (bAnimContext *ac, int mval[2], short select_mode) NlaTrack *nlt= (NlaTrack *)ale->data; nlt->flag |= NLATRACK_SELECTED; - if (nlt->flag & NLATRACK_SELECTED) - ANIM_set_active_channel(ac->data, ac->datatype, filter, nlt, ANIMTYPE_NLATRACK); + ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, nlt, ANIMTYPE_NLATRACK); } } diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index e41ab5ac492..a566f733978 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -269,6 +269,7 @@ typedef enum eAction_Flags { /* flags for evaluation/editing */ ACT_MUTED = (1<<9), ACT_PROTECTED = (1<<10), + ACT_DISABLED = (1<<11), } eAction_Flags; diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index ffc1561e7ab..c19318629f6 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -506,6 +506,9 @@ enum { NLATRACK_SOLO = (1<<3), /* track's settings (and strips) cannot be edited (to guard against unwanted changes) */ NLATRACK_PROTECTED = (1<<4), + + /* track is not allowed to execute, usually as result of tweaking being enabled (internal flag) */ + NLATRACK_DISABLED = (1<<10), } eNlaTrack_Flag; @@ -648,11 +651,15 @@ typedef struct AnimOverride { * blocks may override local settings. * * This datablock should be placed immediately after the ID block where it is used, so that - * the code which retrieves this data can do so in an easier manner. See blenkernel/internal/anim_sys.c for details. + * the code which retrieves this data can do so in an easier manner. See blenkernel/intern/anim_sys.c for details. */ typedef struct AnimData { /* active action - acts as the 'tweaking track' for the NLA */ - bAction *action; + bAction *action; + /* temp-storage for the 'real' active action (i.e. the one used before the tweaking-action + * took over to be edited in the Animation Editors) + */ + bAction *tmpact; /* remapping-info for active action - should only be used if needed * (for 'foreign' actions that aren't working correctly) */ diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 6f88a98fee8..8acefdad9a2 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -832,6 +832,7 @@ typedef struct Scene { /* sce->flag */ #define SCE_DS_SELECTED (1<<0) #define SCE_DS_COLLAPSED (1<<1) +#define SCE_NLA_EDIT_ON (1<<2) /* return flag next_object function */ -- cgit v1.2.3 From 308b567e9c2c36ddb3e9571e4d064a8954f83607 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 5 Jun 2009 11:51:27 +0000 Subject: NLA SoC: NLA-Evaluation Bugfixes * Fixed an evil bug where the last frame of a strip was always incorrectly evaluated. This was because these frames were not being included in the strip's 'range' as defined by the IN_RANGE() testing macro, which only considers the given range as an open interval (i.e. non-inclusive of boundary points). I've added a new macro, IN_RANGE_INCL(), which is inclusive of boundary points, since this is a common test in many other parts of the code. * When an AnimData block is in 'tweaking' mode, the tracks following (and including the active track) are now correctly skipped during evaluation. * Finished coding the option of setting a single NLA-track per NLA-block to play 'solo' (i.e. only that track is enabled for evaluation). To enable this, simply click on one of the grey 'dots' beside the NLA-track names, turning this dot yellow. The 'yellow' dot means that the track will play by itself (even the 'active action' gets silenced). Only one track per AnimData block can play solo at a time. To disable, simply click on the 'yellow' dot again. NOTE: this currently uses the View3D layer-status icons. We probably need some special ones for these later (coloured vs grey star?) * Also (not related to evaluation) made the selection operators for the NLA Editor only work when not in tweaking mode, since in tweaking mode they can potentially result in data being resolved inappropriately when leaving tweaking mode. --- source/blender/blenkernel/BKE_nla.h | 4 +++ source/blender/blenkernel/BKE_utildefines.h | 1 + source/blender/blenkernel/intern/anim_sys.c | 34 +++++++++++++++++-------- source/blender/blenkernel/intern/nla.c | 32 +++++++++++++++++++++++ source/blender/editors/space_nla/nla_channels.c | 19 +++++++++++++- source/blender/editors/space_nla/nla_intern.h | 3 +++ source/blender/editors/space_nla/nla_select.c | 4 +-- 7 files changed, 84 insertions(+), 13 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 89e5f1af7e1..da824fd2093 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -56,12 +56,16 @@ struct NlaStrip *add_nlastrip_to_stack(struct AnimData *adt, struct bAction *act struct NlaTrack *BKE_nlatrack_find_active(ListBase *tracks); void BKE_nlatrack_set_active(ListBase *tracks, struct NlaTrack *nlt); +void BKE_nlatrack_solo_toggle(struct AnimData *adt, struct NlaTrack *nlt); + short BKE_nlatrack_has_space(struct NlaTrack *nlt, float start, float end); void BKE_nlatrack_sort_strips(struct NlaTrack *nlt); + struct NlaStrip *BKE_nlastrip_find_active(struct NlaTrack *nlt); short BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max); + void BKE_nla_action_pushdown(struct AnimData *adt); short BKE_nla_tweakmode_enter(struct AnimData *adt); diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h index 6584af085cd..0bed2c095e2 100644 --- a/source/blender/blenkernel/BKE_utildefines.h +++ b/source/blender/blenkernel/BKE_utildefines.h @@ -128,6 +128,7 @@ #define IS_EQT(a, b, c) ((a > b)? (((a-b) <= c)? 1:0) : ((((b-a) <= c)? 1:0))) #define IN_RANGE(a, b, c) ((b < c)? ((bflag & (NLATRACK_MUTED|NLATRACK_DISABLED)) - return; - /* loop over strips, checking if they fall within the range */ for (strip= nlt->strips.first; strip; strip= strip->next) { /* check if current time occurs within this strip */ - if (IN_RANGE(ctime, strip->start, strip->end)) { + if (IN_RANGE_INCL(ctime, strip->start, strip->end)) { /* this strip is active, so try to use it */ estrip= strip; side= NES_TIME_WITHIN; @@ -1013,8 +1009,21 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime) NlaEvalStrip *nes; /* 1. get the stack of strips to evaluate at current time (influence calculated here) */ - for (nlt=adt->nla_tracks.first; nlt; nlt=nlt->next, track_index++) + for (nlt=adt->nla_tracks.first; nlt; nlt=nlt->next, track_index++) { + /* if tweaking is on and this strip is the tweaking track, stop on this one */ + if ((adt->flag & ADT_NLA_EDIT_ON) && (nlt->flag & NLATRACK_DISABLED)) + break; + + /* skip if we're only considering a track tagged 'solo' */ + if ((adt->flag & ADT_NLA_SOLO_TRACK) && (nlt->flag & NLATRACK_SOLO)==0) + continue; + /* skip if track is muted */ + if (nlt->flag & NLATRACK_MUTED) + continue; + + /* otherwise, get strip to evaluate for this channel */ nlatrack_ctime_get_strip(&estrips, nlt, track_index, ctime); + } /* only continue if there are strips to evaluate */ if (estrips.first == NULL) @@ -1114,12 +1123,17 @@ void BKE_animsys_evaluate_animdata (ID *id, AnimData *adt, float ctime, short re /* evaluate NLA data */ if ((adt->nla_tracks.first) && !(adt->flag & ADT_NLA_EVAL_OFF)) { + /* evaluate NLA-stack */ animsys_evaluate_nla(&id_ptr, adt, ctime); + + /* evaluate 'active' Action (may be tweaking track) on top of results of NLA-evaluation + * - only do this if we're not exclusively evaluating the 'solo' NLA-track + */ + if ((adt->action) && !(adt->flag & ADT_NLA_SOLO_TRACK)) + animsys_evaluate_action(&id_ptr, adt->action, adt->remap, ctime); } - - /* evaluate Action data */ - // FIXME: what if the solo track was not tweaking one, then nla-solo should be checked too? - if (adt->action) + /* evaluate Active Action only */ + else if (adt->action) animsys_evaluate_action(&id_ptr, adt->action, adt->remap, ctime); /* reset tag */ diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 84f98096364..d3a01b6d610 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -359,6 +359,38 @@ NlaTrack *BKE_nlatrack_find_active (ListBase *tracks) return NULL; } +/* Toggle the 'solo' setting for the given NLA-track, making sure that it is the only one + * that has this status in its AnimData block. + */ +void BKE_nlatrack_solo_toggle (AnimData *adt, NlaTrack *nlt) +{ + NlaTrack *nt; + + /* sanity check */ + if ELEM(NULL, adt, adt->nla_tracks.first) + return; + + /* firstly, make sure 'solo' flag for all tracks is disabled */ + for (nt= adt->nla_tracks.first; nt; nt= nt->next) { + if (nt != nlt) + nt->flag &= ~NLATRACK_SOLO; + } + + /* now, enable 'solo' for the given track if appropriate */ + if (nlt) { + /* toggle solo status */ + nlt->flag ^= NLATRACK_SOLO; + + /* set or clear solo-status on AnimData */ + if (nlt->flag & NLATRACK_SOLO) + adt->flag |= ADT_NLA_SOLO_TRACK; + else + adt->flag &= ~ADT_NLA_SOLO_TRACK; + } + else + adt->flag &= ~ADT_NLA_SOLO_TRACK; +} + /* Make the given NLA-track the active one for the given stack. If no track is provided, * this function can be used to simply deactivate all the NLA tracks in the given stack too. */ diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 8db85ffa0b1..ed401c3596b 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -326,6 +326,19 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh case ANIMTYPE_NLATRACK: { NlaTrack *nlt= (NlaTrack *)ale->data; + AnimData *adt= BKE_animdata_from_id(ale->id); + short offset; + + /* offset for start of channel (on LHS of channel-list) */ + if (ale->id) { + /* special exception for materials */ + if (GS(ale->id->name) == ID_MA) + offset= 21 + NLACHANNEL_BUTTON_WIDTH; + else + offset= 14; + } + else + offset= 0; if (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) { /* toggle protection (only if there's a toggle there) */ @@ -335,6 +348,10 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh /* toggle mute */ nlt->flag ^= NLATRACK_MUTED; } + else if (x <= ((NLACHANNEL_BUTTON_WIDTH*2)+offset)) { + /* toggle 'solo' */ + BKE_nlatrack_solo_toggle(adt, nlt); + } else { /* set selection */ if (selectmode == SELECT_INVERT) { @@ -359,7 +376,7 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh /* for now, only do something if user clicks on the 'push-down' button */ if (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) { - /* activate push-down operator */ + /* activate push-down function */ // TODO: make this use the operator instead of calling the function directly // however, calling the operator requires that we supply the args, and that works with proper buttons only BKE_nla_action_pushdown(adt); diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index a7188a7cccd..3d8cb7548c0 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -30,6 +30,9 @@ /* internal exports only */ +/* **************************************** */ +/* Macros, etc. only used by NLA */ + /* -------------- NLA Channel Defines -------------- */ /* NLA channel heights */ diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 2e3d5572711..463479c0909 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -199,7 +199,7 @@ void NLAEDIT_OT_select_all_toggle (wmOperatorType *ot) /* api callbacks */ ot->exec= nlaedit_deselectall_exec; - ot->poll= ED_operator_areaactive; + ot->poll= nlaop_poll_tweakmode_off; /* flags */ ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/; @@ -441,7 +441,7 @@ void NLAEDIT_OT_click_select (wmOperatorType *ot) /* api callbacks - absolutely no exec() this yet... */ ot->invoke= nlaedit_clickselect_invoke; - ot->poll= ED_operator_areaactive; + ot->poll= nlaop_poll_tweakmode_off; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; -- cgit v1.2.3 From 6c5e1b6b243e0571f32d46177c0606f510e22e46 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Fri, 5 Jun 2009 16:53:21 +0000 Subject: coverity issue CID: 97 Checker: FORWARD_NULL (help) File: base/src/source/blender/src/poseobject.c Function: pose_special_editmenu Description: Variable "ob" tracked as NULL was dereferenced. logic was wrong (gets complicated when you use !'s ;)) Kent --- source/blender/src/poseobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index 551aca0cc91..0bea1fea943 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -551,7 +551,7 @@ void pose_special_editmenu(void) short nr; /* paranoia checks */ - if(!ob && !ob->pose) return; + if(!ob || !ob->pose) return; if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; nr= pupmenu("Specials%t|Select Constraint Target%x1|Flip Left-Right Names%x2|Calculate Paths%x3|Clear Paths%x4|Clear User Transform %x5|Relax Pose %x6|%l|AutoName Left-Right%x7|AutoName Front-Back%x8|AutoName Top-Bottom%x9"); -- cgit v1.2.3 From e9ffd8f63e42af0f1618de189288ad86cf82ddb8 Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Fri, 5 Jun 2009 16:54:06 +0000 Subject: Fix "duplicate strip" always increase the user count for ipo. As venomgfx point, the shift+d function never duplicate the ipo block if we have enable the option in UserDef -> Edit Methods -> Ipo. Now, if Ipo option is disable, we just increase the user count, otherwise we duplicate the ipo. Note: Alighorith, we need call ipo_idnew here ? (like single_ipo_users) --- source/blender/src/editseq.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c index 5dcfae30960..48c301ab051 100644 --- a/source/blender/src/editseq.c +++ b/source/blender/src/editseq.c @@ -68,6 +68,7 @@ #include "BKE_library.h" #include "BKE_main.h" #include "BKE_scene.h" +#include "BKE_ipo.h" #include "BIF_space.h" #include "BIF_interface.h" @@ -2243,12 +2244,30 @@ void del_seq(void) static Sequence *dupli_seq(Sequence *seq) { Sequence *seqn = MEM_dupallocN(seq); + ID *id; seq->tmp = seqn; seqn->strip= MEM_dupallocN(seq->strip); - if(seqn->ipo) seqn->ipo->id.us++; + if (seqn->ipo) { + if (U.dupflag & USER_DUP_IPO) { + id= (ID *)seqn->ipo; + seqn->ipo= copy_ipo(seqn->ipo); + /* we don't need to decrease the number + * of the ipo because we never increase it, + * for example, adduplicate need decrease + * the number but only because copy_object + * call id_us_plus for the ipo block and + * single_ipo_users only work if id->us > 1. + * + * need call ipo_idnew here, for drivers ?? + * - Diego + */ + } + else + seqn->ipo->id.us++; + } seqn->strip->tstripdata = 0; seqn->strip->tstripdata_startstill = 0; -- cgit v1.2.3 From 868f31754cca607d3b3142e645e4f13176f73a70 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Fri, 5 Jun 2009 17:45:17 +0000 Subject: A bunch of the same logic issues. (missed these before) Kent --- source/blender/src/poseobject.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index 0bea1fea943..b4e92f77628 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -445,7 +445,7 @@ void pose_select_constraint_target(void) bConstraint *con; /* paranoia checks */ - if (!ob && !ob->pose) return; + if (!ob || !ob->pose) return; if (ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { @@ -491,7 +491,7 @@ void pose_select_hierarchy(short direction, short add_to_sel) Bone *curbone, *pabone, *chbone; /* paranoia checks */ - if (!ob && !ob->pose) return; + if (!ob || !ob->pose) return; if (ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { @@ -583,7 +583,7 @@ void pose_add_IK(void) Object *ob= OBACT; /* paranoia checks */ - if(!ob && !ob->pose) return; + if(!ob || !ob->pose) return; if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; add_constraint(1); /* 1 means only IK */ @@ -599,7 +599,7 @@ void pose_clear_IK(void) bConstraint *next; /* paranoia checks */ - if(!ob && !ob->pose) return; + if(!ob || !ob->pose) return; if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; if(pose_has_protected_selected(ob, 0, 1)) @@ -640,7 +640,7 @@ void pose_clear_constraints(void) bPoseChannel *pchan; /* paranoia checks */ - if(!ob && !ob->pose) return; + if(!ob || !ob->pose) return; if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; if(pose_has_protected_selected(ob, 0, 1)) @@ -1352,7 +1352,7 @@ void pose_flip_names(void) char newname[32]; /* paranoia checks */ - if(!ob && !ob->pose) return; + if(!ob || !ob->pose) return; if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; if(pose_has_protected_selected(ob, 0, 1)) -- cgit v1.2.3 From 04ccb0caf847b29542618a903f0e4243270f8c82 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 5 Jun 2009 19:22:23 +0000 Subject: bpy.config.sequenceMemCacheLimit is the only way to set the memcache in background mode and it didnt work. removed some unused vars from KX_Scene --- source/blender/python/api2_2x/bpy_config.c | 11 +++++++++-- source/gameengine/Ketsji/KX_Scene.cpp | 3 --- source/gameengine/Ketsji/KX_Scene.h | 5 ----- 3 files changed, 9 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/bpy_config.c b/source/blender/python/api2_2x/bpy_config.c index 0e6f9741751..1bbf04b8331 100644 --- a/source/blender/python/api2_2x/bpy_config.c +++ b/source/blender/python/api2_2x/bpy_config.c @@ -32,6 +32,7 @@ #include "../api2_2x/gen_utils.h" #include "bpy_config.h" #include "BKE_utildefines.h" +#include "../../../../intern/memutil/MEM_CacheLimiterC-Api.h" enum conf_consts { /*string*/ @@ -219,7 +220,7 @@ static PyObject *getIntAttr( BPy_Config *self, void *type ) static int setIntAttrClamp( BPy_Config *self, PyObject *value, void *type ) { void *param; - int min, max, size; + int min, max, size, ret; switch( GET_INT_FROM_POINTER(type) ) { case EXPP_CONF_ATTR_UNDOSTEPS: @@ -257,7 +258,13 @@ static int setIntAttrClamp( BPy_Config *self, PyObject *value, void *type ) return EXPP_ReturnIntError( PyExc_RuntimeError, "undefined type in setIntAttrClamp"); } - return EXPP_setIValueClamped( value, param, min, max, size ); + + ret = EXPP_setIValueClamped( value, param, min, max, size ); + + if(GET_INT_FROM_POINTER(type) == EXPP_CONF_ATTR_MEM_CACHE_LIMIT) + MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024); + + return ret; } static PyGetSetDef Config_getseters[] = { diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 2c74c88dc14..b57a07779cb 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -207,9 +207,6 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice, m_rootnode = NULL; m_bucketmanager=new RAS_BucketManager(); - - m_canvasDesignWidth = 0; - m_canvasDesignHeight = 0; m_attr_dict = PyDict_New(); /* new ref */ } diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 5191ea9f23f..79d3f7fd828 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -189,11 +189,6 @@ protected: */ KX_Camera* m_active_camera; - /** Desired canvas width set at design time. */ - unsigned int m_canvasDesignWidth; - /** Desired canvas height set at design time. */ - unsigned int m_canvasDesignHeight; - /** * Another temporary variable outstaying its welcome * used in AddReplicaObject to map game objects to their -- cgit v1.2.3 From 884a6a6573c08d2d0fe7f44994b8a874f45d68f2 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sat, 6 Jun 2009 00:12:49 +0000 Subject: #18872 bugfix for torque on dynamic objects #18893, fix to getParam for generic 6dof constraints --- source/gameengine/Ketsji/KX_ConstraintWrapper.cpp | 15 ++++++++ source/gameengine/Ketsji/KX_ConstraintWrapper.h | 1 + .../Physics/Bullet/CcdPhysicsController.cpp | 3 +- .../Physics/Bullet/CcdPhysicsEnvironment.cpp | 45 ++++++++++++++++++++-- .../Physics/Bullet/CcdPhysicsEnvironment.h | 3 ++ .../Physics/Dummy/DummyPhysicsEnvironment.h | 5 +++ .../Physics/Sumo/SumoPhysicsEnvironment.h | 4 ++ .../Physics/common/PHY_IPhysicsEnvironment.h | 1 + 8 files changed, 72 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index 3e5594e0d1c..c5cf67af67d 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -54,6 +54,20 @@ PyObject* KX_ConstraintWrapper::PyGetConstraintId() return PyInt_FromLong(m_constraintId); } + +PyObject* KX_ConstraintWrapper::PyGetParam(PyObject* args, PyObject* kwds) +{ + int dof; + float value; + + if (!PyArg_ParseTuple(args,"i:getParam",&dof)) + return NULL; + + value = m_physenv->getConstraintParam(m_constraintId,dof); + return PyFloat_FromDouble(value); + +} + PyObject* KX_ConstraintWrapper::PySetParam(PyObject* args, PyObject* kwds) { int dof; @@ -119,6 +133,7 @@ int KX_ConstraintWrapper::py_setattro(PyObject *attr,PyObject* value) PyMethodDef KX_ConstraintWrapper::Methods[] = { {"getConstraintId",(PyCFunction) KX_ConstraintWrapper::sPyGetConstraintId, METH_NOARGS}, {"setParam",(PyCFunction) KX_ConstraintWrapper::sPySetParam, METH_VARARGS}, + {"getParam",(PyCFunction) KX_ConstraintWrapper::sPyGetParam, METH_VARARGS}, {NULL,NULL} //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.h b/source/gameengine/Ketsji/KX_ConstraintWrapper.h index d4f038e2898..03813e0f167 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.h +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.h @@ -45,6 +45,7 @@ public: KX_PYMETHOD_NOARGS(KX_ConstraintWrapper,GetConstraintId); KX_PYMETHOD(KX_ConstraintWrapper,SetParam); + KX_PYMETHOD(KX_ConstraintWrapper,GetParam); private: int m_constraintId; diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 3a3c817698b..d22c09b4d3e 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -1019,7 +1019,8 @@ void CcdPhysicsController::ApplyTorque(float torqueX,float torqueY,float torque //workaround for incompatibility between 'DYNAMIC' game object, and angular factor //a DYNAMIC object has some inconsistency: it has no angular effect due to collisions, but still has torque const btVector3& angFac = body->getAngularFactor(); - body->setAngularFactor(1.f); + btVector3 tmpFac(0,0,1); + body->setAngularFactor(tmpFac); body->applyTorque(torque); body->setAngularFactor(angFac); } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 2dc7bffe618..bc7ccacc39b 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -1786,6 +1786,45 @@ CcdPhysicsEnvironment::~CcdPhysicsEnvironment() } +float CcdPhysicsEnvironment::getConstraintParam(int constraintId,int param) +{ + btTypedConstraint* typedConstraint = getConstraintById(constraintId); + switch (typedConstraint->getUserConstraintType()) + { + case PHY_GENERIC_6DOF_CONSTRAINT: + { + + switch (param) + { + case 0: case 1: case 2: + { + //param = 0..2 are linear constraint values + btGeneric6DofConstraint* genCons = (btGeneric6DofConstraint*)typedConstraint; + genCons->calculateTransforms(); + return genCons->getRelativePivotPosition(param); + break; + } + case 3: case 4: case 5: + { + //param = 3..5 are relative constraint (Euler) angles + btGeneric6DofConstraint* genCons = (btGeneric6DofConstraint*)typedConstraint; + genCons->calculateTransforms(); + return genCons->getAngle(param-3); + break; + } + default: + { + } + } + break; + }; + default: + { + }; + }; + return 0.f; +} + void CcdPhysicsEnvironment::setConstraintParam(int constraintId,int param,float value0,float value1) { btTypedConstraint* typedConstraint = getConstraintById(constraintId); @@ -1835,11 +1874,9 @@ void CcdPhysicsEnvironment::setConstraintParam(int constraintId,int param,float { bool springEnabled = true; genCons->setStiffness(springIndex,value0); + genCons->setDamping(springIndex,value1); genCons->enableSpring(springIndex,springEnabled); - if (value1>0.5f) - { - genCons->setEquilibriumPoint(springIndex); - } + genCons->setEquilibriumPoint(springIndex); } else { bool springEnabled = false; diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h index 4e39d531cd6..bc5491e00cc 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h @@ -149,7 +149,10 @@ protected: const btVector3& angularMaxLimits,int flags ); + virtual void setConstraintParam(int constraintId,int param,float value,float value1); + + virtual float getConstraintParam(int constraintId,int param); virtual void removeConstraint(int constraintid); diff --git a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h index 73e7e947355..8dbd137f9de 100644 --- a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h +++ b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h @@ -88,6 +88,11 @@ public: { } + virtual float getConstraintParam(int constraintId,int param) + { + return 0.f; + } + }; #endif //_DUMMYPHYSICSENVIRONMENT diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h index 4c9d59e3673..5ae33eb4b0e 100644 --- a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h +++ b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h @@ -88,6 +88,10 @@ public: virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position); virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight); + virtual float getConstraintParam(int constraintId,int param) + { + return 0.f; + } virtual void setConstraintParam(int constraintId,int param,float value,float value1) { } diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h index 1939083ef5f..c76e9d175ce 100644 --- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h +++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h @@ -159,6 +159,7 @@ class PHY_IPhysicsEnvironment virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight)=0; virtual void setConstraintParam(int constraintId,int param,float value,float value1) = 0; + virtual float getConstraintParam(int constraintId,int param) = 0; }; #endif //_IPHYSICSENVIRONMENT -- cgit v1.2.3 From 4e1bb5a806d65982320f89216b24ac7267f64f4a Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 6 Jun 2009 04:44:18 +0000 Subject: NLA SoC: Action-line is now drawn with green colouring when a strip is being tweaked to show the relationship between them. --- source/blender/editors/space_nla/nla_draw.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 6c4c64ea272..4fa27f4bc11 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -295,14 +295,23 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) case ANIMTYPE_NLAACTION: { + AnimData *adt= BKE_animdata_from_id(ale->id); + /* just draw a semi-shaded rect spanning the width of the viewable area if there's data */ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); - if (ale->data) - glColor4f(0.8f, 0.2f, 0.0f, 0.4f); // reddish color - hardcoded for now - else - glColor4f(0.6f, 0.5f, 0.5f, 0.3f); // greyish-red color - hardcoded for now + // TODO: if tweaking some action, use the same color as for the tweaked track (quick hack done for now) + if (adt && (adt->flag & ADT_NLA_EDIT_ON)) { + // greenish color (same as tweaking strip) - hardcoded for now + glColor4f(0.3f, 0.95f, 0.1f, 0.3f); // FIXME: only draw the actual range of the action darker? + } + else { + if (ale->data) + glColor4f(0.8f, 0.2f, 0.0f, 0.4f); // reddish color - hardcoded for now + else + glColor4f(0.6f, 0.5f, 0.5f, 0.3f); // greyish-red color - hardcoded for now + } /* draw slightly shifted up for greater separation from standard channels, * but also slightly shorter for some more contrast when viewing the strips -- cgit v1.2.3 From 99c0f8dcc06b7ff6f833ec4228c5bcf3ee5bcf85 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 6 Jun 2009 04:56:22 +0000 Subject: Blender.Particle.New() wasnt documented. Changed to accept Object as well as Object name to avoid name collisions with libraries. --- source/blender/python/api2_2x/Particle.c | 32 +++++++++++++-------------- source/blender/python/api2_2x/doc/Particle.py | 9 ++++++++ 2 files changed, 25 insertions(+), 16 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Particle.c b/source/blender/python/api2_2x/Particle.c index 97bdc127426..21697779ca4 100644 --- a/source/blender/python/api2_2x/Particle.c +++ b/source/blender/python/api2_2x/Particle.c @@ -57,7 +57,7 @@ /* Type Methods */ -static PyObject *M_ParticleSys_New( PyObject * self, PyObject * args ); +static PyObject *M_ParticleSys_New( PyObject * self, PyObject * value ); static PyObject *M_ParticleSys_Get( PyObject * self, PyObject * args ); /* Particle Methods */ @@ -646,7 +646,7 @@ static PyGetSetDef BPy_ParticleSys_getseters[] = { /* Python method structure definition for Blender.Particle module: */ /*****************************************************************************/ static struct PyMethodDef M_ParticleSys_methods[] = { - {"New", ( PyCFunction ) M_ParticleSys_New, METH_VARARGS, M_ParticleSys_New_doc}, + {"New", ( PyCFunction ) M_ParticleSys_New, METH_O, M_ParticleSys_New_doc}, {"Get", M_ParticleSys_Get, METH_VARARGS, M_ParticleSys_Get_doc}, {NULL, NULL, 0, NULL} }; @@ -779,27 +779,27 @@ PyObject *ParticleSys_CreatePyObject( ParticleSystem * psystem, Object *ob ) } -PyObject *M_ParticleSys_New( PyObject * self, PyObject * args ){ +PyObject *M_ParticleSys_New( PyObject * self, PyObject * value) +{ ParticleSystem *psys = 0; ParticleSystem *rpsys = 0; ModifierData *md; ParticleSystemModifierData *psmd; Object *ob = NULL; - char *name = NULL; ID *id; int nr; - - if( !PyArg_ParseTuple( args, "s", &name ) ) - return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected string argument" ); - - for( ob = G.main->object.first; ob; ob = ob->id.next ) - if( !strcmp( name, ob->id.name + 2 ) ) - break; - - if( !ob ) - return EXPP_ReturnPyObjError( PyExc_AttributeError, - "object does not exist" ); + + if ( PyString_Check( value ) ) { + char *name; + name = PyString_AsString ( value ); + ob = ( Object * ) GetIdFromList( &( G.main->object ), name ); + if( !ob ) + return EXPP_ReturnPyObjError( PyExc_AttributeError, name ); + } else if ( BPy_Object_Check(value) ) { + ob = (( BPy_Object * ) value)->object; + } else { + return EXPP_ReturnPyObjError( PyExc_TypeError, "expected object or string" ); + } id = (ID *)psys_new_settings("PSys", G.main); diff --git a/source/blender/python/api2_2x/doc/Particle.py b/source/blender/python/api2_2x/doc/Particle.py index 888747f6225..7193e365536 100644 --- a/source/blender/python/api2_2x/doc/Particle.py +++ b/source/blender/python/api2_2x/doc/Particle.py @@ -88,6 +88,15 @@ This module provides access to the B{Particle} in Blender. - Z: set Z axis for offset """ +def New(object): + """ + Create a new particle system applied to L{object} + @type object: string or L{Blender.Object.Object} + @param name: The name of an existing object. + @rtype: L{Particle} + @return: a new Particle system. + """ + class Particle: """ The Particle object -- cgit v1.2.3 From 9621d626a0484d19e2c18e57cbdd5f9c24c827f4 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 6 Jun 2009 05:06:46 +0000 Subject: NLA SoC: Various user-counts and file IO bugfixes for tweaking actions... --- source/blender/blenkernel/intern/anim_sys.c | 2 +- source/blender/blenkernel/intern/nla.c | 5 ++++- source/blender/blenloader/intern/readfile.c | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index fb4c2663c3c..390efc5ced4 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -154,7 +154,7 @@ AnimData *BKE_copy_animdata (AnimData *adt) // XXX review this... it might not be optimal behaviour yet... //id_us_plus((ID *)dadt->action); dadt->action= copy_action(adt->action); - dadt->tmpact= copy_action(adt->action); + dadt->tmpact= copy_action(adt->tmpact); /* duplicate NLA data */ copy_nladata(&dadt->nla_tracks, &adt->nla_tracks); diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index d3a01b6d610..9acbad32a42 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -675,11 +675,12 @@ short BKE_nla_tweakmode_enter (AnimData *adt) /* handle AnimData level changes: * - 'real' active action to temp storage (no need to change user-counts) - * - action of active strip set to be the 'active action' + * - action of active strip set to be the 'active action', and have its usercount incremented * - editing-flag for this AnimData block should also get turned on (for more efficient restoring) */ adt->tmpact= adt->action; adt->action= activeStrip->act; + id_us_plus(&activeStrip->act->id); adt->flag |= ADT_NLA_EDIT_ON; /* done! */ @@ -706,10 +707,12 @@ void BKE_nla_tweakmode_exit (AnimData *adt) nlt->flag &= ~NLATRACK_DISABLED; /* handle AnimData level changes: + * - 'temporary' active action needs its usercount decreased, since we're removing this reference * - 'real' active action is restored from storage * - storage pointer gets cleared (to avoid having bad notes hanging around) * - editing-flag for this AnimData block should also get turned off */ + if (adt->action) adt->action->id.us--; adt->action= adt->tmpact; adt->tmpact= NULL; adt->flag &= ~ADT_NLA_EDIT_ON; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index e3869d4bc8a..c306f5bcde4 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1896,6 +1896,7 @@ static void lib_link_animdata(FileData *fd, ID *id, AnimData *adt) /* link action data */ adt->action= newlibadr_us(fd, id->lib, adt->action); + adt->tmpact= newlibadr_us(fd, id->lib, adt->tmpact); /* link drivers */ lib_link_fcurves(fd, id, &adt->drivers); @@ -9406,6 +9407,7 @@ static void expand_animdata(FileData *fd, Main *mainvar, AnimData *adt) /* own action */ expand_doit(fd, mainvar, adt->action); + expand_doit(fd, mainvar, adt->tmpact); /* drivers - assume that these F-Curves have driver data to be in this list... */ for (fcd= adt->drivers.first; fcd; fcd= fcd->next) { -- cgit v1.2.3 From e4b20c3d2a1754f20cee544ea400c3ba522c9efd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 6 Jun 2009 11:26:43 +0000 Subject: Setting the directories and files is buggy still, but this should prevent some simple crashes, file was 80 chars long but it let the text input type in 160 chars. --- source/blender/src/buttons_scene.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index f99ac47b2c5..c0ba5469c9a 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -1206,7 +1206,7 @@ static void seq_panel_proxy() uiDefBut(block, TEX, B_SEQ_BUT_RELOAD, "Dir: ", 30,120,220,20, last_seq->strip->proxy->dir, - 0.0, 160.0, 100, 0, ""); + 0.0, (float)sizeof(last_seq->strip->proxy->dir), 100, 0, ""); } if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_FILE, @@ -1218,7 +1218,7 @@ static void seq_panel_proxy() uiDefBut(block, TEX, B_SEQ_BUT_RELOAD, "File: ", 30,100,220,20, last_seq->strip->proxy->file, - 0.0, 160.0, 100, 0, ""); + 0.0, (float)sizeof(last_seq->strip->proxy->file), 100, 0, ""); } } @@ -1307,7 +1307,7 @@ void sequencer_panels() static void sel_proxy_dir(char *name) { Sequence *last_seq = get_last_seq(); - strcpy(last_seq->strip->proxy->dir, name); + BLI_strncpy(last_seq->strip->proxy->dir, name, sizeof(last_seq->strip->proxy->dir)); allqueue(REDRAWBUTSSCENE, 0); -- cgit v1.2.3 From 580e69b365a2b308bc5d8a2e7cc41b7f3ee5c248 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Sat, 6 Jun 2009 21:49:00 +0000 Subject: Patch/Bugfix so wind noise got controlable seed and therefore redoable cloth sims - bug reported by istvan --- source/blender/blenkernel/BKE_blender.h | 2 +- source/blender/blenkernel/intern/effect.c | 10 ++++------ source/blender/blenloader/intern/readfile.c | 12 ++++++++++++ source/blender/makesdna/DNA_object_force.h | 2 +- source/blender/python/api2_2x/Object.c | 3 ++- source/blender/src/buttons_object.c | 10 +++++++++- 6 files changed, 29 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index cc2f9bd8334..5513f98b299 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -41,7 +41,7 @@ struct ListBase; struct MemFile; #define BLENDER_VERSION 249 -#define BLENDER_SUBVERSION 0 +#define BLENDER_SUBVERSION 1 #define BLENDER_MINVERSION 245 #define BLENDER_MINSUBVERSION 15 diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index cca5d68167e..5bc3e295272 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -80,7 +80,6 @@ #include "BKE_screen.h" #include "BKE_utildefines.h" -#include "PIL_time.h" #include "RE_render_ext.h" /* fluid sim particle import */ @@ -161,8 +160,7 @@ static void add_to_effectorcache(ListBase *lb, Object *ob, Object *obsrc) if(pd->forcefield == PFIELD_WIND) { - pd->rng = rng_new(1); - rng_srandom(pd->rng, (unsigned int)(ceil(PIL_check_seconds_timer()))); // use better seed + pd->rng = rng_new(pd->seed); } ec= MEM_callocN(sizeof(pEffectorCache), "effector cache"); @@ -286,14 +284,14 @@ static float eff_calc_visibility(Object *ob, float *co, float *dir) // noise function for wind e.g. static float wind_func(struct RNG *rng, float strength) { - int random = (rng_getInt(rng)+1) % 65535; // max 2357 + int random = (rng_getInt(rng)+1) % 128; // max 2357 float force = rng_getFloat(rng) + 1.0f; float ret; float sign = 0; - sign = (random > 32000.0) ? 1.0: -1.0; // dividing by 2 is not giving equal sign distribution + sign = ((float)random > 64.0) ? 1.0: -1.0; // dividing by 2 is not giving equal sign distribution - ret = sign*((float)random / force)*strength/65535.0f; + ret = sign*((float)random / force)*strength/128.0f; return ret; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index f0ec75dedd9..38b8bfaaa88 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -162,6 +162,8 @@ #include "mydevice.h" #include "blendef.h" +#include "PIL_time.h" + #include /* @@ -8144,6 +8146,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } + // correct introduce of seed for wind force + if (main->versionfile < 249 && main->subversionfile < 1) { + Object *ob; + for(ob = main->object.first; ob; ob= ob->id.next) { + if(ob->pd) + ob->pd->seed = ((unsigned int)(ceil(PIL_check_seconds_timer()))+1) % 128; + } + + } + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index dc449a64c6d..718d1a17834 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -69,7 +69,7 @@ typedef struct PartDeflect { struct Tex *tex; /* Texture of the texture effector */ struct RNG *rng; /* random noise generator for e.g. wind */ float f_noise; /* noise of force (currently used for wind) */ - int pad; + int seed; /* wind noise random seed */ } PartDeflect; typedef struct PointCache { diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index c3f7a21a7bf..b50b0082bf4 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -3757,7 +3757,8 @@ static int setupPI( Object* ob ) ob->pd->pdef_perm =0; ob->pd->f_strength =0; ob->pd->f_power =0; - ob->pd->maxdist =0; + ob->pd->maxdist =0; + ob->pd->seed =0; return 1; } diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index a90dd0447e9..8bf62836888 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -159,6 +159,8 @@ #include "butspace.h" // own module +#include "PIL_time.h" + static float prspeed=0.0; float prlen=0.0; @@ -3337,6 +3339,7 @@ static void object_panel_collision(Object *ob) ob->pd->pdef_sbdamp = 0.1f; ob->pd->pdef_sbift = 0.2f; ob->pd->pdef_sboft = 0.02f; + ob->pd->seed = ((unsigned int)(ceil(PIL_check_seconds_timer()))+1) % 128; } /* only meshes collide now */ @@ -3431,6 +3434,7 @@ static void object_panel_fields(Object *ob) ob->pd->pdef_sbift = 0.2f; ob->pd->pdef_sboft = 0.02f; ob->pd->tex_nabla = 0.025f; + ob->pd->seed = ((unsigned int)(ceil(PIL_check_seconds_timer()))+1) % 128; } if(ob->pd) { @@ -3530,7 +3534,10 @@ static void object_panel_fields(Object *ob) else if(pd->forcefield == PFIELD_HARMONIC) uiDefButF(block, NUM, B_FIELD_CHANGE, "Damp: ", 10,120,140,20, &pd->f_damp, 0, 10, 10, 0, "Damping of the harmonic force"); else if(pd->forcefield == PFIELD_WIND) - uiDefButF(block, NUM, B_FIELD_CHANGE, "Noise: ",10,120,140,20, &pd->f_noise, 0, 10, 100, 0, "Noise of the wind force"); + { + uiDefButF(block, NUM, B_FIELD_CHANGE, "Noise: ",10,120,140,20, &pd->f_noise, 0, 10, 100, 0, "Noise of the wind force"); + uiDefButI(block, NUM, B_FIELD_CHANGE, "Seed: ",10,100,140,20, &pd->seed, 1, 128, 1, 0, "Seed of the wind noise"); + } } uiBlockEndAlign(block); @@ -3839,6 +3846,7 @@ static void object_softbodies_collision(Object *ob) ob->pd->pdef_sbdamp = 0.1f; ob->pd->pdef_sbift = 0.2f; ob->pd->pdef_sboft = 0.02f; + ob->pd->seed = ((unsigned int)(ceil(PIL_check_seconds_timer()))+1) % 128; } block= uiNewBlock(&curarea->uiblocks, "object_softbodies_collision", UI_EMBOSS, UI_HELV, curarea->win); uiNewPanelTabbed("Soft Body", "Physics"); -- cgit v1.2.3 From 80571c04085165e961ba7efa0761e670104dc6d5 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sat, 6 Jun 2009 21:54:12 +0000 Subject: BGE VideoTexture: fix VideoFFmpeg range attribute + error message. --- source/gameengine/VideoTexture/VideoBase.cpp | 2 +- source/gameengine/VideoTexture/VideoFFmpeg.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/gameengine/VideoTexture/VideoBase.cpp b/source/gameengine/VideoTexture/VideoBase.cpp index ada672c5569..5d449a158d8 100644 --- a/source/gameengine/VideoTexture/VideoBase.cpp +++ b/source/gameengine/VideoTexture/VideoBase.cpp @@ -149,7 +149,7 @@ int Video_setRange (PyImage * self, PyObject * value, void * closure) || !PyFloat_Check(PySequence_Fast_GET_ITEM(value, 0)) || !PyFloat_Check(PySequence_Fast_GET_ITEM(value, 1))) { - PyErr_SetString(PyExc_TypeError, "The value must be a sequence of 2 longs"); + PyErr_SetString(PyExc_TypeError, "The value must be a sequence of 2 float"); return -1; } // set range diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp index 7910113a225..1a5481488c0 100644 --- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp +++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp @@ -117,6 +117,7 @@ bool VideoFFmpeg::release() } m_codec = NULL; m_status = SourceStopped; + m_lastFrame = -1; return true; } @@ -735,7 +736,7 @@ void VideoFFmpeg::loadFrame (void) { // get actual time double startTime = PIL_check_seconds_timer(); - if (m_lastFrame == -1) + if (m_lastFrame == -1 && !m_isFile) m_startTime = startTime; double actTime = startTime - m_startTime; // if video has ended -- cgit v1.2.3 From a03c30ea77938b38b4b6fbe1f60bd356fb49e49a Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sun, 7 Jun 2009 06:04:44 +0000 Subject: Bugfix to avoid crashing BGE on Mobile Intel GMA 950/945 Express GPU (2009 latest driver 6.14.10.4926 Windows XP) Command-line option to disable vertexarrays in BGE: -g novertexarrays --- source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index c3ff923b8fb..b78feb8f75d 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -142,7 +142,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, bool game2ipo = (SYS_GetCommandLineInt(syshandle, "game2ipo", 0) != 0); bool displaylists = (SYS_GetCommandLineInt(syshandle, "displaylists", 0) != 0); bool nodepwarnings = (SYS_GetCommandLineInt(syshandle, "ignore_deprecation_warnings", 0) != 0); - + bool novertexarrays = (SYS_GetCommandLineInt(syshandle, "novertexarrays", 0) != 0); // create the canvas, rasterizer and rendertools RAS_ICanvas* canvas = new KX_BlenderCanvas(area); canvas->SetMouseState(RAS_ICanvas::MOUSE_INVISIBLE); @@ -150,12 +150,12 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, RAS_IRasterizer* rasterizer = NULL; if(displaylists) { - if (GLEW_VERSION_1_1) + if (GLEW_VERSION_1_1 && !novertexarrays) rasterizer = new RAS_ListRasterizer(canvas, true, true); else rasterizer = new RAS_ListRasterizer(canvas); } - else if (GLEW_VERSION_1_1) + else if (GLEW_VERSION_1_1 && !novertexarrays) rasterizer = new RAS_VAOpenGLRasterizer(canvas, false); else rasterizer = new RAS_OpenGLRasterizer(canvas); -- cgit v1.2.3 From 34f29749c8d83b279dc0dd186da32018d0b30685 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 7 Jun 2009 06:49:04 +0000 Subject: NLA SoC: RNA wrapping for NLA Data Most of the relevant properties have been wrapped. - There are still some properties I'm not sure about whether they should be exposed at all (which have been left out for now). Most of these are really internal flags which are used in a few select places. - To maintain the integrity of the settings, I've included some custom code for a few of the setters (i.e. scale/end-frame) where changing one should result in a change in the other and vica-versa. Also, tweaked the wrapping for a few other types. Another side effect of this commit is that I can now uncommented some code for using F-Curves to control the influence and time of the strips. These F-Curves would need to be specifically attached to the NLA-Strip they affect for now (TODO: I need to review this again...), and as such, cannot be used yet since there's no (end-user-accessible) way to do this :) --- source/blender/blenkernel/intern/anim_sys.c | 5 +- source/blender/makesrna/RNA_access.h | 2 + source/blender/makesrna/intern/makesrna.c | 1 + source/blender/makesrna/intern/rna_animation.c | 2 +- source/blender/makesrna/intern/rna_internal.h | 1 + source/blender/makesrna/intern/rna_nla.c | 329 +++++++++++++++++++++++++ 6 files changed, 335 insertions(+), 5 deletions(-) create mode 100644 source/blender/makesrna/intern/rna_nla.c (limited to 'source') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 390efc5ced4..44817b47860 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -657,16 +657,13 @@ void nlastrip_evaluate_controls (NlaStrip *strip, float ctime) /* now strip's evaluate F-Curves for these settings (if applicable) */ if (strip->fcurves.first) { -#if 0 PointerRNA strip_ptr; - FCurve *fcu; /* create RNA-pointer needed to set values */ RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &strip_ptr); /* execute these settings as per normal */ - animsys_evaluate_fcurves(&actstrip_ptr, &strip->fcurves, NULL, ctime); -#endif + animsys_evaluate_fcurves(&strip_ptr, &strip->fcurves, NULL, ctime); } } diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index eb355a34f9f..ad9869f853e 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -189,6 +189,8 @@ extern StructRNA RNA_MultiresModifier; extern StructRNA RNA_MusgraveTexture; extern StructRNA RNA_NandController; extern StructRNA RNA_NearSensor; +extern StructRNA RNA_NlaTrack; +extern StructRNA RNA_NlaStrip; extern StructRNA RNA_Node; extern StructRNA RNA_NodeTree; extern StructRNA RNA_NoiseTexture; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 1cfba4286c7..15140e4f744 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1794,6 +1794,7 @@ RNAProcessItem PROCESS_ITEMS[]= { {"rna_mesh.c", RNA_def_mesh}, {"rna_meta.c", RNA_def_meta}, {"rna_modifier.c", RNA_def_modifier}, + {"rna_nla.c", RNA_def_nla}, {"rna_nodetree.c", RNA_def_nodetree}, {"rna_object.c", RNA_def_object}, {"rna_object_force.c", RNA_def_object_force}, diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 702dc9fa65d..3da8eb33bfd 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -184,7 +184,7 @@ void rna_def_animdata(BlenderRNA *brna) /* NLA */ prop= RNA_def_property(srna, "nla_tracks", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "nla_tracks", NULL); - RNA_def_property_struct_type(prop, "UnknownType"); // XXX! + RNA_def_property_struct_type(prop, "NlaTrack"); RNA_def_property_ui_text(prop, "NLA Tracks", "NLA Tracks (i.e. Animation Layers)."); /* Action */ diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 9071efe71f7..16f7a11d1be 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -139,6 +139,7 @@ void RNA_def_material(struct BlenderRNA *brna); void RNA_def_mesh(struct BlenderRNA *brna); void RNA_def_meta(struct BlenderRNA *brna); void RNA_def_modifier(struct BlenderRNA *brna); +void RNA_def_nla(struct BlenderRNA *brna); void RNA_def_nodetree(struct BlenderRNA *brna); void RNA_def_object(struct BlenderRNA *brna); void RNA_def_object_force(struct BlenderRNA *brna); diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c new file mode 100644 index 00000000000..35d1e415243 --- /dev/null +++ b/source/blender/makesrna/intern/rna_nla.c @@ -0,0 +1,329 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * Contributor(s): Blender Foundation (2009), Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include + +#include "RNA_define.h" +#include "RNA_types.h" + +#include "rna_internal.h" + +#include "DNA_anim_types.h" +#include "DNA_action_types.h" +#include "DNA_scene_types.h" + +#include "MEM_guardedalloc.h" + +#ifdef RNA_RUNTIME + +#include +#include + +static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) +{ + NlaStrip *data= (NlaStrip*)ptr->data; + CLAMP(value, 1, data->end); + data->start= value; +} + +static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value) +{ + NlaStrip *data= (NlaStrip*)ptr->data; + float len, actlen; + + /* clamp value to lie within valid limits - must not have zero or negative length strip */ + CLAMP(value, data->start+0.1f, MAXFRAME); + data->end= value; + + /* calculate the lengths the strip and its action (if applicable) */ + len= data->end - data->start; + actlen= data->actend - data->actstart; + if (IS_EQ(actlen, 0.0f)) actlen= 1.0f; + + /* now, adjust the 'scale' setting to reflect this (so that this change can be valid) */ + data->scale= len / ((actlen) * data->repeat); +} + +static void rna_NlaStrip_scale_set(PointerRNA *ptr, float value) +{ + NlaStrip *data= (NlaStrip*)ptr->data; + float actlen, mapping; + + /* set scale value */ + CLAMP(value, 0.0001f, 1000.0f); /* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */ + data->scale= value; + + /* calculate existing factors */ + actlen= data->actend - data->actstart; + if (IS_EQ(actlen, 0.0f)) actlen= 1.0f; + mapping= data->scale * data->repeat; + + /* adjust endpoint of strip in response to this */ + if (IS_EQ(mapping, 0.0f) == 0) + data->end = (actlen * mapping) + data->start; + else + printf("NlaStrip Set Scale Error (in RNA): Scale = %0.4f, Repeat = %0.4f \n", data->scale, data->repeat); +} + +static void rna_NlaStrip_blend_in_set(PointerRNA *ptr, float value) +{ + NlaStrip *data= (NlaStrip*)ptr->data; + float len; + + /* blend-in is limited to the length of the strip, and also cannot overlap with blendout */ + len= (data->end - data->start) - data->blendout; + CLAMP(value, 0, len); + + data->blendin= value; +} + +static void rna_NlaStrip_blend_out_set(PointerRNA *ptr, float value) +{ + NlaStrip *data= (NlaStrip*)ptr->data; + float len; + + /* blend-out is limited to the length of the strip */ + len= (data->end - data->start); + CLAMP(value, 0, len); + + /* it also cannot overlap with blendin */ + if ((len - value) < data->blendin) + value= len - data->blendin; + + data->blendout= value; +} + +static void rna_NlaStrip_action_start_frame_set(PointerRNA *ptr, float value) +{ + NlaStrip *data= (NlaStrip*)ptr->data; + CLAMP(value, 1, data->actend); + data->actstart= value; +} + +static void rna_NlaStrip_action_end_frame_set(PointerRNA *ptr, float value) +{ + NlaStrip *data= (NlaStrip*)ptr->data; + CLAMP(value, data->actstart, MAXFRAME); + data->actend= value; +} + +#else + +void rna_def_nlastrip(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + /* enum defs */ + static EnumPropertyItem prop_type_items[] = { + {NLASTRIP_TYPE_CLIP, "CLIP", "Action Clip", "NLA Strip references some Action."}, + {NLASTRIP_TYPE_TRANSITION, "TRANSITION", "Transition", "NLA Strip 'transitions' between adjacent strips."}, + {0, NULL, NULL, NULL}}; + static EnumPropertyItem prop_mode_blend_items[] = { + {NLASTRIP_MODE_BLEND, "BLEND", "Blend", "Results of strip and accumulated results are combined in ratio governed by influence."}, + {NLASTRIP_MODE_ADD, "ADD", "Add", "Weighted result of strip is added to the accumlated results."}, + {NLASTRIP_MODE_SUBTRACT, "SUBTRACT", "Subtract", "Weighted result of strip is removed from the accumlated results."}, + {NLASTRIP_MODE_MULTIPLY, "MULITPLY", "Multiply", "Weighted result of strip is multiplied with the accumlated results."}, + {0, NULL, NULL, NULL}}; + static EnumPropertyItem prop_mode_extend_items[] = { + {NLASTRIP_EXTEND_NOTHING, "NOTHING", "Nothing", "Strip has no influence past its extents."}, + {NLASTRIP_EXTEND_HOLD, "HOLD", "Hold", "Hold the first frame if no previous strips in track, and always hold last frame."}, + {NLASTRIP_EXTEND_HOLD_FORWARD, "HOLD_FORWARD", "Hold Forward", "Only hold last frame."}, + {0, NULL, NULL, NULL}}; + + /* struct definition */ + srna= RNA_def_struct(brna, "NlaStrip", NULL); + RNA_def_struct_ui_text(srna, "NLA Strip", "A container referencing an existing Action."); + //RNA_def_struct_ui_icon(srna, ICON_ACTION); + + /* Enums */ + prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "type"); + RNA_def_property_enum_items(prop, prop_type_items); + RNA_def_property_ui_text(prop, "Type", "Type of NLA Strip."); + + prop= RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "extendmode"); + RNA_def_property_enum_items(prop, prop_mode_extend_items); + RNA_def_property_ui_text(prop, "Extrapolation", "Action to take for gaps past the strip extents."); + + prop= RNA_def_property(srna, "blending", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "blendmode"); + RNA_def_property_enum_items(prop, prop_mode_blend_items); + RNA_def_property_ui_text(prop, "Blending", "Method used for combining strip's result with accumulated result."); + + /* Strip extents */ + prop= RNA_def_property(srna, "start_frame", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "start"); + RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_start_frame_set", NULL); + RNA_def_property_ui_text(prop, "Start Frame", ""); + + prop= RNA_def_property(srna, "end_frame", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "end"); + RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_end_frame_set", NULL); + RNA_def_property_ui_text(prop, "End Frame", ""); + + /* Blending */ + prop= RNA_def_property(srna, "blend_in", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "blendin"); + RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_in_set", NULL); + RNA_def_property_ui_text(prop, "Blend In", "Number of frames at start of strip to fade in influence."); + + prop= RNA_def_property(srna, "blend_out", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "blendout"); + RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_out_set", NULL); + RNA_def_property_ui_text(prop, "Blend Out", ""); + + prop= RNA_def_property(srna, "auto_blending", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_AUTO_BLENDS); + RNA_def_property_ui_text(prop, "Auto Blend In/Out", "Number of frames for Blending In/Out is automatically determined from overlapping strips."); + + /* Action */ + prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "act"); + RNA_def_property_ui_text(prop, "Action", "Action referenced by this strip."); + + /* Action extents */ + prop= RNA_def_property(srna, "action_start_frame", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "actstart"); + RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_start_frame_set", NULL); + RNA_def_property_ui_text(prop, "Action Start Frame", ""); + + prop= RNA_def_property(srna, "action_end_frame", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "actend"); + RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_end_frame_set", NULL); + RNA_def_property_ui_text(prop, "Action End Frame", ""); + + /* Action Reuse */ + prop= RNA_def_property(srna, "repeat", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "repeat"); + RNA_def_property_range(prop, 1.0f, 1000.0f); /* these limits have currently be chosen arbitarily, but could be extended (minimum should still be > 0 though) if needed... */ + RNA_def_property_ui_text(prop, "Repeat", "Number of times to repeat the "); + + prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "scale"); + RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_scale_set", NULL); + RNA_def_property_range(prop, 0.0001f, 1000.0f); /* these limits can be extended, but beyond this, we can get some crazy+annoying bugs due to numeric errors */ + RNA_def_property_ui_text(prop, "Scale", "Scaling factor for action."); + + // TODO: strip's F-Curves? + + /* Strip's F-Modifiers */ + prop= RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "FModifier"); + RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting all the F-Curves in the referenced Action."); + + /* Settings - Values necessary for evaluation */ + prop= RNA_def_property(srna, "influence", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Influence", "Amount the strip contributes to the current result."); + + prop= RNA_def_property(srna, "strip_time", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Strip Time", "Frame of referenced Action to evaluate."); + + prop= RNA_def_property(srna, "animated_influence", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, not editable + RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_INFLUENCE); + RNA_def_property_ui_text(prop, "Animated Influence", "Influence setting is controlled by an F-Curve rather than automatically determined."); + + prop= RNA_def_property(srna, "animated_time", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, not editable + RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_INFLUENCE); + RNA_def_property_ui_text(prop, "Animated Strip Time", "Strip time is controlled by an F-Curve rather than automatically determined."); + + /* settings */ + prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */ + RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_ACTIVE); + RNA_def_property_ui_text(prop, "Active", "NLA Strip is active."); + + prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_SELECT); + RNA_def_property_ui_text(prop, "Selected", "NLA Strip is selected."); + + prop= RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_MUTED); + RNA_def_property_ui_text(prop, "Muted", "NLA Strip is not evaluated."); + + prop= RNA_def_property(srna, "reversed", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_REVERSE); + RNA_def_property_ui_text(prop, "Reversed", "NLA Strip is played back in reverse order (only when timing is automatically determined)."); + + // TODO: + // - sync length +} + +void rna_def_nlatrack(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "NlaTrack", NULL); + RNA_def_struct_ui_text(srna, "NLA Track", "A animation layer containing Actions referenced as NLA strips."); + //RNA_def_struct_ui_icon(srna, ICON_ACTION); + + /* strips collection */ + prop= RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "NlaStrip"); + RNA_def_property_ui_text(prop, "NLA Strips", "NLA Strips on this NLA-track."); + + /* name property */ + prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); + RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_struct_name_property(srna, prop); + + /* settings */ + prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */ + RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_ACTIVE); + RNA_def_property_ui_text(prop, "Active", "NLA Track is active."); + + prop= RNA_def_property(srna, "solo", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* can be made editable by hooking it up to the necessary NLA API methods */ + RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SOLO); + RNA_def_property_ui_text(prop, "Solo", "NLA Track is evaluated itself (i.e. active Action and all other NLA Tracks in the same AnimData block are disabled)."); + + prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SELECTED); + RNA_def_property_ui_text(prop, "Selected", "NLA Track is selected."); + + prop= RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_MUTED); + RNA_def_property_ui_text(prop, "Muted", "NLA Track is not evaluated."); + + prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_PROTECTED); + RNA_def_property_ui_text(prop, "Locked", "NLA Track is locked."); +} + +/* --------- */ + +void RNA_def_nla(BlenderRNA *brna) +{ + rna_def_nlatrack(brna); + rna_def_nlastrip(brna); +} + + +#endif -- cgit v1.2.3 From 43c7c15e2be555454f54840307fd5ea7d61d0216 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 7 Jun 2009 07:04:31 +0000 Subject: NLA SoC: 2 little tweaks - Evaluation times for strips are now strictly clamped to the endpoints of the strips - i.e. if a strip has 'extend' on, the strip's evaluation time won't continue to change as time changes - New NLA Editor instances now have auto-snapping turned on by default (as they should) --- source/blender/blenkernel/intern/anim_sys.c | 10 ++++++++++ source/blender/editors/space_nla/space_nla.c | 3 +++ 2 files changed, 13 insertions(+) (limited to 'source') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 44817b47860..3290e06dfb4 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -730,6 +730,16 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index */ if ((estrip == NULL) || (estrip->flag & NLASTRIP_FLAG_MUTED)) return; + + /* if ctime was not within the boundaries of the strip, clamp! */ + switch (side) { + case NES_TIME_BEFORE: /* extend first frame only */ + ctime= estrip->start; + break; + case NES_TIME_AFTER: /* extend last frame only */ + ctime= estrip->end; + break; + } /* evaluate strip's evaluation controls * - skip if no influence (i.e. same effect as muting the strip) diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 39579ec96da..32ced127831 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -79,6 +79,9 @@ static SpaceLink *nla_new(const bContext *C) /* allocate DopeSheet data for NLA Editor */ snla->ads= MEM_callocN(sizeof(bDopeSheet), "NlaEdit DopeSheet"); + /* set auto-snapping settings */ + snla->autosnap = SACTSNAP_FRAME; + /* header */ ar= MEM_callocN(sizeof(ARegion), "header for nla"); -- cgit v1.2.3 From 019baf8b8fc0cae24b8706a557a296e598290615 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 7 Jun 2009 11:37:15 +0000 Subject: NLA SoC: Adding skeleton code for a buttons region in NLA If anyone's doing any testing at this point, please check if this works ok for files with new/old NLA Editors, as I was having some problems with one of my testing (saved from this branch) files with this. --- source/blender/editors/space_nla/nla_buttons.c | 198 +++++++++++++++++++++++++ source/blender/editors/space_nla/nla_intern.h | 7 + source/blender/editors/space_nla/nla_ops.c | 7 + source/blender/editors/space_nla/space_nla.c | 104 +++++++++++++ 4 files changed, 316 insertions(+) create mode 100644 source/blender/editors/space_nla/nla_buttons.c (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c new file mode 100644 index 00000000000..118dc988dfb --- /dev/null +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -0,0 +1,198 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation, Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include +#include +#include + +#include "DNA_anim_types.h" +#include "DNA_action_types.h" +#include "DNA_object_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_userdef_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_arithb.h" +#include "BLI_blenlib.h" +#include "BLI_editVert.h" +#include "BLI_rand.h" + +#include "BKE_animsys.h" +#include "BKE_nla.h" +#include "BKE_action.h" +#include "BKE_context.h" +#include "BKE_curve.h" +#include "BKE_customdata.h" +#include "BKE_depsgraph.h" +#include "BKE_fcurve.h" +#include "BKE_object.h" +#include "BKE_global.h" +#include "BKE_scene.h" +#include "BKE_screen.h" +#include "BKE_utildefines.h" + +#include "BIF_gl.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "ED_anim_api.h" +#include "ED_keyframing.h" +#include "ED_screen.h" +#include "ED_types.h" +#include "ED_util.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "nla_intern.h" // own include + + +/* ******************* nla editor space & buttons ************** */ + +#define B_NOP 1 +#define B_REDR 2 + +/* -------------- */ + +static void do_nla_region_buttons(bContext *C, void *arg, int event) +{ + //Scene *scene= CTX_data_scene(C); + + switch(event) { + + } + + /* default for now */ + //WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, ob); +} + +static int nla_panel_context(const bContext *C, bAnimListElem **ale, NlaTrack **nlt) +{ + bAnimContext ac; + bAnimListElem *elem= NULL; + + /* for now, only draw if we could init the anim-context info (necessary for all animation-related tools) + * to work correctly is able to be correctly retrieved. There's no point showing empty panels? + */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return 0; + + // XXX + return 1; + + /* try to find 'active' F-Curve */ + //elem= get_active_fcurve_channel(&ac); + if(elem == NULL) + return 0; + + if(nlt) + *nlt= (NlaTrack*)elem->data; + if(ale) + *ale= elem; + else + MEM_freeN(elem); + + return 1; +} + +static int nla_panel_poll(const bContext *C, PanelType *pt) +{ + return nla_panel_context(C, NULL, NULL); +} + +static void nla_panel_properties(const bContext *C, Panel *pa) +{ + bAnimListElem *ale; + NlaTrack *nlt; + uiBlock *block; + char name[128]; + + if(!nla_panel_context(C, &ale, &nlt)) + return; + + block= uiLayoutFreeBlock(pa->layout); + uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); + + /* Info - Active F-Curve */ + uiDefBut(block, LABEL, 1, "Active NLA Strip:", 10, 200, 150, 19, NULL, 0.0, 0.0, 0, 0, ""); + + + //MEM_freeN(ale); +} + + +/* ******************* general ******************************** */ + + +void nla_buttons_register(ARegionType *art) +{ + PanelType *pt; + + pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel properties"); + strcpy(pt->idname, "NLA_PT_properties"); + strcpy(pt->label, "Properties"); + pt->draw= nla_panel_properties; + pt->poll= nla_panel_poll; + BLI_addtail(&art->paneltypes, pt); +} + +static int nla_properties(bContext *C, wmOperator *op) +{ + ScrArea *sa= CTX_wm_area(C); + ARegion *ar= nla_has_buttons_region(sa); + + if(ar) { + ar->flag ^= RGN_FLAG_HIDDEN; + ar->v2d.flag &= ~V2D_IS_INITIALISED; /* XXX should become hide/unhide api? */ + + ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa); + ED_area_tag_redraw(sa); + } + return OPERATOR_FINISHED; +} + +void NLAEDIT_OT_properties(wmOperatorType *ot) +{ + ot->name= "Properties"; + ot->idname= "NLAEDIT_OT_properties"; + + ot->exec= nla_properties; + ot->poll= ED_operator_nla_active; + + /* flags */ + ot->flag= 0; +} diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 3d8cb7548c0..00de0498e4b 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -48,6 +48,13 @@ /* channel toggle-buttons */ #define NLACHANNEL_BUTTON_WIDTH 16 +/* **************************************** */ +/* space_nla.c / nla_buttons.c */ + +ARegion *nla_has_buttons_region(ScrArea *sa); + +void nla_buttons_register(ARegionType *art); +void NLAEDIT_OT_properties(wmOperatorType *ot); /* **************************************** */ /* nla_draw.c */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 057e4b05656..f59cbd9c1d4 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -115,6 +115,9 @@ int nlaop_poll_tweakmode_on (bContext *C) void nla_operatortypes(void) { + /* view */ + WM_operatortype_append(NLAEDIT_OT_properties); + /* channels */ WM_operatortype_append(NLA_OT_channels_click); WM_operatortype_append(NLA_OT_channels_select_border); @@ -197,6 +200,10 @@ void nla_keymap(wmWindowManager *wm) { ListBase *keymap; + /* keymap for all regions */ + keymap= WM_keymap_listbase(wm, "NLA Generic", SPACE_NLA, 0); + WM_keymap_add_item(keymap, "NLAEDIT_OT_properties", NKEY, KM_PRESS, 0, 0); + /* channels */ /* Channels are not directly handled by the NLA Editor module, but are inherited from the Animation module. * Most of the relevant operations, keymaps, drawing, etc. can therefore all be found in that module instead, as there diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 32ced127831..5490f40eb03 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -66,6 +66,39 @@ #include "nla_intern.h" // own include +/* ******************** manage regions ********************* */ + +ARegion *nla_has_buttons_region(ScrArea *sa) +{ + ARegion *ar, *arnew; + + for (ar= sa->regionbase.first; ar; ar= ar->next) { + if (ar->regiontype==RGN_TYPE_UI) + return ar; + } + + /* add subdiv level; after main */ + for (ar= sa->regionbase.first; ar; ar= ar->next) { + if (ar->regiontype==RGN_TYPE_WINDOW) + break; + } + + /* is error! */ + if (ar==NULL) return NULL; + + arnew= MEM_callocN(sizeof(ARegion), "buttons for nla"); + + BLI_insertlinkafter(&sa->regionbase, ar, arnew); + arnew->regiontype= RGN_TYPE_UI; + arnew->alignment= RGN_ALIGN_RIGHT; + + arnew->flag = RGN_FLAG_HIDDEN; + + return arnew; +} + + + /* ******************** default callbacks for nla space ***************** */ static SpaceLink *nla_new(const bContext *C) @@ -130,6 +163,14 @@ static SpaceLink *nla_new(const bContext *C) ar->v2d.align= V2D_ALIGN_NO_NEG_Y; ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL; + /* ui buttons */ + ar= MEM_callocN(sizeof(ARegion), "buttons area for nla"); + + BLI_addtail(&snla->regionbase, ar); + ar->regiontype= RGN_TYPE_UI; + ar->alignment= RGN_ALIGN_RIGHT; + ar->flag = RGN_FLAG_HIDDEN; + return (SpaceLink *)snla; } @@ -178,6 +219,8 @@ static void nla_channel_area_init(wmWindowManager *wm, ARegion *ar) // TODO: cannot use generic copy, need special NLA version keymap= WM_keymap_listbase(wm, "NLA Channels", SPACE_NLA, 0); /* XXX weak? */ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); + keymap= WM_keymap_listbase(wm, "NLA Generic", SPACE_NLA, 0); + WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } /* draw entirely, view changes should be handled here */ @@ -221,6 +264,8 @@ static void nla_main_area_init(wmWindowManager *wm, ARegion *ar) /* own keymap */ keymap= WM_keymap_listbase(wm, "NLA Data", SPACE_NLA, 0); /* XXX weak? */ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); + keymap= WM_keymap_listbase(wm, "NLA Generic", SPACE_NLA, 0); + WM_event_add_keymap_handler(&ar->handlers, keymap); } static void nla_main_area_draw(const bContext *C, ARegion *ar) @@ -309,6 +354,52 @@ static void nla_header_area_draw(const bContext *C, ARegion *ar) UI_view2d_view_restore(C); } +/* add handlers, stuff you only do once or on area/region changes */ +static void nla_buttons_area_init(wmWindowManager *wm, ARegion *ar) +{ + ListBase *keymap; + + ED_region_panels_init(wm, ar); + + keymap= WM_keymap_listbase(wm, "NLA Generic", SPACE_NLA, 0); + WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); +} + +static void nla_buttons_area_draw(const bContext *C, ARegion *ar) +{ + ED_region_panels(C, ar, 1, NULL); +} + +static void nla_region_listener(ARegion *ar, wmNotifier *wmn) +{ + /* context changes */ + switch(wmn->category) { + case NC_SCENE: + switch(wmn->data) { + case ND_OB_ACTIVE: + case ND_FRAME: + case ND_MARKERS: + ED_region_tag_redraw(ar); + break; + } + break; + case NC_OBJECT: + switch(wmn->data) { + case ND_BONE_ACTIVE: + case ND_BONE_SELECT: + case ND_KEYS: + ED_region_tag_redraw(ar); + break; + } + break; + default: + if(wmn->data==ND_KEYS) + ED_region_tag_redraw(ar); + + } +} + + static void nla_main_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ @@ -439,6 +530,19 @@ void ED_spacetype_nla(void) BLI_addhead(&st->regiontypes, art); + /* regions: UI buttons */ + art= MEM_callocN(sizeof(ARegionType), "spacetype nla region"); + art->regionid = RGN_TYPE_UI; + art->minsizex= 200; + art->keymapflag= ED_KEYMAP_UI; + art->listener= nla_region_listener; + art->init= nla_buttons_area_init; + art->draw= nla_buttons_area_draw; + + BLI_addhead(&st->regiontypes, art); + + nla_buttons_register(art); + BKE_spacetype_register(st); } -- cgit v1.2.3 From 39ff455eecdacb6cc7cfcc1003b9faf6e6b8c21b Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 8 Jun 2009 01:07:19 +0000 Subject: NLA SoC: Added button for entering/exiting TweakMode - Should the icons used for this be reversed? --- source/blender/editors/space_nla/nla_edit.c | 4 ++++ source/blender/editors/space_nla/nla_header.c | 9 +++++++++ 2 files changed, 13 insertions(+) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index f7053957667..49d43f29c5f 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -120,6 +120,10 @@ static int nlaedit_enable_tweakmode_exec (bContext *C, wmOperator *op) ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); WM_event_add_notifier(C, NC_SCENE, NULL); } + else { + BKE_report(op->reports, RPT_ERROR, "No active strip(s) to enter tweakmode on."); + return OPERATOR_CANCELLED; + } /* done */ return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index 0dcd3198db0..7ce7536878b 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -118,6 +118,7 @@ static void do_nla_buttons(bContext *C, void *arg, int event) void nla_header_buttons(const bContext *C, ARegion *ar) { SpaceNla *snla= (SpaceNla *)CTX_wm_space_data(C); + Scene *scene= CTX_data_scene(C); ScrArea *sa= CTX_wm_area(C); uiBlock *block; int xco, yco= 3; @@ -178,6 +179,14 @@ void nla_header_buttons(const bContext *C, ARegion *ar) } xco += 98; + /* Tweakmode... */ + // XXX these icons need to be changed + if (scene->flag & SCE_NLA_EDIT_ON) + uiDefIconTextButO(block, BUT, "NLAEDIT_OT_tweakmode_exit", WM_OP_INVOKE_REGION_WIN, ICON_NLA, "Exit TweakMode", xco,yco,130,YIC, "Restore the true active action. (TAB)"); + else + uiDefIconTextButO(block, BUT, "NLAEDIT_OT_tweakmode_enter", WM_OP_INVOKE_REGION_WIN, ICON_EDIT, "Enter TweakMode", xco,yco,130,YIC, "Temporarily set the action referenced by the active strip as the active action so that it can be tweaked. (TAB)"); + xco+= 150; + /* always as last */ UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); -- cgit v1.2.3 From d8ae009653a58f272dda39eaf637c8ddaaa3916d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 8 Jun 2009 11:04:05 +0000 Subject: needed to use sizeof(string)-1 for text button lengths --- source/blender/src/buttons_scene.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index c0ba5469c9a..7c361b6113d 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -1206,7 +1206,7 @@ static void seq_panel_proxy() uiDefBut(block, TEX, B_SEQ_BUT_RELOAD, "Dir: ", 30,120,220,20, last_seq->strip->proxy->dir, - 0.0, (float)sizeof(last_seq->strip->proxy->dir), 100, 0, ""); + 0.0, (float)sizeof(last_seq->strip->proxy->dir)-1, 100, 0, ""); } if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_FILE, @@ -1218,7 +1218,7 @@ static void seq_panel_proxy() uiDefBut(block, TEX, B_SEQ_BUT_RELOAD, "File: ", 30,100,220,20, last_seq->strip->proxy->file, - 0.0, (float)sizeof(last_seq->strip->proxy->file), 100, 0, ""); + 0.0, (float)sizeof(last_seq->strip->proxy->file)-1, 100, 0, ""); } } -- cgit v1.2.3 From a8f81615183dea449d337b24338e60bf928b3653 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 8 Jun 2009 11:11:39 +0000 Subject: NLA SoC: Fixed Outliner drawing for NLA data, and set icons for RNA wrapping of this data... --- source/blender/editors/space_outliner/outliner.c | 14 ++++++++------ source/blender/editors/space_outliner/outliner_intern.h | 1 + source/blender/makesrna/intern/rna_nla.c | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 16748af39d5..eba0aa84e85 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -949,7 +949,6 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i /* NLA Data */ if (adt->nla_tracks.first) { -#if 0 TreeElement *tenla= outliner_add_element(soops, &te->subtree, adt, te, TSE_NLA, 0); NlaTrack *nlt; int a= 0; @@ -957,17 +956,18 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i tenla->name= "NLA Tracks"; for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { - TreeElement *tenlt= outliner_add_element(soops, &te->subtree, nlt, te, TSE_NLA_TRACK, a); - bActionStrip *strip; + TreeElement *tenlt= outliner_add_element(soops, &tenla->subtree, nlt, tenla, TSE_NLA_TRACK, a); + NlaStrip *strip; TreeElement *ten; int b= 0; - for (strip=nlt->strips.first; strip; strip=strip->next, a++) { - ten= outliner_add_element(soops, &tenla->subtree, strip->act, tenla, TSE_NLA_ACTION, a); + tenlt->name= nlt->name; + + for (strip=nlt->strips.first; strip; strip=strip->next, b++) { + ten= outliner_add_element(soops, &tenlt->subtree, strip->act, tenlt, TSE_NLA_ACTION, b); if(ten) ten->directdata= strip; } } -#endif } } else if(type==TSE_SEQUENCE) { @@ -3521,6 +3521,8 @@ static void tselem_draw_icon(float x, float y, TreeStoreElem *tselem, TreeElemen UI_icon_draw(x, y, ICON_ANIM_DATA); break; // xxx case TSE_NLA: UI_icon_draw(x, y, ICON_NLA); break; + case TSE_NLA_TRACK: + UI_icon_draw(x, y, ICON_NLA); break; // XXX case TSE_NLA_ACTION: UI_icon_draw(x, y, ICON_ACTION); break; case TSE_DEFGROUP_BASE: diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index 48c904121a5..204298f2b70 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -94,6 +94,7 @@ typedef struct TreeElement { #define TSE_RNA_STRUCT 30 #define TSE_RNA_PROPERTY 31 #define TSE_RNA_ARRAY_ELEM 32 +#define TSE_NLA_TRACK 33 /* outliner search flags */ #define OL_FIND 0 diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 35d1e415243..0a7d17adc09 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -155,7 +155,7 @@ void rna_def_nlastrip(BlenderRNA *brna) /* struct definition */ srna= RNA_def_struct(brna, "NlaStrip", NULL); RNA_def_struct_ui_text(srna, "NLA Strip", "A container referencing an existing Action."); - //RNA_def_struct_ui_icon(srna, ICON_ACTION); + RNA_def_struct_ui_icon(srna, ICON_NLA); // XXX /* Enums */ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); @@ -281,7 +281,7 @@ void rna_def_nlatrack(BlenderRNA *brna) srna= RNA_def_struct(brna, "NlaTrack", NULL); RNA_def_struct_ui_text(srna, "NLA Track", "A animation layer containing Actions referenced as NLA strips."); - //RNA_def_struct_ui_icon(srna, ICON_ACTION); + RNA_def_struct_ui_icon(srna, ICON_NLA); /* strips collection */ prop= RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE); -- cgit v1.2.3 From 105d3fd32324c3d6dcf1b1ecbd5d50c4afea89cc Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Mon, 8 Jun 2009 17:30:53 +0000 Subject: Fix "no newline at end of file" warning. --- source/blender/blenkernel/intern/scene.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index df304568ed5..2c71f07a97a 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -802,4 +802,4 @@ void free_dome_warp_text(struct Text *txt) scene->r.dometext = NULL; scene = scene->id.next; } -} \ No newline at end of file +} -- cgit v1.2.3 From 4b8b9b222eebbfa01566b90a00bba8a35835c671 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 9 Jun 2009 04:39:33 +0000 Subject: NLA SoC: Added buttons in NKEY region for NLA Editor - Most of the settings wrapped in RNA have been exposed here using the new layout engine stuff from Brecht (C-API). I've tried to maintain a hierarchy of high-level (owner, generic-settings) to low-level (children, specialised-settings) here, which seems to be the prevailing guidelines? (It took a while to try to understand how this all fitted together, since there were no clear examples on how to use this anywhere) - NLA-Strip Modifiers have not been exposed yet. They still use the old-style drawing, which may/may not be compatible here. - Fixed a bug with how the notifiers from this panel get sent. I really don't know how the compiler would have missed the undeclared pointer that was being used ('ob'). --- source/blender/editors/animation/anim_filter.c | 1 - source/blender/editors/space_nla/nla_buttons.c | 216 ++++++++++++++++++++++--- 2 files changed, 190 insertions(+), 27 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 32405571b57..cdda13d999d 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -730,7 +730,6 @@ static int animdata_filter_nla (ListBase *anim_data, AnimData *adt, int filter_m /* only include this track if selected in a way consistent with the filtering requirements */ if ( ANIMCHANNEL_SELOK(SEL_NLT(nlt)) ) { /* only include if this track is active */ - // XXX keep this? if (!(filter_mode & ANIMFILTER_ACTIVE) || (nlt->flag & NLATRACK_ACTIVE)) { ale= make_new_animlistelem(nlt, ANIMTYPE_NLATRACK, owner, ownertype, owner_id); diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 118dc988dfb..80982d9feb5 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -97,13 +97,16 @@ static void do_nla_region_buttons(bContext *C, void *arg, int event) } /* default for now */ - //WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, ob); + WM_event_add_notifier(C, NC_SCENE|NC_OBJECT|ND_TRANSFORM, NULL); } -static int nla_panel_context(const bContext *C, bAnimListElem **ale, NlaTrack **nlt) +static int nla_panel_context(const bContext *C, PointerRNA *nlt_ptr, PointerRNA *strip_ptr) { bAnimContext ac; - bAnimListElem *elem= NULL; + bAnimListElem *ale= NULL; + ListBase anim_data = {NULL, NULL}; + short found=0; + int filter; /* for now, only draw if we could init the anim-context info (necessary for all animation-related tools) * to work correctly is able to be correctly retrieved. There's no point showing empty panels? @@ -111,20 +114,32 @@ static int nla_panel_context(const bContext *C, bAnimListElem **ale, NlaTrack ** if (ANIM_animdata_get_context(C, &ac) == 0) return 0; - // XXX - return 1; + /* extract list of active channel(s), of which we should only take the first one (expecting it to be an NLA track) */ + filter= (ANIMFILTER_VISIBLE|ANIMFILTER_ACTIVE); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - /* try to find 'active' F-Curve */ - //elem= get_active_fcurve_channel(&ac); - if(elem == NULL) - return 0; + for (ale= anim_data.first; ale; ale= ale->next) { + if (ale->type == ANIMTYPE_NLATRACK) { + NlaTrack *nlt= (NlaTrack *)ale->data; + + /* found it, now set the pointers */ + if (nlt_ptr) { + /* NLA-Track pointer */ + RNA_pointer_create(ale->id, &RNA_NlaTrack, nlt, nlt_ptr); + } + if (strip_ptr) { + /* NLA-Strip pointer */ + NlaStrip *strip= BKE_nlastrip_find_active(nlt); + RNA_pointer_create(ale->id, &RNA_NlaStrip, strip, strip_ptr); + } + + found= 1; + break; + } + } - if(nlt) - *nlt= (NlaTrack*)elem->data; - if(ale) - *ale= elem; - else - MEM_freeN(elem); + /* free temp data */ + BLI_freelistN(&anim_data); return 1; } @@ -134,26 +149,147 @@ static int nla_panel_poll(const bContext *C, PanelType *pt) return nla_panel_context(C, NULL, NULL); } + +/* -------------- */ + +/* active NLA-Track */ +static void nla_panel_track (const bContext *C, Panel *pa) +{ + PointerRNA nlt_ptr; + uiLayout *layout= pa->layout; + uiLayout *row; + uiBlock *block; + + /* check context and also validity of pointer */ + if (!nla_panel_context(C, &nlt_ptr, NULL)) + return; + if (nlt_ptr.data == NULL) + return; + + block= uiLayoutGetBlock(layout); + uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); + + /* Info - Active NLA-Context:Track ---------------------- */ + row= uiLayoutRow(layout, 1); + uiItemR(row, NULL, ICON_NLA, &nlt_ptr, "name", 0, 0, 0); +} + +/* generic settings for active NLA-Strip */ static void nla_panel_properties(const bContext *C, Panel *pa) { - bAnimListElem *ale; - NlaTrack *nlt; + PointerRNA strip_ptr; + uiLayout *layout= pa->layout; + uiLayout *column, *row, *subcol; uiBlock *block; - char name[128]; - if(!nla_panel_context(C, &ale, &nlt)) + /* check context and also validity of pointer */ + if (!nla_panel_context(C, NULL, &strip_ptr)) + return; + if (strip_ptr.data == NULL) return; - block= uiLayoutFreeBlock(pa->layout); + block= uiLayoutGetBlock(layout); uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); - - /* Info - Active F-Curve */ - uiDefBut(block, LABEL, 1, "Active NLA Strip:", 10, 200, 150, 19, NULL, 0.0, 0.0, 0, 0, ""); + /* Strip Properties ------------------------------------- */ + /* strip type */ + row= uiLayoutRow(layout, 1); + uiItemR(row, NULL, 0, &strip_ptr, "type", 0, 0, 0); + + /* strip extents */ + column= uiLayoutColumn(layout, 1); + uiItemL(column, "Strip Extents:", 0); + uiItemR(column, NULL, 0, &strip_ptr, "start_frame", 0, 0, 0); + uiItemR(column, NULL, 0, &strip_ptr, "end_frame", 0, 0, 0); + + /* extrapolation */ + row= uiLayoutRow(layout, 1); + uiItemR(row, NULL, 0, &strip_ptr, "extrapolation", 0, 0, 0); + + /* blending */ + row= uiLayoutRow(layout, 1); + uiItemR(row, NULL, 0, &strip_ptr, "blending", 0, 0, 0); + + /* blend in/out + autoblending + * - blend in/out can only be set when autoblending is off + */ + column= uiLayoutColumn(layout, 1); + uiItemR(column, NULL, 0, &strip_ptr, "auto_blending", 0, 0, 0); // XXX as toggle? + subcol= uiLayoutColumn(column, 1); + uiLayoutSetActive(subcol, RNA_boolean_get(&strip_ptr, "auto_blending")==0); + uiItemR(subcol, NULL, 0, &strip_ptr, "blend_in", 0, 0, 0); + uiItemR(subcol, NULL, 0, &strip_ptr, "blend_out", 0, 0, 0); + + /* settings */ + column= uiLayoutColumn(layout, 1); + uiItemL(column, "Playback Settings:", 0); + uiItemR(column, NULL, 0, &strip_ptr, "muted", 0, 0, 0); + uiItemR(column, NULL, 0, &strip_ptr, "reversed", 0, 0, 0); +} + - //MEM_freeN(ale); +/* action-clip only settings for active NLA-Strip */ +static void nla_panel_actclip(const bContext *C, Panel *pa) +{ + PointerRNA strip_ptr; + uiLayout *layout= pa->layout; + uiLayout *column, *row; + uiBlock *block; + + /* check context and also validity of pointer */ + if (!nla_panel_context(C, NULL, &strip_ptr)) + return; + if (strip_ptr.data == NULL) + return; + + // XXX FIXME: move this check into a poll callback + if (RNA_enum_get(&strip_ptr, "type") != NLASTRIP_TYPE_CLIP) + return; + + block= uiLayoutGetBlock(layout); + uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); + + /* Strip Properties ------------------------------------- */ + /* action pointer */ + row= uiLayoutRow(layout, 1); + uiItemR(row, NULL, ICON_ACTION, &strip_ptr, "action", 0, 0, 0); + + /* action extents */ + // XXX custom names were used here... probably not necessary in future? + column= uiLayoutColumn(layout, 1); + uiItemL(column, "Action Extents:", 0); + uiItemR(column, "Start Frame", 0, &strip_ptr, "action_start_frame", 0, 0, 0); + uiItemR(column, "End Frame", 0, &strip_ptr, "action_end_frame", 0, 0, 0); + + /* action usage */ + column= uiLayoutColumn(layout, 1); + uiItemL(column, "Playback Settings:", 0); + uiItemR(column, NULL, 0, &strip_ptr, "scale", 0, 0, 0); + uiItemR(column, NULL, 0, &strip_ptr, "repeat", 0, 0, 0); } +/* evaluation settings for active NLA-Strip */ +static void nla_panel_evaluation(const bContext *C, Panel *pa) +{ + PointerRNA strip_ptr; + uiLayout *layout= pa->layout; + //uiLayout *column, *row, *subcol; + uiBlock *block; + + /* check context and also validity of pointer */ + if (!nla_panel_context(C, NULL, &strip_ptr)) + return; + if (strip_ptr.data == NULL) + return; + + block= uiLayoutGetBlock(layout); + uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); + + // influence + // strip_time + // animated_influence + // animated_time +} /* ******************* general ******************************** */ @@ -161,13 +297,41 @@ static void nla_panel_properties(const bContext *C, Panel *pa) void nla_buttons_register(ARegionType *art) { PanelType *pt; - + + pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel track"); + strcpy(pt->idname, "NLA_PT_track"); + strcpy(pt->label, "Active Track"); + pt->draw= nla_panel_track; + pt->poll= nla_panel_poll; + BLI_addtail(&art->paneltypes, pt); + pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel properties"); strcpy(pt->idname, "NLA_PT_properties"); - strcpy(pt->label, "Properties"); + strcpy(pt->label, "Active Strip"); pt->draw= nla_panel_properties; pt->poll= nla_panel_poll; BLI_addtail(&art->paneltypes, pt); + + pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel properties"); + strcpy(pt->idname, "NLA_PT_actionclip"); + strcpy(pt->label, "Action Clip"); + pt->draw= nla_panel_actclip; + pt->poll= nla_panel_poll; // XXX need a special one to check for 'action clip' types only + BLI_addtail(&art->paneltypes, pt); + + pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel evaluation"); + strcpy(pt->idname, "NLA_PT_evaluation"); + strcpy(pt->label, "Evaluation"); + pt->draw= nla_panel_evaluation; + pt->poll= nla_panel_poll; + BLI_addtail(&art->paneltypes, pt); + + pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel modifiers"); + strcpy(pt->idname, "NLA_PT_modifiers"); + strcpy(pt->label, "Modifiers"); + //pt->draw= nla_panel_modifiers; + pt->poll= nla_panel_poll; + BLI_addtail(&art->paneltypes, pt); } static int nla_properties(bContext *C, wmOperator *op) -- cgit v1.2.3 From 096e2f0b5ab370fcc01a265ccf77eb71a2f03a43 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 9 Jun 2009 11:26:45 +0000 Subject: NLA SoC: Transform tools for NLA This commit restores transform support for NLA. Grab, scale, 'extend', and tweak (i.e. grab by just click+dragging) are implemented. Notes: - As soon as one end of a strip touches another adjacent strip (within the same track), that end stops moving. This has been done to avoid the situation where overlapping strips within the same track (which is not allowed) might be caused by transforms. - Made some changes to the RNA setters for the strip extents so that the validation above could take place (and other necessary changes on a per-strip basis could also occur). TODO's ? - Strips cannot be transferred from track to track using transforms. I've yet to decide whether this needs to be done, or whether a separate operator will suffice. - What happens to the range of Actions used when the strips change sizes unexpectedly (i.e. the no-overlap condition above)? Currently range stays the same, but this doesn't always seem desirable? --- source/blender/editors/space_nla/nla_ops.c | 4 +- source/blender/editors/transform/transform.c | 3 + source/blender/editors/transform/transform.h | 7 + .../editors/transform/transform_conversions.c | 195 +++++++++++++++++---- .../blender/editors/transform/transform_generics.c | 100 +++++------ source/blender/editors/transform/transform_ops.c | 13 ++ source/blender/makesrna/intern/rna_nla.c | 26 ++- 7 files changed, 251 insertions(+), 97 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index f59cbd9c1d4..6505b1deea3 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -54,6 +54,8 @@ #include "ED_space_api.h" #include "ED_screen.h" +#include "BIF_transform.h" + #include "WM_api.h" #include "WM_types.h" @@ -191,7 +193,7 @@ static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "NLAEDIT_OT_tweakmode_exit", TABKEY, KM_PRESS, 0, 0); /* transform system */ - //transform_keymap_for_space(wm, keymap, SPACE_NLA); + transform_keymap_for_space(wm, keymap, SPACE_NLA); } /* --------------- */ diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 674de81a9f5..fa93d2a143d 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -319,6 +319,9 @@ static void viewRedrawForce(bContext *C, TransInfo *t) else ED_area_tag_redraw(t->sa); } + else if (t->spacetype == SPACE_NLA) { + ED_area_tag_redraw(t->sa); // XXX this should use a notifier instead! + } else if(t->spacetype == SPACE_NODE) { //ED_area_tag_redraw(t->sa); diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index ee767fada58..c0a57a85033 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -161,6 +161,13 @@ typedef struct TransDataSeq { } TransDataSeq; +/* for NLA transform (stored in td->extra pointer) */ +typedef struct TransDataNla { + struct NlaStrip *strip; /* NLA-strip that handle belongs to */ + float val; /* value for the handle that the transform tools write to */ + int handle; /* handle-index, 0 for start, 1 for end */ +} TransDataNla; + typedef struct TransData { float dist; /* Distance needed to affect element (for Proportionnal Editing) */ float rdist; /* Distance to the nearest element (for Proportionnal Editing) */ diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 6c7aa1ee49d..96f62f1e18e 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2559,7 +2559,140 @@ int clipUVTransform(TransInfo *t, float *vec, int resize) return (clipx || clipy); } -/* ********************* ACTION/NLA EDITOR ****************** */ +/* ********************* ANIMATION EDITORS (GENERAL) ************************* */ + +/* This function tests if a point is on the "mouse" side of the cursor/frame-marking */ +static short FrameOnMouseSide(char side, float frame, float cframe) +{ + /* both sides, so it doesn't matter */ + if (side == 'B') return 1; + + /* only on the named side */ + if (side == 'R') + return (frame >= cframe) ? 1 : 0; + else + return (frame <= cframe) ? 1 : 0; +} + +/* ********************* NLA EDITOR ************************* */ + +static void createTransNlaData(bContext *C, TransInfo *t) +{ + Scene *scene= CTX_data_scene(C); + TransData *td = NULL; + TransDataNla *tdn = NULL; + + bAnimContext ac; + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + int count=0; + char side; + + /* determine what type of data we are operating on */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return; + + /* filter data */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* which side of the current frame should be allowed */ + if (t->mode == TFM_TIME_EXTEND) { + /* only side on which mouse is gets transformed */ + float xmouse, ymouse; + + UI_view2d_region_to_view(&ac.ar->v2d, t->imval[0], t->imval[1], &xmouse, &ymouse); + side = (xmouse > CFRA) ? 'R' : 'L'; // XXX use t->frame_side + } + else { + /* normal transform - both sides of current frame are considered */ + side = 'B'; + } + + /* loop 1: count how many strips are selected (consider each strip as 2 points) */ + for (ale= anim_data.first; ale; ale= ale->next) { + /* only if a real NLA-track */ + if (ale->type == ANIMTYPE_NLATRACK) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip; + + /* only consider selected strips */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + // TODO: we can make strips have handles later on... + if (strip->flag & NLASTRIP_FLAG_SELECT) { + if (FrameOnMouseSide(side, strip->start, (float)CFRA)) count++; + if (FrameOnMouseSide(side, strip->end, (float)CFRA)) count++; + } + } + } + } + + /* stop if trying to build list if nothing selected */ + if (count == 0) { + /* cleanup temp list */ + BLI_freelistN(&anim_data); + return; + } + + /* allocate memory for data */ + t->total= count; + + t->data= MEM_callocN(t->total*sizeof(TransData), "TransData(NLA Editor)"); + td= t->data; + t->customData= MEM_callocN(t->total*sizeof(TransDataNla), "TransDataNla (NLA Editor)"); + tdn= t->customData; + + /* loop 2: build transdata array */ + for (ale= anim_data.first; ale; ale= ale->next) { + /* only if a real NLA-track */ + if (ale->type == ANIMTYPE_NLATRACK) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip; + + /* only consider selected strips */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + // TODO: we can make strips have handles later on... + if (strip->flag & NLASTRIP_FLAG_SELECT) { + if (FrameOnMouseSide(side, strip->start, (float)CFRA)) + { + /* init the 'extra' data for NLA strip handles first */ + tdn->strip= strip; + tdn->val= strip->start; + tdn->handle= 0; + + /* now, link the transform data up to this data */ + td->val= &tdn->val; + td->ival= tdn->val; + td->extra= tdn; + td++; + tdn++; + } + if (FrameOnMouseSide(side, strip->end, (float)CFRA)) + { + /* init the 'extra' data for NLA strip handles first */ + tdn->strip= strip; + tdn->val= strip->end; + tdn->handle= 1; + + /* now, link the transform data up to this data */ + td->val= &tdn->val; + td->ival= tdn->val; + td->extra= tdn; + td++; + tdn++; + } + } + } + } + } + + /* cleanup temp list */ + BLI_freelistN(&anim_data); +} + +/* ********************* ACTION EDITOR ****************** */ /* Called by special_aftertrans_update to make sure selected gp-frames replace * any other gp-frames which may reside on that frame (that are not selected). @@ -2744,19 +2877,6 @@ static void posttrans_action_clean (bAnimContext *ac, bAction *act) /* ----------------------------- */ -/* This function tests if a point is on the "mouse" side of the cursor/frame-marking */ -static short FrameOnMouseSide(char side, float frame, float cframe) -{ - /* both sides, so it doesn't matter */ - if (side == 'B') return 1; - - /* only on the named side */ - if (side == 'R') - return (frame >= cframe) ? 1 : 0; - else - return (frame <= cframe) ? 1 : 0; -} - /* fully select selected beztriples, but only include if it's on the right side of cfra */ static int count_fcurve_keys(FCurve *fcu, char side, float cfra) { @@ -3044,8 +3164,6 @@ static void createTransActionData(bContext *C, TransInfo *t) /* ********************* GRAPH EDITOR ************************* */ - - /* Helper function for createTransGraphEditData, which is reponsible for associating * source data with transform data */ @@ -3502,7 +3620,6 @@ void flushTransGraphData(TransInfo *t) } } - /* **************** IpoKey stuff, for Object TransData ********** */ /* while transforming */ @@ -4604,6 +4721,29 @@ void special_aftertrans_update(TransInfo *t) /* make sure all F-Curves are set correctly */ ANIM_editkeyframes_refresh(&ac); } + else if (t->spacetype == SPACE_NLA) { + SpaceNla *snla= (SpaceNla *)t->sa->spacedata.first; + Scene *scene; + bAnimContext ac; + + /* initialise relevant anim-context 'context' data from TransInfo data */ + /* NOTE: sync this with the code in ANIM_animdata_get_context() */ + memset(&ac, 0, sizeof(bAnimContext)); + + scene= ac.scene= t->scene; + ob= ac.obact= OBACT; + ac.sa= t->sa; + ac.ar= t->ar; + ac.spacetype= (t->sa)? t->sa->spacetype : 0; + ac.regiontype= (t->ar)? t->ar->regiontype : 0; + + if (ANIM_animdata_context_getdata(&ac) == 0) + return; + + // XXX check on the calls below... we need some of these sanity checks + //synchronize_action_strips(); + //ANIM_editkeyframes_refresh(&ac); + } else if (t->obedit) { // TRANSFORM_FIX_ME // if (t->mode==TFM_BONESIZE || t->mode==TFM_BONE_ENVELOPE) @@ -4682,24 +4822,6 @@ void special_aftertrans_update(TransInfo *t) } } -#if 0 // TRANSFORM_FIX_ME - else if (t->spacetype == SPACE_NLA) { - recalc_all_ipos(); // bad - synchronize_action_strips(); - - /* cleanup */ - for (base=t->scene->base.first; base; base=base->next) - base->flag &= ~(BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA); - - /* after transform, remove duplicate keyframes on a frame that resulted from transform */ - if ( (G.snla->flag & SNLA_NOTRANSKEYCULL)==0 && - ((cancelled == 0) || (duplicate)) ) - { - posttrans_nla_clean(t); - } - } -#endif - clear_trans_object_base_flags(t); #if 0 // TRANSFORM_FIX_ME @@ -4932,8 +5054,7 @@ void createTransData(bContext *C, TransInfo *t) } else if (t->spacetype == SPACE_NLA) { t->flag |= T_POINTS|T_2D_EDIT; - // TRANSFORM_FIX_ME - //createTransNlaData(C, t); + createTransNlaData(C, t); } else if (t->spacetype == SPACE_SEQ) { t->flag |= T_POINTS|T_2D_EDIT; diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 171665c9282..4c9592fb27a 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -102,6 +102,8 @@ #include "BLI_editVert.h" #include "BLI_rand.h" +#include "RNA_access.h" + #include "WM_types.h" #include "UI_resources.h" @@ -299,61 +301,6 @@ void recalcData(TransInfo *t) DAG_object_flush_update(G.scene, OBACT, OB_RECALC_OB|OB_RECALC_DATA); } } - } - else if (t->spacetype == SPACE_NLA) { - if (G.snla->lock) { - for (base=G.scene->base.first; base; base=base->next) { - if (base->flag & BA_HAS_RECALC_OB) - base->object->recalc |= OB_RECALC_OB; - if (base->flag & BA_HAS_RECALC_DATA) - base->object->recalc |= OB_RECALC_DATA; - - if (base->object->recalc) - base->object->ctime= -1234567.0f; // eveil! - - /* recalculate scale of selected nla-strips */ - if (base->object->nlastrips.first) { - Object *bob= base->object; - bActionStrip *strip; - - for (strip= bob->nlastrips.first; strip; strip= strip->next) { - if (strip->flag & ACTSTRIP_SELECT) { - float actlen= strip->actend - strip->actstart; - float len= strip->end - strip->start; - - strip->scale= len / (actlen * strip->repeat); - } - } - } - } - - DAG_scene_flush_update(G.scene, screen_view3d_layers(), 0); - } - else { - for (base=G.scene->base.first; base; base=base->next) { - /* recalculate scale of selected nla-strips */ - if (base->object && base->object->nlastrips.first) { - Object *bob= base->object; - bActionStrip *strip; - - for (strip= bob->nlastrips.first; strip; strip= strip->next) { - if (strip->flag & ACTSTRIP_SELECT) { - float actlen= strip->actend - strip->actstart; - float len= strip->end - strip->start; - - /* prevent 'negative' scaling */ - if (len < 0) { - SWAP(float, strip->start, strip->end); - len= fabs(len); - } - - /* calculate new scale */ - strip->scale= len / (actlen * strip->repeat); - } - } - } - } - } } #endif if (t->obedit) { @@ -422,6 +369,47 @@ void recalcData(TransInfo *t) } } + else if (t->spacetype == SPACE_NLA) { + TransData *td= t->data; + int i; + + /* for each point we've captured, look at its 'extra' data, which is basically a wrapper around the strip + * it is for + some extra storage for the values that get set, and use RNA to set this value (performing validation + * work so that we don't need to repeat it here) + */ + for (i = 0; i < t->total; i++, td++) + { + if (td->extra) + { + TransDataNla *tdn= td->extra; + NlaStrip *strip= tdn->strip; + + /* if we're just cancelling (i.e. the user aborted the transform), + * just restore the data by directly overwriting the values with the original + * ones (i.e. don't go through RNA), as we get some artifacts... + */ + if (t->state == TRANS_CANCEL) { + /* write the value set by the transform tools to the appropriate property using RNA */ + if (tdn->handle) + strip->end= tdn->val; + else + strip->start= tdn->val; + } + else { + PointerRNA strip_ptr; + + /* make RNA-pointer */ + RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &strip_ptr); + + /* write the value set by the transform tools to the appropriate property using RNA */ + if (tdn->handle) + RNA_float_set(&strip_ptr, "end_frame", tdn->val); + else + RNA_float_set(&strip_ptr, "start_frame", tdn->val); + } + } + } + } else if (t->obedit) { if ELEM(t->obedit->type, OB_CURVE, OB_SURF) { Curve *cu= t->obedit->data; @@ -866,7 +854,7 @@ void postTrans (TransInfo *t) if(sima->flag & SI_LIVE_UNWRAP) ED_uvedit_live_unwrap_end(t->state == TRANS_CANCEL); } - else if(t->spacetype==SPACE_ACTION) { + else if(ELEM(t->spacetype, SPACE_ACTION, SPACE_NLA)) { if (t->customData) MEM_freeN(t->customData); } diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 769001b30a8..f7ddd18452e 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -607,6 +607,19 @@ void transform_keymap_for_space(struct wmWindowManager *wm, struct ListBase *key km = WM_keymap_add_item(keymap, "TFM_OT_resize", SKEY, KM_PRESS, 0, 0); break; + case SPACE_NLA: + km= WM_keymap_add_item(keymap, "TFM_OT_transform", GKEY, KM_PRESS, 0, 0); + RNA_int_set(km->ptr, "mode", TFM_TIME_TRANSLATE); + + km= WM_keymap_add_item(keymap, "TFM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0); + RNA_int_set(km->ptr, "mode", TFM_TIME_TRANSLATE); + + km= WM_keymap_add_item(keymap, "TFM_OT_transform", EKEY, KM_PRESS, 0, 0); + RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND); + + km= WM_keymap_add_item(keymap, "TFM_OT_transform", SKEY, KM_PRESS, 0, 0); + RNA_int_set(km->ptr, "mode", TFM_TIME_SCALE); + break; case SPACE_NODE: km= WM_keymap_add_item(keymap, "TFM_OT_translation", GKEY, KM_PRESS, 0, 0); diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 0a7d17adc09..b55b4e431fb 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -43,7 +43,18 @@ static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) { NlaStrip *data= (NlaStrip*)ptr->data; - CLAMP(value, 1, data->end); + + /* clamp value to lie within valid limits + * - cannot start past the end of the strip + some flexibility threshold + * - cannot start before the previous strip (if present) ends + * - minimum frame is 1.0f (this can be changed) + */ + if (data->prev) { + CLAMP(value, data->prev->end, data->end-0.1f); + } + else { + CLAMP(value, 1, data->end); + } data->start= value; } @@ -52,8 +63,17 @@ static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value) NlaStrip *data= (NlaStrip*)ptr->data; float len, actlen; - /* clamp value to lie within valid limits - must not have zero or negative length strip */ - CLAMP(value, data->start+0.1f, MAXFRAME); + /* clamp value to lie within valid limits + * - must not have zero or negative length strip, so cannot start before the first frame + * + some minimum-strip-length threshold + * - cannot end later than the start of the next strip (if present) + */ + if (data->next) { + CLAMP(value, data->start+0.1f, data->next->start); + } + else { + CLAMP(value, data->start+0.1f, MAXFRAME); + } data->end= value; /* calculate the lengths the strip and its action (if applicable) */ -- cgit v1.2.3 From e4b427bb595f15956f72b53961586504464fdb8a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 9 Jun 2009 12:18:20 +0000 Subject: [#18847] Material.c Python API calls Adds access to... - Anisotropy - Mirr Threshold - Trans Threshold Breaks rule of no additions but python data access is quite safe, vray exporter needed these attributes. [#18891] BGE Convert script Python 2.5 compatible --- source/blender/python/api2_2x/Material.c | 60 +++++++++++++++++++++++++++ source/blender/python/api2_2x/doc/Material.py | 9 ++++ 2 files changed, 69 insertions(+) (limited to 'source') diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c index ad4296d19d8..50a1be3fa97 100644 --- a/source/blender/python/api2_2x/Material.c +++ b/source/blender/python/api2_2x/Material.c @@ -139,6 +139,12 @@ #define EXPP_MAT_RAYTRANSPGLOSS_MAX 1.0 #define EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MIN 0 #define EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MAX 1024 +#define EXPP_MAT_ANISO_GLOSS_MIR_MIN 0.0 +#define EXPP_MAT_ANISO_GLOSS_MIR_MAX 1.0 +#define EXPP_MAT_ADAPT_THRESH_MIR_MIN 0.0 +#define EXPP_MAT_ADAPT_THRESH_MIR_MAX 1.0 +#define EXPP_MAT_ADAPT_THRESH_TRA_MIN 0.0 +#define EXPP_MAT_ADAPT_THRESH_TRA_MAX 1.0 #define EXPP_MAT_FILTER_MIN 0.0 #define EXPP_MAT_FILTER_MAX 1.0 #define EXPP_MAT_TRANSLUCENCY_MIN 0.0 @@ -598,6 +604,9 @@ static int Material_setGlossMirr( BPy_Material * self, PyObject * value ); static int Material_setGlossMirrSamples( BPy_Material * self, PyObject * value ); static int Material_setGlossTrans( BPy_Material * self, PyObject * value ); static int Material_setGlossTransSamples( BPy_Material * self, PyObject * value ); +static int Material_setAniso( BPy_Material * self, PyObject * value ); +static int Material_setThreshMirr( BPy_Material * self, PyObject * value ); +static int Material_setThreshTrans( BPy_Material * self, PyObject * value ); static int Material_setRigidBodyFriction( BPy_Material * self, PyObject * value ); static int Material_setRigidBodyRestitution( BPy_Material * self, PyObject * value ); @@ -689,6 +698,9 @@ static PyObject *Material_getGlossMirr( BPy_Material * self ); static PyObject *Material_getGlossMirrSamples( BPy_Material * self ); static PyObject *Material_getGlossTrans( BPy_Material * self ); static PyObject *Material_getGlossTransSamples( BPy_Material * self ); +static PyObject *Material_getAniso( BPy_Material * self ); +static PyObject *Material_getThreshMirr( BPy_Material * self ); +static PyObject *Material_getThreshTrans( BPy_Material * self ); static PyObject *Material_getRigidBodyFriction( BPy_Material * self ); static PyObject *Material_getRigidBodyRestitution( BPy_Material * self ); @@ -1169,6 +1181,18 @@ static PyGetSetDef BPy_Material_getseters[] = { (getter)Material_getGlossMirrSamples, (setter)Material_setGlossMirrSamples, "Refraction glossiness", NULL}, + {"anisotropy", + (getter)Material_getAniso, (setter)Material_setAniso, + "Anisotropy", + NULL}, + {"threshMir", + (getter)Material_getThreshMirr, (setter)Material_setThreshMirr, + "Reflections threshold", + NULL}, + {"threshTra", + (getter)Material_getThreshTrans, (setter)Material_setThreshTrans, + "Refractions threshold", + NULL}, {"rgbCol", (getter)Material_getRGBCol, (setter)Material_setRGBCol, "Diffuse RGB color triplet", @@ -1804,6 +1828,21 @@ static PyObject *Material_getGlossTransSamples( BPy_Material * self ) return PyInt_FromLong( ( long ) self->material->samp_gloss_tra ); } +static PyObject *Material_getAniso( BPy_Material * self ) +{ + return PyFloat_FromDouble( ( double ) self->material->aniso_gloss_mir ); +} + +static PyObject *Material_getThreshMirr( BPy_Material * self ) +{ + return PyFloat_FromDouble( ( double ) self->material->adapt_thresh_mir ); +} + +static PyObject *Material_getThreshTrans( BPy_Material * self ) +{ + return PyFloat_FromDouble( ( double ) self->material->adapt_thresh_tra ); +} + static PyObject* Material_getRigidBodyFriction( BPy_Material * self ) { return PyFloat_FromDouble( ( double ) self->material->friction ); @@ -2379,6 +2418,27 @@ static int Material_setGlossTransSamples( BPy_Material * self, PyObject * value EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MAX, 'h' ); } +static int Material_setAniso( BPy_Material * self, PyObject * value ) +{ + return EXPP_setFloatClamped ( value, &self->material->aniso_gloss_mir, + EXPP_MAT_ANISO_GLOSS_MIR_MIN, + EXPP_MAT_ANISO_GLOSS_MIR_MAX ); +} + +static int Material_setThreshMirr( BPy_Material * self, PyObject * value ) +{ + return EXPP_setFloatClamped ( value, &self->material->adapt_thresh_mir, + EXPP_MAT_ADAPT_THRESH_MIR_MIN, + EXPP_MAT_ADAPT_THRESH_MIR_MAX ); +} + +static int Material_setThreshTrans( BPy_Material * self, PyObject * value ) +{ + return EXPP_setFloatClamped ( value, &self->material->adapt_thresh_tra, + EXPP_MAT_ADAPT_THRESH_TRA_MIN, + EXPP_MAT_ADAPT_THRESH_TRA_MAX ); +} + static int Material_setRigidBodyFriction( BPy_Material * self, PyObject * value ) { return EXPP_setFloatClamped ( value, &self->material->friction, diff --git a/source/blender/python/api2_2x/doc/Material.py b/source/blender/python/api2_2x/doc/Material.py index 3b8148b3f11..59ff4bc8503 100644 --- a/source/blender/python/api2_2x/doc/Material.py +++ b/source/blender/python/api2_2x/doc/Material.py @@ -285,6 +285,15 @@ class Material: @ivar sampGlossTra: Refraction glossy samples. Value is clamped to the range [1,1024]. @type sampGlossTra: int + @ivar anisotropy: The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent). + Value is clamped to the range [0.0,1.0]. + @type anisotropy: float + @ivar threshMir: Threshold below which reflections will not be computed. + Value is clamped to the range [0.0,1.0]. + @type threshMir: float + @ivar threshTra: threshold below which refractions will not be computed. + Value is clamped to the range [0.0,1.0]. + @type threshTra: float @ivar rayMirrDepth: Amount of raytrace inter-reflections. Value is clamped to the range [0,10]. @type rayMirrDepth: int -- cgit v1.2.3 From ca5ff43b1f3efa555b1e52d190c5a97332e01e85 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 9 Jun 2009 12:28:10 +0000 Subject: NLA SoC: Improved anim-channel filtering flags for NLA so that channels don't need to be checked to be NLA-Tracks before being used. --- source/blender/editors/animation/anim_filter.c | 16 +++++++-------- source/blender/editors/include/ED_anim_api.h | 3 ++- source/blender/editors/space_nla/nla_select.c | 4 ++-- .../editors/transform/transform_conversions.c | 23 ++++++++++------------ 4 files changed, 22 insertions(+), 24 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index cdda13d999d..6cb24a01711 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1050,7 +1050,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B int items = 0; /* add this object as a channel first */ - if ((filter_mode & ANIMFILTER_CURVESONLY) == 0) { + if ((filter_mode & (ANIMFILTER_CURVESONLY|ANIMFILTER_NLATRACKS)) == 0) { /* check if filtering by selection */ if ANIMCHANNEL_SELOK((base->flag & SELECT)) { ale= make_new_animlistelem(base, ANIMTYPE_OBJECT, NULL, ANIMTYPE_NONE, NULL); @@ -1062,7 +1062,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B } /* if collapsed, don't go any further (unless adding keyframes only) */ - if ( (EXPANDED_OBJC(ob) == 0) && !(filter_mode & ANIMFILTER_CURVESONLY) ) + if ( (EXPANDED_OBJC(ob) == 0) && !(filter_mode & (ANIMFILTER_CURVESONLY|ANIMFILTER_NLATRACKS)) ) return items; /* Action, Drivers, or NLA */ @@ -1073,7 +1073,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B { /* nla */ #if 0 /* include nla-expand widget? */ - if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { + if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_NLATRACKS)) { ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLNLA, base, ANIMTYPE_OBJECT, (ID *)ob); if (ale) { BLI_addtail(anim_data, ale); @@ -1129,7 +1129,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B { /* nla */ #if 0 /* include nla-expand widget? */ - if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { + if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_NLATRACKS)) { ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLNLA, base, ANIMTYPE_OBJECT, (ID *)ob); if (ale) { BLI_addtail(anim_data, ale); @@ -1235,7 +1235,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads int items = 0; /* add scene as a channel first (even if we aren't showing scenes we still need to show the scene's sub-data */ - if ((filter_mode & ANIMFILTER_CURVESONLY) == 0) { + if ((filter_mode & (ANIMFILTER_CURVESONLY|ANIMFILTER_NLATRACKS)) == 0) { /* check if filtering by selection */ if (ANIMCHANNEL_SELOK( (sce->flag & SCE_DS_SELECTED) )) { ale= make_new_animlistelem(sce, ANIMTYPE_SCENE, NULL, ANIMTYPE_NONE, NULL); @@ -1247,7 +1247,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads } /* if collapsed, don't go any further (unless adding keyframes only) */ - if ( (EXPANDED_SCEC(sce) == 0) && !(filter_mode & ANIMFILTER_CURVESONLY) ) + if ( (EXPANDED_SCEC(sce) == 0) && !(filter_mode & (ANIMFILTER_CURVESONLY|ANIMFILTER_NLATRACKS)) ) return items; /* Action, Drivers, or NLA for Scene */ @@ -1258,7 +1258,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads { /* nla */ #if 0 /* include nla-expand widget? */ - if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { + if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_NLATRACKS)) { ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLNLA, base, ANIMTYPE_SCENE (ID *)sce); if (ale) { BLI_addtail(anim_data, ale); @@ -1312,7 +1312,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads { /* nla */ #if 0 /* include nla-expand widget? */ - if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { + if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_NLATRACKS)) { ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLNLA, base, ANIMTYPE_DSWOR (ID *)wo); if (ale) { BLI_addtail(anim_data, ale); diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index dcaabb4b369..e44c7ff5603 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -162,8 +162,9 @@ typedef enum eAnimFilter_Flags { ANIMFILTER_CHANNELS = (1<<5), /* make list for interface drawing */ ANIMFILTER_ACTGROUPED = (1<<6), /* belongs to the active actiongroup */ ANIMFILTER_CURVEVISIBLE = (1<<7), /* F-Curve is visible for editing/viewing in Graph Editor */ - ANIMFILTER_ACTIVE = (1<<8), /* channel should be 'active' */ // FIXME: this is only relevant for F-Curves for now + ANIMFILTER_ACTIVE = (1<<8), /* channel should be 'active' */ ANIMFILTER_ANIMDATA = (1<<9), /* only return the underlying AnimData blocks (not the tracks, etc.) data comes from */ + ANIMFILTER_NLATRACKS = (1<<10), /* only include NLA-tracks */ } eAnimFilter_Flags; diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 463479c0909..730814dc562 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -120,8 +120,8 @@ static void deselect_nla_strips (bAnimContext *ac, short test, short sel) int filter; short smode; - /* determine type-based settings - curvesonly eliminates all the unnecessary channels... */ - filter= (ANIMFILTER_VISIBLE|ANIMFILTER_CURVESONLY); + /* determine type-based settings */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS); /* filter data */ ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 96f62f1e18e..fb7d9c57eaf 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2595,7 +2595,7 @@ static void createTransNlaData(bContext *C, TransInfo *t) return; /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); /* which side of the current frame should be allowed */ @@ -2613,18 +2613,15 @@ static void createTransNlaData(bContext *C, TransInfo *t) /* loop 1: count how many strips are selected (consider each strip as 2 points) */ for (ale= anim_data.first; ale; ale= ale->next) { - /* only if a real NLA-track */ - if (ale->type == ANIMTYPE_NLATRACK) { - NlaTrack *nlt= (NlaTrack *)ale->data; - NlaStrip *strip; - - /* only consider selected strips */ - for (strip= nlt->strips.first; strip; strip= strip->next) { - // TODO: we can make strips have handles later on... - if (strip->flag & NLASTRIP_FLAG_SELECT) { - if (FrameOnMouseSide(side, strip->start, (float)CFRA)) count++; - if (FrameOnMouseSide(side, strip->end, (float)CFRA)) count++; - } + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip; + + /* only consider selected strips */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + // TODO: we can make strips have handles later on... + if (strip->flag & NLASTRIP_FLAG_SELECT) { + if (FrameOnMouseSide(side, strip->start, (float)CFRA)) count++; + if (FrameOnMouseSide(side, strip->end, (float)CFRA)) count++; } } } -- cgit v1.2.3 From abdb8fd94d90a1b9fb262c94dac1ccb52cfee36f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 9 Jun 2009 12:28:49 +0000 Subject: NLA SoC: Added simple delete-strips operator (XKEY/DELKEY) --- source/blender/editors/space_nla/nla_edit.c | 63 ++++++++++++++++++++++++++- source/blender/editors/space_nla/nla_intern.h | 5 +++ source/blender/editors/space_nla/nla_ops.c | 6 +++ 3 files changed, 73 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 49d43f29c5f..ce62d36e667 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -68,7 +68,7 @@ #include "nla_intern.h" // own include /* *********************************************** */ -/* General Editing */ +/* 'Special' Editing */ /* ******************** Tweak-Mode Operators ***************************** */ /* 'Tweak mode' allows the action referenced by the active NLA-strip to be edited @@ -211,5 +211,66 @@ void NLAEDIT_OT_tweakmode_exit (wmOperatorType *ot) } /* *********************************************** */ +/* NLA Editing Operations */ + +/* ******************** Delete Operator ***************************** */ +/* Deletes the selected NLA-Strips */ + +static int nlaedit_delete_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the AnimData blocks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* for each NLA-Track, delete all selected strips */ + // FIXME: need to double-check that we've got tracks + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip, *nstrip; + + for (strip= nlt->strips.first; strip; strip= nstrip) { + nstrip= strip->next; + + /* if selected, delete */ + if (strip->flag & NLASTRIP_FLAG_SELECT) + free_nlastrip(&nlt->strips, strip); + } + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done */ + return OPERATOR_FINISHED; +} + +void NLAEDIT_OT_delete (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Delete Strips"; + ot->idname= "NLAEDIT_OT_delete"; + ot->description= "Delete selected strips."; + + /* api callbacks */ + ot->exec= nlaedit_delete_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} /* *********************************************** */ diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 00de0498e4b..abbb7331e28 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -89,6 +89,11 @@ void NLAEDIT_OT_click_select(wmOperatorType *ot); void NLAEDIT_OT_tweakmode_enter(wmOperatorType *ot); void NLAEDIT_OT_tweakmode_exit(wmOperatorType *ot); +/* --- */ + +void NLAEDIT_OT_delete(wmOperatorType *ot); + + /* **************************************** */ /* nla_channels.c */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 6505b1deea3..3eb32d147f5 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -131,6 +131,8 @@ void nla_operatortypes(void) /* edit */ WM_operatortype_append(NLAEDIT_OT_tweakmode_enter); WM_operatortype_append(NLAEDIT_OT_tweakmode_exit); + + WM_operatortype_append(NLAEDIT_OT_delete); } /* ************************** registration - keymaps **********************************/ @@ -191,6 +193,10 @@ static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) */ WM_keymap_add_item(keymap, "NLAEDIT_OT_tweakmode_enter", TABKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "NLAEDIT_OT_tweakmode_exit", TABKEY, KM_PRESS, 0, 0); + + /* delete */ + WM_keymap_add_item(keymap, "NLAEDIT_OT_delete", XKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "NLAEDIT_OT_delete", DELKEY, KM_PRESS, 0, 0); /* transform system */ transform_keymap_for_space(wm, keymap, SPACE_NLA); -- cgit v1.2.3 From 20eaa1466dbb530e583699e189c9f8b8597b7eb4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 9 Jun 2009 13:03:00 +0000 Subject: Fix for bug #18881 and #18866: Surface option for Fields crashed on non-mesh objects, so hide it if not applicable. Also made it support surf, curve, font objects. --- source/blender/blenkernel/BKE_displist.h | 2 +- source/blender/blenkernel/intern/displist.c | 10 +- source/blender/blenkernel/intern/modifier.c | 135 +++++++++++---------- .../blender/render/intern/source/convertblender.c | 2 +- source/blender/src/buttons_object.c | 20 +-- 5 files changed, 89 insertions(+), 80 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h index a534dcc3669..9108846330c 100644 --- a/source/blender/blenkernel/BKE_displist.h +++ b/source/blender/blenkernel/BKE_displist.h @@ -86,7 +86,7 @@ extern void count_displist(struct ListBase *lb, int *totvert, int *totface); extern void freedisplist(struct ListBase *lb); extern int displist_has_faces(struct ListBase *lb); extern void makeDerivedMesh(struct Object *ob, CustomDataMask dataMask); -extern void makeDispListSurf(struct Object *ob, struct ListBase *dispbase, int forRender); +extern void makeDispListSurf(struct Object *ob, struct ListBase *dispbase, int forRender, int forOrco); extern void makeDispListCurveTypes(struct Object *ob, int forOrco); extern void makeDispListMBall(struct Object *ob); extern void shadeDispList(struct Base *base); diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 91eea56c9e7..afc769b0966 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1356,7 +1356,7 @@ static void displist_surf_indices(DispList *dl) } -void makeDispListSurf(Object *ob, ListBase *dispbase, int forRender) +void makeDispListSurf(Object *ob, ListBase *dispbase, int forRender, int forOrco) { ListBase *nubase; Nurb *nu; @@ -1375,7 +1375,8 @@ void makeDispListSurf(Object *ob, ListBase *dispbase, int forRender) nubase= &cu->nurb; } - curve_calc_modifiers_pre(ob, nubase, forRender, &originalVerts, &deformedVerts, &numVerts); + if(!forOrco) + curve_calc_modifiers_pre(ob, nubase, forRender, &originalVerts, &deformedVerts, &numVerts); for (nu=nubase->first; nu; nu=nu->next) { if(forRender || nu->hide==0) { @@ -1429,7 +1430,8 @@ void makeDispListSurf(Object *ob, ListBase *dispbase, int forRender) tex_space_curve(cu); } - curve_calc_modifiers_post(ob, nubase, dispbase, forRender, originalVerts, deformedVerts); + if(!forOrco) + curve_calc_modifiers_post(ob, nubase, dispbase, forRender, originalVerts, deformedVerts); } void makeDispListCurveTypes(Object *ob, int forOrco) @@ -1445,7 +1447,7 @@ void makeDispListCurveTypes(Object *ob, int forOrco) freedisplist(dispbase); if(ob->type==OB_SURF) { - makeDispListSurf(ob, dispbase, 0); + makeDispListSurf(ob, dispbase, 0, forOrco); } else if ELEM(ob->type, OB_CURVE, OB_FONT) { ListBase dlbev; diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index c9f6bc18abd..2c4528f641e 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -114,6 +114,72 @@ #include "RE_shader_ext.h" +/* Utility */ + +static int is_last_displist(Object *ob) +{ + Curve *cu = ob->data; + static int curvecount=0, totcurve=0; + + if(curvecount == 0){ + DispList *dl; + + totcurve = 0; + for(dl=cu->disp.first; dl; dl=dl->next) + totcurve++; + } + + curvecount++; + + if(curvecount == totcurve){ + curvecount = 0; + return 1; + } + + return 0; +} + +static DerivedMesh *get_original_dm(Object *ob, float (*vertexCos)[3], int orco) +{ + DerivedMesh *dm= NULL; + + if(ob->type==OB_MESH) { + dm = CDDM_from_mesh((Mesh*)(ob->data), ob); + + if(vertexCos) { + CDDM_apply_vert_coords(dm, vertexCos); + //CDDM_calc_normals(dm); + } + + if(orco) + DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, get_mesh_orco_verts(ob)); + } + else if(ELEM3(ob->type,OB_FONT,OB_CURVE,OB_SURF)) { + Object *tmpobj; + Curve *tmpcu; + + if(is_last_displist(ob)) { + /* copies object and modifiers (but not the data) */ + tmpobj= copy_object(ob); + tmpcu = (Curve *)tmpobj->data; + tmpcu->id.us--; + + /* copies the data */ + tmpobj->data = copy_curve((Curve *) ob->data); + + makeDispListCurveTypes(tmpobj, 1); + nurbs_to_mesh(tmpobj); + + dm = CDDM_from_mesh((Mesh*)(tmpobj->data), tmpobj); + //CDDM_calc_normals(dm); + + free_libblock_us(&G.main->object, tmpobj); + } + } + + return dm; +} + /***/ static int noneModifier_isDisabled(ModifierData *md) @@ -6037,7 +6103,8 @@ static void surfaceModifier_freeData(ModifierData *md) MEM_freeN(surmd->bvhtree); } - surmd->dm->release(surmd->dm); + if(surmd->dm) + surmd->dm->release(surmd->dm); surmd->bvhtree = NULL; surmd->dm = NULL; @@ -6061,7 +6128,7 @@ static void surfaceModifier_deformVerts( /* if possible use/create DerivedMesh */ if(derivedData) surmd->dm = CDDM_copy(derivedData); - else if(ob->type==OB_MESH) surmd->dm = CDDM_from_mesh(ob->data, ob); + else surmd->dm = get_original_dm(ob, NULL, 0); if(!ob->pd) { @@ -6233,70 +6300,6 @@ CustomDataMask particleSystemModifier_requiredDataMask(ModifierData *md) return dataMask; } -static int is_last_displist(Object *ob) -{ - Curve *cu = ob->data; - static int curvecount=0, totcurve=0; - - if(curvecount==0){ - DispList *dl; - - totcurve=0; - for(dl=cu->disp.first; dl; dl=dl->next){ - totcurve++; - } - } - - curvecount++; - - if(curvecount==totcurve){ - curvecount=0; - return 1; - } - - return 0; -} - -static DerivedMesh *get_original_dm(Object *ob, float (*vertexCos)[3], int orco) -{ - DerivedMesh *dm= NULL; - - if(ob->type==OB_MESH) { - dm = CDDM_from_mesh((Mesh*)(ob->data), ob); - - if(vertexCos) { - CDDM_apply_vert_coords(dm, vertexCos); - //CDDM_calc_normals(dm); - } - - if(orco) - DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, get_mesh_orco_verts(ob)); - } - else if(ELEM3(ob->type,OB_FONT,OB_CURVE,OB_SURF)) { - Object *tmpobj; - Curve *tmpcu; - - if(is_last_displist(ob)) { - /* copies object and modifiers (but not the data) */ - tmpobj= copy_object(ob); - tmpcu = (Curve *)tmpobj->data; - tmpcu->id.us--; - - /* copies the data */ - tmpobj->data = copy_curve((Curve *) ob->data); - - makeDispListCurveTypes(tmpobj, 1); - nurbs_to_mesh(tmpobj); - - dm = CDDM_from_mesh((Mesh*)(tmpobj->data), tmpobj); - //CDDM_calc_normals(dm); - - free_libblock_us(&G.main->object, tmpobj); - } - } - - return dm; -} /* saves the current emitter state for a particle system and calculates particles */ static void particleSystemModifier_deformVerts( diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 79ab661e578..6f07d44d1fb 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -2562,7 +2562,7 @@ static void init_render_surf(Render *re, ObjectRen *obr) if(need_orco) orcobase= orco= get_object_orco(re, ob); displist.first= displist.last= 0; - makeDispListSurf(ob, &displist, 1); + makeDispListSurf(ob, &displist, 1, 0); dl= displist.first; /* walk along displaylist and create rendervertices/-faces */ diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index 8bf62836888..36517982d9c 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -3395,12 +3395,14 @@ static void object_surface__enabletoggle ( void *ob_v, void *arg2 ) if(pd && (pd->flag & PFIELD_SURFACE) && ELEM5(pd->forcefield,PFIELD_HARMONIC,PFIELD_FORCE,PFIELD_HARMONIC,PFIELD_CHARGE,PFIELD_LENNARDJ)) { - md = modifier_new ( eModifierType_Surface ); - BLI_addtail ( &ob->modifiers, md ); - DAG_scene_sort(G.scene); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); + if(ELEM4(ob->type, OB_MESH, OB_SURF, OB_FONT, OB_CURVE)) { + md = modifier_new ( eModifierType_Surface ); + BLI_addtail ( &ob->modifiers, md ); + DAG_scene_sort(G.scene); + DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); + allqueue(REDRAWBUTSEDIT, 0); + allqueue(REDRAWVIEW3D, 0); + } } } else if(!pd || !(pd->flag & PFIELD_SURFACE) @@ -3556,8 +3558,10 @@ static void object_panel_fields(Object *ob) } if(particles==0 && ELEM5(pd->forcefield,PFIELD_HARMONIC,PFIELD_FORCE,PFIELD_HARMONIC,PFIELD_CHARGE,PFIELD_LENNARDJ)) { - but = uiDefButBitS(block, TOG, PFIELD_SURFACE, B_FIELD_CHANGE, "Surface", 10,15,140,20, &pd->flag, 0.0, 0, 0, 0, "Use closest point on surface"); - uiButSetFunc(but, object_surface__enabletoggle, ob, NULL); + if(ELEM4(ob->type, OB_MESH, OB_SURF, OB_FONT, OB_CURVE)) { + but = uiDefButBitS(block, TOG, PFIELD_SURFACE, B_FIELD_CHANGE, "Surface", 10,15,140,20, &pd->flag, 0.0, 0, 0, 0, "Use closest point on surface"); + uiButSetFunc(but, object_surface__enabletoggle, ob, NULL); + } } uiBlockEndAlign(block); -- cgit v1.2.3 From e29c9bc4da59a8e8db933e1a53a181e396f4706b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 9 Jun 2009 13:51:32 +0000 Subject: Fix for bug #18900: game engine lights in non-glsl mode did move anymore, missing matrix update. Also move some code to KX_LightObject to avoid duplication with player. --- .../BlenderRoutines/KX_BlenderRenderTools.cpp | 88 ++------------------ .../GamePlayer/common/GPC_RenderTools.cpp | 88 ++------------------ source/gameengine/Ketsji/KX_Light.cpp | 97 +++++++++++++++++++++- source/gameengine/Ketsji/KX_Light.h | 5 +- source/gameengine/Rasterizer/RAS_LightObject.h | 4 +- 5 files changed, 111 insertions(+), 171 deletions(-) (limited to 'source') diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp index 17d1bf65ca4..ffff7185fe4 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp @@ -28,8 +28,6 @@ #include "GL/glew.h" -#include "DNA_scene_types.h" - #include "RAS_IRenderTools.h" #include "RAS_IRasterizer.h" #include "RAS_LightObject.h" @@ -41,6 +39,7 @@ #include "KX_BlenderMaterial.h" #include "KX_RayCast.h" #include "KX_IPhysicsController.h" +#include "KX_Light.h" #include "PHY_IPhysicsEnvironment.h" @@ -330,21 +329,12 @@ int KX_BlenderRenderTools::applyLights(int objectlayer, const MT_Transform& view { // taken from blender source, incompatibility between Blender Object / GameObject KX_Scene* kxscene = (KX_Scene*)m_auxilaryClientInfo; - int scenelayer = ~0; float glviewmat[16]; unsigned int count; - float vec[4]; - - vec[3]= 1.0; + std::vector::iterator lit = m_lights.begin(); - if(kxscene && kxscene->GetBlenderScene()) - scenelayer = kxscene->GetBlenderScene()->lay; - for(count=0; count m_lights; - std::vector::iterator lit = m_lights.begin(); viewmat.getValue(glviewmat); @@ -353,82 +343,14 @@ int KX_BlenderRenderTools::applyLights(int objectlayer, const MT_Transform& view for (lit = m_lights.begin(), count = 0; !(lit==m_lights.end()) && count < m_numgllights; ++lit) { RAS_LightObject* lightdata = (*lit); - KX_Scene* lightscene = (KX_Scene*)lightdata->m_scene; - - /* only use lights in the same layer as the object */ - if(!(lightdata->m_layer & objectlayer)) - continue; - /* only use lights in the same scene, and in a visible layer */ - if(kxscene != lightscene || !(lightdata->m_layer & scenelayer)) - continue; - - vec[0] = (*(lightdata->m_worldmatrix))(0,3); - vec[1] = (*(lightdata->m_worldmatrix))(1,3); - vec[2] = (*(lightdata->m_worldmatrix))(2,3); - vec[3] = 1; - - if(lightdata->m_type==RAS_LightObject::LIGHT_SUN) { - - vec[0] = (*(lightdata->m_worldmatrix))(0,2); - vec[1] = (*(lightdata->m_worldmatrix))(1,2); - vec[2] = (*(lightdata->m_worldmatrix))(2,2); - //vec[0]= base->object->obmat[2][0]; - //vec[1]= base->object->obmat[2][1]; - //vec[2]= base->object->obmat[2][2]; - vec[3]= 0.0; - glLightfv((GLenum)(GL_LIGHT0+count), GL_POSITION, vec); - } - else { - //vec[3]= 1.0; - glLightfv((GLenum)(GL_LIGHT0+count), GL_POSITION, vec); - glLightf((GLenum)(GL_LIGHT0+count), GL_CONSTANT_ATTENUATION, 1.0); - glLightf((GLenum)(GL_LIGHT0+count), GL_LINEAR_ATTENUATION, lightdata->m_att1/lightdata->m_distance); - // without this next line it looks backward compatible. - //attennuation still is acceptable - glLightf((GLenum)(GL_LIGHT0+count), GL_QUADRATIC_ATTENUATION, lightdata->m_att2/(lightdata->m_distance*lightdata->m_distance)); - - if(lightdata->m_type==RAS_LightObject::LIGHT_SPOT) { - vec[0] = -(*(lightdata->m_worldmatrix))(0,2); - vec[1] = -(*(lightdata->m_worldmatrix))(1,2); - vec[2] = -(*(lightdata->m_worldmatrix))(2,2); - //vec[0]= -base->object->obmat[2][0]; - //vec[1]= -base->object->obmat[2][1]; - //vec[2]= -base->object->obmat[2][2]; - glLightfv((GLenum)(GL_LIGHT0+count), GL_SPOT_DIRECTION, vec); - glLightf((GLenum)(GL_LIGHT0+count), GL_SPOT_CUTOFF, lightdata->m_spotsize/2.0); - glLightf((GLenum)(GL_LIGHT0+count), GL_SPOT_EXPONENT, 128.0*lightdata->m_spotblend); - } - else glLightf((GLenum)(GL_LIGHT0+count), GL_SPOT_CUTOFF, 180.0); - } - - if (lightdata->m_nodiffuse) - { - vec[0] = vec[1] = vec[2] = vec[3] = 0.0; - } else { - vec[0]= lightdata->m_energy*lightdata->m_red; - vec[1]= lightdata->m_energy*lightdata->m_green; - vec[2]= lightdata->m_energy*lightdata->m_blue; - vec[3]= 1.0; - } - glLightfv((GLenum)(GL_LIGHT0+count), GL_DIFFUSE, vec); - if (lightdata->m_nospecular) - { - vec[0] = vec[1] = vec[2] = vec[3] = 0.0; - } else if (lightdata->m_nodiffuse) { - vec[0]= lightdata->m_energy*lightdata->m_red; - vec[1]= lightdata->m_energy*lightdata->m_green; - vec[2]= lightdata->m_energy*lightdata->m_blue; - vec[3]= 1.0; - } - glLightfv((GLenum)(GL_LIGHT0+count), GL_SPECULAR, vec); - glEnable((GLenum)(GL_LIGHT0+count)); + KX_LightObject *kxlight = (KX_LightObject*)lightdata->m_light; - count++; + if(kxlight->ApplyLight(kxscene, objectlayer, count)) + count++; } glPopMatrix(); return count; - } void KX_BlenderRenderTools::MotionBlur(RAS_IRasterizer* rasterizer) diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index 02f23a8431b..96e50e651c0 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -31,8 +31,6 @@ #include "BMF_Api.h" -#include "DNA_scene_types.h" - #include "RAS_IRenderTools.h" #include "RAS_IRasterizer.h" #include "RAS_LightObject.h" @@ -44,6 +42,7 @@ #include "KX_BlenderMaterial.h" #include "KX_RayCast.h" #include "KX_IPhysicsController.h" +#include "KX_Light.h" #include "PHY_IPhysicsEnvironment.h" @@ -389,21 +388,12 @@ int GPC_RenderTools::applyLights(int objectlayer, const MT_Transform& viewmat) { // taken from blender source, incompatibility between Blender Object / GameObject KX_Scene* kxscene = (KX_Scene*)m_auxilaryClientInfo; - int scenelayer = ~0; float glviewmat[16]; unsigned int count; - float vec[4]; - - vec[3]= 1.0; + std::vector::iterator lit = m_lights.begin(); - if(kxscene && kxscene->GetBlenderScene()) - scenelayer = kxscene->GetBlenderScene()->lay; - for(count=0; count m_lights; - std::vector::iterator lit = m_lights.begin(); viewmat.getValue(glviewmat); @@ -412,82 +402,14 @@ int GPC_RenderTools::applyLights(int objectlayer, const MT_Transform& viewmat) for (lit = m_lights.begin(), count = 0; !(lit==m_lights.end()) && count < m_numgllights; ++lit) { RAS_LightObject* lightdata = (*lit); - KX_Scene* lightscene = (KX_Scene*)lightdata->m_scene; - - /* only use lights in the same layer as the object */ - if(!(lightdata->m_layer & objectlayer)) - continue; - /* only use lights in the same scene, and in a visible layer */ - if(kxscene != lightscene || !(lightdata->m_layer & scenelayer)) - continue; - - vec[0] = (*(lightdata->m_worldmatrix))(0,3); - vec[1] = (*(lightdata->m_worldmatrix))(1,3); - vec[2] = (*(lightdata->m_worldmatrix))(2,3); - vec[3] = 1; - - if(lightdata->m_type==RAS_LightObject::LIGHT_SUN) { - - vec[0] = (*(lightdata->m_worldmatrix))(0,2); - vec[1] = (*(lightdata->m_worldmatrix))(1,2); - vec[2] = (*(lightdata->m_worldmatrix))(2,2); - //vec[0]= base->object->obmat[2][0]; - //vec[1]= base->object->obmat[2][1]; - //vec[2]= base->object->obmat[2][2]; - vec[3]= 0.0; - glLightfv((GLenum)(GL_LIGHT0+count), GL_POSITION, vec); - } - else { - //vec[3]= 1.0; - glLightfv((GLenum)(GL_LIGHT0+count), GL_POSITION, vec); - glLightf((GLenum)(GL_LIGHT0+count), GL_CONSTANT_ATTENUATION, 1.0); - glLightf((GLenum)(GL_LIGHT0+count), GL_LINEAR_ATTENUATION, lightdata->m_att1/lightdata->m_distance); - // without this next line it looks backward compatible. - //attennuation still is acceptable - glLightf((GLenum)(GL_LIGHT0+count), GL_QUADRATIC_ATTENUATION, lightdata->m_att2/(lightdata->m_distance*lightdata->m_distance)); - - if(lightdata->m_type==RAS_LightObject::LIGHT_SPOT) { - vec[0] = -(*(lightdata->m_worldmatrix))(0,2); - vec[1] = -(*(lightdata->m_worldmatrix))(1,2); - vec[2] = -(*(lightdata->m_worldmatrix))(2,2); - //vec[0]= -base->object->obmat[2][0]; - //vec[1]= -base->object->obmat[2][1]; - //vec[2]= -base->object->obmat[2][2]; - glLightfv((GLenum)(GL_LIGHT0+count), GL_SPOT_DIRECTION, vec); - glLightf((GLenum)(GL_LIGHT0+count), GL_SPOT_CUTOFF, lightdata->m_spotsize/2.0); - glLightf((GLenum)(GL_LIGHT0+count), GL_SPOT_EXPONENT, 128.0*lightdata->m_spotblend); - } - else glLightf((GLenum)(GL_LIGHT0+count), GL_SPOT_CUTOFF, 180.0); - } - - if (lightdata->m_nodiffuse) - { - vec[0] = vec[1] = vec[2] = vec[3] = 0.0; - } else { - vec[0]= lightdata->m_energy*lightdata->m_red; - vec[1]= lightdata->m_energy*lightdata->m_green; - vec[2]= lightdata->m_energy*lightdata->m_blue; - vec[3]= 1.0; - } - glLightfv((GLenum)(GL_LIGHT0+count), GL_DIFFUSE, vec); - if (lightdata->m_nospecular) - { - vec[0] = vec[1] = vec[2] = vec[3] = 0.0; - } else if (lightdata->m_nodiffuse) { - vec[0]= lightdata->m_energy*lightdata->m_red; - vec[1]= lightdata->m_energy*lightdata->m_green; - vec[2]= lightdata->m_energy*lightdata->m_blue; - vec[3]= 1.0; - } - glLightfv((GLenum)(GL_LIGHT0+count), GL_SPECULAR, vec); - glEnable((GLenum)(GL_LIGHT0+count)); + KX_LightObject *kxlight = (KX_LightObject*)lightdata->m_light; - count++; + if(kxlight->ApplyLight(kxscene, objectlayer, count)) + count++; } glPopMatrix(); return count; - } void GPC_RenderTools::MotionBlur(RAS_IRasterizer* rasterizer) diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index fe575384a35..274d8f26d78 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -35,6 +35,8 @@ #pragma warning (disable : 4786) #endif +#include "GL/glew.h" + #include "KX_Light.h" #include "KX_Camera.h" #include "RAS_IRasterizer.h" @@ -43,6 +45,7 @@ #include "KX_PyMath.h" #include "DNA_object_types.h" +#include "DNA_scene_types.h" #include "GPU_material.h" KX_LightObject::KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks, @@ -56,8 +59,8 @@ KX_LightObject::KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks, m_rendertools(rendertools) { m_lightobj = lightobj; - m_lightobj.m_worldmatrix = GetOpenGLMatrixPtr(); m_lightobj.m_scene = sgReplicationInfo; + m_lightobj.m_light = this; m_rendertools->AddLight(&m_lightobj); m_glsl = glsl; m_blenderscene = ((KX_Scene*)sgReplicationInfo)->GetBlenderScene(); @@ -84,12 +87,102 @@ CValue* KX_LightObject::GetReplica() replica->ProcessReplica(); - replica->m_lightobj.m_worldmatrix = replica->GetOpenGLMatrixPtr(); + replica->m_lightobj.m_light = replica; m_rendertools->AddLight(&replica->m_lightobj); return replica; } +bool KX_LightObject::ApplyLight(KX_Scene *kxscene, int oblayer, int slot) +{ + KX_Scene* lightscene = (KX_Scene*)m_lightobj.m_scene; + float vec[4]; + int scenelayer = ~0; + + if(kxscene && kxscene->GetBlenderScene()) + scenelayer = kxscene->GetBlenderScene()->lay; + + /* only use lights in the same layer as the object */ + if(!(m_lightobj.m_layer & oblayer)) + return false; + /* only use lights in the same scene, and in a visible layer */ + if(kxscene != lightscene || !(m_lightobj.m_layer & scenelayer)) + return false; + + // lights don't get their openGL matrix updated, do it now + if(GetSGNode()->IsDirty()) + GetOpenGLMatrix(); + + MT_CmMatrix4x4& worldmatrix= *GetOpenGLMatrixPtr(); + + vec[0] = worldmatrix(0,3); + vec[1] = worldmatrix(1,3); + vec[2] = worldmatrix(2,3); + vec[3] = 1.0f; + + if(m_lightobj.m_type==RAS_LightObject::LIGHT_SUN) { + + vec[0] = worldmatrix(0,2); + vec[1] = worldmatrix(1,2); + vec[2] = worldmatrix(2,2); + //vec[0]= base->object->obmat[2][0]; + //vec[1]= base->object->obmat[2][1]; + //vec[2]= base->object->obmat[2][2]; + vec[3]= 0.0; + glLightfv((GLenum)(GL_LIGHT0+slot), GL_POSITION, vec); + } + else { + //vec[3]= 1.0; + glLightfv((GLenum)(GL_LIGHT0+slot), GL_POSITION, vec); + glLightf((GLenum)(GL_LIGHT0+slot), GL_CONSTANT_ATTENUATION, 1.0); + glLightf((GLenum)(GL_LIGHT0+slot), GL_LINEAR_ATTENUATION, m_lightobj.m_att1/m_lightobj.m_distance); + // without this next line it looks backward compatible. + //attennuation still is acceptable + glLightf((GLenum)(GL_LIGHT0+slot), GL_QUADRATIC_ATTENUATION, m_lightobj.m_att2/(m_lightobj.m_distance*m_lightobj.m_distance)); + + if(m_lightobj.m_type==RAS_LightObject::LIGHT_SPOT) { + vec[0] = -worldmatrix(0,2); + vec[1] = -worldmatrix(1,2); + vec[2] = -worldmatrix(2,2); + //vec[0]= -base->object->obmat[2][0]; + //vec[1]= -base->object->obmat[2][1]; + //vec[2]= -base->object->obmat[2][2]; + glLightfv((GLenum)(GL_LIGHT0+slot), GL_SPOT_DIRECTION, vec); + glLightf((GLenum)(GL_LIGHT0+slot), GL_SPOT_CUTOFF, m_lightobj.m_spotsize/2.0); + glLightf((GLenum)(GL_LIGHT0+slot), GL_SPOT_EXPONENT, 128.0*m_lightobj.m_spotblend); + } + else + glLightf((GLenum)(GL_LIGHT0+slot), GL_SPOT_CUTOFF, 180.0); + } + + if (m_lightobj.m_nodiffuse) { + vec[0] = vec[1] = vec[2] = vec[3] = 0.0; + } + else { + vec[0]= m_lightobj.m_energy*m_lightobj.m_red; + vec[1]= m_lightobj.m_energy*m_lightobj.m_green; + vec[2]= m_lightobj.m_energy*m_lightobj.m_blue; + vec[3]= 1.0; + } + + glLightfv((GLenum)(GL_LIGHT0+slot), GL_DIFFUSE, vec); + if(m_lightobj.m_nospecular) + { + vec[0] = vec[1] = vec[2] = vec[3] = 0.0; + } + else if (m_lightobj.m_nodiffuse) { + vec[0]= m_lightobj.m_energy*m_lightobj.m_red; + vec[1]= m_lightobj.m_energy*m_lightobj.m_green; + vec[2]= m_lightobj.m_energy*m_lightobj.m_blue; + vec[3]= 1.0; + } + + glLightfv((GLenum)(GL_LIGHT0+slot), GL_SPECULAR, vec); + glEnable((GLenum)(GL_LIGHT0+slot)); + + return true; +} + GPULamp *KX_LightObject::GetGPULamp() { if(m_glsl) diff --git a/source/gameengine/Ketsji/KX_Light.h b/source/gameengine/Ketsji/KX_Light.h index 35f25515e3b..358c705080a 100644 --- a/source/gameengine/Ketsji/KX_Light.h +++ b/source/gameengine/Ketsji/KX_Light.h @@ -54,7 +54,10 @@ public: virtual CValue* GetReplica(); RAS_LightObject* GetLightData() { return &m_lightobj;} - /* GLSL shadow */ + /* OpenGL Light */ + bool ApplyLight(KX_Scene *kxscene, int oblayer, int slot); + + /* GLSL Light */ struct GPULamp *GetGPULamp(); bool HasShadowBuffer(); int GetShadowLayer(); diff --git a/source/gameengine/Rasterizer/RAS_LightObject.h b/source/gameengine/Rasterizer/RAS_LightObject.h index 6b63a891981..b45a35e4266 100644 --- a/source/gameengine/Rasterizer/RAS_LightObject.h +++ b/source/gameengine/Rasterizer/RAS_LightObject.h @@ -39,8 +39,9 @@ struct RAS_LightObject LIGHT_NORMAL }; bool m_modified; - int m_layer; + int m_layer; void *m_scene; + void *m_light; float m_energy; float m_distance; @@ -55,7 +56,6 @@ struct RAS_LightObject float m_spotblend; LightType m_type; - MT_CmMatrix4x4* m_worldmatrix; bool m_nodiffuse; bool m_nospecular; -- cgit v1.2.3 From 61889df87bc04f2a8ddc29fcb7e0a124a01d64f5 Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Tue, 9 Jun 2009 17:04:50 +0000 Subject: Tools ----- Bugfix #18835: negatively scaled objects resulted in incorrect boolean output. Commit to trunk instead of tagged release this time :-p --- source/blender/src/booleanops.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/src/booleanops.c b/source/blender/src/booleanops.c index c5b97e475a9..c777283d7d9 100644 --- a/source/blender/src/booleanops.c +++ b/source/blender/src/booleanops.c @@ -164,6 +164,7 @@ typedef struct { DerivedMesh *dm; int pos; int offset; + int flip; } FaceIt; static void FaceIt_Destruct(CSG_FaceIteratorDescriptor * iterator) @@ -190,9 +191,15 @@ static void FaceIt_Fill(CSG_IteratorPtr it, CSG_IFace *face) MFace *mfaces = face_it->dm->getFaceArray(face_it->dm); MFace *mface = &mfaces[face_it->pos]; - face->vertex_index[0] = mface->v1; + /* reverse face vertices if necessary */ face->vertex_index[1] = mface->v2; - face->vertex_index[2] = mface->v3; + if( face_it->flip == 0 ) { + face->vertex_index[0] = mface->v1; + face->vertex_index[2] = mface->v3; + } else { + face->vertex_index[2] = mface->v1; + face->vertex_index[0] = mface->v3; + } if (mface->v4) { face->vertex_index[3] = mface->v4; face->vertex_number = 4; @@ -216,7 +223,7 @@ static void FaceIt_Reset(CSG_IteratorPtr it) } static void FaceIt_Construct( - CSG_FaceIteratorDescriptor *output, DerivedMesh *dm, int offset) + CSG_FaceIteratorDescriptor *output, DerivedMesh *dm, int offset, Object *ob) { FaceIt *it; if (output == 0) return; @@ -231,6 +238,25 @@ static void FaceIt_Construct( it->offset = offset; it->pos = 0; + /* determine if we will need to reverse order of face vertices */ + if (ob->size[0] < 0.0f) { + if (ob->size[1] < 0.0f && ob->size[2] < 0.0f) { + it->flip = 1; + } else if (ob->size[1] >= 0.0f && ob->size[2] >= 0.0f) { + it->flip = 1; + } else { + it->flip = 0; + } + } else { + if (ob->size[1] < 0.0f && ob->size[2] < 0.0f) { + it->flip = 0; + } else if (ob->size[1] >= 0.0f && ob->size[2] >= 0.0f) { + it->flip = 0; + } else { + it->flip = 1; + } + } + // assign iterator function pointers. output->Step = FaceIt_Step; output->Fill = FaceIt_Fill; @@ -429,7 +455,7 @@ static void BuildMeshDescriptors( struct CSG_VertexIteratorDescriptor * vertex_it) { VertexIt_Construct(vertex_it,dm, ob); - FaceIt_Construct(face_it,dm,face_offset); + FaceIt_Construct(face_it,dm,face_offset,ob); } static void FreeMeshDescriptors( -- cgit v1.2.3 From 19c9708a1611415327fc5c76fcbcc5671c041a21 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 9 Jun 2009 17:56:07 +0000 Subject: Fix for bug #18855: in texture node editor, "Add New" for world did not set texture in correct place and crashed without an active object. --- source/blender/src/header_node.c | 8 ++++++-- source/blender/src/headerbuttons.c | 22 ++++++++++++++++++---- 2 files changed, 24 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/src/header_node.c b/source/blender/src/header_node.c index c23913bb97c..1a8b7d44a7a 100644 --- a/source/blender/src/header_node.c +++ b/source/blender/src/header_node.c @@ -804,8 +804,12 @@ void node_buttons(ScrArea *sa) if(snode->from) { /* can't use unlink etc here, code requires buttons context */ - xco= std_libbuttons(block, xco, 0, 0, NULL, B_TEXBROWSE, ID_TE, 1, snode->id, snode->from, &(snode->menunr), - 0, 0, 0, B_AUTOTEXNAME, B_KEEPDATA); + if(snode->texfrom == SNODE_TEX_WORLD) + xco= std_libbuttons(block, xco, 0, 0, NULL, B_WTEXBROWSE, ID_TE, 1, snode->id, snode->from, &(snode->menunr), + 0, 0, 0, B_AUTOTEXNAME, B_KEEPDATA); + else + xco= std_libbuttons(block, xco, 0, 0, NULL, B_TEXBROWSE, ID_TE, 1, snode->id, snode->from, &(snode->menunr), + 0, 0, 0, B_AUTOTEXNAME, B_KEEPDATA); if(snode->id) { Tex *tx= (Tex *)snode->id; diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c index 17d16924ae6..27d30816c09 100644 --- a/source/blender/src/headerbuttons.c +++ b/source/blender/src/headerbuttons.c @@ -1226,8 +1226,20 @@ void do_global_buttons(unsigned short event) break; case B_WTEXBROWSE: + { + short *menunr = 0; + + /* this is called now from Node editor too, buttons might not exist */ + if(curarea->spacetype==SPACE_NODE) { + SpaceNode *snode = curarea->spacedata.first; + menunr = &snode->menunr; + } + else if(G.buts) { + menunr = &G.buts->texnr; + } + else return; - if(G.buts->texnr== -2) { + if(*menunr== -2) { id= NULL; wrld= G.scene->world; if(wrld) { @@ -1235,12 +1247,12 @@ void do_global_buttons(unsigned short event) if(mtex) id= (ID *)mtex->tex; } - activate_databrowse((ID *)id, ID_TE, 0, B_WTEXBROWSE, &G.buts->texnr, do_global_buttons); + activate_databrowse((ID *)id, ID_TE, 0, B_WTEXBROWSE, menunr, do_global_buttons); return; } - if(G.buts->texnr < 0) break; + if(*menunr < 0) break; - if(G.buts->pin) { + if(G.buts && G.buts->pin) { } else { @@ -1279,10 +1291,12 @@ void do_global_buttons(unsigned short event) allqueue(REDRAWBUTSSHADING, 0); allqueue(REDRAWIPO, 0); allqueue(REDRAWOOPS, 0); + allqueue(REDRAWNODE, 0); BIF_preview_changed(ID_WO); } } break; + } case B_LAMPBROWSE: /* no lock */ if(ob==0) return; -- cgit v1.2.3 From 8704629945c015ec0c34298c406402373c01efa4 Mon Sep 17 00:00:00 2001 From: Chris Want Date: Tue, 9 Jun 2009 18:08:45 +0000 Subject: Use fputs instead of fprintf in mem_error_cb(). This silences the gcc warning "format not a string literal and no format arguments". --- source/creator/creator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/creator/creator.c b/source/creator/creator.c index f8bf7288143..5a90a1e5b9f 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -887,7 +887,7 @@ static void error_cb(char *err) static void mem_error_cb(char *errorStr) { - fprintf(stderr, errorStr); + fputs(errorStr, stderr); fflush(stderr); } -- cgit v1.2.3 From 8adb155e98e9699117bb652f17d63f0837cefa05 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 9 Jun 2009 18:21:48 +0000 Subject: Built in limitations for script scanning was making python fail on meta-androcto script pack. If a total of 30 subdirs was hit, or 4 dirs deep was hit - script scanning would quit, skipping files in the root scripts path too. To work around this the script pack included some of blenders scripts twice just so they would get into the menu but this is a dodgy workaround. * dont stop scanning for scripts when limits are reached (just dont scan further). * global 30 dir limit per scan is silly - removed. * limit recursive depth is kept but keep scanning at lower depths. * bumped recursive limit from 4 to 6 * flt_properties.py had #!BPY without a menu header. --- source/blender/python/BPY_menus.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/python/BPY_menus.c b/source/blender/python/BPY_menus.c index 9e7abc44657..cdcdd8402bf 100644 --- a/source/blender/python/BPY_menus.c +++ b/source/blender/python/BPY_menus.c @@ -49,7 +49,7 @@ #include "api2_2x/EXPP_interface.h" /* for bpy_gethome() */ #define BPYMENU_DATAFILE "Bpymenus" -#define MAX_DIR_DEPTH 4 /* max depth for traversing scripts dirs */ +#define MAX_DIR_DEPTH 6 /* max depth for traversing scripts dirs */ #define MAX_DIR_NUMBER 30 /* max number of dirs in scripts dirs trees */ static int DEBUG; @@ -929,17 +929,20 @@ static int bpymenu_ParseDir(char *dirname, char *parentdir, int is_userdir ) else if (S_ISDIR(status.st_mode)) { /* is subdir */ Dirs_Number++; Dir_Depth++; +#if 0 // Limiting the total number of directories is too restrictive, only limit recursion should be enough if (Dirs_Number > MAX_DIR_NUMBER) { if (DEBUG) { - fprintf(stderr, "BPyMenus error: too many subdirs.\n"); + fprintf(stderr, "BPyMenus error: too many subdirs %s/%s.\n", dirname, de->d_name); } closedir(dir); return -1; } - else if (Dir_Depth > MAX_DIR_DEPTH) { + else +#endif + if (Dir_Depth > MAX_DIR_DEPTH) { if (DEBUG) fprintf(stderr, - "BPyMenus error: max depth reached traversing dir tree.\n"); + "BPyMenus error: max depth reached traversing dir tree %s/%s.\n", dirname, de->d_name); closedir(dir); return -1; } @@ -949,10 +952,14 @@ static int bpymenu_ParseDir(char *dirname, char *parentdir, int is_userdir ) BLI_join_dirfile(subdir, parentdir, de->d_name); s = subdir; } +#if 0 // to stop searching for scripts once the maxdir is hit is bad, just dont look further but keep going with other dirs. if (bpymenu_ParseDir(path, s, is_userdir) == -1) { closedir(dir); return -1; } +#else + bpymenu_ParseDir(path, s, is_userdir); +#endif Dir_Depth--; } -- cgit v1.2.3 From e917b1043ebe6201c89e3c4960280fee484161b8 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 9 Jun 2009 18:25:57 +0000 Subject: Fix for bug #18860: particle hair strands missed first segment when rendering as regular geometry (not strand render). --- source/blender/render/intern/source/convertblender.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 6f07d44d1fb..3c6b872a16d 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -1863,8 +1863,6 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem strand->totvert++; } else{ - sd.first = 0; - sd.time = time; sd.size = hasize; if(k==1){ @@ -1872,8 +1870,13 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem sd.time = 0.0f; VECSUB(loc0,loc1,loc); VECADD(loc0,loc1,loc0); + + render_new_particle(re, obr, psmd->dm, ma, &sd, loc1, loc0, seed); } + sd.first = 0; + sd.time = time; + if(k) render_new_particle(re, obr, psmd->dm, ma, &sd, loc, loc1, seed); -- cgit v1.2.3 From 9a54ca9af79012354e91424d3b434ea23bc053ad Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 9 Jun 2009 18:50:02 +0000 Subject: Fix for bug #18710: a crash with hair emitted from vertices. --- source/blender/blenkernel/intern/particle_system.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 3445556b53b..31e246f66b9 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -1307,9 +1307,23 @@ int psys_threads_init_distribution(ParticleThread *threads, DerivedMesh *finaldm /* for hair, sort by origindex, allows optimizations in rendering */ /* however with virtual parents the children need to be in random order */ if(part->type == PART_HAIR && !(part->childtype==PART_CHILD_FACES && part->parents!=0.0)) { - COMPARE_ORIG_INDEX= dm->getFaceDataArray(dm, CD_ORIGINDEX); - if(COMPARE_ORIG_INDEX) - qsort(index, totpart, sizeof(int), compare_orig_index); + if(from != PART_FROM_PARTICLE) { + COMPARE_ORIG_INDEX = NULL; + + if(from == PART_FROM_VERT) { + if(dm->numVertData) + COMPARE_ORIG_INDEX= dm->getVertDataArray(dm, CD_ORIGINDEX); + } + else { + if(dm->numFaceData) + COMPARE_ORIG_INDEX= dm->getFaceDataArray(dm, CD_ORIGINDEX); + } + + if(COMPARE_ORIG_INDEX) { + qsort(index, totpart, sizeof(int), compare_orig_index); + COMPARE_ORIG_INDEX = NULL; + } + } } /* weights are no longer used except for FROM_PARTICLE, which needs them zeroed for indexing */ -- cgit v1.2.3 From 323863015db62f1b7b10a09a34489503070c23b4 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Tue, 9 Jun 2009 22:56:43 +0000 Subject: fix for bug #18898: GE perspective 3D View not working properly (missing LENS) note: I'm not changing GamePlayer files. There is no such a thing as 3D view camera in gameplayer (override_camera). --- source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 1 + source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 7 +++++++ source/gameengine/Ketsji/KX_KetsjiEngine.h | 2 ++ 3 files changed, 10 insertions(+) (limited to 'source') diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index b78feb8f75d..38a2ccd5d79 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -326,6 +326,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, ketsjiengine->SetCameraOverrideProjectionMatrix(projmat); ketsjiengine->SetCameraOverrideViewMatrix(viewmat); ketsjiengine->SetCameraOverrideClipping(v3d->near, v3d->far); + ketsjiengine->SetCameraOverrideLens(v3d->lens); } // create a scene converter, create and convert the startingscene diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index b30b79e7f23..a43ea59220b 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -1078,6 +1078,11 @@ void KX_KetsjiEngine::SetCameraOverrideClipping(float near, float far) m_overrideCamFar = far; } +void KX_KetsjiEngine::SetCameraOverrideLens(float lens) +{ + m_overrideCamLens = lens; +} + void KX_KetsjiEngine::GetSceneViewport(KX_Scene *scene, KX_Camera* cam, RAS_Rect& area, RAS_Rect& viewport) { // In this function we make sure the rasterizer settings are upto @@ -1351,6 +1356,8 @@ void KX_KetsjiEngine::PostProcessScene(KX_Scene* scene) KX_Camera* activecam = NULL; RAS_CameraData camdata = RAS_CameraData(); + if (override_camera) camdata.m_lens = m_overrideCamLens; + activecam = new KX_Camera(scene,KX_Scene::m_callbacks,camdata); activecam->SetName("__default__cam__"); diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index 6fa379e551a..abba23ca376 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -129,6 +129,7 @@ private: MT_CmMatrix4x4 m_overrideCamViewMat; float m_overrideCamNear; float m_overrideCamFar; + float m_overrideCamLens; bool m_stereo; int m_curreye; @@ -253,6 +254,7 @@ public: void SetCameraOverrideProjectionMatrix(const MT_CmMatrix4x4& mat); void SetCameraOverrideViewMatrix(const MT_CmMatrix4x4& mat); void SetCameraOverrideClipping(float near, float far); + void SetCameraOverrideLens(float lens); /** * Sets display of all frames. -- cgit v1.2.3 From 2f8290434ca1e36c8a60ebc405a3edaacd41e9a9 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 10 Jun 2009 04:43:18 +0000 Subject: NLA SoC: Added BorderSelect operators (BKEY and Alt-BKEY) These work in the same way as the ones in the Action Editor... --- source/blender/editors/space_nla/nla_channels.c | 4 +- source/blender/editors/space_nla/nla_intern.h | 1 + source/blender/editors/space_nla/nla_ops.c | 6 + source/blender/editors/space_nla/nla_select.c | 145 ++++++++++++++++++++++++ 4 files changed, 154 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index ed401c3596b..b40b1bf0f4d 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -179,7 +179,7 @@ void NLA_OT_channels_select_border(wmOperatorType *ot) ot->exec= nlachannels_borderselect_exec; ot->modal= WM_border_select_modal; - ot->poll= ED_operator_areaactive; + ot->poll= nlaop_poll_tweakmode_off; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -449,7 +449,7 @@ void NLA_OT_channels_click (wmOperatorType *ot) /* api callbacks */ ot->invoke= nlachannels_mouseclick_invoke; - ot->poll= ED_operator_areaactive; + ot->poll= nlaop_poll_tweakmode_off; // xxx? /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index abbb7331e28..94e907a59db 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -81,6 +81,7 @@ enum { /* --- */ void NLAEDIT_OT_select_all_toggle(wmOperatorType *ot); +void NLAEDIT_OT_select_border(wmOperatorType *ot); void NLAEDIT_OT_click_select(wmOperatorType *ot); /* **************************************** */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 3eb32d147f5..61654338fea 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -126,6 +126,7 @@ void nla_operatortypes(void) /* select */ WM_operatortype_append(NLAEDIT_OT_click_select); + WM_operatortype_append(NLAEDIT_OT_select_border); WM_operatortype_append(NLAEDIT_OT_select_all_toggle); /* edit */ @@ -186,6 +187,11 @@ static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "NLAEDIT_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "NLAEDIT_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); + /* borderselect */ + WM_keymap_add_item(keymap, "NLAEDIT_OT_select_border", BKEY, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "NLAEDIT_OT_select_border", BKEY, KM_PRESS, KM_ALT, 0)->ptr, "axis_range", 1); + + /* editing */ /* tweakmode * - enter and exit are separate operators with the same hotkey... diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 730814dc562..25a876d44f4 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -208,6 +208,151 @@ void NLAEDIT_OT_select_all_toggle (wmOperatorType *ot) RNA_def_boolean(ot->srna, "invert", 0, "Invert", ""); } +/* ******************** Border Select Operator **************************** */ +/* This operator currently works in one of three ways: + * -> BKEY - 1) all strips within region are selected (ACTKEYS_BORDERSEL_ALLSTRIPS) + * -> ALT-BKEY - depending on which axis of the region was larger... + * -> 2) x-axis, so select all frames within frame range (ACTKEYS_BORDERSEL_FRAMERANGE) + * -> 3) y-axis, so select all frames within channels that region included (ACTKEYS_BORDERSEL_CHANNELS) + */ + +/* defines for borderselect mode */ +enum { + NLA_BORDERSEL_ALLSTRIPS = 0, + NLA_BORDERSEL_FRAMERANGE, + NLA_BORDERSEL_CHANNELS, +} eActKeys_BorderSelect_Mode; + + +static void borderselect_nla_strips (bAnimContext *ac, rcti rect, short mode, short selectmode) +{ + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + View2D *v2d= &ac->ar->v2d; + rctf rectf; + float ymin=(float)(-NLACHANNEL_HEIGHT), ymax=0; + + /* convert border-region to view coordinates */ + UI_view2d_region_to_view(v2d, rect.xmin, rect.ymin+2, &rectf.xmin, &rectf.ymin); + UI_view2d_region_to_view(v2d, rect.xmax, rect.ymax-2, &rectf.xmax, &rectf.ymax); + + /* filter data */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS); + ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); + + /* convert selection modes to selection modes */ + selectmode= selmodes_to_flagmodes(selectmode); + + /* loop over data, doing border select */ + for (ale= anim_data.first; ale; ale= ale->next) { + ymax= ymin + NLACHANNEL_STEP; + + /* perform vertical suitability check (if applicable) */ + if ( (mode == NLA_BORDERSEL_FRAMERANGE) || + !((ymax < rectf.ymin) || (ymin > rectf.ymax)) ) + { + /* loop over data selecting (only if NLA-Track) */ + if (ale->type == ANIMTYPE_NLATRACK) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip; + + /* only select strips if they fall within the required ranges (if applicable) */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + if ( (mode == NLA_BORDERSEL_CHANNELS) || + BKE_nlastrip_within_bounds(strip, rectf.xmin, rectf.xmax) ) + { + /* set selection */ + ACHANNEL_SET_FLAG(strip, selectmode, NLASTRIP_FLAG_SELECT); + + /* clear active flag */ + strip->flag &= ~NLASTRIP_FLAG_ACTIVE; + } + } + } + } + + /* set maximum extent to be the minimum of the next channel */ + ymin= ymax; + } + + /* cleanup */ + BLI_freelistN(&anim_data); +} + +/* ------------------- */ + +static int nlaedit_borderselect_exec(bContext *C, wmOperator *op) +{ + bAnimContext ac; + rcti rect; + short mode=0, selectmode=0; + int event; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get settings from operator */ + rect.xmin= RNA_int_get(op->ptr, "xmin"); + rect.ymin= RNA_int_get(op->ptr, "ymin"); + rect.xmax= RNA_int_get(op->ptr, "xmax"); + rect.ymax= RNA_int_get(op->ptr, "ymax"); + + event= RNA_int_get(op->ptr, "event_type"); + if (event == LEFTMOUSE) // FIXME... hardcoded + selectmode = SELECT_ADD; + else + selectmode = SELECT_SUBTRACT; + + /* selection 'mode' depends on whether borderselect region only matters on one axis */ + if (RNA_boolean_get(op->ptr, "axis_range")) { + /* mode depends on which axis of the range is larger to determine which axis to use + * - checking this in region-space is fine, as it's fundamentally still going to be a different rect size + * - the frame-range select option is favoured over the channel one (x over y), as frame-range one is often + * used for tweaking timing when "blocking", while channels is not that useful... + */ + if ((rect.xmax - rect.xmin) >= (rect.ymax - rect.ymin)) + mode= NLA_BORDERSEL_FRAMERANGE; + else + mode= NLA_BORDERSEL_CHANNELS; + } + else + mode= NLA_BORDERSEL_ALLSTRIPS; + + /* apply borderselect action */ + borderselect_nla_strips(&ac, rect, mode, selectmode); + + return OPERATOR_FINISHED; +} + +void NLAEDIT_OT_select_border(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Border Select"; + ot->idname= "NLAEDIT_OT_select_border"; + + /* api callbacks */ + ot->invoke= WM_border_select_invoke; + ot->exec= nlaedit_borderselect_exec; + ot->modal= WM_border_select_modal; + + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* rna */ + RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); + + RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", ""); +} + /* ******************** Mouse-Click Select Operator *********************** */ /* This operator works in one of 2 ways: * 1) Select the strip directly under the mouse -- cgit v1.2.3 From 867e1291350de7c128c18c9f9a2e7c4b7a5513f4 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 10 Jun 2009 05:03:27 +0000 Subject: F-Modifiers (in Nla branch): For fun, added 'sinc' (i.e. y = sin(pi*x)/(pi*x)) as a type of builtin function usable through the generator modifier. This makes a nice 'jolt' which tapers off. --- source/blender/blenkernel/intern/fcurve.c | 17 ++++++++++++++++- source/blender/editors/space_graph/graph_buttons.c | 5 ++++- source/blender/makesdna/DNA_anim_types.h | 1 + source/blender/makesrna/intern/rna_fcurve.c | 1 + 4 files changed, 22 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 6a3870f8f31..5820761234c 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1410,6 +1410,18 @@ static void fcm_generator_verify (FModifier *fcm) } } +/* Unary 'normalised sine' function + * y = sin(PI + x) / (PI * x), + * except for x = 0 when y = 1. + */ +static double sinc (double x) +{ + if (fabs(x) < 0.0001) + return 1.0; + else + return sin(M_PI * x) / (M_PI * x); +} + static void fcm_generator_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) { FMod_Generator *data= (FMod_Generator *)fcm->data; @@ -1490,6 +1502,9 @@ static void fcm_generator_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, case FCM_GENERATOR_FN_COS: /* cosine wave */ fn= cos; break; + case FCM_GENERATOR_FN_SINC: /* normalised sine wave */ + fn= sinc; + break; /* validation required */ case FCM_GENERATOR_FN_TAN: /* tangent wave */ @@ -1527,7 +1542,7 @@ static void fcm_generator_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, } } break; - + default: printf("Invalid Function-Generator for F-Modifier - %d \n", data->func_type); } diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index a4babaad74c..5b00205b5d0 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -405,7 +405,7 @@ static void draw_modifier__generator(uiBlock *block, FCurve *fcu, FModifier *fcm { FMod_Generator *data= (FMod_Generator *)fcm->data; char gen_mode[]="Generator Type%t|Expanded Polynomial%x0|Factorised Polynomial%x1|Built-In Function%x2|Expression%x3"; - char fn_type[]="Built-In Function%t|Sin%x0|Cos%x1|Tan%x2|Square Root%x3|Natural Log%x4"; + char fn_type[]="Built-In Function%t|Sin%x0|Cos%x1|Tan%x2|Square Root%x3|Natural Log%x4|Normalised Sin%x5"; int cy= *yco - 30; uiBut *but; @@ -555,6 +555,9 @@ static void draw_modifier__generator(uiBlock *block, FCurve *fcu, FModifier *fcm case FCM_GENERATOR_FN_SQRT: /* square root */ sprintf(func_name, "sqrt("); break; + case FCM_GENERATOR_FN_SINC: /* normalised sine wave */ + sprintf(func_name, "sinc("); + break; default: /* unknown */ sprintf(func_name, "("); break; diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index c19318629f6..a784adaf35f 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -108,6 +108,7 @@ enum { FCM_GENERATOR_FN_TAN, FCM_GENERATOR_FN_SQRT, FCM_GENERATOR_FN_LN, + FCM_GENERATOR_FN_SINC, } eFMod_Generator_Functions; diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index ea26118f267..69103536310 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -284,6 +284,7 @@ static void rna_def_fmodifier_generator_function(BlenderRNA *brna) {2, "TAN", "Tangent", ""}, {3, "SQRT", "Square Root", ""}, {4, "LN", "Natural Logarithm", ""}, + {5, "SINC", "Normalised Sine", "sin(x) / x"}, {0, NULL, NULL, NULL}}; -- cgit v1.2.3 From 219f1ce2f034642776782b9465c41783c1a6ab6a Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 10 Jun 2009 15:09:44 +0000 Subject: 2.5 Scene toolsettings was not setting Brush pointers on read, causing crashes on reading files. Thanks Jingyuan for (irc) report! :) --- source/blender/blenloader/intern/readfile.c | 9 ++++++++- source/blender/editors/space_view3d/view3d_buttons.c | 12 +++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ce3a35c7194..6cde040e5fd 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3827,12 +3827,19 @@ static void lib_link_scene(FileData *fd, Main *main) sce->world= newlibadr_us(fd, sce->id.lib, sce->world); sce->set= newlibadr(fd, sce->id.lib, sce->set); sce->ima= newlibadr_us(fd, sce->id.lib, sce->ima); + sce->toolsettings->imapaint.brush= newlibadr_us(fd, sce->id.lib, sce->toolsettings->imapaint.brush); if(sce->toolsettings->sculpt) sce->toolsettings->sculpt->brush= newlibadr_us(fd, sce->id.lib, sce->toolsettings->sculpt->brush); - + if(sce->toolsettings->vpaint) + sce->toolsettings->vpaint->brush= + newlibadr_us(fd, sce->id.lib, sce->toolsettings->vpaint->brush); + if(sce->toolsettings->wpaint) + sce->toolsettings->wpaint->brush= + newlibadr_us(fd, sce->id.lib, sce->toolsettings->wpaint->brush); + sce->toolsettings->skgen_template = newlibadr(fd, sce->id.lib, sce->toolsettings->skgen_template); for(base= sce->base.first; base; base= next) { diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index d7cb08db414..3146b8b45ae 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1157,11 +1157,13 @@ static void view3d_panel_brush(const bContext *C, Panel *pa) cy-= 20; uiBlockEndAlign(block); - rect.xmin= cx; rect.xmax= cx + w; - rect.ymin= cy - 200; rect.ymax= cy; - uiBlockBeginAlign(block); - curvemap_buttons(block, br->curve, (char)0, B_NOP, 0, &rect); - uiBlockEndAlign(block); + if(br->curve) { + rect.xmin= cx; rect.xmax= cx + w; + rect.ymin= cy - 200; rect.ymax= cy; + uiBlockBeginAlign(block); + curvemap_buttons(block, br->curve, (char)0, B_NOP, 0, &rect); + uiBlockEndAlign(block); + } } static void sculptmode_draw_interface_tools(Scene *scene, uiBlock *block, unsigned short cx, unsigned short cy) -- cgit v1.2.3 From 5a8b389ebe6105149625e7367ac533ca258c3970 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 10 Jun 2009 19:33:59 +0000 Subject: was printing all warnings twice --- source/gameengine/Expressions/PyObjectPlus.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 369c00782cc..c002dccefe4 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -113,8 +113,8 @@ typedef struct { if ((m_ignore_deprecation_warnings || wlink.warn_done)==0) \ { \ ShowDeprecationWarning_func(old_way, new_way); \ + \ WarnLink *wlink_last= GetDeprecationWarningLinkLast(); \ - ShowDeprecationWarning_func(old_way, new_way); \ wlink.warn_done = true; \ wlink.link = NULL; \ \ -- cgit v1.2.3 From 9bcc6f3cb6421066d62719ac6c34f03387d3e719 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 10 Jun 2009 19:57:06 +0000 Subject: patch from Xavier Thomas, make the sequence strip start frame and channel editable --- source/blender/makesrna/intern/rna_sequence.c | 59 +++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index 357e3bf8bc8..8740b6e779e 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -48,6 +48,56 @@ static void rna_SequenceEditor_name_get(PointerRNA *ptr, char *str) strcpy(str, "Sequence Editor"); } +static void rna_SequenceEditor_start_frame_set(PointerRNA *ptr, int value) +{ + Sequence *seq= (Sequence*)ptr->data; + Scene *sce= (Scene*)ptr->id.data; + Editing *ed= seq_give_editing(sce, FALSE); + + seq->start= value; + calc_sequence_disp(seq); + + if( seq_test_overlap(ed->seqbasep, seq) ) { + shuffle_seq(ed->seqbasep, seq); + } + sort_seq(sce); +} + +static void rna_SequenceEditor_length_set(PointerRNA *ptr, int value) +{ + Sequence *seq= (Sequence*)ptr->data; + Scene *sce= (Scene*)ptr->id.data; + Editing *ed= seq_give_editing(sce, FALSE); + + seq_tx_set_final_right(seq, seq->start+value); + calc_sequence_disp(seq); + + if( seq_test_overlap(ed->seqbasep, seq) ) { + shuffle_seq(ed->seqbasep, seq); + } + sort_seq(sce); +} + +static int rna_SequenceEditor_length_get(PointerRNA *ptr) +{ + Sequence *seq= (Sequence*)ptr->data; + return seq_tx_get_final_right(seq, 1)-seq_tx_get_final_left(seq, 1); +} + +static void rna_SequenceEditor_channel_set(PointerRNA *ptr, int value) +{ + Sequence *seq= (Sequence*)ptr->data; + Scene *sce= (Scene*)ptr->id.data; + Editing *ed= seq_give_editing(sce, FALSE); + + seq->machine= value; + + if( seq_test_overlap(ed->seqbasep, seq) ) { + shuffle_seq(ed->seqbasep, seq); + } + sort_seq(sce); +} + /* name functions that ignore the first two characters */ static void rna_Sequence_name_get(PointerRNA *ptr, char *value) { @@ -329,13 +379,14 @@ static void rna_def_sequence(BlenderRNA *brna) prop= RNA_def_property(srna, "length", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "len"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); // computed from other values + RNA_def_property_range(prop, 1, MAXFRAME); RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied"); - + RNA_def_property_int_funcs(prop, "rna_SequenceEditor_length_get", "rna_SequenceEditor_length_set",NULL); + prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "start"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests RNA_def_property_ui_text(prop, "Start Frame", ""); + RNA_def_property_int_funcs(prop, NULL, "rna_SequenceEditor_start_frame_set",NULL); // overlap tests and calc_seq_disp prop= RNA_def_property(srna, "start_offset", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "startofs"); @@ -361,8 +412,8 @@ static void rna_def_sequence(BlenderRNA *brna) prop= RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "machine"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip."); + RNA_def_property_int_funcs(prop, NULL, "rna_SequenceEditor_channel_set",NULL); // overlap test /* blending */ -- cgit v1.2.3 From 1a787efd7c600e7b08774c8432e43a8ea69c941b Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Wed, 10 Jun 2009 20:50:23 +0000 Subject: 2.5: * Wrapped FFMpeg in RNA (some properties are disabled for now). * Some Texture panel tweaks by William. Thanks! --- source/blender/makesrna/intern/rna_scene.c | 132 ++++++++++++++++++++++++++++- 1 file changed, 131 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index b7487f46f8d..6001757dfbd 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -31,6 +31,12 @@ #include "DNA_scene_types.h" +/* +#include "BKE_writeffmpeg.h" +#include +#include +*/ + #include "WM_types.h" /* prop_mode needs to be accessible from transform operator */ @@ -285,7 +291,45 @@ void rna_def_scene_render_data(BlenderRNA *brna) {R_JPEG2K_16BIT, "32", "32", ""}, {0, NULL, NULL, NULL}}; #endif - + +/* +#ifdef WITH_FFMPEG + static EnumPropertyItem ffmpeg_format_items[] = { + {FFMPEG_MPEG1, "MPEG1", "MPEG-1", ""}, + {FFMPEG_MPEG2, "MPEG2", "MPEG-2", ""}, + {FFMPEG_MPEG4, "MPEG4", "MPEG-4", ""}, + {FFMPEG_AVI, "AVI", "Avi", ""}, + {FFMPEG_MOV, "QUICKTIME", "Quicktime", ""}, + {FFMPEG_DV, "DV", "DV", ""}, + {FFMPEG_H264, "H264", "H264", ""}, + {FFMPEG_XVID, "XVID", "XVid", ""}, + {FFMPEG_OGG, "OGG", "OGG", ""}, + {FFMPEG_FLV, "FLASH", "Flash", ""}, + {0, NULL, NULL, NULL}}; + + static EnumPropertyItem ffmpeg_codec_items[] = { + {CODEC_ID_MPEG1VIDEO, "MPEG1", "MPEG-1", ""}, + {CODEC_ID_MPEG2VIDEO, "MPEG2", "MPEG-2", ""}, + {CODEC_ID_MPEG4, "MPEG4", "MPEG-4(divx)", ""}, + {CODEC_ID_HUFFYUV, "HUFFYUV", "HuffYUV", ""}, + {CODEC_ID_DVVIDEO, "DV", "DV", ""}, + {CODEC_ID_H264, "H264", "H264", ""}, + {CODEC_ID_XVID, "XVID", "XVid", ""}, + {CODEC_ID_THEORA, "THEORA", "OGG Theora", ""}, + {CODEC_ID_FLV1, "FLASH", "FlashVideo1", ""}, + {0, NULL, NULL, NULL}}; + + static EnumPropertyItem ffmpeg_audio_codec_items[] = { + {CODEC_ID_MP2, "MP2", "MP2", ""}, + {CODEC_ID_MP3, "MP3", "MP3", ""}, + {CODEC_ID_AC3, "AC3", "AC3", ""}, + {CODEC_ID_AAC, "AAC", "AAC", ""}, + {CODEC_ID_VORBIS, "VORBIS", "Vorbis", ""}, + {CODEC_ID_PCM_S16LE, "PCM", "PCM", ""}, + {0, NULL, NULL, NULL}}; +#endif +*/ + srna= RNA_def_struct(brna, "SceneRenderData", NULL); RNA_def_struct_sdna(srna, "RenderData"); RNA_def_struct_nested(brna, srna, "Scene"); @@ -422,7 +466,93 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance instead of RGB color channels"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); #endif + +#ifdef WITH_FFMPEG + /* FFMPEG Video*/ + + /* + prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type"); + RNA_def_property_enum_items(prop, ffmpeg_format_items); + RNA_def_property_ui_text(prop, "Format", "Output file format"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "ffmpeg_codec", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.codec"); + RNA_def_property_enum_items(prop, ffmpeg_codec_items); + RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + */ + + prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate"); + RNA_def_property_range(prop, 1, 14000); + RNA_def_property_ui_text(prop, "Bitrate", "Video bitrate(kb/s)"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "ffmpeg_minrate", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_min_rate"); + RNA_def_property_range(prop, 0, 9000); + RNA_def_property_ui_text(prop, "Min Rate", "Rate control: min rate(kb/s)"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + prop= RNA_def_property(srna, "ffmpeg_maxrate", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_max_rate"); + RNA_def_property_range(prop, 1, 14000); + RNA_def_property_ui_text(prop, "Max Rate", "Rate control: max rate(kb/s)"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "ffmpeg_muxrate", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_rate"); + RNA_def_property_range(prop, 0, 100000000); + RNA_def_property_ui_text(prop, "Mux Rate", "Mux rate (bits/s(!))"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "ffmpeg_gopsize", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.gop_size"); + RNA_def_property_range(prop, 0, 100); + RNA_def_property_ui_text(prop, "GOP Size", "Distance between key frames"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "ffmpeg_buffersize", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.rc_buffer_size"); + RNA_def_property_range(prop, 0, 2000); + RNA_def_property_ui_text(prop, "Buffersize", "Rate control: buffer size (kb)"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "ffmpeg_packetsize", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.mux_packet_size"); + RNA_def_property_range(prop, 0, 16384); + RNA_def_property_ui_text(prop, "Mux Packet Size", "Mux packet size (byte)"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "ffmpeg_autosplit", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_AUTOSPLIT_OUTPUT); + RNA_def_property_ui_text(prop, "Autosplit Output", "Autosplit output at 2GB boundary."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + /* FFMPEG Audio*/ + + /* + prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec"); + RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items); + RNA_def_property_ui_text(prop, Codec", "FFMpeg codec to use"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + */ + + prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate"); + RNA_def_property_range(prop, 32, 384); + RNA_def_property_ui_text(prop, "Bitrate", "Audio bitrate(kb/s)"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "ffmpeg_multiplex_audio", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "ffcodecdata.flags", FFMPEG_MULTIPLEX_AUDIO); + RNA_def_property_ui_text(prop, "Multiplex Audio", "Interleave audio with the output video"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); +#endif + prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "frs_sec"); RNA_def_property_range(prop, 1, 120); -- cgit v1.2.3 From 3bdcd4f738e470dd906de239e70d54f44aa0d78e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 10 Jun 2009 22:03:50 +0000 Subject: patch from Xavier Thomas, color balance and proxy access both need to allocate structs when enabled. --- source/blender/makesrna/intern/rna_sequence.c | 37 +++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index 8740b6e779e..10cfb47b385 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -98,6 +98,39 @@ static void rna_SequenceEditor_channel_set(PointerRNA *ptr, int value) sort_seq(sce); } +static int rna_SequenceEditor_use_color_balance_set(PointerRNA *ptr, int value) +{ + Sequence *seq= (Sequence*)ptr->data; + int c; + + if(value) { + seq->flag |= SEQ_USE_COLOR_BALANCE; + if(seq->strip->color_balance == NULL) { + seq->strip->color_balance = MEM_callocN(sizeof(struct StripColorBalance), "StripColorBalance"); + for (c=0; c<3; c++) { + seq->strip->color_balance->lift[c] = 1.0f; + seq->strip->color_balance->gamma[c] = 1.0f; + seq->strip->color_balance->gain[c] = 1.0f; + } + } + } else { + seq->flag ^= SEQ_USE_COLOR_BALANCE; + } +} + +static int rna_SequenceEditor_use_proxy_set(PointerRNA *ptr, int value) +{ + Sequence *seq= (Sequence*)ptr->data; + if(value) { + seq->flag |= SEQ_USE_PROXY; + if(seq->strip->proxy == NULL) { + seq->strip->proxy = MEM_callocN(sizeof(struct StripProxy), "StripProxy"); + } + } else { + seq->flag ^= SEQ_USE_PROXY; + } +} + /* name functions that ignore the first two characters */ static void rna_Sequence_name_get(PointerRNA *ptr, char *value) { @@ -504,8 +537,8 @@ static void rna_def_filter_video(StructRNA *srna) prop= RNA_def_property(srna, "use_color_balance", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_COLOR_BALANCE); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); // allocate color balance RNA_def_property_ui_text(prop, "Use Color Balance", "(3-Way color correction) on input."); + RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_color_balance_set"); prop= RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "strip->color_balance"); @@ -551,8 +584,8 @@ static void rna_def_proxy(StructRNA *srna) prop= RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXY); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); // allocate proxy RNA_def_property_ui_text(prop, "Use Proxy", "Use a preview proxy for this strip."); + RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_proxy_set"); prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "strip->proxy"); -- cgit v1.2.3 From 64f94a670ea9a5704276f1e80f61afdcb067a2b6 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 11 Jun 2009 02:14:56 +0000 Subject: NLA SoC: Evaluation bugfixes * Strip scaling was being evaluated in the wrong way, resulting in scaled strips not being played too fast (for lengthened strips) or too slow (shortened strips) * Also, verified that the 'reversed' option works correctly (no changes needed to be made here) --- source/blender/blenkernel/intern/anim_sys.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 3290e06dfb4..a864e3d4e87 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -591,23 +591,23 @@ static float nlastrip_get_frame (NlaStrip *strip, float cframe, short invert) float length, actlength, repeat, scale; /* get number of repeats */ - if (strip->repeat == 0.0f) strip->repeat = 1.0f; + if (IS_EQ(strip->repeat, 0.0f)) strip->repeat = 1.0f; repeat = strip->repeat; /* scaling */ - if (strip->scale == 0.0f) strip->scale= 1.0f; + if (IS_EQ(strip->scale, 0.0f)) strip->scale= 1.0f; scale = (float)fabs(strip->scale); /* scale must be positive - we've got a special flag for reversing */ /* length of referenced action */ actlength = strip->actend - strip->actstart; - if (actlength == 0.0f) actlength = 1.0f; + if (IS_EQ(actlength, 0.0f)) actlength = 1.0f; /* length of strip */ - length = repeat * scale * actlength; + length = strip->end - strip->start; + if (IS_EQ(length, 0.0f)) length= actlength * scale * repeat; /* reversed = play strip backwards */ if (strip->flag & NLASTRIP_FLAG_REVERSE) { - // FIXME: verify these /* invert = convert action-strip time to global time */ if (invert) return length*(strip->actend - cframe)/(repeat*actlength) + strip->start; @@ -651,7 +651,7 @@ void nlastrip_evaluate_controls (NlaStrip *strip, float ctime) { /* firstly, analytically generate values for influence and time (if applicable) */ if ((strip->flag & NLASTRIP_FLAG_USR_TIME) == 0) - strip->strip_time= nlastrip_get_frame(strip, ctime, 1); /* last arg '1' means current time to 'strip'/action time */ + strip->strip_time= nlastrip_get_frame(strip, ctime, 0); if ((strip->flag & NLASTRIP_FLAG_USR_INFLUENCE) == 0) strip->influence= nlastrip_get_influence(strip, ctime); -- cgit v1.2.3 From 4a29d0c1a36359c3e08a90beb80cd40857305c80 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 11 Jun 2009 02:18:29 +0000 Subject: NLA SoC: 'Split' Operator (YKEY) Selected NLA Strips are split into two strips, each with half the length of the original strip. Possible improvements subject to demand: - multiple splits? - splits with variable spacing? (i.e. 3:2, or 1:5). --- source/blender/editors/space_nla/nla_edit.c | 97 ++++++++++++++++++++++++++- source/blender/editors/space_nla/nla_intern.h | 1 + source/blender/editors/space_nla/nla_ops.c | 4 ++ 3 files changed, 100 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index ce62d36e667..93ac726c17e 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -49,6 +49,7 @@ #include "BKE_context.h" #include "BKE_report.h" #include "BKE_screen.h" +#include "BKE_utildefines.h" #include "ED_anim_api.h" #include "ED_markers.h" @@ -213,7 +214,7 @@ void NLAEDIT_OT_tweakmode_exit (wmOperatorType *ot) /* *********************************************** */ /* NLA Editing Operations */ -/* ******************** Delete Operator ***************************** */ +/* ******************** Delete Strips Operator ***************************** */ /* Deletes the selected NLA-Strips */ static int nlaedit_delete_exec (bContext *C, wmOperator *op) @@ -233,7 +234,6 @@ static int nlaedit_delete_exec (bContext *C, wmOperator *op) ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); /* for each NLA-Track, delete all selected strips */ - // FIXME: need to double-check that we've got tracks for (ale= anim_data.first; ale; ale= ale->next) { NlaTrack *nlt= (NlaTrack *)ale->data; NlaStrip *strip, *nstrip; @@ -273,4 +273,97 @@ void NLAEDIT_OT_delete (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/* ******************** Split Strips Operator ***************************** */ +/* Splits the selected NLA-Strips into two strips at the midpoint of the strip */ +// TODO's? +// - multiple splits +// - variable-length splits? + +static int nlaedit_split_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the AnimData blocks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* for each NLA-Track, delete all selected strips */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip, *nstrip, *next; + + for (strip= nlt->strips.first; strip; strip= next) { + next= strip->next; + + /* if selected, split the strip at its midpoint */ + if (strip->flag & NLASTRIP_FLAG_SELECT) { + float midframe, midaframe, len; + + /* calculate the frames to do the splitting at */ + /* strip extents */ + len= strip->end - strip->start; + if (IS_EQ(len, 0.0f)) + continue; + else + midframe= strip->start + (len / 2.0f); + + /* action range */ + len= strip->actend - strip->actstart; + if (IS_EQ(len, 0.0f)) + midaframe= strip->actend; + else + midaframe= strip->actstart + (len / 2.0f); + + /* make a copy (assume that this is possible) and append + * it immediately after the current strip + */ + nstrip= copy_nlastrip(strip); + BLI_insertlinkafter(&nlt->strips, strip, nstrip); + + /* set the endpoint of the first strip and the start of the new strip + * to the midframe values calculated above + */ + strip->end= midframe; + nstrip->start= midframe; + + strip->actend= midaframe; + nstrip->actstart= midaframe; + } + } + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done */ + return OPERATOR_FINISHED; +} + +void NLAEDIT_OT_split (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Split Strips"; + ot->idname= "NLAEDIT_OT_split"; + ot->description= "Split selected strips at their midpoints."; + + /* api callbacks */ + ot->exec= nlaedit_split_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /* *********************************************** */ diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 94e907a59db..9511f67f824 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -93,6 +93,7 @@ void NLAEDIT_OT_tweakmode_exit(wmOperatorType *ot); /* --- */ void NLAEDIT_OT_delete(wmOperatorType *ot); +void NLAEDIT_OT_split(wmOperatorType *ot); /* **************************************** */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 61654338fea..14c6f2a32d2 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -134,6 +134,7 @@ void nla_operatortypes(void) WM_operatortype_append(NLAEDIT_OT_tweakmode_exit); WM_operatortype_append(NLAEDIT_OT_delete); + WM_operatortype_append(NLAEDIT_OT_split); } /* ************************** registration - keymaps **********************************/ @@ -204,6 +205,9 @@ static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "NLAEDIT_OT_delete", XKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "NLAEDIT_OT_delete", DELKEY, KM_PRESS, 0, 0); + /* split */ + WM_keymap_add_item(keymap, "NLAEDIT_OT_split", YKEY, KM_PRESS, 0, 0); + /* transform system */ transform_keymap_for_space(wm, keymap, SPACE_NLA); } -- cgit v1.2.3 From f0f9034966be8692250686aee74048294960aad3 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 11 Jun 2009 03:19:08 +0000 Subject: NLA SoC: Operator for adding new NLA-Tracks New tracks can be added in the following ways (with the mouse hovering over the channels-list): * Shift-A - this will add a new track at the top of the stack (i.e. above all the existing NLA-tracks but below the Active Action) for every AnimData block where there was a selected NLA-Track * Ctrl-Shift-A - this will add a new track above every selected one --- source/blender/blenkernel/BKE_nla.h | 2 +- source/blender/blenkernel/intern/nla.c | 13 +++-- source/blender/editors/space_nla/nla_channels.c | 73 +++++++++++++++++++++++++ source/blender/editors/space_nla/nla_edit.c | 1 + source/blender/editors/space_nla/nla_intern.h | 2 + source/blender/editors/space_nla/nla_ops.c | 9 ++- 6 files changed, 94 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index da824fd2093..078c1ba52bb 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -46,7 +46,7 @@ struct NlaStrip *copy_nlastrip(struct NlaStrip *strip); struct NlaTrack *copy_nlatrack(struct NlaTrack *nlt); void copy_nladata(ListBase *dst, ListBase *src); -struct NlaTrack *add_nlatrack(struct AnimData *adt); +struct NlaTrack *add_nlatrack(struct AnimData *adt, struct NlaTrack *prev); struct NlaStrip *add_nlastrip(struct bAction *act); struct NlaStrip *add_nlastrip_to_stack(struct AnimData *adt, struct bAction *act); diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 9acbad32a42..cef14128032 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -215,8 +215,10 @@ void copy_nladata (ListBase *dst, ListBase *src) /* Adding ------------------------------------------- */ -/* Add a NLA Track to the given AnimData */ -NlaTrack *add_nlatrack (AnimData *adt) +/* Add a NLA Track to the given AnimData + * - prev: NLA-Track to add the new one after + */ +NlaTrack *add_nlatrack (AnimData *adt, NlaTrack *prev) { NlaTrack *nlt; @@ -232,7 +234,10 @@ NlaTrack *add_nlatrack (AnimData *adt) nlt->index= BLI_countlist(&adt->nla_tracks); /* add track to stack, and make it the active one */ - BLI_addtail(&adt->nla_tracks, nlt); + if (prev) + BLI_insertlinkafter(&adt->nla_tracks, prev, nlt); + else + BLI_addtail(&adt->nla_tracks, nlt); BKE_nlatrack_set_active(&adt->nla_tracks, nlt); /* must have unique name, but we need to seed this */ @@ -308,7 +313,7 @@ NlaStrip *add_nlastrip_to_stack (AnimData *adt, bAction *act) (BKE_nlatrack_has_space(adt->nla_tracks.last, strip->start, strip->end)==0) ) { /* no space, so add to a new track... */ - nlt= add_nlatrack(adt); + nlt= add_nlatrack(adt, NULL); } else { diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index b40b1bf0f4d..992c5bfa756 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -459,3 +459,76 @@ void NLA_OT_channels_click (wmOperatorType *ot) } /* *********************************************** */ +/* Special Operators */ + +/* ******************** Add Tracks Operator ***************************** */ +/* Add NLA Tracks to the same AnimData block as a selected track, or above the selected tracks */ + +static int nlaedit_add_tracks_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + AnimData *lastAdt = NULL; + short above_sel= RNA_boolean_get(op->ptr, "above_selected"); + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the AnimData blocks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_SEL); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* add tracks... */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + AnimData *adt= BKE_animdata_from_id(ale->id); + + /* check if just adding a new track above this one, + * or whether we're adding a new one to the top of the stack that this one belongs to + */ + if (above_sel) { + /* just add a new one above this one */ + add_nlatrack(adt, nlt); + } + else if ((lastAdt == NULL) || (adt != lastAdt)) { + /* add one track to the top of the owning AnimData's stack, then don't add anymore to this stack */ + add_nlatrack(adt, NULL); + lastAdt= adt; + } + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done */ + return OPERATOR_FINISHED; +} + +void NLA_OT_add_tracks (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Track(s)"; + ot->idname= "NLA_OT_add_tracks"; + ot->description= "Add NLA-Tracks above/after the selected tracks."; + + /* api callbacks */ + ot->exec= nlaedit_add_tracks_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_boolean(ot->srna, "above_selected", 0, "Above Selected", "Add a new NLA Track above every existing selected one."); +} + +/* *********************************************** */ diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 93ac726c17e..e8af67aebd1 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -28,6 +28,7 @@ #include #include +#include #include "DNA_anim_types.h" #include "DNA_action_types.h" diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 9511f67f824..b0a9ba5b182 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -102,6 +102,8 @@ void NLAEDIT_OT_split(wmOperatorType *ot); void NLA_OT_channels_select_border(wmOperatorType *ot); void NLA_OT_channels_click(wmOperatorType *ot); +void NLA_OT_add_tracks(wmOperatorType *ot); + /* **************************************** */ /* nla_ops.c */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 14c6f2a32d2..6cba19bb2cf 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -124,6 +124,8 @@ void nla_operatortypes(void) WM_operatortype_append(NLA_OT_channels_click); WM_operatortype_append(NLA_OT_channels_select_border); + WM_operatortype_append(NLA_OT_add_tracks); + /* select */ WM_operatortype_append(NLAEDIT_OT_click_select); WM_operatortype_append(NLAEDIT_OT_select_border); @@ -148,9 +150,14 @@ static void nla_keymap_channels (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "NLA_OT_channels_click", LEFTMOUSE, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "NLA_OT_channels_click", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", 1); - /* borderselect */ + /* borderselect */ WM_keymap_add_item(keymap, "NLA_OT_channels_select_border", BKEY, KM_PRESS, 0, 0); + /* channel operations */ + /* add tracks */ + WM_keymap_add_item(keymap, "NLA_OT_add_tracks", AKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "NLA_OT_add_tracks", AKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "above_selected", 1); + /* General Animation Channels keymap (see anim_channels.c) ----------------------- */ /* deselect all */ WM_keymap_add_item(keymap, "ANIM_OT_channels_select_all_toggle", AKEY, KM_PRESS, 0, 0); -- cgit v1.2.3 From 0bef8012bc71b1a1d3fae4f5ef82055045ef4752 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 11 Jun 2009 05:02:46 +0000 Subject: NLA SoC: Channel ordering change In response to user-feedback, I've changed the order in which channels appear. Now, the channel ordering is: - Object/AnimData block -- Active Action -- Last NLA Track .. .. -- First NLA Track It is important to note several things still: 1) Active action is applied AFTER the NLA Tracks have been evaluated, not before 2) In this new order, the tracks+active action are shown in the evaluation-stack order, i.e. first thing applied is at the bottom, last is at the top. As a result, I've switched the view-orientation back so that it works the same way as for DopeSheet/Graph editors (i.e. expands downwards not upwards). This may cause problems loading files saved with older builds of this branch. There are still some lingering problems due to this change which I'll fix in due course. --- source/blender/editors/animation/anim_channels.c | 8 ++ source/blender/editors/animation/anim_filter.c | 72 ++++++++++----- source/blender/editors/space_nla/nla_buttons.c | 2 +- source/blender/editors/space_nla/nla_channels.c | 112 +---------------------- source/blender/editors/space_nla/nla_draw.c | 46 +++++----- source/blender/editors/space_nla/nla_intern.h | 1 - source/blender/editors/space_nla/nla_ops.c | 8 +- source/blender/editors/space_nla/nla_select.c | 8 +- source/blender/editors/space_nla/space_nla.c | 45 +++++---- 9 files changed, 108 insertions(+), 194 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index 59fb56f3c35..2944c9519b9 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -1216,6 +1216,14 @@ static void borderselect_anim_channels (bAnimContext *ac, rcti *rect, short sele ACHANNEL_SET_FLAG(gpl, selectmode, GP_LAYER_SELECT); } break; + + case ANIMTYPE_NLATRACK: /* nla-track */ + { + NlaTrack *nlt= (NlaTrack *)ale->data; + + ACHANNEL_SET_FLAG(nlt, selectmode, NLATRACK_SELECTED); + } + break; } } diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 6cb24a01711..b47211f35d1 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -717,36 +717,21 @@ static int animdata_filter_action (ListBase *anim_data, bAction *act, int filter return items; } +/* Include NLA-Data for NLA-Editor: + * - when ANIMFILTER_CHANNELS is used, that means we should be filtering the list for display + * Although the evaluation order is from the first track to the last and then apply the Action on top, + * we present this in the UI as the Active Action followed by the last track to the first so that we + * get the evaluation order presented as per a stack. + * - for normal filtering (i.e. for editing), we only need the NLA-tracks but they can be in 'normal' evaluation + * order, i.e. first to last. Otherwise, some tools may get screwed up. + */ static int animdata_filter_nla (ListBase *anim_data, AnimData *adt, int filter_mode, void *owner, short ownertype, ID *owner_id) { bAnimListElem *ale; NlaTrack *nlt; + NlaTrack *first=NULL, *next=NULL; int items = 0; - /* loop over NLA Tracks - assume that the caller of this has already checked that these should be included */ - for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { - /* only work with this channel and its subchannels if it is editable */ - if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_NLT(nlt)) { - /* only include this track if selected in a way consistent with the filtering requirements */ - if ( ANIMCHANNEL_SELOK(SEL_NLT(nlt)) ) { - /* only include if this track is active */ - if (!(filter_mode & ANIMFILTER_ACTIVE) || (nlt->flag & NLATRACK_ACTIVE)) { - ale= make_new_animlistelem(nlt, ANIMTYPE_NLATRACK, owner, ownertype, owner_id); - - if (ale) { - BLI_addtail(anim_data, ale); - items++; - } - } - - /* if we're in NLA-tweakmode, if this track was active, that means that it was the last active one */ - // FIXME: the channels after should still get drawn, just 'differently', and after an active-action channel - if ((adt->flag & ADT_NLA_EDIT_ON) && (nlt->flag & NLATRACK_ACTIVE)) - break; - } - } - } - /* if showing channels, include active action */ if (filter_mode & ANIMFILTER_CHANNELS) { /* there isn't really anything editable here, so skip if need editable */ @@ -764,6 +749,45 @@ static int animdata_filter_nla (ListBase *anim_data, AnimData *adt, int filter_m items++; } } + + /* first track to include will be the last one if we're filtering by channels */ + first= adt->nla_tracks.last; + } + else { + /* first track to include will the the first one (as per normal) */ + first= adt->nla_tracks.first; + } + + /* loop over NLA Tracks - assume that the caller of this has already checked that these should be included */ + for (nlt= first; nlt; nlt= next) { + /* 'next' NLA-Track to use depends on whether we're filtering for drawing or not */ + if (filter_mode & ANIMFILTER_CHANNELS) + next= nlt->prev; + else + next= nlt->next; + + /* if we're in NLA-tweakmode, don't show this track if it was disabled (due to tweaking) for now + * - active track should still get shown though (even though it has disabled flag set) + */ + // FIXME: the channels after should still get drawn, just 'differently', and after an active-action channel + if ((adt->flag & ADT_NLA_EDIT_ON) && (nlt->flag & NLATRACK_DISABLED) && !(nlt->flag & NLATRACK_ACTIVE)) + continue; + + /* only work with this channel and its subchannels if it is editable */ + if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_NLT(nlt)) { + /* only include this track if selected in a way consistent with the filtering requirements */ + if ( ANIMCHANNEL_SELOK(SEL_NLT(nlt)) ) { + /* only include if this track is active */ + if (!(filter_mode & ANIMFILTER_ACTIVE) || (nlt->flag & NLATRACK_ACTIVE)) { + ale= make_new_animlistelem(nlt, ANIMTYPE_NLATRACK, owner, ownertype, owner_id); + + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } + } + } + } } /* return the number of items added to the list */ diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 80982d9feb5..cb21dd66934 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -141,7 +141,7 @@ static int nla_panel_context(const bContext *C, PointerRNA *nlt_ptr, PointerRNA /* free temp data */ BLI_freelistN(&anim_data); - return 1; + return found; } static int nla_panel_poll(const bContext *C, PanelType *pt) diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 992c5bfa756..f928daa523b 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -82,116 +82,6 @@ /* *********************************************** */ /* Operators for NLA channels-list which need to be different from the standard Animation Editor ones */ -/* ******************** Borderselect Operator *********************** */ - -static void borderselect_nla_channels (bAnimContext *ac, rcti *rect, short selectmode) -{ - ListBase anim_data = {NULL, NULL}; - bAnimListElem *ale; - int filter; - - View2D *v2d= &ac->ar->v2d; - rctf rectf; - float ymin=(float)(-NLACHANNEL_HEIGHT), ymax=0; - - /* convert border-region to view coordinates */ - UI_view2d_region_to_view(v2d, rect->xmin, rect->ymin+2, &rectf.xmin, &rectf.ymin); - UI_view2d_region_to_view(v2d, rect->xmax, rect->ymax-2, &rectf.xmax, &rectf.ymax); - - /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS); - ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); - - /* loop over data, doing border select */ - for (ale= anim_data.first; ale; ale= ale->next) { - ymax= ymin + NLACHANNEL_STEP; - - /* if channel is within border-select region, alter it */ - if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))) { - /* only the following types can be selected */ - switch (ale->type) { - case ANIMTYPE_OBJECT: /* object */ - { - Base *base= (Base *)ale->data; - Object *ob= base->object; - - ACHANNEL_SET_FLAG(base, selectmode, SELECT); - ACHANNEL_SET_FLAG(ob, selectmode, SELECT); - } - break; - case ANIMTYPE_NLATRACK: /* nla-track */ - { - NlaTrack *nlt= (NlaTrack *)ale->data; - - ACHANNEL_SET_FLAG(nlt, selectmode, NLATRACK_SELECTED); - } - break; - } - } - - /* set maximum extent to be the minimum of the next channel */ - ymin= ymax; - } - - /* cleanup */ - BLI_freelistN(&anim_data); -} - -/* ------------------- */ - -static int nlachannels_borderselect_exec(bContext *C, wmOperator *op) -{ - bAnimContext ac; - rcti rect; - short selectmode=0; - int event; - - /* get editor data */ - if (ANIM_animdata_get_context(C, &ac) == 0) - return OPERATOR_CANCELLED; - - /* get settings from operator */ - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); - - event= RNA_int_get(op->ptr, "event_type"); - if (event == LEFTMOUSE) // FIXME... hardcoded - selectmode = ACHANNEL_SETFLAG_ADD; - else - selectmode = ACHANNEL_SETFLAG_CLEAR; - - /* apply borderselect animation channels */ - borderselect_nla_channels(&ac, &rect, selectmode); - - return OPERATOR_FINISHED; -} - -void NLA_OT_channels_select_border(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Border Select"; - ot->idname= "NLA_OT_channels_select_border"; - - /* api callbacks */ - ot->invoke= WM_border_select_invoke; - ot->exec= nlachannels_borderselect_exec; - ot->modal= WM_border_select_modal; - - ot->poll= nlaop_poll_tweakmode_off; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /* rna */ - RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); -} - /* ******************** Mouse-Click Operator *********************** */ /* Depending on the channel that was clicked on, the mouse click will activate whichever * part of the channel is relevant. @@ -425,7 +315,7 @@ static int nlachannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *e selectmode= SELECT_REPLACE; /* figure out which channel user clicked in - * Note: although channels technically start at y= ACHANNEL_FIRST, we need to adjust by half a channel's height + * Note: although channels technically start at y= NLACHANNEL_FIRST, we need to adjust by half a channel's height * so that the tops of channels get caught ok. Since NLACHANNEL_FIRST is really NLACHANNEL_HEIGHT, we simply use * NLACHANNEL_HEIGHT_HALF. */ diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 4fa27f4bc11..8d417a150aa 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -250,15 +250,13 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) * start of list offset, and the second is as a correction for the scrollers. */ height= ((items*NLACHANNEL_STEP) + (NLACHANNEL_HEIGHT*2)); - if (height > (v2d->mask.ymax - v2d->mask.ymin)) { - /* don't use totrect set, as the width stays the same - * (NOTE: this is ok here, the configuration is pretty straightforward) - */ - v2d->tot.ymax= (float)(height); - } + /* don't use totrect set, as the width stays the same + * (NOTE: this is ok here, the configuration is pretty straightforward) + */ + v2d->tot.ymin= (float)(-height); /* loop through channels, and set up drawing depending on their type */ - y= (float)(-NLACHANNEL_FIRST); + y= (float)(-NLACHANNEL_HEIGHT); for (ale= anim_data.first; ale; ale= ale->next) { const float yminc= (float)(y - NLACHANNEL_HEIGHT_HALF); @@ -330,7 +328,7 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) } /* adjust y-position for next one */ - y += NLACHANNEL_STEP; + y -= NLACHANNEL_STEP; } /* free tempolary channels */ @@ -361,15 +359,13 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) * start of list offset, and the second is as a correction for the scrollers. */ height= ((items*NLACHANNEL_STEP) + (NLACHANNEL_HEIGHT*2)); - if (height > (v2d->mask.ymax - v2d->mask.ymin)) { - /* don't use totrect set, as the width stays the same - * (NOTE: this is ok here, the configuration is pretty straightforward) - */ - v2d->tot.ymax= (float)(height); - } + /* don't use totrect set, as the width stays the same + * (NOTE: this is ok here, the configuration is pretty straightforward) + */ + v2d->tot.ymin= (float)(-height); /* loop through channels, and set up drawing depending on their type */ - y= (float)(-NLACHANNEL_FIRST); + y= (float)(-NLACHANNEL_HEIGHT); for (ale= anim_data.first; ale; ale= ale->next) { const float yminc= (float)(y - NLACHANNEL_HEIGHT_HALF); @@ -397,7 +393,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) /* only show expand if there are any channels */ if (EXPANDED_SCEC(sce)) - expand= ICON_TRIA_UP; + expand= ICON_TRIA_DOWN; else expand= ICON_TRIA_RIGHT; @@ -421,7 +417,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) /* only show expand if there are any channels */ if (EXPANDED_OBJC(ob)) - expand= ICON_TRIA_UP; + expand= ICON_TRIA_DOWN; else expand= ICON_TRIA_RIGHT; @@ -438,7 +434,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) special = ICON_MATERIAL_DATA; if (FILTER_MAT_OBJC(ob)) - expand = ICON_TRIA_UP; + expand = ICON_TRIA_DOWN; else expand = ICON_TRIA_RIGHT; @@ -457,7 +453,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) offset = 21; if (FILTER_MAT_OBJD(ma)) - expand = ICON_TRIA_UP; + expand = ICON_TRIA_DOWN; else expand = ICON_TRIA_RIGHT; @@ -473,7 +469,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) special = ICON_LAMP_DATA; if (FILTER_LAM_OBJD(la)) - expand = ICON_TRIA_UP; + expand = ICON_TRIA_DOWN; else expand = ICON_TRIA_RIGHT; @@ -489,7 +485,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) special = ICON_CAMERA_DATA; if (FILTER_CAM_OBJD(ca)) - expand = ICON_TRIA_UP; + expand = ICON_TRIA_DOWN; else expand = ICON_TRIA_RIGHT; @@ -505,7 +501,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) special = ICON_CURVE_DATA; if (FILTER_CUR_OBJD(cu)) - expand = ICON_TRIA_UP; + expand = ICON_TRIA_DOWN; else expand = ICON_TRIA_RIGHT; @@ -521,7 +517,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) special = ICON_SHAPEKEY_DATA; // XXX if (FILTER_SKE_OBJD(key)) - expand = ICON_TRIA_UP; + expand = ICON_TRIA_DOWN; else expand = ICON_TRIA_RIGHT; @@ -629,7 +625,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) if (ELEM(ale->type, ANIMTYPE_SCENE, ANIMTYPE_OBJECT)) { /* object channel - darker */ UI_ThemeColor(TH_DOPESHEET_CHANNELOB); - uiSetRoundBox((expand == ICON_TRIA_UP)? (8):(1|8)); + uiSetRoundBox((expand == ICON_TRIA_DOWN)? (8):(1|8)); gl_round_box(GL_POLYGON, x+offset, yminc, (float)NLACHANNEL_NAMEWIDTH, ymaxc, 10); } else { @@ -763,7 +759,7 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) } /* adjust y-position for next one */ - y += NLACHANNEL_STEP; + y -= NLACHANNEL_STEP; } /* free tempolary channels */ diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index b0a9ba5b182..5c6670cfd6f 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -99,7 +99,6 @@ void NLAEDIT_OT_split(wmOperatorType *ot); /* **************************************** */ /* nla_channels.c */ -void NLA_OT_channels_select_border(wmOperatorType *ot); void NLA_OT_channels_click(wmOperatorType *ot); void NLA_OT_add_tracks(wmOperatorType *ot); diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 6cba19bb2cf..981ef9a4f87 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -122,7 +122,6 @@ void nla_operatortypes(void) /* channels */ WM_operatortype_append(NLA_OT_channels_click); - WM_operatortype_append(NLA_OT_channels_select_border); WM_operatortype_append(NLA_OT_add_tracks); @@ -150,15 +149,16 @@ static void nla_keymap_channels (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "NLA_OT_channels_click", LEFTMOUSE, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "NLA_OT_channels_click", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", 1); - /* borderselect */ - WM_keymap_add_item(keymap, "NLA_OT_channels_select_border", BKEY, KM_PRESS, 0, 0); - /* channel operations */ /* add tracks */ WM_keymap_add_item(keymap, "NLA_OT_add_tracks", AKEY, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "NLA_OT_add_tracks", AKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "above_selected", 1); /* General Animation Channels keymap (see anim_channels.c) ----------------------- */ + /* selection */ + /* borderselect */ + WM_keymap_add_item(keymap, "ANIM_OT_channels_select_border", BKEY, KM_PRESS, 0, 0); + /* deselect all */ WM_keymap_add_item(keymap, "ANIM_OT_channels_select_all_toggle", AKEY, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 25a876d44f4..b850ec76f82 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -247,7 +247,7 @@ static void borderselect_nla_strips (bAnimContext *ac, rcti rect, short mode, sh /* loop over data, doing border select */ for (ale= anim_data.first; ale; ale= ale->next) { - ymax= ymin + NLACHANNEL_STEP; + ymin= ymax - NLACHANNEL_STEP; /* perform vertical suitability check (if applicable) */ if ( (mode == NLA_BORDERSEL_FRAMERANGE) || @@ -273,8 +273,8 @@ static void borderselect_nla_strips (bAnimContext *ac, rcti rect, short mode, sh } } - /* set maximum extent to be the minimum of the next channel */ - ymin= ymax; + /* set minimum extent to be the maximum of the next channel */ + ymax= ymin; } /* cleanup */ @@ -390,7 +390,7 @@ static void mouse_nla_strips (bAnimContext *ac, int mval[2], short select_mode) /* use View2D to determine the index of the channel (i.e a row in the list) where keyframe was */ UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y); - UI_view2d_listview_view_to_cell(v2d, 0, NLACHANNEL_STEP, 0, 0, x, y, NULL, &channel_index); + UI_view2d_listview_view_to_cell(v2d, 0, NLACHANNEL_STEP, 0, (float)NLACHANNEL_HEIGHT_HALF, x, y, NULL, &channel_index); /* x-range to check is +/- 7 (in screen/region-space) on either side of mouse click * (that is the size of keyframe icons, so user should be expecting similar tolerances) diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 5490f40eb03..a7e9844726d 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -103,6 +103,7 @@ ARegion *nla_has_buttons_region(ScrArea *sa) static SpaceLink *nla_new(const bContext *C) { + Scene *scene= CTX_data_scene(C); ARegion *ar; SpaceNla *snla; @@ -132,45 +133,41 @@ static SpaceLink *nla_new(const bContext *C) ar->v2d.scroll = V2D_SCROLL_BOTTOM; ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL; + /* ui buttons */ + ar= MEM_callocN(sizeof(ARegion), "buttons area for nla"); + + BLI_addtail(&snla->regionbase, ar); + ar->regiontype= RGN_TYPE_UI; + ar->alignment= RGN_ALIGN_RIGHT; + ar->flag = RGN_FLAG_HIDDEN; + /* main area */ ar= MEM_callocN(sizeof(ARegion), "main area for nla"); BLI_addtail(&snla->regionbase, ar); ar->regiontype= RGN_TYPE_WINDOW; - ar->v2d.tot.xmin= 1.0f; - ar->v2d.tot.ymin= 0.0f; - ar->v2d.tot.xmax= 1000.0f; - ar->v2d.tot.ymax= 500.0f; + ar->v2d.tot.xmin= (float)(SFRA-10); + ar->v2d.tot.ymin= -500.0f; + ar->v2d.tot.xmax= (float)(EFRA+10); + ar->v2d.tot.ymax= 0.0f; - ar->v2d.cur.xmin= -5.0f; - ar->v2d.cur.ymin= 0.0f; - ar->v2d.cur.xmax= 65.0f; - ar->v2d.cur.ymax= 250.0f; + ar->v2d.cur = ar->v2d.tot; ar->v2d.min[0]= 0.0f; - ar->v2d.min[1]= 0.0f; + ar->v2d.min[1]= 0.0f; ar->v2d.max[0]= MAXFRAMEF; - ar->v2d.max[1]= 1000.0f; - - ar->v2d.minzoom= 0.1f; - ar->v2d.maxzoom= 50.0f; - + ar->v2d.max[1]= 10000.0f; + + ar->v2d.minzoom= 0.01f; + ar->v2d.maxzoom= 50; ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); ar->v2d.scroll |= (V2D_SCROLL_RIGHT); ar->v2d.keepzoom= V2D_LOCKZOOM_Y; - ar->v2d.align= V2D_ALIGN_NO_NEG_Y; + ar->v2d.align= V2D_ALIGN_NO_POS_Y; ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL; - /* ui buttons */ - ar= MEM_callocN(sizeof(ARegion), "buttons area for nla"); - - BLI_addtail(&snla->regionbase, ar); - ar->regiontype= RGN_TYPE_UI; - ar->alignment= RGN_ALIGN_RIGHT; - ar->flag = RGN_FLAG_HIDDEN; - return (SpaceLink *)snla; } @@ -213,7 +210,7 @@ static void nla_channel_area_init(wmWindowManager *wm, ARegion *ar) { ListBase *keymap; - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STACK, ar->winx, ar->winy); + UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy); /* own keymap */ // TODO: cannot use generic copy, need special NLA version -- cgit v1.2.3 From a543a1549e32a29a259603994e938ee5597d2bbb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 11 Jun 2009 10:26:53 +0000 Subject: Sound actuator bug reported by zapman on blenderartist. Negative events would play on an actuator if it hadn't played a sound yet. --- source/gameengine/Ketsji/KX_GameObject.cpp | 2 +- source/gameengine/Ketsji/KX_SoundActuator.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 7f417b325c8..fdab34c13a9 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -2207,7 +2207,7 @@ PyObject* KX_GameObject::PyGetChildrenRecursive() PyObject* KX_GameObject::PyGetMesh(PyObject* args) { - ShowDeprecationWarning("getMesh()", "the meshes property"); + ShowDeprecationWarning("getMesh()", "the meshes property (now a list of meshes)"); int mesh = 0; diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index 5c02a2db646..c13271f66a5 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -112,7 +112,7 @@ bool KX_SoundActuator::Update(double curtime, bool frame) return false; // actual audio device playing state - bool isplaying = (m_soundObject->GetPlaystate() != SND_STOPPED) ? true : false; + bool isplaying = (m_soundObject->GetPlaystate() != SND_STOPPED && m_soundObject->GetPlaystate() != SND_INITIAL) ? true : false; if (m_pino) { @@ -194,7 +194,7 @@ bool KX_SoundActuator::Update(double curtime, bool frame) } } // verify that the sound is still playing - isplaying = (m_soundObject->GetPlaystate() != SND_STOPPED) ? true : false; + isplaying = (m_soundObject->GetPlaystate() != SND_STOPPED && m_soundObject->GetPlaystate() != SND_INITIAL) ? true : false; if (isplaying) { -- cgit v1.2.3 From bf729ab26879cd290696f5950a09c423bafdebc0 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Thu, 11 Jun 2009 11:44:47 +0000 Subject: == SEQUENCER == This fixes * some issues with Scene strips containing audio by removing the curpos pointer from sequence structure. (the same scene strip can now be used in a row) That also makes the code a lot cleaner. * fixed a corner case on the beginning of a strip, where audio was not mixed in, depending of current audio buffer state. * Also: made some hardwired variables macros to enhance readability. Problem remaining: mixing the same scene strip several times (read put it into a stack instead of into a row) has problems with HD-audio since the same HD-audio state structure is used and therefore the system will seek permanently, which leads to audio distortions... --- source/blender/makesdna/DNA_sequence_types.h | 4 +- source/blender/src/seqaudio.c | 215 +++++++++++++++------------ 2 files changed, 125 insertions(+), 94 deletions(-) (limited to 'source') diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index 801b283a6c2..ed1626c887f 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -159,7 +159,7 @@ typedef struct Sequence { struct bSound *sound; /* the linked "bSound" object */ struct hdaudio *hdaudio; /* external hdaudio object */ float level, pan; /* level in dB (0=full), pan -1..1 */ - int curpos; /* last sample position in audio_fill() */ + int scenenr; /* for scene selection */ float strobe; void *effectdata; /* Struct pointer for effect settings */ @@ -170,8 +170,6 @@ typedef struct Sequence { int blend_mode; float blend_opacity; - int scenenr; /* for scene selection */ - int pad; } Sequence; typedef struct MetaStack { diff --git a/source/blender/src/seqaudio.c b/source/blender/src/seqaudio.c index 03885292dfd..a464b7d71e1 100644 --- a/source/blender/src/seqaudio.c +++ b/source/blender/src/seqaudio.c @@ -104,6 +104,10 @@ static Scene * audio_scene = 0; /* we can't use G.scene, since #define AFRA2TIME(a) ((((double) audio_scene->r.frs_sec_base) * (a)) / audio_scene->r.frs_sec) #define ATIME2FRA(a) ((((double) audio_scene->r.frs_sec) * (a)) / audio_scene->r.frs_sec_base) +/* we do currently stereo 16 bit mixing only */ +#define AUDIO_CHANNELS 2 +#define SAMPLE_SIZE (AUDIO_CHANNELS * sizeof(short)) + ///// // /* local protos ------------------- */ @@ -149,7 +153,8 @@ void audio_mixdown() strcpy(buf, "RIFFlengWAVEfmt fmln01ccRATEbsecBP16dataDLEN"); totframe = (EFRA - SFRA + 1); - totlen = (int) ( FRA2TIME(totframe) * (float)G.scene->audio.mixrate * 4.0); + totlen = (int) ( FRA2TIME(totframe) + * (float)G.scene->audio.mixrate * SAMPLE_SIZE); printf(" totlen %d\n", totlen+36+8); totlen+= 36; /* len is filesize-8 in WAV spec, total header is 44 bytes */ @@ -159,7 +164,7 @@ void audio_mixdown() buf[16] = 0x10; buf[17] = buf[18] = buf[19] = 0; buf[20] = 1; buf[21] = 0; buf[22] = 2; buf[23]= 0; memcpy(buf+24, &G.scene->audio.mixrate, 4); - i = G.scene->audio.mixrate * 4; + i = G.scene->audio.mixrate * SAMPLE_SIZE; memcpy(buf+28, &i, 4); buf[32] = 4; buf[33] = 0; buf[34] = 16; buf[35] = 0; i = totlen; @@ -192,7 +197,8 @@ void audio_mixdown() memset(buf+i, 0, 64); - CFRA=(int) ( ((float)(audio_pos-64)/( G.scene->audio.mixrate*4 ))*FPS ); + CFRA=(int) ( ((float)(audio_pos-64) + / ( G.scene->audio.mixrate*SAMPLE_SIZE ))*FPS ); audio_fill(buf+i, NULL, 64); if (G.order == B_ENDIAN) { @@ -226,7 +232,7 @@ void audiostream_fill(uint8_t *mixdown, int len) #ifndef DISABLE_SDL for (i = 0; i < len; i += 64) { CFRA = (int) ( ((float)(audio_pos-64) - /( audio_scene->audio.mixrate*4 )) + /( audio_scene->audio.mixrate * SAMPLE_SIZE )) * FPS ); audio_fill(mixdown + i, NULL, @@ -251,7 +257,7 @@ static void audio_levels(uint8_t *buf, int len, float db, fac = pow(10.0, ((-(db+audio_scene->audio.main))/20.0)); - for (i=0; iaudio.mixrate / (float)sound->sample->rate; - sound->streamlen = (int) ( (float)sound->sample->len * ratio * 2.0/((float)sound->sample->channels) ); + sound->streamlen = (int) ( (float)sound->sample->len * ratio + * AUDIO_CHANNELS + / ((float)sound->sample->channels) ); sound->stream = malloc((int) ((float)sound->streamlen * 1.05)); if (sound->sample->rate == G.scene->audio.mixrate) { - if (sound->sample->channels == 2) { - memcpy(sound->stream, sound->sample->data, sound->streamlen); + if (sound->sample->channels == AUDIO_CHANNELS) { + memcpy(sound->stream, + sound->sample->data, sound->streamlen); return; - } else { + } else if (sound->sample->channels == 1) { for (source = (signed short*)(sound->sample->data), dest = (signed short*)(sound->stream), i=0; - istreamlen/4; - dest += 2, source++, i++) dest[0] = dest[1] = source[0]; + istreamlen/SAMPLE_SIZE; + dest += 2, source++, i++) { + int j; + for (j = 0; j < AUDIO_CHANNELS; j++) { + dest[j] = source[0]; + } + } + return; + } else { + fprintf(stderr, "audio_makestream: " + "FIXME: can't handle number of channels %d\n", + sound->sample->channels); return; } } if (sound->sample->channels == 1) { - for (dest=(signed short*)(sound->stream), i=0, source=(signed short*)(sound->sample->data); - i<(sound->streamlen/4); dest+=2, i++) - dest[0] = dest[1] = source[(int)((float)i/ratio)]; + for (dest = (signed short*)(sound->stream), i=0, + source = (signed short*)(sound->sample->data); + i<(sound->streamlen/SAMPLE_SIZE); + dest += AUDIO_CHANNELS, i++) { + int j; + int s = source[(int)((float)i/ratio)]; + for (j = 0; j < AUDIO_CHANNELS; j++) { + dest[j] = s; + } + } } else if (sound->sample->channels == 2) { - for (dest=(signed short*)(sound->stream), i=0, source=(signed short*)(sound->sample->data); - i<(sound->streamlen/2); dest+=2, i+=2) { + for (dest=(signed short*)(sound->stream), i=0, + source = (signed short*)(sound->sample->data); + i<(sound->streamlen / 2); dest += AUDIO_CHANNELS, i+=2) { dest[1] = source[(int)((float)i/ratio)]; - dest[0] = source[(int)((float)i/ratio)+1]; + dest[0] = source[(int)((float)i/ratio)+1]; } } } @@ -315,24 +342,37 @@ static int fra2curpos(Sequence * seq, int cfra) seq->anim_startofs)) * ((float)audio_scene ->audio.mixrate) - * 4 )); + * SAMPLE_SIZE)); } static int curpos2fra(Sequence * seq, int curpos) { return ((int) floor( ATIME2FRA( - ((double) curpos) / 4 + ((double) curpos) / SAMPLE_SIZE /audio_scene->audio.mixrate))) - seq->anim_startofs + seq->start; } +static int get_curpos(Sequence * seq, int cfra) +{ + return audio_pos + + (((int)((FRA2TIME(((double) cfra) + - ((double) audio_scene->r.cfra) + - ((double) seq->start) + + ((double) seq->anim_startofs)) + * ((float)audio_scene->audio.mixrate) + * SAMPLE_SIZE ))) + & (~(SAMPLE_SIZE - 1))); /* has to be sample aligned! */ +} + static void do_audio_seq_ipo(Sequence * seq, int len, float * facf_start, - float * facf_end) + float * facf_end, int cfra) { - int cfra_start = curpos2fra(seq, seq->curpos); + int seq_curpos = get_curpos(seq, cfra); + int cfra_start = curpos2fra(seq, seq_curpos); int cfra_end = cfra_start + 1; - int ipo_curpos_start = fra2curpos(seq, curpos2fra(seq, seq->curpos)); + int ipo_curpos_start = fra2curpos(seq, curpos2fra(seq, seq_curpos)); int ipo_curpos_end = fra2curpos(seq, cfra_end); double ipo_facf_start; double ipo_facf_end; @@ -346,8 +386,8 @@ static void do_audio_seq_ipo(Sequence * seq, int len, float * facf_start, m = (ipo_facf_end- ipo_facf_start)/(ipo_curpos_end - ipo_curpos_start); - *facf_start = ipo_facf_start + (seq->curpos - ipo_curpos_start) * m; - *facf_end = ipo_facf_start + (seq->curpos + len-ipo_curpos_start) * m; + *facf_start = ipo_facf_start + (seq_curpos - ipo_curpos_start) * m; + *facf_end = ipo_facf_start + (seq_curpos + len-ipo_curpos_start) * m; } #endif @@ -361,20 +401,30 @@ static void audio_fill_ram_sound(Sequence *seq, void * mixdown, bSound* sound; float facf_start; float facf_end; + int seq_curpos = get_curpos(seq, cfra); + + /* catch corner case at the beginning of strip */ + if (seq_curpos < 0 && (seq_curpos + len > 0)) { + seq_curpos *= -1; + len -= seq_curpos; + sstream += seq_curpos; + seq_curpos = 0; + } sound = seq->sound; audio_makestream(sound); - if ((seq->curposstreamlen -len) && (seq->curpos>=0) && + if ((seq_curpos < sound->streamlen -len) && (seq_curpos >= 0) && (seq->startdisp <= cfra) && ((seq->enddisp) > cfra)) { if(seq->ipo && seq->ipo->curve.first) { - do_audio_seq_ipo(seq, len, &facf_start, &facf_end); + do_audio_seq_ipo(seq, len, &facf_start, &facf_end, + cfra); } else { facf_start = 1.0; facf_end = 1.0; } cvtbuf = malloc(len); - memcpy(cvtbuf, ((uint8_t*)sound->stream)+(seq->curpos & (~3)), len); + memcpy(cvtbuf, ((uint8_t*)sound->stream)+(seq_curpos), len); audio_levels(cvtbuf, len, seq->level, facf_start, facf_end, seq->pan); if (!mixdown) { @@ -384,7 +434,6 @@ static void audio_fill_ram_sound(Sequence *seq, void * mixdown, } free(cvtbuf); } - seq->curpos += len; } #endif @@ -396,12 +445,22 @@ static void audio_fill_hd_sound(Sequence *seq, uint8_t* cvtbuf; float facf_start; float facf_end; + int seq_curpos = get_curpos(seq, cfra); + + /* catch corner case at the beginning of strip */ + if (seq_curpos < 0 && (seq_curpos + len > 0)) { + seq_curpos *= -1; + len -= seq_curpos; + sstream += seq_curpos; + seq_curpos = 0; + } - if ((seq->curpos >= 0) && + if ((seq_curpos >= 0) && (seq->startdisp <= cfra) && ((seq->enddisp) > cfra)) { if(seq->ipo && seq->ipo->curve.first) { - do_audio_seq_ipo(seq, len, &facf_start, &facf_end); + do_audio_seq_ipo(seq, len, &facf_start, &facf_end, + cfra); } else { facf_start = 1.0; facf_end = 1.0; @@ -409,10 +468,10 @@ static void audio_fill_hd_sound(Sequence *seq, cvtbuf = malloc(len); sound_hdaudio_extract(seq->hdaudio, (short*) cvtbuf, - seq->curpos / 4, + seq_curpos / SAMPLE_SIZE, audio_scene->audio.mixrate, - 2, - len / 4); + AUDIO_CHANNELS, + len / SAMPLE_SIZE); audio_levels(cvtbuf, len, seq->level, facf_start, facf_end, seq->pan); if (!mixdown) { @@ -424,18 +483,15 @@ static void audio_fill_hd_sound(Sequence *seq, } free(cvtbuf); } - seq->curpos += len; } #endif #ifndef DISABLE_SDL static void audio_fill_seq(Sequence * seq, void * mixdown, - uint8_t *sstream, int len, int cfra, - int advance_only); + uint8_t *sstream, int len, int cfra); static void audio_fill_scene_strip(Sequence * seq, void * mixdown, - uint8_t *sstream, int len, int cfra, - int advance_only) + uint8_t *sstream, int len, int cfra) { Editing *ed; @@ -450,8 +506,7 @@ static void audio_fill_scene_strip(Sequence * seq, void * mixdown, audio_fill_seq(ed->seqbasep->first, mixdown, - sstream, len, sce_cfra, - advance_only); + sstream, len, sce_cfra); } /* restore */ @@ -461,8 +516,7 @@ static void audio_fill_scene_strip(Sequence * seq, void * mixdown, #ifndef DISABLE_SDL static void audio_fill_seq(Sequence * seq, void * mixdown, - uint8_t *sstream, int len, int cfra, - int advance_only) + uint8_t *sstream, int len, int cfra) { while(seq) { if (seq->type == SEQ_META && @@ -470,11 +524,7 @@ static void audio_fill_seq(Sequence * seq, void * mixdown, if (seq->startdisp <= cfra && seq->enddisp > cfra) { audio_fill_seq(seq->seqbase.first, mixdown, sstream, len, - cfra, advance_only); - } else { - audio_fill_seq(seq->seqbase.first, - mixdown, sstream, len, - cfra, 1); + cfra); } } if (seq->type == SEQ_SCENE @@ -485,42 +535,27 @@ static void audio_fill_seq(Sequence * seq, void * mixdown, if (seq->startdisp <= cfra && seq->enddisp > cfra) { audio_fill_scene_strip( seq, mixdown, sstream, len, - cfra, advance_only); - } else { - audio_fill_scene_strip( - seq, mixdown, sstream, len, - cfra, 1); + cfra); } } if ( (seq->type == SEQ_RAM_SOUND) && (seq->sound) && (!(seq->flag & SEQ_MUTE))) { - if (advance_only) { - seq->curpos += len; - } else { - audio_fill_ram_sound( - seq, mixdown, sstream, len, - cfra); - } + audio_fill_ram_sound(seq, mixdown, sstream, len, cfra); } if ( (seq->type == SEQ_HD_SOUND) && (!(seq->flag & SEQ_MUTE))) { - if (advance_only) { - seq->curpos += len; - } else { - if (!seq->hdaudio) { - char name[FILE_MAXDIR+FILE_MAXFILE]; - - BLI_join_dirfile(name, seq->strip->dir, seq->strip->stripdata->name); - BLI_convertstringcode(name, G.sce); + if (!seq->hdaudio) { + char name[FILE_MAXDIR+FILE_MAXFILE]; - seq->hdaudio= sound_open_hdaudio(name); - } - if (seq->hdaudio) { - audio_fill_hd_sound(seq, mixdown, - sstream, len, - cfra); - } + BLI_join_dirfile(name, seq->strip->dir, seq->strip->stripdata->name); + BLI_convertstringcode(name, G.sce); + + seq->hdaudio= sound_open_hdaudio(name); + } + if (seq->hdaudio) { + audio_fill_hd_sound(seq, mixdown, sstream, len, + cfra); } } seq = seq->next; @@ -542,10 +577,11 @@ static void audio_fill(void *mixdown, uint8_t *sstream, int len) if((ed) && (!(audio_scene->audio.flag & AUDIO_MUTE))) { seq = ed->seqbasep->first; audio_fill_seq(seq, mixdown, sstream, len, - audio_scene->r.cfra, 0); + audio_scene->r.cfra); } - audio_pos += len; + audio_pos += len; + if (audio_scrub > 0) { audio_scrub-= len; if (audio_scrub <= 0) { @@ -620,13 +656,6 @@ static int audiostream_play_seq(Sequence * seq, int startframe) } if ((seq->type == SEQ_RAM_SOUND) && (seq->sound)) { have_sound = 1; - seq->curpos = (int)( (FRA2TIME(((double) startframe) - - ((double) seq->start) + - ((double) - seq->anim_startofs)) - * ((float)audio_scene - ->audio.mixrate) - * 4 )); } if ((seq->type == SEQ_HD_SOUND)) { if (!seq->hdaudio) { @@ -636,20 +665,22 @@ static int audiostream_play_seq(Sequence * seq, int startframe) seq->hdaudio = sound_open_hdaudio(name); } - - seq->curpos = (int)( (FRA2TIME(((double) startframe) - - ((double) seq->start) + - ((double) - seq->anim_startofs)) - * ((float)audio_scene - ->audio.mixrate) - * 4 )); } seq= seq->next; } return have_sound; } +static void audiostream_reset_recurs_protection() +{ + Scene * sce = G.main->scene.first; + + while(sce) { + sce->r.scemode &= ~R_RECURS_PROTECTION; + sce= sce->id.next; + } +} + void audiostream_play(int startframe, uint32_t duration, int mixdown) { #ifndef DISABLE_SDL @@ -659,6 +690,8 @@ void audiostream_play(int startframe, uint32_t duration, int mixdown) audio_scene = G.scene; + audiostream_reset_recurs_protection(); + ed= audio_scene->ed; if(ed) { have_sound = -- cgit v1.2.3 From cdeb95e737f6995b3b4cb2ced1a966f787167c1b Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 11 Jun 2009 11:53:41 +0000 Subject: NLA SoC: RNA Fixes - Lower bound for start values has been expanded to -MAXFRAME, to avoid clipping problems when the strip is moved past frame 0 - Removed some obsolete (+ commented out) NLA wrapping in Object stuff --- source/blender/makesrna/intern/rna_nla.c | 6 +++--- source/blender/makesrna/intern/rna_object.c | 23 ----------------------- 2 files changed, 3 insertions(+), 26 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index b55b4e431fb..4b5c14aab82 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -47,13 +47,13 @@ static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) /* clamp value to lie within valid limits * - cannot start past the end of the strip + some flexibility threshold * - cannot start before the previous strip (if present) ends - * - minimum frame is 1.0f (this can be changed) + * - minimum frame is -MAXFRAME so that we don't get clipping on frame 0 */ if (data->prev) { CLAMP(value, data->prev->end, data->end-0.1f); } else { - CLAMP(value, 1, data->end); + CLAMP(value, -MAXFRAME, data->end); } data->start= value; } @@ -137,7 +137,7 @@ static void rna_NlaStrip_blend_out_set(PointerRNA *ptr, float value) static void rna_NlaStrip_action_start_frame_set(PointerRNA *ptr, float value) { NlaStrip *data= (NlaStrip*)ptr->data; - CLAMP(value, 1, data->actend); + CLAMP(value, -MAXFRAME, data->actend); data->actstart= value; } diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 08eca7b0528..edfaf5cb21a 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1069,29 +1069,6 @@ static StructRNA *rna_def_object(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Pose Mode", "Object with armature data is in pose mode."); - // XXX this stuff should be moved to AnimData... -/* - prop= RNA_def_property(srna, "nla_disable_path", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "nlaflag", OB_DISABLE_PATH); - RNA_def_property_ui_text(prop, "NLA Disable Path", "Disable path temporally, for editing cycles."); - - prop= RNA_def_property(srna, "nla_collapsed", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "nlaflag", OB_NLA_COLLAPSED); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "NLA Collapsed", ""); - - prop= RNA_def_property(srna, "nla_override", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "nlaflag", OB_NLA_OVERRIDE); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "NLA Override", ""); - - prop= RNA_def_property(srna, "nla_strips", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_sdna(prop, NULL, "nlastrips", NULL); - RNA_def_property_struct_type(prop, "UnknownType"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "NLA Strips", "NLA strips of the object."); -*/ - /* shape keys */ prop= RNA_def_property(srna, "shape_key_lock", PROP_BOOLEAN, PROP_NONE); -- cgit v1.2.3 From 776b8c0369300c0b76089acc577fd46882dd497c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 11 Jun 2009 11:54:56 +0000 Subject: sequencer patch from Xavier Thomas - allocate transform and crop on "use" - bring back the scopes drawing (histogram, vectorscope, luma) - tweak properties layout (need more) --- .../editors/space_sequencer/sequencer_draw.c | 4 +-- source/blender/makesrna/intern/rna_sequence.c | 30 ++++++++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index bd31d8d86ff..245076508a0 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -790,8 +790,8 @@ static void draw_image_seq(Scene *scene, ARegion *ar, SpaceSeq *sseq) if(ibuf->rect==NULL && ibuf->rect_float == NULL) return; - - switch(sseq->mainb != SEQ_DRAW_SEQUENCE) { + + switch(sseq->mainb) { case SEQ_DRAW_IMG_IMBUF: if (sseq->zebra != 0) { ibuf = make_zebra_view_from_ibuf(ibuf, sseq->zebra); diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index 10cfb47b385..754a3b44182 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -98,6 +98,7 @@ static void rna_SequenceEditor_channel_set(PointerRNA *ptr, int value) sort_seq(sce); } +/* properties that need to allocate structs */ static int rna_SequenceEditor_use_color_balance_set(PointerRNA *ptr, int value) { Sequence *seq= (Sequence*)ptr->data; @@ -131,6 +132,31 @@ static int rna_SequenceEditor_use_proxy_set(PointerRNA *ptr, int value) } } +static int rna_SequenceEditor_use_translation_set(PointerRNA *ptr, int value) +{ + Sequence *seq= (Sequence*)ptr->data; + if(value) { + seq->flag |= SEQ_USE_TRANSFORM; + if(seq->strip->transform == NULL) { + seq->strip->transform = MEM_callocN(sizeof(struct StripTransform), "StripTransform"); + } + } else { + seq->flag ^= SEQ_USE_TRANSFORM; + } +} + +static int rna_SequenceEditor_use_crop_set(PointerRNA *ptr, int value) +{ + Sequence *seq= (Sequence*)ptr->data; + if(value) { + seq->flag |= SEQ_USE_CROP; + if(seq->strip->crop == NULL) { + seq->strip->crop = MEM_callocN(sizeof(struct StripCrop), "StripCrop"); + } + } else { + seq->flag ^= SEQ_USE_CROP; + } +} /* name functions that ignore the first two characters */ static void rna_Sequence_name_get(PointerRNA *ptr, char *value) { @@ -546,8 +572,8 @@ static void rna_def_filter_video(StructRNA *srna) prop= RNA_def_property(srna, "use_translation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_TRANSFORM); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); // allocate transform RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing."); + RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_translation_set"); prop= RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "strip->transform"); @@ -555,8 +581,8 @@ static void rna_def_filter_video(StructRNA *srna) prop= RNA_def_property(srna, "use_crop", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_CROP); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); // allocate crop RNA_def_property_ui_text(prop, "Use Crop", "Crop image before processing."); + RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_crop_set"); prop= RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "strip->crop"); -- cgit v1.2.3 From db8b4cee565676658bf6042a05b763654769f3a2 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Thu, 11 Jun 2009 13:42:41 +0000 Subject: Bugfix for [#18911] Applied torque breaks rigid bodies in game engine --- .../Physics/Bullet/CcdPhysicsController.cpp | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index d22c09b4d3e..3e20203a4cc 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -1016,14 +1016,21 @@ void CcdPhysicsController::ApplyTorque(float torqueX,float torqueY,float torque } if (body) { - //workaround for incompatibility between 'DYNAMIC' game object, and angular factor - //a DYNAMIC object has some inconsistency: it has no angular effect due to collisions, but still has torque - const btVector3& angFac = body->getAngularFactor(); - btVector3 tmpFac(0,0,1); - body->setAngularFactor(tmpFac); - body->applyTorque(torque); - body->setAngularFactor(angFac); - } + if (m_cci.m_bRigid) + { + body->applyTorque(torque); + } + else + { + //workaround for incompatibility between 'DYNAMIC' game object, and angular factor + //a DYNAMIC object has some inconsistency: it has no angular effect due to collisions, but still has torque + const btVector3& angFac = body->getAngularFactor(); + btVector3 tmpFac(0,0,1); + body->setAngularFactor(tmpFac); + body->applyTorque(torque); + body->setAngularFactor(angFac); + } + } } } -- cgit v1.2.3 From 2c8fae1f8b0b791a82fd3dcc698e5b1ce69f5041 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Thu, 11 Jun 2009 16:59:59 +0000 Subject: 2.5: * Fixed some RNA properties Ranges. --- source/blender/makesrna/intern/rna_modifier.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index be1e6a317a2..fe5bd6ad727 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -378,14 +378,14 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna) prop= RNA_def_property(srna, "levels", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "levels"); - RNA_def_property_range(prop, 1, 20); + RNA_def_property_range(prop, 1, 6); RNA_def_property_ui_range(prop, 1, 6, 1, 0); RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to perform."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "renderLevels"); - RNA_def_property_range(prop, 1, 20); + RNA_def_property_range(prop, 1, 6); RNA_def_property_ui_range(prop, 1, 6, 1, 0); RNA_def_property_ui_text(prop, "Render Levels", "Number of subdivisions to perform when rendering."); @@ -669,14 +669,14 @@ static void rna_def_modifier_wave(BlenderRNA *brna) prop= RNA_def_property(srna, "start_position_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "startx"); - RNA_def_property_range(prop, FLT_MIN, FLT_MAX); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 100, 2); RNA_def_property_ui_text(prop, "Start Position X", ""); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); prop= RNA_def_property(srna, "start_position_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "starty"); - RNA_def_property_range(prop, FLT_MIN, FLT_MAX); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 100, 2); RNA_def_property_ui_text(prop, "Start Position Y", ""); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); @@ -717,13 +717,13 @@ static void rna_def_modifier_wave(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, FLT_MIN, FLT_MAX); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -2, 2, 10, 2); RNA_def_property_ui_text(prop, "Speed", ""); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, FLT_MIN, FLT_MAX); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -2, 2, 10, 2); RNA_def_property_ui_text(prop, "Height", ""); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); @@ -1042,7 +1042,7 @@ static void rna_def_modifier_displace(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, FLT_MIN, FLT_MAX); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 10, 2); RNA_def_property_ui_text(prop, "Strength", ""); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); @@ -1524,7 +1524,7 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) prop= RNA_def_property(srna, "subsurf_levels", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "subsurfLevels"); - RNA_def_property_range(prop, 0, 20); + RNA_def_property_range(prop, 0, 6); RNA_def_property_ui_range(prop, 0, 6, 1, 0); RNA_def_property_ui_text(prop, "Subsurf Levels", "Number of subdivisions that must be performed before extracting vertices' positions and normals."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); -- cgit v1.2.3 From 4e66f6d11f3a45fbb1d7537542d50caf622d0688 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 11 Jun 2009 17:21:27 +0000 Subject: 2.5 Added search-browse to the Python ID template. Also added icon/button for 'Add new'. (Note, we need icon for it). Also fixed bug in search menu closing too quick on mouse-release, when mouse was close to bottom of menu button. And removed annoying warning if ID pointer was zero. --- .../blender/editors/interface/interface_handlers.c | 3 +- .../blender/editors/interface/interface_intern.h | 1 + .../blender/editors/interface/interface_regions.c | 115 +++++++++-------- .../editors/interface/interface_templates.c | 140 +++++++++++++++------ source/blender/editors/interface/interface_utils.c | 1 + source/blender/editors/preview/previewrender.c | 65 +++++----- 6 files changed, 204 insertions(+), 121 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 74559b36c60..f8f0ebad700 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1263,7 +1263,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle /* exit on LMB only on RELEASE for searchbox, to mimic other popups, and allow multiple menu levels */ if(data->searchbox) - inbox= BLI_in_rcti(&data->searchbox->winrct, event->x, event->y); + inbox= ui_searchbox_inside(data->searchbox, event->x, event->y); if(event->val==KM_PRESS) { mx= event->x; @@ -1287,6 +1287,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle } } else if(inbox) { + printf("release inside \n"); button_activate_state(C, but, BUTTON_STATE_EXIT); retval= WM_UI_HANDLER_BREAK; } diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 18423434eef..08fa6434aa8 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -357,6 +357,7 @@ void ui_tooltip_free(struct bContext *C, struct ARegion *ar); /* searchbox for string button */ ARegion *ui_searchbox_create(struct bContext *C, struct ARegion *butregion, uiBut *but); +int ui_searchbox_inside(struct ARegion *ar, int x, int y); void ui_searchbox_update(struct bContext *C, struct ARegion *ar, uiBut *but, int reset); void ui_searchbox_event(struct bContext *C, struct ARegion *ar, uiBut *but, struct wmEvent *event); void ui_searchbox_apply(uiBut *but, struct ARegion *ar); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index f4b606dac72..31d0bf5d97d 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -520,6 +520,14 @@ static void ui_searchbox_butrect(rcti *rect, uiSearchboxData *data, int itemnr) } +/* x and y in screencoords */ +int ui_searchbox_inside(ARegion *ar, int x, int y) +{ + uiSearchboxData *data= ar->regiondata; + + return(BLI_in_rcti(&data->bbox, x-ar->winrct.xmin, y-ar->winrct.ymin)); +} + /* string validated to be of correct length (but->hardmax) */ void ui_searchbox_apply(uiBut *but, ARegion *ar) { @@ -699,71 +707,80 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) /* compute position */ - x1f= but->x1 - 5; /* align text with button */ - x2f= but->x2 + 5; /* symmetrical */ if(but->block->flag & UI_BLOCK_LOOP) { + /* this case is search menu inside other menu */ + /* we copy region size */ + + ar->winrct= butregion->winrct; + + /* widget rect, in region coords */ + data->bbox.xmin= MENU_SHADOW_SIDE; + data->bbox.xmax= (ar->winrct.xmax-ar->winrct.xmin) - MENU_SHADOW_SIDE; + data->bbox.ymin= MENU_SHADOW_BOTTOM; + data->bbox.ymax= (ar->winrct.ymax-ar->winrct.ymin) - MENU_SHADOW_BOTTOM; + /* check if button is lower half */ if( but->y2 < (but->block->minx+but->block->maxx)/2 ) { - y1f= but->y2; - y2f= y1f + uiSearchBoxhHeight(); + data->bbox.ymin += (but->y2-but->y1); } else { - y2f= but->y1; - y1f= y2f - uiSearchBoxhHeight(); + data->bbox.ymax -= (but->y2-but->y1); } } else { + x1f= but->x1 - 5; /* align text with button */ + x2f= but->x2 + 5; /* symmetrical */ y2f= but->y1; y1f= y2f - uiSearchBoxhHeight(); - } - /* minimal width */ - if(x2f - x1f < 150) x2f= x1f+150; // XXX arbitrary - - /* copy to int, gets projected if possible too */ - x1= x1f; y1= y1f; x2= x2f; y2= y2f; - - if(butregion) { - if(butregion->v2d.cur.xmin != butregion->v2d.cur.xmax) { - UI_view2d_to_region_no_clip(&butregion->v2d, x1f, y1f, &x1, &y1); - UI_view2d_to_region_no_clip(&butregion->v2d, x2f, y2f, &x2, &y2); + /* minimal width */ + if(x2f - x1f < 150) x2f= x1f+150; // XXX arbitrary + + /* copy to int, gets projected if possible too */ + x1= x1f; y1= y1f; x2= x2f; y2= y2f; + + if(butregion) { + if(butregion->v2d.cur.xmin != butregion->v2d.cur.xmax) { + UI_view2d_to_region_no_clip(&butregion->v2d, x1f, y1f, &x1, &y1); + UI_view2d_to_region_no_clip(&butregion->v2d, x2f, y2f, &x2, &y2); + } + + x1 += butregion->winrct.xmin; + x2 += butregion->winrct.xmin; + y1 += butregion->winrct.ymin; + y2 += butregion->winrct.ymin; } - x1 += butregion->winrct.xmin; - x2 += butregion->winrct.xmin; - y1 += butregion->winrct.ymin; - y2 += butregion->winrct.ymin; - } - - wm_window_get_size(CTX_wm_window(C), &winx, &winy); - - if(x2 > winx) { - /* super size */ - if(x2 > winx + x1) { - x2= winx; - x1= 0; + wm_window_get_size(CTX_wm_window(C), &winx, &winy); + + if(x2 > winx) { + /* super size */ + if(x2 > winx + x1) { + x2= winx; + x1= 0; + } + else { + x1 -= x2-winx; + x2= winx; + } } - else { - x1 -= x2-winx; - x2= winx; + if(y1 < 0) { + y1 += 36; + y2 += 36; } + + /* widget rect, in region coords */ + data->bbox.xmin= MENU_SHADOW_SIDE; + data->bbox.xmax= x2-x1 + MENU_SHADOW_SIDE; + data->bbox.ymin= MENU_SHADOW_BOTTOM; + data->bbox.ymax= y2-y1 + MENU_SHADOW_BOTTOM; + + /* region bigger for shadow */ + ar->winrct.xmin= x1 - MENU_SHADOW_SIDE; + ar->winrct.xmax= x2 + MENU_SHADOW_SIDE; + ar->winrct.ymin= y1 - MENU_SHADOW_BOTTOM; + ar->winrct.ymax= y2; } - if(y1 < 0) { - y1 += 36; - y2 += 36; - } - - /* widget rect, in region coords */ - data->bbox.xmin= MENU_SHADOW_SIDE; - data->bbox.xmax= x2-x1 + MENU_SHADOW_SIDE; - data->bbox.ymin= MENU_SHADOW_BOTTOM; - data->bbox.ymax= y2-y1 + MENU_SHADOW_BOTTOM; - - /* region bigger for shadow */ - ar->winrct.xmin= x1 - MENU_SHADOW_SIDE; - ar->winrct.xmax= x2 + MENU_SHADOW_SIDE; - ar->winrct.ymin= y1 - MENU_SHADOW_BOTTOM; - ar->winrct.ymax= y2; /* adds subwindow */ ED_region_init(C, ar); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 020d442bfe6..53238a306cd 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -78,9 +78,8 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) { TemplateID *template= (TemplateID*)arg_litem; PointerRNA idptr= RNA_property_pointer_get(&template->ptr, template->prop); - ID *idtest, *id= idptr.data; - ListBase *lb= wich_libbase(CTX_data_main(C), template->idtype); - int nr, event= GET_INT_FROM_POINTER(arg_event); + ID *id= idptr.data; + int event= GET_INT_FROM_POINTER(arg_event); if(event == UI_ID_BROWSE && template->browse == 32767) event= UI_ID_ADD_NEW; @@ -88,31 +87,9 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) event= UI_ID_OPEN; switch(event) { - case UI_ID_BROWSE: { - if(template->browse== -2) { - /* XXX implement or find a replacement - * activate_databrowse((ID *)G.buts->lockpoin, GS(id->name), 0, B_MESHBROWSE, &template->browse, do_global_buttons); */ - return; - } - if(template->browse < 0) - return; - - for(idtest=lb->first, nr=1; idtest; idtest=idtest->next, nr++) { - if(nr==template->browse) { - if(id == idtest) - return; - - id= idtest; - RNA_id_pointer_create(id, &idptr); - RNA_property_pointer_set(&template->ptr, template->prop, idptr); - RNA_property_update(C, &template->ptr, template->prop); - /* XXX */ - - break; - } - } + case UI_ID_BROWSE: + printf("warning, id browse shouldnt come here\n"); break; - } case UI_ID_DELETE: memset(&idptr, 0, sizeof(idptr)); RNA_property_pointer_set(&template->ptr, template->prop, idptr); @@ -148,10 +125,79 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) } } +/* ID Search browse menu, assign */ +static void id_search_call_cb(struct bContext *C, void *arg_litem, void *item) +{ + if(item) { + TemplateID *template= (TemplateID*)arg_litem; + PointerRNA idptr= RNA_property_pointer_get(&template->ptr, template->prop); + + RNA_id_pointer_create(item, &idptr); + RNA_property_pointer_set(&template->ptr, template->prop, idptr); + RNA_property_update(C, &template->ptr, template->prop); + } +} + +/* ID Search browse menu, do the search */ +static void id_search_cb(const struct bContext *C, void *arg_litem, char *str, uiSearchItems *items) +{ + TemplateID *template= (TemplateID*)arg_litem; + ListBase *lb= wich_libbase(CTX_data_main(C), template->idtype); + ID *id; + + for(id= lb->first; id; id= id->next) { + + if(BLI_strcasestr(id->name+2, str)) { + if(0==uiSearchItemAdd(items, id->name+2, id)) + break; + } + } +} + +/* ID Search browse menu, open */ +static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem) +{ + static char search[256]; + static TemplateID template; + wmEvent event; + wmWindow *win= CTX_wm_window(C); + uiBlock *block; + uiBut *but; + + /* clear initial search string, then all items show */ + search[0]= 0; + /* arg_litem is malloced, can be freed by parent button */ + template= *((TemplateID*)arg_litem); + + block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS); + uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1); + + /* fake button, it holds space for search items */ + uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); + + but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 0, 150, 19, ""); + uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb); + + uiBoundsBlock(block, 6); + uiBlockSetDirection(block, UI_DOWN); + uiEndBlock(C, block); + + event= *(win->eventstate); /* XXX huh huh? make api call */ + event.type= EVT_BUT_OPEN; + event.val= KM_PRESS; + event.customdata= but; + event.customdatafree= FALSE; + wm_event_add(win, &event); + + return block; +} + +/* ****************** */ + + static void template_header_ID(bContext *C, uiBlock *block, TemplateID *template, StructRNA *type) { uiBut *but; - TemplateID *duptemplate; PointerRNA idptr; ListBase *lb; @@ -165,6 +211,7 @@ static void template_header_ID(bContext *C, uiBlock *block, TemplateID *template uiBlockBeginAlign(block); if(template->flag & UI_ID_BROWSE) { + /* char *extrastr, *str; if((template->flag & UI_ID_ADD_NEW) && (template->flag & UI_ID_OPEN)) @@ -183,6 +230,8 @@ static void template_header_ID(bContext *C, uiBlock *block, TemplateID *template uiButSetNFunc(but, template_id_cb, duptemplate, SET_INT_IN_POINTER(UI_ID_BROWSE)); MEM_freeN(str); + */ + uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X, UI_UNIT_Y, "Browse ID data"); } /* text button with name */ @@ -193,18 +242,31 @@ static void template_header_ID(bContext *C, uiBlock *block, TemplateID *template name[0]= '\0'; but= uiDefButR(block, TEX, 0, name, 0, 0, UI_UNIT_X*6, UI_UNIT_Y, &idptr, "name", -1, 0, 0, -1, -1, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_RENAME)); - - /* delete button */ - if(template->flag & UI_ID_DELETE) { - if(template->unlinkop[0]) { - but= uiDefIconButO(block, BUT, template->unlinkop, WM_OP_EXEC_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL); - } - else { - but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); - uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_DELETE)); - } + } + + if(template->flag & UI_ID_ADD_NEW) { + int w= idptr.data?UI_UNIT_X:UI_UNIT_X*6; + + if(template->newop[0]) { + but= uiDefIconTextButO(block, BUT, template->newop, WM_OP_EXEC_REGION_WIN, ICON_ZOOMIN, "Add New", 0, 0, w, UI_UNIT_Y, NULL); + } + else { + but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, "Add New", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); + } + } + + /* delete button */ + if(idptr.data && (template->flag & UI_ID_DELETE)) { + if(template->unlinkop[0]) { + but= uiDefIconButO(block, BUT, template->unlinkop, WM_OP_EXEC_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL); + } + else { + but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_DELETE)); } } + uiBlockEndAlign(block); } @@ -1310,7 +1372,7 @@ void uiTemplatePreview(uiLayout *layout, ID *id) uiBlock *block; Material *ma; - if(!id || !ELEM4(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA)) { + if(id && !ELEM4(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA)) { printf("uiTemplatePreview: expected ID of type material, texture, lamp or world.\n"); return; } diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index e08aeb1b371..a75a3402774 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -203,6 +203,7 @@ void uiDefAutoButsRNA_single(const bContext *C, uiLayout *layout, PointerRNA *pt /***************************** ID Utilities *******************************/ +/* note, C code version, will be replaced with version in interface_templates.c */ typedef struct uiIDPoinParams { uiIDPoinFunc func; diff --git a/source/blender/editors/preview/previewrender.c b/source/blender/editors/preview/previewrender.c index 3ed4fa6bd0f..1435ca7290b 100644 --- a/source/blender/editors/preview/previewrender.c +++ b/source/blender/editors/preview/previewrender.c @@ -633,41 +633,42 @@ void BIF_previewrender_buts(Scene *scene, SpaceButs *sbuts) /* uses ROUNDBOX button in block to get the rect */ void ED_preview_draw(const bContext *C, void *idp, rcti *rect) { - ScrArea *sa= CTX_wm_area(C); - SpaceButs *sbuts= sa->spacedata.first; - RenderResult rres; - int newx= rect->xmax-rect->xmin, newy= rect->ymax-rect->ymin; - int ok= 0; - char name[32]; - - sprintf(name, "Preview %p", sa); - BLI_lock_malloc_thread(); - RE_GetResultImage(RE_GetRender(name), &rres); - - if(rres.rectf) { - - if( ABS(rres.rectx-newx)<2 && ABS(rres.recty-newy)<2 ) { - /* correct size, then black outline matches */ - rect->xmax= rect->xmin + rres.rectx; - rect->ymax= rect->ymin + rres.recty; + if(idp) { + ScrArea *sa= CTX_wm_area(C); + SpaceButs *sbuts= sa->spacedata.first; + RenderResult rres; + int newx= rect->xmax-rect->xmin, newy= rect->ymax-rect->ymin; + int ok= 0; + char name[32]; - glaDrawPixelsSafe(rect->xmin, rect->ymin, rres.rectx, rres.recty, rres.rectx, GL_RGBA, GL_FLOAT, rres.rectf); - ok= 1; + sprintf(name, "Preview %p", sa); + BLI_lock_malloc_thread(); + RE_GetResultImage(RE_GetRender(name), &rres); + + if(rres.rectf) { + + if( ABS(rres.rectx-newx)<2 && ABS(rres.recty-newy)<2 ) { + /* correct size, then black outline matches */ + rect->xmax= rect->xmin + rres.rectx; + rect->ymax= rect->ymin + rres.recty; + + glaDrawPixelsSafe(rect->xmin, rect->ymin, rres.rectx, rres.recty, rres.rectx, GL_RGBA, GL_FLOAT, rres.rectf); + ok= 1; + } } - } - BLI_unlock_malloc_thread(); + BLI_unlock_malloc_thread(); - /* check for spacetype... */ - if(sbuts->spacetype==SPACE_BUTS && sbuts->preview) { - sbuts->preview= 0; - ok= 0; - } - - if(ok==0) { - printf("added shader job\n"); - ED_preview_shader_job(C, sa, idp, newx, newy); - } - + /* check for spacetype... */ + if(sbuts->spacetype==SPACE_BUTS && sbuts->preview) { + sbuts->preview= 0; + ok= 0; + } + + if(ok==0) { + printf("added shader job\n"); + ED_preview_shader_job(C, sa, idp, newx, newy); + } + } } /* *************************** Preview for 3d window *********************** */ -- cgit v1.2.3 From a4175684b9ce32f24ba86e6e7c73c738c096e521 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Thu, 11 Jun 2009 18:19:08 +0000 Subject: 2.5 RNA: * Tooltip updates by William Reynish. Thanks! --- source/blender/makesrna/intern/rna_camera.c | 2 +- source/blender/makesrna/intern/rna_material.c | 2 +- source/blender/makesrna/intern/rna_scene.c | 80 +++++++++++++-------------- source/blender/makesrna/intern/rna_texture.c | 2 +- source/blender/makesrna/intern/rna_world.c | 44 +++++++-------- 5 files changed, 65 insertions(+), 65 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index bee8a21ad7d..e64f58e9a9c 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -62,7 +62,7 @@ void RNA_def_camera(BlenderRNA *brna) /* Number values */ - prop= RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "passepartalpha"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view."); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 7e66c9fb5e5..a5dbb63adf2 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -123,7 +123,7 @@ static void rna_def_material_mtex(BlenderRNA *brna) {TEXCO_GLOB, "GLOBAL", "Global", "Uses global coordinates for the texture coordinates."}, {TEXCO_OBJECT, "OBJECT", "Object", "Uses linked object's coordinates for texture coordinates."}, {TEXCO_UV, "UV", "UV", "Uses UV coordinates for texture coordinates."}, - {TEXCO_ORCO, "ORCO", "Orco", "Uses the original undeformed coordinates of the object."}, + {TEXCO_ORCO, "ORCO", "Generated", "Uses the original undeformed coordinates of the object."}, {TEXCO_STRAND, "STRAND", "Strand", "Uses normalized strand texture coordinate (1D)."}, {TEXCO_STICKY, "STICKY", "Sticky", "Uses mesh's sticky coordinates for the texture coordinates."}, {TEXCO_WINDOW, "WINDOW", "Window", "Uses screen coordinates as texture coordinates."}, diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 6001757dfbd..3907a633e3d 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -213,8 +213,8 @@ void rna_def_scene_render_data(BlenderRNA *brna) {0, NULL, NULL, NULL}}; static EnumPropertyItem threads_mode_items[] = { - {0, "THREADS_AUTO", "Auto-detect", ""}, - {R_FIXED_THREADS, "THREADS_FIXED", "Fixed Number", ""}, + {0, "THREADS_AUTO", "Auto-detect", "Automatically determine the number of threads, based on CPUs"}, + {R_FIXED_THREADS, "THREADS_FIXED", "Fixed", "Manually determine the number of threads"}, {0, NULL, NULL, NULL}}; static EnumPropertyItem stamp_font_size_items[] = { @@ -243,9 +243,9 @@ void rna_def_scene_render_data(BlenderRNA *brna) {R_RAWTGA, "RAWTARGA", "Targa Raw", ""}, {R_PNG, "PNG", "PNG", ""}, //{R_DDS, "DDS", "DDS", ""}, // XXX not yet implemented -#ifdef WITH_OPENJPEG +//#ifdef WITH_OPENJPEG {R_JP2, "JPEG2000", "JPEG 2000", ""}, -#endif +//#endif {R_BMP, "BMP", "BMP", ""}, {R_JPEG90, "JPEG", "JPEG", ""}, {R_HAMX, "HAMX", "HamX", ""}, @@ -256,14 +256,14 @@ void rna_def_scene_render_data(BlenderRNA *brna) #ifdef __sgi {R_MOVIE, "MOVIE", "Movie", ""}, #endif -#ifdef WITH_OPENEXR +//#ifdef WITH_OPENEXR {R_OPENEXR, "OPENEXR", "OpenEXR", ""}, {R_MULTILAYER, "MULTILAYER", "MultiLayer", ""}, -#endif +//#endif {R_TIFF, "TIFF", "TIFF", ""}, // XXX only with G.have_libtiff {0, NULL, NULL, NULL}}; -#ifdef WITH_OPENEXR +//#ifdef WITH_OPENEXR static EnumPropertyItem exr_codec_items[] = { {0, "NONE", "None", ""}, {1, "PXR24", "Pxr24 (lossy)", ""}, @@ -271,9 +271,9 @@ void rna_def_scene_render_data(BlenderRNA *brna) {3, "PIZ", "PIZ (lossless)", ""}, {4, "RLE", "RLE (lossless)", ""}, {0, NULL, NULL, NULL}}; -#endif +//#endif -#ifdef WITH_OPENJPEG +//#ifdef WITH_OPENJPEG static EnumPropertyItem jp2_preset_items[] = { {0, "NO_PRESET", "No Preset", ""}, {1, "R_JPEG2K_CINE_PRESET", "Cinema 24fps 2048x1080", ""}, @@ -290,7 +290,7 @@ void rna_def_scene_render_data(BlenderRNA *brna) {R_JPEG2K_12BIT, "16", "16", ""}, {R_JPEG2K_16BIT, "32", "32", ""}, {0, NULL, NULL, NULL}}; -#endif +//#endif /* #ifdef WITH_FFMPEG @@ -338,7 +338,7 @@ void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "planes"); RNA_def_property_enum_items(prop, color_mode_items); - RNA_def_property_ui_text(prop, "Color Mode", "What Color Mode images are saved in (BW, RGB, RGBA)"); + RNA_def_property_ui_text(prop, "Color Mode", "Choose BW for saving greyscale images, RGB for saving red, green and blue channels, AND RGBA for saving red, green, blue + alpha channels"); prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "xsch"); @@ -355,7 +355,7 @@ void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE); RNA_def_property_int_sdna(prop, NULL, "size"); RNA_def_property_ui_range(prop, 1, 100, 10, 1); - RNA_def_property_ui_text(prop, "Resolution %", "Preview scale for render resolution"); + RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution"); prop= RNA_def_property(srna, "parts_x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "xparts"); @@ -386,33 +386,33 @@ void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "quality"); RNA_def_property_range(prop, 1, 100); - RNA_def_property_ui_text(prop, "Quality", "Quality setting for JPEG images, AVI Jpeg and SGI movies."); + RNA_def_property_ui_text(prop, "Quality", "Quality of JPEG images, AVI Jpeg and SGI movies."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); /* Tiff */ prop= RNA_def_property(srna, "tiff_bit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_TIFF_16BIT); - RNA_def_property_ui_text(prop, "16 Bit", "Save 16 bit per channel TIFF"); + RNA_def_property_ui_text(prop, "16 Bit", "Save TIFF with 16 bits per channel"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); /* Cineon and DPX */ prop= RNA_def_property(srna, "cineon_log", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_CINEON_LOG); - RNA_def_property_ui_text(prop, "Log", "Convert to log color space"); + RNA_def_property_ui_text(prop, "Log", "Convert to logarithmic color space"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "cineon_black", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "cineonblack"); RNA_def_property_range(prop, 0, 1024); - RNA_def_property_ui_text(prop, "B", "Log conversion reference black"); + RNA_def_property_ui_text(prop, "B", "Log conversion reference blackpoint"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "cineon_white", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "cineonwhite"); RNA_def_property_range(prop, 0, 1024); - RNA_def_property_ui_text(prop, "W", "Log conversion reference white"); + RNA_def_property_ui_text(prop, "W", "Log conversion reference whitepoint"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "cineon_gamma", PROP_FLOAT, PROP_NONE); @@ -421,13 +421,13 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "G", "Log conversion gamma"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); -#ifdef WITH_OPENEXR +//#ifdef WITH_OPENEXR /* OpenEXR */ prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "quality"); RNA_def_property_enum_items(prop, exr_codec_items); - RNA_def_property_ui_text(prop, "Codec", "Set codec settings for OpenEXR"); + RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "exr_half", PROP_BOOLEAN, PROP_NONE); @@ -442,11 +442,11 @@ void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "exr_preview", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG); - RNA_def_property_ui_text(prop, "Preview", "When animation render, save JPG preview images in same directory"); + RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); -#endif +//#endif -#ifdef WITH_OPENJPEG +//#ifdef WITH_OPENJPEG /* Jpeg 2000 */ prop= RNA_def_property(srna, "jpeg_preset", PROP_ENUM, PROP_NONE); @@ -458,14 +458,14 @@ void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "jpeg_depth", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "jp2_depth"); RNA_def_property_enum_items(prop, jp2_depth_items); - RNA_def_property_ui_text(prop, "Depth", ""); + RNA_def_property_ui_text(prop, "Depth", "Bit depth per channel"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "jpeg_ycc", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC); - RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance instead of RGB color channels"); + RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); -#endif +//#endif #ifdef WITH_FFMPEG /* FFMPEG Video*/ @@ -556,13 +556,13 @@ void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "fps", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "frs_sec"); RNA_def_property_range(prop, 1, 120); - RNA_def_property_ui_text(prop, "FPS", "Frames per second."); + RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "frs_sec_base"); RNA_def_property_range(prop, 0.1f, 120.0f); - RNA_def_property_ui_text(prop, "FPS Base", "Frames per second base"); + RNA_def_property_ui_text(prop, "FPS Base", "Framerate base"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE); @@ -574,7 +574,7 @@ void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "pixel_filter", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "filtertype"); RNA_def_property_enum_items(prop, pixel_filter_items); - RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining AA samples."); + RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE); @@ -592,33 +592,33 @@ void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ocres"); RNA_def_property_enum_items(prop, octree_resolution_items); - RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator - use higher resolutions for larger scenes."); + RNA_def_property_ui_text(prop, "Octree Resolution", "Resolution of raytrace accelerator. Use higher resolutions for larger scenes."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "antialiasing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA); - RNA_def_property_ui_text(prop, "Anti-Aliasing", "Renders and combines multiple samples per pixel to prevent aliasing."); + RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "osa"); RNA_def_property_enum_items(prop, fixed_oversample_items); - RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "The number of fixed samples per pixel for anti-aliasing."); + RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "fields", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS); - RNA_def_property_ui_text(prop, "Fields", "Renders image to two fields per frame, for interlaced TV display."); + RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, field_order_items); - RNA_def_property_ui_text(prop, "Field Order", ""); + RNA_def_property_ui_text(prop, "Field Order", "Order of video fields. Select which lines get rendered first, to create smooth motion for TV output"); prop= RNA_def_property(srna, "fields_still", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL); - RNA_def_property_ui_text(prop, "Fields Still", "Disables the time difference between fields."); + RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "render_shadows", PROP_BOOLEAN, PROP_NONE); @@ -682,7 +682,7 @@ void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, threads_mode_items); - RNA_def_property_ui_text(prop, "Threads Mode", ""); + RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used"); prop= RNA_def_property(srna, "motion_blur", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR); @@ -737,12 +737,12 @@ void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "save_buffers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE); - RNA_def_property_ui_text(prop, "Save Buffers","Save tiles for all RenderLayers and used SceneNodes to files in the temp directory (saves memory, allows Full Sampling)."); + RNA_def_property_ui_text(prop, "Save Buffers","Save tiles for all RenderLayers and SceneNodes to files in the temp directory (saves memory, allows Full Sampling)."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "full_sample", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE); - RNA_def_property_ui_text(prop, "Full Sample","Saves for every OSA sample the entire RenderLayer results (Higher quality sampling but slower)."); + RNA_def_property_ui_text(prop, "Full Sample","Save for every anti-aliasing sample the entire RenderLayer results. This solves anti-aliasing issues with compositing"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "backbuf", PROP_BOOLEAN, PROP_NONE); @@ -818,19 +818,19 @@ void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "stamp_font_size", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "stamp_font_id"); RNA_def_property_enum_items(prop, stamp_font_size_items); - RNA_def_property_ui_text(prop, "Stamp Font Size", "Size of the font used when rendering stamp info text"); + RNA_def_property_ui_text(prop, "Stamp Font Size", "Size of the font used when rendering stamp text"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "stamp_foreground", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "fg_stamp"); RNA_def_property_array(prop, 4); - RNA_def_property_ui_text(prop, "Stamp Foreground", ""); + RNA_def_property_ui_text(prop, "Stamp Foreground", "Stamp text color"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "bg_stamp"); RNA_def_property_array(prop, 4); - RNA_def_property_ui_text(prop, "Stamp Background", ""); + RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); } diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 360a0938bb2..86278c53eef 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1120,7 +1120,7 @@ static void rna_def_texture(BlenderRNA *brna) {TEX_BLEND, "BLEND", "Blend", ""}, {TEX_STUCCI, "STUCCI", "Stucci", ""}, {TEX_NOISE, "NOISE", "Noise", ""}, - {TEX_IMAGE, "IMAGE", "Image", ""}, + {TEX_IMAGE, "IMAGE", "Image/Movie", ""}, {TEX_PLUGIN, "PLUGIN", "Plugin", ""}, {TEX_ENVMAP, "ENVIRONMENT_MAP", "Environment Map", ""}, {TEX_MUSGRAVE, "MUSGRAVE", "Musgrave", ""}, diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 46a7ef139d5..697efc88af1 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -89,19 +89,19 @@ static void rna_def_world_mtex(BlenderRNA *brna) /* map to */ prop= RNA_def_property(srna, "map_to_blend", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_BLEND); - RNA_def_property_ui_text(prop, "Map To Blend", "Causes the texture to affect the color progression of the background."); + RNA_def_property_ui_text(prop, "Map To Blend", "Affect the color progression of the background."); prop= RNA_def_property(srna, "map_to_horizon", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_HORIZ); - RNA_def_property_ui_text(prop, "Map To Horizon", "Causes the texture to affect the color of the horizon."); + RNA_def_property_ui_text(prop, "Map To Horizon", "Affect the color of the horizon."); prop= RNA_def_property(srna, "map_to_zenith_up", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENUP); - RNA_def_property_ui_text(prop, "Map To Zenith Up", "Causes the texture to affect the color of the zenith above."); + RNA_def_property_ui_text(prop, "Map To Zenith Up", "Affect the color of the zenith above."); prop= RNA_def_property(srna, "map_to_zenith_down", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENDOWN); - RNA_def_property_ui_text(prop, "Map To Zenith Down", "Causes the texture to affect the color of the zenith below."); + RNA_def_property_ui_text(prop, "Map To Zenith Down", "Affect the color of the zenith below."); /* unused prop= RNA_def_property(srna, "map_to_mist", PROP_BOOLEAN, PROP_NONE); @@ -111,7 +111,7 @@ static void rna_def_world_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "texco"); RNA_def_property_enum_items(prop, texco_items); - RNA_def_property_ui_text(prop, "Texture Coordinates", "Textures coordinates used to map the texture with."); + RNA_def_property_ui_text(prop, "Texture Coordinates", "Texture coordinates used to map the texture onto the background."); prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "object"); @@ -155,7 +155,7 @@ static void rna_def_ambient_occlusion(BlenderRNA *brna) prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_AMB_OCC); - RNA_def_property_ui_text(prop, "Enabled", ""); + RNA_def_property_ui_text(prop, "Enabled", "Use Ambient Occlusion to add light based on distance between elements, creating the illusion of omnipresent light"); prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aodist"); @@ -165,10 +165,10 @@ static void rna_def_ambient_occlusion(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "aodistfac"); RNA_def_property_ui_text(prop, "Strength", "Distance attenuation factor, the higher, the 'shorter' the shadows."); - prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "aoenergy"); RNA_def_property_ui_range(prop, 0, 10, 0.1, 3); - RNA_def_property_ui_text(prop, "Energy", "Global energy scale for ambient occlusion."); + RNA_def_property_ui_text(prop, "Energy", "Amount of enerygy generated by ambient occlusion."); prop= RNA_def_property(srna, "bias", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aobias"); @@ -207,17 +207,17 @@ static void rna_def_ambient_occlusion(BlenderRNA *brna) prop= RNA_def_property(srna, "samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "aosamp"); RNA_def_property_range(prop, 1, 32); - RNA_def_property_ui_text(prop, "Samples", ""); + RNA_def_property_ui_text(prop, "Samples", "Amount of ray samples. Higher values give smoother results and longer rendering times"); prop= RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "aomix"); RNA_def_property_enum_items(prop, blend_mode_items); - RNA_def_property_ui_text(prop, "Blend Mode", "Blending mode for how AO mixes with material shading."); + RNA_def_property_ui_text(prop, "Blend Mode", "Defines how AO mixes with material shading."); prop= RNA_def_property(srna, "color", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "aocolor"); RNA_def_property_enum_items(prop, prop_color_items); - RNA_def_property_ui_text(prop, "Color", ""); + RNA_def_property_ui_text(prop, "Color", "Defines the color of the AO light"); prop= RNA_def_property(srna, "sample_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ao_samp_method"); @@ -253,34 +253,34 @@ static void rna_def_world_mist(BlenderRNA *brna) prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_MIST); - RNA_def_property_ui_text(prop, "Enabled", "Enable mist, occluding objects with the environment color as they are further away."); + RNA_def_property_ui_text(prop, "Enabled", "Occlude objects with the environment color as they are further away."); prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "misi"); RNA_def_property_range(prop, 0, 1); - RNA_def_property_ui_text(prop, "Intensity", "Intensity of the mist."); + RNA_def_property_ui_text(prop, "Intensity", "Intensity of the mist effect."); prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "miststa"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 10000, 10, 2); - RNA_def_property_ui_text(prop, "Start", "Starting distance of the mist."); + RNA_def_property_ui_text(prop, "Start", "Starting distance of the mist, measured from the camera"); prop= RNA_def_property(srna, "depth", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mistdist"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 10000, 10, 2); - RNA_def_property_ui_text(prop, "Depth", "Depth of the mist."); + RNA_def_property_ui_text(prop, "Depth", "The distance over which the mist effect fades in"); prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "misthi"); RNA_def_property_range(prop, 0, 100); - RNA_def_property_ui_text(prop, "Height", "Factor for a less dense mist with increasing height."); + RNA_def_property_ui_text(prop, "Height", "Control how much mist density decreases with height"); prop= RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mistype"); RNA_def_property_enum_items(prop, falloff_items); - RNA_def_property_ui_text(prop, "Falloff", "Falloff method for mist."); + RNA_def_property_ui_text(prop, "Falloff", "Type of transition used to fade mist"); } static void rna_def_world_stars(BlenderRNA *brna) @@ -319,7 +319,7 @@ static void rna_def_world_stars(BlenderRNA *brna) prop= RNA_def_property(srna, "color_randomization", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "starcolnoise"); RNA_def_property_range(prop, 0, 1); - RNA_def_property_ui_text(prop, "Color Randomization", "Randomizes star color."); + RNA_def_property_ui_text(prop, "Color Randomization", "Randomize star colors."); RNA_def_property_update(prop, NC_WORLD, NULL); /* unused @@ -377,22 +377,22 @@ void RNA_def_world(BlenderRNA *brna) prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "range"); RNA_def_property_range(prop, 0.2, 5.0); - RNA_def_property_ui_text(prop, "Range", "The color amount that will be mapped on color 1.0."); + RNA_def_property_ui_text(prop, "Range", "The color rage that will be mapped to 0-1"); /* sky type */ prop= RNA_def_property(srna, "blend_sky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYBLEND); - RNA_def_property_ui_text(prop, "Blend Sky", "Renders background with natural progression from horizon to zenith."); + RNA_def_property_ui_text(prop, "Blend Sky", "Render background with natural progression from horizon to zenith."); RNA_def_property_update(prop, NC_WORLD, NULL); prop= RNA_def_property(srna, "paper_sky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYPAPER); - RNA_def_property_ui_text(prop, "Paper Sky", "Flattens blend or texture coordinates."); + RNA_def_property_ui_text(prop, "Paper Sky", "Flatten blend or texture coordinates."); RNA_def_property_update(prop, NC_WORLD, NULL); prop= RNA_def_property(srna, "real_sky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYREAL); - RNA_def_property_ui_text(prop, "Real Sky", "Renders background with a real horizon."); + RNA_def_property_ui_text(prop, "Real Sky", "Render background with a real horizon, relative to the camera angle."); RNA_def_property_update(prop, NC_WORLD, NULL); /* physics */ -- cgit v1.2.3 From ec8b2593ecdee9493210df0e6f9c4dbbcb2a1985 Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Thu, 11 Jun 2009 21:43:59 +0000 Subject: Smal tweak to allow the user set a kerning value. This commit add two option to the blenfont library: 1) BLF_FONT_KERNING This enable the kerning information that come with the font, by default this option is disable and still don't have a UI for change. 2) BLF USER_KERNING This allow the user set a kerning value to by apply for every character, by default this option is enable but all the font have a kerning value of zero. Ton I add this option to the style with a default value of 1. Access from: Outliner -> User Preferences -> Style -> FontStyle -> Kerning --- source/blender/blenfont/BLF_api.h | 4 ++- source/blender/blenfont/intern/blf.c | 9 ++++++ source/blender/blenfont/intern/blf_font.c | 35 ++++++++++++++++++---- source/blender/blenfont/intern/blf_glyph.c | 12 ++++++-- .../blender/blenfont/intern/blf_internal_types.h | 3 ++ source/blender/editors/interface/interface_style.c | 5 ++++ source/blender/makesdna/DNA_userdef_types.h | 2 ++ source/blender/makesrna/intern/rna_userdef.c | 6 +++- 8 files changed, 67 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index b5a61f2727f..d1d802622ea 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -85,7 +85,7 @@ float BLF_height_default(char *str); void BLF_rotation(float angle); void BLF_clipping(float xmin, float ymin, float xmax, float ymax); void BLF_blur(int size); - +void BLF_kerning(int space); void BLF_enable(int option); void BLF_disable(int option); @@ -117,6 +117,8 @@ void BLF_dir_free(char **dirs, int count); /* font->flags. */ #define BLF_ROTATION (1<<0) #define BLF_CLIPPING (1<<1) +#define BLF_FONT_KERNING (1<<2) +#define BLF_USER_KERNING (1<<3) /* font->mode. */ #define BLF_MODE_TEXTURE 0 diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 14bc6a33b72..ffb845f7888 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -491,3 +491,12 @@ void BLF_mode(int mode) if (font) font->mode= mode; } + +void BLF_kerning(int space) +{ + FontBLF *font; + + font= global_font[global_font_cur]; + if (font) + font->kerning= space; +} diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 1a96dbc13bc..df77aee70e8 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -100,7 +100,7 @@ void blf_font_draw(FontBLF *font, char *str) GlyphBLF *g, *g_prev; FT_Vector delta; FT_UInt glyph_index, g_prev_index; - int pen_x, pen_y; + int pen_x, pen_y, old_pen_x; int i, has_kerning; if (!font->glyph_cache) @@ -138,12 +138,24 @@ void blf_font_draw(FontBLF *font, char *str) else if (font->mode == BLF_MODE_TEXTURE && (!g->tex_data)) g= blf_glyph_add(font, glyph_index, c); - if (has_kerning && g_prev) { + if ((font->flags & BLF_FONT_KERNING) && has_kerning && g_prev) { + old_pen_x= pen_x; delta.x= 0; delta.y= 0; FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta); pen_x += delta.x >> 6; + + if (pen_x < old_pen_x) + pen_x= old_pen_x; + } + + if (font->flags & BLF_USER_KERNING) { + old_pen_x= pen_x; + pen_x += font->kerning; + + if (pen_x < old_pen_x) + pen_x= old_pen_x; } /* do not return this loop if clipped, we want every character tested */ @@ -162,7 +174,7 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) FT_Vector delta; FT_UInt glyph_index, g_prev_index; rctf gbox; - int pen_x, pen_y; + int pen_x, pen_y, old_pen_x; int i, has_kerning; if (!font->glyph_cache) @@ -205,12 +217,24 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) else if (font->mode == BLF_MODE_TEXTURE && (!g->tex_data)) g= blf_glyph_add(font, glyph_index, c); - if (has_kerning && g_prev) { + if ((font->flags & BLF_FONT_KERNING) && has_kerning && g_prev) { + old_pen_x= pen_x; delta.x= 0; delta.y= 0; FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta); pen_x += delta.x >> 6; + + if (pen_x < old_pen_x) + old_pen_x= pen_x; + } + + if (font->flags & BLF_USER_KERNING) { + old_pen_x= pen_x; + pen_x += font->kerning; + + if (pen_x < old_pen_x) + old_pen_x= pen_x; } gbox.xmin= g->box.xmin + pen_x; @@ -294,9 +318,10 @@ void blf_font_fill(FontBLF *font) font->clip_rec.xmax= 0.0f; font->clip_rec.ymin= 0.0f; font->clip_rec.ymax= 0.0f; - font->flags= 0; + font->flags= BLF_USER_KERNING; font->dpi= 0; font->size= 0; + font->kerning= 0; font->cache.first= NULL; font->cache.last= NULL; font->glyph_cache= NULL; diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 142d2145ab2..33a435cc5be 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -213,7 +213,11 @@ GlyphBLF *blf_glyph_texture_add(FontBLF *font, FT_UInt index, unsigned int c) else do_new= 1; - err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); + if (font->flags & BLF_FONT_KERNING) + err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_BITMAP); + else + err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); + if (err) return(NULL); @@ -328,7 +332,11 @@ GlyphBLF *blf_glyph_bitmap_add(FontBLF *font, FT_UInt index, unsigned int c) else do_new= 1; - err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); + if (font->flags & BLF_FONT_KERNING) + err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_BITMAP); + else + err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); + if (err) return(NULL); diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h index 1c55499b568..d200d910020 100644 --- a/source/blender/blenfont/intern/blf_internal_types.h +++ b/source/blender/blenfont/intern/blf_internal_types.h @@ -167,6 +167,9 @@ typedef struct FontBLF { /* font size. */ int size; + /* kerning space, user setting. */ + int kerning; + /* max texture size. */ int max_tex_size; diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 62a4c01bc6c..a3959327ccd 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -91,6 +91,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->paneltitle.uifont_id= UIFONT_DEFAULT; style->paneltitle.points= 13; + style->paneltitle.kerning= 1; style->paneltitle.shadow= 5; style->paneltitle.shadx= 2; style->paneltitle.shady= -2; @@ -99,6 +100,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->grouplabel.uifont_id= UIFONT_DEFAULT; style->grouplabel.points= 12; + style->grouplabel.kerning= 1; style->grouplabel.shadow= 3; style->grouplabel.shadx= 1; style->grouplabel.shady= -1; @@ -106,6 +108,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->widgetlabel.uifont_id= UIFONT_DEFAULT; style->widgetlabel.points= 11; + style->widgetlabel.kerning= 1; style->widgetlabel.shadow= 3; style->widgetlabel.shadx= 1; style->widgetlabel.shady= -1; @@ -114,6 +117,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->widget.uifont_id= UIFONT_DEFAULT; style->widget.points= 11; + style->widget.kerning= 1; style->widget.shadowalpha= 0.25f; style->columnspace= 5; @@ -263,5 +267,6 @@ void uiStyleFontSet(uiFontStyle *fs) BLF_set(font->blf_id); BLF_size(fs->points, U.dpi); + BLF_kerning(fs->kerning); } diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 022e1cef840..c99992cb126 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -66,6 +66,8 @@ typedef struct uiFont { typedef struct uiFontStyle { short uifont_id; /* saved in file, 0 is default */ short points; /* actual size depends on 'global' dpi */ + short kerning; /* kerning space between characters. */ + char pad[6]; short italic, bold; /* style hint */ short shadow; /* value is amount of pixels blur */ short shadx, shady; /* shadow offset in pixels */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index e0d3201a5e7..1963e48b00f 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -135,7 +135,11 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna) prop= RNA_def_property(srna, "points", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 6, 48); RNA_def_property_ui_text(prop, "Points", ""); - + + prop= RNA_def_property(srna, "kerning", PROP_INT, PROP_NONE); + RNA_def_property_range(prop, -5, 5); + RNA_def_property_ui_text(prop, "Kerning", ""); + prop= RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 5); RNA_def_property_ui_text(prop, "Shadow Size", "Shadow size in pixels (0, 3 and 5 supported)"); -- cgit v1.2.3 From 642fea299b7ce108783d1075c6c1a3d94eab3f7d Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Thu, 11 Jun 2009 22:21:00 +0000 Subject: == Sequencer == This fixes: [#18894] Scene iterfer with movie in sequencer (the real use cases that also triggered that bug are fixed with the previous commit) --- source/blender/src/seqaudio.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') diff --git a/source/blender/src/seqaudio.c b/source/blender/src/seqaudio.c index a464b7d71e1..91913377775 100644 --- a/source/blender/src/seqaudio.c +++ b/source/blender/src/seqaudio.c @@ -679,6 +679,9 @@ static void audiostream_reset_recurs_protection() sce->r.scemode &= ~R_RECURS_PROTECTION; sce= sce->id.next; } + /* fix for silly case, when people try testing with + the same scene ... */ + audio_scene->r.scemode |= R_RECURS_PROTECTION; } void audiostream_play(int startframe, uint32_t duration, int mixdown) -- cgit v1.2.3 From 4f9846b6a13184c504682853beb2647b4a77e9ac Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 12 Jun 2009 02:49:21 +0000 Subject: NLA SoC: Fixes for crashes when selecting keyframes in object channels in DopeSheet --- source/blender/editors/animation/anim_filter.c | 48 +--------------------- source/blender/editors/animation/keyframes_edit.c | 24 ++++++++++- .../blender/editors/space_action/action_select.c | 26 ++++++------ 3 files changed, 38 insertions(+), 60 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index b47211f35d1..f9c1b1bb42f 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1095,17 +1095,6 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B ANIMDATA_FILTER_CASES(ob, { /* AnimData blocks - do nothing... */ }, { /* nla */ -#if 0 - /* include nla-expand widget? */ - if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_NLATRACKS)) { - ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLNLA, base, ANIMTYPE_OBJECT, (ID *)ob); - if (ale) { - BLI_addtail(anim_data, ale); - items++; - } - } -#endif - /* add NLA tracks */ items += animdata_filter_nla(anim_data, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); }, @@ -1141,7 +1130,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B items += animdata_filter_action(anim_data, adt->action, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); } } - ) + ); } @@ -1151,17 +1140,6 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B ANIMDATA_FILTER_CASES(key, { /* AnimData blocks - do nothing... */ }, { /* nla */ -#if 0 - /* include nla-expand widget? */ - if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_NLATRACKS)) { - ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLNLA, base, ANIMTYPE_OBJECT, (ID *)ob); - if (ale) { - BLI_addtail(anim_data, ale); - items++; - } - } -#endif - /* add NLA tracks */ items += animdata_filter_nla(anim_data, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); }, @@ -1195,7 +1173,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B items += animdata_filter_shapekey(anim_data, key, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob); } } - ) + ); } /* Materials? */ @@ -1280,17 +1258,6 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads ANIMDATA_FILTER_CASES(sce, { /* AnimData blocks - do nothing... */ }, { /* nla */ -#if 0 - /* include nla-expand widget? */ - if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_NLATRACKS)) { - ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLNLA, base, ANIMTYPE_SCENE (ID *)sce); - if (ale) { - BLI_addtail(anim_data, ale); - items++; - } - } -#endif - /* add NLA tracks */ items += animdata_filter_nla(anim_data, adt, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce); }, @@ -1334,17 +1301,6 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads ANIMDATA_FILTER_CASES(wo, { /* AnimData blocks - do nothing... */ }, { /* nla */ -#if 0 - /* include nla-expand widget? */ - if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_NLATRACKS)) { - ale= make_new_animlistelem(adt->action, ANIMTYPE_FILLNLA, base, ANIMTYPE_DSWOR (ID *)wo); - if (ale) { - BLI_addtail(anim_data, ale); - items++; - } - } -#endif - /* add NLA tracks */ items += animdata_filter_nla(anim_data, adt, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo); }, diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index 8243629b4a6..77826eca87a 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -128,6 +128,10 @@ static short agrp_keys_bezier_loop(BeztEditData *bed, bActionGroup *agrp, BeztEd { FCurve *fcu; + /* sanity check */ + if (agrp == NULL) + return 0; + /* only iterate over the F-Curves that are in this group */ for (fcu= agrp->channels.first; fcu && fcu->grp==agrp; fcu= fcu->next) { if (ANIM_fcurve_keys_bezier_loop(bed, fcu, bezt_ok, bezt_cb, fcu_cb)) @@ -142,6 +146,10 @@ static short act_keys_bezier_loop(BeztEditData *bed, bAction *act, BeztEditFunc { FCurve *fcu; + /* sanity check */ + if (act == NULL) + return 0; + /* just loop through all F-Curves */ for (fcu= act->curves.first; fcu; fcu= fcu->next) { if (ANIM_fcurve_keys_bezier_loop(bed, fcu, bezt_ok, bezt_cb, fcu_cb)) @@ -154,6 +162,10 @@ static short act_keys_bezier_loop(BeztEditData *bed, bAction *act, BeztEditFunc /* This function is used to loop over the keyframe data of an AnimData block */ static short adt_keys_bezier_loop(BeztEditData *bed, AnimData *adt, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag) { + /* sanity check */ + if (adt == NULL) + return 0; + /* drivers or actions? */ if (filterflag & ADS_FILTER_ONLYDRIVERS) { FCurve *fcu; @@ -178,6 +190,10 @@ static short ob_keys_bezier_loop(BeztEditData *bed, Object *ob, BeztEditFunc bez { Key *key= ob_get_key(ob); + /* sanity check */ + if (ob == NULL) + return 0; + /* firstly, Object's own AnimData */ if (ob->adt) adt_keys_bezier_loop(bed, ob->adt, bezt_ok, bezt_cb, fcu_cb, filterflag); @@ -194,7 +210,11 @@ static short ob_keys_bezier_loop(BeztEditData *bed, Object *ob, BeztEditFunc bez /* This function is used to loop over the keyframe data in a Scene */ static short scene_keys_bezier_loop(BeztEditData *bed, Scene *sce, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, FcuEditFunc fcu_cb, int filterflag) { - World *wo= sce->world; + World *wo= (sce) ? sce->world : NULL; + + /* sanity check */ + if (sce == NULL) + return 0; /* Scene's own animation */ if (sce->adt) @@ -231,7 +251,7 @@ short ANIM_animchannel_keys_bezier_loop(BeztEditData *bed, bAnimListElem *ale, B return act_keys_bezier_loop(bed, (bAction *)ale->data, bezt_ok, bezt_cb, fcu_cb); case ALE_OB: /* object */ - return ob_keys_bezier_loop(bed, (Object *)ale->data, bezt_ok, bezt_cb, fcu_cb, filterflag); + return ob_keys_bezier_loop(bed, (Object *)ale->key_data, bezt_ok, bezt_cb, fcu_cb, filterflag); case ALE_SCE: /* scene */ return scene_keys_bezier_loop(bed, (Scene *)ale->data, bezt_ok, bezt_cb, fcu_cb, filterflag); } diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index d8ed3fd1068..826728e83f9 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -858,17 +858,19 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short select_mode, ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR); /* Highlight Action-Group or F-Curve? */ - if (ale->type == ANIMTYPE_GROUP) { - bActionGroup *agrp= ale->data; - - agrp->flag |= AGRP_SELECTED; - ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, agrp, ANIMTYPE_GROUP); - } - else if (ale->type == ANIMTYPE_FCURVE) { - FCurve *fcu= ale->data; - - fcu->flag |= FCURVE_SELECTED; - ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE); + if (ale && ale->data) { + if (ale->type == ANIMTYPE_GROUP) { + bActionGroup *agrp= ale->data; + + agrp->flag |= AGRP_SELECTED; + ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, agrp, ANIMTYPE_GROUP); + } + else if (ale->type == ANIMTYPE_FCURVE) { + FCurve *fcu= ale->data; + + fcu->flag |= FCURVE_SELECTED; + ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE); + } } } else if (ac->datatype == ANIMCONT_GPENCIL) { @@ -881,7 +883,7 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short select_mode, } /* only select keyframes if we clicked on a valid channel and hit something */ - if (ale) { + if (ale && found) { /* apply selection to keyframes */ if (/*gpl*/0) { /* grease pencil */ -- cgit v1.2.3 From 74884754d221a97c487d4c3630ceb4412b726863 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 12 Jun 2009 06:44:49 +0000 Subject: NLA SoC: Added menus including the operators coded already --- source/blender/editors/space_nla/nla_header.c | 102 ++++++++++++++++++++------ source/blender/makesdna/DNA_space_types.h | 3 + source/blender/makesrna/RNA_access.h | 1 + source/blender/makesrna/intern/rna_space.c | 28 ++++++- 4 files changed, 109 insertions(+), 25 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index 7ce7536878b..0d42c544a3f 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -57,6 +57,9 @@ #include "ED_screen.h" #include "BIF_gl.h" +#include "BIF_transform.h" + +#include "RNA_access.h" #include "WM_api.h" #include "WM_types.h" @@ -74,37 +77,84 @@ enum { /* ************************ header area region *********************** */ -static void do_viewmenu(bContext *C, void *arg, int event) + +static void nla_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) { + bScreen *sc= CTX_wm_screen(C); + ScrArea *sa= CTX_wm_area(C); + Scene *scene= CTX_data_scene(C); + SpaceNla *snla= (SpaceNla*)CTX_wm_space_data(C); + PointerRNA spaceptr; + + /* retrieve state */ + RNA_pointer_create(&sc->id, &RNA_SpaceNLA, snla, &spaceptr); + + /* create menu */ + uiItemO(layout, NULL, ICON_MENU_PANEL, "NLAEDIT_OT_properties"); + + uiItemS(layout); + + uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0, 0, 0); + if (snla->flag & SNLA_DRAWTIME) + uiItemO(layout, "Show Frames", 0, "ANIM_OT_time_toggle"); + else + uiItemO(layout, "Show Seconds", 0, "ANIM_OT_time_toggle"); + + uiItemS(layout); + + if (scene->flag & SCE_NLA_EDIT_ON) + uiItemO(layout, NULL, 0, "NLAEDIT_OT_tweakmode_exit"); + else + uiItemO(layout, NULL, 0, "NLAEDIT_OT_tweakmode_enter"); + + uiItemS(layout); + + uiItemO(layout, NULL, 0, "NLA_OT_view_all"); + + if (sa->full) + uiItemO(layout, NULL, 0, "SCREEN_OT_screen_full_area"); // "Tile Window", Ctrl UpArrow + else + uiItemO(layout, NULL, 0, "SCREEN_OT_screen_full_area"); // "Maximize Window", Ctr DownArrow } -static uiBlock *dummy_viewmenu(bContext *C, ARegion *ar, void *arg_unused) +static void nla_selectmenu(bContext *C, uiLayout *layout, void *arg_unused) { - ScrArea *curarea= CTX_wm_area(C); - uiBlock *block; - short yco= 0, menuwidth=120; + uiItemO(layout, NULL, 0, "NLAEDIT_OT_select_all_toggle"); + uiItemBooleanO(layout, "Invert All", 0, "NLAEDIT_OT_select_all_toggle", "invert", 1); - block= uiBeginBlock(C, ar, "dummy_viewmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_viewmenu, NULL); + uiItemS(layout); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiItemO(layout, NULL, 0, "NLAEDIT_OT_select_border"); + uiItemBooleanO(layout, "Border Axis Range", 0, "NLAEDIT_OT_select_border", "axis_range", 1); +} + +static void nla_edit_transformmenu(bContext *C, uiLayout *layout, void *arg_unused) +{ + // XXX these operators may change for NLA... + uiItemEnumO(layout, "Grab/Move", 0, "TFM_OT_transform", "mode", TFM_TIME_TRANSLATE); + uiItemEnumO(layout, "Extend", 0, "TFM_OT_transform", "mode", TFM_TIME_EXTEND); + uiItemEnumO(layout, "Scale", 0, "TFM_OT_transform", "mode", TFM_TIME_SCALE); +} + +static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused) +{ + uiItemMenuF(layout, "Transform", 0, nla_edit_transformmenu); - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } + uiItemS(layout); - uiTextBoundsBlock(block, 50); - uiEndBlock(C, block); + uiItemO(layout, NULL, 0, "NLA_OT_add_tracks"); + uiItemBooleanO(layout, "Add Tracks Above Selected", 0, "NLA_OT_add_tracks", "above_selected", 1); + + uiItemO(layout, NULL, 0, "NLAEDIT_OT_split"); - return block; + uiItemS(layout); + + uiItemO(layout, NULL, 0, "NLAEDIT_OT_delete"); } +/* ------------------ */ + static void do_nla_buttons(bContext *C, void *arg, int event) { switch (event) { @@ -132,9 +182,17 @@ void nla_header_buttons(const bContext *C, ARegion *ar) int xmax; xmax= GetButStringLength("View"); - uiDefPulldownBut(block, dummy_viewmenu, CTX_wm_area(C), - "View", xco, yco-2, xmax-3, 24, ""); - xco+=XIC+xmax; + uiDefMenuBut(block, nla_viewmenu, NULL, "View", xco, yco, xmax-3, 20, ""); + xco+= xmax; + + xmax= GetButStringLength("Select"); + uiDefMenuBut(block, nla_selectmenu, NULL, "Select", xco, yco, xmax-3, 20, ""); + xco+= xmax; + + xmax= GetButStringLength("Edit"); + uiDefMenuBut(block, nla_editmenu, NULL, "Edit", xco, yco, xmax-3, 20, ""); + xco+= xmax; + } uiBlockSetEmboss(block, UI_EMBOSS); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index c7abd8f7f83..3740633b576 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -696,8 +696,11 @@ enum { #define IMS_INFILESLI 4 /* nla->flag */ + // depreceated #define SNLA_ALLKEYED (1<<0) + // depreceated #define SNLA_ACTIVELAYERS (1<<1) + #define SNLA_DRAWTIME (1<<2) #define SNLA_NOTRANSKEYCULL (1<<3) #define SNLA_NODRAWCFRANUM (1<<4) diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 1a8bf88d1cc..d1fd3d78074 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -365,6 +365,7 @@ extern StructRNA RNA_Space; extern StructRNA RNA_Space3DView; extern StructRNA RNA_SpaceButtonsWindow; extern StructRNA RNA_SpaceImageEditor; +extern StructRNA RNA_SpaceNLA; extern StructRNA RNA_SpaceOutliner; extern StructRNA RNA_SpaceSequenceEditor; extern StructRNA RNA_SpaceTextEditor; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 5de80cce2b5..1b776b727ce 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -92,10 +92,10 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr) /*case SPACE_SOUND: return &RNA_SpaceAudioWindow; case SPACE_ACTION: - return &RNA_SpaceDopeSheetEditor; + return &RNA_SpaceDopeSheetEditor;*/ case SPACE_NLA: - return &RNA_SpaceNLAEditor; - case SPACE_SCRIPT: + return &RNA_SpaceNLA; + /*case SPACE_SCRIPT: return &RNA_SpaceScriptsWindow; case SPACE_TIME: return &RNA_SpaceTimeline; @@ -757,6 +757,27 @@ static void rna_def_space_text(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool."); } +static void rna_def_space_nla(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "SpaceNLA", "Space"); + RNA_def_struct_sdna(srna, "SpaceNla"); + RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data."); + + /* display */ + prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SNLA_DRAWTIME); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator + RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames."); + + prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCFRANUM); + RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line."); + +} + void RNA_def_space(BlenderRNA *brna) { rna_def_space(brna); @@ -767,6 +788,7 @@ void RNA_def_space(BlenderRNA *brna) rna_def_background_image(brna); rna_def_space_3dview(brna); rna_def_space_buttons(brna); + rna_def_space_nla(brna); } #endif -- cgit v1.2.3 From 1c2ce9535caa7ef0ed70aea5bd25c0f281322cf6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 12 Jun 2009 12:56:12 +0000 Subject: use contains for ListValue and KX_GameObject types (has_key is deprecated by python) eg. if 'prop' in gameOb: ... if 'GameOb' in sce.objects: ... --- source/gameengine/Expressions/ListValue.cpp | 35 +++++++++++++++-- source/gameengine/Ketsji/KX_Camera.cpp | 7 +++- source/gameengine/Ketsji/KX_GameObject.cpp | 61 +++++++++++++++++++++-------- source/gameengine/Ketsji/KX_GameObject.h | 4 +- source/gameengine/Ketsji/KX_Light.cpp | 7 +++- 5 files changed, 86 insertions(+), 28 deletions(-) (limited to 'source') diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index a0d73c75d60..ea097ddff5b 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -209,6 +209,30 @@ static PyObject *listvalue_buffer_concat(PyObject * self, PyObject * other) return listval_new->NewProxy(true); /* python owns this list */ } +static int listvalue_buffer_contains(PyObject *self_v, PyObject *value) +{ + CListValue *self= static_cast(BGE_PROXY_REF(self_v)); + + if (self==NULL) { + PyErr_SetString(PyExc_SystemError, "val in CList, "BGE_PROXY_ERROR_MSG); + return -1; + } + + if (PyString_Check(value)) { + if (self->FindValue((const char *)PyString_AsString(value))) { + return 1; + } + } + else if (BGE_PROXY_CHECK_TYPE(value)) { /* not dict like at all but this worked before __contains__ was used */ + CValue *item= static_cast(BGE_PROXY_REF(value)); + for (int i=0; i < self->GetCount(); i++) + if (self->GetValue(i) == item) // Com + return 1; + + } // not using CheckEqual + + return 0; +} static PySequenceMethods listvalue_as_sequence = { @@ -225,6 +249,7 @@ static PySequenceMethods listvalue_as_sequence = { NULL, /*sq_ass_item*/ NULL, /*sq_ass_slice*/ #endif + (objobjproc)listvalue_buffer_contains, /* sq_contains */ }; @@ -264,7 +289,9 @@ PyTypeObject CListValue::Type = { 0, py_base_getattro, py_base_setattro, - 0,0,0,0,0,0,0,0,0, + 0, + Py_TPFLAGS_DEFAULT, + 0,0,0,0,0,0,0, Methods }; @@ -499,7 +526,7 @@ PyObject* CListValue::Pyreverse() bool CListValue::CheckEqual(CValue* first,CValue* second) { bool result = false; - + CValue* eqval = ((CValue*)first)->Calc(VALUE_EQL_OPERATOR,(CValue*)second); if (eqval==NULL) @@ -528,7 +555,7 @@ PyObject* CListValue::Pyindex(PyObject *value) for (int i=0;iBGE_PROXY_REF(self_v); const char *attr_str= PyString_AsString(item); @@ -1295,7 +1295,7 @@ PyObject *KX_GameObject::Map_GetItem(PyObject *self_v, PyObject *item) PyObject* pyconvert; if (self==NULL) { - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, "val = gameOb[key]: KX_GameObject, "BGE_PROXY_ERROR_MSG); return NULL; } @@ -1321,7 +1321,7 @@ PyObject *KX_GameObject::Map_GetItem(PyObject *self_v, PyObject *item) } -int KX_GameObject::Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) +static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) { KX_GameObject* self= static_castBGE_PROXY_REF(self_v); const char *attr_str= PyString_AsString(key); @@ -1329,7 +1329,7 @@ int KX_GameObject::Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) PyErr_Clear(); if (self==NULL) { - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, "gameOb[key] = value: KX_GameObject, "BGE_PROXY_ERROR_MSG); return -1; } @@ -1409,11 +1409,40 @@ int KX_GameObject::Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) return 0; /* success */ } -/* Cant set the len otherwise it can evaluate as false */ +static int Seq_Contains(PyObject *self_v, PyObject *value) +{ + KX_GameObject* self= static_castBGE_PROXY_REF(self_v); + + if (self==NULL) { + PyErr_SetString(PyExc_SystemError, "val in gameOb: KX_GameObject, "BGE_PROXY_ERROR_MSG); + return -1; + } + + if(PyString_Check(value) && self->GetProperty(PyString_AsString(value))) + return 1; + + if (self->m_attr_dict && PyDict_GetItem(self->m_attr_dict, value)) + return 1; + + return 0; +} + + PyMappingMethods KX_GameObject::Mapping = { (lenfunc)NULL , /*inquiry mp_length */ - (binaryfunc)KX_GameObject::Map_GetItem, /*binaryfunc mp_subscript */ - (objobjargproc)KX_GameObject::Map_SetItem, /*objobjargproc mp_ass_subscript */ + (binaryfunc)Map_GetItem, /*binaryfunc mp_subscript */ + (objobjargproc)Map_SetItem, /*objobjargproc mp_ass_subscript */ +}; + +PySequenceMethods KX_GameObject::Sequence = { + NULL, /* Cant set the len otherwise it can evaluate as false */ + NULL, /* sq_concat */ + NULL, /* sq_repeat */ + NULL, /* sq_item */ + NULL, /* sq_slice */ + NULL, /* sq_ass_item */ + NULL, /* sq_ass_slice */ + (objobjproc)Seq_Contains, /* sq_contains */ }; PyTypeObject KX_GameObject::Type = { @@ -1433,12 +1462,15 @@ PyTypeObject KX_GameObject::Type = { 0, 0, py_base_repr, - 0,0, + 0, + &Sequence, &Mapping, 0,0,0, py_base_getattro, py_base_setattro, - 0,0,0,0,0,0,0,0,0, + 0, + Py_TPFLAGS_DEFAULT, + 0,0,0,0,0,0,0, Methods }; @@ -2779,16 +2811,11 @@ PyObject* KX_GameObject::Pyget(PyObject *args) /* Matches python dict.has_key() */ PyObject* KX_GameObject::Pyhas_key(PyObject* value) { - if(PyString_Check(value) && GetProperty(PyString_AsString(value))) - Py_RETURN_TRUE; - - if (m_attr_dict && PyDict_GetItem(m_attr_dict, value)) - Py_RETURN_TRUE; - - Py_RETURN_FALSE; + // the ONLY error case is invalid data, this is checked by the macro'd static function + // that calls this one. but make sure Seq_Contains doesnt add extra errors later on. + return PyBool_FromLong(Seq_Contains((PyObject *)this, value)); } - /* --------------------------------------------------------------------- * Some stuff taken from the header * --------------------------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index dbdea97031d..ff5c8a01e6e 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -917,10 +917,8 @@ public: static PyObject* pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); /* getitem/setitem */ - static Py_ssize_t Map_Len(PyObject* self); static PyMappingMethods Mapping; - static PyObject* Map_GetItem(PyObject *self_v, PyObject *item); - static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val); + static PySequenceMethods Sequence; private : diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index 274d8f26d78..ae9e097a96e 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -293,12 +293,15 @@ PyTypeObject KX_LightObject::Type = { 0, 0, py_base_repr, - 0,0, + 0, + &KX_GameObject::Sequence, &KX_GameObject::Mapping, 0,0,0, py_base_getattro, py_base_setattro, - 0,0,0,0,0,0,0,0,0, + 0, + Py_TPFLAGS_DEFAULT, + 0,0,0,0,0,0,0, Methods }; -- cgit v1.2.3 From 32b34f82fd782d45ee4b5389a1f961bc1f463631 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 12 Jun 2009 13:53:08 +0000 Subject: UI: * Immediately do updates when working in the color picker popup. * Fix for color picking wrongly getting cancelled sometimes. --- source/blender/editors/include/UI_interface.h | 1 + .../blender/editors/interface/interface_handlers.c | 29 ++++++++++++++++------ .../blender/editors/interface/interface_regions.c | 27 ++++++++++++++++++++ 3 files changed, 49 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 0604a5e27e1..7b18380b54f 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -96,6 +96,7 @@ typedef struct uiLayout uiLayout; #define UI_RETURN_CANCEL 1 /* cancel all menus cascading */ #define UI_RETURN_OK 2 /* choice made */ #define UI_RETURN_OUT 4 /* left the menu */ +#define UI_RETURN_UPDATE 8 /* update the button that opened */ /* block->flag bits 12-15 are identical to but->flag bits */ diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index f8f0ebad700..6eddb564945 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3362,7 +3362,8 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but) uiBut *bt= ui_but_find_mouse_over(ar, event->x, event->y); if(bt && bt->active != data) { - data->cancel= 1; + if(but->type != COL) /* exception */ + data->cancel= 1; button_activate_state(C, but, BUTTON_STATE_EXIT); } break; @@ -3391,7 +3392,7 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but) return retval; } -static void ui_handle_button_closed_submenu(bContext *C, wmEvent *event, uiBut *but) +static void ui_handle_button_return_submenu(bContext *C, wmEvent *event, uiBut *but) { uiHandleButtonData *data; uiPopupBlockHandle *menu; @@ -3400,12 +3401,19 @@ static void ui_handle_button_closed_submenu(bContext *C, wmEvent *event, uiBut * menu= data->menu; /* copy over return values from the closing menu */ - if(menu->menuretval == UI_RETURN_OK) { + if(menu->menuretval == UI_RETURN_OK || menu->menuretval == UI_RETURN_UPDATE) { if(but->type == COL) VECCOPY(data->vec, menu->retvec) else if(ELEM3(but->type, MENU, ICONROW, ICONTEXTROW)) data->value= menu->retvalue; } + + if(menu->menuretval == UI_RETURN_UPDATE) { + if(data->interactive) ui_apply_button(C, but->block, but, data, 1); + else ui_check_but(but); + + menu->menuretval= 0; + } /* now change button state or exit, which will close the submenu */ if(ELEM(menu->menuretval, UI_RETURN_OK, UI_RETURN_CANCEL)) { @@ -3716,7 +3724,7 @@ int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle *menu, * buttons inside this region. disabled inside check .. not sure * anymore why it was there? but i meant enter enter didn't work * for example when mouse was not over submenu */ - if((/*inside &&*/ !menu->menuretval && retval == WM_UI_HANDLER_CONTINUE) || event->type == TIMER) { + if((/*inside &&*/ (!menu->menuretval || menu->menuretval == UI_RETURN_UPDATE) && retval == WM_UI_HANDLER_CONTINUE) || event->type == TIMER) { but= ui_but_find_activated(ar); if(but) { @@ -3746,7 +3754,7 @@ int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle *menu, return retval; } -static int ui_handle_menu_closed_submenu(bContext *C, wmEvent *event, uiPopupBlockHandle *menu) +static int ui_handle_menu_return_submenu(bContext *C, wmEvent *event, uiPopupBlockHandle *menu) { ARegion *ar; uiBut *but; @@ -3771,10 +3779,15 @@ static int ui_handle_menu_closed_submenu(bContext *C, wmEvent *event, uiPopupBlo menu->butretval= data->retval; } } + else if(submenu->menuretval == UI_RETURN_UPDATE) + menu->menuretval = UI_RETURN_UPDATE; /* now let activated button in this menu exit, which * will actually close the submenu too */ - ui_handle_button_closed_submenu(C, event, but); + ui_handle_button_return_submenu(C, event, but); + + if(submenu->menuretval == UI_RETURN_UPDATE) + submenu->menuretval = 0; } /* for cases where close does not cascade, allow the user to @@ -3808,7 +3821,7 @@ static int ui_handle_menus_recursive(bContext *C, wmEvent *event, uiPopupBlockHa /* now handle events for our own menu */ if(retval == WM_UI_HANDLER_CONTINUE || event->type == TIMER) { if(submenu && submenu->menuretval) - retval= ui_handle_menu_closed_submenu(C, event, menu); + retval= ui_handle_menu_return_submenu(C, event, menu); else retval= ui_handle_menu_event(C, event, menu, (submenu == NULL)); } @@ -3901,7 +3914,7 @@ static int ui_handler_region_menu(bContext *C, wmEvent *event, void *userdata) /* handle events for the activated button */ if(retval == WM_UI_HANDLER_CONTINUE || event->type == TIMER) { if(data->menu->menuretval) - ui_handle_button_closed_submenu(C, event, but); + ui_handle_button_return_submenu(C, event, but); else ui_handle_button_event(C, event, but); } diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 31d0bf5d97d..5d562805b51 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1480,6 +1480,7 @@ static void do_palette_cb(bContext *C, void *bt1, void *col1) { wmWindow *win= CTX_wm_window(C); uiBut *but1= (uiBut *)bt1; + uiPopupBlockHandle *popup= but1->block->handle; float *col= (float *)col1; float *fp, hsv[3]; @@ -1495,6 +1496,18 @@ static void do_palette_cb(bContext *C, void *bt1, void *col1) rgb_to_hsv(col[0], col[1], col[2], hsv, hsv+1, hsv+2); ui_update_block_buts_hsv(but1->block, hsv); update_picker_hex(but1->block, col); + + if(popup) + popup->menuretval= UI_RETURN_UPDATE; +} + +static void do_hsv_cb(bContext *C, void *bt1, void *unused) +{ + uiBut *but1= (uiBut *)bt1; + uiPopupBlockHandle *popup= but1->block->handle; + + if(popup) + popup->menuretval= UI_RETURN_UPDATE; } /* bt1 is num but, hsv1 is pointer to original color in hsv space*/ @@ -1502,6 +1515,7 @@ static void do_palette_cb(bContext *C, void *bt1, void *col1) static void do_palette1_cb(bContext *C, void *bt1, void *hsv1) { uiBut *but1= (uiBut *)bt1; + uiPopupBlockHandle *popup= but1->block->handle; float *hsv= (float *)hsv1; float *fp= NULL; @@ -1514,6 +1528,9 @@ static void do_palette1_cb(bContext *C, void *bt1, void *hsv1) rgb_to_hsv(fp[0], fp[1], fp[2], hsv, hsv+1, hsv+2); } ui_update_block_buts_hsv(but1->block, hsv); + + if(popup) + popup->menuretval= UI_RETURN_UPDATE; } /* bt1 is num but, col1 is pointer to original color */ @@ -1521,6 +1538,7 @@ static void do_palette1_cb(bContext *C, void *bt1, void *hsv1) static void do_palette2_cb(bContext *C, void *bt1, void *col1) { uiBut *but1= (uiBut *)bt1; + uiPopupBlockHandle *popup= but1->block->handle; float *rgb= (float *)col1; float *fp= NULL; @@ -1533,14 +1551,21 @@ static void do_palette2_cb(bContext *C, void *bt1, void *col1) hsv_to_rgb(fp[0], fp[1], fp[2], rgb, rgb+1, rgb+2); } ui_update_block_buts_hsv(but1->block, fp); + + if(popup) + popup->menuretval= UI_RETURN_UPDATE; } static void do_palette_hex_cb(bContext *C, void *bt1, void *hexcl) { uiBut *but1= (uiBut *)bt1; + uiPopupBlockHandle *popup= but1->block->handle; char *hexcol= (char *)hexcl; ui_update_block_buts_hex(but1->block, hexcol); + + if(popup) + popup->menuretval= UI_RETURN_UPDATE; } /* used for both 3d view and image window */ @@ -1623,8 +1648,10 @@ void uiBlockPickerButtons(uiBlock *block, float *col, float *hsv, float *old, ch // the cube intersection bt= uiDefButF(block, HSVCUBE, retval, "", 0,DPICK+BPICK,FPICK,FPICK, col, 0.0, 0.0, 2, 0, ""); + uiButSetFunc(bt, do_hsv_cb, bt, NULL); bt= uiDefButF(block, HSVCUBE, retval, "", 0,0,FPICK,BPICK, col, 0.0, 0.0, 3, 0, ""); + uiButSetFunc(bt, do_hsv_cb, bt, NULL); // palette -- cgit v1.2.3 From a62bec6667c7ae0df7d0003b566a466b1047d728 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 12 Jun 2009 14:22:27 +0000 Subject: 2.5 Quick Color picker alternative! - only a color circle + value slider - exits immediate after use, or slight mouse move outside picker - use scrollwheel to change HSV 'value'. Also works while picking. - added nicer AA'ed cursor in picker - All color swatches change 'value' on ALT+Wheel mouse-over Old picker is still there, under SHIFT+click on swatch. Needs evaluation... part of UI keymap? Per button type? Or divide picker in left/right? Or just have all those old picker buttons in another panel... I'm not to fond of this giant old popup. --- source/blender/editors/include/UI_interface.h | 1 + source/blender/editors/interface/interface.c | 2 +- .../blender/editors/interface/interface_handlers.c | 107 ++++++++++++++++++- .../blender/editors/interface/interface_intern.h | 5 + .../blender/editors/interface/interface_regions.c | 92 ++++++++++++++++- .../blender/editors/interface/interface_widgets.c | 115 +++++++++++++++++++-- source/blender/editors/preview/previewrender.c | 1 - 7 files changed, 305 insertions(+), 18 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 7b18380b54f..dea408f818a 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -195,6 +195,7 @@ typedef struct uiLayout uiLayout; #define OPTIONN (39<<9) #define SEARCH_MENU (40<<9) #define BUT_EXTRA (41<<9) +#define HSVCIRCLE (42<<9) #define BUTTYPE (63<<9) /* Drawing diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 79e32d4a5f1..e37f7d2158c 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2232,7 +2232,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short } } - if(but->type==HSVCUBE) { /* hsv buttons temp storage */ + if(ELEM(but->type, HSVCUBE, HSVCIRCLE)) { /* hsv buttons temp storage */ float rgb[3]; ui_get_but_vectorf(but, rgb); rgb_to_hsv(rgb[0], rgb[1], rgb[2], but->hsv, but->hsv+1, but->hsv+2); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 6eddb564945..bda16584811 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -621,6 +621,7 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut break; case BUT_NORMAL: case HSVCUBE: + case HSVCIRCLE: ui_apply_but_VEC(C, but, data); break; case BUT_COLORBAND: @@ -1432,7 +1433,7 @@ static void ui_numedit_begin(uiBut *but, uiHandleButtonData *data) data->coba= (ColorBand*)but->poin; but->editcoba= data->coba; } - else if(ELEM(but->type, BUT_NORMAL, HSVCUBE)) { + else if(ELEM3(but->type, BUT_NORMAL, HSVCUBE, HSVCIRCLE)) { ui_get_but_vectorf(but, data->origvec); VECCOPY(data->vec, data->origvec); but->editvec= data->vec; @@ -2100,6 +2101,25 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wm return WM_UI_HANDLER_BREAK; } } + else if(but->type==COL) { + if( ELEM(event->type, WHEELDOWNMOUSE, WHEELUPMOUSE) && event->alt) { + float col[3]; + + ui_get_but_vectorf(but, col); + rgb_to_hsv(col[0], col[1], col[2], but->hsv, but->hsv+1, but->hsv+2); + + if(event->type==WHEELDOWNMOUSE) + but->hsv[2]= CLAMPIS(but->hsv[2]-0.05f, 0.0f, 1.0f); + else + but->hsv[2]= CLAMPIS(but->hsv[2]+0.05f, 0.0f, 1.0f); + + hsv_to_rgb(but->hsv[0], but->hsv[1], but->hsv[2], data->vec, data->vec+1, data->vec+2); + + button_activate_state(C, but, BUTTON_STATE_EXIT); + ui_apply_button(C, but->block, but, data, 1); + return WM_UI_HANDLER_BREAK; + } + } } return WM_UI_HANDLER_CONTINUE; @@ -2223,8 +2243,11 @@ static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx, but->hsv[2]= x; but->hsv[1]= y; } - else + else if(but->a1==3) { but->hsv[0]= x; + } + else + but->hsv[2]= y; ui_set_but_hsv(but); // converts to rgb @@ -2276,6 +2299,79 @@ static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleBu return WM_UI_HANDLER_CONTINUE; } +static int ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, int mx, int my) +{ + rcti rect; + int changed= 1; + + rect.xmin= but->x1; rect.xmax= but->x2; + rect.ymin= but->y1; rect.ymax= but->y2; + + ui_hsvcircle_vals_from_pos(but->hsv, but->hsv+1, &rect, (float)mx, (float)my); + + ui_set_but_hsv(but); // converts to rgb + + // update button values and strings + // XXX ui_update_block_buts_hsv(but->block, but->hsv); + + data->draglastx= mx; + data->draglasty= my; + + return changed; +} + + +static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event) +{ + int mx, my; + + mx= event->x; + my= event->y; + ui_window_to_block(data->region, block, &mx, &my); + + if(data->state == BUTTON_STATE_HIGHLIGHT) { + if(event->type==LEFTMOUSE && event->val==KM_PRESS) { + data->dragstartx= mx; + data->dragstarty= my; + data->draglastx= mx; + data->draglasty= my; + button_activate_state(C, but, BUTTON_STATE_NUM_EDITING); + + /* also do drag the first time */ + if(ui_numedit_but_HSVCIRCLE(but, data, mx, my)) + ui_numedit_apply(C, block, but, data); + + return WM_UI_HANDLER_BREAK; + } + } + else if(data->state == BUTTON_STATE_NUM_EDITING) { + /* XXX hardcoded keymap check.... */ + if(event->type == WHEELDOWNMOUSE) { + but->hsv[2]= CLAMPIS(but->hsv[2]-0.05f, 0.0f, 1.0f); + ui_set_but_hsv(but); // converts to rgb + ui_numedit_apply(C, block, but, data); + } + else if(event->type == WHEELUPMOUSE) { + but->hsv[2]= CLAMPIS(but->hsv[2]+0.05f, 0.0f, 1.0f); + ui_set_but_hsv(but); // converts to rgb + ui_numedit_apply(C, block, but, data); + } + else if(event->type == MOUSEMOVE) { + if(mx!=data->draglastx || my!=data->draglasty) { + if(ui_numedit_but_HSVCIRCLE(but, data, mx, my)) + ui_numedit_apply(C, block, but, data); + } + } + else if(event->type==LEFTMOUSE && event->val!=KM_PRESS) + button_activate_state(C, but, BUTTON_STATE_EXIT); + + return WM_UI_HANDLER_BREAK; + } + + return WM_UI_HANDLER_CONTINUE; +} + + static int verg_colorband(const void *a1, const void *a2) { const CBData *x1=a1, *x2=a2; @@ -2847,6 +2943,9 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event) case HSVCUBE: retval= ui_do_but_HSVCUBE(C, block, but, data, event); break; + case HSVCIRCLE: + retval= ui_do_but_HSVCIRCLE(C, block, but, data, event); + break; #ifdef INTERNATIONAL case CHARTAB: retval= ui_do_but_CHARTAB(C, block, but, data, event); @@ -3545,8 +3644,10 @@ int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle *menu, if(event->type == MOUSEMOVE) ui_mouse_motion_towards_init(menu, mx, my, 0); + /* first block own event func */ + if(block->block_event_func && block->block_event_func(C, block, event)); /* events not for active search menu button */ - if(but==NULL || but->type!=SEARCH_MENU) { + else if(but==NULL || but->type!=SEARCH_MENU) { switch(event->type) { /* closing sublevels of pulldowns */ case LEFTARROWKEY: diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 08fa6434aa8..83d3ec7fc46 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -254,6 +254,9 @@ struct uiBlock { uiBlockHandleFunc handle_func; void *handle_func_arg; + /* custom extra handling */ + int (*block_event_func)(const struct bContext *C, struct uiBlock *, struct wmEvent *); + /* extra draw function for custom blocks */ void (*drawextra)(const struct bContext *C, void *idv, rcti *rect); @@ -306,6 +309,8 @@ extern void ui_set_but_hsv(uiBut *but); extern void ui_get_but_vectorf(uiBut *but, float *vec); extern void ui_set_but_vectorf(uiBut *but, float *vec); +extern void ui_hsvcircle_vals_from_pos(float *valrad, float *valdist, rcti *rect, float mx, float my); + extern void ui_get_but_string(uiBut *but, char *str, int maxlen); extern int ui_set_but_string(struct bContext *C, uiBut *but, const char *str); extern int ui_get_but_string_max_length(uiBut *but); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 5d562805b51..89654f0ffab 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1393,6 +1393,7 @@ static void update_picker_hex(uiBlock *block, float *rgb) } } +/* also used by small picker, be careful with name checks below... */ void ui_update_block_buts_hsv(uiBlock *block, float *hsv) { uiBut *bt; @@ -1406,7 +1407,7 @@ void ui_update_block_buts_hsv(uiBlock *block, float *hsv) update_picker_hex(block, rgb); for(bt= block->buttons.first; bt; bt= bt->next) { - if(bt->type==HSVCUBE) { + if(ELEM(bt->type, HSVCUBE, HSVCIRCLE)) { VECCOPY(bt->hsv, hsv); ui_set_but_hsv(bt); } @@ -1701,22 +1702,103 @@ void uiBlockPickerButtons(uiBlock *block, float *col, float *hsv, float *old, ch uiBlockEndAlign(block); } +/* bt1 is num but, hsv1 is pointer to original color in hsv space*/ +/* callback to handle changes */ +static void do_picker_small_cb(bContext *C, void *bt1, void *hsv1) +{ + uiBut *but1= (uiBut *)bt1; + uiPopupBlockHandle *popup= but1->block->handle; + float *hsv= (float *)hsv1; + float *fp= NULL; + + fp= (float *)but1->poin; + rgb_to_hsv(fp[0], fp[1], fp[2], hsv, hsv+1, hsv+2); + + ui_update_block_buts_hsv(but1->block, hsv); + + if(popup) + popup->menuretval= UI_RETURN_UPDATE; +} + + +/* only the color, a circle, slider */ +void uiBlockPickerSmall(uiBlock *block, float *col, float *hsv, float *old, char *hexcol, char mode, short retval) +{ + uiBut *bt; + + VECCOPY(old, col); // old color stored there, for palette_cb to work + + /* HS circle */ + bt= uiDefButF(block, HSVCIRCLE, retval, "", 0, 0,SPICK,SPICK, col, 0.0, 0.0, 0, 0, ""); + uiButSetFunc(bt, do_picker_small_cb, bt, hsv); + + /* value */ + bt= uiDefButF(block, HSVCUBE, retval, "", SPICK+DPICK,0,14,SPICK, col, 0.0, 0.0, 4, 0, ""); + uiButSetFunc(bt, do_picker_small_cb, bt, hsv); + +} + +static int ui_picker_small_wheel(const bContext *C, uiBlock *block, wmEvent *event) +{ + float add= 0.0f; + + if(event->type==WHEELUPMOUSE) + add= 0.05f; + else if(event->type==WHEELDOWNMOUSE) + add= -0.05f; + + if(add!=0.0f) { + uiBut *but; + + for(but= block->buttons.first; but; but= but->next) { + if(but->type==HSVCUBE && but->active==NULL) { + uiPopupBlockHandle *popup= block->handle; + float col[3]; + + ui_get_but_vectorf(but, col); + + rgb_to_hsv(col[0], col[1], col[2], but->hsv, but->hsv+1, but->hsv+2); + but->hsv[2]= CLAMPIS(but->hsv[2]+add, 0.0f, 1.0f); + hsv_to_rgb(but->hsv[0], but->hsv[1], but->hsv[2], col, col+1, col+2); + + ui_set_but_vectorf(but, col); + + ui_update_block_buts_hsv(block, but->hsv); + if(popup) + popup->menuretval= UI_RETURN_UPDATE; + + return 1; + } + } + } + return 0; +} + uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_but) { + wmWindow *win= CTX_wm_window(C); // XXX temp, needs to become keymap to detect type? uiBut *but= arg_but; uiBlock *block; static float hsvcol[3], oldcol[3]; static char hexcol[128]; block= uiBeginBlock(C, handle->region, "colorpicker", UI_EMBOSS); - block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_KEEP_OPEN; VECCOPY(handle->retvec, but->editvec); - uiBlockPickerButtons(block, handle->retvec, hsvcol, oldcol, hexcol, 'p', 0); - + if(win->eventstate->shift) { + uiBlockPickerButtons(block, handle->retvec, hsvcol, oldcol, hexcol, 'p', 0); + block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_KEEP_OPEN; + uiBoundsBlock(block, 3); + } + else { + uiBlockPickerSmall(block, handle->retvec, hsvcol, oldcol, hexcol, 'p', 0); + block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1; + uiBoundsBlock(block, 10); + + block->block_event_func= ui_picker_small_wheel; + } /* and lets go */ block->direction= UI_TOP; - uiBoundsBlock(block, 3); return block; } diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index ab8569bf47e..27f42da9fa0 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1087,6 +1087,20 @@ static struct uiWidgetColors wcol_box= { 0, 0 }; +/* free wcol struct to play with */ +static struct uiWidgetColors wcol_tmp= { + {0, 0, 0, 255}, + {128, 128, 128, 255}, + {100, 100, 100, 255}, + {25, 25, 25, 255}, + + {0, 0, 0, 255}, + {255, 255, 255, 255}, + + 0, + 0, 0 +}; + /* called for theme init (new theme) and versions */ void ui_widget_color_init(ThemeUI *tui) @@ -1262,9 +1276,28 @@ static void widget_menu_back(uiWidgetColors *wcol, rcti *rect, int flag, int dir glDisable(GL_BLEND); } -/* ************ custom buttons, old stuff ************** */ -static void ui_hsvcircle_to_val(float *valrad, float *valdist, rcti *rect, float mx, float my) +static void ui_hsv_cursor(float x, float y) +{ + + glPushMatrix(); + glTranslatef(x, y, 0.0f); + + glColor3f(1.0f, 1.0f, 1.0f); + glutil_draw_filled_arc(0.0f, M_PI*2.0, 3.0f, 8); + + glEnable(GL_BLEND); + glEnable(GL_LINE_SMOOTH ); + glColor3f(0.0f, 0.0f, 0.0f); + glutil_draw_lined_arc(0.0f, M_PI*2.0, 3.0f, 12); + glDisable(GL_BLEND); + glDisable(GL_LINE_SMOOTH ); + + glPopMatrix(); + +} + +void ui_hsvcircle_vals_from_pos(float *valrad, float *valdist, rcti *rect, float mx, float my) { /* duplication of code... well, simple is better now */ float centx= (float)(rect->xmin + rect->xmax)/2; @@ -1319,7 +1352,7 @@ void ui_draw_but_HSVCIRCLE(uiBut *but, rcti *rect) float si= sin(ang); float co= cos(ang); - ui_hsvcircle_to_val(hsv, hsv+1, rect, centx + co*radius, centy + si*radius); + ui_hsvcircle_vals_from_pos(hsv, hsv+1, rect, centx + co*radius, centy + si*radius); hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2); glColor3fv(col); glVertex2f( centx + co*radius, centy + si*radius); @@ -1327,8 +1360,27 @@ void ui_draw_but_HSVCIRCLE(uiBut *but, rcti *rect) glEnd(); glShadeModel(GL_FLAT); + + /* fully rounded outline */ + glPushMatrix(); + glTranslatef(centx, centy, 0.0f); + glEnable(GL_BLEND); + glEnable(GL_LINE_SMOOTH ); + glColor3f(0.0f, 0.0f, 0.0f); + glutil_draw_lined_arc(0.0f, M_PI*2.0, radius, tot); + glDisable(GL_BLEND); + glDisable(GL_LINE_SMOOTH ); + glPopMatrix(); + + /* cursor */ + ang= 2.0f*M_PI*but->hsv[0] + 0.5f*M_PI; + radius= but->hsv[1]*radius; + ui_hsv_cursor(centx + cos(-ang)*radius, centy + sin(-ang)*radius); + } +/* ************ custom buttons, old stuff ************** */ + /* draws in resolution of 20x4 colors */ static void ui_draw_but_HSVCUBE(uiBut *but, rcti *rect) { @@ -1366,7 +1418,7 @@ static void ui_draw_but_HSVCUBE(uiBut *but, rcti *rect) hsv_to_rgb(h, 1.0, 0.0, &col1[3][0], &col1[3][1], &col1[3][2]); x= v; y= s; } - else { // only hue slider + else if(but->a1==3) { // only hue slider hsv_to_rgb(0.0, 1.0, 1.0, &col1[0][0], &col1[0][1], &col1[0][2]); VECCOPY(col1[1], col1[0]); VECCOPY(col1[2], col1[0]); @@ -1400,7 +1452,7 @@ static void ui_draw_but_HSVCUBE(uiBut *but, rcti *rect) hsv_to_rgb(h, 0.666, dx, &col1[2][0], &col1[2][1], &col1[2][2]); hsv_to_rgb(h, 1.0, dx, &col1[3][0], &col1[3][1], &col1[3][2]); } - else { // only H + else if(but->a1==3) { // only H hsv_to_rgb(dx, 1.0, 1.0, &col1[0][0], &col1[0][1], &col1[0][2]); VECCOPY(col1[1], col1[0]); VECCOPY(col1[2], col1[0]); @@ -1438,13 +1490,42 @@ static void ui_draw_but_HSVCUBE(uiBut *but, rcti *rect) CLAMP(x, rect->xmin+3.0, rect->xmax-3.0); CLAMP(y, rect->ymin+3.0, rect->ymax-3.0); - fdrawXORcirc(x, y, 3.1); + ui_hsv_cursor(x, y); /* outline */ glColor3ub(0, 0, 0); fdrawbox((rect->xmin), (rect->ymin), (rect->xmax), (rect->ymax)); } +/* vertical 'value' slider, using new widget code */ +static void ui_draw_but_HSV_v(uiBut *but, rcti *rect) +{ + uiWidgetBase wtb; + float rad= 0.5f*(rect->xmax - rect->xmin); + float x, y; + + widget_init(&wtb); + + /* fully rounded */ + round_box_edges(&wtb, 15, rect, rad); + + /* setup temp colors */ + wcol_tmp.outline[0]= wcol_tmp.outline[1]= wcol_tmp.outline[2]= 0; + wcol_tmp.inner[0]= wcol_tmp.inner[1]= wcol_tmp.inner[2]= 128; + wcol_tmp.shadetop= 127; + wcol_tmp.shadedown= -128; + wcol_tmp.shaded= 1; + + widgetbase_draw(&wtb, &wcol_tmp); + + /* cursor */ + x= rect->xmin + 0.5f*(rect->xmax-rect->xmin); + y= rect->ymin + but->hsv[2]*(rect->ymax-rect->ymin); + CLAMP(y, rect->ymin+3.0, rect->ymax-3.0); + + ui_hsv_cursor(x, y); + +} /* ************ button callbacks, draw ***************** */ @@ -1930,35 +2011,43 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct fstyle= &style->widgetlabel; } break; + case SEPR: break; + case BUT: wt= widget_type(UI_WTYPE_EXEC); break; case NUM: wt= widget_type(UI_WTYPE_NUMBER); break; + case NUMSLI: case HSVSLI: wt= widget_type(UI_WTYPE_SLIDER); break; + case ROW: wt= widget_type(UI_WTYPE_RADIO); break; + case TEX: wt= widget_type(UI_WTYPE_NAME); break; + case SEARCH_MENU: wt= widget_type(UI_WTYPE_NAME); if(but->block->flag & UI_BLOCK_LOOP) wt->wcol_theme= &btheme->tui.wcol_menu_back; break; + case TOGBUT: case TOG: case TOGN: case TOG3: wt= widget_type(UI_WTYPE_TOGGLE); break; + case OPTION: case OPTIONN: if (!(but->flag & UI_HAS_ICON)) { @@ -1968,6 +2057,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct else wt= widget_type(UI_WTYPE_TOGGLE); break; + case MENU: case BLOCK: case ICONTEXTROW: @@ -1994,16 +2084,25 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct widget_draw_extra_mask(C, but, widget_type(UI_WTYPE_BOX), rect); break; - // XXX four old button types case HSVCUBE: - ui_draw_but_HSVCUBE(but, rect); + if(but->a1==4) // vertical V slider, uses new widget draw now + ui_draw_but_HSV_v(but, rect); + else // other HSV pickers... + ui_draw_but_HSVCUBE(but, rect); + break; + + case HSVCIRCLE: + ui_draw_but_HSVCIRCLE(but, rect); break; + case BUT_COLORBAND: ui_draw_but_COLORBAND(but, &tui->wcol_regular, rect); break; + case BUT_NORMAL: ui_draw_but_NORMAL(but, &tui->wcol_regular, rect); break; + case BUT_CURVE: ui_draw_but_CURVE(ar, but, &tui->wcol_regular, rect); break; diff --git a/source/blender/editors/preview/previewrender.c b/source/blender/editors/preview/previewrender.c index 1435ca7290b..1ce20fcb0af 100644 --- a/source/blender/editors/preview/previewrender.c +++ b/source/blender/editors/preview/previewrender.c @@ -665,7 +665,6 @@ void ED_preview_draw(const bContext *C, void *idp, rcti *rect) } if(ok==0) { - printf("added shader job\n"); ED_preview_shader_job(C, sa, idp, newx, newy); } } -- cgit v1.2.3 From 7910d458076ea1605c8ef581e2f037be3684979a Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Fri, 12 Jun 2009 14:48:11 +0000 Subject: 2.5 RNA: * Added some more notifiers to userdef. * Removed "yafray_export_directory" property. --- source/blender/makesrna/intern/rna_userdef.c | 44 +++++++++++++++++++++------- 1 file changed, 33 insertions(+), 11 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 1963e48b00f..7e14f8e2f5b 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -135,33 +135,39 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna) prop= RNA_def_property(srna, "points", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 6, 48); RNA_def_property_ui_text(prop, "Points", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "kerning", PROP_INT, PROP_NONE); RNA_def_property_range(prop, -5, 5); RNA_def_property_ui_text(prop, "Kerning", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 5); RNA_def_property_ui_text(prop, "Shadow Size", "Shadow size in pixels (0, 3 and 5 supported)"); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "shadx", PROP_INT, PROP_NONE); RNA_def_property_range(prop, -10, 10); RNA_def_property_ui_text(prop, "Shadow X Offset", "Shadow offset in pixels"); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "shady", PROP_INT, PROP_NONE); RNA_def_property_range(prop, -10, 10); RNA_def_property_ui_text(prop, "Shadow Y Offset", "Shadow offset in pixels"); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "shadowalpha", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Shadow Alpha", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "shadowcolor", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in grey value"); + RNA_def_property_update(prop, NC_WINDOW, NULL); } - static void rna_def_userdef_theme_ui_style(BlenderRNA *brna) { StructRNA *srna; @@ -177,21 +183,25 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "paneltitle"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Panel Font", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "grouplabel", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "grouplabel"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Group Label Font", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "widgetlabel", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Widget Label Font", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "widget"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Widget Font", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); } @@ -207,38 +217,47 @@ static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna) prop= RNA_def_property(srna, "outline", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Outline", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "inner", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Inner", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "inner_sel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Inner Selected", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "item", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Item", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Text", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "text_sel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Text Selected", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "shaded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shaded", 1); RNA_def_property_ui_text(prop, "Shaded", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "shadetop", PROP_INT, PROP_NONE); RNA_def_property_range(prop, -100, 100); RNA_def_property_ui_text(prop, "Shade Top", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "shadedown", PROP_INT, PROP_NONE); RNA_def_property_range(prop, -100, 100); RNA_def_property_ui_text(prop, "Shade Down", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); } @@ -1402,23 +1421,28 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "display_object_info", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO); - RNA_def_property_ui_text(prop, "Display Object Info", "Display and objects name and frame number in 3d view."); + RNA_def_property_ui_text(prop, "Display Object Info", "Display objects name and frame number in 3d view."); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "global_scene", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SCENEGLOBAL); RNA_def_property_ui_text(prop, "Global Scene", "Forces the current Scene to be displayed in all Screens."); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "use_large_cursors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "curssize", 0); RNA_def_property_ui_text(prop, "Large Cursors", "Use large mouse cursors when available."); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "show_view_name", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_VIEWPORTNAME); RNA_def_property_ui_text(prop, "Show View Name", "Show the name of the view's direction in each 3D View."); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_FPS); RNA_def_property_ui_text(prop, "Show Playback FPS", "Show the frames per second screen refresh rate, while animation is played back."); + RNA_def_property_update(prop, NC_WINDOW, NULL); /* menus */ prop= RNA_def_property(srna, "open_mouse_over", PROP_BOOLEAN, PROP_NONE); @@ -1789,33 +1813,40 @@ static void rna_def_userdef_language(BlenderRNA *brna) prop= RNA_def_property(srna, "international_fonts", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE); RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts."); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dpi"); RNA_def_property_range(prop, 48, 128); RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display."); + RNA_def_property_update(prop, NC_WINDOW, NULL); /* Language Selection */ prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, language_items); RNA_def_property_ui_text(prop, "Language", "Language use for translation."); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "translate_tooltips", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS); RNA_def_property_ui_text(prop, "Translate Tooltips", "Translate Tooltips."); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "translate_buttons", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_BUTTONS); RNA_def_property_ui_text(prop, "Translate Buttons", "Translate button labels."); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "translate_toolbox", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_MENUS); RNA_def_property_ui_text(prop, "Translate Toolbox", "Translate toolbox menu."); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "use_textured_fonts", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_USETEXTUREFONT); RNA_def_property_ui_text(prop, "Textured Fonts", "Use textures for drawing international fonts."); + RNA_def_property_update(prop, NC_WINDOW, NULL); } static void rna_def_userdef_autosave(BlenderRNA *brna) @@ -2005,10 +2036,6 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_FILECOMPRESS); RNA_def_property_ui_text(prop, "Compress File", "Enable file compression when saving .blend files."); - prop= RNA_def_property(srna, "yafray_export_directory", PROP_STRING, PROP_DIRPATH); - RNA_def_property_string_sdna(prop, NULL, "yfexportdir"); - RNA_def_property_ui_text(prop, "Yafray Export Directory", "The default directory for yafray xml export (must exist!)."); - prop= RNA_def_property(srna, "fonts_directory", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_sdna(prop, NULL, "fontdir"); RNA_def_property_ui_text(prop, "Fonts Directory", "The default directory to search for loading fonts."); @@ -2117,11 +2144,6 @@ void RNA_def_userdef(BlenderRNA *brna) rna_def_userdef_filepaths(brna); rna_def_userdef_system(brna); - - - - - } #endif -- cgit v1.2.3 From 63abf1ec6cf2ac57af09af8c3334403ff8160479 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 12 Jun 2009 15:11:51 +0000 Subject: 2.5 Fix for new picker: mouse move out of menu was handled as restore... added new block flag UI_BLOCK_OUT_1 to denote it shouldn't. --- source/blender/editors/include/UI_interface.h | 1 + source/blender/editors/interface/interface_handlers.c | 8 ++++++-- source/blender/editors/interface/interface_regions.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index dea408f818a..48a859dadc4 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -91,6 +91,7 @@ typedef struct uiLayout uiLayout; #define UI_BLOCK_MOVEMOUSE_QUIT 128 #define UI_BLOCK_KEEP_OPEN 256 #define UI_BLOCK_POPUP 512 +#define UI_BLOCK_OUT_1 1024 /* uiPopupBlockHandle->menuretval */ #define UI_RETURN_CANCEL 1 /* cancel all menus cascading */ diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index bda16584811..0f6dbc430fb 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3812,8 +3812,12 @@ int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle *menu, } /* strict check, and include the parent rect */ - if(!menu->dotowards && !saferct) - menu->menuretval= (block->flag & UI_BLOCK_KEEP_OPEN)? UI_RETURN_OK: UI_RETURN_OUT; + if(!menu->dotowards && !saferct) { + if(block->flag & UI_BLOCK_OUT_1) + menu->menuretval= UI_RETURN_OK; + else + menu->menuretval= (block->flag & UI_BLOCK_KEEP_OPEN)? UI_RETURN_OK: UI_RETURN_OUT; + } else if(menu->dotowards && event->type==MOUSEMOVE) retval= WM_UI_HANDLER_BREAK; } diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 89654f0ffab..7ccb6c5163b 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1792,7 +1792,7 @@ uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_bu } else { uiBlockPickerSmall(block, handle->retvec, hsvcol, oldcol, hexcol, 'p', 0); - block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1; + block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_OUT_1; uiBoundsBlock(block, 10); block->block_event_func= ui_picker_small_wheel; -- cgit v1.2.3 From 845e9a0e25ab7257005288fe2938a8ca9ca856d2 Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Fri, 12 Jun 2009 17:18:59 +0000 Subject: Made the kerning a float, this give a little more of tweak. 0.5 is the default value now, the range are from -5.0 to 5.0. Note that we allow negative value, but the current draw code always check for overlap characters. --- source/blender/blenfont/BLF_api.h | 2 +- source/blender/blenfont/intern/blf.c | 2 +- source/blender/blenfont/intern/blf_font.c | 6 +++--- source/blender/blenfont/intern/blf_internal_types.h | 2 +- source/blender/editors/interface/interface_style.c | 8 ++++---- source/blender/makesdna/DNA_userdef_types.h | 4 ++-- source/blender/makesrna/intern/rna_userdef.c | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) (limited to 'source') diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index d1d802622ea..e871de490f3 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -85,7 +85,7 @@ float BLF_height_default(char *str); void BLF_rotation(float angle); void BLF_clipping(float xmin, float ymin, float xmax, float ymax); void BLF_blur(int size); -void BLF_kerning(int space); +void BLF_kerning(float space); void BLF_enable(int option); void BLF_disable(int option); diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index ffb845f7888..f06c7fb0d28 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -492,7 +492,7 @@ void BLF_mode(int mode) font->mode= mode; } -void BLF_kerning(int space) +void BLF_kerning(float space) { FontBLF *font; diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index df77aee70e8..5a3b3207e29 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -100,7 +100,7 @@ void blf_font_draw(FontBLF *font, char *str) GlyphBLF *g, *g_prev; FT_Vector delta; FT_UInt glyph_index, g_prev_index; - int pen_x, pen_y, old_pen_x; + float pen_x, pen_y, old_pen_x; int i, has_kerning; if (!font->glyph_cache) @@ -159,7 +159,7 @@ void blf_font_draw(FontBLF *font, char *str) } /* do not return this loop if clipped, we want every character tested */ - blf_glyph_render(font, g, (float)pen_x, (float)pen_y); + blf_glyph_render(font, g, pen_x, pen_y); pen_x += g->advance; g_prev= g; @@ -321,7 +321,7 @@ void blf_font_fill(FontBLF *font) font->flags= BLF_USER_KERNING; font->dpi= 0; font->size= 0; - font->kerning= 0; + font->kerning= 0.0f; font->cache.first= NULL; font->cache.last= NULL; font->glyph_cache= NULL; diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h index d200d910020..60446aa93b2 100644 --- a/source/blender/blenfont/intern/blf_internal_types.h +++ b/source/blender/blenfont/intern/blf_internal_types.h @@ -168,7 +168,7 @@ typedef struct FontBLF { int size; /* kerning space, user setting. */ - int kerning; + float kerning; /* max texture size. */ int max_tex_size; diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index a3959327ccd..f1d29ac8688 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -91,7 +91,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->paneltitle.uifont_id= UIFONT_DEFAULT; style->paneltitle.points= 13; - style->paneltitle.kerning= 1; + style->paneltitle.kerning= 0.5; style->paneltitle.shadow= 5; style->paneltitle.shadx= 2; style->paneltitle.shady= -2; @@ -100,7 +100,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->grouplabel.uifont_id= UIFONT_DEFAULT; style->grouplabel.points= 12; - style->grouplabel.kerning= 1; + style->grouplabel.kerning= 0.5; style->grouplabel.shadow= 3; style->grouplabel.shadx= 1; style->grouplabel.shady= -1; @@ -108,7 +108,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->widgetlabel.uifont_id= UIFONT_DEFAULT; style->widgetlabel.points= 11; - style->widgetlabel.kerning= 1; + style->widgetlabel.kerning= 0.5; style->widgetlabel.shadow= 3; style->widgetlabel.shadx= 1; style->widgetlabel.shady= -1; @@ -117,7 +117,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->widget.uifont_id= UIFONT_DEFAULT; style->widget.points= 11; - style->widget.kerning= 1; + style->widget.kerning= 0.5; style->widget.shadowalpha= 0.25f; style->columnspace= 5; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index c99992cb126..87931f8e93d 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -66,8 +66,8 @@ typedef struct uiFont { typedef struct uiFontStyle { short uifont_id; /* saved in file, 0 is default */ short points; /* actual size depends on 'global' dpi */ - short kerning; /* kerning space between characters. */ - char pad[6]; + float kerning; /* kerning space between characters. */ + float pad; short italic, bold; /* style hint */ short shadow; /* value is amount of pixels blur */ short shadx, shady; /* shadow offset in pixels */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 7e14f8e2f5b..082e4896d16 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -137,8 +137,8 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Points", ""); RNA_def_property_update(prop, NC_WINDOW, NULL); - prop= RNA_def_property(srna, "kerning", PROP_INT, PROP_NONE); - RNA_def_property_range(prop, -5, 5); + prop= RNA_def_property(srna, "kerning", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, -5.0, 5.0); RNA_def_property_ui_text(prop, "Kerning", ""); RNA_def_property_update(prop, NC_WINDOW, NULL); -- cgit v1.2.3 From fe329792b4087add019508b0cb02aed0034c3651 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 13 Jun 2009 01:30:47 +0000 Subject: remove warnings --- source/blender/makesrna/intern/rna_sequence.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index 754a3b44182..b21e08fcd1a 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -36,6 +36,8 @@ #include "BKE_sequence.h" +#include "MEM_guardedalloc.h" + #ifdef RNA_RUNTIME static int rna_SequenceEditor_name_length(PointerRNA *ptr) @@ -99,7 +101,7 @@ static void rna_SequenceEditor_channel_set(PointerRNA *ptr, int value) } /* properties that need to allocate structs */ -static int rna_SequenceEditor_use_color_balance_set(PointerRNA *ptr, int value) +static void rna_SequenceEditor_use_color_balance_set(PointerRNA *ptr, int value) { Sequence *seq= (Sequence*)ptr->data; int c; @@ -119,7 +121,7 @@ static int rna_SequenceEditor_use_color_balance_set(PointerRNA *ptr, int value) } } -static int rna_SequenceEditor_use_proxy_set(PointerRNA *ptr, int value) +static void rna_SequenceEditor_use_proxy_set(PointerRNA *ptr, int value) { Sequence *seq= (Sequence*)ptr->data; if(value) { @@ -132,7 +134,7 @@ static int rna_SequenceEditor_use_proxy_set(PointerRNA *ptr, int value) } } -static int rna_SequenceEditor_use_translation_set(PointerRNA *ptr, int value) +static void rna_SequenceEditor_use_translation_set(PointerRNA *ptr, int value) { Sequence *seq= (Sequence*)ptr->data; if(value) { @@ -145,7 +147,7 @@ static int rna_SequenceEditor_use_translation_set(PointerRNA *ptr, int value) } } -static int rna_SequenceEditor_use_crop_set(PointerRNA *ptr, int value) +static void rna_SequenceEditor_use_crop_set(PointerRNA *ptr, int value) { Sequence *seq= (Sequence*)ptr->data; if(value) { -- cgit v1.2.3 From 03de57c6d5a72b30014ed7753525af1df4feba93 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Sat, 13 Jun 2009 03:08:58 +0000 Subject: coverity issue CID: 523 Checker: UNINIT (help) File: base/src/source/blender/blenlib/intern/freetypefont.c Function: objchr_to_ftvfontdata Description: Using uninitialized value "face" in call to function "freetypechar_to_vchar" freetypechar_to_vchar expects face to be defined so we need to return before then if we have a problem. Also it doesn't make sense to not return FALSE if there is an error because we didn't do anything. Kent --- source/blender/blenlib/intern/freetypefont.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c index a97f2460ba1..da415377073 100644 --- a/source/blender/blenlib/intern/freetypefont.c +++ b/source/blender/blenlib/intern/freetypefont.c @@ -301,9 +301,12 @@ int objchr_to_ftvfontdata(VFont *vfont, FT_ULong charcode) tf->pf->size, 0, &face); + if (err) return FALSE; + } + else { + err = TRUE; + return FALSE; } - else - err= TRUE; // Read the char freetypechar_to_vchar(face, charcode, vfont->data); -- cgit v1.2.3 From d35d04a78961946145be256ed1ff45342f7633b8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 13 Jun 2009 06:42:12 +0000 Subject: text live_edit feature useful for UI scripts (run python scripts on every keystroke, careful with the os module) http://www.graphicall.org/ftp/ideasman42/realtime_ui.ogv current kerning makes this a bit cryptic. --- source/blender/editors/space_text/text_ops.c | 28 ++++++++++++++++++++++++---- source/blender/makesdna/DNA_space_types.h | 3 ++- source/blender/makesrna/intern/rna_space.c | 3 +++ 3 files changed, 29 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 065b4ffcc48..ebb42aa2098 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -524,7 +524,10 @@ static int run_script_exec(bContext *C, wmOperator *op) if (BPY_run_python_script( C, NULL, text )) return OPERATOR_FINISHED; - BKE_report(op->reports, RPT_ERROR, "Python script fail, look in the console for now..."); + /* Dont report error messages while live editing */ + if(!CTX_wm_space_text(C)->live_edit) + BKE_report(op->reports, RPT_ERROR, "Python script fail, look in the console for now..."); + return OPERATOR_CANCELLED; #endif } @@ -699,6 +702,10 @@ static int paste_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, text); WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text); + /* run the script while editing, evil but useful */ + if(CTX_wm_space_text(C)->live_edit) + run_script_exec(C, op); + return OPERATOR_FINISHED; } @@ -765,6 +772,10 @@ static int cut_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, text); WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text); + /* run the script while editing, evil but useful */ + if(CTX_wm_space_text(C)->live_edit) + run_script_exec(C, op); + return OPERATOR_FINISHED; } @@ -1627,6 +1638,10 @@ static int delete_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_TEXT|ND_CURSOR, text); WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text); + /* run the script while editing, evil but useful */ + if(CTX_wm_space_text(C)->live_edit) + run_script_exec(C, op); + return OPERATOR_FINISHED; } @@ -2224,7 +2239,7 @@ static int insert_exec(bContext *C, wmOperator *op) static int insert_invoke(bContext *C, wmOperator *op, wmEvent *event) { char str[2]; - + int ret; /* XXX old code from winqreadtextspace, is it still needed somewhere? */ /* smartass code to prevent the CTRL/ALT events below from not working! */ /*if(qual & (LR_ALTKEY|LR_CTRLKEY)) @@ -2235,8 +2250,13 @@ static int insert_invoke(bContext *C, wmOperator *op, wmEvent *event) str[1]= '\0'; RNA_string_set(op->ptr, "text", str); - - return insert_exec(C, op); + ret = insert_exec(C, op); + + /* run the script while editing, evil but useful */ + if(ret==OPERATOR_FINISHED && CTX_wm_space_text(C)->live_edit) + run_script_exec(C, op); + + return ret; } void TEXT_OT_insert(wmOperatorType *ot) diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 3864bcd0a21..4c2c2520ee3 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -272,7 +272,8 @@ typedef struct SpaceText { int tabnumber; int showsyntax; - int overwrite; + short overwrite; + short live_edit; /* run python while editing, evil */ float pix_per_line; struct rcti txtscroll, txtbar; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 5de80cce2b5..a27c7926428 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -726,6 +726,9 @@ static void rna_def_space_text(BlenderRNA *brna) prop= RNA_def_property(srna, "overwrite", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them."); RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); + + prop= RNA_def_property(srna, "live_edit", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing."); prop= RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tabnumber"); -- cgit v1.2.3 From e10e1ac04e63ed04a5712e515ed28eb92a78fd62 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 13 Jun 2009 08:04:43 +0000 Subject: adding __contains__ to python rna props. example usage. if "Scene" in bpy.data.scenes: print(True) Only works for strings with collection property types. --- source/blender/python/intern/bpy_rna.c | 35 +++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 12c19bd3471..207ca41ed46 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -763,6 +763,39 @@ static PyMappingMethods pyrna_prop_as_mapping = { ( objobjargproc ) pyrna_prop_assign_subscript, /* mp_ass_subscript */ }; +static int pyrna_prop_contains(BPy_PropertyRNA * self, PyObject *value) +{ + PointerRNA newptr; /* not used, just so RNA_property_collection_lookup_string runs */ + char *keyname = _PyUnicode_AsString(value); + + if(keyname==NULL) { + PyErr_SetString(PyExc_SystemError, "PropertyRNA - key in prop, key must be a string type"); + return -1; + } + + if (RNA_property_type(self->prop) != PROP_COLLECTION) { + PyErr_SetString(PyExc_SystemError, "PropertyRNA - key in prop, is only valid for collection types"); + return -1; + } + + + if (RNA_property_collection_lookup_string(&self->ptr, self->prop, keyname, &newptr)) + return 1; + + return 0; +} + +static PySequenceMethods pyrna_prop_as_sequence = { + NULL, /* Cant set the len otherwise it can evaluate as false */ + NULL, /* sq_concat */ + NULL, /* sq_repeat */ + NULL, /* sq_item */ + NULL, /* sq_slice */ + NULL, /* sq_ass_item */ + NULL, /* sq_ass_slice */ + (objobjproc)pyrna_prop_contains, /* sq_contains */ +}; + static PyObject *pyrna_struct_dir(BPy_StructRNA * self) { PyObject *ret, *dict; @@ -1403,7 +1436,7 @@ PyTypeObject pyrna_prop_Type = { /* Method suites for standard classes */ NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ + &pyrna_prop_as_sequence, /* PySequenceMethods *tp_as_sequence; */ &pyrna_prop_as_mapping, /* PyMappingMethods *tp_as_mapping; */ /* More standard operations (here for binary compatibility) */ -- cgit v1.2.3 From cd3c52db0334950f85911cca9f7b834647950f7b Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 13 Jun 2009 11:21:02 +0000 Subject: 2.5 - Armature Buttons + UI-Templates Added a new template for layer-buttons, which auto-determines the layout of the buttons instead of relying on some hardcoded pattern for n-layers (i.e. 16 or 20 currently). This is a still bit rough, and could do with some refining to allow us to define what extra info (icons) should get drawn on the buttons or so. Currently, this is only used in the Armature buttons to allow showing/hiding layers. --- source/blender/editors/include/UI_interface.h | 1 + source/blender/editors/interface/interface_api.c | 6 +++ .../editors/interface/interface_templates.c | 53 ++++++++++++++++++++++ 3 files changed, 60 insertions(+) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 48a859dadc4..eb3a037d7b1 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -615,6 +615,7 @@ uiLayout *uiTemplateConstraint(uiLayout *layout, struct PointerRNA *ptr); void uiTemplatePreview(uiLayout *layout, struct ID *id); void uiTemplateColorRamp(uiLayout *layout, struct ColorBand *coba, int expand); void uiTemplateCurveMapping(uiLayout *layout, struct CurveMapping *cumap, int type); +void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, char *propname); /* items */ void uiItemO(uiLayout *layout, char *name, int icon, char *opname); diff --git a/source/blender/editors/interface/interface_api.c b/source/blender/editors/interface/interface_api.c index 60bfe4e79ad..b4e7dc03506 100644 --- a/source/blender/editors/interface/interface_api.c +++ b/source/blender/editors/interface/interface_api.c @@ -230,5 +230,11 @@ void RNA_api_ui_layout(StructRNA *srna) parm= RNA_def_pointer(func, "ramp", "ColorRamp", "", "Color ramp pointer."); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); + + func= RNA_def_function(srna, "template_layers", "uiTemplateLayers"); + parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of pointer property in data."); + RNA_def_property_flag(parm, PROP_REQUIRED); } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 53238a306cd..63de328af0f 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1439,3 +1439,56 @@ void uiTemplateCurveMapping(uiLayout *layout, CurveMapping *cumap, int type) } } +/********************* Layer Buttons Template ************************/ + +// TODO: +// - option for showing extra info like whether layer has contents? +// - for now, grouping of layers is determined by dividing up the length of +// the array of layer bitflags + +void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, char *propname) +{ + uiBlock *block; + uiLayout *uRow, *uSplit, *uCol; + PropertyRNA *prop; + StructRNA *type; + int groups, cols, layers; + int group, col, layer, row; + + if (!ptr->data) + return; + + prop= RNA_struct_find_property(ptr, propname); + if (!prop) { + printf("uiTemplateLayer: layers property not found: %s\n", propname); + return; + } + + /* the number of layers determines the way we group them + * - we want 2 rows only (for now) + * - the number of columns (cols) is the total number of buttons per row + * the 'remainder' is added to this, as it will be ok to have first row slightly wider if need be + * - for now, only split into groups if if group will have at least 5 items + */ + layers= RNA_property_array_length(prop); + cols= (layers / 2) + (layers % 2); + groups= ((cols / 2) < 5) ? (1) : (cols / 2); + + /* layers are laid out going across rows, with the columns being divided into groups */ + uSplit= uiLayoutSplit(layout, (1.0f/(float)groups)); + + for (group= 0; group < groups; group++) { + uCol= uiLayoutColumn(uSplit, 1); + + for (row= 0; row < 2; row++) { + uRow= uiLayoutRow(uCol, 1); + layer= groups*cols*row + cols*group; + + /* add layers as toggle buts */ + for (col= 0; (col < cols) && (layer < layers); col++, layer++) { + int icon=0; // XXX - add some way of setting this... + uiItemFullR(uRow, "", icon, ptr, prop, layer, 0, 0, 0, 1); + } + } + } +} -- cgit v1.2.3 From c7debe1455f4e48e98ccb7af385dc1b1075f83e6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 13 Jun 2009 11:28:29 +0000 Subject: allow building without SDL --- source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp index d83179d4f80..6140702534c 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp @@ -158,12 +158,13 @@ bool SCA_Joystick::aAxisIsPositive(int axis_single) bool SCA_Joystick::aAnyButtonPressIsPositive(void) { +#ifndef DISABLE_SDL /* this is needed for the "all events" option * so we know if there are no buttons pressed */ for (int i=0; im_joystick, i)) return true; - +#endif return false; } -- cgit v1.2.3 From d7e06a6d91dc2773bb8c4d0b6a0d8e71c775e02c Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 13 Jun 2009 11:52:33 +0000 Subject: 2.5 - Armature/Bone Tweaks - Changing visible layers for armatures now sends notifiers - Made the bone buttons show the layers data TODO: I also tried making the bone buttons show for 'PoseChannels' instead of the raw bones since this is more correct for most editing that can be done (i.e. when posing). For editmode though, we'd need to wrap EditBones in some way? However, I couldn't seem to get this to work due to the way paths are resolved. --- source/blender/makesrna/intern/rna_armature.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index d49e5d14714..aa74e7429e2 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -32,6 +32,8 @@ #include "DNA_armature_types.h" #include "DNA_scene_types.h" +#include "WM_types.h" + #ifdef RNA_RUNTIME static void rna_Bone_layer_set(PointerRNA *ptr, const int *values) @@ -294,6 +296,7 @@ void rna_def_armature(BlenderRNA *brna) RNA_def_property_array(prop, 16); RNA_def_property_ui_text(prop, "Visible Layers", "Armature layer visibility."); RNA_def_property_boolean_funcs(prop, NULL, "rna_Armature_layer_set"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, NULL); /* layer protection */ prop= RNA_def_property(srna, "layer_protection", PROP_BOOLEAN, PROP_NONE); -- cgit v1.2.3 From b40eb540d3a49c710bbd10effa9d9db04a915347 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 13 Jun 2009 13:02:01 +0000 Subject: G.sipo was being passed in the BGE when it wasnt needed, just access G.sipo directly. KX_PythonSeq.cpp - disable the cmpfunc with py3, need to have richcmp. --- source/blender/src/space.c | 8 ++++---- source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 6 ++---- source/gameengine/Converter/KX_BlenderSceneConverter.cpp | 10 ++++------ source/gameengine/Converter/KX_BlenderSceneConverter.h | 5 +---- source/gameengine/GamePlayer/ghost/GPG_Application.cpp | 2 +- source/gameengine/Ketsji/KX_PythonSeq.cpp | 4 ++++ 6 files changed, 16 insertions(+), 19 deletions(-) (limited to 'source') diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 8ff2b526ae8..1e845376952 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -194,8 +194,8 @@ #include "BLO_sys_types.h" // for intptr_t support /* maybe we need this defined somewhere else */ -extern void StartKetsjiShell(ScrArea *area, char* startscenename, struct Main* maggie, struct SpaceIpo* sipo,int always_use_expand_framing); -extern void StartKetsjiShellSimulation(ScrArea *area, char* startscenename, struct Main* maggie, struct SpaceIpo* sipo,int always_use_expand_framing);/*rcruiz*/ +extern void StartKetsjiShell(ScrArea *area, char* startscenename, struct Main* maggie,int always_use_expand_framing); +extern void StartKetsjiShellSimulation(ScrArea *area, char* startscenename, struct Main* maggie, int always_use_expand_framing);/*rcruiz*/ /** * When the mipmap setting changes, we want to redraw the view right @@ -556,7 +556,7 @@ void start_game(void) space_set_commmandline_options(); SaveState(); - StartKetsjiShell(curarea, startscene->id.name+2, G.main,G.sipo, 1); + StartKetsjiShell(curarea, startscene->id.name+2, G.main, 1); RestoreState(); /* Restart BPY - unload the game engine modules. */ @@ -634,7 +634,7 @@ void start_RBSimulation(void) space_set_commmandline_options(); SaveState(); - StartKetsjiShellSimulation(curarea, startscene->id.name+2, G.main,G.sipo, 1); + StartKetsjiShellSimulation(curarea, startscene->id.name+2, G.main, 1); RestoreState(); /* Restart BPY - unload the game engine modules. */ diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 38a2ccd5d79..ec751376d4a 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -104,7 +104,6 @@ static BlendFileData *load_game_data(char *filename) { extern "C" void StartKetsjiShell(struct ScrArea *area, char* scenename, struct Main* maggie1, - struct SpaceIpo *sipo, int always_use_expand_framing) { int exitrequested = KX_EXIT_REQUEST_NO_REQUEST; @@ -330,7 +329,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, } // create a scene converter, create and convert the startingscene - KX_ISceneConverter* sceneconverter = new KX_BlenderSceneConverter(blenderdata,sipo, ketsjiengine); + KX_ISceneConverter* sceneconverter = new KX_BlenderSceneConverter(blenderdata, ketsjiengine); ketsjiengine->SetSceneConverter(sceneconverter); sceneconverter->addInitFromFrame=false; if (always_use_expand_framing) @@ -549,7 +548,6 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, extern "C" void StartKetsjiShellSimulation(struct ScrArea *area, char* scenename, struct Main* maggie, - struct SpaceIpo *sipo, int always_use_expand_framing) { int exitrequested = KX_EXIT_REQUEST_NO_REQUEST; @@ -648,7 +646,7 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area, if (exitrequested != KX_EXIT_REQUEST_QUIT_GAME) { // create a scene converter, create and convert the startingscene - KX_ISceneConverter* sceneconverter = new KX_BlenderSceneConverter(maggie,sipo, ketsjiengine); + KX_ISceneConverter* sceneconverter = new KX_BlenderSceneConverter(maggie, ketsjiengine); ketsjiengine->SetSceneConverter(sceneconverter); sceneconverter->addInitFromFrame=true; diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 646e569a27e..42b96d65622 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -94,11 +94,9 @@ extern "C" KX_BlenderSceneConverter::KX_BlenderSceneConverter( struct Main* maggie, - struct SpaceIpo* sipo, class KX_KetsjiEngine* engine ) : m_maggie(maggie), - m_sipo(sipo), m_ketsjiEngine(engine), m_alwaysUseExpandFraming(false), m_usemat(false), @@ -641,13 +639,13 @@ void KX_BlenderSceneConverter::RegisterWorldInfo( * When deleting an IPO curve from Python, check if the IPO is being * edited and if so clear the pointer to the old curve. */ -void KX_BlenderSceneConverter::localDel_ipoCurve ( IpoCurve * icu ,struct SpaceIpo* sipo) +void KX_BlenderSceneConverter::localDel_ipoCurve ( IpoCurve * icu) { - if (!sipo) + if (!G.sipo) return; int i; - EditIpo *ei= (EditIpo *)sipo->editipo; + EditIpo *ei= (EditIpo *)G.sipo->editipo; if (!ei) return; for(i=0; itotipo; i++, ei++) { @@ -751,7 +749,7 @@ void KX_BlenderSceneConverter::ResetPhysicsObjectsAnimationIpo(bool clearIpo) if( tmpicu->bezt ) MEM_freeN( tmpicu->bezt ); MEM_freeN( tmpicu ); - localDel_ipoCurve( tmpicu ,m_sipo); + localDel_ipoCurve( tmpicu ); } } } else diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h index f7c1a506457..cf8dd5b339a 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.h +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h @@ -44,7 +44,6 @@ class BL_InterpolatorList; class BL_Material; struct IpoCurve; struct Main; -struct SpaceIpo; struct Scene; class KX_BlenderSceneConverter : public KX_ISceneConverter @@ -69,7 +68,6 @@ class KX_BlenderSceneConverter : public KX_ISceneConverter GEN_Map m_map_blender_to_gameipolist; Main* m_maggie; - SpaceIpo* m_sipo; STR_String m_newfilename; class KX_KetsjiEngine* m_ketsjiEngine; @@ -78,13 +76,12 @@ class KX_BlenderSceneConverter : public KX_ISceneConverter bool m_usemat; bool m_useglslmat; - void localDel_ipoCurve ( IpoCurve * icu ,struct SpaceIpo* sipo); + void localDel_ipoCurve ( IpoCurve * icu ); // struct Ipo* findIpoForName(char* objName); public: KX_BlenderSceneConverter( Main* maggie, - SpaceIpo *sipo, class KX_KetsjiEngine* engine ); diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index 8a594f7365d..bd332e8bbd7 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -663,7 +663,7 @@ bool GPG_Application::startEngine(void) */ // create a scene converter, create and convert the stratingscene - m_sceneconverter = new KX_BlenderSceneConverter(m_maggie,0, m_ketsjiengine); + m_sceneconverter = new KX_BlenderSceneConverter(m_maggie, m_ketsjiengine); if (m_sceneconverter) { STR_String startscenename = m_startSceneName.Ptr(); diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp index cc8021fc2e4..f2bc4671f4e 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.cpp +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -313,7 +313,11 @@ PyTypeObject KX_PythonSeq_Type = { NULL, /* printfunc tp_print; */ NULL, /* getattrfunc tp_getattr; */ NULL, /* setattrfunc tp_setattr; */ +#if PY_VERSION_HEX >= 0x03000000 // TODO - richcmp + NULL, +#else ( cmpfunc ) KX_PythonSeq_compare, /* cmpfunc tp_compare; */ +#endif ( reprfunc ) KX_PythonSeq_repr, /* reprfunc tp_repr; */ /* Method suites for standard classes */ -- cgit v1.2.3 From b592b6e8be051d590a6fa1806d44809c75df6515 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 13 Jun 2009 13:57:56 +0000 Subject: convert non-string pyoperator exceptions into strings if they are not already. --- source/blender/python/intern/bpy_operator_wrap.c | 37 +++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index 6ab990acdf5..8cd1bc64f11 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -140,12 +140,47 @@ static PyObject *pyop_dict_from_event(wmEvent *event) /* TODO - a whole traceback would be ideal */ static void pyop_error_report(ReportList *reports) { + const char *string; PyObject *exception, *v, *tb; PyErr_Fetch(&exception, &v, &tb); if (exception == NULL) return; + + /* get the string from the exception */ + if(v==NULL) { + string= "py exception not set"; + } + else if(string = _PyUnicode_AsString(v)) { + /* do nothing */ + } + else { /* a valid PyObject but not a string, try get its string value */ + PyObject *repr; + + Py_INCREF(v); /* incase clearing the error below somehow frees this */ + PyErr_Clear(); + + repr= PyObject_Repr(v); + + if(repr==NULL) { + PyErr_Clear(); + string= "py exception found but can't be converted"; + } + else { + string = _PyUnicode_AsString(repr); + Py_DECREF(repr); + + if(string==NULL) { /* unlikely to happen */ + PyErr_Clear(); + string= "py exception found but can't be converted"; + } + } + + Py_DECREF(v); /* finished dealing with v, PyErr_Clear isnt called anymore so can decref it */ + } + /* done getting the string */ + /* Now we know v != NULL too */ - BKE_report(reports, RPT_ERROR, _PyUnicode_AsString(v)); + BKE_report(reports, RPT_ERROR, string); PyErr_Print(); } -- cgit v1.2.3 From c4ad2ed2536407cf2a9b3bc8f0b77bc88cccf71d Mon Sep 17 00:00:00 2001 From: Robin Allen Date: Sat, 13 Jun 2009 14:22:40 +0000 Subject: Omission of a texture node to specify coordinates was regarded as a bug by some users. I rather agree :) --- source/blender/blenkernel/BKE_node.h | 3 +- source/blender/blenkernel/intern/node.c | 1 + source/blender/nodes/TEX_node.h | 1 + source/blender/nodes/intern/TEX_nodes/TEX_at.c | 70 ++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 source/blender/nodes/intern/TEX_nodes/TEX_at.c (limited to 'source') diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 184b28b2cd2..66e8492b357 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -407,8 +407,9 @@ struct TexResult; #define TEX_NODE_DECOMPOSE 420 #define TEX_NODE_VALTONOR 421 #define TEX_NODE_SCALE 422 +#define TEX_NODE_AT 423 -/* 201-299 reserved. Use like this: TEX_NODE_PROC + TEX_CLOUDS, etc */ +/* 501-599 reserved. Use like this: TEX_NODE_PROC + TEX_CLOUDS, etc */ #define TEX_NODE_PROC 500 #define TEX_NODE_PROC_MAX 600 diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 413c2fc20f5..62064799aca 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -2921,6 +2921,7 @@ static void registerTextureNodes(ListBase *ntypelist) nodeRegisterType(ntypelist, &tex_node_rotate); nodeRegisterType(ntypelist, &tex_node_translate); nodeRegisterType(ntypelist, &tex_node_scale); + nodeRegisterType(ntypelist, &tex_node_at); nodeRegisterType(ntypelist, &tex_node_proc_voronoi); nodeRegisterType(ntypelist, &tex_node_proc_blend); diff --git a/source/blender/nodes/TEX_node.h b/source/blender/nodes/TEX_node.h index d298f062143..f58d0312961 100644 --- a/source/blender/nodes/TEX_node.h +++ b/source/blender/nodes/TEX_node.h @@ -59,6 +59,7 @@ extern bNodeType tex_node_distance; extern bNodeType tex_node_rotate; extern bNodeType tex_node_translate; extern bNodeType tex_node_scale; +extern bNodeType tex_node_at; extern bNodeType tex_node_compose; extern bNodeType tex_node_decompose; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_at.c b/source/blender/nodes/intern/TEX_nodes/TEX_at.c new file mode 100644 index 00000000000..80f232ccd0c --- /dev/null +++ b/source/blender/nodes/intern/TEX_nodes/TEX_at.c @@ -0,0 +1,70 @@ +/** + * + * ***** BEGIN GPL 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. + * + * 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) 2005 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): R Allen + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "../TEX_util.h" + +static bNodeSocketType inputs[]= { + { SOCK_RGBA, 1, "Texture", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f }, + { SOCK_VECTOR, 1, "Coordinates", 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f }, + { -1, 0, "" } +}; +static bNodeSocketType outputs[]= { + { SOCK_RGBA, 0, "Texture", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f }, + { -1, 0, "" } +}; + +static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +{ + float new_coord[3]; + + tex_input_vec(new_coord, in[1], coord, thread); + tex_input_rgba(out, in[0], new_coord, thread); +} + +static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ + tex_output(node, in, out[0], &colorfn); +} + +bNodeType tex_node_at = { + /* *next,*prev */ NULL, NULL, + /* type code */ TEX_NODE_AT, + /* name */ "At", + /* width+range */ 100, 60, 150, + /* class+opts */ NODE_CLASS_DISTORT, 0, + /* input sock */ inputs, + /* output sock */ outputs, + /* storage */ "", + /* execfunc */ exec, + /* butfunc */ NULL, + /* initfunc */ NULL, + /* freestoragefunc */ NULL, + /* copystoragefunc */ NULL, + /* id */ NULL + +}; -- cgit v1.2.3 From 3a9396c47dcc1083baf5bcbb93556f65b84ba5a0 Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Sat, 13 Jun 2009 14:58:39 +0000 Subject: Restore default value for font kerning. The user value is 0 by default and the font kerning (the value that come with the font) is enable, like always. (the last was disable by mistake in a previous commit) --- source/blender/blenfont/intern/blf_font.c | 23 ++++++++++++---------- source/blender/editors/interface/interface_style.c | 8 ++++---- 2 files changed, 17 insertions(+), 14 deletions(-) (limited to 'source') diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 5a3b3207e29..921f5cac67c 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -143,11 +144,12 @@ void blf_font_draw(FontBLF *font, char *str) delta.x= 0; delta.y= 0; - FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta); - pen_x += delta.x >> 6; + if (FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta) == 0) { + pen_x += delta.x >> 6; - if (pen_x < old_pen_x) - pen_x= old_pen_x; + if (pen_x < old_pen_x) + pen_x= old_pen_x; + } } if (font->flags & BLF_USER_KERNING) { @@ -174,7 +176,7 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) FT_Vector delta; FT_UInt glyph_index, g_prev_index; rctf gbox; - int pen_x, pen_y, old_pen_x; + float pen_x, pen_y, old_pen_x; int i, has_kerning; if (!font->glyph_cache) @@ -222,11 +224,12 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) delta.x= 0; delta.y= 0; - FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta); - pen_x += delta.x >> 6; + if (FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta) == 0) { + pen_x += delta.x >> 6; - if (pen_x < old_pen_x) - old_pen_x= pen_x; + if (pen_x < old_pen_x) + old_pen_x= pen_x; + } } if (font->flags & BLF_USER_KERNING) { @@ -318,7 +321,7 @@ void blf_font_fill(FontBLF *font) font->clip_rec.xmax= 0.0f; font->clip_rec.ymin= 0.0f; font->clip_rec.ymax= 0.0f; - font->flags= BLF_USER_KERNING; + font->flags= BLF_USER_KERNING | BLF_FONT_KERNING; font->dpi= 0; font->size= 0; font->kerning= 0.0f; diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index f1d29ac8688..831a8a5bf6c 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -91,7 +91,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->paneltitle.uifont_id= UIFONT_DEFAULT; style->paneltitle.points= 13; - style->paneltitle.kerning= 0.5; + style->paneltitle.kerning= 0.0; style->paneltitle.shadow= 5; style->paneltitle.shadx= 2; style->paneltitle.shady= -2; @@ -100,7 +100,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->grouplabel.uifont_id= UIFONT_DEFAULT; style->grouplabel.points= 12; - style->grouplabel.kerning= 0.5; + style->grouplabel.kerning= 0.0; style->grouplabel.shadow= 3; style->grouplabel.shadx= 1; style->grouplabel.shady= -1; @@ -108,7 +108,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->widgetlabel.uifont_id= UIFONT_DEFAULT; style->widgetlabel.points= 11; - style->widgetlabel.kerning= 0.5; + style->widgetlabel.kerning= 0.0; style->widgetlabel.shadow= 3; style->widgetlabel.shadx= 1; style->widgetlabel.shady= -1; @@ -117,7 +117,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->widget.uifont_id= UIFONT_DEFAULT; style->widget.points= 11; - style->widget.kerning= 0.5; + style->widget.kerning= 0.0; style->widget.shadowalpha= 0.25f; style->columnspace= 5; -- cgit v1.2.3 From 76cd7046bba916737de142a76b06adea9f52660c Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Sat, 13 Jun 2009 15:54:39 +0000 Subject: coverity issue CID: 44 Checker: FORWARD_NULL (help) File: base/src/source/blender/render/intern/source/texture.c Function: do_lamp_tex Description: Variable "co" tracked as NULL was dereferenced. co was set to NULL at the beginning of the function and it could possibly slip through all the logic above so lets test it before we use it blindly. Kent --- source/blender/render/intern/source/texture.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index d41f68c021a..f2169ceea12 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -2420,13 +2420,13 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef /* placement */ - if(mtex->projx) texvec[0]= mtex->size[0]*(co[mtex->projx-1]+mtex->ofs[0]); + if(mtex->projx && co) texvec[0]= mtex->size[0]*(co[mtex->projx-1]+mtex->ofs[0]); else texvec[0]= mtex->size[0]*(mtex->ofs[0]); - if(mtex->projy) texvec[1]= mtex->size[1]*(co[mtex->projy-1]+mtex->ofs[1]); + if(mtex->projy && co) texvec[1]= mtex->size[1]*(co[mtex->projy-1]+mtex->ofs[1]); else texvec[1]= mtex->size[1]*(mtex->ofs[1]); - if(mtex->projz) texvec[2]= mtex->size[2]*(co[mtex->projz-1]+mtex->ofs[2]); + if(mtex->projz && co) texvec[2]= mtex->size[2]*(co[mtex->projz-1]+mtex->ofs[2]); else texvec[2]= mtex->size[2]*(mtex->ofs[2]); if(shi->osatex) { -- cgit v1.2.3 From a2bc531dc1ff47facd800f52c8f29cf5453d8b77 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Sat, 13 Jun 2009 16:49:30 +0000 Subject: coverity issue CID: 228 Checker: DEADCODE (help) File: base/src/source/blender/gpu/intern/gpu_material.c Function: GPU_materials_free Description: Conditional "ma != 0" was looping over wrong variable I'm guessing a cut and paste error from above. Kent --- source/blender/gpu/intern/gpu_material.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 818b67170c7..7e8b5c18d71 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1285,7 +1285,7 @@ void GPU_materials_free() GPU_material_free(&defmaterial); - for(ob=G.main->object.first; ma; ma=ma->id.next) + for(ob=G.main->object.first; ob; ob=ob->id.next) GPU_lamp_free(ob); } -- cgit v1.2.3 From 0e13433d7cdb81b6ab7bf5dad7c9701097e9ffd2 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Sat, 13 Jun 2009 16:52:01 +0000 Subject: coverity issue CID: 401 Checker: NULL_RETURNS (help) File: base/src/source/blender/imbuf/intern/radiance_hdr.c Function: imb_loadhdr Description: Incrementing possibly NULL value "ptr" Make sure were not trying to index past our array. Kent --- source/blender/imbuf/intern/radiance_hdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c index d00e34cfdbe..69c4970df38 100644 --- a/source/blender/imbuf/intern/radiance_hdr.c +++ b/source/blender/imbuf/intern/radiance_hdr.c @@ -191,7 +191,7 @@ struct ImBuf *imb_loadhdr(unsigned char *mem, int size, int flags) break; } } - if (found) { + if (found && (x<(size + 2))) { if (sscanf((char *)&mem[x+1], "%79s %d %79s %d", (char*)&oriY, &height, (char*)&oriX, &width) != 4) return NULL; -- cgit v1.2.3 From a7ac260cc5e47bfca6e9678f1271fbdd438ac119 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Sat, 13 Jun 2009 16:57:26 +0000 Subject: coverity issue CID: 469 Checker: REVERSE_INULL (help) File: base/src/source/blender/blenkernel/intern/BME_tools.c Function: BME_split_face Description: Pointer "example" dereferenced before NULL check Check for null before we try to use it. Kent --- source/blender/blenkernel/intern/BME_tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/BME_tools.c b/source/blender/blenkernel/intern/BME_tools.c index f3e4add34e9..a2cd6389e7d 100644 --- a/source/blender/blenkernel/intern/BME_tools.c +++ b/source/blender/blenkernel/intern/BME_tools.c @@ -192,7 +192,7 @@ static BME_Poly *BME_split_face(BME_Mesh *bm, BME_Poly *f, BME_Vert *v1, BME_Ver nf = BME_SFME(bm,f,v1,v2,nl); nf->flag = f->flag; /* if the edge was selected, select this face, too */ - if (example->flag & SELECT) f->flag |= ME_FACE_SEL; + if (example && (example->flag & SELECT)) f->flag |= ME_FACE_SEL; nf->h = f->h; nf->mat_nr = f->mat_nr; if (nl && example) { -- cgit v1.2.3 From 611e2f484c1d3c1c07abbe289a23623e714c700f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 13 Jun 2009 17:25:54 +0000 Subject: GameEngine WIP, * pressing P starts the BGE in the 3D view * redraw window clipping isnt right * BGE python api works in py3k (without __import__ override or Mathutils, BGL, Geometry) * no events yet (so there is no way to exit) --- source/blender/editors/space_view3d/SConscript | 6 +- .../blender/editors/space_view3d/view3d_intern.h | 2 + source/blender/editors/space_view3d/view3d_ops.c | 3 + source/blender/editors/space_view3d/view3d_view.c | 69 ++++++++++++++++++++++ .../BlenderRoutines/BL_KetsjiEmbedStart.cpp | 31 +++++----- .../BlenderRoutines/KX_BlenderCanvas.cpp | 25 ++++---- .../gameengine/BlenderRoutines/KX_BlenderCanvas.h | 10 ++-- source/gameengine/BlenderRoutines/KX_BlenderGL.cpp | 16 ++++- source/gameengine/BlenderRoutines/KX_BlenderGL.h | 7 ++- source/gameengine/Ketsji/KX_PythonInit.cpp | 11 ++-- 10 files changed, 136 insertions(+), 44 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_view3d/SConscript b/source/blender/editors/space_view3d/SConscript index b771095c781..7d51d237ef0 100644 --- a/source/blender/editors/space_view3d/SConscript +++ b/source/blender/editors/space_view3d/SConscript @@ -2,10 +2,14 @@ Import ('env') sources = env.Glob('*.c') +defs = [] incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../render/extern/include #/intern/guardedalloc' incs += ' ../../gpu ../../makesrna ../../blenfont' -env.BlenderLib ( 'bf_editors_space_view3d', sources, Split(incs), [], libtype=['core'], priority=[40] ) +if env['WITH_BF_GAMEENGINE']: + defs.append('GAMEBLENDER=1') + +env.BlenderLib ( 'bf_editors_space_view3d', sources, Split(incs), defines = defs, libtype=['core'], priority=[40] ) diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index ab705cb32fb..6dbd99c67be 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -120,6 +120,8 @@ void VIEW3D_OT_select_lasso(struct wmOperatorType *ot); void VIEW3D_OT_smoothview(struct wmOperatorType *ot); void VIEW3D_OT_setcameratoview(struct wmOperatorType *ot); void VIEW3D_OT_localview(struct wmOperatorType *ot); +void VIEW3D_OT_game_start(struct wmOperatorType *ot); + int boundbox_clip(RegionView3D *rv3d, float obmat[][4], struct BoundBox *bb); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 0ed43bead17..6cb1051ce4a 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -85,6 +85,7 @@ void view3d_operatortypes(void) WM_operatortype_append(VIEW3D_OT_drawtype); WM_operatortype_append(VIEW3D_OT_editmesh_face_toolbox); WM_operatortype_append(VIEW3D_OT_localview); + WM_operatortype_append(VIEW3D_OT_game_start); WM_operatortype_append(VIEW3D_OT_layers); WM_operatortype_append(VIEW3D_OT_properties); @@ -173,6 +174,8 @@ void view3d_keymap(wmWindowManager *wm) WM_keymap_add_item(keymap, "VIEW3D_OT_localview", PADSLASHKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "VIEW3D_OT_game_start", PKEY, KM_PRESS, 0, 0); + /* layers, shift + alt are properties set in invoke() */ RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_layers", ONEKEY, KM_PRESS, KM_ANY, 0)->ptr, "nr", 1); RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_layers", TWOKEY, KM_PRESS, KM_ANY, 0)->ptr, "nr", 2); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index e1a6f32aa41..eaa23061322 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1382,6 +1382,75 @@ void VIEW3D_OT_localview(wmOperatorType *ot) ot->poll= ED_operator_view3d_active; } + +static void SaveState(void) +{ + glPushAttrib(GL_ALL_ATTRIB_BITS); + + GPU_state_init(); + + if(G.f & G_TEXTUREPAINT) + GPU_paint_set_mipmap(1); + + //XXX waitcursor(1); +} + +static void RestoreState(void) +{ + if(G.f & G_TEXTUREPAINT) + GPU_paint_set_mipmap(0); + + //XXX curarea->win_swap = 0; + //XXX curarea->head_swap=0; + //XXX allqueue(REDRAWVIEW3D, 1); + //XXX allqueue(REDRAWBUTSALL, 0); + //XXX reset_slowparents(); + //XXX waitcursor(0); + //XXX G.qual= 0; + glPopAttrib(); +} + +/* maybe we need this defined somewhere else */ +extern void StartKetsjiShell(wmWindow *win, ScrArea *area, struct ARegion *ar, struct Scene *scene, struct Main* maggie,int always_use_expand_framing); + + +static int game_engine_exec(bContext *C, wmOperator *unused) +{ + View3D *v3d= CTX_wm_view3d(C); + ScrArea *sa= CTX_wm_area(C); // curarea + ARegion *ar= CTX_wm_region(C); + Scene *sc, *startscene = CTX_data_scene(C); + +#if GAMEBLENDER == 1 + SaveState(); + StartKetsjiShell(CTX_wm_window(C), sa, ar, startscene, CTX_data_main(C), 1); + RestoreState(); + + //XXX restore_all_scene_cfra(scene_cfra_store); + set_scene_bg(startscene); + //XXX scene_update_for_newframe(G.scene, G.scene->lay); + + ED_area_tag_redraw(CTX_wm_area(C)); +#else + printf("GameEngine Disabled\n"); +#endif + + return OPERATOR_FINISHED; +} + +void VIEW3D_OT_game_start(wmOperatorType *ot) +{ + + /* identifiers */ + ot->name= "Start Game Engine"; + ot->idname= "VIEW3D_OT_game_start"; + + /* api callbacks */ + ot->exec= game_engine_exec; + + ot->poll= ED_operator_view3d_active; +} + /* ************************************** */ void view3d_align_axis_to_vector(View3D *v3d, RegionView3D *rv3d, int axisidx, float vec[3]) diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index a1df5621922..5f1437b8699 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -88,11 +88,11 @@ extern "C" { #endif //XXX #include "BSE_headerbuttons.h" -void update_for_newframe(); #ifdef __cplusplus } #endif + static BlendFileData *load_game_data(char *filename) { ReportList reports; @@ -111,17 +111,17 @@ static BlendFileData *load_game_data(char *filename) return bfd; } -extern "C" void StartKetsjiShell(struct ScrArea *area, +extern "C" void StartKetsjiShell(struct wmWindow *win, + struct ScrArea *area, struct ARegion *ar, - char* scenename, + Scene *scene, struct Main* maggie1, int always_use_expand_framing) { int exitrequested = KX_EXIT_REQUEST_NO_REQUEST; - Scene *scene= NULL; // XXX give as arg Main* blenderdata = maggie1; - char* startscenename = scenename; + char* startscenename = scene->id.name+2; char pathname[FILE_MAXDIR+FILE_MAXFILE], oldsce[FILE_MAXDIR+FILE_MAXFILE]; STR_String exitstring = ""; BlendFileData *bfd= NULL; @@ -155,7 +155,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, bool nodepwarnings = (SYS_GetCommandLineInt(syshandle, "ignore_deprecation_warnings", 0) != 0); bool novertexarrays = (SYS_GetCommandLineInt(syshandle, "novertexarrays", 0) != 0); // create the canvas, rasterizer and rendertools - RAS_ICanvas* canvas = new KX_BlenderCanvas(area); + RAS_ICanvas* canvas = new KX_BlenderCanvas(win, ar); canvas->SetMouseState(RAS_ICanvas::MOUSE_INVISIBLE); RAS_IRenderTools* rendertools = new KX_BlenderRenderTools(); RAS_IRasterizer* rasterizer = NULL; @@ -235,7 +235,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, } for (i = 0; i < 16; i++) { - float *projmat_linear; //XXX = (float*) area->winmat; + float *projmat_linear= (float*) rv3d->winmat; projmat.setElem(i, projmat_linear[i]); } @@ -423,7 +423,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, exitrequested = ketsjiengine->GetExitCode(); // kick the engine - bool render = ketsjiengine->NextFrame(); + bool render = ketsjiengine->NextFrame(); // XXX 2.5 Bug, This is never true! FIXME- Campbell if (render) { @@ -434,7 +434,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, // test for the ESC key while (0) //XXX while (qtest()) { - short val; + short val = 0; unsigned short event = 0; //XXX extern_qread(&val); if (keyboarddevice->ConvertBlenderEvent(event,val)) @@ -444,9 +444,9 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, * should this really be? */ if (event==MOUSEX) { - val = 0;//XXX val - scrarea_get_win_x(area); + val = val - ar->winrct.xmin; } else if (event==MOUSEY) { - val = 0;//XXX scrarea_get_win_height(area) - (val - scrarea_get_win_y(area)) - 1; + val = ar->winy - (val - ar->winrct.ymin) - 1; } mousedevice->ConvertBlenderEvent(event,val); @@ -557,7 +557,8 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, PyGILState_Release(gilstate); } -extern "C" void StartKetsjiShellSimulation(struct ScrArea *area, +extern "C" void StartKetsjiShellSimulation(struct wmWindow *win, + struct ScrArea *area, struct ARegion *ar, char* scenename, struct Main* maggie, @@ -595,7 +596,7 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area, bool usemat = false; // create the canvas, rasterizer and rendertools - RAS_ICanvas* canvas = new KX_BlenderCanvas(area); + RAS_ICanvas* canvas = new KX_BlenderCanvas(win, ar); //canvas->SetMouseState(RAS_ICanvas::MOUSE_INVISIBLE); RAS_IRenderTools* rendertools = new KX_BlenderRenderTools(); RAS_IRasterizer* rasterizer = NULL; @@ -648,7 +649,7 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area, cframe=blscene->r.cfra; startFrame = blscene->r.sfra; blscene->r.cfra=startFrame; - update_for_newframe(); + // update_for_newframe(); // XXX scene_update_for_newframe wont cut it! ketsjiengine->SetGame2IpoMode(game2ipo,startFrame); } @@ -722,7 +723,7 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area, // kick the engine ketsjiengine->NextFrame(); blscene->r.cfra=blscene->r.cfra+1; - update_for_newframe(); + // update_for_newframe(); // XXX scene_update_for_newframe wont cut it } exitstring = ketsjiengine->GetExitString(); diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp index 750a1ef3f93..aa83d17a03a 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp @@ -26,15 +26,16 @@ * ***** END GPL LICENSE BLOCK ***** */ -//XXX #include "BIF_scrarea.h" #include "KX_BlenderCanvas.h" +#include "DNA_screen_types.h" #ifdef HAVE_CONFIG_H #include #endif -KX_BlenderCanvas::KX_BlenderCanvas(struct ScrArea *area) : -m_area(area) +KX_BlenderCanvas::KX_BlenderCanvas(struct wmWindow *win, ARegion *ar) : +m_win(win), +m_ar(ar) { } @@ -50,7 +51,7 @@ void KX_BlenderCanvas::Init() void KX_BlenderCanvas::SwapBuffers() { - BL_SwapBuffers(); + BL_SwapBuffers(m_win); } void KX_BlenderCanvas::BeginFrame() @@ -93,12 +94,12 @@ void KX_BlenderCanvas::ClearBuffer(int type) int KX_BlenderCanvas::GetWidth( ) const { - return 0; //XXX scrarea_get_win_width(m_area); + return m_ar->winx; } int KX_BlenderCanvas::GetHeight( ) const { - return 0; //XXX scrarea_get_win_height(m_area); + return m_ar->winy; } RAS_Rect & @@ -116,8 +117,8 @@ SetViewPort( ){ int vp_width = (x2 - x1) + 1; int vp_height = (y2 - y1) + 1; - int minx = 0;//XXX scrarea_get_win_x(m_area); - int miny = 0;//XXX scrarea_get_win_y(m_area); + int minx = m_ar->winrct.xmin; + int miny = m_ar->winrct.ymin; m_area_rect.SetLeft(minx + x1); m_area_rect.SetBottom(miny + y1); @@ -159,9 +160,9 @@ void KX_BlenderCanvas::SetMouseState(RAS_MouseState mousestate) // (0,0) is top left, (width,height) is bottom right void KX_BlenderCanvas::SetMousePosition(int x,int y) { - int winX = 0;//XXX scrarea_get_win_x(m_area); - int winY = 0;//XXX scrarea_get_win_y(m_area); - int winH = 0;//XXX scrarea_get_win_height(m_area); + int winX = m_ar->winrct.xmin; + int winY = m_ar->winrct.ymin; + int winH = m_ar->winy; BL_warp_pointer(winX + x, winY + (winH-y-1)); } @@ -170,5 +171,5 @@ void KX_BlenderCanvas::SetMousePosition(int x,int y) void KX_BlenderCanvas::MakeScreenShot(const char* filename) { - BL_MakeScreenShot(m_area, filename); + BL_MakeScreenShot(m_ar, filename); } diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h index bc202a8558c..fd41fb90f2f 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h @@ -40,7 +40,8 @@ #include "KX_BlenderGL.h" -struct ScrArea; +struct ARegion; +struct wmWindow; /** * 2D Blender device context abstraction. @@ -57,9 +58,9 @@ private: public: /* Construct a new canvas. * - * @param area The Blender ScrArea to run the game within. + * @param area The Blender ARegion to run the game within. */ - KX_BlenderCanvas(struct ScrArea* area); + KX_BlenderCanvas(struct wmWindow* win, struct ARegion* ar); ~KX_BlenderCanvas(); void @@ -162,7 +163,8 @@ public: private: /** Blender area the game engine is running within */ - struct ScrArea* m_area; + struct ARegion* m_ar; + struct wmWindow* m_win; RAS_Rect m_area_rect; }; diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp index de7a7f54fde..5cf696fe146 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp @@ -27,7 +27,14 @@ */ #include "KX_BlenderGL.h" + +#ifdef __cplusplus +extern "C" { +#endif #include "BLF_api.h" +#ifdef __cplusplus +} +#endif #ifdef HAVE_CONFIG_H #include @@ -58,6 +65,7 @@ #include "DNA_image_types.h" #include "DNA_view3d_types.h" #include "DNA_material_types.h" +#include "DNA_windowmanager_types.h" #include "BKE_global.h" #include "BKE_bmfont.h" @@ -68,7 +76,7 @@ extern "C" { //XXX #include "BIF_mywindow.h" //XXX #include "BIF_toolbox.h" //XXX #include "BIF_graphics.h" /* For CURSOR_NONE CURSOR_WAIT CURSOR_STD */ - +void wm_window_swap_buffers(wmWindow *win); // wm_window.h } /* end of blender block */ @@ -86,8 +94,10 @@ void BL_warp_pointer(int x,int y) //XXX warp_pointer(x,y); } -void BL_SwapBuffers() +void BL_SwapBuffers(wmWindow *win) { + //wmWindow *window= CTX_wm_window(C); + wm_window_swap_buffers(win); //XXX myswapbuffers(); } @@ -214,7 +224,7 @@ void BL_NormalMouse() #define MAX_FILE_LENGTH 512 -void BL_MakeScreenShot(struct ScrArea *area, const char* filename) +void BL_MakeScreenShot(struct ARegion *ar, const char* filename) { char copyfilename[MAX_FILE_LENGTH]; strcpy(copyfilename,filename); diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.h b/source/gameengine/BlenderRoutines/KX_BlenderGL.h index b891a7343c2..1e65f29d87c 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderGL.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.h @@ -33,14 +33,15 @@ extern "C" { #endif //__cplusplus -struct ScrArea; +struct wmWindow; +struct ARegion; // special swapbuffers, that takes care of which area (viewport) needs to be swapped -void BL_SwapBuffers(); +void BL_SwapBuffers(struct wmWindow *win); void BL_warp_pointer(int x,int y); -void BL_MakeScreenShot(struct ScrArea *area, const char* filename); +void BL_MakeScreenShot(struct ARegion *ar, const char* filename); void BL_HideMouse(); void BL_NormalMouse(); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index fc3e48f504c..a3d464f0d5d 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -81,11 +81,10 @@ #include "PyObjectPlus.h" -//XXX -#if 0 - #include "KX_PythonInitTypes.h" +#if 0 //XXX25 + /* we only need this to get a list of libraries from the main struct */ #include "DNA_ID.h" @@ -97,7 +96,7 @@ extern "C" { #include "BGL.h" #endif } -#endif +#endif //XXX25 #include "marshal.h" /* python header for loading/saving dicts */ @@ -1606,7 +1605,7 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur //importBlenderModules() setSandbox(level); - /* XXX 2.5 initPyTypes(); */ + initPyTypes(); /* XXX 2.5 bpy_import_main_set(maggie); */ @@ -1645,7 +1644,7 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev Py_FrozenFlag=1; setSandbox(level); - /* XXX 2.5 initPyTypes(); */ + initPyTypes(); /* XXX 2.5 bpy_import_main_set(maggie); */ -- cgit v1.2.3 From 646d4041e2c3461f4494be126172cf10472914b7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 13 Jun 2009 20:58:43 +0000 Subject: BGE events, not sure every event works as it should but keyboard looking and mouse focus seems to work ok. Tested some basic logic brick blend files that use key input which run properly. --- source/blender/editors/space_view3d/view3d_view.c | 35 ++++++++----- .../blender/windowmanager/intern/wm_event_system.c | 2 +- source/blender/windowmanager/intern/wm_window.c | 6 +++ source/blender/windowmanager/wm_event_system.h | 2 + source/blender/windowmanager/wm_window.h | 1 + .../BlenderRoutines/BL_KetsjiEmbedStart.cpp | 61 ++++++++++++++++------ 6 files changed, 76 insertions(+), 31 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index eaa23061322..2db5f2c97fd 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1382,21 +1382,29 @@ void VIEW3D_OT_localview(wmOperatorType *ot) ot->poll= ED_operator_view3d_active; } - -static void SaveState(void) +static ListBase queue_back; +static void SaveState(bContext *C) { + wmWindow *win= CTX_wm_window(C); + glPushAttrib(GL_ALL_ATTRIB_BITS); GPU_state_init(); if(G.f & G_TEXTUREPAINT) GPU_paint_set_mipmap(1); - + + queue_back= win->queue; + + win->queue.first= win->queue.last= NULL; + //XXX waitcursor(1); } -static void RestoreState(void) +static void RestoreState(bContext *C) { + wmWindow *win= CTX_wm_window(C); + if(G.f & G_TEXTUREPAINT) GPU_paint_set_mipmap(0); @@ -1407,34 +1415,33 @@ static void RestoreState(void) //XXX reset_slowparents(); //XXX waitcursor(0); //XXX G.qual= 0; + + win->queue= queue_back; + glPopAttrib(); } /* maybe we need this defined somewhere else */ -extern void StartKetsjiShell(wmWindow *win, ScrArea *area, struct ARegion *ar, struct Scene *scene, struct Main* maggie,int always_use_expand_framing); +extern void StartKetsjiShell(struct bContext *C,int always_use_expand_framing); static int game_engine_exec(bContext *C, wmOperator *unused) { - View3D *v3d= CTX_wm_view3d(C); - ScrArea *sa= CTX_wm_area(C); // curarea - ARegion *ar= CTX_wm_region(C); - Scene *sc, *startscene = CTX_data_scene(C); + Scene *startscene = CTX_data_scene(C); #if GAMEBLENDER == 1 - SaveState(); - StartKetsjiShell(CTX_wm_window(C), sa, ar, startscene, CTX_data_main(C), 1); - RestoreState(); + SaveState(C); + StartKetsjiShell(C, 1); + RestoreState(C); //XXX restore_all_scene_cfra(scene_cfra_store); set_scene_bg(startscene); //XXX scene_update_for_newframe(G.scene, G.scene->lay); - ED_area_tag_redraw(CTX_wm_area(C)); #else printf("GameEngine Disabled\n"); #endif - + ED_area_tag_redraw(CTX_wm_area(C)); return OPERATOR_FINISHED; } diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index f5c8e535002..ea6a65859e5 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -76,7 +76,7 @@ void wm_event_add(wmWindow *win, wmEvent *event_to_add) BLI_addtail(&win->queue, event); } -static void wm_event_free(wmEvent *event) +void wm_event_free(wmEvent *event) { if(event->customdata && event->customdatafree) MEM_freeN(event->customdata); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index cb6bcb41366..2d320458543 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -595,6 +595,12 @@ void wm_window_process_events(const bContext *C) PIL_sleep_ms(5); } +void wm_window_process_events_nosleep(const bContext *C) +{ + if(GHOST_ProcessEvents(g_system, 0)) + GHOST_DispatchEvents(g_system); +} + /* exported as handle callback to bke blender.c */ void wm_window_testbreak(void) { diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h index 99853c77a55..9a3bba9af1d 100644 --- a/source/blender/windowmanager/wm_event_system.h +++ b/source/blender/windowmanager/wm_event_system.h @@ -82,6 +82,8 @@ enum { /* wm_event_system.c */ void wm_event_add (wmWindow *win, wmEvent *event_to_add); void wm_event_free_all (wmWindow *win); +void wm_event_free (wmEvent *event); + /* goes over entire hierarchy: events -> window -> screen -> area -> region */ void wm_event_do_handlers (bContext *C); diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h index 7bf08617fb6..45fa9bf6cf7 100644 --- a/source/blender/windowmanager/wm_window.h +++ b/source/blender/windowmanager/wm_window.h @@ -40,6 +40,7 @@ void wm_window_free (bContext *C, wmWindow *win); void wm_window_title (wmWindowManager *wm, wmWindow *win); void wm_window_add_ghostwindows (wmWindowManager *wm); void wm_window_process_events (const bContext *C); +void wm_window_process_events_nosleep(const bContext *C); void wm_window_make_drawable(bContext *C, wmWindow *win); diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 5f1437b8699..44678cb73eb 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -66,16 +66,18 @@ #include "SYS_System.h" /***/ - #include "DNA_view3d_types.h" #include "DNA_screen_types.h" +#include "DNA_windowmanager_types.h" #include "BKE_global.h" #include "BKE_report.h" + #include "BKE_utildefines.h" //XXX #include "BIF_screen.h" //XXX #include "BIF_scrarea.h" -#include "BKE_main.h" +#include "BKE_main.h" +//#include "BKE_context.h" #include "BLI_blenlib.h" #include "BLO_readfile.h" #include "DNA_scene_types.h" @@ -84,10 +86,15 @@ #include "GPU_extensions.h" #include "Value.h" + + #ifdef __cplusplus extern "C" { #endif //XXX #include "BSE_headerbuttons.h" +#include "../../blender/windowmanager/WM_types.h" +#include "../../blender/windowmanager/wm_window.h" +#include "../../blender/windowmanager/wm_event_system.h" #ifdef __cplusplus } #endif @@ -111,13 +118,24 @@ static BlendFileData *load_game_data(char *filename) return bfd; } -extern "C" void StartKetsjiShell(struct wmWindow *win, - struct ScrArea *area, - struct ARegion *ar, - Scene *scene, - struct Main* maggie1, - int always_use_expand_framing) + +/* screw it, BKE_context.h is complaining! */ +extern "C" struct wmWindow *CTX_wm_window(const bContext *C); +extern "C" struct ScrArea *CTX_wm_area(const bContext *C); +extern "C" struct ARegion *CTX_wm_region(const bContext *C); +extern "C" struct Scene *CTX_data_scene(const bContext *C); +extern "C" struct Main *CTX_data_main(const bContext *C); + +extern "C" void StartKetsjiShell(struct bContext *C, int always_use_expand_framing) { + /* context values */ + struct wmWindow *win= CTX_wm_window(C); + struct ScrArea *area= CTX_wm_area(C); // curarea + struct ARegion *ar= CTX_wm_region(C); + struct Scene *scene= CTX_data_scene(C); + struct Main* maggie1= CTX_data_main(C); + + int exitrequested = KX_EXIT_REQUEST_NO_REQUEST; Main* blenderdata = maggie1; @@ -431,26 +449,37 @@ extern "C" void StartKetsjiShell(struct wmWindow *win, ketsjiengine->Render(); } + wm_window_process_events_nosleep(C); + // test for the ESC key - while (0) //XXX while (qtest()) + //XXX while (qtest()) + while(wmEvent *event= (wmEvent *)win->queue.first) { short val = 0; - unsigned short event = 0; //XXX extern_qread(&val); + //unsigned short event = 0; //XXX extern_qread(&val); - if (keyboarddevice->ConvertBlenderEvent(event,val)) + if (keyboarddevice->ConvertBlenderEvent(event->type,event->val)) exitrequested = KX_EXIT_REQUEST_BLENDER_ESC; /* Coordinate conversion... where * should this really be? */ - if (event==MOUSEX) { - val = val - ar->winrct.xmin; - } else if (event==MOUSEY) { - val = ar->winy - (val - ar->winrct.ymin) - 1; + if (event->type==MOUSEMOVE) { + /* Note nice! XXX 2.5 event hack */ + val = event->x - ar->winrct.xmin; + mousedevice->ConvertBlenderEvent(MOUSEX, val); + + val = ar->winy - (event->y - ar->winrct.ymin) - 1; + mousedevice->ConvertBlenderEvent(MOUSEY, val); + } + else { + mousedevice->ConvertBlenderEvent(event->type,event->val); } - mousedevice->ConvertBlenderEvent(event,val); + BLI_remlink(&win->queue, event); + wm_event_free(event); } + } printf("\nBlender Game Engine Finished\n\n"); exitstring = ketsjiengine->GetExitString(); -- cgit v1.2.3 From c3c38155ad2aca369fa956b2251ed41c749942cc Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sat, 13 Jun 2009 21:22:21 +0000 Subject: 2.5 Buttons: * Added more material buttons by William. Thanks. I made some minor adjustments and added Specular Shader Model RNA. * Code cleanup and some consistency tweaks of button files. Notes: Preview render now only shows up when there is an active world, material, texture or lamp. * Made sure initial panels with ID Datablocks are shown, even when no block is active. --- source/blender/makesrna/intern/rna_material.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index a5dbb63adf2..78098570783 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -734,13 +734,28 @@ static void rna_def_material_sss(BlenderRNA *brna) void rna_def_material_specularity(StructRNA *srna) { PropertyRNA *prop; - + + static EnumPropertyItem prop_spec_shader_items[] = { + {MA_SPEC_COOKTORR, "COOKTORR", "CookTorr", ""}, + {MA_SPEC_PHONG, "PHONG", "Phong", ""}, + {MA_SPEC_BLINN, "BLINN", "Blinn", ""}, + {MA_SPEC_TOON, "TOON", "Toon", ""}, + {MA_SPEC_WARDISO, "WARDISO", "WardIso", ""}, + {0, NULL, NULL, NULL}}; + + prop= RNA_def_property(srna, "spec_shader", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "spec_shader"); + RNA_def_property_enum_items(prop, prop_spec_shader_items); + RNA_def_property_ui_text(prop, "Specular Shader Model", ""); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + prop= RNA_def_property(srna, "specularity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "spec"); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Specularity Intensity", ""); /* XXX: this field is also used for Halo hardness. should probably be fixed in DNA */ + /* I guess it's fine. Specular is disabled when mat type is Halo. --DingTo */ prop= RNA_def_property(srna, "specular_hardness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "har"); RNA_def_property_range(prop, 1, 511); -- cgit v1.2.3 From 472239cc948443e8265fc6359834225214ae03c5 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Sat, 13 Jun 2009 22:23:24 +0000 Subject: coverity issue CID: 307 Checker: FORWARD_NULL (help) File: base/src/source/blender/blenkernel/intern/modifier.c Function: meshdeformModifier_deformVerts Description: Variable "dm" tracked as NULL was passed to a function that dereferences it. fix provided by Brecht. Kent --- source/blender/blenkernel/intern/modifier.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 2c4528f641e..29930b3eb58 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7813,10 +7813,12 @@ static void meshdeformModifier_deformVerts( { DerivedMesh *dm; - if(!derivedData && ob->type==OB_MESH) - dm= CDDM_from_mesh(ob->data, ob); - else - dm= derivedData; + if (!derivedData) { + dm= get_original_dm(ob, NULL, 0); + if (dm == NULL) return; + } + else dm= derivedData; + modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */ -- cgit v1.2.3 From bde991df9ed2d9a1bd54eecd09eb6a7ab0bea4fc Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Sat, 13 Jun 2009 22:31:14 +0000 Subject: coverity issue CID: 275 Checker: FORWARD_NULL (help) File: base/src/source/blender/gpu/intern/gpu_extensions.c Function: GPU_shader_create Description: Variable "fragcode" tracked as NULL was passed to a function that dereferences it. fix provided by Brecht. :) Kent --- source/blender/gpu/intern/gpu_extensions.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 7654c67419b..70192f44ceb 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -746,7 +746,9 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, /*GPU glGetObjectParameterivARB(shader->object, GL_OBJECT_LINK_STATUS_ARB, &status); if (!status) { glGetInfoLogARB(shader->object, sizeof(log), &length, log); - shader_print_errors("linking", log, fragcode); + if (fragecode) shader_print_errors("linking", log, fragcode); + else if (vertexcode) shader_print_errors("linking", log, vertexcode); + else if (libcode) shader_print_errors("linking", log, libcode); GPU_shader_free(shader); return NULL; -- cgit v1.2.3 From e3fda550ba4aa784130d2e40ef3c6c9f262d1379 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Jun 2009 06:03:12 +0000 Subject: changing the scale of a sleeping object wasnt working with bullet. Example is a cube that lands on a plane, sleeps after some time, a script changes the scale. It would still use the scale when the object first went to sleep. reported on blenderartist. http://blenderartists.org/forum/showthread.php?t=158617 --- source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 3e20203a4cc..3c41a856660 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -979,6 +979,7 @@ void CcdPhysicsController::setScaling(float scaleX,float scaleY,float scaleZ) if (m_object && m_object->getCollisionShape()) { + m_object->activate(true); // without this, sleeping objects scale wont be applied in bullet if python changes the scale - Campbell. m_object->getCollisionShape()->setLocalScaling(m_cci.m_scaling); //printf("no inertia recalc for fixed objects with mass=0\n"); -- cgit v1.2.3 From 7aeadf2baa89aef3775fdf47efde77b76ec601a9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Jun 2009 06:52:46 +0000 Subject: typo in gpu_extensions.c, removed unused function --- source/blender/gpu/intern/gpu_extensions.c | 2 +- source/blender/python/api2_2x/sceneRender.c | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 70192f44ceb..4984e043031 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -746,7 +746,7 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, /*GPU glGetObjectParameterivARB(shader->object, GL_OBJECT_LINK_STATUS_ARB, &status); if (!status) { glGetInfoLogARB(shader->object, sizeof(log), &length, log); - if (fragecode) shader_print_errors("linking", log, fragcode); + if (fragcode) shader_print_errors("linking", log, fragcode); else if (vertexcode) shader_print_errors("linking", log, vertexcode); else if (libcode) shader_print_errors("linking", log, libcode); diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c index dce9231cce5..17c1c497061 100644 --- a/source/blender/python/api2_2x/sceneRender.c +++ b/source/blender/python/api2_2x/sceneRender.c @@ -925,13 +925,6 @@ static PyObject *RenderData_getBorder( BPy_RenderData * self ) self->renderContext->border.ymax ); } -static PyObject *RenderData_EnableGammaCorrection( BPy_RenderData * self, - PyObject * args ) -{ - return M_Render_BitToggleInt( args, R_GAMMA, - &self->renderContext->mode ); -} - static PyObject *RenderData_GaussFilterSize( BPy_RenderData * self, PyObject * args ) { return M_Render_GetSetAttributeFloat( args, -- cgit v1.2.3 From 36e96e5b6e497926a6d7bbb215577bd3bf7bbee0 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 14 Jun 2009 10:59:54 +0000 Subject: == Sequencer == This fixes: * free_imbuf_seq() didn't free all scenes. That will lead to steady memory growth in case of nested timelines with several scenes. * sequencer panels were always jumping around, depending on strip type, which was caused by choosing always the same panel position and the silly limitation, that * effect strips had no filter option, which was therefore added. So you can apply color balance on effect filter output now :) --- source/blender/src/buttons_scene.c | 14 ++++++------ source/blender/src/sequence.c | 45 +++++++++++++++++++++++++++++++++----- 2 files changed, 47 insertions(+), 12 deletions(-) (limited to 'source') diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 7c361b6113d..532ecad249f 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -570,7 +570,7 @@ static void seq_panel_editing() UI_EMBOSS, UI_HELV, curarea->win); if(uiNewPanel(curarea, block, "Edit", "Sequencer", - 10, 230, 318, 204) == 0) return; + 0, 0, 318, 204) == 0) return; uiDefBut(block, LABEL, 0, give_seqname(last_seq), @@ -754,7 +754,7 @@ static void seq_panel_input() UI_EMBOSS, UI_HELV, curarea->win); if(uiNewPanel(curarea, block, "Input", "Sequencer", - 10, 230, 318, 204) == 0) return; + 320, 0, 318, 204) == 0) return; if (SEQ_HAS_PATH(last_seq)) { uiDefBut(block, TEX, @@ -897,7 +897,7 @@ static void seq_panel_filter_video() UI_EMBOSS, UI_HELV, curarea->win); if(uiNewPanel(curarea, block, "Filter", "Sequencer", - 10, 230, 318, 204) == 0) return; + 640, 0, 318, 204) == 0) return; uiBlockBeginAlign(block); @@ -1024,7 +1024,7 @@ static void seq_panel_filter_audio() UI_EMBOSS, UI_HELV, curarea->win); if(uiNewPanel(curarea, block, "Filter", "Sequencer", - 10, 230, 318, 204) == 0) return; + 640, 0, 318, 204) == 0) return; uiBlockBeginAlign(block); uiDefButF(block, NUM, B_SEQ_BUT_RELOAD, "Gain (dB):", 10,50,150,19, &last_seq->level, -96.0, 6.0, 100, 0, ""); @@ -1040,7 +1040,7 @@ static void seq_panel_effect() UI_EMBOSS, UI_HELV, curarea->win); if(uiNewPanel(curarea, block, "Effect", "Sequencer", - 10, 230, 318, 204) == 0) return; + 320, 0, 318, 204) == 0) return; if(last_seq->type == SEQ_PLUGIN) { PluginSeq *pis; @@ -1168,7 +1168,7 @@ static void seq_panel_proxy() UI_EMBOSS, UI_HELV, curarea->win); if(uiNewPanel(curarea, block, "Proxy", "Sequencer", - 10, 230, 318, 204) == 0) return; + 960, 0, 318, 204) == 0) return; uiBlockBeginAlign(block); @@ -1276,7 +1276,7 @@ void sequencer_panels() } if (type == SEQ_PLUGIN || type >= SEQ_EFFECT) { - panels |= SEQ_PANEL_EFFECT | SEQ_PANEL_PROXY; + panels |= SEQ_PANEL_EFFECT | SEQ_PANEL_FILTER| SEQ_PANEL_PROXY; } if (panels & SEQ_PANEL_EDITING) { diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index cf2b28c6d72..44661b5fa91 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -1480,7 +1480,8 @@ static int input_have_to_preprocess(Sequence * seq, TStripElem* se, int cfra) mul = seq->mul; - if(seq->blend_mode == SEQ_BLEND_REPLACE) { + if(seq->blend_mode == SEQ_BLEND_REPLACE && + !(seq->type & SEQ_EFFECT)) { if (seq->ipo && seq->ipo->curve.first) { do_seq_ipo(seq, cfra); mul *= seq->facf0; @@ -1568,7 +1569,8 @@ static void input_preprocess(Sequence * seq, TStripElem* se, int cfra) mul = seq->mul; - if(seq->blend_mode == SEQ_BLEND_REPLACE) { + if(seq->blend_mode == SEQ_BLEND_REPLACE && + !(seq->type & SEQ_EFFECT)) { if (seq->ipo && seq->ipo->curve.first) { do_seq_ipo(seq, cfra); mul *= seq->facf0; @@ -1822,10 +1824,14 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, input_preprocess(seq, se, cfra); } } else if(seq->type & SEQ_EFFECT) { + int use_preprocess = FALSE; /* should the effect be recalculated? */ if (!build_proxy_run && se->ibuf == 0) { se->ibuf = seq_proxy_fetch(seq, cfra, render_size); + if (se->ibuf) { + use_preprocess = TRUE; + } } if(se->ibuf == 0) { @@ -1838,6 +1844,22 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rect, 0); do_effect(cfra, seq, se); + if (input_have_to_preprocess(seq, se, cfra) && + !build_proxy_run) { + if ((se->se1 && (se->ibuf == se->se1->ibuf)) || + (se->se2 && (se->ibuf == se->se2->ibuf))) { + struct ImBuf * i + = IMB_dupImBuf(se->ibuf); + + IMB_freeImBuf(se->ibuf); + + se->ibuf = i; + } + use_preprocess = TRUE; + } + } + if (use_preprocess) { + input_preprocess(seq, se, cfra); } } else if(seq->type == SEQ_IMAGE) { if(se->ok == STRIPELEM_OK && se->ibuf == 0) { @@ -2946,9 +2968,8 @@ void free_imbuf_seq_except(int cfra) END_SEQ } -void free_imbuf_seq() +static void free_imbuf_seq_editing(Editing * ed) { - Editing *ed= G.scene->ed; Sequence *seq; TStripElem *se; int a; @@ -2990,6 +3011,15 @@ void free_imbuf_seq() END_SEQ } +void free_imbuf_seq() +{ + Scene * sce = G.main->scene.first; + while(sce) { + free_imbuf_seq_editing(sce->ed); + sce= sce->id.next; + } +} + void free_imbuf_seq_with_ipo(struct Ipo *ipo) { /* force update of all sequences with this ipo, on ipo changes */ @@ -3074,12 +3104,17 @@ void update_changed_seq_and_deps(Sequence *changed_seq, int len_change, int ibuf /* bad levell call... */ void do_render_seq(RenderResult *rr, int cfra) { + static int recurs_depth = 0; ImBuf *ibuf; G.f |= G_PLAYANIM; /* waitcursor patch */ + recurs_depth++; + ibuf= give_ibuf_seq(rr->rectx, rr->recty, cfra, 0, G.scene->r.size); + recurs_depth--; + if(ibuf) { if(ibuf->rect_float) { if (!rr->rectf) @@ -3115,7 +3150,7 @@ void do_render_seq(RenderResult *rr, int cfra) on freeing _all_ buffers every time on long timelines...) (schlaile) */ - { + if (recurs_depth == 0) { /* with nested scenes, only free on toplevel... */ uintptr_t mem_in_use; uintptr_t mmap_in_use; uintptr_t max; -- cgit v1.2.3 From 8ab7fbe79563895b38bcfc50625e19fa2b38f843 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 14 Jun 2009 12:53:47 +0000 Subject: Blender/Python API Send the full python stack trace to the reporting api, added BPY_exception_buffer which temporarily overrides sys.stdout and sys.stderr to get the output (uses the io module in py3 StringIO in py2 to avoid writing into a real file), pity the Py/C api has no function to do this. fix for crash when showing menu's that have no items. --- .../blender/editors/interface/interface_regions.c | 3 + source/blender/editors/space_script/script_edit.c | 10 +- source/blender/editors/space_text/text_ops.c | 2 +- source/blender/python/BPY_extern.h | 2 +- source/blender/python/intern/bpy_interface.c | 18 ++-- source/blender/python/intern/bpy_operator_wrap.c | 54 +---------- source/blender/python/intern/bpy_util.c | 102 +++++++++++++++++++++ source/blender/python/intern/bpy_util.h | 3 + source/creator/creator.c | 4 +- 9 files changed, 130 insertions(+), 68 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 7ccb6c5163b..32bcae77e6b 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1948,6 +1948,9 @@ uiBlock *ui_block_func_PUPMENU(bContext *C, uiPopupBlockHandle *handle, void *ar md= decompose_menu_string(info->instr); rows= md->nitems; + if(rows<1) + rows= 1; + columns= 1; /* size and location, title slightly bigger for bold */ diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c index 797302a8652..88b8dccc6c9 100644 --- a/source/blender/editors/space_script/script_edit.c +++ b/source/blender/editors/space_script/script_edit.c @@ -62,15 +62,17 @@ static int run_pyfile_exec(bContext *C, wmOperator *op) { ARegion *ar= CTX_wm_region(C); + char filename[512]; RNA_string_get(op->ptr, "filename", filename); #ifndef DISABLE_PYTHON - BPY_run_python_script(C, filename, NULL); + if(BPY_run_python_script(C, filename, NULL, op->reports)) { + ED_region_tag_redraw(ar); + return OPERATOR_FINISHED; + } #endif - ED_region_tag_redraw(ar); - - return OPERATOR_FINISHED; + return OPERATOR_CANCELLED; /* FAIL */ } void SCRIPT_OT_python_file_run(wmOperatorType *ot) diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index ebb42aa2098..f43888b08da 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -521,7 +521,7 @@ static int run_script_exec(bContext *C, wmOperator *op) #else Text *text= CTX_data_edit_text(C); - if (BPY_run_python_script( C, NULL, text )) + if (BPY_run_python_script(C, NULL, text, op->reports)) return OPERATOR_FINISHED; /* Dont report error messages while live editing */ diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h index ff3e89a6e25..855fdde50c5 100644 --- a/source/blender/python/BPY_extern.h +++ b/source/blender/python/BPY_extern.h @@ -97,7 +97,7 @@ extern "C" { int BPY_menu_invoke( struct BPyMenu *pym, short menutype ); /* 2.5 UI Scripts */ - int BPY_run_python_script( struct bContext *C, const char *filename, struct Text *text ); // 2.5 working + int BPY_run_python_script( struct bContext *C, const char *filename, struct Text *text, struct ReportList *reports ); // 2.5 working int BPY_run_script_space_draw(struct bContext *C, struct SpaceScript * sc); // 2.5 working void BPY_run_ui_scripts(struct bContext *C, int reload); // int BPY_run_script_space_listener(struct bContext *C, struct SpaceScript * sc, struct ARegion *ar, struct wmNotifier *wmn); // 2.5 working diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 7b3a67ebff5..22336bd4f71 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -150,7 +150,7 @@ void BPY_end_python( void ) } /* Can run a file or text block */ -int BPY_run_python_script( bContext *C, const char *fn, struct Text *text ) +int BPY_run_python_script( bContext *C, const char *fn, struct Text *text, struct ReportList *reports) { PyObject *py_dict, *py_result; PyGILState_STATE gilstate; @@ -178,7 +178,7 @@ int BPY_run_python_script( bContext *C, const char *fn, struct Text *text ) MEM_freeN( buf ); if( PyErr_Occurred( ) ) { - PyErr_Print(); PyErr_Clear(); + BPy_errors_to_report(reports); BPY_free_compiled_text( text ); PyGILState_Release(gilstate); return 0; @@ -194,7 +194,7 @@ int BPY_run_python_script( bContext *C, const char *fn, struct Text *text ) } if (!py_result) { - PyErr_Print(); PyErr_Clear(); + BPy_errors_to_report(reports); } else { Py_DECREF( py_result ); } @@ -221,7 +221,7 @@ static void exit_pydraw( SpaceScript * sc, short err ) script = sc->script; if( err ) { - PyErr_Print(); PyErr_Clear(); + BPy_errors_to_report(NULL); // TODO, reports script->flags = 0; /* mark script struct for deletion */ SCRIPT_SET_NULL(script); script->scriptname[0] = '\0'; @@ -250,7 +250,7 @@ static int bpy_run_script_init(bContext *C, SpaceScript * sc) return 0; if (sc->script->py_draw==NULL && sc->script->scriptname[0] != '\0') - BPY_run_python_script(C, sc->script->scriptname, NULL); + BPY_run_python_script(C, sc->script->scriptname, NULL, NULL); if (sc->script->py_draw==NULL) return 0; @@ -329,7 +329,7 @@ int BPY_run_python_script_space(const char *modulename, const char *func) } if (!py_result) { - PyErr_Print(); PyErr_Clear(); + BPy_errors_to_report(NULL); // TODO - reports } else Py_DECREF( py_result ); @@ -410,7 +410,7 @@ void BPY_run_ui_scripts(bContext *C, int reload) if(mod) { Py_DECREF(mod); /* could be NULL from reloading */ } else { - PyErr_Print(); PyErr_Clear(); + BPy_errors_to_report(NULL); // TODO - reports fprintf(stderr, "unable to import \"%s\" %s/%s\n", path, dirname, de->d_name); } } @@ -530,7 +530,7 @@ static float pydriver_error(ChannelDriver *driver) driver->flag |= DRIVER_FLAG_INVALID; /* py expression failed */ fprintf(stderr, "\nError in Driver: The following Python expression failed:\n\t'%s'\n\n", driver->expression); - PyErr_Print(); PyErr_Clear(); + BPy_errors_to_report(NULL); // TODO - reports return 0.0f; } @@ -589,7 +589,7 @@ float BPY_pydriver_eval (ChannelDriver *driver) } fprintf(stderr, "\tBPY_pydriver_eval() - couldn't add variable '%s' to namespace \n", dtar->name); - PyErr_Print(); PyErr_Clear(); + BPy_errors_to_report(NULL); // TODO - reports } } diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index 8cd1bc64f11..9b7893a949b 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -137,54 +137,6 @@ static PyObject *pyop_dict_from_event(wmEvent *event) return dict; } -/* TODO - a whole traceback would be ideal */ -static void pyop_error_report(ReportList *reports) -{ - const char *string; - PyObject *exception, *v, *tb; - PyErr_Fetch(&exception, &v, &tb); - if (exception == NULL) - return; - - /* get the string from the exception */ - if(v==NULL) { - string= "py exception not set"; - } - else if(string = _PyUnicode_AsString(v)) { - /* do nothing */ - } - else { /* a valid PyObject but not a string, try get its string value */ - PyObject *repr; - - Py_INCREF(v); /* incase clearing the error below somehow frees this */ - PyErr_Clear(); - - repr= PyObject_Repr(v); - - if(repr==NULL) { - PyErr_Clear(); - string= "py exception found but can't be converted"; - } - else { - string = _PyUnicode_AsString(repr); - Py_DECREF(repr); - - if(string==NULL) { /* unlikely to happen */ - PyErr_Clear(); - string= "py exception found but can't be converted"; - } - } - - Py_DECREF(v); /* finished dealing with v, PyErr_Clear isnt called anymore so can decref it */ - } - /* done getting the string */ - - /* Now we know v != NULL too */ - BKE_report(reports, RPT_ERROR, string); - - PyErr_Print(); -} - static struct BPY_flag_def pyop_ret_flags[] = { {"RUNNING_MODAL", OPERATOR_RUNNING_MODAL}, {"CANCELLED", OPERATOR_CANCELLED}, @@ -291,13 +243,13 @@ static int PYTHON_OT_generic(int mode, bContext *C, wmOperator *op, wmEvent *eve } if (ret == NULL) { /* covers py_class_instance failing too */ - pyop_error_report(op->reports); + BPy_errors_to_report(op->reports); } else { if (mode==PYOP_POLL) { if (PyBool_Check(ret) == 0) { PyErr_SetString(PyExc_ValueError, "Python poll function return value "); - pyop_error_report(op->reports); + BPy_errors_to_report(op->reports); } else { ret_flag= ret==Py_True ? 1:0; @@ -305,7 +257,7 @@ static int PYTHON_OT_generic(int mode, bContext *C, wmOperator *op, wmEvent *eve } else if (BPY_flag_from_seq(pyop_ret_flags, ret, &ret_flag) == -1) { /* the returned value could not be converted into a flag */ - pyop_error_report(op->reports); + BPy_errors_to_report(op->reports); } /* there is no need to copy the py keyword dict modified by diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index c447e7de982..d5b131583dc 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -168,6 +168,12 @@ void PyObSpit(char *name, PyObject *var) { PyObject_Print(var, stderr, 0); fprintf(stderr, " ref:%d ", var->ob_refcnt); fprintf(stderr, " ptr:%ld", (long)var); + + fprintf(stderr, " type:"); + if(Py_TYPE(var)) + fprintf(stderr, "%s", Py_TYPE(var)->tp_name); + else + fprintf(stderr, ""); } fprintf(stderr, "\n"); } @@ -329,6 +335,72 @@ int BPY_class_validate(const char *class_type, PyObject *class, PyObject *base_c return 0; } + + +/* returns the exception string as a new PyUnicode object, depends on external StringIO module */ +PyObject *BPY_exception_buffer(void) +{ + PyObject *stdout_backup = PySys_GetObject("stdout"); /* borrowed */ + PyObject *stderr_backup = PySys_GetObject("stderr"); /* borrowed */ + PyObject *string_io = NULL; + PyObject *string_io_buf = NULL; + PyObject *string_io_mod; + PyObject *string_io_getvalue; + + PyObject *error_type, *error_value, *error_traceback; + + if (!PyErr_Occurred()) + return NULL; + + PyErr_Fetch(&error_type, &error_value, &error_traceback); + + PyErr_Clear(); + + /* import StringIO / io + * string_io = StringIO.StringIO() + */ + +#if PY_VERSION_HEX < 0x03000000 + if(! (string_io_mod= PyImport_ImportModule("StringIO")) ) { +#else + if(! (string_io_mod= PyImport_ImportModule("io")) ) { +#endif + return NULL; + } else if (! (string_io = PyObject_CallMethod(string_io_mod, "StringIO", NULL))) { + Py_DECREF(string_io_mod); + return NULL; + } else if (! (string_io_getvalue= PyObject_GetAttrString(string_io, "getvalue"))) { + Py_DECREF(string_io_mod); + Py_DECREF(string_io); + return NULL; + } + + Py_INCREF(stdout_backup); // since these were borrowed we dont want them freed when replaced. + Py_INCREF(stderr_backup); + + PySys_SetObject("stdout", string_io); // both of these are free'd when restoring + PySys_SetObject("stderr", string_io); + + PyErr_Restore(error_type, error_value, error_traceback); + PyErr_Print(); /* print the error */ + PyErr_Clear(); + + string_io_buf = PyObject_CallObject(string_io_getvalue, NULL); + + PySys_SetObject("stdout", stdout_backup); + PySys_SetObject("stderr", stderr_backup); + + Py_DECREF(stdout_backup); /* now sys owns the ref again */ + Py_DECREF(stderr_backup); + + Py_DECREF(string_io_mod); + Py_DECREF(string_io_getvalue); + Py_DECREF(string_io); /* free the original reference */ + + PyErr_Clear(); + return string_io_buf; +} + char *BPy_enum_as_string(EnumPropertyItem *item) { DynStr *dynstr= BLI_dynstr_new(); @@ -358,3 +430,33 @@ int BPy_reports_to_error(ReportList *reports) return (report_str != NULL); } + +int BPy_errors_to_report(ReportList *reports) +{ + PyObject *pystring; + char *cstring; + + if (!PyErr_Occurred()) + return 1; + + /* less hassle if we allow NULL */ + if(reports==NULL) { + PyErr_Print(); + PyErr_Clear(); + return 1; + } + + pystring= BPY_exception_buffer(); + + if(pystring==NULL) { + BKE_report(reports, RPT_ERROR, "unknown py-exception, could not convert"); + return 0; + } + + cstring= _PyUnicode_AsString(pystring); + + BKE_report(reports, RPT_ERROR, cstring); + fprintf(stderr, "%s\n", cstring); // not exactly needed. just for testing + Py_DECREF(pystring); + return 1; +} diff --git a/source/blender/python/intern/bpy_util.h b/source/blender/python/intern/bpy_util.h index 49f48802249..6429af67eb0 100644 --- a/source/blender/python/intern/bpy_util.h +++ b/source/blender/python/intern/bpy_util.h @@ -47,6 +47,8 @@ void PyObSpit(char *name, PyObject *var); void PyLineSpit(void); void BPY_getFileAndNum(char **filename, int *lineno); +PyObject *BPY_exception_buffer(void); + /* own python like utility function */ PyObject *PyObject_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...); @@ -73,6 +75,7 @@ char *BPy_enum_as_string(struct EnumPropertyItem *item); /* error reporting */ int BPy_reports_to_error(struct ReportList *reports); +int BPy_errors_to_report(struct ReportList *reports); /* TODO - find a better solution! */ struct bContext *BPy_GetContext(void); diff --git a/source/creator/creator.c b/source/creator/creator.c index 5617435049d..a19e5d0718c 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -710,7 +710,7 @@ int main(int argc, char **argv) //XXX // FOR TESTING ONLY a++; - BPY_run_python_script(C, argv[a], NULL); + BPY_run_python_script(C, argv[a], NULL, NULL); // use reports? #if 0 a++; if (a < argc) { @@ -719,7 +719,7 @@ int main(int argc, char **argv) main_init_screen(); scr_init = 1; } - BPY_run_python_script(C, argv[a], NULL); + BPY_run_python_script(C, argv[a], NULL, NULL); // use reports? } else printf("\nError: you must specify a Python script after '-P '.\n"); #endif -- cgit v1.2.3 From 680a838a791a5fd08c9e52b77cf6b7d3c0b2e7e2 Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Sun, 14 Jun 2009 17:20:46 +0000 Subject: Enable non reordering menus option, it was disabled without explanation (?). --- source/blender/editors/interface/interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index e37f7d2158c..b3f24be2f9a 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2874,8 +2874,8 @@ void uiBlockFlipOrder(uiBlock *block) uiBut *but, *next; float centy, miny=10000, maxy= -10000; -// if(U.uiflag & USER_PLAINMENUS) -// return; + if(U.uiflag & USER_PLAINMENUS) + return; for(but= block->buttons.first; but; but= but->next) { if(but->flag & UI_BUT_ALIGN) return; -- cgit v1.2.3 From 03bd1367ac79f5a34a7c39704d19e067ef69f1c0 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 14 Jun 2009 18:16:38 +0000 Subject: 2.5 Material: * Some material button tweaks by William. Thanks. * Some more material notifiers. --- source/blender/makesrna/intern/rna_material.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 78098570783..3facfab16f6 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -753,6 +753,7 @@ void rna_def_material_specularity(StructRNA *srna) RNA_def_property_float_sdna(prop, NULL, "spec"); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Specularity Intensity", ""); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); /* XXX: this field is also used for Halo hardness. should probably be fixed in DNA */ /* I guess it's fine. Specular is disabled when mat type is Halo. --DingTo */ @@ -760,11 +761,13 @@ void rna_def_material_specularity(StructRNA *srna) RNA_def_property_float_sdna(prop, NULL, "har"); RNA_def_property_range(prop, 1, 511); RNA_def_property_ui_text(prop, "Specular Hardness", ""); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "specular_refraction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "refrac"); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Specular IOR", ""); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); /* XXX: evil "param" field also does specular stuff */ @@ -772,6 +775,7 @@ void rna_def_material_specularity(StructRNA *srna) RNA_def_property_float_sdna(prop, NULL, "rms"); RNA_def_property_range(prop, 0, 0.4); RNA_def_property_ui_text(prop, "Specular Slope", "The standard deviation of surface slope."); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); } void rna_def_material_strand(BlenderRNA *brna) @@ -787,48 +791,58 @@ void rna_def_material_strand(BlenderRNA *brna) prop= RNA_def_property(srna, "tangent_shading", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_STR); RNA_def_property_ui_text(prop, "Tangent Shading", "Uses direction of strands as normal for tangent-shading."); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "surface_diffuse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STR_SURFDIFF); RNA_def_property_ui_text(prop, "Surface Diffuse", "Make diffuse shading more similar to shading the surface."); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "blend_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "strand_surfnor"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Blend Distance", "Distance in Blender units over which to blend in the surface normal."); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "blender_units", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STR_B_UNITS); RNA_def_property_ui_text(prop, "Blender Units", "Use Blender units for widths instead of pixels."); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "start_size", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "strand_sta"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_start_size_range"); RNA_def_property_ui_text(prop, "Start Size", "Start size of strands in pixels Blender units."); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "end_size", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "strand_end"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_end_size_range"); RNA_def_property_ui_text(prop, "End Size", "Start size of strands in pixels or Blender units."); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "min_size", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "strand_min"); RNA_def_property_range(prop, 0.001, 10); RNA_def_property_ui_text(prop, "Minimum Size", "Minimum size of strands in pixels."); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "shape", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "strand_ease"); RNA_def_property_range(prop, -0.9, 0.9); RNA_def_property_ui_text(prop, "Shape", "Positive values make strands rounder, negative makes strands spiky."); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "width_fade", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "strand_widthfade"); RNA_def_property_range(prop, 0, 2); RNA_def_property_ui_text(prop, "Width Fade", "Transparency along the width of the strand."); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "strand_uvname"); RNA_def_property_ui_text(prop, "UV Layer", "Name of UV layer to override."); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); } void RNA_def_material(BlenderRNA *brna) -- cgit v1.2.3 From ca12954e9fb3b38d662190d12e72937ef9990d89 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 14 Jun 2009 18:54:35 +0000 Subject: == Sequencer == Big proxy fix (addressing hopefully most complaints on mailing list and in tracker) * proxy render settings are now independent of render size settings. That means: which proxy size is used, is controlled by two parameters now: the proxy size of the files, can be controlled with additional buttons within the proxy panels. What is shown in a specific preview window depends on the header settings of the preview panel. So: proxies are _only_ used in those windows, that are switched to a specific proxy resolution. * output rendering is always done _without_ proxies. * proxy generation now shows a waitcursor with numbers. (closing Bug: [#18909] Building Proxies doesn't give any feedback which was rather a feature request, since the problem mentioned there was always the case :) ) --- source/blender/blenkernel/BKE_blender.h | 2 +- source/blender/blenloader/intern/readfile.c | 28 +++++ source/blender/makesdna/DNA_sequence_types.h | 3 + source/blender/src/buttons_scene.c | 159 +++++++++++++++++---------- source/blender/src/drawseq.c | 18 ++- source/blender/src/header_seq.c | 16 +-- source/blender/src/sequence.c | 20 ++-- 7 files changed, 162 insertions(+), 84 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 5513f98b299..30e68b83149 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -41,7 +41,7 @@ struct ListBase; struct MemFile; #define BLENDER_VERSION 249 -#define BLENDER_SUBVERSION 1 +#define BLENDER_SUBVERSION 2 #define BLENDER_MINVERSION 245 #define BLENDER_MINSUBVERSION 15 diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 38b8bfaaa88..c4d63cf14fd 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8156,6 +8156,34 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } + if (main->versionfile < 249 && main->subversionfile < 2) { + Scene *sce= main->scene.first; + Sequence *seq; + Editing *ed; + + while(sce) { + ed= sce->ed; + if(ed) { + WHILE_SEQ(&ed->seqbase) { + if (seq->strip && seq->strip->proxy){ + if (G.scene->r.size != 100.0) { + seq->strip->proxy->size + = sce->r.size; + } else { + seq->strip->proxy->size + = 25.0; + } + seq->strip->proxy->quality =90; + } + } + END_SEQ + } + + sce= sce->id.next; + } + + } + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index ed1626c887f..b6815df9fc5 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -80,6 +80,9 @@ typedef struct StripProxy { char dir[160]; char file[80]; struct anim *anim; + short size; + short quality; + int pad; } StripProxy; typedef struct Strip { diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 532ecad249f..d0df532a824 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -1164,6 +1164,8 @@ static void seq_panel_proxy() { Sequence *last_seq = get_last_seq(); uiBlock *block; + int yofs; + block = uiNewBlock(&curarea->uiblocks, "seq_panel_proxy", UI_EMBOSS, UI_HELV, curarea->win); @@ -1172,83 +1174,118 @@ static void seq_panel_proxy() uiBlockBeginAlign(block); + yofs = 140; + uiDefButBitI(block, TOG, SEQ_USE_PROXY, B_SEQ_BUT_RELOAD, "Use Proxy", - 10,140,80,19, &last_seq->flag, + 10,yofs,80,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Use a preview proxy for this strip"); - if (last_seq->flag & SEQ_USE_PROXY) { - if (!last_seq->strip->proxy) { - last_seq->strip->proxy = - MEM_callocN(sizeof(struct StripProxy), - "StripProxy"); - } + if (!(last_seq->flag & SEQ_USE_PROXY)) { + uiBlockEndAlign(block); + return; + } - uiDefButBitI(block, TOG, SEQ_USE_PROXY_CUSTOM_DIR, - B_SEQ_BUT_RELOAD, "Custom Dir", - 90,140,80,19, &last_seq->flag, - 0.0, 21.0, 100, 0, - "Use a custom directory to store data"); + if (!last_seq->strip->proxy) { + last_seq->strip->proxy = + MEM_callocN(sizeof(struct StripProxy), + "StripProxy"); + } - uiDefButBitI(block, TOG, SEQ_USE_PROXY_CUSTOM_FILE, - B_SEQ_BUT_RELOAD, "Custom File", - 170,140,80,19, &last_seq->flag, - 0.0, 21.0, 100, 0, - "Use a custom file to load data from"); + uiDefButBitI(block, TOG, SEQ_USE_PROXY_CUSTOM_DIR, + B_SEQ_BUT_RELOAD, "Custom Dir", + 90,yofs,80,19, &last_seq->flag, + 0.0, 21.0, 100, 0, + "Use a custom directory to store data"); - if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR) { - uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_DIR, - ICON_FILESEL, 10, 120, 20, 20, 0, 0, 0, 0, 0, - "Select the directory/name for " - "the proxy storage"); + uiDefButBitI(block, TOG, SEQ_USE_PROXY_CUSTOM_FILE, + B_SEQ_BUT_RELOAD, "Custom File", + 170,yofs,80,19, &last_seq->flag, + 0.0, 21.0, 100, 0, + "Use a custom file to load data from"); + + if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR || + last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { + yofs -= 20; - uiDefBut(block, TEX, - B_SEQ_BUT_RELOAD, "Dir: ", - 30,120,220,20, last_seq->strip->proxy->dir, - 0.0, (float)sizeof(last_seq->strip->proxy->dir)-1, 100, 0, ""); - } - if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { - uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_FILE, - ICON_FILESEL, 10, 100, 20, 20, 0, 0, 0, - 0, 0, - "Select the custom proxy file " - "(used for all preview resolutions!)"); + uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_DIR, + ICON_FILESEL, 10, yofs, 20, 20, 0, 0, 0, 0, 0, + "Select the directory/name for " + "the proxy storage"); + + uiDefBut(block, TEX, + B_SEQ_BUT_RELOAD, "Dir: ", + 30,yofs,220,20, last_seq->strip->proxy->dir, + 0.0, (float)sizeof(last_seq->strip->proxy->dir)-1, + 100, 0, ""); + } - uiDefBut(block, TEX, - B_SEQ_BUT_RELOAD, "File: ", - 30,100,220,20, last_seq->strip->proxy->file, - 0.0, (float)sizeof(last_seq->strip->proxy->file)-1, 100, 0, ""); - } + if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { + yofs -= 20; + uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_FILE, + ICON_FILESEL, 10, yofs, 20, 20, 0, 0, 0, + 0, 0, + "Select the custom proxy file " + "(used for all preview resolutions!)"); + + uiDefBut(block, TEX, + B_SEQ_BUT_RELOAD, "File: ", + 30, yofs,220,20, last_seq->strip->proxy->file, + 0.0, (float)sizeof(last_seq->strip->proxy->file)-1, + 100, 0, ""); } - if (last_seq->flag & SEQ_USE_PROXY) { - if (G.scene->r.size == 100) { - uiDefBut(block, LABEL, 0, - "Full render size selected, ", - 10,60,240,19, 0, 0, 0, 0, 0, ""); - uiDefBut(block, LABEL, 0, - "so no proxy enabled!", - 10,40,240,19, 0, 0, 0, 0, 0, ""); - } else if (last_seq->type != SEQ_MOVIE - && last_seq->type != SEQ_IMAGE - && !(last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)) { - uiDefBut(block, LABEL, 0, - "Cannot proxy this strip without ", - 10,60,240,19, 0, 0, 0, 0, 0, ""); - uiDefBut(block, LABEL, 0, - "custom directory selection!", - 10,40,240,19, 0, 0, 0, 0, 0, ""); - } else if (!(last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE)) { - uiDefBut(block, BUT, B_SEQ_BUT_REBUILD_PROXY, - "Rebuild proxy", - 10,60,240,19, 0, 0, 0, 0, 0, - "Rebuild proxy for the " - "currently selected strip."); + if (!(last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE)) { + if (last_seq->strip->proxy->size == 0) { + if (G.scene->r.size != 100) { + last_seq->strip->proxy->size = G.scene->r.size; + } else { + last_seq->strip->proxy->size = 25; + } + } + if (last_seq->strip->proxy->quality == 0) { + last_seq->strip->proxy->quality = 90; } + yofs -= 25; + + uiDefButS(block, NUM,B_DIFF, "Q:", 10,yofs,74,20, + &last_seq->strip->proxy->quality, + 10.0, 100.0, 0, 0, + "Quality setting for JPEG images"); + uiDefButS(block, ROW,B_DIFF,"75%", 90,yofs,53,20, + &last_seq->strip->proxy->size,1.0,75.0, 0, 0, + "Set proxy size to 3/4 of defined size"); + uiDefButS(block, ROW,B_DIFF,"50%", 143,yofs,53,20, + &last_seq->strip->proxy->size,1.0,50.0, 0, 0, + "Set proxy size to 1/2 of defined size"); + uiDefButS(block, ROW,B_DIFF,"25%", 196,yofs,53,20, + &last_seq->strip->proxy->size,1.0,25.0, 0, 0, + "Set proxy size to 1/4 of defined size"); + } + + if (last_seq->type != SEQ_MOVIE + && last_seq->type != SEQ_IMAGE + && !(last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)) { + yofs -= 20; + uiDefBut(block, LABEL, 0, + "Cannot proxy this strip without ", + 30,yofs,240,19, 0, 0, 0, 0, 0, ""); + yofs -= 20; + uiDefBut(block, LABEL, 0, + "custom directory selection!", + 30,yofs,240,19, 0, 0, 0, 0, 0, ""); + } else if (!(last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE)) { + yofs -= 45; + uiDefBut(block, BUT, B_SEQ_BUT_REBUILD_PROXY, + "Rebuild proxy", + 10,yofs,240,40, 0, 0, 0, 0, 0, + "Rebuild proxy for the " + "currently selected strip."); } uiBlockEndAlign(block); + } diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c index 7fd7d8880a1..2ff26d75595 100644 --- a/source/blender/src/drawseq.c +++ b/source/blender/src/drawseq.c @@ -849,7 +849,8 @@ static void draw_image_seq(ScrArea *sa) static int recursive= 0; float zoom; float zoomx, zoomy; - int render_size = 0; + float render_size = 0.0; + float proxy_size = 100.0; glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); @@ -860,6 +861,8 @@ static void draw_image_seq(ScrArea *sa) render_size = sseq->render_size; if (render_size == 0) { render_size = G.scene->r.size; + } else { + proxy_size = render_size; } if (render_size < 0) { return; @@ -879,16 +882,16 @@ static void draw_image_seq(ScrArea *sa) recursive= 1; if (special_seq_update) { ibuf= give_ibuf_seq_direct( - rectx, recty, (G.scene->r.cfra), render_size, + rectx, recty, (G.scene->r.cfra), proxy_size, special_seq_update); } else if (!U.prefetchframes || (G.f & G_PLAYANIM) == 0) { ibuf= (ImBuf *)give_ibuf_seq( rectx, recty, (G.scene->r.cfra), - sseq->chanshown, render_size); + sseq->chanshown, proxy_size); } else { ibuf= (ImBuf *)give_ibuf_seq_threaded( rectx, recty, (G.scene->r.cfra), - sseq->chanshown, render_size); + sseq->chanshown, proxy_size); } recursive= 0; @@ -939,7 +942,7 @@ static void draw_image_seq(ScrArea *sa) zoom= SEQ_ZOOM_FAC(sseq->zoom); if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) { - zoom /= render_size / 100.0; + zoom /= proxy_size / 100.0; zoomx = zoom * ((float)G.scene->r.xasp / (float)G.scene->r.yasp); zoomy = zoom; } else { @@ -1122,8 +1125,11 @@ void drawprefetchseqspace(ScrArea *sa, void *spacedata) SpaceSeq *sseq= sa->spacedata.first; int rectx, recty; int render_size = sseq->render_size; + int proxy_size = 100.0; if (render_size == 0) { render_size = G.scene->r.size; + } else { + proxy_size = render_size; } if (render_size < 0) { return; @@ -1135,7 +1141,7 @@ void drawprefetchseqspace(ScrArea *sa, void *spacedata) if(sseq->mainb) { give_ibuf_prefetch_request( rectx, recty, (G.scene->r.cfra), sseq->chanshown, - render_size); + proxy_size); } } diff --git a/source/blender/src/header_seq.c b/source/blender/src/header_seq.c index 23712b93b50..5b117fb2273 100644 --- a/source/blender/src/header_seq.c +++ b/source/blender/src/header_seq.c @@ -741,16 +741,16 @@ void seq_buttons() xco+= 8 + XIC*3.5; uiDefButS(block, MENU, B_REDR, - "Render size: %t" - "|R 100 %x100" - "|R 75 %x75" - "|R 50 %x50" - "|R 25 %x25" - "|R Sce %x0" - "|R Off %x-1", + "Proxy Render Size: %t" + "|Q 100 %x100" + "|Q 75 %x75" + "|Q 50 %x50" + "|Q 25 %x25" + "|Q Sce %x0" + "|Q Off %x-1", xco,0,3.0 * XIC, YIC, &sseq->render_size, 0,0,0,0, - "Use different (proxy) render size " + "Use different proxy render size settings " "for this preview screen, use scene render size " "or disable this preview completely"); diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index 44661b5fa91..5a63e3ea995 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -1211,7 +1211,7 @@ static void seq_proxy_build_frame(Sequence * seq, int cfra, int render_size) depth = 32 is intentionally left in, otherwise ALPHA channels won't work... */ - quality = 90; + quality = seq->strip->proxy->quality; ibuf->ftype= JPG | quality; BLI_make_existing_file(name); @@ -1228,6 +1228,7 @@ static void seq_proxy_build_frame(Sequence * seq, int cfra, int render_size) void seq_proxy_rebuild(Sequence * seq) { int cfra; + float rsize = seq->strip->proxy->size; waitcursor(1); @@ -1245,6 +1246,8 @@ void seq_proxy_rebuild(Sequence * seq) tse->flag &= ~STRIPELEM_PREVIEW_DONE; } + + /* a _lot_ faster for movie files, if we read frames in sequential order */ if (seq->flag & SEQ_REVERSE_FRAMES) { @@ -1253,8 +1256,8 @@ void seq_proxy_rebuild(Sequence * seq) TStripElem * tse = give_tstripelem(seq, cfra); if (!(tse->flag & STRIPELEM_PREVIEW_DONE)) { - seq_proxy_build_frame(seq, cfra, - G.scene->r.size); + set_timecursor(cfra); + seq_proxy_build_frame(seq, cfra, rsize); tse->flag |= STRIPELEM_PREVIEW_DONE; } if (blender_test_break()) { @@ -1267,8 +1270,8 @@ void seq_proxy_rebuild(Sequence * seq) TStripElem * tse = give_tstripelem(seq, cfra); if (!(tse->flag & STRIPELEM_PREVIEW_DONE)) { - seq_proxy_build_frame(seq, cfra, - G.scene->r.size); + set_timecursor(cfra); + seq_proxy_build_frame(seq, cfra, rsize); tse->flag |= STRIPELEM_PREVIEW_DONE; } if (blender_test_break()) { @@ -1959,7 +1962,7 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, } else if (se->ibuf==NULL && sce_valid) { /* no need to display a waitcursor on sequencer scene strips */ - if (!(sce->r.scemode & R_DOSEQ)) + if (!(sce->r.scemode & R_DOSEQ) && !build_proxy_run) waitcursor(1); /* Hack! This function can be called from do_render_seq(), in that case @@ -2012,7 +2015,8 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra, G.scene->r.scemode |= doseq; if((G.f & G_PLAYANIM)==0 /* bad, is set on do_render_seq */ - && !(sce->r.scemode & R_DOSEQ)) + && !(sce->r.scemode & R_DOSEQ) + && !build_proxy_run) waitcursor(0); CFRA = oldcfra; @@ -3111,7 +3115,7 @@ void do_render_seq(RenderResult *rr, int cfra) recurs_depth++; - ibuf= give_ibuf_seq(rr->rectx, rr->recty, cfra, 0, G.scene->r.size); + ibuf= give_ibuf_seq(rr->rectx, rr->recty, cfra, 0, 100.0); recurs_depth--; -- cgit v1.2.3 From bc6761f5ef9e4201a0f34531f9855fce2be68c5e Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sun, 14 Jun 2009 20:01:12 +0000 Subject: BGE bug #18869: Can't create Windows runtime. --- source/blender/src/header_info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c index 71abed0d806..98a45de51e9 100644 --- a/source/blender/src/header_info.c +++ b/source/blender/src/header_info.c @@ -565,8 +565,8 @@ static void copy_game_dll(char *dll_filename, char *source_dir, char *dest_dir) static void copy_all_game_dlls(char *str) { -#define GAME_DLL_COUNT 7 - char *game_dll_list[GAME_DLL_COUNT]={"gnu_gettext.dll", "libpng.dll", "libtiff.dll", "pthreadVC2.dll", "python25.dll", "SDL.dll", "zlib.dll"}; +#define GAME_DLL_COUNT 17 + char *game_dll_list[GAME_DLL_COUNT]={"avcodec-52.dll", "avdevice-52.dll", "avformat-52.dll", "avutil-50.dll", "libfaac-0.dll", "libfaad-2.dll", "libmp3lame-0.dll", "libx264-67.dll", "swscale-0.dll", "xvidcore.dll", "gnu_gettext.dll", "libtiff.dll", "python25.dll", "SDL.dll", "pthreadVC2.dll", "libpng.dll", "zlib.dll"}; char dest_dir[FILE_MAX]; char source_dir[FILE_MAX]; -- cgit v1.2.3 From c12d5d61a89e549dd4a07abf65d54d2768c1df76 Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Sun, 14 Jun 2009 20:26:20 +0000 Subject: Standarizing on control for unconditionally entering keyboard input edit mode. (Outliner uses this because shift is used for multiple select) --- source/blender/editors/interface/interface_handlers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 0f6dbc430fb..6ec809b7178 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1774,7 +1774,7 @@ static int ui_do_but_NUM(bContext *C, uiBlock *block, uiBut *but, uiHandleButton click= 1; } else if(event->val==KM_PRESS) { - if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->shift) { + if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->ctrl) { button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING); retval= WM_UI_HANDLER_BREAK; } @@ -1985,7 +1985,7 @@ static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButton click= 2; } else if(event->val==KM_PRESS) { - if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->shift) { + if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->ctrl) { button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING); retval= WM_UI_HANDLER_BREAK; } @@ -2027,7 +2027,7 @@ static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButton } if(click) { - if (event->ctrl || click==2) { + if (click==2) { /* nudge slider to the left or right */ float f, tempf, softmin, softmax, softrange; int temp; -- cgit v1.2.3 From afaa3768e655bb7cfc7f89fd5fdd08a69ac4f132 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 14 Jun 2009 20:52:43 +0000 Subject: == Sequencer == Fixes an irritating but harmless error message when using custom proxy files. --- source/blender/src/buttons_scene.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index d0df532a824..dac093b6ba8 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -1266,7 +1266,8 @@ static void seq_panel_proxy() if (last_seq->type != SEQ_MOVIE && last_seq->type != SEQ_IMAGE - && !(last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)) { + && !(last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR) + && !(last_seq->flag & SEQ_USE_PROXY_CUSTOM_FILE)) { yofs -= 20; uiDefBut(block, LABEL, 0, "Cannot proxy this strip without ", -- cgit v1.2.3 From e6aa552e25cd2c8ff6582b3f8fb2a91b8aad2711 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 15 Jun 2009 09:54:37 +0000 Subject: 2.5 Text Object: editmode suffered wrong allocation and reading from wrong memory, causing crashes when typing more than a few chars. --- source/blender/blenkernel/intern/curve.c | 2 +- source/blender/blenkernel/intern/font.c | 4 ++-- source/blender/editors/curve/editfont.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index fab9669d55f..7dd868278f4 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -155,7 +155,7 @@ Curve *add_curve(char *name, int type) cu->str= MEM_mallocN(12, "str"); strcpy(cu->str, "Text"); cu->pos= 4; - cu->strinfo= MEM_callocN(12*sizeof(CharInfo), "strinfo"); + cu->strinfo= MEM_callocN(12*sizeof(CharInfo), "strinfo new"); cu->totbox= cu->actbox= 1; cu->tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "textbox"); cu->tb[0].w = cu->tb[0].h = 0.0; diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index c3cf6e06c09..60a7ffc28d9 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -682,7 +682,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) cu->ulheight = 0.05; if (cu->strinfo==NULL) /* old file */ - cu->strinfo = MEM_callocN((slen+1) * sizeof(CharInfo), "strinfo compat"); + cu->strinfo = MEM_callocN((slen+4) * sizeof(CharInfo), "strinfo compat"); custrinfo= cu->strinfo; if (cu->editfont) @@ -1145,7 +1145,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) if (cu->sepchar==0) { for (i= 0; istrinfo[i]); + info = &(custrinfo[i]); if (info->mat_nr > (ob->totcol)) { /* printf("Error: Illegal material index (%d) in text object, setting to 0\n", info->mat_nr); */ info->mat_nr = 0; diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 1b2c8ea6b11..0fb6fb8cb90 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -1407,7 +1407,7 @@ void make_editText(Object *obedit) ef->copybuf= MEM_callocN((MAXTEXT+4)*sizeof(wchar_t), "texteditcopybuf"); ef->copybufinfo= MEM_callocN((MAXTEXT+4)*sizeof(CharInfo), "texteditcopybufinfo"); ef->oldstr= MEM_callocN((MAXTEXT+4)*sizeof(wchar_t), "oldstrbuf"); - ef->oldstrinfo= MEM_callocN((MAXTEXT+4)*sizeof(wchar_t), "oldstrbuf"); + ef->oldstrinfo= MEM_callocN((MAXTEXT+4)*sizeof(CharInfo), "oldstrbuf"); } // Convert the original text to wchar_t -- cgit v1.2.3 From 2773464561e5e2e19295b96684a4fd0d9bb60361 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 15 Jun 2009 10:11:08 +0000 Subject: Game Engine working with the new animation system for Ipos (IpoActuator) FCurves are used for animation evaluation so FCurve modifiers work :). Tested with object location and object color animation. Armature and Shape Keys next. --- .../Converter/KX_BlenderScalarInterpolator.cpp | 49 +- .../Converter/KX_BlenderScalarInterpolator.h | 15 +- .../Converter/KX_BlenderSceneConverter.cpp | 18 +- .../Converter/KX_BlenderSceneConverter.h | 6 +- source/gameengine/Converter/KX_IpoConvert.cpp | 579 +++++---------------- 5 files changed, 170 insertions(+), 497 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp index 17bb3dedd36..1ae96350197 100644 --- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp +++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp @@ -27,33 +27,28 @@ */ #include "KX_BlenderScalarInterpolator.h" +#include "stdio.h" +#include extern "C" { #include "DNA_ipo_types.h" -#include "BKE_ipo.h" +#include "DNA_action_types.h" +#include "DNA_anim_types.h" +#include "BKE_fcurve.h" } -static const int BL_MAX_CHANNELS = 32; - float BL_ScalarInterpolator::GetValue(float currentTime) const { - return 0; // XXX IPO_GetFloatValue(m_blender_ipo, m_channel, currentTime); + // XXX 2.4x IPO_GetFloatValue(m_blender_adt, m_channel, currentTime); + return evaluate_fcurve(m_fcu, currentTime); } - - -BL_InterpolatorList::BL_InterpolatorList(struct Ipo *ipo) { - IPO_Channel channels[BL_MAX_CHANNELS]; - - int num_channels = 0; // XXX IPO_GetChannels(ipo, channels); - - int i; - - for (i = 0; i != num_channels; ++i) { - BL_ScalarInterpolator *new_ipo = - new BL_ScalarInterpolator(ipo, channels[i]); - - //assert(new_ipo); - push_back(new_ipo); +BL_InterpolatorList::BL_InterpolatorList(struct AnimData *adt) { + for(FCurve *fcu= (FCurve *)adt->action->curves.first; fcu; fcu= (FCurve *)fcu->next) { + if(fcu->rna_path) { + BL_ScalarInterpolator *new_ipo = new BL_ScalarInterpolator(fcu); + //assert(new_ipo); + push_back(new_ipo); + } } } @@ -64,15 +59,13 @@ BL_InterpolatorList::~BL_InterpolatorList() { } } - -KX_IScalarInterpolator *BL_InterpolatorList::GetScalarInterpolator(BL_IpoChannel channel) { - BL_InterpolatorList::iterator i = begin(); - while (!(i == end()) && - (static_cast(*i))->GetChannel() != - channel) { - ++i; +KX_IScalarInterpolator *BL_InterpolatorList::GetScalarInterpolator(char *rna_path, int array_index) { + for(BL_InterpolatorList::iterator i = begin(); (i != end()) ; i++ ) + { + FCurve *fcu= (static_cast(*i))->GetFCurve(); + if(array_index==fcu->array_index && strcmp(rna_path, fcu->rna_path)==0) + return *i; } - - return (i == end()) ? 0 : *i; + return NULL; } diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h index 94d15aff6be..396a7d197df 100644 --- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h +++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h @@ -38,29 +38,26 @@ typedef unsigned short BL_IpoChannel; class BL_ScalarInterpolator : public KX_IScalarInterpolator { public: BL_ScalarInterpolator() {} // required for use in STL list - BL_ScalarInterpolator(struct Ipo *ipo, BL_IpoChannel channel) : - m_blender_ipo(ipo), - m_channel(channel) + BL_ScalarInterpolator(struct FCurve* fcu) : + m_fcu(fcu) {} virtual ~BL_ScalarInterpolator() {} virtual float GetValue(float currentTime) const; - - BL_IpoChannel GetChannel() const { return m_channel; } + struct FCurve *GetFCurve() { return m_fcu;}; private: - struct Ipo *m_blender_ipo; - BL_IpoChannel m_channel; + struct FCurve *m_fcu; }; class BL_InterpolatorList : public std::vector { public: - BL_InterpolatorList(struct Ipo *ipo); + BL_InterpolatorList(struct AnimData *adt); ~BL_InterpolatorList(); - KX_IScalarInterpolator *GetScalarInterpolator(BL_IpoChannel channel); + KX_IScalarInterpolator *GetScalarInterpolator(char *rna_path, int array_index); }; #endif //__KX_SCALARINTERPOLATOR_H diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index d5c93758f94..86e20b88580 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -113,11 +113,11 @@ KX_BlenderSceneConverter::~KX_BlenderSceneConverter() // delete sumoshapes - int numipolists = m_map_blender_to_gameipolist.size(); - for (i=0; i >::iterator itw = m_worldinfos.begin(); @@ -573,18 +573,18 @@ void KX_BlenderSceneConverter::RegisterPolyMaterial(RAS_IPolyMaterial *polymat) void KX_BlenderSceneConverter::RegisterInterpolatorList( - BL_InterpolatorList *ipoList, - struct Ipo *for_ipo) + BL_InterpolatorList *adtList, + struct AnimData *for_adt) { - m_map_blender_to_gameipolist.insert(CHashedPtr(for_ipo), ipoList); + m_map_blender_to_gameAdtList.insert(CHashedPtr(for_adt), adtList); } BL_InterpolatorList *KX_BlenderSceneConverter::FindInterpolatorList( - struct Ipo *for_ipo) + struct AnimData *for_adt) { - BL_InterpolatorList **listp = m_map_blender_to_gameipolist[CHashedPtr(for_ipo)]; + BL_InterpolatorList **listp = m_map_blender_to_gameAdtList[CHashedPtr(for_adt)]; return listp?*listp:NULL; } diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h index cf8dd5b339a..b65f49c2b59 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.h +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h @@ -65,7 +65,7 @@ class KX_BlenderSceneConverter : public KX_ISceneConverter GEN_Map m_map_blender_to_gameactuator; GEN_Map m_map_blender_to_gamecontroller; - GEN_Map m_map_blender_to_gameipolist; + GEN_Map m_map_blender_to_gameAdtList; Main* m_maggie; @@ -121,8 +121,8 @@ public: void RegisterBlenderMaterial(BL_Material *mat); - void RegisterInterpolatorList(BL_InterpolatorList *ipoList, struct Ipo *for_ipo); - BL_InterpolatorList *FindInterpolatorList(struct Ipo *for_ipo); + void RegisterInterpolatorList(BL_InterpolatorList *adtList, struct AnimData *for_adt); + BL_InterpolatorList *FindInterpolatorList(struct AnimData *for_adt); void RegisterGameActuator(SCA_IActuator *act, struct bActuator *for_actuator); SCA_IActuator *FindGameActuator(struct bActuator *for_actuator); diff --git a/source/gameengine/Converter/KX_IpoConvert.cpp b/source/gameengine/Converter/KX_IpoConvert.cpp index f19390db8a9..35a1ccc1dbb 100644 --- a/source/gameengine/Converter/KX_IpoConvert.cpp +++ b/source/gameengine/Converter/KX_IpoConvert.cpp @@ -71,20 +71,20 @@ #include "STR_HashedString.h" -static BL_InterpolatorList *GetIpoList(struct Ipo *for_ipo, KX_BlenderSceneConverter *converter) { - BL_InterpolatorList *ipoList= converter->FindInterpolatorList(for_ipo); +static BL_InterpolatorList *GetAdtList(struct AnimData *for_adt, KX_BlenderSceneConverter *converter) { + BL_InterpolatorList *adtList= converter->FindInterpolatorList(for_adt); - if (!ipoList) { - ipoList = new BL_InterpolatorList(for_ipo); - converter->RegisterInterpolatorList(ipoList, for_ipo); + if (!adtList) { + adtList = new BL_InterpolatorList(for_adt); + converter->RegisterInterpolatorList(adtList, for_adt); } - return ipoList; + return adtList; } void BL_ConvertIpos(struct Object* blenderobject,KX_GameObject* gameobj,KX_BlenderSceneConverter *converter) { - if (blenderobject->ipo) { + if (blenderobject->adt) { KX_IpoSGController* ipocontr = new KX_IpoSGController(); gameobj->GetSGNode()->AddSGController(ipocontr); @@ -120,271 +120,79 @@ void BL_ConvertIpos(struct Object* blenderobject,KX_GameObject* gameobj,KX_Blend ) ); - BL_InterpolatorList *ipoList= GetIpoList(blenderobject->ipo, converter); + BL_InterpolatorList *adtList= GetAdtList(blenderobject->adt, converter); - // For each active channel in the ipoList add an + // For each active channel in the adtList add an // interpolator to the game object. - KX_IScalarInterpolator *ipo; + KX_IInterpolator *interpolator; + KX_IScalarInterpolator *interp; - ipo = ipoList->GetScalarInterpolator(OB_LOC_X); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetPosition()[0]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_LOC_X, true); - - } - - ipo = ipoList->GetScalarInterpolator(OB_LOC_Y); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetPosition()[1]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_LOC_Y, true); - } - - ipo = ipoList->GetScalarInterpolator(OB_LOC_Z); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetPosition()[2]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_LOC_Z, true); - } - - // Master the art of cut & paste programming... - - ipo = ipoList->GetScalarInterpolator(OB_DLOC_X); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetDeltaPosition()[0]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_DLOC_X, true); - } - - ipo = ipoList->GetScalarInterpolator(OB_DLOC_Y); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetDeltaPosition()[1]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_DLOC_Y, true); - } - - ipo = ipoList->GetScalarInterpolator(OB_DLOC_Z); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetDeltaPosition()[2]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_DLOC_Z, true); - } - - // Explore the finesse of reuse and slight modification - - ipo = ipoList->GetScalarInterpolator(OB_ROT_X); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetEulerAngles()[0]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_ROT_X, true); - } - ipo = ipoList->GetScalarInterpolator(OB_ROT_Y); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetEulerAngles()[1]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_ROT_Y, true); - } - ipo = ipoList->GetScalarInterpolator(OB_ROT_Z); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetEulerAngles()[2]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_ROT_Z, true); - } - - // Hmmm, the need for a macro comes to mind... - - ipo = ipoList->GetScalarInterpolator(OB_DROT_X); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetDeltaEulerAngles()[0]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_DROT_X, true); - } - ipo = ipoList->GetScalarInterpolator(OB_DROT_Y); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetDeltaEulerAngles()[1]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_DROT_Y, true); - } - ipo = ipoList->GetScalarInterpolator(OB_DROT_Z); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetDeltaEulerAngles()[2]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_DROT_Z, true); - } - - // Hang on, almost there... - - ipo = ipoList->GetScalarInterpolator(OB_SIZE_X); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetScaling()[0]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_SIZE_X, true); + for(int i=0; i<3; i++) { + if ((interp = adtList->GetScalarInterpolator("location", i))) { + interpolator= new KX_ScalarInterpolator(&(ipocontr->GetIPOTransform().GetPosition()[i]), interp); + ipocontr->AddInterpolator(interpolator); + ipocontr->SetIPOChannelActive(OB_LOC_X+i, true); + } } - ipo = ipoList->GetScalarInterpolator(OB_SIZE_Y); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetScaling()[1]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_SIZE_Y, true); + for(int i=0; i<3; i++) { + if ((interp = adtList->GetScalarInterpolator("delta_location", i))) { + interpolator= new KX_ScalarInterpolator(&(ipocontr->GetIPOTransform().GetDeltaPosition()[i]), interp); + ipocontr->AddInterpolator(interpolator); + ipocontr->SetIPOChannelActive(OB_DLOC_X+i, true); + } } - ipo = ipoList->GetScalarInterpolator(OB_SIZE_Z); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetScaling()[2]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_SIZE_Z, true); + for(int i=0; i<3; i++) { + if ((interp = adtList->GetScalarInterpolator("rotation", i))) { + interpolator= new KX_ScalarInterpolator(&(ipocontr->GetIPOTransform().GetEulerAngles()[i]), interp); + ipocontr->AddInterpolator(interpolator); + ipocontr->SetIPOChannelActive(OB_ROT_X+i, true); + } } - - // The last few... - - ipo = ipoList->GetScalarInterpolator(OB_DSIZE_X); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetDeltaScaling()[0]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_DSIZE_X, true); + for(int i=0; i<3; i++) { + if ((interp = adtList->GetScalarInterpolator("delta_rotation", i))) { + interpolator= new KX_ScalarInterpolator(&(ipocontr->GetIPOTransform().GetDeltaEulerAngles()[i]), interp); + ipocontr->AddInterpolator(interpolator); + ipocontr->SetIPOChannelActive(OB_DROT_X+i, true); + } } - ipo = ipoList->GetScalarInterpolator(OB_DSIZE_Y); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetDeltaScaling()[1]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_DSIZE_Y, true); + for(int i=0; i<3; i++) { + if ((interp = adtList->GetScalarInterpolator("scale", i))) { + interpolator= new KX_ScalarInterpolator(&(ipocontr->GetIPOTransform().GetScaling()[i]), interp); + ipocontr->AddInterpolator(interpolator); + ipocontr->SetIPOChannelActive(OB_SIZE_X+i, true); + } } - ipo = ipoList->GetScalarInterpolator(OB_DSIZE_Z); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &(ipocontr->GetIPOTransform().GetDeltaScaling()[2]), - ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetIPOChannelActive(OB_DSIZE_Z, true); + for(int i=0; i<3; i++) { + if ((interp = adtList->GetScalarInterpolator("delta_scale", i))) { + interpolator= new KX_ScalarInterpolator(&(ipocontr->GetIPOTransform().GetDeltaScaling()[i]), interp); + ipocontr->AddInterpolator(interpolator); + ipocontr->SetIPOChannelActive(OB_DSIZE_X+i, true); + } } { KX_ObColorIpoSGController* ipocontr_obcol=NULL; - - ipo = ipoList->GetScalarInterpolator(OB_COL_R); - if (ipo) - { - if (!ipocontr_obcol) - { - ipocontr_obcol = new KX_ObColorIpoSGController(); - gameobj->GetSGNode()->AddSGController(ipocontr_obcol); - ipocontr_obcol->SetObject(gameobj->GetSGNode()); - } - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &ipocontr_obcol->m_rgba[0], - ipo); - ipocontr_obcol->AddInterpolator(interpolator); - } - ipo = ipoList->GetScalarInterpolator(OB_COL_G); - if (ipo) - { - if (!ipocontr_obcol) - { - ipocontr_obcol = new KX_ObColorIpoSGController(); - gameobj->GetSGNode()->AddSGController(ipocontr_obcol); - ipocontr_obcol->SetObject(gameobj->GetSGNode()); - } - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &ipocontr_obcol->m_rgba[1], - ipo); - ipocontr_obcol->AddInterpolator(interpolator); - } - ipo = ipoList->GetScalarInterpolator(OB_COL_B); - if (ipo) - { - if (!ipocontr_obcol) - { - ipocontr_obcol = new KX_ObColorIpoSGController(); - gameobj->GetSGNode()->AddSGController(ipocontr_obcol); - ipocontr_obcol->SetObject(gameobj->GetSGNode()); - } - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &ipocontr_obcol->m_rgba[2], - ipo); - ipocontr_obcol->AddInterpolator(interpolator); - } - ipo = ipoList->GetScalarInterpolator(OB_COL_A); - if (ipo) - { - if (!ipocontr_obcol) - { - ipocontr_obcol = new KX_ObColorIpoSGController(); - gameobj->GetSGNode()->AddSGController(ipocontr_obcol); - ipocontr_obcol->SetObject(gameobj->GetSGNode()); + + for(int i=0; i<4; i++) { + if (interp = adtList->GetScalarInterpolator("color", i)) { + if (!ipocontr_obcol) { + ipocontr_obcol = new KX_ObColorIpoSGController(); + gameobj->GetSGNode()->AddSGController(ipocontr_obcol); + ipocontr_obcol->SetObject(gameobj->GetSGNode()); + } + interpolator= new KX_ScalarInterpolator(&ipocontr_obcol->m_rgba[i], interp); + ipocontr_obcol->AddInterpolator(interpolator); } - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &ipocontr_obcol->m_rgba[3], - ipo); - ipocontr_obcol->AddInterpolator(interpolator); } } - - } - - } void BL_ConvertLampIpos(struct Lamp* blenderlamp, KX_GameObject *lightobj,KX_BlenderSceneConverter *converter) { - if (blenderlamp->ipo) { + if (blenderlamp->adt) { KX_LightIpoSGController* ipocontr = new KX_LightIpoSGController(); lightobj->GetSGNode()->AddSGController(ipocontr); @@ -396,51 +204,32 @@ void BL_ConvertLampIpos(struct Lamp* blenderlamp, KX_GameObject *lightobj,KX_Ble ipocontr->m_col_rgb[2] = blenderlamp->b; ipocontr->m_dist = blenderlamp->dist; - BL_InterpolatorList *ipoList= GetIpoList(blenderlamp->ipo, converter); + BL_InterpolatorList *adtList= GetAdtList(blenderlamp->adt, converter); - // For each active channel in the ipoList add an + // For each active channel in the adtList add an // interpolator to the game object. - KX_IScalarInterpolator *ipo; + KX_IInterpolator *interpolator; + KX_IScalarInterpolator *interp; - ipo = ipoList->GetScalarInterpolator(LA_ENERGY); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator(&ipocontr->m_energy, ipo); + if ((interp= adtList->GetScalarInterpolator("energy", 0))) { + interpolator= new KX_ScalarInterpolator(&ipocontr->m_energy, interp); ipocontr->AddInterpolator(interpolator); ipocontr->SetModifyEnergy(true); } - ipo = ipoList->GetScalarInterpolator(LA_DIST); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator(&ipocontr->m_dist, ipo); + if ((interp = adtList->GetScalarInterpolator("distance", 0))) { + interpolator= new KX_ScalarInterpolator(&ipocontr->m_dist, interp); ipocontr->AddInterpolator(interpolator); ipocontr->SetModifyDist(true); } - - ipo = ipoList->GetScalarInterpolator(LA_COL_R); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator(&ipocontr->m_col_rgb[0], ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetModifyColor(true); - } - - ipo = ipoList->GetScalarInterpolator(LA_COL_G); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator(&ipocontr->m_col_rgb[1], ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetModifyColor(true); - } - - ipo = ipoList->GetScalarInterpolator(LA_COL_B); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator(&ipocontr->m_col_rgb[2], ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetModifyColor(true); + + for(int i=0; i<3; i++) { + if ((interp = adtList->GetScalarInterpolator("color", i))) { + interpolator= new KX_ScalarInterpolator(&ipocontr->m_col_rgb[i], interp); + ipocontr->AddInterpolator(interpolator); + ipocontr->SetModifyColor(true); + } } } } @@ -451,7 +240,7 @@ void BL_ConvertLampIpos(struct Lamp* blenderlamp, KX_GameObject *lightobj,KX_Ble void BL_ConvertCameraIpos(struct Camera* blendercamera, KX_GameObject *cameraobj,KX_BlenderSceneConverter *converter) { - if (blendercamera->ipo) { + if (blendercamera->adt) { KX_CameraIpoSGController* ipocontr = new KX_CameraIpoSGController(); cameraobj->GetSGNode()->AddSGController(ipocontr); @@ -461,33 +250,28 @@ void BL_ConvertCameraIpos(struct Camera* blendercamera, KX_GameObject *cameraobj ipocontr->m_clipstart = blendercamera->clipsta; ipocontr->m_clipend = blendercamera->clipend; - BL_InterpolatorList *ipoList= GetIpoList(blendercamera->ipo, converter); + BL_InterpolatorList *adtList= GetAdtList(blendercamera->adt, converter); - // For each active channel in the ipoList add an + // For each active channel in the adtList add an // interpolator to the game object. - KX_IScalarInterpolator *ipo; + KX_IInterpolator *interpolator; + KX_IScalarInterpolator *interp; - ipo = ipoList->GetScalarInterpolator(CAM_LENS); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator(&ipocontr->m_lens, ipo); + if ((interp = adtList->GetScalarInterpolator("lens", 0))) { + interpolator= new KX_ScalarInterpolator(&ipocontr->m_lens, interp); ipocontr->AddInterpolator(interpolator); ipocontr->SetModifyLens(true); } - ipo = ipoList->GetScalarInterpolator(CAM_STA); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator(&ipocontr->m_clipstart, ipo); + if ((interp = adtList->GetScalarInterpolator("clip_start", 0))) { + interpolator= new KX_ScalarInterpolator(&ipocontr->m_clipstart, interp); ipocontr->AddInterpolator(interpolator); ipocontr->SetModifyClipStart(true); } - ipo = ipoList->GetScalarInterpolator(CAM_END); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator(&ipocontr->m_clipend, ipo); + if ((interp = adtList->GetScalarInterpolator("clip_end", 0))) { + interpolator= new KX_ScalarInterpolator(&ipocontr->m_clipend, interp); ipocontr->AddInterpolator(interpolator); ipocontr->SetModifyClipEnd(true); } @@ -499,7 +283,7 @@ void BL_ConvertCameraIpos(struct Camera* blendercamera, KX_GameObject *cameraobj void BL_ConvertWorldIpos(struct World* blenderworld,KX_BlenderSceneConverter *converter) { - if (blenderworld->ipo) { + if (blenderworld->adt) { KX_WorldIpoController* ipocontr = new KX_WorldIpoController(); @@ -514,49 +298,29 @@ void BL_ConvertWorldIpos(struct World* blenderworld,KX_BlenderSceneConverter *co ipocontr->m_mist_rgb[1] = blenderworld->horg; ipocontr->m_mist_rgb[2] = blenderworld->horb; - BL_InterpolatorList *ipoList= GetIpoList(blenderworld->ipo, converter); + BL_InterpolatorList *adtList= GetAdtList(blenderworld->adt, converter); - // For each active channel in the ipoList add an + // For each active channel in the adtList add an // interpolator to the game object. - KX_IScalarInterpolator *ipo; + KX_IScalarInterpolator *interp; - ipo = ipoList->GetScalarInterpolator(WO_HOR_R); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator(&ipocontr->m_mist_rgb[0], ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetModifyMistColor(true); - } - - ipo = ipoList->GetScalarInterpolator(WO_HOR_G); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator(&ipocontr->m_mist_rgb[1], ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetModifyMistColor(true); - } - - ipo = ipoList->GetScalarInterpolator(WO_HOR_B); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator(&ipocontr->m_mist_rgb[2], ipo); - ipocontr->AddInterpolator(interpolator); - ipocontr->SetModifyMistColor(true); + for(int i=0; i<3; i++) { + if ((interp = adtList->GetScalarInterpolator("horizon_color", i))) { + interpolator= new KX_ScalarInterpolator(&ipocontr->m_mist_rgb[i], interp); + ipocontr->AddInterpolator(interpolator); + ipocontr->SetModifyMistColor(true); + } } - ipo = ipoList->GetScalarInterpolator(WO_MISTDI); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator(&ipocontr->m_mist_dist, ipo); + if ((interp = adtList->GetScalarInterpolator("mist.depth", 0))) { + interpolator= new KX_ScalarInterpolator(&ipocontr->m_mist_dist, interp); ipocontr->AddInterpolator(interpolator); ipocontr->SetModifyMistDist(true); } - ipo = ipoList->GetScalarInterpolator(WO_MISTSTA); - if (ipo) { - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator(&ipocontr->m_mist_start, ipo); + if ((interp = adtList->GetScalarInterpolator("mist.start", 0))) { + interpolator= new KX_ScalarInterpolator(&ipocontr->m_mist_start, interp); ipocontr->AddInterpolator(interpolator); ipocontr->SetModifyMistStart(true); } @@ -570,12 +334,12 @@ static void ConvertMaterialIpos( KX_BlenderSceneConverter *converter ) { - if (blendermaterial->ipo) { + if (blendermaterial->adt) { KX_MaterialIpoController* ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); - BL_InterpolatorList *ipoList= GetIpoList(blendermaterial->ipo, converter); + BL_InterpolatorList *adtList= GetAdtList(blendermaterial->adt, converter); ipocontr->m_rgba[0] = blendermaterial->r; @@ -592,163 +356,82 @@ static void ConvertMaterialIpos( ipocontr->m_ref = blendermaterial->ref; ipocontr->m_emit = blendermaterial->emit; ipocontr->m_alpha = blendermaterial->alpha; - KX_IScalarInterpolator *ipo; - // -- - ipo = ipoList->GetScalarInterpolator(MA_COL_R); - if (ipo) { - if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(matname_hash); - gameobj->GetSGNode()->AddSGController(ipocontr); - ipocontr->SetObject(gameobj->GetSGNode()); - } - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &ipocontr->m_rgba[0], - ipo); - ipocontr->AddInterpolator(interpolator); - } - - ipo = ipoList->GetScalarInterpolator(MA_COL_G); - if (ipo) { - if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(matname_hash); - gameobj->GetSGNode()->AddSGController(ipocontr); - ipocontr->SetObject(gameobj->GetSGNode()); - } - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &ipocontr->m_rgba[1], - ipo); - ipocontr->AddInterpolator(interpolator); - } + KX_IInterpolator *interpolator; + KX_IScalarInterpolator *sinterp; - ipo = ipoList->GetScalarInterpolator(MA_COL_B); - if (ipo) { - if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(matname_hash); - gameobj->GetSGNode()->AddSGController(ipocontr); - ipocontr->SetObject(gameobj->GetSGNode()); + // -- + for(int i=0; i<3; i++) { + if ((sinterp = adtList->GetScalarInterpolator("diffuse_color", i))) { + if (!ipocontr) { + ipocontr = new KX_MaterialIpoController(matname_hash); + gameobj->GetSGNode()->AddSGController(ipocontr); + ipocontr->SetObject(gameobj->GetSGNode()); + } + interpolator= new KX_ScalarInterpolator(&ipocontr->m_rgba[i], sinterp); + ipocontr->AddInterpolator(interpolator); } - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &ipocontr->m_rgba[2], - ipo); - ipocontr->AddInterpolator(interpolator); } - ipo = ipoList->GetScalarInterpolator(MA_ALPHA); - if (ipo) { + if ((sinterp = adtList->GetScalarInterpolator("alpha", 0))) { if (!ipocontr) { ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &ipocontr->m_rgba[3], - ipo); + interpolator= new KX_ScalarInterpolator(&ipocontr->m_rgba[3], sinterp); ipocontr->AddInterpolator(interpolator); } - // -- - ipo = ipoList->GetScalarInterpolator(MA_SPEC_R ); - if (ipo) { - if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(matname_hash); - gameobj->GetSGNode()->AddSGController(ipocontr); - ipocontr->SetObject(gameobj->GetSGNode()); - } - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &ipocontr->m_specrgb[0], - ipo); - ipocontr->AddInterpolator(interpolator); - } - - ipo = ipoList->GetScalarInterpolator(MA_SPEC_G); - if (ipo) { - if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(matname_hash); - gameobj->GetSGNode()->AddSGController(ipocontr); - ipocontr->SetObject(gameobj->GetSGNode()); + for(int i=0; i<3; i++) { + if ((sinterp = adtList->GetScalarInterpolator("specular_color", i))) { + if (!ipocontr) { + ipocontr = new KX_MaterialIpoController(matname_hash); + gameobj->GetSGNode()->AddSGController(ipocontr); + ipocontr->SetObject(gameobj->GetSGNode()); + } + interpolator= new KX_ScalarInterpolator(&ipocontr->m_specrgb[i], sinterp); + ipocontr->AddInterpolator(interpolator); } - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &ipocontr->m_specrgb[1], - ipo); - ipocontr->AddInterpolator(interpolator); } - ipo = ipoList->GetScalarInterpolator(MA_SPEC_B); - if (ipo) { - if (!ipocontr) { - ipocontr = new KX_MaterialIpoController(matname_hash); - gameobj->GetSGNode()->AddSGController(ipocontr); - ipocontr->SetObject(gameobj->GetSGNode()); - } - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &ipocontr->m_specrgb[2], - ipo); - ipocontr->AddInterpolator(interpolator); - } - - // -- - ipo = ipoList->GetScalarInterpolator(MA_HARD); - if (ipo) { + if ((sinterp = adtList->GetScalarInterpolator("specular_hardness", 0))) { if (!ipocontr) { ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &ipocontr->m_hard, - ipo); + interpolator= new KX_ScalarInterpolator(&ipocontr->m_hard, sinterp); ipocontr->AddInterpolator(interpolator); } - ipo = ipoList->GetScalarInterpolator(MA_SPEC); - if (ipo) { + if ((sinterp = adtList->GetScalarInterpolator("specularity", 0))) { if (!ipocontr) { ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &ipocontr->m_spec, - ipo); + interpolator= new KX_ScalarInterpolator(&ipocontr->m_spec, sinterp); ipocontr->AddInterpolator(interpolator); } - - ipo = ipoList->GetScalarInterpolator(MA_REF); - if (ipo) { + if ((sinterp = adtList->GetScalarInterpolator("diffuse_reflection", 0))) { if (!ipocontr) { ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &ipocontr->m_ref, - ipo); + interpolator= new KX_ScalarInterpolator(&ipocontr->m_ref, sinterp); ipocontr->AddInterpolator(interpolator); } - ipo = ipoList->GetScalarInterpolator(MA_EMIT); - if (ipo) { + if ((sinterp = adtList->GetScalarInterpolator("emit", 0))) { if (!ipocontr) { ipocontr = new KX_MaterialIpoController(matname_hash); gameobj->GetSGNode()->AddSGController(ipocontr); ipocontr->SetObject(gameobj->GetSGNode()); } - KX_IInterpolator *interpolator = - new KX_ScalarInterpolator( - &ipocontr->m_emit, - ipo); + interpolator= new KX_ScalarInterpolator(&ipocontr->m_emit, sinterp); ipocontr->AddInterpolator(interpolator); } } -- cgit v1.2.3 From e0c960814be3729cd394596b72cf019180444b1e Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 15 Jun 2009 11:36:22 +0000 Subject: 2.5 - Changed the order in which constraints are defined in RNA to resemble the order users of 2.4x are more familiar with. Compared to the order in which they're actually defined, this order is more 'standard' in many cases. --- source/blender/makesrna/intern/rna_constraint.c | 39 +++++++++++++++---------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index a98bc41d129..fd1a97ac3c6 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -36,27 +36,36 @@ #include "WM_types.h" EnumPropertyItem constraint_type_items[] ={ - {CONSTRAINT_TYPE_NULL, "NULL", "Null", ""}, {CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", "Child Of", ""}, - {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", "Track To", ""}, - {CONSTRAINT_TYPE_KINEMATIC, "IK", "IK", ""}, - {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", "Follow Path", ""}, - {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", "Limit Rotation", ""}, - {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", "Limit Location", ""}, - {CONSTRAINT_TYPE_SIZELIMIT, "LIMIT_SCALE", "Limit Scale", ""}, - {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", "Copy Rotation", ""}, + {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", "Transformation", ""}, + {CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", "Copy Location", ""}, + {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", "Copy Rotation", ""}, {CONSTRAINT_TYPE_SIZELIKE, "COPY_SCALE", "Copy Scale", ""}, - {CONSTRAINT_TYPE_PYTHON, "SCRIPT", "Script", ""}, - {CONSTRAINT_TYPE_ACTION, "ACTION", "Action", ""}, - {CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", "Locked Track", ""}, + + {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", "Limit Location", ""}, + {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", "Limit Rotation", ""}, + {CONSTRAINT_TYPE_SIZELIMIT, "LIMIT_SCALE", "Limit Scale", ""}, {CONSTRAINT_TYPE_DISTLIMIT, "LIMIT_DISTANCE", "Limit Distance", ""}, - {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO", "Stretch To", ""}, + + {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", "Track To", ""}, + {CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", "Locked Track", ""}, + {CONSTRAINT_TYPE_MINMAX, "FLOOR", "Floor", ""}, - {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", "Rigid Body Joint", ""}, - {CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", "Clamp To", ""}, - {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", "Transformation", ""}, {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", "Shrinkwrap", ""}, + {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", "Follow Path", ""}, + + {CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", "Clamp To", ""}, + {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO", "Stretch To", ""}, + + {CONSTRAINT_TYPE_KINEMATIC, "IK", "IK", ""}, + {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", "Rigid Body Joint", ""}, + + {CONSTRAINT_TYPE_ACTION, "ACTION", "Action", ""}, + + {CONSTRAINT_TYPE_PYTHON, "SCRIPT", "Script", ""}, + + {CONSTRAINT_TYPE_NULL, "NULL", "Null", ""}, {0, NULL, NULL, NULL}}; -- cgit v1.2.3 From 7453f4388ec381b9e6fd4a1e0b459c20edc40527 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 15 Jun 2009 11:47:16 +0000 Subject: missing var in last commit --- source/gameengine/Converter/KX_IpoConvert.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/gameengine/Converter/KX_IpoConvert.cpp b/source/gameengine/Converter/KX_IpoConvert.cpp index 35a1ccc1dbb..d3a2e1a9ba4 100644 --- a/source/gameengine/Converter/KX_IpoConvert.cpp +++ b/source/gameengine/Converter/KX_IpoConvert.cpp @@ -303,6 +303,7 @@ void BL_ConvertWorldIpos(struct World* blenderworld,KX_BlenderSceneConverter *co // For each active channel in the adtList add an // interpolator to the game object. + KX_IInterpolator *interpolator; KX_IScalarInterpolator *interp; for(int i=0; i<3; i++) { -- cgit v1.2.3 From b8d0f62fd2a9088034fa7da1d7e5e82ca845b728 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 15 Jun 2009 11:48:42 +0000 Subject: Fix for bug #18924: OpenGL performance issue with particle modifiers, actually two modifier datamask optimizations that were never done. * Don't use modifier data mask for disabled modifiers. * Check if UV data is needed for particle system instead of always requesting it. --- source/blender/blenkernel/BKE_modifier.h | 9 ++- source/blender/blenkernel/intern/DerivedMesh.c | 26 +++---- source/blender/blenkernel/intern/modifier.c | 80 +++++++++++++++------- source/blender/blenkernel/intern/particle.c | 4 +- source/blender/blenkernel/intern/particle_system.c | 5 +- 5 files changed, 78 insertions(+), 46 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index a41716ed1ff..e6d83793f94 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -202,7 +202,7 @@ typedef struct ModifierTypeInfo { * * This function is optional. */ - CustomDataMask (*requiredDataMask)(struct ModifierData *md); + CustomDataMask (*requiredDataMask)(struct Object *ob, struct ModifierData *md); /* Free internal modifier data variables, this function should * not free the md variable itself. @@ -270,6 +270,7 @@ int modifier_dependsOnTime(struct ModifierData *md); int modifier_supportsMapping(struct ModifierData *md); int modifier_couldBeCage(struct ModifierData *md); int modifier_isDeformer(struct ModifierData *md); +int modifier_isEnabled(struct ModifierData *md, int required_mode); void modifier_setError(struct ModifierData *md, char *format, ...); void modifiers_foreachObjectLink(struct Object *ob, @@ -300,8 +301,10 @@ int modifiers_indexInObject(struct Object *ob, struct ModifierData *md * evaluation, assuming the data indicated by dataMask is required at the * end of the stack. */ -struct LinkNode *modifiers_calcDataMasks(struct ModifierData *md, - CustomDataMask dataMask); +struct LinkNode *modifiers_calcDataMasks(struct Object *ob, + struct ModifierData *md, + CustomDataMask dataMask, + int required_mode); struct ModifierData *modifiers_getVirtualModifierList(struct Object *ob); #endif diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index ddb7d853f2f..1d0d91c4208 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2134,18 +2134,18 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3], modifiers_clearErrors(ob); + if(useRenderParams) required_mode = eModifierMode_Render; + else required_mode = eModifierMode_Realtime; + /* we always want to keep original indices */ dataMask |= CD_MASK_ORIGINDEX; - datamasks = modifiers_calcDataMasks(md, dataMask); + datamasks = modifiers_calcDataMasks(ob, md, dataMask, required_mode); curr = datamasks; if(deform_r) *deform_r = NULL; *final_r = NULL; - if(useRenderParams) required_mode = eModifierMode_Render; - else required_mode = eModifierMode_Realtime; - if(useDeform) { if(useDeform > 0 && do_ob_key(ob)) /* shape key makes deform verts */ deformedVerts = mesh_getVertexCos(me, &numVerts); @@ -2156,8 +2156,7 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3], for(;md; md = md->next, curr = curr->next) { ModifierTypeInfo *mti = modifierType_getInfo(md->type); - if((md->mode & required_mode) != required_mode) continue; - if(mti->isDisabled && mti->isDisabled(md)) continue; + if(!modifier_isEnabled(md, required_mode)) continue; if(useDeform < 0 && mti->dependsOnTime && mti->dependsOnTime(md)) continue; if(mti->type == eModifierTypeType_OnlyDeform) { @@ -2221,19 +2220,18 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3], for(;md; md = md->next, curr = curr->next) { ModifierTypeInfo *mti = modifierType_getInfo(md->type); - if((md->mode & required_mode) != required_mode) continue; + if(!modifier_isEnabled(md, required_mode)) continue; if(mti->type == eModifierTypeType_OnlyDeform && !useDeform) continue; if((mti->flags & eModifierTypeFlag_RequiresOriginalData) && dm) { modifier_setError(md, "Modifier requires original data, bad stack position."); continue; } - if(mti->isDisabled && mti->isDisabled(md)) continue; if(needMapping && !modifier_supportsMapping(md)) continue; if(useDeform < 0 && mti->dependsOnTime && mti->dependsOnTime(md)) continue; /* add an orco layer if needed by this modifier */ if(dm && mti->requiredDataMask) { - mask = mti->requiredDataMask(md); + mask = mti->requiredDataMask(ob, md); if(mask & CD_MASK_ORCO) add_orco_dm(ob, NULL, dm, orcodm); } @@ -2405,14 +2403,11 @@ static int editmesh_modifier_is_enabled(ModifierData *md, DerivedMesh *dm) ModifierTypeInfo *mti = modifierType_getInfo(md->type); int required_mode = eModifierMode_Realtime | eModifierMode_Editmode; - if((md->mode & required_mode) != required_mode) return 0; + if(!modifier_isEnabled(md, required_mode)) return 0; if((mti->flags & eModifierTypeFlag_RequiresOriginalData) && dm) { modifier_setError(md, "Modifier requires original data, bad stack position."); return 0; } - if(mti->isDisabled && mti->isDisabled(md)) return 0; - if(!(mti->flags & eModifierTypeFlag_SupportsEditmode)) return 0; - if(md->mode & eModifierMode_DisableTemporary) return 0; return 1; } @@ -2429,6 +2424,7 @@ static void editmesh_calc_modifiers(DerivedMesh **cage_r, DerivedMesh *dm, *orcodm = NULL; int i, numVerts = 0, cageIndex = modifiers_getCageIndex(ob, NULL); LinkNode *datamasks, *curr; + int required_mode = eModifierMode_Realtime | eModifierMode_Editmode; modifiers_clearErrors(ob); @@ -2442,7 +2438,7 @@ static void editmesh_calc_modifiers(DerivedMesh **cage_r, /* we always want to keep original indices */ dataMask |= CD_MASK_ORIGINDEX; - datamasks = modifiers_calcDataMasks(md, dataMask); + datamasks = modifiers_calcDataMasks(ob, md, dataMask, required_mode); curr = datamasks; for(i = 0; md; i++, md = md->next, curr = curr->next) { @@ -2453,7 +2449,7 @@ static void editmesh_calc_modifiers(DerivedMesh **cage_r, /* add an orco layer if needed by this modifier */ if(dm && mti->requiredDataMask) { - mask = mti->requiredDataMask(md); + mask = mti->requiredDataMask(ob, md); if(mask & CD_MASK_ORCO) add_orco_dm(ob, em, dm, orcodm); } diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 29930b3eb58..fa2f857cc8b 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -206,7 +206,7 @@ static void curveModifier_copyData(ModifierData *md, ModifierData *target) strncpy(tcmd->name, cmd->name, 32); } -CustomDataMask curveModifier_requiredDataMask(ModifierData *md) +CustomDataMask curveModifier_requiredDataMask(Object *ob, ModifierData *md) { CurveModifierData *cmd = (CurveModifierData *)md; CustomDataMask dataMask = 0; @@ -282,7 +282,7 @@ static void latticeModifier_copyData(ModifierData *md, ModifierData *target) strncpy(tlmd->name, lmd->name, 32); } -CustomDataMask latticeModifier_requiredDataMask(ModifierData *md) +CustomDataMask latticeModifier_requiredDataMask(Object *ob, ModifierData *md) { LatticeModifierData *lmd = (LatticeModifierData *)md; CustomDataMask dataMask = 0; @@ -665,7 +665,7 @@ static void maskModifier_copyData(ModifierData *md, ModifierData *target) strcpy(tmmd->vgroup, mmd->vgroup); } -static CustomDataMask maskModifier_requiredDataMask(ModifierData *md) +static CustomDataMask maskModifier_requiredDataMask(Object *ob, ModifierData *md) { return (1 << CD_MDEFORMVERT); } @@ -3393,7 +3393,7 @@ static void bevelModifier_copyData(ModifierData *md, ModifierData *target) strncpy(tbmd->defgrp_name, bmd->defgrp_name, 32); } -CustomDataMask bevelModifier_requiredDataMask(ModifierData *md) +CustomDataMask bevelModifier_requiredDataMask(Object *ob, ModifierData *md) { BevelModifierData *bmd = (BevelModifierData *)md; CustomDataMask dataMask = 0; @@ -3473,7 +3473,7 @@ static void displaceModifier_copyData(ModifierData *md, ModifierData *target) strncpy(tdmd->uvlayer_name, dmd->uvlayer_name, 32); } -CustomDataMask displaceModifier_requiredDataMask(ModifierData *md) +CustomDataMask displaceModifier_requiredDataMask(Object *ob, ModifierData *md) { DisplaceModifierData *dmd = (DisplaceModifierData *)md; CustomDataMask dataMask = 0; @@ -3816,7 +3816,7 @@ static void uvprojectModifier_copyData(ModifierData *md, ModifierData *target) tumd->aspecty = umd->aspecty; } -CustomDataMask uvprojectModifier_requiredDataMask(ModifierData *md) +CustomDataMask uvprojectModifier_requiredDataMask(Object *ob, ModifierData *md) { CustomDataMask dataMask = 0; @@ -4276,7 +4276,7 @@ int smoothModifier_isDisabled(ModifierData *md) return 0; } -CustomDataMask smoothModifier_requiredDataMask(ModifierData *md) +CustomDataMask smoothModifier_requiredDataMask(Object *ob, ModifierData *md) { SmoothModifierData *smd = (SmoothModifierData *)md; CustomDataMask dataMask = 0; @@ -4505,7 +4505,7 @@ int castModifier_isDisabled(ModifierData *md) return 0; } -CustomDataMask castModifier_requiredDataMask(ModifierData *md) +CustomDataMask castModifier_requiredDataMask(Object *ob, ModifierData *md) { CastModifierData *cmd = (CastModifierData *)md; CustomDataMask dataMask = 0; @@ -5136,7 +5136,7 @@ static void waveModifier_updateDepgraph( } } -CustomDataMask waveModifier_requiredDataMask(ModifierData *md) +CustomDataMask waveModifier_requiredDataMask(Object *ob, ModifierData *md) { WaveModifierData *wmd = (WaveModifierData *)md; CustomDataMask dataMask = 0; @@ -5473,7 +5473,7 @@ static void armatureModifier_copyData(ModifierData *md, ModifierData *target) strncpy(tamd->defgrp_name, amd->defgrp_name, 32); } -CustomDataMask armatureModifier_requiredDataMask(ModifierData *md) +CustomDataMask armatureModifier_requiredDataMask(Object *ob, ModifierData *md) { CustomDataMask dataMask = 0; @@ -5587,7 +5587,7 @@ static void hookModifier_copyData(ModifierData *md, ModifierData *target) strncpy(thmd->name, hmd->name, 32); } -CustomDataMask hookModifier_requiredDataMask(ModifierData *md) +CustomDataMask hookModifier_requiredDataMask(Object *ob, ModifierData *md) { HookModifierData *hmd = (HookModifierData *)md; CustomDataMask dataMask = 0; @@ -5846,7 +5846,7 @@ static void clothModifier_updateDepgraph( } } -CustomDataMask clothModifier_requiredDataMask(ModifierData *md) +CustomDataMask clothModifier_requiredDataMask(Object *ob, ModifierData *md) { CustomDataMask dataMask = 0; @@ -6230,7 +6230,7 @@ static DerivedMesh *booleanModifier_applyModifier( return derivedData; } -CustomDataMask booleanModifier_requiredDataMask(ModifierData *md) +CustomDataMask booleanModifier_requiredDataMask(Object *ob, ModifierData *md) { CustomDataMask dataMask = (1 << CD_MTFACE) + (1 << CD_MEDGE); @@ -6278,12 +6278,27 @@ static void particleSystemModifier_copyData(ModifierData *md, ModifierData *targ tpsmd->psys = psmd->psys; } -CustomDataMask particleSystemModifier_requiredDataMask(ModifierData *md) +CustomDataMask particleSystemModifier_requiredDataMask(Object *ob, ModifierData *md) { ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md; - CustomDataMask dataMask = (1 << CD_MTFACE) + (1 << CD_MEDGE); + CustomDataMask dataMask = 0; + Material *ma; + MTex *mtex; int i; + ma= give_current_material(ob, psmd->psys->part->omat); + if(ma) { + for(i=0; imtex[i]; + if(mtex && (ma->septex & (1<pmapto && (mtex->texco & TEXCO_UV)) + dataMask |= (1 << CD_MTFACE); + } + } + + if(psmd->psys->part->tanfac!=0.0) + dataMask |= (1 << CD_MTFACE); + /* ask for vertexgroups if we need them */ for(i=0; ipsys->vgroup[i]){ @@ -6638,7 +6653,7 @@ static int explodeModifier_dependsOnTime(ModifierData *md) { return 1; } -CustomDataMask explodeModifier_requiredDataMask(ModifierData *md) +CustomDataMask explodeModifier_requiredDataMask(Object *ob, ModifierData *md) { ExplodeModifierData *emd= (ExplodeModifierData*) md; CustomDataMask dataMask = 0; @@ -7552,7 +7567,7 @@ static void meshdeformModifier_copyData(ModifierData *md, ModifierData *target) tmmd->object = mmd->object; } -CustomDataMask meshdeformModifier_requiredDataMask(ModifierData *md) +CustomDataMask meshdeformModifier_requiredDataMask(Object *ob, ModifierData *md) { MeshDeformModifierData *mmd = (MeshDeformModifierData *)md; CustomDataMask dataMask = 0; @@ -7876,7 +7891,7 @@ static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target) tsmd->subsurfLevels = smd->subsurfLevels; } -CustomDataMask shrinkwrapModifier_requiredDataMask(ModifierData *md) +CustomDataMask shrinkwrapModifier_requiredDataMask(Object *ob, ModifierData *md) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *)md; CustomDataMask dataMask = 0; @@ -7910,7 +7925,7 @@ static void shrinkwrapModifier_foreachObjectLink(ModifierData *md, Object *ob, O static void shrinkwrapModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { DerivedMesh *dm = NULL; - CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(md); + CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(ob, md); /* We implement requiredDataMask but thats not really usefull since mesh_calc_modifiers pass a NULL derivedData or without the modified vertexs applied */ if(dataMask) @@ -7936,7 +7951,7 @@ static void shrinkwrapModifier_deformVerts(ModifierData *md, Object *ob, Derived static void shrinkwrapModifier_deformVertsEM(ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { DerivedMesh *dm = NULL; - CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(md); + CustomDataMask dataMask = shrinkwrapModifier_requiredDataMask(ob, md); if(dataMask) { @@ -7995,7 +8010,7 @@ static void simpledeformModifier_copyData(ModifierData *md, ModifierData *target memcpy(tsmd->limit, smd->limit, sizeof(tsmd->limit)); } -static CustomDataMask simpledeformModifier_requiredDataMask(ModifierData *md) +static CustomDataMask simpledeformModifier_requiredDataMask(Object *ob, ModifierData *md) { SimpleDeformModifierData *smd = (SimpleDeformModifierData *)md; CustomDataMask dataMask = 0; @@ -8024,7 +8039,7 @@ static void simpledeformModifier_updateDepgraph(ModifierData *md, DagForest *for static void simpledeformModifier_deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { DerivedMesh *dm = NULL; - CustomDataMask dataMask = simpledeformModifier_requiredDataMask(md); + CustomDataMask dataMask = simpledeformModifier_requiredDataMask(ob, md); /* We implement requiredDataMask but thats not really usefull since mesh_calc_modifiers pass a NULL derivedData or without the modified vertexs applied */ if(dataMask) @@ -8051,7 +8066,7 @@ static void simpledeformModifier_deformVerts(ModifierData *md, Object *ob, Deriv static void simpledeformModifier_deformVertsEM(ModifierData *md, Object *ob, EditMesh *editData, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts) { DerivedMesh *dm = NULL; - CustomDataMask dataMask = simpledeformModifier_requiredDataMask(md); + CustomDataMask dataMask = simpledeformModifier_requiredDataMask(ob, md); /* We implement requiredDataMask but thats not really usefull since mesh_calc_modifiers pass a NULL derivedData or without the modified vertexs applied */ if(dataMask) @@ -8658,7 +8673,20 @@ int modifiers_isParticleEnabled(Object *ob) return (md && md->mode & (eModifierMode_Realtime | eModifierMode_Render)); } -LinkNode *modifiers_calcDataMasks(ModifierData *md, CustomDataMask dataMask) +int modifier_isEnabled(ModifierData *md, int required_mode) +{ + ModifierTypeInfo *mti = modifierType_getInfo(md->type); + + if((md->mode & required_mode) != required_mode) return 0; + if(mti->isDisabled && mti->isDisabled(md)) return 0; + if(md->mode & eModifierMode_DisableTemporary) return 0; + if(required_mode & eModifierMode_Editmode) + if(!(mti->flags & eModifierTypeFlag_SupportsEditmode)) return 0; + + return 1; +} + +LinkNode *modifiers_calcDataMasks(Object *ob, ModifierData *md, CustomDataMask dataMask, int required_mode) { LinkNode *dataMasks = NULL; LinkNode *curr, *prev; @@ -8668,7 +8696,9 @@ LinkNode *modifiers_calcDataMasks(ModifierData *md, CustomDataMask dataMask) ModifierTypeInfo *mti = modifierType_getInfo(md->type); CustomDataMask mask = 0; - if(mti->requiredDataMask) mask = mti->requiredDataMask(md); + if(modifier_isEnabled(md, required_mode)) + if(mti->requiredDataMask) + mask = mti->requiredDataMask(ob, md); BLI_linklist_prepend(&dataMasks, (void *)mask); } diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 41ce23347a3..b5b2c07af9c 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3182,7 +3182,7 @@ static void get_cpa_texture(DerivedMesh *dm, Material *ma, int face_index, float if(ma) for(m=0; mmtex[m]; - if(mtex && (ma->septex & (1<septex & (1<pmapto){ float def=mtex->def_var; float var=mtex->varfac; short blend=mtex->blendtype; @@ -3231,7 +3231,7 @@ void psys_get_texture(Object *ob, Material *ma, ParticleSystemModifierData *psmd if(ma) for(m=0; mmtex[m]; - if(mtex && (ma->septex & (1<septex & (1<pmapto){ float var=mtex->varfac; float def=mtex->def_var; short blend=mtex->blendtype; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 31e246f66b9..6ac57934670 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -1762,7 +1762,10 @@ void reset_particle(ParticleData *pa, ParticleSystem *psys, ParticleSystemModifi where_is_object_time(ob,pa->time); /* get birth location from object */ - psys_particle_on_emitter(psmd,part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,utan,vtan,0,0); + if(part->tanfac!=0.0) + psys_particle_on_emitter(psmd,part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,utan,vtan,0,0); + else + psys_particle_on_emitter(psmd,part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,0,0,0,0); /* save local coordinates for later */ VECCOPY(tloc,loc); -- cgit v1.2.3 From 17b2e0e6f6d7e73b0a38d0ea48ad378b6dbf1b8e Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 15 Jun 2009 12:13:10 +0000 Subject: 2.5 Bugfix: reading iconfile (~/.blender/icons/xxxx.png) didn't work. Note: go to the outliner, user preferences, first theme, User Inteface, and fill in name of the png file in "Icon File" text button. Save prefs, start Blender, and it shows. This whole process can be optimized once, indeed :) --- source/blender/editors/interface/interface_widgets.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 27f42da9fa0..ce416d2a3c5 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1118,8 +1118,6 @@ void ui_widget_color_init(ThemeUI *tui) tui->wcol_menu_back= wcol_menu_back; tui->wcol_menu_item= wcol_menu_item; tui->wcol_box= wcol_box; - - tui->iconfile[0]= 0; } /* ************ button callbacks, state ***************** */ -- cgit v1.2.3 From 1a7d3a085632142817d2aa42ab252ca54032f35a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 15 Jun 2009 12:18:17 +0000 Subject: Bug #18920, clarification in tooltip of Mirror Vgroup option in the mirror modifier. --- source/blender/src/buttons_editing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index b4eddfde865..2f9eac67d94 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -2004,7 +2004,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco uiDefButBitS(block, TOG, MOD_MIR_AXIS_Y, B_MODIFIER_RECALC, "Y", lx+20,cy,20,19, &mmd->flag, 0, 0, 0, 0, "Enable Y axis mirror"); uiDefButBitS(block, TOG, MOD_MIR_AXIS_Z, B_MODIFIER_RECALC, "Z", lx+40,cy,20,19, &mmd->flag, 0, 0, 0, 0, "Enable Z axis mirror"); uiDefButBitS(block, TOG, MOD_MIR_CLIPPING, B_MODIFIER_RECALC, "Do Clipping", lx+60, cy, buttonWidth-60,19, &mmd->flag, 1, 2, 0, 0, "Prevents during Transform vertices to go through Mirror"); - uiDefButBitS(block, TOG, MOD_MIR_VGROUP, B_MODIFIER_RECALC, "Mirror Vgroups", lx, (cy-=19), buttonWidth,19, &mmd->flag, 1, 2, 0, 0, "Mirror vertex groups (e.g. .R->.L)"); + uiDefButBitS(block, TOG, MOD_MIR_VGROUP, B_MODIFIER_RECALC, "Mirror Vgroups", lx, (cy-=19), buttonWidth,19, &mmd->flag, 1, 2, 0, 0, "Mirror vertex groups (e.g. .R to .L), empty mirror vertex groups must already exist."); uiDefButBitS(block, TOG, MOD_MIR_MIRROR_U, B_MODIFIER_RECALC, "Mirror U", lx, (cy-=19), buttonWidth/2, 19, -- cgit v1.2.3 From 6efd2e643953b293aaf7ef0de50d08badd2f49a8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 15 Jun 2009 20:22:50 +0000 Subject: saving globalDict didnt work with python3.x --- source/gameengine/Ketsji/KX_PythonInit.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 20009b7b846..b10ea7e1ab5 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1986,6 +1986,8 @@ PyObject* initGeometry() {Py_INCREF(Py_None);return Py_None;} PyObject* initBGL() {Py_INCREF(Py_None);return Py_None;} #endif + + void KX_SetActiveScene(class KX_Scene* scene) { gp_KetsjiScene = scene; @@ -2017,11 +2019,17 @@ int saveGamePythonConfig( char **marshal_buffer) if (pyGlobalDictMarshal) { // for testing only // PyObject_Print(pyGlobalDictMarshal, stderr, 0); - + char *marshal_cstring; + +#if PY_VERSION_HEX < 0x03000000 + marshal_cstring = PyString_AsString(pyGlobalDictMarshal); marshal_length= PyString_Size(pyGlobalDictMarshal); +#else // py3 uses byte arrays + marshal_cstring = PyBytes_AsString(pyGlobalDictMarshal); + marshal_length= PyBytes_Size(pyGlobalDictMarshal); +#endif *marshal_buffer = new char[marshal_length + 1]; - memcpy(*marshal_buffer, PyString_AsString(pyGlobalDictMarshal), marshal_length); - + memcpy(*marshal_buffer, marshal_cstring, marshal_length); Py_DECREF(pyGlobalDictMarshal); } else { printf("Error, GameLogic.globalDict could not be marshal'd\n"); -- cgit v1.2.3 From 32cf82dbb394fa454a2bc0b93d166d1091b3c25e Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Mon, 15 Jun 2009 20:28:49 +0000 Subject: 2.5 UI * RNA enum for icons to allow specifying icons as string * example: row.itemR(st, "line_numbers", text="", icon='ICON_LINENUMBERS_OFF') --- source/blender/editors/include/UI_icons.h | 882 +++++++++++++++++++++++ source/blender/editors/include/UI_resources.h | 856 +--------------------- source/blender/editors/interface/interface_api.c | 15 +- source/blender/editors/interface/resources.c | 2 +- 4 files changed, 901 insertions(+), 854 deletions(-) create mode 100644 source/blender/editors/include/UI_icons.h (limited to 'source') diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h new file mode 100644 index 00000000000..a38dfd93c30 --- /dev/null +++ b/source/blender/editors/include/UI_icons.h @@ -0,0 +1,882 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/* Note: this is included twice with different #defines for DEF_ICON + once from UI_resources.h for the internal icon enum and once fro interface_api.c for + definition of the RNA enum for he icons */ + +DEF_ICON(ICON_BLENDER) +DEF_ICON(ICON_QUESTION) +DEF_ICON(ICON_ERROR) +DEF_ICON(ICON_BLANK1) // XXX this is used lots, it's not actually 'blank' +DEF_ICON(ICON_TRIA_RIGHT) +DEF_ICON(ICON_TRIA_DOWN) +DEF_ICON(ICON_TRIA_LEFT) +DEF_ICON(ICON_TRIA_UP) +DEF_ICON(ICON_ARROW_LEFTRIGHT) +DEF_ICON(ICON_PLUS) +DEF_ICON(ICON_DISCLOSURE_TRI_DOWN) +DEF_ICON(ICON_DISCLOSURE_TRI_RIGHT) +DEF_ICON(ICON_RADIOBUT_OFF) +DEF_ICON(ICON_RADIOBUT_ON) +DEF_ICON(ICON_MENU_PANEL) +DEF_ICON(ICON_PYTHON) +DEF_ICON(ICON_BLANK003) +DEF_ICON(ICON_DOT) +DEF_ICON(ICON_BLANK004) +DEF_ICON(ICON_X) +DEF_ICON(ICON_BLANK005) +DEF_ICON(ICON_GO_LEFT) +DEF_ICON(ICON_BLANK006) +DEF_ICON(ICON_BLANK007) +DEF_ICON(ICON_BLANK008) +DEF_ICON(ICON_BLANK008b) + + /* ui */ +DEF_ICON(ICON_FULLSCREEN) +DEF_ICON(ICON_SPLITSCREEN) +DEF_ICON(ICON_RIGHTARROW_THIN) +DEF_ICON(ICON_BORDERMOVE) +DEF_ICON(ICON_VIEWZOOM) +DEF_ICON(ICON_ZOOMIN) +DEF_ICON(ICON_ZOOMOUT) +DEF_ICON(ICON_PANEL_CLOSE) +DEF_ICON(ICON_BLANK009) +DEF_ICON(ICON_EYEDROPPER) +DEF_ICON(ICON_BLANK010) +DEF_ICON(ICON_AUTO) +DEF_ICON(ICON_CHECKBOX_DEHLT) +DEF_ICON(ICON_CHECKBOX_HLT) +DEF_ICON(ICON_UNLOCKED) +DEF_ICON(ICON_LOCKED) +DEF_ICON(ICON_PINNED) +DEF_ICON(ICON_UNPINNED) +DEF_ICON(ICON_BLANK015) +DEF_ICON(ICON_RIGHTARROW) +DEF_ICON(ICON_DOWNARROW_HLT) +DEF_ICON(ICON_DOTSUP) +DEF_ICON(ICON_DOTSDOWN) +DEF_ICON(ICON_LINK) +DEF_ICON(ICON_INLINK) +DEF_ICON(ICON_BLANK012b) + + /* various ui */ +DEF_ICON(ICON_HELP) +DEF_ICON(ICON_GHOSTDRAW) +DEF_ICON(ICON_COLOR) +DEF_ICON(ICON_LINKED) +DEF_ICON(ICON_UNLINKED) +DEF_ICON(ICON_HAND) +DEF_ICON(ICON_ZOOM_ALL) +DEF_ICON(ICON_ZOOM_SELECTED) +DEF_ICON(ICON_ZOOM_PREVIOUS) +DEF_ICON(ICON_ZOOM_IN) +DEF_ICON(ICON_ZOOM_OUT) +DEF_ICON(ICON_RENDER_REGION) +DEF_ICON(ICON_BORDER_RECT) +DEF_ICON(ICON_BORDER_LASSO) +DEF_ICON(ICON_FREEZE) +DEF_ICON(ICON_BLANK031) +DEF_ICON(ICON_BLANK032) +DEF_ICON(ICON_BLANK033) +DEF_ICON(ICON_BLANK034) +DEF_ICON(ICON_BLANK035) +DEF_ICON(ICON_BLANK036) +DEF_ICON(ICON_BLANK037) +DEF_ICON(ICON_BLANK038) +DEF_ICON(ICON_BLANK039) +DEF_ICON(ICON_BLANK040) +DEF_ICON(ICON_BLANK040b) + + /* BUTTONS */ +DEF_ICON(ICON_LAMP) +DEF_ICON(ICON_MATERIAL) +DEF_ICON(ICON_TEXTURE) +DEF_ICON(ICON_ANIM) +DEF_ICON(ICON_WORLD) +DEF_ICON(ICON_SCENE) +DEF_ICON(ICON_EDIT) +DEF_ICON(ICON_GAME) +DEF_ICON(ICON_RADIO) +DEF_ICON(ICON_SCRIPT) +DEF_ICON(ICON_PARTICLES) +DEF_ICON(ICON_PHYSICS) +DEF_ICON(ICON_SPEAKER) +DEF_ICON(ICON_BLANK041) +DEF_ICON(ICON_BLANK042) +DEF_ICON(ICON_BLANK043) +DEF_ICON(ICON_BLANK044) +DEF_ICON(ICON_BLANK045) +DEF_ICON(ICON_BLANK046) +DEF_ICON(ICON_BLANK047) +DEF_ICON(ICON_BLANK048) +DEF_ICON(ICON_BLANK049) +DEF_ICON(ICON_BLANK050) +DEF_ICON(ICON_BLANK051) +DEF_ICON(ICON_BLANK052) +DEF_ICON(ICON_BLANK052b) + + /* EDITORS */ +DEF_ICON(ICON_VIEW3D) +DEF_ICON(ICON_IPO) +DEF_ICON(ICON_OOPS) +DEF_ICON(ICON_BUTS) +DEF_ICON(ICON_FILESEL) +DEF_ICON(ICON_IMAGE_COL) +DEF_ICON(ICON_INFO) +DEF_ICON(ICON_SEQUENCE) +DEF_ICON(ICON_TEXT) +DEF_ICON(ICON_IMASEL) +DEF_ICON(ICON_SOUND) +DEF_ICON(ICON_ACTION) +DEF_ICON(ICON_NLA) +DEF_ICON(ICON_SCRIPTWIN) +DEF_ICON(ICON_TIME) +DEF_ICON(ICON_NODE) +DEF_ICON(ICON_BLANK053) +DEF_ICON(ICON_BLANK054) +DEF_ICON(ICON_BLANK055) +DEF_ICON(ICON_BLANK056) +DEF_ICON(ICON_BLANK057) +DEF_ICON(ICON_BLANK058) +DEF_ICON(ICON_BLANK059) +DEF_ICON(ICON_BLANK060) +DEF_ICON(ICON_BLANK061) +DEF_ICON(ICON_BLANK061b) + + /* MODES */ +DEF_ICON(ICON_OBJECT_DATAMODE) // XXX fix this up +DEF_ICON(ICON_EDITMODE_HLT) +DEF_ICON(ICON_FACESEL_HLT) +DEF_ICON(ICON_VPAINT_HLT) +DEF_ICON(ICON_TPAINT_HLT) +DEF_ICON(ICON_WPAINT_HLT) +DEF_ICON(ICON_SCULPTMODE_HLT) +DEF_ICON(ICON_POSE_HLT) +DEF_ICON(ICON_PARTICLEMODE) +DEF_ICON(ICON_BLANK062) +DEF_ICON(ICON_BLANK063) +DEF_ICON(ICON_BLANK064) +DEF_ICON(ICON_BLANK065) +DEF_ICON(ICON_BLANK066) +DEF_ICON(ICON_BLANK067) +DEF_ICON(ICON_BLANK068) +DEF_ICON(ICON_BLANK069) +DEF_ICON(ICON_BLANK070) +DEF_ICON(ICON_BLANK071) +DEF_ICON(ICON_BLANK072) +DEF_ICON(ICON_BLANK073) +DEF_ICON(ICON_BLANK074) +DEF_ICON(ICON_BLANK075) +DEF_ICON(ICON_BLANK076) +DEF_ICON(ICON_BLANK077) +DEF_ICON(ICON_BLANK077b) + + /* DATA */ +DEF_ICON(ICON_SCENE_DATA) +DEF_ICON(ICON_RENDERLAYERS) +DEF_ICON(ICON_WORLD_DATA) +DEF_ICON(ICON_OBJECT_DATA) +DEF_ICON(ICON_MESH_DATA) +DEF_ICON(ICON_CURVE_DATA) +DEF_ICON(ICON_META_DATA) +DEF_ICON(ICON_LATTICE_DATA) +DEF_ICON(ICON_LAMP_DATA) +DEF_ICON(ICON_MATERIAL_DATA) +DEF_ICON(ICON_TEXTURE_DATA) +DEF_ICON(ICON_ANIM_DATA) +DEF_ICON(ICON_CAMERA_DATA) +DEF_ICON(ICON_PARTICLE_DATA) +DEF_ICON(ICON_LIBRARY_DATA_DIRECT) +DEF_ICON(ICON_GROUP) +DEF_ICON(ICON_ARMATURE_DATA) +DEF_ICON(ICON_POSE_DATA) +DEF_ICON(ICON_BONE_DATA) +DEF_ICON(ICON_CONSTRAINT) +DEF_ICON(ICON_SHAPEKEY_DATA) +DEF_ICON(ICON_BLANK079a) +DEF_ICON(ICON_BLANK079) +DEF_ICON(ICON_PACKAGE) +DEF_ICON(ICON_UGLYPACKAGE) +DEF_ICON(ICON_BLANK079b) + + /* DATA */ +DEF_ICON(ICON_BRUSH_DATA) +DEF_ICON(ICON_IMAGE_DATA) +DEF_ICON(ICON_FILE) +DEF_ICON(ICON_FCURVE) +DEF_ICON(ICON_FONT_DATA) +DEF_ICON(ICON_RENDER_RESULT) +DEF_ICON(ICON_SURFACE_DATA) +DEF_ICON(ICON_EMPTY_DATA) +DEF_ICON(ICON_SETTINGS) +DEF_ICON(ICON_BLANK080D) +DEF_ICON(ICON_BLANK080E) +DEF_ICON(ICON_BLANK080F) +DEF_ICON(ICON_BLANK080) +DEF_ICON(ICON_STRANDS) +DEF_ICON(ICON_LIBRARY_DATA_INDIRECT) +DEF_ICON(ICON_BLANK082) +DEF_ICON(ICON_BLANK083) +DEF_ICON(ICON_BLANK084) +DEF_ICON(ICON_GROUP_BONE) +DEF_ICON(ICON_GROUP_VERTEX) +DEF_ICON(ICON_GROUP_VCOL) +DEF_ICON(ICON_GROUP_UVS) +DEF_ICON(ICON_BLANK089) +DEF_ICON(ICON_BLANK090) +DEF_ICON(ICON_RNA) +DEF_ICON(ICON_BLANK090b) + + /* available */ +DEF_ICON(ICON_BLANK092) +DEF_ICON(ICON_BLANK093) +DEF_ICON(ICON_BLANK094) +DEF_ICON(ICON_BLANK095) +DEF_ICON(ICON_BLANK096) +DEF_ICON(ICON_BLANK097) +DEF_ICON(ICON_BLANK098) +DEF_ICON(ICON_BLANK099) +DEF_ICON(ICON_BLANK100) +DEF_ICON(ICON_BLANK101) +DEF_ICON(ICON_BLANK102) +DEF_ICON(ICON_BLANK103) +DEF_ICON(ICON_BLANK104) +DEF_ICON(ICON_BLANK105) +DEF_ICON(ICON_BLANK106) +DEF_ICON(ICON_BLANK107) +DEF_ICON(ICON_BLANK108) +DEF_ICON(ICON_BLANK109) +DEF_ICON(ICON_BLANK110) +DEF_ICON(ICON_BLANK111) +DEF_ICON(ICON_BLANK112) +DEF_ICON(ICON_BLANK113) +DEF_ICON(ICON_BLANK114) +DEF_ICON(ICON_BLANK115) +DEF_ICON(ICON_BLANK116) +DEF_ICON(ICON_BLANK116b) + + /* OUTLINER */ +DEF_ICON(ICON_OUTLINER_OB_EMPTY) +DEF_ICON(ICON_OUTLINER_OB_MESH) +DEF_ICON(ICON_OUTLINER_OB_CURVE) +DEF_ICON(ICON_OUTLINER_OB_LATTICE) +DEF_ICON(ICON_OUTLINER_OB_META) +DEF_ICON(ICON_OUTLINER_OB_LAMP) +DEF_ICON(ICON_OUTLINER_OB_CAMERA) +DEF_ICON(ICON_OUTLINER_OB_ARMATURE) +DEF_ICON(ICON_OUTLINER_OB_FONT) +DEF_ICON(ICON_OUTLINER_OB_SURFACE) +DEF_ICON(ICON_BLANK119) +DEF_ICON(ICON_BLANK120) +DEF_ICON(ICON_BLANK121) +DEF_ICON(ICON_BLANK122) +DEF_ICON(ICON_BLANK123) +DEF_ICON(ICON_BLANK124) +DEF_ICON(ICON_BLANK125) +DEF_ICON(ICON_BLANK126) +DEF_ICON(ICON_BLANK127) +DEF_ICON(ICON_RESTRICT_VIEW_OFF) +DEF_ICON(ICON_RESTRICT_VIEW_ON) +DEF_ICON(ICON_RESTRICT_SELECT_OFF) +DEF_ICON(ICON_RESTRICT_SELECT_ON) +DEF_ICON(ICON_RESTRICT_RENDER_OFF) +DEF_ICON(ICON_RESTRICT_RENDER_ON) +DEF_ICON(ICON_BLANK127b) + + /* OUTLINER */ +DEF_ICON(ICON_OUTLINER_DATA_EMPTY) +DEF_ICON(ICON_OUTLINER_DATA_MESH) +DEF_ICON(ICON_OUTLINER_DATA_CURVE) +DEF_ICON(ICON_OUTLINER_DATA_LATTICE) +DEF_ICON(ICON_OUTLINER_DATA_META) +DEF_ICON(ICON_OUTLINER_DATA_LAMP) +DEF_ICON(ICON_OUTLINER_DATA_CAMERA) +DEF_ICON(ICON_OUTLINER_DATA_ARMATURE) +DEF_ICON(ICON_OUTLINER_DATA_FONT) +DEF_ICON(ICON_OUTLINER_DATA_SURFACE) +DEF_ICON(ICON_OUTLINER_DATA_POSE) +DEF_ICON(ICON_BLANK129) +DEF_ICON(ICON_BLANK130) +DEF_ICON(ICON_BLANK131) +DEF_ICON(ICON_BLANK132) +DEF_ICON(ICON_BLANK133) +DEF_ICON(ICON_BLANK134) +DEF_ICON(ICON_BLANK135) +DEF_ICON(ICON_BLANK136) +DEF_ICON(ICON_BLANK137) +DEF_ICON(ICON_BLANK138) +DEF_ICON(ICON_BLANK139) +DEF_ICON(ICON_BLANK140) +DEF_ICON(ICON_BLANK141) +DEF_ICON(ICON_BLANK142) +DEF_ICON(ICON_BLANK142b) + + /* PRIMITIVES */ +DEF_ICON(ICON_MESH_PLANE) +DEF_ICON(ICON_MESH_CUBE) +DEF_ICON(ICON_MESH_CIRCLE) +DEF_ICON(ICON_MESH_UVSPHERE) +DEF_ICON(ICON_MESH_ICOSPHERE) +DEF_ICON(ICON_MESH_GRID) +DEF_ICON(ICON_MESH_MONKEY) +DEF_ICON(ICON_MESH_TUBE) +DEF_ICON(ICON_MESH_DONUT) +DEF_ICON(ICON_MESH_CONE) +DEF_ICON(ICON_BLANK610) +DEF_ICON(ICON_BLANK611) +DEF_ICON(ICON_LAMP_POINT) +DEF_ICON(ICON_LAMP_SUN) +DEF_ICON(ICON_LAMP_SPOT) +DEF_ICON(ICON_LAMP_HEMI) +DEF_ICON(ICON_LAMP_AREA) +DEF_ICON(ICON_BLANK617) +DEF_ICON(ICON_BLANK618) +DEF_ICON(ICON_BLANK619) +DEF_ICON(ICON_META_PLANE) +DEF_ICON(ICON_META_CUBE) +DEF_ICON(ICON_META_BALL) +DEF_ICON(ICON_META_ELLIPSOID) +DEF_ICON(ICON_META_TUBE) +DEF_ICON(ICON_BLANK625) + + /* PRIMITIVES */ +DEF_ICON(ICON_SURFACE_NCURVE) +DEF_ICON(ICON_SURFACE_NCIRCLE) +DEF_ICON(ICON_SURFACE_NSURFACE) +DEF_ICON(ICON_SURFACE_NTUBE) +DEF_ICON(ICON_SURFACE_NSPHERE) +DEF_ICON(ICON_SURFACE_NDONUT) +DEF_ICON(ICON_BLANK636) +DEF_ICON(ICON_BLANK637) +DEF_ICON(ICON_BLANK638) +DEF_ICON(ICON_CURVE_BEZCURVE) +DEF_ICON(ICON_CURVE_BEZCIRCLE) +DEF_ICON(ICON_CURVE_NCURVE) +DEF_ICON(ICON_CURVE_NCIRCLE) +DEF_ICON(ICON_CURVE_PATH) +DEF_ICON(ICON_BLANK644) +DEF_ICON(ICON_BLANK645) +DEF_ICON(ICON_BLANK646) +DEF_ICON(ICON_BLANK647) +DEF_ICON(ICON_BLANK648) +DEF_ICON(ICON_BLANK649) +DEF_ICON(ICON_BLANK650) +DEF_ICON(ICON_BLANK651) +DEF_ICON(ICON_BLANK652) +DEF_ICON(ICON_BLANK653) +DEF_ICON(ICON_BLANK654) +DEF_ICON(ICON_BLANK655) + + /* EMPTY */ +DEF_ICON(ICON_BLANK660) +DEF_ICON(ICON_BLANK661) +DEF_ICON(ICON_BLANK662) +DEF_ICON(ICON_BLANK663) +DEF_ICON(ICON_BLANK664) +DEF_ICON(ICON_BLANK665) +DEF_ICON(ICON_BLANK666) +DEF_ICON(ICON_BLANK667) +DEF_ICON(ICON_BLANK668) +DEF_ICON(ICON_BLANK669) +DEF_ICON(ICON_BLANK670) +DEF_ICON(ICON_BLANK671) +DEF_ICON(ICON_BLANK672) +DEF_ICON(ICON_BLANK673) +DEF_ICON(ICON_BLANK674) +DEF_ICON(ICON_BLANK675) +DEF_ICON(ICON_BLANK676) +DEF_ICON(ICON_BLANK677) +DEF_ICON(ICON_BLANK678) +DEF_ICON(ICON_BLANK679) +DEF_ICON(ICON_BLANK680) +DEF_ICON(ICON_BLANK681) +DEF_ICON(ICON_BLANK682) +DEF_ICON(ICON_BLANK683) +DEF_ICON(ICON_BLANK684) +DEF_ICON(ICON_BLANK685) + + /* EMPTY */ +DEF_ICON(ICON_BLANK690) +DEF_ICON(ICON_BLANK691) +DEF_ICON(ICON_BLANK692) +DEF_ICON(ICON_BLANK693) +DEF_ICON(ICON_BLANK694) +DEF_ICON(ICON_BLANK695) +DEF_ICON(ICON_BLANK696) +DEF_ICON(ICON_BLANK697) +DEF_ICON(ICON_BLANK698) +DEF_ICON(ICON_BLANK699) +DEF_ICON(ICON_BLANK700) +DEF_ICON(ICON_BLANK701) +DEF_ICON(ICON_BLANK702) +DEF_ICON(ICON_BLANK703) +DEF_ICON(ICON_BLANK704) +DEF_ICON(ICON_BLANK705) +DEF_ICON(ICON_BLANK706) +DEF_ICON(ICON_BLANK707) +DEF_ICON(ICON_BLANK708) +DEF_ICON(ICON_BLANK709) +DEF_ICON(ICON_BLANK710) +DEF_ICON(ICON_BLANK711) +DEF_ICON(ICON_BLANK712) +DEF_ICON(ICON_BLANK713) +DEF_ICON(ICON_BLANK714) +DEF_ICON(ICON_BLANK715) + + /* EMPTY */ +DEF_ICON(ICON_BLANK720) +DEF_ICON(ICON_BLANK721) +DEF_ICON(ICON_BLANK722) +DEF_ICON(ICON_BLANK733) +DEF_ICON(ICON_BLANK734) +DEF_ICON(ICON_BLANK735) +DEF_ICON(ICON_BLANK736) +DEF_ICON(ICON_BLANK737) +DEF_ICON(ICON_BLANK738) +DEF_ICON(ICON_BLANK739) +DEF_ICON(ICON_BLANK740) +DEF_ICON(ICON_BLANK741) +DEF_ICON(ICON_BLANK742) +DEF_ICON(ICON_BLANK743) +DEF_ICON(ICON_BLANK744) +DEF_ICON(ICON_BLANK745) +DEF_ICON(ICON_BLANK746) +DEF_ICON(ICON_BLANK747) +DEF_ICON(ICON_BLANK748) +DEF_ICON(ICON_BLANK749) +DEF_ICON(ICON_BLANK750) +DEF_ICON(ICON_BLANK751) +DEF_ICON(ICON_BLANK752) +DEF_ICON(ICON_BLANK753) +DEF_ICON(ICON_BLANK754) +DEF_ICON(ICON_BLANK755) + + /* EMPTY */ +DEF_ICON(ICON_BLANK760) +DEF_ICON(ICON_BLANK761) +DEF_ICON(ICON_BLANK762) +DEF_ICON(ICON_BLANK763) +DEF_ICON(ICON_BLANK764) +DEF_ICON(ICON_BLANK765) +DEF_ICON(ICON_BLANK766) +DEF_ICON(ICON_BLANK767) +DEF_ICON(ICON_BLANK768) +DEF_ICON(ICON_BLANK769) +DEF_ICON(ICON_BLANK770) +DEF_ICON(ICON_BLANK771) +DEF_ICON(ICON_BLANK772) +DEF_ICON(ICON_BLANK773) +DEF_ICON(ICON_BLANK774) +DEF_ICON(ICON_BLANK775) +DEF_ICON(ICON_BLANK776) +DEF_ICON(ICON_BLANK777) +DEF_ICON(ICON_BLANK778) +DEF_ICON(ICON_BLANK779) +DEF_ICON(ICON_BLANK780) +DEF_ICON(ICON_BLANK781) +DEF_ICON(ICON_BLANK782) +DEF_ICON(ICON_BLANK783) +DEF_ICON(ICON_BLANK784) +DEF_ICON(ICON_BLANK785) + + /* MODIFIERS */ +DEF_ICON(ICON_MODIFIER) +DEF_ICON(ICON_MOD_WAVE) +DEF_ICON(ICON_MOD_BUILD) +DEF_ICON(ICON_MOD_DECIM) +DEF_ICON(ICON_MOD_MIRROR) +DEF_ICON(ICON_MOD_SOFT) +DEF_ICON(ICON_MOD_SUBSURF) +DEF_ICON(ICON_HOOK) +DEF_ICON(ICON_MOD_PHYSICS) +DEF_ICON(ICON_MOD_PARTICLES) +DEF_ICON(ICON_MOD_BOOLEAN) +DEF_ICON(ICON_MOD_EDGESPLIT) +DEF_ICON(ICON_MOD_ARRAY) +DEF_ICON(ICON_MOD_UVPROJECT) +DEF_ICON(ICON_MOD_DISPLACE) +DEF_ICON(ICON_MOD_CURVE) +DEF_ICON(ICON_MOD_LATTICE) +DEF_ICON(ICON_BLANK143) +DEF_ICON(ICON_MOD_ARMATURE) +DEF_ICON(ICON_MOD_SHRINKWRAP) +DEF_ICON(ICON_MOD_CAST) +DEF_ICON(ICON_MOD_MESHDEFORM) +DEF_ICON(ICON_MOD_BEVEL) +DEF_ICON(ICON_MOD_SMOOTH) +DEF_ICON(ICON_MOD_SIMPLEDEFORM) +DEF_ICON(ICON_MOD_MASK) + + /* MODIFIERS */ +DEF_ICON(ICON_MOD_CLOTH) +DEF_ICON(ICON_MOD_EXPLODE) +DEF_ICON(ICON_MOD_FLUIDSIM) +DEF_ICON(ICON_MOD_MULTIRES) +DEF_ICON(ICON_BLANK157) +DEF_ICON(ICON_BLANK158) +DEF_ICON(ICON_BLANK159) +DEF_ICON(ICON_BLANK160) +DEF_ICON(ICON_BLANK161) +DEF_ICON(ICON_BLANK162) +DEF_ICON(ICON_BLANK163) +DEF_ICON(ICON_BLANK164) +DEF_ICON(ICON_BLANK165) +DEF_ICON(ICON_BLANK166) +DEF_ICON(ICON_BLANK167) +DEF_ICON(ICON_BLANK168) +DEF_ICON(ICON_BLANK169) +DEF_ICON(ICON_BLANK170) +DEF_ICON(ICON_BLANK171) +DEF_ICON(ICON_BLANK172) +DEF_ICON(ICON_BLANK173) +DEF_ICON(ICON_BLANK174) +DEF_ICON(ICON_BLANK175) +DEF_ICON(ICON_BLANK176) +DEF_ICON(ICON_BLANK177) +DEF_ICON(ICON_BLANK177b) + + /* ANIMATION */ +DEF_ICON(ICON_REC) +DEF_ICON(ICON_PLAY) +DEF_ICON(ICON_FF) +DEF_ICON(ICON_REW) +DEF_ICON(ICON_PAUSE) +DEF_ICON(ICON_PREV_KEYFRAME) +DEF_ICON(ICON_NEXT_KEYFRAME) +DEF_ICON(ICON_PLAY_AUDIO) +DEF_ICON(ICON_BLANK178) +DEF_ICON(ICON_BLANK179) +DEF_ICON(ICON_BLANK180) +DEF_ICON(ICON_PMARKER_ACT) +DEF_ICON(ICON_PMARKER_SEL) +DEF_ICON(ICON_PMARKER) +DEF_ICON(ICON_MARKER_HLT) +DEF_ICON(ICON_MARKER) +DEF_ICON(ICON_SPACE2) // XXX +DEF_ICON(ICON_SPACE3) // XXX +DEF_ICON(ICON_BLANK181) +DEF_ICON(ICON_KEY_DEHLT) +DEF_ICON(ICON_KEY_HLT) +DEF_ICON(ICON_MUTE_IPO_OFF) +DEF_ICON(ICON_MUTE_IPO_ON) +DEF_ICON(ICON_BLANK182) +DEF_ICON(ICON_BLANK183) +DEF_ICON(ICON_BLANK183b) + + /* available */ +DEF_ICON(ICON_BLANK184) +DEF_ICON(ICON_BLANK185) +DEF_ICON(ICON_BLANK186) +DEF_ICON(ICON_BLANK187) +DEF_ICON(ICON_BLANK188) +DEF_ICON(ICON_BLANK189) +DEF_ICON(ICON_BLANK190) +DEF_ICON(ICON_BLANK191) +DEF_ICON(ICON_BLANK192) +DEF_ICON(ICON_BLANK193) +DEF_ICON(ICON_BLANK194) +DEF_ICON(ICON_BLANK195) +DEF_ICON(ICON_BLANK196) +DEF_ICON(ICON_BLANK197) +DEF_ICON(ICON_BLANK198) +DEF_ICON(ICON_BLANK199) +DEF_ICON(ICON_BLANK200) +DEF_ICON(ICON_BLANK201) +DEF_ICON(ICON_BLANK202) +DEF_ICON(ICON_BLANK203) +DEF_ICON(ICON_BLANK204) +DEF_ICON(ICON_BLANK205) +DEF_ICON(ICON_BLANK206) +DEF_ICON(ICON_BLANK207) +DEF_ICON(ICON_BLANK208) +DEF_ICON(ICON_BLANK208b) + + /* EDITING */ +DEF_ICON(ICON_VERTEXSEL) +DEF_ICON(ICON_EDGESEL) +DEF_ICON(ICON_FACESEL) +DEF_ICON(ICON_LINKEDSEL) +DEF_ICON(ICON_BLANK210) +DEF_ICON(ICON_ROTATE) +DEF_ICON(ICON_CURSOR) +DEF_ICON(ICON_ROTATECOLLECTION) +DEF_ICON(ICON_ROTATECENTER) +DEF_ICON(ICON_ROTACTIVE) +DEF_ICON(ICON_ALIGN) +DEF_ICON(ICON_BLANK211) +DEF_ICON(ICON_SMOOTHCURVE) +DEF_ICON(ICON_SPHERECURVE) +DEF_ICON(ICON_ROOTCURVE) +DEF_ICON(ICON_SHARPCURVE) +DEF_ICON(ICON_LINCURVE) +DEF_ICON(ICON_NOCURVE) +DEF_ICON(ICON_RNDCURVE) +DEF_ICON(ICON_PROP_OFF) +DEF_ICON(ICON_PROP_ON) +DEF_ICON(ICON_PROP_CON) +DEF_ICON(ICON_BLANK212) +DEF_ICON(ICON_BLANK213) +DEF_ICON(ICON_BLANK214) +DEF_ICON(ICON_BLANK214b) + + /* EDITING */ +DEF_ICON(ICON_MAN_TRANS) +DEF_ICON(ICON_MAN_ROT) +DEF_ICON(ICON_MAN_SCALE) +DEF_ICON(ICON_MANIPUL) +DEF_ICON(ICON_BLANK215) +DEF_ICON(ICON_SNAP_GEAR) +DEF_ICON(ICON_SNAP_GEO) +DEF_ICON(ICON_SNAP_NORMAL) +DEF_ICON(ICON_SNAP_VERTEX) +DEF_ICON(ICON_SNAP_EDGE) +DEF_ICON(ICON_SNAP_FACE) +DEF_ICON(ICON_SNAP_VOLUME) +DEF_ICON(ICON_STICKY_UVS_LOC) +DEF_ICON(ICON_STICKY_UVS_DISABLE) +DEF_ICON(ICON_STICKY_UVS_VERT) +DEF_ICON(ICON_CLIPUV_DEHLT) +DEF_ICON(ICON_CLIPUV_HLT) +DEF_ICON(ICON_BLANK219) +DEF_ICON(ICON_SNAP_PEEL_OBJECT) +DEF_ICON(ICON_BLANK221) +DEF_ICON(ICON_GRID) +DEF_ICON(ICON_GEARS) +DEF_ICON(ICON_BLANK224) +DEF_ICON(ICON_BLANK225) +DEF_ICON(ICON_BLANK226) +DEF_ICON(ICON_BLANK226b) + + /* EDITING */ +DEF_ICON(ICON_PASTEDOWN) +DEF_ICON(ICON_COPYDOWN) +DEF_ICON(ICON_PASTEFLIPUP) +DEF_ICON(ICON_PASTEFLIPDOWN) +DEF_ICON(ICON_BLANK227) +DEF_ICON(ICON_BLANK228) +DEF_ICON(ICON_BLANK229) +DEF_ICON(ICON_BLANK230) +DEF_ICON(ICON_BLANK231) +DEF_ICON(ICON_BLANK232) +DEF_ICON(ICON_BLANK233) +DEF_ICON(ICON_BLANK234) +DEF_ICON(ICON_BLANK235) +DEF_ICON(ICON_BLANK236) +DEF_ICON(ICON_BLANK237) +DEF_ICON(ICON_BLANK238) +DEF_ICON(ICON_BLANK239) +DEF_ICON(ICON_BLANK240) +DEF_ICON(ICON_BLANK241) +DEF_ICON(ICON_BLANK242) +DEF_ICON(ICON_BLANK243) +DEF_ICON(ICON_BLANK244) +DEF_ICON(ICON_BLANK245) +DEF_ICON(ICON_BLANK246) +DEF_ICON(ICON_BLANK247) +DEF_ICON(ICON_BLANK247b) + + /* 3D VIEW */ +DEF_ICON(ICON_BBOX) +DEF_ICON(ICON_WIRE) +DEF_ICON(ICON_SOLID) +DEF_ICON(ICON_SMOOTH) +DEF_ICON(ICON_POTATO) +DEF_ICON(ICON_BLANK248) +DEF_ICON(ICON_ORTHO) +DEF_ICON(ICON_BLANK249) +DEF_ICON(ICON_CAMERA) +DEF_ICON(ICON_LOCKVIEW_OFF) +DEF_ICON(ICON_LOCKVIEW_ON) +DEF_ICON(ICON_BLANK250) +DEF_ICON(ICON_AXIS_SIDE) +DEF_ICON(ICON_AXIS_FRONT) +DEF_ICON(ICON_AXIS_TOP) +DEF_ICON(ICON_NDOF_DOM) +DEF_ICON(ICON_NDOF_TURN) +DEF_ICON(ICON_NDOF_FLY) +DEF_ICON(ICON_NDOF_TRANS) +DEF_ICON(ICON_LAYER_USED) +DEF_ICON(ICON_LAYER_ACTIVE) +DEF_ICON(ICON_BLANK254) +DEF_ICON(ICON_BLANK255) +DEF_ICON(ICON_BLANK256) +DEF_ICON(ICON_BLANK257) +DEF_ICON(ICON_BLANK257b) + + /* available */ +DEF_ICON(ICON_BLANK258) +DEF_ICON(ICON_BLANK259) +DEF_ICON(ICON_BLANK260) +DEF_ICON(ICON_BLANK261) +DEF_ICON(ICON_BLANK262) +DEF_ICON(ICON_BLANK263) +DEF_ICON(ICON_BLANK264) +DEF_ICON(ICON_BLANK265) +DEF_ICON(ICON_BLANK266) +DEF_ICON(ICON_BLANK267) +DEF_ICON(ICON_BLANK268) +DEF_ICON(ICON_BLANK269) +DEF_ICON(ICON_BLANK270) +DEF_ICON(ICON_BLANK271) +DEF_ICON(ICON_BLANK272) +DEF_ICON(ICON_BLANK273) +DEF_ICON(ICON_BLANK274) +DEF_ICON(ICON_BLANK275) +DEF_ICON(ICON_BLANK276) +DEF_ICON(ICON_BLANK277) +DEF_ICON(ICON_BLANK278) +DEF_ICON(ICON_BLANK279) +DEF_ICON(ICON_BLANK280) +DEF_ICON(ICON_BLANK281) +DEF_ICON(ICON_BLANK282) +DEF_ICON(ICON_BLANK282b) + + /* FILE SELECT */ +DEF_ICON(ICON_SORTALPHA) +DEF_ICON(ICON_SORTBYEXT) +DEF_ICON(ICON_SORTTIME) +DEF_ICON(ICON_SORTSIZE) +DEF_ICON(ICON_LONGDISPLAY) +DEF_ICON(ICON_SHORTDISPLAY) +DEF_ICON(ICON_GHOST) +DEF_ICON(ICON_IMGDISPLAY) +DEF_ICON(ICON_BLANK284) +DEF_ICON(ICON_BLANK285) +DEF_ICON(ICON_BOOKMARKS) +DEF_ICON(ICON_FONTPREVIEW) +DEF_ICON(ICON_FILTER) +DEF_ICON(ICON_NEWFOLDER) +DEF_ICON(ICON_BLANK285F) +DEF_ICON(ICON_FILE_PARENT) +DEF_ICON(ICON_FILE_REFRESH) +DEF_ICON(ICON_FILE_FOLDER) +DEF_ICON(ICON_FILE_BLANK) +DEF_ICON(ICON_FILE_BLEND) +DEF_ICON(ICON_FILE_IMAGE) +DEF_ICON(ICON_FILE_MOVIE) +DEF_ICON(ICON_FILE_SCRIPT) +DEF_ICON(ICON_FILE_SOUND) +DEF_ICON(ICON_FILE_FONT) +DEF_ICON(ICON_BLANK291b) + + /* available */ +DEF_ICON(ICON_BLANK292) +DEF_ICON(ICON_BLANK293) +DEF_ICON(ICON_BLANK294) +DEF_ICON(ICON_BLANK295) +DEF_ICON(ICON_BLANK296) +DEF_ICON(ICON_BLANK297) +DEF_ICON(ICON_BLANK298) +DEF_ICON(ICON_BLANK299) +DEF_ICON(ICON_BLANK300) +DEF_ICON(ICON_BLANK301) +DEF_ICON(ICON_BLANK302) +DEF_ICON(ICON_BLANK303) +DEF_ICON(ICON_BLANK304) +DEF_ICON(ICON_BLANK305) +DEF_ICON(ICON_BLANK306) +DEF_ICON(ICON_BLANK307) +DEF_ICON(ICON_BLANK308) +DEF_ICON(ICON_BLANK309) +DEF_ICON(ICON_BLANK310) +DEF_ICON(ICON_BLANK311) +DEF_ICON(ICON_BLANK312) +DEF_ICON(ICON_BLANK313) +DEF_ICON(ICON_BLANK314) +DEF_ICON(ICON_BLANK315) +DEF_ICON(ICON_BLANK316) +DEF_ICON(ICON_DISK_DRIVE) + + /* SHADING / TEXT */ +DEF_ICON(ICON_MATPLANE) +DEF_ICON(ICON_MATSPHERE) +DEF_ICON(ICON_MATCUBE) +DEF_ICON(ICON_MONKEY) +DEF_ICON(ICON_HAIR) +DEF_ICON(ICON_RING) +DEF_ICON(ICON_BLANK317) +DEF_ICON(ICON_BLANK318) +DEF_ICON(ICON_BLANK319) +DEF_ICON(ICON_BLANK320) +DEF_ICON(ICON_BLANK321) +DEF_ICON(ICON_BLANK322) +DEF_ICON(ICON_WORDWRAP_OFF) +DEF_ICON(ICON_WORDWRAP_ON) +DEF_ICON(ICON_SYNTAX_OFF) +DEF_ICON(ICON_SYNTAX_ON) +DEF_ICON(ICON_LINENUMBERS_OFF) +DEF_ICON(ICON_LINENUMBERS_ON) +DEF_ICON(ICON_SCRIPTPLUGINS) // XXX CREATE NEW +DEF_ICON(ICON_BLANK323) +DEF_ICON(ICON_BLANK324) +DEF_ICON(ICON_BLANK325) +DEF_ICON(ICON_BLANK326) +DEF_ICON(ICON_BLANK327) +DEF_ICON(ICON_BLANK328) +DEF_ICON(ICON_BLANK328b) + + /* SEQUENCE / IMAGE EDITOR */ +DEF_ICON(ICON_SEQ_SEQUENCER) +DEF_ICON(ICON_SEQ_PREVIEW) +DEF_ICON(ICON_SEQ_LUMA_WAVEFORM) +DEF_ICON(ICON_SEQ_CHROMA_SCOPE) +DEF_ICON(ICON_SEQ_HISTOGRAM) +DEF_ICON(ICON_BLANK330) +DEF_ICON(ICON_BLANK331) +DEF_ICON(ICON_BLANK332) +DEF_ICON(ICON_BLANK333) +DEF_ICON(ICON_IMAGE_RGB) // XXX CHANGE TO STRAIGHT ALPHA, Z ETC +DEF_ICON(ICON_IMAGE_RGB_ALPHA) +DEF_ICON(ICON_IMAGE_ALPHA) +DEF_ICON(ICON_IMAGE_ZDEPTH) +DEF_ICON(ICON_IMAGEFILE) +DEF_ICON(ICON_BLANK336) +DEF_ICON(ICON_BLANK337) +DEF_ICON(ICON_BLANK338) +DEF_ICON(ICON_BLANK339) +DEF_ICON(ICON_BLANK340) +DEF_ICON(ICON_BLANK341) +DEF_ICON(ICON_BLANK342) +DEF_ICON(ICON_BLANK343) +DEF_ICON(ICON_BLANK344) +DEF_ICON(ICON_BLANK345) +DEF_ICON(ICON_BLANK346) +DEF_ICON(ICON_BLANK346b) + + /* vector icons */ + +DEF_ICON(VICON_VIEW3D) +DEF_ICON(VICON_EDIT) +DEF_ICON(VICON_EDITMODE_DEHLT) +DEF_ICON(VICON_EDITMODE_HLT) +DEF_ICON(VICON_DISCLOSURE_TRI_RIGHT) +DEF_ICON(VICON_DISCLOSURE_TRI_DOWN) +DEF_ICON(VICON_MOVE_UP) +DEF_ICON(VICON_MOVE_DOWN) +DEF_ICON(VICON_X) diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index 6fa0eb90c5f..7168e593a8a 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -35,864 +35,16 @@ /* elubie: TODO: move the typedef for icons to UI_interface_icons.h */ /* and add/replace include of UI_resources.h by UI_interface_icons.h */ +#define DEF_ICON(name) name, typedef enum { #define BIFICONID_FIRST (ICON_BLENDER) /* ui */ - ICON_BLENDER, - ICON_QUESTION, - ICON_ERROR, - ICON_BLANK1, // XXX this is used lots, it's not actually 'blank' - ICON_TRIA_RIGHT, - ICON_TRIA_DOWN, - ICON_TRIA_LEFT, - ICON_TRIA_UP, - ICON_ARROW_LEFTRIGHT, - ICON_PLUS, - ICON_DISCLOSURE_TRI_DOWN, - ICON_DISCLOSURE_TRI_RIGHT, - ICON_RADIOBUT_OFF, - ICON_RADIOBUT_ON, - ICON_MENU_PANEL, - ICON_PYTHON, - ICON_BLANK003, - ICON_DOT, - ICON_BLANK004, - ICON_X, - ICON_BLANK005, - ICON_GO_LEFT, - ICON_BLANK006, - ICON_BLANK007, - ICON_BLANK008, - ICON_BLANK008b, - - /* ui */ - ICON_FULLSCREEN, - ICON_SPLITSCREEN, - ICON_RIGHTARROW_THIN, - ICON_BORDERMOVE, - ICON_VIEWZOOM, - ICON_ZOOMIN, - ICON_ZOOMOUT, - ICON_PANEL_CLOSE, - ICON_BLANK009, - ICON_EYEDROPPER, - ICON_BLANK010, - ICON_AUTO, - ICON_CHECKBOX_DEHLT, - ICON_CHECKBOX_HLT, - ICON_UNLOCKED, - ICON_LOCKED, - ICON_PINNED, - ICON_UNPINNED, - ICON_BLANK015, - ICON_RIGHTARROW, - ICON_DOWNARROW_HLT, - ICON_DOTSUP, - ICON_DOTSDOWN, - ICON_LINK, - ICON_INLINK, - ICON_BLANK012b, - - /* various ui */ - ICON_HELP, - ICON_GHOSTDRAW, - ICON_COLOR, - ICON_LINKED, - ICON_UNLINKED, - ICON_HAND, - ICON_ZOOM_ALL, - ICON_ZOOM_SELECTED, - ICON_ZOOM_PREVIOUS, - ICON_ZOOM_IN, - ICON_ZOOM_OUT, - ICON_RENDER_REGION, - ICON_BORDER_RECT, - ICON_BORDER_LASSO, - ICON_FREEZE, - ICON_BLANK031, - ICON_BLANK032, - ICON_BLANK033, - ICON_BLANK034, - ICON_BLANK035, - ICON_BLANK036, - ICON_BLANK037, - ICON_BLANK038, - ICON_BLANK039, - ICON_BLANK040, - ICON_BLANK040b, - - /* BUTTONS */ - ICON_LAMP, - ICON_MATERIAL, - ICON_TEXTURE, - ICON_ANIM, - ICON_WORLD, - ICON_SCENE, - ICON_EDIT, - ICON_GAME, - ICON_RADIO, - ICON_SCRIPT, - ICON_PARTICLES, - ICON_PHYSICS, - ICON_SPEAKER, - ICON_BLANK041, - ICON_BLANK042, - ICON_BLANK043, - ICON_BLANK044, - ICON_BLANK045, - ICON_BLANK046, - ICON_BLANK047, - ICON_BLANK048, - ICON_BLANK049, - ICON_BLANK050, - ICON_BLANK051, - ICON_BLANK052, - ICON_BLANK052b, - - /* EDITORS */ - ICON_VIEW3D, - ICON_IPO, - ICON_OOPS, - ICON_BUTS, - ICON_FILESEL, - ICON_IMAGE_COL, - ICON_INFO, - ICON_SEQUENCE, - ICON_TEXT, - ICON_IMASEL, - ICON_SOUND, - ICON_ACTION, - ICON_NLA, - ICON_SCRIPTWIN, - ICON_TIME, - ICON_NODE, - ICON_BLANK053, - ICON_BLANK054, - ICON_BLANK055, - ICON_BLANK056, - ICON_BLANK057, - ICON_BLANK058, - ICON_BLANK059, - ICON_BLANK060, - ICON_BLANK061, - ICON_BLANK061b, - - /* MODES */ - ICON_OBJECT_DATAMODE, // XXX fix this up - ICON_EDITMODE_HLT, - ICON_FACESEL_HLT, - ICON_VPAINT_HLT, - ICON_TPAINT_HLT, - ICON_WPAINT_HLT, - ICON_SCULPTMODE_HLT, - ICON_POSE_HLT, - ICON_PARTICLEMODE, - ICON_BLANK062, - ICON_BLANK063, - ICON_BLANK064, - ICON_BLANK065, - ICON_BLANK066, - ICON_BLANK067, - ICON_BLANK068, - ICON_BLANK069, - ICON_BLANK070, - ICON_BLANK071, - ICON_BLANK072, - ICON_BLANK073, - ICON_BLANK074, - ICON_BLANK075, - ICON_BLANK076, - ICON_BLANK077, - ICON_BLANK077b, - - /* DATA */ - ICON_SCENE_DATA, - ICON_RENDERLAYERS, - ICON_WORLD_DATA, - ICON_OBJECT_DATA, - ICON_MESH_DATA, - ICON_CURVE_DATA, - ICON_META_DATA, - ICON_LATTICE_DATA, - ICON_LAMP_DATA, - ICON_MATERIAL_DATA, - ICON_TEXTURE_DATA, - ICON_ANIM_DATA, - ICON_CAMERA_DATA, - ICON_PARTICLE_DATA, - ICON_LIBRARY_DATA_DIRECT, - ICON_GROUP, - ICON_ARMATURE_DATA, - ICON_POSE_DATA, - ICON_BONE_DATA, - ICON_CONSTRAINT, - ICON_SHAPEKEY_DATA, - ICON_BLANK079a, - ICON_BLANK079, - ICON_PACKAGE, - ICON_UGLYPACKAGE, - ICON_BLANK079b, - - /* DATA */ - ICON_BRUSH_DATA, - ICON_IMAGE_DATA, - ICON_FILE, - ICON_FCURVE, - ICON_FONT_DATA, - ICON_RENDER_RESULT, - ICON_SURFACE_DATA, - ICON_EMPTY_DATA, - ICON_SETTINGS, - ICON_BLANK080D, - ICON_BLANK080E, - ICON_BLANK080F, - ICON_BLANK080, - ICON_STRANDS, - ICON_LIBRARY_DATA_INDIRECT, - ICON_BLANK082, - ICON_BLANK083, - ICON_BLANK084, - ICON_GROUP_BONE, - ICON_GROUP_VERTEX, - ICON_GROUP_VCOL, - ICON_GROUP_UVS, - ICON_BLANK089, - ICON_BLANK090, - ICON_RNA, - ICON_BLANK090b, - - /* available */ - ICON_BLANK092, - ICON_BLANK093, - ICON_BLANK094, - ICON_BLANK095, - ICON_BLANK096, - ICON_BLANK097, - ICON_BLANK098, - ICON_BLANK099, - ICON_BLANK100, - ICON_BLANK101, - ICON_BLANK102, - ICON_BLANK103, - ICON_BLANK104, - ICON_BLANK105, - ICON_BLANK106, - ICON_BLANK107, - ICON_BLANK108, - ICON_BLANK109, - ICON_BLANK110, - ICON_BLANK111, - ICON_BLANK112, - ICON_BLANK113, - ICON_BLANK114, - ICON_BLANK115, - ICON_BLANK116, - ICON_BLANK116b, - - /* OUTLINER */ - ICON_OUTLINER_OB_EMPTY, - ICON_OUTLINER_OB_MESH, - ICON_OUTLINER_OB_CURVE, - ICON_OUTLINER_OB_LATTICE, - ICON_OUTLINER_OB_META, - ICON_OUTLINER_OB_LAMP, - ICON_OUTLINER_OB_CAMERA, - ICON_OUTLINER_OB_ARMATURE, - ICON_OUTLINER_OB_FONT, - ICON_OUTLINER_OB_SURFACE, - ICON_BLANK119, - ICON_BLANK120, - ICON_BLANK121, - ICON_BLANK122, - ICON_BLANK123, - ICON_BLANK124, - ICON_BLANK125, - ICON_BLANK126, - ICON_BLANK127, - ICON_RESTRICT_VIEW_OFF, - ICON_RESTRICT_VIEW_ON, - ICON_RESTRICT_SELECT_OFF, - ICON_RESTRICT_SELECT_ON, - ICON_RESTRICT_RENDER_OFF, - ICON_RESTRICT_RENDER_ON, - ICON_BLANK127b, - - /* OUTLINER */ - ICON_OUTLINER_DATA_EMPTY, - ICON_OUTLINER_DATA_MESH, - ICON_OUTLINER_DATA_CURVE, - ICON_OUTLINER_DATA_LATTICE, - ICON_OUTLINER_DATA_META, - ICON_OUTLINER_DATA_LAMP, - ICON_OUTLINER_DATA_CAMERA, - ICON_OUTLINER_DATA_ARMATURE, - ICON_OUTLINER_DATA_FONT, - ICON_OUTLINER_DATA_SURFACE, - ICON_OUTLINER_DATA_POSE, - ICON_BLANK129, - ICON_BLANK130, - ICON_BLANK131, - ICON_BLANK132, - ICON_BLANK133, - ICON_BLANK134, - ICON_BLANK135, - ICON_BLANK136, - ICON_BLANK137, - ICON_BLANK138, - ICON_BLANK139, - ICON_BLANK140, - ICON_BLANK141, - ICON_BLANK142, - ICON_BLANK142b, - - /* PRIMITIVES */ - ICON_MESH_PLANE, - ICON_MESH_CUBE, - ICON_MESH_CIRCLE, - ICON_MESH_UVSPHERE, - ICON_MESH_ICOSPHERE, - ICON_MESH_GRID, - ICON_MESH_MONKEY, - ICON_MESH_TUBE, - ICON_MESH_DONUT, - ICON_MESH_CONE, - ICON_BLANK610, - ICON_BLANK611, - ICON_LAMP_POINT, - ICON_LAMP_SUN, - ICON_LAMP_SPOT, - ICON_LAMP_HEMI, - ICON_LAMP_AREA, - ICON_BLANK617, - ICON_BLANK618, - ICON_BLANK619, - ICON_META_PLANE, - ICON_META_CUBE, - ICON_META_BALL, - ICON_META_ELLIPSOID, - ICON_META_TUBE, - ICON_BLANK625, - - /* PRIMITIVES */ - ICON_SURFACE_NCURVE, - ICON_SURFACE_NCIRCLE, - ICON_SURFACE_NSURFACE, - ICON_SURFACE_NTUBE, - ICON_SURFACE_NSPHERE, - ICON_SURFACE_NDONUT, - ICON_BLANK636, - ICON_BLANK637, - ICON_BLANK638, - ICON_CURVE_BEZCURVE, - ICON_CURVE_BEZCIRCLE, - ICON_CURVE_NCURVE, - ICON_CURVE_NCIRCLE, - ICON_CURVE_PATH, - ICON_BLANK644, - ICON_BLANK645, - ICON_BLANK646, - ICON_BLANK647, - ICON_BLANK648, - ICON_BLANK649, - ICON_BLANK650, - ICON_BLANK651, - ICON_BLANK652, - ICON_BLANK653, - ICON_BLANK654, - ICON_BLANK655, - - /* EMPTY */ - ICON_BLANK660, - ICON_BLANK661, - ICON_BLANK662, - ICON_BLANK663, - ICON_BLANK664, - ICON_BLANK665, - ICON_BLANK666, - ICON_BLANK667, - ICON_BLANK668, - ICON_BLANK669, - ICON_BLANK670, - ICON_BLANK671, - ICON_BLANK672, - ICON_BLANK673, - ICON_BLANK674, - ICON_BLANK675, - ICON_BLANK676, - ICON_BLANK677, - ICON_BLANK678, - ICON_BLANK679, - ICON_BLANK680, - ICON_BLANK681, - ICON_BLANK682, - ICON_BLANK683, - ICON_BLANK684, - ICON_BLANK685, - - /* EMPTY */ - ICON_BLANK690, - ICON_BLANK691, - ICON_BLANK692, - ICON_BLANK693, - ICON_BLANK694, - ICON_BLANK695, - ICON_BLANK696, - ICON_BLANK697, - ICON_BLANK698, - ICON_BLANK699, - ICON_BLANK700, - ICON_BLANK701, - ICON_BLANK702, - ICON_BLANK703, - ICON_BLANK704, - ICON_BLANK705, - ICON_BLANK706, - ICON_BLANK707, - ICON_BLANK708, - ICON_BLANK709, - ICON_BLANK710, - ICON_BLANK711, - ICON_BLANK712, - ICON_BLANK713, - ICON_BLANK714, - ICON_BLANK715, - - /* EMPTY */ - ICON_BLANK720, - ICON_BLANK721, - ICON_BLANK722, - ICON_BLANK733, - ICON_BLANK734, - ICON_BLANK735, - ICON_BLANK736, - ICON_BLANK737, - ICON_BLANK738, - ICON_BLANK739, - ICON_BLANK740, - ICON_BLANK741, - ICON_BLANK742, - ICON_BLANK743, - ICON_BLANK744, - ICON_BLANK745, - ICON_BLANK746, - ICON_BLANK747, - ICON_BLANK748, - ICON_BLANK749, - ICON_BLANK750, - ICON_BLANK751, - ICON_BLANK752, - ICON_BLANK753, - ICON_BLANK754, - ICON_BLANK755, - - /* EMPTY */ - ICON_BLANK760, - ICON_BLANK761, - ICON_BLANK762, - ICON_BLANK763, - ICON_BLANK764, - ICON_BLANK765, - ICON_BLANK766, - ICON_BLANK767, - ICON_BLANK768, - ICON_BLANK769, - ICON_BLANK770, - ICON_BLANK771, - ICON_BLANK772, - ICON_BLANK773, - ICON_BLANK774, - ICON_BLANK775, - ICON_BLANK776, - ICON_BLANK777, - ICON_BLANK778, - ICON_BLANK779, - ICON_BLANK780, - ICON_BLANK781, - ICON_BLANK782, - ICON_BLANK783, - ICON_BLANK784, - ICON_BLANK785, - - /* MODIFIERS */ - ICON_MODIFIER, - ICON_MOD_WAVE, - ICON_MOD_BUILD, - ICON_MOD_DECIM, - ICON_MOD_MIRROR, - ICON_MOD_SOFT, - ICON_MOD_SUBSURF, - ICON_HOOK, - ICON_MOD_PHYSICS, - ICON_MOD_PARTICLES, - ICON_MOD_BOOLEAN, - ICON_MOD_EDGESPLIT, - ICON_MOD_ARRAY, - ICON_MOD_UVPROJECT, - ICON_MOD_DISPLACE, - ICON_MOD_CURVE, - ICON_MOD_LATTICE, - ICON_BLANK143, - ICON_MOD_ARMATURE, - ICON_MOD_SHRINKWRAP, - ICON_MOD_CAST, - ICON_MOD_MESHDEFORM, - ICON_MOD_BEVEL, - ICON_MOD_SMOOTH, - ICON_MOD_SIMPLEDEFORM, - ICON_MOD_MASK, - - /* MODIFIERS */ - ICON_MOD_CLOTH, - ICON_MOD_EXPLODE, - ICON_MOD_FLUIDSIM, - ICON_MOD_MULTIRES, - ICON_BLANK157, - ICON_BLANK158, - ICON_BLANK159, - ICON_BLANK160, - ICON_BLANK161, - ICON_BLANK162, - ICON_BLANK163, - ICON_BLANK164, - ICON_BLANK165, - ICON_BLANK166, - ICON_BLANK167, - ICON_BLANK168, - ICON_BLANK169, - ICON_BLANK170, - ICON_BLANK171, - ICON_BLANK172, - ICON_BLANK173, - ICON_BLANK174, - ICON_BLANK175, - ICON_BLANK176, - ICON_BLANK177, - ICON_BLANK177b, - - /* ANIMATION */ - ICON_REC, - ICON_PLAY, - ICON_FF, - ICON_REW, - ICON_PAUSE, - ICON_PREV_KEYFRAME, - ICON_NEXT_KEYFRAME, - ICON_PLAY_AUDIO, - ICON_BLANK178, - ICON_BLANK179, - ICON_BLANK180, - ICON_PMARKER_ACT, - ICON_PMARKER_SEL, - ICON_PMARKER, - ICON_MARKER_HLT, - ICON_MARKER, - ICON_SPACE2, // XXX - ICON_SPACE3, // XXX - ICON_BLANK181, - ICON_KEY_DEHLT, - ICON_KEY_HLT, - ICON_MUTE_IPO_OFF, - ICON_MUTE_IPO_ON, - ICON_BLANK182, - ICON_BLANK183, - ICON_BLANK183b, - - /* available */ - ICON_BLANK184, - ICON_BLANK185, - ICON_BLANK186, - ICON_BLANK187, - ICON_BLANK188, - ICON_BLANK189, - ICON_BLANK190, - ICON_BLANK191, - ICON_BLANK192, - ICON_BLANK193, - ICON_BLANK194, - ICON_BLANK195, - ICON_BLANK196, - ICON_BLANK197, - ICON_BLANK198, - ICON_BLANK199, - ICON_BLANK200, - ICON_BLANK201, - ICON_BLANK202, - ICON_BLANK203, - ICON_BLANK204, - ICON_BLANK205, - ICON_BLANK206, - ICON_BLANK207, - ICON_BLANK208, - ICON_BLANK208b, - - /* EDITING */ - ICON_VERTEXSEL, - ICON_EDGESEL, - ICON_FACESEL, - ICON_LINKEDSEL, - ICON_BLANK210, - ICON_ROTATE, - ICON_CURSOR, - ICON_ROTATECOLLECTION, - ICON_ROTATECENTER, - ICON_ROTACTIVE, - ICON_ALIGN, - ICON_BLANK211, - ICON_SMOOTHCURVE, - ICON_SPHERECURVE, - ICON_ROOTCURVE, - ICON_SHARPCURVE, - ICON_LINCURVE, - ICON_NOCURVE, - ICON_RNDCURVE, - ICON_PROP_OFF, - ICON_PROP_ON, - ICON_PROP_CON, - ICON_BLANK212, - ICON_BLANK213, - ICON_BLANK214, - ICON_BLANK214b, - - /* EDITING */ - ICON_MAN_TRANS, - ICON_MAN_ROT, - ICON_MAN_SCALE, - ICON_MANIPUL, - ICON_BLANK215, - ICON_SNAP_GEAR, - ICON_SNAP_GEO, - ICON_SNAP_NORMAL, - ICON_SNAP_VERTEX, - ICON_SNAP_EDGE, - ICON_SNAP_FACE, - ICON_SNAP_VOLUME, - ICON_STICKY_UVS_LOC, - ICON_STICKY_UVS_DISABLE, - ICON_STICKY_UVS_VERT, - ICON_CLIPUV_DEHLT, - ICON_CLIPUV_HLT, - ICON_BLANK219, - ICON_SNAP_PEEL_OBJECT, - ICON_BLANK221, - ICON_GRID, - ICON_GEARS, - ICON_BLANK224, - ICON_BLANK225, - ICON_BLANK226, - ICON_BLANK226b, - - /* EDITING */ - ICON_PASTEDOWN, - ICON_COPYDOWN, - ICON_PASTEFLIPUP, - ICON_PASTEFLIPDOWN, - ICON_BLANK227, - ICON_BLANK228, - ICON_BLANK229, - ICON_BLANK230, - ICON_BLANK231, - ICON_BLANK232, - ICON_BLANK233, - ICON_BLANK234, - ICON_BLANK235, - ICON_BLANK236, - ICON_BLANK237, - ICON_BLANK238, - ICON_BLANK239, - ICON_BLANK240, - ICON_BLANK241, - ICON_BLANK242, - ICON_BLANK243, - ICON_BLANK244, - ICON_BLANK245, - ICON_BLANK246, - ICON_BLANK247, - ICON_BLANK247b, - - /* 3D VIEW */ - ICON_BBOX, - ICON_WIRE, - ICON_SOLID, - ICON_SMOOTH, - ICON_POTATO, - ICON_BLANK248, - ICON_ORTHO, - ICON_BLANK249, - ICON_CAMERA, - ICON_LOCKVIEW_OFF, - ICON_LOCKVIEW_ON, - ICON_BLANK250, - ICON_AXIS_SIDE, - ICON_AXIS_FRONT, - ICON_AXIS_TOP, - ICON_NDOF_DOM, - ICON_NDOF_TURN, - ICON_NDOF_FLY, - ICON_NDOF_TRANS, - ICON_LAYER_USED, - ICON_LAYER_ACTIVE, - ICON_BLANK254, - ICON_BLANK255, - ICON_BLANK256, - ICON_BLANK257, - ICON_BLANK257b, - - /* available */ - ICON_BLANK258, - ICON_BLANK259, - ICON_BLANK260, - ICON_BLANK261, - ICON_BLANK262, - ICON_BLANK263, - ICON_BLANK264, - ICON_BLANK265, - ICON_BLANK266, - ICON_BLANK267, - ICON_BLANK268, - ICON_BLANK269, - ICON_BLANK270, - ICON_BLANK271, - ICON_BLANK272, - ICON_BLANK273, - ICON_BLANK274, - ICON_BLANK275, - ICON_BLANK276, - ICON_BLANK277, - ICON_BLANK278, - ICON_BLANK279, - ICON_BLANK280, - ICON_BLANK281, - ICON_BLANK282, - ICON_BLANK282b, - - /* FILE SELECT */ - ICON_SORTALPHA, - ICON_SORTBYEXT, - ICON_SORTTIME, - ICON_SORTSIZE, - ICON_LONGDISPLAY, - ICON_SHORTDISPLAY, - ICON_GHOST, - ICON_IMGDISPLAY, - ICON_BLANK284, - ICON_BLANK285, - ICON_BOOKMARKS, - ICON_FONTPREVIEW, - ICON_FILTER, - ICON_NEWFOLDER, - ICON_BLANK285F, - ICON_FILE_PARENT, - ICON_FILE_REFRESH, - ICON_FILE_FOLDER, - ICON_FILE_BLANK, - ICON_FILE_BLEND, - ICON_FILE_IMAGE, - ICON_FILE_MOVIE, - ICON_FILE_SCRIPT, - ICON_FILE_SOUND, - ICON_FILE_FONT, - ICON_BLANK291b, - - /* available */ - ICON_BLANK292, - ICON_BLANK293, - ICON_BLANK294, - ICON_BLANK295, - ICON_BLANK296, - ICON_BLANK297, - ICON_BLANK298, - ICON_BLANK299, - ICON_BLANK300, - ICON_BLANK301, - ICON_BLANK302, - ICON_BLANK303, - ICON_BLANK304, - ICON_BLANK305, - ICON_BLANK306, - ICON_BLANK307, - ICON_BLANK308, - ICON_BLANK309, - ICON_BLANK310, - ICON_BLANK311, - ICON_BLANK312, - ICON_BLANK313, - ICON_BLANK314, - ICON_BLANK315, - ICON_BLANK316, - ICON_DISK_DRIVE, - - /* SHADING / TEXT */ - ICON_MATPLANE, - ICON_MATSPHERE, - ICON_MATCUBE, - ICON_MONKEY, - ICON_HAIR, - ICON_RING, - ICON_BLANK317, - ICON_BLANK318, - ICON_BLANK319, - ICON_BLANK320, - ICON_BLANK321, - ICON_BLANK322, - ICON_WORDWRAP_OFF, - ICON_WORDWRAP_ON, - ICON_SYNTAX_OFF, - ICON_SYNTAX_ON, - ICON_LINENUMBERS_OFF, - ICON_LINENUMBERS_ON, - ICON_SCRIPTPLUGINS, // XXX CREATE NEW - ICON_BLANK323, - ICON_BLANK324, - ICON_BLANK325, - ICON_BLANK326, - ICON_BLANK327, - ICON_BLANK328, - ICON_BLANK328b, - - /* SEQUENCE / IMAGE EDITOR */ - ICON_SEQ_SEQUENCER, - ICON_SEQ_PREVIEW, - ICON_SEQ_LUMA_WAVEFORM, - ICON_SEQ_CHROMA_SCOPE, - ICON_SEQ_HISTOGRAM, - ICON_BLANK330, - ICON_BLANK331, - ICON_BLANK332, - ICON_BLANK333, - ICON_IMAGE_RGB, // XXX CHANGE TO STRAIGHT ALPHA, Z ETC - ICON_IMAGE_RGB_ALPHA, - ICON_IMAGE_ALPHA, - ICON_IMAGE_ZDEPTH, - ICON_IMAGEFILE, - ICON_BLANK336, - ICON_BLANK337, - ICON_BLANK338, - ICON_BLANK339, - ICON_BLANK340, - ICON_BLANK341, - ICON_BLANK342, - ICON_BLANK343, - ICON_BLANK344, - ICON_BLANK345, - ICON_BLANK346, - ICON_BLANK346b, - - /* vector icons */ - - VICON_VIEW3D, - VICON_EDIT, - VICON_EDITMODE_DEHLT, - VICON_EDITMODE_HLT, - VICON_DISCLOSURE_TRI_RIGHT, - VICON_DISCLOSURE_TRI_DOWN, - VICON_MOVE_UP, - VICON_MOVE_DOWN, - VICON_X - -#define BIFICONID_LAST (VICON_X) +#include "UI_icons.h" + BIFICONID_LAST #define BIFNICONIDS (BIFICONID_LAST-BIFICONID_FIRST + 1) } BIFIconID; +#undef DEF_ICON typedef enum { diff --git a/source/blender/editors/interface/interface_api.c b/source/blender/editors/interface/interface_api.c index b4e7dc03506..7b2cdbe32dd 100644 --- a/source/blender/editors/interface/interface_api.c +++ b/source/blender/editors/interface/interface_api.c @@ -33,11 +33,24 @@ #include "RNA_types.h" #include "UI_interface.h" +#include "UI_resources.h" + +#define DEF_ICON(name) {name, #name, #name, ""}, +static EnumPropertyItem icon_items[] = { +#include "UI_icons.h" + {0, NULL, NULL, NULL}}; +#undef DEF_ICON static void api_ui_item_common(FunctionRNA *func) { + PropertyRNA *prop; + RNA_def_string(func, "text", "", 0, "", "Override automatic text of the item."); - RNA_def_int(func, "icon", 0, 0, INT_MAX, "", "Override automatic icon of the item.", 0, INT_MAX); + + prop= RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, icon_items); + RNA_def_property_ui_text(prop, "Icon", "Override automatic icon of the item."); + } static void api_ui_item_op_common(FunctionRNA *func) diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 1cb58c986d0..edf2f160285 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -75,7 +75,7 @@ static int theme_regionid= RGN_TYPE_WINDOW; void ui_resources_init(void) { - UI_icons_init(BIFICONID_LAST+1); + UI_icons_init(BIFICONID_LAST); } void ui_resources_free(void) -- cgit v1.2.3 From 51fbc95e8c8699cd9ba2f7b1958df7270851af39 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Jun 2009 00:52:21 +0000 Subject: RNA * Added icon to property and enum property items. The latter is responsible for the large number of files changed. * For RNA functions, added PROP_RNAPTR flag to ask for a PointerRNA as argument instead of a C pointer, instead of doing it implicitly with the AnyType type. * Material: properly wrap diffuse/specular param variables, and rename some things for consistency. * MaterialTextureSlot: added "enabled" property (ma->septex). * Image: make animated property editable. * Image Editor: make some things editable, notifiers, respect state. * Context: fix issue with screen not being set as ID. --- source/blender/blenkernel/intern/ipo.c | 2 +- source/blender/editors/animation/anim_channels.c | 14 +- source/blender/editors/animation/keyingsets.c | 8 +- source/blender/editors/armature/editarmature.c | 30 +- source/blender/editors/armature/poseobject.c | 6 +- source/blender/editors/curve/editcurve.c | 38 +-- source/blender/editors/curve/editfont.c | 50 ++-- source/blender/editors/interface/interface_api.c | 62 ++-- source/blender/editors/mesh/editmesh.c | 8 +- source/blender/editors/mesh/editmesh_loop.c | 8 +- source/blender/editors/mesh/editmesh_mods.c | 46 +-- source/blender/editors/mesh/editmesh_tools.c | 26 +- source/blender/editors/object/object_edit.c | 144 +++++----- source/blender/editors/physics/editparticle.c | 22 +- source/blender/editors/screen/screen_ops.c | 6 +- source/blender/editors/sculpt_paint/sculpt.c | 8 +- source/blender/editors/space_action/action_edit.c | 34 +-- .../blender/editors/space_action/action_select.c | 20 +- source/blender/editors/space_graph/graph_edit.c | 28 +- source/blender/editors/space_graph/graph_select.c | 20 +- source/blender/editors/space_image/image_ops.c | 6 +- source/blender/editors/space_node/node_select.c | 10 +- .../editors/space_sequencer/sequencer_edit.c | 50 ++-- source/blender/editors/space_text/text_ops.c | 52 ++-- source/blender/editors/space_view3d/view3d_edit.c | 36 +-- .../blender/editors/space_view3d/view3d_select.c | 12 +- source/blender/editors/transform/transform_ops.c | 100 +++---- source/blender/editors/uvedit/uvedit_ops.c | 28 +- source/blender/editors/uvedit/uvedit_unwrap_ops.c | 20 +- source/blender/makesrna/RNA_access.h | 3 + source/blender/makesrna/RNA_define.h | 1 + source/blender/makesrna/RNA_types.h | 5 + source/blender/makesrna/SConscript | 2 +- source/blender/makesrna/intern/CMakeLists.txt | 2 +- source/blender/makesrna/intern/Makefile | 1 + source/blender/makesrna/intern/SConscript | 4 + source/blender/makesrna/intern/makesrna.c | 8 +- source/blender/makesrna/intern/rna_access.c | 9 +- source/blender/makesrna/intern/rna_actuator.c | 38 +-- source/blender/makesrna/intern/rna_animation.c | 10 +- source/blender/makesrna/intern/rna_armature.c | 18 +- source/blender/makesrna/intern/rna_brush.c | 42 +-- source/blender/makesrna/intern/rna_camera.c | 12 +- source/blender/makesrna/intern/rna_color.c | 12 +- source/blender/makesrna/intern/rna_constraint.c | 228 +++++++-------- source/blender/makesrna/intern/rna_context.c | 16 +- source/blender/makesrna/intern/rna_controller.c | 18 +- source/blender/makesrna/intern/rna_curve.c | 42 +-- source/blender/makesrna/intern/rna_define.c | 13 +- source/blender/makesrna/intern/rna_fcurve.c | 82 +++--- source/blender/makesrna/intern/rna_fluidsim.c | 52 ++-- source/blender/makesrna/intern/rna_image.c | 56 ++-- .../blender/makesrna/intern/rna_internal_types.h | 2 + source/blender/makesrna/intern/rna_key.c | 8 +- source/blender/makesrna/intern/rna_lamp.c | 132 ++++----- source/blender/makesrna/intern/rna_lattice.c | 8 +- source/blender/makesrna/intern/rna_material.c | 204 ++++++++----- source/blender/makesrna/intern/rna_mesh.c | 14 +- source/blender/makesrna/intern/rna_meta.c | 22 +- source/blender/makesrna/intern/rna_modifier.c | 176 ++++++------ source/blender/makesrna/intern/rna_nodetree.c | 254 +++++++++-------- source/blender/makesrna/intern/rna_object.c | 150 +++++----- source/blender/makesrna/intern/rna_object_force.c | 38 +-- source/blender/makesrna/intern/rna_particle.c | 216 +++++++------- source/blender/makesrna/intern/rna_pose.c | 6 +- source/blender/makesrna/intern/rna_property.c | 12 +- source/blender/makesrna/intern/rna_radio.c | 8 +- source/blender/makesrna/intern/rna_rna.c | 38 +-- source/blender/makesrna/intern/rna_scene.c | 238 ++++++++-------- source/blender/makesrna/intern/rna_screen.c | 12 +- source/blender/makesrna/intern/rna_sensor.c | 118 ++++---- source/blender/makesrna/intern/rna_sequence.c | 102 +++---- source/blender/makesrna/intern/rna_sound.c | 22 +- source/blender/makesrna/intern/rna_space.c | 317 ++++++++++++++------- source/blender/makesrna/intern/rna_texture.c | 228 +++++++-------- source/blender/makesrna/intern/rna_ui.c | 32 +-- source/blender/makesrna/intern/rna_userdef.c | 128 ++++----- source/blender/makesrna/intern/rna_vpaint.c | 16 +- source/blender/makesrna/intern/rna_world.c | 66 ++--- source/blender/python/intern/bpy_rna.c | 7 +- source/blender/windowmanager/intern/wm_operators.c | 20 +- 81 files changed, 2190 insertions(+), 1972 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 8cbf25eaeed..e4c366dd3d7 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -545,7 +545,7 @@ static char *material_adrcodes_to_paths (int adrcode, int *array_index) return "ambient"; case MA_SPEC: - return "specularity"; + return "specular_reflection"; case MA_HARD: return "specular_hardness"; diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index 9e0e50a8de5..c52ade1bba8 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -721,17 +721,17 @@ enum { /* defines for setting animation-channel flags */ EnumPropertyItem prop_animchannel_setflag_types[] = { - {ACHANNEL_SETFLAG_CLEAR, "DISABLE", "Disable", ""}, - {ACHANNEL_SETFLAG_ADD, "ENABLE", "Enable", ""}, - {ACHANNEL_SETFLAG_TOGGLE, "TOGGLE", "Toggle", ""}, - {0, NULL, NULL, NULL} + {ACHANNEL_SETFLAG_CLEAR, "DISABLE", 0, "Disable", ""}, + {ACHANNEL_SETFLAG_ADD, "ENABLE", 0, "Enable", ""}, + {ACHANNEL_SETFLAG_TOGGLE, "TOGGLE", 0, "Toggle", ""}, + {0, NULL, 0, NULL, NULL} }; /* defines for set animation-channel settings */ EnumPropertyItem prop_animchannel_settings_types[] = { - {ACHANNEL_SETTING_PROTECT, "PROTECT", "Protect", ""}, - {ACHANNEL_SETTING_MUTE, "MUTE", "Mute", ""}, - {0, NULL, NULL, NULL} + {ACHANNEL_SETTING_PROTECT, "PROTECT", 0, "Protect", ""}, + {ACHANNEL_SETTING_MUTE, "MUTE", 0, "Mute", ""}, + {0, NULL, 0, NULL, NULL} }; diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 0f5cef51bdb..1813c76d0c4 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -106,10 +106,10 @@ void ANIM_OT_keyingset_add_destination (wmOperatorType *ot) { // XXX: this is also defined in rna_animation.c static EnumPropertyItem prop_mode_grouping_items[] = { - {KSP_GROUP_NAMED, "NAMED", "Named Group", ""}, - {KSP_GROUP_NONE, "NONE", "None", ""}, - {KSP_GROUP_KSNAME, "KEYINGSET", "Keying Set Name", ""}, - {0, NULL, NULL, NULL}}; + {KSP_GROUP_NAMED, "NAMED", 0, "Named Group", ""}, + {KSP_GROUP_NONE, "NONE", 0, "None", ""}, + {KSP_GROUP_KSNAME, "KEYINGSET", 0, "Keying Set Name", ""}, + {0, NULL, 0, NULL, NULL}}; /* identifiers */ ot->name= "Add Keying Set Destination"; diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 9c9be51f010..7155bdd6850 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -1957,9 +1957,9 @@ void auto_align_ebone_tocursor(Scene *scene, View3D *v3d, EditBone *ebone) static EnumPropertyItem prop_calc_roll_types[] = { - {0, "GLOBALUP", "Z-Axis Up", ""}, - {1, "CURSOR", "Z-Axis to Cursor", ""}, - {0, NULL, NULL, NULL} + {0, "GLOBALUP", 0, "Z-Axis Up", ""}, + {1, "CURSOR", 0, "Z-Axis to Cursor", ""}, + {0, NULL, 0, NULL, NULL} }; static int armature_calc_roll_exec(bContext *C, wmOperator *op) @@ -3489,9 +3489,9 @@ static int armature_subdivs_exec(bContext *C, wmOperator *op) void ARMATURE_OT_subdivs(wmOperatorType *ot) { static EnumPropertyItem type_items[]= { - {0, "SIMPLE", "Simple", ""}, - {1, "MULTI", "Multi", ""}, - {0, NULL, NULL}}; + {0, "SIMPLE", 0, "Simple", ""}, + {1, "MULTI", 0, "Multi", ""}, + {0, NULL, 0, NULL, NULL}}; /* identifiers */ ot->name= "subdivs"; @@ -3669,9 +3669,9 @@ static void bone_connect_to_new_parent(ListBase *edbo, EditBone *selbone, EditBo } static EnumPropertyItem prop_editarm_make_parent_types[] = { - {ARM_PAR_CONNECT, "CONNECTED", "Connected", ""}, - {ARM_PAR_OFFSET, "OFFSET", "Keep Offset", ""}, - {0, NULL, NULL, NULL} + {ARM_PAR_CONNECT, "CONNECTED", 0, "Connected", ""}, + {ARM_PAR_OFFSET, "OFFSET", 0, "Keep Offset", ""}, + {0, NULL, 0, NULL, NULL} }; static int armature_parent_set_exec(bContext *C, wmOperator *op) @@ -3785,9 +3785,9 @@ void ARMATURE_OT_parent_set(wmOperatorType *ot) } static EnumPropertyItem prop_editarm_clear_parent_types[] = { - {1, "CLEAR", "Clear Parent", ""}, - {2, "DISCONNECT", "Disconnect Bone", ""}, - {0, NULL, NULL, NULL} + {1, "CLEAR", 0, "Clear Parent", ""}, + {2, "DISCONNECT", 0, "Disconnect Bone", ""}, + {0, NULL, 0, NULL, NULL} }; static void editbone_clear_parent(EditBone *ebone, int mode) @@ -3973,9 +3973,9 @@ static int armature_select_hierarchy_exec(bContext *C, wmOperator *op) void ARMATURE_OT_select_hierarchy(wmOperatorType *ot) { static EnumPropertyItem direction_items[]= { - {BONE_SELECT_PARENT, "PARENT", "Select Parent", ""}, - {BONE_SELECT_CHILD, "CHILD", "Select Child", ""}, - {0, NULL, NULL, NULL} + {BONE_SELECT_PARENT, "PARENT", 0, "Select Parent", ""}, + {BONE_SELECT_CHILD, "CHILD", 0, "Select Child", ""}, + {0, NULL, 0, NULL, NULL} }; /* identifiers */ diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 0d7bb3c63cc..281f314a546 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -500,9 +500,9 @@ static int pose_select_hierarchy_exec(bContext *C, wmOperator *op) void POSE_OT_select_hierarchy(wmOperatorType *ot) { static EnumPropertyItem direction_items[]= { - {BONE_SELECT_PARENT, "PARENT", "Select Parent", ""}, - {BONE_SELECT_CHILD, "CHILD", "Select Child", ""}, - {0, NULL, NULL, NULL} + {BONE_SELECT_PARENT, "PARENT", 0, "Select Parent", ""}, + {BONE_SELECT_CHILD, "CHILD", 0, "Select Child", ""}, + {0, NULL, 0, NULL, NULL} }; /* identifiers */ diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 45b9a589bd5..466908c562c 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -2475,12 +2475,12 @@ static int set_spline_type_exec(bContext *C, wmOperator *op) void CURVE_OT_spline_type_set(wmOperatorType *ot) { static EnumPropertyItem type_items[]= { - {CU_POLY, "POLY", "Poly", ""}, - {CU_BEZIER, "BEZIER", "Bezier", ""}, - {CU_CARDINAL, "CARDINAL", "Cardinal", ""}, - {CU_BSPLINE, "B_SPLINE", "B-Spline", ""}, - {CU_NURBS, "NURBS", "NURBS", ""}, - {0, NULL, NULL, NULL}}; + {CU_POLY, "POLY", 0, "Poly", ""}, + {CU_BEZIER, "BEZIER", 0, "Bezier", ""}, + {CU_CARDINAL, "CARDINAL", 0, "Cardinal", ""}, + {CU_BSPLINE, "B_SPLINE", 0, "B-Spline", ""}, + {CU_NURBS, "NURBS", 0, "NURBS", ""}, + {0, NULL, 0, NULL, NULL}}; /* identifiers */ ot->name= "Set Spline Type"; @@ -2516,12 +2516,12 @@ static int set_handle_type_exec(bContext *C, wmOperator *op) void CURVE_OT_handle_type_set(wmOperatorType *ot) { static EnumPropertyItem type_items[]= { - {1, "AUTOMATIC", "Automatic", ""}, - {2, "VECTOR", "Vector", ""}, - {3, "TOGGLE_FREE_ALIGN", "Toggle Free/Align", ""}, - {5, "ALIGN", "Align", ""}, - {6, "FREE_ALIGN", "Free Align", ""}, - {0, NULL, NULL, NULL}}; + {1, "AUTOMATIC", 0, "Automatic", ""}, + {2, "VECTOR", 0, "Vector", ""}, + {3, "TOGGLE_FREE_ALIGN", 0, "Toggle Free/Align", ""}, + {5, "ALIGN", 0, "Align", ""}, + {6, "FREE_ALIGN", 0, "Free Align", ""}, + {0, NULL, 0, NULL, NULL}}; /* identifiers */ ot->name= "Set Handle Type"; @@ -3582,9 +3582,9 @@ static int toggle_cyclic_invoke(bContext *C, wmOperator *op, wmEvent *event) void CURVE_OT_cyclic_toggle(wmOperatorType *ot) { static EnumPropertyItem direction_items[]= { - {0, "CYCLIC_U", "Cyclic U", ""}, - {1, "CYCLIC_V", "Cyclic V", ""}, - {0, NULL, NULL, NULL}}; + {0, "CYCLIC_U", 0, "Cyclic U", ""}, + {1, "CYCLIC_V", 0, "Cyclic V", ""}, + {0, NULL, 0, NULL, NULL}}; /* identifiers */ ot->name= "Toggle Cyclic"; @@ -4530,10 +4530,10 @@ static int delete_invoke(bContext *C, wmOperator *op, wmEvent *event) void CURVE_OT_delete(wmOperatorType *ot) { static EnumPropertyItem type_items[] = { - {0, "SELECTED", "Selected", ""}, - {1, "SEGMENT", "Segment", ""}, - {2, "ALL", "All", ""}, - {0, NULL, NULL, NULL}}; + {0, "SELECTED", 0, "Selected", ""}, + {1, "SEGMENT", 0, "Segment", ""}, + {2, "ALL", 0, "All", ""}, + {0, NULL, 0, NULL, NULL}}; /* identifiers */ ot->name= "Delete"; diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 0fb6fb8cb90..5389db9e2ee 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -607,10 +607,10 @@ static int kill_selection(Object *obedit, int ins) /* 1 == new character */ /******************* set style operator ********************/ static EnumPropertyItem style_items[]= { - {CU_BOLD, "BOLD", "Bold", ""}, - {CU_ITALIC, "ITALIC", "Italic", ""}, - {CU_UNDERLINE, "UNDERLINE", "Underline", ""}, - {0, NULL, NULL, NULL}}; + {CU_BOLD, "BOLD", 0, "Bold", ""}, + {CU_ITALIC, "ITALIC", 0, "Italic", ""}, + {CU_UNDERLINE, "UNDERLINE", 0, "Underline", ""}, + {0, NULL, 0, NULL, NULL}}; static int set_style(bContext *C, int style, int clear) { @@ -873,17 +873,17 @@ void FONT_OT_text_paste(wmOperatorType *ot) /************************ move operator ************************/ static EnumPropertyItem move_type_items[]= { - {LINE_BEGIN, "LINE_BEGIN", "Line Begin", ""}, - {LINE_END, "LINE_END", "Line End", ""}, - {PREV_CHAR, "PREVIOUS_CHARACTER", "Previous Character", ""}, - {NEXT_CHAR, "NEXT_CHARACTER", "Next Character", ""}, - {PREV_WORD, "PREVIOUS_WORD", "Previous Word", ""}, - {NEXT_WORD, "NEXT_WORD", "Next Word", ""}, - {PREV_LINE, "PREVIOUS_LINE", "Previous Line", ""}, - {NEXT_LINE, "NEXT_LINE", "Next Line", ""}, - {PREV_PAGE, "PREVIOUS_PAGE", "Previous Page", ""}, - {NEXT_PAGE, "NEXT_PAGE", "Next Page", ""}, - {0, NULL, NULL, NULL}}; + {LINE_BEGIN, "LINE_BEGIN", 0, "Line Begin", ""}, + {LINE_END, "LINE_END", 0, "Line End", ""}, + {PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""}, + {NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""}, + {PREV_WORD, "PREVIOUS_WORD", 0, "Previous Word", ""}, + {NEXT_WORD, "NEXT_WORD", 0, "Next Word", ""}, + {PREV_LINE, "PREVIOUS_LINE", 0, "Previous Line", ""}, + {NEXT_LINE, "NEXT_LINE", 0, "Next Line", ""}, + {PREV_PAGE, "PREVIOUS_PAGE", 0, "Previous Page", ""}, + {NEXT_PAGE, "NEXT_PAGE", 0, "Next Page", ""}, + {0, NULL, 0, NULL, NULL}}; static int move_cursor(bContext *C, int type, int select) { @@ -1164,13 +1164,13 @@ void FONT_OT_line_break(wmOperatorType *ot) /******************* delete operator **********************/ static EnumPropertyItem delete_type_items[]= { - {DEL_ALL, "ALL", "All", ""}, - {DEL_NEXT_CHAR, "NEXT_CHARACTER", "Next Character", ""}, - {DEL_PREV_CHAR, "PREVIOUS_CHARACTER", "Previous Character", ""}, - {DEL_SELECTION, "SELECTION", "Selection", ""}, - {DEL_NEXT_SEL, "NEXT_OR_SELECTION", "Next or Selection", ""}, - {DEL_PREV_SEL, "PREVIOUS_OR_SELECTION", "Previous or Selection", ""}, - {0, NULL, NULL, NULL}}; + {DEL_ALL, "ALL", 0, "All", ""}, + {DEL_NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""}, + {DEL_PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""}, + {DEL_SELECTION, "SELECTION", 0, "Selection", ""}, + {DEL_NEXT_SEL, "NEXT_OR_SELECTION", 0, "Next or Selection", ""}, + {DEL_PREV_SEL, "PREVIOUS_OR_SELECTION", 0, "Previous or Selection", ""}, + {0, NULL, 0, NULL, NULL}}; static int delete_exec(bContext *C, wmOperator *op) { @@ -1465,9 +1465,9 @@ void free_editText(Object *obedit) /********************** set case operator *********************/ static EnumPropertyItem case_items[]= { - {CASE_LOWER, "LOWER", "Lower", ""}, - {CASE_UPPER, "UPPER", "Upper", ""}, - {0, NULL, NULL, NULL}}; + {CASE_LOWER, "LOWER", 0, "Lower", ""}, + {CASE_UPPER, "UPPER", 0, "Upper", ""}, + {0, NULL, 0, NULL, NULL}}; static int set_case(bContext *C, int ccase) { diff --git a/source/blender/editors/interface/interface_api.c b/source/blender/editors/interface/interface_api.c index 7b2cdbe32dd..31b0b85fae6 100644 --- a/source/blender/editors/interface/interface_api.c +++ b/source/blender/editors/interface/interface_api.c @@ -35,10 +35,10 @@ #include "UI_interface.h" #include "UI_resources.h" -#define DEF_ICON(name) {name, #name, #name, ""}, +#define DEF_ICON(name) {name, #name, 0, #name, ""}, static EnumPropertyItem icon_items[] = { #include "UI_icons.h" - {0, NULL, NULL, NULL}}; + {0, NULL, 0, NULL, NULL}}; #undef DEF_ICON static void api_ui_item_common(FunctionRNA *func) @@ -62,16 +62,26 @@ static void api_ui_item_op_common(FunctionRNA *func) RNA_def_property_flag(parm, PROP_REQUIRED); } +static void api_ui_item_rna_common(FunctionRNA *func) +{ + PropertyRNA *parm; + + parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data."); + RNA_def_property_flag(parm, PROP_REQUIRED); +} + void RNA_api_ui_layout(StructRNA *srna) { FunctionRNA *func; PropertyRNA *parm; static EnumPropertyItem curve_type_items[] = { - {0, "NONE", "None", ""}, - {'v', "VECTOR", "Vector", ""}, - {'c', "COLOR", "Color", ""}, - {0, NULL, NULL, NULL}}; + {0, "NONE", 0, "None", ""}, + {'v', "VECTOR", 0, "Vector", ""}, + {'c', "COLOR", 0, "Color", ""}, + {0, NULL, 0, NULL, NULL}}; /* simple layout specifiers */ func= RNA_def_function(srna, "row", "uiLayoutRow"); @@ -104,33 +114,21 @@ void RNA_api_ui_layout(StructRNA *srna) /* items */ func= RNA_def_function(srna, "itemR", "uiItemR"); api_ui_item_common(func); - parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data."); - RNA_def_property_flag(parm, PROP_REQUIRED); + api_ui_item_rna_common(func); RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); RNA_def_boolean(func, "slider", 0, "", "Use slider widget for numeric values."); RNA_def_boolean(func, "toggle", 0, "", "Use toggle widget for boolean values."); func= RNA_def_function(srna, "items_enumR", "uiItemsEnumR"); - parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data."); - RNA_def_property_flag(parm, PROP_REQUIRED); + api_ui_item_rna_common(func); func= RNA_def_function(srna, "item_menu_enumR", "uiItemMenuEnumR"); api_ui_item_common(func); - parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data."); - RNA_def_property_flag(parm, PROP_REQUIRED); + api_ui_item_rna_common(func); /*func= RNA_def_function(srna, "item_enumR", "uiItemEnumR"); api_ui_item_common(func); - parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data."); - RNA_def_property_flag(parm, PROP_REQUIRED); + api_ui_item_rna_common(func); parm= RNA_def_string(func, "value", "", 0, "", "Enum property value."); RNA_def_property_flag(parm, PROP_REQUIRED);*/ @@ -200,7 +198,7 @@ void RNA_api_ui_layout(StructRNA *srna) parm= RNA_def_string(func, "name", "", 0, "Name", "Name of entry in the context."); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context."); - RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); /* templates */ func= RNA_def_function(srna, "template_header", "uiTemplateHeader"); @@ -210,23 +208,20 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "template_ID", "uiTemplateID"); parm= RNA_def_pointer(func, "context", "Context", "", "Current context."); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of pointer property in data."); - RNA_def_property_flag(parm, PROP_REQUIRED); + api_ui_item_rna_common(func); RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block."); RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a new ID block."); RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block."); func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier"); - parm= RNA_def_pointer(func, "data", "AnyType", "", "Modifier data."); - RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "data", "Modifier", "", "Modifier data."); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "template_constraint", "uiTemplateConstraint"); - parm= RNA_def_pointer(func, "data", "AnyType", "", "Constraint data."); - RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "data", "Constraint", "", "Constraint data."); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); RNA_def_function_return(func, parm); @@ -245,9 +240,6 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); func= RNA_def_function(srna, "template_layers", "uiTemplateLayers"); - parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of pointer property in data."); - RNA_def_property_flag(parm, PROP_REQUIRED); + api_ui_item_rna_common(func); } diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index 40373c9f327..dd003d103d5 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1434,10 +1434,10 @@ void remake_editMesh(Scene *scene, Object *ob) /* *************** Operator: separate parts *************/ static EnumPropertyItem prop_separate_types[] = { - {0, "SELECTED", "Selection", ""}, - {1, "MATERIAL", "By Material", ""}, - {2, "LOOSE", "By loose parts", ""}, - {0, NULL, NULL, NULL} + {0, "SELECTED", 0, "Selection", ""}, + {1, "MATERIAL", 0, "By Material", ""}, + {2, "LOOSE", 0, "By loose parts", ""}, + {0, NULL, 0, NULL, NULL} }; /* return 1: success */ diff --git a/source/blender/editors/mesh/editmesh_loop.c b/source/blender/editors/mesh/editmesh_loop.c index d0f7517df78..afbf43c4d85 100644 --- a/source/blender/editors/mesh/editmesh_loop.c +++ b/source/blender/editors/mesh/editmesh_loop.c @@ -458,10 +458,10 @@ typedef struct CutCurve { #define KNIFE_MULTICUT 3 static EnumPropertyItem knife_items[]= { - {KNIFE_EXACT, "EXACT", "Exact", ""}, - {KNIFE_MIDPOINT, "MIDPOINTS", "Midpoints", ""}, - {KNIFE_MULTICUT, "MULTICUT", "Multicut", ""}, - {0, NULL, NULL} + {KNIFE_EXACT, "EXACT", 0, "Exact", ""}, + {KNIFE_MIDPOINT, "MIDPOINTS", 0, "Midpoints", ""}, + {KNIFE_MULTICUT, "MULTICUT", 0, "Multicut", ""}, + {0, NULL, 0, NULL, NULL} }; /* seg_intersect() Determines if and where a mouse trail intersects an EditEdge */ diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index faa3176c958..a1f8b3251c8 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -655,13 +655,13 @@ FACES GROUP */ static EnumPropertyItem prop_simface_types[] = { - {1, "MATERIAL", "Material", ""}, - {2, "IMAGE", "Image", ""}, - {3, "AREA", "Area", ""}, - {4, "PERIMETER", "Perimeter", ""}, - {5, "NORMAL", "Normal", ""}, - {6, "COPLANAR", "Co-planar", ""}, - {0, NULL, NULL, NULL} + {1, "MATERIAL", 0, "Material", ""}, + {2, "IMAGE", 0, "Image", ""}, + {3, "AREA", 0, "Area", ""}, + {4, "PERIMETER", 0, "Perimeter", ""}, + {5, "NORMAL", 0, "Normal", ""}, + {6, "COPLANAR", 0, "Co-planar", ""}, + {0, NULL, 0, NULL, NULL} }; @@ -849,14 +849,14 @@ EDGE GROUP */ static EnumPropertyItem prop_simedge_types[] = { - {1, "LENGTH", "Length", ""}, - {2, "DIR", "Direction", ""}, - {3, "FACE", "Amount of Vertices in Face", ""}, - {4, "FACE_ANGLE", "Face Angles", ""}, - {5, "CREASE", "Crease", ""}, - {6, "SEAM", "Seam", ""}, - {7, "SHARP", "Sharpness", ""}, - {0, NULL, NULL, NULL} + {1, "LENGTH", 0, "Length", ""}, + {2, "DIR", 0, "Direction", ""}, + {3, "FACE", 0, "Amount of Vertices in Face", ""}, + {4, "FACE_ANGLE", 0, "Face Angles", ""}, + {5, "CREASE", 0, "Crease", ""}, + {6, "SEAM", 0, "Seam", ""}, + {7, "SHARP", 0, "Sharpness", ""}, + {0, NULL, 0, NULL, NULL} }; static int similar_edge_select__internal(Scene *scene, EditMesh *em, int mode) @@ -1105,10 +1105,10 @@ VERT GROUP mode 3: same vertex groups */ static EnumPropertyItem prop_simvertex_types[] = { - {0, "NORMAL", "Normal", ""}, - {1, "FACE", "Amount of Vertices in Face", ""}, - {2, "VGROUP", "Vertex Groups", ""}, - {0, NULL, NULL, NULL} + {0, "NORMAL", 0, "Normal", ""}, + {1, "FACE", 0, "Amount of Vertices in Face", ""}, + {2, "VGROUP", 0, "Vertex Groups", ""}, + {0, NULL, 0, NULL, NULL} }; @@ -3537,10 +3537,10 @@ static void mesh_selection_type(Scene *scene, EditMesh *em, int val) } static EnumPropertyItem prop_mesh_edit_types[] = { - {1, "VERT", "Vertices", ""}, - {2, "EDGE", "Edges", ""}, - {3, "FACE", "Faces", ""}, - {0, NULL, NULL, NULL} + {1, "VERT", 0, "Vertices", ""}, + {2, "EDGE", 0, "Edges", ""}, + {3, "FACE", 0, "Faces", ""}, + {0, NULL, 0, NULL, NULL} }; static int mesh_selection_type_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 4fc16297db8..45cf67de17e 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -1273,14 +1273,14 @@ void delete_mesh(Object *obedit, EditMesh *em, wmOperator *op, int event) /* Note, these values must match delete_mesh() event values */ static EnumPropertyItem prop_mesh_delete_types[] = { - {10,"VERT", "Vertices", ""}, - {1, "EDGE", "Edges", ""}, - {2, "FACE", "Faces", ""}, - {3, "ALL", "All", ""}, - {4, "EDGE_FACE","Edges & Faces", ""}, - {5, "ONLY_FACE","Only Faces", ""}, - {6, "EDGE_LOOP","Edge Loop", ""}, - {0, NULL, NULL, NULL} + {10,"VERT", 0, "Vertices", ""}, + {1, "EDGE", 0, "Edges", ""}, + {2, "FACE", 0, "Faces", ""}, + {3, "ALL", 0, "All", ""}, + {4, "EDGE_FACE",0, "Edges & Faces", ""}, + {5, "ONLY_FACE",0, "Only Faces", ""}, + {6, "EDGE_LOOP",0, "Edge Loop", ""}, + {0, NULL, 0, NULL, NULL} }; static int delete_mesh_exec(bContext *C, wmOperator *op) @@ -6646,11 +6646,11 @@ static int subdivs_exec(bContext *C, wmOperator *op) void MESH_OT_subdivs(wmOperatorType *ot) { static EnumPropertyItem type_items[]= { - {0, "SIMPLE", "Simple", ""}, - {1, "MULTI", "Multi", ""}, - {2, "FRACTAL", "Fractal", ""}, - {3, "SMOOTH", "Smooth", ""}, - {0, NULL, NULL}}; + {0, "SIMPLE", 0, "Simple", ""}, + {1, "MULTI", 0, "Multi", ""}, + {2, "FRACTAL", 0, "Fractal", ""}, + {3, "SMOOTH", 0, "Smooth", ""}, + {0, NULL, 0, NULL, NULL}}; /* identifiers */ ot->name= "subdivs"; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 4cf98f2c904..74a1fc12631 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -244,17 +244,17 @@ void ED_object_base_init_from_view(bContext *C, Base *base) /* ******************* add object operator ****************** */ static EnumPropertyItem prop_object_types[] = { - {OB_EMPTY, "EMPTY", "Empty", ""}, - {OB_MESH, "MESH", "Mesh", ""}, - {OB_CURVE, "CURVE", "Curve", ""}, - {OB_SURF, "SURFACE", "Surface", ""}, - {OB_FONT, "TEXT", "Text", ""}, - {OB_MBALL, "META", "Meta", ""}, - {OB_LAMP, "LAMP", "Lamp", ""}, - {OB_CAMERA, "CAMERA", "Camera", ""}, - {OB_ARMATURE, "ARMATURE", "Armature", ""}, - {OB_LATTICE, "LATTICE", "Lattice", ""}, - {0, NULL, NULL, NULL} + {OB_EMPTY, "EMPTY", 0, "Empty", ""}, + {OB_MESH, "MESH", 0, "Mesh", ""}, + {OB_CURVE, "CURVE", 0, "Curve", ""}, + {OB_SURF, "SURFACE", 0, "Surface", ""}, + {OB_FONT, "TEXT", 0, "Text", ""}, + {OB_MBALL, "META", 0, "Meta", ""}, + {OB_LAMP, "LAMP", 0, "Lamp", ""}, + {OB_CAMERA, "CAMERA", 0, "Camera", ""}, + {OB_ARMATURE, "ARMATURE", 0, "Armature", ""}, + {OB_LATTICE, "LATTICE", 0, "Lattice", ""}, + {0, NULL, 0, NULL, NULL} }; @@ -321,16 +321,16 @@ void OBJECT_OT_object_add(wmOperatorType *ot) /* ****** work both in and outside editmode ****** */ static EnumPropertyItem prop_mesh_types[] = { - {0, "PLANE", "Plane", ""}, - {1, "CUBE", "Cube", ""}, - {2, "CIRCLE", "Circle", ""}, - {3, "UVSPHERE", "UVsphere", ""}, - {4, "ICOSPHERE", "Icosphere", ""}, - {5, "CYLINDER", "Cylinder", ""}, - {6, "CONE", "Cone", ""}, - {7, "GRID", "Grid", ""}, - {8, "MONKEY", "Monkey", ""}, - {0, NULL, NULL, NULL} + {0, "PLANE", 0, "Plane", ""}, + {1, "CUBE", 0, "Cube", ""}, + {2, "CIRCLE", 0, "Circle", ""}, + {3, "UVSPHERE", 0, "UVsphere", ""}, + {4, "ICOSPHERE", 0, "Icosphere", ""}, + {5, "CYLINDER", 0, "Cylinder", ""}, + {6, "CONE", 0, "Cone", ""}, + {7, "GRID", 0, "Grid", ""}, + {8, "MONKEY", 0, "Monkey", ""}, + {0, NULL, 0, NULL, NULL} }; static int object_add_mesh_exec(bContext *C, wmOperator *op) @@ -405,12 +405,12 @@ void OBJECT_OT_mesh_add(wmOperatorType *ot) } static EnumPropertyItem prop_curve_types[] = { - {CU_BEZIER|CU_2D|CU_PRIM_CURVE, "BEZIER_CURVE", "Bezier Curve", ""}, - {CU_BEZIER|CU_2D|CU_PRIM_CIRCLE, "BEZIER_CIRCLE", "Bezier Circle", ""}, - {CU_NURBS|CU_2D|CU_PRIM_CURVE, "NURBS_CURVE", "NURBS Curve", ""}, - {CU_NURBS|CU_2D|CU_PRIM_CIRCLE, "NURBS_CIRCLE", "NURBS Circle", ""}, - {CU_NURBS|CU_2D|CU_PRIM_PATH, "PATH", "Path", ""}, - {0, NULL, NULL, NULL} + {CU_BEZIER|CU_2D|CU_PRIM_CURVE, "BEZIER_CURVE", 0, "Bezier Curve", ""}, + {CU_BEZIER|CU_2D|CU_PRIM_CIRCLE, "BEZIER_CIRCLE", 0, "Bezier Circle", ""}, + {CU_NURBS|CU_2D|CU_PRIM_CURVE, "NURBS_CURVE", 0, "NURBS Curve", ""}, + {CU_NURBS|CU_2D|CU_PRIM_CIRCLE, "NURBS_CIRCLE", 0, "NURBS Circle", ""}, + {CU_NURBS|CU_2D|CU_PRIM_PATH, "PATH", 0, "Path", ""}, + {0, NULL, 0, NULL, NULL} }; static int object_add_curve_exec(bContext *C, wmOperator *op) @@ -479,13 +479,13 @@ void OBJECT_OT_curve_add(wmOperatorType *ot) } static EnumPropertyItem prop_surface_types[]= { - {CU_PRIM_CURVE|CU_NURBS, "NURBS_CURVE", "NURBS Curve", ""}, - {CU_PRIM_CIRCLE|CU_NURBS, "NURBS_CIRCLE", "NURBS Circle", ""}, - {CU_PRIM_PATCH|CU_NURBS, "NURBS_SURFACE", "NURBS Surface", ""}, - {CU_PRIM_TUBE|CU_NURBS, "NURBS_TUBE", "NURBS Tube", ""}, - {CU_PRIM_SPHERE|CU_NURBS, "NURBS_SPHERE", "NURBS Sphere", ""}, - {CU_PRIM_DONUT|CU_NURBS, "NURBS_DONUT", "NURBS Donut", ""}, - {0, NULL, NULL, NULL} + {CU_PRIM_CURVE|CU_NURBS, "NURBS_CURVE", 0, "NURBS Curve", ""}, + {CU_PRIM_CIRCLE|CU_NURBS, "NURBS_CIRCLE", 0, "NURBS Circle", ""}, + {CU_PRIM_PATCH|CU_NURBS, "NURBS_SURFACE", 0, "NURBS Surface", ""}, + {CU_PRIM_TUBE|CU_NURBS, "NURBS_TUBE", 0, "NURBS Tube", ""}, + {CU_PRIM_SPHERE|CU_NURBS, "NURBS_SPHERE", 0, "NURBS Sphere", ""}, + {CU_PRIM_DONUT|CU_NURBS, "NURBS_DONUT", 0, "NURBS Donut", ""}, + {0, NULL, 0, NULL, NULL} }; static int object_add_surface_exec(bContext *C, wmOperator *op) @@ -1366,10 +1366,10 @@ void add_hook_menu(Scene *scene, View3D *v3d) /* ******************** clear parent operator ******************* */ static EnumPropertyItem prop_clear_parent_types[] = { - {0, "CLEAR", "Clear Parent", ""}, - {1, "CLEAR_KEEP_TRANSFORM", "Clear and Keep Transformation (Clear Track)", ""}, - {2, "CLEAR_INVERSE", "Clear Parent Inverse", ""}, - {0, NULL, NULL, NULL} + {0, "CLEAR", 0, "Clear Parent", ""}, + {1, "CLEAR_KEEP_TRANSFORM", 0, "Clear and Keep Transformation (Clear Track)", ""}, + {2, "CLEAR_INVERSE", 0, "Clear Parent Inverse", ""}, + {0, NULL, 0, NULL, NULL} }; /* note, poll should check for editable scene */ @@ -1422,9 +1422,9 @@ void OBJECT_OT_parent_clear(wmOperatorType *ot) static EnumPropertyItem prop_clear_track_types[] = { - {0, "CLEAR", "Clear Track", ""}, - {1, "CLEAR_KEEP_TRANSFORM", "Clear and Keep Transformation (Clear Track)", ""}, - {0, NULL, NULL, NULL} + {0, "CLEAR", 0, "Clear Track", ""}, + {1, "CLEAR_KEEP_TRANSFORM", 0, "Clear and Keep Transformation (Clear Track)", ""}, + {0, NULL, 0, NULL, NULL} }; /* note, poll should check for editable scene */ @@ -1471,9 +1471,9 @@ void OBJECT_OT_track_clear(wmOperatorType *ot) /* *****************Selection Operators******************* */ static EnumPropertyItem prop_select_types[] = { - {0, "EXCLUSIVE", "Exclusive", ""}, - {1, "EXTEND", "Extend", ""}, - {0, NULL, NULL, NULL} + {0, "EXCLUSIVE", 0, "Exclusive", ""}, + {1, "EXTEND", 0, "Extend", ""}, + {0, NULL, 0, NULL, NULL} }; /* ****** Select by Type ****** */ @@ -1526,13 +1526,13 @@ void OBJECT_OT_select_by_type(wmOperatorType *ot) /* ****** selection by links *******/ static EnumPropertyItem prop_select_linked_types[] = { - {1, "IPO", "Object IPO", ""}, // XXX depreceated animation system stuff... - {2, "OBDATA", "Ob Data", ""}, - {3, "MATERIAL", "Material", ""}, - {4, "TEXTURE", "Texture", ""}, - {5, "DUPGROUP", "Dupligroup", ""}, - {6, "PARTICLE", "Particle System", ""}, - {0, NULL, NULL, NULL} + {1, "IPO", 0, "Object IPO", ""}, // XXX depreceated animation system stuff... + {2, "OBDATA", 0, "Ob Data", ""}, + {3, "MATERIAL", 0, "Material", ""}, + {4, "TEXTURE", 0, "Texture", ""}, + {5, "DUPGROUP", 0, "Dupligroup", ""}, + {6, "PARTICLE", 0, "Particle System", ""}, + {0, NULL, 0, NULL, NULL} }; static int object_select_linked_exec(bContext *C, wmOperator *op) @@ -2085,9 +2085,9 @@ void OBJECT_OT_restrictview_clear(wmOperatorType *ot) } static EnumPropertyItem prop_set_restrictview_types[] = { - {0, "SELECTED", "Selected", ""}, - {1, "UNSELECTED", "Unselected ", ""}, - {0, NULL, NULL, NULL} + {0, "SELECTED", 0, "Selected", ""}, + {1, "UNSELECTED", 0, "Unselected ", ""}, + {0, NULL, 0, NULL, NULL} }; static int object_restrictview_set_exec(bContext *C, wmOperator *op) @@ -2462,16 +2462,16 @@ void make_proxy(Scene *scene) #define PAR_TRIA 8 static EnumPropertyItem prop_make_parent_types[] = { - {PAR_OBJECT, "OBJECT", "Object", ""}, - {PAR_ARMATURE, "ARMATURE", "Armature Deform", ""}, - {PAR_BONE, "BONE", "Bone", ""}, - {PAR_CURVE, "CURVE", "Curve Deform", ""}, - {PAR_FOLLOW, "FOLLOW", "Follow Path", ""}, - {PAR_PATH_CONST, "PATH_CONST", "Path Constraint", ""}, - {PAR_LATTICE, "LATTICE", "Lattice Deform", ""}, - {PAR_VERTEX, "VERTEX", "Vertex", ""}, - {PAR_TRIA, "TRIA", "Triangle", ""}, - {0, NULL, NULL, NULL} + {PAR_OBJECT, "OBJECT", 0, "Object", ""}, + {PAR_ARMATURE, "ARMATURE", 0, "Armature Deform", ""}, + {PAR_BONE, "BONE", 0, "Bone", ""}, + {PAR_CURVE, "CURVE", 0, "Curve Deform", ""}, + {PAR_FOLLOW, "FOLLOW", 0, "Follow Path", ""}, + {PAR_PATH_CONST, "PATH_CONST", 0, "Path Constraint", ""}, + {PAR_LATTICE, "LATTICE", 0, "Lattice Deform", ""}, + {PAR_VERTEX, "VERTEX", 0, "Vertex", ""}, + {PAR_TRIA, "TRIA", 0, "Triangle", ""}, + {0, NULL, 0, NULL, NULL} }; static int test_parent_loop(Object *par, Object *ob) @@ -2655,10 +2655,10 @@ void OBJECT_OT_parent_set(wmOperatorType *ot) /* *** make track ***** */ static EnumPropertyItem prop_make_track_types[] = { - {1, "TRACKTO", "TrackTo Constraint", ""}, - {2, "LOCKTRACK", "LockTrack Constraint", ""}, - {3, "OLDTRACK", "Old Track", ""}, - {0, NULL, NULL, NULL} + {1, "TRACKTO", 0, "TrackTo Constraint", ""}, + {2, "LOCKTRACK", 0, "LockTrack Constraint", ""}, + {3, "OLDTRACK", 0, "Old Track", ""}, + {0, NULL, 0, NULL, NULL} }; static int track_set_exec(bContext *C, wmOperator *op) @@ -2831,10 +2831,10 @@ void OBJECT_OT_dupli_set_real(wmOperatorType *ot) /* ******************* Set Object Center ********************** */ static EnumPropertyItem prop_set_center_types[] = { - {0, "CENTER", "ObData to Center", "Move object data around Object center"}, - {1, "CENTERNEW", "Center New", "Move Object center to center of object data"}, - {2, "CENTERCURSOR", "Center Cursor", "Move Object Center to position of the 3d cursor"}, - {0, NULL, NULL, NULL} + {0, "CENTER", 0, "ObData to Center", "Move object data around Object center"}, + {1, "CENTERNEW", 0, "Center New", "Move Object center to center of object data"}, + {2, "CENTERCURSOR", 0, "Center Cursor", "Move Object Center to position of the 3d cursor"}, + {0, NULL, 0, NULL, NULL} }; /* 0 == do center, 1 == center new, 2 == center cursor */ diff --git a/source/blender/editors/physics/editparticle.c b/source/blender/editors/physics/editparticle.c index 0947f540fc6..a9fc65bdc37 100644 --- a/source/blender/editors/physics/editparticle.c +++ b/source/blender/editors/physics/editparticle.c @@ -2347,8 +2347,8 @@ void PARTICLE_OT_brush_radial_control(wmOperatorType *ot) enum { DEL_PARTICLE, DEL_KEY }; static EnumPropertyItem delete_type_items[]= { - {DEL_PARTICLE, "PARTICLE", "Particle", ""}, - {DEL_KEY, "KEY", "Key", ""}, + {DEL_PARTICLE, "PARTICLE", 0, "Particle", ""}, + {DEL_KEY, "KEY", 0, "Key", ""}, {0, NULL, NULL}}; static void set_delete_particle(PEData *data, int pa_index) @@ -2563,15 +2563,15 @@ void PARTICLE_OT_mirror(wmOperatorType *ot) /*********************** set brush operator **********************/ static EnumPropertyItem brush_type_items[]= { - {PE_BRUSH_NONE, "NONE", "None", ""}, - {PE_BRUSH_COMB, "COMB", "Comb", ""}, - {PE_BRUSH_SMOOTH, "SMOOTH", "Smooth", ""}, - {PE_BRUSH_WEIGHT, "WEIGHT", "Weight", ""}, - {PE_BRUSH_ADD, "ADD", "Add", ""}, - {PE_BRUSH_LENGTH, "LENGTH", "Length", ""}, - {PE_BRUSH_PUFF, "PUFF", "Puff", ""}, - {PE_BRUSH_CUT, "CUT", "Cut", ""}, - {0, NULL, NULL, NULL} + {PE_BRUSH_NONE, "NONE", 0, "None", ""}, + {PE_BRUSH_COMB, "COMB", 0, "Comb", ""}, + {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", ""}, + {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", ""}, + {PE_BRUSH_ADD, "ADD", 0, "Add", ""}, + {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", ""}, + {PE_BRUSH_PUFF, "PUFF", 0, "Puff", ""}, + {PE_BRUSH_CUT, "CUT", 0, "Cut", ""}, + {0, NULL, 0, NULL, NULL} }; static int set_brush_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 3f4d175c94e..dae7a7cedd5 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1192,9 +1192,9 @@ static int area_split_modal(bContext *C, wmOperator *op, wmEvent *event) } static EnumPropertyItem prop_direction_items[] = { - {'h', "HORIZONTAL", "Horizontal", ""}, - {'v', "VERTICAL", "Vertical", ""}, - {0, NULL, NULL, NULL}}; + {'h', "HORIZONTAL", 0, "Horizontal", ""}, + {'v', "VERTICAL", 0, "Vertical", ""}, + {0, NULL, 0, NULL, NULL}}; void SCREEN_OT_area_split(wmOperatorType *ot) { diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index dc954ff5f26..2dba08b4601 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1245,10 +1245,10 @@ static int sculpt_brush_curve_preset_exec(bContext *C, wmOperator *op) static void SCULPT_OT_brush_curve_preset(wmOperatorType *ot) { static EnumPropertyItem prop_mode_items[] = { - {BRUSH_PRESET_SHARP, "SHARP", "Sharp Curve", ""}, - {BRUSH_PRESET_SMOOTH, "SMOOTH", "Smooth Curve", ""}, - {BRUSH_PRESET_MAX, "MAX", "Max Curve", ""}, - {0, NULL, NULL, NULL}}; + {BRUSH_PRESET_SHARP, "SHARP", 0, "Sharp Curve", ""}, + {BRUSH_PRESET_SMOOTH, "SMOOTH", 0, "Smooth Curve", ""}, + {BRUSH_PRESET_MAX, "MAX", 0, "Max Curve", ""}, + {0, NULL, 0, NULL, NULL}}; ot->name= "Preset"; ot->idname= "SCULPT_OT_brush_curve_preset"; diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index af074ca348d..a0f1adbd97e 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -369,10 +369,10 @@ void ACT_OT_keyframes_paste (wmOperatorType *ot) /* defines for insert keyframes tool */ EnumPropertyItem prop_actkeys_insertkey_types[] = { - {1, "ALL", "All Channels", ""}, - {2, "SEL", "Only Selected Channels", ""}, - {3, "GROUP", "In Active Group", ""}, // xxx not in all cases - {0, NULL, NULL, NULL} + {1, "ALL", 0, "All Channels", ""}, + {2, "SEL", 0, "Only Selected Channels", ""}, + {3, "GROUP", 0, "In Active Group", ""}, // xxx not in all cases + {0, NULL, 0, NULL, NULL} }; /* this function is responsible for snapping keyframes to frame-times */ @@ -799,9 +799,9 @@ void ACT_OT_keyframes_sample (wmOperatorType *ot) /* defines for set extrapolation-type for selected keyframes tool */ EnumPropertyItem prop_actkeys_expo_types[] = { - {FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", "Constant Extrapolation", ""}, - {FCURVE_EXTRAPOLATE_LINEAR, "LINEAR", "Linear Extrapolation", ""}, - {0, NULL, NULL, NULL} + {FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", 0, "Constant Extrapolation", ""}, + {FCURVE_EXTRAPOLATE_LINEAR, "LINEAR", 0, "Linear Extrapolation", ""}, + {0, NULL, 0, NULL, NULL} }; /* this function is responsible for setting extrapolation mode for keyframes */ @@ -1089,11 +1089,11 @@ void ACT_OT_keyframes_cfrasnap (wmOperatorType *ot) /* defines for snap keyframes tool */ EnumPropertyItem prop_actkeys_snap_types[] = { - {ACTKEYS_SNAP_CFRA, "CFRA", "Current frame", ""}, - {ACTKEYS_SNAP_NEAREST_FRAME, "NEAREST_FRAME", "Nearest Frame", ""}, // XXX as single entry? - {ACTKEYS_SNAP_NEAREST_SECOND, "NEAREST_SECOND", "Nearest Second", ""}, // XXX as single entry? - {ACTKEYS_SNAP_NEAREST_MARKER, "NEAREST_MARKER", "Nearest Marker", ""}, - {0, NULL, NULL, NULL} + {ACTKEYS_SNAP_CFRA, "CFRA", 0, "Current frame", ""}, + {ACTKEYS_SNAP_NEAREST_FRAME, "NEAREST_FRAME", 0, "Nearest Frame", ""}, // XXX as single entry? + {ACTKEYS_SNAP_NEAREST_SECOND, "NEAREST_SECOND", 0, "Nearest Second", ""}, // XXX as single entry? + {ACTKEYS_SNAP_NEAREST_MARKER, "NEAREST_MARKER", 0, "Nearest Marker", ""}, + {0, NULL, 0, NULL, NULL} }; /* this function is responsible for snapping keyframes to frame-times */ @@ -1188,11 +1188,11 @@ void ACT_OT_keyframes_snap (wmOperatorType *ot) /* defines for mirror keyframes tool */ EnumPropertyItem prop_actkeys_mirror_types[] = { - {ACTKEYS_MIRROR_CFRA, "CFRA", "Current frame", ""}, - {ACTKEYS_MIRROR_YAXIS, "YAXIS", "Vertical Axis", ""}, - {ACTKEYS_MIRROR_XAXIS, "XAXIS", "Horizontal Axis", ""}, - {ACTKEYS_MIRROR_MARKER, "MARKER", "First Selected Marker", ""}, - {0, NULL, NULL, NULL} + {ACTKEYS_MIRROR_CFRA, "CFRA", 0, "Current frame", ""}, + {ACTKEYS_MIRROR_YAXIS, "YAXIS", 0, "Vertical Axis", ""}, + {ACTKEYS_MIRROR_XAXIS, "XAXIS", 0, "Horizontal Axis", ""}, + {ACTKEYS_MIRROR_MARKER, "MARKER", 0, "First Selected Marker", ""}, + {0, NULL, 0, NULL, NULL} }; /* this function is responsible for mirroring keyframes */ diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index d4782418be7..b82e44f3aa3 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -374,11 +374,11 @@ void ACT_OT_keyframes_select_border(wmOperatorType *ot) /* defines for column-select mode */ static EnumPropertyItem prop_column_select_types[] = { - {ACTKEYS_COLUMNSEL_KEYS, "KEYS", "On Selected Keyframes", ""}, - {ACTKEYS_COLUMNSEL_CFRA, "CFRA", "On Current Frame", ""}, - {ACTKEYS_COLUMNSEL_MARKERS_COLUMN, "MARKERS_COLUMN", "On Selected Markers", ""}, - {ACTKEYS_COLUMNSEL_MARKERS_BETWEEN, "MARKERS_BETWEEN", "Between Min/Max Selected Markers", ""}, - {0, NULL, NULL, NULL} + {ACTKEYS_COLUMNSEL_KEYS, "KEYS", 0, "On Selected Keyframes", ""}, + {ACTKEYS_COLUMNSEL_CFRA, "CFRA", 0, "On Current Frame", ""}, + {ACTKEYS_COLUMNSEL_MARKERS_COLUMN, "MARKERS_COLUMN", 0, "On Selected Markers", ""}, + {ACTKEYS_COLUMNSEL_MARKERS_BETWEEN, "MARKERS_BETWEEN", 0, "Between Min/Max Selected Markers", ""}, + {0, NULL, 0, NULL, NULL} }; /* ------------------- */ @@ -584,11 +584,11 @@ void ACT_OT_keyframes_select_column (wmOperatorType *ot) /* defines for left-right select tool */ static EnumPropertyItem prop_actkeys_leftright_select_types[] = { - {ACTKEYS_LRSEL_TEST, "CHECK", "Check if Select Left or Right", ""}, - {ACTKEYS_LRSEL_NONE, "OFF", "Don't select", ""}, - {ACTKEYS_LRSEL_LEFT, "LEFT", "Before current frame", ""}, - {ACTKEYS_LRSEL_RIGHT, "RIGHT", "After current frame", ""}, - {0, NULL, NULL, NULL} + {ACTKEYS_LRSEL_TEST, "CHECK", 0, "Check if Select Left or Right", ""}, + {ACTKEYS_LRSEL_NONE, "OFF", 0, "Don't select", ""}, + {ACTKEYS_LRSEL_LEFT, "LEFT", 0, "Before current frame", ""}, + {ACTKEYS_LRSEL_RIGHT, "RIGHT", 0, "After current frame", ""}, + {0, NULL, 0, NULL, NULL} }; /* sensitivity factor for frame-selections */ diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index a3d0b50b9a6..49397ed0edd 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1001,9 +1001,9 @@ void GRAPHEDIT_OT_keyframes_sample (wmOperatorType *ot) /* defines for set extrapolation-type for selected keyframes tool */ EnumPropertyItem prop_graphkeys_expo_types[] = { - {FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", "Constant Extrapolation", ""}, - {FCURVE_EXTRAPOLATE_LINEAR, "LINEAR", "Linear Extrapolation", ""}, - {0, NULL, NULL, NULL} + {FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", 0, "Constant Extrapolation", ""}, + {FCURVE_EXTRAPOLATE_LINEAR, "LINEAR", 0, "Linear Extrapolation", ""}, + {0, NULL, 0, NULL, NULL} }; /* this function is responsible for setting extrapolation mode for keyframes */ @@ -1371,12 +1371,12 @@ void GRAPHEDIT_OT_keyframes_cfrasnap (wmOperatorType *ot) /* defines for snap keyframes tool */ EnumPropertyItem prop_graphkeys_snap_types[] = { - {GRAPHKEYS_SNAP_CFRA, "CFRA", "Current frame", ""}, - {GRAPHKEYS_SNAP_NEAREST_FRAME, "NEAREST_FRAME", "Nearest Frame", ""}, // XXX as single entry? - {GRAPHKEYS_SNAP_NEAREST_SECOND, "NEAREST_SECOND", "Nearest Second", ""}, // XXX as single entry? - {GRAPHKEYS_SNAP_NEAREST_MARKER, "NEAREST_MARKER", "Nearest Marker", ""}, - {GRAPHKEYS_SNAP_HORIZONTAL, "HORIZONTAL", "Flatten Handles", ""}, - {0, NULL, NULL, NULL} + {GRAPHKEYS_SNAP_CFRA, "CFRA", 0, "Current frame", ""}, + {GRAPHKEYS_SNAP_NEAREST_FRAME, "NEAREST_FRAME", 0, "Nearest Frame", ""}, // XXX as single entry? + {GRAPHKEYS_SNAP_NEAREST_SECOND, "NEAREST_SECOND", 0, "Nearest Second", ""}, // XXX as single entry? + {GRAPHKEYS_SNAP_NEAREST_MARKER, "NEAREST_MARKER", 0, "Nearest Marker", ""}, + {GRAPHKEYS_SNAP_HORIZONTAL, "HORIZONTAL", 0, "Flatten Handles", ""}, + {0, NULL, 0, NULL, NULL} }; /* this function is responsible for snapping keyframes to frame-times */ @@ -1466,11 +1466,11 @@ void GRAPHEDIT_OT_keyframes_snap (wmOperatorType *ot) /* defines for mirror keyframes tool */ EnumPropertyItem prop_graphkeys_mirror_types[] = { - {GRAPHKEYS_MIRROR_CFRA, "CFRA", "Current frame", ""}, - {GRAPHKEYS_MIRROR_YAXIS, "YAXIS", "Vertical Axis", ""}, - {GRAPHKEYS_MIRROR_XAXIS, "XAXIS", "Horizontal Axis", ""}, - {GRAPHKEYS_MIRROR_MARKER, "MARKER", "First Selected Marker", ""}, - {0, NULL, NULL, NULL} + {GRAPHKEYS_MIRROR_CFRA, "CFRA", 0, "Current frame", ""}, + {GRAPHKEYS_MIRROR_YAXIS, "YAXIS", 0, "Vertical Axis", ""}, + {GRAPHKEYS_MIRROR_XAXIS, "XAXIS", 0, "Horizontal Axis", ""}, + {GRAPHKEYS_MIRROR_MARKER, "MARKER", 0, "First Selected Marker", ""}, + {0, NULL, 0, NULL, NULL} }; /* this function is responsible for mirroring keyframes */ diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index bb923ca6f95..9aaef9fca8a 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -340,11 +340,11 @@ void GRAPHEDIT_OT_keyframes_select_border(wmOperatorType *ot) /* defines for column-select mode */ static EnumPropertyItem prop_column_select_types[] = { - {GRAPHKEYS_COLUMNSEL_KEYS, "KEYS", "On Selected Keyframes", ""}, - {GRAPHKEYS_COLUMNSEL_CFRA, "CFRA", "On Current Frame", ""}, - {GRAPHKEYS_COLUMNSEL_MARKERS_COLUMN, "MARKERS_COLUMN", "On Selected Markers", ""}, - {GRAPHKEYS_COLUMNSEL_MARKERS_BETWEEN, "MARKERS_BETWEEN", "Between Min/Max Selected Markers", ""}, - {0, NULL, NULL, NULL} + {GRAPHKEYS_COLUMNSEL_KEYS, "KEYS", 0, "On Selected Keyframes", ""}, + {GRAPHKEYS_COLUMNSEL_CFRA, "CFRA", 0, "On Current Frame", ""}, + {GRAPHKEYS_COLUMNSEL_MARKERS_COLUMN, "MARKERS_COLUMN", 0, "On Selected Markers", ""}, + {GRAPHKEYS_COLUMNSEL_MARKERS_BETWEEN, "MARKERS_BETWEEN", 0, "Between Min/Max Selected Markers", ""}, + {0, NULL, 0, NULL, NULL} }; /* ------------------- */ @@ -526,11 +526,11 @@ void GRAPHEDIT_OT_keyframes_columnselect (wmOperatorType *ot) /* defines for left-right select tool */ static EnumPropertyItem prop_graphkeys_leftright_select_types[] = { - {GRAPHKEYS_LRSEL_TEST, "CHECK", "Check if Select Left or Right", ""}, - {GRAPHKEYS_LRSEL_NONE, "OFF", "Don't select", ""}, - {GRAPHKEYS_LRSEL_LEFT, "LEFT", "Before current frame", ""}, - {GRAPHKEYS_LRSEL_RIGHT, "RIGHT", "After current frame", ""}, - {0, NULL, NULL, NULL} + {GRAPHKEYS_LRSEL_TEST, "CHECK", 0, "Check if Select Left or Right", ""}, + {GRAPHKEYS_LRSEL_NONE, "OFF", 0, "Don't select", ""}, + {GRAPHKEYS_LRSEL_LEFT, "LEFT", 0, "Before current frame", ""}, + {GRAPHKEYS_LRSEL_RIGHT, "RIGHT", 0, "After current frame", ""}, + {0, NULL, 0, NULL, NULL} }; /* ------------------- */ diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 378d91c8e32..73a7f570c44 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1412,9 +1412,9 @@ void IMAGE_OT_sample(wmOperatorType *ot) void IMAGE_OT_curves_point_set(wmOperatorType *ot) { static EnumPropertyItem point_items[]= { - {0, "BLACK_POINT", "Black Point", ""}, - {1, "WHITE_POINT", "White Point", ""}, - {0, NULL, NULL, NULL}}; + {0, "BLACK_POINT", 0, "Black Point", ""}, + {1, "WHITE_POINT", 0, "White Point", ""}, + {0, NULL, 0, NULL, NULL}}; /* identifiers */ ot->name= "Set Curves Point"; diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index 3c37793e8d6..6746c21ebcf 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -177,8 +177,8 @@ static int node_extend_select_invoke(bContext *C, wmOperator *op, wmEvent *event /* operators */ static EnumPropertyItem prop_select_items[] = { - {NODE_SELECT_MOUSE, "NORMAL", "Normal Select", "Select using the mouse"}, - {0, NULL, NULL, NULL}}; + {NODE_SELECT_MOUSE, "NORMAL", 0, "Normal Select", "Select using the mouse"}, + {0, NULL, 0, NULL, NULL}}; void NODE_OT_select_extend(wmOperatorType *ot) { @@ -225,9 +225,9 @@ void NODE_OT_select(wmOperatorType *ot) /* ****** Border Select ****** */ static EnumPropertyItem prop_select_types[] = { - {NODE_EXCLUSIVE, "EXCLUSIVE", "Exclusive", ""}, /* right mouse */ - {NODE_EXTEND, "EXTEND", "Extend", ""}, /* left mouse */ - {0, NULL, NULL, NULL} + {NODE_EXCLUSIVE, "EXCLUSIVE", 0, "Exclusive", ""}, /* right mouse */ + {NODE_EXTEND, "EXTEND", 0, "Extend", ""}, /* left mouse */ + {0, NULL, 0, NULL, NULL} }; static int node_borderselect_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 20ad1b61981..7cd81faede1 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -105,35 +105,35 @@ static int okee() {return 0;} /* XXX */ /* RNA Enums, used in multiple files */ EnumPropertyItem sequencer_prop_effect_types[] = { - {SEQ_CROSS, "CROSS", "Crossfade", "Crossfade effect strip type"}, - {SEQ_ADD, "ADD", "Add", "Add effect strip type"}, - {SEQ_SUB, "SUBTRACT", "Subtract", "Subtract effect strip type"}, - {SEQ_ALPHAOVER, "ALPHA_OVER", "Alpha Over", "Alpha Over effect strip type"}, - {SEQ_ALPHAUNDER, "ALPHA_UNDER", "Alpha Under", "Alpha Under effect strip type"}, - {SEQ_GAMCROSS, "GAMMA_CROSS", "Gamma Cross", "Gamma Cross effect strip type"}, - {SEQ_MUL, "MULTIPLY", "Multiply", "Multiply effect strip type"}, - {SEQ_OVERDROP, "OVER_DROP", "Alpha Over Drop", "Alpha Over Drop effect strip type"}, - {SEQ_PLUGIN, "PLUGIN", "Plugin", "Plugin effect strip type"}, - {SEQ_WIPE, "WIPE", "Wipe", "Wipe effect strip type"}, - {SEQ_GLOW, "GLOW", "Glow", "Glow effect strip type"}, - {SEQ_TRANSFORM, "TRANSFORM", "Transform", "Transform effect strip type"}, - {SEQ_COLOR, "COLOR", "Color", "Color effect strip type"}, - {SEQ_SPEED, "SPEED", "Speed", "Color effect strip type"}, - {0, NULL, NULL, NULL} + {SEQ_CROSS, "CROSS", 0, "Crossfade", "Crossfade effect strip type"}, + {SEQ_ADD, "ADD", 0, "Add", "Add effect strip type"}, + {SEQ_SUB, "SUBTRACT", 0, "Subtract", "Subtract effect strip type"}, + {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", "Alpha Over effect strip type"}, + {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", "Alpha Under effect strip type"}, + {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", "Gamma Cross effect strip type"}, + {SEQ_MUL, "MULTIPLY", 0, "Multiply", "Multiply effect strip type"}, + {SEQ_OVERDROP, "OVER_DROP", 0, "Alpha Over Drop", "Alpha Over Drop effect strip type"}, + {SEQ_PLUGIN, "PLUGIN", 0, "Plugin", "Plugin effect strip type"}, + {SEQ_WIPE, "WIPE", 0, "Wipe", "Wipe effect strip type"}, + {SEQ_GLOW, "GLOW", 0, "Glow", "Glow effect strip type"}, + {SEQ_TRANSFORM, "TRANSFORM", 0, "Transform", "Transform effect strip type"}, + {SEQ_COLOR, "COLOR", 0, "Color", "Color effect strip type"}, + {SEQ_SPEED, "SPEED", 0, "Speed", "Color effect strip type"}, + {0, NULL, 0, NULL, NULL} }; /* mute operator */ EnumPropertyItem sequencer_prop_operate_types[] = { /* better name? */ - {SEQ_SELECTED, "SELECTED", "Selected", ""}, - {SEQ_UNSELECTED, "UNSELECTED", "Unselected ", ""}, - {0, NULL, NULL, NULL} + {SEQ_SELECTED, "SELECTED", 0, "Selected", ""}, + {SEQ_UNSELECTED, "UNSELECTED", 0, "Unselected ", ""}, + {0, NULL, 0, NULL, NULL} }; EnumPropertyItem prop_side_types[] = { - {SEQ_SIDE_LEFT, "LEFT", "Left", ""}, - {SEQ_SIDE_RIGHT, "RIGHT", "Right", ""}, - {SEQ_SIDE_BOTH, "BOTH", "Both", ""}, - {0, NULL, NULL, NULL} + {SEQ_SIDE_LEFT, "LEFT", 0, "Left", ""}, + {SEQ_SIDE_RIGHT, "RIGHT", 0, "Right", ""}, + {SEQ_SIDE_BOTH, "BOTH", 0, "Both", ""}, + {0, NULL, 0, NULL, NULL} }; typedef struct TransSeq { @@ -1726,9 +1726,9 @@ void SEQUENCER_OT_refresh_all(struct wmOperatorType *ot) /* cut operator */ static EnumPropertyItem prop_cut_types[] = { - {SEQ_CUT_SOFT, "SOFT", "Soft", ""}, - {SEQ_CUT_HARD, "HARD", "Hard", ""}, - {0, NULL, NULL, NULL} + {SEQ_CUT_SOFT, "SOFT", 0, "Soft", ""}, + {SEQ_CUT_HARD, "HARD", 0, "Hard", ""}, + {0, NULL, 0, NULL, NULL} }; static int sequencer_cut_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index f43888b08da..95970798e53 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -972,9 +972,9 @@ void TEXT_OT_uncomment(wmOperatorType *ot) enum { TO_SPACES, TO_TABS }; static EnumPropertyItem whitespace_type_items[]= { - {TO_SPACES, "SPACES", "To Spaces", NULL}, - {TO_TABS, "TABS", "To Tabs", NULL}, - {0, NULL, NULL, NULL}}; + {TO_SPACES, "SPACES", 0, "To Spaces", NULL}, + {TO_TABS, "TABS", 0, "To Tabs", NULL}, + {0, NULL, 0, NULL, NULL}}; static int convert_whitespace_exec(bContext *C, wmOperator *op) { @@ -1270,19 +1270,19 @@ void TEXT_OT_markers_clear(wmOperatorType *ot) /************************ move operator ************************/ static EnumPropertyItem move_type_items[]= { - {LINE_BEGIN, "LINE_BEGIN", "Line Begin", ""}, - {LINE_END, "LINE_END", "Line End", ""}, - {FILE_TOP, "FILE_TOP", "File Top", ""}, - {FILE_BOTTOM, "FILE_BOTTOM", "File Bottom", ""}, - {PREV_CHAR, "PREVIOUS_CHARACTER", "Previous Character", ""}, - {NEXT_CHAR, "NEXT_CHARACTER", "Next Character", ""}, - {PREV_WORD, "PREVIOUS_WORD", "Previous Word", ""}, - {NEXT_WORD, "NEXT_WORD", "Next Word", ""}, - {PREV_LINE, "PREVIOUS_LINE", "Previous Line", ""}, - {NEXT_LINE, "NEXT_LINE", "Next Line", ""}, - {PREV_PAGE, "PREVIOUS_PAGE", "Previous Page", ""}, - {NEXT_PAGE, "NEXT_PAGE", "Next Page", ""}, - {0, NULL, NULL, NULL}}; + {LINE_BEGIN, "LINE_BEGIN", 0, "Line Begin", ""}, + {LINE_END, "LINE_END", 0, "Line End", ""}, + {FILE_TOP, "FILE_TOP", 0, "File Top", ""}, + {FILE_BOTTOM, "FILE_BOTTOM", 0, "File Bottom", ""}, + {PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""}, + {NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""}, + {PREV_WORD, "PREVIOUS_WORD", 0, "Previous Word", ""}, + {NEXT_WORD, "NEXT_WORD", 0, "Next Word", ""}, + {PREV_LINE, "PREVIOUS_LINE", 0, "Previous Line", ""}, + {NEXT_LINE, "NEXT_LINE", 0, "Next Line", ""}, + {PREV_PAGE, "PREVIOUS_PAGE", 0, "Previous Page", ""}, + {NEXT_PAGE, "NEXT_PAGE", 0, "Next Page", ""}, + {0, NULL, 0, NULL, NULL}}; static void wrap_move_bol(SpaceText *st, ARegion *ar, short sel) { @@ -1613,11 +1613,11 @@ void TEXT_OT_jump(wmOperatorType *ot) /******************* delete operator **********************/ static EnumPropertyItem delete_type_items[]= { - {DEL_NEXT_CHAR, "NEXT_CHARACTER", "Next Character", ""}, - {DEL_PREV_CHAR, "PREVIOUS_CHARACTER", "Previous Character", ""}, - {DEL_NEXT_WORD, "NEXT_WORD", "Next Word", ""}, - {DEL_PREV_WORD, "PREVIOUS_WORD", "Previous Word", ""}, - {0, NULL, NULL, NULL}}; + {DEL_NEXT_CHAR, "NEXT_CHARACTER", 0, "Next Character", ""}, + {DEL_PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""}, + {DEL_NEXT_WORD, "NEXT_WORD", 0, "Next Word", ""}, + {DEL_PREV_WORD, "PREVIOUS_WORD", 0, "Previous Word", ""}, + {0, NULL, 0, NULL, NULL}}; static int delete_exec(bContext *C, wmOperator *op) { @@ -2469,11 +2469,11 @@ void TEXT_OT_replace_set_selected(wmOperatorType *ot) enum { RESOLVE_IGNORE, RESOLVE_RELOAD, RESOLVE_SAVE, RESOLVE_MAKE_INTERNAL }; static EnumPropertyItem resolution_items[]= { - {RESOLVE_IGNORE, "IGNORE", "Ignore", ""}, - {RESOLVE_RELOAD, "RELOAD", "Reload", ""}, - {RESOLVE_SAVE, "SAVE", "Save", ""}, - {RESOLVE_MAKE_INTERNAL, "MAKE_INTERNAL", "Make Internal", ""}, - {0, NULL, NULL, NULL}}; + {RESOLVE_IGNORE, "IGNORE", 0, "Ignore", ""}, + {RESOLVE_RELOAD, "RELOAD", 0, "Reload", ""}, + {RESOLVE_SAVE, "SAVE", 0, "Save", ""}, + {RESOLVE_MAKE_INTERNAL, "MAKE_INTERNAL", 0, "Make Internal", ""}, + {0, NULL, 0, NULL, NULL}}; /* returns 0 if file on disk is the same or Text is in memory only returns 1 if file has been modified on disk since last local edit diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index b4b35be3ef3..79173d3fec7 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -1320,14 +1320,14 @@ void VIEW3D_OT_zoom_border(wmOperatorType *ot) /* ********************* Changing view operator ****************** */ static EnumPropertyItem prop_view_items[] = { - {V3D_VIEW_FRONT, "FRONT", "Front", "View From the Front"}, - {V3D_VIEW_BACK, "BACK", "Back", "View From the Back"}, - {V3D_VIEW_LEFT, "LEFT", "Left", "View From the Left"}, - {V3D_VIEW_RIGHT, "RIGHT", "Right", "View From the Right"}, - {V3D_VIEW_TOP, "TOP", "Top", "View From the Top"}, - {V3D_VIEW_BOTTOM, "BOTTOM", "Bottom", "View From the Bottom"}, - {V3D_VIEW_CAMERA, "CAMERA", "Camera", "View From the active amera"}, - {0, NULL, NULL, NULL}}; + {V3D_VIEW_FRONT, "FRONT", 0, "Front", "View From the Front"}, + {V3D_VIEW_BACK, "BACK", 0, "Back", "View From the Back"}, + {V3D_VIEW_LEFT, "LEFT", 0, "Left", "View From the Left"}, + {V3D_VIEW_RIGHT, "RIGHT", 0, "Right", "View From the Right"}, + {V3D_VIEW_TOP, "TOP", 0, "Top", "View From the Top"}, + {V3D_VIEW_BOTTOM, "BOTTOM", 0, "Bottom", "View From the Bottom"}, + {V3D_VIEW_CAMERA, "CAMERA", 0, "Camera", "View From the active amera"}, + {0, NULL, 0, NULL, NULL}}; static void axis_set_view(bContext *C, float q1, float q2, float q3, float q4, short view, int perspo) { @@ -1479,11 +1479,11 @@ void VIEW3D_OT_viewnumpad(wmOperatorType *ot) } static EnumPropertyItem prop_view_orbit_items[] = { - {V3D_VIEW_STEPLEFT, "ORBITLEFT", "Orbit Left", "Orbit the view around to the Left"}, - {V3D_VIEW_STEPRIGHT, "ORBITRIGHT", "Orbit Right", "Orbit the view around to the Right"}, - {V3D_VIEW_STEPUP, "ORBITUP", "Orbit Up", "Orbit the view Up"}, - {V3D_VIEW_STEPDOWN, "ORBITDOWN", "Orbit Down", "Orbit the view Down"}, - {0, NULL, NULL, NULL}}; + {V3D_VIEW_STEPLEFT, "ORBITLEFT", 0, "Orbit Left", "Orbit the view around to the Left"}, + {V3D_VIEW_STEPRIGHT, "ORBITRIGHT", 0, "Orbit Right", "Orbit the view around to the Right"}, + {V3D_VIEW_STEPUP, "ORBITUP", 0, "Orbit Up", "Orbit the view Up"}, + {V3D_VIEW_STEPDOWN, "ORBITDOWN", 0, "Orbit Down", "Orbit the view Down"}, + {0, NULL, 0, NULL, NULL}}; static int vieworbit_exec(bContext *C, wmOperator *op) { @@ -1547,11 +1547,11 @@ void VIEW3D_OT_view_orbit(wmOperatorType *ot) } static EnumPropertyItem prop_view_pan_items[] = { - {V3D_VIEW_PANLEFT, "PANLEFT", "Pan Left", "Pan the view to the Left"}, - {V3D_VIEW_PANRIGHT, "PANRIGHT", "Pan Right", "Pan the view to the Right"}, - {V3D_VIEW_PANUP, "PANUP", "Pan Up", "Pan the view Up"}, - {V3D_VIEW_PANDOWN, "PANDOWN", "Pan Down", "Pan the view Down"}, - {0, NULL, NULL, NULL}}; + {V3D_VIEW_PANLEFT, "PANLEFT", 0, "Pan Left", "Pan the view to the Left"}, + {V3D_VIEW_PANRIGHT, "PANRIGHT", 0, "Pan Right", "Pan the view to the Right"}, + {V3D_VIEW_PANUP, "PANUP", 0, "Pan Up", "Pan the view Up"}, + {V3D_VIEW_PANDOWN, "PANDOWN", 0, "Pan Down", "Pan the view Down"}, + {0, NULL, 0, NULL, NULL}}; static int viewpan_exec(bContext *C, wmOperator *op) { diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 9c4f0b576da..e0e8ac7c7a7 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -715,9 +715,9 @@ void view3d_lasso_select(bContext *C, ViewContext *vc, short mcords[][2], short } static EnumPropertyItem lasso_select_types[] = { - {0, "SELECT", "Select", ""}, - {1, "DESELECT", "Deselect", ""}, - {0, NULL, NULL, NULL} + {0, "SELECT", 0, "Select", ""}, + {1, "DESELECT", 0, "Deselect", ""}, + {0, NULL, 0, NULL, NULL} }; @@ -1526,9 +1526,9 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) /* *****************Selection Operators******************* */ static EnumPropertyItem prop_select_types[] = { - {0, "EXCLUSIVE", "Exclusive", ""}, - {1, "EXTEND", "Extend", ""}, - {0, NULL, NULL, NULL} + {0, "EXCLUSIVE", 0, "Exclusive", ""}, + {1, "EXTEND", 0, "Extend", ""}, + {0, NULL, 0, NULL, NULL} }; /* ****** Border Select ****** */ diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 769001b30a8..e697b6dfa7d 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -56,29 +56,29 @@ static float VecOne[3] = {1, 1, 1}; /* need constants for this */ EnumPropertyItem proportional_mode_types[] = { - {0, "OFF", "Off", ""}, - {1, "ON", "On", ""}, - {2, "CONNECTED", "Connected", ""}, - {0, NULL, NULL, NULL} + {0, "OFF", 0, "Off", ""}, + {1, "ON", 0, "On", ""}, + {2, "CONNECTED", 0, "Connected", ""}, + {0, NULL, 0, NULL, NULL} }; EnumPropertyItem snap_mode_types[] = { - {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", "Closest", ""}, - {SCE_SNAP_TARGET_CENTER, "CENTER", "Center", ""}, - {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", "Median", ""}, - {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", "Active", ""}, - {0, NULL, NULL, NULL} + {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", ""}, + {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", ""}, + {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", ""}, + {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", ""}, + {0, NULL, 0, NULL, NULL} }; EnumPropertyItem proportional_falloff_types[] = { - {PROP_SMOOTH, "SMOOTH", "Smooth", ""}, - {PROP_SPHERE, "SPHERE", "Sphere", ""}, - {PROP_ROOT, "ROOT", "Root", ""}, - {PROP_SHARP, "SHARP", "Sharp", ""}, - {PROP_LIN, "LINEAR", "Linear", ""}, - {PROP_CONST, "CONSTANT", "Constant", ""}, - {PROP_RANDOM, "RANDOM", "Random", ""}, - {0, NULL, NULL, NULL} + {PROP_SMOOTH, "SMOOTH", 0, "Smooth", ""}, + {PROP_SPHERE, "SPHERE", 0, "Sphere", ""}, + {PROP_ROOT, "ROOT", 0, "Root", ""}, + {PROP_SHARP, "SHARP", 0, "Sharp", ""}, + {PROP_LIN, "LINEAR", 0, "Linear", ""}, + {PROP_CONST, "CONSTANT", 0, "Constant", ""}, + {PROP_RANDOM, "RANDOM", 0, "Random", ""}, + {0, NULL, 0, NULL, NULL} }; char OP_TRANSLATION[] = "TFM_OT_translation"; @@ -133,12 +133,12 @@ static int select_orientation_invoke(bContext *C, wmOperator *op, wmEvent *event void TFM_OT_select_orientation(struct wmOperatorType *ot) { static EnumPropertyItem orientation_items[]= { - {V3D_MANIP_GLOBAL, "GLOBAL", "Global", ""}, - {V3D_MANIP_NORMAL, "NORMAL", "Normal", ""}, - {V3D_MANIP_LOCAL, "LOCAL", "Local", ""}, - {V3D_MANIP_VIEW, "VIEW", "View", ""}, - {V3D_MANIP_CUSTOM, "CUSTOM", "Custom", ""}, - {0, NULL, NULL, NULL}}; + {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", ""}, + {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal", ""}, + {V3D_MANIP_LOCAL, "LOCAL", 0, "Local", ""}, + {V3D_MANIP_VIEW, "VIEW", 0, "View", ""}, + {V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", ""}, + {0, NULL, 0, NULL, NULL}}; /* identifiers */ ot->name = "Select Orientation"; @@ -484,33 +484,33 @@ void TFM_OT_tosphere(struct wmOperatorType *ot) void TFM_OT_transform(struct wmOperatorType *ot) { static EnumPropertyItem transform_mode_types[] = { - {TFM_INIT, "INIT", "Init", ""}, - {TFM_DUMMY, "DUMMY", "Dummy", ""}, - {TFM_TRANSLATION, "TRANSLATION", "Translation", ""}, - {TFM_ROTATION, "ROTATION", "Rotation", ""}, - {TFM_RESIZE, "RESIZE", "Resize", ""}, - {TFM_TOSPHERE, "TOSPHERE", "Tosphere", ""}, - {TFM_SHEAR, "SHEAR", "Shear", ""}, - {TFM_WARP, "WARP", "Warp", ""}, - {TFM_SHRINKFATTEN, "SHRINKFATTEN", "Shrinkfatten", ""}, - {TFM_TILT, "TILT", "Tilt", ""}, - {TFM_TRACKBALL, "TRACKBALL", "Trackball", ""}, - {TFM_PUSHPULL, "PUSHPULL", "Pushpull", ""}, - {TFM_CREASE, "CREASE", "Crease", ""}, - {TFM_MIRROR, "MIRROR", "Mirror", ""}, - {TFM_BONESIZE, "BONESIZE", "Bonesize", ""}, - {TFM_BONE_ENVELOPE, "BONE_ENVELOPE", "Bone_Envelope", ""}, - {TFM_CURVE_SHRINKFATTEN, "CURVE_SHRINKFATTEN", "Curve_Shrinkfatten", ""}, - {TFM_BONE_ROLL, "BONE_ROLL", "Bone_Roll", ""}, - {TFM_TIME_TRANSLATE, "TIME_TRANSLATE", "Time_Translate", ""}, - {TFM_TIME_SLIDE, "TIME_SLIDE", "Time_Slide", ""}, - {TFM_TIME_SCALE, "TIME_SCALE", "Time_Scale", ""}, - {TFM_TIME_EXTEND, "TIME_EXTEND", "Time_Extend", ""}, - {TFM_BAKE_TIME, "BAKE_TIME", "Bake_Time", ""}, - {TFM_BEVEL, "BEVEL", "Bevel", ""}, - {TFM_BWEIGHT, "BWEIGHT", "Bweight", ""}, - {TFM_ALIGN, "ALIGN", "Align", ""}, - {0, NULL, NULL, NULL} + {TFM_INIT, "INIT", 0, "Init", ""}, + {TFM_DUMMY, "DUMMY", 0, "Dummy", ""}, + {TFM_TRANSLATION, "TRANSLATION", 0, "Translation", ""}, + {TFM_ROTATION, "ROTATION", 0, "Rotation", ""}, + {TFM_RESIZE, "RESIZE", 0, "Resize", ""}, + {TFM_TOSPHERE, "TOSPHERE", 0, "Tosphere", ""}, + {TFM_SHEAR, "SHEAR", 0, "Shear", ""}, + {TFM_WARP, "WARP", 0, "Warp", ""}, + {TFM_SHRINKFATTEN, "SHRINKFATTEN", 0, "Shrinkfatten", ""}, + {TFM_TILT, "TILT", 0, "Tilt", ""}, + {TFM_TRACKBALL, "TRACKBALL", 0, "Trackball", ""}, + {TFM_PUSHPULL, "PUSHPULL", 0, "Pushpull", ""}, + {TFM_CREASE, "CREASE", 0, "Crease", ""}, + {TFM_MIRROR, "MIRROR", 0, "Mirror", ""}, + {TFM_BONESIZE, "BONESIZE", 0, "Bonesize", ""}, + {TFM_BONE_ENVELOPE, "BONE_ENVELOPE", 0, "Bone_Envelope", ""}, + {TFM_CURVE_SHRINKFATTEN, "CURVE_SHRINKFATTEN", 0, "Curve_Shrinkfatten", ""}, + {TFM_BONE_ROLL, "BONE_ROLL", 0, "Bone_Roll", ""}, + {TFM_TIME_TRANSLATE, "TIME_TRANSLATE", 0, "Time_Translate", ""}, + {TFM_TIME_SLIDE, "TIME_SLIDE", 0, "Time_Slide", ""}, + {TFM_TIME_SCALE, "TIME_SCALE", 0, "Time_Scale", ""}, + {TFM_TIME_EXTEND, "TIME_EXTEND", 0, "Time_Extend", ""}, + {TFM_BAKE_TIME, "BAKE_TIME", 0, "Bake_Time", ""}, + {TFM_BEVEL, "BEVEL", 0, "Bevel", ""}, + {TFM_BWEIGHT, "BWEIGHT", 0, "Bweight", ""}, + {TFM_ALIGN, "ALIGN", 0, "Align", ""}, + {0, NULL, 0, NULL, NULL} }; /* identifiers */ diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 0b82efda7ab..a42008bef0c 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -963,9 +963,9 @@ static int mirror_exec(bContext *C, wmOperator *op) void UV_OT_mirror(wmOperatorType *ot) { static EnumPropertyItem axis_items[] = { - {'x', "MIRROR_X", "Mirror X", "Mirror UVs over X axis."}, - {'y', "MIRROR_Y", "Mirror Y", "Mirror UVs over Y axis."}, - {0, NULL, NULL, NULL}}; + {'x', "MIRROR_X", 0, "Mirror X", "Mirror UVs over X axis."}, + {'y', "MIRROR_Y", 0, "Mirror Y", "Mirror UVs over Y axis."}, + {0, NULL, 0, NULL, NULL}}; /* identifiers */ ot->name= "Mirror"; @@ -1068,10 +1068,10 @@ static int align_exec(bContext *C, wmOperator *op) void UV_OT_align(wmOperatorType *ot) { static EnumPropertyItem axis_items[] = { - {'a', "ALIGN_AUTO", "Align Auto", "Automatically choose the axis on which there is most alignment already."}, - {'x', "ALIGN_X", "Align X", "Align UVs on X axis."}, - {'y', "ALIGN_Y", "Align Y", "Align UVs on Y axis."}, - {0, NULL, NULL, NULL}}; + {'a', "ALIGN_AUTO", 0, "Align Auto", "Automatically choose the axis on which there is most alignment already."}, + {'x', "ALIGN_X", 0, "Align X", "Align UVs on X axis."}, + {'y', "ALIGN_Y", 0, "Align Y", "Align UVs on Y axis."}, + {0, NULL, 0, NULL, NULL}}; /* identifiers */ ot->name= "Align"; @@ -2326,9 +2326,9 @@ static int snap_cursor_exec(bContext *C, wmOperator *op) void UV_OT_snap_cursor(wmOperatorType *ot) { static EnumPropertyItem target_items[] = { - {0, "PIXELS", "Pixels", ""}, - {1, "SELECTION", "Selection", ""}, - {0, NULL, NULL, NULL}}; + {0, "PIXELS", 0, "Pixels", ""}, + {1, "SELECTION", 0, "Selection", ""}, + {0, NULL, 0, NULL, NULL}}; /* identifiers */ ot->name= "Snap Cursor"; @@ -2561,10 +2561,10 @@ static int snap_selection_exec(bContext *C, wmOperator *op) void UV_OT_snap_selection(wmOperatorType *ot) { static EnumPropertyItem target_items[] = { - {0, "PIXELS", "Pixels", ""}, - {1, "CURSOR", "Cursor", ""}, - {2, "ADJACENT_UNSELECTED", "Adjacent Unselected", ""}, - {0, NULL, NULL, NULL}}; + {0, "PIXELS", 0, "Pixels", ""}, + {1, "CURSOR", 0, "Cursor", ""}, + {2, "ADJACENT_UNSELECTED", 0, "Adjacent Unselected", ""}, + {0, NULL, 0, NULL, NULL}}; /* identifiers */ ot->name= "Snap Selection"; diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 27d0c68ec36..95467d13e8d 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -639,15 +639,15 @@ static void uv_map_transform(bContext *C, wmOperator *op, float center[3], float static void uv_transform_properties(wmOperatorType *ot, int radius) { static EnumPropertyItem direction_items[]= { - {VIEW_ON_EQUATOR, "VIEW_ON_EQUATOR", "View on Equator", "3D view is on the equator."}, - {VIEW_ON_POLES, "VIEW_ON_POLES", "View on Poles", "3D view is on the poles."}, - {ALIGN_TO_OBJECT, "ALIGN_TO_OBJECT", "Align to Object", "Align according to object transform."}, - {0, NULL, NULL, NULL} + {VIEW_ON_EQUATOR, "VIEW_ON_EQUATOR", 0, "View on Equator", "3D view is on the equator."}, + {VIEW_ON_POLES, "VIEW_ON_POLES", 0, "View on Poles", "3D view is on the poles."}, + {ALIGN_TO_OBJECT, "ALIGN_TO_OBJECT", 0, "Align to Object", "Align according to object transform."}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem align_items[]= { - {POLAR_ZX, "POLAR_ZX", "Polar ZX", "Polar 0 is X."}, - {POLAR_ZY, "POLAR_ZY", "Polar ZY", "Polar 0 is Y."}, - {0, NULL, NULL, NULL} + {POLAR_ZX, "POLAR_ZX", 0, "Polar ZX", "Polar 0 is X."}, + {POLAR_ZY, "POLAR_ZY", 0, "Polar ZY", "Polar 0 is Y."}, + {0, NULL, 0, NULL, NULL} }; RNA_def_enum(ot->srna, "direction", direction_items, VIEW_ON_EQUATOR, "Direction", "Direction of the sphere or cylinder."); @@ -820,9 +820,9 @@ static int unwrap_exec(bContext *C, wmOperator *op) void UV_OT_unwrap(wmOperatorType *ot) { static EnumPropertyItem method_items[] = { - {0, "ANGLE_BASED", "Angle Based", ""}, - {1, "CONFORMAL", "Conformal", ""}, - {0, NULL, NULL, NULL}}; + {0, "ANGLE_BASED", 0, "Angle Based", ""}, + {1, "CONFORMAL", 0, "Conformal", ""}, + {0, NULL, 0, NULL, NULL}}; /* identifiers */ ot->name= "Unwrap"; diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index d827d10ec27..f7b069d8227 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -479,6 +479,8 @@ void RNA_pointer_create(struct ID *id, StructRNA *type, void *data, PointerRNA * void RNA_blender_rna_pointer_create(PointerRNA *r_ptr); +extern PointerRNA PointerRNA_NULL; + /* Structs */ const char *RNA_struct_identifier(StructRNA *type); @@ -527,6 +529,7 @@ int RNA_property_string_maxlength(PropertyRNA *prop); const char *RNA_property_ui_name(PropertyRNA *prop); const char *RNA_property_ui_description(PropertyRNA *prop); +int RNA_property_ui_icon(PropertyRNA *prop); /* Dynamic Property Information */ diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index c40f50c34fc..6cd8cce59a3 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -136,6 +136,7 @@ void RNA_def_property_string_default(PropertyRNA *prop, const char *value); void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description); void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision); +void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive); void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *updatefunc); void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable); diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 7e62ea6d823..b527a4f11b3 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -91,9 +91,13 @@ typedef enum PropertyFlag { * and collections */ PROP_ANIMATEABLE = 2, + /* icon */ + PROP_ICONS_CONSECUTIVE = 4096, + /* function paramater flags */ PROP_REQUIRED = 4, PROP_RETURN = 8, + PROP_RNAPTR = 2048, /* registering */ PROP_REGISTER = 16, @@ -133,6 +137,7 @@ typedef struct CollectionPointerLink { typedef struct EnumPropertyItem { int value; const char *identifier; + int icon; const char *name; const char *description; } EnumPropertyItem; diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index 7bf968a0979..967636fe36b 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -7,6 +7,6 @@ o = SConscript('intern/SConscript') objs += o incs = '#/intern/guardedalloc ../blenkernel ../blenlib ../makesdna intern .' -incs += ' ../windowmanager ../editors/include' +incs += ' ../windowmanager ../editors/include ../imbuf' env.BlenderLib ( 'bf_rna', objs, Split(incs), [], libtype=['core'], priority = [195] ) diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index bc3be44aec9..2914e488efa 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -38,7 +38,7 @@ SET(SRC ../../../../intern/guardedalloc/intern/mallocn.c ../../../../intern/guardedalloc/intern/mmap_win.c) -INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../windowmanager ../../editors/include .) +INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../windowmanager ../../editors/include ../../imbuf .) FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h) IF(WITH_OPENEXR) diff --git a/source/blender/makesrna/intern/Makefile b/source/blender/makesrna/intern/Makefile index cd1f27f43b7..78757c4f4b5 100644 --- a/source/blender/makesrna/intern/Makefile +++ b/source/blender/makesrna/intern/Makefile @@ -47,6 +47,7 @@ CFLAGS += $(LEVEL_1_C_WARNINGS) CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include CPPFLAGS += -I../../blenlib CPPFLAGS += -I../../blenkernel +CPPFLAGS += -I../../imbuf CPPFLAGS += -I../../makesdna CPPFLAGS += -I../../windowmanager CPPFLAGS += -I../../editors/include diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 9c8e00da16d..041f743a056 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -41,11 +41,15 @@ if env['WITH_BF_FFMPEG']: if env['WITH_BF_QUICKTIME']: defs.append('WITH_QUICKTIME') +if env['WITH_BF_LCMS']: + defs.append('WITH_LCMS') + makesrna_tool.Append(CPPDEFINES=defs) makesrna_tool.Append (CPPPATH = ['#/intern/guardedalloc', '../../blenlib', '../../blenkernel', + '../../imbuf', '../../makesdna', '../../makesrna', '../../windowmanager', diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index ea587174f54..dd438cfe164 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -242,7 +242,7 @@ static const char *rna_parameter_type_name(PropertyRNA *parm) case PROP_POINTER: { PointerPropertyRNA *pparm= (PointerPropertyRNA*)parm; - if(strcmp((char*)pparm->type, "AnyType") == 0) + if(parm->flag & PROP_RNAPTR) return "PointerRNA"; else return rna_find_dna_type((const char *)pparm->type); @@ -1146,9 +1146,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA else if(dparm->prop->arraylength) fprintf(f, "\t%s= ((%s%s*)_data);\n", dparm->prop->identifier, rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop)); else if(dparm->prop->type == PROP_POINTER) { - PointerPropertyRNA *pprop= (PointerPropertyRNA*)dparm->prop; - - if(strcmp((char*)pprop->type, "AnyType") == 0) + if(dparm->prop->flag & PROP_RNAPTR) fprintf(f, "\t%s= ((%s%s*)_data);\n", dparm->prop->identifier, rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop)); else fprintf(f, "\t%s= *((%s%s**)_data);\n", dparm->prop->identifier, rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop)); @@ -1467,6 +1465,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr for(i=0; itotitem; i++) { fprintf(f, "{%d, ", eprop->item[i].value); rna_print_c_string(f, eprop->item[i].identifier); fprintf(f, ", "); + fprintf(f, "%d, ", eprop->item[i].icon); rna_print_c_string(f, eprop->item[i].name); fprintf(f, ", "); rna_print_c_string(f, eprop->item[i].description); fprintf(f, "}"); if(i != eprop->totitem-1) @@ -1565,6 +1564,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr fprintf(f, ", %d, ", prop->flag); rna_print_c_string(f, prop->name); fprintf(f, ",\n\t"); rna_print_c_string(f, prop->description); fprintf(f, ",\n"); + fprintf(f, "%d, ", prop->icon); fprintf(f, "\t%s, %s, %d,\n", rna_property_typename(prop->type), rna_property_subtypename(prop->subtype), prop->arraylength); fprintf(f, "\t%s, %d, %s},\n", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable)); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 870fa4d9aa3..2413cd46eed 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -53,6 +53,8 @@ void RNA_exit() /* Pointer */ +PointerRNA PointerRNA_NULL = {{0}, 0, 0}; + void RNA_main_pointer_create(struct Main *main, PointerRNA *r_ptr) { r_ptr->id.data= NULL; @@ -677,6 +679,11 @@ const char *RNA_property_ui_description(PropertyRNA *prop) return rna_ensure_property(prop)->description; } +int RNA_property_ui_icon(PropertyRNA *prop) +{ + return rna_ensure_property(prop)->icon; +} + int RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop) { ID *id; @@ -2674,7 +2681,7 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop ptype= RNA_property_pointer_type(ptr, prop); - if(ptype == &RNA_AnyType) { + if(prop->flag & PROP_RNAPTR) { *((PointerRNA*)dest)= *((PointerRNA*)src); } else if (ptype!=srna) { diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index 531ae1e2790..3eb88e706e9 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -41,25 +41,25 @@ void RNA_def_actuator(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem actuator_type_items[] ={ - {ACT_OBJECT, "OBJECT", "Object", ""}, - {ACT_IPO, "IPO", "IPO", ""}, - {ACT_CAMERA, "CAMERA", "Camera", ""}, - {ACT_SOUND, "SOUND", "Sound", ""}, - {ACT_PROPERTY, "PROPERTY", "Property", ""}, - {ACT_CONSTRAINT, "CONSTRAINT", "Constraint", ""}, - {ACT_EDIT_OBJECT, "EDIT_OBJECT", "Edit Object", ""}, - {ACT_SCENE, "SCENE", "Scene", ""}, - {ACT_RANDOM, "RANDOM", "Random", ""}, - {ACT_MESSAGE, "MESSAGE", "Message", ""}, - {ACT_ACTION, "ACTION", "Action", ""}, - {ACT_CD, "CD", "CD", ""}, - {ACT_GAME, "GAME", "Game", ""}, - {ACT_VISIBILITY, "VISIBILITY", "Visibility", ""}, - {ACT_2DFILTER, "FILTER_2D", "2D Filter", ""}, - {ACT_PARENT, "PARENT", "Parent", ""}, - {ACT_SHAPEACTION, "SHAPE_ACTION", "Shape Action", ""}, - {ACT_STATE, "STATE", "State", ""}, - {0, NULL, NULL, NULL}}; + {ACT_OBJECT, "OBJECT", 0, "Object", ""}, + {ACT_IPO, "IPO", 0, "IPO", ""}, + {ACT_CAMERA, "CAMERA", 0, "Camera", ""}, + {ACT_SOUND, "SOUND", 0, "Sound", ""}, + {ACT_PROPERTY, "PROPERTY", 0, "Property", ""}, + {ACT_CONSTRAINT, "CONSTRAINT", 0, "Constraint", ""}, + {ACT_EDIT_OBJECT, "EDIT_OBJECT", 0, "Edit Object", ""}, + {ACT_SCENE, "SCENE", 0, "Scene", ""}, + {ACT_RANDOM, "RANDOM", 0, "Random", ""}, + {ACT_MESSAGE, "MESSAGE", 0, "Message", ""}, + {ACT_ACTION, "ACTION", 0, "Action", ""}, + {ACT_CD, "CD", 0, "CD", ""}, + {ACT_GAME, "GAME", 0, "Game", ""}, + {ACT_VISIBILITY, "VISIBILITY", 0, "Visibility", ""}, + {ACT_2DFILTER, "FILTER_2D", 0, "2D Filter", ""}, + {ACT_PARENT, "PARENT", 0, "Parent", ""}, + {ACT_SHAPEACTION, "SHAPE_ACTION", 0, "Shape Action", ""}, + {ACT_STATE, "STATE", 0, "State", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Actuator", NULL); RNA_def_struct_ui_text(srna, "Actuator", "Game engine logic brick to apply actions in the game engine."); diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 702dc9fa65d..2ed47effec1 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -79,11 +79,11 @@ void rna_def_keyingset_path(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_mode_grouping_items[] = { - {KSP_GROUP_NAMED, "NAMED", "Named Group", ""}, - {KSP_GROUP_NONE, "NONE", "None", ""}, - {KSP_GROUP_KSNAME, "KEYINGSET", "Keying Set Name", ""}, - {KSP_GROUP_TEMPLATE_ITEM, "TEMPLATE", "Innermost Context-Item Name", ""}, - {0, NULL, NULL, NULL}}; + {KSP_GROUP_NAMED, "NAMED", 0, "Named Group", ""}, + {KSP_GROUP_NONE, "NONE", 0, "None", ""}, + {KSP_GROUP_KSNAME, "KEYINGSET", 0, "Keying Set Name", ""}, + {KSP_GROUP_TEMPLATE_ITEM, "TEMPLATE", 0, "Innermost Context-Item Name", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "KeyingSetPath", NULL); RNA_def_struct_sdna(srna, "KS_Path"); diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index aa74e7429e2..631550964d6 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -256,16 +256,16 @@ void rna_def_armature(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_drawtype_items[] = { - {ARM_OCTA, "OCTAHEDRAL", "Octahedral", "Draw bones as octahedral shape (default)."}, - {ARM_LINE, "STICK", "Stick", "Draw bones as simple 2D lines with dots."}, - {ARM_B_BONE, "BBONE", "B-Bone", "Draw bones as boxes, showing subdivision and B-Splines"}, - {ARM_ENVELOPE, "ENVELOPE", "Envelope", "Draw bones as extruded spheres, showing defomation influence volume."}, - {0, NULL, NULL, NULL}}; + {ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Draw bones as octahedral shape (default)."}, + {ARM_LINE, "STICK", 0, "Stick", "Draw bones as simple 2D lines with dots."}, + {ARM_B_BONE, "BBONE", 0, "B-Bone", "Draw bones as boxes, showing subdivision and B-Splines"}, + {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", "Draw bones as extruded spheres, showing defomation influence volume."}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_ghost_type_items[] = { - {ARM_GHOST_CUR, "CURRENT_FRAME", "Around Current Frame", "Draw Ghosts of poses within a fixed number of frames around the current frame."}, - {ARM_GHOST_RANGE, "RANGE", "In Range", "Draw Ghosts of poses within specified range."}, - {ARM_GHOST_KEYS, "KEYS", "On Keyframes", "Draw Ghosts of poses on Keyframes."}, - {0, NULL, NULL, NULL}}; + {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Current Frame", "Draw Ghosts of poses within a fixed number of frames around the current frame."}, + {ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Draw Ghosts of poses within specified range."}, + {ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Draw Ghosts of poses on Keyframes."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Armature", "ID"); RNA_def_struct_ui_text(srna, "Armature", "Armature datablock containing a hierarchy of bones, usually used for rigging characters."); diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 3deb38a3a07..90617d01833 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -67,29 +67,29 @@ void rna_def_brush(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_blend_items[] = { - {BRUSH_BLEND_MIX, "MIX", "Mix", "Use mix blending mode while painting."}, - {BRUSH_BLEND_ADD, "ADD", "Add", "Use add blending mode while painting."}, - {BRUSH_BLEND_SUB, "SUB", "Subtract", "Use subtract blending mode while painting."}, - {BRUSH_BLEND_MUL, "MUL", "Multiply", "Use multiply blending mode while painting."}, - {BRUSH_BLEND_LIGHTEN, "LIGHTEN", "Lighten", "Use lighten blending mode while painting."}, - {BRUSH_BLEND_DARKEN, "DARKEN", "Darken", "Use darken blending mode while painting."}, - {BRUSH_BLEND_ERASE_ALPHA, "ERASE_ALPHA", "Erase Alpha", "Erase alpha while painting."}, - {BRUSH_BLEND_ADD_ALPHA, "ADD_ALPHA", "Add Alpha", "Add alpha while painting."}, - {0, NULL, NULL, NULL}}; + {BRUSH_BLEND_MIX, "MIX", 0, "Mix", "Use mix blending mode while painting."}, + {BRUSH_BLEND_ADD, "ADD", 0, "Add", "Use add blending mode while painting."}, + {BRUSH_BLEND_SUB, "SUB", 0, "Subtract", "Use subtract blending mode while painting."}, + {BRUSH_BLEND_MUL, "MUL", 0, "Multiply", "Use multiply blending mode while painting."}, + {BRUSH_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", "Use lighten blending mode while painting."}, + {BRUSH_BLEND_DARKEN, "DARKEN", 0, "Darken", "Use darken blending mode while painting."}, + {BRUSH_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting."}, + {BRUSH_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting."}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_texture_mode_items[] = { - {BRUSH_TEX_DRAG, "TEX_DRAG", "Drag", ""}, - {BRUSH_TEX_TILE, "TEX_TILE", "Tile", ""}, - {BRUSH_TEX_3D, "TEX_3D", "3D", ""}, - {0, NULL, NULL, NULL}}; + {BRUSH_TEX_DRAG, "TEX_DRAG", 0, "Drag", ""}, + {BRUSH_TEX_TILE, "TEX_TILE", 0, "Tile", ""}, + {BRUSH_TEX_3D, "TEX_3D", 0, "3D", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_sculpt_tool_items[] = { - {SCULPT_TOOL_DRAW, "DRAW", "Draw", ""}, - {SCULPT_TOOL_SMOOTH, "SMOOTH", "Smooth", ""}, - {SCULPT_TOOL_PINCH, "PINCH", "Pinch", ""}, - {SCULPT_TOOL_INFLATE, "INFLATE", "Inflate", ""}, - {SCULPT_TOOL_GRAB, "GRAB", "Grab", ""}, - {SCULPT_TOOL_LAYER, "LAYER", "Layer", ""}, - {SCULPT_TOOL_FLATTEN, "FLATTEN", "Flatten", ""}, - {0, NULL, NULL, NULL}}; + {SCULPT_TOOL_DRAW, "DRAW", 0, "Draw", ""}, + {SCULPT_TOOL_SMOOTH, "SMOOTH", 0, "Smooth", ""}, + {SCULPT_TOOL_PINCH, "PINCH", 0, "Pinch", ""}, + {SCULPT_TOOL_INFLATE, "INFLATE", 0, "Inflate", ""}, + {SCULPT_TOOL_GRAB, "GRAB", 0, "Grab", ""}, + {SCULPT_TOOL_LAYER, "LAYER", 0, "Layer", ""}, + {SCULPT_TOOL_FLATTEN, "FLATTEN", 0, "Flatten", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Brush", "ID"); RNA_def_struct_ui_text(srna, "Brush", "Brush datablock for storing brush settings for painting and sculpting."); diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index e64f58e9a9c..4814f9583a9 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -42,13 +42,13 @@ void RNA_def_camera(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_type_items[] = { - {CAM_PERSP, "PERSP", "Perspective", ""}, - {CAM_ORTHO, "ORTHO", "Orthographic", ""}, - {0, NULL, NULL, NULL}}; + {CAM_PERSP, "PERSP", 0, "Perspective", ""}, + {CAM_ORTHO, "ORTHO", 0, "Orthographic", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_lens_unit_items[] = { - {0, "MILLIMETERS", "Millimeters", ""}, - {CAM_ANGLETOGGLE, "DEGREES", "Degrees", ""}, - {0, NULL, NULL, NULL}}; + {0, "MILLIMETERS", 0, "Millimeters", ""}, + {CAM_ANGLETOGGLE, "DEGREES", 0, "Degrees", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Camera", "ID"); RNA_def_struct_ui_text(srna, "Camera", "Camera datablock for storing camera settings."); diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index dcd5a494e5d..09b423e6753 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -120,9 +120,9 @@ static void rna_def_curvemappoint(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_handle_type_items[] = { - {0, "AUTO", "Auto Handle", ""}, - {CUMA_VECTOR, "VECTOR", "Vector Handle", ""}, - {0, NULL, NULL, NULL} + {0, "AUTO", 0, "Auto Handle", ""}, + {CUMA_VECTOR, "VECTOR", 0, "Vector Handle", ""}, + {0, NULL, 0, NULL, NULL} }; srna= RNA_def_struct(brna, "CurveMapPoint", NULL); @@ -152,9 +152,9 @@ static void rna_def_curvemap(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_extend_items[] = { - {0, "HORIZONTAL", "Horizontal", ""}, - {CUMA_EXTEND_EXTRAPOLATE, "EXTRAPOLATED", "Extrapolated", ""}, - {0, NULL, NULL, NULL} + {0, "HORIZONTAL", 0, "Horizontal", ""}, + {CUMA_EXTEND_EXTRAPOLATE, "EXTRAPOLATED", 0, "Extrapolated", ""}, + {0, NULL, 0, NULL, NULL} }; srna= RNA_def_struct(brna, "CurveMap", NULL); diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index fd1a97ac3c6..80c145911b1 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -36,37 +36,37 @@ #include "WM_types.h" EnumPropertyItem constraint_type_items[] ={ - {CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", "Child Of", ""}, - {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", "Transformation", ""}, + {CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", 0, "Child Of", ""}, + {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", 0, "Transformation", ""}, - {CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", "Copy Location", ""}, - {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", "Copy Rotation", ""}, - {CONSTRAINT_TYPE_SIZELIKE, "COPY_SCALE", "Copy Scale", ""}, + {CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", 0, "Copy Location", ""}, + {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", 0, "Copy Rotation", ""}, + {CONSTRAINT_TYPE_SIZELIKE, "COPY_SCALE", 0, "Copy Scale", ""}, - {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", "Limit Location", ""}, - {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", "Limit Rotation", ""}, - {CONSTRAINT_TYPE_SIZELIMIT, "LIMIT_SCALE", "Limit Scale", ""}, - {CONSTRAINT_TYPE_DISTLIMIT, "LIMIT_DISTANCE", "Limit Distance", ""}, + {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", 0, "Limit Location", ""}, + {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", 0, "Limit Rotation", ""}, + {CONSTRAINT_TYPE_SIZELIMIT, "LIMIT_SCALE", 0, "Limit Scale", ""}, + {CONSTRAINT_TYPE_DISTLIMIT, "LIMIT_DISTANCE", 0, "Limit Distance", ""}, - {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", "Track To", ""}, - {CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", "Locked Track", ""}, + {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", 0, "Track To", ""}, + {CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", 0, "Locked Track", ""}, - {CONSTRAINT_TYPE_MINMAX, "FLOOR", "Floor", ""}, - {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", "Shrinkwrap", ""}, - {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", "Follow Path", ""}, + {CONSTRAINT_TYPE_MINMAX, "FLOOR", 0, "Floor", ""}, + {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", 0, "Shrinkwrap", ""}, + {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", 0, "Follow Path", ""}, - {CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", "Clamp To", ""}, - {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO", "Stretch To", ""}, + {CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", 0, "Clamp To", ""}, + {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO", 0, "Stretch To", ""}, - {CONSTRAINT_TYPE_KINEMATIC, "IK", "IK", ""}, - {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", "Rigid Body Joint", ""}, + {CONSTRAINT_TYPE_KINEMATIC, "IK", 0, "IK", ""}, + {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", 0, "Rigid Body Joint", ""}, - {CONSTRAINT_TYPE_ACTION, "ACTION", "Action", ""}, + {CONSTRAINT_TYPE_ACTION, "ACTION", 0, "Action", ""}, - {CONSTRAINT_TYPE_PYTHON, "SCRIPT", "Script", ""}, + {CONSTRAINT_TYPE_PYTHON, "SCRIPT", 0, "Script", ""}, - {CONSTRAINT_TYPE_NULL, "NULL", "Null", ""}, - {0, NULL, NULL, NULL}}; + {CONSTRAINT_TYPE_NULL, "NULL", 0, "Null", ""}, + {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME @@ -167,16 +167,16 @@ static void rna_Constraint_influence_update(bContext *C, PointerRNA *ptr) } static EnumPropertyItem space_pchan_items[] = { - {0, "WORLD", "World Space", ""}, - {2, "POSE", "Pose Space", ""}, - {3, "LOCAL_WITH_PARENT", "Local With Parent", ""}, - {1, "LOCAL", "Local Space", ""}, - {0, NULL, NULL, NULL}}; + {0, "WORLD", 0, "World Space", ""}, + {2, "POSE", 0, "Pose Space", ""}, + {3, "LOCAL_WITH_PARENT", 0, "Local With Parent", ""}, + {1, "LOCAL", 0, "Local Space", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem space_object_items[] = { - {0, "WORLD", "World Space", ""}, - {1, "LOCAL", "Local (Without Parent) Space", ""}, - {0, NULL, NULL, NULL}}; + {0, "WORLD", 0, "World Space", ""}, + {1, "LOCAL", 0, "Local (Without Parent) Space", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem *rna_Constraint_owner_space_itemf(PointerRNA *ptr) { @@ -424,19 +424,19 @@ static void rna_def_constraint_track_to(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem track_items[] = { - {TRACK_X, "TRACK_X", "X", ""}, - {TRACK_Y, "TRACK_Y", "Y", ""}, - {TRACK_Z, "TRACK_Z", "Z", ""}, - {TRACK_nX, "TRACK_NEGATIVE_X", "-X", ""}, - {TRACK_nY, "TRACK_NEGATIVE_Y", "-Y", ""}, - {TRACK_nZ, "TRACK_NEGATIVE_Z", "-Z", ""}, - {0, NULL, NULL, NULL}}; + {TRACK_X, "TRACK_X", 0, "X", ""}, + {TRACK_Y, "TRACK_Y", 0, "Y", ""}, + {TRACK_Z, "TRACK_Z", 0, "Z", ""}, + {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""}, + {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""}, + {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem up_items[] = { - {TRACK_X, "UP_X", "X", ""}, - {TRACK_Y, "UP_Y", "Y", ""}, - {TRACK_Z, "UP_Z", "Z", ""}, - {0, NULL, NULL, NULL}}; + {TRACK_X, "UP_X", 0, "X", ""}, + {TRACK_Y, "UP_Y", 0, "Y", ""}, + {TRACK_Z, "UP_Z", 0, "Z", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "TrackToConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Track To Constraint", "Aims the constrained object toward the target."); @@ -597,13 +597,13 @@ static void rna_def_constraint_minmax(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem minmax_items[] = { - {LOCLIKE_X, "FLOOR_X", "X", ""}, - {LOCLIKE_Y, "FLOOR_Y", "Y", ""}, - {LOCLIKE_Z, "FLOOR_Z", "Z", ""}, - {LOCLIKE_X_INVERT, "FLOOR_NEGATIVE_X", "-X", ""}, - {LOCLIKE_Y_INVERT, "FLOOR_NEGATIVE_Y", "-Y", ""}, - {LOCLIKE_Z_INVERT, "FLOOR_NEGATIVE_Z", "-Z", ""}, - {0, NULL, NULL, NULL}}; + {LOCLIKE_X, "FLOOR_X", 0, "X", ""}, + {LOCLIKE_Y, "FLOOR_Y", 0, "Y", ""}, + {LOCLIKE_Z, "FLOOR_Z", 0, "Z", ""}, + {LOCLIKE_X_INVERT, "FLOOR_NEGATIVE_X", 0, "-X", ""}, + {LOCLIKE_Y_INVERT, "FLOOR_NEGATIVE_Y", 0, "-Y", ""}, + {LOCLIKE_Z_INVERT, "FLOOR_NEGATIVE_Z", 0, "-Z", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FloorConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Floor Constraint", "Uses the target object for location limitation."); @@ -690,16 +690,16 @@ static void rna_def_constraint_action(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem transform_channel_items[] = { - {00, "ROTATION_X", "Rotation X", ""}, - {01, "ROTATION_Y", "Rotation Y", ""}, - {02, "ROTATION_Z", "Rotation Z", ""}, - {10, "SIZE_X", "Scale X", ""}, - {11, "SIZE_Y", "Scale Y", ""}, - {12, "SIZE_Z", "Scale Z", ""}, - {20, "LOCATION_X", "Location X", ""}, - {21, "LOCATION_Y", "Location Y", ""}, - {22, "LOCATION_Z", "Location Z", ""}, - {0, NULL, NULL, NULL}}; + {00, "ROTATION_X", 0, "Rotation X", ""}, + {01, "ROTATION_Y", 0, "Rotation Y", ""}, + {02, "ROTATION_Z", 0, "Rotation Z", ""}, + {10, "SIZE_X", 0, "Scale X", ""}, + {11, "SIZE_Y", 0, "Scale Y", ""}, + {12, "SIZE_Z", 0, "Scale Z", ""}, + {20, "LOCATION_X", 0, "Location X", ""}, + {21, "LOCATION_Y", 0, "Location Y", ""}, + {22, "LOCATION_Z", 0, "Location Z", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ActionConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Action Constraint", "Map an action to the transform axes of a bone."); @@ -759,19 +759,19 @@ static void rna_def_constraint_locked_track(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem locktrack_items[] = { - {TRACK_X, "TRACK_X", "X", ""}, - {TRACK_Y, "TRACK_Y", "Y", ""}, - {TRACK_Z, "TRACK_Z", "Z", ""}, - {TRACK_nX, "TRACK_NEGATIVE_X", "-X", ""}, - {TRACK_nY, "TRACK_NEGATIVE_Y", "-Y", ""}, - {TRACK_nZ, "TRACK_NEGATIVE_Z", "-Z", ""}, - {0, NULL, NULL, NULL}}; + {TRACK_X, "TRACK_X", 0, "X", ""}, + {TRACK_Y, "TRACK_Y", 0, "Y", ""}, + {TRACK_Z, "TRACK_Z", 0, "Z", ""}, + {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""}, + {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""}, + {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem lock_items[] = { - {TRACK_X, "LOCK_X", "X", ""}, - {TRACK_Y, "LOCK_Y", "Y", ""}, - {TRACK_Z, "LOCK_Z", "Z", ""}, - {0, NULL, NULL, NULL}}; + {TRACK_X, "LOCK_X", 0, "X", ""}, + {TRACK_Y, "LOCK_Y", 0, "Y", ""}, + {TRACK_Z, "LOCK_Z", 0, "Z", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "LockedTrackConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Locked Track Constraint", "Points toward the target along the track axis, while locking the other axis."); @@ -807,19 +807,19 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem forwardpath_items[] = { - {TRACK_X, "FORWARD_X", "X", ""}, - {TRACK_Y, "FORWARD_Y", "Y", ""}, - {TRACK_Z, "FORWARD_Z", "Z", ""}, - {TRACK_nX, "TRACK_NEGATIVE_X", "-X", ""}, - {TRACK_nY, "TRACK_NEGATIVE_Y", "-Y", ""}, - {TRACK_nZ, "TRACK_NEGATIVE_Z", "-Z", ""}, - {0, NULL, NULL, NULL}}; + {TRACK_X, "FORWARD_X", 0, "X", ""}, + {TRACK_Y, "FORWARD_Y", 0, "Y", ""}, + {TRACK_Z, "FORWARD_Z", 0, "Z", ""}, + {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""}, + {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""}, + {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem pathup_items[] = { - {TRACK_X, "UP_X", "X", ""}, - {TRACK_Y, "UP_Y", "Y", ""}, - {TRACK_Z, "UP_Z", "Z", ""}, - {0, NULL, NULL, NULL}}; + {TRACK_X, "UP_X", 0, "X", ""}, + {TRACK_Y, "UP_Y", 0, "Y", ""}, + {TRACK_Z, "UP_Z", 0, "Z", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FollowPathConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Follow Path Constraint", "Locks motion to the target path."); @@ -860,16 +860,16 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem volume_items[] = { - {VOLUME_XZ, "VOLUME_XZX", "XZ", ""}, - {VOLUME_X, "VOLUME_X", "Y", ""}, - {VOLUME_Z, "VOLUME_Z", "Z", ""}, - {NO_VOLUME, "NO_VOLUME", "None", ""}, - {0, NULL, NULL, NULL}}; + {VOLUME_XZ, "VOLUME_XZX", 0, "XZ", ""}, + {VOLUME_X, "VOLUME_X", 0, "Y", ""}, + {VOLUME_Z, "VOLUME_Z", 0, "Z", ""}, + {NO_VOLUME, "NO_VOLUME", 0, "None", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem plane_items[] = { - {PLANE_X, "PLANE_X", "X", "Keep X Axis"}, - {PLANE_Z, "PLANE_Z", "Z", "Keep Z Axis"}, - {0, NULL, NULL, NULL}}; + {PLANE_X, "PLANE_X", 0, "X", "Keep X Axis"}, + {PLANE_Z, "PLANE_Z", 0, "Z", "Keep Z Axis"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "StretchToConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Stretch To Constraint", "Stretches to meet the target object."); @@ -911,11 +911,11 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem pivot_items[] = { - {CONSTRAINT_RB_BALL, "BALL", "Ball", ""}, - {CONSTRAINT_RB_HINGE, "HINGE", "Hinge", ""}, - {CONSTRAINT_RB_CONETWIST, "CONE_TWIST", "Cone Twist", ""}, - {CONSTRAINT_RB_GENERIC6DOF, "GENERIC_6_DOF", "Generic 6 DoF", ""}, - {0, NULL, NULL, NULL}}; + {CONSTRAINT_RB_BALL, "BALL", 0, "Ball", ""}, + {CONSTRAINT_RB_HINGE, "HINGE", 0, "Hinge", ""}, + {CONSTRAINT_RB_CONETWIST, "CONE_TWIST", 0, "Cone Twist", ""}, + {CONSTRAINT_RB_GENERIC6DOF, "GENERIC_6_DOF", 0, "Generic 6 DoF", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "RigidBodyJointConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Rigid Body Joint Constraint", "For use with the Game Engine."); @@ -995,11 +995,11 @@ static void rna_def_constraint_clamp_to(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem clamp_items[] = { - {CLAMPTO_AUTO, "CLAMPTO_AUTO", "Auto", ""}, - {CLAMPTO_X, "CLAMPTO_X", "X", ""}, - {CLAMPTO_Y, "CLAMPTO_Y", "Y", ""}, - {CLAMPTO_Z, "CLAMPTO_Z", "Z", ""}, - {0, NULL, NULL, NULL}}; + {CLAMPTO_AUTO, "CLAMPTO_AUTO", 0, "Auto", ""}, + {CLAMPTO_X, "CLAMPTO_X", 0, "X", ""}, + {CLAMPTO_Y, "CLAMPTO_Y", 0, "Y", ""}, + {CLAMPTO_Z, "CLAMPTO_Z", 0, "Z", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ClampToConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Clamp To Constraint", "Constrains an object's location to the nearest point along the target path."); @@ -1029,16 +1029,16 @@ static void rna_def_constraint_transform(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem transform_items[] = { - {0, "LOCATION", "Loc", ""}, - {1, "ROTATION", "Rot", ""}, - {2, "SCALE", "Scale", ""}, - {0, NULL, NULL, NULL}}; + {0, "LOCATION", 0, "Loc", ""}, + {1, "ROTATION", 0, "Rot", ""}, + {2, "SCALE", 0, "Scale", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem axis_map_items[] = { - {0, "X", "X", ""}, - {1, "Y", "Y", ""}, - {2, "Z", "Z", ""}, - {0, NULL, NULL, NULL}}; + {0, "X", 0, "X", ""}, + {1, "Y", 0, "Y", ""}, + {2, "Z", 0, "Z", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "TransformConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Transformation Constraint", "Maps transformations of the target to the object."); @@ -1397,10 +1397,10 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem distance_items[] = { - {LIMITDIST_INSIDE, "LIMITDIST_INSIDE", "Inside", ""}, - {LIMITDIST_OUTSIDE, "LIMITDIST_OUTSIDE", "Outside", ""}, - {LIMITDIST_ONSURFACE, "LIMITDIST_ONSURFACE", "On Surface", ""}, - {0, NULL, NULL, NULL}}; + {LIMITDIST_INSIDE, "LIMITDIST_INSIDE", 0, "Inside", ""}, + {LIMITDIST_OUTSIDE, "LIMITDIST_OUTSIDE", 0, "Outside", ""}, + {LIMITDIST_ONSURFACE, "LIMITDIST_ONSURFACE", 0, "On Surface", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "LimitDistanceConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Limit Distance Constraint", "Limits the distance from target object."); @@ -1436,10 +1436,10 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem type_items[] = { - {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACE", "Nearest Surface Point", ""}, - {MOD_SHRINKWRAP_PROJECT, "PROJECT", "Project", ""}, - {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", "Nearest Vertex", ""}, - {0, NULL, NULL, NULL}}; + {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACE", 0, "Nearest Surface Point", ""}, + {MOD_SHRINKWRAP_PROJECT, "PROJECT", 0, "Project", ""}, + {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ShrinkwrapConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Shrinkwrap Constraint", "Creates constraint-based shrinkwrap relationship."); diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c index ed609c48e50..07a50235733 100644 --- a/source/blender/makesrna/intern/rna_context.c +++ b/source/blender/makesrna/intern/rna_context.c @@ -55,25 +55,33 @@ static PointerRNA rna_Context_screen_get(PointerRNA *ptr) static PointerRNA rna_Context_area_get(PointerRNA *ptr) { bContext *C= (bContext*)ptr->data; - return rna_pointer_inherit_refine(ptr, &RNA_Area, CTX_wm_area(C)); + PointerRNA newptr; + RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_Area, CTX_wm_area(C), &newptr); + return newptr; } static PointerRNA rna_Context_space_data_get(PointerRNA *ptr) { bContext *C= (bContext*)ptr->data; - return rna_pointer_inherit_refine(ptr, &RNA_Space, CTX_wm_space_data(C)); + PointerRNA newptr; + RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_Space, CTX_wm_space_data(C), &newptr); + return newptr; } static PointerRNA rna_Context_region_get(PointerRNA *ptr) { bContext *C= (bContext*)ptr->data; - return rna_pointer_inherit_refine(ptr, &RNA_Region, CTX_wm_region(C)); + PointerRNA newptr; + RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_Region, CTX_wm_region(C), &newptr); + return newptr; } /*static PointerRNA rna_Context_region_data_get(PointerRNA *ptr) { bContext *C= (bContext*)ptr->data; - return rna_pointer_inherit_refine(ptr, &RNA_RegionData, CTX_wm_region_data(C)); + PointerRNA newptr; + RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_RegionData, CTX_wm_region_data(C), &newptr); + return newptr; }*/ static PointerRNA rna_Context_main_get(PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c index df603e7920f..4d5ef7aa123 100644 --- a/source/blender/makesrna/intern/rna_controller.c +++ b/source/blender/makesrna/intern/rna_controller.c @@ -66,15 +66,15 @@ void RNA_def_controller(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem controller_type_items[] ={ - {CONT_LOGIC_AND, "LOGIC_AND", "Logic And", ""}, - {CONT_LOGIC_OR, "LOGIC_OR", "Logic Or", ""}, - {CONT_LOGIC_NAND, "LOGIC_NAND", "Logic Nand", ""}, - {CONT_LOGIC_NOR, "LOGIC_NOR", "Logic Nor", ""}, - {CONT_LOGIC_XOR, "LOGIC_XOR", "Logic Xor", ""}, - {CONT_LOGIC_XNOR, "LOGIC_XNOR", "Logic Xnor", ""}, - {CONT_EXPRESSION, "EXPRESSION", "Expression", ""}, - {CONT_PYTHON, "PYTHON", "Python Script", ""}, - {0, NULL, NULL, NULL}}; + {CONT_LOGIC_AND, "LOGIC_AND", 0, "Logic And", ""}, + {CONT_LOGIC_OR, "LOGIC_OR", 0, "Logic Or", ""}, + {CONT_LOGIC_NAND, "LOGIC_NAND", 0, "Logic Nand", ""}, + {CONT_LOGIC_NOR, "LOGIC_NOR", 0, "Logic Nor", ""}, + {CONT_LOGIC_XOR, "LOGIC_XOR", 0, "Logic Xor", ""}, + {CONT_LOGIC_XNOR, "LOGIC_XNOR", 0, "Logic Xnor", ""}, + {CONT_EXPRESSION, "EXPRESSION", 0, "Expression", ""}, + {CONT_PYTHON, "PYTHON", 0, "Python Script", ""}, + {0, NULL, 0, NULL, NULL}}; /* Controller */ srna= RNA_def_struct(brna, "Controller", NULL); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index aac9d75c6a6..445a9b6070f 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -33,18 +33,18 @@ #include "DNA_material_types.h" EnumPropertyItem beztriple_handle_type_items[] = { - {HD_FREE, "FREE", "Free", ""}, - {HD_AUTO, "AUTO", "Auto", ""}, - {HD_VECT, "VECTOR", "Vector", ""}, - {HD_ALIGN, "ALIGNED", "Aligned", ""}, - {HD_AUTO_ANIM, "AUTO_CLAMPED", "Auto Clamped", ""}, - {0, NULL, NULL, NULL}}; + {HD_FREE, "FREE", 0, "Free", ""}, + {HD_AUTO, "AUTO", 0, "Auto", ""}, + {HD_VECT, "VECTOR", 0, "Vector", ""}, + {HD_ALIGN, "ALIGNED", 0, "Aligned", ""}, + {HD_AUTO_ANIM, "AUTO_CLAMPED", 0, "Auto Clamped", ""}, + {0, NULL, 0, NULL, NULL}}; EnumPropertyItem beztriple_interpolation_mode_items[] = { - {BEZT_IPO_CONST, "CONSTANT", "Constant", ""}, - {BEZT_IPO_LIN, "LINEAR", "Linear", ""}, - {BEZT_IPO_BEZ, "BEZIER", "Bezier", ""}, - {0, NULL, NULL, NULL}}; + {BEZT_IPO_CONST, "CONSTANT", 0, "Constant", ""}, + {BEZT_IPO_LIN, "LINEAR", 0, "Linear", ""}, + {BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""}, + {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME @@ -307,12 +307,12 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem prop_align_items[] = { - {CU_LEFT, "LEFT", "Left", "Align text to the left"}, - {CU_MIDDLE, "CENTRAL", "Center", "Center text"}, - {CU_RIGHT, "RIGHT", "Right", "Align text to the right"}, - {CU_JUSTIFY, "JUSTIFY", "Justify", "Align to the left and the right"}, - {CU_FLUSH, "FLUSH", "Flush", "Align to the left and the right, with equal character spacing"}, - {0, NULL, NULL, NULL}}; + {CU_LEFT, "LEFT", 0, "Left", "Align text to the left"}, + {CU_MIDDLE, "CENTRAL", 0, "Center", "Center text"}, + {CU_RIGHT, "RIGHT", 0, "Right", "Align text to the right"}, + {CU_JUSTIFY, "JUSTIFY", 0, "Justify", "Align to the left and the right"}, + {CU_FLUSH, "FLUSH", 0, "Flush", "Align to the left and the right, with equal character spacing"}, + {0, NULL, 0, NULL, NULL}}; /* Enums */ prop= RNA_def_property(srna, "spacemode", PROP_ENUM, PROP_NONE); @@ -590,11 +590,11 @@ static void rna_def_curve(BlenderRNA *brna) static void rna_def_curve_nurb(BlenderRNA *brna) { static EnumPropertyItem spline_interpolation_items[] = { - {BEZT_IPO_CONST, "LINEAR", "Linear", ""}, - {BEZT_IPO_LIN, "CARDINAL", "Cardinal", ""}, - {BEZT_IPO_BEZ, "BSPLINE", "BSpline", ""}, - {BEZT_IPO_BEZ, "EASE", "Ease", ""}, - {0, NULL, NULL, NULL}}; + {BEZT_IPO_CONST, "LINEAR", 0, "Linear", ""}, + {BEZT_IPO_LIN, "CARDINAL", 0, "Cardinal", ""}, + {BEZT_IPO_BEZ, "BSPLINE", 0, "BSpline", ""}, + {BEZT_IPO_BEZ, "EASE", 0, "Ease", ""}, + {0, NULL, 0, NULL, NULL}}; StructRNA *srna; PropertyRNA *prop; diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 33d94e800d1..05439f71f83 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -976,6 +976,13 @@ void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *d prop->description= description; } +void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive) +{ + prop->icon= icon; + if(consecutive) + prop->flag |= PROP_ICONS_CONSECUTIVE; +} + void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision) { StructRNA *srna= DefRNA.laststruct; @@ -2219,15 +2226,13 @@ int rna_parameter_size(PropertyRNA *parm) case PROP_STRING: return sizeof(char *); case PROP_POINTER: { - PointerPropertyRNA *pprop= (PointerPropertyRNA*)parm; - #ifdef RNA_RUNTIME - if(pprop->type == &RNA_AnyType) + if(parm->flag & PROP_RNAPTR) return sizeof(PointerRNA); else return sizeof(void *); #else - if(strcmp((char*)pprop->type, "AnyType") == 0) + if(parm->flag & PROP_RNAPTR) return sizeof(PointerRNA); else return sizeof(void *); diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index ea26118f267..806219ec6bf 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -35,15 +35,15 @@ #include "MEM_guardedalloc.h" EnumPropertyItem fmodifier_type_items[] = { - {FMODIFIER_TYPE_NULL, "NULL", "Invalid", ""}, - {FMODIFIER_TYPE_GENERATOR, "GENERATOR", "Generator", ""}, - {FMODIFIER_TYPE_ENVELOPE, "ENVELOPE", "Envelope", ""}, - {FMODIFIER_TYPE_CYCLES, "CYCLES", "Cycles", ""}, - {FMODIFIER_TYPE_NOISE, "NOISE", "Noise", ""}, - {FMODIFIER_TYPE_FILTER, "FILTER", "Filter", ""}, - {FMODIFIER_TYPE_PYTHON, "PYTHON", "Python", ""}, - {FMODIFIER_TYPE_LIMITS, "LIMITS", "Limits", ""}, - {0, NULL, NULL, NULL}}; + {FMODIFIER_TYPE_NULL, "NULL", 0, "Invalid", ""}, + {FMODIFIER_TYPE_GENERATOR, "GENERATOR", 0, "Generator", ""}, + {FMODIFIER_TYPE_ENVELOPE, "ENVELOPE", 0, "Envelope", ""}, + {FMODIFIER_TYPE_CYCLES, "CYCLES", 0, "Cycles", ""}, + {FMODIFIER_TYPE_NOISE, "NOISE", 0, "Noise", ""}, + {FMODIFIER_TYPE_FILTER, "FILTER", 0, "Filter", ""}, + {FMODIFIER_TYPE_PYTHON, "PYTHON", 0, "Python", ""}, + {FMODIFIER_TYPE_LIMITS, "LIMITS", 0, "Limits", ""}, + {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME @@ -220,11 +220,11 @@ static void rna_def_fmodifier_generator_common(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem prop_mode_items[] = { - {FCM_GENERATOR_POLYNOMIAL, "POLYNOMIAL", "Expanded Polynomial", ""}, - {FCM_GENERATOR_POLYNOMIAL_FACTORISED, "POLYNOMIAL_FACTORISED", "Factorised Polynomial", ""}, - {FCM_GENERATOR_FUNCTION, "FUNCTION", "Built-In Function", ""}, - {FCM_GENERATOR_EXPRESSION, "EXPRESSION", "Expression", ""}, - {0, NULL, NULL, NULL}}; + {FCM_GENERATOR_POLYNOMIAL, "POLYNOMIAL", 0, "Expanded Polynomial", ""}, + {FCM_GENERATOR_POLYNOMIAL_FACTORISED, "POLYNOMIAL_FACTORISED", 0, "Factorised Polynomial", ""}, + {FCM_GENERATOR_FUNCTION, "FUNCTION", 0, "Built-In Function", ""}, + {FCM_GENERATOR_EXPRESSION, "EXPRESSION", 0, "Expression", ""}, + {0, NULL, 0, NULL, NULL}}; /* struct wrapping settings */ RNA_def_struct_sdna_from(srna, "FMod_Generator", "data"); @@ -279,12 +279,12 @@ static void rna_def_fmodifier_generator_function(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_type_items[] = { - {0, "SIN", "Sine", ""}, - {1, "COS", "Cosine", ""}, - {2, "TAN", "Tangent", ""}, - {3, "SQRT", "Square Root", ""}, - {4, "LN", "Natural Logarithm", ""}, - {0, NULL, NULL, NULL}}; + {0, "SIN", 0, "Sine", ""}, + {1, "COS", 0, "Cosine", ""}, + {2, "TAN", 0, "Tangent", ""}, + {3, "SQRT", 0, "Square Root", ""}, + {4, "LN", 0, "Natural Logarithm", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FModifierGenerator_Function", "FModifier"); @@ -336,11 +336,11 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_type_items[] = { - {FCM_EXTRAPOLATE_NONE, "NONE", "No Cycles", "Don't do anything."}, - {FCM_EXTRAPOLATE_CYCLIC, "REPEAT", "Repeat Motion", "Repeat keyframe range as-is."}, - {FCM_EXTRAPOLATE_CYCLIC_OFFSET, "REPEAT_OFFSET", "Repeat with Offset", "Repeat keyframe range, but with offset based on gradient between values"}, - {FCM_EXTRAPOLATE_MIRROR, "MIRROR", "Repeat Mirrored", "Alternate between forward and reverse playback of keyframe range"}, - {0, NULL, NULL, NULL}}; + {FCM_EXTRAPOLATE_NONE, "NONE", 0, "No Cycles", "Don't do anything."}, + {FCM_EXTRAPOLATE_CYCLIC, "REPEAT", 0, "Repeat Motion", "Repeat keyframe range as-is."}, + {FCM_EXTRAPOLATE_CYCLIC_OFFSET, "REPEAT_OFFSET", 0, "Repeat with Offset", "Repeat keyframe range, but with offset based on gradient between values"}, + {FCM_EXTRAPOLATE_MIRROR, "MIRROR", 0, "Repeat Mirrored", "Alternate between forward and reverse playback of keyframe range"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FModifierCycles", "FModifier"); RNA_def_struct_ui_text(srna, "Cycles F-Curve Modifier", "Repeats the values of the modified F-Curve."); @@ -428,11 +428,11 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_modification_items[] = { - {FCM_NOISE_MODIF_REPLACE, "REPLACE", "Replace", ""}, - {FCM_NOISE_MODIF_ADD, "ADD", "Add", ""}, - {FCM_NOISE_MODIF_SUBTRACT, "SUBTRACT", "Subtract", ""}, - {FCM_NOISE_MODIF_MULTIPLY, "MULTIPLY", "Multiply", ""}, - {0, NULL, NULL, NULL}}; + {FCM_NOISE_MODIF_REPLACE, "REPLACE", 0, "Replace", ""}, + {FCM_NOISE_MODIF_ADD, "ADD", 0, "Add", ""}, + {FCM_NOISE_MODIF_SUBTRACT, "SUBTRACT", 0, "Subtract", ""}, + {FCM_NOISE_MODIF_MULTIPLY, "MULTIPLY", 0, "Multiply", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FModifierNoise", "FModifier"); RNA_def_struct_ui_text(srna, "Noise F-Curve Modifier", "Gives randomness to the modified F-Curve."); @@ -542,10 +542,10 @@ void rna_def_channeldriver(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_type_items[] = { - {DRIVER_TYPE_AVERAGE, "AVERAGE", "Averaged Value", ""}, - {DRIVER_TYPE_PYTHON, "SCRIPTED", "Scripted Expression", ""}, - {DRIVER_TYPE_ROTDIFF, "ROTDIFF", "Rotational Difference", ""}, - {0, NULL, NULL, NULL}}; + {DRIVER_TYPE_AVERAGE, "AVERAGE", 0, "Averaged Value", ""}, + {DRIVER_TYPE_PYTHON, "SCRIPTED", 0, "Scripted Expression", ""}, + {DRIVER_TYPE_ROTDIFF, "ROTDIFF", 0, "Rotational Difference", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Driver", NULL); RNA_def_struct_sdna(srna, "ChannelDriver"); @@ -575,14 +575,14 @@ void rna_def_fcurve(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_mode_extend_items[] = { - {FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", "Constant", ""}, - {FCURVE_EXTRAPOLATE_LINEAR, "LINEAR", "Linear", ""}, - {0, NULL, NULL, NULL}}; + {FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", 0, "Constant", ""}, + {FCURVE_EXTRAPOLATE_LINEAR, "LINEAR", 0, "Linear", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_mode_color_items[] = { - {FCURVE_COLOR_AUTO_RAINBOW, "AUTO_RAINBOW", "Automatic Rainbow", ""}, - {FCURVE_COLOR_AUTO_RGB, "AUTO_RGB", "Automatic XYZ to RGB", ""}, - {FCURVE_COLOR_CUSTOM, "CUSTOM", "User Defined", ""}, - {0, NULL, NULL, NULL}}; + {FCURVE_COLOR_AUTO_RAINBOW, "AUTO_RAINBOW", 0, "Automatic Rainbow", ""}, + {FCURVE_COLOR_AUTO_RGB, "AUTO_RGB", 0, "Automatic XYZ to RGB", ""}, + {FCURVE_COLOR_CUSTOM, "CUSTOM", 0, "User Defined", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FCurve", NULL); RNA_def_struct_ui_text(srna, "F-Curve", "F-Curve defining values of a period of time."); diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index 210024f0859..4e047ff7772 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -64,10 +64,10 @@ static void rna_def_fluidsim_slip(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem slip_items[] = { - {OB_FSBND_NOSLIP, "NOSLIP", "No Slip", "Obstacle causes zero normal and tangential velocity (=sticky). Default for all. Only option for moving objects."}, - {OB_FSBND_PARTSLIP, "PARTIALSLIP", "Partial Slip", "Mix between no-slip and free-slip. Non moving objects only!"}, - {OB_FSBND_FREESLIP, "FREESLIP", "Free Slip", "Obstacle only causes zero normal velocity (=not sticky). Non moving objects only!"}, - {0, NULL, NULL, NULL}}; + {OB_FSBND_NOSLIP, "NOSLIP", 0, "No Slip", "Obstacle causes zero normal and tangential velocity (=sticky). Default for all. Only option for moving objects."}, + {OB_FSBND_PARTSLIP, "PARTIALSLIP", 0, "Partial Slip", "Mix between no-slip and free-slip. Non moving objects only!"}, + {OB_FSBND_FREESLIP, "FREESLIP", 0, "Free Slip", "Obstacle only causes zero normal velocity (=not sticky). Non moving objects only!"}, + {0, NULL, 0, NULL, NULL}}; prop= RNA_def_property(srna, "slip_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "typeFlags"); @@ -86,17 +86,17 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem quality_items[] = { - {OB_FSDOM_GEOM, "GEOMETRY", "Geometry", "Display geometry."}, - {OB_FSDOM_PREVIEW, "PREVIEW", "Preview", "Display preview quality results."}, - {OB_FSDOM_FINAL, "FINAL", "Final", "Display final quality results."}, - {0, NULL, NULL, NULL}}; + {OB_FSDOM_GEOM, "GEOMETRY", 0, "Geometry", "Display geometry."}, + {OB_FSDOM_PREVIEW, "PREVIEW", 0, "Preview", "Display preview quality results."}, + {OB_FSDOM_FINAL, "FINAL", 0, "Final", "Display final quality results."}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem viscosity_items[] = { - {1, "MANUAL", "Manual", "Manual viscosity settings."}, - {2, "WATER", "Water", "Viscosity of 1.0 * 10^-6."}, - {3, "OIL", "Oil", "Viscosity of 5.0 * 10^-5."}, - {4, "HONEY", "Honey", "Viscosity of 2.0 * 10^-3."}, - {0, NULL, NULL, NULL}}; + {1, "MANUAL", 0, "Manual", "Manual viscosity settings."}, + {2, "WATER", 0, "Water", "Viscosity of 1.0 * 10^-6."}, + {3, "OIL", 0, "Oil", "Viscosity of 5.0 * 10^-5."}, + {4, "HONEY", 0, "Honey", "Viscosity of 2.0 * 10^-3."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "DomainFluidSettings", "FluidSettings"); RNA_def_struct_sdna(srna, "FluidsimSettings"); @@ -217,10 +217,10 @@ static void rna_def_fluidsim_volume(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem volume_type_items[] = { - {1, "VOLUME", "Volume", "Use only the inner volume of the mesh."}, - {2, "SHELL", "Shell", "Use only the outer shell of the mesh."}, - {3, "BOTH", "Both", "Use both the inner volume and the outer shell of the mesh."}, - {0, NULL, NULL, NULL}}; + {1, "VOLUME", 0, "Volume", "Use only the inner volume of the mesh."}, + {2, "SHELL", 0, "Shell", "Use only the outer shell of the mesh."}, + {3, "BOTH", 0, "Both", "Use both the inner volume and the outer shell of the mesh."}, + {0, NULL, 0, NULL, NULL}}; prop= RNA_def_property(srna, "volume_initialization", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "volumeInitType"); @@ -393,15 +393,15 @@ void RNA_def_fluidsim(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_fluid_type_items[] = { - {0, "NONE", "None", ""}, - {OB_FLUIDSIM_DOMAIN, "DOMAIN", "Domain", "Bounding box of this object represents the computational domain of the fluid simulation."}, - {OB_FLUIDSIM_FLUID, "FLUID", "Fluid", "Object represents a volume of fluid in the simulation."}, - {OB_FLUIDSIM_OBSTACLE, "OBSTACLE", "Obstacle", "Object is a fixed obstacle."}, - {OB_FLUIDSIM_INFLOW, "INFLOW", "Inflow", "Object adds fluid to the simulation."}, - {OB_FLUIDSIM_OUTFLOW, "OUTFLOW", "Outflow", "Object removes fluid from the simulation."}, - {OB_FLUIDSIM_PARTICLE, "PARTICLE", "Particle", "Object is made a particle system to display particles generated by a fluidsim domain object."}, - {OB_FLUIDSIM_CONTROL, "CONTROL", "Control", "Object is made a fluid control mesh, which influences the fluid."}, - {0, NULL, NULL, NULL}}; + {0, "NONE", 0, "None", ""}, + {OB_FLUIDSIM_DOMAIN, "DOMAIN", 0, "Domain", "Bounding box of this object represents the computational domain of the fluid simulation."}, + {OB_FLUIDSIM_FLUID, "FLUID", 0, "Fluid", "Object represents a volume of fluid in the simulation."}, + {OB_FLUIDSIM_OBSTACLE, "OBSTACLE", 0, "Obstacle", "Object is a fixed obstacle."}, + {OB_FLUIDSIM_INFLOW, "INFLOW", 0, "Inflow", "Object adds fluid to the simulation."}, + {OB_FLUIDSIM_OUTFLOW, "OUTFLOW", 0, "Outflow", "Object removes fluid from the simulation."}, + {OB_FLUIDSIM_PARTICLE, "PARTICLE", 0, "Particle", "Object is made a particle system to display particles generated by a fluidsim domain object."}, + {OB_FLUIDSIM_CONTROL, "CONTROL", 0, "Control", "Object is made a fluid control mesh, which influences the fluid."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FluidSettings", NULL); diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 8620a933d61..e045c76057b 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -32,10 +32,24 @@ #include "DNA_image_types.h" #include "DNA_scene_types.h" +#include "BKE_context.h" #include "BKE_image.h" #ifdef RNA_RUNTIME +static void rna_Image_animated_update(bContext *C, PointerRNA *ptr) +{ + Image *ima= (Image*)ptr->data; + int nr; + + if(ima->flag & IMA_TWINANIM) { + nr= ima->xrep*ima->yrep; + if(ima->twsta>=nr) ima->twsta= 1; + if(ima->twend>=nr) ima->twend= nr-1; + if(ima->twsta>ima->twend) ima->twsta= 1; + } +} + #else static void rna_def_imageuser(BlenderRNA *brna) @@ -89,27 +103,27 @@ static void rna_def_image(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; static const EnumPropertyItem prop_type_items[]= { - {IMA_TYPE_IMAGE, "IMAGE", "Image", ""}, - {IMA_TYPE_MULTILAYER, "MULTILAYER", "Multilayer", ""}, - {IMA_TYPE_UV_TEST, "UVTEST", "UV Test", ""}, - {IMA_TYPE_R_RESULT, "RENDERRESULT", "Render Result", ""}, - {IMA_TYPE_COMPOSITE, "COMPOSITING", "Compositing", ""}, - {0, NULL, NULL, NULL}}; + {IMA_TYPE_IMAGE, "IMAGE", 0, "Image", ""}, + {IMA_TYPE_MULTILAYER, "MULTILAYER", 0, "Multilayer", ""}, + {IMA_TYPE_UV_TEST, "UVTEST", 0, "UV Test", ""}, + {IMA_TYPE_R_RESULT, "RENDERRESULT", 0, "Render Result", ""}, + {IMA_TYPE_COMPOSITE, "COMPOSITING", 0, "Compositing", ""}, + {0, NULL, 0, NULL, NULL}}; static const EnumPropertyItem prop_source_items[]= { - {IMA_SRC_FILE, "FILE", "File", "Single image file"}, - {IMA_SRC_SEQUENCE, "SEQUENCE", "Sequence", "Multiple image files, as a sequence"}, - {IMA_SRC_MOVIE, "MOVIE", "Movie", "Movie file"}, - {IMA_SRC_GENERATED, "GENERATED", "Generated", "Generated image"}, - {IMA_SRC_VIEWER, "VIEWER", "Viewer", "Compositing node viewer"}, - {0, NULL, NULL, NULL}}; + {IMA_SRC_FILE, "FILE", 0, "File", "Single image file"}, + {IMA_SRC_SEQUENCE, "SEQUENCE", 0, "Sequence", "Multiple image files, as a sequence"}, + {IMA_SRC_MOVIE, "MOVIE", 0, "Movie", "Movie file"}, + {IMA_SRC_GENERATED, "GENERATED", 0, "Generated", "Generated image"}, + {IMA_SRC_VIEWER, "VIEWER", 0, "Viewer", "Compositing node viewer"}, + {0, NULL, 0, NULL, NULL}}; static const EnumPropertyItem prop_generated_type_items[]= { - {0, "BLANK", "Blank", "Generate a blank image"}, - {1, "UVTESTGRID", "UV Test Grid", "Generated grid to test UV mappings"}, - {0, NULL, NULL, NULL}}; + {0, "BLANK", 0, "Blank", "Generate a blank image"}, + {1, "UVTESTGRID", 0, "UV Test Grid", "Generated grid to test UV mappings"}, + {0, NULL, 0, NULL, NULL}}; static const EnumPropertyItem prop_mapping_items[]= { - {0, "UV", "UV Coordinates", "Use UV coordinates for mapping the image"}, - {IMA_REFLECT, "REFLECTION", "Reflection", "Use reflection mapping for mapping the image"}, - {0, NULL, NULL, NULL}}; + {0, "UV", 0, "UV Coordinates", "Use UV coordinates for mapping the image"}, + {IMA_REFLECT, "REFLECTION", 0, "Reflection", "Use reflection mapping for mapping the image"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Image", "ID"); RNA_def_struct_ui_text(srna, "Image", "Image datablock referencing an external or packed image."); @@ -180,19 +194,21 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this image, does not affect rendering."); prop= RNA_def_property(srna, "animated", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* B_TWINANIM */ RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TWINANIM); RNA_def_property_ui_text(prop, "Animated", "Use as animated texture in the game engine."); + RNA_def_property_update(prop, 0, "rna_Image_animated_update"); prop= RNA_def_property(srna, "animation_start", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "twsta"); RNA_def_property_range(prop, 0, 128); RNA_def_property_ui_text(prop, "Animation Start", "Start frame of an animated texture."); + RNA_def_property_update(prop, 0, "rna_Image_animated_update"); prop= RNA_def_property(srna, "animation_end", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "twend"); RNA_def_property_range(prop, 0, 128); RNA_def_property_ui_text(prop, "Animation End", "End frame of an animated texture."); + RNA_def_property_update(prop, 0, "rna_Image_animated_update"); prop= RNA_def_property(srna, "animation_speed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "animspeed"); @@ -200,8 +216,8 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Animation Speed", "Speed of the animation in frames per second."); prop= RNA_def_property(srna, "tiles", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* B_SIMAGETILE */ RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TILES); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_tile_set */ RNA_def_property_ui_text(prop, "Tiles", "Use of tilemode for faces (default shift-LMB to pick the tile for selected faces)."); prop= RNA_def_property(srna, "tiles_x", PROP_INT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index d690251f503..3a5a4fa1ced 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -128,6 +128,8 @@ struct PropertyRNA { const char *name; /* single line description, displayed in the tooltip for example */ const char *description; + /* icon ID */ + int icon; /* property type as it appears to the outside */ PropertyType type; diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index ae03cca74c2..896f660c720 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -277,10 +277,10 @@ static void rna_def_keyblock(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_keyblock_type_items[] = { - {KEY_LINEAR, "KEY_LINEAR", "Linear", ""}, - {KEY_CARDINAL, "KEY_CARDINAL", "Cardinal", ""}, - {KEY_BSPLINE, "KEY_BSPLINE", "BSpline", ""}, - {0, NULL, NULL, NULL}}; + {KEY_LINEAR, "KEY_LINEAR", 0, "Linear", ""}, + {KEY_CARDINAL, "KEY_CARDINAL", 0, "Cardinal", ""}, + {KEY_BSPLINE, "KEY_BSPLINE", 0, "BSpline", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ShapeKey", NULL); RNA_def_struct_ui_text(srna, "Shape Key", "Shape key in a shape keys datablock."); diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index 97ad5b7f6a4..092a5804a74 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -91,10 +91,10 @@ static void rna_def_lamp_mtex(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_texture_coordinates_items[] = { - {TEXCO_GLOB, "GLOBAL", "Global", "Uses global coordinates for the texture coordinates."}, - {TEXCO_VIEW, "VIEW", "View", "Uses view coordinates for the texture coordinates."}, - {TEXCO_OBJECT, "OBJECT", "Object", "Uses linked object's coordinates for texture coordinates."}, - {0, NULL, NULL, NULL}}; + {TEXCO_GLOB, "GLOBAL", 0, "Global", "Uses global coordinates for the texture coordinates."}, + {TEXCO_VIEW, "VIEW", 0, "View", "Uses view coordinates for the texture coordinates."}, + {TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "LampTextureSlot", "TextureSlot"); RNA_def_struct_sdna(srna, "MTex"); @@ -126,29 +126,29 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_skycolorspace_items[] = { - {0, "SMPTE", "SMPTE", ""}, - {1, "REC709", "REC709", ""}, - {2, "CIE", "CIE", ""}, - {0, NULL, NULL, NULL}}; + {0, "SMPTE", 0, "SMPTE", ""}, + {1, "REC709", 0, "REC709", ""}, + {2, "CIE", 0, "CIE", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_blendmode_items[] = { - {0, "MIX", "Mix", ""}, - {1, "ADD", "Add", ""}, - {2, "MULTIPLY", "Multiply", ""}, - {3, "SUBTRACT", "Subtract", ""}, - {4, "SCREEN", "Screen", ""}, - {5, "DIVIDE", "Divide", ""}, - {6, "DIFFERENCE", "Difference", ""}, - {7, "DARKEN", "Darken", ""}, - {8, "LIGHTEN", "Lighten", ""}, - {9, "OVERLAY", "Overlay", ""}, - {10, "DODGE", "Dodge", ""}, - {11, "BURN", "Burn", ""}, - {12, "HUE", "Hue", ""}, - {13, "SATURATION", "Saturation", ""}, - {14, "VALUE", "Value", ""}, - {15, "COLOR", "Color", ""}, - {0, NULL, NULL, NULL}}; + {0, "MIX", 0, "Mix", ""}, + {1, "ADD", 0, "Add", ""}, + {2, "MULTIPLY", 0, "Multiply", ""}, + {3, "SUBTRACT", 0, "Subtract", ""}, + {4, "SCREEN", 0, "Screen", ""}, + {5, "DIVIDE", 0, "Divide", ""}, + {6, "DIFFERENCE", 0, "Difference", ""}, + {7, "DARKEN", 0, "Darken", ""}, + {8, "LIGHTEN", 0, "Lighten", ""}, + {9, "OVERLAY", 0, "Overlay", ""}, + {10, "DODGE", 0, "Dodge", ""}, + {11, "BURN", 0, "Burn", ""}, + {12, "HUE", 0, "Hue", ""}, + {13, "SATURATION", 0, "Saturation", ""}, + {14, "VALUE", 0, "Value", ""}, + {15, "COLOR", 0, "Color", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "LampSkySettings", NULL); RNA_def_struct_sdna(srna, "Lamp"); @@ -253,12 +253,12 @@ static void rna_def_lamp(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_type_items[] = { - {LA_LOCAL, "POINT", "Point", "Omnidirectional point light source."}, - {LA_SUN, "SUN", "Sun", "Constant direction parallel ray light source."}, - {LA_SPOT, "SPOT", "Spot", "Directional cone light source."}, - {LA_HEMI, "HEMI", "Hemi", "180 degree constant light source."}, - {LA_AREA, "AREA", "Area", "Directional area light source."}, - {0, NULL, NULL, NULL}}; + {LA_LOCAL, "POINT", 0, "Point", "Omnidirectional point light source."}, + {LA_SUN, "SUN", 0, "Sun", "Constant direction parallel ray light source."}, + {LA_SPOT, "SPOT", 0, "Spot", "Directional cone light source."}, + {LA_HEMI, "HEMI", 0, "Hemi", "180 degree constant light source."}, + {LA_AREA, "AREA", 0, "Area", "Directional area light source."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Lamp", "ID"); RNA_def_struct_refine_func(srna, "rna_Lamp_refine"); @@ -322,12 +322,12 @@ static void rna_def_lamp_falloff(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem prop_fallofftype_items[] = { - {LA_FALLOFF_CONSTANT, "CONSTANT", "Constant", ""}, - {LA_FALLOFF_INVLINEAR, "INVERSE_LINEAR", "Inverse Linear", ""}, - {LA_FALLOFF_INVSQUARE, "INVERSE_SQUARE", "Inverse Square", ""}, - {LA_FALLOFF_CURVE, "CUSTOM_CURVE", "Custom Curve", ""}, - {LA_FALLOFF_SLIDERS, "LINEAR_QUADRATIC_WEIGHTED", "Lin/Quad Weighted", ""}, - {0, NULL, NULL, NULL}}; + {LA_FALLOFF_CONSTANT, "CONSTANT", 0, "Constant", ""}, + {LA_FALLOFF_INVLINEAR, "INVERSE_LINEAR", 0, "Inverse Linear", ""}, + {LA_FALLOFF_INVSQUARE, "INVERSE_SQUARE", 0, "Inverse Square", ""}, + {LA_FALLOFF_CURVE, "CUSTOM_CURVE", 0, "Custom Curve", ""}, + {LA_FALLOFF_SLIDERS, "LINEAR_QUADRATIC_WEIGHTED", 0, "Lin/Quad Weighted", ""}, + {0, NULL, 0, NULL, NULL}}; prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_fallofftype_items); @@ -362,26 +362,26 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area) PropertyRNA *prop; static EnumPropertyItem prop_shadow_items[] = { - {0, "NOSHADOW", "No Shadow", ""}, - {LA_SHAD_RAY, "RAY_SHADOW", "Ray Shadow", "Use ray tracing for shadow."}, - {0, NULL, NULL, NULL}}; + {0, "NOSHADOW", 0, "No Shadow", ""}, + {LA_SHAD_RAY, "RAY_SHADOW", 0, "Ray Shadow", "Use ray tracing for shadow."}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_spot_shadow_items[] = { - {0, "NOSHADOW", "No Shadow", ""}, - {LA_SHAD_BUF, "BUFFER_SHADOW", "Buffer Shadow", "Lets spotlight produce shadows using shadow buffer."}, - {LA_SHAD_RAY, "RAY_SHADOW", "Ray Shadow", "Use ray tracing for shadow."}, - {0, NULL, NULL, NULL}}; + {0, "NOSHADOW", 0, "No Shadow", ""}, + {LA_SHAD_BUF, "BUFFER_SHADOW", 0, "Buffer Shadow", "Lets spotlight produce shadows using shadow buffer."}, + {LA_SHAD_RAY, "RAY_SHADOW", 0, "Ray Shadow", "Use ray tracing for shadow."}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_ray_sampling_method_items[] = { - {LA_SAMP_HALTON, "ADAPTIVE_QMC", "Adaptive QMC", ""}, - {LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", "Constant QMC", ""}, - {0, NULL, NULL, NULL}}; + {LA_SAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", ""}, + {LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_spot_ray_sampling_method_items[] = { - {LA_SAMP_HALTON, "ADAPTIVE_QMC", "Adaptive QMC", ""}, - {LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", "Constant QMC", ""}, - {LA_SAMP_CONSTANT, "CONSTANT_JITTERED", "Constant Jittered", ""}, - {0, NULL, NULL, NULL}}; + {LA_SAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", ""}, + {LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", ""}, + {LA_SAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", ""}, + {0, NULL, 0, NULL, NULL}}; prop= RNA_def_property(srna, "shadow_method", PROP_ENUM, PROP_NONE); @@ -457,9 +457,9 @@ static void rna_def_area_lamp(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_areashape_items[] = { - {LA_AREA_SQUARE, "SQUARE", "Square", ""}, - {LA_AREA_RECT, "RECTANGLE", "Rectangle", ""}, - {0, NULL, NULL, NULL}}; + {LA_AREA_SQUARE, "SQUARE", 0, "Square", ""}, + {LA_AREA_RECT, "RECTANGLE", 0, "Rectangle", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "AreaLamp", "Lamp"); RNA_def_struct_sdna(srna, "Lamp"); @@ -513,22 +513,22 @@ static void rna_def_spot_lamp(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_shadbuftype_items[] = { - {LA_SHADBUF_REGULAR , "REGULAR", "Classical", "Classic shadow buffer."}, - {LA_SHADBUF_HALFWAY, "HALFWAY", "Classic-Halfway", "Regular buffer, averaging the closest and 2nd closest Z value to reducing bias artifaces."}, - {LA_SHADBUF_IRREGULAR, "IRREGULAR", "Irregular", "Irregular buffer produces sharp shadow always, but it doesn't show up for raytracing."}, - {0, NULL, NULL, NULL}}; + {LA_SHADBUF_REGULAR , "REGULAR", 0, "Classical", "Classic shadow buffer."}, + {LA_SHADBUF_HALFWAY, "HALFWAY", 0, "Classic-Halfway", "Regular buffer, averaging the closest and 2nd closest Z value to reducing bias artifaces."}, + {LA_SHADBUF_IRREGULAR, "IRREGULAR", 0, "Irregular", "Irregular buffer produces sharp shadow always, but it doesn't show up for raytracing."}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_shadbuffiltertype_items[] = { - {LA_SHADBUF_BOX , "BOX", "Box", "Apply the Box filter to shadow buffer samples."}, - {LA_SHADBUF_TENT, "TENT", "Tent", "Apply the Tent Filter to shadow buffer samples."}, - {LA_SHADBUF_GAUSS, "GAUSS", "Gauss", "Apply the Gauss filter to shadow buffer samples."}, - {0, NULL, NULL, NULL}}; + {LA_SHADBUF_BOX , "BOX", 0, "Box", "Apply the Box filter to shadow buffer samples."}, + {LA_SHADBUF_TENT, "TENT", 0, "Tent", "Apply the Tent Filter to shadow buffer samples."}, + {LA_SHADBUF_GAUSS, "GAUSS", 0, "Gauss", "Apply the Gauss filter to shadow buffer samples."}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_numbuffer_items[] = { - {1, "BUFFERS_1", "1", "Only one buffer rendered."}, - {4, "BUFFERS_4", "4", "Renders 4 buffers for better AA, this quadruples memory usage."}, - {9, "BUFFERS_9", "9", "Renders 9 buffers for better AA, this uses nine times more memory."}, - {0, NULL, NULL, NULL}}; + {1, "BUFFERS_1", 0, "1", "Only one buffer rendered."}, + {4, "BUFFERS_4", 0, "4", "Renders 4 buffers for better AA, this quadruples memory usage."}, + {9, "BUFFERS_9", 0, "9", "Renders 9 buffers for better AA, this uses nine times more memory."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SpotLamp", "Lamp"); RNA_def_struct_sdna(srna, "Lamp"); diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index 26c4ebb7b23..0e341fcdbd0 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -110,10 +110,10 @@ static void rna_def_lattice(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_keyblock_type_items[] = { - {KEY_LINEAR, "KEY_LINEAR", "Linear", ""}, - {KEY_CARDINAL, "KEY_CARDINAL", "Cardinal", ""}, - {KEY_BSPLINE, "KEY_BSPLINE", "BSpline", ""}, - {0, NULL, NULL, NULL}}; + {KEY_LINEAR, "KEY_LINEAR", 0, "Linear", ""}, + {KEY_CARDINAL, "KEY_CARDINAL", 0, "Cardinal", ""}, + {KEY_BSPLINE, "KEY_BSPLINE", 0, "BSpline", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Lattice", "ID"); RNA_def_struct_ui_text(srna, "Lattice", "Lattice datablock defining a grid for deforming other objects."); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 3facfab16f6..1c16e793fdc 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -112,6 +112,35 @@ static void rna_MaterialStrand_end_size_range(PointerRNA *ptr, float *min, float } } +static int rna_MaterialTextureSlot_enabled_get(PointerRNA *ptr) +{ + Material *ma= (Material*)ptr->id.data; + MTex *mtex= (MTex*)ptr->data; + int a; + + for(a=0; amtex[a] == mtex) + return (ma->septex & (1<id.data; + MTex *mtex= (MTex*)ptr->data; + int a; + + for(a=0; amtex[a] == mtex) { + if(value) + ma->septex &= ~(1<septex |= (1<defined && node->category == category) { item->value = i; item->identifier = node->enum_name; + item->icon = node->icon; item->name = node->ui_name; item->description = node->ui_desc; @@ -173,25 +175,25 @@ static void def_math(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem items[] = { - { 0, "ADD", "Add", ""}, - { 1, "SUBTRACT", "Subtract", ""}, - { 2, "MULTIPLY", "Multiply", ""}, - { 3, "DIVIDE", "Divide", ""}, - { 4, "SINE", "Sine", ""}, - { 5, "COSINE", "Cosine", ""}, - { 6, "TANGENT", "Tangent", ""}, - { 7, "ARCSINE", "Arcsine", ""}, - { 8, "ARCCOSINE", "Arccosine", ""}, - { 9, "ARCTANGENT", "Arctangent", ""}, - {10, "POWER", "Power", ""}, - {11, "LOGARITHM", "Logarithm", ""}, - {12, "MINIMUM", "Minimum", ""}, - {13, "MAXIMUM", "Maximum", ""}, - {14, "ROUND", "Round", ""}, - {15, "LESS_THAN", "Less Than", ""}, - {16, "GREATER_THAN", "Greater Than", ""}, + { 0, "ADD", 0, "Add", ""}, + { 1, "SUBTRACT", 0, "Subtract", ""}, + { 2, "MULTIPLY", 0, "Multiply", ""}, + { 3, "DIVIDE", 0, "Divide", ""}, + { 4, "SINE", 0, "Sine", ""}, + { 5, "COSINE", 0, "Cosine", ""}, + { 6, "TANGENT", 0, "Tangent", ""}, + { 7, "ARCSINE", 0, "Arcsine", ""}, + { 8, "ARCCOSINE", 0, "Arccosine", ""}, + { 9, "ARCTANGENT", 0, "Arctangent", ""}, + {10, "POWER", 0, "Power", ""}, + {11, "LOGARITHM", 0, "Logarithm", ""}, + {12, "MINIMUM", 0, "Minimum", ""}, + {13, "MAXIMUM", 0, "Maximum", ""}, + {14, "ROUND", 0, "Round", ""}, + {15, "LESS_THAN", 0, "Less Than", ""}, + {16, "GREATER_THAN", 0, "Greater Than", ""}, - {0, NULL, NULL, NULL} + {0, NULL, 0, NULL, NULL} }; prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE); @@ -205,14 +207,14 @@ static void def_vector_math(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem items[] = { - {0, "ADD", "Add", ""}, - {1, "SUBTRACT", "Subtract", ""}, - {2, "AVERAGE", "Average", ""}, - {3, "DOT_PRODUCT", "Dot Product", ""}, - {4, "CROSS_PRODUCT", "Cross Product", ""}, - {5, "NORMALIZE", "Normalize", ""}, + {0, "ADD", 0, "Add", ""}, + {1, "SUBTRACT", 0, "Subtract", ""}, + {2, "AVERAGE", 0, "Average", ""}, + {3, "DOT_PRODUCT", 0, "Dot Product", ""}, + {4, "CROSS_PRODUCT", 0, "Cross Product", ""}, + {5, "NORMALIZE", 0, "Normalize", ""}, - {0, NULL, NULL, NULL} + {0, NULL, 0, NULL, NULL} }; prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE); @@ -275,23 +277,23 @@ static void def_mix_rgb(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem blend_type_items[] = { - { 0, "MIX", "Mix", ""}, - { 1, "ADD", "Add", ""}, - { 3, "SUBTRACT", "Subtract", ""}, - { 2, "MULTIPLY", "Multiply", ""}, - { 4, "SCREEN", "Screen", ""}, - { 9, "OVERLAY", "Overlay", ""}, - { 5, "DIVIDE", "Divide", ""}, - { 6, "DIFFERENCE", "Difference", ""}, - { 7, "DARKEN", "Darken", ""}, - { 8, "LIGHTEN", "Lighten", ""}, - {10, "DODGE", "Dodge", ""}, - {11, "BURN", "Burn", ""}, - {15, "COLOR", "Color", ""}, - {14, "VALUE", "Value", ""}, - {13, "SATURATION", "Saturation", ""}, - {12, "HUE", "Hue", ""}, - {0, NULL, NULL, NULL} + { 0, "MIX", 0, "Mix", ""}, + { 1, "ADD", 0, "Add", ""}, + { 3, "SUBTRACT", 0, "Subtract", ""}, + { 2, "MULTIPLY", 0, "Multiply", ""}, + { 4, "SCREEN", 0, "Screen", ""}, + { 9, "OVERLAY", 0, "Overlay", ""}, + { 5, "DIVIDE", 0, "Divide", ""}, + { 6, "DIFFERENCE", 0, "Difference", ""}, + { 7, "DARKEN", 0, "Darken", ""}, + { 8, "LIGHTEN", 0, "Lighten", ""}, + {10, "DODGE", 0, "Dodge", ""}, + {11, "BURN", 0, "Burn", ""}, + {15, "COLOR", 0, "Color", ""}, + {14, "VALUE", 0, "Value", ""}, + {13, "SATURATION", 0, "Saturation", ""}, + {12, "HUE", 0, "Hue", ""}, + {0, NULL, 0, NULL, NULL} }; prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); @@ -393,15 +395,15 @@ static void def_cmp_blur(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem filter_type_items[] = { - {R_FILTER_BOX, "FLAT", "Flat", ""}, - {R_FILTER_TENT, "TENT", "Tent", ""}, - {R_FILTER_QUAD, "QUAD", "Quadratic", ""}, - {R_FILTER_CUBIC, "CUBIC", "Cubic", ""}, - {R_FILTER_GAUSS, "GAUSS", "Gaussian", ""}, - {R_FILTER_FAST_GAUSS, "FAST_GAUSS", "Fast Gaussian", ""}, - {R_FILTER_CATROM, "CATROM", "Catrom", ""}, - {R_FILTER_MITCH, "MITCH", "Mitch", ""}, - {0, NULL, NULL, NULL} + {R_FILTER_BOX, "FLAT", 0, "Flat", ""}, + {R_FILTER_TENT, "TENT", 0, "Tent", ""}, + {R_FILTER_QUAD, "QUAD", 0, "Quadratic", ""}, + {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", ""}, + {R_FILTER_GAUSS, "GAUSS", 0, "Gaussian", ""}, + {R_FILTER_FAST_GAUSS, "FAST_GAUSS", 0, "Fast Gaussian", ""}, + {R_FILTER_CATROM, "CATROM", 0, "Catrom", ""}, + {R_FILTER_MITCH, "MITCH", 0, "Mitch", ""}, + {0, NULL, 0, NULL, NULL} }; RNA_def_struct_sdna_from(srna, "NodeBlurData", "storage"); @@ -471,14 +473,14 @@ static void def_cmp_filter(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem type_items[] = { - {0, "SOFTEN", "Soften", ""}, - {1, "SHARPEN", "Sharpen", ""}, - {2, "LAPLACE", "Laplace", ""}, - {3, "SOBEL", "Sobel", ""}, - {4, "PREWITT", "Prewitt", ""}, - {5, "KIRSCH", "Kirsch", ""}, - {6, "SHADOW", "Shadow", ""}, - {0, NULL, NULL, NULL} + {0, "SOFTEN", 0, "Soften", ""}, + {1, "SHARPEN", 0, "Sharpen", ""}, + {2, "LAPLACE", 0, "Laplace", ""}, + {3, "SOBEL", 0, "Sobel", ""}, + {4, "PREWITT", 0, "Prewitt", ""}, + {5, "KIRSCH", 0, "Kirsch", ""}, + {6, "SHADOW", 0, "Shadow", ""}, + {0, NULL, 0, NULL, NULL} }; prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); @@ -550,11 +552,11 @@ static void def_cmp_image(StructRNA *srna) PropertyRNA *prop; /*static EnumPropertyItem type_items[] = { - {IMA_SRC_FILE, "IMAGE", "Image", ""}, + {IMA_SRC_FILE, "IMAGE", 0, "Image", ""}, {IMA_SRC_MOVIE, "MOVIE", "Movie", ""}, {IMA_SRC_SEQUENCE, "SEQUENCE", "Sequence", ""}, {IMA_SRC_GENERATED, "GENERATED", "Generated", ""}, - {0, NULL, NULL, NULL} + {0, NULL, 0, NULL, NULL} };*/ prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); @@ -627,26 +629,26 @@ static void def_cmp_output_file(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem type_items[] = { - {R_TARGA, "TARGA", "Targa", ""}, - {R_RAWTGA, "RAW_TARGA", "Targa Raw", ""}, - {R_PNG, "PNG", "PNG", ""}, - {R_BMP, "BMP", "BMP", ""}, - {R_JPEG90, "JPEG", "JPEG", ""}, - {R_IRIS, "IRIS", "IRIS", ""}, - {R_RADHDR, "RADIANCE_HDR", "Radiance HDR", ""}, - {R_CINEON, "CINEON", "Cineon", ""}, - {R_DPX, "DPX", "DPX", ""}, - {R_OPENEXR, "OPENEXR", "OpenEXR", ""}, - {0, NULL, NULL, NULL} + {R_TARGA, "TARGA", 0, "Targa", ""}, + {R_RAWTGA, "RAW_TARGA", 0, "Targa Raw", ""}, + {R_PNG, "PNG", 0, "PNG", ""}, + {R_BMP, "BMP", 0, "BMP", ""}, + {R_JPEG90, "JPEG", 0, "JPEG", ""}, + {R_IRIS, "IRIS", 0, "IRIS", ""}, + {R_RADHDR, "RADIANCE_HDR", 0, "Radiance HDR", ""}, + {R_CINEON, "CINEON", 0, "Cineon", ""}, + {R_DPX, "DPX", 0, "DPX", ""}, + {R_OPENEXR, "OPENEXR", 0, "OpenEXR", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem openexr_codec_items[] = { - {0, "NONE", "None", ""}, - {1, "PXR24", "Pxr24 (lossy)", ""}, - {2, "ZIP", "ZIP (lossless)", ""}, - {3, "PIZ", "PIX (lossless)", ""}, - {4, "RLE", "RLE (lossless)", ""}, - {0, NULL, NULL, NULL} + {0, "NONE", 0, "None", ""}, + {1, "PXR24", 0, "Pxr24 (lossy)", ""}, + {2, "ZIP", 0, "ZIP (lossless)", ""}, + {3, "PIZ", 0, "PIX (lossless)", ""}, + {4, "RLE", 0, "RLE (lossless)", ""}, + {0, NULL, 0, NULL, NULL} }; RNA_def_struct_sdna_from(srna, "NodeImageFile", "storage"); @@ -702,10 +704,10 @@ static void def_cmp_scale(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem space_items[] = { - {0, "RELATIVE", "Relative", ""}, - {1, "ABSOLUTE", "Absolute", ""}, - {2, "SCENE_SIZE", "Scene Size", ""}, - {0, NULL, NULL, NULL} + {0, "RELATIVE", 0, "Relative", ""}, + {1, "ABSOLUTE", 0, "Absolute", ""}, + {2, "SCENE_SIZE", 0, "Scene Size", ""}, + {0, NULL, 0, NULL, NULL} }; prop = RNA_def_property(srna, "space", PROP_ENUM, PROP_NONE); @@ -719,11 +721,11 @@ static void def_cmp_diff_matte(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem color_space_items[] = { - {1, "RGB", "RGB", ""}, - {2, "HSV", "HSV", ""}, - {3, "YUV", "YUV", ""}, - {4, "YCC", "YCbCr", ""}, - {0, NULL, NULL, NULL} + {1, "RGB", 0, "RGB", ""}, + {2, "HSV", 0, "HSV", ""}, + {3, "YUV", 0, "YUV", ""}, + {4, "YCC", 0, "YCbCr", ""}, + {0, NULL, 0, NULL, NULL} }; prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE); @@ -757,10 +759,10 @@ static void def_cmp_color_spill(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem channel_items[] = { - {1, "R", "Red", ""}, - {2, "G", "Green", ""}, - {3, "B", "Blue", ""}, - {0, NULL, NULL, NULL} + {1, "R", 0, "Red", ""}, + {2, "G", 0, "Green", ""}, + {3, "B", 0, "Blue", ""}, + {0, NULL, 0, NULL, NULL} }; prop = RNA_def_property(srna, "channel", PROP_ENUM, PROP_NONE); @@ -812,11 +814,11 @@ static void def_cmp_channel_matte(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem color_space_items[] = { - {1, "RGB", "RGB", ""}, - {2, "HSV", "HSV", ""}, - {3, "YUV", "YUV", ""}, - {4, "YCC", "YCbCr", ""}, - {0, NULL, NULL, NULL} + {1, "RGB", 0, "RGB", ""}, + {2, "HSV", 0, "HSV", ""}, + {3, "YUV", 0, "YUV", ""}, + {4, "YCC", 0, "YCbCr", ""}, + {0, NULL, 0, NULL, NULL} }; prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE); @@ -850,10 +852,10 @@ static void def_cmp_flip(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem axis_items[] = { - {0, "X", "X", ""}, - {1, "Y", "Y", ""}, - {2, "XY", "X & Y", ""}, - {0, NULL, NULL, NULL} + {0, "X", 0, "X", ""}, + {1, "Y", 0, "Y", ""}, + {2, "XY", 0, "X & Y", ""}, + {0, NULL, 0, NULL, NULL} }; prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); @@ -867,9 +869,9 @@ static void def_cmp_splitviewer(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem axis_items[] = { - {0, "X", "X", ""}, - {1, "Y", "Y", ""}, - {0, NULL, NULL, NULL} + {0, "X", 0, "X", ""}, + {1, "Y", 0, "Y", ""}, + {0, NULL, 0, NULL, NULL} }; prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); @@ -907,14 +909,14 @@ static void def_cmp_defocus(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem bokeh_items[] = { - {8, "OCTAGON", "Octagonal", "8 sides"}, - {7, "HEPTAGON", "Heptagonal", "7 sides"}, - {6, "HEXAGON", "Hexagonal", "6 sides"}, - {5, "PENTAGON", "Pentagonal", "5 sides"}, - {4, "SQUARE", "Square", "4 sides"}, - {3, "TRIANGLE", "Triangular", "3 sides"}, - {0, "CIRCLE", "Circular", ""}, - {0, NULL, NULL, NULL} + {8, "OCTAGON", 0, "Octagonal", "8 sides"}, + {7, "HEPTAGON", 0, "Heptagonal", "7 sides"}, + {6, "HEXAGON", 0, "Hexagonal", "6 sides"}, + {5, "PENTAGON", 0, "Pentagonal", "5 sides"}, + {4, "SQUARE", 0, "Square", "4 sides"}, + {3, "TRIANGLE", 0, "Triangular", "3 sides"}, + {0, "CIRCLE", 0, "Circular", ""}, + {0, NULL, 0, NULL, NULL} }; RNA_def_struct_sdna_from(srna, "NodeDefocus", "storage"); @@ -1085,9 +1087,9 @@ static void def_cmp_premul_key(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem type_items[] = { - {0, "KEY_TO_PREMUL", "Key to Premul", ""}, - {1, "PREMUL_TO_KEY", "Premul to Key", ""}, - {0, NULL, NULL, NULL} + {0, "KEY_TO_PREMUL", 0, "Key to Premul", ""}, + {1, "PREMUL_TO_KEY", 0, "Premul to Key", ""}, + {0, NULL, 0, NULL, NULL} }; prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); @@ -1102,18 +1104,18 @@ static void def_cmp_glare(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem type_items[] = { - {3, "GHOSTS", "Ghosts", ""}, - {2, "STREAKS", "Streaks", ""}, - {1, "FOG_GLOW", "Fog Glow", ""}, - {0, "SIMPLE_STAR", "Simple Star", ""}, - {0, NULL, NULL, NULL} + {3, "GHOSTS", 0, "Ghosts", ""}, + {2, "STREAKS", 0, "Streaks", ""}, + {1, "FOG_GLOW", 0, "Fog Glow", ""}, + {0, "SIMPLE_STAR", 0, "Simple Star", ""}, + {0, NULL, 0, NULL, NULL} }; /*static EnumPropertyItem quality_items[] = { - {0, "HIGH", "High", ""}, - {1, "MEDIUM", "Medium", ""}, - {2, "LOW", "Low", ""}, - {0, NULL, NULL, NULL} + {0, "HIGH", 0, "High", ""}, + {1, "MEDIUM", 0, "Medium", ""}, + {2, "LOW", 0, "Low", ""}, + {0, NULL, 0, NULL, NULL} };*/ RNA_def_struct_sdna_from(srna, "NodeGlare", "storage"); @@ -1172,9 +1174,9 @@ static void def_cmp_tonemap(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem type_items[] = { - {1, "RD_PHOTORECEPTOR", "R/D Photoreceptor", ""}, - {0, "RH_SIMPLE", "Rh Simple", ""}, - {0, NULL, NULL, NULL} + {1, "RD_PHOTORECEPTOR", 0, "R/D Photoreceptor", ""}, + {0, "RH_SIMPLE", 0, "Rh Simple", ""}, + {0, NULL, 0, NULL, NULL} }; RNA_def_struct_sdna_from(srna, "NodeTonemap", "storage"); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 08eca7b0528..9d7da401ec1 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -392,9 +392,9 @@ static void rna_def_material_slot(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem link_items[] = { - {0, "DATA", "Data", ""}, - {1, "OBJECT", "Object", ""}, - {0, NULL, NULL, NULL}}; + {0, "DATA", 0, "Data", ""}, + {1, "OBJECT", 0, "Object", ""}, + {0, NULL, 0, NULL, NULL}}; /* NOTE: there is no MaterialSlot equivalent in DNA, so the internal * pointer data points to ob->mat + index, and we manually implement @@ -428,22 +428,22 @@ static void rna_def_object_game_settings(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem body_type_items[] = { - {OB_BODY_TYPE_NO_COLLISION, "NO_COLLISION", "No Collision", ""}, - {OB_BODY_TYPE_STATIC, "STATIC", "Static", ""}, - {OB_BODY_TYPE_DYNAMIC, "DYNAMIC", "Dynamic", ""}, - {OB_BODY_TYPE_RIGID, "RIGID_BODY", "Rigid Body", ""}, - {OB_BODY_TYPE_SOFT, "SOFT_BODY", "Soft Body", ""}, - {0, NULL, NULL, NULL}}; + {OB_BODY_TYPE_NO_COLLISION, "NO_COLLISION", 0, "No Collision", ""}, + {OB_BODY_TYPE_STATIC, "STATIC", 0, "Static", ""}, + {OB_BODY_TYPE_DYNAMIC, "DYNAMIC", 0, "Dynamic", ""}, + {OB_BODY_TYPE_RIGID, "RIGID_BODY", 0, "Rigid Body", ""}, + {OB_BODY_TYPE_SOFT, "SOFT_BODY", 0, "Soft Body", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem collision_bounds_items[] = { - {OB_BOUND_BOX, "BOX", "Box", ""}, - {OB_BOUND_SPHERE, "SPHERE", "Sphere", ""}, - {OB_BOUND_CYLINDER, "CYLINDER", "Cylinder", ""}, - {OB_BOUND_CONE, "CONE", "Cone", ""}, - {OB_BOUND_POLYH, "CONVEX_HULL", "Convex Hull", ""}, - {OB_BOUND_POLYT, "TRIANGLE_MESH", "Triangle Mesh", ""}, - //{OB_DYN_MESH, "DYNAMIC_MESH", "Dynamic Mesh", ""}, - {0, NULL, NULL, NULL}}; + {OB_BOUND_BOX, "BOX", 0, "Box", ""}, + {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""}, + {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""}, + {OB_BOUND_CONE, "CONE", 0, "Cone", ""}, + {OB_BOUND_POLYH, "CONVEX_HULL", 0, "Convex Hull", ""}, + {OB_BOUND_POLYT, "TRIANGLE_MESH", 0, "Triangle Mesh", ""}, + //{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "GameObjectSettings", NULL); RNA_def_struct_sdna(srna, "Object"); @@ -590,78 +590,78 @@ static StructRNA *rna_def_object(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem parent_type_items[] = { - {PAROBJECT, "OBJECT", "Object", ""}, - {PARCURVE, "CURVE", "Curve", ""}, - //{PARKEY, "KEY", "Key", ""}, - {PARSKEL, "ARMATURE", "Armature", ""}, - {PARSKEL, "LATTICE", "Lattice", ""}, // PARSKEL reuse will give issues - {PARVERT1, "VERTEX", "Vertex", ""}, - {PARVERT3, "VERTEX_3", "3 Vertices", ""}, - {PARBONE, "BONE", "Bone", ""}, - {0, NULL, NULL, NULL}}; + {PAROBJECT, "OBJECT", 0, "Object", ""}, + {PARCURVE, "CURVE", 0, "Curve", ""}, + //{PARKEY, "KEY", 0, "Key", ""}, + {PARSKEL, "ARMATURE", 0, "Armature", ""}, + {PARSKEL, "LATTICE", 0, "Lattice", ""}, // PARSKEL reuse will give issues + {PARVERT1, "VERTEX", 0, "Vertex", ""}, + {PARVERT3, "VERTEX_3", 0, "3 Vertices", ""}, + {PARBONE, "BONE", 0, "Bone", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem object_type_items[] = { - {OB_EMPTY, "EMPTY", "Empty", ""}, - {OB_MESH, "MESH", "Mesh", ""}, - {OB_CURVE, "CURVE", "Curve", ""}, - {OB_SURF, "SURFACE", "Surface", ""}, - {OB_FONT, "TEXT", "Text", ""}, - {OB_MBALL, "META", "Meta", ""}, - {OB_LAMP, "LAMP", "Lamp", ""}, - {OB_CAMERA, "CAMERA", "Camera", ""}, - {OB_WAVE, "WAVE", "Wave", ""}, - {OB_LATTICE, "LATTICE", "Lattice", ""}, - {OB_ARMATURE, "ARMATURE", "Armature", ""}, - {0, NULL, NULL, NULL}}; + {OB_EMPTY, "EMPTY", 0, "Empty", ""}, + {OB_MESH, "MESH", 0, "Mesh", ""}, + {OB_CURVE, "CURVE", 0, "Curve", ""}, + {OB_SURF, "SURFACE", 0, "Surface", ""}, + {OB_FONT, "TEXT", 0, "Text", ""}, + {OB_MBALL, "META", 0, "Meta", ""}, + {OB_LAMP, "LAMP", 0, "Lamp", ""}, + {OB_CAMERA, "CAMERA", 0, "Camera", ""}, + {OB_WAVE, "WAVE", 0, "Wave", ""}, + {OB_LATTICE, "LATTICE", 0, "Lattice", ""}, + {OB_ARMATURE, "ARMATURE", 0, "Armature", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem empty_drawtype_items[] = { - {OB_ARROWS, "ARROWS", "Arrows", ""}, - {OB_SINGLE_ARROW, "SINGLE_ARROW", "Single Arrow", ""}, - {OB_PLAINAXES, "PLAIN_AXES", "Plain Axes", ""}, - {OB_CIRCLE, "CIRCLE", "Circle", ""}, - {OB_CUBE, "CUBE", "Cube", ""}, - {OB_EMPTY_SPHERE, "SPHERE", "Sphere", ""}, - {OB_EMPTY_CONE, "CONE", "Cone", ""}, - {0, NULL, NULL, NULL}}; + {OB_ARROWS, "ARROWS", 0, "Arrows", ""}, + {OB_SINGLE_ARROW, "SINGLE_ARROW", 0, "Single Arrow", ""}, + {OB_PLAINAXES, "PLAIN_AXES", 0, "Plain Axes", ""}, + {OB_CIRCLE, "CIRCLE", 0, "Circle", ""}, + {OB_CUBE, "CUBE", 0, "Cube", ""}, + {OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""}, + {OB_EMPTY_CONE, "CONE", 0, "Cone", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem track_items[] = { - {OB_POSX, "POSX", "+X", ""}, - {OB_POSY, "POSY", "+Y", ""}, - {OB_POSZ, "POSZ", "+Z", ""}, - {OB_NEGX, "NEGX", "-X", ""}, - {OB_NEGY, "NEGY", "-Y", ""}, - {OB_NEGZ, "NEGZ", "-Z", ""}, - {0, NULL, NULL, NULL}}; + {OB_POSX, "POSX", 0, "+X", ""}, + {OB_POSY, "POSY", 0, "+Y", ""}, + {OB_POSZ, "POSZ", 0, "+Z", ""}, + {OB_NEGX, "NEGX", 0, "-X", ""}, + {OB_NEGY, "NEGY", 0, "-Y", ""}, + {OB_NEGZ, "NEGZ", 0, "-Z", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem up_items[] = { - {OB_POSX, "X", "X", ""}, - {OB_POSY, "Y", "Y", ""}, - {OB_POSZ, "Z", "Z", ""}, - {0, NULL, NULL, NULL}}; + {OB_POSX, "X", 0, "X", ""}, + {OB_POSY, "Y", 0, "Y", ""}, + {OB_POSZ, "Z", 0, "Z", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem drawtype_items[] = { - {OB_BOUNDBOX, "BOUNDS", "Bounds", ""}, - {OB_WIRE, "WIRE", "Wire", ""}, - {OB_SOLID, "SOLID", "Solid", ""}, - {OB_SHADED, "SHADED", "Shaded", ""}, - {OB_TEXTURE, "TEXTURED", "Textured", ""}, - {0, NULL, NULL, NULL}}; + {OB_BOUNDBOX, "BOUNDS", 0, "Bounds", ""}, + {OB_WIRE, "WIRE", 0, "Wire", ""}, + {OB_SOLID, "SOLID", 0, "Solid", ""}, + {OB_SHADED, "SHADED", 0, "Shaded", ""}, + {OB_TEXTURE, "TEXTURED", 0, "Textured", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem boundtype_items[] = { - {OB_BOUND_BOX, "BOX", "Box", ""}, - {OB_BOUND_SPHERE, "SPHERE", "Sphere", ""}, - {OB_BOUND_CYLINDER, "CYLINDER", "Cylinder", ""}, - {OB_BOUND_CONE, "CONE", "Cone", ""}, - {OB_BOUND_POLYH, "POLYHEDER", "Polyheder", ""}, - {0, NULL, NULL, NULL}}; + {OB_BOUND_BOX, "BOX", 0, "Box", ""}, + {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""}, + {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""}, + {OB_BOUND_CONE, "CONE", 0, "Cone", ""}, + {OB_BOUND_POLYH, "POLYHEDER", 0, "Polyheder", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem dupli_items[] = { - {0, "NONE", "None", ""}, - {OB_DUPLIFRAMES, "FRAMES", "Frames", "Make copy of object for every frame."}, - {OB_DUPLIVERTS, "VERTS", "Verts", "Duplicate child objects on all vertices."}, - {OB_DUPLIFACES, "FACES", "Faces", "Duplicate child objects on all faces."}, - {OB_DUPLIGROUP, "GROUP", "Group", "Enable group instancing."}, - {0, NULL, NULL, NULL}}; + {0, "NONE", 0, "None", ""}, + {OB_DUPLIFRAMES, "FRAMES", 0, "Frames", "Make copy of object for every frame."}, + {OB_DUPLIVERTS, "VERTS", 0, "Verts", "Duplicate child objects on all vertices."}, + {OB_DUPLIFACES, "FACES", 0, "Faces", "Duplicate child objects on all faces."}, + {OB_DUPLIGROUP, "GROUP", 0, "Group", "Enable group instancing."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Object", "ID"); RNA_def_struct_ui_text(srna, "Object", "Object datablock defining an object in a scene.."); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 4f4530e0424..d144ed5f28b 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -136,29 +136,29 @@ static void rna_def_field(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem field_type_items[] = { - {0, "NONE", "None", ""}, - {PFIELD_FORCE, "SPHERICAL", "Spherical", ""}, - {PFIELD_VORTEX, "VORTEX", "Vortex", ""}, - {PFIELD_MAGNET, "MAGNET", "Magnetic", ""}, - {PFIELD_WIND, "WIND", "Wind", ""}, - {PFIELD_GUIDE, "GUIDE", "Curve Guide", ""}, - {PFIELD_TEXTURE, "TEXTURE", "Texture", ""}, - {PFIELD_HARMONIC, "HARMONIC", "Harmonic", ""}, - {PFIELD_CHARGE, "CHARGE", "Charge", ""}, - {PFIELD_LENNARDJ, "LENNARDJ", "Lennard-Jones", ""}, - {0, NULL, NULL, NULL}}; + {0, "NONE", 0, "None", ""}, + {PFIELD_FORCE, "SPHERICAL", 0, "Spherical", ""}, + {PFIELD_VORTEX, "VORTEX", 0, "Vortex", ""}, + {PFIELD_MAGNET, "MAGNET", 0, "Magnetic", ""}, + {PFIELD_WIND, "WIND", 0, "Wind", ""}, + {PFIELD_GUIDE, "GUIDE", 0, "Curve Guide", ""}, + {PFIELD_TEXTURE, "TEXTURE", 0, "Texture", ""}, + {PFIELD_HARMONIC, "HARMONIC", 0, "Harmonic", ""}, + {PFIELD_CHARGE, "CHARGE", 0, "Charge", ""}, + {PFIELD_LENNARDJ, "LENNARDJ", 0, "Lennard-Jones", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem falloff_items[] = { - {PFIELD_FALL_SPHERE, "SPHERE", "Sphere", ""}, - {PFIELD_FALL_TUBE, "TUBE", "Tube", ""}, - {PFIELD_FALL_CONE, "CONE", "Cone", ""}, - {0, NULL, NULL, NULL}}; + {PFIELD_FALL_SPHERE, "SPHERE", 0, "Sphere", ""}, + {PFIELD_FALL_TUBE, "TUBE", 0, "Tube", ""}, + {PFIELD_FALL_CONE, "CONE", 0, "Cone", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem texture_items[] = { - {PFIELD_TEX_RGB, "RGB", "RGB", ""}, - {PFIELD_TEX_GRAD, "GRADIENT", "Gradient", ""}, - {PFIELD_TEX_CURL, "CURL", "Curl", ""}, - {0, NULL, NULL, NULL}}; + {PFIELD_TEX_RGB, "RGB", 0, "RGB", ""}, + {PFIELD_TEX_GRAD, "GRADIENT", 0, "Gradient", ""}, + {PFIELD_TEX_CURL, "CURL", 0, "Curl", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FieldSettings", NULL); RNA_def_struct_sdna(srna, "PartDeflect"); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 8d23f9538a5..8ee71b6fd9e 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -160,18 +160,18 @@ static void rna_ParticleSystem_name_get(PointerRNA *ptr, char *str) } static EnumPropertyItem from_items[] = { - {PART_FROM_VERT, "VERT", "Vertexes", ""}, - {PART_FROM_FACE, "FACE", "Faces", ""}, - {PART_FROM_VOLUME, "VOLUME", "Volume", ""}, - {0, NULL, NULL, NULL} + {PART_FROM_VERT, "VERT", 0, "Vertexes", ""}, + {PART_FROM_FACE, "FACE", 0, "Faces", ""}, + {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem reactor_from_items[] = { - {PART_FROM_VERT, "VERT", "Vertexes", ""}, - {PART_FROM_FACE, "FACE", "Faces", ""}, - {PART_FROM_VOLUME, "VOLUME", "Volume", ""}, - {PART_FROM_PARTICLE, "PARTICLE", "Particle", ""}, - {0, NULL, NULL, NULL} + {PART_FROM_VERT, "VERT", 0, "Vertexes", ""}, + {PART_FROM_FACE, "FACE", 0, "Faces", ""}, + {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""}, + {PART_FROM_PARTICLE, "PARTICLE", 0, "Particle", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem *rna_Particle_from_itemf(PointerRNA *ptr) @@ -185,39 +185,39 @@ static EnumPropertyItem *rna_Particle_from_itemf(PointerRNA *ptr) } static EnumPropertyItem draw_as_items[] = { - {PART_DRAW_NOT, "NONE", "None", ""}, - {PART_DRAW_REND, "RENDER", "Rendered", ""}, - {PART_DRAW_DOT, "DOT", "Point", ""}, - {PART_DRAW_CIRC, "CIRC", "Circle", ""}, - {PART_DRAW_CROSS, "CROSS", "Cross", ""}, - {PART_DRAW_AXIS, "AXIS", "Axis", ""}, - {0, NULL, NULL, NULL} + {PART_DRAW_NOT, "NONE", 0, "None", ""}, + {PART_DRAW_REND, "RENDER", 0, "Rendered", ""}, + {PART_DRAW_DOT, "DOT", 0, "Point", ""}, + {PART_DRAW_CIRC, "CIRC", 0, "Circle", ""}, + {PART_DRAW_CROSS, "CROSS", 0, "Cross", ""}, + {PART_DRAW_AXIS, "AXIS", 0, "Axis", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem hair_draw_as_items[] = { - {PART_DRAW_NOT, "NONE", "None", ""}, - {PART_DRAW_REND, "RENDER", "Rendered", ""}, - {PART_DRAW_PATH, "PATH", "Path", ""}, - {0, NULL, NULL, NULL} + {PART_DRAW_NOT, "NONE", 0, "None", ""}, + {PART_DRAW_REND, "RENDER", 0, "Rendered", ""}, + {PART_DRAW_PATH, "PATH", 0, "Path", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem ren_as_items[] = { - {PART_DRAW_NOT, "NONE", "None", ""}, - {PART_DRAW_HALO, "HALO", "Halo", ""}, - {PART_DRAW_LINE, "LINE", "Line", ""}, - {PART_DRAW_PATH, "PATH", "Path", ""}, - {PART_DRAW_OB, "OBJECT", "Object", ""}, - {PART_DRAW_GR, "GROUP", "Group", ""}, - {PART_DRAW_BB, "BILLBOARD", "Billboard", ""}, - {0, NULL, NULL, NULL} + {PART_DRAW_NOT, "NONE", 0, "None", ""}, + {PART_DRAW_HALO, "HALO", 0, "Halo", ""}, + {PART_DRAW_LINE, "LINE", 0, "Line", ""}, + {PART_DRAW_PATH, "PATH", 0, "Path", ""}, + {PART_DRAW_OB, "OBJECT", 0, "Object", ""}, + {PART_DRAW_GR, "GROUP", 0, "Group", ""}, + {PART_DRAW_BB, "BILLBOARD", 0, "Billboard", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem hair_ren_as_items[] = { - {PART_DRAW_NOT, "NONE", "None", ""}, - {PART_DRAW_PATH, "PATH", "Path", ""}, - {PART_DRAW_OB, "OBJECT", "Object", ""}, - {PART_DRAW_GR, "GROUP", "Group", ""}, - {0, NULL, NULL, NULL} + {PART_DRAW_NOT, "NONE", 0, "None", ""}, + {PART_DRAW_PATH, "PATH", 0, "Path", ""}, + {PART_DRAW_OB, "OBJECT", 0, "Object", ""}, + {PART_DRAW_GR, "GROUP", 0, "Group", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem *rna_Particle_draw_as_itemf(PointerRNA *ptr) @@ -313,12 +313,12 @@ static void rna_def_particle(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem alive_items[] = { - {PARS_KILLED, "KILLED", "Killed", ""}, - {PARS_DEAD, "DEAD", "Dead", ""}, - {PARS_UNBORN, "UNBORN", "Unborn", ""}, - {PARS_ALIVE, "ALIVE", "Alive", ""}, - {PARS_DYING, "DYING", "Dying", ""}, - {0, NULL, NULL, NULL} + {PARS_KILLED, "KILLED", 0, "Killed", ""}, + {PARS_DEAD, "DEAD", 0, "Dead", ""}, + {PARS_UNBORN, "UNBORN", 0, "Unborn", ""}, + {PARS_ALIVE, "ALIVE", 0, "Alive", ""}, + {PARS_DYING, "DYING", 0, "Dying", ""}, + {0, NULL, 0, NULL, NULL} }; srna = RNA_def_struct(brna, "Particle", NULL); @@ -453,115 +453,115 @@ static void rna_def_particle_settings(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem type_items[] = { - {PART_EMITTER, "EMITTER", "Emitter", ""}, - {PART_REACTOR, "REACTOR", "Reactor", ""}, - {PART_HAIR, "HAIR", "Hair", ""}, - {0, NULL, NULL, NULL} + {PART_EMITTER, "EMITTER", 0, "Emitter", ""}, + {PART_REACTOR, "REACTOR", 0, "Reactor", ""}, + {PART_HAIR, "HAIR", 0, "Hair", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem dist_items[] = { - {PART_DISTR_JIT, "JIT", "Jittered", ""}, - {PART_DISTR_RAND, "RAND", "Random", ""}, - {PART_DISTR_GRID, "GRID", "Grid", ""}, - {0, NULL, NULL, NULL} + {PART_DISTR_JIT, "JIT", 0, "Jittered", ""}, + {PART_DISTR_RAND, "RAND", 0, "Random", ""}, + {PART_DISTR_GRID, "GRID", 0, "Grid", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem phys_type_items[] = { - {PART_PHYS_NO, "NO", "No", ""}, - {PART_PHYS_NEWTON, "NEWTON", "Newtonian", ""}, - {PART_PHYS_KEYED, "KEYED", "Keyed", ""}, - {PART_PHYS_BOIDS, "BOIDS", "Boids", ""}, - {0, NULL, NULL, NULL} + {PART_PHYS_NO, "NO", 0, "No", ""}, + {PART_PHYS_NEWTON, "NEWTON", 0, "Newtonian", ""}, + {PART_PHYS_KEYED, "KEYED", 0, "Keyed", ""}, + {PART_PHYS_BOIDS, "BOIDS", 0, "Boids", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem rot_mode_items[] = { - {0, "NONE", "None", ""}, - {PART_ROT_NOR, "NOR", "Normal", ""}, - {PART_ROT_VEL, "VEL", "Velocity", ""}, - {PART_ROT_GLOB_X, "GLOB_X", "Global X", ""}, - {PART_ROT_GLOB_Y, "GLOB_Y", "Global Y", ""}, - {PART_ROT_GLOB_Z, "GLOB_Z", "Global Z", ""}, - {PART_ROT_OB_X, "OB_X", "Object X", ""}, - {PART_ROT_OB_Y, "OB_Y", "Object Y", ""}, - {PART_ROT_OB_Z, "OB_Z", "Object Z", ""}, - {0, NULL, NULL, NULL} + {0, "NONE", 0, "None", ""}, + {PART_ROT_NOR, "NOR", 0, "Normal", ""}, + {PART_ROT_VEL, "VEL", 0, "Velocity", ""}, + {PART_ROT_GLOB_X, "GLOB_X", 0, "Global X", ""}, + {PART_ROT_GLOB_Y, "GLOB_Y", 0, "Global Y", ""}, + {PART_ROT_GLOB_Z, "GLOB_Z", 0, "Global Z", ""}, + {PART_ROT_OB_X, "OB_X", 0, "Object X", ""}, + {PART_ROT_OB_Y, "OB_Y", 0, "Object Y", ""}, + {PART_ROT_OB_Z, "OB_Z", 0, "Object Z", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem ave_mode_items[] = { - {0, "NONE", "None", ""}, - {PART_AVE_SPIN, "SPIN", "Spin", ""}, - {PART_AVE_RAND, "RAND", "Random", ""} , - {0, NULL, NULL, NULL} + {0, "NONE", 0, "None", ""}, + {PART_AVE_SPIN, "SPIN", 0, "Spin", ""}, + {PART_AVE_RAND, "RAND", 0, "Random", ""} , + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem react_event_items[] = { - {PART_EVENT_DEATH, "DEATH", "Death", ""}, - {PART_EVENT_COLLIDE, "COLLIDE", "Collision", ""}, - {PART_EVENT_NEAR, "NEAR", "Near", ""}, - {0, NULL, NULL, NULL} + {PART_EVENT_DEATH, "DEATH", 0, "Death", ""}, + {PART_EVENT_COLLIDE, "COLLIDE", 0, "Collision", ""}, + {PART_EVENT_NEAR, "NEAR", 0, "Near", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem child_type_items[] = { - {0, "NONE", "None", ""}, - {PART_CHILD_PARTICLES, "PARTICLES", "Particles", ""}, - {PART_CHILD_FACES, "FACES", "Faces", ""}, - {0, NULL, NULL, NULL} + {0, "NONE", 0, "None", ""}, + {PART_CHILD_PARTICLES, "PARTICLES", 0, "Particles", ""}, + {PART_CHILD_FACES, "FACES", 0, "Faces", ""}, + {0, NULL, 0, NULL, NULL} }; //TODO: names, tooltips static EnumPropertyItem rot_from_items[] = { - {PART_ROT_KEYS, "KEYS", "keys", ""}, - {PART_ROT_ZINCR, "ZINCR", "zincr", ""}, - {PART_ROT_IINCR, "IINCR", "iincr", ""}, - {0, NULL, NULL, NULL} + {PART_ROT_KEYS, "KEYS", 0, "keys", ""}, + {PART_ROT_ZINCR, "ZINCR", 0, "zincr", ""}, + {PART_ROT_IINCR, "IINCR", 0, "iincr", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem integrator_type_items[] = { - {PART_INT_EULER, "EULER", "Euler", ""}, - {PART_INT_MIDPOINT, "MIDPOINT", "Midpoint", ""}, - {PART_INT_RK4, "RK4", "RK4", ""}, - {0, NULL, NULL, NULL} + {PART_INT_EULER, "EULER", 0, "Euler", ""}, + {PART_INT_MIDPOINT, "MIDPOINT", 0, "Midpoint", ""}, + {PART_INT_RK4, "RK4", 0, "RK4", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem kink_type_items[] = { - {PART_KINK_NO, "NO", "Nothing", ""}, - {PART_KINK_CURL, "CURL", "Curl", ""}, - {PART_KINK_RADIAL, "RADIAL", "Radial", ""}, - {PART_KINK_WAVE, "WAVE", "Wave", ""}, - {PART_KINK_BRAID, "BRAID", "Braid", ""}, - {0, NULL, NULL, NULL} + {PART_KINK_NO, "NO", 0, "Nothing", ""}, + {PART_KINK_CURL, "CURL", 0, "Curl", ""}, + {PART_KINK_RADIAL, "RADIAL", 0, "Radial", ""}, + {PART_KINK_WAVE, "WAVE", 0, "Wave", ""}, + {PART_KINK_BRAID, "BRAID", 0, "Braid", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem kink_axis_items[] = { - {0, "X", "X", ""}, - {1, "Y", "Y", ""}, - {2, "Z", "Z", ""}, - {0, NULL, NULL, NULL} + {0, "X", 0, "X", ""}, + {1, "Y", 0, "Y", ""}, + {2, "Z", 0, "Z", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem bb_align_items[] = { - {PART_BB_X, "X", "X", ""}, - {PART_BB_Y, "Y", "Y", ""}, - {PART_BB_Z, "Z", "Z", ""}, - {PART_BB_VIEW, "VIEW", "View", ""}, - {PART_BB_VEL, "VEL", "Velocity", ""}, - {0, NULL, NULL, NULL} + {PART_BB_X, "X", 0, "X", ""}, + {PART_BB_Y, "Y", 0, "Y", ""}, + {PART_BB_Z, "Z", 0, "Z", ""}, + {PART_BB_VIEW, "VIEW", 0, "View", ""}, + {PART_BB_VEL, "VEL", 0, "Velocity", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem bb_anim_items[] = { - {PART_BB_ANIM_NONE, "NONE", "None", ""}, - {PART_BB_ANIM_TIME, "TIME", "Time", ""}, - {PART_BB_ANIM_ANGLE, "ANGLE", "Angle", ""}, - //{PART_BB_ANIM_OFF_TIME, "OFF_TIME", "off_time", ""}, - //{PART_BB_ANIM_OFF_ANGLE, "OFF_ANGLE", "off_angle", ""}, - {0, NULL, NULL, NULL} + {PART_BB_ANIM_NONE, "NONE", 0, "None", ""}, + {PART_BB_ANIM_TIME, "TIME", 0, "Time", ""}, + {PART_BB_ANIM_ANGLE, "ANGLE", 0, "Angle", ""}, + //{PART_BB_ANIM_OFF_TIME, "OFF_TIME", 0, "off_time", ""}, + //{PART_BB_ANIM_OFF_ANGLE, "OFF_ANGLE", 0, "off_angle", ""}, + {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem bb_split_offset_items[] = { - {PART_BB_OFF_NONE, "NONE", "None", ""}, - {PART_BB_OFF_LINEAR, "LINEAR", "Linear", ""}, - {PART_BB_OFF_RANDOM, "RANDOM", "Random", ""}, - {0, NULL, NULL, NULL} + {PART_BB_OFF_NONE, "NONE", 0, "None", ""}, + {PART_BB_OFF_LINEAR, "LINEAR", 0, "Linear", ""}, + {PART_BB_OFF_RANDOM, "RANDOM", 0, "Random", ""}, + {0, NULL, 0, NULL, NULL} }; srna= RNA_def_struct(brna, "ParticleSettings", "ID"); diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 8edcc4c72f4..b8863540bdf 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -69,9 +69,9 @@ IDProperty *rna_PoseChannel_idproperties(PointerRNA *ptr, int create) static void rna_def_pose_channel(BlenderRNA *brna) { static EnumPropertyItem prop_rotmode_items[] = { - {PCHAN_ROT_QUAT, "QUATERNION", "Quaternion (WXYZ)", "No Gimbal Lock (default)"}, - {PCHAN_ROT_EUL, "EULER", "Euler (XYZ)", "Prone to Gimbal Lock"}, - {0, NULL, NULL, NULL}}; + {PCHAN_ROT_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock (default)"}, + {PCHAN_ROT_EUL, "EULER", 0, "Euler (XYZ)", "Prone to Gimbal Lock"}, + {0, NULL, 0, NULL, NULL}}; StructRNA *srna; PropertyRNA *prop; diff --git a/source/blender/makesrna/intern/rna_property.c b/source/blender/makesrna/intern/rna_property.c index c38b6342942..a840552b86f 100644 --- a/source/blender/makesrna/intern/rna_property.c +++ b/source/blender/makesrna/intern/rna_property.c @@ -75,12 +75,12 @@ void RNA_def_gameproperty(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem gameproperty_type_items[] ={ - {GPROP_BOOL, "BOOL", "Boolean", ""}, - {GPROP_INT, "INT", "Integer", ""}, - {GPROP_FLOAT, "FLOAT", "Float", ""}, - {GPROP_STRING, "STRING", "String", ""}, - {GPROP_TIME, "TIMER", "Timer", ""}, - {0, NULL, NULL, NULL}}; + {GPROP_BOOL, "BOOL", 0, "Boolean", ""}, + {GPROP_INT, "INT", 0, "Integer", ""}, + {GPROP_FLOAT, "FLOAT", 0, "Float", ""}, + {GPROP_STRING, "STRING", 0, "String", ""}, + {GPROP_TIME, "TIMER", 0, "Timer", ""}, + {0, NULL, 0, NULL, NULL}}; /* Base Struct for GameProperty */ srna= RNA_def_struct(brna, "GameProperty", NULL); diff --git a/source/blender/makesrna/intern/rna_radio.c b/source/blender/makesrna/intern/rna_radio.c index 54dbd59b52d..8b862b4c535 100644 --- a/source/blender/makesrna/intern/rna_radio.c +++ b/source/blender/makesrna/intern/rna_radio.c @@ -40,10 +40,10 @@ void RNA_def_radio(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_drawtype_items[] = { - {RAD_WIREFRAME, "WIREFRAME", "Wireframe", "Enables Wireframe draw mode"}, - {RAD_SOLID, "SOLID", "Solid", "Enables Solid draw mode"}, - {RAD_GOURAUD, "GOURAUD", "Gouraud", "Enables Gouraud draw mode"}, - {0, NULL, NULL, NULL}}; + {RAD_WIREFRAME, "WIREFRAME", 0, "Wireframe", "Enables Wireframe draw mode"}, + {RAD_SOLID, "SOLID", 0, "Solid", "Enables Solid draw mode"}, + {RAD_GOURAUD, "GOURAUD", 0, "Gouraud", "Enables Gouraud draw mode"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Radiosity", NULL); RNA_def_struct_ui_text(srna, "Radiosity", "Settings for radiosity simulation of indirect diffuse lighting."); diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 8ea8844c65f..329175ad68b 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -626,26 +626,26 @@ static void rna_def_property(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem type_items[] = { - {PROP_BOOLEAN, "BOOLEAN", "Boolean", ""}, - {PROP_INT, "INT", "Integer", ""}, - {PROP_FLOAT, "FLOAT", "Float", ""}, - {PROP_STRING, "STRING", "String", ""}, - {PROP_ENUM, "ENUM", "Enumeration", ""}, - {PROP_POINTER, "POINTER", "Pointer", ""}, - {PROP_COLLECTION, "COLLECTION", "Collection", ""}, - {0, NULL, NULL, NULL}}; + {PROP_BOOLEAN, "BOOLEAN", 0, "Boolean", ""}, + {PROP_INT, "INT", 0, "Integer", ""}, + {PROP_FLOAT, "FLOAT", 0, "Float", ""}, + {PROP_STRING, "STRING", 0, "String", ""}, + {PROP_ENUM, "ENUM", 0, "Enumeration", ""}, + {PROP_POINTER, "POINTER", 0, "Pointer", ""}, + {PROP_COLLECTION, "COLLECTION", 0, "Collection", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem subtype_items[] = { - {PROP_NONE, "NONE", "None", ""}, - {PROP_UNSIGNED, "UNSIGNED", "Unsigned Number", ""}, - {PROP_FILEPATH, "FILE_PATH", "File Path", ""}, - {PROP_DIRPATH, "DIRECTORY_PATH", "Directory Path", ""}, - {PROP_COLOR, "COLOR", "Color", ""}, - {PROP_VECTOR, "VECTOR", "Vector", ""}, - {PROP_MATRIX, "MATRIX", "Matrix", ""}, - {PROP_ROTATION, "ROTATION", "Rotation", ""}, - {PROP_NEVER_NULL, "NEVER_NULL", "Never Null", ""}, - {PROP_PERCENTAGE, "PERCENTAGE", "Percentage", ""}, - {0, NULL, NULL, NULL}}; + {PROP_NONE, "NONE", 0, "None", ""}, + {PROP_UNSIGNED, "UNSIGNED", 0, "Unsigned Number", ""}, + {PROP_FILEPATH, "FILE_PATH", 0, "File Path", ""}, + {PROP_DIRPATH, "DIRECTORY_PATH", 0, "Directory Path", ""}, + {PROP_COLOR, "COLOR", 0, "Color", ""}, + {PROP_VECTOR, "VECTOR", 0, "Vector", ""}, + {PROP_MATRIX, "MATRIX", 0, "Matrix", ""}, + {PROP_ROTATION, "ROTATION", 0, "Rotation", ""}, + {PROP_NEVER_NULL, "NEVER_NULL", 0, "Never Null", ""}, + {PROP_PERCENTAGE, "PERCENTAGE", 0, "Percentage", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Property", NULL); RNA_def_struct_ui_text(srna, "Property Definition", "RNA property definition."); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 3907a633e3d..64ba6e11e56 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -41,14 +41,14 @@ /* prop_mode needs to be accessible from transform operator */ EnumPropertyItem prop_mode_items[] ={ - {PROP_SMOOTH, "SMOOTH", "Smooth", ""}, - {PROP_SPHERE, "SPHERE", "Sphere", ""}, - {PROP_ROOT, "ROOT", "Root", ""}, - {PROP_SHARP, "SHARP", "Sharp", ""}, - {PROP_LIN, "LINEAR", "Linear", ""}, - {PROP_CONST, "CONSTANT", "Constant", ""}, - {PROP_RANDOM, "RANDOM", "Random", ""}, - {0, NULL, NULL, NULL}}; + {PROP_SMOOTH, "SMOOTH", 0, "Smooth", ""}, + {PROP_SPHERE, "SPHERE", 0, "Sphere", ""}, + {PROP_ROOT, "ROOT", 0, "Root", ""}, + {PROP_SHARP, "SHARP", 0, "Sharp", ""}, + {PROP_LIN, "LINEAR", 0, "Linear", ""}, + {PROP_CONST, "CONSTANT", 0, "Constant", ""}, + {PROP_RANDOM, "RANDOM", 0, "Random", ""}, + {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME @@ -172,161 +172,161 @@ void rna_def_scene_render_data(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem pixel_filter_items[] ={ - {R_FILTER_BOX, "BOX", "Box", ""}, - {R_FILTER_TENT, "TENT", "Tent", ""}, - {R_FILTER_QUAD, "QUADRATIC", "Quadratic", ""}, - {R_FILTER_CUBIC, "CUBIC", "Cubic", ""}, - {R_FILTER_CATROM, "CATMULLROM", "Catmull-Rom", ""}, - {R_FILTER_GAUSS, "GAUSSIAN", "Gaussian", ""}, - {R_FILTER_MITCH, "MITCHELL", "Mitchell-Netravali", ""}, - {0, NULL, NULL, NULL}}; + {R_FILTER_BOX, "BOX", 0, "Box", ""}, + {R_FILTER_TENT, "TENT", 0, "Tent", ""}, + {R_FILTER_QUAD, "QUADRATIC", 0, "Quadratic", ""}, + {R_FILTER_CUBIC, "CUBIC", 0, "Cubic", ""}, + {R_FILTER_CATROM, "CATMULLROM", 0, "Catmull-Rom", ""}, + {R_FILTER_GAUSS, "GAUSSIAN", 0, "Gaussian", ""}, + {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem alpha_mode_items[] ={ - {R_ADDSKY, "SKY", "Sky", "Transparent pixels are filled with sky color"}, - {R_ALPHAPREMUL, "PREMUL", "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"}, - {R_ALPHAKEY, "STRAIGHT", "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"}, - {0, NULL, NULL, NULL}}; + {R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"}, + {R_ALPHAPREMUL, "PREMUL", 0, "Premultiplied", "Transparent RGB pixels are multiplied by the alpha channel"}, + {R_ALPHAKEY, "STRAIGHT", 0, "Straight Alpha", "Transparent RGB and alpha pixels are unmodified"}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem color_mode_items[] ={ - {R_PLANESBW, "BW", "BW", "Images are saved with BW (grayscale) data"}, - {R_PLANES24, "RGB", "RGB", "Images are saved with RGB (color) data"}, - {R_PLANES32, "RGBA", "RGBA", "Images are saved with RGB and Alpha data (if supported)"}, - {0, NULL, NULL, NULL}}; + {R_PLANESBW, "BW", 0, "BW", "Images are saved with BW (grayscale) data"}, + {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"}, + {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem octree_resolution_items[] = { - {64, "OCTREE_RES_64", "64", ""}, - {128, "OCTREE_RES_128", "128", ""}, - {256, "OCTREE_RES_256", "256", ""}, - {512, "OCTREE_RES_512", "512", ""}, - {0, NULL, NULL, NULL}}; + {64, "OCTREE_RES_64", 0, "64", ""}, + {128, "OCTREE_RES_128", 0, "128", ""}, + {256, "OCTREE_RES_256", 0, "256", ""}, + {512, "OCTREE_RES_512", 0, "512", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem fixed_oversample_items[] = { - {5, "OVERSAMPLE_5", "5", ""}, - {8, "OVERSAMPLE_8", "8", ""}, - {11, "OVERSAMPLE_11", "11", ""}, - {16, "OVERSAMPLE_16", "16", ""}, - {0, NULL, NULL, NULL}}; + {5, "OVERSAMPLE_5", 0, "5", ""}, + {8, "OVERSAMPLE_8", 0, "8", ""}, + {11, "OVERSAMPLE_11", 0, "11", ""}, + {16, "OVERSAMPLE_16", 0, "16", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem field_order_items[] = { - {0, "FIELDS_EVENFIRST", "Even", "Even Fields First"}, - {R_ODDFIELD, "FIELDS_ODDFIRST", "Odd", "Odd Fields First"}, - {0, NULL, NULL, NULL}}; + {0, "FIELDS_EVENFIRST", 0, "Even", "Even Fields First"}, + {R_ODDFIELD, "FIELDS_ODDFIRST", 0, "Odd", "Odd Fields First"}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem threads_mode_items[] = { - {0, "THREADS_AUTO", "Auto-detect", "Automatically determine the number of threads, based on CPUs"}, - {R_FIXED_THREADS, "THREADS_FIXED", "Fixed", "Manually determine the number of threads"}, - {0, NULL, NULL, NULL}}; + {0, "THREADS_AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"}, + {R_FIXED_THREADS, "THREADS_FIXED", 0, "Fixed", "Manually determine the number of threads"}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem stamp_font_size_items[] = { - {1, "STAMP_FONT_TINY", "Tiny", ""}, - {2, "STAMP_FONT_SMALL", "Small", ""}, - {3, "STAMP_FONT_MEDIUM", "Medium", ""}, - {0, "STAMP_FONT_LARGE", "Large", ""}, - {4, "STAMP_FONT_EXTRALARGE", "Extra Large", ""}, - {0, NULL, NULL, NULL}}; + {1, "STAMP_FONT_TINY", 0, "Tiny", ""}, + {2, "STAMP_FONT_SMALL", 0, "Small", ""}, + {3, "STAMP_FONT_MEDIUM", 0, "Medium", ""}, + {0, "STAMP_FONT_LARGE", 0, "Large", ""}, + {4, "STAMP_FONT_EXTRALARGE", 0, "Extra Large", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem image_type_items[] = { - {R_FRAMESERVER, "FRAMESERVER", "Frame Server", ""}, + {R_FRAMESERVER, "FRAMESERVER", 0, "Frame Server", ""}, #ifdef WITH_FFMPEG - {R_FFMPEG, "FFMPEG", "FFMpeg", ""}, + {R_FFMPEG, "FFMPEG", 0, "FFMpeg", ""}, #endif - {R_AVIRAW, "AVIRAW", "AVI Raw", ""}, - {R_AVIJPEG, "AVIJPEG", "AVI JPEG", ""}, + {R_AVIRAW, "AVIRAW", 0, "AVI Raw", ""}, + {R_AVIJPEG, "AVIJPEG", 0, "AVI JPEG", ""}, #ifdef _WIN32 - {R_AVICODEC, "AVICODEC", "AVI Codec", ""}, + {R_AVICODEC, "AVICODEC", 0, "AVI Codec", ""}, #endif #ifdef WITH_QUICKTIME - {R_QUICKTIME, "QUICKTIME", "QuickTime", ""}, + {R_QUICKTIME, "QUICKTIME", 0, "QuickTime", ""}, #endif - {R_TARGA, "TARGA", "Targa", ""}, - {R_RAWTGA, "RAWTARGA", "Targa Raw", ""}, - {R_PNG, "PNG", "PNG", ""}, - //{R_DDS, "DDS", "DDS", ""}, // XXX not yet implemented + {R_TARGA, "TARGA", 0, "Targa", ""}, + {R_RAWTGA, "RAWTARGA", 0, "Targa Raw", ""}, + {R_PNG, "PNG", 0, "PNG", ""}, + //{R_DDS, "DDS", 0, "DDS", ""}, // XXX not yet implemented //#ifdef WITH_OPENJPEG - {R_JP2, "JPEG2000", "JPEG 2000", ""}, + {R_JP2, "JPEG2000", 0, "JPEG 2000", ""}, //#endif - {R_BMP, "BMP", "BMP", ""}, - {R_JPEG90, "JPEG", "JPEG", ""}, - {R_HAMX, "HAMX", "HamX", ""}, - {R_IRIS, "IRIS", "Iris", ""}, - {R_RADHDR, "RADHDR", "Radiance HDR", ""}, - {R_CINEON, "CINEON", "Cineon", ""}, - {R_DPX, "DPX", "DPX", ""}, + {R_BMP, "BMP", 0, "BMP", ""}, + {R_JPEG90, "JPEG", 0, "JPEG", ""}, + {R_HAMX, "HAMX", 0, "HamX", ""}, + {R_IRIS, "IRIS", 0, "Iris", ""}, + {R_RADHDR, "RADHDR", 0, "Radiance HDR", ""}, + {R_CINEON, "CINEON", 0, "Cineon", ""}, + {R_DPX, "DPX", 0, "DPX", ""}, #ifdef __sgi - {R_MOVIE, "MOVIE", "Movie", ""}, + {R_MOVIE, "MOVIE", 0, "Movie", ""}, #endif //#ifdef WITH_OPENEXR - {R_OPENEXR, "OPENEXR", "OpenEXR", ""}, - {R_MULTILAYER, "MULTILAYER", "MultiLayer", ""}, + {R_OPENEXR, "OPENEXR", 0, "OpenEXR", ""}, + {R_MULTILAYER, "MULTILAYER", 0, "MultiLayer", ""}, //#endif - {R_TIFF, "TIFF", "TIFF", ""}, // XXX only with G.have_libtiff - {0, NULL, NULL, NULL}}; + {R_TIFF, "TIFF", 0, "TIFF", ""}, // XXX only with G.have_libtiff + {0, NULL, 0, NULL, NULL}}; //#ifdef WITH_OPENEXR static EnumPropertyItem exr_codec_items[] = { - {0, "NONE", "None", ""}, - {1, "PXR24", "Pxr24 (lossy)", ""}, - {2, "ZIP", "ZIP (lossless)", ""}, - {3, "PIZ", "PIZ (lossless)", ""}, - {4, "RLE", "RLE (lossless)", ""}, - {0, NULL, NULL, NULL}}; + {0, "NONE", 0, "None", ""}, + {1, "PXR24", 0, "Pxr24 (lossy)", ""}, + {2, "ZIP", 0, "ZIP (lossless)", ""}, + {3, "PIZ", 0, "PIZ (lossless)", ""}, + {4, "RLE", 0, "RLE (lossless)", ""}, + {0, NULL, 0, NULL, NULL}}; //#endif //#ifdef WITH_OPENJPEG static EnumPropertyItem jp2_preset_items[] = { - {0, "NO_PRESET", "No Preset", ""}, - {1, "R_JPEG2K_CINE_PRESET", "Cinema 24fps 2048x1080", ""}, - {2, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", "Cinema 48fps 2048x1080", ""}, - {3, "R_JPEG2K_CINE_PRESET", "Cinema 24fps 4096x2160", ""}, - {4, "R_JPEG2K_CINE_PRESET", "Cine-Scope 24fps 2048x858", ""}, - {5, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", "Cine-Scope 48fps 2048x858", ""}, - {6, "R_JPEG2K_CINE_PRESET", "Cine-Flat 24fps 1998x1080", ""}, - {7, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", "Cine-Flat 48fps 1998x1080", ""}, - {0, NULL, NULL, NULL}}; + {0, "NO_PRESET", 0, "No Preset", ""}, + {1, "R_JPEG2K_CINE_PRESET", 0, "Cinema 24fps 2048x1080", ""}, + {2, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""}, + {3, "R_JPEG2K_CINE_PRESET", 0, "Cinema 24fps 4096x2160", ""}, + {4, "R_JPEG2K_CINE_PRESET", 0, "Cine-Scope 24fps 2048x858", ""}, + {5, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""}, + {6, "R_JPEG2K_CINE_PRESET", 0, "Cine-Flat 24fps 1998x1080", ""}, + {7, "R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem jp2_depth_items[] = { - {0, "8", "8", ""}, - {R_JPEG2K_12BIT, "16", "16", ""}, - {R_JPEG2K_16BIT, "32", "32", ""}, - {0, NULL, NULL, NULL}}; + {0, "8", 0, "8", ""}, + {R_JPEG2K_12BIT, "16", 0, "16", ""}, + {R_JPEG2K_16BIT, "32", 0, "32", ""}, + {0, NULL, 0, NULL, NULL}}; //#endif /* #ifdef WITH_FFMPEG static EnumPropertyItem ffmpeg_format_items[] = { - {FFMPEG_MPEG1, "MPEG1", "MPEG-1", ""}, - {FFMPEG_MPEG2, "MPEG2", "MPEG-2", ""}, - {FFMPEG_MPEG4, "MPEG4", "MPEG-4", ""}, - {FFMPEG_AVI, "AVI", "Avi", ""}, - {FFMPEG_MOV, "QUICKTIME", "Quicktime", ""}, - {FFMPEG_DV, "DV", "DV", ""}, - {FFMPEG_H264, "H264", "H264", ""}, - {FFMPEG_XVID, "XVID", "XVid", ""}, - {FFMPEG_OGG, "OGG", "OGG", ""}, - {FFMPEG_FLV, "FLASH", "Flash", ""}, - {0, NULL, NULL, NULL}}; + {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""}, + {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""}, + {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""}, + {FFMPEG_AVI, "AVI", 0, "Avi", ""}, + {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""}, + {FFMPEG_DV, "DV", 0, "DV", ""}, + {FFMPEG_H264, "H264", 0, "H264", ""}, + {FFMPEG_XVID, "XVID", 0, "XVid", ""}, + {FFMPEG_OGG, "OGG", 0, "OGG", ""}, + {FFMPEG_FLV, "FLASH", 0, "Flash", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem ffmpeg_codec_items[] = { - {CODEC_ID_MPEG1VIDEO, "MPEG1", "MPEG-1", ""}, - {CODEC_ID_MPEG2VIDEO, "MPEG2", "MPEG-2", ""}, - {CODEC_ID_MPEG4, "MPEG4", "MPEG-4(divx)", ""}, - {CODEC_ID_HUFFYUV, "HUFFYUV", "HuffYUV", ""}, - {CODEC_ID_DVVIDEO, "DV", "DV", ""}, - {CODEC_ID_H264, "H264", "H264", ""}, - {CODEC_ID_XVID, "XVID", "XVid", ""}, - {CODEC_ID_THEORA, "THEORA", "OGG Theora", ""}, - {CODEC_ID_FLV1, "FLASH", "FlashVideo1", ""}, - {0, NULL, NULL, NULL}}; + {CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""}, + {CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""}, + {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""}, + {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""}, + {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""}, + {CODEC_ID_H264, "H264", 0, "H264", ""}, + {CODEC_ID_XVID, "XVID", 0, "XVid", ""}, + {CODEC_ID_THEORA, "THEORA", 0, "OGG Theora", ""}, + {CODEC_ID_FLV1, "FLASH", 0, "FlashVideo1", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem ffmpeg_audio_codec_items[] = { - {CODEC_ID_MP2, "MP2", "MP2", ""}, - {CODEC_ID_MP3, "MP3", "MP3", ""}, - {CODEC_ID_AC3, "AC3", "AC3", ""}, - {CODEC_ID_AAC, "AAC", "AAC", ""}, - {CODEC_ID_VORBIS, "VORBIS", "Vorbis", ""}, - {CODEC_ID_PCM_S16LE, "PCM", "PCM", ""}, - {0, NULL, NULL, NULL}}; + {CODEC_ID_MP2, "MP2", 0, "MP2", ""}, + {CODEC_ID_MP3, "MP3", 0, "MP3", ""}, + {CODEC_ID_AC3, "AC3", 0, "AC3", ""}, + {CODEC_ID_AAC, "AAC", 0, "AAC", ""}, + {CODEC_ID_VORBIS, "VORBIS", 0, "Vorbis", ""}, + {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""}, + {0, NULL, 0, NULL, NULL}}; #endif */ @@ -840,9 +840,9 @@ void RNA_def_scene(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem unwrapper_items[] = { - {0, "CONFORMAL", "Conformal", ""}, - {1, "ANGLEBASED", "Angle Based", ""}, - {0, NULL, NULL, NULL}}; + {0, "CONFORMAL", 0, "Conformal", ""}, + {1, "ANGLEBASED", 0, "Angle Based", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Scene", "ID"); RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings."); diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index e153994e7a6..b7279757455 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -33,12 +33,12 @@ #include "DNA_scene_types.h" EnumPropertyItem region_type_items[] = { - {RGN_TYPE_WINDOW, "WINDOW", "Window", ""}, - {RGN_TYPE_HEADER, "HEADER", "Header", ""}, - {RGN_TYPE_CHANNELS, "CHANNELS", "Channels", ""}, - {RGN_TYPE_TEMPORARY, "TEMPORARY", "Temporary", ""}, - {RGN_TYPE_UI, "UI", "UI", ""}, - {0, NULL, NULL, NULL}}; + {RGN_TYPE_WINDOW, "WINDOW", 0, "Window", ""}, + {RGN_TYPE_HEADER, "HEADER", 0, "Header", ""}, + {RGN_TYPE_CHANNELS, "CHANNELS", 0, "Channels", ""}, + {RGN_TYPE_TEMPORARY, "TEMPORARY", 0, "Temporary", ""}, + {RGN_TYPE_UI, "UI", 0, "UI", ""}, + {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c index 265b59c97ae..53bd230870f 100644 --- a/source/blender/makesrna/intern/rna_sensor.c +++ b/source/blender/makesrna/intern/rna_sensor.c @@ -78,21 +78,21 @@ void rna_def_sensor(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem sensor_type_items[] ={ - {SENS_ALWAYS, "ALWAYS", "Always", ""}, - {SENS_TOUCH, "TOUCH", "Touch", ""}, - {SENS_NEAR, "NEAR", "Near", ""}, - {SENS_KEYBOARD, "KEYBOARD", "Keyboard", ""}, - {SENS_PROPERTY, "PROPERTY", "Property", ""}, - {SENS_MOUSE, "MOUSE", "Mouse", ""}, - {SENS_COLLISION, "COLLISION", "Collision", ""}, - {SENS_RADAR, "RADAR", "Radar", ""}, - {SENS_RANDOM, "RANDOM", "Random", ""}, - {SENS_RAY, "RAY", "Ray", ""}, - {SENS_MESSAGE, "MESSAGE", "Message", ""}, - {SENS_JOYSTICK, "JOYSTICK", "joystick", ""}, - {SENS_ACTUATOR, "ACTUATOR", "Actuator", ""}, - {SENS_DELAY, "DELAY", "Delay", ""}, - {0, NULL, NULL, NULL}}; + {SENS_ALWAYS, "ALWAYS", 0, "Always", ""}, + {SENS_TOUCH, "TOUCH", 0, "Touch", ""}, + {SENS_NEAR, "NEAR", 0, "Near", ""}, + {SENS_KEYBOARD, "KEYBOARD", 0, "Keyboard", ""}, + {SENS_PROPERTY, "PROPERTY", 0, "Property", ""}, + {SENS_MOUSE, "MOUSE", 0, "Mouse", ""}, + {SENS_COLLISION, "COLLISION", 0, "Collision", ""}, + {SENS_RADAR, "RADAR", 0, "Radar", ""}, + {SENS_RANDOM, "RANDOM", 0, "Random", ""}, + {SENS_RAY, "RAY", 0, "Ray", ""}, + {SENS_MESSAGE, "MESSAGE", 0, "Message", ""}, + {SENS_JOYSTICK, "JOYSTICK", 0, "joystick", ""}, + {SENS_ACTUATOR, "ACTUATOR", 0, "Actuator", ""}, + {SENS_DELAY, "DELAY", 0, "Delay", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Sensor", NULL); RNA_def_struct_ui_text(srna, "Sensor", "Game engine logic brick to detect events."); @@ -166,15 +166,15 @@ void rna_def_mouse_sensor(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem mouse_event_items[] ={ - {BL_SENS_MOUSE_LEFT_BUTTON, "LEFTCLICK", "Left Button", ""}, - {BL_SENS_MOUSE_MIDDLE_BUTTON, "MIDDLECLICK", "Middle Button", ""}, - {BL_SENS_MOUSE_RIGHT_BUTTON, "RIGHTCLICK", "Right Button", ""}, - {BL_SENS_MOUSE_WHEEL_UP, "WHEELUP", "Wheel Up", ""}, - {BL_SENS_MOUSE_WHEEL_DOWN, "WHEELDOWN", "Wheel Down", ""}, - {BL_SENS_MOUSE_MOVEMENT, "MOVEMENT", "Movement", ""}, - {BL_SENS_MOUSE_MOUSEOVER, "MOUSEOVER", "Mouse Over", ""}, - {BL_SENS_MOUSE_MOUSEOVER_ANY, "MOUSEOVERANY", "Mouse Over Any", ""}, - {0, NULL, NULL, NULL}}; + {BL_SENS_MOUSE_LEFT_BUTTON, "LEFTCLICK", 0, "Left Button", ""}, + {BL_SENS_MOUSE_MIDDLE_BUTTON, "MIDDLECLICK", 0, "Middle Button", ""}, + {BL_SENS_MOUSE_RIGHT_BUTTON, "RIGHTCLICK", 0, "Right Button", ""}, + {BL_SENS_MOUSE_WHEEL_UP, "WHEELUP", 0, "Wheel Up", ""}, + {BL_SENS_MOUSE_WHEEL_DOWN, "WHEELDOWN", 0, "Wheel Down", ""}, + {BL_SENS_MOUSE_MOVEMENT, "MOVEMENT", 0, "Movement", ""}, + {BL_SENS_MOUSE_MOUSEOVER, "MOUSEOVER", 0, "Mouse Over", ""}, + {BL_SENS_MOUSE_MOUSEOVER_ANY, "MOUSEOVERANY", 0, "Mouse Over Any", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "MouseSensor", "Sensor"); RNA_def_struct_ui_text(srna, "Mouse Sensor", "Sensor to detect mouse events."); @@ -245,12 +245,12 @@ void rna_def_property_sensor(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_type_items[] ={ - {SENS_PROP_EQUAL, "PROPEQUAL", "Equal", ""}, - {SENS_PROP_NEQUAL, "PROPNEQUAL", "Not Equal", ""}, - {SENS_PROP_INTERVAL, "PROPINTERVAL", "Interval", ""}, - {SENS_PROP_CHANGED, "PROPCHANGED", "Changed", ""}, - /* {SENS_PROP_EXPRESSION, "PROPEXPRESSION", "Expression", ""}, NOT_USED_IN_UI */ - {0, NULL, NULL, NULL}}; + {SENS_PROP_EQUAL, "PROPEQUAL", 0, "Equal", ""}, + {SENS_PROP_NEQUAL, "PROPNEQUAL", 0, "Not Equal", ""}, + {SENS_PROP_INTERVAL, "PROPINTERVAL", 0, "Interval", ""}, + {SENS_PROP_CHANGED, "PROPCHANGED", 0, "Changed", ""}, + /* {SENS_PROP_EXPRESSION, "PROPEXPRESSION", 0, "Expression", ""}, NOT_USED_IN_UI */ + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "PropertySensor", "Sensor"); RNA_def_struct_ui_text(srna, "Property Sensor", "Sensor to detect values and changes in values of properties."); @@ -319,9 +319,9 @@ void rna_def_collision_sensor(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_type_items[] ={ - {0, "PROPERTY", "Property", ""}, - {1, "MATERIAL", "Material", ""}, - {0, NULL, NULL, NULL}}; + {0, "PROPERTY", 0, "Property", ""}, + {1, "MATERIAL", 0, "Material", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "CollisionSensor", "Sensor"); RNA_def_struct_ui_text(srna, "Collision Sensor", "Sensor to detect objects colliding with the current object, with more settings than the Touch sensor."); @@ -346,13 +346,13 @@ void rna_def_radar_sensor(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem axis_items[] ={ - {SENS_RAY_X_AXIS, "XAXIS", "+X axis", ""}, - {SENS_RAY_Y_AXIS, "YAXIS", "+Y axis", ""}, - {SENS_RAY_Z_AXIS, "ZAXIS", "+Z axis", ""}, - {SENS_RAY_NEG_X_AXIS, "NEGXAXIS", "-X axis", ""}, - {SENS_RAY_NEG_Y_AXIS, "NEGYAXIS", "-Y axis", ""}, - {SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", "-Z axis", ""}, - {0, NULL, NULL, NULL}}; + {SENS_RAY_X_AXIS, "XAXIS", 0, "+X axis", ""}, + {SENS_RAY_Y_AXIS, "YAXIS", 0, "+Y axis", ""}, + {SENS_RAY_Z_AXIS, "ZAXIS", 0, "+Z axis", ""}, + {SENS_RAY_NEG_X_AXIS, "NEGXAXIS", 0, "-X axis", ""}, + {SENS_RAY_NEG_Y_AXIS, "NEGYAXIS", 0, "-Y axis", ""}, + {SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "RadarSensor", "Sensor"); RNA_def_struct_ui_text(srna, "Radar Sensor", "Sensor to detect objects in a cone shaped radar emanating from the current object."); @@ -395,17 +395,17 @@ void rna_def_ray_sensor(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem axis_items[] ={ - {SENS_RAY_X_AXIS, "XAXIS", "+X axis", ""}, - {SENS_RAY_Y_AXIS, "YAXIS", "+Y axis", ""}, - {SENS_RAY_Z_AXIS, "ZAXIS", "+Z axis", ""}, - {SENS_RAY_NEG_X_AXIS, "NEGXAXIS", "-X axis", ""}, - {SENS_RAY_NEG_Y_AXIS, "NEGYAXIS", "-Y axis", ""}, - {SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", "-Z axis", ""}, - {0, NULL, NULL, NULL}}; + {SENS_RAY_X_AXIS, "XAXIS", 0, "+X axis", ""}, + {SENS_RAY_Y_AXIS, "YAXIS", 0, "+Y axis", ""}, + {SENS_RAY_Z_AXIS, "ZAXIS", 0, "+Z axis", ""}, + {SENS_RAY_NEG_X_AXIS, "NEGXAXIS", 0, "-X axis", ""}, + {SENS_RAY_NEG_Y_AXIS, "NEGYAXIS", 0, "-Y axis", ""}, + {SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_type_items[] ={ - {0, "PROPERTY", "Property", ""}, - {1, "MATERIAL", "Material", ""}, - {0, NULL, NULL, NULL}}; + {0, "PROPERTY", 0, "Property", ""}, + {1, "MATERIAL", 0, "Material", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "RaySensor", "Sensor"); RNA_def_struct_ui_text(srna, "Ray Sensor", "Sensor to detect intersections with a ray emanating from the current object."); @@ -457,17 +457,17 @@ void rna_def_joystick_sensor(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem event_type_items[] ={ - {SENS_JOY_BUTTON, "BUTTON", "Button", ""}, - {SENS_JOY_AXIS, "AXIS", "Axis", ""}, - {SENS_JOY_HAT, "HAT", "Hat", ""}, - {0, NULL, NULL, NULL}}; + {SENS_JOY_BUTTON, "BUTTON", 0, "Button", ""}, + {SENS_JOY_AXIS, "AXIS", 0, "Axis", ""}, + {SENS_JOY_HAT, "HAT", 0, "Hat", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem axis_direction_items[] ={ - {SENS_JOY_X_AXIS, "RIGHTAXIS", "Right Axis", ""}, - {SENS_JOY_Y_AXIS, "UPAXIS", "Up Axis", ""}, - {SENS_JOY_NEG_X_AXIS, "LEFTAXIS", "Left Axis", ""}, - {SENS_JOY_NEG_Y_AXIS, "DOWNAXIS", "Down Axis", ""}, - {0, NULL, NULL, NULL}}; + {SENS_JOY_X_AXIS, "RIGHTAXIS", 0, "Right Axis", ""}, + {SENS_JOY_Y_AXIS, "UPAXIS", 0, "Up Axis", ""}, + {SENS_JOY_NEG_X_AXIS, "LEFTAXIS", 0, "Left Axis", ""}, + {SENS_JOY_NEG_Y_AXIS, "DOWNAXIS", 0, "Down Axis", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "JoystickSensor", "Sensor"); RNA_def_struct_ui_text(srna, "Joystick Sensor", "Sensor to detect joystick events."); diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index b21e08fcd1a..69e884fe249 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -40,6 +40,8 @@ #ifdef RNA_RUNTIME +#include "MEM_guardedalloc.h" + static int rna_SequenceEditor_name_length(PointerRNA *ptr) { return strlen("Sequence Editor"); @@ -356,41 +358,41 @@ static void rna_def_sequence(BlenderRNA *brna) FunctionRNA *func; static const EnumPropertyItem seq_type_items[]= { - {SEQ_IMAGE, "IMAGE", "Image", ""}, - {SEQ_META, "META", "Meta", ""}, - {SEQ_SCENE, "SCENE", "Scene", ""}, - {SEQ_MOVIE, "MOVIE", "Movie", ""}, - {SEQ_RAM_SOUND, "RAM_SOUND", "Ram Sound", ""}, - {SEQ_HD_SOUND, "HD_SOUND", "HD Sound", ""}, - {SEQ_MOVIE_AND_HD_SOUND, "MOVIE_AND_HD_SOUND", "Movie and HD Sound", ""}, - {SEQ_EFFECT, "REPLACE", "Replace", ""}, - {SEQ_CROSS, "CROSS", "Cross", ""}, - {SEQ_ADD, "ADD", "Add", ""}, - {SEQ_SUB, "SUBTRACT", "Subtract", ""}, - {SEQ_ALPHAOVER, "ALPHA_OVER", "Alpha Over", ""}, - {SEQ_ALPHAUNDER, "ALPHA_UNDER", "Alpha Under", ""}, - {SEQ_GAMCROSS, "GAMMA_CROSS", "Gamma Cross", ""}, - {SEQ_MUL, "MULTIPLY", "Multiply", ""}, - {SEQ_OVERDROP, "OVER_DROP", "Over Drop", ""}, - {SEQ_PLUGIN, "PLUGIN", "plugin", ""}, - {SEQ_WIPE, "WIPE", "Wipe", ""}, - {SEQ_GLOW, "GLOW", "Glow", ""}, - {SEQ_TRANSFORM, "TRANSFORM", "Transform", ""}, - {SEQ_COLOR, "COLOR", "Color", ""}, - {SEQ_SPEED, "SPEED", "Speed", ""}, - {0, NULL, NULL, NULL}}; + {SEQ_IMAGE, "IMAGE", 0, "Image", ""}, + {SEQ_META, "META", 0, "Meta", ""}, + {SEQ_SCENE, "SCENE", 0, "Scene", ""}, + {SEQ_MOVIE, "MOVIE", 0, "Movie", ""}, + {SEQ_RAM_SOUND, "RAM_SOUND", 0, "Ram Sound", ""}, + {SEQ_HD_SOUND, "HD_SOUND", 0, "HD Sound", ""}, + {SEQ_MOVIE_AND_HD_SOUND, "MOVIE_AND_HD_SOUND", 0, "Movie and HD Sound", ""}, + {SEQ_EFFECT, "REPLACE", 0, "Replace", ""}, + {SEQ_CROSS, "CROSS", 0, "Cross", ""}, + {SEQ_ADD, "ADD", 0, "Add", ""}, + {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""}, + {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""}, + {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""}, + {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""}, + {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""}, + {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""}, + {SEQ_PLUGIN, "PLUGIN", 0, "plugin", ""}, + {SEQ_WIPE, "WIPE", 0, "Wipe", ""}, + {SEQ_GLOW, "GLOW", 0, "Glow", ""}, + {SEQ_TRANSFORM, "TRANSFORM", 0, "Transform", ""}, + {SEQ_COLOR, "COLOR", 0, "Color", ""}, + {SEQ_SPEED, "SPEED", 0, "Speed", ""}, + {0, NULL, 0, NULL, NULL}}; static const EnumPropertyItem blend_mode_items[]= { - {SEQ_BLEND_REPLACE, "REPLACE", "Replace", ""}, - {SEQ_CROSS, "CROSS", "Cross", ""}, - {SEQ_ADD, "ADD", "Add", ""}, - {SEQ_SUB, "SUBTRACT", "Subtract", ""}, - {SEQ_ALPHAOVER, "ALPHA_OVER", "Alpha Over", ""}, - {SEQ_ALPHAUNDER, "ALPHA_UNDER", "Alpha Under", ""}, - {SEQ_GAMCROSS, "GAMMA_CROSS", "Gamma Cross", ""}, - {SEQ_MUL, "MULTIPLY", "Multiply", ""}, - {SEQ_OVERDROP, "OVER_DROP", "Over Drop", ""}, - {0, NULL, NULL, NULL}}; + {SEQ_BLEND_REPLACE, "REPLACE", 0, "Replace", ""}, + {SEQ_CROSS, "CROSS", 0, "Cross", ""}, + {SEQ_ADD, "ADD", 0, "Add", ""}, + {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""}, + {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""}, + {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""}, + {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""}, + {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""}, + {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""}, + {0, NULL, 0, NULL, NULL}}; srna = RNA_def_struct(brna, "Sequence", NULL); RNA_def_struct_ui_text(srna, "Sequence", "Sequence strip in the sequence editor."); @@ -785,19 +787,19 @@ static void rna_def_wipe(BlenderRNA *brna) PropertyRNA *prop; static const EnumPropertyItem wipe_type_items[]= { - {0, "SINGLE", "Single", ""}, - {1, "DOUBLE", "Double", ""}, - /* not used yet {2, "BOX", "Box", ""}, */ - /* not used yet {3, "CROSS", "Cross", ""}, */ - {4, "IRIS", "Iris", ""}, - {5, "CLOCK", "Clock", ""}, - {0, NULL, NULL, NULL} + {0, "SINGLE", 0, "Single", ""}, + {1, "DOUBLE", 0, "Double", ""}, + /* not used yet {2, "BOX", 0, "Box", ""}, */ + /* not used yet {3, "CROSS", 0, "Cross", ""}, */ + {4, "IRIS", 0, "Iris", ""}, + {5, "CLOCK", 0, "Clock", ""}, + {0, NULL, 0, NULL, NULL} }; static const EnumPropertyItem wipe_direction_items[]= { - {0, "OUT", "Out", ""}, - {1, "IN", "In", ""}, - {0, NULL, NULL, NULL} + {0, "OUT", 0, "Out", ""}, + {1, "IN", 0, "In", ""}, + {0, NULL, 0, NULL, NULL} }; srna = RNA_def_struct(brna, "WipeSequence", "EffectSequence"); @@ -870,16 +872,16 @@ static void rna_def_transform(BlenderRNA *brna) PropertyRNA *prop; static const EnumPropertyItem interpolation_items[]= { - {0, "NONE", "None", "No interpolation."}, - {1, "BILINEAR", "Bilinear", "Bilinear interpolation."}, - {2, "BICUBIC", "Bicubic", "Bicubic interpolation."}, - {0, NULL, NULL, NULL} + {0, "NONE", 0, "None", "No interpolation."}, + {1, "BILINEAR", 0, "Bilinear", "Bilinear interpolation."}, + {2, "BICUBIC", 0, "Bicubic", "Bicubic interpolation."}, + {0, NULL, 0, NULL, NULL} }; static const EnumPropertyItem translation_unit_items[]= { - {0, "PIXELS", "Pixels", ""}, - {1, "PERCENT", "Percent", ""}, - {0, NULL, NULL, NULL} + {0, "PIXELS", 0, "Pixels", ""}, + {1, "PERCENT", 0, "Percent", ""}, + {0, NULL, 0, NULL, NULL} }; srna = RNA_def_struct(brna, "TransformSequence", "EffectSequence"); diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c index 118c39655e8..363a5595b43 100644 --- a/source/blender/makesrna/intern/rna_sound.c +++ b/source/blender/makesrna/intern/rna_sound.c @@ -46,17 +46,17 @@ static void rna_def_sample(BlenderRNA *brna) /* sound types */ static EnumPropertyItem prop_sample_type_items[] = { - {SAMPLE_INVALID, "INVALID", "Invalid", ""}, - {SAMPLE_UNKNOWN, "UNKNOWN", "Unknown", ""}, - {SAMPLE_RAW, "RAW", "Raw", ""}, - {SAMPLE_WAV, "WAV", "WAV", "Uncompressed"}, - {SAMPLE_MP2, "MP2", "MP2", "MPEG-1 Audio Layer 2"}, - {SAMPLE_MP3, "MP3", "MP3", "MPEG-1 Audio Layer 3"}, - {SAMPLE_OGG_VORBIS, "OGG_VORBIS", "Ogg Vorbis", ""}, - {SAMPLE_WMA, "WMA", "WMA", "Windows Media Audio"}, - {SAMPLE_ASF, "ASF", "ASF", "Windows Advanced Systems Format"}, - {SAMPLE_AIFF, "AIFF", "AIFF", "Audio Interchange File Format"}, - {0, NULL, NULL, NULL}}; + {SAMPLE_INVALID, "INVALID", 0, "Invalid", ""}, + {SAMPLE_UNKNOWN, "UNKNOWN", 0, "Unknown", ""}, + {SAMPLE_RAW, "RAW", 0, "Raw", ""}, + {SAMPLE_WAV, "WAV", 0, "WAV", "Uncompressed"}, + {SAMPLE_MP2, "MP2", 0, "MP2", "MPEG-1 Audio Layer 2"}, + {SAMPLE_MP3, "MP3", 0, "MP3", "MPEG-1 Audio Layer 3"}, + {SAMPLE_OGG_VORBIS, "OGG_VORBIS", 0, "Ogg Vorbis", ""}, + {SAMPLE_WMA, "WMA", 0, "WMA", "Windows Media Audio"}, + {SAMPLE_ASF, "ASF", 0, "ASF", "Windows Advanced Systems Format"}, + {SAMPLE_AIFF, "AIFF", 0, "AIFF", "Audio Interchange File Format"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SoundSample", "ID"); RNA_def_struct_sdna(srna, "bSample"); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index a27c7926428..debe6851451 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -37,32 +37,50 @@ #include "WM_types.h" EnumPropertyItem space_type_items[] = { - {SPACE_EMPTY, "EMPTY", "Empty", ""}, - {SPACE_VIEW3D, "VIEW_3D", "3D View", ""}, - {SPACE_IPO, "GRAPH_EDITOR", "Graph Editor", ""}, - {SPACE_OUTLINER, "OUTLINER", "Outliner", ""}, - {SPACE_BUTS, "BUTTONS_WINDOW", "Buttons Window", ""}, - {SPACE_FILE, "FILE_BROWSER", "File Browser", ""}, - {SPACE_IMAGE, "IMAGE_EDITOR", "Image Editor", ""}, - {SPACE_INFO, "USER_PREFERENCES", "User Preferences", ""}, - {SPACE_SEQ, "SEQUENCE_EDITOR", "Sequence Editor", ""}, - {SPACE_TEXT, "TEXT_EDITOR", "Text Editor", ""}, - //{SPACE_IMASEL, "IMAGE_BROWSER", "Image Browser", ""}, - {SPACE_SOUND, "AUDIO_WINDOW", "Audio Window", ""}, - {SPACE_ACTION, "DOPESHEET_EDITOR", "DopeSheet Editor", ""}, - {SPACE_NLA, "NLA_EDITOR", "NLA Editor", ""}, - {SPACE_SCRIPT, "SCRIPTS_WINDOW", "Scripts Window", ""}, - {SPACE_TIME, "TIMELINE", "Timeline", ""}, - {SPACE_NODE, "NODE_EDITOR", "Node Editor", ""}, - {0, NULL, NULL, NULL}}; + {SPACE_EMPTY, "EMPTY", 0, "Empty", ""}, + {SPACE_VIEW3D, "VIEW_3D", 0, "3D View", ""}, + {SPACE_IPO, "GRAPH_EDITOR", 0, "Graph Editor", ""}, + {SPACE_OUTLINER, "OUTLINER", 0, "Outliner", ""}, + {SPACE_BUTS, "BUTTONS_WINDOW", 0, "Buttons Window", ""}, + {SPACE_FILE, "FILE_BROWSER", 0, "File Browser", ""}, + {SPACE_IMAGE, "IMAGE_EDITOR", 0, "Image Editor", ""}, + {SPACE_INFO, "USER_PREFERENCES", 0, "User Preferences", ""}, + {SPACE_SEQ, "SEQUENCE_EDITOR", 0, "Sequence Editor", ""}, + {SPACE_TEXT, "TEXT_EDITOR", 0, "Text Editor", ""}, + //{SPACE_IMASEL, "IMAGE_BROWSER", 0, "Image Browser", ""}, + {SPACE_SOUND, "AUDIO_WINDOW", 0, "Audio Window", ""}, + {SPACE_ACTION, "DOPESHEET_EDITOR", 0, "DopeSheet Editor", ""}, + {SPACE_NLA, "NLA_EDITOR", 0, "NLA Editor", ""}, + {SPACE_SCRIPT, "SCRIPTS_WINDOW", 0, "Scripts Window", ""}, + {SPACE_TIME, "TIMELINE", 0, "Timeline", ""}, + {SPACE_NODE, "NODE_EDITOR", 0, "Node Editor", ""}, + {0, NULL, 0, NULL, NULL}}; + +#define DC_RGB {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors."} +#define DC_RGBA {SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency."} +#define DC_ALPHA {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel."} +#define DC_Z {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer", "Draw Z-buffer associated with image (mapped from camera clip start to end)."} +#ifdef WITH_LCMS +#define DC_LCMS SI_COLOR_CORRECTION, "COLOR_CORRECTED", ICON_IMAGE_ALPHA, "Color Corrected", "Display color corrected image."} +#else +#define DC_LCMS {0, NULL, 0, NULL, NULL} +#endif +#define DC_ZERO {0, NULL, 0, NULL, NULL} + +static EnumPropertyItem dc_all_items[] = {DC_RGB, DC_RGBA, DC_ALPHA, DC_Z, DC_LCMS, DC_ZERO}; #ifdef RNA_RUNTIME #include "DNA_scene_types.h" +#include "DNA_screen_types.h" #include "BKE_brush.h" #include "BKE_context.h" +#include "ED_image.h" + +#include "IMB_imbuf_types.h" + static StructRNA* rna_Space_refine(struct PointerRNA *ptr) { SpaceLink *space= (SpaceLink*)ptr->data; @@ -106,12 +124,14 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr) } } -static PointerRNA rna_SpaceImage_uvedit_get(PointerRNA *ptr) +/* Space Image Editor */ + +static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr) { return rna_pointer_inherit_refine(ptr, &RNA_SpaceUVEditor, ptr->data); } -static void rna_SpaceImage_paint_update(bContext *C, PointerRNA *ptr) +static void rna_SpaceImageEditor_paint_update(bContext *C, PointerRNA *ptr) { Scene *scene= CTX_data_scene(C); @@ -119,6 +139,58 @@ static void rna_SpaceImage_paint_update(bContext *C, PointerRNA *ptr) brush_check_exists(&scene->toolsettings->imapaint.brush); } +static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr) +{ + SpaceImage *sima= (SpaceImage*)(ptr->data); + return ED_space_image_show_render(sima); +} + +static int rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr) +{ + SpaceImage *sima= (SpaceImage*)(ptr->data); + return ED_space_image_show_paint(sima); +} + +static int rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr) +{ + SpaceImage *sima= (SpaceImage*)(ptr->data); + bScreen *sc= (bScreen*)ptr->id.data; + return ED_space_image_show_uvedit(sima, sc->scene->obedit); +} + +static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value) +{ + SpaceImage *sima= (SpaceImage*)(ptr->data); + bScreen *sc= (bScreen*)ptr->id.data; + + ED_space_image_set(NULL, sima, sc->scene, sc->scene->obedit, (Image*)value.data); +} + +static EnumPropertyItem dc_rgb_items[] = {DC_RGB, DC_LCMS, DC_ZERO}; +static EnumPropertyItem dc_alpha_items[] = {DC_RGB, DC_RGBA, DC_ALPHA, DC_LCMS, DC_ZERO}; +static EnumPropertyItem dc_z_items[] = {DC_RGB, DC_Z, DC_LCMS, DC_ZERO}; + +static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(PointerRNA *ptr) +{ + SpaceImage *sima= (SpaceImage*)ptr->data; + ImBuf *ibuf= ED_space_image_buffer(sima); + int zbuf, alpha; + + alpha= ibuf && (ibuf->channels == 4); + zbuf= ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1)); + + if(alpha && zbuf) + return dc_all_items; + else if(alpha) + return dc_alpha_items; + else if(zbuf) + return dc_z_items; + else + return dc_rgb_items; +} + +/* Space Text Editor */ + void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value) { SpaceText *st= (SpaceText*)(ptr->data); @@ -135,6 +207,8 @@ void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value) st->top= 0; } +/* Space Buttons */ + StructRNA *rna_SpaceButtonsWindow_pin_id_typef(PointerRNA *ptr) { SpaceButs *sbuts= (SpaceButs*)(ptr->data); @@ -171,30 +245,30 @@ static void rna_def_space_image_uv(BlenderRNA *brna) #if 0 static EnumPropertyItem select_mode_items[] = { - {SI_SELECT_VERTEX, "VERTEX", "Vertex", "Vertex selection mode."}, - //{SI_SELECT_EDGE, "Edge", "Edge", "Edge selection mode."}, - {SI_SELECT_FACE, "FACE", "Face", "Face selection mode."}, - {SI_SELECT_ISLAND, "ISLAND", "Island", "Island selection mode."}, - {0, NULL, NULL, NULL}}; + {SI_SELECT_VERTEX, "VERTEX", 0, "Vertex", "Vertex selection mode."}, + //{SI_SELECT_EDGE, "Edge", 0, "Edge", "Edge selection mode."}, + {SI_SELECT_FACE, "FACE", 0, "Face", "Face selection mode."}, + {SI_SELECT_ISLAND, "ISLAND", 0, "Island", "Island selection mode."}, + {0, NULL, 0, NULL, NULL}}; #endif static EnumPropertyItem sticky_mode_items[] = { - {SI_STICKY_DISABLE, "DISABLED", "Disabled", "Sticky vertex selection disabled."}, - {SI_STICKY_LOC, "SHARED_LOCATION", "SHARED_LOCATION", "Select UVs that are at the same location and share a mesh vertex."}, - {SI_STICKY_VERTEX, "SHARED_VERTEX", "SHARED_VERTEX", "Select UVs that share mesh vertex, irrespective if they are in the same location."}, - {0, NULL, NULL, NULL}}; + {SI_STICKY_DISABLE, "DISABLED", 0, "Disabled", "Sticky vertex selection disabled."}, + {SI_STICKY_LOC, "SHARED_LOCATION", 0, "SHARED_LOCATION", "Select UVs that are at the same location and share a mesh vertex."}, + {SI_STICKY_VERTEX, "SHARED_VERTEX", 0, "SHARED_VERTEX", "Select UVs that share mesh vertex, irrespective if they are in the same location."}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem dt_uv_items[] = { - {SI_UVDT_OUTLINE, "OUTLINE", "Outline", "Draw white edges with black outline."}, - {SI_UVDT_DASH, "DASH", "Dash", "Draw dashed black-white edges."}, - {SI_UVDT_BLACK, "BLACK", "Black", "Draw black edges."}, - {SI_UVDT_WHITE, "WHITE", "White", "Draw white edges."}, - {0, NULL, NULL, NULL}}; + {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Draw white edges with black outline."}, + {SI_UVDT_DASH, "DASH", 0, "Dash", "Draw dashed black-white edges."}, + {SI_UVDT_BLACK, "BLACK", 0, "Black", "Draw black edges."}, + {SI_UVDT_WHITE, "WHITE", 0, "White", "Draw white edges."}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem dt_uvstretch_items[] = { - {SI_UVDT_STRETCH_ANGLE, "ANGLE", "Angle", "Angular distortion between UV and 3D angles."}, - {SI_UVDT_STRETCH_AREA, "AREA", "Area", "Area distortion between UV and 3D faces."}, - {0, NULL, NULL, NULL}}; + {SI_UVDT_STRETCH_ANGLE, "ANGLE", 0, "Angle", "Angular distortion between UV and 3D angles."}, + {SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion between UV and 3D faces."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SpaceUVEditor", NULL); RNA_def_struct_sdna(srna, "SpaceImage"); @@ -211,45 +285,54 @@ static void rna_def_space_image_uv(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "sticky"); RNA_def_property_enum_items(prop, sticky_mode_items); RNA_def_property_ui_text(prop, "Sticky Selection Mode", "Automatically select also UVs sharing the same vertex as the ones being selected."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); /* drawing */ prop= RNA_def_property(srna, "edge_draw_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "dt_uv"); RNA_def_property_enum_items(prop, dt_uv_items); RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for drawing UV edges."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "draw_smooth_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SMOOTH_UV); RNA_def_property_ui_text(prop, "Draw Smooth Edges", "Draw UV edges anti-aliased."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "draw_stretch", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH); RNA_def_property_ui_text(prop, "Draw Stretch", "Draw faces colored according to the difference in shape between UVs and their 3D coordinates (blue for low distortion, red for high distortion)."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch"); RNA_def_property_enum_items(prop, dt_uvstretch_items); RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "draw_modified_edges", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch"); RNA_def_property_enum_items(prop, dt_uvstretch_items); RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges from the final mesh after object modifier evaluation."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); /*prop= RNA_def_property(srna, "local_view", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LOCAL_UV); - RNA_def_property_ui_text(prop, "Local View", "Draw only faces with the currently displayed image assigned.");*/ + RNA_def_property_ui_text(prop, "Local View", "Draw only faces with the currently displayed image assigned."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);*/ prop= RNA_def_property(srna, "normalized_coordinates", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS); RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); /* todo: move edge and face drawing options here from G.f */ /* editing */ /*prop= RNA_def_property(srna, "sync_selection", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SYNC_UVSEL); - RNA_def_property_ui_text(prop, "Sync Selection", "Keep UV and edit mode mesh selection in sync.");*/ + RNA_def_property_ui_text(prop, "Sync Selection", "Keep UV and edit mode mesh selection in sync."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);*/ prop= RNA_def_property(srna, "snap_to_pixels", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP); @@ -270,18 +353,18 @@ static void rna_def_space_outliner(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem display_mode_items[] = { - {0, "ALL_SCENES", "All Scenes", ""}, - {1, "CURRENT_SCENE", "Current Scene", ""}, - {2, "VISIBLE_LAYERS", "Visible Layers", ""}, - {3, "SELECTED", "Selected", ""}, - {4, "ACTIVE", "Active", ""}, - {5, "SAME_TYPES", "Same Types", ""}, - {6, "GROUPS", "Groups", ""}, - {7, "LIBRARIES", "Libraries", ""}, - {10, "SEQUENCE", "Sequence", ""}, - {11, "DATABLOCKS", "Datablocks", ""}, - {12, "USER_PREFERENCES", "User Preferences", ""}, - {0, NULL, NULL, NULL}}; + {0, "ALL_SCENES", 0, "All Scenes", ""}, + {1, "CURRENT_SCENE", 0, "Current Scene", ""}, + {2, "VISIBLE_LAYERS", 0, "Visible Layers", ""}, + {3, "SELECTED", 0, "Selected", ""}, + {4, "ACTIVE", 0, "Active", ""}, + {5, "SAME_TYPES", 0, "Same Types", ""}, + {6, "GROUPS", 0, "Groups", ""}, + {7, "LIBRARIES", 0, "Libraries", ""}, + {10, "SEQUENCE", 0, "Sequence", ""}, + {11, "DATABLOCKS", 0, "Datablocks", ""}, + {12, "USER_PREFERENCES", 0, "User Preferences", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SpaceOutliner", "Space"); RNA_def_struct_sdna(srna, "SpaceOops"); @@ -312,6 +395,7 @@ static void rna_def_background_image(BlenderRNA *brna) prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ima"); RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, NULL); prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "iuser"); @@ -343,28 +427,28 @@ static void rna_def_space_3dview(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem viewport_shading_items[] = { - {OB_BOUNDBOX, "BOUNDBOX", "Bounding Box", "Display the object's local bounding boxes only"}, - {OB_WIRE, "WIREFRAME", "Wireframe", "Display the object as wire edges"}, - {OB_SOLID, "SOLID", "Solid", "Display the object solid, lit with default OpenGL lights"}, - {OB_SHADED, "SHADED", "Shaded", "Display the object solid, with preview shading interpolated at vertices"}, - {OB_TEXTURE, "TEXTURED", "Textured", "Display the object solid, with face-assigned textures"}, - {0, NULL, NULL, NULL}}; + {OB_BOUNDBOX, "BOUNDBOX", 0, "Bounding Box", "Display the object's local bounding boxes only"}, + {OB_WIRE, "WIREFRAME", 0, "Wireframe", "Display the object as wire edges"}, + {OB_SOLID, "SOLID", 0, "Solid", "Display the object solid, lit with default OpenGL lights"}, + {OB_SHADED, "SHADED", 0, "Shaded", "Display the object solid, with preview shading interpolated at vertices"}, + {OB_TEXTURE, "TEXTURED", 0, "Textured", "Display the object solid, with face-assigned textures"}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem pivot_items[] = { - {V3D_CENTER, "BOUNDING_BOX_CENTER", "Bounding Box Center", ""}, - {V3D_CURSOR, "CURSOR", "3D Cursor", ""}, - {V3D_LOCAL, "INDIVIDUAL_CENTERS", "Individual Centers", ""}, - {V3D_CENTROID, "MEDIAN_POINT", "Median Point", ""}, - {V3D_ACTIVE, "ACTIVE_ELEMENT", "Active Element", ""}, - {0, NULL, NULL, NULL}}; + {V3D_CENTER, "BOUNDING_BOX_CENTER", 0, "Bounding Box Center", ""}, + {V3D_CURSOR, "CURSOR", 0, "3D Cursor", ""}, + {V3D_LOCAL, "INDIVIDUAL_CENTERS", 0, "Individual Centers", ""}, + {V3D_CENTROID, "MEDIAN_POINT", 0, "Median Point", ""}, + {V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem transform_orientation_items[] = { - {V3D_MANIP_GLOBAL, "ORIENT_GLOBAL", "Global", "Align the transformation axes to world space"}, - {V3D_MANIP_LOCAL, "ORIENT_LOCAL", "Local", "Align the transformation axes to the selected objects' local space"}, - {V3D_MANIP_NORMAL, "ORIENT_NORMAL", "Normal", "Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)"}, - {V3D_MANIP_VIEW, "ORIENT_VIEW", "View", "Align the transformation axes to the window"}, - {V3D_MANIP_CUSTOM, "ORIENT_CUSTOM", "Custom", "Use a custom transform orientation"}, - {0, NULL, NULL, NULL}}; + {V3D_MANIP_GLOBAL, "ORIENT_GLOBAL", 0, "Global", "Align the transformation axes to world space"}, + {V3D_MANIP_LOCAL, "ORIENT_LOCAL", 0, "Local", "Align the transformation axes to the selected objects' local space"}, + {V3D_MANIP_NORMAL, "ORIENT_NORMAL", 0, "Normal", "Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)"}, + {V3D_MANIP_VIEW, "ORIENT_VIEW", 0, "View", "Align the transformation axes to the window"}, + {V3D_MANIP_CUSTOM, "ORIENT_CUSTOM", 0, "Custom", "Use a custom transform orientation"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Space3DView", "Space"); RNA_def_struct_sdna(srna, "View3D"); @@ -488,24 +572,24 @@ static void rna_def_space_buttons(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem buttons_context_items[] = { - {BCONTEXT_SCENE, "SCENE", "Scene", ""}, - {BCONTEXT_WORLD, "WORLD", "World", ""}, - {BCONTEXT_OBJECT, "OBJECT", "Object", ""}, - {BCONTEXT_DATA, "DATA", "Data", ""}, - {BCONTEXT_MATERIAL, "MATERIAL", "Material", ""}, - {BCONTEXT_TEXTURE, "TEXTURE", "Texture", ""}, - {BCONTEXT_PARTICLE, "PARTICLE", "Particle", ""}, - {BCONTEXT_PHYSICS, "PHYSICS", "Physics", ""}, - {BCONTEXT_GAME, "GAME", "Game", ""}, - {BCONTEXT_BONE, "BONE", "Bone", ""}, - {BCONTEXT_MODIFIER, "MODIFIER", "Modifier", ""}, - {BCONTEXT_CONSTRAINT, "CONSTRAINT", "Constraint", ""}, - {0, NULL, NULL, NULL}}; + {BCONTEXT_SCENE, "SCENE", 0, "Scene", ""}, + {BCONTEXT_WORLD, "WORLD", 0, "World", ""}, + {BCONTEXT_OBJECT, "OBJECT", 0, "Object", ""}, + {BCONTEXT_DATA, "DATA", 0, "Data", ""}, + {BCONTEXT_MATERIAL, "MATERIAL", 0, "Material", ""}, + {BCONTEXT_TEXTURE, "TEXTURE", 0, "Texture", ""}, + {BCONTEXT_PARTICLE, "PARTICLE", 0, "Particle", ""}, + {BCONTEXT_PHYSICS, "PHYSICS", 0, "Physics", ""}, + {BCONTEXT_GAME, "GAME", 0, "Game", ""}, + {BCONTEXT_BONE, "BONE", 0, "Bone", ""}, + {BCONTEXT_MODIFIER, "MODIFIER", 0, "Modifier", ""}, + {BCONTEXT_CONSTRAINT, "CONSTRAINT", 0, "Constraint", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem panel_alignment_items[] = { - {1, "HORIZONTAL", "Horizontal", ""}, - {2, "VERTICAL", "Vertical", ""}, - {0, NULL, NULL, NULL}}; + {1, "HORIZONTAL", 0, "Horizontal", ""}, + {2, "VERTICAL", 0, "Vertical", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SpaceButtonsWindow", "Space"); RNA_def_struct_sdna(srna, "SpaceButs"); @@ -534,55 +618,57 @@ static void rna_def_space_image(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem draw_channels_items[] = { - {0, "COLOR", "Color", "Draw image with RGB colors."}, - {SI_USE_ALPHA, "COLOR_ALPHA", "Color and Alpha", "Draw image with RGB colors and alpha transparency."}, - {SI_SHOW_ALPHA, "ALPHA", "Alpha", "Draw alpha transparency channel."}, - {SI_SHOW_ZBUF, "Z_BUFFER", "Z-Buffer", "Draw Z-buffer associated with image (mapped from camera clip start to end)."}, - {SI_COLOR_CORRECTION, "COLOR_CORRECTED", "Color Corrected", "Display color corrected image."}, - {0, NULL, NULL, NULL}}; - srna= RNA_def_struct(brna, "SpaceImageEditor", "Space"); RNA_def_struct_sdna(srna, "SpaceImage"); RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data."); /* image */ prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL); RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space."); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "iuser"); RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "curves", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "cumap"); RNA_def_property_ui_text(prop, "Curves", "Color curve mapping to use for displaying the image."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "image_pin", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "pin", 0); RNA_def_property_ui_text(prop, "Image Pin", "Display current image regardless of object selection."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); /* image draw */ prop= RNA_def_property(srna, "draw_repeated", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_TILE); RNA_def_property_ui_text(prop, "Draw Repeated", "Draw the image repeated outside of the main view."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "draw_channels", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); - RNA_def_property_enum_items(prop, draw_channels_items); + RNA_def_property_enum_items(prop, dc_all_items); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_draw_channels_itemf"); RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); /* uv */ prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "SpaceUVEditor"); - RNA_def_property_pointer_funcs(prop, "rna_SpaceImage_uvedit_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL); RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings."); /* paint */ prop= RNA_def_property(srna, "image_painting", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWTOOL); RNA_def_property_ui_text(prop, "Image Painting", "Enable image painting mode."); - RNA_def_property_update(prop, 0, "rna_SpaceImage_paint_update"); + RNA_def_property_ui_icon(prop, ICON_TPAINT_HLT, 0); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_SpaceImageEditor_paint_update"); /* grease pencil */ prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); @@ -597,24 +683,40 @@ static void rna_def_space_image(BlenderRNA *brna) /* update */ prop= RNA_def_property(srna, "update_automatically", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "lock", 0); + RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); RNA_def_property_ui_text(prop, "Update Automatically", "Update other affected window spaces automatically to reflect changes during interactive operations such as transform."); + /* state */ + prop= RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_render_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Show Render", "Show render related properties."); + + prop= RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_paint_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Show Paint", "Show paint related properties."); + + prop= RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Show UV Editor", "Show uv editing related properties."); + rna_def_space_image_uv(brna); } - static void rna_def_space_sequencer(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem display_mode_items[] = { - {SEQ_DRAW_SEQUENCE, "SEQUENCER", "Sequencer", ""}, - {SEQ_DRAW_IMG_IMBUF, "IMAGE", "Image Preview", ""}, - {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", "Luma Waveform", ""}, - {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", "Chroma Vectorscope", ""}, - {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", "Histogram", ""}, - {0, NULL, NULL, NULL}}; + {SEQ_DRAW_SEQUENCE, "SEQUENCER", 0, "Sequencer", ""}, + {SEQ_DRAW_IMG_IMBUF, "IMAGE", 0, "Image Preview", ""}, + {SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", 0, "Luma Waveform", ""}, + {SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", 0, "Chroma Vectorscope", ""}, + {SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", 0, "Histogram", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SpaceSequenceEditor", "Space"); RNA_def_struct_sdna(srna, "SpaceSeq"); @@ -691,9 +793,9 @@ static void rna_def_space_text(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem font_size_items[] = { - {12, "SCREEN_12", "Screen 12", ""}, - {15, "SCREEN_15", "Screen 15", ""}, - {0, NULL, NULL, NULL}}; + {12, "SCREEN_12", 0, "Screen 12", ""}, + {15, "SCREEN_15", 0, "Screen 15", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SpaceTextEditor", "Space"); RNA_def_struct_sdna(srna, "SpaceText"); @@ -710,17 +812,20 @@ static void rna_def_space_text(BlenderRNA *brna) prop= RNA_def_property(srna, "syntax_highlight", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0); RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting."); + RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1); RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "word_wrap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "wordwrap", 0); RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceTextEditor_word_wrap_set"); RNA_def_property_ui_text(prop, "Word Wrap", "Wrap words if there is not enough horizontal space."); + RNA_def_property_ui_icon(prop, ICON_WORDWRAP_OFF, 1); RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "line_numbers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "showlinenrs", 0); RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text."); + RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_OFF, 1); RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "overwrite", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 86278c53eef..2a7f65e2d90 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -127,12 +127,12 @@ static void rna_def_color_ramp(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_interpolation_items[] = { - {1, "EASE", "Ease", ""}, - {3, "CARDINAL", "Cardinal", ""}, - {0, "LINEAR", "Linear", ""}, - {2, "B_SPLINE", "B-Spline", ""}, - {4, "CONSTANT", "Constant", ""}, - {0, NULL, NULL, NULL}}; + {1, "EASE", 0, "Ease", ""}, + {3, "CARDINAL", 0, "Cardinal", ""}, + {0, "LINEAR", 0, "Linear", ""}, + {2, "B_SPLINE", 0, "B-Spline", ""}, + {4, "CONSTANT", 0, "Constant", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ColorRamp", NULL); RNA_def_struct_sdna(srna, "ColorBand"); @@ -201,21 +201,21 @@ static void rna_def_mtex(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_blend_type_items[] = { - {MTEX_BLEND, "MIX", "Mix", ""}, - {MTEX_ADD, "ADD", "Add", ""}, - {MTEX_SUB, "SUBTRACT", "Subtract", ""}, - {MTEX_MUL, "MULTIPLY", "Multiply", ""}, - {MTEX_SCREEN, "SCREEN", "Screen", ""}, - {MTEX_OVERLAY, "OVERLAY", "Overlay", ""}, - {MTEX_DIFF, "DIFFERENCE", "Difference", ""}, - {MTEX_DIV, "DIVIDE", "Divide", ""}, - {MTEX_DARK, "DARKEN", "Darken", ""}, - {MTEX_LIGHT, "LIGHTEN", "Lighten", ""}, - {MTEX_BLEND_HUE, "HUE", "Hue", ""}, - {MTEX_BLEND_SAT, "SATURATION", "Saturation", ""}, - {MTEX_BLEND_VAL, "VALUE", "Value", ""}, - {MTEX_BLEND_COLOR, "COLOR", "Color", ""}, - {0, NULL, NULL, NULL}}; + {MTEX_BLEND, "MIX", 0, "Mix", ""}, + {MTEX_ADD, "ADD", 0, "Add", ""}, + {MTEX_SUB, "SUBTRACT", 0, "Subtract", ""}, + {MTEX_MUL, "MULTIPLY", 0, "Multiply", ""}, + {MTEX_SCREEN, "SCREEN", 0, "Screen", ""}, + {MTEX_OVERLAY, "OVERLAY", 0, "Overlay", ""}, + {MTEX_DIFF, "DIFFERENCE", 0, "Difference", ""}, + {MTEX_DIV, "DIVIDE", 0, "Divide", ""}, + {MTEX_DARK, "DARKEN", 0, "Darken", ""}, + {MTEX_LIGHT, "LIGHTEN", 0, "Lighten", ""}, + {MTEX_BLEND_HUE, "HUE", 0, "Hue", ""}, + {MTEX_BLEND_SAT, "SATURATION", 0, "Saturation", ""}, + {MTEX_BLEND_VAL, "VALUE", 0, "Value", ""}, + {MTEX_BLEND_COLOR, "COLOR", 0, "Color", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "TextureSlot", NULL); RNA_def_struct_sdna(srna, "MTex"); @@ -323,10 +323,10 @@ static void rna_def_environment_map_common(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem prop_source_items[] = { - {ENV_STATIC, "STATIC", "Static", "Calculates environment map only once"}, - {ENV_ANIM, "ANIMATED", "Animated", "Calculates environment map at each rendering"}, - {ENV_LOAD, "LOADED", "Loaded", "Loads saved environment map from disk"}, - {0, NULL, NULL, NULL}}; + {ENV_STATIC, "STATIC", 0, "Static", "Calculates environment map only once"}, + {ENV_ANIM, "ANIMATED", 0, "Animated", "Calculates environment map at each rendering"}, + {ENV_LOAD, "LOADED", 0, "Loaded", "Loads saved environment map from disk"}, + {0, NULL, 0, NULL, NULL}}; prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "stype"); @@ -348,9 +348,9 @@ static void rna_def_environment_map(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_type_items[] = { - {ENV_CUBE, "CUBE", "Cube", "Use environment map with six cube sides."}, - {ENV_PLANE, "PLANE", "Plane", "Only one side is rendered, with Z axis pointing in direction of image."}, - {0, NULL, NULL, NULL}}; + {ENV_CUBE, "CUBE", 0, "Cube", "Use environment map with six cube sides."}, + {ENV_PLANE, "PLANE", 0, "Plane", "Only one side is rendered, with Z axis pointing in direction of image."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "EnvironmentMap", NULL); RNA_def_struct_sdna(srna, "EnvMap"); @@ -400,22 +400,22 @@ static void rna_def_environment_map(BlenderRNA *brna) } static EnumPropertyItem prop_noise_basis_items[] = { - {TEX_BLENDER, "BLENDER_ORIGINAL", "Blender Original", ""}, - {TEX_STDPERLIN, "ORIGINAL_PERLIN", "Original Perlin", ""}, - {TEX_NEWPERLIN, "IMPROVED_PERLIN", "Improved Perlin", ""}, - {TEX_VORONOI_F1, "VORONOI_F1", "Voronoi F1", ""}, - {TEX_VORONOI_F2, "VORONOI_F2", "Voronoi F2", ""}, - {TEX_VORONOI_F3, "VORONOI_F3", "Voronoi F3", ""}, - {TEX_VORONOI_F4, "VORONOI_F4", "Voronoi F4", ""}, - {TEX_VORONOI_F2F1, "VORONOI_F2_F1", "Voronoi F2-F1", ""}, - {TEX_VORONOI_CRACKLE, "VORONOI_CRACKLE", "Voronoi Crackle", ""}, - {TEX_CELLNOISE, "CELL_NOISE", "Cell Noise", ""}, - {0, NULL, NULL, NULL}}; + {TEX_BLENDER, "BLENDER_ORIGINAL", 0, "Blender Original", ""}, + {TEX_STDPERLIN, "ORIGINAL_PERLIN", 0, "Original Perlin", ""}, + {TEX_NEWPERLIN, "IMPROVED_PERLIN", 0, "Improved Perlin", ""}, + {TEX_VORONOI_F1, "VORONOI_F1", 0, "Voronoi F1", ""}, + {TEX_VORONOI_F2, "VORONOI_F2", 0, "Voronoi F2", ""}, + {TEX_VORONOI_F3, "VORONOI_F3", 0, "Voronoi F3", ""}, + {TEX_VORONOI_F4, "VORONOI_F4", 0, "Voronoi F4", ""}, + {TEX_VORONOI_F2F1, "VORONOI_F2_F1", 0, "Voronoi F2-F1", ""}, + {TEX_VORONOI_CRACKLE, "VORONOI_CRACKLE", 0, "Voronoi Crackle", ""}, + {TEX_CELLNOISE, "CELL_NOISE", 0, "Cell Noise", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_noise_type[] = { - {TEX_NOISESOFT, "SOFT_NOISE", "Soft", ""}, - {TEX_NOISEPERL, "HARD_NOISE", "Hard", ""}, - {0, NULL, NULL, NULL}}; + {TEX_NOISESOFT, "SOFT_NOISE", 0, "Soft", ""}, + {TEX_NOISEPERL, "HARD_NOISE", 0, "Hard", ""}, + {0, NULL, 0, NULL, NULL}}; static void rna_def_texture_clouds(BlenderRNA *brna) @@ -424,9 +424,9 @@ static void rna_def_texture_clouds(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_clouds_stype[] = { - {TEX_DEFAULT, "GREYSCALE", "Greyscale", ""}, - {TEX_COLOR, "COLOR", "Color", ""}, - {0, NULL, NULL, NULL}}; + {TEX_DEFAULT, "GREYSCALE", 0, "Greyscale", ""}, + {TEX_COLOR, "COLOR", 0, "Color", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "CloudsTexture", "Texture"); RNA_def_struct_ui_text(srna, "Clouds Texture", "Procedural noise texture."); @@ -477,17 +477,17 @@ static void rna_def_texture_wood(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_wood_stype[] = { - {TEX_BAND, "BANDS", "Bands", "Uses standard wood texture in bands"}, - {TEX_RING, "RINGS", "Rings", "Uses wood texture in rings"}, - {TEX_BANDNOISE, "BANDNOISE", "Band Noise", "Adds noise to standard wood"}, - {TEX_RINGNOISE, "RINGNOISE", "Ring Noise", "Adds noise to rings"}, - {0, NULL, NULL, NULL}}; + {TEX_BAND, "BANDS", 0, "Bands", "Uses standard wood texture in bands"}, + {TEX_RING, "RINGS", 0, "Rings", "Uses wood texture in rings"}, + {TEX_BANDNOISE, "BANDNOISE", 0, "Band Noise", "Adds noise to standard wood"}, + {TEX_RINGNOISE, "RINGNOISE", 0, "Ring Noise", "Adds noise to rings"}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_wood_noisebasis2[] = { - {TEX_SIN, "SIN", "Sine", "Uses a sine wave to produce bands"}, - {TEX_SAW, "SAW", "Saw", "Uses a saw wave to produce bands"}, - {TEX_TRI, "TRI", "Tri", "Uses a triangle wave to produce bands"}, - {0, NULL, NULL, NULL}}; + {TEX_SIN, "SIN", 0, "Sine", "Uses a sine wave to produce bands"}, + {TEX_SAW, "SAW", 0, "Saw", "Uses a saw wave to produce bands"}, + {TEX_TRI, "TRI", 0, "Tri", "Uses a triangle wave to produce bands"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "WoodTexture", "Texture"); RNA_def_struct_ui_text(srna, "Wood Texture", "Procedural noise texture."); @@ -545,16 +545,16 @@ static void rna_def_texture_marble(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_marble_stype[] = { - {TEX_SOFT, "SOFT", "Soft", "Uses soft marble"}, - {TEX_SHARP, "SHARP", "Sharp", "Uses more clearly defined marble"}, - {TEX_SHARPER, "SHARPER", "Sharper", "Uses very clearly defined marble"}, - {0, NULL, NULL, NULL}}; + {TEX_SOFT, "SOFT", 0, "Soft", "Uses soft marble"}, + {TEX_SHARP, "SHARP", 0, "Sharp", "Uses more clearly defined marble"}, + {TEX_SHARPER, "SHARPER", 0, "Sharper", "Uses very clearly defined marble"}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_marble_noisebasis2[] = { - {TEX_SIN, "SIN", "Sin", "Uses a sine wave to produce bands"}, - {TEX_SAW, "SAW", "Saw", "Uses a saw wave to produce bands"}, - {TEX_TRI, "TRI", "Tri", "Uses a triangle wave to produce bands"}, - {0, NULL, NULL, NULL}}; + {TEX_SIN, "SIN", 0, "Sin", "Uses a sine wave to produce bands"}, + {TEX_SAW, "SAW", 0, "Saw", "Uses a saw wave to produce bands"}, + {TEX_TRI, "TRI", 0, "Tri", "Uses a triangle wave to produce bands"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "MarbleTexture", "Texture"); RNA_def_struct_ui_text(srna, "Marble Texture", "Procedural noise texture."); @@ -643,14 +643,14 @@ static void rna_def_texture_blend(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_blend_progression[] = { - {TEX_LIN, "LINEAR", "Linear", "Creates a linear progression"}, - {TEX_QUAD, "QUADRATIC", "Quadratic", "Creates a quadratic progression"}, - {TEX_EASE, "EASING", "Easing", "Creates a progression easing from one step to the next"}, - {TEX_DIAG, "DIAGONAL", "Diagonal", "Creates a diagonal progression"}, - {TEX_SPHERE, "SPHERICAL", "Spherical", "Creates a spherical progression"}, - {TEX_HALO, "QUADRATIC_SPHERE", "Quadratic sphere", "Creates a quadratic progression in the shape of a sphere"}, - {TEX_RAD, "RADIAL", "Radial", "Creates a radial progression"}, - {0, NULL, NULL, NULL}}; + {TEX_LIN, "LINEAR", 0, "Linear", "Creates a linear progression"}, + {TEX_QUAD, "QUADRATIC", 0, "Quadratic", "Creates a quadratic progression"}, + {TEX_EASE, "EASING", 0, "Easing", "Creates a progression easing from one step to the next"}, + {TEX_DIAG, "DIAGONAL", 0, "Diagonal", "Creates a diagonal progression"}, + {TEX_SPHERE, "SPHERICAL", 0, "Spherical", "Creates a spherical progression"}, + {TEX_HALO, "QUADRATIC_SPHERE", 0, "Quadratic sphere", "Creates a quadratic progression in the shape of a sphere"}, + {TEX_RAD, "RADIAL", 0, "Radial", "Creates a radial progression"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "BlendTexture", "Texture"); RNA_def_struct_ui_text(srna, "Blend Texture", "Procedural color blending texture."); @@ -674,10 +674,10 @@ static void rna_def_texture_stucci(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_stucci_stype[] = { - {TEX_PLASTIC, "PLASTIC", "Plastic", "Uses standard stucci"}, - {TEX_WALLIN, "WALL_IN", "Wall in", "Creates Dimples"}, - {TEX_WALLOUT, "WALL_OUT", "Wall out", "Creates Ridges"}, - {0, NULL, NULL, NULL}}; + {TEX_PLASTIC, "PLASTIC", 0, "Plastic", "Uses standard stucci"}, + {TEX_WALLIN, "WALL_IN", 0, "Wall in", "Creates Dimples"}, + {TEX_WALLOUT, "WALL_OUT", 0, "Wall out", "Creates Ridges"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "StucciTexture", "Texture"); RNA_def_struct_ui_text(srna, "Stucci Texture", "Procedural noise texture."); @@ -731,12 +731,12 @@ static void rna_def_texture_image(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_image_extension[] = { - {1, "EXTEND", "Extend", "Extends by repeating edge pixels of the image"}, - {2, "CLIP", "Clip", "Clips to image size and sets exterior pixels as transparent"}, - {4, "CLIP_CUBE", "Clip Cube", "Clips to cubic-shaped area around the image and sets exterior pixels as transparent"}, - {3, "REPEAT", "Repeat", "Causes the image to repeat horizontally and vertically"}, - {5, "CHECKER", "Checker", "Causes the image to repeat in checker board pattern"}, - {0, NULL, NULL, NULL}}; + {1, "EXTEND", 0, "Extend", "Extends by repeating edge pixels of the image"}, + {2, "CLIP", 0, "Clip", "Clips to image size and sets exterior pixels as transparent"}, + {4, "CLIP_CUBE", 0, "Clip Cube", "Clips to cubic-shaped area around the image and sets exterior pixels as transparent"}, + {3, "REPEAT", 0, "Repeat", "Causes the image to repeat horizontally and vertically"}, + {5, "CHECKER", 0, "Checker", "Causes the image to repeat in checker board pattern"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "ImageTexture", "Texture"); RNA_def_struct_ui_text(srna, "Image Texture", ""); @@ -920,12 +920,12 @@ static void rna_def_texture_musgrave(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_musgrave_type[] = { - {TEX_MFRACTAL, "MULTIFRACTAL", "Multifractal", ""}, - {TEX_RIDGEDMF, "RIDGED_MULTIFRACTAL", "Ridged Multifractal", ""}, - {TEX_HYBRIDMF, "HYBRID_MULTIFRACTAL", "Hybrid Multifractal", ""}, - {TEX_FBM, "FBM", "fBM", ""}, - {TEX_HTERRAIN, "HETERO_TERRAIN", "Hetero Terrain", ""}, - {0, NULL, NULL, NULL}}; + {TEX_MFRACTAL, "MULTIFRACTAL", 0, "Multifractal", ""}, + {TEX_RIDGEDMF, "RIDGED_MULTIFRACTAL", 0, "Ridged Multifractal", ""}, + {TEX_HYBRIDMF, "HYBRID_MULTIFRACTAL", 0, "Hybrid Multifractal", ""}, + {TEX_FBM, "FBM", 0, "fBM", ""}, + {TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "MusgraveTexture", "Texture"); RNA_def_struct_ui_text(srna, "Musgrave", "Procedural musgrave texture."); @@ -999,22 +999,22 @@ static void rna_def_texture_voronoi(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_distance_metric_items[] = { - {TEX_DISTANCE, "DISTANCE", "Actual Distance", ""}, - {TEX_DISTANCE_SQUARED, "DISTANCE_SQUARED", "Distance Squared", ""}, - {TEX_MANHATTAN, "MANHATTAN", "Manhattan", ""}, - {TEX_CHEBYCHEV, "CHEBYCHEV", "Chebychev", ""}, - {TEX_MINKOVSKY_HALF, "MINKOVSKY_HALF", "Minkovsky 1/2", ""}, - {TEX_MINKOVSKY_FOUR, "MINKOVSKY_FOUR", "Minkovsky 4", ""}, - {TEX_MINKOVSKY, "MINKOVSKY", "Minkovsky", ""}, - {0, NULL, NULL, NULL}}; + {TEX_DISTANCE, "DISTANCE", 0, "Actual Distance", ""}, + {TEX_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared", ""}, + {TEX_MANHATTAN, "MANHATTAN", 0, "Manhattan", ""}, + {TEX_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev", ""}, + {TEX_MINKOVSKY_HALF, "MINKOVSKY_HALF", 0, "Minkovsky 1/2", ""}, + {TEX_MINKOVSKY_FOUR, "MINKOVSKY_FOUR", 0, "Minkovsky 4", ""}, + {TEX_MINKOVSKY, "MINKOVSKY", 0, "Minkovsky", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_coloring_items[] = { /* XXX: OK names / descriptions? */ - {TEX_INTENSITY, "INTENSITY", "Intensity", "Only calculate intensity."}, - {TEX_COL1, "POSITION", "Position", "Color cells by position."}, - {TEX_COL2, "POSITION_OUTLINE", "Position and Outline", "Use position plus an outline based on F2-F.1"}, - {TEX_COL3, "POSITION_OUTLINE_INTENSITY", "Position, Outline, and Intensity", "Multiply position and outline by intensity."}, - {0, NULL, NULL, NULL}}; + {TEX_INTENSITY, "INTENSITY", 0, "Intensity", "Only calculate intensity."}, + {TEX_COL1, "POSITION", 0, "Position", "Color cells by position."}, + {TEX_COL2, "POSITION_OUTLINE", 0, "Position and Outline", "Use position plus an outline based on F2-F.1"}, + {TEX_COL3, "POSITION_OUTLINE_INTENSITY", 0, "Position, Outline, and Intensity", "Multiply position and outline by intensity."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "VoronoiTexture", "Texture"); RNA_def_struct_ui_text(srna, "Voronoi", "Procedural voronoi texture."); @@ -1112,21 +1112,21 @@ static void rna_def_texture(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_type_items[] = { - {0, "NONE", "None", ""}, - {TEX_CLOUDS, "CLOUDS", "Clouds", ""}, - {TEX_WOOD, "WOOD", "Wood", ""}, - {TEX_MARBLE, "MARBLE", "Marble", ""}, - {TEX_MAGIC, "MAGIC", "Magic", ""}, - {TEX_BLEND, "BLEND", "Blend", ""}, - {TEX_STUCCI, "STUCCI", "Stucci", ""}, - {TEX_NOISE, "NOISE", "Noise", ""}, - {TEX_IMAGE, "IMAGE", "Image/Movie", ""}, - {TEX_PLUGIN, "PLUGIN", "Plugin", ""}, - {TEX_ENVMAP, "ENVIRONMENT_MAP", "Environment Map", ""}, - {TEX_MUSGRAVE, "MUSGRAVE", "Musgrave", ""}, - {TEX_VORONOI, "VORONOI", "Voronoi", ""}, - {TEX_DISTNOISE, "DISTORTED_NOISE", "Distorted Noise", ""}, - {0, NULL, NULL, NULL}}; + {0, "NONE", 0, "None", ""}, + {TEX_CLOUDS, "CLOUDS", 0, "Clouds", ""}, + {TEX_WOOD, "WOOD", 0, "Wood", ""}, + {TEX_MARBLE, "MARBLE", 0, "Marble", ""}, + {TEX_MAGIC, "MAGIC", 0, "Magic", ""}, + {TEX_BLEND, "BLEND", 0, "Blend", ""}, + {TEX_STUCCI, "STUCCI", 0, "Stucci", ""}, + {TEX_NOISE, "NOISE", 0, "Noise", ""}, + {TEX_IMAGE, "IMAGE", 0, "Image/Movie", ""}, + {TEX_PLUGIN, "PLUGIN", 0, "Plugin", ""}, + {TEX_ENVMAP, "ENVIRONMENT_MAP", 0, "Environment Map", ""}, + {TEX_MUSGRAVE, "MUSGRAVE", 0, "Musgrave", ""}, + {TEX_VORONOI, "VORONOI", 0, "Voronoi", ""}, + {TEX_DISTNOISE, "DISTORTED_NOISE", 0, "Distorted Noise", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Texture", "ID"); RNA_def_struct_sdna(srna, "Tex"); diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index b6912c44fb7..c46dfe15d8b 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -24,6 +24,8 @@ #include +#include "DNA_screen_types.h" + #include "RNA_define.h" #include "RNA_types.h" @@ -40,8 +42,6 @@ #include "RNA_access.h" -#include "DNA_screen_types.h" - #include "BLI_dynstr.h" #include "BKE_context.h" @@ -497,23 +497,23 @@ static void rna_def_ui_layout(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem alignment_items[] = { - {UI_LAYOUT_ALIGN_EXPAND, "EXPAND", "Expand", ""}, - {UI_LAYOUT_ALIGN_LEFT, "LEFT", "Left", ""}, - {UI_LAYOUT_ALIGN_CENTER, "CENTER", "Center", ""}, - {UI_LAYOUT_ALIGN_RIGHT, "RIGHT", "RIght", ""}, - {0, NULL, NULL, NULL}}; + {UI_LAYOUT_ALIGN_EXPAND, "EXPAND", 0, "Expand", ""}, + {UI_LAYOUT_ALIGN_LEFT, "LEFT", 0, "Left", ""}, + {UI_LAYOUT_ALIGN_CENTER, "CENTER", 0, "Center", ""}, + {UI_LAYOUT_ALIGN_RIGHT, "RIGHT", 0, "RIght", ""}, + {0, NULL, 0, NULL, NULL}}; /* see WM_types.h */ static EnumPropertyItem operator_context_items[] = { - {WM_OP_INVOKE_DEFAULT, "INVOKE_DEFAULT", "Invoke Default", ""}, - {WM_OP_INVOKE_REGION_WIN, "INVOKE_REGION_WIN", "Invoke Region Window", ""}, - {WM_OP_INVOKE_AREA, "INVOKE_AREA", "Invoke Area", ""}, - {WM_OP_INVOKE_SCREEN, "INVOKE_SCREEN", "Invoke Screen", ""}, - {WM_OP_EXEC_DEFAULT, "EXEC_DEFAULT", "Exec Default", ""}, - {WM_OP_EXEC_REGION_WIN, "EXEC_REGION_WIN", "Exec Region Window", ""}, - {WM_OP_EXEC_AREA, "EXEC_AREA", "Exec Area", ""}, - {WM_OP_EXEC_SCREEN, "EXEC_SCREEN", "Exec Screen", ""}, - {0, NULL, NULL, NULL}}; + {WM_OP_INVOKE_DEFAULT, "INVOKE_DEFAULT", 0, "Invoke Default", ""}, + {WM_OP_INVOKE_REGION_WIN, "INVOKE_REGION_WIN", 0, "Invoke Region Window", ""}, + {WM_OP_INVOKE_AREA, "INVOKE_AREA", 0, "Invoke Area", ""}, + {WM_OP_INVOKE_SCREEN, "INVOKE_SCREEN", 0, "Invoke Screen", ""}, + {WM_OP_EXEC_DEFAULT, "EXEC_DEFAULT", 0, "Exec Default", ""}, + {WM_OP_EXEC_REGION_WIN, "EXEC_REGION_WIN", 0, "Exec Region Window", ""}, + {WM_OP_EXEC_AREA, "EXEC_AREA", 0, "Exec Area", ""}, + {WM_OP_EXEC_SCREEN, "EXEC_SCREEN", 0, "Exec Screen", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "UILayout", NULL); RNA_def_struct_sdna(srna, "uiLayout"); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 082e4896d16..64febd884f3 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -1396,15 +1396,15 @@ static void rna_def_userdef_view(BlenderRNA *brna) StructRNA *srna; static EnumPropertyItem view_zoom_styles[] = { - {USER_ZOOM_CONT, "CONTINUE", "Continue", "Old style zoom, continues while moving mouse up or down."}, - {USER_ZOOM_DOLLY, "DOLLY", "Dolly", "Zooms in and out based on vertical mouse movement."}, - {USER_ZOOM_SCALE, "SCALE", "Scale", "Zooms in and out like scaling the view, mouse movements relative to center."}, - {0, NULL, NULL, NULL}}; + {USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down."}, + {USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zooms in and out based on vertical mouse movement."}, + {USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zooms in and out like scaling the view, mouse movements relative to center."}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem view_rotation_items[] = { - {0, "TURNTABLE", "Turntable", "Use turntable style rotation in the viewport."}, - {USER_TRACKBALL, "TRACKBALL", "Trackball", "Use trackball style rotation in the viewport."}, - {0, NULL, NULL, NULL}}; + {0, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport."}, + {USER_TRACKBALL, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "UserPreferencesView", NULL); @@ -1627,15 +1627,15 @@ static void rna_def_userdef_edit(BlenderRNA *brna) StructRNA *srna; static EnumPropertyItem auto_key_modes[] = { - {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", "Add/Replace Keys", ""}, - {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", "Replace Keys", ""}, - {0, NULL, NULL, NULL}}; + {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add/Replace Keys", ""}, + {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace Keys", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem new_interpolation_types[] = { - {BEZT_IPO_CONST, "CONSTANT", "Constant", ""}, - {BEZT_IPO_LIN, "LINEAR", "Linear", ""}, - {BEZT_IPO_BEZ, "BEZIER", "Bezier", ""}, - {0, NULL, NULL, NULL}}; + {BEZT_IPO_CONST, "CONSTANT", 0, "Constant", ""}, + {BEZT_IPO_LIN, "LINEAR", 0, "Linear", ""}, + {BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "UserPreferencesEdit", NULL); RNA_def_struct_sdna(srna, "UserDef"); @@ -1780,30 +1780,30 @@ static void rna_def_userdef_language(BlenderRNA *brna) /* hardcoded here, could become dynamic somehow */ static EnumPropertyItem language_items[] = { - {0, "ENGLISH", "English", ""}, - {1, "JAPANESE", "Japanese", ""}, - {2, "DUTCH", "Dutch", ""}, - {3, "ITALIAN", "Italian", ""}, - {4, "GERMAN", "German", ""}, - {5, "FINNISH", "Finnish", ""}, - {6, "SWEDISH", "Swedish", ""}, - {7, "FRENCH", "French", ""}, - {8, "SPANISH", "Spanish", ""}, - {9, "CATALAN", "Catalan", ""}, - {10, "CZECH", "Czech", ""}, - {11, "BRAZILIAN_PORTUGUESE", "Brazilian Portuguese", ""}, - {12, "SIMPLIFIED_CHINESE", "Simplified Chinese", ""}, - {13, "RUSSIAN", "Russian", ""}, - {14, "CROATIAN", "Croatian", ""}, - {15, "SERBIAN", "Serbian", ""}, - {16, "UKRAINIAN", "Ukrainian", ""}, - {17, "POLISH", "Polish", ""}, - {18, "ROMANIAN", "Romanian", ""}, - {19, "ARABIC", "Arabic", ""}, - {20, "BULGARIAN", "Bulgarian", ""}, - {21, "GREEK", "Greek", ""}, - {22, "KOREAN", "Korean", ""}, - {0, NULL, NULL, NULL}}; + {0, "ENGLISH", 0, "English", ""}, + {1, "JAPANESE", 0, "Japanese", ""}, + {2, "DUTCH", 0, "Dutch", ""}, + {3, "ITALIAN", 0, "Italian", ""}, + {4, "GERMAN", 0, "German", ""}, + {5, "FINNISH", 0, "Finnish", ""}, + {6, "SWEDISH", 0, "Swedish", ""}, + {7, "FRENCH", 0, "French", ""}, + {8, "SPANISH", 0, "Spanish", ""}, + {9, "CATALAN", 0, "Catalan", ""}, + {10, "CZECH", 0, "Czech", ""}, + {11, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese", ""}, + {12, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese", ""}, + {13, "RUSSIAN", 0, "Russian", ""}, + {14, "CROATIAN", 0, "Croatian", ""}, + {15, "SERBIAN", 0, "Serbian", ""}, + {16, "UKRAINIAN", 0, "Ukrainian", ""}, + {17, "POLISH", 0, "Polish", ""}, + {18, "ROMANIAN", 0, "Romanian", ""}, + {19, "ARABIC", 0, "Arabic", ""}, + {20, "BULGARIAN", 0, "Bulgarian", ""}, + {21, "GREEK", 0, "Greek", ""}, + {22, "KOREAN", 0, "Korean", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "UserPreferencesLanguage", NULL); RNA_def_struct_sdna(srna, "UserDef"); @@ -1890,28 +1890,28 @@ static void rna_def_userdef_system(BlenderRNA *brna) StructRNA *srna; static EnumPropertyItem gl_texture_clamp_items[] = { - {0, "GL_CLAMP_OFF", "GL Texture Clamp Off", ""}, - {8192, "GL_CLAMP_8192", "GL Texture Clamp 8192", ""}, - {4096, "GL_CLAMP_4096", "GL Texture Clamp 4096", ""}, - {2048, "GL_CLAMP_2048", "GL Texture Clamp 2048", ""}, - {1024, "GL_CLAMP_1024", "GL Texture Clamp 1024", ""}, - {512, "GL_CLAMP_512", "GL Texture Clamp 512", ""}, - {256, "GL_CLAMP_256", "GL Texture Clamp 256", ""}, - {128, "GL_CLAMP_128", "GL Texture Clamp 128", ""}, - {0, NULL, NULL, NULL}}; + {0, "GL_CLAMP_OFF", 0, "GL Texture Clamp Off", ""}, + {8192, "GL_CLAMP_8192", 0, "GL Texture Clamp 8192", ""}, + {4096, "GL_CLAMP_4096", 0, "GL Texture Clamp 4096", ""}, + {2048, "GL_CLAMP_2048", 0, "GL Texture Clamp 2048", ""}, + {1024, "GL_CLAMP_1024", 0, "GL Texture Clamp 1024", ""}, + {512, "GL_CLAMP_512", 0, "GL Texture Clamp 512", ""}, + {256, "GL_CLAMP_256", 0, "GL Texture Clamp 256", ""}, + {128, "GL_CLAMP_128", 0, "GL Texture Clamp 128", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem audio_mixing_samples_items[] = { - {256, "AUDIO_SAMPLES_256", "256", "Set audio mixing buffer size to 256 samples"}, - {512, "AUDIO_SAMPLES_512", "512", "Set audio mixing buffer size to 512 samples"}, - {1024, "AUDIO_SAMPLES_1024", "1024", "Set audio mixing buffer size to 1024 samples"}, - {2048, "AUDIO_SAMPLES_2048", "2048", "Set audio mixing buffer size to 2048 samples"}, - {0, NULL, NULL, NULL}}; + {256, "AUDIO_SAMPLES_256", 0, "256", "Set audio mixing buffer size to 256 samples"}, + {512, "AUDIO_SAMPLES_512", 0, "512", "Set audio mixing buffer size to 512 samples"}, + {1024, "AUDIO_SAMPLES_1024", 0, "1024", "Set audio mixing buffer size to 1024 samples"}, + {2048, "AUDIO_SAMPLES_2048", 0, "2048", "Set audio mixing buffer size to 2048 samples"}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem draw_method_items[] = { - {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", "Triple Buffer", "Use a third buffer for minimal redraws at the cost of more memory."}, - {USER_DRAW_OVERLAP, "OVERLAP", "Overlap", "Redraw all overlapping regions, minimal memory usage but more redraws."}, - {USER_DRAW_FULL, "FULL", "Full", "Do a full redraw each time, slow, only use for reference or when all else fails."}, - {0, NULL, NULL, NULL}}; + {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer", "Use a third buffer for minimal redraws at the cost of more memory."}, + {USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap", "Redraw all overlapping regions, minimal memory usage but more redraws."}, + {USER_DRAW_FULL, "FULL", 0, "Full", "Do a full redraw each time, slow, only use for reference or when all else fails."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL); RNA_def_struct_sdna(srna, "UserDef"); @@ -2075,14 +2075,14 @@ void RNA_def_userdef(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem user_pref_sections[] = { - {0, "VIEW_CONTROLS", "View & Controls", ""}, - {1, "EDIT_METHODS", "Edit Methods", ""}, - {2, "LANGUAGE_COLORS", "Language & Colors", ""}, - {3, "AUTO_SAVE", "Auto Save", ""}, - {4, "SYSTEM_OPENGL", "System & OpenGL", ""}, - {5, "FILE_PATHS", "File Paths", ""}, - {6, "THEMES", "Themes", ""}, - {0, NULL, NULL, NULL}}; + {0, "VIEW_CONTROLS", 0, "View & Controls", ""}, + {1, "EDIT_METHODS", 0, "Edit Methods", ""}, + {2, "LANGUAGE_COLORS", 0, "Language & Colors", ""}, + {3, "AUTO_SAVE", 0, "Auto Save", ""}, + {4, "SYSTEM_OPENGL", 0, "System & OpenGL", ""}, + {5, "FILE_PATHS", 0, "File Paths", ""}, + {6, "THEMES", 0, "Themes", ""}, + {0, NULL, 0, NULL, NULL}}; rna_def_userdef_dothemes(brna); rna_def_userdef_solidlight(brna); diff --git a/source/blender/makesrna/intern/rna_vpaint.c b/source/blender/makesrna/intern/rna_vpaint.c index 44219f032e7..a34099dffb7 100644 --- a/source/blender/makesrna/intern/rna_vpaint.c +++ b/source/blender/makesrna/intern/rna_vpaint.c @@ -40,14 +40,14 @@ void RNA_def_vpaint(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_mode_items[] = { - {0, "MIX", "Mix", "Use mix blending mode while painting."}, - {1, "ADD", "Add", "Use add blending mode while painting."}, - {2, "SUB", "Subtract", "Use subtract blending mode while painting."}, - {3, "MUL", "Multiply", "Use multiply blending mode while painting."}, - {4, "BLUR", "Blur", "Blur the color with surrounding values"}, - {5, "LIGHTEN", "Lighten", "Use lighten blending mode while painting."}, - {6, "DARKEN", "Darken", "Use darken blending mode while painting."}, - {0, NULL, NULL, NULL}}; + {0, "MIX", 0, "Mix", "Use mix blending mode while painting."}, + {1, "ADD", 0, "Add", "Use add blending mode while painting."}, + {2, "SUB", 0, "Subtract", "Use subtract blending mode while painting."}, + {3, "MUL", 0, "Multiply", "Use multiply blending mode while painting."}, + {4, "BLUR", 0, "Blur", "Blur the color with surrounding values"}, + {5, "LIGHTEN", 0, "Lighten", "Use lighten blending mode while painting."}, + {6, "DARKEN", 0, "Darken", "Use darken blending mode while painting."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "VPaint", NULL); RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of the Vpaint tool."); diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 697efc88af1..9290e81a219 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -74,13 +74,13 @@ static void rna_def_world_mtex(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem texco_items[] = { - {TEXCO_VIEW, "VIEW", "View", "Uses view vector for the texture coordinates."}, - {TEXCO_GLOB, "GLOBAL", "Global", "Uses global coordinates for the texture coordinates (interior mist)."}, - {TEXCO_ANGMAP, "ANGMAP", "AngMap", "Uses 360 degree angular coordinates, e.g. for spherical light probes."}, - {TEXCO_H_SPHEREMAP, "SPHERE", "Sphere", "For 360 degree panorama sky, spherical mapped, only top half."}, - {TEXCO_H_TUBEMAP, "TUBE", "Tube", "For 360 degree panorama sky, cylindrical mapped, only top half."}, - {TEXCO_OBJECT, "OBJECT", "Object", "Uses linked object's coordinates for texture coordinates."}, - {0, NULL, NULL, NULL}}; + {TEXCO_VIEW, "VIEW", 0, "View", "Uses view vector for the texture coordinates."}, + {TEXCO_GLOB, "GLOBAL", 0, "Global", "Uses global coordinates for the texture coordinates (interior mist)."}, + {TEXCO_ANGMAP, "ANGMAP", 0, "AngMap", "Uses 360 degree angular coordinates, e.g. for spherical light probes."}, + {TEXCO_H_SPHEREMAP, "SPHERE", 0, "Sphere", "For 360 degree panorama sky, spherical mapped, only top half."}, + {TEXCO_H_TUBEMAP, "TUBE", 0, "Tube", "For 360 degree panorama sky, cylindrical mapped, only top half."}, + {TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "WorldTextureSlot", "TextureSlot"); RNA_def_struct_sdna(srna, "MTex"); @@ -126,27 +126,27 @@ static void rna_def_ambient_occlusion(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem blend_mode_items[] = { - {WO_AOADD, "ADD", "Add", "Add light and shadow."}, - {WO_AOSUB, "SUBTRACT", "Subtract", "Subtract light and shadow (needs a normal light to make anything visible.)"}, - {WO_AOADDSUB, "BOTH", "Both", "Both lighten and darken."}, - {0, NULL, NULL, NULL}}; + {WO_AOADD, "ADD", 0, "Add", "Add light and shadow."}, + {WO_AOSUB, "SUBTRACT", 0, "Subtract", "Subtract light and shadow (needs a normal light to make anything visible.)"}, + {WO_AOADDSUB, "BOTH", 0, "Both", "Both lighten and darken."}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_color_items[] = { - {WO_AOPLAIN, "PLAIN", "White", "Plain diffuse energy (white.)"}, - {WO_AOSKYCOL, "SKY_COLOR", "Sky Color", "Use horizon and zenith color for diffuse energy."}, - {WO_AOSKYTEX, "SKY_TEXTURE", "Sky Texture", "Does full Sky texture render for diffuse energy."}, - {0, NULL, NULL, NULL}}; + {WO_AOPLAIN, "PLAIN", 0, "White", "Plain diffuse energy (white.)"}, + {WO_AOSKYCOL, "SKY_COLOR", 0, "Sky Color", "Use horizon and zenith color for diffuse energy."}, + {WO_AOSKYTEX, "SKY_TEXTURE", 0, "Sky Texture", "Does full Sky texture render for diffuse energy."}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_sample_method_items[] = { - {WO_AOSAMP_CONSTANT, "CONSTANT_JITTERED", "Constant Jittered", ""}, - {WO_AOSAMP_HALTON, "ADAPTIVE_QMC", "Adaptive QMC", "Fast in high-contrast areas."}, - {WO_AOSAMP_HAMMERSLEY, "CONSTANT_QMC", "Constant QMC", "Best quality."}, - {0, NULL, NULL, NULL}}; + {WO_AOSAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", ""}, + {WO_AOSAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", "Fast in high-contrast areas."}, + {WO_AOSAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", "Best quality."}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_gather_method_items[] = { - {WO_AOGATHER_RAYTRACE, "RAYTRACE", "Raytrace", "Accurate, but slow when noise-free results are required."}, - {WO_AOGATHER_APPROX, "APPROXIMATE", "Approximate", "Inaccurate, but faster and without noise."}, - {0, NULL, NULL, NULL}}; + {WO_AOGATHER_RAYTRACE, "RAYTRACE", 0, "Raytrace", "Accurate, but slow when noise-free results are required."}, + {WO_AOGATHER_APPROX, "APPROXIMATE", 0, "Approximate", "Inaccurate, but faster and without noise."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "WorldAmbientOcclusion", NULL); RNA_def_struct_sdna(srna, "World"); @@ -241,10 +241,10 @@ static void rna_def_world_mist(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem falloff_items[] = { - {0, "QUADRATIC", "Quadratic", "Mist uses quadratic progression."}, - {1, "LINEAR", "Linear", "Mist uses linear progression."}, - {2, "INVERSE_QUADRATIC", "Inverse Quadratic", "Mist uses inverse quadratic progression."}, - {0, NULL, NULL, NULL}}; + {0, "QUADRATIC", 0, "Quadratic", "Mist uses quadratic progression."}, + {1, "LINEAR", 0, "Linear", "Mist uses linear progression."}, + {2, "INVERSE_QUADRATIC", 0, "Inverse Quadratic", "Mist uses inverse quadratic progression."}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "WorldMistSettings", NULL); RNA_def_struct_sdna(srna, "World"); @@ -335,13 +335,13 @@ void RNA_def_world(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem physics_engine_items[] = { - {WOPHY_NONE, "NONE", "None", ""}, - //{WOPHY_ENJI, "ENJI", "Enji", ""}, - {WOPHY_SUMO, "SUMO", "Sumo (Deprecated)", ""}, - //{WOPHY_DYNAMO, "DYNAMO", "Dynamo", ""}, - //{WOPHY_ODE, "ODE", "ODE", ""}, - {WOPHY_BULLET, "BULLET", "Bullet", ""}, - {0, NULL, NULL, NULL}}; + {WOPHY_NONE, "NONE", 0, "None", ""}, + //{WOPHY_ENJI, "ENJI", 0, "Enji", ""}, + {WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""}, + //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""}, + //{WOPHY_ODE, "ODE", 0, "ODE", ""}, + {WOPHY_BULLET, "BULLET", 0, "Bullet", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "World", "ID"); RNA_def_struct_ui_text(srna, "World", "World datablock describing the environment and ambient lighting of a scene."); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 207ca41ed46..4cdc78297d4 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -481,7 +481,9 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v BPy_StructRNA *param= (BPy_StructRNA*)value; int raise_error= 0; if(data) { - if(ptype == &RNA_AnyType) { + int flag = RNA_property_flag(prop); + + if(flag & PROP_RNAPTR) { if(value == Py_None) memset(data, 0, sizeof(PointerRNA)); else @@ -1209,8 +1211,9 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data) { PointerRNA newptr; StructRNA *type= RNA_property_pointer_type(ptr, prop); + int flag = RNA_property_flag(prop); - if(type == &RNA_AnyType) { + if(flag & PROP_RNAPTR) { /* in this case we get the full ptr */ newptr= *(PointerRNA*)data; } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 3b6d605df61..46e9df10adc 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1399,10 +1399,10 @@ void WM_radial_control_string(wmOperator *op, char str[], int maxlen) void WM_OT_radial_control_partial(wmOperatorType *ot) { static EnumPropertyItem prop_mode_items[] = { - {WM_RADIALCONTROL_SIZE, "SIZE", "Size", ""}, - {WM_RADIALCONTROL_STRENGTH, "STRENGTH", "Strength", ""}, - {WM_RADIALCONTROL_ANGLE, "ANGLE", "Angle", ""}, - {0, NULL, NULL, NULL}}; + {WM_RADIALCONTROL_SIZE, "SIZE", 0, "Size", ""}, + {WM_RADIALCONTROL_STRENGTH, "STRENGTH", 0, "Strength", ""}, + {WM_RADIALCONTROL_ANGLE, "ANGLE", 0, "Angle", ""}, + {0, NULL, 0, NULL, NULL}}; /* Should be set in custom invoke() */ RNA_def_float(ot->srna, "initial_value", 0, 0, FLT_MAX, "Initial Value", "", 0, FLT_MAX); @@ -1484,12 +1484,12 @@ static int ten_timer_exec(bContext *C, wmOperator *op) static void WM_OT_ten_timer(wmOperatorType *ot) { static EnumPropertyItem prop_type_items[] = { - {0, "DRAW", "Draw Region", ""}, - {1, "DRAWSWAP", "Draw Region + Swap", ""}, - {2, "DRAWWINSWAP", "Draw Window + Swap", ""}, - {3, "ANIMSTEP", "Anim Step", ""}, - {4, "UNDO", "Undo/Redo", ""}, - {0, NULL, NULL, NULL}}; + {0, "DRAW", 0, "Draw Region", ""}, + {1, "DRAWSWAP", 0, "Draw Region + Swap", ""}, + {2, "DRAWWINSWAP", 0, "Draw Window + Swap", ""}, + {3, "ANIMSTEP", 0, "Anim Step", ""}, + {4, "UNDO", 0, "Undo/Redo", ""}, + {0, NULL, 0, NULL, NULL}}; ot->name= "Ten Timer"; ot->idname= "WM_OT_ten_timer"; -- cgit v1.2.3 From f10541f7cfa13b3f2c92abea2c99c2901efbf91a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Jun 2009 01:08:39 +0000 Subject: UI * Added option for panel to be closed by default. * Added support for RNA property and enum icons in buttons. * Remove some deprecated RNA menu code. * Fix issue with newly created panels not being inserted in the right place. * Fix issue with 3-split layout not being divided correctly. * FIx issue with menu items not drawing correct using python UI. --- source/blender/blenkernel/BKE_screen.h | 2 + source/blender/editors/include/UI_interface.h | 4 +- source/blender/editors/interface/interface.c | 118 ++++++++------------- .../blender/editors/interface/interface_layout.c | 39 ++++--- source/blender/editors/interface/interface_panel.c | 41 +++++-- .../editors/interface/interface_templates.c | 2 - .../blender/editors/interface/interface_widgets.c | 4 +- source/blender/editors/screen/area.c | 8 +- source/blender/makesdna/DNA_screen_types.h | 3 + source/blender/makesrna/intern/rna_ui.c | 4 + 10 files changed, 121 insertions(+), 104 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h index 9b5d99f6ae6..750f4fba7e6 100644 --- a/source/blender/blenkernel/BKE_screen.h +++ b/source/blender/blenkernel/BKE_screen.h @@ -157,6 +157,8 @@ typedef struct PanelType { int space_type; int region_type; + int flag; + /* verify if the panel should draw or not */ int (*poll)(const struct bContext *, struct PanelType *); /* draw header (optional) */ diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index eb3a037d7b1..62469686e7f 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -491,7 +491,7 @@ void autocomplete_end(AutoComplete *autocpl, char *autoname); void uiBeginPanels(const struct bContext *C, struct ARegion *ar); void uiEndPanels(const struct bContext *C, struct ARegion *ar); -struct Panel *uiBeginPanel(struct ARegion *ar, uiBlock *block, struct PanelType *pt, int *open); +struct Panel *uiBeginPanel(struct ScrArea *sa, struct ARegion *ar, uiBlock *block, struct PanelType *pt, int *open); void uiEndPanel(uiBlock *block, int width, int height); /* Handlers @@ -539,8 +539,6 @@ void UI_exit(void); uiBut *uiDefMenuButO(uiBlock *block, char *opname, char *name); uiBut *uiDefMenuSep(uiBlock *block); -uiBut *uiDefMenuSub(uiBlock *block, uiBlockCreateFunc func, char *name); -uiBut *uiDefMenuTogR(uiBlock *block, struct PointerRNA *ptr, char *propname, char *propvalue, char *name); /* Layout * diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index b3f24be2f9a..99c520db7b8 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1859,18 +1859,24 @@ void ui_check_but(uiBut *but) case ICONTOG: case ICONTOGN: - if(but->flag & UI_SELECT) but->iconadd= 1; - else but->iconadd= 0; + if(!but->rnaprop || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) { + if(but->flag & UI_SELECT) but->iconadd= 1; + else but->iconadd= 0; + } break; case ICONROW: - value= ui_get_but_val(but); - but->iconadd= (int)value- (int)(but->hardmin); + if(!but->rnaprop || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) { + value= ui_get_but_val(but); + but->iconadd= (int)value- (int)(but->hardmin); + } break; case ICONTEXTROW: - value= ui_get_but_val(but); - but->iconadd= (int)value- (int)(but->hardmin); + if(!but->rnaprop || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) { + value= ui_get_but_val(but); + but->iconadd= (int)value- (int)(but->hardmin); + } break; } @@ -2267,7 +2273,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, uiBut *but; PropertyRNA *prop; PropertyType proptype; - int freestr= 0; + int freestr= 0, icon= 0; prop= RNA_struct_find_property(ptr, propname); @@ -2279,14 +2285,22 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, if(type == MENU && proptype == PROP_ENUM) { const EnumPropertyItem *item; DynStr *dynstr; - int i, totitem; + int i, totitem, value; RNA_property_enum_items(ptr, prop, &item, &totitem); + value= RNA_property_enum_get(ptr, prop); dynstr= BLI_dynstr_new(); BLI_dynstr_appendf(dynstr, "%s%%t", RNA_property_ui_name(prop)); - for(i=0; iicon= (BIFIconID)icon; + but->flag |= UI_HAS_ICON; + but->flag|= UI_ICON_LEFT; } if (!prop || !RNA_property_editable(&but->rnapoin, prop)) { @@ -2653,8 +2679,10 @@ uiBut *uiDefIconButR(uiBlock *block, int type, int retval, int icon, short x1, s but= ui_def_but_rna(block, type, retval, "", x1, y1, x2, y2, ptr, propname, index, min, max, a1, a2, tip); if(but) { - but->icon= (BIFIconID) icon; - but->flag|= UI_HAS_ICON; + if(icon) { + but->icon= (BIFIconID) icon; + but->flag|= UI_HAS_ICON; + } ui_check_but(but); } @@ -2736,8 +2764,10 @@ uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, char *s but= ui_def_but_rna(block, type, retval, str, x1, y1, x2, y2, ptr, propname, index, min, max, a1, a2, tip); if(but) { - but->icon= (BIFIconID) icon; - but->flag|= UI_HAS_ICON; + if(icon) { + but->icon= (BIFIconID) icon; + but->flag|= UI_HAS_ICON; + } but->flag|= UI_ICON_LEFT; ui_check_but(but); } @@ -2779,60 +2809,6 @@ uiBut *uiDefMenuSep(uiBlock *block) return uiDefBut(block, SEPR, 0, "", 0, y, MENU_WIDTH, MENU_SEP_HEIGHT, NULL, 0.0, 0.0, 0, 0, ""); } -uiBut *uiDefMenuSub(uiBlock *block, uiBlockCreateFunc func, char *name) -{ - int y= ui_menu_y(block) - MENU_ITEM_HEIGHT; - return uiDefIconTextBlockBut(block, func, NULL, ICON_BLANK1, name, 0, y, MENU_WIDTH, MENU_ITEM_HEIGHT-1, ""); -} - -uiBut *uiDefMenuTogR(uiBlock *block, PointerRNA *ptr, char *propname, char *propvalue, char *name) -{ - uiBut *but; - PropertyRNA *prop; - PropertyType type; - const EnumPropertyItem *item; - int a, value, totitem, icon= ICON_CHECKBOX_DEHLT; - int y= ui_menu_y(block) - MENU_ITEM_HEIGHT; - - prop= RNA_struct_find_property(ptr, propname); - if(prop) { - type= RNA_property_type(prop); - - if(type == PROP_BOOLEAN) { - if(RNA_property_boolean_get(ptr, prop)) - icon= ICON_CHECKBOX_HLT; - - return uiDefIconTextButR(block, TOG, 0, icon, name, 0, y, MENU_WIDTH, MENU_ITEM_HEIGHT-1, ptr, propname, 0, 0, 0, 0, 0, NULL); - } - else if(type == PROP_ENUM) { - RNA_property_enum_items(ptr, prop, &item, &totitem); - - value= 0; - for(a=0; acurlayout, (char*)item[a].name, 0); - uiDefButR(block, ROW, 0, NULL, 0, 0, itemw, h, ptr, propname, -1, 0, item[a].value, -1, -1, NULL); + name= (!uiname || uiname[0])? (char*)item[a].name: ""; + icon= item[a].icon; + value= item[a].value; + itemw= ui_text_icon_width(block->curlayout, name, icon); + + if(icon && strcmp(name, "") != 0) + uiDefIconTextButR(block, ROW, 0, icon, name, 0, 0, itemw, h, ptr, identifier, -1, 0, value, -1, -1, NULL); + else if(icon) + uiDefIconButR(block, ROW, 0, icon, 0, 0, itemw, h, ptr, identifier, -1, 0, value, -1, -1, NULL); + else + uiDefButR(block, ROW, 0, name, 0, 0, itemw, h, ptr, identifier, -1, 0, value, -1, -1, NULL); } uiBlockSetCurLayout(block, layout); } @@ -732,6 +742,8 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper /* set name and icon */ if(!name) name= (char*)RNA_property_ui_name(prop); + if(!icon) + icon= RNA_property_ui_icon(prop); if(ELEM5(type, PROP_INT, PROP_FLOAT, PROP_STRING, PROP_ENUM, PROP_POINTER)) name= ui_item_name_add_colon(name, namestr); @@ -764,7 +776,7 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper } /* expanded enum */ else if(type == PROP_ENUM && expand) - ui_item_enum_row(layout, block, ptr, prop, 0, 0, w, h); + ui_item_enum_row(layout, block, ptr, prop, name, 0, 0, w, h); /* property with separate label */ else if(type == PROP_ENUM || type == PROP_STRING || type == PROP_POINTER) ui_item_with_label(layout, block, name, icon, ptr, prop, index, 0, 0, w, h); @@ -858,7 +870,7 @@ static void ui_item_menu(uiLayout *layout, char *name, int icon, uiMenuCreateFun uiBlockSetCurLayout(block, layout); if(layout->root->type == UI_LAYOUT_HEADER) - uiBlockSetEmboss(block, UI_EMBOSSP); + uiBlockSetEmboss(block, UI_EMBOSS); if(!name) name= ""; @@ -869,7 +881,7 @@ static void ui_item_menu(uiLayout *layout, char *name, int icon, uiMenuCreateFun h= UI_UNIT_Y; if(layout->root->type == UI_LAYOUT_HEADER) /* ugly .. */ - w -= 3; + w -= 10; if(icon) but= uiDefIconTextMenuBut(block, func, arg, icon, (char*)name, 0, 0, w, h, ""); @@ -1484,6 +1496,7 @@ static void ui_litem_layout_split(uiLayout *litem) { uiLayoutItemSplt *split= (uiLayoutItemSplt*)litem; uiItem *item; + float percentage; int itemh, x, y, w, tot=0, colw=0; x= litem->x; @@ -1495,8 +1508,10 @@ static void ui_litem_layout_split(uiLayout *litem) if(tot == 0) return; + percentage= (split->percentage == 0.0f)? 1.0f/(float)tot: split->percentage; + w= (litem->w - (tot-1)*litem->space); - colw= w*split->percentage; + colw= w*percentage; colw= MAX2(colw, 0); for(item=litem->items.first; item; item=item->next) { @@ -1506,7 +1521,7 @@ static void ui_litem_layout_split(uiLayout *litem) x += colw; if(item->next) { - colw= (w - (w*split->percentage))/(tot-1); + colw= (w - (int)(w*percentage))/(tot-1); colw= MAX2(colw, 0); x += litem->space; @@ -1637,7 +1652,7 @@ uiLayout *uiLayoutSplit(uiLayout *layout, float percentage) split->litem.enabled= 1; split->litem.context= layout->context; split->litem.space= layout->root->style->columnspace; - split->percentage= (percentage == 0.0f)? 0.5f: percentage; + split->percentage= percentage; BLI_addtail(&layout->items, split); uiBlockSetCurLayout(layout->root->block, &split->litem); diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 278f7c026b1..06582762fdb 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -69,6 +69,7 @@ #define PNL_ACTIVE 2 #define PNL_WAS_ACTIVE 4 #define PNL_ANIM_ALIGN 8 +#define PNL_NEW_ADDED 16 typedef enum uiHandlePanelState { PANEL_STATE_DRAG, @@ -157,18 +158,20 @@ static void ui_panel_copy_offset(Panel *pa, Panel *papar) pa->ofsy= papar->ofsy + papar->sizey-pa->sizey; } -Panel *uiBeginPanel(ARegion *ar, uiBlock *block, PanelType *pt, int *open) +Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, int *open) { uiStyle *style= U.uistyles.first; Panel *pa, *patab, *palast, *panext; - char *panelname= pt->label; - char *tabname= pt->label; + char *drawname= pt->label; + char *idname= pt->idname; + char *tabname= pt->idname; char *hookname= NULL; int newpanel; + int align= panel_aligned(sa, ar); /* check if Panel exists, then use that one */ for(pa=ar->panels.first; pa; pa=pa->next) - if(strncmp(pa->panelname, panelname, UI_MAX_NAME_STR)==0) + if(strncmp(pa->panelname, idname, UI_MAX_NAME_STR)==0) if(strncmp(pa->tabname, tabname, UI_MAX_NAME_STR)==0) break; @@ -181,13 +184,21 @@ Panel *uiBeginPanel(ARegion *ar, uiBlock *block, PanelType *pt, int *open) /* new panel */ pa= MEM_callocN(sizeof(Panel), "new panel"); pa->type= pt; - BLI_strncpy(pa->panelname, panelname, UI_MAX_NAME_STR); + BLI_strncpy(pa->panelname, idname, UI_MAX_NAME_STR); BLI_strncpy(pa->tabname, tabname, UI_MAX_NAME_STR); + + if(pt->flag & PNL_DEFAULT_CLOSED) { + if(align == BUT_VERTICAL) + pa->flag |= PNL_CLOSEDY; + else + pa->flag |= PNL_CLOSEDX; + } pa->ofsx= 0; pa->ofsy= style->panelouter; pa->sizex= 0; pa->sizey= 0; + pa->runtime_flag |= PNL_NEW_ADDED; BLI_addtail(&ar->panels, pa); @@ -207,6 +218,8 @@ Panel *uiBeginPanel(ARegion *ar, uiBlock *block, PanelType *pt, int *open) } } + BLI_strncpy(pa->drawname, drawname, UI_MAX_NAME_STR); + /* if a new panel is added, we insert it right after the panel * that was last added. this way new panels are inserted in the * right place between versions */ @@ -235,7 +248,6 @@ Panel *uiBeginPanel(ARegion *ar, uiBlock *block, PanelType *pt, int *open) if(pa->flag & PNL_CLOSED) return pa; *open= 1; - pa->drawname[0]= 0; /* otherwise closes panels show wrong title */ return pa; } @@ -244,13 +256,20 @@ void uiEndPanel(uiBlock *block, int width, int height) { Panel *pa= block->panel; - if(pa->sizex != width || pa->sizey != height) { - pa->runtime_flag |= PNL_ANIM_ALIGN; - pa->ofsy += pa->sizey-height; + if(pa->runtime_flag & PNL_NEW_ADDED) { + pa->runtime_flag &= ~PNL_NEW_ADDED; + pa->sizex= width; + pa->sizey= height; } + else if(!(width == 0 || height == 0)) { + if(pa->sizex != width || pa->sizey != height) { + pa->runtime_flag |= PNL_ANIM_ALIGN; + pa->ofsy += pa->sizey-height; + } - pa->sizex= width; - pa->sizey= height; + pa->sizex= width; + pa->sizey= height; + } } #if 0 diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 63de328af0f..a0ee264cf01 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1448,10 +1448,8 @@ void uiTemplateCurveMapping(uiLayout *layout, CurveMapping *cumap, int type) void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, char *propname) { - uiBlock *block; uiLayout *uRow, *uSplit, *uCol; PropertyRNA *prop; - StructRNA *type; int groups, cols, layers; int group, col, layer, row; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index ce416d2a3c5..52a77be0b01 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -874,9 +874,9 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB and offset the text label to accomodate it */ if (but->flag & UI_HAS_ICON) { - widget_draw_icon(but, but->icon, 0, rect); + widget_draw_icon(but, but->icon+but->iconadd, 0, rect); - rect->xmin += UI_icon_get_width(but->icon); + rect->xmin += UI_icon_get_width(but->icon+but->iconadd); if(but->editstr || (but->flag & UI_TEXT_LEFT)) rect->xmin += 5; diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 81b63b694ba..c2521bd5b2c 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1106,6 +1106,7 @@ int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco) void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *context) { + ScrArea *sa= CTX_wm_area(C); uiStyle *style= U.uistyles.first; uiBlock *block; PanelType *pt; @@ -1143,7 +1144,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex /* draw panel */ if(pt->draw && (!pt->poll || pt->poll(C, pt))) { block= uiBeginBlock(C, ar, pt->idname, UI_EMBOSS); - panel= uiBeginPanel(ar, block, pt, &open); + panel= uiBeginPanel(sa, ar, block, pt, &open); if(vertical) y -= header; @@ -1161,7 +1162,6 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex } if(open) { - panel->type= pt; panel->layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, style->panelspace, 0, w-2*style->panelspace, em, style); @@ -1173,8 +1173,10 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex yco -= 2*style->panelspace; uiEndPanel(block, w, -yco); } - else + else { yco= 0; + uiEndPanel(block, w, 0); + } uiEndBlock(C, block); diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index 418cc84205a..4891f44e1cd 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -205,6 +205,9 @@ typedef struct ARegion { #define PNL_SNAP_DIST 9.0 +/* paneltype flag */ +#define PNL_DEFAULT_CLOSED 1 + /* screen handlers */ #define SCREEN_MAXHANDLER 8 diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index c46dfe15d8b..825b3711b97 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -603,6 +603,10 @@ static void rna_def_panel(BlenderRNA *brna) prop= RNA_def_property(srna, "context", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->context"); RNA_def_property_flag(prop, PROP_REGISTER); + + prop= RNA_def_property(srna, "default_closed", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "type->flag", PNL_DEFAULT_CLOSED); + RNA_def_property_flag(prop, PROP_REGISTER); } static void rna_def_header(BlenderRNA *brna) -- cgit v1.2.3 From 18d8454f2e5dbf217e5a40ff96296c6d3cffa5c4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Jun 2009 01:10:47 +0000 Subject: 2.5: Text editor, port menu code to python. --- source/blender/editors/space_text/space_text.c | 2 - source/blender/editors/space_text/text_header.c | 95 ------------------------- source/blender/editors/space_text/text_intern.h | 3 - 3 files changed, 100 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 384ad3e919c..d3c3b78cc50 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -415,8 +415,6 @@ void ED_spacetype_text(void) art->init= text_header_area_init; art->draw= text_header_area_draw; - - text_header_register(art); BLI_addhead(&st->regiontypes, art); diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c index fe00b86e19f..1b8149cb5a2 100644 --- a/source/blender/editors/space_text/text_header.c +++ b/source/blender/editors/space_text/text_header.c @@ -155,101 +155,6 @@ static uiBlock *text_plugin_scriptsmenu(bContext *C, void *args_unused) } #endif -static void text_editmenu_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemEnumO(layout, "Top of File", 0, "TEXT_OT_move", "type", FILE_TOP); - uiItemEnumO(layout, "Bottom of File", 0, "TEXT_OT_move", "type", FILE_BOTTOM); -} - -static void text_editmenu_selectmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "TEXT_OT_select_all"); - uiItemO(layout, NULL, 0, "TEXT_OT_select_line"); -} - -static void text_editmenu_markermenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "TEXT_OT_markers_clear"); - uiItemO(layout, NULL, 0, "TEXT_OT_next_marker"); - uiItemO(layout, NULL, 0, "TEXT_OT_previous_marker"); -} - -static void text_formatmenu(const bContext *C, Menu *menu) -{ - uiLayout *layout= menu->layout; - - uiItemO(layout, NULL, 0, "TEXT_OT_indent"); - uiItemO(layout, NULL, 0, "TEXT_OT_unindent"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "TEXT_OT_comment"); - uiItemO(layout, NULL, 0, "TEXT_OT_uncomment"); - - uiItemS(layout); - - uiItemMenuEnumO(layout, NULL, 0, "TEXT_OT_convert_whitespace", "type"); -} - -static void text_editmenu_to3dmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemBooleanO(layout, "One Object", 0, "TEXT_OT_to_3d_object", "split_lines", 0); - uiItemBooleanO(layout, "One Object Per Line", 0, "TEXT_OT_to_3d_object", "split_lines", 1); -} - -static int text_menu_edit_poll(bContext *C) -{ - return (CTX_data_edit_text(C) != NULL); -} - -static void text_editmenu(const bContext *C, Menu *menu) -{ - uiLayout *layout= menu->layout; - - uiItemO(layout, NULL, 0, "ED_OT_undo"); - uiItemO(layout, NULL, 0, "ED_OT_redo"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "TEXT_OT_cut"); - uiItemO(layout, NULL, 0, "TEXT_OT_copy"); - uiItemO(layout, NULL, 0, "TEXT_OT_paste"); - - uiItemS(layout); - - uiItemMenuF(layout, "View", 0, text_editmenu_viewmenu); - uiItemMenuF(layout, "Select", 0, text_editmenu_selectmenu); - uiItemMenuF(layout, "Markers", 0, text_editmenu_markermenu); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "TEXT_OT_jump"); - uiItemO(layout, NULL, 0, "TEXT_OT_properties"); - - uiItemS(layout); - - uiItemMenuF(layout, "Text to 3D Object", 0, text_editmenu_to3dmenu); -} - -/********************** header buttons ***********************/ - -void text_header_register(ARegionType *art) -{ - MenuType *mt; - - mt= MEM_callocN(sizeof(MenuType), "spacetype text menu edit"); - strcpy(mt->idname, "TEXT_MT_edit"); - strcpy(mt->label, "Edit"); - mt->draw= text_editmenu; - BLI_addhead(&art->menutypes, mt); - - mt= MEM_callocN(sizeof(MenuType), "spacetype text menu format"); - strcpy(mt->idname, "TEXT_MT_format"); - strcpy(mt->label, "Format"); - mt->draw= text_formatmenu; - BLI_addhead(&art->menutypes, mt); -} - /************************** properties ******************************/ ARegion *text_has_properties_region(ScrArea *sa) diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index 259811aee0f..31d29ac7f17 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -41,9 +41,6 @@ struct TextLine; struct wmOperatorType; struct wmWindowManager; -/* text_header.c */ -void text_header_register(struct ARegionType *art); - /* text_draw.c */ void draw_text_main(struct SpaceText *st, struct ARegion *ar); -- cgit v1.2.3 From 401b58cb45dd23d4b92143f29b77060c105ba127 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Jun 2009 01:22:56 +0000 Subject: 2.5: Image Editor * Started porting over to python, menus nearly done, header WIP. * Game Properties panel is in python too * Deprecated "Tiles" as a per face flag here, now it's always on the image, used to be both, working in a very confusing way. Unlikely someone actually had a purpose for this being per face. * Remove GPC_PolygonMaterial.cpp/h, it's not actually used anymore, so I don't want to bother updating it. * Fix crash in image painting (own mistake in porting over bugfix from 2.4x). --- source/blender/editors/mesh/editmesh_tools.c | 4 +- source/blender/editors/sculpt_paint/paint_image.c | 11 +- source/blender/editors/space_image/image_buttons.c | 41 -- source/blender/editors/space_image/image_ops.c | 4 +- source/blender/editors/space_image/space_image.c | 27 +- source/blender/editors/uvedit/uvedit_ops.c | 20 +- source/blender/gpu/intern/gpu_draw.c | 4 +- source/blender/makesdna/DNA_meshdata_types.h | 2 +- source/blender/makesrna/intern/rna_image.c | 1 - .../GamePlayer/common/GPC_PolygonMaterial.cpp | 412 --------------------- .../GamePlayer/common/GPC_PolygonMaterial.h | 89 ----- 11 files changed, 30 insertions(+), 585 deletions(-) delete mode 100644 source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp delete mode 100644 source/gameengine/GamePlayer/common/GPC_PolygonMaterial.h (limited to 'source') diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 45cf67de17e..83ef88a48a3 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -4656,7 +4656,7 @@ void mesh_set_face_flags(EditMesh *em, short mode) { EditFace *efa; MTFace *tface; - short m_tex=0, m_tiles=0, m_shared=0, + short m_tex=0, m_shared=0, m_light=0, m_invis=0, m_collision=0, m_twoside=0, m_obcolor=0, m_halo=0, m_billboard=0, m_shadow=0, m_text=0, @@ -4669,7 +4669,6 @@ void mesh_set_face_flags(EditMesh *em, short mode) // } add_numbut(0, TOG|SHO, "Texture", 0, 0, &m_tex, NULL); - add_numbut(1, TOG|SHO, "Tiles", 0, 0, &m_tiles, NULL); add_numbut(2, TOG|SHO, "Light", 0, 0, &m_light, NULL); add_numbut(3, TOG|SHO, "Invisible", 0, 0, &m_invis, NULL); add_numbut(4, TOG|SHO, "Collision", 0, 0, &m_collision, NULL); @@ -4691,7 +4690,6 @@ void mesh_set_face_flags(EditMesh *em, short mode) m_billboard = 0; if (m_tex) flag |= TF_TEX; - if (m_tiles) flag |= TF_TILES; if (m_shared) flag |= TF_SHAREDCOL; if (m_light) flag |= TF_LIGHT; if (m_invis) flag |= TF_INVISIBLE; diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 1effd8fd377..a163ef5f8e2 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -4517,6 +4517,9 @@ static int paint_init(bContext *C, wmOperator *op) pop->ps.ar= CTX_wm_region(C); /* intialize brush */ + if(!settings->imapaint.brush) + return 0; + pop->s.brush = settings->imapaint.brush; pop->s.tool = settings->imapaint.tool; if(pop->mode == PAINT_MODE_3D && (pop->s.tool == PAINT_TOOL_CLONE)) @@ -4536,6 +4539,10 @@ static int paint_init(bContext *C, wmOperator *op) if (!pop->s.ob || !(pop->s.ob->lay & pop->ps.v3d->lay)) return 0; pop->s.me = get_mesh(pop->s.ob); if (!pop->s.me) return 0; + + /* Dont allow brush size below 2 */ + if (pop->ps.brush && pop->ps.brush->size<=1) + pop->ps.brush->size = 2; } else { pop->s.image = pop->s.sima->image; @@ -4548,10 +4555,6 @@ static int paint_init(bContext *C, wmOperator *op) return 0; } - - /* Dont allow brush size below 2 */ - if (pop->ps.brush->size<=1) - pop->ps.brush->size = 2; } /* note, if we have no UVs on the derived mesh, then we must return here */ diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 35004a4bdef..b5df0257e71 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -383,41 +383,6 @@ static void image_editcursor_buts(const bContext *C, View2D *v2d, uiBlock *block } } -static void image_panel_game_properties(const bContext *C, Panel *pa) -{ - SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); - ImBuf *ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser); - uiBlock *block; - - block= uiLayoutFreeBlock(pa->layout); - uiBlockSetHandleFunc(block, do_image_panel_events, NULL); - - if (ibuf) { - char str[128]; - - image_info(sima->image, ibuf, str); - uiDefBut(block, LABEL, B_NOP, str, 10,180,300,19, 0, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, IMA_TWINANIM, B_TWINANIM, "Anim", 10,150,140,19, &sima->image->tpageflag, 0, 0, 0, 0, "Toggles use of animated texture"); - uiDefButS(block, NUM, B_TWINANIM, "Start:", 10,130,140,19, &sima->image->twsta, 0.0, 128.0, 0, 0, "Displays the start frame of an animated texture"); - uiDefButS(block, NUM, B_TWINANIM, "End:", 10,110,140,19, &sima->image->twend, 0.0, 128.0, 0, 0, "Displays the end frame of an animated texture"); - uiDefButS(block, NUM, B_NOP, "Speed", 10,90,140,19, &sima->image->animspeed, 1.0, 100.0, 0, 0, "Displays Speed of the animation in frames per second"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, IMA_TILES, B_SIMAGETILE, "Tiles", 160,150,140,19, &sima->image->tpageflag, 0, 0, 0, 0, "Toggles use of tilemode for faces (Shift LMB to pick the tile for selected faces)"); - uiDefButS(block, NUM, B_REDR, "X:", 160,130,70,19, &sima->image->xrep, 1.0, 16.0, 0, 0, "Sets the degree of repetition in the X direction"); - uiDefButS(block, NUM, B_REDR, "Y:", 230,130,70,19, &sima->image->yrep, 1.0, 16.0, 0, 0, "Sets the degree of repetition in the Y direction"); - uiBlockBeginAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, IMA_CLAMP_U, B_REDR, "ClampX", 160,100,70,19, &sima->image->tpageflag, 0, 0, 0, 0, "Disable texture repeating horizontaly"); - uiDefButBitS(block, TOG, IMA_CLAMP_V, B_REDR, "ClampY", 230,100,70,19, &sima->image->tpageflag, 0, 0, 0, 0, "Disable texture repeating vertically"); - uiBlockEndAlign(block); - } -} - static void image_panel_view_properties(const bContext *C, Panel *pa) { SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); @@ -1412,12 +1377,6 @@ void image_buttons_register(ARegionType *art) pt->draw= image_panel_properties; BLI_addtail(&art->paneltypes, pt); - pt= MEM_callocN(sizeof(PanelType), "spacetype image panel game properties"); - strcpy(pt->idname, "IMAGE_PT_game_properties"); - strcpy(pt->label, "Game Properties"); - pt->draw= image_panel_game_properties; - BLI_addtail(&art->paneltypes, pt); - pt= MEM_callocN(sizeof(PanelType), "spacetype image view properties"); strcpy(pt->idname, "IMAGE_PT_view_properties"); strcpy(pt->label, "View Properties"); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 73a7f570c44..537996601b8 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -132,10 +132,10 @@ static int space_image_file_exists_poll(bContext *C) int space_image_main_area_poll(bContext *C) { SpaceLink *slink= CTX_wm_space_data(C); - ARegion *ar= CTX_wm_region(C); + // XXX ARegion *ar= CTX_wm_region(C); if(slink && (slink->spacetype == SPACE_IMAGE)) - return (ar && ar->type->regionid == RGN_TYPE_WINDOW); + return 1; // XXX (ar && ar->type->regionid == RGN_TYPE_WINDOW); return 0; } diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index c82018a3aac..e12f3bfe357 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -270,13 +270,6 @@ static void image_refresh(const bContext *C, ScrArea *sa) if(sima->flag & SI_EDITTILE); else sima->curtile= tf->tile; - - if(ima) { - if(tf->mode & TF_TILES) - ima->tpageflag |= IMA_TILES; - else - ima->tpageflag &= ~IMA_TILES; - } } } @@ -286,8 +279,6 @@ static void image_refresh(const bContext *C, ScrArea *sa) static void image_listener(ScrArea *sa, wmNotifier *wmn) { - SpaceImage *sima= sa->spacedata.first; - /* context changes */ switch(wmn->category) { case NC_SCENE: @@ -301,8 +292,7 @@ static void image_listener(ScrArea *sa, wmNotifier *wmn) } break; case NC_IMAGE: - if(!wmn->reference || wmn->reference == sima->image) - ED_area_tag_redraw(sa); + ED_area_tag_redraw(sa); break; } } @@ -508,11 +498,17 @@ static void image_buttons_area_listener(ARegion *ar, wmNotifier *wmn) /* add handlers, stuff you only do once or on area/region changes */ static void image_header_area_init(wmWindowManager *wm, ARegion *ar) { +#if 0 UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); +#else + ED_region_header_init(ar); +#endif } static void image_header_area_draw(const bContext *C, ARegion *ar) { + ED_region_header(C, ar); +#if 0 float col[3]; /* clear */ @@ -531,6 +527,7 @@ static void image_header_area_draw(const bContext *C, ARegion *ar) /* restore view matrix? */ UI_view2d_view_restore(C); +#endif } /**************************** spacetype *****************************/ @@ -616,10 +613,12 @@ void ED_space_image_set(bContext *C, SpaceImage *sima, Scene *scene, Object *obe if(sima->image && sima->image->id.us==0) sima->image->id.us= 1; - if(obedit) - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + if(C) { + if(obedit) + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - ED_area_tag_redraw(CTX_wm_area(C)); + ED_area_tag_redraw(CTX_wm_area(C)); + } } ImBuf *ED_space_image_buffer(SpaceImage *sima) diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index a42008bef0c..7dca4d34c48 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -126,9 +126,6 @@ void ED_uvedit_assign_image(Scene *scene, Object *obedit, Image *ima, Image *pre tf->tpage= ima; tf->mode |= TF_TEX; - if(ima->tpageflag & IMA_TILES) tf->mode |= TF_TILES; - else tf->mode &= ~TF_TILES; - if(ima->id.us==0) id_us_plus(&ima->id); else id_lib_extern(&ima->id); } @@ -150,7 +147,7 @@ void ED_uvedit_assign_image(Scene *scene, Object *obedit, Image *ima, Image *pre /* dotile - 1, set the tile flag (from the space image) * 2, set the tile index for the faces. */ -void ED_uvedit_set_tile(bContext *C, Scene *scene, Object *obedit, Image *ima, int curtile, int dotile) +void ED_uvedit_set_tile(bContext *C, Scene *scene, Object *obedit, Image *ima, int curtile) { EditMesh *em; EditFace *efa; @@ -169,17 +166,8 @@ void ED_uvedit_set_tile(bContext *C, Scene *scene, Object *obedit, Image *ima, i for(efa= em->faces.first; efa; efa= efa->next) { tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if(efa->h==0 && efa->f & SELECT) { - if(dotile==1) { - /* set tile flag */ - if(ima->tpageflag & IMA_TILES) - tf->mode |= TF_TILES; - else - tf->mode &= ~TF_TILES; - } - else if(dotile==2) - tf->tile= curtile; /* set tile index */ - } + if(efa->h==0 && efa->f & SELECT) + tf->tile= curtile; /* set tile index */ } DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); @@ -3005,7 +2993,7 @@ static int set_tile_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; RNA_int_get_array(op->ptr, "tile", tile); - ED_uvedit_set_tile(C, CTX_data_scene(C), CTX_data_edit_object(C), ima, tile[0] + ima->xrep*tile[1], 1); + ED_uvedit_set_tile(C, CTX_data_scene(C), CTX_data_edit_object(C), ima, tile[0] + ima->xrep*tile[1]); ED_area_tag_redraw(CTX_wm_area(C)); diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index f8d0957f70d..5edb619f7e5 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -393,7 +393,7 @@ int GPU_verify_image(Image *ima, int tftile, int tfmode, int compare) /* initialize tile mode and number of repeats */ GTS.ima = ima; - GTS.tilemode= (tfmode & TF_TILES) || (ima && (ima->tpageflag & IMA_TWINANIM)); + GTS.tilemode= (ima && (ima->tpageflag & (IMA_TILES|IMA_TWINANIM))); GTS.tileXRep = 0; GTS.tileYRep = 0; @@ -423,7 +423,7 @@ int GPU_verify_image(Image *ima, int tftile, int tfmode, int compare) glMatrixMode(GL_TEXTURE); glLoadIdentity(); - if((tfmode & TF_TILES) && ima!=NULL) + if(ima && (ima->tpageflag & IMA_TILES)) glScalef(ima->xrep, ima->yrep, 1.0); glMatrixMode(GL_MODELVIEW); diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index c07989b2ce6..cec27b85b23 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -239,7 +239,7 @@ typedef struct PartialVisibility { #define TF_LIGHT 16 #define TF_SHAREDCOL 64 -#define TF_TILES 128 +#define TF_TILES 128 /* deprecated */ #define TF_BILLBOARD 256 #define TF_TWOSIDE 512 #define TF_INVISIBLE 1024 diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index e045c76057b..252cd633b69 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -217,7 +217,6 @@ static void rna_def_image(BlenderRNA *brna) prop= RNA_def_property(srna, "tiles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TILES); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_tile_set */ RNA_def_property_ui_text(prop, "Tiles", "Use of tilemode for faces (default shift-LMB to pick the tile for selected faces)."); prop= RNA_def_property(srna, "tiles_x", PROP_INT, PROP_NONE); diff --git a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp deleted file mode 100644 index b1e2b5af0e6..00000000000 --- a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp +++ /dev/null @@ -1,412 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "GL/glew.h" - -#include "GPC_PolygonMaterial.h" -#include "MT_Vector3.h" -#include "RAS_IRasterizer.h" -#include "RAS_GLExtensionManager.h" - -/* This list includes only data type definitions */ -#include "DNA_object_types.h" -#include "DNA_material_types.h" -#include "DNA_image_types.h" -#include "DNA_lamp_types.h" -#include "DNA_group_types.h" -#include "DNA_scene_types.h" -#include "DNA_camera_types.h" -#include "DNA_property_types.h" -#include "DNA_text_types.h" -#include "DNA_sensor_types.h" -#include "DNA_controller_types.h" -#include "DNA_actuator_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_view3d_types.h" -#include "DNA_world_types.h" - -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_mesh.h" - -#include "MEM_guardedalloc.h" - -#include "IMB_imbuf_types.h" -/* end of blender include block */ - -static Image *fCurpage=0; -static int fCurtile=0, fCurmode=0, fCurTileXRep=0, fCurTileYRep=0; -static short fTexWindx, fTexWindy, fTexWinsx, fTexWinsy; -static int fDoMipMap = 1; -static int fLinearMipMap=1; -static int fAlphamode= -1; - - /* (n&(n-1)) zeros the least significant bit of n */ -static int is_pow2(int num) { - return ((num)&(num-1))==0; -} -static int smaller_pow2(int num) { - while (!is_pow2(num)) - num= num&(num-1); - return num; -} - -static void my_make_repbind(Image *ima) -{ - if(ima==0 || ima->ibufs.first==0) return; - - if(ima->repbind) { - glDeleteTextures(ima->totbind, (GLuint*)ima->repbind); - delete (ima->repbind); - ima->repbind= 0; - } - ima->totbind= ima->xrep*ima->yrep; - if(ima->totbind>1) { - ima->repbind= (unsigned int *) malloc(sizeof(int)*ima->totbind); - for (int i=0;itotbind;i++) - ((int*)ima->repbind)[i] = 0; - } -} - -extern "C" int set_tpage(MTFace *tface); - -int set_tpage(MTFace *tface) -{ - static MTFace *lasttface= 0; - Image *ima; - unsigned int *rect, *bind; - int tpx, tpy, tilemode, tileXRep,tileYRep; - - /* disable */ - if(tface==0) { - if(lasttface==0) return 0; - - lasttface= 0; - fCurtile= 0; - fCurpage= 0; - if(fCurmode!=0) { - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); - } - fCurmode= 0; - fCurTileXRep=0; - fCurTileYRep=0; - fAlphamode= -1; - - glDisable(GL_BLEND); - glDisable(GL_TEXTURE_2D); - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - return 0; - } - lasttface= tface; - - if( fAlphamode != tface->transp) { - fAlphamode= tface->transp; - - if(fAlphamode) { - if(fAlphamode==TF_ADD) { - glEnable(GL_BLEND); - glBlendFunc(GL_ONE, GL_ONE); - glDisable ( GL_ALPHA_TEST ); - /* glBlendEquationEXT(GL_FUNC_ADD_EXT); */ - } - else if(fAlphamode==TF_ALPHA) { - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glDisable ( GL_ALPHA_TEST ); - /* glBlendEquationEXT(GL_FUNC_ADD_EXT); */ - } - else if (fAlphamode==TF_CLIP){ - glDisable(GL_BLEND); - glEnable ( GL_ALPHA_TEST ); - glAlphaFunc(GL_GREATER, 0.5f); - } - /* else { */ - /* glBlendFunc(GL_ONE, GL_ONE); */ - /* glBlendEquationEXT(GL_FUNC_REVERSE_SUBTRACT_EXT); */ - /* } */ - } - else glDisable(GL_BLEND); - } - - ima= (struct Image *) tface->tpage; - - /* Enable or disable environment mapping */ - if (ima && (ima->flag & IMA_REFLECT)){ - - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); - - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - } - else{ - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - } - - tilemode= tface->mode & TF_TILES; - tileXRep = 0; - tileYRep = 0; - if (ima) - { - tileXRep = ima->xrep; - tileYRep = ima->yrep; - } - - - if(ima==fCurpage && fCurtile==tface->tile && tilemode==fCurmode && fCurTileXRep==tileXRep && fCurTileYRep == tileYRep) return ima!=0; - - if(tilemode!=fCurmode || fCurTileXRep!=tileXRep || fCurTileYRep != tileYRep) - { - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - - if(tilemode && ima!=0) - glScalef(ima->xrep, ima->yrep, 1.0); - - glMatrixMode(GL_MODELVIEW); - } - - if(ima==0 || ima->ok==0) { - glDisable(GL_TEXTURE_2D); - - fCurtile= tface->tile; - fCurpage= 0; - fCurmode= tilemode; - fCurTileXRep = tileXRep; - fCurTileYRep = tileYRep; - - return 0; - } - - ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL); - - if(ibuf==0) { - ima->ok= 0; - - fCurtile= tface->tile; - fCurpage= 0; - fCurmode= tilemode; - fCurTileXRep = tileXRep; - fCurTileYRep = tileYRep; - - glDisable(GL_TEXTURE_2D); - return 0; - } - - if(ima->tpageflag & IMA_TWINANIM) fCurtile= ima->lastframe; - else fCurtile= tface->tile; - - if(tilemode) { - - if(ima->repbind==0) my_make_repbind(ima); - - if(fCurtile>=ima->totbind) fCurtile= 0; - - /* this happens when you change repeat buttons */ - if(ima->repbind) bind= ima->repbind+fCurtile; - else bind= &ima->bindcode; - - if(*bind==0) { - - fTexWindx= ibuf->x/ima->xrep; - fTexWindy= ibuf->y/ima->yrep; - - if(fCurtile>=ima->xrep*ima->yrep) fCurtile= ima->xrep*ima->yrep-1; - - fTexWinsy= fCurtile / ima->xrep; - fTexWinsx= fCurtile - fTexWinsy*ima->xrep; - - fTexWinsx*= fTexWindx; - fTexWinsy*= fTexWindy; - - tpx= fTexWindx; - tpy= fTexWindy; - - rect= ibuf->rect + fTexWinsy*ibuf->x + fTexWinsx; - } - } - else { - bind= &ima->bindcode; - - if(*bind==0) { - tpx= ibuf->x; - tpy= ibuf->y; - rect= ibuf->rect; - } - } - - if(*bind==0) { - int rectw= tpx, recth= tpy; - unsigned int *tilerect= NULL, *scalerect= NULL; - - /* - * Maarten: - * According to Ton this code is not needed anymore. It was used only - * in really old Blenders. - * Reevan: - * Actually it is needed for backwards compatibility. Simpledemo 6 does not display correctly without it. - */ -#if 1 - if (tilemode) { - int y; - - tilerect= (unsigned int*)MEM_mallocN(rectw*recth*sizeof(*tilerect), "tilerect"); - for (y=0; yx]; - unsigned int *tilerectrow= &tilerect[y*rectw]; - - memcpy(tilerectrow, rectrow, tpx*sizeof(*rectrow)); - } - - rect= tilerect; - } -#endif - if (!is_pow2(rectw) || !is_pow2(recth)) { - rectw= smaller_pow2(rectw); - recth= smaller_pow2(recth); - - scalerect= (unsigned int *)MEM_mallocN(rectw*recth*sizeof(*scalerect), "scalerect"); - gluScaleImage(GL_RGBA, tpx, tpy, GL_UNSIGNED_BYTE, rect, rectw, recth, GL_UNSIGNED_BYTE, scalerect); - rect= scalerect; - } - - glGenTextures(1, (GLuint*)bind); - - /* - if(G.f & G_DEBUG) { - printf("var1: %s\n", ima->id.name+2); - printf("var1: %d, var2: %d\n", *bind, tpx); - printf("var1: %d, var2: %d\n", fCurtile, tilemode); - } - */ - glBindTexture( GL_TEXTURE_2D, *bind); - - if (!fDoMipMap) - { - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, rectw, recth, 0, GL_RGBA, GL_UNSIGNED_BYTE, rect); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } else - { - int minfilter= fLinearMipMap?GL_LINEAR_MIPMAP_LINEAR:GL_LINEAR_MIPMAP_NEAREST; - - gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, rectw, recth, GL_RGBA, GL_UNSIGNED_BYTE, rect); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minfilter); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } - - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - - if (tilerect) - MEM_freeN(tilerect); - if (scalerect) - MEM_freeN(scalerect); - } - else glBindTexture( GL_TEXTURE_2D, *bind); - - - - glEnable(GL_TEXTURE_2D); - - fCurpage= ima; - fCurmode= tilemode; - fCurTileXRep = tileXRep; - fCurTileYRep = tileYRep; - - return 1; -} - -#if 0 -GPC_PolygonMaterial::GPC_PolygonMaterial(const STR_String& texname, bool ba, const STR_String& matname, - int tile, int tileXrep, int tileYrep, int mode, bool transparant, bool zsort, - int lightlayer, bool bIsTriangle, void* clientobject, void* tpage) : - RAS_IPolyMaterial(texname, ba, matname, tile, tileXrep, tileYrep, mode, - transparant, zsort, lightlayer, bIsTriangle, clientobject), m_tface((struct MTFace*)tpage) -{ - // clear local caching info - my_set_tpage(0); -} - - -GPC_PolygonMaterial::~GPC_PolygonMaterial(void) -{ -} - - -void GPC_PolygonMaterial::Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingInfo) const -{ - if (GetCachingInfo() != cachingInfo) - { - if (!cachingInfo) - { - my_set_tpage(0); - } - cachingInfo = GetCachingInfo(); - - if ((m_drawingmode & 4)&& (rasty->GetDrawingMode() == RAS_IRasterizer::KX_TEXTURED) ) - { - update_realtime_texture((struct MTFace*) m_tface, rasty->GetTime()); - my_set_tpage(m_tface); - rasty->EnableTextures(true); - } else - { - my_set_tpage(0); - rasty->EnableTextures(false); - } - - //TF_TWOSIDE == 512, todo, make this a ketsji enum - if(m_drawingmode & 512) { - rasty->SetCullFace(false); - } - - else - { - rasty->SetCullFace(true);//glEnable(GL_CULL_FACE); - //else glDisable(GL_CULL_FACE); - } - } - rasty->SetSpecularity(m_specular[0],m_specular[1],m_specular[2],m_specularity); - rasty->SetShinyness(m_shininess); - rasty->SetDiffuse(m_diffuse[0], m_diffuse[1],m_diffuse[2], 1.0); -} - -#endif -void GPC_PolygonMaterial::SetMipMappingEnabled(bool enabled) -{ - fDoMipMap = enabled ? 1 : 0; -} diff --git a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.h b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.h deleted file mode 100644 index 212decd078c..00000000000 --- a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.h +++ /dev/null @@ -1,89 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifndef __GPC_POLYGONMATERIAL -#define __GPC_POLYGONMATERIAL - -#include "RAS_IPolygonMaterial.h" - -namespace GPC_PolygonMaterial -{ - void SetMipMappingEnabled(bool enabled = false); -}; - -#if 0 -class GPC_PolygonMaterial : public RAS_IPolyMaterial -{ - struct MTFace* m_tface; - -public: - GPC_PolygonMaterial(const STR_String& texname, bool ba, const STR_String& matname, - int tile, int tileXrep, int tileYrep, int mode, bool transparant, bool zsort, - int lightlayer, bool bIsTriangle, void* clientobject, void* tpage); - - virtual ~GPC_PolygonMaterial(void); - - /** - * Returns the caching information for this material, - * This can be used to speed up the rasterizing process. - * @return The caching information. - */ - virtual TCachingInfo GetCachingInfo(void) const; - - /** - * Activates the material in the (OpenGL) rasterizer. - * On entry, the cachingInfo contains info about the last activated material. - * On exit, the cachingInfo should contain updated info about this material. - * @param rasty The rasterizer in which the material should be active. - * @param cachingInfo The information about the material used to speed up rasterizing. - */ - virtual void Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingInfo) const; - - /** - * Returns the Blender texture face structure that is used for this material. - * @return The material's texture face. - */ - MTFace* GetMTFace(void) const; - - static void SetMipMappingEnabled(bool enabled = false); -}; - - -inline MTFace* GPC_PolygonMaterial::GetMTFace(void) const -{ - return m_tface; -} - -inline GPC_PolygonMaterial::TCachingInfo GPC_PolygonMaterial::GetCachingInfo(void) const -{ - return GetMTFace(); -} -#endif -#endif // __GPC_POLYGONMATERIAL_H - -- cgit v1.2.3 From 1d0bc55e6ccfb43d439eeab788598d955dae9887 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Jun 2009 01:32:33 +0000 Subject: UI: Revert revision #20879: Enable non reordering menus option, it was disabled without explanation (?). This changed the order of all header menus with the header at the bottom, this doesn't seem acceptable to me. Additionaly, it doesn't make sense to me that this would be the same option as the toolbox shape, they should be separate options. Here's the rationale from 2005 by Ton: I didn't add the commenting out of correcting pulldown menu order, which is based on location of the originating button in the UI. This uncommenting didn't solve anything, since button definitions itself can be flipped too. (Example: the data brose menus in top bar need to be corrected). I can imagine the order flipping is sometimes annoying, but it still has reasons to be there; - the most important / most used items are always closest to the mouse. (like opening properties panel, or "Add new" for material. - it follows muscle memory and 'locus of attention' (mouse position). - menus are configured to open to the top for bottom headers, and to the bottom for top headers. We can expect the UI is configured consistantly for headers, so in general the menus will appear consistant as well. Where menu flipping fails is especially for alphabetic listings, like in the menu button of fileselect. However, that one should be configured to open by default to the bottom, so ordering is consistant as well. --- source/blender/editors/interface/interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 99c520db7b8..83c9fc2ac2d 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2850,8 +2850,8 @@ void uiBlockFlipOrder(uiBlock *block) uiBut *but, *next; float centy, miny=10000, maxy= -10000; - if(U.uiflag & USER_PLAINMENUS) - return; + /*if(U.uiflag & USER_PLAINMENUS) + return;*/ for(but= block->buttons.first; but; but= but->next) { if(but->flag & UI_BUT_ALIGN) return; -- cgit v1.2.3 From 172a3e9d0e6459122bb8e501eadaa3ef9b9f1e34 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 16 Jun 2009 01:51:51 +0000 Subject: small fix: ao energy is not a percentage --- source/blender/makesrna/intern/rna_world.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 9290e81a219..4dba61411f0 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -165,7 +165,7 @@ static void rna_def_ambient_occlusion(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "aodistfac"); RNA_def_property_ui_text(prop, "Strength", "Distance attenuation factor, the higher, the 'shorter' the shadows."); - prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_PERCENTAGE); + prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aoenergy"); RNA_def_property_ui_range(prop, 0, 10, 0.1, 3); RNA_def_property_ui_text(prop, "Energy", "Amount of enerygy generated by ambient occlusion."); -- cgit v1.2.3 From 573f2f34fa8115a6193902b3995168d45ce8257a Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Tue, 16 Jun 2009 02:40:39 +0000 Subject: Separate "content reordering" from "plain menus". --- source/blender/editors/interface/interface.c | 4 ++-- source/blender/makesdna/DNA_userdef_types.h | 1 + source/blender/makesrna/intern/rna_userdef.c | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 83c9fc2ac2d..9a06bd21ea2 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2850,8 +2850,8 @@ void uiBlockFlipOrder(uiBlock *block) uiBut *but, *next; float centy, miny=10000, maxy= -10000; - /*if(U.uiflag & USER_PLAINMENUS) - return;*/ + if(!(U.uiflag & USER_DIRECTIONALORDER)) + return; for(but= block->buttons.first; but; but= but->next) { if(but->flag & UI_BUT_ALIGN) return; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 87931f8e93d..2b9592fca56 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -378,6 +378,7 @@ extern UserDef U; /* from blenkernel blender.c */ #define USER_ZOOM_TO_MOUSEPOS (1 << 20) #define USER_SHOW_FPS (1 << 21) #define USER_MMB_PASTE (1 << 22) +#define USER_DIRECTIONALORDER (1 << 23) /* Auto-Keying mode */ /* AUTOKEY_ON is a bitflag */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 64febd884f3..04006f51c7c 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -1476,7 +1476,11 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "use_column_layout", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_PLAINMENUS); - RNA_def_property_ui_text(prop, "Toolbox Column Layout", "Use a column layout for toolbox and do not flip the contents of any menu."); + RNA_def_property_ui_text(prop, "Toolbox Column Layout", "Use a column layout for toolbox."); + + prop= RNA_def_property(srna, "directional_menus", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DIRECTIONALORDER); + RNA_def_property_ui_text(prop, "Contents Follow Opening Direction", "Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction."); /* snap to grid */ prop= RNA_def_property(srna, "snap_translate", PROP_BOOLEAN, PROP_NONE); -- cgit v1.2.3 From 2ecbe1c81cec6f537aa10829e94fbc451f9bc823 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 16 Jun 2009 07:16:51 +0000 Subject: BGE Py API * Removed modules Expression and CValue, neither were ever available. * Added GameLogic.EvalExpression(exp) from the Expression module, evaluates an expression like the expression controller (not sure if this is really that useful since python is far more advanced). * resetting the original blend file path didint work (own fault == -> =) * Py3.x PyModule_Create didnt allow importing since it didn't add to sys.modules, Looks like they want us to use init-tab array, but this doesn't suit us since it needs to be setup before python is initialized. * Documented GameLogic.globalDict --- source/blender/python/api2_2x/BGL.c | 1 + source/blender/python/api2_2x/Geometry.c | 1 + source/blender/python/api2_2x/Mathutils.c | 1 + source/gameengine/Expressions/InputParser.cpp | 60 ---------------------- source/gameengine/Expressions/Value.cpp | 48 ----------------- .../gameengine/Ketsji/KX_PyConstraintBinding.cpp | 1 + source/gameengine/Ketsji/KX_PythonInit.cpp | 33 +++++++++++- source/gameengine/PyDoc/GameLogic.py | 21 ++++++-- source/gameengine/VideoTexture/blendVideoTex.cpp | 1 + 9 files changed, 55 insertions(+), 112 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/BGL.c b/source/blender/python/api2_2x/BGL.c index 7735f2b444f..93e110dfbde 100644 --- a/source/blender/python/api2_2x/BGL.c +++ b/source/blender/python/api2_2x/BGL.c @@ -1104,6 +1104,7 @@ PyObject *BGL_Init(const char *from) PyObject *mod, *dict, *item; #if (PY_VERSION_HEX >= 0x03000000) mod = PyModule_Create(&BGL_module_def); + PyDict_SetItemString(PySys_GetObject("modules"), BGL_module_def.m_name, mod); #else mod= Py_InitModule(from, BGL_methods); #endif diff --git a/source/blender/python/api2_2x/Geometry.c b/source/blender/python/api2_2x/Geometry.c index f875cbc52fb..e5679ea6ed7 100644 --- a/source/blender/python/api2_2x/Geometry.c +++ b/source/blender/python/api2_2x/Geometry.c @@ -99,6 +99,7 @@ PyObject *Geometry_Init(const char *from) #if (PY_VERSION_HEX >= 0x03000000) submodule = PyModule_Create(&M_Geometry_module_def); + PyDict_SetItemString(PySys_GetObject("modules"), M_Geometry_module_def.m_name, submodule); #else submodule = Py_InitModule3(from, M_Geometry_methods, M_Geometry_doc); #endif diff --git a/source/blender/python/api2_2x/Mathutils.c b/source/blender/python/api2_2x/Mathutils.c index 8f99723e12d..3ffc8662cc9 100644 --- a/source/blender/python/api2_2x/Mathutils.c +++ b/source/blender/python/api2_2x/Mathutils.c @@ -139,6 +139,7 @@ PyObject *Mathutils_Init(const char *from) #if (PY_VERSION_HEX >= 0x03000000) submodule = PyModule_Create(&M_Mathutils_module_def); + PyDict_SetItemString(PySys_GetObject("modules"), M_Mathutils_module_def.m_name, submodule); #else submodule = Py_InitModule3(from, M_Mathutils_methods, M_Mathutils_doc); #endif diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp index b15b206a38a..96a52aec028 100644 --- a/source/gameengine/Expressions/InputParser.cpp +++ b/source/gameengine/Expressions/InputParser.cpp @@ -636,63 +636,3 @@ void CParser::SetContext(CValue* context) } m_identifierContext = context; } - - - - -PyObject* CParserPyMake(PyObject* ignored,PyObject* args) -{ - char* txt; - if (!PyArg_ParseTuple(args,"s",&txt)) - return NULL; - CParser parser; - CExpression* expr = parser.ProcessText(txt); - CValue* val = expr->Calculate(); - expr->Release(); - return val->GetProxy(); -} - -static PyMethodDef CParserMethods[] = -{ - { "calc", CParserPyMake , METH_VARARGS}, - { NULL,NULL} // Sentinel -}; - - -#if (PY_VERSION_HEX >= 0x03000000) -static struct PyModuleDef Expression_module_def = { - {}, /* m_base */ - "Expression", /* m_name */ - 0, /* m_doc */ - 0, /* m_size */ - CParserMethods, /* m_methods */ - 0, /* m_reload */ - 0, /* m_traverse */ - 0, /* m_clear */ - 0, /* m_free */ -}; -#endif - -extern "C" { - void initExpressionModule(void) - { - PyObject *m; - /* Use existing module where possible - * be careful not to init any runtime vars after this */ - m = PyImport_ImportModule( "Expression" ); - if(m) { - Py_DECREF(m); - //return m; - } - else { - PyErr_Clear(); - -#if (PY_VERSION_HEX >= 0x03000000) - PyModule_Create(&Expression_module_def); -#else - Py_InitModule("Expression",CParserMethods); -#endif - } - } -} - diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index e6ef9733da8..61dabff510b 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -725,54 +725,6 @@ PyObject* CValue::ConvertKeysToPython( void ) return pylist; } -/* -PyObject* CValue::PyMake(PyObject* ignored,PyObject* args) -{ - - //if (!PyArg_ParseTuple(args,"s:make",&name)) return NULL; - Py_RETURN_NONE;//new CValue(); -} -*/ - -#if (PY_VERSION_HEX >= 0x03000000) -static struct PyModuleDef CValue_module_def = { - {}, /* m_base */ - "CValue", /* m_name */ - 0, /* m_doc */ - 0, /* m_size */ - CValueMethods, /* m_methods */ - 0, /* m_reload */ - 0, /* m_traverse */ - 0, /* m_clear */ - 0, /* m_free */ -}; -#endif - -extern "C" { - void initCValue(void) - { - PyObject *m; - /* Use existing module where possible - * be careful not to init any runtime vars after this */ - m = PyImport_ImportModule( "CValue" ); - if(m) { - Py_DECREF(m); - //return m; - } - else { - PyErr_Clear(); - -#if (PY_VERSION_HEX >= 0x03000000) - PyModule_Create(&CValue_module_def); -#else - Py_InitModule("CValue",CValueMethods); -#endif - } - } -} - - - #endif //NO_EXP_PYTHON_EMBEDDING /////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index a098d99864f..4ec901a2f5e 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -630,6 +630,7 @@ PyObject* initPythonConstraintBinding() #if (PY_VERSION_HEX >= 0x03000000) m = PyModule_Create(&PhysicsConstraints_module_def); + PyDict_SetItemString(PySys_GetObject("modules"), PhysicsConstraints_module_def.m_name, m); #else m = Py_InitModule4("PhysicsConstraints", physicsconstraints_methods, PhysicsConstraints_module_documentation, diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index b10ea7e1ab5..75b29481e54 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -70,6 +70,7 @@ #include "MT_Vector3.h" #include "MT_Point3.h" #include "ListValue.h" +#include "InputParser.h" #include "KX_Scene.h" #include "SND_DeviceManager.h" @@ -498,6 +499,32 @@ static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *) } +static PyObject *gEvalExpression(PyObject*, PyObject* value) +{ + char* txt= PyString_AsString(value); + + if (txt==NULL) { + PyErr_SetString(PyExc_TypeError, "Expression.calc(text): expects a single string argument"); + return NULL; + } + + CParser parser; + CExpression* expr = parser.ProcessText(txt); + CValue* val = expr->Calculate(); + expr->Release(); + + if (val) { + PyObject* pyobj = val->ConvertValueToPython(); + if (pyobj) + return pyobj; + else + return val->GetProxy(); + } + + Py_RETURN_NONE; +} + + static struct PyMethodDef game_methods[] = { {"expandPath", (PyCFunction)gPyExpandPath, METH_VARARGS, (PY_METHODCHAR)gPyExpandPath_doc}, {"sendMessage", (PyCFunction)gPySendMessage, METH_VARARGS, (PY_METHODCHAR)gPySendMessage_doc}, @@ -526,6 +553,7 @@ static struct PyMethodDef game_methods[] = { {"getAverageFrameRate", (PyCFunction) gPyGetAverageFrameRate, METH_NOARGS, (PY_METHODCHAR)"Gets the estimated average frame rate"}, {"getBlendFileList", (PyCFunction)gPyGetBlendFileList, METH_VARARGS, (PY_METHODCHAR)"Gets a list of blend files in the same directory as the current blend file"}, {"PrintGLInfo", (PyCFunction)pyPrintExt, METH_NOARGS, (PY_METHODCHAR)"Prints GL Extension Info"}, + {"EvalExpression", (PyCFunction)gEvalExpression, METH_O, (PY_METHODCHAR)"Evaluate a string as a game logic expression"}, {NULL, (PyCFunction) NULL, 0, NULL } }; @@ -1032,6 +1060,7 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack // Create the module and add the functions #if (PY_VERSION_HEX >= 0x03000000) m = PyModule_Create(&GameLogic_module_def); + PyDict_SetItemString(PySys_GetObject("modules"), GameLogic_module_def.m_name, m); #else m = Py_InitModule4("GameLogic", game_methods, GameLogic_module_documentation, @@ -1697,6 +1726,7 @@ PyObject* initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas) // Create the module and add the functions #if (PY_VERSION_HEX >= 0x03000000) m = PyModule_Create(&Rasterizer_module_def); + PyDict_SetItemString(PySys_GetObject("modules"), Rasterizer_module_def.m_name, m); #else m = Py_InitModule4("Rasterizer", rasterizer_methods, Rasterizer_module_documentation, @@ -1831,6 +1861,7 @@ PyObject* initGameKeys() // Create the module and add the functions #if (PY_VERSION_HEX >= 0x03000000) m = PyModule_Create(&GameKeys_module_def); + PyDict_SetItemString(PySys_GetObject("modules"), GameKeys_module_def.m_name, m); #else m = Py_InitModule4("GameKeys", gamekeys_methods, GameKeys_module_documentation, @@ -2106,5 +2137,5 @@ void setGamePythonPath(char *path) // engine but loading blend files within the BGE wont overwrite gp_GamePythonPathOrig void resetGamePythonPath() { - gp_GamePythonPathOrig[0] == '\0'; + gp_GamePythonPathOrig[0] = '\0'; } diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 3ec30a63c58..46f00fa7ea6 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -271,7 +271,7 @@ Documentation for the GameLogic Module. @var KX_PARENT_REMOVE: @var KX_PARENT_SET: -@group Shader: MODELMATRIX*, MODELVIEWMATRIX*, VIEWMATRIX*, CAM_POS, CONSTANT_TIMER +@group Shader: MODELMATRIX*, MODELVIEWMATRIX*, VIEWMATRIX*, CAM_POS, CONSTANT_TIMER, SHD_TANGENT @var VIEWMATRIX: @var VIEWMATRIX_INVERSE: @var VIEWMATRIX_INVERSETRANSPOSE: @@ -285,8 +285,8 @@ Documentation for the GameLogic Module. @var MODELVIEWMATRIX_INVERSETRANSPOSE: @var MODELVIEWMATRIX_TRANSPOSE: @var CAM_POS: Current camera position -@var CONSTANT_TIMER: Current camera position -@var SHD_TANGENT: Current camera position +@var CONSTANT_TIMER: User a timer for the uniform value. +@var SHD_TANGENT: Not yet documented. @group Blender Material: BL_* @var BL_DST_ALPHA: @@ -302,6 +302,13 @@ Documentation for the GameLogic Module. @var BL_ZERO: @group Deprecated: addActiveActuator + +@var globalDict: A dictionary that is saved between loading blend files so you can use + it to store inventory and other variables you want to store between + scenes and blend files. It can also be written to a file and loaded + later on with the game load/save actuators. + note: only python built in types such as int/string/bool/float/tuples/lists + can be saved, GameObjects, Actuators etc will not work as expectred. """ import GameTypes @@ -441,6 +448,14 @@ def setPhysicsTicRate(ticrate): @type ticrate: float """ +def EvalExpression(text): + """ + Evaluate the string as an expression, similar to the expression controller logic brick. + @param text: The expression to evaluate. + @type text: string + @return: The result of the expression. The type depends on the expression. + """ + #{ Utility functions def getAverageFrameRate(): """ diff --git a/source/gameengine/VideoTexture/blendVideoTex.cpp b/source/gameengine/VideoTexture/blendVideoTex.cpp index 1dcc72c8f7d..dad52a426b6 100644 --- a/source/gameengine/VideoTexture/blendVideoTex.cpp +++ b/source/gameengine/VideoTexture/blendVideoTex.cpp @@ -204,6 +204,7 @@ PyObject* initVideoTexture(void) #if (PY_VERSION_HEX >= 0x03000000) m = PyModule_Create(&VideoTexture_module_def); + PyDict_SetItemString(PySys_GetObject("modules"), VideoTexture_module_def.m_name, m); #else m = Py_InitModule4("VideoTexture", moduleMethods, "Module that allows to play video files on textures in GameBlender.", -- cgit v1.2.3 From 0a66e24bd79fa9ec15a0bc1454d9c7d41fe401b8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 16 Jun 2009 08:52:04 +0000 Subject: KX_PythonSeq (used for a number of BGE sequence types) * cont.actuators.get("key", default) # dict like get function * if "key" in cont.sensors: ... Updated docs Added missing include to Particle.c --- source/blender/python/api2_2x/Particle.c | 1 + source/gameengine/Ketsji/KX_PythonSeq.cpp | 133 ++++++++++++++++++++++-------- source/gameengine/PyDoc/API_intro.py | 29 ++++--- 3 files changed, 119 insertions(+), 44 deletions(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Particle.c b/source/blender/python/api2_2x/Particle.c index 21697779ca4..f69cb6a01b9 100644 --- a/source/blender/python/api2_2x/Particle.c +++ b/source/blender/python/api2_2x/Particle.c @@ -31,6 +31,7 @@ #include "Particle.h" #include "gen_utils.h" +#include "gen_library.h" #include "BKE_object.h" #include "BKE_main.h" #include "BKE_particle.h" diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp index f2bc4671f4e..524d957a80c 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.cpp +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -57,7 +57,7 @@ static Py_ssize_t KX_PythonSeq_len( PyObject * self ) PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); if(self_plus==NULL) { - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, "len(seq): "BGE_PROXY_ERROR_MSG); return -1; } @@ -84,7 +84,7 @@ static PyObject *KX_PythonSeq_getIndex(PyObject* self, int index) PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); if(self_plus==NULL) { - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, "val = seq[i]: "BGE_PROXY_ERROR_MSG); return NULL; } @@ -145,25 +145,9 @@ static PyObject *KX_PythonSeq_getIndex(PyObject* self, int index) return NULL; } - -static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) +static PyObjectPlus * KX_PythonSeq_subscript__internal(PyObject *self, char *key) { PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); - char *name = NULL; - - if(self_plus==NULL) { - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); - return NULL; - } - - if (PyInt_Check(key)) { - return KX_PythonSeq_getIndex(self, PyInt_AS_LONG( key )); - } else if ( PyString_Check(key) ) { - name = PyString_AsString( key ); - } else { - PyErr_SetString( PyExc_TypeError, "expected a string or an index" ); - return NULL; - } switch(((KX_PythonSeq *)self)->type) { case KX_PYGENSEQ_CONT_TYPE_SENSORS: @@ -172,8 +156,9 @@ static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) SCA_ISensor* sensor; for (unsigned int index=0;indexGetName() == name) - return sensor->GetProxy(); + if (sensor->GetName() == key) + return static_cast(sensor); + } break; } @@ -183,8 +168,8 @@ static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) SCA_IActuator* actuator; for (unsigned int index=0;indexGetName() == name) - return actuator->GetProxy(); + if (actuator->GetName() == key) + return static_cast(actuator); } break; } @@ -194,8 +179,8 @@ static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) SCA_ISensor *sensor; for (unsigned int index=0;indexGetName() == name) - return sensor->GetProxy(); + if (sensor->GetName() == key) + return static_cast(sensor); } break; } @@ -205,8 +190,8 @@ static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) SCA_IController *controller; for (unsigned int index=0;indexGetName() == name) - return controller->GetProxy(); + if (controller->GetName() == key) + return static_cast(controller); } break; } @@ -216,23 +201,105 @@ static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) SCA_IActuator *actuator; for (unsigned int index=0;indexGetName() == name) - return actuator->GetProxy(); + if (actuator->GetName() == key) + return static_cast(actuator); } break; } } - PyErr_Format( PyExc_KeyError, "requested item \"%s\" does not exist", name); return NULL; } + +static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) +{ + PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); + + if(self_plus==NULL) { + PyErr_SetString(PyExc_SystemError, "val = seq[key], KX_PythonSeq: "BGE_PROXY_ERROR_MSG); + return NULL; + } + + if (PyInt_Check(key)) { + return KX_PythonSeq_getIndex(self, PyInt_AS_LONG( key )); + } + else if ( PyString_Check(key) ) { + char *name = PyString_AsString(key); + PyObjectPlus *ret = KX_PythonSeq_subscript__internal(self, name); + + if(ret) { + return ret->GetProxy(); + } else { + PyErr_Format( PyExc_KeyError, "requested item \"%s\" does not exist", name); + return NULL; + } + } + else { + PyErr_SetString( PyExc_TypeError, "expected a string or an index" ); + return NULL; + } +} + + +static int KX_PythonSeq_contains(PyObject *self, PyObject *key) +{ + PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); + + if(self_plus==NULL) { + PyErr_SetString(PyExc_SystemError, "key in seq, KX_PythonSeq: "BGE_PROXY_ERROR_MSG); + return -1; + } + if(!PyString_Check(key)) { + PyErr_SetString(PyExc_SystemError, "key in seq, KX_PythonSeq: key must be a string"); + return -1; + } + + if(KX_PythonSeq_subscript__internal(self, PyString_AsString(key))) + return 1; + + return 0; +} + +/* Matches python dict.get(key, [default]) */ +PyObject* KX_PythonSeq_get(PyObject * self, PyObject *args) +{ + char *key; + PyObject* def = Py_None; + PyObjectPlus* ret_plus; + + if (!PyArg_ParseTuple(args, "s|O:get", &key, &def)) + return NULL; + + if((ret_plus = KX_PythonSeq_subscript__internal(self, key))) + return ret_plus->GetProxy(); + + Py_INCREF(def); + return def; +} + +PySequenceMethods KX_PythonSeq_as_sequence = { + NULL, /* Cant set the len otherwise it can evaluate as false */ + NULL, /* sq_concat */ + NULL, /* sq_repeat */ + NULL, /* sq_item */ + NULL, /* sq_slice */ + NULL, /* sq_ass_item */ + NULL, /* sq_ass_slice */ + (objobjproc)KX_PythonSeq_contains, /* sq_contains */ +}; + static PyMappingMethods KX_PythonSeq_as_mapping = { KX_PythonSeq_len, /* mp_length */ KX_PythonSeq_subscript, /* mp_subscript */ 0, /* mp_ass_subscript */ }; +PyMethodDef KX_PythonSeq_methods[] = { + // dict style access for props + {"get",(PyCFunction) KX_PythonSeq_get, METH_VARARGS}, + {NULL,NULL} //Sentinel +}; /* * Initialize the interator index @@ -241,7 +308,7 @@ static PyMappingMethods KX_PythonSeq_as_mapping = { static PyObject *KX_PythonSeq_getIter(KX_PythonSeq *self) { if(BGE_PROXY_REF(self->base)==NULL) { - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, "for i in seq: "BGE_PROXY_ERROR_MSG); return NULL; } @@ -323,7 +390,7 @@ PyTypeObject KX_PythonSeq_Type = { /* Method suites for standard classes */ NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ + &KX_PythonSeq_as_sequence, /* PySequenceMethods *tp_as_sequence; */ &KX_PythonSeq_as_mapping, /* PyMappingMethods *tp_as_mapping; */ /* More standard operations (here for binary compatibility) */ @@ -361,7 +428,7 @@ PyTypeObject KX_PythonSeq_Type = { ( iternextfunc ) KX_PythonSeq_nextIter, /* iternextfunc tp_iternext; */ /*** Attribute descriptor and subclassing stuff ***/ - NULL, /* struct PyMethodDef *tp_methods; */ + KX_PythonSeq_methods, /* struct PyMethodDef *tp_methods; */ NULL, /* struct PyMemberDef *tp_members; */ NULL, /* struct PyGetSetDef *tp_getset; */ NULL, /* struct _typeobject *tp_base; */ diff --git a/source/gameengine/PyDoc/API_intro.py b/source/gameengine/PyDoc/API_intro.py index ad37e34fbac..578b56eb2b0 100644 --- a/source/gameengine/PyDoc/API_intro.py +++ b/source/gameengine/PyDoc/API_intro.py @@ -6,22 +6,29 @@ The Blender Game Engine Python API Reference See U{release notes} for updates, changes and new functionality in the Game Engine Python API. - Top Module: - ----------- - - - L{GameLogic} - - L{GameKeys} - - L{GameTypes} - - L{Mathutils} - - L{Geometry} - - L{BGL} + Blender Game Engine Modules: + ---------------------------- + + Modules that include methods for accessing GameEngine data and functions. + + - L{GameLogic} utility functons for game logic. + - L{GameKeys} keyboard input and event conversion. + - L{Rasterizer} display and rendering. + - L{GameTypes} contains all the python types spesific to the GameEngine. Undocumented modules: --------------------- - VideoTexture - - CValue - - Expression - PhysicsConstraints + + Additional Modules: + ------------------- + + These modules have no GameEngine spesific functionality but are useful in many cases. + + - L{Mathutils} + - L{Geometry} + - L{BGL} Introduction: -- cgit v1.2.3 From 2d40b8d56ff100b71dac7c4694f6115dcc0b01b5 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 16 Jun 2009 13:09:36 +0000 Subject: 2.5 Added SpaceLogic, to restore the old logic buttons into. In future it can be used for a more advanced logic editor, with states, behaviour, whatever. We'll see! This commit only adds the backend for new space. Committed this now as reference for when we need another space type. It's still not well plugin-able (dynamic space types), but my idea is to just have a new SpacePlugIn for this, with a neat small API to define all relevant callbacks. Also note the icon for the spacetype is wrong still. --- source/Makefile | 1 + source/blender/blenloader/intern/readfile.c | 8 + source/blender/blenloader/intern/writefile.c | 3 + source/blender/editors/Makefile | 2 +- source/blender/editors/SConscript | 1 + source/blender/editors/include/ED_screen.h | 1 + source/blender/editors/include/ED_space_api.h | 1 + source/blender/editors/interface/resources.c | 13 + source/blender/editors/mesh/editmesh_lib.c | 9 + source/blender/editors/mesh/editmesh_tools.c | 6 +- source/blender/editors/mesh/mesh_intern.h | 1 + source/blender/editors/screen/area.c | 1 + source/blender/editors/screen/screen_ops.c | 5 + source/blender/editors/space_api/spacetypes.c | 1 + source/blender/editors/space_logic/Makefile | 54 ++++ source/blender/editors/space_logic/SConscript | 18 ++ source/blender/editors/space_logic/logic_buttons.c | 147 +++++++++ source/blender/editors/space_logic/logic_header.c | 126 ++++++++ source/blender/editors/space_logic/logic_intern.h | 55 ++++ source/blender/editors/space_logic/space_logic.c | 342 +++++++++++++++++++++ source/blender/makesdna/DNA_space_types.h | 19 +- source/blender/makesdna/DNA_userdef_types.h | 1 + source/blender/makesrna/intern/rna_space.c | 5 +- source/blender/makesrna/intern/rna_userdef.c | 26 ++ 24 files changed, 839 insertions(+), 7 deletions(-) create mode 100644 source/blender/editors/space_logic/Makefile create mode 100644 source/blender/editors/space_logic/SConscript create mode 100644 source/blender/editors/space_logic/logic_buttons.c create mode 100644 source/blender/editors/space_logic/logic_header.c create mode 100644 source/blender/editors/space_logic/logic_intern.h create mode 100644 source/blender/editors/space_logic/space_logic.c (limited to 'source') diff --git a/source/Makefile b/source/Makefile index 535a86e9139..94446f4d1d5 100644 --- a/source/Makefile +++ b/source/Makefile @@ -226,6 +226,7 @@ PULIB += $(OCGDIR)/blender/ed_action/$(DEBUG_DIR)libed_action.a PULIB += $(OCGDIR)/blender/ed_nla/$(DEBUG_DIR)libed_nla.a PULIB += $(OCGDIR)/blender/ed_script/$(DEBUG_DIR)libed_script.a PULIB += $(OCGDIR)/blender/ed_text/$(DEBUG_DIR)libed_text.a +PULIB += $(OCGDIR)/blender/ed_logic/$(DEBUG_DIR)libed_logic.a PULIB += $(OCGDIR)/blender/ed_sequencer/$(DEBUG_DIR)libed_sequencer.a PULIB += $(OCGDIR)/blender/ed_file/$(DEBUG_DIR)libed_file.a PULIB += $(OCGDIR)/blender/ed_info/$(DEBUG_DIR)libed_info.a diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 6cde040e5fd..e4afdb6b7b5 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4733,6 +4733,14 @@ static void direct_link_screen(FileData *fd, bScreen *sc) } snode->nodetree= snode->edittree= NULL; } + else if(sl->spacetype==SPACE_LOGIC) { + SpaceLogic *slogic= (SpaceLogic *)sl; + + if(slogic->gpd) { + slogic->gpd= newdataadr(fd, slogic->gpd); + direct_link_gpencil(fd, slogic->gpd); + } + } else if(sl->spacetype==SPACE_SEQ) { SpaceSeq *sseq= (SpaceSeq *)sl; if(sseq->gpd) { diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 943e23861ad..f8112406e80 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1884,6 +1884,9 @@ static void write_screens(WriteData *wd, ListBase *scrbase) else if(sl->spacetype==SPACE_NODE){ writestruct(wd, DATA, "SpaceNode", 1, sl); } + else if(sl->spacetype==SPACE_LOGIC){ + writestruct(wd, DATA, "SpaceLogic", 1, sl); + } sl= sl->next; } } diff --git a/source/blender/editors/Makefile b/source/blender/editors/Makefile index 8a819195fbd..62bf612b09d 100644 --- a/source/blender/editors/Makefile +++ b/source/blender/editors/Makefile @@ -29,6 +29,6 @@ # Bounces make to subdirectories. SOURCEDIR = source/blender/editors -DIRS = armature mesh animation object sculpt_paint datafiles transform screen curve gpencil physics preview uvedit space_outliner space_time space_view3d interface util space_api space_graph space_image space_node space_buttons space_info space_file space_sound space_action space_nla space_script space_text space_sequencer +DIRS = armature mesh animation object sculpt_paint datafiles transform screen curve gpencil physics preview uvedit space_outliner space_time space_view3d interface util space_api space_graph space_image space_node space_buttons space_info space_file space_sound space_action space_nla space_script space_text space_sequencer space_logic include nan_subdirs.mk diff --git a/source/blender/editors/SConscript b/source/blender/editors/SConscript index a99d21b19a4..9baaf7ae7a5 100644 --- a/source/blender/editors/SConscript +++ b/source/blender/editors/SConscript @@ -29,6 +29,7 @@ SConscript(['datafiles/SConscript', 'space_script/SConscript', 'space_text/SConscript', 'space_sequencer/SConscript', + 'space_logic/SConscript', 'transform/SConscript', 'screen/SConscript', 'sculpt_paint/SConscript', diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index c2beb34e7b5..ef682c871bc 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -118,6 +118,7 @@ int ED_operator_node_active(struct bContext *C); int ED_operator_ipo_active(struct bContext *C); int ED_operator_sequencer_active(struct bContext *C); int ED_operator_image_active(struct bContext *C); +int ED_operator_logic_active(struct bContext *C); int ED_operator_object_active(struct bContext *C); int ED_operator_editmesh(struct bContext *C); diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h index 08d2894ddf7..f2b46369d13 100644 --- a/source/blender/editors/include/ED_space_api.h +++ b/source/blender/editors/include/ED_space_api.h @@ -50,6 +50,7 @@ void ED_spacetype_nla(void); void ED_spacetype_script(void); void ED_spacetype_text(void); void ED_spacetype_sequencer(void); +void ED_spacetype_logic(void); /* calls for instancing and freeing spacetype static data called in WM_init_exit */ diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index edf2f160285..da0f66af02e 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -156,6 +156,9 @@ char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid) case SPACE_NODE: ts= &btheme->tnode; break; + case SPACE_LOGIC: + ts= &btheme->tlogic; + break; default: ts= &btheme->tv3d; break; @@ -398,6 +401,7 @@ static void ui_theme_init_new(bTheme *btheme) ui_theme_init_new_do(&btheme->toops); ui_theme_init_new_do(&btheme->ttime); ui_theme_init_new_do(&btheme->tnode); + ui_theme_init_new_do(&btheme->tlogic); } @@ -608,6 +612,9 @@ void ui_theme_init_userdef(void) SETCOL(btheme->tnode.syntaxv, 142, 138, 145, 255); /* generator */ SETCOL(btheme->tnode.syntaxc, 120, 145, 120, 255); /* group */ + /* space logic */ + btheme->tlogic= btheme->tv3d; + } @@ -1233,6 +1240,12 @@ void init_userdef_do_versions(void) if(btheme->tui.wcol_num.outline[3]==0) ui_widget_color_init(&btheme->tui); + + /* Logic editor theme, check for alpha==0 is safe, then color was never set */ + if(btheme->tlogic.syntaxn[3]==0) { + /* re-uses syntax color storage */ + btheme->tlogic= btheme->tv3d; + } } } diff --git a/source/blender/editors/mesh/editmesh_lib.c b/source/blender/editors/mesh/editmesh_lib.c index bfa381550df..e1b63022dd4 100644 --- a/source/blender/editors/mesh/editmesh_lib.c +++ b/source/blender/editors/mesh/editmesh_lib.c @@ -51,11 +51,13 @@ editmesh_lib: generic (no UI, no menus) operations/evaluators for editmesh data #include "BLI_editVert.h" #include "BKE_customdata.h" +#include "BKE_context.h" #include "BKE_global.h" #include "BKE_mesh.h" #include "BKE_utildefines.h" #include "ED_mesh.h" +#include "ED_screen.h" #include "ED_view3d.h" #include "mesh_intern.h" @@ -2278,3 +2280,10 @@ void EM_free_uv_vert_map(UvVertMap *vmap) } } +/* poll call for mesh operators requiring a view3d context */ +int EM_view3d_poll(bContext *C) +{ + if(ED_operator_editmesh(C) && ED_operator_view3d_active(C)) + return 1; + return 0; +} diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 83ef88a48a3..b26fded4fb6 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -966,7 +966,7 @@ void MESH_OT_spin(wmOperatorType *ot) /* api callbacks */ ot->invoke= spin_mesh_invoke; ot->exec= spin_mesh_exec; - ot->poll= ED_operator_editmesh; + ot->poll= EM_view3d_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1073,7 +1073,7 @@ void MESH_OT_screw(wmOperatorType *ot) /* api callbacks */ ot->invoke= screw_mesh_invoke; ot->exec= screw_mesh_exec; - ot->poll= ED_operator_editmesh; + ot->poll= EM_view3d_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -4995,7 +4995,7 @@ void MESH_OT_rip(wmOperatorType *ot) /* api callbacks */ ot->invoke= mesh_rip_invoke; - ot->poll= ED_operator_editmesh; // XXX + v3d! + ot->poll= EM_view3d_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index f7d2fcfc1f2..83a4211dda1 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -135,6 +135,7 @@ extern int convex(float *v1, float *v2, float *v3, float *v4); extern struct EditFace *EM_face_from_faces(EditMesh *em, struct EditFace *efa1, struct EditFace *efa2, int i1, int i2, int i3, int i4); +extern int EM_view3d_poll(struct bContext *C); /* ******************* editmesh_loop.c */ diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index c2521bd5b2c..07d8fb370e6 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1048,6 +1048,7 @@ static char *windowtype_pup(void) "|Outliner %x3" //232 "|Buttons Window %x4" //251 "|Node Editor %x16" + "|Logic Editor %x17" "|%l" //254 "|File Browser %x5" //290 diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index dae7a7cedd5..2aa6758850e 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -179,6 +179,11 @@ int ED_operator_image_active(bContext *C) return ed_spacetype_test(C, SPACE_IMAGE); } +int ED_operator_logic_active(bContext *C) +{ + return ed_spacetype_test(C, SPACE_LOGIC); +} + int ED_operator_object_active(bContext *C) { return NULL != CTX_data_active_object(C); diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 9a4d1f329e8..4f9c1f4b7a7 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -73,6 +73,7 @@ void ED_spacetypes_init(void) ED_spacetype_script(); ED_spacetype_text(); ED_spacetype_sequencer(); + ED_spacetype_logic(); // ... /* register operator types for screen and all spaces */ diff --git a/source/blender/editors/space_logic/Makefile b/source/blender/editors/space_logic/Makefile new file mode 100644 index 00000000000..e07a5bbf4a9 --- /dev/null +++ b/source/blender/editors/space_logic/Makefile @@ -0,0 +1,54 @@ +# +# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# +# ***** BEGIN GPL 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. +# +# 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) 2007 Blender Foundation +# All rights reserved. +# +# The Original Code is: all of this file. +# +# Contributor(s): none yet. +# +# ***** END GPL LICENSE BLOCK ***** +# +# Makes module object directory and bounces make to subdirectories. + +LIBNAME = ed_logic +DIR = $(OCGDIR)/blender/$(LIBNAME) + +include nan_compile.mk + +CFLAGS += $(LEVEL_1_C_WARNINGS) + +CPPFLAGS += -I$(NAN_GLEW)/include +CPPFLAGS += -I$(OPENGL_HEADERS) + +# not very neat.... +CPPFLAGS += -I../../windowmanager +CPPFLAGS += -I../../blenloader +CPPFLAGS += -I../../blenkernel +CPPFLAGS += -I../../blenlib +CPPFLAGS += -I../../makesdna +CPPFLAGS += -I../../makesrna +CPPFLAGS += -I../../imbuf +CPPFLAGS += -I../../python +CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include + +# own include + +CPPFLAGS += -I../include diff --git a/source/blender/editors/space_logic/SConscript b/source/blender/editors/space_logic/SConscript new file mode 100644 index 00000000000..46a9858a836 --- /dev/null +++ b/source/blender/editors/space_logic/SConscript @@ -0,0 +1,18 @@ +#!/usr/bin/python +Import ('env') + +sources = env.Glob('*.c') + +incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' +incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' +incs += ' ../../makesrna' + +defs = [] + +if env['WITH_BF_GAMEENGINE']: + defs.append('GAMEBLENDER=1') + + if env['WITH_BF_SOLID']: + defs.append('USE_SUMO_SOLID') + +env.BlenderLib ( 'bf_editors_space_game', sources, Split(incs), defs, libtype=['core'], priority=[120] ) diff --git a/source/blender/editors/space_logic/logic_buttons.c b/source/blender/editors/space_logic/logic_buttons.c new file mode 100644 index 00000000000..240ddfc2614 --- /dev/null +++ b/source/blender/editors/space_logic/logic_buttons.c @@ -0,0 +1,147 @@ +/** + * $Id: image_buttons.c 20913 2009-06-16 01:22:56Z blendix $ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 by Blender Foundation + * All rights reserved. + * + * ***** END GPL LICENSE BLOCK ***** + */ + + +#include +#include + +#include "DNA_object_types.h" +#include "DNA_node_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_userdef_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" + +#include "BKE_context.h" +#include "BKE_global.h" +#include "BKE_library.h" +#include "BKE_main.h" +#include "BKE_mesh.h" +#include "BKE_node.h" +#include "BKE_screen.h" +#include "BKE_utildefines.h" + +#include "ED_space_api.h" +#include "ED_screen.h" +#include "ED_util.h" + +#include "BIF_gl.h" +#include "BIF_glutil.h" + +#include "RNA_access.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "logic_intern.h" + +static void do_logic_panel_events(bContext *C, void *arg, int event) +{ + + switch(event) { + + } +} + + +/* *** */ + +static void logic_panel_properties(const bContext *C, Panel *pa) +{ +// SpaceLogic *slogic= (SpaceLogic*)CTX_wm_space_data(C); + uiBlock *block; + + block= uiLayoutFreeBlock(pa->layout); + uiBlockSetHandleFunc(block, do_logic_panel_events, NULL); + +} + +static void logic_panel_view_properties(const bContext *C, Panel *pa) +{ + // SpaceLogic *slogic= (SpaceLogic*)CTX_wm_space_data(C); + uiBlock *block; + + block= uiLayoutFreeBlock(pa->layout); + uiBlockSetHandleFunc(block, do_logic_panel_events, NULL); + +} + + +void logic_buttons_register(ARegionType *art) +{ + PanelType *pt; + + pt= MEM_callocN(sizeof(PanelType), "spacetype logic panel properties"); + strcpy(pt->idname, "LOGIC_PT_properties"); + strcpy(pt->label, "Logic Properties"); + pt->draw= logic_panel_properties; + BLI_addtail(&art->paneltypes, pt); + + pt= MEM_callocN(sizeof(PanelType), "spacetype logic view properties"); + strcpy(pt->idname, "LOGIC_PT_view_properties"); + strcpy(pt->label, "View Properties"); + pt->draw= logic_panel_view_properties; + BLI_addtail(&art->paneltypes, pt); + +} + +static int logic_properties(bContext *C, wmOperator *op) +{ + ScrArea *sa= CTX_wm_area(C); + ARegion *ar= logic_has_buttons_region(sa); + + if(ar) { + ar->flag ^= RGN_FLAG_HIDDEN; + ar->v2d.flag &= ~V2D_IS_INITIALISED; /* XXX should become hide/unhide api? */ + + ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa); + ED_area_tag_redraw(sa); + } + return OPERATOR_FINISHED; +} + +void LOGIC_OT_properties(wmOperatorType *ot) +{ + ot->name= "Properties"; + ot->idname= "LOGIC_OT_properties"; + + ot->exec= logic_properties; + ot->poll= ED_operator_logic_active; + + /* flags */ + ot->flag= 0; +} + + + diff --git a/source/blender/editors/space_logic/logic_header.c b/source/blender/editors/space_logic/logic_header.c new file mode 100644 index 00000000000..d0e905728be --- /dev/null +++ b/source/blender/editors/space_logic/logic_header.c @@ -0,0 +1,126 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_windowmanager_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" + +#include "BKE_context.h" +#include "BKE_screen.h" +#include "BKE_main.h" + +#include "ED_screen.h" +#include "ED_types.h" +#include "ED_util.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "BIF_gl.h" +#include "BIF_glutil.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "logic_intern.h" + +/* ************************ header area region *********************** */ + + +static void do_logic_buttons(bContext *C, void *arg, int event) +{ +// SpaceLogic *slogic= (SpaceLogic*)CTX_wm_space_data(C); +} + +static uiBlock *logic_addmenu(bContext *C, ARegion *ar, void *arg_unused) +{ +// SpaceLogic *slogic= (SpaceLogic*)CTX_wm_space_data(C); + uiBlock *block; + short yco= 0, menuwidth=120; + + block= uiBeginBlock(C, ar, "logic_addmenu", UI_EMBOSSP); +// uiBlockSetButmFunc(block, do_logic_addmenu, NULL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiTextBoundsBlock(block, 50); + uiBlockSetDirection(block, UI_TOP); + uiEndBlock(C, block); + + return block; +} + +void logic_header_buttons(const bContext *C, ARegion *ar) +{ + ScrArea *sa= CTX_wm_area(C); +// SpaceLogic *slogic= (SpaceLogic*)CTX_wm_space_data(C); + uiBlock *block; + short xco, yco= 3; + + block= uiBeginBlock(C, ar, "header logic", UI_EMBOSS); + uiBlockSetHandleFunc(block, do_logic_buttons, NULL); + + xco= ED_area_header_standardbuttons(C, block, yco); + + if((sa->flag & HEADER_NO_PULLDOWN)==0) { + int xmax; + + xmax= GetButStringLength("View"); + uiDefPulldownBut(block, logic_addmenu, NULL, + "View", xco, yco, xmax-3, 20, ""); + xco+= xmax; + + xmax= GetButStringLength("Select"); + uiDefPulldownBut(block, logic_addmenu, NULL, + "Select", xco, yco, xmax-3, 20, ""); + xco+= xmax; + + xmax= GetButStringLength("Add"); + uiDefPulldownBut(block, logic_addmenu, NULL, + "Add", xco, yco, xmax-3, 20, ""); + xco+= xmax; + } + + uiBlockSetEmboss(block, UI_EMBOSS); + + UI_view2d_totRect_set(&ar->v2d, xco+XIC+100, (int)(ar->v2d.tot.ymax-ar->v2d.tot.ymin)); + + uiEndBlock(C, block); + uiDrawBlock(C, block); +} + + diff --git a/source/blender/editors/space_logic/logic_intern.h b/source/blender/editors/space_logic/logic_intern.h new file mode 100644 index 00000000000..773a36bdb2d --- /dev/null +++ b/source/blender/editors/space_logic/logic_intern.h @@ -0,0 +1,55 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef ED_LOGIC_INTERN_H +#define ED_LOGIC_INTERN_H + +/* internal exports only */ +struct bContext; +struct ARegion; +struct ARegionType; +struct ScrArea; +struct SpaceLogic; +struct Object; +struct wmOperatorType; +struct Scene; + +/* space_logic.c */ +struct ARegion *logic_has_buttons_region(struct ScrArea *sa); + +/* logic_header.c */ +void logic_header_buttons(const struct bContext *C, struct ARegion *ar); + +/* logic_ops.c */ + +/* logic_buttons.c */ +void logic_buttons_register(struct ARegionType *art); +void LOGIC_OT_properties(struct wmOperatorType *ot); + +#endif /* ED_LOGIC_INTERN_H */ + diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c new file mode 100644 index 00000000000..12eeed35ec8 --- /dev/null +++ b/source/blender/editors/space_logic/space_logic.c @@ -0,0 +1,342 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "DNA_image_types.h" +#include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" +#include "DNA_object_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" + +#include "BKE_context.h" +#include "BKE_screen.h" +#include "BKE_utildefines.h" + +#include "ED_space_api.h" +#include "ED_screen.h" + +#include "BIF_gl.h" +#include "BIF_glutil.h" + +#include "RNA_access.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "logic_intern.h" + +/* ******************** manage regions ********************* */ + +ARegion *logic_has_buttons_region(ScrArea *sa) +{ + ARegion *ar, *arnew; + + for(ar= sa->regionbase.first; ar; ar= ar->next) + if(ar->regiontype==RGN_TYPE_UI) + return ar; + + /* add subdiv level; after header */ + for(ar= sa->regionbase.first; ar; ar= ar->next) + if(ar->regiontype==RGN_TYPE_HEADER) + break; + + /* is error! */ + if(ar==NULL) return NULL; + + arnew= MEM_callocN(sizeof(ARegion), "buttons for image"); + + BLI_insertlinkafter(&sa->regionbase, ar, arnew); + arnew->regiontype= RGN_TYPE_UI; + arnew->alignment= RGN_ALIGN_LEFT; + + arnew->flag = RGN_FLAG_HIDDEN; + + return arnew; +} + +/* ******************** default callbacks for image space ***************** */ + +static SpaceLink *logic_new(const bContext *C) +{ + ARegion *ar; + SpaceLogic *slogic; + + slogic= MEM_callocN(sizeof(SpaceLogic), "initlogic"); + slogic->spacetype= SPACE_LOGIC; + + /* header */ + ar= MEM_callocN(sizeof(ARegion), "header for logic"); + + BLI_addtail(&slogic->regionbase, ar); + ar->regiontype= RGN_TYPE_HEADER; + ar->alignment= RGN_ALIGN_BOTTOM; + + /* buttons/list view */ + ar= MEM_callocN(sizeof(ARegion), "buttons for logic"); + + BLI_addtail(&slogic->regionbase, ar); + ar->regiontype= RGN_TYPE_UI; + ar->alignment= RGN_ALIGN_LEFT; + + /* main area */ + ar= MEM_callocN(sizeof(ARegion), "main area for logic"); + + BLI_addtail(&slogic->regionbase, ar); + ar->regiontype= RGN_TYPE_WINDOW; + + return (SpaceLink *)slogic; +} + +/* not spacelink itself */ +static void logic_free(SpaceLink *sl) +{ +// Spacelogic *slogic= (SpaceLogic*) sl; + +// if(slogic->gpd) +// XXX free_gpencil_data(slogic->gpd); + +} + + +/* spacetype; init callback */ +static void logic_init(struct wmWindowManager *wm, ScrArea *sa) +{ + +} + +static SpaceLink *logic_duplicate(SpaceLink *sl) +{ + SpaceLogic *slogicn= MEM_dupallocN(sl); + + return (SpaceLink *)slogicn; +} + +void logic_operatortypes(void) +{ + WM_operatortype_append(LOGIC_OT_properties); + +} + +void logic_keymap(struct wmWindowManager *wm) +{ + ListBase *keymap= WM_keymap_listbase(wm, "Logic Generic", SPACE_LOGIC, 0); + + WM_keymap_add_item(keymap, "LOGIC_OT_properties", NKEY, KM_PRESS, 0, 0); +} + +static void logic_refresh(const bContext *C, ScrArea *sa) +{ +// SpaceLogic *slogic= (SpaceImage*)CTX_wm_space_data(C); +// Object *obedit= CTX_data_edit_object(C); + +} + +static void logic_listener(ARegion *ar, wmNotifier *wmn) +{ + /* context changes */ + switch(wmn->category) { + case NC_SCENE: + switch(wmn->data) { + case ND_FRAME: + ED_region_tag_redraw(ar); + break; + + case ND_OB_ACTIVE: + ED_region_tag_redraw(ar); + break; + } + break; + case NC_OBJECT: + break; + } +} + +static int logic_context(const bContext *C, const char *member, bContextDataResult *result) +{ +// SpaceLogic *slogic= (SpaceLogic*)CTX_wm_space_data(C); + + + return 0; +} + +/************************** main region ***************************/ + + +/* add handlers, stuff you only do once or on area/region changes */ +static void logic_main_area_init(wmWindowManager *wm, ARegion *ar) +{ + ListBase *keymap; + + UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy); + + /* own keymaps */ + keymap= WM_keymap_listbase(wm, "Logic Generic", SPACE_LOGIC, 0); + WM_event_add_keymap_handler(&ar->handlers, keymap); +} + +static void logic_main_area_draw(const bContext *C, ARegion *ar) +{ + /* draw entirely, view changes should be handled here */ +// SpaceLogic *slogic= (SpaceLogic*)CTX_wm_space_data(C); + View2D *v2d= &ar->v2d; + float col[3]; + + /* clear and setup matrix */ + UI_GetThemeColor3fv(TH_BACK, col); + glClearColor(col[0], col[1], col[2], 0.0); + glClear(GL_COLOR_BUFFER_BIT); + + /* we set view2d from own zoom and offset each time */ +// image_main_area_set_view2d(sima, ar, scene); + + UI_view2d_view_ortho(C, v2d); + + /* scrollers? */ + /*scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_UNIT_VALUES, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); + UI_view2d_scrollers_draw(C, v2d, scrollers); + UI_view2d_scrollers_free(scrollers);*/ +} + + +/* *********************** buttons region ************************ */ + +/* add handlers, stuff you only do once or on area/region changes */ +static void logic_buttons_area_init(wmWindowManager *wm, ARegion *ar) +{ + ListBase *keymap; + + ED_region_panels_init(wm, ar); + + keymap= WM_keymap_listbase(wm, "Logic Generic", SPACE_LOGIC, 0); + WM_event_add_keymap_handler(&ar->handlers, keymap); +} + +static void logic_buttons_area_draw(const bContext *C, ARegion *ar) +{ + ED_region_panels(C, ar, 1, NULL); +} + +/************************* header region **************************/ + +/* add handlers, stuff you only do once or on area/region changes */ +static void logic_header_area_init(wmWindowManager *wm, ARegion *ar) +{ + ED_region_header_init(ar); +} + +static void logic_header_area_draw(const bContext *C, ARegion *ar) +{ + float col[3]; + + /* clear */ + if(ED_screen_area_active(C)) + UI_GetThemeColor3fv(TH_HEADER, col); + else + UI_GetThemeColor3fv(TH_HEADERDESEL, col); + + glClearColor(col[0], col[1], col[2], 0.0); + glClear(GL_COLOR_BUFFER_BIT); + + /* set view2d view matrix for scrolling (without scrollers) */ + UI_view2d_view_ortho(C, &ar->v2d); + + logic_header_buttons(C, ar); + + /* restore view matrix? */ + UI_view2d_view_restore(C); +} + +/**************************** spacetype *****************************/ + +/* only called once, from space/spacetypes.c */ +void ED_spacetype_logic(void) +{ + SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype logic"); + ARegionType *art; + + st->spaceid= SPACE_LOGIC; + + st->new= logic_new; + st->free= logic_free; + st->init= logic_init; + st->duplicate= logic_duplicate; + st->operatortypes= logic_operatortypes; + st->keymap= logic_keymap; + st->refresh= logic_refresh; + st->context= logic_context; + + /* regions: main window */ + art= MEM_callocN(sizeof(ARegionType), "spacetype logic region"); + art->regionid = RGN_TYPE_WINDOW; + art->keymapflag= ED_KEYMAP_FRAMES; + art->init= logic_main_area_init; + art->draw= logic_main_area_draw; + art->listener= logic_listener; + art->keymapflag= 0; + + BLI_addhead(&st->regiontypes, art); + + /* regions: listview/buttons */ + art= MEM_callocN(sizeof(ARegionType), "spacetype logic region"); + art->regionid = RGN_TYPE_UI; + art->minsizex= 220; // XXX + art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES; + art->listener= logic_listener; + art->init= logic_buttons_area_init; + art->draw= logic_buttons_area_draw; + BLI_addhead(&st->regiontypes, art); + + logic_buttons_register(art); + + /* regions: header */ + art= MEM_callocN(sizeof(ARegionType), "spacetype logic region"); + art->regionid = RGN_TYPE_HEADER; + art->minsizey= HEADERY; + art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES; + art->init= logic_header_area_init; + art->draw= logic_header_area_draw; + + BLI_addhead(&st->regiontypes, art); + + BKE_spacetype_register(st); +} + + diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 4c2c2520ee3..97f0d3e53f3 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -361,6 +361,21 @@ typedef struct SpaceNode { #define SNODE_TEX_WORLD 1 #define SNODE_TEX_BRUSH 2 +typedef struct SpaceLogic { + SpaceLink *next, *prev; + ListBase regionbase; /* storage of regions for inactive spaces */ + int spacetype; + float blockscale; + + short blockhandler[8]; + + short flag, pad; + int pad2; + + struct bGPdata *gpd; /* grease-pencil data */ +} SpaceLogic; + + typedef struct SpaceImaSel { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ @@ -753,8 +768,8 @@ enum { SPACE_SCRIPT, SPACE_TIME, SPACE_NODE, - SPACEICONMAX = SPACE_NODE -/* SPACE_LOGIC */ + SPACE_LOGIC, + SPACEICONMAX = SPACE_LOGIC }; #endif diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 2b9592fca56..9d554c88a95 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -244,6 +244,7 @@ typedef struct bTheme { ThemeSpace toops; ThemeSpace ttime; ThemeSpace tnode; + ThemeSpace tlogic; /* 20 sets of bone colors for this theme */ ThemeWireColor tarm[20]; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index debe6851451..3b8b88beaff 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -54,6 +54,7 @@ EnumPropertyItem space_type_items[] = { {SPACE_SCRIPT, "SCRIPTS_WINDOW", 0, "Scripts Window", ""}, {SPACE_TIME, "TIMELINE", 0, "Timeline", ""}, {SPACE_NODE, "NODE_EDITOR", 0, "Node Editor", ""}, + {SPACE_LOGIC, "LOGIC_EDITOR", 0, "Logic Editor", ""}, {0, NULL, 0, NULL, NULL}}; #define DC_RGB {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors."} @@ -118,7 +119,9 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr) case SPACE_TIME: return &RNA_SpaceTimeline; case SPACE_NODE: - return &RNA_SpaceNodeEditor;*/ + return &RNA_SpaceNodeEditor; + case SPACE_LOGIC: + return &RNA_SpaceLogicEditor;*/ default: return &RNA_Space; } diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 04006f51c7c..65d83bec552 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -891,6 +891,26 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) RNA_def_property_update(prop, NC_WINDOW, NULL); } +static void rna_def_userdef_theme_space_logic(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + /* space_buts */ + + srna= RNA_def_struct(brna, "ThemeLogicEditor", NULL); + RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_ui_text(srna, "Theme Logic Editor", "Theme settings for the Logic Editor."); + + rna_def_userdef_theme_spaces_main(srna, SPACE_LOGIC); + + prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Panel", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); +} + + static void rna_def_userdef_theme_space_buts(BlenderRNA *brna) { StructRNA *srna; @@ -1321,6 +1341,11 @@ static void rna_def_userdef_themes(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ThemeNodeEditor"); RNA_def_property_ui_text(prop, "Node Editor", ""); + prop= RNA_def_property(srna, "logic_editor", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "tlogic"); + RNA_def_property_struct_type(prop, "ThemeLogicEditor"); + RNA_def_property_ui_text(prop, "Logic Editor", ""); + prop= RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "toops"); RNA_def_property_struct_type(prop, "ThemeOutliner"); @@ -1357,6 +1382,7 @@ static void rna_def_userdef_dothemes(BlenderRNA *brna) rna_def_userdef_theme_space_outliner(brna); rna_def_userdef_theme_space_info(brna); rna_def_userdef_theme_space_sound(brna); + rna_def_userdef_theme_space_logic(brna); rna_def_userdef_theme_colorset(brna); rna_def_userdef_themes(brna); } -- cgit v1.2.3 From aa0825a5e5c19f33cf60f72e295b5902129cfe1d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 16 Jun 2009 15:44:08 +0000 Subject: looks like a mistake. should check with the scene render size, not the current scenes. --- source/blender/blenloader/intern/readfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c4d63cf14fd..b4efa5d1432 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8166,7 +8166,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if(ed) { WHILE_SEQ(&ed->seqbase) { if (seq->strip && seq->strip->proxy){ - if (G.scene->r.size != 100.0) { + if (sce->r.size != 100.0) { seq->strip->proxy->size = sce->r.size; } else { -- cgit v1.2.3 From 2faf20c4b3ae1ca6c82dd2a942d2f2a580685436 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 16 Jun 2009 18:25:48 +0000 Subject: BGE Action Actuator setChannel() function was broken in a number of ways. * extract_pose_from_pose only checked one of the list items for NULL when looping over them yet its possible they are different sizes. * game_free_pose needed to be used rather then MEM_freeN, channels would never be freed leaking memory. * setChannel() would make a new pose that wasnt aligned with the existing pose, the lists are assumed aligned so when extracting the channels its unlikely this was ever useful. * Added getChannel() - returns pose loc/size/quat * Added option args for setChannel(channel, matrix) or setChannel(channel, loc, size, quat) --- source/blender/blenkernel/intern/action.c | 3 +- source/gameengine/Converter/BL_ActionActuator.cpp | 172 +++++++++++++--------- source/gameengine/Converter/BL_ActionActuator.h | 2 +- source/gameengine/PyDoc/GameTypes.py | 16 +- 4 files changed, 114 insertions(+), 79 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index e0afdec5e23..dea8b72bbfd 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -798,6 +798,7 @@ void calc_action_range(const bAction *act, float *start, float *end, int incl_hi /* Copy the data from the action-pose (src) into the pose */ /* both args are assumed to be valid */ /* exported to game engine */ +/* Note! this assumes both poses are aligned, this isnt always true when dealing with user poses */ void extract_pose_from_pose(bPose *pose, const bPose *src) { const bPoseChannel *schan; @@ -808,7 +809,7 @@ void extract_pose_from_pose(bPose *pose, const bPose *src) return; } - for (schan=src->chanbase.first; schan; schan=schan->next, pchan= pchan->next) { + for (schan=src->chanbase.first; (schan && pchan); schan=schan->next, pchan= pchan->next) { copy_pose_channel_data(pchan, schan); } } diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 0812693ee0a..e18b8213b21 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -50,6 +50,7 @@ #include "BKE_utildefines.h" #include "FloatValue.h" #include "PyObjectPlus.h" +#include "KX_PyMath.h" #include "blendef.h" #ifdef HAVE_CONFIG_H @@ -366,8 +367,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame) /* Perform the user override (if any) */ if (m_userpose){ extract_pose_from_pose(m_pose, m_userpose); -// clear_pose(m_userpose); - MEM_freeN(m_userpose); + game_free_pose(m_userpose); //cant use MEM_freeN(m_userpose) because the channels need freeing too. m_userpose = NULL; } #if 1 @@ -767,22 +767,55 @@ PyObject* BL_ActionActuator::PySetFrameProperty(PyObject* args, Py_RETURN_NONE; } -/* -PyObject* BL_ActionActuator::PyGetChannel(PyObject* args, - PyObject* kwds) { - char *string; +PyObject* BL_ActionActuator::PyGetChannel(PyObject* value) { + char *string= PyString_AsString(value); - if (PyArg_ParseTuple(args,"s:getChannel",&string)) - { - m_propname = string; + if (!string) { + PyErr_SetString(PyExc_TypeError, "expected a single string"); + return NULL; } - else { + + bPoseChannel *pchan; + + + // get_pose_channel accounts for NULL pose, run on both incase one exists but + // the channel doesnt + if( !(pchan=get_pose_channel(m_userpose, string)) && + !(pchan=get_pose_channel(m_pose, string)) ) + { + PyErr_SetString(PyExc_ValueError, "channel doesnt exist"); return NULL; } + + PyObject *ret = PyTuple_New(3); - Py_RETURN_NONE; -} + PyObject *list = PyList_New(3); + PyList_SET_ITEM(list, 0, PyFloat_FromDouble(pchan->loc[0])); + PyList_SET_ITEM(list, 1, PyFloat_FromDouble(pchan->loc[1])); + PyList_SET_ITEM(list, 2, PyFloat_FromDouble(pchan->loc[2])); + PyTuple_SET_ITEM(ret, 0, list); + + list = PyList_New(3); + PyList_SET_ITEM(list, 0, PyFloat_FromDouble(pchan->size[0])); + PyList_SET_ITEM(list, 1, PyFloat_FromDouble(pchan->size[1])); + PyList_SET_ITEM(list, 2, PyFloat_FromDouble(pchan->size[2])); + PyTuple_SET_ITEM(ret, 1, list); + + list = PyList_New(4); + PyList_SET_ITEM(list, 0, PyFloat_FromDouble(pchan->quat[0])); + PyList_SET_ITEM(list, 1, PyFloat_FromDouble(pchan->quat[1])); + PyList_SET_ITEM(list, 2, PyFloat_FromDouble(pchan->quat[2])); + PyList_SET_ITEM(list, 3, PyFloat_FromDouble(pchan->quat[3])); + PyTuple_SET_ITEM(ret, 2, list); + + return ret; +/* + return Py_BuildValue("([fff][fff][ffff])", + pchan->loc[0], pchan->loc[1], pchan->loc[2], + pchan->size[0], pchan->size[1], pchan->size[2], + pchan->quat[0], pchan->quat[1], pchan->quat[2], pchan->quat[3] ); */ +} /* getType */ const char BL_ActionActuator::GetType_doc[] = @@ -857,76 +890,69 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, "\t - matrix : A 4x4 matrix specifying the overriding transformation\n" "\t as an offset from the bone's rest position.\n") { - float matrix[4][4]; + BL_ArmatureObject *obj = (BL_ArmatureObject*)GetParent(); char *string; - PyObject* pylist; - bool error = false; - int row,col; - int mode = 0; /* 0 for bone space, 1 for armature/world space */ + PyObject *pymat= NULL; + PyObject *pyloc= NULL, *pysize= NULL, *pyquat= NULL; + bPoseChannel *pchan; - if (!PyArg_ParseTuple(args,"sO|i:setChannel", &string, &pylist, &mode)) - return NULL; - - if (pylist->ob_type == &CListValue::Type) - { - CListValue* listval = (CListValue*) pylist; - if (listval->GetCount() == 4) - { - for (row=0;row<4;row++) // each row has a 4-vector [x,y,z, w] - { - CListValue* vecval = (CListValue*)listval->GetValue(row); - for (col=0;col<4;col++) - { - matrix[row][col] = vecval->GetValue(col)->GetNumber(); - - } - } - } - else - { - error = true; - } + if(PyTuple_Size(args)==2) { + if (!PyArg_ParseTuple(args,"sO:setChannel", &string, &pymat)) // matrix + return NULL; } - else - { - // assert the list is long enough... - int numitems = PyList_Size(pylist); - if (numitems == 4) - { - for (row=0;row<4;row++) // each row has a 4-vector [x,y,z, w] - { - - PyObject* veclist = PyList_GetItem(pylist,row); // here we have a vector4 list - for (col=0;col<4;col++) - { - matrix[row][col] = PyFloat_AsDouble(PyList_GetItem(veclist,col)); - - } - } - } - else - { - error = true; - } + else if(PyTuple_Size(args)==4) { + if (!PyArg_ParseTuple(args,"sOOO:setChannel", &string, &pyloc, &pysize, &pyquat)) // loc/size/quat + return NULL; + } + else { + PyErr_SetString(PyExc_ValueError, "Expected a string and a 4x4 matrix (2 args) or a string and loc/size/quat sequences (4 args)"); + return NULL; } - if (!error) - { - -/* DO IT HERE */ - bPoseChannel *pchan= verify_pose_channel(m_userpose, string); - - Mat4ToQuat(matrix, pchan->quat); - Mat4ToSize(matrix, pchan->size); + if(pymat) { + float matrix[4][4]; + MT_Matrix4x4 mat; + + if(!PyMatTo(pymat, mat)) + return NULL; + + mat.setValue((const float *)matrix); + + BL_ArmatureObject *obj = (BL_ArmatureObject*)GetParent(); + obj->GetPose(&m_pose); /* Get the underlying pose from the armature */ + + if (!m_userpose) { + obj->GetPose(&m_pose); /* Get the underlying pose from the armature */ + game_copy_pose(&m_userpose, m_pose); + } + pchan= verify_pose_channel(m_userpose, string); // adds the channel if its not there. + VECCOPY (pchan->loc, matrix[3]); + Mat4ToSize(matrix, pchan->size); + Mat4ToQuat(matrix, pchan->quat); + } + else { + MT_Vector3 loc; + MT_Vector3 size; + MT_Vector4 quat; - pchan->flag |= POSE_ROT|POSE_LOC|POSE_SIZE; - - if (!m_userpose){ - m_userpose = (bPose*)MEM_callocN(sizeof(bPose), "userPose"); + if (!PyVecTo(pyloc, loc) || !PyVecTo(pysize, size) || !PyVecTo(pyquat, quat)) + return NULL; + + // same as above + if (!m_userpose) { + obj->GetPose(&m_pose); /* Get the underlying pose from the armature */ + game_copy_pose(&m_userpose, m_pose); } + pchan= verify_pose_channel(m_userpose, string); + + // for some reason loc.setValue(pchan->loc) fails + pchan->loc[0]= loc[0]; pchan->loc[1]= loc[1]; pchan->loc[2]= loc[2]; + pchan->size[0]= size[0]; pchan->size[1]= size[1]; pchan->size[2]= size[2]; + pchan->quat[0]= quat[0]; pchan->quat[1]= quat[1]; pchan->quat[2]= quat[2]; pchan->quat[3]= quat[3]; } + pchan->flag |= POSE_ROT|POSE_LOC|POSE_SIZE; Py_RETURN_NONE; } @@ -986,7 +1012,7 @@ PyMethodDef BL_ActionActuator::Methods[] = { {"getFrame", (PyCFunction) BL_ActionActuator::sPyGetFrame, METH_VARARGS, (PY_METHODCHAR)GetFrame_doc}, {"getProperty", (PyCFunction) BL_ActionActuator::sPyGetProperty, METH_VARARGS, (PY_METHODCHAR)GetProperty_doc}, {"getFrameProperty", (PyCFunction) BL_ActionActuator::sPyGetFrameProperty, METH_VARARGS, (PY_METHODCHAR)GetFrameProperty_doc}, -// {"getChannel", (PyCFunction) BL_ActionActuator::sPyGetChannel, METH_VARARGS}, + {"getChannel", (PyCFunction) BL_ActionActuator::sPyGetChannel, METH_O}, {"getType", (PyCFunction) BL_ActionActuator::sPyGetType, METH_VARARGS, (PY_METHODCHAR)GetType_doc}, {"setType", (PyCFunction) BL_ActionActuator::sPySetType, METH_VARARGS, (PY_METHODCHAR)SetType_doc}, {"getContinue", (PyCFunction) BL_ActionActuator::sPyGetContinue, METH_NOARGS, 0}, diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h index b3c15c08f50..422b16bb3ec 100644 --- a/source/gameengine/Converter/BL_ActionActuator.h +++ b/source/gameengine/Converter/BL_ActionActuator.h @@ -104,7 +104,7 @@ public: KX_PYMETHOD_DOC(BL_ActionActuator,GetFrame); KX_PYMETHOD_DOC(BL_ActionActuator,GetProperty); KX_PYMETHOD_DOC(BL_ActionActuator,GetFrameProperty); -// KX_PYMETHOD(BL_ActionActuator,GetChannel); + KX_PYMETHOD_O(BL_ActionActuator,GetChannel); KX_PYMETHOD_DOC(BL_ActionActuator,GetType); KX_PYMETHOD_DOC(BL_ActionActuator,SetType); KX_PYMETHOD_NOARGS(BL_ActionActuator,GetContinue); diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index 4ab175a8f6c..63dd1a7fabf 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -336,15 +336,23 @@ class BL_ActionActuator(SCA_IActuator): @ivar framePropName: The name of the property that is set to the current frame number. @type framePropName: string """ - def setChannel(channel, matrix, mode = False): + def setChannel(channel, matrix): """ - @param channel: A string specifying the name of the bone channel. + Alternative to the 2 arguments, 4 arguments (channel, matrix, loc, size, quat) are also supported. + + @param channel: A string specifying the name of the bone channel, created if missing. @type channel: string @param matrix: A 4x4 matrix specifying the overriding transformation as an offset from the bone's rest position. @type matrix: list [[float]] - @param mode: True for armature/world space, False for bone space - @type mode: boolean + """ + + def getChannel(channel): + """ + @param channel: A string specifying the name of the bone channel. error raised if missing. + @type channel: string + @rtype: tuple + @return: (loc, size, quat) """ #{ Deprecated -- cgit v1.2.3 From 54ed699743dd605a41bc02b2c3b0f59a7dd311a0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 16 Jun 2009 20:38:18 +0000 Subject: ActionActuator in the game engine working again to display deformed meshes with the new animation system. Note that the animation conversion from existing 2.4x blend files doesnt yet set the Action pointer in the actuator so the only way to test is to use the python api to set the new converted action active on the actuator because there is no user interface. --- source/gameengine/Converter/BL_ActionActuator.cpp | 30 +++++++++++++++++++++- source/gameengine/Converter/BL_ArmatureObject.cpp | 9 ++++--- source/gameengine/Converter/BL_ArmatureObject.h | 5 +++- .../Converter/BL_BlenderDataConversion.cpp | 3 ++- .../Converter/KX_BlenderScalarInterpolator.cpp | 2 +- 5 files changed, 42 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 0c7b99df387..131d48aed4f 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -57,6 +57,13 @@ #include #endif +extern "C" { +#include "BKE_animsys.h" +#include "BKE_action.h" +#include "RNA_access.h" +#include "RNA_define.h" +} + BL_ActionActuator::~BL_ActionActuator() { if (m_pose) @@ -360,10 +367,31 @@ bool BL_ActionActuator::Update(double curtime, bool frame) /* Get the underlying pose from the armature */ obj->GetPose(&m_pose); - + +// 2.4x function, /* Override the necessary channels with ones from the action */ // XXX extract_pose_from_action(m_pose, m_action, m_localtime); + + +// 2.5x - replacement for extract_pose_from_action(...) above. + { + struct PointerRNA id_ptr; + Object *arm= obj->GetArmatureObject(); + bPose *pose_back= arm->pose; + + arm->pose= m_pose; + RNA_id_pointer_create((ID *)arm, &id_ptr); + animsys_evaluate_action(&id_ptr, m_action, NULL, m_localtime); + + arm->pose= pose_back; + +// 2.5x - could also do this but looks too high level, constraints use this, it works ok. +// Object workob; /* evaluate using workob */ +// what_does_obaction((Scene *)obj->GetScene(), obj->GetArmatureObject(), &workob, m_pose, m_action, NULL, m_localtime); + } + // done getting the pose from the action + /* Perform the user override (if any) */ if (m_userpose){ extract_pose_from_pose(m_pose, m_userpose); diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index 6fc5c40d570..f8a9b1b637f 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -38,6 +38,7 @@ #include "DNA_action_types.h" #include "DNA_armature_types.h" #include "DNA_object_types.h" +#include "DNA_scene_types.h" #include "MT_Matrix4x4.h" @@ -48,10 +49,12 @@ BL_ArmatureObject::BL_ArmatureObject( void* sgReplicationInfo, SG_Callbacks callbacks, - Object *armature ) + Object *armature, + Scene *scene) : KX_GameObject(sgReplicationInfo,callbacks), m_objArma(armature), + m_scene(scene), // maybe remove later. needed for where_is_pose m_framePose(NULL), m_lastframe(0.0), m_activeAct(NULL), @@ -93,9 +96,9 @@ void BL_ArmatureObject::ApplyPose() { m_armpose = m_objArma->pose; m_objArma->pose = m_pose; - + //m_scene->r.cfra++; if(m_lastapplyframe != m_lastframe) { - where_is_pose(NULL, m_objArma); // XXX + where_is_pose(m_scene, m_objArma); // XXX m_lastapplyframe = m_lastframe; } } diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h index d5402cfd126..e1e176840a6 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.h +++ b/source/gameengine/Converter/BL_ArmatureObject.h @@ -51,7 +51,8 @@ public: BL_ArmatureObject( void* sgReplicationInfo, SG_Callbacks callbacks, - Object *armature + Object *armature, + Scene *scene ); virtual ~BL_ArmatureObject(); @@ -67,6 +68,7 @@ public: struct bArmature * GetArmature() { return m_armature; } const struct bArmature * GetArmature() const { return m_armature; } + const struct Scene * GetScene() const { return m_scene; } Object* GetArmatureObject() {return m_objArma;} @@ -84,6 +86,7 @@ protected: struct bPose *m_pose; struct bPose *m_armpose; struct bPose *m_framePose; + struct Scene *m_scene; // need for where_is_pose double m_lastframe; class BL_ActionActuator *m_activeAct; short m_activePriority; diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index c25bdbe71f7..b907e300879 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1795,7 +1795,8 @@ static KX_GameObject *gameobject_from_blenderobject( gameobj = new BL_ArmatureObject( kxscene, KX_Scene::m_callbacks, - ob // handle + ob, + blenderscene // handle ); /* Get the current pose from the armature object and apply it as the rest pose */ break; diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp index 1ae96350197..20829524558 100644 --- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp +++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp @@ -27,7 +27,7 @@ */ #include "KX_BlenderScalarInterpolator.h" -#include "stdio.h" + #include extern "C" { -- cgit v1.2.3 From 0b0b02caf86c44b19c47c404c7a083b3ebf9b97d Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 17 Jun 2009 11:01:05 +0000 Subject: 2.5 Logic editing back! Test screenie: http://download.blender.org/institute/rt9.jpg I gave the buttons a bit more width, added nicer linkline draw. Not working yet: - theme colors for sensor/actuator types (was old button colors) - moving sensors up/down (used bad pupmenu... better is icons like used for modifiers) - Linkline mouse-over select. Currently deleting a link goes by drawing the same line again. Needs to be fully tested for functionality too, leave that to the GE department. :) I noted there's bad button hacking with reading button values, like check_state_mask(). uiBut structure was not meant to be exported outside of interface module. --- source/blender/editors/interface/interface.c | 139 +- .../blender/editors/interface/interface_handlers.c | 215 +- .../blender/editors/interface/interface_intern.h | 2 + .../blender/editors/interface/interface_widgets.c | 78 + source/blender/editors/interface/resources.c | 2 + source/blender/editors/space_logic/logic_intern.h | 3 + source/blender/editors/space_logic/logic_window.c | 3351 ++++++++++++++++++++ source/blender/editors/space_logic/space_logic.c | 45 +- source/blender/makesdna/DNA_space_types.h | 4 +- 9 files changed, 3694 insertions(+), 145 deletions(-) create mode 100644 source/blender/editors/space_logic/logic_window.c (limited to 'source') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 9a06bd21ea2..5ffc6440dc4 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -398,18 +398,21 @@ void uiMenuPopupBoundsBlock(uiBlock *block, int addval, int mx, int my) static void ui_draw_linkline(uiBut *but, uiLinkLine *line) { - float vec1[2], vec2[2]; + rcti rect; if(line->from==NULL || line->to==NULL) return; - vec1[0]= (line->from->x1+line->from->x2)/2.0; - vec1[1]= (line->from->y1+line->from->y2)/2.0; - vec2[0]= (line->to->x1+line->to->x2)/2.0; - vec2[1]= (line->to->y1+line->to->y2)/2.0; + rect.xmin= (line->from->x1+line->from->x2)/2.0; + rect.ymin= (line->from->y1+line->from->y2)/2.0; + rect.xmax= (line->to->x1+line->to->x2)/2.0; + rect.ymax= (line->to->y1+line->to->y2)/2.0; - if(line->flag & UI_SELECT) glColor3ub(100,100,100); - else glColor3ub(0,0,0); - fdrawline(vec1[0], vec1[1], vec2[0], vec2[1]); + if(line->flag & UI_SELECT) + glColor3ub(100,100,100); + else + glColor3ub(0,0,0); + + ui_draw_link_bezier(&rect); } static void ui_draw_links(uiBlock *block) @@ -475,6 +478,8 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut but->selend= oldbut->selend; but->softmin= oldbut->softmin; but->softmax= oldbut->softmax; + but->linkto[0]= oldbut->linkto[0]; + but->linkto[1]= oldbut->linkto[1]; found= 1; oldbut->active= NULL; @@ -733,8 +738,13 @@ static void ui_is_but_sel(uiBut *but) /* XXX 2.50 no links supported yet */ -#if 0 -static uiBut *ui_get_valid_link_button(uiBlock *block, uiBut *but, short *mval) +static int uibut_contains_pt(uiBut *but, short *mval) +{ + return 0; + +} + +uiBut *ui_get_valid_link_button(uiBlock *block, uiBut *but, short *mval) { uiBut *bt; @@ -745,7 +755,7 @@ static uiBut *ui_get_valid_link_button(uiBlock *block, uiBut *but, short *mval) if (bt) { if (but->type==LINK && bt->type==INLINK) { - if( but->link->tocode == (int)bt->min ) { + if( but->link->tocode == (int)bt->hardmin ) { return bt; } } @@ -759,21 +769,6 @@ static uiBut *ui_get_valid_link_button(uiBlock *block, uiBut *but, short *mval) return NULL; } -static int ui_is_a_link(uiBut *from, uiBut *to) -{ - uiLinkLine *line; - uiLink *link; - - link= from->link; - if(link) { - line= link->lines.first; - while(line) { - if(line->from==from && line->to==to) return 1; - line= line->next; - } - } - return 0; -} static uiBut *ui_find_inlink(uiBlock *block, void *poin) { @@ -839,98 +834,6 @@ void uiComposeLinks(uiBlock *block) } } -static void ui_add_link(uiBut *from, uiBut *to) -{ - /* in 'from' we have to add a link to 'to' */ - uiLink *link; - void **oldppoin; - int a; - - if(ui_is_a_link(from, to)) { - printf("already exists\n"); - return; - } - - link= from->link; - - /* are there more pointers allowed? */ - if(link->ppoin) { - oldppoin= *(link->ppoin); - - (*(link->totlink))++; - *(link->ppoin)= MEM_callocN( *(link->totlink)*sizeof(void *), "new link"); - - for(a=0; a< (*(link->totlink))-1; a++) { - (*(link->ppoin))[a]= oldppoin[a]; - } - (*(link->ppoin))[a]= to->poin; - - if(oldppoin) MEM_freeN(oldppoin); - } - else { - *(link->poin)= to->poin; - } - -} - -static int ui_do_but_LINK(uiBlock *block, uiBut *but) -{ - /* - * This button only visualizes, the dobutton mode - * can add a new link, but then the whole system - * should be redrawn/initialized. - * - */ - uiBut *bt=0, *bto=NULL; - short sval[2], mval[2], mvalo[2], first= 1; - - uiGetMouse(curarea->win, sval); - mvalo[0]= sval[0]; - mvalo[1]= sval[1]; - - while (get_mbut() & L_MOUSE) { - uiGetMouse(curarea->win, mval); - - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || first) { - /* clear completely, because of drawbuttons */ - bt= ui_get_valid_link_button(block, but, mval); - if(bt) { - bt->flag |= UI_ACTIVE; - ui_draw_but(ar, bt); - } - if(bto && bto!=bt) { - bto->flag &= ~UI_ACTIVE; - ui_draw_but(ar, bto); - } - bto= bt; - - if (!first) { - glutil_draw_front_xor_line(sval[0], sval[1], mvalo[0], mvalo[1]); - } - glutil_draw_front_xor_line(sval[0], sval[1], mval[0], mval[1]); - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - - first= 0; - } - else UI_wait_for_statechange(); - } - - if (!first) { - glutil_draw_front_xor_line(sval[0], sval[1], mvalo[0], mvalo[1]); - } - - if(bt) { - if(but->type==LINK) ui_add_link(but, bt); - else ui_add_link(bt, but); - - scrarea_queue_winredraw(curarea); - } - - return 0; -} -#endif /* ************************************************ */ diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 6ec809b7178..fb5afbf5e36 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -165,6 +165,7 @@ typedef struct uiAfterFunc { bContextStore *context; } uiAfterFunc; +static int ui_mouse_inside_button(ARegion *ar, uiBut *but, int x, int y); static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState state); static int ui_handler_region_menu(bContext *C, wmEvent *event, void *userdata); static int ui_handler_popup(bContext *C, wmEvent *event, void *userdata); @@ -525,6 +526,149 @@ static void ui_apply_but_CHARTAB(bContext *C, uiBut *but, uiHandleButtonData *da } #endif + +static void ui_delete_active_linkline(uiBlock *block) +{ + uiBut *but; + uiLink *link; + uiLinkLine *line, *nline; + int a, b; + + but= block->buttons.first; + while(but) { + if(but->type==LINK && but->link) { + line= but->link->lines.first; + while(line) { + + nline= line->next; + + if(line->flag & UI_SELECT) { + BLI_remlink(&but->link->lines, line); + + link= line->from->link; + + /* are there more pointers allowed? */ + if(link->ppoin) { + + if(*(link->totlink)==1) { + *(link->totlink)= 0; + MEM_freeN(*(link->ppoin)); + *(link->ppoin)= NULL; + } + else { + b= 0; + for(a=0; a< (*(link->totlink)); a++) { + + if( (*(link->ppoin))[a] != line->to->poin ) { + (*(link->ppoin))[b]= (*(link->ppoin))[a]; + b++; + } + } + (*(link->totlink))--; + } + } + else { + *(link->poin)= NULL; + } + + MEM_freeN(line); + } + line= nline; + } + } + but= but->next; + } +} + + +static uiLinkLine *ui_is_a_link(uiBut *from, uiBut *to) +{ + uiLinkLine *line; + uiLink *link; + + link= from->link; + if(link) { + line= link->lines.first; + while(line) { + if(line->from==from && line->to==to) return line; + line= line->next; + } + } + return NULL; +} + +static void ui_add_link(uiBut *from, uiBut *to) +{ + /* in 'from' we have to add a link to 'to' */ + uiLink *link; + uiLinkLine *line; + void **oldppoin; + int a; + + if( (line= ui_is_a_link(from, to)) ) { + line->flag |= UI_SELECT; + ui_delete_active_linkline(from->block); + printf("already exists, means deletion now\n"); + return; + } + + if (from->type==LINK && to->type==INLINK) { + if( from->link->tocode != (int)to->hardmin ) { + printf("cannot link\n"); + return; + } + } + else if(from->type==INLINK && to->type==LINK) { + if( to->link->tocode == (int)from->hardmin ) { + printf("cannot link\n"); + return; + } + } + + link= from->link; + + /* are there more pointers allowed? */ + if(link->ppoin) { + oldppoin= *(link->ppoin); + + (*(link->totlink))++; + *(link->ppoin)= MEM_callocN( *(link->totlink)*sizeof(void *), "new link"); + + for(a=0; a< (*(link->totlink))-1; a++) { + (*(link->ppoin))[a]= oldppoin[a]; + } + (*(link->ppoin))[a]= to->poin; + + if(oldppoin) MEM_freeN(oldppoin); + } + else { + *(link->poin)= to->poin; + } + +} + + +static void ui_apply_but_LINK(bContext *C, uiBut *but, uiHandleButtonData *data) +{ + ARegion *ar= CTX_wm_region(C); + uiBut *bt; + + for(bt= but->block->buttons.first; bt; bt= bt->next) { + if( ui_mouse_inside_button(ar, bt, but->linkto[0]+ar->winrct.xmin, but->linkto[1]+ar->winrct.ymin) ) + break; + } + if(bt && bt!=but) { + + if(but->type==LINK) ui_add_link(but, bt); + else ui_add_link(bt, but); + + ui_apply_but_func(C, but); + data->retval= but->retval; + } + data->applied= 1; +} + + static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, int interactive) { char *editstr; @@ -640,6 +784,7 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut #endif case LINK: case INLINK: + ui_apply_but_LINK(C, but, data); break; default: break; @@ -2806,6 +2951,38 @@ static int ui_do_but_CHARTAB(bContext *C, uiBlock *block, uiBut *but, uiHandleBu } #endif + +static int ui_do_but_LINK(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event) +{ + ARegion *ar= CTX_wm_region(C); + + but->linkto[0]= event->x-ar->winrct.xmin; + but->linkto[1]= event->y-ar->winrct.ymin; + + if(data->state == BUTTON_STATE_HIGHLIGHT) { + if(event->type == LEFTMOUSE && event->val==KM_PRESS) { + button_activate_state(C, but, BUTTON_STATE_WAIT_RELEASE); + return WM_UI_HANDLER_BREAK; + } + else if(event->type == LEFTMOUSE && but->block->handle) { + button_activate_state(C, but, BUTTON_STATE_EXIT); + return WM_UI_HANDLER_BREAK; + } + } + else if(data->state == BUTTON_STATE_WAIT_RELEASE) { + + if(event->type == LEFTMOUSE && event->val!=KM_PRESS) { + if(!(but->flag & UI_SELECT)) + data->cancel= 1; + button_activate_state(C, but, BUTTON_STATE_EXIT); + return WM_UI_HANDLER_BREAK; + } + } + + return WM_UI_HANDLER_CONTINUE; +} + + static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event) { uiHandleButtonData *data; @@ -2951,13 +3128,11 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event) retval= ui_do_but_CHARTAB(C, block, but, data, event); break; #endif - /* XXX 2.50 links not implemented yet */ -#if 0 + case LINK: case INLINK: - retval= retval= ui_do_but_LINK(block, but); + retval= ui_do_but_LINK(C, but, data, event); break; -#endif } return retval; @@ -3421,21 +3596,29 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but) else if(data->state == BUTTON_STATE_WAIT_RELEASE) { switch(event->type) { case MOUSEMOVE: - /* deselect the button when moving the mouse away */ - if(ui_mouse_inside_button(ar, but, event->x, event->y)) { - if(!(but->flag & UI_SELECT)) { - but->flag |= UI_SELECT; - data->cancel= 0; - ED_region_tag_redraw(data->region); - } + + if(ELEM(but->type,LINK, INLINK)) { + but->flag |= UI_SELECT; + ui_do_button(C, block, but, event); + ED_region_tag_redraw(data->region); } else { - if(but->flag & UI_SELECT) { - but->flag &= ~UI_SELECT; - data->cancel= 1; - ED_region_tag_redraw(data->region); + /* deselect the button when moving the mouse away */ + if(ui_mouse_inside_button(ar, but, event->x, event->y)) { + if(!(but->flag & UI_SELECT)) { + but->flag |= UI_SELECT; + data->cancel= 0; + ED_region_tag_redraw(data->region); + } } - } + else { + if(but->flag & UI_SELECT) { + but->flag &= ~UI_SELECT; + data->cancel= 1; + ED_region_tag_redraw(data->region); + } + } + } break; default: /* otherwise catch mouse release event */ diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 83d3ec7fc46..3aed2a7c299 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -181,6 +181,7 @@ struct uiBut { void *search_arg; uiLink *link; + short linkto[2]; char *tip, *lockstr; @@ -408,6 +409,7 @@ extern int ui_button_is_active(struct ARegion *ar); void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3); void ui_draw_menu_back(struct uiStyle *style, uiBlock *block, rcti *rect); void ui_draw_search_back(struct uiStyle *style, uiBlock *block, rcti *rect); +void ui_draw_link_bezier(rcti *rect); extern void ui_draw_but(const struct bContext *C, ARegion *ar, struct uiStyle *style, uiBut *but, rcti *rect); /* theme color init */ diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 52a77be0b01..119fd8a3fe5 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -40,6 +40,7 @@ #include "BLI_rect.h" #include "BKE_context.h" +#include "BKE_curve.h" #include "BKE_global.h" #include "BKE_utildefines.h" @@ -1550,6 +1551,76 @@ static void widget_numbut(uiWidgetColors *wcol, rcti *rect, int state, int round } + +static int ui_link_bezier_points(rcti *rect, float coord_array[][2], int resol) +{ + float dist, vec[4][2]; + + vec[0][0]= rect->xmin; + vec[0][1]= rect->ymin; + vec[3][0]= rect->xmax; + vec[3][1]= rect->ymax; + + dist= 0.5f*ABS(vec[0][0] - vec[3][0]); + + vec[1][0]= vec[0][0]+dist; + vec[1][1]= vec[0][1]; + + vec[2][0]= vec[3][0]-dist; + vec[2][1]= vec[3][1]; + + forward_diff_bezier(vec[0][0], vec[1][0], vec[2][0], vec[3][0], coord_array[0], resol, 2); + forward_diff_bezier(vec[0][1], vec[1][1], vec[2][1], vec[3][1], coord_array[0]+1, resol, 2); + + return 1; +} + +#define LINK_RESOL 24 +void ui_draw_link_bezier(rcti *rect) +{ + float coord_array[LINK_RESOL+1][2]; + + if(ui_link_bezier_points(rect, coord_array, LINK_RESOL)) { + float dist; + int i; + + /* we can reuse the dist variable here to increment the GL curve eval amount*/ + dist = 1.0f/(float)LINK_RESOL; + + glEnable(GL_BLEND); + glEnable(GL_LINE_SMOOTH); + + glBegin(GL_LINE_STRIP); + for(i=0; i<=LINK_RESOL; i++) { + glVertex2fv(coord_array[i]); + } + glEnd(); + + glDisable(GL_BLEND); + glDisable(GL_LINE_SMOOTH); + + } +} + + +static void widget_link(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +{ + + if(but->flag & UI_SELECT) { + rcti rectlink; + + UI_ThemeColor(TH_TEXT_HI); + + rectlink.xmin= (rect->xmin+rect->xmax)/2; + rectlink.ymin= (rect->ymin+rect->ymax)/2; + rectlink.xmax= but->linkto[0]; + rectlink.ymax= but->linkto[1]; + + ui_draw_link_bezier(&rectlink); + } +} + + static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) { uiWidgetBase wtb, wtb1; @@ -2077,6 +2148,13 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct case ROUNDBOX: wt= widget_type(UI_WTYPE_BOX); break; + + case LINK: + case INLINK: + wt= widget_type(UI_WTYPE_ICON); + wt->custom= widget_link; + + break; case BUT_EXTRA: widget_draw_extra_mask(C, but, widget_type(UI_WTYPE_BOX), rect); diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index da0f66af02e..0a65718b708 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -614,6 +614,7 @@ void ui_theme_init_userdef(void) /* space logic */ btheme->tlogic= btheme->tv3d; + SETCOL(btheme->tlogic.back, 100, 100, 100, 255); } @@ -1245,6 +1246,7 @@ void init_userdef_do_versions(void) if(btheme->tlogic.syntaxn[3]==0) { /* re-uses syntax color storage */ btheme->tlogic= btheme->tv3d; + SETCOL(btheme->tlogic.back, 100, 100, 100, 255); } } } diff --git a/source/blender/editors/space_logic/logic_intern.h b/source/blender/editors/space_logic/logic_intern.h index 773a36bdb2d..ac5d11a3ee1 100644 --- a/source/blender/editors/space_logic/logic_intern.h +++ b/source/blender/editors/space_logic/logic_intern.h @@ -51,5 +51,8 @@ void logic_header_buttons(const struct bContext *C, struct ARegion *ar); void logic_buttons_register(struct ARegionType *art); void LOGIC_OT_properties(struct wmOperatorType *ot); +/* logic_window.c */ +void logic_buttons(struct bContext *C, struct ARegion *ar); + #endif /* ED_LOGIC_INTERN_H */ diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c new file mode 100644 index 00000000000..b328ed74e08 --- /dev/null +++ b/source/blender/editors/space_logic/logic_window.c @@ -0,0 +1,3351 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "DNA_actuator_types.h" +#include "DNA_controller_types.h" +#include "DNA_object_types.h" +#include "DNA_property_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_sensor_types.h" +#include "DNA_sound_types.h" +#include "DNA_windowmanager_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" + +#include "BKE_context.h" +#include "BKE_global.h" +#include "BKE_library.h" +#include "BKE_main.h" +#include "BKE_property.h" +#include "BKE_screen.h" +#include "BKE_sca.h" +#include "BKE_utildefines.h" + +#include "ED_screen.h" +#include "ED_types.h" +#include "ED_util.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "BIF_gl.h" +#include "BIF_glutil.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +/* XXX BAD BAD */ +#include "../interface/interface_intern.h" + +#include "logic_intern.h" + + + +/* XXX */ +static int pupmenu() {return 1;} +/* XXX */ + +#define MAX_RENDER_PASS 100 +#define B_REDR 1 +#define B_IDNAME 2 + +#define B_ADD_PROP 2701 +#define B_CHANGE_PROP 2702 + +#define B_ADD_SENS 2703 +#define B_CHANGE_SENS 2704 +#define B_DEL_SENS 2705 + +#define B_ADD_CONT 2706 +#define B_CHANGE_CONT 2707 +#define B_DEL_CONT 2708 + +#define B_ADD_ACT 2709 +#define B_CHANGE_ACT 2710 +#define B_DEL_ACT 2711 + +#define B_SOUNDACT_BROWSE 2712 + +#define B_SETSECTOR 2713 +#define B_SETPROP 2714 +#define B_SETACTOR 2715 +#define B_SETMAINACTOR 2716 +#define B_SETDYNA 2717 +#define B_SET_STATE_BIT 2718 +#define B_INIT_STATE_BIT 2719 + +/* proto */ +static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisflag); + +static int vergname(const void *v1, const void *v2) +{ + char **x1, **x2; + + x1= (char **)v1; + x2= (char **)v2; + + return strcmp(*x1, *x2); +} + +void make_unique_prop_names(bContext *C, char *str) +{ + Object *ob; + bProperty *prop; + bSensor *sens; + bController *cont; + bActuator *act; + ID **idar; + short a, obcount, propcount=0, nr; + char **names; + + /* this function is called by a Button, and gives the current + * stringpointer as an argument, this is the one that can change + */ + + idar= get_selected_and_linked_obs(C, &obcount, BUTS_SENS_SEL|BUTS_SENS_ACT|BUTS_ACT_SEL|BUTS_ACT_ACT|BUTS_CONT_SEL|BUTS_CONT_ACT); + + /* for each object, make properties and sca names unique */ + + /* count total names */ + for(a=0; aprop); + propcount+= BLI_countlist(&ob->sensors); + propcount+= BLI_countlist(&ob->controllers); + propcount+= BLI_countlist(&ob->actuators); + } + if(propcount==0) { + if(idar) MEM_freeN(idar); + return; + } + + /* make names array for sorting */ + names= MEM_callocN(propcount*sizeof(void *), "names"); + + /* count total names */ + nr= 0; + for(a=0; aprop.first; + while(prop) { + names[nr++]= prop->name; + prop= prop->next; + } + sens= ob->sensors.first; + while(sens) { + names[nr++]= sens->name; + sens= sens->next; + } + cont= ob->controllers.first; + while(cont) { + names[nr++]= cont->name; + cont= cont->next; + } + act= ob->actuators.first; + while(act) { + names[nr++]= act->name; + act= act->next; + } + } + + qsort(names, propcount, sizeof(void *), vergname); + + /* now we check for double names, and change them */ + + for(nr=0; nr0) { + /* now find out which object has this ... */ + base= FIRSTBASE; + while(base) { + + sens= base->object->sensors.first; + while(sens) { + if(sens == sens_to_delete) break; + sens= sens->next; + } + + if(sens) { + if( val==1 && sens->prev) { + for (tmp=sens->prev; tmp; tmp=tmp->prev) { + if (tmp->flag & SENS_VISIBLE) + break; + } + if (tmp) { + BLI_remlink(&base->object->sensors, sens); + BLI_insertlinkbefore(&base->object->sensors, tmp, sens); + } + } + else if( val==2 && sens->next) { + for (tmp=sens->next; tmp; tmp=tmp->next) { + if (tmp->flag & SENS_VISIBLE) + break; + } + if (tmp) { + BLI_remlink(&base->object->sensors, sens); + BLI_insertlink(&base->object->sensors, tmp, sens); + } + } + ED_undo_push(C, "Move sensor"); + break; + } + + base= base->next; + } + } +} + +static void sca_move_controller(bContext *C, void *datav, void *data2_unused) +{ + Scene *scene= CTX_data_scene(C); + bController *controller_to_del= datav; + int val; + Base *base; + bController *cont, *tmp; + + val= pupmenu("Move up%x1|Move down %x2"); + + if(val>0) { + /* now find out which object has this ... */ + base= FIRSTBASE; + while(base) { + + cont= base->object->controllers.first; + while(cont) { + if(cont == controller_to_del) break; + cont= cont->next; + } + + if(cont) { + if( val==1 && cont->prev) { + /* locate the controller that has the same state mask but is earlier in the list */ + tmp = cont->prev; + while(tmp) { + if(tmp->state_mask & cont->state_mask) + break; + tmp = tmp->prev; + } + if (tmp) { + BLI_remlink(&base->object->controllers, cont); + BLI_insertlinkbefore(&base->object->controllers, tmp, cont); + } + } + else if( val==2 && cont->next) { + tmp = cont->next; + while(tmp) { + if(tmp->state_mask & cont->state_mask) + break; + tmp = tmp->next; + } + BLI_remlink(&base->object->controllers, cont); + BLI_insertlink(&base->object->controllers, tmp, cont); + } + ED_undo_push(C, "Move controller"); + break; + } + + base= base->next; + } + } +} + +static void sca_move_actuator(bContext *C, void *datav, void *data2_unused) +{ + Scene *scene= CTX_data_scene(C); + bActuator *actuator_to_move= datav; + int val; + Base *base; + bActuator *act, *tmp; + + val= pupmenu("Move up%x1|Move down %x2"); + + if(val>0) { + /* now find out which object has this ... */ + base= FIRSTBASE; + while(base) { + + act= base->object->actuators.first; + while(act) { + if(act == actuator_to_move) break; + act= act->next; + } + + if(act) { + if( val==1 && act->prev) { + /* locate the first visible actuators before this one */ + for (tmp = act->prev; tmp; tmp=tmp->prev) { + if (tmp->flag & ACT_VISIBLE) + break; + } + if (tmp) { + BLI_remlink(&base->object->actuators, act); + BLI_insertlinkbefore(&base->object->actuators, tmp, act); + } + } + else if( val==2 && act->next) { + for (tmp=act->next; tmp; tmp=tmp->next) { + if (tmp->flag & ACT_VISIBLE) + break; + } + if (tmp) { + BLI_remlink(&base->object->actuators, act); + BLI_insertlink(&base->object->actuators, tmp, act); + } + } + ED_undo_push(C, "Move actuator"); + break; + } + + base= base->next; + } + } +} + +void do_logic_buts(bContext *C, void *arg, int event) +{ + bProperty *prop; + bSensor *sens; + bController *cont; + bActuator *act; + Object *ob; + int didit, bit; + + ob= CTX_data_active_object(C); + if(ob==NULL) return; + + switch(event) { + + case B_SETPROP: + /* check for inconsistant types */ + ob->gameflag &= ~(OB_SECTOR|OB_MAINACTOR|OB_DYNAMIC|OB_ACTOR); + break; + + case B_SETACTOR: + case B_SETDYNA: + case B_SETMAINACTOR: + ob->gameflag &= ~(OB_SECTOR|OB_PROP); + break; + + + case B_ADD_PROP: + prop= new_property(PROP_FLOAT); + make_unique_prop_names(C, prop->name); + BLI_addtail(&ob->prop, prop); + ED_undo_push(C, "Add property"); + break; + + case B_CHANGE_PROP: + prop= ob->prop.first; + while(prop) { + if(prop->type!=prop->otype) { + init_property(prop); + } + prop= prop->next; + } + break; + + case B_ADD_SENS: + for(ob=G.main->object.first; ob; ob=ob->id.next) { + if(ob->scaflag & OB_ADDSENS) { + ob->scaflag &= ~OB_ADDSENS; + sens= new_sensor(SENS_ALWAYS); + BLI_addtail(&(ob->sensors), sens); + make_unique_prop_names(C, sens->name); + ob->scaflag |= OB_SHOWSENS; + } + } + + ED_undo_push(C, "Add sensor"); + break; + + case B_CHANGE_SENS: + for(ob=G.main->object.first; ob; ob=ob->id.next) { + sens= ob->sensors.first; + while(sens) { + if(sens->type != sens->otype) { + init_sensor(sens); + sens->otype= sens->type; + break; + } + sens= sens->next; + } + } + break; + + case B_DEL_SENS: + for(ob=G.main->object.first; ob; ob=ob->id.next) { + sens= ob->sensors.first; + while(sens) { + if(sens->flag & SENS_DEL) { + BLI_remlink(&(ob->sensors), sens); + free_sensor(sens); + break; + } + sens= sens->next; + } + } + ED_undo_push(C, "Delete sensor"); + break; + + case B_ADD_CONT: + for(ob=G.main->object.first; ob; ob=ob->id.next) { + if(ob->scaflag & OB_ADDCONT) { + ob->scaflag &= ~OB_ADDCONT; + cont= new_controller(CONT_LOGIC_AND); + make_unique_prop_names(C, cont->name); + ob->scaflag |= OB_SHOWCONT; + BLI_addtail(&(ob->controllers), cont); + /* set the controller state mask from the current object state. + A controller is always in a single state, so select the lowest bit set + from the object state */ + for (bit=0; bit<32; bit++) { + if (ob->state & (1<state_mask = (1<state_mask == 0) { + /* shouldn't happen, object state is never 0 */ + cont->state_mask = 1; + } + } + } + ED_undo_push(C, "Add controller"); + break; + + case B_SET_STATE_BIT: + for(ob=G.main->object.first; ob; ob=ob->id.next) { + if(ob->scaflag & OB_SETSTBIT) { + ob->scaflag &= ~OB_SETSTBIT; + ob->state = 0x3FFFFFFF; + } + } + break; + + case B_INIT_STATE_BIT: + for(ob=G.main->object.first; ob; ob=ob->id.next) { + if(ob->scaflag & OB_INITSTBIT) { + ob->scaflag &= ~OB_INITSTBIT; + ob->state = ob->init_state; + if (!ob->state) + ob->state = 1; + } + } + break; + + case B_CHANGE_CONT: + for(ob=G.main->object.first; ob; ob=ob->id.next) { + cont= ob->controllers.first; + while(cont) { + if(cont->type != cont->otype) { + init_controller(cont); + cont->otype= cont->type; + break; + } + cont= cont->next; + } + } + break; + + + case B_DEL_CONT: + for(ob=G.main->object.first; ob; ob=ob->id.next) { + cont= ob->controllers.first; + while(cont) { + if(cont->flag & CONT_DEL) { + BLI_remlink(&(ob->controllers), cont); + unlink_controller(cont); + free_controller(cont); + break; + } + cont= cont->next; + } + } + ED_undo_push(C, "Delete controller"); + break; + + case B_ADD_ACT: + for(ob=G.main->object.first; ob; ob=ob->id.next) { + if(ob->scaflag & OB_ADDACT) { + ob->scaflag &= ~OB_ADDACT; + act= new_actuator(ACT_OBJECT); + make_unique_prop_names(C, act->name); + BLI_addtail(&(ob->actuators), act); + ob->scaflag |= OB_SHOWACT; + } + } + ED_undo_push(C, "Add actuator"); + break; + + case B_CHANGE_ACT: + for(ob=G.main->object.first; ob; ob=ob->id.next) { + act= ob->actuators.first; + while(act) { + if(act->type != act->otype) { + init_actuator(act); + act->otype= act->type; + break; + } + act= act->next; + } + } + break; + + case B_DEL_ACT: + for(ob=G.main->object.first; ob; ob=ob->id.next) { + act= ob->actuators.first; + while(act) { + if(act->flag & ACT_DEL) { + BLI_remlink(&(ob->actuators), act); + unlink_actuator(act); + free_actuator(act); + break; + } + act= act->next; + } + } + ED_undo_push(C, "Delete actuator"); + break; + + case B_SOUNDACT_BROWSE: + /* since we don't know which... */ + didit= 0; + for(ob=G.main->object.first; ob; ob=ob->id.next) { + act= ob->actuators.first; + while(act) + { + if(act->type==ACT_SOUND) + { + bSoundActuator *sa= act->data; + if(sa->sndnr) + { + bSound *sound= G.main->sound.first; + int nr= 1; + + if(sa->sndnr == -2) { +// XXX activate_databrowse((ID *)G.main->sound.first, ID_SO, 0, B_SOUNDACT_BROWSE, +// &sa->sndnr, do_logic_buts); + break; + } + + while(sound) + { + if(nr==sa->sndnr) + break; + nr++; + sound= sound->id.next; + } + + if(sa->sound) + sa->sound->id.us--; + + sa->sound= sound; + + if(sound) + sound->id.us++; + + sa->sndnr= 0; + didit= 1; + } + } + act= act->next; + } + if(didit) + break; + } + + break; + } +} + + +static char *sensor_name(int type) +{ + switch (type) { + case SENS_ALWAYS: + return "Always"; + case SENS_TOUCH: + return "Touch"; + case SENS_NEAR: + return "Near"; + case SENS_KEYBOARD: + return "Keyboard"; + case SENS_PROPERTY: + return "Property"; + case SENS_ACTUATOR: + return "Actuator"; + case SENS_DELAY: + return "Delay"; + case SENS_MOUSE: + return "Mouse"; + case SENS_COLLISION: + return "Collision"; + case SENS_RADAR: + return "Radar"; + case SENS_RANDOM: + return "Random"; + case SENS_RAY: + return "Ray"; + case SENS_MESSAGE: + return "Message"; + case SENS_JOYSTICK: + return "Joystick"; + } + return "unknown"; +} + +static char *sensor_pup(void) +{ + /* the number needs to match defines in game.h */ + return "Sensors %t|Always %x0|Delay %x13|Keyboard %x3|Mouse %x5|" + "Touch %x1|Collision %x6|Near %x2|Radar %x7|" + "Property %x4|Random %x8|Ray %x9|Message %x10|Joystick %x11|Actuator %x12"; +} + +static char *controller_name(int type) +{ + switch (type) { + case CONT_LOGIC_AND: + return "AND"; + case CONT_LOGIC_OR: + return "OR"; + case CONT_LOGIC_NAND: + return "NAND"; + case CONT_LOGIC_NOR: + return "NOR"; + case CONT_LOGIC_XOR: + return "XOR"; + case CONT_LOGIC_XNOR: + return "XNOR"; + case CONT_EXPRESSION: + return "Expression"; + case CONT_PYTHON: + return "Python"; + } + return "unknown"; +} + +static char *controller_pup(void) +{ + return "Controllers %t|AND %x0|OR %x1|XOR %x6|NAND %x4|NOR %x5|XNOR %x7|Expression %x2|Python %x3"; +} + +static char *actuator_name(int type) +{ + switch (type) { + case ACT_SHAPEACTION: + return "Shape Action"; + case ACT_ACTION: + return "Action"; + case ACT_OBJECT: + return "Motion"; + case ACT_IPO: + return "Ipo"; + case ACT_LAMP: + return "Lamp"; + case ACT_CAMERA: + return "Camera"; + case ACT_MATERIAL: + return "Material"; + case ACT_SOUND: + return "Sound"; + case ACT_CD: + return "CD"; + case ACT_PROPERTY: + return "Property"; + case ACT_EDIT_OBJECT: + return "Edit Object"; + case ACT_CONSTRAINT: + return "Constraint"; + case ACT_SCENE: + return "Scene"; + case ACT_GROUP: + return "Group"; + case ACT_RANDOM: + return "Random"; + case ACT_MESSAGE: + return "Message"; + case ACT_GAME: + return "Game"; + case ACT_VISIBILITY: + return "Visibility"; + case ACT_2DFILTER: + return "2D Filter"; + case ACT_PARENT: + return "Parent"; + case ACT_STATE: + return "State"; + } + return "unknown"; +} + + + + +static char *actuator_pup(Object *owner) +{ + switch (owner->type) + { + case OB_ARMATURE: + return "Actuators %t|Action %x15|Motion %x0|Constraint %x9|Ipo %x1" + "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10" + "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17" + "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22"; + break; + + case OB_MESH: + return "Actuators %t|Shape Action %x21|Motion %x0|Constraint %x9|Ipo %x1" + "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10" + "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17" + "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22"; + break; + + default: + return "Actuators %t|Motion %x0|Constraint %x9|Ipo %x1" + "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10" + "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17" + "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22"; + } +} + + + +static void set_sca_ob(Object *ob) +{ + bController *cont; + bActuator *act; + + cont= ob->controllers.first; + while(cont) { + cont->mynew= (bController *)ob; + cont= cont->next; + } + act= ob->actuators.first; + while(act) { + act->mynew= (bActuator *)ob; + act= act->next; + } +} + +static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisflag) +{ + Base *base; + Scene *scene= CTX_data_scene(C); + Object *ob, *obt, *obact= CTX_data_active_object(C); + ID **idar; + bSensor *sens; + bController *cont; + unsigned int lay; + int a, nr, doit; + + /* we need a sorted object list */ + /* set scavisflags flags in Objects to indicate these should be evaluated */ + /* also hide ob pointers in ->new entries of controllerss/actuators */ + + *count= 0; + + if(scene==NULL) return NULL; + + ob= G.main->object.first; + while(ob) { + ob->scavisflag= 0; + set_sca_ob(ob); + ob= ob->id.next; + } + + /* XXX here it checked 3d lay */ + lay= scene->lay; + + base= FIRSTBASE; + while(base) { + if(base->lay & lay) { + if(base->flag & SELECT) { + if(scavisflag & BUTS_SENS_SEL) base->object->scavisflag |= OB_VIS_SENS; + if(scavisflag & BUTS_CONT_SEL) base->object->scavisflag |= OB_VIS_CONT; + if(scavisflag & BUTS_ACT_SEL) base->object->scavisflag |= OB_VIS_ACT; + } + } + base= base->next; + } + + if(obact) { + if(scavisflag & BUTS_SENS_ACT) obact->scavisflag |= OB_VIS_SENS; + if(scavisflag & BUTS_CONT_ACT) obact->scavisflag |= OB_VIS_CONT; + if(scavisflag & BUTS_ACT_ACT) obact->scavisflag |= OB_VIS_ACT; + } + + /* BUTS_XXX_STATE are similar to BUTS_XXX_LINK for selecting the object */ + if(scavisflag & (BUTS_SENS_LINK|BUTS_CONT_LINK|BUTS_ACT_LINK|BUTS_SENS_STATE|BUTS_ACT_STATE)) { + doit= 1; + while(doit) { + doit= 0; + + ob= G.main->object.first; + while(ob) { + + /* 1st case: select sensor when controller selected */ + if((scavisflag & (BUTS_SENS_LINK|BUTS_SENS_STATE)) && (ob->scavisflag & OB_VIS_SENS)==0) { + sens= ob->sensors.first; + while(sens) { + for(a=0; atotlinks; a++) { + if(sens->links[a]) { + obt= (Object *)sens->links[a]->mynew; + if(obt && (obt->scavisflag & OB_VIS_CONT)) { + doit= 1; + ob->scavisflag |= OB_VIS_SENS; + break; + } + } + } + if(doit) break; + sens= sens->next; + } + } + + /* 2nd case: select cont when act selected */ + if((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_CONT)==0) { + cont= ob->controllers.first; + while(cont) { + for(a=0; atotlinks; a++) { + if(cont->links[a]) { + obt= (Object *)cont->links[a]->mynew; + if(obt && (obt->scavisflag & OB_VIS_ACT)) { + doit= 1; + ob->scavisflag |= OB_VIS_CONT; + break; + } + } + } + if(doit) break; + cont= cont->next; + } + } + + /* 3rd case: select controller when sensor selected */ + if((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_SENS)) { + sens= ob->sensors.first; + while(sens) { + for(a=0; atotlinks; a++) { + if(sens->links[a]) { + obt= (Object *)sens->links[a]->mynew; + if(obt && (obt->scavisflag & OB_VIS_CONT)==0) { + doit= 1; + obt->scavisflag |= OB_VIS_CONT; + } + } + } + sens= sens->next; + } + } + + /* 4th case: select actuator when controller selected */ + if( (scavisflag & (BUTS_ACT_LINK|BUTS_ACT_STATE)) && (ob->scavisflag & OB_VIS_CONT)) { + cont= ob->controllers.first; + while(cont) { + for(a=0; atotlinks; a++) { + if(cont->links[a]) { + obt= (Object *)cont->links[a]->mynew; + if(obt && (obt->scavisflag & OB_VIS_ACT)==0) { + doit= 1; + obt->scavisflag |= OB_VIS_ACT; + } + } + } + cont= cont->next; + } + + } + ob= ob->id.next; + } + } + } + + /* now we count */ + ob= G.main->object.first; + while(ob) { + if( ob->scavisflag ) (*count)++; + ob= ob->id.next; + } + + if(*count==0) return NULL; + if(*count>24) *count= 24; /* temporal */ + + idar= MEM_callocN( (*count)*sizeof(void *), "idar"); + + ob= G.main->object.first; + nr= 0; + while(ob) { + if( ob->scavisflag ) { + idar[nr]= (ID *)ob; + nr++; + } + if(nr>=24) break; + ob= ob->id.next; + } + + /* just to be sure... these were set in set_sca_done_ob() */ + clear_sca_new_poins(); + + return idar; +} + + +static int get_col_sensor(int type) +{ + /* XXX themecolors not here */ + + switch(type) { + case SENS_ALWAYS: return TH_PANEL; + case SENS_DELAY: return TH_PANEL; + case SENS_TOUCH: return TH_PANEL; + case SENS_COLLISION: return TH_PANEL; + case SENS_NEAR: return TH_PANEL; + case SENS_KEYBOARD: return TH_PANEL; + case SENS_PROPERTY: return TH_PANEL; + case SENS_ACTUATOR: return TH_PANEL; + case SENS_MOUSE: return TH_PANEL; + case SENS_RADAR: return TH_PANEL; + case SENS_RANDOM: return TH_PANEL; + case SENS_RAY: return TH_PANEL; + case SENS_MESSAGE: return TH_PANEL; + case SENS_JOYSTICK: return TH_PANEL; + default: return TH_PANEL; + } +} +static void set_col_sensor(int type, int medium) +{ + int col= get_col_sensor(type); + UI_ThemeColorShade(col, medium?30:0); +} + + +static void verify_logicbutton_func(bContext *C, void *data1, void *data2) +{ + bSensor *sens= (bSensor*)data1; + + if(sens->level && sens->tap) { + if(data2 == &(sens->level)) + sens->tap= 0; + else + sens->level= 0; + } +} + + +/** + * Draws a toggle for pulse mode, a frequency field and a toggle to invert + * the value of this sensor. Operates on the shared data block of sensors. + */ +static void draw_default_sensor_header(bSensor *sens, + uiBlock *block, + short x, + short y, + short w) +{ + uiBut *but; + + /* Pulsing and frequency */ + uiDefIconButBitS(block, TOG, SENS_PULSE_REPEAT, 1, ICON_DOTSUP, + (short)(x + 10 + 0. * (w-20)), (short)(y - 21), (short)(0.1 * (w-20)), 19, + &sens->pulse, 0.0, 0.0, 0, 0, + "Activate TRUE level triggering (pulse mode)"); + + uiDefIconButBitS(block, TOG, SENS_NEG_PULSE_MODE, 1, ICON_DOTSDOWN, + (short)(x + 10 + 0.1 * (w-20)), (short)(y - 21), (short)(0.1 * (w-20)), 19, + &sens->pulse, 0.0, 0.0, 0, 0, + "Activate FALSE level triggering (pulse mode)"); + uiDefButS(block, NUM, 1, "f:", + (short)(x + 10 + 0.2 * (w-20)), (short)(y - 21), (short)(0.275 * (w-20)), 19, + &sens->freq, 0.0, 10000.0, 0, 0, + "Delay between repeated pulses (in logic tics, 0 = no delay)"); + + /* value or shift? */ + but= uiDefButS(block, TOG, 1, "Level", + (short)(x + 10 + 0.5 * (w-20)), (short)(y - 21), (short)(0.20 * (w-20)), 19, + &sens->level, 0.0, 0.0, 0, 0, + "Level detector, trigger controllers of new states (only applicable upon logic state transition)"); + uiButSetFunc(but, verify_logicbutton_func, sens, &(sens->level)); + but= uiDefButS(block, TOG, 1, "Tap", + (short)(x + 10 + 0.702 * (w-20)), (short)(y - 21), (short)(0.12 * (w-20)), 19, + &sens->tap, 0.0, 0.0, 0, 0, + "Trigger controllers only for an instant, even while the sensor remains true"); + uiButSetFunc(but, verify_logicbutton_func, sens, &(sens->tap)); + + uiDefButS(block, TOG, 1, "Inv", + (short)(x + 10 + 0.85 * (w-20)), (short)(y - 21), (short)(0.15 * (w-20)), 19, + &sens->invert, 0.0, 0.0, 0, 0, + "Invert the level (output) of this sensor"); +} + +static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short yco, short width,char* objectname) +{ + bNearSensor *ns = NULL; + bTouchSensor *ts = NULL; + bKeyboardSensor *ks = NULL; + bPropertySensor *ps = NULL; + bMouseSensor *ms = NULL; + bCollisionSensor *cs = NULL; + bRadarSensor *rs = NULL; + bRandomSensor *randomSensor = NULL; + bRaySensor *raySens = NULL; + bMessageSensor *mes = NULL; + bJoystickSensor *joy = NULL; + bActuatorSensor *as = NULL; + bDelaySensor *ds = NULL; + short ysize; + char *str; + + /* yco is at the top of the rect, draw downwards */ + + set_col_sensor(sens->type, 0); + + switch (sens->type) + { + case SENS_ALWAYS: + { + ysize= 24; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + draw_default_sensor_header(sens, block, xco, yco, width); + + yco-= ysize; + + break; + } + case SENS_TOUCH: + { + ysize= 48; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + draw_default_sensor_header(sens, block, xco, yco, width); + + ts= sens->data; + + /* uiDefBut(block, TEX, 1, "Property:", xco,yco-22,width, 19, &ts->name, 0, 31, 0, 0, "Only look for Objects with this property"); */ + uiDefIDPoinBut(block, test_matpoin_but, ID_MA, 1, "MA:",(short)(xco + 10),(short)(yco-44), (short)(width - 20), 19, &ts->ma, "Only look for floors with this Material"); + ///* uiDefButF(block, NUM, 1, "Margin:", xco+width/2,yco-44,width/2, 19, &ts->dist, 0.0, 10.0, 100, 0, "Extra margin (distance) for larger sensitivity"); + yco-= ysize; + break; + } + case SENS_COLLISION: + { + ysize= 48; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + draw_default_sensor_header(sens, block, xco, yco, width); + cs= sens->data; + + /* The collision sensor will become a generic collision (i.e. it */ + /* absorb the old touch sensor). */ + + uiDefButBitS(block, TOG, SENS_COLLISION_PULSE, B_REDR, "Pulse",(short)(xco + 10),(short)(yco - 44), + (short)(0.20 * (width-20)), 19, &cs->mode, 0.0, 0.0, 0, 0, + "Changes to the set of colliding objects generated pulses"); + + uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P",(short)(xco + 10 + (0.20 * (width-20))),(short)(yco - 44), + (short)(0.20 * (width-20)), 19, &cs->mode, 0.0, 0.0, 0, 0, + "Toggle collision on material or property"); + + if (cs->mode & SENS_COLLISION_MATERIAL) { + uiDefBut(block, TEX, 1, "Material:", (short)(xco + 10 + 0.40 * (width-20)), + (short)(yco-44), (short)(0.6*(width-20)), 19, &cs->materialName, 0, 31, 0, 0, + "Only look for Objects with this material"); + } else { + uiDefBut(block, TEX, 1, "Property:", (short)(xco + 10 + 0.40 * (width-20)), (short)(yco-44), + (short)(0.6*(width-20)), 19, &cs->name, 0, 31, 0, 0, + "Only look for Objects with this property"); + } + + /* uiDefButS(block, NUM, 1, "Damp:", xco+10+width-90,yco-24, 70, 19, &cs->damp, 0, 250, 0, 0, "For 'damp' time don't detect another collision"); */ + + yco-= ysize; + break; + } + case SENS_NEAR: + { + ysize= 72; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + draw_default_sensor_header(sens, block, xco, yco, width); + ns= sens->data; + + uiDefBut(block, TEX, 1, "Property:",(short)(10+xco),(short)(yco-44), (short)(width-20), 19, + &ns->name, 0, 31, 0, 0, "Only look for Objects with this property"); + uiDefButF(block, NUM, 1, "Dist",(short)(10+xco),(short)(yco-68),(short)((width-22)/2), 19, + &ns->dist, 0.0, 1000.0, 1000, 0, "Trigger distance"); + uiDefButF(block, NUM, 1, "Reset",(short)(10+xco+(width-22)/2), (short)(yco-68), (short)((width-22)/2), 19, + &ns->resetdist, 0.0, 1000.0, 1000, 0, "Reset distance"); + yco-= ysize; + break; + } + case SENS_RADAR: + { + ysize= 72; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + draw_default_sensor_header(sens, block, xco, yco, width); + + rs= sens->data; + + uiDefBut(block, TEX, 1, "Prop:", + (short)(10+xco),(short)(yco-44), (short)(0.7 * (width-20)), 19, + &rs->name, 0, 31, 0, 0, + "Only look for Objects with this property"); + + str = "Type %t|+X axis %x0|+Y axis %x1|+Z axis %x2|-X axis %x3|-Y axis %x4|-Z axis %x5"; + uiDefButS(block, MENU, B_REDR, str, + (short)(10+xco+0.7 * (width-20)), (short)(yco-44), (short)(0.3 * (width-22)), 19, + &rs->axis, 2.0, 31, 0, 0, + "Specify along which axis the radar cone is cast"); + + uiDefButF(block, NUM, 1, "Ang:", + (short)(10+xco), (short)(yco-68), (short)((width-20)/2), 19, + &rs->angle, 0.0, 179.9, 10, 0, + "Opening angle of the radar cone"); + uiDefButF(block, NUM, 1, "Dist:", + (short)(xco+10 + (width-20)/2), (short)(yco-68), (short)((width-20)/2), 19, + &rs->range, 0.01, 10000.0, 100, 0, + "Depth of the radar cone"); + yco-= ysize; + break; + } + case SENS_KEYBOARD: + { + ks= sens->data; + + /* 5 lines: 120 height */ + ysize= (ks->type&1) ? 96:120; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + /* header line */ + draw_default_sensor_header(sens, block, xco, yco, width); + + /* part of line 1 */ + uiDefBut(block, LABEL, 0, "Key", xco, yco-44, 40, 19, NULL, 0, 0, 0, 0, ""); + uiDefButBitS(block, TOG, 1, B_REDR, "All keys", xco+40+(width/2), yco-44, (width/2)-50, 19, + &ks->type, 0, 0, 0, 0, ""); + + + if ((ks->type&1)==0) { /* is All Keys option off? */ + /* line 2: hotkey and allkeys toggle */ + uiDefKeyevtButS(block, 0, "", xco+40, yco-44, (width)/2, 19, &ks->key, "Key code"); + + /* line 3: two key modifyers (qual1, qual2) */ + uiDefBut(block, LABEL, 0, "Hold", xco, yco-68, 40, 19, NULL, 0, 0, 0, 0, ""); + uiDefKeyevtButS(block, 0, "", xco+40, yco-68, (width-50)/2, 19, &ks->qual, "Modifier key code"); + uiDefKeyevtButS(block, 0, "", xco+40+(width-50)/2, yco-68, (width-50)/2, 19, &ks->qual2, "Second Modifier key code"); + } + + /* line 4: toggle property for string logging mode */ + uiDefBut(block, TEX, 1, "LogToggle: ", + xco+10, yco-((ks->type&1) ? 68:92), (width-20), 19, + ks->toggleName, 0, 31, 0, 0, + "Property that indicates whether to log " + "keystrokes as a string"); + + /* line 5: target property for string logging mode */ + uiDefBut(block, TEX, 1, "Target: ", + xco+10, yco-((ks->type&1) ? 92:116), (width-20), 19, + ks->targetName, 0, 31, 0, 0, + "Property that receives the keystrokes in case " + "a string is logged"); + + yco-= ysize; + break; + } + case SENS_PROPERTY: + { + ysize= 96; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, + (float)xco+width, (float)yco, 1); + + draw_default_sensor_header(sens, block, xco, yco, width); + ps= sens->data; + + str= "Type %t|Equal %x0|Not Equal %x1|Interval %x2|Changed %x3"; + /* str= "Type %t|Equal %x0|Not Equal %x1"; */ + uiDefButI(block, MENU, B_REDR, str, xco+30,yco-44,width-60, 19, + &ps->type, 0, 31, 0, 0, "Type"); + + if (ps->type != SENS_PROP_EXPRESSION) + { + uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-68,width-60, 19, + ps->name, 0, 31, 0, 0, "Property name"); + } + + if(ps->type == SENS_PROP_INTERVAL) + { + uiDefBut(block, TEX, 1, "Min: ", xco,yco-92,width/2, 19, + ps->value, 0, 31, 0, 0, "check for min value"); + uiDefBut(block, TEX, 1, "Max: ", xco+width/2,yco-92,width/2, 19, + ps->maxvalue, 0, 31, 0, 0, "check for max value"); + } + else if(ps->type == SENS_PROP_CHANGED); + else + { + uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-92,width-60, 19, + ps->value, 0, 31, 0, 0, "check for value"); + } + + yco-= ysize; + break; + } + case SENS_ACTUATOR: + { + ysize= 48; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, + (float)xco+width, (float)yco, 1); + + draw_default_sensor_header(sens, block, xco, yco, width); + as= sens->data; + + uiDefBut(block, TEX, 1, "Act: ", xco+30,yco-44,width-60, 19, + as->name, 0, 31, 0, 0, "Actuator name, actuator active state modifications will be detected"); + yco-= ysize; + break; + } + case SENS_DELAY: + { + ysize= 48; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, + (float)xco+width, (float)yco, 1); + + draw_default_sensor_header(sens, block, xco, yco, width); + ds = sens->data; + + uiDefButS(block, NUM, 0, "Delay",(short)(10+xco),(short)(yco-44),(short)((width-22)*0.4+10), 19, + &ds->delay, 0.0, 5000.0, 0, 0, "Delay in number of logic tics before the positive trigger (default 60 per second)"); + uiDefButS(block, NUM, 0, "Dur",(short)(10+xco+(width-22)*0.4+10),(short)(yco-44),(short)((width-22)*0.4-10), 19, + &ds->duration, 0.0, 5000.0, 0, 0, "If >0, delay in number of logic tics before the negative trigger following the positive trigger"); + uiDefButBitS(block, TOG, SENS_DELAY_REPEAT, 0, "REP",(short)(xco + 10 + (width-22)*0.8),(short)(yco - 44), + (short)(0.20 * (width-22)), 19, &ds->flag, 0.0, 0.0, 0, 0, + "Toggle repeat option. If selected, the sensor restarts after Delay+Dur logic tics"); + yco-= ysize; + break; + } + case SENS_MOUSE: + { + ms= sens->data; + /* Two lines: 48 pixels high. */ + ysize = 48; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + /* line 1: header */ + draw_default_sensor_header(sens, block, xco, yco, width); + + /* Line 2: type selection. The number are a bit mangled to get + * proper compatibility with older .blend files. */ + str= "Type %t|Left button %x1|Middle button %x2|" + "Right button %x4|Wheel Up %x5|Wheel Down %x6|Movement %x8|Mouse over %x16|Mouse over any%x32"; + uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, width-20, 19, + &ms->type, 0, 31, 0, 0, + "Specify the type of event this mouse sensor should trigger on"); + + yco-= ysize; + break; + } + case SENS_RANDOM: + { + ysize = 48; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + draw_default_sensor_header(sens, block, xco, yco, width); + randomSensor = sens->data; + /* some files were wrongly written, avoid crash now */ + if (randomSensor) + { + uiDefButI(block, NUM, 1, "Seed: ", xco+10,yco-44,(width-20), 19, + &randomSensor->seed, 0, 1000, 0, 0, + "Initial seed of the generator. (Choose 0 for not random)"); + } + yco-= ysize; + break; + } + case SENS_RAY: + { + ysize = 72; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + draw_default_sensor_header(sens, block, xco, yco, width); + raySens = sens->data; + + /* 1. property or material */ + uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P", + xco + 10,yco - 44, 0.20 * (width-20), 19, + &raySens->mode, 0.0, 0.0, 0, 0, + "Toggle collision on material or property"); + + if (raySens->mode & SENS_COLLISION_MATERIAL) + { + uiDefBut(block, TEX, 1, "Material:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19, + &raySens->matname, 0, 31, 0, 0, + "Only look for Objects with this material"); + } + else + { + uiDefBut(block, TEX, 1, "Property:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19, + &raySens->propname, 0, 31, 0, 0, + "Only look for Objects with this property"); + } + + /* X-Ray option */ + uiDefButBitS(block, TOG, SENS_RAY_XRAY, 1, "X", + xco + 10,yco - 68, 0.10 * (width-20), 19, + &raySens->mode, 0.0, 0.0, 0, 0, + "Toggle X-Ray option (see through objects that don't have the property)"); + /* 2. sensing range */ + uiDefButF(block, NUM, 1, "Range", xco+10 + 0.10 * (width-20), yco-68, 0.5 * (width-20), 19, + &raySens->range, 0.01, 10000.0, 100, 0, + "Sense objects no farther than this distance"); + + /* 3. axis choice */ + str = "Type %t|+ X axis %x1|+ Y axis %x0|+ Z axis %x2|- X axis %x3|- Y axis %x4|- Z axis %x5"; + uiDefButI(block, MENU, B_REDR, str, xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19, + &raySens->axisflag, 2.0, 31, 0, 0, + "Specify along which axis the ray is cast"); + + yco-= ysize; + break; + } + case SENS_MESSAGE: + { + mes = sens->data; + ysize = 2 * 24; /* total number of lines * 24 pixels/line */ + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, + (float)xco+width, (float)yco, 1); + + /* line 1: header line */ + draw_default_sensor_header(sens, block, xco, yco, width); + + /* line 2: Subject filter */ + uiDefBut(block, TEX, 1, "Subject: ", + (xco+10), (yco-44), (width-20), 19, + mes->subject, 0, 31, 0, 0, + "Optional subject filter: only accept messages with this subject" + ", or empty for all"); + + yco -= ysize; + break; + } + case SENS_JOYSTICK: + { + + ysize = 72; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + /* line 1: header */ + draw_default_sensor_header(sens, block, xco, yco, width); + + joy= sens->data; + + uiDefButC(block, NUM, 1, "Index:", xco+10, yco-44, 0.33 * (width-20), 19, + &joy->joyindex, 0, SENS_JOY_MAXINDEX-1, 100, 0, + "Specify which joystick to use"); + + str= "Type %t|Button %x0|Axis %x1|Single Axis %x3|Hat%x2"; + uiDefButC(block, MENU, B_REDR, str, xco+87, yco-44, 0.26 * (width-20), 19, + &joy->type, 0, 31, 0, 0, + "The type of event this joystick sensor is triggered on"); + + if (joy->type != SENS_JOY_AXIS_SINGLE) { + if (joy->flag & SENS_JOY_ANY_EVENT) { + switch (joy->type) { + case SENS_JOY_AXIS: + str = "All Axis Events"; + break; + case SENS_JOY_BUTTON: + str = "All Button Events"; + break; + default: + str = "All Hat Events"; + break; + } + } else { + str = "All"; + } + + uiDefButBitS(block, TOG, SENS_JOY_ANY_EVENT, B_REDR, str, + xco+10 + 0.475 * (width-20), yco-68, ((joy->flag & SENS_JOY_ANY_EVENT) ? 0.525 : 0.12) * (width-20), 19, + &joy->flag, 0, 0, 0, 0, + "Triggered by all events on this joysticks current type (axis/button/hat)"); + } + if(joy->type == SENS_JOY_BUTTON) + { + if ((joy->flag & SENS_JOY_ANY_EVENT)==0) { + uiDefButI(block, NUM, 1, "Number:", xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19, + &joy->button, 0, 18, 100, 0, + "Specify which button to use"); + } + } + else if(joy->type == SENS_JOY_AXIS) + { + uiDefButS(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19, + &joy->axis, 1, 8.0, 100, 0, + "Specify which axis pair to use, 1 is useually the main direction input"); + + uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20),yco-44, 0.4 * (width-20), 19, + &joy->precision, 0, 32768.0, 100, 0, + "Specify the precision of the axis"); + + if ((joy->flag & SENS_JOY_ANY_EVENT)==0) { + str = "Type %t|Up Axis %x1 |Down Axis %x3|Left Axis %x2|Right Axis %x0"; + uiDefButI(block, MENU, B_REDR, str, xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19, + &joy->axisf, 2.0, 31, 0, 0, + "The direction of the axis, use 'All Events' to recieve events on any direction"); + } + } + else if (joy->type == SENS_JOY_HAT) + { + uiDefButI(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19, + &joy->hat, 1, 4.0, 100, 0, + "Specify which hat to use"); + + if ((joy->flag & SENS_JOY_ANY_EVENT)==0) { + str = "Direction%t|Up%x1|Down%x4|Left%x8|Right%x2|%l|Up/Right%x3|Down/Left%x12|Up/Left%x9|Down/Right%x6"; + uiDefButI(block, MENU, 0, str, xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19, + &joy->hatf, 2.0, 31, 0, 0, + "The direction of the hat, use 'All Events' to recieve events on any direction"); + } + } + else { /* (joy->type == SENS_JOY_AXIS_SINGLE)*/ + uiDefButS(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19, + &joy->axis_single, 1, 16.0, 100, 0, + "Specify a single axis (verticle/horizontal/other) to detect"); + + uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20),yco-44, 0.4 * (width-20), 19, + &joy->precision, 0, 32768.0, 100, 0, + "Specify the precision of the axis"); + } + yco-= ysize; + break; + } + } + + return yco-4; +} + + + +static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco, short yco, short width) +{ + bExpressionCont *ec; + bPythonCont *pc; + short ysize; + + switch (cont->type) { + case CONT_EXPRESSION: + ysize= 28; + + UI_ThemeColor(TH_PANEL); + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + /* uiDefBut(block, LABEL, 1, "Not yet...", xco,yco-24,80, 19, NULL, 0, 0, 0, 0, ""); */ + ec= cont->data; + /* uiDefBut(block, BUT, 1, "Variables", xco,yco-24,80, 19, NULL, 0, 0, 0, 0, "Available variables for expression"); */ + uiDefBut(block, TEX, 1, "Exp:", xco + 10 , yco-21, width-20, 19, + ec->str, 0, 127, 0, 0, + "Expression"); + + yco-= ysize; + break; + case CONT_PYTHON: + ysize= 28; + + if(cont->data==NULL) init_controller(cont); + pc= cont->data; + + UI_ThemeColor(TH_PANEL); + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + + uiBlockBeginAlign(block); + uiDefButI(block, MENU, B_REDR, "Execution Method%t|Script%x0|Module%x1", xco+4,yco-23, 66, 19, &pc->mode, 0, 0, 0, 0, "Python script type (textblock or module - faster)"); + if(pc->mode==0) + uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "", xco+70,yco-23,width-74, 19, &pc->text, "Blender textblock to run as a script"); + else { + uiDefBut(block, TEX, 1, "", xco+70,yco-23,(width-70)-25, 19, pc->module, 0, 63, 0, 0, "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used"); + uiDefButBitI(block, TOG, CONT_PY_DEBUG, B_REDR, "D", (xco+width)-25, yco-23, 19, 19, &pc->flag, 0, 0, 0, 0, "Continuously reload the module from disk for editing external modules without restarting"); + } + uiBlockEndAlign(block); + + yco-= ysize; + break; + + default: + ysize= 4; + + UI_ThemeColor(TH_PANEL); + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + yco-= ysize; + } + + return yco; +} + +static int get_col_actuator(int type) +{ + switch(type) { + case ACT_ACTION: return TH_PANEL; + case ACT_SHAPEACTION: return TH_PANEL; + case ACT_OBJECT: return TH_PANEL; + case ACT_IPO: return TH_PANEL; + case ACT_PROPERTY: return TH_PANEL; + case ACT_SOUND: return TH_PANEL; + case ACT_CD: return TH_PANEL; + case ACT_CAMERA: return TH_PANEL; + case ACT_EDIT_OBJECT: return TH_PANEL; + case ACT_GROUP: return TH_PANEL; + case ACT_RANDOM: return TH_PANEL; + case ACT_SCENE: return TH_PANEL; + case ACT_MESSAGE: return TH_PANEL; + case ACT_GAME: return TH_PANEL; + case ACT_VISIBILITY: return TH_PANEL; + case ACT_CONSTRAINT: return TH_PANEL; + case ACT_STATE: return TH_PANEL; + default: return TH_PANEL; + } +} +static void set_col_actuator(int item, int medium) +{ + int col= get_col_actuator(item); + UI_ThemeColorShade(col, medium?30:10); + +} + +static void change_object_actuator(bContext *C, void *act, void *arg) +{ + bObjectActuator *oa = act; + + if (oa->type != oa->otype) { + switch (oa->type) { + case ACT_OBJECT_NORMAL: + memset(oa, 0, sizeof(bObjectActuator)); + oa->flag = ACT_FORCE_LOCAL|ACT_TORQUE_LOCAL|ACT_DLOC_LOCAL|ACT_DROT_LOCAL; + oa->type = ACT_OBJECT_NORMAL; + break; + + case ACT_OBJECT_SERVO: + memset(oa, 0, sizeof(bObjectActuator)); + oa->flag = ACT_LIN_VEL_LOCAL; + oa->type = ACT_OBJECT_SERVO; + oa->forcerot[0] = 30.0f; + oa->forcerot[1] = 0.5f; + oa->forcerot[2] = 0.0f; + break; + } + } +} + +static void change_ipo_actuator(bContext *C, void *arg1_but, void *arg2_ia) +{ + bIpoActuator *ia = arg2_ia; + uiBut *but = arg1_but; + + if (but->retval & ACT_IPOFORCE) + ia->flag &= ~ACT_IPOADD; + else if (but->retval & ACT_IPOADD) + ia->flag &= ~ACT_IPOFORCE; + but->retval = B_REDR; +} + +void update_object_actuator_PID(bContext *C, void *act, void *arg) +{ + bObjectActuator *oa = act; + oa->forcerot[0] = 60.0f*oa->forcerot[1]; +} + +char *get_state_name(Object *ob, short bit) +{ + bController *cont; + unsigned int mask; + + mask = (1<controllers.first; + while (cont) { + if (cont->state_mask & mask) { + return cont->name; + } + cont = cont->next; + } + return (char*)""; +} + +static void check_state_mask(bContext *C, void *arg1_but, void *arg2_mask) +{ + int shift= 0; // XXX + unsigned int *cont_mask = arg2_mask; + uiBut *but = arg1_but; + + if (*cont_mask == 0 || !(shift)) + *cont_mask = (1<retval); + but->retval = B_REDR; +} + +static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, short xco, short yco, short width) +{ + bSoundActuator *sa = NULL; + bCDActuator *cda = NULL; + bObjectActuator *oa = NULL; + bIpoActuator *ia = NULL; + bPropertyActuator *pa = NULL; + bCameraActuator *ca = NULL; + bEditObjectActuator *eoa = NULL; + bConstraintActuator *coa = NULL; + bSceneActuator *sca = NULL; + bGroupActuator *ga = NULL; + bRandomActuator *randAct = NULL; + bMessageActuator *ma = NULL; + bActionActuator *aa = NULL; + bGameActuator *gma = NULL; + bVisibilityActuator *visAct = NULL; + bTwoDFilterActuator *tdfa = NULL; + bParentActuator *parAct = NULL; + bStateActuator *staAct = NULL; + + float *fp; + short ysize = 0, wval; + char *str; + int myline, stbit; + uiBut *but; + + + /* yco is at the top of the rect, draw downwards */ + set_col_actuator(act->type, 0); + + switch (act->type) + { + case ACT_OBJECT: + { + oa = act->data; + wval = (width-100)/3; + if (oa->type == ACT_OBJECT_NORMAL) + { + if ( ob->gameflag & OB_DYNAMIC ) + { + ysize= 175; + } + else + { + ysize= 72; + } + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + uiBlockBeginAlign(block); + uiDefBut(block, LABEL, 0, "Loc", xco, yco-45, 45, 19, NULL, 0, 0, 0, 0, "Sets the location"); + uiDefButF(block, NUM, 0, "", xco+45, yco-45, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-45, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-45, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, ""); + uiBlockEndAlign(block); + + uiDefBut(block, LABEL, 0, "Rot", xco, yco-64, 45, 19, NULL, 0, 0, 0, 0, "Sets the rotation"); + uiBlockBeginAlign(block); + uiDefButF(block, NUM, 0, "", xco+45, yco-64, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-64, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-64, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, ""); + uiBlockEndAlign(block); + + uiDefButBitS(block, TOG, ACT_DLOC_LOCAL, 0, "L", xco+45+3*wval, yco-45, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_DROT_LOCAL, 0, "L", xco+45+3*wval, yco-64, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + + if ( ob->gameflag & OB_DYNAMIC ) + { + uiDefBut(block, LABEL, 0, "Force", xco, yco-87, 55, 19, NULL, 0, 0, 0, 0, "Sets the force"); + uiBlockBeginAlign(block); + uiDefButF(block, NUM, 0, "", xco+45, yco-87, wval, 19, oa->forceloc, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-87, wval, 19, oa->forceloc+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-87, wval, 19, oa->forceloc+2, -10000.0, 10000.0, 10, 0, ""); + uiBlockEndAlign(block); + + uiDefBut(block, LABEL, 0, "Torque", xco, yco-106, 55, 19, NULL, 0, 0, 0, 0, "Sets the torque"); + uiBlockBeginAlign(block); + uiDefButF(block, NUM, 0, "", xco+45, yco-106, wval, 19, oa->forcerot, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-106, wval, 19, oa->forcerot+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-106, wval, 19, oa->forcerot+2, -10000.0, 10000.0, 10, 0, ""); + uiBlockEndAlign(block); + } + + if ( ob->gameflag & OB_DYNAMIC ) + { + uiDefBut(block, LABEL, 0, "LinV", xco, yco-129, 45, 19, NULL, 0, 0, 0, 0, "Sets the linear velocity"); + uiBlockBeginAlign(block); + uiDefButF(block, NUM, 0, "", xco+45, yco-129, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-129, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-129, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, ""); + uiBlockEndAlign(block); + + uiDefBut(block, LABEL, 0, "AngV", xco, yco-148, 45, 19, NULL, 0, 0, 0, 0, "Sets the angular velocity"); + uiBlockBeginAlign(block); + uiDefButF(block, NUM, 0, "", xco+45, yco-148, wval, 19, oa->angularvelocity, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-148, wval, 19, oa->angularvelocity+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-148, wval, 19, oa->angularvelocity+2, -10000.0, 10000.0, 10, 0, ""); + uiBlockEndAlign(block); + + uiDefBut(block, LABEL, 0, "Damp", xco, yco-171, 45, 19, NULL, 0, 0, 0, 0, "Number of frames to reach the target velocity"); + uiDefButS(block, NUM, 0, "", xco+45, yco-171, wval, 19, &oa->damping, 0.0, 1000.0, 100, 0, ""); + + uiDefButBitS(block, TOG, ACT_FORCE_LOCAL, 0, "L", xco+45+3*wval, yco-87, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_TORQUE_LOCAL, 0, "L", xco+45+3*wval, yco-106, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-129, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + uiDefButBitS(block, TOG, ACT_ANG_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-148, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); + + uiDefButBitS(block, TOG, ACT_ADD_LIN_VEL, 0, "add",xco+45+3*wval+15, yco-129, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV"); + } + } else if (oa->type == ACT_OBJECT_SERVO) + { + ysize= 195; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + uiDefBut(block, LABEL, 0, "Ref", xco, yco-45, 45, 19, NULL, 0, 0, 0, 0, ""); + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+45, yco-45, wval*3, 19, &(oa->reference), "Reference object for velocity calculation, leave empty for world reference"); + uiDefBut(block, LABEL, 0, "linV", xco, yco-68, 45, 19, NULL, 0, 0, 0, 0, "Sets the target relative linear velocity, it will be achieved by automatic application of force. Null velocity is a valid target"); + uiBlockBeginAlign(block); + uiDefButF(block, NUM, 0, "", xco+45, yco-68, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-68, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-68, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, ""); + uiBlockEndAlign(block); + uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-68, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Velocity is defined in local coordinates"); + + uiDefBut(block, LABEL, 0, "Limit", xco, yco-91, 45, 19, NULL, 0, 0, 0, 0, "Select if the force needs to be limited along certain axis (local or global depending on LinV Local flag)"); + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_X, B_REDR, "X", xco+45, yco-91, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the X axis"); + uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_Y, B_REDR, "Y", xco+45+wval, yco-91, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the Y axis"); + uiDefButBitS(block, TOG, ACT_SERVO_LIMIT_Z, B_REDR, "Z", xco+45+2*wval, yco-91, wval, 19, &oa->flag, 0.0, 0.0, 0, 0, "Set limit to force along the Z axis"); + uiBlockEndAlign(block); + uiDefBut(block, LABEL, 0, "Max", xco, yco-110, 45, 19, NULL, 0, 0, 0, 0, "Set the upper limit for force"); + uiDefBut(block, LABEL, 0, "Min", xco, yco-129, 45, 19, NULL, 0, 0, 0, 0, "Set the lower limit for force"); + if (oa->flag & ACT_SERVO_LIMIT_X) { + uiDefButF(block, NUM, 0, "", xco+45, yco-110, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45, yco-129, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, ""); + } + if (oa->flag & ACT_SERVO_LIMIT_Y) { + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-110, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-129, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, ""); + } + if (oa->flag & ACT_SERVO_LIMIT_Z) { + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-110, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-129, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, ""); + } + uiDefBut(block, LABEL, 0, "Servo", xco, yco-152, 45, 19, NULL, 0, 0, 0, 0, "Coefficients of the PID servo controller"); + uiDefButF(block, NUMSLI, B_REDR, "P: ", xco+45, yco-152, wval*3, 19, oa->forcerot, 0.00, 200.0, 100, 0, "Proportional coefficient, typical value is 60x Integral coefficient"); + uiDefBut(block, LABEL, 0, "Slow", xco, yco-171, 45, 19, NULL, 0, 0, 0, 0, "Low value of I coefficient correspond to slow response"); + but = uiDefButF(block, NUMSLI, B_REDR, " I : ", xco+45, yco-171, wval*3, 19, oa->forcerot+1, 0.0, 3.0, 1, 0, "Integral coefficient, low value (0.01) for slow response, high value (0.5) for fast response"); + uiButSetFunc(but, update_object_actuator_PID, oa, NULL); + uiDefBut(block, LABEL, 0, "Fast", xco+45+3*wval, yco-171, 45, 19, NULL, 0, 0, 0, 0, "High value of I coefficient correspond to fast response"); + uiDefButF(block, NUMSLI, B_REDR, "D: ", xco+45, yco-190, wval*3, 19, oa->forcerot+2, -100.0, 100.0, 100, 0, "Derivate coefficient, not required, high values can cause instability"); + } + str= "Motion Type %t|Simple motion %x0|Servo Control %x1"; + but = uiDefButS(block, MENU, B_REDR, str, xco+40, yco-23, (width-80), 19, &oa->type, 0.0, 0.0, 0, 0, ""); + oa->otype = oa->type; + uiButSetFunc(but, change_object_actuator, oa, NULL); + yco-= ysize; + break; + } + case ACT_ACTION: + case ACT_SHAPEACTION: + { + /* DrawAct */ +#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR + ysize = 112; +#else + ysize= 92; +#endif + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + aa = act->data; + wval = (width-60)/3; + + // str= "Action types %t|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6"; +#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR + str= "Action types %t|Play %x0|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6|Displacement %x7"; +#else + str= "Action types %t|Play %x0|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6"; +#endif + uiDefButS(block, MENU, B_REDR, str, xco+10, yco-24, width/3, 19, &aa->type, 0.0, 0.0, 0.0, 0.0, "Action playback type"); + uiDefIDPoinBut(block, test_actionpoin_but, ID_AC, 1, "AC: ", xco+10+ (width/3), yco-24, ((width/3)*2) - (20 + 60), 19, &aa->act, "Action name"); + + uiDefButBitS(block, TOGN, 1, 0, "Continue", xco+((width/3)*2)+20, yco-24, 60, 19, + &aa->end_reset, 0.0, 0.0, 0, 0, "Restore last frame when switching on/off, otherwise play from the start each time"); + + + if(aa->type == ACT_ACTION_FROM_PROP) + { + uiDefBut(block, TEX, 0, "Prop: ",xco+10, yco-44, width-20, 19, aa->name, 0.0, 31.0, 0, 0, "Use this property to define the Action position"); + } + else + { + uiDefButI(block, NUM, 0, "Sta: ",xco+10, yco-44, (width-20)/2, 19, &aa->sta, 1.0, MAXFRAMEF, 0, 0, "Start frame"); + uiDefButI(block, NUM, 0, "End: ",xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &aa->end, 1.0, MAXFRAMEF, 0, 0, "End frame"); + } + + uiDefButS(block, NUM, 0, "Blendin: ", xco+10, yco-64, (width-20)/2, 19, &aa->blendin, 0.0, 32767, 0.0, 0.0, "Number of frames of motion blending"); + uiDefButS(block, NUM, 0, "Priority: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, &aa->priority, 0.0, 100.0, 0.0, 0.0, "Execution priority - lower numbers will override actions with higher numbers, With 2 or more actions at once, the overriding channels must be lower in the stack"); + + uiDefBut(block, TEX, 0, "FrameProp: ",xco+10, yco-84, width-20, 19, aa->frameProp, 0.0, 31.0, 0, 0, "Assign the action's current frame number to this property"); + + +#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR + if(aa->type == ACT_ACTION_MOTION) + { + uiDefButF(block, NUM, 0, "Cycle: ",xco+30, yco-84, (width-60)/2, 19, &aa->stridelength, 0.0, 2500.0, 0, 0, "Distance covered by a single cycle of the action"); + } +#endif + + + + yco-=ysize; + break; + } + case ACT_IPO: + { + ia= act->data; + + ysize= 72; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + str = "Ipo types %t|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6"; + + uiDefButS(block, MENU, B_REDR, str, xco+10, yco-24, (width-20)/2, 19, &ia->type, 0, 0, 0, 0, ""); + + but = uiDefButBitS(block, TOG, ACT_IPOFORCE, ACT_IPOFORCE, + "Force", xco+10+(width-20)/2, yco-24, (width-20)/4-10, 19, + &ia->flag, 0, 0, 0, 0, + "Apply Ipo as a global or local force depending on the local option (dynamic objects only)"); + uiButSetFunc(but, change_ipo_actuator, but, ia); + + but = uiDefButBitS(block, TOG, ACT_IPOADD, ACT_IPOADD, + "Add", xco+3*(width-20)/4, yco-24, (width-20)/4-10, 19, + &ia->flag, 0, 0, 0, 0, + "Ipo is added to the current loc/rot/scale in global or local coordinate according to Local flag"); + uiButSetFunc(but, change_ipo_actuator, but, ia); + + /* Only show the do-force-local toggle if force is requested */ + if (ia->flag & (ACT_IPOFORCE|ACT_IPOADD)) { + uiDefButBitS(block, TOG, ACT_IPOLOCAL, 0, + "L", xco+width-30, yco-24, 20, 19, + &ia->flag, 0, 0, 0, 0, + "Let the ipo acts in local coordinates, used in Force and Add mode"); + } + + if(ia->type==ACT_IPO_FROM_PROP) { + uiDefBut(block, TEX, 0, + "Prop: ", xco+10, yco-44, width-80, 19, + ia->name, 0.0, 31.0, 0, 0, + "Use this property to define the Ipo position"); + } + else { + uiDefButI(block, NUM, 0, + "Sta", xco+10, yco-44, (width-80)/2, 19, + &ia->sta, 1.0, MAXFRAMEF, 0, 0, + "Start frame"); + uiDefButI(block, NUM, 0, + "End", xco+10+(width-80)/2, yco-44, (width-80)/2, 19, + &ia->end, 1.0, MAXFRAMEF, 0, 0, + "End frame"); + } + uiDefButBitS(block, TOG, ACT_IPOCHILD, B_REDR, + "Child", xco+10+(width-80), yco-44, 60, 19, + &ia->flag, 0, 0, 0, 0, + "Update IPO on all children Objects as well"); + uiDefBut(block, TEX, 0, + "FrameProp: ", xco+10, yco-64, width-20, 19, + ia->frameProp, 0.0, 31.0, 0, 0, + "Assign the action's current frame number to this property"); + + yco-= ysize; + break; + } + case ACT_PROPERTY: + { + ysize= 68; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + pa= act->data; + + str= "Type%t|Assign%x0|Add %x1|Copy %x2|Toggle (bool/int/float/timer)%x3"; + uiDefButI(block, MENU, B_REDR, str, xco+30,yco-24,width-60, 19, &pa->type, 0, 31, 0, 0, "Type"); + + uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-44,width-60, 19, pa->name, 0, 31, 0, 0, "Property name"); + + + if(pa->type==ACT_PROP_TOGGLE) { + /* no ui */ + ysize -= 22; + } + else if(pa->type==ACT_PROP_COPY) { + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-64, (width-20)/2, 19, &(pa->ob), "Copy from this Object"); + uiDefBut(block, TEX, 1, "Prop: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, pa->value, 0, 31, 0, 0, "Copy this property"); + } + else { + uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-64,width-60, 19, pa->value, 0, 31, 0, 0, "change with this value, use \"\" around strings"); + } + yco-= ysize; + + break; + } + case ACT_SOUND: + { + ysize = 70; + + sa = act->data; + sa->sndnr = 0; + + wval = (width-20)/2; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + if(G.main->sound.first) { + IDnames_to_pupstring(&str, "Sound files", NULL, &(G.main->sound), (ID *)sa->sound, &(sa->sndnr)); + /* reset this value, it is for handling the event */ + sa->sndnr = 0; + uiDefButS(block, MENU, B_SOUNDACT_BROWSE, str, xco+10,yco-22,20,19, &(sa->sndnr), 0, 0, 0, 0, ""); + + if(sa->sound) { + char dummy_str[] = "Sound mode %t|Play Stop %x0|Play End %x1|Loop Stop %x2|Loop End %x3|Loop Ping Pong Stop %x5|Loop Ping Pong %x4"; + uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,width-40,19, sa->sound->id.name+2, 0.0, 21.0, 0, 0, ""); + uiDefButS(block, MENU, 1, dummy_str,xco+10,yco-44,width-20, 19, &sa->type, 0.0, 0.0, 0, 0, ""); + uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-66,wval, 19, &sa->sound->volume, 0.0, 1.0, 0, 0, "Sets the volume of this sound"); + uiDefButF(block, NUM, 0, "Pitch:",xco+wval+10,yco-66,wval, 19, &sa->sound->pitch,-12.0, 12.0, 0, 0, "Sets the pitch of this sound"); + } + MEM_freeN(str); + } + else { + uiDefBut(block, LABEL, 0, "Use Sound window (F10) to load samples", xco, yco-24, width, 19, NULL, 0, 0, 0, 0, ""); + } + + yco-= ysize; + + break; + } + case ACT_CD: + { + char cd_type_str[] = "Sound mode %t|Play all tracks %x0|Play one track %x1|" + "Volume %x3|Stop %x4|Pause %x5|Resume %x6"; + cda = act->data; + + if (cda) { + if (cda->track == 0) { + cda->track = 1; + cda->volume = 1; + cda->type = ACT_CD_PLAY_ALL; + } + + if (cda->type == ACT_CD_PLAY_TRACK || cda->type == ACT_CD_LOOP_TRACK) { + ysize = 48; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + uiDefButS(block, NUM, 0, "Track:", xco+10,yco-44,width-20, 19, &cda->track, 1, 99, 0, 0, "Select the track to be played"); + } + else if (cda->type == ACT_CD_VOLUME) { + ysize = 48; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-44,width-20, 19, &cda->volume, 0, 1, 0, 0, "Set the volume for CD playback"); + } + else { + ysize = 28; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + } + uiDefButS(block, MENU, B_REDR, cd_type_str,xco+10,yco-22,width-20, 19, &cda->type, 0.0, 0.0, 0, 0, ""); + } + yco-= ysize; + break; + } + case ACT_CAMERA: + + ysize= 48; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + ca= act->data; + + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-24, (width-20)/2, 19, &(ca->ob), "Look at this Object"); + uiDefButF(block, NUM, 0, "Height:", xco+10+(width-20)/2, yco-24, (width-20)/2, 19, &ca->height, 0.0, 20.0, 0, 0, ""); + + uiDefButF(block, NUM, 0, "Min:", xco+10, yco-44, (width-60)/2, 19, &ca->min, 0.0, 20.0, 0, 0, ""); + + if(ca->axis==0) ca->axis= 'x'; + uiDefButS(block, ROW, 0, "X", xco+10+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'x', 0, 0, "Camera tries to get behind the X axis"); + uiDefButS(block, ROW, 0, "Y", xco+30+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'y', 0, 0, "Camera tries to get behind the Y axis"); + + uiDefButF(block, NUM, 0, "Max:", xco+20+(width)/2, yco-44, (width-60)/2, 19, &ca->max, 0.0, 20.0, 0, 0, ""); + + yco-= ysize; + + break; + + case ACT_EDIT_OBJECT: + + eoa= act->data; + + if(eoa->type==ACT_EDOB_ADD_OBJECT) { + int wval; /* just a temp width */ + ysize = 92; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-44, (width-20)/2, 19, &(eoa->ob), "Add this Object and all its children (cant be on an visible layer)"); + uiDefButI(block, NUM, 0, "Time:", xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &eoa->time, 0.0, 2000.0, 0, 0, "Duration the new Object lives"); + + wval= (width-60)/3; + uiDefBut(block, LABEL, 0, "linV", xco, yco-68, 45, 19, + NULL, 0, 0, 0, 0, + "Velocity upon creation"); + uiDefButF(block, NUM, 0, "", xco+45, yco-68, wval, 19, + eoa->linVelocity, -100.0, 100.0, 10, 0, + "Velocity upon creation, x component"); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-68, wval, 19, + eoa->linVelocity+1, -100.0, 100.0, 10, 0, + "Velocity upon creation, y component"); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-68, wval, 19, + eoa->linVelocity+2, -100.0, 100.0, 10, 0, + "Velocity upon creation, z component"); + uiDefButBitS(block, TOG, ACT_EDOB_LOCAL_LINV, 0, "L", xco+45+3*wval, yco-68, 15, 19, + &eoa->localflag, 0.0, 0.0, 0, 0, + "Apply the transformation locally"); + + + uiDefBut(block, LABEL, 0, "AngV", xco, yco-90, 45, 19, + NULL, 0, 0, 0, 0, + "Angular velocity upon creation"); + uiDefButF(block, NUM, 0, "", xco+45, yco-90, wval, 19, + eoa->angVelocity, -10000.0, 10000.0, 10, 0, + "Angular velocity upon creation, x component"); + uiDefButF(block, NUM, 0, "", xco+45+wval, yco-90, wval, 19, + eoa->angVelocity+1, -10000.0, 10000.0, 10, 0, + "Angular velocity upon creation, y component"); + uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-90, wval, 19, + eoa->angVelocity+2, -10000.0, 10000.0, 10, 0, + "Angular velocity upon creation, z component"); + uiDefButBitS(block, TOG, ACT_EDOB_LOCAL_ANGV, 0, "L", xco+45+3*wval, yco-90, 15, 19, + &eoa->localflag, 0.0, 0.0, 0, 0, + "Apply the rotation locally"); + + + } + else if(eoa->type==ACT_EDOB_END_OBJECT) { + ysize= 28; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + } + else if(eoa->type==ACT_EDOB_REPLACE_MESH) { + ysize= 48; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + uiDefIDPoinBut(block, test_meshpoin_but, ID_ME, 1, "ME:", xco+40, yco-44, (width-80), 19, &(eoa->me), "replace the existing mesh with this one"); + } + else if(eoa->type==ACT_EDOB_TRACK_TO) { + ysize= 48; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-44, (width-20)/2, 19, &(eoa->ob), "Track to this Object"); + uiDefButI(block, NUM, 0, "Time:", xco+10+(width-20)/2, yco-44, (width-20)/2-40, 19, &eoa->time, 0.0, 2000.0, 0, 0, "Duration the tracking takes"); + uiDefButS(block, TOG, 0, "3D", xco+width-50, yco-44, 40, 19, &eoa->flag, 0.0, 0.0, 0, 0, "Enable 3D tracking"); + } + else if(eoa->type==ACT_EDOB_DYNAMICS) { + ysize= 69; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + str= "Dynamic Operation %t|Restore Dynamics %x0|Suspend Dynamics %x1|Enable Rigid Body %x2|Disable Rigid Body %x3|Set Mass %x4"; + uiDefButS(block, MENU, B_REDR, str, xco+40, yco-44, (width-80), 19, &(eoa->dyn_operation), 0.0, 0.0, 0, 0, ""); + if(eoa->dyn_operation==4) { + uiDefButF(block, NUM, 0, "", xco+40, yco-63, width-80, 19, + &eoa->mass, 0.0, 10000.0, 10, 0, + "Mass for object"); + } + } + str= "Edit Object %t|Add Object %x0|End Object %x1|Replace Mesh %x2|Track to %x3|Dynamics %x4"; + uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &eoa->type, 0.0, 0.0, 0, 0, ""); + + yco-= ysize; + + break; + + case ACT_CONSTRAINT: + coa= act->data; + + if (coa->type == ACT_CONST_TYPE_LOC) { + ysize= 69; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + /* str= "Limit %t|None %x0|Loc X %x1|Loc Y %x2|Loc Z %x4|Rot X %x8|Rot Y %x16|Rot Z %x32"; */ + /* coa->flag &= ~(63); */ + str= "Limit %t|None %x0|Loc X %x1|Loc Y %x2|Loc Z %x4"; + coa->flag &= 7; + coa->time = 0; + uiDefButS(block, MENU, 1, str, xco+10, yco-65, 70, 19, &coa->flag, 0.0, 0.0, 0, 0, ""); + + uiDefButS(block, NUM, 0, "damp", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, "Damping factor: time constant (in frame) of low pass filter"); + uiDefBut(block, LABEL, 0, "Min", xco+80, yco-45, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "Max", xco+80+(width-90)/2, yco-45, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, ""); + + if(coa->flag & ACT_CONST_LOCX) fp= coa->minloc; + else if(coa->flag & ACT_CONST_LOCY) fp= coa->minloc+1; + else if(coa->flag & ACT_CONST_LOCZ) fp= coa->minloc+2; + else if(coa->flag & ACT_CONST_ROTX) fp= coa->minrot; + else if(coa->flag & ACT_CONST_ROTY) fp= coa->minrot+1; + else fp= coa->minrot+2; + + uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-90)/2, 19, fp, -2000.0, 2000.0, 10, 0, ""); + uiDefButF(block, NUM, 0, "", xco+80+(width-90)/2, yco-65, (width-90)/2, 19, fp+3, -2000.0, 2000.0, 10, 0, ""); + } else if (coa->type == ACT_CONST_TYPE_DIST) { + ysize= 106; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + str= "Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4|-X axis %x8|-Y axis %x16|-Z axis %x32"; + uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, &coa->mode, 0.0, 0.0, 0, 0, "Set the direction of the ray"); + + uiDefButS(block, NUM, 0, "damp", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, "Damping factor: time constant (in frame) of low pass filter"); + uiDefBut(block, LABEL, 0, "Range", xco+80, yco-45, (width-115)/2, 19, NULL, 0.0, 0.0, 0, 0, "Set the maximum length of ray"); + uiDefButBitS(block, TOG, ACT_CONST_DISTANCE, B_REDR, "Dist", xco+80+(width-115)/2, yco-45, (width-115)/2, 19, &coa->flag, 0.0, 0.0, 0, 0, "Force distance of object to point of impact of ray"); + uiDefButBitS(block, TOG, ACT_CONST_LOCAL, 0, "L", xco+80+(width-115), yco-45, 25, 19, + &coa->flag, 0.0, 0.0, 0, 0, "Set ray along object's axis or global axis"); + + if(coa->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= coa->minloc; + else if(coa->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= coa->minloc+1; + else fp= coa->minloc+2; + + uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-115)/2, 19, fp+3, 0.0, 2000.0, 10, 0, "Maximum length of ray"); + if (coa->flag & ACT_CONST_DISTANCE) + uiDefButF(block, NUM, 0, "", xco+80+(width-115)/2, yco-65, (width-115)/2, 19, fp, -2000.0, 2000.0, 10, 0, "Keep this distance to target"); + uiDefButBitS(block, TOG, ACT_CONST_NORMAL, 0, "N", xco+80+(width-115), yco-65, 25, 19, + &coa->flag, 0.0, 0.0, 0, 0, "Set object axis along (local axis) or parallel (global axis) to the normal at hit position"); + uiDefButBitS(block, TOG, ACT_CONST_MATERIAL, B_REDR, "M/P", xco+10, yco-84, 40, 19, + &coa->flag, 0.0, 0.0, 0, 0, "Detect material instead of property"); + if (coa->flag & ACT_CONST_MATERIAL) + { + uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19, + coa->matprop, 0, 31, 0, 0, + "Ray detects only Objects with this material"); + } + else + { + uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19, + coa->matprop, 0, 31, 0, 0, + "Ray detect only Objects with this property"); + } + uiDefButBitS(block, TOG, ACT_CONST_PERMANENT, 0, "PER", xco+10, yco-103, 40, 19, + &coa->flag, 0.0, 0.0, 0, 0, "Persistent actuator: stays active even if ray does not reach target"); + uiDefButS(block, NUM, 0, "time", xco+50, yco-103, (width-60)/2, 19, &(coa->time), 0.0, 1000.0, 0, 0, "Maximum activation time in frame, 0 for unlimited"); + uiDefButS(block, NUM, 0, "rotDamp", xco+50+(width-60)/2, yco-103, (width-60)/2, 19, &(coa->rotdamp), 0.0, 100.0, 0, 0, "Use a different damping for orientation"); + } else if (coa->type == ACT_CONST_TYPE_ORI) { + ysize= 87; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + str= "Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4"; + uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, &coa->mode, 0.0, 0.0, 0, 0, "Select the axis to be aligned along the reference direction"); + + uiDefButS(block, NUM, 0, "damp", xco+10, yco-45, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, "Damping factor: time constant (in frame) of low pass filter"); + uiDefBut(block, LABEL, 0, "X", xco+80, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "Y", xco+80+(width-115)/3, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, ""); + uiDefBut(block, LABEL, 0, "Z", xco+80+2*(width-115)/3, yco-45, (width-115)/3, 19, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefButF(block, NUM, 0, "", xco+80, yco-65, (width-115)/3, 19, &coa->maxrot[0], -2000.0, 2000.0, 10, 0, "X component of reference direction"); + uiDefButF(block, NUM, 0, "", xco+80+(width-115)/3, yco-65, (width-115)/3, 19, &coa->maxrot[1], -2000.0, 2000.0, 10, 0, "Y component of reference direction"); + uiDefButF(block, NUM, 0, "", xco+80+2*(width-115)/3, yco-65, (width-115)/3, 19, &coa->maxrot[2], -2000.0, 2000.0, 10, 0, "Z component of reference direction"); + + uiDefButS(block, NUM, 0, "time", xco+10, yco-84, 70, 19, &(coa->time), 0.0, 1000.0, 0, 0, "Maximum activation time in frame, 0 for unlimited"); + uiDefButF(block, NUM, 0, "min", xco+80, yco-84, (width-115)/2, 19, &(coa->minloc[0]), 0.0, 180.0, 10, 1, "Minimum angle (in degree) to maintain with target direction. No correction is done if angle with target direction is between min and max"); + uiDefButF(block, NUM, 0, "max", xco+80+(width-115)/2, yco-84, (width-115)/2, 19, &(coa->maxloc[0]), 0.0, 180.0, 10, 1, "Maximum angle (in degree) allowed with target direction. No correction is done if angle with target direction is between min and max"); + } else if (coa->type == ACT_CONST_TYPE_FH) { + ysize= 106; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + str= "Direction %t|None %x0|X axis %x1|Y axis %x2|Z axis %x4|-X axis %x8|-Y axis %x16|-Z axis %x32"; + uiDefButS(block, MENU, B_REDR, str, xco+10, yco-65, 70, 19, &coa->mode, 0.0, 0.0, 0, 0, "Set the direction of the ray (in world coordinate)"); + + if(coa->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp= coa->minloc; + else if(coa->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp= coa->minloc+1; + else fp= coa->minloc+2; + + uiDefButF(block, NUM, 0, "damp", xco+10, yco-45, (width-70)/2, 19, &coa->maxrot[0], 0.0, 1.0, 1, 0, "Damping factor of the Fh spring force"); + uiDefButF(block, NUM, 0, "dist", xco+10+(width-70)/2, yco-45, (width-70)/2, 19, fp, 0.010, 2000.0, 10, 0, "Height of the Fh area"); + uiDefButBitS(block, TOG, ACT_CONST_DOROTFH, 0, "Rot Fh", xco+10+(width-70), yco-45, 50, 19, &coa->flag, 0.0, 0.0, 0, 0, "Keep object axis parallel to normal"); + + uiDefButF(block, NUMSLI, 0, "Fh ", xco+80, yco-65, (width-115), 19, fp+3, 0.0, 1.0, 0, 0, "Spring force within the Fh area"); + uiDefButBitS(block, TOG, ACT_CONST_NORMAL, 0, "N", xco+80+(width-115), yco-65, 25, 19, + &coa->flag, 0.0, 0.0, 0, 0, "Add a horizontal spring force on slopes"); + uiDefButBitS(block, TOG, ACT_CONST_MATERIAL, B_REDR, "M/P", xco+10, yco-84, 40, 19, + &coa->flag, 0.0, 0.0, 0, 0, "Detect material instead of property"); + if (coa->flag & ACT_CONST_MATERIAL) + { + uiDefBut(block, TEX, 1, "Material:", xco + 50, yco-84, (width-60), 19, + coa->matprop, 0, 31, 0, 0, + "Ray detects only Objects with this material"); + } + else + { + uiDefBut(block, TEX, 1, "Property:", xco + 50, yco-84, (width-60), 19, + coa->matprop, 0, 31, 0, 0, + "Ray detect only Objects with this property"); + } + uiDefButBitS(block, TOG, ACT_CONST_PERMANENT, 0, "PER", xco+10, yco-103, 40, 19, + &coa->flag, 0.0, 0.0, 0, 0, "Persistent actuator: stays active even if ray does not reach target"); + uiDefButS(block, NUM, 0, "time", xco+50, yco-103, 90, 19, &(coa->time), 0.0, 1000.0, 0, 0, "Maximum activation time in frame, 0 for unlimited"); + uiDefButF(block, NUM, 0, "rotDamp", xco+140, yco-103, (width-150), 19, &coa->maxrot[1], 0.0, 1.0, 1, 0, "Use a different damping for rotation"); + } + str= "Constraint Type %t|Location %x0|Distance %x1|Orientation %x2|Force field %x3"; + but = uiDefButS(block, MENU, B_REDR, str, xco+40, yco-23, (width-80), 19, &coa->type, 0.0, 0.0, 0, 0, ""); + yco-= ysize; + break; + + case ACT_SCENE: + sca= act->data; + + if(sca->type==ACT_SCENE_RESTART) { + ysize= 28; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + } + else if(sca->type==ACT_SCENE_CAMERA) { + + ysize= 48; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+40, yco-44, (width-80), 19, &(sca->camera), "Set this Camera. Leave empty to refer to self object"); + } + else if(sca->type==ACT_SCENE_SET) { + + ysize= 48; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Set this Scene"); + } + else if(sca->type==ACT_SCENE_ADD_FRONT) { + + ysize= 48; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Add an Overlay Scene"); + } + else if(sca->type==ACT_SCENE_ADD_BACK) { + + ysize= 48; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Add a Background Scene"); + } + else if(sca->type==ACT_SCENE_REMOVE) { + + ysize= 48; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Remove a Scene"); + } + else if(sca->type==ACT_SCENE_SUSPEND) { + + ysize= 48; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Pause a Scene"); + } + else if(sca->type==ACT_SCENE_RESUME) { + + ysize= 48; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Unpause a Scene"); + } + + str= "Scene %t|Restart %x0|Set Scene %x1|Set Camera %x2|Add OverlayScene %x3|Add BackgroundScene %x4|Remove Scene %x5|Suspend Scene %x6|Resume Scene %x7"; + uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &sca->type, 0.0, 0.0, 0, 0, ""); + + yco-= ysize; + break; + case ACT_GAME: + { + gma = act->data; + if (gma->type == ACT_GAME_LOAD) + { + //ysize = 68; + ysize = 48; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, 63, 0, 0, "Load this blend file, use the \"//\" prefix for a path relative to the current blend file"); +// uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, 63, 0, 0, "Use this loadinganimation"); + } +/* else if (gma->type == ACT_GAME_START) + { + ysize = 68; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, 63, 0, 0, "Load this file"); + uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, 63, 0, 0, "Use this loadinganimation"); + } +*/ else if (ELEM4(gma->type, ACT_GAME_RESTART, ACT_GAME_QUIT, ACT_GAME_SAVECFG, ACT_GAME_LOADCFG)) + { + ysize = 28; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + } + + //str = "Scene %t|Load game%x0|Start loaded game%x1|Restart this game%x2|Quit this game %x3"; + str = "Scene %t|Start new game%x0|Restart this game%x2|Quit this game %x3|Save GameLogic.globalDict %x4|Load GameLogic.globalDict %x5"; + uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &gma->type, 0.0, 0.0, 0, 0, ""); + + yco -= ysize; + break; + } + case ACT_GROUP: + ga= act->data; + + ysize= 52; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + str= "GroupKey types %t|Set Key %x6|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x5"; + + uiDefButS(block, MENU, 1, str, xco+20, yco-24, width-40, 19, &ga->type, 0, 0, 0, 0, ""); + if(ga->type==ACT_GROUP_SET) { + uiDefBut(block, TEX, 0, "Key: ", xco+20, yco-44, (width-10)/2, 19, ga->name, 0.0, 31.0, 0, 0, "This name defines groupkey to be set"); + uiDefButI(block, NUM, 0, "Frame:", xco+20+(width-10)/2, yco-44, (width-70)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Set this frame"); + } + else if(ga->type==ACT_GROUP_FROM_PROP) { + uiDefBut(block, TEX, 0, "Prop: ", xco+20, yco-44, width-40, 19, ga->name, 0.0, 31.0, 0, 0, "Use this property to define the Group position"); + } + else { + uiDefButI(block, NUM, 0, "State", xco+20, yco-44, (width-40)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Start frame"); + uiDefButI(block, NUM, 0, "End", xco+20+(width-40)/2, yco-44, (width-40)/2, 19, &ga->end, 0.0, 2500.0, 0, 0, "End frame"); + } + yco-= ysize; + break; + + case ACT_VISIBILITY: + ysize = 24; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, + (float)yco-ysize, (float)xco+width, (float)yco, 1); + + visAct = act->data; + + uiBlockBeginAlign(block); + uiDefButBitI(block, TOGN, ACT_VISIBILITY_INVISIBLE, B_REDR, + "Visible", + xco + 10, yco - 20, (width - 20)/3, 19, &visAct->flag, + 0.0, 0.0, 0, 0, + "Set the objects visible. Initialized from the objects render restriction toggle (access in the outliner)"); + uiDefButBitI(block, TOG, ACT_VISIBILITY_OCCLUSION, B_REDR, + "Occlusion", + xco + 10 + ((width - 20)/3), yco - 20, (width - 20)/3, 19, &visAct->flag, + 0.0, 0.0, 0, 0, + "Set the object to occlude objects behind it. Initialized from the object type in physics button"); + uiBlockEndAlign(block); + + uiDefButBitI(block, TOG, ACT_VISIBILITY_RECURSIVE, 0, + "Children", + xco + 10 + (((width - 20)/3)*2)+10, yco - 20, ((width - 20)/3)-10, 19, &visAct->flag, + 0.0, 0.0, 0, 0, + "Sets all the children of this object to the same visibility/occlusion recursively"); + + yco-= ysize; + + break; + + case ACT_STATE: + ysize = 34; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, + (float)yco-ysize, (float)xco+width, (float)yco, 1); + + staAct = act->data; + + str= "Operation %t|Cpy %x0|Add %x1|Sub %x2|Inv %x3"; + + uiDefButI(block, MENU, B_REDR, str, + xco + 10, yco - 24, 65, 19, &staAct->type, + 0.0, 0.0, 0, 0, + "Select the bit operation on object state mask"); + + for (wval=0; wval<15; wval+=5) { + uiBlockBeginAlign(block); + for (stbit=0; stbit<5; stbit++) { + but = uiDefButBitI(block, TOG, 1<<(stbit+wval), stbit+wval, "", (short)(xco+85+12*stbit+13*wval), yco-17, 12, 12, (int *)&(staAct->mask), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+wval))); + uiButSetFunc(but, check_state_mask, but, &(staAct->mask)); + } + for (stbit=0; stbit<5; stbit++) { + but = uiDefButBitI(block, TOG, 1<<(stbit+wval+15), stbit+wval+15, "", (short)(xco+85+12*stbit+13*wval), yco-29, 12, 12, (int *)&(staAct->mask), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+wval+15))); + uiButSetFunc(but, check_state_mask, but, &(staAct->mask)); + } + } + uiBlockEndAlign(block); + + yco-= ysize; + + break; + + case ACT_RANDOM: + ysize = 69; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, + (float)yco-ysize, (float)xco+width, (float)yco, 1); + + randAct = act->data; + + /* 1. seed */ + uiDefButI(block, NUM, 1, "Seed: ", (xco+10),yco-24, 0.4 *(width-20), 19, + &randAct->seed, 0, 1000, 0, 0, + "Initial seed of the random generator. Use Python for more freedom. " + " (Choose 0 for not random)"); + + /* 2. distribution type */ + /* One pick per distribution. These numbers MUST match the #defines */ + /* in game.h !!! */ + str= "Distribution %t|Bool Constant %x0|Bool Uniform %x1" + "|Bool Bernoulli %x2|Int Constant %x3|Int Uniform %x4" + "|Int Poisson %x5|Float Constant %x6|Float Uniform %x7" + "|Float Normal %x8|Float Neg. Exp. %x9"; + uiDefButI(block, MENU, B_REDR, str, (xco+10) + 0.4 * (width-20), yco-24, 0.6 * (width-20), 19, + &randAct->distribution, 0.0, 0.0, 0, 0, + "Choose the type of distribution"); + + /* 3. property */ + uiDefBut(block, TEX, 1, "Property:", (xco+10), yco-44, (width-20), 19, + &randAct->propname, 0, 31, 0, 0, + "Assign the random value to this property"); + + /*4. and 5. arguments for the distribution*/ + switch (randAct->distribution) { + case ACT_RANDOM_BOOL_CONST: + uiDefButBitI(block, TOG, 1, 1, "Always true", (xco+10), yco-64, (width-20), 19, + &randAct->int_arg_1, 2.0, 1, 0, 0, + "Always false or always true"); + break; + case ACT_RANDOM_BOOL_UNIFORM: + uiDefBut(block, LABEL, 0, " Do a 50-50 pick", (xco+10), yco-64, (width-20), 19, + NULL, 0, 0, 0, 0, + "Choose between true and false, 50% chance each"); + break; + case ACT_RANDOM_BOOL_BERNOUILLI: + uiDefButF(block, NUM, 1, "Chance", (xco+10), yco-64, (width-20), 19, + &randAct->float_arg_1, 0.0, 1.0, 0, 0, + "Pick a number between 0 and 1. Success if you stay " + "below this value"); + break; + case ACT_RANDOM_INT_CONST: + uiDefButI(block, NUM, 1, "Value: ", (xco+10), yco-64, (width-20), 19, + &randAct->int_arg_1, -1000, 1000, 0, 0, + "Always return this number"); + break; + case ACT_RANDOM_INT_UNIFORM: + uiDefButI(block, NUM, 1, "Min: ", (xco+10), yco-64, (width-20)/2, 19, + &randAct->int_arg_1, -1000, 1000, 0, 0, + "Choose a number from a range. " + "Lower boundary of the range"); + uiDefButI(block, NUM, 1, "Max: ", (xco+10) + (width-20)/2, yco-64, (width-20)/2, 19, + &randAct->int_arg_2, -1000, 1000, 0, 0, + "Choose a number from a range. " + "Upper boundary of the range"); + break; + case ACT_RANDOM_INT_POISSON: + uiDefButF(block, NUM, 1, "Mean: ", (xco+10), yco-64, (width-20), 19, + &randAct->float_arg_1, 0.01, 100.0, 0, 0, + "Expected mean value of the distribution"); + break; + case ACT_RANDOM_FLOAT_CONST: + uiDefButF(block, NUM, 1, "Value: ", (xco+10), yco-64, (width-20), 19, + &randAct->float_arg_1, 0.0, 1.0, 0, 0, + "Always return this number"); + break; + case ACT_RANDOM_FLOAT_UNIFORM: + uiDefButF(block, NUM, 1, "Min: ", (xco+10), yco-64, (width-20)/2, 19, + &randAct->float_arg_1, -10000.0, 10000.0, 0, 0, + "Choose a number from a range" + "Lower boundary of the range"); + uiDefButF(block, NUM, 1, "Max: ", (xco+10) + (width-20)/2, yco-64, (width-20)/2, 19, + &randAct->float_arg_2, -10000.0, 10000.0, 0, 0, + "Choose a number from a range" + "Upper boundary of the range"); + break; + case ACT_RANDOM_FLOAT_NORMAL: + uiDefButF(block, NUM, 1, "Mean: ", (xco+10), yco-64, (width-20)/2, 19, + &randAct->float_arg_1, -10000.0, 10000.0, 0, 0, + "A normal distribution. Mean of the distribution"); + uiDefButF(block, NUM, 1, "SD: ", (xco+10) + (width-20)/2, yco-64, (width-20)/2, 19, + &randAct->float_arg_2, 0.0, 10000.0, 0, 0, + "A normal distribution. Standard deviation of the " + "distribution"); + break; + case ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL: + uiDefButF(block, NUM, 1, "Half-life time: ", (xco+10), yco-64, (width-20), 19, + &randAct->float_arg_1, 0.001, 10000.0, 0, 0, + "Negative exponential dropoff"); + break; + default: + ; /* don't know what this distro is... can be useful for testing */ + /* though :) */ + } + + yco-= ysize; + break; + case ACT_MESSAGE: + ma = act->data; + + ysize = 4 + (3 * 24); /* footer + number of lines * 24 pixels/line */ + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, + (float)xco+width, (float)yco, 1); + + myline=1; + + /* line 1: To */ + uiDefBut(block, TEX, 1, "To: ", + (xco+10), (yco-(myline++*24)), (width-20), 19, + &ma->toPropName, 0, 31, 0, 0, + "Optional send message to objects with this name only, or empty to broadcast"); + + /* line 2: Message Subject */ + uiDefBut(block, TEX, 1, "Subject: ", + (xco+10), (yco-(myline++*24)), (width-20), 19, + &ma->subject, 0, 31, 0, 0, + "Optional message subject. This is what can be filtered on"); + + /* line 3: Text/Property */ + uiDefButBitS(block, TOG, 1, B_REDR, "T/P", + (xco+10),(yco-(myline*24)), (0.20 * (width-20)), 19, + &ma->bodyType, 0.0, 0.0, 0, 0, + "Toggle message type: either Text or a PropertyName"); + + if (ma->bodyType == ACT_MESG_MESG) + { + /* line 3: Message Body */ + uiDefBut(block, TEX, 1, "Body: ", + (xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19, + &ma->body, 0, 31, 0, 0, + "Optional message body Text"); + } else + { + /* line 3: Property body (set by property) */ + uiDefBut(block, TEX, 1, "Propname: ", + (xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19, + &ma->body, 0, 31, 0, 0, + "The message body will be set by the Property Value"); + } + + yco -= ysize; + break; + case ACT_2DFILTER: + tdfa = act->data; + + ysize = 50; + if(tdfa->type == ACT_2DFILTER_CUSTOMFILTER) + { + ysize +=20; + } + glRects( xco, yco-ysize, xco+width, yco ); + uiEmboss( (float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1 ); + + switch(tdfa->type) + { + case ACT_2DFILTER_MOTIONBLUR: + if(!tdfa->flag) + { + uiDefButS(block, TOG, B_REDR, "D", xco+30,yco-44,19, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Disable Motion Blur"); + uiDefButF(block, NUM, B_REDR, "Value:", xco+52,yco-44,width-82,19,&tdfa->float_arg,0.0,1.0,0.0,0.0,"Set motion blur value"); + } + else + { + uiDefButS(block, TOG, B_REDR, "Disabled", xco+30,yco-44,width-60, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Enable Motion Blur"); + } + break; + case ACT_2DFILTER_BLUR: + case ACT_2DFILTER_SHARPEN: + case ACT_2DFILTER_DILATION: + case ACT_2DFILTER_EROSION: + case ACT_2DFILTER_LAPLACIAN: + case ACT_2DFILTER_SOBEL: + case ACT_2DFILTER_PREWITT: + case ACT_2DFILTER_GRAYSCALE: + case ACT_2DFILTER_SEPIA: + case ACT_2DFILTER_INVERT: + case ACT_2DFILTER_NOFILTER: + case ACT_2DFILTER_DISABLED: + case ACT_2DFILTER_ENABLED: + uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30,yco-44,width-60,19,&tdfa->int_arg,0.0,MAX_RENDER_PASS-1,0.0,0.0,"Set motion blur value"); + break; + case ACT_2DFILTER_CUSTOMFILTER: + uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30,yco-44,width-60,19,&tdfa->int_arg,0.0,MAX_RENDER_PASS-1,0.0,0.0,"Set motion blur value"); + uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Script: ", xco+30,yco-64,width-60, 19, &tdfa->text, ""); + break; + } + + str= "2D Filter %t|Motion Blur %x1|Blur %x2|Sharpen %x3|Dilation %x4|Erosion %x5|" + "Laplacian %x6|Sobel %x7|Prewitt %x8|Gray Scale %x9|Sepia %x10|Invert %x11|Custom Filter %x12|" + "Enable Filter %x-2|Disable Filter %x-1|Remove Filter %x0|"; + uiDefButS(block, MENU, B_REDR, str, xco+30,yco-24,width-60, 19, &tdfa->type, 0.0, 0.0, 0.0, 0.0, "2D filter type"); + + yco -= ysize; + break; + case ACT_PARENT: + parAct = act->data; + + if(parAct->type==ACT_PARENT_SET) { + + ysize= 48; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+95, yco-24, (width-100), 19, &(parAct->ob), "Set this object as parent"); + uiBlockBeginAlign(block); + uiDefButBitS(block, TOGN, ACT_PARENT_COMPOUND, B_REDR, + "Compound", + xco + 5, yco - 44, (width - 10)/2, 19, &parAct->flag, + 0.0, 0.0, 0, 0, + "Add this object shape to the parent shape (only if the parent shape is already compound)"); + uiDefButBitS(block, TOGN, ACT_PARENT_GHOST, B_REDR, + "Ghost", + xco + 5 + ((width - 10)/2), yco - 44, (width - 10)/2, 19, &parAct->flag, + 0.0, 0.0, 0, 0, + "Make this object ghost while parented (only if not compound)"); + uiBlockEndAlign(block); + } + else if(parAct->type==ACT_PARENT_REMOVE) { + + ysize= 28; + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + } + + str= "Parent %t|Set Parent %x0|Remove Parent %x1"; + uiDefButI(block, MENU, B_REDR, str, xco+5, yco-24, parAct->type==1?(width-80):90, 19, &parAct->type, 0.0, 0.0, 0, 0, ""); + + yco-= ysize; + break; + default: + ysize= 4; + + glRects(xco, yco-ysize, xco+width, yco); + uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); + + yco-= ysize; + break; + } + + uiBlockSetEmboss(block, UI_EMBOSS); + + return yco-4; +} + +static void do_sensor_menu(bContext *C, void *arg, int event) +{ + SpaceLogic *slogic= (SpaceLogic *)CTX_wm_space_data(C); + ID **idar; + Object *ob; + bSensor *sens; + short count, a; + + idar= get_selected_and_linked_obs(C, &count, slogic->scaflag); + + for(a=0; ascaflag |= OB_SHOWSENS; + else if(event==1) ob->scaflag &= ~OB_SHOWSENS; + } + + for(a=0; asensors.first; + while(sens) { + if(event==2) sens->flag |= SENS_SHOW; + else if(event==3) sens->flag &= ~SENS_SHOW; + sens= sens->next; + } + } + + if(idar) MEM_freeN(idar); +} + +static uiBlock *sensor_menu(bContext *C, ARegion *ar, void *arg_unused) +{ + uiBlock *block; + int yco=0; + + block= uiBeginBlock(C, ar, "filemenu", UI_EMBOSSP); + uiBlockSetButmFunc(block, do_sensor_menu, NULL); + + uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefBut(block, BUTM, 1, "Hide Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefBut(block, SEPR, 0, "", 0, (short)(yco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiDefBut(block, BUTM, 1, "Show Sensors", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefBut(block, BUTM, 1, "Hide Sensors", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 3, ""); + + uiBlockSetDirection(block, UI_TOP); + uiEndBlock(C, block); + + return block; +} + +static void do_controller_menu(bContext *C, void *arg, int event) +{ + SpaceLogic *slogic= (SpaceLogic *)CTX_wm_space_data(C); + ID **idar; + Object *ob; + bController *cont; + short count, a; + + idar= get_selected_and_linked_obs(C, &count, slogic->scaflag); + + for(a=0; ascaflag |= OB_SHOWCONT; + else if(event==1) ob->scaflag &= ~OB_SHOWCONT; + } + + for(a=0; acontrollers.first; + while(cont) { + if(event==2) cont->flag |= CONT_SHOW; + else if(event==3) cont->flag &= ~CONT_SHOW; + cont= cont->next; + } + } + + if(idar) MEM_freeN(idar); +} + +static uiBlock *controller_menu(bContext *C, ARegion *ar, void *arg_unused) +{ + uiBlock *block; + int yco=0; + + block= uiBeginBlock(C, ar, "filemenu", UI_EMBOSSP); + uiBlockSetButmFunc(block, do_controller_menu, NULL); + + uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefBut(block, BUTM, 1, "Hide Objects", 0,(short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefBut(block, SEPR, 0, "", 0, (short)(yco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiDefBut(block, BUTM, 1, "Show Controllers", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 2, 2, ""); + uiDefBut(block, BUTM, 1, "Hide Controllers", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 3, 3, ""); + + uiBlockSetDirection(block, UI_TOP); + uiEndBlock(C, block); + + return block; +} + +static void do_actuator_menu(bContext *C, void *arg, int event) +{ + SpaceLogic *slogic= (SpaceLogic *)CTX_wm_space_data(C); + ID **idar; + Object *ob; + bActuator *act; + short count, a; + + idar= get_selected_and_linked_obs(C, &count, slogic->scaflag); + + for(a=0; ascaflag |= OB_SHOWACT; + else if(event==1) ob->scaflag &= ~OB_SHOWACT; + } + + for(a=0; aactuators.first; + while(act) { + if(event==2) act->flag |= ACT_SHOW; + else if(event==3) act->flag &= ~ACT_SHOW; + act= act->next; + } + } + + if(idar) MEM_freeN(idar); +} + +static uiBlock *actuator_menu(bContext *C, ARegion *ar, void *arg_unused) +{ + uiBlock *block; + int xco=0; + + block= uiBeginBlock(C, ar, "filemenu", UI_EMBOSSP); + uiBlockSetButmFunc(block, do_actuator_menu, NULL); + + uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefBut(block, BUTM, 1, "Hide Objects", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefBut(block, SEPR, 0, "", 0, (short)(xco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiDefBut(block, BUTM, 1, "Show Actuators", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefBut(block, BUTM, 1, "Hide Actuators", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 3, ""); + + uiBlockSetDirection(block, UI_TOP); + uiEndBlock(C, block); + + return block; +} + + + +static void check_controller_state_mask(bContext *C, void *arg1_but, void *arg2_mask) +{ + unsigned int *cont_mask = arg2_mask; + uiBut *but = arg1_but; + + /* a controller is always in a single state */ + *cont_mask = (1<retval); + but->retval = B_REDR; +} + +static int first_bit(unsigned int mask) +{ + int bit; + + for (bit=0; bit<32; bit++) { + if (mask & (1<state_mask), 0, 0, 0, 0, ""); + uiButSetFunc(but, check_controller_state_mask, but, &(cont->state_mask)); + } + for (stbit=0; stbit<5; stbit++) { + but = uiDefButBitI(block, TOG, (1<<(stbit+offset+15)), (stbit+offset+15), "", (short)(xco+12*stbit+13*offset), yco-12, 12, 12, (int *)&(cont->state_mask), 0, 0, 0, 0, ""); + uiButSetFunc(but, check_controller_state_mask, but, &(cont->state_mask)); + } + } + uiBlockEndAlign(block); + + uiBlockSetDirection(block, UI_TOP); + uiEndBlock(C, block); + + return block; +} + +static void do_object_state_menu(bContext *C, void *arg, int event) +{ + Object *ob = arg; + + switch (event) { + case 0: + ob->state = 0x3FFFFFFF; + break; + case 1: + ob->state = ob->init_state; + if (!ob->state) + ob->state = 1; + break; + case 2: + ob->init_state = ob->state; + break; + } +} + +static uiBlock *object_state_mask_menu(bContext *C, ARegion *ar, void *arg_obj) +{ + uiBlock *block; + short xco = 0; + + block= uiBeginBlock(C, ar, "obstatemenu", UI_EMBOSSP); + uiBlockSetButmFunc(block, do_object_state_menu, arg_obj); + + uiDefBut(block, BUTM, 1, "Set all bits", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); + uiDefBut(block, BUTM, 1, "Recall init state", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefBut(block, SEPR, 0, "", 0, (short)(xco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiDefBut(block, BUTM, 1, "Store init state", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 2, ""); + + uiBlockSetDirection(block, UI_TOP); + uiEndBlock(C, block); + + return block; +} + +static int is_sensor_linked(uiBlock *block, bSensor *sens) +{ + bController *cont; + int i, count; + + for (count=0, i=0; itotlinks; i++) { + cont = sens->links[i]; + if (uiFindInlink(block, cont) != NULL) + return 1; + } + return 0; +} + +/* never used, see CVS 1.134 for the code */ +/* static FreeCamera *new_freecamera(void) */ + +/* never used, see CVS 1.120 for the code */ +/* static uiBlock *freecamera_menu(void) */ + + +void logic_buttons(bContext *C, ARegion *ar) +{ + SpaceLogic *slogic= (SpaceLogic *)CTX_wm_space_data(C); + Object *ob= CTX_data_active_object(C); + ID **idar; + bSensor *sens; + bController *cont; + bActuator *act; + uiBlock *block; + uiBut *but; + int a, iact, stbit, offset; + short xco, yco, count, width, ycoo; + char name[32]; + /* pin is a bool used for actuator and sensor drawing with states + * pin so changing states dosnt hide the logic brick */ + char pin; + + if(ob==NULL) return; +// uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE); + + sprintf(name, "buttonswin %p", ar); + block= uiBeginBlock(C, ar, name, UI_EMBOSS); + uiBlockSetHandleFunc(block, do_logic_buts, NULL); + + idar= get_selected_and_linked_obs(C, &count, slogic->scaflag); + + /* clean ACT_LINKED and ACT_VISIBLE of all potentially visible actuators so that + we can determine which is actually linked/visible */ + for(a=0; aactuators.first; + while(act) { + act->flag &= ~(ACT_LINKED|ACT_VISIBLE); + act = act->next; + } + /* same for sensors */ + sens= ob->sensors.first; + while(sens) { + sens->flag &= ~(SENS_VISIBLE); + sens = sens->next; + } + } + + /* start with the controller because we need to know which one is visible */ + /* ******************************* */ + xco= 500; yco= 170; width= 300; + + uiDefPulldownBut(block, controller_menu, NULL, "Controllers", xco-10, yco+35, 100, 19, ""); + + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, BUTS_CONT_SEL, B_REDR, "Sel", xco+110, yco+35, (width-100)/3, 19, &slogic->scaflag, 0, 0, 0, 0, "Show all selected Objects"); + uiDefButBitS(block, TOG, BUTS_CONT_ACT, B_REDR, "Act", xco+110+(width-100)/3, yco+35, (width-100)/3, 19, &slogic->scaflag, 0, 0, 0, 0, "Show active Object"); + uiDefButBitS(block, TOG, BUTS_CONT_LINK, B_REDR, "Link", xco+110+2*(width-100)/3, yco+35, (width-100)/3, 19, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Sensor/Actuator"); + uiBlockEndAlign(block); + + ob= CTX_data_active_object(C); + + for(a=0; ascavisflag & OB_VIS_CONT) == 0) continue; + + /* presume it is only objects for now */ + uiBlockBeginAlign(block); +// if(ob->controllers.first) uiSetCurFont(block, UI_HELVB); + uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), 19, &ob->scaflag, 0, 0, 0, 0, "Active Object name"); +// if(ob->controllers.first) uiSetCurFont(block, UI_HELV); + uiDefButBitS(block, TOG, OB_ADDCONT, B_ADD_CONT, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Controller"); + uiBlockEndAlign(block); + yco-=20; + + /* mark all actuators linked to these controllers */ + /* note that some of these actuators could be from objects that are not in the display list. + It's ok because those actuators will not be displayed here */ + cont= ob->controllers.first; + while(cont) { + for (iact=0; iacttotlinks; iact++) { + act = cont->links[iact]; + if (act) + act->flag |= ACT_LINKED; + } + controller_state_mask |= cont->state_mask; + cont = cont->next; + } + + if(ob->scaflag & OB_SHOWCONT) { + + /* first show the state */ + uiDefBlockBut(block, object_state_mask_menu, ob, "State", (short)(xco-10), (short)(yco-10), 36, 19, "Object state menu: store and retrieve initial state"); + + if (!ob->state) + ob->state = 1; + for (offset=0; offset<15; offset+=5) { + uiBlockBeginAlign(block); + for (stbit=0; stbit<5; stbit++) { + but = uiDefButBitI(block, controller_state_mask&(1<<(stbit+offset)) ? BUT_TOGDUAL:TOG, 1<<(stbit+offset), stbit+offset, "", (short)(xco+31+12*stbit+13*offset), yco, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset))); + uiButSetFunc(but, check_state_mask, but, &(ob->state)); + } + for (stbit=0; stbit<5; stbit++) { + but = uiDefButBitI(block, controller_state_mask&(1<<(stbit+offset+15)) ? BUT_TOGDUAL:TOG, 1<<(stbit+offset+15), stbit+offset+15, "", (short)(xco+31+12*stbit+13*offset), yco-12, 12, 12, (int *)&(ob->state), 0, 0, 0, 0, get_state_name(ob, (short)(stbit+offset+15))); + uiButSetFunc(but, check_state_mask, but, &(ob->state)); + } + } + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, OB_SETSTBIT, B_SET_STATE_BIT, "All",(short)(xco+226), yco-10, 22, 19, &ob->scaflag, 0, 0, 0, 0, "Set all state bits"); + uiDefButBitS(block, TOG, OB_INITSTBIT, B_INIT_STATE_BIT, "Ini",(short)(xco+248), yco-10, 22, 19, &ob->scaflag, 0, 0, 0, 0, "Set the initial state"); + uiDefButBitS(block, TOG, OB_DEBUGSTATE, 0, "D",(short)(xco+270), yco-10, 15, 19, &ob->scaflag, 0, 0, 0, 0, "Print state debug info"); + uiBlockEndAlign(block); + + yco-=35; + + /* display only the controllers that match the current state */ + offset = 0; + for (stbit=0; stbit<32; stbit++) { + if (!(ob->state & (1<controllers.first; + while(cont) { + if (cont->state_mask & (1<totlinks; iact++) { + act = cont->links[iact]; + if (act) + act->flag |= ACT_VISIBLE; + } + uiDefIconButBitS(block, TOG, CONT_DEL, B_DEL_CONT, ICON_X, xco, yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Delete Controller"); + uiDefIconButBitS(block, ICONTOG, CONT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Controller settings"); + uiDefIconButBitS(block, TOG, CONT_PRIO, B_REDR, ICON_BOOKMARKS, (short)(xco+width-66), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Mark controller for execution before all non-marked controllers (good for startup scripts)"); + + sprintf(name, "%d", first_bit(cont->state_mask)+1); + uiDefBlockBut(block, controller_state_mask_menu, cont, name, (short)(xco+width-44), yco, 22, 19, "Set controller state index (from 1 to 30)"); + + if(cont->flag & CONT_SHOW) { + cont->otype= cont->type; + uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 70, 19, &cont->type, 0, 0, 0, 0, "Controller type"); + but= uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-158), 19, cont->name, 0, 31, 0, 0, "Controller name"); + uiButSetFunc(but, make_unique_prop_names_cb, cont->name, (void*) 0); + + ycoo= yco; + yco= draw_controllerbuttons(cont, block, xco, yco, width); + if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2; + } + else { + cpack(0x999999); + glRecti(xco+22, yco, xco+width-22,yco+19); + but= uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, 19, cont, 0, 0, 0, 0, "Controller type"); + uiButSetFunc(but, sca_move_controller, cont, NULL); + but= uiDefBut(block, LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-158), 19, cont, 0, 0, 0, 0, "Controller name"); + uiButSetFunc(but, sca_move_controller, cont, NULL); + ycoo= yco; + } + + but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, 19, 19, NULL, 0, 0, 0, 0, ""); + uiSetButLink(but, NULL, (void ***)&(cont->links), &cont->totlinks, LINK_CONTROLLER, LINK_ACTUATOR); + + uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, 19, 19, cont, LINK_CONTROLLER, 0, 0, 0, ""); + /* offset is >0 if at least one controller was displayed */ + offset++; + yco-=20; + } + cont= cont->next; + } + + } + yco-= 6; + } + } + + /* ******************************* */ + xco= 10; yco= 170; width= 400; + + uiDefPulldownBut(block, sensor_menu, NULL, "Sensors", xco-10, yco+35, 70, 19, ""); + + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, BUTS_SENS_SEL, B_REDR, "Sel", xco+80, yco+35, (width-70)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show all selected Objects"); + uiDefButBitS(block, TOG, BUTS_SENS_ACT, B_REDR, "Act", xco+80+(width-70)/4, yco+35, (width-70)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show active Object"); + uiDefButBitS(block, TOG, BUTS_SENS_LINK, B_REDR, "Link", xco+80+2*(width-70)/4, yco+35, (width-70)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller"); + uiDefButBitS(block, TOG, BUTS_SENS_STATE, B_REDR, "State", xco+80+3*(width-70)/4, yco+35, (width-70)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show only sensors connected to active states"); + uiBlockEndAlign(block); + + for(a=0; ascavisflag & OB_VIS_SENS) == 0) continue; + + /* presume it is only objects for now */ + uiBlockBeginAlign(block); +// if(ob->sensors.first) uiSetCurFont(block, UI_HELVB); + uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), 19, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors"); +// if(ob->sensors.first) uiSetCurFont(block, UI_HELV); + uiDefButBitS(block, TOG, OB_ADDSENS, B_ADD_SENS, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Sensor"); + uiBlockEndAlign(block); + yco-=20; + + if(ob->scaflag & OB_SHOWSENS) { + + sens= ob->sensors.first; + while(sens) { + if (!(slogic->scaflag & BUTS_SENS_STATE) || + (sens->totlinks == 0) || /* always display sensor without links so that is can be edited */ + (sens->flag & SENS_PIN && slogic->scaflag & BUTS_SENS_STATE) || /* states can hide some sensors, pinned sensors ignore the visible state */ + (is_sensor_linked(block, sens)) + ) { + /* should we draw the pin? - for now always draw when there is a state */ + pin = (slogic->scaflag & BUTS_SENS_STATE && (sens->flag & SENS_SHOW || sens->flag & SENS_PIN)) ? 1:0 ; + + sens->flag |= SENS_VISIBLE; + uiDefIconButBitS(block, TOG, SENS_DEL, B_DEL_SENS, ICON_X, xco, yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Delete Sensor"); + if (pin) + uiDefIconButBitS(block, ICONTOG, SENS_PIN, B_REDR, ICON_PINNED, (short)(xco+width-44), yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Display when not linked to a visible states controller"); + + uiDefIconButBitS(block, ICONTOG, SENS_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Sensor settings"); + + ycoo= yco; + if(sens->flag & SENS_SHOW) + { + uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 80, 19, &sens->type, 0, 0, 0, 0, "Sensor type"); + but= uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-(pin?146:124)), 19, sens->name, 0, 31, 0, 0, "Sensor name"); + uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0); + + sens->otype= sens->type; + yco= draw_sensorbuttons(sens, block, xco, yco, width,ob->id.name); + if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2; + } + else { + set_col_sensor(sens->type, 1); + glRecti(xco+22, yco, xco+width-22,yco+19); + but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, 19, sens, 0, 0, 0, 0, ""); + uiButSetFunc(but, sca_move_sensor, sens, NULL); + but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), 19, sens, 0, 31, 0, 0, ""); + uiButSetFunc(but, sca_move_sensor, sens, NULL); + } + + but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, 19, 19, NULL, 0, 0, 0, 0, ""); + uiSetButLink(but, NULL, (void ***)&(sens->links), &sens->totlinks, LINK_SENSOR, LINK_CONTROLLER); + + yco-=20; + } + sens= sens->next; + } + yco-= 6; + } + } + + /* ******************************* */ + xco= 900; yco= 170; width= 400; + + uiDefPulldownBut(block, actuator_menu, NULL, "Actuators", xco-10, yco+35, 90, 19, ""); + + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, BUTS_ACT_SEL, B_REDR, "Sel", xco+110, yco+35, (width-100)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show all selected Objects"); + uiDefButBitS(block, TOG, BUTS_ACT_ACT, B_REDR, "Act", xco+110+(width-100)/4, yco+35, (width-100)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show active Object"); + uiDefButBitS(block, TOG, BUTS_ACT_LINK, B_REDR, "Link", xco+110+2*(width-100)/4, yco+35, (width-100)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller"); + uiDefButBitS(block, TOG, BUTS_ACT_STATE, B_REDR, "State", xco+110+3*(width-100)/4, yco+35, (width-100)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show only actuators connected to active states"); + uiBlockEndAlign(block); + for(a=0; ascavisflag & OB_VIS_ACT) == 0) continue; + + /* presume it is only objects for now */ + uiBlockBeginAlign(block); +// if(ob->actuators.first) uiSetCurFont(block, UI_HELVB); + uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2,(short)(xco-10), yco,(short)(width-30), 19, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators"); +// if(ob->actuators.first) uiSetCurFont(block, UI_HELV); + uiDefButBitS(block, TOG, OB_ADDACT, B_ADD_ACT, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Actuator"); + uiBlockEndAlign(block); + yco-=20; + + if(ob->scaflag & OB_SHOWACT) { + + act= ob->actuators.first; + while(act) { + if (!(slogic->scaflag & BUTS_ACT_STATE) || + !(act->flag & ACT_LINKED) || /* always display actuators without links so that is can be edited */ + (act->flag & ACT_VISIBLE) || /* this actuator has visible connection, display it */ + (act->flag & ACT_PIN && slogic->scaflag & BUTS_ACT_STATE)) { + + pin = (slogic->scaflag & BUTS_ACT_STATE && (act->flag & SENS_SHOW || act->flag & SENS_PIN)) ? 1:0 ; + + act->flag |= ACT_VISIBLE; /* mark the actuator as visible to help implementing the up/down action */ + uiDefIconButBitS(block, TOG, ACT_DEL, B_DEL_ACT, ICON_X, xco, yco, 22, 19, &act->flag, 0, 0, 0, 0, "Delete Actuator"); + if (pin) + uiDefIconButBitS(block, ICONTOG, ACT_PIN, B_REDR, ICON_PINNED, (short)(xco+width-44), yco, 22, 19, &act->flag, 0, 0, 0, 0, "Display when not linked to a visible states controller"); + uiDefIconButBitS(block, ICONTOG, ACT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &act->flag, 0, 0, 0, 0, "Display the actuator"); + + if(act->flag & ACT_SHOW) { + act->otype= act->type; + uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 90, 19, &act->type, 0, 0, 0, 0, "Actuator type"); + but= uiDefBut(block, TEX, 1, "", (short)(xco+112), yco, (short)(width-(pin?156:134)), 19, act->name, 0, 31, 0, 0, "Actuator name"); + uiButSetFunc(but, make_unique_prop_names_cb, act->name, (void*) 0); + + ycoo= yco; + yco= draw_actuatorbuttons(ob, act, block, xco, yco, width); + if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2; + } + else { + set_col_actuator(act->type, 1); + glRecti((short)(xco+22), yco, (short)(xco+width-22),(short)(yco+19)); + but= uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 90, 19, act, 0, 0, 0, 0, "Actuator type"); + uiButSetFunc(but, sca_move_actuator, act, NULL); + but= uiDefBut(block, LABEL, 0, act->name, (short)(xco+112), yco, (short)(width-(pin?156:134)), 19, act, 0, 0, 0, 0, "Actuator name"); + uiButSetFunc(but, sca_move_actuator, act, NULL); + ycoo= yco; + } + + uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, 19, 19, act, LINK_ACTUATOR, 0, 0, 0, ""); + + yco-=20; + } + act= act->next; + } + yco-= 6; + } + } + + uiComposeLinks(block); + + uiEndBlock(C, block); + uiDrawBlock(C, block); + + if(idar) MEM_freeN(idar); +} + + + + + + diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c index 12eeed35ec8..a593cfd1e7f 100644 --- a/source/blender/editors/space_logic/space_logic.c +++ b/source/blender/editors/space_logic/space_logic.c @@ -121,6 +121,30 @@ static SpaceLink *logic_new(const bContext *C) BLI_addtail(&slogic->regionbase, ar); ar->regiontype= RGN_TYPE_WINDOW; + + ar->v2d.tot.xmin= 0.0f; + ar->v2d.tot.ymin= 0.0f; + ar->v2d.tot.xmax= 1280; + ar->v2d.tot.ymax= 240.0f; + + ar->v2d.cur.xmin= 0.0f; + ar->v2d.cur.ymin= 0.0f; + ar->v2d.cur.xmax= 1280.0f; + ar->v2d.cur.ymax= 240.0f; + + ar->v2d.min[0]= 1.0f; + ar->v2d.min[1]= 1.0f; + + ar->v2d.max[0]= 32000.0f; + ar->v2d.max[1]= 32000.0f; + + ar->v2d.minzoom= 0.5f; + ar->v2d.maxzoom= 1.21f; + + ar->v2d.scroll= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM); + ar->v2d.keepzoom= V2D_KEEPZOOM|V2D_KEEPASPECT; + ar->v2d.keeptot= 0; + return (SpaceLink *)slogic; } @@ -205,7 +229,7 @@ static void logic_main_area_init(wmWindowManager *wm, ARegion *ar) { ListBase *keymap; - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy); + UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); /* own keymaps */ keymap= WM_keymap_listbase(wm, "Logic Generic", SPACE_LOGIC, 0); @@ -217,6 +241,7 @@ static void logic_main_area_draw(const bContext *C, ARegion *ar) /* draw entirely, view changes should be handled here */ // SpaceLogic *slogic= (SpaceLogic*)CTX_wm_space_data(C); View2D *v2d= &ar->v2d; + View2DScrollers *scrollers; float col[3]; /* clear and setup matrix */ @@ -224,15 +249,18 @@ static void logic_main_area_draw(const bContext *C, ARegion *ar) glClearColor(col[0], col[1], col[2], 0.0); glClear(GL_COLOR_BUFFER_BIT); - /* we set view2d from own zoom and offset each time */ -// image_main_area_set_view2d(sima, ar, scene); - UI_view2d_view_ortho(C, v2d); - /* scrollers? */ - /*scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_UNIT_VALUES, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); + logic_buttons((bContext *)C, ar); + + /* reset view matrix */ + UI_view2d_view_restore(C); + + /* scrollers */ + scrollers= UI_view2d_scrollers_calc(C, v2d, 10, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); UI_view2d_scrollers_draw(C, v2d, scrollers); - UI_view2d_scrollers_free(scrollers);*/ + UI_view2d_scrollers_free(scrollers); + } @@ -306,11 +334,10 @@ void ED_spacetype_logic(void) /* regions: main window */ art= MEM_callocN(sizeof(ARegionType), "spacetype logic region"); art->regionid = RGN_TYPE_WINDOW; - art->keymapflag= ED_KEYMAP_FRAMES; + art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES|ED_KEYMAP_VIEW2D; art->init= logic_main_area_init; art->draw= logic_main_area_draw; art->listener= logic_listener; - art->keymapflag= 0; BLI_addhead(&st->regiontypes, art); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 97f0d3e53f3..416acd7467e 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -369,8 +369,8 @@ typedef struct SpaceLogic { short blockhandler[8]; - short flag, pad; - int pad2; + short flag, scaflag; + int pad; struct bGPdata *gpd; /* grease-pencil data */ } SpaceLogic; -- cgit v1.2.3 From cb68b9434c4967d8985da809b98305b8599a95e2 Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Wed, 17 Jun 2009 19:46:39 +0000 Subject: Fix mask in arrow cursor and improve swap one. --- source/blender/windowmanager/intern/wm_cursors.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index 627aebbe875..9b64ad6d38c 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -316,7 +316,7 @@ BEGIN_CURSOR_BLOCK static char ew_smsk[]={ 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x38, 0x1c, - 0x3c, 0x3c, 0xfe, 0x7f, 0xff, 0xff, 0x3f, 0xfc, + 0x3c, 0x3c, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0x3c, 0x3c, 0x38, 0x1c, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; @@ -943,17 +943,17 @@ END_CURSOR_BLOCK /********************** Swap Area Cursor ***********************/ BEGIN_CURSOR_BLOCK static char swap_sbm[]={ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xff, 0x07, 0xff, 0x07, - 0xff, 0x07, 0xff, 0x07, 0xff, 0x07, 0xff, 0x07, - 0xff, 0x07, 0xff, 0x07, 0xff, 0x07, 0xff, 0x07, + 0xc0, 0xff, 0x40, 0x80, 0x40, 0x80, 0x40, 0x9c, + 0x40, 0x98, 0x40, 0x94, 0x00, 0x82, 0xfe, 0x80, + 0x7e, 0xfd, 0xbe, 0x01, 0xda, 0x01, 0xe2, 0x01, + 0xe2, 0x01, 0xc2, 0x01, 0xfe, 0x01, 0x00, 0x00, }; static char swap_smsk[]={ - 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff, - 0xc0, 0xff, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0x07, - 0xff, 0x07, 0xff, 0x07, 0xff, 0x07, 0xff, 0x07, + 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xff, + 0xc0, 0xff, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, + 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, }; static BCursor SwapCursor = { -- cgit v1.2.3 From 489db9994df0bd95ac595922b38391ee68c3088f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 17 Jun 2009 20:33:34 +0000 Subject: Some generic modules from blender 2.4x building with py3k and mostly working. * Mathutils, Geometry, BGL, Mostly working, some //XXX comments for things to fix with py3 python import override (bpy_internal_import.c) so you can import python internal scripts from the BGE and running blender normally. --- source/blender/python/SConscript | 4 + source/blender/python/generic/BGL.c | 1605 +++++++++++++++++ source/blender/python/generic/BGL.h | 337 ++++ source/blender/python/generic/Geometry.c | 522 ++++++ source/blender/python/generic/Geometry.h | 39 + source/blender/python/generic/Mathutils.c | 1712 ++++++++++++++++++ source/blender/python/generic/Mathutils.h | 100 ++ .../blender/python/generic/bpy_internal_import.c | 341 ++++ .../blender/python/generic/bpy_internal_import.h | 49 + source/blender/python/generic/euler.c | 558 ++++++ source/blender/python/generic/euler.h | 65 + source/blender/python/generic/matrix.c | 1002 +++++++++++ source/blender/python/generic/matrix.h | 77 + source/blender/python/generic/quat.c | 765 ++++++++ source/blender/python/generic/quat.h | 72 + source/blender/python/generic/vector.c | 1838 ++++++++++++++++++++ source/blender/python/generic/vector.h | 60 + source/blender/python/intern/bpy_interface.c | 17 +- source/gameengine/Ketsji/KX_PythonInit.cpp | 53 +- source/gameengine/Ketsji/SConscript | 31 +- 20 files changed, 9196 insertions(+), 51 deletions(-) create mode 100644 source/blender/python/generic/BGL.c create mode 100755 source/blender/python/generic/BGL.h create mode 100644 source/blender/python/generic/Geometry.c create mode 100644 source/blender/python/generic/Geometry.h create mode 100644 source/blender/python/generic/Mathutils.c create mode 100644 source/blender/python/generic/Mathutils.h create mode 100644 source/blender/python/generic/bpy_internal_import.c create mode 100644 source/blender/python/generic/bpy_internal_import.h create mode 100644 source/blender/python/generic/euler.c create mode 100644 source/blender/python/generic/euler.h create mode 100644 source/blender/python/generic/matrix.c create mode 100644 source/blender/python/generic/matrix.h create mode 100644 source/blender/python/generic/quat.c create mode 100644 source/blender/python/generic/quat.h create mode 100644 source/blender/python/generic/vector.c create mode 100644 source/blender/python/generic/vector.h (limited to 'source') diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index 9d7fcf6a9cf..93b23a9c4cf 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -15,3 +15,7 @@ if env['OURPLATFORM'] in ('win32-mingw', 'win32-vc') and env['BF_DEBUG']: env.BlenderLib( libname = 'bf_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [140]) + +# generic XXX todo, BGE currently uses these externally +# sources = env.Glob('generic/*.c') +# env.BlenderLib( libname = 'bf_gen_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [140]) diff --git a/source/blender/python/generic/BGL.c b/source/blender/python/generic/BGL.c new file mode 100644 index 00000000000..f1a72270ea1 --- /dev/null +++ b/source/blender/python/generic/BGL.c @@ -0,0 +1,1605 @@ +/* + * $Id: BGL.c 20922 2009-06-16 07:16:51Z campbellbarton $ + * + * ***** BEGIN GPL 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. + * + * 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): Willian P. Germano + * + * ***** END GPL LICENSE BLOCK ***** +*/ + +/* This file is the Blender.BGL part of opy_draw.c, from the old + * bpython/intern dir, with minor changes to adapt it to the new Python + * implementation. The BGL submodule "wraps" OpenGL functions and constants, + * allowing script writers to make OpenGL calls in their Python scripts. */ + +#include "BGL.h" /*This must come first */ + +#include "MEM_guardedalloc.h" + +static int type_size( int type ); +static Buffer *make_buffer( int type, int ndimensions, int *dimensions ); + +static char Method_Buffer_doc[] = + "(type, dimensions, [template]) - Create a new Buffer object\n\n\ +(type) - The format to store data in\n\ +(dimensions) - An int or sequence specifying the dimensions of the buffer\n\ +[template] - A sequence of matching dimensions to the buffer to be created\n\ + which will be used to initialize the Buffer.\n\n\ +If a template is not passed in all fields will be initialized to 0.\n\n\ +The type should be one of GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT, or GL_DOUBLE.\n\ +If the dimensions are specified as an int a linear buffer will be\n\ +created. If a sequence is passed for the dimensions the buffer\n\ +will have len(sequence) dimensions, where the size for each dimension\n\ +is determined by the value in the sequence at that index.\n\n\ +For example, passing [100, 100] will create a 2 dimensional\n\ +square buffer. Passing [16, 16, 32] will create a 3 dimensional\n\ +buffer which is twice as deep as it is wide or high."; + +static PyObject *Method_Buffer( PyObject * self, PyObject * args ); + +/* Buffer sequence methods */ + +static int Buffer_len( PyObject * self ); +static PyObject *Buffer_item( PyObject * self, int i ); +static PyObject *Buffer_slice( PyObject * self, int begin, int end ); +static int Buffer_ass_item( PyObject * self, int i, PyObject * v ); +static int Buffer_ass_slice( PyObject * self, int begin, int end, + PyObject * seq ); + +static PySequenceMethods Buffer_SeqMethods = { + ( inquiry ) Buffer_len, /*sq_length */ + ( binaryfunc ) 0, /*sq_concat */ + ( ssizeargfunc ) 0, /*sq_repeat */ + ( ssizeargfunc ) Buffer_item, /*sq_item */ + ( ssizessizeargfunc ) Buffer_slice, /*sq_slice */ + ( ssizeobjargproc ) Buffer_ass_item, /*sq_ass_item */ + ( ssizessizeobjargproc ) Buffer_ass_slice, /*sq_ass_slice */ +}; + +static void Buffer_dealloc( PyObject * self ); +static PyObject *Buffer_tolist( PyObject * self ); +static PyObject *Buffer_dimensions( PyObject * self ); +static PyObject *Buffer_getattr( PyObject * self, char *name ); +static PyObject *Buffer_repr( PyObject * self ); + +PyTypeObject buffer_Type = { + PyObject_HEAD_INIT( NULL ) /* required python macro */ + 0, /*ob_size */ + "buffer", /*tp_name */ + sizeof( Buffer ), /*tp_basicsize */ + 0, /*tp_itemsize */ + ( destructor ) Buffer_dealloc, /*tp_dealloc */ + ( printfunc ) 0, /*tp_print */ + ( getattrfunc ) Buffer_getattr, /*tp_getattr */ + ( setattrfunc ) 0, /*tp_setattr */ + 0, /*tp_compare */ + ( reprfunc ) Buffer_repr, /*tp_repr */ + 0, /*tp_as_number */ + &Buffer_SeqMethods, /*tp_as_sequence */ +}; + +/* #ifndef __APPLE__ */ + +#define BGL_Wrap(nargs, funcname, ret, arg_list) \ +static PyObject *Method_##funcname (PyObject *self, PyObject *args) {\ + arg_def##nargs arg_list; \ + ret_def_##ret; \ + if(!PyArg_ParseTuple(args, arg_str##nargs arg_list, arg_ref##nargs arg_list)) return NULL;\ + ret_set_##ret gl##funcname (arg_var##nargs arg_list);\ + ret_ret_##ret; \ +} + +#define BGLU_Wrap(nargs, funcname, ret, arg_list) \ +static PyObject *Method_##funcname (PyObject *self, PyObject *args) {\ + arg_def##nargs arg_list; \ + ret_def_##ret; \ + if(!PyArg_ParseTuple(args, arg_str##nargs arg_list, arg_ref##nargs arg_list)) return NULL;\ + ret_set_##ret glu##funcname (arg_var##nargs arg_list);\ + ret_ret_##ret; \ +} + +/* #endif */ + +/********/ +static int type_size(int type) +{ + switch (type) { + case GL_BYTE: + return sizeof(char); + case GL_SHORT: + return sizeof(short); + case GL_INT: + return sizeof(int); + case GL_FLOAT: + return sizeof(float); + case GL_DOUBLE: + return sizeof(double); + } + return -1; +} + +static Buffer *make_buffer(int type, int ndimensions, int *dimensions) +{ + Buffer *buffer; + void *buf= NULL; + int i, size, length; + + length= 1; + for (i=0; iparent= NULL; + buffer->ndimensions= ndimensions; + buffer->dimensions= dimensions; + buffer->type= type; + buffer->buf.asvoid= buf; + + for (i= 0; ibuf.asbyte[i]= 0; + else if (type==GL_SHORT) + buffer->buf.asshort[i]= 0; + else if (type==GL_INT) + buffer->buf.asint[i]= 0; + else if (type==GL_FLOAT) + buffer->buf.asfloat[i]= 0.0f; + else if (type==GL_DOUBLE) + buffer->buf.asdouble[i]= 0.0; + } + return buffer; +} + +static PyObject *Method_Buffer (PyObject *self, PyObject *args) +{ + PyObject *length_ob= NULL, *template= NULL; + Buffer *buffer; + + int i, type; + int *dimensions = 0, ndimensions = 0; + + if (!PyArg_ParseTuple(args, "iO|O", &type, &length_ob, &template)) { + PyErr_SetString(PyExc_AttributeError, "expected an int and one or two PyObjects"); + return NULL; + } + if (type!=GL_BYTE && type!=GL_SHORT && type!=GL_INT && type!=GL_FLOAT && type!=GL_DOUBLE) { + PyErr_SetString(PyExc_AttributeError, "invalid first argument type, should be one of GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT or GL_DOUBLE"); + return NULL; + } + + if (PyNumber_Check(length_ob)) { + ndimensions= 1; + dimensions= MEM_mallocN(ndimensions*sizeof(int), "Buffer dimensions"); + dimensions[0]= PyLong_AsLong(length_ob); + } else if (PySequence_Check(length_ob)) { + ndimensions= PySequence_Length(length_ob); + dimensions= MEM_mallocN(ndimensions*sizeof(int), "Buffer dimensions"); + for (i=0; idimensions[0]; +} + +static PyObject *Buffer_item(PyObject *self, int i) +{ + Buffer *buf= (Buffer *) self; + + if (i >= buf->dimensions[0]) { + PyErr_SetString(PyExc_IndexError, "array index out of range"); + return NULL; + } + + if (buf->ndimensions==1) { + switch (buf->type) { + case GL_BYTE: return Py_BuildValue("b", buf->buf.asbyte[i]); + case GL_SHORT: return Py_BuildValue("h", buf->buf.asshort[i]); + case GL_INT: return Py_BuildValue("i", buf->buf.asint[i]); + case GL_FLOAT: return PyFloat_FromDouble(buf->buf.asfloat[i]); + case GL_DOUBLE: return Py_BuildValue("d", buf->buf.asdouble[i]); + } + } else { + Buffer *newbuf; + int j, length, size; + + length= 1; + for (j=1; jndimensions; j++) { + length*= buf->dimensions[j]; + } + size= type_size(buf->type); + + newbuf= (Buffer *) PyObject_NEW(Buffer, &buffer_Type); + + Py_INCREF(self); + newbuf->parent= self; + + newbuf->ndimensions= buf->ndimensions-1; + newbuf->type= buf->type; + newbuf->buf.asvoid= buf->buf.asbyte + i*length*size; + newbuf->dimensions= MEM_mallocN(newbuf->ndimensions*sizeof(int), + "Buffer dimensions"); + memcpy(newbuf->dimensions, buf->dimensions+1, + newbuf->ndimensions*sizeof(int)); + + return (PyObject *) newbuf; + } + + return NULL; +} + +static PyObject *Buffer_slice(PyObject *self, int begin, int end) +{ + Buffer *buf= (Buffer *) self; + PyObject *list; + int count; + + if (begin<0) begin= 0; + if (end>buf->dimensions[0]) + end= buf->dimensions[0]; + if (begin>end) begin= end; + + list= PyList_New(end-begin); + + for (count= begin; count= buf->dimensions[0]) { + PyErr_SetString(PyExc_IndexError, "array assignment index out of range"); + return -1; + } + + if (buf->ndimensions!=1) { + PyObject *row= Buffer_item(self, i); + int ret; + + if (!row) return -1; + ret= Buffer_ass_slice(row, 0, buf->dimensions[1], v); + Py_DECREF(row); + return ret; + } + + if (buf->type==GL_BYTE) { + if (!PyArg_Parse(v, "b;Coordinates must be ints", &buf->buf.asbyte[i])) + return -1; + } else if (buf->type==GL_SHORT) { + if (!PyArg_Parse(v, "h;Coordinates must be ints", &buf->buf.asshort[i])) + return -1; + + } else if (buf->type==GL_INT) { + if (!PyArg_Parse(v, "i;Coordinates must be ints", &buf->buf.asint[i])) + return -1; + } else if (buf->type==GL_FLOAT) { + if (!PyArg_Parse(v, "f;Coordinates must be floats", &buf->buf.asfloat[i])) + return -1; + } else if (buf->type==GL_DOUBLE) { + if (!PyArg_Parse(v, "d;Coordinates must be floats", &buf->buf.asdouble[i])) + return -1; + } + return 0; +} + +static int Buffer_ass_slice(PyObject *self, int begin, int end, PyObject *seq) +{ + Buffer *buf= (Buffer *) self; + PyObject *item; + int count, err=0; + + if (begin<0) begin= 0; + if (end>buf->dimensions[0]) end= buf->dimensions[0]; + if (begin>end) begin= end; + + if (!PySequence_Check(seq)) { + PyErr_SetString(PyExc_TypeError, + "illegal argument type for built-in operation"); + return -1; + } + + if (PySequence_Length(seq)!=(end-begin)) { + PyErr_SetString(PyExc_TypeError, "size mismatch in assignment"); + return -1; + } + + for (count= begin; countparent) Py_DECREF (buf->parent); + else MEM_freeN (buf->buf.asvoid); + + MEM_freeN (buf->dimensions); + + PyObject_DEL (self); +} + +static PyObject *Buffer_tolist(PyObject *self) +{ + int i, len= ((Buffer *)self)->dimensions[0]; + PyObject *list= PyList_New(len); + + for (i=0; indimensions); + int i; + + for (i= 0; indimensions; i++) { + PyList_SetItem(list, i, PyLong_FromLong(buffer->dimensions[i])); + } + + return list; +} + +static PyObject *Buffer_getattr(PyObject *self, char *name) +{ + if (strcmp(name, "list")==0) return Buffer_tolist(self); + else if (strcmp(name, "dimensions")==0) return Buffer_dimensions(self); + + PyErr_SetString(PyExc_AttributeError, name); + return NULL; +} + +static PyObject *Buffer_repr(PyObject *self) +{ + PyObject *list= Buffer_tolist(self); + PyObject *repr= PyObject_Repr(list); + Py_DECREF(list); + + return repr; +} + + +BGL_Wrap(2, Accum, void, (GLenum, GLfloat)) +BGL_Wrap(2, AlphaFunc, void, (GLenum, GLclampf)) +BGL_Wrap(3, AreTexturesResident, GLboolean, (GLsizei, GLuintP, GLbooleanP)) +BGL_Wrap(1, Begin, void, (GLenum)) +BGL_Wrap(2, BindTexture, void, (GLenum, GLuint)) +BGL_Wrap(7, Bitmap, void, (GLsizei, GLsizei, GLfloat, + GLfloat, GLfloat, GLfloat, GLubyteP)) +BGL_Wrap(2, BlendFunc, void, (GLenum, GLenum)) +BGL_Wrap(1, CallList, void, (GLuint)) +BGL_Wrap(3, CallLists, void, (GLsizei, GLenum, GLvoidP)) +BGL_Wrap(1, Clear, void, (GLbitfield)) +BGL_Wrap(4, ClearAccum, void, (GLfloat, GLfloat, GLfloat, GLfloat)) +BGL_Wrap(4, ClearColor, void, (GLclampf, GLclampf, GLclampf, GLclampf)) +BGL_Wrap(1, ClearDepth, void, (GLclampd)) +BGL_Wrap(1, ClearIndex, void, (GLfloat)) +BGL_Wrap(1, ClearStencil, void, (GLint)) +BGL_Wrap(2, ClipPlane, void, (GLenum, GLdoubleP)) +BGL_Wrap(3, Color3b, void, (GLbyte, GLbyte, GLbyte)) +BGL_Wrap(1, Color3bv, void, (GLbyteP)) +BGL_Wrap(3, Color3d, void, (GLdouble, GLdouble, GLdouble)) +BGL_Wrap(1, Color3dv, void, (GLdoubleP)) +BGL_Wrap(3, Color3f, void, (GLfloat, GLfloat, GLfloat)) +BGL_Wrap(1, Color3fv, void, (GLfloatP)) +BGL_Wrap(3, Color3i, void, (GLint, GLint, GLint)) +BGL_Wrap(1, Color3iv, void, (GLintP)) +BGL_Wrap(3, Color3s, void, (GLshort, GLshort, GLshort)) +BGL_Wrap(1, Color3sv, void, (GLshortP)) +BGL_Wrap(3, Color3ub, void, (GLubyte, GLubyte, GLubyte)) +BGL_Wrap(1, Color3ubv, void, (GLubyteP)) +BGL_Wrap(3, Color3ui, void, (GLuint, GLuint, GLuint)) +BGL_Wrap(1, Color3uiv, void, (GLuintP)) +BGL_Wrap(3, Color3us, void, (GLushort, GLushort, GLushort)) +BGL_Wrap(1, Color3usv, void, (GLushortP)) +BGL_Wrap(4, Color4b, void, (GLbyte, GLbyte, GLbyte, GLbyte)) +BGL_Wrap(1, Color4bv, void, (GLbyteP)) +BGL_Wrap(4, Color4d, void, (GLdouble, GLdouble, GLdouble, GLdouble)) +BGL_Wrap(1, Color4dv, void, (GLdoubleP)) +BGL_Wrap(4, Color4f, void, (GLfloat, GLfloat, GLfloat, GLfloat)) +BGL_Wrap(1, Color4fv, void, (GLfloatP)) +BGL_Wrap(4, Color4i, void, (GLint, GLint, GLint, GLint)) +BGL_Wrap(1, Color4iv, void, (GLintP)) +BGL_Wrap(4, Color4s, void, (GLshort, GLshort, GLshort, GLshort)) +BGL_Wrap(1, Color4sv, void, (GLshortP)) +BGL_Wrap(4, Color4ub, void, (GLubyte, GLubyte, GLubyte, GLubyte)) +BGL_Wrap(1, Color4ubv, void, (GLubyteP)) +BGL_Wrap(4, Color4ui, void, (GLuint, GLuint, GLuint, GLuint)) +BGL_Wrap(1, Color4uiv, void, (GLuintP)) +BGL_Wrap(4, Color4us, void, (GLushort, GLushort, GLushort, GLushort)) +BGL_Wrap(1, Color4usv, void, (GLushortP)) +BGL_Wrap(4, ColorMask, void, (GLboolean, GLboolean, GLboolean, GLboolean)) +BGL_Wrap(2, ColorMaterial, void, (GLenum, GLenum)) +BGL_Wrap(5, CopyPixels, void, (GLint, GLint, GLsizei, GLsizei, GLenum)) +BGL_Wrap(1, CullFace, void, (GLenum)) +BGL_Wrap(2, DeleteLists, void, (GLuint, GLsizei)) +BGL_Wrap(2, DeleteTextures, void, (GLsizei, GLuintP)) +BGL_Wrap(1, DepthFunc, void, (GLenum)) +BGL_Wrap(1, DepthMask, void, (GLboolean)) +BGL_Wrap(2, DepthRange, void, (GLclampd, GLclampd)) +BGL_Wrap(1, Disable, void, (GLenum)) +BGL_Wrap(1, DrawBuffer, void, (GLenum)) +BGL_Wrap(5, DrawPixels, void, (GLsizei, GLsizei, GLenum, GLenum, GLvoidP)) +BGL_Wrap(1, EdgeFlag, void, (GLboolean)) +BGL_Wrap(1, EdgeFlagv, void, (GLbooleanP)) +BGL_Wrap(1, Enable, void, (GLenum)) +BGL_Wrap(1, End, void, (void)) +BGL_Wrap(1, EndList, void, (void)) +BGL_Wrap(1, EvalCoord1d, void, (GLdouble)) +BGL_Wrap(1, EvalCoord1dv, void, (GLdoubleP)) +BGL_Wrap(1, EvalCoord1f, void, (GLfloat)) +BGL_Wrap(1, EvalCoord1fv, void, (GLfloatP)) +BGL_Wrap(2, EvalCoord2d, void, (GLdouble, GLdouble)) +BGL_Wrap(1, EvalCoord2dv, void, (GLdoubleP)) +BGL_Wrap(2, EvalCoord2f, void, (GLfloat, GLfloat)) +BGL_Wrap(1, EvalCoord2fv, void, (GLfloatP)) +BGL_Wrap(3, EvalMesh1, void, (GLenum, GLint, GLint)) +BGL_Wrap(5, EvalMesh2, void, (GLenum, GLint, GLint, GLint, GLint)) +BGL_Wrap(1, EvalPoint1, void, (GLint)) +BGL_Wrap(2, EvalPoint2, void, (GLint, GLint)) +BGL_Wrap(3, FeedbackBuffer, void, (GLsizei, GLenum, GLfloatP)) +BGL_Wrap(1, Finish, void, (void)) +BGL_Wrap(1, Flush, void, (void)) +BGL_Wrap(2, Fogf, void, (GLenum, GLfloat)) +BGL_Wrap(2, Fogfv, void, (GLenum, GLfloatP)) +BGL_Wrap(2, Fogi, void, (GLenum, GLint)) +BGL_Wrap(2, Fogiv, void, (GLenum, GLintP)) +BGL_Wrap(1, FrontFace, void, (GLenum)) +BGL_Wrap(6, Frustum, void, (GLdouble, GLdouble, + GLdouble, GLdouble, GLdouble, GLdouble)) +BGL_Wrap(1, GenLists, GLuint, (GLsizei)) +BGL_Wrap(2, GenTextures, void, (GLsizei, GLuintP)) +BGL_Wrap(2, GetBooleanv, void, (GLenum, GLbooleanP)) +BGL_Wrap(2, GetClipPlane, void, (GLenum, GLdoubleP)) +BGL_Wrap(2, GetDoublev, void, (GLenum, GLdoubleP)) +BGL_Wrap(1, GetError, GLenum, (void)) +BGL_Wrap(2, GetFloatv, void, (GLenum, GLfloatP)) +BGL_Wrap(2, GetIntegerv, void, (GLenum, GLintP)) +BGL_Wrap(3, GetLightfv, void, (GLenum, GLenum, GLfloatP)) +BGL_Wrap(3, GetLightiv, void, (GLenum, GLenum, GLintP)) +BGL_Wrap(3, GetMapdv, void, (GLenum, GLenum, GLdoubleP)) +BGL_Wrap(3, GetMapfv, void, (GLenum, GLenum, GLfloatP)) +BGL_Wrap(3, GetMapiv, void, (GLenum, GLenum, GLintP)) +BGL_Wrap(3, GetMaterialfv, void, (GLenum, GLenum, GLfloatP)) +BGL_Wrap(3, GetMaterialiv, void, (GLenum, GLenum, GLintP)) +BGL_Wrap(2, GetPixelMapfv, void, (GLenum, GLfloatP)) +BGL_Wrap(2, GetPixelMapuiv, void, (GLenum, GLuintP)) +BGL_Wrap(2, GetPixelMapusv, void, (GLenum, GLushortP)) +BGL_Wrap(1, GetPolygonStipple,void, (GLubyteP)) +BGL_Wrap(1, GetString, GLstring, (GLenum)) +BGL_Wrap(3, GetTexEnvfv, void, (GLenum, GLenum, GLfloatP)) +BGL_Wrap(3, GetTexEnviv, void, (GLenum, GLenum, GLintP)) +BGL_Wrap(3, GetTexGendv, void, (GLenum, GLenum, GLdoubleP)) +BGL_Wrap(3, GetTexGenfv, void, (GLenum, GLenum, GLfloatP)) +BGL_Wrap(3, GetTexGeniv, void, (GLenum, GLenum, GLintP)) +BGL_Wrap(5, GetTexImage, void, (GLenum, GLint, GLenum, GLenum, GLvoidP)) +BGL_Wrap(4, GetTexLevelParameterfv, void, (GLenum, GLint, GLenum, GLfloatP)) +BGL_Wrap(4, GetTexLevelParameteriv, void, (GLenum, GLint, GLenum, GLintP)) +BGL_Wrap(3, GetTexParameterfv, void, (GLenum, GLenum, GLfloatP)) +BGL_Wrap(3, GetTexParameteriv, void, (GLenum, GLenum, GLintP)) +BGL_Wrap(2, Hint, void, (GLenum, GLenum)) +BGL_Wrap(1, IndexMask, void, (GLuint)) +BGL_Wrap(1, Indexd, void, (GLdouble)) +BGL_Wrap(1, Indexdv, void, (GLdoubleP)) +BGL_Wrap(1, Indexf, void, (GLfloat)) +BGL_Wrap(1, Indexfv, void, (GLfloatP)) +BGL_Wrap(1, Indexi, void, (GLint)) +BGL_Wrap(1, Indexiv, void, (GLintP)) +BGL_Wrap(1, Indexs, void, (GLshort)) +BGL_Wrap(1, Indexsv, void, (GLshortP)) +BGL_Wrap(1, InitNames, void, (void)) +BGL_Wrap(1, IsEnabled, GLboolean, (GLenum)) +BGL_Wrap(1, IsList, GLboolean, (GLuint)) +BGL_Wrap(1, IsTexture, GLboolean, (GLuint)) +BGL_Wrap(2, LightModelf, void, (GLenum, GLfloat)) +BGL_Wrap(2, LightModelfv, void, (GLenum, GLfloatP)) +BGL_Wrap(2, LightModeli, void, (GLenum, GLint)) +BGL_Wrap(2, LightModeliv, void, (GLenum, GLintP)) +BGL_Wrap(3, Lightf, void, (GLenum, GLenum, GLfloat)) +BGL_Wrap(3, Lightfv, void, (GLenum, GLenum, GLfloatP)) +BGL_Wrap(3, Lighti, void, (GLenum, GLenum, GLint)) +BGL_Wrap(3, Lightiv, void, (GLenum, GLenum, GLintP)) +BGL_Wrap(2, LineStipple, void, (GLint, GLushort)) +BGL_Wrap(1, LineWidth, void, (GLfloat)) +BGL_Wrap(1, ListBase, void, (GLuint)) +BGL_Wrap(1, LoadIdentity, void, (void)) +BGL_Wrap(1, LoadMatrixd, void, (GLdoubleP)) +BGL_Wrap(1, LoadMatrixf, void, (GLfloatP)) +BGL_Wrap(1, LoadName, void, (GLuint)) +BGL_Wrap(1, LogicOp, void, (GLenum)) +BGL_Wrap(6, Map1d, void, (GLenum, GLdouble, GLdouble, + GLint, GLint, GLdoubleP)) +BGL_Wrap(6, Map1f, void, (GLenum, GLfloat, GLfloat, + GLint, GLint, GLfloatP)) +BGL_Wrap(10, Map2d, void, (GLenum, GLdouble, GLdouble, + GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdoubleP)) +BGL_Wrap(10, Map2f, void, (GLenum, GLfloat, GLfloat, + GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloatP)) +BGL_Wrap(3, MapGrid1d, void, (GLint, GLdouble, GLdouble)) +BGL_Wrap(3, MapGrid1f, void, (GLint, GLfloat, GLfloat)) +BGL_Wrap(6, MapGrid2d, void, (GLint, GLdouble, GLdouble, + GLint, GLdouble, GLdouble)) +BGL_Wrap(6, MapGrid2f, void, (GLint, GLfloat, GLfloat, + GLint, GLfloat, GLfloat)) +BGL_Wrap(3, Materialf, void, (GLenum, GLenum, GLfloat)) +BGL_Wrap(3, Materialfv, void, (GLenum, GLenum, GLfloatP)) +BGL_Wrap(3, Materiali, void, (GLenum, GLenum, GLint)) +BGL_Wrap(3, Materialiv, void, (GLenum, GLenum, GLintP)) +BGL_Wrap(1, MatrixMode, void, (GLenum)) +BGL_Wrap(1, MultMatrixd, void, (GLdoubleP)) +BGL_Wrap(1, MultMatrixf, void, (GLfloatP)) +BGL_Wrap(2, NewList, void, (GLuint, GLenum)) +BGL_Wrap(3, Normal3b, void, (GLbyte, GLbyte, GLbyte)) +BGL_Wrap(1, Normal3bv, void, (GLbyteP)) +BGL_Wrap(3, Normal3d, void, (GLdouble, GLdouble, GLdouble)) +BGL_Wrap(1, Normal3dv, void, (GLdoubleP)) +BGL_Wrap(3, Normal3f, void, (GLfloat, GLfloat, GLfloat)) +BGL_Wrap(1, Normal3fv, void, (GLfloatP)) +BGL_Wrap(3, Normal3i, void, (GLint, GLint, GLint)) +BGL_Wrap(1, Normal3iv, void, (GLintP)) +BGL_Wrap(3, Normal3s, void, (GLshort, GLshort, GLshort)) +BGL_Wrap(1, Normal3sv, void, (GLshortP)) +BGL_Wrap(6, Ortho, void, (GLdouble, GLdouble, + GLdouble, GLdouble, GLdouble, GLdouble)) +BGL_Wrap(1, PassThrough, void, (GLfloat)) +BGL_Wrap(3, PixelMapfv, void, (GLenum, GLint, GLfloatP)) +BGL_Wrap(3, PixelMapuiv, void, (GLenum, GLint, GLuintP)) +BGL_Wrap(3, PixelMapusv, void, (GLenum, GLint, GLushortP)) +BGL_Wrap(2, PixelStoref, void, (GLenum, GLfloat)) +BGL_Wrap(2, PixelStorei, void, (GLenum, GLint)) +BGL_Wrap(2, PixelTransferf, void, (GLenum, GLfloat)) +BGL_Wrap(2, PixelTransferi, void, (GLenum, GLint)) +BGL_Wrap(2, PixelZoom, void, (GLfloat, GLfloat)) +BGL_Wrap(1, PointSize, void, (GLfloat)) +BGL_Wrap(2, PolygonMode, void, (GLenum, GLenum)) +BGL_Wrap(2, PolygonOffset, void, (GLfloat, GLfloat)) +BGL_Wrap(1, PolygonStipple, void, (GLubyteP)) +BGL_Wrap(1, PopAttrib, void, (void)) +BGL_Wrap(1, PopClientAttrib, void, (void)) +BGL_Wrap(1, PopMatrix, void, (void)) +BGL_Wrap(1, PopName, void, (void)) +BGL_Wrap(3, PrioritizeTextures, void, (GLsizei, GLuintP, GLclampfP)) +BGL_Wrap(1, PushAttrib, void, (GLbitfield)) +BGL_Wrap(1, PushClientAttrib, void, (GLbitfield)) +BGL_Wrap(1, PushMatrix, void, (void)) +BGL_Wrap(1, PushName, void, (GLuint)) +BGL_Wrap(2, RasterPos2d, void, (GLdouble, GLdouble)) +BGL_Wrap(1, RasterPos2dv, void, (GLdoubleP)) +BGL_Wrap(2, RasterPos2f, void, (GLfloat, GLfloat)) +BGL_Wrap(1, RasterPos2fv, void, (GLfloatP)) +BGL_Wrap(2, RasterPos2i, void, (GLint, GLint)) +BGL_Wrap(1, RasterPos2iv, void, (GLintP)) +BGL_Wrap(2, RasterPos2s, void, (GLshort, GLshort)) +BGL_Wrap(1, RasterPos2sv, void, (GLshortP)) +BGL_Wrap(3, RasterPos3d, void, (GLdouble, GLdouble, GLdouble)) +BGL_Wrap(1, RasterPos3dv, void, (GLdoubleP)) +BGL_Wrap(3, RasterPos3f, void, (GLfloat, GLfloat, GLfloat)) +BGL_Wrap(1, RasterPos3fv, void, (GLfloatP)) +BGL_Wrap(3, RasterPos3i, void, (GLint, GLint, GLint)) +BGL_Wrap(1, RasterPos3iv, void, (GLintP)) +BGL_Wrap(3, RasterPos3s, void, (GLshort, GLshort, GLshort)) +BGL_Wrap(1, RasterPos3sv, void, (GLshortP)) +BGL_Wrap(4, RasterPos4d, void, (GLdouble, GLdouble, GLdouble, GLdouble)) +BGL_Wrap(1, RasterPos4dv, void, (GLdoubleP)) +BGL_Wrap(4, RasterPos4f, void, (GLfloat, GLfloat, GLfloat, GLfloat)) +BGL_Wrap(1, RasterPos4fv, void, (GLfloatP)) +BGL_Wrap(4, RasterPos4i, void, (GLint, GLint, GLint, GLint)) +BGL_Wrap(1, RasterPos4iv, void, (GLintP)) +BGL_Wrap(4, RasterPos4s, void, (GLshort, GLshort, GLshort, GLshort)) +BGL_Wrap(1, RasterPos4sv, void, (GLshortP)) +BGL_Wrap(1, ReadBuffer, void, (GLenum)) +BGL_Wrap(7, ReadPixels, void, (GLint, GLint, GLsizei, + GLsizei, GLenum, GLenum, GLvoidP)) +BGL_Wrap(4, Rectd, void, (GLdouble, GLdouble, GLdouble, GLdouble)) +BGL_Wrap(2, Rectdv, void, (GLdoubleP, GLdoubleP)) +BGL_Wrap(4, Rectf, void, (GLfloat, GLfloat, GLfloat, GLfloat)) +BGL_Wrap(2, Rectfv, void, (GLfloatP, GLfloatP)) +BGL_Wrap(4, Recti, void, (GLint, GLint, GLint, GLint)) +BGL_Wrap(2, Rectiv, void, (GLintP, GLintP)) +BGL_Wrap(4, Rects, void, (GLshort, GLshort, GLshort, GLshort)) +BGL_Wrap(2, Rectsv, void, (GLshortP, GLshortP)) +BGL_Wrap(1, RenderMode, GLint, (GLenum)) +BGL_Wrap(4, Rotated, void, (GLdouble, GLdouble, GLdouble, GLdouble)) +BGL_Wrap(4, Rotatef, void, (GLfloat, GLfloat, GLfloat, GLfloat)) +BGL_Wrap(3, Scaled, void, (GLdouble, GLdouble, GLdouble)) +BGL_Wrap(3, Scalef, void, (GLfloat, GLfloat, GLfloat)) +BGL_Wrap(4, Scissor, void, (GLint, GLint, GLsizei, GLsizei)) +BGL_Wrap(2, SelectBuffer, void, (GLsizei, GLuintP)) +BGL_Wrap(1, ShadeModel, void, (GLenum)) +BGL_Wrap(3, StencilFunc, void, (GLenum, GLint, GLuint)) +BGL_Wrap(1, StencilMask, void, (GLuint)) +BGL_Wrap(3, StencilOp, void, (GLenum, GLenum, GLenum)) +BGL_Wrap(1, TexCoord1d, void, (GLdouble)) +BGL_Wrap(1, TexCoord1dv, void, (GLdoubleP)) +BGL_Wrap(1, TexCoord1f, void, (GLfloat)) +BGL_Wrap(1, TexCoord1fv, void, (GLfloatP)) +BGL_Wrap(1, TexCoord1i, void, (GLint)) +BGL_Wrap(1, TexCoord1iv, void, (GLintP)) +BGL_Wrap(1, TexCoord1s, void, (GLshort)) +BGL_Wrap(1, TexCoord1sv, void, (GLshortP)) +BGL_Wrap(2, TexCoord2d, void, (GLdouble, GLdouble)) +BGL_Wrap(1, TexCoord2dv, void, (GLdoubleP)) +BGL_Wrap(2, TexCoord2f, void, (GLfloat, GLfloat)) +BGL_Wrap(1, TexCoord2fv, void, (GLfloatP)) +BGL_Wrap(2, TexCoord2i, void, (GLint, GLint)) +BGL_Wrap(1, TexCoord2iv, void, (GLintP)) +BGL_Wrap(2, TexCoord2s, void, (GLshort, GLshort)) +BGL_Wrap(1, TexCoord2sv, void, (GLshortP)) +BGL_Wrap(3, TexCoord3d, void, (GLdouble, GLdouble, GLdouble)) +BGL_Wrap(1, TexCoord3dv, void, (GLdoubleP)) +BGL_Wrap(3, TexCoord3f, void, (GLfloat, GLfloat, GLfloat)) +BGL_Wrap(1, TexCoord3fv, void, (GLfloatP)) +BGL_Wrap(3, TexCoord3i, void, (GLint, GLint, GLint)) +BGL_Wrap(1, TexCoord3iv, void, (GLintP)) +BGL_Wrap(3, TexCoord3s, void, (GLshort, GLshort, GLshort)) +BGL_Wrap(1, TexCoord3sv, void, (GLshortP)) +BGL_Wrap(4, TexCoord4d, void, (GLdouble, GLdouble, GLdouble, GLdouble)) +BGL_Wrap(1, TexCoord4dv, void, (GLdoubleP)) +BGL_Wrap(4, TexCoord4f, void, (GLfloat, GLfloat, GLfloat, GLfloat)) +BGL_Wrap(1, TexCoord4fv, void, (GLfloatP)) +BGL_Wrap(4, TexCoord4i, void, (GLint, GLint, GLint, GLint)) +BGL_Wrap(1, TexCoord4iv, void, (GLintP)) +BGL_Wrap(4, TexCoord4s, void, (GLshort, GLshort, GLshort, GLshort)) +BGL_Wrap(1, TexCoord4sv, void, (GLshortP)) +BGL_Wrap(3, TexEnvf, void, (GLenum, GLenum, GLfloat)) +BGL_Wrap(3, TexEnvfv, void, (GLenum, GLenum, GLfloatP)) +BGL_Wrap(3, TexEnvi, void, (GLenum, GLenum, GLint)) +BGL_Wrap(3, TexEnviv, void, (GLenum, GLenum, GLintP)) +BGL_Wrap(3, TexGend, void, (GLenum, GLenum, GLdouble)) +BGL_Wrap(3, TexGendv, void, (GLenum, GLenum, GLdoubleP)) +BGL_Wrap(3, TexGenf, void, (GLenum, GLenum, GLfloat)) +BGL_Wrap(3, TexGenfv, void, (GLenum, GLenum, GLfloatP)) +BGL_Wrap(3, TexGeni, void, (GLenum, GLenum, GLint)) +BGL_Wrap(3, TexGeniv, void, (GLenum, GLenum, GLintP)) +BGL_Wrap(8, TexImage1D, void, (GLenum, GLint, GLint, + GLsizei, GLint, GLenum, GLenum, GLvoidP)) +BGL_Wrap(9, TexImage2D, void, (GLenum, GLint, GLint, + GLsizei, GLsizei, GLint, GLenum, GLenum, GLvoidP)) +BGL_Wrap(3, TexParameterf, void, (GLenum, GLenum, GLfloat)) +BGL_Wrap(3, TexParameterfv, void, (GLenum, GLenum, GLfloatP)) +BGL_Wrap(3, TexParameteri, void, (GLenum, GLenum, GLint)) +BGL_Wrap(3, TexParameteriv, void, (GLenum, GLenum, GLintP)) +BGL_Wrap(3, Translated, void, (GLdouble, GLdouble, GLdouble)) +BGL_Wrap(3, Translatef, void, (GLfloat, GLfloat, GLfloat)) +BGL_Wrap(2, Vertex2d, void, (GLdouble, GLdouble)) +BGL_Wrap(1, Vertex2dv, void, (GLdoubleP)) +BGL_Wrap(2, Vertex2f, void, (GLfloat, GLfloat)) +BGL_Wrap(1, Vertex2fv, void, (GLfloatP)) +BGL_Wrap(2, Vertex2i, void, (GLint, GLint)) +BGL_Wrap(1, Vertex2iv, void, (GLintP)) +BGL_Wrap(2, Vertex2s, void, (GLshort, GLshort)) +BGL_Wrap(1, Vertex2sv, void, (GLshortP)) +BGL_Wrap(3, Vertex3d, void, (GLdouble, GLdouble, GLdouble)) +BGL_Wrap(1, Vertex3dv, void, (GLdoubleP)) +BGL_Wrap(3, Vertex3f, void, (GLfloat, GLfloat, GLfloat)) +BGL_Wrap(1, Vertex3fv, void, (GLfloatP)) +BGL_Wrap(3, Vertex3i, void, (GLint, GLint, GLint)) +BGL_Wrap(1, Vertex3iv, void, (GLintP)) +BGL_Wrap(3, Vertex3s, void, (GLshort, GLshort, GLshort)) +BGL_Wrap(1, Vertex3sv, void, (GLshortP)) +BGL_Wrap(4, Vertex4d, void, (GLdouble, GLdouble, GLdouble, GLdouble)) +BGL_Wrap(1, Vertex4dv, void, (GLdoubleP)) +BGL_Wrap(4, Vertex4f, void, (GLfloat, GLfloat, GLfloat, GLfloat)) +BGL_Wrap(1, Vertex4fv, void, (GLfloatP)) +BGL_Wrap(4, Vertex4i, void, (GLint, GLint, GLint, GLint)) +BGL_Wrap(1, Vertex4iv, void, (GLintP)) +BGL_Wrap(4, Vertex4s, void, (GLshort, GLshort, GLshort, GLshort)) +BGL_Wrap(1, Vertex4sv, void, (GLshortP)) +BGL_Wrap(4, Viewport, void, (GLint, GLint, GLsizei, GLsizei)) +BGLU_Wrap(4, Perspective, void, (GLdouble, GLdouble, GLdouble, GLdouble)) +BGLU_Wrap(9, LookAt, void, (GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble)) +BGLU_Wrap(4, Ortho2D, void, (GLdouble, GLdouble, GLdouble, GLdouble)) +BGLU_Wrap(5, PickMatrix, void, (GLdouble, GLdouble, GLdouble, GLdouble, GLintP)) +BGLU_Wrap(9, Project, GLint, (GLdouble, GLdouble, GLdouble, GLdoubleP, GLdoubleP, GLintP, GLdoubleP, GLdoubleP, GLdoubleP)) +BGLU_Wrap(9, UnProject, GLint, (GLdouble, GLdouble, GLdouble, GLdoubleP, GLdoubleP, GLintP, GLdoubleP, GLdoubleP, GLdoubleP)) + +#undef MethodDef +#define MethodDef(func) {"gl"#func, Method_##func, METH_VARARGS, "no string"} +#define MethodDefu(func) {"glu"#func, Method_##func, METH_VARARGS, "no string"} +/* So that MethodDef(Accum) becomes: + * {"glAccum", Method_Accumfunc, METH_VARARGS} */ + +static struct PyMethodDef BGL_methods[] = { + {"Buffer", Method_Buffer, METH_VARARGS, Method_Buffer_doc}, + +/* #ifndef __APPLE__ */ + MethodDef(Accum), + MethodDef(AlphaFunc), + MethodDef(AreTexturesResident), + MethodDef(Begin), + MethodDef(BindTexture), + MethodDef(Bitmap), + MethodDef(BlendFunc), + MethodDef(CallList), + MethodDef(CallLists), + MethodDef(Clear), + MethodDef(ClearAccum), + MethodDef(ClearColor), + MethodDef(ClearDepth), + MethodDef(ClearIndex), + MethodDef(ClearStencil), + MethodDef(ClipPlane), + MethodDef(Color3b), + MethodDef(Color3bv), + MethodDef(Color3d), + MethodDef(Color3dv), + MethodDef(Color3f), + MethodDef(Color3fv), + MethodDef(Color3i), + MethodDef(Color3iv), + MethodDef(Color3s), + MethodDef(Color3sv), + MethodDef(Color3ub), + MethodDef(Color3ubv), + MethodDef(Color3ui), + MethodDef(Color3uiv), + MethodDef(Color3us), + MethodDef(Color3usv), + MethodDef(Color4b), + MethodDef(Color4bv), + MethodDef(Color4d), + MethodDef(Color4dv), + MethodDef(Color4f), + MethodDef(Color4fv), + MethodDef(Color4i), + MethodDef(Color4iv), + MethodDef(Color4s), + MethodDef(Color4sv), + MethodDef(Color4ub), + MethodDef(Color4ubv), + MethodDef(Color4ui), + MethodDef(Color4uiv), + MethodDef(Color4us), + MethodDef(Color4usv), + MethodDef(ColorMask), + MethodDef(ColorMaterial), + MethodDef(CopyPixels), + MethodDef(CullFace), + MethodDef(DeleteLists), + MethodDef(DeleteTextures), + MethodDef(DepthFunc), + MethodDef(DepthMask), + MethodDef(DepthRange), + MethodDef(Disable), + MethodDef(DrawBuffer), + MethodDef(DrawPixels), + MethodDef(EdgeFlag), + MethodDef(EdgeFlagv), + MethodDef(Enable), + MethodDef(End), + MethodDef(EndList), + MethodDef(EvalCoord1d), + MethodDef(EvalCoord1dv), + MethodDef(EvalCoord1f), + MethodDef(EvalCoord1fv), + MethodDef(EvalCoord2d), + MethodDef(EvalCoord2dv), + MethodDef(EvalCoord2f), + MethodDef(EvalCoord2fv), + MethodDef(EvalMesh1), + MethodDef(EvalMesh2), + MethodDef(EvalPoint1), + MethodDef(EvalPoint2), + MethodDef(FeedbackBuffer), + MethodDef(Finish), + MethodDef(Flush), + MethodDef(Fogf), + MethodDef(Fogfv), + MethodDef(Fogi), + MethodDef(Fogiv), + MethodDef(FrontFace), + MethodDef(Frustum), + MethodDef(GenLists), + MethodDef(GenTextures), + MethodDef(GetBooleanv), + MethodDef(GetClipPlane), + MethodDef(GetDoublev), + MethodDef(GetError), + MethodDef(GetFloatv), + MethodDef(GetIntegerv), + MethodDef(GetLightfv), + MethodDef(GetLightiv), + MethodDef(GetMapdv), + MethodDef(GetMapfv), + MethodDef(GetMapiv), + MethodDef(GetMaterialfv), + MethodDef(GetMaterialiv), + MethodDef(GetPixelMapfv), + MethodDef(GetPixelMapuiv), + MethodDef(GetPixelMapusv), + MethodDef(GetPolygonStipple), + MethodDef(GetString), + MethodDef(GetTexEnvfv), + MethodDef(GetTexEnviv), + MethodDef(GetTexGendv), + MethodDef(GetTexGenfv), + MethodDef(GetTexGeniv), + MethodDef(GetTexImage), + MethodDef(GetTexLevelParameterfv), + MethodDef(GetTexLevelParameteriv), + MethodDef(GetTexParameterfv), + MethodDef(GetTexParameteriv), + MethodDef(Hint), + MethodDef(IndexMask), + MethodDef(Indexd), + MethodDef(Indexdv), + MethodDef(Indexf), + MethodDef(Indexfv), + MethodDef(Indexi), + MethodDef(Indexiv), + MethodDef(Indexs), + MethodDef(Indexsv), + MethodDef(InitNames), + MethodDef(IsEnabled), + MethodDef(IsList), + MethodDef(IsTexture), + MethodDef(LightModelf), + MethodDef(LightModelfv), + MethodDef(LightModeli), + MethodDef(LightModeliv), + MethodDef(Lightf), + MethodDef(Lightfv), + MethodDef(Lighti), + MethodDef(Lightiv), + MethodDef(LineStipple), + MethodDef(LineWidth), + MethodDef(ListBase), + MethodDef(LoadIdentity), + MethodDef(LoadMatrixd), + MethodDef(LoadMatrixf), + MethodDef(LoadName), + MethodDef(LogicOp), + MethodDef(Map1d), + MethodDef(Map1f), + MethodDef(Map2d), + MethodDef(Map2f), + MethodDef(MapGrid1d), + MethodDef(MapGrid1f), + MethodDef(MapGrid2d), + MethodDef(MapGrid2f), + MethodDef(Materialf), + MethodDef(Materialfv), + MethodDef(Materiali), + MethodDef(Materialiv), + MethodDef(MatrixMode), + MethodDef(MultMatrixd), + MethodDef(MultMatrixf), + MethodDef(NewList), + MethodDef(Normal3b), + MethodDef(Normal3bv), + MethodDef(Normal3d), + MethodDef(Normal3dv), + MethodDef(Normal3f), + MethodDef(Normal3fv), + MethodDef(Normal3i), + MethodDef(Normal3iv), + MethodDef(Normal3s), + MethodDef(Normal3sv), + MethodDef(Ortho), + MethodDef(PassThrough), + MethodDef(PixelMapfv), + MethodDef(PixelMapuiv), + MethodDef(PixelMapusv), + MethodDef(PixelStoref), + MethodDef(PixelStorei), + MethodDef(PixelTransferf), + MethodDef(PixelTransferi), + MethodDef(PixelZoom), + MethodDef(PointSize), + MethodDef(PolygonMode), + MethodDef(PolygonOffset), + MethodDef(PolygonStipple), + MethodDef(PopAttrib), + MethodDef(PopClientAttrib), + MethodDef(PopMatrix), + MethodDef(PopName), + MethodDef(PrioritizeTextures), + MethodDef(PushAttrib), + MethodDef(PushClientAttrib), + MethodDef(PushMatrix), + MethodDef(PushName), + MethodDef(RasterPos2d), + MethodDef(RasterPos2dv), + MethodDef(RasterPos2f), + MethodDef(RasterPos2fv), + MethodDef(RasterPos2i), + MethodDef(RasterPos2iv), + MethodDef(RasterPos2s), + MethodDef(RasterPos2sv), + MethodDef(RasterPos3d), + MethodDef(RasterPos3dv), + MethodDef(RasterPos3f), + MethodDef(RasterPos3fv), + MethodDef(RasterPos3i), + MethodDef(RasterPos3iv), + MethodDef(RasterPos3s), + MethodDef(RasterPos3sv), + MethodDef(RasterPos4d), + MethodDef(RasterPos4dv), + MethodDef(RasterPos4f), + MethodDef(RasterPos4fv), + MethodDef(RasterPos4i), + MethodDef(RasterPos4iv), + MethodDef(RasterPos4s), + MethodDef(RasterPos4sv), + MethodDef(ReadBuffer), + MethodDef(ReadPixels), + MethodDef(Rectd), + MethodDef(Rectdv), + MethodDef(Rectf), + MethodDef(Rectfv), + MethodDef(Recti), + MethodDef(Rectiv), + MethodDef(Rects), + MethodDef(Rectsv), + MethodDef(RenderMode), + MethodDef(Rotated), + MethodDef(Rotatef), + MethodDef(Scaled), + MethodDef(Scalef), + MethodDef(Scissor), + MethodDef(SelectBuffer), + MethodDef(ShadeModel), + MethodDef(StencilFunc), + MethodDef(StencilMask), + MethodDef(StencilOp), + MethodDef(TexCoord1d), + MethodDef(TexCoord1dv), + MethodDef(TexCoord1f), + MethodDef(TexCoord1fv), + MethodDef(TexCoord1i), + MethodDef(TexCoord1iv), + MethodDef(TexCoord1s), + MethodDef(TexCoord1sv), + MethodDef(TexCoord2d), + MethodDef(TexCoord2dv), + MethodDef(TexCoord2f), + MethodDef(TexCoord2fv), + MethodDef(TexCoord2i), + MethodDef(TexCoord2iv), + MethodDef(TexCoord2s), + MethodDef(TexCoord2sv), + MethodDef(TexCoord3d), + MethodDef(TexCoord3dv), + MethodDef(TexCoord3f), + MethodDef(TexCoord3fv), + MethodDef(TexCoord3i), + MethodDef(TexCoord3iv), + MethodDef(TexCoord3s), + MethodDef(TexCoord3sv), + MethodDef(TexCoord4d), + MethodDef(TexCoord4dv), + MethodDef(TexCoord4f), + MethodDef(TexCoord4fv), + MethodDef(TexCoord4i), + MethodDef(TexCoord4iv), + MethodDef(TexCoord4s), + MethodDef(TexCoord4sv), + MethodDef(TexEnvf), + MethodDef(TexEnvfv), + MethodDef(TexEnvi), + MethodDef(TexEnviv), + MethodDef(TexGend), + MethodDef(TexGendv), + MethodDef(TexGenf), + MethodDef(TexGenfv), + MethodDef(TexGeni), + MethodDef(TexGeniv), + MethodDef(TexImage1D), + MethodDef(TexImage2D), + MethodDef(TexParameterf), + MethodDef(TexParameterfv), + MethodDef(TexParameteri), + MethodDef(TexParameteriv), + MethodDef(Translated), + MethodDef(Translatef), + MethodDef(Vertex2d), + MethodDef(Vertex2dv), + MethodDef(Vertex2f), + MethodDef(Vertex2fv), + MethodDef(Vertex2i), + MethodDef(Vertex2iv), + MethodDef(Vertex2s), + MethodDef(Vertex2sv), + MethodDef(Vertex3d), + MethodDef(Vertex3dv), + MethodDef(Vertex3f), + MethodDef(Vertex3fv), + MethodDef(Vertex3i), + MethodDef(Vertex3iv), + MethodDef(Vertex3s), + MethodDef(Vertex3sv), + MethodDef(Vertex4d), + MethodDef(Vertex4dv), + MethodDef(Vertex4f), + MethodDef(Vertex4fv), + MethodDef(Vertex4i), + MethodDef(Vertex4iv), + MethodDef(Vertex4s), + MethodDef(Vertex4sv), + MethodDef(Viewport), + MethodDefu(Perspective), + MethodDefu(LookAt), + MethodDefu(Ortho2D), + MethodDefu(PickMatrix), + MethodDefu(Project), + MethodDefu(UnProject), +/* #endif */ + {NULL, NULL, 0, NULL} +}; + +#if (PY_VERSION_HEX >= 0x03000000) +static struct PyModuleDef BGL_module_def = { + {}, /* m_base */ + "BGL", /* m_name */ + 0, /* m_doc */ + 0, /* m_size */ + BGL_methods, /* m_methods */ + 0, /* m_reload */ + 0, /* m_traverse */ + 0, /* m_clear */ + 0, /* m_free */ +}; +#endif + +PyObject *BGL_Init(const char *from) +{ + PyObject *mod, *dict, *item; +#if (PY_VERSION_HEX >= 0x03000000) + mod = PyModule_Create(&BGL_module_def); + PyDict_SetItemString(PySys_GetObject("modules"), BGL_module_def.m_name, mod); +#else + mod= Py_InitModule(from, BGL_methods); +#endif + dict= PyModule_GetDict(mod); + + if( PyType_Ready( &buffer_Type) < 0) + return NULL; /* should never happen */ + +#define EXPP_ADDCONST(x) PyDict_SetItemString(dict, #x, item=PyLong_FromLong((int)x)); Py_DECREF(item) + +/* So, for example: + * EXPP_ADDCONST(GL_CURRENT_BIT) becomes + * PyDict_SetItemString(dict, "GL_CURRENT_BIT", item=PyLong_FromLong(GL_CURRENT_BIT)); Py_DECREF(item) */ + + EXPP_ADDCONST(GL_CURRENT_BIT); + EXPP_ADDCONST(GL_POINT_BIT); + EXPP_ADDCONST(GL_LINE_BIT); + EXPP_ADDCONST(GL_POLYGON_BIT); + EXPP_ADDCONST(GL_POLYGON_STIPPLE_BIT); + EXPP_ADDCONST(GL_PIXEL_MODE_BIT); + EXPP_ADDCONST(GL_LIGHTING_BIT); + EXPP_ADDCONST(GL_FOG_BIT); + EXPP_ADDCONST(GL_DEPTH_BUFFER_BIT); + EXPP_ADDCONST(GL_ACCUM_BUFFER_BIT); + EXPP_ADDCONST(GL_STENCIL_BUFFER_BIT); + EXPP_ADDCONST(GL_VIEWPORT_BIT); + EXPP_ADDCONST(GL_TRANSFORM_BIT); + EXPP_ADDCONST(GL_ENABLE_BIT); + EXPP_ADDCONST(GL_COLOR_BUFFER_BIT); + EXPP_ADDCONST(GL_HINT_BIT); + EXPP_ADDCONST(GL_EVAL_BIT); + EXPP_ADDCONST(GL_LIST_BIT); + EXPP_ADDCONST(GL_TEXTURE_BIT); + EXPP_ADDCONST(GL_SCISSOR_BIT); + EXPP_ADDCONST(GL_ALL_ATTRIB_BITS); + EXPP_ADDCONST(GL_CLIENT_ALL_ATTRIB_BITS); + + EXPP_ADDCONST(GL_FALSE); + EXPP_ADDCONST(GL_TRUE); + + EXPP_ADDCONST(GL_POINTS); + EXPP_ADDCONST(GL_LINES); + EXPP_ADDCONST(GL_LINE_LOOP); + EXPP_ADDCONST(GL_LINE_STRIP); + EXPP_ADDCONST(GL_TRIANGLES); + EXPP_ADDCONST(GL_TRIANGLE_STRIP); + EXPP_ADDCONST(GL_TRIANGLE_FAN); + EXPP_ADDCONST(GL_QUADS); + EXPP_ADDCONST(GL_QUAD_STRIP); + EXPP_ADDCONST(GL_POLYGON); + + EXPP_ADDCONST(GL_ACCUM); + EXPP_ADDCONST(GL_LOAD); + EXPP_ADDCONST(GL_RETURN); + EXPP_ADDCONST(GL_MULT); + EXPP_ADDCONST(GL_ADD); + + EXPP_ADDCONST(GL_NEVER); + EXPP_ADDCONST(GL_LESS); + EXPP_ADDCONST(GL_EQUAL); + EXPP_ADDCONST(GL_LEQUAL); + EXPP_ADDCONST(GL_GREATER); + EXPP_ADDCONST(GL_NOTEQUAL); + EXPP_ADDCONST(GL_GEQUAL); + EXPP_ADDCONST(GL_ALWAYS); + + EXPP_ADDCONST(GL_ZERO); + EXPP_ADDCONST(GL_ONE); + EXPP_ADDCONST(GL_SRC_COLOR); + EXPP_ADDCONST(GL_ONE_MINUS_SRC_COLOR); + EXPP_ADDCONST(GL_SRC_ALPHA); + EXPP_ADDCONST(GL_ONE_MINUS_SRC_ALPHA); + EXPP_ADDCONST(GL_DST_ALPHA); + EXPP_ADDCONST(GL_ONE_MINUS_DST_ALPHA); + + EXPP_ADDCONST(GL_DST_COLOR); + EXPP_ADDCONST(GL_ONE_MINUS_DST_COLOR); + EXPP_ADDCONST(GL_SRC_ALPHA_SATURATE); + + EXPP_ADDCONST(GL_NONE); + EXPP_ADDCONST(GL_FRONT_LEFT); + EXPP_ADDCONST(GL_FRONT_RIGHT); + EXPP_ADDCONST(GL_BACK_LEFT); + EXPP_ADDCONST(GL_BACK_RIGHT); + EXPP_ADDCONST(GL_FRONT); + EXPP_ADDCONST(GL_BACK); + EXPP_ADDCONST(GL_LEFT); + EXPP_ADDCONST(GL_RIGHT); + EXPP_ADDCONST(GL_FRONT_AND_BACK); + EXPP_ADDCONST(GL_AUX0); + EXPP_ADDCONST(GL_AUX1); + EXPP_ADDCONST(GL_AUX2); + EXPP_ADDCONST(GL_AUX3); + + EXPP_ADDCONST(GL_NO_ERROR); + EXPP_ADDCONST(GL_INVALID_ENUM); + EXPP_ADDCONST(GL_INVALID_VALUE); + EXPP_ADDCONST(GL_INVALID_OPERATION); + EXPP_ADDCONST(GL_STACK_OVERFLOW); + EXPP_ADDCONST(GL_STACK_UNDERFLOW); + EXPP_ADDCONST(GL_OUT_OF_MEMORY); + + EXPP_ADDCONST(GL_2D); + EXPP_ADDCONST(GL_3D); + EXPP_ADDCONST(GL_3D_COLOR); + EXPP_ADDCONST(GL_3D_COLOR_TEXTURE); + EXPP_ADDCONST(GL_4D_COLOR_TEXTURE); + + EXPP_ADDCONST(GL_PASS_THROUGH_TOKEN); + EXPP_ADDCONST(GL_POINT_TOKEN); + EXPP_ADDCONST(GL_LINE_TOKEN); + EXPP_ADDCONST(GL_POLYGON_TOKEN); + EXPP_ADDCONST(GL_BITMAP_TOKEN); + EXPP_ADDCONST(GL_DRAW_PIXEL_TOKEN); + EXPP_ADDCONST(GL_COPY_PIXEL_TOKEN); + EXPP_ADDCONST(GL_LINE_RESET_TOKEN); + + EXPP_ADDCONST(GL_EXP); + EXPP_ADDCONST(GL_EXP2); + + EXPP_ADDCONST(GL_CW); + EXPP_ADDCONST(GL_CCW); + + EXPP_ADDCONST(GL_COEFF); + EXPP_ADDCONST(GL_ORDER); + EXPP_ADDCONST(GL_DOMAIN); + + EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_I); + EXPP_ADDCONST(GL_PIXEL_MAP_S_TO_S); + EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_R); + EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_G); + EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_B); + EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_A); + EXPP_ADDCONST(GL_PIXEL_MAP_R_TO_R); + EXPP_ADDCONST(GL_PIXEL_MAP_G_TO_G); + EXPP_ADDCONST(GL_PIXEL_MAP_B_TO_B); + EXPP_ADDCONST(GL_PIXEL_MAP_A_TO_A); + + EXPP_ADDCONST(GL_CURRENT_COLOR); + EXPP_ADDCONST(GL_CURRENT_INDEX); + EXPP_ADDCONST(GL_CURRENT_NORMAL); + EXPP_ADDCONST(GL_CURRENT_TEXTURE_COORDS); + EXPP_ADDCONST(GL_CURRENT_RASTER_COLOR); + EXPP_ADDCONST(GL_CURRENT_RASTER_INDEX); + EXPP_ADDCONST(GL_CURRENT_RASTER_TEXTURE_COORDS); + EXPP_ADDCONST(GL_CURRENT_RASTER_POSITION); + EXPP_ADDCONST(GL_CURRENT_RASTER_POSITION_VALID); + EXPP_ADDCONST(GL_CURRENT_RASTER_DISTANCE); + EXPP_ADDCONST(GL_POINT_SMOOTH); + EXPP_ADDCONST(GL_POINT_SIZE); + EXPP_ADDCONST(GL_POINT_SIZE_RANGE); + EXPP_ADDCONST(GL_POINT_SIZE_GRANULARITY); + EXPP_ADDCONST(GL_LINE_SMOOTH); + EXPP_ADDCONST(GL_LINE_WIDTH); + EXPP_ADDCONST(GL_LINE_WIDTH_RANGE); + EXPP_ADDCONST(GL_LINE_WIDTH_GRANULARITY); + EXPP_ADDCONST(GL_LINE_STIPPLE); + EXPP_ADDCONST(GL_LINE_STIPPLE_PATTERN); + EXPP_ADDCONST(GL_LINE_STIPPLE_REPEAT); + EXPP_ADDCONST(GL_LIST_MODE); + EXPP_ADDCONST(GL_MAX_LIST_NESTING); + EXPP_ADDCONST(GL_LIST_BASE); + EXPP_ADDCONST(GL_LIST_INDEX); + EXPP_ADDCONST(GL_POLYGON_MODE); + EXPP_ADDCONST(GL_POLYGON_SMOOTH); + EXPP_ADDCONST(GL_POLYGON_STIPPLE); + EXPP_ADDCONST(GL_EDGE_FLAG); + EXPP_ADDCONST(GL_CULL_FACE); + EXPP_ADDCONST(GL_CULL_FACE_MODE); + EXPP_ADDCONST(GL_FRONT_FACE); + EXPP_ADDCONST(GL_LIGHTING); + EXPP_ADDCONST(GL_LIGHT_MODEL_LOCAL_VIEWER); + EXPP_ADDCONST(GL_LIGHT_MODEL_TWO_SIDE); + EXPP_ADDCONST(GL_LIGHT_MODEL_AMBIENT); + EXPP_ADDCONST(GL_SHADE_MODEL); + EXPP_ADDCONST(GL_COLOR_MATERIAL_FACE); + EXPP_ADDCONST(GL_COLOR_MATERIAL_PARAMETER); + EXPP_ADDCONST(GL_COLOR_MATERIAL); + EXPP_ADDCONST(GL_FOG); + EXPP_ADDCONST(GL_FOG_INDEX); + EXPP_ADDCONST(GL_FOG_DENSITY); + EXPP_ADDCONST(GL_FOG_START); + EXPP_ADDCONST(GL_FOG_END); + EXPP_ADDCONST(GL_FOG_MODE); + EXPP_ADDCONST(GL_FOG_COLOR); + EXPP_ADDCONST(GL_DEPTH_RANGE); + EXPP_ADDCONST(GL_DEPTH_TEST); + EXPP_ADDCONST(GL_DEPTH_WRITEMASK); + EXPP_ADDCONST(GL_DEPTH_CLEAR_VALUE); + EXPP_ADDCONST(GL_DEPTH_FUNC); + EXPP_ADDCONST(GL_ACCUM_CLEAR_VALUE); + EXPP_ADDCONST(GL_STENCIL_TEST); + EXPP_ADDCONST(GL_STENCIL_CLEAR_VALUE); + EXPP_ADDCONST(GL_STENCIL_FUNC); + EXPP_ADDCONST(GL_STENCIL_VALUE_MASK); + EXPP_ADDCONST(GL_STENCIL_FAIL); + EXPP_ADDCONST(GL_STENCIL_PASS_DEPTH_FAIL); + EXPP_ADDCONST(GL_STENCIL_PASS_DEPTH_PASS); + EXPP_ADDCONST(GL_STENCIL_REF); + EXPP_ADDCONST(GL_STENCIL_WRITEMASK); + EXPP_ADDCONST(GL_MATRIX_MODE); + EXPP_ADDCONST(GL_NORMALIZE); + EXPP_ADDCONST(GL_VIEWPORT); + EXPP_ADDCONST(GL_MODELVIEW_STACK_DEPTH); + EXPP_ADDCONST(GL_PROJECTION_STACK_DEPTH); + EXPP_ADDCONST(GL_TEXTURE_STACK_DEPTH); + EXPP_ADDCONST(GL_MODELVIEW_MATRIX); + EXPP_ADDCONST(GL_PROJECTION_MATRIX); + EXPP_ADDCONST(GL_TEXTURE_MATRIX); + EXPP_ADDCONST(GL_ATTRIB_STACK_DEPTH); + EXPP_ADDCONST(GL_ALPHA_TEST); + EXPP_ADDCONST(GL_ALPHA_TEST_FUNC); + EXPP_ADDCONST(GL_ALPHA_TEST_REF); + EXPP_ADDCONST(GL_DITHER); + EXPP_ADDCONST(GL_BLEND_DST); + EXPP_ADDCONST(GL_BLEND_SRC); + EXPP_ADDCONST(GL_BLEND); + EXPP_ADDCONST(GL_LOGIC_OP_MODE); + EXPP_ADDCONST(GL_LOGIC_OP); + EXPP_ADDCONST(GL_AUX_BUFFERS); + EXPP_ADDCONST(GL_DRAW_BUFFER); + EXPP_ADDCONST(GL_READ_BUFFER); + EXPP_ADDCONST(GL_SCISSOR_BOX); + EXPP_ADDCONST(GL_SCISSOR_TEST); + EXPP_ADDCONST(GL_INDEX_CLEAR_VALUE); + EXPP_ADDCONST(GL_INDEX_WRITEMASK); + EXPP_ADDCONST(GL_COLOR_CLEAR_VALUE); + EXPP_ADDCONST(GL_COLOR_WRITEMASK); + EXPP_ADDCONST(GL_INDEX_MODE); + EXPP_ADDCONST(GL_RGBA_MODE); + EXPP_ADDCONST(GL_DOUBLEBUFFER); + EXPP_ADDCONST(GL_STEREO); + EXPP_ADDCONST(GL_RENDER_MODE); + EXPP_ADDCONST(GL_PERSPECTIVE_CORRECTION_HINT); + EXPP_ADDCONST(GL_POINT_SMOOTH_HINT); + EXPP_ADDCONST(GL_LINE_SMOOTH_HINT); + EXPP_ADDCONST(GL_POLYGON_SMOOTH_HINT); + EXPP_ADDCONST(GL_FOG_HINT); + EXPP_ADDCONST(GL_TEXTURE_GEN_S); + EXPP_ADDCONST(GL_TEXTURE_GEN_T); + EXPP_ADDCONST(GL_TEXTURE_GEN_R); + EXPP_ADDCONST(GL_TEXTURE_GEN_Q); + EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_I_SIZE); + EXPP_ADDCONST(GL_PIXEL_MAP_S_TO_S_SIZE); + EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_R_SIZE); + EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_G_SIZE); + EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_B_SIZE); + EXPP_ADDCONST(GL_PIXEL_MAP_I_TO_A_SIZE); + EXPP_ADDCONST(GL_PIXEL_MAP_R_TO_R_SIZE); + EXPP_ADDCONST(GL_PIXEL_MAP_G_TO_G_SIZE); + EXPP_ADDCONST(GL_PIXEL_MAP_B_TO_B_SIZE); + EXPP_ADDCONST(GL_PIXEL_MAP_A_TO_A_SIZE); + EXPP_ADDCONST(GL_UNPACK_SWAP_BYTES); + EXPP_ADDCONST(GL_UNPACK_LSB_FIRST); + EXPP_ADDCONST(GL_UNPACK_ROW_LENGTH); + EXPP_ADDCONST(GL_UNPACK_SKIP_ROWS); + EXPP_ADDCONST(GL_UNPACK_SKIP_PIXELS); + EXPP_ADDCONST(GL_UNPACK_ALIGNMENT); + EXPP_ADDCONST(GL_PACK_SWAP_BYTES); + EXPP_ADDCONST(GL_PACK_LSB_FIRST); + EXPP_ADDCONST(GL_PACK_ROW_LENGTH); + EXPP_ADDCONST(GL_PACK_SKIP_ROWS); + EXPP_ADDCONST(GL_PACK_SKIP_PIXELS); + EXPP_ADDCONST(GL_PACK_ALIGNMENT); + EXPP_ADDCONST(GL_MAP_COLOR); + EXPP_ADDCONST(GL_MAP_STENCIL); + EXPP_ADDCONST(GL_INDEX_SHIFT); + EXPP_ADDCONST(GL_INDEX_OFFSET); + EXPP_ADDCONST(GL_RED_SCALE); + EXPP_ADDCONST(GL_RED_BIAS); + EXPP_ADDCONST(GL_ZOOM_X); + EXPP_ADDCONST(GL_ZOOM_Y); + EXPP_ADDCONST(GL_GREEN_SCALE); + EXPP_ADDCONST(GL_GREEN_BIAS); + EXPP_ADDCONST(GL_BLUE_SCALE); + EXPP_ADDCONST(GL_BLUE_BIAS); + EXPP_ADDCONST(GL_ALPHA_SCALE); + EXPP_ADDCONST(GL_ALPHA_BIAS); + EXPP_ADDCONST(GL_DEPTH_SCALE); + EXPP_ADDCONST(GL_DEPTH_BIAS); + EXPP_ADDCONST(GL_MAX_EVAL_ORDER); + EXPP_ADDCONST(GL_MAX_LIGHTS); + EXPP_ADDCONST(GL_MAX_CLIP_PLANES); + EXPP_ADDCONST(GL_MAX_TEXTURE_SIZE); + EXPP_ADDCONST(GL_MAX_PIXEL_MAP_TABLE); + EXPP_ADDCONST(GL_MAX_ATTRIB_STACK_DEPTH); + EXPP_ADDCONST(GL_MAX_MODELVIEW_STACK_DEPTH); + EXPP_ADDCONST(GL_MAX_NAME_STACK_DEPTH); + EXPP_ADDCONST(GL_MAX_PROJECTION_STACK_DEPTH); + EXPP_ADDCONST(GL_MAX_TEXTURE_STACK_DEPTH); + EXPP_ADDCONST(GL_MAX_VIEWPORT_DIMS); + EXPP_ADDCONST(GL_SUBPIXEL_BITS); + EXPP_ADDCONST(GL_INDEX_BITS); + EXPP_ADDCONST(GL_RED_BITS); + EXPP_ADDCONST(GL_GREEN_BITS); + EXPP_ADDCONST(GL_BLUE_BITS); + EXPP_ADDCONST(GL_ALPHA_BITS); + EXPP_ADDCONST(GL_DEPTH_BITS); + EXPP_ADDCONST(GL_STENCIL_BITS); + EXPP_ADDCONST(GL_ACCUM_RED_BITS); + EXPP_ADDCONST(GL_ACCUM_GREEN_BITS); + EXPP_ADDCONST(GL_ACCUM_BLUE_BITS); + EXPP_ADDCONST(GL_ACCUM_ALPHA_BITS); + EXPP_ADDCONST(GL_NAME_STACK_DEPTH); + EXPP_ADDCONST(GL_AUTO_NORMAL); + EXPP_ADDCONST(GL_MAP1_COLOR_4); + EXPP_ADDCONST(GL_MAP1_INDEX); + EXPP_ADDCONST(GL_MAP1_NORMAL); + EXPP_ADDCONST(GL_MAP1_TEXTURE_COORD_1); + EXPP_ADDCONST(GL_MAP1_TEXTURE_COORD_2); + EXPP_ADDCONST(GL_MAP1_TEXTURE_COORD_3); + EXPP_ADDCONST(GL_MAP1_TEXTURE_COORD_4); + EXPP_ADDCONST(GL_MAP1_VERTEX_3); + EXPP_ADDCONST(GL_MAP1_VERTEX_4); + EXPP_ADDCONST(GL_MAP2_COLOR_4); + EXPP_ADDCONST(GL_MAP2_INDEX); + EXPP_ADDCONST(GL_MAP2_NORMAL); + EXPP_ADDCONST(GL_MAP2_TEXTURE_COORD_1); + EXPP_ADDCONST(GL_MAP2_TEXTURE_COORD_2); + EXPP_ADDCONST(GL_MAP2_TEXTURE_COORD_3); + EXPP_ADDCONST(GL_MAP2_TEXTURE_COORD_4); + EXPP_ADDCONST(GL_MAP2_VERTEX_3); + EXPP_ADDCONST(GL_MAP2_VERTEX_4); + EXPP_ADDCONST(GL_MAP1_GRID_DOMAIN); + EXPP_ADDCONST(GL_MAP1_GRID_SEGMENTS); + EXPP_ADDCONST(GL_MAP2_GRID_DOMAIN); + EXPP_ADDCONST(GL_MAP2_GRID_SEGMENTS); + EXPP_ADDCONST(GL_TEXTURE_1D); + EXPP_ADDCONST(GL_TEXTURE_2D); + + EXPP_ADDCONST(GL_TEXTURE_WIDTH); + EXPP_ADDCONST(GL_TEXTURE_HEIGHT); + EXPP_ADDCONST(GL_TEXTURE_COMPONENTS); + EXPP_ADDCONST(GL_TEXTURE_BORDER_COLOR); + EXPP_ADDCONST(GL_TEXTURE_BORDER); + + EXPP_ADDCONST(GL_DONT_CARE); + EXPP_ADDCONST(GL_FASTEST); + EXPP_ADDCONST(GL_NICEST); + + EXPP_ADDCONST(GL_AMBIENT); + EXPP_ADDCONST(GL_DIFFUSE); + EXPP_ADDCONST(GL_SPECULAR); + EXPP_ADDCONST(GL_POSITION); + EXPP_ADDCONST(GL_SPOT_DIRECTION); + EXPP_ADDCONST(GL_SPOT_EXPONENT); + EXPP_ADDCONST(GL_SPOT_CUTOFF); + EXPP_ADDCONST(GL_CONSTANT_ATTENUATION); + EXPP_ADDCONST(GL_LINEAR_ATTENUATION); + EXPP_ADDCONST(GL_QUADRATIC_ATTENUATION); + + EXPP_ADDCONST(GL_COMPILE); + EXPP_ADDCONST(GL_COMPILE_AND_EXECUTE); + + EXPP_ADDCONST(GL_BYTE); + EXPP_ADDCONST(GL_UNSIGNED_BYTE); + EXPP_ADDCONST(GL_SHORT); + EXPP_ADDCONST(GL_UNSIGNED_SHORT); + EXPP_ADDCONST(GL_INT); + EXPP_ADDCONST(GL_UNSIGNED_INT); + EXPP_ADDCONST(GL_FLOAT); + EXPP_ADDCONST(GL_DOUBLE); + EXPP_ADDCONST(GL_2_BYTES); + EXPP_ADDCONST(GL_3_BYTES); + EXPP_ADDCONST(GL_4_BYTES); + + EXPP_ADDCONST(GL_CLEAR); + EXPP_ADDCONST(GL_AND); + EXPP_ADDCONST(GL_AND_REVERSE); + EXPP_ADDCONST(GL_COPY); + EXPP_ADDCONST(GL_AND_INVERTED); + EXPP_ADDCONST(GL_NOOP); + EXPP_ADDCONST(GL_XOR); + EXPP_ADDCONST(GL_OR); + EXPP_ADDCONST(GL_NOR); + EXPP_ADDCONST(GL_EQUIV); + EXPP_ADDCONST(GL_INVERT); + EXPP_ADDCONST(GL_OR_REVERSE); + EXPP_ADDCONST(GL_COPY_INVERTED); + EXPP_ADDCONST(GL_OR_INVERTED); + EXPP_ADDCONST(GL_NAND); + EXPP_ADDCONST(GL_SET); + + EXPP_ADDCONST(GL_EMISSION); + EXPP_ADDCONST(GL_SHININESS); + EXPP_ADDCONST(GL_AMBIENT_AND_DIFFUSE); + EXPP_ADDCONST(GL_COLOR_INDEXES); + + EXPP_ADDCONST(GL_MODELVIEW); + EXPP_ADDCONST(GL_PROJECTION); + EXPP_ADDCONST(GL_TEXTURE); + + EXPP_ADDCONST(GL_COLOR); + EXPP_ADDCONST(GL_DEPTH); + EXPP_ADDCONST(GL_STENCIL); + + EXPP_ADDCONST(GL_COLOR_INDEX); + EXPP_ADDCONST(GL_STENCIL_INDEX); + EXPP_ADDCONST(GL_DEPTH_COMPONENT); + EXPP_ADDCONST(GL_RED); + EXPP_ADDCONST(GL_GREEN); + EXPP_ADDCONST(GL_BLUE); + EXPP_ADDCONST(GL_ALPHA); + EXPP_ADDCONST(GL_RGB); + EXPP_ADDCONST(GL_RGBA); + EXPP_ADDCONST(GL_LUMINANCE); + EXPP_ADDCONST(GL_LUMINANCE_ALPHA); + + EXPP_ADDCONST(GL_BITMAP); + + EXPP_ADDCONST(GL_POINT); + EXPP_ADDCONST(GL_LINE); + EXPP_ADDCONST(GL_FILL); + + EXPP_ADDCONST(GL_RENDER); + EXPP_ADDCONST(GL_FEEDBACK); + EXPP_ADDCONST(GL_SELECT); + + EXPP_ADDCONST(GL_FLAT); + EXPP_ADDCONST(GL_SMOOTH); + + EXPP_ADDCONST(GL_KEEP); + EXPP_ADDCONST(GL_REPLACE); + EXPP_ADDCONST(GL_INCR); + EXPP_ADDCONST(GL_DECR); + + EXPP_ADDCONST(GL_VENDOR); + EXPP_ADDCONST(GL_RENDERER); + EXPP_ADDCONST(GL_VERSION); + EXPP_ADDCONST(GL_EXTENSIONS); + + EXPP_ADDCONST(GL_S); + EXPP_ADDCONST(GL_T); + EXPP_ADDCONST(GL_R); + EXPP_ADDCONST(GL_Q); + + EXPP_ADDCONST(GL_MODULATE); + EXPP_ADDCONST(GL_DECAL); + + EXPP_ADDCONST(GL_TEXTURE_ENV_MODE); + EXPP_ADDCONST(GL_TEXTURE_ENV_COLOR); + + EXPP_ADDCONST(GL_TEXTURE_ENV); + + EXPP_ADDCONST(GL_EYE_LINEAR); + EXPP_ADDCONST(GL_OBJECT_LINEAR); + EXPP_ADDCONST(GL_SPHERE_MAP); + + EXPP_ADDCONST(GL_TEXTURE_GEN_MODE); + EXPP_ADDCONST(GL_OBJECT_PLANE); + EXPP_ADDCONST(GL_EYE_PLANE); + + EXPP_ADDCONST(GL_NEAREST); + EXPP_ADDCONST(GL_LINEAR); + + EXPP_ADDCONST(GL_NEAREST_MIPMAP_NEAREST); + EXPP_ADDCONST(GL_LINEAR_MIPMAP_NEAREST); + EXPP_ADDCONST(GL_NEAREST_MIPMAP_LINEAR); + EXPP_ADDCONST(GL_LINEAR_MIPMAP_LINEAR); + + EXPP_ADDCONST(GL_TEXTURE_MAG_FILTER); + EXPP_ADDCONST(GL_TEXTURE_MIN_FILTER); + EXPP_ADDCONST(GL_TEXTURE_WRAP_S); + EXPP_ADDCONST(GL_TEXTURE_WRAP_T); + + EXPP_ADDCONST(GL_CLAMP); + EXPP_ADDCONST(GL_REPEAT); + + EXPP_ADDCONST(GL_CLIP_PLANE0); + EXPP_ADDCONST(GL_CLIP_PLANE1); + EXPP_ADDCONST(GL_CLIP_PLANE2); + EXPP_ADDCONST(GL_CLIP_PLANE3); + EXPP_ADDCONST(GL_CLIP_PLANE4); + EXPP_ADDCONST(GL_CLIP_PLANE5); + + EXPP_ADDCONST(GL_LIGHT0); + EXPP_ADDCONST(GL_LIGHT1); + EXPP_ADDCONST(GL_LIGHT2); + EXPP_ADDCONST(GL_LIGHT3); + EXPP_ADDCONST(GL_LIGHT4); + EXPP_ADDCONST(GL_LIGHT5); + EXPP_ADDCONST(GL_LIGHT6); + EXPP_ADDCONST(GL_LIGHT7); + + EXPP_ADDCONST(GL_POLYGON_OFFSET_UNITS); + EXPP_ADDCONST(GL_POLYGON_OFFSET_POINT); + EXPP_ADDCONST(GL_POLYGON_OFFSET_LINE); + EXPP_ADDCONST(GL_POLYGON_OFFSET_FILL); + EXPP_ADDCONST(GL_POLYGON_OFFSET_FACTOR); + + EXPP_ADDCONST(GL_TEXTURE_PRIORITY); + EXPP_ADDCONST(GL_TEXTURE_RESIDENT); + EXPP_ADDCONST(GL_TEXTURE_BINDING_1D); + EXPP_ADDCONST(GL_TEXTURE_BINDING_2D); + + return mod; +} + diff --git a/source/blender/python/generic/BGL.h b/source/blender/python/generic/BGL.h new file mode 100755 index 00000000000..345536d64be --- /dev/null +++ b/source/blender/python/generic/BGL.h @@ -0,0 +1,337 @@ +/* + * $Id: BGL.h 19717 2009-04-14 17:19:09Z campbellbarton $ + * + * ***** BEGIN GPL 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. + * + * 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): Willian P. Germano + * + * ***** END GPL LICENSE BLOCK ***** +*/ + +/* This is the Blender.BGL part of opy_draw.c, from the old bpython/intern + * dir, with minor changes to adapt it to the new Python implementation. + * The BGL submodule "wraps" OpenGL functions and constants, allowing script + * writers to make OpenGL calls in their Python scripts for Blender. The + * more important original comments are marked with an @ symbol. */ + +#ifndef EXPP_BGL_H +#define EXPP_BGL_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include "BIF_gl.h" + +PyObject *BGL_Init( const char *from ); + +/*@ Buffer Object */ +/*@ For Python access to OpenGL functions requiring a pointer. */ + +typedef struct _Buffer { + PyObject_VAR_HEAD + PyObject * parent; + + int type; /* GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT */ + int ndimensions; + int *dimensions; + + union { + char *asbyte; + short *asshort; + int *asint; + float *asfloat; + double *asdouble; + + void *asvoid; + } buf; +} Buffer; + + +/*@ By golly George! It looks like fancy pants macro time!!! */ + +/* +#define int_str "i" +#define int_var(number) bgl_int##number +#define int_ref(number) &bgl_int##number +#define int_def(number) int int_var(number) + +#define float_str "f" +#define float_var(number) bgl_float##number +#define float_ref(number) &bgl_float##number +#define float_def(number) float float_var(number) +*/ + +/* TYPE_str is the string to pass to Py_ArgParse (for the format) */ +/* TYPE_var is the name to pass to the GL function */ +/* TYPE_ref is the pointer to pass to Py_ArgParse (to store in) */ +/* TYPE_def is the C initialization of the variable */ + +#define void_str "" +#define void_var(num) +#define void_ref(num) &bgl_var##num +#define void_def(num) char bgl_var##num + +#define buffer_str "O!" +#define buffer_var(number) (bgl_buffer##number)->buf.asvoid +#define buffer_ref(number) &buffer_Type, &bgl_buffer##number +#define buffer_def(number) Buffer *bgl_buffer##number + +/* GL Pointer fields, handled by buffer type */ +/* GLdoubleP, GLfloatP, GLintP, GLuintP, GLshortP */ + +#define GLbooleanP_str "O!" +#define GLbooleanP_var(number) (bgl_buffer##number)->buf.asvoid +#define GLbooleanP_ref(number) &buffer_Type, &bgl_buffer##number +#define GLbooleanP_def(number) Buffer *bgl_buffer##number + +#define GLbyteP_str "O!" +#define GLbyteP_var(number) (bgl_buffer##number)->buf.asvoid +#define GLbyteP_ref(number) &buffer_Type, &bgl_buffer##number +#define GLbyteP_def(number) Buffer *bgl_buffer##number + +#define GLubyteP_str "O!" +#define GLubyteP_var(number) (bgl_buffer##number)->buf.asvoid +#define GLubyteP_ref(number) &buffer_Type, &bgl_buffer##number +#define GLubyteP_def(number) Buffer *bgl_buffer##number + +#define GLintP_str "O!" +#define GLintP_var(number) (bgl_buffer##number)->buf.asvoid +#define GLintP_ref(number) &buffer_Type, &bgl_buffer##number +#define GLintP_def(number) Buffer *bgl_buffer##number + +#define GLuintP_str "O!" +#define GLuintP_var(number) (bgl_buffer##number)->buf.asvoid +#define GLuintP_ref(number) &buffer_Type, &bgl_buffer##number +#define GLuintP_def(number) Buffer *bgl_buffer##number + +#define GLshortP_str "O!" +#define GLshortP_var(number) (bgl_buffer##number)->buf.asvoid +#define GLshortP_ref(number) &buffer_Type, &bgl_buffer##number +#define GLshortP_def(number) Buffer *bgl_buffer##number + +#define GLushortP_str "O!" +#define GLushortP_var(number) (bgl_buffer##number)->buf.asvoid +#define GLushortP_ref(number) &buffer_Type, &bgl_buffer##number +#define GLushortP_def(number) Buffer *bgl_buffer##number + +#define GLfloatP_str "O!" +#define GLfloatP_var(number) (bgl_buffer##number)->buf.asvoid +#define GLfloatP_ref(number) &buffer_Type, &bgl_buffer##number +#define GLfloatP_def(number) Buffer *bgl_buffer##number + +#define GLdoubleP_str "O!" +#define GLdoubleP_var(number) (bgl_buffer##number)->buf.asvoid +#define GLdoubleP_ref(number) &buffer_Type, &bgl_buffer##number +#define GLdoubleP_def(number) Buffer *bgl_buffer##number + +#define GLclampfP_str "O!" +#define GLclampfP_var(number) (bgl_buffer##number)->buf.asvoid +#define GLclampfP_ref(number) &buffer_Type, &bgl_buffer##number +#define GLclampfP_def(number) Buffer *bgl_buffer##number + +#define GLvoidP_str "O!" +#define GLvoidP_var(number) (bgl_buffer##number)->buf.asvoid +#define GLvoidP_ref(number) &buffer_Type, &bgl_buffer##number +#define GLvoidP_def(number) Buffer *bgl_buffer##number + +#define buffer_str "O!" +#define buffer_var(number) (bgl_buffer##number)->buf.asvoid +#define buffer_ref(number) &buffer_Type, &bgl_buffer##number +#define buffer_def(number) Buffer *bgl_buffer##number + +/*@The standard GL typedefs are used as prototypes, we can't + * use the GL type directly because Py_ArgParse expects normal + * C types. + * + * Py_ArgParse doesn't grok writing into unsigned variables, + * so we use signed everything (even stuff that should be unsigned. + */ + +/* typedef unsigned int GLenum; */ +#define GLenum_str "i" +#define GLenum_var(num) bgl_var##num +#define GLenum_ref(num) &bgl_var##num +#define GLenum_def(num) /* unsigned */ int GLenum_var(num) + +/* typedef unsigned int GLboolean; */ +#define GLboolean_str "b" +#define GLboolean_var(num) bgl_var##num +#define GLboolean_ref(num) &bgl_var##num +#define GLboolean_def(num) /* unsigned */ char GLboolean_var(num) + +/* typedef unsigned int GLbitfield; */ +#define GLbitfield_str "i" +#define GLbitfield_var(num) bgl_var##num +#define GLbitfield_ref(num) &bgl_var##num +#define GLbitfield_def(num) /* unsigned */ int GLbitfield_var(num) + +/* typedef signed char GLbyte; */ +#define GLbyte_str "b" +#define GLbyte_var(num) bgl_var##num +#define GLbyte_ref(num) &bgl_var##num +#define GLbyte_def(num) signed char GLbyte_var(num) + +/* typedef short GLshort; */ +#define GLshort_str "h" +#define GLshort_var(num) bgl_var##num +#define GLshort_ref(num) &bgl_var##num +#define GLshort_def(num) short GLshort_var(num) + +/* typedef int GLint; */ +#define GLint_str "i" +#define GLint_var(num) bgl_var##num +#define GLint_ref(num) &bgl_var##num +#define GLint_def(num) int GLint_var(num) + +/* typedef int GLsizei; */ +#define GLsizei_str "i" +#define GLsizei_var(num) bgl_var##num +#define GLsizei_ref(num) &bgl_var##num +#define GLsizei_def(num) int GLsizei_var(num) + +/* typedef unsigned char GLubyte; */ +#define GLubyte_str "b" +#define GLubyte_var(num) bgl_var##num +#define GLubyte_ref(num) &bgl_var##num +#define GLubyte_def(num) /* unsigned */ char GLubyte_var(num) + +/* typedef unsigned short GLushort; */ +#define GLushort_str "h" +#define GLushort_var(num) bgl_var##num +#define GLushort_ref(num) &bgl_var##num +#define GLushort_def(num) /* unsigned */ short GLushort_var(num) + +/* typedef unsigned int GLuint; */ +#define GLuint_str "i" +#define GLuint_var(num) bgl_var##num +#define GLuint_ref(num) &bgl_var##num +#define GLuint_def(num) /* unsigned */ int GLuint_var(num) + +/* typedef float GLfloat; */ +#define GLfloat_str "f" +#define GLfloat_var(num) bgl_var##num +#define GLfloat_ref(num) &bgl_var##num +#define GLfloat_def(num) float GLfloat_var(num) + +/* typedef float GLclampf; */ +#define GLclampf_str "f" +#define GLclampf_var(num) bgl_var##num +#define GLclampf_ref(num) &bgl_var##num +#define GLclampf_def(num) float GLclampf_var(num) + +/* typedef double GLdouble; */ +#define GLdouble_str "d" +#define GLdouble_var(num) bgl_var##num +#define GLdouble_ref(num) &bgl_var##num +#define GLdouble_def(num) double GLdouble_var(num) + +/* typedef double GLclampd; */ +#define GLclampd_str "d" +#define GLclampd_var(num) bgl_var##num +#define GLclampd_ref(num) &bgl_var##num +#define GLclampd_def(num) double GLclampd_var(num) + +/* typedef void GLvoid; */ +/* #define GLvoid_str "" */ +/* #define GLvoid_var(num) bgl_var##num */ +/* #define GLvoid_ref(num) &bgl_var##num */ +/* #define GLvoid_def(num) char bgl_var##num */ + +#define arg_def1(a1) a1##_def(1) +#define arg_def2(a1, a2) arg_def1(a1); a2##_def(2) +#define arg_def3(a1, a2, a3) arg_def2(a1, a2); a3##_def(3) +#define arg_def4(a1, a2, a3, a4) arg_def3(a1, a2, a3); a4##_def(4) +#define arg_def5(a1, a2, a3, a4, a5) arg_def4(a1, a2, a3, a4); a5##_def(5) +#define arg_def6(a1, a2, a3, a4, a5, a6)arg_def5(a1, a2, a3, a4, a5); a6##_def(6) +#define arg_def7(a1, a2, a3, a4, a5, a6, a7)arg_def6(a1, a2, a3, a4, a5, a6); a7##_def(7) +#define arg_def8(a1, a2, a3, a4, a5, a6, a7, a8)arg_def7(a1, a2, a3, a4, a5, a6, a7); a8##_def(8) +#define arg_def9(a1, a2, a3, a4, a5, a6, a7, a8, a9)arg_def8(a1, a2, a3, a4, a5, a6, a7, a8); a9##_def(9) +#define arg_def10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)arg_def9(a1, a2, a3, a4, a5, a6, a7, a8, a9); a10##_def(10) + +#define arg_var1(a1) a1##_var(1) +#define arg_var2(a1, a2) arg_var1(a1), a2##_var(2) +#define arg_var3(a1, a2, a3) arg_var2(a1, a2), a3##_var(3) +#define arg_var4(a1, a2, a3, a4) arg_var3(a1, a2, a3), a4##_var(4) +#define arg_var5(a1, a2, a3, a4, a5) arg_var4(a1, a2, a3, a4), a5##_var(5) +#define arg_var6(a1, a2, a3, a4, a5, a6)arg_var5(a1, a2, a3, a4, a5), a6##_var(6) +#define arg_var7(a1, a2, a3, a4, a5, a6, a7)arg_var6(a1, a2, a3, a4, a5, a6), a7##_var(7) +#define arg_var8(a1, a2, a3, a4, a5, a6, a7, a8)arg_var7(a1, a2, a3, a4, a5, a6, a7), a8##_var(8) +#define arg_var9(a1, a2, a3, a4, a5, a6, a7, a8, a9)arg_var8(a1, a2, a3, a4, a5, a6, a7, a8), a9##_var(9) +#define arg_var10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)arg_var9(a1, a2, a3, a4, a5, a6, a7, a8, a9), a10##_var(10) + +#define arg_ref1(a1) a1##_ref(1) +#define arg_ref2(a1, a2) arg_ref1(a1), a2##_ref(2) +#define arg_ref3(a1, a2, a3) arg_ref2(a1, a2), a3##_ref(3) +#define arg_ref4(a1, a2, a3, a4) arg_ref3(a1, a2, a3), a4##_ref(4) +#define arg_ref5(a1, a2, a3, a4, a5) arg_ref4(a1, a2, a3, a4), a5##_ref(5) +#define arg_ref6(a1, a2, a3, a4, a5, a6)arg_ref5(a1, a2, a3, a4, a5), a6##_ref(6) +#define arg_ref7(a1, a2, a3, a4, a5, a6, a7)arg_ref6(a1, a2, a3, a4, a5, a6), a7##_ref(7) +#define arg_ref8(a1, a2, a3, a4, a5, a6, a7, a8)arg_ref7(a1, a2, a3, a4, a5, a6, a7), a8##_ref(8) +#define arg_ref9(a1, a2, a3, a4, a5, a6, a7, a8, a9)arg_ref8(a1, a2, a3, a4, a5, a6, a7, a8), a9##_ref(9) +#define arg_ref10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)arg_ref9(a1, a2, a3, a4, a5, a6, a7, a8, a9), a10##_ref(10) + +#define arg_str1(a1) a1##_str +#define arg_str2(a1, a2) arg_str1(a1) a2##_str +#define arg_str3(a1, a2, a3) arg_str2(a1, a2) a3##_str +#define arg_str4(a1, a2, a3, a4) arg_str3(a1, a2, a3) a4##_str +#define arg_str5(a1, a2, a3, a4, a5) arg_str4(a1, a2, a3, a4) a5##_str +#define arg_str6(a1, a2, a3, a4, a5, a6)arg_str5(a1, a2, a3, a4, a5) a6##_str +#define arg_str7(a1, a2, a3, a4, a5, a6, a7)arg_str6(a1, a2, a3, a4, a5, a6) a7##_str +#define arg_str8(a1, a2, a3, a4, a5, a6, a7, a8)arg_str7(a1, a2, a3, a4, a5, a6, a7) a8##_str +#define arg_str9(a1, a2, a3, a4, a5, a6, a7, a8, a9)arg_str8(a1, a2, a3, a4, a5, a6, a7, a8) a9##_str +#define arg_str10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)arg_str9(a1, a2, a3, a4, a5, a6, a7, a8, a9) a10##_str + +#define ret_def_void +#define ret_set_void +/* would use Py_RETURN_NONE - except for py 2.3 doesnt have it */ +#define ret_ret_void { Py_INCREF(Py_None); return Py_None; } + +#define ret_def_GLint int ret_int +#define ret_set_GLint ret_int= +#define ret_ret_GLint return PyLong_FromLong(ret_int); + +#define ret_def_GLuint unsigned int ret_uint +#define ret_set_GLuint ret_uint= +#define ret_ret_GLuint return PyLong_FromLong((long) ret_uint); + +#define ret_def_GLenum unsigned int ret_uint +#define ret_set_GLenum ret_uint= +#define ret_ret_GLenum return PyLong_FromLong((long) ret_uint); + +#define ret_def_GLboolean unsigned char ret_bool +#define ret_set_GLboolean ret_bool= +#define ret_ret_GLboolean return PyLong_FromLong((long) ret_bool); + +#define ret_def_GLstring const unsigned char *ret_str; +#define ret_set_GLstring ret_str= + +#define ret_ret_GLstring \ + if (ret_str) {\ + return PyUnicode_FromString(ret_str);\ + } else {\ + PyErr_SetString(PyExc_AttributeError, "could not get opengl string");\ + return NULL;\ + } + +#endif /* EXPP_BGL_H */ diff --git a/source/blender/python/generic/Geometry.c b/source/blender/python/generic/Geometry.c new file mode 100644 index 00000000000..d1e8b471f75 --- /dev/null +++ b/source/blender/python/generic/Geometry.c @@ -0,0 +1,522 @@ +/* + * $Id: Geometry.c 20922 2009-06-16 07:16:51Z campbellbarton $ + * + * ***** BEGIN GPL 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. + * + * 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, Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "Geometry.h" + +/* - Not needed for now though other geometry functions will probably need them +#include "BLI_arithb.h" +#include "BKE_utildefines.h" +*/ + +/* Used for PolyFill */ +#include "BKE_displist.h" +#include "MEM_guardedalloc.h" +#include "BLI_blenlib.h" + +#include "BKE_utildefines.h" +#include "BKE_curve.h" +#include "BLI_boxpack2d.h" +#include "BLI_arithb.h" + +#define SWAP_FLOAT(a,b,tmp) tmp=a; a=b; b=tmp +#define eul 0.000001 + +/*-- forward declarations -- */ +static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq ); +static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args ); +static PyObject *M_Geometry_ClosestPointOnLine( PyObject * self, PyObject * args ); +static PyObject *M_Geometry_PointInTriangle2D( PyObject * self, PyObject * args ); +static PyObject *M_Geometry_PointInQuad2D( PyObject * self, PyObject * args ); +static PyObject *M_Geometry_BoxPack2D( PyObject * self, PyObject * args ); +static PyObject *M_Geometry_BezierInterp( PyObject * self, PyObject * args ); + + +/*-------------------------DOC STRINGS ---------------------------*/ +static char M_Geometry_doc[] = "The Blender Geometry module\n\n"; +static char M_Geometry_PolyFill_doc[] = "(veclist_list) - takes a list of polylines (each point a vector) and returns the point indicies for a polyline filled with triangles"; +static char M_Geometry_LineIntersect2D_doc[] = "(lineA_p1, lineA_p2, lineB_p1, lineB_p2) - takes 2 lines (as 4 vectors) and returns a vector for their point of intersection or None"; +static char M_Geometry_ClosestPointOnLine_doc[] = "(pt, line_p1, line_p2) - takes a point and a line and returns a (Vector, float) for the point on the line, and the bool so you can know if the point was between the 2 points"; +static char M_Geometry_PointInTriangle2D_doc[] = "(pt, tri_p1, tri_p2, tri_p3) - takes 4 vectors, one is the point and the next 3 define the triangle, only the x and y are used from the vectors"; +static char M_Geometry_PointInQuad2D_doc[] = "(pt, quad_p1, quad_p2, quad_p3, quad_p4) - takes 5 vectors, one is the point and the next 4 define the quad, only the x and y are used from the vectors"; +static char M_Geometry_BoxPack2D_doc[] = ""; +static char M_Geometry_BezierInterp_doc[] = ""; +/*-----------------------METHOD DEFINITIONS ----------------------*/ +struct PyMethodDef M_Geometry_methods[] = { + {"PolyFill", ( PyCFunction ) M_Geometry_PolyFill, METH_O, M_Geometry_PolyFill_doc}, + {"LineIntersect2D", ( PyCFunction ) M_Geometry_LineIntersect2D, METH_VARARGS, M_Geometry_LineIntersect2D_doc}, + {"ClosestPointOnLine", ( PyCFunction ) M_Geometry_ClosestPointOnLine, METH_VARARGS, M_Geometry_ClosestPointOnLine_doc}, + {"PointInTriangle2D", ( PyCFunction ) M_Geometry_PointInTriangle2D, METH_VARARGS, M_Geometry_PointInTriangle2D_doc}, + {"PointInQuad2D", ( PyCFunction ) M_Geometry_PointInQuad2D, METH_VARARGS, M_Geometry_PointInQuad2D_doc}, + {"BoxPack2D", ( PyCFunction ) M_Geometry_BoxPack2D, METH_O, M_Geometry_BoxPack2D_doc}, + {"BezierInterp", ( PyCFunction ) M_Geometry_BezierInterp, METH_VARARGS, M_Geometry_BezierInterp_doc}, + {NULL, NULL, 0, NULL} +}; + +#if (PY_VERSION_HEX >= 0x03000000) +static struct PyModuleDef M_Geometry_module_def = { + {}, /* m_base */ + "Geometry", /* m_name */ + M_Geometry_doc, /* m_doc */ + 0, /* m_size */ + M_Geometry_methods, /* m_methods */ + 0, /* m_reload */ + 0, /* m_traverse */ + 0, /* m_clear */ + 0, /* m_free */ +}; +#endif + +/*----------------------------MODULE INIT-------------------------*/ +PyObject *Geometry_Init(const char *from) +{ + PyObject *submodule; + +#if (PY_VERSION_HEX >= 0x03000000) + submodule = PyModule_Create(&M_Geometry_module_def); + PyDict_SetItemString(PySys_GetObject("modules"), M_Geometry_module_def.m_name, submodule); +#else + submodule = Py_InitModule3(from, M_Geometry_methods, M_Geometry_doc); +#endif + + return (submodule); +} + +/*----------------------------------Geometry.PolyFill() -------------------*/ +/* PolyFill function, uses Blenders scanfill to fill multiple poly lines */ +static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq ) +{ + PyObject *tri_list; /*return this list of tri's */ + PyObject *polyLine, *polyVec; + int i, len_polylines, len_polypoints, ls_error = 0; + + /* display listbase */ + ListBase dispbase={NULL, NULL}; + DispList *dl; + float *fp; /*pointer to the array of malloced dl->verts to set the points from the vectors */ + int index, *dl_face, totpoints=0; + + + dispbase.first= dispbase.last= NULL; + + + if(!PySequence_Check(polyLineSeq)) { + PyErr_SetString( PyExc_TypeError, "expected a sequence of poly lines" ); + return NULL; + } + + len_polylines = PySequence_Size( polyLineSeq ); + + for( i = 0; i < len_polylines; ++i ) { + polyLine= PySequence_GetItem( polyLineSeq, i ); + if (!PySequence_Check(polyLine)) { + freedisplist(&dispbase); + Py_XDECREF(polyLine); /* may be null so use Py_XDECREF*/ + PyErr_SetString( PyExc_TypeError, "One or more of the polylines is not a sequence of Mathutils.Vector's" ); + return NULL; + } + + len_polypoints= PySequence_Size( polyLine ); + if (len_polypoints>0) { /* dont bother adding edges as polylines */ +#if 0 + if (EXPP_check_sequence_consistency( polyLine, &vector_Type ) != 1) { + freedisplist(&dispbase); + Py_DECREF(polyLine); + PyErr_SetString( PyExc_TypeError, "A point in one of the polylines is not a Mathutils.Vector type" ); + return NULL; + } +#endif + dl= MEM_callocN(sizeof(DispList), "poly disp"); + BLI_addtail(&dispbase, dl); + dl->type= DL_INDEX3; + dl->nr= len_polypoints; + dl->type= DL_POLY; + dl->parts= 1; /* no faces, 1 edge loop */ + dl->col= 0; /* no material */ + dl->verts= fp= MEM_callocN( sizeof(float)*3*len_polypoints, "dl verts"); + dl->index= MEM_callocN(sizeof(int)*3*len_polypoints, "dl index"); + + for( index = 0; indexvec[0]; + fp[1] = ((VectorObject *)polyVec)->vec[1]; + if( ((VectorObject *)polyVec)->size > 2 ) + fp[2] = ((VectorObject *)polyVec)->vec[2]; + else + fp[2]= 0.0f; /* if its a 2d vector then set the z to be zero */ + } + else { + ls_error= 1; + } + + totpoints++; + Py_DECREF(polyVec); + } + } + Py_DECREF(polyLine); + } + + if(ls_error) { + freedisplist(&dispbase); /* possible some dl was allocated */ + PyErr_SetString( PyExc_TypeError, "A point in one of the polylines is not a Mathutils.Vector type" ); + return NULL; + } + else if (totpoints) { + /* now make the list to return */ + filldisplist(&dispbase, &dispbase); + + /* The faces are stored in a new DisplayList + thats added to the head of the listbase */ + dl= dispbase.first; + + tri_list= PyList_New(dl->parts); + if( !tri_list ) { + freedisplist(&dispbase); + PyErr_SetString( PyExc_RuntimeError, "Geometry.PolyFill failed to make a new list" ); + return NULL; + } + + index= 0; + dl_face= dl->index; + while(index < dl->parts) { + PyList_SetItem(tri_list, index, Py_BuildValue("iii", dl_face[0], dl_face[1], dl_face[2]) ); + dl_face+= 3; + index++; + } + freedisplist(&dispbase); + } else { + /* no points, do this so scripts dont barf */ + freedisplist(&dispbase); /* possible some dl was allocated */ + tri_list= PyList_New(0); + } + + return tri_list; +} + + +static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args ) +{ + VectorObject *line_a1, *line_a2, *line_b1, *line_b2; + float a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y, xi, yi, a1,a2,b1,b2, newvec[2]; + if( !PyArg_ParseTuple ( args, "O!O!O!O!", + &vector_Type, &line_a1, + &vector_Type, &line_a2, + &vector_Type, &line_b1, + &vector_Type, &line_b2) + ) { + PyErr_SetString( PyExc_TypeError, "expected 4 vector types\n" ); + return NULL; + } + + a1x= line_a1->vec[0]; + a1y= line_a1->vec[1]; + a2x= line_a2->vec[0]; + a2y= line_a2->vec[1]; + + b1x= line_b1->vec[0]; + b1y= line_b1->vec[1]; + b2x= line_b2->vec[0]; + b2y= line_b2->vec[1]; + + if((MIN2(a1x, a2x) > MAX2(b1x, b2x)) || + (MAX2(a1x, a2x) < MIN2(b1x, b2x)) || + (MIN2(a1y, a2y) > MAX2(b1y, b2y)) || + (MAX2(a1y, a2y) < MIN2(b1y, b2y)) ) { + Py_RETURN_NONE; + } + /* Make sure the hoz/vert line comes first. */ + if (fabs(b1x - b2x) < eul || fabs(b1y - b2y) < eul) { + SWAP_FLOAT(a1x, b1x, xi); /*abuse xi*/ + SWAP_FLOAT(a1y, b1y, xi); + SWAP_FLOAT(a2x, b2x, xi); + SWAP_FLOAT(a2y, b2y, xi); + } + + if (fabs(a1x-a2x) < eul) { /* verticle line */ + if (fabs(b1x-b2x) < eul){ /*verticle second line */ + Py_RETURN_NONE; /* 2 verticle lines dont intersect. */ + } + else if (fabs(b1y-b2y) < eul) { + /*X of vert, Y of hoz. no calculation needed */ + newvec[0]= a1x; + newvec[1]= b1y; + return newVectorObject(newvec, 2, Py_NEW); + } + + yi = (float)(((b1y / fabs(b1x - b2x)) * fabs(b2x - a1x)) + ((b2y / fabs(b1x - b2x)) * fabs(b1x - a1x))); + + if (yi > MAX2(a1y, a2y)) {/* New point above seg1's vert line */ + Py_RETURN_NONE; + } else if (yi < MIN2(a1y, a2y)) { /* New point below seg1's vert line */ + Py_RETURN_NONE; + } + newvec[0]= a1x; + newvec[1]= yi; + return newVectorObject(newvec, 2, Py_NEW); + } else if (fabs(a2y-a1y) < eul) { /* hoz line1 */ + if (fabs(b2y-b1y) < eul) { /*hoz line2*/ + Py_RETURN_NONE; /*2 hoz lines dont intersect*/ + } + + /* Can skip vert line check for seg 2 since its covered above. */ + xi = (float)(((b1x / fabs(b1y - b2y)) * fabs(b2y - a1y)) + ((b2x / fabs(b1y - b2y)) * fabs(b1y - a1y))); + if (xi > MAX2(a1x, a2x)) { /* New point right of hoz line1's */ + Py_RETURN_NONE; + } else if (xi < MIN2(a1x, a2x)) { /*New point left of seg1's hoz line */ + Py_RETURN_NONE; + } + newvec[0]= xi; + newvec[1]= a1y; + return newVectorObject(newvec, 2, Py_NEW); + } + + b1 = (a2y-a1y)/(a2x-a1x); + b2 = (b2y-b1y)/(b2x-b1x); + a1 = a1y-b1*a1x; + a2 = b1y-b2*b1x; + + if (b1 - b2 == 0.0) { + Py_RETURN_NONE; + } + + xi = - (a1-a2)/(b1-b2); + yi = a1+b1*xi; + if ((a1x-xi)*(xi-a2x) >= 0 && (b1x-xi)*(xi-b2x) >= 0 && (a1y-yi)*(yi-a2y) >= 0 && (b1y-yi)*(yi-b2y)>=0) { + newvec[0]= xi; + newvec[1]= yi; + return newVectorObject(newvec, 2, Py_NEW); + } + Py_RETURN_NONE; +} + +static PyObject *M_Geometry_ClosestPointOnLine( PyObject * self, PyObject * args ) +{ + VectorObject *pt, *line_1, *line_2; + float pt_in[3], pt_out[3], l1[3], l2[3]; + float lambda; + PyObject *ret; + + if( !PyArg_ParseTuple ( args, "O!O!O!", + &vector_Type, &pt, + &vector_Type, &line_1, + &vector_Type, &line_2) + ) { + PyErr_SetString( PyExc_TypeError, "expected 3 vector types\n" ); + return NULL; + } + /* accept 2d verts */ + if (pt->size==3) { VECCOPY(pt_in, pt->vec);} + else { pt_in[2]=0.0; VECCOPY2D(pt_in, pt->vec) } + + if (line_1->size==3) { VECCOPY(l1, line_1->vec);} + else { l1[2]=0.0; VECCOPY2D(l1, line_1->vec) } + + if (line_2->size==3) { VECCOPY(l2, line_2->vec);} + else { l2[2]=0.0; VECCOPY2D(l2, line_2->vec) } + + /* do the calculation */ + lambda = lambda_cp_line_ex(pt_in, l1, l2, pt_out); + + ret = PyTuple_New(2); + PyTuple_SET_ITEM( ret, 0, newVectorObject(pt_out, 3, Py_NEW) ); + PyTuple_SET_ITEM( ret, 1, PyFloat_FromDouble(lambda) ); + return ret; +} + +static PyObject *M_Geometry_PointInTriangle2D( PyObject * self, PyObject * args ) +{ + VectorObject *pt_vec, *tri_p1, *tri_p2, *tri_p3; + + if( !PyArg_ParseTuple ( args, "O!O!O!O!", + &vector_Type, &pt_vec, + &vector_Type, &tri_p1, + &vector_Type, &tri_p2, + &vector_Type, &tri_p3) + ) { + PyErr_SetString( PyExc_TypeError, "expected 4 vector types\n" ); + return NULL; + } + + return PyLong_FromLong(IsectPT2Df(pt_vec->vec, tri_p1->vec, tri_p2->vec, tri_p3->vec)); +} + +static PyObject *M_Geometry_PointInQuad2D( PyObject * self, PyObject * args ) +{ + VectorObject *pt_vec, *quad_p1, *quad_p2, *quad_p3, *quad_p4; + + if( !PyArg_ParseTuple ( args, "O!O!O!O!O!", + &vector_Type, &pt_vec, + &vector_Type, &quad_p1, + &vector_Type, &quad_p2, + &vector_Type, &quad_p3, + &vector_Type, &quad_p4) + ) { + PyErr_SetString( PyExc_TypeError, "expected 5 vector types\n" ); + return NULL; + } + + return PyLong_FromLong(IsectPQ2Df(pt_vec->vec, quad_p1->vec, quad_p2->vec, quad_p3->vec, quad_p4->vec)); +} + +static int boxPack_FromPyObject(PyObject * value, boxPack **boxarray ) +{ + int len, i; + PyObject *list_item, *item_1, *item_2; + boxPack *box; + + + /* Error checking must alredy be done */ + if( !PyList_Check( value ) ) { + PyErr_SetString( PyExc_TypeError, "can only back a list of [x,y,x,w]" ); + return -1; + } + + len = PyList_Size( value ); + + (*boxarray) = MEM_mallocN( len*sizeof(boxPack), "boxPack box"); + + + for( i = 0; i < len; i++ ) { + list_item = PyList_GET_ITEM( value, i ); + if( !PyList_Check( list_item ) || PyList_Size( list_item ) < 4 ) { + MEM_freeN(*boxarray); + PyErr_SetString( PyExc_TypeError, "can only back a list of [x,y,x,w]" ); + return -1; + } + + box = (*boxarray)+i; + + item_1 = PyList_GET_ITEM(list_item, 2); + item_2 = PyList_GET_ITEM(list_item, 3); + + if (!PyNumber_Check(item_1) || !PyNumber_Check(item_2)) { + MEM_freeN(*boxarray); + PyErr_SetString( PyExc_TypeError, "can only back a list of 2d boxes [x,y,x,w]" ); + return -1; + } + + box->w = (float)PyFloat_AsDouble( item_1 ); + box->h = (float)PyFloat_AsDouble( item_2 ); + box->index = i; + /* verts will be added later */ + } + return 0; +} + +static void boxPack_ToPyObject(PyObject * value, boxPack **boxarray) +{ + int len, i; + PyObject *list_item; + boxPack *box; + + len = PyList_Size( value ); + + for( i = 0; i < len; i++ ) { + box = (*boxarray)+i; + list_item = PyList_GET_ITEM( value, box->index ); + PyList_SET_ITEM( list_item, 0, PyFloat_FromDouble( box->x )); + PyList_SET_ITEM( list_item, 1, PyFloat_FromDouble( box->y )); + } + MEM_freeN(*boxarray); +} + + +static PyObject *M_Geometry_BoxPack2D( PyObject * self, PyObject * boxlist ) +{ + boxPack *boxarray = NULL; + float tot_width, tot_height; + int len; + int error; + + if(!PyList_Check(boxlist)) { + PyErr_SetString( PyExc_TypeError, "expected a sequence of boxes [[x,y,w,h], ... ]" ); + return NULL; + } + + len = PyList_Size( boxlist ); + + if (!len) + return Py_BuildValue( "ff", 0.0, 0.0); + + error = boxPack_FromPyObject(boxlist, &boxarray); + if (error!=0) return NULL; + + /* Non Python function */ + boxPack2D(boxarray, len, &tot_width, &tot_height); + + boxPack_ToPyObject(boxlist, &boxarray); + + return Py_BuildValue( "ff", tot_width, tot_height); +} + +static PyObject *M_Geometry_BezierInterp( PyObject * self, PyObject * args ) +{ + VectorObject *vec_k1, *vec_h1, *vec_k2, *vec_h2; + int resolu; + int dims; + int i; + float *coord_array, *fp; + PyObject *list; + + float k1[4] = {0.0, 0.0, 0.0, 0.0}; + float h1[4] = {0.0, 0.0, 0.0, 0.0}; + float k2[4] = {0.0, 0.0, 0.0, 0.0}; + float h2[4] = {0.0, 0.0, 0.0, 0.0}; + + + if( !PyArg_ParseTuple ( args, "O!O!O!O!i", + &vector_Type, &vec_k1, + &vector_Type, &vec_h1, + &vector_Type, &vec_h2, + &vector_Type, &vec_k2, &resolu) || (resolu<=1) + ) { + PyErr_SetString( PyExc_TypeError, "expected 4 vector types and an int greater then 1\n" ); + return NULL; + } + + dims= MAX4(vec_k1->size, vec_h1->size, vec_h2->size, vec_k2->size); + + for(i=0; i < vec_k1->size; i++) k1[i]= vec_k1->vec[i]; + for(i=0; i < vec_h1->size; i++) h1[i]= vec_h1->vec[i]; + for(i=0; i < vec_k2->size; i++) k2[i]= vec_k2->vec[i]; + for(i=0; i < vec_h2->size; i++) h2[i]= vec_h2->vec[i]; + + coord_array = MEM_callocN(dims * (resolu) * sizeof(float), "BezierInterp"); + for(i=0; i +#include "Mathutils.h" + +PyObject *Geometry_Init( const char *from ); + +#endif /* EXPP_Geometry_H */ diff --git a/source/blender/python/generic/Mathutils.c b/source/blender/python/generic/Mathutils.c new file mode 100644 index 00000000000..1e2e59edbaf --- /dev/null +++ b/source/blender/python/generic/Mathutils.c @@ -0,0 +1,1712 @@ +/* + * $Id: Mathutils.c 20922 2009-06-16 07:16:51Z campbellbarton $ + * + * ***** BEGIN GPL 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. + * + * 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, Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "Mathutils.h" + +#include "BLI_arithb.h" +#include "PIL_time.h" +#include "BLI_rand.h" +#include "BKE_utildefines.h" + +//-------------------------DOC STRINGS --------------------------- +static char M_Mathutils_doc[] = "The Blender Mathutils module\n\n"; +static char M_Mathutils_Vector_doc[] = "() - create a new vector object from a list of floats"; +static char M_Mathutils_Matrix_doc[] = "() - create a new matrix object from a list of floats"; +static char M_Mathutils_Quaternion_doc[] = "() - create a quaternion from a list or an axis of rotation and an angle"; +static char M_Mathutils_Euler_doc[] = "() - create and return a new euler object"; +static char M_Mathutils_Rand_doc[] = "() - return a random number"; +static char M_Mathutils_CrossVecs_doc[] = "() - returns a vector perpedicular to the 2 vectors crossed"; +static char M_Mathutils_CopyVec_doc[] = "() - create a copy of vector"; +static char M_Mathutils_DotVecs_doc[] = "() - return the dot product of two vectors"; +static char M_Mathutils_AngleBetweenVecs_doc[] = "() - returns the angle between two vectors in degrees"; +static char M_Mathutils_MidpointVecs_doc[] = "() - return the vector to the midpoint between two vectors"; +static char M_Mathutils_MatMultVec_doc[] = "() - multiplies a matrix by a column vector"; +static char M_Mathutils_VecMultMat_doc[] = "() - multiplies a row vector by a matrix"; +static char M_Mathutils_ProjectVecs_doc[] = "() - returns the projection vector from the projection of vecA onto vecB"; +static char M_Mathutils_RotationMatrix_doc[] = "() - construct a rotation matrix from an angle and axis of rotation"; +static char M_Mathutils_ScaleMatrix_doc[] = "() - construct a scaling matrix from a scaling factor"; +static char M_Mathutils_OrthoProjectionMatrix_doc[] = "() - construct a orthographic projection matrix from a selected plane"; +static char M_Mathutils_ShearMatrix_doc[] = "() - construct a shearing matrix from a plane of shear and a shear factor"; +static char M_Mathutils_CopyMat_doc[] = "() - create a copy of a matrix"; +static char M_Mathutils_TranslationMatrix_doc[] = "(vec) - create a translation matrix from a vector"; +static char M_Mathutils_CopyQuat_doc[] = "() - copy quatB to quatA"; +static char M_Mathutils_CopyEuler_doc[] = "() - copy eulB to eultA"; +static char M_Mathutils_CrossQuats_doc[] = "() - return the mutliplication of two quaternions"; +static char M_Mathutils_DotQuats_doc[] = "() - return the dot product of two quaternions"; +static char M_Mathutils_Slerp_doc[] = "() - returns the interpolation between two quaternions"; +static char M_Mathutils_DifferenceQuats_doc[] = "() - return the angular displacment difference between two quats"; +static char M_Mathutils_RotateEuler_doc[] = "() - rotate euler by an axis and angle"; +static char M_Mathutils_Intersect_doc[] = "(v1, v2, v3, ray, orig, clip=1) - returns the intersection between a ray and a triangle, if possible, returns None otherwise"; +static char M_Mathutils_TriangleArea_doc[] = "(v1, v2, v3) - returns the area size of the 2D or 3D triangle defined"; +static char M_Mathutils_TriangleNormal_doc[] = "(v1, v2, v3) - returns the normal of the 3D triangle defined"; +static char M_Mathutils_QuadNormal_doc[] = "(v1, v2, v3, v4) - returns the normal of the 3D quad defined"; +static char M_Mathutils_LineIntersect_doc[] = "(v1, v2, v3, v4) - returns a tuple with the points on each line respectively closest to the other"; +//-----------------------METHOD DEFINITIONS ---------------------- +struct PyMethodDef M_Mathutils_methods[] = { + {"Rand", (PyCFunction) M_Mathutils_Rand, METH_VARARGS, M_Mathutils_Rand_doc}, + {"Vector", (PyCFunction) M_Mathutils_Vector, METH_VARARGS, M_Mathutils_Vector_doc}, + {"CrossVecs", (PyCFunction) M_Mathutils_CrossVecs, METH_VARARGS, M_Mathutils_CrossVecs_doc}, + {"DotVecs", (PyCFunction) M_Mathutils_DotVecs, METH_VARARGS, M_Mathutils_DotVecs_doc}, + {"AngleBetweenVecs", (PyCFunction) M_Mathutils_AngleBetweenVecs, METH_VARARGS, M_Mathutils_AngleBetweenVecs_doc}, + {"MidpointVecs", (PyCFunction) M_Mathutils_MidpointVecs, METH_VARARGS, M_Mathutils_MidpointVecs_doc}, + {"VecMultMat", (PyCFunction) M_Mathutils_VecMultMat, METH_VARARGS, M_Mathutils_VecMultMat_doc}, + {"ProjectVecs", (PyCFunction) M_Mathutils_ProjectVecs, METH_VARARGS, M_Mathutils_ProjectVecs_doc}, + {"CopyVec", (PyCFunction) M_Mathutils_CopyVec, METH_VARARGS, M_Mathutils_CopyVec_doc}, + {"Matrix", (PyCFunction) M_Mathutils_Matrix, METH_VARARGS, M_Mathutils_Matrix_doc}, + {"RotationMatrix", (PyCFunction) M_Mathutils_RotationMatrix, METH_VARARGS, M_Mathutils_RotationMatrix_doc}, + {"ScaleMatrix", (PyCFunction) M_Mathutils_ScaleMatrix, METH_VARARGS, M_Mathutils_ScaleMatrix_doc}, + {"ShearMatrix", (PyCFunction) M_Mathutils_ShearMatrix, METH_VARARGS, M_Mathutils_ShearMatrix_doc}, + {"TranslationMatrix", (PyCFunction) M_Mathutils_TranslationMatrix, METH_O, M_Mathutils_TranslationMatrix_doc}, + {"CopyMat", (PyCFunction) M_Mathutils_CopyMat, METH_VARARGS, M_Mathutils_CopyMat_doc}, + {"OrthoProjectionMatrix", (PyCFunction) M_Mathutils_OrthoProjectionMatrix, METH_VARARGS, M_Mathutils_OrthoProjectionMatrix_doc}, + {"MatMultVec", (PyCFunction) M_Mathutils_MatMultVec, METH_VARARGS, M_Mathutils_MatMultVec_doc}, + {"Quaternion", (PyCFunction) M_Mathutils_Quaternion, METH_VARARGS, M_Mathutils_Quaternion_doc}, + {"CopyQuat", (PyCFunction) M_Mathutils_CopyQuat, METH_VARARGS, M_Mathutils_CopyQuat_doc}, + {"CrossQuats", (PyCFunction) M_Mathutils_CrossQuats, METH_VARARGS, M_Mathutils_CrossQuats_doc}, + {"DotQuats", (PyCFunction) M_Mathutils_DotQuats, METH_VARARGS, M_Mathutils_DotQuats_doc}, + {"DifferenceQuats", (PyCFunction) M_Mathutils_DifferenceQuats, METH_VARARGS,M_Mathutils_DifferenceQuats_doc}, + {"Slerp", (PyCFunction) M_Mathutils_Slerp, METH_VARARGS, M_Mathutils_Slerp_doc}, + {"Euler", (PyCFunction) M_Mathutils_Euler, METH_VARARGS, M_Mathutils_Euler_doc}, + {"CopyEuler", (PyCFunction) M_Mathutils_CopyEuler, METH_VARARGS, M_Mathutils_CopyEuler_doc}, + {"RotateEuler", (PyCFunction) M_Mathutils_RotateEuler, METH_VARARGS, M_Mathutils_RotateEuler_doc}, + {"Intersect", ( PyCFunction ) M_Mathutils_Intersect, METH_VARARGS, M_Mathutils_Intersect_doc}, + {"TriangleArea", ( PyCFunction ) M_Mathutils_TriangleArea, METH_VARARGS, M_Mathutils_TriangleArea_doc}, + {"TriangleNormal", ( PyCFunction ) M_Mathutils_TriangleNormal, METH_VARARGS, M_Mathutils_TriangleNormal_doc}, + {"QuadNormal", ( PyCFunction ) M_Mathutils_QuadNormal, METH_VARARGS, M_Mathutils_QuadNormal_doc}, + {"LineIntersect", ( PyCFunction ) M_Mathutils_LineIntersect, METH_VARARGS, M_Mathutils_LineIntersect_doc}, + {NULL, NULL, 0, NULL} +}; +/*----------------------------MODULE INIT-------------------------*/ +/* from can be Blender.Mathutils or GameLogic.Mathutils for the BGE */ + +#if (PY_VERSION_HEX >= 0x03000000) +static struct PyModuleDef M_Mathutils_module_def = { + {}, /* m_base */ + "Mathutils", /* m_name */ + M_Mathutils_doc, /* m_doc */ + 0, /* m_size */ + M_Mathutils_methods, /* m_methods */ + 0, /* m_reload */ + 0, /* m_traverse */ + 0, /* m_clear */ + 0, /* m_free */ +}; +#endif + +PyObject *Mathutils_Init(const char *from) +{ + PyObject *submodule; + + //seed the generator for the rand function + BLI_srand((unsigned int) (PIL_check_seconds_timer() * 0x7FFFFFFF)); + + if( PyType_Ready( &vector_Type ) < 0 ) + return NULL; + if( PyType_Ready( &matrix_Type ) < 0 ) + return NULL; + if( PyType_Ready( &euler_Type ) < 0 ) + return NULL; + if( PyType_Ready( &quaternion_Type ) < 0 ) + return NULL; + +#if (PY_VERSION_HEX >= 0x03000000) + submodule = PyModule_Create(&M_Mathutils_module_def); + PyDict_SetItemString(PySys_GetObject("modules"), M_Mathutils_module_def.m_name, submodule); +#else + submodule = Py_InitModule3(from, M_Mathutils_methods, M_Mathutils_doc); +#endif + + return (submodule); +} + +//-----------------------------METHODS---------------------------- +//----------------column_vector_multiplication (internal)--------- +//COLUMN VECTOR Multiplication (Matrix X Vector) +// [1][2][3] [a] +// [4][5][6] * [b] +// [7][8][9] [c] +//vector/matrix multiplication IS NOT COMMUTATIVE!!!! +PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec) +{ + float vecNew[4], vecCopy[4]; + double dot = 0.0f; + int x, y, z = 0; + + if(mat->rowSize != vec->size){ + if(mat->rowSize == 4 && vec->size != 3){ + PyErr_SetString(PyExc_AttributeError, "matrix * vector: matrix row size and vector size must be the same"); + return NULL; + }else{ + vecCopy[3] = 1.0f; + } + } + + for(x = 0; x < vec->size; x++){ + vecCopy[x] = vec->vec[x]; + } + + for(x = 0; x < mat->rowSize; x++) { + for(y = 0; y < mat->colSize; y++) { + dot += mat->matrix[x][y] * vecCopy[y]; + } + vecNew[z++] = (float)dot; + dot = 0.0f; + } + return newVectorObject(vecNew, vec->size, Py_NEW); +} + +//-----------------row_vector_multiplication (internal)----------- +//ROW VECTOR Multiplication - Vector X Matrix +//[x][y][z] * [1][2][3] +// [4][5][6] +// [7][8][9] +//vector/matrix multiplication IS NOT COMMUTATIVE!!!! +PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat) +{ + float vecNew[4], vecCopy[4]; + double dot = 0.0f; + int x, y, z = 0, vec_size = vec->size; + + if(mat->colSize != vec_size){ + if(mat->rowSize == 4 && vec_size != 3){ + PyErr_SetString(PyExc_AttributeError, "vector * matrix: matrix column size and the vector size must be the same"); + return NULL; + }else{ + vecCopy[3] = 1.0f; + } + } + + for(x = 0; x < vec_size; x++){ + vecCopy[x] = vec->vec[x]; + } + + //muliplication + for(x = 0; x < mat->colSize; x++) { + for(y = 0; y < mat->rowSize; y++) { + dot += mat->matrix[y][x] * vecCopy[y]; + } + vecNew[z++] = (float)dot; + dot = 0.0f; + } + return newVectorObject(vecNew, vec_size, Py_NEW); +} + +//-----------------quat_rotation (internal)----------- +//This function multiplies a vector/point * quat or vice versa +//to rotate the point/vector by the quaternion +//arguments should all be 3D +PyObject *quat_rotation(PyObject *arg1, PyObject *arg2) +{ + float rot[3]; + QuaternionObject *quat = NULL; + VectorObject *vec = NULL; + + if(QuaternionObject_Check(arg1)){ + quat = (QuaternionObject*)arg1; + if(VectorObject_Check(arg2)){ + vec = (VectorObject*)arg2; + rot[0] = quat->quat[0]*quat->quat[0]*vec->vec[0] + 2*quat->quat[2]*quat->quat[0]*vec->vec[2] - + 2*quat->quat[3]*quat->quat[0]*vec->vec[1] + quat->quat[1]*quat->quat[1]*vec->vec[0] + + 2*quat->quat[2]*quat->quat[1]*vec->vec[1] + 2*quat->quat[3]*quat->quat[1]*vec->vec[2] - + quat->quat[3]*quat->quat[3]*vec->vec[0] - quat->quat[2]*quat->quat[2]*vec->vec[0]; + rot[1] = 2*quat->quat[1]*quat->quat[2]*vec->vec[0] + quat->quat[2]*quat->quat[2]*vec->vec[1] + + 2*quat->quat[3]*quat->quat[2]*vec->vec[2] + 2*quat->quat[0]*quat->quat[3]*vec->vec[0] - + quat->quat[3]*quat->quat[3]*vec->vec[1] + quat->quat[0]*quat->quat[0]*vec->vec[1] - + 2*quat->quat[1]*quat->quat[0]*vec->vec[2] - quat->quat[1]*quat->quat[1]*vec->vec[1]; + rot[2] = 2*quat->quat[1]*quat->quat[3]*vec->vec[0] + 2*quat->quat[2]*quat->quat[3]*vec->vec[1] + + quat->quat[3]*quat->quat[3]*vec->vec[2] - 2*quat->quat[0]*quat->quat[2]*vec->vec[0] - + quat->quat[2]*quat->quat[2]*vec->vec[2] + 2*quat->quat[0]*quat->quat[1]*vec->vec[1] - + quat->quat[1]*quat->quat[1]*vec->vec[2] + quat->quat[0]*quat->quat[0]*vec->vec[2]; + return newVectorObject(rot, 3, Py_NEW); + } + }else if(VectorObject_Check(arg1)){ + vec = (VectorObject*)arg1; + if(QuaternionObject_Check(arg2)){ + quat = (QuaternionObject*)arg2; + rot[0] = quat->quat[0]*quat->quat[0]*vec->vec[0] + 2*quat->quat[2]*quat->quat[0]*vec->vec[2] - + 2*quat->quat[3]*quat->quat[0]*vec->vec[1] + quat->quat[1]*quat->quat[1]*vec->vec[0] + + 2*quat->quat[2]*quat->quat[1]*vec->vec[1] + 2*quat->quat[3]*quat->quat[1]*vec->vec[2] - + quat->quat[3]*quat->quat[3]*vec->vec[0] - quat->quat[2]*quat->quat[2]*vec->vec[0]; + rot[1] = 2*quat->quat[1]*quat->quat[2]*vec->vec[0] + quat->quat[2]*quat->quat[2]*vec->vec[1] + + 2*quat->quat[3]*quat->quat[2]*vec->vec[2] + 2*quat->quat[0]*quat->quat[3]*vec->vec[0] - + quat->quat[3]*quat->quat[3]*vec->vec[1] + quat->quat[0]*quat->quat[0]*vec->vec[1] - + 2*quat->quat[1]*quat->quat[0]*vec->vec[2] - quat->quat[1]*quat->quat[1]*vec->vec[1]; + rot[2] = 2*quat->quat[1]*quat->quat[3]*vec->vec[0] + 2*quat->quat[2]*quat->quat[3]*vec->vec[1] + + quat->quat[3]*quat->quat[3]*vec->vec[2] - 2*quat->quat[0]*quat->quat[2]*vec->vec[0] - + quat->quat[2]*quat->quat[2]*vec->vec[2] + 2*quat->quat[0]*quat->quat[1]*vec->vec[1] - + quat->quat[1]*quat->quat[1]*vec->vec[2] + quat->quat[0]*quat->quat[0]*vec->vec[2]; + return newVectorObject(rot, 3, Py_NEW); + } + } + + PyErr_SetString(PyExc_RuntimeError, "quat_rotation(internal): internal problem rotating vector/point\n"); + return NULL; + +} + +//----------------------------------Mathutils.Rand() -------------------- +//returns a random number between a high and low value +PyObject *M_Mathutils_Rand(PyObject * self, PyObject * args) +{ + float high, low, range; + double drand; + //initializers + high = 1.0; + low = 0.0; + + if(!PyArg_ParseTuple(args, "|ff", &low, &high)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.Rand(): expected nothing or optional (float, float)\n"); + return NULL; + } + + if((high < low) || (high < 0 && low > 0)) { + PyErr_SetString(PyExc_ValueError, "Mathutils.Rand(): high value should be larger than low value\n"); + return NULL; + } + //get the random number 0 - 1 + drand = BLI_drand(); + + //set it to range + range = high - low; + drand = drand * range; + drand = drand + low; + + return PyFloat_FromDouble(drand); +} +//----------------------------------VECTOR FUNCTIONS--------------------- +//----------------------------------Mathutils.Vector() ------------------ +// Supports 2D, 3D, and 4D vector objects both int and float values +// accepted. Mixed float and int values accepted. Ints are parsed to float +PyObject *M_Mathutils_Vector(PyObject * self, PyObject * args) +{ + PyObject *listObject = NULL; + int size, i; + float vec[4], f; + PyObject *v; + + size = PySequence_Length(args); + if (size == 1) { + listObject = PySequence_GetItem(args, 0); + if (PySequence_Check(listObject)) { + size = PySequence_Length(listObject); + } else { // Single argument was not a sequence + Py_XDECREF(listObject); + PyErr_SetString(PyExc_TypeError, "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); + return NULL; + } + } else if (size == 0) { + //returns a new empty 3d vector + return newVectorObject(NULL, 3, Py_NEW); + } else { + Py_INCREF(args); + listObject = args; + } + + if (size<2 || size>4) { // Invalid vector size + Py_XDECREF(listObject); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); + return NULL; + } + + for (i=0; isize != 3 || vec2->size != 3) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.CrossVecs(): expects (2) 3D vector objects\n"); + return NULL; + } + vecCross = newVectorObject(NULL, 3, Py_NEW); + Crossf(((VectorObject*)vecCross)->vec, vec1->vec, vec2->vec); + return vecCross; +} +//----------------------------------Mathutils.DotVec() ------------------- +//calculates the dot product of two vectors +PyObject *M_Mathutils_DotVecs(PyObject * self, PyObject * args) +{ + VectorObject *vec1 = NULL, *vec2 = NULL; + double dot = 0.0f; + int x; + + if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.DotVecs(): expects (2) vector objects of the same size\n"); + return NULL; + } + + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.DotVecs(): expects (2) vector objects of the same size\n"); + return NULL; + } + + for(x = 0; x < vec1->size; x++) { + dot += vec1->vec[x] * vec2->vec[x]; + } + return PyFloat_FromDouble(dot); +} +//----------------------------------Mathutils.AngleBetweenVecs() --------- +//calculates the angle between 2 vectors +PyObject *M_Mathutils_AngleBetweenVecs(PyObject * self, PyObject * args) +{ + VectorObject *vec1 = NULL, *vec2 = NULL; + double dot = 0.0f, angleRads, test_v1 = 0.0f, test_v2 = 0.0f; + int x, size; + + if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2)) + goto AttributeError1; //not vectors + if(vec1->size != vec2->size) + goto AttributeError1; //bad sizes + + //since size is the same.... + size = vec1->size; + + for(x = 0; x < size; x++) { + test_v1 += vec1->vec[x] * vec1->vec[x]; + test_v2 += vec2->vec[x] * vec2->vec[x]; + } + if (!test_v1 || !test_v2){ + goto AttributeError2; //zero-length vector + } + + //dot product + for(x = 0; x < size; x++) { + dot += vec1->vec[x] * vec2->vec[x]; + } + dot /= (sqrt(test_v1) * sqrt(test_v2)); + + angleRads = (double)saacos(dot); + + return PyFloat_FromDouble(angleRads * (180/ Py_PI)); + +AttributeError1: + PyErr_SetString(PyExc_AttributeError, "Mathutils.AngleBetweenVecs(): expects (2) VECTOR objects of the same size\n"); + return NULL; + +AttributeError2: + PyErr_SetString(PyExc_AttributeError, "Mathutils.AngleBetweenVecs(): zero length vectors are not acceptable arguments\n"); + return NULL; +} +//----------------------------------Mathutils.MidpointVecs() ------------- +//calculates the midpoint between 2 vectors +PyObject *M_Mathutils_MidpointVecs(PyObject * self, PyObject * args) +{ + VectorObject *vec1 = NULL, *vec2 = NULL; + float vec[4]; + int x; + + if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.MidpointVecs(): expects (2) vector objects of the same size\n"); + return NULL; + } + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.MidpointVecs(): expects (2) vector objects of the same size\n"); + return NULL; + } + + for(x = 0; x < vec1->size; x++) { + vec[x] = 0.5f * (vec1->vec[x] + vec2->vec[x]); + } + return newVectorObject(vec, vec1->size, Py_NEW); +} +//----------------------------------Mathutils.ProjectVecs() ------------- +//projects vector 1 onto vector 2 +PyObject *M_Mathutils_ProjectVecs(PyObject * self, PyObject * args) +{ + VectorObject *vec1 = NULL, *vec2 = NULL; + float vec[4]; + double dot = 0.0f, dot2 = 0.0f; + int x, size; + + if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.ProjectVecs(): expects (2) vector objects of the same size\n"); + return NULL; + } + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.ProjectVecs(): expects (2) vector objects of the same size\n"); + return NULL; + } + + //since they are the same size... + size = vec1->size; + + //get dot products + for(x = 0; x < size; x++) { + dot += vec1->vec[x] * vec2->vec[x]; + dot2 += vec2->vec[x] * vec2->vec[x]; + } + //projection + dot /= dot2; + for(x = 0; x < size; x++) { + vec[x] = (float)(dot * vec2->vec[x]); + } + return newVectorObject(vec, size, Py_NEW); +} +//----------------------------------MATRIX FUNCTIONS-------------------- +//----------------------------------Mathutils.Matrix() ----------------- +//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. +//create a new matrix type +PyObject *M_Mathutils_Matrix(PyObject * self, PyObject * args) +{ + PyObject *listObject = NULL; + PyObject *argObject, *m, *s, *f; + MatrixObject *mat; + int argSize, seqSize = 0, i, j; + float matrix[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + + argSize = PySequence_Length(args); + if(argSize > 4){ //bad arg nums + PyErr_SetString(PyExc_AttributeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + return NULL; + } else if (argSize == 0) { //return empty 4D matrix + return (PyObject *) newMatrixObject(NULL, 4, 4, Py_NEW); + }else if (argSize == 1){ + //copy constructor for matrix objects + argObject = PySequence_GetItem(args, 0); + if(MatrixObject_Check(argObject)){ + mat = (MatrixObject*)argObject; + + argSize = mat->rowSize; //rows + seqSize = mat->colSize; //col + for(i = 0; i < (seqSize * argSize); i++){ + matrix[i] = mat->contigPtr[i]; + } + } + Py_DECREF(argObject); + }else{ //2-4 arguments (all seqs? all same size?) + for(i =0; i < argSize; i++){ + argObject = PySequence_GetItem(args, i); + if (PySequence_Check(argObject)) { //seq? + if(seqSize){ //0 at first + if(PySequence_Length(argObject) != seqSize){ //seq size not same + Py_DECREF(argObject); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + return NULL; + } + } + seqSize = PySequence_Length(argObject); + }else{ //arg not a sequence + Py_XDECREF(argObject); + PyErr_SetString(PyExc_TypeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + return NULL; + } + Py_DECREF(argObject); + } + //all is well... let's continue parsing + listObject = args; + for (i = 0; i < argSize; i++){ + m = PySequence_GetItem(listObject, i); + if (m == NULL) { // Failed to read sequence + PyErr_SetString(PyExc_RuntimeError, "Mathutils.Matrix(): failed to parse arguments...\n"); + return NULL; + } + + for (j = 0; j < seqSize; j++) { + s = PySequence_GetItem(m, j); + if (s == NULL) { // Failed to read sequence + Py_DECREF(m); + PyErr_SetString(PyExc_RuntimeError, "Mathutils.Matrix(): failed to parse arguments...\n"); + return NULL; + } + + f = PyNumber_Float(s); + if(f == NULL) { // parsed item is not a number + Py_DECREF(m); + Py_DECREF(s); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + return NULL; + } + + matrix[(seqSize*i)+j]=(float)PyFloat_AS_DOUBLE(f); + Py_DECREF(f); + Py_DECREF(s); + } + Py_DECREF(m); + } + } + return newMatrixObject(matrix, argSize, seqSize, Py_NEW); +} +//----------------------------------Mathutils.RotationMatrix() ---------- +//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. +//creates a rotation matrix +PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args) +{ + VectorObject *vec = NULL; + char *axis = NULL; + int matSize; + float angle = 0.0f, norm = 0.0f, cosAngle = 0.0f, sinAngle = 0.0f; + float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + + if(!PyArg_ParseTuple(args, "fi|sO!", &angle, &matSize, &axis, &vector_Type, &vec)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.RotationMatrix(): expected float int and optional string and vector\n"); + return NULL; + } + + /* Clamp to -360:360 */ + while (angle<-360.0f) + angle+=360.0; + while (angle>360.0f) + angle-=360.0; + + if(matSize != 2 && matSize != 3 && matSize != 4) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.RotationMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); + return NULL; + } + if(matSize == 2 && (axis != NULL || vec != NULL)) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.RotationMatrix(): cannot create a 2x2 rotation matrix around arbitrary axis\n"); + return NULL; + } + if((matSize == 3 || matSize == 4) && axis == NULL) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.RotationMatrix(): please choose an axis of rotation for 3d and 4d matrices\n"); + return NULL; + } + if(axis) { + if(((strcmp(axis, "r") == 0) || (strcmp(axis, "R") == 0)) && vec == NULL) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.RotationMatrix(): please define the arbitrary axis of rotation\n"); + return NULL; + } + } + if(vec) { + if(vec->size != 3) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.RotationMatrix(): the arbitrary axis must be a 3D vector\n"); + return NULL; + } + } + //convert to radians + angle = angle * (float) (Py_PI / 180); + if(axis == NULL && matSize == 2) { + //2D rotation matrix + mat[0] = (float) cos (angle); + mat[1] = (float) sin (angle); + mat[2] = -((float) sin(angle)); + mat[3] = (float) cos(angle); + } else if((strcmp(axis, "x") == 0) || (strcmp(axis, "X") == 0)) { + //rotation around X + mat[0] = 1.0f; + mat[4] = (float) cos(angle); + mat[5] = (float) sin(angle); + mat[7] = -((float) sin(angle)); + mat[8] = (float) cos(angle); + } else if((strcmp(axis, "y") == 0) || (strcmp(axis, "Y") == 0)) { + //rotation around Y + mat[0] = (float) cos(angle); + mat[2] = -((float) sin(angle)); + mat[4] = 1.0f; + mat[6] = (float) sin(angle); + mat[8] = (float) cos(angle); + } else if((strcmp(axis, "z") == 0) || (strcmp(axis, "Z") == 0)) { + //rotation around Z + mat[0] = (float) cos(angle); + mat[1] = (float) sin(angle); + mat[3] = -((float) sin(angle)); + mat[4] = (float) cos(angle); + mat[8] = 1.0f; + } else if((strcmp(axis, "r") == 0) || (strcmp(axis, "R") == 0)) { + //arbitrary rotation + //normalize arbitrary axis + norm = (float) sqrt(vec->vec[0] * vec->vec[0] + + vec->vec[1] * vec->vec[1] + + vec->vec[2] * vec->vec[2]); + vec->vec[0] /= norm; + vec->vec[1] /= norm; + vec->vec[2] /= norm; + + if (isnan(vec->vec[0]) || isnan(vec->vec[1]) || isnan(vec->vec[2])) { + /* zero length vector, return an identity matrix, could also return an error */ + mat[0]= mat[4] = mat[8] = 1.0f; + } else { + /* create matrix */ + cosAngle = (float) cos(angle); + sinAngle = (float) sin(angle); + mat[0] = ((vec->vec[0] * vec->vec[0]) * (1 - cosAngle)) + + cosAngle; + mat[1] = ((vec->vec[0] * vec->vec[1]) * (1 - cosAngle)) + + (vec->vec[2] * sinAngle); + mat[2] = ((vec->vec[0] * vec->vec[2]) * (1 - cosAngle)) - + (vec->vec[1] * sinAngle); + mat[3] = ((vec->vec[0] * vec->vec[1]) * (1 - cosAngle)) - + (vec->vec[2] * sinAngle); + mat[4] = ((vec->vec[1] * vec->vec[1]) * (1 - cosAngle)) + + cosAngle; + mat[5] = ((vec->vec[1] * vec->vec[2]) * (1 - cosAngle)) + + (vec->vec[0] * sinAngle); + mat[6] = ((vec->vec[0] * vec->vec[2]) * (1 - cosAngle)) + + (vec->vec[1] * sinAngle); + mat[7] = ((vec->vec[1] * vec->vec[2]) * (1 - cosAngle)) - + (vec->vec[0] * sinAngle); + mat[8] = ((vec->vec[2] * vec->vec[2]) * (1 - cosAngle)) + + cosAngle; + } + } else { + PyErr_SetString(PyExc_AttributeError, "Mathutils.RotationMatrix(): unrecognizable axis of rotation type - expected x,y,z or r\n"); + return NULL; + } + if(matSize == 4) { + //resize matrix + mat[10] = mat[8]; + mat[9] = mat[7]; + mat[8] = mat[6]; + mat[7] = 0.0f; + mat[6] = mat[5]; + mat[5] = mat[4]; + mat[4] = mat[3]; + mat[3] = 0.0f; + } + //pass to matrix creation + return newMatrixObject(mat, matSize, matSize, Py_NEW); +} +//----------------------------------Mathutils.TranslationMatrix() ------- +//creates a translation matrix +PyObject *M_Mathutils_TranslationMatrix(PyObject * self, VectorObject * vec) +{ + float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + + if(!VectorObject_Check(vec)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.TranslationMatrix(): expected vector\n"); + return NULL; + } + if(vec->size != 3 && vec->size != 4) { + PyErr_SetString(PyExc_TypeError, "Mathutils.TranslationMatrix(): vector must be 3D or 4D\n"); + return NULL; + } + //create a identity matrix and add translation + Mat4One((float(*)[4]) mat); + mat[12] = vec->vec[0]; + mat[13] = vec->vec[1]; + mat[14] = vec->vec[2]; + + return newMatrixObject(mat, 4, 4, Py_NEW); +} +//----------------------------------Mathutils.ScaleMatrix() ------------- +//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. +//creates a scaling matrix +PyObject *M_Mathutils_ScaleMatrix(PyObject * self, PyObject * args) +{ + VectorObject *vec = NULL; + float norm = 0.0f, factor; + int matSize, x; + float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + + if(!PyArg_ParseTuple(args, "fi|O!", &factor, &matSize, &vector_Type, &vec)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.ScaleMatrix(): expected float int and optional vector\n"); + return NULL; + } + if(matSize != 2 && matSize != 3 && matSize != 4) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.ScaleMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); + return NULL; + } + if(vec) { + if(vec->size > 2 && matSize == 2) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.ScaleMatrix(): please use 2D vectors when scaling in 2D\n"); + return NULL; + } + } + if(vec == NULL) { //scaling along axis + if(matSize == 2) { + mat[0] = factor; + mat[3] = factor; + } else { + mat[0] = factor; + mat[4] = factor; + mat[8] = factor; + } + } else { //scaling in arbitrary direction + //normalize arbitrary axis + for(x = 0; x < vec->size; x++) { + norm += vec->vec[x] * vec->vec[x]; + } + norm = (float) sqrt(norm); + for(x = 0; x < vec->size; x++) { + vec->vec[x] /= norm; + } + if(matSize == 2) { + mat[0] = 1 +((factor - 1) *(vec->vec[0] * vec->vec[0])); + mat[1] =((factor - 1) *(vec->vec[0] * vec->vec[1])); + mat[2] =((factor - 1) *(vec->vec[0] * vec->vec[1])); + mat[3] = 1 + ((factor - 1) *(vec->vec[1] * vec->vec[1])); + } else { + mat[0] = 1 + ((factor - 1) *(vec->vec[0] * vec->vec[0])); + mat[1] =((factor - 1) *(vec->vec[0] * vec->vec[1])); + mat[2] =((factor - 1) *(vec->vec[0] * vec->vec[2])); + mat[3] =((factor - 1) *(vec->vec[0] * vec->vec[1])); + mat[4] = 1 + ((factor - 1) *(vec->vec[1] * vec->vec[1])); + mat[5] =((factor - 1) *(vec->vec[1] * vec->vec[2])); + mat[6] =((factor - 1) *(vec->vec[0] * vec->vec[2])); + mat[7] =((factor - 1) *(vec->vec[1] * vec->vec[2])); + mat[8] = 1 + ((factor - 1) *(vec->vec[2] * vec->vec[2])); + } + } + if(matSize == 4) { + //resize matrix + mat[10] = mat[8]; + mat[9] = mat[7]; + mat[8] = mat[6]; + mat[7] = 0.0f; + mat[6] = mat[5]; + mat[5] = mat[4]; + mat[4] = mat[3]; + mat[3] = 0.0f; + } + //pass to matrix creation + return newMatrixObject(mat, matSize, matSize, Py_NEW); +} +//----------------------------------Mathutils.OrthoProjectionMatrix() --- +//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. +//creates an ortho projection matrix +PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * args) +{ + VectorObject *vec = NULL; + char *plane; + int matSize, x; + float norm = 0.0f; + float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + + if(!PyArg_ParseTuple(args, "si|O!", &plane, &matSize, &vector_Type, &vec)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.OrthoProjectionMatrix(): expected string and int and optional vector\n"); + return NULL; + } + if(matSize != 2 && matSize != 3 && matSize != 4) { + PyErr_SetString(PyExc_AttributeError,"Mathutils.OrthoProjectionMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); + return NULL; + } + if(vec) { + if(vec->size > 2 && matSize == 2) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.OrthoProjectionMatrix(): please use 2D vectors when scaling in 2D\n"); + return NULL; + } + } + if(vec == NULL) { //ortho projection onto cardinal plane + if(((strcmp(plane, "x") == 0) + || (strcmp(plane, "X") == 0)) && matSize == 2) { + mat[0] = 1.0f; + } else if(((strcmp(plane, "y") == 0) + || (strcmp(plane, "Y") == 0)) + && matSize == 2) { + mat[3] = 1.0f; + } else if(((strcmp(plane, "xy") == 0) + || (strcmp(plane, "XY") == 0)) + && matSize > 2) { + mat[0] = 1.0f; + mat[4] = 1.0f; + } else if(((strcmp(plane, "xz") == 0) + || (strcmp(plane, "XZ") == 0)) + && matSize > 2) { + mat[0] = 1.0f; + mat[8] = 1.0f; + } else if(((strcmp(plane, "yz") == 0) + || (strcmp(plane, "YZ") == 0)) + && matSize > 2) { + mat[4] = 1.0f; + mat[8] = 1.0f; + } else { + PyErr_SetString(PyExc_AttributeError, "Mathutils.OrthoProjectionMatrix(): unknown plane - expected: x, y, xy, xz, yz\n"); + return NULL; + } + } else { //arbitrary plane + //normalize arbitrary axis + for(x = 0; x < vec->size; x++) { + norm += vec->vec[x] * vec->vec[x]; + } + norm = (float) sqrt(norm); + for(x = 0; x < vec->size; x++) { + vec->vec[x] /= norm; + } + if(((strcmp(plane, "r") == 0) + || (strcmp(plane, "R") == 0)) && matSize == 2) { + mat[0] = 1 - (vec->vec[0] * vec->vec[0]); + mat[1] = -(vec->vec[0] * vec->vec[1]); + mat[2] = -(vec->vec[0] * vec->vec[1]); + mat[3] = 1 - (vec->vec[1] * vec->vec[1]); + } else if(((strcmp(plane, "r") == 0) + || (strcmp(plane, "R") == 0)) + && matSize > 2) { + mat[0] = 1 - (vec->vec[0] * vec->vec[0]); + mat[1] = -(vec->vec[0] * vec->vec[1]); + mat[2] = -(vec->vec[0] * vec->vec[2]); + mat[3] = -(vec->vec[0] * vec->vec[1]); + mat[4] = 1 - (vec->vec[1] * vec->vec[1]); + mat[5] = -(vec->vec[1] * vec->vec[2]); + mat[6] = -(vec->vec[0] * vec->vec[2]); + mat[7] = -(vec->vec[1] * vec->vec[2]); + mat[8] = 1 - (vec->vec[2] * vec->vec[2]); + } else { + PyErr_SetString(PyExc_AttributeError, "Mathutils.OrthoProjectionMatrix(): unknown plane - expected: 'r' expected for axis designation\n"); + return NULL; + } + } + if(matSize == 4) { + //resize matrix + mat[10] = mat[8]; + mat[9] = mat[7]; + mat[8] = mat[6]; + mat[7] = 0.0f; + mat[6] = mat[5]; + mat[5] = mat[4]; + mat[4] = mat[3]; + mat[3] = 0.0f; + } + //pass to matrix creation + return newMatrixObject(mat, matSize, matSize, Py_NEW); +} +//----------------------------------Mathutils.ShearMatrix() ------------- +//creates a shear matrix +PyObject *M_Mathutils_ShearMatrix(PyObject * self, PyObject * args) +{ + int matSize; + char *plane; + float factor; + float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + + if(!PyArg_ParseTuple(args, "sfi", &plane, &factor, &matSize)) { + PyErr_SetString(PyExc_TypeError,"Mathutils.ShearMatrix(): expected string float and int\n"); + return NULL; + } + if(matSize != 2 && matSize != 3 && matSize != 4) { + PyErr_SetString(PyExc_AttributeError,"Mathutils.ShearMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); + return NULL; + } + + if(((strcmp(plane, "x") == 0) || (strcmp(plane, "X") == 0)) + && matSize == 2) { + mat[0] = 1.0f; + mat[2] = factor; + mat[3] = 1.0f; + } else if(((strcmp(plane, "y") == 0) + || (strcmp(plane, "Y") == 0)) && matSize == 2) { + mat[0] = 1.0f; + mat[1] = factor; + mat[3] = 1.0f; + } else if(((strcmp(plane, "xy") == 0) + || (strcmp(plane, "XY") == 0)) && matSize > 2) { + mat[0] = 1.0f; + mat[4] = 1.0f; + mat[6] = factor; + mat[7] = factor; + } else if(((strcmp(plane, "xz") == 0) + || (strcmp(plane, "XZ") == 0)) && matSize > 2) { + mat[0] = 1.0f; + mat[3] = factor; + mat[4] = 1.0f; + mat[5] = factor; + mat[8] = 1.0f; + } else if(((strcmp(plane, "yz") == 0) + || (strcmp(plane, "YZ") == 0)) && matSize > 2) { + mat[0] = 1.0f; + mat[1] = factor; + mat[2] = factor; + mat[4] = 1.0f; + mat[8] = 1.0f; + } else { + PyErr_SetString(PyExc_AttributeError, "Mathutils.ShearMatrix(): expected: x, y, xy, xz, yz or wrong matrix size for shearing plane\n"); + return NULL; + } + if(matSize == 4) { + //resize matrix + mat[10] = mat[8]; + mat[9] = mat[7]; + mat[8] = mat[6]; + mat[7] = 0.0f; + mat[6] = mat[5]; + mat[5] = mat[4]; + mat[4] = mat[3]; + mat[3] = 0.0f; + } + //pass to matrix creation + return newMatrixObject(mat, matSize, matSize, Py_NEW); +} +//----------------------------------QUATERNION FUNCTIONS----------------- +//----------------------------------Mathutils.Quaternion() -------------- +PyObject *M_Mathutils_Quaternion(PyObject * self, PyObject * args) +{ + PyObject *listObject = NULL, *n, *q, *f; + int size, i; + float quat[4]; + double norm = 0.0f, angle = 0.0f; + + size = PySequence_Length(args); + if (size == 1 || size == 2) { //seq? + listObject = PySequence_GetItem(args, 0); + if (PySequence_Check(listObject)) { + size = PySequence_Length(listObject); + if ((size == 4 && PySequence_Length(args) !=1) || + (size == 3 && PySequence_Length(args) !=2) || (size >4 || size < 3)) { + // invalid args/size + Py_DECREF(listObject); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + if(size == 3){ //get angle in axis/angle + n = PySequence_GetItem(args, 1); + if(n == NULL) { // parsed item not a number or getItem fail + Py_DECREF(listObject); + PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + + angle = PyFloat_AsDouble(n); + Py_DECREF(n); + + if (angle==-1 && PyErr_Occurred()) { + Py_DECREF(listObject); + PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + } + }else{ + Py_DECREF(listObject); /* assume the list is teh second arg */ + listObject = PySequence_GetItem(args, 1); + if (size>1 && PySequence_Check(listObject)) { + size = PySequence_Length(listObject); + if (size != 3) { + // invalid args/size + Py_DECREF(listObject); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + n = PySequence_GetItem(args, 0); + if(n == NULL) { // parsed item not a number or getItem fail + Py_DECREF(listObject); + PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + angle = PyFloat_AsDouble(n); + Py_DECREF(n); + + if (angle==-1 && PyErr_Occurred()) { + Py_DECREF(listObject); + PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + } else { // argument was not a sequence + Py_XDECREF(listObject); + PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + } + } else if (size == 0) { //returns a new empty quat + return newQuaternionObject(NULL, Py_NEW); + } else { + Py_INCREF(args); + listObject = args; + } + + if (size == 3) { // invalid quat size + if(PySequence_Length(args) != 2){ + Py_DECREF(listObject); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + }else{ + if(size != 4){ + Py_DECREF(listObject); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + } + + for (i=0; iquat, quatV->quat); + + return newQuaternionObject(quat, Py_NEW); +} +//----------------------------------Mathutils.DotQuats() ---------------- +//returns the dot product of 2 quaternions +PyObject *M_Mathutils_DotQuats(PyObject * self, PyObject * args) +{ + QuaternionObject *quatU = NULL, *quatV = NULL; + double dot = 0.0f; + int x; + + if(!PyArg_ParseTuple(args, "O!O!", &quaternion_Type, &quatU, &quaternion_Type, &quatV)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.DotQuats(): expected Quaternion types"); + return NULL; + } + + for(x = 0; x < 4; x++) { + dot += quatU->quat[x] * quatV->quat[x]; + } + return PyFloat_FromDouble(dot); +} +//----------------------------------Mathutils.DifferenceQuats() --------- +//returns the difference between 2 quaternions +PyObject *M_Mathutils_DifferenceQuats(PyObject * self, PyObject * args) +{ + QuaternionObject *quatU = NULL, *quatV = NULL; + float quat[4], tempQuat[4]; + double dot = 0.0f; + int x; + + if(!PyArg_ParseTuple(args, "O!O!", &quaternion_Type, &quatU, &quaternion_Type, &quatV)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.DifferenceQuats(): expected Quaternion types"); + return NULL; + } + tempQuat[0] = quatU->quat[0]; + tempQuat[1] = -quatU->quat[1]; + tempQuat[2] = -quatU->quat[2]; + tempQuat[3] = -quatU->quat[3]; + + dot = sqrt(tempQuat[0] * tempQuat[0] + tempQuat[1] * tempQuat[1] + + tempQuat[2] * tempQuat[2] + tempQuat[3] * tempQuat[3]); + + for(x = 0; x < 4; x++) { + tempQuat[x] /= (float)(dot * dot); + } + QuatMul(quat, tempQuat, quatV->quat); + return newQuaternionObject(quat, Py_NEW); +} +//----------------------------------Mathutils.Slerp() ------------------ +//attemps to interpolate 2 quaternions and return the result +PyObject *M_Mathutils_Slerp(PyObject * self, PyObject * args) +{ + QuaternionObject *quatU = NULL, *quatV = NULL; + float quat[4], quat_u[4], quat_v[4], param; + double x, y, dot, sinT, angle, IsinT; + int z; + + if(!PyArg_ParseTuple(args, "O!O!f", &quaternion_Type, &quatU, &quaternion_Type, &quatV, ¶m)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.Slerp(): expected Quaternion types and float"); + return NULL; + } + if(param > 1.0f || param < 0.0f) { + PyErr_SetString(PyExc_AttributeError, "Mathutils.Slerp(): interpolation factor must be between 0.0 and 1.0"); + return NULL; + } + + //copy quats + for(z = 0; z < 4; z++){ + quat_u[z] = quatU->quat[z]; + quat_v[z] = quatV->quat[z]; + } + + //dot product + dot = quat_u[0] * quat_v[0] + quat_u[1] * quat_v[1] + + quat_u[2] * quat_v[2] + quat_u[3] * quat_v[3]; + + //if negative negate a quat (shortest arc) + if(dot < 0.0f) { + quat_v[0] = -quat_v[0]; + quat_v[1] = -quat_v[1]; + quat_v[2] = -quat_v[2]; + quat_v[3] = -quat_v[3]; + dot = -dot; + } + if(dot > .99999f) { //very close + x = 1.0f - param; + y = param; + } else { + //calculate sin of angle + sinT = sqrt(1.0f - (dot * dot)); + //calculate angle + angle = atan2(sinT, dot); + //caluculate inverse of sin(theta) + IsinT = 1.0f / sinT; + x = sin((1.0f - param) * angle) * IsinT; + y = sin(param * angle) * IsinT; + } + //interpolate + quat[0] = (float)(quat_u[0] * x + quat_v[0] * y); + quat[1] = (float)(quat_u[1] * x + quat_v[1] * y); + quat[2] = (float)(quat_u[2] * x + quat_v[2] * y); + quat[3] = (float)(quat_u[3] * x + quat_v[3] * y); + + return newQuaternionObject(quat, Py_NEW); +} +//----------------------------------EULER FUNCTIONS---------------------- +//----------------------------------Mathutils.Euler() ------------------- +//makes a new euler for you to play with +PyObject *M_Mathutils_Euler(PyObject * self, PyObject * args) +{ + + PyObject *listObject = NULL; + int size, i; + float eul[3]; + PyObject *e, *f; + + size = PySequence_Length(args); + if (size == 1) { + listObject = PySequence_GetItem(args, 0); + if (PySequence_Check(listObject)) { + size = PySequence_Length(listObject); + } else { // Single argument was not a sequence + Py_DECREF(listObject); + PyErr_SetString(PyExc_TypeError, "Mathutils.Euler(): 3d numeric sequence expected\n"); + return NULL; + } + } else if (size == 0) { + //returns a new empty 3d euler + return newEulerObject(NULL, Py_NEW); + } else { + Py_INCREF(args); + listObject = args; + } + + if (size != 3) { // Invalid euler size + Py_DECREF(listObject); + PyErr_SetString(PyExc_AttributeError, "Mathutils.Euler(): 3d numeric sequence expected\n"); + return NULL; + } + + for (i=0; isize != 3 || vec2->size != 3 || vec3->size != 3 || ray->size != 3 || ray_off->size != 3) { + PyErr_SetString( PyExc_TypeError, "only 3D vectors for all parameters\n"); + return NULL; + } + + VECCOPY(v1, vec1->vec); + VECCOPY(v2, vec2->vec); + VECCOPY(v3, vec3->vec); + + VECCOPY(dir, ray->vec); + Normalize(dir); + + VECCOPY(orig, ray_off->vec); + + /* find vectors for two edges sharing v1 */ + VecSubf(e1, v2, v1); + VecSubf(e2, v3, v1); + + /* begin calculating determinant - also used to calculated U parameter */ + Crossf(pvec, dir, e2); + + /* if determinant is near zero, ray lies in plane of triangle */ + det = Inpf(e1, pvec); + + if (det > -0.000001 && det < 0.000001) { + Py_RETURN_NONE; + } + + inv_det = 1.0f / det; + + /* calculate distance from v1 to ray origin */ + VecSubf(tvec, orig, v1); + + /* calculate U parameter and test bounds */ + u = Inpf(tvec, pvec) * inv_det; + if (clip && (u < 0.0f || u > 1.0f)) { + Py_RETURN_NONE; + } + + /* prepare to test the V parameter */ + Crossf(qvec, tvec, e1); + + /* calculate V parameter and test bounds */ + v = Inpf(dir, qvec) * inv_det; + + if (clip && (v < 0.0f || u + v > 1.0f)) { + Py_RETURN_NONE; + } + + /* calculate t, ray intersects triangle */ + t = Inpf(e2, qvec) * inv_det; + + VecMulf(dir, t); + VecAddf(pvec, orig, dir); + + return newVectorObject(pvec, 3, Py_NEW); +} +//----------------------------------Mathutils.LineIntersect() ------------------- +/* Line-Line intersection using algorithm from mathworld.wolfram.com */ +PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args ) +{ + PyObject * tuple; + VectorObject *vec1, *vec2, *vec3, *vec4; + float v1[3], v2[3], v3[3], v4[3], i1[3], i2[3]; + + if( !PyArg_ParseTuple( args, "O!O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3, &vector_Type, &vec4 ) ) { + PyErr_SetString( PyExc_TypeError, "expected 4 vector types\n" ); + return NULL; + } + if( vec1->size != vec2->size || vec1->size != vec3->size || vec1->size != vec2->size) { + PyErr_SetString( PyExc_TypeError,"vectors must be of the same size\n" ); + return NULL; + } + if( vec1->size == 3 || vec1->size == 2) { + int result; + + if (vec1->size == 3) { + VECCOPY(v1, vec1->vec); + VECCOPY(v2, vec2->vec); + VECCOPY(v3, vec3->vec); + VECCOPY(v4, vec4->vec); + } + else { + v1[0] = vec1->vec[0]; + v1[1] = vec1->vec[1]; + v1[2] = 0.0f; + + v2[0] = vec2->vec[0]; + v2[1] = vec2->vec[1]; + v2[2] = 0.0f; + + v3[0] = vec3->vec[0]; + v3[1] = vec3->vec[1]; + v3[2] = 0.0f; + + v4[0] = vec4->vec[0]; + v4[1] = vec4->vec[1]; + v4[2] = 0.0f; + } + + result = LineIntersectLine(v1, v2, v3, v4, i1, i2); + + if (result == 0) { + /* colinear */ + Py_RETURN_NONE; + } + else { + tuple = PyTuple_New( 2 ); + PyTuple_SetItem( tuple, 0, newVectorObject(i1, vec1->size, Py_NEW) ); + PyTuple_SetItem( tuple, 1, newVectorObject(i2, vec1->size, Py_NEW) ); + return tuple; + } + } + else { + PyErr_SetString( PyExc_TypeError, "2D/3D vectors only\n" ); + return NULL; + } +} + + + +//---------------------------------NORMALS FUNCTIONS-------------------- +//----------------------------------Mathutils.QuadNormal() ------------------- +PyObject *M_Mathutils_QuadNormal( PyObject * self, PyObject * args ) +{ + VectorObject *vec1; + VectorObject *vec2; + VectorObject *vec3; + VectorObject *vec4; + float v1[3], v2[3], v3[3], v4[3], e1[3], e2[3], n1[3], n2[3]; + + if( !PyArg_ParseTuple( args, "O!O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3, &vector_Type, &vec4 ) ) { + PyErr_SetString( PyExc_TypeError, "expected 4 vector types\n" ); + return NULL; + } + if( vec1->size != vec2->size || vec1->size != vec3->size || vec1->size != vec4->size) { + PyErr_SetString( PyExc_TypeError,"vectors must be of the same size\n" ); + return NULL; + } + if( vec1->size != 3 ) { + PyErr_SetString( PyExc_TypeError, "only 3D vectors\n" ); + return NULL; + } + VECCOPY(v1, vec1->vec); + VECCOPY(v2, vec2->vec); + VECCOPY(v3, vec3->vec); + VECCOPY(v4, vec4->vec); + + /* find vectors for two edges sharing v2 */ + VecSubf(e1, v1, v2); + VecSubf(e2, v3, v2); + + Crossf(n1, e2, e1); + Normalize(n1); + + /* find vectors for two edges sharing v4 */ + VecSubf(e1, v3, v4); + VecSubf(e2, v1, v4); + + Crossf(n2, e2, e1); + Normalize(n2); + + /* adding and averaging the normals of both triangles */ + VecAddf(n1, n2, n1); + Normalize(n1); + + return newVectorObject(n1, 3, Py_NEW); +} + +//----------------------------Mathutils.TriangleNormal() ------------------- +PyObject *M_Mathutils_TriangleNormal( PyObject * self, PyObject * args ) +{ + VectorObject *vec1, *vec2, *vec3; + float v1[3], v2[3], v3[3], e1[3], e2[3], n[3]; + + if( !PyArg_ParseTuple( args, "O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3 ) ) { + PyErr_SetString( PyExc_TypeError, "expected 3 vector types\n" ); + return NULL; + } + if( vec1->size != vec2->size || vec1->size != vec3->size ) { + PyErr_SetString( PyExc_TypeError, "vectors must be of the same size\n" ); + return NULL; + } + if( vec1->size != 3 ) { + PyErr_SetString( PyExc_TypeError, "only 3D vectors\n" ); + return NULL; + } + + VECCOPY(v1, vec1->vec); + VECCOPY(v2, vec2->vec); + VECCOPY(v3, vec3->vec); + + /* find vectors for two edges sharing v2 */ + VecSubf(e1, v1, v2); + VecSubf(e2, v3, v2); + + Crossf(n, e2, e1); + Normalize(n); + + return newVectorObject(n, 3, Py_NEW); +} + +//--------------------------------- AREA FUNCTIONS-------------------- +//----------------------------------Mathutils.TriangleArea() ------------------- +PyObject *M_Mathutils_TriangleArea( PyObject * self, PyObject * args ) +{ + VectorObject *vec1, *vec2, *vec3; + float v1[3], v2[3], v3[3]; + + if( !PyArg_ParseTuple + ( args, "O!O!O!", &vector_Type, &vec1, &vector_Type, &vec2 + , &vector_Type, &vec3 ) ) { + PyErr_SetString( PyExc_TypeError, "expected 3 vector types\n"); + return NULL; + } + if( vec1->size != vec2->size || vec1->size != vec3->size ) { + PyErr_SetString( PyExc_TypeError, "vectors must be of the same size\n" ); + return NULL; + } + + if (vec1->size == 3) { + VECCOPY(v1, vec1->vec); + VECCOPY(v2, vec2->vec); + VECCOPY(v3, vec3->vec); + + return PyFloat_FromDouble( AreaT3Dfl(v1, v2, v3) ); + } + else if (vec1->size == 2) { + v1[0] = vec1->vec[0]; + v1[1] = vec1->vec[1]; + + v2[0] = vec2->vec[0]; + v2[1] = vec2->vec[1]; + + v3[0] = vec3->vec[0]; + v3[1] = vec3->vec[1]; + + return PyFloat_FromDouble( AreaF2Dfl(v1, v2, v3) ); + } + else { + PyErr_SetString( PyExc_TypeError, "only 2D,3D vectors are supported\n" ); + return NULL; + } +} +//#############################DEPRECATED################################ +//####################################################################### +//----------------------------------Mathutils.CopyMat() ----------------- +//copies a matrix into a new matrix +PyObject *M_Mathutils_CopyMat(PyObject * self, PyObject * args) +{ + PyObject *matrix = NULL; + static char warning = 1; + + if( warning ) { + printf("Mathutils.CopyMat(): deprecated :use Mathutils.Matrix() to copy matrices\n"); + --warning; + } + + matrix = M_Mathutils_Matrix(self, args); + if(matrix == NULL) + return NULL; //error string already set if we get here + else + return matrix; +} +//----------------------------------Mathutils.CopyVec() ----------------- +//makes a new vector that is a copy of the input +PyObject *M_Mathutils_CopyVec(PyObject * self, PyObject * args) +{ + PyObject *vec = NULL; + static char warning = 1; + + if( warning ) { + printf("Mathutils.CopyVec(): Deprecated: use Mathutils.Vector() to copy vectors\n"); + --warning; + } + + vec = M_Mathutils_Vector(self, args); + if(vec == NULL) + return NULL; //error string already set if we get here + else + return vec; +} +//----------------------------------Mathutils.CopyQuat() -------------- +//Copies a quaternion to a new quat +PyObject *M_Mathutils_CopyQuat(PyObject * self, PyObject * args) +{ + PyObject *quat = NULL; + static char warning = 1; + + if( warning ) { + printf("Mathutils.CopyQuat(): Deprecated: use Mathutils.Quaternion() to copy vectors\n"); + --warning; + } + + quat = M_Mathutils_Quaternion(self, args); + if(quat == NULL) + return NULL; //error string already set if we get here + else + return quat; +} +//----------------------------------Mathutils.CopyEuler() --------------- +//copies a euler to a new euler +PyObject *M_Mathutils_CopyEuler(PyObject * self, PyObject * args) +{ + PyObject *eul = NULL; + static char warning = 1; + + if( warning ) { + printf("Mathutils.CopyEuler(): deprecated:use Mathutils.Euler() to copy vectors\n"); + --warning; + } + + eul = M_Mathutils_Euler(self, args); + if(eul == NULL) + return NULL; //error string already set if we get here + else + return eul; +} +//----------------------------------Mathutils.RotateEuler() ------------ +//rotates a euler a certain amount and returns the result +//should return a unique euler rotation (i.e. no 720 degree pitches :) +PyObject *M_Mathutils_RotateEuler(PyObject * self, PyObject * args) +{ + EulerObject *Eul = NULL; + float angle; + char *axis; + static char warning = 1; + + if( warning ) { + printf("Mathutils.RotateEuler(): Deprecated:use Euler.rotate() to rotate a euler\n"); + --warning; + } + + if(!PyArg_ParseTuple(args, "O!fs", &euler_Type, &Eul, &angle, &axis)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.RotateEuler(): expected euler type & float & string"); + return NULL; + } + + Euler_Rotate(Eul, Py_BuildValue("fs", angle, axis)); + Py_RETURN_NONE; +} +//----------------------------------Mathutils.MatMultVec() -------------- +//COLUMN VECTOR Multiplication (Matrix X Vector) +PyObject *M_Mathutils_MatMultVec(PyObject * self, PyObject * args) +{ + MatrixObject *mat = NULL; + VectorObject *vec = NULL; + static char warning = 1; + + if( warning ) { + printf("Mathutils.MatMultVec(): Deprecated: use matrix * vec to perform column vector multiplication\n"); + --warning; + } + + //get pyObjects + if(!PyArg_ParseTuple(args, "O!O!", &matrix_Type, &mat, &vector_Type, &vec)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.MatMultVec(): MatMultVec() expects a matrix and a vector object - in that order\n"); + return NULL; + } + + return column_vector_multiplication(mat, vec); +} +//----------------------------------Mathutils.VecMultMat() --------------- +//ROW VECTOR Multiplication - Vector X Matrix +PyObject *M_Mathutils_VecMultMat(PyObject * self, PyObject * args) +{ + MatrixObject *mat = NULL; + VectorObject *vec = NULL; + static char warning = 1; + + if( warning ) { + printf("Mathutils.VecMultMat(): Deprecated: use vec * matrix to perform row vector multiplication\n"); + --warning; + } + + //get pyObjects + if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec, &matrix_Type, &mat)) { + PyErr_SetString(PyExc_TypeError, "Mathutils.VecMultMat(): VecMultMat() expects a vector and matrix object - in that order\n"); + return NULL; + } + + return row_vector_multiplication(vec, mat); +} + +/* Utility functions */ + +/*---------------------- EXPP_FloatsAreEqual ------------------------- + Floating point comparisons + floatStep = number of representable floats allowable in between + float A and float B to be considered equal. */ +int EXPP_FloatsAreEqual(float A, float B, int floatSteps) +{ + int a, b, delta; + assert(floatSteps > 0 && floatSteps < (4 * 1024 * 1024)); + a = *(int*)&A; + if (a < 0) + a = 0x80000000 - a; + b = *(int*)&B; + if (b < 0) + b = 0x80000000 - b; + delta = abs(a - b); + if (delta <= floatSteps) + return 1; + return 0; +} +/*---------------------- EXPP_VectorsAreEqual ------------------------- + Builds on EXPP_FloatsAreEqual to test vectors */ +int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps){ + + int x; + for (x=0; x< size; x++){ + if (EXPP_FloatsAreEqual(vecA[x], vecB[x], floatSteps) == 0) + return 0; + } + return 1; +} + + + +//####################################################################### +//#############################DEPRECATED################################ diff --git a/source/blender/python/generic/Mathutils.h b/source/blender/python/generic/Mathutils.h new file mode 100644 index 00000000000..4c8153e5e54 --- /dev/null +++ b/source/blender/python/generic/Mathutils.h @@ -0,0 +1,100 @@ +/* + * $Id: Mathutils.h 20332 2009-05-22 03:22:56Z campbellbarton $ + * + * ***** BEGIN GPL 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. + * + * 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 LICENSE BLOCK ***** +*/ +//Include this file for access to vector, quat, matrix, euler, etc... + +#ifndef EXPP_Mathutils_H +#define EXPP_Mathutils_H + +#include +#include "vector.h" +#include "matrix.h" +#include "quat.h" +#include "euler.h" + +PyObject *Mathutils_Init( const char * from ); + +PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat); +PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec); +PyObject *quat_rotation(PyObject *arg1, PyObject *arg2); + +PyObject *M_Mathutils_Rand(PyObject * self, PyObject * args); +PyObject *M_Mathutils_Vector(PyObject * self, PyObject * args); +PyObject *M_Mathutils_AngleBetweenVecs(PyObject * self, PyObject * args); +PyObject *M_Mathutils_MidpointVecs(PyObject * self, PyObject * args); +PyObject *M_Mathutils_ProjectVecs(PyObject * self, PyObject * args); +PyObject *M_Mathutils_Matrix(PyObject * self, PyObject * args); +PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args); +PyObject *M_Mathutils_TranslationMatrix(PyObject * self, VectorObject * value); +PyObject *M_Mathutils_ScaleMatrix(PyObject * self, PyObject * args); +PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * args); +PyObject *M_Mathutils_ShearMatrix(PyObject * self, PyObject * args); +PyObject *M_Mathutils_Quaternion(PyObject * self, PyObject * args); +PyObject *M_Mathutils_DifferenceQuats(PyObject * self, PyObject * args); +PyObject *M_Mathutils_Slerp(PyObject * self, PyObject * args); +PyObject *M_Mathutils_Euler(PyObject * self, PyObject * args); +PyObject *M_Mathutils_Intersect( PyObject * self, PyObject * args ); +PyObject *M_Mathutils_TriangleArea( PyObject * self, PyObject * args ); +PyObject *M_Mathutils_TriangleNormal( PyObject * self, PyObject * args ); +PyObject *M_Mathutils_QuadNormal( PyObject * self, PyObject * args ); +PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args ); +//DEPRECATED +PyObject *M_Mathutils_CopyMat(PyObject * self, PyObject * args); +PyObject *M_Mathutils_CopyVec(PyObject * self, PyObject * args); +PyObject *M_Mathutils_CopyQuat(PyObject * self, PyObject * args); +PyObject *M_Mathutils_CopyEuler(PyObject * self, PyObject * args); +PyObject *M_Mathutils_RotateEuler(PyObject * self, PyObject * args); +PyObject *M_Mathutils_MatMultVec(PyObject * self, PyObject * args); +PyObject *M_Mathutils_VecMultMat(PyObject * self, PyObject * args); +PyObject *M_Mathutils_CrossVecs(PyObject * self, PyObject * args); +PyObject *M_Mathutils_DotVecs(PyObject * self, PyObject * args); +PyObject *M_Mathutils_CrossQuats(PyObject * self, PyObject * args); +PyObject *M_Mathutils_DotQuats(PyObject * self, PyObject * args); + +int EXPP_FloatsAreEqual(float A, float B, int floatSteps); +int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps); + + +#define Py_PI 3.14159265358979323846 +#define Py_WRAP 1024 +#define Py_NEW 2048 + + +/* Mathutils is used by the BGE and Blender so have to define + * some things here for luddite mac users of py2.3 */ +#ifndef Py_RETURN_NONE +#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None +#endif +#ifndef Py_RETURN_FALSE +#define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False +#endif +#ifndef Py_RETURN_TRUE +#define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True +#endif + +#endif /* EXPP_Mathutils_H */ diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c new file mode 100644 index 00000000000..6789aea9c10 --- /dev/null +++ b/source/blender/python/generic/bpy_internal_import.c @@ -0,0 +1,341 @@ +/* + * $Id: bpy_internal_import.c 20434 2009-05-26 18:06:09Z campbellbarton $ + * ***** BEGIN GPL 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. + * + * 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): Willian P. Germano + * + * ***** END GPL LICENSE BLOCK ***** +*/ + +#include "bpy_internal_import.h" +#include "DNA_text_types.h" +#include "DNA_ID.h" + +#include "MEM_guardedalloc.h" +#include "BKE_text.h" /* txt_to_buf */ +#include "BKE_main.h" + +static Main *bpy_import_main= NULL; + +static void free_compiled_text(Text *text) +{ + if(text->compiled) { + Py_DECREF(( PyObject * )text->compiled); + } + text->compiled= NULL; +} + +struct Main *bpy_import_main_get(void) +{ + return bpy_import_main; +} + +void bpy_import_main_set(struct Main *maggie) +{ + bpy_import_main= maggie; +} + + +PyObject *bpy_text_import( char *name, int *found ) +{ + Text *text; + char txtname[22]; /* 21+NULL */ + char *buf = NULL; + int namelen = strlen( name ); +//XXX Main *maggie= bpy_import_main ? bpy_import_main:G.main; + Main *maggie= bpy_import_main; + + *found= 0; + + if (namelen>21-3) return NULL; /* we know this cant be importable, the name is too long for blender! */ + + memcpy( txtname, name, namelen ); + memcpy( &txtname[namelen], ".py", 4 ); + + for(text = maggie->text.first; text; text = text->id.next) { + if( !strcmp( txtname, text->id.name+2 ) ) + break; + } + + if( !text ) + return NULL; + else + *found = 1; + + if( !text->compiled ) { + buf = txt_to_buf( text ); + text->compiled = Py_CompileString( buf, text->id.name+2, Py_file_input ); + MEM_freeN( buf ); + + if( PyErr_Occurred( ) ) { + PyErr_Print( ); + PyErr_Clear( ); + PySys_SetObject("last_traceback", NULL); + free_compiled_text( text ); + return NULL; + } + } + + return PyImport_ExecCodeModule( name, text->compiled ); +} + + +/* + * find in-memory module and recompile + */ + +PyObject *bpy_text_reimport( PyObject *module, int *found ) +{ + Text *text; + char *txtname; + char *name; + char *buf = NULL; +//XXX Main *maggie= bpy_import_main ? bpy_import_main:G.main; + Main *maggie= bpy_import_main; + + *found= 0; + + /* get name, filename from the module itself */ + + txtname = PyModule_GetFilename( module ); + name = PyModule_GetName( module ); + if( !txtname || !name) + return NULL; + + /* look up the text object */ + text = ( Text * ) & ( maggie->text.first ); + while( text ) { + if( !strcmp( txtname, text->id.name+2 ) ) + break; + text = text->id.next; + } + + /* uh-oh.... didn't find it */ + if( !text ) + return NULL; + else + *found = 1; + + /* if previously compiled, free the object */ + /* (can't see how could be NULL, but check just in case) */ + if( text->compiled ){ + Py_DECREF( (PyObject *)text->compiled ); + } + + /* compile the buffer */ + buf = txt_to_buf( text ); + text->compiled = Py_CompileString( buf, text->id.name+2, Py_file_input ); + MEM_freeN( buf ); + + /* if compile failed.... return this error */ + if( PyErr_Occurred( ) ) { + PyErr_Print( ); + PyErr_Clear( ); + PySys_SetObject("last_traceback", NULL); + free_compiled_text( text ); + return NULL; + } + + /* make into a module */ + return PyImport_ExecCodeModule( name, text->compiled ); +} + + +static PyObject *blender_import( PyObject * self, PyObject * args, PyObject * kw) +{ + PyObject *exception, *err, *tb; + char *name; + int found= 0; + PyObject *globals = NULL, *locals = NULL, *fromlist = NULL; + PyObject *newmodule; + + //PyObject_Print(args, stderr, 0); +#if (PY_VERSION_HEX >= 0x02060000) + int dummy_val; /* what does this do?*/ + static char *kwlist[] = {"name", "globals", "locals", "fromlist", "level", 0}; + + if( !PyArg_ParseTupleAndKeywords( args, kw, "s|OOOi:bpy_import_meth", kwlist, + &name, &globals, &locals, &fromlist, &dummy_val) ) + return NULL; +#else + static char *kwlist[] = {"name", "globals", "locals", "fromlist", 0}; + + if( !PyArg_ParseTupleAndKeywords( args, kw, "s|OOO:bpy_import_meth", kwlist, + &name, &globals, &locals, &fromlist ) ) + return NULL; +#endif + + /* import existing builtin modules or modules that have been imported alredy */ + newmodule = PyImport_ImportModuleEx( name, globals, locals, fromlist ); + + if(newmodule) + return newmodule; + + PyErr_Fetch( &exception, &err, &tb ); /* get the python error incase we cant import as blender text either */ + + /* importing from existing modules failed, see if we have this module as blender text */ + newmodule = bpy_text_import( name, &found ); + + if( newmodule ) {/* found module as blender text, ignore above exception */ + PyErr_Clear( ); + Py_XDECREF( exception ); + Py_XDECREF( err ); + Py_XDECREF( tb ); + /* printf( "imported from text buffer...\n" ); */ + } + else if (found==1) { /* blender text module failed to execute but was found, use its error message */ + Py_XDECREF( exception ); + Py_XDECREF( err ); + Py_XDECREF( tb ); + return NULL; + } + else { + /* no blender text was found that could import the module + * rause the original error from PyImport_ImportModuleEx */ + PyErr_Restore( exception, err, tb ); + } + return newmodule; +} + + +/* + * our reload() module, to handle reloading in-memory scripts + */ + +static PyObject *blender_reload( PyObject * self, PyObject * args ) +{ + PyObject *exception, *err, *tb; + PyObject *module = NULL; + PyObject *newmodule = NULL; + int found= 0; + + /* check for a module arg */ + if( !PyArg_ParseTuple( args, "O:bpy_reload_meth", &module ) ) + return NULL; + + /* try reimporting from file */ + newmodule = PyImport_ReloadModule( module ); + if( newmodule ) + return newmodule; + + /* no file, try importing from memory */ + PyErr_Fetch( &exception, &err, &tb ); /*restore for probable later use */ + + newmodule = bpy_text_reimport( module, &found ); + if( newmodule ) {/* found module as blender text, ignore above exception */ + PyErr_Clear( ); + Py_XDECREF( exception ); + Py_XDECREF( err ); + Py_XDECREF( tb ); + /* printf( "imported from text buffer...\n" ); */ + } + else if (found==1) { /* blender text module failed to execute but was found, use its error message */ + Py_XDECREF( exception ); + Py_XDECREF( err ); + Py_XDECREF( tb ); + return NULL; + } + else { + /* no blender text was found that could import the module + * rause the original error from PyImport_ImportModuleEx */ + PyErr_Restore( exception, err, tb ); + } + + return newmodule; +} + +PyMethodDef bpy_import_meth[] = { {"bpy_import_meth", blender_import, METH_VARARGS | METH_KEYWORDS, "blenders import"} }; +PyMethodDef bpy_reload_meth[] = { {"bpy_reload_meth", blender_reload, METH_VARARGS, "blenders reload"} }; + + +/* Clear user modules. + * This is to clear any modules that could be defined from running scripts in blender. + * + * Its also needed for the BGE Python api so imported scripts are not used between levels + * + * This clears every modules that has a __file__ attribute (is not a builtin) + * + * Note that clearing external python modules is important for the BGE otherwise + * it wont reload scripts between loading different blend files or while making the game. + * - use 'clear_all' arg in this case. + * + * Since pythons bultins include a full path even for win32. + * even if we remove a python module a reimport will bring it back again. + */ + +#if 0 // not used anymore but may still come in handy later + +#if defined(WIN32) || defined(WIN64) +#define SEPSTR "\\" +#else +#define SEPSTR "/" +#endif + + +void bpy_text_clear_modules(int clear_all) +{ + PyObject *modules= PySys_GetObject("modules"); + + char *fname; + char *file_extension; + + /* looping over the dict */ + PyObject *key, *value; + int pos = 0; + + /* new list */ + PyObject *list; + + if (modules==NULL) + return; /* should never happen but just incase */ + + list= PyList_New(0); + + /* go over sys.modules and remove anything with a + * sys.modukes[x].__file__ thats ends with a .py and has no path + */ + while (PyDict_Next(modules, &pos, &key, &value)) { + fname= PyModule_GetFilename(value); + if(fname) { + if (clear_all || ((strstr(fname, SEPSTR))==0)) { /* no path ? */ + file_extension = strstr(fname, ".py"); + if(file_extension && (*(file_extension + 3) == '\0' || *(file_extension + 4) == '\0')) { /* .py or pyc extension? */ + /* now we can be fairly sure its a python import from the blendfile */ + PyList_Append(list, key); /* free'd with the list */ + } + } + } + else { + PyErr_Clear(); + } + } + + /* remove all our modules */ + for(pos=0; pos < PyList_Size(list); pos++) { + /* PyObject_Print(key, stderr, 0); */ + key= PyList_GET_ITEM(list, pos); + PyDict_DelItem(modules, key); + } + + Py_DECREF(list); /* removes all references from append */ +} +#endif diff --git a/source/blender/python/generic/bpy_internal_import.h b/source/blender/python/generic/bpy_internal_import.h new file mode 100644 index 00000000000..9c3ce572cc4 --- /dev/null +++ b/source/blender/python/generic/bpy_internal_import.h @@ -0,0 +1,49 @@ +/* + * $Id: bpy_internal_import.h 20434 2009-05-26 18:06:09Z campbellbarton $ + * ***** BEGIN GPL 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. + * + * 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): Willian P. Germano, Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** +*/ + +/* Note, the BGE needs to use this too, keep it minimal */ + +#ifndef EXPP_bpy_import_h +#define EXPP_bpy_import_h + +#include +#include "compile.h" /* for the PyCodeObject */ +#include "eval.h" /* for PyEval_EvalCode */ + +PyObject* bpy_text_import( char *name, int *found ); +PyObject* bpy_text_reimport( PyObject *module, int *found ); +/* void bpy_text_clear_modules( int clear_all );*/ /* Clear user modules */ +extern PyMethodDef bpy_import_meth[]; +extern PyMethodDef bpy_reload_meth[]; + +/* The game engine has its own Main struct, if this is set search this rather then G.main */ +struct Main *bpy_import_main_get(void); +void bpy_import_main_set(struct Main *maggie); + + +#endif /* EXPP_bpy_import_h */ diff --git a/source/blender/python/generic/euler.c b/source/blender/python/generic/euler.c new file mode 100644 index 00000000000..82131b10710 --- /dev/null +++ b/source/blender/python/generic/euler.c @@ -0,0 +1,558 @@ +/* + * $Id: euler.c 20248 2009-05-18 04:11:54Z campbellbarton $ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * + * Contributor(s): Joseph Gilbert + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "Mathutils.h" + +#include "BLI_arithb.h" +#include "BKE_utildefines.h" +#include "BLI_blenlib.h" + + +//-------------------------DOC STRINGS --------------------------- +char Euler_Zero_doc[] = "() - set all values in the euler to 0"; +char Euler_Unique_doc[] ="() - sets the euler rotation a unique shortest arc rotation - tests for gimbal lock"; +char Euler_ToMatrix_doc[] = "() - returns a rotation matrix representing the euler rotation"; +char Euler_ToQuat_doc[] = "() - returns a quaternion representing the euler rotation"; +char Euler_Rotate_doc[] = "() - rotate a euler by certain amount around an axis of rotation"; +char Euler_copy_doc[] = "() - returns a copy of the euler."; +char Euler_MakeCompatible_doc[] = "(euler) - Make this user compatible with another (no axis flipping)."; +//-----------------------METHOD DEFINITIONS ---------------------- +struct PyMethodDef Euler_methods[] = { + {"zero", (PyCFunction) Euler_Zero, METH_NOARGS, Euler_Zero_doc}, + {"unique", (PyCFunction) Euler_Unique, METH_NOARGS, Euler_Unique_doc}, + {"toMatrix", (PyCFunction) Euler_ToMatrix, METH_NOARGS, Euler_ToMatrix_doc}, + {"toQuat", (PyCFunction) Euler_ToQuat, METH_NOARGS, Euler_ToQuat_doc}, + {"rotate", (PyCFunction) Euler_Rotate, METH_VARARGS, Euler_Rotate_doc}, + {"makeCompatible", (PyCFunction) Euler_MakeCompatible, METH_O, Euler_MakeCompatible_doc}, + {"__copy__", (PyCFunction) Euler_copy, METH_VARARGS, Euler_copy_doc}, + {"copy", (PyCFunction) Euler_copy, METH_VARARGS, Euler_copy_doc}, + {NULL, NULL, 0, NULL} +}; +//-----------------------------METHODS---------------------------- +//----------------------------Euler.toQuat()---------------------- +//return a quaternion representation of the euler +PyObject *Euler_ToQuat(EulerObject * self) +{ + float eul[3], quat[4]; + int x; + + for(x = 0; x < 3; x++) { + eul[x] = self->eul[x] * ((float)Py_PI / 180); + } + EulToQuat(eul, quat); + return newQuaternionObject(quat, Py_NEW); +} +//----------------------------Euler.toMatrix()--------------------- +//return a matrix representation of the euler +PyObject *Euler_ToMatrix(EulerObject * self) +{ + float eul[3]; + float mat[9] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}; + int x; + + for(x = 0; x < 3; x++) { + eul[x] = self->eul[x] * ((float)Py_PI / 180); + } + EulToMat3(eul, (float (*)[3]) mat); + return newMatrixObject(mat, 3, 3 , Py_NEW); +} +//----------------------------Euler.unique()----------------------- +//sets the x,y,z values to a unique euler rotation +PyObject *Euler_Unique(EulerObject * self) +{ + double heading, pitch, bank; + double pi2 = Py_PI * 2.0f; + double piO2 = Py_PI / 2.0f; + double Opi2 = 1.0f / pi2; + + //radians + heading = self->eul[0] * (float)Py_PI / 180; + pitch = self->eul[1] * (float)Py_PI / 180; + bank = self->eul[2] * (float)Py_PI / 180; + + //wrap heading in +180 / -180 + pitch += Py_PI; + pitch -= floor(pitch * Opi2) * pi2; + pitch -= Py_PI; + + + if(pitch < -piO2) { + pitch = -Py_PI - pitch; + heading += Py_PI; + bank += Py_PI; + } else if(pitch > piO2) { + pitch = Py_PI - pitch; + heading += Py_PI; + bank += Py_PI; + } + //gimbal lock test + if(fabs(pitch) > piO2 - 1e-4) { + heading += bank; + bank = 0.0f; + } else { + bank += Py_PI; + bank -= (floor(bank * Opi2)) * pi2; + bank -= Py_PI; + } + + heading += Py_PI; + heading -= (floor(heading * Opi2)) * pi2; + heading -= Py_PI; + + //back to degrees + self->eul[0] = (float)(heading * 180 / (float)Py_PI); + self->eul[1] = (float)(pitch * 180 / (float)Py_PI); + self->eul[2] = (float)(bank * 180 / (float)Py_PI); + + Py_INCREF(self); + return (PyObject *)self; +} +//----------------------------Euler.zero()------------------------- +//sets the euler to 0,0,0 +PyObject *Euler_Zero(EulerObject * self) +{ + self->eul[0] = 0.0; + self->eul[1] = 0.0; + self->eul[2] = 0.0; + + Py_INCREF(self); + return (PyObject *)self; +} +//----------------------------Euler.rotate()----------------------- +//rotates a euler a certain amount and returns the result +//should return a unique euler rotation (i.e. no 720 degree pitches :) +PyObject *Euler_Rotate(EulerObject * self, PyObject *args) +{ + float angle = 0.0f; + char *axis; + int x; + + if(!PyArg_ParseTuple(args, "fs", &angle, &axis)){ + PyErr_SetString(PyExc_TypeError, "euler.rotate():expected angle (float) and axis (x,y,z)"); + return NULL; + } + if(!STREQ3(axis,"x","y","z")){ + PyErr_SetString(PyExc_TypeError, "euler.rotate(): expected axis to be 'x', 'y' or 'z'"); + return NULL; + } + + //covert to radians + angle *= ((float)Py_PI / 180); + for(x = 0; x < 3; x++) { + self->eul[x] *= ((float)Py_PI / 180); + } + euler_rot(self->eul, angle, *axis); + //convert back from radians + for(x = 0; x < 3; x++) { + self->eul[x] *= (180 / (float)Py_PI); + } + + Py_INCREF(self); + return (PyObject *)self; +} + +PyObject *Euler_MakeCompatible(EulerObject * self, EulerObject *value) +{ + float eul_from_rad[3]; + int x; + + if(!EulerObject_Check(value)) { + PyErr_SetString(PyExc_TypeError, "euler.makeCompatible(euler):expected a single euler argument."); + return NULL; + } + + //covert to radians + for(x = 0; x < 3; x++) { + self->eul[x] = self->eul[x] * ((float)Py_PI / 180); + eul_from_rad[x] = value->eul[x] * ((float)Py_PI / 180); + } + compatible_eul(self->eul, eul_from_rad); + //convert back from radians + for(x = 0; x < 3; x++) { + self->eul[x] *= (180 / (float)Py_PI); + } + + Py_INCREF(self); + return (PyObject *)self; +} + +//----------------------------Euler.rotate()----------------------- +// return a copy of the euler +PyObject *Euler_copy(EulerObject * self, PyObject *args) +{ + return newEulerObject(self->eul, Py_NEW); +} + + +//----------------------------dealloc()(internal) ------------------ +//free the py_object +static void Euler_dealloc(EulerObject * self) +{ + //only free py_data + if(self->data.py_data){ + PyMem_Free(self->data.py_data); + } + PyObject_DEL(self); +} + +//----------------------------print object (internal)-------------- +//print the object to screen +static PyObject *Euler_repr(EulerObject * self) +{ + char str[64]; + sprintf(str, "[%.6f, %.6f, %.6f](euler)", self->eul[0], self->eul[1], self->eul[2]); + return PyUnicode_FromString(str); +} +//------------------------tp_richcmpr +//returns -1 execption, 0 false, 1 true +static PyObject* Euler_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type) +{ + EulerObject *eulA = NULL, *eulB = NULL; + int result = 0; + + if (!EulerObject_Check(objectA) || !EulerObject_Check(objectB)){ + if (comparison_type == Py_NE){ + Py_RETURN_TRUE; + }else{ + Py_RETURN_FALSE; + } + } + eulA = (EulerObject*)objectA; + eulB = (EulerObject*)objectB; + + switch (comparison_type){ + case Py_EQ: + result = EXPP_VectorsAreEqual(eulA->eul, eulB->eul, 3, 1); + break; + case Py_NE: + result = EXPP_VectorsAreEqual(eulA->eul, eulB->eul, 3, 1); + if (result == 0){ + result = 1; + }else{ + result = 0; + } + break; + default: + printf("The result of the comparison could not be evaluated"); + break; + } + if (result == 1){ + Py_RETURN_TRUE; + }else{ + Py_RETURN_FALSE; + } +} +//------------------------tp_doc +static char EulerObject_doc[] = "This is a wrapper for euler objects."; +//---------------------SEQUENCE PROTOCOLS------------------------ +//----------------------------len(object)------------------------ +//sequence length +static int Euler_len(EulerObject * self) +{ + return 3; +} +//----------------------------object[]--------------------------- +//sequence accessor (get) +static PyObject *Euler_item(EulerObject * self, int i) +{ + if(i<0) + i= 3-i; + + if(i < 0 || i >= 3) { + PyErr_SetString(PyExc_IndexError, "euler[attribute]: array index out of range"); + return NULL; + } + return PyFloat_FromDouble(self->eul[i]); + +} +//----------------------------object[]------------------------- +//sequence accessor (set) +static int Euler_ass_item(EulerObject * self, int i, PyObject * value) +{ + float f = PyFloat_AsDouble(value); + + if(f == -1 && PyErr_Occurred()) { // parsed item not a number + PyErr_SetString(PyExc_TypeError, "euler[attribute] = x: argument not a number"); + return -1; + } + + if(i<0) + i= 3-i; + + if(i < 0 || i >= 3){ + PyErr_SetString(PyExc_IndexError, "euler[attribute] = x: array assignment index out of range\n"); + return -1; + } + + self->eul[i] = f; + return 0; +} +//----------------------------object[z:y]------------------------ +//sequence slice (get) +static PyObject *Euler_slice(EulerObject * self, int begin, int end) +{ + PyObject *list = NULL; + int count; + + CLAMP(begin, 0, 3); + if (end<0) end= 4+end; + CLAMP(end, 0, 3); + begin = MIN2(begin,end); + + list = PyList_New(end - begin); + for(count = begin; count < end; count++) { + PyList_SetItem(list, count - begin, + PyFloat_FromDouble(self->eul[count])); + } + + return list; +} +//----------------------------object[z:y]------------------------ +//sequence slice (set) +static int Euler_ass_slice(EulerObject * self, int begin, int end, + PyObject * seq) +{ + int i, y, size = 0; + float eul[3]; + PyObject *e, *f; + + CLAMP(begin, 0, 3); + if (end<0) end= 4+end; + CLAMP(end, 0, 3); + begin = MIN2(begin,end); + + size = PySequence_Length(seq); + if(size != (end - begin)){ + PyErr_SetString(PyExc_TypeError, "euler[begin:end] = []: size mismatch in slice assignment"); + return -1; + } + + for (i = 0; i < size; i++) { + e = PySequence_GetItem(seq, i); + if (e == NULL) { // Failed to read sequence + PyErr_SetString(PyExc_RuntimeError, "euler[begin:end] = []: unable to read sequence"); + return -1; + } + + f = PyNumber_Float(e); + if(f == NULL) { // parsed item not a number + Py_DECREF(e); + PyErr_SetString(PyExc_TypeError, "euler[begin:end] = []: sequence argument not a number"); + return -1; + } + + eul[i] = (float)PyFloat_AS_DOUBLE(f); + Py_DECREF(f); + Py_DECREF(e); + } + //parsed well - now set in vector + for(y = 0; y < 3; y++){ + self->eul[begin + y] = eul[y]; + } + return 0; +} +//-----------------PROTCOL DECLARATIONS-------------------------- +static PySequenceMethods Euler_SeqMethods = { + (inquiry) Euler_len, /* sq_length */ + (binaryfunc) 0, /* sq_concat */ + (ssizeargfunc) 0, /* sq_repeat */ + (ssizeargfunc) Euler_item, /* sq_item */ + (ssizessizeargfunc) Euler_slice, /* sq_slice */ + (ssizeobjargproc) Euler_ass_item, /* sq_ass_item */ + (ssizessizeobjargproc) Euler_ass_slice, /* sq_ass_slice */ +}; + + + +/* + * vector axis, vector.x/y/z/w + */ + +static PyObject *Euler_getAxis( EulerObject * self, void *type ) +{ + switch( (long)type ) { + case 'X': /* these are backwards, but that how it works */ + return PyFloat_FromDouble(self->eul[0]); + case 'Y': + return PyFloat_FromDouble(self->eul[1]); + case 'Z': + return PyFloat_FromDouble(self->eul[2]); + } + + PyErr_SetString(PyExc_SystemError, "corrupt euler, cannot get axis"); + return NULL; +} + +static int Euler_setAxis( EulerObject * self, PyObject * value, void * type ) +{ + float param= (float)PyFloat_AsDouble( value ); + + if (param==-1 && PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "expected a number for the vector axis"); + return -1; + } + + switch( (long)type ) { + case 'X': /* these are backwards, but that how it works */ + self->eul[0]= param; + break; + case 'Y': + self->eul[1]= param; + break; + case 'Z': + self->eul[2]= param; + break; + } + + return 0; +} + +static PyObject *Euler_getWrapped( VectorObject * self, void *type ) +{ + if (self->wrapped == Py_WRAP) + Py_RETURN_TRUE; + else + Py_RETURN_FALSE; +} + + +/*****************************************************************************/ +/* Python attributes get/set structure: */ +/*****************************************************************************/ +static PyGetSetDef Euler_getseters[] = { + {"x", + (getter)Euler_getAxis, (setter)Euler_setAxis, + "Euler X axis", + (void *)'X'}, + {"y", + (getter)Euler_getAxis, (setter)Euler_setAxis, + "Euler Y axis", + (void *)'Y'}, + {"z", + (getter)Euler_getAxis, (setter)Euler_setAxis, + "Euler Z axis", + (void *)'Z'}, + {"wrapped", + (getter)Euler_getWrapped, (setter)NULL, + "True when this wraps blenders internal data", + NULL}, + {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ +}; + +//------------------PY_OBECT DEFINITION-------------------------- +PyTypeObject euler_Type = { +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif + "euler", //tp_name + sizeof(EulerObject), //tp_basicsize + 0, //tp_itemsize + (destructor)Euler_dealloc, //tp_dealloc + 0, //tp_print + 0, //tp_getattr + 0, //tp_setattr + 0, //tp_compare + (reprfunc) Euler_repr, //tp_repr + 0, //tp_as_number + &Euler_SeqMethods, //tp_as_sequence + 0, //tp_as_mapping + 0, //tp_hash + 0, //tp_call + 0, //tp_str + 0, //tp_getattro + 0, //tp_setattro + 0, //tp_as_buffer + Py_TPFLAGS_DEFAULT, //tp_flags + EulerObject_doc, //tp_doc + 0, //tp_traverse + 0, //tp_clear + (richcmpfunc)Euler_richcmpr, //tp_richcompare + 0, //tp_weaklistoffset + 0, //tp_iter + 0, //tp_iternext + Euler_methods, //tp_methods + 0, //tp_members + Euler_getseters, //tp_getset + 0, //tp_base + 0, //tp_dict + 0, //tp_descr_get + 0, //tp_descr_set + 0, //tp_dictoffset + 0, //tp_init + 0, //tp_alloc + 0, //tp_new + 0, //tp_free + 0, //tp_is_gc + 0, //tp_bases + 0, //tp_mro + 0, //tp_cache + 0, //tp_subclasses + 0, //tp_weaklist + 0 //tp_del +}; +//------------------------newEulerObject (internal)------------- +//creates a new euler object +/*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER + (i.e. it was allocated elsewhere by MEM_mallocN()) + pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON + (i.e. it must be created here with PyMEM_malloc())*/ +PyObject *newEulerObject(float *eul, int type) +{ + EulerObject *self; + int x; + + self = PyObject_NEW(EulerObject, &euler_Type); + self->data.blend_data = NULL; + self->data.py_data = NULL; + + if(type == Py_WRAP){ + self->data.blend_data = eul; + self->eul = self->data.blend_data; + self->wrapped = Py_WRAP; + }else if (type == Py_NEW){ + self->data.py_data = PyMem_Malloc(3 * sizeof(float)); + self->eul = self->data.py_data; + if(!eul) { //new empty + for(x = 0; x < 3; x++) { + self->eul[x] = 0.0f; + } + }else{ + for(x = 0; x < 3; x++){ + self->eul[x] = eul[x]; + } + } + self->wrapped = Py_NEW; + }else{ //bad type + return NULL; + } + return (PyObject *)self; +} diff --git a/source/blender/python/generic/euler.h b/source/blender/python/generic/euler.h new file mode 100644 index 00000000000..f94f060a61d --- /dev/null +++ b/source/blender/python/generic/euler.h @@ -0,0 +1,65 @@ +/* + * $Id: euler.h 20248 2009-05-18 04:11:54Z campbellbarton $ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): Joseph Gilbert + * + * ***** END GPL LICENSE BLOCK ***** + * + */ + +#ifndef EXPP_euler_h +#define EXPP_euler_h + +#include + +extern PyTypeObject euler_Type; + +#define EulerObject_Check(v) (Py_TYPE(v) == &euler_Type) + +typedef struct { + PyObject_VAR_HEAD + struct{ + float *py_data; //python managed + float *blend_data; //blender managed + }data; + float *eul; //1D array of data (alias) + int wrapped; //is wrapped data? +} EulerObject; + +/*struct data contains a pointer to the actual data that the +object uses. It can use either PyMem allocated data (which will +be stored in py_data) or be a wrapper for data allocated through +blender (stored in blend_data). This is an either/or struct not both*/ + +//prototypes +PyObject *Euler_Zero( EulerObject * self ); +PyObject *Euler_Unique( EulerObject * self ); +PyObject *Euler_ToMatrix( EulerObject * self ); +PyObject *Euler_ToQuat( EulerObject * self ); +PyObject *Euler_Rotate( EulerObject * self, PyObject *args ); +PyObject *Euler_MakeCompatible( EulerObject * self, EulerObject *value ); +PyObject *Euler_copy( EulerObject * self, PyObject *args ); +PyObject *newEulerObject( float *eul, int type ); + +#endif /* EXPP_euler_h */ diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c new file mode 100644 index 00000000000..16c72d69dde --- /dev/null +++ b/source/blender/python/generic/matrix.c @@ -0,0 +1,1002 @@ +/* + * $Id: matrix.c 20249 2009-05-18 04:27:48Z campbellbarton $ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * Contributor(s): Michel Selten & Joseph Gilbert + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "Mathutils.h" + +#include "BKE_utildefines.h" +#include "BLI_arithb.h" +#include "BLI_blenlib.h" + +/*-------------------------DOC STRINGS ---------------------------*/ +char Matrix_Zero_doc[] = "() - set all values in the matrix to 0"; +char Matrix_Identity_doc[] = "() - set the square matrix to it's identity matrix"; +char Matrix_Transpose_doc[] = "() - set the matrix to it's transpose"; +char Matrix_Determinant_doc[] = "() - return the determinant of the matrix"; +char Matrix_Invert_doc[] = "() - set the matrix to it's inverse if an inverse is possible"; +char Matrix_TranslationPart_doc[] = "() - return a vector encompassing the translation of the matrix"; +char Matrix_RotationPart_doc[] = "() - return a vector encompassing the rotation of the matrix"; +char Matrix_scalePart_doc[] = "() - convert matrix to a 3D vector"; +char Matrix_Resize4x4_doc[] = "() - resize the matrix to a 4x4 square matrix"; +char Matrix_toEuler_doc[] = "(eul_compat) - convert matrix to a euler angle rotation, optional euler argument that the new euler will be made compatible with."; +char Matrix_toQuat_doc[] = "() - convert matrix to a quaternion rotation"; +char Matrix_copy_doc[] = "() - return a copy of the matrix"; +/*-----------------------METHOD DEFINITIONS ----------------------*/ +struct PyMethodDef Matrix_methods[] = { + {"zero", (PyCFunction) Matrix_Zero, METH_NOARGS, Matrix_Zero_doc}, + {"identity", (PyCFunction) Matrix_Identity, METH_NOARGS, Matrix_Identity_doc}, + {"transpose", (PyCFunction) Matrix_Transpose, METH_NOARGS, Matrix_Transpose_doc}, + {"determinant", (PyCFunction) Matrix_Determinant, METH_NOARGS, Matrix_Determinant_doc}, + {"invert", (PyCFunction) Matrix_Invert, METH_NOARGS, Matrix_Invert_doc}, + {"translationPart", (PyCFunction) Matrix_TranslationPart, METH_NOARGS, Matrix_TranslationPart_doc}, + {"rotationPart", (PyCFunction) Matrix_RotationPart, METH_NOARGS, Matrix_RotationPart_doc}, + {"scalePart", (PyCFunction) Matrix_scalePart, METH_NOARGS, Matrix_scalePart_doc}, + {"resize4x4", (PyCFunction) Matrix_Resize4x4, METH_NOARGS, Matrix_Resize4x4_doc}, + {"toEuler", (PyCFunction) Matrix_toEuler, METH_VARARGS, Matrix_toEuler_doc}, + {"toQuat", (PyCFunction) Matrix_toQuat, METH_NOARGS, Matrix_toQuat_doc}, + {"copy", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc}, + {"__copy__", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc}, + {NULL, NULL, 0, NULL} +}; +/*-----------------------------METHODS----------------------------*/ +/*---------------------------Matrix.toQuat() ---------------------*/ +PyObject *Matrix_toQuat(MatrixObject * self) +{ + float quat[4]; + + /*must be 3-4 cols, 3-4 rows, square matrix*/ + if(self->colSize < 3 || self->rowSize < 3 || (self->colSize != self->rowSize)) { + PyErr_SetString(PyExc_AttributeError, "Matrix.toQuat(): inappropriate matrix size - expects 3x3 or 4x4 matrix"); + return NULL; + } + if(self->colSize == 3){ + Mat3ToQuat((float (*)[3])*self->matrix, quat); + }else{ + Mat4ToQuat((float (*)[4])*self->matrix, quat); + } + + return newQuaternionObject(quat, Py_NEW); +} +/*---------------------------Matrix.toEuler() --------------------*/ +PyObject *Matrix_toEuler(MatrixObject * self, PyObject *args) +{ + float eul[3], eul_compatf[3]; + EulerObject *eul_compat = NULL; + int x; + + if(!PyArg_ParseTuple(args, "|O!:toEuler", &euler_Type, &eul_compat)) + return NULL; + + if(eul_compat) { + for(x = 0; x < 3; x++) { + eul_compatf[x] = eul_compat->eul[x] * ((float)Py_PI / 180); + } + } + + /*must be 3-4 cols, 3-4 rows, square matrix*/ + if(self->colSize ==3 && self->rowSize ==3) { + if(eul_compat) Mat3ToCompatibleEul((float (*)[3])*self->matrix, eul, eul_compatf); + else Mat3ToEul((float (*)[3])*self->matrix, eul); + }else if (self->colSize ==4 && self->rowSize ==4) { + float tempmat3[3][3]; + Mat3CpyMat4(tempmat3, (float (*)[4])*self->matrix); + Mat3ToEul(tempmat3, eul); + if(eul_compat) Mat3ToCompatibleEul(tempmat3, eul, eul_compatf); + else Mat3ToEul(tempmat3, eul); + + }else { + PyErr_SetString(PyExc_AttributeError, "Matrix.toEuler(): inappropriate matrix size - expects 3x3 or 4x4 matrix\n"); + return NULL; + } + /*have to convert to degrees*/ + for(x = 0; x < 3; x++) { + eul[x] *= (float) (180 / Py_PI); + } + return newEulerObject(eul, Py_NEW); +} +/*---------------------------Matrix.resize4x4() ------------------*/ +PyObject *Matrix_Resize4x4(MatrixObject * self) +{ + int x, first_row_elem, curr_pos, new_pos, blank_columns, blank_rows, index; + + if(self->data.blend_data){ + PyErr_SetString(PyExc_TypeError, "cannot resize wrapped data - only python matrices"); + return NULL; + } + + self->data.py_data = PyMem_Realloc(self->data.py_data, (sizeof(float) * 16)); + if(self->data.py_data == NULL) { + PyErr_SetString(PyExc_MemoryError, "matrix.resize4x4(): problem allocating pointer space"); + return NULL; + } + self->contigPtr = self->data.py_data; /*force*/ + self->matrix = PyMem_Realloc(self->matrix, (sizeof(float *) * 4)); + if(self->matrix == NULL) { + PyErr_SetString(PyExc_MemoryError, "matrix.resize4x4(): problem allocating pointer space"); + return NULL; + } + /*set row pointers*/ + for(x = 0; x < 4; x++) { + self->matrix[x] = self->contigPtr + (x * 4); + } + /*move data to new spot in array + clean*/ + for(blank_rows = (4 - self->rowSize); blank_rows > 0; blank_rows--){ + for(x = 0; x < 4; x++){ + index = (4 * (self->rowSize + (blank_rows - 1))) + x; + if (index == 10 || index == 15){ + self->contigPtr[index] = 1.0f; + }else{ + self->contigPtr[index] = 0.0f; + } + } + } + for(x = 1; x <= self->rowSize; x++){ + first_row_elem = (self->colSize * (self->rowSize - x)); + curr_pos = (first_row_elem + (self->colSize -1)); + new_pos = (4 * (self->rowSize - x )) + (curr_pos - first_row_elem); + for(blank_columns = (4 - self->colSize); blank_columns > 0; blank_columns--){ + self->contigPtr[new_pos + blank_columns] = 0.0f; + } + for(curr_pos = curr_pos; curr_pos >= first_row_elem; curr_pos--){ + self->contigPtr[new_pos] = self->contigPtr[curr_pos]; + new_pos--; + } + } + self->rowSize = 4; + self->colSize = 4; + + Py_INCREF(self); + return (PyObject *)self; +} +/*---------------------------Matrix.translationPart() ------------*/ +PyObject *Matrix_TranslationPart(MatrixObject * self) +{ + float vec[4]; + + if(self->colSize < 3 || self->rowSize < 4){ + PyErr_SetString(PyExc_AttributeError, "Matrix.translationPart: inappropriate matrix size"); + return NULL; + } + + vec[0] = self->matrix[3][0]; + vec[1] = self->matrix[3][1]; + vec[2] = self->matrix[3][2]; + + return newVectorObject(vec, 3, Py_NEW); +} +/*---------------------------Matrix.rotationPart() ---------------*/ +PyObject *Matrix_RotationPart(MatrixObject * self) +{ + float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + + if(self->colSize < 3 || self->rowSize < 3){ + PyErr_SetString(PyExc_AttributeError, "Matrix.rotationPart: inappropriate matrix size\n"); + return NULL; + } + + mat[0] = self->matrix[0][0]; + mat[1] = self->matrix[0][1]; + mat[2] = self->matrix[0][2]; + mat[3] = self->matrix[1][0]; + mat[4] = self->matrix[1][1]; + mat[5] = self->matrix[1][2]; + mat[6] = self->matrix[2][0]; + mat[7] = self->matrix[2][1]; + mat[8] = self->matrix[2][2]; + + return newMatrixObject(mat, 3, 3, Py_NEW); +} +/*---------------------------Matrix.scalePart() --------------------*/ +PyObject *Matrix_scalePart(MatrixObject * self) +{ + float scale[3], rot[3]; + float mat[3][3], imat[3][3], tmat[3][3]; + + /*must be 3-4 cols, 3-4 rows, square matrix*/ + if(self->colSize == 4 && self->rowSize == 4) + Mat3CpyMat4(mat, (float (*)[4])*self->matrix); + else if(self->colSize == 3 && self->rowSize == 3) + Mat3CpyMat3(mat, (float (*)[3])*self->matrix); + else { + PyErr_SetString(PyExc_AttributeError, "Matrix.scalePart(): inappropriate matrix size - expects 3x3 or 4x4 matrix\n"); + return NULL; + } + /* functionality copied from editobject.c apply_obmat */ + Mat3ToEul(mat, rot); + EulToMat3(rot, tmat); + Mat3Inv(imat, tmat); + Mat3MulMat3(tmat, imat, mat); + + scale[0]= tmat[0][0]; + scale[1]= tmat[1][1]; + scale[2]= tmat[2][2]; + return newVectorObject(scale, 3, Py_NEW); +} +/*---------------------------Matrix.invert() ---------------------*/ +PyObject *Matrix_Invert(MatrixObject * self) +{ + + int x, y, z = 0; + float det = 0.0f; + PyObject *f = NULL; + float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + + if(self->rowSize != self->colSize){ + PyErr_SetString(PyExc_AttributeError, "Matrix.invert(ed): only square matrices are supported"); + return NULL; + } + + /*calculate the determinant*/ + f = Matrix_Determinant(self); + det = (float)PyFloat_AS_DOUBLE(f); /*Increfs, so we need to decref*/ + Py_DECREF(f); + + if(det != 0) { + /*calculate the classical adjoint*/ + if(self->rowSize == 2) { + mat[0] = self->matrix[1][1]; + mat[1] = -self->matrix[0][1]; + mat[2] = -self->matrix[1][0]; + mat[3] = self->matrix[0][0]; + } else if(self->rowSize == 3) { + Mat3Adj((float (*)[3]) mat,(float (*)[3]) *self->matrix); + } else if(self->rowSize == 4) { + Mat4Adj((float (*)[4]) mat, (float (*)[4]) *self->matrix); + } + /*divide by determinate*/ + for(x = 0; x < (self->rowSize * self->colSize); x++) { + mat[x] /= det; + } + /*set values*/ + for(x = 0; x < self->rowSize; x++) { + for(y = 0; y < self->colSize; y++) { + self->matrix[x][y] = mat[z]; + z++; + } + } + /*transpose + Matrix_Transpose(self);*/ + } else { + PyErr_SetString(PyExc_ValueError, "matrix does not have an inverse"); + return NULL; + } + + Py_INCREF(self); + return (PyObject *)self; +} + + +/*---------------------------Matrix.determinant() ----------------*/ +PyObject *Matrix_Determinant(MatrixObject * self) +{ + float det = 0.0f; + + if(self->rowSize != self->colSize){ + PyErr_SetString(PyExc_AttributeError, "Matrix.determinant: only square matrices are supported"); + return NULL; + } + + if(self->rowSize == 2) { + det = Det2x2(self->matrix[0][0], self->matrix[0][1], + self->matrix[1][0], self->matrix[1][1]); + } else if(self->rowSize == 3) { + det = Det3x3(self->matrix[0][0], self->matrix[0][1], + self->matrix[0][2], self->matrix[1][0], + self->matrix[1][1], self->matrix[1][2], + self->matrix[2][0], self->matrix[2][1], + self->matrix[2][2]); + } else { + det = Det4x4((float (*)[4]) *self->matrix); + } + + return PyFloat_FromDouble( (double) det ); +} +/*---------------------------Matrix.transpose() ------------------*/ +PyObject *Matrix_Transpose(MatrixObject * self) +{ + float t = 0.0f; + + if(self->rowSize != self->colSize){ + PyErr_SetString(PyExc_AttributeError, "Matrix.transpose(d): only square matrices are supported"); + return NULL; + } + + if(self->rowSize == 2) { + t = self->matrix[1][0]; + self->matrix[1][0] = self->matrix[0][1]; + self->matrix[0][1] = t; + } else if(self->rowSize == 3) { + Mat3Transp((float (*)[3])*self->matrix); + } else { + Mat4Transp((float (*)[4])*self->matrix); + } + + Py_INCREF(self); + return (PyObject *)self; +} + + +/*---------------------------Matrix.zero() -----------------------*/ +PyObject *Matrix_Zero(MatrixObject * self) +{ + int row, col; + + for(row = 0; row < self->rowSize; row++) { + for(col = 0; col < self->colSize; col++) { + self->matrix[row][col] = 0.0f; + } + } + Py_INCREF(self); + return (PyObject *)self; +} +/*---------------------------Matrix.identity(() ------------------*/ +PyObject *Matrix_Identity(MatrixObject * self) +{ + if(self->rowSize != self->colSize){ + PyErr_SetString(PyExc_AttributeError, "Matrix.identity: only square matrices are supported\n"); + return NULL; + } + + if(self->rowSize == 2) { + self->matrix[0][0] = 1.0f; + self->matrix[0][1] = 0.0f; + self->matrix[1][0] = 0.0f; + self->matrix[1][1] = 1.0f; + } else if(self->rowSize == 3) { + Mat3One((float (*)[3]) *self->matrix); + } else { + Mat4One((float (*)[4]) *self->matrix); + } + + Py_INCREF(self); + return (PyObject *)self; +} + +/*---------------------------Matrix.inverted() ------------------*/ +PyObject *Matrix_copy(MatrixObject * self) +{ + return (PyObject*)(MatrixObject*)newMatrixObject((float (*))*self->matrix, self->rowSize, self->colSize, Py_NEW); +} + +/*----------------------------dealloc()(internal) ----------------*/ +/*free the py_object*/ +static void Matrix_dealloc(MatrixObject * self) +{ + Py_XDECREF(self->coerced_object); + PyMem_Free(self->matrix); + /*only free py_data*/ + if(self->data.py_data){ + PyMem_Free(self->data.py_data); + } + PyObject_DEL(self); +} +/*----------------------------getattr()(internal) ----------------*/ +/*object.attribute access (get)*/ +static PyObject *Matrix_getattr(MatrixObject * self, char *name) +{ + if(STREQ(name, "rowSize")) { + return PyLong_FromLong((long) self->rowSize); + } else if(STREQ(name, "colSize")) { + return PyLong_FromLong((long) self->colSize); + } + if(STREQ(name, "wrapped")){ + if(self->wrapped == Py_WRAP) + Py_RETURN_TRUE; + else + Py_RETURN_FALSE; + } +#if 0 //XXX + return Py_FindMethod(Matrix_methods, (PyObject *) self, name); +#else + PyErr_SetString(PyExc_AttributeError, "blender 2.5 is not finished yet"); + return NULL; +#endif +} +/*----------------------------setattr()(internal) ----------------*/ +/*object.attribute access (set)*/ +static int Matrix_setattr(MatrixObject * self, char *name, PyObject * v) +{ + /* This is not supported. */ + return (-1); +} +/*----------------------------print object (internal)-------------*/ +/*print the object to screen*/ +static PyObject *Matrix_repr(MatrixObject * self) +{ + int x, y; + char buffer[48], str[1024]; + + BLI_strncpy(str,"",1024); + for(x = 0; x < self->rowSize; x++){ + sprintf(buffer, "["); + strcat(str,buffer); + for(y = 0; y < (self->colSize - 1); y++) { + sprintf(buffer, "%.6f, ", self->matrix[x][y]); + strcat(str,buffer); + } + if(x < (self->rowSize-1)){ + sprintf(buffer, "%.6f](matrix [row %d])\n", self->matrix[x][y], x); + strcat(str,buffer); + }else{ + sprintf(buffer, "%.6f](matrix [row %d])", self->matrix[x][y], x); + strcat(str,buffer); + } + } + + return PyUnicode_FromString(str); +} +/*------------------------tp_richcmpr*/ +/*returns -1 execption, 0 false, 1 true*/ +static PyObject* Matrix_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type) +{ + MatrixObject *matA = NULL, *matB = NULL; + int result = 0; + + if (!MatrixObject_Check(objectA) || !MatrixObject_Check(objectB)){ + if (comparison_type == Py_NE){ + Py_RETURN_TRUE; + }else{ + Py_RETURN_FALSE; + } + } + matA = (MatrixObject*)objectA; + matB = (MatrixObject*)objectB; + + if (matA->colSize != matB->colSize || matA->rowSize != matB->rowSize){ + if (comparison_type == Py_NE){ + Py_RETURN_TRUE; + }else{ + Py_RETURN_FALSE; + } + } + + switch (comparison_type){ + case Py_EQ: + /*contigPtr is basically a really long vector*/ + result = EXPP_VectorsAreEqual(matA->contigPtr, matB->contigPtr, + (matA->rowSize * matA->colSize), 1); + break; + case Py_NE: + result = EXPP_VectorsAreEqual(matA->contigPtr, matB->contigPtr, + (matA->rowSize * matA->colSize), 1); + if (result == 0){ + result = 1; + }else{ + result = 0; + } + break; + default: + printf("The result of the comparison could not be evaluated"); + break; + } + if (result == 1){ + Py_RETURN_TRUE; + }else{ + Py_RETURN_FALSE; + } +} +/*------------------------tp_doc*/ +static char MatrixObject_doc[] = "This is a wrapper for matrix objects."; +/*---------------------SEQUENCE PROTOCOLS------------------------ + ----------------------------len(object)------------------------ + sequence length*/ +static int Matrix_len(MatrixObject * self) +{ + return (self->rowSize); +} +/*----------------------------object[]--------------------------- + sequence accessor (get) + the wrapped vector gives direct access to the matrix data*/ +static PyObject *Matrix_item(MatrixObject * self, int i) +{ + if(i < 0 || i >= self->rowSize) { + PyErr_SetString(PyExc_IndexError, "matrix[attribute]: array index out of range"); + return NULL; + } + return newVectorObject(self->matrix[i], self->colSize, Py_WRAP); +} +/*----------------------------object[]------------------------- + sequence accessor (set)*/ +static int Matrix_ass_item(MatrixObject * self, int i, PyObject * ob) +{ + int y, x, size = 0; + float vec[4]; + PyObject *m, *f; + + if(i >= self->rowSize || i < 0){ + PyErr_SetString(PyExc_TypeError, "matrix[attribute] = x: bad row\n"); + return -1; + } + + if(PySequence_Check(ob)){ + size = PySequence_Length(ob); + if(size != self->colSize){ + PyErr_SetString(PyExc_TypeError, "matrix[attribute] = x: bad sequence size\n"); + return -1; + } + for (x = 0; x < size; x++) { + m = PySequence_GetItem(ob, x); + if (m == NULL) { /*Failed to read sequence*/ + PyErr_SetString(PyExc_RuntimeError, "matrix[attribute] = x: unable to read sequence\n"); + return -1; + } + + f = PyNumber_Float(m); + if(f == NULL) { /*parsed item not a number*/ + Py_DECREF(m); + PyErr_SetString(PyExc_TypeError, "matrix[attribute] = x: sequence argument not a number\n"); + return -1; + } + + vec[x] = (float)PyFloat_AS_DOUBLE(f); + Py_DECREF(m); + Py_DECREF(f); + } + /*parsed well - now set in matrix*/ + for(y = 0; y < size; y++){ + self->matrix[i][y] = vec[y]; + } + return 0; + }else{ + PyErr_SetString(PyExc_TypeError, "matrix[attribute] = x: expects a sequence of column size\n"); + return -1; + } +} +/*----------------------------object[z:y]------------------------ + sequence slice (get)*/ +static PyObject *Matrix_slice(MatrixObject * self, int begin, int end) +{ + + PyObject *list = NULL; + int count; + + CLAMP(begin, 0, self->rowSize); + CLAMP(end, 0, self->rowSize); + begin = MIN2(begin,end); + + list = PyList_New(end - begin); + for(count = begin; count < end; count++) { + PyList_SetItem(list, count - begin, + newVectorObject(self->matrix[count], self->colSize, Py_WRAP)); + } + + return list; +} +/*----------------------------object[z:y]------------------------ + sequence slice (set)*/ +static int Matrix_ass_slice(MatrixObject * self, int begin, int end, + PyObject * seq) +{ + int i, x, y, size, sub_size = 0; + float mat[16], f; + PyObject *subseq; + PyObject *m; + + CLAMP(begin, 0, self->rowSize); + CLAMP(end, 0, self->rowSize); + begin = MIN2(begin,end); + + if(PySequence_Check(seq)){ + size = PySequence_Length(seq); + if(size != (end - begin)){ + PyErr_SetString(PyExc_TypeError, "matrix[begin:end] = []: size mismatch in slice assignment\n"); + return -1; + } + /*parse sub items*/ + for (i = 0; i < size; i++) { + /*parse each sub sequence*/ + subseq = PySequence_GetItem(seq, i); + if (subseq == NULL) { /*Failed to read sequence*/ + PyErr_SetString(PyExc_RuntimeError, "matrix[begin:end] = []: unable to read sequence"); + return -1; + } + + if(PySequence_Check(subseq)){ + /*subsequence is also a sequence*/ + sub_size = PySequence_Length(subseq); + if(sub_size != self->colSize){ + Py_DECREF(subseq); + PyErr_SetString(PyExc_TypeError, "matrix[begin:end] = []: size mismatch in slice assignment\n"); + return -1; + } + for (y = 0; y < sub_size; y++) { + m = PySequence_GetItem(subseq, y); + if (m == NULL) { /*Failed to read sequence*/ + Py_DECREF(subseq); + PyErr_SetString(PyExc_RuntimeError, "matrix[begin:end] = []: unable to read sequence\n"); + return -1; + } + + f = PyFloat_AsDouble(m); /* faster to assume a float and raise an error after */ + if(f == -1 && PyErr_Occurred()) { /*parsed item not a number*/ + Py_DECREF(m); + Py_DECREF(subseq); + PyErr_SetString(PyExc_TypeError, "matrix[begin:end] = []: sequence argument not a number\n"); + return -1; + } + + mat[(i * self->colSize) + y] = f; + Py_DECREF(m); + } + }else{ + Py_DECREF(subseq); + PyErr_SetString(PyExc_TypeError, "matrix[begin:end] = []: illegal argument type for built-in operation\n"); + return -1; + } + Py_DECREF(subseq); + } + /*parsed well - now set in matrix*/ + for(x = 0; x < (size * sub_size); x++){ + self->matrix[begin + (int)floor(x / self->colSize)][x % self->colSize] = mat[x]; + } + return 0; + }else{ + PyErr_SetString(PyExc_TypeError, "matrix[begin:end] = []: illegal argument type for built-in operation\n"); + return -1; + } +} +/*------------------------NUMERIC PROTOCOLS---------------------- + ------------------------obj + obj------------------------------*/ +static PyObject *Matrix_add(PyObject * m1, PyObject * m2) +{ + int x, y; + float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + MatrixObject *mat1 = NULL, *mat2 = NULL; + + mat1 = (MatrixObject*)m1; + mat2 = (MatrixObject*)m2; + + if(mat1->coerced_object || mat2->coerced_object){ + PyErr_SetString(PyExc_AttributeError, "Matrix addition: arguments not valid for this operation...."); + return NULL; + } + if(mat1->rowSize != mat2->rowSize || mat1->colSize != mat2->colSize){ + PyErr_SetString(PyExc_AttributeError, "Matrix addition: matrices must have the same dimensions for this operation"); + return NULL; + } + + for(x = 0; x < mat1->rowSize; x++) { + for(y = 0; y < mat1->colSize; y++) { + mat[((x * mat1->colSize) + y)] = mat1->matrix[x][y] + mat2->matrix[x][y]; + } + } + + return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW); +} +/*------------------------obj - obj------------------------------ + subtraction*/ +static PyObject *Matrix_sub(PyObject * m1, PyObject * m2) +{ + int x, y; + float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + MatrixObject *mat1 = NULL, *mat2 = NULL; + + mat1 = (MatrixObject*)m1; + mat2 = (MatrixObject*)m2; + + if(mat1->coerced_object || mat2->coerced_object){ + PyErr_SetString(PyExc_AttributeError, "Matrix addition: arguments not valid for this operation...."); + return NULL; + } + if(mat1->rowSize != mat2->rowSize || mat1->colSize != mat2->colSize){ + PyErr_SetString(PyExc_AttributeError, "Matrix addition: matrices must have the same dimensions for this operation"); + return NULL; + } + + for(x = 0; x < mat1->rowSize; x++) { + for(y = 0; y < mat1->colSize; y++) { + mat[((x * mat1->colSize) + y)] = mat1->matrix[x][y] - mat2->matrix[x][y]; + } + } + + return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW); +} +/*------------------------obj * obj------------------------------ + mulplication*/ +static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) +{ + int x, y, z; + float scalar; + float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + double dot = 0.0f; + MatrixObject *mat1 = NULL, *mat2 = NULL; + PyObject *f = NULL; + + mat1 = (MatrixObject*)m1; + mat2 = (MatrixObject*)m2; + + if(mat1->coerced_object){ + if (PyFloat_Check(mat1->coerced_object) || + PyLong_Check(mat1->coerced_object)){ /*FLOAT/INT * MATRIX*/ + f = PyNumber_Float(mat1->coerced_object); + if(f == NULL) { /*parsed item not a number*/ + PyErr_SetString(PyExc_TypeError, "Matrix multiplication: arguments not acceptable for this operation"); + return NULL; + } + + scalar = (float)PyFloat_AS_DOUBLE(f); + Py_DECREF(f); + for(x = 0; x < mat2->rowSize; x++) { + for(y = 0; y < mat2->colSize; y++) { + mat[((x * mat2->colSize) + y)] = scalar * mat2->matrix[x][y]; + } + } + return newMatrixObject(mat, mat2->rowSize, mat2->colSize, Py_NEW); + } + }else{ + if(mat2->coerced_object){ + /* MATRIX * VECTOR operation is now being done by vector */ + /*if(VectorObject_Check(mat2->coerced_object)){ + vec = (VectorObject*)mat2->coerced_object; + return column_vector_multiplication(mat1, vec); + }else */ + if (PyFloat_Check(mat2->coerced_object) || PyLong_Check(mat2->coerced_object)){ /*MATRIX * FLOAT/INT*/ + f = PyNumber_Float(mat2->coerced_object); + if(f == NULL) { /*parsed item not a number*/ + PyErr_SetString(PyExc_TypeError, "Matrix multiplication: arguments not acceptable for this operation\n"); + return NULL; + } + + scalar = (float)PyFloat_AS_DOUBLE(f); + Py_DECREF(f); + for(x = 0; x < mat1->rowSize; x++) { + for(y = 0; y < mat1->colSize; y++) { + mat[((x * mat1->colSize) + y)] = scalar * mat1->matrix[x][y]; + } + } + return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW); + } + }else{ /*MATRIX * MATRIX*/ + if(mat1->colSize != mat2->rowSize){ + PyErr_SetString(PyExc_AttributeError,"Matrix multiplication: matrix A rowsize must equal matrix B colsize"); + return NULL; + } + for(x = 0; x < mat1->rowSize; x++) { + for(y = 0; y < mat2->colSize; y++) { + for(z = 0; z < mat1->colSize; z++) { + dot += (mat1->matrix[x][z] * mat2->matrix[z][y]); + } + mat[((x * mat1->rowSize) + y)] = (float)dot; + dot = 0.0f; + } + } + return newMatrixObject(mat, mat1->rowSize, mat2->colSize, Py_NEW); + } + } + + PyErr_SetString(PyExc_TypeError, "Matrix multiplication: arguments not acceptable for this operation\n"); + return NULL; +} +static PyObject* Matrix_inv(MatrixObject *self) +{ + return Matrix_Invert(self); +} +/*------------------------coerce(obj, obj)----------------------- + coercion of unknown types to type MatrixObject for numeric protocols. + + Coercion() is called whenever a math operation has 2 operands that + it doesn't understand how to evaluate. 2+Matrix for example. We want to + evaluate some of these operations like: (vector * 2), however, for math + to proceed, the unknown operand must be cast to a type that python math will + understand. (e.g. in the case above case, 2 must be cast to a vector and + then call vector.multiply(vector, scalar_cast_as_vector)*/ +static int Matrix_coerce(PyObject ** m1, PyObject ** m2) +{ + if(VectorObject_Check(*m2) || PyFloat_Check(*m2) || PyLong_Check(*m2)) { + PyObject *coerced = (PyObject *)(*m2); + Py_INCREF(coerced); + *m2 = newMatrixObject(NULL,3,3,Py_NEW); + ((MatrixObject*)*m2)->coerced_object = coerced; + Py_INCREF (*m1); + return 0; + } + + PyErr_SetString(PyExc_TypeError, "matrix.coerce(): unknown operand - can't coerce for numeric protocols"); + return -1; +} +/*-----------------PROTOCOL DECLARATIONS--------------------------*/ +static PySequenceMethods Matrix_SeqMethods = { + (inquiry) Matrix_len, /* sq_length */ + (binaryfunc) 0, /* sq_concat */ + (ssizeargfunc) 0, /* sq_repeat */ + (ssizeargfunc) Matrix_item, /* sq_item */ + (ssizessizeargfunc) Matrix_slice, /* sq_slice */ + (ssizeobjargproc) Matrix_ass_item, /* sq_ass_item */ + (ssizessizeobjargproc) Matrix_ass_slice, /* sq_ass_slice */ +}; +static PyNumberMethods Matrix_NumMethods = { + (binaryfunc) Matrix_add, /* __add__ */ + (binaryfunc) Matrix_sub, /* __sub__ */ + (binaryfunc) Matrix_mul, /* __mul__ */ + (binaryfunc) 0, /* __div__ */ + (binaryfunc) 0, /* __mod__ */ + (binaryfunc) 0, /* __divmod__ */ + (ternaryfunc) 0, /* __pow__ */ + (unaryfunc) 0, /* __neg__ */ + (unaryfunc) 0, /* __pos__ */ + (unaryfunc) 0, /* __abs__ */ + (inquiry) 0, /* __nonzero__ */ + (unaryfunc) Matrix_inv, /* __invert__ */ + (binaryfunc) 0, /* __lshift__ */ + (binaryfunc) 0, /* __rshift__ */ + (binaryfunc) 0, /* __and__ */ + (binaryfunc) 0, /* __xor__ */ + (binaryfunc) 0, /* __or__ */ +#if 0 // XXX 2.5 + (coercion) Matrix_coerce, /* __coerce__ */ +#else + 0, +#endif + (unaryfunc) 0, /* __int__ */ + (unaryfunc) 0, /* __long__ */ + (unaryfunc) 0, /* __float__ */ + (unaryfunc) 0, /* __oct__ */ + (unaryfunc) 0, /* __hex__ */ +}; +/*------------------PY_OBECT DEFINITION--------------------------*/ +PyTypeObject matrix_Type = { +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif + "matrix", /*tp_name*/ + sizeof(MatrixObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + (destructor)Matrix_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + (getattrfunc)Matrix_getattr, /*tp_getattr*/ + (setattrfunc) Matrix_setattr, /*tp_setattr*/ + 0, /*tp_compare*/ + (reprfunc) Matrix_repr, /*tp_repr*/ + &Matrix_NumMethods, /*tp_as_number*/ + &Matrix_SeqMethods, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT, /*tp_flags*/ + MatrixObject_doc, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + (richcmpfunc)Matrix_richcmpr, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + 0, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0 /*tp_del*/ +}; + +/*------------------------newMatrixObject (internal)------------- +creates a new matrix object +self->matrix self->contiguous_ptr (reference to data.xxx) + [0]------------->[0] + [1] + [2] + [1]------------->[3] + [4] + [5] + .... +self->matrix[1][1] = self->contiguous_ptr[4] = self->data.xxx_data[4]*/ + +/*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER + (i.e. it was allocated elsewhere by MEM_mallocN()) + pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON + (i.e. it must be created here with PyMEM_malloc())*/ +PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type) +{ + MatrixObject *self; + int x, row, col; + + /*matrix objects can be any 2-4row x 2-4col matrix*/ + if(rowSize < 2 || rowSize > 4 || colSize < 2 || colSize > 4){ + PyErr_SetString(PyExc_RuntimeError, "matrix(): row and column sizes must be between 2 and 4"); + return NULL; + } + + self = PyObject_NEW(MatrixObject, &matrix_Type); + self->data.blend_data = NULL; + self->data.py_data = NULL; + self->rowSize = rowSize; + self->colSize = colSize; + self->coerced_object = NULL; + + if(type == Py_WRAP){ + self->data.blend_data = mat; + self->contigPtr = self->data.blend_data; + /*create pointer array*/ + self->matrix = PyMem_Malloc(rowSize * sizeof(float *)); + if(self->matrix == NULL) { /*allocation failure*/ + PyErr_SetString( PyExc_MemoryError, "matrix(): problem allocating pointer space"); + return NULL; + } + /*pointer array points to contigous memory*/ + for(x = 0; x < rowSize; x++) { + self->matrix[x] = self->contigPtr + (x * colSize); + } + self->wrapped = Py_WRAP; + }else if (type == Py_NEW){ + self->data.py_data = PyMem_Malloc(rowSize * colSize * sizeof(float)); + if(self->data.py_data == NULL) { /*allocation failure*/ + PyErr_SetString( PyExc_MemoryError, "matrix(): problem allocating pointer space\n"); + return NULL; + } + self->contigPtr = self->data.py_data; + /*create pointer array*/ + self->matrix = PyMem_Malloc(rowSize * sizeof(float *)); + if(self->matrix == NULL) { /*allocation failure*/ + PyMem_Free(self->data.py_data); + PyErr_SetString( PyExc_MemoryError, "matrix(): problem allocating pointer space"); + return NULL; + } + /*pointer array points to contigous memory*/ + for(x = 0; x < rowSize; x++) { + self->matrix[x] = self->contigPtr + (x * colSize); + } + /*parse*/ + if(mat) { /*if a float array passed*/ + for(row = 0; row < rowSize; row++) { + for(col = 0; col < colSize; col++) { + self->matrix[row][col] = mat[(row * colSize) + col]; + } + } + } else if (rowSize == colSize ) { /*or if no arguments are passed return identity matrix for square matrices */ + Matrix_Identity(self); + Py_DECREF(self); + } + self->wrapped = Py_NEW; + }else{ /*bad type*/ + return NULL; + } + return (PyObject *) self; +} diff --git a/source/blender/python/generic/matrix.h b/source/blender/python/generic/matrix.h new file mode 100644 index 00000000000..fd51d99c455 --- /dev/null +++ b/source/blender/python/generic/matrix.h @@ -0,0 +1,77 @@ +/* + * $Id: matrix.h 20248 2009-05-18 04:11:54Z campbellbarton $ + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): Joseph Gilbert + * + * ***** END GPL LICENSE BLOCK ***** + * + */ + +#ifndef EXPP_matrix_h +#define EXPP_matrix_h + +#include + +extern PyTypeObject matrix_Type; + +#define MatrixObject_Check(v) ((v)->ob_type == &matrix_Type) + +typedef float **ptRow; +typedef struct _Matrix { + PyObject_VAR_HEAD + struct{ + float *py_data; /*python managed*/ + float *blend_data; /*blender managed*/ + }data; + ptRow matrix; /*ptr to the contigPtr (accessor)*/ + float *contigPtr; /*1D array of data (alias)*/ + int rowSize; + int colSize; + int wrapped; /*is wrapped data?*/ + PyObject *coerced_object; +} MatrixObject; +/*coerced_object is a pointer to the object that it was +coerced from when a dummy vector needs to be created from +the coerce() function for numeric protocol operations*/ + +/*struct data contains a pointer to the actual data that the +object uses. It can use either PyMem allocated data (which will +be stored in py_data) or be a wrapper for data allocated through +blender (stored in blend_data). This is an either/or struct not both*/ + +/*prototypes*/ +PyObject *Matrix_Zero( MatrixObject * self ); +PyObject *Matrix_Identity( MatrixObject * self ); +PyObject *Matrix_Transpose( MatrixObject * self ); +PyObject *Matrix_Determinant( MatrixObject * self ); +PyObject *Matrix_Invert( MatrixObject * self ); +PyObject *Matrix_TranslationPart( MatrixObject * self ); +PyObject *Matrix_RotationPart( MatrixObject * self ); +PyObject *Matrix_scalePart( MatrixObject * self ); +PyObject *Matrix_Resize4x4( MatrixObject * self ); +PyObject *Matrix_toEuler( MatrixObject * self, PyObject *args ); +PyObject *Matrix_toQuat( MatrixObject * self ); +PyObject *Matrix_copy( MatrixObject * self ); +PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type); + +#endif /* EXPP_matrix_H */ diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c new file mode 100644 index 00000000000..ca703f12907 --- /dev/null +++ b/source/blender/python/generic/quat.c @@ -0,0 +1,765 @@ +/* + * $Id: quat.c 20332 2009-05-22 03:22:56Z campbellbarton $ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * + * Contributor(s): Joseph Gilbert + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "Mathutils.h" + +#include "BLI_arithb.h" +#include "BKE_utildefines.h" +#include "BLI_blenlib.h" + + +//-------------------------DOC STRINGS --------------------------- +char Quaternion_Identity_doc[] = "() - set the quaternion to it's identity (1, vector)"; +char Quaternion_Negate_doc[] = "() - set all values in the quaternion to their negative"; +char Quaternion_Conjugate_doc[] = "() - set the quaternion to it's conjugate"; +char Quaternion_Inverse_doc[] = "() - set the quaternion to it's inverse"; +char Quaternion_Normalize_doc[] = "() - normalize the vector portion of the quaternion"; +char Quaternion_ToEuler_doc[] = "(eul_compat) - return a euler rotation representing the quaternion, optional euler argument that the new euler will be made compatible with."; +char Quaternion_ToMatrix_doc[] = "() - return a rotation matrix representing the quaternion"; +char Quaternion_Cross_doc[] = "(other) - return the cross product between this quaternion and another"; +char Quaternion_Dot_doc[] = "(other) - return the dot product between this quaternion and another"; +char Quaternion_copy_doc[] = "() - return a copy of the quat"; +//-----------------------METHOD DEFINITIONS ---------------------- +struct PyMethodDef Quaternion_methods[] = { + {"identity", (PyCFunction) Quaternion_Identity, METH_NOARGS, Quaternion_Identity_doc}, + {"negate", (PyCFunction) Quaternion_Negate, METH_NOARGS, Quaternion_Negate_doc}, + {"conjugate", (PyCFunction) Quaternion_Conjugate, METH_NOARGS, Quaternion_Conjugate_doc}, + {"inverse", (PyCFunction) Quaternion_Inverse, METH_NOARGS, Quaternion_Inverse_doc}, + {"normalize", (PyCFunction) Quaternion_Normalize, METH_NOARGS, Quaternion_Normalize_doc}, + {"toEuler", (PyCFunction) Quaternion_ToEuler, METH_VARARGS, Quaternion_ToEuler_doc}, + {"toMatrix", (PyCFunction) Quaternion_ToMatrix, METH_NOARGS, Quaternion_ToMatrix_doc}, + {"cross", (PyCFunction) Quaternion_Cross, METH_O, Quaternion_Cross_doc}, + {"dot", (PyCFunction) Quaternion_Dot, METH_O, Quaternion_Dot_doc}, + {"__copy__", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc}, + {"copy", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc}, + {NULL, NULL, 0, NULL} +}; +//-----------------------------METHODS------------------------------ +//----------------------------Quaternion.toEuler()------------------ +//return the quat as a euler +PyObject *Quaternion_ToEuler(QuaternionObject * self, PyObject *args) +{ + float eul[3]; + EulerObject *eul_compat = NULL; + int x; + + if(!PyArg_ParseTuple(args, "|O!:toEuler", &euler_Type, &eul_compat)) + return NULL; + + if(eul_compat) { + float mat[3][3], eul_compatf[3]; + + for(x = 0; x < 3; x++) { + eul_compatf[x] = eul_compat->eul[x] * ((float)Py_PI / 180); + } + + QuatToMat3(self->quat, mat); + Mat3ToCompatibleEul(mat, eul, eul_compatf); + } + else { + QuatToEul(self->quat, eul); + } + + + for(x = 0; x < 3; x++) { + eul[x] *= (180 / (float)Py_PI); + } + return newEulerObject(eul, Py_NEW); +} +//----------------------------Quaternion.toMatrix()------------------ +//return the quat as a matrix +PyObject *Quaternion_ToMatrix(QuaternionObject * self) +{ + float mat[9] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}; + QuatToMat3(self->quat, (float (*)[3]) mat); + + return newMatrixObject(mat, 3, 3, Py_NEW); +} + +//----------------------------Quaternion.cross(other)------------------ +//return the cross quat +PyObject *Quaternion_Cross(QuaternionObject * self, QuaternionObject * value) +{ + float quat[4]; + + if (!QuaternionObject_Check(value)) { + PyErr_SetString( PyExc_TypeError, "quat.cross(value): expected a quaternion argument" ); + return NULL; + } + + QuatMul(quat, self->quat, value->quat); + return newQuaternionObject(quat, Py_NEW); +} + +//----------------------------Quaternion.dot(other)------------------ +//return the dot quat +PyObject *Quaternion_Dot(QuaternionObject * self, QuaternionObject * value) +{ + int x; + double dot = 0.0; + + if (!QuaternionObject_Check(value)) { + PyErr_SetString( PyExc_TypeError, "quat.dot(value): expected a quaternion argument" ); + return NULL; + } + + for(x = 0; x < 4; x++) { + dot += self->quat[x] * value->quat[x]; + } + return PyFloat_FromDouble(dot); +} + +//----------------------------Quaternion.normalize()---------------- +//normalize the axis of rotation of [theta,vector] +PyObject *Quaternion_Normalize(QuaternionObject * self) +{ + NormalQuat(self->quat); + Py_INCREF(self); + return (PyObject*)self; +} +//----------------------------Quaternion.inverse()------------------ +//invert the quat +PyObject *Quaternion_Inverse(QuaternionObject * self) +{ + double mag = 0.0f; + int x; + + for(x = 1; x < 4; x++) { + self->quat[x] = -self->quat[x]; + } + for(x = 0; x < 4; x++) { + mag += (self->quat[x] * self->quat[x]); + } + mag = sqrt(mag); + for(x = 0; x < 4; x++) { + self->quat[x] /= (float)(mag * mag); + } + + Py_INCREF(self); + return (PyObject*)self; +} +//----------------------------Quaternion.identity()----------------- +//generate the identity quaternion +PyObject *Quaternion_Identity(QuaternionObject * self) +{ + self->quat[0] = 1.0; + self->quat[1] = 0.0; + self->quat[2] = 0.0; + self->quat[3] = 0.0; + + Py_INCREF(self); + return (PyObject*)self; +} +//----------------------------Quaternion.negate()------------------- +//negate the quat +PyObject *Quaternion_Negate(QuaternionObject * self) +{ + int x; + for(x = 0; x < 4; x++) { + self->quat[x] = -self->quat[x]; + } + Py_INCREF(self); + return (PyObject*)self; +} +//----------------------------Quaternion.conjugate()---------------- +//negate the vector part +PyObject *Quaternion_Conjugate(QuaternionObject * self) +{ + int x; + for(x = 1; x < 4; x++) { + self->quat[x] = -self->quat[x]; + } + Py_INCREF(self); + return (PyObject*)self; +} +//----------------------------Quaternion.copy()---------------- +//return a copy of the quat +PyObject *Quaternion_copy(QuaternionObject * self) +{ + return newQuaternionObject(self->quat, Py_NEW); +} + +//----------------------------dealloc()(internal) ------------------ +//free the py_object +static void Quaternion_dealloc(QuaternionObject * self) +{ + Py_XDECREF(self->coerced_object); + //only free py_data + if(self->data.py_data){ + PyMem_Free(self->data.py_data); + } + PyObject_DEL(self); +} + +//----------------------------print object (internal)-------------- +//print the object to screen +static PyObject *Quaternion_repr(QuaternionObject * self) +{ + char str[64]; + sprintf(str, "[%.6f, %.6f, %.6f, %.6f](quaternion)", self->quat[0], self->quat[1], self->quat[2], self->quat[3]); + return PyUnicode_FromString(str); +} +//------------------------tp_richcmpr +//returns -1 execption, 0 false, 1 true +static PyObject* Quaternion_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type) +{ + QuaternionObject *quatA = NULL, *quatB = NULL; + int result = 0; + + if (!QuaternionObject_Check(objectA) || !QuaternionObject_Check(objectB)){ + if (comparison_type == Py_NE){ + Py_RETURN_TRUE; + }else{ + Py_RETURN_FALSE; + } + } + quatA = (QuaternionObject*)objectA; + quatB = (QuaternionObject*)objectB; + + switch (comparison_type){ + case Py_EQ: + result = EXPP_VectorsAreEqual(quatA->quat, quatB->quat, 4, 1); + break; + case Py_NE: + result = EXPP_VectorsAreEqual(quatA->quat, quatB->quat, 4, 1); + if (result == 0){ + result = 1; + }else{ + result = 0; + } + break; + default: + printf("The result of the comparison could not be evaluated"); + break; + } + if (result == 1){ + Py_RETURN_TRUE; + }else{ + Py_RETURN_FALSE; + } +} +//------------------------tp_doc +static char QuaternionObject_doc[] = "This is a wrapper for quaternion objects."; +//---------------------SEQUENCE PROTOCOLS------------------------ +//----------------------------len(object)------------------------ +//sequence length +static int Quaternion_len(QuaternionObject * self) +{ + return 4; +} +//----------------------------object[]--------------------------- +//sequence accessor (get) +static PyObject *Quaternion_item(QuaternionObject * self, int i) +{ + if(i < 0 || i >= 4) { + PyErr_SetString(PyExc_IndexError, "quaternion[attribute]: array index out of range\n"); + return NULL; + } + return PyFloat_FromDouble(self->quat[i]); + +} +//----------------------------object[]------------------------- +//sequence accessor (set) +static int Quaternion_ass_item(QuaternionObject * self, int i, PyObject * ob) +{ + PyObject *f = NULL; + + f = PyNumber_Float(ob); + if(f == NULL) { // parsed item not a number + PyErr_SetString(PyExc_TypeError, "quaternion[attribute] = x: argument not a number\n"); + return -1; + } + + if(i < 0 || i >= 4){ + Py_DECREF(f); + PyErr_SetString(PyExc_IndexError, "quaternion[attribute] = x: array assignment index out of range\n"); + return -1; + } + self->quat[i] = (float)PyFloat_AS_DOUBLE(f); + Py_DECREF(f); + return 0; +} +//----------------------------object[z:y]------------------------ +//sequence slice (get) +static PyObject *Quaternion_slice(QuaternionObject * self, int begin, int end) +{ + PyObject *list = NULL; + int count; + + CLAMP(begin, 0, 4); + if (end<0) end= 5+end; + CLAMP(end, 0, 4); + begin = MIN2(begin,end); + + list = PyList_New(end - begin); + for(count = begin; count < end; count++) { + PyList_SetItem(list, count - begin, + PyFloat_FromDouble(self->quat[count])); + } + + return list; +} +//----------------------------object[z:y]------------------------ +//sequence slice (set) +static int Quaternion_ass_slice(QuaternionObject * self, int begin, int end, + PyObject * seq) +{ + int i, y, size = 0; + float quat[4]; + PyObject *q, *f; + + CLAMP(begin, 0, 4); + if (end<0) end= 5+end; + CLAMP(end, 0, 4); + begin = MIN2(begin,end); + + size = PySequence_Length(seq); + if(size != (end - begin)){ + PyErr_SetString(PyExc_TypeError, "quaternion[begin:end] = []: size mismatch in slice assignment\n"); + return -1; + } + + for (i = 0; i < size; i++) { + q = PySequence_GetItem(seq, i); + if (q == NULL) { // Failed to read sequence + PyErr_SetString(PyExc_RuntimeError, "quaternion[begin:end] = []: unable to read sequence\n"); + return -1; + } + + f = PyNumber_Float(q); + if(f == NULL) { // parsed item not a number + Py_DECREF(q); + PyErr_SetString(PyExc_TypeError, "quaternion[begin:end] = []: sequence argument not a number\n"); + return -1; + } + + quat[i] = (float)PyFloat_AS_DOUBLE(f); + Py_DECREF(f); + Py_DECREF(q); + } + //parsed well - now set in vector + for(y = 0; y < size; y++){ + self->quat[begin + y] = quat[y]; + } + return 0; +} +//------------------------NUMERIC PROTOCOLS---------------------- +//------------------------obj + obj------------------------------ +//addition +static PyObject *Quaternion_add(PyObject * q1, PyObject * q2) +{ + int x; + float quat[4]; + QuaternionObject *quat1 = NULL, *quat2 = NULL; + + quat1 = (QuaternionObject*)q1; + quat2 = (QuaternionObject*)q2; + + if(quat1->coerced_object || quat2->coerced_object){ + PyErr_SetString(PyExc_AttributeError, "Quaternion addition: arguments not valid for this operation....\n"); + return NULL; + } + for(x = 0; x < 4; x++) { + quat[x] = quat1->quat[x] + quat2->quat[x]; + } + + return newQuaternionObject(quat, Py_NEW); +} +//------------------------obj - obj------------------------------ +//subtraction +static PyObject *Quaternion_sub(PyObject * q1, PyObject * q2) +{ + int x; + float quat[4]; + QuaternionObject *quat1 = NULL, *quat2 = NULL; + + quat1 = (QuaternionObject*)q1; + quat2 = (QuaternionObject*)q2; + + if(quat1->coerced_object || quat2->coerced_object){ + PyErr_SetString(PyExc_AttributeError, "Quaternion addition: arguments not valid for this operation....\n"); + return NULL; + } + for(x = 0; x < 4; x++) { + quat[x] = quat1->quat[x] - quat2->quat[x]; + } + + return newQuaternionObject(quat, Py_NEW); +} +//------------------------obj * obj------------------------------ +//mulplication +static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2) +{ + int x; + float quat[4], scalar; + double dot = 0.0f; + QuaternionObject *quat1 = NULL, *quat2 = NULL; + PyObject *f = NULL; + VectorObject *vec = NULL; + + quat1 = (QuaternionObject*)q1; + quat2 = (QuaternionObject*)q2; + + if(quat1->coerced_object){ + if (PyFloat_Check(quat1->coerced_object) || + PyLong_Check(quat1->coerced_object)){ // FLOAT/INT * QUAT + f = PyNumber_Float(quat1->coerced_object); + if(f == NULL) { // parsed item not a number + PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: arguments not acceptable for this operation\n"); + return NULL; + } + + scalar = (float)PyFloat_AS_DOUBLE(f); + Py_DECREF(f); + for(x = 0; x < 4; x++) { + quat[x] = quat2->quat[x] * scalar; + } + return newQuaternionObject(quat, Py_NEW); + } + }else{ + if(quat2->coerced_object){ + if (PyFloat_Check(quat2->coerced_object) || + PyLong_Check(quat2->coerced_object)){ // QUAT * FLOAT/INT + f = PyNumber_Float(quat2->coerced_object); + if(f == NULL) { // parsed item not a number + PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: arguments not acceptable for this operation\n"); + return NULL; + } + + scalar = (float)PyFloat_AS_DOUBLE(f); + Py_DECREF(f); + for(x = 0; x < 4; x++) { + quat[x] = quat1->quat[x] * scalar; + } + return newQuaternionObject(quat, Py_NEW); + }else if(VectorObject_Check(quat2->coerced_object)){ //QUAT * VEC + vec = (VectorObject*)quat2->coerced_object; + if(vec->size != 3){ + PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: only 3D vector rotations currently supported\n"); + return NULL; + } + return quat_rotation((PyObject*)quat1, (PyObject*)vec); + } + }else{ //QUAT * QUAT (dot product) + for(x = 0; x < 4; x++) { + dot += quat1->quat[x] * quat1->quat[x]; + } + return PyFloat_FromDouble(dot); + } + } + + PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: arguments not acceptable for this operation\n"); + return NULL; +} +//------------------------coerce(obj, obj)----------------------- +//coercion of unknown types to type QuaternionObject for numeric protocols +/*Coercion() is called whenever a math operation has 2 operands that + it doesn't understand how to evaluate. 2+Matrix for example. We want to + evaluate some of these operations like: (vector * 2), however, for math + to proceed, the unknown operand must be cast to a type that python math will + understand. (e.g. in the case above case, 2 must be cast to a vector and + then call vector.multiply(vector, scalar_cast_as_vector)*/ +static int Quaternion_coerce(PyObject ** q1, PyObject ** q2) +{ + if(VectorObject_Check(*q2) || PyFloat_Check(*q2) || PyLong_Check(*q2)) { + PyObject *coerced = (PyObject *)(*q2); + Py_INCREF(coerced); + + *q2 = newQuaternionObject(NULL,Py_NEW); + ((QuaternionObject*)*q2)->coerced_object = coerced; + Py_INCREF (*q1); + return 0; + } + + PyErr_SetString(PyExc_TypeError, "quaternion.coerce(): unknown operand - can't coerce for numeric protocols"); + return -1; +} +//-----------------PROTOCOL DECLARATIONS-------------------------- +static PySequenceMethods Quaternion_SeqMethods = { + (inquiry) Quaternion_len, /* sq_length */ + (binaryfunc) 0, /* sq_concat */ + (ssizeargfunc) 0, /* sq_repeat */ + (ssizeargfunc) Quaternion_item, /* sq_item */ + (ssizessizeargfunc) Quaternion_slice, /* sq_slice */ + (ssizeobjargproc) Quaternion_ass_item, /* sq_ass_item */ + (ssizessizeobjargproc) Quaternion_ass_slice, /* sq_ass_slice */ +}; +static PyNumberMethods Quaternion_NumMethods = { + (binaryfunc) Quaternion_add, /* __add__ */ + (binaryfunc) Quaternion_sub, /* __sub__ */ + (binaryfunc) Quaternion_mul, /* __mul__ */ + (binaryfunc) 0, /* __div__ */ + (binaryfunc) 0, /* __mod__ */ + (binaryfunc) 0, /* __divmod__ */ + (ternaryfunc) 0, /* __pow__ */ + (unaryfunc) 0, /* __neg__ */ + (unaryfunc) 0, /* __pos__ */ + (unaryfunc) 0, /* __abs__ */ + (inquiry) 0, /* __nonzero__ */ + (unaryfunc) 0, /* __invert__ */ + (binaryfunc) 0, /* __lshift__ */ + (binaryfunc) 0, /* __rshift__ */ + (binaryfunc) 0, /* __and__ */ + (binaryfunc) 0, /* __xor__ */ + (binaryfunc) 0, /* __or__ */ +#if 0 //XXX 2.5 + (coercion) Quaternion_coerce, /* __coerce__ */ +#else + 0, +#endif + (unaryfunc) 0, /* __int__ */ + (unaryfunc) 0, /* __long__ */ + (unaryfunc) 0, /* __float__ */ + (unaryfunc) 0, /* __oct__ */ + (unaryfunc) 0, /* __hex__ */ + +}; + + +static PyObject *Quaternion_getAxis( QuaternionObject * self, void *type ) +{ + switch( (long)type ) { + case 'W': + return PyFloat_FromDouble(self->quat[0]); + case 'X': + return PyFloat_FromDouble(self->quat[1]); + case 'Y': + return PyFloat_FromDouble(self->quat[2]); + case 'Z': + return PyFloat_FromDouble(self->quat[3]); + } + + PyErr_SetString(PyExc_SystemError, "corrupt quaternion, cannot get axis"); + return NULL; +} + +static int Quaternion_setAxis( QuaternionObject * self, PyObject * value, void * type ) +{ + float param= (float)PyFloat_AsDouble( value ); + + if (param==-1 && PyErr_Occurred()) { + PyErr_SetString( PyExc_TypeError, "expected a number for the vector axis" ); + return -1; + } + switch( (long)type ) { + case 'W': + self->quat[0]= param; + break; + case 'X': + self->quat[1]= param; + break; + case 'Y': + self->quat[2]= param; + break; + case 'Z': + self->quat[3]= param; + break; + } + + return 0; +} + +static PyObject *Quaternion_getWrapped( QuaternionObject * self, void *type ) +{ + if (self->wrapped == Py_WRAP) + Py_RETURN_TRUE; + else + Py_RETURN_FALSE; +} + +static PyObject *Quaternion_getMagnitude( QuaternionObject * self, void *type ) +{ + double mag = 0.0; + int i; + for(i = 0; i < 4; i++) { + mag += self->quat[i] * self->quat[i]; + } + return PyFloat_FromDouble(sqrt(mag)); +} + +static PyObject *Quaternion_getAngle( QuaternionObject * self, void *type ) +{ + double ang = self->quat[0]; + ang = 2 * (saacos(ang)); + ang *= (180 / Py_PI); + return PyFloat_FromDouble(ang); +} + +static PyObject *Quaternion_getAxisVec( QuaternionObject * self, void *type ) +{ + int i; + float vec[3]; + double mag = self->quat[0] * (Py_PI / 180); + mag = 2 * (saacos(mag)); + mag = sin(mag / 2); + for(i = 0; i < 3; i++) + vec[i] = (float)(self->quat[i + 1] / mag); + + Normalize(vec); + //If the axis of rotation is 0,0,0 set it to 1,0,0 - for zero-degree rotations + if( EXPP_FloatsAreEqual(vec[0], 0.0f, 10) && + EXPP_FloatsAreEqual(vec[1], 0.0f, 10) && + EXPP_FloatsAreEqual(vec[2], 0.0f, 10) ){ + vec[0] = 1.0f; + } + return (PyObject *) newVectorObject(vec, 3, Py_NEW); +} + + +/*****************************************************************************/ +/* Python attributes get/set structure: */ +/*****************************************************************************/ +static PyGetSetDef Quaternion_getseters[] = { + {"w", + (getter)Quaternion_getAxis, (setter)Quaternion_setAxis, + "Quaternion W value", + (void *)'W'}, + {"x", + (getter)Quaternion_getAxis, (setter)Quaternion_setAxis, + "Quaternion X axis", + (void *)'X'}, + {"y", + (getter)Quaternion_getAxis, (setter)Quaternion_setAxis, + "Quaternion Y axis", + (void *)'Y'}, + {"z", + (getter)Quaternion_getAxis, (setter)Quaternion_setAxis, + "Quaternion Z axis", + (void *)'Z'}, + {"magnitude", + (getter)Quaternion_getMagnitude, (setter)NULL, + "Size of the quaternion", + NULL}, + {"angle", + (getter)Quaternion_getAngle, (setter)NULL, + "angle of the quaternion", + NULL}, + {"axis", + (getter)Quaternion_getAxisVec, (setter)NULL, + "quaternion axis as a vector", + NULL}, + {"wrapped", + (getter)Quaternion_getWrapped, (setter)NULL, + "True when this wraps blenders internal data", + NULL}, + {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ +}; + + +//------------------PY_OBECT DEFINITION-------------------------- +PyTypeObject quaternion_Type = { +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif + "quaternion", //tp_name + sizeof(QuaternionObject), //tp_basicsize + 0, //tp_itemsize + (destructor)Quaternion_dealloc, //tp_dealloc + 0, //tp_print + 0, //tp_getattr + 0, //tp_setattr + 0, //tp_compare + (reprfunc) Quaternion_repr, //tp_repr + &Quaternion_NumMethods, //tp_as_number + &Quaternion_SeqMethods, //tp_as_sequence + 0, //tp_as_mapping + 0, //tp_hash + 0, //tp_call + 0, //tp_str + 0, //tp_getattro + 0, //tp_setattro + 0, //tp_as_buffer + Py_TPFLAGS_DEFAULT, //tp_flags + QuaternionObject_doc, //tp_doc + 0, //tp_traverse + 0, //tp_clear + (richcmpfunc)Quaternion_richcmpr, //tp_richcompare + 0, //tp_weaklistoffset + 0, //tp_iter + 0, //tp_iternext + Quaternion_methods, //tp_methods + 0, //tp_members + Quaternion_getseters, //tp_getset + 0, //tp_base + 0, //tp_dict + 0, //tp_descr_get + 0, //tp_descr_set + 0, //tp_dictoffset + 0, //tp_init + 0, //tp_alloc + 0, //tp_new + 0, //tp_free + 0, //tp_is_gc + 0, //tp_bases + 0, //tp_mro + 0, //tp_cache + 0, //tp_subclasses + 0, //tp_weaklist + 0 //tp_del +}; +//------------------------newQuaternionObject (internal)------------- +//creates a new quaternion object +/*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER + (i.e. it was allocated elsewhere by MEM_mallocN()) + pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON + (i.e. it must be created here with PyMEM_malloc())*/ +PyObject *newQuaternionObject(float *quat, int type) +{ + QuaternionObject *self; + int x; + + self = PyObject_NEW(QuaternionObject, &quaternion_Type); + self->data.blend_data = NULL; + self->data.py_data = NULL; + self->coerced_object = NULL; + + if(type == Py_WRAP){ + self->data.blend_data = quat; + self->quat = self->data.blend_data; + self->wrapped = Py_WRAP; + }else if (type == Py_NEW){ + self->data.py_data = PyMem_Malloc(4 * sizeof(float)); + self->quat = self->data.py_data; + if(!quat) { //new empty + Quaternion_Identity(self); + Py_DECREF(self); + }else{ + for(x = 0; x < 4; x++){ + self->quat[x] = quat[x]; + } + } + self->wrapped = Py_NEW; + }else{ //bad type + return NULL; + } + return (PyObject *) self; +} diff --git a/source/blender/python/generic/quat.h b/source/blender/python/generic/quat.h new file mode 100644 index 00000000000..f98665ded55 --- /dev/null +++ b/source/blender/python/generic/quat.h @@ -0,0 +1,72 @@ +/* + * $Id: quat.h 20332 2009-05-22 03:22:56Z campbellbarton $ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): Joseph Gilbert + * + * ***** END GPL LICENSE BLOCK ***** + * + */ + +#ifndef EXPP_quat_h +#define EXPP_quat_h + +#include + +extern PyTypeObject quaternion_Type; + +#define QuaternionObject_Check(v) (Py_TYPE(v) == &quaternion_Type) + +typedef struct { + PyObject_VAR_HEAD + struct{ + float *py_data; //python managed + float *blend_data; //blender managed + }data; + float *quat; //1D array of data (alias) + int wrapped; //is wrapped data? + PyObject *coerced_object; +} QuaternionObject; +/*coerced_object is a pointer to the object that it was +coerced from when a dummy vector needs to be created from +the coerce() function for numeric protocol operations*/ + +/*struct data contains a pointer to the actual data that the +object uses. It can use either PyMem allocated data (which will +be stored in py_data) or be a wrapper for data allocated through +blender (stored in blend_data). This is an either/or struct not both*/ + +//prototypes +PyObject *Quaternion_Identity( QuaternionObject * self ); +PyObject *Quaternion_Negate( QuaternionObject * self ); +PyObject *Quaternion_Conjugate( QuaternionObject * self ); +PyObject *Quaternion_Inverse( QuaternionObject * self ); +PyObject *Quaternion_Normalize( QuaternionObject * self ); +PyObject *Quaternion_ToEuler( QuaternionObject * self, PyObject *args ); +PyObject *Quaternion_ToMatrix( QuaternionObject * self ); +PyObject *Quaternion_Cross( QuaternionObject * self, QuaternionObject * value ); +PyObject *Quaternion_Dot( QuaternionObject * self, QuaternionObject * value ); +PyObject *Quaternion_copy( QuaternionObject * self ); +PyObject *newQuaternionObject( float *quat, int type ); + +#endif /* EXPP_quat_h */ diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c new file mode 100644 index 00000000000..86ce5c21217 --- /dev/null +++ b/source/blender/python/generic/vector.c @@ -0,0 +1,1838 @@ +/* + * $Id: vector.c 20332 2009-05-22 03:22:56Z campbellbarton $ + * ***** BEGIN GPL 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. + * + * 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. + * + * + * Contributor(s): Willian P. Germano, Joseph Gilbert, Ken Hughes, Alex Fraser, Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "Mathutils.h" + +#include "BLI_blenlib.h" +#include "BKE_utildefines.h" +#include "BLI_arithb.h" + +#define MAX_DIMENSIONS 4 +/* Swizzle axes get packed into a single value that is used as a closure. Each + axis uses SWIZZLE_BITS_PER_AXIS bits. The first bit (SWIZZLE_VALID_AXIS) is + used as a sentinel: if it is unset, the axis is not valid. */ +#define SWIZZLE_BITS_PER_AXIS 3 +#define SWIZZLE_VALID_AXIS 0x4 +#define SWIZZLE_AXIS 0x3 + +/*-------------------------DOC STRINGS ---------------------------*/ +char Vector_Zero_doc[] = "() - set all values in the vector to 0"; +char Vector_Normalize_doc[] = "() - normalize the vector"; +char Vector_Negate_doc[] = "() - changes vector to it's additive inverse"; +char Vector_Resize2D_doc[] = "() - resize a vector to [x,y]"; +char Vector_Resize3D_doc[] = "() - resize a vector to [x,y,z]"; +char Vector_Resize4D_doc[] = "() - resize a vector to [x,y,z,w]"; +char Vector_ToTrackQuat_doc[] = "(track, up) - extract a quaternion from the vector and the track and up axis"; +char Vector_Reflect_doc[] = "(mirror) - return a vector reflected on the mirror normal"; +char Vector_Cross_doc[] = "(other) - return the cross product between this vector and another"; +char Vector_Dot_doc[] = "(other) - return the dot product between this vector and another"; +char Vector_copy_doc[] = "() - return a copy of the vector"; +char Vector_swizzle_doc[] = "Swizzle: Get or set axes in specified order"; +/*-----------------------METHOD DEFINITIONS ----------------------*/ +struct PyMethodDef Vector_methods[] = { + {"zero", (PyCFunction) Vector_Zero, METH_NOARGS, Vector_Zero_doc}, + {"normalize", (PyCFunction) Vector_Normalize, METH_NOARGS, Vector_Normalize_doc}, + {"negate", (PyCFunction) Vector_Negate, METH_NOARGS, Vector_Negate_doc}, + {"resize2D", (PyCFunction) Vector_Resize2D, METH_NOARGS, Vector_Resize2D_doc}, + {"resize3D", (PyCFunction) Vector_Resize3D, METH_NOARGS, Vector_Resize2D_doc}, + {"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, Vector_Resize2D_doc}, + {"toTrackQuat", ( PyCFunction ) Vector_ToTrackQuat, METH_VARARGS, Vector_ToTrackQuat_doc}, + {"reflect", ( PyCFunction ) Vector_Reflect, METH_O, Vector_Reflect_doc}, + {"cross", ( PyCFunction ) Vector_Cross, METH_O, Vector_Dot_doc}, + {"dot", ( PyCFunction ) Vector_Dot, METH_O, Vector_Cross_doc}, + {"copy", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc}, + {"__copy__", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc}, + {NULL, NULL, 0, NULL} +}; + +/*-----------------------------METHODS---------------------------- */ +/*----------------------------Vector.zero() ---------------------- + set the vector data to 0,0,0 */ +PyObject *Vector_Zero(VectorObject * self) +{ + int i; + for(i = 0; i < self->size; i++) { + self->vec[i] = 0.0f; + } + Py_INCREF(self); + return (PyObject*)self; +} +/*----------------------------Vector.normalize() ----------------- + normalize the vector data to a unit vector */ +PyObject *Vector_Normalize(VectorObject * self) +{ + int i; + float norm = 0.0f; + + for(i = 0; i < self->size; i++) { + norm += self->vec[i] * self->vec[i]; + } + norm = (float) sqrt(norm); + for(i = 0; i < self->size; i++) { + self->vec[i] /= norm; + } + Py_INCREF(self); + return (PyObject*)self; +} + + +/*----------------------------Vector.resize2D() ------------------ + resize the vector to x,y */ +PyObject *Vector_Resize2D(VectorObject * self) +{ + if(self->wrapped==Py_WRAP) { + PyErr_SetString(PyExc_TypeError, "vector.resize2d(): cannot resize wrapped data - only python vectors\n"); + return NULL; + } + self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 2)); + if(self->vec == NULL) { + PyErr_SetString(PyExc_MemoryError, "vector.resize2d(): problem allocating pointer space\n\n"); + return NULL; + } + + self->size = 2; + Py_INCREF(self); + return (PyObject*)self; +} +/*----------------------------Vector.resize3D() ------------------ + resize the vector to x,y,z */ +PyObject *Vector_Resize3D(VectorObject * self) +{ + if (self->wrapped==Py_WRAP) { + PyErr_SetString(PyExc_TypeError, "vector.resize3d(): cannot resize wrapped data - only python vectors\n"); + return NULL; + } + self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 3)); + if(self->vec == NULL) { + PyErr_SetString(PyExc_MemoryError, "vector.resize3d(): problem allocating pointer space\n\n"); + return NULL; + } + + if(self->size == 2) + self->vec[2] = 0.0f; + + self->size = 3; + Py_INCREF(self); + return (PyObject*)self; +} +/*----------------------------Vector.resize4D() ------------------ + resize the vector to x,y,z,w */ +PyObject *Vector_Resize4D(VectorObject * self) +{ + if(self->wrapped==Py_WRAP) { + PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize wrapped data - only python vectors"); + return NULL; + } + self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 4)); + if(self->vec == NULL) { + PyErr_SetString(PyExc_MemoryError, "vector.resize4d(): problem allocating pointer space\n\n"); + return NULL; + } + if(self->size == 2){ + self->vec[2] = 0.0f; + self->vec[3] = 1.0f; + }else if(self->size == 3){ + self->vec[3] = 1.0f; + } + self->size = 4; + Py_INCREF(self); + return (PyObject*)self; +} +/*----------------------------Vector.toTrackQuat(track, up) ---------------------- + extract a quaternion from the vector and the track and up axis */ +PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) +{ + float vec[3], quat[4]; + char *strack, *sup; + short track = 2, up = 1; + + if( !PyArg_ParseTuple ( args, "|ss", &strack, &sup ) ) { + PyErr_SetString( PyExc_TypeError, "expected optional two strings\n" ); + return NULL; + } + if (self->size != 3) { + PyErr_SetString( PyExc_TypeError, "only for 3D vectors\n" ); + return NULL; + } + + if (strack) { + if (strlen(strack) == 2) { + if (strack[0] == '-') { + switch(strack[1]) { + case 'X': + case 'x': + track = 3; + break; + case 'Y': + case 'y': + track = 4; + break; + case 'z': + case 'Z': + track = 5; + break; + default: + PyErr_SetString( PyExc_ValueError, "only X, -X, Y, -Y, Z or -Z for track axis\n" ); + return NULL; + } + } + else { + PyErr_SetString( PyExc_ValueError, "only X, -X, Y, -Y, Z or -Z for track axis\n" ); + return NULL; + } + } + else if (strlen(strack) == 1) { + switch(strack[0]) { + case '-': + case 'X': + case 'x': + track = 0; + break; + case 'Y': + case 'y': + track = 1; + break; + case 'z': + case 'Z': + track = 2; + break; + default: + PyErr_SetString( PyExc_ValueError, "only X, -X, Y, -Y, Z or -Z for track axis\n" ); + return NULL; + } + } + else { + PyErr_SetString( PyExc_ValueError, "only X, -X, Y, -Y, Z or -Z for track axis\n" ); + return NULL; + } + } + + if (sup) { + if (strlen(sup) == 1) { + switch(*sup) { + case 'X': + case 'x': + up = 0; + break; + case 'Y': + case 'y': + up = 1; + break; + case 'z': + case 'Z': + up = 2; + break; + default: + PyErr_SetString( PyExc_ValueError, "only X, Y or Z for up axis\n" ); + return NULL; + } + } + else { + PyErr_SetString( PyExc_ValueError, "only X, Y or Z for up axis\n" ); + return NULL; + } + } + + if (track == up) { + PyErr_SetString( PyExc_ValueError, "Can't have the same axis for track and up\n" ); + return NULL; + } + + /* + flip vector around, since vectoquat expect a vector from target to tracking object + and the python function expects the inverse (a vector to the target). + */ + vec[0] = -self->vec[0]; + vec[1] = -self->vec[1]; + vec[2] = -self->vec[2]; + + vectoquat(vec, track, up, quat); + + return newQuaternionObject(quat, Py_NEW); +} + +/*----------------------------Vector.reflect(mirror) ---------------------- + return a reflected vector on the mirror normal + ((2 * DotVecs(vec, mirror)) * mirror) - vec + using arithb.c would be nice here */ +PyObject *Vector_Reflect( VectorObject * self, PyObject * value ) +{ + VectorObject *mirrvec; + float mirror[3]; + float vec[3]; + float reflect[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + float dot2; + + /* for normalizing */ + int i; + float norm = 0.0f; + + if (!VectorObject_Check(value)) { + PyErr_SetString( PyExc_TypeError, "vec.reflect(value): expected a vector argument" ); + return NULL; + } + mirrvec = (VectorObject *)value; + + mirror[0] = mirrvec->vec[0]; + mirror[1] = mirrvec->vec[1]; + if (mirrvec->size > 2) mirror[2] = mirrvec->vec[2]; + else mirror[2] = 0.0; + + /* normalize, whos idea was it not to use arithb.c? :-/ */ + for(i = 0; i < 3; i++) { + norm += mirror[i] * mirror[i]; + } + norm = (float) sqrt(norm); + for(i = 0; i < 3; i++) { + mirror[i] /= norm; + } + /* done */ + + vec[0] = self->vec[0]; + vec[1] = self->vec[1]; + if (self->size > 2) vec[2] = self->vec[2]; + else vec[2] = 0.0; + + dot2 = 2 * vec[0]*mirror[0]+vec[1]*mirror[1]+vec[2]*mirror[2]; + + reflect[0] = (dot2 * mirror[0]) - vec[0]; + reflect[1] = (dot2 * mirror[1]) - vec[1]; + reflect[2] = (dot2 * mirror[2]) - vec[2]; + + return newVectorObject(reflect, self->size, Py_NEW); +} + +PyObject *Vector_Cross( VectorObject * self, VectorObject * value ) +{ + VectorObject *vecCross = NULL; + + if (!VectorObject_Check(value)) { + PyErr_SetString( PyExc_TypeError, "vec.cross(value): expected a vector argument" ); + return NULL; + } + + if(self->size != 3 || value->size != 3) { + PyErr_SetString(PyExc_AttributeError, "vec.cross(value): expects both vectors to be 3D\n"); + return NULL; + } + + vecCross = (VectorObject *)newVectorObject(NULL, 3, Py_NEW); + Crossf(vecCross->vec, self->vec, value->vec); + return (PyObject *)vecCross; +} + +PyObject *Vector_Dot( VectorObject * self, VectorObject * value ) +{ + double dot = 0.0; + int x; + + if (!VectorObject_Check(value)) { + PyErr_SetString( PyExc_TypeError, "vec.cross(value): expected a vector argument" ); + return NULL; + } + + if(self->size != value->size) { + PyErr_SetString(PyExc_AttributeError, "vec.dot(value): expects both vectors to have the same size\n"); + return NULL; + } + + for(x = 0; x < self->size; x++) { + dot += self->vec[x] * value->vec[x]; + } + return PyFloat_FromDouble(dot); +} + +/*----------------------------Vector.copy() -------------------------------------- + return a copy of the vector */ +PyObject *Vector_copy(VectorObject * self) +{ + return newVectorObject(self->vec, self->size, Py_NEW); +} + +/*----------------------------dealloc()(internal) ---------------- + free the py_object */ +static void Vector_dealloc(VectorObject * self) +{ + /* only free non wrapped */ + if(self->wrapped != Py_WRAP){ + PyMem_Free(self->vec); + } + PyObject_DEL(self); +} + +/*----------------------------print object (internal)------------- + print the object to screen */ +static PyObject *Vector_repr(VectorObject * self) +{ + int i; + char buffer[48], str[1024]; + + BLI_strncpy(str,"[",1024); + for(i = 0; i < self->size; i++){ + if(i < (self->size - 1)){ + sprintf(buffer, "%.6f, ", self->vec[i]); + strcat(str,buffer); + }else{ + sprintf(buffer, "%.6f", self->vec[i]); + strcat(str,buffer); + } + } + strcat(str, "](vector)"); + + return PyUnicode_FromString(str); +} +/*---------------------SEQUENCE PROTOCOLS------------------------ + ----------------------------len(object)------------------------ + sequence length*/ +static int Vector_len(VectorObject * self) +{ + return self->size; +} +/*----------------------------object[]--------------------------- + sequence accessor (get)*/ +static PyObject *Vector_item(VectorObject * self, int i) +{ + if(i < 0 || i >= self->size) { + PyErr_SetString(PyExc_IndexError,"vector[index]: out of range\n"); + return NULL; + } + + return PyFloat_FromDouble(self->vec[i]); + +} +/*----------------------------object[]------------------------- + sequence accessor (set)*/ +static int Vector_ass_item(VectorObject * self, int i, PyObject * ob) +{ + + if(!(PyNumber_Check(ob))) { /* parsed item not a number */ + PyErr_SetString(PyExc_TypeError, "vector[index] = x: index argument not a number\n"); + return -1; + } + + if(i < 0 || i >= self->size){ + PyErr_SetString(PyExc_IndexError, "vector[index] = x: assignment index out of range\n"); + return -1; + } + self->vec[i] = (float)PyFloat_AsDouble(ob); + return 0; +} + +/*----------------------------object[z:y]------------------------ + sequence slice (get) */ +static PyObject *Vector_slice(VectorObject * self, int begin, int end) +{ + PyObject *list = NULL; + int count; + + CLAMP(begin, 0, self->size); + if (end<0) end= self->size+end+1; + CLAMP(end, 0, self->size); + begin = MIN2(begin,end); + + list = PyList_New(end - begin); + for(count = begin; count < end; count++) { + PyList_SetItem(list, count - begin, + PyFloat_FromDouble(self->vec[count])); + } + + return list; +} +/*----------------------------object[z:y]------------------------ + sequence slice (set) */ +static int Vector_ass_slice(VectorObject * self, int begin, int end, + PyObject * seq) +{ + int i, y, size = 0; + float vec[4]; + PyObject *v; + + CLAMP(begin, 0, self->size); + if (end<0) end= self->size+end+1; + CLAMP(end, 0, self->size); + begin = MIN2(begin,end); + + size = PySequence_Length(seq); + if(size != (end - begin)){ + PyErr_SetString(PyExc_TypeError, "vector[begin:end] = []: size mismatch in slice assignment\n"); + return -1; + } + + for (i = 0; i < size; i++) { + v = PySequence_GetItem(seq, i); + if (v == NULL) { /* Failed to read sequence */ + PyErr_SetString(PyExc_RuntimeError, "vector[begin:end] = []: unable to read sequence\n"); + return -1; + } + + if(!PyNumber_Check(v)) { /* parsed item not a number */ + Py_DECREF(v); + PyErr_SetString(PyExc_TypeError, "vector[begin:end] = []: sequence argument not a number\n"); + return -1; + } + + vec[i] = (float)PyFloat_AsDouble(v); + Py_DECREF(v); + } + /*parsed well - now set in vector*/ + for(y = 0; y < size; y++){ + self->vec[begin + y] = vec[y]; + } + return 0; +} +/*------------------------NUMERIC PROTOCOLS---------------------- + ------------------------obj + obj------------------------------ + addition*/ +static PyObject *Vector_add(PyObject * v1, PyObject * v2) +{ + int i; + float vec[4]; + + VectorObject *vec1 = NULL, *vec2 = NULL; + + if VectorObject_Check(v1) + vec1= (VectorObject *)v1; + + if VectorObject_Check(v2) + vec2= (VectorObject *)v2; + + /* make sure v1 is always the vector */ + if (vec1 && vec2 ) { + /*VECTOR + VECTOR*/ + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Vector addition: vectors must have the same dimensions for this operation\n"); + return NULL; + } + for(i = 0; i < vec1->size; i++) { + vec[i] = vec1->vec[i] + vec2->vec[i]; + } + return newVectorObject(vec, vec1->size, Py_NEW); + } + + PyErr_SetString(PyExc_AttributeError, "Vector addition: arguments not valid for this operation....\n"); + return NULL; +} + +/* ------------------------obj += obj------------------------------ + addition in place */ +static PyObject *Vector_iadd(PyObject * v1, PyObject * v2) +{ + int i; + + VectorObject *vec1 = NULL, *vec2 = NULL; + + if VectorObject_Check(v1) + vec1= (VectorObject *)v1; + + if VectorObject_Check(v2) + vec2= (VectorObject *)v2; + + /* make sure v1 is always the vector */ + if (vec1 && vec2 ) { + /*VECTOR + VECTOR*/ + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Vector addition: vectors must have the same dimensions for this operation\n"); + return NULL; + } + for(i = 0; i < vec1->size; i++) { + vec1->vec[i] += vec2->vec[i]; + } + Py_INCREF( v1 ); + return v1; + } + + PyErr_SetString(PyExc_AttributeError, "Vector addition: arguments not valid for this operation....\n"); + return NULL; +} + +/*------------------------obj - obj------------------------------ + subtraction*/ +static PyObject *Vector_sub(PyObject * v1, PyObject * v2) +{ + int i; + float vec[4]; + VectorObject *vec1 = NULL, *vec2 = NULL; + + if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) { + PyErr_SetString(PyExc_AttributeError, "Vector subtraction: arguments not valid for this operation....\n"); + return NULL; + } + vec1 = (VectorObject*)v1; + vec2 = (VectorObject*)v2; + + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Vector subtraction: vectors must have the same dimensions for this operation\n"); + return NULL; + } + for(i = 0; i < vec1->size; i++) { + vec[i] = vec1->vec[i] - vec2->vec[i]; + } + + return newVectorObject(vec, vec1->size, Py_NEW); +} + +/*------------------------obj -= obj------------------------------ + subtraction*/ +static PyObject *Vector_isub(PyObject * v1, PyObject * v2) +{ + int i, size; + VectorObject *vec1 = NULL, *vec2 = NULL; + + if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) { + PyErr_SetString(PyExc_AttributeError, "Vector subtraction: arguments not valid for this operation....\n"); + return NULL; + } + vec1 = (VectorObject*)v1; + vec2 = (VectorObject*)v2; + + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Vector subtraction: vectors must have the same dimensions for this operation\n"); + return NULL; + } + + size = vec1->size; + for(i = 0; i < vec1->size; i++) { + vec1->vec[i] = vec1->vec[i] - vec2->vec[i]; + } + + Py_INCREF( v1 ); + return v1; +} + +/*------------------------obj * obj------------------------------ + mulplication*/ +static PyObject *Vector_mul(PyObject * v1, PyObject * v2) +{ + VectorObject *vec1 = NULL, *vec2 = NULL; + + if VectorObject_Check(v1) + vec1= (VectorObject *)v1; + + if VectorObject_Check(v2) + vec2= (VectorObject *)v2; + + /* make sure v1 is always the vector */ + if (vec1 && vec2 ) { + int i; + double dot = 0.0f; + + if(vec1->size != vec2->size) { + PyErr_SetString(PyExc_AttributeError, "Vector multiplication: vectors must have the same dimensions for this operation\n"); + return NULL; + } + + /*dot product*/ + for(i = 0; i < vec1->size; i++) { + dot += vec1->vec[i] * vec2->vec[i]; + } + return PyFloat_FromDouble(dot); + } + + /*swap so vec1 is always the vector */ + if (vec2) { + vec1= vec2; + v2= v1; + } + + if (PyNumber_Check(v2)) { + /* VEC * NUM */ + int i; + float vec[4]; + float scalar = (float)PyFloat_AsDouble( v2 ); + + for(i = 0; i < vec1->size; i++) { + vec[i] = vec1->vec[i] * scalar; + } + return newVectorObject(vec, vec1->size, Py_NEW); + + } else if (MatrixObject_Check(v2)) { + /* VEC * MATRIX */ + if (v1==v2) /* mat*vec, we have swapped the order */ + return column_vector_multiplication((MatrixObject*)v2, vec1); + else /* vec*mat */ + return row_vector_multiplication(vec1, (MatrixObject*)v2); + } else if (QuaternionObject_Check(v2)) { + QuaternionObject *quat = (QuaternionObject*)v2; + if(vec1->size != 3) { + PyErr_SetString(PyExc_TypeError, "Vector multiplication: only 3D vector rotations (with quats) currently supported\n"); + return NULL; + } + return quat_rotation((PyObject*)vec1, (PyObject*)quat); + } + + PyErr_SetString(PyExc_TypeError, "Vector multiplication: arguments not acceptable for this operation\n"); + return NULL; +} + +/*------------------------obj *= obj------------------------------ + in place mulplication */ +static PyObject *Vector_imul(PyObject * v1, PyObject * v2) +{ + VectorObject *vec = (VectorObject *)v1; + int i; + + /* only support vec*=float and vec*=mat + vec*=vec result is a float so that wont work */ + if (PyNumber_Check(v2)) { + /* VEC * NUM */ + float scalar = (float)PyFloat_AsDouble( v2 ); + + for(i = 0; i < vec->size; i++) { + vec->vec[i] *= scalar; + } + + Py_INCREF( v1 ); + return v1; + + } else if (MatrixObject_Check(v2)) { + float vecCopy[4]; + int x,y, size = vec->size; + MatrixObject *mat= (MatrixObject*)v2; + + if(mat->colSize != size){ + if(mat->rowSize == 4 && vec->size != 3){ + PyErr_SetString(PyExc_AttributeError, "vector * matrix: matrix column size and the vector size must be the same"); + return NULL; + } else { + vecCopy[3] = 1.0f; + } + } + + for(i = 0; i < size; i++){ + vecCopy[i] = vec->vec[i]; + } + + size = MIN2(size, mat->colSize); + + /*muliplication*/ + for(x = 0, i = 0; x < size; x++, i++) { + double dot = 0.0f; + for(y = 0; y < mat->rowSize; y++) { + dot += mat->matrix[y][x] * vecCopy[y]; + } + vec->vec[i] = (float)dot; + } + Py_INCREF( v1 ); + return v1; + } + PyErr_SetString(PyExc_TypeError, "Vector multiplication: arguments not acceptable for this operation\n"); + return NULL; +} + +/*------------------------obj / obj------------------------------ + divide*/ +static PyObject *Vector_div(PyObject * v1, PyObject * v2) +{ + int i, size; + float vec[4], scalar; + VectorObject *vec1 = NULL; + + if(!VectorObject_Check(v1)) { /* not a vector */ + PyErr_SetString(PyExc_TypeError, "Vector division: Vector must be divided by a float\n"); + return NULL; + } + vec1 = (VectorObject*)v1; /* vector */ + + if(!PyNumber_Check(v2)) { /* parsed item not a number */ + PyErr_SetString(PyExc_TypeError, "Vector division: Vector must be divided by a float\n"); + return NULL; + } + scalar = (float)PyFloat_AsDouble(v2); + + if(scalar==0.0) { /* not a vector */ + PyErr_SetString(PyExc_ZeroDivisionError, "Vector division: divide by zero error.\n"); + return NULL; + } + size = vec1->size; + for(i = 0; i < size; i++) { + vec[i] = vec1->vec[i] / scalar; + } + return newVectorObject(vec, size, Py_NEW); +} + +/*------------------------obj / obj------------------------------ + divide*/ +static PyObject *Vector_idiv(PyObject * v1, PyObject * v2) +{ + int i, size; + float scalar; + VectorObject *vec1 = NULL; + + /*if(!VectorObject_Check(v1)) { + PyErr_SetString(PyExc_TypeError, "Vector division: Vector must be divided by a float\n"); + return -1; + }*/ + + vec1 = (VectorObject*)v1; /* vector */ + + if(!PyNumber_Check(v2)) { /* parsed item not a number */ + PyErr_SetString(PyExc_TypeError, "Vector division: Vector must be divided by a float\n"); + return NULL; + } + + scalar = (float)PyFloat_AsDouble(v2); + + if(scalar==0.0) { /* not a vector */ + PyErr_SetString(PyExc_ZeroDivisionError, "Vector division: divide by zero error.\n"); + return NULL; + } + size = vec1->size; + for(i = 0; i < size; i++) { + vec1->vec[i] /= scalar; + } + Py_INCREF( v1 ); + return v1; +} + +/*-------------------------- -obj ------------------------------- + returns the negative of this object*/ +static PyObject *Vector_neg(VectorObject *self) +{ + int i; + float vec[4]; + for(i = 0; i < self->size; i++){ + vec[i] = -self->vec[i]; + } + + return newVectorObject(vec, self->size, Py_NEW); +} +/*------------------------coerce(obj, obj)----------------------- + coercion of unknown types to type VectorObject for numeric protocols + Coercion() is called whenever a math operation has 2 operands that + it doesn't understand how to evaluate. 2+Matrix for example. We want to + evaluate some of these operations like: (vector * 2), however, for math + to proceed, the unknown operand must be cast to a type that python math will + understand. (e.g. in the case above case, 2 must be cast to a vector and + then call vector.multiply(vector, scalar_cast_as_vector)*/ + + +static int Vector_coerce(PyObject ** v1, PyObject ** v2) +{ + /* Just incref, each functon must raise errors for bad types */ + Py_INCREF (*v1); + Py_INCREF (*v2); + return 0; +} + + +/*------------------------tp_doc*/ +static char VectorObject_doc[] = "This is a wrapper for vector objects."; +/*------------------------vec_magnitude_nosqrt (internal) - for comparing only */ +static double vec_magnitude_nosqrt(float *data, int size) +{ + double dot = 0.0f; + int i; + + for(i=0; isize != vecB->size){ + if (comparison_type == Py_NE){ + Py_RETURN_TRUE; + }else{ + Py_RETURN_FALSE; + } + } + + switch (comparison_type){ + case Py_LT: + lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size); + lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size); + if( lenA < lenB ){ + result = 1; + } + break; + case Py_LE: + lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size); + lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size); + if( lenA < lenB ){ + result = 1; + }else{ + result = (((lenA + epsilon) > lenB) && ((lenA - epsilon) < lenB)); + } + break; + case Py_EQ: + result = EXPP_VectorsAreEqual(vecA->vec, vecB->vec, vecA->size, 1); + break; + case Py_NE: + result = EXPP_VectorsAreEqual(vecA->vec, vecB->vec, vecA->size, 1); + if (result == 0){ + result = 1; + }else{ + result = 0; + } + break; + case Py_GT: + lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size); + lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size); + if( lenA > lenB ){ + result = 1; + } + break; + case Py_GE: + lenA = vec_magnitude_nosqrt(vecA->vec, vecA->size); + lenB = vec_magnitude_nosqrt(vecB->vec, vecB->size); + if( lenA > lenB ){ + result = 1; + }else{ + result = (((lenA + epsilon) > lenB) && ((lenA - epsilon) < lenB)); + } + break; + default: + printf("The result of the comparison could not be evaluated"); + break; + } + if (result == 1){ + Py_RETURN_TRUE; + }else{ + Py_RETURN_FALSE; + } +} +/*-----------------PROTCOL DECLARATIONS--------------------------*/ +static PySequenceMethods Vector_SeqMethods = { + (inquiry) Vector_len, /* sq_length */ + (binaryfunc) 0, /* sq_concat */ + (ssizeargfunc) 0, /* sq_repeat */ + (ssizeargfunc) Vector_item, /* sq_item */ + (ssizessizeargfunc) Vector_slice, /* sq_slice */ + (ssizeobjargproc) Vector_ass_item, /* sq_ass_item */ + (ssizessizeobjargproc) Vector_ass_slice, /* sq_ass_slice */ +}; + + +/* For numbers without flag bit Py_TPFLAGS_CHECKTYPES set, all + arguments are guaranteed to be of the object's type (modulo + coercion hacks -- i.e. if the type's coercion function + returns other types, then these are allowed as well). Numbers that + have the Py_TPFLAGS_CHECKTYPES flag bit set should check *both* + arguments for proper type and implement the necessary conversions + in the slot functions themselves. */ + +static PyNumberMethods Vector_NumMethods = { + (binaryfunc) Vector_add, /* __add__ */ + (binaryfunc) Vector_sub, /* __sub__ */ + (binaryfunc) Vector_mul, /* __mul__ */ + (binaryfunc) Vector_div, /* __div__ */ + (binaryfunc) NULL, /* __mod__ */ + (binaryfunc) NULL, /* __divmod__ */ + (ternaryfunc) NULL, /* __pow__ */ + (unaryfunc) Vector_neg, /* __neg__ */ + (unaryfunc) NULL, /* __pos__ */ + (unaryfunc) NULL, /* __abs__ */ + (inquiry) NULL, /* __nonzero__ */ + (unaryfunc) NULL, /* __invert__ */ + (binaryfunc) NULL, /* __lshift__ */ + (binaryfunc) NULL, /* __rshift__ */ + (binaryfunc) NULL, /* __and__ */ + (binaryfunc) NULL, /* __xor__ */ + (binaryfunc) NULL, /* __or__ */ +#if 0 //XXX 2.5 + (coercion) Vector_coerce, /* __coerce__ */ +#else + 0, +#endif + (unaryfunc) NULL, /* __int__ */ + (unaryfunc) NULL, /* __long__ */ + (unaryfunc) NULL, /* __float__ */ + (unaryfunc) NULL, /* __oct__ */ + (unaryfunc) NULL, /* __hex__ */ + + /* Added in release 2.0 */ + (binaryfunc) Vector_iadd, /*__iadd__*/ + (binaryfunc) Vector_isub, /*__isub__*/ + (binaryfunc) Vector_imul, /*__imul__*/ + (binaryfunc) Vector_idiv, /*__idiv__*/ + (binaryfunc) NULL, /*__imod__*/ + (ternaryfunc) NULL, /*__ipow__*/ + (binaryfunc) NULL, /*__ilshift__*/ + (binaryfunc) NULL, /*__irshift__*/ + (binaryfunc) NULL, /*__iand__*/ + (binaryfunc) NULL, /*__ixor__*/ + (binaryfunc) NULL, /*__ior__*/ + + /* Added in release 2.2 */ + /* The following require the Py_TPFLAGS_HAVE_CLASS flag */ + (binaryfunc) NULL, /*__floordiv__ __rfloordiv__*/ + (binaryfunc) NULL, /*__truediv__ __rfloordiv__*/ + (binaryfunc) NULL, /*__ifloordiv__*/ + (binaryfunc) NULL, /*__itruediv__*/ +}; +/*------------------PY_OBECT DEFINITION--------------------------*/ + +/* + * vector axis, vector.x/y/z/w + */ + +static PyObject *Vector_getAxis( VectorObject * self, void *type ) +{ + switch( (long)type ) { + case 'X': /* these are backwards, but that how it works */ + return PyFloat_FromDouble(self->vec[0]); + case 'Y': + return PyFloat_FromDouble(self->vec[1]); + case 'Z': /* these are backwards, but that how it works */ + if(self->size < 3) { + PyErr_SetString(PyExc_AttributeError, "vector.z: error, cannot get this axis for a 2D vector\n"); + return NULL; + } + else { + return PyFloat_FromDouble(self->vec[2]); + } + case 'W': + if(self->size < 4) { + PyErr_SetString(PyExc_AttributeError, "vector.w: error, cannot get this axis for a 3D vector\n"); + return NULL; + } + + return PyFloat_FromDouble(self->vec[3]); + default: + { + PyErr_SetString( PyExc_RuntimeError, "undefined type in Vector_getAxis" ); + return NULL; + } + } +} + +static int Vector_setAxis( VectorObject * self, PyObject * value, void * type ) +{ + float param= (float)PyFloat_AsDouble( value ); + + if (param==-1 && PyErr_Occurred()) { + PyErr_SetString( PyExc_TypeError, "expected a number for the vector axis" ); + return -1; + } + switch( (long)type ) { + case 'X': /* these are backwards, but that how it works */ + self->vec[0]= param; + break; + case 'Y': + self->vec[1]= param; + break; + case 'Z': /* these are backwards, but that how it works */ + if(self->size < 3) { + PyErr_SetString(PyExc_AttributeError, "vector.z: error, cannot get this axis for a 2D vector\n"); + return -1; + } + self->vec[2]= param; + break; + case 'W': + if(self->size < 4) { + PyErr_SetString(PyExc_AttributeError, "vector.w: error, cannot get this axis for a 3D vector\n"); + return -1; + } + self->vec[3]= param; + break; + } + + return 0; +} + +/* vector.length */ +static PyObject *Vector_getLength( VectorObject * self, void *type ) +{ + double dot = 0.0f; + int i; + + for(i = 0; i < self->size; i++){ + dot += (self->vec[i] * self->vec[i]); + } + return PyFloat_FromDouble(sqrt(dot)); +} + +static int Vector_setLength( VectorObject * self, PyObject * value ) +{ + double dot = 0.0f, param; + int i; + + if (!PyNumber_Check(value)) { + PyErr_SetString( PyExc_TypeError, "expected a number for the vector axis" ); + return -1; + } + param= PyFloat_AsDouble( value ); + + if (param < 0) { + PyErr_SetString( PyExc_TypeError, "cannot set a vectors length to a negative value" ); + return -1; + } + if (param==0) { + for(i = 0; i < self->size; i++){ + self->vec[i]= 0; + } + return 0; + } + + for(i = 0; i < self->size; i++){ + dot += (self->vec[i] * self->vec[i]); + } + + if (!dot) /* cant sqrt zero */ + return 0; + + dot = sqrt(dot); + + if (dot==param) + return 0; + + dot= dot/param; + + for(i = 0; i < self->size; i++){ + self->vec[i]= self->vec[i] / (float)dot; + } + + return 0; +} + +static PyObject *Vector_getWrapped( VectorObject * self, void *type ) +{ + if (self->wrapped == Py_WRAP) + Py_RETURN_TRUE; + else + Py_RETURN_FALSE; +} + + +/* Get a new Vector according to the provided swizzle. This function has little + error checking, as we are in control of the inputs: the closure is set by us + in Vector_createSwizzleGetSeter. */ +static PyObject *Vector_getSwizzle(VectorObject * self, void *closure) +{ + size_t axisA; + size_t axisB; + float vec[MAX_DIMENSIONS]; + unsigned int swizzleClosure; + + /* Unpack the axes from the closure into an array. */ + axisA = 0; + swizzleClosure = (unsigned int) closure; + while (swizzleClosure & SWIZZLE_VALID_AXIS) + { + axisB = swizzleClosure & SWIZZLE_AXIS; + vec[axisA] = self->vec[axisB]; + swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS; + axisA++; + } + + return newVectorObject(vec, axisA, Py_NEW); +} + +/* Set the items of this vector using a swizzle. + - If value is a vector or list this operates like an array copy, except that + the destination is effectively re-ordered as defined by the swizzle. At + most min(len(source), len(dest)) values will be copied. + - If the value is scalar, it is copied to all axes listed in the swizzle. + - If an axis appears more than once in the swizzle, the final occurrance is + the one that determines its value. + + Returns 0 on success and -1 on failure. On failure, the vector will be + unchanged. */ +static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closure) +{ + VectorObject *vecVal; + PyObject *item; + size_t listLen; + float scalarVal; + + size_t axisB; + size_t axisA; + unsigned int swizzleClosure; + + float vecTemp[MAX_DIMENSIONS]; + + /* Check that the closure can be used with this vector: even 2D vectors have + swizzles defined for axes z and w, but they would be invalid. */ + swizzleClosure = (unsigned int) closure; + while (swizzleClosure & SWIZZLE_VALID_AXIS) + { + axisA = swizzleClosure & SWIZZLE_AXIS; + if (axisA >= self->size) + { + PyErr_SetString(PyExc_AttributeError, "Error: vector does not have specified axis.\n"); + return -1; + } + swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS; + } + + if (VectorObject_Check(value)) + { + /* Copy vector contents onto swizzled axes. */ + vecVal = (VectorObject*) value; + axisB = 0; + swizzleClosure = (unsigned int) closure; + while (swizzleClosure & SWIZZLE_VALID_AXIS && axisB < vecVal->size) + { + axisA = swizzleClosure & SWIZZLE_AXIS; + vecTemp[axisA] = vecVal->vec[axisB]; + + swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS; + axisB++; + } + memcpy(self->vec, vecTemp, axisB * sizeof(float)); + return 0; + } + else if (PyList_Check(value)) + { + /* Copy list contents onto swizzled axes. */ + listLen = PyList_Size(value); + swizzleClosure = (unsigned int) closure; + axisB = 0; + while (swizzleClosure & SWIZZLE_VALID_AXIS && axisB < listLen) + { + item = PyList_GetItem(value, axisB); + if (!PyNumber_Check(item)) + { + PyErr_SetString(PyExc_AttributeError, "Error: vector does not have specified axis.\n"); + return -1; + } + scalarVal = (float)PyFloat_AsDouble(item); + + axisA = swizzleClosure & SWIZZLE_AXIS; + vecTemp[axisA] = scalarVal; + + swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS; + axisB++; + } + memcpy(self->vec, vecTemp, axisB * sizeof(float)); + return 0; + } + else if (PyNumber_Check(value)) + { + /* Assign the same value to each axis. */ + scalarVal = (float)PyFloat_AsDouble(value); + swizzleClosure = (unsigned int) closure; + while (swizzleClosure & SWIZZLE_VALID_AXIS) + { + axisA = swizzleClosure & SWIZZLE_AXIS; + self->vec[axisA] = scalarVal; + + swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS; + } + return 0; + } + else + { + PyErr_SetString( PyExc_TypeError, "Expected a Vector, list or scalar value." ); + return -1; + } +} + +/*****************************************************************************/ +/* Python attributes get/set structure: */ +/*****************************************************************************/ +static PyGetSetDef Vector_getseters[] = { + {"x", + (getter)Vector_getAxis, (setter)Vector_setAxis, + "Vector X axis", + (void *)'X'}, + {"y", + (getter)Vector_getAxis, (setter)Vector_setAxis, + "Vector Y axis", + (void *)'Y'}, + {"z", + (getter)Vector_getAxis, (setter)Vector_setAxis, + "Vector Z axis", + (void *)'Z'}, + {"w", + (getter)Vector_getAxis, (setter)Vector_setAxis, + "Vector Z axis", + (void *)'W'}, + {"length", + (getter)Vector_getLength, (setter)Vector_setLength, + "Vector Length", + NULL}, + {"magnitude", + (getter)Vector_getLength, (setter)Vector_setLength, + "Vector Length", + NULL}, + {"wrapped", + (getter)Vector_getWrapped, (setter)NULL, + "True when this wraps blenders internal data", + NULL}, + + /* autogenerated swizzle attrs, see python script below */ + {"xx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, Vector_swizzle_doc, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<= 2: + + for axis_0 in axises: + axis_0_pos = axis_pos[axis_0] + for axis_1 in axises: + axis_1_pos = axis_pos[axis_1] + axis_dict[axis_0+axis_1] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<2: + for axis_2 in axises: + axis_2_pos = axis_pos[axis_2] + axis_dict[axis_0+axis_1+axis_2] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<3: + for axis_3 in axises: + axis_3_pos = axis_pos[axis_3] + axis_dict[axis_0+axis_1+axis_2+axis_3] = '((%s|SWIZZLE_VALID_AXIS) | ((%s|SWIZZLE_VALID_AXIS)<= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif + /* For printing, in format "." */ + "Blender Vector", /* char *tp_name; */ + sizeof( VectorObject ), /* int tp_basicsize; */ + 0, /* tp_itemsize; For allocation */ + + /* Methods to implement standard operations */ + + ( destructor ) Vector_dealloc,/* destructor tp_dealloc; */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + NULL, /* cmpfunc tp_compare; */ + ( reprfunc ) Vector_repr, /* reprfunc tp_repr; */ + + /* Method suites for standard classes */ + + &Vector_NumMethods, /* PyNumberMethods *tp_as_number; */ + &Vector_SeqMethods, /* PySequenceMethods *tp_as_sequence; */ + NULL, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + + /*** Flags to define presence of optional/expanded features ***/ +#if 0 //XXX 2.5 + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES, /* long tp_flags; */ +#else + Py_TPFLAGS_DEFAULT, +#endif + + VectorObject_doc, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + (richcmpfunc)Vector_richcmpr, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + NULL, /* getiterfunc tp_iter; */ + NULL, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + Vector_methods, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + Vector_getseters, /* struct PyGetSetDef *tp_getset; */ + NULL, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + NULL, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; + + +/*------------------------newVectorObject (internal)------------- + creates a new vector object + pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER + (i.e. it was allocated elsewhere by MEM_mallocN()) + pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON + (i.e. it must be created here with PyMEM_malloc())*/ +PyObject *newVectorObject(float *vec, int size, int type) +{ + int i; + VectorObject *self = PyObject_NEW(VectorObject, &vector_Type); + + if(size > 4 || size < 2) + return NULL; + self->size = size; + + if(type == Py_WRAP) { + self->vec = vec; + self->wrapped = Py_WRAP; + } else if (type == Py_NEW) { + self->vec = PyMem_Malloc(size * sizeof(float)); + if(!vec) { /*new empty*/ + for(i = 0; i < size; i++){ + self->vec[i] = 0.0f; + } + if(size == 4) /* do the homogenous thing */ + self->vec[3] = 1.0f; + }else{ + for(i = 0; i < size; i++){ + self->vec[i] = vec[i]; + } + } + self->wrapped = Py_NEW; + }else{ /*bad type*/ + return NULL; + } + return (PyObject *) self; +} + +/* + #############################DEPRECATED################################ + ####################################################################### + ----------------------------Vector.negate() -------------------- + set the vector to it's negative -x, -y, -z */ +PyObject *Vector_Negate(VectorObject * self) +{ + int i; + for(i = 0; i < self->size; i++) { + self->vec[i] = -(self->vec[i]); + } + /*printf("Vector.negate(): Deprecated: use -vector instead\n");*/ + Py_INCREF(self); + return (PyObject*)self; +} +/*################################################################### + ###########################DEPRECATED##############################*/ diff --git a/source/blender/python/generic/vector.h b/source/blender/python/generic/vector.h new file mode 100644 index 00000000000..e53a0c1f24b --- /dev/null +++ b/source/blender/python/generic/vector.h @@ -0,0 +1,60 @@ +/* $Id: vector.h 20332 2009-05-22 03:22:56Z campbellbarton $ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): Willian P. Germano & Joseph Gilbert + * + * ***** END GPL LICENSE BLOCK ***** + * + */ + +#ifndef EXPP_vector_h +#define EXPP_vector_h + +#include + +extern PyTypeObject vector_Type; + +#define VectorObject_Check(v) (((PyObject *)v)->ob_type == &vector_Type) + +typedef struct { + PyObject_VAR_HEAD + float *vec; /*1D array of data (alias), wrapped status depends on wrapped status */ + short size; /* vec size 2,3 or 4 */ + short wrapped; /* is wrapped data? */ +} VectorObject; + +/*prototypes*/ +PyObject *Vector_Zero( VectorObject * self ); +PyObject *Vector_Normalize( VectorObject * self ); +PyObject *Vector_Negate( VectorObject * self ); +PyObject *Vector_Resize2D( VectorObject * self ); +PyObject *Vector_Resize3D( VectorObject * self ); +PyObject *Vector_Resize4D( VectorObject * self ); +PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ); +PyObject *Vector_Reflect( VectorObject * self, PyObject * value ); +PyObject *Vector_Cross( VectorObject * self, VectorObject * value ); +PyObject *Vector_Dot( VectorObject * self, VectorObject * value ); +PyObject *Vector_copy( VectorObject * self ); +PyObject *newVectorObject(float *vec, int size, int type); + +#endif /* EXPP_vector_h */ diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 22336bd4f71..0c063c0192b 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -36,6 +36,9 @@ #include "BPY_extern.h" +#include "../generic/bpy_internal_import.h" // our own imports + + void BPY_free_compiled_text( struct Text *text ) { if( text->compiled ) { @@ -131,10 +134,17 @@ void BPY_start_python( int argc, char **argv ) /* bpy.* and lets us import it */ bpy_init_modules(); + { /* our own import and reload functions */ + PyObject *item; + //PyObject *m = PyImport_AddModule("__builtin__"); + //PyObject *d = PyModule_GetDict(m); + PyObject *d = PyEval_GetBuiltins( ); + PyDict_SetItemString(d, "reload", item=PyCFunction_New(bpy_reload_meth, NULL)); Py_DECREF(item); + PyDict_SetItemString(d, "__import__", item=PyCFunction_New(bpy_import_meth, NULL)); Py_DECREF(item); + } py_tstate = PyGILState_GetThisThreadState(); PyEval_ReleaseThread(py_tstate); - } void BPY_end_python( void ) @@ -164,6 +174,7 @@ int BPY_run_python_script( bContext *C, const char *fn, struct Text *text, struc gilstate = PyGILState_Ensure(); BPY_update_modules(); /* can give really bad results if this isnt here */ + bpy_import_main_set(CTX_data_main(C)); py_dict = CreateGlobalDictionary(C); @@ -201,6 +212,7 @@ int BPY_run_python_script( bContext *C, const char *fn, struct Text *text, struc Py_DECREF(py_dict); PyGILState_Release(gilstate); + bpy_import_main_set(NULL); //BPY_end_python(); return py_result ? 1:0; @@ -387,6 +399,7 @@ void BPY_run_ui_scripts(bContext *C, int reload) // XXX - evil, need to access context BPy_SetContext(C); + bpy_import_main_set(CTX_data_main(C)); while((de = readdir(dir)) != NULL) { /* We could stat the file but easier just to let python @@ -421,6 +434,8 @@ void BPY_run_ui_scripts(bContext *C, int reload) PySys_SetObject("path", sys_path_orig); Py_DECREF(sys_path_orig); + bpy_import_main_set(NULL); + PyGILState_Release(gilstate); #ifdef TIME_REGISTRATION printf("script time %f\n", (PIL_check_seconds_timer()-time)); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 24fd0a512fb..736460d33db 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -42,6 +42,13 @@ #pragma warning (disable : 4786) #endif //WIN32 +extern "C" { + #include "bpy_internal_import.h" /* from the blender python api, but we want to import text too! */ + #include "Mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use. + #include "Geometry.h" // Blender.Geometry module copied here so the blenderlayer can use. + #include "BGL.h" +} + #include "KX_PythonInit.h" //python physics binding #include "KX_PyConstraintBinding.h" @@ -84,20 +91,9 @@ #include "KX_PythonInitTypes.h" -#if 0 //XXX25 - /* we only need this to get a list of libraries from the main struct */ #include "DNA_ID.h" -extern "C" { - #include "bpy_internal_import.h" /* from the blender python api, but we want to import text too! */ -#if PY_VERSION_HEX < 0x03000000 - #include "Mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use. - #include "Geometry.h" // Blender.Geometry module copied here so the blenderlayer can use. - #include "BGL.h" -#endif -} -#endif //XXX25 #include "marshal.h" /* python header for loading/saving dicts */ @@ -1380,10 +1376,9 @@ PyObject *KXpy_import(PyObject *self, PyObject *args) } /* Import blender texts as python modules */ - /* XXX 2.5 - * m= bpy_text_import(name, &found); + m= bpy_text_import(name, &found); if (m) - return m; */ + return m; if(found==0) /* if its found but could not import then it has its own error */ PyErr_Format(PyExc_ImportError, "Import of external Module %.20s not allowed.", name); @@ -1407,9 +1402,9 @@ PyObject *KXpy_reload(PyObject *self, PyObject *args) { if( !PyArg_ParseTuple( args, "O:bpy_reload_meth", &module ) ) return NULL; - /* XXX 2.5 newmodule= bpy_text_reimport( module, &found ); + newmodule= bpy_text_reimport( module, &found ); if (newmodule) - return newmodule; */ + return newmodule; if (found==0) /* if its found but could not import then it has its own error */ PyErr_SetString(PyExc_ImportError, "reload(module): failed to reload from blenders internal text"); @@ -1490,8 +1485,8 @@ void setSandbox(TPythonSecurityLevel level) */ default: /* Allow importing internal text, from bpy_internal_import.py */ - /* XXX 2.5 PyDict_SetItemString(d, "reload", item=PyCFunction_New(bpy_reload_meth, NULL)); Py_DECREF(item); */ - /* XXX 2.5 PyDict_SetItemString(d, "__import__", item=PyCFunction_New(bpy_import_meth, NULL)); Py_DECREF(item); */ + PyDict_SetItemString(d, "reload", item=PyCFunction_New(bpy_reload_meth, NULL)); Py_DECREF(item); + PyDict_SetItemString(d, "__import__", item=PyCFunction_New(bpy_import_meth, NULL)); Py_DECREF(item); break; } } @@ -1636,7 +1631,7 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur setSandbox(level); initPyTypes(); - /* XXX 2.5 bpy_import_main_set(maggie); */ + bpy_import_main_set(maggie); initPySysObjects(maggie); @@ -1654,7 +1649,7 @@ void exitGamePlayerPythonScripting() restorePySysObjects(); /* get back the original sys.path and clear the backup */ Py_Finalize(); - /* XXX 2.5 bpy_import_main_set(NULL); */ + bpy_import_main_set(NULL); PyObjectPlus::ClearDeprecationWarning(); } @@ -1675,7 +1670,7 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev setSandbox(level); initPyTypes(); - /* XXX 2.5 bpy_import_main_set(maggie); */ + bpy_import_main_set(maggie); initPySysObjects(maggie); @@ -1688,7 +1683,7 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev void exitGamePythonScripting() { restorePySysObjects(); /* get back the original sys.path and clear the backup */ - /* XXX 2.5 bpy_import_main_set(NULL); */ + bpy_import_main_set(NULL); PyObjectPlus::ClearDeprecationWarning(); } @@ -2000,28 +1995,20 @@ PyObject* initGameKeys() return d; } -#if PY_VERSION_HEX < 0x03000000 PyObject* initMathutils() { - return NULL; //XXX Mathutils_Init("Mathutils"); // Use as a top level module in BGE + return Mathutils_Init("Mathutils"); // Use as a top level module in BGE } PyObject* initGeometry() { - return NULL; // XXX Geometry_Init("Geometry"); // Use as a top level module in BGE + return Geometry_Init("Geometry"); // Use as a top level module in BGE } PyObject* initBGL() { - return NULL; // XXX 2.5 BGL_Init("BGL"); // Use as a top level module in BGE + return BGL_Init("BGL"); // Use as a top level module in BGE } -#else // TODO Py3k conversion -PyObject* initMathutils() {Py_INCREF(Py_None);return Py_None;} -PyObject* initGeometry() {Py_INCREF(Py_None);return Py_None;} -PyObject* initBGL() {Py_INCREF(Py_None);return Py_None;} -#endif - - void KX_SetActiveScene(class KX_Scene* scene) { diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index 5ab15c9eab3..5b6b8bba730 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -6,32 +6,29 @@ Import ('env') sources = env.Glob('*.cpp') defs = '' -# XXX 2.5 # Mathutils C files. -""" -if not env['BF_PYTHON_VERSION'].startswith('3'): + +if env['BF_PYTHON_VERSION'].startswith('3'): # TODO - py3 support sources.extend([\ - '#source/blender/python/api2_2x/Mathutils.c',\ - '#source/blender/python/api2_2x/Geometry.c',\ - '#source/blender/python/api2_2x/euler.c',\ - '#source/blender/python/api2_2x/matrix.c',\ - '#source/blender/python/api2_2x/quat.c',\ - '#source/blender/python/api2_2x/vector.c',\ - '#source/blender/python/api2_2x/constant.c',\ + '#source/blender/python/generic/Mathutils.c',\ + '#source/blender/python/generic/Geometry.c',\ + '#source/blender/python/generic/euler.c',\ + '#source/blender/python/generic/matrix.c',\ + '#source/blender/python/generic/quat.c',\ + '#source/blender/python/generic/vector.c',\ ]) sources.extend([\ - '#source/blender/python/api2_2x/BGL.c' + '#source/blender/python/generic/BGL.c' + ]) + + sources.extend([\ + '#source/blender/python/generic/bpy_internal_import.c' ]) - -sources.extend([\ - '#source/blender/python/api2_2x/bpy_internal_import.c' -]) -""" -incs = '. #source/blender/python/api2_2x' # Only for Mathutils! and bpy_internal_import.h, be very careful +incs = '. #source/blender/python/generic' # Only for Mathutils! and bpy_internal_import.h, be very careful incs += ' #source/kernel/gen_system #intern/string #intern/guardedalloc' incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer' -- cgit v1.2.3 From 7e57823c47761383a458665e923bb189e489c1f4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 18 Jun 2009 04:36:45 +0000 Subject: build generic modules in their own lib, compiling without the game engine would fail because bpy_internal_import.c wasnt being included. (scons only) --- source/blender/python/SConscript | 6 +++--- source/gameengine/Ketsji/SConscript | 22 ---------------------- 2 files changed, 3 insertions(+), 25 deletions(-) (limited to 'source') diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index 93b23a9c4cf..c974ebe1092 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -16,6 +16,6 @@ if env['OURPLATFORM'] in ('win32-mingw', 'win32-vc') and env['BF_DEBUG']: env.BlenderLib( libname = 'bf_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [140]) -# generic XXX todo, BGE currently uses these externally -# sources = env.Glob('generic/*.c') -# env.BlenderLib( libname = 'bf_gen_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [140]) +# generic +sources = env.Glob('generic/*.c') +env.BlenderLib( libname = 'bf_gen_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [361]) # ketsji is 360 diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index 5b6b8bba730..49dbacc8916 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -6,28 +6,6 @@ Import ('env') sources = env.Glob('*.cpp') defs = '' -# Mathutils C files. - -if env['BF_PYTHON_VERSION'].startswith('3'): - # TODO - py3 support - sources.extend([\ - '#source/blender/python/generic/Mathutils.c',\ - '#source/blender/python/generic/Geometry.c',\ - '#source/blender/python/generic/euler.c',\ - '#source/blender/python/generic/matrix.c',\ - '#source/blender/python/generic/quat.c',\ - '#source/blender/python/generic/vector.c',\ - ]) - - sources.extend([\ - '#source/blender/python/generic/BGL.c' - ]) - - sources.extend([\ - '#source/blender/python/generic/bpy_internal_import.c' - ]) - - incs = '. #source/blender/python/generic' # Only for Mathutils! and bpy_internal_import.h, be very careful incs += ' #source/kernel/gen_system #intern/string #intern/guardedalloc' -- cgit v1.2.3 From 5ea992df98d152f83072e886a0b1f9464a4883d6 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 18 Jun 2009 14:20:25 +0000 Subject: UI: * Fix context.cloth, was not being set correct. * Fix errors with context pinning, scripts should not assume context.object to be there. * Always show preview even if e.g. the material is not set, to keep ID buttons from jumping while you're using them. --- source/blender/editors/space_buttons/buttons_context.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 255bee1bf5a..42180e7902f 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -574,8 +574,14 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r return 1; } else if(CTX_data_equals(member, "cloth")) { - set_pointer_type(path, result, &RNA_ClothModifier); - return 1; + PointerRNA *ptr= get_pointer_type(path, &RNA_Object); + + if(ptr && ptr->data) { + Object *ob= ptr->data; + ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth); + CTX_data_pointer_set(result, &ob->id, &RNA_ClothModifier, md); + return 1; + } } else if(CTX_data_equals(member, "soft_body")) { PointerRNA *ptr= get_pointer_type(path, &RNA_Object); -- cgit v1.2.3 From 8130fb29b2a80a795fd891d2c9a74f86993221e2 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 18 Jun 2009 14:29:24 +0000 Subject: RNA: * Make cloth settings animateable from buttons. --- source/blender/makesrna/intern/rna_cloth.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index 919ae210801..361c1b61303 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -31,6 +31,8 @@ #include "rna_internal.h" #include "BKE_cloth.h" +#include "BKE_modifier.h" + #include "DNA_cloth_types.h" #ifdef RNA_RUNTIME @@ -129,6 +131,22 @@ static void rna_ClothSettings_gravity_set(PointerRNA *ptr, const float *values) sim->gravity[2]= values[2]; } +static char *rna_ClothSettings_path(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth); + + return BLI_sprintfN("modifiers[%s].settings", md->name); +} + +static char *rna_ClothCollisionSettings_path(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth); + + return BLI_sprintfN("modifiers[%s].collision_settings", md->name); +} + #else static void rna_def_cloth_sim_settings(BlenderRNA *brna) @@ -139,6 +157,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) srna = RNA_def_struct(brna, "ClothSettings", NULL); RNA_def_struct_ui_text(srna, "Cloth Settings", "Cloth simulation settings for an object."); RNA_def_struct_sdna(srna, "ClothSimSettings"); + RNA_def_struct_path_func(srna, "rna_ClothSettings_path"); /* goal */ @@ -297,6 +316,7 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna) srna = RNA_def_struct(brna, "ClothCollisionSettings", NULL); RNA_def_struct_ui_text(srna, "Cloth Collision Settings", "Cloth simulation settings for self collision and collision with other objects."); RNA_def_struct_sdna(srna, "ClothCollSettings"); + RNA_def_struct_path_func(srna, "rna_ClothCollisionSettings_path"); /* general collision */ -- cgit v1.2.3 From 2f48d0b46bc76e0f06cf499cf51aa833340a6c04 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 18 Jun 2009 15:31:14 +0000 Subject: Added Make for new python/generic dir. Also included GLEW. --- source/blender/python/Makefile | 2 +- source/blender/python/generic/Makefile | 66 ++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 source/blender/python/generic/Makefile (limited to 'source') diff --git a/source/blender/python/Makefile b/source/blender/python/Makefile index c830fbb3ccf..0c4b9ab6578 100644 --- a/source/blender/python/Makefile +++ b/source/blender/python/Makefile @@ -29,6 +29,6 @@ # Bounces make to subdirectories. SOURCEDIR = source/blender/python -DIRS = intern +DIRS = intern generic include nan_subdirs.mk diff --git a/source/blender/python/generic/Makefile b/source/blender/python/generic/Makefile new file mode 100644 index 00000000000..6e8e5bc1d2e --- /dev/null +++ b/source/blender/python/generic/Makefile @@ -0,0 +1,66 @@ +# +# $Id: Makefile 11904 2007-08-31 16:16:33Z sirdude $ +# +# ***** BEGIN GPL 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. +# +# 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. +# +# The Original Code is: all of this file. +# +# Contributor(s): none yet. +# +# ***** END GPL LICENSE BLOCK ***** +# +# + +LIBNAME = python +DIR = $(OCGDIR)/blender/$(LIBNAME) + +include nan_compile.mk + +CFLAGS += $(LEVEL_1_C_WARNINGS) + +# OpenGL and Python +CPPFLAGS += -I$(NAN_GLEW)/include +CPPFLAGS += $(OGL_CPPFLAGS) +CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) + +# PreProcessor stuff + +CPPFLAGS += -I$(NAN_GHOST)/include +CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include $(NAN_SDLCFLAGS) + +# modules +CPPFLAGS += -I../../editors/include +CPPFLAGS += -I../../python +CPPFLAGS += -I../../makesdna +CPPFLAGS += -I../../makesrna +CPPFLAGS += -I../../blenlib +CPPFLAGS += -I../../blenkernel +CPPFLAGS += -I../../nodes +CPPFLAGS += -I../../imbuf +CPPFLAGS += -I../../blenloader +CPPFLAGS += -I../../windowmanager +CPPFLAGS += -I../../render/extern/include + +# path to the guarded memory allocator +CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include +CPPFLAGS += -I$(NAN_MEMUTIL)/include + +# path to our own headerfiles +CPPFLAGS += -I.. -- cgit v1.2.3 From 122b206de35b72cd65934a3183331a93674559a2 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Thu, 18 Jun 2009 15:33:58 +0000 Subject: Fixing gl/glw.h compiiler error --- source/blender/python/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index c974ebe1092..4b62c912d34 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('intern/*.c') incs = '. ../editors/include ../makesdna ../makesrna ../blenlib ../blenkernel ../nodes' incs += ' ../imbuf ../blenloader ../render/extern/include ../windowmanager' -incs += ' #intern/guardedalloc #intern/memutil' +incs += ' #intern/guardedalloc #intern/memutil #/extern/glew/include' incs += ' ' + env['BF_PYTHON_INC'] defs = [] -- cgit v1.2.3 From 025b6dcbc3f6303e051354cbfb694ee810934979 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 18 Jun 2009 17:34:39 +0000 Subject: fix for building with py2.3 --- source/blender/python/generic/BGL.h | 1 + source/blender/python/generic/Mathutils.h | 1 + source/blender/python/generic/bpy_internal_import.h | 1 + source/blender/python/generic/euler.h | 1 + source/blender/python/generic/quat.h | 1 + source/blender/python/generic/vector.h | 1 + source/blender/python/intern/bpy_compat.h | 18 ++++++++++++++++++ source/gameengine/Expressions/ListValue.cpp | 1 + 8 files changed, 25 insertions(+) (limited to 'source') diff --git a/source/blender/python/generic/BGL.h b/source/blender/python/generic/BGL.h index 345536d64be..0e82ddf6d29 100755 --- a/source/blender/python/generic/BGL.h +++ b/source/blender/python/generic/BGL.h @@ -41,6 +41,7 @@ #endif #include +#include "../intern/bpy_compat.h" #include "BIF_gl.h" PyObject *BGL_Init( const char *from ); diff --git a/source/blender/python/generic/Mathutils.h b/source/blender/python/generic/Mathutils.h index 4c8153e5e54..173922fe09a 100644 --- a/source/blender/python/generic/Mathutils.h +++ b/source/blender/python/generic/Mathutils.h @@ -32,6 +32,7 @@ #define EXPP_Mathutils_H #include +#include "../intern/bpy_compat.h" #include "vector.h" #include "matrix.h" #include "quat.h" diff --git a/source/blender/python/generic/bpy_internal_import.h b/source/blender/python/generic/bpy_internal_import.h index 9c3ce572cc4..475ec8dd118 100644 --- a/source/blender/python/generic/bpy_internal_import.h +++ b/source/blender/python/generic/bpy_internal_import.h @@ -32,6 +32,7 @@ #define EXPP_bpy_import_h #include +#include "../intern/bpy_compat.h" #include "compile.h" /* for the PyCodeObject */ #include "eval.h" /* for PyEval_EvalCode */ diff --git a/source/blender/python/generic/euler.h b/source/blender/python/generic/euler.h index f94f060a61d..773b024f174 100644 --- a/source/blender/python/generic/euler.h +++ b/source/blender/python/generic/euler.h @@ -32,6 +32,7 @@ #define EXPP_euler_h #include +#include "../intern/bpy_compat.h" extern PyTypeObject euler_Type; diff --git a/source/blender/python/generic/quat.h b/source/blender/python/generic/quat.h index f98665ded55..8a4602c1d8e 100644 --- a/source/blender/python/generic/quat.h +++ b/source/blender/python/generic/quat.h @@ -32,6 +32,7 @@ #define EXPP_quat_h #include +#include "../intern/bpy_compat.h" extern PyTypeObject quaternion_Type; diff --git a/source/blender/python/generic/vector.h b/source/blender/python/generic/vector.h index e53a0c1f24b..930e987fcc7 100644 --- a/source/blender/python/generic/vector.h +++ b/source/blender/python/generic/vector.h @@ -31,6 +31,7 @@ #define EXPP_vector_h #include +#include "../intern/bpy_compat.h" extern PyTypeObject vector_Type; diff --git a/source/blender/python/intern/bpy_compat.h b/source/blender/python/intern/bpy_compat.h index ad6b7a5e85c..3a2d4bda84c 100644 --- a/source/blender/python/intern/bpy_compat.h +++ b/source/blender/python/intern/bpy_compat.h @@ -88,6 +88,24 @@ typedef Py_ssize_t (*lenfunc)(PyObject *); #endif +#ifndef ssizeargfunc +#define ssizeargfunc intargfunc +#endif + +#ifndef ssizessizeargfunc +#define ssizessizeargfunc intintargfunc +#endif + +#ifndef ssizeobjargproc +#define ssizeobjargproc intobjargproc +#endif + +#ifndef ssizessizeobjargproc +#define ssizessizeobjargproc intintobjargproc +#endif + + + /* defined in bpy_util.c */ #if PY_VERSION_HEX < 0x03000000 PyObject *Py_CmpToRich(int op, int cmp); diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index ea097ddff5b..d3df36fbff0 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -18,6 +18,7 @@ #include "StringValue.h" #include "VoidValue.h" #include +#include #include "BoolValue.h" #ifdef HAVE_CONFIG_H -- cgit v1.2.3 From 89d2559e6dbde26acdd45e3fe9d6eff2c62d98c0 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 18 Jun 2009 19:25:58 +0000 Subject: 2.5 * Update cmake and makefiles to link python generic. * Fix game engine building for cmake and makefiles. * Fix compile error with py 3.x, due to 2.x compat fix. --- source/Makefile | 1 + source/blender/python/SConscript | 2 +- source/blender/python/generic/BGL.h | 2 +- source/blender/python/generic/Makefile | 2 +- source/blender/python/intern/Makefile | 1 + source/blender/python/intern/bpy_compat.h | 2 ++ source/creator/CMakeLists.txt | 2 ++ source/gameengine/Converter/CMakeLists.txt | 1 + source/gameengine/Converter/Makefile | 1 + source/gameengine/Ketsji/CMakeLists.txt | 3 ++- source/gameengine/Ketsji/Makefile | 2 +- 11 files changed, 14 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/Makefile b/source/Makefile index 94446f4d1d5..2df57f58c73 100644 --- a/source/Makefile +++ b/source/Makefile @@ -162,6 +162,7 @@ COMLIB += $(OCGDIR)/blender/makesdna/$(DEBUG_DIR)libdna.a COMLIB += $(NAN_GUARDEDALLOC)/lib/libguardedalloc.a COMLIB += $(NAN_MEMUTIL)/lib/libmemutil.a COMLIB += $(NAN_PNG)/lib/libpng.a +COMLIB += $(OCGDIR)/blender/gen_python/$(DEBUG_DIR)libgen_python.a ifeq ($(WITH_QUICKTIME), true) COMLIB += $(OCGDIR)/blender/blenderqt/$(DEBUG_DIR)libblenderqt.a diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index 4b62c912d34..73dc171fc3e 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('intern/*.c') incs = '. ../editors/include ../makesdna ../makesrna ../blenlib ../blenkernel ../nodes' incs += ' ../imbuf ../blenloader ../render/extern/include ../windowmanager' -incs += ' #intern/guardedalloc #intern/memutil #/extern/glew/include' +incs += ' #intern/guardedalloc #intern/memutil #extern/glew/include' incs += ' ' + env['BF_PYTHON_INC'] defs = [] diff --git a/source/blender/python/generic/BGL.h b/source/blender/python/generic/BGL.h index 0e82ddf6d29..e2d1b0bb495 100755 --- a/source/blender/python/generic/BGL.h +++ b/source/blender/python/generic/BGL.h @@ -41,8 +41,8 @@ #endif #include +#include #include "../intern/bpy_compat.h" -#include "BIF_gl.h" PyObject *BGL_Init( const char *from ); diff --git a/source/blender/python/generic/Makefile b/source/blender/python/generic/Makefile index 6e8e5bc1d2e..20cf7f19ec7 100644 --- a/source/blender/python/generic/Makefile +++ b/source/blender/python/generic/Makefile @@ -28,7 +28,7 @@ # # -LIBNAME = python +LIBNAME = gen_python DIR = $(OCGDIR)/blender/$(LIBNAME) include nan_compile.mk diff --git a/source/blender/python/intern/Makefile b/source/blender/python/intern/Makefile index 3e28f5aac31..0c4a540a4bd 100644 --- a/source/blender/python/intern/Makefile +++ b/source/blender/python/intern/Makefile @@ -37,6 +37,7 @@ CFLAGS += $(LEVEL_1_C_WARNINGS) # OpenGL and Python CPPFLAGS += $(OGL_CPPFLAGS) +CPPFLAGS += -I$(NAN_GLEW)/include CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) # PreProcessor stuff diff --git a/source/blender/python/intern/bpy_compat.h b/source/blender/python/intern/bpy_compat.h index 3a2d4bda84c..1ad9376c13b 100644 --- a/source/blender/python/intern/bpy_compat.h +++ b/source/blender/python/intern/bpy_compat.h @@ -88,6 +88,7 @@ typedef Py_ssize_t (*lenfunc)(PyObject *); #endif +#if PY_VERSION_HEX < 0x03000000 #ifndef ssizeargfunc #define ssizeargfunc intargfunc #endif @@ -103,6 +104,7 @@ typedef Py_ssize_t (*lenfunc)(PyObject *); #ifndef ssizessizeobjargproc #define ssizessizeobjargproc intintobjargproc #endif +#endif diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 221c0a92e09..4701eba810f 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -221,6 +221,7 @@ IF(UNIX) blender_radiosity blender_ONL bf_python + bf_gen_python bf_blenkernel bf_nodes bf_gpu @@ -269,6 +270,7 @@ IF(UNIX) extern_qhull bf_moto bf_python + bf_gen_python bf_quicktime extern_binreloc extern_glew diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt index 44692241e6f..031c2234ea8 100644 --- a/source/gameengine/Converter/CMakeLists.txt +++ b/source/gameengine/Converter/CMakeLists.txt @@ -49,6 +49,7 @@ SET(INC ../../../source/blender ../../../source/blender/include ../../../source/blender/makesdna + ../../../source/blender/makesrna ../../../source/gameengine/Rasterizer ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer ../../../source/gameengine/GameLogic diff --git a/source/gameengine/Converter/Makefile b/source/gameengine/Converter/Makefile index 938994e8b62..abded70f289 100644 --- a/source/gameengine/Converter/Makefile +++ b/source/gameengine/Converter/Makefile @@ -48,6 +48,7 @@ CPPFLAGS += -I../../blender CPPFLAGS += -I../../blender/windowmanager CPPFLAGS += -I../../blender/imbuf CPPFLAGS += -I../../blender/makesdna +CPPFLAGS += -I../../blender/makesrna CPPFLAGS += -I../../blender/editors/include CPPFLAGS += -I../../blender/blenlib CPPFLAGS += -I../../blender/blenkernel diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt index 4aaa49a8493..ee1ff2c6502 100644 --- a/source/gameengine/Ketsji/CMakeLists.txt +++ b/source/gameengine/Ketsji/CMakeLists.txt @@ -53,7 +53,8 @@ SET(INC ../../../source/gameengine/Ketsji ../../../source/blender/blenlib ../../../source/blender/blenkernel - ../../../source/blender/python/api2_2x + ../../../source/blender/python + ../../../source/blender/python/generic ../../../source/blender ../../../source/blender/include ../../../source/blender/makesdna diff --git a/source/gameengine/Ketsji/Makefile b/source/gameengine/Ketsji/Makefile index bdc0b335b02..59b3ff178fb 100644 --- a/source/gameengine/Ketsji/Makefile +++ b/source/gameengine/Ketsji/Makefile @@ -41,7 +41,7 @@ CPPFLAGS += -I$(NAN_GLEW)/include CPPFLAGS += -I$(OPENGL_HEADERS) CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) CPPFLAGS += -I../../blender/python -CPPFLAGS += -I../../blender/python/api2_2x +CPPFLAGS += -I../../blender/python/generic CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_SUMO) -I$(NAN_MOTO)/include -- cgit v1.2.3 From 4cd24cf05809557e0d620dccf1f19a570784f6fe Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 18 Jun 2009 19:48:55 +0000 Subject: RNA Merging changes made by Arystanbek in the soc-2009-kazanbas branch, plus some things modified and added by me. * The API files now all in the makesrna module, convention is to call them e.g. rna_mesh_api.c for rna_mesh.c. Note for visual studio build maintainers, the rna_*_api.c files are compiled as part of "makesrna", but do not have rna_*_gen.c generated as part of the library. SCons/cmake/make were updated. * Added function flags FUNC_USE_CONTEXT and FUNC_USE_REPORTS, to allow RNA functions to get context and error reporting parameters optionally. Renamed FUNC_TYPESTATIC to FUNC_NO_SELF. * RNA collections now have a pointer to add/remove FunctionRNA's, this isn't actually used anywhere yet, purpose is to make an alias main.meshes.add() for main.add_mesh() in python. * Fixes to make autogenerating property set/get for multidimensional arrays work, though a 4x4 matrix will be exposed as a length 16 one dimensional RNA array. * Functions and properties added: * Main.add_mesh() * Main.remove_mesh() * Object.matrix * Object.create_render_mesh() * WindowManager.add_fileselect() --- source/blender/editors/interface/interface_api.c | 245 -------------------- source/blender/editors/space_script/space_script.c | 21 +- source/blender/makesrna/RNA_access.h | 13 +- source/blender/makesrna/RNA_define.h | 2 +- source/blender/makesrna/RNA_types.h | 10 +- source/blender/makesrna/intern/CMakeLists.txt | 3 +- source/blender/makesrna/intern/Makefile | 23 +- source/blender/makesrna/intern/SConscript | 7 +- source/blender/makesrna/intern/makesrna.c | 203 ++++++++++------- source/blender/makesrna/intern/rna_ID.c | 6 - source/blender/makesrna/intern/rna_access.c | 50 ++-- source/blender/makesrna/intern/rna_color.c | 2 +- source/blender/makesrna/intern/rna_curve.c | 2 +- source/blender/makesrna/intern/rna_define.c | 6 +- source/blender/makesrna/intern/rna_group.c | 2 +- source/blender/makesrna/intern/rna_internal.h | 4 + .../blender/makesrna/intern/rna_internal_types.h | 1 + source/blender/makesrna/intern/rna_key.c | 2 +- source/blender/makesrna/intern/rna_lattice.c | 4 +- source/blender/makesrna/intern/rna_main.c | 6 +- source/blender/makesrna/intern/rna_main_api.c | 81 +++++++ source/blender/makesrna/intern/rna_material.c | 2 +- source/blender/makesrna/intern/rna_mesh.c | 25 +- source/blender/makesrna/intern/rna_mesh_api.c | 108 +++++++++ source/blender/makesrna/intern/rna_modifier.c | 2 +- source/blender/makesrna/intern/rna_object.c | 14 +- source/blender/makesrna/intern/rna_object_api.c | 83 +++++++ source/blender/makesrna/intern/rna_rna.c | 10 +- source/blender/makesrna/intern/rna_scene.c | 2 +- source/blender/makesrna/intern/rna_sequence.c | 2 +- source/blender/makesrna/intern/rna_ui_api.c | 251 +++++++++++++++++++++ source/blender/makesrna/intern/rna_wm.c | 2 + source/blender/makesrna/intern/rna_wm_api.c | 56 +++++ source/blender/python/CMakeLists.txt | 4 + source/blender/python/intern/bpy_rna.c | 16 +- 35 files changed, 839 insertions(+), 431 deletions(-) delete mode 100644 source/blender/editors/interface/interface_api.c create mode 100644 source/blender/makesrna/intern/rna_main_api.c create mode 100644 source/blender/makesrna/intern/rna_mesh_api.c create mode 100644 source/blender/makesrna/intern/rna_object_api.c create mode 100644 source/blender/makesrna/intern/rna_ui_api.c create mode 100644 source/blender/makesrna/intern/rna_wm_api.c (limited to 'source') diff --git a/source/blender/editors/interface/interface_api.c b/source/blender/editors/interface/interface_api.c deleted file mode 100644 index 31b0b85fae6..00000000000 --- a/source/blender/editors/interface/interface_api.c +++ /dev/null @@ -1,245 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL 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. - * - * 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) 2009 Blender Foundation. - * All rights reserved. - * - * - * Contributor(s): Blender Foundation - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include - -#include "RNA_define.h" -#include "RNA_types.h" - -#include "UI_interface.h" -#include "UI_resources.h" - -#define DEF_ICON(name) {name, #name, 0, #name, ""}, -static EnumPropertyItem icon_items[] = { -#include "UI_icons.h" - {0, NULL, 0, NULL, NULL}}; -#undef DEF_ICON - -static void api_ui_item_common(FunctionRNA *func) -{ - PropertyRNA *prop; - - RNA_def_string(func, "text", "", 0, "", "Override automatic text of the item."); - - prop= RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, icon_items); - RNA_def_property_ui_text(prop, "Icon", "Override automatic icon of the item."); - -} - -static void api_ui_item_op_common(FunctionRNA *func) -{ - PropertyRNA *parm; - - api_ui_item_common(func); - parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator."); - RNA_def_property_flag(parm, PROP_REQUIRED); -} - -static void api_ui_item_rna_common(FunctionRNA *func) -{ - PropertyRNA *parm; - - parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data."); - RNA_def_property_flag(parm, PROP_REQUIRED); -} - -void RNA_api_ui_layout(StructRNA *srna) -{ - FunctionRNA *func; - PropertyRNA *parm; - - static EnumPropertyItem curve_type_items[] = { - {0, "NONE", 0, "None", ""}, - {'v', "VECTOR", 0, "Vector", ""}, - {'c', "COLOR", 0, "Color", ""}, - {0, NULL, 0, NULL, NULL}}; - - /* simple layout specifiers */ - func= RNA_def_function(srna, "row", "uiLayoutRow"); - parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); - RNA_def_function_return(func, parm); - RNA_def_boolean(func, "align", 0, "", "Align buttons to each other."); - - func= RNA_def_function(srna, "column", "uiLayoutColumn"); - parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); - RNA_def_function_return(func, parm); - RNA_def_boolean(func, "align", 0, "", "Align buttons to each other."); - - func= RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow"); - parm= RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic.", 0, INT_MAX); - parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); - RNA_def_function_return(func, parm); - RNA_def_boolean(func, "align", 0, "", "Align buttons to each other."); - - /* box layout */ - func= RNA_def_function(srna, "box", "uiLayoutBox"); - parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); - RNA_def_function_return(func, parm); - - /* split layout */ - func= RNA_def_function(srna, "split", "uiLayoutSplit"); - parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); - RNA_def_function_return(func, parm); - RNA_def_float(func, "percentage", 0.5f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at.", 0.0f, 1.0f); - - /* items */ - func= RNA_def_function(srna, "itemR", "uiItemR"); - api_ui_item_common(func); - api_ui_item_rna_common(func); - RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); - RNA_def_boolean(func, "slider", 0, "", "Use slider widget for numeric values."); - RNA_def_boolean(func, "toggle", 0, "", "Use toggle widget for boolean values."); - - func= RNA_def_function(srna, "items_enumR", "uiItemsEnumR"); - api_ui_item_rna_common(func); - - func= RNA_def_function(srna, "item_menu_enumR", "uiItemMenuEnumR"); - api_ui_item_common(func); - api_ui_item_rna_common(func); - - /*func= RNA_def_function(srna, "item_enumR", "uiItemEnumR"); - api_ui_item_common(func); - api_ui_item_rna_common(func); - parm= RNA_def_string(func, "value", "", 0, "", "Enum property value."); - RNA_def_property_flag(parm, PROP_REQUIRED);*/ - - func= RNA_def_function(srna, "itemO", "uiItemO"); - api_ui_item_op_common(func); - - func= RNA_def_function(srna, "item_enumO", "uiItemEnumO_string"); - api_ui_item_op_common(func); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "value", "", 0, "", "Enum property value."); - RNA_def_property_flag(parm, PROP_REQUIRED); - - func= RNA_def_function(srna, "items_enumO", "uiItemsEnumO"); - parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); - RNA_def_property_flag(parm, PROP_REQUIRED); - - func= RNA_def_function(srna, "item_menu_enumO", "uiItemMenuEnumO"); - api_ui_item_op_common(func); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); - RNA_def_property_flag(parm, PROP_REQUIRED); - - func= RNA_def_function(srna, "item_booleanO", "uiItemBooleanO"); - api_ui_item_op_common(func); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_boolean(func, "value", 0, "", "Value of the property to call the operator with."); - RNA_def_property_flag(parm, PROP_REQUIRED); - - func= RNA_def_function(srna, "item_intO", "uiItemIntO"); - api_ui_item_op_common(func); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_int(func, "value", 0, INT_MIN, INT_MAX, "", "Value of the property to call the operator with.", INT_MIN, INT_MAX); - RNA_def_property_flag(parm, PROP_REQUIRED); - - func= RNA_def_function(srna, "item_floatO", "uiItemFloatO"); - api_ui_item_op_common(func); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_float(func, "value", 0, -FLT_MAX, FLT_MAX, "", "Value of the property to call the operator with.", -FLT_MAX, FLT_MAX); - RNA_def_property_flag(parm, PROP_REQUIRED); - - func= RNA_def_function(srna, "item_stringO", "uiItemStringO"); - api_ui_item_op_common(func); - parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_string(func, "value", "", 0, "", "Value of the property to call the operator with."); - RNA_def_property_flag(parm, PROP_REQUIRED); - - func= RNA_def_function(srna, "itemL", "uiItemL"); - api_ui_item_common(func); - - func= RNA_def_function(srna, "itemM", "uiItemM"); - parm= RNA_def_pointer(func, "context", "Context", "", "Current context."); - RNA_def_property_flag(parm, PROP_REQUIRED); - api_ui_item_common(func); - parm= RNA_def_string(func, "menu", "", 0, "", "Identifier of the menu."); - RNA_def_property_flag(parm, PROP_REQUIRED); - - func= RNA_def_function(srna, "itemS", "uiItemS"); - - /* context */ - func= RNA_def_function(srna, "set_context_pointer", "uiLayoutSetContextPointer"); - parm= RNA_def_string(func, "name", "", 0, "Name", "Name of entry in the context."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context."); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); - - /* templates */ - func= RNA_def_function(srna, "template_header", "uiTemplateHeader"); - parm= RNA_def_pointer(func, "context", "Context", "", "Current context."); - RNA_def_property_flag(parm, PROP_REQUIRED); - - func= RNA_def_function(srna, "template_ID", "uiTemplateID"); - parm= RNA_def_pointer(func, "context", "Context", "", "Current context."); - RNA_def_property_flag(parm, PROP_REQUIRED); - api_ui_item_rna_common(func); - RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block."); - RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a new ID block."); - RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block."); - - func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier"); - parm= RNA_def_pointer(func, "data", "Modifier", "", "Modifier data."); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); - parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); - RNA_def_function_return(func, parm); - - func= RNA_def_function(srna, "template_constraint", "uiTemplateConstraint"); - parm= RNA_def_pointer(func, "data", "Constraint", "", "Constraint data."); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); - parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); - RNA_def_function_return(func, parm); - - func= RNA_def_function(srna, "template_preview", "uiTemplatePreview"); - parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock."); - RNA_def_property_flag(parm, PROP_REQUIRED); - - func= RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping"); - parm= RNA_def_pointer(func, "curvemap", "CurveMapping", "", "Curve mapping pointer."); - RNA_def_property_flag(parm, PROP_REQUIRED); - RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display."); - - func= RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp"); - parm= RNA_def_pointer(func, "ramp", "ColorRamp", "", "Color ramp pointer."); - RNA_def_property_flag(parm, PROP_REQUIRED); - RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); - - func= RNA_def_function(srna, "template_layers", "uiTemplateLayers"); - api_ui_item_rna_common(func); -} - diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c index 4c17ed16475..99233cc5020 100644 --- a/source/blender/editors/space_script/space_script.c +++ b/source/blender/editors/space_script/space_script.c @@ -175,29 +175,12 @@ static void script_main_area_draw(const bContext *C, ARegion *ar) /* add handlers, stuff you only do once or on area/region changes */ static void script_header_area_init(wmWindowManager *wm, ARegion *ar) { - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); + ED_region_header_init(ar); } static void script_header_area_draw(const bContext *C, ARegion *ar) { - float col[3]; - - /* clear */ - if(ED_screen_area_active(C)) - UI_GetThemeColor3fv(TH_HEADER, col); - else - UI_GetThemeColor3fv(TH_HEADERDESEL, col); - - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - /* set view2d view matrix for scrolling (without scrollers) */ - UI_view2d_view_ortho(C, &ar->v2d); - - script_header_buttons(C, ar); - - /* restore view matrix? */ - UI_view2d_view_restore(C); + ED_region_header(C, ar); } static void script_main_area_listener(ARegion *ar, wmNotifier *wmn) diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index f7b069d8227..1907b2cedb4 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -37,6 +37,7 @@ extern "C" { struct bContext; struct ID; struct Main; +struct ReportList; /* Types */ @@ -719,13 +720,13 @@ void RNA_parameter_get_lookup(ParameterList *parms, const char *identifier, void void RNA_parameter_set(ParameterList *parms, PropertyRNA *parm, void *value); void RNA_parameter_set_lookup(ParameterList *parms, const char *identifier, void *value); -int RNA_function_call(PointerRNA *ptr, FunctionRNA *func, ParameterList *parms); -int RNA_function_call_lookup(PointerRNA *ptr, const char *identifier, ParameterList *parms); +int RNA_function_call(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms); +int RNA_function_call_lookup(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, const char *identifier, ParameterList *parms); -int RNA_function_call_direct(PointerRNA *ptr, FunctionRNA *func, const char *format, ...); -int RNA_function_call_direct_lookup(PointerRNA *ptr, const char *identifier, const char *format, ...); -int RNA_function_call_direct_va(PointerRNA *ptr, FunctionRNA *func, const char *format, va_list args); -int RNA_function_call_direct_va_lookup(PointerRNA *ptr, const char *identifier, const char *format, va_list args); +int RNA_function_call_direct(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, FunctionRNA *func, const char *format, ...); +int RNA_function_call_direct_lookup(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, const char *identifier, const char *format, ...); +int RNA_function_call_direct_va(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, FunctionRNA *func, const char *format, va_list args); +int RNA_function_call_direct_va_lookup(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, const char *identifier, const char *format, va_list args); /* ID */ diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index 6cd8cce59a3..dfe072c4b8e 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -147,7 +147,7 @@ void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item); void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set); void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *typef); -void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring); +void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *add, const char *remove); /* Function */ diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index b527a4f11b3..75f52ededd0 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -161,11 +161,13 @@ typedef struct ParameterIterator { /* Function */ typedef enum FunctionFlag { - FUNC_TYPESTATIC = 1, /* for static functions, FUNC_ STATIC is taken by some windows header it seems */ + FUNC_NO_SELF = 1, /* for static functions */ + FUNC_USE_CONTEXT = 2, + FUNC_USE_REPORTS = 4, /* registering */ - FUNC_REGISTER = 2, - FUNC_REGISTER_OPTIONAL = 2|4, + FUNC_REGISTER = 8, + FUNC_REGISTER_OPTIONAL = 8|16, /* internal flags */ FUNC_BUILTIN = 128, @@ -173,7 +175,7 @@ typedef enum FunctionFlag { FUNC_RUNTIME = 512 } FunctionFlag; -typedef void (*CallFunc)(PointerRNA *ptr, ParameterList *parms); +typedef void (*CallFunc)(struct bContext *C, struct ReportList *reports, PointerRNA *ptr, ParameterList *parms); typedef struct FunctionRNA FunctionRNA; diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 2914e488efa..963e4f9aeff 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -25,8 +25,9 @@ # ***** END GPL LICENSE BLOCK ***** FILE(GLOB DEFSRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c") +FILE(GLOB APISRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*_api.c") LIST(REMOVE_ITEM DEFSRC rna_access.c rna_define.c makesrna.c) -FILE(GLOB_RECURSE APISRC "../../editors/*/*_api.c") +LIST(REMOVE_ITEM DEFSRC ${APISRC}) STRING(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}") diff --git a/source/blender/makesrna/intern/Makefile b/source/blender/makesrna/intern/Makefile index 78757c4f4b5..03f75f0bea6 100644 --- a/source/blender/makesrna/intern/Makefile +++ b/source/blender/makesrna/intern/Makefile @@ -28,10 +28,11 @@ DIR = $(OCGDIR)/blender/makesrna ALLRNA = $(wildcard rna_*.c) DEFRNA = $(filter-out %rna_define.c, $(filter-out %rna_access.c, $(ALLRNA))) -GENSRCS = $(patsubst rna_%.c, rna_%_gen.c, $(DEFRNA)) +GENRNA = $(filter-out %_api.c, $(DEFRNA)) +GENSRCS = $(patsubst rna_%.c, rna_%_gen.c, $(GENRNA)) GENTARGET = $(patsubst %.c, $(DIR)/$(DEBUG_DIR)%.c, $(GENSRCS)) -MAKESRCS = $(DEFRNA) makesrna.c rna_define.c $(wildcard ../../editors/*/*_api.c) +MAKESRCS = $(DEFRNA) makesrna.c rna_define.c MAKEOBJS = $(patsubst %.c, $(DIR)/$(DEBUG_DIR)%.o, $(notdir $(MAKESRCS))) CSRCS = $(GENSRCS) rna_access.c @@ -94,24 +95,6 @@ clean:: # TODO include right .mk for ldflags -# XXX this is an ugly hack, copying code from nan_compile.mk -# we want the .o's to be in the makesrna/ directory, but the -# .c's are in the editors/*/ directories - -$(DIR)/$(DEBUG_DIR)%_api.o: ../../editors/interface/%_api.c - ifdef NAN_DEPEND - @set -e; $(CC) -M $(CPPFLAGS) $< 2>/dev/null \ - | sed 's@\($*\)\.o[ :]*@$(DIR)/$(DEBUG_DIR)\1.o : @g' \ - > $(DIR)/$(DEBUG_DIR)$*.d; \ - [ -s $(DIR)/$(DEBUG_DIR)$*.d ] || $(RM) $(DIR)/$*.d - endif - ifdef NAN_QUIET - @echo " -- $< -- " - @$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ - else - $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ - endif - # A small note: we do not use the debug version of the alloc lib. That # is done quite intentionally. If there is a bug in that lib, it needs # to be fixed by the module maintainer. diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 041f743a056..03f0afdb2cc 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -16,9 +16,12 @@ source_files.remove('rna_access.c') generated_files = source_files[:] generated_files.remove('rna_define.c') generated_files.remove('makesrna.c') -generated_files = [filename[:-2] + '_gen.c' for filename in generated_files] -source_files.extend(env.Glob('../../editors/*/*_api.c')) +api_files = env.Glob('*_api.c') +for api_file in api_files: + generated_files.remove(api_file) + +generated_files = [filename[:-2] + '_gen.c' for filename in generated_files] makesrna_tool = env.Clone() rna = env.Clone() diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index dd438cfe164..a8fe025fd46 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -394,7 +394,7 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr else if(rna_color_quantize(prop, dp)) fprintf(f, " values[%d]= (%s)(data->%s[%d]*(1.0f/255.0f));\n", i, rna_type_type(prop), dp->dnaname, i); else - fprintf(f, " values[%d]= (%s)%s(data->%s[%d]);\n", i, rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname, i); + fprintf(f, " values[%d]= (%s)%s(((%s*)data->%s)[%d]);\n", i, rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnatype, dp->dnaname, i); } } } @@ -559,7 +559,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr fprintf(f, " data->%s[%d]= FTOCHAR(values[%d]);\n", dp->dnaname, i, i); } else { - fprintf(f, " data->%s[%d]= %s", dp->dnaname, i, (dp->booleannegative)? "!": ""); + fprintf(f, " ((%s*)data->%s)[%d]= %s", dp->dnatype, dp->dnaname, i, (dp->booleannegative)? "!": ""); rna_clamp_value(f, prop, 1, i); } } @@ -1104,6 +1104,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA FunctionRNA *func; PropertyDefRNA *dparm; char *funcname, *ptrstr; + int first; srna= dsrna->srna; func= dfunc->func; @@ -1113,10 +1114,10 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA funcname= rna_alloc_function_name(srna->identifier, func->identifier, "call"); - fprintf(f, "void %s(PointerRNA *_ptr, ParameterList *_parms)", funcname); + fprintf(f, "void %s(bContext *C, ReportList *reports, PointerRNA *_ptr, ParameterList *_parms)", funcname); fprintf(f, "\n{\n"); - if((func->flag & FUNC_TYPESTATIC)==0) { + if((func->flag & FUNC_NO_SELF)==0) { if(dsrna->dnaname) fprintf(f, "\tstruct %s *_self;\n", dsrna->dnaname); else fprintf(f, "\tstruct %s *_self;\n", srna->identifier); } @@ -1132,7 +1133,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA fprintf(f, ";\n"); fprintf(f, "\t\n"); - if((func->flag & FUNC_TYPESTATIC)==0) { + if((func->flag & FUNC_NO_SELF)==0) { if(dsrna->dnaname) fprintf(f, "\t_self= (struct %s *)_ptr->data;\n", dsrna->dnaname); else fprintf(f, "\t_self= (struct %s *)_ptr->data;\n", srna->identifier); } @@ -1164,16 +1165,33 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA if(func->ret) fprintf(f, "%s= ", func->ret->identifier); fprintf(f, "%s(", dfunc->call); - if((func->flag & FUNC_TYPESTATIC)==0) + first= 1; + + if((func->flag & FUNC_NO_SELF)==0) { fprintf(f, "_self"); + first= 0; + } + + if(func->flag & FUNC_USE_CONTEXT) { + if(!first) fprintf(f, ", "); + first= 0; + fprintf(f, "C"); + } + + if(func->flag & FUNC_USE_REPORTS) { + if(!first) fprintf(f, ", "); + first= 0; + fprintf(f, "reports"); + } dparm= dfunc->cont.properties.first; for(; dparm; dparm= dparm->next) { if(dparm->prop==func->ret) continue; - if((func->flag & FUNC_TYPESTATIC)==0 || dparm!=dfunc->cont.properties.first) - fprintf(f, ", "); + if(!first) fprintf(f, ", "); + first= 0; + fprintf(f, "%s", dparm->prop->identifier); } @@ -1356,7 +1374,7 @@ static void rna_generate_function_prototypes(BlenderRNA *brna, StructRNA *srna, base= srna->base; while (base) { for(func= base->functions.first; func; func= func->cont.next) { - fprintf(f, "%s%s rna_%s_%s;\n", "extern ", "FunctionRNA", base->identifier, func->identifier); + fprintf(f, "%s%s rna_%s_%s_func;\n", "extern ", "FunctionRNA", base->identifier, func->identifier); rna_generate_parameter_prototypes(brna, base, func, f); } @@ -1367,7 +1385,7 @@ static void rna_generate_function_prototypes(BlenderRNA *brna, StructRNA *srna, } for(func= srna->functions.first; func; func= func->cont.next) { - fprintf(f, "%s%s rna_%s_%s;\n", "extern ", "FunctionRNA", srna->identifier, func->identifier); + fprintf(f, "%s%s rna_%s_%s_func;\n", "extern ", "FunctionRNA", srna->identifier, func->identifier); rna_generate_parameter_prototypes(brna, srna, func, f); } @@ -1380,6 +1398,7 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA FunctionRNA *func; PropertyDefRNA *dparm; StructDefRNA *dsrna; + int first; dsrna= rna_find_struct_def(srna); func= dfunc->func; @@ -1402,17 +1421,39 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA fprintf(f, "%s(", dfunc->call); - if(dsrna->dnaname) fprintf(f, "struct %s *_self", dsrna->dnaname); - else fprintf(f, "struct %s *_self", srna->identifier); + first= 1; + + if((func->flag & FUNC_NO_SELF)==0) { + if(dsrna->dnaname) fprintf(f, "struct %s *_self", dsrna->dnaname); + else fprintf(f, "struct %s *_self", srna->identifier); + first= 0; + } + + if(func->flag & FUNC_USE_CONTEXT) { + if(!first) fprintf(f, ", "); + first= 0; + fprintf(f, "bContext *C"); + } + + if(func->flag & FUNC_USE_REPORTS) { + if(!first) fprintf(f, ", "); + first= 0; + fprintf(f, "ReportList *reports"); + } for(dparm= dfunc->cont.properties.first; dparm; dparm= dparm->next) { - if(dparm->prop==func->ret) ; - else if(dparm->prop->arraylength) - fprintf(f, ", %s%s %s[%d]", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier, dparm->prop->arraylength); + if(dparm->prop==func->ret) + continue; + + if(!first) fprintf(f, ", "); + first= 0; + + if(dparm->prop->arraylength) + fprintf(f, "%s%s %s[%d]", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier, dparm->prop->arraylength); else if(dparm->prop->type == PROP_POINTER) - fprintf(f, ", %s%s *%s", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier); + fprintf(f, "%s%s *%s", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier); else - fprintf(f, ", %s%s %s", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier); + fprintf(f, "%s%s %s", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), dparm->prop->identifier); } fprintf(f, ");\n"); @@ -1629,10 +1670,14 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr case PROP_COLLECTION: { CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, ", rna_function_string(cprop->begin), rna_function_string(cprop->next), rna_function_string(cprop->end), rna_function_string(cprop->get), rna_function_string(cprop->length), rna_function_string(cprop->lookupint), rna_function_string(cprop->lookupstring)); + if(cprop->add) fprintf(f, "&rna_%s_%s_func, ", srna->identifier, (char*)cprop->add); + else fprintf(f, "NULL, "); + if(cprop->remove) fprintf(f, "&rna_%s_%s_func, ", srna->identifier, (char*)cprop->remove); + else fprintf(f, "NULL, "); if(cprop->type) fprintf(f, "&RNA_%s\n", (char*)cprop->type); else fprintf(f, "NULL\n"); break; - } + } } fprintf(f, "};\n\n"); @@ -1659,11 +1704,11 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f) for(parm= func->cont.properties.first; parm; parm= parm->next) rna_generate_property(f, srna, func->identifier, parm); - fprintf(f, "%s%s rna_%s_%s = {\n", "", "FunctionRNA", srna->identifier, func->identifier); + fprintf(f, "%s%s rna_%s_%s_func = {\n", "", "FunctionRNA", srna->identifier, func->identifier); - if(func->cont.next) fprintf(f, "\t{(FunctionRNA*)&rna_%s_%s, ", srna->identifier, ((FunctionRNA*)func->cont.next)->identifier); + if(func->cont.next) fprintf(f, "\t{(FunctionRNA*)&rna_%s_%s_func, ", srna->identifier, ((FunctionRNA*)func->cont.next)->identifier); else fprintf(f, "\t{NULL, "); - if(func->cont.prev) fprintf(f, "(FunctionRNA*)&rna_%s_%s,\n", srna->identifier, ((FunctionRNA*)func->cont.prev)->identifier); + if(func->cont.prev) fprintf(f, "(FunctionRNA*)&rna_%s_%s_func,\n", srna->identifier, ((FunctionRNA*)func->cont.prev)->identifier); else fprintf(f, "NULL,\n"); parm= func->cont.properties.first; @@ -1749,11 +1794,11 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f) } func= srna->functions.first; - if(func) fprintf(f, "\t{(FunctionRNA*)&rna_%s_%s, ", srna->identifier, func->identifier); + if(func) fprintf(f, "\t{(FunctionRNA*)&rna_%s_%s_func, ", srna->identifier, func->identifier); else fprintf(f, "\t{NULL, "); func= srna->functions.last; - if(func) fprintf(f, "(FunctionRNA*)&rna_%s_%s}\n", srna->identifier, func->identifier); + if(func) fprintf(f, "(FunctionRNA*)&rna_%s_%s_func}\n", srna->identifier, func->identifier); else fprintf(f, "NULL}\n"); fprintf(f, "};\n"); @@ -1763,63 +1808,64 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f) typedef struct RNAProcessItem { char *filename; + char *api_filename; void (*define)(BlenderRNA *brna); } RNAProcessItem; RNAProcessItem PROCESS_ITEMS[]= { - {"rna_rna.c", RNA_def_rna}, - {"rna_ID.c", RNA_def_ID}, - {"rna_texture.c", RNA_def_texture}, - {"rna_action.c", RNA_def_action}, - {"rna_animation.c", RNA_def_animation}, - {"rna_actuator.c", RNA_def_actuator}, - {"rna_armature.c", RNA_def_armature}, - {"rna_brush.c", RNA_def_brush}, - {"rna_camera.c", RNA_def_camera}, - {"rna_cloth.c", RNA_def_cloth}, - {"rna_color.c", RNA_def_color}, - {"rna_constraint.c", RNA_def_constraint}, - {"rna_context.c", RNA_def_context}, - {"rna_controller.c", RNA_def_controller}, - {"rna_curve.c", RNA_def_curve}, - {"rna_fcurve.c", RNA_def_fcurve}, - {"rna_fluidsim.c", RNA_def_fluidsim}, - {"rna_group.c", RNA_def_group}, - {"rna_image.c", RNA_def_image}, - {"rna_key.c", RNA_def_key}, - {"rna_lamp.c", RNA_def_lamp}, - {"rna_lattice.c", RNA_def_lattice}, - {"rna_main.c", RNA_def_main}, - {"rna_material.c", RNA_def_material}, - {"rna_mesh.c", RNA_def_mesh}, - {"rna_meta.c", RNA_def_meta}, - {"rna_modifier.c", RNA_def_modifier}, - {"rna_nodetree.c", RNA_def_nodetree}, - {"rna_object.c", RNA_def_object}, - {"rna_object_force.c", RNA_def_object_force}, - {"rna_packedfile.c", RNA_def_packedfile}, - {"rna_particle.c", RNA_def_particle}, - {"rna_pose.c", RNA_def_pose}, - {"rna_property.c", RNA_def_gameproperty}, - {"rna_radio.c", RNA_def_radio}, - {"rna_scene.c", RNA_def_scene}, - {"rna_screen.c", RNA_def_screen}, - {"rna_scriptlink.c", RNA_def_scriptlink}, - {"rna_sensor.c", RNA_def_sensor}, - {"rna_sequence.c", RNA_def_sequence}, - {"rna_space.c", RNA_def_space}, - {"rna_text.c", RNA_def_text}, - {"rna_timeline.c", RNA_def_timeline_marker}, - {"rna_sound.c", RNA_def_sound}, - {"rna_ui.c", RNA_def_ui}, - {"rna_userdef.c", RNA_def_userdef}, - {"rna_vfont.c", RNA_def_vfont}, - {"rna_vpaint.c", RNA_def_vpaint}, - {"rna_wm.c", RNA_def_wm}, - {"rna_world.c", RNA_def_world}, + {"rna_rna.c", NULL, RNA_def_rna}, + {"rna_ID.c", NULL, RNA_def_ID}, + {"rna_texture.c", NULL, RNA_def_texture}, + {"rna_action.c", NULL, RNA_def_action}, + {"rna_animation.c", NULL, RNA_def_animation}, + {"rna_actuator.c", NULL, RNA_def_actuator}, + {"rna_armature.c", NULL, RNA_def_armature}, + {"rna_brush.c", NULL, RNA_def_brush}, + {"rna_camera.c", NULL, RNA_def_camera}, + {"rna_cloth.c", NULL, RNA_def_cloth}, + {"rna_color.c", NULL, RNA_def_color}, + {"rna_constraint.c", NULL, RNA_def_constraint}, + {"rna_context.c", NULL, RNA_def_context}, + {"rna_controller.c", NULL, RNA_def_controller}, + {"rna_curve.c", NULL, RNA_def_curve}, + {"rna_fcurve.c", NULL, RNA_def_fcurve}, + {"rna_fluidsim.c", NULL, RNA_def_fluidsim}, + {"rna_group.c", NULL, RNA_def_group}, + {"rna_image.c", NULL, RNA_def_image}, + {"rna_key.c", NULL, RNA_def_key}, + {"rna_lamp.c", NULL, RNA_def_lamp}, + {"rna_lattice.c", NULL, RNA_def_lattice}, + {"rna_main.c", "rna_main_api.c", RNA_def_main}, + {"rna_material.c", NULL, RNA_def_material}, + {"rna_mesh.c", "rna_mesh_api.c", RNA_def_mesh}, + {"rna_meta.c", NULL, RNA_def_meta}, + {"rna_modifier.c", NULL, RNA_def_modifier}, + {"rna_nodetree.c", NULL, RNA_def_nodetree}, + {"rna_object.c", "rna_object_api.c", RNA_def_object}, + {"rna_object_force.c", NULL, RNA_def_object_force}, + {"rna_packedfile.c", NULL, RNA_def_packedfile}, + {"rna_particle.c", NULL, RNA_def_particle}, + {"rna_pose.c", NULL, RNA_def_pose}, + {"rna_property.c", NULL, RNA_def_gameproperty}, + {"rna_radio.c", NULL, RNA_def_radio}, + {"rna_scene.c", NULL, RNA_def_scene}, + {"rna_screen.c", NULL, RNA_def_screen}, + {"rna_scriptlink.c", NULL, RNA_def_scriptlink}, + {"rna_sensor.c", NULL, RNA_def_sensor}, + {"rna_sequence.c", NULL, RNA_def_sequence}, + {"rna_space.c", NULL, RNA_def_space}, + {"rna_text.c", NULL, RNA_def_text}, + {"rna_timeline.c", NULL, RNA_def_timeline_marker}, + {"rna_sound.c", NULL, RNA_def_sound}, + {"rna_ui.c", "rna_ui_api.c", RNA_def_ui}, + {"rna_userdef.c", NULL, RNA_def_userdef}, + {"rna_vfont.c", NULL, RNA_def_vfont}, + {"rna_vpaint.c", NULL, RNA_def_vpaint}, + {"rna_wm.c", "rna_wm_api.c", RNA_def_wm}, + {"rna_world.c", NULL, RNA_def_world}, {NULL, NULL}}; -static void rna_generate(BlenderRNA *brna, FILE *f, char *filename) +static void rna_generate(BlenderRNA *brna, FILE *f, char *filename, char *api_filename) { StructDefRNA *ds; PropertyDefRNA *dp; @@ -1837,7 +1883,9 @@ static void rna_generate(BlenderRNA *brna, FILE *f, char *filename) fprintf(f, "#include \"BLI_blenlib.h\"\n\n"); + fprintf(f, "#include \"BKE_context.h\"\n"); fprintf(f, "#include \"BKE_library.h\"\n"); + fprintf(f, "#include \"BKE_report.h\"\n"); fprintf(f, "#include \"BKE_utildefines.h\"\n\n"); fprintf(f, "#include \"RNA_define.h\"\n"); @@ -1846,7 +1894,10 @@ static void rna_generate(BlenderRNA *brna, FILE *f, char *filename) rna_generate_prototypes(brna, f); - fprintf(f, "#include \"%s\"\n\n", filename); + fprintf(f, "#include \"%s\"\n", filename); + if(api_filename) + fprintf(f, "#include \"%s\"\n", api_filename); + fprintf(f, "\n"); fprintf(f, "/* Autogenerated Functions */\n\n"); @@ -2169,7 +2220,7 @@ static int rna_preprocess(char *outfile) status = 1; } else { - rna_generate(brna, file, PROCESS_ITEMS[i].filename); + rna_generate(brna, file, PROCESS_ITEMS[i].filename, PROCESS_ITEMS[i].api_filename); fclose(file); status= (DefRNA.error != 0); diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 56eda4eb735..52680e26afe 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -246,12 +246,6 @@ static void rna_def_ID(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "lib"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Library", "Library file the datablock is linked from."); - - /* XXX temporary for testing */ - func= RNA_def_function(srna, "rename", "rename_id"); - RNA_def_function_ui_description(func, "Rename this ID datablock."); - prop= RNA_def_string(func, "name", "", 0, "", "New name for the datablock."); - RNA_def_property_flag(prop, PROP_REQUIRED); } static void rna_def_library(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 2413cd46eed..cfddb1daf10 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -33,7 +33,9 @@ #include "BLI_blenlib.h" #include "BLI_dynstr.h" +#include "BKE_context.h" #include "BKE_idprop.h" +#include "BKE_report.h" #include "BKE_utildefines.h" #include "WM_api.h" @@ -725,7 +727,7 @@ int RNA_property_animated(PointerRNA *ptr, PropertyRNA *prop) return 0; } -void RNA_property_update(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop) +void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop) { prop= rna_ensure_property(prop); @@ -1321,6 +1323,7 @@ int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop) void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr) { IDProperty *idprop; + //CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; if((idprop=rna_idproperty_check(&prop, ptr))) { IDPropertyTemplate val = {0}; @@ -1346,8 +1349,17 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA MEM_freeN(item); } } +#if 0 + else if(cprop->add){ + if(!(cprop->add->flag & FUNC_USE_CONTEXT)) { /* XXX check for this somewhere else */ + ParameterList *params= RNA_parameter_list_create(ptr, cprop->add); + RNA_function_call(NULL, NULL, ptr, cprop->add, params); + RNA_parameter_list_free(params); + } + } +#endif else - printf("RNA_property_collection_add %s.%s: only supported for id properties.\n", ptr->type->identifier, prop->identifier); + printf("RNA_property_collection_add %s.%s: not implemented for this property.\n", ptr->type->identifier, prop->identifier); if(r_ptr) { if(idprop) { @@ -1365,6 +1377,7 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA void RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key) { IDProperty *idprop; + //CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; if((idprop=rna_idproperty_check(&prop, ptr))) { IDProperty tmp, *array; @@ -1385,6 +1398,15 @@ void RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key) } } else if(prop->flag & PROP_IDPROPERTY); +#if 0 + else if(cprop->remove){ + if(!(cprop->remove->flag & FUNC_USE_CONTEXT)) { /* XXX check for this somewhere else */ + ParameterList *params= RNA_parameter_list_create(ptr, cprop->remove); + RNA_function_call(NULL, NULL, ptr, cprop->remove, params); + RNA_parameter_list_free(params); + } + } +#endif else printf("RNA_property_collection_remove %s.%s: only supported for id properties.\n", ptr->type->identifier, prop->identifier); } @@ -2524,10 +2546,10 @@ void RNA_parameter_set_lookup(ParameterList *parms, const char *identifier, void RNA_parameter_set(parms, parm, value); } -int RNA_function_call(PointerRNA *ptr, FunctionRNA *func, ParameterList *parms) +int RNA_function_call(bContext *C, ReportList *reports, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms) { if(func->call) { - func->call(ptr, parms); + func->call(C, reports, ptr, parms); return 0; } @@ -2535,33 +2557,33 @@ int RNA_function_call(PointerRNA *ptr, FunctionRNA *func, ParameterList *parms) return -1; } -int RNA_function_call_lookup(PointerRNA *ptr, const char *identifier, ParameterList *parms) +int RNA_function_call_lookup(bContext *C, ReportList *reports, PointerRNA *ptr, const char *identifier, ParameterList *parms) { FunctionRNA *func; func= RNA_struct_find_function(ptr, identifier); if(func) - return RNA_function_call(ptr, func, parms); + return RNA_function_call(C, reports, ptr, func, parms); return -1; } -int RNA_function_call_direct(PointerRNA *ptr, FunctionRNA *func, const char *format, ...) +int RNA_function_call_direct(bContext *C, ReportList *reports, PointerRNA *ptr, FunctionRNA *func, const char *format, ...) { va_list args; int ret; va_start(args, format); - ret= RNA_function_call_direct_va(ptr, func, format, args); + ret= RNA_function_call_direct_va(C, reports, ptr, func, format, args); va_end(args); return ret; } -int RNA_function_call_direct_lookup(PointerRNA *ptr, const char *identifier, const char *format, ...) +int RNA_function_call_direct_lookup(bContext *C, ReportList *reports, PointerRNA *ptr, const char *identifier, const char *format, ...) { FunctionRNA *func; @@ -2573,7 +2595,7 @@ int RNA_function_call_direct_lookup(PointerRNA *ptr, const char *identifier, con va_start(args, format); - ret= RNA_function_call_direct_va(ptr, func, format, args); + ret= RNA_function_call_direct_va(C, reports, ptr, func, format, args); va_end(args); @@ -2715,7 +2737,7 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop return 0; } -int RNA_function_call_direct_va(PointerRNA *ptr, FunctionRNA *func, const char *format, va_list args) +int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *ptr, FunctionRNA *func, const char *format, va_list args) { PointerRNA funcptr; ParameterList *parms; @@ -2810,7 +2832,7 @@ int RNA_function_call_direct_va(PointerRNA *ptr, FunctionRNA *func, const char * } if (err==0) - err= RNA_function_call(ptr, func, parms); + err= RNA_function_call(C, reports, ptr, func, parms); /* XXX throw error when more parameters than those needed are passed or leave silent? */ if (err==0 && pret && ofslength= (PropCollectionLengthFunc)length; if(lookupint) cprop->lookupint= (PropCollectionLookupIntFunc)lookupint; if(lookupstring) cprop->lookupstring= (PropCollectionLookupStringFunc)lookupstring; + if(add) cprop->add= (FunctionRNA*)add; + if(remove) cprop->remove= (FunctionRNA*)remove; break; } default: diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c index 059b2ce78f7..1406ad1ae60 100644 --- a/source/blender/makesrna/intern/rna_group.c +++ b/source/blender/makesrna/intern/rna_group.c @@ -61,7 +61,7 @@ void RNA_def_group(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "gobject", NULL); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_ui_text(prop, "Objects", "A collection of this groups objects."); - RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Group_objects_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Group_objects_get", 0, 0, 0, 0, 0); prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "layer", 1); diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 9071efe71f7..61cde5a01a3 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -188,7 +188,11 @@ void rna_object_vcollayer_name_set(struct PointerRNA *ptr, const char *value, ch /* API functions */ +void RNA_api_main(struct StructRNA *srna); +void RNA_api_mesh(struct StructRNA *srna); +void RNA_api_object(struct StructRNA *srna); void RNA_api_ui_layout(struct StructRNA *srna); +void RNA_api_wm(struct StructRNA *srna); /* ID Properties */ diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 3a5a4fa1ced..d93e6f4d7cf 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -245,6 +245,7 @@ typedef struct CollectionPropertyRNA { PropCollectionLengthFunc length; /* optional */ PropCollectionLookupIntFunc lookupint; /* optional */ PropCollectionLookupStringFunc lookupstring; /* optional */ + FunctionRNA *add, *remove; struct StructRNA *type; } CollectionPropertyRNA; diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 896f660c720..b97dd95c4d4 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -335,7 +335,7 @@ static void rna_def_keyblock(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "data", "totelem"); RNA_def_property_struct_type(prop, "UnknownType"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_ShapeKey_data_begin", 0, 0, "rna_ShapeKey_data_get", "rna_ShapeKey_data_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_ShapeKey_data_begin", 0, 0, "rna_ShapeKey_data_get", "rna_ShapeKey_data_length", 0, 0, 0, 0); } static void rna_def_key(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index 0e341fcdbd0..3af448b0233 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -99,7 +99,7 @@ static void rna_def_latticepoint(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Deformed Location", ""); prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_funcs(prop, "rna_LatticePoint_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_LatticePoint_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0, 0, 0); RNA_def_property_struct_type(prop, "VertexGroupElement"); RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this point is member of."); } @@ -159,7 +159,7 @@ static void rna_def_lattice(BlenderRNA *brna) prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "LatticePoint"); - RNA_def_property_collection_funcs(prop, "rna_Lattice_points_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Lattice_points_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0, 0, 0); RNA_def_property_ui_text(prop, "Points", "Points of the lattice."); } diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index fdd0349b25e..8d98036290a 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -33,6 +33,7 @@ #ifdef RNA_RUNTIME #include "BKE_main.h" +#include "BKE_mesh.h" /* all the list begin functions are added manually here, Main is not in SDNA */ @@ -218,6 +219,7 @@ void RNA_def_main(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; + const char *lists[][5]= { {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks."}, {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks."}, @@ -262,9 +264,11 @@ void RNA_def_main(BlenderRNA *brna) { prop= RNA_def_property(srna, lists[i][0], PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, lists[i][1]); - RNA_def_property_collection_funcs(prop, lists[i][2], "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, lists[i][2], "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, "add_mesh", "remove_mesh"); RNA_def_property_ui_text(prop, lists[i][3], lists[i][4]); } + + RNA_api_main(srna); } #endif diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c new file mode 100644 index 00000000000..6d56b2b00f9 --- /dev/null +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -0,0 +1,81 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "RNA_define.h" +#include "RNA_types.h" + +#ifdef RNA_RUNTIME + +#include "BKE_main.h" +#include "BKE_mesh.h" +#include "BKE_library.h" + +#include "DNA_mesh_types.h" + +Mesh *rna_Main_add_mesh(Main *main, char *name) +{ + Mesh *me= add_mesh(name); + me->id.us--; + return me; +} + +void rna_Main_remove_mesh(Main *main, ReportList *reports, Mesh *me) +{ + if(me->id.us == 0) + free_libblock(&main->mesh, me); + else + BKE_report(reports, RPT_ERROR, "Mesh must have zero users to be removed."); + + /* XXX python now has invalid pointer? */ +} + +#else + +void RNA_api_main(StructRNA *srna) +{ + FunctionRNA *func; + PropertyRNA *prop; + + func= RNA_def_function(srna, "add_mesh", "rna_Main_add_mesh"); + RNA_def_function_ui_description(func, "Add a new mesh."); + prop= RNA_def_string(func, "name", "Mesh", 0, "", "New name for the datablock."); + prop= RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh."); + RNA_def_function_return(func, prop); + + func= RNA_def_function(srna, "remove_mesh", "rna_Main_remove_mesh"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + RNA_def_function_ui_description(func, "Remove a mesh if it has zero users."); + prop= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove."); + RNA_def_property_flag(prop, PROP_REQUIRED); +} + +#endif + diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 1c16e793fdc..41f31594f6e 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -1143,7 +1143,7 @@ void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeg /* mtex */ prop= RNA_def_property(srna, "textures", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, structname); - RNA_def_property_collection_funcs(prop, begin, "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_dereference_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, begin, "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_dereference_get", 0, 0, 0, 0, 0); RNA_def_property_ui_text(prop, "Textures", "Texture slots defining the mapping and influence of textures."); prop= RNA_def_property(srna, "active_texture", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 3499ee16258..653f9d61fa5 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -646,7 +646,7 @@ static void rna_def_mvert(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Bevel Weight", "Weight used by the Bevel modifier 'Only Vertices' option"); prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0, 0, 0); RNA_def_property_struct_type(prop, "VertexGroupElement"); RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this vertex is member of."); } @@ -761,7 +761,7 @@ static void rna_def_mtface(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshTextureFace"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshTextureFaceLayer_data_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshTextureFaceLayer_data_length", 0, 0, 0, 0); srna= RNA_def_struct(brna, "MeshTextureFace", NULL); RNA_def_struct_sdna(srna, "MTFace"); @@ -898,7 +898,7 @@ static void rna_def_mcol(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshColor"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshColorLayer_data_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_MeshColorLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshColorLayer_data_length", 0, 0, 0, 0); srna= RNA_def_struct(brna, "MeshColor", NULL); RNA_def_struct_sdna(srna, "MCol"); @@ -944,7 +944,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshFloatProperty"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_MeshFloatPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshFloatPropertyLayer_data_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_MeshFloatPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshFloatPropertyLayer_data_length", 0, 0, 0, 0); srna= RNA_def_struct(brna, "MeshFloatProperty", NULL); RNA_def_struct_sdna(srna, "MFloatProperty"); @@ -968,7 +968,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshIntProperty"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_MeshIntPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshIntPropertyLayer_data_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_MeshIntPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshIntPropertyLayer_data_length", 0, 0, 0, 0); srna= RNA_def_struct(brna, "MeshIntProperty", NULL); RNA_def_struct_sdna(srna, "MIntProperty"); @@ -992,7 +992,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshStringProperty"); RNA_def_property_ui_text(prop, "Data", ""); - RNA_def_property_collection_funcs(prop, "rna_MeshStringPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshStringPropertyLayer_data_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_MeshStringPropertyLayer_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_MeshStringPropertyLayer_data_length", 0, 0, 0, 0); srna= RNA_def_struct(brna, "MeshStringProperty", NULL); RNA_def_struct_sdna(srna, "MStringProperty"); @@ -1049,6 +1049,7 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "mvert", "totvert"); RNA_def_property_struct_type(prop, "MeshVertex"); RNA_def_property_ui_text(prop, "Vertices", "Vertices of the mesh."); + // XXX RNA_def_property_collection_funcs(prop, "rna_Mesh_verts_begin", 0, 0, 0, 0, 0, 0, "add_verts", "remove_verts"); prop= RNA_def_property(srna, "edges", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "medge", "totedge"); @@ -1067,31 +1068,31 @@ static void rna_def_mesh(BlenderRNA *brna) prop= RNA_def_property(srna, "uv_layers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); - RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_layers_begin", 0, 0, 0, "rna_Mesh_uv_layers_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_layers_begin", 0, 0, 0, "rna_Mesh_uv_layers_length", 0, 0, 0, 0); RNA_def_property_struct_type(prop, "MeshTextureFaceLayer"); RNA_def_property_ui_text(prop, "UV Layers", ""); prop= RNA_def_property(srna, "vcol_layers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); - RNA_def_property_collection_funcs(prop, "rna_Mesh_vcol_layers_begin", 0, 0, 0, "rna_Mesh_vcol_layers_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Mesh_vcol_layers_begin", 0, 0, 0, "rna_Mesh_vcol_layers_length", 0, 0, 0, 0); RNA_def_property_struct_type(prop, "MeshColorLayer"); RNA_def_property_ui_text(prop, "Vertex Color Layers", ""); prop= RNA_def_property(srna, "float_layers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); - RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", 0, 0, 0, "rna_Mesh_float_layers_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", 0, 0, 0, "rna_Mesh_float_layers_length", 0, 0, 0, 0); RNA_def_property_struct_type(prop, "MeshFloatPropertyLayer"); RNA_def_property_ui_text(prop, "Float Property Layers", ""); prop= RNA_def_property(srna, "int_layers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); - RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", 0, 0, 0, "rna_Mesh_int_layers_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Mesh_int_layers_begin", 0, 0, 0, "rna_Mesh_int_layers_length", 0, 0, 0, 0); RNA_def_property_struct_type(prop, "MeshIntPropertyLayer"); RNA_def_property_ui_text(prop, "Int Property Layers", ""); prop= RNA_def_property(srna, "string_layers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); - RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", 0, 0, 0, "rna_Mesh_string_layers_length", 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Mesh_string_layers_begin", 0, 0, 0, "rna_Mesh_string_layers_length", 0, 0, 0, 0); RNA_def_property_struct_type(prop, "MeshStringPropertyLayer"); RNA_def_property_ui_text(prop, "String Property Layers", ""); @@ -1122,6 +1123,8 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Shape Keys", ""); rna_def_texmat_common(srna, "rna_Mesh_texspace_editable"); + + RNA_api_mesh(srna); } void RNA_def_mesh(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c new file mode 100644 index 00000000000..26fb77777d7 --- /dev/null +++ b/source/blender/makesrna/intern/rna_mesh_api.c @@ -0,0 +1,108 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "RNA_define.h" +#include "RNA_types.h" + +#ifdef RNA_RUNTIME + +#include "BKE_customdata.h" +#include "BKE_DerivedMesh.h" + +#include "DNA_mesh_types.h" +#include "DNA_scene_types.h" + +/* +void rna_Mesh_copy(Mesh *me, Mesh *from) +{ + copy_mesh_data(me, from); +} + +void rna_Mesh_copy_applied(Mesh *me, Scene *sce, Object *ob) +{ + DerivedMesh *dm= mesh_create_derived_view(sce, ob, CD_MASK_MESH); + DM_to_mesh(dm, me); + dm->release(dm); +} +*/ + +void rna_Mesh_transform(Mesh *me, float **mat) +{ +} + +#if 0 +/* extern struct EditVert *addvertlist(EditMesh *em, float *vec, struct EditVert *example); */ + +static void rna_Mesh_verts_add(PointerRNA *ptr, PointerRNA *ptr_item) +{ + //Mesh *me= (Mesh*)ptr->data; + + /* + // XXX if item is not MVert we fail silently + if (item->type == RNA_MeshVertex) + return; + + // XXX this must be slow... + EditMesh *em= BKE_mesh_get_editmesh(me); + + MVert *v = (MVert*)ptr_item->ptr->data; + addvertlist(em, v->co, NULL); + + BKE_mesh_end_editmesh(me, em); + */ +} +#endif + +#else + +void RNA_api_mesh(StructRNA *srna) +{ + /*FunctionRNA *func; + PropertyRNA *prop;*/ + + /* + func= RNA_def_function(srna, "copy", "rna_Mesh_copy"); + RNA_def_function_ui_description(func, "Copy mesh data."); + prop= RNA_def_pointer(func, "src", "Mesh", "", "A mesh to copy data from."); + RNA_def_property_flag(prop, PROP_REQUIRED);*/ + + /* + func= RNA_def_function(srna, "add_geom", "rna_Mesh_add_geom"); + RNA_def_function_ui_description(func, "Add geometry data to mesh."); + prop= RNA_def_collection(func, "verts", "?", "", "Vertices."); + RNA_def_property_flag(prop, PROP_REQUIRED); + prop= RNA_def_collection(func, "faces", "?", "", "Faces."); + RNA_def_property_flag(prop, PROP_REQUIRED); + */ +} + +#endif + diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 30f4936a06d..dab7a94584f 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1089,7 +1089,7 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna) prop= RNA_def_property(srna, "projectors", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_collection_funcs(prop, "rna_UVProject_projectors_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_dereference_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_UVProject_projectors_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_dereference_get", 0, 0, 0, 0, 0); RNA_def_property_ui_text(prop, "Projectors", ""); prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 9d7da401ec1..ff9777d283e 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -584,7 +584,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Debug State", "Print state debug info in the game engine."); } -static StructRNA *rna_def_object(BlenderRNA *brna) +static void rna_def_object(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -739,7 +739,7 @@ static StructRNA *rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol"); RNA_def_property_struct_type(prop, "MaterialSlot"); - RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_iterator_array_get", 0, 0, 0); /* don't dereference pointer! */ + RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_iterator_array_get", 0, 0, 0, 0, 0); /* don't dereference pointer! */ RNA_def_property_ui_text(prop, "Materials", "Material slots in the object."); prop= RNA_def_property(srna, "active_material", PROP_POINTER, PROP_NONE); @@ -799,6 +799,12 @@ static StructRNA *rna_def_object(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale in the interface."); + /* matrix */ + prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX); + RNA_def_property_float_sdna(prop, NULL, "obmat"); + RNA_def_property_array(prop, 16); + RNA_def_property_ui_text(prop, "Matrix", "Transformation matrix."); + /* collections */ prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "Constraint"); @@ -1103,8 +1109,8 @@ static StructRNA *rna_def_object(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "shapenr"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Shape Key", "Current shape key index."); - - return srna; + + RNA_api_object(srna); } void RNA_def_object(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c new file mode 100644 index 00000000000..053ab115b3b --- /dev/null +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -0,0 +1,83 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "RNA_define.h" +#include "RNA_types.h" + +#ifdef RNA_RUNTIME + +#include "BKE_customdata.h" +#include "BKE_DerivedMesh.h" + +#include "DNA_mesh_types.h" +#include "DNA_scene_types.h" + +/* copied from init_render_mesh (render code) */ +Mesh *rna_Object_create_render_mesh(Object *ob, Scene *scene) +{ + CustomDataMask mask = CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL; + DerivedMesh *dm; + Mesh *me; + + /* TODO: other types */ + if(ob->type != OB_MESH) + return NULL; + + dm= mesh_create_derived_render(scene, ob, mask); + + if(!dm) + return NULL; + + me= add_mesh("tmp_render_mesh"); + me->id.us--; /* we don't assign it to anything */ + DM_to_mesh(dm, me); + dm->release(dm); + + return me; +} + +#else + +void RNA_api_object(StructRNA *srna) +{ + FunctionRNA *func; + PropertyRNA *prop; + + func= RNA_def_function(srna, "create_render_mesh", "rna_Object_create_render_mesh"); + RNA_def_function_ui_description(func, "Create a Mesh datablock with all modifiers applied."); + prop= RNA_def_pointer(func, "scene", "Scene", "", ""); + RNA_def_property_flag(prop, PROP_REQUIRED); + prop= RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export."); + RNA_def_function_return(func, prop); +} + +#endif + diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 329175ad68b..bd3a8ae5580 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -611,13 +611,13 @@ static void rna_def_struct(BlenderRNA *brna) prop= RNA_def_property(srna, "properties", PROP_COLLECTION, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Property"); - RNA_def_property_collection_funcs(prop, "rna_Struct_properties_begin", "rna_Struct_properties_next", "rna_iterator_listbase_end", "rna_Struct_properties_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Struct_properties_begin", "rna_Struct_properties_next", "rna_iterator_listbase_end", "rna_Struct_properties_get", 0, 0, 0, 0, 0); RNA_def_property_ui_text(prop, "Properties", "Properties in the struct."); prop= RNA_def_property(srna, "functions", PROP_COLLECTION, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Function"); - RNA_def_property_collection_funcs(prop, "rna_Struct_functions_begin", "rna_Struct_functions_next", "rna_iterator_listbase_end", "rna_Struct_functions_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Struct_functions_begin", "rna_Struct_functions_next", "rna_iterator_listbase_end", "rna_Struct_functions_get", 0, 0, 0, 0, 0); RNA_def_property_ui_text(prop, "Functions", ""); } @@ -719,7 +719,7 @@ static void rna_def_function(BlenderRNA *brna) prop= RNA_def_property(srna, "parameters", PROP_COLLECTION, PROP_NONE); /*RNA_def_property_clear_flag(prop, PROP_EDITABLE);*/ RNA_def_property_struct_type(prop, "Property"); - RNA_def_property_collection_funcs(prop, "rna_Function_parameters_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Function_parameters_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0, 0); RNA_def_property_ui_text(prop, "Parameters", "Parameters for the function."); prop= RNA_def_property(srna, "registered", PROP_BOOLEAN, PROP_NONE); @@ -800,7 +800,7 @@ static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna) prop= RNA_def_property(srna, "items", PROP_COLLECTION, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "EnumPropertyItem"); - RNA_def_property_collection_funcs(prop, "rna_EnumProperty_items_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_EnumProperty_items_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0, 0, 0); RNA_def_property_ui_text(prop, "Items", "Possible values for the property."); srna= RNA_def_struct(brna, "EnumPropertyItem", NULL); @@ -895,7 +895,7 @@ void RNA_def_rna(BlenderRNA *brna) prop= RNA_def_property(srna, "structs", PROP_COLLECTION, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Struct"); - RNA_def_property_collection_funcs(prop, "rna_BlenderRNA_structs_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_BlenderRNA_structs_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0, 0); RNA_def_property_ui_text(prop, "Structs", ""); } diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 64ba6e11e56..1365ab75fc7 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -866,7 +866,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "base", NULL); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_ui_text(prop, "Objects", ""); - RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Scene_objects_get", 0, 0, 0, 0, 0); prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "lay", 1); diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index 69e884fe249..055e67fb135 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -521,7 +521,7 @@ void rna_def_editor(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "metastack", NULL); RNA_def_property_struct_type(prop, "Sequence"); RNA_def_property_ui_text(prop, "Meta Stack", "Meta strip stack, last is currently edited meta strip."); - RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_SequenceEdtior_meta_stack_get", 0, 0, 0); + RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_SequenceEdtior_meta_stack_get", 0, 0, 0, 0, 0); prop= RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "act_seq"); diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c new file mode 100644 index 00000000000..d06d4d4406d --- /dev/null +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -0,0 +1,251 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "RNA_define.h" +#include "RNA_types.h" + +#include "UI_interface.h" +#include "UI_resources.h" + +#ifdef RNA_RUNTIME + +#else + +#define DEF_ICON(name) {name, #name, 0, #name, ""}, +static EnumPropertyItem icon_items[] = { +#include "UI_icons.h" + {0, NULL, 0, NULL, NULL}}; +#undef DEF_ICON + +static void api_ui_item_common(FunctionRNA *func) +{ + PropertyRNA *prop; + + RNA_def_string(func, "text", "", 0, "", "Override automatic text of the item."); + + prop= RNA_def_property(func, "icon", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, icon_items); + RNA_def_property_ui_text(prop, "Icon", "Override automatic icon of the item."); + +} + +static void api_ui_item_op_common(FunctionRNA *func) +{ + PropertyRNA *parm; + + api_ui_item_common(func); + parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator."); + RNA_def_property_flag(parm, PROP_REQUIRED); +} + +static void api_ui_item_rna_common(FunctionRNA *func) +{ + PropertyRNA *parm; + + parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in data."); + RNA_def_property_flag(parm, PROP_REQUIRED); +} + +void RNA_api_ui_layout(StructRNA *srna) +{ + FunctionRNA *func; + PropertyRNA *parm; + + static EnumPropertyItem curve_type_items[] = { + {0, "NONE", 0, "None", ""}, + {'v', "VECTOR", 0, "Vector", ""}, + {'c', "COLOR", 0, "Color", ""}, + {0, NULL, 0, NULL, NULL}}; + + /* simple layout specifiers */ + func= RNA_def_function(srna, "row", "uiLayoutRow"); + parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); + RNA_def_function_return(func, parm); + RNA_def_boolean(func, "align", 0, "", "Align buttons to each other."); + + func= RNA_def_function(srna, "column", "uiLayoutColumn"); + parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); + RNA_def_function_return(func, parm); + RNA_def_boolean(func, "align", 0, "", "Align buttons to each other."); + + func= RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow"); + parm= RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic.", 0, INT_MAX); + parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); + RNA_def_function_return(func, parm); + RNA_def_boolean(func, "align", 0, "", "Align buttons to each other."); + + /* box layout */ + func= RNA_def_function(srna, "box", "uiLayoutBox"); + parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); + RNA_def_function_return(func, parm); + + /* split layout */ + func= RNA_def_function(srna, "split", "uiLayoutSplit"); + parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); + RNA_def_function_return(func, parm); + RNA_def_float(func, "percentage", 0.5f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at.", 0.0f, 1.0f); + + /* items */ + func= RNA_def_function(srna, "itemR", "uiItemR"); + api_ui_item_common(func); + api_ui_item_rna_common(func); + RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); + RNA_def_boolean(func, "slider", 0, "", "Use slider widget for numeric values."); + RNA_def_boolean(func, "toggle", 0, "", "Use toggle widget for boolean values."); + + func= RNA_def_function(srna, "items_enumR", "uiItemsEnumR"); + api_ui_item_rna_common(func); + + func= RNA_def_function(srna, "item_menu_enumR", "uiItemMenuEnumR"); + api_ui_item_common(func); + api_ui_item_rna_common(func); + + /*func= RNA_def_function(srna, "item_enumR", "uiItemEnumR"); + api_ui_item_common(func); + api_ui_item_rna_common(func); + parm= RNA_def_string(func, "value", "", 0, "", "Enum property value."); + RNA_def_property_flag(parm, PROP_REQUIRED);*/ + + func= RNA_def_function(srna, "itemO", "uiItemO"); + api_ui_item_op_common(func); + + func= RNA_def_function(srna, "item_enumO", "uiItemEnumO_string"); + api_ui_item_op_common(func); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_string(func, "value", "", 0, "", "Enum property value."); + RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "items_enumO", "uiItemsEnumO"); + parm= RNA_def_string(func, "operator", "", 0, "", "Identifier of the operator."); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); + RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "item_menu_enumO", "uiItemMenuEnumO"); + api_ui_item_op_common(func); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); + RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "item_booleanO", "uiItemBooleanO"); + api_ui_item_op_common(func); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_boolean(func, "value", 0, "", "Value of the property to call the operator with."); + RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "item_intO", "uiItemIntO"); + api_ui_item_op_common(func); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_int(func, "value", 0, INT_MIN, INT_MAX, "", "Value of the property to call the operator with.", INT_MIN, INT_MAX); + RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "item_floatO", "uiItemFloatO"); + api_ui_item_op_common(func); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_float(func, "value", 0, -FLT_MAX, FLT_MAX, "", "Value of the property to call the operator with.", -FLT_MAX, FLT_MAX); + RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "item_stringO", "uiItemStringO"); + api_ui_item_op_common(func); + parm= RNA_def_string(func, "property", "", 0, "", "Identifier of property in operator."); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_string(func, "value", "", 0, "", "Value of the property to call the operator with."); + RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "itemL", "uiItemL"); + api_ui_item_common(func); + + func= RNA_def_function(srna, "itemM", "uiItemM"); + parm= RNA_def_pointer(func, "context", "Context", "", "Current context."); + RNA_def_property_flag(parm, PROP_REQUIRED); + api_ui_item_common(func); + parm= RNA_def_string(func, "menu", "", 0, "", "Identifier of the menu."); + RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "itemS", "uiItemS"); + + /* context */ + func= RNA_def_function(srna, "set_context_pointer", "uiLayoutSetContextPointer"); + parm= RNA_def_string(func, "name", "", 0, "Name", "Name of entry in the context."); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context."); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); + + /* templates */ + func= RNA_def_function(srna, "template_header", "uiTemplateHeader"); + parm= RNA_def_pointer(func, "context", "Context", "", "Current context."); + RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "template_ID", "uiTemplateID"); + parm= RNA_def_pointer(func, "context", "Context", "", "Current context."); + RNA_def_property_flag(parm, PROP_REQUIRED); + api_ui_item_rna_common(func); + RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block."); + RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a new ID block."); + RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block."); + + func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier"); + parm= RNA_def_pointer(func, "data", "Modifier", "", "Modifier data."); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); + parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); + RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "template_constraint", "uiTemplateConstraint"); + parm= RNA_def_pointer(func, "data", "Constraint", "", "Constraint data."); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); + parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); + RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "template_preview", "uiTemplatePreview"); + parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock."); + RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping"); + parm= RNA_def_pointer(func, "curvemap", "CurveMapping", "", "Curve mapping pointer."); + RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display."); + + func= RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp"); + parm= RNA_def_pointer(func, "ramp", "ColorRamp", "", "Color ramp pointer."); + RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); + + func= RNA_def_function(srna, "template_layers", "uiTemplateLayers"); + api_ui_item_rna_common(func); +} + +#endif + diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 22ce207c6a9..df07e03850a 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -160,6 +160,8 @@ static void rna_def_windowmanager(BlenderRNA *brna) prop= RNA_def_property(srna, "operators", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "Operator"); RNA_def_property_ui_text(prop, "Operators", "Operator registry."); + + RNA_api_wm(srna); } void RNA_def_wm(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c new file mode 100644 index 00000000000..fd34d7c4d70 --- /dev/null +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -0,0 +1,56 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "RNA_define.h" +#include "RNA_types.h" + +#ifdef RNA_RUNTIME + +#include "BKE_context.h" + +#include "WM_api.h" + +#else + +void RNA_api_wm(StructRNA *srna) +{ + FunctionRNA *func; + PropertyRNA *prop; + + func= RNA_def_function(srna, "add_fileselect", "WM_event_add_fileselect"); + RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT); + RNA_def_function_ui_description(func, "Show up the file selector."); + prop= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call."); + RNA_def_property_flag(prop, PROP_REQUIRED); +} + +#endif + diff --git a/source/blender/python/CMakeLists.txt b/source/blender/python/CMakeLists.txt index d15970e1df4..7700e6bc2aa 100644 --- a/source/blender/python/CMakeLists.txt +++ b/source/blender/python/CMakeLists.txt @@ -24,10 +24,12 @@ # ***** END GPL LICENSE BLOCK ***** FILE(GLOB SRC intern/*.c) +FILE(GLOB GENSRC generic/*.c) SET(INC . ../../../intern/guardedalloc ../blenlib ../makesdna ../makesrna ../blenkernel ../editors/include ../windowmanager ${PYTHON_INC} + ../../../extern/glew/include ) IF(WITH_OPENEXR) @@ -47,3 +49,5 @@ ENDIF(WITH_FFMPEG) ADD_DEFINITIONS(-DWITH_CCGSUBSURF) BLENDERLIB(bf_python "${SRC}" "${INC}") +BLENDERLIB(bf_gen_python "${GENSRC}" "${INC}") + diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 4cdc78297d4..a0fb4865548 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1310,11 +1310,19 @@ static PyObject * pyrna_func_call(PyObject * self, PyObject *args, PyObject *kw) ret= NULL; if (err==0) { /* call function */ - RNA_function_call(self_ptr, self_func, parms); + ReportList reports; + bContext *C= BPy_GetContext(); + + BKE_reports_init(&reports, RPT_STORE); + RNA_function_call(C, &reports, self_ptr, self_func, parms); + + err= (BPy_reports_to_error(&reports))? -1: 0; + BKE_reports_clear(&reports); /* return value */ - if(pret) - ret= pyrna_param_to_py(&funcptr, pret, retdata); + if(err==0) + if(pret) + ret= pyrna_param_to_py(&funcptr, pret, retdata); } /* cleanup */ @@ -2121,7 +2129,7 @@ PyObject *pyrna_basetype_register(PyObject *self, PyObject *args) C= BPy_GetContext(); /* call the register callback */ - BKE_reports_init(&reports, RPT_PRINT); + BKE_reports_init(&reports, RPT_STORE); srna= reg(C, &reports, py_class, bpy_class_validate, bpy_class_call, bpy_class_free); if(!srna) { -- cgit v1.2.3 From 94dbb3bbdd612247f757d1962d2604737eb72f64 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 18 Jun 2009 19:51:22 +0000 Subject: 2.5 Python Merging changes made by Arystanbek in the soc-2009-kazanbas branch, plus some things modified and added by me. * Operator exec is called execute in python now, due to conflicts with python exec keyword. * Operator invoke/execute now get context argument. * Fix crash executing operators due to bpy_import_main_set not being set with Main pointer. * The bpy.props module now has the FloatProperty/IntProperty/ StringProperty/BoolProperty functions to define RNA properties for operators. * Operators now have an __operator__ property to get the actual RNA operator pointers, this is only temporary though. * bpy.ops.add now allows the operator to be already registered, it will simply overwrite the existing one. * Both the ui and io directories are now scanned and run on startup. --- source/blender/python/intern/bpy_interface.c | 100 ++++++++++++----------- source/blender/python/intern/bpy_operator_wrap.c | 74 +++++++++++++---- source/blender/python/intern/bpy_rna.c | 70 +++++++++++++++- source/blender/python/intern/bpy_rna.h | 2 + source/blender/python/intern/bpy_util.c | 4 + 5 files changed, 186 insertions(+), 64 deletions(-) (limited to 'source') diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 0c063c0192b..559ed537757 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -59,6 +59,7 @@ static void bpy_init_modules( void ) PyModule_AddObject( mod, "data", BPY_rna_module() ); /* PyModule_AddObject( mod, "doc", BPY_rna_doc() ); */ PyModule_AddObject( mod, "types", BPY_rna_types() ); + PyModule_AddObject( mod, "props", BPY_rna_props() ); PyModule_AddObject( mod, "ops", BPY_operator_module() ); PyModule_AddObject( mod, "ui", BPY_ui_module() ); // XXX very experemental, consider this a test, especially PyCObject is not meant to be perminant @@ -103,6 +104,7 @@ static PyObject *CreateGlobalDictionary( bContext *C ) {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, ""}, {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, ""}, {"BoolProperty", (PyCFunction)BPy_BoolProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"StringProperty", (PyCFunction)BPy_StringProperty, METH_VARARGS|METH_KEYWORDS, ""}, {NULL, NULL, 0, NULL} }; @@ -369,70 +371,76 @@ void BPY_run_ui_scripts(bContext *C, int reload) DIR *dir; struct dirent *de; char *file_extension; + char *dirname; char path[FILE_MAX]; - char *dirname= BLI_gethome_folder("ui"); - int filelen; /* filename length */ + char *dirs[] = {"io", "ui", NULL}; + int a, filelen; /* filename length */ PyGILState_STATE gilstate; PyObject *mod; PyObject *sys_path_orig; PyObject *sys_path_new; - - if(!dirname) - return; - - dir = opendir(dirname); - if(!dir) - return; - gilstate = PyGILState_Ensure(); - /* backup sys.path */ - sys_path_orig= PySys_GetObject("path"); - Py_INCREF(sys_path_orig); /* dont free it */ - - sys_path_new= PyList_New(1); - PyList_SET_ITEM(sys_path_new, 0, PyUnicode_FromString(dirname)); - PySys_SetObject("path", sys_path_new); - Py_DECREF(sys_path_new); - // XXX - evil, need to access context BPy_SetContext(C); bpy_import_main_set(CTX_data_main(C)); - - while((de = readdir(dir)) != NULL) { - /* We could stat the file but easier just to let python - * import it and complain if theres a problem */ - - file_extension = strstr(de->d_name, ".py"); + + for(a=0; dirs[a]; a++) { + dirname= BLI_gethome_folder(dirs[a]); + + if(!dirname) + continue; + + dir = opendir(dirname); + + if(!dir) + continue; + + /* backup sys.path */ + sys_path_orig= PySys_GetObject("path"); + Py_INCREF(sys_path_orig); /* dont free it */ - if(file_extension && *(file_extension + 3) == '\0') { - filelen = strlen(de->d_name); - BLI_strncpy(path, de->d_name, filelen-2); /* cut off the .py on copy */ + sys_path_new= PyList_New(1); + PyList_SET_ITEM(sys_path_new, 0, PyUnicode_FromString(dirname)); + PySys_SetObject("path", sys_path_new); + Py_DECREF(sys_path_new); - mod= PyImport_ImportModuleLevel(path, NULL, NULL, NULL, 0); - if (mod) { - if (reload) { - PyObject *mod_orig= mod; - mod= PyImport_ReloadModule(mod); - Py_DECREF(mod_orig); - } - } + while((de = readdir(dir)) != NULL) { + /* We could stat the file but easier just to let python + * import it and complain if theres a problem */ + + file_extension = strstr(de->d_name, ".py"); - if(mod) { - Py_DECREF(mod); /* could be NULL from reloading */ - } else { - BPy_errors_to_report(NULL); // TODO - reports - fprintf(stderr, "unable to import \"%s\" %s/%s\n", path, dirname, de->d_name); + if(file_extension && *(file_extension + 3) == '\0') { + filelen = strlen(de->d_name); + BLI_strncpy(path, de->d_name, filelen-2); /* cut off the .py on copy */ + + mod= PyImport_ImportModuleLevel(path, NULL, NULL, NULL, 0); + if (mod) { + if (reload) { + PyObject *mod_orig= mod; + mod= PyImport_ReloadModule(mod); + Py_DECREF(mod_orig); + } + } + + if(mod) { + Py_DECREF(mod); /* could be NULL from reloading */ + } else { + BPy_errors_to_report(NULL); // TODO - reports + fprintf(stderr, "unable to import \"%s\" %s/%s\n", path, dirname, de->d_name); + } + } } - } - closedir(dir); - - PySys_SetObject("path", sys_path_orig); - Py_DECREF(sys_path_orig); + closedir(dir); + + PySys_SetObject("path", sys_path_orig); + Py_DECREF(sys_path_orig); + } bpy_import_main_set(NULL); diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index 9b7893a949b..f4fdd0c6194 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -40,6 +40,8 @@ #include "bpy_compat.h" #include "bpy_util.h" +#include "../generic/bpy_internal_import.h" // our own imports + #define PYOP_ATTR_PROP "__props__" #define PYOP_ATTR_UINAME "__label__" #define PYOP_ATTR_IDNAME "__name__" /* use pythons class name */ @@ -177,9 +179,12 @@ static int PYTHON_OT_generic(int mode, bContext *C, wmOperator *op, wmEvent *eve PyObject *ret= NULL, *py_class_instance, *item= NULL; int ret_flag= (mode==PYOP_POLL ? 0:OPERATOR_CANCELLED); PointerRNA ptr_context; - PyObject *py_context; + PointerRNA ptr_operator; + PyObject *py_operator; PyGILState_STATE gilstate = PyGILState_Ensure(); + + bpy_import_main_set(CTX_data_main(C)); BPY_update_modules(); // XXX - the RNA pointers can change so update before running, would like a nicer solutuon for this. @@ -213,20 +218,29 @@ static int PYTHON_OT_generic(int mode, bContext *C, wmOperator *op, wmEvent *eve RNA_property_collection_end(&iter); } - + + /* set operator pointer RNA as instance "__operator__" attribute */ + RNA_pointer_create(NULL, &RNA_Operator, op, &ptr_operator); + py_operator= pyrna_struct_CreatePyObject(&ptr_operator); + PyObject_SetAttrString(py_class_instance, "__operator__", py_operator); + Py_DECREF(py_operator); + + RNA_pointer_create(NULL, &RNA_Context, C, &ptr_context); if (mode==PYOP_INVOKE) { item= PyObject_GetAttrString(py_class, "invoke"); - args = PyTuple_New(2); - PyTuple_SET_ITEM(args, 1, pyop_dict_from_event(event)); + args = PyTuple_New(3); + + // PyTuple_SET_ITEM "steals" object reference, it is + // an object passed shouldn't be DECREF'ed + PyTuple_SET_ITEM(args, 1, pyrna_struct_CreatePyObject(&ptr_context)); + PyTuple_SET_ITEM(args, 2, pyop_dict_from_event(event)); } else if (mode==PYOP_EXEC) { - item= PyObject_GetAttrString(py_class, "exec"); + item= PyObject_GetAttrString(py_class, "execute"); args = PyTuple_New(2); - RNA_pointer_create(NULL, &RNA_Context, C, &ptr_context); - py_context = pyrna_struct_CreatePyObject(&ptr_context); - PyTuple_SET_ITEM(args, 1, py_context); + PyTuple_SET_ITEM(args, 1, pyrna_struct_CreatePyObject(&ptr_context)); } else if (mode==PYOP_POLL) { item= PyObject_GetAttrString(py_class, "poll"); @@ -258,7 +272,8 @@ static int PYTHON_OT_generic(int mode, bContext *C, wmOperator *op, wmEvent *eve } else if (BPY_flag_from_seq(pyop_ret_flags, ret, &ret_flag) == -1) { /* the returned value could not be converted into a flag */ BPy_errors_to_report(op->reports); - + + ret_flag = OPERATOR_CANCELLED; } /* there is no need to copy the py keyword dict modified by * pyot->py_invoke(), back to the operator props since they are just @@ -271,7 +286,34 @@ static int PYTHON_OT_generic(int mode, bContext *C, wmOperator *op, wmEvent *eve Py_DECREF(ret); } + /* print operator return value */ + if (mode != PYOP_POLL) { + char flag_str[100]; + char class_name[100]; + BPY_flag_def *flag_def = pyop_ret_flags; + + strcpy(flag_str, ""); + + while(flag_def->name) { + if (ret_flag & flag_def->flag) { + if(flag_str[1]) + sprintf(flag_str, "%s | %s", flag_str, flag_def->name); + else + strcpy(flag_str, flag_def->name); + } + flag_def++; + } + + /* get class name */ + item= PyObject_GetAttrString(py_class, PYOP_ATTR_IDNAME); + Py_DECREF(item); + strcpy(class_name, _PyUnicode_AsString(item)); + + fprintf(stderr, "%s's %s returned %s\n", class_name, mode == PYOP_EXEC ? "execute" : "invoke", flag_str); + } + PyGILState_Release(gilstate); + bpy_import_main_set(NULL); return ret_flag; } @@ -321,7 +363,7 @@ void PYTHON_OT_wrapper(wmOperatorType *ot, void *userdata) /* api callbacks, detailed checks dont on adding */ if (PyObject_HasAttrString(py_class, "invoke")) ot->invoke= PYTHON_OT_invoke; - if (PyObject_HasAttrString(py_class, "exec")) + if (PyObject_HasAttrString(py_class, "execute")) ot->exec= PYTHON_OT_exec; if (PyObject_HasAttrString(py_class, "poll")) ot->poll= PYTHON_OT_poll; @@ -374,6 +416,7 @@ void PYTHON_OT_wrapper(wmOperatorType *ot, void *userdata) PyObject *PYOP_wrap_add(PyObject *self, PyObject *py_class) { PyObject *base_class, *item; + wmOperatorType *ot; char *idname= NULL; @@ -384,8 +427,8 @@ PyObject *PYOP_wrap_add(PyObject *self, PyObject *py_class) {PYOP_ATTR_UINAME, 's', 0, BPY_CLASS_ATTR_OPTIONAL}, {PYOP_ATTR_PROP, 'l', 0, BPY_CLASS_ATTR_OPTIONAL}, {PYOP_ATTR_DESCRIPTION, 's', 0, BPY_CLASS_ATTR_NONE_OK}, - {"exec", 'f', 2, BPY_CLASS_ATTR_OPTIONAL}, - {"invoke", 'f', 2, BPY_CLASS_ATTR_OPTIONAL}, + {"execute", 'f', 2, BPY_CLASS_ATTR_OPTIONAL}, + {"invoke", 'f', 3, BPY_CLASS_ATTR_OPTIONAL}, {"poll", 'f', 2, BPY_CLASS_ATTR_OPTIONAL}, {NULL, 0, 0, 0} }; @@ -404,9 +447,10 @@ PyObject *PYOP_wrap_add(PyObject *self, PyObject *py_class) Py_DECREF(item); idname = _PyUnicode_AsString(item); - if (WM_operatortype_find(idname)) { - PyErr_Format( PyExc_AttributeError, "Operator alredy exists with this name \"%s\"", idname); - return NULL; + /* remove if it already exists */ + if ((ot=WM_operatortype_find(idname))) { + Py_XDECREF((PyObject*)ot->pyop_data); + WM_operatortype_remove(idname); } /* If we have properties set, check its a list of dicts */ diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index a0fb4865548..57a4de21443 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1760,7 +1760,44 @@ PyObject *BPY_rna_types(void) return (PyObject *)self; } +static struct PyMethodDef props_methods[] = { + {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"BoolProperty", (PyCFunction)BPy_BoolProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"StringProperty", (PyCFunction)BPy_StringProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {NULL, NULL, 0, NULL} +}; +#if PY_VERSION_HEX >= 0x03000000 +static struct PyModuleDef props_module = { + PyModuleDef_HEAD_INIT, + "bpyprops", + "", + -1,/* multiple "initialization" just copies the module dict. */ + props_methods, + NULL, NULL, NULL, NULL +}; +#endif + +PyObject *BPY_rna_props( void ) +{ + PyObject *submodule, *mod; +#if PY_VERSION_HEX >= 0x03000000 + submodule= PyModule_Create(&props_module); +#else /* Py2.x */ + submodule= Py_InitModule3( "bpy.props", props_methods, "" ); +#endif + + mod = PyModule_New("props"); + PyModule_AddObject( submodule, "props", mod ); + + /* INCREF since its its assumed that all these functions return the + * module with a new ref like PyDict_New, since they are passed to + * PyModule_AddObject which steals a ref */ + Py_INCREF(submodule); + + return submodule; +} /* Orphan functions, not sure where they should go */ @@ -1780,7 +1817,7 @@ PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - if (self) { + if (self && PyCObject_Check(self)) { StructRNA *srna = PyCObject_AsVoidPtr(self); RNA_def_float(srna, id, def, min, max, name, description, soft_min, soft_max); Py_RETURN_NONE; @@ -1807,7 +1844,7 @@ PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - if (self) { + if (self && PyCObject_Check(self)) { StructRNA *srna = PyCObject_AsVoidPtr(self); RNA_def_int(srna, id, def, min, max, name, description, soft_min, soft_max); Py_RETURN_NONE; @@ -1834,7 +1871,7 @@ PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } - if (self) { + if (self && PyCObject_Check(self)) { StructRNA *srna = PyCObject_AsVoidPtr(self); RNA_def_boolean(srna, id, def, name, description); Py_RETURN_NONE; @@ -1847,6 +1884,33 @@ PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) } } +PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw) +{ + static char *kwlist[] = {"attr", "name", "description", "maxlen", "default", NULL}; + char *id, *name="", *description="", *def=""; + int maxlen=0; + + if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssis:StringProperty", kwlist, &id, &name, &description, &maxlen, &def)) + return NULL; + + if (PyTuple_Size(args) > 0) { + PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + return NULL; + } + + if (self && PyCObject_Check(self)) { + StructRNA *srna = PyCObject_AsVoidPtr(self); + RNA_def_string(srna, id, def, maxlen, name, description); + Py_RETURN_NONE; + } else { + PyObject *ret = PyTuple_New(2); + PyTuple_SET_ITEM(ret, 0, PyCObject_FromVoidPtr((void *)BPy_StringProperty, NULL)); + PyTuple_SET_ITEM(ret, 1, kw); + Py_INCREF(kw); + return ret; + } +} + /*-------------------- Type Registration ------------------------*/ static int rna_function_arg_count(FunctionRNA *func) diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index a2a3015912b..d2f01b06336 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -63,6 +63,7 @@ typedef struct { PyObject *BPY_rna_module( void ); /*PyObject *BPY_rna_doc( void );*/ PyObject *BPY_rna_types( void ); +PyObject *BPY_rna_props( void ); PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr ); PyObject *pyrna_prop_CreatePyObject( PointerRNA *ptr, PropertyRNA *prop ); @@ -76,6 +77,7 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop); PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw); PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw); PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw); +PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw); /* function for registering types */ PyObject *pyrna_basetype_register(PyObject *self, PyObject *args); diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index d5b131583dc..d837892fb4d 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -81,6 +81,7 @@ int BPY_flag_from_seq(BPY_flag_def *flagdef, PyObject *seq, int *flag) char *cstring; PyObject *item; BPY_flag_def *fd; + *flag = 0; if (PySequence_Check(seq)) { i= PySequence_Length(seq); @@ -108,6 +109,9 @@ int BPY_flag_from_seq(BPY_flag_def *flagdef, PyObject *seq, int *flag) error_val= 1; } + if (*flag == 0) + error_val = 1; + if (error_val) { char *buf = bpy_flag_error_str(flagdef); PyErr_SetString(PyExc_AttributeError, buf); -- cgit v1.2.3 From dd250f7d85ba5ce0d44ec9dfb4ffb770813834aa Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Thu, 18 Jun 2009 20:13:17 +0000 Subject: 2.5 Missing { when WITH_LCMS is defined. --- source/blender/makesrna/intern/rna_space.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 3b8b88beaff..41acc458cd9 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -62,7 +62,7 @@ EnumPropertyItem space_type_items[] = { #define DC_ALPHA {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel."} #define DC_Z {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer", "Draw Z-buffer associated with image (mapped from camera clip start to end)."} #ifdef WITH_LCMS -#define DC_LCMS SI_COLOR_CORRECTION, "COLOR_CORRECTED", ICON_IMAGE_ALPHA, "Color Corrected", "Display color corrected image."} +#define DC_LCMS {SI_COLOR_CORRECTION, "COLOR_CORRECTED", ICON_IMAGE_ALPHA, "Color Corrected", "Display color corrected image."} #else #define DC_LCMS {0, NULL, 0, NULL, NULL} #endif -- cgit v1.2.3 From 2269280910755a2be77fed2767a52f2026b0e55b Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Thu, 18 Jun 2009 20:23:46 +0000 Subject: don't include stdint.h directly, it's broken on non C99 compliant compilers (you know which one I'm talking about). --- source/gameengine/Expressions/ListValue.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index d3df36fbff0..59344ddb7b7 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -18,9 +18,10 @@ #include "StringValue.h" #include "VoidValue.h" #include -#include #include "BoolValue.h" +#include "BLO_sys_types.h" /* for intptr_t support */ + #ifdef HAVE_CONFIG_H #include #endif -- cgit v1.2.3 From 96003b5b73d2dddac2daad5d38dc81f03b3c7738 Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Thu, 18 Jun 2009 20:45:58 +0000 Subject: Revert a small change to kerning, Matt please let me know if now it's fine (or like before). --- source/blender/blenfont/intern/blf_font.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 921f5cac67c..ee4ba0ee71a 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -146,18 +146,20 @@ void blf_font_draw(FontBLF *font, char *str) if (FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta) == 0) { pen_x += delta.x >> 6; - +/* if (pen_x < old_pen_x) pen_x= old_pen_x; +*/ } } if (font->flags & BLF_USER_KERNING) { old_pen_x= pen_x; pen_x += font->kerning; - +/* if (pen_x < old_pen_x) pen_x= old_pen_x; +*/ } /* do not return this loop if clipped, we want every character tested */ @@ -226,18 +228,20 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) if (FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta) == 0) { pen_x += delta.x >> 6; - +/* if (pen_x < old_pen_x) old_pen_x= pen_x; +*/ } } if (font->flags & BLF_USER_KERNING) { old_pen_x= pen_x; pen_x += font->kerning; - +/* if (pen_x < old_pen_x) old_pen_x= pen_x; +*/ } gbox.xmin= g->box.xmin + pen_x; -- cgit v1.2.3 From b6182781b0ab2d10c12b4a547cba5222f39f5edf Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Thu, 18 Jun 2009 21:25:21 +0000 Subject: Fix for compiler error since BLO_sys_types.h was not in the path --- source/gameengine/Expressions/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/Expressions/SConscript b/source/gameengine/Expressions/SConscript index b5c69eafe6b..07cab62c020 100644 --- a/source/gameengine/Expressions/SConscript +++ b/source/gameengine/Expressions/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('*.cpp') -incs ='. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/SceneGraph' +incs ='. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/SceneGraph #source/blender/blenloader' incs += ' ' + env['BF_PYTHON_INC'] cxxflags = [] -- cgit v1.2.3 From 4f9e0ec06ed8498f34d30fa9a4a7b264b85d4d0e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 18 Jun 2009 23:12:29 +0000 Subject: Update Mathutils for py3k * removed coercing types which has been removed from py3. * matrix uses getset's rather then getset items. * removed deprecated functions. --- source/blender/python/generic/Mathutils.c | 236 ------------------------------ source/blender/python/generic/Mathutils.h | 12 -- source/blender/python/generic/matrix.c | 181 +++++++++-------------- source/blender/python/generic/matrix.h | 4 - source/blender/python/generic/quat.c | 115 +++++---------- source/blender/python/generic/quat.h | 4 - source/blender/python/generic/vector.c | 147 +++++++------------ 7 files changed, 166 insertions(+), 533 deletions(-) (limited to 'source') diff --git a/source/blender/python/generic/Mathutils.c b/source/blender/python/generic/Mathutils.c index 1e2e59edbaf..637a42e2aa1 100644 --- a/source/blender/python/generic/Mathutils.c +++ b/source/blender/python/generic/Mathutils.c @@ -41,27 +41,16 @@ static char M_Mathutils_Matrix_doc[] = "() - create a new matrix object from a l static char M_Mathutils_Quaternion_doc[] = "() - create a quaternion from a list or an axis of rotation and an angle"; static char M_Mathutils_Euler_doc[] = "() - create and return a new euler object"; static char M_Mathutils_Rand_doc[] = "() - return a random number"; -static char M_Mathutils_CrossVecs_doc[] = "() - returns a vector perpedicular to the 2 vectors crossed"; -static char M_Mathutils_CopyVec_doc[] = "() - create a copy of vector"; -static char M_Mathutils_DotVecs_doc[] = "() - return the dot product of two vectors"; static char M_Mathutils_AngleBetweenVecs_doc[] = "() - returns the angle between two vectors in degrees"; static char M_Mathutils_MidpointVecs_doc[] = "() - return the vector to the midpoint between two vectors"; -static char M_Mathutils_MatMultVec_doc[] = "() - multiplies a matrix by a column vector"; -static char M_Mathutils_VecMultMat_doc[] = "() - multiplies a row vector by a matrix"; static char M_Mathutils_ProjectVecs_doc[] = "() - returns the projection vector from the projection of vecA onto vecB"; static char M_Mathutils_RotationMatrix_doc[] = "() - construct a rotation matrix from an angle and axis of rotation"; static char M_Mathutils_ScaleMatrix_doc[] = "() - construct a scaling matrix from a scaling factor"; static char M_Mathutils_OrthoProjectionMatrix_doc[] = "() - construct a orthographic projection matrix from a selected plane"; static char M_Mathutils_ShearMatrix_doc[] = "() - construct a shearing matrix from a plane of shear and a shear factor"; -static char M_Mathutils_CopyMat_doc[] = "() - create a copy of a matrix"; static char M_Mathutils_TranslationMatrix_doc[] = "(vec) - create a translation matrix from a vector"; -static char M_Mathutils_CopyQuat_doc[] = "() - copy quatB to quatA"; -static char M_Mathutils_CopyEuler_doc[] = "() - copy eulB to eultA"; -static char M_Mathutils_CrossQuats_doc[] = "() - return the mutliplication of two quaternions"; -static char M_Mathutils_DotQuats_doc[] = "() - return the dot product of two quaternions"; static char M_Mathutils_Slerp_doc[] = "() - returns the interpolation between two quaternions"; static char M_Mathutils_DifferenceQuats_doc[] = "() - return the angular displacment difference between two quats"; -static char M_Mathutils_RotateEuler_doc[] = "() - rotate euler by an axis and angle"; static char M_Mathutils_Intersect_doc[] = "(v1, v2, v3, ray, orig, clip=1) - returns the intersection between a ray and a triangle, if possible, returns None otherwise"; static char M_Mathutils_TriangleArea_doc[] = "(v1, v2, v3) - returns the area size of the 2D or 3D triangle defined"; static char M_Mathutils_TriangleNormal_doc[] = "(v1, v2, v3) - returns the normal of the 3D triangle defined"; @@ -71,30 +60,19 @@ static char M_Mathutils_LineIntersect_doc[] = "(v1, v2, v3, v4) - returns a tupl struct PyMethodDef M_Mathutils_methods[] = { {"Rand", (PyCFunction) M_Mathutils_Rand, METH_VARARGS, M_Mathutils_Rand_doc}, {"Vector", (PyCFunction) M_Mathutils_Vector, METH_VARARGS, M_Mathutils_Vector_doc}, - {"CrossVecs", (PyCFunction) M_Mathutils_CrossVecs, METH_VARARGS, M_Mathutils_CrossVecs_doc}, - {"DotVecs", (PyCFunction) M_Mathutils_DotVecs, METH_VARARGS, M_Mathutils_DotVecs_doc}, {"AngleBetweenVecs", (PyCFunction) M_Mathutils_AngleBetweenVecs, METH_VARARGS, M_Mathutils_AngleBetweenVecs_doc}, {"MidpointVecs", (PyCFunction) M_Mathutils_MidpointVecs, METH_VARARGS, M_Mathutils_MidpointVecs_doc}, - {"VecMultMat", (PyCFunction) M_Mathutils_VecMultMat, METH_VARARGS, M_Mathutils_VecMultMat_doc}, {"ProjectVecs", (PyCFunction) M_Mathutils_ProjectVecs, METH_VARARGS, M_Mathutils_ProjectVecs_doc}, - {"CopyVec", (PyCFunction) M_Mathutils_CopyVec, METH_VARARGS, M_Mathutils_CopyVec_doc}, {"Matrix", (PyCFunction) M_Mathutils_Matrix, METH_VARARGS, M_Mathutils_Matrix_doc}, {"RotationMatrix", (PyCFunction) M_Mathutils_RotationMatrix, METH_VARARGS, M_Mathutils_RotationMatrix_doc}, {"ScaleMatrix", (PyCFunction) M_Mathutils_ScaleMatrix, METH_VARARGS, M_Mathutils_ScaleMatrix_doc}, {"ShearMatrix", (PyCFunction) M_Mathutils_ShearMatrix, METH_VARARGS, M_Mathutils_ShearMatrix_doc}, {"TranslationMatrix", (PyCFunction) M_Mathutils_TranslationMatrix, METH_O, M_Mathutils_TranslationMatrix_doc}, - {"CopyMat", (PyCFunction) M_Mathutils_CopyMat, METH_VARARGS, M_Mathutils_CopyMat_doc}, {"OrthoProjectionMatrix", (PyCFunction) M_Mathutils_OrthoProjectionMatrix, METH_VARARGS, M_Mathutils_OrthoProjectionMatrix_doc}, - {"MatMultVec", (PyCFunction) M_Mathutils_MatMultVec, METH_VARARGS, M_Mathutils_MatMultVec_doc}, {"Quaternion", (PyCFunction) M_Mathutils_Quaternion, METH_VARARGS, M_Mathutils_Quaternion_doc}, - {"CopyQuat", (PyCFunction) M_Mathutils_CopyQuat, METH_VARARGS, M_Mathutils_CopyQuat_doc}, - {"CrossQuats", (PyCFunction) M_Mathutils_CrossQuats, METH_VARARGS, M_Mathutils_CrossQuats_doc}, - {"DotQuats", (PyCFunction) M_Mathutils_DotQuats, METH_VARARGS, M_Mathutils_DotQuats_doc}, {"DifferenceQuats", (PyCFunction) M_Mathutils_DifferenceQuats, METH_VARARGS,M_Mathutils_DifferenceQuats_doc}, {"Slerp", (PyCFunction) M_Mathutils_Slerp, METH_VARARGS, M_Mathutils_Slerp_doc}, {"Euler", (PyCFunction) M_Mathutils_Euler, METH_VARARGS, M_Mathutils_Euler_doc}, - {"CopyEuler", (PyCFunction) M_Mathutils_CopyEuler, METH_VARARGS, M_Mathutils_CopyEuler_doc}, - {"RotateEuler", (PyCFunction) M_Mathutils_RotateEuler, METH_VARARGS, M_Mathutils_RotateEuler_doc}, {"Intersect", ( PyCFunction ) M_Mathutils_Intersect, METH_VARARGS, M_Mathutils_Intersect_doc}, {"TriangleArea", ( PyCFunction ) M_Mathutils_TriangleArea, METH_VARARGS, M_Mathutils_TriangleArea_doc}, {"TriangleNormal", ( PyCFunction ) M_Mathutils_TriangleNormal, METH_VARARGS, M_Mathutils_TriangleNormal_doc}, @@ -356,49 +334,6 @@ PyObject *M_Mathutils_Vector(PyObject * self, PyObject * args) Py_DECREF(listObject); return newVectorObject(vec, size, Py_NEW); } -//----------------------------------Mathutils.CrossVecs() --------------- -//finds perpendicular vector - only 3D is supported -PyObject *M_Mathutils_CrossVecs(PyObject * self, PyObject * args) -{ - PyObject *vecCross = NULL; - VectorObject *vec1 = NULL, *vec2 = NULL; - - if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2)) { - PyErr_SetString(PyExc_TypeError, "Mathutils.CrossVecs(): expects (2) 3D vector objects\n"); - return NULL; - } - - if(vec1->size != 3 || vec2->size != 3) { - PyErr_SetString(PyExc_AttributeError, "Mathutils.CrossVecs(): expects (2) 3D vector objects\n"); - return NULL; - } - vecCross = newVectorObject(NULL, 3, Py_NEW); - Crossf(((VectorObject*)vecCross)->vec, vec1->vec, vec2->vec); - return vecCross; -} -//----------------------------------Mathutils.DotVec() ------------------- -//calculates the dot product of two vectors -PyObject *M_Mathutils_DotVecs(PyObject * self, PyObject * args) -{ - VectorObject *vec1 = NULL, *vec2 = NULL; - double dot = 0.0f; - int x; - - if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec1, &vector_Type, &vec2)) { - PyErr_SetString(PyExc_TypeError, "Mathutils.DotVecs(): expects (2) vector objects of the same size\n"); - return NULL; - } - - if(vec1->size != vec2->size) { - PyErr_SetString(PyExc_AttributeError, "Mathutils.DotVecs(): expects (2) vector objects of the same size\n"); - return NULL; - } - - for(x = 0; x < vec1->size; x++) { - dot += vec1->vec[x] * vec2->vec[x]; - } - return PyFloat_FromDouble(dot); -} //----------------------------------Mathutils.AngleBetweenVecs() --------- //calculates the angle between 2 vectors PyObject *M_Mathutils_AngleBetweenVecs(PyObject * self, PyObject * args) @@ -1100,39 +1035,7 @@ PyObject *M_Mathutils_Quaternion(PyObject * self, PyObject * args) Py_DECREF(listObject); return newQuaternionObject(quat, Py_NEW); } -//----------------------------------Mathutils.CrossQuats() ---------------- -//quaternion multiplication - associate not commutative -PyObject *M_Mathutils_CrossQuats(PyObject * self, PyObject * args) -{ - QuaternionObject *quatU = NULL, *quatV = NULL; - float quat[4]; - - if(!PyArg_ParseTuple(args, "O!O!", &quaternion_Type, &quatU, &quaternion_Type, &quatV)) { - PyErr_SetString(PyExc_TypeError,"Mathutils.CrossQuats(): expected Quaternion types"); - return NULL; - } - QuatMul(quat, quatU->quat, quatV->quat); - - return newQuaternionObject(quat, Py_NEW); -} -//----------------------------------Mathutils.DotQuats() ---------------- -//returns the dot product of 2 quaternions -PyObject *M_Mathutils_DotQuats(PyObject * self, PyObject * args) -{ - QuaternionObject *quatU = NULL, *quatV = NULL; - double dot = 0.0f; - int x; - - if(!PyArg_ParseTuple(args, "O!O!", &quaternion_Type, &quatU, &quaternion_Type, &quatV)) { - PyErr_SetString(PyExc_TypeError, "Mathutils.DotQuats(): expected Quaternion types"); - return NULL; - } - for(x = 0; x < 4; x++) { - dot += quatU->quat[x] * quatV->quat[x]; - } - return PyFloat_FromDouble(dot); -} //----------------------------------Mathutils.DifferenceQuats() --------- //returns the difference between 2 quaternions PyObject *M_Mathutils_DifferenceQuats(PyObject * self, PyObject * args) @@ -1533,145 +1436,6 @@ PyObject *M_Mathutils_TriangleArea( PyObject * self, PyObject * args ) return NULL; } } -//#############################DEPRECATED################################ -//####################################################################### -//----------------------------------Mathutils.CopyMat() ----------------- -//copies a matrix into a new matrix -PyObject *M_Mathutils_CopyMat(PyObject * self, PyObject * args) -{ - PyObject *matrix = NULL; - static char warning = 1; - - if( warning ) { - printf("Mathutils.CopyMat(): deprecated :use Mathutils.Matrix() to copy matrices\n"); - --warning; - } - - matrix = M_Mathutils_Matrix(self, args); - if(matrix == NULL) - return NULL; //error string already set if we get here - else - return matrix; -} -//----------------------------------Mathutils.CopyVec() ----------------- -//makes a new vector that is a copy of the input -PyObject *M_Mathutils_CopyVec(PyObject * self, PyObject * args) -{ - PyObject *vec = NULL; - static char warning = 1; - - if( warning ) { - printf("Mathutils.CopyVec(): Deprecated: use Mathutils.Vector() to copy vectors\n"); - --warning; - } - - vec = M_Mathutils_Vector(self, args); - if(vec == NULL) - return NULL; //error string already set if we get here - else - return vec; -} -//----------------------------------Mathutils.CopyQuat() -------------- -//Copies a quaternion to a new quat -PyObject *M_Mathutils_CopyQuat(PyObject * self, PyObject * args) -{ - PyObject *quat = NULL; - static char warning = 1; - - if( warning ) { - printf("Mathutils.CopyQuat(): Deprecated: use Mathutils.Quaternion() to copy vectors\n"); - --warning; - } - - quat = M_Mathutils_Quaternion(self, args); - if(quat == NULL) - return NULL; //error string already set if we get here - else - return quat; -} -//----------------------------------Mathutils.CopyEuler() --------------- -//copies a euler to a new euler -PyObject *M_Mathutils_CopyEuler(PyObject * self, PyObject * args) -{ - PyObject *eul = NULL; - static char warning = 1; - - if( warning ) { - printf("Mathutils.CopyEuler(): deprecated:use Mathutils.Euler() to copy vectors\n"); - --warning; - } - - eul = M_Mathutils_Euler(self, args); - if(eul == NULL) - return NULL; //error string already set if we get here - else - return eul; -} -//----------------------------------Mathutils.RotateEuler() ------------ -//rotates a euler a certain amount and returns the result -//should return a unique euler rotation (i.e. no 720 degree pitches :) -PyObject *M_Mathutils_RotateEuler(PyObject * self, PyObject * args) -{ - EulerObject *Eul = NULL; - float angle; - char *axis; - static char warning = 1; - - if( warning ) { - printf("Mathutils.RotateEuler(): Deprecated:use Euler.rotate() to rotate a euler\n"); - --warning; - } - - if(!PyArg_ParseTuple(args, "O!fs", &euler_Type, &Eul, &angle, &axis)) { - PyErr_SetString(PyExc_TypeError, "Mathutils.RotateEuler(): expected euler type & float & string"); - return NULL; - } - - Euler_Rotate(Eul, Py_BuildValue("fs", angle, axis)); - Py_RETURN_NONE; -} -//----------------------------------Mathutils.MatMultVec() -------------- -//COLUMN VECTOR Multiplication (Matrix X Vector) -PyObject *M_Mathutils_MatMultVec(PyObject * self, PyObject * args) -{ - MatrixObject *mat = NULL; - VectorObject *vec = NULL; - static char warning = 1; - - if( warning ) { - printf("Mathutils.MatMultVec(): Deprecated: use matrix * vec to perform column vector multiplication\n"); - --warning; - } - - //get pyObjects - if(!PyArg_ParseTuple(args, "O!O!", &matrix_Type, &mat, &vector_Type, &vec)) { - PyErr_SetString(PyExc_TypeError, "Mathutils.MatMultVec(): MatMultVec() expects a matrix and a vector object - in that order\n"); - return NULL; - } - - return column_vector_multiplication(mat, vec); -} -//----------------------------------Mathutils.VecMultMat() --------------- -//ROW VECTOR Multiplication - Vector X Matrix -PyObject *M_Mathutils_VecMultMat(PyObject * self, PyObject * args) -{ - MatrixObject *mat = NULL; - VectorObject *vec = NULL; - static char warning = 1; - - if( warning ) { - printf("Mathutils.VecMultMat(): Deprecated: use vec * matrix to perform row vector multiplication\n"); - --warning; - } - - //get pyObjects - if(!PyArg_ParseTuple(args, "O!O!", &vector_Type, &vec, &matrix_Type, &mat)) { - PyErr_SetString(PyExc_TypeError, "Mathutils.VecMultMat(): VecMultMat() expects a vector and matrix object - in that order\n"); - return NULL; - } - - return row_vector_multiplication(vec, mat); -} /* Utility functions */ diff --git a/source/blender/python/generic/Mathutils.h b/source/blender/python/generic/Mathutils.h index 173922fe09a..af984c58db8 100644 --- a/source/blender/python/generic/Mathutils.h +++ b/source/blender/python/generic/Mathutils.h @@ -64,18 +64,6 @@ PyObject *M_Mathutils_TriangleArea( PyObject * self, PyObject * args ); PyObject *M_Mathutils_TriangleNormal( PyObject * self, PyObject * args ); PyObject *M_Mathutils_QuadNormal( PyObject * self, PyObject * args ); PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args ); -//DEPRECATED -PyObject *M_Mathutils_CopyMat(PyObject * self, PyObject * args); -PyObject *M_Mathutils_CopyVec(PyObject * self, PyObject * args); -PyObject *M_Mathutils_CopyQuat(PyObject * self, PyObject * args); -PyObject *M_Mathutils_CopyEuler(PyObject * self, PyObject * args); -PyObject *M_Mathutils_RotateEuler(PyObject * self, PyObject * args); -PyObject *M_Mathutils_MatMultVec(PyObject * self, PyObject * args); -PyObject *M_Mathutils_VecMultMat(PyObject * self, PyObject * args); -PyObject *M_Mathutils_CrossVecs(PyObject * self, PyObject * args); -PyObject *M_Mathutils_DotVecs(PyObject * self, PyObject * args); -PyObject *M_Mathutils_CrossQuats(PyObject * self, PyObject * args); -PyObject *M_Mathutils_DotQuats(PyObject * self, PyObject * args); int EXPP_FloatsAreEqual(float A, float B, int floatSteps); int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps); diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c index 16c72d69dde..4b2c9d4a8a7 100644 --- a/source/blender/python/generic/matrix.c +++ b/source/blender/python/generic/matrix.c @@ -387,7 +387,6 @@ PyObject *Matrix_copy(MatrixObject * self) /*free the py_object*/ static void Matrix_dealloc(MatrixObject * self) { - Py_XDECREF(self->coerced_object); PyMem_Free(self->matrix); /*only free py_data*/ if(self->data.py_data){ @@ -395,35 +394,7 @@ static void Matrix_dealloc(MatrixObject * self) } PyObject_DEL(self); } -/*----------------------------getattr()(internal) ----------------*/ -/*object.attribute access (get)*/ -static PyObject *Matrix_getattr(MatrixObject * self, char *name) -{ - if(STREQ(name, "rowSize")) { - return PyLong_FromLong((long) self->rowSize); - } else if(STREQ(name, "colSize")) { - return PyLong_FromLong((long) self->colSize); - } - if(STREQ(name, "wrapped")){ - if(self->wrapped == Py_WRAP) - Py_RETURN_TRUE; - else - Py_RETURN_FALSE; - } -#if 0 //XXX - return Py_FindMethod(Matrix_methods, (PyObject *) self, name); -#else - PyErr_SetString(PyExc_AttributeError, "blender 2.5 is not finished yet"); - return NULL; -#endif -} -/*----------------------------setattr()(internal) ----------------*/ -/*object.attribute access (set)*/ -static int Matrix_setattr(MatrixObject * self, char *name, PyObject * v) -{ - /* This is not supported. */ - return (-1); -} + /*----------------------------print object (internal)-------------*/ /*print the object to screen*/ static PyObject *Matrix_repr(MatrixObject * self) @@ -672,7 +643,7 @@ static PyObject *Matrix_add(PyObject * m1, PyObject * m2) mat1 = (MatrixObject*)m1; mat2 = (MatrixObject*)m2; - if(mat1->coerced_object || mat2->coerced_object){ + if(!MatrixObject_Check(m1) || !MatrixObject_Check(m2)) { PyErr_SetString(PyExc_AttributeError, "Matrix addition: arguments not valid for this operation...."); return NULL; } @@ -701,7 +672,7 @@ static PyObject *Matrix_sub(PyObject * m1, PyObject * m2) mat1 = (MatrixObject*)m1; mat2 = (MatrixObject*)m2; - if(mat1->coerced_object || mat2->coerced_object){ + if(!MatrixObject_Check(m1) || !MatrixObject_Check(m2)) { PyErr_SetString(PyExc_AttributeError, "Matrix addition: arguments not valid for this operation...."); return NULL; } @@ -728,22 +699,31 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; double dot = 0.0f; MatrixObject *mat1 = NULL, *mat2 = NULL; - PyObject *f = NULL; - mat1 = (MatrixObject*)m1; - mat2 = (MatrixObject*)m2; + if(MatrixObject_Check(m1)) mat1 = (MatrixObject*)m1; + if(MatrixObject_Check(m2)) mat2 = (MatrixObject*)m2; - if(mat1->coerced_object){ - if (PyFloat_Check(mat1->coerced_object) || - PyLong_Check(mat1->coerced_object)){ /*FLOAT/INT * MATRIX*/ - f = PyNumber_Float(mat1->coerced_object); - if(f == NULL) { /*parsed item not a number*/ - PyErr_SetString(PyExc_TypeError, "Matrix multiplication: arguments not acceptable for this operation"); - return NULL; + if(mat1 && mat2) { /*MATRIX * MATRIX*/ + if(mat1->colSize != mat2->rowSize){ + PyErr_SetString(PyExc_AttributeError,"Matrix multiplication: matrix A rowsize must equal matrix B colsize"); + return NULL; + } + for(x = 0; x < mat1->rowSize; x++) { + for(y = 0; y < mat2->colSize; y++) { + for(z = 0; z < mat1->colSize; z++) { + dot += (mat1->matrix[x][z] * mat2->matrix[z][y]); + } + mat[((x * mat1->rowSize) + y)] = (float)dot; + dot = 0.0f; } - - scalar = (float)PyFloat_AS_DOUBLE(f); - Py_DECREF(f); + } + + return newMatrixObject(mat, mat1->rowSize, mat2->colSize, Py_NEW); + } + + if(mat1==NULL){ + scalar=PyFloat_AsDouble(m1); // may not be a float... + if ((scalar == -1.0 && PyErr_Occurred())==0) { /*FLOAT/INT * MATRIX, this line annoys theeth, lets see if he finds it */ for(x = 0; x < mat2->rowSize; x++) { for(y = 0; y < mat2->colSize; y++) { mat[((x * mat2->colSize) + y)] = scalar * mat2->matrix[x][y]; @@ -751,22 +731,18 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) } return newMatrixObject(mat, mat2->rowSize, mat2->colSize, Py_NEW); } - }else{ - if(mat2->coerced_object){ - /* MATRIX * VECTOR operation is now being done by vector */ - /*if(VectorObject_Check(mat2->coerced_object)){ - vec = (VectorObject*)mat2->coerced_object; - return column_vector_multiplication(mat1, vec); - }else */ - if (PyFloat_Check(mat2->coerced_object) || PyLong_Check(mat2->coerced_object)){ /*MATRIX * FLOAT/INT*/ - f = PyNumber_Float(mat2->coerced_object); - if(f == NULL) { /*parsed item not a number*/ - PyErr_SetString(PyExc_TypeError, "Matrix multiplication: arguments not acceptable for this operation\n"); - return NULL; - } - - scalar = (float)PyFloat_AS_DOUBLE(f); - Py_DECREF(f); + + PyErr_SetString(PyExc_TypeError, "Matrix multiplication: arguments not acceptable for this operation"); + return NULL; + } + else /* if(mat1) { */ { + + if(VectorObject_Check(m2)) { /* MATRIX*VECTOR */ + return column_vector_multiplication(mat1, (VectorObject *)m2); + } + else { + scalar= PyFloat_AsDouble(m2); + if ((scalar == -1.0 && PyErr_Occurred())==0) { /* MATRIX*FLOAT/INT */ for(x = 0; x < mat1->rowSize; x++) { for(y = 0; y < mat1->colSize; y++) { mat[((x * mat1->colSize) + y)] = scalar * mat1->matrix[x][y]; @@ -774,22 +750,9 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) } return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW); } - }else{ /*MATRIX * MATRIX*/ - if(mat1->colSize != mat2->rowSize){ - PyErr_SetString(PyExc_AttributeError,"Matrix multiplication: matrix A rowsize must equal matrix B colsize"); - return NULL; - } - for(x = 0; x < mat1->rowSize; x++) { - for(y = 0; y < mat2->colSize; y++) { - for(z = 0; z < mat1->colSize; z++) { - dot += (mat1->matrix[x][z] * mat2->matrix[z][y]); - } - mat[((x * mat1->rowSize) + y)] = (float)dot; - dot = 0.0f; - } - } - return newMatrixObject(mat, mat1->rowSize, mat2->colSize, Py_NEW); } + PyErr_SetString(PyExc_TypeError, "Matrix multiplication: arguments not acceptable for this operation"); + return NULL; } PyErr_SetString(PyExc_TypeError, "Matrix multiplication: arguments not acceptable for this operation\n"); @@ -799,29 +762,7 @@ static PyObject* Matrix_inv(MatrixObject *self) { return Matrix_Invert(self); } -/*------------------------coerce(obj, obj)----------------------- - coercion of unknown types to type MatrixObject for numeric protocols. - - Coercion() is called whenever a math operation has 2 operands that - it doesn't understand how to evaluate. 2+Matrix for example. We want to - evaluate some of these operations like: (vector * 2), however, for math - to proceed, the unknown operand must be cast to a type that python math will - understand. (e.g. in the case above case, 2 must be cast to a vector and - then call vector.multiply(vector, scalar_cast_as_vector)*/ -static int Matrix_coerce(PyObject ** m1, PyObject ** m2) -{ - if(VectorObject_Check(*m2) || PyFloat_Check(*m2) || PyLong_Check(*m2)) { - PyObject *coerced = (PyObject *)(*m2); - Py_INCREF(coerced); - *m2 = newMatrixObject(NULL,3,3,Py_NEW); - ((MatrixObject*)*m2)->coerced_object = coerced; - Py_INCREF (*m1); - return 0; - } - PyErr_SetString(PyExc_TypeError, "matrix.coerce(): unknown operand - can't coerce for numeric protocols"); - return -1; -} /*-----------------PROTOCOL DECLARATIONS--------------------------*/ static PySequenceMethods Matrix_SeqMethods = { (inquiry) Matrix_len, /* sq_length */ @@ -850,17 +791,42 @@ static PyNumberMethods Matrix_NumMethods = { (binaryfunc) 0, /* __and__ */ (binaryfunc) 0, /* __xor__ */ (binaryfunc) 0, /* __or__ */ -#if 0 // XXX 2.5 - (coercion) Matrix_coerce, /* __coerce__ */ -#else - 0, -#endif + /*(coercion)*/ 0, /* __coerce__ */ (unaryfunc) 0, /* __int__ */ (unaryfunc) 0, /* __long__ */ (unaryfunc) 0, /* __float__ */ (unaryfunc) 0, /* __oct__ */ (unaryfunc) 0, /* __hex__ */ }; + +static PyObject *Matrix_getRowSize( MatrixObject * self, void *type ) +{ + return PyLong_FromLong((long) self->rowSize); +} + +static PyObject *Matrix_getColSize( MatrixObject * self, void *type ) +{ + return PyLong_FromLong((long) self->colSize); +} + +static PyObject *Matrix_getWrapped( MatrixObject * self, void *type ) +{ + if (self->wrapped == Py_WRAP) + Py_RETURN_TRUE; + else + Py_RETURN_FALSE; +} + +/*****************************************************************************/ +/* Python attributes get/set structure: */ +/*****************************************************************************/ +static PyGetSetDef Matrix_getseters[] = { + {"rowSize", (getter)Matrix_getRowSize, (setter)NULL, "", NULL}, + {"colSize", (getter)Matrix_getColSize, (setter)NULL, "", NULL}, + {"wrapped", (getter)Matrix_getWrapped, (setter)NULL, "", NULL}, + {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ +}; + /*------------------PY_OBECT DEFINITION--------------------------*/ PyTypeObject matrix_Type = { #if (PY_VERSION_HEX >= 0x02060000) @@ -875,8 +841,8 @@ PyTypeObject matrix_Type = { 0, /*tp_itemsize*/ (destructor)Matrix_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ - (getattrfunc)Matrix_getattr, /*tp_getattr*/ - (setattrfunc) Matrix_setattr, /*tp_setattr*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ 0, /*tp_compare*/ (reprfunc) Matrix_repr, /*tp_repr*/ &Matrix_NumMethods, /*tp_as_number*/ @@ -896,9 +862,9 @@ PyTypeObject matrix_Type = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - 0, /*tp_methods*/ + Matrix_methods, /*tp_methods*/ 0, /*tp_members*/ - 0, /*tp_getset*/ + Matrix_getseters, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -949,7 +915,6 @@ PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type) self->data.py_data = NULL; self->rowSize = rowSize; self->colSize = colSize; - self->coerced_object = NULL; if(type == Py_WRAP){ self->data.blend_data = mat; diff --git a/source/blender/python/generic/matrix.h b/source/blender/python/generic/matrix.h index fd51d99c455..4658f4b5f6c 100644 --- a/source/blender/python/generic/matrix.h +++ b/source/blender/python/generic/matrix.h @@ -48,11 +48,7 @@ typedef struct _Matrix { int rowSize; int colSize; int wrapped; /*is wrapped data?*/ - PyObject *coerced_object; } MatrixObject; -/*coerced_object is a pointer to the object that it was -coerced from when a dummy vector needs to be created from -the coerce() function for numeric protocol operations*/ /*struct data contains a pointer to the actual data that the object uses. It can use either PyMem allocated data (which will diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c index ca703f12907..c3c9e28c520 100644 --- a/source/blender/python/generic/quat.c +++ b/source/blender/python/generic/quat.c @@ -208,7 +208,6 @@ PyObject *Quaternion_copy(QuaternionObject * self) //free the py_object static void Quaternion_dealloc(QuaternionObject * self) { - Py_XDECREF(self->coerced_object); //only free py_data if(self->data.py_data){ PyMem_Free(self->data.py_data); @@ -377,13 +376,14 @@ static PyObject *Quaternion_add(PyObject * q1, PyObject * q2) float quat[4]; QuaternionObject *quat1 = NULL, *quat2 = NULL; - quat1 = (QuaternionObject*)q1; - quat2 = (QuaternionObject*)q2; - - if(quat1->coerced_object || quat2->coerced_object){ + if(!QuaternionObject_Check(q1) || !QuaternionObject_Check(q2)) { PyErr_SetString(PyExc_AttributeError, "Quaternion addition: arguments not valid for this operation....\n"); return NULL; } + + quat1 = (QuaternionObject*)q1; + quat2 = (QuaternionObject*)q2; + for(x = 0; x < 4; x++) { quat[x] = quat1->quat[x] + quat2->quat[x]; } @@ -398,13 +398,14 @@ static PyObject *Quaternion_sub(PyObject * q1, PyObject * q2) float quat[4]; QuaternionObject *quat1 = NULL, *quat2 = NULL; - quat1 = (QuaternionObject*)q1; - quat2 = (QuaternionObject*)q2; - - if(quat1->coerced_object || quat2->coerced_object){ + if(!QuaternionObject_Check(q1) || !QuaternionObject_Check(q2)) { PyErr_SetString(PyExc_AttributeError, "Quaternion addition: arguments not valid for this operation....\n"); return NULL; } + + quat1 = (QuaternionObject*)q1; + quat2 = (QuaternionObject*)q2; + for(x = 0; x < 4; x++) { quat[x] = quat1->quat[x] - quat2->quat[x]; } @@ -419,86 +420,53 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2) float quat[4], scalar; double dot = 0.0f; QuaternionObject *quat1 = NULL, *quat2 = NULL; - PyObject *f = NULL; VectorObject *vec = NULL; quat1 = (QuaternionObject*)q1; quat2 = (QuaternionObject*)q2; - if(quat1->coerced_object){ - if (PyFloat_Check(quat1->coerced_object) || - PyLong_Check(quat1->coerced_object)){ // FLOAT/INT * QUAT - f = PyNumber_Float(quat1->coerced_object); - if(f == NULL) { // parsed item not a number - PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: arguments not acceptable for this operation\n"); - return NULL; - } - - scalar = (float)PyFloat_AS_DOUBLE(f); - Py_DECREF(f); + if(QuaternionObject_Check(q1) && QuaternionObject_Check(q2)) { /* QUAT*QUAT (dot product) */ + for(x = 0; x < 4; x++) { + dot += quat1->quat[x] * quat1->quat[x]; + } + return PyFloat_FromDouble(dot); + } + + /* the only case this can happen (for a supported type is "FLOAT*QUAT" ) */ + if(!QuaternionObject_Check(q1)) { + scalar= PyFloat_AsDouble(q1); + if ((scalar == -1.0 && PyErr_Occurred())==0) { /* FLOAT*QUAT */ for(x = 0; x < 4; x++) { quat[x] = quat2->quat[x] * scalar; } return newQuaternionObject(quat, Py_NEW); } - }else{ - if(quat2->coerced_object){ - if (PyFloat_Check(quat2->coerced_object) || - PyLong_Check(quat2->coerced_object)){ // QUAT * FLOAT/INT - f = PyNumber_Float(quat2->coerced_object); - if(f == NULL) { // parsed item not a number - PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: arguments not acceptable for this operation\n"); - return NULL; - } - - scalar = (float)PyFloat_AS_DOUBLE(f); - Py_DECREF(f); - for(x = 0; x < 4; x++) { - quat[x] = quat1->quat[x] * scalar; - } - return newQuaternionObject(quat, Py_NEW); - }else if(VectorObject_Check(quat2->coerced_object)){ //QUAT * VEC - vec = (VectorObject*)quat2->coerced_object; - if(vec->size != 3){ - PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: only 3D vector rotations currently supported\n"); - return NULL; - } - return quat_rotation((PyObject*)quat1, (PyObject*)vec); + PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: val * quat, val is not an acceptable type"); + return NULL; + } + else { /* QUAT*SOMETHING */ + if(VectorObject_Check(q2)){ /* QUAT*VEC */ + vec = (VectorObject*)q2; + if(vec->size != 3){ + PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: only 3D vector rotations currently supported\n"); + return NULL; } - }else{ //QUAT * QUAT (dot product) + return quat_rotation((PyObject*)quat1, (PyObject*)vec); + } + + scalar= PyFloat_AsDouble(q2); + if ((scalar == -1.0 && PyErr_Occurred())==0) { /* QUAT*FLOAT */ for(x = 0; x < 4; x++) { - dot += quat1->quat[x] * quat1->quat[x]; + quat[x] = quat1->quat[x] * scalar; } - return PyFloat_FromDouble(dot); + return newQuaternionObject(quat, Py_NEW); } } - + PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: arguments not acceptable for this operation\n"); return NULL; } -//------------------------coerce(obj, obj)----------------------- -//coercion of unknown types to type QuaternionObject for numeric protocols -/*Coercion() is called whenever a math operation has 2 operands that - it doesn't understand how to evaluate. 2+Matrix for example. We want to - evaluate some of these operations like: (vector * 2), however, for math - to proceed, the unknown operand must be cast to a type that python math will - understand. (e.g. in the case above case, 2 must be cast to a vector and - then call vector.multiply(vector, scalar_cast_as_vector)*/ -static int Quaternion_coerce(PyObject ** q1, PyObject ** q2) -{ - if(VectorObject_Check(*q2) || PyFloat_Check(*q2) || PyLong_Check(*q2)) { - PyObject *coerced = (PyObject *)(*q2); - Py_INCREF(coerced); - - *q2 = newQuaternionObject(NULL,Py_NEW); - ((QuaternionObject*)*q2)->coerced_object = coerced; - Py_INCREF (*q1); - return 0; - } - PyErr_SetString(PyExc_TypeError, "quaternion.coerce(): unknown operand - can't coerce for numeric protocols"); - return -1; -} //-----------------PROTOCOL DECLARATIONS-------------------------- static PySequenceMethods Quaternion_SeqMethods = { (inquiry) Quaternion_len, /* sq_length */ @@ -527,11 +495,7 @@ static PyNumberMethods Quaternion_NumMethods = { (binaryfunc) 0, /* __and__ */ (binaryfunc) 0, /* __xor__ */ (binaryfunc) 0, /* __or__ */ -#if 0 //XXX 2.5 - (coercion) Quaternion_coerce, /* __coerce__ */ -#else - 0, -#endif + /*(coercion)*/ 0, /* __coerce__ */ (unaryfunc) 0, /* __int__ */ (unaryfunc) 0, /* __long__ */ (unaryfunc) 0, /* __float__ */ @@ -740,7 +704,6 @@ PyObject *newQuaternionObject(float *quat, int type) self = PyObject_NEW(QuaternionObject, &quaternion_Type); self->data.blend_data = NULL; self->data.py_data = NULL; - self->coerced_object = NULL; if(type == Py_WRAP){ self->data.blend_data = quat; diff --git a/source/blender/python/generic/quat.h b/source/blender/python/generic/quat.h index 8a4602c1d8e..8887b147705 100644 --- a/source/blender/python/generic/quat.h +++ b/source/blender/python/generic/quat.h @@ -46,11 +46,7 @@ typedef struct { }data; float *quat; //1D array of data (alias) int wrapped; //is wrapped data? - PyObject *coerced_object; } QuaternionObject; -/*coerced_object is a pointer to the object that it was -coerced from when a dummy vector needs to be created from -the coerce() function for numeric protocol operations*/ /*struct data contains a pointer to the actual data that the object uses. It can use either PyMem allocated data (which will diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index 86ce5c21217..e2009d9974e 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -428,8 +428,8 @@ static PyObject *Vector_item(VectorObject * self, int i) sequence accessor (set)*/ static int Vector_ass_item(VectorObject * self, int i, PyObject * ob) { - - if(!(PyNumber_Check(ob))) { /* parsed item not a number */ + float scalar= (float)PyFloat_AsDouble(ob); + if(scalar==-1.0f && PyErr_Occurred()) { /* parsed item not a number */ PyErr_SetString(PyExc_TypeError, "vector[index] = x: index argument not a number\n"); return -1; } @@ -438,7 +438,7 @@ static int Vector_ass_item(VectorObject * self, int i, PyObject * ob) PyErr_SetString(PyExc_IndexError, "vector[index] = x: assignment index out of range\n"); return -1; } - self->vec[i] = (float)PyFloat_AsDouble(ob); + self->vec[i] = scalar; return 0; } @@ -468,7 +468,7 @@ static int Vector_ass_slice(VectorObject * self, int begin, int end, PyObject * seq) { int i, y, size = 0; - float vec[4]; + float vec[4], scalar; PyObject *v; CLAMP(begin, 0, self->size); @@ -489,13 +489,14 @@ static int Vector_ass_slice(VectorObject * self, int begin, int end, return -1; } - if(!PyNumber_Check(v)) { /* parsed item not a number */ + scalar= (float)PyFloat_AsDouble(v); + if(scalar==-1.0f && PyErr_Occurred()) { /* parsed item not a number */ Py_DECREF(v); PyErr_SetString(PyExc_TypeError, "vector[begin:end] = []: sequence argument not a number\n"); return -1; } - vec[i] = (float)PyFloat_AsDouble(v); + vec[i] = scalar; Py_DECREF(v); } /*parsed well - now set in vector*/ @@ -628,6 +629,7 @@ static PyObject *Vector_isub(PyObject * v1, PyObject * v2) static PyObject *Vector_mul(PyObject * v1, PyObject * v2) { VectorObject *vec1 = NULL, *vec2 = NULL; + float scalar; if VectorObject_Check(v1) vec1= (VectorObject *)v1; @@ -658,23 +660,9 @@ static PyObject *Vector_mul(PyObject * v1, PyObject * v2) v2= v1; } - if (PyNumber_Check(v2)) { - /* VEC * NUM */ - int i; - float vec[4]; - float scalar = (float)PyFloat_AsDouble( v2 ); - - for(i = 0; i < vec1->size; i++) { - vec[i] = vec1->vec[i] * scalar; - } - return newVectorObject(vec, vec1->size, Py_NEW); - - } else if (MatrixObject_Check(v2)) { + if (MatrixObject_Check(v2)) { /* VEC * MATRIX */ - if (v1==v2) /* mat*vec, we have swapped the order */ - return column_vector_multiplication((MatrixObject*)v2, vec1); - else /* vec*mat */ - return row_vector_multiplication(vec1, (MatrixObject*)v2); + return row_vector_multiplication(vec1, (MatrixObject*)v2); } else if (QuaternionObject_Check(v2)) { QuaternionObject *quat = (QuaternionObject*)v2; if(vec1->size != 3) { @@ -683,6 +671,16 @@ static PyObject *Vector_mul(PyObject * v1, PyObject * v2) } return quat_rotation((PyObject*)vec1, (PyObject*)quat); } + else if (((scalar= PyFloat_AsDouble(v2)) == -1.0 && PyErr_Occurred())==0) { /* VEC*FLOAT */ + int i; + float vec[4]; + + for(i = 0; i < vec1->size; i++) { + vec[i] = vec1->vec[i] * scalar; + } + return newVectorObject(vec, vec1->size, Py_NEW); + + } PyErr_SetString(PyExc_TypeError, "Vector multiplication: arguments not acceptable for this operation\n"); return NULL; @@ -694,21 +692,11 @@ static PyObject *Vector_imul(PyObject * v1, PyObject * v2) { VectorObject *vec = (VectorObject *)v1; int i; + float scalar; /* only support vec*=float and vec*=mat vec*=vec result is a float so that wont work */ - if (PyNumber_Check(v2)) { - /* VEC * NUM */ - float scalar = (float)PyFloat_AsDouble( v2 ); - - for(i = 0; i < vec->size; i++) { - vec->vec[i] *= scalar; - } - - Py_INCREF( v1 ); - return v1; - - } else if (MatrixObject_Check(v2)) { + if (MatrixObject_Check(v2)) { float vecCopy[4]; int x,y, size = vec->size; MatrixObject *mat= (MatrixObject*)v2; @@ -739,6 +727,17 @@ static PyObject *Vector_imul(PyObject * v1, PyObject * v2) Py_INCREF( v1 ); return v1; } + else if (((scalar= PyFloat_AsDouble(v2)) == -1.0 && PyErr_Occurred())==0) { /* VEC*=FLOAT */ + + for(i = 0; i < vec->size; i++) { + vec->vec[i] *= scalar; + } + + Py_INCREF( v1 ); + return v1; + + } + PyErr_SetString(PyExc_TypeError, "Vector multiplication: arguments not acceptable for this operation\n"); return NULL; } @@ -747,7 +746,7 @@ static PyObject *Vector_imul(PyObject * v1, PyObject * v2) divide*/ static PyObject *Vector_div(PyObject * v1, PyObject * v2) { - int i, size; + int i; float vec[4], scalar; VectorObject *vec1 = NULL; @@ -757,28 +756,28 @@ static PyObject *Vector_div(PyObject * v1, PyObject * v2) } vec1 = (VectorObject*)v1; /* vector */ - if(!PyNumber_Check(v2)) { /* parsed item not a number */ + scalar = (float)PyFloat_AsDouble(v2); + if(scalar== -1.0f && PyErr_Occurred()) { /* parsed item not a number */ PyErr_SetString(PyExc_TypeError, "Vector division: Vector must be divided by a float\n"); return NULL; } - scalar = (float)PyFloat_AsDouble(v2); if(scalar==0.0) { /* not a vector */ PyErr_SetString(PyExc_ZeroDivisionError, "Vector division: divide by zero error.\n"); return NULL; } - size = vec1->size; - for(i = 0; i < size; i++) { + + for(i = 0; i < vec1->size; i++) { vec[i] = vec1->vec[i] / scalar; } - return newVectorObject(vec, size, Py_NEW); + return newVectorObject(vec, vec1->size, Py_NEW); } -/*------------------------obj / obj------------------------------ +/*------------------------obj /= obj------------------------------ divide*/ static PyObject *Vector_idiv(PyObject * v1, PyObject * v2) { - int i, size; + int i; float scalar; VectorObject *vec1 = NULL; @@ -788,20 +787,18 @@ static PyObject *Vector_idiv(PyObject * v1, PyObject * v2) }*/ vec1 = (VectorObject*)v1; /* vector */ - - if(!PyNumber_Check(v2)) { /* parsed item not a number */ + + scalar = (float)PyFloat_AsDouble(v2); + if(scalar==-1.0f && PyErr_Occurred()) { /* parsed item not a number */ PyErr_SetString(PyExc_TypeError, "Vector division: Vector must be divided by a float\n"); return NULL; } - - scalar = (float)PyFloat_AsDouble(v2); if(scalar==0.0) { /* not a vector */ PyErr_SetString(PyExc_ZeroDivisionError, "Vector division: divide by zero error.\n"); return NULL; } - size = vec1->size; - for(i = 0; i < size; i++) { + for(i = 0; i < vec1->size; i++) { vec1->vec[i] /= scalar; } Py_INCREF( v1 ); @@ -820,24 +817,6 @@ static PyObject *Vector_neg(VectorObject *self) return newVectorObject(vec, self->size, Py_NEW); } -/*------------------------coerce(obj, obj)----------------------- - coercion of unknown types to type VectorObject for numeric protocols - Coercion() is called whenever a math operation has 2 operands that - it doesn't understand how to evaluate. 2+Matrix for example. We want to - evaluate some of these operations like: (vector * 2), however, for math - to proceed, the unknown operand must be cast to a type that python math will - understand. (e.g. in the case above case, 2 must be cast to a vector and - then call vector.multiply(vector, scalar_cast_as_vector)*/ - - -static int Vector_coerce(PyObject ** v1, PyObject ** v2) -{ - /* Just incref, each functon must raise errors for bad types */ - Py_INCREF (*v1); - Py_INCREF (*v2); - return 0; -} - /*------------------------tp_doc*/ static char VectorObject_doc[] = "This is a wrapper for vector objects."; @@ -949,15 +928,6 @@ static PySequenceMethods Vector_SeqMethods = { (ssizeobjargproc) Vector_ass_item, /* sq_ass_item */ (ssizessizeobjargproc) Vector_ass_slice, /* sq_ass_slice */ }; - - -/* For numbers without flag bit Py_TPFLAGS_CHECKTYPES set, all - arguments are guaranteed to be of the object's type (modulo - coercion hacks -- i.e. if the type's coercion function - returns other types, then these are allowed as well). Numbers that - have the Py_TPFLAGS_CHECKTYPES flag bit set should check *both* - arguments for proper type and implement the necessary conversions - in the slot functions themselves. */ static PyNumberMethods Vector_NumMethods = { (binaryfunc) Vector_add, /* __add__ */ @@ -977,11 +947,7 @@ static PyNumberMethods Vector_NumMethods = { (binaryfunc) NULL, /* __and__ */ (binaryfunc) NULL, /* __xor__ */ (binaryfunc) NULL, /* __or__ */ -#if 0 //XXX 2.5 - (coercion) Vector_coerce, /* __coerce__ */ -#else - 0, -#endif + /*(coercion)*/ NULL, /* __coerce__ */ (unaryfunc) NULL, /* __int__ */ (unaryfunc) NULL, /* __long__ */ (unaryfunc) NULL, /* __float__ */ @@ -1095,11 +1061,11 @@ static int Vector_setLength( VectorObject * self, PyObject * value ) double dot = 0.0f, param; int i; - if (!PyNumber_Check(value)) { - PyErr_SetString( PyExc_TypeError, "expected a number for the vector axis" ); + param= PyFloat_AsDouble( value ); + if(param==-1.0 && PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "length must be set to a number"); return -1; } - param= PyFloat_AsDouble( value ); if (param < 0) { PyErr_SetString( PyExc_TypeError, "cannot set a vectors length to a negative value" ); @@ -1229,12 +1195,13 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur while (swizzleClosure & SWIZZLE_VALID_AXIS && axisB < listLen) { item = PyList_GetItem(value, axisB); - if (!PyNumber_Check(item)) - { + scalarVal = (float)PyFloat_AsDouble(item); + + if (scalarVal==-1.0 && PyErr_Occurred()) { PyErr_SetString(PyExc_AttributeError, "Error: vector does not have specified axis.\n"); return -1; } - scalarVal = (float)PyFloat_AsDouble(item); + axisA = swizzleClosure & SWIZZLE_AXIS; vecTemp[axisA] = scalarVal; @@ -1245,10 +1212,9 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur memcpy(self->vec, vecTemp, axisB * sizeof(float)); return 0; } - else if (PyNumber_Check(value)) + else if (((scalarVal = (float)PyFloat_AsDouble(value)) == -1.0 && PyErr_Occurred())==0) { /* Assign the same value to each axis. */ - scalarVal = (float)PyFloat_AsDouble(value); swizzleClosure = (unsigned int) closure; while (swizzleClosure & SWIZZLE_VALID_AXIS) { @@ -1729,12 +1695,7 @@ PyTypeObject vector_Type = { NULL, /* PyBufferProcs *tp_as_buffer; */ /*** Flags to define presence of optional/expanded features ***/ -#if 0 //XXX 2.5 - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES, /* long tp_flags; */ -#else Py_TPFLAGS_DEFAULT, -#endif - VectorObject_doc, /* char *tp_doc; Documentation string */ /*** Assigned meaning in release 2.0 ***/ /* call function for all accessible objects */ -- cgit v1.2.3 From a87bc73d321f5bddc17fb5c6332637738bfb7fa6 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 19 Jun 2009 04:45:56 +0000 Subject: NLA SoC: Transition Strips + Strip Adding Operators + Bugfixes == Transitions == Transition strips are now able to be created + evaluated. Transitions allow for interpolation between the endpoints of two adjacent strips in the same track (i.e. two strips which occur in the same track one after the other, but with a gap between them). - The current behaviour when only one endpoint affects some setting is non-optimal, since it appears somewhat inconsistently extend/replace values... - Transform code needs a few fixes still to deal with these == Strip Adding Operators == * New strips referencing Actions can be added using the Shift-A hotkey while in the strips-area. You must have a track selected first though. The new strip will get added, starting from the current frame, in the selected track(s) only if there is enough space to do so. Otherwise, the new strip gets added at the top of the stack in a new track. * New transition strips can be added with the Shift-T hotkey while in the strips area. You must have two adjacent strips selected for this to work. == New Backend Methods == * Recoded the strip/track adding API to be more flexible * Added a new method for testing whether F-Curve has any modifiers of with certain attributes. Will be used in a later bugfix... == Bugfixes == - Fixed bug with strip-blending which caused the blending modes to be useless. - NLA buttons now use proper poll callbacks instead of defining checks - Commented out missing operator in menus, silencing warnings in console - Removed obsolete/incorrect comments --- source/blender/blenkernel/BKE_fcurve.h | 2 + source/blender/blenkernel/BKE_nla.h | 2 + source/blender/blenkernel/intern/anim_sys.c | 156 +++++++++++++++-- source/blender/blenkernel/intern/fcurve.c | 36 ++++ source/blender/blenkernel/intern/nla.c | 72 ++++---- source/blender/editors/space_nla/nla_buttons.c | 65 +++++-- source/blender/editors/space_nla/nla_draw.c | 23 ++- source/blender/editors/space_nla/nla_edit.c | 229 ++++++++++++++++++++++++- source/blender/editors/space_nla/nla_header.c | 5 +- source/blender/editors/space_nla/nla_intern.h | 3 + source/blender/editors/space_nla/nla_ops.c | 7 + 11 files changed, 536 insertions(+), 64 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index 7058b9d236a..af272e892f2 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -112,6 +112,8 @@ void fcurve_free_modifiers(struct FCurve *fcu); struct FModifier *fcurve_find_active_modifier(struct FCurve *fcu); void fcurve_set_active_modifier(struct FCurve *fcu, struct FModifier *fcm); +short fcurve_has_suitable_modifier(FCurve *fcu, int mtype, short acttype); + float evaluate_time_fmodifiers(ListBase *modifiers, struct FCurve *fcu, float cvalue, float evaltime); void evaluate_value_fmodifiers(ListBase *modifiers, struct FCurve *fcu, float *cvalue, float evaltime); diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 078c1ba52bb..5200ca6d4d7 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -61,6 +61,8 @@ void BKE_nlatrack_solo_toggle(struct AnimData *adt, struct NlaTrack *nlt); short BKE_nlatrack_has_space(struct NlaTrack *nlt, float start, float end); void BKE_nlatrack_sort_strips(struct NlaTrack *nlt); +short BKE_nlatrack_add_strip(struct NlaTrack *nlt, struct NlaStrip *strip); + struct NlaStrip *BKE_nlastrip_find_active(struct NlaTrack *nlt); short BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max); diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index a864e3d4e87..2efb4f2b2d3 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -558,13 +558,20 @@ typedef struct NlaEvalStrip { short track_index; /* the index of the track within the list */ short strip_mode; /* which end of the strip are we looking at */ + + float strip_time; /* time at which which strip is being evaluated */ } NlaEvalStrip; /* NlaEvalStrip->strip_mode */ enum { + /* standard evaluation */ NES_TIME_BEFORE = -1, NES_TIME_WITHIN, NES_TIME_AFTER, + + /* transition-strip evaluations */ + NES_TIME_TRANSITION_START, + NES_TIME_TRANSITION_END, } eNlaEvalStrip_StripMode; @@ -583,10 +590,10 @@ typedef struct NlaEvalChannel { /* ---------------------- */ -/* non clipped mapping for strip-time <-> global time +/* non clipped mapping for strip-time <-> global time (for Action-Clips) * invert = convert action-strip time to global time */ -static float nlastrip_get_frame (NlaStrip *strip, float cframe, short invert) +static float nlastrip_get_frame_actionclip (NlaStrip *strip, float cframe, short invert) { float length, actlength, repeat, scale; @@ -603,8 +610,8 @@ static float nlastrip_get_frame (NlaStrip *strip, float cframe, short invert) if (IS_EQ(actlength, 0.0f)) actlength = 1.0f; /* length of strip */ - length = strip->end - strip->start; - if (IS_EQ(length, 0.0f)) length= actlength * scale * repeat; + length= actlength * scale * repeat; + if (IS_EQ(length, 0.0f)) length= strip->end - strip->start; /* reversed = play strip backwards */ if (strip->flag & NLASTRIP_FLAG_REVERSE) { @@ -623,6 +630,48 @@ static float nlastrip_get_frame (NlaStrip *strip, float cframe, short invert) } } +/* non clipped mapping for strip-time <-> global time (for Transitions) + * invert = convert action-strip time to global time + */ +static float nlastrip_get_frame_transition (NlaStrip *strip, float cframe, short invert) +{ + float length; + + /* length of strip */ + length= strip->end - strip->start; + + /* reversed = play strip backwards */ + if (strip->flag & NLASTRIP_FLAG_REVERSE) { + /* invert = convert within-strip-time to global time */ + if (invert) + return strip->end - (length * cframe); + else + return (strip->end - cframe) / length; + } + else { + /* invert = convert within-strip-time to global time */ + if (invert) + return (length * cframe) + strip->start; + else + return (cframe - strip->start) / length; + } +} + +/* non clipped mapping for strip-time <-> global time + * invert = convert action-strip time to global time + */ +static float nlastrip_get_frame (NlaStrip *strip, float cframe, short invert) +{ + switch (strip->type) { + case NLASTRIP_TYPE_TRANSITION: /* transition */ + return nlastrip_get_frame_transition(strip, cframe, invert); + + case NLASTRIP_TYPE_CLIP: /* action-clip (default) */ + default: + return nlastrip_get_frame_actionclip(strip, cframe, invert); + } +} + /* calculate influence of strip based for given frame based on blendin/out values */ static float nlastrip_get_influence (NlaStrip *strip, float cframe) { @@ -631,7 +680,6 @@ static float nlastrip_get_influence (NlaStrip *strip, float cframe) strip->blendout= (float)fabs(strip->blendout); /* result depends on where frame is in respect to blendin/out values */ - // the +0.0001 factors are to combat rounding errors if (IS_EQ(strip->blendin, 0)==0 && (cframe <= (strip->start + strip->blendin))) { /* there is some blend-in */ return (float)fabs(cframe - strip->start) / (strip->blendin); @@ -746,12 +794,13 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index * - negative influence is not supported yet... how would that be defined? */ // TODO: this sounds a bit hacky having a few isolated F-Curves stuck on some data it operates on... - // TODO: should we clamp the time to only be on the endpoints of the strip? nlastrip_evaluate_controls(estrip, ctime); if (estrip->influence <= 0.0f) // XXX is it useful to invert the strip? return; - /* check if strip has valid data to evaluate */ + /* check if strip has valid data to evaluate, + * and/or perform any additional type-specific actions + */ switch (estrip->type) { case NLASTRIP_TYPE_CLIP: /* clip must have some action to evaluate */ @@ -760,9 +809,12 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index break; case NLASTRIP_TYPE_TRANSITION: /* there must be strips to transition from and to (i.e. prev and next required) */ - // TODO: what happens about cross-track transitions? if (ELEM(NULL, estrip->prev, estrip->next)) return; + + /* evaluate controls for the relevant extents of the bordering strips... */ + nlastrip_evaluate_controls(estrip->prev, estrip->start); + nlastrip_evaluate_controls(estrip->next, estrip->end); break; } @@ -773,6 +825,7 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index nes->strip= estrip; nes->strip_mode= side; nes->track_index= index; + nes->strip_time= estrip->strip_time; BLI_addtail(list, nes); } @@ -847,6 +900,8 @@ static NlaEvalChannel *nlaevalchan_verify (PointerRNA *ptr, ListBase *channels, nec->prop= prop; nec->index= fcu->array_index; } + else + *newChan= 0; /* we can now return */ return nec; @@ -856,6 +911,7 @@ static NlaEvalChannel *nlaevalchan_verify (PointerRNA *ptr, ListBase *channels, static void nlaevalchan_accumulate (NlaEvalChannel *nec, NlaEvalStrip *nes, short newChan, float value) { NlaStrip *strip= nes->strip; + short blendmode= strip->blendmode; float inf= strip->influence; /* if channel is new, just store value regardless of blending factors, etc. */ @@ -863,13 +919,19 @@ static void nlaevalchan_accumulate (NlaEvalChannel *nec, NlaEvalStrip *nes, shor nec->value= value; return; } + + /* if this is being performed as part of transition evaluation, incorporate + * an additional weighting factor for the influence + */ + if (nes->strip_mode == NES_TIME_TRANSITION_END) + inf *= nes->strip_time; /* premultiply the value by the weighting factor */ if (IS_EQ(inf, 0)) return; value *= inf; /* perform blending */ - switch (strip->blendmode) { + switch (blendmode) { case NLASTRIP_MODE_ADD: /* simply add the scaled value on to the stack */ nec->value += value; @@ -938,8 +1000,80 @@ static void nlastrip_evaluate_actionclip (PointerRNA *ptr, ListBase *channels, N } } +/* evaluate transition strip */ +static void nlastrip_evaluate_transition (PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes) +{ + ListBase tmp_channels = {NULL, NULL}; + NlaEvalChannel *nec, *necn, *necd; + NlaEvalStrip tmp_nes; + NlaStrip *s1, *s2; + + /* get the two strips to operate on + * - we use the endpoints of the strips directly flanking our strip + * using these as the endpoints of the transition (destination and source) + * - these should have already been determined to be valid... + * - if this strip is being played in reverse, we need to swap these endpoints + * otherwise they will be interpolated wrong + */ + if (nes->strip->flag & NLASTRIP_FLAG_REVERSE) { + s1= nes->strip->next; + s2= nes->strip->prev; + } + else { + s1= nes->strip->prev; + s2= nes->strip->next; + } + + /* prepare template for 'evaluation strip' + * - based on the transition strip's evaluation strip data + * - strip_mode is NES_TIME_TRANSITION_* based on which endpoint + * - strip_time is the 'normalised' (i.e. in-strip) time for evaluation, + * which doubles up as an additional weighting factor for the strip influences + * which allows us to appear to be 'interpolating' between the two extremes + */ + tmp_nes= *nes; + + /* evaluate these strips into a temp-buffer (tmp_channels) */ + /* first strip */ + tmp_nes.strip_mode= NES_TIME_TRANSITION_START; + tmp_nes.strip= s1; + nlastrip_evaluate_actionclip(ptr, &tmp_channels, &tmp_nes); + + /* second strip */ + tmp_nes.strip_mode= NES_TIME_TRANSITION_END; + tmp_nes.strip= s2; + nlastrip_evaluate_actionclip(ptr, &tmp_channels, &tmp_nes); + + + /* optimise - abort if no channels */ + if (tmp_channels.first == NULL) + return; + + + /* accumulate results in tmp_channels buffer to the accumulation buffer */ + for (nec= tmp_channels.first; nec; nec= necn) { + /* get pointer to next channel in case we remove the current channel from the temp-buffer */ + necn= nec->next; + + /* try to find an existing matching channel for this setting in the accumulation buffer */ + necd= nlaevalchan_find_match(channels, &nec->ptr, nec->prop, nec->index); + + /* if there was a matching channel already in the buffer, accumulate to it, + * otherwise, add the current channel to the buffer for efficiency + */ + if (necd) + nlaevalchan_accumulate(necd, nes, 0, nec->value); + else { + BLI_remlink(&tmp_channels, nec); + BLI_addtail(channels, nec); + } + } + + /* free temp-channels that haven't been assimilated into the buffer */ + BLI_freelistN(&tmp_channels); +} + /* evaluates the given evaluation strip */ -// TODO: only evaluate here, but flush in one go using the accumulated channels at end... static void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes) { /* actions to take depend on the type of strip */ @@ -948,7 +1082,7 @@ static void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, NlaEvalStrip nlastrip_evaluate_actionclip(ptr, channels, nes); break; case NLASTRIP_TYPE_TRANSITION: /* transition */ - // XXX code this... + nlastrip_evaluate_transition(ptr, channels, nes); break; } } diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 5820761234c..d8b5135a1b1 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -2242,6 +2242,42 @@ void fcurve_set_active_modifier (FCurve *fcu, FModifier *fcm) fcm->flag |= FMODIFIER_FLAG_ACTIVE; } +/* Do we have any modifiers which match certain criteria + * - mtype - type of modifier (if 0, doesn't matter) + * - acttype - type of action to perform (if -1, doesn't matter) + */ +short fcurve_has_suitable_modifier (FCurve *fcu, int mtype, short acttype) +{ + FModifier *fcm; + + /* if there are no specific filtering criteria, just skip */ + if ((mtype == 0) && (acttype == 0)) + return (fcu && fcu->modifiers.first); + + /* sanity checks */ + if ELEM(NULL, fcu, fcu->modifiers.first) + return 0; + + /* find the first mdifier fitting these criteria */ + for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) { + FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); + short mOk=1, aOk=1; /* by default 1, so that when only one test, won't fail */ + + /* check if applicable ones are fullfilled */ + if (mtype) + mOk= (fcm->type == mtype); + if (acttype > -1) + aOk= (fmi->acttype == acttype); + + /* if both are ok, we've found a hit */ + if (mOk && aOk) + return 1; + } + + /* no matches */ + return 0; +} + /* Evaluation API --------------------------- */ /* evaluate time modifications imposed by some F-Curve Modifiers diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index cef14128032..0684d943754 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -293,9 +293,8 @@ NlaStrip *add_nlastrip (bAction *act) /* Add new NLA-strip to the top of the NLA stack - i.e. into the last track if space, or a new one otherwise */ NlaStrip *add_nlastrip_to_stack (AnimData *adt, bAction *act) { - NlaStrip *strip, *ns; + NlaStrip *strip; NlaTrack *nlt; - short not_added = 1; /* sanity checks */ if ELEM(NULL, adt, act) @@ -306,36 +305,15 @@ NlaStrip *add_nlastrip_to_stack (AnimData *adt, bAction *act) if (strip == NULL) return NULL; - /* check if the last NLA-track (if it exists) has any space for this strip: - * - if so, add this strip to that track - */ - if ( (adt->nla_tracks.last == NULL) || - (BKE_nlatrack_has_space(adt->nla_tracks.last, strip->start, strip->end)==0) ) - { - /* no space, so add to a new track... */ + /* firstly try adding strip to last track, but if that fails, add to a new track */ + if (BKE_nlatrack_add_strip(adt->nla_tracks.last, strip) == 0) { + /* trying to add to the last track failed (no track or no space), + * so add a new track to the stack, and add to that... + */ nlt= add_nlatrack(adt, NULL); - } - else - { - /* there's some space, so add to this track... */ - nlt= adt->nla_tracks.last; + BKE_nlatrack_add_strip(nlt, strip); } - /* find the right place to add the strip to the nominated track */ - for (ns= nlt->strips.first; ns; ns= ns->next) { - /* if current strip occurs after the new strip, add it before */ - if (ns->start > strip->end) { - BLI_insertlinkbefore(&nlt->strips, ns, strip); - not_added= 0; - break; - } - } - if (not_added) { - /* just add to the end of the list of the strips then... */ - BLI_addtail(&nlt->strips, strip); - } - - /* returns the strip added */ return strip; } @@ -490,6 +468,40 @@ void BKE_nlatrack_sort_strips (NlaTrack *nlt) nlt->strips.last= tmp.last; } +/* Add the given NLA-Strip to the given NLA-Track, assuming that it + * isn't currently attached to another one + */ +short BKE_nlatrack_add_strip (NlaTrack *nlt, NlaStrip *strip) +{ + NlaStrip *ns; + short not_added = 1; + + /* sanity checks */ + if ELEM(NULL, nlt, strip) + return 0; + + /* check if any space to add */ + if (BKE_nlatrack_has_space(nlt, strip->start, strip->end)==0) + return 0; + + /* find the right place to add the strip to the nominated track */ + for (ns= nlt->strips.first; ns; ns= ns->next) { + /* if current strip occurs after the new strip, add it before */ + if (ns->start > strip->end) { + BLI_insertlinkbefore(&nlt->strips, ns, strip); + not_added= 0; + break; + } + } + if (not_added) { + /* just add to the end of the list of the strips then... */ + BLI_addtail(&nlt->strips, strip); + } + + /* added... */ + return 1; +} + /* NLA Strips -------------------------------------- */ /* Find the active NLA-strip within the given track */ @@ -571,7 +583,7 @@ short nlastrip_is_first (AnimData *adt, NlaStrip *strip) /* should be first now */ return 1; } - + /* Tools ------------------------------------------- */ /* For the given AnimData block, add the active action to the NLA diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index cb21dd66934..cb76f7fc735 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -144,11 +144,38 @@ static int nla_panel_context(const bContext *C, PointerRNA *nlt_ptr, PointerRNA return found; } +#if 0 static int nla_panel_poll(const bContext *C, PanelType *pt) { return nla_panel_context(C, NULL, NULL); } +#endif +static int nla_track_panel_poll(const bContext *C, PanelType *pt) +{ + PointerRNA ptr; + return (nla_panel_context(C, &ptr, NULL) && (ptr.data != NULL)); +} + +static int nla_strip_panel_poll(const bContext *C, PanelType *pt) +{ + PointerRNA ptr; + return (nla_panel_context(C, NULL, &ptr) && (ptr.data != NULL)); +} + +static int nla_strip_actclip_panel_poll(const bContext *C, PanelType *pt) +{ + PointerRNA ptr; + NlaStrip *strip; + + if (!nla_panel_context(C, NULL, &ptr)) + return 0; + if (ptr.data == NULL) + return 0; + + strip= ptr.data; + return (strip->type == NLASTRIP_TYPE_CLIP); +} /* -------------- */ @@ -163,8 +190,6 @@ static void nla_panel_track (const bContext *C, Panel *pa) /* check context and also validity of pointer */ if (!nla_panel_context(C, &nlt_ptr, NULL)) return; - if (nlt_ptr.data == NULL) - return; block= uiLayoutGetBlock(layout); uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); @@ -185,8 +210,6 @@ static void nla_panel_properties(const bContext *C, Panel *pa) /* check context and also validity of pointer */ if (!nla_panel_context(C, NULL, &strip_ptr)) return; - if (strip_ptr.data == NULL) - return; block= uiLayoutGetBlock(layout); uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); @@ -239,8 +262,6 @@ static void nla_panel_actclip(const bContext *C, Panel *pa) /* check context and also validity of pointer */ if (!nla_panel_context(C, NULL, &strip_ptr)) return; - if (strip_ptr.data == NULL) - return; // XXX FIXME: move this check into a poll callback if (RNA_enum_get(&strip_ptr, "type") != NLASTRIP_TYPE_CLIP) @@ -279,8 +300,6 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa) /* check context and also validity of pointer */ if (!nla_panel_context(C, NULL, &strip_ptr)) return; - if (strip_ptr.data == NULL) - return; block= uiLayoutGetBlock(layout); uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); @@ -291,6 +310,24 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa) // animated_time } +/* F-Modifiers for active NLA-Strip */ +static void nla_panel_modifiers(const bContext *C, Panel *pa) +{ + PointerRNA strip_ptr; + uiLayout *layout= pa->layout; + //uiLayout *column, *row, *subcol; + uiBlock *block; + + /* check context and also validity of pointer */ + if (!nla_panel_context(C, NULL, &strip_ptr)) + return; + + block= uiLayoutGetBlock(layout); + uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); + + // TODO... +} + /* ******************* general ******************************** */ @@ -302,35 +339,35 @@ void nla_buttons_register(ARegionType *art) strcpy(pt->idname, "NLA_PT_track"); strcpy(pt->label, "Active Track"); pt->draw= nla_panel_track; - pt->poll= nla_panel_poll; + pt->poll= nla_track_panel_poll; BLI_addtail(&art->paneltypes, pt); pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel properties"); strcpy(pt->idname, "NLA_PT_properties"); strcpy(pt->label, "Active Strip"); pt->draw= nla_panel_properties; - pt->poll= nla_panel_poll; + pt->poll= nla_strip_panel_poll; BLI_addtail(&art->paneltypes, pt); pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel properties"); strcpy(pt->idname, "NLA_PT_actionclip"); strcpy(pt->label, "Action Clip"); pt->draw= nla_panel_actclip; - pt->poll= nla_panel_poll; // XXX need a special one to check for 'action clip' types only + pt->poll= nla_strip_actclip_panel_poll; BLI_addtail(&art->paneltypes, pt); pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel evaluation"); strcpy(pt->idname, "NLA_PT_evaluation"); strcpy(pt->label, "Evaluation"); pt->draw= nla_panel_evaluation; - pt->poll= nla_panel_poll; + pt->poll= nla_strip_panel_poll; BLI_addtail(&art->paneltypes, pt); pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel modifiers"); strcpy(pt->idname, "NLA_PT_modifiers"); strcpy(pt->label, "Modifiers"); - //pt->draw= nla_panel_modifiers; - pt->poll= nla_panel_poll; + pt->draw= nla_panel_modifiers; + pt->poll= nla_strip_panel_poll; BLI_addtail(&art->paneltypes, pt); } diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 8d417a150aa..3a3f86bb5a3 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -202,11 +202,20 @@ static void nla_draw_strip_text (NlaTrack *nlt, NlaStrip *strip, int index, View char str[256]; rctf rect; - /* for now, just init the string with a fixed-format */ - if (strip->act) - sprintf(str, "%d | Act: %s | %.2f <-> %.2f", index, strip->act->id.name+2, strip->start, strip->end); - else - sprintf(str, "%d | Act: ", index); + /* for now, just init the string with fixed-formats */ + switch (strip->type) { + case NLASTRIP_TYPE_TRANSITION: /* Transition */ + sprintf(str, "%d | Transition | %.2f <-> %.2f", index, strip->start, strip->end); + break; + + case NLASTRIP_TYPE_CLIP: /* Action-Clip (default) */ + default: + if (strip->act) + sprintf(str, "%d | Act: %s | %.2f <-> %.2f", index, strip->act->id.name+2, strip->start, strip->end); + else + sprintf(str, "%d | Act: ", index); // xxx... need a better format? + break; + } /* set text colour - if colours (see above) are light, draw black text, otherwise draw white */ if (strip->flag & (NLASTRIP_FLAG_ACTIVE|NLASTRIP_FLAG_SELECT|NLASTRIP_FLAG_TWEAKUSER)) @@ -295,7 +304,9 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) { AnimData *adt= BKE_animdata_from_id(ale->id); - /* just draw a semi-shaded rect spanning the width of the viewable area if there's data */ + /* just draw a semi-shaded rect spanning the width of the viewable area if there's data, + * and a second darker rect within which we draw keyframe indicator dots if there's data + */ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index e8af67aebd1..2996a005177 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -48,6 +48,8 @@ #include "BKE_animsys.h" #include "BKE_nla.h" #include "BKE_context.h" +#include "BKE_library.h" +#include "BKE_main.h" #include "BKE_report.h" #include "BKE_screen.h" #include "BKE_utildefines.h" @@ -215,6 +217,229 @@ void NLAEDIT_OT_tweakmode_exit (wmOperatorType *ot) /* *********************************************** */ /* NLA Editing Operations */ +/* ******************** Add Action-Clip Operator ***************************** */ +/* Add a new Action-Clip strip to the active track (or the active block if no space in the track) */ + +/* pop up menu allowing user to choose the action to use */ +static int nlaedit_add_actionclip_invoke (bContext *C, wmOperator *op, wmEvent *evt) +{ + Main *m= CTX_data_main(C); + bAction *act; + uiPopupMenu *pup; + uiLayout *layout; + + pup= uiPupMenuBegin(C, "Add Action Clip", 0); + layout= uiPupMenuLayout(pup); + + /* loop through Actions in Main database, adding as items in the menu */ + for (act= m->action.first; act; act= act->id.next) + uiItemStringO(layout, act->id.name+2, 0, "NLAEDIT_OT_add_actionclip", "action", act->id.name); + uiItemS(layout); + + uiPupMenuEnd(C, pup); + + return OPERATOR_CANCELLED; +} + +/* add the specified action as new strip */ +static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + Scene *scene; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter, items; + + bAction *act = NULL; + char actname[22]; + float cfra; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + scene= ac.scene; + cfra= (float)CFRA; + + /* get action to use */ + RNA_string_get(op->ptr, "action", actname); + act= (bAction *)find_id("AC", actname+2); + + if (act == NULL) { + BKE_report(op->reports, RPT_ERROR, "No valid Action to add."); + //printf("Add strip - actname = '%s' \n", actname); + return OPERATOR_CANCELLED; + } + + /* get a list of the editable tracks being shown in the NLA + * - this is limited to active ones for now, but could be expanded to + */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_ACTIVE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); + items= ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + if (items == 0) { + BKE_report(op->reports, RPT_ERROR, "No active track(s) to add strip to."); + return OPERATOR_CANCELLED; + } + + /* for every active track, try to add strip to free space in track or to the top of the stack if no space */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + AnimData *adt= BKE_animdata_from_id(ale->id); + NlaStrip *strip= NULL; + + /* create a new strip, and offset it to start on the current frame */ + strip= add_nlastrip(act); + + strip->end += (cfra - strip->start); + strip->start = cfra; + + /* firstly try adding strip to our current track, but if that fails, add to a new track */ + if (BKE_nlatrack_add_strip(nlt, strip) == 0) { + /* trying to add to the current failed (no space), + * so add a new track to the stack, and add to that... + */ + nlt= add_nlatrack(adt, NULL); + BKE_nlatrack_add_strip(nlt, strip); + } + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done */ + return OPERATOR_FINISHED; +} + +void NLAEDIT_OT_add_actionclip (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Action Strip"; + ot->idname= "NLAEDIT_OT_add_actionclip"; + ot->description= "Add an Action-Clip strip (i.e. an NLA Strip referencing an Action) to the active track."; + + /* api callbacks */ + ot->invoke= nlaedit_add_actionclip_invoke; + ot->exec= nlaedit_add_actionclip_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* props */ + // TODO: this would be nicer as an ID-pointer... + RNA_def_string(ot->srna, "action", "", 21, "Action", "Name of Action to add as a new Action-Clip Strip."); +} + +/* ******************** Add Transition Operator ***************************** */ +/* Add a new transition strip between selected strips */ + +/* add the specified action as new strip */ +static int nlaedit_add_transition_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + int done = 0; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the editable tracks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* for each track, find pairs of strips to add transitions to */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *s1, *s2; + + /* get initial pair of strips */ + if ELEM(nlt->strips.first, NULL, nlt->strips.last) + continue; + s1= nlt->strips.first; + s2= s1->next; + + /* loop over strips */ + for (; s1 && s2; s1=s2, s2=s2->next) { + NlaStrip *strip; + + /* check if both are selected */ + if ELEM(0, (s1->flag & NLASTRIP_FLAG_SELECT), (s2->flag & NLASTRIP_FLAG_SELECT)) + continue; + /* check if there's space between the two */ + if (IS_EQ(s1->end, s2->start)) + continue; + + /* allocate new strip */ + strip= MEM_callocN(sizeof(NlaStrip), "NlaStrip"); + BLI_insertlinkafter(&nlt->strips, s1, strip); + + /* set the type */ + strip->type= NLASTRIP_TYPE_TRANSITION; + + /* generic settings + * - selected flag to highlight this to the user + * - auto-blends to ensure that blend in/out values are automatically + * determined by overlaps of strips + */ + strip->flag = NLASTRIP_FLAG_SELECT|NLASTRIP_FLAG_AUTO_BLENDS; + + /* range is simply defined as the endpoints of the adjacent strips */ + strip->start = s1->end; + strip->end = s2->start; + + /* scale and repeat aren't of any use, but shouldn't ever be 0 */ + strip->scale= 1.0f; + strip->repeat = 1.0f; + + /* make note of this */ + done++; + } + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* was anything added? */ + if (done) { + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done */ + return OPERATOR_FINISHED; + } + else { + BKE_report(op->reports, RPT_ERROR, "Needs at least a pair of adjacent selected strips."); + return OPERATOR_CANCELLED; + } +} + +void NLAEDIT_OT_add_transition (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Transition"; + ot->idname= "NLAEDIT_OT_add_transition"; + ot->description= "Add a transition strip between two adjacent selected strips."; + + /* api callbacks */ + ot->exec= nlaedit_add_transition_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /* ******************** Delete Strips Operator ***************************** */ /* Deletes the selected NLA-Strips */ @@ -230,7 +455,7 @@ static int nlaedit_delete_exec (bContext *C, wmOperator *op) if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; - /* get a list of the AnimData blocks being shown in the NLA */ + /* get a list of the editable tracks being shown in the NLA */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); @@ -292,7 +517,7 @@ static int nlaedit_split_exec (bContext *C, wmOperator *op) if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; - /* get a list of the AnimData blocks being shown in the NLA */ + /* get a list of editable tracks being shown in the NLA */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index 0d42c544a3f..970d602c0af 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -110,7 +110,7 @@ static void nla_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); - uiItemO(layout, NULL, 0, "NLA_OT_view_all"); + //uiItemO(layout, NULL, 0, "NLA_OT_view_all"); if (sa->full) uiItemO(layout, NULL, 0, "SCREEN_OT_screen_full_area"); // "Tile Window", Ctrl UpArrow @@ -146,6 +146,9 @@ static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemO(layout, NULL, 0, "NLA_OT_add_tracks"); uiItemBooleanO(layout, "Add Tracks Above Selected", 0, "NLA_OT_add_tracks", "above_selected", 1); + uiItemO(layout, NULL, 0, "NLA_OT_add_actionclip"); + uiItemO(layout, NULL, 0, "NLA_OT_add_transition"); + uiItemO(layout, NULL, 0, "NLAEDIT_OT_split"); uiItemS(layout); diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 5c6670cfd6f..f1bde40f4ab 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -92,6 +92,9 @@ void NLAEDIT_OT_tweakmode_exit(wmOperatorType *ot); /* --- */ +void NLAEDIT_OT_add_actionclip(wmOperatorType *ot); +void NLAEDIT_OT_add_transition(wmOperatorType *ot); + void NLAEDIT_OT_delete(wmOperatorType *ot); void NLAEDIT_OT_split(wmOperatorType *ot); diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 981ef9a4f87..a9b7022157e 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -134,6 +134,9 @@ void nla_operatortypes(void) WM_operatortype_append(NLAEDIT_OT_tweakmode_enter); WM_operatortype_append(NLAEDIT_OT_tweakmode_exit); + WM_operatortype_append(NLAEDIT_OT_add_actionclip); + WM_operatortype_append(NLAEDIT_OT_add_transition); + WM_operatortype_append(NLAEDIT_OT_delete); WM_operatortype_append(NLAEDIT_OT_split); } @@ -208,6 +211,10 @@ static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "NLAEDIT_OT_tweakmode_enter", TABKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "NLAEDIT_OT_tweakmode_exit", TABKEY, KM_PRESS, 0, 0); + /* add strips */ + WM_keymap_add_item(keymap, "NLAEDIT_OT_add_actionclip", AKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "NLAEDIT_OT_add_transition", TKEY, KM_PRESS, KM_SHIFT, 0); + /* delete */ WM_keymap_add_item(keymap, "NLAEDIT_OT_delete", XKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "NLAEDIT_OT_delete", DELKEY, KM_PRESS, 0, 0); -- cgit v1.2.3 From 8ffb1dacad032e42830debe9b51fdd961def354f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 19 Jun 2009 04:58:40 +0000 Subject: NLA SoC: Bugfix for Deleting Keyframes When an F-Curve doesn't contain any keyframes anymore but it still exists, the F-Curve's value is not recalculated and flushed anymore if the F-Curve's value will not change. That is, if the F-Curve doesn't have any other data, i.e. drivers or generator-modifiers, which would still change its value, it wouldn't be recalculated to have a value of zero. This solves the problem of deleting all scale keyframes, whereby objects/bones would appear to 'vanish' --- source/blender/blenkernel/BKE_fcurve.h | 2 +- source/blender/blenkernel/intern/fcurve.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index af272e892f2..5c77e3c2ae4 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -112,7 +112,7 @@ void fcurve_free_modifiers(struct FCurve *fcu); struct FModifier *fcurve_find_active_modifier(struct FCurve *fcu); void fcurve_set_active_modifier(struct FCurve *fcu, struct FModifier *fcm); -short fcurve_has_suitable_modifier(FCurve *fcu, int mtype, short acttype); +short fcurve_has_suitable_modifier(struct FCurve *fcu, int mtype, short acttype); float evaluate_time_fmodifiers(ListBase *modifiers, struct FCurve *fcu, float cvalue, float evaltime); void evaluate_value_fmodifiers(ListBase *modifiers, struct FCurve *fcu, float *cvalue, float evaltime); diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index d8b5135a1b1..856930e5a44 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -2415,10 +2415,16 @@ float evaluate_fcurve (FCurve *fcu, float evaltime) } /* Calculate the value of the given F-Curve at the given frame, and set its curval */ -// TODO: will this be necessary? void calculate_fcurve (FCurve *fcu, float ctime) { - /* calculate and set curval (evaluates driver too) */ - fcu->curval= evaluate_fcurve(fcu, ctime); + /* only calculate + set curval (overriding the existing value) if curve has + * any data which warrants this... + */ + if ( (fcu->totvert) || (fcu->driver && !(fcu->driver->flag & DRIVER_FLAG_INVALID)) || + fcurve_has_suitable_modifier(fcu, 0, FMI_TYPE_GENERATE_CURVE) ) + { + /* calculate and set curval (evaluates driver too if necessary) */ + fcu->curval= evaluate_fcurve(fcu, ctime); + } } -- cgit v1.2.3 From 42e60acce669a425a3ce3a588a2bd649cd6963eb Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 19 Jun 2009 11:17:56 +0000 Subject: Animato - Conversions Bugfix Object actions are now converted before object ipo's so that if both of them exist, the Action can still preserve its name. --- source/blender/blenkernel/intern/ipo.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index e4c366dd3d7..a6aac096814 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1515,14 +1515,7 @@ void do_versions_ipos_to_animato(Main *main) /* Add AnimData block */ adt= BKE_id_add_animdata(id); - /* IPO first */ - if (ob->ipo) { - ipo_to_animdata(id, ob->ipo, NULL, NULL); - ob->ipo->id.us--; - ob->ipo= NULL; - } - - /* now Action */ + /* Action first - so that Action name get conserved */ if (ob->action) { action_to_animdata(id, ob->action); @@ -1533,6 +1526,13 @@ void do_versions_ipos_to_animato(Main *main) } } + /* IPO second... */ + if (ob->ipo) { + ipo_to_animdata(id, ob->ipo, NULL, NULL); + ob->ipo->id.us--; + ob->ipo= NULL; + } + /* finally NLA */ // XXX todo... for now, new NLA code not hooked up yet, so keep old stuff (but not for too long!) } -- cgit v1.2.3 From e3fc5481b9da35336e5f7b7413938a089eb384af Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 19 Jun 2009 11:56:53 +0000 Subject: NLA SoC: Bugfixes * Loading old Action Editors resulted in wrong view settings being used * Wrong operator names used in previous commit... --- source/blender/blenloader/intern/readfile.c | 2 +- source/blender/editors/space_nla/nla_header.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index fe19496bd38..31f97e1d41d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5755,7 +5755,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); ar->v2d.scroll |= (V2D_SCROLL_RIGHT); ar->v2d.keepzoom= V2D_LOCKZOOM_Y; - ar->v2d.align= V2D_ALIGN_NO_NEG_Y; + ar->v2d.align= V2D_ALIGN_NO_POS_Y; ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL; break; } diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index 970d602c0af..175f40befeb 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -146,8 +146,8 @@ static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemO(layout, NULL, 0, "NLA_OT_add_tracks"); uiItemBooleanO(layout, "Add Tracks Above Selected", 0, "NLA_OT_add_tracks", "above_selected", 1); - uiItemO(layout, NULL, 0, "NLA_OT_add_actionclip"); - uiItemO(layout, NULL, 0, "NLA_OT_add_transition"); + uiItemO(layout, NULL, 0, "NLAEDIT_OT_add_actionclip"); + uiItemO(layout, NULL, 0, "NLAEDIT_OT_add_transition"); uiItemO(layout, NULL, 0, "NLAEDIT_OT_split"); -- cgit v1.2.3 From d525ae17829ae13640488e6f50022b317a8eba63 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 19 Jun 2009 12:45:08 +0000 Subject: NLA SoC: Duplicate Strips Operator (Shift D) It is now possible to Duplicate Strips again. Strips are added into the first available space in the track above the original track (or a new track above the original if there wasn't any space). Also, separated out the 'add' operators into their own menu. This might need to be changed later... --- source/blender/editors/space_nla/nla_edit.c | 88 +++++++++++++++++++++++++++ source/blender/editors/space_nla/nla_header.c | 19 ++++-- source/blender/editors/space_nla/nla_intern.h | 1 + source/blender/editors/space_nla/nla_ops.c | 4 ++ 4 files changed, 107 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 2996a005177..d2cf728ea58 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -440,6 +440,94 @@ void NLAEDIT_OT_add_transition (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/* ******************** Duplicate Strips Operator ************************** */ +/* Duplicates the selected NLA-Strips, putting them on new tracks above the one + * the originals were housed in. + */ + +static int nlaedit_duplicate_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + short done = 0; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of editable tracks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* duplicate strips in tracks starting from the last one so that we're + * less likely to duplicate strips we just duplicated... + */ + for (ale= anim_data.last; ale; ale= ale->prev) { + NlaTrack *nlt= (NlaTrack *)ale->data; + AnimData *adt= BKE_animdata_from_id(ale->id); + NlaStrip *strip, *nstrip, *next; + NlaTrack *track; + + for (strip= nlt->strips.first; strip; strip= next) { + next= strip->next; + + /* if selected, split the strip at its midpoint */ + if (strip->flag & NLASTRIP_FLAG_SELECT) { + /* make a copy (assume that this is possible) */ + nstrip= copy_nlastrip(strip); + + /* in case there's no space in the track above, or we haven't got a reference to it yet, try adding */ + if (BKE_nlatrack_add_strip(nlt->next, nstrip) == 0) { + /* need to add a new track above the one above the current one + * - if the current one is the last one, nlt->next will be NULL, which defaults to adding + * at the top of the stack anyway... + */ + track= add_nlatrack(adt, nlt->next); + BKE_nlatrack_add_strip(track, nstrip); + } + + /* deselect the original */ + strip->flag &= ~NLASTRIP_FLAG_SELECT; + + done++; + } + } + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + if (done) { + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done + allow for tweaking to be invoked */ + return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; + } + else + return OPERATOR_CANCELLED; +} + +void NLAEDIT_OT_duplicate (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Duplicate Strips"; + ot->idname= "NLAEDIT_OT_duplicate"; + ot->description= "Duplicate selected NLA-Strips, adding the new strips in new tracks above the originals."; + + /* api callbacks */ + ot->exec= nlaedit_duplicate_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /* ******************** Delete Strips Operator ***************************** */ /* Deletes the selected NLA-Strips */ diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index 175f40befeb..f8c6ba2131a 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -143,17 +143,23 @@ static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); - uiItemO(layout, NULL, 0, "NLA_OT_add_tracks"); - uiItemBooleanO(layout, "Add Tracks Above Selected", 0, "NLA_OT_add_tracks", "above_selected", 1); + uiItemO(layout, NULL, 0, "NLAEDIT_OT_duplicate"); + uiItemO(layout, NULL, 0, "NLAEDIT_OT_split"); + + uiItemS(layout); + uiItemO(layout, NULL, 0, "NLAEDIT_OT_delete"); +} + +static void nla_addmenu(bContext *C, uiLayout *layout, void *arg_unused) +{ uiItemO(layout, NULL, 0, "NLAEDIT_OT_add_actionclip"); uiItemO(layout, NULL, 0, "NLAEDIT_OT_add_transition"); - uiItemO(layout, NULL, 0, "NLAEDIT_OT_split"); - uiItemS(layout); - uiItemO(layout, NULL, 0, "NLAEDIT_OT_delete"); + uiItemO(layout, NULL, 0, "NLA_OT_add_tracks"); + uiItemBooleanO(layout, "Add Tracks Above Selected", 0, "NLA_OT_add_tracks", "above_selected", 1); } /* ------------------ */ @@ -196,6 +202,9 @@ void nla_header_buttons(const bContext *C, ARegion *ar) uiDefMenuBut(block, nla_editmenu, NULL, "Edit", xco, yco, xmax-3, 20, ""); xco+= xmax; + xmax= GetButStringLength("Add"); + uiDefMenuBut(block, nla_addmenu, NULL, "Add", xco, yco, xmax-3, 20, ""); + xco+= xmax; } uiBlockSetEmboss(block, UI_EMBOSS); diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index f1bde40f4ab..1237542172f 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -95,6 +95,7 @@ void NLAEDIT_OT_tweakmode_exit(wmOperatorType *ot); void NLAEDIT_OT_add_actionclip(wmOperatorType *ot); void NLAEDIT_OT_add_transition(wmOperatorType *ot); +void NLAEDIT_OT_duplicate(wmOperatorType *ot); void NLAEDIT_OT_delete(wmOperatorType *ot); void NLAEDIT_OT_split(wmOperatorType *ot); diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index a9b7022157e..52b529661cb 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -137,6 +137,7 @@ void nla_operatortypes(void) WM_operatortype_append(NLAEDIT_OT_add_actionclip); WM_operatortype_append(NLAEDIT_OT_add_transition); + WM_operatortype_append(NLAEDIT_OT_duplicate); WM_operatortype_append(NLAEDIT_OT_delete); WM_operatortype_append(NLAEDIT_OT_split); } @@ -215,6 +216,9 @@ static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "NLAEDIT_OT_add_actionclip", AKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "NLAEDIT_OT_add_transition", TKEY, KM_PRESS, KM_SHIFT, 0); + /* duplicate */ + WM_keymap_add_item(keymap, "NLAEDIT_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); + /* delete */ WM_keymap_add_item(keymap, "NLAEDIT_OT_delete", XKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "NLAEDIT_OT_delete", DELKEY, KM_PRESS, 0, 0); -- cgit v1.2.3 From bb9323a720483b0c02bf25ecfca9c6ccc8699519 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 19 Jun 2009 12:57:31 +0000 Subject: NLA SoC: Minor Tweaks (Duplicate + Muted-Strip Drawing) * Duplicate operator now inits transform once strips have been created * Muted strips now draw with a dotted outline --- source/blender/editors/space_nla/nla_draw.c | 15 ++++++++++++++- source/blender/editors/space_nla/nla_edit.c | 20 ++++++++++++++++++-- 2 files changed, 32 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 3a3f86bb5a3..9a9cbeeff21 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -68,6 +68,7 @@ #include "ED_screen.h" #include "BIF_gl.h" +#include "BIF_glutil.h" #include "WM_api.h" #include "WM_types.h" @@ -184,7 +185,10 @@ static void nla_draw_strip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2 uiSetRoundBox(15); /* all corners rounded */ gl_round_box_shade(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1); - /* draw strip outline - different colors are used here... */ + + /* draw strip outline + * - color used here is to indicate active vs non-active + */ if (strip->flag & NLASTRIP_FLAG_ACTIVE) { /* strip should appear 'sunken', so draw a light border around it */ glColor3f(0.9f, 1.0f, 0.9f); // FIXME: hardcoded temp-hack colors @@ -193,7 +197,16 @@ static void nla_draw_strip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2 /* strip should appear to stand out, so draw a dark border around it */ glColor3f(0.0f, 0.0f, 0.0f); } + + /* - line style: dotted for muted */ + if (strip->flag & NLASTRIP_FLAG_MUTED) + setlinestyle(4); + + /* draw outline */ gl_round_box_shade(GL_LINE_LOOP, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1); + + /* reset linestyle */ + setlinestyle(0); } /* add the relevant text to the cache of text-strings to draw in pixelspace */ diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index d2cf728ea58..8b7c6bb99c6 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -59,6 +59,8 @@ #include "ED_space_api.h" #include "ED_screen.h" +#include "BIF_transform.h" + #include "RNA_access.h" #include "RNA_define.h" @@ -506,13 +508,23 @@ static int nlaedit_duplicate_exec (bContext *C, wmOperator *op) ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); WM_event_add_notifier(C, NC_SCENE, NULL); - /* done + allow for tweaking to be invoked */ - return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; + /* done */ + return OPERATOR_FINISHED; } else return OPERATOR_CANCELLED; } +static int nlaedit_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + nlaedit_duplicate_exec(C, op); + + RNA_int_set(op->ptr, "mode", TFM_TIME_TRANSLATE); // XXX + WM_operator_name_call(C, "TFM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr); + + return OPERATOR_FINISHED; +} + void NLAEDIT_OT_duplicate (wmOperatorType *ot) { /* identifiers */ @@ -521,11 +533,15 @@ void NLAEDIT_OT_duplicate (wmOperatorType *ot) ot->description= "Duplicate selected NLA-Strips, adding the new strips in new tracks above the originals."; /* api callbacks */ + ot->invoke= nlaedit_duplicate_invoke; ot->exec= nlaedit_duplicate_exec; ot->poll= nlaop_poll_tweakmode_off; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* to give to transform */ + RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); } /* ******************** Delete Strips Operator ***************************** */ -- cgit v1.2.3 From 6c139156cf2b47ea9d8e7606204205cb01d4ad21 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 19 Jun 2009 14:56:49 +0000 Subject: RNA: * EditBone wrapped, using manual get/set function, and used in the UI code. Makes the RNA wrapping code here more complicated, but works. --- .../editors/space_buttons/buttons_context.c | 28 +- source/blender/makesrna/RNA_access.h | 1 + source/blender/makesrna/intern/makesrna.c | 4 +- source/blender/makesrna/intern/rna_ID.c | 1 - source/blender/makesrna/intern/rna_access.c | 2 +- source/blender/makesrna/intern/rna_armature.c | 552 ++++++++++++++++++--- 6 files changed, 499 insertions(+), 89 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 42180e7902f..fc280d9b551 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -54,6 +54,7 @@ #include "RNA_access.h" +#include "ED_armature.h" #include "ED_screen.h" #include "UI_interface.h" @@ -249,16 +250,29 @@ static int buttons_context_path_bone(ButsContextPath *path) { bArmature *arm; Bone *bone; + EditBone *edbo; /* if we have an armature, get the active bone */ if(buttons_context_path_data(path, OB_ARMATURE)) { arm= path->ptr[path->len-1].data; - bone= find_active_bone(arm->bonebase.first); - if(bone) { - RNA_pointer_create(&arm->id, &RNA_Bone, bone, &path->ptr[path->len]); - path->len++; - return 1; + if(arm->edbo) { + for(edbo=arm->edbo->first; edbo; edbo=edbo->next) { + if(edbo->flag & BONE_ACTIVE) { + RNA_pointer_create(&arm->id, &RNA_EditBone, edbo, &path->ptr[path->len]); + path->len++; + return 1; + } + } + } + else { + bone= find_active_bone(arm->bonebase.first); + + if(bone) { + RNA_pointer_create(&arm->id, &RNA_Bone, bone, &path->ptr[path->len]); + path->len++; + return 1; + } } } @@ -569,6 +583,10 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r set_pointer_type(path, result, &RNA_Bone); return 1; } + else if(CTX_data_equals(member, "edit_bone")) { + set_pointer_type(path, result, &RNA_EditBone); + return 1; + } else if(CTX_data_equals(member, "particle_system")) { set_pointer_type(path, result, &RNA_ParticleSystem); return 1; diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 1907b2cedb4..9b653bd924a 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -164,6 +164,7 @@ extern StructRNA RNA_DomainFluidSettings; extern StructRNA RNA_Driver; extern StructRNA RNA_DriverTarget; extern StructRNA RNA_EdgeSplitModifier; +extern StructRNA RNA_EditBone; extern StructRNA RNA_EffectSequence; extern StructRNA RNA_EnumProperty; extern StructRNA RNA_EnumPropertyItem; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index a8fe025fd46..c8273513711 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -702,8 +702,10 @@ static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA * else { if(manualfunc) fprintf(f, "\n %s(iter, ptr);\n", manualfunc); - else + else if(dp->dnapointerlevel == 0) fprintf(f, "\n rna_iterator_listbase_begin(iter, &data->%s, NULL);\n", dp->dnaname); + else + fprintf(f, "\n rna_iterator_listbase_begin(iter, data->%s, NULL);\n", dp->dnaname); } getfunc= rna_alloc_function_name(srna->identifier, prop->identifier, "get"); diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 52680e26afe..7d8bab8bee8 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -218,7 +218,6 @@ static void rna_def_ID(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - FunctionRNA *func; srna= RNA_def_struct(brna, "ID", NULL); RNA_def_struct_ui_text(srna, "ID", "Base type for datablocks, defining a unique name, linking from other libraries and garbage collection."); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index cfddb1daf10..8d0d87a72d3 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1500,7 +1500,7 @@ void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, ListBaseIterator *internal; internal= MEM_callocN(sizeof(ListBaseIterator), "ListBaseIterator"); - internal->link= lb->first; + internal->link= (lb)? lb->first: NULL; internal->skip= skip; iter->internal= internal; diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 631550964d6..0f437f8f1a8 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -36,25 +36,32 @@ #ifdef RNA_RUNTIME -static void rna_Bone_layer_set(PointerRNA *ptr, const int *values) +#include "ED_armature.h" + +static void rna_bone_layer_set(short *layer, const int *values) { - Bone *bone= (Bone*)ptr->data; int i, tot= 0; /* ensure we always have some layer selected */ - for(i=0; i<20; i++) + for(i=0; i<16; i++) if(values[i]) tot++; if(tot==0) return; - for(i=0; i<20; i++) { - if(values[i]) bone->layer |= (1<layer &= ~(1<data; + rna_bone_layer_set(&bone->layer, values); +} + static void rna_Armature_layer_set(PointerRNA *ptr, const int *values) { bArmature *arm= (bArmature*)ptr->data; @@ -102,152 +109,529 @@ static void rna_Armature_path_end_frame_set(PointerRNA *ptr, int value) data->pathef= value; } +PointerRNA rna_EditBone_rna_type_get(PointerRNA *ptr) +{ + return rna_builtin_type_get(ptr); +} + +void rna_EditBone_name_get(PointerRNA *ptr, char *value) +{ + EditBone *data= (EditBone*)(ptr->data); + BLI_strncpy(value, data->name, sizeof(data->name)); +} + +int rna_EditBone_name_length(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return strlen(data->name); +} + +int rna_EditBone_active_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (((data->flag) & BONE_ACTIVE) != 0); +} + +void rna_EditBone_active_set(PointerRNA *ptr, int value) +{ + EditBone *data= (EditBone*)(ptr->data); + if(value) data->flag |= BONE_ACTIVE; + else data->flag &= ~BONE_ACTIVE; +} + +float rna_EditBone_bbone_in_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (float)(data->ease1); +} + +void rna_EditBone_bbone_in_set(PointerRNA *ptr, float value) +{ + EditBone *data= (EditBone*)(ptr->data); + data->ease1= CLAMPIS(value, 0.0f, 2.0f); +} + +float rna_EditBone_bbone_out_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (float)(data->ease2); +} + +void rna_EditBone_bbone_out_set(PointerRNA *ptr, float value) +{ + EditBone *data= (EditBone*)(ptr->data); + data->ease2= CLAMPIS(value, 0.0f, 2.0f); +} + +int rna_EditBone_bbone_segments_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (int)(data->segments); +} + +void rna_EditBone_bbone_segments_set(PointerRNA *ptr, int value) +{ + EditBone *data= (EditBone*)(ptr->data); + data->segments= CLAMPIS(value, 1, 32); +} + +void rna_EditBone_layer_get(PointerRNA *ptr, int values[16]) +{ + EditBone *data= (EditBone*)(ptr->data); + values[0]= ((data->layer & (1<<0)) != 0); + values[1]= ((data->layer & (1<<1)) != 0); + values[2]= ((data->layer & (1<<2)) != 0); + values[3]= ((data->layer & (1<<3)) != 0); + values[4]= ((data->layer & (1<<4)) != 0); + values[5]= ((data->layer & (1<<5)) != 0); + values[6]= ((data->layer & (1<<6)) != 0); + values[7]= ((data->layer & (1<<7)) != 0); + values[8]= ((data->layer & (1<<8)) != 0); + values[9]= ((data->layer & (1<<9)) != 0); + values[10]= ((data->layer & (1<<10)) != 0); + values[11]= ((data->layer & (1<<11)) != 0); + values[12]= ((data->layer & (1<<12)) != 0); + values[13]= ((data->layer & (1<<13)) != 0); + values[14]= ((data->layer & (1<<14)) != 0); + values[15]= ((data->layer & (1<<15)) != 0); +} + +void rna_EditBone_layer_set(PointerRNA *ptr, const int values[16]) +{ + EditBone *data= (EditBone*)(ptr->data); + rna_bone_layer_set(&data->layer, values); +} + +int rna_EditBone_connected_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (((data->flag) & BONE_CONNECTED) != 0); +} + +void rna_EditBone_connected_set(PointerRNA *ptr, int value) +{ + EditBone *data= (EditBone*)(ptr->data); + if(value) data->flag |= BONE_CONNECTED; + else data->flag &= ~BONE_CONNECTED; +} + +int rna_EditBone_cyclic_offset_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (!((data->flag) & BONE_NO_CYCLICOFFSET) != 0); +} + +void rna_EditBone_cyclic_offset_set(PointerRNA *ptr, int value) +{ + EditBone *data= (EditBone*)(ptr->data); + if(!value) data->flag |= BONE_NO_CYCLICOFFSET; + else data->flag &= ~BONE_NO_CYCLICOFFSET; +} + +int rna_EditBone_deform_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (!((data->flag) & BONE_NO_DEFORM) != 0); +} + +void rna_EditBone_deform_set(PointerRNA *ptr, int value) +{ + EditBone *data= (EditBone*)(ptr->data); + if(!value) data->flag |= BONE_NO_DEFORM; + else data->flag &= ~BONE_NO_DEFORM; +} + +int rna_EditBone_draw_wire_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (((data->flag) & BONE_DRAWWIRE) != 0); +} + +void rna_EditBone_draw_wire_set(PointerRNA *ptr, int value) +{ + EditBone *data= (EditBone*)(ptr->data); + if(value) data->flag |= BONE_DRAWWIRE; + else data->flag &= ~BONE_DRAWWIRE; +} + +float rna_EditBone_envelope_distance_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (float)(data->dist); +} + +void rna_EditBone_envelope_distance_set(PointerRNA *ptr, float value) +{ + EditBone *data= (EditBone*)(ptr->data); + data->dist= CLAMPIS(value, 0.0f, 1000.0f); +} + +float rna_EditBone_envelope_weight_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (float)(data->weight); +} + +void rna_EditBone_envelope_weight_set(PointerRNA *ptr, float value) +{ + EditBone *data= (EditBone*)(ptr->data); + data->weight= CLAMPIS(value, 0.0f, 1000.0f); +} + +float rna_EditBone_radius_head_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (float)(data->rad_head); +} + +void rna_EditBone_radius_head_set(PointerRNA *ptr, float value) +{ + EditBone *data= (EditBone*)(ptr->data); + data->rad_head= value; +} + +float rna_EditBone_radius_tail_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (float)(data->rad_tail); +} + +void rna_EditBone_radius_tail_set(PointerRNA *ptr, float value) +{ + EditBone *data= (EditBone*)(ptr->data); + data->rad_tail= value; +} + +void rna_EditBone_head_get(PointerRNA *ptr, float values[3]) +{ + EditBone *data= (EditBone*)(ptr->data); + values[0]= (float)(((float*)data->head)[0]); + values[1]= (float)(((float*)data->head)[1]); + values[2]= (float)(((float*)data->head)[2]); +} + +void rna_EditBone_head_set(PointerRNA *ptr, const float values[3]) +{ + EditBone *data= (EditBone*)(ptr->data); + ((float*)data->head)[0]= values[0]; + ((float*)data->head)[1]= values[1]; + ((float*)data->head)[2]= values[2]; +} + +int rna_EditBone_head_selected_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (((data->flag) & BONE_ROOTSEL) != 0); +} + +void rna_EditBone_head_selected_set(PointerRNA *ptr, int value) +{ + EditBone *data= (EditBone*)(ptr->data); + if(value) data->flag |= BONE_ROOTSEL; + else data->flag &= ~BONE_ROOTSEL; +} + +int rna_EditBone_hidden_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (((data->flag) & BONE_HIDDEN_A) != 0); +} + +void rna_EditBone_hidden_set(PointerRNA *ptr, int value) +{ + EditBone *data= (EditBone*)(ptr->data); + if(value) data->flag |= BONE_HIDDEN_A; + else data->flag &= ~BONE_HIDDEN_A; +} + +int rna_EditBone_hinge_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (!((data->flag) & BONE_HINGE) != 0); +} + +void rna_EditBone_hinge_set(PointerRNA *ptr, int value) +{ + EditBone *data= (EditBone*)(ptr->data); + if(!value) data->flag |= BONE_HINGE; + else data->flag &= ~BONE_HINGE; +} + +int rna_EditBone_inherit_scale_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (!((data->flag) & BONE_NO_SCALE) != 0); +} + +void rna_EditBone_inherit_scale_set(PointerRNA *ptr, int value) +{ + EditBone *data= (EditBone*)(ptr->data); + if(!value) data->flag |= BONE_NO_SCALE; + else data->flag &= ~BONE_NO_SCALE; +} + +int rna_EditBone_locked_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (((data->flag) & BONE_EDITMODE_LOCKED) != 0); +} + +void rna_EditBone_locked_set(PointerRNA *ptr, int value) +{ + EditBone *data= (EditBone*)(ptr->data); + if(value) data->flag |= BONE_EDITMODE_LOCKED; + else data->flag &= ~BONE_EDITMODE_LOCKED; +} + +int rna_EditBone_multiply_vertexgroup_with_envelope_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (((data->flag) & BONE_MULT_VG_ENV) != 0); +} + +void rna_EditBone_multiply_vertexgroup_with_envelope_set(PointerRNA *ptr, int value) +{ + EditBone *data= (EditBone*)(ptr->data); + if(value) data->flag |= BONE_MULT_VG_ENV; + else data->flag &= ~BONE_MULT_VG_ENV; +} + +PointerRNA rna_EditBone_parent_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return rna_pointer_inherit_refine(ptr, &RNA_EditBone, data->parent); +} + +float rna_EditBone_roll_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (float)(data->roll); +} + +void rna_EditBone_roll_set(PointerRNA *ptr, float value) +{ + EditBone *data= (EditBone*)(ptr->data); + data->roll= value; +} + +void rna_EditBone_tail_get(PointerRNA *ptr, float values[3]) +{ + EditBone *data= (EditBone*)(ptr->data); + values[0]= (float)(((float*)data->tail)[0]); + values[1]= (float)(((float*)data->tail)[1]); + values[2]= (float)(((float*)data->tail)[2]); +} + +void rna_EditBone_tail_set(PointerRNA *ptr, const float values[3]) +{ + EditBone *data= (EditBone*)(ptr->data); + ((float*)data->tail)[0]= values[0]; + ((float*)data->tail)[1]= values[1]; + ((float*)data->tail)[2]= values[2]; +} + +int rna_EditBone_tail_selected_get(PointerRNA *ptr) +{ + EditBone *data= (EditBone*)(ptr->data); + return (((data->flag) & BONE_TIPSEL) != 0); +} + +void rna_EditBone_tail_selected_set(PointerRNA *ptr, int value) +{ + EditBone *data= (EditBone*)(ptr->data); + if(value) data->flag |= BONE_TIPSEL; + else data->flag &= ~BONE_TIPSEL; +} + #else -// err... bones should not be directly edited (only editbones should be...) -static void rna_def_bone(BlenderRNA *brna) +static void rna_def_bone_common(StructRNA *srna, int editbone) { - StructRNA *srna; PropertyRNA *prop; - - srna= RNA_def_struct(brna, "Bone", NULL); - RNA_def_struct_ui_text(srna, "Bone", "Bone in an Armature datablock."); - RNA_def_struct_ui_icon(srna, ICON_BONE_DATA); - - /* pointers/collections */ - /* parent (pointer) */ - prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Bone"); - RNA_def_property_pointer_sdna(prop, NULL, "parent"); - RNA_def_property_ui_text(prop, "Parent", "Parent bone (in same Armature)."); - - /* children (collection) */ - prop= RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE); - RNA_def_property_collection_sdna(prop, NULL, "childbase", NULL); - RNA_def_property_struct_type(prop, "Bone"); - RNA_def_property_ui_text(prop, "Children", "Bones which are children of this bone"); - + /* strings */ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* must be unique */ RNA_def_property_ui_text(prop, "Name", ""); RNA_def_struct_name_property(srna, prop); - + if(editbone) RNA_def_property_string_funcs(prop, "rna_EditBone_name_get", "rna_EditBone_name_length", "rna_EditBone_name_set"); + /* flags */ - /* layer */ prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "layer", 1); RNA_def_property_array(prop, 16); RNA_def_property_ui_text(prop, "Bone Layers", "Layers bone exists in"); - RNA_def_property_boolean_funcs(prop, NULL, "rna_Bone_layer_set"); + if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_layer_get", "rna_EditBone_layer_set"); + else { + RNA_def_property_boolean_funcs(prop, NULL, "rna_Bone_layer_set"); + RNA_def_property_boolean_sdna(prop, NULL, "layer", 1); + } - /* flag */ - prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_SELECTED); - RNA_def_property_ui_text(prop, "Selected", ""); - - prop= RNA_def_property(srna, "head_selected", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_ROOTSEL); - RNA_def_property_ui_text(prop, "Head Selected", ""); - - prop= RNA_def_property(srna, "tail_selected", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_TIPSEL); - RNA_def_property_ui_text(prop, "Tail Selected", ""); - prop= RNA_def_property(srna, "connected", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_CONNECTED); + if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_connected_get", "rna_EditBone_connected_set"); + else RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_CONNECTED); RNA_def_property_ui_text(prop, "Connected", "When bone has a parent, bone's head is struck to the parent's tail."); - // XXX should we define this in PoseChannel wrapping code instead? but PoseChannels directly get some of their flags from here... - prop= RNA_def_property(srna, "pose_channel_hidden", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_P); - RNA_def_property_ui_text(prop, "Pose Channel Hidden", "Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes)."); - prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_ACTIVE); + if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_active_get", "rna_EditBone_active_set"); + else RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_ACTIVE); RNA_def_property_ui_text(prop, "Active", "Bone was the last bone clicked on (most operations are applied to only this bone)"); prop= RNA_def_property(srna, "hinge", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_HINGE); + if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_hinge_get", "rna_EditBone_hinge_set"); + else RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_HINGE); RNA_def_property_ui_text(prop, "Inherit Rotation", "Bone doesn't inherit rotation or scale from parent bone."); - prop= RNA_def_property(srna, "editmode_hidden", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_A); - RNA_def_property_ui_text(prop, "Edit Mode Hidden", "Bone is not visible when in Edit Mode"); - prop= RNA_def_property(srna, "multiply_vertexgroup_with_envelope", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_MULT_VG_ENV); + if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_multiply_vertexgroup_with_envelope_get", "rna_EditBone_multiply_vertexgroup_with_envelope_set"); + else RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_MULT_VG_ENV); RNA_def_property_ui_text(prop, "Multiply Vertex Group with Envelope", "When deforming bone, multiply effects of Vertex Group weights with Envelope influence."); prop= RNA_def_property(srna, "deform", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_DEFORM); + if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_deform_get", "rna_EditBone_deform_set"); + else RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_DEFORM); RNA_def_property_ui_text(prop, "Deform", "Bone does not deform any geometry."); prop= RNA_def_property(srna, "inherit_scale", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_SCALE); RNA_def_property_ui_text(prop, "Inherit Scale", "Bone inherits scaling from parent bone."); + if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_inherit_scale_get", "rna_EditBone_inherit_scale_set"); + else RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_SCALE); prop= RNA_def_property(srna, "draw_wire", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_DRAWWIRE); + if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_draw_wire_get", "rna_EditBone_draw_wire_set"); + else RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_DRAWWIRE); RNA_def_property_ui_text(prop, "Draw Wire", "Bone is always drawn as Wireframe regardless of viewport draw mode. Useful for non-obstructive custom bone shapes."); prop= RNA_def_property(srna, "cyclic_offset", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_CYCLICOFFSET); + if(editbone) RNA_def_property_boolean_funcs(prop, "rna_EditBone_cyclic_offset_get", "rna_EditBone_cyclic_offset_set"); + else RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_CYCLICOFFSET); RNA_def_property_ui_text(prop, "Cyclic Offset", "When bone doesn't have a parent, it receives cyclic offset effects."); - - prop= RNA_def_property(srna, "editmode_locked", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_EDITMODE_LOCKED); - RNA_def_property_ui_text(prop, "Edit Mode Locked", "Bone is not able to be transformed when in Edit Mode."); - + /* Number values */ /* envelope deform settings */ prop= RNA_def_property(srna, "envelope_distance", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "dist"); + if(editbone) RNA_def_property_float_funcs(prop, "rna_EditBone_envelope_distance_get", "rna_EditBone_envelope_distance_set", NULL); + else RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Envelope Deform Distance", "Bone deformation distance (for Envelope deform only)."); prop= RNA_def_property(srna, "envelope_weight", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "weight"); + if(editbone) RNA_def_property_float_funcs(prop, "rna_EditBone_envelope_weight_get", "rna_EditBone_envelope_weight_set", NULL); + else RNA_def_property_float_sdna(prop, NULL, "weight"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Envelope Deform Weight", "Bone deformation weight (for Envelope deform only)."); prop= RNA_def_property(srna, "radius_head", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "rad_head"); + if(editbone) RNA_def_property_float_funcs(prop, "rna_EditBone_radius_head_get", "rna_EditBone_radius_head_set", NULL); + else RNA_def_property_float_sdna(prop, NULL, "rad_head"); //RNA_def_property_range(prop, 0, 1000); // XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); RNA_def_property_ui_text(prop, "Envelope Radius Head", "Radius of head of bone (for Envelope deform only)."); prop= RNA_def_property(srna, "radius_tail", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "rad_tail"); + if(editbone) RNA_def_property_float_funcs(prop, "rna_EditBone_radius_tail_get", "rna_EditBone_radius_tail_set", NULL); + else RNA_def_property_float_sdna(prop, NULL, "rad_tail"); //RNA_def_property_range(prop, 0, 1000); // XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); RNA_def_property_ui_text(prop, "Envelope Radius Tail", "Radius of tail of bone (for Envelope deform only)."); /* b-bones deform settings */ prop= RNA_def_property(srna, "bbone_segments", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "segments"); + if(editbone) RNA_def_property_int_funcs(prop, "rna_EditBone_bbone_segments_get", "rna_EditBone_bbone_segments_set", NULL); + else RNA_def_property_int_sdna(prop, NULL, "segments"); RNA_def_property_range(prop, 1, 32); RNA_def_property_ui_text(prop, "B-Bone Segments", "Number of subdivisions of bone (for B-Bones only)."); prop= RNA_def_property(srna, "bbone_in", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "ease1"); + if(editbone) RNA_def_property_float_funcs(prop, "rna_EditBone_bbone_in_get", "rna_EditBone_bbone_in_set", NULL); + else RNA_def_property_float_sdna(prop, NULL, "ease1"); RNA_def_property_range(prop, 0.0f, 2.0f); RNA_def_property_ui_text(prop, "B-Bone Ease In", "Length of first Bezier Handle (for B-Bones only)."); prop= RNA_def_property(srna, "bbone_out", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "ease2"); + if(editbone) RNA_def_property_float_funcs(prop, "rna_EditBone_bbone_out_get", "rna_EditBone_bbone_out_set", NULL); + else RNA_def_property_float_sdna(prop, NULL, "ease2"); RNA_def_property_range(prop, 0.0f, 2.0f); RNA_def_property_ui_text(prop, "B-Bone Ease Out", "Length of second Bezier Handle (for B-Bones only)."); +} + +// err... bones should not be directly edited (only editbones should be...) +static void rna_def_bone(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; - /* editmode bone coordinates */ - // XXX not sure if we want to wrap these here... besides, changing these requires changing the matrix? - prop= RNA_def_property(srna, "head", PROP_FLOAT, PROP_VECTOR); - RNA_def_property_ui_text(prop, "Bone Head Location", "In Edit Mode, the location of the 'head' of the bone."); + srna= RNA_def_struct(brna, "Bone", NULL); + RNA_def_struct_ui_text(srna, "Bone", "Bone in an Armature datablock."); + RNA_def_struct_ui_icon(srna, ICON_BONE_DATA); - prop= RNA_def_property(srna, "tail", PROP_FLOAT, PROP_VECTOR); - RNA_def_property_ui_text(prop, "Bone Tail Location", "In Edit Mode, the location of the 'head' of the bone."); + /* pointers/collections */ + /* parent (pointer) */ + prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "Bone"); + RNA_def_property_pointer_sdna(prop, NULL, "parent"); + RNA_def_property_ui_text(prop, "Parent", "Parent bone (in same Armature)."); + + /* children (collection) */ + prop= RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "childbase", NULL); + RNA_def_property_struct_type(prop, "Bone"); + RNA_def_property_ui_text(prop, "Children", "Bones which are children of this bone"); + + rna_def_bone_common(srna, 0); + + // XXX should we define this in PoseChannel wrapping code instead? but PoseChannels directly get some of their flags from here... + prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_P); + RNA_def_property_ui_text(prop, "Hidden", "Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes)."); + + prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_SELECTED); + RNA_def_property_ui_text(prop, "Selected", ""); +} + +static void rna_def_edit_bone(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "EditBone", NULL); + RNA_def_struct_ui_text(srna, "Edit Bone", "Editmode bone in an Armature datablock."); + RNA_def_struct_ui_icon(srna, ICON_BONE_DATA); + + prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "EditBone"); + RNA_def_property_pointer_funcs(prop, "rna_EditBone_parent_get", NULL, NULL); + RNA_def_property_ui_text(prop, "Parent", "Parent edit bone (in same Armature)."); prop= RNA_def_property(srna, "roll", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, 0.0f, 2.0f); - RNA_def_property_ui_text(prop, "Bone Roll", "In Edit Mode, the 'roll' (i.e. rotation around the bone vector, equivalent to local Y-axis rotation)."); + RNA_def_property_float_funcs(prop, "rna_EditBone_roll_get", "rna_EditBone_roll_set", NULL); + RNA_def_property_ui_text(prop, "Roll", "Bone rotation around head-tail axis."); + + prop= RNA_def_property(srna, "head", PROP_FLOAT, PROP_VECTOR); + RNA_def_property_array(prop, 3); + RNA_def_property_float_funcs(prop, "rna_EditBone_head_get", "rna_EditBone_head_set", NULL); + RNA_def_property_ui_text(prop, "Head", "Location of head end of the bone."); + + prop= RNA_def_property(srna, "tail", PROP_FLOAT, PROP_VECTOR); + RNA_def_property_array(prop, 3); + RNA_def_property_float_funcs(prop, "rna_EditBone_tail_get", "rna_EditBone_tail_set", NULL); + RNA_def_property_ui_text(prop, "Tail", "Location of tail end of the bone."); + + rna_def_bone_common(srna, 1); + + prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_EditBone_hidden_get", "rna_EditBone_hidden_set"); + RNA_def_property_ui_text(prop, "Hidden", "Bone is not visible when in Edit Mode"); + + prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_EditBone_locked_get", "rna_EditBone_locked_set"); + RNA_def_property_ui_text(prop, "Locked", "Bone is not able to be transformed when in Edit Mode."); + + prop= RNA_def_property(srna, "head_selected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_EditBone_head_selected_get", "rna_EditBone_head_selected_set"); + RNA_def_property_ui_text(prop, "Head Selected", ""); + + prop= RNA_def_property(srna, "tail_selected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_EditBone_tail_selected_get", "rna_EditBone_tail_selected_set"); + RNA_def_property_ui_text(prop, "Tail Selected", ""); } void rna_def_armature(BlenderRNA *brna) @@ -278,6 +662,11 @@ void rna_def_armature(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "bonebase", NULL); RNA_def_property_struct_type(prop, "Bone"); RNA_def_property_ui_text(prop, "Bones", ""); + + prop= RNA_def_property(srna, "edit_bones", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "edbo", NULL); + RNA_def_property_struct_type(prop, "EditBone"); + RNA_def_property_ui_text(prop, "Edit Bones", ""); /* Enum values */ prop= RNA_def_property(srna, "drawtype", PROP_ENUM, PROP_NONE); @@ -436,6 +825,7 @@ void RNA_def_armature(BlenderRNA *brna) { rna_def_armature(brna); rna_def_bone(brna); + rna_def_edit_bone(brna); } #endif -- cgit v1.2.3 From c3b8db4833fe561ce8803af1619a4f1eb5f0c3b6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 19 Jun 2009 16:27:01 +0000 Subject: BGE: allow action blending by bringing back blend_poses() as game_blend_poses, the new animation system doesnt use it but doesnt have a replacement function so it can be kept for the BGE only. --- source/blender/blenkernel/BKE_action.h | 2 +- source/blender/blenkernel/intern/action.c | 140 +++++++++++---------- source/gameengine/Converter/BL_ActionActuator.cpp | 2 +- .../Converter/KX_BlenderScalarInterpolator.cpp | 3 + 4 files changed, 76 insertions(+), 71 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h index 67eb2ed58bf..f0796697670 100644 --- a/source/blender/blenkernel/BKE_action.h +++ b/source/blender/blenkernel/BKE_action.h @@ -137,7 +137,7 @@ void framechange_poses_clear_unkeyed(void); void what_does_obaction(struct Scene *scene, struct Object *ob, struct Object *workob, struct bPose *pose, struct bAction *act, char groupname[], float cframe); /* exported for game engine */ -void blend_poses(struct bPose *dst, struct bPose *src, float srcweight, short mode); +void game_blend_poses(struct bPose *dst, struct bPose *src, float srcweight/*, short mode*/); /* was blend_poses */ void extract_pose_from_pose(struct bPose *pose, const struct bPose *src); /* for proxy */ diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index fb1b2e9cf70..f7e15cef4c4 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -581,6 +581,77 @@ void game_copy_pose(bPose **dst, bPose *src) *dst=out; } + +/* Only allowed for Poses with identical channels */ +void game_blend_poses(bPose *dst, bPose *src, float srcweight/*, short mode*/) +{ + short mode= ACTSTRIPMODE_BLEND; + + bPoseChannel *dchan; + const bPoseChannel *schan; + bConstraint *dcon, *scon; + float dstweight; + int i; + + switch (mode){ + case ACTSTRIPMODE_BLEND: + dstweight = 1.0F - srcweight; + break; + case ACTSTRIPMODE_ADD: + dstweight = 1.0F; + break; + default : + dstweight = 1.0F; + } + + schan= src->chanbase.first; + for (dchan = dst->chanbase.first; dchan; dchan=dchan->next, schan= schan->next){ + if (schan->flag & (POSE_ROT|POSE_LOC|POSE_SIZE)) { + /* replaced quat->matrix->quat conversion with decent quaternion interpol (ton) */ + + /* Do the transformation blend */ + if (schan->flag & POSE_ROT) { + /* quat interpolation done separate */ + if (schan->rotmode == PCHAN_ROT_QUAT) { + float dquat[4], squat[4]; + + QUATCOPY(dquat, dchan->quat); + QUATCOPY(squat, schan->quat); + if (mode==ACTSTRIPMODE_BLEND) + QuatInterpol(dchan->quat, dquat, squat, srcweight); + else { + QuatMulFac(squat, srcweight); + QuatMul(dchan->quat, dquat, squat); + } + + NormalQuat(dchan->quat); + } + } + + for (i=0; i<3; i++) { + /* blending for loc and scale are pretty self-explanatory... */ + if (schan->flag & POSE_LOC) + dchan->loc[i] = (dchan->loc[i]*dstweight) + (schan->loc[i]*srcweight); + if (schan->flag & POSE_SIZE) + dchan->size[i] = 1.0f + ((dchan->size[i]-1.0f)*dstweight) + ((schan->size[i]-1.0f)*srcweight); + + /* euler-rotation interpolation done here instead... */ + // FIXME: are these results decent? + if ((schan->flag & POSE_ROT) && (schan->rotmode)) + dchan->eul[i] = (dchan->eul[i]*dstweight) + (schan->eul[i]*srcweight); + } + dchan->flag |= schan->flag; + } + for(dcon= dchan->constraints.first, scon= schan->constraints.first; dcon && scon; dcon= dcon->next, scon= scon->next) { + /* no 'add' option for constraint blending */ + dcon->enforce= dcon->enforce*(1.0f-srcweight) + scon->enforce*srcweight; + } + } + + /* this pose is now in src time */ + dst->ctime= src->ctime; +} + void game_free_pose(bPose *pose) { if (pose) { @@ -1039,75 +1110,6 @@ static void blend_pose_offset_bone(bActionStrip *strip, bPose *dst, bPose *src, VecAddf(dst->cyclic_offset, dst->cyclic_offset, src->cyclic_offset); } - -/* Only allowed for Poses with identical channels */ -void blend_poses(bPose *dst, bPose *src, float srcweight, short mode) -{ - bPoseChannel *dchan; - const bPoseChannel *schan; - bConstraint *dcon, *scon; - float dstweight; - int i; - - switch (mode){ - case ACTSTRIPMODE_BLEND: - dstweight = 1.0F - srcweight; - break; - case ACTSTRIPMODE_ADD: - dstweight = 1.0F; - break; - default : - dstweight = 1.0F; - } - - schan= src->chanbase.first; - for (dchan = dst->chanbase.first; dchan; dchan=dchan->next, schan= schan->next){ - if (schan->flag & (POSE_ROT|POSE_LOC|POSE_SIZE)) { - /* replaced quat->matrix->quat conversion with decent quaternion interpol (ton) */ - - /* Do the transformation blend */ - if (schan->flag & POSE_ROT) { - /* quat interpolation done separate */ - if (schan->rotmode == PCHAN_ROT_QUAT) { - float dquat[4], squat[4]; - - QUATCOPY(dquat, dchan->quat); - QUATCOPY(squat, schan->quat); - if (mode==ACTSTRIPMODE_BLEND) - QuatInterpol(dchan->quat, dquat, squat, srcweight); - else { - QuatMulFac(squat, srcweight); - QuatMul(dchan->quat, dquat, squat); - } - - NormalQuat(dchan->quat); - } - } - - for (i=0; i<3; i++) { - /* blending for loc and scale are pretty self-explanatory... */ - if (schan->flag & POSE_LOC) - dchan->loc[i] = (dchan->loc[i]*dstweight) + (schan->loc[i]*srcweight); - if (schan->flag & POSE_SIZE) - dchan->size[i] = 1.0f + ((dchan->size[i]-1.0f)*dstweight) + ((schan->size[i]-1.0f)*srcweight); - - /* euler-rotation interpolation done here instead... */ - // FIXME: are these results decent? - if ((schan->flag & POSE_ROT) && (schan->rotmode)) - dchan->eul[i] = (dchan->eul[i]*dstweight) + (schan->eul[i]*srcweight); - } - dchan->flag |= schan->flag; - } - for(dcon= dchan->constraints.first, scon= schan->constraints.first; dcon && scon; dcon= dcon->next, scon= scon->next) { - /* no 'add' option for constraint blending */ - dcon->enforce= dcon->enforce*(1.0f-srcweight) + scon->enforce*srcweight; - } - } - - /* this pose is now in src time */ - dst->ctime= src->ctime; -} - typedef struct NlaIpoChannel { struct NlaIpoChannel *next, *prev; float val; diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 131d48aed4f..c0d28d28bda 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -409,7 +409,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame) /* Find percentages */ newweight = (m_blendframe/(float)m_blendin); - // XXX blend_poses(m_pose, m_blendpose, 1.0 - newweight, ACTSTRIPMODE_BLEND); + game_blend_poses(m_pose, m_blendpose, 1.0 - newweight); /* Increment current blending percentage */ m_blendframe = (curtime - m_blendstart)*KX_KetsjiEngine::GetAnimFrameRate(); diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp index 20829524558..c3264a2bc37 100644 --- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp +++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp @@ -43,6 +43,9 @@ float BL_ScalarInterpolator::GetValue(float currentTime) const { } BL_InterpolatorList::BL_InterpolatorList(struct AnimData *adt) { + if(adt->action==NULL) + return; + for(FCurve *fcu= (FCurve *)adt->action->curves.first; fcu; fcu= (FCurve *)fcu->next) { if(fcu->rna_path) { BL_ScalarInterpolator *new_ipo = new BL_ScalarInterpolator(fcu); -- cgit v1.2.3 From 7349d775b0c80a112cc90888db80f481a36c4b92 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Fri, 19 Jun 2009 22:16:30 +0000 Subject: 2.5/Sculpt: Made some improvements to how brush strength works. * For the draw and inflate brushes, the brush's 3D radius is used to set the "goal" distance, towards which vertices move. A strength setting of 1.0 will move verts there immediately (with the usual exceptions of tablet pressure, texture/curve input, etc.) * Also changed strength calculation to use the square of the strength slider, so that you don't have to be as finicky setting a low brush strength. * For smooth brush, added an extra loop through the verts. So, a bit slower, but now verts take into account more than the immediate vertex ring. TODO: Still some magic numbers: * Pinch limits the effect to moving vertices half of the way towards brush center. I see no use for a 100% pinch (it pretty much destroys the mesh.) Even half may be too high a limit, but this is hard to place an exact number on. * Smooth has two magic numbers, the strength fudge factor and the number of smooth repetitions (currently 2.) * The way the layer brush works is left unchanged for now. --- source/blender/editors/sculpt_paint/sculpt.c | 87 +++++++++++++++------------- 1 file changed, 46 insertions(+), 41 deletions(-) (limited to 'source') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 2dba08b4601..7703dc0c303 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -234,6 +234,9 @@ static char brush_size(Sculpt *sd) special multiplier found experimentally to scale the strength factor. */ static float brush_strength(Sculpt *sd, StrokeCache *cache) { + /* Primary strength input; square it to make lower values more sensitive */ + float alpha = sd->brush->alpha * sd->brush->alpha; + float dir= sd->brush->flag & BRUSH_DIR_IN ? -1 : 1; float pressure= 1; float flip= cache->flip ? -1:1; @@ -244,18 +247,17 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache) switch(sd->brush->sculpt_tool){ case SCULPT_TOOL_DRAW: - case SCULPT_TOOL_LAYER: - return sd->brush->alpha / 50.0f * dir * pressure * flip * anchored; /*XXX: not sure why? multiplied by G.vd->grid */; + case SCULPT_TOOL_INFLATE: + return alpha * dir * pressure * flip; /*XXX: not sure why? was multiplied by G.vd->grid */; + case SCULPT_TOOL_FLATTEN: case SCULPT_TOOL_SMOOTH: - return sd->brush->alpha / .5 * pressure * anchored; + return alpha * 4 * pressure; case SCULPT_TOOL_PINCH: - return sd->brush->alpha / 10.0f * dir * pressure * flip * anchored; + return alpha / 2 * dir * pressure * flip; case SCULPT_TOOL_GRAB: return 1; - case SCULPT_TOOL_INFLATE: - return sd->brush->alpha / 50.0f * dir * pressure * flip * anchored; - case SCULPT_TOOL_FLATTEN: - return sd->brush->alpha / 5.0f * pressure * anchored; + case SCULPT_TOOL_LAYER: + return sd->brush->alpha / 50.0f * dir * pressure * flip * anchored; /*XXX: not sure why? multiplied by G.vd->grid */; default: return 0; } @@ -354,10 +356,10 @@ static void do_draw_brush(Sculpt *sd, SculptSession *ss, const ListBase* active_ while(node){ float *co= ss->mvert[node->Index].co; - - const float val[3]= {co[0]+area_normal[0]*node->Fade*ss->cache->scale[0], - co[1]+area_normal[1]*node->Fade*ss->cache->scale[1], - co[2]+area_normal[2]*node->Fade*ss->cache->scale[2]}; + + const float val[3]= {co[0]+area_normal[0]*ss->cache->radius*node->Fade*ss->cache->scale[0], + co[1]+area_normal[1]*ss->cache->radius*node->Fade*ss->cache->scale[1], + co[2]+area_normal[2]*ss->cache->radius*node->Fade*ss->cache->scale[2]}; sculpt_clip(ss->cache, co, val); @@ -412,18 +414,21 @@ static void neighbor_average(SculptSession *ss, float avg[3], const int vert) static void do_smooth_brush(SculptSession *ss, const ListBase* active_verts) { ActiveData *node= active_verts->first; - - while(node){ - float *co= ss->mvert[node->Index].co; - float avg[3], val[3]; - - neighbor_average(ss, avg, node->Index); - val[0] = co[0]+(avg[0]-co[0])*node->Fade; - val[1] = co[1]+(avg[1]-co[1])*node->Fade; - val[2] = co[2]+(avg[2]-co[2])*node->Fade; - - sculpt_clip(ss->cache, co, val); - node= node->next; + int i; + + for(i = 0; i < 2; ++i) { + while(node){ + float *co= ss->mvert[node->Index].co; + float avg[3], val[3]; + + neighbor_average(ss, avg, node->Index); + val[0] = co[0]+(avg[0]-co[0])*node->Fade; + val[1] = co[1]+(avg[1]-co[1])*node->Fade; + val[2] = co[2]+(avg[2]-co[2])*node->Fade; + + sculpt_clip(ss->cache, co, val); + node= node->next; + } } } @@ -467,33 +472,33 @@ static void do_layer_brush(Sculpt *sd, SculptSession *ss, const ListBase *active { float area_normal[3]; ActiveData *node= active_verts->first; - const float bstr= brush_strength(sd, ss->cache); + float lim= brush_strength(sd, ss->cache); + + if(sd->brush->flag & BRUSH_DIR_IN) + lim = -lim; calc_area_normal(sd, area_normal, active_verts); while(node){ float *disp= &ss->cache->layer_disps[node->Index]; - if((bstr > 0 && *disp < bstr) || - (bstr < 0 && *disp > bstr)) { + if((lim > 0 && *disp < lim) || + (lim < 0 && *disp > lim)) { float *co= ss->mvert[node->Index].co; + float val[3]; *disp+= node->Fade; - if(bstr < 0) { - if(*disp < bstr) - *disp = bstr; - } else { - if(*disp > bstr) - *disp = bstr; - } + if(lim < 0 && *disp < lim) + *disp = lim; + else if(lim > 0 && *disp > lim) + *disp = lim; - { - const float val[3]= {ss->cache->mesh_store[node->Index][0]+area_normal[0] * *disp*ss->cache->scale[0], - ss->cache->mesh_store[node->Index][1]+area_normal[1] * *disp*ss->cache->scale[1], - ss->cache->mesh_store[node->Index][2]+area_normal[2] * *disp*ss->cache->scale[2]}; - sculpt_clip(ss->cache, co, val); - } + val[0] = ss->cache->mesh_store[node->Index][0]+area_normal[0] * *disp*ss->cache->scale[0]; + val[1] = ss->cache->mesh_store[node->Index][1]+area_normal[1] * *disp*ss->cache->scale[1]; + val[2] = ss->cache->mesh_store[node->Index][2]+area_normal[2] * *disp*ss->cache->scale[2]; + //VecMulf(val, ss->cache->radius); + sculpt_clip(ss->cache, co, val); } node= node->next; @@ -512,7 +517,7 @@ static void do_inflate_brush(SculptSession *ss, const ListBase *active_verts) add[0]= no[0]/ 32767.0f; add[1]= no[1]/ 32767.0f; add[2]= no[2]/ 32767.0f; - VecMulf(add, node->Fade); + VecMulf(add, node->Fade * ss->cache->radius); add[0]*= ss->cache->scale[0]; add[1]*= ss->cache->scale[1]; add[2]*= ss->cache->scale[2]; -- cgit v1.2.3 From aa0aac706e4381624482978110a54b5959414d14 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 19 Jun 2009 23:05:21 +0000 Subject: 2.5 * Optimized RNA property lookups and path resolving, still can be much better, but now the 1000 IPO example on bf-taskforce25 runs at reasonable speed. * Also an optimization in the depsgraph when dealing with many objects, this was actually also a bottleneck here. --- source/blender/blenkernel/BKE_depsgraph.h | 1 + source/blender/blenkernel/depsgraph_private.h | 2 + source/blender/blenkernel/intern/depsgraph.c | 41 ++++++----- source/blender/makesrna/RNA_define.h | 2 + source/blender/makesrna/intern/makesrna.c | 8 ++- source/blender/makesrna/intern/rna_access.c | 83 ++++++++++++---------- source/blender/makesrna/intern/rna_define.c | 12 +++- source/blender/makesrna/intern/rna_internal.h | 1 + .../blender/makesrna/intern/rna_internal_types.h | 2 + source/blender/makesrna/intern/rna_rna.c | 47 ++++++++++++ source/creator/creator.c | 6 +- source/gameengine/GamePlayer/ghost/CMakeLists.txt | 1 + source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 4 ++ source/gameengine/GamePlayer/ghost/Makefile | 1 + source/gameengine/GamePlayer/ghost/SConscript | 1 + 15 files changed, 154 insertions(+), 58 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_depsgraph.h b/source/blender/blenkernel/BKE_depsgraph.h index b86a58780dc..70b6c1d13f4 100644 --- a/source/blender/blenkernel/BKE_depsgraph.h +++ b/source/blender/blenkernel/BKE_depsgraph.h @@ -36,6 +36,7 @@ struct Scene; struct DagNodeQueue; struct DagForest; struct DagNode; +struct GHash; /* **** DAG relation types *** */ diff --git a/source/blender/blenkernel/depsgraph_private.h b/source/blender/blenkernel/depsgraph_private.h index 78717393baf..47e33c0e81e 100644 --- a/source/blender/blenkernel/depsgraph_private.h +++ b/source/blender/blenkernel/depsgraph_private.h @@ -65,6 +65,7 @@ typedef struct DagNode void * first_ancestor; int ancestor_count; int lay; // accumulated layers of its relations + itself + int scelay; // layers due to being in scene int lasttime; // if lasttime != DagForest->time, this node was not evaluated yet for flushing int BFS_dist; // BFS distance int DFS_dist; // DFS distance @@ -93,6 +94,7 @@ typedef struct DagNodeQueue typedef struct DagForest { ListBase DagNode; + struct GHash *nodeHash; int numNodes; int is_acyclic; int time; // for flushing/tagging, compare with node->lasttime diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index dfe3b7ea279..8bb34bde122 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -61,6 +61,8 @@ #include "DNA_view2d_types.h" #include "DNA_view3d_types.h" +#include "BLI_ghash.h" + #include "BKE_action.h" #include "BKE_effect.h" #include "BKE_global.h" @@ -754,6 +756,9 @@ void free_forest(DagForest *Dag) itN = itN->next; MEM_freeN(tempN); } + + BLI_ghash_free(Dag->nodeHash, NULL, NULL); + Dag->nodeHash= NULL; Dag->DagNode.first = NULL; Dag->DagNode.last = NULL; Dag->numNodes = 0; @@ -762,13 +767,9 @@ void free_forest(DagForest *Dag) DagNode * dag_find_node (DagForest *forest,void * fob) { - DagNode *node = forest->DagNode.first; - - while (node) { - if (node->ob == fob) - return node; - node = node->next; - } + if(forest->nodeHash) + return BLI_ghash_lookup(forest->nodeHash, fob); + return NULL; } @@ -794,7 +795,12 @@ DagNode * dag_add_node (DagForest *forest, void * fob) forest->DagNode.first = node; forest->numNodes = 1; } + + if(!forest->nodeHash) + forest->nodeHash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); + BLI_ghash_insert(forest->nodeHash, fob, node); } + return node; } @@ -1805,17 +1811,10 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime) /* node was checked to have lasttime != curtime , and is of type ID_OB */ static unsigned int flush_layer_node(Scene *sce, DagNode *node, int curtime) { - Base *base; DagAdjList *itA; node->lasttime= curtime; - node->lay= 0; - for(base= sce->base.first; base; base= base->next) { - if(node->ob == base->object) { - node->lay= ((Object *)node->ob)->lay; - break; - } - } + node->lay= node->scelay; for(itA = node->child; itA; itA= itA->next) { if(itA->node->type==ID_OB) { @@ -1860,9 +1859,10 @@ static void flush_pointcache_reset(DagNode *node, int curtime, int reset) /* flushes all recalc flags in objects down the dependency tree */ void DAG_scene_flush_update(Scene *sce, unsigned int lay, int time) { - DagNode *firstnode; + DagNode *firstnode, *node; DagAdjList *itA; Object *ob; + Base *base; int lasttime; if(sce->theDag==NULL) { @@ -1879,6 +1879,15 @@ void DAG_scene_flush_update(Scene *sce, unsigned int lay, int time) sce->theDag->time++; // so we know which nodes were accessed lasttime= sce->theDag->time; + + for(base= sce->base.first; base; base= base->next) { + node= dag_get_node(sce->theDag, base->object); + if(node) + node->scelay= base->object->lay; + else + node->scelay= 0; + } + for(itA = firstnode->child; itA; itA= itA->next) if(itA->node->lasttime!=lasttime && itA->node->type==ID_OB) flush_layer_node(sce, itA->node, lasttime); diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index dfe072c4b8e..b620a315085 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -42,6 +42,8 @@ extern "C" { BlenderRNA *RNA_create(void); void RNA_define_free(BlenderRNA *brna); void RNA_free(BlenderRNA *brna); + +void RNA_init(void); void RNA_exit(void); /* Struct */ diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index c8273513711..75293d83346 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1488,8 +1488,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr if(nest != NULL) { len= strlen(nest); - strnest= MEM_mallocN(sizeof(char)*(len+1), "rna_generate_property -> strnest"); - errnest= MEM_mallocN(sizeof(char)*(len+1), "rna_generate_property -> errnest"); + strnest= MEM_mallocN(sizeof(char)*(len+2), "rna_generate_property -> strnest"); + errnest= MEM_mallocN(sizeof(char)*(len+2), "rna_generate_property -> errnest"); strcpy(strnest, "_"); strcat(strnest, nest); strcpy(errnest, "."); strcat(errnest, nest); @@ -1713,6 +1713,8 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f) if(func->cont.prev) fprintf(f, "(FunctionRNA*)&rna_%s_%s_func,\n", srna->identifier, ((FunctionRNA*)func->cont.prev)->identifier); else fprintf(f, "NULL,\n"); + fprintf(f, "\tNULL,\n"); + parm= func->cont.properties.first; if(parm) fprintf(f, "\t{(PropertyRNA*)&rna_%s_%s_%s, ", srna->identifier, func->identifier, parm->identifier); else fprintf(f, "\t{NULL, "); @@ -1744,6 +1746,8 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f) if(srna->cont.prev) fprintf(f, "(ContainerRNA *)&RNA_%s,\n", ((StructRNA*)srna->cont.prev)->identifier); else fprintf(f, "NULL,\n"); + fprintf(f, "\tNULL,\n"); + prop= srna->cont.properties.first; if(prop) fprintf(f, "\t{(PropertyRNA*)&rna_%s_%s, ", srna->identifier, prop->identifier); else fprintf(f, "\t{NULL, "); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 8d0d87a72d3..ba893319ce9 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -32,6 +32,7 @@ #include "BLI_blenlib.h" #include "BLI_dynstr.h" +#include "BLI_ghash.h" #include "BKE_context.h" #include "BKE_idprop.h" @@ -46,10 +47,35 @@ #include "rna_internal.h" -/* Exit */ +/* Init/Exit */ + +void RNA_init() +{ + StructRNA *srna; + PropertyRNA *prop; + + for(srna=BLENDER_RNA.structs.first; srna; srna=srna->cont.next) { + if(!srna->cont.prophash) { + srna->cont.prophash= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp); + + for(prop=srna->cont.properties.first; prop; prop=prop->next) + if(!(prop->flag & PROP_BUILTIN)) + BLI_ghash_insert(srna->cont.prophash, (void*)prop->identifier, prop); + } + } +} void RNA_exit() { + StructRNA *srna; + + for(srna=BLENDER_RNA.structs.first; srna; srna=srna->cont.next) { + if(srna->cont.prophash) { + BLI_ghash_free(srna->cont.prophash, NULL, NULL); + srna->cont.prophash= NULL; + } + } + RNA_free(&BLENDER_RNA); } @@ -388,24 +414,13 @@ int RNA_struct_is_a(StructRNA *type, StructRNA *srna) PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier) { - CollectionPropertyIterator iter; - PropertyRNA *iterprop, *prop; - int i = 0; - - iterprop= RNA_struct_iterator_property(ptr->type); - RNA_property_collection_begin(ptr, iterprop, &iter); - prop= NULL; - - for(; iter.valid; RNA_property_collection_next(&iter), i++) { - if(strcmp(identifier, RNA_property_identifier(iter.ptr.data)) == 0) { - prop= iter.ptr.data; - break; - } - } - - RNA_property_collection_end(&iter); + PropertyRNA *iterprop= RNA_struct_iterator_property(ptr->type); + PointerRNA propptr; - return prop; + if(RNA_property_collection_lookup_string(ptr, iterprop, identifier, &propptr)) + return propptr.data; + + return NULL; } /* Find the property which uses the given nested struct */ @@ -1643,12 +1658,18 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int buf= MEM_callocN(sizeof(char)*(len+1), "rna_path_token"); /* copy string, taking into account escaped ] */ - for(p=*path, i=0, j=0; icont.prophash= NULL; srna->cont.properties.first= srna->cont.properties.last= NULL; srna->functions.first= srna->functions.last= NULL; srna->py_type= NULL; @@ -604,7 +607,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char * if(DefRNA.preprocess) { RNA_def_property_struct_type(prop, "Property"); - RNA_def_property_collection_funcs(prop, "rna_builtin_properties_begin", "rna_builtin_properties_next", "rna_iterator_listbase_end", "rna_builtin_properties_get", 0, 0, 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_builtin_properties_begin", "rna_builtin_properties_next", "rna_iterator_listbase_end", "rna_builtin_properties_get", 0, 0, "rna_builtin_properties_lookup_string", 0, 0); } else { #ifdef RNA_RUNTIME @@ -923,8 +926,13 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier break; } } - else + else { prop->flag |= PROP_IDPROPERTY|PROP_RUNTIME; +#ifdef RNA_RUNTIME + if(cont->prophash) + BLI_ghash_insert(cont->prophash, (void*)prop->identifier, prop); +#endif + } rna_addtail(&cont->properties, prop); diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 61cde5a01a3..362217e3123 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -217,6 +217,7 @@ void rna_builtin_properties_begin(struct CollectionPropertyIterator *iter, struc void rna_builtin_properties_next(struct CollectionPropertyIterator *iter); PointerRNA rna_builtin_properties_get(struct CollectionPropertyIterator *iter); PointerRNA rna_builtin_type_get(struct PointerRNA *ptr); +PointerRNA rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key); /* Iterators */ diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index d93e6f4d7cf..8bae21cca2b 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -37,6 +37,7 @@ struct ReportList; struct CollectionPropertyIterator; struct bContext; struct IDProperty; +struct GHash; #define RNA_MAX_ARRAY 32 @@ -83,6 +84,7 @@ typedef PointerRNA (*PropCollectionLookupStringFunc)(struct PointerRNA *ptr, con typedef struct ContainerRNA { void *next, *prev; + struct GHash *prophash; ListBase properties; } ContainerRNA; diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index bd3a8ae5580..6fa275cec91 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -34,6 +34,8 @@ #ifdef RNA_RUNTIME +#include "BLI_ghash.h" + /* Struct */ static void rna_Struct_identifier_get(PointerRNA *ptr, char *value) @@ -277,6 +279,51 @@ PointerRNA rna_builtin_properties_get(CollectionPropertyIterator *iter) return rna_Struct_properties_get(iter); } +PointerRNA rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key) +{ + StructRNA *srna; + PropertyRNA *prop; + IDProperty *group, *idp; + PointerRNA propptr; + + memset(&propptr, 0, sizeof(propptr)); + srna= ptr->type; + + do { + if(srna->cont.prophash) { + prop= BLI_ghash_lookup(srna->cont.prophash, (void*)key); + + if(prop) { + propptr.type= &RNA_Property; + propptr.data= prop; + return propptr; + } + } + + for(prop=srna->cont.properties.first; prop; prop=prop->next) { + if(!(prop->flag & PROP_BUILTIN) && strcmp(prop->identifier, key)==0) { + propptr.type= &RNA_Property; + propptr.data= prop; + return propptr; + } + } + } while((srna=srna->base)); + + group= RNA_struct_idproperties(ptr, 0); + + if(group) { + for(idp=group->data.group.first; idp; idp=idp->next) { + if(strcmp(idp->name, key) == 0) { + propptr.type= &RNA_Property; + propptr.data= idp; + return propptr; + } + } + } + + return propptr; +} + PointerRNA rna_builtin_type_get(PointerRNA *ptr) { return rna_pointer_inherit_refine(ptr, &RNA_Struct, ptr->type); diff --git a/source/creator/creator.c b/source/creator/creator.c index a19e5d0718c..9bf09a46461 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -77,6 +77,8 @@ #include "WM_api.h" +#include "RNA_define.h" + #include "GPU_draw.h" #include "GPU_extensions.h" @@ -310,11 +312,13 @@ int main(int argc, char **argv) BLI_where_am_i(bprogname, argv[0]); + RNA_init(); + /* Hack - force inclusion of the plugin api functions, * see blenpluginapi:pluginapi.c */ pluginapi_force_ref(); - + init_nodesystem(); initglobals(); /* blender.c */ diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt index 71961f27339..0d4abf1e1fe 100644 --- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt +++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt @@ -51,6 +51,7 @@ SET(INC ../../../../source/blender ../../../../source/blender/include ../../../../source/blender/makesdna + ../../../../source/blender/makesrna ../../../../source/gameengine/Rasterizer ../../../../source/gameengine/GameLogic ../../../../source/gameengine/Expressions diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index b69188e5476..2433c587179 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -86,6 +86,8 @@ extern "C" #include "BKE_main.h" #include "BKE_utildefines.h" +#include "RNA_define.h" + #ifdef WIN32 #include #ifdef NDEBUG @@ -344,6 +346,8 @@ int main(int argc, char** argv) */ #endif // __APPLE__ + RNA_init(); + init_nodesystem(); initglobals(); diff --git a/source/gameengine/GamePlayer/ghost/Makefile b/source/gameengine/GamePlayer/ghost/Makefile index c82edca0d45..49ad9457ee3 100644 --- a/source/gameengine/GamePlayer/ghost/Makefile +++ b/source/gameengine/GamePlayer/ghost/Makefile @@ -68,6 +68,7 @@ CPPFLAGS += -I../../../blender/blenlib CPPFLAGS += -I../../../blender/blenloader CPPFLAGS += -I../../../blender/imbuf CPPFLAGS += -I../../../blender/makesdna +CPPFLAGS += -I../../../blender/makesrna CPPFLAGS += -I../../../blender/readblenfile CPPFLAGS += -I../../../blender/gpu diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript index 1cb7c9f2457..390b6f5e089 100644 --- a/source/gameengine/GamePlayer/ghost/SConscript +++ b/source/gameengine/GamePlayer/ghost/SConscript @@ -26,6 +26,7 @@ incs = ['.', '#source/blender', '#source/blender/include', '#source/blender/makesdna', + '#source/blender/makesrna', '#source/gameengine/BlenderRoutines', '#source/gameengine/Rasterizer', '#source/gameengine/GameLogic', -- cgit v1.2.3 From d0e8acaf2902235afd0b3fbd2e408c1cf04689be Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 19 Jun 2009 23:11:41 +0000 Subject: UI * Fix issue with panel header line not always being hidden for the first panel. * Fix graying out of aligned buttons being off by one pixel, did not find a nice solution for it though, so just added -1/+1 in the code. --- source/blender/editors/interface/interface_panel.c | 24 +++++++++++++--------- .../blender/editors/interface/interface_widgets.c | 4 +++- 2 files changed, 17 insertions(+), 11 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 06582762fdb..72076175ad5 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -70,6 +70,7 @@ #define PNL_WAS_ACTIVE 4 #define PNL_ANIM_ALIGN 8 #define PNL_NEW_ADDED 16 +#define PNL_FIRST 32 typedef enum uiHandlePanelState { PANEL_STATE_DRAG, @@ -528,7 +529,7 @@ static void rectf_scale(rctf *rect, float scale) /* panel integrated in buttonswindow, tool/property lists etc */ void ui_draw_aligned_panel(ARegion *ar, uiStyle *style, uiBlock *block, rcti *rect) { - Panel *panel= block->panel, *prev; + Panel *panel= block->panel; rcti headrect; rctf itemrect; int ofsx; @@ -541,14 +542,7 @@ void ui_draw_aligned_panel(ARegion *ar, uiStyle *style, uiBlock *block, rcti *re headrect.ymin= headrect.ymax; headrect.ymax= headrect.ymin + floor(PNL_HEADER/block->aspect + 0.001f); - /* divider only when there's a previous panel */ - prev= panel->prev; - while(prev) { - if(prev->runtime_flag & PNL_ACTIVE) break; - prev= prev->prev; - } - - if(panel->sortorder != 0) { + if(!(panel->runtime_flag & PNL_FIRST)) { float minx= rect->xmin+5.0f/block->aspect; float maxx= rect->xmax-5.0f/block->aspect; float y= headrect.ymax; @@ -848,7 +842,7 @@ void uiEndPanels(const bContext *C, ARegion *ar) { ScrArea *sa= CTX_wm_area(C); uiBlock *block; - Panel *panot, *panew, *patest, *pa; + Panel *panot, *panew, *patest, *pa, *firstpa; /* offset contents */ for(block= ar->uiblocks.first; block; block= block->next) @@ -888,6 +882,16 @@ void uiEndPanels(const bContext *C, ARegion *ar) uiAlignPanelStep(sa, ar, 1.0, 0); } + /* tag first panel */ + firstpa= NULL; + for(block= ar->uiblocks.first; block; block=block->next) + if(block->active && block->panel) + if(!firstpa || block->panel->sortorder < firstpa->sortorder) + firstpa= block->panel; + + if(firstpa) + firstpa->runtime_flag |= PNL_FIRST; + /* draw panels, selected on top */ for(block= ar->uiblocks.first; block; block=block->next) { if(block->active && block->panel && !(block->panel->flag & PNL_SELECT)) { diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 119fd8a3fe5..14df9026078 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1876,7 +1876,9 @@ static void widget_disabled(rcti *rect) /* can't use theme TH_BACK or TH_PANEL... undefined */ glGetFloatv(GL_COLOR_CLEAR_VALUE, col); glColor4f(col[0], col[1], col[2], 0.5f); - glRectf(rect->xmin, rect->ymin, rect->xmax, rect->ymax); + /* need -1 and +1 to make it work right for aligned buttons, + * but problem may be somewhere else? */ + glRectf(rect->xmin-1, rect->ymin, rect->xmax, rect->ymax+1); glDisable(GL_BLEND); } -- cgit v1.2.3 From 7785ead4eb64f9702d7a59060e73b3e121e674a7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 Jun 2009 02:44:57 +0000 Subject: ObColor wasnt converted into an RNA string. Updated Mathutils.Vector/Euler/Quaternion/Matrix so these are types rather then module methods, each type now has a tp_new function, matching python builtins float/int/str. Also cleaned up float conversion and arg passing. Changed buttons_objects.py... if ob in groups.objects: # no longer works if ob.name in groups.objects: # is the new syntax ...its more dict like and a lot faster (avoids python iterating over each item and comparing each, use a single rna lookup instead). --- source/blender/blenkernel/intern/ipo.c | 14 +- source/blender/python/generic/Mathutils.c | 388 ++++-------------------------- source/blender/python/generic/Mathutils.h | 21 -- source/blender/python/generic/euler.c | 94 ++++++-- source/blender/python/generic/euler.h | 7 - source/blender/python/generic/matrix.c | 121 ++++++++-- source/blender/python/generic/matrix.h | 12 - source/blender/python/generic/quat.c | 163 +++++++++++-- source/blender/python/generic/quat.h | 10 - source/blender/python/generic/vector.c | 115 +++++++-- source/blender/python/generic/vector.h | 11 - source/blender/python/intern/bpy_rna.c | 4 +- 12 files changed, 463 insertions(+), 497 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index a6aac096814..54618813a0b 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -235,17 +235,15 @@ static char *ob_adrcodes_to_paths (int adrcode, int *array_index) *array_index= 1; return "delta_scale"; case OB_DSIZE_Z: *array_index= 2; return "delta_scale"; - -#if 0 - case OB_COL_R: - poin= &(ob->col[0]); break; + case OB_COL_R: + *array_index= 0; return "color"; case OB_COL_G: - poin= &(ob->col[1]); break; + *array_index= 1; return "color"; case OB_COL_B: - poin= &(ob->col[2]); break; + *array_index= 2; return "color"; case OB_COL_A: - poin= &(ob->col[3]); break; - + *array_index= 3; return "color"; +#if 0 case OB_PD_FSTR: if (ob->pd) poin= &(ob->pd->f_strength); break; diff --git a/source/blender/python/generic/Mathutils.c b/source/blender/python/generic/Mathutils.c index 637a42e2aa1..3c34a369baf 100644 --- a/source/blender/python/generic/Mathutils.c +++ b/source/blender/python/generic/Mathutils.c @@ -36,10 +36,6 @@ //-------------------------DOC STRINGS --------------------------- static char M_Mathutils_doc[] = "The Blender Mathutils module\n\n"; -static char M_Mathutils_Vector_doc[] = "() - create a new vector object from a list of floats"; -static char M_Mathutils_Matrix_doc[] = "() - create a new matrix object from a list of floats"; -static char M_Mathutils_Quaternion_doc[] = "() - create a quaternion from a list or an axis of rotation and an angle"; -static char M_Mathutils_Euler_doc[] = "() - create and return a new euler object"; static char M_Mathutils_Rand_doc[] = "() - return a random number"; static char M_Mathutils_AngleBetweenVecs_doc[] = "() - returns the angle between two vectors in degrees"; static char M_Mathutils_MidpointVecs_doc[] = "() - return the vector to the midpoint between two vectors"; @@ -57,22 +53,36 @@ static char M_Mathutils_TriangleNormal_doc[] = "(v1, v2, v3) - returns the norma static char M_Mathutils_QuadNormal_doc[] = "(v1, v2, v3, v4) - returns the normal of the 3D quad defined"; static char M_Mathutils_LineIntersect_doc[] = "(v1, v2, v3, v4) - returns a tuple with the points on each line respectively closest to the other"; //-----------------------METHOD DEFINITIONS ---------------------- + +static PyObject *M_Mathutils_Rand(PyObject * self, PyObject * args); +static PyObject *M_Mathutils_AngleBetweenVecs(PyObject * self, PyObject * args); +static PyObject *M_Mathutils_MidpointVecs(PyObject * self, PyObject * args); +static PyObject *M_Mathutils_ProjectVecs(PyObject * self, PyObject * args); +static PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args); +static PyObject *M_Mathutils_TranslationMatrix(PyObject * self, VectorObject * value); +static PyObject *M_Mathutils_ScaleMatrix(PyObject * self, PyObject * args); +static PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * args); +static PyObject *M_Mathutils_ShearMatrix(PyObject * self, PyObject * args); +static PyObject *M_Mathutils_DifferenceQuats(PyObject * self, PyObject * args); +static PyObject *M_Mathutils_Slerp(PyObject * self, PyObject * args); +static PyObject *M_Mathutils_Intersect( PyObject * self, PyObject * args ); +static PyObject *M_Mathutils_TriangleArea( PyObject * self, PyObject * args ); +static PyObject *M_Mathutils_TriangleNormal( PyObject * self, PyObject * args ); +static PyObject *M_Mathutils_QuadNormal( PyObject * self, PyObject * args ); +static PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args ); + struct PyMethodDef M_Mathutils_methods[] = { {"Rand", (PyCFunction) M_Mathutils_Rand, METH_VARARGS, M_Mathutils_Rand_doc}, - {"Vector", (PyCFunction) M_Mathutils_Vector, METH_VARARGS, M_Mathutils_Vector_doc}, {"AngleBetweenVecs", (PyCFunction) M_Mathutils_AngleBetweenVecs, METH_VARARGS, M_Mathutils_AngleBetweenVecs_doc}, {"MidpointVecs", (PyCFunction) M_Mathutils_MidpointVecs, METH_VARARGS, M_Mathutils_MidpointVecs_doc}, {"ProjectVecs", (PyCFunction) M_Mathutils_ProjectVecs, METH_VARARGS, M_Mathutils_ProjectVecs_doc}, - {"Matrix", (PyCFunction) M_Mathutils_Matrix, METH_VARARGS, M_Mathutils_Matrix_doc}, {"RotationMatrix", (PyCFunction) M_Mathutils_RotationMatrix, METH_VARARGS, M_Mathutils_RotationMatrix_doc}, {"ScaleMatrix", (PyCFunction) M_Mathutils_ScaleMatrix, METH_VARARGS, M_Mathutils_ScaleMatrix_doc}, {"ShearMatrix", (PyCFunction) M_Mathutils_ShearMatrix, METH_VARARGS, M_Mathutils_ShearMatrix_doc}, {"TranslationMatrix", (PyCFunction) M_Mathutils_TranslationMatrix, METH_O, M_Mathutils_TranslationMatrix_doc}, {"OrthoProjectionMatrix", (PyCFunction) M_Mathutils_OrthoProjectionMatrix, METH_VARARGS, M_Mathutils_OrthoProjectionMatrix_doc}, - {"Quaternion", (PyCFunction) M_Mathutils_Quaternion, METH_VARARGS, M_Mathutils_Quaternion_doc}, {"DifferenceQuats", (PyCFunction) M_Mathutils_DifferenceQuats, METH_VARARGS,M_Mathutils_DifferenceQuats_doc}, {"Slerp", (PyCFunction) M_Mathutils_Slerp, METH_VARARGS, M_Mathutils_Slerp_doc}, - {"Euler", (PyCFunction) M_Mathutils_Euler, METH_VARARGS, M_Mathutils_Euler_doc}, {"Intersect", ( PyCFunction ) M_Mathutils_Intersect, METH_VARARGS, M_Mathutils_Intersect_doc}, {"TriangleArea", ( PyCFunction ) M_Mathutils_TriangleArea, METH_VARARGS, M_Mathutils_TriangleArea_doc}, {"TriangleNormal", ( PyCFunction ) M_Mathutils_TriangleNormal, METH_VARARGS, M_Mathutils_TriangleNormal_doc}, @@ -80,6 +90,7 @@ struct PyMethodDef M_Mathutils_methods[] = { {"LineIntersect", ( PyCFunction ) M_Mathutils_LineIntersect, METH_VARARGS, M_Mathutils_LineIntersect_doc}, {NULL, NULL, 0, NULL} }; + /*----------------------------MODULE INIT-------------------------*/ /* from can be Blender.Mathutils or GameLogic.Mathutils for the BGE */ @@ -120,6 +131,12 @@ PyObject *Mathutils_Init(const char *from) submodule = Py_InitModule3(from, M_Mathutils_methods, M_Mathutils_doc); #endif + /* each type has its own new() function */ + PyModule_AddObject( submodule, "Vector", (PyObject *)&vector_Type ); + PyModule_AddObject( submodule, "Matrix", (PyObject *)&matrix_Type ); + PyModule_AddObject( submodule, "Euler", (PyObject *)&euler_Type ); + PyModule_AddObject( submodule, "Quaternion", (PyObject *)&quaternion_Type ); + return (submodule); } @@ -250,7 +267,7 @@ PyObject *quat_rotation(PyObject *arg1, PyObject *arg2) //----------------------------------Mathutils.Rand() -------------------- //returns a random number between a high and low value -PyObject *M_Mathutils_Rand(PyObject * self, PyObject * args) +static PyObject *M_Mathutils_Rand(PyObject * self, PyObject * args) { float high, low, range; double drand; @@ -278,65 +295,9 @@ PyObject *M_Mathutils_Rand(PyObject * self, PyObject * args) return PyFloat_FromDouble(drand); } //----------------------------------VECTOR FUNCTIONS--------------------- -//----------------------------------Mathutils.Vector() ------------------ -// Supports 2D, 3D, and 4D vector objects both int and float values -// accepted. Mixed float and int values accepted. Ints are parsed to float -PyObject *M_Mathutils_Vector(PyObject * self, PyObject * args) -{ - PyObject *listObject = NULL; - int size, i; - float vec[4], f; - PyObject *v; - - size = PySequence_Length(args); - if (size == 1) { - listObject = PySequence_GetItem(args, 0); - if (PySequence_Check(listObject)) { - size = PySequence_Length(listObject); - } else { // Single argument was not a sequence - Py_XDECREF(listObject); - PyErr_SetString(PyExc_TypeError, "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); - return NULL; - } - } else if (size == 0) { - //returns a new empty 3d vector - return newVectorObject(NULL, 3, Py_NEW); - } else { - Py_INCREF(args); - listObject = args; - } - - if (size<2 || size>4) { // Invalid vector size - Py_XDECREF(listObject); - PyErr_SetString(PyExc_AttributeError, "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); - return NULL; - } - - for (i=0; i 4){ //bad arg nums - PyErr_SetString(PyExc_AttributeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); - return NULL; - } else if (argSize == 0) { //return empty 4D matrix - return (PyObject *) newMatrixObject(NULL, 4, 4, Py_NEW); - }else if (argSize == 1){ - //copy constructor for matrix objects - argObject = PySequence_GetItem(args, 0); - if(MatrixObject_Check(argObject)){ - mat = (MatrixObject*)argObject; - - argSize = mat->rowSize; //rows - seqSize = mat->colSize; //col - for(i = 0; i < (seqSize * argSize); i++){ - matrix[i] = mat->contigPtr[i]; - } - } - Py_DECREF(argObject); - }else{ //2-4 arguments (all seqs? all same size?) - for(i =0; i < argSize; i++){ - argObject = PySequence_GetItem(args, i); - if (PySequence_Check(argObject)) { //seq? - if(seqSize){ //0 at first - if(PySequence_Length(argObject) != seqSize){ //seq size not same - Py_DECREF(argObject); - PyErr_SetString(PyExc_AttributeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); - return NULL; - } - } - seqSize = PySequence_Length(argObject); - }else{ //arg not a sequence - Py_XDECREF(argObject); - PyErr_SetString(PyExc_TypeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); - return NULL; - } - Py_DECREF(argObject); - } - //all is well... let's continue parsing - listObject = args; - for (i = 0; i < argSize; i++){ - m = PySequence_GetItem(listObject, i); - if (m == NULL) { // Failed to read sequence - PyErr_SetString(PyExc_RuntimeError, "Mathutils.Matrix(): failed to parse arguments...\n"); - return NULL; - } - - for (j = 0; j < seqSize; j++) { - s = PySequence_GetItem(m, j); - if (s == NULL) { // Failed to read sequence - Py_DECREF(m); - PyErr_SetString(PyExc_RuntimeError, "Mathutils.Matrix(): failed to parse arguments...\n"); - return NULL; - } - - f = PyNumber_Float(s); - if(f == NULL) { // parsed item is not a number - Py_DECREF(m); - Py_DECREF(s); - PyErr_SetString(PyExc_AttributeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); - return NULL; - } - - matrix[(seqSize*i)+j]=(float)PyFloat_AS_DOUBLE(f); - Py_DECREF(f); - Py_DECREF(s); - } - Py_DECREF(m); - } - } - return newMatrixObject(matrix, argSize, seqSize, Py_NEW); -} //----------------------------------Mathutils.RotationMatrix() ---------- //mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. //creates a rotation matrix -PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args) +static PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args) { VectorObject *vec = NULL; char *axis = NULL; @@ -648,7 +525,7 @@ PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args) } //----------------------------------Mathutils.TranslationMatrix() ------- //creates a translation matrix -PyObject *M_Mathutils_TranslationMatrix(PyObject * self, VectorObject * vec) +static PyObject *M_Mathutils_TranslationMatrix(PyObject * self, VectorObject * vec) { float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; @@ -672,7 +549,7 @@ PyObject *M_Mathutils_TranslationMatrix(PyObject * self, VectorObject * vec) //----------------------------------Mathutils.ScaleMatrix() ------------- //mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. //creates a scaling matrix -PyObject *M_Mathutils_ScaleMatrix(PyObject * self, PyObject * args) +static PyObject *M_Mathutils_ScaleMatrix(PyObject * self, PyObject * args) { VectorObject *vec = NULL; float norm = 0.0f, factor; @@ -746,7 +623,7 @@ PyObject *M_Mathutils_ScaleMatrix(PyObject * self, PyObject * args) //----------------------------------Mathutils.OrthoProjectionMatrix() --- //mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. //creates an ortho projection matrix -PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * args) +static PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * args) { VectorObject *vec = NULL; char *plane; @@ -844,7 +721,7 @@ PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * args) } //----------------------------------Mathutils.ShearMatrix() ------------- //creates a shear matrix -PyObject *M_Mathutils_ShearMatrix(PyObject * self, PyObject * args) +static PyObject *M_Mathutils_ShearMatrix(PyObject * self, PyObject * args) { int matSize; char *plane; @@ -910,135 +787,10 @@ PyObject *M_Mathutils_ShearMatrix(PyObject * self, PyObject * args) return newMatrixObject(mat, matSize, matSize, Py_NEW); } //----------------------------------QUATERNION FUNCTIONS----------------- -//----------------------------------Mathutils.Quaternion() -------------- -PyObject *M_Mathutils_Quaternion(PyObject * self, PyObject * args) -{ - PyObject *listObject = NULL, *n, *q, *f; - int size, i; - float quat[4]; - double norm = 0.0f, angle = 0.0f; - - size = PySequence_Length(args); - if (size == 1 || size == 2) { //seq? - listObject = PySequence_GetItem(args, 0); - if (PySequence_Check(listObject)) { - size = PySequence_Length(listObject); - if ((size == 4 && PySequence_Length(args) !=1) || - (size == 3 && PySequence_Length(args) !=2) || (size >4 || size < 3)) { - // invalid args/size - Py_DECREF(listObject); - PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); - return NULL; - } - if(size == 3){ //get angle in axis/angle - n = PySequence_GetItem(args, 1); - if(n == NULL) { // parsed item not a number or getItem fail - Py_DECREF(listObject); - PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); - return NULL; - } - - angle = PyFloat_AsDouble(n); - Py_DECREF(n); - - if (angle==-1 && PyErr_Occurred()) { - Py_DECREF(listObject); - PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); - return NULL; - } - } - }else{ - Py_DECREF(listObject); /* assume the list is teh second arg */ - listObject = PySequence_GetItem(args, 1); - if (size>1 && PySequence_Check(listObject)) { - size = PySequence_Length(listObject); - if (size != 3) { - // invalid args/size - Py_DECREF(listObject); - PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); - return NULL; - } - n = PySequence_GetItem(args, 0); - if(n == NULL) { // parsed item not a number or getItem fail - Py_DECREF(listObject); - PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); - return NULL; - } - angle = PyFloat_AsDouble(n); - Py_DECREF(n); - - if (angle==-1 && PyErr_Occurred()) { - Py_DECREF(listObject); - PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); - return NULL; - } - } else { // argument was not a sequence - Py_XDECREF(listObject); - PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); - return NULL; - } - } - } else if (size == 0) { //returns a new empty quat - return newQuaternionObject(NULL, Py_NEW); - } else { - Py_INCREF(args); - listObject = args; - } - - if (size == 3) { // invalid quat size - if(PySequence_Length(args) != 2){ - Py_DECREF(listObject); - PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); - return NULL; - } - }else{ - if(size != 4){ - Py_DECREF(listObject); - PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); - return NULL; - } - } - - for (i=0; ieul[0] = 0.0; self->eul[1] = 0.0; @@ -146,7 +208,7 @@ PyObject *Euler_Zero(EulerObject * self) //----------------------------Euler.rotate()----------------------- //rotates a euler a certain amount and returns the result //should return a unique euler rotation (i.e. no 720 degree pitches :) -PyObject *Euler_Rotate(EulerObject * self, PyObject *args) +static PyObject *Euler_Rotate(EulerObject * self, PyObject *args) { float angle = 0.0f; char *axis; @@ -176,7 +238,7 @@ PyObject *Euler_Rotate(EulerObject * self, PyObject *args) return (PyObject *)self; } -PyObject *Euler_MakeCompatible(EulerObject * self, EulerObject *value) +static PyObject *Euler_MakeCompatible(EulerObject * self, EulerObject *value) { float eul_from_rad[3]; int x; @@ -203,7 +265,7 @@ PyObject *Euler_MakeCompatible(EulerObject * self, EulerObject *value) //----------------------------Euler.rotate()----------------------- // return a copy of the euler -PyObject *Euler_copy(EulerObject * self, PyObject *args) +static PyObject *Euler_copy(EulerObject * self, PyObject *args) { return newEulerObject(self->eul, Py_NEW); } @@ -509,7 +571,7 @@ PyTypeObject euler_Type = { 0, //tp_dictoffset 0, //tp_init 0, //tp_alloc - 0, //tp_new + Euler_new, //tp_new 0, //tp_free 0, //tp_is_gc 0, //tp_bases diff --git a/source/blender/python/generic/euler.h b/source/blender/python/generic/euler.h index 773b024f174..3206668ffa0 100644 --- a/source/blender/python/generic/euler.h +++ b/source/blender/python/generic/euler.h @@ -54,13 +54,6 @@ be stored in py_data) or be a wrapper for data allocated through blender (stored in blend_data). This is an either/or struct not both*/ //prototypes -PyObject *Euler_Zero( EulerObject * self ); -PyObject *Euler_Unique( EulerObject * self ); -PyObject *Euler_ToMatrix( EulerObject * self ); -PyObject *Euler_ToQuat( EulerObject * self ); -PyObject *Euler_Rotate( EulerObject * self, PyObject *args ); -PyObject *Euler_MakeCompatible( EulerObject * self, EulerObject *value ); -PyObject *Euler_copy( EulerObject * self, PyObject *args ); PyObject *newEulerObject( float *eul, int type ); #endif /* EXPP_euler_h */ diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c index 4b2c9d4a8a7..e2ab1c3c653 100644 --- a/source/blender/python/generic/matrix.c +++ b/source/blender/python/generic/matrix.c @@ -32,20 +32,34 @@ #include "BLI_blenlib.h" /*-------------------------DOC STRINGS ---------------------------*/ -char Matrix_Zero_doc[] = "() - set all values in the matrix to 0"; -char Matrix_Identity_doc[] = "() - set the square matrix to it's identity matrix"; -char Matrix_Transpose_doc[] = "() - set the matrix to it's transpose"; -char Matrix_Determinant_doc[] = "() - return the determinant of the matrix"; -char Matrix_Invert_doc[] = "() - set the matrix to it's inverse if an inverse is possible"; -char Matrix_TranslationPart_doc[] = "() - return a vector encompassing the translation of the matrix"; -char Matrix_RotationPart_doc[] = "() - return a vector encompassing the rotation of the matrix"; -char Matrix_scalePart_doc[] = "() - convert matrix to a 3D vector"; -char Matrix_Resize4x4_doc[] = "() - resize the matrix to a 4x4 square matrix"; -char Matrix_toEuler_doc[] = "(eul_compat) - convert matrix to a euler angle rotation, optional euler argument that the new euler will be made compatible with."; -char Matrix_toQuat_doc[] = "() - convert matrix to a quaternion rotation"; -char Matrix_copy_doc[] = "() - return a copy of the matrix"; +static char Matrix_Zero_doc[] = "() - set all values in the matrix to 0"; +static char Matrix_Identity_doc[] = "() - set the square matrix to it's identity matrix"; +static char Matrix_Transpose_doc[] = "() - set the matrix to it's transpose"; +static char Matrix_Determinant_doc[] = "() - return the determinant of the matrix"; +static char Matrix_Invert_doc[] = "() - set the matrix to it's inverse if an inverse is possible"; +static char Matrix_TranslationPart_doc[] = "() - return a vector encompassing the translation of the matrix"; +static char Matrix_RotationPart_doc[] = "() - return a vector encompassing the rotation of the matrix"; +static char Matrix_scalePart_doc[] = "() - convert matrix to a 3D vector"; +static char Matrix_Resize4x4_doc[] = "() - resize the matrix to a 4x4 square matrix"; +static char Matrix_toEuler_doc[] = "(eul_compat) - convert matrix to a euler angle rotation, optional euler argument that the new euler will be made compatible with."; +static char Matrix_toQuat_doc[] = "() - convert matrix to a quaternion rotation"; +static char Matrix_copy_doc[] = "() - return a copy of the matrix"; + +static PyObject *Matrix_Zero( MatrixObject * self ); +static PyObject *Matrix_Identity( MatrixObject * self ); +static PyObject *Matrix_Transpose( MatrixObject * self ); +static PyObject *Matrix_Determinant( MatrixObject * self ); +static PyObject *Matrix_Invert( MatrixObject * self ); +static PyObject *Matrix_TranslationPart( MatrixObject * self ); +static PyObject *Matrix_RotationPart( MatrixObject * self ); +static PyObject *Matrix_scalePart( MatrixObject * self ); +static PyObject *Matrix_Resize4x4( MatrixObject * self ); +static PyObject *Matrix_toEuler( MatrixObject * self, PyObject *args ); +static PyObject *Matrix_toQuat( MatrixObject * self ); +static PyObject *Matrix_copy( MatrixObject * self ); + /*-----------------------METHOD DEFINITIONS ----------------------*/ -struct PyMethodDef Matrix_methods[] = { +static struct PyMethodDef Matrix_methods[] = { {"zero", (PyCFunction) Matrix_Zero, METH_NOARGS, Matrix_Zero_doc}, {"identity", (PyCFunction) Matrix_Identity, METH_NOARGS, Matrix_Identity_doc}, {"transpose", (PyCFunction) Matrix_Transpose, METH_NOARGS, Matrix_Transpose_doc}, @@ -61,9 +75,86 @@ struct PyMethodDef Matrix_methods[] = { {"__copy__", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc}, {NULL, NULL, 0, NULL} }; + +//----------------------------------Mathutils.Matrix() ----------------- +//mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. +//create a new matrix type +static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + PyObject *argObject, *m, *s; + MatrixObject *mat; + int argSize, seqSize = 0, i, j; + float matrix[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + float scalar; + + argSize = PyTuple_GET_SIZE(args); + if(argSize > 4){ //bad arg nums + PyErr_SetString(PyExc_AttributeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + return NULL; + } else if (argSize == 0) { //return empty 4D matrix + return (PyObject *) newMatrixObject(NULL, 4, 4, Py_NEW); + }else if (argSize == 1){ + //copy constructor for matrix objects + argObject = PyTuple_GET_ITEM(args, 0); + if(MatrixObject_Check(argObject)){ + mat = (MatrixObject*)argObject; + + argSize = mat->rowSize; //rows + seqSize = mat->colSize; //col + for(i = 0; i < (seqSize * argSize); i++){ + matrix[i] = mat->contigPtr[i]; + } + } + }else{ //2-4 arguments (all seqs? all same size?) + for(i =0; i < argSize; i++){ + argObject = PyTuple_GET_ITEM(args, i); + if (PySequence_Check(argObject)) { //seq? + if(seqSize){ //0 at first + if(PySequence_Length(argObject) != seqSize){ //seq size not same + PyErr_SetString(PyExc_AttributeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + return NULL; + } + } + seqSize = PySequence_Length(argObject); + }else{ //arg not a sequence + PyErr_SetString(PyExc_TypeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + return NULL; + } + } + //all is well... let's continue parsing + for (i = 0; i < argSize; i++){ + m = PyTuple_GET_ITEM(args, i); + if (m == NULL) { // Failed to read sequence + PyErr_SetString(PyExc_RuntimeError, "Mathutils.Matrix(): failed to parse arguments...\n"); + return NULL; + } + + for (j = 0; j < seqSize; j++) { + s = PySequence_GetItem(m, j); + if (s == NULL) { // Failed to read sequence + PyErr_SetString(PyExc_RuntimeError, "Mathutils.Matrix(): failed to parse arguments...\n"); + return NULL; + } + + scalar= (float)PyFloat_AsDouble(s); + Py_DECREF(s); + + if(scalar==-1 && PyErr_Occurred()) { // parsed item is not a number + PyErr_SetString(PyExc_AttributeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); + return NULL; + } + + matrix[(seqSize*i)+j]= scalar; + } + } + } + return newMatrixObject(matrix, argSize, seqSize, Py_NEW); +} + /*-----------------------------METHODS----------------------------*/ /*---------------------------Matrix.toQuat() ---------------------*/ -PyObject *Matrix_toQuat(MatrixObject * self) +static PyObject *Matrix_toQuat(MatrixObject * self) { float quat[4]; @@ -872,7 +963,7 @@ PyTypeObject matrix_Type = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - 0, /*tp_new*/ + Matrix_new, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ diff --git a/source/blender/python/generic/matrix.h b/source/blender/python/generic/matrix.h index 4658f4b5f6c..ef82263fe00 100644 --- a/source/blender/python/generic/matrix.h +++ b/source/blender/python/generic/matrix.h @@ -56,18 +56,6 @@ be stored in py_data) or be a wrapper for data allocated through blender (stored in blend_data). This is an either/or struct not both*/ /*prototypes*/ -PyObject *Matrix_Zero( MatrixObject * self ); -PyObject *Matrix_Identity( MatrixObject * self ); -PyObject *Matrix_Transpose( MatrixObject * self ); -PyObject *Matrix_Determinant( MatrixObject * self ); -PyObject *Matrix_Invert( MatrixObject * self ); -PyObject *Matrix_TranslationPart( MatrixObject * self ); -PyObject *Matrix_RotationPart( MatrixObject * self ); -PyObject *Matrix_scalePart( MatrixObject * self ); -PyObject *Matrix_Resize4x4( MatrixObject * self ); -PyObject *Matrix_toEuler( MatrixObject * self, PyObject *args ); -PyObject *Matrix_toQuat( MatrixObject * self ); -PyObject *Matrix_copy( MatrixObject * self ); PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type); #endif /* EXPP_matrix_H */ diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c index c3c9e28c520..4ad5d07b3b8 100644 --- a/source/blender/python/generic/quat.c +++ b/source/blender/python/generic/quat.c @@ -34,18 +34,30 @@ //-------------------------DOC STRINGS --------------------------- -char Quaternion_Identity_doc[] = "() - set the quaternion to it's identity (1, vector)"; -char Quaternion_Negate_doc[] = "() - set all values in the quaternion to their negative"; -char Quaternion_Conjugate_doc[] = "() - set the quaternion to it's conjugate"; -char Quaternion_Inverse_doc[] = "() - set the quaternion to it's inverse"; -char Quaternion_Normalize_doc[] = "() - normalize the vector portion of the quaternion"; -char Quaternion_ToEuler_doc[] = "(eul_compat) - return a euler rotation representing the quaternion, optional euler argument that the new euler will be made compatible with."; -char Quaternion_ToMatrix_doc[] = "() - return a rotation matrix representing the quaternion"; -char Quaternion_Cross_doc[] = "(other) - return the cross product between this quaternion and another"; -char Quaternion_Dot_doc[] = "(other) - return the dot product between this quaternion and another"; -char Quaternion_copy_doc[] = "() - return a copy of the quat"; +static char Quaternion_Identity_doc[] = "() - set the quaternion to it's identity (1, vector)"; +static char Quaternion_Negate_doc[] = "() - set all values in the quaternion to their negative"; +static char Quaternion_Conjugate_doc[] = "() - set the quaternion to it's conjugate"; +static char Quaternion_Inverse_doc[] = "() - set the quaternion to it's inverse"; +static char Quaternion_Normalize_doc[] = "() - normalize the vector portion of the quaternion"; +static char Quaternion_ToEuler_doc[] = "(eul_compat) - return a euler rotation representing the quaternion, optional euler argument that the new euler will be made compatible with."; +static char Quaternion_ToMatrix_doc[] = "() - return a rotation matrix representing the quaternion"; +static char Quaternion_Cross_doc[] = "(other) - return the cross product between this quaternion and another"; +static char Quaternion_Dot_doc[] = "(other) - return the dot product between this quaternion and another"; +static char Quaternion_copy_doc[] = "() - return a copy of the quat"; + +static PyObject *Quaternion_Identity( QuaternionObject * self ); +static PyObject *Quaternion_Negate( QuaternionObject * self ); +static PyObject *Quaternion_Conjugate( QuaternionObject * self ); +static PyObject *Quaternion_Inverse( QuaternionObject * self ); +static PyObject *Quaternion_Normalize( QuaternionObject * self ); +static PyObject *Quaternion_ToEuler( QuaternionObject * self, PyObject *args ); +static PyObject *Quaternion_ToMatrix( QuaternionObject * self ); +static PyObject *Quaternion_Cross( QuaternionObject * self, QuaternionObject * value ); +static PyObject *Quaternion_Dot( QuaternionObject * self, QuaternionObject * value ); +static PyObject *Quaternion_copy( QuaternionObject * self ); + //-----------------------METHOD DEFINITIONS ---------------------- -struct PyMethodDef Quaternion_methods[] = { +static struct PyMethodDef Quaternion_methods[] = { {"identity", (PyCFunction) Quaternion_Identity, METH_NOARGS, Quaternion_Identity_doc}, {"negate", (PyCFunction) Quaternion_Negate, METH_NOARGS, Quaternion_Negate_doc}, {"conjugate", (PyCFunction) Quaternion_Conjugate, METH_NOARGS, Quaternion_Conjugate_doc}, @@ -59,10 +71,117 @@ struct PyMethodDef Quaternion_methods[] = { {"copy", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc}, {NULL, NULL, 0, NULL} }; + +//----------------------------------Mathutils.Quaternion() -------------- +static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + PyObject *listObject = NULL, *n, *q, *f; + int size, i; + float quat[4], scalar; + double norm = 0.0f, angle = 0.0f; + + size = PyTuple_GET_SIZE(args); + if (size == 1 || size == 2) { //seq? + listObject = PyTuple_GET_ITEM(args, 0); + if (PySequence_Check(listObject)) { + size = PySequence_Length(listObject); + if ((size == 4 && PySequence_Length(args) !=1) || + (size == 3 && PySequence_Length(args) !=2) || (size >4 || size < 3)) { + // invalid args/size + PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + if(size == 3){ //get angle in axis/angle + n = PySequence_GetItem(args, 1); + if(n == NULL) { // parsed item not a number or getItem fail + PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + + angle = PyFloat_AsDouble(n); + Py_DECREF(n); + + if (angle==-1 && PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + } + }else{ + listObject = PyTuple_GET_ITEM(args, 1); + if (size>1 && PySequence_Check(listObject)) { + size = PySequence_Length(listObject); + if (size != 3) { + // invalid args/size + PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + angle = PyFloat_AsDouble(PyTuple_GET_ITEM(args, 0)); + + if (angle==-1 && PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + } else { // argument was not a sequence + PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + } + } else if (size == 0) { //returns a new empty quat + return newQuaternionObject(NULL, Py_NEW); + } else { + listObject = args; + } + + if (size == 3) { // invalid quat size + if(PySequence_Length(args) != 2){ + PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + }else{ + if(size != 4){ + PyErr_SetString(PyExc_AttributeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); + return NULL; + } + } + + for (i=0; iquat, (float (*)[3]) mat); @@ -103,7 +222,7 @@ PyObject *Quaternion_ToMatrix(QuaternionObject * self) //----------------------------Quaternion.cross(other)------------------ //return the cross quat -PyObject *Quaternion_Cross(QuaternionObject * self, QuaternionObject * value) +static PyObject *Quaternion_Cross(QuaternionObject * self, QuaternionObject * value) { float quat[4]; @@ -118,7 +237,7 @@ PyObject *Quaternion_Cross(QuaternionObject * self, QuaternionObject * value) //----------------------------Quaternion.dot(other)------------------ //return the dot quat -PyObject *Quaternion_Dot(QuaternionObject * self, QuaternionObject * value) +static PyObject *Quaternion_Dot(QuaternionObject * self, QuaternionObject * value) { int x; double dot = 0.0; @@ -136,7 +255,7 @@ PyObject *Quaternion_Dot(QuaternionObject * self, QuaternionObject * value) //----------------------------Quaternion.normalize()---------------- //normalize the axis of rotation of [theta,vector] -PyObject *Quaternion_Normalize(QuaternionObject * self) +static PyObject *Quaternion_Normalize(QuaternionObject * self) { NormalQuat(self->quat); Py_INCREF(self); @@ -144,7 +263,7 @@ PyObject *Quaternion_Normalize(QuaternionObject * self) } //----------------------------Quaternion.inverse()------------------ //invert the quat -PyObject *Quaternion_Inverse(QuaternionObject * self) +static PyObject *Quaternion_Inverse(QuaternionObject * self) { double mag = 0.0f; int x; @@ -165,7 +284,7 @@ PyObject *Quaternion_Inverse(QuaternionObject * self) } //----------------------------Quaternion.identity()----------------- //generate the identity quaternion -PyObject *Quaternion_Identity(QuaternionObject * self) +static PyObject *Quaternion_Identity(QuaternionObject * self) { self->quat[0] = 1.0; self->quat[1] = 0.0; @@ -177,7 +296,7 @@ PyObject *Quaternion_Identity(QuaternionObject * self) } //----------------------------Quaternion.negate()------------------- //negate the quat -PyObject *Quaternion_Negate(QuaternionObject * self) +static PyObject *Quaternion_Negate(QuaternionObject * self) { int x; for(x = 0; x < 4; x++) { @@ -188,7 +307,7 @@ PyObject *Quaternion_Negate(QuaternionObject * self) } //----------------------------Quaternion.conjugate()---------------- //negate the vector part -PyObject *Quaternion_Conjugate(QuaternionObject * self) +static PyObject *Quaternion_Conjugate(QuaternionObject * self) { int x; for(x = 1; x < 4; x++) { @@ -199,7 +318,7 @@ PyObject *Quaternion_Conjugate(QuaternionObject * self) } //----------------------------Quaternion.copy()---------------- //return a copy of the quat -PyObject *Quaternion_copy(QuaternionObject * self) +static PyObject *Quaternion_copy(QuaternionObject * self) { return newQuaternionObject(self->quat, Py_NEW); } @@ -680,7 +799,7 @@ PyTypeObject quaternion_Type = { 0, //tp_dictoffset 0, //tp_init 0, //tp_alloc - 0, //tp_new + Quaternion_new, //tp_new 0, //tp_free 0, //tp_is_gc 0, //tp_bases diff --git a/source/blender/python/generic/quat.h b/source/blender/python/generic/quat.h index 8887b147705..cfb50e4dbe1 100644 --- a/source/blender/python/generic/quat.h +++ b/source/blender/python/generic/quat.h @@ -54,16 +54,6 @@ be stored in py_data) or be a wrapper for data allocated through blender (stored in blend_data). This is an either/or struct not both*/ //prototypes -PyObject *Quaternion_Identity( QuaternionObject * self ); -PyObject *Quaternion_Negate( QuaternionObject * self ); -PyObject *Quaternion_Conjugate( QuaternionObject * self ); -PyObject *Quaternion_Inverse( QuaternionObject * self ); -PyObject *Quaternion_Normalize( QuaternionObject * self ); -PyObject *Quaternion_ToEuler( QuaternionObject * self, PyObject *args ); -PyObject *Quaternion_ToMatrix( QuaternionObject * self ); -PyObject *Quaternion_Cross( QuaternionObject * self, QuaternionObject * value ); -PyObject *Quaternion_Dot( QuaternionObject * self, QuaternionObject * value ); -PyObject *Quaternion_copy( QuaternionObject * self ); PyObject *newQuaternionObject( float *quat, int type ); #endif /* EXPP_quat_h */ diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index e2009d9974e..562413c6967 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -40,20 +40,32 @@ #define SWIZZLE_AXIS 0x3 /*-------------------------DOC STRINGS ---------------------------*/ -char Vector_Zero_doc[] = "() - set all values in the vector to 0"; -char Vector_Normalize_doc[] = "() - normalize the vector"; -char Vector_Negate_doc[] = "() - changes vector to it's additive inverse"; -char Vector_Resize2D_doc[] = "() - resize a vector to [x,y]"; -char Vector_Resize3D_doc[] = "() - resize a vector to [x,y,z]"; -char Vector_Resize4D_doc[] = "() - resize a vector to [x,y,z,w]"; -char Vector_ToTrackQuat_doc[] = "(track, up) - extract a quaternion from the vector and the track and up axis"; -char Vector_Reflect_doc[] = "(mirror) - return a vector reflected on the mirror normal"; -char Vector_Cross_doc[] = "(other) - return the cross product between this vector and another"; -char Vector_Dot_doc[] = "(other) - return the dot product between this vector and another"; -char Vector_copy_doc[] = "() - return a copy of the vector"; -char Vector_swizzle_doc[] = "Swizzle: Get or set axes in specified order"; +static char Vector_Zero_doc[] = "() - set all values in the vector to 0"; +static char Vector_Normalize_doc[] = "() - normalize the vector"; +static char Vector_Negate_doc[] = "() - changes vector to it's additive inverse"; +static char Vector_Resize2D_doc[] = "() - resize a vector to [x,y]"; +static char Vector_Resize3D_doc[] = "() - resize a vector to [x,y,z]"; +static char Vector_Resize4D_doc[] = "() - resize a vector to [x,y,z,w]"; +static char Vector_ToTrackQuat_doc[] = "(track, up) - extract a quaternion from the vector and the track and up axis"; +static char Vector_Reflect_doc[] = "(mirror) - return a vector reflected on the mirror normal"; +static char Vector_Cross_doc[] = "(other) - return the cross product between this vector and another"; +static char Vector_Dot_doc[] = "(other) - return the dot product between this vector and another"; +static char Vector_copy_doc[] = "() - return a copy of the vector"; +static char Vector_swizzle_doc[] = "Swizzle: Get or set axes in specified order"; /*-----------------------METHOD DEFINITIONS ----------------------*/ -struct PyMethodDef Vector_methods[] = { +static PyObject *Vector_Zero( VectorObject * self ); +static PyObject *Vector_Normalize( VectorObject * self ); +static PyObject *Vector_Negate( VectorObject * self ); +static PyObject *Vector_Resize2D( VectorObject * self ); +static PyObject *Vector_Resize3D( VectorObject * self ); +static PyObject *Vector_Resize4D( VectorObject * self ); +static PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ); +static PyObject *Vector_Reflect( VectorObject * self, PyObject * value ); +static PyObject *Vector_Cross( VectorObject * self, VectorObject * value ); +static PyObject *Vector_Dot( VectorObject * self, VectorObject * value ); +static PyObject *Vector_copy( VectorObject * self ); + +static struct PyMethodDef Vector_methods[] = { {"zero", (PyCFunction) Vector_Zero, METH_NOARGS, Vector_Zero_doc}, {"normalize", (PyCFunction) Vector_Normalize, METH_NOARGS, Vector_Normalize_doc}, {"negate", (PyCFunction) Vector_Negate, METH_NOARGS, Vector_Negate_doc}, @@ -69,10 +81,61 @@ struct PyMethodDef Vector_methods[] = { {NULL, NULL, 0, NULL} }; +//----------------------------------Mathutils.Vector() ------------------ +// Supports 2D, 3D, and 4D vector objects both int and float values +// accepted. Mixed float and int values accepted. Ints are parsed to float +static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + PyObject *listObject = NULL; + int size, i; + float vec[4], f; + PyObject *v; + + size = PyTuple_GET_SIZE(args); /* we know its a tuple because its an arg */ + if (size == 1) { + listObject = PyTuple_GET_ITEM(args, 0); + if (PySequence_Check(listObject)) { + size = PySequence_Length(listObject); + } else { // Single argument was not a sequence + PyErr_SetString(PyExc_TypeError, "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); + return NULL; + } + } else if (size == 0) { + //returns a new empty 3d vector + return newVectorObject(NULL, 3, Py_NEW); + } else { + listObject = args; + } + + if (size<2 || size>4) { // Invalid vector size + PyErr_SetString(PyExc_AttributeError, "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); + return NULL; + } + + for (i=0; isize; i++) { @@ -83,7 +146,7 @@ PyObject *Vector_Zero(VectorObject * self) } /*----------------------------Vector.normalize() ----------------- normalize the vector data to a unit vector */ -PyObject *Vector_Normalize(VectorObject * self) +static PyObject *Vector_Normalize(VectorObject * self) { int i; float norm = 0.0f; @@ -102,7 +165,7 @@ PyObject *Vector_Normalize(VectorObject * self) /*----------------------------Vector.resize2D() ------------------ resize the vector to x,y */ -PyObject *Vector_Resize2D(VectorObject * self) +static PyObject *Vector_Resize2D(VectorObject * self) { if(self->wrapped==Py_WRAP) { PyErr_SetString(PyExc_TypeError, "vector.resize2d(): cannot resize wrapped data - only python vectors\n"); @@ -120,7 +183,7 @@ PyObject *Vector_Resize2D(VectorObject * self) } /*----------------------------Vector.resize3D() ------------------ resize the vector to x,y,z */ -PyObject *Vector_Resize3D(VectorObject * self) +static PyObject *Vector_Resize3D(VectorObject * self) { if (self->wrapped==Py_WRAP) { PyErr_SetString(PyExc_TypeError, "vector.resize3d(): cannot resize wrapped data - only python vectors\n"); @@ -141,7 +204,7 @@ PyObject *Vector_Resize3D(VectorObject * self) } /*----------------------------Vector.resize4D() ------------------ resize the vector to x,y,z,w */ -PyObject *Vector_Resize4D(VectorObject * self) +static PyObject *Vector_Resize4D(VectorObject * self) { if(self->wrapped==Py_WRAP) { PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize wrapped data - only python vectors"); @@ -164,7 +227,7 @@ PyObject *Vector_Resize4D(VectorObject * self) } /*----------------------------Vector.toTrackQuat(track, up) ---------------------- extract a quaternion from the vector and the track and up axis */ -PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) +static PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) { float vec[3], quat[4]; char *strack, *sup; @@ -279,7 +342,7 @@ PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) return a reflected vector on the mirror normal ((2 * DotVecs(vec, mirror)) * mirror) - vec using arithb.c would be nice here */ -PyObject *Vector_Reflect( VectorObject * self, PyObject * value ) +static PyObject *Vector_Reflect( VectorObject * self, PyObject * value ) { VectorObject *mirrvec; float mirror[3]; @@ -326,7 +389,7 @@ PyObject *Vector_Reflect( VectorObject * self, PyObject * value ) return newVectorObject(reflect, self->size, Py_NEW); } -PyObject *Vector_Cross( VectorObject * self, VectorObject * value ) +static PyObject *Vector_Cross( VectorObject * self, VectorObject * value ) { VectorObject *vecCross = NULL; @@ -345,7 +408,7 @@ PyObject *Vector_Cross( VectorObject * self, VectorObject * value ) return (PyObject *)vecCross; } -PyObject *Vector_Dot( VectorObject * self, VectorObject * value ) +static PyObject *Vector_Dot( VectorObject * self, VectorObject * value ) { double dot = 0.0; int x; @@ -368,7 +431,7 @@ PyObject *Vector_Dot( VectorObject * self, VectorObject * value ) /*----------------------------Vector.copy() -------------------------------------- return a copy of the vector */ -PyObject *Vector_copy(VectorObject * self) +static PyObject *Vector_copy(VectorObject * self) { return newVectorObject(self->vec, self->size, Py_NEW); } @@ -839,7 +902,7 @@ static double vec_magnitude_nosqrt(float *data, int size) /*------------------------tp_richcmpr returns -1 execption, 0 false, 1 true */ -PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type) +static PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type) { VectorObject *vecA = NULL, *vecB = NULL; int result = 0; @@ -1727,7 +1790,7 @@ PyTypeObject vector_Type = { 0, /* long tp_dictoffset; */ NULL, /* initproc tp_init; */ NULL, /* allocfunc tp_alloc; */ - NULL, /* newfunc tp_new; */ + Vector_new, /* newfunc tp_new; */ /* Low-level free-memory routine */ NULL, /* freefunc tp_free; */ /* For PyObject_IS_GC */ @@ -1785,7 +1848,7 @@ PyObject *newVectorObject(float *vec, int size, int type) ####################################################################### ----------------------------Vector.negate() -------------------- set the vector to it's negative -x, -y, -z */ -PyObject *Vector_Negate(VectorObject * self) +static PyObject *Vector_Negate(VectorObject * self) { int i; for(i = 0; i < self->size; i++) { diff --git a/source/blender/python/generic/vector.h b/source/blender/python/generic/vector.h index 930e987fcc7..d2eb826ef10 100644 --- a/source/blender/python/generic/vector.h +++ b/source/blender/python/generic/vector.h @@ -45,17 +45,6 @@ typedef struct { } VectorObject; /*prototypes*/ -PyObject *Vector_Zero( VectorObject * self ); -PyObject *Vector_Normalize( VectorObject * self ); -PyObject *Vector_Negate( VectorObject * self ); -PyObject *Vector_Resize2D( VectorObject * self ); -PyObject *Vector_Resize3D( VectorObject * self ); -PyObject *Vector_Resize4D( VectorObject * self ); -PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ); -PyObject *Vector_Reflect( VectorObject * self, PyObject * value ); -PyObject *Vector_Cross( VectorObject * self, VectorObject * value ); -PyObject *Vector_Dot( VectorObject * self, VectorObject * value ); -PyObject *Vector_copy( VectorObject * self ); PyObject *newVectorObject(float *vec, int size, int type); #endif /* EXPP_vector_h */ diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 57a4de21443..5727bb97483 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -771,12 +771,12 @@ static int pyrna_prop_contains(BPy_PropertyRNA * self, PyObject *value) char *keyname = _PyUnicode_AsString(value); if(keyname==NULL) { - PyErr_SetString(PyExc_SystemError, "PropertyRNA - key in prop, key must be a string type"); + PyErr_SetString(PyExc_TypeError, "PropertyRNA - key in prop, key must be a string type"); return -1; } if (RNA_property_type(self->prop) != PROP_COLLECTION) { - PyErr_SetString(PyExc_SystemError, "PropertyRNA - key in prop, is only valid for collection types"); + PyErr_SetString(PyExc_TypeError, "PropertyRNA - key in prop, is only valid for collection types"); return -1; } -- cgit v1.2.3 From 6393e9b3ca7e40e95830d009020b0f106c00b529 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 20 Jun 2009 03:58:25 +0000 Subject: NLA SoC: Fixes for problems arising from the merge --- source/blender/editors/space_nla/nla_buttons.c | 6 +----- source/blender/editors/space_nla/nla_select.c | 8 ++++---- source/blender/makesrna/intern/makesrna.c | 2 +- source/blender/makesrna/intern/rna_nla.c | 24 ++++++++++++------------ 4 files changed, 18 insertions(+), 22 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index cb76f7fc735..0d5cdf80830 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -206,11 +206,7 @@ static void nla_panel_properties(const bContext *C, Panel *pa) uiLayout *layout= pa->layout; uiLayout *column, *row, *subcol; uiBlock *block; - - /* check context and also validity of pointer */ - if (!nla_panel_context(C, NULL, &strip_ptr)) - return; - + block= uiLayoutGetBlock(layout); uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index b850ec76f82..ee4ed01ab81 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -361,10 +361,10 @@ void NLAEDIT_OT_select_border(wmOperatorType *ot) /* defines for left-right select tool */ static EnumPropertyItem prop_nlaedit_leftright_select_types[] = { - {NLAEDIT_LRSEL_TEST, "CHECK", "Check if Select Left or Right", ""}, - {NLAEDIT_LRSEL_NONE, "OFF", "Don't select", ""}, - {NLAEDIT_LRSEL_LEFT, "LEFT", "Before current frame", ""}, - {NLAEDIT_LRSEL_RIGHT, "RIGHT", "After current frame", ""}, + {NLAEDIT_LRSEL_TEST, "CHECK", 0, "Check if Select Left or Right", ""}, + {NLAEDIT_LRSEL_NONE, "OFF", 0, "Don't select", ""}, + {NLAEDIT_LRSEL_LEFT, "LEFT", 0, "Before current frame", ""}, + {NLAEDIT_LRSEL_RIGHT, "RIGHT", 0, "After current frame", ""}, {0, NULL, NULL, NULL} }; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index eacf3a65c7d..18734fbcb18 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1846,7 +1846,7 @@ RNAProcessItem PROCESS_ITEMS[]= { {"rna_mesh.c", "rna_mesh_api.c", RNA_def_mesh}, {"rna_meta.c", NULL, RNA_def_meta}, {"rna_modifier.c", NULL, RNA_def_modifier}, - {"rna_nla.c", RNA_def_nla}, + {"rna_nla.c", NULL, RNA_def_nla}, {"rna_nodetree.c", NULL, RNA_def_nodetree}, {"rna_object.c", "rna_object_api.c", RNA_def_object}, {"rna_object_force.c", NULL, RNA_def_object_force}, diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 4b5c14aab82..dacd257dc17 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -157,20 +157,20 @@ void rna_def_nlastrip(BlenderRNA *brna) /* enum defs */ static EnumPropertyItem prop_type_items[] = { - {NLASTRIP_TYPE_CLIP, "CLIP", "Action Clip", "NLA Strip references some Action."}, - {NLASTRIP_TYPE_TRANSITION, "TRANSITION", "Transition", "NLA Strip 'transitions' between adjacent strips."}, - {0, NULL, NULL, NULL}}; + {NLASTRIP_TYPE_CLIP, "CLIP", 0, "Action Clip", "NLA Strip references some Action."}, + {NLASTRIP_TYPE_TRANSITION, "TRANSITION", 0, "Transition", "NLA Strip 'transitions' between adjacent strips."}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_mode_blend_items[] = { - {NLASTRIP_MODE_BLEND, "BLEND", "Blend", "Results of strip and accumulated results are combined in ratio governed by influence."}, - {NLASTRIP_MODE_ADD, "ADD", "Add", "Weighted result of strip is added to the accumlated results."}, - {NLASTRIP_MODE_SUBTRACT, "SUBTRACT", "Subtract", "Weighted result of strip is removed from the accumlated results."}, - {NLASTRIP_MODE_MULTIPLY, "MULITPLY", "Multiply", "Weighted result of strip is multiplied with the accumlated results."}, - {0, NULL, NULL, NULL}}; + {NLASTRIP_MODE_BLEND, "BLEND", 0, "Blend", "Results of strip and accumulated results are combined in ratio governed by influence."}, + {NLASTRIP_MODE_ADD, "ADD", 0, "Add", "Weighted result of strip is added to the accumlated results."}, + {NLASTRIP_MODE_SUBTRACT, "SUBTRACT", 0, "Subtract", "Weighted result of strip is removed from the accumlated results."}, + {NLASTRIP_MODE_MULTIPLY, "MULITPLY", 0, "Multiply", "Weighted result of strip is multiplied with the accumlated results."}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_mode_extend_items[] = { - {NLASTRIP_EXTEND_NOTHING, "NOTHING", "Nothing", "Strip has no influence past its extents."}, - {NLASTRIP_EXTEND_HOLD, "HOLD", "Hold", "Hold the first frame if no previous strips in track, and always hold last frame."}, - {NLASTRIP_EXTEND_HOLD_FORWARD, "HOLD_FORWARD", "Hold Forward", "Only hold last frame."}, - {0, NULL, NULL, NULL}}; + {NLASTRIP_EXTEND_NOTHING, "NOTHING", 0, "Nothing", "Strip has no influence past its extents."}, + {NLASTRIP_EXTEND_HOLD, "HOLD", 0, "Hold", "Hold the first frame if no previous strips in track, and always hold last frame."}, + {NLASTRIP_EXTEND_HOLD_FORWARD, "HOLD_FORWARD", 0, "Hold Forward", "Only hold last frame."}, + {0, NULL, 0, NULL, NULL}}; /* struct definition */ srna= RNA_def_struct(brna, "NlaStrip", NULL); -- cgit v1.2.3 From 6394ee9e8143988b2a0f9316fb7bca5dc78e6e53 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 20 Jun 2009 04:02:49 +0000 Subject: NLA SoC: Drawing + Editing Fixes * Strips using the same action as the 'tweaking action' now get the error flag cleared after tweakmode is exited. (These strips draw with red shading) * The direction in which strips get played (as a result of the 'reversed' option) now gets indicated on strips by the direction of the arrow text printed on each strip * The active strip flag is now cleared after duplicating/splitting strips. --- source/blender/blenkernel/intern/nla.c | 12 +++++++++--- source/blender/editors/space_nla/nla_draw.c | 12 +++++++++--- source/blender/editors/space_nla/nla_edit.c | 7 +++++-- 3 files changed, 23 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 0684d943754..1ce6d9f98c7 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -648,7 +648,6 @@ short BKE_nla_tweakmode_enter (AnimData *adt) /* if block is already in tweakmode, just leave, but we should report * that this block is in tweakmode (as our returncode) */ - // FIXME: hopefully the flag is correct! if (adt->flag & ADT_NLA_EDIT_ON) return 1; @@ -707,6 +706,7 @@ short BKE_nla_tweakmode_enter (AnimData *adt) /* Exit tweakmode for this AnimData block */ void BKE_nla_tweakmode_exit (AnimData *adt) { + NlaStrip *strip; NlaTrack *nlt; /* verify that data is valid */ @@ -719,9 +719,15 @@ void BKE_nla_tweakmode_exit (AnimData *adt) // TODO: need to sync the user-strip with the new state of the action! - /* for all NLA-tracks, clear the 'disabled' flag */ - for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) + /* for all NLA-tracks, clear the 'disabled' flag + * for all NLA-strips, clear the 'tweak-user' flag + */ + for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { nlt->flag &= ~NLATRACK_DISABLED; + + for (strip= nlt->strips.first; strip; strip= strip->next) + strip->flag &= ~NLASTRIP_FLAG_TWEAKUSER; + } /* handle AnimData level changes: * - 'temporary' active action needs its usercount decreased, since we're removing this reference diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 9a9cbeeff21..2ac2b557243 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -212,19 +212,25 @@ static void nla_draw_strip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2 /* add the relevant text to the cache of text-strings to draw in pixelspace */ static void nla_draw_strip_text (NlaTrack *nlt, NlaStrip *strip, int index, View2D *v2d, float yminc, float ymaxc) { - char str[256]; + char str[256], dir[3]; rctf rect; + /* 'dir' - direction that strip is played in */ + if (strip->flag & NLASTRIP_FLAG_REVERSE) + sprintf(dir, "<-"); + else + sprintf(dir, "->"); + /* for now, just init the string with fixed-formats */ switch (strip->type) { case NLASTRIP_TYPE_TRANSITION: /* Transition */ - sprintf(str, "%d | Transition | %.2f <-> %.2f", index, strip->start, strip->end); + sprintf(str, "%d | Transition | %.2f %s %.2f", index, strip->start, dir, strip->end); break; case NLASTRIP_TYPE_CLIP: /* Action-Clip (default) */ default: if (strip->act) - sprintf(str, "%d | Act: %s | %.2f <-> %.2f", index, strip->act->id.name+2, strip->start, strip->end); + sprintf(str, "%d | Act: %s | %.2f %s %.2f", index, strip->act->id.name+2, strip->start, dir, strip->end); else sprintf(str, "%d | Act: ", index); // xxx... need a better format? break; diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 8b7c6bb99c6..ebb0589a82d 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -492,8 +492,8 @@ static int nlaedit_duplicate_exec (bContext *C, wmOperator *op) BKE_nlatrack_add_strip(track, nstrip); } - /* deselect the original */ - strip->flag &= ~NLASTRIP_FLAG_SELECT; + /* deselect the original and the active flag */ + strip->flag &= ~(NLASTRIP_FLAG_SELECT|NLASTRIP_FLAG_ACTIVE); done++; } @@ -666,6 +666,9 @@ static int nlaedit_split_exec (bContext *C, wmOperator *op) strip->actend= midaframe; nstrip->actstart= midaframe; + + /* clear the active flag from the copy */ + nstrip->flag &= ~NLASTRIP_FLAG_ACTIVE; } } } -- cgit v1.2.3 From 3511d72488501640fb9b38daff7cfed35e5beed2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 Jun 2009 06:06:13 +0000 Subject: game logic UI script, physics could be broken up into more panels. --- source/blender/makesrna/intern/rna_object.c | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index ff9777d283e..435a9e0f0a4 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -522,6 +522,49 @@ static void rna_def_object_game_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Rotation Damping", "General rotation damping."); + prop= RNA_def_property(srna, "minimum_velocity", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "min_vel"); + RNA_def_property_range(prop, 0.0, 1000.0); + RNA_def_property_ui_text(prop, "Velocity Min", "Clamp velocity to this minimum speed (except when totally still)."); + + prop= RNA_def_property(srna, "maximum_velocity", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "max_vel"); + RNA_def_property_range(prop, 0.0, 1000.0); + RNA_def_property_ui_text(prop, "Velocity Max", "Clamp velocity to this maximum speed."); + + /* lock position */ + prop= RNA_def_property(srna, "lock_x_axis", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_X_AXIS); + RNA_def_property_ui_text(prop, "Lock X Axis", "Disable simulation of linear motion along the X axis."); + + prop= RNA_def_property(srna, "lock_y_axis", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Y_AXIS); + RNA_def_property_ui_text(prop, "Lock Y Axis", "Disable simulation of linear motion along the Y axis."); + + prop= RNA_def_property(srna, "lock_z_axis", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Z_AXIS); + RNA_def_property_ui_text(prop, "Lock Z Axis", "Disable simulation of linear motion along the Z axis."); + + + /* lock rotation */ + prop= RNA_def_property(srna, "lock_x_rot_axis", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_X_ROT_AXIS); + RNA_def_property_ui_text(prop, "Lock X Rotation Axis", "Disable simulation of angular motion along the X axis."); + + prop= RNA_def_property(srna, "lock_y_rot_axis", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Y_ROT_AXIS); + RNA_def_property_ui_text(prop, "Lock Y Rotation Axis", "Disable simulation of angular motion along the Y axis."); + + prop= RNA_def_property(srna, "lock_z_rot_axis", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Z_ROT_AXIS); + RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis."); + + /* is this used anywhere ? */ + prop= RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflag2", OB_NEVER_DO_ACTIVITY_CULLING); + RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis."); + + prop= RNA_def_property(srna, "do_fh", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_DO_FH); RNA_def_property_ui_text(prop, "Do Fh", "Use Fh settings in materials."); -- cgit v1.2.3 From ef7860ed9a68e3b92346697028ef0bdd9d21932f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 20 Jun 2009 09:36:55 +0000 Subject: NLA SoC: Conversions for old NLA-data to the new system Old NLA-data now gets mostly ported converted over to the new system, with strips and their respective Actions being handled correctly in the test cases I've got. The conversion procedure now tries to fit multiple strips into since tracks as it is assumed that quite a few old setups tried to do. However, some old setups may be adversely affected by this (i.e. if they depend on a certain order of holding adds for example). For now, there are no complete replacements for the NLA-Modifier/Auto-Walking stuff yet, so that info is currently just ignored (but correctly freed). The current plan here is to get Armature-level pose-offset system + F-Modifiers where appropriate. This should be one of the major causes of file breakage now... Also, I've yet to restore some patching for group instancing NLA stuff, since more trickery here is required. This is probably the second major cause of file breakage... --- source/blender/blenkernel/intern/ipo.c | 111 +++++++++++++++++++++++++++++++-- 1 file changed, 107 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 54618813a0b..5642e63326f 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -58,6 +58,7 @@ #include "DNA_key_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" +#include "DNA_nla_types.h" #include "DNA_object_types.h" #include "DNA_object_force.h" #include "DNA_particle_types.h" @@ -85,6 +86,7 @@ #include "BKE_library.h" #include "BKE_main.h" #include "BKE_mesh.h" +#include "BKE_nla.h" #include "BKE_object.h" @@ -1463,6 +1465,87 @@ static void action_to_animdata (ID *id, bAction *act) action_to_animato(act, &adt->action->groups, &adt->action->curves, &adt->drivers); } +/* ------------------------- */ + +// TODO: +// - NLA group duplicators info +// - NLA curve/stride modifiers... + +/* Convert NLA-Strip to new system */ +static void nlastrips_to_animdata (ID *id, ListBase *strips) +{ + AnimData *adt= BKE_animdata_from_id(id); + NlaTrack *nlt = NULL; + NlaStrip *strip; + bActionStrip *as, *asn; + + /* for each one of the original strips, convert to a new strip and free the old... */ + for (as= strips->first; as; as= asn) { + asn= as->next; + + /* this old strip is only worth something if it had an action... */ + if (as->act) { + /* convert Action data (if not yet converted), storing the results in the same Action */ + action_to_animato(as->act, &as->act->groups, &as->act->curves, &adt->drivers); + + /* create a new-style NLA-strip which references this Action, then copy over relevant settings */ + { + /* init a new strip, and assign the action to it + * - no need to muck around with the user-counts, since this is just + * passing over the ref to the new owner, not creating an additional ref + */ + strip= MEM_callocN(sizeof(NlaStrip), "NlaStrip"); + strip->act= as->act; + + /* endpoints */ + strip->start= as->start; + strip->end= as->end; + strip->actstart= as->actstart; + strip->actend= as->actend; + + /* action reuse */ + strip->repeat= as->repeat; + strip->scale= as->scale; + if (as->flag & ACTSTRIP_LOCK_ACTION) strip->flag |= NLASTRIP_FLAG_SYNC_LENGTH; + + /* blending */ + strip->blendin= as->blendin; + strip->blendout= as->blendout; + strip->blendmode= (as->mode==ACTSTRIPMODE_ADD) ? NLASTRIP_MODE_ADD : NLASTRIP_MODE_BLEND; + if (as->flag & ACTSTRIP_AUTO_BLENDS) strip->flag |= NLASTRIP_FLAG_AUTO_BLENDS; + + /* assorted setting flags */ + if (as->flag & ACTSTRIP_SELECT) strip->flag |= NLASTRIP_FLAG_SELECT; + if (as->flag & ACTSTRIP_ACTIVE) strip->flag |= NLASTRIP_FLAG_ACTIVE; + + if (as->flag & ACTSTRIP_MUTE) strip->flag |= NLASTRIP_FLAG_MUTED; + if (as->flag & ACTSTRIP_REVERSE) strip->flag |= NLASTRIP_FLAG_REVERSE; + + /* by default, we now always extrapolate, while in the past this was optional */ + if ((as->flag & ACTSTRIP_HOLDLASTFRAME)==0) + strip->extendmode= NLASTRIP_EXTEND_NOTHING; + } + + /* try to add this strip to the current NLA-Track (i.e. the 'last' one on the stack atm) */ + if (BKE_nlatrack_add_strip(nlt, strip) == 0) { + /* trying to add to the current failed (no space), + * so add a new track to the stack, and add to that... + */ + nlt= add_nlatrack(adt, NULL); + BKE_nlatrack_add_strip(nlt, strip); + } + } + + /* modifiers */ + // FIXME: for now, we just free them... + if (as->modifiers.first) + BLI_freelistN(&as->modifiers); + + /* free the old strip */ + BLI_freelinkN(strips, as); + } +} + /* *************************************************** */ /* External API - Only Called from do_versions() */ @@ -1509,7 +1592,30 @@ void do_versions_ipos_to_animato(Main *main) if (G.f & G_DEBUG) printf("\tconverting ob %s \n", id->name+2); /* check if object has any animation data */ - if ((ob->ipo) || (ob->action) || (ob->nlastrips.first)) { + if (ob->nlastrips.first) { + /* Add AnimData block */ + adt= BKE_id_add_animdata(id); + + /* IPO first to take into any non-NLA'd Object Animation */ + if (ob->ipo) { + ipo_to_animdata(id, ob->ipo, NULL, NULL); + + ob->ipo->id.us--; + ob->ipo= NULL; + } + + /* Action is skipped since it'll be used by some strip in the NLA anyway, + * causing errors with evaluation in the new evaluation pipeline + */ + if (ob->action) { + ob->action->id.us--; + ob->action= NULL; + } + + /* finally NLA */ + nlastrips_to_animdata(id, &ob->nlastrips); + } + else if ((ob->ipo) || (ob->action)) { /* Add AnimData block */ adt= BKE_id_add_animdata(id); @@ -1530,9 +1636,6 @@ void do_versions_ipos_to_animato(Main *main) ob->ipo->id.us--; ob->ipo= NULL; } - - /* finally NLA */ - // XXX todo... for now, new NLA code not hooked up yet, so keep old stuff (but not for too long!) } /* check PoseChannels for constraints with local data */ -- cgit v1.2.3 From 6ff4a7229f316548046ab5593070b082cc1a4a7a Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 20 Jun 2009 11:44:56 +0000 Subject: NLA SoC: Conversion fixes - Curve 'Speed' Curves + Constraints These fixes get the 'pathJumper.blend' file from our testing suite workable in 2.5 (with a few minor tweaks still needed *) Changes required: - Added a 'ctime' var to curve structs for storing the value that used to be obtained by specially evaluating the 'speed' curve when evaluating objects parented to the curve. This can now be animated as a 'proper' var as per normal. - Added a special hack for detecting constraint blocks, as the old method resulted in paths for Objects instead... (*) Issues: - Unfortunately, the paths still don't work out of the box. For some reason, the constraint names in the paths are spelt incorrectly - "Ar" and "Br" instead of "Ap" and "Bp". I'm not sure where this problem is coming from, but changing the paths manually in the Datablocks viewer fixes this error... - I noticed that in the buttons view, only 1st of the constraints gets shown. This seems a bit like some of the intermittent problems I've had with some arrays/lists not expanding properly in Datablocks view. --- source/blender/blenkernel/intern/anim_sys.c | 14 +++++++++++++- source/blender/blenkernel/intern/ipo.c | 11 +++++++++-- source/blender/blenkernel/intern/object.c | 16 ++++++++-------- source/blender/makesdna/DNA_curve_types.h | 5 +++-- source/blender/makesrna/intern/rna_curve.c | 6 ++++++ 5 files changed, 39 insertions(+), 13 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 2efb4f2b2d3..7a6706b7c5a 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1341,10 +1341,22 @@ void BKE_animsys_evaluate_all_animation (Main *main, float ctime) EVAL_ANIM_IDS(main->camera.first, ADT_RECALC_ANIM); /* shapekeys */ + // TODO: we probably need the same hack as for curves (ctime-hack) EVAL_ANIM_IDS(main->key.first, ADT_RECALC_ANIM); /* curves */ - // TODO... + /* we need to perform a special hack here to ensure that the ctime + * value of the curve gets set in case there's no animation for that + * - it needs to be set before animation is evaluated just so that + * animation can successfully override... + */ + for (id= main->curve.first; id; id= id->next) { + AnimData *adt= BKE_animdata_from_id(id); + Curve *cu= (Curve *)id; + + cu->ctime= ctime; + BKE_animsys_evaluate_animdata(id, adt, ctime, ADT_RECALC_ANIM); + } /* meshes */ // TODO... diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 5642e63326f..968a0e68fb9 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -827,6 +827,10 @@ char *get_rna_access (int blocktype, int adrcode, char actname[], char constname char buf[512]; int dummy_index= 0; + /* hack: if constname is set, we can only be dealing with an Constraint curve */ + if (constname) + blocktype= ID_CO; + /* get property name based on blocktype */ switch (blocktype) { case ID_OB: /* object */ @@ -842,7 +846,7 @@ char *get_rna_access (int blocktype, int adrcode, char actname[], char constname break; case ID_CO: /* constraint */ - propname= constraint_adrcodes_to_paths(adrcode, &dummy_index); + propname= constraint_adrcodes_to_paths(adrcode, &dummy_index); break; case ID_TE: /* texture */ @@ -872,7 +876,10 @@ char *get_rna_access (int blocktype, int adrcode, char actname[], char constname /* XXX problematic blocktypes */ case ID_CU: /* curve */ - propname= "speed"; // XXX this was a 'dummy curve' that didn't really correspond to any real var... + /* this used to be a 'dummy' curve which got evaluated on the fly... + * now we've got real var for this! + */ + propname= "eval_time"; break; case ID_SEQ: /* sequencer strip */ diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index c2916bc2231..6490ff3c724 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1569,14 +1569,14 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4]) } /* catch exceptions: curve paths used as a duplicator */ else if(enable_cu_speed) { - ctime= bsystem_time(scene, ob, (float)scene->r.cfra, 0.0); - -#if 0 // XXX old animation system - if(calc_ipo_spec(cu->ipo, CU_SPEED, &ctime)==0) { - ctime /= cu->pathlen; - CLAMP(ctime, 0.0, 1.0); - } -#endif // XXX old animation system + /* ctime is now a proper var setting of Curve which gets set by Animato like any other var that's animated, + * but this will only work if it actually is animated... + * + * we firstly calculate the modulus of cu->ctime/cu->pathlen to clamp ctime within the 0.0 to 1.0 times pathlen + * range, then divide this (the modulus) by pathlen to get a value between 0.0 and 1.0 + */ + ctime= fmod(cu->ctime, cu->pathlen) / cu->pathlen; + CLAMP(ctime, 0.0, 1.0); } else { ctime= scene->r.cfra - give_timeoffset(ob); diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index f8ea5f95d65..b0f089d670f 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -148,7 +148,7 @@ typedef struct Curve { ListBase *editnurb; /* edited data, not in file, use pointer so we can check for it */ struct Object *bevobj, *taperobj, *textoncurve; - struct Ipo *ipo; + struct Ipo *ipo; // XXX depreceated... old animation system Path *path; struct Key *key; struct Material **mat; @@ -193,7 +193,8 @@ typedef struct Curve { int sepchar; - int totbox, actbox, pad; + float ctime; /* current evaltime - for use by Objects parented to curves */ + int totbox, actbox; struct TextBox *tb; int selstart, selend; diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 41a47e279e9..91488aa2a49 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -31,6 +31,7 @@ #include "DNA_curve_types.h" #include "DNA_material_types.h" +#include "DNA_scene_types.h" EnumPropertyItem beztriple_handle_type_items[] = { {HD_FREE, "FREE", 0, "Free", ""}, @@ -558,6 +559,11 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_ui_range(prop, 1, 1024, 1, 0); RNA_def_property_ui_text(prop, "Render Resolution V", "Surface resolution in V direction used while rendering. Zero skips this property."); + + prop= RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "ctime"); + RNA_def_property_ui_text(prop, "Evaluation Time", "Parametric position along the length of the curve that Objects 'following' it should be at."); + /* pointers */ prop= RNA_def_property(srna, "bevel_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "bevobj"); -- cgit v1.2.3 From a68ebbbccdf6bc1854c7a947685254ca912de7bf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 Jun 2009 13:53:14 +0000 Subject: RNA Fixes * Python apis iterator didnt work, for example [f for f in mesh.faces] # failed. * Python apis collection.items(), collections without names now return (index,value) pairs, better then returning nothing. * bpy.ui and bpy.props modules were incorrectly named * Mesh vertex colors red/blue needed to be swapped on getting/setting. * Mesh vertex colors were not clamped. --- source/blender/makesrna/intern/rna_mesh.c | 37 ++++++++++++++++++------------- source/blender/python/intern/bpy_rna.c | 35 +++++++++++++++++------------ source/blender/python/intern/bpy_ui.c | 2 +- 3 files changed, 43 insertions(+), 31 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 653f9d61fa5..5634740a4e6 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -80,76 +80,77 @@ static void rna_MEdge_crease_set(PointerRNA *ptr, float value) medge->crease= (char)(CLAMPIS(value*255.0f, 0, 255)); } +/* notice red and blue are swapped */ static void rna_MeshColor_color1_get(PointerRNA *ptr, float *values) { MCol *mcol= (MCol*)ptr->data; - values[0]= (&mcol[0].r)[0]/255.0f; + values[2]= (&mcol[0].r)[0]/255.0f; values[1]= (&mcol[0].r)[1]/255.0f; - values[2]= (&mcol[0].r)[2]/255.0f; + values[0]= (&mcol[0].r)[2]/255.0f; } static void rna_MeshColor_color1_set(PointerRNA *ptr, const float *values) { MCol *mcol= (MCol*)ptr->data; - (&mcol[0].r)[0]= (char)(CLAMPIS(values[0]*255.0f, 0, 255)); + (&mcol[0].r)[2]= (char)(CLAMPIS(values[0]*255.0f, 0, 255)); (&mcol[0].r)[1]= (char)(CLAMPIS(values[1]*255.0f, 0, 255)); - (&mcol[0].r)[2]= (char)(CLAMPIS(values[2]*255.0f, 0, 255)); + (&mcol[0].r)[0]= (char)(CLAMPIS(values[2]*255.0f, 0, 255)); } static void rna_MeshColor_color2_get(PointerRNA *ptr, float *values) { MCol *mcol= (MCol*)ptr->data; - values[0]= (&mcol[1].r)[0]/255.0f; + values[2]= (&mcol[1].r)[0]/255.0f; values[1]= (&mcol[1].r)[1]/255.0f; - values[2]= (&mcol[1].r)[2]/255.0f; + values[0]= (&mcol[1].r)[2]/255.0f; } static void rna_MeshColor_color2_set(PointerRNA *ptr, const float *values) { MCol *mcol= (MCol*)ptr->data; - (&mcol[1].r)[0]= (char)(CLAMPIS(values[0]*255.0f, 0, 255)); + (&mcol[1].r)[2]= (char)(CLAMPIS(values[0]*255.0f, 0, 255)); (&mcol[1].r)[1]= (char)(CLAMPIS(values[1]*255.0f, 0, 255)); - (&mcol[1].r)[2]= (char)(CLAMPIS(values[2]*255.0f, 0, 255)); + (&mcol[1].r)[0]= (char)(CLAMPIS(values[2]*255.0f, 0, 255)); } static void rna_MeshColor_color3_get(PointerRNA *ptr, float *values) { MCol *mcol= (MCol*)ptr->data; - values[0]= (&mcol[2].r)[0]/255.0f; + values[2]= (&mcol[2].r)[0]/255.0f; values[1]= (&mcol[2].r)[1]/255.0f; - values[2]= (&mcol[2].r)[2]/255.0f; + values[0]= (&mcol[2].r)[2]/255.0f; } static void rna_MeshColor_color3_set(PointerRNA *ptr, const float *values) { MCol *mcol= (MCol*)ptr->data; - (&mcol[2].r)[0]= (char)(CLAMPIS(values[0]*255.0f, 0, 255)); + (&mcol[2].r)[2]= (char)(CLAMPIS(values[0]*255.0f, 0, 255)); (&mcol[2].r)[1]= (char)(CLAMPIS(values[1]*255.0f, 0, 255)); - (&mcol[2].r)[2]= (char)(CLAMPIS(values[2]*255.0f, 0, 255)); + (&mcol[2].r)[0]= (char)(CLAMPIS(values[2]*255.0f, 0, 255)); } static void rna_MeshColor_color4_get(PointerRNA *ptr, float *values) { MCol *mcol= (MCol*)ptr->data; - values[0]= (&mcol[3].r)[0]/255.0f; + values[2]= (&mcol[3].r)[0]/255.0f; values[1]= (&mcol[3].r)[1]/255.0f; - values[2]= (&mcol[3].r)[2]/255.0f; + values[0]= (&mcol[3].r)[2]/255.0f; } static void rna_MeshColor_color4_set(PointerRNA *ptr, const float *values) { MCol *mcol= (MCol*)ptr->data; - (&mcol[3].r)[0]= (char)(CLAMPIS(values[0]*255.0f, 0, 255)); + (&mcol[3].r)[2]= (char)(CLAMPIS(values[0]*255.0f, 0, 255)); (&mcol[3].r)[1]= (char)(CLAMPIS(values[1]*255.0f, 0, 255)); - (&mcol[3].r)[2]= (char)(CLAMPIS(values[2]*255.0f, 0, 255)); + (&mcol[3].r)[0]= (char)(CLAMPIS(values[2]*255.0f, 0, 255)); } static int rna_Mesh_texspace_editable(PointerRNA *ptr) @@ -907,21 +908,25 @@ static void rna_def_mcol(BlenderRNA *brna) prop= RNA_def_property(srna, "color1", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_float_funcs(prop, "rna_MeshColor_color1_get", "rna_MeshColor_color1_set", NULL); RNA_def_property_ui_text(prop, "Color 1", ""); prop= RNA_def_property(srna, "color2", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_float_funcs(prop, "rna_MeshColor_color2_get", "rna_MeshColor_color2_set", NULL); RNA_def_property_ui_text(prop, "Color 2", ""); prop= RNA_def_property(srna, "color3", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_float_funcs(prop, "rna_MeshColor_color3_get", "rna_MeshColor_color3_set", NULL); RNA_def_property_ui_text(prop, "Color 3", ""); prop= RNA_def_property(srna, "color4", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_float_funcs(prop, "rna_MeshColor_color4_get", "rna_MeshColor_color4_set", NULL); RNA_def_property_ui_text(prop, "Color 4", ""); } diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 5727bb97483..e4c17e080b7 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1011,22 +1011,30 @@ PyObject *pyrna_prop_items(BPy_PropertyRNA *self) CollectionPropertyIterator iter; PropertyRNA *nameprop; char name[256], *nameptr; + int i= 0; ret = PyList_New(0); RNA_property_collection_begin(&self->ptr, self->prop, &iter); for(; iter.valid; RNA_property_collection_next(&iter)) { - if(iter.ptr.data && (nameprop = RNA_struct_name_property(iter.ptr.type))) { - nameptr= RNA_property_string_get_alloc(&iter.ptr, nameprop, name, sizeof(name)); - + if(iter.ptr.data) { /* add to python list */ - item = Py_BuildValue("(NN)", PyUnicode_FromString( nameptr ), pyrna_struct_CreatePyObject(&iter.ptr)); + item= PyTuple_New(2); + if(nameprop = RNA_struct_name_property(iter.ptr.type)) { + nameptr= RNA_property_string_get_alloc(&iter.ptr, nameprop, name, sizeof(name)); + PyTuple_SET_ITEM(item, 0, PyUnicode_FromString( nameptr )); + if ((char *)&name != nameptr) + MEM_freeN(nameptr); + } + else { + PyTuple_SET_ITEM(item, 0, PyLong_FromSsize_t(i)); /* a bit strange but better then returning an empty list */ + } + PyTuple_SET_ITEM(item, 1, pyrna_struct_CreatePyObject(&iter.ptr)); + PyList_Append(ret, item); Py_DECREF(item); - /* done */ - if ((char *)&name != nameptr) - MEM_freeN(nameptr); + i++; } } RNA_property_collection_end(&iter); @@ -1039,23 +1047,22 @@ PyObject *pyrna_prop_items(BPy_PropertyRNA *self) PyObject *pyrna_prop_values(BPy_PropertyRNA *self) { PyObject *ret; + if (RNA_property_type(self->prop) != PROP_COLLECTION) { PyErr_SetString( PyExc_TypeError, "values() is only valid for collection types" ); ret = NULL; } else { PyObject *item; CollectionPropertyIterator iter; - PropertyRNA *nameprop; - + PropertyRNA *iterprop; ret = PyList_New(0); + //iterprop= RNA_struct_iterator_property(self->ptr.type); RNA_property_collection_begin(&self->ptr, self->prop, &iter); for(; iter.valid; RNA_property_collection_next(&iter)) { - if(iter.ptr.data && (nameprop = RNA_struct_name_property(iter.ptr.type))) { - item = pyrna_struct_CreatePyObject(&iter.ptr); - PyList_Append(ret, item); - Py_DECREF(item); - } + item = pyrna_struct_CreatePyObject(&iter.ptr); + PyList_Append(ret, item); + Py_DECREF(item); } RNA_property_collection_end(&iter); } diff --git a/source/blender/python/intern/bpy_ui.c b/source/blender/python/intern/bpy_ui.c index c15315ca350..088fe436c69 100644 --- a/source/blender/python/intern/bpy_ui.c +++ b/source/blender/python/intern/bpy_ui.c @@ -373,7 +373,7 @@ static struct PyMethodDef ui_methods[] = { #if PY_VERSION_HEX >= 0x03000000 static struct PyModuleDef ui_module = { PyModuleDef_HEAD_INIT, - "bpyui", + "bpy.ui", "", -1,/* multiple "initialization" just copies the module dict. */ ui_methods, -- cgit v1.2.3 From 980dab90282ab3ca63ac44b174344a6607934fb9 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 20 Jun 2009 14:53:30 +0000 Subject: 2.5: fix for crash in BLI_dynstr_appendf, each vsnprintf call apparently needs its own va_start/va_end. --- source/blender/blenlib/intern/BLI_dynstr.c | 52 +++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenlib/intern/BLI_dynstr.c b/source/blender/blenlib/intern/BLI_dynstr.c index 04388ea946f..dd10d898a7f 100644 --- a/source/blender/blenlib/intern/BLI_dynstr.c +++ b/source/blender/blenlib/intern/BLI_dynstr.c @@ -92,7 +92,7 @@ void BLI_dynstr_vappendf(DynStr *ds, const char *format, va_list args) if(len == sizeof(fixedmessage)) message= fixedmessage; else - message= MEM_callocN(sizeof(char)*len+1, "BLI_dynstr_appendf"); + message= MEM_callocN(sizeof(char)*(len+1), "BLI_dynstr_appendf"); retval= vsnprintf(message, len, format, args); @@ -132,10 +132,54 @@ void BLI_dynstr_vappendf(DynStr *ds, const char *format, va_list args) void BLI_dynstr_appendf(DynStr *ds, const char *format, ...) { va_list args; + char *message, fixedmessage[256]; + int len= 256, maxlen= 65536, retval; + + /* note that it's tempting to just call BLI_dynstr_vappendf here + * and avoid code duplication, that crashes on some system because + * va_start/va_end have to be called for each vsnprintf call */ - va_start(args, format); - BLI_dynstr_vappendf(ds, format, args); - va_end(args); + while(1) { + if(len == sizeof(fixedmessage)) + message= fixedmessage; + else + message= MEM_callocN(sizeof(char)*(len+1), "BLI_dynstr_appendf"); + + va_start(args, format); + retval= vsnprintf(message, len, format, args); + va_end(args); + + if(retval == -1) { + /* -1 means not enough space, but on windows it may also mean + * there is a formatting error, so we impose a maximum length */ + if(message != fixedmessage) + MEM_freeN(message); + message= NULL; + + len *= 2; + if(len > maxlen) { + fprintf(stderr, "BLI_dynstr_append text too long or format error.\n"); + break; + } + } + else if(retval > len) { + /* in C99 the actual length required is returned */ + if(message != fixedmessage) + MEM_freeN(message); + message= NULL; + + len= retval; + } + else + break; + } + + if(message) { + BLI_dynstr_append(ds, message); + + if(message != fixedmessage) + MEM_freeN(message); + } } int BLI_dynstr_get_len(DynStr *ds) { -- cgit v1.2.3 From ad07fc19c0fb97540bfe8d259c0b39098b9d7b9b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 20 Jun 2009 14:55:28 +0000 Subject: Context Python dir(context) now gives the items from the data context too, modified context callbacks to also return a list of items in the context. --- source/blender/blenkernel/BKE_context.h | 15 +++-- source/blender/blenkernel/intern/context.c | 76 +++++++++++++++++++++- source/blender/editors/screen/screen_context.c | 10 ++- .../editors/space_buttons/buttons_context.c | 13 +++- source/blender/editors/space_image/space_image.c | 6 +- source/blender/editors/space_node/space_node.c | 7 +- source/blender/editors/space_text/space_text.c | 7 +- source/blender/editors/space_view3d/space_view3d.c | 12 +++- source/blender/python/intern/bpy_rna.c | 13 ++++ 9 files changed, 144 insertions(+), 15 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h index 6a43f4ca25c..898b84ecdc3 100644 --- a/source/blender/blenkernel/BKE_context.h +++ b/source/blender/blenkernel/BKE_context.h @@ -126,12 +126,14 @@ void CTX_wm_menu_set(bContext *C, struct ARegion *menu); /* Data Context - - note: listbases consist of LinkData items and must be - freed with BLI_freelistN! */ + - listbases consist of CollectionPointerLink items and must be + freed with BLI_freelistN! + - the dir listbase consits of LinkData items */ -PointerRNA CTX_data_pointer_get(bContext *C, const char *member); -ListBase CTX_data_collection_get(bContext *C, const char *member); -void CTX_data_get(bContext *C, const char *member, PointerRNA *r_ptr, ListBase *r_lb); +PointerRNA CTX_data_pointer_get(const bContext *C, const char *member); +ListBase CTX_data_collection_get(const bContext *C, const char *member); +ListBase CTX_data_dir_get(const bContext *C); +void CTX_data_get(const bContext *C, const char *member, PointerRNA *r_ptr, ListBase *r_lb); void CTX_data_id_pointer_set(bContextDataResult *result, struct ID *id); void CTX_data_pointer_set(bContextDataResult *result, struct ID *id, StructRNA *type, void *data); @@ -139,7 +141,10 @@ void CTX_data_pointer_set(bContextDataResult *result, struct ID *id, StructRNA * void CTX_data_id_list_add(bContextDataResult *result, struct ID *id); void CTX_data_list_add(bContextDataResult *result, struct ID *id, StructRNA *type, void *data); +void CTX_data_dir_set(bContextDataResult *result, const char **member); + int CTX_data_equals(const char *member, const char *str); +int CTX_data_dir(const char *member); /*void CTX_data_pointer_set(bContextDataResult *result, void *data); void CTX_data_list_add(bContextDataResult *result, void *data);*/ diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index ae541365b1e..12deec838a8 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -280,6 +280,7 @@ void CTX_wm_menu_set(bContext *C, ARegion *menu) struct bContextDataResult { PointerRNA ptr; ListBase list; + const char **dir; }; static int ctx_data_get(bContext *C, const char *member, bContextDataResult *result) @@ -360,7 +361,7 @@ static int ctx_data_collection_get(const bContext *C, const char *member, ListBa return 0; } -PointerRNA CTX_data_pointer_get(bContext *C, const char *member) +PointerRNA CTX_data_pointer_get(const bContext *C, const char *member) { bContextDataResult result; @@ -375,7 +376,7 @@ PointerRNA CTX_data_pointer_get(bContext *C, const char *member) } -ListBase CTX_data_collection_get(bContext *C, const char *member) +ListBase CTX_data_collection_get(const bContext *C, const char *member) { bContextDataResult result; @@ -389,7 +390,7 @@ ListBase CTX_data_collection_get(bContext *C, const char *member) } } -void CTX_data_get(bContext *C, const char *member, PointerRNA *r_ptr, ListBase *r_lb) +void CTX_data_get(const bContext *C, const char *member, PointerRNA *r_ptr, ListBase *r_lb) { bContextDataResult result; @@ -403,11 +404,75 @@ void CTX_data_get(bContext *C, const char *member, PointerRNA *r_ptr, ListBase * } } +static void data_dir_add(ListBase *lb, const char *member) +{ + LinkData *link; + + if(strcmp(member, "scene") == 0) /* exception */ + return; + + for(link=lb->first; link; link=link->next) + if(strcmp(link->data, member) == 0) + return; + + link= MEM_callocN(sizeof(LinkData), "LinkData"); + link->data= (void*)member; + BLI_addtail(lb, link); +} + +ListBase CTX_data_dir_get(const bContext *C) +{ + bContextDataResult result; + ListBase lb; + int a; + + memset(&lb, 0, sizeof(lb)); + + if(C->wm.store) { + bContextStoreEntry *entry; + + for(entry=C->wm.store->entries.first; entry; entry=entry->next) + data_dir_add(&lb, entry->name); + } + if(C->wm.region && C->wm.region->type && C->wm.region->type->context) { + memset(&result, 0, sizeof(result)); + C->wm.region->type->context(C, "", &result); + + if(result.dir) + for(a=0; result.dir[a]; a++) + data_dir_add(&lb, result.dir[a]); + } + if(C->wm.area && C->wm.area->type && C->wm.area->type->context) { + memset(&result, 0, sizeof(result)); + C->wm.area->type->context(C, "", &result); + + if(result.dir) + for(a=0; result.dir[a]; a++) + data_dir_add(&lb, result.dir[a]); + } + if(C->wm.screen && C->wm.screen->context) { + bContextDataCallback cb= C->wm.screen->context; + memset(&result, 0, sizeof(result)); + cb(C, "", &result); + + if(result.dir) + for(a=0; result.dir[a]; a++) + data_dir_add(&lb, result.dir[a]); + } + + return lb; +} + int CTX_data_equals(const char *member, const char *str) { return (strcmp(member, str) == 0); } +int CTX_data_dir(const char *member) +{ + return (strcmp(member, "") == 0); +} + void CTX_data_id_pointer_set(bContextDataResult *result, ID *id) { RNA_id_pointer_create(id, &result->ptr); @@ -451,6 +516,11 @@ int ctx_data_list_count(const bContext *C, int (*func)(const bContext*, ListBase return 0; } +void CTX_data_dir_set(bContextDataResult *result, const char **dir) +{ + result->dir= dir; +} + /* data context */ Main *CTX_data_main(const bContext *C) diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 11d1d019005..1ea6f8baceb 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -42,7 +42,15 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult Scene *scene= sc->scene; Base *base; - if(CTX_data_equals(member, "scene")) { + if(CTX_data_dir(member)) { + static const char *dir[] = { + "scene", "selected_objects", "selected_bases", "active_base", + "active_object", "edit_object", NULL}; + + CTX_data_dir_set(result, dir); + return 1; + } + else if(CTX_data_equals(member, "scene")) { CTX_data_id_pointer_set(result, &scene->id); return 1; } diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index fc280d9b551..d97b4acdb96 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -492,8 +492,17 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r return 0; /* here we handle context, getting data from precomputed path */ - - if(CTX_data_equals(member, "world")) { + if(CTX_data_dir(member)) { + static const char *dir[] = { + "world", "object", "meshe", "armature", "lattice", "curve", + "meta_ball", "lamp", "camera", "material", "material_slot", + "texture", "texture_slot", "bone", "edit_bone", "particle_system", + "cloth", "soft_body", "fluid", NULL}; + + CTX_data_dir_set(result, dir); + return 1; + } + else if(CTX_data_equals(member, "world")) { set_pointer_type(path, result, &RNA_World); return 1; } diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index e12f3bfe357..49f950fe67b 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -301,7 +301,11 @@ static int image_context(const bContext *C, const char *member, bContextDataResu { SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); - if(CTX_data_equals(member, "edit_image")) { + if(CTX_data_dir(member)) { + static const char *dir[] = {"edit_image", NULL}; + CTX_data_dir_set(result, dir); + } + else if(CTX_data_equals(member, "edit_image")) { CTX_data_id_pointer_set(result, (ID*)ED_space_image(sima)); return 1; } diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 775f46b8e04..ac3a884c5f8 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -283,7 +283,12 @@ static int node_context(const bContext *C, const char *member, bContextDataResul { SpaceNode *snode= (SpaceNode*)CTX_wm_space_data(C); - if(CTX_data_equals(member, "selected_nodes")) { + if(CTX_data_dir(member)) { + static const char *dir[] = {"selected_nodes", NULL}; + CTX_data_dir_set(result, dir); + return 1; + } + else if(CTX_data_equals(member, "selected_nodes")) { bNode *node; for(next_node(snode->edittree); (node=next_node(NULL));) { diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index d3c3b78cc50..8759fd00f74 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -293,7 +293,12 @@ static int text_context(const bContext *C, const char *member, bContextDataResul { SpaceText *st= CTX_wm_space_text(C); - if(CTX_data_equals(member, "edit_text")) { + if(CTX_data_dir(member)) { + static const char *dir[] = {"edit_text", NULL}; + CTX_data_dir_set(result, dir); + return 1; + } + else if(CTX_data_equals(member, "edit_text")) { CTX_data_id_pointer_set(result, &st->text->id); return 1; } diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 6e33b1dcaab..2d6a57d5a34 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -565,7 +565,17 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes if(v3d==NULL) return 0; - if(CTX_data_equals(member, "selected_objects") || CTX_data_equals(member, "selected_bases")) { + if(CTX_data_dir(member)) { + static const char *dir[] = { + "selected_objects", "selected_bases" "selected_editable_objects", + "selected_editable_bases" "visible_objects", "visible_bases", + "active_base", "active_object", "visible_bones", "editable_bones", + "selected_bones", "selected_editable_bones" "visible_pchans", + "selected_pchans", "active_bone", "active_pchan", NULL}; + + CTX_data_dir_set(result, dir); + } + else if(CTX_data_equals(member, "selected_objects") || CTX_data_equals(member, "selected_bases")) { int selected_objects= CTX_data_equals(member, "selected_objects"); for(base=scene->base.first; base; base=base->next) { diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index e4c17e080b7..f28f00e9c02 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -875,6 +875,19 @@ static PyObject *pyrna_struct_dir(BPy_StructRNA * self) RNA_property_collection_end(&iter); } + + if(self->ptr.type == &RNA_Context) { + ListBase lb = CTX_data_dir_get(self->ptr.data); + LinkData *link; + + for(link=lb.first; link; link=link->next) { + pystring = PyUnicode_FromString(link->data); + PyList_Append(ret, pystring); + Py_DECREF(pystring); + } + + BLI_freelistN(&lb); + } return ret; } -- cgit v1.2.3 From 823a7ce3d3b6cde3f99ed660f002c61502ba7736 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 20 Jun 2009 15:06:18 +0000 Subject: RNA: added MeshVertex.normal. --- source/blender/makesrna/intern/rna_mesh.c | 16 ++++++++++------ source/blender/makesrna/intern/rna_object.c | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 5634740a4e6..da90b9f4c76 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -38,11 +38,14 @@ #ifdef RNA_RUNTIME -/*static float rna_MeshVertex_no_get(PointerRNA *ptr, int index) +static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value) { MVert *mvert= (MVert*)ptr->data; - return mvert->no[index]/32767.0f; -}*/ + + value[0]= mvert->no[0]/32767.0f; + value[1]= mvert->no[1]/32767.0f; + value[2]= mvert->no[2]/32767.0f; +} static float rna_MeshVertex_bevel_weight_get(PointerRNA *ptr) { @@ -629,10 +632,11 @@ static void rna_def_mvert(BlenderRNA *brna) prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR); RNA_def_property_ui_text(prop, "Location", ""); - /*prop= RNA_def_property(srna, "no", PROP_FLOAT, PROP_VECTOR); - RNA_def_property_float_funcs(prop, "rna_MeshVertex_no_get", NULL, NULL); + prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_VECTOR); + RNA_def_property_float_sdna(prop, NULL, "no"); + RNA_def_property_float_funcs(prop, "rna_MeshVertex_normal_get", NULL, NULL); RNA_def_property_ui_text(prop, "Normal", "Vertex Normal"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE);*/ + RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 435a9e0f0a4..9e8dbbb12b3 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -92,7 +92,7 @@ static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value) ob->data= id; test_object_materials(id); - if(GS(id->name)==ID_CU ) + if(GS(id->name)==ID_CU) test_curve_type(ob); else if(ob->type==OB_ARMATURE) armature_rebuild_pose(ob, ob->data); -- cgit v1.2.3 From 001dab25d448e5aea93f7ee7026eb52f3230b927 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sat, 20 Jun 2009 20:29:25 +0000 Subject: 2.5/Sculpt: Added a clay brush. It behaves like a combination of the flatten and draw brushes. Credit to Fredrik Hannson for the original patch (#18666) --- source/blender/editors/sculpt_paint/sculpt.c | 22 ++++++++++++++++------ .../blender/editors/space_view3d/view3d_buttons.c | 7 ++++--- source/blender/makesdna/DNA_brush_types.h | 1 + 3 files changed, 21 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 7703dc0c303..fa33e214737 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -248,8 +248,9 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache) switch(sd->brush->sculpt_tool){ case SCULPT_TOOL_DRAW: case SCULPT_TOOL_INFLATE: - return alpha * dir * pressure * flip; /*XXX: not sure why? was multiplied by G.vd->grid */; + case SCULPT_TOOL_CLAY: case SCULPT_TOOL_FLATTEN: + return alpha * dir * pressure * flip; /*XXX: not sure why? was multiplied by G.vd->grid */; case SCULPT_TOOL_SMOOTH: return alpha * 4 * pressure; case SCULPT_TOOL_PINCH: @@ -552,7 +553,7 @@ static void calc_flatten_center(SculptSession *ss, ActiveData *node, float co[3] VecMulf(co, 1.0f / FLATTEN_SAMPLE_SIZE); } -static void do_flatten_brush(Sculpt *sd, SculptSession *ss, const ListBase *active_verts) +static void do_flatten_clay_brush(Sculpt *sd, SculptSession *ss, const ListBase *active_verts, int clay) { ActiveData *node= active_verts->first; /* area_normal and cntr define the plane towards which vertices are squashed */ @@ -575,16 +576,23 @@ static void do_flatten_brush(Sculpt *sd, SculptSession *ss, const ListBase *acti VecAddf(intr, intr, p1); VecSubf(val, intr, co); - VecMulf(val, node->Fade); + VecMulf(val, fabs(node->Fade)); VecAddf(val, val, co); + if(clay) { + /* Clay brush displaces after flattening */ + float tmp[3]; + VecCopyf(tmp, area_normal); + VecMulf(tmp, ss->cache->radius * node->Fade * 0.1); + VecAddf(val, val, tmp); + } + sculpt_clip(ss->cache, co, val); node= node->next; } } - - + /* Uses symm to selectively flip any axis of a coordinate. */ static void flip_coord(float out[3], float in[3], const char symm) { @@ -852,8 +860,10 @@ static void do_brush_action(Sculpt *sd, StrokeCache *cache) do_layer_brush(sd, ss, &active_verts); break; case SCULPT_TOOL_FLATTEN: - do_flatten_brush(sd, ss, &active_verts); + do_flatten_clay_brush(sd, ss, &active_verts, 0); break; + case SCULPT_TOOL_CLAY: + do_flatten_clay_brush(sd, ss, &active_verts, 1); } /* Copy the modified vertices from mesh to the active key */ diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 3146b8b45ae..b6e9e05b120 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1132,9 +1132,10 @@ static void view3d_panel_brush(const bContext *C, Panel *pa) uiDefButC(block,ROW,B_REDR,"Pinch",cx+134,cy,67,19,&br->sculpt_tool,14.0,SCULPT_TOOL_PINCH,0,0,"Interactively pinch areas of the model"); uiDefButC(block,ROW,B_REDR,"Inflate",cx+201,cy,67,19,&br->sculpt_tool,14,SCULPT_TOOL_INFLATE,0,0,"Push vertices along the direction of their normals"); cy-= 20; - uiDefButC(block,ROW,B_REDR,"Grab", cx,cy,89,19,&br->sculpt_tool,14,SCULPT_TOOL_GRAB,0,0,"Grabs a group of vertices and moves them with the mouse"); - uiDefButC(block,ROW,B_REDR,"Layer", cx+89,cy,89,19,&br->sculpt_tool,14, SCULPT_TOOL_LAYER,0,0,"Adds a layer of depth"); - uiDefButC(block,ROW,B_REDR,"Flatten", cx+178,cy,90,19,&br->sculpt_tool,14, SCULPT_TOOL_FLATTEN,0,0,"Interactively flatten areas of the model"); + uiDefButC(block,ROW,B_REDR,"Grab", cx,cy,67,19,&br->sculpt_tool,14,SCULPT_TOOL_GRAB,0,0,"Grabs a group of vertices and moves them with the mouse"); + uiDefButC(block,ROW,B_REDR,"Layer", cx+67,cy,67,19,&br->sculpt_tool,14, SCULPT_TOOL_LAYER,0,0,"Adds a layer of depth"); + uiDefButC(block,ROW,B_REDR,"Flatten", cx+134,cy,67,19,&br->sculpt_tool,14, SCULPT_TOOL_FLATTEN,0,0,"Interactively flatten areas of the model"); + uiDefButC(block,ROW,B_REDR,"Clay", cx+201,cy,67,19,&br->sculpt_tool,14, SCULPT_TOOL_CLAY,0,0,"Build up depth quickly"); cy-= 25; uiBlockEndAlign(block); } diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 88520a12e75..8ce0b439b29 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -108,6 +108,7 @@ typedef struct Brush { #define SCULPT_TOOL_GRAB 5 #define SCULPT_TOOL_LAYER 6 #define SCULPT_TOOL_FLATTEN 7 +#define SCULPT_TOOL_CLAY 8 #define PAINT_TOOL_DRAW 0 #define PAINT_TOOL_SOFTEN 1 -- cgit v1.2.3 From 6bca54aac17212f9c40b0a54a50a6c39e0817815 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 21 Jun 2009 02:03:50 +0000 Subject: NLA SoC: Click-Select Operator and TweakMode To make TweakMode seem less modal/blocking, selection now works in TweakMode. The caveat though, is that TweakMode must be immediately exited as a result of this, or else the internal state could become rather inconsistent and confused. All other operators will still continue to operate as per normal though, since in TweakMode, some operations are still very dangerous. --- source/blender/editors/space_nla/nla_select.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index ee4ed01ab81..28027d0d9cd 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -365,7 +365,7 @@ static EnumPropertyItem prop_nlaedit_leftright_select_types[] = { {NLAEDIT_LRSEL_NONE, "OFF", 0, "Don't select", ""}, {NLAEDIT_LRSEL_LEFT, "LEFT", 0, "Before current frame", ""}, {NLAEDIT_LRSEL_RIGHT, "RIGHT", 0, "After current frame", ""}, - {0, NULL, NULL, NULL} + {0, NULL, 0, NULL, NULL} }; /* sensitivity factor for frame-selections */ @@ -375,13 +375,14 @@ static EnumPropertyItem prop_nlaedit_leftright_select_types[] = { /* ------------------- */ /* option 1) select strip directly under mouse */ -static void mouse_nla_strips (bAnimContext *ac, int mval[2], short select_mode) +static void mouse_nla_strips (bContext *C, bAnimContext *ac, int mval[2], short select_mode) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale = NULL; int filter; View2D *v2d= &ac->ar->v2d; + Scene *scene= ac->scene; NlaStrip *strip = NULL; int channel_index; float xmin, xmax, dummy; @@ -429,6 +430,12 @@ static void mouse_nla_strips (bAnimContext *ac, int mval[2], short select_mode) BLI_freelistN(&anim_data); } + /* if currently in tweakmode, exit tweakmode before changing selection states + * now that we've found our target... + */ + if (scene->flag & SCE_NLA_EDIT_ON) + WM_operator_name_call(C, "NLAEDIT_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, NULL); + /* for replacing selection, firstly need to clear existing selection */ if (select_mode == SELECT_REPLACE) { /* reset selection mode for next steps */ @@ -470,7 +477,7 @@ static void mouse_nla_strips (bAnimContext *ac, int mval[2], short select_mode) } /* Option 2) Selects all the strips on either side of the current frame (depends on which side the mouse is on) */ -static void nlaedit_mselect_leftright (bAnimContext *ac, short leftright, short select_mode) +static void nlaedit_mselect_leftright (bContext *C, bAnimContext *ac, short leftright, short select_mode) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; @@ -479,6 +486,10 @@ static void nlaedit_mselect_leftright (bAnimContext *ac, short leftright, short Scene *scene= ac->scene; float xmin, xmax; + /* if currently in tweakmode, exit tweakmode first */ + if (scene->flag & SCE_NLA_EDIT_ON) + WM_operator_name_call(C, "NLAEDIT_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, NULL); + /* if select mode is replace, deselect all keyframes (and channels) first */ if (select_mode==SELECT_REPLACE) { select_mode= SELECT_ADD; @@ -564,11 +575,11 @@ static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even else RNA_int_set(op->ptr, "left_right", NLAEDIT_LRSEL_RIGHT); - nlaedit_mselect_leftright(&ac, RNA_enum_get(op->ptr, "left_right"), selectmode); + nlaedit_mselect_leftright(C, &ac, RNA_enum_get(op->ptr, "left_right"), selectmode); } else { /* select strips based upon mouse position */ - mouse_nla_strips(&ac, mval, selectmode); + mouse_nla_strips(C, &ac, mval, selectmode); } /* set notifier that things have changed */ @@ -586,7 +597,7 @@ void NLAEDIT_OT_click_select (wmOperatorType *ot) /* api callbacks - absolutely no exec() this yet... */ ot->invoke= nlaedit_clickselect_invoke; - ot->poll= nlaop_poll_tweakmode_off; + ot->poll= ED_operator_nla_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; -- cgit v1.2.3 From 984ab796298bac49ea7519ee7c4efbccabf3a35b Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sun, 21 Jun 2009 02:51:42 +0000 Subject: 2.5/Multires: Bugfix for loading older files with the pre-modifier multires. --- source/blender/blenkernel/intern/multires.c | 6 ++++-- source/blender/blenloader/intern/readfile.c | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index b1387281cf5..5def910ddef 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -1270,8 +1270,10 @@ void multires_free(Multires *mr) if(lvl) { CustomData_free(&mr->vdata, lvl->totvert); CustomData_free(&mr->fdata, lvl->totface); - MEM_freeN(mr->edge_flags); - MEM_freeN(mr->edge_creases); + if(mr->edge_flags) + MEM_freeN(mr->edge_flags); + if(mr->edge_creases) + MEM_freeN(mr->edge_creases); } while(lvl) { diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 1502b475350..a4856944d8a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3142,10 +3142,8 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh) direct_link_dverts(fd, lvl->totvert, CustomData_get(&mesh->mr->vdata, 0, CD_MDEFORMVERT)); direct_link_customdata(fd, &mesh->mr->fdata, lvl->totface); - if(!mesh->mr->edge_flags) - mesh->mr->edge_flags= MEM_callocN(sizeof(short)*lvl->totedge, "Multires Edge Flags"); - if(!mesh->mr->edge_creases) - mesh->mr->edge_creases= MEM_callocN(sizeof(char)*lvl->totedge, "Multires Edge Creases"); + mesh->mr->edge_flags= newdataadr(fd, mesh->mr->edge_flags); + mesh->mr->edge_creases= newdataadr(fd, mesh->mr->edge_creases); mesh->mr->verts = newdataadr(fd, mesh->mr->verts); -- cgit v1.2.3 From ed316ad8e967b85a79bb67b79ffc5e3cd90820a5 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 21 Jun 2009 03:02:40 +0000 Subject: NLA SoC: Fixes for Operator Poll Callbacks * Clicking on NLA tracks while in TweakMode now works so that channels can be muted/protected/expanded as per usual. However, they cannot be selected, as changing the selection state can interfere with TweakMode state changes * Operators for animation channel-lists now use proper poll callbacks, which also take into account TweakMode where appropriate (i.e. all selection operators are now allowed to operate in NLA while in TweakMode, and all other operators will only work in Animation Editors) * Action Editor operators now use the poll callback for Action Editors/DopeSheet instead of the generic active-araa one. --- source/blender/editors/animation/anim_channels.c | 59 ++++++++++++++++++---- source/blender/editors/space_action/action_edit.c | 30 +++++------ .../blender/editors/space_action/action_select.c | 8 +-- source/blender/editors/space_nla/nla_channels.c | 16 +++--- source/blender/editors/space_nla/nla_edit.c | 2 +- source/blender/editors/space_nla/nla_intern.h | 2 + source/blender/editors/space_nla/nla_ops.c | 12 ++++- 7 files changed, 91 insertions(+), 38 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index d753f65ff50..9230cdfc9a2 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -271,6 +271,47 @@ void ANIM_deselect_anim_channels (void *data, short datatype, short test, short /* ************************************************************************** */ /* OPERATORS */ +/* ****************** Operator Utilities ********************************** */ + +/* poll callback for being in an Animation Editor channels list region */ +int animedit_poll_channels_active (bContext *C) +{ + ScrArea *sa= CTX_wm_area(C); + + /* channels region test */ + // TODO: could enhance with actually testing if channels region? + if (ELEM(NULL, sa, CTX_wm_region(C))) + return 0; + /* animation editor test */ + if (ELEM3(sa->spacetype, SPACE_ACTION, SPACE_IPO, SPACE_NLA) == 0) + return 0; + + return 1; +} + +/* poll callback for Animation Editor channels list region + not in NLA-tweakmode for NLA */ +int animedit_poll_channels_nla_tweakmode_off (bContext *C) +{ + ScrArea *sa= CTX_wm_area(C); + Scene *scene = CTX_data_scene(C); + + /* channels region test */ + // TODO: could enhance with actually testing if channels region? + if (ELEM(NULL, sa, CTX_wm_region(C))) + return 0; + /* animation editor test */ + if (ELEM3(sa->spacetype, SPACE_ACTION, SPACE_IPO, SPACE_NLA) == 0) + return 0; + + /* NLA TweakMode test */ + if (sa->spacetype == SPACE_NLA) { + if ((scene == NULL) || (scene->flag & SCE_NLA_EDIT_ON)) + return 0; + } + + return 1; +} + /* ****************** Rearrange Channels Operator ******************* */ /* This operator only works for Action Editor mode for now, as having it elsewhere makes things difficult */ @@ -961,7 +1002,7 @@ void ANIM_OT_channels_setting_enable (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= animchannels_setflag_exec; - ot->poll= ED_operator_areaactive; + ot->poll= animedit_poll_channels_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -982,7 +1023,7 @@ void ANIM_OT_channels_setting_disable (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= animchannels_setflag_exec; - ot->poll= ED_operator_areaactive; + ot->poll= animedit_poll_channels_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1003,7 +1044,7 @@ void ANIM_OT_channels_setting_toggle (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= animchannels_setflag_exec; - ot->poll= ED_operator_areaactive; + ot->poll= animedit_poll_channels_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1024,7 +1065,7 @@ void ANIM_OT_channels_editable_toggle (wmOperatorType *ot) /* api callbacks */ ot->exec= animchannels_setflag_exec; - ot->poll= ED_operator_areaactive; + ot->poll= animedit_poll_channels_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1068,7 +1109,7 @@ void ANIM_OT_channels_expand (wmOperatorType *ot) /* api callbacks */ ot->exec= animchannels_expand_exec; - ot->poll= ED_operator_areaactive; + ot->poll= animedit_poll_channels_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1109,7 +1150,7 @@ void ANIM_OT_channels_collapse (wmOperatorType *ot) /* api callbacks */ ot->exec= animchannels_collapse_exec; - ot->poll= ED_operator_areaactive; + ot->poll= animedit_poll_channels_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1148,7 +1189,7 @@ void ANIM_OT_channels_select_all_toggle (wmOperatorType *ot) /* api callbacks */ ot->exec= animchannels_deselectall_exec; - ot->poll= ED_operator_areaactive; + ot->poll= animedit_poll_channels_nla_tweakmode_off; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1277,7 +1318,7 @@ void ANIM_OT_channels_select_border(wmOperatorType *ot) ot->exec= animchannels_borderselect_exec; ot->modal= WM_border_select_modal; - ot->poll= ED_operator_areaactive; + ot->poll= animedit_poll_channels_nla_tweakmode_off; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1636,7 +1677,7 @@ void ANIM_OT_channels_click (wmOperatorType *ot) /* api callbacks */ ot->invoke= animchannels_mouseclick_invoke; - ot->poll= ED_operator_areaactive; + ot->poll= animedit_poll_channels_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index a0f1adbd97e..27be82ccec0 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -181,7 +181,7 @@ void ACT_OT_previewrange_set (wmOperatorType *ot) /* api callbacks */ ot->exec= actkeys_previewrange_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -228,7 +228,7 @@ void ACT_OT_view_all (wmOperatorType *ot) /* api callbacks */ ot->exec= actkeys_viewall_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -315,7 +315,7 @@ void ACT_OT_keyframes_copy (wmOperatorType *ot) /* api callbacks */ ot->exec= actkeys_copy_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -359,7 +359,7 @@ void ACT_OT_keyframes_paste (wmOperatorType *ot) /* api callbacks */ ot->exec= actkeys_paste_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -456,7 +456,7 @@ void ACT_OT_keyframes_insert (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= actkeys_insertkey_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -533,7 +533,7 @@ void ACT_OT_keyframes_duplicate (wmOperatorType *ot) /* api callbacks */ ot->invoke= actkeys_duplicate_invoke; ot->exec= actkeys_duplicate_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -600,7 +600,7 @@ void ACT_OT_keyframes_delete (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_operator_confirm; ot->exec= actkeys_delete_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -663,7 +663,7 @@ void ACT_OT_keyframes_clean (wmOperatorType *ot) /* api callbacks */ //ot->invoke= // XXX we need that number popup for this! ot->exec= actkeys_clean_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -786,7 +786,7 @@ void ACT_OT_keyframes_sample (wmOperatorType *ot) /* api callbacks */ ot->exec= actkeys_sample_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -862,7 +862,7 @@ void ACT_OT_keyframes_extrapolation_type_set (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= actkeys_expo_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -932,7 +932,7 @@ void ACT_OT_keyframes_interpolation_type (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= actkeys_ipo_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1020,7 +1020,7 @@ void ACT_OT_keyframes_handle_type_set (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= actkeys_handletype_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1079,7 +1079,7 @@ void ACT_OT_keyframes_cfrasnap (wmOperatorType *ot) /* api callbacks */ ot->exec= actkeys_cfrasnap_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1175,7 +1175,7 @@ void ACT_OT_keyframes_snap (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= actkeys_snap_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1291,7 +1291,7 @@ void ACT_OT_keyframes_mirror (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= actkeys_mirror_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 6bfdf77e2e7..f99a08bc26d 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -187,7 +187,7 @@ void ACT_OT_keyframes_select_all_toggle (wmOperatorType *ot) /* api callbacks */ ot->exec= actkeys_deselectall_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -349,7 +349,7 @@ void ACT_OT_keyframes_select_border(wmOperatorType *ot) ot->exec= actkeys_borderselect_exec; ot->modal= WM_border_select_modal; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -563,7 +563,7 @@ void ACT_OT_keyframes_select_column (wmOperatorType *ot) /* api callbacks */ ot->exec= actkeys_columnselect_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -968,7 +968,7 @@ void ACT_OT_keyframes_clickselect (wmOperatorType *ot) /* api callbacks - absolutely no exec() this yet... */ ot->invoke= actkeys_clickselect_invoke; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_action_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index f928daa523b..a1c0de1e552 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -143,7 +143,7 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh /* toggle expand */ ob->nlaflag ^= OB_ADS_COLLAPSED; // XXX } - else { + else if (nlaedit_is_tweakmode_on(ac) == 0) { /* set selection status */ if (selectmode == SELECT_INVERT) { /* swap select */ @@ -242,7 +242,7 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh /* toggle 'solo' */ BKE_nlatrack_solo_toggle(adt, nlt); } - else { + else if (nlaedit_is_tweakmode_on(ac) == 0) { /* set selection */ if (selectmode == SELECT_INVERT) { /* inverse selection status of this F-Curve only */ @@ -266,10 +266,12 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh /* for now, only do something if user clicks on the 'push-down' button */ if (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) { - /* activate push-down function */ - // TODO: make this use the operator instead of calling the function directly - // however, calling the operator requires that we supply the args, and that works with proper buttons only - BKE_nla_action_pushdown(adt); + /* activate push-down function - only usable when not in TweakMode */ + if (nlaedit_is_tweakmode_on(ac) == 0) { + // TODO: make this use the operator instead of calling the function directly + // however, calling the operator requires that we supply the args, and that works with proper buttons only + BKE_nla_action_pushdown(adt); + } } } break; @@ -339,7 +341,7 @@ void NLA_OT_channels_click (wmOperatorType *ot) /* api callbacks */ ot->invoke= nlachannels_mouseclick_invoke; - ot->poll= nlaop_poll_tweakmode_off; // xxx? + ot->poll= ED_operator_nla_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index ebb0589a82d..70a033052bd 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -625,7 +625,7 @@ static int nlaedit_split_exec (bContext *C, wmOperator *op) filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - /* for each NLA-Track, delete all selected strips */ + /* for each NLA-Track, split all selected strips into two strips */ for (ale= anim_data.first; ale; ale= ale->next) { NlaTrack *nlt= (NlaTrack *)ale->data; NlaStrip *strip, *nstrip, *next; diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 1237542172f..79ee5396f36 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -113,6 +113,8 @@ void NLA_OT_add_tracks(wmOperatorType *ot); int nlaop_poll_tweakmode_off(bContext *C); int nlaop_poll_tweakmode_on (bContext *C); +short nlaedit_is_tweakmode_on(bAnimContext *ac); + /* --- */ void nla_operatortypes(void); diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 52b529661cb..df731e9d0fb 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -113,6 +113,14 @@ int nlaop_poll_tweakmode_on (bContext *C) return 1; } +/* is tweakmode enabled - for use in NLA operator code */ +short nlaedit_is_tweakmode_on (bAnimContext *ac) +{ + if (ac && ac->scene) + return (ac->scene->flag & SCE_NLA_EDIT_ON); + return 0; +} + /* ************************** registration - operator types **********************************/ void nla_operatortypes(void) @@ -160,10 +168,10 @@ static void nla_keymap_channels (wmWindowManager *wm, ListBase *keymap) /* General Animation Channels keymap (see anim_channels.c) ----------------------- */ /* selection */ - /* borderselect */ + /* borderselect - not in tweakmode */ WM_keymap_add_item(keymap, "ANIM_OT_channels_select_border", BKEY, KM_PRESS, 0, 0); - /* deselect all */ + /* deselect all - not in tweakmode */ WM_keymap_add_item(keymap, "ANIM_OT_channels_select_all_toggle", AKEY, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); -- cgit v1.2.3 From 64274de2fe8ef3b9a98a5cb3bd7d691fa1cee600 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sun, 21 Jun 2009 03:34:30 +0000 Subject: 2.5/Sculpt: Fix for the poll used for the operator to set the brush curve to a preset. The 3 brush curve presets in the Sculpt menu are now functional. --- source/blender/editors/sculpt_paint/sculpt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index fa33e214737..b61141ab62e 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1192,6 +1192,11 @@ void sculptmode_draw_mesh(int only_damaged) } #endif +static int sculpt_mode_poll(bContext *C) +{ + return G.f & G_SCULPTMODE; +} + static int sculpt_poll(bContext *C) { return G.f & G_SCULPTMODE && CTX_wm_area(C)->spacetype == SPACE_VIEW3D && @@ -1269,7 +1274,7 @@ static void SCULPT_OT_brush_curve_preset(wmOperatorType *ot) ot->idname= "SCULPT_OT_brush_curve_preset"; ot->exec= sculpt_brush_curve_preset_exec; - ot->poll= sculpt_poll; + ot->poll= sculpt_mode_poll; ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; -- cgit v1.2.3 From 6b15024f4a7b999331694d8a9135d47e4b783a34 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sun, 21 Jun 2009 10:16:52 +0000 Subject: Pointcache refresh part 1: * Particles support larger than 1 frame changes, bigger frame changes can result in inaccurate results, but it's super fast and you get a nice feeling of how the particles behave! * "Cache to current frame" button calculates the exact result of particles at current frame. * Current state of cache can be protected by making it a bake. * Cache is now in memory by default, disk cache is an option. * Only "viewport %" number of particles are calculated and cached in viewport, baking and rendering calculate all particles. * Info on cached frames and memory usage given in ui. * Support for exact "autocaching" of changes and large frame changes(disabled for now until exact place in event system is decided) * "Continue physics" is probably deprecated after this and should be removed once sb & cloth use the new cache code. Todo: * Make softbody & cloth use the new cache things. Other changes: * Some cleanup of particle buttons. --- source/blender/blenkernel/BKE_particle.h | 5 + source/blender/blenkernel/BKE_pointcache.h | 56 +- source/blender/blenkernel/intern/depsgraph.c | 18 +- source/blender/blenkernel/intern/particle.c | 48 +- source/blender/blenkernel/intern/particle_system.c | 187 +++-- source/blender/blenkernel/intern/pointcache.c | 753 +++++++++++++++++++-- source/blender/blenloader/intern/readfile.c | 24 +- source/blender/blenloader/intern/writefile.c | 20 +- source/blender/editors/include/ED_pointcache.h | 38 ++ source/blender/editors/physics/ed_pointcache.c | 270 ++++++++ source/blender/editors/space_api/spacetypes.c | 2 + .../editors/transform/transform_conversions.c | 2 +- source/blender/makesdna/DNA_object_force.h | 19 +- source/blender/makesrna/intern/rna_object_force.c | 105 +++ source/blender/makesrna/intern/rna_particle.c | 86 ++- source/blender/render/intern/source/pipeline.c | 18 + 16 files changed, 1489 insertions(+), 162 deletions(-) create mode 100644 source/blender/editors/include/ED_pointcache.h create mode 100644 source/blender/editors/physics/ed_pointcache.c (limited to 'source') diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index 4efd9a7f8ba..0ecd71fc4a3 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -217,6 +217,7 @@ char *psys_menu_string(struct Object *ob, int for_sb); struct ParticleSystem *psys_get_current(struct Object *ob); short psys_get_current_num(struct Object *ob); +struct Object *psys_find_object(struct Scene *scene, struct ParticleSystem *psys); //struct ParticleSystem *psys_get(struct Object *ob, int index); struct ParticleData *psys_get_selected_particle(struct ParticleSystem *psys, int *index); struct ParticleKey *psys_get_selected_key(struct ParticleSystem *psys, int pa_index, int *key_index); @@ -251,6 +252,7 @@ struct ParticleSystemModifierData *psys_get_modifier(struct Object *ob, struct P struct ParticleSettings *psys_new_settings(char *name, struct Main *main); struct ParticleSettings *psys_copy_settings(struct ParticleSettings *part); +int psys_count_autocache(struct Scene *scene, struct ParticleSettings *part); void psys_flush_particle_settings(struct Scene *scene, struct ParticleSettings *part, int recalc); void make_local_particlesettings(struct ParticleSettings *part); @@ -290,10 +292,13 @@ void psys_get_reactor_target(struct Object *ob, struct ParticleSystem *psys, str void psys_init_effectors(struct Scene *scene, struct Object *obsrc, struct Group *group, struct ParticleSystem *psys); void psys_end_effectors(struct ParticleSystem *psys); +void psys_get_pointcache_start_end(struct Scene *scene, struct ParticleSystem *psys, int *sfra, int *efra); + void particle_system_update(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys); /* ----------- functions needed only inside particlesystem ------------ */ /* particle.c */ +void psys_interpolate_particle(short type, struct ParticleKey keys[4], float dt, struct ParticleKey *result, int velocity); void psys_key_to_object(struct Object *ob, struct ParticleKey *key, float imat[][4]); //void psys_key_to_geometry(struct DerivedMesh *dm, struct ParticleData *pa, struct ParticleKey *key); //void psys_key_from_geometry(struct DerivedMesh *dm, struct ParticleData *pa, struct ParticleKey *key); diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index 8ef3ff4d4b7..b79357edf36 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -31,6 +31,8 @@ #include "DNA_ID.h" +#include "MEM_guardedalloc.h" + /* Point cache clearing option, for BKE_ptcache_id_clear, before * and after are non inclusive (they wont remove the cfra) */ #define PTCACHE_CLEAR_ALL 0 @@ -42,6 +44,7 @@ #define PTCACHE_RESET_DEPSGRAPH 0 #define PTCACHE_RESET_BAKED 1 #define PTCACHE_RESET_OUTDATED 2 +#define PTCACHE_RESET_FREE 3 /* Add the blendfile name after blendcache_ */ #define PTCACHE_EXT ".bphys" @@ -56,6 +59,11 @@ #define PTCACHE_TYPE_PARTICLES 1 #define PTCACHE_TYPE_CLOTH 2 +/* PTCache read return code */ +#define PTCACHE_READ_EXACT 1 +#define PTCACHE_READ_INTERPOLATED 2 +#define PTCACHE_READ_OLD 3 + /* Structs */ struct Object; struct Scene; @@ -80,6 +88,41 @@ typedef struct PTCacheID { struct PointCache *cache; } PTCacheID; +typedef struct PTCacheWriter { + struct PTCacheID *pid; + int cfra; + int totelem; + + float *(*elem_ptr)(int index, void *calldata); + void *calldata; +} PTCacheWriter; + +typedef struct PTCacheReader { + struct Scene *scene; + struct PTCacheID *pid; + float cfra; + int totelem; + + void (*set_elem)(int index, void *calldata, float *data); + void (*interpolate_elem)(int index, void *calldata, float frs_sec, float cfra, int cfra1, int cfra2, float *data1, float *data2); + void *calldata; + + int allow_interpolate; + int allow_old; + int *old_frame; +} PTCacheReader; + +typedef struct PTCacheBaker { + struct Scene *scene; + int bake; + int render; + struct PTCacheID *pid; + int (*break_test)(void *data); + void *break_data; + void (*progressbar)(void *data, int num); + void *progresscontext; +} PTCacheBaker; + /* Creating ID's */ void BKE_ptcache_id_from_softbody(PTCacheID *pid, struct Object *ob, struct SoftBody *sb); void BKE_ptcache_id_from_particles(PTCacheID *pid, struct Object *ob, struct ParticleSystem *psys); @@ -93,9 +136,9 @@ void BKE_ptcache_remove(void); /* ID specific functions */ void BKE_ptcache_id_clear(PTCacheID *id, int mode, int cfra); int BKE_ptcache_id_exist(PTCacheID *id, int cfra); -int BKE_ptcache_id_reset(PTCacheID *id, int mode); +int BKE_ptcache_id_reset(struct Scene *scene, PTCacheID *id, int mode); void BKE_ptcache_id_time(PTCacheID *pid, struct Scene *scene, float cfra, int *startframe, int *endframe, float *timescale); -int BKE_ptcache_object_reset(struct Object *ob, int mode); +int BKE_ptcache_object_reset(struct Scene *scene, struct Object *ob, int mode); /* File reading/writing */ PTCacheFile *BKE_ptcache_file_open(PTCacheID *id, int mode, int cfra); @@ -103,6 +146,10 @@ void BKE_ptcache_file_close(PTCacheFile *pf); int BKE_ptcache_file_read_floats(PTCacheFile *pf, float *f, int tot); int BKE_ptcache_file_write_floats(PTCacheFile *pf, float *f, int tot); +/* General cache reading/writing */ +int BKE_ptcache_read_cache(PTCacheReader *reader); +int BKE_ptcache_write_cache(PTCacheWriter *writer); + /* Continue physics */ void BKE_ptcache_set_continue_physics(struct Scene *scene, int enable); int BKE_ptcache_get_continue_physics(void); @@ -112,4 +159,9 @@ struct PointCache *BKE_ptcache_add(void); void BKE_ptcache_free(struct PointCache *cache); struct PointCache *BKE_ptcache_copy(struct PointCache *cache); +/* Baking */ +void BKE_ptcache_autocache_all(struct Scene *scene); +void BKE_ptcache_make_cache(struct PTCacheBaker* baker); +void BKE_ptcache_toggle_disk_cache(struct PTCacheID *pid); + #endif diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 8bb34bde122..b57b8b7a6da 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -1831,7 +1831,7 @@ static unsigned int flush_layer_node(Scene *sce, DagNode *node, int curtime) } /* node was checked to have lasttime != curtime , and is of type ID_OB */ -static void flush_pointcache_reset(DagNode *node, int curtime, int reset) +static void flush_pointcache_reset(Scene *scene, DagNode *node, int curtime, int reset) { DagAdjList *itA; Object *ob; @@ -1844,13 +1844,13 @@ static void flush_pointcache_reset(DagNode *node, int curtime, int reset) ob= (Object*)(node->ob); if(reset || (ob->recalc & OB_RECALC)) { - if(BKE_ptcache_object_reset(ob, PTCACHE_RESET_DEPSGRAPH)) + if(BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH)) ob->recalc |= OB_RECALC_DATA; - flush_pointcache_reset(itA->node, curtime, 1); + flush_pointcache_reset(scene, itA->node, curtime, 1); } else - flush_pointcache_reset(itA->node, curtime, 0); + flush_pointcache_reset(scene, itA->node, curtime, 0); } } } @@ -1908,13 +1908,13 @@ void DAG_scene_flush_update(Scene *sce, unsigned int lay, int time) ob= (Object*)(itA->node->ob); if(ob->recalc & OB_RECALC) { - if(BKE_ptcache_object_reset(ob, PTCACHE_RESET_DEPSGRAPH)) + if(BKE_ptcache_object_reset(sce, ob, PTCACHE_RESET_DEPSGRAPH)) ob->recalc |= OB_RECALC_DATA; - flush_pointcache_reset(itA->node, lasttime, 1); + flush_pointcache_reset(sce, itA->node, lasttime, 1); } else - flush_pointcache_reset(itA->node, lasttime, 0); + flush_pointcache_reset(sce, itA->node, lasttime, 0); } } } @@ -2132,7 +2132,7 @@ void DAG_object_flush_update(Scene *sce, Object *ob, short flag) if(ob==NULL || sce->theDag==NULL) return; ob->recalc |= flag; - BKE_ptcache_object_reset(ob, PTCACHE_RESET_DEPSGRAPH); + BKE_ptcache_object_reset(sce, ob, PTCACHE_RESET_DEPSGRAPH); /* all users of this ob->data should be checked */ /* BUT! displists for curves are still only on cu */ @@ -2147,7 +2147,7 @@ void DAG_object_flush_update(Scene *sce, Object *ob, short flag) for (obt=G.main->object.first; obt; obt= obt->id.next) { if (obt != ob && obt->data==ob->data) { obt->recalc |= OB_RECALC_DATA; - BKE_ptcache_object_reset(obt, PTCACHE_RESET_DEPSGRAPH); + BKE_ptcache_object_reset(sce, obt, PTCACHE_RESET_DEPSGRAPH); } } } diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 34e69b2d736..5b3720cd6b0 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -222,6 +222,45 @@ short psys_get_current_num(Object *ob) return i; } +Object *psys_find_object(Scene *scene, ParticleSystem *psys) +{ + Base *base = scene->base.first; + ParticleSystem *tpsys; + + for(base = scene->base.first; base; base = base->next) { + for(tpsys = base->object->particlesystem.first; psys; psys=psys->next) { + if(tpsys == psys) + return base->object; + } + } + + return NULL; +} +int psys_count_autocache(Scene *scene, ParticleSettings *part) +{ + Base *base = scene->base.first; + ParticleSystem *psys; + PTCacheID pid; + int autocache_count= 0; + + for(base = scene->base.first; base; base = base->next) { + for(psys = base->object->particlesystem.first; psys; psys=psys->next) { + if(part && psys->part != part) + continue; + + BKE_ptcache_id_from_particles(&pid, base->object, psys); + + if((psys->pointcache->flag & PTCACHE_BAKED) + || (psys->pointcache->flag & PTCACHE_AUTOCACHE)==0) + continue; + + if((psys->pointcache->flag & PTCACHE_OUTDATED) + || BKE_ptcache_id_exist(&pid, CFRA)==0) + autocache_count++; + } + } + return autocache_count; +} /* change object's active particle system */ void psys_change_act(void *ob_v, void *act_v) { @@ -864,7 +903,7 @@ static void weighted_particle_vector(float *v1, float *v2, float *v3, float *v4, vec[1]= weights[0]*v1[1] + weights[1]*v2[1] + weights[2]*v3[1] + weights[3]*v4[1]; vec[2]= weights[0]*v1[2] + weights[1]*v2[2] + weights[2]*v3[2] + weights[3]*v4[2]; } -static void interpolate_particle(short type, ParticleKey keys[4], float dt, ParticleKey *result, int velocity) +void psys_interpolate_particle(short type, ParticleKey keys[4], float dt, ParticleKey *result, int velocity) { float t[4]; @@ -2569,7 +2608,7 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra } /* now we should have in chronologiacl order k1<=k2<=t<=k3<=k4 with keytime between [0,1]->[k2,k3] (k1 & k4 used for cardinal & bspline interpolation)*/ - interpolate_particle((psys->flag & PSYS_KEYED) ? -1 /* signal for cubic interpolation */ + psys_interpolate_particle((psys->flag & PSYS_KEYED) ? -1 /* signal for cubic interpolation */ : ((psys->part->flag & PART_HAIR_BSPLINE) ? KEY_BSPLINE : KEY_CARDINAL) ,keys, keytime, &result, 0); @@ -3062,7 +3101,6 @@ void make_local_particlesettings(ParticleSettings *part) } } } - void psys_flush_particle_settings(Scene *scene, ParticleSettings *part, int recalc) { Base *base = scene->base.first; @@ -3495,7 +3533,7 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i QuatInterpol(state->rot,keys[1].rot,keys[2].rot,keytime); } - interpolate_particle((psys->flag & PSYS_KEYED) ? -1 /* signal for cubic interpolation */ + psys_interpolate_particle((psys->flag & PSYS_KEYED) ? -1 /* signal for cubic interpolation */ : ((psys->part->flag & PART_HAIR_BSPLINE) ? KEY_BSPLINE : KEY_CARDINAL) ,keys, keytime, state, 1); @@ -3776,7 +3814,7 @@ int psys_get_particle_state(struct Scene *scene, Object *ob, ParticleSystem *psy VecMulf(keys[1].vel, dfra / frs_sec); VecMulf(keys[2].vel, dfra / frs_sec); - interpolate_particle(-1, keys, keytime, state, 1); + psys_interpolate_particle(-1, keys, keytime, state, 1); /* convert back to real velocity */ VecMulf(state->vel, frs_sec / dfra); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 52f13eeadb8..fc6413849d1 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -104,7 +104,8 @@ static int get_current_display_percentage(ParticleSystem *psys) { ParticleSettings *part=psys->part; - if(psys->renderdata || (part->child_nbr && part->childtype)) + if(psys->renderdata || (part->child_nbr && part->childtype) + || (psys->pointcache->flag & PTCACHE_BAKING)) return 100; if(part->phystype==PART_PHYS_KEYED){ @@ -2195,57 +2196,80 @@ void psys_get_reactor_target(Object *ob, ParticleSystem *psys, Object **target_o /************************************************/ /* Point Cache */ /************************************************/ - -static void write_particles_to_cache(Object *ob, ParticleSystem *psys, int cfra) +void psys_get_pointcache_start_end(Scene *scene, ParticleSystem *psys, int *sfra, int *efra) { - PTCacheID pid; - PTCacheFile *pf; - ParticleData *pa; - int i, totpart= psys->totpart; + ParticleSettings *part = psys->part; - if(totpart == 0) - return; + *sfra = MAX2(1, (int)part->sta); + *efra = MIN2((int)(part->end + part->lifetime + 1.0), scene->r.efra); +} +static float *particle_state_ptr(int index, ParticleSystem *psys) +{ + return (float *)(&(psys->particles+index)->state); +} +static void particle_read_state(int index, ParticleSystem *psys, float *data) +{ + ParticleData *pa = psys->particles + index; + ParticleKey *key = (ParticleKey *)data; - BKE_ptcache_id_from_particles(&pid, ob, psys); - pf= BKE_ptcache_file_open(&pid, PTCACHE_FILE_WRITE, cfra); - if(!pf) - return; + if(key->time > pa->state.time) + copy_particle_key(&pa->prev_state, &pa->state, 1); - /* assuming struct consists of tightly packed floats */ - for(i=0, pa=psys->particles; istate, sizeof(ParticleKey)/sizeof(float)); - - BKE_ptcache_file_close(pf); + copy_particle_key(&pa->state, key, 1); } +static void particle_cache_interpolate(int index, ParticleSystem *psys, float frs_sec, float cfra, int cfra1, int cfra2, float *data1, float *data2) +{ + ParticleData *pa = psys->particles + index; + ParticleKey keys[4]; + float dfra; + + keys[1] = *((ParticleKey*)data1); + keys[2] = *((ParticleKey*)data2); + + dfra = keys[2].time - keys[1].time; -static int get_particles_from_cache(Object *ob, ParticleSystem *psys, int cfra) + VecMulf(keys[1].vel, dfra / frs_sec); + VecMulf(keys[2].vel, dfra / frs_sec); + + psys_interpolate_particle(-1, keys, (keys[1].time - cfra) / dfra, &pa->state, 1); + + VecMulf(pa->state.vel, frs_sec / dfra); +} +static void write_particles_to_cache(Object *ob, ParticleSystem *psys, int cfra) { + PTCacheWriter writer; PTCacheID pid; - PTCacheFile *pf; - ParticleData *pa; - int i, totpart= psys->totpart; - - if(totpart == 0) - return 0; BKE_ptcache_id_from_particles(&pid, ob, psys); - pf= BKE_ptcache_file_open(&pid, PTCACHE_FILE_READ, cfra); - if(!pf) - return 0; - /* assuming struct consists of tightly packed floats */ - for(i=0, pa=psys->particles; istate.time) - copy_particle_key(&pa->prev_state,&pa->state,1); - if(!BKE_ptcache_file_read_floats(pf, (float*)&pa->state, sizeof(ParticleKey)/sizeof(float))) { - BKE_ptcache_file_close(pf); - return 0; - } - } + writer.calldata = psys; + writer.cfra = cfra; + writer.elem_ptr = particle_state_ptr; + writer.pid = &pid; + writer.totelem = psys->totpart; - BKE_ptcache_file_close(pf); + BKE_ptcache_write_cache(&writer); +} - return 1; +static int get_particles_from_cache(Scene *scene, Object *ob, ParticleSystem *psys, float cfra, int allow_interpolate, int allow_old, int *old_frame) +{ + PTCacheReader reader; + PTCacheID pid; + + BKE_ptcache_id_from_particles(&pid, ob, psys); + + reader.allow_interpolate = allow_interpolate; + reader.allow_old = allow_old; + reader.calldata = psys; + reader.cfra = cfra; + reader.interpolate_elem = particle_cache_interpolate; + reader.old_frame = old_frame; + reader.pid = &pid; + reader.scene = scene; + reader.set_elem = particle_read_state; + reader.totelem = psys->totpart; + + return BKE_ptcache_read_cache(&reader); } /************************************************/ @@ -4085,7 +4109,7 @@ static void dynamics_step(Scene *scene, Object *ob, ParticleSystem *psys, Partic /* main loop: calculate physics for all particles */ for(p=0, pa=psys->particles; pflag & PARS_UNEXIST) continue; + if(pa->flag & (PARS_UNEXIST+PARS_NO_DISP)) continue; copy_particle_key(&pa->prev_state,&pa->state,1); @@ -4110,25 +4134,26 @@ static void dynamics_step(Scene *scene, Object *ob, ParticleSystem *psys, Partic if(pa->alive==PARS_UNBORN || pa->alive==PARS_KILLED || ELEM(part->phystype,PART_PHYS_NO,PART_PHYS_KEYED) - || birthtime >= cfra){ + || birthtime >= psys->cfra){ reset_particle(scene, pa,psys,psmd,ob,dtime,cfra,vg_vel,vg_tan,vg_rot); } pa_dfra = dfra; pa_dtime = dtime; - if(birthtime <= cfra && birthtime >= psys->cfra){ + + if(dietime <= cfra && psys->cfra < dietime){ + /* particle dies some time between this and last step */ + pa_dfra = dietime - ((birthtime > psys->cfra) ? birthtime : psys->cfra); + pa_dtime = pa_dfra * timestep; + pa->alive = PARS_DYING; + } + else if(birthtime <= cfra && birthtime >= psys->cfra){ /* particle is born some time between this and last step*/ pa->alive = PARS_ALIVE; pa_dfra = cfra - birthtime; pa_dtime = pa_dfra*timestep; } - else if(dietime <= cfra && psys->cfra < dietime){ - /* particle dies some time between this and last step */ - pa_dfra = dietime - psys->cfra; - pa_dtime = pa_dfra * timestep; - pa->alive = PARS_DYING; - } else if(dietime < cfra){ /* nothing to be done when particle is dead */ } @@ -4520,7 +4545,7 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle int totpart, oldtotpart, totchild, oldtotchild, p; float disp, *vg_vel= 0, *vg_tan= 0, *vg_rot= 0, *vg_size= 0; int init= 0, distr= 0, alloc= 0, usecache= 0, only_children_changed= 0; - int framenr, framedelta, startframe, endframe; + int framenr, framedelta, startframe, endframe, old_framenr; part= psys->part; cache= psys->pointcache; @@ -4528,6 +4553,10 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle framenr= (int)scene->r.cfra; framedelta= framenr - cache->simframe; + /* set suitable cache range automatically */ + if((cache->flag & (PTCACHE_BAKING|PTCACHE_BAKED))==0) + psys_get_pointcache_start_end(scene, psys, &cache->startframe, &cache->endframe); + BKE_ptcache_id_from_particles(&pid, ob, psys); BKE_ptcache_id_time(&pid, scene, 0.0f, &startframe, &endframe, NULL); @@ -4600,9 +4629,13 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle if(init) { if(distr) { - if(alloc) + if(alloc) { realloc_particles(ob, psys, totpart); + if(usecache) + BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_ALL, 0); + } + distribute_particles(scene, ob, psys, part->from); if((psys->part->type == PART_HAIR) && !(psys->flag & PSYS_HAIR_DONE)) @@ -4616,9 +4649,11 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle free_keyed_keys(psys); initialize_all_particles(ob, psys, psmd); + - if(alloc) + if(alloc) { reset_all_particles(scene, ob, psys, psmd, 0.0, cfra, oldtotpart); + } } /* flag for possible explode modifiers after this system */ @@ -4627,25 +4662,47 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle /* try to read from the cache */ if(usecache) { - if(get_particles_from_cache(ob, psys, framenr)) { - if(part->phystype==PART_PHYS_KEYED && psys->flag&PSYS_FIRST_KEYED) { - psys_count_keyed_targets(ob,psys); - set_keyed_keys(scene, ob, psys); - } + int result = get_particles_from_cache(scene, ob, psys, (float)framenr, 0, 1, &old_framenr); + + if(result == PTCACHE_READ_EXACT) { + //if(part->phystype==PART_PHYS_KEYED && psys->flag&PSYS_FIRST_KEYED) { + // psys_count_keyed_targets(ob,psys); + // set_keyed_keys(scene, ob, psys); + //} cached_step(scene, ob, psmd, psys, cfra); psys->cfra=cfra; psys->recalc = 0; - if(part->phystype==PART_PHYS_KEYED && psys->flag&PSYS_FIRST_KEYED) { - psys_update_path_cache(scene, ob, psmd, psys, framenr); - } + //if(part->phystype==PART_PHYS_KEYED && psys->flag&PSYS_FIRST_KEYED) { + // psys_update_path_cache(scene, ob, psmd, psys, framenr); + //} cache->simframe= framenr; cache->flag |= PTCACHE_SIMULATION_VALID; + if(cache->flag & PTCACHE_OUTDATED) + BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_FREE); + return; } + else if((cache->flag & PTCACHE_AUTOCACHE)==0 && result==PTCACHE_READ_OLD) { + /* clear cache after current frame */ + BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_FREE); + + /* set old cfra */ + psys->cfra = (float)old_framenr; + + for(p=0, pa=psys->particles; ptime > psys->cfra) + pa->alive = PARS_UNBORN; + else if(pa->dietime <= psys->cfra) + pa->alive = PARS_DEAD; + else + pa->alive = PARS_ALIVE; + } + } else if(ob->id.lib || (cache->flag & PTCACHE_BAKED)) { psys_reset(psys, PSYS_RESET_CACHE_MISS); psys->cfra=cfra; @@ -4653,8 +4710,10 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle return; } - if(framenr != startframe && framedelta != 1) { - psys_reset(psys, PSYS_RESET_CACHE_MISS); + if(framenr != startframe && framedelta != 1 && cache->flag & PTCACHE_AUTOCACHE) { + //psys_reset(psys, PSYS_RESET_CACHE_MISS); + /* make sure cache is recalculated */ + BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_FRAME, (int)cfra); psys->cfra = cfra; psys->recalc = 0; return; @@ -4663,10 +4722,11 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle else { cache->flag &= ~PTCACHE_SIMULATION_VALID; cache->simframe= 0; + cache->last_exact= 0; } /* if on second frame, write cache for first frame */ - if(usecache && framenr == startframe+1) + if(usecache && psys->cfra == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0)) write_particles_to_cache(ob, psys, startframe); if(part->phystype==PART_PHYS_KEYED && psys->flag&PSYS_FIRST_KEYED) @@ -4768,8 +4828,7 @@ static void psys_to_softbody(Scene *scene, Object *ob, ParticleSystem *psys) static int hair_needs_recalc(ParticleSystem *psys) { if((psys->flag & PSYS_EDITED)==0 && - ((psys->flag & PSYS_HAIR_DONE)==0 || psys->recalc & PSYS_RECALC_REDO)) { - psys->recalc &= ~PSYS_RECALC_REDO; + ((psys->flag & PSYS_HAIR_DONE)==0 || psys->recalc & PSYS_RECALC_RESET)) { return 1; } diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index b00755f7135..f59336518d7 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -51,9 +51,11 @@ #include "BKE_object.h" #include "BKE_particle.h" #include "BKE_pointcache.h" +#include "BKE_scene.h" #include "BKE_softbody.h" #include "BKE_utildefines.h" +#include "BLI_blenlib.h" /* needed for directory lookup */ #ifndef WIN32 @@ -213,21 +215,29 @@ static int BKE_ptcache_id_filename(PTCacheID *pid, char *filename, int cfra, sho filename[0] = '\0'; newname = filename; - /*if (!G.relbase_valid) return 0; *//* save blend file before using pointcache */ + if (!G.relbase_valid) return 0; /* save blend file before using disk pointcache */ /* start with temp dir */ if (do_path) { len = ptcache_path(pid, filename); newname += len; } - idname = (pid->ob->id.name+2); - /* convert chars to hex so they are always a valid filename */ - while('\0' != *idname) { - snprintf(newname, MAX_PTCACHE_FILE, "%02X", (char)(*idname++)); - newname+=2; - len += 2; + if(strcmp(pid->cache->name, "")==0) { + idname = (pid->ob->id.name+2); + /* convert chars to hex so they are always a valid filename */ + while('\0' != *idname) { + snprintf(newname, MAX_PTCACHE_FILE, "%02X", (char)(*idname++)); + newname+=2; + len += 2; + } } - + else { + int temp = strlen(pid->cache->name); + strcpy(newname, pid->cache->name); + newname+=temp; + len += temp; + } + if (do_ext) { snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02d"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */ len += 16; @@ -247,7 +257,7 @@ PTCacheFile *BKE_ptcache_file_open(PTCacheID *pid, int mode, int cfra) if(pid->ob->id.lib && mode == PTCACHE_FILE_WRITE) return NULL; - /*if (!G.relbase_valid) return NULL; *//* save blend file before using pointcache */ + if (!G.relbase_valid) return NULL; /* save blend file before using disk pointcache */ BKE_ptcache_id_filename(pid, filename, cfra, 1, 1); @@ -286,6 +296,323 @@ int BKE_ptcache_file_write_floats(PTCacheFile *pf, float *f, int tot) return (fwrite(f, sizeof(float), tot, pf->fp) == tot); } +static int ptcache_pid_elemsize(PTCacheID *pid) +{ + if(pid->type==PTCACHE_TYPE_SOFTBODY) + return 0; // TODO + else if(pid->type==PTCACHE_TYPE_PARTICLES) + return sizeof(ParticleKey); + else if(pid->type==PTCACHE_TYPE_CLOTH) + return 0; // TODO + + return 0; +} +static int ptcache_pid_totelem(PTCacheID *pid) +{ + if(pid->type==PTCACHE_TYPE_SOFTBODY) + return 0; // TODO + else if(pid->type==PTCACHE_TYPE_PARTICLES) { + ParticleSystem *psys = pid->data; + return psys->totpart; + } + else if(pid->type==PTCACHE_TYPE_CLOTH) + return 0; // TODO + + return 0; +} + +void ptcache_update_info(PTCacheID *pid) +{ + PointCache *cache = pid->cache; + int totframes = 0; + + if(cache->flag & PTCACHE_DISK_CACHE) { + int cfra = cache->startframe; + + for(; cfra<=cache->endframe; cfra++) { + if(BKE_ptcache_id_exist(pid, cfra)) + totframes++; + } + + sprintf(cache->info, "%i frames on disk.", totframes); + } + else { + PTCacheMem *pm = cache->mem_cache.first; + float framesize = 0.0f, bytes = 0.0f; + int mb; + + if(pm) + framesize = (float)ptcache_pid_elemsize(pid) * (float)pm->totpoint; + + for(; pm; pm=pm->next) + totframes++; + + bytes = totframes * framesize; + + mb = (bytes > 1024.0f * 1024.0f); + + sprintf(cache->info, "%i frames in memory (%.1f %s).", + totframes, + bytes / (mb ? 1024.0f * 1024.0f : 1024.0f), + mb ? "Mb" : "kb"); + } +} +/* reads cache from disk or memory */ +/* possible to get old or interpolated result */ +int BKE_ptcache_read_cache(PTCacheReader *reader) +{ + PTCacheID *pid = reader->pid; + PTCacheFile *pf=NULL, *pf2=NULL; + PTCacheMem *pm=NULL, *pm2=NULL; + int totelem = reader->totelem; + float cfra = reader->cfra; + int cfrai = (int)cfra; + int elemsize = ptcache_pid_elemsize(pid); + int i, incr = elemsize / sizeof(float); + float frs_sec = reader->scene->r.frs_sec; + + if(totelem == 0) + return 0; + + /* first check if we have the actual frame cached */ + if(cfra == (float)cfrai) { + if(pid->cache->flag & PTCACHE_DISK_CACHE) { + pf= BKE_ptcache_file_open(pid, PTCACHE_FILE_READ, cfrai); + } + else { + pm = pid->cache->mem_cache.first; + + for(; pm; pm=pm->next) { + if(pm->frame == cfrai) + break; + } + } + } + + /* if found, use exact frame */ + if(pf || pm) { + float *data; + + if(pm) + data = pm->data; + else + data = MEM_callocN(elemsize, "pointcache read data"); + + for(i=0; iset_elem(i, reader->calldata, data); + } + else { + reader->set_elem(i, reader->calldata, data); + data += incr; + } + } + + if(pf) { + BKE_ptcache_file_close(pf); + MEM_freeN(data); + } + + return PTCACHE_READ_EXACT; + } + /* no exact cache frame found so try to find cached frames around cfra */ + if(reader->allow_interpolate || reader->allow_old) { + int cfra1, cfra2; + + if(pid->cache->flag & PTCACHE_DISK_CACHE) { + pf=NULL; + while(cfrai > pid->cache->startframe && !pf) { + cfrai--; + pf= BKE_ptcache_file_open(pid, PTCACHE_FILE_READ, cfrai); + cfra1 = cfrai; + } + + *(reader->old_frame) = cfrai; + + cfrai = (int)cfra; + while(cfrai < pid->cache->endframe && !pf2) { + cfrai++; + pf2= BKE_ptcache_file_open(pid, PTCACHE_FILE_READ, cfrai); + cfra2 = cfrai; + } + } + else if(pid->cache->mem_cache.first){ + pm = pid->cache->mem_cache.first; + + while(pm->next && pm->next->frame < cfra) + pm= pm->next; + + if(pm) { + *(reader->old_frame) = pm->frame; + cfra1 = pm->frame; + } + + pm2 = pid->cache->mem_cache.last; + + while(pm2->prev && pm2->frame > cfra) + pm2= pm2->prev; + + if(pm2) + cfra2 = pm2->frame; + } + + if(reader->allow_interpolate && ((pf && pf2) || (pm && pm2))) { + /* interpolate from nearest frames */ + float *data1, *data2; + + if(pm) { + data1 = pm->data; + data2 = pm2->data; + } + else { + data1 = MEM_callocN(elemsize, "pointcache read data1"); + data2 = MEM_callocN(elemsize, "pointcache read data2"); + } + + for(i=0; iinterpolate_elem(i, reader->calldata, frs_sec, cfra, cfra1, cfra2, data1, data2); + } + else { + reader->interpolate_elem(i, reader->calldata, frs_sec, cfra, cfra1, cfra2, data1, data2); + data1 += incr; + data2 += incr; + } + } + + if(pf) { + BKE_ptcache_file_close(pf); + BKE_ptcache_file_close(pf2); + MEM_freeN(data1); + MEM_freeN(data2); + } + + return PTCACHE_READ_INTERPOLATED; + } + else if(reader->allow_old && (pf || pm)) { + /* use last valid cache frame */ + float *data; + + if(pm) + data = pm->data; + else + data = MEM_callocN(elemsize, "pointcache read data"); + + for(i=0; iset_elem(i, reader->calldata, data); + } + else { + reader->set_elem(i, reader->calldata, data); + data += incr; + } + } + + if(pf) { + BKE_ptcache_file_close(pf); + MEM_freeN(data); + } + if(pf2) + BKE_ptcache_file_close(pf2); + + return PTCACHE_READ_OLD; + } + } + + if(pf) + BKE_ptcache_file_close(pf); + if(pf2) + BKE_ptcache_file_close(pf2); + + return 0; +} +/* writes cache to disk or memory */ +int BKE_ptcache_write_cache(PTCacheWriter *writer) +{ + PointCache *cache = writer->pid->cache; + PTCacheFile *pf= NULL; + int elemsize = ptcache_pid_elemsize(writer->pid); + int i, incr = elemsize / sizeof(float); + + if(writer->totelem == 0 || writer->cfra <= 0) + return 0; + + if(cache->flag & PTCACHE_DISK_CACHE) { + pf = BKE_ptcache_file_open(writer->pid, PTCACHE_FILE_WRITE, writer->cfra); + if(!pf) + return 0; + + for(i=0; itotelem; i++) + BKE_ptcache_file_write_floats(pf, writer->elem_ptr(i, writer->calldata), incr); + } + else { + PTCacheMem *pm = MEM_callocN(sizeof(PTCacheMem), "Pointcache mem"); + PTCacheMem *pm2; + float *pmdata; + + pm->data = MEM_callocN(elemsize * writer->totelem, "Pointcache mem data"); + pmdata = pm->data; + + for(i=0; itotelem; i++, pmdata+=incr) + memcpy(pmdata, writer->elem_ptr(i, writer->calldata), elemsize); + + pm->frame = writer->cfra; + pm->totpoint = writer->totelem; + + /* find add location */ + pm2 = cache->mem_cache.first; + if(!pm2) + BLI_addtail(&cache->mem_cache, pm); + else if(pm2->frame == writer->cfra) { + /* overwrite same frame */ + MEM_freeN(pm2->data); + pm2->data = pm->data; + MEM_freeN(pm); + } + else { + while(pm2->next && pm2->next->frame < writer->cfra) + pm2 = pm2->next; + + BLI_insertlinkafter(&cache->mem_cache, pm2, pm); + } + } + + if(writer->cfra - cache->last_exact == 1) + cache->last_exact = writer->cfra; + + if(pf) + BKE_ptcache_file_close(pf); + + ptcache_update_info(writer->pid); + + return 1; +} /* youll need to close yourself after! * mode - PTCACHE_CLEAR_ALL, @@ -317,62 +644,116 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, int cfra) case PTCACHE_CLEAR_ALL: case PTCACHE_CLEAR_BEFORE: case PTCACHE_CLEAR_AFTER: - ptcache_path(pid, path); - - len = BKE_ptcache_id_filename(pid, filename, cfra, 0, 0); /* no path */ - - dir = opendir(path); - if (dir==NULL) - return; - - snprintf(ext, sizeof(ext), "_%02d"PTCACHE_EXT, pid->stack_index); - - while ((de = readdir(dir)) != NULL) { - if (strstr(de->d_name, ext)) { /* do we have the right extension?*/ - if (strncmp(filename, de->d_name, len ) == 0) { /* do we have the right prefix */ - if (mode == PTCACHE_CLEAR_ALL) { - BLI_join_dirfile(path_full, path, de->d_name); - BLI_delete(path_full, 0, 0); - } else { - /* read the number of the file */ - int frame, len2 = strlen(de->d_name); - char num[7]; - - if (len2 > 15) { /* could crash if trying to copy a string out of this range*/ - BLI_strncpy(num, de->d_name + (strlen(de->d_name) - 15), sizeof(num)); - frame = atoi(num); - - if((mode==PTCACHE_CLEAR_BEFORE && frame < cfra) || - (mode==PTCACHE_CLEAR_AFTER && frame > cfra) ) { + if(pid->cache->flag & PTCACHE_DISK_CACHE) { + ptcache_path(pid, path); + + len = BKE_ptcache_id_filename(pid, filename, cfra, 0, 0); /* no path */ + + dir = opendir(path); + if (dir==NULL) + return; + + snprintf(ext, sizeof(ext), "_%02d"PTCACHE_EXT, pid->stack_index); + + while ((de = readdir(dir)) != NULL) { + if (strstr(de->d_name, ext)) { /* do we have the right extension?*/ + if (strncmp(filename, de->d_name, len ) == 0) { /* do we have the right prefix */ + if (mode == PTCACHE_CLEAR_ALL) { + pid->cache->last_exact = 0; + BLI_join_dirfile(path_full, path, de->d_name); + BLI_delete(path_full, 0, 0); + } else { + /* read the number of the file */ + int frame, len2 = strlen(de->d_name); + char num[7]; + + if (len2 > 15) { /* could crash if trying to copy a string out of this range*/ + BLI_strncpy(num, de->d_name + (strlen(de->d_name) - 15), sizeof(num)); + frame = atoi(num); - BLI_join_dirfile(path_full, path, de->d_name); - BLI_delete(path_full, 0, 0); + if((mode==PTCACHE_CLEAR_BEFORE && frame < cfra) || + (mode==PTCACHE_CLEAR_AFTER && frame > cfra) ) { + + BLI_join_dirfile(path_full, path, de->d_name); + BLI_delete(path_full, 0, 0); + } } } } } } + closedir(dir); + } + else { + PTCacheMem *pm= pid->cache->mem_cache.first; + PTCacheMem *link= NULL; + + if(mode == PTCACHE_CLEAR_ALL) { + pid->cache->last_exact = 0; + for(; pm; pm=pm->next) + MEM_freeN(pm->data); + BLI_freelistN(&pid->cache->mem_cache); + } else { + while(pm) { + if((mode==PTCACHE_CLEAR_BEFORE && pm->frame < cfra) || + (mode==PTCACHE_CLEAR_AFTER && pm->frame > cfra) ) { + link = pm; + pm = pm->next; + MEM_freeN(link->data); + BLI_freelinkN(&pid->cache->mem_cache, link); + } + else + pm = pm->next; + } + } } - closedir(dir); break; case PTCACHE_CLEAR_FRAME: - len = BKE_ptcache_id_filename(pid, filename, cfra, 1, 1); /* no path */ - BLI_delete(filename, 0, 0); + if(pid->cache->flag & PTCACHE_DISK_CACHE) { + if(BKE_ptcache_id_exist(pid, cfra)) { + BKE_ptcache_id_filename(pid, filename, cfra, 1, 1); /* no path */ + BLI_delete(filename, 0, 0); + } + } + else { + PTCacheMem *pm = pid->cache->mem_cache.first; + + for(; pm; pm=pm->next) { + if(pm->frame == cfra) { + MEM_freeN(pm->data); + BLI_freelinkN(&pid->cache->mem_cache, pm); + break; + } + } + } break; } + + ptcache_update_info(pid); } int BKE_ptcache_id_exist(PTCacheID *pid, int cfra) { - char filename[MAX_PTCACHE_FILE]; - if(!pid->cache) return 0; - BKE_ptcache_id_filename(pid, filename, cfra, 1, 1); + if(pid->cache->flag & PTCACHE_DISK_CACHE) { + char filename[MAX_PTCACHE_FILE]; + + BKE_ptcache_id_filename(pid, filename, cfra, 1, 1); - return BLI_exists(filename); + return BLI_exists(filename); + } + else { + PTCacheMem *pm = pid->cache->mem_cache.first; + + for(; pm; pm=pm->next) { + if(pm->frame==cfra) + return 1; + } + return 0; + } } void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startframe, int *endframe, float *timescale) @@ -414,10 +795,10 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra } } -int BKE_ptcache_id_reset(PTCacheID *pid, int mode) +int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode) { PointCache *cache; - int reset, clear; + int reset, clear, current, after; if(!pid->cache) return 0; @@ -425,11 +806,20 @@ int BKE_ptcache_id_reset(PTCacheID *pid, int mode) cache= pid->cache; reset= 0; clear= 0; + current= 0; + after= 0; if(mode == PTCACHE_RESET_DEPSGRAPH) { if(!(cache->flag & PTCACHE_BAKED) && !BKE_ptcache_get_continue_physics()) { - reset= 1; - clear= 1; + if(cache->flag & PTCACHE_AUTOCACHE) { + reset= 1; + clear= 1; + } + else { + current= 1; + after= 1; + cache->flag |= PTCACHE_OUTDATED; + } } else cache->flag |= PTCACHE_OUTDATED; @@ -449,10 +839,19 @@ int BKE_ptcache_id_reset(PTCacheID *pid, int mode) if(!(cache->flag & PTCACHE_BAKED)) clear= 1; } + else if(mode == PTCACHE_RESET_FREE) { + if(!(cache->flag & PTCACHE_BAKED) && !BKE_ptcache_get_continue_physics()) { + if((cache->flag & PTCACHE_AUTOCACHE)==0) { + current= 1; + after= 1; + } + } + } if(reset) { cache->flag &= ~(PTCACHE_OUTDATED|PTCACHE_SIMULATION_VALID); cache->simframe= 0; + cache->last_exact= 0; if(pid->type == PTCACHE_TYPE_CLOTH) cloth_free_modifier(pid->ob, pid->data); @@ -463,11 +862,15 @@ int BKE_ptcache_id_reset(PTCacheID *pid, int mode) } if(clear) BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); + if(after) + BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_AFTER, CFRA); + if(current) + BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_FRAME, CFRA); - return (reset || clear); + return (reset || clear || current || after); } -int BKE_ptcache_object_reset(Object *ob, int mode) +int BKE_ptcache_object_reset(Scene *scene, Object *ob, int mode) { PTCacheID pid; ParticleSystem *psys; @@ -479,7 +882,7 @@ int BKE_ptcache_object_reset(Object *ob, int mode) if(ob->soft) { BKE_ptcache_id_from_softbody(&pid, ob, ob->soft); - reset |= BKE_ptcache_id_reset(&pid, mode); + reset |= BKE_ptcache_id_reset(scene, &pid, mode); } for(psys=ob->particlesystem.first; psys; psys=psys->next) { @@ -488,23 +891,23 @@ int BKE_ptcache_object_reset(Object *ob, int mode) if(psys->soft) { BKE_ptcache_id_from_softbody(&pid, ob, psys->soft); if(mode == PSYS_RESET_ALL || !(psys->part->type == PART_HAIR && (pid.cache->flag & PTCACHE_BAKED))) - reset |= BKE_ptcache_id_reset(&pid, mode); + reset |= BKE_ptcache_id_reset(scene, &pid, mode); else skip = 1; } - else if((psys->recalc & PSYS_RECALC_RESET)==0) + else if(psys->recalc & PSYS_RECALC_REDO || psys->recalc & PSYS_RECALC_CHILD) skip = 1; if(skip == 0) { BKE_ptcache_id_from_particles(&pid, ob, psys); - reset |= BKE_ptcache_id_reset(&pid, mode); + reset |= BKE_ptcache_id_reset(scene, &pid, mode); } } for(md=ob->modifiers.first; md; md=md->next) { if(md->type == eModifierType_Cloth) { BKE_ptcache_id_from_cloth(&pid, ob, (ClothModifierData*)md); - reset |= BKE_ptcache_id_reset(&pid, mode); + reset |= BKE_ptcache_id_reset(scene, &pid, mode); } } @@ -564,7 +967,7 @@ void BKE_ptcache_set_continue_physics(Scene *scene, int enable) if(CONTINUE_PHYSICS == 0) { for(ob=G.main->object.first; ob; ob=ob->id.next) - if(BKE_ptcache_object_reset(ob, PTCACHE_RESET_OUTDATED)) + if(BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_OUTDATED)) DAG_object_flush_update(scene, ob, OB_RECALC_DATA); } } @@ -590,6 +993,14 @@ PointCache *BKE_ptcache_add() void BKE_ptcache_free(PointCache *cache) { + PTCacheMem *pm = cache->mem_cache.first; + if(pm) { + for(; pm; pm=pm->next) + MEM_freeN(pm->data); + + BLI_freelistN(&cache->mem_cache); + } + MEM_freeN(cache); } @@ -605,3 +1016,231 @@ PointCache *BKE_ptcache_copy(PointCache *cache) return ncache; } + + +/* Baking */ +void BKE_ptcache_autocache_all(Scene *scene) +{ + PTCacheBaker baker; + + baker.bake=0; + baker.break_data=NULL; + baker.break_test=NULL; + baker.pid=NULL; + baker.progressbar=NULL; + baker.progresscontext=NULL; + baker.render=0; + baker.scene=scene; + + if(psys_count_autocache(scene, NULL)) + BKE_ptcache_make_cache(&baker); +} + +/* if bake is not given run simulations to current frame */ +void BKE_ptcache_make_cache(PTCacheBaker* baker) +{ + Scene *scene = baker->scene; + Base *base; + ListBase pidlist; + PTCacheID *pid = baker->pid; + PointCache *cache; + float frameleno = scene->r.framelen; + int cfrao = CFRA; + int startframe = MAXFRAME; + int endframe = CFRA; + int bake = baker->bake; + int render = baker->render; + int end = 0; + + G.afbreek = 0; + + //printf("Caching physics..."); + + /* set caches to baking mode and figure out start frame */ + if(pid) { + /* cache/bake a single object */ + cache = pid->cache; + if((cache->flag & PTCACHE_BAKED)==0) { + if(pid->type==PTCACHE_TYPE_PARTICLES) + psys_get_pointcache_start_end(scene, pid->data, &cache->startframe, &cache->endframe); + + if(bake || cache->flag & PTCACHE_OUTDATED) + BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); + + startframe = MAX2(cache->last_exact, cache->startframe); + + if(bake) { + endframe = cache->endframe; + cache->flag |= PTCACHE_BAKING; + } + else + endframe = MIN2(endframe, cache->endframe); + + cache->flag &= ~PTCACHE_BAKED; + } + } + else for(base=scene->base.first; base; base= base->next) { + /* cache/bake everything in the scene */ + BKE_ptcache_ids_from_object(&pidlist, base->object); + + for(pid=pidlist.first; pid; pid=pid->next) { + cache = pid->cache; + if((cache->flag & PTCACHE_BAKED)==0) { + if(pid->type==PTCACHE_TYPE_PARTICLES) + psys_get_pointcache_start_end(scene, pid->data, &cache->startframe, &cache->endframe); + + if(cache->flag & PTCACHE_OUTDATED) + BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); + + startframe = MIN2(startframe, cache->startframe); + + if(bake) { + endframe = MAX2(endframe, cache->endframe); + cache->flag |= PTCACHE_BAKING; + } + else if(render) + cache->flag |= PTCACHE_BAKING; + + cache->flag &= ~PTCACHE_BAKED; + + } + } + + BLI_freelistN(&pidlist); + } + + CFRA= startframe; + scene->r.framelen = 1.0; + scene_update_for_newframe(scene, scene->lay); + + for(; CFRA <= endframe; CFRA++) { + float prog; + + if(bake) + prog = (int)(100.0 * (float)(CFRA - startframe)/(float)(endframe-startframe)); + else + prog = CFRA; + + /* NOTE: baking should not redraw whole ui as this slows things down */ + if(baker->progressbar) + baker->progressbar(baker->progresscontext, prog); + + scene_update_for_newframe(scene, scene->lay); + + /* NOTE: breaking baking should leave calculated frames in cache, not clear it */ + if(baker->break_test && baker->break_test(baker->break_data)) + break; + } + + /* clear baking flag */ + if(pid) { + cache->flag &= ~(PTCACHE_BAKING|PTCACHE_OUTDATED); + if(bake) + cache->flag |= PTCACHE_BAKED; + } + else for(base=scene->base.first; base; base= base->next) { + BKE_ptcache_ids_from_object(&pidlist, base->object); + + for(pid=pidlist.first; pid; pid=pid->next) { + cache->flag &= ~(PTCACHE_BAKING|PTCACHE_OUTDATED); + if(bake) + cache->flag |= PTCACHE_BAKED; + } + } + + //printf("done!\n"); + + scene->r.framelen = frameleno; + CFRA = cfrao; + scene_update_for_newframe(scene, scene->lay); +} + +void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) { + PointCache *cache = pid->cache; + PTCacheFile *pf; + PTCacheMem *pm; + int totelem=0; + int float_count=0; + int tot; + int write_error=0; + + if (!G.relbase_valid){ + cache->flag &= ~PTCACHE_DISK_CACHE; + return; + } + + totelem = ptcache_pid_totelem(pid); + float_count = ptcache_pid_elemsize(pid) / sizeof(float); + + if(totelem==0 || float_count==0) + return; + + tot = totelem*float_count; + + /* MEM -> DISK */ + if(cache->flag & PTCACHE_DISK_CACHE) { + pm = cache->mem_cache.first; + + BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); + + for(; pm; pm=pm->next) { + pf = BKE_ptcache_file_open(pid, PTCACHE_FILE_WRITE, pm->frame); + + if(pf) { + if(fwrite(pm->data, sizeof(float), tot, pf->fp) != tot) { + printf("Error writing to disk cache\n"); + + cache->flag &= ~PTCACHE_DISK_CACHE; + + BKE_ptcache_file_close(pf); + return; + } + BKE_ptcache_file_close(pf); + } + else + printf("Error creating disk cache file\n"); + } + + cache->flag &= ~PTCACHE_DISK_CACHE; + BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); + cache->flag |= PTCACHE_DISK_CACHE; + } + /* DISK -> MEM */ + else { + int cfra; + int sfra = cache->startframe; + int efra = cache->endframe; + + BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); + + for(cfra=sfra; cfra <= efra; cfra++) { + pf = BKE_ptcache_file_open(pid, PTCACHE_FILE_READ, cfra); + + if(pf) { + pm = MEM_callocN(sizeof(PTCacheMem), "Pointcache mem"); + pm->data = MEM_callocN(sizeof(float)*tot, "Pointcache mem data"); + + if(fread(pm->data, sizeof(float), tot, pf->fp)!= tot) { + printf("Error reading from disk cache\n"); + + cache->flag |= PTCACHE_DISK_CACHE; + + MEM_freeN(pm->data); + MEM_freeN(pm); + BKE_ptcache_file_close(pf); + return; + } + + pm->frame = cfra; + + BLI_addtail(&pid->cache->mem_cache, pm); + + BKE_ptcache_file_close(pf); + } + } + + cache->flag |= PTCACHE_DISK_CACHE; + BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); + cache->flag &= ~PTCACHE_DISK_CACHE; + } +} \ No newline at end of file diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index a4856944d8a..77e256f1435 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2878,6 +2878,16 @@ static void direct_link_material(FileData *fd, Material *ma) static void direct_link_pointcache(FileData *fd, PointCache *cache) { + if((cache->flag & PTCACHE_DISK_CACHE)==0) { + PTCacheMem *pm; + + link_list(fd, &cache->mem_cache); + + pm = cache->mem_cache.first; + + for(; pm; pm=pm->next) + pm->data = newdataadr(fd, pm->data); + } cache->flag &= ~(PTCACHE_SIMULATION_VALID|PTCACHE_BAKE_EDIT_ACTIVE); cache->simframe= 0; } @@ -8996,6 +9006,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) Scene *sce; Tex *tx; ParticleSettings *part; + Object *ob; for(screen= main->screen.first; screen; screen= screen->id.next) { do_versions_windowmanager_2_50(screen); @@ -9038,7 +9049,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) me->drawflag= ME_DRAWEDGES|ME_DRAWFACES|ME_DRAWCREASES; } - /* particle settings conversion */ + /* particle draw and render types */ for(part= main->particle.first; part; part= part->id.next) { if(part->draw_as) { if(part->draw_as == PART_DRAW_DOT) { @@ -9054,6 +9065,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } } + /* set old pointcaches to have disk cache flag */ + for(ob = main->object.first; ob; ob= ob->id.next) { + ParticleSystem *psys = ob->particlesystem.first; + + for(; psys; psys=psys->next) { + if(psys->pointcache) + psys->pointcache->flag |= PTCACHE_DISK_CACHE; + } + + /* TODO: softbody & cloth caches */ + } } /* TODO: should be moved into one of the version blocks once this branch moves to trunk and we can diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index f8112406e80..9ef062bd7b6 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -549,6 +549,22 @@ static void write_userdef(WriteData *wd) } } +/* TODO: replace *cache with *cachelist once it's coded */ +#define PTCACHE_WRITE_PSYS 0 +static void write_pointcaches(WriteData *wd, PointCache *cache, int type) +{ + writestruct(wd, DATA, "PointCache", 1, cache); + + if((cache->flag & PTCACHE_DISK_CACHE)==0) { + PTCacheMem *pm = cache->mem_cache.first; + + for(; pm; pm=pm->next) { + writestruct(wd, DATA, "PTCacheMem", 1, pm); + if(type==PTCACHE_WRITE_PSYS) + writestruct(wd, DATA, "ParticleKey", pm->totpoint, pm->data); + } + } +} static void write_particlesettings(WriteData *wd, ListBase *idbase) { ParticleSettings *part; @@ -585,8 +601,8 @@ static void write_particlesystems(WriteData *wd, ListBase *particles) } if(psys->child) writestruct(wd, DATA, "ChildParticle", psys->totchild ,psys->child); writestruct(wd, DATA, "SoftBody", 1, psys->soft); - if(psys->soft) writestruct(wd, DATA, "PointCache", 1, psys->soft->pointcache); - writestruct(wd, DATA, "PointCache", 1, psys->pointcache); + if(psys->soft) write_pointcaches(wd, psys->soft->pointcache, PTCACHE_WRITE_PSYS); + write_pointcaches(wd, psys->pointcache, PTCACHE_WRITE_PSYS); } } diff --git a/source/blender/editors/include/ED_pointcache.h b/source/blender/editors/include/ED_pointcache.h new file mode 100644 index 00000000000..7bf51d9d53d --- /dev/null +++ b/source/blender/editors/include/ED_pointcache.h @@ -0,0 +1,38 @@ +/* + * $Id: ED_editparticle.h $ + * + * ***** BEGIN GPL 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. + * + * 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) 2007 by Janne Karhu. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef ED_PHYSICS_H +#define ED_PHYSICS_H + +/* operators */ +void ED_operatortypes_pointcache(void); +//void ED_keymap_pointcache(struct wmWindowManager *wm); + +#endif /* ED_PHYSICS_H */ + diff --git a/source/blender/editors/physics/ed_pointcache.c b/source/blender/editors/physics/ed_pointcache.c new file mode 100644 index 00000000000..e47f44c5c1a --- /dev/null +++ b/source/blender/editors/physics/ed_pointcache.c @@ -0,0 +1,270 @@ +/* + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2007 by Janne Karhu. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "MEM_guardedalloc.h" + +#include "DNA_scene_types.h" +#include "DNA_object_force.h" + +#include "BKE_context.h" +#include "BKE_particle.h" +#include "BKE_report.h" +#include "BKE_scene.h" +#include "BKE_utildefines.h" +#include "BKE_pointcache.h" +#include "BKE_global.h" +#include "BKE_multires.h" + +#include "BLI_blenlib.h" + +#include "ED_screen.h" +#include "ED_pointcache.h" + +#include "UI_interface.h" +#include "UI_resources.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "physics_intern.h" + +static int cache_break_test(void *cbd) { + return G.afbreek==1; +} +/**************************** general **********************************/ +static int ptcache_bake_all_poll(bContext *C) +{ + Scene *scene= CTX_data_scene(C); + + if(!scene) + return 0; + + return 1; +} + +static int ptcache_bake_all_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + PTCacheBaker baker; + + + baker.scene = scene; + baker.pid = NULL; + baker.bake = RNA_boolean_get(op->ptr, "bake"); + baker.render = 0; + baker.break_test = cache_break_test; + baker.break_data = NULL; + baker.progressbar = WM_timecursor; + baker.progresscontext = CTX_wm_window(C); + + BKE_ptcache_make_cache(&baker); + + WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); + + return OPERATOR_FINISHED; +} +static int ptcache_free_bake_all_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Base *base; + PTCacheID *pid; + ListBase pidlist; + + for(base=scene->base.first; base; base= base->next) { + BKE_ptcache_ids_from_object(&pidlist, base->object); + + for(pid=pidlist.first; pid; pid=pid->next) { + pid->cache->flag &= ~PTCACHE_BAKED; + BKE_ptcache_id_reset(scene, pid, PTCACHE_RESET_OUTDATED); + } + } + + BLI_freelistN(&pidlist); + + WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); + + return OPERATOR_FINISHED; +} + +void PTCACHE_OT_bake_all(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Bake All Physics"; + ot->idname= "PTCACHE_OT_bake_all"; + + /* api callbacks */ + ot->exec= ptcache_bake_all_exec; + ot->poll= ptcache_bake_all_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} +void PTCACHE_OT_free_bake_all(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Free All Physics Bakes"; + ot->idname= "PTCACHE_OT_free_bake_all"; + + /* api callbacks */ + ot->exec= ptcache_free_bake_all_exec; + ot->poll= ptcache_bake_all_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/**************************** particles **********************************/ +static int ptcache_bake_particle_system_poll(bContext *C) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_active_object(C); + + if(!scene || !ob || ob->id.lib) + return 0; + + return (ob->particlesystem.first != NULL); +} + +static int ptcache_bake_particle_system_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_active_object(C); + ParticleSystem *psys =psys_get_current(ob); + PTCacheID pid; + PTCacheBaker baker; + + BKE_ptcache_id_from_particles(&pid, ob, psys); + + baker.scene = scene; + baker.pid = &pid; + baker.bake = RNA_boolean_get(op->ptr, "bake"); + baker.render = 0; + baker.break_test = cache_break_test; + baker.break_data = NULL; + baker.progressbar = WM_timecursor; + baker.progresscontext = CTX_wm_window(C); + + BKE_ptcache_make_cache(&baker); + + WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); + + return OPERATOR_FINISHED; +} +static int ptcache_free_bake_particle_system_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_active_object(C); + ParticleSystem *psys= psys_get_current(ob); + PTCacheID pid; + + BKE_ptcache_id_from_particles(&pid, ob, psys); + psys->pointcache->flag &= ~PTCACHE_BAKED; + BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED); + + WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); + + return OPERATOR_FINISHED; +} +void PTCACHE_OT_cache_particle_system(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Bake Particles"; + ot->idname= "PTCACHE_OT_cache_particle_system"; + + /* api callbacks */ + ot->exec= ptcache_bake_particle_system_exec; + ot->poll= ptcache_bake_particle_system_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_boolean(ot->srna, "bake", 0, "Bake", ""); +} +void PTCACHE_OT_free_bake_particle_system(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Free Particles Bake"; + ot->idname= "PTCACHE_OT_free_bake_particle_system"; + + /* api callbacks */ + ot->exec= ptcache_free_bake_particle_system_exec; + ot->poll= ptcache_bake_particle_system_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} +static int ptcache_bake_from_particles_cache_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_active_object(C); + ParticleSystem *psys= psys_get_current(ob); + PTCacheID pid; + + BKE_ptcache_id_from_particles(&pid, ob, psys); + psys->pointcache->flag |= PTCACHE_BAKED; + + return OPERATOR_FINISHED; +} +void PTCACHE_OT_bake_from_particles_cache(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Bake From Cache"; + ot->idname= "PTCACHE_OT_bake_from_particles_cache"; + + /* api callbacks */ + ot->exec= ptcache_bake_from_particles_cache_exec; + ot->poll= ptcache_bake_particle_system_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/**************************** registration **********************************/ + +void ED_operatortypes_pointcache(void) +{ + WM_operatortype_append(PTCACHE_OT_bake_all); + WM_operatortype_append(PTCACHE_OT_free_bake_all); + WM_operatortype_append(PTCACHE_OT_cache_particle_system); + WM_operatortype_append(PTCACHE_OT_free_bake_particle_system); + WM_operatortype_append(PTCACHE_OT_bake_from_particles_cache); +} + +//void ED_keymap_pointcache(wmWindowManager *wm) +//{ +// ListBase *keymap= WM_keymap_listbase(wm, "Pointcache", 0, 0); +// +// WM_keymap_add_item(keymap, "PHYSICS_OT_bake_all", AKEY, KM_PRESS, 0, 0); +// WM_keymap_add_item(keymap, "PHYSICS_OT_free_all", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); +// WM_keymap_add_item(keymap, "PHYSICS_OT_bake_particle_system", PADMINUS, KM_PRESS, KM_CTRL, 0); +// WM_keymap_add_item(keymap, "PHYSICS_OT_free_particle_system", LKEY, KM_PRESS, 0, 0); +//} + diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 4f9c1f4b7a7..510103895f4 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -50,6 +50,7 @@ #include "ED_screen.h" #include "ED_space_api.h" #include "ED_uvedit.h" +#include "ED_pointcache.h" /* only call once on startup, storage is global in BKE kernel listbase */ void ED_spacetypes_init(void) @@ -89,6 +90,7 @@ void ED_spacetypes_init(void) ED_operatortypes_curve(); ED_operatortypes_armature(); ED_marker_operatortypes(); + ED_operatortypes_pointcache(); ui_view2d_operatortypes(); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 6c7aa1ee49d..efe5122ad01 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4672,7 +4672,7 @@ void special_aftertrans_update(TransInfo *t) if (base->flag & SELECT && (t->mode != TFM_DUMMY)) { /* pointcache refresh */ - if (BKE_ptcache_object_reset(ob, PTCACHE_RESET_DEPSGRAPH)) + if (BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH)) ob->recalc |= OB_RECALC_DATA; /* Set autokey if necessary */ diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 718d1a17834..a8d402fc503 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -33,6 +33,8 @@ #ifdef __cplusplus extern "C" { #endif + +#include "DNA_listBase.h" typedef struct PartDeflect { short deflect; /* Deflection flag - does mesh deflect particles*/ @@ -72,12 +74,25 @@ typedef struct PartDeflect { int seed; /* wind noise random seed */ } PartDeflect; +typedef struct PTCacheMem { + struct PTCacheMem *next, *prev; + int frame, totpoint; + float *data; /* data points */ + void *xdata; /* extra data */ +} PTCacheMem; + typedef struct PointCache { - int flag; /* generic flag */ + int flag, rt; /* generic flag */ int simframe; /* current frame of simulation (only if SIMULATION_VALID) */ int startframe; /* simulation start frame */ int endframe; /* simulation end frame */ int editframe; /* frame being edited (runtime only) */ + int last_exact; /* last exact frame that's cached */ + int xdata_type; /* type of extra data */ + char name[64]; + char prev_name[64]; + char info[64]; + struct ListBase mem_cache; } PointCache; typedef struct SBVertex { @@ -247,6 +262,8 @@ typedef struct SoftBody { #define PTCACHE_BAKING 8 #define PTCACHE_BAKE_EDIT 16 #define PTCACHE_BAKE_EDIT_ACTIVE 32 +#define PTCACHE_DISK_CACHE 64 +#define PTCACHE_AUTOCACHE 128 /* ob->softflag */ #define OB_SB_ENABLE 1 diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index d144ed5f28b..bc3f0733a0d 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -32,8 +32,87 @@ #include "DNA_object_types.h" #include "DNA_object_force.h" +#include "WM_types.h" + #ifdef RNA_RUNTIME +#include "MEM_guardedalloc.h" + +#include "BKE_context.h" +#include "BKE_pointcache.h" + +#include "BLI_blenlib.h" + +static void rna_Cache_toggle_disk_cache(bContext *C, PointerRNA *ptr) +{ + Object *ob = CTX_data_active_object(C); + PointCache *cache = (PointCache*)ptr->data; + PTCacheID *pid = NULL; + ListBase pidlist; + + if(!ob) + return; + + BKE_ptcache_ids_from_object(&pidlist, ob); + + for(pid=pidlist.first; pid; pid=pid->next) { + if(pid->cache==cache) + break; + } + + if(pid) + BKE_ptcache_toggle_disk_cache(pid); + + BLI_freelistN(&pidlist); +} + +static void rna_Cache_idname_change(bContext *C, PointerRNA *ptr) +{ + Object *ob = CTX_data_active_object(C); + PointCache *cache = (PointCache*)ptr->data; + PTCacheID *pid = NULL, *pid2; + ListBase pidlist; + int new_name = 1; + char name[80]; + + if(!ob) + return; + + /* TODO: check for proper characters */ + + BKE_ptcache_ids_from_object(&pidlist, ob); + + for(pid=pidlist.first; pid; pid=pid->next) { + if(pid->cache==cache) + pid2 = pid; + else if(strcmp(cache->name, "") && strcmp(cache->name,pid->cache->name)==0) { + /*TODO: report "name exists" to user */ + strcpy(cache->name, cache->prev_name); + new_name = 0; + } + } + + if(new_name) { + if(pid2 && cache->flag & PTCACHE_DISK_CACHE) { + strcpy(name, cache->name); + strcpy(cache->name, cache->prev_name); + + cache->flag &= ~PTCACHE_DISK_CACHE; + + BKE_ptcache_toggle_disk_cache(pid2); + + strcpy(cache->name, name); + + cache->flag |= PTCACHE_DISK_CACHE; + + BKE_ptcache_toggle_disk_cache(pid2); + } + + strcpy(cache->prev_name, cache->name); + } + + BLI_freelistN(&pidlist); +} #else static void rna_def_pointcache(BlenderRNA *brna) @@ -60,6 +139,32 @@ static void rna_def_pointcache(BlenderRNA *brna) prop= RNA_def_property(srna, "baking", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_BAKING); + + prop= RNA_def_property(srna, "disk_cache", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_DISK_CACHE); + RNA_def_property_ui_text(prop, "Disk Cache", "Save cache files to disk"); + RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_toggle_disk_cache"); + + prop= RNA_def_property(srna, "outdated", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_OUTDATED); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Cache is outdated", ""); + + prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "name"); + RNA_def_property_ui_text(prop, "Name", "Cache name"); + RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change"); + + prop= RNA_def_property(srna, "autocache", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_AUTOCACHE); + RNA_def_property_ui_text(prop, "Auto Cache", "Cache changes automatically"); + //RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_toggle_autocache"); + + prop= RNA_def_property(srna, "info", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "info"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Cache Info", "Info on current cache status."); + } static void rna_def_collision(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 8ee71b6fd9e..2c4c75e45eb 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -38,6 +38,7 @@ #include "DNA_scene_types.h" #include "WM_types.h" +#include "WM_api.h" #ifdef RNA_RUNTIME @@ -45,48 +46,93 @@ #include "BKE_depsgraph.h" #include "BKE_particle.h" +#include "BLI_arithb.h" + +/* property update functions */ static void rna_Particle_redo(bContext *C, PointerRNA *ptr) { + Scene *scene = CTX_data_scene(C); ParticleSettings *part; - if(ptr->type==&RNA_ParticleSystem) - part = ((ParticleSystem*)ptr->data)->part; - else + if(ptr->type==&RNA_ParticleSystem) { + ParticleSystem *psys = (ParticleSystem*)ptr->data; + Object *ob = psys_find_object(scene, psys); + + psys->recalc = PSYS_RECALC_REDO; + + if(ob) + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + } + else { part = ptr->id.data; - - psys_flush_particle_settings(CTX_data_scene(C), part, PSYS_RECALC_REDO); + psys_flush_particle_settings(scene, part, PSYS_RECALC_REDO); + } } static void rna_Particle_reset(bContext *C, PointerRNA *ptr) { + Scene *scene = CTX_data_scene(C); ParticleSettings *part; - if(ptr->type==&RNA_ParticleSystem) - part = ((ParticleSystem*)ptr->data)->part; - else - part = ptr->id.data; - psys_flush_particle_settings(CTX_data_scene(C), part, PSYS_RECALC_RESET|PSYS_RECALC_REDO); + if(ptr->type==&RNA_ParticleSystem) { + ParticleSystem *psys = (ParticleSystem*)ptr->data; + Object *ob = psys_find_object(scene, psys); + + psys->recalc = PSYS_RECALC_RESET; + + if(ob) { + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + //WM_event_add_notifier(C, NC_SCENE|ND_CACHE_PHYSICS, scene); + } + } + else { + part = ptr->id.data; + psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET); + //WM_event_add_notifier(C, NC_SCENE|ND_CACHE_PHYSICS, scene); + } } static void rna_Particle_change_type(bContext *C, PointerRNA *ptr) { + Scene *scene = CTX_data_scene(C); ParticleSettings *part; - if(ptr->type==&RNA_ParticleSystem) - part = ((ParticleSystem*)ptr->data)->part; - else - part = ptr->id.data; - psys_flush_particle_settings(CTX_data_scene(C), part, PSYS_RECALC_RESET|PSYS_RECALC_TYPE|PSYS_RECALC_REDO); + if(ptr->type==&RNA_ParticleSystem) { + ParticleSystem *psys = (ParticleSystem*)ptr->data; + Object *ob = psys_find_object(scene, psys); + + psys->recalc = PSYS_RECALC_RESET|PSYS_RECALC_TYPE; + + if(ob) { + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + //WM_event_add_notifier(C, NC_SCENE|ND_CACHE_PHYSICS, scene); + } + } + else { + part = ptr->id.data; + psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET|PSYS_RECALC_TYPE); + //WM_event_add_notifier(C, NC_SCENE|ND_CACHE_PHYSICS, scene); + } } static void rna_Particle_redo_child(bContext *C, PointerRNA *ptr) { + Scene *scene = CTX_data_scene(C); ParticleSettings *part; - if(ptr->type==&RNA_ParticleSystem) - part = ((ParticleSystem*)ptr->data)->part; - else + + if(ptr->type==&RNA_ParticleSystem) { + ParticleSystem *psys = (ParticleSystem*)ptr->data; + Object *ob = psys_find_object(scene, psys); + + psys->recalc = PSYS_RECALC_CHILD; + + if(ob) + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + } + else { part = ptr->id.data; - psys_flush_particle_settings(CTX_data_scene(C), part, PSYS_RECALC_CHILD); + psys_flush_particle_settings(scene, part, PSYS_RECALC_CHILD); + } } static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value) { @@ -887,7 +933,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "disp"); RNA_def_property_range(prop, 0, 100); RNA_def_property_ui_text(prop, "Display", "Percentage of particles to display in 3d view"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "material", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "omat"); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 07560edb76b..f7aae88519f 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -46,6 +46,7 @@ #include "BKE_object.h" #include "BKE_scene.h" #include "BKE_writeavi.h" /* <------ should be replaced once with generic movie module */ +#include "BKE_pointcache.h" #include "MEM_guardedalloc.h" @@ -2413,6 +2414,20 @@ static int is_rendering_allowed(Render *re) return 1; } +static void update_physics_cache(Render *re, Scene *scene) +{ + PTCacheBaker baker; + + baker.scene = scene; + baker.pid = NULL; + baker.bake = 0; + baker.render = 1; + baker.break_test = re->test_break; + baker.break_data = re->tbh; + baker.progressbar = NULL; + + BKE_ptcache_make_cache(&baker); +} /* evaluating scene options for general Blender render */ static int render_initialize_from_scene(Render *re, Scene *scene, int anim) { @@ -2450,6 +2465,9 @@ static int render_initialize_from_scene(Render *re, Scene *scene, int anim) /* check all scenes involved */ tag_scenes_for_render(re); + + /* make sure dynamics are up to date */ + update_physics_cache(re, scene); if(scene->r.scemode & R_SINGLE_LAYER) push_render_result(re); -- cgit v1.2.3 From c549e75c1690dd740540d1349593983ae6dd08d9 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 21 Jun 2009 10:26:39 +0000 Subject: 2.5 Buttons Window: * WIP Commit: Started wrapping the buttons header to python. Still disabled due to some display problems. --- .../blender/editors/space_buttons/space_buttons.c | 12 ++++++++++- source/blender/makesrna/intern/rna_space.c | 25 +++++++++++----------- 2 files changed, 24 insertions(+), 13 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 38ce88019ed..e5d2215be29 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -220,14 +220,23 @@ void buttons_keymap(struct wmWindowManager *wm) } +//#define PY_HEADER /* add handlers, stuff you only do once or on area/region changes */ static void buttons_header_area_init(wmWindowManager *wm, ARegion *ar) { +#ifdef PY_HEADER + ED_region_header_init(ar); +#else UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); +#endif } static void buttons_header_area_draw(const bContext *C, ARegion *ar) { +#ifdef PY_HEADER + ED_region_header(C, ar); +#else + float col[3]; /* clear */ @@ -243,7 +252,8 @@ static void buttons_header_area_draw(const bContext *C, ARegion *ar) UI_view2d_view_ortho(C, &ar->v2d); buttons_header_buttons(C, ar); - +#endif + /* restore view matrix? */ UI_view2d_view_restore(C); } diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 41acc458cd9..66d98d98834 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -575,18 +575,17 @@ static void rna_def_space_buttons(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem buttons_context_items[] = { - {BCONTEXT_SCENE, "SCENE", 0, "Scene", ""}, - {BCONTEXT_WORLD, "WORLD", 0, "World", ""}, - {BCONTEXT_OBJECT, "OBJECT", 0, "Object", ""}, - {BCONTEXT_DATA, "DATA", 0, "Data", ""}, - {BCONTEXT_MATERIAL, "MATERIAL", 0, "Material", ""}, - {BCONTEXT_TEXTURE, "TEXTURE", 0, "Texture", ""}, - {BCONTEXT_PARTICLE, "PARTICLE", 0, "Particle", ""}, - {BCONTEXT_PHYSICS, "PHYSICS", 0, "Physics", ""}, - {BCONTEXT_GAME, "GAME", 0, "Game", ""}, - {BCONTEXT_BONE, "BONE", 0, "Bone", ""}, - {BCONTEXT_MODIFIER, "MODIFIER", 0, "Modifier", ""}, - {BCONTEXT_CONSTRAINT, "CONSTRAINT", 0, "Constraint", ""}, + {BCONTEXT_SCENE, "SCENE", ICON_SCENE, "Scene", "Scene"}, + {BCONTEXT_WORLD, "WORLD", ICON_WORLD, "World", "World"}, + {BCONTEXT_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Object"}, + {BCONTEXT_CONSTRAINT, "CONSTRAINT", ICON_CONSTRAINT, "Constraint", "Constraint"}, + {BCONTEXT_MODIFIER, "MODIFIER", ICON_MODIFIER, "Modifier", "Modifier"}, + {BCONTEXT_DATA, "DATA", 0, "Data", "Data"}, + {BCONTEXT_BONE, "BONE", ICON_BONE_DATA, "Bone", "Bone"}, + {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material"}, + {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"}, + {BCONTEXT_PARTICLE, "PARTICLE", ICON_PARTICLES, "Particle", "Particle"}, + {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem panel_alignment_items[] = { @@ -602,11 +601,13 @@ static void rna_def_space_buttons(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "mainb"); RNA_def_property_enum_items(prop, buttons_context_items); RNA_def_property_ui_text(prop, "Buttons Context", "The type of active data to display and edit in the buttons window"); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "panel_alignment", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "align"); RNA_def_property_enum_items(prop, panel_alignment_items); RNA_def_property_ui_text(prop, "Panel Alignment", "Arrangement of the panels within the buttons window"); + RNA_def_property_update(prop, NC_WINDOW, NULL); /* pinned data */ prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE); -- cgit v1.2.3 From 1f9368b37ec9a418cd8996ffd9ee24f4bd47b2dd Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sun, 21 Jun 2009 11:09:16 +0000 Subject: Particle system parenting * Allows moving, rotating & scaling of particle simulations. * Setting in particle render options. * Changes viewed & rendered particles from global space to parent space. * Doesn't effect simulations at all. --- source/blender/editors/space_view3d/drawobject.c | 3 +++ source/blender/makesdna/DNA_particle_types.h | 1 + source/blender/makesrna/intern/rna_particle.c | 8 ++++++++ source/blender/render/intern/source/convertblender.c | 3 +++ 4 files changed, 15 insertions(+) (limited to 'source') diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index a67e8c8a1c3..42da6775d5f 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3239,6 +3239,9 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(draw_as!=PART_DRAW_PATH){ state.time=cfra; if(psys_get_particle_state(scene,ob,psys,a,&state,0)){ + if(psys->parent) + Mat4MulVecfl(psys->parent->obmat, state.co); + /* create actiual particle data */ switch(draw_as){ case PART_DRAW_DOT: diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 6805082d094..b10f35b9091 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -192,6 +192,7 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in struct Object *target_ob; struct Object *keyed_ob; struct Object *lattice; + struct Object *parent; /* particles from global space -> parent space */ struct ListBase effectors, reactevents; /* runtime */ diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 2c4c75e45eb..c48c1006588 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1715,6 +1715,14 @@ static void rna_def_particle_system(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "pointcache"); RNA_def_property_struct_type(prop, "PointCache"); RNA_def_property_ui_text(prop, "Point Cache", ""); + + /* offset ob */ + prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "parent"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Parent", "Use this object's coordinate system instead of global coordinate system."); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + } void RNA_def_particle(BlenderRNA *brna) diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 98e5819c0d3..8423b5d271c 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -1886,6 +1886,9 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem if(psys_get_particle_state(re->scene,ob,psys,a,&state,0)==0) continue; + if(psys->parent) + Mat4MulVecfl(psys->parent->obmat, state.co); + VECCOPY(loc,state.co); if(part->ren_as!=PART_DRAW_BB) MTC_Mat4MulVecfl(re->viewmat,loc); -- cgit v1.2.3 From 7f55c3b89c67a17d454389815be313b4c66f34b4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 21 Jun 2009 14:30:59 +0000 Subject: RNA read-only wrapped wmEvent so python operators invoke functions * 2 new enums event_value_items and event_type_items in RNA_enum_types.h * WM_key_event_string now uses an RNA enum lookup rather then its own switch statement. * moved wmEvent from WM_types.h into DNA_windowmanager_types.h * added RNA_enum_identifier and RNA_enum_name to get strings from an enum value. --- source/blender/editors/transform/transform_input.c | 1 + .../editors/transform/transform_ndofinput.c | 1 + .../blender/editors/transform/transform_numinput.c | 1 + source/blender/makesdna/DNA_windowmanager_types.h | 31 ++ source/blender/makesrna/RNA_access.h | 4 + source/blender/makesrna/RNA_enum_types.h | 3 + source/blender/makesrna/intern/rna_access.c | 31 +- source/blender/makesrna/intern/rna_wm.c | 202 +++++++++++++ source/blender/python/intern/bpy_operator_wrap.c | 97 +------ source/blender/windowmanager/WM_types.h | 31 -- source/blender/windowmanager/intern/wm_keymap.c | 311 +-------------------- 11 files changed, 274 insertions(+), 439 deletions(-) (limited to 'source') diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 4d721a83c78..76b3f58f75c 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -26,6 +26,7 @@ #include #include "DNA_screen_types.h" +#include "DNA_windowmanager_types.h" #include "BLI_arithb.h" diff --git a/source/blender/editors/transform/transform_ndofinput.c b/source/blender/editors/transform/transform_ndofinput.c index c52492ebd6b..9c2a1a7db6d 100644 --- a/source/blender/editors/transform/transform_ndofinput.c +++ b/source/blender/editors/transform/transform_ndofinput.c @@ -31,6 +31,7 @@ #include "BKE_utildefines.h" /* ABS */ #include "DNA_view3d_types.h" /* for G.vd (view3d) */ +#include "DNA_windowmanager_types.h" /* for G.vd (view3d) */ #include "WM_types.h" diff --git a/source/blender/editors/transform/transform_numinput.c b/source/blender/editors/transform/transform_numinput.c index 34976105db3..f5f1d5fac9e 100644 --- a/source/blender/editors/transform/transform_numinput.c +++ b/source/blender/editors/transform/transform_numinput.c @@ -34,6 +34,7 @@ #include "BKE_utildefines.h" /* ABS */ #include "WM_types.h" +#include "DNA_windowmanager_types.h" #include "transform.h" diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index 7d6b5ec8764..e02d2984771 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -222,5 +222,36 @@ typedef enum wmRadialControlMode { WM_RADIALCONTROL_ANGLE } wmRadialControlMode; +/* ************** wmEvent ************************ */ +/* for read-only rna access, dont save this */ + +/* each event should have full modifier state */ +/* event comes from eventmanager and from keymap */ +typedef struct wmEvent { + struct wmEvent *next, *prev; + + short type; /* event code itself (short, is also in keymap) */ + short val; /* press, release, scrollvalue */ + short x, y; /* mouse pointer position, screen coord */ + short mval[2]; /* region mouse position, name convention pre 2.5 :) */ + short prevx, prevy; /* previous mouse pointer position */ + short unicode; /* future, ghost? */ + char ascii; /* from ghost */ + char pad; + + /* modifier states */ + short shift, ctrl, alt, oskey; /* oskey is apple or windowskey, value denotes order of pressed */ + short keymodifier; /* rawkey modifier */ + + /* keymap item, set by handler (weak?) */ + const char *keymap_idname; + + /* custom data */ + short custom; /* custom data type, stylus, 6dof, see wm_event_types.h */ + void *customdata; /* ascii, unicode, mouse coords, angles, vectors, dragdrop info */ + short customdatafree; + +} wmEvent; + #endif /* DNA_WINDOWMANAGER_TYPES_H */ diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 9b653bd924a..4a074ab1546 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -172,6 +172,7 @@ extern StructRNA RNA_EnvironmentMap; extern StructRNA RNA_EnvironmentMapTexture; extern StructRNA RNA_ExplodeModifier; extern StructRNA RNA_ExpressionController; +extern StructRNA RNA_Event; extern StructRNA RNA_FCurve; extern StructRNA RNA_FModifier; extern StructRNA RNA_FModifierCycles; @@ -541,6 +542,9 @@ void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin, void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax); void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision); +int RNA_enum_identifier(const EnumPropertyItem *item, const int value, const char **identifier); +int RNA_enum_name(const EnumPropertyItem *item, const int value, const char **name); + void RNA_property_enum_items(PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **item, int *totitem); int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value); int RNA_property_enum_identifier(PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier); diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index c679d9fc544..276f421c586 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -40,6 +40,9 @@ extern EnumPropertyItem beztriple_interpolation_mode_items[]; extern EnumPropertyItem fmodifier_type_items[]; +extern EnumPropertyItem event_value_items[]; +extern EnumPropertyItem event_type_items[]; + #endif /* RNA_ENUM_TYPES */ diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index ba893319ce9..13686809cd2 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -669,6 +669,28 @@ int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *iden return 0; } +int RNA_enum_identifier(const EnumPropertyItem *item, const int value, const char **identifier) +{ + for (; item->identifier; item++) { + if(item->value==value) { + *identifier = item->identifier; + return 1; + } + } + return 0; +} + +int RNA_enum_name(const EnumPropertyItem *item, const int value, const char **name) +{ + for (; item->identifier; item++) { + if(item->value==value) { + *name = item->name; + return 1; + } + } + return 0; +} + int RNA_property_enum_identifier(PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier) { const EnumPropertyItem *item; @@ -676,14 +698,7 @@ int RNA_property_enum_identifier(PointerRNA *ptr, PropertyRNA *prop, const int v RNA_property_enum_items(ptr, prop, &item, &totitem); - for(i=0; iproperties); } + +static int rna_Event_ascii_get(PointerRNA *ptr, char *value) +{ + wmEvent *event= (wmEvent*)ptr->id.data; + value[0]= event->ascii; + value[1]= '\0'; +} + +static int rna_Event_ascii_length(PointerRNA *ptr) +{ + wmEvent *event= (wmEvent*)ptr->id.data; + return (event->ascii)? 1 : 0; +} + #else static void rna_def_operator(BlenderRNA *brna) @@ -146,7 +274,80 @@ static void rna_def_operator_filelist_element(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_IDPROPERTY); RNA_def_property_ui_text(prop, "Name", "the name of a file or directory within a file list"); } + +static void rna_def_event(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "Event", NULL); + RNA_def_struct_ui_text(srna, "Event", "Window Manager Event"); + RNA_def_struct_sdna(srna, "wmEvent"); + + /* strings */ + prop= RNA_def_property(srna, "ascii", PROP_STRING, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_string_funcs(prop, "rna_Event_ascii_get", "rna_Event_ascii_length", NULL); + RNA_def_property_ui_text(prop, "ASCII", "Single ASCII character for this event."); + + + /* enums */ + prop= RNA_def_property(srna, "value", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "val"); + RNA_def_property_enum_items(prop, event_value_items); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Value", "The type of event, only applies to some."); + + prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "type"); + RNA_def_property_enum_items(prop, event_type_items); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Type", ""); + + + /* mouse */ + prop= RNA_def_property(srna, "mouse_x", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "x"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Mouse X Position", "The window relative vertical location of the mouse."); + + prop= RNA_def_property(srna, "mouse_y", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "y"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Mouse Y Position", "The window relative horizontal location of the mouse."); + + prop= RNA_def_property(srna, "mouse_prev_x", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "prevx"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Mouse Previous X Position", "The window relative vertical location of the mouse."); + + prop= RNA_def_property(srna, "mouse_prev_y", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "prevy"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Mouse Previous Y Position", "The window relative horizontal location of the mouse."); + + /* modifiers */ + prop= RNA_def_property(srna, "shift", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "shift", 1); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Shift", "True when the shift key is held."); + + prop= RNA_def_property(srna, "ctrl", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "ctrl", 1); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Ctrl", "True when the shift key is held."); + + prop= RNA_def_property(srna, "alt", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "alt", 1); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Alt", "True when the shift key is held."); + + prop= RNA_def_property(srna, "oskey", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "oskey", 1); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "OS Key", "True when the shift key is held."); +} static void rna_def_windowmanager(BlenderRNA *brna) { @@ -169,6 +370,7 @@ void RNA_def_wm(BlenderRNA *brna) rna_def_operator(brna); rna_def_operator_utils(brna); rna_def_operator_filelist_element(brna); + rna_def_event(brna); rna_def_windowmanager(brna); } diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index f4fdd0c6194..542de6bd9b8 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -47,98 +47,6 @@ #define PYOP_ATTR_IDNAME "__name__" /* use pythons class name */ #define PYOP_ATTR_DESCRIPTION "__doc__" /* use pythons docstring */ -static PyObject *pyop_dict_from_event(wmEvent *event) -{ - PyObject *dict= PyDict_New(); - PyObject *item; - char *cstring, ascii[2]; - - /* type */ - item= PyUnicode_FromString(WM_key_event_string(event->type)); - PyDict_SetItemString(dict, "type", item); Py_DECREF(item); - - /* val */ - switch(event->val) { - case KM_ANY: - cstring = "ANY"; - break; - case KM_RELEASE: - cstring = "RELEASE"; - break; - case KM_PRESS: - cstring = "PRESS"; - break; - default: - cstring = "UNKNOWN"; - break; - } - - item= PyUnicode_FromString(cstring); - PyDict_SetItemString(dict, "val", item); Py_DECREF(item); - - /* x, y (mouse) */ - item= PyLong_FromLong(event->x); - PyDict_SetItemString(dict, "x", item); Py_DECREF(item); - - item= PyLong_FromLong(event->y); - PyDict_SetItemString(dict, "y", item); Py_DECREF(item); - - item= PyLong_FromLong(event->prevx); - PyDict_SetItemString(dict, "prevx", item); Py_DECREF(item); - - item= PyLong_FromLong(event->prevy); - PyDict_SetItemString(dict, "prevy", item); Py_DECREF(item); - - /* ascii */ - ascii[0]= event->ascii; - ascii[1]= '\0'; - item= PyUnicode_FromString(ascii); - PyDict_SetItemString(dict, "ascii", item); Py_DECREF(item); - - /* modifier keys */ - item= PyLong_FromLong(event->shift); - PyDict_SetItemString(dict, "shift", item); Py_DECREF(item); - - item= PyLong_FromLong(event->ctrl); - PyDict_SetItemString(dict, "ctrl", item); Py_DECREF(item); - - item= PyLong_FromLong(event->alt); - PyDict_SetItemString(dict, "alt", item); Py_DECREF(item); - - item= PyLong_FromLong(event->oskey); - PyDict_SetItemString(dict, "oskey", item); Py_DECREF(item); - - - - /* modifier */ -#if 0 - item= PyTuple_New(0); - if(event->keymodifier & KM_SHIFT) { - _PyTuple_Resize(&item, size+1); - PyTuple_SET_ITEM(item, size, _PyUnicode_AsString("SHIFT")); - size++; - } - if(event->keymodifier & KM_CTRL) { - _PyTuple_Resize(&item, size+1); - PyTuple_SET_ITEM(item, size, _PyUnicode_AsString("CTRL")); - size++; - } - if(event->keymodifier & KM_ALT) { - _PyTuple_Resize(&item, size+1); - PyTuple_SET_ITEM(item, size, _PyUnicode_AsString("ALT")); - size++; - } - if(event->keymodifier & KM_OSKEY) { - _PyTuple_Resize(&item, size+1); - PyTuple_SET_ITEM(item, size, _PyUnicode_AsString("OSKEY")); - size++; - } - PyDict_SetItemString(dict, "keymodifier", item); Py_DECREF(item); -#endif - - return dict; -} - static struct BPY_flag_def pyop_ret_flags[] = { {"RUNNING_MODAL", OPERATOR_RUNNING_MODAL}, {"CANCELLED", OPERATOR_CANCELLED}, @@ -180,6 +88,7 @@ static int PYTHON_OT_generic(int mode, bContext *C, wmOperator *op, wmEvent *eve int ret_flag= (mode==PYOP_POLL ? 0:OPERATOR_CANCELLED); PointerRNA ptr_context; PointerRNA ptr_operator; + PointerRNA ptr_event; PyObject *py_operator; PyGILState_STATE gilstate = PyGILState_Ensure(); @@ -230,11 +139,13 @@ static int PYTHON_OT_generic(int mode, bContext *C, wmOperator *op, wmEvent *eve if (mode==PYOP_INVOKE) { item= PyObject_GetAttrString(py_class, "invoke"); args = PyTuple_New(3); + + RNA_pointer_create(NULL, &RNA_Event, event, &ptr_event); // PyTuple_SET_ITEM "steals" object reference, it is // an object passed shouldn't be DECREF'ed PyTuple_SET_ITEM(args, 1, pyrna_struct_CreatePyObject(&ptr_context)); - PyTuple_SET_ITEM(args, 2, pyop_dict_from_event(event)); + PyTuple_SET_ITEM(args, 2, pyrna_struct_CreatePyObject(&ptr_event)); } else if (mode==PYOP_EXEC) { item= PyObject_GetAttrString(py_class, "execute"); diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 739cfbcc1ac..9b987cdfa51 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -58,37 +58,6 @@ enum { WM_OP_EXEC_SCREEN }; -/* ************** wmEvent ************************ */ - -/* each event should have full modifier state */ -/* event comes from eventmanager and from keymap */ -typedef struct wmEvent { - struct wmEvent *next, *prev; - - short type; /* event code itself (short, is also in keymap) */ - short val; /* press, release, scrollvalue */ - short x, y; /* mouse pointer position, screen coord */ - short mval[2]; /* region mouse position, name convention pre 2.5 :) */ - short prevx, prevy; /* previous mouse pointer position */ - short unicode; /* future, ghost? */ - char ascii; /* from ghost */ - char pad; - - /* modifier states */ - short shift, ctrl, alt, oskey; /* oskey is apple or windowskey, value denotes order of pressed */ - short keymodifier; /* rawkey modifier */ - - /* keymap item, set by handler (weak?) */ - const char *keymap_idname; - - /* custom data */ - short custom; /* custom data type, stylus, 6dof, see wm_event_types.h */ - void *customdata; /* ascii, unicode, mouse coords, angles, vectors, dragdrop info */ - short customdatafree; - -} wmEvent; - - /* ************** wmKeyMap ************************ */ /* modifier */ diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 7528321c7c5..85028e3ea1a 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -44,6 +44,7 @@ #include "RNA_access.h" #include "RNA_types.h" +#include "RNA_enum_types.h" #include "WM_api.h" #include "WM_types.h" @@ -155,313 +156,9 @@ ListBase *WM_keymap_listbase(wmWindowManager *wm, const char *nameid, int spacei char *WM_key_event_string(short type) { - /* not returned: CAPSLOCKKEY, UNKNOWNKEY, COMMANDKEY, GRLESSKEY */ - - switch(type) { - case AKEY: - return "A"; - break; - case BKEY: - return "B"; - break; - case CKEY: - return "C"; - break; - case DKEY: - return "D"; - break; - case EKEY: - return "E"; - break; - case FKEY: - return "F"; - break; - case GKEY: - return "G"; - break; - case HKEY: - return "H"; - break; - case IKEY: - return "I"; - break; - case JKEY: - return "J"; - break; - case KKEY: - return "K"; - break; - case LKEY: - return "L"; - break; - case MKEY: - return "M"; - break; - case NKEY: - return "N"; - break; - case OKEY: - return "O"; - break; - case PKEY: - return "P"; - break; - case QKEY: - return "Q"; - break; - case RKEY: - return "R"; - break; - case SKEY: - return "S"; - break; - case TKEY: - return "T"; - break; - case UKEY: - return "U"; - break; - case VKEY: - return "V"; - break; - case WKEY: - return "W"; - break; - case XKEY: - return "X"; - break; - case YKEY: - return "Y"; - break; - case ZKEY: - return "Z"; - break; - - case ZEROKEY: - return "Zero"; - break; - case ONEKEY: - return "One"; - break; - case TWOKEY: - return "Two"; - break; - case THREEKEY: - return "Three"; - break; - case FOURKEY: - return "Four"; - break; - case FIVEKEY: - return "Five"; - break; - case SIXKEY: - return "Six"; - break; - case SEVENKEY: - return "Seven"; - break; - case EIGHTKEY: - return "Eight"; - break; - case NINEKEY: - return "Nine"; - break; - - case LEFTCTRLKEY: - return "Leftctrl"; - break; - case LEFTALTKEY: - return "Leftalt"; - break; - case RIGHTALTKEY: - return "Rightalt"; - break; - case RIGHTCTRLKEY: - return "Rightctrl"; - break; - case RIGHTSHIFTKEY: - return "Rightshift"; - break; - case LEFTSHIFTKEY: - return "Leftshift"; - break; - - case ESCKEY: - return "Esc"; - break; - case TABKEY: - return "Tab"; - break; - case RETKEY: - return "Ret"; - break; - case SPACEKEY: - return "Space"; - break; - case LINEFEEDKEY: - return "Linefeed"; - break; - case BACKSPACEKEY: - return "Backspace"; - break; - case DELKEY: - return "Del"; - break; - case SEMICOLONKEY: - return "Semicolon"; - break; - case PERIODKEY: - return "Period"; - break; - case COMMAKEY: - return "Comma"; - break; - case QUOTEKEY: - return "Quote"; - break; - case ACCENTGRAVEKEY: - return "Accentgrave"; - break; - case MINUSKEY: - return "Minus"; - break; - case SLASHKEY: - return "Slash"; - break; - case BACKSLASHKEY: - return "Backslash"; - break; - case EQUALKEY: - return "Equal"; - break; - case LEFTBRACKETKEY: - return "Leftbracket"; - break; - case RIGHTBRACKETKEY: - return "Rightbracket"; - break; - - case LEFTARROWKEY: - return "Leftarrow"; - break; - case DOWNARROWKEY: - return "Downarrow"; - break; - case RIGHTARROWKEY: - return "Rightarrow"; - break; - case UPARROWKEY: - return "Uparrow"; - break; - - case PAD2: - return "Numpad 2"; - break; - case PAD4: - return "Numpad 4"; - break; - case PAD6: - return "Numpad 6"; - break; - case PAD8: - return "Numpad 8"; - break; - case PAD1: - return "Numpad 1"; - break; - case PAD3: - return "Numpad 3"; - break; - case PAD5: - return "Numpad 5"; - break; - case PAD7: - return "Numpad 7"; - break; - case PAD9: - return "Numpad 9"; - break; - - case PADPERIOD: - return "Numpad ."; - break; - case PADSLASHKEY: - return "Numpad /"; - break; - case PADASTERKEY: - return "Numpad *"; - break; - - case PAD0: - return "Numpad 0"; - break; - case PADMINUS: - return "Numpad -"; - break; - case PADENTER: - return "Numpad Enter"; - break; - case PADPLUSKEY: - return "Numpad +"; - break; - - case F1KEY: - return "F1"; - break; - case F2KEY: - return "F2"; - break; - case F3KEY: - return "F3"; - break; - case F4KEY: - return "F4"; - break; - case F5KEY: - return "F5"; - break; - case F6KEY: - return "F6"; - break; - case F7KEY: - return "F7"; - break; - case F8KEY: - return "F8"; - break; - case F9KEY: - return "F9"; - break; - case F10KEY: - return "F10"; - break; - case F11KEY: - return "F11"; - break; - case F12KEY: - return "F12"; - break; - - case PAUSEKEY: - return "Pause"; - break; - case INSERTKEY: - return "Insert"; - break; - case HOMEKEY: - return "Home"; - break; - case PAGEUPKEY: - return "Pageup"; - break; - case PAGEDOWNKEY: - return "Pagedown"; - break; - case ENDKEY: - return "End"; - break; - } + const char *name= NULL; + if(RNA_enum_name(event_type_items, (int)type, &name)) + return name; return ""; } -- cgit v1.2.3 From de77b4a9b36cc0f12c8bd458c4a7f662caec38ac Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sun, 21 Jun 2009 15:59:43 +0000 Subject: 2.5/Sculpt: Fixed bug where anchor brush would leave messed up normals (was related to using face normals, not vertex normals.) --- source/blender/editors/sculpt_paint/sculpt.c | 29 ++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index b61141ab62e..595c0463632 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -148,6 +148,7 @@ typedef struct StrokeCache { float *layer_disps; /* Displacements for each vertex */ float (*mesh_store)[3]; /* Copy of the mesh vertices' locations */ short (*orig_norms)[3]; /* Copy of the mesh vertices' normals */ + float (*face_norms)[3]; /* Copy of the mesh faces' normals */ float rotation; /* Texture rotation (radians) for anchored and rake modes */ int pixel_radius, previous_pixel_radius; ListBase grab_active_verts[8]; /* The same list of verts is used throught grab stroke */ @@ -1339,6 +1340,8 @@ static void sculpt_cache_free(StrokeCache *cache) MEM_freeN(cache->mesh_store); if(cache->orig_norms) MEM_freeN(cache->orig_norms); + if(cache->face_norms) + MEM_freeN(cache->face_norms); if(cache->mats) MEM_freeN(cache->mats); MEM_freeN(cache); @@ -1381,6 +1384,13 @@ static void sculpt_update_cache_invariants(Sculpt *sd, bContext *C, wmOperator * cache->orig_norms[i][1] = sd->session->mvert[i].no[1]; cache->orig_norms[i][2] = sd->session->mvert[i].no[2]; } + + if(sd->session->face_normals) { + float *fn = sd->session->face_normals; + cache->face_norms= MEM_mallocN(sizeof(float) * 3 * sd->session->totface, "Sculpt face norms"); + for(i = 0; i < sd->session->totface; ++i, fn += 3) + VecCopyf(cache->face_norms[i], fn); + } } } @@ -1507,16 +1517,23 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *even static void sculpt_restore_mesh(Sculpt *sd) { - StrokeCache *cache = sd->session->cache; + SculptSession *ss = sd->session; + StrokeCache *cache = ss->cache; int i; /* Restore the mesh before continuing with anchored stroke */ if((sd->brush->flag & BRUSH_ANCHORED) && cache->mesh_store) { - for(i = 0; i < sd->session->totvert; ++i) { - VecCopyf(sd->session->mvert[i].co, cache->mesh_store[i]); - sd->session->mvert[i].no[0] = cache->orig_norms[i][0]; - sd->session->mvert[i].no[1] = cache->orig_norms[i][1]; - sd->session->mvert[i].no[2] = cache->orig_norms[i][2]; + for(i = 0; i < ss->totvert; ++i) { + VecCopyf(ss->mvert[i].co, cache->mesh_store[i]); + ss->mvert[i].no[0] = cache->orig_norms[i][0]; + ss->mvert[i].no[1] = cache->orig_norms[i][1]; + ss->mvert[i].no[2] = cache->orig_norms[i][2]; + } + + if(ss->face_normals) { + float *fn = ss->face_normals; + for(i = 0; i < ss->totface; ++i, fn += 3) + VecCopyf(fn, cache->face_norms[i]); } } } -- cgit v1.2.3 From 8ead648fd1ca35f02901764445afc7b675524b67 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 21 Jun 2009 16:18:38 +0000 Subject: Spring Cleaning * removed radiosity render code, DNA and RNA (left in radio render pass options), we'll get GI to replace this probably, better allow baking to vertex colors for people who used this. * removed deprecated solid physics library, sumo integrations and qhull, a dependency * removed ODE, was no longer being build or supported * remove BEOS and AMIGA defines and references in Makefiles. --- source/Makefile | 11 - source/blender/CMakeLists.txt | 1 - source/blender/Makefile | 2 +- source/blender/SConscript | 1 - source/blender/blenkernel/BKE_utildefines.h | 2 +- source/blender/blenkernel/intern/blender.c | 1 - source/blender/blenkernel/intern/scene.c | 2 - source/blender/blenlib/intern/storage.c | 12 +- source/blender/blenlib/intern/util.c | 5 +- source/blender/blenloader/intern/readfile.c | 2 - source/blender/blenloader/intern/writefile.c | 1 - source/blender/blenpluginapi/intern/Makefile | 4 - source/blender/editors/space_buttons/SConscript | 3 - source/blender/editors/space_info/SConscript | 3 - source/blender/editors/space_logic/SConscript | 3 - source/blender/gpu/intern/Makefile | 2 +- source/blender/imbuf/intern/imbuf.h | 2 +- source/blender/imbuf/intern/readimage.c | 21 - source/blender/makesdna/DNA_radio_types.h | 62 - source/blender/makesdna/DNA_scene_types.h | 4 +- source/blender/makesdna/intern/makesdna.c | 2 - source/blender/makesrna/intern/makesrna.c | 1 - source/blender/makesrna/intern/rna_internal.h | 1 - source/blender/makesrna/intern/rna_radio.c | 140 --- source/blender/makesrna/intern/rna_scene.c | 4 - source/blender/makesrna/intern/rna_world.c | 2 +- source/blender/radiosity/CMakeLists.txt | 36 - source/blender/radiosity/Makefile | 34 - source/blender/radiosity/SConscript | 12 - source/blender/radiosity/extern/include/radio.h | 173 --- .../blender/radiosity/extern/include/radio_types.h | 168 --- source/blender/radiosity/intern/Makefile | 34 - source/blender/radiosity/intern/source/Makefile | 55 - .../blender/radiosity/intern/source/raddisplay.c | 477 ------- .../blender/radiosity/intern/source/radfactors.c | 939 -------------- source/blender/radiosity/intern/source/radio.c | 390 ------ source/blender/radiosity/intern/source/radnode.c | 1103 ----------------- .../radiosity/intern/source/radpostprocess.c | 824 ------------- .../radiosity/intern/source/radpreprocess.c | 828 ------------- source/blender/radiosity/intern/source/radrender.c | 530 -------- .../blender/render/extern/include/RE_render_ext.h | 3 +- .../blender/render/intern/source/convertblender.c | 7 +- source/blender/render/intern/source/pipeline.c | 1 - source/blender/render/intern/source/zbuf.c | 108 +- source/blender/windowmanager/intern/wm_init_exit.c | 5 - source/gameengine/BlenderRoutines/Makefile | 3 - source/gameengine/BlenderRoutines/SConscript | 5 - source/gameengine/CMakeLists.txt | 1 - .../Converter/BL_BlenderDataConversion.cpp | 13 - .../Converter/KX_BlenderSceneConverter.cpp | 28 +- source/gameengine/Converter/Makefile | 3 +- source/gameengine/Converter/SConscript | 5 - source/gameengine/GamePlayer/common/Makefile | 3 - source/gameengine/GamePlayer/common/SConscript | 5 - .../GamePlayer/common/unix/GPU_Engine.cpp | 3 - source/gameengine/GamePlayer/common/unix/Makefile | 2 - source/gameengine/GamePlayer/ghost/SConscript | 4 - source/gameengine/Ketsji/KX_ClientObjectInfo.h | 12 - source/gameengine/Ketsji/KX_ConvertPhysicsObject.h | 30 - .../gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 592 --------- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 4 - .../gameengine/Ketsji/KX_OdePhysicsController.cpp | 257 ---- source/gameengine/Ketsji/KX_OdePhysicsController.h | 109 -- .../gameengine/Ketsji/KX_SumoPhysicsController.cpp | 244 ---- .../gameengine/Ketsji/KX_SumoPhysicsController.h | 122 -- source/gameengine/Ketsji/Makefile | 4 +- source/gameengine/Ketsji/SConscript | 9 +- source/gameengine/Physics/BlOde/Makefile | 48 - .../Physics/BlOde/OdePhysicsController.cpp | 625 ---------- .../Physics/BlOde/OdePhysicsController.h | 164 --- .../Physics/BlOde/OdePhysicsEnvironment.cpp | 277 ----- .../Physics/BlOde/OdePhysicsEnvironment.h | 94 -- source/gameengine/Physics/BlOde/SConscript | 15 - source/gameengine/Physics/Dummy/Makefile | 2 +- source/gameengine/Physics/Makefile | 3 +- source/gameengine/Physics/Sumo/CMakeLists.txt | 46 - source/gameengine/Physics/Sumo/Fuzzics/Makefile | 34 - .../Physics/Sumo/Fuzzics/include/SM_Callback.h | 11 - .../Sumo/Fuzzics/include/SM_ClientObjectInfo.h | 16 - .../Physics/Sumo/Fuzzics/include/SM_Debug.h | 26 - .../Physics/Sumo/Fuzzics/include/SM_FhObject.h | 56 - .../Physics/Sumo/Fuzzics/include/SM_MotionState.h | 77 -- .../Physics/Sumo/Fuzzics/include/SM_Object.h | 393 ------ .../Physics/Sumo/Fuzzics/include/SM_Props.h | 58 - .../Physics/Sumo/Fuzzics/include/SM_Scene.h | 172 --- .../Physics/Sumo/Fuzzics/sample/Makefile | 25 - .../Physics/Sumo/Fuzzics/sample/particle.cpp | 709 ----------- .../Physics/Sumo/Fuzzics/sample/particle0.cpp | 695 ----------- .../gameengine/Physics/Sumo/Fuzzics/src/Makefile | 14 - .../Physics/Sumo/Fuzzics/src/SM_FhObject.cpp | 180 --- .../Physics/Sumo/Fuzzics/src/SM_MotionState.cpp | 100 -- .../Physics/Sumo/Fuzzics/src/SM_Object.cpp | 1298 -------------------- .../Physics/Sumo/Fuzzics/src/SM_Scene.cpp | 378 ------ source/gameengine/Physics/Sumo/Makefile | 50 - source/gameengine/Physics/Sumo/SConscript | 25 - .../Physics/Sumo/SumoPHYCallbackBridge.cpp | 66 - .../Physics/Sumo/SumoPHYCallbackBridge.h | 28 - .../Physics/Sumo/SumoPhysicsController.cpp | 495 -------- .../Physics/Sumo/SumoPhysicsController.h | 192 --- .../Physics/Sumo/SumoPhysicsEnvironment.cpp | 264 ---- .../Physics/Sumo/SumoPhysicsEnvironment.h | 110 -- source/gameengine/Physics/Sumo/convert.txt | 35 - .../gameengine/Physics/Sumo/include/interpolator.h | 27 - source/gameengine/Physics/common/Makefile | 2 +- source/gameengine/SConscript | 8 - source/nan_compile.mk | 15 - source/nan_definitions.mk | 41 - source/nan_link.mk | 4 - 108 files changed, 22 insertions(+), 14335 deletions(-) delete mode 100644 source/blender/makesdna/DNA_radio_types.h delete mode 100644 source/blender/makesrna/intern/rna_radio.c delete mode 100644 source/blender/radiosity/CMakeLists.txt delete mode 100644 source/blender/radiosity/Makefile delete mode 100644 source/blender/radiosity/SConscript delete mode 100644 source/blender/radiosity/extern/include/radio.h delete mode 100644 source/blender/radiosity/extern/include/radio_types.h delete mode 100644 source/blender/radiosity/intern/Makefile delete mode 100644 source/blender/radiosity/intern/source/Makefile delete mode 100644 source/blender/radiosity/intern/source/raddisplay.c delete mode 100644 source/blender/radiosity/intern/source/radfactors.c delete mode 100644 source/blender/radiosity/intern/source/radio.c delete mode 100644 source/blender/radiosity/intern/source/radnode.c delete mode 100644 source/blender/radiosity/intern/source/radpostprocess.c delete mode 100644 source/blender/radiosity/intern/source/radpreprocess.c delete mode 100644 source/blender/radiosity/intern/source/radrender.c delete mode 100644 source/gameengine/Ketsji/KX_OdePhysicsController.cpp delete mode 100644 source/gameengine/Ketsji/KX_OdePhysicsController.h delete mode 100644 source/gameengine/Ketsji/KX_SumoPhysicsController.cpp delete mode 100644 source/gameengine/Ketsji/KX_SumoPhysicsController.h delete mode 100644 source/gameengine/Physics/BlOde/Makefile delete mode 100644 source/gameengine/Physics/BlOde/OdePhysicsController.cpp delete mode 100644 source/gameengine/Physics/BlOde/OdePhysicsController.h delete mode 100644 source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp delete mode 100644 source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h delete mode 100644 source/gameengine/Physics/BlOde/SConscript delete mode 100644 source/gameengine/Physics/Sumo/CMakeLists.txt delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/Makefile delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/include/SM_Callback.h delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/include/SM_ClientObjectInfo.h delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/include/SM_Debug.h delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/include/SM_FhObject.h delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/include/SM_MotionState.h delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/include/SM_Object.h delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/include/SM_Props.h delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/include/SM_Scene.h delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/sample/Makefile delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/sample/particle.cpp delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/sample/particle0.cpp delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/src/Makefile delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/src/SM_FhObject.cpp delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/src/SM_MotionState.cpp delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/src/SM_Object.cpp delete mode 100644 source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp delete mode 100644 source/gameengine/Physics/Sumo/Makefile delete mode 100644 source/gameengine/Physics/Sumo/SConscript delete mode 100644 source/gameengine/Physics/Sumo/SumoPHYCallbackBridge.cpp delete mode 100644 source/gameengine/Physics/Sumo/SumoPHYCallbackBridge.h delete mode 100644 source/gameengine/Physics/Sumo/SumoPhysicsController.cpp delete mode 100644 source/gameengine/Physics/Sumo/SumoPhysicsController.h delete mode 100644 source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp delete mode 100644 source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h delete mode 100644 source/gameengine/Physics/Sumo/convert.txt delete mode 100644 source/gameengine/Physics/Sumo/include/interpolator.h (limited to 'source') diff --git a/source/Makefile b/source/Makefile index 2df57f58c73..62eb25acbc1 100644 --- a/source/Makefile +++ b/source/Makefile @@ -115,25 +115,16 @@ ifneq ($(NAN_NO_KETSJI),true) COMLIB += $(OCGDIR)/gameengine/ketsji/$(DEBUG_DIR)libketsji.a COMLIB += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a COMLIB += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a - COMLIB += $(NAN_SOLID)/lib/libsolid.a - COMLIB += $(NAN_SOLID)/lib/libsolid_broad.a - COMLIB += $(NAN_SOLID)/lib/libsolid_complex.a - COMLIB += $(NAN_SOLID)/lib/libsolid_convex.a - COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a COMLIB += $(OCGDIR)/gameengine/blphys/fuzzics/$(DEBUG_DIR)libfuzzics.a COMLIB += $(NAN_QHULL)/lib/libqhull.a COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a -# COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a COMLIB += $(OCGDIR)/gameengine/ketsji/$(DEBUG_DIR)libketsji.a COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a -# COMLIB += $(OCGDIR)/gameengine/blphys/blode/$(DEBUG_DIR)libblode.a -# COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a COMLIB += $(OCGDIR)/gameengine/blphys/blbullet/$(DEBUG_DIR)libblbullet.a COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a -# COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a COMLIB += $(OCGDIR)/gameengine/ketsji/$(DEBUG_DIR)libketsji.a COMLIB += $(OCGDIR)/gameengine/logic/$(DEBUG_DIR)liblogic.a @@ -143,8 +134,6 @@ ifneq ($(NAN_NO_KETSJI),true) COMLIB += $(OCGDIR)/gameengine/expression/$(DEBUG_DIR)libexpression.a COMLIB += $(OCGDIR)/gameengine/scenegraph/$(DEBUG_DIR)libscenegraph.a COMLIB += $(OCGDIR)/gameengine/videotex/$(DEBUG_DIR)libvideotex.a -# COMLIB += $(OCGDIR)/sumo/$(DEBUG_DIR)libfuzzics.a -# COMLIB += $(OCGDIR)/sumo/$(DEBUG_DIR)libsolid.a COMLIB += $(NAN_MOTO)/lib/libmoto.a COMLIB += $(NAN_SND_LIBS) COMLIB += $(OCGDIR)/kernel/gen_system/$(DEBUG_DIR)libgen_system.a diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt index a53b15673e2..a9e3d50211f 100644 --- a/source/blender/CMakeLists.txt +++ b/source/blender/CMakeLists.txt @@ -37,7 +37,6 @@ ADD_SUBDIRECTORY(imbuf/intern/cineon) ADD_SUBDIRECTORY(gpu) ADD_SUBDIRECTORY(makesdna) ADD_SUBDIRECTORY(makesrna) -ADD_SUBDIRECTORY(radiosity) ADD_SUBDIRECTORY(readblenfile) ADD_SUBDIRECTORY(render) ADD_SUBDIRECTORY(blenfont) diff --git a/source/blender/Makefile b/source/blender/Makefile index 64eb1a2614b..31636f838c3 100644 --- a/source/blender/Makefile +++ b/source/blender/Makefile @@ -31,7 +31,7 @@ include nan_definitions.mk DIRS = windowmanager editors blenloader readblenfile -DIRS += avi imbuf render radiosity blenlib blenkernel blenpluginapi +DIRS += avi imbuf render blenlib blenkernel blenpluginapi DIRS += makesdna makesrna DIRS += python nodes gpu DIRS += blenfont diff --git a/source/blender/SConscript b/source/blender/SConscript index 691fbf9b494..a064850c170 100644 --- a/source/blender/SConscript +++ b/source/blender/SConscript @@ -13,7 +13,6 @@ SConscript(['avi/SConscript', 'imbuf/intern/cineon/SConscript', 'makesdna/SConscript', 'makesrna/SConscript', - 'radiosity/SConscript', 'readblenfile/SConscript', 'render/SConscript', 'nodes/SConscript', diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h index 6584af085cd..8043eb74749 100644 --- a/source/blender/blenkernel/BKE_utildefines.h +++ b/source/blender/blenkernel/BKE_utildefines.h @@ -130,7 +130,7 @@ #define IN_RANGE(a, b, c) ((b < c)? ((bbase); seq_free_editing(sce->ed); - if(sce->radio) MEM_freeN(sce->radio); - sce->radio= 0; #ifndef DISABLE_PYTHON BPY_free_scriptlink(&sce->scriptlink); diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 688a4ab901b..0ae17a13e43 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -62,13 +62,6 @@ #include #endif -#ifdef __BeOS -struct statfs { - int f_bsize; - int f_bfree; -}; -#endif - #ifdef __APPLE__ /* For statfs */ #include @@ -77,7 +70,7 @@ struct statfs { #include -#if !defined(__BeOS) && !defined(WIN32) +#if !defined(WIN32) #include /* tape comando's */ #endif #include /* strcpy etc.. */ @@ -201,9 +194,6 @@ double BLI_diskfree(char *dir) #if defined (__FreeBSD__) || defined (linux) || defined (__OpenBSD__) || defined (__APPLE__) if (statfs(name, &disk)) return(-1); #endif -#ifdef __BeOS - return -1; -#endif #if defined (__sun__) || defined (__sun) || defined (__sgi) if (statvfs(name, &disk)) return(-1); diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index df4ad4e7c75..26f4c2dd415 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -737,10 +737,7 @@ void BLI_splitdirstring(char *di, char *fi) } char *BLI_gethome(void) { - #ifdef __BeOS - return "/boot/home/"; /* BeOS 4.5: doubleclick at icon doesnt give home env */ - - #elif !defined(WIN32) + #if !defined(WIN32) return getenv("HOME"); #else /* Windows */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 77e256f1435..48aa3f6a3b7 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3941,8 +3941,6 @@ static void direct_link_scene(FileData *fd, Scene *sce) direct_link_keyingsets(fd, &sce->keyingsets); sce->basact= newdataadr(fd, sce->basact); - - sce->radio= newdataadr(fd, sce->radio); sce->toolsettings= newdataadr(fd, sce->toolsettings); if(sce->toolsettings) { diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 9ef062bd7b6..172c081570b 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1600,7 +1600,6 @@ static void write_scenes(WriteData *wd, ListBase *scebase) base= base->next; } - writestruct(wd, DATA, "Radio", 1, sce->radio); writestruct(wd, DATA, "ToolSettings", 1, sce->toolsettings); if(sce->toolsettings->vpaint) writestruct(wd, DATA, "VPaint", 1, sce->toolsettings->vpaint); diff --git a/source/blender/blenpluginapi/intern/Makefile b/source/blender/blenpluginapi/intern/Makefile index 51905cad8ec..20a61e9a25c 100644 --- a/source/blender/blenpluginapi/intern/Makefile +++ b/source/blender/blenpluginapi/intern/Makefile @@ -33,10 +33,6 @@ DIR = $(OCGDIR)/blender/$(LIBNAME) include nan_compile.mk -ifeq ($(OS),$(findstring $(OS), "beos darwin freebsd linux openbsd solaris")) - CFLAGS += -shared -endif - CFLAGS += $(LEVEL_1_C_WARNINGS) # path to our own external headerfiles. On win2k this needs to be diff --git a/source/blender/editors/space_buttons/SConscript b/source/blender/editors/space_buttons/SConscript index 541da52f7f9..a0a7dad4077 100644 --- a/source/blender/editors/space_buttons/SConscript +++ b/source/blender/editors/space_buttons/SConscript @@ -12,7 +12,4 @@ defs = [] if env['WITH_BF_GAMEENGINE']: defs.append('GAMEBLENDER=1') - if env['WITH_BF_SOLID']: - defs.append('USE_SUMO_SOLID') - env.BlenderLib ( 'bf_editors_space_buttons', sources, Split(incs), defs, libtype=['core'], priority=[120] ) diff --git a/source/blender/editors/space_info/SConscript b/source/blender/editors/space_info/SConscript index 05afcae162e..01268115687 100644 --- a/source/blender/editors/space_info/SConscript +++ b/source/blender/editors/space_info/SConscript @@ -11,7 +11,4 @@ defs = [] if env['WITH_BF_GAMEENGINE']: defs.append('GAMEBLENDER=1') - if env['WITH_BF_SOLID']: - defs.append('USE_SUMO_SOLID') - env.BlenderLib ( 'bf_editors_space_info', sources, Split(incs), defs, libtype=['core'], priority=[70] ) diff --git a/source/blender/editors/space_logic/SConscript b/source/blender/editors/space_logic/SConscript index 46a9858a836..e32fcc1b535 100644 --- a/source/blender/editors/space_logic/SConscript +++ b/source/blender/editors/space_logic/SConscript @@ -12,7 +12,4 @@ defs = [] if env['WITH_BF_GAMEENGINE']: defs.append('GAMEBLENDER=1') - if env['WITH_BF_SOLID']: - defs.append('USE_SUMO_SOLID') - env.BlenderLib ( 'bf_editors_space_game', sources, Split(incs), defs, libtype=['core'], priority=[120] ) diff --git a/source/blender/gpu/intern/Makefile b/source/blender/gpu/intern/Makefile index 733ee3f764c..3a3ac20ff6c 100644 --- a/source/blender/gpu/intern/Makefile +++ b/source/blender/gpu/intern/Makefile @@ -35,7 +35,7 @@ DIR = $(OCGDIR)/blender/$(LIBNAME) include nan_compile.mk -ifeq ($(OS),$(findstring $(OS), "beos darwin freebsd linux openbsd solaris windows")) +ifeq ($(OS),$(findstring $(OS), "darwin freebsd linux openbsd solaris windows")) CFLAGS += -funsigned-char endif diff --git a/source/blender/imbuf/intern/imbuf.h b/source/blender/imbuf/intern/imbuf.h index bd2a0d3082f..7b5d668ce2b 100644 --- a/source/blender/imbuf/intern/imbuf.h +++ b/source/blender/imbuf/intern/imbuf.h @@ -51,7 +51,7 @@ #include #endif -#if !defined(WIN32) && !defined(__BeOS) +#if !defined(WIN32) #define O_BINARY 0 #endif diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c index 6df92f69fff..1a6ab104bcf 100644 --- a/source/blender/imbuf/intern/readimage.c +++ b/source/blender/imbuf/intern/readimage.c @@ -244,26 +244,6 @@ struct ImBuf *IMB_loadifffile(int file, int flags) { size = BLI_filesize(file); -#if defined(AMIGA) || defined(__BeOS) - mem= (int *)malloc(size); - if (mem==0) { - printf("Out of mem\n"); - return (0); - } - - if (read(file, mem, size)!=size){ - printf("Read Error\n"); - free(mem); - return (0); - } - - ibuf = IMB_ibImageFromMemory(mem, size, flags); - free(mem); - - /* for jpeg read */ - lseek(file, 0L, SEEK_SET); - -#else mem= (int *)mmap(0,size,PROT_READ,MAP_SHARED,file,0); if (mem==(int *)-1){ printf("Couldn't get mapping\n"); @@ -275,7 +255,6 @@ struct ImBuf *IMB_loadifffile(int file, int flags) { if (munmap( (void *) mem, size)){ printf("Couldn't unmap file.\n"); } -#endif return(ibuf); } diff --git a/source/blender/makesdna/DNA_radio_types.h b/source/blender/makesdna/DNA_radio_types.h deleted file mode 100644 index 4219bf59b93..00000000000 --- a/source/blender/makesdna/DNA_radio_types.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - * radio_types.h dec 2000 Nzc - * - * All type defs for the Blender core. - * - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - * - */ - -#ifndef DNA_RADIO_TYPES_H -#define DNA_RADIO_TYPES_H - -typedef struct Radio { - short hemires, maxiter; - short drawtype, flag; /* bit 0 and 1: show limits */ - short subshootp, subshoote, nodelim, maxsublamp; - short pama, pami, elma, elmi; /* patch and elem limits */ - int maxnode; - float convergence; - float radfac, gamma; /* for display */ - -} Radio; - - -/* **************** RADIOSITY ********************* */ - -/* draw type */ -#define RAD_WIREFRAME 0 -#define RAD_SOLID 1 -#define RAD_GOURAUD 2 - -/* flag */ -#define RAD_SHOWLIMITS 1 -#define RAD_SHOWZ 2 - -#endif - diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 7391201776e..4605d1f31e2 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -39,7 +39,6 @@ extern "C" { #include "DNA_scriptlink_types.h" #include "DNA_ID.h" -struct Radio; struct Object; struct World; struct Scene; @@ -158,7 +157,7 @@ typedef struct SceneRenderLayer { #define SCE_PASS_REFRACT 1024 #define SCE_PASS_INDEXOB 2048 #define SCE_PASS_UV 4096 -#define SCE_PASS_RADIO 8192 +#define SCE_PASS_RADIO 8192 /* Radio removed, can use for new GI? */ #define SCE_PASS_MIST 16384 /* note, srl->passflag is treestore element 'nr' in outliner, short still... */ @@ -570,7 +569,6 @@ typedef struct Scene { struct bNodeTree *nodetree; void *ed; /* sequence editor data is allocated here */ - struct Radio *radio; struct GameFraming framing; diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index bf2f0f3900e..91e9e617ea9 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -98,7 +98,6 @@ char *includefiles[] = { "DNA_object_force.h", "DNA_object_fluidsim.h", "DNA_world_types.h", - "DNA_radio_types.h", "DNA_scene_types.h", "DNA_view3d_types.h", "DNA_view2d_types.h", @@ -1124,7 +1123,6 @@ int main(int argc, char ** argv) #include "DNA_object_force.h" #include "DNA_object_fluidsim.h" #include "DNA_world_types.h" -#include "DNA_radio_types.h" #include "DNA_scene_types.h" #include "DNA_view3d_types.h" #include "DNA_view2d_types.h" diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 75293d83346..e7ca3fc5932 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1853,7 +1853,6 @@ RNAProcessItem PROCESS_ITEMS[]= { {"rna_particle.c", NULL, RNA_def_particle}, {"rna_pose.c", NULL, RNA_def_pose}, {"rna_property.c", NULL, RNA_def_gameproperty}, - {"rna_radio.c", NULL, RNA_def_radio}, {"rna_scene.c", NULL, RNA_def_scene}, {"rna_screen.c", NULL, RNA_def_screen}, {"rna_scriptlink.c", NULL, RNA_def_scriptlink}, diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 362217e3123..7538f103245 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -145,7 +145,6 @@ void RNA_def_object_force(struct BlenderRNA *brna); void RNA_def_packedfile(struct BlenderRNA *brna); void RNA_def_particle(struct BlenderRNA *brna); void RNA_def_pose(struct BlenderRNA *brna); -void RNA_def_radio(struct BlenderRNA *brna); void RNA_def_rna(struct BlenderRNA *brna); void RNA_def_scene(struct BlenderRNA *brna); void RNA_def_screen(struct BlenderRNA *brna); diff --git a/source/blender/makesrna/intern/rna_radio.c b/source/blender/makesrna/intern/rna_radio.c deleted file mode 100644 index 8b862b4c535..00000000000 --- a/source/blender/makesrna/intern/rna_radio.c +++ /dev/null @@ -1,140 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * Contributor(s): Blender Foundation (2008). - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include - -#include "RNA_define.h" -#include "RNA_types.h" - -#include "rna_internal.h" - -#include "DNA_radio_types.h" - -#ifdef RNA_RUNTIME - -#else - -void RNA_def_radio(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - static EnumPropertyItem prop_drawtype_items[] = { - {RAD_WIREFRAME, "WIREFRAME", 0, "Wireframe", "Enables Wireframe draw mode"}, - {RAD_SOLID, "SOLID", 0, "Solid", "Enables Solid draw mode"}, - {RAD_GOURAUD, "GOURAUD", 0, "Gouraud", "Enables Gouraud draw mode"}, - {0, NULL, 0, NULL, NULL}}; - - srna= RNA_def_struct(brna, "Radiosity", NULL); - RNA_def_struct_ui_text(srna, "Radiosity", "Settings for radiosity simulation of indirect diffuse lighting."); - RNA_def_struct_sdna(srna, "Radio"); - - /* Enums */ - prop= RNA_def_property(srna, "draw_mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "drawtype"); - RNA_def_property_enum_items(prop, prop_drawtype_items); - RNA_def_property_ui_text(prop, "Draw Mode", "Radiosity draw modes."); - - /* Number values */ - prop= RNA_def_property(srna, "hemi_resolution", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "hemires"); - RNA_def_property_range(prop, 100, 1000); - RNA_def_property_ui_text(prop, "Hemi Resolution", "Sets the size of a hemicube."); - - prop= RNA_def_property(srna, "max_iterations", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "maxiter"); - RNA_def_property_range(prop, 0, 10000); - RNA_def_property_ui_text(prop, "Max Iterations", "Limits the maximum number of radiosity rounds."); - - prop= RNA_def_property(srna, "multiplier", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "radfac"); - RNA_def_property_range(prop, 0.001f, 250.0f); - RNA_def_property_ui_text(prop, "Multiplier", "Multiplies the energy values."); - - prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "gamma"); - RNA_def_property_range(prop, 0.2f, 10.0f); - RNA_def_property_ui_text(prop, "Gamma", "Changes the contrast of the energy values."); - - prop= RNA_def_property(srna, "convergence", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "convergence"); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Convergence", "Sets the lower threshold of unshot energy."); - - prop= RNA_def_property(srna, "element_max", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "elma"); - RNA_def_property_range(prop, 1, 500); - RNA_def_property_ui_text(prop, "Element Max", "Sets maximum size of an element"); - - prop= RNA_def_property(srna, "element_min", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "elmi"); - RNA_def_property_range(prop, 1, 100); - RNA_def_property_ui_text(prop, "Element Min", "Sets minimum size of an element"); - - prop= RNA_def_property(srna, "patch_max", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "pama"); - RNA_def_property_range(prop, 10, 1000); - RNA_def_property_ui_text(prop, "Patch Max", "Sets maximum size of a patch."); - - prop= RNA_def_property(srna, "patch_min", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "pami"); - RNA_def_property_range(prop, 10, 1000); - RNA_def_property_ui_text(prop, "Patch Min", "Sets minimum size of a patch."); - - prop= RNA_def_property(srna, "subshoot_patch", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "subshootp"); - RNA_def_property_range(prop, 0, 10); - RNA_def_property_ui_text(prop, "SubShoot Patch", "Sets the number of times the environment is tested to detect paths."); - - prop= RNA_def_property(srna, "subshoot_element", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "subshoote"); - RNA_def_property_range(prop, 0, 10); - RNA_def_property_ui_text(prop, "SubShoot Element", "Sets the number of times the environment is tested to detect elements."); - - prop= RNA_def_property(srna, "max_elements", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "maxnode"); - RNA_def_property_range(prop, 1, 250000); - RNA_def_property_ui_text(prop, "Max Elements", "Sets the maximum allowed number of elements."); - - prop= RNA_def_property(srna, "max_subdiv_shoot", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "maxsublamp"); - RNA_def_property_range(prop, 1, 250); - RNA_def_property_ui_text(prop, "Max Subdiv Shoot", "Sets the maximum number of initial shoot patches that are evaluated"); - - prop= RNA_def_property(srna, "remove_doubles_limit", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "nodelim"); - RNA_def_property_range(prop, 0, 50); - RNA_def_property_ui_text(prop, "Remove Doubles Limit", "Sets the range for removing doubles"); - - /* flag */ - prop= RNA_def_property(srna, "show_limits", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", RAD_SHOWLIMITS); - RNA_def_property_ui_text(prop, "Show Limits", "Draws patch and element limits"); - - prop= RNA_def_property(srna, "show_z", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", RAD_SHOWZ); - RNA_def_property_ui_text(prop, "Show Z", "Draws limits differently"); -} - -#endif - diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 1365ab75fc7..5d4916bb3c6 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -923,10 +923,6 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "ed"); RNA_def_property_struct_type(prop, "SequenceEditor"); RNA_def_property_ui_text(prop, "Sequence Editor", ""); - - prop= RNA_def_property(srna, "radiosity", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "radio"); - RNA_def_property_ui_text(prop, "Radiosity", ""); prop= RNA_def_property(srna, "keyingsets", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "keyingsets", NULL); diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 4dba61411f0..f5eb81e3cea 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -337,7 +337,7 @@ void RNA_def_world(BlenderRNA *brna) static EnumPropertyItem physics_engine_items[] = { {WOPHY_NONE, "NONE", 0, "None", ""}, //{WOPHY_ENJI, "ENJI", 0, "Enji", ""}, - {WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""}, + //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""}, //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""}, //{WOPHY_ODE, "ODE", 0, "ODE", ""}, {WOPHY_BULLET, "BULLET", 0, "Bullet", ""}, diff --git a/source/blender/radiosity/CMakeLists.txt b/source/blender/radiosity/CMakeLists.txt deleted file mode 100644 index e76f7409f99..00000000000 --- a/source/blender/radiosity/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -# $Id$ -# ***** BEGIN GPL 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. -# -# 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) 2006, Blender Foundation -# All rights reserved. -# -# The Original Code is: all of this file. -# -# Contributor(s): Jacques Beaurain. -# -# ***** END GPL LICENSE BLOCK ***** - -FILE(GLOB SRC intern/source/*.c) - -SET(INC - extern/include ../blenlib ../blenkernel ../makesdna ../editors/include - ../../../intern/guardedalloc ../render/extern/include - ../render/intern/include ../blenloader ../../../extern/glew/include -) - -BLENDERLIB_NOLIST(blender_radiosity "${SRC}" "${INC}") -#env.BlenderLib ( 'blender_radiosity', sources, Split(incs), [], libtype='core', priority=50 ) diff --git a/source/blender/radiosity/Makefile b/source/blender/radiosity/Makefile deleted file mode 100644 index 91a13e2fd57..00000000000 --- a/source/blender/radiosity/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -# -# $Id$ -# -# ***** BEGIN GPL 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. -# -# 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. -# -# The Original Code is: all of this file. -# -# Contributor(s): none yet. -# -# ***** END GPL LICENSE BLOCK ***** -# -# Makes module object directory and bounces make to subdirectories. - -SOURCEDIR = source/blender/radiosity -DIRS = intern - -include nan_subdirs.mk diff --git a/source/blender/radiosity/SConscript b/source/blender/radiosity/SConscript deleted file mode 100644 index 29854d2ee83..00000000000 --- a/source/blender/radiosity/SConscript +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/python -Import ('env') - -sources = env.Glob('intern/source/*.c') - -incs = 'extern/include ../blenlib ../blenkernel ../makesdna ../editors/include' -incs += ' #/intern/guardedalloc ../render/extern/include' -incs += ' ../render/intern/include ../blenloader #/extern/glew/include' - -incs += ' ' + env['BF_OPENGL_INC'] - -env.BlenderLib ( 'bf_radiosity', sources, Split(incs), [], libtype='core', priority=150 ) diff --git a/source/blender/radiosity/extern/include/radio.h b/source/blender/radiosity/extern/include/radio.h deleted file mode 100644 index e7f23302880..00000000000 --- a/source/blender/radiosity/extern/include/radio.h +++ /dev/null @@ -1,173 +0,0 @@ -/* *************************************** - - - - radio.h nov/dec 1992 - revised for Blender may 1999 - - $Id$ - - ***** BEGIN GPL 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. - - 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. - - The Original Code is: all of this file. - - Contributor(s): none yet. - - ***** END GPL LICENSE BLOCK ***** - */ - -#ifndef RADIO_H -#define RADIO_H -#define RADIO_H - -/* type include */ -#include "radio_types.h" - -extern RadGlobal RG; -struct View3D; -struct Scene; - -/* radfactors.c */ -extern float calcStokefactor(RPatch *shoot, RPatch *rp, RNode *rn, float *area); -extern void calcTopfactors(void); -void calcSidefactors(void); -extern void initradiosity(void); -extern void rad_make_hocos(RadView *vw); -extern void hemizbuf(RadView *vw); -extern int makeformfactors(RPatch *shoot); -extern void applyformfactors(RPatch *shoot); -extern RPatch *findshootpatch(void); -extern void setnodeflags(RNode *rn, int flag, int set); -extern void backface_test(RPatch *shoot); -extern void clear_backface_test(void); -extern void progressiverad(void); -extern void minmaxradelem(RNode *rn, float *min, float *max); -extern void minmaxradelemfilt(RNode *rn, float *min, float *max, float *errmin, float *errmax); -extern void subdivideshootElements(int it); -extern void subdivideshootPatches(int it); -extern void inithemiwindows(void); -extern void closehemiwindows(void); -void rad_init_energy(void); - -/* radio.c */ -void freeAllRad(struct Scene *scene); -int rad_phase(void); -void rad_status_str(char *str); -void rad_printstatus(void); -void rad_setlimits(struct Scene *scene); -void set_radglobal(struct Scene *scene); -void add_radio(struct Scene *scene); -void delete_radio(struct Scene *scene); -int rad_go(struct Scene *scene); -void rad_subdivshootpatch(struct Scene *scene); -void rad_subdivshootelem(struct Scene *scene); -void rad_limit_subdivide(struct Scene *scene); - -/* radnode.c */ -extern void setnodelimit(float limit); -extern float *mallocVert(void); -extern float *callocVert(void); -extern void freeVert(float *vert); -extern int totalRadVert(void); -extern RNode *mallocNode(void); -extern RNode *callocNode(void); -extern void freeNode(RNode *node); -extern void freeNode_recurs(RNode *node); -extern RPatch *mallocPatch(void); -extern RPatch *callocPatch(void); -extern void freePatch(RPatch *patch); -extern void replaceAllNode(RNode *, RNode *); -extern void replaceAllNodeInv(RNode *neighb, RNode *old); -extern void replaceAllNodeUp(RNode *neighb, RNode *old); -extern void replaceTestNode(RNode *, RNode **, RNode *, int , float *); -extern void free_fastAll(void); - -/* radnode.c */ -extern void start_fastmalloc(char *str); -extern int setvertexpointersNode(RNode *neighb, RNode *node, int level, float **v1, float **v2); -extern float edlen(float *v1, float *v2); -extern void deleteNodes(RNode *node); -extern void subdivideTriNode(RNode *node, RNode *edge); -extern void subdivideNode(RNode *node, RNode *edge); -extern int comparelevel(RNode *node, RNode *nb, int level); - -/* radpreprocess.c */ -extern void splitconnected(void); -extern int vergedge(const void *v1,const void *v2); -extern void addedge(float *v1, float *v2, EdSort *es); -extern void setedgepointers(void); -extern void rad_collect_meshes(struct Scene *scene, struct View3D *v3d); -extern void countelem(RNode *rn); -extern void countglobaldata(void); -extern void addelem(RNode ***el, RNode *rn, RPatch *rp); -extern void makeGlobalElemArray(void); -extern void remakeGlobaldata(void); -extern void splitpatch(RPatch *old); -extern void addpatch(RPatch *old, RNode *rn); -extern void converttopatches(void); -extern void make_elements(void); -extern void subdividelamps(void); -extern void maxsizePatches(void); -extern void subdiv_elements(void); - -/* radpostprocess.c */ -void addaccu(register char *z, register char *t); -void addaccuweight(register char *z, register char *t, int w); -void triaweight(Face *face, int *w1, int *w2, int *w3); -void init_face_tab(void); -Face *addface(void); -Face *makeface(float *v1, float *v2, float *v3, float *v4, RNode *rn); -void anchorQuadface(RNode *rn, float *v1, float *v2, float *v3, float *v4, int flag); -void anchorTriface(RNode *rn, float *v1, float *v2, float *v3, int flag); -float *findmiddlevertex(RNode *node, RNode *nb, float *v1, float *v2); -void make_face_tab(void); -void filterFaces(void); -void calcfiltrad(RNode *rn, float *cd); -void filterNodes(void); -void removeEqualNodes(short limit); -void rad_addmesh(struct Scene *scene); -void rad_replacemesh(struct Scene *scene); - -/* raddisplay.c */ -extern char calculatecolor(float col); -extern void make_node_display(void); -extern void drawnodeWire(RNode *rn); -extern void drawsingnodeWire(RNode *rn); -extern void drawnodeSolid(RNode *rn); -extern void drawnodeGour(RNode *rn); -extern void drawpatch(RPatch *patch, unsigned int col); -extern void drawfaceGour(Face *face); -extern void drawfaceSolid(Face *face); -extern void drawfaceWire(Face *face); -extern void drawsquare(float *cent, float size, short cox, short coy); -extern void drawlimits(void); -extern void setcolNode(RNode *rn, unsigned int *col); -extern void pseudoAmb(void); -extern void rad_forcedraw(void); -extern void drawpatch_ext(RPatch *patch, unsigned int col); -extern void RAD_drawall(int depth_is_on); - -/* radrender.c */ -struct Render; -extern void do_radio_render(struct Render *re); -void end_radio_render(void); - -#endif /* RADIO_H */ - diff --git a/source/blender/radiosity/extern/include/radio_types.h b/source/blender/radiosity/extern/include/radio_types.h deleted file mode 100644 index 5a218ee71be..00000000000 --- a/source/blender/radiosity/extern/include/radio_types.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * radio_types.h - * - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/* #include "misc_util.h" */ /* for listbase...*/ - - -#ifndef RADIO_TYPES_H -#define RADIO_TYPES_H - -#include "DNA_listBase.h" -#include "DNA_material_types.h" - -struct Render; -struct CustomData; - -#define PI M_PI -#define RAD_MAXFACETAB 1024 -#define RAD_NEXTFACE(a) if( ((a) & 1023)==0 ) face= RG.facebase[(a)>>10]; else face++; - -/* RG.phase */ -#define RAD_SHOOTE 1 -#define RAD_SHOOTP 2 -#define RAD_SOLVE 3 - -typedef struct RadView { - float cam[3], tar[3], up[3]; - float wx1, wx2, wy1, wy2; - float mynear, myfar; - float viewmat[4][4], winmat[4][4]; - unsigned int *rect, *rectz; - short rectx, recty; - int wid; - -} RadView; - -/* rn->f */ -#define RAD_PATCH 1 -#define RAD_SHOOT 2 -#define RAD_SUBDIV 4 -#define RAD_BACKFACE 8 -#define RAD_TWOSIDED 16 - - -typedef struct RNode { /* length: 104 */ - struct RNode *down1, *down2, *up; - struct RNode *ed1, *ed2, *ed3, *ed4; - struct RPatch *par; - - char lev1, lev2, lev3, lev4; /* edgelevels */ - short type; /* type: 4==QUAD, 3==TRIA */ - short f; - float *v1, *v2, *v3, *v4; - float totrad[3], area; - - unsigned int col; - int orig; /* index in custom face data */ -} RNode; - - -typedef struct Face { /* length: 52 */ - float *v1, *v2, *v3, *v4; - unsigned int col, matindex; - int orig; /* index in custom face data */ -} Face; - -/* rp->f1 */ -#define RAD_NO_SPLIT 1 - -typedef struct RPatch { - struct RPatch *next, *prev; - RNode *first; /* first node==patch */ - - struct Object *from; - - int type; /* 3: TRIA, 4: QUAD */ - short f, f1; /* flags f: if node, only for subdiv */ - - float ref[3], emit[3], unshot[3]; - float cent[3], norm[3]; - float area; - int matindex; - -} RPatch; - - -typedef struct VeNoCo { /* needed for splitconnected */ - struct VeNoCo *next; - float *v; - float *n; - float *col; - int flag; -} VeNoCo; - - -typedef struct EdSort { /* sort edges */ - float *v1, *v2; - RNode *node; - int nr; -} EdSort; - -typedef struct { - struct Radio *radio; - unsigned int *hemibuf; - struct ListBase patchbase; - int totpatch, totelem, totvert, totlamp; - RNode **elem; /* global array with all pointers */ - VeNoCo *verts; /* temporal vertices from patches */ - float *formfactors; /* 1 factor per element */ - float *topfactors, *sidefactors; /* LUT for delta's */ - int *index; /* LUT for above LUT */ - Face **facebase; - int totface; - float min[3], max[3], size[3], cent[3]; /* world */ - float maxsize, totenergy; - float patchmin, patchmax; - float elemmin, elemmax; - float radfactor, lostenergy, igamma; /* radfac is in button, radfactor is calculated */ - int phase; - struct Render *re; /* for calling hemizbuf correctly */ - /* to preserve materials as used before, max 16 */ - Material *matar[MAXMAT]; - int totmat; - - /* for preserving face data */ - int mfdatatot; - struct CustomData *mfdata; - struct RNode **mfdatanodes; - - /* this part is a copy of struct Radio */ - short hemires, maxiter; - short drawtype, flag; /* bit 0 en 1: show limits */ - short subshootp, subshoote, nodelim, maxsublamp; - int maxnode; - float convergence; - float radfac, gamma; /* for display */ - -} RadGlobal; - -#endif /* radio_types.h */ - diff --git a/source/blender/radiosity/intern/Makefile b/source/blender/radiosity/intern/Makefile deleted file mode 100644 index 456b51cc56e..00000000000 --- a/source/blender/radiosity/intern/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -# -# $Id$ -# -# ***** BEGIN GPL 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. -# -# 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. -# -# The Original Code is: all of this file. -# -# Contributor(s): none yet. -# -# ***** END GPL LICENSE BLOCK ***** -# -# Makes module object directory and bounces make to subdirectories. - -SOURCEDIR = source/blender/radiosity/intern -DIRS = source - -include nan_subdirs.mk diff --git a/source/blender/radiosity/intern/source/Makefile b/source/blender/radiosity/intern/source/Makefile deleted file mode 100644 index 44b38de9bae..00000000000 --- a/source/blender/radiosity/intern/source/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# -# $Id$ -# -# ***** BEGIN GPL 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. -# -# 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. -# -# The Original Code is: all of this file. -# -# Contributor(s): none yet. -# -# ***** END GPL LICENSE BLOCK ***** -# -# radiosity uses the render lib -# - -LIBNAME = radiosity -DIR = $(OCGDIR)/blender/$(LIBNAME) - -include nan_compile.mk - -CFLAGS += $(LEVEL_1_C_WARNINGS) - -CPPFLAGS += -I$(NAN_GLEW)/include -CPPFLAGS += -I$(OPENGL_HEADERS) - -# not very neat.... -CPPFLAGS += -I../../../blenkernel -CPPFLAGS += -I../../../blenlib -CPPFLAGS += -I../../../makesdna -CPPFLAGS += -I../../../imbuf -CPPFLAGS += -I../../../ -CPPFLAGS += -I../../../blenloader -CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include - -# first /include is my own includes, second are the external includes -# third is the external interface. there should be a nicer way to say this -CPPFLAGS += -I../include -I../../../editors/include -I../../extern/include -CPPFLAGS += -I../../../render/extern/include -CPPFLAGS += -I../../../render/intern/include diff --git a/source/blender/radiosity/intern/source/raddisplay.c b/source/blender/radiosity/intern/source/raddisplay.c deleted file mode 100644 index ab9e8eedc28..00000000000 --- a/source/blender/radiosity/intern/source/raddisplay.c +++ /dev/null @@ -1,477 +0,0 @@ -/* *************************************** - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - - - - raddisplay.c nov/dec 1992 - may 1999 - - - drawing - - color calculation for display during solving - - $Id$ - - *************************************** */ - -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "BLI_blenlib.h" - -#include "DNA_radio_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_global.h" -#include "BKE_main.h" - -#include "BIF_gl.h" - -#include "radio.h" - -/* cpack has to be endian-insensitive! (old irisgl function) */ -#define cpack(x) glColor3ub( ((x)&0xFF), (((x)>>8)&0xFF), (((x)>>16)&0xFF) ) - -char calculatecolor(float col) -{ - int b; - - if(RG.gamma==1.0) { - b= RG.radfactor*col; - } - else if(RG.gamma==2.0) { - b= RG.radfactor*sqrt(col); - } - else { - b= RG.radfactor*pow(col, RG.igamma); - } - - if(b>255) b=255; - return b; -} - -void make_node_display() -{ - RNode *rn, **el; - int a; - char *charcol; - - RG.igamma= 1.0/RG.gamma; - RG.radfactor= RG.radfac*pow(64*64, RG.igamma); - - el= RG.elem; - for(a=RG.totelem; a>0; a--, el++) { - rn= *el; - charcol= (char *)&( rn->col ); - - charcol[3]= calculatecolor(rn->totrad[0]); - charcol[2]= calculatecolor(rn->totrad[1]); - charcol[1]= calculatecolor(rn->totrad[2]); - - /* gouraudcolor */ - *(rn->v1+3)= 0; - *(rn->v2+3)= 0; - *(rn->v3+3)= 0; - if(rn->v4) *(rn->v4+3)= 0; - } - - el= RG.elem; - for(a=RG.totelem; a>0; a--, el++) { - rn= *el; - addaccuweight( (char *)&(rn->col), (char *)(rn->v1+3), 16 ); - addaccuweight( (char *)&(rn->col), (char *)(rn->v2+3), 16 ); - addaccuweight( (char *)&(rn->col), (char *)(rn->v3+3), 16 ); - if(rn->v4) addaccuweight( (char *)&(rn->col), (char *)(rn->v4+3), 16 ); - } -} - -void drawnodeWire(RNode *rn) -{ - - if(rn->down1) { - drawnodeWire(rn->down1); - drawnodeWire(rn->down2); - } - else { - glBegin(GL_LINE_LOOP); - glVertex3fv(rn->v1); - glVertex3fv(rn->v2); - glVertex3fv(rn->v3); - if(rn->type==4) glVertex3fv(rn->v4); - glEnd(); - } -} - -void drawsingnodeWire(RNode *rn) -{ - - glBegin(GL_LINE_LOOP); - glVertex3fv(rn->v1); - glVertex3fv(rn->v2); - glVertex3fv(rn->v3); - if(rn->type==4) glVertex3fv(rn->v4); - glEnd(); -} - -void drawnodeSolid(RNode *rn) -{ - char *cp; - - if(rn->down1) { - drawnodeSolid(rn->down1); - drawnodeSolid(rn->down2); - } - else { - cp= (char *)&rn->col; - glColor3ub(cp[3], cp[2], cp[1]); - glBegin(GL_POLYGON); - glVertex3fv(rn->v1); - glVertex3fv(rn->v2); - glVertex3fv(rn->v3); - if(rn->type==4) glVertex3fv(rn->v4); - glEnd(); - } -} - -void drawnodeGour(RNode *rn) -{ - char *cp; - - if(rn->down1) { - drawnodeGour(rn->down1); - drawnodeGour(rn->down2); - } - else { - glBegin(GL_POLYGON); - cp= (char *)(rn->v1+3); - glColor3ub(cp[3], cp[2], cp[1]); - glVertex3fv(rn->v1); - - cp= (char *)(rn->v2+3); - glColor3ub(cp[3], cp[2], cp[1]); - glVertex3fv(rn->v2); - - cp= (char *)(rn->v3+3); - glColor3ub(cp[3], cp[2], cp[1]); - glVertex3fv(rn->v3); - - if(rn->type==4) { - cp= (char *)(rn->v4+3); - glColor3ub(cp[3], cp[2], cp[1]); - glVertex3fv(rn->v4); - } - glEnd(); - } -} - -void drawpatch_ext(RPatch *patch, unsigned int col) -{ - ScrArea *sa, *oldsa; - View3D *v3d; - glDrawBuffer(GL_FRONT); - - return; // XXX - - cpack(col); - - oldsa= NULL; // XXX curarea; - -// sa= G.curscreen->areabase.first; - while(sa) { - if (sa->spacetype==SPACE_VIEW3D) { - v3d= sa->spacedata.first; - - /* use mywinget() here: otherwise it draws in header */ -// XXX if(sa->win != mywinget()) areawinset(sa->win); -// XXX persp(PERSP_VIEW); - if(v3d->zbuf) glDisable(GL_DEPTH_TEST); - drawnodeWire(patch->first); - if(v3d->zbuf) glEnable(GL_DEPTH_TEST); // pretty useless? - } - sa= sa->next; - } - -// XXX if(oldsa && oldsa!=curarea) areawinset(oldsa->win); - - glFlush(); - glDrawBuffer(GL_BACK); -} - - -void drawfaceGour(Face *face) -{ - char *cp; - - glBegin(GL_POLYGON); - cp= (char *)(face->v1+3); - glColor3ub(cp[3], cp[2], cp[1]); - glVertex3fv(face->v1); - - cp= (char *)(face->v2+3); - glColor3ub(cp[3], cp[2], cp[1]); - glVertex3fv(face->v2); - - cp= (char *)(face->v3+3); - glColor3ub(cp[3], cp[2], cp[1]); - glVertex3fv(face->v3); - - if(face->v4) { - cp= (char *)(face->v4+3); - glColor3ub(cp[3], cp[2], cp[1]); - glVertex3fv(face->v4); - } - glEnd(); - -} - -void drawfaceSolid(Face *face) -{ - char *cp; - - cp= (char *)&face->col; - glColor3ub(cp[3], cp[2], cp[1]); - - glBegin(GL_POLYGON); - glVertex3fv(face->v1); - glVertex3fv(face->v2); - glVertex3fv(face->v3); - if(face->v4) { - glVertex3fv(face->v4); - } - glEnd(); - -} - -void drawfaceWire(Face *face) -{ - char *cp; - - cp= (char *)&face->col; - glColor3ub(cp[3], cp[2], cp[1]); - - glBegin(GL_LINE_LOOP); - glVertex3fv(face->v1); - glVertex3fv(face->v2); - glVertex3fv(face->v3); - if(face->v4) { - glVertex3fv(face->v4); - } - glEnd(); - -} - -void drawsquare(float *cent, float size, short cox, short coy) -{ - float vec[3]; - - vec[0]= cent[0]; - vec[1]= cent[1]; - vec[2]= cent[2]; - - glBegin(GL_LINE_LOOP); - vec[cox]+= .5*size; - vec[coy]+= .5*size; - glVertex3fv(vec); - vec[coy]-= size; - glVertex3fv(vec); - vec[cox]-= size; - glVertex3fv(vec); - vec[coy]+= size; - glVertex3fv(vec); - glEnd(); -} - -void drawlimits() -{ - /* center around cent */ - short cox=0, coy=1; - - if((RG.flag & (RAD_SHOWLIMITS|RAD_SHOWZ))==RAD_SHOWZ) coy= 2; - if((RG.flag & (RAD_SHOWLIMITS|RAD_SHOWZ))==(RAD_SHOWLIMITS|RAD_SHOWZ)) { - cox= 1; - coy= 2; - } - - cpack(0); - drawsquare(RG.cent, sqrt(RG.patchmax), cox, coy); - drawsquare(RG.cent, sqrt(RG.patchmin), cox, coy); - - drawsquare(RG.cent, sqrt(RG.elemmax), cox, coy); - drawsquare(RG.cent, sqrt(RG.elemmin), cox, coy); - - cpack(0xFFFFFF); - drawsquare(RG.cent, sqrt(RG.patchmax), cox, coy); - drawsquare(RG.cent, sqrt(RG.patchmin), cox, coy); - cpack(0xFFFF00); - drawsquare(RG.cent, sqrt(RG.elemmax), cox, coy); - drawsquare(RG.cent, sqrt(RG.elemmin), cox, coy); - -} - -void setcolNode(RNode *rn, unsigned int *col) -{ - - if(rn->down1) { - setcolNode(rn->down1, col); - setcolNode(rn->down2, col); - } - rn->col= *col; - - *((unsigned int *)rn->v1+3)= *col; - *((unsigned int *)rn->v2+3)= *col; - *((unsigned int *)rn->v3+3)= *col; - if(rn->v4) *((unsigned int *)rn->v4+3)= *col; -} - -void pseudoAmb() -{ - RPatch *rp; - float fac; - char col[4]; - - /* sets pseudo ambient color in the nodes */ - - rp= RG.patchbase.first; - while(rp) { - - if(rp->emit[0]!=0.0 || rp->emit[1]!=0.0 || rp->emit[2]!=0.0) { - col[1]= col[2]= col[3]= 255; - } - else { - fac= rp->norm[0]+ rp->norm[1]+ rp->norm[2]; - fac= 225.0*(3+fac)/6.0; - - col[3]= fac*rp->ref[0]; - col[2]= fac*rp->ref[1]; - col[1]= fac*rp->ref[2]; - } - - setcolNode(rp->first, (unsigned int *)col); - - rp= rp->next; - } -} - -void RAD_drawall(int depth_is_on) -{ - /* displays elements or faces */ - Face *face = NULL; - RNode **el; - RPatch *rp; - int a; - - if(!depth_is_on) { - glEnable(GL_DEPTH_TEST); - glClearDepth(1.0); glClear(GL_DEPTH_BUFFER_BIT); - } - - if(RG.totface) { - if(RG.drawtype==RAD_GOURAUD) { - glShadeModel(GL_SMOOTH); - for(a=0; afirst); - rp= rp->next; - } - } - } - else { - el= RG.elem; - if(RG.drawtype==RAD_GOURAUD) { - glShadeModel(GL_SMOOTH); - for(a=RG.totelem; a>0; a--, el++) { - drawnodeGour(*el); - } - } - else if(RG.drawtype==RAD_SOLID) { - for(a=RG.totelem; a>0; a--, el++) { - drawnodeSolid(*el); - } - } - else { - cpack(0); - for(a=RG.totelem; a>0; a--, el++) { - drawnodeWire(*el); - } - } - } - glShadeModel(GL_FLAT); - - if(RG.totpatch) { - if(RG.flag & (RAD_SHOWLIMITS|RAD_SHOWZ)) { - if(depth_is_on) glDisable(GL_DEPTH_TEST); - drawlimits(); - if(depth_is_on) glEnable(GL_DEPTH_TEST); - } - } - if(!depth_is_on) { - glDisable(GL_DEPTH_TEST); - } -} - -void rad_forcedraw() -{ - ScrArea *sa, *oldsa; - - return; // XXX - - oldsa= NULL; // XXX curarea; - -/// sa= G.curscreen->areabase.first; - while(sa) { - if (sa->spacetype==SPACE_VIEW3D) { - /* use mywinget() here: othwerwise it draws in header */ -// XXX if(sa->win != mywinget()) areawinset(sa->win); -// XXX scrarea_do_windraw(sa); - } - sa= sa->next; - } -// XXX screen_swapbuffers(); - -// XXX if(oldsa && oldsa!=curarea) areawinset(oldsa->win); -} - diff --git a/source/blender/radiosity/intern/source/radfactors.c b/source/blender/radiosity/intern/source/radfactors.c deleted file mode 100644 index b87473dd811..00000000000 --- a/source/blender/radiosity/intern/source/radfactors.c +++ /dev/null @@ -1,939 +0,0 @@ -/* *************************************** - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - - - - formfactors.c nov/dec 1992 - - $Id$ - - *************************************** */ - -#include -#include -#include - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_rand.h" - -#include "BKE_utildefines.h" -#include "BKE_global.h" -#include "BKE_main.h" - -#include "radio.h" -#include "RE_render_ext.h" /* for `RE_zbufferall_radio and RE_zbufferall_radio */ - -/* locals */ -static void rad_setmatrices(RadView *vw); -static void clearsubflagelem(RNode *rn); -static void setsubflagelem(RNode *rn); - -RadView hemitop, hemiside; - -float calcStokefactor(RPatch *shoot, RPatch *rp, RNode *rn, float *area) -{ - float tvec[3], fac; - float vec[4][3]; /* vectors of shoot->cent to vertices rp */ - float cross[4][3]; /* cross products of this */ - float rad[4]; /* anlgles between vecs */ - - /* test for direction */ - VecSubf(tvec, shoot->cent, rp->cent); - if( tvec[0]*shoot->norm[0]+ tvec[1]*shoot->norm[1]+ tvec[2]*shoot->norm[2]>0.0) - return 0.0; - - if(rp->type==4) { - - /* corner vectors */ - VecSubf(vec[0], shoot->cent, rn->v1); - VecSubf(vec[1], shoot->cent, rn->v2); - VecSubf(vec[2], shoot->cent, rn->v3); - VecSubf(vec[3], shoot->cent, rn->v4); - - Normalize(vec[0]); - Normalize(vec[1]); - Normalize(vec[2]); - Normalize(vec[3]); - - /* cross product */ - Crossf(cross[0], vec[0], vec[1]); - Crossf(cross[1], vec[1], vec[2]); - Crossf(cross[2], vec[2], vec[3]); - Crossf(cross[3], vec[3], vec[0]); - Normalize(cross[0]); - Normalize(cross[1]); - Normalize(cross[2]); - Normalize(cross[3]); - - /* angles */ - rad[0]= vec[0][0]*vec[1][0]+ vec[0][1]*vec[1][1]+ vec[0][2]*vec[1][2]; - rad[1]= vec[1][0]*vec[2][0]+ vec[1][1]*vec[2][1]+ vec[1][2]*vec[2][2]; - rad[2]= vec[2][0]*vec[3][0]+ vec[2][1]*vec[3][1]+ vec[2][2]*vec[3][2]; - rad[3]= vec[3][0]*vec[0][0]+ vec[3][1]*vec[0][1]+ vec[3][2]*vec[0][2]; - - rad[0]= acos(rad[0]); - rad[1]= acos(rad[1]); - rad[2]= acos(rad[2]); - rad[3]= acos(rad[3]); - - /* Stoke formula */ - VecMulf(cross[0], rad[0]); - VecMulf(cross[1], rad[1]); - VecMulf(cross[2], rad[2]); - VecMulf(cross[3], rad[3]); - - VECCOPY(tvec, shoot->norm); - fac= tvec[0]*cross[0][0]+ tvec[1]*cross[0][1]+ tvec[2]*cross[0][2]; - fac+= tvec[0]*cross[1][0]+ tvec[1]*cross[1][1]+ tvec[2]*cross[1][2]; - fac+= tvec[0]*cross[2][0]+ tvec[1]*cross[2][1]+ tvec[2]*cross[2][2]; - fac+= tvec[0]*cross[3][0]+ tvec[1]*cross[3][1]+ tvec[2]*cross[3][2]; - } - else { - /* corner vectors */ - VecSubf(vec[0], shoot->cent, rn->v1); - VecSubf(vec[1], shoot->cent, rn->v2); - VecSubf(vec[2], shoot->cent, rn->v3); - - Normalize(vec[0]); - Normalize(vec[1]); - Normalize(vec[2]); - - /* cross product */ - Crossf(cross[0], vec[0], vec[1]); - Crossf(cross[1], vec[1], vec[2]); - Crossf(cross[2], vec[2], vec[0]); - Normalize(cross[0]); - Normalize(cross[1]); - Normalize(cross[2]); - - /* angles */ - rad[0]= vec[0][0]*vec[1][0]+ vec[0][1]*vec[1][1]+ vec[0][2]*vec[1][2]; - rad[1]= vec[1][0]*vec[2][0]+ vec[1][1]*vec[2][1]+ vec[1][2]*vec[2][2]; - rad[2]= vec[2][0]*vec[0][0]+ vec[2][1]*vec[0][1]+ vec[2][2]*vec[0][2]; - - rad[0]= acos(rad[0]); - rad[1]= acos(rad[1]); - rad[2]= acos(rad[2]); - - /* Stoke formula */ - VecMulf(cross[0], rad[0]); - VecMulf(cross[1], rad[1]); - VecMulf(cross[2], rad[2]); - - VECCOPY(tvec, shoot->norm); - fac= tvec[0]*cross[0][0]+ tvec[1]*cross[0][1]+ tvec[2]*cross[0][2]; - fac+= tvec[0]*cross[1][0]+ tvec[1]*cross[1][1]+ tvec[2]*cross[1][2]; - fac+= tvec[0]*cross[2][0]+ tvec[1]*cross[2][1]+ tvec[2]*cross[2][2]; - } - - *area= -fac/(2.0*PI); - return (*area * (shoot->area/rn->area)); -} - - -void calcTopfactors() -{ - float xsq , ysq, xysq; - float n; - float *fp; - int a, b, hres; - - fp = RG.topfactors; - hres= RG.hemires/2; - n= hres; - - for (a=0; aho); */ - /* ver->clip = testclip(ver->ho); */ -/* */ - /* } */ -} - -static void rad_setmatrices(RadView *vw) /* for hemi's */ -{ - float up1[3], len, twist; - - i_lookat(vw->cam[0], vw->cam[1], vw->cam[2], vw->tar[0], vw->tar[1], vw->tar[2], 0, vw->viewmat); - up1[0] = vw->viewmat[0][0]*vw->up[0] + vw->viewmat[1][0]*vw->up[1] + vw->viewmat[2][0]*vw->up[2]; - up1[1] = vw->viewmat[0][1]*vw->up[0] + vw->viewmat[1][1]*vw->up[1] + vw->viewmat[2][1]*vw->up[2]; - up1[2] = vw->viewmat[0][2]*vw->up[0] + vw->viewmat[1][2]*vw->up[1] + vw->viewmat[2][2]*vw->up[2]; - - len= up1[0]*up1[0]+up1[1]*up1[1]; - if(len>0.0) { - twist= -atan2(up1[0], up1[1]); - } - else twist= 0.0; - - i_lookat(vw->cam[0], vw->cam[1], vw->cam[2], vw->tar[0], vw->tar[1], vw->tar[2], (180.0*twist/M_PI), vw->viewmat); - - /* window matrix was set in inithemiwindows */ - -} - - -void hemizbuf(RadView *vw) -{ - float *factors; - unsigned int *rz; - int a, b, inda, hres; - - rad_setmatrices(vw); - RE_zbufferall_radio(vw, RG.elem, RG.totelem, RG.re); /* Render for when we got renderfaces */ - - /* count factors */ - if(vw->recty==vw->rectx) factors= RG.topfactors; - else factors= RG.sidefactors; - hres= RG.hemires/2; - - rz= vw->rect; - for(a=0; arecty; a++) { - inda= hres*RG.index[a]; - for(b=0; brectx; b++, rz++) { - if(*rznorm, vec); - len= Normalize(up); - /* this safety for input normals that are zero or illegal sized */ - if(a>3) return 0; - } while(len==0.0 || len>1.0); - - VECCOPY(hemitop.up, up); - VECCOPY(hemiside.up, shoot->norm); - - Crossf(side, shoot->norm, up); - - /* five targets */ - VecAddf(tar[0], shoot->cent, shoot->norm); - VecAddf(tar[1], shoot->cent, up); - VecSubf(tar[2], shoot->cent, up); - VecAddf(tar[3], shoot->cent, side); - VecSubf(tar[4], shoot->cent, side); - - /* camera */ - VECCOPY(hemiside.cam, shoot->cent); - VECCOPY(hemitop.cam, shoot->cent); - - /* do it! */ - VECCOPY(hemitop.tar, tar[0]); - hemizbuf(&hemitop); - - for(a=1; a<5; a++) { - VECCOPY(hemiside.tar, tar[a]); - hemizbuf(&hemiside); - } - - /* convert factors to real radiosity */ - re= RG.elem; - fp= RG.formfactors; - - overfl= 0; - for(a= RG.totelem; a>0; a--, re++, fp++) { - - if(*fp!=0.0) { - - *fp *= shoot->area/(*re)->area; - - if(*fp>1.0) { - overfl= 1; - *fp= 1.0001; - } - } - } - - if(overfl) { - if(shoot->first->down1) { - splitpatch(shoot); - return 0; - } - } - - return 1; -} - -void applyformfactors(RPatch *shoot) -{ - RPatch *rp; - RNode **el, *rn; - float *fp, *ref, unr, ung, unb, r, g, b, w; - int a; - - unr= shoot->unshot[0]; - ung= shoot->unshot[1]; - unb= shoot->unshot[2]; - - fp= RG.formfactors; - el= RG.elem; - for(a=0; apar; - ref= rp->ref; - - r= (*fp)*unr*ref[0]; - g= (*fp)*ung*ref[1]; - b= (*fp)*unb*ref[2]; - - w= rn->area/rp->area; - rn->totrad[0]+= r; - rn->totrad[1]+= g; - rn->totrad[2]+= b; - - rp->unshot[0]+= w*r; - rp->unshot[1]+= w*g; - rp->unshot[2]+= w*b; - } - } - - shoot->unshot[0]= shoot->unshot[1]= shoot->unshot[2]= 0.0; -} - -RPatch *findshootpatch() -{ - RPatch *rp, *shoot; - float energy, maxenergy; - - shoot= 0; - maxenergy= 0.0; - rp= RG.patchbase.first; - while(rp) { - energy= rp->unshot[0]*rp->area; - energy+= rp->unshot[1]*rp->area; - energy+= rp->unshot[2]*rp->area; - - if(energy>maxenergy) { - shoot= rp; - maxenergy= energy; - } - rp= rp->next; - } - - if(shoot) { - maxenergy/= RG.totenergy; - if(maxenergydown1) { - setnodeflags(rn->down1, flag, set); - setnodeflags(rn->down2, flag, set); - } - else { - if(set) rn->f |= flag; - else rn->f &= ~flag; - } -} - -void backface_test(RPatch *shoot) -{ - RPatch *rp; - float tvec[3]; - - rp= RG.patchbase.first; - while(rp) { - if(rp!=shoot) { - - VecSubf(tvec, shoot->cent, rp->cent); - if( tvec[0]*rp->norm[0]+ tvec[1]*rp->norm[1]+ tvec[2]*rp->norm[2]<0.0) { - setnodeflags(rp->first, RAD_BACKFACE, 1); - } - } - rp= rp->next; - } -} - -void clear_backface_test() -{ - RNode **re; - int a; - - re= RG.elem; - for(a= RG.totelem-1; a>=0; a--, re++) { - (*re)->f &= ~RAD_BACKFACE; - } - -} - -void rad_init_energy() -{ - /* call before shooting */ - /* keep patches and elements, clear all data */ - RNode **el, *rn; - RPatch *rp; - int a; - - el= RG.elem; - for(a=RG.totelem; a>0; a--, el++) { - rn= *el; - VECCOPY(rn->totrad, rn->par->emit); - } - - RG.totenergy= 0.0; - rp= RG.patchbase.first; - while(rp) { - VECCOPY(rp->unshot, rp->emit); - - RG.totenergy+= rp->unshot[0]*rp->area; - RG.totenergy+= rp->unshot[1]*rp->area; - RG.totenergy+= rp->unshot[2]*rp->area; - - rp->f= 0; - - rp= rp->next; - } -} - -void progressiverad() -{ - RPatch *shoot; - float unshot[3]; - int it= 0; - - rad_printstatus(); - rad_init_energy(); - - shoot=findshootpatch(); - - while( shoot ) { - - setnodeflags(shoot->first, RAD_SHOOT, 1); - - backface_test(shoot); - - drawpatch_ext(shoot, 0x88FF00); - - if(shoot->first->f & RAD_TWOSIDED) { - VECCOPY(unshot, shoot->unshot); - VecNegf(shoot->norm); - if(makeformfactors(shoot)) - applyformfactors(shoot); - VecNegf(shoot->norm); - VECCOPY(shoot->unshot, unshot); - } - - if( makeformfactors(shoot) ) { - applyformfactors(shoot); - - it++; - //XXX set_timecursor(it); - if( (it & 3)==1 ) { - make_node_display(); - rad_forcedraw(); - } - setnodeflags(shoot->first, RAD_SHOOT, 0); - } - - clear_backface_test(); - - //XXX if(blender_test_break()) break; - if(RG.maxiter && RG.maxiter<=it) break; - - shoot=findshootpatch(); - - } - -} - - -/* ************* subdivideshoot *********** */ - -void minmaxradelem(RNode *rn, float *min, float *max) -{ - int c; - - if(rn->down1) { - minmaxradelem(rn->down1, min, max); - minmaxradelem(rn->down2, min, max); - } - else { - for(c=0; c<3; c++) { - min[c]= MIN2(min[c], rn->totrad[c]); - max[c]= MAX2(max[c], rn->totrad[c]); - } - } -} - -void minmaxradelemfilt(RNode *rn, float *min, float *max, float *errmin, float *errmax) -{ - float col[3], area; - int c; - - if(rn->down1) { - minmaxradelemfilt(rn->down1, min, max, errmin, errmax); - minmaxradelemfilt(rn->down2, min, max, errmin, errmax); - } - else { - VECCOPY(col, rn->totrad); - - for(c=0; c<3; c++) { - min[c]= MIN2(min[c], col[c]); - max[c]= MAX2(max[c], col[c]); - } - - VecMulf(col, 2.0); - area= 2.0; - if(rn->ed1) { - VecAddf(col, rn->ed1->totrad, col); - area+= 1.0; - } - if(rn->ed2) { - VecAddf(col, rn->ed2->totrad, col); - area+= 1.0; - } - if(rn->ed3) { - VecAddf(col, rn->ed3->totrad, col); - area+= 1.0; - } - if(rn->ed4) { - VecAddf(col, rn->ed4->totrad, col); - area+= 1.0; - } - VecMulf(col, 1.0/area); - - for(c=0; c<3; c++) { - errmin[c]= MIN2(errmin[c], col[c]); - errmax[c]= MAX2(errmax[c], col[c]); - } - } -} - -static void setsubflagelem(RNode *rn) -{ - - if(rn->down1) { - setsubflagelem(rn->down1); - setsubflagelem(rn->down2); - } - else { - rn->f |= RAD_SUBDIV; - } -} - -static void clearsubflagelem(RNode *rn) -{ - - if(rn->down1) { - setsubflagelem(rn->down1); - setsubflagelem(rn->down2); - } - else { - rn->f &= ~RAD_SUBDIV; - } -} - -void subdivideshootElements(int it) -{ - RPatch *rp, *shoot; - RNode **el, *rn; - float *fp, err, stoke, area, min[3], max[3], errmin[3], errmax[3]; - int a, b, c, d, e, f, contin; - int maxlamp; - - if(RG.maxsublamp==0) maxlamp= RG.totlamp; - else maxlamp= RG.maxsublamp; - - while(it) { - rad_printstatus(); - rad_init_energy(); - it--; - - for(a=0; afirst, RAD_SHOOT, 1); - if( makeformfactors(shoot) ) { - - fp= RG.formfactors; - el= RG.elem; - for(b=RG.totelem; b>0; b--, el++) { - rn= *el; - - if( (rn->f & RAD_SUBDIV)==0 && *fp!=0.0) { - if(rn->par->emit[0]+rn->par->emit[1]+rn->par->emit[2]==0.0) { - - stoke= calcStokefactor(shoot, rn->par, rn, &area); - if(stoke!= 0.0) { - - err= *fp/stoke; - - /* area error */ - area*=(0.5*RG.hemires*RG.hemires); - - if(area>35.0) { - if(err<0.95 || err>1.05) { - if(err>0.05) { - rn->f |= RAD_SUBDIV; - rn->par->f |= RAD_SUBDIV; - } - } - } - } - - } - } - - fp++; - - } - - applyformfactors(shoot); - - if( (a & 3)==1 ) { - make_node_display(); - rad_forcedraw(); - } - - setnodeflags(shoot->first, RAD_SHOOT, 0); - } - else a--; - - //XXX if(blender_test_break()) break; - } - - /* test for extreme small color change within a patch with subdivflag */ - - rp= RG.patchbase.first; - - while(rp) { - if(rp->f & RAD_SUBDIV) { /* rp has elems that need subdiv */ - /* at least 4 levels deep */ - rn= rp->first->down1; - if(rn) { - rn= rn->down1; - if(rn) { - rn= rn->down1; - if(rn) rn= rn->down1; - } - } - if(rn) { - INIT_MINMAX(min, max); - /* errmin and max are the filtered colors */ - INIT_MINMAX(errmin, errmax); - minmaxradelemfilt(rp->first, min, max, errmin, errmax); - - /* if small difference between colors: no subdiv */ - /* also test for the filtered ones: but with higher critical level */ - - contin= 0; - a= abs( calculatecolor(min[0])-calculatecolor(max[0])); - b= abs( calculatecolor(errmin[0])-calculatecolor(errmax[0])); - if(a<15 || b<7) { - c= abs( calculatecolor(min[1])-calculatecolor(max[1])); - d= abs( calculatecolor(errmin[1])-calculatecolor(errmax[1])); - if(c<15 || d<7) { - e= abs( calculatecolor(min[2])-calculatecolor(max[2])); - f= abs( calculatecolor(errmin[2])-calculatecolor(errmax[2])); - if(e<15 || f<7) { - contin= 1; - clearsubflagelem(rp->first); - /* printf("%d %d %d %d %d %d\n", a, b, c, d, e, f); */ - } - } - } - if(contin) { - drawpatch_ext(rp, 0xFFFF); - } - } - } - rp->f &= ~RAD_SUBDIV; - rp= rp->next; - } - - contin= 0; - - el= RG.elem; - for(b=RG.totelem; b>0; b--, el++) { - rn= *el; - if(rn->f & RAD_SUBDIV) { - rn->f-= RAD_SUBDIV; - subdivideNode(rn, 0); - if(rn->down1) { - subdivideNode(rn->down1, 0); - subdivideNode(rn->down2, 0); - contin= 1; - } - } - } - makeGlobalElemArray(); - - //XXX if(contin==0 || blender_test_break()) break; - } - - make_node_display(); -} - -void subdivideshootPatches(int it) -{ - RPatch *rp, *shoot, *next; - float *fp, err, stoke, area; - int a, contin; - int maxlamp; - - if(RG.maxsublamp==0) maxlamp= RG.totlamp; - else maxlamp= RG.maxsublamp; - - while(it) { - rad_printstatus(); - rad_init_energy(); - it--; - - for(a=0; afirst, RAD_SHOOT, 1); - - if( makeformfactors(shoot) ) { - - fp= RG.formfactors; - rp= RG.patchbase.first; - while(rp) { - if(*fp!=0.0 && rp!=shoot) { - - stoke= calcStokefactor(shoot, rp, rp->first, &area); - if(stoke!= 0.0) { - if(area>.1) { /* does patch receive more than (about)10% of energy? */ - rp->f= RAD_SUBDIV; - } - else { - - err= *fp/stoke; - - /* area error */ - area*=(0.5*RG.hemires*RG.hemires); - - if(area>45.0) { - if(err<0.95 || err>1.05) { - if(err>0.05) { - - rp->f= RAD_SUBDIV; - - } - } - } - } - } - } - fp++; - - rp= rp->next; - } - - applyformfactors(shoot); - - if( (a & 3)==1 ) { - make_node_display(); - rad_forcedraw(); - } - - setnodeflags(shoot->first, RAD_SHOOT, 0); - - //XXX if(blender_test_break()) break; - } - else a--; - - } - - contin= 0; - - rp= RG.patchbase.first; - while(rp) { - next= rp->next; - if(rp->f & RAD_SUBDIV) { - if(rp->emit[0]+rp->emit[1]+rp->emit[2]==0.0) { - contin= 1; - subdivideNode(rp->first, 0); - if(rp->first->down1) { - subdivideNode(rp->first->down1, 0); - subdivideNode(rp->first->down2, 0); - } - } - } - rp= next; - } - - converttopatches(); - makeGlobalElemArray(); - - //XXX if(contin==0 || blender_test_break()) break; - } - make_node_display(); -} - -void inithemiwindows() -{ - RadView *vw; - - /* the hemiwindows */ - vw= &(hemitop); - memset(vw, 0, sizeof(RadView)); - vw->rectx= RG.hemires; - vw->recty= RG.hemires; - vw->rectz= MEM_mallocN(sizeof(int)*vw->rectx*vw->recty, "initwindows"); - vw->rect= MEM_mallocN(sizeof(int)*vw->rectx*vw->recty, "initwindows"); - vw->mynear= RG.maxsize/2000.0; - vw->myfar= 2.0*RG.maxsize; - vw->wx1= -vw->mynear; - vw->wx2= vw->mynear; - vw->wy1= -vw->mynear; - vw->wy2= vw->mynear; - - i_window(vw->wx1, vw->wx2, vw->wy1, vw->wy2, vw->mynear, vw->myfar, vw->winmat); - - hemiside= hemitop; - - vw= &(hemiside); - vw->recty/= 2; - vw->wy1= vw->wy2; - vw->wy2= 0.0; - - i_window(vw->wx1, vw->wx2, vw->wy1, vw->wy2, vw->mynear, vw->myfar, vw->winmat); - -} - -void closehemiwindows() -{ - - if(hemiside.rect) MEM_freeN(hemiside.rect); - if(hemiside.rectz) MEM_freeN(hemiside.rectz); - hemiside.rectz= 0; - hemiside.rect= 0; - hemitop.rectz= 0; - hemitop.rect= 0; -} diff --git a/source/blender/radiosity/intern/source/radio.c b/source/blender/radiosity/intern/source/radio.c deleted file mode 100644 index 63032b2d603..00000000000 --- a/source/blender/radiosity/intern/source/radio.c +++ /dev/null @@ -1,390 +0,0 @@ -/* *************************************** - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - - - - radio.c nov/dec 1992 - may 1999 - - $Id$ - - - mainloop - - interactivity - - - - PREPROCES - - collect meshes - - spitconnected (all faces with different color and normals) - - setedgepointers (nodes pointing to neighbours) - - - EDITING - - min-max patch en min-max element size - - using this info patches subdividing - - lamp subdivide - - - if there are too many lamps for subdivide shooting: - - temporal join patches - - - SUBDIVIDE SHOOTING - - except for last shooting, this defines patch subdivide - - if subdivided patches still > 2*minsize : continue - - at the end create as many elements as possible - - als store if lamp (can still) cause subdivide. - - - REFINEMENT SHOOTING - - test for overflows (shootpatch subdivide) - - testen for extreme color transitions: - - if possible: shootpatch subdivide - - elements subdivide = start over ? - - continue itterate until ? - - - DEFINITIVE SHOOTING - - user indicates how many faces maximum and duration of itteration. - - - POST PROCESS - - join element- nodes when nothing happens in it (filter nodes, filter faces) - - define gamma & mul - - *************************************** */ - -#include -#include - -#include "MEM_guardedalloc.h" -#include "PIL_time.h" - -#include "BLI_blenlib.h" - -#include "DNA_object_types.h" -#include "DNA_radio_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" - -#include "BKE_customdata.h" -#include "BKE_global.h" -#include "BKE_main.h" - -#include "radio.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -/* locals? This one was already done in radio.h... */ -/* void rad_status_str(char *str); */ - -RadGlobal RG= {0, 0}; - -void freeAllRad(Scene *scene) -{ - Base *base; - extern int Ntotvert, Ntotnode, Ntotpatch; - - /* clear flag that disables drawing the meshes */ - if(scene) { - base= (scene->base.first); - while(base) { - if(base->object->type==OB_MESH) { - base->flag &= ~OB_RADIO; - } - base= base->next; - } - } - - free_fastAll(); /* verts, nodes, patches */ - RG.patchbase.first= RG.patchbase.last= 0; - Ntotvert= Ntotnode= Ntotpatch= 0; - - closehemiwindows(); /* not real windows anymore... */ - if(RG.elem) MEM_freeN(RG.elem); - RG.elem= 0; - if(RG.verts) MEM_freeN(RG.verts); - RG.verts= 0; - if(RG.topfactors) MEM_freeN(RG.topfactors); - RG.topfactors= 0; - if(RG.sidefactors) MEM_freeN(RG.sidefactors); - RG.sidefactors= 0; - if(RG.formfactors) MEM_freeN(RG.formfactors); - RG.formfactors= 0; - if(RG.index) MEM_freeN(RG.index); - RG.index= 0; - if(RG.facebase) { - init_face_tab(); /* frees all tables */ - MEM_freeN(RG.facebase); - RG.facebase= 0; - } - - if(RG.mfdata) { - CustomData_free(RG.mfdata, RG.mfdatatot); - MEM_freeN(RG.mfdata); - MEM_freeN(RG.mfdatanodes); - RG.mfdatanodes= NULL; - RG.mfdata= NULL; - RG.mfdatatot= 0; - } - RG.totelem= RG.totpatch= RG.totvert= RG.totface= RG.totlamp= RG.totmat= 0; -} - -int rad_phase() -{ - int flag= 0; - - if(RG.totpatch) flag |= RAD_PHASE_PATCHES; - if(RG.totface) flag |= RAD_PHASE_FACES; - - return flag; -} - -void rad_status_str(char *str) -{ - extern int totfastmem; - int tot; - char *phase; - - tot= (RG.totface*sizeof(Face))/1024; - tot+= totfastmem/1024; - - if(RG.phase==RAD_SHOOTE) phase= "Phase: ELEMENT SUBD, "; - else if(RG.phase==RAD_SHOOTP) phase= "Phase: PATCH SUBD, "; - else if(RG.phase==RAD_SOLVE) phase= "Phase: SOLVE, "; - else if(RG.totpatch==0) phase= "Phase: COLLECT MESHES "; - else if(RG.totface) phase= "Phase: FINISHED, "; - else phase= "Phase: INIT, "; - - if(RG.totpatch==0) strcpy(str, phase); - else sprintf(str, "%s TotPatch: %d TotElem: %d Emit: %d Faces %d Mem: %d k ", phase, RG.totpatch, RG.totelem, RG.totlamp, RG.totface, tot); - - if(RG.phase==RAD_SOLVE) strcat(str, "(press ESC to stop)"); -} - -void rad_printstatus() -{ - /* actions always are started from a buttonswindow */ -// XX if(curarea) { -// scrarea_do_windraw(curarea); -// screen_swapbuffers(); -// } -} - -void rad_setlimits(Scene *scene) -{ - Radio *rad= scene->radio; - float fac; - - fac= 0.0005*rad->pama; - RG.patchmax= RG.maxsize*fac; - RG.patchmax*= RG.patchmax; - fac= 0.0005*rad->pami; - RG.patchmin= RG.maxsize*fac; - RG.patchmin*= RG.patchmin; - - fac= 0.0005*rad->elma; - RG.elemmax= RG.maxsize*fac; - RG.elemmax*= RG.elemmax; - fac= 0.0005*rad->elmi; - RG.elemmin= RG.maxsize*fac; - RG.elemmin*= RG.elemmin; -} - -void set_radglobal(Scene *scene) -{ - /* always call before any action is performed */ - Radio *rad= scene->radio; - - if(RG.radio==0) { - /* firsttime and to be sure */ - memset(&RG, 0, sizeof(RadGlobal)); - } - - if(rad==0) return; - - if(rad != RG.radio) { - if(RG.radio) freeAllRad(scene); - memset(&RG, 0, sizeof(RadGlobal)); - RG.radio= rad; - } - - RG.hemires= rad->hemires & 0xFFF0; - RG.drawtype= rad->drawtype; - RG.flag= rad->flag; - RG.subshootp= rad->subshootp; - RG.subshoote= rad->subshoote; - RG.nodelim= rad->nodelim; - RG.maxsublamp= rad->maxsublamp; - RG.maxnode= 2*rad->maxnode; /* in button:max elem, subdividing! */ - RG.convergence= rad->convergence/1000.0; - RG.radfac= rad->radfac; - RG.gamma= rad->gamma; - RG.maxiter= rad->maxiter; - - RG.re= NULL; /* struct render, for when call it from render engine */ - - rad_setlimits(scene); -} - -/* called from buttons.c */ -void add_radio(Scene *scene) -{ - Radio *rad; - - if(scene->radio) MEM_freeN(scene->radio); - rad= scene->radio= MEM_callocN(sizeof(Radio), "radio"); - - rad->hemires= 300; - rad->convergence= 0.1; - rad->radfac= 30.0; - rad->gamma= 2.0; - rad->drawtype= RAD_SOLID; - rad->subshootp= 1; - rad->subshoote= 2; - rad->maxsublamp= 0; - - rad->pama= 500; - rad->pami= 200; - rad->elma= 100; - rad->elmi= 20; - rad->nodelim= 0; - rad->maxnode= 10000; - rad->maxiter= 120; // arbitrary - rad->flag= 2; - set_radglobal(scene); -} - -void delete_radio(Scene *scene) -{ - freeAllRad(scene); - if(scene->radio) MEM_freeN(scene->radio); - scene->radio= 0; - - RG.radio= 0; -} - -int rad_go(Scene *scene) /* return 0 when user escapes */ -{ - double stime= PIL_check_seconds_timer(); - int retval; - - if(RG.totface) return 0; - - G.afbreek= 0; - - set_radglobal(scene); - initradiosity(); /* LUT's */ - inithemiwindows(); /* views */ - - maxsizePatches(); - - setnodelimit(RG.patchmin); - RG.phase= RAD_SHOOTP; - subdivideshootPatches(RG.subshootp); - - setnodelimit(RG.elemmin); - RG.phase= RAD_SHOOTE; - subdivideshootElements(RG.subshoote); - - setnodelimit(RG.patchmin); - subdividelamps(); - - setnodelimit(RG.elemmin); - - RG.phase= RAD_SOLVE; - subdiv_elements(); - - progressiverad(); - - removeEqualNodes(RG.nodelim); - - make_face_tab(); /* now anchored */ - - closehemiwindows(); - RG.phase= 0; - - stime= PIL_check_seconds_timer()-stime; - printf("Radiosity solving time: %dms\n", (int) (stime*1000)); - - if(G.afbreek==1) retval= 1; - else retval= 0; - - G.afbreek= 0; - - return retval; -} - -void rad_subdivshootpatch(Scene *scene) -{ - - if(RG.totface) return; - - G.afbreek= 0; - - set_radglobal(scene); - initradiosity(); /* LUT's */ - inithemiwindows(); /* views */ - - subdivideshootPatches(1); - - removeEqualNodes(RG.nodelim); - closehemiwindows(); - -// XXX allqueue(REDRAWVIEW3D, 1); -} - -void rad_subdivshootelem(Scene *scene) -{ - - if(RG.totface) return; - - G.afbreek= 0; - - set_radglobal(scene); - initradiosity(); /* LUT's */ - inithemiwindows(); /* views */ - - subdivideshootElements(1); - - removeEqualNodes(RG.nodelim); - closehemiwindows(); - -// XXX allqueue(REDRAWVIEW3D, 1); -} - -void rad_limit_subdivide(Scene *scene) -{ - - if(scene->radio==0) return; - - set_radglobal(scene); - - if(RG.totpatch==0) { - /* printf("exit: no relevant data\n"); */ - return; - } - - maxsizePatches(); - - init_face_tab(); /* free faces */ -} diff --git a/source/blender/radiosity/intern/source/radnode.c b/source/blender/radiosity/intern/source/radnode.c deleted file mode 100644 index fa23ca5da57..00000000000 --- a/source/blender/radiosity/intern/source/radnode.c +++ /dev/null @@ -1,1103 +0,0 @@ -/* *************************************** - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - - - - node.c nov/dec 1992 - may 1999 - - $Id$ - - *************************************** */ - -#include -#include -#include - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "BKE_global.h" -#include "BKE_main.h" - -#include "radio.h" - -#include "BLO_sys_types.h" // for intptr_t support - -#ifdef HAVE_CONFIG_H -#include -#endif - -/* locals */ -static void *malloc_fast(int size); -static void *calloc_fast(int size); -static void free_fast(void *poin, int siz); -static void deleteTriNodes(RNode *node); -/* lower because of local type define */ -/* void check_mallocgroup(MallocGroup *mg); */ - - -/* ********** fastmalloc ************** */ - -#define MAL_GROUPSIZE 256 -#define MAL_AVAILABLE 1 -#define MAL_FULL 2 - - - - -ListBase MallocBase= {0, 0}; -int totfastmem= 0; - -typedef struct MallocGroup { - struct MallocGroup *next, *prev; - short size, flag; - short curfree, tot; - char flags[MAL_GROUPSIZE]; - char *data; -} MallocGroup; - -/* one more local */ -void check_mallocgroup(MallocGroup *mg); - -void check_mallocgroup(MallocGroup *mg) -{ - int a; - char *cp; - - if(mg->tot==MAL_GROUPSIZE) { - mg->flag= MAL_FULL; - return; - } - - cp= mg->flags; - - if(mg->curfreecurfree+1]==0) { - mg->curfree++; - return; - } - } - if(mg->curfree>0) { - if(cp[mg->curfree-1]==0) { - mg->curfree--; - return; - } - } - - for(a=0; acurfree= a; - return; - } - } - printf("fastmalloc: shouldnt be here\n"); -} - -static void *malloc_fast(int size) -{ - MallocGroup *mg; - void *retval; - - mg= MallocBase.last; - while(mg) { - if(mg->size==size) { - if(mg->flag & MAL_AVAILABLE) { - mg->flags[mg->curfree]= 1; - mg->tot++; - retval= mg->data+mg->curfree*mg->size; - check_mallocgroup(mg); - return retval; - } - } - mg= mg->prev; - } - - /* no free block found */ - mg= MEM_callocN(sizeof(MallocGroup), "mallocgroup"); - BLI_addtail(&MallocBase, mg); - mg->data= MEM_mallocN(MAL_GROUPSIZE*size, "mallocgroupdata"); - mg->flag= MAL_AVAILABLE; - mg->flags[0]= 1; - mg->curfree= 1; - mg->size= size; - mg->tot= 1; - - totfastmem+= sizeof(MallocGroup)+MAL_GROUPSIZE*size; - - return mg->data; -} - -static void *calloc_fast(int size) -{ - void *poin; - - poin= malloc_fast(size); - memset(poin, 0, size); - - return poin; -} - -static void free_fast(void *poin, int size) -{ - MallocGroup *mg; - intptr_t val; - - mg= MallocBase.last; - while(mg) { - if(mg->size==size) { - if( ((intptr_t)poin) >= ((intptr_t)mg->data) ) { - if( ((intptr_t)poin) < ((intptr_t)(mg->data+MAL_GROUPSIZE*size)) ) { - val= ((intptr_t)poin) - ((intptr_t)mg->data); - val/= size; - mg->curfree= val; - mg->flags[val]= 0; - mg->flag= MAL_AVAILABLE; - - mg->tot--; - if(mg->tot==0) { - BLI_remlink(&MallocBase, mg); - MEM_freeN(mg->data); - MEM_freeN(mg); - totfastmem-= sizeof(MallocGroup)+MAL_GROUPSIZE*size; - } - return; - } - } - } - mg= mg->prev; - } - printf("fast free: pointer not in memlist %p size %d\n", - poin, size); -} - -/* security: only one function in a time can use it */ -static char *fastmallocstr= 0; - -void free_fastAll() -{ - MallocGroup *mg; - - mg= MallocBase.first; - while(mg) { - BLI_remlink(&MallocBase, mg); - MEM_freeN(mg->data); - MEM_freeN(mg); - mg= MallocBase.first; - } - totfastmem= 0; - fastmallocstr= 0; -} - -void start_fastmalloc(char *str) -{ - if(fastmallocstr) { -// XXX error("Fastmalloc in use: %s", fastmallocstr); - return; - } - fastmallocstr= str; -} - -/* **************************************** */ - -float nodelimit; - -void setnodelimit(float limit) -{ - nodelimit= limit; - -} - -/* ************ memory management *********** */ - -int Ntotvert=0, Ntotnode=0, Ntotpatch=0; - -float *mallocVert() -{ - Ntotvert++; - return (float *)malloc_fast(16); -} - -float *callocVert() -{ - Ntotvert++; - return (float *)calloc_fast(16); -} - -void freeVert(float *vert) -{ - free_fast(vert, 16); - Ntotvert--; -} - -int totalRadVert() -{ - return Ntotvert; -} - -RNode *mallocNode() -{ - Ntotnode++; - return (RNode *)malloc_fast(sizeof(RNode)); -} - -RNode *callocNode() -{ - Ntotnode++; - return (RNode *)calloc_fast(sizeof(RNode)); -} - -void freeNode(RNode *node) -{ - free_fast(node, sizeof(RNode)); - Ntotnode--; -} - -void freeNode_recurs(RNode *node) -{ - - if(node->down1) { - freeNode_recurs(node->down1); - freeNode_recurs(node->down2); - } - - node->down1= node->down2= 0; - freeNode(node); - -} - -RPatch *mallocPatch() -{ - Ntotpatch++; - return (RPatch *)malloc_fast(sizeof(RPatch)); -} - -RPatch *callocPatch() -{ - Ntotpatch++; - return (RPatch *)calloc_fast(sizeof(RPatch)); -} - -void freePatch(RPatch *patch) -{ - free_fast(patch, sizeof(RPatch)); - Ntotpatch--; -} - -/* ************ SUBDIVIDE *********** */ - - -void replaceAllNode(RNode *neighb, RNode *newn) -{ - /* changes from all neighbours the edgepointers that point to newn->up in new */ - int ok= 0; - - - if(neighb==0) return; - if(newn->up==0) return; - - if(neighb->ed1==newn->up) { - neighb->ed1= newn; - ok= 1; - } - else if(neighb->ed2==newn->up) { - neighb->ed2= newn; - ok= 1; - } - else if(neighb->ed3==newn->up) { - neighb->ed3= newn; - ok= 1; - } - else if(neighb->ed4==newn->up) { - neighb->ed4= newn; - ok= 1; - } - - if(ok && neighb->down1) { - replaceAllNode(neighb->down1, newn); - replaceAllNode(neighb->down2, newn); - } -} - -void replaceAllNodeInv(RNode *neighb, RNode *old) -{ - /* changes from all neighbours the edgepointers that point to old in old->up */ - if(neighb==0) return; - if(old->up==0) return; - - if(neighb->ed1==old) { - neighb->ed1= old->up; - } - else if(neighb->ed2==old) { - neighb->ed2= old->up; - } - else if(neighb->ed3==old) { - neighb->ed3= old->up; - } - else if(neighb->ed4==old) { - neighb->ed4= old->up; - } - - if(neighb->down1) { - replaceAllNodeInv(neighb->down1, old); - replaceAllNodeInv(neighb->down2, old); - } -} - -void replaceAllNodeUp(RNode *neighb, RNode *old) -{ - /* changes from all neighbours the edgepointers that point to old in old->up */ - if(neighb==0) return; - if(old->up==0) return; - neighb= neighb->up; - if(neighb==0) return; - - if(neighb->ed1==old) { - neighb->ed1= old->up; - } - else if(neighb->ed2==old) { - neighb->ed2= old->up; - } - else if(neighb->ed3==old) { - neighb->ed3= old->up; - } - else if(neighb->ed4==old) { - neighb->ed4= old->up; - } - - if(neighb->up) { - replaceAllNodeUp(neighb, old); - } -} - - -void replaceTestNode(RNode *neighb, RNode **edpp, RNode *newn, int level, float *vert) -{ - /* IF neighb->ed points to newn->up - * IF edgelevels equal - IF testvert is in neighb->ed - change pointers both ways - ELSE - RETURN - ELSE - IF neighb edgelevel is deeper - change neighb pointer - - */ - int ok= 0; - - if(neighb==0) return; - if(newn->up==0) return; - - if(neighb->ed1==newn->up) { - if(neighb->lev1==level) { - if(vert==neighb->v1 || vert==neighb->v2) { - *edpp= neighb; - neighb->ed1= newn; - } - else return; - } - else if(neighb->lev1>level) { - neighb->ed1= newn; - } - ok= 1; - } - else if(neighb->ed2==newn->up) { - if(neighb->lev2==level) { - if(vert==neighb->v2 || vert==neighb->v3) { - *edpp= neighb; - neighb->ed2= newn; - } - else return; - } - else if(neighb->lev2>level) { - neighb->ed2= newn; - } - ok= 1; - } - else if(neighb->ed3==newn->up) { - if(neighb->lev3==level) { - if(neighb->type==3) { - if(vert==neighb->v3 || vert==neighb->v1) { - *edpp= neighb; - neighb->ed3= newn; - } - else return; - } - else { - if(vert==neighb->v3 || vert==neighb->v4) { - *edpp= neighb; - neighb->ed3= newn; - } - else return; - } - } - else if(neighb->lev3>level) { - neighb->ed3= newn; - } - ok= 1; - } - else if(neighb->ed4==newn->up) { - if(neighb->lev4==level) { - if(vert==neighb->v4 || vert==neighb->v1) { - *edpp= neighb; - neighb->ed4= newn; - } - else return; - } - else if(neighb->lev4>level) { - neighb->ed4= newn; - } - ok= 1; - } - - if(ok && neighb->down1) { - replaceTestNode(neighb->down1, edpp, newn, level, vert); - replaceTestNode(neighb->down2, edpp, newn, level, vert); - } - -} - -int setvertexpointersNode(RNode *neighb, RNode *node, int level, float **v1, float **v2) -{ - /* compares edgelevels , if equal it sets the vertexpointers */ - - if(neighb==0) return 0; - - if(neighb->ed1==node) { - if(neighb->lev1==level) { - *v1= neighb->v1; - *v2= neighb->v2; - return 1; - } - } - else if(neighb->ed2==node) { - if(neighb->lev2==level) { - *v1= neighb->v2; - *v2= neighb->v3; - return 1; - } - } - else if(neighb->ed3==node) { - if(neighb->lev3==level) { - if(neighb->type==3) { - *v1= neighb->v3; - *v2= neighb->v1; - } - else { - *v1= neighb->v3; - *v2= neighb->v4; - } - return 1; - } - } - else if(neighb->ed4==node) { - if(neighb->lev4==level) { - *v1= neighb->v4; - *v2= neighb->v1; - return 1; - } - } - return 0; -} - -float edlen(float *v1, float *v2) -{ - return (v1[0]-v2[0])*(v1[0]-v2[0])+ (v1[1]-v2[1])*(v1[1]-v2[1])+ (v1[2]-v2[2])*(v1[2]-v2[2]); -} - - -void subdivideTriNode(RNode *node, RNode *edge) -{ - RNode *n1, *n2, *up; - float fu, fv, fl, *v1, *v2; /* , AreaT3Dfl(); ... from arithb... */ - int uvl; - - if(node->down1 || node->down2) { - /* printf("trinode: subd already done\n"); */ - return; - } - - /* defines subdivide direction */ - - if(edge==0) { - /* areathreshold */ - if(node->areav1, node->v2); - fv= edlen(node->v2, node->v3); - fl= edlen(node->v3, node->v1); - - if(fu>fv && fu>fl) uvl= 1; - else if(fv>fu && fv>fl) uvl= 2; - else uvl= 3; - } - else { - - if(edge==node->ed1) uvl= 1; - else if(edge==node->ed2) uvl= 2; - else uvl= 3; - } - - /* should neighbour nodes be deeper? Recursive! */ - n1= 0; - if(uvl==1) { - if(node->ed1 && node->ed1->down1==0) n1= node->ed1; - } - else if(uvl==2) { - if(node->ed2 && node->ed2->down1==0) n1= node->ed2; - } - else { - if(node->ed3 && node->ed3->down1==0) n1= node->ed3; - } - if(n1) { - up= node->up; - while(up) { /* also test for ed4 !!! */ - if(n1->ed1==up || n1->ed2==up || n1->ed3==up || n1->ed4==up) { - subdivideNode(n1, up); - break; - } - up= up->up; - } - } - - /* the subdividing */ - n1= mallocNode(); - memcpy(n1, node, sizeof(RNode)); - n2= mallocNode(); - memcpy(n2, node, sizeof(RNode)); - - n1->up= node; - n2->up= node; - - node->down1= n1; - node->down2= n2; - - /* subdivide edge 1 */ - if(uvl==1) { - - /* FIRST NODE gets edge 2 */ - n1->ed3= n2; - n1->lev3= 0; - replaceAllNode(n1->ed2, n1); - n1->lev1++; - replaceTestNode(n1->ed1, &(n1->ed1), n1, n1->lev1, n1->v2); - - /* SECOND NODE gets edge 3 */ - n2->ed2= n1; - n2->lev2= 0; - replaceAllNode(n2->ed3, n2); - n2->lev1++; - replaceTestNode(n2->ed1, &(n2->ed1), n2, n2->lev1, n2->v1); - - /* NEW VERTEX from edge 1 */ - if( setvertexpointersNode(n1->ed1, n1, n1->lev1, &v1, &v2) ) { /* nodes have equal levels */ - if(v1== n1->v2) { - n1->v1= v2; - n2->v2= v2; - } - else { - n1->v1= v1; - n2->v2= v1; - } - } - else { - n1->v1= n2->v2= mallocVert(); - n1->v1[0]= 0.5*(node->v1[0]+ node->v2[0]); - n1->v1[1]= 0.5*(node->v1[1]+ node->v2[1]); - n1->v1[2]= 0.5*(node->v1[2]+ node->v2[2]); - n1->v1[3]= node->v1[3]; /* color */ - } - } - else if(uvl==2) { - - /* FIRST NODE gets edge 1 */ - n1->ed3= n2; - n1->lev3= 0; - replaceAllNode(n1->ed1, n1); - n1->lev2++; - replaceTestNode(n1->ed2, &(n1->ed2), n1, n1->lev2, n1->v2); - - /* SECOND NODE gets edge 3 */ - n2->ed1= n1; - n2->lev1= 0; - replaceAllNode(n2->ed3, n2); - n2->lev2++; - replaceTestNode(n2->ed2, &(n2->ed2), n2, n2->lev2, n2->v3); - - /* NEW VERTEX from edge 2 */ - if( setvertexpointersNode(n1->ed2, n1, n1->lev2, &v1, &v2) ) { /* nodes have equal levels */ - if(v1== n1->v2) { - n1->v3= v2; - n2->v2= v2; - } - else { - n1->v3= v1; - n2->v2= v1; - } - } - else { - n1->v3= n2->v2= mallocVert(); - n1->v3[0]= 0.5*(node->v2[0]+ node->v3[0]); - n1->v3[1]= 0.5*(node->v2[1]+ node->v3[1]); - n1->v3[2]= 0.5*(node->v2[2]+ node->v3[2]); - n1->v3[3]= node->v1[3]; /* color */ - } - } - else if(uvl==3) { - - /* FIRST NODE gets edge 1 */ - n1->ed2= n2; - n1->lev2= 0; - replaceAllNode(n1->ed1, n1); - n1->lev3++; - replaceTestNode(n1->ed3, &(n1->ed3), n1, n1->lev3, n1->v1); - - /* SECOND NODE gets edge 2 */ - n2->ed1= n1; - n2->lev1= 0; - replaceAllNode(n2->ed2, n2); - n2->lev3++; - replaceTestNode(n2->ed3, &(n2->ed3), n2, n2->lev3, n2->v3); - - /* NEW VERTEX from edge 3 */ - if( setvertexpointersNode(n1->ed3, n1, n1->lev3, &v1, &v2) ) { /* nodes have equal levels */ - if(v1== n1->v1) { - n1->v3= v2; - n2->v1= v2; - } - else { - n1->v3= v1; - n2->v1= v1; - } - } - else { - n1->v3= n2->v1= mallocVert(); - n1->v3[0]= 0.5*(node->v1[0]+ node->v3[0]); - n1->v3[1]= 0.5*(node->v1[1]+ node->v3[1]); - n1->v3[2]= 0.5*(node->v1[2]+ node->v3[2]); - n1->v3[3]= node->v3[3]; /* color */ - } - } - n1->area= AreaT3Dfl(n1->v1, n1->v2, n1->v3); - n2->area= AreaT3Dfl(n2->v1, n2->v2, n2->v3); - -} - - -void subdivideNode(RNode *node, RNode *edge) -{ - RNode *n1, *n2, *up; - float fu, fv, *v1, *v2;/*, AreaQ3Dfl(); ... from arithb... */ - int uvl; - - if(Ntotnode>RG.maxnode) return; - - if(node->type==3) { - subdivideTriNode(node, edge); - return; - } - - if(node->down1 || node->down2) { - /* printf("subdivide Node: already done \n"); */ - return; - } - - /* defines subdivide direction */ - - if(edge==0) { - /* areathreshold */ - if(node->areav1[0]- node->v2[0])+ fabs(node->v1[1]- node->v2[1]) +fabs(node->v1[2]- node->v2[2]); - fv= fabs(node->v1[0]- node->v4[0])+ fabs(node->v1[1]- node->v4[1]) +fabs(node->v1[2]- node->v4[2]); - if(fu>fv) uvl= 1; - else uvl= 2; - } - else { - if(edge==node->ed1 || edge==node->ed3) uvl= 1; - else uvl= 2; - } - - /* do neighbour nodes have to be deeper? Recursive! */ - n1= n2= 0; - if(uvl==1) { - if(node->ed1 && node->ed1->down1==0) n1= node->ed1; - if(node->ed3 && node->ed3->down1==0) n2= node->ed3; - } - else { - if(node->ed2 && node->ed2->down1==0) n1= node->ed2; - if(node->ed4 && node->ed4->down1==0) n2= node->ed4; - } - if(n1) { - up= node->up; - while(up) { - if(n1->ed1==up || n1->ed2==up || n1->ed3==up || n1->ed4==up) { - /* printf("recurs subd\n"); */ - subdivideNode(n1, up); - break; - } - up= up->up; - } - } - if(n2) { - up= node->up; - while(up) { - if(n2->ed1==up || n2->ed2==up || n2->ed3==up || n2->ed4==up) { - /* printf("recurs subd\n"); */ - subdivideNode(n2, up); - break; - } - up= up->up; - } - } - - /* the subdividing */ - n1= mallocNode(); - memcpy(n1, node, sizeof(RNode)); - n2= mallocNode(); - memcpy(n2, node, sizeof(RNode)); - - n1->up= node; - n2->up= node; - - node->down1= n1; - node->down2= n2; - - /* subdivide edge 1 and 3 */ - if(uvl==1) { - - /* FIRST NODE gets edge 2 */ - n1->ed4= n2; - n1->lev4= 0; - replaceAllNode(n1->ed2, n1); - n1->lev1++; - n1->lev3++; - replaceTestNode(n1->ed1, &(n1->ed1), n1, n1->lev1, n1->v2); - replaceTestNode(n1->ed3, &(n1->ed3), n1, n1->lev3, n1->v3); - - /* SECOND NODE gets edge 4 */ - n2->ed2= n1; - n2->lev2= 0; - replaceAllNode(n2->ed4, n2); - n2->lev1++; - n2->lev3++; - replaceTestNode(n2->ed1, &(n2->ed1), n2, n2->lev1, n2->v1); - replaceTestNode(n2->ed3, &(n2->ed3), n2, n2->lev3, n2->v4); - - /* NEW VERTEX from edge 1 */ - if( setvertexpointersNode(n1->ed1, n1, n1->lev1, &v1, &v2) ) { /* nodes have equal levels */ - if(v1== n1->v2) { - n1->v1= v2; - n2->v2= v2; - } - else { - n1->v1= v1; - n2->v2= v1; - } - } - else { - n1->v1= n2->v2= mallocVert(); - n1->v1[0]= 0.5*(node->v1[0]+ node->v2[0]); - n1->v1[1]= 0.5*(node->v1[1]+ node->v2[1]); - n1->v1[2]= 0.5*(node->v1[2]+ node->v2[2]); - n1->v1[3]= node->v1[3]; /* color */ - } - - /* NEW VERTEX from edge 3 */ - if( setvertexpointersNode(n1->ed3, n1, n1->lev3, &v1, &v2) ) { /* nodes have equal levels */ - if(v1== n1->v3) { - n1->v4= v2; - n2->v3= v2; - } - else { - n1->v4= v1; - n2->v3= v1; - } - } - else { - n1->v4= n2->v3= mallocVert(); - n1->v4[0]= 0.5*(node->v3[0]+ node->v4[0]); - n1->v4[1]= 0.5*(node->v3[1]+ node->v4[1]); - n1->v4[2]= 0.5*(node->v3[2]+ node->v4[2]); - n1->v4[3]= node->v4[3]; /* color */ - } - } - /* subdivide edge 2 and 4 */ - else if(uvl==2) { - - /* FIRST NODE gets edge 1 */ - n1->ed3= n2; - n1->lev3= 0; - replaceAllNode(n1->ed1, n1); - n1->lev2++; - n1->lev4++; - replaceTestNode(n1->ed2, &(n1->ed2), n1, n1->lev2, n1->v2); - replaceTestNode(n1->ed4, &(n1->ed4), n1, n1->lev4, n1->v1); - - /* SECOND NODE gets edge 3 */ - n2->ed1= n1; - n2->lev1= 0; - replaceAllNode(n2->ed3, n2); - n2->lev2++; - n2->lev4++; - replaceTestNode(n2->ed2, &(n2->ed2), n2, n2->lev2, n2->v3); - replaceTestNode(n2->ed4, &(n2->ed4), n2, n2->lev4, n2->v4); - - /* NEW VERTEX from edge 2 */ - if( setvertexpointersNode(n1->ed2, n1, n1->lev2, &v1, &v2) ) { /* nodes have equal levels */ - if(v1== n1->v2) { - n1->v3= v2; - n2->v2= v2; - } - else { - n1->v3= v1; - n2->v2= v1; - } - } - else { - n1->v3= n2->v2= mallocVert(); - n1->v3[0]= 0.5*(node->v2[0]+ node->v3[0]); - n1->v3[1]= 0.5*(node->v2[1]+ node->v3[1]); - n1->v3[2]= 0.5*(node->v2[2]+ node->v3[2]); - n1->v3[3]= node->v3[3]; /* color */ - } - - /* NEW VERTEX from edge 4 */ - if( setvertexpointersNode(n1->ed4, n1, n1->lev4, &v1, &v2) ) { /* nodes have equal levels */ - if(v1== n1->v1) { - n1->v4= v2; - n2->v1= v2; - } - else { - n1->v4= v1; - n2->v1= v1; - } - } - else { - n1->v4= n2->v1= mallocVert(); - n1->v4[0]= 0.5*(node->v1[0]+ node->v4[0]); - n1->v4[1]= 0.5*(node->v1[1]+ node->v4[1]); - n1->v4[2]= 0.5*(node->v1[2]+ node->v4[2]); - n1->v4[3]= node->v4[3]; /* color */ - } - } - - n1->area= AreaQ3Dfl(n1->v1, n1->v2, n1->v3, n1->v4); - n2->area= AreaQ3Dfl(n2->v1, n2->v2, n2->v3, n2->v4); - -} - -int comparelevel(RNode *node, RNode *nb, int level) -{ - /* recursive descent: test with deepest node */ - /* return 1 means equal or higher */ - - if(nb==0) return 1; - - if(nb->down1) { - return 0; - - /* THERE IS AN ERROR HERE, BUT WHAT? (without this function the system - works too, but is slower) (ton) */ - - /* - n1= nb->down1; - if(n1->ed1==node) return comparelevel(node, n1, level); - if(n1->ed2==node) return comparelevel(node, n1, level); - if(n1->ed3==node) return comparelevel(node, n1, level); - if(n1->ed4==node) return comparelevel(node, n1, level); - n1= nb->down2; - if(n1->ed1==node) return comparelevel(node, n1, level); - if(n1->ed2==node) return comparelevel(node, n1, level); - if(n1->ed3==node) return comparelevel(node, n1, level); - if(n1->ed4==node) return comparelevel(node, n1, level); - printf(" dit kan niet "); - return 0; - */ - - } - - if(nb->down1==0) { - /* if(nb->ed1==node) return (nb->lev1<=level); */ - /* if(nb->ed2==node) return (nb->lev2<=level); */ - /* if(nb->ed3==node) return (nb->lev3<=level); */ - /* if(nb->ed4==node) return (nb->lev4<=level); */ - - return 1; /* is higher node */ - } - return 1; -} - -static void deleteTriNodes(RNode *node) /* both children of node */ -{ - RNode *n1, *n2; - - /* if neighbour nodes are deeper: no delete */ - /* just test 2 nodes, from the others the level doesn't change */ - - n1= node->down1; - n2= node->down2; - - if(n1==0 || n2==0) return; - - if(n1->down1 || n2->down1) return; - - /* at the edges no subdivided node is allowed */ - - if(n1->ed1 && n1->ed1->down1) return; - if(n1->ed2 && n1->ed2->down1) return; - if(n1->ed3 && n1->ed3->down1) return; - - if(n2->ed1 && n2->ed1->down1) return; - if(n2->ed2 && n2->ed2->down1) return; - if(n2->ed3 && n2->ed3->down1) return; - - replaceAllNodeInv(n1->ed1, n1); - replaceAllNodeInv(n1->ed2, n1); - replaceAllNodeInv(n1->ed3, n1); - - replaceAllNodeUp(n1->ed1, n1); - replaceAllNodeUp(n1->ed2, n1); - replaceAllNodeUp(n1->ed3, n1); - - replaceAllNodeInv(n2->ed1, n2); - replaceAllNodeInv(n2->ed2, n2); - replaceAllNodeInv(n2->ed3, n2); - - replaceAllNodeUp(n2->ed1, n2); - replaceAllNodeUp(n2->ed2, n2); - replaceAllNodeUp(n2->ed3, n2); - - n1->down1= (RNode *)12; /* for debug */ - n2->down1= (RNode *)12; - - freeNode(n1); - freeNode(n2); - node->down1= node->down2= 0; - -} - - /* both children of node */ -void deleteNodes(RNode *node) -{ - RNode *n1, *n2; - - /* if neighbour nodes are deeper: no delete */ - /* just test 2 nodes, from the others the level doesn't change */ - - if(node->type==3) { - deleteTriNodes(node); - return; - } - - n1= node->down1; - n2= node->down2; - - if(n1==0 || n2==0) return; - - if(n1->down1 || n2->down1) return; - - if(n1->ed3==n2) { - - /* at the edges no subdivided node is allowed */ - - if(n1->ed1 && n1->ed1->down1) return; - if(n1->ed2 && n1->ed2->down1) return; - if(n1->ed4 && n1->ed4->down1) return; - - if(n2->ed2 && n2->ed2->down1) return; - if(n2->ed3 && n2->ed3->down1) return; - if(n2->ed4 && n2->ed4->down1) return; - - replaceAllNodeInv(n1->ed1, n1); - replaceAllNodeInv(n1->ed2, n1); - replaceAllNodeInv(n1->ed4, n1); - - replaceAllNodeUp(n1->ed1, n1); - replaceAllNodeUp(n1->ed2, n1); - replaceAllNodeUp(n1->ed4, n1); - - replaceAllNodeInv(n2->ed2, n2); - replaceAllNodeInv(n2->ed3, n2); - replaceAllNodeInv(n2->ed4, n2); - - replaceAllNodeUp(n2->ed2, n2); - replaceAllNodeUp(n2->ed3, n2); - replaceAllNodeUp(n2->ed4, n2); - - n1->down1= (RNode *)12; /* for debug */ - n2->down1= (RNode *)12; - - freeNode(n1); - freeNode(n2); - node->down1= node->down2= 0; - - return; - } - else if(n1->ed4==n2) { - - if(n1->ed1 && n1->ed1->down1) return; - if(n1->ed2 && n1->ed2->down1) return; - if(n1->ed3 && n1->ed3->down1) return; - - if(n2->ed1 && n2->ed1->down1) return; - if(n2->ed3 && n2->ed3->down1) return; - if(n2->ed4 && n2->ed4->down1) return; - - replaceAllNodeInv(n1->ed1, n1); - replaceAllNodeInv(n1->ed2, n1); - replaceAllNodeInv(n1->ed3, n1); - - replaceAllNodeUp(n1->ed1, n1); - replaceAllNodeUp(n1->ed2, n1); - replaceAllNodeUp(n1->ed3, n1); - - replaceAllNodeInv(n2->ed1, n2); - replaceAllNodeInv(n2->ed3, n2); - replaceAllNodeInv(n2->ed4, n2); - - replaceAllNodeUp(n2->ed1, n2); - replaceAllNodeUp(n2->ed3, n2); - replaceAllNodeUp(n2->ed4, n2); - - n1->down1= (RNode *)12; /* for debug */ - n2->down1= (RNode *)12; - - freeNode(n1); - freeNode(n2); - node->down1= node->down2= 0; - - return; - } - -} - - diff --git a/source/blender/radiosity/intern/source/radpostprocess.c b/source/blender/radiosity/intern/source/radpostprocess.c deleted file mode 100644 index 6912c737a51..00000000000 --- a/source/blender/radiosity/intern/source/radpostprocess.c +++ /dev/null @@ -1,824 +0,0 @@ -/* *************************************** - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - - - - radpostprocess.c nov/dec 1992 - may 1999 - - - faces - - filtering and node-limit - - apply to meshes - $Id$ - - *************************************** */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_ghash.h" - -#include "DNA_material_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_radio_types.h" -#include "DNA_scene_types.h" - -#include "BKE_customdata.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_mesh.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" - -#include "radio.h" - -/* locals? not. done in radio.h... */ -/* void rad_addmesh(void); */ -/* void rad_replacemesh(void); */ - -void addaccu(register char *z, register char *t) -{ - register int div, mul; - - mul= *t; - div= mul+1; - (*t)++; - - t[1]= (mul*t[1]+z[1])/div; - t[2]= (mul*t[2]+z[2])/div; - t[3]= (mul*t[3]+z[3])/div; - -} - -void addaccuweight(register char *z, register char *t, int w) -{ - register int div, mul; - - if(w==0) w= 1; - - mul= *t; - div= mul+w; - if(div>255) return; - (*t)= div; - - t[1]= (mul*t[1]+w*z[1])/div; - t[2]= (mul*t[2]+w*z[2])/div; - t[3]= (mul*t[3]+w*z[3])/div; - -} - -void triaweight(Face *face, int *w1, int *w2, int *w3) -{ - float n1[3], n2[3], n3[3], temp; - - n1[0]= face->v2[0]-face->v1[0]; - n1[1]= face->v2[1]-face->v1[1]; - n1[2]= face->v2[2]-face->v1[2]; - n2[0]= face->v3[0]-face->v2[0]; - n2[1]= face->v3[1]-face->v2[1]; - n2[2]= face->v3[2]-face->v2[2]; - n3[0]= face->v1[0]-face->v3[0]; - n3[1]= face->v1[1]-face->v3[1]; - n3[2]= face->v1[2]-face->v3[2]; - Normalize(n1); - Normalize(n2); - Normalize(n3); - temp= 32.0/(PI); - *w1= 0.5+temp*acos(-n1[0]*n3[0]-n1[1]*n3[1]-n1[2]*n3[2]); - *w2= 0.5+temp*acos(-n1[0]*n2[0]-n1[1]*n2[1]-n1[2]*n2[2]); - *w3= 0.5+temp*acos(-n2[0]*n3[0]-n2[1]*n3[1]-n2[2]*n3[2]); - -} - - - -void init_face_tab() -{ - int a= 0; - - if(RG.facebase==0) { - RG.facebase= MEM_callocN(sizeof(void *)*RAD_MAXFACETAB, "init_face_tab"); - } - for(a=0; aRAD_MAXFACETAB*1024 ) { - printf("error in addface: %d\n", RG.totface); - return 0; - } - a= RG.totface>>10; - face= RG.facebase[a]; - if(face==0) { - face= MEM_callocN(1024*sizeof(Face),"addface"); - RG.facebase[a]= face; - } - face+= (RG.totface & 1023); - - RG.totface++; - - return face; - -} - -Face * makeface(float *v1, float *v2, float *v3, float *v4, RNode *rn) -{ - Face *face; - - face= addface(); - face->v1= v1; - face->v2= v2; - face->v3= v3; - face->v4= v4; - face->col= rn->col; - face->matindex= rn->par->matindex; - face->orig= rn->orig; - - return face; -} - -void anchorQuadface(RNode *rn, float *v1, float *v2, float *v3, float *v4, int flag) -{ - Face *face; - - switch(flag) { - case 1: - face = makeface(rn->v1, v1, rn->v4, NULL, rn); - face = makeface(v1, rn->v3, rn->v4, NULL, rn); - face = makeface(v1, rn->v2, rn->v3, NULL, rn); - break; - case 2: - face = makeface(rn->v2, v2, rn->v1, NULL, rn); - face = makeface(v2, rn->v4, rn->v1, NULL, rn); - face = makeface(v2, rn->v3, rn->v4, NULL, rn); - break; - case 4: - face = makeface(rn->v3, v3, rn->v2, NULL, rn); - face = makeface(v3, rn->v1, rn->v2, NULL, rn); - face = makeface(v3, rn->v4, rn->v1, NULL, rn); - break; - case 8: - face = makeface(rn->v4, v4, rn->v3, NULL, rn); - face = makeface(v4, rn->v2, rn->v3, NULL, rn); - face = makeface(v4, rn->v1, rn->v2, NULL, rn); - break; - case 3: - face = makeface(rn->v1, v1, rn->v4, NULL, rn); - face = makeface(v1, v2, rn->v4, NULL, rn); - face = makeface(v1, rn->v2, v2, NULL, rn); - face = makeface(v2, rn->v3, rn->v4, NULL, rn); - break; - case 6: - face = makeface(rn->v2, v2, rn->v1, NULL, rn); - face = makeface(v2, v3, rn->v1, NULL, rn); - face = makeface(v2, rn->v3, v3, NULL, rn); - face = makeface(v3, rn->v4, rn->v1, NULL, rn); - break; - case 12: - face = makeface(rn->v3, v3, rn->v2, NULL, rn); - face = makeface(v3, v4, rn->v2, NULL, rn); - face = makeface(v3, rn->v4, v4, NULL, rn); - face = makeface(v4, rn->v1, rn->v2, NULL, rn); - break; - case 9: - face = makeface(rn->v4, v4, rn->v3, NULL, rn); - face = makeface(v4, v1, rn->v3, NULL, rn); - face = makeface(v4, rn->v1, v1, NULL, rn); - face = makeface(v1, rn->v2, rn->v3, NULL, rn); - break; - case 5: - face = makeface(rn->v1, v1, v3, rn->v4, rn); - face = makeface(v1, rn->v2, rn->v3, v3, rn); - break; - case 10: - face = makeface(rn->v1, rn->v2, v2, v4, rn); - face = makeface(v4, v2, rn->v3, rn->v4, rn); - break; - case 7: - face = makeface(rn->v1, v1, v3, rn->v4, rn); - face = makeface(v1, v2, v3, NULL, rn); - face = makeface(v1, rn->v2, v2, NULL, rn); - face = makeface(v2, rn->v3, v3, NULL, rn); - break; - case 14: - face = makeface(rn->v2, v2, v4, rn->v1, rn); - face = makeface(v2, v3, v4, NULL, rn); - face = makeface(v2, rn->v3, v3, NULL, rn); - face = makeface(v3, rn->v4, v4, NULL, rn); - break; - case 13: - face = makeface(rn->v3, v3, v1, rn->v2, rn); - face = makeface(v3, v4, v1, NULL, rn); - face = makeface(v3, rn->v4, v4, NULL, rn); - face = makeface(v4, rn->v1, v1, NULL, rn); - break; - case 11: - face = makeface(rn->v4, v4, v2, rn->v3, rn); - face = makeface(v4, v1, v2, NULL, rn); - face = makeface(v4, rn->v1, v1, NULL, rn); - face = makeface(v1, rn->v2, v2, NULL, rn); - break; - case 15: - face = makeface(v1, v2, v3, v4, rn); - face = makeface(v1, rn->v2, v2, NULL, rn); - face = makeface(v2, rn->v3, v3, NULL, rn); - face = makeface(v3, rn->v4, v4, NULL, rn); - face = makeface(v4, rn->v1, v1, NULL, rn); - break; - } -} - -void anchorTriface(RNode *rn, float *v1, float *v2, float *v3, int flag) -{ - Face *face; - - switch(flag) { - case 1: - face = makeface(rn->v1, v1, rn->v3, NULL, rn); - face = makeface(v1, rn->v2, rn->v3, NULL, rn); - break; - case 2: - face = makeface(rn->v2, v2, rn->v1, NULL, rn); - face = makeface(v2, rn->v3, rn->v1, NULL, rn); - break; - case 4: - face = makeface(rn->v3, v3, rn->v2, NULL, rn); - face = makeface(v3, rn->v1, rn->v2, NULL, rn); - break; - case 3: - face = makeface(rn->v1, v2, rn->v3, NULL, rn); - face = makeface(rn->v1, v1, v2, NULL, rn); - face = makeface(v1, rn->v2, v2, NULL, rn); - break; - case 6: - face = makeface(rn->v2, v3, rn->v1, NULL, rn); - face = makeface(rn->v2, v2, v3, NULL, rn); - face = makeface(v2, rn->v3, v3, NULL, rn); - break; - case 5: - face = makeface(rn->v3, v1, rn->v2, NULL, rn); - face = makeface(rn->v3, v3, v1, NULL, rn); - face = makeface(v3, rn->v1, v1, NULL, rn); - break; - - case 7: - face = makeface(v1, v2, v3, NULL, rn); - face = makeface(rn->v1, v1, v3, NULL, rn); - face = makeface(rn->v2, v2, v1, NULL, rn); - face = makeface(rn->v3, v3, v2, NULL, rn); - break; - } -} - - -float *findmiddlevertex(RNode *node, RNode *nb, float *v1, float *v2) -{ - int test= 0; - - if(nb==0) return 0; - - if(nb->ed1==node) { - if(nb->v1==v1 || nb->v1==v2) test++; - if(nb->v2==v1 || nb->v2==v2) test+=2; - if(test==1) return nb->v2; - else if(test==2) return nb->v1; - } - else if(nb->ed2==node) { - if(nb->v2==v1 || nb->v2==v2) test++; - if(nb->v3==v1 || nb->v3==v2) test+=2; - if(test==1) return nb->v3; - else if(test==2) return nb->v2; - } - else if(nb->ed3==node) { - if(nb->type==4) { - if(nb->v3==v1 || nb->v3==v2) test++; - if(nb->v4==v1 || nb->v4==v2) test+=2; - if(test==1) return nb->v4; - else if(test==2) return nb->v3; - } - else { - if(nb->v3==v1 || nb->v3==v2) test++; - if(nb->v1==v1 || nb->v1==v2) test+=2; - if(test==1) return nb->v1; - else if(test==2) return nb->v3; - } - } - else if(nb->ed4==node) { - if(nb->v4==v1 || nb->v4==v2) test++; - if(nb->v1==v1 || nb->v1==v2) test+=2; - if(test==1) return nb->v1; - else if(test==2) return nb->v4; - } - return 0; -} - -void make_face_tab() /* takes care of anchoring */ -{ - RNode *rn, **el; - Face *face = NULL; - float *v1, *v2, *v3, *v4; - int a, flag, w1, w2, w3; - char *charcol; - - if(RG.totelem==0) return; - - init_face_tab(); - - RG.igamma= 1.0/RG.gamma; - RG.radfactor= RG.radfac*pow(64*64, RG.igamma); - - /* convert face colors */ - el= RG.elem; - for(a=RG.totelem; a>0; a--, el++) { - rn= *el; - charcol= (char *)&( rn->col ); - - charcol[3]= calculatecolor(rn->totrad[0]); - charcol[2]= calculatecolor(rn->totrad[1]); - charcol[1]= calculatecolor(rn->totrad[2]); - } - - /* check nodes and make faces */ - el= RG.elem; - for(a=RG.totelem; a>0; a--, el++) { - - rn= *el; - - rn->v1[3]= 0.0; - rn->v2[3]= 0.0; - rn->v3[3]= 0.0; - if(rn->v4) rn->v4[3]= 0.0; - - /* test edges for subdivide */ - flag= 0; - v1= v2= v3= v4= 0; - if(rn->ed1) { - v1= findmiddlevertex(rn, rn->ed1->down1, rn->v1, rn->v2); - if(v1) flag |= 1; - } - if(rn->ed2) { - v2= findmiddlevertex(rn, rn->ed2->down1, rn->v2, rn->v3); - if(v2) flag |= 2; - } - if(rn->ed3) { - if(rn->type==4) - v3= findmiddlevertex(rn, rn->ed3->down1, rn->v3, rn->v4); - else - v3= findmiddlevertex(rn, rn->ed3->down1, rn->v3, rn->v1); - if(v3) flag |= 4; - } - if(rn->ed4) { - v4= findmiddlevertex(rn, rn->ed4->down1, rn->v4, rn->v1); - if(v4) flag |= 8; - } - - /* using flag and vertexpointers now Faces can be made */ - - if(flag==0) { - makeface(rn->v1, rn->v2, rn->v3, rn->v4, rn); - } - else if(rn->type==4) anchorQuadface(rn, v1, v2, v3, v4, flag); - else anchorTriface(rn, v1, v2, v3, flag); - } - - /* add */ - for(a=0; av4) { - addaccuweight( (char *)&(face->col), (char *)(face->v1+3), 16 ); - addaccuweight( (char *)&(face->col), (char *)(face->v2+3), 16 ); - addaccuweight( (char *)&(face->col), (char *)(face->v3+3), 16 ); - addaccuweight( (char *)&(face->col), (char *)(face->v4+3), 16 ); - } - else { - triaweight(face, &w1, &w2, &w3); - addaccuweight( (char *)&(face->col), (char *)(face->v1+3), w1 ); - addaccuweight( (char *)&(face->col), (char *)(face->v2+3), w2 ); - addaccuweight( (char *)&(face->col), (char *)(face->v3+3), w3 ); - } - } - -} - -void filterFaces() -{ - /* put vertex colors in faces, and put them back */ - - Face *face = NULL; - int a, w1, w2, w3; - - if(RG.totface==0) return; - - /* clear */ - for(a=0; acol= 0; - } - - /* add: vertices with faces */ - for(a=0; av4) { - addaccuweight( (char *)(face->v1+3), (char *)&(face->col), 16 ); - addaccuweight( (char *)(face->v2+3), (char *)&(face->col), 16 ); - addaccuweight( (char *)(face->v3+3), (char *)&(face->col), 16 ); - addaccuweight( (char *)(face->v4+3), (char *)&(face->col), 16 ); - } - else { - triaweight(face, &w1, &w2, &w3); - addaccuweight( (char *)(face->v1+3), (char *)&(face->col), w1 ); - addaccuweight( (char *)(face->v2+3), (char *)&(face->col), w2 ); - addaccuweight( (char *)(face->v3+3), (char *)&(face->col), w3 ); - } - } - - /* clear */ - for(a=0; av1[3]= 0.0; - face->v2[3]= 0.0; - face->v3[3]= 0.0; - if(face->v4) face->v4[3]= 0.0; - } - - - /* add: faces with vertices */ - for(a=0; av4) { - addaccuweight( (char *)&(face->col), (char *)(face->v1+3), 16 ); - addaccuweight( (char *)&(face->col), (char *)(face->v2+3), 16 ); - addaccuweight( (char *)&(face->col), (char *)(face->v3+3), 16 ); - addaccuweight( (char *)&(face->col), (char *)(face->v4+3), 16 ); - } - else { - triaweight(face, &w1, &w2, &w3); - addaccuweight( (char *)&(face->col), (char *)(face->v1+3), w1 ); - addaccuweight( (char *)&(face->col), (char *)(face->v2+3), w2 ); - addaccuweight( (char *)&(face->col), (char *)(face->v3+3), w3 ); - } - } -} - -void calcfiltrad(RNode *rn, float *cd) -{ - float area; - - cd[0]= 2.0*rn->totrad[0]; - cd[1]= 2.0*rn->totrad[1]; - cd[2]= 2.0*rn->totrad[2]; - area= 2.0; - - if(rn->ed1) { - cd[0]+= rn->ed1->totrad[0]; - cd[1]+= rn->ed1->totrad[1]; - cd[2]+= rn->ed1->totrad[2]; - area+= 1.0; - } - if(rn->ed2) { - cd[0]+= rn->ed2->totrad[0]; - cd[1]+= rn->ed2->totrad[1]; - cd[2]+= rn->ed2->totrad[2]; - area+= 1.0; - } - if(rn->ed3) { - cd[0]+= rn->ed3->totrad[0]; - cd[1]+= rn->ed3->totrad[1]; - cd[2]+= rn->ed3->totrad[2]; - area+= 1.0; - } - if(rn->ed4) { - cd[0]+= rn->ed4->totrad[0]; - cd[1]+= rn->ed4->totrad[1]; - cd[2]+= rn->ed4->totrad[2]; - area+= 1.0; - } - cd[0]/= area; - cd[1]/= area; - cd[2]/= area; - -} - -void filterNodes() -{ - /* colors from nodes in tempblock and back */ - - RNode *rn, **el; - float *coldata, *cd; - int a; - - if(RG.totelem==0) return; - /* the up-nodes need a color */ - el= RG.elem; - for(a=0; aup) { - rn->up->totrad[0]= 0.0; - rn->up->totrad[1]= 0.0; - rn->up->totrad[2]= 0.0; - if(rn->up->up) { - rn->up->up->totrad[0]= 0.0; - rn->up->up->totrad[1]= 0.0; - rn->up->up->totrad[2]= 0.0; - } - } - } - el= RG.elem; - for(a=0; aup) { - rn->up->totrad[0]+= 0.5*rn->totrad[0]; - rn->up->totrad[1]+= 0.5*rn->totrad[1]; - rn->up->totrad[2]+= 0.5*rn->totrad[2]; - if(rn->up->up) { - rn->up->up->totrad[0]+= 0.25*rn->totrad[0]; - rn->up->up->totrad[1]+= 0.25*rn->totrad[1]; - rn->up->up->totrad[2]+= 0.25*rn->totrad[2]; - } - } - } - - /* add using area */ - cd= coldata= MEM_mallocN(3*4*RG.totelem, "filterNodes"); - el= RG.elem; - for(a=0; atotrad, cd); - cd+= 3; - } - MEM_freeN(coldata); -} - -void removeEqualNodes(short limit) -{ - /* nodes with equal colors: remove */ - RNode **el, *rn, *rn1; - float thresh, f1, f2; - int a, foundone=1, ok; - int c1, c2; - - if(limit==0) return; - - thresh= 1.0/(256.0*RG.radfactor); - thresh= 3.0*pow(thresh, RG.gamma); - -// XXX waitcursor(1); - - while(foundone) { - foundone= 0; - - el= RG.elem; - for(a=RG.totelem; a>1; a--, el++) { - rn= *el; - rn1= *(el+1); - - if(rn!=rn->par->first && rn1!=rn1->par->first) { - if(rn->up && rn->up==rn1->up) { - f1= rn->totrad[0]+ rn->totrad[1]+ rn->totrad[2]; - f2= rn1->totrad[0]+ rn1->totrad[1]+ rn1->totrad[2]; - - ok= 0; - if(f1totrad[0]); - c2= calculatecolor(rn1->totrad[0]); - - if( abs(c1-c2)<=limit ) { - c1= calculatecolor(rn->totrad[1]); - c2= calculatecolor(rn1->totrad[1]); - - if( abs(c1-c2)<=limit ) { - c1= calculatecolor(rn->totrad[2]); - c2= calculatecolor(rn1->totrad[2]); - - if( abs(c1-c2)<=limit ) { - ok= 1; - } - } - } - } - - if(ok) { - rn->up->totrad[0]= 0.5f*(rn->totrad[0]+rn1->totrad[0]); - rn->up->totrad[1]= 0.5f*(rn->totrad[1]+rn1->totrad[1]); - rn->up->totrad[2]= 0.5f*(rn->totrad[2]+rn1->totrad[2]); - rn1= rn->up; - deleteNodes(rn1); - if(rn1->down1) ; - else { - foundone++; - a--; el++; - } - } - } - } - } - if(foundone) { - makeGlobalElemArray(); - } - } -// XXX waitcursor(0); -} - -unsigned int rad_find_or_add_mvert(Mesh *me, MFace *mf, RNode *orignode, float *w, float *radco, GHash *hash) -{ - MVert *mvert = BLI_ghash_lookup(hash, radco); - - if(!mvert) { - mvert = &me->mvert[me->totvert]; - VECCOPY(mvert->co, radco); - me->totvert++; - - BLI_ghash_insert(hash, radco, mvert); - } - - InterpWeightsQ3Dfl(orignode->v1, orignode->v2, orignode->v3, - orignode->v4, mvert->co, w); - - return (unsigned int)(mvert - me->mvert); -} - -void rad_addmesh(Scene *scene) -{ - Face *face = NULL; - Object *ob; - Mesh *me; - MVert *mvert; - MFace *mf; - RNode *node; - Material *ma=0; - GHash *verthash; - unsigned int *mcol; - float cent[3], min[3], max[3], w[4][4]; - int a; - - if(RG.totface==0) - return; - -// if(RG.totmat==MAXMAT) -// XXX notice("warning: cannot assign more than 16 materials to 1 mesh"); - - /* create the mesh */ - ob= add_object(scene, OB_MESH); - - me= ob->data; - me->totvert= totalRadVert(); - me->totface= RG.totface; - me->flag= 0; - - CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, me->totvert); - CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, NULL, me->totface); - CustomData_add_layer(&me->fdata, CD_MCOL, CD_CALLOC, NULL, me->totface); - - CustomData_merge(RG.mfdata, &me->fdata, CD_MASK_MESH, CD_CALLOC, me->totface); - mesh_update_customdata_pointers(me); - - /* create materials and set vertex color flag */ - for(a=0; amode |= MA_VERTEXCOL; - } - - /* create vertices and faces in one go, adding vertices to the end of the - mvert array if they were not added already */ - me->totvert= 0; - verthash= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); - - mcol= (unsigned int*)me->mcol; - mf= me->mface; - - for(a=0; atotface; a++, mf++, mcol+=4) { - RAD_NEXTFACE(a); - - /* the original node that this node is a subnode of */ - node= RG.mfdatanodes[face->orig]; - - /* set mverts from the radio data, and compute interpolation weights */ - mf->v1= rad_find_or_add_mvert(me, mf, node, w[0], face->v1, verthash); - mf->v2= rad_find_or_add_mvert(me, mf, node, w[1], face->v2, verthash); - mf->v3= rad_find_or_add_mvert(me, mf, node, w[2], face->v3, verthash); - if(face->v4) - mf->v4= rad_find_or_add_mvert(me, mf, node, w[3], face->v4, verthash); - - /* copy face and interpolate data */ - mf->mat_nr= face->matindex; - - CustomData_copy_data(RG.mfdata, &me->fdata, face->orig, a, 1); - CustomData_interp(RG.mfdata, &me->fdata, &face->orig, NULL, (float*)w, 1, a); - - /* load face vertex colors, with alpha added */ - mcol[0]= *((unsigned int*)face->v1+3) | 0x1000000; - mcol[1]= *((unsigned int*)face->v2+3) | 0x1000000; - mcol[2]= *((unsigned int*)face->v3+3) | 0x1000000; - if(face->v4) - mcol[3]= *((unsigned int*)face->v4+3) | 0x1000000; - - /* reorder face indices if needed to make face->v4 == 0 */ - test_index_face(mf, &me->fdata, a, face->v4? 4: 3); - } - - BLI_ghash_free(verthash, NULL, NULL); - - /* boundbox and center new */ - INIT_MINMAX(min, max); - - mvert= me->mvert; - for(a=0; atotvert; a++, mvert++) { - DO_MINMAX(mvert->co, min, max); - } - - cent[0]= (min[0]+max[0])/2.0f; - cent[1]= (min[1]+max[1])/2.0f; - cent[2]= (min[2]+max[2])/2.0f; - - mvert= me->mvert; - for(a=0; atotvert; a++, mvert++) { - VecSubf(mvert->co, mvert->co, cent); - } - - VECCOPY(ob->loc, cent); - - /* create edges */ - make_edges(me, 0); -} - -void rad_replacemesh(Scene *scene) -{ - RPatch *rp; - -// XXX deselectall(); - - rp= RG.patchbase.first; - while(rp) { - if( exist_object(rp->from)) { - if (rp->from->type == OB_MESH) { - rp->from->flag |= SELECT; - } - } - rp= rp->next; - } - - copy_objectflags(scene); -// XXX delete_obj(1); - - rad_addmesh(scene); -} - diff --git a/source/blender/radiosity/intern/source/radpreprocess.c b/source/blender/radiosity/intern/source/radpreprocess.c deleted file mode 100644 index 2b3ce1a856b..00000000000 --- a/source/blender/radiosity/intern/source/radpreprocess.c +++ /dev/null @@ -1,828 +0,0 @@ - /* *************************************** - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - - - - preproces.c nov/dec 1992 - may 1999 - - - collect from meshes - - countglobaldata() - - makeGlobalElemArray() - - $Id$ - - *************************************** */ - -#include -#include -#include -#include - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_customdata.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_mesh.h" -#include "BKE_object.h" /* during_script() */ -#include "BKE_utildefines.h" - -#include "radio.h" - -#include "BLO_sys_types.h" // for intptr_t support - -void setparelem(RNode *rn, RPatch *par); - -void splitconnected() -{ - /* Since input meshes can have faces with sharing vertices, the geometry is being tested here. - * Using normals and colors, faces are split separately. we do this by storing for each - * vertex a normal and a color - */ - RPatch *rp; - RNode *rn; - VeNoCo *vnc, *next, *vnc1; - int a; - - /* test if we need a split */ - - rp= RG.patchbase.first; - while(rp) { - rn= rp->first; - if((rp->f1 & RAD_NO_SPLIT)==0) { - for(a=0; atype; a++) { - - if(a==0) vnc= (VeNoCo *)rn->v1; - else if(a==1) vnc= (VeNoCo *)rn->v2; - else if(a==2) vnc= (VeNoCo *)rn->v3; - else vnc= (VeNoCo *)rn->v4; - - if(vnc->flag==0) { - vnc->n= (float *)rp->norm; - vnc->col= (float *)rp->ref; - vnc->flag= 1; - } - else { /* is face from this vertex allowed for gouraud? */ - vnc1= vnc; - while(vnc1) { - if(VecCompare(vnc1->n, rp->norm, 0.01f)) { - if(VecCompare(vnc1->col, rp->ref, 0.01f)) { - break; - } - } - vnc= vnc1; - vnc1= vnc1->next; - } - if(vnc1==0) { - vnc1= MEM_mallocN(sizeof(VeNoCo), "splitconn"); - vnc1->next= 0; - vnc1->v= mallocVert(); - vnc->next= vnc1; - VECCOPY(vnc1->v, vnc->v); - vnc1->n= (float *)rp->norm; - vnc1->col= (float *)rp->ref; - } - if(a==0) rn->v1= (float *)vnc1; - else if(a==1) rn->v2= (float *)vnc1; - else if(a==2) rn->v3= (float *)vnc1; - else rn->v4= (float *)vnc1; - } - } - } - rp= rp->next; - } - /* adapt vertexpointers from nodes */ - - rp= RG.patchbase.first; - while(rp) { - rn= rp->first; - rn->v1= ((VeNoCo *)(rn->v1))->v; - rn->v2= ((VeNoCo *)(rn->v2))->v; - rn->v3= ((VeNoCo *)(rn->v3))->v; - if(rp->type==4) rn->v4= ((VeNoCo *)(rn->v4))->v; - - rp= rp->next; - } - - - /* free all */ - vnc= RG.verts; - for(a=0; anext; - while(vnc1) { - next= vnc1->next; - MEM_freeN(vnc1); - vnc1= next; - } - vnc++; - } - MEM_freeN(RG.verts); - RG.verts= 0; -} - -int vergedge(const void *v1,const void *v2) -{ - int *e1, *e2; - - e1= (int *)v1; - e2= (int *)v2; - - if( e1[0] > e2[0] ) return 1; - else if( e1[0] < e2[0] ) return -1; - else if( e1[1] > e2[1] ) return 1; - else if( e1[1] < e2[1] ) return -1; - - return 0; -} - - -void addedge(float *v1, float *v2, EdSort *es) -{ - if( ((intptr_t)v1)<((intptr_t)v2) ) { - es->v1= v1; - es->v2= v2; - } - else { - es->v2= v1; - es->v1= v2; - } -} - -static void setedge(RNode *node, RNode *nb, int nr, int nrb) -{ - switch(nr) { - case 1: - node->ed1= nb; - break; - case 2: - node->ed2= nb; - break; - case 3: - node->ed3= nb; - break; - case 4: - node->ed4= nb; - break; - } - switch(nrb) { - case 1: - nb->ed1= node; - break; - case 2: - nb->ed2= node; - break; - case 3: - nb->ed3= node; - break; - case 4: - nb->ed4= node; - break; - } -} - -void setedgepointers() -{ - /* make edge-array and sort it */ - /* pairs of edges are put together: fill in pointers in nodes */ - EdSort *es, *esblock; - RPatch *rp; - RNode *rn; - int tot= 0; - - rp= RG.patchbase.first; - while(rp) { - tot+= rp->type; - rp= rp->next; - } - - if(tot==0) return; - - es=esblock= MEM_mallocN(tot*sizeof(EdSort), "setedgepointers"); - rp= RG.patchbase.first; - while(rp) { - rn= rp->first; - addedge(rn->v1, rn->v2, es); - es->nr= 1; - es->node= rn; - es++; - addedge(rn->v2, rn->v3, es); - es->nr= 2; - es->node= rn; - es++; - if(rp->type==3) { - addedge(rn->v3, rn->v1, es); - es->nr= 3; - es->node= rn; - es++; - } - else { - addedge(rn->v3, rn->v4, es); - es->nr= 3; - es->node= rn; - es++; - addedge(rn->v4, rn->v1, es); - es->nr= 4; - es->node= rn; - es++; - } - rp= rp->next; - } - - qsort(esblock,tot,sizeof(EdSort),vergedge); - - es= esblock; - while(tot>0) { - if( es->v1== (es+1)->v1 ) { - if( es->v2== (es+1)->v2 ) { - setedge(es->node, (es+1)->node, es->nr, (es+1)->nr); - tot--; - es++; - } - } - es++; - tot--; - } - - MEM_freeN(esblock); -} - -static int materialIndex(Material *ma) -{ - int i = 0; - for(i=0;i< RG.totmat; i++) - { - if (RG.matar[i] == ma) { - return i; - } - } - return -1; -} - -void rad_collect_meshes(Scene *scene, View3D *v3d) -{ - extern Material defmaterial; - Base *base; - Object *ob; - Mesh *me; - MVert *mvert; - MFace *mface; - MTFace *tf, *tface; - Material *ma = NULL, *noma= NULL; - RPatch *rp; - RNode *rn; - VeNoCo *vnc, **nodevert; - float *vd, *v1, *v2, *v3, *v4 = NULL; - int a, b, offs, index, mfdatatot; - - if (v3d==NULL) { - printf("Error, trying to collect radiosity meshes with no 3d view\n"); - return; - } - - set_radglobal(scene); - - freeAllRad(scene); - - start_fastmalloc("Radiosity"); - - /* count the number of verts */ - RG.totvert= 0; - RG.totface= 0; - base= (scene->base.first); - while(base) { - if(((base)->flag & SELECT) && ((base)->lay & v3d->lay) ) { - if(base->object->type==OB_MESH) { - base->flag |= OB_RADIO; - me= base->object->data; - RG.totvert+= me->totvert; - } - } - base= base->next; - } - if(RG.totvert==0) { - if (!during_script()); //XXX error("No vertices"); - return; - } - vnc= RG.verts= MEM_callocN(RG.totvert*sizeof(VeNoCo), "radioverts"); - - RG.min[0]= RG.min[1]= RG.min[2]= 1.0e20f; - RG.max[0]= RG.max[1]= RG.max[2]= -1.0e20f; - - mfdatatot= 0; - - /* min-max and material array */ - base= (scene->base.first); - while(base) { - if( ((base)->flag & SELECT) && ((base)->lay & v3d->lay) ) { - if(base->object->type==OB_MESH) { - me= base->object->data; - mvert= me->mvert; - for(a=0; atotvert; a++, mvert++) { - vd= mallocVert(); - VECCOPY(vd, mvert->co); - /* Should make MTC its own module... */ - Mat4MulVecfl(base->object->obmat, vd); - - vnc->v= vd; - for(b=0; b<3; b++) { - RG.min[b]= MIN2(RG.min[b], vd[b]); - RG.max[b]= MAX2(RG.max[b], vd[b]); - } - vnc++; - } - - if(base->object->totcol==0) { - if(RG.totmatobject->totcol; a++) { - if(RG.totmat >= MAXMAT) break; - - ma = give_current_material(base->object, a+1); - - if (materialIndex(ma)!=-1) break; - - RG.matar[RG.totmat]= ma; - RG.totmat++; - } - } - - mfdatatot += me->totface; - } - } - base= base->next; - } - - RG.cent[0]= (RG.min[0]+ RG.max[0])/2; - RG.cent[1]= (RG.min[1]+ RG.max[1])/2; - RG.cent[2]= (RG.min[2]+ RG.max[2])/2; - RG.size[0]= (RG.max[0]- RG.min[0]); - RG.size[1]= (RG.max[1]- RG.min[1]); - RG.size[2]= (RG.max[2]- RG.min[2]); - RG.maxsize= MAX3(RG.size[0],RG.size[1],RG.size[2]); - - RG.mfdata= MEM_callocN(sizeof(CustomData), "radiomfdata"); - RG.mfdatanodes= MEM_mallocN(sizeof(RNode*)*mfdatatot, "radiomfdatanodes"); - RG.mfdatatot= mfdatatot; - - /* make patches */ - - RG.totelem= 0; - RG.totpatch= 0; - RG.totlamp= 0; - offs= 0; - - base= (scene->base.first); - while(base) { - if( ((base)->flag & SELECT) && ((base)->lay & v3d->lay) ) { - if(base->object->type==OB_MESH) { - ob= base->object; - me= ob->data; - mface= me->mface; - tface= me->mtface; - - index= -1; - - CustomData_merge(&me->fdata, RG.mfdata, CD_MASK_DERIVEDMESH, - CD_DEFAULT, mfdatatot); - - for(a=0; atotface; a++, mface++) { - tf= tface? tface+a: NULL; - - if (tf && (tf->mode & TF_INVISIBLE)) - continue; - - rp= callocPatch(); - BLI_addtail(&(RG.patchbase), rp); - rp->from= ob; - - if(mface->v4) rp->type= 4; - else rp->type= 3; - - rp->first= rn= callocNode(); - - if(mface->flag & ME_SMOOTH) rp->f1= RAD_NO_SPLIT; - - /* temporal: we store the venoco in the node */ - rn->v1= (float *)(RG.verts+mface->v1+offs); - v1= (RG.verts+mface->v1+offs)->v; - rn->v2= (float *)(RG.verts+mface->v2+offs); - v2= (RG.verts+mface->v2+offs)->v; - rn->v3= (float *)(RG.verts+mface->v3+offs); - v3= (RG.verts+mface->v3+offs)->v; - - if(mface->v4) { - rn->v4= (float *)(RG.verts+mface->v4+offs); - v4= (RG.verts+mface->v4+offs)->v; - } - rn->par= rp; - rn->f= RAD_PATCH; /* this node is a Patch */ - rn->type= rp->type; - - if(rn->type==4) { - rp->area= AreaQ3Dfl(v1, v2, v3, v4); - CalcNormFloat4(v1, v2, v3, v4, rp->norm); - } - else { - rp->area= AreaT3Dfl(v1, v2, v3); - CalcNormFloat(v1, v2, v3, rp->norm); - } - - rn->area= rp->area; - - /* color and emit */ - if(mface->mat_nr != index) { - index= mface->mat_nr; - ma= give_current_material(ob, index+1); - if(ma==0) ma= &defmaterial; - } - rp->ref[0]= ma->r; - rp->ref[1]= ma->g; - rp->ref[2]= ma->b; - - if(ma->emit) RG.totlamp++; - - rp->emit[0]= rp->emit[1]= rp->emit[2]= ma->emit; - rp->emit[0]*= rp->ref[0]; - rp->emit[1]*= rp->ref[1]; - rp->emit[2]*= rp->ref[2]; - -// uncommented, this is not satisfying, but i leave it in code for now (ton) -// if(ma->translucency!=0.0) rn->f |= RAD_TWOSIDED; - - nodevert= (VeNoCo **)&(rn->v1); - for(b=0; btype; b++) { - rp->cent[0]+= (*nodevert)->v[0]; - rp->cent[1]+= (*nodevert)->v[1]; - rp->cent[2]+= (*nodevert)->v[2]; - nodevert++; - } - rp->cent[0]/= (float)rp->type; - rp->cent[1]/= (float)rp->type; - rp->cent[2]/= (float)rp->type; - - /* for reconstruction materials */ - rp->matindex= materialIndex(ma); - if(rp->matindex==-1) rp->matindex= 1; - - /* these RNode's are stored now for later use in rad_addmesh - they should not get deleted before that */ - rn->orig= RG.totelem; - RG.mfdatanodes[RG.totelem]= rn; - - CustomData_copy_data(&me->fdata, RG.mfdata, a, RG.totelem, 1); - - RG.totelem++; - RG.totpatch++; - } - - offs+= me->totvert; - } - } - base= base->next; - } - - splitconnected(); - setedgepointers(); - - makeGlobalElemArray(); - pseudoAmb(); - rad_setlimits(scene); -} - -void setparelem(RNode *rn, RPatch *par) -{ - - if(rn->down1) { - setparelem(rn->down1, par); - setparelem(rn->down2, par); - } - else { - rn->par= par; - } -} - -void countelem(RNode *rn) -{ - - if(rn->down1) { - countelem(rn->down1); - countelem(rn->down2); - } - else RG.totelem++; -} - -void countglobaldata() -{ - /* counts elements and patches*/ - RPatch *rp; - - RG.totelem= RG.totpatch= 0; - - rp= RG.patchbase.first; - while(rp) { - RG.totpatch++; - countelem(rp->first); - rp= rp->next; - } -} - -void addelem(RNode ***el, RNode *rn, RPatch *rp) -{ - if(rn->down1) { - addelem(el, rn->down1, rp); - addelem(el, rn->down2, rp); - } - else { - rn->par= rp; - **el= rn; - (*el)++; - } -} - -void makeGlobalElemArray() -{ - /* always called when # of elements change */ - RPatch *rp; - RNode **el; - - countglobaldata(); - - if(RG.elem) MEM_freeN(RG.elem); - if(RG.totelem) { - el= RG.elem= MEM_mallocN(sizeof(void *)*RG.totelem, "makeGlobalElemArray"); - } - else { - RG.elem= 0; - return; - } - - /* recursive adding elements */ - rp= RG.patchbase.first; - while(rp) { - addelem(&el, rp->first, rp); - rp= rp->next; - } - - /* formfactor array */ - if(RG.formfactors) MEM_freeN(RG.formfactors); - if(RG.totelem) - RG.formfactors= MEM_mallocN(sizeof(float)*RG.totelem, "formfactors"); - else - RG.formfactors= 0; -} - -void splitpatch(RPatch *old) /* in case of overflow during shoot */ -{ - RNode *rn; - float **fpp; - RPatch *rp; - int a; - - rn= old->first; - if(rn->down1==0) return; - rn= rn->down1; - - old->unshot[0]/=2.0; - old->unshot[1]/=2.0; - old->unshot[2]/=2.0; - setnodeflags(old->first, 2, 0); - - rp= mallocPatch(); - *rp= *old; - BLI_addhead(&RG.patchbase, rp); - rp->first= rn; - rp->area= rn->area; - rp->cent[0]= rp->cent[1]= rp->cent[2]= 0.0; - fpp= &(rn->v1); - for(a=0; atype; a++) { - rp->cent[0]+= (*fpp)[0]; - rp->cent[1]+= (*fpp)[1]; - rp->cent[2]+= (*fpp)[2]; - fpp++; - } - rp->cent[0]/=(float)rp->type; - rp->cent[1]/=(float)rp->type; - rp->cent[2]/=(float)rp->type; - - setparelem(rn, rp); - - rn= old->first->down2; - - rp= mallocPatch(); - *rp= *old; - BLI_addhead(&RG.patchbase, rp); - rp->first= rn; - rp->area= rn->area; - rp->cent[0]= rp->cent[1]= rp->cent[2]= 0.0; - fpp= &(rn->v1); - for(a=0; atype; a++) { - rp->cent[0]+= (*fpp)[0]; - rp->cent[1]+= (*fpp)[1]; - rp->cent[2]+= (*fpp)[2]; - fpp++; - } - rp->cent[0]/=(float)rp->type; - rp->cent[1]/=(float)rp->type; - rp->cent[2]/=(float)rp->type; - - setparelem(rn, rp); - - BLI_remlink(&RG.patchbase, old); - freePatch(old); -} - - -void addpatch(RPatch *old, RNode *rn) -{ - float **fpp; - RPatch *rp; - int a; - - if(rn->down1) { - addpatch(old, rn->down1); - addpatch(old, rn->down2); - } - else { - rp= mallocPatch(); - *rp= *old; - BLI_addhead(&RG.patchbase, rp); - rp->first= rn; - - rp->area= rn->area; - rp->cent[0]= rp->cent[1]= rp->cent[2]= 0.0; - fpp= &(rn->v1); - for(a=0; atype; a++) { - rp->cent[0]+= (*fpp)[0]; - rp->cent[1]+= (*fpp)[1]; - rp->cent[2]+= (*fpp)[2]; - fpp++; - } - rp->cent[0]/=(float)rp->type; - rp->cent[1]/=(float)rp->type; - rp->cent[2]/=(float)rp->type; - - rn->par= rp; - } -} - -void converttopatches() -{ - /* chacks patches list, if node subdivided: new patch */ - RPatch *rp, *next; - - rp= RG.patchbase.first; - while(rp) { - next= rp->next; - if(rp->first->down1) { - addpatch(rp, rp->first); - BLI_remlink(&RG.patchbase, rp); - freePatch(rp); - } - rp= next; - } - -} - -void subdiv_elements() -{ - RNode **el, *rn; - int a, toobig= 1; - - rad_init_energy(); - - /* first maxsize elements */ - - while(toobig) { - toobig= 0; - - el= RG.elem; - for(a=RG.totelem; a>0; a--, el++) { - rn= *el; - if( rn->totrad[0]==0.0 && rn->totrad[1]==0.0 && rn->totrad[2]==0.0) { - if(rn->area>RG.elemmin) { - subdivideNode(rn, 0); - if(rn->down1 ) { - toobig= 1; - if(rn->down1->area>RG.elemmin) - subdivideNode( rn->down1, 0); - if(rn->down2->area>RG.elemmin) - subdivideNode( rn->down2, 0); - } - } - } - } - if(toobig) makeGlobalElemArray(); - } - - el= RG.elem; - for(a=RG.totelem; a>0; a--, el++) { - rn= *el; - if( rn->totrad[0]==0.0 && rn->totrad[1]==0.0 && rn->totrad[2]==0.0) { - subdivideNode(rn, 0); - if( rn->down1 ) { - subdivideNode( rn->down1, 0); - subdivideNode( rn->down2, 0); - } - } - } - makeGlobalElemArray(); -} - -void subdividelamps() -{ - RPatch *rp, *next; - - rp= RG.patchbase.first; - while(rp) { - next= rp->next; - if(rp->emit[0]!=0.0 || rp->emit[1]!=0.0 || rp->emit[2]!=0.0) { - subdivideNode( rp->first, 0); - if(rp->first->down1) { - subdivideNode(rp->first->down1, 0); - subdivideNode(rp->first->down2, 0); - } - - addpatch(rp, rp->first); - BLI_remlink(&RG.patchbase, rp); - freePatch(rp); - } - rp= next; - } - -} - -void maxsizePatches() -{ - RPatch *rp; - int toobig= 1; - - while(toobig) { - toobig= 0; - rp= RG.patchbase.first; - while(rp) { - if(rp->area>RG.patchmax) { - subdivideNode( rp->first, 0); - if(rp->first->down1) toobig= 1; - } - rp= rp->next; - } - - if(toobig) converttopatches(); - } - - /* count lamps */ - rp= RG.patchbase.first; - RG.totlamp= 0; - while(rp) { - if(rp->emit[0]!=0.0 || rp->emit[1]!=0.0 || rp->emit[2]!=0.0) { - RG.totlamp++; - } - rp= rp->next; - } - makeGlobalElemArray(); -} - - - diff --git a/source/blender/radiosity/intern/source/radrender.c b/source/blender/radiosity/intern/source/radrender.c deleted file mode 100644 index d33bbc90ee3..00000000000 --- a/source/blender/radiosity/intern/source/radrender.c +++ /dev/null @@ -1,530 +0,0 @@ -/* *************************************** - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/* radrender.c, aug 2003 - * - * Most of the code here is copied from radiosity code, to optimize for renderfaces. - * Shared function calls mostly reside in radfactors.c - * No adaptive subdivision takes place - * - * - do_radio_render(); main call, extern - * - initradfaces(); add radface structs in render faces, init radio globals - * - - * - initradiosity(); LUTs - * - inithemiwindows(); - * - progressiverad(); main itteration loop - * - hemi zbuffers - * - calc rad factors - * - * - closehemiwindows(); - * - freeAllRad(); - * - make vertex colors - * - * - during render, materials use totrad as ambient replacement - * - free radfaces - */ - -#include -#include -#include - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_rand.h" - -#include "BKE_utildefines.h" -#include "BKE_global.h" -#include "BKE_main.h" - -#include "radio.h" - -/* the radiosity module uses internal includes from render! */ -#include "renderpipeline.h" -#include "render_types.h" -#include "renderdatabase.h" - - -/* only needed now for a print, if its useful move to RG */ -static float maxenergy; - -/* find the face with maximum energy to become shooter */ -/* nb: _rr means rad-render version of existing radio call */ -static void findshoot_rr(Render *re, VlakRen **shoot_p, RadFace **shootrf_p) -{ - RadFace *rf, *shootrf, **radface; - ObjectRen *obr; - VlakRen *vlr=NULL, *shoot; - float energy; - int a; - - shoot= NULL; - shootrf= NULL; - maxenergy= 0.0; - - for(obr=re->objecttable.first; obr; obr=obr->next) { - for(a=0; atotvlak; a++) { - if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; - if((radface=RE_vlakren_get_radface(obr, vlr, 0)) && *radface) { - rf= *radface; - rf->flag &= ~RAD_SHOOT; - - energy= rf->unshot[0]*rf->area; - energy+= rf->unshot[1]*rf->area; - energy+= rf->unshot[2]*rf->area; - - if(energy>maxenergy) { - shoot= vlr; - shootrf= rf; - maxenergy= energy; - } - } - } - } - - if(shootrf) { - maxenergy/= RG.totenergy; - if(maxenergyflag |= RAD_SHOOT; - } - - *shoot_p= shoot; - *shootrf_p= shootrf; -} - -static void backface_test_rr(Render *re, VlakRen *shoot, RadFace *shootrf) -{ - ObjectRen *obr; - VlakRen *vlr=NULL; - RadFace *rf, **radface; - float tvec[3]; - int a; - - /* backface testing */ - for(obr=re->objecttable.first; obr; obr=obr->next) { - for(a=0; atotvlak; a++) { - if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; - if(vlr != shoot && (radface=RE_vlakren_get_radface(obr, vlr, 0)) && *radface) { - rf= *radface; - VecSubf(tvec, shootrf->cent, rf->cent); - - if(tvec[0]*rf->norm[0]+ tvec[1]*rf->norm[1]+ tvec[2]*rf->norm[2] < 0.0) - rf->flag |= RAD_BACKFACE; - } - } - } -} - -static void clear_backface_test_rr(Render *re) -{ - ObjectRen *obr; - VlakRen *vlr=NULL; - RadFace *rf, **radface; - int a; - - /* backface flag clear */ - for(obr=re->objecttable.first; obr; obr=obr->next) { - for(a=0; atotvlak; a++) { - if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; - - if((radface=RE_vlakren_get_radface(obr, vlr, 0)) && *radface) { - rf= *radface; - rf->flag &= ~RAD_BACKFACE; - } - } - } -} - -extern RadView hemitop, hemiside; // radfactors.c - -/* hemi-zbuffering, delivers formfactors array */ -static void makeformfactors_rr(Render *re, VlakRen *shoot, RadFace *shootrf) -{ - ObjectRen *obr; - VlakRen *vlr=NULL; - RadFace *rf, **radface; - float len, vec[3], up[3], side[3], tar[5][3], *fp; - int a; - - memset(RG.formfactors, 0, sizeof(float)*RG.totelem); - - /* set up hemiview */ - /* first: upvector for hemitop, we use diagonal hemicubes to prevent aliasing */ - - VecSubf(vec, shoot->v1->co, shootrf->cent); - Crossf(up, shootrf->norm, vec); - len= Normalize(up); - - VECCOPY(hemitop.up, up); - VECCOPY(hemiside.up, shootrf->norm); - - Crossf(side, shootrf->norm, up); - - /* five targets */ - VecAddf(tar[0], shootrf->cent, shootrf->norm); - VecAddf(tar[1], shootrf->cent, up); - VecSubf(tar[2], shootrf->cent, up); - VecAddf(tar[3], shootrf->cent, side); - VecSubf(tar[4], shootrf->cent, side); - - /* camera */ - VECCOPY(hemiside.cam, shootrf->cent); - VECCOPY(hemitop.cam, shootrf->cent); - - /* do it! */ - VECCOPY(hemitop.tar, tar[0]); - hemizbuf(&hemitop); - - for(a=1; a<5; a++) { - VECCOPY(hemiside.tar, tar[a]); - hemizbuf(&hemiside); - } - - /* convert factors to real radiosity */ - fp= RG.formfactors; - - for(obr=re->objecttable.first; obr; obr=obr->next) { - for(a=0; atotvlak; a++) { - if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; - - if((radface=RE_vlakren_get_radface(obr, vlr, 0)) && *radface) { - rf= *radface; - if(*fp!=0.0 && rf->area!=0.0) { - *fp *= shootrf->area/rf->area; - if(*fp>1.0) *fp= 1.0001; - } - fp++; - } - } - } -} - -/* based at RG.formfactors array, distribute shoot energy over other faces */ -static void applyformfactors_rr(Render *re, VlakRen *shoot, RadFace *shootrf) -{ - ObjectRen *obr; - VlakRen *vlr=NULL; - RadFace *rf, **radface; - float *fp, *ref, unr, ung, unb, r, g, b; - int a; - - unr= shootrf->unshot[0]; - ung= shootrf->unshot[1]; - unb= shootrf->unshot[2]; - - fp= RG.formfactors; - - for(obr=re->objecttable.first; obr; obr=obr->next) { - for(a=0; atotvlak; a++) { - if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; - - if((radface=RE_vlakren_get_radface(obr, vlr, 0)) && *radface) { - rf= *radface; - if(*fp!= 0.0) { - - ref= &(vlr->mat->r); - - r= (*fp)*unr*ref[0]; - g= (*fp)*ung*ref[1]; - b= (*fp)*unb*ref[2]; - - // if(rf->flag & RAD_BACKFACE) { - - rf->totrad[0]+= r; - rf->totrad[1]+= g; - rf->totrad[2]+= b; - - rf->unshot[0]+= r; - rf->unshot[1]+= g; - rf->unshot[2]+= b; - } - fp++; - } - } - } - /* shoot energy has been shot */ - shootrf->unshot[0]= shootrf->unshot[1]= shootrf->unshot[2]= 0.0; -} - - -/* main loop for itterations */ -static void progressiverad_rr(Render *re) -{ - VlakRen *shoot; - RadFace *shootrf; - float unshot[3]; - int it= 0; - - findshoot_rr(re, &shoot, &shootrf); - while( shoot ) { - - /* backfaces receive no energy, but are zbuffered... */ - backface_test_rr(re, shoot, shootrf); - - /* ...unless it's two sided */ - if(shootrf->flag & RAD_TWOSIDED) { - VECCOPY(unshot, shootrf->unshot); - VecNegf(shootrf->norm); - makeformfactors_rr(re, shoot, shootrf); - applyformfactors_rr(re, shoot, shootrf); - VecNegf(shootrf->norm); - VECCOPY(shootrf->unshot, unshot); - } - - /* hemi-zbuffers */ - makeformfactors_rr(re, shoot, shootrf); - /* based at RG.formfactors array, distribute shoot energy over other faces */ - applyformfactors_rr(re, shoot, shootrf); - - it++; - re->timecursor(re->tch, it); - - clear_backface_test_rr(re); - - if(re->test_break(re->tbh)) break; - if(RG.maxiter && RG.maxiter<=it) break; - - findshoot_rr(re, &shoot, &shootrf); - } - printf(" Unshot energy:%f\n", 1000.0*maxenergy); - - re->timecursor(re->tch, re->scene->r.cfra); -} - -static RadFace *radfaces=NULL; - -static void initradfaces(Render *re) -{ - ObjectRen *obr; - VlakRen *vlr= NULL; - RadFace *rf, **radface; - int a, b; - - /* globals */ - RG.totenergy= 0.0; - RG.totpatch= 0; // we count initial emittors here - RG.totelem= 0; // total # faces are put here (so we can use radfactors.c calls) - /* size is needed for hemicube clipping */ - RG.min[0]= RG.min[1]= RG.min[2]= 1.0e20; - RG.max[0]= RG.max[1]= RG.max[2]= -1.0e20; - - /* count first for fast malloc */ - for(obr=re->objecttable.first; obr; obr=obr->next) { - for(a=0; atotvlak; a++) { - if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; - - if(vlr->mat->mode & MA_RADIO) { - if(vlr->mat->emit > 0.0) { - RG.totpatch++; - } - RG.totelem++; - } - } - } - -printf(" Rad elems: %d emittors %d\n", RG.totelem, RG.totpatch); - if(RG.totelem==0 || RG.totpatch==0) return; - - /* make/init radfaces */ - rf=radfaces= MEM_callocN(RG.totelem*sizeof(RadFace), "radfaces"); - for(obr=re->objecttable.first; obr; obr=obr->next) { - for(a=0; atotvlak; a++) { - if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; - - if(vlr->mat->mode & MA_RADIO) { - - /* during render, vlr->n gets flipped/corrected, we cannot have that */ - if (obr->ob->transflag & OB_NEG_SCALE){ - /* The object has negative scale that will cause the normals to flip. - To counter this unwanted normal flip, swap vertex 2 and 4 for a quad - or vertex 2 and 3 (see flip_face) for a triangle in the call to CalcNormFloat4 - in order to flip the normals back to the way they were in the original mesh. */ - if(vlr->v4) CalcNormFloat4(vlr->v1->co, vlr->v4->co, vlr->v3->co, vlr->v2->co, rf->norm); - else CalcNormFloat(vlr->v1->co, vlr->v3->co, vlr->v2->co, rf->norm); - }else{ - if(vlr->v4) CalcNormFloat4(vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->v4->co, rf->norm); - else CalcNormFloat(vlr->v1->co, vlr->v2->co, vlr->v3->co, rf->norm); - } - - rf->totrad[0]= vlr->mat->emit*vlr->mat->r; - rf->totrad[1]= vlr->mat->emit*vlr->mat->g; - rf->totrad[2]= vlr->mat->emit*vlr->mat->b; - VECCOPY(rf->unshot, rf->totrad); - - if(vlr->v4) { - rf->area= AreaQ3Dfl(vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->v4->co); - CalcCent4f(rf->cent, vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->v4->co); - } - else { - rf->area= AreaT3Dfl(vlr->v1->co, vlr->v2->co, vlr->v3->co); - CalcCent3f(rf->cent, vlr->v1->co, vlr->v2->co, vlr->v3->co); - } - - RG.totenergy+= rf->unshot[0]*rf->area; - RG.totenergy+= rf->unshot[1]*rf->area; - RG.totenergy+= rf->unshot[2]*rf->area; - - for(b=0; b<3; b++) { - RG.min[b]= MIN2(RG.min[b], rf->cent[b]); - RG.max[b]= MAX2(RG.max[b], rf->cent[b]); - } - - // uncommented; this isnt satisfying, but i leave it in the code for now (ton) - // if(vlr->mat->translucency!=0.0) rf->flag |= RAD_TWOSIDED; - - radface=RE_vlakren_get_radface(obr, vlr, 1); - *radface= rf++; - } - } - } - RG.size[0]= (RG.max[0]- RG.min[0]); - RG.size[1]= (RG.max[1]- RG.min[1]); - RG.size[2]= (RG.max[2]- RG.min[2]); - RG.maxsize= MAX3(RG.size[0],RG.size[1],RG.size[2]); - - /* formfactor array */ - if(RG.formfactors) MEM_freeN(RG.formfactors); - if(RG.totelem) - RG.formfactors= MEM_mallocN(sizeof(float)*RG.totelem, "formfactors"); - else - RG.formfactors= NULL; - -} - -static void vecaddfac(float *vec, float *v1, float *v2, float fac) -{ - vec[0]= v1[0] + fac*v2[0]; - vec[1]= v1[1] + fac*v2[1]; - vec[2]= v1[2] + fac*v2[2]; - -} - -/* unused now, doesnt work..., find it in cvs of nov 2005 or older */ -/* static void filter_rad_values(void) */ - - -static void make_vertex_rad_values(Render *re) -{ - ObjectRen *obr; - VertRen *v1=NULL; - VlakRen *vlr=NULL; - RadFace *rf, **radface; - float *col; - int a; - - RG.igamma= 1.0/RG.gamma; - RG.radfactor= RG.radfac*pow(64*64, RG.igamma)/128.0; /* compatible with radio-tool */ - - /* accumulate vertexcolors */ - for(obr=re->objecttable.first; obr; obr=obr->next) { - for(a=0; atotvlak; a++) { - if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; - - if((radface=RE_vlakren_get_radface(obr, vlr, 0)) && *radface) { - rf= *radface; - - /* apply correction */ - rf->totrad[0]= RG.radfactor*pow( rf->totrad[0], RG.igamma); - rf->totrad[1]= RG.radfactor*pow( rf->totrad[1], RG.igamma); - rf->totrad[2]= RG.radfactor*pow( rf->totrad[2], RG.igamma); - - /* correct rf->rad values for color */ - if(vlr->mat->r > 0.0) rf->totrad[0]/= vlr->mat->r; - if(vlr->mat->g > 0.0) rf->totrad[1]/= vlr->mat->g; - if(vlr->mat->b > 0.0) rf->totrad[2]/= vlr->mat->b; - - col= RE_vertren_get_rad(obr, vlr->v1, 1); - vecaddfac(col, col, rf->totrad, rf->area); - col[3]+= rf->area; - - col= RE_vertren_get_rad(obr, vlr->v2, 1); - vecaddfac(col, col, rf->totrad, rf->area); - col[3]+= rf->area; - - col= RE_vertren_get_rad(obr, vlr->v3, 1); - vecaddfac(col, col, rf->totrad, rf->area); - col[3]+= rf->area; - - if(vlr->v4) { - col= RE_vertren_get_rad(obr, vlr->v4, 1); - vecaddfac(col, col, rf->totrad, rf->area); - col[3]+= rf->area; - } - } - } - - /* make vertex colors */ - for(a=0; atotvert; a++) { - if((a & 255)==0) v1= RE_findOrAddVert(obr, a); else v1++; - - col= RE_vertren_get_rad(obr, v1, 0); - if(col && col[3]>0.0) { - col[0]/= col[3]; - col[1]/= col[3]; - col[2]/= col[3]; - } - } - } -} - -/* main call, extern */ -void do_radio_render(Render *re) -{ - if(re->scene->radio==NULL) add_radio(re->scene); - freeAllRad(re->scene); /* just in case radio-tool is still used */ - - set_radglobal(re->scene); /* init the RG struct */ - RG.re= re; /* only used by hemizbuf(), prevents polluting radio code all over */ - - initradfaces(re); /* add radface structs to render faces */ - if(RG.totenergy>0.0) { - - initradiosity(); /* LUT's */ - inithemiwindows(); /* views, need RG.maxsize for clipping */ - - progressiverad_rr(re); /* main radio loop */ - - make_vertex_rad_values(re); /* convert face energy to vertex ones */ - - } - - freeAllRad(re->scene); /* luts, hemis, sets vars at zero */ -} - -/* free call, after rendering, extern */ -void end_radio_render(void) -{ - if(radfaces) MEM_freeN(radfaces); - radfaces= NULL; -} - diff --git a/source/blender/render/extern/include/RE_render_ext.h b/source/blender/render/extern/include/RE_render_ext.h index 20eea0c98bd..15b59f2c8cc 100644 --- a/source/blender/render/extern/include/RE_render_ext.h +++ b/source/blender/render/extern/include/RE_render_ext.h @@ -47,7 +47,8 @@ struct Render; struct MTex; struct ImBuf; -void RE_zbufferall_radio(struct RadView *vw, struct RNode **rg_elem, int rg_totelem, struct Render *re); +// RADIO REMOVED, Maybe this will be useful later +//void RE_zbufferall_radio(struct RadView *vw, struct RNode **rg_elem, int rg_totelem, struct Render *re); /* particle.c, effect.c, editmesh_modes.c and brush.c, returns 1 if rgb, 0 otherwise */ int externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 8423b5d271c..a00cd2211fc 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -104,7 +104,6 @@ #include "rendercore.h" #include "renderdatabase.h" #include "renderpipeline.h" -#include "radio.h" #include "shadbuf.h" #include "shading.h" #include "strand.h" @@ -4311,8 +4310,9 @@ void RE_Database_Free(Render *re) } free_mesh_orco_hash(re); - +#if 0 /* radio can be redone better */ end_radio_render(); +#endif end_render_materials(); end_render_textures(); @@ -4739,10 +4739,11 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view) /* yafray: 'direct' radiosity, environment maps and raytree init not needed for yafray render */ /* although radio mode could be useful at some point, later */ if (re->r.renderer==R_INTERN) { +#if 0 /* RADIO was removed */ /* RADIO (uses no R anymore) */ if(!re->test_break(re->tbh)) if(re->r.mode & R_RADIO) do_radio_render(re); - +#endif /* raytree */ if(!re->test_break(re->tbh)) { if(re->r.mode & R_RAYTRACE) { diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index f7aae88519f..5eec13ed7fe 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -62,7 +62,6 @@ #include "intern/openexr/openexr_multi.h" #include "RE_pipeline.h" -#include "radio.h" /* internal */ #include "render_types.h" diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index b68cecce7bd..21c3977fc0b 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -49,14 +49,12 @@ #include "DNA_mesh_types.h" #include "DNA_node_types.h" #include "DNA_meshdata_types.h" +#include "DNA_material_types.h" #include "BKE_global.h" #include "BKE_material.h" #include "BKE_utildefines.h" -#include "radio_types.h" -#include "radio.h" /* needs RG, some root data for radiosity */ - #include "RE_render_ext.h" /* local includes */ @@ -2301,110 +2299,6 @@ static int hashlist_projectvert(float *v1, float winmat[][4], float *hoco) return buck->clip; } -/* used for booth radio 'tool' as during render */ -void RE_zbufferall_radio(struct RadView *vw, RNode **rg_elem, int rg_totelem, Render *re) -{ - ZSpan zspan; - float hoco[4][4], winmat[4][4]; - int a, zvlnr; - int c1, c2, c3, c4= 0; - - if(rg_totelem==0) return; - - hashlist_projectvert(NULL, winmat, NULL); - - /* needed for projectvert */ - MTC_Mat4MulMat4(winmat, vw->viewmat, vw->winmat); - - /* 1.0f for clipping in clippyra()... bad stuff actually */ - zbuf_alloc_span(&zspan, vw->rectx, vw->recty, 1.0f); - zspan.zmulx= ((float)vw->rectx)/2.0; - zspan.zmuly= ((float)vw->recty)/2.0; - zspan.zofsx= -0.5f; - zspan.zofsy= -0.5f; - - /* the buffers */ - zspan.rectz= (int *)vw->rectz; - zspan.rectp= (int *)vw->rect; - zspan.recto= MEM_callocN(sizeof(int)*vw->rectx*vw->recty, "radiorecto"); - fillrect(zspan.rectz, vw->rectx, vw->recty, 0x7FFFFFFF); - fillrect(zspan.rectp, vw->rectx, vw->recty, 0xFFFFFF); - - /* filling methods */ - zspan.zbuffunc= zbuffillGL4; - - if(rg_elem) { /* radio tool */ - RNode **re, *rn; - - re= rg_elem; - re+= (rg_totelem-1); - for(a= rg_totelem-1; a>=0; a--, re--) { - rn= *re; - if( (rn->f & RAD_SHOOT)==0 ) { /* no shootelement */ - - if( rn->f & RAD_TWOSIDED) zvlnr= a; - else if( rn->f & RAD_BACKFACE) zvlnr= 0xFFFFFF; - else zvlnr= a; - - c1= hashlist_projectvert(rn->v1, winmat, hoco[0]); - c2= hashlist_projectvert(rn->v2, winmat, hoco[1]); - c3= hashlist_projectvert(rn->v3, winmat, hoco[2]); - - if(rn->v4) { - c4= hashlist_projectvert(rn->v4, winmat, hoco[3]); - } - - if(rn->v4) - zbufclip4(&zspan, 0, zvlnr, hoco[0], hoco[1], hoco[2], hoco[3], c1, c2, c3, c4); - else - zbufclip(&zspan, 0, zvlnr, hoco[0], hoco[1], hoco[2], c1, c2, c3); - } - } - } - else { /* radio render */ - ObjectRen *obr; - VlakRen *vlr=NULL; - RadFace **radface, *rf; - int totface=0; - - /* note: radio render doesn't support duplis */ - for(obr=re->objecttable.first; obr; obr=obr->next) { - hashlist_projectvert(NULL, NULL, NULL); /* clear hashlist */ - - for(a=0; atotvlak; a++) { - if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; - - if((radface=RE_vlakren_get_radface(obr, vlr, 0)) && *radface) { - rf= *radface; - if( (rf->flag & RAD_SHOOT)==0 ) { /* no shootelement */ - - if( rf->flag & RAD_TWOSIDED) zvlnr= totface; - else if( rf->flag & RAD_BACKFACE) zvlnr= 0xFFFFFF; /* receives no energy, but is zbuffered */ - else zvlnr= totface; - - c1= hashlist_projectvert(vlr->v1->co, winmat, hoco[0]); - c2= hashlist_projectvert(vlr->v2->co, winmat, hoco[1]); - c3= hashlist_projectvert(vlr->v3->co, winmat, hoco[2]); - - if(vlr->v4) { - c4= hashlist_projectvert(vlr->v4->co, winmat, hoco[3]); - } - - if(vlr->v4) - zbufclip4(&zspan, 0, zvlnr, hoco[0], hoco[1], hoco[2], hoco[3], c1, c2, c3, c4); - else - zbufclip(&zspan, 0, zvlnr, hoco[0], hoco[1], hoco[2], c1, c2, c3); - } - totface++; - } - } - } - } - - MEM_freeN(zspan.recto); - zbuf_free_span(&zspan); -} - void zbuffer_shadow(Render *re, float winmat[][4], LampRen *lar, int *rectz, int size, float jitx, float jity) { ZbufProjectCache cache[ZBUF_PROJECT_CACHE_SIZE]; diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index adbc43e439d..0bc35ffa9b2 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -58,8 +58,6 @@ #include "RE_pipeline.h" /* RE_ free stuff */ -#include "radio.h" - #ifndef DISABLE_PYTHON #include "BPY_extern.h" #endif @@ -196,9 +194,6 @@ void WM_exit(bContext *C) // BIF_freeRetarget(); BIF_freeTemplates(C); BIF_freeSketch(C); - - /* Context should still working here. but radio tool needs cleaning... */ - freeAllRad(CTX_data_scene(C)); free_ttfont(); /* bke_font.h */ diff --git a/source/gameengine/BlenderRoutines/Makefile b/source/gameengine/BlenderRoutines/Makefile index f5486bae87b..549e466c4e0 100644 --- a/source/gameengine/BlenderRoutines/Makefile +++ b/source/gameengine/BlenderRoutines/Makefile @@ -36,8 +36,6 @@ include nan_compile.mk CCFLAGS += $(LEVEL_1_CPP_WARNINGS) CPPFLAGS += -I$(NAN_GLEW)/include -CPPFLAGS += -I$(NAN_SUMO)/include -I$(NAN_SOLID)/include -CPPFLAGS += -I$(NAN_SOLID) CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include CPPFLAGS += -I$(NAN_FUZZICS)/include @@ -67,7 +65,6 @@ CPPFLAGS += -I../../kernel/gen_system CPPFLAGS += -I../Network CPPFLAGS += -I../Network/LoopBackNetwork CPPFLAGS += -I../Physics/common -CPPFLAGS += -I../Physics/Sumo CPPFLAGS += -I. ifeq ($(OS),windows) diff --git a/source/gameengine/BlenderRoutines/SConscript b/source/gameengine/BlenderRoutines/SConscript index a0cc3af3611..c2094a15825 100644 --- a/source/gameengine/BlenderRoutines/SConscript +++ b/source/gameengine/BlenderRoutines/SConscript @@ -20,11 +20,6 @@ incs += ' #intern/SoundSystem #source/blender/misc #source/blender/blenloader' incs += ' #extern/glew/include #source/blender/gpu' incs += ' #source/blender/windowmanager' -if env['WITH_BF_SOLID']: - incs += ' #source/gameengine/Physics/Sumo #source/gameengine/Physics/Sumo/Fuzzics/include' - incs += ' ' + env['BF_SOLID_INC'] - defs.append('USE_SUMO_SOLID') - if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') diff --git a/source/gameengine/CMakeLists.txt b/source/gameengine/CMakeLists.txt index fd05858710d..f546a31fb2e 100644 --- a/source/gameengine/CMakeLists.txt +++ b/source/gameengine/CMakeLists.txt @@ -38,7 +38,6 @@ ADD_SUBDIRECTORY(Rasterizer) ADD_SUBDIRECTORY(Rasterizer/RAS_OpenGLRasterizer) ADD_SUBDIRECTORY(SceneGraph) ADD_SUBDIRECTORY(Physics/Bullet) -ADD_SUBDIRECTORY(Physics/Sumo) ADD_SUBDIRECTORY(VideoTexture) IF(WITH_PLAYER) diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index b907e300879..177f261e40b 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -163,7 +163,6 @@ extern "C" { #include "SG_BBox.h" #include "SG_Tree.h" -// defines USE_ODE to choose physics engine #include "KX_ConvertPhysicsObject.h" #ifdef USE_BULLET #include "CcdPhysicsEnvironment.h" @@ -1610,18 +1609,6 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, break; #endif -#ifdef USE_SUMO_SOLID - case UseSumo: - KX_ConvertSumoObject(gameobj, meshobj, kxscene, shapeprops, smmaterial, &objprop); - break; -#endif - -#ifdef USE_ODE - case UseODE: - KX_ConvertODEEngineObject(gameobj, meshobj, kxscene, shapeprops, smmaterial, &objprop); - break; -#endif //USE_ODE - case UseDynamo: //KX_ConvertDynamoObject(gameobj,meshobj,kxscene,shapeprops, smmaterial, &objprop); break; diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 86e20b88580..9e0a710f44f 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -44,21 +44,12 @@ #include "DummyPhysicsEnvironment.h" -//to decide to use sumo/ode or dummy physics - defines USE_ODE #include "KX_ConvertPhysicsObject.h" #ifdef USE_BULLET #include "CcdPhysicsEnvironment.h" #endif -#ifdef USE_ODE -#include "OdePhysicsEnvironment.h" -#endif //USE_ODE - -#ifdef USE_SUMO_SOLID -#include "SumoPhysicsEnvironment.h" -#endif - #include "KX_BlenderSceneConverter.h" #include "KX_BlenderScalarInterpolator.h" #include "BL_BlenderDataConversion.h" @@ -145,10 +136,6 @@ KX_BlenderSceneConverter::~KX_BlenderSceneConverter() delete (*itm).second; itm++; } - -#ifdef USE_SUMO_SOLID - KX_ClearSumoSharedShapes(); -#endif #ifdef USE_BULLET KX_ClearBulletSharedShapes(); @@ -331,20 +318,7 @@ void KX_BlenderSceneConverter::ConvertScene(const STR_String& scenename, destinationscene->SetPhysicsEnvironment(ccdPhysEnv); break; } -#endif - -#ifdef USE_SUMO_SOLID - case UseSumo: - destinationscene ->SetPhysicsEnvironment(new SumoPhysicsEnvironment()); - break; -#endif -#ifdef USE_ODE - - case UseODE: - destinationscene ->SetPhysicsEnvironment(new ODEPhysicsEnvironment()); - break; -#endif //USE_ODE - +#endif case UseDynamo: { } diff --git a/source/gameengine/Converter/Makefile b/source/gameengine/Converter/Makefile index abded70f289..ed95aa968c7 100644 --- a/source/gameengine/Converter/Makefile +++ b/source/gameengine/Converter/Makefile @@ -39,8 +39,7 @@ CPPFLAGS += -I$(OPENGL_HEADERS) CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) -CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_SUMO) -I$(NAN_MOTO)/include -CPPFLAGS += -I$(NAN_SOLID)/include +CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_MOTO)/include CPPFLAGS += -I$(NAN_BULLET2)/include CPPFLAGS += -I../../blender diff --git a/source/gameengine/Converter/SConscript b/source/gameengine/Converter/SConscript index 3e0929e605a..05ea01c902a 100644 --- a/source/gameengine/Converter/SConscript +++ b/source/gameengine/Converter/SConscript @@ -21,11 +21,6 @@ incs += ' #source/blender/misc #source/blender/blenloader #source/blender/gpu' incs += ' #source/blender/windowmanager' incs += ' #source/blender/makesrna' -if env['WITH_BF_SOLID']: - incs += ' #source/gameengine/Physics/Sumo #source/gameengine/Physics/Sumo/Fuzzics/include' - incs += ' ' + env['BF_SOLID_INC'] - defs.append('USE_SUMO_SOLID') - incs += ' ' + env['BF_PYTHON_INC'] incs += ' ' + env['BF_BULLET_INC'] diff --git a/source/gameengine/GamePlayer/common/Makefile b/source/gameengine/GamePlayer/common/Makefile index 84b4a4170a9..4a952856739 100644 --- a/source/gameengine/GamePlayer/common/Makefile +++ b/source/gameengine/GamePlayer/common/Makefile @@ -50,8 +50,6 @@ CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include CPPFLAGS += -I$(NAN_FUZZICS)/include CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include -CPPFLAGS += -I$(NAN_SUMO)/include -CPPFLAGS += -I$(NAN_SOLID)/include CPPFLAGS += -I$(NAN_PNG)/include CPPFLAGS += -I$(NAN_ZLIB)/include CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) @@ -69,7 +67,6 @@ CPPFLAGS += -I../../../gameengine/Network/LoopBackNetwork CPPFLAGS += -I../../../gameengine/Rasterizer CPPFLAGS += -I../../../gameengine/SceneGraph CPPFLAGS += -I../../../gameengine/Rasterizer/RAS_OpenGLRasterizer -CPPFLAGS += -I../../../gameengine/Physics/Sumo CPPFLAGS += -I../../../gameengine/Physics/common ############################### diff --git a/source/gameengine/GamePlayer/common/SConscript b/source/gameengine/GamePlayer/common/SConscript index e96b2c5400b..f899385c841 100644 --- a/source/gameengine/GamePlayer/common/SConscript +++ b/source/gameengine/GamePlayer/common/SConscript @@ -59,11 +59,6 @@ incs = ['.', # 'unix/GPU_System.cpp'] # gp_common_env.Append ( CPPPATH = ['unix']) -if env['WITH_BF_SOLID']: - incs.append('#source/gameengine/Physics/Sumo') - incs.append('#source/gameengine/Physics/Sumo/Fuzzics/include') - incs += Split(env['BF_SOLID_INC']) - incs += Split(env['BF_PYTHON_INC']) incs += Split(env['BF_PNG_INC']) incs += Split(env['BF_ZLIB_INC']) diff --git a/source/gameengine/GamePlayer/common/unix/GPU_Engine.cpp b/source/gameengine/GamePlayer/common/unix/GPU_Engine.cpp index a5dec02c753..0ef087efbfe 100644 --- a/source/gameengine/GamePlayer/common/unix/GPU_Engine.cpp +++ b/source/gameengine/GamePlayer/common/unix/GPU_Engine.cpp @@ -44,9 +44,6 @@ #include "NG_LoopBackNetworkDeviceInterface.h" #include "SND_DeviceManager.h" #include "KX_BlenderSceneConverter.h" -#ifdef USE_SUMO_SOLID - #include "SM_Scene.h" -#endif #include "KX_KetsjiEngine.h" #include "GPC_RenderTools.h" diff --git a/source/gameengine/GamePlayer/common/unix/Makefile b/source/gameengine/GamePlayer/common/unix/Makefile index 90342c7b735..08c52ddc904 100644 --- a/source/gameengine/GamePlayer/common/unix/Makefile +++ b/source/gameengine/GamePlayer/common/unix/Makefile @@ -57,10 +57,8 @@ CPPFLAGS += -I../../../../gameengine/Rasterizer/RAS_OpenGLRasterizer CPPFLAGS += -I../../../../gameengine/SceneGraph CPPFLAGS += -I$(NAN_FUZZICS)/include -CPPFLAGS += -I$(NAN_SUMO)/include CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include CPPFLAGS += -I$(NAN_MOTO)/include -CPPFLAGS += -I$(NAN_SOLID)/include # Blender stuff CPPFLAGS += -I../../../../blender/blenkernel diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript index 390b6f5e089..19234cb663c 100644 --- a/source/gameengine/GamePlayer/ghost/SConscript +++ b/source/gameengine/GamePlayer/ghost/SConscript @@ -41,10 +41,6 @@ incs = ['.', '#source/blender/gpu', '#extern/glew/include'] -if env['WITH_BF_SOLID']: - incs.append(['#source/gameengine/Physics/Sumo', '#source/gameengine/Physics/Sumo/Fuzzics/include']) - incs += Split(env['BF_SOLID_INC']) - incs += Split(env['BF_PYTHON_INC']) cxxflags = [] diff --git a/source/gameengine/Ketsji/KX_ClientObjectInfo.h b/source/gameengine/Ketsji/KX_ClientObjectInfo.h index 077ac96f0ac..1898dc71ef8 100644 --- a/source/gameengine/Ketsji/KX_ClientObjectInfo.h +++ b/source/gameengine/Ketsji/KX_ClientObjectInfo.h @@ -30,9 +30,6 @@ #define __KX_CLIENTOBJECT_INFO_H /* Note, the way this works with/without sumo is a bit odd */ -#ifdef USE_SUMO_SOLID -#include -#endif //USE_SUMO_SOLID #include @@ -42,9 +39,6 @@ class KX_GameObject; * Client Type and Additional Info. This structure can be use instead of a bare void* pointer, for safeness, and additional info for callbacks */ struct KX_ClientObjectInfo -#ifdef USE_SUMO_SOLID - : public SM_ClientObject -#endif { enum clienttype { STATIC, @@ -59,18 +53,12 @@ struct KX_ClientObjectInfo std::list m_sensors; public: KX_ClientObjectInfo(KX_GameObject *gameobject, clienttype type = STATIC, void *auxilary_info = NULL) : -#ifdef USE_SUMO_SOLID - SM_ClientObject(), -#endif m_type(type), m_gameobject(gameobject), m_auxilary_info(auxilary_info) {} KX_ClientObjectInfo(const KX_ClientObjectInfo ©) : -#ifdef USE_SUMO_SOLID - SM_ClientObject(copy), -#endif m_type(copy.m_type), m_gameobject(copy.m_gameobject), m_auxilary_info(copy.m_auxilary_info) diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h b/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h index 74042366bae..9d3b9cdaf74 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h @@ -32,11 +32,8 @@ /* These are defined by the build system... */ //but the build system is broken, because it doesn't allow for 2 or more defines at once. //Please leave Sumo _AND_ Bullet enabled -//#define USE_SUMO_SOLID // scons defines this #define USE_BULLET -//#define USE_ODE - //on visual studio 7/8, always enable BULLET for now //you can have multiple physics engines running anyway, and //the scons build system doesn't really support this at the moment. @@ -148,20 +145,6 @@ struct KX_ObjectProperties } m_boundobject; }; -#ifdef USE_ODE - - -void KX_ConvertODEEngineObject(KX_GameObject* gameobj, - RAS_MeshObject* meshobj, - KX_Scene* kxscene, - struct PHY_ShapeProps* shapeprops, - struct PHY_MaterialProps* smmaterial, - struct KX_ObjectProperties* objprop); - - -#endif //USE_ODE - - void KX_ConvertDynamoObject(KX_GameObject* gameobj, RAS_MeshObject* meshobj, KX_Scene* kxscene, @@ -169,19 +152,6 @@ void KX_ConvertDynamoObject(KX_GameObject* gameobj, struct PHY_MaterialProps* smmaterial, struct KX_ObjectProperties* objprop); -#ifdef USE_SUMO_SOLID - -void KX_ConvertSumoObject( class KX_GameObject* gameobj, - class RAS_MeshObject* meshobj, - class KX_Scene* kxscene, - struct PHY_ShapeProps* shapeprops, - struct PHY_MaterialProps* smmaterial, - struct KX_ObjectProperties* objprop); - -void KX_ClearSumoSharedShapes(); -bool KX_ReInstanceShapeFromMesh(RAS_MeshObject* meshobj); - -#endif #ifdef USE_BULLET diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index 51c41c0686d..64b5760de28 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -32,7 +32,6 @@ #include "MT_assert.h" -// defines USE_ODE to choose physics engine #include "KX_ConvertPhysicsObject.h" #include "BL_DeformableGameObject.h" #include "RAS_MeshObject.h" @@ -56,597 +55,6 @@ extern "C"{ #include "BKE_DerivedMesh.h" } -#ifdef USE_ODE - -#include "KX_OdePhysicsController.h" -#include "OdePhysicsEnvironment.h" -#endif //USE_ODE - - -// USE_SUMO_SOLID is defined in headerfile KX_ConvertPhysicsObject.h -#ifdef USE_SUMO_SOLID - - -#include "SumoPhysicsEnvironment.h" -#include "KX_SumoPhysicsController.h" - - -// sumo physics specific -#include "SM_Object.h" -#include "SM_FhObject.h" -#include "SM_Scene.h" -#include "SM_ClientObjectInfo.h" - -#include "KX_SumoPhysicsController.h" - -struct KX_PhysicsInstance -{ - DT_VertexBaseHandle m_vertexbase; - RAS_DisplayArray* m_darray; - RAS_IPolyMaterial* m_material; - - KX_PhysicsInstance(DT_VertexBaseHandle vertex_base, RAS_DisplayArray *darray, RAS_IPolyMaterial* mat) - : m_vertexbase(vertex_base), - m_darray(darray), - m_material(mat) - { - } - - ~KX_PhysicsInstance() - { - DT_DeleteVertexBase(m_vertexbase); - } -}; - -static GEN_Map map_gamemesh_to_sumoshape; -static GEN_Map map_gamemesh_to_instance; - -// forward declarations -static void BL_RegisterSumoObject(KX_GameObject* gameobj,class SM_Scene* sumoScene,class SM_Object* sumoObj,const STR_String& matname,bool isDynamic,bool isActor); -static DT_ShapeHandle CreateShapeFromMesh(RAS_MeshObject* meshobj, bool polytope); - -void KX_ConvertSumoObject( KX_GameObject* gameobj, - RAS_MeshObject* meshobj, - KX_Scene* kxscene, - PHY_ShapeProps* kxshapeprops, - PHY_MaterialProps* kxmaterial, - struct KX_ObjectProperties* objprop) - - -{ - SM_ShapeProps* smprop = new SM_ShapeProps; - - smprop->m_ang_drag = kxshapeprops->m_ang_drag; - smprop->m_do_anisotropic = kxshapeprops->m_do_anisotropic; - smprop->m_do_fh = kxshapeprops->m_do_fh; - smprop->m_do_rot_fh = kxshapeprops->m_do_rot_fh ; - smprop->m_friction_scaling[0] = kxshapeprops->m_friction_scaling[0]; - smprop->m_friction_scaling[1] = kxshapeprops->m_friction_scaling[1]; - smprop->m_friction_scaling[2] = kxshapeprops->m_friction_scaling[2]; - smprop->m_inertia = MT_Vector3(1., 1., 1.) * kxshapeprops->m_inertia; - smprop->m_lin_drag = kxshapeprops->m_lin_drag; - smprop->m_mass = kxshapeprops->m_mass; - smprop->m_radius = objprop->m_radius; - - - SM_MaterialProps* smmaterial = new SM_MaterialProps; - - smmaterial->m_fh_damping = kxmaterial->m_fh_damping; - smmaterial->m_fh_distance = kxmaterial->m_fh_distance; - smmaterial->m_fh_normal = kxmaterial->m_fh_normal; - smmaterial->m_fh_spring = kxmaterial->m_fh_spring; - smmaterial->m_friction = kxmaterial->m_friction; - smmaterial->m_restitution = kxmaterial->m_restitution; - - SumoPhysicsEnvironment* sumoEnv = - (SumoPhysicsEnvironment*)kxscene->GetPhysicsEnvironment(); - - SM_Scene* sceneptr = sumoEnv->GetSumoScene(); - - SM_Object* sumoObj=NULL; - - if (objprop->m_dyna && objprop->m_isactor) - { - DT_ShapeHandle shape = NULL; - bool polytope = false; - switch (objprop->m_boundclass) - { - case KX_BOUNDBOX: - shape = DT_NewBox(objprop->m_boundobject.box.m_extends[0], - objprop->m_boundobject.box.m_extends[1], - objprop->m_boundobject.box.m_extends[2]); - smprop->m_inertia.scale(objprop->m_boundobject.box.m_extends[0]*objprop->m_boundobject.box.m_extends[0], - objprop->m_boundobject.box.m_extends[1]*objprop->m_boundobject.box.m_extends[1], - objprop->m_boundobject.box.m_extends[2]*objprop->m_boundobject.box.m_extends[2]); - smprop->m_inertia *= smprop->m_mass/MT_Vector3(objprop->m_boundobject.box.m_extends).length(); - break; - case KX_BOUNDCYLINDER: - shape = DT_NewCylinder(smprop->m_radius, objprop->m_boundobject.c.m_height); - smprop->m_inertia.scale(smprop->m_mass*smprop->m_radius*smprop->m_radius, - smprop->m_mass*smprop->m_radius*smprop->m_radius, - smprop->m_mass*objprop->m_boundobject.c.m_height*objprop->m_boundobject.c.m_height); - break; - case KX_BOUNDCONE: - shape = DT_NewCone(objprop->m_radius, objprop->m_boundobject.c.m_height); - smprop->m_inertia.scale(smprop->m_mass*smprop->m_radius*smprop->m_radius, - smprop->m_mass*smprop->m_radius*smprop->m_radius, - smprop->m_mass*objprop->m_boundobject.c.m_height*objprop->m_boundobject.c.m_height); - break; - /* Dynamic mesh objects. WARNING! slow. */ - case KX_BOUNDPOLYTOPE: - polytope = true; - // fall through - case KX_BOUNDMESH: - if (meshobj && meshobj->NumPolygons() > 0) - { - if ((shape = CreateShapeFromMesh(meshobj, polytope))) - { - // TODO: calculate proper inertia - smprop->m_inertia *= smprop->m_mass*smprop->m_radius*smprop->m_radius; - break; - } - } - /* If CreateShapeFromMesh fails, fall through and use sphere */ - default: - case KX_BOUNDSPHERE: - shape = DT_NewSphere(objprop->m_radius); - smprop->m_inertia *= smprop->m_mass*smprop->m_radius*smprop->m_radius; - break; - - } - - sumoObj = new SM_Object(shape, !objprop->m_ghost?smmaterial:NULL,smprop,NULL); - - sumoObj->setRigidBody(objprop->m_angular_rigidbody?true:false); - - BL_RegisterSumoObject(gameobj,sceneptr,sumoObj,"",true, true); - - } - else { - // non physics object - if (meshobj) - { - int numpolys = meshobj->NumPolygons(); - { - - DT_ShapeHandle complexshape=0; - bool polytope = false; - - switch (objprop->m_boundclass) - { - case KX_BOUNDBOX: - complexshape = DT_NewBox(objprop->m_boundobject.box.m_extends[0], objprop->m_boundobject.box.m_extends[1], objprop->m_boundobject.box.m_extends[2]); - break; - case KX_BOUNDSPHERE: - complexshape = DT_NewSphere(objprop->m_boundobject.c.m_radius); - break; - case KX_BOUNDCYLINDER: - complexshape = DT_NewCylinder(objprop->m_boundobject.c.m_radius, objprop->m_boundobject.c.m_height); - break; - case KX_BOUNDCONE: - complexshape = DT_NewCone(objprop->m_boundobject.c.m_radius, objprop->m_boundobject.c.m_height); - break; - case KX_BOUNDPOLYTOPE: - polytope = true; - // fall through - default: - case KX_BOUNDMESH: - if (numpolys>0) - { - complexshape = CreateShapeFromMesh(meshobj, polytope); - //std::cout << "Convert Physics Mesh: " << meshobj->GetName() << std::endl; -/* if (!complexshape) - { - // Something has to be done here - if the object has no polygons, it will not be able to have - // sensors attached to it. - DT_Vector3 pt = {0., 0., 0.}; - complexshape = DT_NewSphere(1.0); - objprop->m_ghost = evilObject = true; - } */ - } - break; - } - - if (complexshape) - { - SM_Object *dynamicParent = NULL; - - if (objprop->m_dynamic_parent) - { - // problem is how to find the dynamic parent - // in the scenegraph - KX_SumoPhysicsController* sumoctrl = - (KX_SumoPhysicsController*) - objprop->m_dynamic_parent->GetPhysicsController(); - - if (sumoctrl) - { - dynamicParent = sumoctrl->GetSumoObject(); - } - - MT_assert(dynamicParent); - } - - - sumoObj = new SM_Object(complexshape,!objprop->m_ghost?smmaterial:NULL,NULL, dynamicParent); - const STR_String& matname=meshobj->GetMaterialName(0); - - - BL_RegisterSumoObject(gameobj,sceneptr, - sumoObj, - matname, - objprop->m_dyna, - objprop->m_isactor); - } - } - } - } - - // physics object get updated here ! - - - // lazy evaluation because we might not support scaling !gameobj->UpdateTransform(); - - if (objprop->m_in_active_layer && sumoObj) - { - sceneptr->add(*sumoObj); - } - -} - - - -static void BL_RegisterSumoObject( - KX_GameObject* gameobj, - class SM_Scene* sumoScene, - class SM_Object* sumoObj, - const STR_String& matname, - bool isDynamic, - bool isActor) -{ - PHY_IMotionState* motionstate = new KX_MotionState(gameobj->GetSGNode()); - - // need easy access, not via 'node' etc. - KX_SumoPhysicsController* physicscontroller = new KX_SumoPhysicsController(sumoScene,sumoObj,motionstate,isDynamic); - gameobj->SetPhysicsController(physicscontroller,isDynamic); - - - if (!gameobj->getClientInfo()) - std::cout << "BL_RegisterSumoObject: WARNING: Object " << gameobj->GetName() << " has no client info" << std::endl; - physicscontroller->setNewClientInfo(gameobj->getClientInfo()); - - - gameobj->GetSGNode()->AddSGController(physicscontroller); - - gameobj->getClientInfo()->m_type = (isActor ? KX_ClientObjectInfo::ACTOR : KX_ClientObjectInfo::STATIC); - - // store materialname in auxinfo, needed for touchsensors - gameobj->getClientInfo()->m_auxilary_info = (matname.Length() ? (void*)(matname.ReadPtr()+2) : NULL); - - physicscontroller->SetObject(gameobj->GetSGNode()); -} - -static DT_ShapeHandle InstancePhysicsComplex(RAS_MeshObject* meshobj, RAS_DisplayArray *darray, RAS_IPolyMaterial *mat) -{ - // instance a mesh from a single vertex array & material - const RAS_TexVert *vertex_array = &darray->m_vertex[0]; - DT_VertexBaseHandle vertex_base = DT_NewVertexBase(vertex_array[0].getXYZ(), sizeof(RAS_TexVert)); - - DT_ShapeHandle shape = DT_NewComplexShape(vertex_base); - - std::vector indices; - for (int p = 0; p < meshobj->NumPolygons(); p++) - { - RAS_Polygon* poly = meshobj->GetPolygon(p); - - // only add polygons that have the collisionflag set - if (poly->IsCollider()) - { - DT_Begin(); - DT_VertexIndex(poly->GetVertexOffset(0)); - DT_VertexIndex(poly->GetVertexOffset(1)); - DT_VertexIndex(poly->GetVertexOffset(2)); - DT_End(); - - // tesselate - if (poly->VertexCount() == 4) - { - DT_Begin(); - DT_VertexIndex(poly->GetVertexOffset(0)); - DT_VertexIndex(poly->GetVertexOffset(2)); - DT_VertexIndex(poly->GetVertexOffset(3)); - DT_End(); - } - } - } - - //DT_VertexIndices(indices.size(), &indices[0]); - DT_EndComplexShape(); - - map_gamemesh_to_instance.insert(GEN_HashedPtr(meshobj), new KX_PhysicsInstance(vertex_base, darray, mat)); - return shape; -} - -static DT_ShapeHandle InstancePhysicsPolytope(RAS_MeshObject* meshobj, RAS_DisplayArray *darray, RAS_IPolyMaterial *mat) -{ - // instance a mesh from a single vertex array & material - const RAS_TexVert *vertex_array = &darray->m_vertex[0]; - DT_VertexBaseHandle vertex_base = DT_NewVertexBase(vertex_array[0].getXYZ(), sizeof(RAS_TexVert)); - - std::vector indices; - for (int p = 0; p < meshobj->NumPolygons(); p++) - { - RAS_Polygon* poly = meshobj->GetPolygon(p); - - // only add polygons that have the collisionflag set - if (poly->IsCollider()) - { - indices.push_back(poly->GetVertexOffset(0)); - indices.push_back(poly->GetVertexOffset(1)); - indices.push_back(poly->GetVertexOffset(2)); - - if (poly->VertexCount() == 4) - indices.push_back(poly->GetVertexOffset(3)); - } - } - - DT_ShapeHandle shape = DT_NewPolytope(vertex_base); - DT_VertexIndices(indices.size(), &indices[0]); - DT_EndPolytope(); - - map_gamemesh_to_instance.insert(GEN_HashedPtr(meshobj), new KX_PhysicsInstance(vertex_base, darray, mat)); - return shape; -} - -// This will have to be a method in a class somewhere... -// Update SOLID with a changed physics mesh. -// not used... yet. -bool KX_ReInstanceShapeFromMesh(RAS_MeshObject* meshobj) -{ - KX_PhysicsInstance *instance = *map_gamemesh_to_instance[GEN_HashedPtr(meshobj)]; - if (instance) - { - const RAS_TexVert *vertex_array = &instance->m_darray->m_vertex[0]; - DT_ChangeVertexBase(instance->m_vertexbase, vertex_array[0].getXYZ()); - return true; - } - return false; -} - -static DT_ShapeHandle CreateShapeFromMesh(RAS_MeshObject* meshobj, bool polytope) -{ - - DT_ShapeHandle *shapeptr = map_gamemesh_to_sumoshape[GEN_HashedPtr(meshobj)]; - // Mesh has already been converted: reuse - if (shapeptr) - { - return *shapeptr; - } - - // Mesh has no polygons! - int numpolys = meshobj->NumPolygons(); - if (!numpolys) - { - return NULL; - } - - // Count the number of collision polygons and check they all come from the same - // vertex array - int numvalidpolys = 0; - RAS_DisplayArray *darray = NULL; - RAS_IPolyMaterial *poly_material = NULL; - bool reinstance = true; - - for (int p=0; pGetPolygon(p); - - // only add polygons that have the collisionflag set - if (poly->IsCollider()) - { - // check polygon is from the same vertex array - if (poly->GetDisplayArray() != darray) - { - if (darray == NULL) - darray = poly->GetDisplayArray(); - else - { - reinstance = false; - darray = NULL; - } - } - - // check poly is from the same material - if (poly->GetMaterial()->GetPolyMaterial() != poly_material) - { - if (poly_material) - { - reinstance = false; - poly_material = NULL; - } - else - poly_material = poly->GetMaterial()->GetPolyMaterial(); - } - - // count the number of collision polys - numvalidpolys++; - - // We have one collision poly, and we can't reinstance, so we - // might as well break here. - if (!reinstance) - break; - } - } - - // No collision polygons - if (numvalidpolys < 1) - return NULL; - - DT_ShapeHandle shape; - if (reinstance) - { - if (polytope) - shape = InstancePhysicsPolytope(meshobj, darray, poly_material); - else - shape = InstancePhysicsComplex(meshobj, darray, poly_material); - } - else - { - if (polytope) - { - std::cout << "CreateShapeFromMesh: " << meshobj->GetName() << " is not suitable for polytope." << std::endl; - if (!poly_material) - std::cout << " Check mesh materials." << std::endl; - if (darray == NULL) - std::cout << " Check number of vertices." << std::endl; - } - - shape = DT_NewComplexShape(NULL); - - numvalidpolys = 0; - - for (int p2=0; p2GetPolygon(p2); - - // only add polygons that have the collisionflag set - if (poly->IsCollider()) - { /* We have to tesselate here because SOLID can only raycast triangles */ - DT_Begin(); - /* V1, V2, V3 */ - DT_Vertex(poly->GetVertex(2)->getXYZ()); - DT_Vertex(poly->GetVertex(1)->getXYZ()); - DT_Vertex(poly->GetVertex(0)->getXYZ()); - - numvalidpolys++; - DT_End(); - - if (poly->VertexCount() == 4) - { - DT_Begin(); - /* V1, V3, V4 */ - DT_Vertex(poly->GetVertex(3)->getXYZ()); - DT_Vertex(poly->GetVertex(2)->getXYZ()); - DT_Vertex(poly->GetVertex(0)->getXYZ()); - - numvalidpolys++; - DT_End(); - } - - } - } - - DT_EndComplexShape(); - } - - if (numvalidpolys > 0) - { - map_gamemesh_to_sumoshape.insert(GEN_HashedPtr(meshobj),shape); - return shape; - } - - delete shape; - return NULL; -} - -void KX_ClearSumoSharedShapes() -{ - int numshapes = map_gamemesh_to_sumoshape.size(); - int i; - for (i=0;im_dyna; - bool fullRigidBody= ( objprop->m_dyna && objprop->m_angular_rigidbody) != 0; - bool phantom = objprop->m_ghost; - class PHY_IMotionState* motionstate = new KX_MotionState(gameobj->GetSGNode()); - - class ODEPhysicsEnvironment* odeEnv = - (ODEPhysicsEnvironment*)kxscene->GetPhysicsEnvironment(); - - dxSpace* space = odeEnv->GetOdeSpace(); - dxWorld* world = odeEnv->GetOdeWorld(); - - bool isSphere = false; - - switch (objprop->m_boundclass) - { - case KX_BOUNDBOX: - { - - KX_OdePhysicsController* physicscontroller = - new KX_OdePhysicsController( - dyna, - fullRigidBody, - phantom, - motionstate, - space, - world, - shapeprops->m_mass, - smmaterial->m_friction, - smmaterial->m_restitution, - isSphere, - objprop->m_boundobject.box.m_center, - objprop->m_boundobject.box.m_extends, - objprop->m_boundobject.c.m_radius - ); - - gameobj->SetPhysicsController(physicscontroller); - physicscontroller->setNewClientInfo(gameobj->getClientInfo()); - gameobj->GetSGNode()->AddSGController(physicscontroller); - - bool isActor = objprop->m_isactor; - STR_String materialname; - if (meshobj) - materialname = meshobj->GetMaterialName(0); - - const char* matname = materialname.ReadPtr(); - - - physicscontroller->SetObject(gameobj->GetSGNode()); - - break; - } - default: - { - } - }; - -} - - -#endif // USE_ODE - - #ifdef USE_BULLET #include "CcdPhysicsEnvironment.h" diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index a43ea59220b..1a417110c08 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -61,10 +61,6 @@ #include "KX_PyConstraintBinding.h" #include "PHY_IPhysicsEnvironment.h" -#ifdef USE_SUMO_SOLID -#include "SumoPhysicsEnvironment.h" -#endif - #include "SND_Scene.h" #include "SND_IAudioDevice.h" diff --git a/source/gameengine/Ketsji/KX_OdePhysicsController.cpp b/source/gameengine/Ketsji/KX_OdePhysicsController.cpp deleted file mode 100644 index dc6990267d4..00000000000 --- a/source/gameengine/Ketsji/KX_OdePhysicsController.cpp +++ /dev/null @@ -1,257 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * The contents of this file may be used under the terms of either the GNU - * General Public License Version 2 or later (the "GPL", see - * http://www.gnu.org/licenses/gpl.html ), or the Blender License 1.0 or - * later (the "BL", see http://www.blender.org/BL/ ) which has to be - * bought from the Blender Foundation to become active, in which case the - * above mentioned GPL option does not apply. - * - * The Original Code is Copyright (C) 2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#include "KX_ConvertPhysicsObject.h" - -#ifdef USE_ODE - -#include "KX_OdePhysicsController.h" -#include "KX_GameObject.h" -#include "KX_MotionState.h" - -#include "MT_assert.h" - -#include "PHY_IPhysicsEnvironment.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -KX_OdePhysicsController::KX_OdePhysicsController( - bool dyna, - bool fullRigidBody, - bool phantom, - class PHY_IMotionState* motionstate, - struct dxSpace* space, - struct dxWorld* world, - float mass, - float friction, - float restitution, - bool implicitsphere, - float center[3], - float extends[3], - float radius - ) -: KX_IPhysicsController(dyna,false,(PHY_IPhysicsController*)this), -ODEPhysicsController( -dyna,fullRigidBody,phantom,motionstate, -space,world,mass,friction,restitution, -implicitsphere,center,extends,radius) -{ -}; - - -bool KX_OdePhysicsController::Update(double time) -{ - return SynchronizeMotionStates(time); -} - -void KX_OdePhysicsController::SetObject (SG_IObject* object) -{ - SG_Controller::SetObject(object); - - // cheating here... - KX_GameObject* gameobj = (KX_GameObject*) object->GetSGClientObject(); - gameobj->SetPhysicsController(this); - -} - - - -void KX_OdePhysicsController::applyImpulse(const MT_Point3& attach, const MT_Vector3& impulse) -{ - ODEPhysicsController::applyImpulse(attach[0],attach[1],attach[2],impulse[0],impulse[1],impulse[2]); -} - - - -void KX_OdePhysicsController::RelativeTranslate(const MT_Vector3& dloc,bool local) -{ - ODEPhysicsController::RelativeTranslate(dloc[0],dloc[1],dloc[2],local); - -} -void KX_OdePhysicsController::RelativeRotate(const MT_Matrix3x3& drot,bool local) -{ - double oldmat[12]; - drot.getValue(oldmat); - float newmat[9]; - float *m = &newmat[0]; - double *orgm = &oldmat[0]; - - *m++ = *orgm++;*m++ = *orgm++;*m++ = *orgm++;orgm++; - *m++ = *orgm++;*m++ = *orgm++;*m++ = *orgm++;orgm++; - *m++ = *orgm++;*m++ = *orgm++;*m++ = *orgm++;orgm++; - - ODEPhysicsController::RelativeRotate(newmat,local); - -} - -void KX_OdePhysicsController::ApplyTorque(const MT_Vector3& torque,bool local) -{ - ODEPhysicsController::ApplyTorque(torque[0],torque[1],torque[2],local); - -} -void KX_OdePhysicsController::ApplyForce(const MT_Vector3& force,bool local) -{ - ODEPhysicsController::ApplyForce(force[0],force[1],force[2],local); - -} -MT_Vector3 KX_OdePhysicsController::GetLinearVelocity() -{ - return MT_Vector3(0,0,0); -} - -MT_Vector3 KX_OdePhysicsController::GetVelocity(const MT_Point3& pos) -{ - return MT_Vector3(0,0,0); -} - -void KX_OdePhysicsController::SetAngularVelocity(const MT_Vector3& ang_vel,bool local) -{ - -} -void KX_OdePhysicsController::SetLinearVelocity(const MT_Vector3& lin_vel,bool local) -{ - ODEPhysicsController::SetLinearVelocity(lin_vel[0],lin_vel[1],lin_vel[2],local); -} - -void KX_OdePhysicsController::setOrientation(const MT_Matrix3x3& rot) -{ - MT_Quaternion orn = rot.getRotation(); - ODEPhysicsController::setOrientation(orn[0],orn[1],orn[2],orn[3]); -} - -void KX_OdePhysicsController::getOrientation(MT_Quaternion& orn) -{ - float florn[4]; - florn[0]=orn[0]; - florn[1]=orn[1]; - florn[2]=orn[2]; - florn[3]=orn[3]; - ODEPhysicsController::getOrientation(florn[0],florn[1],florn[2],florn[3]); - orn[0] = florn[0]; - orn[1] = florn[1]; - orn[2] = florn[2]; - orn[3] = florn[3]; - - -} - -void KX_OdePhysicsController::setPosition(const MT_Point3& pos) -{ - ODEPhysicsController::setPosition(pos[0],pos[1],pos[2]); -} - -void KX_OdePhysicsController::setScaling(const MT_Vector3& scaling) -{ -} - -MT_Scalar KX_OdePhysicsController::GetMass() -{ - return ODEPhysicsController::getMass(); -} - -MT_Scalar KX_OdePhysicsController::GetRadius() -{ - return MT_Scalar(0.f); -} - -MT_Vector3 KX_OdePhysicsController::getReactionForce() -{ - return MT_Vector3(0,0,0); -} -void KX_OdePhysicsController::setRigidBody(bool rigid) -{ - -} - -void KX_OdePhysicsController::SuspendDynamics(bool) -{ - ODEPhysicsController::SuspendDynamics(); -} -void KX_OdePhysicsController::RestoreDynamics() -{ - ODEPhysicsController::RestoreDynamics(); -} - - -SG_Controller* KX_OdePhysicsController::GetReplica(class SG_Node* destnode) -{ - PHY_IMotionState* motionstate = new KX_MotionState(destnode); - KX_OdePhysicsController* copyctrl = new KX_OdePhysicsController(*this); - - // nlin: copied from KX_SumoPhysicsController.cpp. Not 100% sure what this does.... - // furthermore, the parentctrl is not used in ODEPhysicsController::PostProcessReplica, but - // maybe it can/should be used in the future... - - // begin copy block ------------------------------------------------------------------ - - //parentcontroller is here be able to avoid collisions between parent/child - - PHY_IPhysicsController* parentctrl = NULL; - - if (destnode != destnode->GetRootSGParent()) - { - KX_GameObject* clientgameobj = (KX_GameObject*) destnode->GetRootSGParent()->GetSGClientObject(); - if (clientgameobj) - { - parentctrl = (KX_OdePhysicsController*)clientgameobj->GetPhysicsController(); - } else - { - // it could be a false node, try the children - NodeList::const_iterator childit; - for ( - childit = destnode->GetSGChildren().begin(); - childit!= destnode->GetSGChildren().end(); - ++childit - ) { - KX_GameObject* clientgameobj = static_cast( (*childit)->GetSGClientObject()); - if (clientgameobj) - { - parentctrl = (KX_OdePhysicsController*)clientgameobj->GetPhysicsController(); - } - } - } - } - // end copy block ------------------------------------------------------------------ - - copyctrl->PostProcessReplica(motionstate, this); - - return copyctrl; - -} - -void KX_OdePhysicsController::resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ) -{ -} - - -void KX_OdePhysicsController::SetSumoTransform(bool nondynaonly) -{ - -} - // todo: remove next line ! -void KX_OdePhysicsController::SetSimulatedTime(double time) -{ - -} - -#endif //USE_ODE diff --git a/source/gameengine/Ketsji/KX_OdePhysicsController.h b/source/gameengine/Ketsji/KX_OdePhysicsController.h deleted file mode 100644 index 8c3974c38a3..00000000000 --- a/source/gameengine/Ketsji/KX_OdePhysicsController.h +++ /dev/null @@ -1,109 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * The contents of this file may be used under the terms of either the GNU - * General Public License Version 2 or later (the "GPL", see - * http://www.gnu.org/licenses/gpl.html ), or the Blender License 1.0 or - * later (the "BL", see http://www.blender.org/BL/ ) which has to be - * bought from the Blender Foundation to become active, in which case the - * above mentioned GPL option does not apply. - * - * The Original Code is Copyright (C) 2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#ifndef __KX_ODEPHYSICSCONTROLLER_H -#define __KX_ODEPHYSICSCONTROLLER_H - -#include "KX_IPhysicsController.h" -#include "OdePhysicsController.h" - -/** - Physics Controller, a special kind of Scene Graph Transformation Controller. - It get's callbacks from Physics in case a transformation change took place. - Each time the scene graph get's updated, the controller get's a chance - in the 'Update' method to reflect changed. -*/ - -class KX_OdePhysicsController : public KX_IPhysicsController, public ODEPhysicsController - -{ - -public: - KX_OdePhysicsController( - bool dyna, - bool fullRigidBody, - bool phantom, - class PHY_IMotionState* motionstate, - struct dxSpace* space, - struct dxWorld* world, - float mass, - float friction, - float restitution, - bool implicitsphere, - float center[3], - float extends[3], - float radius); - - virtual ~KX_OdePhysicsController() {}; - - virtual void applyImpulse(const MT_Point3& attach, const MT_Vector3& impulse); - virtual void SetObject (SG_IObject* object); - - virtual void RelativeTranslate(const MT_Vector3& dloc,bool local); - virtual void RelativeRotate(const MT_Matrix3x3& drot,bool local); - virtual void ApplyTorque(const MT_Vector3& torque,bool local); - virtual void ApplyForce(const MT_Vector3& force,bool local); - virtual MT_Vector3 GetLinearVelocity(); - virtual MT_Vector3 GetVelocity(const MT_Point3& pos); - virtual void SetAngularVelocity(const MT_Vector3& ang_vel,bool local); - virtual void SetLinearVelocity(const MT_Vector3& lin_vel,bool local); - virtual void resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ); - virtual void getOrientation(MT_Quaternion& orn); - virtual void setOrientation(const MT_Matrix3x3& orn); - virtual void setPosition(const MT_Point3& pos); - virtual void setScaling(const MT_Vector3& scaling); - virtual void SetTransform() {} - virtual MT_Scalar GetMass(); - virtual MT_Vector3 getReactionForce(); - virtual void setRigidBody(bool rigid); - virtual void AddCompoundChild(KX_IPhysicsController* child) { } - virtual void RemoveCompoundChild(KX_IPhysicsController* child) { } - - virtual void SuspendDynamics(bool); - virtual void RestoreDynamics(); - virtual MT_Scalar GetRadius(); - - virtual SG_Controller* GetReplica(class SG_Node* destnode); - - virtual float GetLinVelocityMin() { return ODEPhysicsController::GetLinVelocityMin(); } - virtual void SetLinVelocityMin(float val) { ODEPhysicsController::SetLinVelocityMin(val); } - virtual float GetLinVelocityMax() { return ODEPhysicsController::GetLinVelocityMax(); } - virtual void SetLinVelocityMax(float val) { ODEPhysicsController::SetLinVelocityMax(val); } - - virtual void SetSumoTransform(bool nondynaonly); - // todo: remove next line ! - virtual void SetSimulatedTime(double time); - - // call from scene graph to update - virtual bool Update(double time); - - void - SetOption( - int option, - int value - ){ - // intentionally empty - }; - -}; - -#endif //__KX_ODEPHYSICSCONTROLLER_H - diff --git a/source/gameengine/Ketsji/KX_SumoPhysicsController.cpp b/source/gameengine/Ketsji/KX_SumoPhysicsController.cpp deleted file mode 100644 index fc053f05e63..00000000000 --- a/source/gameengine/Ketsji/KX_SumoPhysicsController.cpp +++ /dev/null @@ -1,244 +0,0 @@ -#include "KX_ConvertPhysicsObject.h" - -#ifdef USE_SUMO_SOLID - -#ifdef WIN32 -#pragma warning (disable : 4786) -#endif - -#include "KX_SumoPhysicsController.h" -#include "SG_Spatial.h" -#include "SM_Scene.h" -#include "KX_GameObject.h" -#include "KX_MotionState.h" -#include "KX_ClientObjectInfo.h" - -#include "PHY_IPhysicsEnvironment.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -void KX_SumoPhysicsController::applyImpulse(const MT_Point3& attach, const MT_Vector3& impulse) -{ - SumoPhysicsController::applyImpulse(attach[0],attach[1],attach[2],impulse[0],impulse[1],impulse[2]); -} -void KX_SumoPhysicsController::RelativeTranslate(const MT_Vector3& dloc,bool local) -{ - SumoPhysicsController::RelativeTranslate(dloc[0],dloc[1],dloc[2],local); - -} -void KX_SumoPhysicsController::RelativeRotate(const MT_Matrix3x3& drot,bool local) -{ - float oldmat[12]; - drot.getValue(oldmat); -/* float newmat[9]; - float *m = &newmat[0]; - double *orgm = &oldmat[0]; - - *m++ = *orgm++;*m++ = *orgm++;*m++ = *orgm++;orgm++; - *m++ = *orgm++;*m++ = *orgm++;*m++ = *orgm++;orgm++; - *m++ = *orgm++;*m++ = *orgm++;*m++ = *orgm++;orgm++; */ - - SumoPhysicsController::RelativeRotate(oldmat,local); -} - -void KX_SumoPhysicsController::SetLinearVelocity(const MT_Vector3& lin_vel,bool local) -{ - SumoPhysicsController::SetLinearVelocity(lin_vel[0],lin_vel[1],lin_vel[2],local); - -} - -void KX_SumoPhysicsController::SetAngularVelocity(const MT_Vector3& ang_vel,bool local) -{ - SumoPhysicsController::SetAngularVelocity(ang_vel[0],ang_vel[1],ang_vel[2],local); -} - -MT_Vector3 KX_SumoPhysicsController::GetVelocity(const MT_Point3& pos) -{ - - float linvel[3]; - SumoPhysicsController::GetVelocity(pos[0],pos[1],pos[2],linvel[0],linvel[1],linvel[2]); - - return MT_Vector3 (linvel); -} - -MT_Vector3 KX_SumoPhysicsController::GetLinearVelocity() -{ - return GetVelocity(MT_Point3(0,0,0)); - -} - -void KX_SumoPhysicsController::resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ) -{ - SumoPhysicsController::resolveCombinedVelocities(linvelX,linvelY,linvelZ,angVelX,angVelY,angVelZ); -} - -void KX_SumoPhysicsController::ApplyTorque(const MT_Vector3& torque,bool local) -{ - SumoPhysicsController::ApplyTorque(torque[0],torque[1],torque[2],local); - -} - -void KX_SumoPhysicsController::ApplyForce(const MT_Vector3& force,bool local) -{ - SumoPhysicsController::ApplyForce(force[0],force[1],force[2],local); -} - -bool KX_SumoPhysicsController::Update(double time) -{ - return SynchronizeMotionStates(time); -} - -void KX_SumoPhysicsController::SetSimulatedTime(double time) -{ - -} - -void KX_SumoPhysicsController::SetSumoTransform(bool nondynaonly) -{ - SumoPhysicsController::setSumoTransform(nondynaonly); - -} - -void KX_SumoPhysicsController::SuspendDynamics(bool) -{ - SumoPhysicsController::SuspendDynamics(); -} - -void KX_SumoPhysicsController::RestoreDynamics() -{ - SumoPhysicsController::RestoreDynamics(); -} - -SG_Controller* KX_SumoPhysicsController::GetReplica(SG_Node* destnode) -{ - - PHY_IMotionState* motionstate = new KX_MotionState(destnode); - - KX_SumoPhysicsController* physicsreplica = new KX_SumoPhysicsController(*this); - - //parentcontroller is here be able to avoid collisions between parent/child - - PHY_IPhysicsController* parentctrl = NULL; - - if (destnode != destnode->GetRootSGParent()) - { - KX_GameObject* clientgameobj = (KX_GameObject*) destnode->GetRootSGParent()->GetSGClientObject(); - if (clientgameobj) - { - parentctrl = (KX_SumoPhysicsController*)clientgameobj->GetPhysicsController(); - } else - { - // it could be a false node, try the children - NodeList::const_iterator childit; - for ( - childit = destnode->GetSGChildren().begin(); - childit!= destnode->GetSGChildren().end(); - ++childit - ) { - KX_GameObject *clientgameobj = static_cast( (*childit)->GetSGClientObject()); - if (clientgameobj) - { - parentctrl = (KX_SumoPhysicsController*)clientgameobj->GetPhysicsController(); - } - } - } - } - - physicsreplica->PostProcessReplica(motionstate,parentctrl); - - return physicsreplica; -} - - -void KX_SumoPhysicsController::SetObject (SG_IObject* object) -{ - SG_Controller::SetObject(object); - - // cheating here... -//should not be necessary, is it for duplicates ? - -KX_GameObject* gameobj = (KX_GameObject*) object->GetSGClientObject(); -gameobj->SetPhysicsController(this,gameobj->IsDynamic()); -GetSumoObject()->setClientObject(gameobj->getClientInfo()); -} - -void KX_SumoPhysicsController::setMargin(float collisionMargin) -{ - SumoPhysicsController::SetMargin(collisionMargin); -} - - -void KX_SumoPhysicsController::setOrientation(const MT_Matrix3x3& rot) -{ - MT_Quaternion orn = rot.getRotation(); - SumoPhysicsController::setOrientation( - orn[0],orn[1],orn[2],orn[3]); - -} -void KX_SumoPhysicsController::getOrientation(MT_Quaternion& orn) -{ - - float quat[4]; - - SumoPhysicsController::getOrientation(quat[0],quat[1],quat[2],quat[3]); - - orn = MT_Quaternion(quat); - -} - -void KX_SumoPhysicsController::setPosition(const MT_Point3& pos) -{ - SumoPhysicsController::setPosition(pos[0],pos[1],pos[2]); - -} - -void KX_SumoPhysicsController::setScaling(const MT_Vector3& scaling) -{ - SumoPhysicsController::setScaling(scaling[0],scaling[1],scaling[2]); - -} - -MT_Scalar KX_SumoPhysicsController::GetMass() -{ - return SumoPhysicsController::getMass(); -} - -void KX_SumoPhysicsController::SetMass(MT_Scalar newmass) -{ -} - -MT_Vector3 KX_SumoPhysicsController::GetLocalInertia() -{ - return MT_Vector3(0.f, 0.f, 0.f); // \todo -} - -MT_Scalar KX_SumoPhysicsController::GetRadius() -{ - return SumoPhysicsController::GetRadius(); -} - -MT_Vector3 KX_SumoPhysicsController::getReactionForce() -{ - float force[3]; - SumoPhysicsController::getReactionForce(force[0],force[1],force[2]); - return MT_Vector3(force); - -} - -void KX_SumoPhysicsController::setRigidBody(bool rigid) -{ - SumoPhysicsController::setRigidBody(rigid); - -} - - -KX_SumoPhysicsController::~KX_SumoPhysicsController() -{ - - -} - - -#endif//USE_SUMO_SOLID diff --git a/source/gameengine/Ketsji/KX_SumoPhysicsController.h b/source/gameengine/Ketsji/KX_SumoPhysicsController.h deleted file mode 100644 index 278994c6ae7..00000000000 --- a/source/gameengine/Ketsji/KX_SumoPhysicsController.h +++ /dev/null @@ -1,122 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#ifndef __KX_SUMOPHYSICSCONTROLLER_H -#define __KX_SUMOPHYSICSCONTROLLER_H - -#include "PHY_IPhysicsController.h" - -/** - Physics Controller, a special kind of Scene Graph Transformation Controller. - It get's callbacks from Sumo in case a transformation change took place. - Each time the scene graph get's updated, the controller get's a chance - in the 'Update' method to reflect changed. -*/ - -#include "SumoPhysicsController.h" -#include "KX_IPhysicsController.h" - -class KX_SumoPhysicsController : public KX_IPhysicsController, - public SumoPhysicsController - -{ - - -public: - KX_SumoPhysicsController( - class SM_Scene* sumoScene, - class SM_Object* sumoObj, - class PHY_IMotionState* motionstate - ,bool dyna) - : KX_IPhysicsController(dyna,false,false,NULL) , - SumoPhysicsController(sumoScene,/*solidscene,*/sumoObj,motionstate,dyna) - { - }; - virtual ~KX_SumoPhysicsController(); - - void applyImpulse(const MT_Point3& attach, const MT_Vector3& impulse); - virtual void SetObject (SG_IObject* object); - virtual void setMargin (float collisionMargin); - - void RelativeTranslate(const MT_Vector3& dloc,bool local); - void RelativeRotate(const MT_Matrix3x3& drot,bool local); - void ApplyTorque(const MT_Vector3& torque,bool local); - void ApplyForce(const MT_Vector3& force,bool local); - MT_Vector3 GetLinearVelocity(); - MT_Vector3 GetAngularVelocity() // to keep compiler happy - { return MT_Vector3(0.0,0.0,0.0); } - MT_Vector3 GetVelocity(const MT_Point3& pos); - void SetAngularVelocity(const MT_Vector3& ang_vel,bool local); - void SetLinearVelocity(const MT_Vector3& lin_vel,bool local); - void resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ); - - - void SuspendDynamics(bool); - void RestoreDynamics(); - virtual void AddCompoundChild(KX_IPhysicsController* child) { } - virtual void RemoveCompoundChild(KX_IPhysicsController* child) { } - - virtual void getOrientation(MT_Quaternion& orn); - virtual void setOrientation(const MT_Matrix3x3& orn); - virtual void SetTransform() {} - - virtual void setPosition(const MT_Point3& pos); - virtual void setScaling(const MT_Vector3& scaling); - virtual MT_Scalar GetMass(); - virtual void SetMass(MT_Scalar newmass); - virtual MT_Vector3 GetLocalInertia(); - virtual MT_Scalar GetRadius(); - virtual MT_Vector3 getReactionForce(); - virtual void setRigidBody(bool rigid); - - virtual float GetLinVelocityMin() { return SumoPhysicsController::GetLinVelocityMin(); } - virtual void SetLinVelocityMin(float val) { SumoPhysicsController::SetLinVelocityMin(val); } - virtual float GetLinVelocityMax() { return SumoPhysicsController::GetLinVelocityMax(); } - virtual void SetLinVelocityMax(float val) { SumoPhysicsController::SetLinVelocityMax(val); } - - virtual SG_Controller* GetReplica(class SG_Node* destnode); - - - void SetSumoTransform(bool nondynaonly); - // todo: remove next line ! - virtual void SetSimulatedTime(double time); - - // call from scene graph to update - virtual bool Update(double time); - - void - SetOption( - int option, - int value - ){ - // intentionally empty - }; -}; - -#endif //__KX_SUMOPHYSICSCONTROLLER_H - diff --git a/source/gameengine/Ketsji/Makefile b/source/gameengine/Ketsji/Makefile index 59b3ff178fb..f57349b7138 100644 --- a/source/gameengine/Ketsji/Makefile +++ b/source/gameengine/Ketsji/Makefile @@ -44,7 +44,7 @@ CPPFLAGS += -I../../blender/python CPPFLAGS += -I../../blender/python/generic CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include -CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_SUMO) -I$(NAN_MOTO)/include +CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_MOTO)/include CPPFLAGS += -I$(NAN_SOLID)/include CPPFLAGS += -I$(NAN_BULLET2)/include CPPFLAGS += -I../Rasterizer/RAS_OpenGLRasterizer @@ -54,8 +54,6 @@ CPPFLAGS += -I../../kernel/gen_system CPPFLAGS += -I../Network -IKXNetwork CPPFLAGS += -I../Physics/common CPPFLAGS += -I../Physics/Dummy -CPPFLAGS += -I../Physics/Sumo -CPPFLAGS += -I../Physics/BlOde CPPFLAGS += -I../Physics/Bullet CPPFLAGS += -I. CPPFLAGS += -I../Converter diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index 49dbacc8916..b09267b79ff 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -18,16 +18,9 @@ incs += ' #source/blender/blenkernel #source/blender #source/blender/editors/inc incs += ' #source/blender/makesdna #source/blender/python #source/gameengine/Rasterizer' incs += ' #source/gameengine/GameLogic #source/gameengine/Expressions #source/gameengine/Network' incs += ' #source/gameengine/SceneGraph #source/gameengine/Physics/common #source/gameengine/Physics/Bullet' -incs += ' #source/gameengine/Physics/BlOde #source/gameengine/Physics/Dummy' +incs += ' #source/gameengine/Physics/Dummy' incs += ' #source/blender/misc #source/blender/blenloader #extern/glew/include #source/blender/gpu' -if env['WITH_BF_SOLID']: - incs += ' #source/gameengine/Physics/Sumo #source/gameengine/Physics/Sumo/include' - incs += ' #source/gameengine/Physics/Sumo/Fuzzics/include #source/gameengine/Network/LoopBackNetwork' - incs += ' ' + env['BF_SOLID_INC'] - defs += ' USE_SUMO_SOLID' - - incs += ' ' + env['BF_PYTHON_INC'] incs += ' ' + env['BF_BULLET_INC'] incs += ' ' + env['BF_OPENGL_INC'] diff --git a/source/gameengine/Physics/BlOde/Makefile b/source/gameengine/Physics/BlOde/Makefile deleted file mode 100644 index 1fbbf198377..00000000000 --- a/source/gameengine/Physics/BlOde/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -# -# $Id$ -# -# ***** BEGIN GPL 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. -# -# 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. -# -# The Original Code is: all of this file. -# -# Contributor(s): none yet. -# -# ***** END GPL LICENSE BLOCK ***** -# -# - -LIBNAME = blode -DIR = $(OCGDIR)/gameengine/blphys/$(LIBNAME) - -include nan_compile.mk - -CCFLAGS += $(LEVEL_1_CPP_WARNINGS) - -CPPFLAGS += -I$(OPENGL_HEADERS) -CPPFLAGS += -I$(NAN_STRING)/include -CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) - -CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_SUMO)/include -I$(NAN_MOTO)/include -CPPFLAGS += -I$(NAN_ODE)/include -CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include -CPPFLAGS += -I../../Physics/common -CPPFLAGS += -I../../Physics/Dummy -# nlin: fix this, should put in NAN_ODE dir -#CPPFLAGS += -I./ode/ode/include diff --git a/source/gameengine/Physics/BlOde/OdePhysicsController.cpp b/source/gameengine/Physics/BlOde/OdePhysicsController.cpp deleted file mode 100644 index 5efd0994311..00000000000 --- a/source/gameengine/Physics/BlOde/OdePhysicsController.cpp +++ /dev/null @@ -1,625 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * The contents of this file may be used under the terms of either the GNU - * General Public License Version 2 or later (the "GPL", see - * http://www.gnu.org/licenses/gpl.html ), or the Blender License 1.0 or - * later (the "BL", see http://www.blender.org/BL/ ) which has to be - * bought from the Blender Foundation to become active, in which case the - * above mentioned GPL option does not apply. - * - * The Original Code is Copyright (C) 2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#define USE_ODE -#ifdef USE_ODE - -#include "OdePhysicsController.h" -#include "PHY_IMotionState.h" - -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -/////////////////////////////////////////////////////////////////////////// -// -// general to-do list for ODE physics. This is maintained in doxygen format. -// -/// \todo determine assignment time for bounding spheres. -/// -/// it appears you have to select "sphere" for bounding volume AND "draw bounds" -/// in order for a bounding sphere to be generated. otherwise a box is generated. -/// determine exactly when and how the bounding volumes are generated and make -/// this consistent. -/// } -/// -/// \todo bounding sphere size incorrect -/// -/// it appears NOT to use the size of the shown bounding sphere (button "draw bounds"). -/// it appears instead to use the size of the "size" dynamic parameter in the -/// gamebuttons but this "size" draws an incorrectly-sized circle on screen for the -/// bounding sphere (leftover skewed size calculation from sumo?) so figure out WHERE -/// its getting the radius from. -/// -/// \todo ODE collisions must fire collision actuator -/// -/// See OdePhysicsEnvironment::OdeNearCallback. If a sensor was created to check -/// for the presence of this collision, then in the NearCallback you need to -/// take appropriate action regarding the sensor - something like checking its -/// controller and if needed firing its actuator. Need to find similar code in -/// Fuzzics which fires collision controllers/actuators. -/// -/// \todo Are ghost collisions possible? -/// -/// How do ghost collisions work? Do they require collision detection through ODE -/// and NON-CREATION of contact-joint in OdeNearCallback? Currently OdeNearCallback -/// creates joints ALWAYS for collisions. -/// -/// \todo Why is KX_GameObject::addLinearVelocity commented out? -/// -/// Try putting this code back in. -/// -/// \todo Too many non-dynamic actors bogs down ODE physics -/// -/// Lots of "geoms" (ODE static geometry) probably slows down ode. Try a test file -/// with lots of static geometry - the game performance in Blender says it is -/// spending all its time in physics, and I bet all that time is in collision -/// detection. It's ode's non-hierarchical collision detection. -/// try making a separate ode test program (not within blender) with 1000 geoms and -/// see how fast it is. if it is really slow, there is the culprit. -/// isnt someone working on an improved ODE collision detector? check -/// ode mailing list. -/// -/// -/// \todo support collision of dynas with non-dynamic triangle meshes -/// -/// ODE has trimesh-collision support but only for trimeshes without a transform -/// matrix. update ODE tricollider to support a transform matrix. this will allow -/// moving trimeshes non-dynamically (e.g. through Ipos). then collide trimeshes -/// with dynas. this allows dynamic primitives (spheres, boxes) to collide with -/// non-dynamic or kinematically controlled tri-meshes. full dynamic trimesh to -/// dynamic trimesh support is hard because it requires (a) collision and penetration -/// depth for trimesh to trimesh and (hard to compute) (b) an intertia tensor -/// (easy to compute). -/// -/// a triangle mesh collision geometry should be created when the blender -/// bounding volume (F9, EDITBUTTONS) is set to "polyheder", since this is -/// currently the place where sphere/box selection is made -/// -/// \todo specify ODE ERP+CFM in blender interface -/// -/// when ODE physics selected, have to be able to set global cfm and erp. -/// per-joint erp/cfm could be handled in constraint window. -/// -/// \todo moving infinite mass objects should impart extra impulse to objects they collide with -/// -/// currently ODE's ERP pushes them apart but doesn't account for their motion. -/// you have to detect if one body in a collision is a non-dyna. This -/// requires adding a new accessor method to -/// KX_IPhysicsInterfaceController to access the hidden m_isDyna variable, -/// currently it can only be written, not read). If one of the bodies in a -/// collision is a non-dyna, then impart an extra impulse based on the -/// motion of the static object (using its last 2 frames as an approximation -/// of its linear and angular velocity). Linear velocity is easy to -/// approximate, but angular? you have orientation at this frame and -/// orientation at previous frame. The question is what is the angular -/// velocity which would have taken you from the previous frame's orientation -/// to this frame's orientation? -/// -/// \todo allow tweaking bounding volume size -/// -/// the scene converter currently uses the blender bounding volume of the selected -/// object as the geometry for ODE collision purposes. this is good and automatic -/// intuitive - lets you choose between cube, sphere, mesh. but you need to be able -/// to tweak this size for physics. -/// -/// \todo off center meshes totally wrong for ode -/// -/// ode uses x, y, z extents regradless of center. then places geom at center of object. -/// but visual geom is not necessarily at center. need to detect off-center situations. -/// then do what? treat it as an encapsulated off-center mass, or recenter it? -/// -/// i.o.w. recalculate center, or recalculate mass distribution (using encapsulation)? -/// -/// \todo allow off-center mass -/// -/// using ode geometry encapsulators -/// -/// \todo allow entering compound geoms for complex collision shapes specified as a union of simpler shapes -/// -/// The collision shape for arbitrary triangle meshes can probably in general be -///well approximated by a compound ODE geometry object, which is merely a combination -///of many primitives (capsule, sphere, box). I eventually want to add the ability -///to associate compound geometry objects with Blender gameobjects. I think one -///way of doing this would be to add a new button in the GameButtons, "RigidBodyCompound". -///If the object is "Dynamic" + "RigidBody", then the object's bounding volume (sphere, -///box) is created. If an object is "Dynamic" + "RigidBodyCompound", then the object itself -///will merely create a "wrapper" compound object, with the actual geometry objects -///being created from the object's children in Blender. E.g. if I wanted to make a -///compound collision object consisting of a sphere and 2 boxes, I would create a -///parent gameobject with the actual triangle mesh, and set its GameButtons to -///"RigidBodyCompound". I would then create 3 children of this object, 1 sphere and -///2 boxes, and set the GameButtons for the children to be "RigidBody". Then at -///scene conversion time, the scene converter sees "RigidBodyCompound" for the -///top-level object, then appropriately traverses the children and creates the compound -///collision geometry consisting of 2 boxes and a sphere. In this way, arbitrary -///mesh-mesh collision becomes much less necessary - the artist can (or must, -///depending on your point of view!) approximate the collision shape for arbitrary -///meshes with a combination of one or more primitive shapes. I think using the -///parent/child relationship in Blender and a new button "RigidBodyCompound" for the -///parent object of a compound is a feasible way of doing this in Blender. -/// -///See ODE demo test_boxstack and look at the code when you drop a compound object -///with the "X" key. -/// -/// \todo add visual specification of constraints -/// -/// extend the armature constraint system. by using empties and constraining one empty -/// to "copy location" of another, you can get a p2p constraint between the two empties. -/// by making the two empties each a parent of a blender object, you effectively have -/// a p2p constraint between 2 blender bodies. the scene converter can detect these -/// empties, detect the constraint, and generate an ODE constraint. -/// -/// then add a new constraint type "hinge" and "slider" to correspond to ODE joints. -/// e.g. a slider would be a constraint which restricts the axis of its object to lie -/// along the same line as another axis of a different object. e.g. you constrain x-axis -/// of one empty to lie along the same line as the z-axis of another empty; this gives -/// a slider joint. -/// -/// open questions: how to handle powered joints? to what extent should/must constraints -/// be enforced during modeling? use CCD-style algorithm in modeler to enforce constraints? -/// how about ODE powered constraints e.g. motors? -/// -/// \todo enable suspension of bodies -/// ODE offers native support for suspending dynas. but what about suspending non-dynas -/// (e.g. geoms)? suspending geoms is also necessary to ease the load of ODE's (simple?) -/// collision detector. suspending dynas and geoms is important for the activity culling, -/// which apparently works at a simple level. perhaps suspension should actually -/// remove or insert geoms/dynas into the ODE space/world? is this operation (insertion/ -/// removal) fast enough at run-time? test it. if fast enough, then suspension=remove from -/// ODE simulation, awakening=insertion into ODE simulation. -/// -/// \todo python interface for tweaking constraints via python -/// -/// \todo raytesting to support gameengine sensors that need it -/// -/// \todo investigate compatibility issues with old Blender 2.25 physics engine (sumo/fuzzics) -/// is it possible to have compatibility? how hard is it? how important is it? - - -ODEPhysicsController::ODEPhysicsController(bool dyna, bool fullRigidBody, - bool phantom, class PHY_IMotionState* motionstate, struct dxSpace* space, - struct dxWorld* world, float mass,float friction,float restitution, - bool implicitsphere,float center[3],float extents[3],float radius) - : - m_OdeDyna(dyna), - m_firstTime(true), - m_bFullRigidBody(fullRigidBody), - m_bPhantom(phantom), - m_bKinematic(false), - m_bPrevKinematic(false), - m_MotionState(motionstate), - m_OdeSuspendDynamics(false), - m_space(space), - m_world(world), - m_mass(mass), - m_friction(friction), - m_restitution(restitution), - m_bodyId(0), - m_geomId(0), - m_implicitsphere(implicitsphere), - m_radius(radius) -{ - m_center[0] = center[0]; - m_center[1] = center[1]; - m_center[2] = center[2]; - m_extends[0] = extents[0]; - m_extends[1] = extents[1]; - m_extends[2] = extents[2]; -}; - - -ODEPhysicsController::~ODEPhysicsController() -{ - if (m_geomId) - { - dGeomDestroy (m_geomId); - } -} - -float ODEPhysicsController::getMass() -{ - dMass mass; - dBodyGetMass(m_bodyId,&mass); - return mass.mass; -} - -////////////////////////////////////////////////////////////////////// -/// \todo Impart some extra impulse to dynamic objects when they collide with kinematically controlled "static" objects (ODE geoms), by using last 2 frames as 1st order approximation to the linear/angular velocity, and computing an appropriate impulse. Sumo (old physics engine) did this, see for details. -/// \todo handle scaling of static ODE geoms or fail with error message if Ipo tries to change scale of a static geom object - -bool ODEPhysicsController::SynchronizeMotionStates(float time) -{ - /** - 'Late binding' of the rigidbody, because the World Scaling is not available until the scenegraph is traversed - */ - - - if (m_firstTime) - { - m_firstTime=false; - - m_MotionState->calculateWorldTransformations(); - - dQuaternion worldquat; - float worldpos[3]; - -#ifdef dDOUBLE - m_MotionState->getWorldOrientation((float)worldquat[1], - (float)worldquat[2],(float)worldquat[3],(float)worldquat[0]); -#else - m_MotionState->getWorldOrientation(worldquat[1], - worldquat[2],worldquat[3],worldquat[0]); -#endif - m_MotionState->getWorldPosition(worldpos[0],worldpos[1],worldpos[2]); - - float scaling[3]; - m_MotionState->getWorldScaling(scaling[0],scaling[1],scaling[2]); - - if (!m_bPhantom) - { - if (m_implicitsphere) - { - m_geomId = dCreateSphere (m_space,m_radius*scaling[0]); - } else - { - m_geomId = dCreateBox (m_space, m_extends[0]*scaling[0],m_extends[1]*scaling[1],m_extends[2]*scaling[2]); - } - } else - { - m_geomId=0; - } - - if (m_geomId) - dGeomSetData(m_geomId,this); - - if (!this->m_OdeDyna) - { - if (!m_bPhantom) - { - dGeomSetPosition (this->m_geomId,worldpos[0],worldpos[1],worldpos[2]); - dMatrix3 R; - dQtoR (worldquat, R); - dGeomSetRotation (this->m_geomId,R); - } - } else - { - //it's dynamic, so create a 'model' - m_bodyId = dBodyCreate(this->m_world); - dBodySetPosition (m_bodyId,worldpos[0],worldpos[1],worldpos[2]); - dBodySetQuaternion (this->m_bodyId,worldquat); - //this contains both scalar mass and inertia tensor - dMass m; - float length=1,width=1,height=1; - dMassSetBox (&m,1,m_extends[0]*scaling[0],m_extends[1]*scaling[1],m_extends[2]*scaling[2]); - dMassAdjust (&m,this->m_mass); - dBodySetMass (m_bodyId,&m); - - if (!m_bPhantom) - { - dGeomSetBody (m_geomId,m_bodyId); - } - - - } - - if (this->m_OdeDyna && !m_bFullRigidBody) - { - // ?? huh? what to do here? - } - } - - - - if (m_OdeDyna) - { - if (this->m_OdeSuspendDynamics) - { - return false; - } - - const float* worldPos = (float *)dBodyGetPosition(m_bodyId); - m_MotionState->setWorldPosition(worldPos[0],worldPos[1],worldPos[2]); - - const float* worldquat = (float *)dBodyGetQuaternion(m_bodyId); - m_MotionState->setWorldOrientation(worldquat[1],worldquat[2],worldquat[3],worldquat[0]); - } - else { - // not a dyna, so dynamics (i.e. this controller) has not updated - // anything. BUT! an Ipo or something else might have changed the - // position/orientation of this geometry. - // so update the static geom position - - /// \todo impart some extra impulse to colliding objects! - dQuaternion worldquat; - float worldpos[3]; - -#ifdef dDOUBLE - m_MotionState->getWorldOrientation((float)worldquat[1], - (float)worldquat[2],(float)worldquat[3],(float)worldquat[0]); -#else - m_MotionState->getWorldOrientation(worldquat[1], - worldquat[2],worldquat[3],worldquat[0]); -#endif - m_MotionState->getWorldPosition(worldpos[0],worldpos[1],worldpos[2]); - - float scaling[3]; - m_MotionState->getWorldScaling(scaling[0],scaling[1],scaling[2]); - - /// \todo handle scaling! what if Ipo changes scale of object? - // Must propagate to geom... is scaling geoms possible with ODE? Also - // what about scaling trimeshes, that is certainly difficult... - dGeomSetPosition (this->m_geomId,worldpos[0],worldpos[1],worldpos[2]); - dMatrix3 R; - dQtoR (worldquat, R); - dGeomSetRotation (this->m_geomId,R); - } - - return false; //it update the worldpos -} - -PHY_IMotionState* ODEPhysicsController::GetMotionState() -{ - return m_MotionState; -} - - -// kinematic methods -void ODEPhysicsController::RelativeTranslate(float dlocX,float dlocY,float dlocZ,bool local) -{ - -} -void ODEPhysicsController::RelativeRotate(const float drot[9],bool local) -{ -} -void ODEPhysicsController::setOrientation(float quatImag0,float quatImag1,float quatImag2,float quatReal) -{ - - dQuaternion worldquat; - worldquat[0] = quatReal; - worldquat[1] = quatImag0; - worldquat[2] = quatImag1; - worldquat[3] = quatImag2; - - if (!this->m_OdeDyna) - { - dMatrix3 R; - dQtoR (worldquat, R); - dGeomSetRotation (this->m_geomId,R); - } else - { - dBodySetQuaternion (m_bodyId,worldquat); - this->m_MotionState->setWorldOrientation(quatImag0,quatImag1,quatImag2,quatReal); - } - -} - -void ODEPhysicsController::getOrientation(float &quatImag0,float &quatImag1,float &quatImag2,float &quatReal) -{ - float q[4]; - this->m_MotionState->getWorldOrientation(q[0],q[1],q[2],q[3]); - quatImag0=q[0]; - quatImag1=q[1]; - quatImag2=q[2]; - quatReal=q[3]; -} - -void ODEPhysicsController::getPosition(PHY__Vector3& pos) const -{ - m_MotionState->getWorldPosition(pos[0],pos[1],pos[2]); - -} - -void ODEPhysicsController::setPosition(float posX,float posY,float posZ) -{ - if (!m_bPhantom) - { - if (!this->m_OdeDyna) - { - dGeomSetPosition (m_geomId, posX, posY, posZ); - } else - { - dBodySetPosition (m_bodyId, posX, posY, posZ); - } - } -} -void ODEPhysicsController::setScaling(float scaleX,float scaleY,float scaleZ) -{ -} - -// physics methods -void ODEPhysicsController::ApplyTorque(float torqueX,float torqueY,float torqueZ,bool local) -{ - if (m_OdeDyna) { - if(local) { - dBodyAddRelTorque(m_bodyId, torqueX, torqueY, torqueZ); - } else { - dBodyAddTorque (m_bodyId, torqueX, torqueY, torqueZ); - } - } -} - -void ODEPhysicsController::ApplyForce(float forceX,float forceY,float forceZ,bool local) -{ - if (m_OdeDyna) { - if(local) { - dBodyAddRelForce(m_bodyId, forceX, forceY, forceZ); - } else { - dBodyAddForce (m_bodyId, forceX, forceY, forceZ); - } - } -} - -void ODEPhysicsController::SetAngularVelocity(float ang_velX,float ang_velY,float ang_velZ,bool local) -{ - if (m_OdeDyna) { - if(local) { - // TODO: translate angular vel into local frame, then apply - } else { - dBodySetAngularVel (m_bodyId, ang_velX,ang_velY,ang_velZ); - } - } -} - -void ODEPhysicsController::SetLinearVelocity(float lin_velX,float lin_velY,float lin_velZ,bool local) -{ - if (m_OdeDyna) - { - dVector3 vel = {lin_velX,lin_velY,lin_velZ, 1.0}; - if (local) - { - dMatrix3 worldmat; - dVector3 localvel; - dQuaternion worldquat; - -#ifdef dDOUBLE - m_MotionState->getWorldOrientation((float)worldquat[1], - (float)worldquat[2], (float)worldquat[3],(float)worldquat[0]); -#else - m_MotionState->getWorldOrientation(worldquat[1],worldquat[2], - worldquat[3],worldquat[0]); -#endif - dQtoR (worldquat, worldmat); - - dMULTIPLY0_331 (localvel,worldmat,vel); - dBodySetLinearVel (m_bodyId, localvel[0],localvel[1],localvel[2]); - - } else - { - dBodySetLinearVel (m_bodyId, lin_velX,lin_velY,lin_velZ); - } - } -} - -void ODEPhysicsController::applyImpulse(float attachX,float attachY,float attachZ, float impulseX,float impulseY,float impulseZ) -{ - if (m_OdeDyna) - { - //apply linear and angular effect - const dReal* linvel = dBodyGetLinearVel(m_bodyId); - float mass = getMass(); - if (mass >= 0.00001f) - { - float massinv = 1.f/mass; - float newvel[3]; - newvel[0]=linvel[0]+impulseX*massinv; - newvel[1]=linvel[1]+impulseY*massinv; - newvel[2]=linvel[2]+impulseZ*massinv; - dBodySetLinearVel(m_bodyId,newvel[0],newvel[1],newvel[2]); - - const float* worldPos = (float *)dBodyGetPosition(m_bodyId); - - const float* angvelc = (float *)dBodyGetAngularVel(m_bodyId); - float angvel[3]; - angvel[0]=angvelc[0]; - angvel[1]=angvelc[1]; - angvel[2]=angvelc[2]; - - dVector3 impulse; - impulse[0]=impulseX; - impulse[1]=impulseY; - impulse[2]=impulseZ; - - dVector3 ap; - ap[0]=attachX-worldPos[0]; - ap[1]=attachY-worldPos[1]; - ap[2]=attachZ-worldPos[2]; - - dCROSS(angvel,+=,ap,impulse); - dBodySetAngularVel(m_bodyId,angvel[0],angvel[1],angvel[2]); - - } - - } - -} - -void ODEPhysicsController::SuspendDynamics() -{ - -} - -void ODEPhysicsController::RestoreDynamics() -{ - -} - - -/** - reading out information from physics -*/ -void ODEPhysicsController::GetLinearVelocity(float& linvX,float& linvY,float& linvZ) -{ - if (m_OdeDyna) - { - const float* vel = (float *)dBodyGetLinearVel(m_bodyId); - linvX = vel[0]; - linvY = vel[1]; - linvZ = vel[2]; - } else - { - linvX = 0.f; - linvY = 0.f; - linvZ = 0.f; - - } -} -/** - GetVelocity parameters are in geometric coordinates (Origin is not center of mass!). -*/ -void ODEPhysicsController::GetVelocity(const float posX,const float posY,const float posZ,float& linvX,float& linvY,float& linvZ) -{ - -} - - -void ODEPhysicsController::getReactionForce(float& forceX,float& forceY,float& forceZ) -{ - -} -void ODEPhysicsController::setRigidBody(bool rigid) -{ - -} - - -void ODEPhysicsController::PostProcessReplica(class PHY_IMotionState* motionstate,class PHY_IPhysicsController* parentctrl) -{ - m_MotionState = motionstate; - m_bKinematic = false; - m_bPrevKinematic = false; - m_firstTime = true; -} - - -void ODEPhysicsController::SetSimulatedTime(float time) -{ -} - - -void ODEPhysicsController::WriteMotionStateToDynamics(bool nondynaonly) -{ - -} -#endif diff --git a/source/gameengine/Physics/BlOde/OdePhysicsController.h b/source/gameengine/Physics/BlOde/OdePhysicsController.h deleted file mode 100644 index 544d11da2ca..00000000000 --- a/source/gameengine/Physics/BlOde/OdePhysicsController.h +++ /dev/null @@ -1,164 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * The contents of this file may be used under the terms of either the GNU - * General Public License Version 2 or later (the "GPL", see - * http://www.gnu.org/licenses/gpl.html ), or the Blender License 1.0 or - * later (the "BL", see http://www.blender.org/BL/ ) which has to be - * bought from the Blender Foundation to become active, in which case the - * above mentioned GPL option does not apply. - * - * The Original Code is Copyright (C) 2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#ifndef __ODE_PHYSICSCONTROLLER_H -#define __ODE_PHYSICSCONTROLLER_H - - -#include "PHY_IPhysicsController.h" - -/** - ODE Physics Controller, a special kind of a PhysicsController. - A Physics Controller is a special kind of Scene Graph Transformation Controller. - Each time the scene graph get's updated, the controller get's a chance - in the 'Update' method to reflect changes. -*/ - -class ODEPhysicsController : public PHY_IPhysicsController - -{ - - bool m_OdeDyna; - -public: - ODEPhysicsController( - bool dyna, - bool fullRigidBody, - bool phantom, - class PHY_IMotionState* motionstate, - struct dxSpace* space, - struct dxWorld* world, - float mass, - float friction, - float restitution, - bool implicitsphere, - float center[3], - float extends[3], - float radius); - - virtual ~ODEPhysicsController(); - - // kinematic methods - virtual void RelativeTranslate(float dlocX,float dlocY,float dlocZ,bool local); - virtual void RelativeRotate(const float drot[9],bool local); - virtual void getOrientation(float &quatImag0,float &quatImag1,float &quatImag2,float &quatReal); - virtual void setOrientation(float quatImag0,float quatImag1,float quatImag2,float quatReal); - virtual void setPosition(float posX,float posY,float posZ); - virtual void getPosition(PHY__Vector3& pos) const; - - virtual void setScaling(float scaleX,float scaleY,float scaleZ); - - // physics methods - virtual void ApplyTorque(float torqueX,float torqueY,float torqueZ,bool local); - virtual void ApplyForce(float forceX,float forceY,float forceZ,bool local); - virtual void SetAngularVelocity(float ang_velX,float ang_velY,float ang_velZ,bool local); - virtual void SetLinearVelocity(float lin_velX,float lin_velY,float lin_velZ,bool local); - virtual void applyImpulse(float attachX,float attachY,float attachZ, float impulseX,float impulseY,float impulseZ); - virtual void SetActive(bool active){}; - virtual void SuspendDynamics(); - virtual void RestoreDynamics(); - virtual void resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ) - { - //todo ? - } - - - /** - reading out information from physics - */ - virtual void GetLinearVelocity(float& linvX,float& linvY,float& linvZ); - /** - GetVelocity parameters are in geometric coordinates (Origin is not center of mass!). - */ - virtual void GetVelocity(const float posX,const float posY,const float posZ,float& linvX,float& linvY,float& linvZ); - virtual float getMass(); - virtual void getReactionForce(float& forceX,float& forceY,float& forceZ); - virtual void setRigidBody(bool rigid); - - - virtual void PostProcessReplica(class PHY_IMotionState* motionstate,class PHY_IPhysicsController* parentctrl); - - // \todo remove next line ! - virtual void SetSimulatedTime(float time); - - - virtual void WriteDynamicsToMotionState() {}; - virtual void WriteMotionStateToDynamics(bool nondynaonly); - virtual class PHY_IMotionState* GetMotionState(); - - /** - call from Scene Graph Node to 'update'. - */ - virtual bool SynchronizeMotionStates(float time); - - virtual void calcXform(){} - virtual void SetMargin(float margin) {} - virtual float GetMargin() const {return 0.f;} - virtual float GetRadius() const {return 0.f;} - virtual void SetRadius(float margin) {} - - // clientinfo for raycasts for example - virtual void* getNewClientInfo() { return m_clientInfo;} - virtual void setNewClientInfo(void* clientinfo) {m_clientInfo = clientinfo;}; - void* m_clientInfo; - - struct dxBody* GetOdeBodyId() { return m_bodyId; } - - float getFriction() { return m_friction;} - float getRestitution() { return m_restitution;} - - float GetLinVelocityMin() const { return 0.f; } - void SetLinVelocityMin(float val) { } - float GetLinVelocityMax() const { return 0.f; } - void SetLinVelocityMax(float val) { } - - -private: - - bool m_firstTime; - bool m_bFullRigidBody; - bool m_bPhantom; // special flag for objects that are not affected by physics 'resolver' - - // data to calculate fake velocities for kinematic objects (non-dynas) - bool m_bKinematic; - bool m_bPrevKinematic; - - - float m_lastTime; - bool m_OdeSuspendDynamics; - class PHY_IMotionState* m_MotionState; - - //Ode specific members - struct dxBody* m_bodyId; - struct dxGeom* m_geomId; - struct dxSpace* m_space; - struct dxWorld* m_world; - float m_mass; - float m_friction; - float m_restitution; - bool m_implicitsphere; - float m_center[3]; - float m_extends[3]; - float m_radius; -}; - -#endif //__ODE_PHYSICSCONTROLLER_H - diff --git a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp deleted file mode 100644 index 54e97858b7f..00000000000 --- a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * The contents of this file may be used under the terms of either the GNU - * General Public License Version 2 or later (the "GPL", see - * http://www.gnu.org/licenses/gpl.html ), or the Blender License 1.0 or - * later (the "BL", see http://www.blender.org/BL/ ) which has to be - * bought from the Blender Foundation to become active, in which case the - * above mentioned GPL option does not apply. - * - * The Original Code is Copyright (C) 2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#include "OdePhysicsEnvironment.h" -#include "PHY_IMotionState.h" -#include "OdePhysicsController.h" - -#include -#include <../ode/src/joint.h> -#include - -ODEPhysicsEnvironment::ODEPhysicsEnvironment() -{ - m_OdeWorld = dWorldCreate(); - m_OdeSpace = dHashSpaceCreate(); - m_OdeContactGroup = dJointGroupCreate (0); - dWorldSetCFM (m_OdeWorld,1e-5f); - - m_JointGroup = dJointGroupCreate(0); - - setFixedTimeStep(true,1.f/60.f); -} - - - -ODEPhysicsEnvironment::~ODEPhysicsEnvironment() -{ - dJointGroupDestroy (m_OdeContactGroup); - dJointGroupDestroy (m_JointGroup); - - dSpaceDestroy (m_OdeSpace); - dWorldDestroy (m_OdeWorld); -} - - - -void ODEPhysicsEnvironment::setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep) -{ - m_useFixedTimeStep = useFixedTimeStep; - - if (useFixedTimeStep) - { - m_fixedTimeStep = fixedTimeStep; - } else - { - m_fixedTimeStep = 0.f; - } - m_currentTime = 0.f; - - //todo:implement fixed timestepping - -} -float ODEPhysicsEnvironment::getFixedTimeStep() -{ - return m_fixedTimeStep; -} - - - -bool ODEPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep1,float interval) -{ - - float deltaTime = timeStep1; - int numSteps = 1; - - if (m_useFixedTimeStep) - { - m_currentTime += timeStep1; - // equal to subSampling (might be a little smaller). - numSteps = (int)(m_currentTime / m_fixedTimeStep); - m_currentTime -= m_fixedTimeStep * (float)numSteps; - deltaTime = m_fixedTimeStep; - //todo: experiment by smoothing the remaining time over the substeps - } - - for (int i=0;iClearOdeContactGroup(); - } - return true; -} - -void ODEPhysicsEnvironment::setGravity(float x,float y,float z) -{ - dWorldSetGravity (m_OdeWorld,x,y,z); -} - - - -int ODEPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsController* ctrl2,PHY_ConstraintType type, - float pivotX,float pivotY,float pivotZ,float axisX,float axisY,float axisZ) -{ - - int constraintid = 0; - ODEPhysicsController* dynactrl = (ODEPhysicsController*)ctrl; - ODEPhysicsController* dynactrl2 = (ODEPhysicsController*)ctrl2; - - switch (type) - { - case PHY_POINT2POINT_CONSTRAINT: - { - if (dynactrl) - { - dJointID jointid = dJointCreateBall (m_OdeWorld,m_JointGroup); - struct dxBody* bodyid1 = dynactrl->GetOdeBodyId(); - struct dxBody* bodyid2=0; - const dReal* pos = dBodyGetPosition(bodyid1); - const dReal* R = dBodyGetRotation(bodyid1); - dReal offset[3] = {pivotX,pivotY,pivotZ}; - dReal newoffset[3]; - dMULTIPLY0_331 (newoffset,R,offset); - newoffset[0] += pos[0]; - newoffset[1] += pos[1]; - newoffset[2] += pos[2]; - - - if (dynactrl2) - bodyid2 = dynactrl2->GetOdeBodyId(); - - dJointAttach (jointid, bodyid1, bodyid2); - - dJointSetBallAnchor (jointid, newoffset[0], newoffset[1], newoffset[2]); - - constraintid = (int) jointid; - } - break; - } - case PHY_LINEHINGE_CONSTRAINT: - { - if (dynactrl) - { - dJointID jointid = dJointCreateHinge (m_OdeWorld,m_JointGroup); - struct dxBody* bodyid1 = dynactrl->GetOdeBodyId(); - struct dxBody* bodyid2=0; - const dReal* pos = dBodyGetPosition(bodyid1); - const dReal* R = dBodyGetRotation(bodyid1); - dReal offset[3] = {pivotX,pivotY,pivotZ}; - dReal axisset[3] = {axisX,axisY,axisZ}; - - dReal newoffset[3]; - dReal newaxis[3]; - dMULTIPLY0_331 (newaxis,R,axisset); - - dMULTIPLY0_331 (newoffset,R,offset); - newoffset[0] += pos[0]; - newoffset[1] += pos[1]; - newoffset[2] += pos[2]; - - - if (dynactrl2) - bodyid2 = dynactrl2->GetOdeBodyId(); - - dJointAttach (jointid, bodyid1, bodyid2); - - dJointSetHingeAnchor (jointid, newoffset[0], newoffset[1], newoffset[2]); - dJointSetHingeAxis(jointid,newaxis[0],newaxis[1],newaxis[2]); - - constraintid = (int) jointid; - } - break; - } - default: - { - //not yet - } - } - - return constraintid; - -} - -void ODEPhysicsEnvironment::removeConstraint(void *constraintid) -{ - if (constraintid) - { - dJointDestroy((dJointID) constraintid); - } -} - -PHY_IPhysicsController* ODEPhysicsEnvironment::rayTest(PHY_IRayCastFilterCallback &filterCallback,float fromX,float fromY,float fromZ, float toX,float toY,float toZ) -{ - - //m_OdeWorld - //collision detection / raytesting - return NULL; -} - - -void ODEPhysicsEnvironment::OdeNearCallback (void *data, dGeomID o1, dGeomID o2) -{ - // \todo if this is a registered collision sensor - // fire the callback - - int i; - // if (o1->body && o2->body) return; - ODEPhysicsEnvironment* env = (ODEPhysicsEnvironment*) data; - dBodyID b1,b2; - - b1 = dGeomGetBody(o1); - b2 = dGeomGetBody(o2); - // exit without doing anything if the two bodies are connected by a joint - if (b1 && b2 && dAreConnected (b1,b2)) return; - - ODEPhysicsController * ctrl1 =(ODEPhysicsController *)dGeomGetData(o1); - ODEPhysicsController * ctrl2 =(ODEPhysicsController *)dGeomGetData(o2); - float friction=ctrl1->getFriction(); - float restitution = ctrl1->getRestitution(); - //for friction, take minimum - - friction=(friction < ctrl2->getFriction() ? - friction :ctrl2->getFriction()); - - //restitution:take minimum - restitution = restitution < ctrl2->getRestitution()? - restitution : ctrl2->getRestitution(); - - dContact contact[3]; // up to 3 contacts per box - for (i=0; i<3; i++) { - contact[i].surface.mode = dContactBounce; //dContactMu2; - contact[i].surface.mu = friction;//dInfinity; - contact[i].surface.mu2 = 0; - contact[i].surface.bounce = restitution;//0.5; - contact[i].surface.bounce_vel = 0.1f; - contact[i].surface.slip1=0.0; - } - - if (int numc = dCollide (o1,o2,3,&contact[0].geom,sizeof(dContact))) { - // dMatrix3 RI; - // dRSetIdentity (RI); - // const dReal ss[3] = {0.02,0.02,0.02}; - for (i=0; im_OdeWorld,env->m_OdeContactGroup,contact+i); - dJointAttach (c,b1,b2); - } - } -} - - -void ODEPhysicsEnvironment::ClearOdeContactGroup() -{ - dJointGroupEmpty (m_OdeContactGroup); -} - -int ODEPhysicsEnvironment::GetNumOdeContacts() -{ - return m_OdeContactGroup->num; -} - diff --git a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h b/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h deleted file mode 100644 index 54e4f7f90e1..00000000000 --- a/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * The contents of this file may be used under the terms of either the GNU - * General Public License Version 2 or later (the "GPL", see - * http://www.gnu.org/licenses/gpl.html ), or the Blender License 1.0 or - * later (the "BL", see http://www.blender.org/BL/ ) which has to be - * bought from the Blender Foundation to become active, in which case the - * above mentioned GPL option does not apply. - * - * The Original Code is Copyright (C) 2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#ifndef _ODEPHYSICSENVIRONMENT -#define _ODEPHYSICSENVIRONMENT - - -#include "PHY_IPhysicsEnvironment.h" - -/** -* Physics Environment takes care of stepping the simulation and is a container for physics entities (rigidbodies,constraints, materials etc.) -* A derived class may be able to 'construct' entities by loading and/or converting -*/ -class ODEPhysicsEnvironment : public PHY_IPhysicsEnvironment -{ - - bool m_useFixedTimeStep; - float m_fixedTimeStep; - float m_currentTime; - -public: - ODEPhysicsEnvironment(); - virtual ~ODEPhysicsEnvironment(); - virtual void beginFrame() {} - virtual void endFrame() {} - - -// Perform an integration step of duration 'timeStep'. - virtual bool proceedDeltaTime(double curTime,float timeStep,float interval); - virtual void setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep); - virtual float getFixedTimeStep(); - - virtual void setGravity(float x,float y,float z); - virtual int createConstraint(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsController* ctrl2,PHY_ConstraintType type, - float pivotX,float pivotY,float pivotZ, - float axisX,float axisY,float axisZ); - - virtual void removeConstraint(void * constraintid); - virtual PHY_IPhysicsController* rayTest(PHY_IRayCastFilterCallback &filterCallback,float fromX,float fromY,float fromZ, float toX,float toY,float toZ); - virtual bool cullingTest(PHY_CullingCallback callback, void* userData, PHY__Vector4* planes, int nplanes, int occlusionRes) { return false; } - - - //gamelogic callbacks - virtual void addSensor(PHY_IPhysicsController* ctrl) {} - virtual void removeSensor(PHY_IPhysicsController* ctrl) {} - virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user) - { - } - virtual bool requestCollisionCallback(PHY_IPhysicsController* ctrl) {return false;} - virtual bool removeCollisionCallback(PHY_IPhysicsController* ctrl) {return false;} - virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position) {return 0;} - virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight) { return 0;} - - - - struct dxWorld* GetOdeWorld() { return m_OdeWorld; }; - struct dxSpace* GetOdeSpace() { return m_OdeSpace;}; - -private: - - - // ODE physics response - struct dxWorld* m_OdeWorld; - // ODE collision detection - struct dxSpace* m_OdeSpace; - void ClearOdeContactGroup(); - struct dxJointGroup* m_OdeContactGroup; - struct dxJointGroup* m_JointGroup; - - static void OdeNearCallback(void *data, struct dxGeom* o1, struct dxGeom* o2); - int GetNumOdeContacts(); - -}; - -#endif //_ODEPHYSICSENVIRONMENT - diff --git a/source/gameengine/Physics/BlOde/SConscript b/source/gameengine/Physics/BlOde/SConscript deleted file mode 100644 index 90e949d2d86..00000000000 --- a/source/gameengine/Physics/BlOde/SConscript +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/python -Import ('user_options_dict') -Import ('library_env') - -phy_ode_env = library_env.Copy () - -source_files = ['OdePhysicsController.cpp', - 'OdePhysicsEnvironment.cpp'] - -phy_ode_env.Append (CPPPATH=['.', - '../common', - ]) -phy_ode_env.Append (CPPPATH=user_options_dict['ODE_INCLUDE']) - -phy_ode_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/PHY_Ode', source=source_files) diff --git a/source/gameengine/Physics/Dummy/Makefile b/source/gameengine/Physics/Dummy/Makefile index b0c1b855322..c016a0bebcb 100644 --- a/source/gameengine/Physics/Dummy/Makefile +++ b/source/gameengine/Physics/Dummy/Makefile @@ -39,7 +39,7 @@ CPPFLAGS += -I$(OPENGL_HEADERS) CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) -CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_SUMO)/include -I$(NAN_MOTO)/include +CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_MOTO)/include CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include CPPFLAGS += -I../../Physics/common CPPFLAGS += -I../../Physics/Dummy diff --git a/source/gameengine/Physics/Makefile b/source/gameengine/Physics/Makefile index b192e497f35..da0d4cafd2e 100644 --- a/source/gameengine/Physics/Makefile +++ b/source/gameengine/Physics/Makefile @@ -32,7 +32,6 @@ include nan_definitions.mk SOURCEDIR = source/gameengine/Physics DIR = $(OCGDIR)/gameengine/blphys -DIRS = common Sumo Dummy Bullet -#DIRS += BlOde +DIRS = common Dummy Bullet include nan_subdirs.mk diff --git a/source/gameengine/Physics/Sumo/CMakeLists.txt b/source/gameengine/Physics/Sumo/CMakeLists.txt deleted file mode 100644 index c57a4af6706..00000000000 --- a/source/gameengine/Physics/Sumo/CMakeLists.txt +++ /dev/null @@ -1,46 +0,0 @@ -# $Id$ -# ***** BEGIN GPL 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. -# -# 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) 2006, Blender Foundation -# All rights reserved. -# -# The Original Code is: all of this file. -# -# Contributor(s): Jacques Beaurain. -# -# ***** END GPL LICENSE BLOCK ***** - -SET(SRC - SumoPHYCallbackBridge.cpp - SumoPhysicsController.cpp - SumoPhysicsEnvironment.cpp - Fuzzics/src/SM_FhObject.cpp - Fuzzics/src/SM_Object.cpp - Fuzzics/src/SM_Scene.cpp - Fuzzics/src/SM_MotionState.cpp -) - -SET(INC - . - ../common - Fuzzics/include - ../../../../intern/moto/include - ../../../../extern/solid -) - -BLENDERLIB(bf_sumo "${SRC}" "${INC}") -#env.BlenderLib ( 'bf_sumo', sources, incs, [], libtype=['game2','player'], priority=[30, 70] , compileflags=cflags) diff --git a/source/gameengine/Physics/Sumo/Fuzzics/Makefile b/source/gameengine/Physics/Sumo/Fuzzics/Makefile deleted file mode 100644 index 5ed2c31a1d0..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -# -# $Id$ -# -# ***** BEGIN GPL 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. -# -# 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. -# -# The Original Code is: all of this file. -# -# Contributor(s): none yet. -# -# ***** END GPL LICENSE BLOCK ***** -# -# Bounces make to subdirectories. - -SOURCEDIR = source/gameengine/Physics/Sumo/Fuzzics -DIRS = src - -include nan_subdirs.mk diff --git a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Callback.h b/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Callback.h deleted file mode 100644 index 42b5ab48ab6..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Callback.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef SM_CALLBACK_H -#define SM_CALLBACK_H - -class SM_Callback { -public: - virtual void do_me() = 0; - virtual ~SM_Callback() {} -}; - -#endif - diff --git a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_ClientObjectInfo.h b/source/gameengine/Physics/Sumo/Fuzzics/include/SM_ClientObjectInfo.h deleted file mode 100644 index 6749e7957ec..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_ClientObjectInfo.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef __SM_CLIENTOBJECT_INFO_H -#define __SM_CLIENTOBJECT_INFO_H - -/** - * Client Type and Additional Info. This structure can be use instead of a bare void* pointer, for safeness, and additional info for callbacks - */ - -struct SM_ClientObjectInfo -{ - int m_type; - void* m_clientobject1; - void* m_auxilary_info; -}; - -#endif //__SM_CLIENTOBJECT_INFO_H - diff --git a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Debug.h b/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Debug.h deleted file mode 100644 index 48d5906e53d..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Debug.h +++ /dev/null @@ -1,26 +0,0 @@ - - -#ifndef __SM_DEBUG_H__ -#define __SM_DEBUG_H__ - -/* Comment this to disable all SUMO debugging printfs */ - -#define SM_DEBUG - -#ifdef SM_DEBUG - -#include - -/* Uncomment this to printf all ray casts */ -//#define SM_DEBUG_RAYCAST - -/* Uncomment this to printf collision callbacks */ -//#define SM_DEBUG_BOING - -/* Uncomment this to printf Xform matrix calculations */ -//#define SM_DEBUG_XFORM - -#endif /* SM_DEBUG */ - -#endif /* __SM_DEBUG_H__ */ - diff --git a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_FhObject.h b/source/gameengine/Physics/Sumo/Fuzzics/include/SM_FhObject.h deleted file mode 100644 index b03612ed15e..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_FhObject.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#ifndef SM_FHOBJECT_H -#define SM_FHOBJECT_H - -#include "SM_Object.h" - -class SM_FhObject : public SM_Object { -public: - virtual ~SM_FhObject(); - SM_FhObject(DT_ShapeHandle rayshape, MT_Vector3 ray, SM_Object *parent_object); - - const MT_Vector3& getRay() const { return m_ray; } - MT_Point3 getSpot() const { return getPosition() + m_ray; } - const MT_Vector3& getRayDirection() const { return m_ray_direction; } - SM_Object *getParentObject() const { return m_parent_object; } - - static DT_Bool ray_hit(void *client_data, - void *object1, - void *object2, - const DT_CollData *coll_data); - -private: - MT_Vector3 m_ray; - MT_Vector3 m_ray_direction; - SM_Object *m_parent_object; -}; - -#endif - diff --git a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_MotionState.h b/source/gameengine/Physics/Sumo/Fuzzics/include/SM_MotionState.h deleted file mode 100644 index fdc45af5225..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_MotionState.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#ifndef SM_MOTIONSTATE_H -#define SM_MOTIONSTATE_H - -#include "MT_Transform.h" - -class SM_MotionState { -public: - SM_MotionState() : - m_time(0.0), - m_pos(0.0, 0.0, 0.0), - m_orn(0.0, 0.0, 0.0, 1.0), - m_lin_vel(0.0, 0.0, 0.0), - m_ang_vel(0.0, 0.0, 0.0) - {} - - void setPosition(const MT_Point3& pos) { m_pos = pos; } - void setOrientation(const MT_Quaternion& orn) { m_orn = orn; } - void setLinearVelocity(const MT_Vector3& lin_vel) { m_lin_vel = lin_vel; } - void setAngularVelocity(const MT_Vector3& ang_vel) { m_ang_vel = ang_vel; } - void setTime(MT_Scalar time) { m_time = time; } - - const MT_Point3& getPosition() const { return m_pos; } - const MT_Quaternion& getOrientation() const { return m_orn; } - const MT_Vector3& getLinearVelocity() const { return m_lin_vel; } - const MT_Vector3& getAngularVelocity() const { return m_ang_vel; } - - MT_Scalar getTime() const { return m_time; } - - void integrateMidpoint(MT_Scalar timeStep, const SM_MotionState &prev_state, const MT_Vector3 &velocity, const MT_Quaternion& ang_vel); - void integrateBackward(MT_Scalar timeStep, const MT_Vector3 &velocity, const MT_Quaternion& ang_vel); - void integrateForward(MT_Scalar timeStep, const SM_MotionState &prev_state); - - void lerp(const SM_MotionState &prev, const SM_MotionState &next); - void lerp(MT_Scalar t, const SM_MotionState &other); - - virtual MT_Transform getTransform() const { - return MT_Transform(m_pos, m_orn); - } - -protected: - MT_Scalar m_time; - MT_Point3 m_pos; - MT_Quaternion m_orn; - MT_Vector3 m_lin_vel; - MT_Vector3 m_ang_vel; -}; - -#endif - diff --git a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Object.h b/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Object.h deleted file mode 100644 index 2d748a0f251..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Object.h +++ /dev/null @@ -1,393 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#ifndef SM_OBJECT_H -#define SM_OBJECT_H - -#include - -#include - -#include "SM_Callback.h" -#include "SM_MotionState.h" -#include - -class SM_FhObject; - -/** Properties of dynamic objects */ -struct SM_ShapeProps { - MT_Scalar m_mass; ///< Total mass - MT_Scalar m_radius; ///< Bound sphere size - MT_Vector3 m_inertia; ///< Inertia, should be a tensor some time - MT_Scalar m_lin_drag; ///< Linear drag (air, water) 0 = concrete, 1 = vacuum - MT_Scalar m_ang_drag; ///< Angular drag - MT_Scalar m_friction_scaling[3]; ///< Scaling for anisotropic friction. Component in range [0, 1] - bool m_do_anisotropic; ///< Should I do anisotropic friction? - bool m_do_fh; ///< Should the object have a linear Fh spring? - bool m_do_rot_fh; ///< Should the object have an angular Fh spring? -}; - - -/** Properties of collidable objects (non-ghost objects) */ -struct SM_MaterialProps { - MT_Scalar m_restitution; ///< restitution of energy after a collision 0 = inelastic, 1 = elastic - MT_Scalar m_friction; ///< Coulomb friction (= ratio between the normal en maximum friction force) - MT_Scalar m_fh_spring; ///< Spring constant (both linear and angular) - MT_Scalar m_fh_damping; ///< Damping factor (linear and angular) in range [0, 1] - MT_Scalar m_fh_distance; ///< The range above the surface where Fh is active. - bool m_fh_normal; ///< Should the object slide off slopes? -}; - -class SM_ClientObject -{ -public: - SM_ClientObject() {} - virtual ~SM_ClientObject() {} - - virtual bool hasCollisionCallback() = 0; -}; - -/** - * SM_Object is an internal part of the Sumo physics engine. - * - * It encapsulates an object in the physics scene, and is responsible - * for calculating the collision response of objects. - */ -class SM_Object -{ -public: - SM_Object() ; - SM_Object( - DT_ShapeHandle shape, - const SM_MaterialProps *materialProps, - const SM_ShapeProps *shapeProps, - SM_Object *dynamicParent - ); - virtual ~SM_Object(); - - bool isDynamic() const; - - /* nzc experimental. There seem to be two places where kinematics - * are evaluated: proceedKinematic (called from SM_Scene) and - * proceed() in this object. I'll just try and bunge these out for - * now. */ - - void suspend(void); - void resume(void); - - void suspendDynamics(); - - void restoreDynamics(); - - bool isGhost() const; - - void suspendMaterial(); - - void restoreMaterial(); - - SM_FhObject *getFhObject() const; - - void registerCallback(SM_Callback& callback); - - void calcXform(); - void notifyClient(); - void updateInvInertiaTensor(); - - - // Save the current state information for use in the - // velocity computation in the next frame. - - void proceedKinematic(MT_Scalar timeStep); - - void saveReactionForce(MT_Scalar timeStep) ; - - void clearForce() ; - - void clearMomentum() ; - - void setMargin(MT_Scalar margin) ; - - MT_Scalar getMargin() const ; - - const SM_MaterialProps *getMaterialProps() const ; - - const SM_ShapeProps *getShapeProps() const ; - - void setPosition(const MT_Point3& pos); - void setOrientation(const MT_Quaternion& orn); - void setScaling(const MT_Vector3& scaling); - - /** - * set an external velocity. This velocity complements - * the physics velocity. So setting it does not override the - * physics velocity. It is your responsibility to clear - * this external velocity. This velocity is not subject to - * friction or damping. - */ - void setExternalLinearVelocity(const MT_Vector3& lin_vel) ; - void addExternalLinearVelocity(const MT_Vector3& lin_vel) ; - - /** Override the physics velocity */ - void addLinearVelocity(const MT_Vector3& lin_vel); - void setLinearVelocity(const MT_Vector3& lin_vel); - - /** - * Set an external angular velocity. This velocity complemetns - * the physics angular velocity so does not override it. It is - * your responsibility to clear this velocity. This velocity - * is not subject to friction or damping. - */ - void setExternalAngularVelocity(const MT_Vector3& ang_vel) ; - void addExternalAngularVelocity(const MT_Vector3& ang_vel); - - /** Override the physics angular velocity */ - void addAngularVelocity(const MT_Vector3& ang_vel); - void setAngularVelocity(const MT_Vector3& ang_vel); - - /** Clear the external velocities */ - void clearCombinedVelocities(); - - /** - * Tell the physics system to combine the external velocity - * with the physics velocity. - */ - void resolveCombinedVelocities( - const MT_Vector3 & lin_vel, - const MT_Vector3 & ang_vel - ) ; - - - - MT_Scalar getInvMass() const; - - const MT_Vector3& getInvInertia() const ; - - const MT_Matrix3x3& getInvInertiaTensor() const; - - void applyForceField(const MT_Vector3& accel) ; - - void applyCenterForce(const MT_Vector3& force) ; - - void applyTorque(const MT_Vector3& torque) ; - - /** - * Apply an impulse to the object. The impulse will be split into - * angular and linear components. - * @param attach point to apply the impulse to (in world coordinates) - */ - void applyImpulse(const MT_Point3& attach, const MT_Vector3& impulse) ; - - /** - * Applies an impulse through the center of this object. (ie the angular - * velocity will not change. - */ - void applyCenterImpulse(const MT_Vector3& impulse); - /** - * Applies an angular impulse. - */ - void applyAngularImpulse(const MT_Vector3& impulse); - - MT_Point3 getWorldCoord(const MT_Point3& local) const; - MT_Point3 getLocalCoord(const MT_Point3& world) const; - - MT_Vector3 getVelocity(const MT_Point3& local) const; - - - const MT_Vector3& getReactionForce() const ; - - void getMatrix(double *m) const ; - - const double *getMatrix() const ; - - // Still need this??? - const MT_Transform& getScaledTransform() const; - - DT_ObjectHandle getObjectHandle() const ; - DT_ShapeHandle getShapeHandle() const ; - - SM_Object *getDynamicParent() ; - - void integrateForces(MT_Scalar timeStep); - void integrateMomentum(MT_Scalar timeSteo); - - void setRigidBody(bool is_rigid_body) ; - - bool isRigidBody() const ; - - // This is the callback for handling collisions of dynamic objects - static - DT_Bool - boing( - void *client_data, - void *object1, - void *object2, - const DT_CollData *coll_data - ); - - static - DT_Bool - fix( - void *client_data, - void *object1, - void *object2, - const DT_CollData *coll_data - ); - - - SM_ClientObject *getClientObject() { return m_client_object; } - void setClientObject(SM_ClientObject *client_object) { m_client_object = client_object; } - void setPhysicsClientObject(void* physicsClientObject) - { - m_physicsClientObject = physicsClientObject; - } - void* getPhysicsClientObject() { - return m_physicsClientObject; - } - void relax(); - - SM_MotionState &getCurrentFrame(); - SM_MotionState &getPreviousFrame(); - SM_MotionState &getNextFrame(); - - const SM_MotionState &getCurrentFrame() const; - const SM_MotionState &getPreviousFrame() const; - const SM_MotionState &getNextFrame() const; - - // Motion state functions - const MT_Point3& getPosition() const; - const MT_Quaternion& getOrientation() const; - const MT_Vector3& getLinearVelocity() const; - const MT_Vector3& getAngularVelocity() const; - - MT_Scalar getTime() const; - - void setTime(MT_Scalar time); - - void interpolate(MT_Scalar timeStep); - void endFrame(); - -private: - friend class Contact; - // Tweak parameters - static MT_Scalar ImpulseThreshold; - - // return the actual linear_velocity of this object this - // is the addition of m_combined_lin_vel and m_lin_vel. - - const - MT_Vector3 - actualLinVelocity( - ) const ; - - const - MT_Vector3 - actualAngVelocity( - ) const ; - - void dynamicCollision(const MT_Point3 &local2, - const MT_Vector3 &normal, - MT_Scalar dist, - const MT_Vector3 &rel_vel, - MT_Scalar restitution, - MT_Scalar friction_factor, - MT_Scalar invMass - ); - - typedef std::vector T_CallbackList; - - - T_CallbackList m_callbackList; // Each object can have multiple callbacks from the client (=game engine) - SM_Object *m_dynamicParent; // Collisions between parent and children are ignored - - // as the collision callback now has only information - // on an SM_Object, there must be a way that the SM_Object client - // can identify it's clientdata after a collision - SM_ClientObject *m_client_object; - - void* m_physicsClientObject; - - DT_ShapeHandle m_shape; // Shape for collision detection - - // Material and shape properties are not owned by this class. - - const SM_MaterialProps *m_materialProps; - const SM_MaterialProps *m_materialPropsBackup; // Backup in case the object temporarily becomes a ghost. - const SM_ShapeProps *m_shapeProps; - const SM_ShapeProps *m_shapePropsBackup; // Backup in case the object's dynamics is temporarily suspended - DT_ObjectHandle m_object; // A handle to the corresponding object in SOLID. - MT_Scalar m_margin; // Offset for the object's shape (also for collision detection) - MT_Vector3 m_scaling; // Non-uniform scaling of the object's shape - - double m_ogl_matrix[16]; // An OpenGL-type 4x4 matrix - MT_Transform m_xform; // The object's local coordinate system - MT_Transform m_prev_xform; // The object's local coordinate system in the previous frame - SM_MotionState m_prev_state; // The object's motion state in the previous frame - MT_Scalar m_timeStep; // The duration of the last frame - - MT_Vector3 m_reaction_impulse; // The accumulated impulse resulting from collisions - MT_Vector3 m_reaction_force; // The reaction force derived from the reaction impulse - - MT_Vector3 m_lin_mom; // Linear momentum (linear velocity times mass) - MT_Vector3 m_ang_mom; // Angular momentum (angualr velocity times inertia) - MT_Vector3 m_force; // Force on center of mass (afffects linear momentum) - MT_Vector3 m_torque; // Torque around center of mass (affects angular momentum) - - SM_MotionState m_frames[3]; - - MT_Vector3 m_error; // Error in position:- amount object must be moved to prevent intersection with scene - - // Here are the values of externally set linear and angular - // velocity. These are updated from the outside - // (actuators and python) each frame and combined with the - // physics values. At the end of each frame (at the end of a - // call to proceed) they are set to zero. This allows the - // outside world to contribute to the velocity of an object - // but still have it react to physics. - - MT_Vector3 m_combined_lin_vel; - MT_Vector3 m_combined_ang_vel; - - // The force and torque are the accumulated forces and torques applied by the client (game logic, python). - - SM_FhObject *m_fh_object; // The ray object used for Fh - bool m_suspended; // Is this object frozen? - - // Mass properties - MT_Scalar m_inv_mass; // 1/mass - MT_Vector3 m_inv_inertia; // [1/inertia_x, 1/inertia_y, 1/inertia_z] - MT_Matrix3x3 m_inv_inertia_tensor; // Inverse Inertia Tensor - - bool m_kinematic; // Have I been displaced (translated, rotated, scaled) in this frame? - bool m_prev_kinematic; // Have I been displaced (translated, rotated, scaled) in the previous frame? - bool m_is_rigid_body; // Should friction give me a change in angular momentum? - int m_static; // temporarily static. - -}; - -#endif - diff --git a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Props.h b/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Props.h deleted file mode 100644 index 81b4cb55b45..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Props.h +++ /dev/null @@ -1,58 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#ifndef SM_PROPSH -#define SM_PROPSH - -#include - -// Properties of dynamic objects -struct SM_ShapeProps { - MT_Scalar m_mass; // Total mass - MT_Scalar m_inertia; // Inertia, should be a tensor some time - MT_Scalar m_lin_drag; // Linear drag (air, water) 0 = concrete, 1 = vacuum - MT_Scalar m_ang_drag; // Angular drag - MT_Scalar m_friction_scaling[3]; // Scaling for anisotropic friction. Component in range [0, 1] - bool m_do_anisotropic; // Should I do anisotropic friction? - bool m_do_fh; // Should the object have a linear Fh spring? - bool m_do_rot_fh; // Should the object have an angular Fh spring? -}; - - -// Properties of collidable objects (non-ghost objects) -struct SM_MaterialProps { - MT_Scalar m_restitution; // restitution of energie after a collision 0 = inelastic, 1 = elastic - MT_Scalar m_friction; // Coulomb friction (= ratio between the normal en maximum friction force) - MT_Scalar m_fh_spring; // Spring constant (both linear and angular) - MT_Scalar m_fh_damping; // Damping factor (linear and angular) in range [0, 1] - MT_Scalar m_fh_distance; // The range above the surface where Fh is active. - bool m_fh_normal; // Should the object slide off slopes? -}; - -#endif //SM_PROPSH - diff --git a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Scene.h b/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Scene.h deleted file mode 100644 index 3d8eef2bae0..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Scene.h +++ /dev/null @@ -1,172 +0,0 @@ -/** - * $Id$ - * Copyright (C) 2001 NaN Technologies B.V. - * The physics scene. - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#ifndef SM_SCENE_H -#define SM_SCENE_H - -#ifdef WIN32 -#pragma warning (disable : 4786) -#endif - -#include -#include -#include //needed for pair - -#include - -#include "MT_Vector3.h" -#include "MT_Point3.h" - -#include "SM_Object.h" - -enum -{ - FH_RESPONSE, - SENSOR_RESPONSE, /* Touch Sensors */ - CAMERA_RESPONSE, /* Visibility Culling */ - OBJECT_RESPONSE, /* Object Dynamic Geometry Response */ - STATIC_RESPONSE, /* Static Geometry Response */ - - NUM_RESPONSE -}; - -class SM_Scene { -public: - SM_Scene(); - - ~SM_Scene(); - - DT_RespTableHandle getRespTableHandle() const { - return m_respTable; - } - - const MT_Vector3& getForceField() const { - return m_forceField; - } - - MT_Vector3& getForceField() { - return m_forceField; - } - - void setForceField(const MT_Vector3& forceField) { - m_forceField = forceField; - } - - void addTouchCallback(int response_class, DT_ResponseCallback callback, void *user); - - void addSensor(SM_Object& object); - void add(SM_Object& object); - void remove(SM_Object& object); - - void notifyCollision(SM_Object *obj1, SM_Object *obj2); - - void setSecondaryRespTable(DT_RespTableHandle secondaryRespTable); - DT_RespTableHandle getSecondaryRespTable() { return m_secondaryRespTable; } - - void requestCollisionCallback(SM_Object &object); - - void beginFrame(); - void endFrame(); - - // Perform an integration step of duration 'timeStep'. - // 'subSampling' is the maximum duration of a substep, i.e., - // The maximum time interval between two collision checks. - // 'subSampling' can be used to control aliasing effects - // (fast moving objects traversing through walls and such). - bool proceed(MT_Scalar curtime, MT_Scalar ticrate); - void proceed(MT_Scalar subStep); - - /** - * Test whether any objects lie on the line defined by from and - * to. The search returns the first such bject starting at from, - * or NULL if there was none. - * @returns A reference to the object, or NULL if there was none. - * @param ignore_client Do not look for collisions with this - * object. This can be useful to avoid self-hits if - * starting from the location of an object. - * @param from The start point, in world coordinates, of the search. - * @param to The end point, in world coordinates, of the search. - * @param result A store to return the point where intersection - * took place (if there was an intersection). - * @param normal A store to return the normal of the hit object on - * the location of the intersection, if it took place. - */ - SM_Object *rayTest(void *ignore_client, - const MT_Point3& from, const MT_Point3& to, - MT_Point3& result, MT_Vector3& normal) const; - -private: - - // Clear the user set velocities. - void clearObjectCombinedVelocities(); - // This is the callback for handling collisions of dynamic objects - static - DT_Bool - boing( - void *client_data, - void *object1, - void *object2, - const DT_CollData *coll_data - ); - - /** internal type */ - typedef std::vector T_ObjectList; - - /** Handle to the scene in SOLID */ - DT_SceneHandle m_scene; - /** Following response table contains the callbacks for the dynmics */ - DT_RespTableHandle m_respTable; - DT_ResponseClass m_ResponseClass[NUM_RESPONSE]; - /** - * Following response table contains callbacks for the client (= - * game engine) */ - DT_RespTableHandle m_secondaryRespTable; // Handle - DT_ResponseClass m_secondaryResponseClass[NUM_RESPONSE]; - - /** - * Following resposne table contains callbacks for fixing the simulation - * ie making sure colliding objects do not intersect. - */ - DT_RespTableHandle m_fixRespTable; - DT_ResponseClass m_fixResponseClass[NUM_RESPONSE]; - - /** The acceleration from the force field */ - MT_Vector3 m_forceField; - - /** - * The list of objects that receive motion updates and do - * collision tests. */ - T_ObjectList m_objectList; - - unsigned int m_frames; -}; - -#endif - diff --git a/source/gameengine/Physics/Sumo/Fuzzics/sample/Makefile b/source/gameengine/Physics/Sumo/Fuzzics/sample/Makefile deleted file mode 100644 index 672dff39028..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/sample/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# -# $Id$ -# Copyright (C) 2001 NaN Technologies B.V. - -DIR = $(OCGDIR)/sumo -ALLTARGETS = $(OBJS) $(DIR)/$(DEBUG_DIR)particle $(DIR)/$(DEBUG_DIR)particle0 - -include nan_compile.mk - -CPPFLAGS = -I../../include -I../include -I$(NAN_MOTO)/include -CPPFLAGS += -I$(OPENGL_HEADERS) - -clean:: - @$(RM) $(DIR)/particle $(DIR)/particle0 - @$(RM) $(DIR)/debug/particle $(DIR)/debug/particle0 - -LDFLAGS = -L$(DIR) -L/usr/X11R6/lib -OGL_LDLIBS = -lglut -lGLU -lGL -pthread -LDLIBS = -lfuzzics -lsolid $(NAN_MOTO)/lib/libmoto.a $(OGL_LDLIBS) - -$(DIR)/$(DEBUG_DIR)particle: particle.o $(DIR)/$(DEBUG_DIR)libfuzzics.a $(DIR)/$(DEBUG_DIR)libsolid.a - $(CCC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) - -$(DIR)/$(DEBUG_DIR)particle0: particle0.o $(DIR)/$(DEBUG_DIR)libfuzzics.a $(DIR)/$(DEBUG_DIR)libsolid.a - $(CCC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) diff --git a/source/gameengine/Physics/Sumo/Fuzzics/sample/particle.cpp b/source/gameengine/Physics/Sumo/Fuzzics/sample/particle.cpp deleted file mode 100644 index d7aca326b42..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/sample/particle.cpp +++ /dev/null @@ -1,709 +0,0 @@ -//#define FAKE_IT -#define USE_COMPLEX -#define QUADS - -#include -#include -#include - -#include "MT_MinMax.h" -#include "MT_Point3.h" -#include "MT_Vector3.h" -#include "MT_Quaternion.h" -#include "MT_Matrix3x3.h" -#include "MT_Transform.h" - -#include "SM_Object.h" -#include "SM_FhObject.h" -#include "SM_Scene.h" - -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -const MT_Scalar bowl_curv = 0.10; -const MT_Scalar timeStep = 0.02; -const MT_Scalar ground_margin = 0.0; -const MT_Scalar sphere_radius = 0.5; - -const MT_Vector3 gravity(0, -9.8, 0); - -static MT_Scalar DISTANCE = 5; - -static MT_Scalar ele = 0, azi = 0; -static MT_Point3 eye(0, 0, DISTANCE); -static MT_Point3 center(0, 0, 0); - -inline double irnd() { return 2 * MT_random() - 1; } - -static const double SCALE_BOTTOM = 0.5; -static const double SCALE_FACTOR = 2.0; - -SM_ShapeProps g_shapeProps = { - 1.0, // mass - 1.0, // inertia - 0.1, // linear drag - 0.1, // angular drag - { 1.0, 0.0, 0.0 }, // anisotropic friction - false, // do anisotropic friction? - true, // do fh? - true // do rot fh? -}; - -SM_MaterialProps g_materialProps = { - 0.7, // restitution - 0.0, // friction - 10.0, // Fh spring constant - 1.0, // Fh damping - 0.5, // Fh distance - true // Fh leveling -}; - - -void toggleIdle(); - - -void newRandom(); - -void coordSystem() { - glDisable(GL_LIGHTING); - glBegin(GL_LINES); - glColor3f(1, 0, 0); - glVertex3d(0, 0, 0); - glVertex3d(10, 0, 0); - glColor3f(0, 1, 0); - glVertex3d(0, 0, 0); - glVertex3d(0, 10, 0); - glColor3f(0, 0, 1); - glVertex3d(0, 0, 0); - glVertex3d(0, 0, 10); - glEnd(); - glEnable(GL_LIGHTING); -} - - -void display_bbox(const MT_Point3& min, const MT_Point3& max) { - glDisable(GL_DEPTH_TEST); - glDisable(GL_LIGHTING); - glColor3f(0, 1, 1); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glBegin(GL_QUAD_STRIP); - glVertex3d(min[0], min[1], min[2]); - glVertex3d(min[0], min[1], max[2]); - glVertex3d(max[0], min[1], min[2]); - glVertex3d(max[0], min[1], max[2]); - glVertex3d(max[0], max[1], min[2]); - glVertex3d(max[0], max[1], max[2]); - glVertex3d(min[0], max[1], min[2]); - glVertex3d(min[0], max[1], max[2]); - glVertex3d(min[0], min[1], min[2]); - glVertex3d(min[0], min[1], max[2]); - glEnd(); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glEnable(GL_LIGHTING); - glEnable(GL_DEPTH_TEST); -} - - - - -class GLShape { -public: - virtual void paint(GLdouble *m) const = 0; -}; - - -class GLSphere : public GLShape { - MT_Scalar radius; -public: - GLSphere(MT_Scalar r) : radius(r) {} - - void paint(GLdouble *m) const { - glPushMatrix(); - glLoadMatrixd(m); - coordSystem(); - glutSolidSphere(radius, 20, 20); - glPopMatrix(); - } -}; - - -class GLBox : public GLShape { - MT_Vector3 extent; -public: - GLBox(MT_Scalar x, MT_Scalar y, MT_Scalar z) : - extent(x, y, z) {} - - void paint(GLdouble *m) const { - glPushMatrix(); - glLoadMatrixd(m); - coordSystem(); - glPushMatrix(); - glScaled(extent[0], extent[1], extent[2]); - glutSolidCube(1.0); - glPopMatrix(); - glPopMatrix(); - } -}; - - -class GLCone : public GLShape { - MT_Scalar bottomRadius; - MT_Scalar height; - mutable GLuint displayList; - -public: - GLCone(MT_Scalar r, MT_Scalar h) : - bottomRadius(r), - height(h), - displayList(0) {} - - void paint(GLdouble *m) const { - glPushMatrix(); - glLoadMatrixd(m); - coordSystem(); - if (displayList) glCallList(displayList); - else { - GLUquadricObj *quadObj = gluNewQuadric(); - displayList = glGenLists(1); - glNewList(displayList, GL_COMPILE_AND_EXECUTE); - glPushMatrix(); - glRotatef(-90.0, 1.0, 0.0, 0.0); - glTranslatef(0.0, 0.0, -1.0); - gluQuadricDrawStyle(quadObj, (GLenum)GLU_FILL); - gluQuadricNormals(quadObj, (GLenum)GLU_SMOOTH); - gluCylinder(quadObj, bottomRadius, 0, height, 15, 10); - glPopMatrix(); - glEndList(); - } - glPopMatrix(); - } -}; - -class GLCylinder : public GLShape { - MT_Scalar radius; - MT_Scalar height; - mutable GLuint displayList; - -public: - GLCylinder(MT_Scalar r, MT_Scalar h) : - radius(r), - height(h), - displayList(0) {} - - void paint(GLdouble *m) const { - glPushMatrix(); - glLoadMatrixd(m); - coordSystem(); - if (displayList) glCallList(displayList); - else { - GLUquadricObj *quadObj = gluNewQuadric(); - displayList = glGenLists(1); - glNewList(displayList, GL_COMPILE_AND_EXECUTE); - glPushMatrix(); - glRotatef(-90.0, 1.0, 0.0, 0.0); - glTranslatef(0.0, 0.0, -1.0); - gluQuadricDrawStyle(quadObj, (GLenum)GLU_FILL); - gluQuadricNormals(quadObj, (GLenum)GLU_SMOOTH); - gluCylinder(quadObj, radius, radius, height, 15, 10); - glPopMatrix (); - glEndList(); - } - glPopMatrix(); - } -}; - -class Object; - -class Callback : public SM_Callback { -public: - Callback(Object& object) : m_object(object) {} - - virtual void do_me(); - -private: - Object& m_object; -}; - - -class Object { -public: - Object(GLShape *gl_shape, SM_Object& object) : - m_gl_shape(gl_shape), - m_object(object), - m_callback(*this) - { - m_object.registerCallback(m_callback); - } - - ~Object() {} - - void paint() { - if (m_gl_shape) { - m_gl_shape->paint(m); - // display_bbox(m_bbox.lower(), m_bbox.upper()); - } - } - - void print_reaction_force() const { - std::cout << m_object.getReactionForce() << std::endl; - } - - MT_Vector3 getAhead() { - return MT_Vector3(&m[4]); - } - - MT_Vector3 getUp() { - return MT_Vector3(&m[8]); - } - - void clearMomentum() { - m_object.clearMomentum(); - } - - void setMargin(MT_Scalar margin) { - m_object.setMargin(margin); - } - - void setScaling(const MT_Vector3& scaling) { - m_object.setScaling(scaling); - } - - const MT_Point3& getPosition() { - return m_object.getPosition(); - } - - void setPosition(const MT_Point3& pos) { - m_object.setPosition(pos); - } - - void setOrientation(const MT_Quaternion& orn) { - m_object.setOrientation(orn); - } - - void applyCenterForce(const MT_Vector3& force) { - m_object.applyCenterForce(force); - } - - void applyTorque(const MT_Vector3& torque) { - m_object.applyTorque(torque); - } - - MT_Point3 getWorldCoord(const MT_Point3& local) const { - return m_object.getWorldCoord(local); - } - - MT_Vector3 getLinearVelocity() const { - return m_object.getLinearVelocity(); - } - - MT_Vector3 getAngularVelocity() const { - return m_object.getAngularVelocity(); - } - - void setMatrix() { - m_object.calcXform(); - m_object.getMatrix(m); - } - - const double *getMatrix() { - m_object.calcXform(); - return m_object.getMatrix(); - } - -private: - GLShape *m_gl_shape; - SM_Object& m_object; - DT_Scalar m[16]; - Callback m_callback; -}; - - - -const MT_Scalar SPACE_SIZE = 2; - -static GLSphere gl_sphere(sphere_radius); -static GLBox gl_ground(50.0, 0.0, 50.0); - - - -#ifdef USE_COMPLEX - -const int GRID_SCALE = 10; -const MT_Scalar GRID_UNIT = 25.0 / GRID_SCALE; - -DT_ShapeHandle createComplex() { - DT_ShapeHandle shape = DT_NewComplexShape(); - for (int i0 = -GRID_SCALE; i0 != GRID_SCALE; ++i0) { - for (int j0 = -GRID_SCALE; j0 != GRID_SCALE; ++j0) { - int i1 = i0 + 1; - int j1 = j0 + 1; -#ifdef QUADS - DT_Begin(); - DT_Vertex(GRID_UNIT * i0, bowl_curv * i0*i0, GRID_UNIT * j0); - DT_Vertex(GRID_UNIT * i0, bowl_curv * i0*i0, GRID_UNIT * j1); - DT_Vertex(GRID_UNIT * i1, bowl_curv * i1*i1, GRID_UNIT * j1); - DT_Vertex(GRID_UNIT * i1, bowl_curv * i1*i1, GRID_UNIT * j0); - DT_End(); -#else - DT_Begin(); - DT_Vertex(GRID_UNIT * i0, 0, GRID_UNIT * j0); - DT_Vertex(GRID_UNIT * i0, 0, GRID_UNIT * j1); - DT_Vertex(GRID_UNIT * i1, 0, GRID_UNIT * j1); - DT_End(); - - DT_Begin(); - DT_Vertex(GRID_UNIT * i0, 0, GRID_UNIT * j1); - DT_Vertex(GRID_UNIT * i1, 0, GRID_UNIT * j1); - DT_Vertex(GRID_UNIT * i1, 0, GRID_UNIT * j0); - DT_End(); -#endif - - } - } - DT_EndComplexShape(); - return shape; -} - - -static DT_ShapeHandle ground_shape = createComplex(); - -#else - -static DT_ShapeHandle ground_shape = DT_Box(50, 0, 50); - -#endif - -static SM_Object sm_ground(ground_shape, &g_materialProps, 0, 0); -static Object ground(&gl_ground, sm_ground); - -static SM_Object sm_sphere(DT_Sphere(0.0), &g_materialProps, &g_shapeProps, 0); -static Object object(&gl_sphere, sm_sphere); - - -static SM_Scene g_scene; - - -bool g_hit = false; -MT_Point3 g_spot; -MT_Vector3 g_normal; - - -void Callback::do_me() -{ - m_object.setMatrix(); - m_object.print_reaction_force(); -} - -void myinit(void) { - - GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 }; - GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; - GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 }; - - /* light_position is NOT default value */ - GLfloat light_position0[] = { 1.0, 1.0, 1.0, 0.0 }; - GLfloat light_position1[] = { -1.0, -1.0, -1.0, 0.0 }; - - glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); - glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); - glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); - glLightfv(GL_LIGHT0, GL_POSITION, light_position0); - - glLightfv(GL_LIGHT1, GL_AMBIENT, light_ambient); - glLightfv(GL_LIGHT1, GL_DIFFUSE, light_diffuse); - glLightfv(GL_LIGHT1, GL_SPECULAR, light_specular); - glLightfv(GL_LIGHT1, GL_POSITION, light_position1); - - - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_LIGHT1); - - glShadeModel(GL_SMOOTH); - - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LESS); - - // glEnable(GL_CULL_FACE); - // glCullFace(GL_BACK); - - ground.setPosition(MT_Point3(0, -10, 0)); - ground.setOrientation(MT_Quaternion(0, 0, 0, 1)); - ground.setMatrix(); - center.setValue(0.0, 0.0, 0.0); - sm_ground.setMargin(ground_margin); - - g_scene.setForceField(gravity); - g_scene.add(sm_ground); - - object.setMargin(sphere_radius); - - g_scene.add(sm_sphere); - - - newRandom(); -} - - -//MT_Point3 cp1, cp2; -//bool intersection; - -void display(void) { - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - ground.paint(); - object.paint(); - - if (g_hit) { - glDisable(GL_LIGHTING); - glColor3f(1, 0, 0); - - glPointSize(5); - glBegin(GL_POINTS); - glVertex3d(g_spot[0], g_spot[1], g_spot[2]); - glEnd(); - glPointSize(1); - - glColor3f(1, 1, 0); - glBegin(GL_LINES); - glVertex3d(g_spot[0], g_spot[1], g_spot[2]); - glVertex3d(g_spot[0] + g_normal[0], - g_spot[1] + g_normal[1], - g_spot[2] + g_normal[2]); - glEnd(); - glEnable(GL_LIGHTING); - } - - - -#ifdef COLLISION - glDisable(GL_DEPTH_TEST); - glDisable(GL_LIGHTING); - glColor3f(1, 1, 0); - if (intersection) { - glPointSize(5); - glBegin(GL_POINTS); - glVertex3d(cp1[0], cp1[1], cp1[2]); - glEnd(); - glPointSize(1); - } - else { - glBegin(GL_LINES); - glVertex3d(cp1[0], cp1[1], cp1[2]); - glVertex3d(cp2[0], cp2[1], cp2[2]); - glEnd(); - } - glEnable(GL_LIGHTING); - glEnable(GL_DEPTH_TEST); -#endif - - glFlush(); - glutSwapBuffers(); -} - - - - - -void newRandom() { - object.setPosition(MT_Point3(0, 0, 0)); - object.setOrientation(MT_Quaternion::random()); - object.clearMomentum(); - object.setMatrix(); - - display(); -} - -void moveAndDisplay() { - g_scene.proceed(timeStep, 0.01); - - display(); - g_hit = false; -} - - -void turn_left() { - object.applyTorque(5.0 * object.getUp()); -} - -void turn_right() { - object.applyTorque(-5.0 * object.getUp()); -} - -void forward() { - object.applyCenterForce(10.0 * object.getAhead()); -} - -void backward() { - object.applyCenterForce(-10.0 * object.getAhead()); -} - -void jump() { - object.applyCenterForce(MT_Vector3(0.0, 200.0, 0.0)); -} - - -void toggleIdle() { - static bool idle = true; - if (idle) { - glutIdleFunc(moveAndDisplay); - idle = false; - } - else { - glutIdleFunc(NULL); - idle = true; - } -} - - -void setCamera() { - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-1.0, 1.0, -1.0, 1.0, 1.0, 200.0); - MT_Scalar rele = MT_radians(ele); - MT_Scalar razi = MT_radians(azi); - eye.setValue(DISTANCE * sin(razi) * cos(rele), - DISTANCE * sin(rele), - DISTANCE * cos(razi) * cos(rele)); - gluLookAt(eye[0], eye[1], eye[2], - center[0], center[1], center[2], - 0, 1, 0); - glMatrixMode(GL_MODELVIEW); - display(); -} - -const MT_Scalar STEPSIZE = 5; - -void stepLeft() { azi -= STEPSIZE; if (azi < 0) azi += 360; setCamera(); } -void stepRight() { azi += STEPSIZE; if (azi >= 360) azi -= 360; setCamera(); } -void stepFront() { ele += STEPSIZE; if (azi >= 360) azi -= 360; setCamera(); } -void stepBack() { ele -= STEPSIZE; if (azi < 0) azi += 360; setCamera(); } -void zoomIn() { DISTANCE -= 1; setCamera(); } -void zoomOut() { DISTANCE += 1; setCamera(); } - - -void myReshape(int w, int h) { - glViewport(0, 0, w, h); - setCamera(); -} - -void myKeyboard(unsigned char key, int x, int y) -{ - switch (key) - { - case 'w': forward(); break; - case 's': backward(); break; - case 'a': turn_left(); break; - case 'd': turn_right(); break; - case 'e': jump(); break; - case 'l' : stepLeft(); break; - case 'r' : stepRight(); break; - case 'f' : stepFront(); break; - case 'b' : stepBack(); break; - case 'z' : zoomIn(); break; - case 'x' : zoomOut(); break; - case 'i' : toggleIdle(); break; - case ' ' : newRandom(); break; - default: -// std::cout << "unused key : " << key << std::endl; - break; - } -} - -void mySpecial(int key, int x, int y) -{ - switch (key) - { - case GLUT_KEY_LEFT : stepLeft(); break; - case GLUT_KEY_RIGHT : stepRight(); break; - case GLUT_KEY_UP : stepFront(); break; - case GLUT_KEY_DOWN : stepBack(); break; - case GLUT_KEY_PAGE_UP : zoomIn(); break; - case GLUT_KEY_PAGE_DOWN : zoomOut(); break; - case GLUT_KEY_HOME : toggleIdle(); break; - default: -// std::cout << "unused (special) key : " << key << std::endl; - break; - } -} - -void goodbye( void) -{ - g_scene.remove(sm_ground); - g_scene.remove(sm_sphere); - - std::cout << "goodbye ..." << std::endl; - exit(0); -} - -void menu(int choice) -{ - - static int fullScreen = 0; - static int px, py, sx, sy; - - switch(choice) { - case 1: - if (fullScreen == 1) { - glutPositionWindow(px,py); - glutReshapeWindow(sx,sy); - glutChangeToMenuEntry(1,"Full Screen",1); - fullScreen = 0; - } else { - px=glutGet((GLenum)GLUT_WINDOW_X); - py=glutGet((GLenum)GLUT_WINDOW_Y); - sx=glutGet((GLenum)GLUT_WINDOW_WIDTH); - sy=glutGet((GLenum)GLUT_WINDOW_HEIGHT); - glutFullScreen(); - glutChangeToMenuEntry(1,"Close Full Screen",1); - fullScreen = 1; - } - break; - case 2: - toggleIdle(); - break; - case 3: - goodbye(); - break; - default: - break; - } -} - -void createMenu() -{ - glutCreateMenu(menu); - glutAddMenuEntry("Full Screen", 1); - glutAddMenuEntry("Toggle Idle (Start/Stop)", 2); - glutAddMenuEntry("Quit", 3); - glutAttachMenu(GLUT_RIGHT_BUTTON); -} - -int main(int argc, char **argv) { - glutInit(&argc, argv); - glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); - glutInitWindowPosition(0, 0); - glutInitWindowSize(500, 500); - glutCreateWindow("Physics demo"); - - myinit(); - glutKeyboardFunc(myKeyboard); - glutSpecialFunc(mySpecial); - glutReshapeFunc(myReshape); - createMenu(); - glutIdleFunc(NULL); - - glutDisplayFunc(display); - glutMainLoop(); - return 0; -} - - - - - - - diff --git a/source/gameengine/Physics/Sumo/Fuzzics/sample/particle0.cpp b/source/gameengine/Physics/Sumo/Fuzzics/sample/particle0.cpp deleted file mode 100644 index cdf0a2d8f64..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/sample/particle0.cpp +++ /dev/null @@ -1,695 +0,0 @@ -//#define FAKE_IT -#define USE_COMPLEX -#define QUADS - -#include -#include -#include - -#include "MT_MinMax.h" -#include "MT_Point3.h" -#include "MT_Vector3.h" -#include "MT_Quaternion.h" -#include "MT_Matrix3x3.h" -#include "MT_Transform.h" - -#include "SM_Object.h" -#include "SM_Scene.h" - -#include "solid.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -const MT_Scalar bowl_curv = 0.10; -const MT_Scalar timeStep = 0.04; -const MT_Scalar ground_margin = 0.0; -const MT_Scalar sphere_radius = 0.5; - -const MT_Vector3 gravity(0, -9.8, 0); - -static MT_Scalar DISTANCE = 5; - -static MT_Scalar ele = 0, azi = 0; -static MT_Point3 eye(0, 0, DISTANCE); -static MT_Point3 center(0, 0, 0); - -inline double irnd() { return 2 * MT_random() - 1; } - -static const double SCALE_BOTTOM = 0.5; -static const double SCALE_FACTOR = 2.0; - -SM_ShapeProps g_shapeProps = { - 1.0, // mass - 1.0, // inertia - 0.9, // linear drag - 0.9 // angular drag -}; - -SM_MaterialProps g_materialProps = { - 0.7, // restitution - 0.0, // friction - 0.0, // spring constant - 0.0 // damping -}; - - -void toggleIdle(); - - -void newRandom(); - -void coordSystem() { - glDisable(GL_LIGHTING); - glBegin(GL_LINES); - glColor3f(1, 0, 0); - glVertex3d(0, 0, 0); - glVertex3d(10, 0, 0); - glColor3f(0, 1, 0); - glVertex3d(0, 0, 0); - glVertex3d(0, 10, 0); - glColor3f(0, 0, 1); - glVertex3d(0, 0, 0); - glVertex3d(0, 0, 10); - glEnd(); - glEnable(GL_LIGHTING); -} - - -void display_bbox(const MT_Point3& min, const MT_Point3& max) { - glDisable(GL_DEPTH_TEST); - glDisable(GL_LIGHTING); - glColor3f(0, 1, 1); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glBegin(GL_QUAD_STRIP); - glVertex3d(min[0], min[1], min[2]); - glVertex3d(min[0], min[1], max[2]); - glVertex3d(max[0], min[1], min[2]); - glVertex3d(max[0], min[1], max[2]); - glVertex3d(max[0], max[1], min[2]); - glVertex3d(max[0], max[1], max[2]); - glVertex3d(min[0], max[1], min[2]); - glVertex3d(min[0], max[1], max[2]); - glVertex3d(min[0], min[1], min[2]); - glVertex3d(min[0], min[1], max[2]); - glEnd(); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glEnable(GL_LIGHTING); - glEnable(GL_DEPTH_TEST); -} - - - - -class GLShape { -public: - virtual void paint(GLdouble *m) const = 0; -}; - - -class GLSphere : public GLShape { - MT_Scalar radius; -public: - GLSphere(MT_Scalar r) : radius(r) {} - - void paint(GLdouble *m) const { - glPushMatrix(); - glLoadMatrixd(m); - coordSystem(); - glutSolidSphere(radius, 20, 20); - glPopMatrix(); - } -}; - - -class GLBox : public GLShape { - MT_Vector3 extent; -public: - GLBox(MT_Scalar x, MT_Scalar y, MT_Scalar z) : - extent(x, y, z) {} - - void paint(GLdouble *m) const { - glPushMatrix(); - glLoadMatrixd(m); - coordSystem(); - glPushMatrix(); - glScaled(extent[0], extent[1], extent[2]); - glutSolidCube(1.0); - glPopMatrix(); - glPopMatrix(); - } -}; - - -class GLCone : public GLShape { - MT_Scalar bottomRadius; - MT_Scalar height; - mutable GLuint displayList; - -public: - GLCone(MT_Scalar r, MT_Scalar h) : - bottomRadius(r), - height(h), - displayList(0) {} - - void paint(GLdouble *m) const { - glPushMatrix(); - glLoadMatrixd(m); - coordSystem(); - if (displayList) glCallList(displayList); - else { - GLUquadricObj *quadObj = gluNewQuadric(); - displayList = glGenLists(1); - glNewList(displayList, GL_COMPILE_AND_EXECUTE); - glPushMatrix(); - glRotatef(-90.0, 1.0, 0.0, 0.0); - glTranslatef(0.0, 0.0, -1.0); - gluQuadricDrawStyle(quadObj, (GLenum)GLU_FILL); - gluQuadricNormals(quadObj, (GLenum)GLU_SMOOTH); - gluCylinder(quadObj, bottomRadius, 0, height, 15, 10); - glPopMatrix(); - glEndList(); - } - glPopMatrix(); - } -}; - -class GLCylinder : public GLShape { - MT_Scalar radius; - MT_Scalar height; - mutable GLuint displayList; - -public: - GLCylinder(MT_Scalar r, MT_Scalar h) : - radius(r), - height(h), - displayList(0) {} - - void paint(GLdouble *m) const { - glPushMatrix(); - glLoadMatrixd(m); - coordSystem(); - if (displayList) glCallList(displayList); - else { - GLUquadricObj *quadObj = gluNewQuadric(); - displayList = glGenLists(1); - glNewList(displayList, GL_COMPILE_AND_EXECUTE); - glPushMatrix(); - glRotatef(-90.0, 1.0, 0.0, 0.0); - glTranslatef(0.0, 0.0, -1.0); - gluQuadricDrawStyle(quadObj, (GLenum)GLU_FILL); - gluQuadricNormals(quadObj, (GLenum)GLU_SMOOTH); - gluCylinder(quadObj, radius, radius, height, 15, 10); - glPopMatrix (); - glEndList(); - } - glPopMatrix(); - } -}; - -class Object; - -class Callback : public SM_Callback { -public: - Callback(Object& object) : m_object(object) {} - - virtual void do_me(); - -private: - Object& m_object; -}; - - -class Object { -public: - Object(GLShape *gl_shape, SM_Object& object) : - m_gl_shape(gl_shape), - m_object(object), - m_callback(*this) - { - m_object.registerCallback(m_callback); - } - - ~Object() {} - - void paint() { - m_gl_shape->paint(m); - // display_bbox(m_bbox.lower(), m_bbox.upper()); - } - - MT_Vector3 getAhead() { - return MT_Vector3(-m[8], -m[9], -m[10]); - } - - void clearMomentum() { - m_object.clearMomentum(); - } - - void setMargin(MT_Scalar margin) { - m_object.setMargin(margin); - } - - void setScaling(const MT_Vector3& scaling) { - m_object.setScaling(scaling); - } - - void setPosition(const MT_Point3& pos) { - m_object.setPosition(pos); - } - - void setOrientation(const MT_Quaternion& orn) { - m_object.setOrientation(orn); - } - - void applyCenterForce(const MT_Vector3& force) { - m_object.applyCenterForce(force); - } - - void applyTorque(const MT_Vector3& torque) { - m_object.applyTorque(torque); - } - - MT_Point3 getWorldCoord(const MT_Point3& local) const { - return m_object.getWorldCoord(local); - } - - MT_Vector3 getLinearVelocity() const { - return m_object.getLinearVelocity(); - } - - void setMatrix() { - m_object.getMatrix(m); - } - -private: - GLShape *m_gl_shape; - SM_Object& m_object; - DT_Scalar m[16]; - Callback m_callback; -}; - - -void Callback::do_me() -{ - m_object.setMatrix(); -} - - -const MT_Scalar SPACE_SIZE = 2; - -static GLSphere gl_sphere(sphere_radius); -static GLBox gl_ground(50.0, 0.0, 50.0); - - - -#ifdef USE_COMPLEX - -const int GRID_SCALE = 10; -const MT_Scalar GRID_UNIT = 25.0 / GRID_SCALE; - -DT_ShapeHandle createComplex() { - DT_ShapeHandle shape = DT_NewComplexShape(); - for (int i0 = -GRID_SCALE; i0 != GRID_SCALE; ++i0) { - for (int j0 = -GRID_SCALE; j0 != GRID_SCALE; ++j0) { - int i1 = i0 + 1; - int j1 = j0 + 1; -#ifdef QUADS - DT_Begin(); - DT_Vertex(GRID_UNIT * i0, bowl_curv * i0*i0, GRID_UNIT * j0); - DT_Vertex(GRID_UNIT * i0, bowl_curv * i0*i0, GRID_UNIT * j1); - DT_Vertex(GRID_UNIT * i1, bowl_curv * i1*i1, GRID_UNIT * j1); - DT_Vertex(GRID_UNIT * i1, bowl_curv * i1*i1, GRID_UNIT * j0); - DT_End(); -#else - DT_Begin(); - DT_Vertex(GRID_UNIT * i0, 0, GRID_UNIT * j0); - DT_Vertex(GRID_UNIT * i0, 0, GRID_UNIT * j1); - DT_Vertex(GRID_UNIT * i1, 0, GRID_UNIT * j1); - DT_End(); - - DT_Begin(); - DT_Vertex(GRID_UNIT * i0, 0, GRID_UNIT * j1); - DT_Vertex(GRID_UNIT * i1, 0, GRID_UNIT * j1); - DT_Vertex(GRID_UNIT * i1, 0, GRID_UNIT * j0); - DT_End(); -#endif - - } - } - DT_EndComplexShape(); - return shape; -} - - -static DT_ShapeHandle ground_shape = createComplex(); - -#else - -static DT_ShapeHandle ground_shape = DT_Box(50, 0, 50); - -#endif - -static SM_Object sm_ground(ground_shape, &g_materialProps, 0, 0); -static Object ground(&gl_ground, sm_ground); - -static SM_Object sm_sphere(DT_Sphere(0.0), &g_materialProps, &g_shapeProps, 0); -static Object object(&gl_sphere, sm_sphere); - - -static SM_Object sm_ray(DT_Ray(0.0, -1.0, 0.0), 0, 0, 0); - -static SM_Scene g_scene; - - -void myinit(void) { - - GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 }; - GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; - GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 }; - - /* light_position is NOT default value */ - GLfloat light_position0[] = { 1.0, 1.0, 1.0, 0.0 }; - GLfloat light_position1[] = { -1.0, -1.0, -1.0, 0.0 }; - - glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); - glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); - glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); - glLightfv(GL_LIGHT0, GL_POSITION, light_position0); - - glLightfv(GL_LIGHT1, GL_AMBIENT, light_ambient); - glLightfv(GL_LIGHT1, GL_DIFFUSE, light_diffuse); - glLightfv(GL_LIGHT1, GL_SPECULAR, light_specular); - glLightfv(GL_LIGHT1, GL_POSITION, light_position1); - - - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_LIGHT1); - - glShadeModel(GL_SMOOTH); - - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LESS); - - // glEnable(GL_CULL_FACE); - // glCullFace(GL_BACK); - - g_scene.setForceField(gravity); - g_scene.add(sm_ground); - sm_ground.setMargin(ground_margin); - - new(&object) Object(&gl_sphere, sm_sphere); - - - object.setMargin(sphere_radius); - - g_scene.add(sm_sphere); - - ground.setPosition(MT_Point3(0, -10, 0)); - ground.setOrientation(MT_Quaternion(0, 0, 0, 1)); - ground.setMatrix(); - center.setValue(0.0, 0.0, 0.0); - - newRandom(); -} - - -//MT_Point3 cp1, cp2; -//bool intersection; - -bool g_hit = false; -MT_Point3 g_spot; -MT_Vector3 g_normal; - - -void display(void) { - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - ground.paint(); - object.paint(); - - if (g_hit) { - glPointSize(5); - glBegin(GL_POINTS); - glVertex3d(g_spot[0], g_spot[1], g_spot[2]); - glEnd(); - glPointSize(1); - } - - - -#ifdef COLLISION - glDisable(GL_DEPTH_TEST); - glDisable(GL_LIGHTING); - glColor3f(1, 1, 0); - if (intersection) { - glPointSize(5); - glBegin(GL_POINTS); - glVertex3d(cp1[0], cp1[1], cp1[2]); - glEnd(); - glPointSize(1); - } - else { - glBegin(GL_LINES); - glVertex3d(cp1[0], cp1[1], cp1[2]); - glVertex3d(cp2[0], cp2[1], cp2[2]); - glEnd(); - } - glEnable(GL_LIGHTING); - glEnable(GL_DEPTH_TEST); -#endif - - glFlush(); - glutSwapBuffers(); -} - - - - - -void newRandom() { - object.setPosition(MT_Point3(0, 0, 0)); - object.clearMomentum(); - object.setMatrix(); - - display(); -} - -void moveAndDisplay() { - g_scene.proceed(timeStep, 0.01); - - MT_Vector3 normal(0, 1, 0); - - MT_Point3 from = object.getWorldCoord(MT_Point3(0, 0, 0)); - MT_Point3 to = from - normal * 10.0; - - g_hit = DT_ObjectRayTest(sm_ground.getObjectHandle(), - from.getValue(), - to.getValue(), g_spot.getValue(), - g_normal.getValue()); - - // Scrap -#define DO_FH -#ifdef DO_FH - MT_Scalar dist = MT_distance(from, g_spot); - if (dist < 5.0) { - MT_Vector3 lin_vel = object.getLinearVelocity(); - MT_Scalar lin_vel_normal = lin_vel.dot(normal); - - MT_Scalar spring_extent = dist + lin_vel_normal * (timeStep * 0.5); - - MT_Scalar f_spring = (5.0 - spring_extent) * 3.0; - object.applyCenterForce(normal * f_spring); - object.applyCenterForce(-lin_vel_normal * normal); - } - -#endif - - - display(); -} - - -void turn_left() { - object.applyTorque(MT_Vector3(0.0, 10.0, 0.0)); -} - -void turn_right() { - object.applyTorque(MT_Vector3(0.0, -10.0, 0.0)); -} - -void forward() { - object.applyCenterForce(20.0 * object.getAhead()); -} - -void backward() { - object.applyCenterForce(-20.0 * object.getAhead()); -} - -void jump() { - object.applyCenterForce(MT_Vector3(0.0, 200.0, 0.0)); -} - - -void toggleIdle() { - static bool idle = true; - if (idle) { - glutIdleFunc(moveAndDisplay); - idle = false; - } - else { - glutIdleFunc(NULL); - idle = true; - } -} - - -void setCamera() { - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-1.0, 1.0, -1.0, 1.0, 1.0, 200.0); - MT_Scalar rele = MT_radians(ele); - MT_Scalar razi = MT_radians(azi); - eye.setValue(DISTANCE * sin(razi) * cos(rele), - DISTANCE * sin(rele), - DISTANCE * cos(razi) * cos(rele)); - gluLookAt(eye[0], eye[1], eye[2], - center[0], center[1], center[2], - 0, 1, 0); - glMatrixMode(GL_MODELVIEW); - display(); -} - -const MT_Scalar STEPSIZE = 5; - -void stepLeft() { azi -= STEPSIZE; if (azi < 0) azi += 360; setCamera(); } -void stepRight() { azi += STEPSIZE; if (azi >= 360) azi -= 360; setCamera(); } -void stepFront() { ele += STEPSIZE; if (azi >= 360) azi -= 360; setCamera(); } -void stepBack() { ele -= STEPSIZE; if (azi < 0) azi += 360; setCamera(); } -void zoomIn() { DISTANCE -= 1; setCamera(); } -void zoomOut() { DISTANCE += 1; setCamera(); } - - -void myReshape(int w, int h) { - glViewport(0, 0, w, h); - setCamera(); -} - -void myKeyboard(unsigned char key, int x, int y) -{ - switch (key) - { - case 'w': forward(); break; - case 's': backward(); break; - case 'a': turn_left(); break; - case 'd': turn_right(); break; - case 'e': jump(); break; - case 'l' : stepLeft(); break; - case 'r' : stepRight(); break; - case 'f' : stepFront(); break; - case 'b' : stepBack(); break; - case 'z' : zoomIn(); break; - case 'x' : zoomOut(); break; - case 'i' : toggleIdle(); break; - case ' ' : newRandom(); break; - default: -// std::cout << "unused key : " << key << std::endl; - break; - } -} - -void mySpecial(int key, int x, int y) -{ - switch (key) - { - case GLUT_KEY_LEFT : stepLeft(); break; - case GLUT_KEY_RIGHT : stepRight(); break; - case GLUT_KEY_UP : stepFront(); break; - case GLUT_KEY_DOWN : stepBack(); break; - case GLUT_KEY_PAGE_UP : zoomIn(); break; - case GLUT_KEY_PAGE_DOWN : zoomOut(); break; - case GLUT_KEY_HOME : toggleIdle(); break; - default: -// std::cout << "unused (special) key : " << key << std::endl; - break; - } -} - -void goodbye( void) -{ - g_scene.remove(sm_ground); - g_scene.remove(sm_sphere); - - std::cout << "goodbye ..." << std::endl; - exit(0); -} - -void menu(int choice) -{ - - static int fullScreen = 0; - static int px, py, sx, sy; - - switch(choice) { - case 1: - if (fullScreen == 1) { - glutPositionWindow(px,py); - glutReshapeWindow(sx,sy); - glutChangeToMenuEntry(1,"Full Screen",1); - fullScreen = 0; - } else { - px=glutGet((GLenum)GLUT_WINDOW_X); - py=glutGet((GLenum)GLUT_WINDOW_Y); - sx=glutGet((GLenum)GLUT_WINDOW_WIDTH); - sy=glutGet((GLenum)GLUT_WINDOW_HEIGHT); - glutFullScreen(); - glutChangeToMenuEntry(1,"Close Full Screen",1); - fullScreen = 1; - } - break; - case 2: - toggleIdle(); - break; - case 3: - goodbye(); - break; - default: - break; - } -} - -void createMenu() -{ - glutCreateMenu(menu); - glutAddMenuEntry("Full Screen", 1); - glutAddMenuEntry("Toggle Idle (Start/Stop)", 2); - glutAddMenuEntry("Quit", 3); - glutAttachMenu(GLUT_RIGHT_BUTTON); -} - -int main(int argc, char **argv) { - glutInit(&argc, argv); - glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); - glutInitWindowPosition(0, 0); - glutInitWindowSize(500, 500); - glutCreateWindow("Physics demo"); - - myinit(); - glutKeyboardFunc(myKeyboard); - glutSpecialFunc(mySpecial); - glutReshapeFunc(myReshape); - createMenu(); - glutIdleFunc(NULL); - - glutDisplayFunc(display); - glutMainLoop(); - return 0; -} - - - - - - - diff --git a/source/gameengine/Physics/Sumo/Fuzzics/src/Makefile b/source/gameengine/Physics/Sumo/Fuzzics/src/Makefile deleted file mode 100644 index b2744c5496a..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/src/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# -# $Id$ -# Copyright (C) 2001 NaN Technologies B.V. - -LIBNAME = fuzzics -DIR = $(OCGDIR)/gameengine/blphys/$(LIBNAME) - -include nan_compile.mk - -CCFLAGS += $(LEVEL_1_CPP_WARNINGS) - -CPPFLAGS += -I../include -I$(NAN_MOTO)/include -I../../include -CPPFLAGS += -I$(NAN_SOLID)/include - diff --git a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_FhObject.cpp b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_FhObject.cpp deleted file mode 100644 index d866cdb4922..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_FhObject.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#include "SM_FhObject.h" -#include "MT_MinMax.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -SM_FhObject::SM_FhObject(DT_ShapeHandle rayshape, MT_Vector3 ray, SM_Object *parent_object) : - SM_Object(rayshape, NULL, NULL, NULL), - m_ray(ray), - m_ray_direction(ray.normalized()), - m_parent_object(parent_object) -{ -} - -SM_FhObject::~SM_FhObject() -{ - DT_DeleteShape(getShapeHandle()); -} - -DT_Bool SM_FhObject::ray_hit(void *client_data, - void *client_object1, - void *client_object2, - const DT_CollData *coll_data) -{ - - SM_FhObject *fh_object = dynamic_cast((SM_Object *)client_object2); - if (!fh_object) - { - std::swap(client_object1, client_object2); - fh_object = dynamic_cast((SM_Object *)client_object2); - } - - SM_Object *hit_object = (SM_Object *)client_object1; - const SM_MaterialProps *matProps = hit_object->getMaterialProps(); - - if ((matProps == 0) || (matProps->m_fh_distance < MT_EPSILON)) { - return DT_CONTINUE; - } - - SM_Object *cl_object = fh_object->getParentObject(); - - assert(fh_object); - - if (hit_object == cl_object) { - // Shot myself in the foot... - return DT_CONTINUE; - } - - const SM_ShapeProps *shapeProps = cl_object->getShapeProps(); - - // Exit if the client object is not dynamic. - if (shapeProps == 0) { - return DT_CONTINUE; - } - - MT_Point3 lspot; - MT_Vector3 normal; - - DT_Vector3 from, to, dnormal; - DT_Scalar dlspot; - fh_object->getPosition().getValue(from); - fh_object->getSpot().getValue(to); - - - if (DT_ObjectRayCast(hit_object->getObjectHandle(), - from, - to, - 1., - &dlspot, - dnormal)) { - - lspot = fh_object->getPosition() + (fh_object->getSpot() - fh_object->getPosition()) * dlspot; - const MT_Vector3& ray_dir = fh_object->getRayDirection(); - MT_Scalar dist = MT_distance(fh_object->getPosition(), lspot) - - cl_object->getMargin() - shapeProps->m_radius; - - normal = MT_Vector3(dnormal).safe_normalized(); - - if (dist < matProps->m_fh_distance) { - - if (shapeProps->m_do_fh) { - lspot -= hit_object->getPosition(); - MT_Vector3 rel_vel = cl_object->getLinearVelocity() - hit_object->getVelocity(lspot); - MT_Scalar rel_vel_ray = ray_dir.dot(rel_vel); - MT_Scalar spring_extent = 1.0 - dist / matProps->m_fh_distance; - - MT_Scalar i_spring = spring_extent * matProps->m_fh_spring; - MT_Scalar i_damp = rel_vel_ray * matProps->m_fh_damping; - - cl_object->addLinearVelocity(-(i_spring + i_damp) * ray_dir); - if (matProps->m_fh_normal) { - cl_object->addLinearVelocity( - (i_spring + i_damp) * - (normal - normal.dot(ray_dir) * ray_dir)); - } - - MT_Vector3 lateral = rel_vel - rel_vel_ray * ray_dir; - const SM_ShapeProps *shapeProps = cl_object->getShapeProps(); - - if (shapeProps->m_do_anisotropic) { - MT_Matrix3x3 lcs(cl_object->getOrientation()); - MT_Vector3 loc_lateral = lateral * lcs; - const MT_Vector3& friction_scaling = - shapeProps->m_friction_scaling; - - loc_lateral.scale(friction_scaling[0], - friction_scaling[1], - friction_scaling[2]); - lateral = lcs * loc_lateral; - } - - - MT_Scalar rel_vel_lateral = lateral.length(); - - if (rel_vel_lateral > MT_EPSILON) { - MT_Scalar friction_factor = matProps->m_friction; - MT_Scalar max_friction = friction_factor * MT_max(MT_Scalar(0.0), i_spring); - - MT_Scalar rel_mom_lateral = rel_vel_lateral / - cl_object->getInvMass(); - - MT_Vector3 friction = - (rel_mom_lateral > max_friction) ? - -lateral * (max_friction / rel_vel_lateral) : - -lateral; - - cl_object->applyCenterImpulse(friction); - } - } - - if (shapeProps->m_do_rot_fh) { - const double *ogl_mat = cl_object->getMatrix(); - MT_Vector3 up(&ogl_mat[8]); - MT_Vector3 t_spring = up.cross(normal) * matProps->m_fh_spring; - MT_Vector3 ang_vel = cl_object->getAngularVelocity(); - - // only rotations that tilt relative to the normal are damped - ang_vel -= ang_vel.dot(normal) * normal; - - MT_Vector3 t_damp = ang_vel * matProps->m_fh_damping; - - cl_object->addAngularVelocity(t_spring - t_damp); - } - } - } - - return DT_CONTINUE; -} - - - diff --git a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_MotionState.cpp b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_MotionState.cpp deleted file mode 100644 index b8f4e0c591c..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_MotionState.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#include -#include -#include - -#include "SM_MotionState.h" - -void SM_MotionState::integrateMidpoint(MT_Scalar timeStep, const SM_MotionState &prev_state, const MT_Vector3 &velocity, const MT_Quaternion& ang_vel) -{ - m_pos += (prev_state.getLinearVelocity() + velocity) * (timeStep * 0.5); - m_orn += (prev_state.getAngularVelocity() * prev_state.getOrientation() + ang_vel * m_orn) * (timeStep * 0.25); - m_orn.normalize(); -} - -void SM_MotionState::integrateBackward(MT_Scalar timeStep, const MT_Vector3 &velocity, const MT_Quaternion& ang_vel) -{ - m_pos += velocity * timeStep; - m_orn += ang_vel * m_orn * (timeStep * 0.5); - m_orn.normalize(); -} - -void SM_MotionState::integrateForward(MT_Scalar timeStep, const SM_MotionState &prev_state) -{ - m_pos += prev_state.getLinearVelocity() * timeStep; - m_orn += prev_state.getAngularVelocity() * m_orn * (timeStep * 0.5); - m_orn.normalize(); -} - -/* -// Newtonian lerp: interpolate based on Newtonian motion -void SM_MotionState::nlerp(const SM_MotionState &prev, const SM_MotionState &next) -{ - MT_Scalar dt = next.getTime() - prev.getTime(); - MT_Scalar t = getTime() - prev.getTime(); - MT_Vector3 dx = next.getPosition() - prev.getPosition(); - MT_Vector3 a = dx/(dt*dt) - prev.getLinearVelocity()/dt; - - m_pos = prev.getPosition() + prev.getLinearVelocity()*t + a*t*t; -} -*/ - -void SM_MotionState::lerp(const SM_MotionState &prev, const SM_MotionState &next) -{ - MT_Scalar dt = next.getTime() - prev.getTime(); - if (MT_fuzzyZero(dt)) - { - *this = next; - return; - } - - MT_Scalar x = (getTime() - prev.getTime())/dt; - - m_pos = x*next.getPosition() + (1-x)*prev.getPosition(); - - m_orn = prev.getOrientation().slerp(next.getOrientation(), 1-x); - - m_lin_vel = x*next.getLinearVelocity() + (1-x)*prev.getLinearVelocity(); - m_ang_vel = x*next.getAngularVelocity() + (1-x)*prev.getAngularVelocity(); -} - -void SM_MotionState::lerp(MT_Scalar t, const SM_MotionState &other) -{ - MT_Scalar x = (t - getTime())/(other.getTime() - getTime()); - m_pos = (1-x)*m_pos + x*other.getPosition(); - - m_orn = other.getOrientation().slerp(m_orn, x); - - m_lin_vel = (1-x)*m_lin_vel + x*other.getLinearVelocity(); - m_ang_vel = (1-x)*m_ang_vel + x*other.getAngularVelocity(); - - m_time = t; -} - diff --git a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Object.cpp b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Object.cpp deleted file mode 100644 index 4b2c7cae008..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Object.cpp +++ /dev/null @@ -1,1298 +0,0 @@ -/** - * $Id$ - * Copyright (C) 2001 NaN Technologies B.V. - * The basic physics object. - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef WIN32 -// This warning tells us about truncation of __long__ stl-generated names. -// It can occasionally cause DevStudio to have internal compiler warnings. -#pragma warning( disable : 4786 ) -#endif - -#include "MT_assert.h" - -#include "SM_Object.h" -#include "SM_Scene.h" -#include "SM_FhObject.h" -#include "SM_Debug.h" - -#include "MT_MinMax.h" - -MT_Scalar SM_Object::ImpulseThreshold = -1.0; - -struct Contact -{ - SM_Object *obj1; - SM_Object *obj2; - MT_Vector3 normal; - MT_Point3 pos; - - // Sort objects by height - bool operator()(const Contact *a, const Contact *b) - { - return a->pos[2] < b->pos[2]; - } - - Contact(SM_Object *o1, SM_Object *o2, const MT_Vector3 nor, const MT_Point3 p) - : obj1(o1), - obj2(o2), - normal(nor), - pos(p) - { - } - - Contact() - { - } - - void resolve() - { - if (obj1->m_static || obj2->m_static) - { - if (obj1->isDynamic()) - { - if (obj1->m_static && obj2->m_static) - { - if (obj1->m_static < obj2->m_static) - { - obj2->m_error -= normal; - obj2->m_static = obj1->m_static + 1; - } - else - { - obj1->m_error += normal; - obj1->m_static = obj2->m_static + 1; - } - } - else - { - if (obj1->m_static) - { - obj2->m_error -= normal; - obj2->m_static = obj1->m_static + 1; - } - else - { - obj1->m_error += normal; - obj1->m_static = obj2->m_static + 1; - } - } - } - else - { - obj2->m_error -= normal; - obj2->m_static = 1; - } - } - else - { - // This distinction between dynamic and non-dynamic objects should not be - // necessary. Non-dynamic objects are assumed to have infinite mass. - if (obj1->isDynamic()) { - MT_Vector3 error = normal * 0.5f; - obj1->m_error += error; - obj2->m_error -= error; - } - else { - // Same again but now obj1 is non-dynamic - obj2->m_error -= normal; - obj2->m_static = obj1->m_static + 1; - } - } - - } - - - typedef std::set Set; -}; - -static Contact::Set contacts; - -SM_Object::SM_Object( - DT_ShapeHandle shape, - const SM_MaterialProps *materialProps, - const SM_ShapeProps *shapeProps, - SM_Object *dynamicParent) : - - m_dynamicParent(dynamicParent), - m_client_object(0), - m_physicsClientObject(0), - m_shape(shape), - m_materialProps(materialProps), - m_materialPropsBackup(0), - m_shapeProps(shapeProps), - m_shapePropsBackup(0), - m_margin(0.0), - m_scaling(1.0, 1.0, 1.0), - m_reaction_impulse(0.0, 0.0, 0.0), - m_reaction_force(0.0, 0.0, 0.0), - m_lin_mom(0.0, 0.0, 0.0), - m_ang_mom(0.0, 0.0, 0.0), - m_force(0.0, 0.0, 0.0), - m_torque(0.0, 0.0, 0.0), - m_error(0.0, 0.0, 0.0), - m_combined_lin_vel (0.0, 0.0, 0.0), - m_combined_ang_vel (0.0, 0.0, 0.0), - m_fh_object(0), - m_inv_mass(0.0), - m_inv_inertia(0., 0., 0.), - m_kinematic(false), - m_prev_kinematic(false), - m_is_rigid_body(false), - m_static(0) -{ - m_object = DT_CreateObject(this, shape); - m_xform.setIdentity(); - m_xform.getValue(m_ogl_matrix); - if (shapeProps) - { - if (shapeProps->m_do_fh || shapeProps->m_do_rot_fh) - { - DT_Vector3 zero = {0., 0., 0.}, ray = {0.0, 0.0, -10.0}; - m_fh_object = new SM_FhObject(DT_NewLineSegment(zero, ray), MT_Vector3(ray), this); - //printf("SM_Object:: WARNING! fh disabled.\n"); - } - m_inv_mass = 1. / shapeProps->m_mass; - m_inv_inertia = MT_Vector3(1./shapeProps->m_inertia[0], 1./shapeProps->m_inertia[1], 1./shapeProps->m_inertia[2]); - } - updateInvInertiaTensor(); - m_suspended = false; -} - - - void -SM_Object:: -integrateForces( - MT_Scalar timeStep -){ - if (!m_suspended) { - m_prev_state = getNextFrame(); - m_prev_state.setLinearVelocity(actualLinVelocity()); - m_prev_state.setAngularVelocity(actualAngVelocity()); - if (isDynamic()) { - // Integrate momentum (forward Euler) - m_lin_mom += m_force * timeStep; - m_ang_mom += m_torque * timeStep; - // Drain momentum because of air/water resistance - m_lin_mom *= pow(m_shapeProps->m_lin_drag, timeStep); - m_ang_mom *= pow(m_shapeProps->m_ang_drag, timeStep); - // Set velocities according momentum - getNextFrame().setLinearVelocity(m_lin_mom * m_inv_mass); - getNextFrame().setAngularVelocity(m_inv_inertia_tensor * m_ang_mom); - } - } - -}; - - void -SM_Object:: -integrateMomentum( - MT_Scalar timeStep -){ - // Integrate position and orientation - - // only do it for objects with linear and/or angular velocity - // else clients with hierarchies may get into trouble - if (!actualLinVelocity().fuzzyZero() || !actualAngVelocity().fuzzyZero()) - { - - // those MIDPOINT and BACKWARD integration methods are - // in this form not ok with some testfiles ! - // For a release build please use forward euler unless completely tested - -//#define MIDPOINT -//#define BACKWARD -#ifdef MIDPOINT -// Midpoint rule - getNextFrame().integrateMidpoint(timeStep, m_prev_state, actualLinVelocity(), actualAngVelocity()); -#elif defined BACKWARD -// Backward Euler - getNextFrame().integrateBackward(timeStep, actualLinVelocity(), actualAngVelocity()); -#else -// Forward Euler - getNextFrame().integrateForward(timeStep, m_prev_state); -#endif - - calcXform(); - notifyClient(); - - } -} - -/** - * dynamicCollision computes the response to a collision. - * - * @param local2 the contact point in local coordinates. - * @param normal the contact normal. - * @param dist the penetration depth of the contact. (unused) - * @param rel_vel the relative velocity of the objects - * @param restitution the amount of momentum conserved in the collision. Range: 0.0 - 1.0 - * @param friction_factor the amount of friction between the two surfaces. - * @param invMass the inverse mass of the collision objects (1.0 / mass) - */ -void SM_Object::dynamicCollision(const MT_Point3 &local2, - const MT_Vector3 &normal, - MT_Scalar dist, - const MT_Vector3 &rel_vel, - MT_Scalar restitution, - MT_Scalar friction_factor, - MT_Scalar invMass -) -{ - /** - * rel_vel_normal is the relative velocity in the contact normal direction. - */ - MT_Scalar rel_vel_normal = normal.dot(rel_vel); - - /** - * if rel_vel_normal > 0, the objects are moving apart! - */ - if (rel_vel_normal < -MT_EPSILON) { - /** - * if rel_vel_normal < ImpulseThreshold, scale the restitution down. - * This should improve the simulation where the object is stacked. - */ - restitution *= MT_min(MT_Scalar(1.0), rel_vel_normal/ImpulseThreshold); - - MT_Scalar impulse = -(1.0 + restitution) * rel_vel_normal; - - if (isRigidBody()) - { - MT_Vector3 temp = getInvInertiaTensor() * local2.cross(normal); - impulse /= invMass + normal.dot(temp.cross(local2)); - - /** - * Apply impulse at the collision point. - * Take rotational inertia into account. - */ - applyImpulse(local2 + getNextFrame().getPosition(), impulse * normal); - } else { - /** - * Apply impulse through object center. (no rotation.) - */ - impulse /= invMass; - applyCenterImpulse( impulse * normal ); - } - - MT_Vector3 external = m_combined_lin_vel + m_combined_ang_vel.cross(local2); - MT_Vector3 lateral = rel_vel - external - normal * (rel_vel_normal - external.dot(normal)); -#if 0 - // test - only do friction on the physics part of the - // velocity. - vel1 -= obj1->m_combined_lin_vel; - vel2 -= obj2->m_combined_lin_vel; - - // This should look familiar.... - rel_vel = vel2 - vel1; - rel_vel_normal = normal.dot(rel_vel); -#endif - /** - * The friction part starts here!!!!!!!! - * - * Compute the lateral component of the relative velocity - * lateral actually points in the opposite direction, i.e., - * into the direction of the friction force. - */ - if (m_shapeProps->m_do_anisotropic) { - - /** - * For anisotropic friction we scale the lateral component, - * rather than compute a direction-dependent fricition - * factor. For this the lateral component is transformed to - * local coordinates. - */ - - MT_Matrix3x3 lcs(getNextFrame().getOrientation()); - - /** - * We cannot use m_xform.getBasis() for the matrix, since - * it might contain a non-uniform scaling. - * OPT: it's a bit daft to compute the matrix since the - * quaternion itself can be used to do the transformation. - */ - MT_Vector3 loc_lateral = lateral * lcs; - - /** - * lcs is orthogonal so lcs.inversed() == lcs.transposed(), - * and lcs.transposed() * lateral == lateral * lcs. - */ - const MT_Vector3& friction_scaling = - m_shapeProps->m_friction_scaling; - - // Scale the local lateral... - loc_lateral.scale(friction_scaling[0], - friction_scaling[1], - friction_scaling[2]); - // ... and transform it back to global coordinates - lateral = lcs * loc_lateral; - } - - /** - * A tiny Coulomb friction primer: - * The Coulomb friction law states that the magnitude of the - * maximum possible friction force depends linearly on the - * magnitude of the normal force. - * - * \f[ - F_max_friction = friction_factor * F_normal - \f] - * - * (NB: independent of the contact area!!) - * - * The friction factor depends on the material. - * We use impulses rather than forces but let us not be - * bothered by this. - */ - MT_Scalar rel_vel_lateral = lateral.length(); - - if (rel_vel_lateral > MT_EPSILON) { - lateral /= rel_vel_lateral; - - // Compute the maximum friction impulse - MT_Scalar max_friction = - friction_factor * MT_max(MT_Scalar(0.0), impulse); - - // I guess the GEN_max is not necessary, so let's check it - - MT_assert(impulse >= 0.0); - - /** - * Here's the trick. We compute the impulse to make the - * lateral velocity zero. (Make the objects stick together - * at the contact point. If this impulse is larger than - * the maximum possible friction impulse, then shrink its - * magnitude to the maximum friction. - */ - - if (isRigidBody()) { - - /** - * For rigid bodies we take the inertia into account, - * since the friction impulse is going to change the - * angular momentum as well. - */ - MT_Vector3 temp = getInvInertiaTensor() * local2.cross(lateral); - MT_Scalar impulse_lateral = rel_vel_lateral / - (invMass + lateral.dot(temp.cross(local2))); - - MT_Scalar friction = MT_min(impulse_lateral, max_friction); - applyImpulse(local2 + getNextFrame().getPosition(), -lateral * friction); - } - else { - MT_Scalar impulse_lateral = rel_vel_lateral / invMass; - - MT_Scalar friction = MT_min(impulse_lateral, max_friction); - applyCenterImpulse( -friction * lateral); - } - - - } - - //calcXform(); - //notifyClient(); - - } -} - -static void AddCallback(SM_Scene *scene, SM_Object *obj1, SM_Object *obj2) -{ - // If we have callbacks on either of the client objects, do a collision test - // and add a callback if they intersect. - DT_Vector3 v; - if ((obj1->getClientObject() && obj1->getClientObject()->hasCollisionCallback()) || - (obj2->getClientObject() && obj2->getClientObject()->hasCollisionCallback()) && - DT_GetIntersect(obj1->getObjectHandle(), obj2->getObjectHandle(), v)) - scene->notifyCollision(obj1, obj2); -} - -DT_Bool SM_Object::boing( - void *client_data, - void *object1, - void *object2, - const DT_CollData *coll_data -){ - SM_Scene *scene = (SM_Scene *)client_data; - SM_Object *obj1 = (SM_Object *)object1; - SM_Object *obj2 = (SM_Object *)object2; - - // at this point it is unknown whether we are really intersecting (broad phase) - - DT_Vector3 p1, p2; - if (!obj2->isDynamic()) { - std::swap(obj1, obj2); - } - - // If one of the objects is a ghost then ignore it for the dynamics - if (obj1->isGhost() || obj2->isGhost()) { - AddCallback(scene, obj1, obj2); - return DT_CONTINUE; - } - - // Objects do not collide with parent objects - if (obj1->getDynamicParent() == obj2 || obj2->getDynamicParent() == obj1) { - AddCallback(scene, obj1, obj2); - return DT_CONTINUE; - } - - if (!obj2->isDynamic()) { - AddCallback(scene, obj1, obj2); - return DT_CONTINUE; - } - - // Get collision data from SOLID - if (!DT_GetPenDepth(obj1->getObjectHandle(), obj2->getObjectHandle(), p1, p2)) - return DT_CONTINUE; - - MT_Point3 local1(p1), local2(p2); - MT_Vector3 normal(local2 - local1); - MT_Scalar dist = normal.length(); - - if (dist < MT_EPSILON) - return DT_CONTINUE; - - // Now we are definitely intersecting. - - // Set callbacks for game engine. - if ((obj1->getClientObject() && obj1->getClientObject()->hasCollisionCallback()) || - (obj2->getClientObject() && obj2->getClientObject()->hasCollisionCallback())) - scene->notifyCollision(obj1, obj2); - - local1 -= obj1->getNextFrame().getPosition(); - local2 -= obj2->getNextFrame().getPosition(); - - // Calculate collision parameters - MT_Vector3 rel_vel = obj1->getVelocity(local1) - obj2->getVelocity(local2); - - MT_Scalar restitution = - MT_min(obj1->getMaterialProps()->m_restitution, - obj2->getMaterialProps()->m_restitution); - - MT_Scalar friction_factor = - MT_min(obj1->getMaterialProps()->m_friction, - obj2->getMaterialProps()->m_friction); - - MT_Scalar invMass = obj1->getInvMass() + obj2->getInvMass(); - - normal /= dist; - - // Calculate reactions - if (obj1->isDynamic()) - obj1->dynamicCollision(local1, normal, dist, rel_vel, restitution, friction_factor, invMass); - - if (obj2->isDynamic()) - { - obj2->dynamicCollision(local2, -normal, dist, -rel_vel, restitution, friction_factor, invMass); - if (!obj1->isDynamic() || obj1->m_static) - obj2->m_static = obj1->m_static + 1; - } - - return DT_CONTINUE; -} - -DT_Bool SM_Object::fix( - void *client_data, - void *object1, - void *object2, - const DT_CollData *coll_data -){ - SM_Object *obj1 = (SM_Object *)object1; - SM_Object *obj2 = (SM_Object *)object2; - - // If one of the objects is a ghost then ignore it for the dynamics - if (obj1->isGhost() || obj2->isGhost()) { - return DT_CONTINUE; - } - - if (obj1->getDynamicParent() == obj2 || obj2->getDynamicParent() == obj1) { - return DT_CONTINUE; - } - - if (!obj2->isDynamic()) { - std::swap(obj1, obj2); - } - - if (!obj2->isDynamic()) { - return DT_CONTINUE; - } - - // obj1 points to a dynamic object - DT_Vector3 p1, p2; - if (!DT_GetPenDepth(obj1->getObjectHandle(), obj2->getObjectHandle(), p1, p2)) - return DT_CONTINUE; - MT_Point3 local1(p1), local2(p2); - // Get collision data from SOLID - MT_Vector3 normal(local2 - local1); - - MT_Scalar dist = normal.dot(normal); - if (dist < MT_EPSILON || dist > obj2->m_shapeProps->m_radius*obj2->m_shapeProps->m_radius) - return DT_CONTINUE; - - - if ((obj1->m_static || !obj1->isDynamic()) && obj1->m_static < obj2->m_static) - { - obj2->m_static = obj1->m_static + 1; - } else if (obj2->m_static && obj2->m_static < obj1->m_static) - { - obj1->m_static = obj2->m_static + 1; - } - - contacts.insert(new Contact(obj1, obj2, normal, MT_Point3(local1 + 0.5*(local2 - local1)))); - - - return DT_CONTINUE; -} - -void SM_Object::relax(void) -{ - for (Contact::Set::iterator csit = contacts.begin() ; csit != contacts.end(); ++csit) - { - (*csit)->resolve(); - delete (*csit); - } - - contacts.clear(); - if (m_error.fuzzyZero()) - return; - //std::cout << "SM_Object::relax: { " << m_error << " }" << std::endl; - - getNextFrame().setPosition(getNextFrame().getPosition() + m_error); - m_error.setValue(0., 0., 0.); - //calcXform(); - //notifyClient(); -} - -SM_Object::SM_Object() : - m_dynamicParent(0), - m_client_object(0), - m_physicsClientObject(0), - m_shape(0), - m_materialProps(0), - m_materialPropsBackup(0), - m_shapeProps(0), - m_shapePropsBackup(0), - m_object(0), - m_margin(0.0), - m_scaling(1.0, 1.0, 1.0), - m_reaction_impulse(0.0, 0.0, 0.0), - m_reaction_force(0.0, 0.0, 0.0), - m_lin_mom(0.0, 0.0, 0.0), - m_ang_mom(0.0, 0.0, 0.0), - m_force(0.0, 0.0, 0.0), - m_torque(0.0, 0.0, 0.0), - m_error(0.0, 0.0, 0.0), - m_combined_lin_vel (0.0, 0.0, 0.0), - m_combined_ang_vel (0.0, 0.0, 0.0), - m_fh_object(0), - m_kinematic(false), - m_prev_kinematic(false), - m_is_rigid_body(false) -{ - // warning no initialization of variables done by moto. -} - -SM_Object:: -~SM_Object() { - if (m_fh_object) - delete m_fh_object; - - DT_DestroyObject(m_object); - m_object = NULL; -} - - bool -SM_Object:: -isDynamic( -) const { - return m_shapeProps != 0; -} - -/* nzc experimental. There seem to be two places where kinematics - * are evaluated: proceedKinematic (called from SM_Scene) and - * proceed() in this object. I'll just try and bunge these out for - * now. */ - void -SM_Object:: -suspend( -){ - if (!m_suspended) { - m_suspended = true; - suspendDynamics(); - } -} - - void -SM_Object:: -resume( -) { - if (m_suspended) { - m_suspended = false; - restoreDynamics(); - } -} - - void -SM_Object:: -suspendDynamics( -) { - if (m_shapeProps) { - m_shapePropsBackup = m_shapeProps; - m_shapeProps = 0; - } -} - - void -SM_Object:: -restoreDynamics( -) { - if (m_shapePropsBackup) { - m_shapeProps = m_shapePropsBackup; - m_shapePropsBackup = 0; - } -} - - bool -SM_Object:: -isGhost( -) const { - return m_materialProps == 0; -} - - void -SM_Object:: -suspendMaterial( -) { - if (m_materialProps) { - m_materialPropsBackup = m_materialProps; - m_materialProps = 0; - } -} - - void -SM_Object:: -restoreMaterial( -) { - if (m_materialPropsBackup) { - m_materialProps = m_materialPropsBackup; - m_materialPropsBackup = 0; - } -} - - SM_FhObject * -SM_Object:: -getFhObject( -) const { - return m_fh_object; -} - - void -SM_Object:: -registerCallback( - SM_Callback& callback -) { - m_callbackList.push_back(&callback); -} - -// Set the local coordinate system according to the current state - void -SM_Object:: -calcXform() { -#ifdef SM_DEBUG_XFORM - printf("SM_Object::calcXform m_pos = { %-0.5f, %-0.5f, %-0.5f }\n", - m_pos[0], m_pos[1], m_pos[2]); - printf(" m_orn = { %-0.5f, %-0.5f, %-0.5f, %-0.5f }\n", - m_orn[0], m_orn[1], m_orn[2], m_orn[3]); - printf(" m_scaling = { %-0.5f, %-0.5f, %-0.5f }\n", - m_scaling[0], m_scaling[1], m_scaling[2]); -#endif - m_xform.setOrigin(getNextFrame().getPosition()); - m_xform.setBasis(MT_Matrix3x3(getNextFrame().getOrientation(), m_scaling)); - m_xform.getValue(m_ogl_matrix); - - /* Blender has been known to crash here. - This usually means SM_Object *this has been deleted more than once. */ - DT_SetMatrixd(m_object, m_ogl_matrix); - if (m_fh_object) { - m_fh_object->setPosition(getNextFrame().getPosition()); - m_fh_object->calcXform(); - } - updateInvInertiaTensor(); -#ifdef SM_DEBUG_XFORM - printf("\n | %-0.5f %-0.5f %-0.5f %-0.5f |\n", - m_ogl_matrix[0], m_ogl_matrix[4], m_ogl_matrix[ 8], m_ogl_matrix[12]); - printf( " | %-0.5f %-0.5f %-0.5f %-0.5f |\n", - m_ogl_matrix[1], m_ogl_matrix[5], m_ogl_matrix[ 9], m_ogl_matrix[13]); - printf( "m_ogl_matrix = | %-0.5f %-0.5f %-0.5f %-0.5f |\n", - m_ogl_matrix[2], m_ogl_matrix[6], m_ogl_matrix[10], m_ogl_matrix[14]); - printf( " | %-0.5f %-0.5f %-0.5f %-0.5f |\n\n", - m_ogl_matrix[3], m_ogl_matrix[7], m_ogl_matrix[11], m_ogl_matrix[15]); -#endif -} - - void -SM_Object::updateInvInertiaTensor() -{ - m_inv_inertia_tensor = m_xform.getBasis().scaled(m_inv_inertia[0], m_inv_inertia[1], m_inv_inertia[2]) * m_xform.getBasis().transposed(); -} - -// Call callbacks to notify the client of a change of placement - void -SM_Object:: -notifyClient() { - T_CallbackList::iterator i; - for (i = m_callbackList.begin(); i != m_callbackList.end(); ++i) { - (*i)->do_me(); - } -} - - -// Save the current state information for use in the velocity computation in the next frame. - void -SM_Object:: -proceedKinematic( - MT_Scalar timeStep -) { - /* nzc: need to bunge this for the logic bubbling as well? */ - if (!m_suspended) { - m_prev_kinematic = m_kinematic; - if (m_kinematic) { - m_prev_xform = m_xform; - m_timeStep = timeStep; - calcXform(); - m_kinematic = false; - } - } -} - - void -SM_Object:: -saveReactionForce( - MT_Scalar timeStep -) { - if (isDynamic()) { - m_reaction_force = m_reaction_impulse / timeStep; - m_reaction_impulse.setValue(0.0, 0.0, 0.0); - } -} - - void -SM_Object:: -clearForce( -) { - m_force.setValue(0.0, 0.0, 0.0); - m_torque.setValue(0.0, 0.0, 0.0); -} - - void -SM_Object:: -clearMomentum( -) { - m_lin_mom.setValue(0.0, 0.0, 0.0); - m_ang_mom.setValue(0.0, 0.0, 0.0); -} - - void -SM_Object:: -setMargin( - MT_Scalar margin -) { - m_margin = margin; - DT_SetMargin(m_object, margin); -} - - MT_Scalar -SM_Object:: -getMargin( -) const { - return m_margin; -} - -const - SM_MaterialProps * -SM_Object:: -getMaterialProps( -) const { - return m_materialProps; -} - -const - SM_ShapeProps * -SM_Object:: -getShapeProps( -) const { - return m_shapeProps; -} - - void -SM_Object:: -setPosition( - const MT_Point3& pos -){ - m_kinematic = true; - getNextFrame().setPosition(pos); - endFrame(); -} - - void -SM_Object:: -setOrientation( - const MT_Quaternion& orn -){ - MT_assert(!orn.fuzzyZero()); - m_kinematic = true; - getNextFrame().setOrientation(orn); - endFrame(); -} - - void -SM_Object:: -setScaling( - const MT_Vector3& scaling -){ - m_kinematic = true; - m_scaling = scaling; -} - -/** - * Functions to handle linear velocity - */ - - void -SM_Object:: -setExternalLinearVelocity( - const MT_Vector3& lin_vel -) { - m_combined_lin_vel=lin_vel; -} - - void -SM_Object:: -addExternalLinearVelocity( - const MT_Vector3& lin_vel -) { - m_combined_lin_vel+=lin_vel; -} - - void -SM_Object:: -addLinearVelocity( - const MT_Vector3& lin_vel -){ - setLinearVelocity(getNextFrame().getLinearVelocity() + lin_vel); -} - - void -SM_Object:: -setLinearVelocity( - const MT_Vector3& lin_vel -){ - getNextFrame().setLinearVelocity(lin_vel); - if (m_shapeProps) { - m_lin_mom = getNextFrame().getLinearVelocity() * m_shapeProps->m_mass; - } -} - -/** - * Functions to handle angular velocity - */ - - void -SM_Object:: -setExternalAngularVelocity( - const MT_Vector3& ang_vel -) { - m_combined_ang_vel = ang_vel; -} - - void -SM_Object:: -addExternalAngularVelocity( - const MT_Vector3& ang_vel -) { - m_combined_ang_vel += ang_vel; -} - - void -SM_Object:: -setAngularVelocity( - const MT_Vector3& ang_vel -) { - getNextFrame().setAngularVelocity(ang_vel); - if (m_shapeProps) { - m_ang_mom = getNextFrame().getAngularVelocity() * m_shapeProps->m_inertia; - } -} - - void -SM_Object:: -addAngularVelocity( - const MT_Vector3& ang_vel -) { - setAngularVelocity(getNextFrame().getAngularVelocity() + ang_vel); -} - - - void -SM_Object:: -clearCombinedVelocities( -) { - m_combined_lin_vel = MT_Vector3(0,0,0); - m_combined_ang_vel = MT_Vector3(0,0,0); -} - - void -SM_Object:: -resolveCombinedVelocities( - const MT_Vector3 & lin_vel, - const MT_Vector3 & ang_vel -) { - - // Different behaviours for dynamic and non-dynamic - // objects. For non-dynamic we just set the velocity to - // zero. For dynmic the physics velocity has to be - // taken into account. We must make an arbitrary decision - // on how to resolve the 2 velocities. Choices are - // Add the physics velocity to the linear velocity. Objects - // will just keep on moving in the direction they were - // last set in - untill external forces affect them. - // Set the combinbed linear and physics velocity to zero. - // Set the physics velocity in the direction of the set velocity - // zero. - if (isDynamic()) { - -#if 1 - getNextFrame().setLinearVelocity(getNextFrame().getLinearVelocity() + lin_vel); - getNextFrame().setAngularVelocity(getNextFrame().getAngularVelocity() + ang_vel); -#else - - //compute the component of the physics velocity in the - // direction of the set velocity and set it to zero. - MT_Vector3 lin_vel_norm = lin_vel.normalized(); - - setLinearVelocity(getNextFrame().getLinearVelocity() - (getNextFrame().getLinearVelocity().dot(lin_vel_norm) * lin_vel_norm)); -#endif - m_lin_mom = getNextFrame().getLinearVelocity() * m_shapeProps->m_mass; - m_ang_mom = getNextFrame().getAngularVelocity() * m_shapeProps->m_inertia; - clearCombinedVelocities(); - - } - -} - - - MT_Scalar -SM_Object:: -getInvMass( -) const { - return m_inv_mass; - // OPT: cache the result of this division rather than compute it each call -} - - const MT_Vector3& -SM_Object:: -getInvInertia( -) const { - return m_inv_inertia; - // OPT: cache the result of this division rather than compute it each call -} - - const MT_Matrix3x3& -SM_Object:: -getInvInertiaTensor( -) const { - return m_inv_inertia_tensor; -} - - void -SM_Object:: -applyForceField( - const MT_Vector3& accel -) { - if (m_shapeProps) { - m_force += m_shapeProps->m_mass * accel; // F = m * a - } -} - - void -SM_Object:: -applyCenterForce( - const MT_Vector3& force -) { - m_force += force; -} - - void -SM_Object:: -applyTorque( - const MT_Vector3& torque -) { - m_torque += torque; -} - - void -SM_Object:: -applyImpulse( - const MT_Point3& attach, const MT_Vector3& impulse -) { - applyCenterImpulse(impulse); // Change in linear momentum - applyAngularImpulse((attach - getNextFrame().getPosition()).cross(impulse)); // Change in angular momentump -} - - void -SM_Object:: -applyCenterImpulse( - const MT_Vector3& impulse -) { - if (m_shapeProps) { - m_lin_mom += impulse; - m_reaction_impulse += impulse; - getNextFrame().setLinearVelocity(m_lin_mom * m_inv_mass); - - // The linear velocity is immedialtely updated since otherwise - // simultaneous collisions will get a double impulse. - } -} - - void -SM_Object:: -applyAngularImpulse( - const MT_Vector3& impulse -) { - if (m_shapeProps) { - m_ang_mom += impulse; - getNextFrame().setAngularVelocity( m_inv_inertia_tensor * m_ang_mom); - } -} - - MT_Point3 -SM_Object:: -getWorldCoord( - const MT_Point3& local -) const { - return m_xform(local); -} - - MT_Vector3 -SM_Object:: -getVelocity( - const MT_Point3& local -) const { - if (m_prev_kinematic && !isDynamic()) - { - // For displaced objects the velocity is faked using the previous state. - // Dynamic objects get their own velocity, not the faked velocity. - // (Dynamic objects shouldn't be displaced in the first place!!) - return (m_xform(local) - m_prev_xform(local)) / m_timeStep; - } - - // NB: m_xform.getBasis() * local == m_xform(local) - m_xform.getOrigin() - return actualLinVelocity() + actualAngVelocity().cross(local); -} - - -const - MT_Vector3& -SM_Object:: -getReactionForce( -) const { - return m_reaction_force; -} - - void -SM_Object:: -getMatrix( - double *m -) const { - std::copy(&m_ogl_matrix[0], &m_ogl_matrix[16], &m[0]); -} - -const - double * -SM_Object:: -getMatrix( -) const { - return m_ogl_matrix; -} - -// Still need this??? -const - MT_Transform& -SM_Object:: -getScaledTransform( -) const { - return m_xform; -} - - DT_ObjectHandle -SM_Object:: -getObjectHandle( -) const { - return m_object; -} - - DT_ShapeHandle -SM_Object:: -getShapeHandle( -) const { - return m_shape; -} - - SM_Object * -SM_Object:: -getDynamicParent( -) { - return m_dynamicParent; -} - - void -SM_Object:: -setRigidBody( - bool is_rigid_body -) { - m_is_rigid_body = is_rigid_body; -} - - bool -SM_Object:: -isRigidBody( -) const { - return m_is_rigid_body; -} - -const - MT_Vector3 -SM_Object:: -actualLinVelocity( -) const { - return m_combined_lin_vel + getNextFrame().getLinearVelocity(); -}; - -const - MT_Vector3 -SM_Object:: -actualAngVelocity( -) const { - return m_combined_ang_vel + getNextFrame().getAngularVelocity(); -} - - -SM_MotionState& -SM_Object:: -getCurrentFrame() -{ - return m_frames[1]; -} - -SM_MotionState& -SM_Object:: -getPreviousFrame() -{ - return m_frames[0]; -} - -SM_MotionState & -SM_Object:: -getNextFrame() -{ - return m_frames[2]; -} - -const SM_MotionState & -SM_Object:: -getCurrentFrame() const -{ - return m_frames[1]; -} - -const SM_MotionState & -SM_Object:: -getPreviousFrame() const -{ - return m_frames[0]; -} - -const SM_MotionState & -SM_Object:: -getNextFrame() const -{ - return m_frames[2]; -} - - -const MT_Point3& -SM_Object:: -getPosition() const -{ - return m_frames[1].getPosition(); -} - -const MT_Quaternion& -SM_Object:: -getOrientation() const -{ - return m_frames[1].getOrientation(); -} - -const MT_Vector3& -SM_Object:: -getLinearVelocity() const -{ - return m_frames[1].getLinearVelocity(); -} - -const MT_Vector3& -SM_Object:: -getAngularVelocity() const -{ - return m_frames[1].getAngularVelocity(); -} - -void -SM_Object:: -interpolate(MT_Scalar timeStep) -{ - if (!actualLinVelocity().fuzzyZero() || !actualAngVelocity().fuzzyZero()) - { - getCurrentFrame().setTime(timeStep); - getCurrentFrame().lerp(getPreviousFrame(), getNextFrame()); - notifyClient(); - } -} - -void -SM_Object:: -endFrame() -{ - getPreviousFrame() = getNextFrame(); - getCurrentFrame() = getNextFrame(); - m_static = 0; -} diff --git a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp deleted file mode 100644 index f0791bbf89f..00000000000 --- a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp +++ /dev/null @@ -1,378 +0,0 @@ -/** - * $Id$ - * Copyright (C) 2001 NaN Technologies B.V. - * The physics scene. - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef WIN32 -#pragma warning(disable : 4786) // shut off 255 char limit debug template warning -#endif - -#include "SM_Scene.h" -#include "SM_Object.h" -#include "SM_FhObject.h" - -#include "SM_Debug.h" - -#include - -SM_Scene::SM_Scene() : - m_scene(DT_CreateScene()), - m_respTable(DT_CreateRespTable()), - m_secondaryRespTable(DT_CreateRespTable()), - m_fixRespTable(DT_CreateRespTable()), - m_forceField(0.0, 0.0, 0.0), - m_frames(0) -{ - for (int i = 0 ; i < NUM_RESPONSE; i++) - { - m_ResponseClass[i] = DT_GenResponseClass(m_respTable); - m_secondaryResponseClass[i] = DT_GenResponseClass(m_secondaryRespTable); - m_fixResponseClass[i] = DT_GenResponseClass(m_fixRespTable); - } - - /* Sensor */ - DT_AddPairResponse(m_respTable, m_ResponseClass[SENSOR_RESPONSE], m_ResponseClass[SENSOR_RESPONSE], 0, DT_NO_RESPONSE, this); - DT_AddPairResponse(m_respTable, m_ResponseClass[SENSOR_RESPONSE], m_ResponseClass[STATIC_RESPONSE], SM_Scene::boing, DT_SIMPLE_RESPONSE, this); - DT_AddPairResponse(m_respTable, m_ResponseClass[SENSOR_RESPONSE], m_ResponseClass[OBJECT_RESPONSE], SM_Scene::boing, DT_SIMPLE_RESPONSE, this); - DT_AddPairResponse(m_respTable, m_ResponseClass[SENSOR_RESPONSE], m_ResponseClass[FH_RESPONSE], 0, DT_NO_RESPONSE, this); - - /* Static */ - DT_AddPairResponse(m_respTable, m_ResponseClass[STATIC_RESPONSE], m_ResponseClass[SENSOR_RESPONSE], SM_Scene::boing, DT_SIMPLE_RESPONSE, this); - DT_AddPairResponse(m_respTable, m_ResponseClass[STATIC_RESPONSE], m_ResponseClass[STATIC_RESPONSE], 0, DT_NO_RESPONSE, this); - DT_AddPairResponse(m_respTable, m_ResponseClass[STATIC_RESPONSE], m_ResponseClass[OBJECT_RESPONSE], SM_Object::boing, DT_BROAD_RESPONSE, this); - DT_AddPairResponse(m_respTable, m_ResponseClass[STATIC_RESPONSE], m_ResponseClass[FH_RESPONSE], SM_FhObject::ray_hit, DT_SIMPLE_RESPONSE, this); - - /* Object */ - DT_AddPairResponse(m_respTable, m_ResponseClass[OBJECT_RESPONSE], m_ResponseClass[SENSOR_RESPONSE], SM_Scene::boing, DT_SIMPLE_RESPONSE, this); - DT_AddPairResponse(m_respTable, m_ResponseClass[OBJECT_RESPONSE], m_ResponseClass[STATIC_RESPONSE], SM_Object::boing, DT_BROAD_RESPONSE, this); - DT_AddPairResponse(m_respTable, m_ResponseClass[OBJECT_RESPONSE], m_ResponseClass[OBJECT_RESPONSE], SM_Object::boing, DT_BROAD_RESPONSE, this); - DT_AddPairResponse(m_respTable, m_ResponseClass[OBJECT_RESPONSE], m_ResponseClass[FH_RESPONSE], SM_FhObject::ray_hit, DT_SIMPLE_RESPONSE, this); - - /* Fh Object */ - DT_AddPairResponse(m_respTable, m_ResponseClass[FH_RESPONSE], m_ResponseClass[SENSOR_RESPONSE], 0, DT_NO_RESPONSE, this); - DT_AddPairResponse(m_respTable, m_ResponseClass[FH_RESPONSE], m_ResponseClass[STATIC_RESPONSE], SM_FhObject::ray_hit, DT_SIMPLE_RESPONSE, this); - DT_AddPairResponse(m_respTable, m_ResponseClass[FH_RESPONSE], m_ResponseClass[OBJECT_RESPONSE], SM_FhObject::ray_hit, DT_SIMPLE_RESPONSE, this); - DT_AddPairResponse(m_respTable, m_ResponseClass[FH_RESPONSE], m_ResponseClass[FH_RESPONSE], 0, DT_NO_RESPONSE, this); - - /* Object (Fix Pass) */ - DT_AddPairResponse(m_fixRespTable, m_ResponseClass[OBJECT_RESPONSE], m_ResponseClass[SENSOR_RESPONSE], 0, DT_NO_RESPONSE, this); - DT_AddPairResponse(m_fixRespTable, m_ResponseClass[OBJECT_RESPONSE], m_ResponseClass[STATIC_RESPONSE], SM_Object::fix, DT_BROAD_RESPONSE, this); - DT_AddPairResponse(m_fixRespTable, m_ResponseClass[OBJECT_RESPONSE], m_ResponseClass[OBJECT_RESPONSE], SM_Object::fix, DT_BROAD_RESPONSE, this); - DT_AddPairResponse(m_fixRespTable, m_ResponseClass[OBJECT_RESPONSE], m_ResponseClass[FH_RESPONSE], 0, DT_NO_RESPONSE, this); -} - -void SM_Scene::addTouchCallback(int response_class, DT_ResponseCallback callback, void *user) -{ - DT_AddClassResponse(m_secondaryRespTable, m_secondaryResponseClass[response_class], callback, DT_BROAD_RESPONSE, user); -} - -void SM_Scene::addSensor(SM_Object& object) -{ - T_ObjectList::iterator i = - std::find(m_objectList.begin(), m_objectList.end(), &object); - if (i == m_objectList.end()) - { - object.calcXform(); - m_objectList.push_back(&object); - DT_AddObject(m_scene, object.getObjectHandle()); - DT_SetResponseClass(m_respTable, object.getObjectHandle(), m_ResponseClass[SENSOR_RESPONSE]); - DT_SetResponseClass(m_secondaryRespTable, object.getObjectHandle(), m_secondaryResponseClass [SENSOR_RESPONSE]); - DT_SetResponseClass(m_fixRespTable, object.getObjectHandle(), m_fixResponseClass[SENSOR_RESPONSE]); - } -} - -void SM_Scene::add(SM_Object& object) { - object.calcXform(); - m_objectList.push_back(&object); - DT_AddObject(m_scene, object.getObjectHandle()); - if (object.isDynamic()) { - DT_SetResponseClass(m_respTable, object.getObjectHandle(), m_ResponseClass[OBJECT_RESPONSE]); - DT_SetResponseClass(m_secondaryRespTable, object.getObjectHandle(), m_secondaryResponseClass[OBJECT_RESPONSE]); - DT_SetResponseClass(m_fixRespTable, object.getObjectHandle(), m_fixResponseClass[OBJECT_RESPONSE]); - } else { - DT_SetResponseClass(m_respTable, object.getObjectHandle(), m_ResponseClass[STATIC_RESPONSE]); - DT_SetResponseClass(m_secondaryRespTable, object.getObjectHandle(), m_secondaryResponseClass[STATIC_RESPONSE]); - DT_SetResponseClass(m_fixRespTable, object.getObjectHandle(), m_fixResponseClass[STATIC_RESPONSE]); - } - - SM_FhObject *fh_object = object.getFhObject(); - - if (fh_object) { - DT_AddObject(m_scene, fh_object->getObjectHandle()); - DT_SetResponseClass(m_respTable, fh_object->getObjectHandle(), m_ResponseClass[FH_RESPONSE]); - DT_SetResponseClass(m_secondaryRespTable, fh_object->getObjectHandle(), m_secondaryResponseClass[FH_RESPONSE]); - DT_SetResponseClass(m_fixRespTable, fh_object->getObjectHandle(), m_fixResponseClass[FH_RESPONSE]); - } -} - -void SM_Scene::requestCollisionCallback(SM_Object &object) -{ - DT_SetResponseClass(m_respTable, object.getObjectHandle(), m_ResponseClass[OBJECT_RESPONSE]); - DT_SetResponseClass(m_secondaryRespTable, object.getObjectHandle(), m_secondaryResponseClass[OBJECT_RESPONSE]); -// DT_SetResponseClass(m_fixRespTable, object.getObjectHandle(), m_fixResponseClass[OBJECT_RESPONSE]); -} - -void SM_Scene::remove(SM_Object& object) { - //std::cout << "SM_Scene::remove this =" << this << "object = " << &object << std::endl; - T_ObjectList::iterator i = - std::find(m_objectList.begin(), m_objectList.end(), &object); - if (!(i == m_objectList.end())) - { - std::swap(*i, m_objectList.back()); - m_objectList.pop_back(); - DT_RemoveObject(m_scene, object.getObjectHandle()); - - SM_FhObject *fh_object = object.getFhObject(); - - if (fh_object) { - DT_RemoveObject(m_scene, fh_object->getObjectHandle()); - } - } - else { - // tried to remove an object that is not in the scene - //assert(false); - } -} - -void SM_Scene::beginFrame() -{ - T_ObjectList::iterator i; - // Apply a forcefield (such as gravity) - for (i = m_objectList.begin(); i != m_objectList.end(); ++i) - (*i)->applyForceField(m_forceField); - -} - -void SM_Scene::endFrame() -{ - T_ObjectList::iterator i; - for (i = m_objectList.begin(); i != m_objectList.end(); ++i) - (*i)->clearForce(); -} - -bool SM_Scene::proceed(MT_Scalar curtime, MT_Scalar ticrate) -{ - if (!m_frames) - { - if (ticrate > 0.) - m_frames = (unsigned int)(curtime*ticrate) + 1.0; - else - m_frames = (unsigned int)(curtime*65536.0); - } - - // Divide the timeStep into a number of subsamples of size roughly - // equal to subS (might be a little smaller). - MT_Scalar subStep; - int num_samples; - int frames = m_frames; - - // Compute the number of steps to do this update. - if (ticrate > 0.0) - { - // Fixed time step - subStep = 1.0/ticrate; - num_samples = (unsigned int)(curtime*ticrate + 1.0) - m_frames; - - if (num_samples > 4) - { - std::cout << "Dropping physics frames! frames:" << num_samples << " substep: " << subStep << std::endl; - MT_Scalar tr = ticrate; - do - { - frames = frames / 2; - tr = tr / 2.0; - num_samples = (unsigned int)(curtime*tr + 1.0) - frames; - subStep *= 2.0; - } while (num_samples > 8); - std::cout << " frames:" << num_samples << " substep: " << subStep << std::endl; - } - } - else - { - // Variable time step. (old update) - // Integrate at least 100 Hz - MT_Scalar timeStep = curtime - m_frames/65536.0; - subStep = timeStep > 0.01 ? 0.01 : timeStep; - num_samples = int(timeStep * 0.01); - if (num_samples < 1) - num_samples = 1; - } - - // Do a physics timestep. - T_ObjectList::iterator i; - if (num_samples > 0) - { - // Do the integration steps per object. - for (int step = 0; step != num_samples; ++step) - { - MT_Scalar time; - if (ticrate > 0.) - time = MT_Scalar(frames + step + 1) * subStep; - else - time = MT_Scalar(m_frames)/65536.0 + MT_Scalar(step + 1)*subStep; - - for (i = m_objectList.begin(); i != m_objectList.end(); ++i) { - (*i)->endFrame(); - // Apply a forcefield (such as gravity) - (*i)->integrateForces(subStep); - // And second we update the object positions by performing - // an integration step for each object - (*i)->integrateMomentum(subStep); - } - - // So now first we let the physics scene respond to - // new forces, velocities set externally. - // The collsion and friction impulses are computed here. - // Collision phase - DT_Test(m_scene, m_respTable); - - // Contact phase - DT_Test(m_scene, m_fixRespTable); - - // Finish this timestep by saving al state information for the next - // timestep and clearing the accumulated forces. - for (i = m_objectList.begin(); i != m_objectList.end(); ++i) { - (*i)->relax(); - (*i)->proceedKinematic(subStep); - (*i)->saveReactionForce(subStep); - (*i)->getNextFrame().setTime(time); - //(*i)->clearForce(); - } - } - } - - if (ticrate > 0) - { - // Interpolate between time steps. - for (i = m_objectList.begin(); i != m_objectList.end(); ++i) - (*i)->interpolate(curtime); - - //only update the m_frames after an actual physics timestep - if (num_samples) - { - m_frames = (unsigned int)(curtime*ticrate) + 1.0; - } - } - else - { - m_frames = (unsigned int)(curtime*65536.0); - } - - return num_samples != 0; -} - -void SM_Scene::notifyCollision(SM_Object *obj1, SM_Object *obj2) -{ - // For each pair of object that collided, call the corresponding callback. - if (m_secondaryRespTable) - DT_CallResponse(m_secondaryRespTable, obj1->getObjectHandle(), obj2->getObjectHandle(), 0); -} - - -SM_Object *SM_Scene::rayTest(void *ignore_client, - const MT_Point3& from, const MT_Point3& to, - MT_Point3& result, MT_Vector3& normal) const { -#ifdef SM_DEBUG_RAYCAST - std::cout << "ray: { " << from << " } - { " << to << " }" << std::endl; -#endif - - DT_Vector3 n, dfrom, dto; - DT_Scalar param; - from.getValue(dfrom); - to.getValue(dto); - SM_Object *hit_object = (SM_Object *) - DT_RayCast(m_scene, ignore_client, dfrom, dto, 1., ¶m, n); - - if (hit_object) { - //result = hit_object->getWorldCoord(from + (to - from)*param); - result = from + (to - from) * param; - normal.setValue(n); -#ifdef SM_DEBUG_RAYCAST - std::cout << "ray: { " << from << " } -> { " << to << " }: { " << result - << " } (" << param << "), normal = { " << normal << " }" << std::endl; -#endif - } - - return hit_object; -} - -void SM_Scene::clearObjectCombinedVelocities() { - - T_ObjectList::iterator i; - - for (i = m_objectList.begin(); i != m_objectList.end(); ++i) { - - (*i)->clearCombinedVelocities(); - - } - -} - - -void SM_Scene::setSecondaryRespTable(DT_RespTableHandle secondaryRespTable) { - m_secondaryRespTable = secondaryRespTable; -} - - -DT_Bool SM_Scene::boing( - void *client_data, - void *object1, - void *object2, - const DT_CollData * -){ - SM_Scene *scene = (SM_Scene *)client_data; - SM_Object *obj1 = (SM_Object *)object1; - SM_Object *obj2 = (SM_Object *)object2; - - scene->notifyCollision(obj1, obj2); // Record this collision for client callbacks - -#ifdef SM_DEBUG_BOING - printf("SM_Scene::boing\n"); -#endif - - return DT_CONTINUE; -} - -SM_Scene::~SM_Scene() -{ - //std::cout << "SM_Scene::~ SM_Scene(): destroy " << this << std::endl; -// if (m_objectList.begin() != m_objectList.end()) -// std::cout << "SM_Scene::~SM_Scene: There are still objects in the Sumo scene!" << std::endl; - for (T_ObjectList::iterator it = m_objectList.begin() ; it != m_objectList.end() ; it++) - delete *it; - - DT_DestroyRespTable(m_respTable); - DT_DestroyRespTable(m_secondaryRespTable); - DT_DestroyRespTable(m_fixRespTable); - DT_DestroyScene(m_scene); -} diff --git a/source/gameengine/Physics/Sumo/Makefile b/source/gameengine/Physics/Sumo/Makefile deleted file mode 100644 index 69efc4d84eb..00000000000 --- a/source/gameengine/Physics/Sumo/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -# -# $Id$ -# -# ***** BEGIN GPL 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. -# -# 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. -# -# The Original Code is: all of this file. -# -# Contributor(s): none yet. -# -# ***** END GPL LICENSE BLOCK ***** -# -# - -SOURCEDIR = source/gameengine/Physics/Sumo -LIBNAME = sumo -DIR = $(OCGDIR)/gameengine/blphys/$(LIBNAME) -DIRS = Fuzzics - -include nan_compile.mk - -CCFLAGS += $(LEVEL_1_CPP_WARNINGS) - -CPPFLAGS += -I$(OPENGL_HEADERS) -CPPFLAGS += -I$(NAN_STRING)/include -CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) - -CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_SUMO) -I$(NAN_MOTO)/include -CPPFLAGS += -I$(NAN_SOLID)/include -CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include -CPPFLAGS += -I../../Physics/common -CPPFLAGS += -I../../Physics/Dummy - -include nan_subdirs.mk diff --git a/source/gameengine/Physics/Sumo/SConscript b/source/gameengine/Physics/Sumo/SConscript deleted file mode 100644 index a228a986af2..00000000000 --- a/source/gameengine/Physics/Sumo/SConscript +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/python -Import ('env') - -sources = ['SumoPHYCallbackBridge.cpp', - 'SumoPhysicsController.cpp', - 'SumoPhysicsEnvironment.cpp', - 'Fuzzics/src/SM_FhObject.cpp', - 'Fuzzics/src/SM_Object.cpp', - 'Fuzzics/src/SM_Scene.cpp', - 'Fuzzics/src/SM_MotionState.cpp' - ] - -incs =['.', - '../common', - 'Fuzzics/include', - '#/intern/moto/include' - ] -incs += [env['BF_SOLID_INC']] - -cflags = [] -if env['OURPLATFORM']=='win32-vc': - cflags.append('/GR') - cflags.append('/O1') - -env.BlenderLib ( 'bf_sumo', sources, incs, [], libtype=['core','player'], priority=[400, 55] , compileflags=cflags) diff --git a/source/gameengine/Physics/Sumo/SumoPHYCallbackBridge.cpp b/source/gameengine/Physics/Sumo/SumoPHYCallbackBridge.cpp deleted file mode 100644 index 1992bbe3421..00000000000 --- a/source/gameengine/Physics/Sumo/SumoPHYCallbackBridge.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "SumoPHYCallbackBridge.h" -#include "PHY_IPhysicsController.h" -#include "SM_Object.h" - - -SumoPHYCallbackBridge::SumoPHYCallbackBridge(void* clientData,PHY_ResponseCallback phyCallback) -:m_orgClientData(clientData), -m_phyCallback(phyCallback) -{ - -} -DT_Bool SumoPHYCallbackBridge::StaticSolidToPHYCallback(void *client_data, - void *client_object1, - void *client_object2, - const DT_CollData *coll_data) -{ - SumoPHYCallbackBridge* bridge = static_cast(client_data); - bridge->SolidToPHY(client_object1,client_object2,coll_data); - return false; -} - -DT_Bool SumoPHYCallbackBridge::SolidToPHY(void *client_object1, - void *client_object2, - const DT_CollData *coll_data) -{ - - SM_Object* smObject1 = static_cast(client_object1); - SM_Object* smObject2 = static_cast(client_object2); - - PHY_IPhysicsController* ctrl1 = static_cast(smObject1->getPhysicsClientObject()); - PHY_IPhysicsController* ctrl2 = static_cast(smObject2->getPhysicsClientObject()); - - if (!ctrl1 || !ctrl2) - { - //todo: check which objects are not linked up properly - return false; - } - if (coll_data) - { - PHY_CollData phyCollData; - - phyCollData.m_point1[0] = coll_data->point1[0]; - phyCollData.m_point1[1] = coll_data->point1[1]; - phyCollData.m_point1[2] = coll_data->point1[2]; - phyCollData.m_point1[3] = 0.f; - - phyCollData.m_point2[0] = coll_data->point2[0]; - phyCollData.m_point2[1] = coll_data->point2[1]; - phyCollData.m_point2[2] = coll_data->point2[2]; - phyCollData.m_point2[3] = 0.f; - - phyCollData.m_normal[0] = coll_data->normal[0]; - phyCollData.m_normal[1] = coll_data->normal[1]; - phyCollData.m_normal[2] = coll_data->normal[2]; - phyCollData.m_normal[3] = 0.f; - - - return m_phyCallback(m_orgClientData, - ctrl1,ctrl2,&phyCollData); - } - - return m_phyCallback(m_orgClientData, - ctrl1,ctrl2,0); - -} - diff --git a/source/gameengine/Physics/Sumo/SumoPHYCallbackBridge.h b/source/gameengine/Physics/Sumo/SumoPHYCallbackBridge.h deleted file mode 100644 index cc980f3961d..00000000000 --- a/source/gameengine/Physics/Sumo/SumoPHYCallbackBridge.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef SUMO_PHY_CALLBACK_BRIDGE_H -#define SUMO_PHY_CALLBACK_BRIDGE_H - -#include -#include "PHY_DynamicTypes.h" - -class SumoPHYCallbackBridge -{ - void* m_orgClientData; - PHY_ResponseCallback m_phyCallback; - -public: - - SumoPHYCallbackBridge(void* clientData,PHY_ResponseCallback phyCallback); - - static DT_Bool StaticSolidToPHYCallback(void *client_data, - void *client_object1, - void *client_object2, - const DT_CollData *coll_data); - - DT_Bool SolidToPHY(void *client_object1, - void *client_object2, - const DT_CollData *coll_data); - - -}; - -#endif //SUMO_PHY_CALLBACK_BRIDGE_H diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsController.cpp b/source/gameengine/Physics/Sumo/SumoPhysicsController.cpp deleted file mode 100644 index 56caa9236bf..00000000000 --- a/source/gameengine/Physics/Sumo/SumoPhysicsController.cpp +++ /dev/null @@ -1,495 +0,0 @@ -/** - * @file $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include "SumoPhysicsController.h" -#include "PHY_IMotionState.h" -#include "SM_Object.h" -#include "MT_Quaternion.h" - - -SumoPhysicsController::SumoPhysicsController( - class SM_Scene* sumoScene, - class SM_Object* sumoObj, - class PHY_IMotionState* motionstate, - - bool dyna) - : - m_sumoObj(sumoObj) , - m_sumoScene(sumoScene), - m_bFirstTime(true), - m_bDyna(dyna), - m_MotionState(motionstate) -{ - if (m_sumoObj) - { - - PHY__Vector3 pos1; - getPosition(pos1); - MT_Point3 pos(pos1); - - //temp debugging check - //assert(pos.length() < 100000.f); - - //need this to do the upcast after the solid/sumo collision callback - m_sumoObj->setPhysicsClientObject(this); - //if it is a dyna, register for a callback - m_sumoObj->registerCallback(*this); - } -}; - - - -SumoPhysicsController::~SumoPhysicsController() -{ - if (m_sumoObj) - { - m_sumoScene->remove(*m_sumoObj); - - delete m_sumoObj; - m_sumoObj = NULL; - } -} - -float SumoPhysicsController::getMass() -{ - if (m_sumoObj) - { - const SM_ShapeProps *shapeprops = m_sumoObj->getShapeProps(); - if(shapeprops!=NULL) return shapeprops->m_mass; - } - return 0.f; -} - -bool SumoPhysicsController::SynchronizeMotionStates(float) -{ - if (m_bFirstTime) - { - setSumoTransform(!m_bFirstTime); - m_bFirstTime = false; - } - return false; -} - - - - -void SumoPhysicsController::GetWorldOrientation(MT_Matrix3x3& mat) -{ - float orn[4]; - m_MotionState->getWorldOrientation(orn[0],orn[1],orn[2],orn[3]); - MT_Quaternion quat(orn); - mat.setRotation(quat); - -} - -void SumoPhysicsController::getPosition(PHY__Vector3& pos) const -{ - assert(m_sumoObj); - - pos[0] = m_sumoObj->getPosition()[0]; - pos[1] = m_sumoObj->getPosition()[0]; - pos[2] = m_sumoObj->getPosition()[0]; - - //m_MotionState->getWorldPosition(pos[0],pos[1],pos[2]); -} - -void SumoPhysicsController::GetWorldPosition(MT_Point3& pos) -{ -// assert(m_sumoObj); - -// pos[0] = m_sumoObj->getPosition()[0]; -// pos[1] = m_sumoObj->getPosition()[0]; -// pos[2] = m_sumoObj->getPosition()[0]; - - float worldpos[3]; - m_MotionState->getWorldPosition(worldpos[0],worldpos[1],worldpos[2]); - pos[0]=worldpos[0]; - pos[1]=worldpos[1]; - pos[2]=worldpos[2]; -} - -void SumoPhysicsController::GetWorldScaling(MT_Vector3& scale) -{ - float worldscale[3]; - m_MotionState->getWorldScaling(worldscale[0],worldscale[1],worldscale[2]); - scale[0]=worldscale[0]; - scale[1]=worldscale[1]; - scale[2]=worldscale[2]; -} - - - // kinematic methods -void SumoPhysicsController::RelativeTranslate(float dlocX,float dlocY,float dlocZ,bool local) -{ - if (m_sumoObj) - { - MT_Matrix3x3 mat; - GetWorldOrientation(mat); - MT_Vector3 dloc(dlocX,dlocY,dlocZ); - - MT_Point3 newpos = m_sumoObj->getPosition(); - - newpos += (local ? mat * dloc : dloc); - m_sumoObj->setPosition(newpos); - } - -} -void SumoPhysicsController::RelativeRotate(const float drot[12],bool local) -{ - if (m_sumoObj ) - { - MT_Matrix3x3 drotmat(drot); - MT_Matrix3x3 currentOrn; - GetWorldOrientation(currentOrn); - - m_sumoObj->setOrientation(m_sumoObj->getOrientation()*(local ? - drotmat : (currentOrn.inverse() * drotmat * currentOrn)).getRotation()); - } - -} -void SumoPhysicsController::setOrientation(float quatImag0,float quatImag1,float quatImag2,float quatReal) -{ - m_sumoObj->setOrientation(MT_Quaternion(quatImag0,quatImag1,quatImag2,quatReal)); -} - -void SumoPhysicsController::getOrientation(float &quatImag0,float &quatImag1,float &quatImag2,float &quatReal) -{ - const MT_Quaternion& q = m_sumoObj->getOrientation(); - quatImag0 = q[0]; - quatImag1 = q[1]; - quatImag2 = q[2]; - quatReal = q[3]; -} - -void SumoPhysicsController::setPosition(float posX,float posY,float posZ) -{ - m_sumoObj->setPosition(MT_Point3(posX,posY,posZ)); -} - -void SumoPhysicsController::setScaling(float scaleX,float scaleY,float scaleZ) -{ - if (!m_bDyna) - m_sumoObj->setScaling(MT_Vector3(scaleX,scaleY,scaleZ)); -} - - // physics methods -void SumoPhysicsController::ApplyTorque(float torqueX,float torqueY,float torqueZ,bool local) -{ - if (m_sumoObj) - { - MT_Vector3 torque(torqueX,torqueY,torqueZ); - - MT_Matrix3x3 orn; - GetWorldOrientation(orn); - m_sumoObj->applyTorque(local ? - orn * torque : - torque); - } -} - -void SumoPhysicsController::ApplyForce(float forceX,float forceY,float forceZ,bool local) -{ - if (m_sumoObj) - { - MT_Vector3 force(forceX,forceY,forceZ); - - MT_Matrix3x3 orn; - GetWorldOrientation(orn); - - m_sumoObj->applyCenterForce(local ? - orn * force : - force); - } -} - -void SumoPhysicsController::SetAngularVelocity(float ang_velX,float ang_velY,float ang_velZ,bool local) -{ - if (m_sumoObj) - { - MT_Vector3 ang_vel(ang_velX,ang_velY,ang_velZ); - - MT_Matrix3x3 orn; - GetWorldOrientation(orn); - - m_sumoObj->setExternalAngularVelocity(local ? - orn * ang_vel : - ang_vel); - } -} - -void SumoPhysicsController::SetLinearVelocity(float lin_velX,float lin_velY,float lin_velZ,bool local) -{ - if (m_sumoObj ) - { - MT_Matrix3x3 orn; - GetWorldOrientation(orn); - - MT_Vector3 lin_vel(lin_velX,lin_velY,lin_velZ); - m_sumoObj->setExternalLinearVelocity(local ? - orn * lin_vel : - lin_vel); - } -} - -void SumoPhysicsController::resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ) -{ - if (m_sumoObj) - m_sumoObj->resolveCombinedVelocities(MT_Vector3(linvelX,linvelY,linvelZ),MT_Vector3(angVelX,angVelY,angVelZ)); -} - - - - -void SumoPhysicsController::applyImpulse(float attachX,float attachY,float attachZ, float impulseX,float impulseY,float impulseZ) -{ - if (m_sumoObj) - { - MT_Point3 attach(attachX,attachY,attachZ); - MT_Vector3 impulse(impulseX,impulseY,impulseZ); - m_sumoObj->applyImpulse(attach,impulse); - } - -} - -void SumoPhysicsController::SuspendDynamics() -{ - m_suspendDynamics=true; - - if (m_sumoObj) - { - m_sumoObj->suspendDynamics(); - m_sumoObj->setLinearVelocity(MT_Vector3(0,0,0)); - m_sumoObj->setAngularVelocity(MT_Vector3(0,0,0)); - m_sumoObj->calcXform(); - } -} - -void SumoPhysicsController::RestoreDynamics() -{ - m_suspendDynamics=false; - - if (m_sumoObj) - { - m_sumoObj->restoreDynamics(); - } -} - - -/** - reading out information from physics -*/ -void SumoPhysicsController::GetLinearVelocity(float& linvX,float& linvY,float& linvZ) -{ - if (m_sumoObj) - { - // get velocity from the physics object (m_sumoObj) - const MT_Vector3& vel = m_sumoObj->getLinearVelocity(); - linvX = vel[0]; - linvY = vel[1]; - linvZ = vel[2]; - } - else - { - linvX = 0.f; - linvY = 0.f; - linvZ = 0.f; - } -} - -/** - GetVelocity parameters are in geometric coordinates (Origin is not center of mass!). -*/ -void SumoPhysicsController::GetVelocity(const float posX,const float posY,const float posZ,float& linvX,float& linvY,float& linvZ) -{ - if (m_sumoObj) - { - MT_Point3 pos(posX,posY,posZ); - // get velocity from the physics object (m_sumoObj) - const MT_Vector3& vel = m_sumoObj->getVelocity(pos); - linvX = vel[0]; - linvY = vel[1]; - linvZ = vel[2]; - } - else - { - linvX = 0.f; - linvY = 0.f; - linvZ = 0.f; - - } -} - -void SumoPhysicsController::getReactionForce(float& forceX,float& forceY,float& forceZ) -{ - const MT_Vector3& force = m_sumoObj->getReactionForce(); - forceX = force[0]; - forceY = force[1]; - forceZ = force[2]; -} - -void SumoPhysicsController::setRigidBody(bool rigid) -{ - m_sumoObj->setRigidBody(rigid); -} - -void SumoPhysicsController::PostProcessReplica(class PHY_IMotionState* motionstate,class PHY_IPhysicsController* parentctrl) -{ - m_MotionState = motionstate; - - SM_Object* dynaparent=0; - SumoPhysicsController* sumoparentctrl = (SumoPhysicsController* )parentctrl; - - if (sumoparentctrl) - { - dynaparent = sumoparentctrl->GetSumoObject(); - } - - SM_Object* orgsumoobject = m_sumoObj; - - - m_sumoObj = new SM_Object( - orgsumoobject->getShapeHandle(), - orgsumoobject->getMaterialProps(), - orgsumoobject->getShapeProps(), - dynaparent); - - m_sumoObj->setRigidBody(orgsumoobject->isRigidBody()); - - m_sumoObj->setMargin(orgsumoobject->getMargin()); - m_sumoObj->setPosition(orgsumoobject->getPosition()); - m_sumoObj->setOrientation(orgsumoobject->getOrientation()); - //if it is a dyna, register for a callback - m_sumoObj->registerCallback(*this); - - m_sumoScene->add(* (m_sumoObj)); -} - -PHY_IMotionState* SumoPhysicsController::GetMotionState() -{ - return m_MotionState; -} - -void SumoPhysicsController::SetSimulatedTime(float) -{ -} - - -void SumoPhysicsController::WriteMotionStateToDynamics(bool) -{ - -} -// this is the actual callback from sumo, and the position/orientation -//is written to the scenegraph, using the motionstate abstraction - -void SumoPhysicsController::do_me() -{ - MT_assert(m_sumoObj); - const MT_Point3& pos = m_sumoObj->getPosition(); - const MT_Quaternion& orn = m_sumoObj->getOrientation(); - - MT_assert(m_MotionState); - m_MotionState->setWorldPosition(pos[0],pos[1],pos[2]); - m_MotionState->setWorldOrientation(orn[0],orn[1],orn[2],orn[3]); -} - - -void SumoPhysicsController::setSumoTransform(bool nondynaonly) -{ - if (!nondynaonly || !m_bDyna) - { - if (m_sumoObj) - { - MT_Point3 pos; - GetWorldPosition(pos); - - m_sumoObj->setPosition(pos); - if (m_bDyna) - { - m_sumoObj->setScaling(MT_Vector3(1,1,1)); - } else - { - MT_Vector3 scale; - GetWorldScaling(scale); - m_sumoObj->setScaling(scale); - } - MT_Matrix3x3 orn; - GetWorldOrientation(orn); - m_sumoObj->setOrientation(orn.getRotation()); - m_sumoObj->calcXform(); - } - } -} - - - // clientinfo for raycasts for example -void* SumoPhysicsController::getNewClientInfo() -{ - if (m_sumoObj) - return m_sumoObj->getClientObject(); - return 0; - -} -void SumoPhysicsController::setNewClientInfo(void* clientinfo) -{ - if (m_sumoObj) - { - SM_ClientObject* clOb = static_cast (clientinfo); - m_sumoObj->setClientObject(clOb); - } - -} - -void SumoPhysicsController::calcXform() -{ - if (m_sumoObj) - m_sumoObj->calcXform(); -} - -void SumoPhysicsController::SetMargin(float margin) -{ - if (m_sumoObj) - m_sumoObj->setMargin(margin); -} - -float SumoPhysicsController::GetMargin() const -{ - if (m_sumoObj) - m_sumoObj->getMargin(); - return 0.f; -} - -float SumoPhysicsController::GetRadius() const -{ - if (m_sumoObj && m_sumoObj->getShapeProps()) - { - return m_sumoObj->getShapeProps()->m_radius; - } - return 0.f; - -} diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsController.h b/source/gameengine/Physics/Sumo/SumoPhysicsController.h deleted file mode 100644 index adf29649f18..00000000000 --- a/source/gameengine/Physics/Sumo/SumoPhysicsController.h +++ /dev/null @@ -1,192 +0,0 @@ -/** - * @file $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#ifndef __SUMO_PHYSICSCONTROLLER_H -#define __SUMO_PHYSICSCONTROLLER_H - -#include "PHY_IPhysicsController.h" -#include "SM_Scene.h" -#include "SM_Callback.h" - -/** - * Sumo Physics Controller, a special kind of a PhysicsController. - * A Physics Controller is a special kind of Scene Graph Transformation Controller. - * Each time the scene graph get's updated, the controller get's a chance - * in the 'Update' method to reflect changes. - * - * Sumo uses the SOLID library for collision detection. - */ -class SumoPhysicsController : public PHY_IPhysicsController , public SM_Callback - - -{ - - -public: - SumoPhysicsController( - class SM_Scene* sumoScene, - class SM_Object* sumoObj, - class PHY_IMotionState* motionstate, - bool dyna); - - virtual ~SumoPhysicsController(); - - /** - * @name Kinematic Methods. - */ - /*@{*/ - virtual void RelativeTranslate(float dlocX,float dlocY,float dlocZ,bool local); - /** - * @param drot a 3x4 matrix. This will treated as a 3x3 rotation matrix. - * @warning RelativeRotate expects a 3x4 matrix. The fourth column is padding. - */ - virtual void RelativeRotate(const float drot[12],bool local); - virtual void getOrientation(float &quatImag0,float &quatImag1,float &quatImag2,float &quatReal); - virtual void setOrientation(float quatImag0,float quatImag1,float quatImag2,float quatReal); - virtual void setPosition(float posX,float posY,float posZ); - virtual void getPosition(PHY__Vector3& pos) const; - - virtual void setScaling(float scaleX,float scaleY,float scaleZ); - /*@}*/ - - /** - * @name Physics Methods - */ - /*@{*/ - virtual void ApplyTorque(float torqueX,float torqueY,float torqueZ,bool local); - virtual void ApplyForce(float forceX,float forceY,float forceZ,bool local); - virtual void SetAngularVelocity(float ang_velX,float ang_velY,float ang_velZ,bool local); - virtual void SetLinearVelocity(float lin_velX,float lin_velY,float lin_velZ,bool local); - virtual void resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ); - virtual void applyImpulse(float attachX,float attachY,float attachZ, float impulseX,float impulseY,float impulseZ); - virtual void SetActive(bool active){}; - virtual void SuspendDynamics(); - virtual void RestoreDynamics(); - /*@}*/ - - - /** - * reading out information from physics - */ - virtual void GetLinearVelocity(float& linvX,float& linvY,float& linvZ); - /** - * GetVelocity parameters are in geometric coordinates (Origin is not center of mass!). - */ - virtual void GetVelocity(const float posX,const float posY,const float posZ,float& linvX,float& linvY,float& linvZ); - virtual float getMass(); - virtual void getReactionForce(float& forceX,float& forceY,float& forceZ); - virtual void setRigidBody(bool rigid); - - - virtual void PostProcessReplica(class PHY_IMotionState* motionstate,class PHY_IPhysicsController* parentctrl); - - // TODO: remove next line ! - virtual void SetSimulatedTime(float time); - - virtual void WriteDynamicsToMotionState() {}; - virtual void WriteMotionStateToDynamics(bool nondynaonly); - virtual class PHY_IMotionState* GetMotionState(); - - /** - * call from Scene Graph Node to 'update'. - */ - virtual bool SynchronizeMotionStates(float time); - - virtual void calcXform(); - virtual void SetMargin(float margin) ; - virtual float GetMargin() const; - virtual float GetRadius() const ; - virtual void SetRadius(float margin) { SetMargin(margin); } - - - // clientinfo for raycasts for example - virtual void* getNewClientInfo(); - virtual void setNewClientInfo(void* clientinfo); - - float getFriction() { return m_friction;} - float getRestitution() { return m_restitution;} - - /** - * Sumo callback - */ - virtual void do_me(); - - class SM_Object* GetSumoObject () - { - return m_sumoObj; - }; - - void GetWorldOrientation(class MT_Matrix3x3& mat); - void GetWorldPosition(MT_Point3& pos); - void GetWorldScaling(MT_Vector3& scale); - - float GetLinVelocityMin() const { return 0.f; } - void SetLinVelocityMin(float val) { } - float GetLinVelocityMax() const { return 0.f; } - void SetLinVelocityMax(float val) { } - - -// void SetSumoObject(class SM_Object* sumoObj) { -// m_sumoObj = sumoObj; -// } -// void SetSumoScene(class SM_Scene* sumoScene) { -// m_sumoScene = sumoScene; -// } - - void setSumoTransform(bool nondynaonly); - - -private: - class SM_Object* m_sumoObj; - class SM_Scene* m_sumoScene; // needed for replication - bool m_bFirstTime; - bool m_bDyna; - - float m_friction; - float m_restitution; - - - bool m_suspendDynamics; - - bool m_firstTime; - bool m_bFullRigidBody; - bool m_bPhantom; // special flag for objects that are not affected by physics 'resolver' - - // data to calculate fake velocities for kinematic objects (non-dynas) - bool m_bKinematic; - bool m_bPrevKinematic; - - float m_lastTime; - - class PHY_IMotionState* m_MotionState; - - -}; - -#endif //__SUMO_PHYSICSCONTROLLER_H - diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp deleted file mode 100644 index b4daf0a3f80..00000000000 --- a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp +++ /dev/null @@ -1,264 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#include // memset -#include "SumoPhysicsEnvironment.h" -#include "PHY_IMotionState.h" -#include "SumoPhysicsController.h" -#include "SM_Scene.h" -#include "SumoPHYCallbackBridge.h" -#include - -SumoPhysicsEnvironment::SumoPhysicsEnvironment() -{ - m_fixedTimeStep = 1.f/60.f; - m_useFixedTimeStep = true; - m_currentTime = 0.f; - - m_sumoScene = new SM_Scene(); -} - - - -SumoPhysicsEnvironment::~SumoPhysicsEnvironment() -{ - delete m_sumoScene; -} - - - -void SumoPhysicsEnvironment::beginFrame() -{ - m_sumoScene->beginFrame(); -} - -void SumoPhysicsEnvironment::endFrame() -{ - m_sumoScene->endFrame(); -} - -void SumoPhysicsEnvironment::setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep) -{ - m_useFixedTimeStep = useFixedTimeStep; - if (m_useFixedTimeStep) - { - m_fixedTimeStep = fixedTimeStep; - } else - { - m_fixedTimeStep = 0.f; - } - //reset current time ? - m_currentTime = 0.f; -} -float SumoPhysicsEnvironment::getFixedTimeStep() -{ - return m_fixedTimeStep; -} - - -bool SumoPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep,float interval) -{ - - bool result = false; - if (m_useFixedTimeStep) - { - m_currentTime += timeStep; - float ticrate = 1.f/m_fixedTimeStep; - - result = m_sumoScene->proceed(curTime, ticrate); - } else - { - m_currentTime += timeStep; - result = m_sumoScene->proceed(m_currentTime, timeStep); - } - return result; -} - -void SumoPhysicsEnvironment::setGravity(float x,float y,float z) -{ - m_sumoScene->setForceField(MT_Vector3(x,y,z)); -} - -int SumoPhysicsEnvironment::createConstraint( - class PHY_IPhysicsController* ctrl, - class PHY_IPhysicsController* ctrl2, - PHY_ConstraintType type, - float pivotX,float pivotY,float pivotZ, - float axisX,float axisY,float axisZ, - float axis1X,float axis1Y,float axis1Z, - float axis2X,float axis2Y,float axis2Z, - int flag - ) -{ - int constraintid = 0; - return constraintid; -} - -void SumoPhysicsEnvironment::removeConstraint(int constraintid) -{ - if (constraintid) - { - } -} - -PHY_IPhysicsController* SumoPhysicsEnvironment::rayTest(PHY_IRayCastFilterCallback &filterCallback, - float fromX,float fromY,float fromZ, - float toX,float toY,float toZ) -{ - SumoPhysicsController* ignoreCtr = static_cast (filterCallback.m_ignoreController); - - //collision detection / raytesting - MT_Point3 hit, normal; - PHY_RayCastResult result; - - SM_Object* sm_ignore = 0; - if (ignoreCtr) - sm_ignore = ignoreCtr->GetSumoObject(); - - memset(&result, 0, sizeof(result)); - - SM_Object* smOb = m_sumoScene->rayTest(sm_ignore,MT_Point3(fromX, fromY, fromZ),MT_Point3(toX, toY, toZ), hit, normal); - if (smOb) - { - result.m_controller = (PHY_IPhysicsController *) smOb->getPhysicsClientObject(); - result.m_hitPoint[0] = hit[0]; - result.m_hitPoint[1] = hit[1]; - result.m_hitPoint[2] = hit[2]; - result.m_hitNormal[0] = normal[0]; - result.m_hitNormal[1] = normal[1]; - result.m_hitNormal[2] = normal[2]; - filterCallback.reportHit(&result); - } - return result.m_controller; -} -//gamelogic callbacks -void SumoPhysicsEnvironment::addSensor(PHY_IPhysicsController* ctrl) -{ - SumoPhysicsController* smctrl = dynamic_cast(ctrl); - SM_Object* smObject = smctrl->GetSumoObject(); - assert(smObject); - if (smObject) - { - m_sumoScene->addSensor(*smObject); - } -} -void SumoPhysicsEnvironment::removeSensor(PHY_IPhysicsController* ctrl) -{ - SumoPhysicsController* smctrl = dynamic_cast(ctrl); - SM_Object* smObject = smctrl->GetSumoObject(); - assert(smObject); - if (smObject) - { - m_sumoScene->remove(*smObject); - } -} - - -void SumoPhysicsEnvironment::addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user) -{ - - int sumoRespClass = 0; - - //map PHY_ convention into SM_ convention - switch (response_class) - { - case PHY_FH_RESPONSE: - sumoRespClass = FH_RESPONSE; - break; - case PHY_SENSOR_RESPONSE: - sumoRespClass = SENSOR_RESPONSE; - break; - case PHY_CAMERA_RESPONSE: - sumoRespClass =CAMERA_RESPONSE; - break; - case PHY_OBJECT_RESPONSE: - sumoRespClass = OBJECT_RESPONSE; - break; - case PHY_STATIC_RESPONSE: - sumoRespClass = PHY_STATIC_RESPONSE; - break; - case PHY_BROADPH_RESPONSE: - return; - default: - assert(0); - return; - } - - SumoPHYCallbackBridge* bridge = new SumoPHYCallbackBridge(user,callback); - - m_sumoScene->addTouchCallback(sumoRespClass,SumoPHYCallbackBridge::StaticSolidToPHYCallback,bridge); -} -bool SumoPhysicsEnvironment::requestCollisionCallback(PHY_IPhysicsController* ctrl) -{ - SumoPhysicsController* smctrl = dynamic_cast(ctrl); - MT_assert(smctrl); - SM_Object* smObject = smctrl->GetSumoObject(); - MT_assert(smObject); - if (smObject) - { - //assert(smObject->getPhysicsClientObject() == ctrl); - smObject->setPhysicsClientObject(ctrl); - - m_sumoScene->requestCollisionCallback(*smObject); - return true; - } - return false; -} - -bool SumoPhysicsEnvironment::removeCollisionCallback(PHY_IPhysicsController* ctrl) -{ - // intentionally empty - return false; -} - -PHY_IPhysicsController* SumoPhysicsEnvironment::CreateSphereController(float radius,const PHY__Vector3& position) -{ - DT_ShapeHandle shape = DT_NewSphere(0.0); - SM_Object* ob = new SM_Object(shape,0,0,0); - ob->setPosition(MT_Point3(position)); - //testing - MT_Quaternion rotquatje(MT_Vector3(0,0,1),MT_radians(90)); - ob->setOrientation(rotquatje); - - PHY_IPhysicsController* ctrl = new SumoPhysicsController(m_sumoScene,ob,0,false); - ctrl->SetMargin(radius); - return ctrl; -} -PHY_IPhysicsController* SumoPhysicsEnvironment::CreateConeController(float coneradius,float coneheight) -{ - DT_ShapeHandle shape = DT_NewCone(coneradius,coneheight); - SM_Object* ob = new SM_Object(shape,0,0,0); - ob->setPosition(MT_Point3(0.f,0.f,0.f)); - MT_Quaternion rotquatje(MT_Vector3(0,0,1),MT_radians(90)); - ob->setOrientation(rotquatje); - - PHY_IPhysicsController* ctrl = new SumoPhysicsController(m_sumoScene,ob,0,false); - - return ctrl; -} - diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h deleted file mode 100644 index 5ae33eb4b0e..00000000000 --- a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h +++ /dev/null @@ -1,110 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#ifndef _SUMOPhysicsEnvironment -#define _SUMOPhysicsEnvironment - -#include "MT_Scalar.h" - -#include "PHY_IPhysicsEnvironment.h" -class SumoPHYCallbackBridge; -#include -/** -* Physics Environment takes care of stepping the simulation and is a container for physics entities (rigidbodies,constraints, materials etc.) -* A derived class may be able to 'construct' entities by loading and/or converting -*/ -class SumoPhysicsEnvironment : public PHY_IPhysicsEnvironment -{ - - class SM_Scene* m_sumoScene; - float m_currentTime; - float m_fixedTimeStep; - bool m_useFixedTimeStep; - - std::vector m_callbacks; - -public: - SumoPhysicsEnvironment(); - virtual ~SumoPhysicsEnvironment(); - virtual void beginFrame(); - virtual void endFrame(); -// Perform an integration step of duration 'timeStep'. - virtual bool proceedDeltaTime(double curTime,float timeStep,float interval); - virtual void setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep); - virtual float getFixedTimeStep(); - - virtual void setGravity(float x,float y,float z); - virtual int createConstraint(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsController* ctrl2,PHY_ConstraintType type, - float pivotX,float pivotY,float pivotZ, - float axisX,float axisY,float axisZ, - float axis1X=0,float axis1Y=0,float axis1Z=0, - float axis2X=0,float axis2Y=0,float axis2Z=0,int flag=0 - - ); - - virtual void removeConstraint(int constraintid); - - //complex constraint for vehicles - virtual PHY_IVehicle* getVehicleConstraint(int constraintId) - { - return 0; - } - - virtual PHY_IPhysicsController* rayTest(PHY_IRayCastFilterCallback &filterCallback,float fromX,float fromY,float fromZ, float toX,float toY,float toZ); - virtual bool cullingTest(PHY_CullingCallback callback, void* userData, PHY__Vector4 *planes, int nplanes, int occlusionRes) { return false; } - - - //gamelogic callbacks - virtual void addSensor(PHY_IPhysicsController* ctrl); - virtual void removeSensor(PHY_IPhysicsController* ctrl); - virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user); - virtual bool requestCollisionCallback(PHY_IPhysicsController* ctrl); - virtual bool removeCollisionCallback(PHY_IPhysicsController* ctrl); - virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position); - virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight); - - virtual float getConstraintParam(int constraintId,int param) - { - return 0.f; - } - virtual void setConstraintParam(int constraintId,int param,float value,float value1) - { - } - SM_Scene* GetSumoScene() - { - return m_sumoScene; - } - -protected: - // 60Hz (Default) - static MT_Scalar PhysicsTicRate; - -}; - -#endif //_SUMOPhysicsEnvironment - diff --git a/source/gameengine/Physics/Sumo/convert.txt b/source/gameengine/Physics/Sumo/convert.txt deleted file mode 100644 index 81f8f602cde..00000000000 --- a/source/gameengine/Physics/Sumo/convert.txt +++ /dev/null @@ -1,35 +0,0 @@ -static DT_ShapeHandle CreateShapeFromMesh(RAS_MeshObject* meshobj) -{ - DT_ShapeHandle shape = DT_NewComplexShape(); - int numpolys = meshobj->NumPolygons(); - int numvalidpolys = 0; - - for (int p=0; pGetPolygon(p); - - // only add polygons that have the collisionflag set - if (poly->IsCollider()) - { - DT_Begin(); - for (int v=0; vVertexCount(); v++) { - MT_Point3 pt = meshobj->GetVertex(poly->GetVertexIndexBase().m_vtxarray, - poly->GetVertexIndexBase().m_indexarray[v], - poly->GetMaterial()->GetPolyMaterial())->xyz(); - DT_Vertex(pt[0],pt[1],pt[2]); - } - DT_End(); - - numvalidpolys++; - } - } - - DT_EndComplexShape(); - - if (numvalidpolys==0) { - delete shape; - return NULL; - } else { - return shape; - } -} diff --git a/source/gameengine/Physics/Sumo/include/interpolator.h b/source/gameengine/Physics/Sumo/include/interpolator.h deleted file mode 100644 index 055c242edc7..00000000000 --- a/source/gameengine/Physics/Sumo/include/interpolator.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef INTERPOLATOR_H -#define INTERPOLATOR_H - -#include "solid_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -DT_DECLARE_HANDLE(IP_IpoHandle); - -typedef struct IP_ControlPoint { - DT_Scalar m_key; - DT_Scalar m_keyValue; -} IP_ControlPoint; - -IP_IpoHandle IP_CreateLinear(const IP_ControlPoint *cpoints, int num_cpoints); - -void IP_DeleteInterpolator(IP_IpoHandle ipo); - -DT_Scalar IP_GetValue(IP_IpoHandle ipo, DT_Scalar key); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/source/gameengine/Physics/common/Makefile b/source/gameengine/Physics/common/Makefile index e3edd426c36..f2dd0134b71 100644 --- a/source/gameengine/Physics/common/Makefile +++ b/source/gameengine/Physics/common/Makefile @@ -40,7 +40,7 @@ CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) -CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_SUMO)/include -I$(NAN_MOTO)/include +CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_MOTO)/include CPPFLAGS += -I../../blender # these two needed because of blenkernel CPPFLAGS += -I../../blender/makesdna diff --git a/source/gameengine/SConscript b/source/gameengine/SConscript index 864e4c3ebee..592b138583f 100644 --- a/source/gameengine/SConscript +++ b/source/gameengine/SConscript @@ -18,13 +18,5 @@ SConscript(['BlenderRoutines/SConscript', 'VideoTexture/SConscript' ]) -if env['WITH_BF_SOLID']: - SConscript(['Physics/Sumo/SConscript']) - if env['WITH_BF_PLAYER']: SConscript(['GamePlayer/SConscript']) - -#if user_options_dict['USE_PHYSICS'] == 'solid': -# SConscript(['Physics/Sumo/SConscript']) -#elif user_options_dict['USE_PHYSICS'] == 'ode': -# SConscript(['Physics/BlOde/SConscript']) diff --git a/source/nan_compile.mk b/source/nan_compile.mk index bd6dd6e1baa..bc264fe5c1d 100644 --- a/source/nan_compile.mk +++ b/source/nan_compile.mk @@ -71,21 +71,6 @@ DBG_CCFLAGS += -g # OS dependent parts --------------------------------------------------- -ifeq ($(OS),beos) - CC = gcc - CCC = g++ - CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing - CCFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing - REL_CFLAGS += -O2 - REL_CCFLAGS += -O2 - NAN_DEPEND = true - OPENGL_HEADERS = . - CPPFLAGS += -D__BeOS - AR = ar - ARFLAGS = ruv - ARFLAGSQUIET = ru -endif - ifeq ($(OS),darwin) CC = gcc CCC = g++ diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk index b9e623ed4e4..91f90525c1e 100644 --- a/source/nan_definitions.mk +++ b/source/nan_definitions.mk @@ -91,7 +91,6 @@ endif export BF_PROFILE ?= false export NAN_USE_BULLET ?= true export NAN_BULLET2 ?= $(LCGDIR)/bullet2 - export NAN_SUMO ?= $(SRCHOME)/gameengine/Physics/Sumo export NAN_FUZZICS ?= $(SRCHOME)/gameengine/Physics/Sumo/Fuzzics export NAN_BLENKEY ?= $(LCGDIR)/blenkey export NAN_DECIMATION ?= $(LCGDIR)/decimation @@ -131,45 +130,6 @@ endif endif # Platform Dependent settings go below: - ifeq ($(OS),beos) - - export ID = $(USER) - export HOST = $(HOSTNAME) - export NAN_PYTHON ?= $(LCGDIR)/python - export NAN_PYTHON_VERSION ?= 2.3 - export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION) - export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a - export NAN_OPENAL ?= $(LCGDIR)/openal - export NAN_JPEG ?= $(LCGDIR)/jpeg - export NAN_PNG ?= $(LCGDIR)/png - export NAN_TIFF ?= $(LCGDIR)/tiff - export NAN_ODE ?= $(LCGDIR)/ode - export NAN_TERRAPLAY ?= $(LCGDIR)/terraplay - export NAN_MESA ?= /usr/src/Mesa-3.1 - export NAN_ZLIB ?= $(LCGDIR)/zlib - export NAN_NSPR ?= $(LCGDIR)/nspr - export NAN_FREETYPE ?= $(LCGDIR)/freetype - export NAN_GETTEXT ?= $(LCGDIR)/gettext - export NAN_SDL ?= $(shell sdl-config --prefix) - export NAN_SDLLIBS ?= $(shell sdl-config --libs) - export NAN_SDLCFLAGS ?= $(shell sdl-config --cflags) - - # Uncomment the following line to use Mozilla inplace of netscape - # CPPFLAGS +=-DMOZ_NOT_NET - # Location of MOZILLA/Netscape header files... - export NAN_MOZILLA_INC ?= $(LCGDIR)/mozilla/include - export NAN_MOZILLA_LIB ?= $(LCGDIR)/mozilla/lib/ - # Will fall back to look in NAN_MOZILLA_INC/nspr and NAN_MOZILLA_LIB - # if this is not set. - - export NAN_BUILDINFO ?= true - # Be paranoid regarding library creation (do not update archives) - export NAN_PARANOID ?= true - - # l10n - #export INTERNATIONAL ?= true - - else ifeq ($(OS),darwin) export ID = $(shell whoami) @@ -589,7 +549,6 @@ endif endif # irix endif # freebsd endif # darwin - endif # beos endif # CONFIG_GUESS diff --git a/source/nan_link.mk b/source/nan_link.mk index 42b17b425b3..63c9a578498 100644 --- a/source/nan_link.mk +++ b/source/nan_link.mk @@ -49,10 +49,6 @@ endif # default (overriden by windows) SOEXT = .so -ifeq ($(OS),beos) - LLIBS = -L/boot/develop/lib/x86/ -lGL -lbe -L/boot/home/config/lib/ -endif - ifeq ($(OS),darwin) LLIBS += -lGLU -lGL LLIBS += -lz -lstdc++ -- cgit v1.2.3 From b9f5676caac84b3795e0e0263744f1fad59cc6d5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 21 Jun 2009 16:58:22 +0000 Subject: remove support for videoscape, amiga 3D app that came before lightwave. --- source/blender/blenkernel/BKE_exotic.h | 1 - source/blender/blenkernel/BKE_utildefines.h | 6 - source/blender/blenkernel/intern/exotic.c | 593 +--------------------------- 3 files changed, 2 insertions(+), 598 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_exotic.h b/source/blender/blenkernel/BKE_exotic.h index 11dc1f41109..5c47eeabfe8 100644 --- a/source/blender/blenkernel/BKE_exotic.h +++ b/source/blender/blenkernel/BKE_exotic.h @@ -47,7 +47,6 @@ int BKE_read_exotic(struct Scene *scene, char *name); void write_dxf(struct Scene *scene, char *str); void write_vrml(struct Scene *scene, char *str); -void write_videoscape(struct Scene *scene, char *str); void write_stl(struct Scene *scene, char *str); #endif diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h index 8043eb74749..419f0f5beeb 100644 --- a/source/blender/blenkernel/BKE_utildefines.h +++ b/source/blender/blenkernel/BKE_utildefines.h @@ -148,12 +148,6 @@ #define ID_NEW(a) if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid #define FORM MAKE_ID('F','O','R','M') -#define DDG1 MAKE_ID('3','D','G','1') -#define DDG2 MAKE_ID('3','D','G','2') -#define DDG3 MAKE_ID('3','D','G','3') -#define DDG4 MAKE_ID('3','D','G','4') - -#define GOUR MAKE_ID('G','O','U','R') #define BLEN MAKE_ID('B','L','E','N') #define DER_ MAKE_ID('D','E','R','_') diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index 929d3f942dc..f15e1c24949 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -27,47 +27,7 @@ * * - Blender Foundation * - * ***** END GPL LICENSE BLOCK ***** - * - * eigen videoscape formaat: - * - * - * lamp: - * 3DG2 - aantal_lampen - - type - spsi spbl - r, g, b, energy - locx, locy, locz - vecx, vecy, vecz - - - curve / nurbs: - 3DG3 - 5 of 11 (curve of surf) - aantal_nurbs - extr1 extr2 - - mat[0][0] mat[0][1] mat[0][2] mat[0][3] - mat[1][0] mat[1][1] mat[1][2] mat[1][3] - ... - - type - pntsu, pntsv - resolu, resolv - orderu, orderv - flagu, flagv - - (als type==nurb) x y z w - x y z w - ... - (als type==bez) xyz xyz xyz h1 h2 h3 - xyz xyz xyz h1 h2 h3 - ... - * - * - */ + * ***** END GPL LICENSE BLOCK *****/ #include /* isdigit, isspace */ @@ -482,385 +442,6 @@ static void read_stl_mesh_ascii(Scene *scene, char *str) #undef STLREADLINE #undef STLREADVERT -static void read_videoscape_mesh(Scene *scene, char *str) -{ - Object *ob; - Mesh *me; - MVert *mvert; - MFace *mface; - Material *ma; - FILE *fp; - float *vertdata, *vd, min[3], max[3], cent[3], ftemp; - unsigned int color[32], col; - int totcol, a, b, verts, tottria=0, totquad=0, totedge=0, poly, nr0, nr, first; - int end; - char s[50]; - - fp= fopen(str, "rb"); - if(fp==NULL) { - //XXX error("Can't read file"); - return; - } - - fscanf(fp, "%40s", s); - - fscanf(fp, "%d\n", &verts); - if(verts<=0) { - fclose(fp); - //XXX error("Read error"); - return; - } - - if(verts>MESH_MAX_VERTS) { - //XXX error("too many vertices"); - fclose(fp); - return; - } - - INIT_MINMAX(min, max); - vd= vertdata= MEM_mallocN(sizeof(float)*3*verts, "videoscapelezer"); - - for(a=0; a0) { - end= fscanf(fp,"%d", &poly); - if(end<=0) break; - - if(poly==3) tottria++; - else if(poly==4) totquad++; - else totedge+= poly; - - for(a=0;a=totcol && totcol<32) { - color[totcol]= col; - totcol++; - } - } - - /* new object */ - ob= add_object(scene, OB_MESH); - me= ob->data; - me->totvert= verts; - me->totface= totedge+tottria+totquad; - - me->mvert= CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, - NULL, me->totvert); - me->mface= CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, - NULL, me->totface); - - /* colors */ - if(totcol) { - ob->mat= MEM_callocN(sizeof(void *)*totcol, "ob->mat"); - me->mat= MEM_callocN(sizeof(void *)*totcol, "me->mat"); - me->totcol= totcol; - ob->totcol= (unsigned char) me->totcol; - ob->actcol= 1; - } - - /* materials */ - for(a=0; amat.first; - while(ma) { - if(ma->mtex[0]==0) { - col= rgb_to_cpack(ma->r, ma->g, ma->b); - if(color[a]==col) { - me->mat[a]= ma; - ma->id.us++; - break; - } - } - ma= ma->id.next; - } - if(ma==0) { - ma= add_material("ext"); - me->mat[a]= ma; - cpack_to_rgb(color[a], cent, cent+1, cent+2); - ma->r= cent[0]; - ma->g= cent[1]; - ma->b= cent[2]; - automatname(ma); - } - } - - /* verts */ - - cent[0]= (min[0]+max[0])/2.0f; - cent[1]= (min[1]+max[1])/2.0f; - cent[2]= (min[2]+max[2])/2.0f; - VECCOPY(ob->loc, cent); - - a= me->totvert; - vd= vertdata; - mvert= me->mvert; - while(a--) { - VecSubf(mvert->co, vd, cent); - mvert++; - vd+= 3; - } - - /* faces */ - if(me->totface) { - rewind(fp); - - fscanf(fp, "%40s", s); - fscanf(fp, "%d\n", &verts); - /* fake read */ - for(a=0;atotface; - mface= me->mface; - while(a--) { - end= fscanf(fp,"%d", &poly); - if(end<=0) break; - - if(poly==3 || poly==4) { - fscanf(fp,"%d", &nr); - mface->v1= MIN2(nr, me->totvert-1); - fscanf(fp,"%d", &nr); - mface->v2= MIN2(nr, me->totvert-1); - fscanf(fp,"%d", &nr); - mface->v3= MIN2(nr, me->totvert-1); - if(poly==4) { - if( fscanf(fp,"%d", &nr) <=0 ) break; - mface->v4= MIN2(nr, me->totvert-1); - } - - test_index_face(mface, NULL, 0, poly); - - mface++; - } - else { - if( fscanf(fp,"%d", &nr0) <=0) break; - first= nr0; - for(b=1; btotvert-1); - mface->v1= nr; - mface->v2= nr0; - nr0= nr; - mface++; - a--; - } - mface->v1= first; - mface->v2= nr; - mface++; - if(end<=0) break; - } - end= fscanf(fp,"%i", &col); - col &= 0xF0F0F0; - if(end<=0) break; - - for(b=0; bmat_nr= b; - break; - } - } - } - } - - fclose(fp); - MEM_freeN(vertdata); - - mesh_add_normals_flags(me); - make_edges(me, 0); - - //XXX waitcursor(1); -} - -static void read_videoscape_lamp(Scene *scene, char *str) -{ - Object *ob; - Lamp *la; - FILE *fp; - float vec[3], q1[4]; - int tot, val; - char s[50]; - - fp= fopen(str, "rb"); - if(fp==NULL) { - //XXX error("Can't read file"); - return; - } - - fscanf(fp, "%40s", s); - fscanf(fp, "%d\n", &tot); - - while(tot--) { - ob= add_object(scene, OB_LAMP); - la= ob->data; - - fscanf(fp, "%d\n", &val); - la->type= val; - if(la->type==1) la->type= LA_SPOT; - else if(la->type==2) la->type= LA_SUN; - - fscanf(fp, "%f %f\n", &la->spotsize, &la->spotblend); - - fscanf(fp, "%f %f %f %f\n", &la->r, &la->g, &la->b, &la->energy); - - fscanf(fp, "%f %f %f\n", ob->loc, ob->loc+1, ob->loc+2); - val= fscanf(fp, "%f %f %f\n", vec, vec+1, vec+2); - vectoquat(vec, 5, 2, q1); - QuatToEul(q1, ob->rot); - - if(val<=0) break; - - } - fclose(fp); -} - -static void read_videoscape_nurbs(Scene *scene, char *str) -{ - Object *ob; - Curve *cu; - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - FILE *fp; - float tmat[4][4], omat[3][3], imat[3][3], mat[3][3]; - int a, tot, type, val; - char s[50]; - - fp= fopen(str, "rb"); - if(fp==NULL) { - //XXX error("Can't read file"); - return; - } - - fscanf(fp, "%40s", s); - fscanf(fp, "%d\n", &type); - - if(type==5) ob= add_object(scene, OB_SURF); - else ob= add_object(scene, OB_CURVE); - cu= ob->data; - - fscanf(fp, "%d\n", &tot); - fscanf(fp, "%d %d\n", &type, &val); - - cu->ext1= 0.002f*type; - cu->ext2= 0.002f*val; - - for(a=0; a<4; a++) fscanf(fp, "%e %e %e %e\n", tmat[a], tmat[a]+1, tmat[a]+2, tmat[a]+3); - - VECCOPY(ob->loc, tmat[3]); - - Mat3CpyMat4(omat, tmat); - Mat3ToEul(omat, ob->rot); - EulToMat3(ob->rot, mat); - Mat3Inv(imat, mat); - Mat3MulMat3((float ( * )[3])tmat, imat, omat); - - while(tot--) { - nu= (Nurb*)MEM_callocN(sizeof(Nurb),"nu from exotic"); - BLI_addtail(&cu->nurb, nu); - - fscanf(fp, "%d\n", &type); - nu->type= type; - - fscanf(fp, "%d %d\n", &type, &val); - nu->pntsu= type; nu->pntsv= val; - fscanf(fp, "%d %d\n", &type, &val); - nu->resolu= type; nu->resolv= val; - fscanf(fp, "%d %d\n", &type, &val); - nu->orderu= type; nu->orderv= val; - fscanf(fp, "%d %d\n", &type, &val); - nu->flagu= type; nu->flagv= val; - - if( (nu->type & 7)==CU_BEZIER) { - a= nu->pntsu; - nu->bezt= bezt= MEM_callocN(a*sizeof(BezTriple), "bezt from exotic"); - while(a--) { - fscanf(fp, "%f %f %f ", bezt->vec[0], bezt->vec[0]+1, bezt->vec[0]+2); - Mat4MulVecfl(tmat, bezt->vec[0]); - fscanf(fp, "%f %f %f ", bezt->vec[1], bezt->vec[1]+1, bezt->vec[1]+2); - Mat4MulVecfl(tmat, bezt->vec[1]); - fscanf(fp, "%f %f %f ", bezt->vec[2], bezt->vec[2]+1, bezt->vec[2]+2); - Mat4MulVecfl(tmat, bezt->vec[2]); - fscanf(fp, "%d %d\n", &type, &val); - bezt->h1= type; - bezt->h2= val; - bezt++; - } - } - else { - a= nu->pntsu*nu->pntsv; - if(a) { - nu->bp= bp= MEM_callocN(a*sizeof(BPoint), "bp from exotic"); - while(a--) { - fscanf(fp, "%f %f %f %f\n", bp->vec, bp->vec+1, bp->vec+2, bp->vec+3); - Mat4MulVecfl(tmat, bp->vec); - bp++; - } - - val= KNOTSU(nu); - nu->knotsu= MEM_mallocN(sizeof(float)*val, "knots"); - for(a=0; aknotsu+a); - - if(nu->pntsv>1) { - val= KNOTSV(nu); - nu->knotsv= MEM_mallocN(sizeof(float)*val, "knots"); - for(a=0; aknotsv+a); - } - } - else { - BLI_remlink(&cu->nurb, nu); - MEM_freeN(nu); - } - } - } - fclose(fp); -} - -static void read_videoscape(Scene *scene, char *str) -{ - int file, type; - unsigned int val; - unsigned short numlen; - char name[FILE_MAXDIR+FILE_MAXFILE], head[FILE_MAXDIR+FILE_MAXFILE], tail[FILE_MAXFILE]; - - strcpy(name, str); - - while( TRUE ) { - file= open(name, O_BINARY|O_RDONLY); - if(file<=0) break; - else { - read(file, &type, 4); - close(file); - - if(type==DDG1) read_videoscape_mesh(scene, name); - else if(type==DDG2) read_videoscape_lamp(scene, name); - else if(type==DDG3) read_videoscape_nurbs(scene, name); - } - - val = BLI_stringdec(name, head, tail, &numlen); - BLI_stringenc(name, head, tail, numlen, val + 1); - - } -} - - /* ***************** INVENTOR ******************* */ @@ -2204,16 +1785,7 @@ int BKE_read_exotic(Scene *scene, char *name) if ((*s0 != FORM) && (strncmp(str, "BLEN", 4) != 0) && !BLI_testextensie(name,".blend.gz")) { //XXX waitcursor(1); - - if(ELEM4(*s0, DDG1, DDG2, DDG3, DDG4)) { - if(0) { // XXX obedit) { - //XXX error("Unable to perform function in EditMode"); - } else { - read_videoscape(scene, name); - retval = 1; - } - } - else if(strncmp(str, "#Inventor V1.0", 14)==0) { + if(strncmp(str, "#Inventor V1.0", 14)==0) { if( strncmp(str+15, "ascii", 5)==0) { read_inventor(scene, name, &lbase); displist_to_objects(scene, &lbase); @@ -2385,167 +1957,6 @@ void write_stl(Scene *scene, char *str) //XXX waitcursor(0); } -static void write_videoscape_mesh(Scene *scene, Object *ob, char *str) -{ - Mesh *me= ob->data; - EditMesh *em = BKE_mesh_get_editmesh(me); - Material *ma; - MFace *mface; - FILE *fp; - EditVert *eve; - EditFace *evl; - unsigned int kleur[32]; - float co[3]; - int a; - intptr_t tot; - char *cp; - - if(ob && ob->type==OB_MESH); - else { - return; - } - - kleur[0]= 0x00C0C0C0; - - cp= (char *)kleur; - for(a=0; atotcol; a++, cp+=4) { - - ma= give_current_material(ob, a+1); - if(ma) { - cp[0]= (unsigned char) (255.0*ma->emit); - cp[1]= (unsigned char) (255.0*ma->b); - cp[2]= (unsigned char) (255.0*ma->g); - cp[3]= (unsigned char) (255.0*ma->r); - if(ENDIAN_ORDER==L_ENDIAN) SWITCH_INT(kleur[a]); - } - else kleur[a]= 0x00C0C0C0; - - if(a>30) break; - } - - fp= fopen(str, "wb"); - if(fp==NULL) return; - - fprintf(fp,"3DG1\n"); - - if(em) { - - fprintf(fp, "%d\n", em->totvert); - - tot= 0; - eve= em->verts.first; - while(eve) { - VECCOPY(co, eve->co); - Mat4MulVecfl(ob->obmat, co); - fprintf(fp, "%f %f %f\n", co[0], co[1], co[2] ); - eve->tmp.l = tot; - tot++; - eve= eve->next; - } - evl= em->faces.first; - while(evl) { - - if(evl->v4==0) { - fprintf(fp, "3 %ld %ld %ld 0x%x\n", - (intptr_t) evl->v1->tmp.l, - (intptr_t) evl->v2->tmp.l, - (intptr_t) evl->v3->tmp.l, - kleur[evl->mat_nr]); - } - else { - fprintf(fp, "4 %ld %ld %ld %ld 0x%x\n", - (intptr_t) evl->v1->tmp.l, - (intptr_t) evl->v2->tmp.l, - (intptr_t) evl->v3->tmp.l, - (intptr_t) evl->v4->tmp.l, - kleur[evl->mat_nr]); - } - evl= evl->next; - } - } - else { - DerivedMesh *dm = mesh_get_derived_deform(scene, ob, CD_MASK_BAREMESH); - - me= ob->data; - - fprintf(fp, "%d\n", me->totvert); - - mface= me->mface; - for(a=0; atotvert; a++) { - dm->getVertCo(dm, a, co); - Mat4MulVecfl(ob->obmat, co); - fprintf(fp, "%f %f %f\n", co[0], co[1], co[2] ); - } - for(a=0; atotface; a++, mface++) { - if(mface->v4==0) { - fprintf(fp, "3 %d %d %d 0x%x\n", mface->v1, mface->v2, mface->v3, kleur[(int)mface->mat_nr]); - } - else { - fprintf(fp, "4 %d %d %d %d 0x%x\n", mface->v1, mface->v2, mface->v3, mface->v4, kleur[(int)mface->mat_nr]); - } - } - - dm->release(dm); - } - - fclose(fp); - - if (em) BKE_mesh_end_editmesh(me, em); - -} - - -void write_videoscape(Scene *scene, char *str) -{ - Base *base; - int file, val, lampdone=0; - unsigned short numlen; - char head[FILE_MAXFILE], tail[FILE_MAXFILE]; - - if(BLI_testextensie(str,".trace")) str[ strlen(str)-6]= 0; - if(BLI_testextensie(str,".blend")) str[ strlen(str)-6]= 0; - if(BLI_testextensie(str,".ble")) str[ strlen(str)-4]= 0; - if(BLI_testextensie(str,".obj")==0) strcat(str, ".obj"); - - file= open(str,O_BINARY|O_RDONLY); - close(file); - //XXX saveover() - // if(file>-1) if(!during_script() && saveover(str)==0) return; - - strcpy(temp_dir, str); - - base= scene->base.first; - while(base) { - if((base->flag & SELECT) && (base->lay & scene->lay)) { - if(base->object->type==OB_MESH) { - write_videoscape_mesh(scene, base->object, str); - val = BLI_stringdec(str, head, tail, &numlen); - BLI_stringenc(str, head, tail, numlen, val + 1); - } - else if(base->object->type==OB_CURVE || base->object->type==OB_SURF) { - /* write_videoscape_nurbs(base->object, str); */ - /* val = stringdec(str, head, tail, &numlen); */ - /* stringenc(str, head, tail, numlen, val + 1); */ - } - else if(lampdone==0 && base->object->type==OB_LAMP) { - /* lampdone= 1; */ - /* write_videoscape_lamps(str); */ - /* val = stringdec(str, head, tail, &numlen); */ - /* stringenc(str, head, tail, numlen, val + 1); */ - } - } - base= base->next; - } - - - /* remove when higher numbers exist */ - while(remove(str)==0) { - - val = BLI_stringdec(str, head, tail, &numlen); - BLI_stringenc(str, head, tail, numlen, val + 1); - } -} - /* ******************************* WRITE VRML ***************************** */ static void replace_chars(char *str1, char *str2) -- cgit v1.2.3 From 6a35c7fc98495a95c726317a84c2029aca046372 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 21 Jun 2009 17:03:17 +0000 Subject: more corrections from cleanup :/ --- source/creator/CMakeLists.txt | 7 +------ source/gameengine/Expressions/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 4701eba810f..ade5a2a64a8 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -198,7 +198,7 @@ ADD_DEPENDENCIES(blender makesdna) FILE(READ ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt BLENDER_LINK_LIBS) -SET(BLENDER_LINK_LIBS bf_nodes ${BLENDER_LINK_LIBS} bf_windowmanager bf_editors blender_render blender_radiosity) +SET(BLENDER_LINK_LIBS bf_nodes ${BLENDER_LINK_LIBS} bf_windowmanager bf_editors blender_render) IF(WITH_ELBEEM) SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} bf_elbeem) @@ -218,7 +218,6 @@ IF(UNIX) bf_ghost bf_string blender_render - blender_radiosity blender_ONL bf_python bf_gen_python @@ -238,7 +237,6 @@ IF(UNIX) bf_kernel bf_decimation bf_elbeem - bf_yafray bf_IK bf_memutil bf_guardedalloc @@ -264,10 +262,7 @@ IF(UNIX) bf_ngnetwork extern_bullet bf_loopbacknetwork - bf_sumo bf_common - extern_solid - extern_qhull bf_moto bf_python bf_gen_python diff --git a/source/gameengine/Expressions/CMakeLists.txt b/source/gameengine/Expressions/CMakeLists.txt index e3942b46557..dffd13f64ff 100644 --- a/source/gameengine/Expressions/CMakeLists.txt +++ b/source/gameengine/Expressions/CMakeLists.txt @@ -32,6 +32,7 @@ SET(INC ../../../intern/string ../../../intern/moto/include ../../../source/gameengine/SceneGraph + ../../../source/blender/blenloader ${PYTHON_INC} ) -- cgit v1.2.3 From 03c46c1e54e762fa81864e4cf2311d8c3f49ea0f Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sun, 21 Jun 2009 17:04:17 +0000 Subject: 2.5/Sculpt: Some improvements to the layer brush; the displacement is now tied to brush size, like for draw and inflate. Fixes for layer brush in subtract mode and anchor mode. --- source/blender/editors/sculpt_paint/sculpt.c | 46 +++++++++++++--------------- 1 file changed, 22 insertions(+), 24 deletions(-) (limited to 'source') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 595c0463632..36d505d5c7c 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -241,7 +241,6 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache) float dir= sd->brush->flag & BRUSH_DIR_IN ? -1 : 1; float pressure= 1; float flip= cache->flip ? -1:1; - float anchored = sd->brush->flag & BRUSH_ANCHORED ? 25 : 1; if(sd->brush->flag & BRUSH_ALPHA_PRESSURE) pressure *= cache->pressure; @@ -251,6 +250,7 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache) case SCULPT_TOOL_INFLATE: case SCULPT_TOOL_CLAY: case SCULPT_TOOL_FLATTEN: + case SCULPT_TOOL_LAYER: return alpha * dir * pressure * flip; /*XXX: not sure why? was multiplied by G.vd->grid */; case SCULPT_TOOL_SMOOTH: return alpha * 4 * pressure; @@ -258,8 +258,6 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache) return alpha / 2 * dir * pressure * flip; case SCULPT_TOOL_GRAB: return 1; - case SCULPT_TOOL_LAYER: - return sd->brush->alpha / 50.0f * dir * pressure * flip * anchored; /*XXX: not sure why? multiplied by G.vd->grid */; default: return 0; } @@ -474,34 +472,29 @@ static void do_layer_brush(Sculpt *sd, SculptSession *ss, const ListBase *active { float area_normal[3]; ActiveData *node= active_verts->first; - float lim= brush_strength(sd, ss->cache); + float lim= ss->cache->radius / 4; - if(sd->brush->flag & BRUSH_DIR_IN) + if(ss->cache->flip) lim = -lim; calc_area_normal(sd, area_normal, active_verts); while(node){ float *disp= &ss->cache->layer_disps[node->Index]; + float *co= ss->mvert[node->Index].co; + float val[3]; - if((lim > 0 && *disp < lim) || - (lim < 0 && *disp > lim)) { - float *co= ss->mvert[node->Index].co; - float val[3]; - - *disp+= node->Fade; - - if(lim < 0 && *disp < lim) - *disp = lim; - else if(lim > 0 && *disp > lim) - *disp = lim; - - val[0] = ss->cache->mesh_store[node->Index][0]+area_normal[0] * *disp*ss->cache->scale[0]; - val[1] = ss->cache->mesh_store[node->Index][1]+area_normal[1] * *disp*ss->cache->scale[1]; - val[2] = ss->cache->mesh_store[node->Index][2]+area_normal[2] * *disp*ss->cache->scale[2]; - //VecMulf(val, ss->cache->radius); - sculpt_clip(ss->cache, co, val); - } + *disp+= node->Fade; + + /* Don't let the displacement go past the limit */ + if((lim < 0 && *disp < lim) || (lim > 0 && *disp > lim)) + *disp = lim; + + val[0] = ss->cache->mesh_store[node->Index][0]+area_normal[0] * *disp*ss->cache->scale[0]; + val[1] = ss->cache->mesh_store[node->Index][1]+area_normal[1] * *disp*ss->cache->scale[1]; + val[2] = ss->cache->mesh_store[node->Index][2]+area_normal[2] * *disp*ss->cache->scale[2]; + + sculpt_clip(ss->cache, co, val); node= node->next; } @@ -1370,9 +1363,11 @@ static void sculpt_update_cache_invariants(Sculpt *sd, bContext *C, wmOperator * sculpt_update_mesh_elements(C); + if(sd->brush->sculpt_tool == SCULPT_TOOL_LAYER) + cache->layer_disps = MEM_callocN(sizeof(float) * sd->session->totvert, "layer brush displacements"); + /* Make copies of the mesh vertex locations and normals for some tools */ if(sd->brush->sculpt_tool == SCULPT_TOOL_LAYER || (sd->brush->flag & BRUSH_ANCHORED)) { - cache->layer_disps = MEM_callocN(sizeof(float) * sd->session->totvert, "layer brush displacements"); cache->mesh_store= MEM_mallocN(sizeof(float) * 3 * sd->session->totvert, "sculpt mesh vertices copy"); for(i = 0; i < sd->session->totvert; ++i) VecCopyf(cache->mesh_store[i], sd->session->mvert[i].co); @@ -1535,6 +1530,9 @@ static void sculpt_restore_mesh(Sculpt *sd) for(i = 0; i < ss->totface; ++i, fn += 3) VecCopyf(fn, cache->face_norms[i]); } + + if(sd->brush->sculpt_tool == SCULPT_TOOL_LAYER) + memset(cache->layer_disps, 0, sizeof(float) * ss->totvert); } } -- cgit v1.2.3 From 1efffc1f564af0597512699890d7be9f41a6aee2 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sun, 21 Jun 2009 18:59:26 +0000 Subject: 2.5/Sculpt: Fixed the Lock X/Y/Z buttons for sculpt, should work for all brushes now. --- source/blender/editors/sculpt_paint/sculpt.c | 73 ++++++++++------------------ 1 file changed, 27 insertions(+), 46 deletions(-) (limited to 'source') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 36d505d5c7c..ac86e2ed962 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -263,39 +263,22 @@ static float brush_strength(Sculpt *sd, StrokeCache *cache) } } -/* For clipping against a mirror modifier */ -static void sculpt_clip(StrokeCache *cache, float *co, const float val[3]) +/* Handles clipping against a mirror modifier and SCULPT_LOCK axis flags */ +static void sculpt_clip(Sculpt *sd, float *co, const float val[3]) { int i; + for(i=0; i<3; ++i) { - if((cache->flag & (CLIP_X << i)) && (fabs(co[i]) <= cache->clip_tolerance[i])) + if(sd->flags & (SCULPT_LOCK_X << i)) + continue; + + if((sd->session->cache->flag & (CLIP_X << i)) && (fabs(co[i]) <= sd->session->cache->clip_tolerance[i])) co[i]= 0.0f; else co[i]= val[i]; } } -static void sculpt_axislock(Sculpt *sd, float *co) -{ - if(sd->flags == (SCULPT_LOCK_X|SCULPT_LOCK_Y|SCULPT_LOCK_Z)) - return; - - if(sd->session->cache->vc.v3d->twmode == V3D_MANIP_LOCAL) { - float mat[3][3], imat[3][3]; - Mat3CpyMat4(mat, sd->session->cache->vc.obact->obmat); - Mat3Inv(imat, mat); - Mat3MulVecfl(mat, co); - if (sd->flags & SCULPT_LOCK_X) co[0] = 0.0; - if (sd->flags & SCULPT_LOCK_Y) co[1] = 0.0; - if (sd->flags & SCULPT_LOCK_Z) co[2] = 0.0; - Mat3MulVecfl(imat, co); - } else { - if (sd->flags & SCULPT_LOCK_X) co[0] = 0.0; - if (sd->flags & SCULPT_LOCK_Y) co[1] = 0.0; - if (sd->flags & SCULPT_LOCK_Z) co[2] = 0.0; - } -} - static void add_norm_if(float view_vec[3], float out[3], float out_flip[3], const short no[3]) { float fno[3] = {no[0], no[1], no[2]}; @@ -352,8 +335,6 @@ static void do_draw_brush(Sculpt *sd, SculptSession *ss, const ListBase* active_ calc_area_normal(sd, area_normal, active_verts); - sculpt_axislock(sd, area_normal); - while(node){ float *co= ss->mvert[node->Index].co; @@ -361,7 +342,7 @@ static void do_draw_brush(Sculpt *sd, SculptSession *ss, const ListBase* active_ co[1]+area_normal[1]*ss->cache->radius*node->Fade*ss->cache->scale[1], co[2]+area_normal[2]*ss->cache->radius*node->Fade*ss->cache->scale[2]}; - sculpt_clip(ss->cache, co, val); + sculpt_clip(sd, co, val); node= node->next; } @@ -411,37 +392,37 @@ static void neighbor_average(SculptSession *ss, float avg[3], const int vert) VecCopyf(avg, ss->mvert[vert].co); } -static void do_smooth_brush(SculptSession *ss, const ListBase* active_verts) +static void do_smooth_brush(Sculpt *s, const ListBase* active_verts) { ActiveData *node= active_verts->first; int i; for(i = 0; i < 2; ++i) { while(node){ - float *co= ss->mvert[node->Index].co; + float *co= s->session->mvert[node->Index].co; float avg[3], val[3]; - neighbor_average(ss, avg, node->Index); + neighbor_average(s->session, avg, node->Index); val[0] = co[0]+(avg[0]-co[0])*node->Fade; val[1] = co[1]+(avg[1]-co[1])*node->Fade; val[2] = co[2]+(avg[2]-co[2])*node->Fade; - sculpt_clip(ss->cache, co, val); + sculpt_clip(s, co, val); node= node->next; } } } -static void do_pinch_brush(SculptSession *ss, const ListBase* active_verts) +static void do_pinch_brush(Sculpt *s, const ListBase* active_verts) { ActiveData *node= active_verts->first; while(node) { - float *co= ss->mvert[node->Index].co; - const float val[3]= {co[0]+(ss->cache->location[0]-co[0])*node->Fade, - co[1]+(ss->cache->location[1]-co[1])*node->Fade, - co[2]+(ss->cache->location[2]-co[2])*node->Fade}; - sculpt_clip(ss->cache, co, val); + float *co= s->session->mvert[node->Index].co; + const float val[3]= {co[0]+(s->session->cache->location[0]-co[0])*node->Fade, + co[1]+(s->session->cache->location[1]-co[1])*node->Fade, + co[2]+(s->session->cache->location[2]-co[2])*node->Fade}; + sculpt_clip(s, co, val); node= node->next; } } @@ -453,7 +434,6 @@ static void do_grab_brush(Sculpt *sd, SculptSession *ss) float grab_delta[3]; VecCopyf(grab_delta, ss->cache->grab_delta_symmetry); - sculpt_axislock(sd, grab_delta); while(node) { float *co= ss->mvert[node->Index].co; @@ -461,7 +441,7 @@ static void do_grab_brush(Sculpt *sd, SculptSession *ss) VecCopyf(add, grab_delta); VecMulf(add, node->Fade); VecAddf(add, add, co); - sculpt_clip(ss->cache, co, add); + sculpt_clip(sd, co, add); node= node->next; } @@ -494,15 +474,16 @@ static void do_layer_brush(Sculpt *sd, SculptSession *ss, const ListBase *active val[1] = ss->cache->mesh_store[node->Index][1]+area_normal[1] * *disp*ss->cache->scale[1]; val[2] = ss->cache->mesh_store[node->Index][2]+area_normal[2] * *disp*ss->cache->scale[2]; - sculpt_clip(ss->cache, co, val); + sculpt_clip(sd, co, val); node= node->next; } } -static void do_inflate_brush(SculptSession *ss, const ListBase *active_verts) +static void do_inflate_brush(Sculpt *s, const ListBase *active_verts) { ActiveData *node= active_verts->first; + SculptSession *ss = s->session; float add[3]; while(node) { @@ -518,7 +499,7 @@ static void do_inflate_brush(SculptSession *ss, const ListBase *active_verts) add[2]*= ss->cache->scale[2]; VecAddf(add, add, co); - sculpt_clip(ss->cache, co, add); + sculpt_clip(s, co, add); node= node->next; } @@ -581,7 +562,7 @@ static void do_flatten_clay_brush(Sculpt *sd, SculptSession *ss, const ListBase VecAddf(val, val, tmp); } - sculpt_clip(ss->cache, co, val); + sculpt_clip(sd, co, val); node= node->next; } @@ -839,13 +820,13 @@ static void do_brush_action(Sculpt *sd, StrokeCache *cache) do_draw_brush(sd, ss, &active_verts); break; case SCULPT_TOOL_SMOOTH: - do_smooth_brush(ss, &active_verts); + do_smooth_brush(sd, &active_verts); break; case SCULPT_TOOL_PINCH: - do_pinch_brush(ss, &active_verts); + do_pinch_brush(sd, &active_verts); break; case SCULPT_TOOL_INFLATE: - do_inflate_brush(ss, &active_verts); + do_inflate_brush(sd, &active_verts); break; case SCULPT_TOOL_GRAB: do_grab_brush(sd, ss); -- cgit v1.2.3 From aea9dd598c72fa5ee4bcbe6198b3b81e739373a1 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 22 Jun 2009 03:26:36 +0000 Subject: NLA SoC: DopeSheet Cleanups * Replaced old-style menu defines with the new-style Layout Engine ones. These are now much cleaner as a result :) * Wrapped DopeSheet and Graph Editors in RNA to allow them to use the new Layout Engine for menu drawing * Shortened the names of operators in the DopeSheet, removing the "keyframes" prefix since that's the only real context which can operate there. * Standardised a few names, and renamed a confusingly named operator (cfrasnap -> jump to frame) --- source/blender/editors/include/ED_anim_api.h | 3 +- source/blender/editors/space_action/action_edit.c | 60 +- .../blender/editors/space_action/action_header.c | 1553 ++------------------ .../blender/editors/space_action/action_intern.h | 35 +- source/blender/editors/space_action/action_ops.c | 89 +- .../blender/editors/space_action/action_select.c | 16 +- source/blender/editors/space_nla/nla_header.c | 5 + source/blender/makesrna/RNA_access.h | 2 + source/blender/makesrna/intern/rna_space.c | 102 +- 9 files changed, 325 insertions(+), 1540 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index e44c7ff5603..8c54c4e8f67 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -142,7 +142,6 @@ typedef enum eAnim_KeyType { ALE_GPFRAME, /* Grease Pencil Frames */ ALE_NLASTRIP, /* NLA Strips */ - // XXX the following are for summaries... should these be kept? ALE_SCE, /* Scene summary */ ALE_OB, /* Object summary */ ALE_ACT, /* Action summary */ @@ -311,7 +310,7 @@ void ipo_rainbow(int cur, int tot, float *out); /* ------------- NLA-Mapping ----------------------- */ /* anim_draw.c */ -// XXX these are soon to be depreceated? +// XXX these need attention for the new editing method... /* Obtain the Object providing NLA-scaling for the given channel if applicable */ struct Object *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale); diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 27be82ccec0..b2f4751fa25 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -307,11 +307,11 @@ static int actkeys_copy_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_copy (wmOperatorType *ot) +void ACT_OT_copy (wmOperatorType *ot) { /* identifiers */ ot->name= "Copy Keyframes"; - ot->idname= "ACT_OT_keyframes_copy"; + ot->idname= "ACT_OT_copy"; /* api callbacks */ ot->exec= actkeys_copy_exec; @@ -351,11 +351,11 @@ static int actkeys_paste_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_paste (wmOperatorType *ot) +void ACT_OT_paste (wmOperatorType *ot) { /* identifiers */ ot->name= "Paste Keyframes"; - ot->idname= "ACT_OT_keyframes_paste"; + ot->idname= "ACT_OT_paste"; /* api callbacks */ ot->exec= actkeys_paste_exec; @@ -447,11 +447,11 @@ static int actkeys_insertkey_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_insert (wmOperatorType *ot) +void ACT_OT_insert (wmOperatorType *ot) { /* identifiers */ ot->name= "Insert Keyframes"; - ot->idname= "ACT_OT_keyframes_insert"; + ot->idname= "ACT_OT_insert"; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -524,11 +524,11 @@ static int actkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_duplicate (wmOperatorType *ot) +void ACT_OT_duplicate (wmOperatorType *ot) { /* identifiers */ ot->name= "Duplicate Keyframes"; - ot->idname= "ACT_OT_keyframes_duplicate"; + ot->idname= "ACT_OT_duplicate"; /* api callbacks */ ot->invoke= actkeys_duplicate_invoke; @@ -591,11 +591,11 @@ static int actkeys_delete_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_delete (wmOperatorType *ot) +void ACT_OT_delete (wmOperatorType *ot) { /* identifiers */ ot->name= "Delete Keyframes"; - ot->idname= "ACT_OT_keyframes_delete"; + ot->idname= "ACT_OT_delete"; /* api callbacks */ ot->invoke= WM_operator_confirm; @@ -654,11 +654,11 @@ static int actkeys_clean_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_clean (wmOperatorType *ot) +void ACT_OT_clean (wmOperatorType *ot) { /* identifiers */ ot->name= "Clean Keyframes"; - ot->idname= "ACT_OT_keyframes_clean"; + ot->idname= "ACT_OT_clean"; /* api callbacks */ //ot->invoke= // XXX we need that number popup for this! @@ -778,11 +778,11 @@ static int actkeys_sample_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_sample (wmOperatorType *ot) +void ACT_OT_sample (wmOperatorType *ot) { /* identifiers */ ot->name= "Sample Keyframes"; - ot->idname= "ACT_OT_keyframes_sample"; + ot->idname= "ACT_OT_sample"; /* api callbacks */ ot->exec= actkeys_sample_exec; @@ -853,11 +853,11 @@ static int actkeys_expo_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_extrapolation_type_set (wmOperatorType *ot) +void ACT_OT_extrapolation_type_set (wmOperatorType *ot) { /* identifiers */ ot->name= "Set Keyframe Extrapolation"; - ot->idname= "ACT_OT_keyframes_extrapolation_type_set"; + ot->idname= "ACT_OT_extrapolation_type_set"; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -923,11 +923,11 @@ static int actkeys_ipo_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_interpolation_type (wmOperatorType *ot) +void ACT_OT_interpolation_type_set (wmOperatorType *ot) { /* identifiers */ ot->name= "Set Keyframe Interpolation"; - ot->idname= "ACT_OT_keyframes_interpolation_type"; + ot->idname= "ACT_OT_interpolation_type_set"; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1011,11 +1011,11 @@ static int actkeys_handletype_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_handle_type_set (wmOperatorType *ot) +void ACT_OT_handle_type_set (wmOperatorType *ot) { /* identifiers */ ot->name= "Set Keyframe Handle Type"; - ot->idname= "ACT_OT_keyframes_handle_type_set"; + ot->idname= "ACT_OT_handle_type_set"; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1032,10 +1032,10 @@ void ACT_OT_keyframes_handle_type_set (wmOperatorType *ot) /* ************************************************************************** */ /* TRANSFORM STUFF */ -/* ***************** Snap Current Frame Operator *********************** */ +/* ***************** Jump to Selected Frames Operator *********************** */ /* snap current-frame indicator to 'average time' of selected keyframe */ -static int actkeys_cfrasnap_exec(bContext *C, wmOperator *op) +static int actkeys_framejump_exec(bContext *C, wmOperator *op) { bAnimContext ac; ListBase anim_data= {NULL, NULL}; @@ -1071,14 +1071,14 @@ static int actkeys_cfrasnap_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_cfrasnap (wmOperatorType *ot) +void ACT_OT_frame_jump (wmOperatorType *ot) { /* identifiers */ - ot->name= "Snap Current Frame to Keys"; - ot->idname= "ACT_OT_keyframes_cfrasnap"; + ot->name= "Jump to Frame"; + ot->idname= "ACT_OT_frame_jump"; /* api callbacks */ - ot->exec= actkeys_cfrasnap_exec; + ot->exec= actkeys_framejump_exec; ot->poll= ED_operator_action_active; /* flags */ @@ -1166,11 +1166,11 @@ static int actkeys_snap_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_snap (wmOperatorType *ot) +void ACT_OT_snap (wmOperatorType *ot) { /* identifiers */ ot->name= "Snap Keys"; - ot->idname= "ACT_OT_keyframes_snap"; + ot->idname= "ACT_OT_snap"; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1282,11 +1282,11 @@ static int actkeys_mirror_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_mirror (wmOperatorType *ot) +void ACT_OT_mirror (wmOperatorType *ot) { /* identifiers */ ot->name= "Mirror Keys"; - ot->idname= "ACT_OT_keyframes_mirror"; + ot->idname= "ACT_OT_mirror"; /* api callbacks */ ot->invoke= WM_menu_invoke; diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index fa96e1ea81f..1bc30b2ac42 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -51,11 +51,14 @@ #include "ED_types.h" #include "ED_util.h" +#include "RNA_access.h" + #include "WM_api.h" #include "WM_types.h" #include "BIF_gl.h" #include "BIF_glutil.h" +#include "BIF_transform.h" #include "UI_interface.h" #include "UI_resources.h" @@ -63,1494 +66,183 @@ #include "action_intern.h" -/* ********************************************************* */ -/* Menu Defines... */ - -/* button events */ -enum { - B_REDR = 0, - B_ACTCOPYKEYS, - B_ACTPASTEKEYS, -} eActHeader_ButEvents; - -/* ------------------------------- */ -/* enums declaring constants that are used as menu event codes */ - -enum { - ACTMENU_VIEW_CENTERVIEW= 0, - ACTMENU_VIEW_AUTOUPDATE, - ACTMENU_VIEW_PLAY3D, - ACTMENU_VIEW_PLAYALL, - ACTMENU_VIEW_ALL, - ACTMENU_VIEW_MAXIMIZE, - ACTMENU_VIEW_LOCK, - ACTMENU_VIEW_SLIDERS, - ACTMENU_VIEW_NEXTMARKER, - ACTMENU_VIEW_PREVMARKER, - ACTMENU_VIEW_NEXTKEYFRAME, - ACTMENU_VIEW_PREVKEYFRAME, - ACTMENU_VIEW_TIME, - ACTMENU_VIEW_NOHIDE, - ACTMENU_VIEW_FRANUM, - ACTMENU_VIEW_TRANSDELDUPS, - ACTMENU_VIEW_HORIZOPTIMISE, - ACTMENU_VIEW_GCOLORS, - ACTMENU_VIEW_PREVRANGESET, - ACTMENU_VIEW_PREVRANGECLEAR, - ACTMENU_VIEW_PREVRANGEAUTO -}; - -enum { - ACTMENU_SEL_BORDER = 0, - ACTMENU_SEL_BORDERC, - ACTMENU_SEL_BORDERM, - ACTMENU_SEL_ALL_KEYS, - ACTMENU_SEL_ALL_CHAN, - ACTMENU_SEL_ALL_MARKERS, - ACTMENU_SEL_INVERSE_KEYS, - ACTMENU_SEL_INVERSE_MARKERS, - ACTMENU_SEL_INVERSE_CHANNELS, - ACTMENU_SEL_LEFTKEYS, - ACTMENU_SEL_RIGHTKEYS -}; - -enum { - ACTMENU_SEL_COLUMN_KEYS = 1, - ACTMENU_SEL_COLUMN_CFRA, - ACTMENU_SEL_COLUMN_MARKERSCOLUMN, - ACTMENU_SEL_COLUMN_MARKERSBETWEEN -}; - -enum { - ACTMENU_CHANNELS_OPENLEVELS = 0, - ACTMENU_CHANNELS_CLOSELEVELS, - ACTMENU_CHANNELS_EXPANDALL, - ACTMENU_CHANNELS_SHOWACHANS, - ACTMENU_CHANNELS_DELETE -}; - -enum { - ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_UP = 0, - ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_DOWN, - ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_TOP, - ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_BOTTOM -}; - -enum { - ACTMENU_CHANNELS_GROUP_ADD_TOACTIVE = 0, - ACTMENU_CHANNELS_GROUP_ADD_TONEW, - ACTMENU_CHANNELS_GROUP_REMOVE, - ACTMENU_CHANNELS_GROUP_SYNCPOSE -}; - -enum { - ACTMENU_CHANNELS_SETTINGS_TOGGLE = 0, - ACTMENU_CHANNELS_SETTINGS_ENABLE, - ACTMENU_CHANNELS_SETTINGS_DISABLE, -}; - -enum { - ACTMENU_KEY_DUPLICATE = 0, - ACTMENU_KEY_DELETE, - ACTMENU_KEY_CLEAN, - ACTMENU_KEY_SAMPLEKEYS, - ACTMENU_KEY_INSERTKEY -}; - -enum { - ACTMENU_KEY_TRANSFORM_MOVE = 0, - ACTMENU_KEY_TRANSFORM_SCALE, - ACTMENU_KEY_TRANSFORM_SLIDE, - ACTMENU_KEY_TRANSFORM_EXTEND -}; - -enum { - ACTMENU_KEY_HANDLE_AUTO = 0, - ACTMENU_KEY_HANDLE_ALIGN, - ACTMENU_KEY_HANDLE_FREE, - ACTMENU_KEY_HANDLE_VECTOR -}; - enum { - ACTMENU_KEY_INTERP_CONST = 0, - ACTMENU_KEY_INTERP_LINEAR, - ACTMENU_KEY_INTERP_BEZIER -}; + B_REDR= 0, +} eActHeader_Events; -enum { - ACTMENU_KEY_EXTEND_CONST = 0, - ACTMENU_KEY_EXTEND_EXTRAPOLATION, - ACTMENU_KEY_EXTEND_CYCLIC, - ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION -}; - -enum { - ACTMENU_KEY_SNAP_NEARFRAME = 1, - ACTMENU_KEY_SNAP_CURFRAME, - ACTMENU_KEY_SNAP_NEARMARK, - ACTMENU_KEY_SNAP_NEARTIME, - ACTMENU_KEY_SNAP_CFRA2KEY, -}; - -enum { - ACTMENU_KEY_MIRROR_CURFRAME = 1, - ACTMENU_KEY_MIRROR_YAXIS, - ACTMENU_KEY_MIRROR_XAXIS, - ACTMENU_KEY_MIRROR_MARKER -}; - -enum { - ACTMENU_MARKERS_ADD = 0, - ACTMENU_MARKERS_DUPLICATE, - ACTMENU_MARKERS_DELETE, - ACTMENU_MARKERS_NAME, - ACTMENU_MARKERS_MOVE, - ACTMENU_MARKERS_LOCALADD, - ACTMENU_MARKERS_LOCALRENAME, - ACTMENU_MARKERS_LOCALDELETE, - ACTMENU_MARKERS_LOCALMOVE -}; - -/* ------------------------------- */ -/* macros for easier state testing (only for use here) */ - -/* test if active action editor is showing any markers */ -#if 0 - #define SACTION_HASMARKERS \ - ((saction->action && saction->action->markers.first) \ - || (scene->markers.first)) -#endif - -/* need to find out how to get scene from context */ -#define SACTION_HASMARKERS (saction->action && saction->action->markers.first) - -/* ------------------------------- */ - -/* *************************************************************** */ -/* menus */ - -/* Key menu --------------------------- */ - -static void do_keymenu_transformmenu(bContext *C, void *arg, int event) -{ - switch (event) - { - case ACTMENU_KEY_TRANSFORM_MOVE: - //transform_action_keys('g', 0); - break; - case ACTMENU_KEY_TRANSFORM_SCALE: - //transform_action_keys('s', 0); - break; - case ACTMENU_KEY_TRANSFORM_SLIDE: - //transform_action_keys('t', 0); - break; - case ACTMENU_KEY_TRANSFORM_EXTEND: - //transform_action_keys('e', 0); - break; - } -} +/* ********************************************************* */ +/* Menu Defines... */ -static uiBlock *action_keymenu_transformmenu(bContext *C, ARegion *ar, void *arg_unused) +static void act_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "action_keymenu_transformmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_keymenu_transformmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_TRANSFORM_MOVE, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Grab/Extend from Frame|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_TRANSFORM_EXTEND, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_TRANSFORM_SCALE, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Time Slide|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_TRANSFORM_SLIDE, ""); - - uiBlockSetDirection(block, UI_RIGHT); - - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); + bScreen *sc= CTX_wm_screen(C); + ScrArea *sa= CTX_wm_area(C); + SpaceAction *sact= (SpaceAction*)CTX_wm_space_data(C); + PointerRNA spaceptr; - return block; -} - -static void do_keymenu_snapmenu(bContext *C, void *arg, int event) -{ - switch(event) - { - case ACTMENU_KEY_SNAP_NEARFRAME: - case ACTMENU_KEY_SNAP_CURFRAME: - case ACTMENU_KEY_SNAP_NEARMARK: - case ACTMENU_KEY_SNAP_NEARTIME: - //snap_action_keys(event); - break; - - case ACTMENU_KEY_SNAP_CFRA2KEY: - //snap_cfra_action(); - break; - } -} - -static uiBlock *action_keymenu_snapmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - SpaceAction *saction= (SpaceAction*)CTX_wm_space_data(C); - uiBlock *block; - short yco= 0, menuwidth=120; - + /* retrieve state */ + RNA_pointer_create(&sc->id, &RNA_SpaceDopeSheetEditor, sact, &spaceptr); - block= uiBeginBlock(C, ar, "action_keymenu_snapmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_keymenu_snapmenu, NULL); - - if (saction->flag & SACTION_DRAWTIME) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Key -> Nearest Second|Shift S, 1", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_SNAP_NEARTIME, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Key -> Current Time|Shift S, 2", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_SNAP_CURFRAME, ""); - - } - else { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Key -> Nearest Frame|Shift S, 1", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_SNAP_NEARFRAME, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Key -> Current Frame|Shift S, 2", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_SNAP_CURFRAME, ""); - } - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Key -> Nearest Marker|Shift S, 3", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_SNAP_NEARMARK, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Current Frame -> Key|Ctrl Shift S", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_SNAP_NEARMARK, ""); + /* create menu */ + //uiItemO(layout, NULL, ICON_MENU_PANEL, "ACT_OT_properties"); - uiBlockSetDirection(block, UI_RIGHT); + //uiItemS(layout); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); + uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0, 0, 0); + uiItemR(layout, NULL, 0, &spaceptr, "show_sliders", 0, 0, 0); + uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0, 0, 0); - return block; -} - -static void do_keymenu_mirrormenu(bContext *C, void *arg, int event) -{ - switch(event) - { - case ACTMENU_KEY_MIRROR_CURFRAME: - case ACTMENU_KEY_MIRROR_YAXIS: - //mirror_action_keys(event); - break; - } - -} - -static uiBlock *action_keymenu_mirrormenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; + if (sact->flag & SACTION_DRAWTIME) + uiItemO(layout, "Show Frames", 0, "ANIM_OT_time_toggle"); + else + uiItemO(layout, "Show Seconds", 0, "ANIM_OT_time_toggle"); - block= uiBeginBlock(C, ar, "action_keymenu_mirrormenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_keymenu_mirrormenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Current Frame|Shift M, 1", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_MIRROR_CURFRAME, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Vertical Axis|Shift M, 2", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_MIRROR_YAXIS, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Horizontal Axis|Shift M, 3", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_MIRROR_XAXIS, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Selected Marker|Shift M, 4", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_MIRROR_MARKER, ""); + uiItemS(layout); - uiBlockSetDirection(block, UI_RIGHT); + uiItemO(layout, NULL, 0, "ANIM_OT_previewrange_set"); + uiItemO(layout, NULL, 0, "ANIM_OT_previewrange_clear"); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); + uiItemO(layout, NULL, 0, "ACT_OT_previewrange_set"); - return block; -} - -static void do_keymenu_handlemenu(bContext *C, void *arg, int event) -{ - switch (event) { - case ACTMENU_KEY_HANDLE_AUTO: - //sethandles_action_keys(HD_AUTO); - break; - - case ACTMENU_KEY_HANDLE_ALIGN: - case ACTMENU_KEY_HANDLE_FREE: - /* OK, this is kinda dumb, need to fix the - * toggle crap in sethandles_ipo_keys() - */ - //sethandles_action_keys(HD_ALIGN); - break; - - case ACTMENU_KEY_HANDLE_VECTOR: - //sethandles_action_keys(HD_VECT); - break; - } -} - -static uiBlock *action_keymenu_handlemenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; + uiItemS(layout); - block= uiBeginBlock(C, ar, "action_keymenu_handlemenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_keymenu_handlemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Auto|Shift H", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_HANDLE_AUTO, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Aligned|H", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_HANDLE_ALIGN, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Free|H", 0, yco-=20, menuwidth, - 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_HANDLE_FREE, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Vector|V", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_HANDLE_VECTOR, ""); + uiItemO(layout, NULL, 0, "ACT_OT_frame_jump"); - uiBlockSetDirection(block, UI_RIGHT); + uiItemO(layout, NULL, 0, "ACT_OT_view_all"); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); - - return block; -} - -static void do_keymenu_extendmenu(bContext *C, void *arg, int event) -{ - switch(event) - { - case ACTMENU_KEY_EXTEND_CONST: - //action_set_ipo_flags(SET_EXTEND_MENU, SET_EXTEND_CONSTANT); - break; - case ACTMENU_KEY_EXTEND_EXTRAPOLATION: - //action_set_ipo_flags(SET_EXTEND_MENU, SET_EXTEND_EXTRAPOLATION); - break; - case ACTMENU_KEY_EXTEND_CYCLIC: - //action_set_ipo_flags(SET_EXTEND_MENU, SET_EXTEND_CYCLIC); - break; - case ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION: - //action_set_ipo_flags(SET_EXTEND_MENU, SET_EXTEND_CYCLICEXTRAPOLATION); - break; - } + if (sa->full) + uiItemO(layout, NULL, 0, "SCREEN_OT_screen_full_area"); // "Tile Window", Ctrl UpArrow + else + uiItemO(layout, NULL, 0, "SCREEN_OT_screen_full_area"); // "Maximize Window", Ctrl DownArrow } -static uiBlock *action_keymenu_extendmenu(bContext *C, ARegion *ar, void *arg_unused) +static void act_selectmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiBlock *block; - short yco= 0, menuwidth=120; + uiItemO(layout, NULL, 0, "ACT_OT_select_all_toggle"); + uiItemBooleanO(layout, "Invert All", 0, "ACT_OT_select_all_toggle", "invert", 1); - block= uiBeginBlock(C, ar, "action_keymenu_extendmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_keymenu_extendmenu, NULL); + uiItemS(layout); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Constant", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_EXTEND_CONST, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Extrapolation", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_EXTEND_EXTRAPOLATION, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Cyclic", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_EXTEND_CYCLIC, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Cyclic Extrapolation", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION, ""); + uiItemO(layout, NULL, 0, "ACT_OT_select_border"); + uiItemBooleanO(layout, "Border Axis Range", 0, "ACT_OT_select_border", "axis_range", 1); - uiBlockSetDirection(block, UI_RIGHT); + uiItemS(layout); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); + uiItemEnumO(layout, "Columns on Selected Keys", 0, "ACT_OT_select_column", "mode", ACTKEYS_COLUMNSEL_KEYS); + uiItemEnumO(layout, "Column on Current Frame", 0, "ACT_OT_select_column", "mode", ACTKEYS_COLUMNSEL_CFRA); - return block; + uiItemEnumO(layout, "Columns on Selected Markers", 0, "ACT_OT_select_column", "mode", ACTKEYS_COLUMNSEL_MARKERS_COLUMN); + uiItemEnumO(layout, "Between Selected Markers", 0, "ACT_OT_select_column", "mode", ACTKEYS_COLUMNSEL_MARKERS_BETWEEN); } -static void do_keymenu_intpolmenu(bContext *C, void *arg, int event) +static void act_channelmenu(bContext *C, uiLayout *layout, void *arg_unused) { - switch(event) - { - case ACTMENU_KEY_INTERP_CONST: - //action_set_ipo_flags(SET_IPO_MENU, SET_IPO_CONSTANT); - break; - case ACTMENU_KEY_INTERP_LINEAR: - //action_set_ipo_flags(SET_IPO_MENU, SET_IPO_LINEAR); - break; - case ACTMENU_KEY_INTERP_BEZIER: - //action_set_ipo_flags(SET_IPO_MENU, SET_IPO_BEZIER); - break; - } -} - -static uiBlock *action_keymenu_intpolmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; + uiItemO(layout, NULL, 0, "ANIM_OT_channels_setting_toggle"); + uiItemO(layout, NULL, 0, "ANIM_OT_channels_setting_enable"); + uiItemO(layout, NULL, 0, "ANIM_OT_channels_setting_disable"); - block= uiBeginBlock(C, ar, "action_keymenu_intpolmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_keymenu_intpolmenu, NULL); + uiItemS(layout); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Constant|Shift T, 1", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_INTERP_CONST, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Linear|Shift T, 2", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_INTERP_LINEAR, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Bezier|Shift T, 3", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_INTERP_BEZIER, ""); + uiItemO(layout, NULL, 0, "ANIM_OT_channels_editable_toggle"); - uiBlockSetDirection(block, UI_RIGHT); + uiItemS(layout); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); - - return block; + uiItemO(layout, NULL, 0, "ANIM_OT_channels_expand"); + uiItemO(layout, NULL, 0, "ANIM_OT_channels_collapse"); } -static void do_action_keymenu(bContext *C, void *arg, int event) +static void act_gplayermenu(bContext *C, uiLayout *layout, void *arg_unused) { - SpaceAction *saction= (SpaceAction*)CTX_wm_space_data(C); - bAction *act; - //Key *key; - - if (!saction) return; - - act = saction->action; - //key = get_action_mesh_key(); - - switch(event) - { - case ACTMENU_KEY_DUPLICATE: - //duplicate_action_keys(); - break; - case ACTMENU_KEY_DELETE: - //delete_action_keys(); - break; - case ACTMENU_KEY_CLEAN: - //clean_action(); - break; - case ACTMENU_KEY_SAMPLEKEYS: - //sample_action_keys(); - break; - case ACTMENU_KEY_INSERTKEY: - //insertkey_action(); - break; - } + //uiItemMenuF(layout, "Transform", 0, nla_edit_transformmenu); + //uiItemS(layout); + //uiItemO(layout, NULL, 0, "NLAEDIT_OT_duplicate"); } -static uiBlock *action_keymenu(bContext *C, ARegion *ar, void *arg_unused) +static void act_edit_transformmenu(bContext *C, uiLayout *layout, void *arg_unused) { - ScrArea *curarea= CTX_wm_area(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "action_keymenu", UI_EMBOSSP); - - - uiBlockSetButmFunc(block, do_action_keymenu, NULL); - - uiDefIconTextBlockBut(block, action_keymenu_transformmenu, - NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 20, ""); - - uiDefIconTextBlockBut(block, action_keymenu_snapmenu, - NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 20, ""); - - uiDefIconTextBlockBut(block, action_keymenu_mirrormenu, - NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 20, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Insert Key|I", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_INSERTKEY, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Duplicate|Shift D", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_DUPLICATE, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Delete|X", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_DELETE, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Clean Action|O", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_CLEAN, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Sample Keys|Alt O", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_SAMPLEKEYS, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, action_keymenu_handlemenu, - NULL, ICON_RIGHTARROW_THIN, - "Handle Type", 0, yco-=20, 120, 20, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, action_keymenu_extendmenu, - NULL, ICON_RIGHTARROW_THIN, - "Extend Mode", 0, yco-=20, 120, 20, ""); - uiDefIconTextBlockBut(block, action_keymenu_intpolmenu, - NULL, ICON_RIGHTARROW_THIN, - "Interpolation Mode", 0, yco-=20, 120, 20, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - uiEndBlock(C, block); - - return block; + uiItemEnumO(layout, "Grab/Move", 0, "TFM_OT_transform", "mode", TFM_TIME_TRANSLATE); + uiItemEnumO(layout, "Extend", 0, "TFM_OT_transform", "mode", TFM_TIME_EXTEND); + uiItemEnumO(layout, "Scale", 0, "TFM_OT_transform", "mode", TFM_TIME_SCALE); } -/* Frame menu --------------------------- */ - - -// framemenu uses functions from keymenu -static uiBlock *action_framemenu(bContext *C, ARegion *ar, void *arg_unused) +static void act_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused) { - ScrArea *curarea= CTX_wm_area(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "action_framemenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_action_keymenu, NULL); - - uiDefIconTextBlockBut(block, action_keymenu_transformmenu, - NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 20, ""); - - uiDefIconTextBlockBut(block, action_keymenu_snapmenu, - NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 20, ""); - - uiDefIconTextBlockBut(block, action_keymenu_mirrormenu, - NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 20, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Duplicate|Shift D", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_DUPLICATE, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Delete|X", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_DELETE, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - uiEndBlock(C, block); - - return block; + uiItemEnumO(layout, "To Current Frame", 0, "ACT_OT_snap", "mode", ACTKEYS_SNAP_CFRA); + uiItemEnumO(layout, "To Nearest Frame", 0, "ACT_OT_snap", "mode", ACTKEYS_SNAP_NEAREST_FRAME); + uiItemEnumO(layout, "To Nearest Second", 0, "ACT_OT_snap", "mode", ACTKEYS_SNAP_NEAREST_SECOND); + uiItemEnumO(layout, "To Nearest Marker", 0, "ACT_OT_snap", "mode", ACTKEYS_SNAP_NEAREST_MARKER); } -/* Marker menu --------------------------- */ - -static void do_markermenu(bContext *C, void *arg, int event) +static void act_edit_mirrormenu(bContext *C, uiLayout *layout, void *arg_unused) { - switch(event) - { - case ACTMENU_MARKERS_ADD: - //add_marker(CFRA); - break; - case ACTMENU_MARKERS_DUPLICATE: - //duplicate_marker(); - break; - case ACTMENU_MARKERS_DELETE: - //remove_marker(); - break; - case ACTMENU_MARKERS_NAME: - //rename_marker(); - break; - case ACTMENU_MARKERS_MOVE: - //transform_markers('g', 0); - break; - case ACTMENU_MARKERS_LOCALADD: - //action_add_localmarker(G.saction->action, CFRA); - break; - case ACTMENU_MARKERS_LOCALDELETE: - //action_remove_localmarkers(G.saction->action); - break; - case ACTMENU_MARKERS_LOCALRENAME: - //action_rename_localmarker(G.saction->action); - break; - case ACTMENU_MARKERS_LOCALMOVE: - /*G.saction->flag |= SACTION_POSEMARKERS_MOVE; - transform_markers('g', 0); - G.saction->flag &= ~SACTION_POSEMARKERS_MOVE;*/ - break; - } + uiItemEnumO(layout, "Over Current Frame", 0, "ACT_OT_mirror", "mode", ACTKEYS_MIRROR_CFRA); + uiItemEnumO(layout, "Over Vertical Axis", 0, "ACT_OT_mirror", "mode", ACTKEYS_MIRROR_YAXIS); + uiItemEnumO(layout, "Over Horizontal Axis", 0, "ACT_OT_mirror", "mode", ACTKEYS_MIRROR_XAXIS); + uiItemEnumO(layout, "Over Selected Marker", 0, "ACT_OT_mirror", "mode", ACTKEYS_MIRROR_MARKER); } -static uiBlock *action_markermenu(bContext *C, ARegion *ar, void *arg_unused) +static void act_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unused) { - SpaceAction *saction= (SpaceAction*)CTX_wm_space_data(C); - ScrArea *curarea= CTX_wm_area(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "action_markermenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_markermenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_ADD, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_DUPLICATE, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|Shift X", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_DELETE, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Ctrl M", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_NAME, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Ctrl G", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_MOVE, ""); - - if (saction->mode == SACTCONT_ACTION) { - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Pose Marker|Shift L", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALADD, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rename Pose Marker|Ctrl Shift L", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALRENAME, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Pose Marker|Alt L", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALDELETE, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Pose Marker|Ctrl L", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_LOCALMOVE, ""); - } - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - uiEndBlock(C, block); - - return block; + uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type_set", "type", HD_FREE); + uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type_set", "type", HD_AUTO); + uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type_set", "type", HD_VECT); + uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type_set", "type", HD_ALIGN); + uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type_set", "type", HD_AUTO_ANIM); // xxx? } - -/* Channel menu --------------------------- */ - -static void do_channelmenu_posmenu(bContext *C, void *arg, int event) +static void act_edit_ipomenu(bContext *C, uiLayout *layout, void *arg_unused) { - switch(event) - { - case ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_DOWN: - //rearrange_action_channels(REARRANGE_ACTCHAN_DOWN); - break; - case ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_UP: - //rearrange_action_channels(REARRANGE_ACTCHAN_UP); - break; - case ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_TOP: - //rearrange_action_channels(REARRANGE_ACTCHAN_TOP); - break; - case ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_BOTTOM: - //rearrange_action_channels(REARRANGE_ACTCHAN_BOTTOM); - break; - } -} - -static uiBlock *action_channelmenu_posmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "action_channelmenu_posmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_channelmenu_posmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Move Up|Shift Page Up", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_UP, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Move Down|Shift Page Down", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_DOWN, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Move to Top|Ctrl Shift Page Up", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_TOP, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Move to Bottom|Ctrl Shift Page Down", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_BOTTOM, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_channelmenu_groupmenu(bContext *C, void *arg, int event) -{ - switch(event) - { - case ACTMENU_CHANNELS_GROUP_ADD_TOACTIVE: - //action_groups_group(0); - break; - case ACTMENU_CHANNELS_GROUP_ADD_TONEW: - //action_groups_group(1); - break; - case ACTMENU_CHANNELS_GROUP_REMOVE: - //action_groups_ungroup(); - break; - case ACTMENU_CHANNELS_GROUP_SYNCPOSE: /* Syncronise Pose-data and Action-data */ - //sync_pchan2achan_grouping(); - break; - } -} - -static uiBlock *action_channelmenu_groupmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "action_channelmenu_groupmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_channelmenu_groupmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Add to Active Group|Shift G", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_CHANNELS_GROUP_ADD_TOACTIVE, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Add to New Group|Ctrl Shift G", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_CHANNELS_GROUP_ADD_TONEW, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Remove From Group|Alt G", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_CHANNELS_GROUP_REMOVE, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Synchronise with Armature", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_CHANNELS_GROUP_SYNCPOSE, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_channelmenu_settingsmenu(bContext *C, void *arg, int event) -{ - //setflag_action_channels(event); -} - -static uiBlock *action_channelmenu_settingsmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "action_channelmenu_settingsmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_channelmenu_settingsmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Toggle a Setting|Shift W", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_CHANNELS_SETTINGS_TOGGLE, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Enable a Setting|Ctrl Shift W", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_CHANNELS_SETTINGS_ENABLE, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Disable a Setting|Alt W", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_CHANNELS_SETTINGS_DISABLE, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_channelmenu(bContext *C, void *arg, int event) -{ - SpaceAction *saction= (SpaceAction*)CTX_wm_space_data(C); - - if (saction == NULL) return; - - switch(event) - { - case ACTMENU_CHANNELS_OPENLEVELS: /* Unfold selected channels one step */ - //openclose_level_action(1); - break; - case ACTMENU_CHANNELS_CLOSELEVELS: /* Fold selected channels one step */ - //openclose_level_action(-1); - break; - case ACTMENU_CHANNELS_EXPANDALL: /* Expands all channels */ - //expand_all_action(); - break; - case ACTMENU_CHANNELS_SHOWACHANS: /* Unfold groups that are hiding selected achans */ - //expand_obscuregroups_action(); - break; - case ACTMENU_CHANNELS_DELETE: /* Deletes selected channels */ - //delete_action_channels(); - break; - } -} - -static uiBlock *action_channelmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - ScrArea *curarea= CTX_wm_area(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "action_channelmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_channelmenu, NULL); - - uiDefIconTextBlockBut(block, action_channelmenu_groupmenu, - NULL, ICON_RIGHTARROW_THIN, - "Grouping", 0, yco-=20, 120, 20, ""); - - uiDefIconTextBlockBut(block, action_channelmenu_posmenu, - NULL, ICON_RIGHTARROW_THIN, - "Ordering", 0, yco-=20, 120, 20, ""); - - uiDefIconTextBlockBut(block, action_channelmenu_settingsmenu, - NULL, ICON_RIGHTARROW_THIN, - "Settings", 0, yco-=20, 120, 20, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Delete|X", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_CHANNELS_DELETE, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Toggle Show Hierachy|~", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_CHANNELS_EXPANDALL, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Show Group-Hidden Channels|Shift ~", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_CHANNELS_SHOWACHANS, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Expand One Level|Ctrl NumPad+", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_CHANNELS_OPENLEVELS, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Collapse One Level|Ctrl NumPad-", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_CHANNELS_CLOSELEVELS, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - uiEndBlock(C, block); - - return block; -} - -/* Grease Pencil --------------------------- */ - -/* Uses channelmenu functions */ -static uiBlock *action_gplayermenu(bContext *C, ARegion *ar, void *arg_unused) -{ - ScrArea *curarea= CTX_wm_area(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "action_gplayermenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_channelmenu, NULL); - - uiDefIconTextBlockBut(block, action_channelmenu_settingsmenu, - NULL, ICON_RIGHTARROW_THIN, - "Settings", 0, yco-=20, 120, 20, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Delete|X", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_CHANNELS_DELETE, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - uiEndBlock(C, block); - - return block; -} - -/* Select menu --------------------------- */ - -static void do_selectmenu_columnmenu(bContext *C, void *arg, int event) -{ - switch (event) { - case ACTMENU_SEL_COLUMN_MARKERSBETWEEN: - //markers_selectkeys_between(); - break; - case ACTMENU_SEL_COLUMN_KEYS: - //column_select_action_keys(1); - break; - case ACTMENU_SEL_COLUMN_MARKERSCOLUMN: - //column_select_action_keys(2); - break; - case ACTMENU_SEL_COLUMN_CFRA: - //column_select_action_keys(3); - break; - } -} - -static uiBlock *action_selectmenu_columnmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - SpaceAction *saction= (SpaceAction*)CTX_wm_space_data(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "action_selectmenu_columnmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_selectmenu_columnmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "On Selected Keys|K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_COLUMN_KEYS, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "On Current Frame|Ctrl K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_COLUMN_CFRA, ""); - - if (SACTION_HASMARKERS) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "On Selected Markers|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_COLUMN_MARKERSCOLUMN, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Between Selected Markers|Alt K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_COLUMN_MARKERSBETWEEN, ""); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_selectmenu(bContext *C, void *arg, int event) -{ - SpaceAction *saction= (SpaceAction*)CTX_wm_space_data(C); - //Key *key; - - if (saction == NULL) return; - - //key = get_action_mesh_key(); - - switch(event) - { - case ACTMENU_SEL_BORDER: /* Border Select */ - //borderselect_action(); - break; - - case ACTMENU_SEL_BORDERC: /* Border Select */ - //borderselect_actionchannels(); - break; - - case ACTMENU_SEL_BORDERM: /* Border Select */ - //borderselect_markers(); - break; - - case ACTMENU_SEL_ALL_KEYS: /* Select/Deselect All Keys */ - /*deselect_action_keys(1, 1); - BIF_undo_push("(De)Select Keys"); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWIPO, 0);*/ - break; - - case ACTMENU_SEL_ALL_CHAN: /* Select/Deselect All Channels */ - /*deselect_action_channels(1); - BIF_undo_push("(De)Select Action Channels"); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWIPO, 0);*/ - break; - - case ACTMENU_SEL_ALL_MARKERS: /* select/deselect all markers */ - /*deselect_markers(1, 0); - BIF_undo_push("(De)Select Markers"); - allqueue(REDRAWMARKER, 0);*/ - break; - - case ACTMENU_SEL_INVERSE_KEYS: /* invert selection status of keys */ - /*deselect_action_keys(0, 2); - BIF_undo_push("Inverse Keys"); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWIPO, 0);*/ - break; - - case ACTMENU_SEL_INVERSE_CHANNELS: /* invert selection status of channels */ - /*deselect_action_channels(2); - BIF_undo_push("Inverse Action Channels"); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWIPO, 0);*/ - break; - - case ACTMENU_SEL_INVERSE_MARKERS: /* invert selection of markers */ - /*deselect_markers(0, 2); - BIF_undo_push("Inverse Action Channels"); - allqueue(REDRAWMARKER, 0);*/ - break; - - case ACTMENU_SEL_LEFTKEYS: - //selectkeys_leftright(1, SELECT_REPLACE); - break; - - case ACTMENU_SEL_RIGHTKEYS: - //selectkeys_leftright(0, SELECT_REPLACE); - break; - } -} - -static uiBlock *action_selectmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - ScrArea *curarea= CTX_wm_area(C); - SpaceAction *saction= (SpaceAction*)CTX_wm_space_data(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "action_selectmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_selectmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Border Select Keys|B", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_BORDER, ""); - if (SACTION_HASMARKERS) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Border Select Markers|Ctrl B", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_BORDERM, ""); - } - if (saction->mode != SACTCONT_SHAPEKEY) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Border Select Channels|B", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_BORDERC, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Select/Deselect All Keys|A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_ALL_KEYS, ""); - if (SACTION_HASMARKERS) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Select/Deselect All Markers|Ctrl A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_ALL_MARKERS, ""); - } - if (saction->mode != SACTCONT_SHAPEKEY) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Select/Deselect All Channels|A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_ALL_CHAN, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Inverse Keys|Ctrl I", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_INVERSE_KEYS, ""); - if (SACTION_HASMARKERS) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Inverse Markers|Ctrl Shift I", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_INVERSE_MARKERS, ""); - } - if (saction->mode != SACTCONT_SHAPEKEY) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Inverse All Channels|Ctrl I", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_INVERSE_CHANNELS, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Back In Time|Alt RMB", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_LEFTKEYS, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Ahead In Time|Alt RMB", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_RIGHTKEYS, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, action_selectmenu_columnmenu, - NULL, ICON_RIGHTARROW_THIN, "Column Select Keys", 0, yco-=20, 120, 20, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - uiEndBlock(C, block); - - return block; + uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type_set", "type", BEZT_IPO_CONST); + uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type_set", "type", BEZT_IPO_LIN); + uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type_set", "type", BEZT_IPO_BEZ); } -/* View menu --------------------------- */ - -static void do_viewmenu(bContext *C, void *arg, int event) +static void act_edit_expomenu(bContext *C, uiLayout *layout, void *arg_unused) { - switch(event) { - case ACTMENU_VIEW_CENTERVIEW: /* Center View to Current Frame */ - //center_currframe(); - break; - case ACTMENU_VIEW_AUTOUPDATE: /* Update Automatically */ - /*if (BTST(G.saction->lock, 0)) - G.saction->lock = BCLR(G.saction->lock, 0); - else - G.saction->lock = BSET(G.saction->lock, 0);*/ - break; - case ACTMENU_VIEW_PLAY3D: /* Play Back Animation */ - //play_anim(0); - break; - case ACTMENU_VIEW_PLAYALL: /* Play Back Animation in All */ - //play_anim(1); - break; - case ACTMENU_VIEW_ALL: /* View All */ - //do_action_buttons(B_ACTHOME); - break; - case ACTMENU_VIEW_LOCK: - /*G.v2d->flag ^= V2D_VIEWLOCK; - if (G.v2d->flag & V2D_VIEWLOCK) - view2d_do_locks(curarea, 0);*/ - break; - case ACTMENU_VIEW_SLIDERS: /* Show sliders (when applicable) */ - //G.saction->flag ^= SACTION_SLIDERS; - break; - case ACTMENU_VIEW_MAXIMIZE: /* Maximize Window */ - /* using event B_FULL */ - break; - case ACTMENU_VIEW_NEXTMARKER: /* Jump to next marker */ - //nextprev_marker(1); - break; - case ACTMENU_VIEW_PREVMARKER: /* Jump to previous marker */ - //nextprev_marker(-1); - break; - case ACTMENU_VIEW_TIME: /* switch between frames and seconds display */ - //G.saction->flag ^= SACTION_DRAWTIME; - break; - case ACTMENU_VIEW_NOHIDE: /* Show hidden channels */ - //G.saction->flag ^= SACTION_NOHIDE; - break; - case ACTMENU_VIEW_NEXTKEYFRAME: /* Jump to next keyframe */ - //nextprev_action_keyframe(1); - break; - case ACTMENU_VIEW_PREVKEYFRAME: /* Jump to previous keyframe */ - //nextprev_action_keyframe(-1); - break; - case ACTMENU_VIEW_TRANSDELDUPS: /* Don't delete duplicate/overlapping keyframes after transform */ - //G.saction->flag ^= SACTION_NOTRANSKEYCULL; - break; - case ACTMENU_VIEW_HORIZOPTIMISE: /* Include keyframes not in view (horizontally) when preparing to draw */ - //G.saction->flag ^= SACTION_HORIZOPTIMISEON; - break; - case ACTMENU_VIEW_GCOLORS: /* Draw grouped-action channels using its group's color */ - //G.saction->flag ^= SACTION_NODRAWGCOLORS; - break; - case ACTMENU_VIEW_PREVRANGESET: /* Set preview range */ - //anim_previewrange_set(); - break; - case ACTMENU_VIEW_PREVRANGECLEAR: /* Clear preview range */ - //anim_previewrange_clear(); - break; - case ACTMENU_VIEW_PREVRANGEAUTO: /* Auto preview-range length */ - //action_previewrange_set(G.saction->action); - break; - } + uiItemEnumO(layout, NULL, 0, "ACT_OT_extrapolation_type_set", "type", FCURVE_EXTRAPOLATE_CONSTANT); + uiItemEnumO(layout, NULL, 0, "ACT_OT_extrapolation_type_set", "type", FCURVE_EXTRAPOLATE_LINEAR); } -static uiBlock *action_viewmenu(bContext *C, ARegion *ar, void *arg_unused) +static void act_editmenu(bContext *C, uiLayout *layout, void *arg_unused) { - ScrArea *curarea= CTX_wm_area(C); - SpaceAction *saction= (SpaceAction*)CTX_wm_space_data(C); - View2D *v2d= UI_view2d_fromcontext_rwin(C); - uiBlock *block; - short yco= 0, menuwidth=120; + uiItemMenuF(layout, "Transform", 0, act_edit_transformmenu); + uiItemMenuF(layout, "Snap", 0, act_edit_snapmenu); + uiItemMenuF(layout, "Mirror", 0, act_edit_mirrormenu); - block= uiBeginBlock(C, ar, "viewmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_viewmenu, NULL); + uiItemS(layout); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Center View to Current Frame|C", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_CENTERVIEW, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if (saction->flag & SACTION_DRAWTIME) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Show Frames|Ctrl T", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_TIME, ""); - } - else { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Show Seconds|Ctrl T", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_TIME, ""); - } + uiItemO(layout, NULL, 0, "ACT_OT_insert"); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiItemS(layout); - if (saction->mode == SACTCONT_GPENCIL) { - // this option may get removed in future - uiDefIconTextBut(block, BUTM, 1, (saction->flag & SACTION_HORIZOPTIMISEON)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Cull Out-of-View Keys (Time)|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_HORIZOPTIMISE, ""); - } - else { - uiDefIconTextBut(block, BUTM, 1, (saction->flag & SACTION_SLIDERS)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Show Sliders|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_SLIDERS, ""); - - uiDefIconTextBut(block, BUTM, 1, (saction->flag & SACTION_NOHIDE)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Show Hidden Channels|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_NOHIDE, ""); - - uiDefIconTextBut(block, BUTM, 1, (saction->flag & SACTION_NODRAWGCOLORS)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT, - "Use Group Colors|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_GCOLORS, ""); - - // this option may get removed in future - uiDefIconTextBut(block, BUTM, 1, (saction->flag & SACTION_HORIZOPTIMISEON)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Cull Out-of-View Keys (Time)|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_HORIZOPTIMISE, ""); - - uiDefIconTextBut(block, BUTM, 1, (saction->flag & SACTION_NOTRANSKEYCULL)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT, - "AutoMerge Keyframes|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_TRANSDELDUPS, ""); - } + uiItemO(layout, NULL, 0, "ACT_OT_duplicate"); + uiItemO(layout, NULL, 0, "ACT_OT_delete"); - - uiDefIconTextBut(block, BUTM, 1, (v2d->flag & V2D_VIEWSYNC_SCREEN_TIME)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Lock Time to Other Windows|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_LOCK, ""); - - /*uiDefIconTextBut(block, BUTM, 1, BTST(saction->lock, 0)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Update Automatically|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_AUTOUPDATE, "");*/ - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Jump To Next Marker|PageUp", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_VIEW_NEXTMARKER, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Jump To Prev Marker|PageDown", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_VIEW_PREVMARKER, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Jump To Next Keyframe|Ctrl PageUp", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_VIEW_NEXTKEYFRAME, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Jump To Prev Keyframe|Ctrl PageDown", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_VIEW_PREVKEYFRAME, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Play Back Animation|Alt A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_PLAY3D, ""); - //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - // "Play Back Animation in 3D View|Alt Shift A", 0, yco-=20, - // menuwidth, 19, NULL, 0.0, 0.0, 1, - // ACTMENU_VIEW_PLAYALL, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Set Preview Range|Ctrl P", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_PREVRANGESET, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Clear Preview Range|Alt P", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_PREVRANGECLEAR, ""); - - if ((saction->mode == SACTCONT_ACTION) && (saction->action)) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Preview Range from Action Length|Ctrl Alt P", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_PREVRANGEAUTO, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiItemS(layout); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "View All|Home", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_ALL, ""); + uiItemMenuF(layout, "Handle Type", 0, act_edit_handlesmenu); + uiItemMenuF(layout, "Interpolation Mode", 0, act_edit_ipomenu); + uiItemMenuF(layout, "Extrapolation Mode", 0, act_edit_expomenu); -/* if (!curarea->full) - uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, - "Maximize Window|Ctrl UpArrow", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_VIEW_MAXIMIZE, ""); - else - uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, - "Tile Window|Ctrl DownArrow", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_VIEW_MAXIMIZE, ""); -*/ + uiItemS(layout); - if (curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } + uiItemO(layout, NULL, 0, "ACT_OT_clean"); + uiItemO(layout, NULL, 0, "ACT_OT_sample"); - uiTextBoundsBlock(block, 50); - uiEndBlock(C, block); + uiItemS(layout); - return block; + uiItemO(layout, NULL, 0, "ACT_OT_copy"); + uiItemO(layout, NULL, 0, "ACT_OT_paste"); } /* ************************ header area region *********************** */ static void do_action_buttons(bContext *C, void *arg, int event) { - switch(event) { + switch (event) { case B_REDR: ED_area_tag_redraw(CTX_wm_area(C)); break; - - case B_ACTCOPYKEYS: - WM_operator_name_call(C, "ACT_OT_keyframes_copy", WM_OP_EXEC_REGION_WIN, NULL); - break; - case B_ACTPASTEKEYS: - WM_operator_name_call(C, "ACT_OT_keyframes_paste", WM_OP_EXEC_REGION_WIN, NULL); - break; } } @@ -1622,45 +314,38 @@ void action_header_buttons(const bContext *C, ARegion *ar) if ((sa->flag & HEADER_NO_PULLDOWN)==0) { xmax= GetButStringLength("View"); - uiDefPulldownBut(block, action_viewmenu, CTX_wm_area(C), - "View", xco, yco-2, xmax-3, 24, ""); + uiDefMenuBut(block, act_viewmenu, NULL, "View", xco, yco, xmax-3, 20, ""); xco+= xmax; xmax= GetButStringLength("Select"); - uiDefPulldownBut(block, action_selectmenu, CTX_wm_area(C), - "Select", xco, yco-2, xmax-3, 24, ""); + uiDefMenuBut(block, act_selectmenu, NULL, "Select", xco, yco, xmax-3, 20, ""); xco+= xmax; if ( (saction->mode == SACTCONT_DOPESHEET) || ((saction->action) && (saction->mode==SACTCONT_ACTION)) ) { xmax= GetButStringLength("Channel"); - uiDefPulldownBut(block, action_channelmenu, CTX_wm_area(C), - "Channel", xco, yco-2, xmax-3, 24, ""); + uiDefMenuBut(block, act_channelmenu, NULL, "Channel", xco, yco, xmax-3, 20, ""); xco+= xmax; } else if (saction->mode==SACTCONT_GPENCIL) { xmax= GetButStringLength("Channel"); - uiDefPulldownBut(block, action_gplayermenu, CTX_wm_area(C), - "Channel", xco, yco-2, xmax-3, 24, ""); + uiDefMenuBut(block, act_gplayermenu, NULL, "Channel", xco, yco, xmax-3, 20, ""); xco+= xmax; } - xmax= GetButStringLength("Marker"); - uiDefPulldownBut(block, action_markermenu, CTX_wm_area(C), - "Marker", xco, yco-2, xmax-3, 24, ""); - xco+= xmax; + //xmax= GetButStringLength("Marker"); + //uiDefMenuBut(block, act_markermenu, NULL, "Marker", xco, yco, xmax-3, 20, ""); + //xco+= xmax; if (saction->mode == SACTCONT_GPENCIL) { - xmax= GetButStringLength("Frame"); - uiDefPulldownBut(block, action_framemenu, CTX_wm_area(C), - "Frame", xco, yco-2, xmax-3, 24, ""); - xco+= xmax; + //xmax= GetButStringLength("Frame"); + //uiDefMenuBut(block, act_selectmenu, NULL, "Frame", xco, yco, xmax-3, 20, ""); + //xco+= xmax; } else { xmax= GetButStringLength("Key"); - uiDefPulldownBut(block, action_keymenu, CTX_wm_area(C), - "Key", xco, yco-2, xmax-3, 24, ""); + uiDefMenuBut(block, act_editmenu, NULL, "Key", xco, yco, xmax-3, 20, ""); xco+= xmax; } } @@ -1712,8 +397,8 @@ void action_header_buttons(const bContext *C, ARegion *ar) /* COPY PASTE */ uiBlockBeginAlign(block); - uiDefIconBut(block, BUT, B_ACTCOPYKEYS, ICON_COPYDOWN, xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected keyframes from the selected channel(s) to the buffer"); - uiDefIconBut(block, BUT, B_ACTPASTEKEYS, ICON_PASTEDOWN, xco+=XIC,yco,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the keyframes from the buffer"); + uiDefIconButO(block, BUT, "ACT_OT_copy", WM_OP_INVOKE_REGION_WIN, ICON_COPYDOWN, xco,yco,XIC,YIC, "Copies the selected keyframes to the buffer."); + uiDefIconButO(block, BUT, "ACT_OT_paste", WM_OP_INVOKE_REGION_WIN, ICON_COPYDOWN, xco,yco,XIC,YIC, "Pastes the keyframes from the buffer into the selected channels."); uiBlockEndAlign(block); xco += (XIC + 8); diff --git a/source/blender/editors/space_action/action_intern.h b/source/blender/editors/space_action/action_intern.h index b4d2528b3b4..377b25030e5 100644 --- a/source/blender/editors/space_action/action_intern.h +++ b/source/blender/editors/space_action/action_intern.h @@ -53,10 +53,10 @@ void action_header_buttons(const struct bContext *C, struct ARegion *ar); /* ***************************************** */ /* action_select.c */ -void ACT_OT_keyframes_select_all_toggle(struct wmOperatorType *ot); -void ACT_OT_keyframes_select_border(struct wmOperatorType *ot); -void ACT_OT_keyframes_select_column(struct wmOperatorType *ot); -void ACT_OT_keyframes_clickselect(struct wmOperatorType *ot); +void ACT_OT_select_all_toggle(struct wmOperatorType *ot); +void ACT_OT_select_border(struct wmOperatorType *ot); +void ACT_OT_select_column(struct wmOperatorType *ot); +void ACT_OT_clickselect(struct wmOperatorType *ot); /* defines for left-right select tool */ enum { @@ -80,22 +80,23 @@ enum { void ACT_OT_previewrange_set(struct wmOperatorType *ot); void ACT_OT_view_all(struct wmOperatorType *ot); -void ACT_OT_keyframes_copy(struct wmOperatorType *ot); -void ACT_OT_keyframes_paste(struct wmOperatorType *ot); +void ACT_OT_copy(struct wmOperatorType *ot); +void ACT_OT_paste(struct wmOperatorType *ot); -void ACT_OT_keyframes_insert(struct wmOperatorType *ot); -void ACT_OT_keyframes_duplicate(struct wmOperatorType *ot); -void ACT_OT_keyframes_delete(struct wmOperatorType *ot); -void ACT_OT_keyframes_clean(struct wmOperatorType *ot); -void ACT_OT_keyframes_sample(struct wmOperatorType *ot); +void ACT_OT_insert(struct wmOperatorType *ot); +void ACT_OT_duplicate(struct wmOperatorType *ot); +void ACT_OT_delete(struct wmOperatorType *ot); +void ACT_OT_clean(struct wmOperatorType *ot); +void ACT_OT_sample(struct wmOperatorType *ot); -void ACT_OT_keyframes_handle_type_set(struct wmOperatorType *ot); -void ACT_OT_keyframes_interpolation_type(struct wmOperatorType *ot); -void ACT_OT_keyframes_extrapolation_type_set(struct wmOperatorType *ot); +void ACT_OT_handle_type_set(struct wmOperatorType *ot); +void ACT_OT_interpolation_type_set(struct wmOperatorType *ot); +void ACT_OT_extrapolation_type_set(struct wmOperatorType *ot); -void ACT_OT_keyframes_cfrasnap(struct wmOperatorType *ot); -void ACT_OT_keyframes_snap(struct wmOperatorType *ot); -void ACT_OT_keyframes_mirror(struct wmOperatorType *ot); +void ACT_OT_frame_jump(struct wmOperatorType *ot); + +void ACT_OT_snap(struct wmOperatorType *ot); +void ACT_OT_mirror(struct wmOperatorType *ot); /* defines for snap keyframes * NOTE: keep in sync with eEditKeyframes_Snap (in ED_keyframes_edit.h) diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index 49a0befdbe2..1a677e9191d 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -63,25 +63,25 @@ void action_operatortypes(void) { /* keyframes */ /* selection */ - WM_operatortype_append(ACT_OT_keyframes_clickselect); - WM_operatortype_append(ACT_OT_keyframes_select_all_toggle); - WM_operatortype_append(ACT_OT_keyframes_select_border); - WM_operatortype_append(ACT_OT_keyframes_select_column); + WM_operatortype_append(ACT_OT_clickselect); + WM_operatortype_append(ACT_OT_select_all_toggle); + WM_operatortype_append(ACT_OT_select_border); + WM_operatortype_append(ACT_OT_select_column); /* editing */ - WM_operatortype_append(ACT_OT_keyframes_snap); - WM_operatortype_append(ACT_OT_keyframes_mirror); - WM_operatortype_append(ACT_OT_keyframes_cfrasnap); - WM_operatortype_append(ACT_OT_keyframes_handle_type_set); - WM_operatortype_append(ACT_OT_keyframes_interpolation_type); - WM_operatortype_append(ACT_OT_keyframes_extrapolation_type_set); - WM_operatortype_append(ACT_OT_keyframes_sample); - WM_operatortype_append(ACT_OT_keyframes_clean); - WM_operatortype_append(ACT_OT_keyframes_delete); - WM_operatortype_append(ACT_OT_keyframes_duplicate); - WM_operatortype_append(ACT_OT_keyframes_insert); - WM_operatortype_append(ACT_OT_keyframes_copy); - WM_operatortype_append(ACT_OT_keyframes_paste); + WM_operatortype_append(ACT_OT_snap); + WM_operatortype_append(ACT_OT_mirror); + WM_operatortype_append(ACT_OT_frame_jump); + WM_operatortype_append(ACT_OT_handle_type_set); + WM_operatortype_append(ACT_OT_interpolation_type_set); + WM_operatortype_append(ACT_OT_extrapolation_type_set); + WM_operatortype_append(ACT_OT_sample); + WM_operatortype_append(ACT_OT_clean); + WM_operatortype_append(ACT_OT_delete); + WM_operatortype_append(ACT_OT_duplicate); + WM_operatortype_append(ACT_OT_insert); + WM_operatortype_append(ACT_OT_copy); + WM_operatortype_append(ACT_OT_paste); WM_operatortype_append(ACT_OT_previewrange_set); WM_operatortype_append(ACT_OT_view_all); @@ -95,57 +95,58 @@ static void action_keymap_keyframes (wmWindowManager *wm, ListBase *keymap) /* action_select.c - selection tools */ /* click-select */ - WM_keymap_add_item(keymap, "ACT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, 0, 0); - kmi= WM_keymap_add_item(keymap, "ACT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "ACT_OT_clickselect", SELECTMOUSE, KM_PRESS, 0, 0); + kmi= WM_keymap_add_item(keymap, "ACT_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0); RNA_boolean_set(kmi->ptr, "column", 1); - kmi= WM_keymap_add_item(keymap, "ACT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); + kmi= WM_keymap_add_item(keymap, "ACT_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", 1); - kmi= WM_keymap_add_item(keymap, "ACT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0); + kmi= WM_keymap_add_item(keymap, "ACT_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", 1); RNA_boolean_set(kmi->ptr, "column", 1); - kmi= WM_keymap_add_item(keymap, "ACT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); + kmi= WM_keymap_add_item(keymap, "ACT_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); RNA_enum_set(kmi->ptr, "left_right", ACTKEYS_LRSEL_TEST); /* deselect all */ - WM_keymap_add_item(keymap, "ACT_OT_keyframes_select_all_toggle", AKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "ACT_OT_keyframes_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); + WM_keymap_add_item(keymap, "ACT_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "ACT_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); /* borderselect */ - WM_keymap_add_item(keymap, "ACT_OT_keyframes_select_border", BKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "ACT_OT_keyframes_select_border", BKEY, KM_PRESS, KM_ALT, 0)->ptr, "axis_range", 1); + WM_keymap_add_item(keymap, "ACT_OT_select_border", BKEY, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "ACT_OT_select_border", BKEY, KM_PRESS, KM_ALT, 0)->ptr, "axis_range", 1); /* column select */ - RNA_enum_set(WM_keymap_add_item(keymap, "ACT_OT_keyframes_select_column", KKEY, KM_PRESS, 0, 0)->ptr, "mode", ACTKEYS_COLUMNSEL_KEYS); - RNA_enum_set(WM_keymap_add_item(keymap, "ACT_OT_keyframes_select_column", KKEY, KM_PRESS, KM_CTRL, 0)->ptr, "mode", ACTKEYS_COLUMNSEL_CFRA); - RNA_enum_set(WM_keymap_add_item(keymap, "ACT_OT_keyframes_select_column", KKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", ACTKEYS_COLUMNSEL_MARKERS_COLUMN); - RNA_enum_set(WM_keymap_add_item(keymap, "ACT_OT_keyframes_select_column", KKEY, KM_PRESS, KM_ALT, 0)->ptr, "mode", ACTKEYS_COLUMNSEL_MARKERS_BETWEEN); + RNA_enum_set(WM_keymap_add_item(keymap, "ACT_OT_select_column", KKEY, KM_PRESS, 0, 0)->ptr, "mode", ACTKEYS_COLUMNSEL_KEYS); + RNA_enum_set(WM_keymap_add_item(keymap, "ACT_OT_select_column", KKEY, KM_PRESS, KM_CTRL, 0)->ptr, "mode", ACTKEYS_COLUMNSEL_CFRA); + RNA_enum_set(WM_keymap_add_item(keymap, "ACT_OT_select_column", KKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", ACTKEYS_COLUMNSEL_MARKERS_COLUMN); + RNA_enum_set(WM_keymap_add_item(keymap, "ACT_OT_select_column", KKEY, KM_PRESS, KM_ALT, 0)->ptr, "mode", ACTKEYS_COLUMNSEL_MARKERS_BETWEEN); /* action_edit.c */ /* snap - current frame to selected keys */ - WM_keymap_add_item(keymap, "ACT_OT_keyframes_cfrasnap", SKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); + // TODO: maybe since this is called jump, we're better to have it on -J? + WM_keymap_add_item(keymap, "ACT_OT_frame_jump", SKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); /* menu + single-step transform */ - WM_keymap_add_item(keymap, "ACT_OT_keyframes_snap", SKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "ACT_OT_keyframes_mirror", MKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "ACT_OT_snap", SKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "ACT_OT_mirror", MKEY, KM_PRESS, KM_SHIFT, 0); /* menu + set setting */ - WM_keymap_add_item(keymap, "ACT_OT_keyframes_handle_type_set", HKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "ACT_OT_keyframes_interpolation_type", TKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "ACT_OT_keyframes_extrapolation_type_set", EKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "ACT_OT_handle_type_set", HKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "ACT_OT_interpolation_type_set", TKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "ACT_OT_extrapolation_type_set", EKEY, KM_PRESS, KM_SHIFT, 0); /* destructive */ - WM_keymap_add_item(keymap, "ACT_OT_keyframes_clean", OKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "ACT_OT_keyframes_sample", OKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "ACT_OT_clean", OKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "ACT_OT_sample", OKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "ACT_OT_keyframes_delete", XKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "ACT_OT_keyframes_delete", DELKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "ACT_OT_delete", XKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "ACT_OT_delete", DELKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "ACT_OT_keyframes_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "ACT_OT_keyframes_insert", IKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "ACT_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "ACT_OT_insert", IKEY, KM_PRESS, 0, 0); /* copy/paste */ - WM_keymap_add_item(keymap, "ACT_OT_keyframes_copy", CKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "ACT_OT_keyframes_paste", VKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "ACT_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "ACT_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0); /* auto-set range */ WM_keymap_add_item(keymap, "ACT_OT_previewrange_set", PKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index f99a08bc26d..4cb39712f84 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -179,11 +179,11 @@ static int actkeys_deselectall_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_select_all_toggle (wmOperatorType *ot) +void ACT_OT_select_all_toggle (wmOperatorType *ot) { /* identifiers */ ot->name= "Select All"; - ot->idname= "ACT_OT_keyframes_select_all_toggle"; + ot->idname= "ACT_OT_select_all_toggle"; /* api callbacks */ ot->exec= actkeys_deselectall_exec; @@ -338,11 +338,11 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_select_border(wmOperatorType *ot) +void ACT_OT_select_border(wmOperatorType *ot) { /* identifiers */ ot->name= "Border Select"; - ot->idname= "ACT_OT_keyframes_select_border"; + ot->idname= "ACT_OT_select_border"; /* api callbacks */ ot->invoke= WM_border_select_invoke; @@ -555,11 +555,11 @@ static int actkeys_columnselect_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_keyframes_select_column (wmOperatorType *ot) +void ACT_OT_select_column (wmOperatorType *ot) { /* identifiers */ ot->name= "Select All"; - ot->idname= "ACT_OT_keyframes_select_column"; + ot->idname= "ACT_OT_select_column"; /* api callbacks */ ot->exec= actkeys_columnselect_exec; @@ -960,11 +960,11 @@ static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; } -void ACT_OT_keyframes_clickselect (wmOperatorType *ot) +void ACT_OT_clickselect (wmOperatorType *ot) { /* identifiers */ ot->name= "Mouse Select Keys"; - ot->idname= "ACT_OT_keyframes_clickselect"; + ot->idname= "ACT_OT_clickselect"; /* api callbacks - absolutely no exec() this yet... */ ot->invoke= actkeys_clickselect_invoke; diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index f8c6ba2131a..1971b062c2b 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -110,6 +110,11 @@ static void nla_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); + uiItemO(layout, NULL, 0, "ANIM_OT_previewrange_set"); + uiItemO(layout, NULL, 0, "ANIM_OT_previewrange_clear"); + + uiItemS(layout); + //uiItemO(layout, NULL, 0, "NLA_OT_view_all"); if (sa->full) diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index d4e952882ce..01abc5450aa 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -366,6 +366,8 @@ extern StructRNA RNA_SoundSequence; extern StructRNA RNA_Space; extern StructRNA RNA_Space3DView; extern StructRNA RNA_SpaceButtonsWindow; +extern StructRNA RNA_SpaceDopeSheetEditor; +extern StructRNA RNA_SpaceGraphEditor; extern StructRNA RNA_SpaceImageEditor; extern StructRNA RNA_SpaceNLA; extern StructRNA RNA_SpaceOutliner; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 78c49a493f4..d4f7c5b0bd1 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -30,6 +30,7 @@ #include "rna_internal.h" +#include "DNA_action_types.h" #include "DNA_object_types.h" #include "DNA_space_types.h" #include "DNA_view3d_types.h" @@ -89,9 +90,8 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr) switch(space->spacetype) { case SPACE_VIEW3D: return &RNA_Space3DView; - /*case SPACE_IPO: + case SPACE_IPO: return &RNA_SpaceGraphEditor; - */ case SPACE_OUTLINER: return &RNA_SpaceOutliner; case SPACE_BUTS: @@ -109,9 +109,9 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr) //case SPACE_IMASEL: // return &RNA_SpaceImageBrowser; /*case SPACE_SOUND: - return &RNA_SpaceAudioWindow; + return &RNA_SpaceAudioWindow;*/ case SPACE_ACTION: - return &RNA_SpaceDopeSheetEditor;*/ + return &RNA_SpaceDopeSheetEditor; case SPACE_NLA: return &RNA_SpaceNLA; /*case SPACE_SCRIPT: @@ -868,6 +868,94 @@ static void rna_def_space_text(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool."); } +static void rna_def_space_dopesheet(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem mode_items[] = { + {SACTCONT_DOPESHEET, "DOPESHEET", 0, "DopeSheet", ""}, + {SACTCONT_ACTION, "ACTION", 0, "Action Editor", ""}, + {SACTCONT_SHAPEKEY, "SHAPEKEY", 0, "ShapeKey Editor", ""}, // XXX to be depreceated? + {SACTCONT_GPENCIL, "GPENCIL", 0, "Grease Pencil", ""}, + {0, NULL, 0, NULL, NULL}}; + + + srna= RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space"); + RNA_def_struct_sdna(srna, "SpaceAction"); + RNA_def_struct_ui_text(srna, "Space DopeSheet Editor", "DopeSheet space data."); + + /* mode */ + prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "mode"); + RNA_def_property_enum_items(prop, mode_items); + RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed."); + + /* display */ + prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_DRAWTIME); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator + RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames."); + + prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWCFRANUM); + RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line."); + + prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SLIDERS); + RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels."); + + /* editing */ + prop= RNA_def_property(srna, "automerge_keyframes", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL); + RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points."); + + // TODO... autosnap, dopesheet? +} + +static void rna_def_space_graph(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem mode_items[] = { + {SIPO_MODE_ANIMATION, "FCURVES", 0, "F-Curves", ""}, + {SIPO_MODE_DRIVERS, "DRIVERS", 0, "Drivers", ""}, + {0, NULL, 0, NULL, NULL}}; + + + srna= RNA_def_struct(brna, "SpaceGraphEditor", "Space"); + RNA_def_struct_sdna(srna, "SpaceIpo"); + RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space data."); + + /* mode */ + prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "mode"); + RNA_def_property_enum_items(prop, mode_items); + RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed."); + + /* display */ + prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_DRAWTIME); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator + RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames."); + + prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM); + RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line."); + + prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_NOHANDLES); + RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points."); + + /* editing */ + prop= RNA_def_property(srna, "automerge_keyframes", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSKEYCULL); + RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points."); + + // TODO... autosnap, dopesheet? +} + static void rna_def_space_nla(BlenderRNA *brna) { StructRNA *srna; @@ -886,7 +974,9 @@ static void rna_def_space_nla(BlenderRNA *brna) prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCFRANUM); RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line."); - + + /* editing */ + // TODO... autosnap, dopesheet? } void RNA_def_space(BlenderRNA *brna) @@ -899,6 +989,8 @@ void RNA_def_space(BlenderRNA *brna) rna_def_background_image(brna); rna_def_space_3dview(brna); rna_def_space_buttons(brna); + rna_def_space_dopesheet(brna); + rna_def_space_graph(brna); rna_def_space_nla(brna); } -- cgit v1.2.3 From f1fb09a493b79e6320a651a035203dff98c3b580 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 22 Jun 2009 04:23:06 +0000 Subject: NLA SoC: Graph Editor Menus + Operator Name Cleanup As with the DopeSheet, the names of operators in the Graph Editor have been cleaned up, and operators have been added to menus as appropriate to show their availability. Tweaked a few DopeSheet operator names to be more in line with the Graph Editor equivalents, and vica versa. TODO: now, the operator poll callbacks here need checking... --- source/blender/editors/space_action/action_edit.c | 12 +- .../blender/editors/space_action/action_header.c | 20 +- .../blender/editors/space_action/action_intern.h | 6 +- source/blender/editors/space_action/action_ops.c | 12 +- source/blender/editors/space_graph/graph_buttons.c | 6 +- source/blender/editors/space_graph/graph_edit.c | 92 ++++---- source/blender/editors/space_graph/graph_header.c | 231 +++++++++++++++------ source/blender/editors/space_graph/graph_intern.h | 50 ++--- source/blender/editors/space_graph/graph_ops.c | 139 +++++++------ source/blender/editors/space_graph/graph_select.c | 16 +- 10 files changed, 349 insertions(+), 235 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index b2f4751fa25..deaa6597bd2 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -853,11 +853,11 @@ static int actkeys_expo_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_extrapolation_type_set (wmOperatorType *ot) +void ACT_OT_extrapolation_type (wmOperatorType *ot) { /* identifiers */ ot->name= "Set Keyframe Extrapolation"; - ot->idname= "ACT_OT_extrapolation_type_set"; + ot->idname= "ACT_OT_extrapolation_type"; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -923,11 +923,11 @@ static int actkeys_ipo_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_interpolation_type_set (wmOperatorType *ot) +void ACT_OT_interpolation_type (wmOperatorType *ot) { /* identifiers */ ot->name= "Set Keyframe Interpolation"; - ot->idname= "ACT_OT_interpolation_type_set"; + ot->idname= "ACT_OT_interpolation_type"; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1011,11 +1011,11 @@ static int actkeys_handletype_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_handle_type_set (wmOperatorType *ot) +void ACT_OT_handle_type (wmOperatorType *ot) { /* identifiers */ ot->name= "Set Keyframe Handle Type"; - ot->idname= "ACT_OT_handle_type_set"; + ot->idname= "ACT_OT_handle_type"; /* api callbacks */ ot->invoke= WM_menu_invoke; diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index 1bc30b2ac42..a9ce145088d 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -183,24 +183,24 @@ static void act_edit_mirrormenu(bContext *C, uiLayout *layout, void *arg_unused) static void act_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type_set", "type", HD_FREE); - uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type_set", "type", HD_AUTO); - uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type_set", "type", HD_VECT); - uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type_set", "type", HD_ALIGN); - uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type_set", "type", HD_AUTO_ANIM); // xxx? + uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type", "type", HD_FREE); + uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type", "type", HD_AUTO); + uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type", "type", HD_VECT); + uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type", "type", HD_ALIGN); + uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type", "type", HD_AUTO_ANIM); // xxx? } static void act_edit_ipomenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type_set", "type", BEZT_IPO_CONST); - uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type_set", "type", BEZT_IPO_LIN); - uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type_set", "type", BEZT_IPO_BEZ); + uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type", "type", BEZT_IPO_CONST); + uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type", "type", BEZT_IPO_LIN); + uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type", "type", BEZT_IPO_BEZ); } static void act_edit_expomenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiItemEnumO(layout, NULL, 0, "ACT_OT_extrapolation_type_set", "type", FCURVE_EXTRAPOLATE_CONSTANT); - uiItemEnumO(layout, NULL, 0, "ACT_OT_extrapolation_type_set", "type", FCURVE_EXTRAPOLATE_LINEAR); + uiItemEnumO(layout, NULL, 0, "ACT_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_CONSTANT); + uiItemEnumO(layout, NULL, 0, "ACT_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_LINEAR); } static void act_editmenu(bContext *C, uiLayout *layout, void *arg_unused) diff --git a/source/blender/editors/space_action/action_intern.h b/source/blender/editors/space_action/action_intern.h index 377b25030e5..6ccdc07421b 100644 --- a/source/blender/editors/space_action/action_intern.h +++ b/source/blender/editors/space_action/action_intern.h @@ -89,9 +89,9 @@ void ACT_OT_delete(struct wmOperatorType *ot); void ACT_OT_clean(struct wmOperatorType *ot); void ACT_OT_sample(struct wmOperatorType *ot); -void ACT_OT_handle_type_set(struct wmOperatorType *ot); -void ACT_OT_interpolation_type_set(struct wmOperatorType *ot); -void ACT_OT_extrapolation_type_set(struct wmOperatorType *ot); +void ACT_OT_handle_type(struct wmOperatorType *ot); +void ACT_OT_interpolation_type(struct wmOperatorType *ot); +void ACT_OT_extrapolation_type(struct wmOperatorType *ot); void ACT_OT_frame_jump(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index 1a677e9191d..c023062453c 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -72,9 +72,9 @@ void action_operatortypes(void) WM_operatortype_append(ACT_OT_snap); WM_operatortype_append(ACT_OT_mirror); WM_operatortype_append(ACT_OT_frame_jump); - WM_operatortype_append(ACT_OT_handle_type_set); - WM_operatortype_append(ACT_OT_interpolation_type_set); - WM_operatortype_append(ACT_OT_extrapolation_type_set); + WM_operatortype_append(ACT_OT_handle_type); + WM_operatortype_append(ACT_OT_interpolation_type); + WM_operatortype_append(ACT_OT_extrapolation_type); WM_operatortype_append(ACT_OT_sample); WM_operatortype_append(ACT_OT_clean); WM_operatortype_append(ACT_OT_delete); @@ -130,9 +130,9 @@ static void action_keymap_keyframes (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "ACT_OT_mirror", MKEY, KM_PRESS, KM_SHIFT, 0); /* menu + set setting */ - WM_keymap_add_item(keymap, "ACT_OT_handle_type_set", HKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "ACT_OT_interpolation_type_set", TKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "ACT_OT_extrapolation_type_set", EKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "ACT_OT_handle_type", HKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "ACT_OT_interpolation_type", TKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "ACT_OT_extrapolation_type", EKEY, KM_PRESS, KM_SHIFT, 0); /* destructive */ WM_keymap_add_item(keymap, "ACT_OT_clean", OKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 5b00205b5d0..ea4f017c9bb 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -989,7 +989,7 @@ static void graph_panel_modifiers(const bContext *C, Panel *pa) /* 'add modifier' button at top of panel */ // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator - uiDefButO(block, BUT, "GRAPHEDIT_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, "Add Modifier", 10, 225, 150, 20, "Adds a new F-Curve Modifier for the active F-Curve"); + uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, "Add Modifier", 10, 225, 150, 20, "Adds a new F-Curve Modifier for the active F-Curve"); /* draw each modifier */ for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) @@ -1069,10 +1069,10 @@ static int graph_properties(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_properties(wmOperatorType *ot) +void GRAPH_OT_properties(wmOperatorType *ot) { ot->name= "Properties"; - ot->idname= "GRAPHEDIT_OT_properties"; + ot->idname= "GRAPH_OT_properties"; ot->exec= graph_properties; ot->poll= ED_operator_ipo_active; // xxx diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 49397ed0edd..8903d95b288 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -180,11 +180,11 @@ static int graphkeys_previewrange_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_previewrange_set (wmOperatorType *ot) +void GRAPH_OT_previewrange_set (wmOperatorType *ot) { /* identifiers */ ot->name= "Auto-Set Preview Range"; - ot->idname= "GRAPHEDIT_OT_previewrange_set"; + ot->idname= "GRAPH_OT_previewrange_set"; /* api callbacks */ ot->exec= graphkeys_previewrange_exec; @@ -227,11 +227,11 @@ static int graphkeys_viewall_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_view_all (wmOperatorType *ot) +void GRAPH_OT_view_all (wmOperatorType *ot) { /* identifiers */ ot->name= "View All"; - ot->idname= "GRAPHEDIT_OT_view_all"; + ot->idname= "GRAPH_OT_view_all"; /* api callbacks */ ot->exec= graphkeys_viewall_exec; @@ -334,11 +334,11 @@ static int graphkeys_create_ghostcurves_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_ghost_curves_create (wmOperatorType *ot) +void GRAPH_OT_ghost_curves_create (wmOperatorType *ot) { /* identifiers */ ot->name= "Create Ghost Curves"; - ot->idname= "GRAPHEDIT_OT_ghost_curves_create"; + ot->idname= "GRAPH_OT_ghost_curves_create"; ot->description= "Create snapshot (Ghosts) of selected F-Curves as background aid for active Graph Editor."; /* api callbacks */ @@ -377,11 +377,11 @@ static int graphkeys_clear_ghostcurves_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_ghost_curves_clear (wmOperatorType *ot) +void GRAPH_OT_ghost_curves_clear (wmOperatorType *ot) { /* identifiers */ ot->name= "Create Ghost Curves"; - ot->idname= "GRAPHEDIT_OT_ghost_curves_clear"; + ot->idname= "GRAPH_OT_ghost_curves_clear"; ot->description= "Clear F-Curve snapshots (Ghosts) for active Graph Editor."; /* api callbacks */ @@ -461,11 +461,11 @@ static int graphkeys_click_insert_invoke (bContext *C, wmOperator *op, wmEvent * return graphkeys_click_insert_exec(C, op); } -void GRAPHEDIT_OT_keyframes_click_insert (wmOperatorType *ot) +void GRAPH_OT_click_insert (wmOperatorType *ot) { /* identifiers */ ot->name= "Click-Insert Keyframes"; - ot->idname= "GRAPHEDIT_OT_keyframes_click_insert"; + ot->idname= "GRAPH_OT_click_insert"; /* api callbacks */ ot->invoke= graphkeys_click_insert_invoke; @@ -544,11 +544,11 @@ static int graphkeys_copy_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_copy (wmOperatorType *ot) +void GRAPH_OT_copy (wmOperatorType *ot) { /* identifiers */ ot->name= "Copy Keyframes"; - ot->idname= "GRAPHEDIT_OT_keyframes_copy"; + ot->idname= "GRAPH_OT_copy"; /* api callbacks */ ot->exec= graphkeys_copy_exec; @@ -583,11 +583,11 @@ static int graphkeys_paste_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_paste (wmOperatorType *ot) +void GRAPH_OT_paste (wmOperatorType *ot) { /* identifiers */ ot->name= "Paste Keyframes"; - ot->idname= "GRAPHEDIT_OT_keyframes_paste"; + ot->idname= "GRAPH_OT_paste"; /* api callbacks */ ot->exec= graphkeys_paste_exec; @@ -650,11 +650,11 @@ static int graphkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *even return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_duplicate (wmOperatorType *ot) +void GRAPH_OT_duplicate (wmOperatorType *ot) { /* identifiers */ ot->name= "Duplicate Keyframes"; - ot->idname= "GRAPHEDIT_OT_keyframes_duplicate"; + ot->idname= "GRAPH_OT_duplicate"; /* api callbacks */ ot->invoke= graphkeys_duplicate_invoke; @@ -711,11 +711,11 @@ static int graphkeys_delete_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_delete (wmOperatorType *ot) +void GRAPH_OT_delete (wmOperatorType *ot) { /* identifiers */ ot->name= "Delete Keyframes"; - ot->idname= "GRAPHEDIT_OT_keyframes_delete"; + ot->idname= "GRAPH_OT_delete"; /* api callbacks */ ot->invoke= WM_operator_confirm; @@ -772,11 +772,11 @@ static int graphkeys_clean_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_clean (wmOperatorType *ot) +void GRAPH_OT_clean (wmOperatorType *ot) { /* identifiers */ ot->name= "Clean Keyframes"; - ot->idname= "GRAPHEDIT_OT_keyframes_clean"; + ot->idname= "GRAPH_OT_clean"; /* api callbacks */ //ot->invoke= // XXX we need that number popup for this! @@ -853,11 +853,11 @@ static int graphkeys_bake_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_bake (wmOperatorType *ot) +void GRAPH_OT_bake (wmOperatorType *ot) { /* identifiers */ ot->name= "Bake Curve"; - ot->idname= "GRAPHEDIT_OT_keyframes_bake"; + ot->idname= "GRAPH_OT_bake"; /* api callbacks */ ot->invoke= WM_operator_confirm; // FIXME... @@ -979,11 +979,11 @@ static int graphkeys_sample_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_sample (wmOperatorType *ot) +void GRAPH_OT_sample (wmOperatorType *ot) { /* identifiers */ ot->name= "Sample Keyframes"; - ot->idname= "GRAPHEDIT_OT_keyframes_sample"; + ot->idname= "GRAPH_OT_sample"; /* api callbacks */ ot->exec= graphkeys_sample_exec; @@ -1053,11 +1053,11 @@ static int graphkeys_expo_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_extrapolation_type (wmOperatorType *ot) +void GRAPH_OT_extrapolation_type (wmOperatorType *ot) { /* identifiers */ ot->name= "Set Keyframe Extrapolation"; - ot->idname= "GRAPHEDIT_OT_keyframes_extrapolation_type"; + ot->idname= "GRAPH_OT_extrapolation_type"; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1121,11 +1121,11 @@ static int graphkeys_ipo_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_interpolation_type (wmOperatorType *ot) +void GRAPH_OT_interpolation_type (wmOperatorType *ot) { /* identifiers */ ot->name= "Set Keyframe Interpolation"; - ot->idname= "GRAPHEDIT_OT_keyframes_interpolation_type"; + ot->idname= "GRAPH_OT_interpolation_type"; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1208,11 +1208,11 @@ static int graphkeys_handletype_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_handletype (wmOperatorType *ot) +void GRAPH_OT_handletype (wmOperatorType *ot) { /* identifiers */ ot->name= "Set Keyframe Handle Type"; - ot->idname= "GRAPHEDIT_OT_keyframes_handletype"; + ot->idname= "GRAPH_OT_handletype"; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1298,11 +1298,11 @@ static int graphkeys_euler_filter_exec (bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -void GRAPHEDIT_OT_keyframes_euler_filter (wmOperatorType *ot) +void GRAPH_OT_euler_filter (wmOperatorType *ot) { /* identifiers */ ot->name= "Euler Filter"; - ot->idname= "GRAPHEDIT_OT_keyframes_euler_filter"; + ot->idname= "GRAPH_OT_euler_filter"; /* api callbacks */ ot->exec= graphkeys_euler_filter_exec; @@ -1314,10 +1314,10 @@ void GRAPHEDIT_OT_keyframes_euler_filter (wmOperatorType *ot) #endif // XXX this is not ready for the primetime yet -/* ***************** Snap Current Frame Operator *********************** */ +/* ***************** Jump to Selected Frames Operator *********************** */ /* snap current-frame indicator to 'average time' of selected keyframe */ -static int graphkeys_cfrasnap_exec(bContext *C, wmOperator *op) +static int graphkeys_framejump_exec(bContext *C, wmOperator *op) { bAnimContext ac; ListBase anim_data= {NULL, NULL}; @@ -1353,14 +1353,14 @@ static int graphkeys_cfrasnap_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_cfrasnap (wmOperatorType *ot) +void GRAPH_OT_frame_jump (wmOperatorType *ot) { /* identifiers */ - ot->name= "Snap Current Frame to Keys"; - ot->idname= "GRAPHEDIT_OT_keyframes_cfrasnap"; + ot->name= "Jump to Frame"; + ot->idname= "GRAPH_OT_frame_jump"; /* api callbacks */ - ot->exec= graphkeys_cfrasnap_exec; + ot->exec= graphkeys_framejump_exec; ot->poll= ED_operator_areaactive; /* flags */ @@ -1444,11 +1444,11 @@ static int graphkeys_snap_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_snap (wmOperatorType *ot) +void GRAPH_OT_snap (wmOperatorType *ot) { /* identifiers */ ot->name= "Snap Keys"; - ot->idname= "GRAPHEDIT_OT_keyframes_snap"; + ot->idname= "GRAPH_OT_snap"; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1555,11 +1555,11 @@ static int graphkeys_mirror_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_mirror (wmOperatorType *ot) +void GRAPH_OT_mirror (wmOperatorType *ot) { /* identifiers */ ot->name= "Mirror Keys"; - ot->idname= "GRAPHEDIT_OT_keyframes_mirror"; + ot->idname= "GRAPH_OT_mirror"; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1609,11 +1609,11 @@ static int graphkeys_smooth_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_smooth (wmOperatorType *ot) +void GRAPH_OT_smooth (wmOperatorType *ot) { /* identifiers */ ot->name= "Smooth Keys"; - ot->idname= "GRAPHEDIT_OT_keyframes_smooth"; + ot->idname= "GRAPH_OT_smooth"; /* api callbacks */ ot->exec= graphkeys_smooth_exec; @@ -1671,11 +1671,11 @@ static int graph_fmodifier_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_fmodifier_add (wmOperatorType *ot) +void GRAPH_OT_fmodifier_add (wmOperatorType *ot) { /* identifiers */ ot->name= "Add F-Curve Modifier"; - ot->idname= "GRAPHEDIT_OT_fmodifier_add"; + ot->idname= "GRAPH_OT_fmodifier_add"; /* api callbacks */ ot->invoke= WM_menu_invoke; diff --git a/source/blender/editors/space_graph/graph_header.c b/source/blender/editors/space_graph/graph_header.c index 178b4b4562f..0bd08625d68 100644 --- a/source/blender/editors/space_graph/graph_header.c +++ b/source/blender/editors/space_graph/graph_header.c @@ -47,11 +47,14 @@ #include "ED_types.h" #include "ED_util.h" +#include "RNA_access.h" + #include "WM_api.h" #include "WM_types.h" #include "BIF_gl.h" #include "BIF_glutil.h" +#include "BIF_transform.h" #include "UI_interface.h" #include "UI_resources.h" @@ -62,77 +65,174 @@ /* ********************************************************* */ /* Menu Defines... */ -/* button events */ -enum { - B_REDR = 0, - B_MODECHANGE, -} eActHeader_ButEvents; +static void graph_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) +{ + bScreen *sc= CTX_wm_screen(C); + ScrArea *sa= CTX_wm_area(C); + SpaceIpo *sipo= (SpaceIpo*)CTX_wm_space_data(C); + PointerRNA spaceptr; + + /* retrieve state */ + RNA_pointer_create(&sc->id, &RNA_SpaceGraphEditor, sipo, &spaceptr); + + /* create menu */ + uiItemO(layout, NULL, ICON_MENU_PANEL, "GRAPH_OT_properties"); + + uiItemS(layout); + + uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0, 0, 0); + + if (sipo->flag & SIPO_NOHANDLES) + uiItemO(layout, "Show Handles", ICON_CHECKBOX_DEHLT, "GRAPH_OT_handles_view_toggle"); + else + uiItemO(layout, "Show Handles", ICON_CHECKBOX_HLT, "GRAPH_OT_handles_view_toggle"); + + uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0, 0, 0); + + if (sipo->flag & SIPO_DRAWTIME) + uiItemO(layout, "Show Frames", 0, "ANIM_OT_time_toggle"); + else + uiItemO(layout, "Show Seconds", 0, "ANIM_OT_time_toggle"); + + uiItemS(layout); + + uiItemO(layout, NULL, 0, "ANIM_OT_previewrange_set"); + uiItemO(layout, NULL, 0, "ANIM_OT_previewrange_clear"); + + uiItemO(layout, NULL, 0, "GRAPH_OT_previewrange_set"); + + uiItemS(layout); + + uiItemO(layout, NULL, 0, "GRAPH_OT_frame_jump"); + + uiItemO(layout, NULL, 0, "GRAPH_OT_view_all"); + + if (sa->full) + uiItemO(layout, NULL, 0, "SCREEN_OT_screen_full_area"); // "Tile Window", Ctrl UpArrow + else + uiItemO(layout, NULL, 0, "SCREEN_OT_screen_full_area"); // "Maximize Window", Ctrl DownArrow +} -/* ************************ header area region *********************** */ +static void graph_selectmenu(bContext *C, uiLayout *layout, void *arg_unused) +{ + uiItemO(layout, NULL, 0, "GRAPH_OT_select_all_toggle"); + uiItemBooleanO(layout, "Invert All", 0, "GRAPH_OT_select_all_toggle", "invert", 1); + + uiItemS(layout); + + uiItemO(layout, NULL, 0, "GRAPH_OT_select_border"); + uiItemBooleanO(layout, "Border Axis Range", 0, "GRAPH_OT_select_border", "axis_range", 1); + + uiItemS(layout); + + uiItemEnumO(layout, "Columns on Selected Keys", 0, "GRAPH_OT_select_column", "mode", GRAPHKEYS_COLUMNSEL_KEYS); + uiItemEnumO(layout, "Column on Current Frame", 0, "GRAPH_OT_select_column", "mode", GRAPHKEYS_COLUMNSEL_CFRA); + + uiItemEnumO(layout, "Columns on Selected Markers", 0, "GRAPH_OT_select_column", "mode", GRAPHKEYS_COLUMNSEL_MARKERS_COLUMN); + uiItemEnumO(layout, "Between Selected Markers", 0, "GRAPH_OT_select_column", "mode", GRAPHKEYS_COLUMNSEL_MARKERS_BETWEEN); +} -static void do_viewmenu(bContext *C, void *arg, int event) +static void graph_channelmenu(bContext *C, uiLayout *layout, void *arg_unused) { - SpaceIpo *sipo= (SpaceIpo *)CTX_wm_space_data(C); + uiItemO(layout, NULL, 0, "ANIM_OT_channels_setting_toggle"); + uiItemO(layout, NULL, 0, "ANIM_OT_channels_setting_enable"); + uiItemO(layout, NULL, 0, "ANIM_OT_channels_setting_disable"); - switch (event) { - case 1: /* Show time/frames */ - sipo->flag ^= SIPO_DRAWTIME; - break; - case 2: /* AutoMerge Keyframes */ - sipo->flag ^= SIPO_NOTRANSKEYCULL; - break; - case 3: /* Show/Hide handles */ - sipo->flag ^= SIPO_NOHANDLES; - break; - case 4: /* Show current frame number beside indicator */ - sipo->flag ^= SIPO_NODRAWCFRANUM; - break; - } + uiItemS(layout); + + uiItemO(layout, NULL, 0, "ANIM_OT_channels_editable_toggle"); + + uiItemS(layout); + + uiItemO(layout, NULL, 0, "ANIM_OT_channels_expand"); + uiItemO(layout, NULL, 0, "ANIM_OT_channels_collapse"); } -static uiBlock *graph_viewmenu(bContext *C, ARegion *ar, void *arg_unused) +static void graph_edit_transformmenu(bContext *C, uiLayout *layout, void *arg_unused) { - ScrArea *curarea= CTX_wm_area(C); - SpaceIpo *sipo= (SpaceIpo *)CTX_wm_space_data(C); - uiBlock *block; - short yco= 0, menuwidth=120; + uiItemEnumO(layout, "Grab/Move", 0, "TFM_OT_transform", "mode", TFM_TIME_TRANSLATE); + uiItemEnumO(layout, "Extend", 0, "TFM_OT_transform", "mode", TFM_TIME_EXTEND); + uiItemEnumO(layout, "Scale", 0, "TFM_OT_transform", "mode", TFM_TIME_SCALE); +} + +static void graph_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused) +{ + uiItemEnumO(layout, "To Current Frame", 0, "GRAPH_OT_snap", "mode", GRAPHKEYS_SNAP_CFRA); + uiItemEnumO(layout, "To Nearest Frame", 0, "GRAPH_OT_snap", "mode", GRAPHKEYS_SNAP_NEAREST_FRAME); + uiItemEnumO(layout, "To Nearest Second", 0, "GRAPH_OT_snap", "mode", GRAPHKEYS_SNAP_NEAREST_SECOND); + uiItemEnumO(layout, "To Nearest Marker", 0, "GRAPH_OT_snap", "mode", GRAPHKEYS_SNAP_NEAREST_MARKER); +} + +static void graph_edit_mirrormenu(bContext *C, uiLayout *layout, void *arg_unused) +{ + uiItemEnumO(layout, "Over Current Frame", 0, "GRAPH_OT_mirror", "mode", GRAPHKEYS_MIRROR_CFRA); + uiItemEnumO(layout, "Over Vertical Axis", 0, "GRAPH_OT_mirror", "mode", GRAPHKEYS_MIRROR_YAXIS); + uiItemEnumO(layout, "Over Horizontal Axis", 0, "GRAPH_OT_mirror", "mode", GRAPHKEYS_MIRROR_XAXIS); + uiItemEnumO(layout, "Over Selected Marker", 0, "GRAPH_OT_mirror", "mode", GRAPHKEYS_MIRROR_MARKER); +} + +static void graph_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unused) +{ + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_handle_type", "type", HD_FREE); + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_handle_type", "type", HD_AUTO); + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_handle_type", "type", HD_VECT); + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_handle_type", "type", HD_ALIGN); + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_handle_type", "type", HD_AUTO_ANIM); // xxx? +} + +static void graph_edit_ipomenu(bContext *C, uiLayout *layout, void *arg_unused) +{ + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_interpolation_type", "type", BEZT_IPO_CONST); + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_interpolation_type", "type", BEZT_IPO_LIN); + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_interpolation_type", "type", BEZT_IPO_BEZ); +} + +static void graph_edit_expomenu(bContext *C, uiLayout *layout, void *arg_unused) +{ + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_CONSTANT); + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_LINEAR); +} + +static void graph_editmenu(bContext *C, uiLayout *layout, void *arg_unused) +{ + uiItemMenuF(layout, "Transform", 0, graph_edit_transformmenu); + uiItemMenuF(layout, "Snap", 0, graph_edit_snapmenu); + uiItemMenuF(layout, "Mirror", 0, graph_edit_mirrormenu); - block= uiBeginBlock(C, ar, "graph_viewmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_viewmenu, NULL); + uiItemS(layout); - // XXX these options should use new menu-options + //uiItemO(layout, NULL, 0, "GRAPH_OT_insert"); + uiItemO(layout, NULL, 0, "GRAPH_OT_fmodifier_add"); - if (sipo->flag & SIPO_DRAWTIME) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Show Frames|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - } - else { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Show Seconds|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - } + uiItemS(layout); + uiItemO(layout, NULL, 0, "GRAPH_OT_duplicate"); + uiItemO(layout, NULL, 0, "GRAPH_OT_delete"); - uiDefIconTextBut(block, BUTM, 1, (sipo->flag & SIPO_NOTRANSKEYCULL)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT, - "AutoMerge Keyframes|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, (sipo->flag & SIPO_NOHANDLES)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT, - "Show Handles|Ctrl H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, (sipo->flag & SIPO_NODRAWCFRANUM)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT, - "Show Current Frame Number|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiItemS(layout); - if (curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } + uiItemMenuF(layout, "Handle Type", 0, graph_edit_handlesmenu); + uiItemMenuF(layout, "Interpolation Mode", 0, graph_edit_ipomenu); + uiItemMenuF(layout, "Extrapolation Mode", 0, graph_edit_expomenu); - uiTextBoundsBlock(block, 50); - uiEndBlock(C, block); + uiItemS(layout); + + uiItemO(layout, NULL, 0, "GRAPH_OT_clean"); + uiItemO(layout, NULL, 0, "GRAPH_OT_sample"); + + uiItemS(layout); - return block; + uiItemO(layout, NULL, 0, "GRAPH_OT_copy"); + uiItemO(layout, NULL, 0, "GRAPH_OT_paste"); } +/* ********************************************************* */ + +enum { + B_REDR = 0, + B_MODECHANGE, +} eGraphEdit_Events; + static void do_graph_buttons(bContext *C, void *arg, int event) { switch (event) { @@ -163,8 +263,19 @@ void graph_header_buttons(const bContext *C, ARegion *ar) int xmax; xmax= GetButStringLength("View"); - uiDefPulldownBut(block, graph_viewmenu, CTX_wm_area(C), - "View", xco, yco-2, xmax-3, 24, ""); + uiDefMenuBut(block, graph_viewmenu, NULL, "View", xco, yco, xmax-3, 20, ""); + xco+= xmax; + + xmax= GetButStringLength("Select"); + uiDefMenuBut(block, graph_selectmenu, NULL, "Select", xco, yco, xmax-3, 20, ""); + xco+= xmax; + + xmax= GetButStringLength("Channel"); + uiDefMenuBut(block, graph_channelmenu, NULL, "Channel", xco, yco, xmax-3, 20, ""); + xco+= xmax; + + xmax= GetButStringLength("Key"); + uiDefMenuBut(block, graph_editmenu, NULL, "Key", xco, yco, xmax-3, 20, ""); xco+= xmax; } @@ -202,8 +313,8 @@ void graph_header_buttons(const bContext *C, ARegion *ar) /* copy + paste */ uiBlockBeginAlign(block); - uiDefIconButO(block, BUT, "GRAPHEDIT_OT_keyframes_copy", WM_OP_INVOKE_REGION_WIN, ICON_COPYDOWN, xco+=XIC,yco,XIC,YIC, "Copies the selected keyframes from the selected channel(s) to the buffer"); - uiDefIconButO(block, BUT, "GRAPHEDIT_OT_keyframes_paste", WM_OP_INVOKE_REGION_WIN, ICON_PASTEDOWN, xco+=XIC,yco,XIC,YIC, "Pastes the keyframes from the buffer"); + uiDefIconButO(block, BUT, "GRAPH_OT_copy", WM_OP_INVOKE_REGION_WIN, ICON_COPYDOWN, xco+=XIC,yco,XIC,YIC, "Copies the selected keyframes from the selected channel(s) to the buffer"); + uiDefIconButO(block, BUT, "GRAPH_OT_paste", WM_OP_INVOKE_REGION_WIN, ICON_PASTEDOWN, xco+=XIC,yco,XIC,YIC, "Pastes the keyframes from the buffer"); uiBlockEndAlign(block); xco += (XIC + 8); @@ -225,9 +336,9 @@ void graph_header_buttons(const bContext *C, ARegion *ar) /* ghost curves */ // XXX these icons need to be changed if (sipo->ghostCurves.first) - uiDefIconButO(block, BUT, "GRAPHEDIT_OT_ghost_curves_clear", WM_OP_INVOKE_REGION_WIN, ICON_OUTLINER_DATA_CURVE, xco,yco,XIC,YIC, "Clear F-Curve snapshots (Ghosts) for this Graph Editor instance"); + uiDefIconButO(block, BUT, "GRAPH_OT_ghost_curves_clear", WM_OP_INVOKE_REGION_WIN, ICON_OUTLINER_DATA_CURVE, xco,yco,XIC,YIC, "Clear F-Curve snapshots (Ghosts) for this Graph Editor instance"); else - uiDefIconButO(block, BUT, "GRAPHEDIT_OT_ghost_curves_create", WM_OP_INVOKE_REGION_WIN, ICON_OUTLINER_OB_CURVE, xco,yco,XIC,YIC, "Create snapshot (Ghosts) of selected F-Curves as background aid for this Graph Editor instance"); + uiDefIconButO(block, BUT, "GRAPH_OT_ghost_curves_create", WM_OP_INVOKE_REGION_WIN, ICON_OUTLINER_OB_CURVE, xco,yco,XIC,YIC, "Create snapshot (Ghosts) of selected F-Curves as background aid for this Graph Editor instance"); xco+= XIC; diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h index 7ba636302a5..93e3df1c728 100644 --- a/source/blender/editors/space_graph/graph_intern.h +++ b/source/blender/editors/space_graph/graph_intern.h @@ -58,10 +58,10 @@ void graph_header_buttons(const bContext *C, struct ARegion *ar); /* ***************************************** */ /* graph_select.c */ -void GRAPHEDIT_OT_keyframes_select_all_toggle(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_select_border(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_columnselect(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_clickselect(struct wmOperatorType *ot); +void GRAPH_OT_select_all_toggle(struct wmOperatorType *ot); +void GRAPH_OT_select_border(struct wmOperatorType *ot); +void GRAPH_OT_select_column(struct wmOperatorType *ot); +void GRAPH_OT_clickselect(struct wmOperatorType *ot); /* defines for left-right select tool */ enum { @@ -82,28 +82,28 @@ enum { /* ***************************************** */ /* graph_edit.c */ -void GRAPHEDIT_OT_previewrange_set(struct wmOperatorType *ot); -void GRAPHEDIT_OT_view_all(struct wmOperatorType *ot); +void GRAPH_OT_previewrange_set(struct wmOperatorType *ot); +void GRAPH_OT_view_all(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_click_insert(struct wmOperatorType *ot); +void GRAPH_OT_click_insert(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_copy(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_paste(struct wmOperatorType *ot); +void GRAPH_OT_copy(struct wmOperatorType *ot); +void GRAPH_OT_paste(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_duplicate(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_delete(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_clean(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_sample(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_bake(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_smooth(struct wmOperatorType *ot); +void GRAPH_OT_duplicate(struct wmOperatorType *ot); +void GRAPH_OT_delete(struct wmOperatorType *ot); +void GRAPH_OT_clean(struct wmOperatorType *ot); +void GRAPH_OT_sample(struct wmOperatorType *ot); +void GRAPH_OT_bake(struct wmOperatorType *ot); +void GRAPH_OT_smooth(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_handletype(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_interpolation_type(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_extrapolation_type(struct wmOperatorType *ot); +void GRAPH_OT_handletype(struct wmOperatorType *ot); +void GRAPH_OT_interpolation_type(struct wmOperatorType *ot); +void GRAPH_OT_extrapolation_type(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_cfrasnap(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_snap(struct wmOperatorType *ot); -void GRAPHEDIT_OT_keyframes_mirror(struct wmOperatorType *ot); +void GRAPH_OT_frame_jump(struct wmOperatorType *ot); +void GRAPH_OT_snap(struct wmOperatorType *ot); +void GRAPH_OT_mirror(struct wmOperatorType *ot); /* defines for snap keyframes * NOTE: keep in sync with eEditKeyframes_Snap (in ED_keyframes_edit.h) @@ -128,16 +128,16 @@ enum { /* ----------- */ -void GRAPHEDIT_OT_fmodifier_add(struct wmOperatorType *ot); +void GRAPH_OT_fmodifier_add(struct wmOperatorType *ot); /* ----------- */ -void GRAPHEDIT_OT_ghost_curves_create(struct wmOperatorType *ot); -void GRAPHEDIT_OT_ghost_curves_clear(struct wmOperatorType *ot); +void GRAPH_OT_ghost_curves_create(struct wmOperatorType *ot); +void GRAPH_OT_ghost_curves_clear(struct wmOperatorType *ot); /* ***************************************** */ /* graph_buttons.c */ -void GRAPHEDIT_OT_properties(struct wmOperatorType *ot); +void GRAPH_OT_properties(struct wmOperatorType *ot); void graph_buttons_register(struct ARegionType *art); struct bAnimListElem *get_active_fcurve_channel(struct bAnimContext *ac); diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index a23f0081c04..f7799023f34 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -58,6 +58,10 @@ #include "WM_api.h" #include "WM_types.h" +/* ************************** poll callbacks **********************************/ + + + /* ************************** view-based operators **********************************/ // XXX this probably shouldn't be here.. @@ -80,11 +84,11 @@ static int view_toggle_handles_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_view_togglehandles (wmOperatorType *ot) +void GRAPH_OT_view_togglehandles (wmOperatorType *ot) { /* identification */ ot->name= "Show/Hide All Handles"; - ot->idname= "GRAPHEDIT_OT_handles_view_toggle"; + ot->idname= "GRAPH_OT_handles_view_toggle"; /* callbacks */ ot->exec= view_toggle_handles_exec; @@ -96,45 +100,43 @@ void GRAPHEDIT_OT_view_togglehandles (wmOperatorType *ot) void graphedit_operatortypes(void) { /* view */ - WM_operatortype_append(GRAPHEDIT_OT_view_togglehandles); - WM_operatortype_append(GRAPHEDIT_OT_previewrange_set); - WM_operatortype_append(GRAPHEDIT_OT_view_all); - WM_operatortype_append(GRAPHEDIT_OT_properties); + WM_operatortype_append(GRAPH_OT_view_togglehandles); + WM_operatortype_append(GRAPH_OT_previewrange_set); + WM_operatortype_append(GRAPH_OT_view_all); + WM_operatortype_append(GRAPH_OT_properties); - WM_operatortype_append(GRAPHEDIT_OT_ghost_curves_create); - WM_operatortype_append(GRAPHEDIT_OT_ghost_curves_clear); + WM_operatortype_append(GRAPH_OT_ghost_curves_create); + WM_operatortype_append(GRAPH_OT_ghost_curves_clear); /* keyframes */ /* selection */ - WM_operatortype_append(GRAPHEDIT_OT_keyframes_clickselect); - WM_operatortype_append(GRAPHEDIT_OT_keyframes_select_all_toggle); - WM_operatortype_append(GRAPHEDIT_OT_keyframes_select_border); - WM_operatortype_append(GRAPHEDIT_OT_keyframes_columnselect); + WM_operatortype_append(GRAPH_OT_clickselect); + WM_operatortype_append(GRAPH_OT_select_all_toggle); + WM_operatortype_append(GRAPH_OT_select_border); + WM_operatortype_append(GRAPH_OT_select_column); /* editing */ - WM_operatortype_append(GRAPHEDIT_OT_keyframes_snap); - WM_operatortype_append(GRAPHEDIT_OT_keyframes_mirror); - WM_operatortype_append(GRAPHEDIT_OT_keyframes_cfrasnap); - WM_operatortype_append(GRAPHEDIT_OT_keyframes_handletype); - WM_operatortype_append(GRAPHEDIT_OT_keyframes_interpolation_type); - WM_operatortype_append(GRAPHEDIT_OT_keyframes_extrapolation_type); - WM_operatortype_append(GRAPHEDIT_OT_keyframes_sample); - WM_operatortype_append(GRAPHEDIT_OT_keyframes_bake); - WM_operatortype_append(GRAPHEDIT_OT_keyframes_smooth); - WM_operatortype_append(GRAPHEDIT_OT_keyframes_clean); - WM_operatortype_append(GRAPHEDIT_OT_keyframes_delete); - WM_operatortype_append(GRAPHEDIT_OT_keyframes_duplicate); - - WM_operatortype_append(GRAPHEDIT_OT_keyframes_copy); - WM_operatortype_append(GRAPHEDIT_OT_keyframes_paste); - - WM_operatortype_append(GRAPHEDIT_OT_keyframes_click_insert); - - //TODO: insertkey... + WM_operatortype_append(GRAPH_OT_snap); + WM_operatortype_append(GRAPH_OT_mirror); + WM_operatortype_append(GRAPH_OT_frame_jump); + WM_operatortype_append(GRAPH_OT_handletype); + WM_operatortype_append(GRAPH_OT_interpolation_type); + WM_operatortype_append(GRAPH_OT_extrapolation_type); + WM_operatortype_append(GRAPH_OT_sample); + WM_operatortype_append(GRAPH_OT_bake); + WM_operatortype_append(GRAPH_OT_smooth); + WM_operatortype_append(GRAPH_OT_clean); + WM_operatortype_append(GRAPH_OT_delete); + WM_operatortype_append(GRAPH_OT_duplicate); + + WM_operatortype_append(GRAPH_OT_copy); + WM_operatortype_append(GRAPH_OT_paste); + + WM_operatortype_append(GRAPH_OT_click_insert); /* F-Curve Modifiers */ // XXX temporary? - WM_operatortype_append(GRAPHEDIT_OT_fmodifier_add); + WM_operatortype_append(GRAPH_OT_fmodifier_add); } /* ************************** registration - keymaps **********************************/ @@ -144,81 +146,82 @@ static void graphedit_keymap_keyframes (wmWindowManager *wm, ListBase *keymap) wmKeymapItem *kmi; /* view */ - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_handles_view_toggle", HKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_handles_view_toggle", HKEY, KM_PRESS, KM_CTRL, 0); /* graph_select.c - selection tools */ /* click-select */ - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, 0, 0); - kmi= WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, 0, 0); + kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0); RNA_boolean_set(kmi->ptr, "column", 1); - kmi= WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); + kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", 1); - kmi= WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0); + kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", 1); RNA_boolean_set(kmi->ptr, "column", 1); - kmi= WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); + kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); RNA_enum_set(kmi->ptr, "left_right", GRAPHKEYS_LRSEL_TEST); - kmi= WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0); + kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0); RNA_boolean_set(kmi->ptr, "curves", 1); - kmi= WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT|KM_SHIFT, 0); + kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT|KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "curves", 1); RNA_boolean_set(kmi->ptr, "extend", 1); /* deselect all */ - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_select_all_toggle", AKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); + WM_keymap_add_item(keymap, "GRAPH_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "GRAPH_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); /* borderselect */ - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_select_border", BKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_select_border", BKEY, KM_PRESS, KM_ALT, 0)->ptr, "axis_range", 1); + WM_keymap_add_item(keymap, "GRAPH_OT_select_border", BKEY, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "GRAPH_OT_select_border", BKEY, KM_PRESS, KM_ALT, 0)->ptr, "axis_range", 1); /* column select */ // XXX KKEY would be nice to keep for 'keyframe' lines - RNA_enum_set(WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_columnselect", KKEY, KM_PRESS, 0, 0)->ptr, "mode", GRAPHKEYS_COLUMNSEL_KEYS); - RNA_enum_set(WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_columnselect", KKEY, KM_PRESS, KM_CTRL, 0)->ptr, "mode", GRAPHKEYS_COLUMNSEL_CFRA); - RNA_enum_set(WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_columnselect", KKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", GRAPHKEYS_COLUMNSEL_MARKERS_COLUMN); - RNA_enum_set(WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_columnselect", KKEY, KM_PRESS, KM_ALT, 0)->ptr, "mode", GRAPHKEYS_COLUMNSEL_MARKERS_BETWEEN); + RNA_enum_set(WM_keymap_add_item(keymap, "GRAPH_OT_select_column", KKEY, KM_PRESS, 0, 0)->ptr, "mode", GRAPHKEYS_COLUMNSEL_KEYS); + RNA_enum_set(WM_keymap_add_item(keymap, "GRAPH_OT_select_column", KKEY, KM_PRESS, KM_CTRL, 0)->ptr, "mode", GRAPHKEYS_COLUMNSEL_CFRA); + RNA_enum_set(WM_keymap_add_item(keymap, "GRAPH_OT_select_column", KKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", GRAPHKEYS_COLUMNSEL_MARKERS_COLUMN); + RNA_enum_set(WM_keymap_add_item(keymap, "GRAPH_OT_select_column", KKEY, KM_PRESS, KM_ALT, 0)->ptr, "mode", GRAPHKEYS_COLUMNSEL_MARKERS_BETWEEN); /* graph_edit.c */ /* snap - current frame to selected keys */ - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_cfrasnap", SKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); + // TODO: maybe since this is called jump, we're better to have it on -J? + WM_keymap_add_item(keymap, "GRAPH_OT_frame_jump", SKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); /* menu + single-step transform */ - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_snap", SKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_mirror", MKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_snap", SKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_mirror", MKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_handletype", HKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_interpolation_type", TKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_extrapolation_type", EKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_handletype", HKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_interpolation_type", TKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_extrapolation_type", EKEY, KM_PRESS, KM_SHIFT, 0); /* destructive */ - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_clean", OKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_smooth", OKEY, KM_PRESS, KM_ALT, 0); - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_sample", OKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_clean", OKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_smooth", OKEY, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_sample", OKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_bake", CKEY, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_bake", CKEY, KM_PRESS, KM_ALT, 0); - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_delete", XKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_delete", DELKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_delete", XKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_delete", DELKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); /* insertkey */ - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_click_insert", LEFTMOUSE, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_click_insert", LEFTMOUSE, KM_PRESS, KM_CTRL, 0); /* copy/paste */ - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_copy", CKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_paste", VKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0); /* auto-set range */ - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_previewrange_set", PKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_view_all", HOMEKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_previewrange_set", PKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_view_all", HOMEKEY, KM_PRESS, 0, 0); /* F-Curve Modifiers */ // XXX these are temporary? operators... - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_fmodifier_add", MKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_fmodifier_add", MKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); /* transform system */ @@ -233,7 +236,7 @@ void graphedit_keymap(wmWindowManager *wm) /* keymap for all regions */ keymap= WM_keymap_listbase(wm, "GraphEdit Generic", SPACE_IPO, 0); - WM_keymap_add_item(keymap, "GRAPHEDIT_OT_properties", NKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_properties", NKEY, KM_PRESS, 0, 0); /* channels */ /* Channels are not directly handled by the Graph Editor module, but are inherited from the Animation module. diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index a222109b0fe..632ce30863d 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -173,11 +173,11 @@ static int graphkeys_deselectall_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_select_all_toggle (wmOperatorType *ot) +void GRAPH_OT_select_all_toggle (wmOperatorType *ot) { /* identifiers */ ot->name= "Select All"; - ot->idname= "GRAPHEDIT_OT_keyframes_select_all_toggle"; + ot->idname= "GRAPH_OT_select_all_toggle"; /* api callbacks */ ot->exec= graphkeys_deselectall_exec; @@ -304,11 +304,11 @@ static int graphkeys_borderselect_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_select_border(wmOperatorType *ot) +void GRAPH_OT_select_border(wmOperatorType *ot) { /* identifiers */ ot->name= "Border Select"; - ot->idname= "GRAPHEDIT_OT_keyframes_select_border"; + ot->idname= "GRAPH_OT_select_border"; /* api callbacks */ ot->invoke= WM_border_select_invoke; @@ -497,11 +497,11 @@ static int graphkeys_columnselect_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPHEDIT_OT_keyframes_columnselect (wmOperatorType *ot) +void GRAPH_OT_select_column (wmOperatorType *ot) { /* identifiers */ ot->name= "Select All"; - ot->idname= "GRAPHEDIT_OT_keyframes_columnselect"; + ot->idname= "GRAPH_OT_select_column"; /* api callbacks */ ot->exec= graphkeys_columnselect_exec; @@ -908,11 +908,11 @@ static int graphkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *ev return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; } -void GRAPHEDIT_OT_keyframes_clickselect (wmOperatorType *ot) +void GRAPH_OT_clickselect (wmOperatorType *ot) { /* identifiers */ ot->name= "Mouse Select Keys"; - ot->idname= "GRAPHEDIT_OT_keyframes_clickselect"; + ot->idname= "GRAPH_OT_clickselect"; /* api callbacks */ ot->invoke= graphkeys_clickselect_invoke; -- cgit v1.2.3 From bce3f7e019c174947a0f98063f39533eb59ab03e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 22 Jun 2009 04:26:48 +0000 Subject: PyAPI Mathutils Vector callbacks, referencing other PyObjects rather then thin wrapping vectors which is crash prone. in short, vectors can work as if they are thin wrapped but not crash blender if the original data is removed. * RNA vector's return Mathutils vector types. * BGE vectors for GameObject's localPosition, worldPosition, localPosition, localScale, worldScale, localInertia. * Comment USE_MATHUTILS define to disable returning vectors. Example... * 2.49... * loc = gameOb.worldPosition loc[1] = 0 gameOb.worldPosition = loc * With vectors... * gameOb.worldPosition[1] = 0 * But this wont crash... * loc = gameOb.worldPosition gameOb.endObject() loc[1] = 0 # will raise an error that the objects removed. This breaks games which assume return values are lists. Will add this to eulers, matrix and quaternion types later. --- source/blender/python/generic/Geometry.c | 20 ++ source/blender/python/generic/Mathutils.c | 205 +++++++++------ source/blender/python/generic/Mathutils.h | 23 +- source/blender/python/generic/matrix.c | 42 +++- source/blender/python/generic/quat.c | 2 +- source/blender/python/generic/vector.c | 321 ++++++++++++++++-------- source/blender/python/generic/vector.h | 11 +- source/blender/python/intern/bpy_rna.c | 79 +++++- source/blender/python/intern/bpy_util.c | 2 +- source/gameengine/Expressions/PyObjectPlus.h | 2 + source/gameengine/Ketsji/KX_GameObject.cpp | 155 +++++++++++- source/gameengine/Ketsji/KX_GameObject.h | 4 + source/gameengine/Ketsji/KX_PythonInitTypes.cpp | 5 + 13 files changed, 682 insertions(+), 189 deletions(-) (limited to 'source') diff --git a/source/blender/python/generic/Geometry.c b/source/blender/python/generic/Geometry.c index d1e8b471f75..edc19523da3 100644 --- a/source/blender/python/generic/Geometry.c +++ b/source/blender/python/generic/Geometry.c @@ -164,6 +164,10 @@ static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq ) for( index = 0; indexvec[0]; fp[1] = ((VectorObject *)polyVec)->vec[1]; if( ((VectorObject *)polyVec)->size > 2 ) @@ -234,6 +238,9 @@ static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args ) return NULL; } + if(!Vector_ReadCallback(line_a1) || !Vector_ReadCallback(line_a2) || !Vector_ReadCallback(line_b1) || !Vector_ReadCallback(line_b2)) + return NULL; + a1x= line_a1->vec[0]; a1y= line_a1->vec[1]; a2x= line_a2->vec[0]; @@ -330,6 +337,10 @@ static PyObject *M_Geometry_ClosestPointOnLine( PyObject * self, PyObject * args PyErr_SetString( PyExc_TypeError, "expected 3 vector types\n" ); return NULL; } + + if(!Vector_ReadCallback(pt) || !Vector_ReadCallback(line_1) || !Vector_ReadCallback(line_2)) + return NULL; + /* accept 2d verts */ if (pt->size==3) { VECCOPY(pt_in, pt->vec);} else { pt_in[2]=0.0; VECCOPY2D(pt_in, pt->vec) } @@ -363,6 +374,9 @@ static PyObject *M_Geometry_PointInTriangle2D( PyObject * self, PyObject * args return NULL; } + if(!Vector_ReadCallback(pt_vec) || !Vector_ReadCallback(tri_p1) || !Vector_ReadCallback(tri_p2) || !Vector_ReadCallback(tri_p3)) + return NULL; + return PyLong_FromLong(IsectPT2Df(pt_vec->vec, tri_p1->vec, tri_p2->vec, tri_p3->vec)); } @@ -381,6 +395,9 @@ static PyObject *M_Geometry_PointInQuad2D( PyObject * self, PyObject * args ) return NULL; } + if(!Vector_ReadCallback(pt_vec) || !Vector_ReadCallback(quad_p1) || !Vector_ReadCallback(quad_p2) || !Vector_ReadCallback(quad_p3) || !Vector_ReadCallback(quad_p4)) + return NULL; + return PyLong_FromLong(IsectPQ2Df(pt_vec->vec, quad_p1->vec, quad_p2->vec, quad_p3->vec, quad_p4->vec)); } @@ -500,6 +517,9 @@ static PyObject *M_Geometry_BezierInterp( PyObject * self, PyObject * args ) return NULL; } + if(!Vector_ReadCallback(vec_k1) || !Vector_ReadCallback(vec_h1) || !Vector_ReadCallback(vec_k2) || !Vector_ReadCallback(vec_h2)) + return NULL; + dims= MAX4(vec_k1->size, vec_h1->size, vec_h2->size, vec_k2->size); for(i=0; i < vec_k1->size; i++) k1[i]= vec_k1->vec[i]; diff --git a/source/blender/python/generic/Mathutils.c b/source/blender/python/generic/Mathutils.c index 3c34a369baf..d5af54ce68e 100644 --- a/source/blender/python/generic/Mathutils.c +++ b/source/blender/python/generic/Mathutils.c @@ -141,77 +141,6 @@ PyObject *Mathutils_Init(const char *from) } //-----------------------------METHODS---------------------------- -//----------------column_vector_multiplication (internal)--------- -//COLUMN VECTOR Multiplication (Matrix X Vector) -// [1][2][3] [a] -// [4][5][6] * [b] -// [7][8][9] [c] -//vector/matrix multiplication IS NOT COMMUTATIVE!!!! -PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec) -{ - float vecNew[4], vecCopy[4]; - double dot = 0.0f; - int x, y, z = 0; - - if(mat->rowSize != vec->size){ - if(mat->rowSize == 4 && vec->size != 3){ - PyErr_SetString(PyExc_AttributeError, "matrix * vector: matrix row size and vector size must be the same"); - return NULL; - }else{ - vecCopy[3] = 1.0f; - } - } - - for(x = 0; x < vec->size; x++){ - vecCopy[x] = vec->vec[x]; - } - - for(x = 0; x < mat->rowSize; x++) { - for(y = 0; y < mat->colSize; y++) { - dot += mat->matrix[x][y] * vecCopy[y]; - } - vecNew[z++] = (float)dot; - dot = 0.0f; - } - return newVectorObject(vecNew, vec->size, Py_NEW); -} - -//-----------------row_vector_multiplication (internal)----------- -//ROW VECTOR Multiplication - Vector X Matrix -//[x][y][z] * [1][2][3] -// [4][5][6] -// [7][8][9] -//vector/matrix multiplication IS NOT COMMUTATIVE!!!! -PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat) -{ - float vecNew[4], vecCopy[4]; - double dot = 0.0f; - int x, y, z = 0, vec_size = vec->size; - - if(mat->colSize != vec_size){ - if(mat->rowSize == 4 && vec_size != 3){ - PyErr_SetString(PyExc_AttributeError, "vector * matrix: matrix column size and the vector size must be the same"); - return NULL; - }else{ - vecCopy[3] = 1.0f; - } - } - - for(x = 0; x < vec_size; x++){ - vecCopy[x] = vec->vec[x]; - } - - //muliplication - for(x = 0; x < mat->colSize; x++) { - for(y = 0; y < mat->rowSize; y++) { - dot += mat->matrix[y][x] * vecCopy[y]; - } - vecNew[z++] = (float)dot; - dot = 0.0f; - } - return newVectorObject(vecNew, vec_size, Py_NEW); -} - //-----------------quat_rotation (internal)----------- //This function multiplies a vector/point * quat or vice versa //to rotate the point/vector by the quaternion @@ -226,6 +155,10 @@ PyObject *quat_rotation(PyObject *arg1, PyObject *arg2) quat = (QuaternionObject*)arg1; if(VectorObject_Check(arg2)){ vec = (VectorObject*)arg2; + + if(!Vector_ReadCallback(vec)) + return NULL; + rot[0] = quat->quat[0]*quat->quat[0]*vec->vec[0] + 2*quat->quat[2]*quat->quat[0]*vec->vec[2] - 2*quat->quat[3]*quat->quat[0]*vec->vec[1] + quat->quat[1]*quat->quat[1]*vec->vec[0] + 2*quat->quat[2]*quat->quat[1]*vec->vec[1] + 2*quat->quat[3]*quat->quat[1]*vec->vec[2] - @@ -242,6 +175,10 @@ PyObject *quat_rotation(PyObject *arg1, PyObject *arg2) } }else if(VectorObject_Check(arg1)){ vec = (VectorObject*)arg1; + + if(!Vector_ReadCallback(vec)) + return NULL; + if(QuaternionObject_Check(arg2)){ quat = (QuaternionObject*)arg2; rot[0] = quat->quat[0]*quat->quat[0]*vec->vec[0] + 2*quat->quat[2]*quat->quat[0]*vec->vec[2] - @@ -308,6 +245,9 @@ static PyObject *M_Mathutils_AngleBetweenVecs(PyObject * self, PyObject * args) if(vec1->size != vec2->size) goto AttributeError1; //bad sizes + if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2)) + return NULL; + //since size is the same.... size = vec1->size; @@ -353,6 +293,9 @@ static PyObject *M_Mathutils_MidpointVecs(PyObject * self, PyObject * args) PyErr_SetString(PyExc_AttributeError, "Mathutils.MidpointVecs(): expects (2) vector objects of the same size\n"); return NULL; } + + if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2)) + return NULL; for(x = 0; x < vec1->size; x++) { vec[x] = 0.5f * (vec1->vec[x] + vec2->vec[x]); @@ -377,6 +320,10 @@ static PyObject *M_Mathutils_ProjectVecs(PyObject * self, PyObject * args) return NULL; } + if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2)) + return NULL; + + //since they are the same size... size = vec1->size; @@ -439,6 +386,10 @@ static PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args) PyErr_SetString(PyExc_AttributeError, "Mathutils.RotationMatrix(): the arbitrary axis must be a 3D vector\n"); return NULL; } + + if(!Vector_ReadCallback(vec)) + return NULL; + } //convert to radians angle = angle * (float) (Py_PI / 180); @@ -538,6 +489,10 @@ static PyObject *M_Mathutils_TranslationMatrix(PyObject * self, VectorObject * v PyErr_SetString(PyExc_TypeError, "Mathutils.TranslationMatrix(): vector must be 3D or 4D\n"); return NULL; } + + if(!Vector_ReadCallback(vec)) + return NULL; + //create a identity matrix and add translation Mat4One((float(*)[4]) mat); mat[12] = vec->vec[0]; @@ -570,6 +525,10 @@ static PyObject *M_Mathutils_ScaleMatrix(PyObject * self, PyObject * args) PyErr_SetString(PyExc_AttributeError, "Mathutils.ScaleMatrix(): please use 2D vectors when scaling in 2D\n"); return NULL; } + + if(!Vector_ReadCallback(vec)) + return NULL; + } if(vec == NULL) { //scaling along axis if(matSize == 2) { @@ -645,6 +604,10 @@ static PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * a PyErr_SetString(PyExc_AttributeError, "Mathutils.OrthoProjectionMatrix(): please use 2D vectors when scaling in 2D\n"); return NULL; } + + if(!Vector_ReadCallback(vec)) + return NULL; + } if(vec == NULL) { //ortho projection onto cardinal plane if(((strcmp(plane, "x") == 0) @@ -891,6 +854,9 @@ static PyObject *M_Mathutils_Intersect( PyObject * self, PyObject * args ) return NULL; } + if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2) || !Vector_ReadCallback(vec3) || !Vector_ReadCallback(ray) || !Vector_ReadCallback(ray_off)) + return NULL; + VECCOPY(v1, vec1->vec); VECCOPY(v2, vec2->vec); VECCOPY(v3, vec3->vec); @@ -959,6 +925,10 @@ static PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args ) PyErr_SetString( PyExc_TypeError,"vectors must be of the same size\n" ); return NULL; } + + if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2) || !Vector_ReadCallback(vec3) || !Vector_ReadCallback(vec4)) + return NULL; + if( vec1->size == 3 || vec1->size == 2) { int result; @@ -1029,6 +999,10 @@ static PyObject *M_Mathutils_QuadNormal( PyObject * self, PyObject * args ) PyErr_SetString( PyExc_TypeError, "only 3D vectors\n" ); return NULL; } + + if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2) || !Vector_ReadCallback(vec3) || !Vector_ReadCallback(vec4)) + return NULL; + VECCOPY(v1, vec1->vec); VECCOPY(v2, vec2->vec); VECCOPY(v3, vec3->vec); @@ -1073,6 +1047,9 @@ static PyObject *M_Mathutils_TriangleNormal( PyObject * self, PyObject * args ) PyErr_SetString( PyExc_TypeError, "only 3D vectors\n" ); return NULL; } + + if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2) || !Vector_ReadCallback(vec3)) + return NULL; VECCOPY(v1, vec1->vec); VECCOPY(v2, vec2->vec); @@ -1105,6 +1082,9 @@ static PyObject *M_Mathutils_TriangleArea( PyObject * self, PyObject * args ) PyErr_SetString( PyExc_TypeError, "vectors must be of the same size\n" ); return NULL; } + + if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2) || !Vector_ReadCallback(vec3)) + return NULL; if (vec1->size == 3) { VECCOPY(v1, vec1->vec); @@ -1154,8 +1134,8 @@ int EXPP_FloatsAreEqual(float A, float B, int floatSteps) } /*---------------------- EXPP_VectorsAreEqual ------------------------- Builds on EXPP_FloatsAreEqual to test vectors */ -int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps){ - +int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps) +{ int x; for (x=0; x< size; x++){ if (EXPP_FloatsAreEqual(vecA[x], vecB[x], floatSteps) == 0) @@ -1165,6 +1145,81 @@ int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps){ } +/* Mathutils Callbacks */ + +/* for mathutils internal use only, eventually should re-alloc but to start with we only have a few users */ +Mathutils_Callback *mathutils_callbacks[8] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; + +int Mathutils_RegisterCallback(Mathutils_Callback *cb) +{ + int i; + + /* find the first free slot */ + for(i= 0; mathutils_callbacks[i]; i++) { + if(mathutils_callbacks[i]==cb) /* alredy registered? */ + return i; + } + + mathutils_callbacks[i] = cb; + return i; +} + +int Vector_ReadCallback(VectorObject *self) { + if(self->user) { + Mathutils_Callback *cb= mathutils_callbacks[self->callback_type]; + if(cb->get(self->user, self->subtype, self->vec)) { + return 1; + } + else { + PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); + return 0; + } + } + + return 1; /* no user continue silently */ +} + +int Vector_WriteCallback(VectorObject *self) { + if(self->user) { + Mathutils_Callback *cb= mathutils_callbacks[self->callback_type]; + if(cb->set(self->user, self->subtype, self->vec)) { + return 1; + } + else { + PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); + return 0; + } + } + + return 1; /* no user continue silently */ +} + +int Vector_ReadIndexCallback(VectorObject *self, int index) { + if(self->user) { + Mathutils_Callback *cb= mathutils_callbacks[self->callback_type]; + if(cb->get_index(self->user, self->subtype, self->vec, index)) { + return 1; + } + else { + PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); + return 0; + } + } + + return 1; /* no user continue silently */ +} -//####################################################################### -//#############################DEPRECATED################################ +int Vector_WriteIndexCallback(VectorObject *self, int index) { + if(self->user) { + Mathutils_Callback *cb= mathutils_callbacks[self->callback_type]; + if(cb->set_index(self->user, self->subtype, self->vec, index)) { + return 1; + } + else { + PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); + return 0; + } + } + + return 1; /* no user continue silently */ +} diff --git a/source/blender/python/generic/Mathutils.h b/source/blender/python/generic/Mathutils.h index e8882c3dac2..07cf029b77c 100644 --- a/source/blender/python/generic/Mathutils.h +++ b/source/blender/python/generic/Mathutils.h @@ -40,8 +40,6 @@ PyObject *Mathutils_Init( const char * from ); -PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat); -PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec); PyObject *quat_rotation(PyObject *arg1, PyObject *arg2); int EXPP_FloatsAreEqual(float A, float B, int floatSteps); @@ -49,8 +47,9 @@ int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps); #define Py_PI 3.14159265358979323846 -#define Py_WRAP 1024 -#define Py_NEW 2048 + +#define Py_NEW 1 +#define Py_WRAP 2 /* Mathutils is used by the BGE and Blender so have to define @@ -65,4 +64,20 @@ int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps); #define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True #endif +typedef struct Mathutils_Callback Mathutils_Callback; +struct Mathutils_Callback { + int (*check)(PyObject *user); /* checks the user is still valid */ + int (*get)(PyObject *user, int subtype, float *vec_from); /* gets the vector from the user */ + int (*set)(PyObject *user, int subtype, float *vec_to); /* sets the users vector values once the vector is modified */ + int (*get_index)(PyObject *user, int subtype, float *vec_from, int index); /* same as above but only for an index */ + int (*set_index)(PyObject *user, int subtype, float *vec_to, int index); /* same as above but only for an index */ +}; + +int Mathutils_RegisterCallback(Mathutils_Callback *cb); + +int Vector_ReadCallback(VectorObject *self); +int Vector_WriteCallback(VectorObject *self); +int Vector_ReadIndexCallback(VectorObject *self, int index); +int Vector_WriteIndexCallback(VectorObject *self, int index); + #endif /* EXPP_Mathutils_H */ diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c index e2ab1c3c653..e8e8bffd419 100644 --- a/source/blender/python/generic/matrix.c +++ b/source/blender/python/generic/matrix.c @@ -31,6 +31,8 @@ #include "BLI_arithb.h" #include "BLI_blenlib.h" +static PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec); /* utility func */ + /*-------------------------DOC STRINGS ---------------------------*/ static char Matrix_Zero_doc[] = "() - set all values in the matrix to 0"; static char Matrix_Identity_doc[] = "() - set the square matrix to it's identity matrix"; @@ -829,7 +831,7 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) else /* if(mat1) { */ { if(VectorObject_Check(m2)) { /* MATRIX*VECTOR */ - return column_vector_multiplication(mat1, (VectorObject *)m2); + return column_vector_multiplication(mat1, (VectorObject *)m2); /* vector update done inside the function */ } else { scalar= PyFloat_AsDouble(m2); @@ -1056,3 +1058,41 @@ PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type) } return (PyObject *) self; } + +//----------------column_vector_multiplication (internal)--------- +//COLUMN VECTOR Multiplication (Matrix X Vector) +// [1][2][3] [a] +// [4][5][6] * [b] +// [7][8][9] [c] +//vector/matrix multiplication IS NOT COMMUTATIVE!!!! +static PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec) +{ + float vecNew[4], vecCopy[4]; + double dot = 0.0f; + int x, y, z = 0; + + if(!Vector_ReadCallback(vec)) + return NULL; + + if(mat->rowSize != vec->size){ + if(mat->rowSize == 4 && vec->size != 3){ + PyErr_SetString(PyExc_AttributeError, "matrix * vector: matrix row size and vector size must be the same"); + return NULL; + }else{ + vecCopy[3] = 1.0f; + } + } + + for(x = 0; x < vec->size; x++){ + vecCopy[x] = vec->vec[x]; + } + + for(x = 0; x < mat->rowSize; x++) { + for(y = 0; y < mat->colSize; y++) { + dot += mat->matrix[x][y] * vecCopy[y]; + } + vecNew[z++] = (float)dot; + dot = 0.0f; + } + return newVectorObject(vecNew, vec->size, Py_NEW); +} diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c index 4ad5d07b3b8..4ee984673e8 100644 --- a/source/blender/python/generic/quat.c +++ b/source/blender/python/generic/quat.c @@ -570,7 +570,7 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2) PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: only 3D vector rotations currently supported\n"); return NULL; } - return quat_rotation((PyObject*)quat1, (PyObject*)vec); + return quat_rotation((PyObject*)quat1, (PyObject*)vec); /* vector updating done inside the func */ } scalar= PyFloat_AsDouble(q2); diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index 562413c6967..ce11149e311 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -39,6 +39,8 @@ #define SWIZZLE_VALID_AXIS 0x4 #define SWIZZLE_AXIS 0x3 +static PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat); /* utility func */ + /*-------------------------DOC STRINGS ---------------------------*/ static char Vector_Zero_doc[] = "() - set all values in the vector to 0"; static char Vector_Normalize_doc[] = "() - normalize the vector"; @@ -60,7 +62,7 @@ static PyObject *Vector_Resize2D( VectorObject * self ); static PyObject *Vector_Resize3D( VectorObject * self ); static PyObject *Vector_Resize4D( VectorObject * self ); static PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ); -static PyObject *Vector_Reflect( VectorObject * self, PyObject * value ); +static PyObject *Vector_Reflect( VectorObject *self, VectorObject *value ); static PyObject *Vector_Cross( VectorObject * self, VectorObject * value ); static PyObject *Vector_Dot( VectorObject * self, VectorObject * value ); static PyObject *Vector_copy( VectorObject * self ); @@ -141,6 +143,8 @@ static PyObject *Vector_Zero(VectorObject * self) for(i = 0; i < self->size; i++) { self->vec[i] = 0.0f; } + + Vector_WriteCallback(self); Py_INCREF(self); return (PyObject*)self; } @@ -151,6 +155,9 @@ static PyObject *Vector_Normalize(VectorObject * self) int i; float norm = 0.0f; + if(!Vector_ReadCallback(self)) + return NULL; + for(i = 0; i < self->size; i++) { norm += self->vec[i] * self->vec[i]; } @@ -158,6 +165,8 @@ static PyObject *Vector_Normalize(VectorObject * self) for(i = 0; i < self->size; i++) { self->vec[i] /= norm; } + + Vector_WriteCallback(self); Py_INCREF(self); return (PyObject*)self; } @@ -171,6 +180,11 @@ static PyObject *Vector_Resize2D(VectorObject * self) PyErr_SetString(PyExc_TypeError, "vector.resize2d(): cannot resize wrapped data - only python vectors\n"); return NULL; } + if(self->user) { + PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize a vector that has an owner"); + return NULL; + } + self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 2)); if(self->vec == NULL) { PyErr_SetString(PyExc_MemoryError, "vector.resize2d(): problem allocating pointer space\n\n"); @@ -189,6 +203,11 @@ static PyObject *Vector_Resize3D(VectorObject * self) PyErr_SetString(PyExc_TypeError, "vector.resize3d(): cannot resize wrapped data - only python vectors\n"); return NULL; } + if(self->user) { + PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize a vector that has an owner"); + return NULL; + } + self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 3)); if(self->vec == NULL) { PyErr_SetString(PyExc_MemoryError, "vector.resize3d(): problem allocating pointer space\n\n"); @@ -210,6 +229,11 @@ static PyObject *Vector_Resize4D(VectorObject * self) PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize wrapped data - only python vectors"); return NULL; } + if(self->user) { + PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize a vector that has an owner"); + return NULL; + } + self->vec = PyMem_Realloc(self->vec, (sizeof(float) * 4)); if(self->vec == NULL) { PyErr_SetString(PyExc_MemoryError, "vector.resize4d(): problem allocating pointer space\n\n"); @@ -241,6 +265,9 @@ static PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) PyErr_SetString( PyExc_TypeError, "only for 3D vectors\n" ); return NULL; } + + if(!Vector_ReadCallback(self)) + return NULL; if (strack) { if (strlen(strack) == 2) { @@ -342,9 +369,8 @@ static PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) return a reflected vector on the mirror normal ((2 * DotVecs(vec, mirror)) * mirror) - vec using arithb.c would be nice here */ -static PyObject *Vector_Reflect( VectorObject * self, PyObject * value ) +static PyObject *Vector_Reflect( VectorObject * self, VectorObject * value ) { - VectorObject *mirrvec; float mirror[3]; float vec[3]; float reflect[4] = {0.0f, 0.0f, 0.0f, 0.0f}; @@ -358,11 +384,13 @@ static PyObject *Vector_Reflect( VectorObject * self, PyObject * value ) PyErr_SetString( PyExc_TypeError, "vec.reflect(value): expected a vector argument" ); return NULL; } - mirrvec = (VectorObject *)value; - mirror[0] = mirrvec->vec[0]; - mirror[1] = mirrvec->vec[1]; - if (mirrvec->size > 2) mirror[2] = mirrvec->vec[2]; + if(!Vector_ReadCallback(self) || !Vector_ReadCallback(value)) + return NULL; + + mirror[0] = value->vec[0]; + mirror[1] = value->vec[1]; + if (value->size > 2) mirror[2] = value->vec[2]; else mirror[2] = 0.0; /* normalize, whos idea was it not to use arithb.c? :-/ */ @@ -403,6 +431,9 @@ static PyObject *Vector_Cross( VectorObject * self, VectorObject * value ) return NULL; } + if(!Vector_ReadCallback(self) || !Vector_ReadCallback(value)) + return NULL; + vecCross = (VectorObject *)newVectorObject(NULL, 3, Py_NEW); Crossf(vecCross->vec, self->vec, value->vec); return (PyObject *)vecCross; @@ -423,6 +454,9 @@ static PyObject *Vector_Dot( VectorObject * self, VectorObject * value ) return NULL; } + if(!Vector_ReadCallback(self) || !Vector_ReadCallback(value)) + return NULL; + for(x = 0; x < self->size; x++) { dot += self->vec[x] * value->vec[x]; } @@ -433,6 +467,9 @@ static PyObject *Vector_Dot( VectorObject * self, VectorObject * value ) return a copy of the vector */ static PyObject *Vector_copy(VectorObject * self) { + if(!Vector_ReadCallback(self)) + return NULL; + return newVectorObject(self->vec, self->size, Py_NEW); } @@ -444,6 +481,7 @@ static void Vector_dealloc(VectorObject * self) if(self->wrapped != Py_WRAP){ PyMem_Free(self->vec); } + Py_XDECREF(self->user); PyObject_DEL(self); } @@ -454,6 +492,9 @@ static PyObject *Vector_repr(VectorObject * self) int i; char buffer[48], str[1024]; + if(!Vector_ReadCallback(self)) + return NULL; + BLI_strncpy(str,"[",1024); for(i = 0; i < self->size; i++){ if(i < (self->size - 1)){ @@ -484,6 +525,9 @@ static PyObject *Vector_item(VectorObject * self, int i) return NULL; } + if(!Vector_ReadIndexCallback(self, i)) + return NULL; + return PyFloat_FromDouble(self->vec[i]); } @@ -502,6 +546,9 @@ static int Vector_ass_item(VectorObject * self, int i, PyObject * ob) return -1; } self->vec[i] = scalar; + + if(!Vector_WriteIndexCallback(self, i)) + return -1; return 0; } @@ -512,6 +559,9 @@ static PyObject *Vector_slice(VectorObject * self, int begin, int end) PyObject *list = NULL; int count; + if(!Vector_ReadCallback(self)) + return NULL; + CLAMP(begin, 0, self->size); if (end<0) end= self->size+end+1; CLAMP(end, 0, self->size); @@ -534,6 +584,9 @@ static int Vector_ass_slice(VectorObject * self, int begin, int end, float vec[4], scalar; PyObject *v; + if(!Vector_ReadCallback(self)) + return -1; + CLAMP(begin, 0, self->size); if (end<0) end= self->size+end+1; CLAMP(end, 0, self->size); @@ -566,6 +619,10 @@ static int Vector_ass_slice(VectorObject * self, int begin, int end, for(y = 0; y < size; y++){ self->vec[begin + y] = vec[y]; } + + if(!Vector_WriteCallback(self)) + return -1; + return 0; } /*------------------------NUMERIC PROTOCOLS---------------------- @@ -586,6 +643,10 @@ static PyObject *Vector_add(PyObject * v1, PyObject * v2) /* make sure v1 is always the vector */ if (vec1 && vec2 ) { + + if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2)) + return NULL; + /*VECTOR + VECTOR*/ if(vec1->size != vec2->size) { PyErr_SetString(PyExc_AttributeError, "Vector addition: vectors must have the same dimensions for this operation\n"); @@ -617,6 +678,10 @@ static PyObject *Vector_iadd(PyObject * v1, PyObject * v2) /* make sure v1 is always the vector */ if (vec1 && vec2 ) { + + if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2)) + return NULL; + /*VECTOR + VECTOR*/ if(vec1->size != vec2->size) { PyErr_SetString(PyExc_AttributeError, "Vector addition: vectors must have the same dimensions for this operation\n"); @@ -629,6 +694,7 @@ static PyObject *Vector_iadd(PyObject * v1, PyObject * v2) return v1; } + Vector_WriteCallback(vec1); PyErr_SetString(PyExc_AttributeError, "Vector addition: arguments not valid for this operation....\n"); return NULL; } @@ -648,6 +714,9 @@ static PyObject *Vector_sub(PyObject * v1, PyObject * v2) vec1 = (VectorObject*)v1; vec2 = (VectorObject*)v2; + if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2)) + return NULL; + if(vec1->size != vec2->size) { PyErr_SetString(PyExc_AttributeError, "Vector subtraction: vectors must have the same dimensions for this operation\n"); return NULL; @@ -663,7 +732,7 @@ static PyObject *Vector_sub(PyObject * v1, PyObject * v2) subtraction*/ static PyObject *Vector_isub(PyObject * v1, PyObject * v2) { - int i, size; + int i; VectorObject *vec1 = NULL, *vec2 = NULL; if (!VectorObject_Check(v1) || !VectorObject_Check(v2)) { @@ -677,12 +746,15 @@ static PyObject *Vector_isub(PyObject * v1, PyObject * v2) PyErr_SetString(PyExc_AttributeError, "Vector subtraction: vectors must have the same dimensions for this operation\n"); return NULL; } + + if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2)) + return NULL; - size = vec1->size; for(i = 0; i < vec1->size; i++) { vec1->vec[i] = vec1->vec[i] - vec2->vec[i]; } + Vector_WriteCallback(vec1); Py_INCREF( v1 ); return v1; } @@ -694,11 +766,17 @@ static PyObject *Vector_mul(PyObject * v1, PyObject * v2) VectorObject *vec1 = NULL, *vec2 = NULL; float scalar; - if VectorObject_Check(v1) + if VectorObject_Check(v1) { vec1= (VectorObject *)v1; - - if VectorObject_Check(v2) + if(!Vector_ReadCallback(vec1)) + return NULL; + } + if VectorObject_Check(v2) { vec2= (VectorObject *)v2; + if(!Vector_ReadCallback(vec2)) + return NULL; + } + /* make sure v1 is always the vector */ if (vec1 && vec2 ) { @@ -757,6 +835,9 @@ static PyObject *Vector_imul(PyObject * v1, PyObject * v2) int i; float scalar; + if(!Vector_ReadCallback(vec)) + return NULL; + /* only support vec*=float and vec*=mat vec*=vec result is a float so that wont work */ if (MatrixObject_Check(v2)) { @@ -787,22 +868,21 @@ static PyObject *Vector_imul(PyObject * v1, PyObject * v2) } vec->vec[i] = (float)dot; } - Py_INCREF( v1 ); - return v1; } else if (((scalar= PyFloat_AsDouble(v2)) == -1.0 && PyErr_Occurred())==0) { /* VEC*=FLOAT */ for(i = 0; i < vec->size; i++) { vec->vec[i] *= scalar; } - - Py_INCREF( v1 ); - return v1; - + } + else { + PyErr_SetString(PyExc_TypeError, "Vector multiplication: arguments not acceptable for this operation\n"); + return NULL; } - PyErr_SetString(PyExc_TypeError, "Vector multiplication: arguments not acceptable for this operation\n"); - return NULL; + Vector_WriteCallback(vec); + Py_INCREF( v1 ); + return v1; } /*------------------------obj / obj------------------------------ @@ -819,6 +899,9 @@ static PyObject *Vector_div(PyObject * v1, PyObject * v2) } vec1 = (VectorObject*)v1; /* vector */ + if(!Vector_ReadCallback(vec1)) + return NULL; + scalar = (float)PyFloat_AsDouble(v2); if(scalar== -1.0f && PyErr_Occurred()) { /* parsed item not a number */ PyErr_SetString(PyExc_TypeError, "Vector division: Vector must be divided by a float\n"); @@ -842,14 +925,10 @@ static PyObject *Vector_idiv(PyObject * v1, PyObject * v2) { int i; float scalar; - VectorObject *vec1 = NULL; + VectorObject *vec1 = (VectorObject*)v1; - /*if(!VectorObject_Check(v1)) { - PyErr_SetString(PyExc_TypeError, "Vector division: Vector must be divided by a float\n"); - return -1; - }*/ - - vec1 = (VectorObject*)v1; /* vector */ + if(!Vector_ReadCallback(vec1)) + return NULL; scalar = (float)PyFloat_AsDouble(v2); if(scalar==-1.0f && PyErr_Occurred()) { /* parsed item not a number */ @@ -864,6 +943,9 @@ static PyObject *Vector_idiv(PyObject * v1, PyObject * v2) for(i = 0; i < vec1->size; i++) { vec1->vec[i] /= scalar; } + + Vector_WriteCallback(vec1); + Py_INCREF( v1 ); return v1; } @@ -874,6 +956,10 @@ static PyObject *Vector_neg(VectorObject *self) { int i; float vec[4]; + + if(!Vector_ReadCallback(self)) + return NULL; + for(i = 0; i < self->size; i++){ vec[i] = -self->vec[i]; } @@ -919,6 +1005,9 @@ static PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int compa vecA = (VectorObject*)objectA; vecB = (VectorObject*)objectB; + if(!Vector_ReadCallback(vecA) || !Vector_ReadCallback(vecB)) + return NULL; + if (vecA->size != vecB->size){ if (comparison_type == Py_NE){ Py_RETURN_TRUE; @@ -1045,66 +1134,12 @@ static PyNumberMethods Vector_NumMethods = { static PyObject *Vector_getAxis( VectorObject * self, void *type ) { - switch( (long)type ) { - case 'X': /* these are backwards, but that how it works */ - return PyFloat_FromDouble(self->vec[0]); - case 'Y': - return PyFloat_FromDouble(self->vec[1]); - case 'Z': /* these are backwards, but that how it works */ - if(self->size < 3) { - PyErr_SetString(PyExc_AttributeError, "vector.z: error, cannot get this axis for a 2D vector\n"); - return NULL; - } - else { - return PyFloat_FromDouble(self->vec[2]); - } - case 'W': - if(self->size < 4) { - PyErr_SetString(PyExc_AttributeError, "vector.w: error, cannot get this axis for a 3D vector\n"); - return NULL; - } - - return PyFloat_FromDouble(self->vec[3]); - default: - { - PyErr_SetString( PyExc_RuntimeError, "undefined type in Vector_getAxis" ); - return NULL; - } - } + return Vector_item(self, (int)type); } static int Vector_setAxis( VectorObject * self, PyObject * value, void * type ) { - float param= (float)PyFloat_AsDouble( value ); - - if (param==-1 && PyErr_Occurred()) { - PyErr_SetString( PyExc_TypeError, "expected a number for the vector axis" ); - return -1; - } - switch( (long)type ) { - case 'X': /* these are backwards, but that how it works */ - self->vec[0]= param; - break; - case 'Y': - self->vec[1]= param; - break; - case 'Z': /* these are backwards, but that how it works */ - if(self->size < 3) { - PyErr_SetString(PyExc_AttributeError, "vector.z: error, cannot get this axis for a 2D vector\n"); - return -1; - } - self->vec[2]= param; - break; - case 'W': - if(self->size < 4) { - PyErr_SetString(PyExc_AttributeError, "vector.w: error, cannot get this axis for a 3D vector\n"); - return -1; - } - self->vec[3]= param; - break; - } - - return 0; + return Vector_ass_item(self, (int)type, value); } /* vector.length */ @@ -1113,6 +1148,9 @@ static PyObject *Vector_getLength( VectorObject * self, void *type ) double dot = 0.0f; int i; + if(!Vector_ReadCallback(self)) + return NULL; + for(i = 0; i < self->size; i++){ dot += (self->vec[i] * self->vec[i]); } @@ -1124,6 +1162,9 @@ static int Vector_setLength( VectorObject * self, PyObject * value ) double dot = 0.0f, param; int i; + if(!Vector_ReadCallback(self)) + return -1; + param= PyFloat_AsDouble( value ); if(param==-1.0 && PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "length must be set to a number"); @@ -1159,6 +1200,8 @@ static int Vector_setLength( VectorObject * self, PyObject * value ) self->vec[i]= self->vec[i] / (float)dot; } + Vector_WriteCallback(self); /* checked alredy */ + return 0; } @@ -1170,6 +1213,16 @@ static PyObject *Vector_getWrapped( VectorObject * self, void *type ) Py_RETURN_FALSE; } +static PyObject *Vector_getOwner( VectorObject * self, void *type ) +{ + if(self->user==NULL) { + Py_RETURN_NONE; + } + else { + Py_INCREF(self->user); + return self->user; + } +} /* Get a new Vector according to the provided swizzle. This function has little error checking, as we are in control of the inputs: the closure is set by us @@ -1181,6 +1234,9 @@ static PyObject *Vector_getSwizzle(VectorObject * self, void *closure) float vec[MAX_DIMENSIONS]; unsigned int swizzleClosure; + if(!Vector_ReadCallback(self)) + return NULL; + /* Unpack the axes from the closure into an array. */ axisA = 0; swizzleClosure = (unsigned int) closure; @@ -1218,6 +1274,9 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur float vecTemp[MAX_DIMENSIONS]; + if(!Vector_ReadCallback(self)) + return -1; + /* Check that the closure can be used with this vector: even 2D vectors have swizzles defined for axes z and w, but they would be invalid. */ swizzleClosure = (unsigned int) closure; @@ -1247,7 +1306,7 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur axisB++; } memcpy(self->vec, vecTemp, axisB * sizeof(float)); - return 0; + /* continue with Vector_WriteCallback at the end */ } else if (PyList_Check(value)) { @@ -1273,7 +1332,7 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur axisB++; } memcpy(self->vec, vecTemp, axisB * sizeof(float)); - return 0; + /* continue with Vector_WriteCallback at the end */ } else if (((scalarVal = (float)PyFloat_AsDouble(value)) == -1.0 && PyErr_Occurred())==0) { @@ -1286,13 +1345,17 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS; } - return 0; + /* continue with Vector_WriteCallback at the end */ } - else - { + else { PyErr_SetString( PyExc_TypeError, "Expected a Vector, list or scalar value." ); return -1; } + + if(!Vector_WriteCallback(vecVal)) + return -1; + else + return 0; } /*****************************************************************************/ @@ -1302,19 +1365,19 @@ static PyGetSetDef Vector_getseters[] = { {"x", (getter)Vector_getAxis, (setter)Vector_setAxis, "Vector X axis", - (void *)'X'}, + (void *)0}, {"y", (getter)Vector_getAxis, (setter)Vector_setAxis, "Vector Y axis", - (void *)'Y'}, + (void *)1}, {"z", (getter)Vector_getAxis, (setter)Vector_setAxis, "Vector Z axis", - (void *)'Z'}, + (void *)2}, {"w", (getter)Vector_getAxis, (setter)Vector_setAxis, "Vector Z axis", - (void *)'W'}, + (void *)3}, {"length", (getter)Vector_getLength, (setter)Vector_setLength, "Vector Length", @@ -1327,6 +1390,10 @@ static PyGetSetDef Vector_getseters[] = { (getter)Vector_getWrapped, (setter)NULL, "True when this wraps blenders internal data", NULL}, + {"__owner__", + (getter)Vector_getOwner, (setter)NULL, + "Read only owner for vectors that depend on another object", + NULL}, /* autogenerated swizzle attrs, see python script below */ {"xx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, Vector_swizzle_doc, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<user= user; + self->callback_type = (unsigned char)callback_type; + self->subtype = (unsigned char)subtype; + } + + return self; +} + +//-----------------row_vector_multiplication (internal)----------- +//ROW VECTOR Multiplication - Vector X Matrix +//[x][y][z] * [1][2][3] +// [4][5][6] +// [7][8][9] +//vector/matrix multiplication IS NOT COMMUTATIVE!!!! +static PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat) +{ + float vecNew[4], vecCopy[4]; + double dot = 0.0f; + int x, y, z = 0, vec_size = vec->size; + + if(mat->colSize != vec_size){ + if(mat->rowSize == 4 && vec_size != 3){ + PyErr_SetString(PyExc_AttributeError, "vector * matrix: matrix column size and the vector size must be the same"); + return NULL; + }else{ + vecCopy[3] = 1.0f; + } + } + + if(!Vector_ReadCallback(vec)) + return NULL; + + for(x = 0; x < vec_size; x++){ + vecCopy[x] = vec->vec[x]; + } + + //muliplication + for(x = 0; x < mat->colSize; x++) { + for(y = 0; y < mat->rowSize; y++) { + dot += mat->matrix[y][x] * vecCopy[y]; + } + vecNew[z++] = (float)dot; + dot = 0.0f; + } + return newVectorObject(vecNew, vec_size, Py_NEW); +} + +/*----------------------------Vector.negate() -------------------- set the vector to it's negative -x, -y, -z */ static PyObject *Vector_Negate(VectorObject * self) { int i; - for(i = 0; i < self->size; i++) { + if(!Vector_ReadCallback(self)) + return NULL; + + for(i = 0; i < self->size; i++) self->vec[i] = -(self->vec[i]); - } - /*printf("Vector.negate(): Deprecated: use -vector instead\n");*/ + + Vector_WriteCallback(self); // alredy checked for error + Py_INCREF(self); return (PyObject*)self; } -/*################################################################### - ###########################DEPRECATED##############################*/ diff --git a/source/blender/python/generic/vector.h b/source/blender/python/generic/vector.h index d2eb826ef10..12e035f55fa 100644 --- a/source/blender/python/generic/vector.h +++ b/source/blender/python/generic/vector.h @@ -39,12 +39,17 @@ extern PyTypeObject vector_Type; typedef struct { PyObject_VAR_HEAD - float *vec; /*1D array of data (alias), wrapped status depends on wrapped status */ - short size; /* vec size 2,3 or 4 */ - short wrapped; /* is wrapped data? */ + float *vec; /*1D array of data (alias), wrapped status depends on wrapped status */ + PyObject *user; /* if this vector references another object, otherwise NULL, *Note* this owns its reference */ + unsigned char size; /* vec size 2,3 or 4 */ + unsigned char wrapped; /* wrapped data type? */ + unsigned char callback_type; /* which user funcs do we adhere to, RNA, GameObject, etc */ + unsigned char subtype; /* subtype: location, rotation... to avoid defining many new functions for every attribute of the same type */ + } VectorObject; /*prototypes*/ PyObject *newVectorObject(float *vec, int size, int type); +PyObject *newVectorObject_cb(PyObject *user, int size, int callback_type, int subtype); #endif /* EXPP_vector_h */ diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index f28f00e9c02..57c7144f949 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -39,6 +39,64 @@ #include "BKE_global.h" /* evil G.* */ #include "BKE_report.h" +#define USE_MATHUTILS + +#ifdef USE_MATHUTILS +#include "../generic/Mathutils.h" /* so we can have mathutils callbacks */ + +static int mathutils_rna_vector_cb_index= -1; /* index for our callbacks */ + +static int mathutils_rna_vector_check(PyObject *user) +{ + return ((BPy_PropertyRNA *)user)->prop?1:0; +} + +static int mathutils_rna_vector_get(BPy_PropertyRNA *self, int subtype, float *vec_from) +{ + if(self->prop==NULL) + return 0; + + RNA_property_float_get_array(&self->ptr, self->prop, vec_from); + return 1; +} + +static int mathutils_rna_vector_set(BPy_PropertyRNA *self, int subtype, float *vec_to) +{ + if(self->prop==NULL) + return 0; + + RNA_property_float_set_array(&self->ptr, self->prop, vec_to); + return 1; +} + +static int mathutils_rna_vector_get_index(BPy_PropertyRNA *self, int subtype, float *vec_from, int index) +{ + if(self->prop==NULL) + return 0; + + vec_from[index]= RNA_property_float_get_index(&self->ptr, self->prop, index); + return 1; +} + +static int mathutils_rna_vector_set_index(BPy_PropertyRNA *self, int subtype, float *vec_to, int index) +{ + if(self->prop==NULL) + return 0; + + RNA_property_float_set_index(&self->ptr, self->prop, index, vec_to[index]); + return 1; +} + +Mathutils_Callback mathutils_rna_vector_cb = { + mathutils_rna_vector_check, + mathutils_rna_vector_get, + mathutils_rna_vector_set, + mathutils_rna_vector_get_index, + mathutils_rna_vector_set_index +}; + +#endif + static int pyrna_struct_compare( BPy_StructRNA * a, BPy_StructRNA * b ) { return (a->ptr.data==b->ptr.data) ? 0 : -1; @@ -144,7 +202,22 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop) if (len > 0) { /* resolve the array from a new pytype */ - return pyrna_prop_CreatePyObject(ptr, prop); + PyObject *ret = pyrna_prop_CreatePyObject(ptr, prop); + +#ifdef USE_MATHUTILS + /* return a mathutils vector where possible */ + if( RNA_property_type(prop)==PROP_FLOAT && + RNA_property_subtype(prop)==PROP_VECTOR && + len>=2 && len <= 4 ) + { + PyObject *vec_cb= newVectorObject_cb(ret, len, mathutils_rna_vector_cb_index, 0); + Py_DECREF(ret); /* the vector owns now */ + + ret= vec_cb; /* return the vector instead */ + } +#endif + + return ret; } /* see if we can coorce into a python type - PropertyType */ @@ -1674,6 +1747,10 @@ PyObject *BPY_rna_module( void ) { PointerRNA ptr; +#ifdef USE_MATHUTILS // register mathutils callbacks, ok to run more then once. + mathutils_rna_vector_cb_index= Mathutils_RegisterCallback(&mathutils_rna_vector_cb); +#endif + /* This can't be set in the pytype struct because some compilers complain */ pyrna_prop_Type.tp_getattro = PyObject_GenericGetAttr; pyrna_prop_Type.tp_setattro = PyObject_GenericSetAttr; diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index d837892fb4d..bce73b903c0 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -171,7 +171,7 @@ void PyObSpit(char *name, PyObject *var) { else { PyObject_Print(var, stderr, 0); fprintf(stderr, " ref:%d ", var->ob_refcnt); - fprintf(stderr, " ptr:%ld", (long)var); + fprintf(stderr, " ptr:%p", (void *)var); fprintf(stderr, " type:"); if(Py_TYPE(var)) diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index c002dccefe4..96c75b710a3 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -41,6 +41,8 @@ #include "MT_Vector3.h" #include "SG_QList.h" +#define USE_MATHUTILS // Blender 2.5x api will use mathutils, for a while we might want to test without it + /*------------------------------ * Python defines ------------------------------*/ diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index b266095c715..081549db686 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1152,6 +1152,139 @@ CListValue* KX_GameObject::GetChildrenRecursive() } +#ifdef USE_MATHUTILS +extern "C" { +#include "../../blender/python/generic/Mathutils.h" /* so we can have mathutils callbacks */ +} + +/* These require an SGNode */ +#define MATHUTILS_VEC_CB_POS_LOCAL 1 +#define MATHUTILS_VEC_CB_POS_GLOBAL 2 +#define MATHUTILS_VEC_CB_SCALE_LOCAL 3 +#define MATHUTILS_VEC_CB_SCALE_GLOBAL 4 +#define MATHUTILS_VEC_CB_INERTIA_LOCAL 5 + + +static int mathutils_kxgameob_vector_cb_index= -1; /* index for our callbacks */ + +static int mathutils_kxgameob_vector_check(PyObject *self_v) +{ + KX_GameObject* self= static_castBGE_PROXY_REF(self_v); + if(self==NULL) + return 0; + + return 1; +} + +static int mathutils_kxgameob_vector_get(PyObject *self_v, int subtype, float *vec_from) +{ + KX_GameObject* self= static_castBGE_PROXY_REF(self_v); + if(self==NULL) + return 0; + + switch(subtype) { + case MATHUTILS_VEC_CB_POS_LOCAL: + if(!self->GetSGNode()) return 0; + self->GetSGNode()->GetLocalPosition().getValue(vec_from); + break; + case MATHUTILS_VEC_CB_POS_GLOBAL: + if(!self->GetSGNode()) return 0; + self->GetSGNode()->GetWorldPosition().getValue(vec_from); + break; + case MATHUTILS_VEC_CB_SCALE_LOCAL: + if(!self->GetSGNode()) return 0; + self->GetSGNode()->GetLocalScale().getValue(vec_from); + break; + case MATHUTILS_VEC_CB_SCALE_GLOBAL: + self->NodeGetWorldScaling().getValue(vec_from); + break; + case MATHUTILS_VEC_CB_INERTIA_LOCAL: + if(!self->GetSGNode()) return 0; + self->GetPhysicsController()->GetLocalInertia().getValue(vec_from); + break; + + + } + + return 1; +} + +static int mathutils_kxgameob_vector_set(PyObject *self_v, int subtype, float *vec_to) +{ + KX_GameObject* self= static_castBGE_PROXY_REF(self_v); + if(self==NULL) + return 0; + + /* first */ + SG_Node* sg = self->GetSGNode(); + if(sg==NULL) + return 0; + + switch(subtype) { + case MATHUTILS_VEC_CB_POS_LOCAL: + self->NodeSetLocalPosition(MT_Point3(vec_to)); + self->NodeUpdateGS(0.f); + break; + case MATHUTILS_VEC_CB_POS_GLOBAL: + self->NodeSetWorldPosition(MT_Point3(vec_to)); + self->NodeUpdateGS(0.f); + break; + case MATHUTILS_VEC_CB_SCALE_LOCAL: + self->NodeSetLocalScale(MT_Point3(vec_to)); + self->NodeUpdateGS(0.f); + break; + case MATHUTILS_VEC_CB_SCALE_GLOBAL: + break; + case MATHUTILS_VEC_CB_INERTIA_LOCAL: + /* read only */ + break; + } + + return 1; +} + +static int mathutils_kxgameob_vector_get_index(PyObject *self_v, int subtype, float *vec_from, int index) +{ + float f[4]; + /* lazy, avoid repeteing the case statement */ + if(!mathutils_kxgameob_vector_get(self_v, subtype, f)) + return 0; + + vec_from[index]= f[index]; + return 1; +} + +static int mathutils_kxgameob_vector_set_index(PyObject *self_v, int subtype, float *vec_to, int index) +{ + float f= vec_to[index]; + + /* lazy, avoid repeteing the case statement */ + if(!mathutils_kxgameob_vector_get(self_v, subtype, vec_to)) + return 0; + + vec_to[index]= f; + mathutils_kxgameob_vector_set(self_v, subtype, vec_to); + + return 1; +} + +Mathutils_Callback mathutils_kxgameob_vector_cb = { + mathutils_kxgameob_vector_check, + mathutils_kxgameob_vector_get, + mathutils_kxgameob_vector_set, + mathutils_kxgameob_vector_get_index, + mathutils_kxgameob_vector_set_index +}; + + +void KX_GameObject_Mathutils_Callback_Init(void) +{ + // register mathutils callbacks, ok to run more then once. + mathutils_kxgameob_vector_cb_index= Mathutils_RegisterCallback(&mathutils_kxgameob_vector_cb); +} + +#endif // USE_MATHUTILS + /* ------- python stuff ---------------------------------------------------*/ PyMethodDef KX_GameObject::Methods[] = { @@ -1596,7 +1729,11 @@ int KX_GameObject::pyattr_set_visible(void *self_v, const KX_PYATTRIBUTE_DEF *at PyObject* KX_GameObject::pyattr_get_worldPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_GameObject* self= static_cast(self_v); +#ifdef USE_MATHUTILS + return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_GLOBAL); +#else return PyObjectFrom(self->NodeGetWorldPosition()); +#endif } int KX_GameObject::pyattr_set_worldPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) @@ -1614,10 +1751,14 @@ int KX_GameObject::pyattr_set_worldPosition(void *self_v, const KX_PYATTRIBUTE_D PyObject* KX_GameObject::pyattr_get_localPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_GameObject* self= static_cast(self_v); +#ifdef USE_MATHUTILS + return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_LOCAL); +#else if (self->GetSGNode()) return PyObjectFrom(self->GetSGNode()->GetLocalPosition()); else return PyObjectFrom(dummy_point); +#endif } int KX_GameObject::pyattr_set_localPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) @@ -1635,11 +1776,13 @@ int KX_GameObject::pyattr_set_localPosition(void *self_v, const KX_PYATTRIBUTE_D PyObject* KX_GameObject::pyattr_get_localInertia(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_GameObject* self= static_cast(self_v); +#ifdef USE_MATHUTILS + return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_INERTIA_LOCAL); +#else if (self->GetPhysicsController()) - { return PyObjectFrom(self->GetPhysicsController()->GetLocalInertia()); - } return Py_BuildValue("fff", 0.0f, 0.0f, 0.0f); + #endif } PyObject* KX_GameObject::pyattr_get_worldOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -1694,16 +1837,24 @@ int KX_GameObject::pyattr_set_localOrientation(void *self_v, const KX_PYATTRIBUT PyObject* KX_GameObject::pyattr_get_worldScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_GameObject* self= static_cast(self_v); +#ifdef USE_MATHUTILS + return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_GLOBAL); +#else return PyObjectFrom(self->NodeGetWorldScaling()); +#endif } PyObject* KX_GameObject::pyattr_get_localScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_GameObject* self= static_cast(self_v); +#ifdef USE_MATHUTILS + return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_LOCAL); +#else if (self->GetSGNode()) return PyObjectFrom(self->GetSGNode()->GetLocalScale()); else return PyObjectFrom(dummy_scaling); +#endif } int KX_GameObject::pyattr_set_localScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index ff5c8a01e6e..b01b0cae641 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -63,6 +63,10 @@ struct Object; /* utility conversion function */ bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py_none_ok, const char *error_prefix); +#ifdef USE_MATHUTILS +void KX_GameObject_Mathutils_Callback_Init(void); +#endif + /** * KX_GameObject is the main class for dynamic objects. */ diff --git a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp index 83c4dcbb34c..05cb818fdd9 100644 --- a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp +++ b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp @@ -231,6 +231,11 @@ void initPyTypes(void) /* Normal python type */ PyType_Ready(&KX_PythonSeq_Type); + +#ifdef USE_MATHUTILS + /* Init mathutils callbacks */ + KX_GameObject_Mathutils_Callback_Init(); +#endif } #endif \ No newline at end of file -- cgit v1.2.3 From e7d02e567990b8cac05565501e0b74a9bb195a6d Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 22 Jun 2009 18:19:18 +0000 Subject: 2.5: warning fixes Mostly harmless ones, except for one about "gzopen64" being undeclared. This needs some defines in BLI_storage.h to be set before is included. Might fix a crash in compressed file reading, though I'm not sure since it's hard to repeat the crash consistently. --- source/blender/blenkernel/intern/constraint.c | 8 ++++---- source/blender/blenkernel/intern/effect.c | 2 ++ source/blender/blenkernel/intern/exotic.c | 1 + source/blender/blenkernel/intern/fluidsim.c | 2 ++ source/blender/blenkernel/intern/idprop.c | 8 ++++---- source/blender/blenkernel/intern/particle_system.c | 12 +++++++++--- source/blender/blenkernel/intern/pointcache.c | 4 +--- source/blender/blenlib/BLI_storage.h | 7 ++++++- source/blender/blenlib/intern/psfont.c | 4 ++-- source/blender/blenloader/intern/readblenentry.c | 2 ++ source/blender/editors/space_text/text_header.c | 2 ++ source/blender/editors/space_view3d/view3d_view.c | 3 ++- source/blender/makesrna/intern/rna_access.c | 2 +- source/blender/python/BPY_extern.h | 2 ++ 14 files changed, 40 insertions(+), 19 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index a43389a2ef6..88e73a00ba7 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -3028,7 +3028,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase * if (VALID_CONS_TARGET(ct)) { float loc[3], eul[3], size[3]; float dvec[3], sval[3]; - short i; + int i; /* obtain target effect */ switch (data->from) { @@ -3075,7 +3075,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase * switch (data->to) { case 2: /* scaling */ for (i=0; i<3; i++) - size[i]= data->to_min[i] + (sval[data->map[i]] * (data->to_max[i] - data->to_min[i])); + size[i]= data->to_min[i] + (sval[(int)data->map[i]] * (data->to_max[i] - data->to_min[i])); break; case 1: /* rotation */ for (i=0; i<3; i++) { @@ -3085,7 +3085,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase * tmax= data->to_max[i]; /* all values here should be in degrees */ - eul[i]= tmin + (sval[data->map[i]] * (tmax - tmin)); + eul[i]= tmin + (sval[(int)data->map[i]] * (tmax - tmin)); /* now convert final value back to radians */ eul[i] = (float)(eul[i] / 180 * M_PI); @@ -3094,7 +3094,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase * default: /* location */ /* get new location */ for (i=0; i<3; i++) - loc[i]= (data->to_min[i] + (sval[data->map[i]] * (data->to_max[i] - data->to_min[i]))); + loc[i]= (data->to_min[i] + (sval[(int)data->map[i]] * (data->to_max[i] - data->to_min[i]))); /* add original location back on (so that it can still be moved) */ VecAddf(loc, cob->matrix[3], loc); diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 9858025af5a..eaa2d541638 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -29,6 +29,8 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include "BLI_storage.h" /* _LARGEFILE_SOURCE */ + #include #include diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index f15e1c24949..4e7e76dfae3 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -29,6 +29,7 @@ * * ***** END GPL LICENSE BLOCK *****/ +#include "BLI_storage.h" #include /* isdigit, isspace */ #include diff --git a/source/blender/blenkernel/intern/fluidsim.c b/source/blender/blenkernel/intern/fluidsim.c index 9eefd48cae4..54008185f72 100644 --- a/source/blender/blenkernel/intern/fluidsim.c +++ b/source/blender/blenkernel/intern/fluidsim.c @@ -28,6 +28,8 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include "BLI_storage.h" /* _LARGEFILE_SOURCE */ + #include "MEM_guardedalloc.h" #include "DNA_mesh_types.h" diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 3be47778674..54366aadd92 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -230,16 +230,16 @@ void IDP_ResizeArray(IDProperty *prop, int newlen) */ newsize = (newsize >> 3) + (newsize < 9 ? 3 : 6) + newsize; - newarr = MEM_callocN(idp_size_table[prop->subtype]*newsize, "idproperty array resized"); + newarr = MEM_callocN(idp_size_table[(int)prop->subtype]*newsize, "idproperty array resized"); if (newlen >= prop->len) { /* newlen is bigger*/ - memcpy(newarr, prop->data.pointer, prop->len*idp_size_table[prop->subtype]); + memcpy(newarr, prop->data.pointer, prop->len*idp_size_table[(int)prop->subtype]); idp_resize_group_array(prop, newlen, newarr); } else { /* newlen is smaller*/ idp_resize_group_array(prop, newlen, newarr); - memcpy(newarr, prop->data.pointer, newlen*prop->len*idp_size_table[prop->subtype]); + memcpy(newarr, prop->data.pointer, newlen*prop->len*idp_size_table[(int)prop->subtype]); } MEM_freeN(prop->data.pointer); @@ -546,7 +546,7 @@ int IDP_EqualsProperties(IDProperty *prop1, IDProperty *prop2) return BSTR_EQ(IDP_String(prop1), IDP_String(prop2)); else if(prop1->type == IDP_ARRAY) { if(prop1->len == prop2->len && prop1->subtype == prop2->subtype) - return memcmp(IDP_Array(prop1), IDP_Array(prop2), idp_size_table[prop1->subtype]*prop1->len); + return memcmp(IDP_Array(prop1), IDP_Array(prop2), idp_size_table[(int)prop1->subtype]*prop1->len); else return 0; } diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index fc6413849d1..97b1956bba9 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -29,6 +29,8 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include "BLI_storage.h" /* _LARGEFILE_SOURCE */ + #include #include #include @@ -2203,12 +2205,15 @@ void psys_get_pointcache_start_end(Scene *scene, ParticleSystem *psys, int *sfra *sfra = MAX2(1, (int)part->sta); *efra = MIN2((int)(part->end + part->lifetime + 1.0), scene->r.efra); } -static float *particle_state_ptr(int index, ParticleSystem *psys) +static float *particle_state_ptr(int index, void *psys_ptr) { + ParticleSystem *psys= psys_ptr; + return (float *)(&(psys->particles+index)->state); } -static void particle_read_state(int index, ParticleSystem *psys, float *data) +static void particle_read_state(int index, void *psys_ptr, float *data) { + ParticleSystem *psys= psys_ptr; ParticleData *pa = psys->particles + index; ParticleKey *key = (ParticleKey *)data; @@ -2217,8 +2222,9 @@ static void particle_read_state(int index, ParticleSystem *psys, float *data) copy_particle_key(&pa->state, key, 1); } -static void particle_cache_interpolate(int index, ParticleSystem *psys, float frs_sec, float cfra, int cfra1, int cfra2, float *data1, float *data2) +static void particle_cache_interpolate(int index, void *psys_ptr, float frs_sec, float cfra, int cfra1, int cfra2, float *data1, float *data2) { + ParticleSystem *psys= psys_ptr; ParticleData *pa = psys->particles + index; ParticleKey keys[4]; float dfra; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index f59336518d7..b514ac026fb 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1050,7 +1050,6 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) int endframe = CFRA; int bake = baker->bake; int render = baker->render; - int end = 0; G.afbreek = 0; @@ -1162,7 +1161,6 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) { int totelem=0; int float_count=0; int tot; - int write_error=0; if (!G.relbase_valid){ cache->flag &= ~PTCACHE_DISK_CACHE; @@ -1243,4 +1241,4 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) { BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); cache->flag &= ~PTCACHE_DISK_CACHE; } -} \ No newline at end of file +} diff --git a/source/blender/blenlib/BLI_storage.h b/source/blender/blenlib/BLI_storage.h index d7bf3bd13f8..fa44bb36e15 100644 --- a/source/blender/blenlib/BLI_storage.h +++ b/source/blender/blenlib/BLI_storage.h @@ -25,15 +25,20 @@ * * ***** END GPL LICENSE BLOCK ***** */ + #ifndef BLI_STORAGE_H #define BLI_STORAGE_H +/* NOTE: these have to be defined before including unistd.h! */ #ifndef __APPLE__ #ifndef WIN32 -#define _LARGEFILE_SOURCE 1 +#ifndef _LARGEFILE_SOURCE +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE #define _FILE_OFFSET_BITS 64 #endif #endif +#endif struct direntry; diff --git a/source/blender/blenlib/intern/psfont.c b/source/blender/blenlib/intern/psfont.c index 39d38e4cf3a..269e674a62f 100644 --- a/source/blender/blenlib/intern/psfont.c +++ b/source/blender/blenlib/intern/psfont.c @@ -837,7 +837,7 @@ static int decodetype1(PackedFile * pf, char *outname) while(newfgets(oneline, LINELEN, pf)) { hptr = (char *)oneline; while(*hptr) { - if(hextab[*hptr] != NOTHEX) + if(hextab[(int)*hptr] != NOTHEX) hexdat[hexbytes++] = *hptr; hptr++; } @@ -853,7 +853,7 @@ static int decodetype1(PackedFile * pf, char *outname) bptr = bindat; c = datbytes; while(c--) { - *bptr++ = (hextab[hptr[0]]<<4)+hextab[hptr[1]]; + *bptr++ = (hextab[(int)hptr[0]]<<4)+hextab[(int)hptr[1]]; hptr += 2; } diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 0c8b8a6b31d..1f276913ea8 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -32,6 +32,8 @@ #include #endif +#include "BLI_storage.h" /* _LARGEFILE_SOURCE */ + #include #include #include diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c index 1b8149cb5a2..c761587198f 100644 --- a/source/blender/editors/space_text/text_header.c +++ b/source/blender/editors/space_text/text_header.c @@ -88,6 +88,7 @@ /* ************************ header area region *********************** */ #ifndef DISABLE_PYTHON +#if 0 static void do_text_template_scriptsmenu(bContext *C, void *arg, int event) { // XXX BPY_menu_do_python(PYMENU_SCRIPTTEMPLATE, event); @@ -154,6 +155,7 @@ static uiBlock *text_plugin_scriptsmenu(bContext *C, void *args_unused) return block; } #endif +#endif /************************** properties ******************************/ diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 2db5f2c97fd..782d426641f 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -76,11 +76,12 @@ #include "UI_resources.h" #include "UI_view2d.h" +#include "GPU_draw.h" + #include "PIL_time.h" /* smoothview */ #include "view3d_intern.h" // own include - /* use this call when executing an operator, event system doesn't set for each event the opengl drawing context */ diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 13686809cd2..c806f1885ba 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -694,7 +694,7 @@ int RNA_enum_name(const EnumPropertyItem *item, const int value, const char **na int RNA_property_enum_identifier(PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier) { const EnumPropertyItem *item; - int totitem, i; + int totitem; RNA_property_enum_items(ptr, prop, &item, &totitem); diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h index 855fdde50c5..7658ca5d359 100644 --- a/source/blender/python/BPY_extern.h +++ b/source/blender/python/BPY_extern.h @@ -50,6 +50,8 @@ struct bConstraintTarget; /* DNA_constraint_types.h*/ struct Script; /* DNA_screen_types.h */ struct BPyMenu; struct bContext; +struct ReportList; + #ifdef __cplusplus extern "C" { #endif -- cgit v1.2.3 From 8c1d19020eb609e6afed714c1083c5cb9261e114 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 22 Jun 2009 23:58:16 +0000 Subject: UI * Make Directional Order menus the default again. * Scale up contents panels that do not use layout system. * Fix for enum size and uncesseray colon in some cases. * For item_menu_enumO, show icons if specified in RNA in the menu (e.g. in the add modifier menu if there were icons specified). --- source/blender/editors/interface/interface.c | 2 +- .../blender/editors/interface/interface_layout.c | 26 +++++++++++++--------- .../editors/interface/interface_templates.c | 1 + source/blender/makesdna/DNA_userdef_types.h | 2 +- source/blender/makesrna/intern/rna_userdef.c | 2 +- 5 files changed, 19 insertions(+), 14 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 5ffc6440dc4..8278e7f6b36 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2753,7 +2753,7 @@ void uiBlockFlipOrder(uiBlock *block) uiBut *but, *next; float centy, miny=10000, maxy= -10000; - if(!(U.uiflag & USER_DIRECTIONALORDER)) + if(U.uiflag & USER_MENUFIXEDORDER) return; for(but= block->buttons.first; but; but= but->next) { diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 81c49105870..555500004ea 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -601,7 +601,7 @@ void uiItemsEnumO(uiLayout *layout, char *opname, char *propname) RNA_property_enum_items(&ptr, prop, &item, &totitem); for(i=0; iroot->type == UI_LAYOUT_MENU) { @@ -1453,9 +1457,9 @@ static void ui_litem_layout_free(uiLayout *litem) totw -= minx; toth -= miny; - if(litem->w && totw > litem->w) + if(litem->w && totw > 0) scalex= (float)litem->w/(float)totw; - if(litem->h && toth > litem->h) + if(litem->h && toth > 0) scaley= (float)litem->h/(float)toth; x= litem->x; @@ -1466,15 +1470,15 @@ static void ui_litem_layout_free(uiLayout *litem) ui_item_size(item, &itemw, &itemh); if(scalex != 1.0f) { - newx= itemx*scalex; - itemw= (itemx + itemw)*scalex - newx; - itemx= newx; + newx= (itemx - minx)*scalex; + itemw= (itemx - minx + itemw)*scalex - newx; + itemx= minx + newx; } if(scaley != 1.0f) { - newy= itemy*scaley; - itemh= (itemy + itemh)*scaley - newy; - itemy= newy; + newy= (itemy - miny)*scaley; + itemh= (itemy - miny + itemh)*scaley - newy; + itemy= miny + newy; } ui_item_position(item, x+itemx-minx, y+itemy-miny, itemw, itemh); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index a0ee264cf01..0bbe0850244 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1490,3 +1490,4 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, char *propname) } } } + diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 9d554c88a95..6be855a27da 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -379,7 +379,7 @@ extern UserDef U; /* from blenkernel blender.c */ #define USER_ZOOM_TO_MOUSEPOS (1 << 20) #define USER_SHOW_FPS (1 << 21) #define USER_MMB_PASTE (1 << 22) -#define USER_DIRECTIONALORDER (1 << 23) +#define USER_MENUFIXEDORDER (1 << 23) /* Auto-Keying mode */ /* AUTOKEY_ON is a bitflag */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 65d83bec552..f3811938e28 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -1505,7 +1505,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Toolbox Column Layout", "Use a column layout for toolbox."); prop= RNA_def_property(srna, "directional_menus", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DIRECTIONALORDER); + RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_MENUFIXEDORDER); RNA_def_property_ui_text(prop, "Contents Follow Opening Direction", "Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction."); /* snap to grid */ -- cgit v1.2.3 From 333e231fa6c8e44582d94fedd2dda958e5131316 Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Tue, 23 Jun 2009 00:09:26 +0000 Subject: SVN maintenance. --- source/blender/blenkernel/BKE_gpencil.h | 2 +- source/blender/blenkernel/intern/gpencil.c | 2 +- source/blender/blenkernel/intern/sequence.c | 2 +- source/blender/blenlib/BLI_listbase.h | 4 ++-- source/blender/blenlib/BLI_noise.h | 2 +- source/blender/blenlib/BLI_rect.h | 2 +- source/blender/blenlib/BLI_string.h | 4 ++-- source/blender/blenlib/intern/dynamiclist.c | 2 +- source/blender/blenlib/intern/dynamiclist.h | 2 +- source/blender/blenlib/intern/listbase.c | 2 +- source/blender/blenlib/intern/string.c | 2 +- source/blender/editors/animation/Makefile | 2 +- source/blender/editors/animation/anim_channels.c | 2 +- source/blender/editors/animation/keyframes_draw.c | 2 +- source/blender/editors/armature/Makefile | 2 +- source/blender/editors/curve/Makefile | 2 +- source/blender/editors/datafiles/Bfont.c | 2 +- source/blender/editors/datafiles/Makefile | 2 +- source/blender/editors/gpencil/Makefile | 2 +- source/blender/editors/gpencil/gpencil_edit.c | 2 +- source/blender/editors/include/BIF_gl.h | 2 +- source/blender/editors/include/ED_fluidsim.h | 2 +- source/blender/editors/include/ED_keyframes_draw.h | 2 +- source/blender/editors/include/ED_keyframing.h | 2 +- source/blender/editors/include/ED_particle.h | 2 +- source/blender/editors/include/ED_pointcache.h | 2 +- source/blender/editors/include/UI_resources.h | 2 +- source/blender/editors/interface/Makefile | 2 +- source/blender/editors/interface/interface.c | 2 +- source/blender/editors/interface/interface_draw.c | 2 +- source/blender/editors/interface/interface_intern.h | 2 +- source/blender/editors/interface/resources.c | 2 +- source/blender/editors/mesh/Makefile | 2 +- source/blender/editors/object/Makefile | 2 +- source/blender/editors/physics/Makefile | 2 +- source/blender/editors/preview/Makefile | 2 +- source/blender/editors/screen/Makefile | 2 +- source/blender/editors/screen/glutil.c | 2 +- source/blender/editors/sculpt_paint/Makefile | 2 +- source/blender/editors/sculpt_paint/sculpt.c | 2 +- source/blender/editors/sculpt_paint/sculpt_intern.h | 2 +- source/blender/editors/space_action/Makefile | 2 +- source/blender/editors/space_action/action_draw.c | 2 +- source/blender/editors/space_action/action_edit.c | 2 +- source/blender/editors/space_action/action_select.c | 2 +- source/blender/editors/space_api/Makefile | 2 +- source/blender/editors/space_buttons/Makefile | 2 +- source/blender/editors/space_file/Makefile | 2 +- source/blender/editors/space_graph/Makefile | 2 +- source/blender/editors/space_graph/graph_draw.c | 2 +- source/blender/editors/space_graph/graph_edit.c | 2 +- source/blender/editors/space_graph/graph_select.c | 2 +- source/blender/editors/space_image/Makefile | 2 +- source/blender/editors/space_info/Makefile | 2 +- source/blender/editors/space_logic/Makefile | 2 +- source/blender/editors/space_logic/logic_buttons.c | 2 +- source/blender/editors/space_nla/Makefile | 2 +- source/blender/editors/space_node/Makefile | 2 +- source/blender/editors/space_node/node_draw.c | 2 +- source/blender/editors/space_outliner/Makefile | 2 +- source/blender/editors/space_script/Makefile | 2 +- source/blender/editors/space_sequencer/Makefile | 2 +- source/blender/editors/space_sequencer/sequencer_buttons.c | 2 +- source/blender/editors/space_sound/Makefile | 2 +- source/blender/editors/space_text/Makefile | 2 +- source/blender/editors/space_time/Makefile | 2 +- source/blender/editors/space_view3d/Makefile | 2 +- source/blender/editors/transform/Makefile | 2 +- source/blender/editors/transform/transform_input.c | 2 +- source/blender/editors/transform/transform_ops.c | 2 +- source/blender/editors/util/Makefile | 2 +- source/blender/editors/uvedit/Makefile | 2 +- source/blender/makesrna/intern/Makefile | 2 +- source/blender/makesrna/intern/rna_key.c | 2 +- source/blender/makesrna/intern/rna_lattice.c | 2 +- source/blender/makesrna/intern/rna_packedfile.c | 2 +- source/blender/python/BPY_extern.h | 2 +- source/blender/python/Makefile | 2 +- source/blender/python/generic/BGL.c | 2 +- source/blender/python/generic/BGL.h | 2 +- source/blender/python/generic/Geometry.c | 2 +- source/blender/python/generic/Geometry.h | 2 +- source/blender/python/generic/Makefile | 2 +- source/blender/python/generic/Mathutils.c | 2 +- source/blender/python/generic/Mathutils.h | 2 +- source/blender/python/generic/bpy_internal_import.c | 2 +- source/blender/python/generic/bpy_internal_import.h | 2 +- source/blender/python/generic/euler.c | 2 +- source/blender/python/generic/euler.h | 2 +- source/blender/python/generic/matrix.c | 2 +- source/blender/python/generic/matrix.h | 2 +- source/blender/python/generic/quat.c | 2 +- source/blender/python/generic/quat.h | 2 +- source/blender/python/generic/vector.c | 2 +- source/blender/python/generic/vector.h | 2 +- source/blender/python/intern/Makefile | 2 +- source/blender/windowmanager/intern/Makefile | 2 +- source/blender/windowmanager/intern/wm_subwindow.c | 2 +- source/blender/windowmanager/wm_cursors.h | 2 +- 99 files changed, 101 insertions(+), 101 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h index 581285be21c..1892c8e71a4 100644 --- a/source/blender/blenkernel/BKE_gpencil.h +++ b/source/blender/blenkernel/BKE_gpencil.h @@ -1,5 +1,5 @@ /** - * $Id: BDR_gpencil.h 19541 2009-04-05 06:54:47Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 6086aa58d40..dd8f44c71d5 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1,5 +1,5 @@ /** - * $Id: gpencil.c 19758 2009-04-16 13:10:08Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/intern/sequence.c b/source/blender/blenkernel/intern/sequence.c index bb0665a5b0f..7fc262b4796 100644 --- a/source/blender/blenkernel/intern/sequence.c +++ b/source/blender/blenkernel/intern/sequence.c @@ -1,5 +1,5 @@ /** -* $Id: sequence.c 17508 2008-11-20 00:34:24Z campbellbarton $ +* $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h index d2fb62141de..d0b106b59c3 100644 --- a/source/blender/blenlib/BLI_listbase.h +++ b/source/blender/blenlib/BLI_listbase.h @@ -1,5 +1,5 @@ /* - * $Id: BLI_blenlib.h 17433 2008-11-12 21:16:53Z blendix $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -26,7 +26,7 @@ * * ***** END GPL LICENSE BLOCK ***** * - * $Id: $ + * $Id$ */ #ifndef BLI_LISTBASE_H diff --git a/source/blender/blenlib/BLI_noise.h b/source/blender/blenlib/BLI_noise.h index 9f72c5e7b54..0886eb3a8a5 100644 --- a/source/blender/blenlib/BLI_noise.h +++ b/source/blender/blenlib/BLI_noise.h @@ -1,5 +1,5 @@ /* - * $Id: BLI_blenlib.h 17433 2008-11-12 21:16:53Z blendix $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h index c7026b21494..c36a41af84b 100644 --- a/source/blender/blenlib/BLI_rect.h +++ b/source/blender/blenlib/BLI_rect.h @@ -1,5 +1,5 @@ /* - * $Id: BLI_blenlib.h 17433 2008-11-12 21:16:53Z blendix $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h index 4e5bf650196..bf93dc19cc5 100644 --- a/source/blender/blenlib/BLI_string.h +++ b/source/blender/blenlib/BLI_string.h @@ -1,5 +1,5 @@ /* - * $Id: BLI_blenlib.h 17433 2008-11-12 21:16:53Z blendix $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -26,7 +26,7 @@ * * ***** END GPL LICENSE BLOCK ***** * - * $Id: $ + * $Id$ */ #ifndef BLI_STRING_H diff --git a/source/blender/blenlib/intern/dynamiclist.c b/source/blender/blenlib/intern/dynamiclist.c index fbb87124bba..4fe654cffb6 100644 --- a/source/blender/blenlib/intern/dynamiclist.c +++ b/source/blender/blenlib/intern/dynamiclist.c @@ -3,7 +3,7 @@ * various string, file, list operations. * * - * $Id: util.c 17433 2008-11-12 21:16:53Z blendix $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenlib/intern/dynamiclist.h b/source/blender/blenlib/intern/dynamiclist.h index aba3eda0696..e8c93fbcf23 100644 --- a/source/blender/blenlib/intern/dynamiclist.h +++ b/source/blender/blenlib/intern/dynamiclist.h @@ -1,5 +1,5 @@ /** - * $Id: BLI_dynamiclist.h 13161 2008-01-07 19:13:47Z hos $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c index e0fd5c37494..1064c8ac1bf 100644 --- a/source/blender/blenlib/intern/listbase.c +++ b/source/blender/blenlib/intern/listbase.c @@ -3,7 +3,7 @@ * various string, file, list operations. * * - * $Id: util.c 17433 2008-11-12 21:16:53Z blendix $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index fa4bcbc26bc..4cd04aa232c 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -3,7 +3,7 @@ * various string, file, list operations. * * - * $Id: util.c 17433 2008-11-12 21:16:53Z blendix $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/animation/Makefile b/source/blender/editors/animation/Makefile index 19b62891b63..a7f36aa58ac 100644 --- a/source/blender/editors/animation/Makefile +++ b/source/blender/editors/animation/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index c52ade1bba8..05d50f98e8e 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -1,5 +1,5 @@ /** - * $Id: editaction.c 17746 2008-12-08 11:19:44Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index cfbd6d2bced..d0e83eeaec7 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -1,5 +1,5 @@ /** - * $Id: drawaction.c 17746 2008-12-08 11:19:44Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/armature/Makefile b/source/blender/editors/armature/Makefile index 6c7ce81a8a1..0291bcb1830 100644 --- a/source/blender/editors/armature/Makefile +++ b/source/blender/editors/armature/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/curve/Makefile b/source/blender/editors/curve/Makefile index 6b1f628f231..6449700e50b 100644 --- a/source/blender/editors/curve/Makefile +++ b/source/blender/editors/curve/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/datafiles/Bfont.c b/source/blender/editors/datafiles/Bfont.c index 4080a0d369f..cd45debcbe4 100644 --- a/source/blender/editors/datafiles/Bfont.c +++ b/source/blender/editors/datafiles/Bfont.c @@ -1,6 +1,6 @@ /* DataToC output of file */ /* - * $Id: Bfont.c 125 2002-11-25 12:02:15Z mein $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/datafiles/Makefile b/source/blender/editors/datafiles/Makefile index 4162125623e..d7bb4e7222f 100644 --- a/source/blender/editors/datafiles/Makefile +++ b/source/blender/editors/datafiles/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/gpencil/Makefile b/source/blender/editors/gpencil/Makefile index f4c1cd246f4..9bc5f491a83 100644 --- a/source/blender/editors/gpencil/Makefile +++ b/source/blender/editors/gpencil/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index bad86c170ab..c0c1cbc7ac6 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -1,5 +1,5 @@ /** - * $Id: gpencil.c 19758 2009-04-16 13:10:08Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/BIF_gl.h b/source/blender/editors/include/BIF_gl.h index 014201648c9..c1b3b056d62 100644 --- a/source/blender/editors/include/BIF_gl.h +++ b/source/blender/editors/include/BIF_gl.h @@ -1,5 +1,5 @@ /** - * $Id: BIF_gl.h 10455 2007-04-04 13:18:41Z campbellbarton $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_fluidsim.h b/source/blender/editors/include/ED_fluidsim.h index bda879173c3..586f16f42aa 100644 --- a/source/blender/editors/include/ED_fluidsim.h +++ b/source/blender/editors/include/ED_fluidsim.h @@ -1,7 +1,7 @@ /** * BKE_fluidsim.h * - * $Id: LBM_fluidsim.h 17433 2008-11-12 21:16:53Z blendix $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h index 81420ac95e5..e104bce90f6 100644 --- a/source/blender/editors/include/ED_keyframes_draw.h +++ b/source/blender/editors/include/ED_keyframes_draw.h @@ -1,5 +1,5 @@ /** - * $Id: BDR_drawaction.h 17579 2008-11-26 11:01:56Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index fbb469f8d43..a15a258d45a 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -1,5 +1,5 @@ /** - * $Id: BIF_keyframing.h 17216 2008-10-29 11:20:02Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h index 0e5d7302837..43cb5053f48 100644 --- a/source/blender/editors/include/ED_particle.h +++ b/source/blender/editors/include/ED_particle.h @@ -1,5 +1,5 @@ /* - * $Id: ED_editparticle.h $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_pointcache.h b/source/blender/editors/include/ED_pointcache.h index 7bf51d9d53d..dc50e274fa9 100644 --- a/source/blender/editors/include/ED_pointcache.h +++ b/source/blender/editors/include/ED_pointcache.h @@ -1,5 +1,5 @@ /* - * $Id: ED_editparticle.h $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index 7168e593a8a..1ae3634c73b 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -1,5 +1,5 @@ /** - * $Id: UI_resources.h 13057 2007-12-30 12:08:28Z aligorith $ + * $Id$ * * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** * diff --git a/source/blender/editors/interface/Makefile b/source/blender/editors/interface/Makefile index dfc8187de49..a3d0692f1e1 100644 --- a/source/blender/editors/interface/Makefile +++ b/source/blender/editors/interface/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 8278e7f6b36..780d999cfbe 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1,5 +1,5 @@ /** - * $Id: interface.c 16882 2008-10-02 12:29:45Z ton $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 6d6d4ab9299..8400fee0c55 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1,5 +1,5 @@ /** - * $Id: interface_draw.c 15733 2008-07-24 09:23:13Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 3aed2a7c299..19a87c40d9c 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -1,5 +1,5 @@ /** - * $Id: interface.h 14444 2008-04-16 22:40:48Z hos $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 0a65718b708..f83dee23417 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1,5 +1,5 @@ /** - * $Id: resources.c 12755 2007-12-02 05:50:38Z aligorith $ + * $Id$ * * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** * diff --git a/source/blender/editors/mesh/Makefile b/source/blender/editors/mesh/Makefile index 650771519cd..8ae40e1b957 100644 --- a/source/blender/editors/mesh/Makefile +++ b/source/blender/editors/mesh/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/object/Makefile b/source/blender/editors/object/Makefile index c0312023bfd..70ada46c80f 100644 --- a/source/blender/editors/object/Makefile +++ b/source/blender/editors/object/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/physics/Makefile b/source/blender/editors/physics/Makefile index a71ea9e2083..63968fdd537 100644 --- a/source/blender/editors/physics/Makefile +++ b/source/blender/editors/physics/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/preview/Makefile b/source/blender/editors/preview/Makefile index c44da6753f3..48e1dc64673 100644 --- a/source/blender/editors/preview/Makefile +++ b/source/blender/editors/preview/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/screen/Makefile b/source/blender/editors/screen/Makefile index cf6e692c304..923a020afcf 100644 --- a/source/blender/editors/screen/Makefile +++ b/source/blender/editors/screen/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index a81a52fd544..a23487effa1 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -1,5 +1,5 @@ /** - * $Id: glutil.c 11920 2007-09-02 17:25:03Z elubie $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/sculpt_paint/Makefile b/source/blender/editors/sculpt_paint/Makefile index 9353116a4bc..012a39b8d25 100644 --- a/source/blender/editors/sculpt_paint/Makefile +++ b/source/blender/editors/sculpt_paint/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index ac86e2ed962..f40880b901f 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1,5 +1,5 @@ /* - * $Id: sculptmode.c 18309 2009-01-04 07:47:11Z nicholasbishop $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index 112da5b4f0f..febca301939 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -1,5 +1,5 @@ /* - * $Id: BDR_sculptmode.h 13396 2008-01-25 04:17:38Z nicholasbishop $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_action/Makefile b/source/blender/editors/space_action/Makefile index 840f31b8a40..e856587acca 100644 --- a/source/blender/editors/space_action/Makefile +++ b/source/blender/editors/space_action/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 6eae581aa40..2c9f91e0941 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -1,5 +1,5 @@ /** - * $Id: drawaction.c 17746 2008-12-08 11:19:44Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index a0f1adbd97e..5d262cb03c5 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -1,5 +1,5 @@ /** - * $Id: editaction.c 17746 2008-12-08 11:19:44Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index b82e44f3aa3..06f35f5cf05 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -1,5 +1,5 @@ /** - * $Id: editaction.c 17746 2008-12-08 11:19:44Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_api/Makefile b/source/blender/editors/space_api/Makefile index 46f926afbc9..474fbe89053 100644 --- a/source/blender/editors/space_api/Makefile +++ b/source/blender/editors/space_api/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_buttons/Makefile b/source/blender/editors/space_buttons/Makefile index b96d1cc5495..a4894ede06b 100644 --- a/source/blender/editors/space_buttons/Makefile +++ b/source/blender/editors/space_buttons/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_file/Makefile b/source/blender/editors/space_file/Makefile index 8f48217473c..2f4180448e5 100644 --- a/source/blender/editors/space_file/Makefile +++ b/source/blender/editors/space_file/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_graph/Makefile b/source/blender/editors/space_graph/Makefile index 340495ecc79..e04a354fb1d 100644 --- a/source/blender/editors/space_graph/Makefile +++ b/source/blender/editors/space_graph/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index acf712d0147..ddf4105fdf4 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -1,5 +1,5 @@ /** - * $Id: drawipo.c 17512 2008-11-20 05:55:42Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 49397ed0edd..b624d02a633 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1,5 +1,5 @@ /** - * $Id: editaction.c 17746 2008-12-08 11:19:44Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 9aaef9fca8a..7746f49d135 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -1,5 +1,5 @@ /** - * $Id: editaction.c 17746 2008-12-08 11:19:44Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_image/Makefile b/source/blender/editors/space_image/Makefile index 44d841a0606..e7e9a9b5665 100644 --- a/source/blender/editors/space_image/Makefile +++ b/source/blender/editors/space_image/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_info/Makefile b/source/blender/editors/space_info/Makefile index bc04ddc7824..931c2f2097c 100644 --- a/source/blender/editors/space_info/Makefile +++ b/source/blender/editors/space_info/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_logic/Makefile b/source/blender/editors/space_logic/Makefile index e07a5bbf4a9..d5709993368 100644 --- a/source/blender/editors/space_logic/Makefile +++ b/source/blender/editors/space_logic/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_logic/logic_buttons.c b/source/blender/editors/space_logic/logic_buttons.c index 240ddfc2614..b082d5d6ae2 100644 --- a/source/blender/editors/space_logic/logic_buttons.c +++ b/source/blender/editors/space_logic/logic_buttons.c @@ -1,5 +1,5 @@ /** - * $Id: image_buttons.c 20913 2009-06-16 01:22:56Z blendix $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_nla/Makefile b/source/blender/editors/space_nla/Makefile index 43f010e6adc..d7c9477dc83 100644 --- a/source/blender/editors/space_nla/Makefile +++ b/source/blender/editors/space_nla/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_node/Makefile b/source/blender/editors/space_node/Makefile index 60f81255a74..5bd6e95e28c 100644 --- a/source/blender/editors/space_node/Makefile +++ b/source/blender/editors/space_node/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 0670dd9e01f..f2e2486075b 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -1,5 +1,5 @@ /** - * $Id: drawnode.c 17439 2008-11-13 09:57:11Z kakbarnf $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_outliner/Makefile b/source/blender/editors/space_outliner/Makefile index 19d40a4a31e..8d7cd017e0b 100644 --- a/source/blender/editors/space_outliner/Makefile +++ b/source/blender/editors/space_outliner/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_script/Makefile b/source/blender/editors/space_script/Makefile index 48e1cd8e861..3322cb61a7f 100644 --- a/source/blender/editors/space_script/Makefile +++ b/source/blender/editors/space_script/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_sequencer/Makefile b/source/blender/editors/space_sequencer/Makefile index 80699db4baa..7be0bc9cfef 100644 --- a/source/blender/editors/space_sequencer/Makefile +++ b/source/blender/editors/space_sequencer/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_sequencer/sequencer_buttons.c b/source/blender/editors/space_sequencer/sequencer_buttons.c index f127ab4b0cf..cc4f5cf5ce3 100644 --- a/source/blender/editors/space_sequencer/sequencer_buttons.c +++ b/source/blender/editors/space_sequencer/sequencer_buttons.c @@ -1,5 +1,5 @@ /** - * $Id: sequencer_buttons.c 20279 2009-05-19 17:13:33Z blendix $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_sound/Makefile b/source/blender/editors/space_sound/Makefile index 4d375282223..a072684d543 100644 --- a/source/blender/editors/space_sound/Makefile +++ b/source/blender/editors/space_sound/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_text/Makefile b/source/blender/editors/space_text/Makefile index 33e12dc1abb..50871017085 100644 --- a/source/blender/editors/space_text/Makefile +++ b/source/blender/editors/space_text/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_time/Makefile b/source/blender/editors/space_time/Makefile index 20877b48559..e0bf3943dd8 100644 --- a/source/blender/editors/space_time/Makefile +++ b/source/blender/editors/space_time/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/space_view3d/Makefile b/source/blender/editors/space_view3d/Makefile index dd4eab89411..5e6f8a6c426 100644 --- a/source/blender/editors/space_view3d/Makefile +++ b/source/blender/editors/space_view3d/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/transform/Makefile b/source/blender/editors/transform/Makefile index bc3e08a2ae8..607038b413b 100644 --- a/source/blender/editors/transform/Makefile +++ b/source/blender/editors/transform/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 76b3f58f75c..631eb1eb134 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -1,5 +1,5 @@ /** - * $Id: transform_input.c 18142 2008-12-29 07:19:16Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index e697b6dfa7d..9e4115f38f0 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -1,5 +1,5 @@ /** - * $Id: transform_ops.c 17542 2008-11-23 15:27:53Z theeth $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/util/Makefile b/source/blender/editors/util/Makefile index da701dc5d86..303079daeee 100644 --- a/source/blender/editors/util/Makefile +++ b/source/blender/editors/util/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/editors/uvedit/Makefile b/source/blender/editors/uvedit/Makefile index b8a8f0bc8af..d589bbec3bc 100644 --- a/source/blender/editors/uvedit/Makefile +++ b/source/blender/editors/uvedit/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14 2002-10-13 15:57:19Z hans $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/makesrna/intern/Makefile b/source/blender/makesrna/intern/Makefile index 03f75f0bea6..1694e55ed4c 100644 --- a/source/blender/makesrna/intern/Makefile +++ b/source/blender/makesrna/intern/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 13161 2008-01-07 19:13:47Z hos $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index b97dd95c4d4..71e424bbd69 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -1,5 +1,5 @@ /** - * $Id: rna_key.c 19382 2009-03-23 13:24:48Z blendix $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index 3af448b0233..f67267ce0d0 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -1,5 +1,5 @@ /** - * $Id: rna_lattice.c 19382 2009-03-23 13:24:48Z blendix $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/makesrna/intern/rna_packedfile.c b/source/blender/makesrna/intern/rna_packedfile.c index 6b6db71ef87..6b9a708f555 100644 --- a/source/blender/makesrna/intern/rna_packedfile.c +++ b/source/blender/makesrna/intern/rna_packedfile.c @@ -1,5 +1,5 @@ /** - * $Id: rna_packedfile.c 19382 2009-03-23 13:24:48Z blendix $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h index 7658ca5d359..d141a585378 100644 --- a/source/blender/python/BPY_extern.h +++ b/source/blender/python/BPY_extern.h @@ -1,5 +1,5 @@ /* - * $Id: BPY_extern.h 12334 2007-10-21 23:00:29Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/Makefile b/source/blender/python/Makefile index 0c4b9ab6578..8e2a04b8449 100644 --- a/source/blender/python/Makefile +++ b/source/blender/python/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 14444 2008-04-16 22:40:48Z hos $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/python/generic/BGL.c b/source/blender/python/generic/BGL.c index f1a72270ea1..360fcbd1c6b 100644 --- a/source/blender/python/generic/BGL.c +++ b/source/blender/python/generic/BGL.c @@ -1,5 +1,5 @@ /* - * $Id: BGL.c 20922 2009-06-16 07:16:51Z campbellbarton $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/generic/BGL.h b/source/blender/python/generic/BGL.h index e2d1b0bb495..938c916bcea 100755 --- a/source/blender/python/generic/BGL.h +++ b/source/blender/python/generic/BGL.h @@ -1,5 +1,5 @@ /* - * $Id: BGL.h 19717 2009-04-14 17:19:09Z campbellbarton $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/generic/Geometry.c b/source/blender/python/generic/Geometry.c index edc19523da3..f1662d7655d 100644 --- a/source/blender/python/generic/Geometry.c +++ b/source/blender/python/generic/Geometry.c @@ -1,5 +1,5 @@ /* - * $Id: Geometry.c 20922 2009-06-16 07:16:51Z campbellbarton $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/generic/Geometry.h b/source/blender/python/generic/Geometry.h index d7292e31fac..ebfb054c54a 100644 --- a/source/blender/python/generic/Geometry.h +++ b/source/blender/python/generic/Geometry.h @@ -1,5 +1,5 @@ /* - * $Id: Geometry.h 20007 2009-04-30 12:45:13Z campbellbarton $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/generic/Makefile b/source/blender/python/generic/Makefile index 20cf7f19ec7..0dbfbd1d102 100644 --- a/source/blender/python/generic/Makefile +++ b/source/blender/python/generic/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 11904 2007-08-31 16:16:33Z sirdude $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/python/generic/Mathutils.c b/source/blender/python/generic/Mathutils.c index d5af54ce68e..fa85d031afc 100644 --- a/source/blender/python/generic/Mathutils.c +++ b/source/blender/python/generic/Mathutils.c @@ -1,5 +1,5 @@ /* - * $Id: Mathutils.c 20922 2009-06-16 07:16:51Z campbellbarton $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/generic/Mathutils.h b/source/blender/python/generic/Mathutils.h index 07cf029b77c..6c769c7729b 100644 --- a/source/blender/python/generic/Mathutils.h +++ b/source/blender/python/generic/Mathutils.h @@ -1,5 +1,5 @@ /* - * $Id: Mathutils.h 20332 2009-05-22 03:22:56Z campbellbarton $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index 6789aea9c10..c41ea386c0e 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -1,5 +1,5 @@ /* - * $Id: bpy_internal_import.c 20434 2009-05-26 18:06:09Z campbellbarton $ + * $Id$ * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/python/generic/bpy_internal_import.h b/source/blender/python/generic/bpy_internal_import.h index 475ec8dd118..aeeafb7c1c4 100644 --- a/source/blender/python/generic/bpy_internal_import.h +++ b/source/blender/python/generic/bpy_internal_import.h @@ -1,5 +1,5 @@ /* - * $Id: bpy_internal_import.h 20434 2009-05-26 18:06:09Z campbellbarton $ + * $Id$ * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/python/generic/euler.c b/source/blender/python/generic/euler.c index a65feb7e949..e78a5739347 100644 --- a/source/blender/python/generic/euler.c +++ b/source/blender/python/generic/euler.c @@ -1,5 +1,5 @@ /* - * $Id: euler.c 20248 2009-05-18 04:11:54Z campbellbarton $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/generic/euler.h b/source/blender/python/generic/euler.h index 3206668ffa0..3be629351cb 100644 --- a/source/blender/python/generic/euler.h +++ b/source/blender/python/generic/euler.h @@ -1,5 +1,5 @@ /* - * $Id: euler.h 20248 2009-05-18 04:11:54Z campbellbarton $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c index e8e8bffd419..c1e36cf7c56 100644 --- a/source/blender/python/generic/matrix.c +++ b/source/blender/python/generic/matrix.c @@ -1,5 +1,5 @@ /* - * $Id: matrix.c 20249 2009-05-18 04:27:48Z campbellbarton $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/generic/matrix.h b/source/blender/python/generic/matrix.h index ef82263fe00..2604d58d0d1 100644 --- a/source/blender/python/generic/matrix.h +++ b/source/blender/python/generic/matrix.h @@ -1,5 +1,5 @@ /* - * $Id: matrix.h 20248 2009-05-18 04:11:54Z campbellbarton $ + * $Id$ * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c index 4ee984673e8..b9ccb478ddd 100644 --- a/source/blender/python/generic/quat.c +++ b/source/blender/python/generic/quat.c @@ -1,5 +1,5 @@ /* - * $Id: quat.c 20332 2009-05-22 03:22:56Z campbellbarton $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/generic/quat.h b/source/blender/python/generic/quat.h index cfb50e4dbe1..ebbac26e39c 100644 --- a/source/blender/python/generic/quat.h +++ b/source/blender/python/generic/quat.h @@ -1,5 +1,5 @@ /* - * $Id: quat.h 20332 2009-05-22 03:22:56Z campbellbarton $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index ce11149e311..b01a51f442a 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -1,5 +1,5 @@ /* - * $Id: vector.c 20332 2009-05-22 03:22:56Z campbellbarton $ + * $Id$ * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/python/generic/vector.h b/source/blender/python/generic/vector.h index 12e035f55fa..c00be8d71b7 100644 --- a/source/blender/python/generic/vector.h +++ b/source/blender/python/generic/vector.h @@ -1,4 +1,4 @@ -/* $Id: vector.h 20332 2009-05-22 03:22:56Z campbellbarton $ +/* $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/python/intern/Makefile b/source/blender/python/intern/Makefile index 0c4a540a4bd..d210cfaf973 100644 --- a/source/blender/python/intern/Makefile +++ b/source/blender/python/intern/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 11904 2007-08-31 16:16:33Z sirdude $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/windowmanager/intern/Makefile b/source/blender/windowmanager/intern/Makefile index 80ae58f9398..8f0f47c52d0 100644 --- a/source/blender/windowmanager/intern/Makefile +++ b/source/blender/windowmanager/intern/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile 11904 2007-08-31 16:16:33Z sirdude $ +# $Id$ # # ***** BEGIN GPL LICENSE BLOCK ***** # diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c index 9bd55e1c5a7..835fdca52fe 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.c +++ b/source/blender/windowmanager/intern/wm_subwindow.c @@ -1,5 +1,5 @@ /** - * $Id: mywindow.c 9584 2007-01-03 13:45:03Z ton $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/windowmanager/wm_cursors.h b/source/blender/windowmanager/wm_cursors.h index 1a1a0d0b71d..3d1b49983ed 100644 --- a/source/blender/windowmanager/wm_cursors.h +++ b/source/blender/windowmanager/wm_cursors.h @@ -1,5 +1,5 @@ /** - * $Id: BIF_cursors.h 7739 2006-06-15 14:22:59Z broken $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * -- cgit v1.2.3 From 272fac8fd6e8c64472c856b85994f841678f172c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 23 Jun 2009 00:19:10 +0000 Subject: UI: some API functions don't require explicit context passing anymore. --- source/blender/makesrna/intern/rna_ui_api.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index d06d4d4406d..c1c2f9a100a 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -189,8 +189,7 @@ void RNA_api_ui_layout(StructRNA *srna) api_ui_item_common(func); func= RNA_def_function(srna, "itemM", "uiItemM"); - parm= RNA_def_pointer(func, "context", "Context", "", "Current context."); - RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); api_ui_item_common(func); parm= RNA_def_string(func, "menu", "", 0, "", "Identifier of the menu."); RNA_def_property_flag(parm, PROP_REQUIRED); @@ -206,12 +205,10 @@ void RNA_api_ui_layout(StructRNA *srna) /* templates */ func= RNA_def_function(srna, "template_header", "uiTemplateHeader"); - parm= RNA_def_pointer(func, "context", "Context", "", "Current context."); - RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); func= RNA_def_function(srna, "template_ID", "uiTemplateID"); - parm= RNA_def_pointer(func, "context", "Context", "", "Current context."); - RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); api_ui_item_rna_common(func); RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block."); RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a new ID block."); -- cgit v1.2.3 From e2b6cea3b95ca41854661726ccea684421738c8f Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 23 Jun 2009 00:41:55 +0000 Subject: 2.5: Tool Settings * Moved proportional edit, snap, autokey mode, and a few others from Scene to ToolSettings. * RNA wrapped properties in ToolSettings for the UV editor: proportional edit, snap settings, selection modes. --- source/blender/blenkernel/intern/scene.c | 7 +- source/blender/blenloader/intern/readfile.c | 89 +++++++-------- .../blender/editors/armature/editarmature_sketch.c | 105 ++++++++--------- source/blender/editors/include/ED_keyframing.h | 4 +- source/blender/editors/include/UI_icons.h | 2 +- source/blender/editors/mesh/editmesh.c | 2 +- source/blender/editors/mesh/editmesh_mods.c | 2 +- source/blender/editors/object/object_edit.c | 2 +- source/blender/editors/physics/editparticle.c | 32 +++--- source/blender/editors/space_image/image_header.c | 14 +-- source/blender/editors/space_time/time_header.c | 4 +- source/blender/editors/space_view3d/drawobject.c | 56 ++++++---- .../blender/editors/space_view3d/view3d_buttons.c | 2 +- .../blender/editors/space_view3d/view3d_header.c | 124 +++++++++++---------- .../blender/editors/space_view3d/view3d_select.c | 21 ++-- source/blender/editors/transform/transform.c | 14 +-- source/blender/editors/transform/transform.h | 1 + .../editors/transform/transform_conversions.c | 10 +- .../blender/editors/transform/transform_generics.c | 12 +- source/blender/editors/transform/transform_snap.c | 19 ++-- source/blender/editors/uvedit/uvedit_draw.c | 22 ++-- source/blender/editors/uvedit/uvedit_ops.c | 112 ++++++++++++------- source/blender/makesdna/DNA_scene_types.h | 61 +++++----- source/blender/makesdna/DNA_space_types.h | 2 +- source/blender/makesrna/intern/rna_scene.c | 98 +++++++++++++--- source/blender/makesrna/intern/rna_wm.c | 2 +- 26 files changed, 470 insertions(+), 349 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 3b51af57e0b..23da5c66850 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -203,9 +203,6 @@ Scene *add_scene(char *name) sce= alloc_libblock(&G.main->scene, ID_SCE, name); sce->lay= 1; - sce->selectmode= SCE_SELECT_VERTEX; - sce->editbutsize= 0.1; - sce->autokey_mode= U.autokey_mode; sce->r.mode= R_GAMMA; sce->r.cfra= 1; @@ -275,6 +272,10 @@ Scene *add_scene(char *name) sce->toolsettings->select_thresh= 0.01f; sce->toolsettings->jointrilimit = 0.8f; + sce->toolsettings->selectmode= SCE_SELECT_VERTEX; + sce->toolsettings->normalsize= 0.1; + sce->toolsettings->autokey_mode= U.autokey_mode; + sce->toolsettings->skgen_resolution = 100; sce->toolsettings->skgen_threshold_internal = 0.01f; sce->toolsettings->skgen_threshold_external = 0.01f; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 48aa3f6a3b7..54caad7f35b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7102,22 +7102,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if(main->versionfile <= 234) { - Scene *sce; World *wo; bScreen *sc; - int set_zbuf_sel=0; // force sumo engine to be active for (wo = main->world.first; wo; wo= wo->id.next) { if(wo->physicsEngine==0) wo->physicsEngine = 2; } - for (sce= main->scene.first; sce; sce= sce->id.next) { - if(sce->selectmode==0) { - sce->selectmode= SCE_SELECT_VERTEX; - set_zbuf_sel= 1; - } - } for (sc= main->screen.first; sc; sc= sc->id.next) { ScrArea *sa; for (sa= sc->areabase.first; sa; sa= sa->next) { @@ -7125,7 +7117,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for (sl= sa->spacedata.first; sl; sl= sl->next) { if(sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D *)sl; - if(set_zbuf_sel) v3d->flag |= V3D_ZBUF_SELECT; + v3d->flag |= V3D_ZBUF_SELECT; } else if(sl->spacetype==SPACE_TEXT) { SpaceText *st= (SpaceText *)sl; @@ -7160,16 +7152,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } if(main->versionfile <= 236) { Object *ob; - Scene *sce= main->scene.first; Camera *cam= main->camera.first; Material *ma; bScreen *sc; - while(sce) { - if(sce->editbutsize==0.0) sce->editbutsize= 0.1f; - - sce= sce->id.next; - } while(cam) { if(cam->ortho_scale==0.0) { cam->ortho_scale= 256.0f/cam->lens; @@ -8795,15 +8781,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } } - /* autokey mode settings now used from scene, but need to be initialised off userprefs */ - if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 8)) { - Scene *sce; - - for (sce= main->scene.first; sce; sce= sce->id.next) { - if (sce->autokey_mode == 0) - sce->autokey_mode= U.autokey_mode; - } - } if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 9)) { Lamp *la= main->lamp.first; @@ -8996,6 +8973,34 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } + if (main->versionfile < 249 && main->subversionfile < 2) { + Scene *sce= main->scene.first; + Sequence *seq; + Editing *ed; + + while(sce) { + ed= sce->ed; + if(ed) { + SEQP_BEGIN(ed, seq) { + if (seq->strip && seq->strip->proxy){ + if (sce->r.size != 100.0) { + seq->strip->proxy->size + = sce->r.size; + } else { + seq->strip->proxy->size + = 25.0; + } + seq->strip->proxy->quality =90; + } + } + SEQ_END + } + + sce= sce->id.next; + } + + } + if (main->versionfile < 250) { bScreen *screen; Scene *scene; @@ -9081,6 +9086,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) { Object *ob; Material *ma; + Scene *sce; + ToolSettings *ts; int i; for(ob = main->object.first; ob; ob = ob->id.next) { @@ -9153,37 +9160,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ma->mode &= ~MA_HALO; } } - } - - if (main->versionfile < 249 && main->subversionfile < 2) { - Scene *sce= main->scene.first; - Sequence *seq; - Editing *ed; - - while(sce) { - ed= sce->ed; - if(ed) { - SEQP_BEGIN(ed, seq) { - if (seq->strip && seq->strip->proxy){ - if (sce->r.size != 100.0) { - seq->strip->proxy->size - = sce->r.size; - } else { - seq->strip->proxy->size - = 25.0; - } - seq->strip->proxy->quality =90; - } - } - SEQ_END + + for(sce = main->scene.first; sce; sce = sce->id.next) { + ts= sce->toolsettings; + if(ts->normalsize == 0.0) { + ts->normalsize= 0.1f; + ts->selectmode= SCE_SELECT_VERTEX; + ts->autokey_mode= U.autokey_mode; } - - sce= sce->id.next; } - } - /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index f010abdb7e7..fb030b91ce1 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -243,6 +243,7 @@ void BIF_makeListTemplates(bContext *C) { Object *obedit = CTX_data_edit_object(C); Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); Base *base; int index = 0; @@ -263,7 +264,7 @@ void BIF_makeListTemplates(bContext *C) index++; BLI_ghash_insert(TEMPLATES_HASH, SET_INT_IN_POINTER(index), ob); - if (ob == scene->toolsettings->skgen_template) + if (ob == ts->skgen_template) { TEMPLATES_CURRENT = index; } @@ -305,8 +306,9 @@ char *BIF_listTemplates(bContext *C) int BIF_currentTemplate(bContext *C) { - Scene *scene = CTX_data_scene(C); - if (TEMPLATES_CURRENT == 0 && scene->toolsettings->skgen_template != NULL) + ToolSettings *ts = CTX_data_tool_settings(C); + + if (TEMPLATES_CURRENT == 0 && ts->skgen_template != NULL) { GHashIterator ghi; BLI_ghashIterator_init(&ghi, TEMPLATES_HASH); @@ -316,7 +318,7 @@ int BIF_currentTemplate(bContext *C) Object *ob = BLI_ghashIterator_getValue(&ghi); int key = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&ghi)); - if (ob == scene->toolsettings->skgen_template) + if (ob == ts->skgen_template) { TEMPLATES_CURRENT = key; break; @@ -360,8 +362,8 @@ RigGraph* sk_makeTemplateGraph(bContext *C, Object *ob) int BIF_nbJointsTemplate(bContext *C) { - Scene *scene = CTX_data_scene(C); - RigGraph *rg = sk_makeTemplateGraph(C, scene->toolsettings->skgen_template); + ToolSettings *ts = CTX_data_tool_settings(C); + RigGraph *rg = sk_makeTemplateGraph(C, ts->skgen_template); if (rg) { @@ -375,7 +377,7 @@ int BIF_nbJointsTemplate(bContext *C) char * BIF_nameBoneTemplate(bContext *C) { - Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); SK_Sketch *stk = GLOBAL_sketch; RigGraph *rg; int index = 0; @@ -385,7 +387,7 @@ char * BIF_nameBoneTemplate(bContext *C) index = stk->active_stroke->nb_points; } - rg = sk_makeTemplateGraph(C, scene->toolsettings->skgen_template); + rg = sk_makeTemplateGraph(C, ts->skgen_template); if (rg == NULL) { @@ -418,14 +420,14 @@ void BIF_freeTemplates(bContext *C) void BIF_setTemplate(bContext *C, int index) { - Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); if (index > 0) { - scene->toolsettings->skgen_template = BLI_ghash_lookup(TEMPLATES_HASH, SET_INT_IN_POINTER(index)); + ts->skgen_template = BLI_ghash_lookup(TEMPLATES_HASH, SET_INT_IN_POINTER(index)); } else { - scene->toolsettings->skgen_template = NULL; + ts->skgen_template = NULL; if (TEMPLATE_RIGG != NULL) { @@ -439,19 +441,19 @@ void BIF_setTemplate(bContext *C, int index) void sk_autoname(bContext *C, ReebArc *arc) { - Scene *scene = CTX_data_scene(C); - if (scene->toolsettings->skgen_retarget_options & SK_RETARGET_AUTONAME) + ToolSettings *ts = CTX_data_tool_settings(C); + if (ts->skgen_retarget_options & SK_RETARGET_AUTONAME) { if (arc == NULL) { - char *num = scene->toolsettings->skgen_num_string; + char *num = ts->skgen_num_string; int i = atoi(num); i++; BLI_snprintf(num, 8, "%i", i); } else { - char *side = scene->toolsettings->skgen_side_string; + char *side = ts->skgen_side_string; int valid = 0; int caps = 0; @@ -525,7 +527,7 @@ ReebArc *sk_strokeToArc(SK_Stroke *stk, float imat[][4], float tmat[][3]) void sk_retargetStroke(bContext *C, SK_Stroke *stk) { - Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); Object *obedit = CTX_data_edit_object(C); float imat[4][4]; float tmat[3][3]; @@ -541,7 +543,7 @@ void sk_retargetStroke(bContext *C, SK_Stroke *stk) sk_autoname(C, arc); - rg = sk_makeTemplateGraph(C, scene->toolsettings->skgen_template); + rg = sk_makeTemplateGraph(C, ts->skgen_template); BIF_retargetArc(C, arc, rg); @@ -1408,10 +1410,10 @@ void sk_startStroke(SK_Sketch *sketch) void sk_endStroke(bContext *C, SK_Sketch *sketch) { - Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); sk_shrinkStrokeBuffer(sketch->active_stroke); - if (scene->toolsettings->bone_sketching & BONE_SKETCHING_ADJUST) + if (ts->bone_sketching & BONE_SKETCHING_ADJUST) { sk_endOverdraw(sketch); } @@ -1521,10 +1523,10 @@ int sk_addStrokeDrawPoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_Dra int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd) { - Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); int point_added = 0; - if (scene->snap_mode == SCE_SNAP_MODE_VOLUME) + if (ts->snap_mode == SCE_SNAP_MODE_VOLUME) { ListBase depth_peels; DepthPeel *p1, *p2; @@ -1557,7 +1559,7 @@ int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Strok p1->flag = 1; /* if peeling objects, take the first and last from each object */ - if (scene->snap_flag & SCE_SNAP_PEEL_OBJECT) + if (ts->snap_flag & SCE_SNAP_PEEL_OBJECT) { DepthPeel *peel; for (peel = p1->next; peel; peel = peel->next) @@ -1627,7 +1629,7 @@ int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Strok int dist = SNAP_MIN_DISTANCE; // Use a user defined value here /* snap to strokes */ - // if (scene->snap_mode == SCE_SNAP_MODE_VERTEX) /* snap all the time to strokes */ + // if (ts->snap_mode == SCE_SNAP_MODE_VERTEX) /* snap all the time to strokes */ for (snap_stk = sketch->strokes.first; snap_stk; snap_stk = snap_stk->next) { SK_Point *spt = NULL; @@ -1713,7 +1715,7 @@ int sk_addStrokeSnapPoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_Dra void sk_addStrokePoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd, short snap) { - Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); int point_added = 0; if (snap) @@ -1726,7 +1728,7 @@ void sk_addStrokePoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawDa point_added = sk_addStrokeDrawPoint(C, sketch, stk, dd); } - if (stk == sketch->active_stroke && scene->toolsettings->bone_sketching & BONE_SKETCHING_ADJUST) + if (stk == sketch->active_stroke && ts->bone_sketching & BONE_SKETCHING_ADJUST) { sk_updateOverdraw(C, sketch, stk, dd); } @@ -1951,7 +1953,7 @@ static int iteratorStopped(void *arg) void sk_convertStroke(bContext *C, SK_Stroke *stk) { Object *obedit = CTX_data_edit_object(C); - Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); bArmature *arm = obedit->data; SK_Point *head; EditBone *parent = NULL; @@ -1990,17 +1992,17 @@ void sk_convertStroke(bContext *C, SK_Stroke *stk) initStrokeIterator(iter, stk, head_index, i); - if (scene->toolsettings->bone_sketching_convert == SK_CONVERT_CUT_ADAPTATIVE) + if (ts->bone_sketching_convert == SK_CONVERT_CUT_ADAPTATIVE) { - bone = subdivideArcBy(scene->toolsettings, arm, arm->edbo, iter, invmat, tmat, nextAdaptativeSubdivision); + bone = subdivideArcBy(ts, arm, arm->edbo, iter, invmat, tmat, nextAdaptativeSubdivision); } - else if (scene->toolsettings->bone_sketching_convert == SK_CONVERT_CUT_LENGTH) + else if (ts->bone_sketching_convert == SK_CONVERT_CUT_LENGTH) { - bone = subdivideArcBy(scene->toolsettings, arm, arm->edbo, iter, invmat, tmat, nextLengthSubdivision); + bone = subdivideArcBy(ts, arm, arm->edbo, iter, invmat, tmat, nextLengthSubdivision); } - else if (scene->toolsettings->bone_sketching_convert == SK_CONVERT_CUT_FIXED) + else if (ts->bone_sketching_convert == SK_CONVERT_CUT_FIXED) { - bone = subdivideArcBy(scene->toolsettings, arm, arm->edbo, iter, invmat, tmat, nextFixedSubdivision); + bone = subdivideArcBy(ts, arm, arm->edbo, iter, invmat, tmat, nextFixedSubdivision); } } @@ -2042,14 +2044,14 @@ void sk_convertStroke(bContext *C, SK_Stroke *stk) void sk_convert(bContext *C, SK_Sketch *sketch) { - Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); SK_Stroke *stk; for (stk = sketch->strokes.first; stk; stk = stk->next) { if (stk->selected == 1) { - if (scene->toolsettings->bone_sketching_convert == SK_CONVERT_RETARGET) + if (ts->bone_sketching_convert == SK_CONVERT_RETARGET) { sk_retargetStroke(C, stk); } @@ -2693,7 +2695,7 @@ void sk_selectStroke(bContext *C, SK_Sketch *sketch, short mval[2], int extend) rect.ymin= mval[1]-5; rect.ymax= mval[1]+5; - hits= view3d_opengl_select(&vc, buffer, MAXPICKBUF, &rect); + hits = view3d_opengl_select(&vc, buffer, MAXPICKBUF, &rect); if (hits>0) { @@ -2743,6 +2745,7 @@ void sk_queueRedrawSketch(SK_Sketch *sketch) void sk_drawSketch(Scene *scene, SK_Sketch *sketch, int with_names) { + ToolSettings *ts= scene->toolsettings; SK_Stroke *stk; glDisable(GL_DEPTH_TEST); @@ -2779,7 +2782,7 @@ void sk_drawSketch(Scene *scene, SK_Sketch *sketch, int with_names) if (stk->selected == 1) { - sk_drawStrokeSubdivision(scene->toolsettings, stk); + sk_drawStrokeSubdivision(ts, stk); } } @@ -2794,9 +2797,9 @@ void sk_drawSketch(Scene *scene, SK_Sketch *sketch, int with_names) { SK_Point *last = sk_lastStrokePoint(sketch->active_stroke); - if (scene->toolsettings->bone_sketching & BONE_SKETCHING_QUICK) + if (ts->bone_sketching & BONE_SKETCHING_QUICK) { - sk_drawStrokeSubdivision(scene->toolsettings, sketch->active_stroke); + sk_drawStrokeSubdivision(ts, sketch->active_stroke); } if (last != NULL) @@ -2839,7 +2842,7 @@ void sk_drawSketch(Scene *scene, SK_Sketch *sketch, int with_names) int sk_finish_stroke(bContext *C, SK_Sketch *sketch) { - Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); if (sketch->active_stroke != NULL) { @@ -2847,9 +2850,9 @@ int sk_finish_stroke(bContext *C, SK_Sketch *sketch) sk_endStroke(C, sketch); - if (scene->toolsettings->bone_sketching & BONE_SKETCHING_QUICK) + if (ts->bone_sketching & BONE_SKETCHING_QUICK) { - if (scene->toolsettings->bone_sketching_convert == SK_CONVERT_RETARGET) + if (ts->bone_sketching_convert == SK_CONVERT_RETARGET) { sk_retargetStroke(C, stk); } @@ -3196,11 +3199,11 @@ static int sketch_draw_preview(bContext *C, wmOperator *op, wmEvent *event) int ED_operator_sketch_mode_active_stroke(bContext *C) { Object *obedit = CTX_data_edit_object(C); - Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); if (obedit && obedit->type == OB_ARMATURE && - scene->toolsettings->bone_sketching & BONE_SKETCHING && + ts->bone_sketching & BONE_SKETCHING && GLOBAL_sketch != NULL && GLOBAL_sketch->active_stroke != NULL) { @@ -3215,12 +3218,12 @@ int ED_operator_sketch_mode_active_stroke(bContext *C) int ED_operator_sketch_mode_gesture(bContext *C) { Object *obedit = CTX_data_edit_object(C); - Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); if (obedit && obedit->type == OB_ARMATURE && - scene->toolsettings->bone_sketching & BONE_SKETCHING && - (scene->toolsettings->bone_sketching & BONE_SKETCHING_QUICK) == 0 && + ts->bone_sketching & BONE_SKETCHING && + (ts->bone_sketching & BONE_SKETCHING_QUICK) == 0 && GLOBAL_sketch != NULL && GLOBAL_sketch->active_stroke == NULL) { @@ -3235,12 +3238,12 @@ int ED_operator_sketch_mode_gesture(bContext *C) int ED_operator_sketch_full_mode(bContext *C) { Object *obedit = CTX_data_edit_object(C); - Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); if (obedit && obedit->type == OB_ARMATURE && - scene->toolsettings->bone_sketching & BONE_SKETCHING && - (scene->toolsettings->bone_sketching & BONE_SKETCHING_QUICK) == 0) + ts->bone_sketching & BONE_SKETCHING && + (ts->bone_sketching & BONE_SKETCHING_QUICK) == 0) { return 1; } @@ -3253,11 +3256,11 @@ int ED_operator_sketch_full_mode(bContext *C) int ED_operator_sketch_mode(bContext *C) { Object *obedit = CTX_data_edit_object(C); - Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); if (obedit && obedit->type == OB_ARMATURE && - scene->toolsettings->bone_sketching & BONE_SKETCHING) + ts->bone_sketching & BONE_SKETCHING) { return 1; } diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index a15a258d45a..9d063910aa9 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -178,9 +178,9 @@ void ANIM_OT_remove_driver_button(struct wmOperatorType *ot); /* Auto-Keying macros for use by various tools */ /* check if auto-keyframing is enabled (per scene takes presidence) */ -#define IS_AUTOKEY_ON(scene) ((scene) ? (scene->autokey_mode & AUTOKEY_ON) : (U.autokey_mode & AUTOKEY_ON)) +#define IS_AUTOKEY_ON(scene) ((scene) ? (scene->toolsettings->autokey_mode & AUTOKEY_ON) : (U.autokey_mode & AUTOKEY_ON)) /* check the mode for auto-keyframing (per scene takes presidence) */ -#define IS_AUTOKEY_MODE(scene, mode) ((scene) ? (scene->autokey_mode == AUTOKEY_MODE_##mode) : (U.autokey_mode == AUTOKEY_MODE_##mode)) +#define IS_AUTOKEY_MODE(scene, mode) ((scene) ? (scene->toolsettings->autokey_mode == AUTOKEY_MODE_##mode) : (U.autokey_mode == AUTOKEY_MODE_##mode)) /* check if a flag is set for auto-keyframing (as userprefs only!) */ #define IS_AUTOKEY_FLAG(flag) (U.autokey_flag & AUTOKEY_FLAG_##flag) diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index a38dfd93c30..884020ae7dc 100644 --- a/source/blender/editors/include/UI_icons.h +++ b/source/blender/editors/include/UI_icons.h @@ -74,8 +74,8 @@ DEF_ICON(ICON_CHECKBOX_DEHLT) DEF_ICON(ICON_CHECKBOX_HLT) DEF_ICON(ICON_UNLOCKED) DEF_ICON(ICON_LOCKED) -DEF_ICON(ICON_PINNED) DEF_ICON(ICON_UNPINNED) +DEF_ICON(ICON_PINNED) DEF_ICON(ICON_BLANK015) DEF_ICON(ICON_RIGHTARROW) DEF_ICON(ICON_DOWNARROW_HLT) diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index dd003d103d5..c05751feddc 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -841,7 +841,7 @@ void make_editMesh(Scene *scene, Object *ob) em= me->edit_mesh; - em->selectmode= scene->selectmode; // warning needs to be synced + em->selectmode= scene->toolsettings->selectmode; // warning needs to be synced em->act_face = NULL; em->totvert= tot= me->totvert; em->totedge= me->totedge; diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index a1f8b3251c8..07ed6ae7a01 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -3531,7 +3531,7 @@ static void mesh_selection_type(Scene *scene, EditMesh *em, int val) /* note, em stores selectmode to be able to pass it on everywhere without scene, this is only until all select modes and toolsettings are settled more */ - scene->selectmode= em->selectmode; + scene->toolsettings->selectmode= em->selectmode; // if (EM_texFaceCheck()) } } diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 74a1fc12631..7a75e3875ea 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -3661,7 +3661,7 @@ void special_editmenu(Scene *scene, View3D *v3d) if(!psys) return; - if(scene->selectmode & SCE_SELECT_POINT) + if(pset->selectmode & SCE_SELECT_POINT) nr= pupmenu("Specials%t|Rekey%x1|Subdivide%x2|Select First%x3|Select Last%x4|Remove Doubles%x5"); else nr= pupmenu("Specials%t|Rekey%x1|Remove Doubles%x5"); diff --git a/source/blender/editors/physics/editparticle.c b/source/blender/editors/physics/editparticle.c index a9fc65bdc37..1b6b5b43522 100644 --- a/source/blender/editors/physics/editparticle.c +++ b/source/blender/editors/physics/editparticle.c @@ -225,7 +225,7 @@ void PE_hide_keys_time(Scene *scene, ParticleSystem *psys, float cfra) ParticleEditSettings *pset=PE_settings(scene); int i, k, totpart= psys->totpart; - if(pset->draw_timed && scene->selectmode==SCE_SELECT_POINT) { + if(pset->draw_timed && pset->selectmode==SCE_SELECT_POINT) { LOOP_PARTICLES(i, pa) { LOOP_KEYS(k, key) { if(fabs(cfra-*key->time) < pset->draw_timed) @@ -425,11 +425,12 @@ static void for_mouse_hit_keys(PEData *data, ForKeyFunc func, int nearest) ParticleEdit *edit= psys->edit; ParticleData *pa; ParticleEditKey *key; + ParticleEditSettings *pset= PE_settings(data->scene); int i, k, totpart, nearest_pa, nearest_key; float dist= data->rad; /* in path select mode we have no keys */ - if(data->scene->selectmode==SCE_SELECT_PATH) + if(pset->selectmode==SCE_SELECT_PATH) return; totpart= psys->totpart; @@ -439,7 +440,7 @@ static void for_mouse_hit_keys(PEData *data, ForKeyFunc func, int nearest) LOOP_PARTICLES(i, pa) { if(pa->flag & PARS_HIDE) continue; - if(data->scene->selectmode == SCE_SELECT_END) { + if(pset->selectmode == SCE_SELECT_END) { /* only do end keys */ key= edit->keys[i] + pa->totkey-1; @@ -481,18 +482,19 @@ static void foreach_mouse_hit_particle(PEData *data, ForParticleFunc func, int s ParticleSystem *psys= data->psys; ParticleData *pa; ParticleEditKey *key; + ParticleEditSettings *pset= PE_settings(data->scene); int i, k, totpart; totpart= psys->totpart; /* all is selected in path mode */ - if(data->scene->selectmode==SCE_SELECT_PATH) + if(pset->selectmode==SCE_SELECT_PATH) selected=0; LOOP_PARTICLES(i, pa) { if(pa->flag & PARS_HIDE) continue; - if(data->scene->selectmode==SCE_SELECT_END) { + if(pset->selectmode==SCE_SELECT_END) { /* only do end keys */ key= psys->edit->keys[i] + pa->totkey-1; @@ -522,6 +524,7 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected ParticleData *pa; ParticleEditKey *key; ParticleSystemModifierData *psmd=0; + ParticleEditSettings *pset= PE_settings(data->scene); int i, k, totpart; float mat[4][4], imat[4][4]; @@ -529,7 +532,7 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected totpart= psys->totpart; /* all is selected in path mode */ - if(data->scene->selectmode==SCE_SELECT_PATH) + if(pset->selectmode==SCE_SELECT_PATH) selected= 0; Mat4One(imat); @@ -541,7 +544,7 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected psys_mat_hair_to_global(data->ob, psmd->dm, psys->part->from, pa, mat); Mat4Invert(imat,mat); - if(data->scene->selectmode==SCE_SELECT_END) { + if(pset->selectmode==SCE_SELECT_END) { /* only do end keys */ key= psys->edit->keys[i] + pa->totkey-1; @@ -610,6 +613,7 @@ static int count_selected_keys(Scene *scene, ParticleSystem *psys) { ParticleData *pa; ParticleEditKey *key; + ParticleEditSettings *pset= PE_settings(scene); int i, k, totpart, sel= 0; totpart= psys->totpart; @@ -619,12 +623,12 @@ static int count_selected_keys(Scene *scene, ParticleSystem *psys) key= psys->edit->keys[i]; - if(scene->selectmode==SCE_SELECT_POINT) { + if(pset->selectmode==SCE_SELECT_POINT) { for(k=0; ktotkey; k++,key++) if(key->flag & PEK_SELECT) sel++; } - else if(scene->selectmode==SCE_SELECT_END) { + else if(pset->selectmode==SCE_SELECT_END) { key += pa->totkey-1; if(key->flag & PEK_SELECT) @@ -1454,6 +1458,7 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short select) ParticleEdit *edit; ParticleData *pa; ParticleEditKey *key; + ParticleEditSettings *pset= PE_settings(scene); float co[3], mat[4][4]; short vertco[2]; int i, k, totpart; @@ -1470,7 +1475,7 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short select) psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat); - if(scene->selectmode==SCE_SELECT_POINT) { + if(pset->selectmode==SCE_SELECT_POINT) { LOOP_KEYS(k, key) { VECCOPY(co, key->co); Mat4MulVecfl(mat, co); @@ -1487,7 +1492,7 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short select) } } } - else if(scene->selectmode==SCE_SELECT_END) { + else if(pset->selectmode==SCE_SELECT_END) { key= edit->keys[i] + pa->totkey - 1; VECCOPY(co, key->co); @@ -2349,7 +2354,7 @@ enum { DEL_PARTICLE, DEL_KEY }; static EnumPropertyItem delete_type_items[]= { {DEL_PARTICLE, "PARTICLE", 0, "Particle", ""}, {DEL_KEY, "KEY", 0, "Key", ""}, - {0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL}}; static void set_delete_particle(PEData *data, int pa_index) { @@ -3842,6 +3847,7 @@ void PE_change_act_psys(Scene *scene, Object *ob, ParticleSystem *psys) static int specials_menu_invoke(bContext *C, wmOperator *op, wmEvent *event) { Scene *scene= CTX_data_scene(C); + ParticleEditSettings *pset=PE_settings(scene); uiPopupMenu *pup; uiLayout *layout; @@ -3849,7 +3855,7 @@ static int specials_menu_invoke(bContext *C, wmOperator *op, wmEvent *event) layout= uiPupMenuLayout(pup); uiItemO(layout, NULL, 0, "PARTICLE_OT_rekey"); - if(scene->selectmode & SCE_SELECT_POINT) { + if(pset->selectmode & SCE_SELECT_POINT) { uiItemO(layout, NULL, 0, "PARTICLE_OT_subdivide"); uiItemO(layout, NULL, 0, "PARTICLE_OT_select_first"); uiItemO(layout, NULL, 0, "PARTICLE_OT_select_last"); diff --git a/source/blender/editors/space_image/image_header.c b/source/blender/editors/space_image/image_header.c index adf4772efde..9550c4c3a29 100644 --- a/source/blender/editors/space_image/image_header.c +++ b/source/blender/editors/space_image/image_header.c @@ -802,11 +802,11 @@ void image_header_buttons(const bContext *C, ARegion *ar) uiBlockBeginAlign(block); uiDefIconButBitS(block, TOG, SCE_SELECT_VERTEX, B_REDR, ICON_VERTEXSEL, - xco,yco,XIC,YIC, &scene->selectmode, 1.0, 0.0, 0, 0, "Vertex select mode"); + xco,yco,XIC,YIC, &scene->toolsettings->selectmode, 1.0, 0.0, 0, 0, "Vertex select mode"); uiDefIconButBitS(block, TOG, SCE_SELECT_EDGE, B_REDR, ICON_EDGESEL, - xco+=XIC,yco,XIC,YIC, &scene->selectmode, 1.0, 0.0, 0, 0, "Edge select mode"); + xco+=XIC,yco,XIC,YIC, &scene->toolsettings->selectmode, 1.0, 0.0, 0, 0, "Edge select mode"); uiDefIconButBitS(block, TOG, SCE_SELECT_FACE, B_REDR, ICON_FACESEL, - xco+=XIC,yco,XIC,YIC, &scene->selectmode, 1.0, 0.0, 0, 0, "Face select mode"); + xco+=XIC,yco,XIC,YIC, &scene->toolsettings->selectmode, 1.0, 0.0, 0, 0, "Face select mode"); uiBlockEndAlign(block); } @@ -837,14 +837,14 @@ void image_header_buttons(const bContext *C, ARegion *ar) /* snap options, identical to options in 3d view header */ uiBlockBeginAlign(block); - if (scene->snap_flag & SCE_SNAP) { - uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEO,xco,yco,XIC,YIC, &scene->snap_flag, 0, 0, 0, 0, "Use Snap or Grid (Shift Tab)."); + if (scene->toolsettings->snap_flag & SCE_SNAP) { + uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEO,xco,yco,XIC,YIC, &scene->toolsettings->snap_flag, 0, 0, 0, 0, "Use Snap or Grid (Shift Tab)."); xco+= XIC; - uiDefButS(block, MENU, B_NOP, "Mode%t|Closest%x0|Center%x1|Median%x2",xco,yco,70,YIC, &scene->snap_target, 0, 0, 0, 0, "Snap Target Mode."); + uiDefButS(block, MENU, B_NOP, "Mode%t|Closest%x0|Center%x1|Median%x2",xco,yco,70,YIC, &scene->toolsettings->snap_target, 0, 0, 0, 0, "Snap Target Mode."); xco+= 70; } else { - uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,yco,XIC,YIC, &scene->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)."); + uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,yco,XIC,YIC, &scene->toolsettings->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)."); xco+= XIC; } diff --git a/source/blender/editors/space_time/time_header.c b/source/blender/editors/space_time/time_header.c index cf9c12f3dff..29f31671670 100644 --- a/source/blender/editors/space_time/time_header.c +++ b/source/blender/editors/space_time/time_header.c @@ -567,12 +567,12 @@ void time_header_buttons(const bContext *C, ARegion *ar) uiBlockBeginAlign(block); uiDefIconButBitS(block, TOG, AUTOKEY_ON, B_REDRAWALL, ICON_REC, - xco, yco, XIC, YIC, &(scene->autokey_mode), 0, 0, 0, 0, "Automatic keyframe insertion for Objects and Bones"); + xco, yco, XIC, YIC, &(scene->toolsettings->autokey_mode), 0, 0, 0, 0, "Automatic keyframe insertion for Objects and Bones"); xco+= XIC; if (IS_AUTOKEY_ON(scene)) { uiDefButS(block, MENU, B_REDRAWALL, "Auto-Keying Mode %t|Add/Replace Keys%x3|Replace Keys %x5", - xco, yco, (int)5.5*XIC, YIC, &(scene->autokey_mode), 0, 1, 0, 0, + xco, yco, (int)5.5*XIC, YIC, &(scene->toolsettings->autokey_mode), 0, 1, 0, 0, "Mode of automatic keyframe insertion for Objects and Bones"); xco+= (6*XIC); } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 42da6775d5f..ea9fb66dae0 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -117,7 +117,7 @@ (vd->drawtype==OB_SOLID && vd->flag2 & V3D_SOLID_TEX)) #define CHECK_OB_DRAWFACEDOT(sce, vd, dt) \ -( (sce->selectmode & SCE_SELECT_FACE) && \ +( (sce->toolsettings->selectmode & SCE_SELECT_FACE) && \ (vd->drawtype<=OB_SOLID) && \ (((vd->drawtype==OB_SOLID) && (dt>=OB_SOLID) && (vd->flag2 & V3D_SOLID_TEX) && (vd->flag & V3D_ZBUF_SELECT)) == 0) \ ) @@ -1493,14 +1493,14 @@ void nurbs_foreachScreenVert(ViewContext *vc, void (*func)(void *userData, Nurb static void draw_dm_face_normals__mapFunc(void *userData, int index, float *cent, float *no) { - Scene *scene= (Scene *)userData; + ToolSettings *ts= ((Scene *)userData)->toolsettings; EditFace *efa = EM_get_face_for_index(index); if (efa->h==0 && efa->fgonf!=EM_FGON) { glVertex3fv(cent); - glVertex3f( cent[0] + no[0]*scene->editbutsize, - cent[1] + no[1]*scene->editbutsize, - cent[2] + no[2]*scene->editbutsize); + glVertex3f( cent[0] + no[0]*ts->normalsize, + cent[1] + no[1]*ts->normalsize, + cent[2] + no[2]*ts->normalsize); } } static void draw_dm_face_normals(Scene *scene, DerivedMesh *dm) @@ -1529,19 +1529,20 @@ static void draw_dm_face_centers(DerivedMesh *dm, int sel) static void draw_dm_vert_normals__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) { Scene *scene= (Scene *)userData; + ToolSettings *ts= scene->toolsettings; EditVert *eve = EM_get_vert_for_index(index); if (eve->h==0) { glVertex3fv(co); if (no_f) { - glVertex3f( co[0] + no_f[0]*scene->editbutsize, - co[1] + no_f[1]*scene->editbutsize, - co[2] + no_f[2]*scene->editbutsize); + glVertex3f( co[0] + no_f[0]*ts->normalsize, + co[1] + no_f[1]*ts->normalsize, + co[2] + no_f[2]*ts->normalsize); } else { - glVertex3f( co[0] + no_s[0]*scene->editbutsize/32767.0f, - co[1] + no_s[1]*scene->editbutsize/32767.0f, - co[2] + no_s[2]*scene->editbutsize/32767.0f); + glVertex3f( co[0] + no_s[0]*ts->normalsize/32767.0f, + co[1] + no_s[1]*ts->normalsize/32767.0f, + co[2] + no_s[2]*ts->normalsize/32767.0f); } } } @@ -1762,7 +1763,9 @@ static void draw_dm_bweights__mapFunc(void *userData, int index, float *co, floa } static void draw_dm_bweights(Scene *scene, DerivedMesh *dm) { - if (scene->selectmode & SCE_SELECT_VERTEX) { + ToolSettings *ts= scene->toolsettings; + + if (ts->selectmode & SCE_SELECT_VERTEX) { glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE) + 2); bglBegin(GL_POINTS); dm->foreachMappedVert(dm, draw_dm_bweights__mapFunc, NULL); @@ -1786,6 +1789,7 @@ static void draw_dm_bweights(Scene *scene, DerivedMesh *dm) static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, EditMesh *em, DerivedMesh *cageDM, EditVert *eve_act) { + ToolSettings *ts= scene->toolsettings; int sel; if(v3d->zbuf) glDepthMask(0); // disable write in zbuffer, zbuf select @@ -1817,7 +1821,7 @@ static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, EditM col[3] = fcol[3] = 255; } - if(scene->selectmode & SCE_SELECT_VERTEX) { + if(ts->selectmode & SCE_SELECT_VERTEX) { glPointSize(size); glColor4ubv((GLubyte *)col); draw_dm_verts(cageDM, sel, eve_act); @@ -1842,6 +1846,7 @@ static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, EditM static void draw_em_fancy_edges(Scene *scene, View3D *v3d, Mesh *me, DerivedMesh *cageDM, short sel_only, EditEdge *eed_act) { + ToolSettings *ts= scene->toolsettings; int pass; unsigned char wireCol[4], selCol[4], actCol[4]; @@ -1871,11 +1876,11 @@ static void draw_em_fancy_edges(Scene *scene, View3D *v3d, Mesh *me, DerivedMesh if (!sel_only) wireCol[3] = 255; } - if(scene->selectmode == SCE_SELECT_FACE) { + if(ts->selectmode == SCE_SELECT_FACE) { draw_dm_edges_sel(cageDM, wireCol, selCol, actCol, eed_act); } - else if( (me->drawflag & ME_DRAWEDGES) || (scene->selectmode & SCE_SELECT_EDGE) ) { - if(cageDM->drawMappedEdgesInterp && (scene->selectmode & SCE_SELECT_VERTEX)) { + else if( (me->drawflag & ME_DRAWEDGES) || (ts->selectmode & SCE_SELECT_EDGE) ) { + if(cageDM->drawMappedEdgesInterp && (ts->selectmode & SCE_SELECT_VERTEX)) { glShadeModel(GL_SMOOTH); draw_dm_edges_sel_interp(cageDM, wireCol, selCol); glShadeModel(GL_FLAT); @@ -3561,6 +3566,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, ParticleSystem *psys, int dt) { + ToolSettings *ts= scene->toolsettings; ParticleEdit *edit = psys->edit; ParticleData *pa; ParticleCacheKey **path; @@ -3664,13 +3670,13 @@ static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ob } /* draw edit vertices */ - if(scene->selectmode!=SCE_SELECT_PATH){ + if(pset->selectmode!=SCE_SELECT_PATH){ glDisableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_COLOR_ARRAY); glDisable(GL_LIGHTING); glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); - if(scene->selectmode==SCE_SELECT_POINT){ + if(pset->selectmode==SCE_SELECT_POINT){ float *cd=0,*cdata=0; cd=cdata=MEM_callocN(edit->totkeys*(timed?4:3)*sizeof(float), "particle edit color data"); @@ -3709,7 +3715,7 @@ static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ob MEM_freeN(cdata); cd=cdata=0; } - else if(scene->selectmode == SCE_SELECT_END){ + else if(pset->selectmode == SCE_SELECT_END){ for(i=0, pa=psys->particles; iflag & PARS_HIDE)==0){ key = edit->keys[i] + pa->totkey - 1; @@ -3947,6 +3953,7 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel) static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, Nurb *nurb, int dt) { + ToolSettings *ts= scene->toolsettings; Object *ob= base->object; Curve *cu = ob->data; Nurb *nu; @@ -3978,7 +3985,7 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, /* direction vectors for 3d curve paths when at its lowest, dont render normals */ - if(cu->flag & CU_3D && scene->editbutsize > 0.0015) { + if(cu->flag & CU_3D && ts->normalsize > 0.0015) { UI_ThemeColor(TH_WIRE); for (bl=cu->bev.first,nu=nurb; nu && bl; bl=bl->next,nu=nu->next) { BevPoint *bevp= (BevPoint *)(bl+1); @@ -3986,7 +3993,7 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int skip= nu->resolu/16; while (nr-->0) { /* accounts for empty bevel lists */ - float fac= bevp->radius * scene->editbutsize; + float fac= bevp->radius * ts->normalsize; float ox,oy,oz; // Offset perpendicular to the curve float dx,dy,dz; // Delta along the curve @@ -5408,6 +5415,7 @@ static void bbs_mesh_solid(Scene *scene, View3D *v3d, Object *ob) void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob) { + ToolSettings *ts= scene->toolsettings; wmMultMatrix(ob->obmat); @@ -5425,8 +5433,8 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec EM_init_index_arrays(em, 1, 1, 1); - bbs_mesh_solid_EM(scene, v3d, ob, dm, scene->selectmode & SCE_SELECT_FACE); - if(scene->selectmode & SCE_SELECT_FACE) + bbs_mesh_solid_EM(scene, v3d, ob, dm, ts->selectmode & SCE_SELECT_FACE); + if(ts->selectmode & SCE_SELECT_FACE) em_solidoffs = 1+em->totface; else em_solidoffs= 1; @@ -5438,7 +5446,7 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec em_wireoffs= em_solidoffs + em->totedge; // we draw verts if vert select mode or if in transform (for snap). - if(scene->selectmode & SCE_SELECT_VERTEX || G.moving & G_TRANSFORM_EDIT) { + if(ts->selectmode & SCE_SELECT_VERTEX || G.moving & G_TRANSFORM_EDIT) { bbs_mesh_verts(dm, em_wireoffs); em_vertoffs= em_wireoffs + em->totvert; } diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index b6e9e05b120..ca911876c89 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1663,7 +1663,7 @@ static void view3d_panel_bonesketch_spaces(const bContext *C, Panel *pa) uiBlockEndAlign(block); - uiDefButBitS(block, TOG, SCE_SNAP_PEEL_OBJECT, B_NOP, "Peel Objects", 10, yco, 200, 20, &scene->snap_flag, 0, 0, 0, 0, "Peel whole objects as one"); + uiDefButBitS(block, TOG, SCE_SNAP_PEEL_OBJECT, B_NOP, "Peel Objects", 10, yco, 200, 20, &scene->toolsettings->snap_flag, 0, 0, 0, 0, "Peel whole objects as one"); } diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index de0680c6cc1..13ebeb05a5b 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -1812,6 +1812,7 @@ static void do_view3d_transformmenu(bContext *C, void *arg, int event) { #if 0 Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); switch(event) { case 1: @@ -1870,22 +1871,22 @@ static void do_view3d_transformmenu(bContext *C, void *arg, int event) Transform(); break; case 15: - scene->snap_flag &= ~SCE_SNAP; + ts->snap_flag &= ~SCE_SNAP; break; case 16: - scene->snap_flag |= SCE_SNAP; + ts->snap_flag |= SCE_SNAP; break; case 17: - scene->snap_target = SCE_SNAP_TARGET_CLOSEST; + ts->snap_target = SCE_SNAP_TARGET_CLOSEST; break; case 18: - scene->snap_target = SCE_SNAP_TARGET_CENTER; + ts->snap_target = SCE_SNAP_TARGET_CENTER; break; case 19: - scene->snap_target = SCE_SNAP_TARGET_MEDIAN; + ts->snap_target = SCE_SNAP_TARGET_MEDIAN; break; case 20: - scene->snap_target = SCE_SNAP_TARGET_ACTIVE; + ts->snap_target = SCE_SNAP_TARGET_ACTIVE; break; case 21: alignmenu(); @@ -1896,7 +1897,7 @@ static void do_view3d_transformmenu(bContext *C, void *arg, int event) static uiBlock *view3d_transformmenu(bContext *C, ARegion *ar, void *arg_unused) { - Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); Object *obedit = CTX_data_edit_object(C); uiBlock *block; short yco = 20, menuwidth = 120; @@ -1948,7 +1949,7 @@ static uiBlock *view3d_transformmenu(bContext *C, ARegion *ar, void *arg_unused) { uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - if (scene->snap_flag & SCE_SNAP) + if (ts->snap_flag & SCE_SNAP) { uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Grid", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); @@ -1961,7 +1962,7 @@ static uiBlock *view3d_transformmenu(bContext *C, ARegion *ar, void *arg_unused) uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - switch(scene->snap_target) + switch(ts->snap_target) { case SCE_SNAP_TARGET_CLOSEST: uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap Closest", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); @@ -2650,34 +2651,34 @@ static uiBlock *view3d_edit_objectmenu(bContext *C, ARegion *ar, void *arg_unuse static void do_view3d_edit_propfalloffmenu(bContext *C, void *arg, int event) { - Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); - scene->prop_mode= event; + ts->prop_mode= event; } static uiBlock *view3d_edit_propfalloffmenu(bContext *C, ARegion *ar, void *arg_unused) { - Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); uiBlock *block; short yco = 20, menuwidth = 120; block= uiBeginBlock(C, ar, "view3d_edit_propfalloffmenu", UI_EMBOSSP); uiBlockSetButmFunc(block, do_view3d_edit_propfalloffmenu, NULL); - if (scene->prop_mode==PROP_SMOOTH) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Smooth|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SMOOTH, ""); + if (ts->prop_mode==PROP_SMOOTH) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Smooth|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SMOOTH, ""); else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Smooth|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SMOOTH, ""); - if (scene->prop_mode==PROP_SPHERE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sphere|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SPHERE, ""); + if (ts->prop_mode==PROP_SPHERE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sphere|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SPHERE, ""); else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Sphere|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SPHERE, ""); - if (scene->prop_mode==PROP_ROOT) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Root|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_ROOT, ""); + if (ts->prop_mode==PROP_ROOT) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Root|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_ROOT, ""); else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Root|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_ROOT, ""); - if (scene->prop_mode==PROP_SHARP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SHARP, ""); + if (ts->prop_mode==PROP_SHARP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SHARP, ""); else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SHARP, ""); - if (scene->prop_mode==PROP_LIN) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Linear|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_LIN, ""); + if (ts->prop_mode==PROP_LIN) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Linear|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_LIN, ""); else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Linear|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_LIN, ""); - if (scene->prop_mode==PROP_RANDOM) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Random|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_RANDOM, ""); + if (ts->prop_mode==PROP_RANDOM) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Random|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_RANDOM, ""); else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Random|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_RANDOM, ""); - if (scene->prop_mode==PROP_CONST) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Constant|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_CONST, ""); + if (ts->prop_mode==PROP_CONST) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Constant|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_CONST, ""); else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Constant|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_CONST, ""); uiBlockSetDirection(block, UI_RIGHT); @@ -2698,7 +2699,7 @@ void do_view3d_edit_mesh_verticesmenu(bContext *C, void *arg, int event) make_parent(); break; case 1: /* remove doubles */ - count= removedoublesflag(1, 0, scene->toolsettings->doublimit); + count= removedoublesflag(1, 0, ts->doublimit); notice("Removed: %d", count); if (count) { /* only undo and redraw if an action is taken */ DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); @@ -2768,18 +2769,18 @@ void do_view3d_edit_mesh_edgesmenu(bContext *C, void *arg, int event) switch(event) { case 0: /* subdivide smooth */ - esubdivideflag(1, 0.0, scene->toolsettings->editbutflag | B_SMOOTH,1,0); + esubdivideflag(1, 0.0, ts->editbutflag | B_SMOOTH,1,0); ED_undo_push(C, "Subdivide Smooth"); break; case 1: /*subdivide fractal */ randfac= 10; if(button(&randfac, 1, 100, "Rand fac:")==0) return; fac= -( (float)randfac )/100; - esubdivideflag(1, fac, scene->toolsettings->editbutflag,1,0); + esubdivideflag(1, fac, ts->editbutflag,1,0); ED_undo_push(C, "Subdivide Fractal"); break; case 2: /* subdivide */ - esubdivideflag(1, 0.0, scene->toolsettings->editbutflag,1,0); + esubdivideflag(1, 0.0, ts->editbutflag,1,0); ED_undo_push(C, "Subdivide"); break; case 3: /* knife subdivide */ @@ -3142,6 +3143,7 @@ static uiBlock *view3d_edit_mesh_scriptsmenu(bContext *C, ARegion *ar, void *arg static void do_view3d_edit_meshmenu(bContext *C, void *arg, int event) { #if 0 + ToolSettings *ts= CTX_data_tool_settings(C); Scene *scene= CTX_data_scene(C); ScrArea *sa= CTX_wm_area(C); View3D *v3d= sa->spacedata.first; @@ -3185,12 +3187,12 @@ static void do_view3d_edit_meshmenu(bContext *C, void *arg, int event) Transform(); break; case 12: /* proportional edit (toggle) */ - if(scene->proportional) scene->proportional= 0; - else scene->proportional= 1; + if(ts->proportional) ts->proportional= 0; + else ts->proportional= 1; break; case 13: /* automerge edit (toggle) */ - if(scene->automerge) scene->automerge= 0; - else scene->automerge= 1; + if(ts->automerge) ts->automerge= 0; + else ts->automerge= 1; break; case 15: uv_autocalc_tface(); @@ -3204,7 +3206,7 @@ static void do_view3d_edit_meshmenu(bContext *C, void *arg, int event) static uiBlock *view3d_edit_meshmenu(bContext *C, ARegion *ar, void *arg_unused) { - Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); Object *obedit = CTX_data_edit_object(C); uiBlock *block; short yco= 0, menuwidth=120; @@ -3250,7 +3252,7 @@ static uiBlock *view3d_edit_meshmenu(bContext *C, ARegion *ar, void *arg_unused) - if(scene->proportional) { + if(ts->proportional) { uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); } else { uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); @@ -3261,7 +3263,7 @@ static uiBlock *view3d_edit_meshmenu(bContext *C, ARegion *ar, void *arg_unused) /* PITA but we should let users know that automerge cant work with multires :/ */ uiDefIconTextBut(block, BUTM, 1, - scene->automerge ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT, + ts->automerge ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT, ((Mesh*)obedit->data)->mr ? "AutoMerge Editing (disabled by multires)" : "AutoMerge Editing", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); @@ -3536,8 +3538,8 @@ static void do_view3d_edit_latticemenu(bContext *C, void *arg, int event) Transform(); break; case 5: /* proportional edit (toggle) */ - if(scene->proportional) scene->proportional= 0; - else scene->proportional= 1; + if(ts->proportional) ts->proportional= 0; + else ts->proportional= 1; break; case 7: /* delete keyframe */ common_deletekey(); @@ -3548,7 +3550,7 @@ static void do_view3d_edit_latticemenu(bContext *C, void *arg, int event) static uiBlock *view3d_edit_latticemenu(bContext *C, ARegion *ar, void *arg_unused) { - Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); uiBlock *block; short yco= 0, menuwidth=120; @@ -3574,7 +3576,7 @@ static uiBlock *view3d_edit_latticemenu(bContext *C, ARegion *ar, void *arg_unus uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - if(scene->proportional) { + if(ts->proportional) { uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); } else { uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); @@ -4695,7 +4697,7 @@ static uiBlock *view3d_faceselmenu(bContext *C, ARegion *ar, void *arg_unused) static void view3d_select_particlemenu(bContext *C, uiLayout *layout, void *arg_unused) { - Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border"); @@ -4704,7 +4706,7 @@ static void view3d_select_particlemenu(bContext *C, uiLayout *layout, void *arg_ uiItemO(layout, NULL, 0, "PARTICLE_OT_select_all_toggle"); uiItemO(layout, NULL, 0, "PARTICLE_OT_select_linked"); - if(scene->selectmode & SCE_SELECT_POINT) { + if(ts->particle.selectmode & SCE_SELECT_POINT) { uiItemO(layout, NULL, 0, "PARTICLE_OT_select_last"); // |W, 4 uiItemO(layout, NULL, 0, "PARTICLE_OT_select_first"); // |W, 3 } @@ -4724,7 +4726,7 @@ static void view3d_particle_showhidemenu(bContext *C, uiLayout *layout, void *ar static void view3d_particlemenu(bContext *C, uiLayout *layout, void *arg_unused) { - Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); // XXX uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Particle Edit Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); // add_blockhandler(sa, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW); @@ -4739,7 +4741,7 @@ static void view3d_particlemenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemO(layout, NULL, 0, "PARTICLE_OT_remove_doubles"); // |W, 5 uiItemO(layout, NULL, 0, "PARTICLE_OT_delete"); - if(scene->selectmode & SCE_SELECT_POINT) + if(ts->particle.selectmode & SCE_SELECT_POINT) uiItemO(layout, NULL, 0, "PARTICLE_OT_subdivide"); // |W, 2 uiItemO(layout, NULL, 0, "PARTICLE_OT_rekey"); // |W, 1 @@ -4873,6 +4875,7 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event) { wmWindow *win= CTX_wm_window(C); Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); ScrArea *sa= CTX_wm_area(C); View3D *v3d= sa->spacedata.first; Base *basact= CTX_data_active_base(C); @@ -5007,7 +5010,7 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event) if(em) { if(shift==0 || em->selectmode==0) em->selectmode= SCE_SELECT_VERTEX; - scene->selectmode= em->selectmode; + ts->selectmode= em->selectmode; EM_selectmode_set(em); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); ED_undo_push(C, "Selectmode Set: Vertex"); @@ -5021,7 +5024,7 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event) } em->selectmode = SCE_SELECT_EDGE; } - scene->selectmode= em->selectmode; + ts->selectmode= em->selectmode; EM_selectmode_set(em); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); ED_undo_push(C, "Selectmode Set: Edge"); @@ -5030,12 +5033,12 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event) case B_SEL_FACE: if(em) { if( shift==0 || em->selectmode==0){ - if( ((scene->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_VERTEX) || ((scene->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_EDGE)){ - if(ctrl) EM_convertsel(em, (scene->selectmode ^ SCE_SELECT_FACE),SCE_SELECT_FACE); + if( ((ts->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_VERTEX) || ((ts->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_EDGE)){ + if(ctrl) EM_convertsel(em, (ts->selectmode ^ SCE_SELECT_FACE),SCE_SELECT_FACE); } em->selectmode = SCE_SELECT_FACE; } - scene->selectmode= em->selectmode; + ts->selectmode= em->selectmode; EM_selectmode_set(em); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); ED_undo_push(C, "Selectmode Set: Face"); @@ -5043,15 +5046,15 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event) break; case B_SEL_PATH: - scene->selectmode= SCE_SELECT_PATH; + ts->particle.selectmode= SCE_SELECT_PATH; ED_undo_push(C, "Selectmode Set: Path"); break; case B_SEL_POINT: - scene->selectmode = SCE_SELECT_POINT; + ts->particle.selectmode = SCE_SELECT_POINT; ED_undo_push(C, "Selectmode Set: Point"); break; case B_SEL_END: - scene->selectmode = SCE_SELECT_END; + ts->particle.selectmode = SCE_SELECT_END; ED_undo_push(C, "Selectmode Set: End point"); break; @@ -5280,6 +5283,7 @@ void view3d_header_buttons(const bContext *C, ARegion *ar) ScrArea *sa= CTX_wm_area(C); View3D *v3d= sa->spacedata.first; Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); Object *ob= OBACT; Object *obedit = CTX_data_edit_object(C); uiBlock *block; @@ -5449,11 +5453,11 @@ void view3d_header_buttons(const bContext *C, ARegion *ar) if((obedit && (obedit->type == OB_MESH || obedit->type == OB_CURVE || obedit->type == OB_SURF || obedit->type == OB_LATTICE)) || G.f & G_PARTICLEEDIT) { uiBlockBeginAlign(block); - uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_PROP_OFF, "Proportional %t|Off %x0|On %x1|Connected %x2", xco,yco,XIC+10,YIC, &(scene->proportional), 0, 1.0, 0, 0, "Proportional Edit Falloff (Hotkeys: O, Alt O) "); + uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_PROP_OFF, "Proportional %t|Off %x0|On %x1|Connected %x2", xco,yco,XIC+10,YIC, &(ts->proportional), 0, 1.0, 0, 0, "Proportional Edit Falloff (Hotkeys: O, Alt O) "); xco+= XIC+10; - if(scene->proportional) { - uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_SMOOTHCURVE, propfalloff_pup(), xco,yco,XIC+10,YIC, &(scene->prop_mode), 0.0, 0.0, 0, 0, "Proportional Edit Falloff (Hotkey: Shift O) "); + if(ts->proportional) { + uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_SMOOTHCURVE, propfalloff_pup(), xco,yco,XIC+10,YIC, &(ts->prop_mode), 0.0, 0.0, 0, 0, "Proportional Edit Falloff (Hotkey: Shift O) "); xco+= XIC+10; } uiBlockEndAlign(block); @@ -5464,21 +5468,21 @@ void view3d_header_buttons(const bContext *C, ARegion *ar) if (BIF_snappingSupported(obedit)) { uiBlockBeginAlign(block); - if (scene->snap_flag & SCE_SNAP) { - uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEO,xco,yco,XIC,YIC, &scene->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)"); + if (ts->snap_flag & SCE_SNAP) { + uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEO,xco,yco,XIC,YIC, &ts->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)"); xco+= XIC; - uiDefIconButBitS(block, TOG, SCE_SNAP_ROTATE, B_REDR, ICON_SNAP_NORMAL,xco,yco,XIC,YIC, &scene->snap_flag, 0, 0, 0, 0, "Align rotation with the snapping target"); + uiDefIconButBitS(block, TOG, SCE_SNAP_ROTATE, B_REDR, ICON_SNAP_NORMAL,xco,yco,XIC,YIC, &ts->snap_flag, 0, 0, 0, 0, "Align rotation with the snapping target"); xco+= XIC; - if (scene->snap_mode == SCE_SNAP_MODE_VOLUME) { - uiDefIconButBitS(block, TOG, SCE_SNAP_PEEL_OBJECT, B_REDR, ICON_SNAP_PEEL_OBJECT,xco,yco,XIC,YIC, &scene->snap_flag, 0, 0, 0, 0, "Consider objects as whole when finding volume center"); + if (ts->snap_mode == SCE_SNAP_MODE_VOLUME) { + uiDefIconButBitS(block, TOG, SCE_SNAP_PEEL_OBJECT, B_REDR, ICON_SNAP_PEEL_OBJECT,xco,yco,XIC,YIC, &ts->snap_flag, 0, 0, 0, 0, "Consider objects as whole when finding volume center"); xco+= XIC; } - uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_SNAP_VERTEX, snapmode_pup(), xco,yco,XIC+10,YIC, &(scene->snap_mode), 0.0, 0.0, 0, 0, "Snapping mode"); + uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_SNAP_VERTEX, snapmode_pup(), xco,yco,XIC+10,YIC, &(ts->snap_mode), 0.0, 0.0, 0, 0, "Snapping mode"); xco+= XIC; - uiDefButS(block, MENU, B_NOP, "Snap Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3",xco,yco,70,YIC, &scene->snap_target, 0, 0, 0, 0, "Snap Target Mode"); + uiDefButS(block, MENU, B_NOP, "Snap Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3",xco,yco,70,YIC, &ts->snap_target, 0, 0, 0, 0, "Snap Target Mode"); xco+= XIC+70; } else { - uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,yco,XIC,YIC, &scene->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)"); + uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,yco,XIC,YIC, &ts->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)"); xco+= XIC; } @@ -5509,11 +5513,11 @@ void view3d_header_buttons(const bContext *C, ARegion *ar) } else if(G.f & G_PARTICLEEDIT) { uiBlockBeginAlign(block); - uiDefIconButBitS(block, TOG, SCE_SELECT_PATH, B_SEL_PATH, ICON_EDGESEL, xco,yco,XIC,YIC, &scene->selectmode, 1.0, 0.0, 0, 0, "Path edit mode"); + uiDefIconButBitS(block, TOG, SCE_SELECT_PATH, B_SEL_PATH, ICON_EDGESEL, xco,yco,XIC,YIC, &ts->particle.selectmode, 1.0, 0.0, 0, 0, "Path edit mode"); xco+= XIC; - uiDefIconButBitS(block, TOG, SCE_SELECT_POINT, B_SEL_POINT, ICON_VERTEXSEL, xco,yco,XIC,YIC, &scene->selectmode, 1.0, 0.0, 0, 0, "Point select mode"); + uiDefIconButBitS(block, TOG, SCE_SELECT_POINT, B_SEL_POINT, ICON_VERTEXSEL, xco,yco,XIC,YIC, &ts->particle.selectmode, 1.0, 0.0, 0, 0, "Point select mode"); xco+= XIC; - uiDefIconButBitS(block, TOG, SCE_SELECT_END, B_SEL_END, ICON_FACESEL, xco,yco,XIC,YIC, &scene->selectmode, 1.0, 0.0, 0, 0, "Tip select mode"); + uiDefIconButBitS(block, TOG, SCE_SELECT_END, B_SEL_END, ICON_FACESEL, xco,yco,XIC,YIC, &ts->particle.selectmode, 1.0, 0.0, 0, 0, "Tip select mode"); xco+= XIC; uiBlockEndAlign(block); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index e0e8ac7c7a7..a153f795292 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -438,6 +438,7 @@ static void do_lasso_select_mesh__doSelectFace(void *userData, EditFace *efa, in static void do_lasso_select_mesh(ViewContext *vc, short mcords[][2], short moves, short select) { struct { ViewContext vc; rcti *rect; short (*mcords)[2], moves, select, pass, done; } data; + ToolSettings *ts= vc->scene->toolsettings; rcti rect; int bbsel; @@ -456,14 +457,14 @@ static void do_lasso_select_mesh(ViewContext *vc, short mcords[][2], short moves bbsel= EM_mask_init_backbuf_border(vc, mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax); - if(vc->scene->selectmode & SCE_SELECT_VERTEX) { + if(ts->selectmode & SCE_SELECT_VERTEX) { if (bbsel) { EM_backbuf_checkAndSelectVerts(vc->em, select); } else { mesh_foreachScreenVert(vc, do_lasso_select_mesh__doSelectVert, &data, 1); } } - if(vc->scene->selectmode & SCE_SELECT_EDGE) { + if(ts->selectmode & SCE_SELECT_EDGE) { /* Does both bbsel and non-bbsel versions (need screen cos for both) */ data.pass = 0; @@ -475,7 +476,7 @@ static void do_lasso_select_mesh(ViewContext *vc, short mcords[][2], short moves } } - if(vc->scene->selectmode & SCE_SELECT_FACE) { + if(ts->selectmode & SCE_SELECT_FACE) { if (bbsel) { EM_backbuf_checkAndSelectFaces(vc->em, select); } else { @@ -1277,6 +1278,7 @@ static void do_mesh_box_select__doSelectFace(void *userData, EditFace *efa, int static void do_mesh_box_select(ViewContext *vc, rcti *rect, int select) { struct { ViewContext vc; rcti *rect; short select, pass, done; } data; + ToolSettings *ts= vc->scene->toolsettings; int bbsel; data.vc= *vc; @@ -1287,14 +1289,14 @@ static void do_mesh_box_select(ViewContext *vc, rcti *rect, int select) bbsel= EM_init_backbuf_border(vc, rect->xmin, rect->ymin, rect->xmax, rect->ymax); - if(vc->scene->selectmode & SCE_SELECT_VERTEX) { + if(ts->selectmode & SCE_SELECT_VERTEX) { if (bbsel) { EM_backbuf_checkAndSelectVerts(vc->em, select); } else { mesh_foreachScreenVert(vc, do_mesh_box_select__doSelectVert, &data, 1); } } - if(vc->scene->selectmode & SCE_SELECT_EDGE) { + if(ts->selectmode & SCE_SELECT_EDGE) { /* Does both bbsel and non-bbsel versions (need screen cos for both) */ data.pass = 0; @@ -1306,7 +1308,7 @@ static void do_mesh_box_select(ViewContext *vc, rcti *rect, int select) } } - if(vc->scene->selectmode & SCE_SELECT_FACE) { + if(ts->selectmode & SCE_SELECT_FACE) { if(bbsel) { EM_backbuf_checkAndSelectFaces(vc->em, select); } else { @@ -1639,6 +1641,7 @@ static void mesh_circle_doSelectFace(void *userData, EditFace *efa, int x, int y static void mesh_circle_select(ViewContext *vc, int selecting, short *mval, float rad) { + ToolSettings *ts= vc->scene->toolsettings; int bbsel; if(vc->obedit==NULL && (FACESEL_PAINT_TEST)) { @@ -1666,7 +1669,7 @@ static void mesh_circle_select(ViewContext *vc, int selecting, short *mval, floa data.mval[1] = mval[1]; data.radius = rad; - if(vc->scene->selectmode & SCE_SELECT_VERTEX) { + if(ts->selectmode & SCE_SELECT_VERTEX) { if(bbsel) { EM_backbuf_checkAndSelectVerts(vc->em, selecting==LEFTMOUSE); } else { @@ -1674,7 +1677,7 @@ static void mesh_circle_select(ViewContext *vc, int selecting, short *mval, floa } } - if(vc->scene->selectmode & SCE_SELECT_EDGE) { + if(ts->selectmode & SCE_SELECT_EDGE) { if (bbsel) { EM_backbuf_checkAndSelectEdges(vc->em, selecting==LEFTMOUSE); } else { @@ -1682,7 +1685,7 @@ static void mesh_circle_select(ViewContext *vc, int selecting, short *mval, floa } } - if(vc->scene->selectmode & SCE_SELECT_FACE) { + if(ts->selectmode & SCE_SELECT_FACE) { if(bbsel) { EM_backbuf_checkAndSelectFaces(vc->em, selecting==LEFTMOUSE); } else { diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 674de81a9f5..3311fb7d0fe 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1134,7 +1134,7 @@ void drawTransform(const struct bContext *C, struct ARegion *ar, void *arg) void saveTransform(bContext *C, TransInfo *t, wmOperator *op) { - Scene *sce = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); int constraint_axis[3] = {0, 0, 0}; int proportional = 0; @@ -1195,8 +1195,8 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) // XXX If modal, save settings back in scene if (t->flag & T_MODAL) { - sce->prop_mode = t->prop_mode; - sce->proportional = proportional; + ts->prop_mode = t->prop_mode; + ts->proportional = proportional; if(t->spacetype == SPACE_VIEW3D) { @@ -2359,7 +2359,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) { } else if (t->flag & T_EDIT) { - if(t->around==V3D_LOCAL && (t->scene->selectmode & SCE_SELECT_FACE)) { + if(t->around==V3D_LOCAL && (t->settings->selectmode & SCE_SELECT_FACE)) { VECCOPY(center, td->center); } else { @@ -2660,7 +2660,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short } else { /* !TODO! Make this if not rely on G */ - if(around==V3D_LOCAL && (t->scene->selectmode & SCE_SELECT_FACE)) { + if(around==V3D_LOCAL && (t->settings->selectmode & SCE_SELECT_FACE)) { center = td->center; } } @@ -3126,7 +3126,7 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str) { sprintf(distvec, "%.4f", dist); if(t->flag & T_AUTOIK) { - short chainlen= t->scene->toolsettings->autoik_chainlen; + short chainlen= t->settings->autoik_chainlen; if(chainlen) sprintf(autoik, "AutoIK-Len: %d", chainlen); @@ -4251,7 +4251,7 @@ int Align(TransInfo *t, short mval[2]) VECCOPY(t->center, td->center); } else { - if(t->scene->selectmode & SCE_SELECT_FACE) { + if(t->settings->selectmode & SCE_SELECT_FACE) { VECCOPY(t->center, td->center); } } diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index ee767fada58..534f142734a 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -257,6 +257,7 @@ typedef struct TransInfo { struct ScrArea *sa; struct ARegion *ar; struct Scene *scene; + struct ToolSettings *settings; struct wmTimer *animtimer; short mval[2]; /* current mouse position */ struct Object *obedit; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index efe5122ad01..bb1f09ec44e 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -777,7 +777,7 @@ static void pchan_autoik_adjust (bPoseChannel *pchan, short chainlen) /* change the chain-length of auto-ik */ void transform_autoik_update (TransInfo *t, short mode) { - short *chainlen= &t->scene->toolsettings->autoik_chainlen; + short *chainlen= &t->settings->autoik_chainlen; bPoseChannel *pchan; /* mode determines what change to apply to chainlen */ @@ -1631,7 +1631,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) int count = 0, hasselected = 0; int propmode = t->flag & T_PROP_EDIT; - if(psys==NULL || t->scene->selectmode==SCE_SELECT_PATH) return; + if(psys==NULL || t->settings->particle.selectmode==SCE_SELECT_PATH) return; psmd = psys_get_modifier(ob,psys); @@ -2101,7 +2101,7 @@ void createTransBMeshVerts(TransInfo *t, BME_Mesh *bm, BME_TransData_Head *td) { static void createTransEditVerts(bContext *C, TransInfo *t) { - Scene *scene = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); TransData *tob = NULL; EditMesh *em = ((Mesh *)t->obedit->data)->edit_mesh; EditVert *eve; @@ -2119,7 +2119,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t) } // transform now requires awareness for select mode, so we tag the f1 flags in verts - if(scene->selectmode & SCE_SELECT_VERTEX) { + if(ts->selectmode & SCE_SELECT_VERTEX) { for(eve= em->verts.first; eve; eve= eve->next) { if(eve->h==0 && (eve->f & SELECT)) eve->f1= SELECT; @@ -2127,7 +2127,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t) eve->f1= 0; } } - else if(scene->selectmode & SCE_SELECT_EDGE) { + else if(ts->selectmode & SCE_SELECT_EDGE) { EditEdge *eed; for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0; for(eed= em->edges.first; eed; eed= eed->next) { diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 171665c9282..f4cb5afc3c2 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -665,6 +665,7 @@ void resetTransRestrictions(TransInfo *t) int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) { Scene *sce = CTX_data_scene(C); + ToolSettings *ts = CTX_data_tool_settings(C); ARegion *ar = CTX_wm_region(C); ScrArea *sa = CTX_wm_area(C); Object *obedit = CTX_data_edit_object(C); @@ -679,6 +680,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) t->sa = sa; t->ar = ar; t->obedit = obedit; + t->settings = ts; t->data = NULL; t->ext = NULL; @@ -774,7 +776,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) // Need stuff to take it from edit mesh or whatnot here else { - if (t->obedit && t->obedit->type == OB_MESH && sce->toolsettings->editbutflag & B_MESH_X_MIRROR) + if (t->obedit && t->obedit->type == OB_MESH && ts->editbutflag & B_MESH_X_MIRROR) { t->flag |= T_MIRROR; } @@ -794,10 +796,10 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) } else { - if ((t->options & CTX_NO_PET) == 0 && (sce->proportional)) { + if ((t->options & CTX_NO_PET) == 0 && (ts->proportional)) { t->flag |= T_PROP_EDIT; - if(sce->proportional == 2) + if(ts->proportional == 2) t->flag |= T_PROP_CONNECTED; // yes i know, has to become define } } @@ -808,7 +810,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) } else { - t->prop_size = sce->toolsettings->proportional_size; + t->prop_size = ts->proportional_size; } if (op && RNA_struct_find_property(op->ptr, "proportional_editing_falloff") && RNA_property_is_set(op->ptr, "proportional_editing_falloff")) @@ -817,7 +819,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) } else { - t->prop_mode = sce->prop_mode; + t->prop_mode = ts->prop_mode; } /* TRANSFORM_FIX_ME rna restrictions */ diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 72901110388..0b9a176dbdf 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -210,7 +210,7 @@ int handleSnapping(TransInfo *t, wmEvent *event) if (BIF_snappingSupported(t->obedit) && event->type == TABKEY && event->shift) { /* toggle snap and reinit */ - t->scene->snap_flag ^= SCE_SNAP; + t->settings->snap_flag ^= SCE_SNAP; initSnapping(t, NULL); status = 1; } @@ -282,10 +282,10 @@ int validSnappingNormal(TransInfo *t) void initSnapping(TransInfo *t, wmOperator *op) { - Scene *scene = t->scene; + ToolSettings *ts = t->settings; Object *obedit = t->obedit; int snapping = 0; - short snap_mode = t->scene->snap_target; + short snap_mode = t->settings->snap_target; resetSnapping(t); @@ -310,8 +310,8 @@ void initSnapping(TransInfo *t, wmOperator *op) } else { - snapping = ((scene->snap_flag & SCE_SNAP) == SCE_SNAP); - t->tsnap.align = ((t->scene->snap_flag & SCE_SNAP_ROTATE) == SCE_SNAP_ROTATE); + snapping = ((ts->snap_flag & SCE_SNAP) == SCE_SNAP); + t->tsnap.align = ((t->settings->snap_flag & SCE_SNAP_ROTATE) == SCE_SNAP_ROTATE); } if ((t->spacetype == SPACE_VIEW3D || t->spacetype == SPACE_IMAGE) && // Only 3D view or UV @@ -542,7 +542,7 @@ void CalcSnapGeometry(TransInfo *t, float *vec) int dist = SNAP_MIN_DISTANCE; // Use a user defined value here SnapMode mode; - if (t->scene->snap_mode == SCE_SNAP_MODE_VOLUME) + if (t->settings->snap_mode == SCE_SNAP_MODE_VOLUME) { ListBase depth_peels; DepthPeel *p1, *p2; @@ -575,7 +575,7 @@ void CalcSnapGeometry(TransInfo *t, float *vec) p1->flag = 1; /* if peeling objects, take the first and last from each object */ - if (t->scene->snap_flag & SCE_SNAP_PEEL_OBJECT) + if (t->settings->snap_flag & SCE_SNAP_PEEL_OBJECT) { DepthPeel *peel; for (peel = p1->next; peel; peel = peel->next) @@ -1346,6 +1346,7 @@ int snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMesh *dm, E int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, float obmat[][4], float ray_start[3], float ray_normal[3], short mval[2], float *loc, float *no, int *dist, float *depth) { + ToolSettings *ts= scene->toolsettings; int retval = 0; if (ob->type == OB_MESH) { @@ -1363,13 +1364,13 @@ int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, float obma dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH); } - retval = snapDerivedMesh(scene->snap_mode, ar, ob, dm, em, obmat, ray_start, ray_normal, mval, loc, no, dist, depth); + retval = snapDerivedMesh(ts->snap_mode, ar, ob, dm, em, obmat, ray_start, ray_normal, mval, loc, no, dist, depth); dm->release(dm); } else if (ob->type == OB_ARMATURE) { - retval = snapArmature(scene->snap_mode, ar, ob, ob->data, obmat, ray_start, ray_normal, mval, loc, no, dist, depth); + retval = snapArmature(ts->snap_mode, ar, ob, ob->data, obmat, ray_start, ray_normal, mval, loc, no, dist, depth); } return retval; diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index aded5a4cff9..b811906f5e5 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -102,17 +102,19 @@ static void drawcursor_sima(SpaceImage *sima, ARegion *ar) static int draw_uvs_face_check(Scene *scene) { + ToolSettings *ts= scene->toolsettings; + /* checks if we are selecting only faces */ - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { - if(scene->selectmode == SCE_SELECT_FACE) + if(ts->uv_flag & UV_SYNC_SELECTION) { + if(ts->selectmode == SCE_SELECT_FACE) return 2; - else if(scene->selectmode & SCE_SELECT_FACE) + else if(ts->selectmode & SCE_SELECT_FACE) return 1; else return 0; } else - return (scene->toolsettings->uv_selectmode == UV_SELECT_FACE); + return (ts->uv_selectmode == UV_SELECT_FACE); } static void draw_uvs_shadow(SpaceImage *sima, Object *obedit) @@ -418,7 +420,7 @@ static void draw_uvs_other(SpaceImage *sima, Scene *scene, Object *obedit, MTFac /* draws uv's in the image space */ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) { - ToolSettings *settings; + ToolSettings *ts; Mesh *me= obedit->data; EditMesh *em; EditFace *efa, *efa_act; @@ -432,13 +434,13 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) em= BKE_mesh_get_editmesh(me); activetf= EM_get_active_mtface(em, &efa_act, NULL, 0); /* will be set to NULL if hidden */ - settings= scene->toolsettings; + ts= scene->toolsettings; drawfaces= draw_uvs_face_check(scene); - if(settings->uv_flag & UV_SYNC_SELECTION) - interpedges= (scene->selectmode & SCE_SELECT_VERTEX); + if(ts->uv_flag & UV_SYNC_SELECTION) + interpedges= (ts->selectmode & SCE_SELECT_VERTEX); else - interpedges= (settings->uv_selectmode == UV_SELECT_VERTEX); + interpedges= (ts->uv_selectmode == UV_SELECT_VERTEX); /* draw other uvs */ if(sima->flag & SI_DRAW_OTHER) @@ -454,7 +456,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) /* when sync selection is enabled, all faces are drawn (except for hidden) * so if cage is the same as the final, theres no point in drawing this */ - if(!((settings->uv_flag & UV_SYNC_SELECTION) && (cagedm == finaldm))) + if(!((ts->uv_flag & UV_SYNC_SELECTION) && (cagedm == finaldm))) draw_uvs_dm_shadow(finaldm); /* release derivedmesh again */ diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 7dca4d34c48..7582145c63b 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -191,7 +191,9 @@ static void uvedit_pixel_to_float(SpaceImage *sima, float *dist, float pixeldist int uvedit_face_visible_nolocal(Scene *scene, EditFace *efa) { - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) + ToolSettings *ts= scene->toolsettings; + + if(ts->uv_flag & UV_SYNC_SELECTION) return (efa->h==0); else return (efa->h==0 && (efa->f & SELECT)); @@ -199,7 +201,9 @@ int uvedit_face_visible_nolocal(Scene *scene, EditFace *efa) int uvedit_face_visible(Scene *scene, Image *ima, EditFace *efa, MTFace *tf) { - if(scene->toolsettings->uv_flag & UV_SHOW_SAME_IMAGE) + ToolSettings *ts= scene->toolsettings; + + if(ts->uv_flag & UV_SHOW_SAME_IMAGE) return (tf->tpage==ima)? uvedit_face_visible_nolocal(scene, efa): 0; else return uvedit_face_visible_nolocal(scene, efa); @@ -207,7 +211,9 @@ int uvedit_face_visible(Scene *scene, Image *ima, EditFace *efa, MTFace *tf) int uvedit_face_selected(Scene *scene, EditFace *efa, MTFace *tf) { - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) + ToolSettings *ts= scene->toolsettings; + + if(ts->uv_flag & UV_SYNC_SELECTION) return (efa->f & SELECT); else return (!(~tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3)) &&(!efa->v4 || tf->flag & TF_SEL4)); @@ -215,7 +221,9 @@ int uvedit_face_selected(Scene *scene, EditFace *efa, MTFace *tf) void uvedit_face_select(Scene *scene, EditFace *efa, MTFace *tf) { - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) + ToolSettings *ts= scene->toolsettings; + + if(ts->uv_flag & UV_SYNC_SELECTION) EM_select_face(efa, 1); else tf->flag |= (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); @@ -223,7 +231,9 @@ void uvedit_face_select(Scene *scene, EditFace *efa, MTFace *tf) void uvedit_face_deselect(Scene *scene, EditFace *efa, MTFace *tf) { - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) + ToolSettings *ts= scene->toolsettings; + + if(ts->uv_flag & UV_SYNC_SELECTION) EM_select_face(efa, 0); else tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); @@ -231,12 +241,13 @@ void uvedit_face_deselect(Scene *scene, EditFace *efa, MTFace *tf) int uvedit_edge_selected(Scene *scene, EditFace *efa, MTFace *tf, int i) { + ToolSettings *ts= scene->toolsettings; int nvert= (efa->v4)? 4: 3; - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { - if(scene->selectmode == SCE_SELECT_FACE) + if(ts->uv_flag & UV_SYNC_SELECTION) { + if(ts->selectmode == SCE_SELECT_FACE) return (efa->f & SELECT); - else if(scene->selectmode == SCE_SELECT_EDGE) + else if(ts->selectmode == SCE_SELECT_EDGE) return (*(&efa->e1 + i))->f & SELECT; else return (((efa->v1 + i)->f & SELECT) && ((efa->v1 + (i+1)%nvert)->f & SELECT)); @@ -247,12 +258,13 @@ int uvedit_edge_selected(Scene *scene, EditFace *efa, MTFace *tf, int i) void uvedit_edge_select(Scene *scene, EditFace *efa, MTFace *tf, int i) { + ToolSettings *ts= scene->toolsettings; int nvert= (efa->v4)? 4: 3; - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { - if(scene->selectmode == SCE_SELECT_FACE) + if(ts->uv_flag & UV_SYNC_SELECTION) { + if(ts->selectmode == SCE_SELECT_FACE) EM_select_face(efa, 1); - else if(scene->selectmode == SCE_SELECT_EDGE) + else if(ts->selectmode == SCE_SELECT_EDGE) EM_select_edge((*(&efa->e1 + i)), 1); else { (efa->v1 + i)->f |= SELECT; @@ -265,12 +277,13 @@ void uvedit_edge_select(Scene *scene, EditFace *efa, MTFace *tf, int i) void uvedit_edge_deselect(Scene *scene, EditFace *efa, MTFace *tf, int i) { + ToolSettings *ts= scene->toolsettings; int nvert= (efa->v4)? 4: 3; - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { - if(scene->selectmode == SCE_SELECT_FACE) + if(ts->uv_flag & UV_SYNC_SELECTION) { + if(ts->selectmode == SCE_SELECT_FACE) EM_select_face(efa, 0); - else if(scene->selectmode == SCE_SELECT_EDGE) + else if(ts->selectmode == SCE_SELECT_EDGE) EM_select_edge((*(&efa->e1 + i)), 0); else { (efa->v1 + i)->f &= ~SELECT; @@ -283,8 +296,10 @@ void uvedit_edge_deselect(Scene *scene, EditFace *efa, MTFace *tf, int i) int uvedit_uv_selected(Scene *scene, EditFace *efa, MTFace *tf, int i) { - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { - if(scene->selectmode == SCE_SELECT_FACE) + ToolSettings *ts= scene->toolsettings; + + if(ts->uv_flag & UV_SYNC_SELECTION) { + if(ts->selectmode == SCE_SELECT_FACE) return (efa->f & SELECT); else return (*(&efa->v1 + i))->f & SELECT; @@ -295,8 +310,10 @@ int uvedit_uv_selected(Scene *scene, EditFace *efa, MTFace *tf, int i) void uvedit_uv_select(Scene *scene, EditFace *efa, MTFace *tf, int i) { - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { - if(scene->selectmode == SCE_SELECT_FACE) + ToolSettings *ts= scene->toolsettings; + + if(ts->uv_flag & UV_SYNC_SELECTION) { + if(ts->selectmode == SCE_SELECT_FACE) EM_select_face(efa, 1); else (*(&efa->v1 + i))->f |= SELECT; @@ -307,8 +324,10 @@ void uvedit_uv_select(Scene *scene, EditFace *efa, MTFace *tf, int i) void uvedit_uv_deselect(Scene *scene, EditFace *efa, MTFace *tf, int i) { - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { - if(scene->selectmode == SCE_SELECT_FACE) + ToolSettings *ts= scene->toolsettings; + + if(ts->uv_flag & UV_SYNC_SELECTION) { + if(ts->selectmode == SCE_SELECT_FACE) EM_select_face(efa, 0); else (*(&efa->v1 + i))->f &= ~SELECT; @@ -1289,6 +1308,7 @@ void UV_OT_stitch(wmOperatorType *ot) static int select_inverse_exec(bContext *C, wmOperator *op) { Scene *scene; + ToolSettings *ts; Object *obedit; EditMesh *em; EditFace *efa; @@ -1296,11 +1316,12 @@ static int select_inverse_exec(bContext *C, wmOperator *op) MTFace *tf; scene= CTX_data_scene(C); + ts= CTX_data_tool_settings(C); obedit= CTX_data_edit_object(C); em= BKE_mesh_get_editmesh((Mesh*)obedit->data); ima= CTX_data_edit_image(C); - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { + if(ts->uv_flag & UV_SYNC_SELECTION) { EM_select_swap(em); } else { @@ -1339,6 +1360,7 @@ void UV_OT_select_invert(wmOperatorType *ot) static int de_select_all_exec(bContext *C, wmOperator *op) { Scene *scene; + ToolSettings *ts; Object *obedit; EditMesh *em; EditFace *efa; @@ -1347,11 +1369,12 @@ static int de_select_all_exec(bContext *C, wmOperator *op) int sel; scene= CTX_data_scene(C); + ts= CTX_data_tool_settings(C); obedit= CTX_data_edit_object(C); em= BKE_mesh_get_editmesh((Mesh*)obedit->data); ima= CTX_data_edit_image(C); - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { + if(ts->uv_flag & UV_SYNC_SELECTION) { EM_toggle_select_all(em); } else { @@ -1431,6 +1454,7 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop) { SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); Object *obedit= CTX_data_edit_object(C); Image *ima= CTX_data_edit_image(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data); @@ -1445,12 +1469,12 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop) uvedit_pixel_to_float(sima, penalty, 5.0f); /* retrieve operation mode */ - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { + if(ts->uv_flag & UV_SYNC_SELECTION) { sync= 1; - if(scene->selectmode & SCE_SELECT_FACE) + if(ts->selectmode & SCE_SELECT_FACE) selectmode= UV_SELECT_FACE; - else if(scene->selectmode & SCE_SELECT_EDGE) + else if(ts->selectmode & SCE_SELECT_EDGE) selectmode= UV_SELECT_EDGE; else selectmode= UV_SELECT_VERTEX; @@ -1459,7 +1483,7 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop) } else { sync= 0; - selectmode= scene->toolsettings->uv_selectmode; + selectmode= ts->uv_selectmode; sticky= sima->sticky; } @@ -1681,7 +1705,7 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop) if(sync) { /* flush for mesh selection */ - if(scene->selectmode != SCE_SELECT_FACE) { + if(ts->selectmode != SCE_SELECT_FACE) { if(flush==1) EM_select_flush(em); else if(flush==-1) EM_deselect_flush(em); } @@ -1794,13 +1818,14 @@ static int select_linked_exec(bContext *C, wmOperator *op) { SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); Object *obedit= CTX_data_edit_object(C); Image *ima= CTX_data_edit_image(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data); float limit[2]; int extend; - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { + if(ts->uv_flag & UV_SYNC_SELECTION) { BKE_report(op->reports, RPT_ERROR, "Can't select linked when sync selection is enabled."); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; @@ -1838,13 +1863,14 @@ void UV_OT_select_linked(wmOperatorType *ot) static int unlink_selection_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); Object *obedit= CTX_data_edit_object(C); Image *ima= CTX_data_edit_image(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data); EditFace *efa; MTFace *tf; - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { + if(ts->uv_flag & UV_SYNC_SELECTION) { BKE_report(op->reports, RPT_ERROR, "Can't unlink selection when sync selection is enabled."); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; @@ -1901,12 +1927,13 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje * This only needs to be done when the Mesh is not used for * selection (so for sticky modes, vertex or location based). */ + ToolSettings *ts= CTX_data_tool_settings(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data); EditFace *efa; MTFace *tf; int nverts, i; - if((scene->toolsettings->uv_flag & UV_SYNC_SELECTION)==0 && sima->sticky == SI_STICKY_VERTEX) { + if((ts->uv_flag & UV_SYNC_SELECTION)==0 && sima->sticky == SI_STICKY_VERTEX) { /* Tag all verts as untouched, then touch the ones that have a face center * in the loop and select all MTFace UV's that use a touched vert. */ EditVert *eve; @@ -1937,7 +1964,7 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje } } } - else if((scene->toolsettings->uv_flag & UV_SYNC_SELECTION)==0 && sima->sticky == SI_STICKY_LOC) { + else if((ts->uv_flag & UV_SYNC_SELECTION)==0 && sima->sticky == SI_STICKY_LOC) { EditFace *efa_vlist; MTFace *tf_vlist; UvMapVert *start_vlist=NULL, *vlist_iter; @@ -2008,7 +2035,7 @@ static void uv_faces_do_sticky(bContext *C, SpaceImage *sima, Scene *scene, Obje EM_free_uv_vert_map(vmap); } - else { /* SI_STICKY_DISABLE or scene->toolsettings->uv_flag & UV_SYNC_SELECTION */ + else { /* SI_STICKY_DISABLE or ts->uv_flag & UV_SYNC_SELECTION */ for(efa= em->faces.first; efa; efa= efa->next) { if(efa->tmp.l) { tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); @@ -2026,6 +2053,7 @@ static int border_select_exec(bContext *C, wmOperator *op) { SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); Object *obedit= CTX_data_edit_object(C); Image *ima= CTX_data_edit_image(C); ARegion *ar= CTX_wm_region(C); @@ -2049,10 +2077,10 @@ static int border_select_exec(bContext *C, wmOperator *op) select= (RNA_int_get(op->ptr, "event_type") == LEFTMOUSE); // XXX hardcoded pinned= RNA_boolean_get(op->ptr, "pinned"); - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) - faces= (scene->selectmode == SCE_SELECT_FACE); + if(ts->uv_flag & UV_SYNC_SELECTION) + faces= (ts->selectmode == SCE_SELECT_FACE); else - faces= (scene->toolsettings->uv_selectmode == UV_SELECT_FACE); + faces= (ts->uv_selectmode == UV_SELECT_FACE); /* do actual selection */ if(faces && !pinned) { @@ -2084,7 +2112,7 @@ static int border_select_exec(bContext *C, wmOperator *op) for(efa= em->faces.first; efa; efa= efa->next) { tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); if(uvedit_face_visible(scene, ima, efa, tface)) { - if(!pinned || (scene->toolsettings->uv_flag & UV_SYNC_SELECTION) ) { + if(!pinned || (ts->uv_flag & UV_SYNC_SELECTION) ) { /* UV_SYNC_SELECTION - can't do pinned selection */ if(BLI_in_rctf(&rectf, tface->uv[0][0], tface->uv[0][1])) { if(select) uvedit_uv_select(scene, efa, tface, 0); @@ -2133,8 +2161,8 @@ static int border_select_exec(bContext *C, wmOperator *op) if(change) { /* make sure newly selected vert selection is updated*/ - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { - if(scene->selectmode != SCE_SELECT_FACE) { + if(ts->uv_flag & UV_SYNC_SELECTION) { + if(ts->selectmode != SCE_SELECT_FACE) { if(select) EM_select_flush(em); else EM_deselect_flush(em); } @@ -2668,14 +2696,14 @@ void UV_OT_select_pinned(wmOperatorType *ot) static int hide_exec(bContext *C, wmOperator *op) { SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); - Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data); EditFace *efa; MTFace *tf; int swap= RNA_boolean_get(op->ptr, "unselected"); - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { + if(ts->uv_flag & UV_SYNC_SELECTION) { EM_hide_mesh(em, swap); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); @@ -2811,14 +2839,14 @@ void UV_OT_hide(wmOperatorType *ot) static int reveal_exec(bContext *C, wmOperator *op) { SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); - Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh*)obedit->data); EditFace *efa; MTFace *tf; /* call the mesh function if we are in mesh sync sel */ - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { + if(ts->uv_flag & UV_SYNC_SELECTION) { EM_reveal_mesh(em); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 4605d1f31e2..828721f0abb 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -47,6 +47,7 @@ struct Group; struct Text; struct bNodeTree; struct AnimData; +struct Editing; typedef struct Base { struct Base *next, *prev; @@ -382,6 +383,8 @@ typedef struct ParticleEditSettings { float emitterdist; int draw_timed; + + int selectmode, pad; } ParticleEditSettings; typedef struct TransformOrientation { @@ -441,14 +444,19 @@ typedef struct ToolSettings { short editbutflag; /*Triangle to Quad conversion threshold*/ float jointrilimit; - /* Extrude Tools */ + /* Editmode Tools */ float degr; short step; short turn; - float extr_offs; - float doublimit; - + float extr_offs; /* extrude offset */ + float doublimit; /* remove doubles limit */ + float normalsize; /* size of normals */ + short automerge; + + /* Selection Mode for Mesh */ + short selectmode; + /* Primitive Settings */ /* UV Sphere */ short segments; @@ -484,8 +492,11 @@ typedef struct ToolSettings { /* Select Group Threshold */ float select_thresh; - /* IPO-Editor */ + /* Graph Editor */ float clean_thresh; + + /* Auto-Keying Mode */ + short autokey_mode, pad2; /* defines in DNA_userdef_types.h */ /* Retopo */ char retopo_mode; @@ -512,7 +523,6 @@ typedef struct ToolSettings { char skgen_postpro_passes; char skgen_subdivisions[3]; char skgen_multi_level; - int skgen_pad; /* Skeleton Sketching */ struct Object *skgen_template; @@ -526,7 +536,10 @@ typedef struct ToolSettings { /* Alt+RMB option */ char edge_mode; - char pad3[2]; + + /* transform */ + short snap_mode, snap_flag, snap_target; + short proportional, prop_mode; } ToolSettings; typedef struct bStats { @@ -547,28 +560,22 @@ typedef struct Scene { struct Image *ima; ListBase base; - struct Base *basact; + struct Base *basact; /* active base */ struct Object *obedit; /* name replaces old G.obedit */ - float cursor[3]; + float cursor[3]; /* 3d cursor location */ float twcent[3]; /* center for transform widget */ float twmin[3], twmax[3]; /* boundbox of selection for transform widget */ unsigned int lay; - /* editmode stuff */ - float editbutsize; /* size of normals */ - short selectmode; /* for mesh only! */ - short proportional, prop_mode; - short automerge, pad5; short flag; /* various settings */ - short autokey_mode; /* mode for autokeying (defines in DNA_userdef_types.h) */ short use_nodes; struct bNodeTree *nodetree; - void *ed; /* sequence editor data is allocated here */ + struct Editing *ed; /* sequence editor data is allocated here */ struct GameFraming framing; @@ -578,20 +585,20 @@ typedef struct Scene { /* migrate or replace? depends on some internal things... */ /* no, is on the right place (ton) */ struct RenderData r; - struct AudioData audio; /* DEPRICATED 2.5 */ + struct AudioData audio; /* DEPRECATED 2.5 */ ScriptLink scriptlink; ListBase markers; ListBase transform_spaces; - short jumpframe; - short snap_mode, snap_flag, snap_target; /* none of the dependancy graph vars is mean to be saved */ struct DagForest *theDag; short dagisvalid, dagflags; - short pad4, recalc; /* recalc = counterpart of ob->recalc */ + short recalc; /* recalc = counterpart of ob->recalc */ + + short jumpframe; /* frame step. */ int frame_step; @@ -791,27 +798,27 @@ typedef struct Scene { /* base->flag is in DNA_object_types.h */ -/* scene->snap_flag */ +/* toolsettings->snap_flag */ #define SCE_SNAP 1 #define SCE_SNAP_ROTATE 2 #define SCE_SNAP_PEEL_OBJECT 4 -/* scene->snap_target */ +/* toolsettings->snap_target */ #define SCE_SNAP_TARGET_CLOSEST 0 #define SCE_SNAP_TARGET_CENTER 1 #define SCE_SNAP_TARGET_MEDIAN 2 #define SCE_SNAP_TARGET_ACTIVE 3 -/* scene->snap_mode */ +/* toolsettings->snap_mode */ #define SCE_SNAP_MODE_VERTEX 0 #define SCE_SNAP_MODE_EDGE 1 #define SCE_SNAP_MODE_FACE 2 #define SCE_SNAP_MODE_VOLUME 3 -/* sce->selectmode */ +/* toolsettings->selectmode */ #define SCE_SELECT_VERTEX 1 /* for mesh */ #define SCE_SELECT_EDGE 2 #define SCE_SELECT_FACE 4 -/* sce->selectmode for particles */ +/* toolsettings->particle.selectmode for particles */ #define SCE_SELECT_PATH 1 #define SCE_SELECT_POINT 2 #define SCE_SELECT_END 4 @@ -819,7 +826,7 @@ typedef struct Scene { /* sce->recalc (now in use by previewrender) */ #define SCE_PRV_CHANGED 1 -/* sce->prop_mode (proportional falloff) */ +/* toolsettings->prop_mode (proportional falloff) */ #define PROP_SMOOTH 0 #define PROP_SPHERE 1 #define PROP_ROOT 2 @@ -886,7 +893,7 @@ typedef enum SculptFlags { /* toolsettings->uv_selectmode */ #define UV_SELECT_VERTEX 1 -#define UV_SELECT_EDGE 2 /* not implemented */ +#define UV_SELECT_EDGE 2 #define UV_SELECT_FACE 4 #define UV_SELECT_ISLAND 8 diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 416acd7467e..9dc7e07a95c 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -229,7 +229,7 @@ typedef struct SpaceImage { char dt_uv; /* UV draw type */ char sticky; /* sticky selection type */ char dt_uvstretch; - char pad; + char around; float xof, yof; /* user defined offset, image is centered */ float zoom, pad4; /* user defined zoom level */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 5d4916bb3c6..47c9025149a 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -151,8 +151,34 @@ void rna_def_tool_settings(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; + static EnumPropertyItem uv_select_mode_items[] = { + {UV_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode."}, + {UV_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode."}, + {UV_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode."}, + {UV_SELECT_ISLAND, "ISLAND", ICON_LINKEDSEL, "Island", "Island selection mode."}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem mesh_select_mode_items[] = { + {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex selection mode."}, + {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection mode."}, + {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection mode."}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem snap_element_items[] = { + {SCE_SNAP_MODE_VERTEX, "VERTEX", ICON_SNAP_VERTEX, "Vertex", "Snap to vertices."}, + {SCE_SNAP_MODE_EDGE, "EDGE", ICON_SNAP_EDGE, "Edge", "Snap to edges."}, + {SCE_SNAP_MODE_FACE, "FACE", ICON_SNAP_FACE, "Face", "Snap to faces."}, + {SCE_SNAP_MODE_VOLUME, "VOLUME", ICON_SNAP_VOLUME, "Volume", "Snap to volume."}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem snap_mode_items[] = { + {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target."}, + {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target."}, + {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target."}, + {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target."}, + {0, NULL, 0, NULL, NULL}}; + srna= RNA_def_struct(brna, "ToolSettings", NULL); - RNA_def_struct_nested(brna, srna, "Scene"); RNA_def_struct_ui_text(srna, "Tool Settings", ""); prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE); @@ -163,6 +189,62 @@ void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_struct_type(prop, "VPaint"); RNA_def_property_ui_text(prop, "Vertex Paint", ""); + /* Transform */ + prop= RNA_def_property(srna, "proportional_editing", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "proportional", 0); + RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional editing mode."); + + prop= RNA_def_property(srna, "proportional_editing_falloff", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "prop_mode"); + RNA_def_property_enum_items(prop, prop_mode_items); + RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode."); + + prop= RNA_def_property(srna, "snap", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP); + RNA_def_property_ui_text(prop, "Snap", "Snap while Ctrl is held during transform."); + RNA_def_property_ui_icon(prop, ICON_SNAP_GEAR, 1); + + prop= RNA_def_property(srna, "snap_align_rotation", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ROTATE); + RNA_def_property_ui_text(prop, "Snap Align Rotation", "Align rotation with the snapping target."); + RNA_def_property_ui_icon(prop, ICON_SNAP_NORMAL, 0); + + prop= RNA_def_property(srna, "snap_element", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "snap_mode"); + RNA_def_property_enum_items(prop, snap_element_items); + RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to."); + + prop= RNA_def_property(srna, "snap_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "snap_target"); + RNA_def_property_enum_items(prop, snap_mode_items); + RNA_def_property_ui_text(prop, "Snap Mode", "Which part to snap onto the target."); + + prop= RNA_def_property(srna, "snap_peel_object", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT); + RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center."); + RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0); + + /* UV */ + prop= RNA_def_property(srna, "uv_selection_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode"); + RNA_def_property_enum_items(prop, uv_select_mode_items); + RNA_def_property_ui_text(prop, "UV Selection Mode", "UV selection and display mode."); + + prop= RNA_def_property(srna, "uv_sync_selection", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SYNC_SELECTION); + RNA_def_property_ui_text(prop, "UV Sync Selection", "Keep UV and edit mode mesh selection in sync."); + RNA_def_property_ui_icon(prop, ICON_EDIT, 0); + + prop= RNA_def_property(srna, "uv_local_view", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "uv_flag", UV_SHOW_SAME_IMAGE); + RNA_def_property_ui_text(prop, "UV Local View", "Draw only faces with the currently displayed image assigned."); + + /* Mesh */ + prop= RNA_def_property(srna, "mesh_selection_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode"); + RNA_def_property_enum_items(prop, mesh_select_mode_items); + RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Mesh selection and display mode."); + rna_def_sculpt(brna); } @@ -839,10 +921,6 @@ void RNA_def_scene(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem unwrapper_items[] = { - {0, "CONFORMAL", 0, "Conformal", ""}, - {1, "ANGLEBASED", 0, "Angle Based", ""}, - {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Scene", "ID"); RNA_def_struct_ui_text(srna, "Scene", "Scene consisting objects and defining time and render related settings."); @@ -874,11 +952,6 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible when rendering the scene."); RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set"); - prop= RNA_def_property(srna, "proportional_editing_falloff", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "prop_mode"); - RNA_def_property_enum_items(prop, prop_mode_items); - RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode."); - prop= RNA_def_property(srna, "current_frame", PROP_INT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_int_sdna(prop, NULL, "r.cfra"); @@ -911,11 +984,6 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Stamp Note", "User define note for the render stamping."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "unwrapper", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "toolsettings->unwrapper"); - RNA_def_property_enum_items(prop, unwrapper_items); - RNA_def_property_ui_text(prop, "Unwrapper", "Unwrap algorithm used by the Unwrap tool."); - prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree."); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index a1b51084fca..1bfc3b6f8f6 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -202,7 +202,7 @@ static PointerRNA rna_Operator_properties_get(PointerRNA *ptr) } -static int rna_Event_ascii_get(PointerRNA *ptr, char *value) +static void rna_Event_ascii_get(PointerRNA *ptr, char *value) { wmEvent *event= (wmEvent*)ptr->id.data; value[0]= event->ascii; -- cgit v1.2.3 From 9fd605c0502d991af30a4d4b91681b4116658f45 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 23 Jun 2009 00:45:41 +0000 Subject: 2.5: Image Editor * Menu and header more complete now. * Clean up Game Properties panel and moved View Properties panel to python. * Fix some drawing issues when combining tiles, repeat and aspect, some also from 2.4x, these options didn't work together 100%. --- source/blender/editors/include/UI_icons.h | 2 +- source/blender/editors/include/UI_interface.h | 3 ++ source/blender/editors/space_image/image_buttons.c | 42 +++++++++++++---- source/blender/editors/space_image/image_draw.c | 28 ++++++------ source/blender/editors/space_image/space_image.c | 8 ++-- .../blender/editors/transform/transform_generics.c | 3 +- source/blender/makesrna/intern/rna_image.c | 26 +++++++++-- source/blender/makesrna/intern/rna_space.c | 53 +++++++++------------- source/blender/makesrna/intern/rna_ui_api.c | 7 +++ 9 files changed, 106 insertions(+), 66 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index 884020ae7dc..602e94838b7 100644 --- a/source/blender/editors/include/UI_icons.h +++ b/source/blender/editors/include/UI_icons.h @@ -658,12 +658,12 @@ DEF_ICON(ICON_SNAP_VERTEX) DEF_ICON(ICON_SNAP_EDGE) DEF_ICON(ICON_SNAP_FACE) DEF_ICON(ICON_SNAP_VOLUME) +DEF_ICON(ICON_UVS_FACE) DEF_ICON(ICON_STICKY_UVS_LOC) DEF_ICON(ICON_STICKY_UVS_DISABLE) DEF_ICON(ICON_STICKY_UVS_VERT) DEF_ICON(ICON_CLIPUV_DEHLT) DEF_ICON(ICON_CLIPUV_HLT) -DEF_ICON(ICON_BLANK219) DEF_ICON(ICON_SNAP_PEEL_OBJECT) DEF_ICON(ICON_BLANK221) DEF_ICON(ICON_GRID) diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 62469686e7f..80e57f5e5be 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -53,6 +53,8 @@ struct uiStyle; struct uiFontStyle; struct ColorBand; struct CurveMapping; +struct Image; +struct ImageUser; typedef struct uiBut uiBut; typedef struct uiBlock uiBlock; @@ -614,6 +616,7 @@ void uiTemplatePreview(uiLayout *layout, struct ID *id); void uiTemplateColorRamp(uiLayout *layout, struct ColorBand *coba, int expand); void uiTemplateCurveMapping(uiLayout *layout, struct CurveMapping *cumap, int type); void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, char *propname); +void uiTemplateImageLayers(uiLayout *layout, struct bContext *C, struct Image *ima, struct ImageUser *iuser); /* items */ void uiItemO(uiLayout *layout, char *name, int icon, char *opname); diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index b5df0257e71..8aa955f0b34 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -1023,42 +1023,53 @@ static void image_load_fs_cb(bContext *C, void *ima_pp_v, void *iuser_v) static void image_multi_cb(bContext *C, void *rr_v, void *iuser_v) { BKE_image_multilayer_index(rr_v, iuser_v); + WM_event_add_notifier(C, NC_IMAGE|ND_DRAW, NULL); } static void image_multi_inclay_cb(bContext *C, void *rr_v, void *iuser_v) { RenderResult *rr= rr_v; ImageUser *iuser= iuser_v; int tot= BLI_countlist(&rr->layers) + (rr->rectf?1:0); /* fake compo result layer */ - if(iuser->layerlayerlayer++; - BKE_image_multilayer_index(rr, iuser); + BKE_image_multilayer_index(rr, iuser); + WM_event_add_notifier(C, NC_IMAGE|ND_DRAW, NULL); + } } static void image_multi_declay_cb(bContext *C, void *rr_v, void *iuser_v) { ImageUser *iuser= iuser_v; - if(iuser->layer>0) + + if(iuser->layer>0) { iuser->layer--; - BKE_image_multilayer_index(rr_v, iuser); + BKE_image_multilayer_index(rr_v, iuser); + WM_event_add_notifier(C, NC_IMAGE|ND_DRAW, NULL); + } } static void image_multi_incpass_cb(bContext *C, void *rr_v, void *iuser_v) { RenderResult *rr= rr_v; ImageUser *iuser= iuser_v; RenderLayer *rl= BLI_findlink(&rr->layers, iuser->layer); + if(rl) { int tot= BLI_countlist(&rl->passes) + (rl->rectf?1:0); /* builtin render result has no combined pass in list */ if(iuser->passpass++; BKE_image_multilayer_index(rr, iuser); + WM_event_add_notifier(C, NC_IMAGE|ND_DRAW, NULL); } } } static void image_multi_decpass_cb(bContext *C, void *rr_v, void *iuser_v) { ImageUser *iuser= iuser_v; + if(iuser->pass>0) { iuser->pass--; BKE_image_multilayer_index(rr_v, iuser); + WM_event_add_notifier(C, NC_IMAGE|ND_DRAW, NULL); } } @@ -1353,6 +1364,23 @@ void ED_image_uiblock_panel(const bContext *C, uiBlock *block, Image **ima_pp, I uiBlockEndAlign(block); } +void uiTemplateImageLayers(uiLayout *layout, bContext *C, Image *ima, ImageUser *iuser) +{ + uiBlock *block= uiLayoutFreeBlock(layout); + Scene *scene= CTX_data_scene(C); + RenderResult *rr; + + /* render layers and passes */ + if(ima && iuser) { + rr= BKE_image_get_renderresult(scene, ima); + + if(rr) { + uiBlockBeginAlign(block); + uiblock_layer_pass_buttons(block, rr, iuser, 0, 0, 0, 160); + uiBlockEndAlign(block); + } + } +} static void image_panel_properties(const bContext *C, Panel *pa) { @@ -1377,12 +1405,6 @@ void image_buttons_register(ARegionType *art) pt->draw= image_panel_properties; BLI_addtail(&art->paneltypes, pt); - pt= MEM_callocN(sizeof(PanelType), "spacetype image view properties"); - strcpy(pt->idname, "IMAGE_PT_view_properties"); - strcpy(pt->label, "View Properties"); - pt->draw= image_panel_view_properties; - BLI_addtail(&art->paneltypes, pt); - pt= MEM_callocN(sizeof(PanelType), "spacetype image panel paint"); strcpy(pt->idname, "IMAGE_PT_paint"); strcpy(pt->label, "Paint"); diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 122e298baaa..e61931f2fad 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -311,12 +311,14 @@ static void sima_draw_alpha_pixelsf(float x1, float y1, int rectx, int recty, fl // glColorMask(1, 1, 1, 1); } +#ifdef WITH_LCMS static void sima_draw_colorcorrected_pixels(float x1, float y1, ImBuf *ibuf) { colorcorrection_do_ibuf(ibuf, "MONOSCNR.ICM"); /* path is hardcoded here, find some place better */ glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->crect); } +#endif static void sima_draw_zbuf_pixels(float x1, float y1, int rectx, int recty, int *recti) { @@ -450,7 +452,7 @@ static unsigned int *get_part_from_ibuf(ImBuf *ibuf, short startx, short starty, return rectmain; } -static void draw_image_buffer_tiled(SpaceImage *sima, ARegion *ar, Image *ima, ImBuf *ibuf, float zoomx, float zoomy) +static void draw_image_buffer_tiled(SpaceImage *sima, ARegion *ar, Image *ima, ImBuf *ibuf, float fx, float fy, float zoomx, float zoomy) { unsigned int *rect; int dx, dy, sx, sy, x, y; @@ -477,7 +479,7 @@ static void draw_image_buffer_tiled(SpaceImage *sima, ARegion *ar, Image *ima, I /* draw repeated */ for(sy=0; sy+dy<=ibuf->y; sy+= dy) { for(sx=0; sx+dx<=ibuf->x; sx+= dx) { - UI_view2d_view_to_region(&ar->v2d, (float)sx/(float)ibuf->x, (float)sy/(float)ibuf->y, &x, &y); + UI_view2d_to_region_no_clip(&ar->v2d, fx + (float)sx/(float)ibuf->x, fy + (float)sy/(float)ibuf->y, &x, &y); glaDrawPixelsSafe(x, y, dx, dy, dx, GL_RGBA, GL_UNSIGNED_BYTE, rect); } @@ -488,16 +490,19 @@ static void draw_image_buffer_tiled(SpaceImage *sima, ARegion *ar, Image *ima, I MEM_freeN(rect); } -static void draw_image_buffer_repeated(SpaceImage *sima, ARegion *ar, Scene *scene, ImBuf *ibuf, float zoomx, float zoomy) +static void draw_image_buffer_repeated(SpaceImage *sima, ARegion *ar, Scene *scene, Image *ima, ImBuf *ibuf, float zoomx, float zoomy) { float x, y; double time_current; time_current = PIL_check_seconds_timer(); - for(x=ar->v2d.cur.xmin; xv2d.cur.xmax; x += zoomx) { - for(y=ar->v2d.cur.ymin; yv2d.cur.ymax; y += zoomy) { - draw_image_buffer(sima, ar, scene, ibuf, x, y, zoomx, zoomy); + for(x=floor(ar->v2d.cur.xmin); xv2d.cur.xmax; x += 1.0f) { + for(y=floor(ar->v2d.cur.ymin); yv2d.cur.ymax; y += 1.0f) { + if(ima && (ima->tpageflag & IMA_TILES)) + draw_image_buffer_tiled(sima, ar, ima, ibuf, x, y, zoomx, zoomy); + else + draw_image_buffer(sima, ar, scene, ibuf, x, y, zoomx, zoomy); /* only draw until running out of time */ if((PIL_check_seconds_timer() - time_current) > 0.25) @@ -667,9 +672,9 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene) if(ibuf==NULL) draw_image_grid(ar, zoomx, zoomy); else if(sima->flag & SI_DRAW_TILE) - draw_image_buffer_repeated(sima, ar, scene, ibuf, zoomx, zoomy); + draw_image_buffer_repeated(sima, ar, scene, ima, ibuf, zoomx, zoomy); else if(ima && (ima->tpageflag & IMA_TILES)) - draw_image_buffer_tiled(sima, ar, ima, ibuf, zoomx, zoomy); + draw_image_buffer_tiled(sima, ar, ima, ibuf, 0.0f, 0.0, zoomx, zoomy); else draw_image_buffer(sima, ar, scene, ibuf, 0.0f, 0.0f, zoomx, zoomy); @@ -699,12 +704,5 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene) } } #endif - -#if 0 - /* it is important to end a view in a transform compatible with buttons */ - bwin_scalematrix(sa->win, sima->blockscale, sima->blockscale, sima->blockscale); - if(!(G.rendering && show_render)) - image_blockhandlers(sa); -#endif } diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 49f950fe67b..7d6faa00dfc 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -327,12 +327,10 @@ static void image_main_area_set_view2d(SpaceImage *sima, ARegion *ar, Scene *sce #endif if(sima->image) { ImBuf *ibuf= ED_space_image_buffer(sima); - float xuser_asp, yuser_asp; - ED_image_aspect(sima->image, &xuser_asp, &yuser_asp); if(ibuf) { - width= ibuf->x*xuser_asp; - height= ibuf->y*yuser_asp; + width= ibuf->x; + height= ibuf->y; } else if(sima->image->type==IMA_TYPE_R_RESULT) { /* not very important, just nice */ @@ -683,7 +681,7 @@ void ED_image_aspect(Image *ima, float *aspx, float *aspy) *aspx= *aspy= 1.0; if((ima == NULL) || (ima->type == IMA_TYPE_R_RESULT) || (ima->type == IMA_TYPE_COMPOSITE) || - (ima->tpageflag & IMA_TILES) || (ima->aspx==0.0 || ima->aspy==0.0)) + (ima->aspx==0.0 || ima->aspy==0.0)) return; /* x is always 1 */ diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index f4cb5afc3c2..e157d7f68f9 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -754,9 +754,10 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) } else if(t->spacetype==SPACE_IMAGE || t->spacetype==SPACE_NODE) { + SpaceImage *sima = sa->spacedata.first; // XXX for now, get View2D from the active region t->view = &ar->v2d; - t->around = ar->v2d.around; + t->around = sima->around; } else { diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 252cd633b69..4a6fdf5a734 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -35,6 +35,8 @@ #include "BKE_context.h" #include "BKE_image.h" +#include "WM_types.h" + #ifdef RNA_RUNTIME static void rna_Image_animated_update(bContext *C, PointerRNA *ptr) @@ -133,16 +135,19 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* imagechanged */ RNA_def_property_ui_text(prop, "Filename", "Image/Movie file name."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_source_items); RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* imagechanged */ RNA_def_property_ui_text(prop, "Source", "Where the image comes from."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* imagechanged */ RNA_def_property_ui_text(prop, "Type", "How to generate the image."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "packedfile"); @@ -152,90 +157,105 @@ static void rna_def_image(BlenderRNA *brna) prop= RNA_def_property(srna, "fields", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_FIELDS); RNA_def_property_ui_text(prop, "Fields", "Use fields of the image."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "odd_fields", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_STD_FIELD); RNA_def_property_ui_text(prop, "Odd Fields", "Standard field toggle."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "antialias", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANTIALI); RNA_def_property_ui_text(prop, "Anti-alias", "Toggles image anti-aliasing, only works with solid colors"); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_DO_PREMUL); RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); /* generated image (image_generated_change_cb) */ prop= RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "gen_type"); RNA_def_property_enum_items(prop, prop_generated_type_items); RNA_def_property_ui_text(prop, "Generated Type", "Generated image type."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "generated_width", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gen_x"); RNA_def_property_range(prop, 1, 16384); RNA_def_property_ui_text(prop, "Generated Width", "Generated image width."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "generated_height", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gen_y"); RNA_def_property_range(prop, 1, 16384); RNA_def_property_ui_text(prop, "Generated Height", "Generated image height."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); /* realtime properties */ prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, prop_mapping_items); RNA_def_property_ui_text(prop, "Mapping", "Mapping type to use for this image in the game engine."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_VECTOR); RNA_def_property_float_sdna(prop, NULL, "aspx"); RNA_def_property_array(prop, 2); RNA_def_property_range(prop, 0.1f, 5000.0f); RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this image, does not affect rendering."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "animated", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TWINANIM); RNA_def_property_ui_text(prop, "Animated", "Use as animated texture in the game engine."); - RNA_def_property_update(prop, 0, "rna_Image_animated_update"); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update"); prop= RNA_def_property(srna, "animation_start", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "twsta"); RNA_def_property_range(prop, 0, 128); RNA_def_property_ui_text(prop, "Animation Start", "Start frame of an animated texture."); - RNA_def_property_update(prop, 0, "rna_Image_animated_update"); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update"); prop= RNA_def_property(srna, "animation_end", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "twend"); RNA_def_property_range(prop, 0, 128); RNA_def_property_ui_text(prop, "Animation End", "End frame of an animated texture."); - RNA_def_property_update(prop, 0, "rna_Image_animated_update"); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update"); prop= RNA_def_property(srna, "animation_speed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "animspeed"); RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_text(prop, "Animation Speed", "Speed of the animation in frames per second."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "tiles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TILES); RNA_def_property_ui_text(prop, "Tiles", "Use of tilemode for faces (default shift-LMB to pick the tile for selected faces)."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "tiles_x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "xrep"); RNA_def_property_range(prop, 1, 16); RNA_def_property_ui_text(prop, "Tiles X", "Degree of repetition in the X direction."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "tiles_y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "yrep"); RNA_def_property_range(prop, 1, 16); RNA_def_property_ui_text(prop, "Tiles Y", "Degree of repetition in the Y direction."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "clamp_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_U); RNA_def_property_ui_text(prop, "Clamp X", "Disable texture repeating horizontally."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "clamp_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_V); RNA_def_property_ui_text(prop, "Clamp Y", "Disable texture repeating vertically."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); } void RNA_def_image(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 66d98d98834..d5ac0d6e427 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -246,19 +246,10 @@ static void rna_def_space_image_uv(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; -#if 0 - static EnumPropertyItem select_mode_items[] = { - {SI_SELECT_VERTEX, "VERTEX", 0, "Vertex", "Vertex selection mode."}, - //{SI_SELECT_EDGE, "Edge", 0, "Edge", "Edge selection mode."}, - {SI_SELECT_FACE, "FACE", 0, "Face", "Face selection mode."}, - {SI_SELECT_ISLAND, "ISLAND", 0, "Island", "Island selection mode."}, - {0, NULL, 0, NULL, NULL}}; -#endif - static EnumPropertyItem sticky_mode_items[] = { - {SI_STICKY_DISABLE, "DISABLED", 0, "Disabled", "Sticky vertex selection disabled."}, - {SI_STICKY_LOC, "SHARED_LOCATION", 0, "SHARED_LOCATION", "Select UVs that are at the same location and share a mesh vertex."}, - {SI_STICKY_VERTEX, "SHARED_VERTEX", 0, "SHARED_VERTEX", "Select UVs that share mesh vertex, irrespective if they are in the same location."}, + {SI_STICKY_DISABLE, "DISABLED", ICON_STICKY_UVS_DISABLE, "Disabled", "Sticky vertex selection disabled."}, + {SI_STICKY_LOC, "SHARED_LOCATION", ICON_STICKY_UVS_LOC, "SHARED_LOCATION", "Select UVs that are at the same location and share a mesh vertex."}, + {SI_STICKY_VERTEX, "SHARED_VERTEX", ICON_STICKY_UVS_VERT, "SHARED_VERTEX", "Select UVs that share mesh vertex, irrespective if they are in the same location."}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem dt_uv_items[] = { @@ -273,17 +264,18 @@ static void rna_def_space_image_uv(BlenderRNA *brna) {SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion between UV and 3D faces."}, {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem pivot_items[] = { + {V3D_CENTER, "CENTER", ICON_ROTATE, "Bounding Box Center", ""}, + {V3D_CENTROID, "MEDIAN", ICON_ROTATECENTER, "Median Point", ""}, + {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""}, + {0, NULL, 0, NULL, NULL}}; + srna= RNA_def_struct(brna, "SpaceUVEditor", NULL); RNA_def_struct_sdna(srna, "SpaceImage"); RNA_def_struct_nested(brna, srna, "SpaceImageEditor"); RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space."); /* selection */ - /*prop= RNA_def_property(srna, "selection_mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "selectmode"); - RNA_def_property_enum_items(prop, select_mode_items); - RNA_def_property_ui_text(prop, "Selection Mode", "UV selection and display mode.");*/ - prop= RNA_def_property(srna, "sticky_selection_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "sticky"); RNA_def_property_enum_items(prop, sticky_mode_items); @@ -313,16 +305,15 @@ static void rna_def_space_image_uv(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw."); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); - prop= RNA_def_property(srna, "draw_modified_edges", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch"); - RNA_def_property_enum_items(prop, dt_uvstretch_items); - RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges from the final mesh after object modifier evaluation."); + prop= RNA_def_property(srna, "draw_modified_edges", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWSHADOW); + RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges after modifiers are applied."); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); - /*prop= RNA_def_property(srna, "local_view", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LOCAL_UV); - RNA_def_property_ui_text(prop, "Local View", "Draw only faces with the currently displayed image assigned."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);*/ + prop= RNA_def_property(srna, "draw_other_objects", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_OTHER); + RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selected objects that share the same image."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); prop= RNA_def_property(srna, "normalized_coordinates", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS); @@ -331,12 +322,6 @@ static void rna_def_space_image_uv(BlenderRNA *brna) /* todo: move edge and face drawing options here from G.f */ - /* editing */ - /*prop= RNA_def_property(srna, "sync_selection", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SYNC_UVSEL); - RNA_def_property_ui_text(prop, "Sync Selection", "Keep UV and edit mode mesh selection in sync."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);*/ - prop= RNA_def_property(srna, "snap_to_pixels", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP); RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixel locations while editing."); @@ -348,6 +333,12 @@ static void rna_def_space_image_uv(BlenderRNA *brna) prop= RNA_def_property(srna, "live_unwrap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP); RNA_def_property_ui_text(prop, "Live Unwrap", "Continuously unwrap the selected UV island while transforming pinned vertices."); + + prop= RNA_def_property(srna, "pivot", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "around"); + RNA_def_property_enum_items(prop, pivot_items); + RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot."); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); } static void rna_def_space_outliner(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index c1c2f9a100a..d8648e05153 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -242,6 +242,13 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "template_layers", "uiTemplateLayers"); api_ui_item_rna_common(func); + + func= RNA_def_function(srna, "template_image_layers", "uiTemplateImageLayers"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); + parm= RNA_def_pointer(func, "image", "Image", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "image_user", "ImageUser", "", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); } #endif -- cgit v1.2.3 From 4771c2358d32e3d83f103abc86f979a0d2041d14 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Tue, 23 Jun 2009 11:00:35 +0000 Subject: 2.5 Icons: * Modifier Icons are now shown in the add modifier menu. --- source/blender/makesrna/intern/rna_modifier.c | 58 +++++++++++++-------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index dab7a94584f..9b3ff6e74a0 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -41,35 +41,35 @@ #include "WM_types.h" EnumPropertyItem modifier_type_items[] ={ - {eModifierType_Armature, "ARMATURE", 0, "Armature", ""}, - {eModifierType_Array, "ARRAY", 0, "Array", ""}, - {eModifierType_Bevel, "BEVEL", 0, "Bevel", ""}, - {eModifierType_Boolean, "BOOLEAN", 0, "Boolean", ""}, - {eModifierType_Build, "BUILD", 0, "Build", ""}, - {eModifierType_Cast, "CAST", 0, "Cast", ""}, - {eModifierType_Cloth, "CLOTH", 0, "Cloth", ""}, - {eModifierType_Collision, "COLLISION", 0, "Collision", ""}, - {eModifierType_Curve, "CURVE", 0, "Curve", ""}, - {eModifierType_Decimate, "DECIMATE", 0, "Decimate", ""}, - {eModifierType_Displace, "DISPLACE", 0, "Displace", ""}, - {eModifierType_EdgeSplit, "EDGE_SPLIT", 0, "Edge Split", ""}, - {eModifierType_Explode, "EXPLODE", 0, "Explode", ""}, - {eModifierType_Fluidsim, "FLUID_SIMULATION", 0, "Fluid Simulation", ""}, - {eModifierType_Hook, "HOOK", 0, "Hook", ""}, - {eModifierType_Lattice, "LATTICE", 0, "Lattice", ""}, - {eModifierType_Mask, "MASK", 0, "Mask", ""}, - {eModifierType_MeshDeform, "MESH_DEFORM", 0, "Mesh Deform", ""}, - {eModifierType_Mirror, "MIRROR", 0, "Mirror", ""}, - {eModifierType_Multires, "MULTIRES", 0, "Multires", ""}, - {eModifierType_ParticleInstance, "PARTICLE_INSTANCE", 0, "Particle Instance", ""}, - {eModifierType_ParticleSystem, "PARTICLE_SYSTEM", 0, "Particle System", ""}, - {eModifierType_Shrinkwrap, "SHRINKWRAP", 0, "Shrinkwrap", ""}, - {eModifierType_SimpleDeform, "SIMPLE_DEFORM", 0, "Simple Deform", ""}, - {eModifierType_Smooth, "SMOOTH", 0, "Smooth", ""}, - {eModifierType_Softbody, "SOFTBODY", 0, "Softbody", ""}, - {eModifierType_Subsurf, "SUBSURF", 0, "Subsurf", ""}, - {eModifierType_UVProject, "UV_PROJECT", 0, "UV Project", ""}, - {eModifierType_Wave, "WAVE", 0, "Wave", ""}, + {eModifierType_Armature, "ARMATURE", ICON_MOD_ARMATURE, "Armature", ""}, + {eModifierType_Array, "ARRAY", ICON_MOD_ARRAY, "Array", ""}, + {eModifierType_Bevel, "BEVEL", ICON_MOD_BEVEL, "Bevel", ""}, + {eModifierType_Boolean, "BOOLEAN", ICON_MOD_BOOLEAN, "Boolean", ""}, + {eModifierType_Build, "BUILD", ICON_MOD_BUILD, "Build", ""}, + {eModifierType_Cast, "CAST", ICON_MOD_CAST, "Cast", ""}, + {eModifierType_Cloth, "CLOTH", ICON_MOD_CLOTH, "Cloth", ""}, + {eModifierType_Collision, "COLLISION", ICON_MOD_PHYSICS, "Collision", ""}, + {eModifierType_Curve, "CURVE", ICON_MOD_CURVE, "Curve", ""}, + {eModifierType_Decimate, "DECIMATE", ICON_MOD_DECIM, "Decimate", ""}, + {eModifierType_Displace, "DISPLACE", ICON_MOD_DISPLACE, "Displace", ""}, + {eModifierType_EdgeSplit, "EDGE_SPLIT", ICON_MOD_EDGESPLIT, "Edge Split", ""}, + {eModifierType_Explode, "EXPLODE", ICON_MOD_EXPLODE, "Explode", ""}, + {eModifierType_Fluidsim, "FLUID_SIMULATION", ICON_MOD_FLUIDSIM, "Fluid Simulation", ""}, + {eModifierType_Hook, "HOOK", ICON_HOOK, "Hook", ""}, + {eModifierType_Lattice, "LATTICE", ICON_MOD_LATTICE, "Lattice", ""}, + {eModifierType_Mask, "MASK", ICON_MOD_MASK, "Mask", ""}, + {eModifierType_MeshDeform, "MESH_DEFORM", ICON_MOD_MESHDEFORM, "Mesh Deform", ""}, + {eModifierType_Mirror, "MIRROR", ICON_MOD_MIRROR, "Mirror", ""}, + {eModifierType_Multires, "MULTIRES", ICON_MOD_MULTIRES, "Multires", ""}, + {eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""}, + {eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""}, + {eModifierType_Shrinkwrap, "SHRINKWRAP", ICON_MOD_SHRINKWRAP, "Shrinkwrap", ""}, + {eModifierType_SimpleDeform, "SIMPLE_DEFORM", ICON_MOD_SIMPLEDEFORM, "Simple Deform", ""}, + {eModifierType_Smooth, "SMOOTH", ICON_MOD_SMOOTH, "Smooth", ""}, + {eModifierType_Softbody, "SOFTBODY", ICON_MOD_SOFT, "Softbody", ""}, + {eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subsurf", ""}, + {eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""}, + {eModifierType_Wave, "WAVE", ICON_MOD_WAVE, "Wave", ""}, {0, NULL, 0, NULL, NULL}}; -- cgit v1.2.3 From a4b0f41a4abb62d305b8a930337577ccc4a2c95b Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Tue, 23 Jun 2009 11:16:27 +0000 Subject: 2.5 Icons: * Added lamp icons. --- source/blender/makesrna/intern/rna_lamp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index 092a5804a74..a49b4377d9d 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -253,11 +253,11 @@ static void rna_def_lamp(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_type_items[] = { - {LA_LOCAL, "POINT", 0, "Point", "Omnidirectional point light source."}, - {LA_SUN, "SUN", 0, "Sun", "Constant direction parallel ray light source."}, - {LA_SPOT, "SPOT", 0, "Spot", "Directional cone light source."}, - {LA_HEMI, "HEMI", 0, "Hemi", "180 degree constant light source."}, - {LA_AREA, "AREA", 0, "Area", "Directional area light source."}, + {LA_LOCAL, "POINT", ICON_LAMP_POINT, "Point", "Omnidirectional point light source."}, + {LA_SUN, "SUN", ICON_LAMP_SUN, "Sun", "Constant direction parallel ray light source."}, + {LA_SPOT, "SPOT", ICON_LAMP_SPOT, "Spot", "Directional cone light source."}, + {LA_HEMI, "HEMI", ICON_LAMP_HEMI, "Hemi", "180 degree constant light source."}, + {LA_AREA, "AREA", ICON_LAMP_AREA, "Area", "Directional area light source."}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Lamp", "ID"); -- cgit v1.2.3 From 502a3849bd0881f74f5a2adc543032a89eede252 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 23 Jun 2009 11:28:48 +0000 Subject: 2.5 - Icons for Modifiers in Modifier Template As per William's mockup - http://www.reynish.com/files/blender25/modifiers.png --- source/blender/editors/interface/interface_templates.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 0bbe0850244..9dd7ae90f20 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -555,7 +555,10 @@ static uiLayout *draw_modifier(uiLayout *layout, Object *ob, ModifierData *md, i uiBlockSetEmboss(block, UI_EMBOSSN); uiDefIconButBitI(block, ICONTOG, eModifierMode_Expanded, 0, ICON_TRIA_RIGHT, 0, 0, UI_UNIT_X, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, "Collapse/Expand Modifier"); } - + + /* modifier-type icon */ + uiDefIconBut(block, BUT, 0, RNA_struct_ui_icon(ptr.type), 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Current Modifier Type"); + uiBlockSetEmboss(block, UI_EMBOSS); if (isVirtual) { @@ -566,7 +569,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Object *ob, ModifierData *md, i uiButSetFunc(but, modifiers_convertToReal, ob, md); } else { uiBlockBeginAlign(block); - uiDefBut(block, TEX, 0, "", 0, 0, buttonWidth-60, UI_UNIT_Y, md->name, 0.0, sizeof(md->name)-1, 0.0, 0.0, "Modifier name"); + uiDefBut(block, TEX, 0, "", 0, 0, buttonWidth-40, UI_UNIT_Y, md->name, 0.0, sizeof(md->name)-1, 0.0, 0.0, "Modifier name"); /* Softbody not allowed in this situation, enforce! */ if (((md->type!=eModifierType_Softbody && md->type!=eModifierType_Collision) || !(ob->pd && ob->pd->deflect)) && (md->type!=eModifierType_Surface)) { -- cgit v1.2.3 From bf74f105bc5ec98980fa087347203244750fb669 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 23 Jun 2009 12:36:15 +0000 Subject: small changes... - allow RNA_property_enum_items to take the totitems int pointer as NULL (spares a loop on all the enum items). this change also makes enums types with no enum array crash in some places, could support these though Id rather disallow them, generating docs is a quick way to test for this. - open recent file operator used and enum to open the recent file without an enum array, changed to an int type. - added space_logic.py poll functions --- source/blender/makesrna/intern/rna_access.c | 34 +++++++++++----------- source/blender/python/intern/bpy_rna.c | 6 ++-- source/blender/windowmanager/intern/wm_operators.c | 4 +-- 3 files changed, 22 insertions(+), 22 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index c806f1885ba..60774c8432c 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -643,25 +643,28 @@ void RNA_property_enum_items(PointerRNA *ptr, PropertyRNA *prop, const EnumPrope if(eprop->itemf) { *item= eprop->itemf(ptr); - for(tot=0; (*item)[tot].identifier; tot++); - *totitem= tot; + if(totitem) { + for(tot=0; (*item)[tot].identifier; tot++); + *totitem= tot; + } } else { *item= eprop->item; - *totitem= eprop->totitem; + if(totitem) + *totitem= eprop->totitem; } } int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value) { const EnumPropertyItem *item; - int totitem, i; + int i; - RNA_property_enum_items(ptr, prop, &item, &totitem); + RNA_property_enum_items(ptr, prop, &item, NULL); - for(i=0; iidentifier; item++) { + if(strcmp(item->identifier, identifier)==0) { + *value = item->value; return 1; } } @@ -693,11 +696,9 @@ int RNA_enum_name(const EnumPropertyItem *item, const int value, const char **na int RNA_property_enum_identifier(PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier) { - const EnumPropertyItem *item; - int totitem; - - RNA_property_enum_items(ptr, prop, &item, &totitem); + const EnumPropertyItem *item= NULL; + RNA_property_enum_items(ptr, prop, &item, NULL); return RNA_enum_identifier(item, value, identifier); } @@ -2067,14 +2068,13 @@ int RNA_enum_is_equal(PointerRNA *ptr, const char *name, const char *enumname) { PropertyRNA *prop= RNA_struct_find_property(ptr, name); const EnumPropertyItem *item; - int a, totitem; if(prop) { - RNA_property_enum_items(ptr, prop, &item, &totitem); + RNA_property_enum_items(ptr, prop, &item, NULL); - for(a=0; aidentifier; item++) + if(strcmp(item->identifier, enumname) == 0) + return (item->value == RNA_property_enum_get(ptr, prop)); printf("RNA_enum_is_equal: %s.%s item %s not found.\n", ptr->type->identifier, name, enumname); return 0; diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 57c7144f949..93a8af8b177 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -46,9 +46,9 @@ static int mathutils_rna_vector_cb_index= -1; /* index for our callbacks */ -static int mathutils_rna_vector_check(PyObject *user) +static int mathutils_rna_vector_check(BPy_PropertyRNA *self) { - return ((BPy_PropertyRNA *)user)->prop?1:0; + return self->prop?1:0; } static int mathutils_rna_vector_get(BPy_PropertyRNA *self, int subtype, float *vec_from) @@ -190,7 +190,7 @@ static char *pyrna_enum_as_string(PointerRNA *ptr, PropertyRNA *prop) const EnumPropertyItem *item; int totitem; - RNA_property_enum_items(ptr, prop, &item, &totitem); + RNA_property_enum_items(ptr, prop, &item, NULL); return (char*)BPy_enum_as_string((EnumPropertyItem*)item); } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 46e9df10adc..33f4ff11679 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -503,7 +503,7 @@ static void WM_OT_read_homefile(wmOperatorType *ot) static int recentfile_exec(bContext *C, wmOperator *op) { - int event= RNA_enum_get(op->ptr, "nr"); + int event= RNA_int_get(op->ptr, "nr"); // XXX wm in context is not set correctly after WM_read_file -> crash // do it before for now, but is this correct with multiple windows? @@ -557,7 +557,7 @@ static void WM_OT_open_recentfile(wmOperatorType *ot) ot->exec= recentfile_exec; ot->poll= WM_operator_winactive; - RNA_def_property(ot->srna, "nr", PROP_ENUM, PROP_NONE); + RNA_def_property(ot->srna, "nr", PROP_INT, PROP_UNSIGNED); } /* ********* main file *********** */ -- cgit v1.2.3 From b4acd77526f32faab0c3d86436eef56096985c3d Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 23 Jun 2009 13:25:31 +0000 Subject: NLA SoC: Big Commit - Restored NLA-Mapping Corrections In TweakMode, the keyframes of the Active Action are now shown (and can be edited) in NLA-mapped time, with appropriate corrections applied when editing. This works in the DopeSheet and Graph Editors :) To do this, got rid of the old wrappers/API-methods, replacing them with new-style ones. A few methods previously (in this branch) used only for evaluation are now used for this purpose too. As the same code is used for editing + evaluation, this should now be much better to work with. I've only done a few brief tests now, but I think I might've muddled the invert-flags on one or two cases which I'll need to check out tomorrow. So, beware that there may be some weird and critical bugs for the next few days here... Also, added proper license headers to new NLA files. TODO: - testing + bugfixing due to this commit - show range of keyframes in NLA Editor active-action line --- source/blender/blenkernel/BKE_action.h | 6 - source/blender/blenkernel/BKE_nla.h | 2 + source/blender/blenkernel/intern/action.c | 42 ------ source/blender/blenkernel/intern/anim_sys.c | 158 ++++----------------- source/blender/blenkernel/intern/fcurve.c | 29 +++- source/blender/blenkernel/intern/nla.c | 136 ++++++++++++++++++ source/blender/blenkernel/nla_private.h | 78 ++++++++++ source/blender/blenloader/intern/readfile.c | 4 + source/blender/editors/animation/anim_draw.c | 72 ++++------ source/blender/editors/animation/keyframes_draw.c | 18 +-- source/blender/editors/include/ED_anim_api.h | 14 +- source/blender/editors/include/ED_keyframes_draw.h | 5 +- source/blender/editors/space_action/action_draw.c | 24 ++-- source/blender/editors/space_action/action_edit.c | 48 ++++--- .../blender/editors/space_action/action_select.c | 45 +++--- source/blender/editors/space_graph/graph_draw.c | 10 +- source/blender/editors/space_graph/graph_edit.c | 51 ++++--- source/blender/editors/space_graph/graph_select.c | 46 +++--- source/blender/editors/transform/transform.c | 58 ++++---- .../editors/transform/transform_conversions.c | 103 ++++++++------ .../blender/editors/transform/transform_generics.c | 31 ---- source/blender/makesdna/DNA_anim_types.h | 29 +++- 22 files changed, 569 insertions(+), 440 deletions(-) create mode 100644 source/blender/blenkernel/nla_private.h (limited to 'source') diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h index 1fb200b94a8..0c9bba5e413 100644 --- a/source/blender/blenkernel/BKE_action.h +++ b/source/blender/blenkernel/BKE_action.h @@ -148,12 +148,6 @@ void copy_pose_result(struct bPose *to, struct bPose *from); /* clear all transforms */ void rest_pose(struct bPose *pose); -/* map global time (frame nr) to strip converted time, doesn't clip */ -float get_action_frame(struct Object *ob, float cframe); -/* map strip time to global time (frame nr) */ -float get_action_frame_inv(struct Object *ob, float cframe); - - /* functions used by the game engine */ void game_copy_pose(struct bPose **dst, struct bPose *src); void game_free_pose(struct bPose *pose); diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 5200ca6d4d7..cc73ac02690 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -73,5 +73,7 @@ void BKE_nla_action_pushdown(struct AnimData *adt); short BKE_nla_tweakmode_enter(struct AnimData *adt); void BKE_nla_tweakmode_exit(struct AnimData *adt); +float BKE_nla_tweakedit_remap(struct AnimData *adt, float cframe, short invert); + #endif diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index f88e249d38c..96896509f60 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -769,48 +769,6 @@ void framechange_poses_clear_unkeyed(void) /* ************** time ****************** */ -static bActionStrip *get_active_strip(Object *ob) -{ -#if 0 // XXX old animation system - bActionStrip *strip; - - if(ob->action==NULL) - return NULL; - - for (strip=ob->nlastrips.first; strip; strip=strip->next) - if(strip->flag & ACTSTRIP_ACTIVE) - break; - - if(strip && strip->act==ob->action) - return strip; -#endif // XXX old animation system - - return NULL; -} - -/* if the conditions match, it converts current time to strip time */ -// TODO: change this adt -float get_action_frame(Object *ob, float cframe) -{ - bActionStrip *strip= get_active_strip(ob); - - //if(strip) - // return get_actionstrip_frame(strip, cframe, 0); - return cframe; -} - -/* inverted, strip time to current time */ -// TODO: change this to adt -float get_action_frame_inv(Object *ob, float cframe) -{ - bActionStrip *strip= get_active_strip(ob); - - //if(strip) - // return get_actionstrip_frame(strip, cframe, 1); - return cframe; -} - - /* Check if the given action has any keyframes */ short action_has_motion(const bAction *act) { diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 7a6706b7c5a..877353a85e9 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1,5 +1,30 @@ -/* Testing code for new animation system in 2.5 - * Copyright 2009, Joshua Leung +/** + * $Id: anim_sys.c 21023 2009-06-20 04:02:49Z aligorith $ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation, Joshua Leung + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Joshua Leung (full recode) + * + * ***** END GPL LICENSE BLOCK ***** */ #include @@ -14,6 +39,8 @@ #include "BLI_arithb.h" #include "BLI_dynstr.h" +#include "DNA_anim_types.h" + #include "BKE_animsys.h" #include "BKE_action.h" #include "BKE_fcurve.h" @@ -25,7 +52,7 @@ #include "RNA_access.h" #include "RNA_types.h" -#include "DNA_anim_types.h" +#include "nla_private.h" /* ***************************************** */ /* AnimData API */ @@ -549,129 +576,6 @@ void animsys_evaluate_action (PointerRNA *ptr, bAction *act, AnimMapper *remap, /* ***************************************** */ /* NLA System - Evaluation */ -/* used for list of strips to accumulate at current time */ -typedef struct NlaEvalStrip { - struct NlaEvalStrip *next, *prev; - - NlaTrack *track; /* track that this strip belongs to */ - NlaStrip *strip; /* strip that's being used */ - - short track_index; /* the index of the track within the list */ - short strip_mode; /* which end of the strip are we looking at */ - - float strip_time; /* time at which which strip is being evaluated */ -} NlaEvalStrip; - -/* NlaEvalStrip->strip_mode */ -enum { - /* standard evaluation */ - NES_TIME_BEFORE = -1, - NES_TIME_WITHIN, - NES_TIME_AFTER, - - /* transition-strip evaluations */ - NES_TIME_TRANSITION_START, - NES_TIME_TRANSITION_END, -} eNlaEvalStrip_StripMode; - - -/* temp channel for accumulating data from NLA (avoids needing to clear all values first) */ -// TODO: maybe this will be used as the 'cache' stuff needed for editable values too? -typedef struct NlaEvalChannel { - struct NlaEvalChannel *next, *prev; - - PointerRNA ptr; /* pointer to struct containing property to use */ - PropertyRNA *prop; /* RNA-property type to use (should be in the struct given) */ - int index; /* array index (where applicable) */ - - float value; /* value of this channel */ -} NlaEvalChannel; - - -/* ---------------------- */ - -/* non clipped mapping for strip-time <-> global time (for Action-Clips) - * invert = convert action-strip time to global time - */ -static float nlastrip_get_frame_actionclip (NlaStrip *strip, float cframe, short invert) -{ - float length, actlength, repeat, scale; - - /* get number of repeats */ - if (IS_EQ(strip->repeat, 0.0f)) strip->repeat = 1.0f; - repeat = strip->repeat; - - /* scaling */ - if (IS_EQ(strip->scale, 0.0f)) strip->scale= 1.0f; - scale = (float)fabs(strip->scale); /* scale must be positive - we've got a special flag for reversing */ - - /* length of referenced action */ - actlength = strip->actend - strip->actstart; - if (IS_EQ(actlength, 0.0f)) actlength = 1.0f; - - /* length of strip */ - length= actlength * scale * repeat; - if (IS_EQ(length, 0.0f)) length= strip->end - strip->start; - - /* reversed = play strip backwards */ - if (strip->flag & NLASTRIP_FLAG_REVERSE) { - /* invert = convert action-strip time to global time */ - if (invert) - return length*(strip->actend - cframe)/(repeat*actlength) + strip->start; - else - return strip->actend - repeat*actlength*(cframe - strip->start)/length; - } - else { - /* invert = convert action-strip time to global time */ - if (invert) - return length*(cframe - strip->actstart)/(repeat*actlength) + strip->start; - else - return repeat*actlength*(cframe - strip->start)/length + strip->actstart; - } -} - -/* non clipped mapping for strip-time <-> global time (for Transitions) - * invert = convert action-strip time to global time - */ -static float nlastrip_get_frame_transition (NlaStrip *strip, float cframe, short invert) -{ - float length; - - /* length of strip */ - length= strip->end - strip->start; - - /* reversed = play strip backwards */ - if (strip->flag & NLASTRIP_FLAG_REVERSE) { - /* invert = convert within-strip-time to global time */ - if (invert) - return strip->end - (length * cframe); - else - return (strip->end - cframe) / length; - } - else { - /* invert = convert within-strip-time to global time */ - if (invert) - return (length * cframe) + strip->start; - else - return (cframe - strip->start) / length; - } -} - -/* non clipped mapping for strip-time <-> global time - * invert = convert action-strip time to global time - */ -static float nlastrip_get_frame (NlaStrip *strip, float cframe, short invert) -{ - switch (strip->type) { - case NLASTRIP_TYPE_TRANSITION: /* transition */ - return nlastrip_get_frame_transition(strip, cframe, invert); - - case NLASTRIP_TYPE_CLIP: /* action-clip (default) */ - default: - return nlastrip_get_frame_actionclip(strip, cframe, invert); - } -} - /* calculate influence of strip based for given frame based on blendin/out values */ static float nlastrip_get_influence (NlaStrip *strip, float cframe) { @@ -695,7 +599,7 @@ static float nlastrip_get_influence (NlaStrip *strip, float cframe) } /* evaluate the evaluation time and influence for the strip, storing the results in the strip */ -void nlastrip_evaluate_controls (NlaStrip *strip, float ctime) +static void nlastrip_evaluate_controls (NlaStrip *strip, float ctime) { /* firstly, analytically generate values for influence and time (if applicable) */ if ((strip->flag & NLASTRIP_FLAG_USR_TIME) == 0) diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 856930e5a44..27ca6332cdc 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1,5 +1,30 @@ -/* Testing code for new animation system in 2.5 - * Copyright 2009, Joshua Leung +/** + * $Id: fcurve.c 21023 2009-06-20 04:02:49Z aligorith $ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation, Joshua Leung + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Joshua Leung (full recode) + * + * ***** END GPL LICENSE BLOCK ***** */ diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 1ce6d9f98c7..a5b3b59d310 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -49,6 +49,9 @@ #include "BKE_object.h" #include "BKE_utildefines.h" +#include "RNA_access.h" +#include "nla_private.h" + #ifdef HAVE_CONFIG_H #include @@ -318,6 +321,135 @@ NlaStrip *add_nlastrip_to_stack (AnimData *adt, bAction *act) return strip; } +/* *************************************************** */ +/* NLA Evaluation <-> Editing Stuff */ + +/* Strip Mapping ------------------------------------- */ + +/* non clipped mapping for strip-time <-> global time (for Action-Clips) + * invert = convert action-strip time to global time + */ +static float nlastrip_get_frame_actionclip (NlaStrip *strip, float cframe, short invert) +{ + float length, actlength, repeat, scale; + + /* get number of repeats */ + if (IS_EQ(strip->repeat, 0.0f)) strip->repeat = 1.0f; + repeat = strip->repeat; + + /* scaling */ + if (IS_EQ(strip->scale, 0.0f)) strip->scale= 1.0f; + scale = (float)fabs(strip->scale); /* scale must be positive - we've got a special flag for reversing */ + + /* length of referenced action */ + actlength = strip->actend - strip->actstart; + if (IS_EQ(actlength, 0.0f)) actlength = 1.0f; + + /* length of strip */ + length= actlength * scale * repeat; + if (IS_EQ(length, 0.0f)) length= strip->end - strip->start; + + /* reversed = play strip backwards */ + if (strip->flag & NLASTRIP_FLAG_REVERSE) { + /* invert = convert action-strip time to global time */ + if (invert) + return length*(strip->actend - cframe)/(repeat*actlength) + strip->start; + else + return strip->actend - repeat*actlength*(cframe - strip->start)/length; + } + else { + /* invert = convert action-strip time to global time */ + if (invert) + return length*(cframe - strip->actstart)/(repeat*actlength) + strip->start; + else + return repeat*actlength*(cframe - strip->start)/length + strip->actstart; + } +} + +/* non clipped mapping for strip-time <-> global time (for Transitions) + * invert = convert action-strip time to global time + */ +static float nlastrip_get_frame_transition (NlaStrip *strip, float cframe, short invert) +{ + float length; + + /* length of strip */ + length= strip->end - strip->start; + + /* reversed = play strip backwards */ + if (strip->flag & NLASTRIP_FLAG_REVERSE) { + /* invert = convert within-strip-time to global time */ + if (invert) + return strip->end - (length * cframe); + else + return (strip->end - cframe) / length; + } + else { + /* invert = convert within-strip-time to global time */ + if (invert) + return (length * cframe) + strip->start; + else + return (cframe - strip->start) / length; + } +} + +/* non clipped mapping for strip-time <-> global time + * invert = convert action-strip time to global time + * + * only secure for 'internal' (i.e. within AnimSys evaluation) operations, + * but should not be directly relied on for stuff which interacts with editors + */ +float nlastrip_get_frame (NlaStrip *strip, float cframe, short invert) +{ + switch (strip->type) { + case NLASTRIP_TYPE_TRANSITION: /* transition */ + return nlastrip_get_frame_transition(strip, cframe, invert); + + case NLASTRIP_TYPE_CLIP: /* action-clip (default) */ + default: + return nlastrip_get_frame_actionclip(strip, cframe, invert); + } +} + + +/* Non clipped mapping for strip-time <-> global time + * invert = convert strip-time to global time + * + * Public API method - perform this mapping using the given AnimData block + * and perform any necessary sanity checks on the value + */ +float BKE_nla_tweakedit_remap (AnimData *adt, float cframe, short invert) +{ + NlaStrip *strip; + + /* sanity checks + * - obviously we've got to have some starting data + * - when not in tweakmode, the active Action does not have any scaling applied :) + */ + if ((adt == NULL) || (adt->flag & ADT_NLA_EDIT_ON)==0) + return cframe; + + /* if the active-strip info has been stored already, access this, otherwise look this up + * and store for (very probable) future usage + */ + if (adt->actstrip == NULL) { + NlaTrack *nlt= BKE_nlatrack_find_active(adt); + adt->actstrip= BKE_nlastrip_find_active(nlt); + } + strip= adt->actstrip; + + /* sanity checks + * - in rare cases, we may not be able to find this strip for some reason (internal error) + * - for now, if the user has defined a curve to control the time, this correction cannot be performed + * reliably... + */ + if ((strip == NULL) || (strip->flag & NLASTRIP_FLAG_USR_TIME)) + return cframe; + + /* perform the correction now... */ + return nlastrip_get_frame(strip, cframe, invert); +} + /* *************************************************** */ /* Basic Utilities */ @@ -693,9 +825,11 @@ short BKE_nla_tweakmode_enter (AnimData *adt) * - 'real' active action to temp storage (no need to change user-counts) * - action of active strip set to be the 'active action', and have its usercount incremented * - editing-flag for this AnimData block should also get turned on (for more efficient restoring) + * - take note of the active strip for mapping-correction of keyframes in the action being edited */ adt->tmpact= adt->action; adt->action= activeStrip->act; + adt->actstrip= activeStrip; id_us_plus(&activeStrip->act->id); adt->flag |= ADT_NLA_EDIT_ON; @@ -734,10 +868,12 @@ void BKE_nla_tweakmode_exit (AnimData *adt) * - 'real' active action is restored from storage * - storage pointer gets cleared (to avoid having bad notes hanging around) * - editing-flag for this AnimData block should also get turned off + * - clear pointer to active strip */ if (adt->action) adt->action->id.us--; adt->action= adt->tmpact; adt->tmpact= NULL; + adt->actstrip= NULL; adt->flag &= ~ADT_NLA_EDIT_ON; } diff --git a/source/blender/blenkernel/nla_private.h b/source/blender/blenkernel/nla_private.h new file mode 100644 index 00000000000..af886fb7de8 --- /dev/null +++ b/source/blender/blenkernel/nla_private.h @@ -0,0 +1,78 @@ +/** + * $Id: BKE_nla.h 20999 2009-06-19 04:45:56Z aligorith $ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation, Joshua Leung + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Joshua Leung (full recode) + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef NLA_PRIVATE +#define NLA_PRIVATE + +/* --------------- NLA Evaluation DataTypes ----------------------- */ + +/* used for list of strips to accumulate at current time */ +typedef struct NlaEvalStrip { + struct NlaEvalStrip *next, *prev; + + NlaTrack *track; /* track that this strip belongs to */ + NlaStrip *strip; /* strip that's being used */ + + short track_index; /* the index of the track within the list */ + short strip_mode; /* which end of the strip are we looking at */ + + float strip_time; /* time at which which strip is being evaluated */ +} NlaEvalStrip; + +/* NlaEvalStrip->strip_mode */ +enum { + /* standard evaluation */ + NES_TIME_BEFORE = -1, + NES_TIME_WITHIN, + NES_TIME_AFTER, + + /* transition-strip evaluations */ + NES_TIME_TRANSITION_START, + NES_TIME_TRANSITION_END, +} eNlaEvalStrip_StripMode; + + +/* temp channel for accumulating data from NLA (avoids needing to clear all values first) */ +// TODO: maybe this will be used as the 'cache' stuff needed for editable values too? +typedef struct NlaEvalChannel { + struct NlaEvalChannel *next, *prev; + + PointerRNA ptr; /* pointer to struct containing property to use */ + PropertyRNA *prop; /* RNA-property type to use (should be in the struct given) */ + int index; /* array index (where applicable) */ + + float value; /* value of this channel */ +} NlaEvalChannel; + +/* --------------- NLA Functions (not to be used as a proper API) ----------------------- */ + +/* convert from strip time <-> global time */ +float nlastrip_get_frame(NlaStrip *strip, float cframe, short invert); + +#endif // NLA_PRIVATE diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index af4f61fccc4..d7f60e1928b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1933,6 +1933,10 @@ static void direct_link_animdata(FileData *fd, AnimData *adt) /* link NLA-data */ link_list(fd, &adt->nla_tracks); direct_link_nladata(fd, &adt->nla_tracks); + + /* clear temp pointers that may have been set... */ + // TODO: it's probably only a small cost to reload this anyway... + adt->actstrip= NULL; } /* ************ READ NODE TREE *************** */ diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index c176f20c26b..6d079fe148a 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -43,10 +43,12 @@ #include "BLI_blenlib.h" +#include "BKE_animsys.h" #include "BKE_action.h" #include "BKE_context.h" #include "BKE_global.h" #include "BKE_fcurve.h" +#include "BKE_nla.h" #include "BKE_object.h" #include "BKE_screen.h" #include "BKE_utildefines.h" @@ -232,37 +234,16 @@ void ANIM_draw_previewrange (const bContext *C, View2D *v2d) /* *************************************************** */ /* NLA-MAPPING UTILITIES (required for drawing and also editing keyframes) */ -/* Obtain the Object providing NLA-scaling for the given channel (if applicable) */ -Object *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale) +/* Obtain the AnimData block providing NLA-mapping for the given channel (if applicable) */ +AnimData *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale) { /* sanity checks */ if (ac == NULL) return NULL; /* handling depends on the type of animation-context we've got */ - if (ac->datatype == ANIMCONT_ACTION) { - /* Action Editor (action mode) or Graph Editor (ipo mode): - * Only use if editor is not pinned, and active object has action - */ - if (ac->obact && ac->obact->action) { - SpaceAction *saction= (SpaceAction *)ac->sa->spacedata.first; - - if (saction->pin == 0) - return ac->obact; - } - } - else if ((ac->datatype == ANIMCONT_DOPESHEET) && (ale)) { - /* Dopesheet: - * Only if channel is available, and is owned by an Object with an Action - */ - if ((ale->id) && (GS(ale->id->name) == ID_OB)) { - Object *ob= (Object *)ale->id; - - if (ob->action) - return ob; - } - } - // XXX todo: add F-Curves mode (Graph Editor) ... + if (ale && ale->id) + return BKE_animdata_from_id(ale->id); /* no appropriate object found */ return NULL; @@ -273,7 +254,8 @@ Object *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale) * (where this is called) is single-threaded anyway */ // XXX was called: map_active_strip() -void ANIM_nla_mapping_draw(gla2DDrawInfo *di, Object *ob, short restore) +// TODO: should this be depreceated? +void ANIM_nla_mapping_draw(gla2DDrawInfo *di, AnimData *adt, short restore) { static rctf stored; @@ -288,8 +270,8 @@ void ANIM_nla_mapping_draw(gla2DDrawInfo *di, Object *ob, short restore) gla2DGetMap(di, &stored); map= stored; - map.xmin= get_action_frame(ob, map.xmin); - map.xmax= get_action_frame(ob, map.xmax); + map.xmin= BKE_nla_tweakedit_remap(adt, map.xmin, 0); + map.xmax= BKE_nla_tweakedit_remap(adt, map.xmax, 0); if (map.xmin == map.xmax) map.xmax += 1.0f; gla2DSetMap(di, &map); @@ -298,36 +280,38 @@ void ANIM_nla_mapping_draw(gla2DDrawInfo *di, Object *ob, short restore) /* ------------------- */ -/* helper function for ANIM_nla_mapping_apply_ipocurve() -> "restore", i.e. mapping points back to IPO-time */ +/* helper function for ANIM_nla_mapping_apply_fcurve() -> "restore", i.e. mapping points back to action-time */ static short bezt_nlamapping_restore(BeztEditData *bed, BezTriple *bezt) { - /* object providing scaling is stored in 'data', only_keys option is stored in i1 */ - Object *ob= (Object *)bed->data; + /* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */ + AnimData *adt= (AnimData *)bed->data; short only_keys= (short)bed->i1; /* adjust BezTriple handles only if allowed to */ if (only_keys == 0) { - bezt->vec[0][0]= get_action_frame(ob, bezt->vec[0][0]); - bezt->vec[2][0]= get_action_frame(ob, bezt->vec[2][0]); - } - bezt->vec[1][0]= get_action_frame(ob, bezt->vec[1][0]); + bezt->vec[0][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[0][0], 0); + bezt->vec[2][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[2][0], 0); + } + + bezt->vec[1][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[1][0], 0); return 0; } -/* helper function for ANIM_nla_mapping_apply_ipocurve() -> "apply", i.e. mapping points to NLA-mapped global time */ +/* helper function for ANIM_nla_mapping_apply_fcurve() -> "apply", i.e. mapping points to NLA-mapped global time */ static short bezt_nlamapping_apply(BeztEditData *bed, BezTriple *bezt) { - /* object providing scaling is stored in 'data', only_keys option is stored in i1 */ - Object *ob= (Object *)bed->data; + /* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */ + AnimData *adt= (AnimData *)bed->data; short only_keys= (short)bed->i1; /* adjust BezTriple handles only if allowed to */ if (only_keys == 0) { - bezt->vec[0][0]= get_action_frame_inv(ob, bezt->vec[0][0]); - bezt->vec[2][0]= get_action_frame_inv(ob, bezt->vec[2][0]); + bezt->vec[0][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[0][0], 1); + bezt->vec[2][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[2][0], 1); } - bezt->vec[1][0]= get_action_frame_inv(ob, bezt->vec[1][0]); + + bezt->vec[1][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[1][0], 1); return 0; } @@ -338,17 +322,17 @@ static short bezt_nlamapping_apply(BeztEditData *bed, BezTriple *bezt) * - restore = whether to map points back to non-mapped time * - only_keys = whether to only adjust the location of the center point of beztriples */ -void ANIM_nla_mapping_apply_fcurve(Object *ob, FCurve *fcu, short restore, short only_keys) +void ANIM_nla_mapping_apply_fcurve (AnimData *adt, FCurve *fcu, short restore, short only_keys) { BeztEditData bed; BeztEditFunc map_cb; /* init edit data - * - ob is stored in 'data' + * - AnimData is stored in 'data' * - only_keys is stored in 'i1' */ memset(&bed, 0, sizeof(BeztEditData)); - bed.data= (void *)ob; + bed.data= (void *)adt; bed.i1= (int)only_keys; /* get editing callback */ diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 144cd68f6df..07db47c8fed 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -451,7 +451,7 @@ void ob_to_keylist(Object *ob, ListBase *keys, ListBase *blocks, ActKeysInc *aki /* Add action keyframes */ if (ob->adt && ob->adt->action) - action_nlascaled_to_keylist(ob, ob->adt->action, keys, blocks, aki); + action_nlascaled_to_keylist(ob->adt, ob->adt->action, keys, blocks, aki); /* Add shapekey keyframes (only if dopesheet allows, if it is available) */ // TODO: when we adapt NLA system, this needs to be the NLA-scaled version @@ -602,34 +602,34 @@ void action_to_keylist(bAction *act, ListBase *keys, ListBase *blocks, ActKeysIn } } -void action_nlascaled_to_keylist(Object *ob, bAction *act, ListBase *keys, ListBase *blocks, ActKeysInc *aki) +void action_nlascaled_to_keylist(AnimData *adt, bAction *act, ListBase *keys, ListBase *blocks, ActKeysInc *aki) { FCurve *fcu; - Object *oldob= NULL; + AnimData *oldadt= NULL; - /* although apply and clearing NLA-scaling pre-post creating keylist does impact on performance, + /* although apply and clearing NLA-mapping pre-post creating keylist does impact on performance, * the effects should be fairly minimal, as we're already going through the keyframes multiple times * already for blocks too... */ if (act) { /* if 'aki' is provided, store it's current ob to restore later as it might not be the same */ if (aki) { - oldob= aki->ob; - aki->ob= ob; + oldadt= aki->adt; + aki->adt= adt; } /* loop through F-Curves * - scaling correction only does times for center-points, so should be faster */ for (fcu= act->curves.first; fcu; fcu= fcu->next) { - ANIM_nla_mapping_apply_fcurve(ob, fcu, 0, 1); + ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1); fcurve_to_keylist(fcu, keys, blocks, aki); - ANIM_nla_mapping_apply_fcurve(ob, fcu, 1, 1); + ANIM_nla_mapping_apply_fcurve(adt, fcu, 1, 1); } /* if 'aki' is provided, restore ob */ if (aki) - aki->ob= oldob; + aki->adt= oldadt; } } diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 8c54c4e8f67..4bfcbde8f1e 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -310,16 +310,14 @@ void ipo_rainbow(int cur, int tot, float *out); /* ------------- NLA-Mapping ----------------------- */ /* anim_draw.c */ -// XXX these need attention for the new editing method... +/* Obtain the AnimData block providing NLA-scaling for the given channel if applicable */ +struct AnimData *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale); -/* Obtain the Object providing NLA-scaling for the given channel if applicable */ -struct Object *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale); +/* Set/clear temporary mapping of coordinates from 'local-action' time to 'global-nla-mapped' time */ +void ANIM_nla_mapping_draw(struct gla2DDrawInfo *di, struct AnimData *adt, short restore); -/* Set/clear temporary mapping of coordinates from 'local-action' time to 'global-nla-scaled' time */ -void ANIM_nla_mapping_draw(struct gla2DDrawInfo *di, struct Object *ob, short restore); - -/* Apply/Unapply NLA mapping to all keyframes in the nominated IPO block */ -void ANIM_nla_mapping_apply_fcurve(struct Object *ob, struct FCurve *fcu, short restore, short only_keys); +/* Apply/Unapply NLA mapping to all keyframes in the nominated F-Curve */ +void ANIM_nla_mapping_apply_fcurve(struct AnimData *adt, struct FCurve *fcu, short restore, short only_keys); /* ------------- Utility macros ----------------------- */ diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h index 81420ac95e5..153b10cf832 100644 --- a/source/blender/editors/include/ED_keyframes_draw.h +++ b/source/blender/editors/include/ED_keyframes_draw.h @@ -30,6 +30,7 @@ #ifndef ED_KEYFRAMES_DRAW_H #define ED_KEYFRAMES_DRAW_H +struct AnimData; struct BezTriple; struct FCurve; struct gla2DDrawInfo; @@ -69,7 +70,7 @@ typedef struct ActKeyBlock { /* Inclusion-Range Limiting Struct (optional) */ typedef struct ActKeysInc { struct bDopeSheet *ads; /* dopesheet data (for dopesheet mode) */ - struct Object *ob; /* owner object for NLA-scaling info (if Object channels, is just Object) */ + struct AnimData *adt; /* owner for NLA-mapping info */ short actmode; /* mode of the Action Editor (-1 is for NLA) */ float start, end; /* frames (global-time) to only consider keys between */ // XXX not used anymore! @@ -89,7 +90,7 @@ void draw_gpl_channel(struct gla2DDrawInfo *di, ActKeysInc *aki, struct bGPDlaye void fcurve_to_keylist(struct FCurve *fcu, ListBase *keys, ListBase *blocks, ActKeysInc *aki); void agroup_to_keylist(struct bActionGroup *agrp, ListBase *keys, ListBase *blocks, ActKeysInc *aki); void action_to_keylist(struct bAction *act, ListBase *keys, ListBase *blocks, ActKeysInc *aki); -void action_nlascaled_to_keylist(struct Object *ob, struct bAction *act, ListBase *keys, ListBase *blocks, ActKeysInc *aki); +void action_nlascaled_to_keylist(struct AnimData *adt, struct bAction *act, ListBase *keys, ListBase *blocks, ActKeysInc *aki); void ob_to_keylist(struct Object *ob, ListBase *keys, ListBase *blocks, ActKeysInc *aki); void scene_to_keylist(struct Scene *sce, ListBase *keys, ListBase *blocks, ActKeysInc *aki); void gpl_to_keylist(struct bGPDlayer *gpl, ListBase *keys, ListBase *blocks, ActKeysInc *aki); diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 6eae581aa40..61048598644 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -964,7 +964,7 @@ ActKeysInc *init_aki_data(bAnimContext *ac, bAnimListElem *ale) return NULL; /* if strip is mapped, store settings */ - aki.ob= ANIM_nla_mapping_get(ac, ale); + aki.adt= ANIM_nla_mapping_get(ac, ale); if (ac->datatype == ANIMCONT_DOPESHEET) aki.ads= (bDopeSheet *)ac->data; @@ -985,7 +985,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) int filter; View2D *v2d= &ar->v2d; - Object *nob= NULL; + AnimData *adt= NULL; gla2DDrawInfo *di; rcti scr_rct; @@ -1016,18 +1016,18 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) /* if in NLA there's a strip active, map the view */ if (ac->datatype == ANIMCONT_ACTION) { - nob= ANIM_nla_mapping_get(ac, NULL); + adt= ANIM_nla_mapping_get(ac, NULL); - if (nob) - ANIM_nla_mapping_draw(di, nob, 0); + if (adt) + ANIM_nla_mapping_draw(di, adt, 0); /* start and end of action itself */ calc_action_range(ac->data, &sta, &end, 0); gla2DDrawTranslatePt(di, sta, 0.0f, &act_start, &dummy); gla2DDrawTranslatePt(di, end, 0.0f, &act_end, &dummy); - if (nob) - ANIM_nla_mapping_draw(di, nob, 1); + if (adt) + ANIM_nla_mapping_draw(di, adt, 1); } /* build list of channels to draw */ @@ -1191,10 +1191,10 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) /* check if anything to show for this channel */ if (ale->datatype != ALE_NONE) { ActKeysInc *aki= init_aki_data(ac, ale); - nob= ANIM_nla_mapping_get(ac, ale); + adt= ANIM_nla_mapping_get(ac, ale); - if (nob) - ANIM_nla_mapping_draw(di, nob, 0); + if (adt) + ANIM_nla_mapping_draw(di, adt, 0); /* draw 'keyframes' for each specific datatype */ switch (ale->datatype) { @@ -1218,8 +1218,8 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) break; } - if (nob) - ANIM_nla_mapping_draw(di, nob, 1); + if (adt) + ANIM_nla_mapping_draw(di, adt, 1); } } diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index deaa6597bd2..272ef3222ce 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -67,6 +67,7 @@ #include "BKE_fcurve.h" #include "BKE_key.h" #include "BKE_material.h" +#include "BKE_nla.h" #include "BKE_object.h" #include "BKE_context.h" #include "BKE_report.h" @@ -112,16 +113,16 @@ static void get_keyframe_extents (bAnimContext *ac, float *min, float *max) if (anim_data.first) { /* go through channels, finding max extents */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); FCurve *fcu= (FCurve *)ale->key_data; float tmin, tmax; /* get range and apply necessary scaling before */ calc_fcurve_range(fcu, &tmin, &tmax); - if (nob) { - tmin= get_action_frame_inv(nob, tmin); - tmax= get_action_frame_inv(nob, tmax); + if (adt) { + tmin= BKE_nla_tweakedit_remap(adt, tmin, 1); + tmax= BKE_nla_tweakedit_remap(adt, tmax, 1); } /* try to set cur using these values, if they're more extreme than previously set values */ @@ -400,14 +401,14 @@ static void insert_action_keys(bAnimContext *ac, short mode) /* insert keyframes */ for (ale= anim_data.first; ale; ale= ale->next) { - //Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); FCurve *fcu= (FCurve *)ale->key_data; /* adjust current frame for NLA-scaling */ - //if (nob) - // cfra= get_action_frame(nob, CFRA); - //else - // cfra= (float)CFRA; + if (adt) + cfra= BKE_nla_tweakedit_remap(adt, (float)CFRA, 1); + else + cfra= (float)CFRA; /* if there's an id */ if (ale->id) @@ -1054,8 +1055,17 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *op) filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - for (ale= anim_data.first; ale; ale= ale->next) - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_calc_average, NULL); + for (ale= anim_data.first; ale; ale= ale->next) { + AnimData *adt= ANIM_nla_mapping_get(&ac, ale); + + if (adt) { + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_calc_average, NULL); + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); + } + else + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_calc_average, NULL); + } BLI_freelistN(&anim_data); @@ -1125,12 +1135,12 @@ static void snap_action_keys(bAnimContext *ac, short mode) /* snap keyframes */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); - if (nob) { - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 1); + if (adt) { + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 1); + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } //else if (ale->type == ACTTYPE_GPLAYER) // snap_gplayer_frames(ale->data, mode); @@ -1241,12 +1251,12 @@ static void mirror_action_keys(bAnimContext *ac, short mode) /* mirror keyframes */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); - if (nob) { - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 1); + if (adt) { + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 1); + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } //else if (ale->type == ACTTYPE_GPLAYER) // snap_gplayer_frames(ale->data, mode); diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 4cb39712f84..3583d16fd8c 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -64,6 +64,7 @@ #include "BKE_fcurve.h" #include "BKE_key.h" #include "BKE_material.h" +#include "BKE_nla.h" #include "BKE_object.h" #include "BKE_context.h" #include "BKE_utildefines.h" @@ -245,7 +246,7 @@ static void borderselect_action (bAnimContext *ac, rcti rect, short mode, short /* loop over data, doing border select */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); /* get new vertical minimum extent of channel */ ymin= ymax - ACHANNEL_STEP; @@ -253,9 +254,9 @@ static void borderselect_action (bAnimContext *ac, rcti rect, short mode, short /* set horizontal range (if applicable) */ if (ELEM(mode, ACTKEYS_BORDERSEL_FRAMERANGE, ACTKEYS_BORDERSEL_ALLKEYS)) { /* if channel is mapped in NLA, apply correction */ - if (nob) { - bed.f1= get_action_frame(nob, rectf.xmin); - bed.f2= get_action_frame(nob, rectf.xmax); + if (adt) { + bed.f1= BKE_nla_tweakedit_remap(adt, rectf.xmin, 0); + bed.f2= BKE_nla_tweakedit_remap(adt, rectf.xmax, 0); } else { bed.f1= rectf.xmin; @@ -413,12 +414,12 @@ static void markers_selectkeys_between (bAnimContext *ac) /* select keys in-between */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); - if (nob) { - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 1); + if (adt) { + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 1); + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } else { ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); @@ -495,15 +496,15 @@ static void columnselect_action_keys (bAnimContext *ac, short mode) ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); /* loop over cfraelems (stored in the BeztEditData->list) * - we need to do this here, as we can apply fewer NLA-mapping conversions */ for (ce= bed.list.first; ce; ce= ce->next) { /* set frame for validation callback to refer to */ - if (nob) - bed.f1= get_action_frame(nob, ce->cfra); + if (adt) + bed.f1= BKE_nla_tweakedit_remap(adt, ce->cfra, 0); else bed.f1= ce->cfra; @@ -658,12 +659,12 @@ static void actkeys_mselect_leftright (bAnimContext *ac, short leftright, short /* select keys on the side where most data occurs */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); - if (nob) { - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 1); + if (adt) { + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 1); + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } //else if (ale->type == ANIMTYPE_GPLAYER) // borderselect_gplayer_frames(ale->data, min, max, SELECT_ADD); @@ -702,11 +703,11 @@ static void actkeys_mselect_column(bAnimContext *ac, short select_mode, float se ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); /* set frame for validation callback to refer to */ - if (nob) - bed.f1= get_action_frame(nob, selx); + if (adt) + bed.f1= BKE_nla_tweakedit_remap(adt, selx, 0); else bed.f1= selx; @@ -771,15 +772,15 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short select_mode, } else { /* found match - must return here... */ - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); ActKeysInc *aki= init_aki_data(ac, ale); ActKeyColumn *ak; float xmin, xmax; /* apply NLA-scaling correction? */ - if (nob) { - xmin= get_action_frame(nob, rectf.xmin); - xmax= get_action_frame(nob, rectf.xmax); + if (adt) { + xmin= BKE_nla_tweakedit_remap(adt, rectf.xmin, 0); + xmax= BKE_nla_tweakedit_remap(adt, rectf.xmax, 0); } else { xmin= rectf.xmin; diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index acf712d0147..d9e12afc947 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -836,11 +836,11 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri for (ale=anim_data.first; ale; ale=ale->next) { FCurve *fcu= (FCurve *)ale->key_data; FModifier *fcm= fcurve_find_active_modifier(fcu); - //Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); /* map keyframes for drawing if scaled F-Curve */ - //if (nob) - // ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 0); + if (adt) + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 0); /* draw curve: * - curve line may be result of one or more destructive modifiers or just the raw data, @@ -918,8 +918,8 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri } /* undo mapping of keyframes for drawing if scaled F-Curve */ - //if (nob) - // ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 0); + if (adt) + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 0); } /* free list of curves */ diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 8903d95b288..a1888e252d2 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -67,6 +67,7 @@ #include "BKE_fcurve.h" #include "BKE_key.h" #include "BKE_material.h" +#include "BKE_nla.h" #include "BKE_object.h" #include "BKE_context.h" #include "BKE_report.h" @@ -114,16 +115,16 @@ static void get_graph_keyframe_extents (bAnimContext *ac, float *xmin, float *xm if (anim_data.first) { /* go through channels, finding max extents */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= NULL; //ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); FCurve *fcu= (FCurve *)ale->key_data; float txmin, txmax, tymin, tymax; /* get range and apply necessary scaling before */ calc_fcurve_bounds(fcu, &txmin, &txmax, &tymin, &tymax); - if (nob) { - txmin= get_action_frame_inv(nob, txmin); - txmax= get_action_frame_inv(nob, txmax); + if (adt) { + txmin= BKE_nla_tweakedit_remap(adt, txmin, 1); + txmax= BKE_nla_tweakedit_remap(adt, txmax, 1); } /* try to set cur using these values, if they're more extreme than previously set values */ @@ -271,6 +272,7 @@ static void create_ghost_curves (bAnimContext *ac, int start, int end) for (ale= anim_data.first; ale; ale= ale->next) { FCurve *fcu= (FCurve *)ale->key_data; FCurve *gcu= MEM_callocN(sizeof(FCurve), "Ghost FCurve"); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); ChannelDriver *driver= fcu->driver; FPoint *fpt; int cfra; @@ -286,8 +288,10 @@ static void create_ghost_curves (bAnimContext *ac, int start, int end) /* use the sampling callback at 1-frame intervals from start to end frames */ for (cfra= start; cfra <= end; cfra++, fpt++) { - fpt->vec[0]= (float)cfra; - fpt->vec[1]= fcurve_samplingcb_evalcurve(fcu, NULL, (float)cfra); + float cfrae= BKE_nla_tweakedit_remap(adt, cfra, 1); + + fpt->vec[0]= cfrae; + fpt->vec[1]= fcurve_samplingcb_evalcurve(fcu, NULL, cfrae); } /* set color of ghost curve @@ -403,6 +407,7 @@ static int graphkeys_click_insert_exec (bContext *C, wmOperator *op) { bAnimContext ac; bAnimListElem *ale; + AnimData *adt; float frame, val; /* get animation context */ @@ -420,6 +425,10 @@ static int graphkeys_click_insert_exec (bContext *C, wmOperator *op) frame= RNA_float_get(op->ptr, "frame"); val= RNA_float_get(op->ptr, "value"); + /* apply inverse NLA-mapping to frame to get correct time in un-scaled action */ + adt= ANIM_nla_mapping_get(&ac, ale); + frame= BKE_nla_tweakedit_remap(adt, frame, 1); + /* insert keyframe on the specified frame + value */ insert_vert_fcurve((FCurve *)ale->data, frame, val, 0); @@ -1336,8 +1345,18 @@ static int graphkeys_framejump_exec(bContext *C, wmOperator *op) filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - for (ale= anim_data.first; ale; ale= ale->next) - ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_calc_average, NULL); + for (ale= anim_data.first; ale; ale= ale->next) { + AnimData *adt= ANIM_nla_mapping_get(&ac, ale); + + if (adt) { + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_calc_average, NULL); + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); + } + else + ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, bezt_calc_average, NULL); + + } BLI_freelistN(&anim_data); @@ -1405,12 +1424,12 @@ static void snap_graph_keys(bAnimContext *ac, short mode) /* snap keyframes */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); - if (nob) { - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 1); + if (adt) { + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 1); + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } else ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); @@ -1516,12 +1535,12 @@ static void mirror_graph_keys(bAnimContext *ac, short mode) /* mirror keyframes */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); - if (nob) { - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 1); + if (adt) { + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 1); + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } else ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve); diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 632ce30863d..4451cfae227 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -63,6 +63,7 @@ #include "BKE_fcurve.h" #include "BKE_key.h" #include "BKE_material.h" +#include "BKE_nla.h" #include "BKE_object.h" #include "BKE_context.h" #include "BKE_utildefines.h" @@ -231,14 +232,14 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho /* loop over data, doing border select */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); /* set horizontal range (if applicable) */ if (mode != BEZT_OK_VALUERANGE) { /* if channel is mapped in NLA, apply correction */ - if (nob) { - bed.f1= get_action_frame(nob, rectf.xmin); - bed.f2= get_action_frame(nob, rectf.xmax); + if (adt) { + bed.f1= BKE_nla_tweakedit_remap(adt, rectf.xmin, 0); + bed.f2= BKE_nla_tweakedit_remap(adt, rectf.xmax, 0); } else { bed.f1= rectf.xmin; @@ -379,12 +380,12 @@ static void markers_selectkeys_between (bAnimContext *ac) /* select keys in-between */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); - if (nob) { - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 1); + if (adt) { + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 1); + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } else { ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); @@ -450,15 +451,15 @@ static void columnselect_graph_keys (bAnimContext *ac, short mode) ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); /* loop over cfraelems (stored in the BeztEditData->list) * - we need to do this here, as we can apply fewer NLA-mapping conversions */ for (ce= bed.list.first; ce; ce= ce->next) { /* set frame for validation callback to refer to */ - if (nob) - bed.f1= get_action_frame(nob, ce->cfra); + if (ale) + bed.f1= BKE_nla_tweakedit_remap(adt, ce->cfra, 0); else bed.f1= ce->cfra; @@ -566,11 +567,16 @@ static short findnearest_fcurve_vert (bAnimContext *ac, int mval[2], FCurve **fc for (ale= anim_data.first; ale; ale= ale->next) { FCurve *fcu= (FCurve *)ale->key_data; + AnimData *adt= ANIM_nla_mapping_get(ac, ale); /* try to progressively get closer to the right point... */ if (fcu->bezt) { BezTriple *bezt1=fcu->bezt, *prevbezt=NULL; + /* apply NLA mapping to all the keyframes */ + if (adt) + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); + for (i=0; i < fcu->totvert; i++, prevbezt=bezt1, bezt1++) { /* convert beztriple points to screen-space */ UI_view2d_to_region_no_clip(v2d, bezt1->vec[0][0], bezt1->vec[0][1], &sco[0][0], &sco[0][1]); @@ -624,6 +630,10 @@ static short findnearest_fcurve_vert (bAnimContext *ac, int mval[2], FCurve **fc } } } + + /* un-apply NLA mapping from all the keyframes */ + if (adt) + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } } @@ -767,12 +777,12 @@ static void graphkeys_mselect_leftright (bAnimContext *ac, short leftright, shor /* select keys on the side where most data occurs */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); - if (nob) { - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 1); + if (adt) { + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); - ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 1); + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } else ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL); @@ -827,11 +837,11 @@ static void graphkeys_mselect_column (bAnimContext *ac, int mval[2], short selec ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); /* set frame for validation callback to refer to */ - if (nob) - bed.f1= get_action_frame(nob, selx); + if (adt) + bed.f1= BKE_nla_tweakedit_remap(adt, selx, 0); else bed.f1= selx; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index fa93d2a143d..f115bb9a068 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -45,6 +45,7 @@ #include "MEM_guardedalloc.h" +#include "DNA_anim_types.h" #include "DNA_armature_types.h" #include "DNA_action_types.h" /* for some special action-editor settings */ #include "DNA_constraint_types.h" @@ -76,9 +77,9 @@ //#include "BIF_editmesh.h" //#include "BIF_editsima.h" //#include "BIF_editparticle.h" -//#include "BIF_editaction.h" -#include "BKE_action.h" /* get_action_frame */ +#include "BKE_action.h" +#include "BKE_nla.h" //#include "BKE_bad_level_calls.h"/* popmenu and error */ #include "BKE_bmesh.h" #include "BKE_context.h" @@ -89,7 +90,6 @@ #include "BKE_utildefines.h" #include "BKE_context.h" -//#include "BSE_editaction_types.h" //#include "BSE_view.h" #include "ED_image.h" @@ -4354,7 +4354,7 @@ static short getAnimEdit_DrawTime(TransInfo *t) /* This function is used by Animation Editor specific transform functions to do * the Snap Keyframe to Nearest Frame/Marker */ -static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, Object *ob, short autosnap) +static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, AnimData *adt, short autosnap) { /* snap key to nearest frame? */ if (autosnap == SACTSNAP_FRAME) { @@ -4364,8 +4364,8 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, Object *ob, short double val; /* convert frame to nla-action time (if needed) */ - if (ob) - val= get_action_frame_inv(ob, *(td->val)); + if (adt) + val= BKE_nla_tweakedit_remap(adt, *(td->val), 1); else val= *(td->val); @@ -4376,8 +4376,8 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, Object *ob, short val= (float)( floor(val+0.5f) ); /* convert frame out of nla-action time */ - if (ob) - *(td->val)= get_action_frame(ob, val); + if (adt) + *(td->val)= BKE_nla_tweakedit_remap(adt, val, 0); else *(td->val)= val; } @@ -4386,8 +4386,8 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, Object *ob, short float val; /* convert frame to nla-action time (if needed) */ - if (ob) - val= get_action_frame_inv(ob, *(td->val)); + if (adt) + val= BKE_nla_tweakedit_remap(adt, *(td->val), 1); else val= *(td->val); @@ -4396,8 +4396,8 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, Object *ob, short val= (float)ED_markers_find_nearest_marker_time(&t->scene->markers, val); /* convert frame out of nla-action time */ - if (ob) - *(td->val)= get_action_frame(ob, val); + if (adt) + *(td->val)= BKE_nla_tweakedit_remap(adt, val, 0); else *(td->val)= val; } @@ -4473,10 +4473,10 @@ static void applyTimeTranslate(TransInfo *t, float sval) /* it is assumed that td->ob is a pointer to the object, * whose active action is where this keyframe comes from */ - Object *ob= td->ob; + AnimData *adt= td->extra; - /* check if any need to apply nla-scaling */ - if (ob) { + /* check if any need to apply nla-mapping */ + if (adt) { deltax = t->values[0]; if (autosnap == SACTSNAP_STEP) { @@ -4486,9 +4486,9 @@ static void applyTimeTranslate(TransInfo *t, float sval) deltax= (float)( floor(deltax + 0.5f) ); } - val = get_action_frame_inv(ob, td->ival); + val = BKE_nla_tweakedit_remap(adt, td->ival, 1); val += deltax; - *(td->val) = get_action_frame(ob, val); + *(td->val) = BKE_nla_tweakedit_remap(adt, val, 0); } else { deltax = val = t->values[0]; @@ -4504,7 +4504,7 @@ static void applyTimeTranslate(TransInfo *t, float sval) } /* apply nearest snapping */ - doAnimEdit_SnapFrame(t, td, ob, autosnap); + doAnimEdit_SnapFrame(t, td, adt, autosnap); } } @@ -4604,15 +4604,15 @@ static void applyTimeSlide(TransInfo *t, float sval) /* it doesn't matter whether we apply to t->data or t->data2d, but t->data2d is more convenient */ for (i = 0 ; i < t->total; i++, td++) { - /* it is assumed that td->ob is a pointer to the object, + /* it is assumed that td->extra is a pointer to the AnimData, * whose active action is where this keyframe comes from */ - Object *ob= td->ob; + AnimData *adt= td->extra; float cval = t->values[0]; - /* apply scaling to necessary values */ - if (ob) - cval= get_action_frame(ob, cval); + /* apply NLA-mapping to necessary values */ + if (adt) + cval= BKE_nla_tweakedit_remap(adt, cval, 0); /* only apply to data if in range */ if ((sval > minx) && (sval < maxx)) { @@ -4707,10 +4707,10 @@ static void applyTimeScale(TransInfo *t) { for (i = 0 ; i < t->total; i++, td++) { - /* it is assumed that td->ob is a pointer to the object, + /* it is assumed that td->extra is a pointer to the AnimData, * whose active action is where this keyframe comes from */ - Object *ob= td->ob; + AnimData *adt= td->extra; float startx= CFRA; float fac= t->values[0]; @@ -4721,9 +4721,9 @@ static void applyTimeScale(TransInfo *t) { fac= (float)( floor(fac + 0.5f) ); } - /* check if any need to apply nla-scaling */ - if (ob) - startx= get_action_frame(ob, startx); + /* check if any need to apply nla-mapping */ + if (adt) + startx= BKE_nla_tweakedit_remap(adt, startx, 0); /* now, calculate the new value */ *(td->val) = td->ival - startx; @@ -4731,7 +4731,7 @@ static void applyTimeScale(TransInfo *t) { *(td->val) += startx; /* apply nearest snapping */ - doAnimEdit_SnapFrame(t, td, ob, autosnap); + doAnimEdit_SnapFrame(t, td, adt, autosnap); } } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index cb210a37bf4..fc5a6b85de4 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -90,6 +90,7 @@ #include "BKE_mball.h" #include "BKE_mesh.h" #include "BKE_modifier.h" +#include "BKE_nla.h" #include "BKE_object.h" #include "BKE_particle.h" #include "BKE_sequence.h" @@ -2857,12 +2858,12 @@ static void posttrans_action_clean (bAnimContext *ac, bAction *act) * - all keyframes are converted in/out of global time */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(ac, ale); + AnimData *adt= ANIM_nla_mapping_get(ac, ale); - if (nob) { - //ANIM_nla_mapping_apply_ipocurve(nob, ale->key_data, 0, 1); + if (adt) { + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); posttrans_fcurve_clean(ale->key_data); - //ANIM_nla_mapping_apply_ipocurve(nob, ale->key_data, 1, 1); + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } else posttrans_fcurve_clean(ale->key_data); @@ -2920,17 +2921,16 @@ static int count_gplayer_frames(bGPDlayer *gpl, char side, float cfra) } /* This function assigns the information to transdata */ -static void TimeToTransData(TransData *td, float *time, Object *ob) +static void TimeToTransData(TransData *td, float *time, AnimData *adt) { /* memory is calloc'ed, so that should zero everything nicely for us */ td->val = time; td->ival = *(time); - /* store the Object where this keyframe exists as a keyframe of the - * active action as td->ob. Usually, this member is only used for constraints - * drawing + /* store the AnimData where this keyframe exists as a keyframe of the + * active action as td->extra. */ - td->ob= ob; + td->extra= adt; } /* This function advances the address to which td points to, so it must return @@ -2940,7 +2940,7 @@ static void TimeToTransData(TransData *td, float *time, Object *ob) * The 'side' argument is needed for the extend mode. 'B' = both sides, 'R'/'L' mean only data * on the named side are used. */ -static TransData *FCurveToTransData(TransData *td, FCurve *fcu, Object *ob, char side, float cfra) +static TransData *FCurveToTransData(TransData *td, FCurve *fcu, AnimData *adt, char side, float cfra) { BezTriple *bezt; int i; @@ -2954,13 +2954,13 @@ static TransData *FCurveToTransData(TransData *td, FCurve *fcu, Object *ob, char /* only add if on the right 'side' of the current frame */ if (FrameOnMouseSide(side, bezt->vec[1][0], cfra)) { /* each control point needs to be added separetely */ - TimeToTransData(td, bezt->vec[0], ob); + TimeToTransData(td, bezt->vec[0], adt); td++; - TimeToTransData(td, bezt->vec[1], ob); + TimeToTransData(td, bezt->vec[1], adt); td++; - TimeToTransData(td, bezt->vec[2], ob); + TimeToTransData(td, bezt->vec[2], adt); td++; } } @@ -3068,13 +3068,13 @@ static void createTransActionData(bContext *C, TransInfo *t) /* loop 1: fully select ipo-keys and count how many BezTriples are selected */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(&ac, ale); + AnimData *adt= ANIM_nla_mapping_get(&ac, ale); /* convert current-frame to action-time (slightly less accurate, espcially under * higher scaling ratios, but is faster than converting all points) */ - if (nob) - cfra = get_action_frame(nob, (float)CFRA); + if (adt) + cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, 0); else cfra = (float)CFRA; @@ -3121,18 +3121,18 @@ static void createTransActionData(bContext *C, TransInfo *t) // tfd += i; //} //else { - Object *nob= ANIM_nla_mapping_get(&ac, ale); + AnimData *adt= ANIM_nla_mapping_get(&ac, ale); FCurve *fcu= (FCurve *)ale->key_data; /* convert current-frame to action-time (slightly less accurate, espcially under * higher scaling ratios, but is faster than converting all points) */ - if (nob) - cfra = get_action_frame(nob, (float)CFRA); + if (adt) + cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, 0); else cfra = (float)CFRA; - td= FCurveToTransData(td, fcu, nob, side, cfra); + td= FCurveToTransData(td, fcu, adt, side, cfra); //} } @@ -3164,23 +3164,23 @@ static void createTransActionData(bContext *C, TransInfo *t) /* Helper function for createTransGraphEditData, which is reponsible for associating * source data with transform data */ -static void bezt_to_transdata (TransData *td, TransData2D *td2d, Object *nob, float *loc, float *cent, short selected, short ishandle, short intvals) +static void bezt_to_transdata (TransData *td, TransData2D *td2d, AnimData *adt, float *loc, float *cent, short selected, short ishandle, short intvals) { /* New location from td gets dumped onto the old-location of td2d, which then * gets copied to the actual data at td2d->loc2d (bezt->vec[n]) * - * Due to NLA scaling, we apply NLA scaling to some of the verts here, - * and then that scaling will be undone after transform is done. + * Due to NLA mapping, we apply NLA mapping to some of the verts here, + * and then that mapping will be undone after transform is done. */ - if (nob) { - td2d->loc[0] = get_action_frame_inv(nob, loc[0]); + if (adt) { + td2d->loc[0] = BKE_nla_tweakedit_remap(adt, loc[0], 0); td2d->loc[1] = loc[1]; td2d->loc[2] = 0.0f; td2d->loc2d = loc; td->loc = td2d->loc; - td->center[0] = get_action_frame_inv(nob, cent[0]); + td->center[0] = BKE_nla_tweakedit_remap(adt, cent[0], 0); td->center[1] = cent[1]; td->center[2] = 0.0f; @@ -3201,6 +3201,9 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, Object *nob, fl td->axismtx[2][2] = 1.0f; td->ext= NULL; td->tdi= NULL; td->val= NULL; + + /* store AnimData info in td->extra, for applying mapping when flushing */ + td->extra= adt; if (selected) { td->flag |= TD_SELECTED; @@ -3261,14 +3264,14 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) /* loop 1: count how many BezTriples (specifically their verts) are selected (or should be edited) */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= NULL; //ANIM_nla_mapping_get(&ac, ale); // XXX we don't handle NLA mapping for now here... + AnimData *adt= ANIM_nla_mapping_get(&ac, ale); FCurve *fcu= (FCurve *)ale->key_data; /* convert current-frame to action-time (slightly less accurate, espcially under * higher scaling ratios, but is faster than converting all points) */ - if (nob) - cfra = get_action_frame(nob, (float)CFRA); + if (adt) + cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, 1); else cfra = (float)CFRA; @@ -3318,13 +3321,19 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) td2d= t->data2d; /* loop 2: build transdata arrays */ - cfra = (float)CFRA; - for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= NULL; //ANIM_nla_mapping_get(&ac, ale); // XXX we don't handle NLA mapping here yet + AnimData *adt= ANIM_nla_mapping_get(&ac, ale); FCurve *fcu= (FCurve *)ale->key_data; short intvals= (fcu->flag & FCURVE_INT_VALUES); + /* convert current-frame to action-time (slightly less accurate, espcially under + * higher scaling ratios, but is faster than converting all points) + */ + if (adt) + cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, 1); + else + cfra = (float)CFRA; + /* only include BezTriples whose 'keyframe' occurs on the same side of the current frame as mouse (if applicable) */ bezt= fcu->bezt; prevbezt= NULL; @@ -3338,7 +3347,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) if ( (!prevbezt && (bezt->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ)) ) { if (bezt->f1 & SELECT) { hdata = initTransDataCurveHandes(td, bezt); - bezt_to_transdata(td++, td2d++, nob, bezt->vec[0], bezt->vec[1], 1, 1, intvals); + bezt_to_transdata(td++, td2d++, adt, bezt->vec[0], bezt->vec[1], 1, 1, intvals); } else h1= 0; @@ -3347,7 +3356,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) if (bezt->f3 & SELECT) { if (hdata==NULL) hdata = initTransDataCurveHandes(td, bezt); - bezt_to_transdata(td++, td2d++, nob, bezt->vec[2], bezt->vec[1], 1, 1, intvals); + bezt_to_transdata(td++, td2d++, adt, bezt->vec[2], bezt->vec[1], 1, 1, intvals); } else h2= 0; @@ -3363,7 +3372,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) hdata = initTransDataCurveHandes(td, bezt); } - bezt_to_transdata(td++, td2d++, nob, bezt->vec[1], bezt->vec[1], 1, 0, intvals); + bezt_to_transdata(td++, td2d++, adt, bezt->vec[1], bezt->vec[1], 1, 0, intvals); } /* special hack (must be done after initTransDataCurveHandes(), as that stores handle settings to restore...): @@ -3587,6 +3596,8 @@ void flushTransGraphData(TransInfo *t) /* flush to 2d vector from internally used 3d vector */ for (a=0, td= t->data, td2d=t->data2d; atotal; a++, td++, td2d++) { + AnimData *adt= (AnimData *)td->extra; /* pointers to relevant AnimData blocks are stored in the td->extra pointers */ + /* handle snapping for time values * - we should still be in NLA-mapping timespace * - only apply to keyframes (but never to handles) @@ -3604,9 +3615,9 @@ void flushTransGraphData(TransInfo *t) } /* we need to unapply the nla-scaling from the time in some situations */ - //if (NLA_IPO_SCALED) - // td2d->loc2d[0]= get_action_frame(OBACT, td2d->loc[0]); - //else + if (adt) + td2d->loc2d[0]= BKE_nla_tweakedit_remap(adt, td2d->loc[0], 0); + else td2d->loc2d[0]= td2d->loc[0]; /* if int-values only, truncate to integers */ @@ -4584,16 +4595,16 @@ void special_aftertrans_update(TransInfo *t) /* these should all be ipo-blocks */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(&ac, ale); + AnimData *adt= ANIM_nla_mapping_get(&ac, ale); FCurve *fcu= (FCurve *)ale->key_data; if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 && ((cancelled == 0) || (duplicate)) ) { - if (nob) { - ANIM_nla_mapping_apply_fcurve(nob, fcu, 0, 1); + if (adt) { + ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1); posttrans_fcurve_clean(fcu); - ANIM_nla_mapping_apply_fcurve(nob, fcu, 1, 1); + ANIM_nla_mapping_apply_fcurve(adt, fcu, 1, 1); } else posttrans_fcurve_clean(fcu); @@ -4695,16 +4706,16 @@ void special_aftertrans_update(TransInfo *t) /* these should all be ipo-blocks */ for (ale= anim_data.first; ale; ale= ale->next) { - Object *nob= ANIM_nla_mapping_get(&ac, ale); + AnimData *adt= ANIM_nla_mapping_get(&ac, ale); FCurve *fcu= (FCurve *)ale->key_data; if ( (sipo->flag & SIPO_NOTRANSKEYCULL)==0 && ((cancelled == 0) || (duplicate)) ) { - if (nob) { - ANIM_nla_mapping_apply_fcurve(nob, fcu, 0, 1); + if (adt) { + ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1); posttrans_fcurve_clean(fcu); - ANIM_nla_mapping_apply_fcurve(nob, fcu, 1, 1); + ANIM_nla_mapping_apply_fcurve(adt, fcu, 1, 1); } else posttrans_fcurve_clean(fcu); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 4c9592fb27a..a60135107bc 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -272,37 +272,6 @@ void recalcData(TransInfo *t) Scene *scene = t->scene; Base *base; -#if 0 // TRANSFORM_FIX_ME - if (t->spacetype == SPACE_ACTION) { - Object *ob= OBACT; - void *data; - short context; - - /* determine what type of data we are operating on */ - data = get_action_context(&context); - if (data == NULL) return; - - /* always flush data if gpencil context */ - if (context == ACTCONT_GPENCIL) { - flushTransGPactionData(t); - } - - if (G.saction->lock) { - if (context == ACTCONT_ACTION) { - if(ob) { - ob->ctime= -1234567.0f; - if(ob->pose || ob_get_key(ob)) - DAG_object_flush_update(G.scene, ob, OB_RECALC); - else - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - } - } - else if (context == ACTCONT_SHAPEKEY) { - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_OB|OB_RECALC_DATA); - } - } - } -#endif if (t->obedit) { } else if(G.f & G_PARTICLEEDIT) { diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index a784adaf35f..2b089530236 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -1,5 +1,28 @@ -/* Testing code for new animation system in 2.5 - * Copyright 2009, Joshua Leung +/** + * $Id: DNA_anim_types.h 21023 2009-06-20 04:02:49Z aligorith $ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation, Joshua Leung + * All rights reserved. + * + * Contributor(s): Joshua Leung (full recode) + * + * ***** END GPL LICENSE BLOCK ***** */ #ifndef DNA_ANIM_TYPES_H @@ -668,6 +691,8 @@ typedef struct AnimData { /* nla-tracks */ ListBase nla_tracks; + /* active NLA-strip (only set/used during tweaking, so no need to worry about dangling pointers) */ + NlaStrip *actstrip; /* 'drivers' for this ID-block's settings - FCurves, but are completely * separate from those for animation data -- cgit v1.2.3 From eb22a7b2102cceb432e3545cd342956e92873a49 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 23 Jun 2009 13:34:45 +0000 Subject: PyRNA API support for matrix types as Mathutils matrix (with callbacks) rather then a generic rna sequence of floats. Any 3x3 or 4x4 rna matrix will automatically be returned as a Mathutils matrix. This makes useful stuff like multiplying a vector location by an object matrix possible. ob = bpy.data.scenes[0].objects[0] print (ob.data.verts[0].co * ob.matrix) Also added mathutils matrix types to the BGE GameObject.localOrientation, worldOrientation * MT_Matrix3x3 added getValue3x3 and setValue3x3, assumed a 4x3 float array. * KX_GameObject.cpp convenience functions NodeSetGlobalOrientation, NodeGetLocalOrientation, NodeGetLocalScaling, NodeGetLocalPosition. * 2.5 python api now initializes modules BGL, Mathutils and Geometry * modules py3 PyModuleDef's use PyModuleDef_HEAD_INIT, rather then {}, was making msvc fail to build. * added macros for Vector_ReadCallback, Vector_WriteCallback etc. to check if the callback pointer is set before calling the function. --- source/blender/python/generic/BGL.c | 2 +- source/blender/python/generic/Geometry.c | 2 +- source/blender/python/generic/Mathutils.c | 114 ++++++++------ source/blender/python/generic/Mathutils.h | 29 +++- source/blender/python/generic/matrix.c | 224 ++++++++++++++++++++++++--- source/blender/python/generic/matrix.h | 21 +-- source/blender/python/generic/quat.c | 3 +- source/blender/python/generic/vector.c | 43 ++--- source/blender/python/generic/vector.h | 6 +- source/blender/python/intern/bpy_interface.c | 13 +- source/blender/python/intern/bpy_rna.c | 64 ++++++-- source/gameengine/Ketsji/KX_GameObject.cpp | 140 +++++++++++++---- source/gameengine/Ketsji/KX_GameObject.h | 21 +-- 13 files changed, 510 insertions(+), 172 deletions(-) (limited to 'source') diff --git a/source/blender/python/generic/BGL.c b/source/blender/python/generic/BGL.c index 360fcbd1c6b..a90fabd3586 100644 --- a/source/blender/python/generic/BGL.c +++ b/source/blender/python/generic/BGL.c @@ -1087,7 +1087,7 @@ static struct PyMethodDef BGL_methods[] = { #if (PY_VERSION_HEX >= 0x03000000) static struct PyModuleDef BGL_module_def = { - {}, /* m_base */ + PyModuleDef_HEAD_INIT, "BGL", /* m_name */ 0, /* m_doc */ 0, /* m_size */ diff --git a/source/blender/python/generic/Geometry.c b/source/blender/python/generic/Geometry.c index f1662d7655d..ec76675f652 100644 --- a/source/blender/python/generic/Geometry.c +++ b/source/blender/python/generic/Geometry.c @@ -80,7 +80,7 @@ struct PyMethodDef M_Geometry_methods[] = { #if (PY_VERSION_HEX >= 0x03000000) static struct PyModuleDef M_Geometry_module_def = { - {}, /* m_base */ + PyModuleDef_HEAD_INIT, "Geometry", /* m_name */ M_Geometry_doc, /* m_doc */ 0, /* m_size */ diff --git a/source/blender/python/generic/Mathutils.c b/source/blender/python/generic/Mathutils.c index fa85d031afc..cd9705236d7 100644 --- a/source/blender/python/generic/Mathutils.c +++ b/source/blender/python/generic/Mathutils.c @@ -96,7 +96,7 @@ struct PyMethodDef M_Mathutils_methods[] = { #if (PY_VERSION_HEX >= 0x03000000) static struct PyModuleDef M_Mathutils_module_def = { - {}, /* m_base */ + PyModuleDef_HEAD_INIT, "Mathutils", /* m_name */ M_Mathutils_doc, /* m_doc */ 0, /* m_size */ @@ -137,6 +137,8 @@ PyObject *Mathutils_Init(const char *from) PyModule_AddObject( submodule, "Euler", (PyObject *)&euler_Type ); PyModule_AddObject( submodule, "Quaternion", (PyObject *)&quaternion_Type ); + mathutils_matrix_vector_cb_index= Mathutils_RegisterCallback(&mathutils_matrix_vector_cb); + return (submodule); } @@ -1164,62 +1166,76 @@ int Mathutils_RegisterCallback(Mathutils_Callback *cb) return i; } -int Vector_ReadCallback(VectorObject *self) { - if(self->user) { - Mathutils_Callback *cb= mathutils_callbacks[self->callback_type]; - if(cb->get(self->user, self->subtype, self->vec)) { - return 1; - } - else { - PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); - return 0; - } +/* use macros to check for NULL */ +int _Vector_ReadCallback(VectorObject *self) +{ + Mathutils_Callback *cb= mathutils_callbacks[self->cb_type]; + if(cb->get(self->cb_user, self->cb_subtype, self->vec)) { + return 1; + } + else { + PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); + return 0; } - - return 1; /* no user continue silently */ } -int Vector_WriteCallback(VectorObject *self) { - if(self->user) { - Mathutils_Callback *cb= mathutils_callbacks[self->callback_type]; - if(cb->set(self->user, self->subtype, self->vec)) { - return 1; - } - else { - PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); - return 0; - } +int _Vector_WriteCallback(VectorObject *self) +{ + Mathutils_Callback *cb= mathutils_callbacks[self->cb_type]; + if(cb->set(self->cb_user, self->cb_subtype, self->vec)) { + return 1; + } + else { + PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); + return 0; } - - return 1; /* no user continue silently */ } -int Vector_ReadIndexCallback(VectorObject *self, int index) { - if(self->user) { - Mathutils_Callback *cb= mathutils_callbacks[self->callback_type]; - if(cb->get_index(self->user, self->subtype, self->vec, index)) { - return 1; - } - else { - PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); - return 0; - } +int _Vector_ReadIndexCallback(VectorObject *self, int index) +{ + Mathutils_Callback *cb= mathutils_callbacks[self->cb_type]; + if(cb->get_index(self->cb_user, self->cb_subtype, self->vec, index)) { + return 1; + } + else { + PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); + return 0; } - - return 1; /* no user continue silently */ } -int Vector_WriteIndexCallback(VectorObject *self, int index) { - if(self->user) { - Mathutils_Callback *cb= mathutils_callbacks[self->callback_type]; - if(cb->set_index(self->user, self->subtype, self->vec, index)) { - return 1; - } - else { - PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); - return 0; - } +int _Vector_WriteIndexCallback(VectorObject *self, int index) +{ + Mathutils_Callback *cb= mathutils_callbacks[self->cb_type]; + if(cb->set_index(self->cb_user, self->cb_subtype, self->vec, index)) { + return 1; + } + else { + PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); + return 0; + } +} + +/* matrix callbacks */ +int _Matrix_ReadCallback(MatrixObject *self) +{ + Mathutils_Callback *cb= mathutils_callbacks[self->cb_type]; + if(cb->get(self->cb_user, self->cb_subtype, self->contigPtr)) { + return 1; + } + else { + PyErr_SetString(PyExc_SystemError, "Matrix user has become invalid"); + return 0; + } +} + +int _Matrix_WriteCallback(MatrixObject *self) +{ + Mathutils_Callback *cb= mathutils_callbacks[self->cb_type]; + if(cb->set(self->cb_user, self->cb_subtype, self->contigPtr)) { + return 1; + } + else { + PyErr_SetString(PyExc_SystemError, "Matrix user has become invalid"); + return 0; } - - return 1; /* no user continue silently */ } diff --git a/source/blender/python/generic/Mathutils.h b/source/blender/python/generic/Mathutils.h index 6c769c7729b..a89b779ecbb 100644 --- a/source/blender/python/generic/Mathutils.h +++ b/source/blender/python/generic/Mathutils.h @@ -67,17 +67,30 @@ int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps); typedef struct Mathutils_Callback Mathutils_Callback; struct Mathutils_Callback { int (*check)(PyObject *user); /* checks the user is still valid */ - int (*get)(PyObject *user, int subtype, float *vec_from); /* gets the vector from the user */ - int (*set)(PyObject *user, int subtype, float *vec_to); /* sets the users vector values once the vector is modified */ - int (*get_index)(PyObject *user, int subtype, float *vec_from, int index); /* same as above but only for an index */ - int (*set_index)(PyObject *user, int subtype, float *vec_to, int index); /* same as above but only for an index */ + int (*get)(PyObject *user, int subtype, float *from); /* gets the vector from the user */ + int (*set)(PyObject *user, int subtype, float *to); /* sets the users vector values once the vector is modified */ + int (*get_index)(PyObject *user, int subtype, float *from,int index); /* same as above but only for an index */ + int (*set_index)(PyObject *user, int subtype, float *to, int index); /* same as above but only for an index */ }; int Mathutils_RegisterCallback(Mathutils_Callback *cb); -int Vector_ReadCallback(VectorObject *self); -int Vector_WriteCallback(VectorObject *self); -int Vector_ReadIndexCallback(VectorObject *self, int index); -int Vector_WriteIndexCallback(VectorObject *self, int index); +int _Vector_ReadCallback(VectorObject *self); +int _Vector_WriteCallback(VectorObject *self); +int _Vector_ReadIndexCallback(VectorObject *self, int index); +int _Vector_WriteIndexCallback(VectorObject *self, int index); + +/* since this is called so often avoid where possible */ +#define Vector_ReadCallback(_self) (((_self)->cb_user ? _Vector_ReadCallback(_self):1)) +#define Vector_WriteCallback(_self) (((_self)->cb_user ?_Vector_WriteCallback(_self):1)) +#define Vector_ReadIndexCallback(_self, _index) (((_self)->cb_user ? _Vector_ReadIndexCallback(_self, _index):1)) +#define Vector_WriteIndexCallback(_self, _index) (((_self)->cb_user ? _Vector_WriteIndexCallback(_self, _index):1)) + + +int _Matrix_ReadCallback(MatrixObject *self); +int _Matrix_WriteCallback(MatrixObject *self); + +#define Matrix_ReadCallback(_self) (((_self)->cb_user ?_Matrix_ReadCallback(_self):1)) +#define Matrix_WriteCallback(_self) (((_self)->cb_user ?_Matrix_WriteCallback(_self):1)) #endif /* EXPP_Mathutils_H */ diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c index c1e36cf7c56..db5b4ab08bf 100644 --- a/source/blender/python/generic/matrix.c +++ b/source/blender/python/generic/matrix.c @@ -33,6 +33,69 @@ static PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vec); /* utility func */ + +/* matrix vector callbacks */ +int mathutils_matrix_vector_cb_index= -1; + +static int mathutils_matrix_vector_check(MatrixObject *self) +{ + return Matrix_ReadCallback(self); +} + +static int mathutils_matrix_vector_get(MatrixObject *self, int subtype, float *vec_from) +{ + int i; + if(!Matrix_ReadCallback(self)) + return 0; + + for(i=0; icolSize; i++) + vec_from[i]= self->matrix[subtype][i]; + + return 1; +} + +static int mathutils_matrix_vector_set(MatrixObject *self, int subtype, float *vec_to) +{ + int i; + if(!Matrix_ReadCallback(self)) + return 0; + + for(i=0; icolSize; i++) + self->matrix[subtype][i]= vec_to[i]; + + Matrix_WriteCallback(self); + return 1; +} + +static int mathutils_matrix_vector_get_index(MatrixObject *self, int subtype, float *vec_from, int index) +{ + if(!Matrix_ReadCallback(self)) + return 0; + + vec_from[index]= self->matrix[subtype][index]; + return 1; +} + +static int mathutils_matrix_vector_set_index(MatrixObject *self, int subtype, float *vec_to, int index) +{ + if(!Matrix_ReadCallback(self)) + return 0; + + self->matrix[subtype][index]= vec_to[index]; + + Matrix_WriteCallback(self); + return 1; +} + +Mathutils_Callback mathutils_matrix_vector_cb = { + mathutils_matrix_vector_check, + mathutils_matrix_vector_get, + mathutils_matrix_vector_set, + mathutils_matrix_vector_get_index, + mathutils_matrix_vector_set_index +}; +/* matrix vector callbacks, this is so you can do matrix[i][j] = val */ + /*-------------------------DOC STRINGS ---------------------------*/ static char Matrix_Zero_doc[] = "() - set all values in the matrix to 0"; static char Matrix_Identity_doc[] = "() - set the square matrix to it's identity matrix"; @@ -101,6 +164,8 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) argObject = PyTuple_GET_ITEM(args, 0); if(MatrixObject_Check(argObject)){ mat = (MatrixObject*)argObject; + if(!Matrix_ReadCallback(mat)) + return NULL; argSize = mat->rowSize; //rows seqSize = mat->colSize; //col @@ -160,6 +225,9 @@ static PyObject *Matrix_toQuat(MatrixObject * self) { float quat[4]; + if(!Matrix_ReadCallback(self)) + return NULL; + /*must be 3-4 cols, 3-4 rows, square matrix*/ if(self->colSize < 3 || self->rowSize < 3 || (self->colSize != self->rowSize)) { PyErr_SetString(PyExc_AttributeError, "Matrix.toQuat(): inappropriate matrix size - expects 3x3 or 4x4 matrix"); @@ -180,6 +248,9 @@ PyObject *Matrix_toEuler(MatrixObject * self, PyObject *args) EulerObject *eul_compat = NULL; int x; + if(!Matrix_ReadCallback(self)) + return NULL; + if(!PyArg_ParseTuple(args, "|O!:toEuler", &euler_Type, &eul_compat)) return NULL; @@ -215,17 +286,20 @@ PyObject *Matrix_Resize4x4(MatrixObject * self) { int x, first_row_elem, curr_pos, new_pos, blank_columns, blank_rows, index; - if(self->data.blend_data){ - PyErr_SetString(PyExc_TypeError, "cannot resize wrapped data - only python matrices"); + if(self->wrapped==Py_WRAP){ + PyErr_SetString(PyExc_TypeError, "cannot resize wrapped data - make a copy and resize that"); return NULL; } - - self->data.py_data = PyMem_Realloc(self->data.py_data, (sizeof(float) * 16)); - if(self->data.py_data == NULL) { + if(self->cb_user){ + PyErr_SetString(PyExc_TypeError, "cannot resize owned data - make a copy and resize that"); + return NULL; + } + + self->contigPtr = PyMem_Realloc(self->contigPtr, (sizeof(float) * 16)); + if(self->contigPtr == NULL) { PyErr_SetString(PyExc_MemoryError, "matrix.resize4x4(): problem allocating pointer space"); return NULL; } - self->contigPtr = self->data.py_data; /*force*/ self->matrix = PyMem_Realloc(self->matrix, (sizeof(float *) * 4)); if(self->matrix == NULL) { PyErr_SetString(PyExc_MemoryError, "matrix.resize4x4(): problem allocating pointer space"); @@ -268,7 +342,10 @@ PyObject *Matrix_Resize4x4(MatrixObject * self) PyObject *Matrix_TranslationPart(MatrixObject * self) { float vec[4]; - + + if(!Matrix_ReadCallback(self)) + return NULL; + if(self->colSize < 3 || self->rowSize < 4){ PyErr_SetString(PyExc_AttributeError, "Matrix.translationPart: inappropriate matrix size"); return NULL; @@ -286,6 +363,9 @@ PyObject *Matrix_RotationPart(MatrixObject * self) float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + if(!Matrix_ReadCallback(self)) + return NULL; + if(self->colSize < 3 || self->rowSize < 3){ PyErr_SetString(PyExc_AttributeError, "Matrix.rotationPart: inappropriate matrix size\n"); return NULL; @@ -309,6 +389,9 @@ PyObject *Matrix_scalePart(MatrixObject * self) float scale[3], rot[3]; float mat[3][3], imat[3][3], tmat[3][3]; + if(!Matrix_ReadCallback(self)) + return NULL; + /*must be 3-4 cols, 3-4 rows, square matrix*/ if(self->colSize == 4 && self->rowSize == 4) Mat3CpyMat4(mat, (float (*)[4])*self->matrix); @@ -339,6 +422,9 @@ PyObject *Matrix_Invert(MatrixObject * self) float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + if(!Matrix_ReadCallback(self)) + return NULL; + if(self->rowSize != self->colSize){ PyErr_SetString(PyExc_AttributeError, "Matrix.invert(ed): only square matrices are supported"); return NULL; @@ -379,6 +465,7 @@ PyObject *Matrix_Invert(MatrixObject * self) return NULL; } + Matrix_WriteCallback(self); Py_INCREF(self); return (PyObject *)self; } @@ -389,6 +476,9 @@ PyObject *Matrix_Determinant(MatrixObject * self) { float det = 0.0f; + if(!Matrix_ReadCallback(self)) + return NULL; + if(self->rowSize != self->colSize){ PyErr_SetString(PyExc_AttributeError, "Matrix.determinant: only square matrices are supported"); return NULL; @@ -414,6 +504,9 @@ PyObject *Matrix_Transpose(MatrixObject * self) { float t = 0.0f; + if(!Matrix_ReadCallback(self)) + return NULL; + if(self->rowSize != self->colSize){ PyErr_SetString(PyExc_AttributeError, "Matrix.transpose(d): only square matrices are supported"); return NULL; @@ -429,6 +522,7 @@ PyObject *Matrix_Transpose(MatrixObject * self) Mat4Transp((float (*)[4])*self->matrix); } + Matrix_WriteCallback(self); Py_INCREF(self); return (PyObject *)self; } @@ -438,18 +532,25 @@ PyObject *Matrix_Transpose(MatrixObject * self) PyObject *Matrix_Zero(MatrixObject * self) { int row, col; - + for(row = 0; row < self->rowSize; row++) { for(col = 0; col < self->colSize; col++) { self->matrix[row][col] = 0.0f; } } + + if(!Matrix_WriteCallback(self)) + return NULL; + Py_INCREF(self); return (PyObject *)self; } /*---------------------------Matrix.identity(() ------------------*/ PyObject *Matrix_Identity(MatrixObject * self) { + if(!Matrix_ReadCallback(self)) + return NULL; + if(self->rowSize != self->colSize){ PyErr_SetString(PyExc_AttributeError, "Matrix.identity: only square matrices are supported\n"); return NULL; @@ -466,6 +567,9 @@ PyObject *Matrix_Identity(MatrixObject * self) Mat4One((float (*)[4]) *self->matrix); } + if(!Matrix_WriteCallback(self)) + return NULL; + Py_INCREF(self); return (PyObject *)self; } @@ -473,6 +577,9 @@ PyObject *Matrix_Identity(MatrixObject * self) /*---------------------------Matrix.inverted() ------------------*/ PyObject *Matrix_copy(MatrixObject * self) { + if(!Matrix_ReadCallback(self)) + return NULL; + return (PyObject*)(MatrixObject*)newMatrixObject((float (*))*self->matrix, self->rowSize, self->colSize, Py_NEW); } @@ -482,9 +589,10 @@ static void Matrix_dealloc(MatrixObject * self) { PyMem_Free(self->matrix); /*only free py_data*/ - if(self->data.py_data){ - PyMem_Free(self->data.py_data); - } + if(self->wrapped==Py_WRAP) + PyMem_Free(self->contigPtr); + + Py_XDECREF(self->cb_user); PyObject_DEL(self); } @@ -495,6 +603,9 @@ static PyObject *Matrix_repr(MatrixObject * self) int x, y; char buffer[48], str[1024]; + if(!Matrix_ReadCallback(self)) + return NULL; + BLI_strncpy(str,"",1024); for(x = 0; x < self->rowSize; x++){ sprintf(buffer, "["); @@ -531,6 +642,9 @@ static PyObject* Matrix_richcmpr(PyObject *objectA, PyObject *objectB, int compa matA = (MatrixObject*)objectA; matB = (MatrixObject*)objectB; + if(!Matrix_ReadCallback(matA) || !Matrix_ReadCallback(matB)) + return NULL; + if (matA->colSize != matB->colSize || matA->rowSize != matB->rowSize){ if (comparison_type == Py_NE){ Py_RETURN_TRUE; @@ -578,11 +692,14 @@ static int Matrix_len(MatrixObject * self) the wrapped vector gives direct access to the matrix data*/ static PyObject *Matrix_item(MatrixObject * self, int i) { + if(!Matrix_ReadCallback(self)) + return NULL; + if(i < 0 || i >= self->rowSize) { PyErr_SetString(PyExc_IndexError, "matrix[attribute]: array index out of range"); return NULL; } - return newVectorObject(self->matrix[i], self->colSize, Py_WRAP); + return newVectorObject_cb((PyObject *)self, self->colSize, mathutils_matrix_vector_cb_index, i); } /*----------------------------object[]------------------------- sequence accessor (set)*/ @@ -592,6 +709,9 @@ static int Matrix_ass_item(MatrixObject * self, int i, PyObject * ob) float vec[4]; PyObject *m, *f; + if(!Matrix_ReadCallback(self)) + return -1; + if(i >= self->rowSize || i < 0){ PyErr_SetString(PyExc_TypeError, "matrix[attribute] = x: bad row\n"); return -1; @@ -625,6 +745,8 @@ static int Matrix_ass_item(MatrixObject * self, int i, PyObject * ob) for(y = 0; y < size; y++){ self->matrix[i][y] = vec[y]; } + + Matrix_WriteCallback(self); return 0; }else{ PyErr_SetString(PyExc_TypeError, "matrix[attribute] = x: expects a sequence of column size\n"); @@ -638,6 +760,9 @@ static PyObject *Matrix_slice(MatrixObject * self, int begin, int end) PyObject *list = NULL; int count; + + if(!Matrix_ReadCallback(self)) + return NULL; CLAMP(begin, 0, self->rowSize); CLAMP(end, 0, self->rowSize); @@ -646,7 +771,8 @@ static PyObject *Matrix_slice(MatrixObject * self, int begin, int end) list = PyList_New(end - begin); for(count = begin; count < end; count++) { PyList_SetItem(list, count - begin, - newVectorObject(self->matrix[count], self->colSize, Py_WRAP)); + newVectorObject_cb((PyObject *)self, self->colSize, mathutils_matrix_vector_cb_index, count)); + } return list; @@ -661,6 +787,9 @@ static int Matrix_ass_slice(MatrixObject * self, int begin, int end, PyObject *subseq; PyObject *m; + if(!Matrix_ReadCallback(self)) + return -1; + CLAMP(begin, 0, self->rowSize); CLAMP(end, 0, self->rowSize); begin = MIN2(begin,end); @@ -718,6 +847,8 @@ static int Matrix_ass_slice(MatrixObject * self, int begin, int end, for(x = 0; x < (size * sub_size); x++){ self->matrix[begin + (int)floor(x / self->colSize)][x % self->colSize] = mat[x]; } + + Matrix_WriteCallback(self); return 0; }else{ PyErr_SetString(PyExc_TypeError, "matrix[begin:end] = []: illegal argument type for built-in operation\n"); @@ -740,6 +871,10 @@ static PyObject *Matrix_add(PyObject * m1, PyObject * m2) PyErr_SetString(PyExc_AttributeError, "Matrix addition: arguments not valid for this operation...."); return NULL; } + + if(!Matrix_ReadCallback(mat1) || !Matrix_ReadCallback(mat2)) + return NULL; + if(mat1->rowSize != mat2->rowSize || mat1->colSize != mat2->colSize){ PyErr_SetString(PyExc_AttributeError, "Matrix addition: matrices must have the same dimensions for this operation"); return NULL; @@ -769,6 +904,10 @@ static PyObject *Matrix_sub(PyObject * m1, PyObject * m2) PyErr_SetString(PyExc_AttributeError, "Matrix addition: arguments not valid for this operation...."); return NULL; } + + if(!Matrix_ReadCallback(mat1) || !Matrix_ReadCallback(mat2)) + return NULL; + if(mat1->rowSize != mat2->rowSize || mat1->colSize != mat2->colSize){ PyErr_SetString(PyExc_AttributeError, "Matrix addition: matrices must have the same dimensions for this operation"); return NULL; @@ -793,8 +932,16 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) double dot = 0.0f; MatrixObject *mat1 = NULL, *mat2 = NULL; - if(MatrixObject_Check(m1)) mat1 = (MatrixObject*)m1; - if(MatrixObject_Check(m2)) mat2 = (MatrixObject*)m2; + if(MatrixObject_Check(m1)) { + mat1 = (MatrixObject*)m1; + if(!Matrix_ReadCallback(mat1)) + return NULL; + } + if(MatrixObject_Check(m2)) { + mat2 = (MatrixObject*)m2; + if(!Matrix_ReadCallback(mat2)) + return NULL; + } if(mat1 && mat2) { /*MATRIX * MATRIX*/ if(mat1->colSize != mat2->rowSize){ @@ -853,6 +1000,9 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) } static PyObject* Matrix_inv(MatrixObject *self) { + if(!Matrix_ReadCallback(self)) + return NULL; + return Matrix_Invert(self); } @@ -902,6 +1052,17 @@ static PyObject *Matrix_getColSize( MatrixObject * self, void *type ) return PyLong_FromLong((long) self->colSize); } +static PyObject *Matrix_getOwner( MatrixObject * self, void *type ) +{ + if(self->cb_user==NULL) { + Py_RETURN_NONE; + } + else { + Py_INCREF(self->cb_user); + return self->cb_user; + } +} + static PyObject *Matrix_getWrapped( MatrixObject * self, void *type ) { if (self->wrapped == Py_WRAP) @@ -917,6 +1078,7 @@ static PyGetSetDef Matrix_getseters[] = { {"rowSize", (getter)Matrix_getRowSize, (setter)NULL, "", NULL}, {"colSize", (getter)Matrix_getColSize, (setter)NULL, "", NULL}, {"wrapped", (getter)Matrix_getWrapped, (setter)NULL, "", NULL}, + {"__owner__",(getter)Matrix_getOwner, (setter)NULL, "Read only owner for vectors that depend on another object", NULL}, {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ }; @@ -986,7 +1148,7 @@ self->matrix self->contiguous_ptr (reference to data.xxx) [4] [5] .... -self->matrix[1][1] = self->contiguous_ptr[4] = self->data.xxx_data[4]*/ +self->matrix[1][1] = self->contigPtr[4] */ /*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER (i.e. it was allocated elsewhere by MEM_mallocN()) @@ -1004,14 +1166,15 @@ PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type) } self = PyObject_NEW(MatrixObject, &matrix_Type); - self->data.blend_data = NULL; - self->data.py_data = NULL; self->rowSize = rowSize; self->colSize = colSize; + + /* init callbacks as NULL */ + self->cb_user= NULL; + self->cb_type= self->cb_subtype= 0; if(type == Py_WRAP){ - self->data.blend_data = mat; - self->contigPtr = self->data.blend_data; + self->contigPtr = mat; /*create pointer array*/ self->matrix = PyMem_Malloc(rowSize * sizeof(float *)); if(self->matrix == NULL) { /*allocation failure*/ @@ -1024,16 +1187,15 @@ PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type) } self->wrapped = Py_WRAP; }else if (type == Py_NEW){ - self->data.py_data = PyMem_Malloc(rowSize * colSize * sizeof(float)); - if(self->data.py_data == NULL) { /*allocation failure*/ + self->contigPtr = PyMem_Malloc(rowSize * colSize * sizeof(float)); + if(self->contigPtr == NULL) { /*allocation failure*/ PyErr_SetString( PyExc_MemoryError, "matrix(): problem allocating pointer space\n"); return NULL; } - self->contigPtr = self->data.py_data; /*create pointer array*/ self->matrix = PyMem_Malloc(rowSize * sizeof(float *)); if(self->matrix == NULL) { /*allocation failure*/ - PyMem_Free(self->data.py_data); + PyMem_Free(self->contigPtr); PyErr_SetString( PyExc_MemoryError, "matrix(): problem allocating pointer space"); return NULL; } @@ -1059,6 +1221,18 @@ PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type) return (PyObject *) self; } +PyObject *newMatrixObject_cb(PyObject *cb_user, int rowSize, int colSize, int cb_type, int cb_subtype) +{ + MatrixObject *self= (MatrixObject *)newMatrixObject(NULL, rowSize, colSize, Py_NEW); + if(self) { + Py_INCREF(cb_user); + self->cb_user= cb_user; + self->cb_type= (unsigned char)cb_type; + self->cb_subtype= (unsigned char)cb_subtype; + } + return (PyObject *) self; +} + //----------------column_vector_multiplication (internal)--------- //COLUMN VECTOR Multiplication (Matrix X Vector) // [1][2][3] [a] @@ -1071,7 +1245,7 @@ static PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* double dot = 0.0f; int x, y, z = 0; - if(!Vector_ReadCallback(vec)) + if(!Matrix_ReadCallback(mat) || !Vector_ReadCallback(vec)) return NULL; if(mat->rowSize != vec->size){ diff --git a/source/blender/python/generic/matrix.h b/source/blender/python/generic/matrix.h index 2604d58d0d1..cc3928f1632 100644 --- a/source/blender/python/generic/matrix.h +++ b/source/blender/python/generic/matrix.h @@ -39,15 +39,14 @@ extern PyTypeObject matrix_Type; typedef float **ptRow; typedef struct _Matrix { PyObject_VAR_HEAD - struct{ - float *py_data; /*python managed*/ - float *blend_data; /*blender managed*/ - }data; - ptRow matrix; /*ptr to the contigPtr (accessor)*/ - float *contigPtr; /*1D array of data (alias)*/ - int rowSize; - int colSize; - int wrapped; /*is wrapped data?*/ + ptRow matrix; /*ptr to the contigPtr (accessor)*/ + float* contigPtr; /*1D array of data (alias)*/ + PyObject* cb_user; /* if this vector references another object, otherwise NULL, *Note* this owns its reference */ + unsigned char rowSize; + unsigned char colSize; + unsigned char wrapped; /*is wrapped data?*/ + unsigned char cb_type; /* which user funcs do we adhere to, RNA, GameObject, etc */ + unsigned int cb_subtype; /* subtype: location, rotation... to avoid defining many new functions for every attribute of the same type */ } MatrixObject; /*struct data contains a pointer to the actual data that the @@ -57,5 +56,9 @@ blender (stored in blend_data). This is an either/or struct not both*/ /*prototypes*/ PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type); +PyObject *newMatrixObject_cb(PyObject *user, int rowSize, int colSize, int cb_type, int cb_subtype); + +extern int mathutils_matrix_vector_cb_index; +extern struct Mathutils_Callback mathutils_matrix_vector_cb; #endif /* EXPP_matrix_H */ diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c index b9ccb478ddd..8a3ded80455 100644 --- a/source/blender/python/generic/quat.c +++ b/source/blender/python/generic/quat.c @@ -75,7 +75,7 @@ static struct PyMethodDef Quaternion_methods[] = { //----------------------------------Mathutils.Quaternion() -------------- static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - PyObject *listObject = NULL, *n, *q, *f; + PyObject *listObject = NULL, *n, *q; int size, i; float quat[4], scalar; double norm = 0.0f, angle = 0.0f; @@ -159,7 +159,6 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw } quat[i] = scalar; - Py_DECREF(f); Py_DECREF(q); } if(size == 3){ //calculate the quat based on axis/angle diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index b01a51f442a..dea5bc93898 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -72,8 +72,8 @@ static struct PyMethodDef Vector_methods[] = { {"normalize", (PyCFunction) Vector_Normalize, METH_NOARGS, Vector_Normalize_doc}, {"negate", (PyCFunction) Vector_Negate, METH_NOARGS, Vector_Negate_doc}, {"resize2D", (PyCFunction) Vector_Resize2D, METH_NOARGS, Vector_Resize2D_doc}, - {"resize3D", (PyCFunction) Vector_Resize3D, METH_NOARGS, Vector_Resize2D_doc}, - {"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, Vector_Resize2D_doc}, + {"resize3D", (PyCFunction) Vector_Resize3D, METH_NOARGS, Vector_Resize3D_doc}, + {"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, Vector_Resize4D_doc}, {"toTrackQuat", ( PyCFunction ) Vector_ToTrackQuat, METH_VARARGS, Vector_ToTrackQuat_doc}, {"reflect", ( PyCFunction ) Vector_Reflect, METH_O, Vector_Reflect_doc}, {"cross", ( PyCFunction ) Vector_Cross, METH_O, Vector_Dot_doc}, @@ -180,7 +180,7 @@ static PyObject *Vector_Resize2D(VectorObject * self) PyErr_SetString(PyExc_TypeError, "vector.resize2d(): cannot resize wrapped data - only python vectors\n"); return NULL; } - if(self->user) { + if(self->cb_user) { PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize a vector that has an owner"); return NULL; } @@ -203,7 +203,7 @@ static PyObject *Vector_Resize3D(VectorObject * self) PyErr_SetString(PyExc_TypeError, "vector.resize3d(): cannot resize wrapped data - only python vectors\n"); return NULL; } - if(self->user) { + if(self->cb_user) { PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize a vector that has an owner"); return NULL; } @@ -229,7 +229,7 @@ static PyObject *Vector_Resize4D(VectorObject * self) PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize wrapped data - only python vectors"); return NULL; } - if(self->user) { + if(self->cb_user) { PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize a vector that has an owner"); return NULL; } @@ -478,10 +478,10 @@ static PyObject *Vector_copy(VectorObject * self) static void Vector_dealloc(VectorObject * self) { /* only free non wrapped */ - if(self->wrapped != Py_WRAP){ + if(self->wrapped != Py_WRAP) PyMem_Free(self->vec); - } - Py_XDECREF(self->user); + + Py_XDECREF(self->cb_user); PyObject_DEL(self); } @@ -845,6 +845,9 @@ static PyObject *Vector_imul(PyObject * v1, PyObject * v2) int x,y, size = vec->size; MatrixObject *mat= (MatrixObject*)v2; + if(!Vector_ReadCallback(mat)) + return NULL; + if(mat->colSize != size){ if(mat->rowSize == 4 && vec->size != 3){ PyErr_SetString(PyExc_AttributeError, "vector * matrix: matrix column size and the vector size must be the same"); @@ -1215,12 +1218,12 @@ static PyObject *Vector_getWrapped( VectorObject * self, void *type ) static PyObject *Vector_getOwner( VectorObject * self, void *type ) { - if(self->user==NULL) { + if(self->cb_user==NULL) { Py_RETURN_NONE; } else { - Py_INCREF(self->user); - return self->user; + Py_INCREF(self->cb_user); + return self->cb_user; } } @@ -1886,6 +1889,10 @@ PyObject *newVectorObject(float *vec, int size, int type) if(size > 4 || size < 2) return NULL; self->size = size; + + /* init callbacks as NULL */ + self->cb_user= NULL; + self->cb_type= self->cb_subtype= 0; if(type == Py_WRAP) { self->vec = vec; @@ -1910,15 +1917,15 @@ PyObject *newVectorObject(float *vec, int size, int type) return (PyObject *) self; } -PyObject *newVectorObject_cb(PyObject *user, int size, int callback_type, int subtype) +PyObject *newVectorObject_cb(PyObject *cb_user, int size, int cb_type, int cb_subtype) { - float dummy[4] = {0.0, 0.0, 0.0, 0.0}; /* the same vector is used because its set each time by the user callback, saves a little ram */ + float dummy[4] = {0.0, 0.0, 0.0, 0.0}; /* dummy init vector, callbacks will be used on access */ VectorObject *self= newVectorObject(dummy, size, Py_NEW); if(self) { - Py_INCREF(user); - self->user= user; - self->callback_type = (unsigned char)callback_type; - self->subtype = (unsigned char)subtype; + Py_INCREF(cb_user); + self->cb_user= cb_user; + self->cb_type= (unsigned char)cb_type; + self->cb_subtype= (unsigned char)cb_subtype; } return self; @@ -1945,7 +1952,7 @@ static PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat } } - if(!Vector_ReadCallback(vec)) + if(!Vector_ReadCallback(vec) || !Matrix_ReadCallback(mat)) return NULL; for(x = 0; x < vec_size; x++){ diff --git a/source/blender/python/generic/vector.h b/source/blender/python/generic/vector.h index c00be8d71b7..82dbf13b9aa 100644 --- a/source/blender/python/generic/vector.h +++ b/source/blender/python/generic/vector.h @@ -40,11 +40,11 @@ extern PyTypeObject vector_Type; typedef struct { PyObject_VAR_HEAD float *vec; /*1D array of data (alias), wrapped status depends on wrapped status */ - PyObject *user; /* if this vector references another object, otherwise NULL, *Note* this owns its reference */ + PyObject *cb_user; /* if this vector references another object, otherwise NULL, *Note* this owns its reference */ unsigned char size; /* vec size 2,3 or 4 */ unsigned char wrapped; /* wrapped data type? */ - unsigned char callback_type; /* which user funcs do we adhere to, RNA, GameObject, etc */ - unsigned char subtype; /* subtype: location, rotation... to avoid defining many new functions for every attribute of the same type */ + unsigned char cb_type; /* which user funcs do we adhere to, RNA, GameObject, etc */ + unsigned char cb_subtype; /* subtype: location, rotation... to avoid defining many new functions for every attribute of the same type */ } VectorObject; diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 559ed537757..8b5ad36f349 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -37,6 +37,11 @@ #include "BPY_extern.h" #include "../generic/bpy_internal_import.h" // our own imports +/* external util modukes */ + +#include "../generic/Mathutils.h" +#include "../generic/Geometry.h" +#include "../generic/BGL.h" void BPY_free_compiled_text( struct Text *text ) @@ -61,11 +66,17 @@ static void bpy_init_modules( void ) PyModule_AddObject( mod, "types", BPY_rna_types() ); PyModule_AddObject( mod, "props", BPY_rna_props() ); PyModule_AddObject( mod, "ops", BPY_operator_module() ); - PyModule_AddObject( mod, "ui", BPY_ui_module() ); // XXX very experemental, consider this a test, especially PyCObject is not meant to be perminant + PyModule_AddObject( mod, "ui", BPY_ui_module() ); // XXX very experimental, consider this a test, especially PyCObject is not meant to be permanent /* add the module so we can import it */ PyDict_SetItemString(PySys_GetObject("modules"), "bpy", mod); Py_DECREF(mod); + + + /* stand alone utility modules not related to blender directly */ + Geometry_Init("Geometry"); + Mathutils_Init("Mathutils"); + BGL_Init("BGL"); } #if (PY_VERSION_HEX < 0x02050000) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 93a8af8b177..70ccd4f58c9 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -44,9 +44,10 @@ #ifdef USE_MATHUTILS #include "../generic/Mathutils.h" /* so we can have mathutils callbacks */ +/* bpyrna vector callbacks */ static int mathutils_rna_vector_cb_index= -1; /* index for our callbacks */ -static int mathutils_rna_vector_check(BPy_PropertyRNA *self) +static int mathutils_rna_generic_check(BPy_PropertyRNA *self) { return self->prop?1:0; } @@ -88,13 +89,42 @@ static int mathutils_rna_vector_set_index(BPy_PropertyRNA *self, int subtype, fl } Mathutils_Callback mathutils_rna_vector_cb = { - mathutils_rna_vector_check, + mathutils_rna_generic_check, mathutils_rna_vector_get, mathutils_rna_vector_set, mathutils_rna_vector_get_index, mathutils_rna_vector_set_index }; +/* bpyrna matrix callbacks */ +static int mathutils_rna_matrix_cb_index= -1; /* index for our callbacks */ + +static int mathutils_rna_matrix_get(BPy_PropertyRNA *self, int subtype, float *mat_from) +{ + if(self->prop==NULL) + return 0; + + RNA_property_float_get_array(&self->ptr, self->prop, mat_from); + return 1; +} + +static int mathutils_rna_matrix_set(BPy_PropertyRNA *self, int subtype, float *mat_to) +{ + if(self->prop==NULL) + return 0; + + RNA_property_float_set_array(&self->ptr, self->prop, mat_to); + return 1; +} + +Mathutils_Callback mathutils_rna_matrix_cb = { + mathutils_rna_generic_check, + mathutils_rna_matrix_get, + mathutils_rna_matrix_set, + NULL, + NULL +}; + #endif static int pyrna_struct_compare( BPy_StructRNA * a, BPy_StructRNA * b ) @@ -206,15 +236,28 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop) #ifdef USE_MATHUTILS /* return a mathutils vector where possible */ - if( RNA_property_type(prop)==PROP_FLOAT && - RNA_property_subtype(prop)==PROP_VECTOR && - len>=2 && len <= 4 ) - { - PyObject *vec_cb= newVectorObject_cb(ret, len, mathutils_rna_vector_cb_index, 0); - Py_DECREF(ret); /* the vector owns now */ - - ret= vec_cb; /* return the vector instead */ + if(RNA_property_type(prop)==PROP_FLOAT) { + if(RNA_property_subtype(prop)==PROP_VECTOR) { + if(len>=2 && len <= 4) { + PyObject *vec_cb= newVectorObject_cb(ret, len, mathutils_rna_vector_cb_index, 0); + Py_DECREF(ret); /* the vector owns now */ + ret= vec_cb; /* return the vector instead */ + } + } + else if(RNA_property_subtype(prop)==PROP_MATRIX) { + if(len==16) { + PyObject *mat_cb= newMatrixObject_cb(ret, 4,4, mathutils_rna_vector_cb_index, 0); + Py_DECREF(ret); /* the matrix owns now */ + ret= mat_cb; /* return the matrix instead */ + } + else if (len==9) { + PyObject *mat_cb= newMatrixObject_cb(ret, 3,3, mathutils_rna_vector_cb_index, 0); + Py_DECREF(ret); /* the matrix owns now */ + ret= mat_cb; /* return the matrix instead */ + } + } } + #endif return ret; @@ -1749,6 +1792,7 @@ PyObject *BPY_rna_module( void ) #ifdef USE_MATHUTILS // register mathutils callbacks, ok to run more then once. mathutils_rna_vector_cb_index= Mathutils_RegisterCallback(&mathutils_rna_vector_cb); + mathutils_rna_matrix_cb_index= Mathutils_RegisterCallback(&mathutils_rna_matrix_cb); #endif /* This can't be set in the pytype struct because some compilers complain */ diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 081549db686..a3b2ba79e11 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -983,7 +983,17 @@ void KX_GameObject::NodeSetLocalOrientation(const MT_Matrix3x3& rot) GetSGNode()->SetLocalOrientation(rot); } +void KX_GameObject::NodeSetGlobalOrientation(const MT_Matrix3x3& rot) +{ + // check on valid node in case a python controller holds a reference to a deleted object + if (!GetSGNode()) + return; + if (GetSGNode()->GetSGParent()) + GetSGNode()->SetLocalOrientation(GetSGNode()->GetSGParent()->GetWorldOrientation().inverse()*rot); + else + GetSGNode()->SetLocalOrientation(rot); +} void KX_GameObject::NodeSetLocalScale(const MT_Vector3& scale) { @@ -1062,7 +1072,13 @@ const MT_Matrix3x3& KX_GameObject::NodeGetWorldOrientation() const return GetSGNode()->GetWorldOrientation(); } - +const MT_Matrix3x3& KX_GameObject::NodeGetLocalOrientation() const +{ + // check on valid node in case a python controller holds a reference to a deleted object + if (!GetSGNode()) + return dummy_orientation; + return GetSGNode()->GetLocalOrientation(); +} const MT_Vector3& KX_GameObject::NodeGetWorldScaling() const { @@ -1073,7 +1089,14 @@ const MT_Vector3& KX_GameObject::NodeGetWorldScaling() const return GetSGNode()->GetWorldScaling(); } +const MT_Vector3& KX_GameObject::NodeGetLocalScaling() const +{ + // check on valid node in case a python controller holds a reference to a deleted object + if (!GetSGNode()) + return dummy_scaling; + return GetSGNode()->GetLocalScale(); +} const MT_Point3& KX_GameObject::NodeGetWorldPosition() const { @@ -1084,6 +1107,16 @@ const MT_Point3& KX_GameObject::NodeGetWorldPosition() const return dummy_point; } +const MT_Point3& KX_GameObject::NodeGetLocalPosition() const +{ + // check on valid node in case a python controller holds a reference to a deleted object + if (GetSGNode()) + return GetSGNode()->GetLocalPosition(); + else + return dummy_point; +} + + /* Suspend/ resume: for the dynamic behaviour, there is a simple * method. For the residual motion, there is not. I wonder what the * correct solution is for Sumo. Remove from the motion-update tree? @@ -1164,10 +1197,9 @@ extern "C" { #define MATHUTILS_VEC_CB_SCALE_GLOBAL 4 #define MATHUTILS_VEC_CB_INERTIA_LOCAL 5 - static int mathutils_kxgameob_vector_cb_index= -1; /* index for our callbacks */ -static int mathutils_kxgameob_vector_check(PyObject *self_v) +static int mathutils_kxgameob_generic_check(PyObject *self_v) { KX_GameObject* self= static_castBGE_PROXY_REF(self_v); if(self==NULL) @@ -1184,26 +1216,21 @@ static int mathutils_kxgameob_vector_get(PyObject *self_v, int subtype, float *v switch(subtype) { case MATHUTILS_VEC_CB_POS_LOCAL: - if(!self->GetSGNode()) return 0; - self->GetSGNode()->GetLocalPosition().getValue(vec_from); + self->NodeGetLocalPosition().getValue(vec_from); break; case MATHUTILS_VEC_CB_POS_GLOBAL: - if(!self->GetSGNode()) return 0; - self->GetSGNode()->GetWorldPosition().getValue(vec_from); + self->NodeGetWorldPosition().getValue(vec_from); break; case MATHUTILS_VEC_CB_SCALE_LOCAL: - if(!self->GetSGNode()) return 0; - self->GetSGNode()->GetLocalScale().getValue(vec_from); + self->NodeGetLocalScaling().getValue(vec_from); break; case MATHUTILS_VEC_CB_SCALE_GLOBAL: self->NodeGetWorldScaling().getValue(vec_from); break; case MATHUTILS_VEC_CB_INERTIA_LOCAL: - if(!self->GetSGNode()) return 0; + if(!self->GetPhysicsController()) return 0; self->GetPhysicsController()->GetLocalInertia().getValue(vec_from); break; - - } return 1; @@ -1215,11 +1242,6 @@ static int mathutils_kxgameob_vector_set(PyObject *self_v, int subtype, float *v if(self==NULL) return 0; - /* first */ - SG_Node* sg = self->GetSGNode(); - if(sg==NULL) - return 0; - switch(subtype) { case MATHUTILS_VEC_CB_POS_LOCAL: self->NodeSetLocalPosition(MT_Point3(vec_to)); @@ -1269,18 +1291,75 @@ static int mathutils_kxgameob_vector_set_index(PyObject *self_v, int subtype, fl } Mathutils_Callback mathutils_kxgameob_vector_cb = { - mathutils_kxgameob_vector_check, + mathutils_kxgameob_generic_check, mathutils_kxgameob_vector_get, mathutils_kxgameob_vector_set, mathutils_kxgameob_vector_get_index, mathutils_kxgameob_vector_set_index }; +/* Matrix */ +#define MATHUTILS_MAT_CB_ORI_LOCAL 1 +#define MATHUTILS_MAT_CB_ORI_GLOBAL 2 + +static int mathutils_kxgameob_matrix_cb_index= -1; /* index for our callbacks */ + +static int mathutils_kxgameob_matrix_get(PyObject *self_v, int subtype, float *mat_from) +{ + KX_GameObject* self= static_castBGE_PROXY_REF(self_v); + if(self==NULL) + return 0; + + switch(subtype) { + case MATHUTILS_MAT_CB_ORI_LOCAL: + self->NodeGetLocalOrientation().getValue3x3(mat_from); + break; + case MATHUTILS_MAT_CB_ORI_GLOBAL: + self->NodeGetWorldOrientation().getValue3x3(mat_from); + break; + } + + return 1; +} + + +static int mathutils_kxgameob_matrix_set(PyObject *self_v, int subtype, float *mat_to) +{ + KX_GameObject* self= static_castBGE_PROXY_REF(self_v); + if(self==NULL) + return 0; + + MT_Matrix3x3 mat3x3; + switch(subtype) { + case MATHUTILS_MAT_CB_ORI_LOCAL: + mat3x3.setValue3x3(mat_to); + self->NodeSetLocalOrientation(mat3x3); + self->NodeUpdateGS(0.f); + break; + case MATHUTILS_MAT_CB_ORI_GLOBAL: + mat3x3.setValue3x3(mat_to); + self->NodeSetLocalOrientation(mat3x3); + self->NodeUpdateGS(0.f); + break; + } + + return 1; +} + +Mathutils_Callback mathutils_kxgameob_matrix_cb = { + mathutils_kxgameob_generic_check, + mathutils_kxgameob_matrix_get, + mathutils_kxgameob_matrix_set, + NULL, + NULL +}; + void KX_GameObject_Mathutils_Callback_Init(void) { // register mathutils callbacks, ok to run more then once. mathutils_kxgameob_vector_cb_index= Mathutils_RegisterCallback(&mathutils_kxgameob_vector_cb); + mathutils_kxgameob_matrix_cb_index= Mathutils_RegisterCallback(&mathutils_kxgameob_matrix_cb); } #endif // USE_MATHUTILS @@ -1754,10 +1833,7 @@ PyObject* KX_GameObject::pyattr_get_localPosition(void *self_v, const KX_PYATTRI #ifdef USE_MATHUTILS return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_LOCAL); #else - if (self->GetSGNode()) - return PyObjectFrom(self->GetSGNode()->GetLocalPosition()); - else - return PyObjectFrom(dummy_point); + return PyObjectFrom(self->NodeGetLocalPosition()); #endif } @@ -1782,13 +1858,17 @@ PyObject* KX_GameObject::pyattr_get_localInertia(void *self_v, const KX_PYATTRIB if (self->GetPhysicsController()) return PyObjectFrom(self->GetPhysicsController()->GetLocalInertia()); return Py_BuildValue("fff", 0.0f, 0.0f, 0.0f); - #endif +#endif } PyObject* KX_GameObject::pyattr_get_worldOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { +#ifdef USE_MATHUTILS + return newMatrixObject_cb((PyObject *)self_v, 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_GLOBAL); +#else KX_GameObject* self= static_cast(self_v); return PyObjectFrom(self->NodeGetWorldOrientation()); +#endif } int KX_GameObject::pyattr_set_worldOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) @@ -1813,11 +1893,12 @@ int KX_GameObject::pyattr_set_worldOrientation(void *self_v, const KX_PYATTRIBUT PyObject* KX_GameObject::pyattr_get_localOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { +#ifdef USE_MATHUTILS + return newMatrixObject_cb((PyObject *)self_v, 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_LOCAL); +#else KX_GameObject* self= static_cast(self_v); - if (self->GetSGNode()) - return PyObjectFrom(self->GetSGNode()->GetLocalOrientation()); - else - return PyObjectFrom(dummy_orientation); + return PyObjectFrom(self->NodeGetLocalOrientation()); +#endif } int KX_GameObject::pyattr_set_localOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) @@ -1850,10 +1931,7 @@ PyObject* KX_GameObject::pyattr_get_localScaling(void *self_v, const KX_PYATTRIB #ifdef USE_MATHUTILS return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_LOCAL); #else - if (self->GetSGNode()) - return PyObjectFrom(self->GetSGNode()->GetLocalScale()); - else - return PyObjectFrom(dummy_scaling); + return PyObjectFrom(self->NodeGetLocalScale()); #endif } diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index b01b0cae641..59285714950 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -397,6 +397,7 @@ public: void NodeSetLocalPosition(const MT_Point3& trans ); void NodeSetLocalOrientation(const MT_Matrix3x3& rot ); + void NodeSetGlobalOrientation(const MT_Matrix3x3& rot ); void NodeSetLocalScale( const MT_Vector3& scale ); @@ -410,21 +411,13 @@ public: double time ); - const - MT_Matrix3x3& - NodeGetWorldOrientation( - ) const; - - const - MT_Vector3& - NodeGetWorldScaling( - ) const; - - const - MT_Point3& - NodeGetWorldPosition( - ) const; + const MT_Matrix3x3& NodeGetWorldOrientation( ) const; + const MT_Vector3& NodeGetWorldScaling( ) const; + const MT_Point3& NodeGetWorldPosition( ) const; + const MT_Matrix3x3& NodeGetLocalOrientation( ) const; + const MT_Vector3& NodeGetLocalScaling( ) const; + const MT_Point3& NodeGetLocalPosition( ) const; /** * @section scene graph node accessor functions. -- cgit v1.2.3 From cb59bf722e597899c0653777f72bcc85ab476eca Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Tue, 23 Jun 2009 16:27:35 +0000 Subject: Move shadow option (for text) from editor/interface to blenfont. Two new function: BLF_shadow: set the level (for blur) and the shadow color. BLF_shadow_offset: set the x and y offset for shadow. (this is the current position plus offset) By default shadow is not enable in the font, so before draw the text you need call BLF_enable(BLF_SHADOW), also remember disable the option in the end. --- source/blender/blenfont/BLF_api.h | 16 +++++++++++ source/blender/blenfont/intern/blf.c | 25 +++++++++++++++++ source/blender/blenfont/intern/blf_glyph.c | 31 ++++++++++++++++++++++ .../blender/blenfont/intern/blf_internal_types.h | 10 +++++++ source/blender/editors/interface/interface_style.c | 30 +++++++-------------- 5 files changed, 91 insertions(+), 21 deletions(-) (limited to 'source') diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index e871de490f3..cb64615d64c 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -90,6 +90,21 @@ void BLF_kerning(float space); void BLF_enable(int option); void BLF_disable(int option); +/* + * Shadow options, level is the blur level, can be 3, 5 or 0 and + * the other argument are the rgba color. + * Take care that shadow need to be enable using BLF_enable!!. + */ +void BLF_shadow(int level, float r, float g, float b, float a); + +/* + * Set the offset for shadow text, this is the current cursor + * position plus this offset, don't need call BLF_position before + * this function, the current position is calculate only on + * BLF_draw, so it's safe call this whenever you like. + */ +void BLF_shadow_offset(int x, int y); + /* * Search the path directory to the locale files, this try all * the case for Linux, Win and Mac. @@ -119,6 +134,7 @@ void BLF_dir_free(char **dirs, int count); #define BLF_CLIPPING (1<<1) #define BLF_FONT_KERNING (1<<2) #define BLF_USER_KERNING (1<<3) +#define BLF_SHADOW (1<<4) /* font->mode. */ #define BLF_MODE_TEXTURE 0 diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index f06c7fb0d28..9dad5a4bfa0 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -500,3 +500,28 @@ void BLF_kerning(float space) if (font) font->kerning= space; } + +void BLF_shadow(int level, float r, float g, float b, float a) +{ + FontBLF *font; + + font= global_font[global_font_cur]; + if (font) { + font->shadow= level; + font->shadow_col[0]= r; + font->shadow_col[1]= g; + font->shadow_col[2]= b; + font->shadow_col[3]= a; + } +} + +void BLF_shadow_offset(int x, int y) +{ + FontBLF *font; + + font= global_font[global_font_cur]; + if (font) { + font->shadow_x= x; + font->shadow_y= y; + } +} diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 33a435cc5be..5e0868ea680 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -496,8 +496,18 @@ int blf_glyph_texture_render(FontBLF *font, GlyphBLF *g, float x, float y) GLint cur_tex; float dx, dx1; float y1, y2; + float xo, yo; + float color[4]; gt= g->tex_data; + + if (font->flags & BLF_SHADOW) { + xo= x; + yo= y; + x += font->shadow_x; + y += font->shadow_y; + } + dx= floor(x + gt->pos_x); dx1= dx + gt->width; y1= y + gt->pos_y; @@ -518,6 +528,27 @@ int blf_glyph_texture_render(FontBLF *font, GlyphBLF *g, float x, float y) if (cur_tex != gt->tex) glBindTexture(GL_TEXTURE_2D, gt->tex); + if (font->flags & BLF_SHADOW) { + glGetFloatv(GL_CURRENT_COLOR, color); + glColor4fv(font->shadow_col); + + if (font->shadow == 3) + blf_texture3_draw(gt->uv, dx, y1, dx1, y2); + else if (font->shadow == 5) + blf_texture5_draw(gt->uv, dx, y1, dx1, y2); + else + blf_texture_draw(gt->uv, dx, y1, dx1, y2); + + glColor4fv(color); + x= xo; + y= yo; + + dx= floor(x + gt->pos_x); + dx1= dx + gt->width; + y1= y + gt->pos_y; + y2= y + gt->pos_y - gt->height; + } + if (font->blur==3) blf_texture3_draw(gt->uv, dx, y1, dx1, y2); else if (font->blur==5) diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h index 60446aa93b2..5382ac19aae 100644 --- a/source/blender/blenfont/intern/blf_internal_types.h +++ b/source/blender/blenfont/intern/blf_internal_types.h @@ -154,6 +154,16 @@ typedef struct FontBLF { /* blur: 3 or 5 large kernel */ int blur; + + /* shadow level. */ + int shadow; + + /* and shadow offset. */ + int shadow_x; + int shadow_y; + + /* shadow color. */ + float shadow_col[4]; /* this is the matrix that we load before rotate/scale/translate. */ float mat[4][4]; diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 831a8a5bf6c..0d30d8e69c0 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -145,22 +145,6 @@ static uiFont *uifont_to_blfont(int id) /* *************** draw ************************ */ -static void ui_font_shadow_draw(uiFontStyle *fs, int x, int y, char *str) -{ - float color[4]; - - glGetFloatv(GL_CURRENT_COLOR, color); - - glColor4f(fs->shadowcolor, fs->shadowcolor, fs->shadowcolor, fs->shadowalpha); - - BLF_blur(fs->shadow); - BLF_position(x+fs->shadx, y+fs->shady, 0.0f); - BLF_draw(str); - BLF_blur(0); - - glColor4fv(color); -} - void uiStyleFontDraw(uiFontStyle *fs, rcti *rect, char *str) { float height; @@ -179,14 +163,18 @@ void uiStyleFontDraw(uiFontStyle *fs, rcti *rect, char *str) /* clip is very strict, so we give it some space */ BLF_clipping(rect->xmin-1, rect->ymin-4, rect->xmax+1, rect->ymax+4); BLF_enable(BLF_CLIPPING); - - if(fs->shadow) - ui_font_shadow_draw(fs, rect->xmin+xofs, rect->ymin+yofs, str); - BLF_position(rect->xmin+xofs, rect->ymin+yofs, 0.0f); - BLF_draw(str); + if (fs->shadow) { + BLF_enable(BLF_SHADOW); + BLF_shadow(fs->shadow, fs->shadowcolor, fs->shadowcolor, fs->shadowcolor, fs->shadowalpha); + BLF_shadow_offset(fs->shadx, fs->shady); + } + + BLF_draw(str); BLF_disable(BLF_CLIPPING); + if (fs->shadow) + BLF_disable(BLF_SHADOW); } /* ************** helpers ************************ */ -- cgit v1.2.3 From 61e7734aaf983d0f4ce3287aef4b702e5b235d05 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 23 Jun 2009 16:57:46 +0000 Subject: 2.5 Game engine Makefile update. Note to coders: including BLO_ for only intptr typedef is ehh... not so nice. But it should not have been added there in first place. (BLO_ = .blend file read/write). Nice for a future cleanup. :) Also goes for ED_ includes btw, = bad level call for GE! If you need it to get things work now, fine, but it will make player impossible. --- source/gameengine/Expressions/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/gameengine/Expressions/Makefile b/source/gameengine/Expressions/Makefile index f46c0037200..09512c3ae87 100644 --- a/source/gameengine/Expressions/Makefile +++ b/source/gameengine/Expressions/Makefile @@ -37,6 +37,7 @@ CCFLAGS += $(LEVEL_1_CPP_WARNINGS) CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) CPPFLAGS += -I../../blender/makesdna +CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include -- cgit v1.2.3 From af3f862480cfa843f07fc9c16ddaf1f4fd877ae2 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 23 Jun 2009 17:06:46 +0000 Subject: 2.5 Removing editors/include export from Make, it's not needed luckily :) --- source/gameengine/Ketsji/Makefile | 1 - 1 file changed, 1 deletion(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/Makefile b/source/gameengine/Ketsji/Makefile index f57349b7138..8e91eb6ff9a 100644 --- a/source/gameengine/Ketsji/Makefile +++ b/source/gameengine/Ketsji/Makefile @@ -59,7 +59,6 @@ CPPFLAGS += -I. CPPFLAGS += -I../Converter CPPFLAGS += -I../../blender/blenkernel CPPFLAGS += -I../../blender/blenlib -CPPFLAGS += -I../../blender/editors/include CPPFLAGS += -I../../blender/makesdna CPPFLAGS += -I../../blender/imbuf CPPFLAGS += -I../../blender/gpu -- cgit v1.2.3 From dd493f71bee1896823b50c68fb8f96ecf7dd959c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 23 Jun 2009 17:10:46 +0000 Subject: modified patch from Arystanbek, allow assigning of mathutils matrix to an rna matrix --- source/blender/python/intern/bpy_rna.c | 40 ++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 70ccd4f58c9..e91b96d6f26 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -410,14 +410,29 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v if (len > 0) { PyObject *item; + int py_len = -1; int i; - if (!PySequence_Check(value)) { + +#ifdef USE_MATHUTILS + if(MatrixObject_Check(value)) { + MatrixObject *mat = (MatrixObject*)value; + if(!Matrix_ReadCallback(mat)) + return -1; + + py_len = mat->rowSize * mat->colSize; + } else // continue... +#endif + if (PySequence_Check(value)) { + py_len= (int)PySequence_Length(value); + } + else { PyErr_SetString(PyExc_TypeError, "expected a python sequence type assigned to an RNA array."); return -1; } + /* done getting the length */ - if ((int)PySequence_Length(value) != len) { + if (py_len != len) { PyErr_SetString(PyExc_AttributeError, "python sequence length did not match the RNA array."); return -1; } @@ -484,14 +499,21 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v else param_arr = MEM_mallocN(sizeof(float) * len, "pyrna float array"); - - /* collect the variables */ - for (i=0; icontigPtr, sizeof(float) * len); + } else // continue... +#endif + { + /* collect the variables */ + for (i=0; i Date: Tue, 23 Jun 2009 17:30:18 +0000 Subject: fix ui issues of space_logic --- .../blender/editors/interface/interface_widgets.c | 1 + source/blender/editors/space_logic/logic_window.c | 100 ++++++++++----------- 2 files changed, 51 insertions(+), 50 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 14df9026078..bae8cdab2cd 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1902,6 +1902,7 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type) break; case UI_WTYPE_TOGGLE: + wt.wcol_theme= &btheme->tui.wcol_radio;/*use radio theme for toggles*/ break; case UI_WTYPE_OPTION: diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index b328ed74e08..55e21561c34 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -3056,12 +3056,12 @@ void logic_buttons(bContext *C, ARegion *ar) /* ******************************* */ xco= 500; yco= 170; width= 300; - uiDefPulldownBut(block, controller_menu, NULL, "Controllers", xco-10, yco+35, 100, 19, ""); + uiDefBlockBut(block, controller_menu, NULL, "Controllers", xco-10, yco+35, 100, UI_UNIT_Y, ""); uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, BUTS_CONT_SEL, B_REDR, "Sel", xco+110, yco+35, (width-100)/3, 19, &slogic->scaflag, 0, 0, 0, 0, "Show all selected Objects"); - uiDefButBitS(block, TOG, BUTS_CONT_ACT, B_REDR, "Act", xco+110+(width-100)/3, yco+35, (width-100)/3, 19, &slogic->scaflag, 0, 0, 0, 0, "Show active Object"); - uiDefButBitS(block, TOG, BUTS_CONT_LINK, B_REDR, "Link", xco+110+2*(width-100)/3, yco+35, (width-100)/3, 19, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Sensor/Actuator"); + uiDefButBitS(block, TOG, BUTS_CONT_SEL, B_REDR, "Sel", xco+110, yco+35, (width-100)/3, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show all selected Objects"); + uiDefButBitS(block, TOG, BUTS_CONT_ACT, B_REDR, "Act", xco+110+(width-100)/3, yco+35, (width-100)/3, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show active Object"); + uiDefButBitS(block, TOG, BUTS_CONT_LINK, B_REDR, "Link", xco+110+2*(width-100)/3, yco+35, (width-100)/3, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Sensor/Actuator"); uiBlockEndAlign(block); ob= CTX_data_active_object(C); @@ -3077,9 +3077,9 @@ void logic_buttons(bContext *C, ARegion *ar) /* presume it is only objects for now */ uiBlockBeginAlign(block); // if(ob->controllers.first) uiSetCurFont(block, UI_HELVB); - uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), 19, &ob->scaflag, 0, 0, 0, 0, "Active Object name"); + uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Active Object name"); // if(ob->controllers.first) uiSetCurFont(block, UI_HELV); - uiDefButBitS(block, TOG, OB_ADDCONT, B_ADD_CONT, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Controller"); + uiDefButBitS(block, TOG, OB_ADDCONT, B_ADD_CONT, "Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Controller"); uiBlockEndAlign(block); yco-=20; @@ -3100,7 +3100,7 @@ void logic_buttons(bContext *C, ARegion *ar) if(ob->scaflag & OB_SHOWCONT) { /* first show the state */ - uiDefBlockBut(block, object_state_mask_menu, ob, "State", (short)(xco-10), (short)(yco-10), 36, 19, "Object state menu: store and retrieve initial state"); + uiDefBlockBut(block, object_state_mask_menu, ob, "State", (short)(xco-10), (short)(yco-10), 36, UI_UNIT_Y, "Object state menu: store and retrieve initial state"); if (!ob->state) ob->state = 1; @@ -3116,9 +3116,9 @@ void logic_buttons(bContext *C, ARegion *ar) } } uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, OB_SETSTBIT, B_SET_STATE_BIT, "All",(short)(xco+226), yco-10, 22, 19, &ob->scaflag, 0, 0, 0, 0, "Set all state bits"); - uiDefButBitS(block, TOG, OB_INITSTBIT, B_INIT_STATE_BIT, "Ini",(short)(xco+248), yco-10, 22, 19, &ob->scaflag, 0, 0, 0, 0, "Set the initial state"); - uiDefButBitS(block, TOG, OB_DEBUGSTATE, 0, "D",(short)(xco+270), yco-10, 15, 19, &ob->scaflag, 0, 0, 0, 0, "Print state debug info"); + uiDefButBitS(block, TOG, OB_SETSTBIT, B_SET_STATE_BIT, "All",(short)(xco+226), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set all state bits"); + uiDefButBitS(block, TOG, OB_INITSTBIT, B_INIT_STATE_BIT, "Ini",(short)(xco+248), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set the initial state"); + uiDefButBitS(block, TOG, OB_DEBUGSTATE, 0, "D",(short)(xco+270), yco-10, 15, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Print state debug info"); uiBlockEndAlign(block); yco-=35; @@ -3142,17 +3142,17 @@ void logic_buttons(bContext *C, ARegion *ar) if (act) act->flag |= ACT_VISIBLE; } - uiDefIconButBitS(block, TOG, CONT_DEL, B_DEL_CONT, ICON_X, xco, yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Delete Controller"); - uiDefIconButBitS(block, ICONTOG, CONT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Controller settings"); - uiDefIconButBitS(block, TOG, CONT_PRIO, B_REDR, ICON_BOOKMARKS, (short)(xco+width-66), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Mark controller for execution before all non-marked controllers (good for startup scripts)"); + uiDefIconButBitS(block, TOG, CONT_DEL, B_DEL_CONT, ICON_X, xco, yco, 22, UI_UNIT_Y, &cont->flag, 0, 0, 0, 0, "Delete Controller"); + uiDefIconButBitS(block, ICONTOG, CONT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, UI_UNIT_Y, &cont->flag, 0, 0, 0, 0, "Controller settings"); + uiDefIconButBitS(block, TOG, CONT_PRIO, B_REDR, ICON_BOOKMARKS, (short)(xco+width-66), yco, 22, UI_UNIT_Y, &cont->flag, 0, 0, 0, 0, "Mark controller for execution before all non-marked controllers (good for startup scripts)"); sprintf(name, "%d", first_bit(cont->state_mask)+1); - uiDefBlockBut(block, controller_state_mask_menu, cont, name, (short)(xco+width-44), yco, 22, 19, "Set controller state index (from 1 to 30)"); + uiDefBlockBut(block, controller_state_mask_menu, cont, name, (short)(xco+width-44), yco, 22, UI_UNIT_Y, "Set controller state index (from 1 to 30)"); if(cont->flag & CONT_SHOW) { cont->otype= cont->type; - uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 70, 19, &cont->type, 0, 0, 0, 0, "Controller type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-158), 19, cont->name, 0, 31, 0, 0, "Controller name"); + uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 70, UI_UNIT_Y, &cont->type, 0, 0, 0, 0, "Controller type"); + but= uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-158), UI_UNIT_Y, cont->name, 0, 31, 0, 0, "Controller name"); uiButSetFunc(but, make_unique_prop_names_cb, cont->name, (void*) 0); ycoo= yco; @@ -3162,17 +3162,17 @@ void logic_buttons(bContext *C, ARegion *ar) else { cpack(0x999999); glRecti(xco+22, yco, xco+width-22,yco+19); - but= uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, 19, cont, 0, 0, 0, 0, "Controller type"); + but= uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller type"); uiButSetFunc(but, sca_move_controller, cont, NULL); - but= uiDefBut(block, LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-158), 19, cont, 0, 0, 0, 0, "Controller name"); + but= uiDefBut(block, LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-158), UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller name"); uiButSetFunc(but, sca_move_controller, cont, NULL); ycoo= yco; } - but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, 19, 19, NULL, 0, 0, 0, 0, ""); + but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); uiSetButLink(but, NULL, (void ***)&(cont->links), &cont->totlinks, LINK_CONTROLLER, LINK_ACTUATOR); - uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, 19, 19, cont, LINK_CONTROLLER, 0, 0, 0, ""); + uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, UI_UNIT_X, UI_UNIT_Y, cont, LINK_CONTROLLER, 0, 0, 0, ""); /* offset is >0 if at least one controller was displayed */ offset++; yco-=20; @@ -3188,13 +3188,13 @@ void logic_buttons(bContext *C, ARegion *ar) /* ******************************* */ xco= 10; yco= 170; width= 400; - uiDefPulldownBut(block, sensor_menu, NULL, "Sensors", xco-10, yco+35, 70, 19, ""); + uiDefBlockBut(block, sensor_menu, NULL, "Sensors", xco-10, yco+35, 70, UI_UNIT_Y, ""); uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, BUTS_SENS_SEL, B_REDR, "Sel", xco+80, yco+35, (width-70)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show all selected Objects"); - uiDefButBitS(block, TOG, BUTS_SENS_ACT, B_REDR, "Act", xco+80+(width-70)/4, yco+35, (width-70)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show active Object"); - uiDefButBitS(block, TOG, BUTS_SENS_LINK, B_REDR, "Link", xco+80+2*(width-70)/4, yco+35, (width-70)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller"); - uiDefButBitS(block, TOG, BUTS_SENS_STATE, B_REDR, "State", xco+80+3*(width-70)/4, yco+35, (width-70)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show only sensors connected to active states"); + uiDefButBitS(block, TOG, BUTS_SENS_SEL, B_REDR, "Sel", xco+80, yco+35, (width-70)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show all selected Objects"); + uiDefButBitS(block, TOG, BUTS_SENS_ACT, B_REDR, "Act", xco+80+(width-70)/4, yco+35, (width-70)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show active Object"); + uiDefButBitS(block, TOG, BUTS_SENS_LINK, B_REDR, "Link", xco+80+2*(width-70)/4, yco+35, (width-70)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller"); + uiDefButBitS(block, TOG, BUTS_SENS_STATE, B_REDR, "State", xco+80+3*(width-70)/4, yco+35, (width-70)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show only sensors connected to active states"); uiBlockEndAlign(block); for(a=0; asensors.first) uiSetCurFont(block, UI_HELVB); - uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), 19, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors"); + uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors"); // if(ob->sensors.first) uiSetCurFont(block, UI_HELV); - uiDefButBitS(block, TOG, OB_ADDSENS, B_ADD_SENS, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Sensor"); + uiDefButBitS(block, TOG, OB_ADDSENS, B_ADD_SENS, "Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Sensor"); uiBlockEndAlign(block); yco-=20; @@ -3226,17 +3226,17 @@ void logic_buttons(bContext *C, ARegion *ar) pin = (slogic->scaflag & BUTS_SENS_STATE && (sens->flag & SENS_SHOW || sens->flag & SENS_PIN)) ? 1:0 ; sens->flag |= SENS_VISIBLE; - uiDefIconButBitS(block, TOG, SENS_DEL, B_DEL_SENS, ICON_X, xco, yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Delete Sensor"); + uiDefIconButBitS(block, TOG, SENS_DEL, B_DEL_SENS, ICON_X, xco, yco, 22, UI_UNIT_Y, &sens->flag, 0, 0, 0, 0, "Delete Sensor"); if (pin) - uiDefIconButBitS(block, ICONTOG, SENS_PIN, B_REDR, ICON_PINNED, (short)(xco+width-44), yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Display when not linked to a visible states controller"); + uiDefIconButBitS(block, ICONTOG, SENS_PIN, B_REDR, ICON_PINNED, (short)(xco+width-44), yco, 22, UI_UNIT_Y, &sens->flag, 0, 0, 0, 0, "Display when not linked to a visible states controller"); - uiDefIconButBitS(block, ICONTOG, SENS_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Sensor settings"); + uiDefIconButBitS(block, ICONTOG, SENS_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, UI_UNIT_Y, &sens->flag, 0, 0, 0, 0, "Sensor settings"); ycoo= yco; if(sens->flag & SENS_SHOW) { - uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 80, 19, &sens->type, 0, 0, 0, 0, "Sensor type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-(pin?146:124)), 19, sens->name, 0, 31, 0, 0, "Sensor name"); + uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 80, UI_UNIT_Y, &sens->type, 0, 0, 0, 0, "Sensor type"); + but= uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens->name, 0, 31, 0, 0, "Sensor name"); uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0); sens->otype= sens->type; @@ -3246,13 +3246,13 @@ void logic_buttons(bContext *C, ARegion *ar) else { set_col_sensor(sens->type, 1); glRecti(xco+22, yco, xco+width-22,yco+19); - but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, 19, sens, 0, 0, 0, 0, ""); + but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, UI_UNIT_Y, sens, 0, 0, 0, 0, ""); uiButSetFunc(but, sca_move_sensor, sens, NULL); - but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), 19, sens, 0, 31, 0, 0, ""); + but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens, 0, 31, 0, 0, ""); uiButSetFunc(but, sca_move_sensor, sens, NULL); } - but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, 19, 19, NULL, 0, 0, 0, 0, ""); + but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); uiSetButLink(but, NULL, (void ***)&(sens->links), &sens->totlinks, LINK_SENSOR, LINK_CONTROLLER); yco-=20; @@ -3266,13 +3266,13 @@ void logic_buttons(bContext *C, ARegion *ar) /* ******************************* */ xco= 900; yco= 170; width= 400; - uiDefPulldownBut(block, actuator_menu, NULL, "Actuators", xco-10, yco+35, 90, 19, ""); + uiDefBlockBut(block, actuator_menu, NULL, "Actuators", xco-10, yco+35, 90, UI_UNIT_Y, ""); uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, BUTS_ACT_SEL, B_REDR, "Sel", xco+110, yco+35, (width-100)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show all selected Objects"); - uiDefButBitS(block, TOG, BUTS_ACT_ACT, B_REDR, "Act", xco+110+(width-100)/4, yco+35, (width-100)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show active Object"); - uiDefButBitS(block, TOG, BUTS_ACT_LINK, B_REDR, "Link", xco+110+2*(width-100)/4, yco+35, (width-100)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller"); - uiDefButBitS(block, TOG, BUTS_ACT_STATE, B_REDR, "State", xco+110+3*(width-100)/4, yco+35, (width-100)/4, 19, &slogic->scaflag, 0, 0, 0, 0, "Show only actuators connected to active states"); + uiDefButBitS(block, TOG, BUTS_ACT_SEL, B_REDR, "Sel", xco+110, yco+35, (width-100)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show all selected Objects"); + uiDefButBitS(block, TOG, BUTS_ACT_ACT, B_REDR, "Act", xco+110+(width-100)/4, yco+35, (width-100)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show active Object"); + uiDefButBitS(block, TOG, BUTS_ACT_LINK, B_REDR, "Link", xco+110+2*(width-100)/4, yco+35, (width-100)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller"); + uiDefButBitS(block, TOG, BUTS_ACT_STATE, B_REDR, "State", xco+110+3*(width-100)/4, yco+35, (width-100)/4, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show only actuators connected to active states"); uiBlockEndAlign(block); for(a=0; aactuators.first) uiSetCurFont(block, UI_HELVB); - uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2,(short)(xco-10), yco,(short)(width-30), 19, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators"); + uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2,(short)(xco-10), yco,(short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators"); // if(ob->actuators.first) uiSetCurFont(block, UI_HELV); - uiDefButBitS(block, TOG, OB_ADDACT, B_ADD_ACT, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Actuator"); + uiDefButBitS(block, TOG, OB_ADDACT, B_ADD_ACT, "Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Actuator"); uiBlockEndAlign(block); yco-=20; @@ -3301,15 +3301,15 @@ void logic_buttons(bContext *C, ARegion *ar) pin = (slogic->scaflag & BUTS_ACT_STATE && (act->flag & SENS_SHOW || act->flag & SENS_PIN)) ? 1:0 ; act->flag |= ACT_VISIBLE; /* mark the actuator as visible to help implementing the up/down action */ - uiDefIconButBitS(block, TOG, ACT_DEL, B_DEL_ACT, ICON_X, xco, yco, 22, 19, &act->flag, 0, 0, 0, 0, "Delete Actuator"); + uiDefIconButBitS(block, TOG, ACT_DEL, B_DEL_ACT, ICON_X, xco, yco, 22, UI_UNIT_Y, &act->flag, 0, 0, 0, 0, "Delete Actuator"); if (pin) - uiDefIconButBitS(block, ICONTOG, ACT_PIN, B_REDR, ICON_PINNED, (short)(xco+width-44), yco, 22, 19, &act->flag, 0, 0, 0, 0, "Display when not linked to a visible states controller"); - uiDefIconButBitS(block, ICONTOG, ACT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &act->flag, 0, 0, 0, 0, "Display the actuator"); + uiDefIconButBitS(block, ICONTOG, ACT_PIN, B_REDR, ICON_PINNED, (short)(xco+width-44), yco, 22, UI_UNIT_Y, &act->flag, 0, 0, 0, 0, "Display when not linked to a visible states controller"); + uiDefIconButBitS(block, ICONTOG, ACT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, UI_UNIT_Y, &act->flag, 0, 0, 0, 0, "Display the actuator"); if(act->flag & ACT_SHOW) { act->otype= act->type; - uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 90, 19, &act->type, 0, 0, 0, 0, "Actuator type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+112), yco, (short)(width-(pin?156:134)), 19, act->name, 0, 31, 0, 0, "Actuator name"); + uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 90, UI_UNIT_Y, &act->type, 0, 0, 0, 0, "Actuator type"); + but= uiDefBut(block, TEX, 1, "", (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act->name, 0, 31, 0, 0, "Actuator name"); uiButSetFunc(but, make_unique_prop_names_cb, act->name, (void*) 0); ycoo= yco; @@ -3319,14 +3319,14 @@ void logic_buttons(bContext *C, ARegion *ar) else { set_col_actuator(act->type, 1); glRecti((short)(xco+22), yco, (short)(xco+width-22),(short)(yco+19)); - but= uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 90, 19, act, 0, 0, 0, 0, "Actuator type"); + but= uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 90, UI_UNIT_Y, act, 0, 0, 0, 0, "Actuator type"); uiButSetFunc(but, sca_move_actuator, act, NULL); - but= uiDefBut(block, LABEL, 0, act->name, (short)(xco+112), yco, (short)(width-(pin?156:134)), 19, act, 0, 0, 0, 0, "Actuator name"); + but= uiDefBut(block, LABEL, 0, act->name, (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act, 0, 0, 0, 0, "Actuator name"); uiButSetFunc(but, sca_move_actuator, act, NULL); ycoo= yco; } - uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, 19, 19, act, LINK_ACTUATOR, 0, 0, 0, ""); + uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, UI_UNIT_X, UI_UNIT_Y, act, LINK_ACTUATOR, 0, 0, 0, ""); yco-=20; } -- cgit v1.2.3 From 483e9479f73dca77fd3b6db7ede72849b1552859 Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Tue, 23 Jun 2009 18:26:01 +0000 Subject: New Style option: Overlap If this option is enable, the blenfont check for overlap characters, like one of my previous commit but now it's optional and disable by default. (This fix the "Fi" or other case when the characters are too close) Enable/disable from: Outliner -> User Preferences -> Styles -> Panel Font -> Overlap (also for other styles, Group Label, Widget, Widget Label) --- source/blender/blenfont/BLF_api.h | 1 + source/blender/blenfont/intern/blf_font.c | 36 ++++++++++++---------- source/blender/blenfont/intern/blf_glyph.c | 2 ++ source/blender/editors/interface/interface_style.c | 8 +++++ source/blender/makesdna/DNA_userdef_types.h | 3 +- source/blender/makesrna/intern/rna_userdef.c | 7 ++++- 6 files changed, 39 insertions(+), 18 deletions(-) (limited to 'source') diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index cb64615d64c..2ee31a17fa6 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -135,6 +135,7 @@ void BLF_dir_free(char **dirs, int count); #define BLF_FONT_KERNING (1<<2) #define BLF_USER_KERNING (1<<3) #define BLF_SHADOW (1<<4) +#define BLF_OVERLAP_CHAR (1<<5) /* font->mode. */ #define BLF_MODE_TEXTURE 0 diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index ee4ba0ee71a..a3c5232cc76 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -146,20 +146,22 @@ void blf_font_draw(FontBLF *font, char *str) if (FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta) == 0) { pen_x += delta.x >> 6; -/* - if (pen_x < old_pen_x) - pen_x= old_pen_x; -*/ + + if (font->flags & BLF_OVERLAP_CHAR) { + if (pen_x < old_pen_x) + pen_x= old_pen_x; + } } } if (font->flags & BLF_USER_KERNING) { old_pen_x= pen_x; pen_x += font->kerning; -/* - if (pen_x < old_pen_x) - pen_x= old_pen_x; -*/ + + if (font->flags & BLF_OVERLAP_CHAR) { + if (pen_x < old_pen_x) + pen_x= old_pen_x; + } } /* do not return this loop if clipped, we want every character tested */ @@ -228,20 +230,22 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) if (FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta) == 0) { pen_x += delta.x >> 6; -/* - if (pen_x < old_pen_x) - old_pen_x= pen_x; -*/ + + if (font->flags & BLF_OVERLAP_CHAR) { + if (pen_x < old_pen_x) + pen_x= old_pen_x; + } } } if (font->flags & BLF_USER_KERNING) { old_pen_x= pen_x; pen_x += font->kerning; -/* - if (pen_x < old_pen_x) - old_pen_x= pen_x; -*/ + + if (font->flags & BLF_OVERLAP_CHAR) { + if (pen_x < old_pen_x) + pen_x= old_pen_x; + } } gbox.xmin= g->box.xmin + pen_x; diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 5e0868ea680..a637774d7bf 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -500,6 +500,8 @@ int blf_glyph_texture_render(FontBLF *font, GlyphBLF *g, float x, float y) float color[4]; gt= g->tex_data; + xo= 0.0f; + yo= 0.0f; if (font->flags & BLF_SHADOW) { xo= x; diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 0d30d8e69c0..e8fba38f793 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -92,6 +92,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->paneltitle.uifont_id= UIFONT_DEFAULT; style->paneltitle.points= 13; style->paneltitle.kerning= 0.0; + style->paneltitle.overlap= 0; style->paneltitle.shadow= 5; style->paneltitle.shadx= 2; style->paneltitle.shady= -2; @@ -101,6 +102,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->grouplabel.uifont_id= UIFONT_DEFAULT; style->grouplabel.points= 12; style->grouplabel.kerning= 0.0; + style->grouplabel.overlap= 0; style->grouplabel.shadow= 3; style->grouplabel.shadx= 1; style->grouplabel.shady= -1; @@ -109,6 +111,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->widgetlabel.uifont_id= UIFONT_DEFAULT; style->widgetlabel.points= 11; style->widgetlabel.kerning= 0.0; + style->widgetlabel.overlap= 0; style->widgetlabel.shadow= 3; style->widgetlabel.shadx= 1; style->widgetlabel.shady= -1; @@ -171,10 +174,15 @@ void uiStyleFontDraw(uiFontStyle *fs, rcti *rect, char *str) BLF_shadow_offset(fs->shadx, fs->shady); } + if (fs->overlap) + BLF_enable(BLF_OVERLAP_CHAR); + BLF_draw(str); BLF_disable(BLF_CLIPPING); if (fs->shadow) BLF_disable(BLF_SHADOW); + if (fs->overlap) + BLF_disable(BLF_OVERLAP_CHAR); } /* ************** helpers ************************ */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 6be855a27da..db13acf12d5 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -67,7 +67,8 @@ typedef struct uiFontStyle { short uifont_id; /* saved in file, 0 is default */ short points; /* actual size depends on 'global' dpi */ float kerning; /* kerning space between characters. */ - float pad; + short overlap; /* check overlaped characters. */ + short pad; short italic, bold; /* style hint */ short shadow; /* value is amount of pixels blur */ short shadx, shady; /* shadow offset in pixels */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index f3811938e28..97337af5cb0 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -139,7 +139,12 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna) prop= RNA_def_property(srna, "kerning", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -5.0, 5.0); - RNA_def_property_ui_text(prop, "Kerning", ""); + RNA_def_property_ui_text(prop, "Kerning", "User kerning value in pixels"); + RNA_def_property_update(prop, NC_WINDOW, NULL); + + prop= RNA_def_property(srna, "overlap", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "overlap", 1); + RNA_def_property_ui_text(prop, "Overlap", "Check for overlap characters"); RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE); -- cgit v1.2.3 From 0336c2e7f5df2b104532a04161b3924870567ab3 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 24 Jun 2009 01:04:01 +0000 Subject: NLA SoC: Fixing a few cases where the wrong flags got used in last night's commit --- source/blender/editors/space_action/action_edit.c | 2 +- source/blender/editors/space_graph/graph_edit.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 272ef3222ce..70dbc42fe6e 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -406,7 +406,7 @@ static void insert_action_keys(bAnimContext *ac, short mode) /* adjust current frame for NLA-scaling */ if (adt) - cfra= BKE_nla_tweakedit_remap(adt, (float)CFRA, 1); + cfra= BKE_nla_tweakedit_remap(adt, (float)CFRA, 0); else cfra= (float)CFRA; diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index a1888e252d2..057c3c40ddf 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -288,7 +288,7 @@ static void create_ghost_curves (bAnimContext *ac, int start, int end) /* use the sampling callback at 1-frame intervals from start to end frames */ for (cfra= start; cfra <= end; cfra++, fpt++) { - float cfrae= BKE_nla_tweakedit_remap(adt, cfra, 1); + float cfrae= BKE_nla_tweakedit_remap(adt, cfra, 0); fpt->vec[0]= cfrae; fpt->vec[1]= fcurve_samplingcb_evalcurve(fcu, NULL, cfrae); @@ -427,7 +427,7 @@ static int graphkeys_click_insert_exec (bContext *C, wmOperator *op) /* apply inverse NLA-mapping to frame to get correct time in un-scaled action */ adt= ANIM_nla_mapping_get(&ac, ale); - frame= BKE_nla_tweakedit_remap(adt, frame, 1); + frame= BKE_nla_tweakedit_remap(adt, frame, 0); /* insert keyframe on the specified frame + value */ insert_vert_fcurve((FCurve *)ale->data, frame, val, 0); -- cgit v1.2.3 From 717916c2b9975b08ed35a8224bf17ccb6df3310b Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 24 Jun 2009 01:41:12 +0000 Subject: NLA SoC: Fixes for segfaults during NLA Transforms The snapping code was incorrectly assuming that td->extra was always AnimData, but for NLA this is incorrect as it is used for special data used for checking back. --- source/blender/editors/transform/transform.c | 23 +++++++--------------- .../editors/transform/transform_conversions.c | 4 ++-- 2 files changed, 9 insertions(+), 18 deletions(-) (limited to 'source') diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index f115bb9a068..a417aa46773 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -4470,10 +4470,11 @@ static void applyTimeTranslate(TransInfo *t, float sval) /* it doesn't matter whether we apply to t->data or t->data2d, but t->data2d is more convenient */ for (i = 0 ; i < t->total; i++, td++) { - /* it is assumed that td->ob is a pointer to the object, + /* it is assumed that td->extra is a pointer to the AnimData, * whose active action is where this keyframe comes from + * (this is only valid when not in NLA) */ - AnimData *adt= td->extra; + AnimData *adt= (t->spacetype != SPACE_NLA) ? td->extra : NULL; /* check if any need to apply nla-mapping */ if (adt) { @@ -4606,8 +4607,9 @@ static void applyTimeSlide(TransInfo *t, float sval) for (i = 0 ; i < t->total; i++, td++) { /* it is assumed that td->extra is a pointer to the AnimData, * whose active action is where this keyframe comes from + * (this is only valid when not in NLA) */ - AnimData *adt= td->extra; + AnimData *adt= (t->spacetype != SPACE_NLA) ? td->extra : NULL; float cval = t->values[0]; /* apply NLA-mapping to necessary values */ @@ -4709,8 +4711,9 @@ static void applyTimeScale(TransInfo *t) { for (i = 0 ; i < t->total; i++, td++) { /* it is assumed that td->extra is a pointer to the AnimData, * whose active action is where this keyframe comes from + * (this is only valid when not in NLA) */ - AnimData *adt= td->extra; + AnimData *adt= (t->spacetype != SPACE_NLA) ? td->extra : NULL; float startx= CFRA; float fac= t->values[0]; @@ -4745,18 +4748,6 @@ int TimeScale(TransInfo *t, short mval[2]) sval= t->imval[0]; cval= mval[0]; - // XXX ewww... we need a better factor! -#if 0 // TRANSFORM_FIX_ME - switch (t->spacetype) { - case SPACE_ACTION: - width= ACTWIDTH; - break; - case SPACE_NLA: - width= NLAWIDTH; - break; - } -#endif - /* calculate scaling factor */ startx= sval-(width/2+(t->ar->winx)/2); deltax= cval-(width/2+(t->ar->winx)/2); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index fc5a6b85de4..1f75384880e 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -3271,7 +3271,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) * higher scaling ratios, but is faster than converting all points) */ if (adt) - cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, 1); + cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, 0); else cfra = (float)CFRA; @@ -3330,7 +3330,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) * higher scaling ratios, but is faster than converting all points) */ if (adt) - cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, 1); + cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, 0); else cfra = (float)CFRA; -- cgit v1.2.3 From db03788ad3ffe3a4c777b70fa5c53f99c5900620 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 24 Jun 2009 02:11:36 +0000 Subject: 2.5 - Particle Settings now Animateable Added AnimData to ParticleSettings so that this will work. This seems to be ok in the brief tests I did, but be warned that this may not be optimal for the Particles System... --- source/blender/blenkernel/intern/anim_sys.c | 4 ++++ source/blender/blenloader/intern/readfile.c | 5 +++++ source/blender/blenloader/intern/writefile.c | 2 ++ source/blender/makesdna/DNA_particle_types.h | 5 ++++- source/blender/makesrna/intern/rna_particle.c | 11 +++-------- 5 files changed, 18 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 30dcb383ef6..441e17f3318 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -43,6 +43,7 @@ static short id_has_animdata (ID *id) case ID_OB: case ID_CU: case ID_KE: + case ID_PA: case ID_MA: case ID_TE: case ID_NT: case ID_LA: case ID_CA: case ID_WO: case ID_SCE: @@ -883,6 +884,9 @@ void BKE_animsys_evaluate_all_animation (Main *main, float ctime) /* meshes */ // TODO... + /* particles */ + EVAL_ANIM_IDS(main->particle.first, ADT_RECALC_ANIM); + /* objects */ /* ADT_RECALC_ANIM doesn't need to be supplied here, since object AnimData gets * this tagged by Depsgraph on framechange diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 54caad7f35b..7921740cbe8 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2899,7 +2899,9 @@ static void lib_link_particlesettings(FileData *fd, Main *main) part= main->particle.first; while(part) { if(part->id.flag & LIB_NEEDLINK) { + if (part->adt) lib_link_animdata(fd, &part->id, part->adt); part->ipo= newlibadr_us(fd, part->id.lib, part->ipo); // XXX depreceated - old animation system + part->dup_ob = newlibadr(fd, part->id.lib, part->dup_ob); part->dup_group = newlibadr(fd, part->id.lib, part->dup_group); part->eff_group = newlibadr(fd, part->id.lib, part->eff_group); @@ -2912,6 +2914,7 @@ static void lib_link_particlesettings(FileData *fd, Main *main) static void direct_link_particlesettings(FileData *fd, ParticleSettings *part) { + part->adt= newdataadr(fd, part->adt); part->pd= newdataadr(fd, part->pd); part->pd2= newdataadr(fd, part->pd2); } @@ -9522,6 +9525,8 @@ static void expand_particlesettings(FileData *fd, Main *mainvar, ParticleSetting expand_doit(fd, mainvar, part->dup_group); expand_doit(fd, mainvar, part->eff_group); expand_doit(fd, mainvar, part->bb_ob); + + expand_animdata(fd, mainvar, part->adt); } static void expand_group(FileData *fd, Main *mainvar, Group *group) diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 172c081570b..565e8128f8c 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -382,6 +382,7 @@ static void writedata(WriteData *wd, int filecode, int len, void *adr) /* do not /*These functions are used by blender's .blend system for file saving/loading.*/ void IDP_WriteProperty_OnlyData(IDProperty *prop, void *wd); void IDP_WriteProperty(IDProperty *prop, void *wd); +void write_animdata(WriteData *wd, AnimData *adt); // XXX code needs reshuffling, but not before NLA SoC is merged back into 2.5 static void IDP_WriteArray(IDProperty *prop, void *wd) { @@ -575,6 +576,7 @@ static void write_particlesettings(WriteData *wd, ListBase *idbase) /* write LibData */ writestruct(wd, ID_PA, "ParticleSettings", 1, part); if (part->id.properties) IDP_WriteProperty(part->id.properties, wd); + if (part->adt) write_animdata(wd, part->adt); writestruct(wd, DATA, "PartDeflect", 1, part->pd); writestruct(wd, DATA, "PartDeflect", 1, part->pd2); } diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index b10f35b9091..05f1cc1f351 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -34,6 +34,8 @@ #include "DNA_ID.h" +struct AnimData; + typedef struct HairKey { float co[3]; /* location of hair vertex */ float time; /* time along hair, default 0-100 */ @@ -100,6 +102,7 @@ typedef struct ParticleData { typedef struct ParticleSettings { ID id; + struct AnimData *adt; int flag; short type, from, distr; @@ -167,7 +170,7 @@ typedef struct ParticleSettings { struct Group *eff_group; struct Object *dup_ob; struct Object *bb_ob; - struct Ipo *ipo; + struct Ipo *ipo; // xxx depreceated... old animation system struct PartDeflect *pd; struct PartDeflect *pd2; } ParticleSettings; diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index c48c1006588..ae53c815ed9 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1470,14 +1470,9 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Billboard Object", "Billboards face this object (default is active camera)"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); - -#if 0 - prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_pointer_sdna(prop, NULL, "ipo"); - RNA_def_property_struct_type(prop, "Ipo"); - RNA_def_property_ui_text(prop, "Ipo", ""); -#endif + + /* animation here? */ + rna_def_animdata_common(srna); // struct PartDeflect *pd; // struct PartDeflect *pd2; -- cgit v1.2.3 From e5119ee2c0d5b9510d89364600e08e40a4407f40 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 24 Jun 2009 10:32:13 +0000 Subject: NLA SoC: Drawing Tweaks * Transition tracks are now drawn in a different colour (bluish) * Action line now shows keyframe indicators for the action it is representing. These are drawn as small empty diamonds to show that they're not directly editable (and never ever will be) via the NLA Editor. * Action line is also drawn with borders to help differentiate it from the other tracks. * As an experiment, removed the 'TweakMode' buttons from the header. I had originally added this as a way of indicating that this functionality was there (and to allow for keeping track of it), though it seems to have caused far too much confusion and frustration about 'modality' instead. --- source/blender/blenkernel/intern/nla.c | 2 +- source/blender/editors/space_nla/nla_draw.c | 154 +++++++++++++++++++++----- source/blender/editors/space_nla/nla_header.c | 9 -- 3 files changed, 130 insertions(+), 35 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index a5b3b59d310..747113b6531 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -433,7 +433,7 @@ float BKE_nla_tweakedit_remap (AnimData *adt, float cframe, short invert) * and store for (very probable) future usage */ if (adt->actstrip == NULL) { - NlaTrack *nlt= BKE_nlatrack_find_active(adt); + NlaTrack *nlt= BKE_nlatrack_find_active(&adt->nla_tracks); adt->actstrip= BKE_nlastrip_find_active(nlt); } strip= adt->actstrip; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 2ac2b557243..5a22da2eb25 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -64,6 +64,7 @@ #include "BKE_utildefines.h" #include "ED_anim_api.h" +#include "ED_keyframes_draw.h" #include "ED_space_api.h" #include "ED_screen.h" @@ -89,33 +90,120 @@ extern void gl_round_box_shade(int mode, float minx, float miny, float maxx, flo /* *********************************************** */ /* Strips */ -static void nla_strip_get_color_inside (AnimData *adt, NlaStrip *strip, float color[3]) +/* Keyframe Ghosts ---------------------- */ + +/* helper func - draw keyframe as a frame only */ +static void draw_nla_keyframe_ghost (float x, float y, float xscale, float hsize) { - if ((strip->flag & NLASTRIP_FLAG_ACTIVE) && (adt && (adt->flag & ADT_NLA_EDIT_ON))) { - /* active strip should be drawn green when it is acting as the tweaking strip. - * however, this case should be skipped for when not in EditMode... - */ - // FIXME: hardcoded temp-hack colors - color[0]= 0.3f; - color[1]= 0.95f; - color[2]= 0.1f; - } - else if (strip->flag & NLASTRIP_FLAG_TWEAKUSER) { - /* alert user that this strip is also used by the tweaking track (this is set when going into - * 'editmode' for that strip), since the edits made here may not be what the user anticipated - */ - // FIXME: hardcoded temp-hack colors - color[0]= 0.85f; - color[1]= 0.0f; - color[2]= 0.0f; - } - else if (strip->flag & NLASTRIP_FLAG_SELECT) { - /* selected strip - use theme color for selected */ - UI_GetThemeColor3fv(TH_STRIP_SELECT, color); + static GLuint displist=0; + + /* initialise empty diamond shape */ + if (displist == 0) { + const float dist= 1.0f; + + displist= glGenLists(1); + glNewList(displist, GL_COMPILE); + + glBegin(GL_LINE_LOOP); + glVertex2f(0.0f, dist); + glVertex2f(dist, 0.0f); + glVertex2f(0.0f, -dist); + glVertex2f(-dist, 0.0f); + glEnd(); + + glEndList(); } + + /* adjust view transform before starting */ + glTranslatef(x, y, 0.0f); + glScalef(1.0f/xscale*hsize, hsize, 1.0f); + + /* anti-aliased lines for more consistent appearance */ + glEnable(GL_LINE_SMOOTH); + + /* draw! */ + glCallList(displist); + + glDisable(GL_LINE_SMOOTH); + + /* restore view transform */ + glScalef(xscale/hsize, 1.0f/hsize, 1.0); + glTranslatef(-x, -y, 0.0f); +} + +/* draw the keyframes in the specified Action */ +static void nla_action_draw_keyframes (AnimData *adt, View2D *v2d, float y) +{ + ListBase keys = {NULL, NULL}; + ActKeyColumn *ak; + float xscale; + + /* for now, color is hardcoded to be black */ + glColor3f(0.0f, 0.0f, 0.0f); + + /* get a list of the keyframes with NLA-scaling applied */ + action_nlascaled_to_keylist(adt, adt->action, &keys, NULL, NULL); + + /* get View2D scaling factor */ + UI_view2d_getscale(v2d, &xscale, NULL); + + /* just draw each keyframe as a simple dot (regardless of the selection status) */ + for (ak= keys.first; ak; ak= ak->next) + draw_nla_keyframe_ghost(ak->cfra, y, xscale, 3.0f); + + /* free icons */ + BLI_freelistN(&keys); +} + +/* Strips (Proper) ---------------------- */ + +static void nla_strip_get_color_inside (AnimData *adt, NlaStrip *strip, float color[3]) +{ + if (strip->type == NLASTRIP_TYPE_TRANSITION) { + /* Transition Clip */ + if (strip->flag & NLASTRIP_FLAG_SELECT) { + /* selected - use a bright blue color */ + // FIXME: hardcoded temp-hack colors + color[0]= 0.18f; + color[1]= 0.46f; + color[2]= 0.86f; + } + else { + /* normal, unselected strip - use (hardly noticable) blue tinge */ + // FIXME: hardcoded temp-hack colors + color[0]= 0.11f; + color[1]= 0.15f; + color[2]= 0.19f; + } + } else { - /* normal, unselected strip - use standard strip theme color */ - UI_GetThemeColor3fv(TH_STRIP, color); + /* Action Clip (default/normal type of strip) */ + if ((strip->flag & NLASTRIP_FLAG_ACTIVE) && (adt && (adt->flag & ADT_NLA_EDIT_ON))) { + /* active strip should be drawn green when it is acting as the tweaking strip. + * however, this case should be skipped for when not in EditMode... + */ + // FIXME: hardcoded temp-hack colors + color[0]= 0.3f; + color[1]= 0.95f; + color[2]= 0.1f; + } + else if (strip->flag & NLASTRIP_FLAG_TWEAKUSER) { + /* alert user that this strip is also used by the tweaking track (this is set when going into + * 'editmode' for that strip), since the edits made here may not be what the user anticipated + */ + // FIXME: hardcoded temp-hack colors + color[0]= 0.85f; + color[1]= 0.0f; + color[2]= 0.0f; + } + else if (strip->flag & NLASTRIP_FLAG_SELECT) { + /* selected strip - use theme color for selected */ + UI_GetThemeColor3fv(TH_STRIP_SELECT, color); + } + else { + /* normal, unselected strip - use standard strip theme color */ + UI_GetThemeColor3fv(TH_STRIP, color); + } } } @@ -328,7 +416,7 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) */ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); - + // TODO: if tweaking some action, use the same color as for the tweaked track (quick hack done for now) if (adt && (adt->flag & ADT_NLA_EDIT_ON)) { // greenish color (same as tweaking strip) - hardcoded for now @@ -351,6 +439,22 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) glVertex2f(v2d->cur.xmax, yminc+NLACHANNEL_SKIP); glEnd(); + /* draw keyframes in the action */ + nla_action_draw_keyframes(adt, v2d, y); + + /* draw 'embossed' lines above and below the strip for effect */ + /* white base-lines */ + glLineWidth(2.0f); + glColor4f(1.0f, 1.0f, 1.0f, 0.3); + fdrawline(v2d->cur.xmin, yminc+NLACHANNEL_SKIP, v2d->cur.xmax, yminc+NLACHANNEL_SKIP); + fdrawline(v2d->cur.xmin, ymaxc-NLACHANNEL_SKIP, v2d->cur.xmax, ymaxc-NLACHANNEL_SKIP); + + /* black top-lines */ + glLineWidth(1.0f); + glColor3f(0.0f, 0.0f, 0.0f); + fdrawline(v2d->cur.xmin, yminc+NLACHANNEL_SKIP, v2d->cur.xmax, yminc+NLACHANNEL_SKIP); + fdrawline(v2d->cur.xmin, ymaxc-NLACHANNEL_SKIP, v2d->cur.xmax, ymaxc-NLACHANNEL_SKIP); + glDisable(GL_BLEND); } break; diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index 1971b062c2b..2cbf3adcba7 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -182,7 +182,6 @@ static void do_nla_buttons(bContext *C, void *arg, int event) void nla_header_buttons(const bContext *C, ARegion *ar) { SpaceNla *snla= (SpaceNla *)CTX_wm_space_data(C); - Scene *scene= CTX_data_scene(C); ScrArea *sa= CTX_wm_area(C); uiBlock *block; int xco, yco= 3; @@ -254,14 +253,6 @@ void nla_header_buttons(const bContext *C, ARegion *ar) } xco += 98; - /* Tweakmode... */ - // XXX these icons need to be changed - if (scene->flag & SCE_NLA_EDIT_ON) - uiDefIconTextButO(block, BUT, "NLAEDIT_OT_tweakmode_exit", WM_OP_INVOKE_REGION_WIN, ICON_NLA, "Exit TweakMode", xco,yco,130,YIC, "Restore the true active action. (TAB)"); - else - uiDefIconTextButO(block, BUT, "NLAEDIT_OT_tweakmode_enter", WM_OP_INVOKE_REGION_WIN, ICON_EDIT, "Enter TweakMode", xco,yco,130,YIC, "Temporarily set the action referenced by the active strip as the active action so that it can be tweaked. (TAB)"); - xco+= 150; - /* always as last */ UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); -- cgit v1.2.3 From 16f32ec4ed8cbb8d719e142d4706d39b2625bd67 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 24 Jun 2009 10:48:37 +0000 Subject: 2.5 - Quick compiling fix for particles-animation commit earlier. For some reason, compilation was broke on some compilers. --- source/blender/blenloader/intern/writefile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 565e8128f8c..ef1e7d70a1e 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -382,7 +382,7 @@ static void writedata(WriteData *wd, int filecode, int len, void *adr) /* do not /*These functions are used by blender's .blend system for file saving/loading.*/ void IDP_WriteProperty_OnlyData(IDProperty *prop, void *wd); void IDP_WriteProperty(IDProperty *prop, void *wd); -void write_animdata(WriteData *wd, AnimData *adt); // XXX code needs reshuffling, but not before NLA SoC is merged back into 2.5 +static void write_animdata(WriteData *wd, AnimData *adt); // XXX code needs reshuffling, but not before NLA SoC is merged back into 2.5 static void IDP_WriteArray(IDProperty *prop, void *wd) { -- cgit v1.2.3 From 3533cda80c7b52f8ffca3e3928bedb5bfa96b320 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 24 Jun 2009 12:12:11 +0000 Subject: NLA SoC: Delete Tracks Operator (XKEY / DELKEY) over the channel list This deletes all the strips in the relevant (selected) tracks too. --- source/blender/editors/space_nla/nla_channels.c | 54 +++++++++++++++++++++++++ source/blender/editors/space_nla/nla_draw.c | 5 +-- source/blender/editors/space_nla/nla_intern.h | 1 + source/blender/editors/space_nla/nla_ops.c | 5 +++ 4 files changed, 61 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index a1c0de1e552..0a2c32b5f52 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -423,4 +423,58 @@ void NLA_OT_add_tracks (wmOperatorType *ot) RNA_def_boolean(ot->srna, "above_selected", 0, "Above Selected", "Add a new NLA Track above every existing selected one."); } +/* ******************** Delete Tracks Operator ***************************** */ +/* Delete selected NLA Tracks */ + +static int nlaedit_delete_tracks_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the AnimData blocks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_SEL); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* delete tracks */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + AnimData *adt= BKE_animdata_from_id(ale->id); + + /* call delete on this track - deletes all strips too */ + free_nlatrack(&adt->nla_tracks, nlt); + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done */ + return OPERATOR_FINISHED; +} + +void NLA_OT_delete_tracks (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Delete Tracks"; + ot->idname= "NLA_OT_delete_tracks"; + ot->description= "Delete selected NLA-Tracks and the strips they contain."; + + /* api callbacks */ + ot->exec= nlaedit_delete_tracks_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /* *********************************************** */ diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 5a22da2eb25..51c1960c4c6 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -391,9 +391,6 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) NlaStrip *strip; int index; - /* draw backdrop? */ - // TODO... - /* draw each strip in the track (if visible) */ for (strip=nlt->strips.first, index=1; strip; strip=strip->next, index++) { if (BKE_nlastrip_within_bounds(strip, v2d->cur.xmin, v2d->cur.xmax)) { @@ -420,7 +417,7 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) // TODO: if tweaking some action, use the same color as for the tweaked track (quick hack done for now) if (adt && (adt->flag & ADT_NLA_EDIT_ON)) { // greenish color (same as tweaking strip) - hardcoded for now - glColor4f(0.3f, 0.95f, 0.1f, 0.3f); // FIXME: only draw the actual range of the action darker? + glColor4f(0.3f, 0.95f, 0.1f, 0.3f); } else { if (ale->data) diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 79ee5396f36..ef37185fd10 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -106,6 +106,7 @@ void NLAEDIT_OT_split(wmOperatorType *ot); void NLA_OT_channels_click(wmOperatorType *ot); void NLA_OT_add_tracks(wmOperatorType *ot); +void NLA_OT_delete_tracks(wmOperatorType *ot); /* **************************************** */ /* nla_ops.c */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index df731e9d0fb..2a6a0c64ea9 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -132,6 +132,7 @@ void nla_operatortypes(void) WM_operatortype_append(NLA_OT_channels_click); WM_operatortype_append(NLA_OT_add_tracks); + WM_operatortype_append(NLA_OT_delete_tracks); /* select */ WM_operatortype_append(NLAEDIT_OT_click_select); @@ -166,6 +167,10 @@ static void nla_keymap_channels (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "NLA_OT_add_tracks", AKEY, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "NLA_OT_add_tracks", AKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "above_selected", 1); + /* delete tracks */ + WM_keymap_add_item(keymap, "NLA_OT_delete_tracks", XKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "NLA_OT_delete_tracks", DELKEY, KM_PRESS, 0, 0); + /* General Animation Channels keymap (see anim_channels.c) ----------------------- */ /* selection */ /* borderselect - not in tweakmode */ -- cgit v1.2.3 From e5f6a41b1b7125a4c3bc7ef2554c04b768ac765c Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 24 Jun 2009 12:50:20 +0000 Subject: NLA SoC: Scale Operators - Clear (Alt-S) and Apply (Ctrl-A) These two operators work only on Action-Clip strips. * Clear (Alt-S) resets the scale of selected strips to 1.0 * Apply (Ctrl-A) applies the scale of the selected strips to their referenced Actions. If this referenced Action is also used by several other strips, a copy of the Action is made, and the scaling is applied to that Action instead. --- source/blender/editors/space_nla/nla_edit.c | 165 +++++++++++++++++++++++++- source/blender/editors/space_nla/nla_header.c | 5 + source/blender/editors/space_nla/nla_intern.h | 3 + source/blender/editors/space_nla/nla_ops.c | 7 ++ 4 files changed, 179 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 70a033052bd..df30e112b5a 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -46,6 +46,8 @@ #include "BLI_rand.h" #include "BKE_animsys.h" +#include "BKE_action.h" +#include "BKE_fcurve.h" #include "BKE_nla.h" #include "BKE_context.h" #include "BKE_library.h" @@ -55,6 +57,7 @@ #include "BKE_utildefines.h" #include "ED_anim_api.h" +#include "ED_keyframes_edit.h" #include "ED_markers.h" #include "ED_space_api.h" #include "ED_screen.h" @@ -72,6 +75,7 @@ #include "UI_view2d.h" #include "nla_intern.h" // own include +#include "nla_private.h" // FIXME... maybe this shouldn't be included? /* *********************************************** */ /* 'Special' Editing */ @@ -217,7 +221,7 @@ void NLAEDIT_OT_tweakmode_exit (wmOperatorType *ot) } /* *********************************************** */ -/* NLA Editing Operations */ +/* NLA Editing Operations (Constructive/Destructive) */ /* ******************** Add Action-Clip Operator ***************************** */ /* Add a new Action-Clip strip to the active track (or the active block if no space in the track) */ @@ -700,3 +704,162 @@ void NLAEDIT_OT_split (wmOperatorType *ot) } /* *********************************************** */ +/* NLA Editing Operations (Modifying) */ + +/* ******************** Apply Scale Operator ***************************** */ +/* Reset the scaling of the selected strips to 1.0f */ + +/* apply scaling to keyframe */ +static short bezt_apply_nlamapping (BeztEditData *bed, BezTriple *bezt) +{ + /* NLA-strip which has this scaling is stored in bed->data */ + NlaStrip *strip= (NlaStrip *)bed->data; + + /* adjust all the times */ + bezt->vec[0][0]= nlastrip_get_frame(strip, bezt->vec[0][0], 1); + bezt->vec[1][0]= nlastrip_get_frame(strip, bezt->vec[1][0], 1); + bezt->vec[2][0]= nlastrip_get_frame(strip, bezt->vec[2][0], 1); + + /* nothing to return or else we exit */ + return 0; +} + +static int nlaedit_apply_scale_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + BeztEditData bed; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the editable tracks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* init the editing data */ + memset(&bed, 0, sizeof(BeztEditData)); + + /* for each NLA-Track, apply scale of all selected strips */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip; + + for (strip= nlt->strips.first; strip; strip= strip->next) { + /* strip must be selected, and must be action-clip only (transitions don't have scale) */ + if ((strip->flag & NLASTRIP_FLAG_SELECT) && (strip->type == NLASTRIP_TYPE_CLIP)) { + /* if the referenced action is used by other strips, make this strip use its own copy */ + if (strip->act == NULL) + continue; + if (strip->act->id.us > 1) { + /* make a copy of the Action to work on */ + bAction *act= copy_action(strip->act); + + /* set this as the new referenced action, decrementing the users of the old one */ + strip->act->id.us--; + strip->act= act; + } + + /* setup iterator, and iterate over all the keyframes in the action, applying this scaling */ + bed.data= strip; + ANIM_animchanneldata_keys_bezier_loop(&bed, strip->act, ALE_ACT, NULL, bezt_apply_nlamapping, calchandles_fcurve, 0); + + /* clear scale of strip now that it has been applied, but leave everything else alone */ + strip->scale= 1.0f; + } + } + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done */ + return OPERATOR_FINISHED; +} + +void NLAEDIT_OT_apply_scale (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Apply Scale"; + ot->idname= "NLAEDIT_OT_apply_scale"; + ot->description= "Apply scaling of selected strips to their referenced Actions."; + + /* api callbacks */ + ot->exec= nlaedit_apply_scale_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/* ******************** Clear Scale Operator ***************************** */ +/* Reset the scaling of the selected strips to 1.0f */ + +static int nlaedit_clear_scale_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the editable tracks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* for each NLA-Track, reset scale of all selected strips */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip; + + for (strip= nlt->strips.first; strip; strip= strip->next) { + /* strip must be selected, and must be action-clip only (transitions don't have scale) */ + if ((strip->flag & NLASTRIP_FLAG_SELECT) && (strip->type == NLASTRIP_TYPE_CLIP)) { + PointerRNA strip_ptr; + + RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &strip_ptr); + RNA_float_set(&strip_ptr, "scale", 1.0f); + } + } + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done */ + return OPERATOR_FINISHED; +} + +void NLAEDIT_OT_clear_scale (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Clear Scale"; + ot->idname= "NLAEDIT_OT_clear_scale"; + ot->description= "Reset scaling of selected strips."; + + /* api callbacks */ + ot->exec= nlaedit_clear_scale_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/* *********************************************** */ diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index 2cbf3adcba7..11dfc5575b1 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -154,6 +154,11 @@ static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); uiItemO(layout, NULL, 0, "NLAEDIT_OT_delete"); + + uiItemS(layout); + + uiItemO(layout, NULL, 0, "NLAEDIT_OT_apply_scale"); + uiItemO(layout, NULL, 0, "NLAEDIT_OT_clear_scale"); } static void nla_addmenu(bContext *C, uiLayout *layout, void *arg_unused) diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index ef37185fd10..17fad5db47f 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -99,6 +99,9 @@ void NLAEDIT_OT_duplicate(wmOperatorType *ot); void NLAEDIT_OT_delete(wmOperatorType *ot); void NLAEDIT_OT_split(wmOperatorType *ot); +void NLAEDIT_OT_apply_scale(wmOperatorType *ot); +void NLAEDIT_OT_clear_scale(wmOperatorType *ot); + /* **************************************** */ /* nla_channels.c */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 2a6a0c64ea9..531e049d29a 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -149,6 +149,9 @@ void nla_operatortypes(void) WM_operatortype_append(NLAEDIT_OT_duplicate); WM_operatortype_append(NLAEDIT_OT_delete); WM_operatortype_append(NLAEDIT_OT_split); + + WM_operatortype_append(NLAEDIT_OT_apply_scale); + WM_operatortype_append(NLAEDIT_OT_clear_scale); } /* ************************** registration - keymaps **********************************/ @@ -239,6 +242,10 @@ static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) /* split */ WM_keymap_add_item(keymap, "NLAEDIT_OT_split", YKEY, KM_PRESS, 0, 0); + /* apply scale */ + WM_keymap_add_item(keymap, "NLAEDIT_OT_apply_scale", AKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "NLAEDIT_OT_clear_scale", SKEY, KM_PRESS, KM_ALT, 0); + /* transform system */ transform_keymap_for_space(wm, keymap, SPACE_NLA); } -- cgit v1.2.3 From 9abce5dfbaee953fcec0779a94cbadc3516b9daf Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 24 Jun 2009 13:44:19 +0000 Subject: 2.5 Medium sized Color Picker; consisting of number sliders, row buttons to select rgb/hsv/hex, HS circle and V slider. It opens persistant, like old picker. This one opens default, other two can be accessed with ALT or SHIFT click. On todo; - eyedropper tool back - method for click-drag to make mini picker appear Note for UI coders (brecht :), added a UI_HIDDEN flag in buttons, to support switching buttons in menus. Hidden buttons are not activated nor drawn. --- source/blender/editors/interface/interface.c | 3 +- .../blender/editors/interface/interface_handlers.c | 11 +- .../blender/editors/interface/interface_intern.h | 2 +- .../blender/editors/interface/interface_regions.c | 115 +++++++++++++++++++-- 4 files changed, 122 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 780d999cfbe..1c17962075f 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -671,7 +671,8 @@ void uiDrawBlock(const bContext *C, uiBlock *block) /* widgets */ for(but= block->buttons.first; but; but= but->next) { ui_but_to_pixelrect(&rect, ar, block, but); - ui_draw_but(C, ar, &style, but, &rect); + if(!(but->flag & UI_HIDDEN)) + ui_draw_but(C, ar, &style, but, &rect); } /* restore matrix */ diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index fb5afbf5e36..8eab0305047 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -404,7 +404,15 @@ static void ui_apply_but_TOG(bContext *C, uiBlock *block, uiBut *but, uiHandleBu static void ui_apply_but_ROW(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data) { + uiBut *bt; + ui_set_but_val(but, but->hardmax); + + /* states of other row buttons */ + for(bt= block->buttons.first; bt; bt= bt->next) + if(bt!=but && bt->poin==but->poin && bt->type==ROW) + ui_check_but(bt); + ui_apply_but_func(C, but); data->retval= but->retval; @@ -3232,7 +3240,8 @@ static uiBut *ui_but_find_mouse_over(ARegion *ar, int x, int y) for(but=block->buttons.first; but; but= but->next) { if(ELEM3(but->type, LABEL, ROUNDBOX, SEPR)) continue; - + if(but->flag & UI_HIDDEN) + continue; if(ui_but_contains_pt(but, mx, my)) /* give precedence to already activated buttons */ if(!butover || (!butover->active && but->active)) diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 19a87c40d9c..187d7cccd97 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -98,7 +98,7 @@ typedef enum { #define UI_ACTIVE 4 #define UI_HAS_ICON 8 #define UI_TEXTINPUT 16 - +#define UI_HIDDEN 32 /* warn: rest of uiBut->flag in UI_interface.h */ /* internal panel drawing defines */ diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 32bcae77e6b..af1d4e91c67 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1720,24 +1720,118 @@ static void do_picker_small_cb(bContext *C, void *bt1, void *hsv1) popup->menuretval= UI_RETURN_UPDATE; } +/* picker sizes S hsize, F full size, D spacer, B button/pallette height */ +#define SPICK1 150.0 +#define DPICK1 6.0 -/* only the color, a circle, slider */ -void uiBlockPickerSmall(uiBlock *block, float *col, float *hsv, float *old, char *hexcol, char mode, short retval) +/* only the color, a HS circle and V slider */ +static void uiBlockPickerSmall(uiBlock *block, float *col, float *hsv, float *old, char *hexcol, char mode, short retval) { uiBut *bt; VECCOPY(old, col); // old color stored there, for palette_cb to work /* HS circle */ - bt= uiDefButF(block, HSVCIRCLE, retval, "", 0, 0,SPICK,SPICK, col, 0.0, 0.0, 0, 0, ""); + bt= uiDefButF(block, HSVCIRCLE, retval, "", 0, 0,SPICK1,SPICK1, col, 0.0, 0.0, 0, 0, ""); + uiButSetFunc(bt, do_picker_small_cb, bt, hsv); + + /* value */ + bt= uiDefButF(block, HSVCUBE, retval, "", SPICK1+DPICK1,0,14,SPICK1, col, 0.0, 0.0, 4, 0, ""); uiButSetFunc(bt, do_picker_small_cb, bt, hsv); +} + +static void picker_new_hide_reveal(uiBlock *block, short colormode) +{ + uiBut *bt; + + /* tag buttons */ + for(bt= block->buttons.first; bt; bt= bt->next) { + + if(bt->type==NUMSLI || bt->type==TEX) { + if( bt->str[1]=='e') { + if(colormode==2) bt->flag &= ~UI_HIDDEN; + else bt->flag |= UI_HIDDEN; + } + else if( ELEM3(bt->str[0], 'R', 'G', 'B')) { + if(colormode==0) bt->flag &= ~UI_HIDDEN; + else bt->flag |= UI_HIDDEN; + } + else if( ELEM3(bt->str[0], 'H', 'S', 'V')) { + if(colormode==1) bt->flag &= ~UI_HIDDEN; + else bt->flag |= UI_HIDDEN; + } + } + } +} + +static void do_picker_new_mode_cb(bContext *C, void *bt1, void *colv) +{ + uiBut *bt= bt1; + short colormode= ui_get_but_val(bt); + + picker_new_hide_reveal(bt->block, colormode); +} + + +/* a HS circle, V slider, rgb/hsv/hex sliders */ +static void uiBlockPickerNew(uiBlock *block, float *col, float *hsv, float *old, char *hexcol, char mode, short retval) +{ + static short colormode= 0; /* temp? 0=rgb, 1=hsv, 2=hex */ + uiBut *bt; + int width; + + VECCOPY(old, col); // old color stored there, for palette_cb to work + + /* HS circle */ + bt= uiDefButF(block, HSVCIRCLE, retval, "", 0, 0,SPICK1,SPICK1, col, 0.0, 0.0, 0, 0, ""); + uiButSetFunc(bt, do_picker_small_cb, bt, hsv); + /* value */ - bt= uiDefButF(block, HSVCUBE, retval, "", SPICK+DPICK,0,14,SPICK, col, 0.0, 0.0, 4, 0, ""); + bt= uiDefButF(block, HSVCUBE, retval, "", SPICK1+DPICK1,0,14,SPICK1, col, 0.0, 0.0, 4, 0, ""); uiButSetFunc(bt, do_picker_small_cb, bt, hsv); + + /* mode */ + width= (SPICK1+DPICK1+14)/3; + uiBlockBeginAlign(block); + bt= uiDefButS(block, ROW, retval, "RGB", 0, -30, width, 19, &colormode, 0.0, 0.0, 0, 0, ""); + uiButSetFunc(bt, do_picker_new_mode_cb, bt, col); + bt= uiDefButS(block, ROW, retval, "HSV", width, -30, width, 19, &colormode, 0.0, 1.0, 0, 0, ""); + uiButSetFunc(bt, do_picker_new_mode_cb, bt, hsv); + bt= uiDefButS(block, ROW, retval, "Hex", 2*width, -30, width, 19, &colormode, 0.0, 2.0, 0, 0, ""); + uiButSetFunc(bt, do_picker_new_mode_cb, bt, hexcol); + uiBlockEndAlign(block); + + /* sliders or hex */ + width= (SPICK1+DPICK1+14); + rgb_to_hsv(col[0], col[1], col[2], hsv, hsv+1, hsv+2); + sprintf(hexcol, "%02X%02X%02X", (unsigned int)(col[0]*255.0), (unsigned int)(col[1]*255.0), (unsigned int)(col[2]*255.0)); + + uiBlockBeginAlign(block); + bt= uiDefButF(block, NUMSLI, 0, "R ", 0, -60, width, 19, col, 0.0, 1.0, 10, 3, ""); + uiButSetFunc(bt, do_palette1_cb, bt, hsv); + bt= uiDefButF(block, NUMSLI, 0, "G ", 0, -80, width, 19, col+1, 0.0, 1.0, 10, 3, ""); + uiButSetFunc(bt, do_palette1_cb, bt, hsv); + bt= uiDefButF(block, NUMSLI, 0, "B ", 0, -100, width, 19, col+2, 0.0, 1.0, 10, 3, ""); + uiButSetFunc(bt, do_palette1_cb, bt, hsv); + uiBlockEndAlign(block); + uiBlockBeginAlign(block); + bt= uiDefButF(block, NUMSLI, 0, "H ", 0, -60, width, 19, hsv, 0.0, 1.0, 10, 3, ""); + uiButSetFunc(bt, do_palette2_cb, bt, col); + bt= uiDefButF(block, NUMSLI, 0, "S ", 0, -80, width, 19, hsv+1, 0.0, 1.0, 10, 3, ""); + uiButSetFunc(bt, do_palette2_cb, bt, col); + bt= uiDefButF(block, NUMSLI, 0, "V ", 0, -100, width, 19, hsv+2, 0.0, 1.0, 10, 3, ""); + uiButSetFunc(bt, do_palette2_cb, bt, col); + uiBlockEndAlign(block); + + bt= uiDefBut(block, TEX, 0, "Hex: ", 0, -80, width, 19, hexcol, 0, 8, 0, 0, "Hex triplet for color (#RRGGBB)"); + uiButSetFunc(bt, do_palette_hex_cb, bt, hexcol); + + picker_new_hide_reveal(block, colormode); } + static int ui_picker_small_wheel(const bContext *C, uiBlock *block, wmEvent *event) { float add= 0.0f; @@ -1790,13 +1884,22 @@ uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_bu block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_KEEP_OPEN; uiBoundsBlock(block, 3); } - else { + else if(win->eventstate->alt) { uiBlockPickerSmall(block, handle->retvec, hsvcol, oldcol, hexcol, 'p', 0); block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_OUT_1; uiBoundsBlock(block, 10); block->block_event_func= ui_picker_small_wheel; - } + } + else { + uiBlockPickerNew(block, handle->retvec, hsvcol, oldcol, hexcol, 'p', 0); + block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_KEEP_OPEN; + uiBoundsBlock(block, 10); + + block->block_event_func= ui_picker_small_wheel; + } + + /* and lets go */ block->direction= UI_TOP; -- cgit v1.2.3 From 242d9c31d3316f99525925eb7da30522457064e8 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 24 Jun 2009 14:03:55 +0000 Subject: RNA * RNA_struct_name_get_alloc function to get the name from a pointer, instead of having to deal with name property. * CTX_data_pointer_get_type to get data from context with a check for the RNA type. --- source/blender/blenkernel/BKE_context.h | 1 + source/blender/blenkernel/intern/context.c | 19 +++++--- source/blender/editors/interface/interface.c | 28 +++++------- .../editors/space_buttons/buttons_context.c | 7 +-- source/blender/editors/space_outliner/outliner.c | 19 ++++---- source/blender/makesrna/RNA_access.h | 2 + source/blender/makesrna/intern/rna_access.c | 11 ++++- source/blender/python/intern/bpy_rna.c | 53 ++++++++++------------ 8 files changed, 71 insertions(+), 69 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h index 898b84ecdc3..f536e117b7b 100644 --- a/source/blender/blenkernel/BKE_context.h +++ b/source/blender/blenkernel/BKE_context.h @@ -131,6 +131,7 @@ void CTX_wm_menu_set(bContext *C, struct ARegion *menu); - the dir listbase consits of LinkData items */ PointerRNA CTX_data_pointer_get(const bContext *C, const char *member); +PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type); ListBase CTX_data_collection_get(const bContext *C, const char *member); ListBase CTX_data_dir_get(const bContext *C); void CTX_data_get(const bContext *C, const char *member, PointerRNA *r_ptr, ListBase *r_lb); diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 12deec838a8..90880e354ec 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -365,15 +365,20 @@ PointerRNA CTX_data_pointer_get(const bContext *C, const char *member) { bContextDataResult result; - if(ctx_data_get((bContext*)C, member, &result)) { + if(ctx_data_get((bContext*)C, member, &result)) return result.ptr; - } - else { - PointerRNA ptr; - memset(&ptr, 0, sizeof(ptr)); - return ptr; - } + else + return PointerRNA_NULL; +} + +PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, StructRNA *type) +{ + PointerRNA ptr = CTX_data_pointer_get(C, member); + if(ptr.data && ptr.type == type) + return ptr; + + return PointerRNA_NULL; } ListBase CTX_data_collection_get(const bContext *C, const char *member) diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 1c17962075f..892a126feb6 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1282,17 +1282,13 @@ void ui_get_but_string(uiBut *but, char *str, int maxlen) else if(type == PROP_POINTER) { /* RNA pointer */ PointerRNA ptr= RNA_property_pointer_get(&but->rnapoin, but->rnaprop); - PropertyRNA *nameprop; - - if(ptr.data && (nameprop = RNA_struct_name_property(ptr.type))) - buf= RNA_property_string_get_alloc(&ptr, nameprop, str, maxlen); - else - BLI_strncpy(str, "", maxlen); + buf= RNA_struct_name_get_alloc(&ptr, str, maxlen); } - else - BLI_strncpy(str, "", maxlen); - if(buf && buf != str) { + if(!buf) { + BLI_strncpy(str, "", maxlen); + } + else if(buf && buf != str) { /* string was too long, we have to truncate */ BLI_strncpy(str, buf, maxlen); MEM_freeN(buf); @@ -1375,7 +1371,7 @@ static void ui_rna_ID_autocomplete(bContext *C, char *str, void *arg_but) AutoComplete *autocpl; CollectionPropertyIterator iter; PointerRNA ptr; - PropertyRNA *prop, *nameprop; + PropertyRNA *prop; char *name; if(str[0]==0) return; @@ -1389,14 +1385,12 @@ static void ui_rna_ID_autocomplete(bContext *C, char *str, void *arg_but) /* loop over items in collection */ for(; iter.valid; RNA_property_collection_next(&iter)) { - if(iter.ptr.data && (nameprop = RNA_struct_name_property(iter.ptr.type))) { - name= RNA_property_string_get_alloc(&iter.ptr, nameprop, NULL, 0); + name= RNA_struct_name_get_alloc(&iter.ptr, NULL, 0); - if(name) { - /* test item name */ - autocomplete_do_name(autocpl, name); - MEM_freeN(name); - } + /* test item name */ + if(name) { + autocomplete_do_name(autocpl, name); + MEM_freeN(name); } } diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index d97b4acdb96..cba9a4cf8fc 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -668,7 +668,6 @@ void buttons_context_draw(const bContext *C, uiLayout *layout) uiBlock *block; uiBut *but; PointerRNA *ptr; - PropertyRNA *nameprop; char namebuf[128], *name; int a, icon; @@ -688,7 +687,7 @@ void buttons_context_draw(const bContext *C, uiLayout *layout) if(ptr->data) { icon= RNA_struct_ui_icon(ptr->type); - nameprop= RNA_struct_name_property(ptr->type); + name= RNA_struct_name_get_alloc(ptr, namebuf, sizeof(namebuf)); #if 0 if(sbuts->mainb != BCONTEXT_SCENE && ptr->type == &RNA_Scene) { @@ -696,9 +695,7 @@ void buttons_context_draw(const bContext *C, uiLayout *layout) } else #endif - if(nameprop) { - name= RNA_property_string_get_alloc(ptr, nameprop, namebuf, sizeof(namebuf)); - + if(name) { uiItemL(row, name, icon); if(name != namebuf) diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 16748af39d5..8017b8437ff 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -1031,7 +1031,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i } else if(ELEM3(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) { PointerRNA pptr, propptr, *ptr= (PointerRNA*)idv; - PropertyRNA *prop, *iterprop, *nameprop; + PropertyRNA *prop, *iterprop; PropertyType proptype; PropertySubType propsubtype; int a, tot; @@ -1043,12 +1043,10 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i } else if(type == TSE_RNA_STRUCT) { /* struct */ - nameprop= RNA_struct_name_property(ptr->type); + te->name= RNA_struct_name_get_alloc(ptr, NULL, 0); - if(nameprop) { - te->name= RNA_property_string_get_alloc(ptr, nameprop, NULL, 0); + if(te->name) te->flag |= TE_FREE_NAME; - } else te->name= (char*)RNA_struct_ui_name(ptr->type); @@ -3075,7 +3073,7 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle TreeElement *tem, *temnext, *temsub; TreeStoreElem *tse, *tsenext; PointerRNA *ptr, *nextptr; - PropertyRNA *prop, *nameprop; + PropertyRNA *prop; char *newpath=NULL; /* optimise tricks: @@ -3119,17 +3117,16 @@ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreEle newpath= RNA_path_append(*path, ptr, prop, 0, NULL); } else if(RNA_property_type(prop) == PROP_COLLECTION) { + char buf[128], *name; + temnext= (TreeElement*)(ld->next->data); tsenext= TREESTORE(temnext); nextptr= &temnext->rnaptr; - nameprop= RNA_struct_name_property(nextptr->type); + name= RNA_struct_name_get_alloc(nextptr, buf, sizeof(buf)); - if(nameprop) { + if(name) { /* if possible, use name as a key in the path */ - char buf[128], *name; - name= RNA_property_string_get_alloc(nextptr, nameprop, buf, sizeof(buf)); - newpath= RNA_path_append(*path, NULL, prop, 0, name); if(name != buf) diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 4a074ab1546..bab6982abd9 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -514,6 +514,8 @@ const struct ListBase *RNA_struct_defined_properties(StructRNA *srna); FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier); const struct ListBase *RNA_struct_defined_functions(StructRNA *srna); +char *RNA_struct_name_get_alloc(PointerRNA *ptr, char *fixedbuf, int fixedlen); + /* Properties * * Access to struct properties. All this works with RNA pointers rather than diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 60774c8432c..a2954d43e0e 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -518,6 +518,16 @@ void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type) srna->blender_type= blender_type; } +char *RNA_struct_name_get_alloc(PointerRNA *ptr, char *fixedbuf, int fixedlen) +{ + PropertyRNA *nameprop; + + if(ptr->data && (nameprop = RNA_struct_name_property(ptr->type))) + return RNA_property_string_get_alloc(ptr, nameprop, fixedbuf, fixedlen); + + return NULL; +} + /* Property Information */ const char *RNA_property_identifier(PropertyRNA *prop) @@ -658,7 +668,6 @@ void RNA_property_enum_items(PointerRNA *ptr, PropertyRNA *prop, const EnumPrope int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value) { const EnumPropertyItem *item; - int i; RNA_property_enum_items(ptr, prop, &item, NULL); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index e91b96d6f26..1fd60a8ff27 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -161,14 +161,15 @@ static PyObject *pyrna_prop_richcmp(BPy_PropertyRNA * a, BPy_PropertyRNA * b, in /*----------------------repr--------------------------------------------*/ static PyObject *pyrna_struct_repr( BPy_StructRNA * self ) { - PropertyRNA *prop; - char str[512]; + PyObject *pyob; + char *name; /* print name if available */ - prop= RNA_struct_name_property(self->ptr.type); - if(prop) { - RNA_property_string_get(&self->ptr, prop, str); - return PyUnicode_FromFormat( "[BPy_StructRNA \"%s\" -> \"%s\"]", RNA_struct_identifier(self->ptr.type), str); + name= RNA_struct_name_get_alloc(&self->ptr, NULL, 0); + if(name) { + pyob= PyUnicode_FromFormat( "[BPy_StructRNA \"%s\" -> \"%s\"]", RNA_struct_identifier(self->ptr.type), name); + MEM_freeN(name); + return pyob; } return PyUnicode_FromFormat( "[BPy_StructRNA \"%s\"]", RNA_struct_identifier(self->ptr.type)); @@ -176,20 +177,19 @@ static PyObject *pyrna_struct_repr( BPy_StructRNA * self ) static PyObject *pyrna_prop_repr( BPy_PropertyRNA * self ) { - PropertyRNA *prop; + PyObject *pyob; PointerRNA ptr; - char str[512]; + char *name; /* if a pointer, try to print name of pointer target too */ if(RNA_property_type(self->prop) == PROP_POINTER) { ptr= RNA_property_pointer_get(&self->ptr, self->prop); + name= RNA_struct_name_get_alloc(&ptr, NULL, 0); - if(ptr.data) { - prop= RNA_struct_name_property(ptr.type); - if(prop) { - RNA_property_string_get(&ptr, prop, str); - return PyUnicode_FromFormat( "[BPy_PropertyRNA \"%s\" -> \"%s\" -> \"%s\" ]", RNA_struct_identifier(self->ptr.type), RNA_property_identifier(self->prop), str); - } + if(name) { + pyob= PyUnicode_FromFormat( "[BPy_PropertyRNA \"%s\" -> \"%s\" -> \"%s\" ]", RNA_struct_identifier(self->ptr.type), RNA_property_identifier(self->prop), name); + MEM_freeN(name); + return pyob; } } @@ -218,7 +218,6 @@ static void pyrna_struct_dealloc( BPy_StructRNA * self ) static char *pyrna_enum_as_string(PointerRNA *ptr, PropertyRNA *prop) { const EnumPropertyItem *item; - int totitem; RNA_property_enum_items(ptr, prop, &item, NULL); return (char*)BPy_enum_as_string((EnumPropertyItem*)item); @@ -971,21 +970,20 @@ static PyObject *pyrna_struct_dir(BPy_StructRNA * self) /* * Collect RNA attributes */ - PropertyRNA *nameprop; char name[256], *nameptr; iterprop= RNA_struct_iterator_property(self->ptr.type); RNA_property_collection_begin(&self->ptr, iterprop, &iter); for(; iter.valid; RNA_property_collection_next(&iter)) { - if(iter.ptr.data && (nameprop = RNA_struct_name_property(iter.ptr.type))) { - nameptr= RNA_property_string_get_alloc(&iter.ptr, nameprop, name, sizeof(name)); - + nameptr= RNA_struct_name_get_alloc(&iter.ptr, name, sizeof(name)); + + if(nameptr) { pystring = PyUnicode_FromString(nameptr); PyList_Append(ret, pystring); Py_DECREF(pystring); - if ((char *)&name != nameptr) + if(name != nameptr) MEM_freeN(nameptr); } } @@ -1132,7 +1130,9 @@ PyObject *pyrna_prop_keys(BPy_PropertyRNA *self) RNA_property_collection_begin(&self->ptr, self->prop, &iter); for(; iter.valid; RNA_property_collection_next(&iter)) { - if(iter.ptr.data && (nameprop = RNA_struct_name_property(iter.ptr.type))) { + nameptr= RNA_struct_name_get_alloc(&iter.ptr, name, sizeof(name)); + + if(nameptr) { nameptr= RNA_property_string_get_alloc(&iter.ptr, nameprop, name, sizeof(name)); /* add to python list */ @@ -1141,7 +1141,7 @@ PyObject *pyrna_prop_keys(BPy_PropertyRNA *self) Py_DECREF(item); /* done */ - if ((char *)&name != nameptr) + if(name != nameptr) MEM_freeN(nameptr); } } @@ -1160,7 +1160,6 @@ PyObject *pyrna_prop_items(BPy_PropertyRNA *self) } else { PyObject *item; CollectionPropertyIterator iter; - PropertyRNA *nameprop; char name[256], *nameptr; int i= 0; @@ -1171,10 +1170,10 @@ PyObject *pyrna_prop_items(BPy_PropertyRNA *self) if(iter.ptr.data) { /* add to python list */ item= PyTuple_New(2); - if(nameprop = RNA_struct_name_property(iter.ptr.type)) { - nameptr= RNA_property_string_get_alloc(&iter.ptr, nameprop, name, sizeof(name)); + nameptr= RNA_struct_name_get_alloc(&iter.ptr, name, sizeof(name)); + if(nameptr) { PyTuple_SET_ITEM(item, 0, PyUnicode_FromString( nameptr )); - if ((char *)&name != nameptr) + if(name != nameptr) MEM_freeN(nameptr); } else { @@ -1205,10 +1204,8 @@ PyObject *pyrna_prop_values(BPy_PropertyRNA *self) } else { PyObject *item; CollectionPropertyIterator iter; - PropertyRNA *iterprop; ret = PyList_New(0); - //iterprop= RNA_struct_iterator_property(self->ptr.type); RNA_property_collection_begin(&self->ptr, self->prop, &iter); for(; iter.valid; RNA_property_collection_next(&iter)) { item = pyrna_struct_CreatePyObject(&iter.ptr); -- cgit v1.2.3 From a379fdd7fba460fdceb14d6dd164116d9a4744bd Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 24 Jun 2009 14:07:48 +0000 Subject: 2.5: Object material slot operators add/remove/assign/select/deselect. --- source/blender/blenkernel/BKE_material.h | 15 +- source/blender/blenkernel/intern/material.c | 4 +- source/blender/editors/curve/curve_intern.h | 1 - source/blender/editors/curve/curve_ops.c | 1 - source/blender/editors/curve/editcurve.c | 2 +- source/blender/editors/curve/editfont.c | 44 ---- source/blender/editors/include/ED_curve.h | 3 + source/blender/editors/include/ED_mesh.h | 3 + source/blender/editors/mesh/editmesh.c | 2 +- source/blender/editors/mesh/editmesh_mods.c | 4 +- .../blender/editors/space_buttons/buttons_intern.h | 6 + source/blender/editors/space_buttons/buttons_ops.c | 261 +++++++++++++++++++-- .../blender/editors/space_buttons/space_buttons.c | 6 + 13 files changed, 272 insertions(+), 80 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h index 38a1d9b13b7..382754ee2b2 100644 --- a/source/blender/blenkernel/BKE_material.h +++ b/source/blender/blenkernel/BKE_material.h @@ -39,6 +39,8 @@ struct Material; struct ID; struct Object; +/* materials */ + void init_def_material(void); void free_material(struct Material *sc); void test_object_materials(struct ID *id); @@ -47,15 +49,22 @@ struct Material *add_material(char *name); struct Material *copy_material(struct Material *ma); void make_local_material(struct Material *ma); +void automatname(struct Material *); + +/* material slots */ + struct Material ***give_matarar(struct Object *ob); short *give_totcolp(struct Object *ob); struct Material *give_current_material(struct Object *ob, int act); struct ID *material_from(struct Object *ob, int act); void assign_material(struct Object *ob, struct Material *ma, int act); -void new_material_to_objectdata(struct Object *ob); int find_material_index(struct Object *ob, struct Material *ma); +void object_add_material_slot(struct Object *ob); +void object_remove_material_slot(struct Object *ob); + +/* rendering */ void init_render_material(struct Material *, int, float *); void init_render_materials(int, float *); @@ -64,12 +73,8 @@ void end_render_materials(void); int material_in_material(struct Material *parmat, struct Material *mat); -void automatname(struct Material *); -void delete_material_index(struct Object *ob); - void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col); - #ifdef __cplusplus } #endif diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index b410c521dea..57b88bb0b3f 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -615,7 +615,7 @@ int find_material_index(Object *ob, Material *ma) return 0; } -void new_material_to_objectdata(Object *ob) +void object_add_material_slot(Object *ob) { Material *ma; @@ -854,7 +854,7 @@ void automatname(Material *ma) } -void delete_material_index(Object *ob) +void object_remove_material_slot(Object *ob) { Material *mao, ***matarar; Object *obt; diff --git a/source/blender/editors/curve/curve_intern.h b/source/blender/editors/curve/curve_intern.h index a73a54323ee..2146855a75e 100644 --- a/source/blender/editors/curve/curve_intern.h +++ b/source/blender/editors/curve/curve_intern.h @@ -49,7 +49,6 @@ void FONT_OT_case_toggle(struct wmOperatorType *ot); void FONT_OT_case_set(struct wmOperatorType *ot); void FONT_OT_style_toggle(struct wmOperatorType *ot); void FONT_OT_style_set(struct wmOperatorType *ot); -void FONT_OT_material_set(struct wmOperatorType *ot); void FONT_OT_text_copy(struct wmOperatorType *ot); void FONT_OT_text_cut(struct wmOperatorType *ot); diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index 5292d86d3c9..66cde772f3e 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -106,7 +106,6 @@ void ED_operatortypes_curve(void) WM_operatortype_append(FONT_OT_case_set); WM_operatortype_append(FONT_OT_style_toggle); WM_operatortype_append(FONT_OT_style_set); - WM_operatortype_append(FONT_OT_material_set); WM_operatortype_append(FONT_OT_text_copy); WM_operatortype_append(FONT_OT_text_cut); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 466908c562c..5283aacf39e 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -189,7 +189,7 @@ static short swap_selection_bpoint(BPoint *bp) return select_bpoint(bp, SELECT, 1, VISIBLE); } -short isNurbsel(Nurb *nu) +int isNurbsel(Nurb *nu) { BezTriple *bezt; BPoint *bp; diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 5389db9e2ee..9f2bd6f26f9 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -700,50 +700,6 @@ void FONT_OT_style_toggle(wmOperatorType *ot) RNA_def_enum(ot->srna, "style", style_items, CU_BOLD, "Style", "Style to set selection to."); } -/******************* set material operator ********************/ - -static int set_material_exec(bContext *C, wmOperator *op) -{ - Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - Curve *cu= obedit->data; - EditFont *ef= cu->editfont; - int i, mat_nr, selstart, selend; - - if(!BKE_font_getselection(obedit, &selstart, &selend)) - return OPERATOR_CANCELLED; - - if(RNA_property_is_set(op->ptr, "index")) - mat_nr= RNA_int_get(op->ptr, "index"); - else - mat_nr= obedit->actcol; - - for(i=selstart; i<=selend; i++) - ef->textbufinfo[i].mat_nr = mat_nr; - - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - - return OPERATOR_FINISHED; -} - -void FONT_OT_material_set(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Set Material"; - ot->idname= "FONT_OT_material_set"; - - /* api callbacks */ - ot->exec= set_material_exec; - ot->poll= ED_operator_editfont; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /* properties */ - RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Material Index", "Material slot index.", 0, INT_MAX); -} - /******************* copy text operator ********************/ static void copy_selection(Object *obedit) diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index c619ee80f70..2cebc6a572a 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -30,6 +30,7 @@ struct Base; struct bContext; +struct Nurb; struct Object; struct Scene; struct Text; @@ -52,6 +53,8 @@ void mouse_nurb (struct bContext *C, short mval[2], int extend); struct Nurb *add_nurbs_primitive(struct bContext *C, int type, int newname); +int isNurbsel (struct Nurb *nu);; + /* editfont.h */ void undo_push_font (struct bContext *C, char *name); void make_editText (struct Object *obedit); diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 6dff4ee6ca4..937f6384f6a 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -147,6 +147,9 @@ int EM_init_backbuf_circle(struct ViewContext *vc, short xs, short ys, short r void EM_hide_mesh(struct EditMesh *em, int swap); void EM_reveal_mesh(struct EditMesh *em); +void EM_select_by_material(struct EditMesh *em, int index); +void EM_deselect_by_material(struct EditMesh *em, int index); + /* editface.c */ struct MTFace *EM_get_active_mtface(struct EditMesh *em, struct EditFace **act_efa, struct MCol **mcol, int sloppy); diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index c05751feddc..7f5201f4704 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1556,7 +1556,7 @@ static int mesh_separate_material(Scene *scene, Base *editbase) /* clear selection, we're going to use that to select material group */ EM_clear_flag_all(em, SELECT); /* select the material */ - editmesh_select_by_material(em, curr_mat); + EM_select_by_material(em, curr_mat); /* and now separate */ if(0==mesh_separate_selected(scene, editbase)) { BKE_mesh_end_editmesh(me, em); diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 07ed6ae7a01..7e9fcb10984 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -3484,7 +3484,7 @@ void MESH_OT_select_random(wmOperatorType *ot) RNA_def_float_percentage(ot->srna, "percent", 0.5f, 0.0f, 1.0f, "Percent", "Percentage of vertices to select randomly.", 0.0001f, 1.0f); } -void editmesh_select_by_material(EditMesh *em, int index) +void EM_select_by_material(EditMesh *em, int index) { EditFace *efa; @@ -3497,7 +3497,7 @@ void editmesh_select_by_material(EditMesh *em, int index) EM_selectmode_flush(em); } -void editmesh_deselect_by_material(EditMesh *em, int index) +void EM_deselect_by_material(EditMesh *em, int index) { EditFace *efa; diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h index 196647a3750..b213e4288be 100644 --- a/source/blender/editors/space_buttons/buttons_intern.h +++ b/source/blender/editors/space_buttons/buttons_intern.h @@ -61,6 +61,12 @@ void buttons_context_draw(const struct bContext *C, struct uiLayout *layout); void buttons_context_register(struct ARegionType *art); /* buttons_ops.c */ +void OBJECT_OT_material_slot_add(struct wmOperatorType *ot); +void OBJECT_OT_material_slot_remove(struct wmOperatorType *ot); +void OBJECT_OT_material_slot_assign(struct wmOperatorType *ot); +void OBJECT_OT_material_slot_select(struct wmOperatorType *ot); +void OBJECT_OT_material_slot_deselect(struct wmOperatorType *ot); + void MATERIAL_OT_new(struct wmOperatorType *ot); void TEXTURE_OT_new(struct wmOperatorType *ot); void WORLD_OT_new(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 63469a8294d..6755a2be1b7 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -30,6 +30,7 @@ #include "MEM_guardedalloc.h" +#include "DNA_curve_types.h" #include "DNA_object_types.h" #include "DNA_material_types.h" #include "DNA_texture_types.h" @@ -37,31 +38,250 @@ #include "DNA_world_types.h" #include "BKE_context.h" +#include "BKE_depsgraph.h" +#include "BKE_font.h" #include "BKE_library.h" #include "BKE_material.h" #include "BKE_texture.h" +#include "BKE_utildefines.h" #include "BKE_world.h" +#include "BLI_editVert.h" + #include "RNA_access.h" #include "WM_api.h" #include "WM_types.h" +#include "ED_curve.h" +#include "ED_mesh.h" + #include "buttons_intern.h" // own include +/********************** material slot operators *********************/ + +static int material_slot_add_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + + if(!ob) + return OPERATOR_CANCELLED; + + object_add_material_slot(ob); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_material_slot_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Material Slot"; + ot->idname= "OBJECT_OT_material_slot_add"; + + /* api callbacks */ + ot->exec= material_slot_add_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int material_slot_remove_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + + if(!ob) + return OPERATOR_CANCELLED; + + object_remove_material_slot(ob); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_material_slot_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Material Slot"; + ot->idname= "OBJECT_OT_material_slot_remove"; + + /* api callbacks */ + ot->exec= material_slot_remove_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int material_slot_assign_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + + if(!ob) + return OPERATOR_CANCELLED; + + if(ob && ob->actcol>0) { + if(ob->type == OB_MESH) { + EditMesh *em= ((Mesh*)ob->data)->edit_mesh; + EditFace *efa; + + if(em) { + for(efa= em->faces.first; efa; efa=efa->next) + if(efa->f & SELECT) + efa->mat_nr= ob->actcol-1; + } + } + else if(ELEM(ob->type, OB_CURVE, OB_SURF)) { + ListBase *editnurb= ((Curve*)ob->data)->editnurb; + Nurb *nu; + + if(editnurb) { + for(nu= editnurb->first; nu; nu= nu->next) + if(isNurbsel(nu)) + nu->mat_nr= nu->charidx= ob->actcol-1; + } + } + else if(ob->type == OB_FONT) { + EditFont *ef= ((Curve*)ob->data)->editfont; + int i, selstart, selend; + + if(ef && BKE_font_getselection(ob, &selstart, &selend)) { + for(i=selstart; i<=selend; i++) + ef->textbufinfo[i].mat_nr = ob->actcol-1; + } + } + } + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_material_slot_assign(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Assign Material Slot"; + ot->idname= "OBJECT_OT_material_slot_assign"; + + /* api callbacks */ + ot->exec= material_slot_assign_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int material_slot_de_select(bContext *C, int select) +{ + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + + if(!ob) + return OPERATOR_CANCELLED; + + if(ob->type == OB_MESH) { + EditMesh *em= ((Mesh*)ob->data)->edit_mesh; + + if(em) { + if(select) + EM_select_by_material(em, ob->actcol-1); + else + EM_deselect_by_material(em, ob->actcol-1); + } + } + else if ELEM(ob->type, OB_CURVE, OB_SURF) { + ListBase *editnurb= ((Curve*)ob->data)->editnurb; + Nurb *nu; + BPoint *bp; + BezTriple *bezt; + int a; + + for(nu= editnurb->first; nu; nu=nu->next) { + if(nu->mat_nr==ob->actcol-1) { + if(nu->bezt) { + a= nu->pntsu; + bezt= nu->bezt; + while(a--) { + if(bezt->hide==0) { + if(select) { + bezt->f1 |= SELECT; + bezt->f2 |= SELECT; + bezt->f3 |= SELECT; + } + else { + bezt->f1 &= ~SELECT; + bezt->f2 &= ~SELECT; + bezt->f3 &= ~SELECT; + } + } + bezt++; + } + } + else if(nu->bp) { + a= nu->pntsu*nu->pntsv; + bp= nu->bp; + while(a--) { + if(bp->hide==0) { + if(select) bp->f1 |= SELECT; + else bp->f1 &= ~SELECT; + } + bp++; + } + } + } + } + } + + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + + return OPERATOR_FINISHED; +} + +static int material_slot_select_exec(bContext *C, wmOperator *op) +{ + return material_slot_de_select(C, 1); +} + +void OBJECT_OT_material_slot_select(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Select Material Slot"; + ot->idname= "OBJECT_OT_material_slot_select"; + + /* api callbacks */ + ot->exec= material_slot_select_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int material_slot_deselect_exec(bContext *C, wmOperator *op) +{ + return material_slot_de_select(C, 0); +} + +void OBJECT_OT_material_slot_deselect(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Deselect Material Slot"; + ot->idname= "OBJECT_OT_material_slot_deselect"; + + /* api callbacks */ + ot->exec= material_slot_deselect_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /********************** new material operator *********************/ static int new_material_exec(bContext *C, wmOperator *op) { - PointerRNA ptr; - Material *ma; + Material *ma= CTX_data_pointer_get_type(C, "material", &RNA_Material).data; Object *ob; + PointerRNA ptr; int index; /* add or copy material */ - ptr= CTX_data_pointer_get(C, "material"); - ma= (RNA_struct_is_a(ptr.type, &RNA_Material))? ptr.data: NULL; - if(ma) ma= copy_material(ma); else @@ -70,9 +290,9 @@ static int new_material_exec(bContext *C, wmOperator *op) ma->id.us--; /* compensating for us++ in assign_material */ /* attempt to assign to material slot */ - ptr= CTX_data_pointer_get(C, "material_slot"); + ptr= CTX_data_pointer_get_type(C, "material_slot", &RNA_MaterialSlot); - if(RNA_struct_is_a(ptr.type, &RNA_MaterialSlot)) { + if(ptr.data) { ob= ptr.id.data; index= (Material**)ptr.data - ob->mat; @@ -80,6 +300,8 @@ static int new_material_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); } + + WM_event_add_notifier(C, NC_MATERIAL|NA_ADDED, ma); return OPERATOR_FINISHED; } @@ -101,15 +323,12 @@ void MATERIAL_OT_new(wmOperatorType *ot) static int new_texture_exec(bContext *C, wmOperator *op) { - PointerRNA ptr; + Tex *tex= CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data; ID *id; - Tex *tex; MTex *mtex; + PointerRNA ptr; /* add or copy texture */ - ptr= CTX_data_pointer_get(C, "texture"); - tex= (RNA_struct_is_a(ptr.type, &RNA_Texture))? ptr.data: NULL; - if(tex) tex= copy_texture(tex); else @@ -118,9 +337,9 @@ static int new_texture_exec(bContext *C, wmOperator *op) id_us_min(&tex->id); /* attempt to assign to texture slot */ - ptr= CTX_data_pointer_get(C, "texture_slot"); + ptr= CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot); - if(RNA_struct_is_a(ptr.type, &RNA_TextureSlot)) { + if(ptr.data) { id= ptr.id.data; mtex= ptr.data; @@ -133,6 +352,8 @@ static int new_texture_exec(bContext *C, wmOperator *op) /* XXX nodes, notifier .. */ } + + WM_event_add_notifier(C, NC_TEXTURE|NA_ADDED, tex); return OPERATOR_FINISHED; } @@ -154,27 +375,21 @@ void TEXTURE_OT_new(wmOperatorType *ot) static int new_world_exec(bContext *C, wmOperator *op) { - PointerRNA ptr; - Scene *scene; - World *wo; + Scene *scene= CTX_data_scene(C); + World *wo= CTX_data_pointer_get_type(C, "world", &RNA_World).data; /* add or copy world */ - ptr= CTX_data_pointer_get(C, "world"); - wo= (RNA_struct_is_a(ptr.type, &RNA_World))? ptr.data: NULL; - if(wo) wo= copy_world(wo); else wo= add_world("World"); /* assign to scene */ - scene= CTX_data_scene(C); - if(scene->world) id_us_min(&scene->world->id); scene->world= wo; - // XXX notifier + WM_event_add_notifier(C, NC_WORLD|NA_ADDED, wo); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index e5d2215be29..0e444d7f0b7 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -210,6 +210,12 @@ static void buttons_main_area_draw(const bContext *C, ARegion *ar) void buttons_operatortypes(void) { + WM_operatortype_append(OBJECT_OT_material_slot_add); + WM_operatortype_append(OBJECT_OT_material_slot_remove); + WM_operatortype_append(OBJECT_OT_material_slot_assign); + WM_operatortype_append(OBJECT_OT_material_slot_select); + WM_operatortype_append(OBJECT_OT_material_slot_deselect); + WM_operatortype_append(MATERIAL_OT_new); WM_operatortype_append(TEXTURE_OT_new); WM_operatortype_append(WORLD_OT_new); -- cgit v1.2.3 From 5b26f520bb50f17b0a2193daf9b8b10616c4707b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 24 Jun 2009 14:16:56 +0000 Subject: UI * Added SCROLL button type, use like a NUMSLI basically, with a1 used to define the scroller size. * Add scroll and toggle colors to the Theme (toggle was set to draw like radio in a recent commit, but it's the intention these look different). * Added rudimentary list template, used for object material slots, this is WIP though. * In popup menu, split text with line breaks over multiple lines, makes python errors display slightly nicer. --- source/blender/editors/include/UI_interface.h | 1 + .../blender/editors/interface/interface_handlers.c | 62 +++++++-- .../blender/editors/interface/interface_intern.h | 6 +- .../blender/editors/interface/interface_layout.c | 2 +- .../blender/editors/interface/interface_regions.c | 3 +- .../editors/interface/interface_templates.c | 144 +++++++++++++++++++++ source/blender/editors/interface/interface_utils.c | 2 + .../blender/editors/interface/interface_widgets.c | 125 +++++++++++++++++- source/blender/makesdna/DNA_userdef_types.h | 5 +- source/blender/makesrna/intern/rna_ui_api.c | 6 + source/blender/makesrna/intern/rna_userdef.c | 13 +- 11 files changed, 348 insertions(+), 21 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 80e57f5e5be..86516f9c973 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -617,6 +617,7 @@ void uiTemplateColorRamp(uiLayout *layout, struct ColorBand *coba, int expand); void uiTemplateCurveMapping(uiLayout *layout, struct CurveMapping *cumap, int type); void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, char *propname); void uiTemplateImageLayers(uiLayout *layout, struct bContext *C, struct Image *ima, struct ImageUser *iuser); +void uiTemplateList(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *activeprop, int items); /* items */ void uiItemO(uiLayout *layout, char *name, int icon, char *opname); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 8eab0305047..bdbfce782b6 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -746,11 +746,8 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut ui_apply_but_ROW(C, block, but, data); break; case SCROLL: - break; case NUM: case NUMABS: - ui_apply_but_NUM(C, but, data); - break; case SLI: case NUMSLI: ui_apply_but_NUM(C, but, data); @@ -2061,6 +2058,11 @@ static int ui_numedit_but_SLI(uiBut *but, uiHandleButtonData *data, int shift, i if(but->type==NUMSLI) deler= ((but->x2-but->x1) - 5.0*but->aspect); else if(but->type==HSVSLI) deler= ((but->x2-but->x1)/2 - 5.0*but->aspect); + else if(but->type==SCROLL) { + int horizontal= (but->x2 - but->x1 > but->y2 - but->y1); + float size= (horizontal)? (but->x2-but->x1): -(but->y2-but->y1); + deler= size*(but->softmax - but->softmin)/(but->softmax - but->softmin + but->a1); + } else deler= (but->x2-but->x1- 5.0*but->aspect); f= (float)(mx-data->dragstartx)/deler + data->dragfstart; @@ -2231,6 +2233,54 @@ static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButton return retval; } +static int ui_do_but_SCROLL(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event) +{ + int mx, my, click= 0; + int retval= WM_UI_HANDLER_CONTINUE; + int horizontal= (but->x2 - but->x1 > but->y2 - but->y1); + + mx= event->x; + my= event->y; + ui_window_to_block(data->region, block, &mx, &my); + + if(data->state == BUTTON_STATE_HIGHLIGHT) { + if(event->val==KM_PRESS) { + if(event->type == LEFTMOUSE) { + if(horizontal) { + data->dragstartx= mx; + data->draglastx= mx; + } + else { + data->dragstartx= my; + data->draglastx= my; + } + button_activate_state(C, but, BUTTON_STATE_NUM_EDITING); + retval= WM_UI_HANDLER_BREAK; + } + else if(ELEM(event->type, PADENTER, RETKEY) && event->val==KM_PRESS) + click= 1; + } + } + else if(data->state == BUTTON_STATE_NUM_EDITING) { + if(event->type == ESCKEY) { + data->cancel= 1; + data->escapecancel= 1; + button_activate_state(C, but, BUTTON_STATE_EXIT); + } + else if(event->type == LEFTMOUSE && event->val!=KM_PRESS) { + button_activate_state(C, but, BUTTON_STATE_EXIT); + } + else if(event->type == MOUSEMOVE) { + if(ui_numedit_but_SLI(but, data, 0, 0, (horizontal)? mx: my)) + ui_numedit_apply(C, block, but, data); + } + + retval= WM_UI_HANDLER_BREAK; + } + + return retval; +} + static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event) { @@ -3073,13 +3123,9 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event) case OPTIONN: retval= ui_do_but_TOG(C, but, data, event); break; -#if 0 case SCROLL: - /* DrawBut(b, 1); */ - /* do_scrollbut(b); */ - /* DrawBut(b,0); */ + retval= ui_do_but_SCROLL(C, block, but, data, event); break; -#endif case NUM: case NUMABS: retval= ui_do_but_NUM(C, block, but, data, event); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 187d7cccd97..3b40bd7c29a 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -50,6 +50,9 @@ struct bContextStore; /* visual types for drawing */ /* for time being separated from functional types */ typedef enum { + /* default */ + UI_WTYPE_REGULAR, + /* standard set */ UI_WTYPE_LABEL, UI_WTYPE_TOGGLE, @@ -78,7 +81,8 @@ typedef enum { UI_WTYPE_SWATCH, UI_WTYPE_RGB_PICKER, UI_WTYPE_NORMAL, - UI_WTYPE_BOX + UI_WTYPE_BOX, + UI_WTYPE_SCROLL } uiWidgetTypeEnum; diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 555500004ea..03da6861974 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1271,7 +1271,6 @@ static void ui_litem_layout_box(uiLayout *litem) h= litem->h; litem->x += style->boxspace; - litem->y -= style->boxspace; if(w != 0) litem->w -= 2*style->boxspace; if(h != 0) litem->h -= 2*style->boxspace; @@ -1352,6 +1351,7 @@ static void ui_litem_estimate_column_flow(uiLayout *litem) } } + litem->w= x; litem->h= litem->y - miny; } diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index af1d4e91c67..f7a0e97d05d 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -181,7 +181,7 @@ MenuData *decompose_menu_string(char *str) *s= '\0'; s++; } - } else if (c=='|' || c=='\0') { + } else if (c=='|' || c == '\n' || c=='\0') { if (nitem) { *s= '\0'; @@ -2567,7 +2567,6 @@ static uiPopupBlockHandle *ui_pup_menu(bContext *C, int maxrow, uiMenuHandleFunc return menu; } - static void operator_name_cb(bContext *C, void *arg, int retval) { const char *opname= arg; diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 9dd7ae90f20..facc0bb6537 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1494,3 +1494,147 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, char *propname) } } + +/************************* List Template **************************/ + +typedef struct ListItem { + PointerRNA ptr; + PropertyRNA *prop; + PropertyRNA *activeprop; + + PointerRNA activeptr; + int activei; + + int selected; +} ListItem; + +static void list_item_cb(bContext *C, void *arg_item, void *arg_unused) +{ + ListItem *item= (ListItem*)arg_item; + PropertyType activetype; + char *activename; + + if(item->selected) { + activetype= RNA_property_type(item->activeprop); + + if(activetype == PROP_POINTER) + RNA_property_pointer_set(&item->ptr, item->activeprop, item->activeptr); + else if(activetype == PROP_INT) + RNA_property_int_set(&item->ptr, item->activeprop, item->activei); + else if(activetype == PROP_STRING) { + activename= RNA_struct_name_get_alloc(&item->activeptr, NULL, 0); + RNA_property_string_set(&item->ptr, item->activeprop, activename); + MEM_freeN(activename); + } + } +} + +void uiTemplateList(uiLayout *layout, PointerRNA *ptr, char *propname, char *activepropname, int items) +{ + PropertyRNA *prop, *activeprop; + PropertyType type, activetype; + PointerRNA activeptr; + uiLayout *box, *row, *col; + uiBlock *block; + uiBut *but; + char *name, *activename= NULL; + int i= 1, activei= 0, len; + static int scroll = 1; + + /* validate arguments */ + if(!ptr->data) + return; + + prop= RNA_struct_find_property(ptr, propname); + if(!prop) { + printf("uiTemplateList: property not found: %s\n", propname); + return; + } + + activeprop= RNA_struct_find_property(ptr, activepropname); + if(!activeprop) { + printf("uiTemplateList: property not found: %s\n", activepropname); + return; + } + + type= RNA_property_type(prop); + if(type != PROP_COLLECTION) { + printf("uiTemplateList: expected collection property.\n"); + return; + } + + activetype= RNA_property_type(activeprop); + if(!ELEM3(activetype, PROP_POINTER, PROP_INT, PROP_STRING)) { + printf("uiTemplateList: expected pointer, integer or string property.\n"); + return; + } + + if(items == 0) + items= 5; + + /* get active data */ + if(activetype == PROP_POINTER) + activeptr= RNA_property_pointer_get(ptr, activeprop); + else if(activetype == PROP_INT) + activei= RNA_property_int_get(ptr, activeprop); + else if(activetype == PROP_STRING) + activename= RNA_property_string_get_alloc(ptr, activeprop, NULL, 0); + + box= uiLayoutBox(layout); + row= uiLayoutRow(box, 0); + col = uiLayoutColumn(row, 1); + + block= uiLayoutGetBlock(col); + uiBlockSetEmboss(block, UI_EMBOSSN); + + len= RNA_property_collection_length(ptr, prop); + CLAMP(scroll, 1, len); + + RNA_BEGIN(ptr, itemptr, propname) { + if(i >= scroll && iptr= *ptr; + item->prop= prop; + item->activeprop= activeprop; + item->activeptr= itemptr; + item->activei= i; + + if(activetype == PROP_POINTER) + item->selected= (activeptr.data == itemptr.data); + else if(activetype == PROP_INT) + item->selected= (activei == i); + else if(activetype == PROP_STRING) + item->selected= (strcmp(activename, name) == 0); + + but= uiDefIconTextButI(block, TOG, 0, RNA_struct_ui_icon(itemptr.type), name, 0,0,UI_UNIT_X*10,UI_UNIT_Y, &item->selected, 0, 0, 0, 0, ""); + uiButSetFlag(but, UI_ICON_LEFT|UI_TEXT_LEFT); + uiButSetNFunc(but, list_item_cb, item, NULL); + + MEM_freeN(name); + } + } + + i++; + } + RNA_END; + + while(i < scroll+items) { + if(i >= scroll) + uiItemL(col, "", 0); + i++; + } + + uiBlockSetEmboss(block, UI_EMBOSS); + + if(len > items) { + col= uiLayoutColumn(row, 0); + uiDefButI(block, SCROLL, 0, "", 0,0,UI_UNIT_X*0.75,UI_UNIT_Y*items, &scroll, 1, len-items+1, items, 0, ""); + } + + //uiDefButI(block, SCROLL, 0, "", 0,0,UI_UNIT_X*15,UI_UNIT_Y*0.75, &scroll, 1, 16-5, 5, 0, ""); +} + diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index a75a3402774..dff8e13aad5 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -120,6 +120,8 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind if(!pptr.type) pptr.type= RNA_property_pointer_type(ptr, prop); icon= RNA_struct_ui_icon(pptr.type); + if(icon == ICON_DOT) + icon= 0; but= uiDefIconTextButR(block, IDPOIN, 0, icon, name, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL); break; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index bae8cdab2cd..fa3abd8a3ad 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -102,6 +102,7 @@ typedef struct uiWidgetBase { float inner_uv[64][2]; short inner, outline, emboss; /* set on/off */ + short shadedir; uiWidgetTrias tria1; uiWidgetTrias tria2; @@ -199,6 +200,7 @@ static void widget_init(uiWidgetBase *wtb) wtb->inner= 1; wtb->outline= 1; wtb->emboss= 1; + wtb->shadedir= 1; } /* helper call, makes shadow rect, with 'sun' above menu, so only shadow to left/right/bottom */ @@ -583,7 +585,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, uiWidgetColors *wcol) glShadeModel(GL_SMOOTH); glBegin(GL_POLYGON); for(a=0; atotvert; a++) { - round_box_shade_col4(col1, col2, wtb->inner_uv[a][1]); + round_box_shade_col4(col1, col2, wtb->inner_uv[a][wtb->shadedir]); glVertex2fv(wtb->inner_v[a]); } glEnd(); @@ -1088,6 +1090,32 @@ static struct uiWidgetColors wcol_box= { 0, 0 }; +static struct uiWidgetColors wcol_toggle= { + {25, 25, 25, 255}, + {153, 153, 153, 255}, + {100, 100, 100, 255}, + {25, 25, 25, 255}, + + {0, 0, 0, 255}, + {255, 255, 255, 255}, + + 0, + 0, 0 +}; + +static struct uiWidgetColors wcol_scroll= { + {25, 25, 25, 255}, + {180, 180, 180, 255}, + {153, 153, 153, 255}, + {90, 90, 90, 255}, + + {0, 0, 0, 255}, + {255, 255, 255, 255}, + + 1, + 0, -20 +}; + /* free wcol struct to play with */ static struct uiWidgetColors wcol_tmp= { {0, 0, 0, 255}, @@ -1109,9 +1137,10 @@ void ui_widget_color_init(ThemeUI *tui) tui->wcol_regular= wcol_regular; tui->wcol_tool= wcol_tool; - tui->wcol_radio= wcol_radio; tui->wcol_text= wcol_text; + tui->wcol_radio= wcol_radio; tui->wcol_option= wcol_option; + tui->wcol_toggle= wcol_toggle; tui->wcol_num= wcol_num; tui->wcol_numslider= wcol_numslider; tui->wcol_menu= wcol_menu; @@ -1119,6 +1148,7 @@ void ui_widget_color_init(ThemeUI *tui) tui->wcol_menu_back= wcol_menu_back; tui->wcol_menu_item= wcol_menu_item; tui->wcol_box= wcol_box; + tui->wcol_scroll= wcol_scroll; } /* ************ button callbacks, state ***************** */ @@ -1602,6 +1632,75 @@ void ui_draw_link_bezier(rcti *rect) } } +static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +{ + uiWidgetBase wtb; + rcti rect1; + double value; + char inner[3]; + float fac, size, rad; + int horizontal; + + /* determine horizontal/vertical */ + horizontal= (rect->xmax - rect->xmin > rect->ymax - rect->ymin); + + if(horizontal) + rad= 0.5f*(rect->ymax - rect->ymin); + else + rad= 0.5f*(rect->xmax - rect->xmin); + + widget_init(&wtb); + wtb.shadedir= (horizontal)? 1: 0; + + /* draw back part, colors swapped and shading inverted */ + VECCOPY(inner, wcol->inner); + VECCOPY(wcol->inner, wcol->item); + if(horizontal) + SWAP(short, wcol->shadetop, wcol->shadedown); + if(state & UI_SELECT) + SWAP(short, wcol->shadetop, wcol->shadedown); + + round_box_edges(&wtb, roundboxalign, rect, rad); /* XXX vertical gradient is wrong */ + widgetbase_draw(&wtb, wcol); + + VECCOPY(wcol->inner, inner); + if(horizontal) + SWAP(short, wcol->shadetop, wcol->shadedown); + if(state & UI_SELECT) + SWAP(short, wcol->shadetop, wcol->shadedown); + + /* front part */ + value= ui_get_but_val(but); + + size= (but->softmax + but->a1 - but->softmin); + size= MAX2(size, 2); + + /* position */ + rect1= *rect; + + if(horizontal) { + fac= (rect->xmax - rect->xmin)/(size-1); + rect1.xmin= rect1.xmin + ceil(fac*(value - but->softmin)); + rect1.xmax= rect1.xmin + ceil(fac*(but->a1 - but->softmin)); + } + else { + fac= (rect->ymax - rect->ymin)/(size-1); + rect1.ymax= rect1.ymax - ceil(fac*(value - but->softmin)); + rect1.ymin= rect1.ymax - ceil(fac*(but->a1 - but->softmin)); + } + + /* draw */ + wtb.emboss= 0; /* only emboss once */ + + if(!horizontal) + SWAP(short, wcol->shadetop, wcol->shadedown); + + round_box_edges(&wtb, roundboxalign, &rect1, rad); /* XXX vertical gradient is wrong */ + widgetbase_draw(&wtb, wcol); + + if(!horizontal) + SWAP(short, wcol->shadetop, wcol->shadedown); +} static void widget_link(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) { @@ -1896,13 +1995,16 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type) wt.text= widget_draw_text_icon; switch(type) { + case UI_WTYPE_REGULAR: + break; + case UI_WTYPE_LABEL: wt.draw= NULL; wt.state= widget_state_label; break; case UI_WTYPE_TOGGLE: - wt.wcol_theme= &btheme->tui.wcol_radio;/*use radio theme for toggles*/ + wt.wcol_theme= &btheme->tui.wcol_toggle; break; case UI_WTYPE_OPTION: @@ -1915,7 +2017,7 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type) wt.wcol_theme= &btheme->tui.wcol_radio; wt.draw= widget_radiobut; break; - + case UI_WTYPE_NUMBER: wt.wcol_theme= &btheme->tui.wcol_num; wt.draw= widget_numbut; @@ -1996,6 +2098,11 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type) case UI_WTYPE_NORMAL: break; + + case UI_WTYPE_SCROLL: + wt.wcol_theme= &btheme->tui.wcol_scroll; + wt.custom= widget_scroll; + break; } return &wt; @@ -2090,6 +2197,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct case BUT: wt= widget_type(UI_WTYPE_EXEC); break; + case NUM: wt= widget_type(UI_WTYPE_NUMBER); break; @@ -2185,9 +2293,13 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct case BUT_CURVE: ui_draw_but_CURVE(ar, but, &tui->wcol_regular, rect); break; - + + case SCROLL: + wt= widget_type(UI_WTYPE_SCROLL); + break; + default: - wt= widget_type(UI_WTYPE_TOGGLE); + wt= widget_type(UI_WTYPE_REGULAR); } } @@ -2196,6 +2308,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct int roundboxalign, state; roundboxalign= widget_roundbox_set(but, rect); + state= but->flag; if(but->editstr) state |= UI_TEXTINPUT; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index db13acf12d5..771a7e43793 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -124,10 +124,11 @@ typedef struct uiWidgetColors { typedef struct ThemeUI { /* Interface Elements (buttons, menus, icons) */ - uiWidgetColors wcol_regular, wcol_tool, wcol_radio, wcol_text, wcol_option; + uiWidgetColors wcol_regular, wcol_tool, wcol_text; + uiWidgetColors wcol_radio, wcol_option, wcol_toggle; uiWidgetColors wcol_num, wcol_numslider; uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item; - uiWidgetColors wcol_box; + uiWidgetColors wcol_box, wcol_scroll; char iconfile[80]; // FILE_MAXFILE length diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index d8648e05153..75de9d53766 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -249,6 +249,12 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_pointer(func, "image_user", "ImageUser", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "template_list", "uiTemplateList"); + api_ui_item_rna_common(func); + parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, indicating the active element."); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_int(func, "items", 5, 0, INT_MAX, "", "Number of items to display.", 0, INT_MAX); } #endif diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 97337af5cb0..609082144e1 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -306,6 +306,12 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Option Widget Colors", ""); RNA_def_property_update(prop, NC_WINDOW, NULL); + + prop= RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "wcol_toggle"); + RNA_def_property_struct_type(prop, "ThemeWidgetColors"); + RNA_def_property_ui_text(prop, "Toggle Widget Colors", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_num"); @@ -348,7 +354,12 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Menu Item Colors", ""); RNA_def_property_update(prop, NC_WINDOW, NULL); - + + prop= RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "wcol_scroll"); + RNA_def_property_struct_type(prop, "ThemeWidgetColors"); + RNA_def_property_ui_text(prop, "Scroll Widget Colors", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "icon_file", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "iconfile"); -- cgit v1.2.3 From 627abe0acf2b52d06fc26e93462f5261cf508879 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 24 Jun 2009 16:44:54 +0000 Subject: 2.5 Added support for icons in search menu. It already displays icons for saved materials etc. from old files. Have to add previewrenders for this still. --- source/blender/editors/include/UI_interface.h | 2 +- source/blender/editors/interface/interface_intern.h | 2 +- source/blender/editors/interface/interface_regions.c | 11 ++++++++--- .../blender/editors/interface/interface_templates.c | 17 ++++++++++++++++- source/blender/editors/interface/interface_utils.c | 19 ++++++++++++++++++- source/blender/editors/interface/interface_widgets.c | 10 +++++++++- source/blender/editors/space_info/info_header.c | 2 +- source/blender/windowmanager/intern/wm_operators.c | 2 +- 8 files changed, 55 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 86516f9c973..2f054f7a08a 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -454,7 +454,7 @@ typedef void (*uiButSearchFunc)(const struct bContext *C, void *arg, char *str, typedef void (*uiBlockHandleFunc)(struct bContext *C, void *arg, int event); /* use inside searchfunc to add items */ -int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin); +int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int iconid); /* bfunc gets search item *poin as arg2, or if NULL the old string */ void uiButSetSearchFunc (uiBut *but, uiButSearchFunc sfunc, void *arg1, uiButHandleFunc bfunc); /* height in pixels, it's using hardcoded values still */ diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 3b40bd7c29a..379c11a6f31 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -420,7 +420,7 @@ extern void ui_draw_but(const struct bContext *C, ARegion *ar, struct uiStyle *s struct ThemeUI; void ui_widget_color_init(struct ThemeUI *tui); -void ui_draw_menu_item(struct uiFontStyle *fstyle, rcti *rect, char *name, int state); +void ui_draw_menu_item(struct uiFontStyle *fstyle, rcti *rect, char *name, int iconid, int state); /* interface_style.c */ void uiStyleInit(void); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index f7a0e97d05d..a1dae39d687 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -40,6 +40,7 @@ #include "BLI_dynstr.h" #include "BKE_context.h" +#include "BKE_icons.h" #include "BKE_report.h" #include "BKE_screen.h" #include "BKE_texture.h" @@ -433,7 +434,7 @@ struct uiSearchItems { char **names; void **pointers; - + int *icons; }; typedef struct uiSearchboxData { @@ -448,7 +449,7 @@ typedef struct uiSearchboxData { /* exported for use by search callbacks */ /* returns zero if nothing to add */ -int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin) +int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int iconid) { if(items->totitem>=items->maxitem) { @@ -464,6 +465,7 @@ int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin) BLI_strncpy(items->names[items->totitem], name, items->maxstrlen); items->pointers[items->totitem]= poin; + items->icons[items->totitem]= iconid; items->totitem++; @@ -639,7 +641,8 @@ static void ui_searchbox_region_draw(const bContext *C, ARegion *ar) for(a=0; aitems.totitem; a++) { ui_searchbox_butrect(&rect, data, a); - ui_draw_menu_item(&data->fstyle, &rect, data->items.names[a], (a+1)==data->active?UI_ACTIVE:0); + /* widget itself */ + ui_draw_menu_item(&data->fstyle, &rect, data->items.names[a], data->items.icons[a], (a+1)==data->active?UI_ACTIVE:0); } /* indicate more */ @@ -666,6 +669,7 @@ static void ui_searchbox_region_free(ARegion *ar) MEM_freeN(data->items.names[a]); MEM_freeN(data->items.names); MEM_freeN(data->items.pointers); + MEM_freeN(data->items.icons); MEM_freeN(data); ar->regiondata= NULL; @@ -794,6 +798,7 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) data->items.totitem= 0; data->items.names= MEM_callocN(SEARCH_ITEMS*sizeof(void *), "search names"); data->items.pointers= MEM_callocN(SEARCH_ITEMS*sizeof(void *), "search pointers"); + data->items.icons= MEM_callocN(SEARCH_ITEMS*sizeof(int), "search icons"); for(x1=0; x1items.names[x1]= MEM_callocN(but->hardmax+1, "search pointers"); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index facc0bb6537..3856a0577fa 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -146,9 +146,24 @@ static void id_search_cb(const struct bContext *C, void *arg_litem, char *str, u ID *id; for(id= lb->first; id; id= id->next) { + int iconid= 0; + + /* icon */ + switch(GS(id->name)) + { + case ID_MA: /* fall through */ + case ID_TE: /* fall through */ + case ID_IM: /* fall through */ + case ID_WO: /* fall through */ + case ID_LA: /* fall through */ + iconid= BKE_icon_getid(id); + break; + default: + break; + } if(BLI_strcasestr(id->name+2, str)) { - if(0==uiSearchItemAdd(items, id->name+2, id)) + if(0==uiSearchItemAdd(items, id->name+2, id, iconid)) break; } } diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index dff8e13aad5..69104c87e64 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -43,6 +43,7 @@ #include "BKE_colortools.h" #include "BKE_context.h" #include "BKE_idprop.h" +#include "BKE_icons.h" #include "BKE_library.h" #include "BKE_main.h" #include "BKE_texture.h" @@ -306,9 +307,25 @@ static void id_search_cb(const struct bContext *C, void *arg_params, char *str, ID *id; for(id= params->lb->first; id; id= id->next) { + int iconid= 0; + + + /* icon */ + switch(GS(id->name)) + { + case ID_MA: /* fall through */ + case ID_TE: /* fall through */ + case ID_IM: /* fall through */ + case ID_WO: /* fall through */ + case ID_LA: /* fall through */ + iconid= BKE_icon_getid(id); + break; + default: + break; + } if(BLI_strcasestr(id->name+2, str)) { - if(0==uiSearchItemAdd(items, id->name+2, id)) + if(0==uiSearchItemAdd(items, id->name+2, id, iconid)) break; } } diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index fa3abd8a3ad..735cfe742c6 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2356,7 +2356,7 @@ void ui_draw_search_back(uiStyle *style, uiBlock *block, rcti *rect) /* helper call to draw a menu item without button */ /* state: UI_ACTIVE or 0 */ -void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, char *name, int state) +void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, char *name, int iconid, int state) { uiWidgetType *wt= widget_type(UI_WTYPE_MENU_ITEM); rcti _rect= *rect; @@ -2370,6 +2370,7 @@ void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, char *name, int state) /* text location offset */ rect->xmin+=5; + if(iconid) rect->xmin+= ICON_HEIGHT; /* cut string in 2 parts? */ cpoin= strchr(name, '|'); @@ -2392,5 +2393,12 @@ void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, char *name, int state) /* restore rect, was messed with */ *rect= _rect; + if(iconid) { + int xs= rect->xmin+4; + int ys= 1 + (rect->ymin+rect->ymax- ICON_HEIGHT)/2; + glEnable(GL_BLEND); + UI_icon_draw_aspect_blended(xs, ys, iconid, 1.2f, 0); /* XXX scale weak get from fstyle? */ + glDisable(GL_BLEND); + } } diff --git a/source/blender/editors/space_info/info_header.c b/source/blender/editors/space_info/info_header.c index c8dd3df8425..7b65a70117c 100644 --- a/source/blender/editors/space_info/info_header.c +++ b/source/blender/editors/space_info/info_header.c @@ -415,7 +415,7 @@ static void operator_search_cb(const struct bContext *C, void *arg, char *str, u name[len]= '|'; } - if(0==uiSearchItemAdd(items, name, ot)) + if(0==uiSearchItemAdd(items, name, ot, 0)) break; } } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 33f4ff11679..76a7b18fa12 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -402,7 +402,7 @@ static void operator_search_cb(const struct bContext *C, void *arg, char *str, u name[len]= '|'; } - if(0==uiSearchItemAdd(items, name, ot)) + if(0==uiSearchItemAdd(items, name, ot, 0)) break; } } -- cgit v1.2.3 From ee9c260c385d41ec45e67450a59ad7788084aa90 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 24 Jun 2009 17:22:22 +0000 Subject: 2.5 - Added ND_SHADING notifier on linking materials, so it gives refreshes in UI - Removed reduntant debug prints Crucial fixes in other code while checking warnings; - Particle buttons were assigned to short, whilst data was int - Filesel border select used float rect API, on an int rect. --- source/blender/editors/interface/interface_handlers.c | 1 - source/blender/editors/interface/interface_templates.c | 3 +++ source/blender/editors/physics/ed_pointcache.c | 4 ++-- source/blender/editors/space_buttons/space_buttons.c | 6 +++++- source/blender/editors/space_file/file_ops.c | 2 +- source/blender/editors/space_file/filesel.c | 2 +- source/blender/editors/space_view3d/view3d_header.c | 6 +++--- source/blender/makesrna/intern/rna_object.c | 2 ++ 8 files changed, 17 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index bdbfce782b6..2382af53a11 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1438,7 +1438,6 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle } } else if(inbox) { - printf("release inside \n"); button_activate_state(C, but, BUTTON_STATE_EXIT); retval= WM_UI_HANDLER_BREAK; } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 3856a0577fa..c919d9c3119 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -27,9 +27,12 @@ #include "MEM_guardedalloc.h" +#include "DNA_screen_types.h" + #include "BLI_string.h" #include "BKE_context.h" +#include "BKE_icons.h" #include "BKE_library.h" #include "BKE_utildefines.h" diff --git a/source/blender/editors/physics/ed_pointcache.c b/source/blender/editors/physics/ed_pointcache.c index e47f44c5c1a..3374e05883c 100644 --- a/source/blender/editors/physics/ed_pointcache.c +++ b/source/blender/editors/physics/ed_pointcache.c @@ -83,7 +83,7 @@ static int ptcache_bake_all_exec(bContext *C, wmOperator *op) baker.render = 0; baker.break_test = cache_break_test; baker.break_data = NULL; - baker.progressbar = WM_timecursor; + baker.progressbar = (void (*)(void *, int))WM_timecursor; baker.progresscontext = CTX_wm_window(C); BKE_ptcache_make_cache(&baker); @@ -170,7 +170,7 @@ static int ptcache_bake_particle_system_exec(bContext *C, wmOperator *op) baker.render = 0; baker.break_test = cache_break_test; baker.break_data = NULL; - baker.progressbar = WM_timecursor; + baker.progressbar = (void (*)(void *, int))WM_timecursor; baker.progresscontext = CTX_wm_window(C); BKE_ptcache_make_cache(&baker); diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 0e444d7f0b7..483a1dc6100 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -343,6 +343,11 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn) case ND_GEOM_SELECT: ED_area_tag_redraw(sa); break; + case ND_SHADING: + case ND_SHADING_DRAW: + /* currently works by redraws... if preview is set, it (re)starts job */ + sbuts->preview= 1; + break; } break; case NC_MATERIAL: @@ -353,7 +358,6 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn) case ND_SHADING_DRAW: /* currently works by redraws... if preview is set, it (re)starts job */ sbuts->preview= 1; - printf("shader notifier \n"); break; } break; diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 0c6cadc05c1..ab02147d020 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -190,7 +190,7 @@ static int file_border_select_exec(bContext *C, wmOperator *op) rect.xmax= RNA_int_get(op->ptr, "xmax"); rect.ymax= RNA_int_get(op->ptr, "ymax"); - BLI_isect_rctf(&(ar->v2d.mask), &rect, &rect); + BLI_isect_rcti(&(ar->v2d.mask), &rect, &rect); file_select(sfile, ar, &rect, val ); WM_event_add_notifier(C, NC_WINDOW, NULL); diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index d57fc7f90bc..479d9cabc55 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -159,7 +159,7 @@ float file_string_width(const char* str) { uiStyle *style= U.uistyles.first; uiStyleFontSet(&style->widget); - return BLF_width(str); + return BLF_width((char *)str); } float file_font_pointsize() diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 13ebeb05a5b..79ea90864f3 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -5513,11 +5513,11 @@ void view3d_header_buttons(const bContext *C, ARegion *ar) } else if(G.f & G_PARTICLEEDIT) { uiBlockBeginAlign(block); - uiDefIconButBitS(block, TOG, SCE_SELECT_PATH, B_SEL_PATH, ICON_EDGESEL, xco,yco,XIC,YIC, &ts->particle.selectmode, 1.0, 0.0, 0, 0, "Path edit mode"); + uiDefIconButBitI(block, TOG, SCE_SELECT_PATH, B_SEL_PATH, ICON_EDGESEL, xco,yco,XIC,YIC, &ts->particle.selectmode, 1.0, 0.0, 0, 0, "Path edit mode"); xco+= XIC; - uiDefIconButBitS(block, TOG, SCE_SELECT_POINT, B_SEL_POINT, ICON_VERTEXSEL, xco,yco,XIC,YIC, &ts->particle.selectmode, 1.0, 0.0, 0, 0, "Point select mode"); + uiDefIconButBitI(block, TOG, SCE_SELECT_POINT, B_SEL_POINT, ICON_VERTEXSEL, xco,yco,XIC,YIC, &ts->particle.selectmode, 1.0, 0.0, 0, 0, "Point select mode"); xco+= XIC; - uiDefIconButBitS(block, TOG, SCE_SELECT_END, B_SEL_END, ICON_FACESEL, xco,yco,XIC,YIC, &ts->particle.selectmode, 1.0, 0.0, 0, 0, "Tip select mode"); + uiDefIconButBitI(block, TOG, SCE_SELECT_END, B_SEL_END, ICON_FACESEL, xco,yco,XIC,YIC, &ts->particle.selectmode, 1.0, 0.0, 0, 0, "Tip select mode"); xco+= XIC; uiBlockEndAlign(block); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 9e8dbbb12b3..3721c7d4ccb 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -409,11 +409,13 @@ static void rna_def_material_slot(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_funcs(prop, "rna_MaterialSlot_material_get", "rna_MaterialSlot_material_set", NULL); RNA_def_property_ui_text(prop, "Material", "Material datablock used by this material slot."); + RNA_def_property_update(prop, NC_OBJECT|ND_SHADING, "rna_Object_update"); prop= RNA_def_property(srna, "link", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, link_items); RNA_def_property_enum_funcs(prop, "rna_MaterialSlot_link_get", "rna_MaterialSlot_link_set", NULL); RNA_def_property_ui_text(prop, "Link", "Link material to object or the object's data."); + RNA_def_property_update(prop, NC_OBJECT|ND_SHADING, "rna_Object_update"); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_MaterialSlot_name_get", "rna_MaterialSlot_name_length", NULL); -- cgit v1.2.3 From b6241e7b7cdc7106db440f57808fc312593974ae Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 24 Jun 2009 17:57:10 +0000 Subject: 2.5 Bugfix: added refresh for modifiers for enable/disable --- source/blender/editors/interface/interface_templates.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index c919d9c3119..a27788530ce 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -380,6 +380,15 @@ static void modifiers_del(bContext *C, void *ob_v, void *md_v) BKE_reports_clear(&reports); } +static void modifiers_activate(bContext *C, void *ob_v, void *md_v) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= ob_v; + + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); +} + static void modifiers_moveUp(bContext *C, void *ob_v, void *md_v) { Scene *scene= CTX_data_scene(C); @@ -593,8 +602,10 @@ static uiLayout *draw_modifier(uiLayout *layout, Object *ob, ModifierData *md, i if (((md->type!=eModifierType_Softbody && md->type!=eModifierType_Collision) || !(ob->pd && ob->pd->deflect)) && (md->type!=eModifierType_Surface)) { uiDefIconButBitI(block, TOG, eModifierMode_Render, 0, ICON_SCENE, 0, 0, 19, UI_UNIT_Y,&md->mode, 0, 0, 1, 0, "Enable modifier during rendering"); but= uiDefIconButBitI(block, TOG, eModifierMode_Realtime, 0, ICON_VIEW3D, 0, 0, 19, UI_UNIT_Y,&md->mode, 0, 0, 1, 0, "Enable modifier during interactive display"); + uiButSetFunc(but, modifiers_activate, ob, md); if (mti->flags&eModifierTypeFlag_SupportsEditmode) { - uiDefIconButBitI(block, TOG, eModifierMode_Editmode, 0, ICON_EDITMODE_HLT, 0, 0, 19, UI_UNIT_Y,&md->mode, 0, 0, 1, 0, "Enable modifier during Editmode (only if enabled for display)"); + but= uiDefIconButBitI(block, TOG, eModifierMode_Editmode, 0, ICON_EDITMODE_HLT, 0, 0, 19, UI_UNIT_Y,&md->mode, 0, 0, 1, 0, "Enable modifier during Editmode (only if enabled for display)"); + uiButSetFunc(but, modifiers_activate, ob, md); } } uiBlockEndAlign(block); -- cgit v1.2.3 From 169fdf9e9757a8c31d950f5902d7c4cfd1f96a88 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 24 Jun 2009 18:39:00 +0000 Subject: 2.5: bug fixes for some erratice materials buttons drawing. --- source/blender/editors/interface/interface_templates.c | 3 ++- source/blender/editors/space_buttons/buttons_context.c | 2 +- source/blender/editors/space_image/image_buttons.c | 2 ++ source/blender/editors/space_view3d/drawobject.c | 1 - 4 files changed, 5 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index a27788530ce..4dcf1590a65 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1617,7 +1617,8 @@ void uiTemplateList(uiLayout *layout, PointerRNA *ptr, char *propname, char *act uiBlockSetEmboss(block, UI_EMBOSSN); len= RNA_property_collection_length(ptr, prop); - CLAMP(scroll, 1, len); + scroll= MIN2(scroll, len-items+1); + scroll= MAX2(scroll, 1); RNA_BEGIN(ptr, itemptr, propname) { if(i >= scroll && idata; - if(ob && ob->type && (ob->typetype && (ob->typetotcol) CTX_data_pointer_set(result, &ob->id, &RNA_MaterialSlot, ob->mat+ob->actcol-1); } diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 8aa955f0b34..a08a23c1263 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -383,6 +383,7 @@ static void image_editcursor_buts(const bContext *C, View2D *v2d, uiBlock *block } } +#if 0 static void image_panel_view_properties(const bContext *C, Panel *pa) { SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); @@ -439,6 +440,7 @@ static void image_panel_view_properties(const bContext *C, Panel *pa) } image_editcursor_buts(C, &ar->v2d, block); } +#endif void brush_buttons(const bContext *C, uiBlock *block, short fromsima, int evt_nop, int evt_change, diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index ea9fb66dae0..05490e2fce1 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3566,7 +3566,6 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, ParticleSystem *psys, int dt) { - ToolSettings *ts= scene->toolsettings; ParticleEdit *edit = psys->edit; ParticleData *pa; ParticleCacheKey **path; -- cgit v1.2.3 From 7a357cba3994bee7d05c7a8bf5736eb94067d564 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 24 Jun 2009 21:27:10 +0000 Subject: 2.5: File Selector: display operator properties in the side region, check Save Image or Export PLY operator for example. Also these code changes: * Added some RNA collection iterator macros to simplify code. * Fix bpy.props.BoolProperty not working correct. * Merge uiDefAutoButsRNA/uiDefAutoButsRNA_single into one. --- source/blender/editors/include/UI_interface.h | 2 +- source/blender/editors/interface/interface.c | 19 ++---- .../editors/interface/interface_templates.c | 12 ++-- source/blender/editors/interface/interface_utils.c | 58 +++++------------- source/blender/editors/space_file/file_draw.c | 71 +++++++++++++++++++--- source/blender/editors/space_image/image_ops.c | 53 ++++++++-------- .../blender/editors/space_view3d/view3d_buttons.c | 2 +- .../blender/editors/space_view3d/view3d_toolbar.c | 4 +- source/blender/makesrna/RNA_access.h | 22 +++++++ source/blender/makesrna/RNA_define.h | 2 +- source/blender/makesrna/intern/rna_access.c | 38 ++++-------- source/blender/makesrna/intern/rna_define.c | 2 +- source/blender/python/intern/bpy_operator_wrap.c | 11 +--- source/blender/python/intern/bpy_rna.c | 66 +++++++------------- source/blender/windowmanager/intern/wm_operators.c | 13 ++-- 15 files changed, 176 insertions(+), 199 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 2f054f7a08a..f5e2b45d41e 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -417,7 +417,7 @@ void uiBlockPickerButtons(struct uiBlock *block, float *col, float *hsv, float * void uiBlockColorbandButtons(struct uiBlock *block, struct ColorBand *coba, struct rctf *butr, int event); uiBut *uiDefAutoButR(uiBlock *block, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, char *name, int icon, int x1, int y1, int x2, int y2); -void uiDefAutoButsRNA(const struct bContext *C, uiLayout *layout, struct PointerRNA *ptr); +void uiDefAutoButsRNA(const struct bContext *C, uiLayout *layout, struct PointerRNA *ptr, int columns); /* Links * diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 892a126feb6..73425eac0e1 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1336,20 +1336,14 @@ void ui_get_but_string(uiBut *but, char *str, int maxlen) static void ui_rna_ID_collection(bContext *C, uiBut *but, PointerRNA *ptr, PropertyRNA **prop) { - CollectionPropertyIterator iter; - PropertyRNA *iterprop, *iprop; StructRNA *srna; /* look for collection property in Main */ RNA_pointer_create(NULL, &RNA_Main, CTX_data_main(C), ptr); - iterprop= RNA_struct_iterator_property(ptr->type); - RNA_property_collection_begin(ptr, iterprop, &iter); *prop= NULL; - for(; iter.valid; RNA_property_collection_next(&iter)) { - iprop= iter.ptr.data; - + RNA_STRUCT_BEGIN(ptr, iprop) { /* if it's a collection and has same pointer type, we've got it */ if(RNA_property_type(iprop) == PROP_COLLECTION) { srna= RNA_property_pointer_type(ptr, iprop); @@ -1360,8 +1354,7 @@ static void ui_rna_ID_collection(bContext *C, uiBut *but, PointerRNA *ptr, Prope } } } - - RNA_property_collection_end(&iter); + RNA_STRUCT_END; } /* autocomplete callback for RNA pointers */ @@ -1369,7 +1362,6 @@ static void ui_rna_ID_autocomplete(bContext *C, char *str, void *arg_but) { uiBut *but= arg_but; AutoComplete *autocpl; - CollectionPropertyIterator iter; PointerRNA ptr; PropertyRNA *prop; char *name; @@ -1381,11 +1373,10 @@ static void ui_rna_ID_autocomplete(bContext *C, char *str, void *arg_but) if(prop==NULL) return; autocpl= autocomplete_begin(str, ui_get_but_string_max_length(but)); - RNA_property_collection_begin(&ptr, prop, &iter); /* loop over items in collection */ - for(; iter.valid; RNA_property_collection_next(&iter)) { - name= RNA_struct_name_get_alloc(&iter.ptr, NULL, 0); + RNA_PROP_BEGIN(&ptr, itemptr, prop) { + name= RNA_struct_name_get_alloc(&itemptr, NULL, 0); /* test item name */ if(name) { @@ -1393,8 +1384,8 @@ static void ui_rna_ID_autocomplete(bContext *C, char *str, void *arg_but) MEM_freeN(name); } } + RNA_PROP_END; - RNA_property_collection_end(&iter); autocomplete_end(autocpl, str); } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 4dcf1590a65..dd87ee15474 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1620,7 +1620,7 @@ void uiTemplateList(uiLayout *layout, PointerRNA *ptr, char *propname, char *act scroll= MIN2(scroll, len-items+1); scroll= MAX2(scroll, 1); - RNA_BEGIN(ptr, itemptr, propname) { + RNA_PROP_BEGIN(ptr, itemptr, prop) { if(i >= scroll && iactivei= i; if(activetype == PROP_POINTER) - item->selected= (activeptr.data == itemptr.data); + item->selected= (activeptr.data == itemptr.data)? i: -1; else if(activetype == PROP_INT) - item->selected= (activei == i); + item->selected= (activei == i)? i: -1; else if(activetype == PROP_STRING) - item->selected= (strcmp(activename, name) == 0); + item->selected= (strcmp(activename, name) == 0)? i: -1; - but= uiDefIconTextButI(block, TOG, 0, RNA_struct_ui_icon(itemptr.type), name, 0,0,UI_UNIT_X*10,UI_UNIT_Y, &item->selected, 0, 0, 0, 0, ""); + but= uiDefIconTextButI(block, ROW, 0, RNA_struct_ui_icon(itemptr.type), name, 0,0,UI_UNIT_X*10,UI_UNIT_Y, &item->selected, 0, i, 0, 0, ""); uiButSetFlag(but, UI_ICON_LEFT|UI_TEXT_LEFT); uiButSetNFunc(but, list_item_cb, item, NULL); @@ -1650,7 +1650,7 @@ void uiTemplateList(uiLayout *layout, PointerRNA *ptr, char *propname, char *act i++; } - RNA_END; + RNA_PROP_END; while(i < scroll+items) { if(i >= scroll) diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 69104c87e64..e67e5b5a871 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -142,69 +142,39 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind return but; } -void uiDefAutoButsRNA(const bContext *C, uiLayout *layout, PointerRNA *ptr) +void uiDefAutoButsRNA(const bContext *C, uiLayout *layout, PointerRNA *ptr, int columns) { - CollectionPropertyIterator iter; - PropertyRNA *iterprop, *prop; - uiLayout *split; + uiLayout *split, *col; char *name; uiItemL(layout, (char*)RNA_struct_ui_name(ptr->type), 0); - iterprop= RNA_struct_iterator_property(ptr->type); - RNA_property_collection_begin(ptr, iterprop, &iter); - - for(; iter.valid; RNA_property_collection_next(&iter)) { - prop= iter.ptr.data; - + RNA_STRUCT_BEGIN(ptr, prop) { if(strcmp(RNA_property_identifier(prop), "rna_type") == 0) continue; - split = uiLayoutSplit(layout, 0.5f); - name= (char*)RNA_property_ui_name(prop); - uiItemL(uiLayoutColumn(split, 0), name, 0); - uiItemFullR(uiLayoutColumn(split, 0), "", 0, ptr, prop, -1, 0, 0, 0, 0); - } + if(columns == 1) { + col= uiLayoutColumn(layout, 1); + uiItemL(col, name, 0); + } + else if(columns == 2) { + split = uiLayoutSplit(layout, 0.5f); - RNA_property_collection_end(&iter); -} + uiItemL(uiLayoutColumn(split, 0), name, 0); + col= uiLayoutColumn(split, 0); + } -/* temp call, single collumn, test for toolbar only */ -void uiDefAutoButsRNA_single(const bContext *C, uiLayout *layout, PointerRNA *ptr) -{ - CollectionPropertyIterator iter; - PropertyRNA *iterprop, *prop; - uiLayout *col; - char *name; - - uiItemL(layout, (char*)RNA_struct_ui_name(ptr->type), 0); - - iterprop= RNA_struct_iterator_property(ptr->type); - RNA_property_collection_begin(ptr, iterprop, &iter); - - for(; iter.valid; RNA_property_collection_next(&iter)) { - prop= iter.ptr.data; - - if(strcmp(RNA_property_identifier(prop), "rna_type") == 0) - continue; - - name= (char*)RNA_property_ui_name(prop); - col= uiLayoutColumn(layout, 1); - uiItemL(col, name, 0); - /* temp hack to show normal button for spin/screw */ if(strcmp(name, "Axis")==0) { - uiDefButR(uiLayoutGetBlock(layout), BUT_NORMAL, 0, name, 0, 0, 100, 100, ptr, "axis", -1, 0, 0, -1, -1, NULL); + uiDefButR(uiLayoutGetBlock(col), BUT_NORMAL, 0, name, 0, 0, 100, 100, ptr, "axis", -1, 0, 0, -1, -1, NULL); } else uiItemFullR(col, "", 0, ptr, prop, -1, 0, 0, 0, 0); } - - RNA_property_collection_end(&iter); + RNA_STRUCT_END; } - /***************************** ID Utilities *******************************/ /* note, C code version, will be replaced with version in interface_templates.c */ diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 6ed8f87d987..bb47d3458fe 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -550,7 +550,24 @@ void file_draw_list(const bContext *C, ARegion *ar) } } -static void file_draw_fsmenu_category(const bContext *C, ARegion *ar, FSMenuCategory category, const char* category_name, short *starty) +static void file_draw_fsmenu_category_name(ARegion *ar, const char *category_name, short *starty) +{ + short sx, sy; + int bmwidth = ar->v2d.cur.xmax - ar->v2d.cur.xmin - 2*TILE_BORDER_X - ICON_DEFAULT_WIDTH - 4; + int fontsize = file_font_pointsize(); + + sx = ar->v2d.cur.xmin + TILE_BORDER_X; + sy = *starty; + + UI_ThemeColor(TH_TEXT_HI); + file_draw_string(sx, sy, category_name, bmwidth, fontsize, FILE_SHORTEN_END); + + sy -= fontsize*2.0f; + + *starty= sy; +} + +static void file_draw_fsmenu_category(const bContext *C, ARegion *ar, FSMenuCategory category, short *starty) { struct FSMenu* fsmenu = fsmenu_get(); char bookmark[FILE_MAX]; @@ -565,11 +582,6 @@ static void file_draw_fsmenu_category(const bContext *C, ARegion *ar, FSMenuCate sx = ar->v2d.cur.xmin + TILE_BORDER_X; sy = *starty; - UI_ThemeColor(TH_TEXT_HI); - file_draw_string(sx, sy, category_name, bmwidth, fontsize, FILE_SHORTEN_END); - - sy -= fontsize*2.0f; - switch(category) { case FS_CATEGORY_SYSTEM: cat_icon = ICON_DISK_DRIVE; break; @@ -616,15 +628,54 @@ static void file_draw_fsmenu_category(const bContext *C, ARegion *ar, FSMenuCate *starty = sy; } +void file_draw_fsmenu_operator(const bContext *C, ARegion *ar, wmOperator *op, short *starty) +{ + uiStyle *style= U.uistyles.first; + uiBlock *block; + uiLayout *layout; + int sy; + + sy= *starty; + + block= uiBeginBlock(C, ar, "file_options", UI_EMBOSS); + layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, TILE_BORDER_X, sy, ar->winx-2*TILE_BORDER_X, 20, style); + + RNA_STRUCT_BEGIN(op->ptr, prop) { + if(strcmp(RNA_property_identifier(prop), "rna_type") == 0) + continue; + if(strcmp(RNA_property_identifier(prop), "filename") == 0) + continue; + + uiItemFullR(layout, NULL, 0, op->ptr, prop, -1, 0, 0, 0, 0); + } + RNA_STRUCT_END; + + uiBlockLayoutResolve(C, block, NULL, &sy); + uiEndBlock(C, block); + uiDrawBlock(C, block); + + *starty= sy; +} + void file_draw_fsmenu(const bContext *C, ARegion *ar) { + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); int linestep = file_font_pointsize()*2.0f; short sy= ar->v2d.cur.ymax-2*TILE_BORDER_Y; - file_draw_fsmenu_category(C, ar, FS_CATEGORY_SYSTEM, "SYSTEM", &sy); + file_draw_fsmenu_category_name(ar, "SYSTEM", &sy); + file_draw_fsmenu_category(C, ar, FS_CATEGORY_SYSTEM, &sy); sy -= linestep; - file_draw_fsmenu_category(C, ar, FS_CATEGORY_BOOKMARKS, "BOOKMARKS", &sy); + file_draw_fsmenu_category_name(ar, "BOOKMARKS", &sy); + file_draw_fsmenu_category(C, ar, FS_CATEGORY_BOOKMARKS, &sy); sy -= linestep; - file_draw_fsmenu_category(C, ar, FS_CATEGORY_RECENT, "RECENT", &sy); - + file_draw_fsmenu_category_name(ar, "RECENT", &sy); + file_draw_fsmenu_category(C, ar, FS_CATEGORY_RECENT, &sy); + + if(sfile->op) { + sy -= linestep; + file_draw_fsmenu_category_name(ar, "OPTIONS", &sy); + file_draw_fsmenu_operator(C, ar, sfile->op, &sy); + } } + diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 537996601b8..8f9bb0d05fe 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -577,34 +577,30 @@ void IMAGE_OT_view_zoom_ratio(wmOperatorType *ot) /**************** load/replace/save callbacks ******************/ -static char *filesel_imagetype_string(Image *ima) -{ - char *strp, *str= MEM_callocN(15*32, "menu for filesel"); - - strp= str; - str += sprintf(str, "Save Image as: %%t|"); - str += sprintf(str, "Targa %%x%d|", R_TARGA); - str += sprintf(str, "Targa Raw %%x%d|", R_RAWTGA); - str += sprintf(str, "PNG %%x%d|", R_PNG); - str += sprintf(str, "BMP %%x%d|", R_BMP); - str += sprintf(str, "Jpeg %%x%d|", R_JPEG90); +/* XXX make dynamic */ +static const EnumPropertyItem image_file_type_items[] = { + {R_TARGA, "TARGA", 0, "Targa", ""}, + {R_RAWTGA, "TARGA RAW", 0, "Targa Raw", ""}, + {R_PNG, "PNG", 0, "PNG", ""}, + {R_BMP, "BMP", 0, "BMP", ""}, + {R_JPEG90, "JPEG", 0, "Jpeg", ""}, #ifdef WITH_OPENJPEG - str += sprintf(str, "Jpeg 2000 %%x%d|", R_JP2); + {R_JP2, "JPEG_2000", 0, "Jpeg 2000", ""}, #endif - str += sprintf(str, "Iris %%x%d|", R_IRIS); - if(G.have_libtiff) - str += sprintf(str, "Tiff %%x%d|", R_TIFF); - str += sprintf(str, "Radiance HDR %%x%d|", R_RADHDR); - str += sprintf(str, "Cineon %%x%d|", R_CINEON); - str += sprintf(str, "DPX %%x%d|", R_DPX); + {R_IRIS, "IRIS", 0, "Iris", ""}, + //if(G.have_libtiff) + {R_TIFF, "TIFF", 0, "Tiff", ""}, + {R_RADHDR, "RADIANCE_HDR", 0, "Radiance HDR", ""}, + {R_CINEON, "CINEON", 0, "Cineon", ""}, + {R_DPX, "DPX", 0, "DPX", ""}, #ifdef WITH_OPENEXR - str += sprintf(str, "OpenEXR %%x%d|", R_OPENEXR); + {R_OPENEXR, "OPENEXR", 0, "OpenEXR", ""}, /* saving sequences of multilayer won't work, they copy buffers */ - if(ima->source==IMA_SRC_SEQUENCE && ima->type==IMA_TYPE_MULTILAYER); - else str += sprintf(str, "MultiLayer %%x%d|", R_MULTILAYER); + /*if(ima->source==IMA_SRC_SEQUENCE && ima->type==IMA_TYPE_MULTILAYER); + else*/ + {R_MULTILAYER, "MULTILAYER", 0, "MultiLayer", ""}, #endif - return strp; -} + {0, NULL, 0, NULL, NULL}}; static void image_filesel(bContext *C, wmOperator *op, const char *path) { @@ -799,7 +795,9 @@ static int save_as_exec(bContext *C, wmOperator *op) if(!ima) return OPERATOR_CANCELLED; + sima->imtypenr= RNA_enum_get(op->ptr, "file_type"); RNA_string_get(op->ptr, "filename", str); + save_image_doit(C, sima, scene, op, str); return OPERATOR_FINISHED; @@ -820,10 +818,6 @@ static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *event) /* always opens fileselect */ if(ibuf) { - char *strp; - - strp= filesel_imagetype_string(ima); // XXX unused still - /* cant save multilayer sequence, ima->rr isn't valid for a specific frame */ if(ima->rr && !(ima->source==IMA_SRC_SEQUENCE && ima->type==IMA_TYPE_MULTILAYER)) sima->imtypenr= R_MULTILAYER; @@ -831,14 +825,14 @@ static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *event) sima->imtypenr= scene->r.imtype; else sima->imtypenr= BKE_ftype_to_imtype(ibuf->ftype); + + RNA_enum_set(op->ptr, "file_type", sima->imtypenr); if(ibuf->name[0]==0) BLI_strncpy(ibuf->name, G.ima, FILE_MAX); // XXX note: we can give default menu enums to operator for this image_filesel(C, op, ibuf->name); - - MEM_freeN(strp); return OPERATOR_RUNNING_MODAL; } @@ -862,6 +856,7 @@ void IMAGE_OT_save_as(wmOperatorType *ot) /* properties */ RNA_def_string_file_path(ot->srna, "filename", "", FILE_MAX, "Filename", "File path to save image to."); + RNA_def_enum(ot->srna, "file_type", image_file_type_items, R_PNG, "File Type", "File type to save image as."); } /******************** save image operator ********************/ diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index ca911876c89..91565235591 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1710,7 +1710,7 @@ static void view3d_panel_operator_redo(const bContext *C, Panel *pa) } RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); - uiDefAutoButsRNA(C, pa->layout, &ptr); + uiDefAutoButsRNA(C, pa->layout, &ptr, 2); } void view3d_buttons_register(ARegionType *art) diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 1e55f2e4a9a..15254ba505e 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -120,8 +120,6 @@ static void redo_cb(bContext *C, void *arg_op, void *arg2) static void view3d_panel_operator_redo(const bContext *C, Panel *pa) { - /* XXX temp */ - extern void uiDefAutoButsRNA_single(const bContext *C, uiLayout *layout, PointerRNA *ptr); wmWindowManager *wm= CTX_wm_manager(C); wmOperator *op; PointerRNA ptr; @@ -147,7 +145,7 @@ static void view3d_panel_operator_redo(const bContext *C, Panel *pa) } RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); - uiDefAutoButsRNA_single(C, pa->layout, &ptr); + uiDefAutoButsRNA(C, pa->layout, &ptr, 1); } void view3d_toolbar_register(ARegionType *art) diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index bab6982abd9..9f7559312ed 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -695,6 +695,28 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name); RNA_property_collection_end(&rna_macro_iter); \ } +#define RNA_PROP_BEGIN(sptr, itemptr, prop) \ + { \ + CollectionPropertyIterator rna_macro_iter; \ + for(RNA_property_collection_begin(sptr, prop, &rna_macro_iter); rna_macro_iter.valid; RNA_property_collection_next(&rna_macro_iter)) { \ + PointerRNA itemptr= rna_macro_iter.ptr; + +#define RNA_PROP_END \ + } \ + RNA_property_collection_end(&rna_macro_iter); \ + } + +#define RNA_STRUCT_BEGIN(sptr, prop) \ + { \ + CollectionPropertyIterator rna_macro_iter; \ + for(RNA_property_collection_begin(sptr, RNA_struct_iterator_property(sptr->type), &rna_macro_iter); rna_macro_iter.valid; RNA_property_collection_next(&rna_macro_iter)) { \ + PropertyRNA *prop= rna_macro_iter.ptr.data; + +#define RNA_STRUCT_END \ + } \ + RNA_property_collection_end(&rna_macro_iter); \ + } + /* check if the idproperty exists, for operators */ int RNA_property_is_set(PointerRNA *ptr, const char *name); diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index b620a315085..85a148be2e2 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -80,7 +80,7 @@ PropertyRNA *RNA_def_string(StructOrFunctionRNA *cont, const char *identifier, c PropertyRNA *RNA_def_string_file_path(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_string_dir_path(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description); -PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont, const char *identifier, EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description); +PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); PropertyRNA *RNA_def_float_vector(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index a2954d43e0e..66127ebc6df 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -426,23 +426,16 @@ PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier) /* Find the property which uses the given nested struct */ PropertyRNA *RNA_struct_find_nested(PointerRNA *ptr, StructRNA *srna) { - CollectionPropertyIterator iter; - PropertyRNA *iterprop, *prop; - int i = 0; + PropertyRNA *prop= NULL; - iterprop= RNA_struct_iterator_property(ptr->type); - RNA_property_collection_begin(ptr, iterprop, &iter); - prop= NULL; - - for(; iter.valid; RNA_property_collection_next(&iter), i++) { + RNA_STRUCT_BEGIN(ptr, iprop) { /* This assumes that there can only be one user of this nested struct */ - if (RNA_property_pointer_type(ptr, iter.ptr.data) == srna) { - prop= iter.ptr.data; + if (RNA_property_pointer_type(ptr, iprop) == srna) { + prop= iprop; break; } } - - RNA_property_collection_end(&iter); + RNA_PROP_END; return prop; } @@ -455,25 +448,21 @@ const struct ListBase *RNA_struct_defined_properties(StructRNA *srna) FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier) { PointerRNA tptr; - CollectionPropertyIterator iter; PropertyRNA *iterprop; FunctionRNA *func; - int i = 0; RNA_pointer_create(NULL, &RNA_Struct, ptr->type, &tptr); iterprop= RNA_struct_find_property(&tptr, "functions"); - RNA_property_collection_begin(&tptr, iterprop, &iter); func= NULL; - for(; iter.valid; RNA_property_collection_next(&iter), i++) { - if(strcmp(identifier, RNA_function_identifier(iter.ptr.data)) == 0) { - func= iter.ptr.data; + RNA_PROP_BEGIN(&tptr, funcptr, iterprop) { + if(strcmp(identifier, RNA_function_identifier(funcptr.data)) == 0) { + func= funcptr.data; break; } } - - RNA_property_collection_end(&iter); + RNA_PROP_END; return func; } @@ -2256,17 +2245,12 @@ char *RNA_pointer_as_string(PointerRNA *ptr) DynStr *dynstr= BLI_dynstr_new(); char *cstring; - PropertyRNA *prop, *iterprop; - CollectionPropertyIterator iter; const char *propname; int first_time = 1; BLI_dynstr_append(dynstr, "{"); - iterprop= RNA_struct_iterator_property(ptr->type); - - for(RNA_property_collection_begin(ptr, iterprop, &iter); iter.valid; RNA_property_collection_next(&iter)) { - prop= iter.ptr.data; + RNA_STRUCT_BEGIN(ptr, prop) { propname = RNA_property_identifier(prop); if(strcmp(propname, "rna_type")==0) @@ -2280,8 +2264,8 @@ char *RNA_pointer_as_string(PointerRNA *ptr) BLI_dynstr_appendf(dynstr, "\"%s\":%s", propname, cstring); MEM_freeN(cstring); } + RNA_STRUCT_END; - RNA_property_collection_end(&iter); BLI_dynstr_append(dynstr, "}"); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 51c1818eed9..bd449acc050 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1946,7 +1946,7 @@ PropertyRNA *RNA_def_string_dir_path(StructOrFunctionRNA *cont_, const char *ide return prop; } -PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, EnumPropertyItem *items, int default_value, +PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description) { ContainerRNA *cont= cont_; diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index 542de6bd9b8..b7e3c86dd91 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -107,15 +107,9 @@ static int PYTHON_OT_generic(int mode, bContext *C, wmOperator *op, wmEvent *eve /* Assign instance attributes from operator properties */ { - PropertyRNA *prop, *iterprop; - CollectionPropertyIterator iter; const char *arg_name; - iterprop= RNA_struct_iterator_property(op->ptr->type); - RNA_property_collection_begin(op->ptr, iterprop, &iter); - - for(; iter.valid; RNA_property_collection_next(&iter)) { - prop= iter.ptr.data; + RNA_STRUCT_BEGIN(op->ptr, prop) { arg_name= RNA_property_identifier(prop); if (strcmp(arg_name, "rna_type")==0) continue; @@ -124,8 +118,7 @@ static int PYTHON_OT_generic(int mode, bContext *C, wmOperator *op, wmEvent *eve PyObject_SetAttrString(py_class_instance, arg_name, item); Py_DECREF(item); } - - RNA_property_collection_end(&iter); + RNA_STRUCT_END; } /* set operator pointer RNA as instance "__operator__" attribute */ diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 1fd60a8ff27..3cef6e14861 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -328,17 +328,9 @@ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, const char *error_prefi const char *arg_name= NULL; PyObject *item; - PropertyRNA *prop, *iterprop; - CollectionPropertyIterator iter; - - iterprop= RNA_struct_iterator_property(ptr->type); - RNA_property_collection_begin(ptr, iterprop, &iter); - totkw = kw ? PyDict_Size(kw):0; - for(; iter.valid; RNA_property_collection_next(&iter)) { - prop= iter.ptr.data; - + RNA_STRUCT_BEGIN(ptr, prop) { arg_name= RNA_property_identifier(prop); if (strcmp(arg_name, "rna_type")==0) continue; @@ -364,8 +356,7 @@ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, const char *error_prefi totkw--; } - - RNA_property_collection_end(&iter); + RNA_STRUCT_END; if (error_val==0 && totkw > 0) { /* some keywords were given that were not used :/ */ PyObject *key, *value; @@ -941,7 +932,6 @@ static PyObject *pyrna_struct_dir(BPy_StructRNA * self) PyObject *pystring; /* for looping over attrs and funcs */ - CollectionPropertyIterator iter; PropertyRNA *iterprop; /* Include this incase this instance is a subtype of a python class @@ -973,10 +963,9 @@ static PyObject *pyrna_struct_dir(BPy_StructRNA * self) char name[256], *nameptr; iterprop= RNA_struct_iterator_property(self->ptr.type); - RNA_property_collection_begin(&self->ptr, iterprop, &iter); - for(; iter.valid; RNA_property_collection_next(&iter)) { - nameptr= RNA_struct_name_get_alloc(&iter.ptr, name, sizeof(name)); + RNA_PROP_BEGIN(&self->ptr, itemptr, iterprop) { + nameptr= RNA_struct_name_get_alloc(&itemptr, name, sizeof(name)); if(nameptr) { pystring = PyUnicode_FromString(nameptr); @@ -987,8 +976,7 @@ static PyObject *pyrna_struct_dir(BPy_StructRNA * self) MEM_freeN(nameptr); } } - RNA_property_collection_end(&iter); - + RNA_PROP_END; } @@ -1001,15 +989,12 @@ static PyObject *pyrna_struct_dir(BPy_StructRNA * self) RNA_pointer_create(NULL, &RNA_Struct, self->ptr.type, &tptr); iterprop= RNA_struct_find_property(&tptr, "functions"); - RNA_property_collection_begin(&tptr, iterprop, &iter); - - for(; iter.valid; RNA_property_collection_next(&iter)) { - pystring = PyUnicode_FromString(RNA_function_identifier(iter.ptr.data)); + RNA_PROP_BEGIN(&tptr, itemptr, iterprop) { + pystring = PyUnicode_FromString(RNA_function_identifier(itemptr.data)); PyList_Append(ret, pystring); Py_DECREF(pystring); } - - RNA_property_collection_end(&iter); + RNA_PROP_END; } if(self->ptr.type == &RNA_Context) { @@ -1122,19 +1107,14 @@ PyObject *pyrna_prop_keys(BPy_PropertyRNA *self) ret = NULL; } else { PyObject *item; - CollectionPropertyIterator iter; - PropertyRNA *nameprop; char name[256], *nameptr; ret = PyList_New(0); - RNA_property_collection_begin(&self->ptr, self->prop, &iter); - for(; iter.valid; RNA_property_collection_next(&iter)) { - nameptr= RNA_struct_name_get_alloc(&iter.ptr, name, sizeof(name)); + RNA_PROP_BEGIN(&self->ptr, itemptr, self->prop) { + nameptr= RNA_struct_name_get_alloc(&itemptr, name, sizeof(name)); if(nameptr) { - nameptr= RNA_property_string_get_alloc(&iter.ptr, nameprop, name, sizeof(name)); - /* add to python list */ item = PyUnicode_FromString( nameptr ); PyList_Append(ret, item); @@ -1145,7 +1125,7 @@ PyObject *pyrna_prop_keys(BPy_PropertyRNA *self) MEM_freeN(nameptr); } } - RNA_property_collection_end(&iter); + RNA_PROP_END; } return ret; @@ -1159,18 +1139,16 @@ PyObject *pyrna_prop_items(BPy_PropertyRNA *self) ret = NULL; } else { PyObject *item; - CollectionPropertyIterator iter; char name[256], *nameptr; int i= 0; ret = PyList_New(0); - RNA_property_collection_begin(&self->ptr, self->prop, &iter); - for(; iter.valid; RNA_property_collection_next(&iter)) { - if(iter.ptr.data) { + RNA_PROP_BEGIN(&self->ptr, itemptr, self->prop) { + if(itemptr.data) { /* add to python list */ item= PyTuple_New(2); - nameptr= RNA_struct_name_get_alloc(&iter.ptr, name, sizeof(name)); + nameptr= RNA_struct_name_get_alloc(&itemptr, name, sizeof(name)); if(nameptr) { PyTuple_SET_ITEM(item, 0, PyUnicode_FromString( nameptr )); if(name != nameptr) @@ -1179,7 +1157,7 @@ PyObject *pyrna_prop_items(BPy_PropertyRNA *self) else { PyTuple_SET_ITEM(item, 0, PyLong_FromSsize_t(i)); /* a bit strange but better then returning an empty list */ } - PyTuple_SET_ITEM(item, 1, pyrna_struct_CreatePyObject(&iter.ptr)); + PyTuple_SET_ITEM(item, 1, pyrna_struct_CreatePyObject(&itemptr)); PyList_Append(ret, item); Py_DECREF(item); @@ -1187,7 +1165,7 @@ PyObject *pyrna_prop_items(BPy_PropertyRNA *self) i++; } } - RNA_property_collection_end(&iter); + RNA_PROP_END; } return ret; @@ -1203,16 +1181,14 @@ PyObject *pyrna_prop_values(BPy_PropertyRNA *self) ret = NULL; } else { PyObject *item; - CollectionPropertyIterator iter; ret = PyList_New(0); - RNA_property_collection_begin(&self->ptr, self->prop, &iter); - for(; iter.valid; RNA_property_collection_next(&iter)) { - item = pyrna_struct_CreatePyObject(&iter.ptr); + RNA_PROP_BEGIN(&self->ptr, itemptr, self->prop) { + item = pyrna_struct_CreatePyObject(&itemptr); PyList_Append(ret, item); Py_DECREF(item); } - RNA_property_collection_end(&iter); + RNA_PROP_END; } return ret; @@ -2023,7 +1999,7 @@ PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) char *id, *name="", *description=""; int def=0; - if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssi:IntProperty", kwlist, &id, &name, &description, &def)) + if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssi:BoolProperty", kwlist, &id, &name, &description, &def)) return NULL; if (PyTuple_Size(args) > 0) { @@ -2037,7 +2013,7 @@ PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) Py_RETURN_NONE; } else { PyObject *ret = PyTuple_New(2); - PyTuple_SET_ITEM(ret, 0, PyCObject_FromVoidPtr((void *)BPy_IntProperty, NULL)); + PyTuple_SET_ITEM(ret, 0, PyCObject_FromVoidPtr((void *)BPy_BoolProperty, NULL)); PyTuple_SET_ITEM(ret, 1, kw); Py_INCREF(kw); return ret; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 76a7b18fa12..410cd11f1bf 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -145,7 +145,6 @@ char *WM_operator_pystring(wmOperator *op) const char *arg_name= NULL; PropertyRNA *prop, *iterprop; - CollectionPropertyIterator iter; /* for building the string */ DynStr *dynstr= BLI_dynstr_new(); @@ -155,10 +154,9 @@ char *WM_operator_pystring(wmOperator *op) BLI_dynstr_appendf(dynstr, "%s(", op->idname); iterprop= RNA_struct_iterator_property(op->ptr->type); - RNA_property_collection_begin(op->ptr, iterprop, &iter); - for(; iter.valid; RNA_property_collection_next(&iter)) { - prop= iter.ptr.data; + RNA_PROP_BEGIN(op->ptr, propptr, iterprop) { + prop= propptr.data; arg_name= RNA_property_identifier(prop); if (strcmp(arg_name, "rna_type")==0) continue; @@ -170,8 +168,7 @@ char *WM_operator_pystring(wmOperator *op) MEM_freeN(buf); first_iter = 0; } - - RNA_property_collection_end(&iter); + RNA_PROP_END; BLI_dynstr_append(dynstr, ")"); @@ -291,7 +288,7 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op) RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr); layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 300, 20, style); - uiDefAutoButsRNA(C, layout, &ptr); + uiDefAutoButsRNA(C, layout, &ptr, 2); uiPopupBoundsBlock(block, 4.0f, 0, 0); uiEndBlock(C, block); @@ -333,7 +330,7 @@ static uiBlock *wm_block_create_menu(bContext *C, ARegion *ar, void *arg_op) uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1); layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 300, 20, style); - uiDefAutoButsRNA(C, layout, op->ptr); + uiDefAutoButsRNA(C, layout, op->ptr, 2); uiPopupBoundsBlock(block, 4.0f, 0, 0); uiEndBlock(C, block); -- cgit v1.2.3 From a50be876d37d4add34d809ebe6546f0097c17761 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 25 Jun 2009 05:05:35 +0000 Subject: NLA SoC: Quick crash fix Pointer for accessing settings of active NLA-strip was not getting set. The code for this was accidentally removed during an earlier commit to clean up the poll callbacks here. --- source/blender/editors/space_nla/nla_buttons.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 0d5cdf80830..a25f741c193 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -207,6 +207,9 @@ static void nla_panel_properties(const bContext *C, Panel *pa) uiLayout *column, *row, *subcol; uiBlock *block; + if (!nla_panel_context(C, NULL, &strip_ptr)) + return; + block= uiLayoutGetBlock(layout); uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); @@ -259,10 +262,6 @@ static void nla_panel_actclip(const bContext *C, Panel *pa) if (!nla_panel_context(C, NULL, &strip_ptr)) return; - // XXX FIXME: move this check into a poll callback - if (RNA_enum_get(&strip_ptr, "type") != NLASTRIP_TYPE_CLIP) - return; - block= uiLayoutGetBlock(layout); uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); -- cgit v1.2.3 From d428ba1de8074e8b0ca2b7c0b060c18ebf7d6b0c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 25 Jun 2009 10:11:37 +0000 Subject: PyAPI RNA/BGE * all mathutils types now have optional callbacks * PyRNA returns mathutils quat and euler types automatically when they have the rotation subtype. * PyRNA, reuse the BPy_StructRNA PyObject rather name making a new one for each function returned. * use more arithb.c functions for Mathutils quaternion type (less inline cruft). * BGE Mathutils integration mostly finished- KX_PyMath now converts to Mathutils types rather then lists. * make all mathutils types share the same header so they can share a number of functions - dealloc, getWrapped, getOwner. --- source/blender/python/generic/Geometry.c | 12 +- source/blender/python/generic/Mathutils.c | 127 ++++----- source/blender/python/generic/Mathutils.h | 41 +-- source/blender/python/generic/euler.c | 182 +++++++------ source/blender/python/generic/euler.h | 14 +- source/blender/python/generic/matrix.c | 114 ++++---- source/blender/python/generic/matrix.h | 21 +- source/blender/python/generic/quat.c | 328 ++++++++++++------------ source/blender/python/generic/quat.h | 16 +- source/blender/python/generic/vector.c | 136 ++++------ source/blender/python/generic/vector.h | 9 +- source/blender/python/intern/bpy_rna.c | 54 ++-- source/gameengine/Expressions/KX_Python.h | 2 + source/gameengine/Expressions/PyObjectPlus.cpp | 7 +- source/gameengine/Expressions/PyObjectPlus.h | 8 +- source/gameengine/Ketsji/KX_GameObject.cpp | 11 +- source/gameengine/Ketsji/KX_ObjectActuator.cpp | 130 +++++++++- source/gameengine/Ketsji/KX_ObjectActuator.h | 11 + source/gameengine/Ketsji/KX_PyMath.cpp | 66 ++--- source/gameengine/Ketsji/KX_PyMath.h | 35 ++- source/gameengine/Ketsji/KX_PythonInitTypes.cpp | 3 +- 21 files changed, 715 insertions(+), 612 deletions(-) (limited to 'source') diff --git a/source/blender/python/generic/Geometry.c b/source/blender/python/generic/Geometry.c index ec76675f652..8a748241570 100644 --- a/source/blender/python/generic/Geometry.c +++ b/source/blender/python/generic/Geometry.c @@ -165,7 +165,7 @@ static PyObject *M_Geometry_PolyFill( PyObject * self, PyObject * polyLineSeq ) polyVec= PySequence_GetItem( polyLine, index ); if(VectorObject_Check(polyVec)) { - if(!Vector_ReadCallback((VectorObject *)polyVec)) + if(!BaseMath_ReadCallback((VectorObject *)polyVec)) ls_error= 1; fp[0] = ((VectorObject *)polyVec)->vec[0]; @@ -238,7 +238,7 @@ static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args ) return NULL; } - if(!Vector_ReadCallback(line_a1) || !Vector_ReadCallback(line_a2) || !Vector_ReadCallback(line_b1) || !Vector_ReadCallback(line_b2)) + if(!BaseMath_ReadCallback(line_a1) || !BaseMath_ReadCallback(line_a2) || !BaseMath_ReadCallback(line_b1) || !BaseMath_ReadCallback(line_b2)) return NULL; a1x= line_a1->vec[0]; @@ -338,7 +338,7 @@ static PyObject *M_Geometry_ClosestPointOnLine( PyObject * self, PyObject * args return NULL; } - if(!Vector_ReadCallback(pt) || !Vector_ReadCallback(line_1) || !Vector_ReadCallback(line_2)) + if(!BaseMath_ReadCallback(pt) || !BaseMath_ReadCallback(line_1) || !BaseMath_ReadCallback(line_2)) return NULL; /* accept 2d verts */ @@ -374,7 +374,7 @@ static PyObject *M_Geometry_PointInTriangle2D( PyObject * self, PyObject * args return NULL; } - if(!Vector_ReadCallback(pt_vec) || !Vector_ReadCallback(tri_p1) || !Vector_ReadCallback(tri_p2) || !Vector_ReadCallback(tri_p3)) + if(!BaseMath_ReadCallback(pt_vec) || !BaseMath_ReadCallback(tri_p1) || !BaseMath_ReadCallback(tri_p2) || !BaseMath_ReadCallback(tri_p3)) return NULL; return PyLong_FromLong(IsectPT2Df(pt_vec->vec, tri_p1->vec, tri_p2->vec, tri_p3->vec)); @@ -395,7 +395,7 @@ static PyObject *M_Geometry_PointInQuad2D( PyObject * self, PyObject * args ) return NULL; } - if(!Vector_ReadCallback(pt_vec) || !Vector_ReadCallback(quad_p1) || !Vector_ReadCallback(quad_p2) || !Vector_ReadCallback(quad_p3) || !Vector_ReadCallback(quad_p4)) + if(!BaseMath_ReadCallback(pt_vec) || !BaseMath_ReadCallback(quad_p1) || !BaseMath_ReadCallback(quad_p2) || !BaseMath_ReadCallback(quad_p3) || !BaseMath_ReadCallback(quad_p4)) return NULL; return PyLong_FromLong(IsectPQ2Df(pt_vec->vec, quad_p1->vec, quad_p2->vec, quad_p3->vec, quad_p4->vec)); @@ -517,7 +517,7 @@ static PyObject *M_Geometry_BezierInterp( PyObject * self, PyObject * args ) return NULL; } - if(!Vector_ReadCallback(vec_k1) || !Vector_ReadCallback(vec_h1) || !Vector_ReadCallback(vec_k2) || !Vector_ReadCallback(vec_h2)) + if(!BaseMath_ReadCallback(vec_k1) || !BaseMath_ReadCallback(vec_h1) || !BaseMath_ReadCallback(vec_k2) || !BaseMath_ReadCallback(vec_h2)) return NULL; dims= MAX4(vec_k1->size, vec_h1->size, vec_h2->size, vec_k2->size); diff --git a/source/blender/python/generic/Mathutils.c b/source/blender/python/generic/Mathutils.c index cd9705236d7..d7330ac46c0 100644 --- a/source/blender/python/generic/Mathutils.c +++ b/source/blender/python/generic/Mathutils.c @@ -155,10 +155,13 @@ PyObject *quat_rotation(PyObject *arg1, PyObject *arg2) if(QuaternionObject_Check(arg1)){ quat = (QuaternionObject*)arg1; + if(!BaseMath_ReadCallback(quat)) + return NULL; + if(VectorObject_Check(arg2)){ vec = (VectorObject*)arg2; - if(!Vector_ReadCallback(vec)) + if(!BaseMath_ReadCallback(vec)) return NULL; rot[0] = quat->quat[0]*quat->quat[0]*vec->vec[0] + 2*quat->quat[2]*quat->quat[0]*vec->vec[2] - @@ -178,11 +181,14 @@ PyObject *quat_rotation(PyObject *arg1, PyObject *arg2) }else if(VectorObject_Check(arg1)){ vec = (VectorObject*)arg1; - if(!Vector_ReadCallback(vec)) + if(!BaseMath_ReadCallback(vec)) return NULL; if(QuaternionObject_Check(arg2)){ quat = (QuaternionObject*)arg2; + if(!BaseMath_ReadCallback(quat)) + return NULL; + rot[0] = quat->quat[0]*quat->quat[0]*vec->vec[0] + 2*quat->quat[2]*quat->quat[0]*vec->vec[2] - 2*quat->quat[3]*quat->quat[0]*vec->vec[1] + quat->quat[1]*quat->quat[1]*vec->vec[0] + 2*quat->quat[2]*quat->quat[1]*vec->vec[1] + 2*quat->quat[3]*quat->quat[1]*vec->vec[2] - @@ -247,7 +253,7 @@ static PyObject *M_Mathutils_AngleBetweenVecs(PyObject * self, PyObject * args) if(vec1->size != vec2->size) goto AttributeError1; //bad sizes - if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2)) + if(!BaseMath_ReadCallback(vec1) || !BaseMath_ReadCallback(vec2)) return NULL; //since size is the same.... @@ -296,7 +302,7 @@ static PyObject *M_Mathutils_MidpointVecs(PyObject * self, PyObject * args) return NULL; } - if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2)) + if(!BaseMath_ReadCallback(vec1) || !BaseMath_ReadCallback(vec2)) return NULL; for(x = 0; x < vec1->size; x++) { @@ -322,7 +328,7 @@ static PyObject *M_Mathutils_ProjectVecs(PyObject * self, PyObject * args) return NULL; } - if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2)) + if(!BaseMath_ReadCallback(vec1) || !BaseMath_ReadCallback(vec2)) return NULL; @@ -389,7 +395,7 @@ static PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args) return NULL; } - if(!Vector_ReadCallback(vec)) + if(!BaseMath_ReadCallback(vec)) return NULL; } @@ -492,7 +498,7 @@ static PyObject *M_Mathutils_TranslationMatrix(PyObject * self, VectorObject * v return NULL; } - if(!Vector_ReadCallback(vec)) + if(!BaseMath_ReadCallback(vec)) return NULL; //create a identity matrix and add translation @@ -528,7 +534,7 @@ static PyObject *M_Mathutils_ScaleMatrix(PyObject * self, PyObject * args) return NULL; } - if(!Vector_ReadCallback(vec)) + if(!BaseMath_ReadCallback(vec)) return NULL; } @@ -607,7 +613,7 @@ static PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * a return NULL; } - if(!Vector_ReadCallback(vec)) + if(!BaseMath_ReadCallback(vec)) return NULL; } @@ -766,6 +772,10 @@ static PyObject *M_Mathutils_DifferenceQuats(PyObject * self, PyObject * args) PyErr_SetString(PyExc_TypeError, "Mathutils.DifferenceQuats(): expected Quaternion types"); return NULL; } + + if(!BaseMath_ReadCallback(quatU) || !BaseMath_ReadCallback(quatV)) + return NULL; + tempQuat[0] = quatU->quat[0]; tempQuat[1] = -quatU->quat[1]; tempQuat[2] = -quatU->quat[2]; @@ -793,6 +803,10 @@ static PyObject *M_Mathutils_Slerp(PyObject * self, PyObject * args) PyErr_SetString(PyExc_TypeError, "Mathutils.Slerp(): expected Quaternion types and float"); return NULL; } + + if(!BaseMath_ReadCallback(quatU) || !BaseMath_ReadCallback(quatV)) + return NULL; + if(param > 1.0f || param < 0.0f) { PyErr_SetString(PyExc_AttributeError, "Mathutils.Slerp(): interpolation factor must be between 0.0 and 1.0"); return NULL; @@ -856,7 +870,7 @@ static PyObject *M_Mathutils_Intersect( PyObject * self, PyObject * args ) return NULL; } - if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2) || !Vector_ReadCallback(vec3) || !Vector_ReadCallback(ray) || !Vector_ReadCallback(ray_off)) + if(!BaseMath_ReadCallback(vec1) || !BaseMath_ReadCallback(vec2) || !BaseMath_ReadCallback(vec3) || !BaseMath_ReadCallback(ray) || !BaseMath_ReadCallback(ray_off)) return NULL; VECCOPY(v1, vec1->vec); @@ -928,7 +942,7 @@ static PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args ) return NULL; } - if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2) || !Vector_ReadCallback(vec3) || !Vector_ReadCallback(vec4)) + if(!BaseMath_ReadCallback(vec1) || !BaseMath_ReadCallback(vec2) || !BaseMath_ReadCallback(vec3) || !BaseMath_ReadCallback(vec4)) return NULL; if( vec1->size == 3 || vec1->size == 2) { @@ -1002,7 +1016,7 @@ static PyObject *M_Mathutils_QuadNormal( PyObject * self, PyObject * args ) return NULL; } - if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2) || !Vector_ReadCallback(vec3) || !Vector_ReadCallback(vec4)) + if(!BaseMath_ReadCallback(vec1) || !BaseMath_ReadCallback(vec2) || !BaseMath_ReadCallback(vec3) || !BaseMath_ReadCallback(vec4)) return NULL; VECCOPY(v1, vec1->vec); @@ -1050,7 +1064,7 @@ static PyObject *M_Mathutils_TriangleNormal( PyObject * self, PyObject * args ) return NULL; } - if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2) || !Vector_ReadCallback(vec3)) + if(!BaseMath_ReadCallback(vec1) || !BaseMath_ReadCallback(vec2) || !BaseMath_ReadCallback(vec3)) return NULL; VECCOPY(v1, vec1->vec); @@ -1085,7 +1099,7 @@ static PyObject *M_Mathutils_TriangleArea( PyObject * self, PyObject * args ) return NULL; } - if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2) || !Vector_ReadCallback(vec3)) + if(!BaseMath_ReadCallback(vec1) || !BaseMath_ReadCallback(vec2) || !BaseMath_ReadCallback(vec3)) return NULL; if (vec1->size == 3) { @@ -1167,75 +1181,66 @@ int Mathutils_RegisterCallback(Mathutils_Callback *cb) } /* use macros to check for NULL */ -int _Vector_ReadCallback(VectorObject *self) +int _BaseMathObject_ReadCallback(BaseMathObject *self) { Mathutils_Callback *cb= mathutils_callbacks[self->cb_type]; - if(cb->get(self->cb_user, self->cb_subtype, self->vec)) { + if(cb->get(self->cb_user, self->cb_subtype, self->data)) return 1; - } - else { - PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); - return 0; - } + + PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name); + return 0; } -int _Vector_WriteCallback(VectorObject *self) +int _BaseMathObject_WriteCallback(BaseMathObject *self) { Mathutils_Callback *cb= mathutils_callbacks[self->cb_type]; - if(cb->set(self->cb_user, self->cb_subtype, self->vec)) { + if(cb->set(self->cb_user, self->cb_subtype, self->data)) return 1; - } - else { - PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); - return 0; - } + + PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name); + return 0; } -int _Vector_ReadIndexCallback(VectorObject *self, int index) +int _BaseMathObject_ReadIndexCallback(BaseMathObject *self, int index) { Mathutils_Callback *cb= mathutils_callbacks[self->cb_type]; - if(cb->get_index(self->cb_user, self->cb_subtype, self->vec, index)) { + if(cb->get_index(self->cb_user, self->cb_subtype, self->data, index)) return 1; - } - else { - PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); - return 0; - } + + PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name); + return 0; } -int _Vector_WriteIndexCallback(VectorObject *self, int index) +int _BaseMathObject_WriteIndexCallback(BaseMathObject *self, int index) { Mathutils_Callback *cb= mathutils_callbacks[self->cb_type]; - if(cb->set_index(self->cb_user, self->cb_subtype, self->vec, index)) { + if(cb->set_index(self->cb_user, self->cb_subtype, self->data, index)) return 1; - } - else { - PyErr_SetString(PyExc_SystemError, "Vector user has become invalid"); - return 0; - } + + PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name); + return 0; } -/* matrix callbacks */ -int _Matrix_ReadCallback(MatrixObject *self) +/* BaseMathObject generic functions for all mathutils types */ +PyObject *BaseMathObject_getOwner( BaseMathObject * self, void *type ) { - Mathutils_Callback *cb= mathutils_callbacks[self->cb_type]; - if(cb->get(self->cb_user, self->cb_subtype, self->contigPtr)) { - return 1; - } - else { - PyErr_SetString(PyExc_SystemError, "Matrix user has become invalid"); - return 0; - } + PyObject *ret= self->cb_user ? self->cb_user : Py_None; + Py_INCREF(ret); + return ret; } -int _Matrix_WriteCallback(MatrixObject *self) +PyObject *BaseMathObject_getWrapped( BaseMathObject *self, void *type ) { - Mathutils_Callback *cb= mathutils_callbacks[self->cb_type]; - if(cb->set(self->cb_user, self->cb_subtype, self->contigPtr)) { - return 1; - } - else { - PyErr_SetString(PyExc_SystemError, "Matrix user has become invalid"); - return 0; - } + PyBool_FromLong((self->wrapped == Py_WRAP) ? 1:0); } + +void BaseMathObject_dealloc(BaseMathObject * self) +{ + /* only free non wrapped */ + if(self->wrapped != Py_WRAP) + PyMem_Free(self->data); + + Py_XDECREF(self->cb_user); + PyObject_DEL(self); +} + diff --git a/source/blender/python/generic/Mathutils.h b/source/blender/python/generic/Mathutils.h index a89b779ecbb..d234ebf1452 100644 --- a/source/blender/python/generic/Mathutils.h +++ b/source/blender/python/generic/Mathutils.h @@ -38,6 +38,24 @@ #include "quat.h" #include "euler.h" +/* Can cast different mathutils types to this, use for generic funcs */ + +typedef struct { + PyObject_VAR_HEAD + float *data; /*array of data (alias), wrapped status depends on wrapped status */ + PyObject *cb_user; /* if this vector references another object, otherwise NULL, *Note* this owns its reference */ + unsigned char cb_type; /* which user funcs do we adhere to, RNA, GameObject, etc */ + unsigned char cb_subtype; /* subtype: location, rotation... to avoid defining many new functions for every attribute of the same type */ + unsigned char wrapped; /* wrapped data type? */ +} BaseMathObject; + +PyObject *BaseMathObject_getOwner( BaseMathObject * self, void * ); +PyObject *BaseMathObject_getWrapped( BaseMathObject *self, void * ); +void BaseMathObject_dealloc(BaseMathObject * self); + + + + PyObject *Mathutils_Init( const char * from ); PyObject *quat_rotation(PyObject *arg1, PyObject *arg2); @@ -75,22 +93,15 @@ struct Mathutils_Callback { int Mathutils_RegisterCallback(Mathutils_Callback *cb); -int _Vector_ReadCallback(VectorObject *self); -int _Vector_WriteCallback(VectorObject *self); -int _Vector_ReadIndexCallback(VectorObject *self, int index); -int _Vector_WriteIndexCallback(VectorObject *self, int index); +int _BaseMathObject_ReadCallback(BaseMathObject *self); +int _BaseMathObject_WriteCallback(BaseMathObject *self); +int _BaseMathObject_ReadIndexCallback(BaseMathObject *self, int index); +int _BaseMathObject_WriteIndexCallback(BaseMathObject *self, int index); /* since this is called so often avoid where possible */ -#define Vector_ReadCallback(_self) (((_self)->cb_user ? _Vector_ReadCallback(_self):1)) -#define Vector_WriteCallback(_self) (((_self)->cb_user ?_Vector_WriteCallback(_self):1)) -#define Vector_ReadIndexCallback(_self, _index) (((_self)->cb_user ? _Vector_ReadIndexCallback(_self, _index):1)) -#define Vector_WriteIndexCallback(_self, _index) (((_self)->cb_user ? _Vector_WriteIndexCallback(_self, _index):1)) - - -int _Matrix_ReadCallback(MatrixObject *self); -int _Matrix_WriteCallback(MatrixObject *self); - -#define Matrix_ReadCallback(_self) (((_self)->cb_user ?_Matrix_ReadCallback(_self):1)) -#define Matrix_WriteCallback(_self) (((_self)->cb_user ?_Matrix_WriteCallback(_self):1)) +#define BaseMath_ReadCallback(_self) (((_self)->cb_user ? _BaseMathObject_ReadCallback((BaseMathObject *)_self):1)) +#define BaseMath_WriteCallback(_self) (((_self)->cb_user ?_BaseMathObject_WriteCallback((BaseMathObject *)_self):1)) +#define BaseMath_ReadIndexCallback(_self, _index) (((_self)->cb_user ? _BaseMathObject_ReadIndexCallback((BaseMathObject *)_self, _index):1)) +#define BaseMath_WriteIndexCallback(_self, _index) (((_self)->cb_user ? _BaseMathObject_WriteIndexCallback((BaseMathObject *)_self, _index):1)) #endif /* EXPP_Mathutils_H */ diff --git a/source/blender/python/generic/euler.c b/source/blender/python/generic/euler.c index e78a5739347..eb9358774e1 100644 --- a/source/blender/python/generic/euler.c +++ b/source/blender/python/generic/euler.c @@ -123,6 +123,9 @@ static PyObject *Euler_ToQuat(EulerObject * self) float eul[3], quat[4]; int x; + if(!BaseMath_ReadCallback(self)) + return NULL; + for(x = 0; x < 3; x++) { eul[x] = self->eul[x] * ((float)Py_PI / 180); } @@ -137,6 +140,9 @@ static PyObject *Euler_ToMatrix(EulerObject * self) float mat[9] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}; int x; + if(!BaseMath_ReadCallback(self)) + return NULL; + for(x = 0; x < 3; x++) { eul[x] = self->eul[x] * ((float)Py_PI / 180); } @@ -152,6 +158,9 @@ static PyObject *Euler_Unique(EulerObject * self) double piO2 = Py_PI / 2.0f; double Opi2 = 1.0f / pi2; + if(!BaseMath_ReadCallback(self)) + return NULL; + //radians heading = self->eul[0] * (float)Py_PI / 180; pitch = self->eul[1] * (float)Py_PI / 180; @@ -191,6 +200,7 @@ static PyObject *Euler_Unique(EulerObject * self) self->eul[1] = (float)(pitch * 180 / (float)Py_PI); self->eul[2] = (float)(bank * 180 / (float)Py_PI); + BaseMath_WriteCallback(self); Py_INCREF(self); return (PyObject *)self; } @@ -202,6 +212,7 @@ static PyObject *Euler_Zero(EulerObject * self) self->eul[1] = 0.0; self->eul[2] = 0.0; + BaseMath_WriteCallback(self); Py_INCREF(self); return (PyObject *)self; } @@ -223,6 +234,9 @@ static PyObject *Euler_Rotate(EulerObject * self, PyObject *args) return NULL; } + if(!BaseMath_ReadCallback(self)) + return NULL; + //covert to radians angle *= ((float)Py_PI / 180); for(x = 0; x < 3; x++) { @@ -234,6 +248,7 @@ static PyObject *Euler_Rotate(EulerObject * self, PyObject *args) self->eul[x] *= (180 / (float)Py_PI); } + BaseMath_WriteCallback(self); Py_INCREF(self); return (PyObject *)self; } @@ -248,6 +263,9 @@ static PyObject *Euler_MakeCompatible(EulerObject * self, EulerObject *value) return NULL; } + if(!BaseMath_ReadCallback(self) || !BaseMath_ReadCallback(value)) + return NULL; + //covert to radians for(x = 0; x < 3; x++) { self->eul[x] = self->eul[x] * ((float)Py_PI / 180); @@ -259,6 +277,7 @@ static PyObject *Euler_MakeCompatible(EulerObject * self, EulerObject *value) self->eul[x] *= (180 / (float)Py_PI); } + BaseMath_WriteCallback(self); Py_INCREF(self); return (PyObject *)self; } @@ -267,19 +286,10 @@ static PyObject *Euler_MakeCompatible(EulerObject * self, EulerObject *value) // return a copy of the euler static PyObject *Euler_copy(EulerObject * self, PyObject *args) { - return newEulerObject(self->eul, Py_NEW); -} - + if(!BaseMath_ReadCallback(self)) + return NULL; -//----------------------------dealloc()(internal) ------------------ -//free the py_object -static void Euler_dealloc(EulerObject * self) -{ - //only free py_data - if(self->data.py_data){ - PyMem_Free(self->data.py_data); - } - PyObject_DEL(self); + return newEulerObject(self->eul, Py_NEW); } //----------------------------print object (internal)-------------- @@ -287,6 +297,10 @@ static void Euler_dealloc(EulerObject * self) static PyObject *Euler_repr(EulerObject * self) { char str[64]; + + if(!BaseMath_ReadCallback(self)) + return NULL; + sprintf(str, "[%.6f, %.6f, %.6f](euler)", self->eul[0], self->eul[1], self->eul[2]); return PyUnicode_FromString(str); } @@ -297,7 +311,18 @@ static PyObject* Euler_richcmpr(PyObject *objectA, PyObject *objectB, int compar EulerObject *eulA = NULL, *eulB = NULL; int result = 0; - if (!EulerObject_Check(objectA) || !EulerObject_Check(objectB)){ + if(EulerObject_Check(objectA)) { + eulA = (EulerObject*)objectA; + if(!BaseMath_ReadCallback(eulA)) + return NULL; + } + if(EulerObject_Check(objectB)) { + eulB = (EulerObject*)objectB; + if(!BaseMath_ReadCallback(eulB)) + return NULL; + } + + if (!eulA || !eulB){ if (comparison_type == Py_NE){ Py_RETURN_TRUE; }else{ @@ -342,13 +367,16 @@ static int Euler_len(EulerObject * self) //sequence accessor (get) static PyObject *Euler_item(EulerObject * self, int i) { - if(i<0) - i= 3-i; + if(i<0) i= 3-i; if(i < 0 || i >= 3) { PyErr_SetString(PyExc_IndexError, "euler[attribute]: array index out of range"); return NULL; } + + if(!BaseMath_ReadIndexCallback(self, i)) + return NULL; + return PyFloat_FromDouble(self->eul[i]); } @@ -363,8 +391,7 @@ static int Euler_ass_item(EulerObject * self, int i, PyObject * value) return -1; } - if(i<0) - i= 3-i; + if(i<0) i= 3-i; if(i < 0 || i >= 3){ PyErr_SetString(PyExc_IndexError, "euler[attribute] = x: array assignment index out of range\n"); @@ -372,6 +399,10 @@ static int Euler_ass_item(EulerObject * self, int i, PyObject * value) } self->eul[i] = f; + + if(!BaseMath_WriteIndexCallback(self, i)) + return -1; + return 0; } //----------------------------object[z:y]------------------------ @@ -381,6 +412,9 @@ static PyObject *Euler_slice(EulerObject * self, int begin, int end) PyObject *list = NULL; int count; + if(!BaseMath_ReadCallback(self)) + return NULL; + CLAMP(begin, 0, 3); if (end<0) end= 4+end; CLAMP(end, 0, 3); @@ -401,7 +435,10 @@ static int Euler_ass_slice(EulerObject * self, int begin, int end, { int i, y, size = 0; float eul[3]; - PyObject *e, *f; + PyObject *e; + + if(!BaseMath_ReadCallback(self)) + return NULL; CLAMP(begin, 0, 3); if (end<0) end= 4+end; @@ -421,21 +458,20 @@ static int Euler_ass_slice(EulerObject * self, int begin, int end, return -1; } - f = PyNumber_Float(e); - if(f == NULL) { // parsed item not a number - Py_DECREF(e); + eul[i] = (float)PyFloat_AsDouble(e); + Py_DECREF(e); + + if(eul[i]==-1 && PyErr_Occurred()) { // parsed item not a number PyErr_SetString(PyExc_TypeError, "euler[begin:end] = []: sequence argument not a number"); return -1; } - - eul[i] = (float)PyFloat_AS_DOUBLE(f); - Py_DECREF(f); - Py_DECREF(e); } //parsed well - now set in vector for(y = 0; y < 3; y++){ self->eul[begin + y] = eul[y]; } + + BaseMath_WriteCallback(self); return 0; } //-----------------PROTCOL DECLARATIONS-------------------------- @@ -450,79 +486,30 @@ static PySequenceMethods Euler_SeqMethods = { }; - /* * vector axis, vector.x/y/z/w */ static PyObject *Euler_getAxis( EulerObject * self, void *type ) { - switch( (long)type ) { - case 'X': /* these are backwards, but that how it works */ - return PyFloat_FromDouble(self->eul[0]); - case 'Y': - return PyFloat_FromDouble(self->eul[1]); - case 'Z': - return PyFloat_FromDouble(self->eul[2]); - } - - PyErr_SetString(PyExc_SystemError, "corrupt euler, cannot get axis"); - return NULL; + return Euler_item(self, GET_INT_FROM_POINTER(type)); } static int Euler_setAxis( EulerObject * self, PyObject * value, void * type ) { - float param= (float)PyFloat_AsDouble( value ); - - if (param==-1 && PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, "expected a number for the vector axis"); - return -1; - } - - switch( (long)type ) { - case 'X': /* these are backwards, but that how it works */ - self->eul[0]= param; - break; - case 'Y': - self->eul[1]= param; - break; - case 'Z': - self->eul[2]= param; - break; - } - - return 0; -} - -static PyObject *Euler_getWrapped( VectorObject * self, void *type ) -{ - if (self->wrapped == Py_WRAP) - Py_RETURN_TRUE; - else - Py_RETURN_FALSE; + return Euler_ass_item(self, GET_INT_FROM_POINTER(type), value); } - /*****************************************************************************/ /* Python attributes get/set structure: */ /*****************************************************************************/ static PyGetSetDef Euler_getseters[] = { - {"x", - (getter)Euler_getAxis, (setter)Euler_setAxis, - "Euler X axis", - (void *)'X'}, - {"y", - (getter)Euler_getAxis, (setter)Euler_setAxis, - "Euler Y axis", - (void *)'Y'}, - {"z", - (getter)Euler_getAxis, (setter)Euler_setAxis, - "Euler Z axis", - (void *)'Z'}, - {"wrapped", - (getter)Euler_getWrapped, (setter)NULL, - "True when this wraps blenders internal data", - NULL}, + {"x", (getter)Euler_getAxis, (setter)Euler_setAxis, "Euler X axis", (void *)0}, + {"y", (getter)Euler_getAxis, (setter)Euler_setAxis, "Euler Y axis", (void *)1}, + {"z", (getter)Euler_getAxis, (setter)Euler_setAxis, "Euler Z axis", (void *)2}, + + {"wrapped", (getter)BaseMathObject_getWrapped, (setter)NULL, "True when this wraps blenders internal data", NULL}, + {"__owner__", (getter)BaseMathObject_getOwner, (setter)NULL, "Read only owner for vectors that depend on another object", NULL}, {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ }; @@ -538,7 +525,7 @@ PyTypeObject euler_Type = { "euler", //tp_name sizeof(EulerObject), //tp_basicsize 0, //tp_itemsize - (destructor)Euler_dealloc, //tp_dealloc + (destructor)BaseMathObject_dealloc, //tp_dealloc 0, //tp_print 0, //tp_getattr 0, //tp_setattr @@ -593,24 +580,22 @@ PyObject *newEulerObject(float *eul, int type) int x; self = PyObject_NEW(EulerObject, &euler_Type); - self->data.blend_data = NULL; - self->data.py_data = NULL; + + /* init callbacks as NULL */ + self->cb_user= NULL; + self->cb_type= self->cb_subtype= 0; if(type == Py_WRAP){ - self->data.blend_data = eul; - self->eul = self->data.blend_data; + self->eul = eul; self->wrapped = Py_WRAP; }else if (type == Py_NEW){ - self->data.py_data = PyMem_Malloc(3 * sizeof(float)); - self->eul = self->data.py_data; + self->eul = PyMem_Malloc(3 * sizeof(float)); if(!eul) { //new empty for(x = 0; x < 3; x++) { self->eul[x] = 0.0f; } }else{ - for(x = 0; x < 3; x++){ - self->eul[x] = eul[x]; - } + VECCOPY(self->eul, eul); } self->wrapped = Py_NEW; }else{ //bad type @@ -618,3 +603,16 @@ PyObject *newEulerObject(float *eul, int type) } return (PyObject *)self; } + +PyObject *newEulerObject_cb(PyObject *cb_user, int cb_type, int cb_subtype) +{ + EulerObject *self= (EulerObject *)newEulerObject(NULL, Py_NEW); + if(self) { + Py_INCREF(cb_user); + self->cb_user= cb_user; + self->cb_type= (unsigned char)cb_type; + self->cb_subtype= (unsigned char)cb_subtype; + } + + return self; +} diff --git a/source/blender/python/generic/euler.h b/source/blender/python/generic/euler.h index 3be629351cb..0bff6de6964 100644 --- a/source/blender/python/generic/euler.h +++ b/source/blender/python/generic/euler.h @@ -40,12 +40,13 @@ extern PyTypeObject euler_Type; typedef struct { PyObject_VAR_HEAD - struct{ - float *py_data; //python managed - float *blend_data; //blender managed - }data; - float *eul; //1D array of data (alias) - int wrapped; //is wrapped data? + float *eul; /*1D array of data */ + PyObject *cb_user; /* if this vector references another object, otherwise NULL, *Note* this owns its reference */ + unsigned char cb_type; /* which user funcs do we adhere to, RNA, GameObject, etc */ + unsigned char cb_subtype; /* subtype: location, rotation... to avoid defining many new functions for every attribute of the same type */ + unsigned char wrapped; /* wrapped data type? */ + /* end BaseMathObject */ + } EulerObject; /*struct data contains a pointer to the actual data that the @@ -55,5 +56,6 @@ blender (stored in blend_data). This is an either/or struct not both*/ //prototypes PyObject *newEulerObject( float *eul, int type ); +PyObject *newEulerObject_cb(PyObject *cb_user, int cb_type, int cb_subtype); #endif /* EXPP_euler_h */ diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c index db5b4ab08bf..ef4f7280cdc 100644 --- a/source/blender/python/generic/matrix.c +++ b/source/blender/python/generic/matrix.c @@ -39,13 +39,13 @@ int mathutils_matrix_vector_cb_index= -1; static int mathutils_matrix_vector_check(MatrixObject *self) { - return Matrix_ReadCallback(self); + return BaseMath_ReadCallback(self); } static int mathutils_matrix_vector_get(MatrixObject *self, int subtype, float *vec_from) { int i; - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return 0; for(i=0; icolSize; i++) @@ -57,19 +57,19 @@ static int mathutils_matrix_vector_get(MatrixObject *self, int subtype, float *v static int mathutils_matrix_vector_set(MatrixObject *self, int subtype, float *vec_to) { int i; - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return 0; for(i=0; icolSize; i++) self->matrix[subtype][i]= vec_to[i]; - Matrix_WriteCallback(self); + BaseMath_WriteCallback(self); return 1; } static int mathutils_matrix_vector_get_index(MatrixObject *self, int subtype, float *vec_from, int index) { - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return 0; vec_from[index]= self->matrix[subtype][index]; @@ -78,12 +78,12 @@ static int mathutils_matrix_vector_get_index(MatrixObject *self, int subtype, fl static int mathutils_matrix_vector_set_index(MatrixObject *self, int subtype, float *vec_to, int index) { - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return 0; self->matrix[subtype][index]= vec_to[index]; - Matrix_WriteCallback(self); + BaseMath_WriteCallback(self); return 1; } @@ -164,7 +164,7 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) argObject = PyTuple_GET_ITEM(args, 0); if(MatrixObject_Check(argObject)){ mat = (MatrixObject*)argObject; - if(!Matrix_ReadCallback(mat)) + if(!BaseMath_ReadCallback(mat)) return NULL; argSize = mat->rowSize; //rows @@ -225,7 +225,7 @@ static PyObject *Matrix_toQuat(MatrixObject * self) { float quat[4]; - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; /*must be 3-4 cols, 3-4 rows, square matrix*/ @@ -248,13 +248,16 @@ PyObject *Matrix_toEuler(MatrixObject * self, PyObject *args) EulerObject *eul_compat = NULL; int x; - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; if(!PyArg_ParseTuple(args, "|O!:toEuler", &euler_Type, &eul_compat)) return NULL; if(eul_compat) { + if(!BaseMath_ReadCallback(eul_compat)) + return NULL; + for(x = 0; x < 3; x++) { eul_compatf[x] = eul_compat->eul[x] * ((float)Py_PI / 180); } @@ -343,7 +346,7 @@ PyObject *Matrix_TranslationPart(MatrixObject * self) { float vec[4]; - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; if(self->colSize < 3 || self->rowSize < 4){ @@ -363,7 +366,7 @@ PyObject *Matrix_RotationPart(MatrixObject * self) float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; if(self->colSize < 3 || self->rowSize < 3){ @@ -389,7 +392,7 @@ PyObject *Matrix_scalePart(MatrixObject * self) float scale[3], rot[3]; float mat[3][3], imat[3][3], tmat[3][3]; - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; /*must be 3-4 cols, 3-4 rows, square matrix*/ @@ -422,7 +425,7 @@ PyObject *Matrix_Invert(MatrixObject * self) float mat[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}; - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; if(self->rowSize != self->colSize){ @@ -465,7 +468,7 @@ PyObject *Matrix_Invert(MatrixObject * self) return NULL; } - Matrix_WriteCallback(self); + BaseMath_WriteCallback(self); Py_INCREF(self); return (PyObject *)self; } @@ -476,7 +479,7 @@ PyObject *Matrix_Determinant(MatrixObject * self) { float det = 0.0f; - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; if(self->rowSize != self->colSize){ @@ -504,7 +507,7 @@ PyObject *Matrix_Transpose(MatrixObject * self) { float t = 0.0f; - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; if(self->rowSize != self->colSize){ @@ -522,7 +525,7 @@ PyObject *Matrix_Transpose(MatrixObject * self) Mat4Transp((float (*)[4])*self->matrix); } - Matrix_WriteCallback(self); + BaseMath_WriteCallback(self); Py_INCREF(self); return (PyObject *)self; } @@ -539,7 +542,7 @@ PyObject *Matrix_Zero(MatrixObject * self) } } - if(!Matrix_WriteCallback(self)) + if(!BaseMath_WriteCallback(self)) return NULL; Py_INCREF(self); @@ -548,7 +551,7 @@ PyObject *Matrix_Zero(MatrixObject * self) /*---------------------------Matrix.identity(() ------------------*/ PyObject *Matrix_Identity(MatrixObject * self) { - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; if(self->rowSize != self->colSize){ @@ -567,7 +570,7 @@ PyObject *Matrix_Identity(MatrixObject * self) Mat4One((float (*)[4]) *self->matrix); } - if(!Matrix_WriteCallback(self)) + if(!BaseMath_WriteCallback(self)) return NULL; Py_INCREF(self); @@ -577,25 +580,12 @@ PyObject *Matrix_Identity(MatrixObject * self) /*---------------------------Matrix.inverted() ------------------*/ PyObject *Matrix_copy(MatrixObject * self) { - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; return (PyObject*)(MatrixObject*)newMatrixObject((float (*))*self->matrix, self->rowSize, self->colSize, Py_NEW); } -/*----------------------------dealloc()(internal) ----------------*/ -/*free the py_object*/ -static void Matrix_dealloc(MatrixObject * self) -{ - PyMem_Free(self->matrix); - /*only free py_data*/ - if(self->wrapped==Py_WRAP) - PyMem_Free(self->contigPtr); - - Py_XDECREF(self->cb_user); - PyObject_DEL(self); -} - /*----------------------------print object (internal)-------------*/ /*print the object to screen*/ static PyObject *Matrix_repr(MatrixObject * self) @@ -603,7 +593,7 @@ static PyObject *Matrix_repr(MatrixObject * self) int x, y; char buffer[48], str[1024]; - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; BLI_strncpy(str,"",1024); @@ -642,7 +632,7 @@ static PyObject* Matrix_richcmpr(PyObject *objectA, PyObject *objectB, int compa matA = (MatrixObject*)objectA; matB = (MatrixObject*)objectB; - if(!Matrix_ReadCallback(matA) || !Matrix_ReadCallback(matB)) + if(!BaseMath_ReadCallback(matA) || !BaseMath_ReadCallback(matB)) return NULL; if (matA->colSize != matB->colSize || matA->rowSize != matB->rowSize){ @@ -692,7 +682,7 @@ static int Matrix_len(MatrixObject * self) the wrapped vector gives direct access to the matrix data*/ static PyObject *Matrix_item(MatrixObject * self, int i) { - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; if(i < 0 || i >= self->rowSize) { @@ -709,7 +699,7 @@ static int Matrix_ass_item(MatrixObject * self, int i, PyObject * ob) float vec[4]; PyObject *m, *f; - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return -1; if(i >= self->rowSize || i < 0){ @@ -746,7 +736,7 @@ static int Matrix_ass_item(MatrixObject * self, int i, PyObject * ob) self->matrix[i][y] = vec[y]; } - Matrix_WriteCallback(self); + BaseMath_WriteCallback(self); return 0; }else{ PyErr_SetString(PyExc_TypeError, "matrix[attribute] = x: expects a sequence of column size\n"); @@ -761,7 +751,7 @@ static PyObject *Matrix_slice(MatrixObject * self, int begin, int end) PyObject *list = NULL; int count; - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; CLAMP(begin, 0, self->rowSize); @@ -787,7 +777,7 @@ static int Matrix_ass_slice(MatrixObject * self, int begin, int end, PyObject *subseq; PyObject *m; - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return -1; CLAMP(begin, 0, self->rowSize); @@ -848,7 +838,7 @@ static int Matrix_ass_slice(MatrixObject * self, int begin, int end, self->matrix[begin + (int)floor(x / self->colSize)][x % self->colSize] = mat[x]; } - Matrix_WriteCallback(self); + BaseMath_WriteCallback(self); return 0; }else{ PyErr_SetString(PyExc_TypeError, "matrix[begin:end] = []: illegal argument type for built-in operation\n"); @@ -872,7 +862,7 @@ static PyObject *Matrix_add(PyObject * m1, PyObject * m2) return NULL; } - if(!Matrix_ReadCallback(mat1) || !Matrix_ReadCallback(mat2)) + if(!BaseMath_ReadCallback(mat1) || !BaseMath_ReadCallback(mat2)) return NULL; if(mat1->rowSize != mat2->rowSize || mat1->colSize != mat2->colSize){ @@ -905,7 +895,7 @@ static PyObject *Matrix_sub(PyObject * m1, PyObject * m2) return NULL; } - if(!Matrix_ReadCallback(mat1) || !Matrix_ReadCallback(mat2)) + if(!BaseMath_ReadCallback(mat1) || !BaseMath_ReadCallback(mat2)) return NULL; if(mat1->rowSize != mat2->rowSize || mat1->colSize != mat2->colSize){ @@ -934,12 +924,12 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) if(MatrixObject_Check(m1)) { mat1 = (MatrixObject*)m1; - if(!Matrix_ReadCallback(mat1)) + if(!BaseMath_ReadCallback(mat1)) return NULL; } if(MatrixObject_Check(m2)) { mat2 = (MatrixObject*)m2; - if(!Matrix_ReadCallback(mat2)) + if(!BaseMath_ReadCallback(mat2)) return NULL; } @@ -1000,7 +990,7 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) } static PyObject* Matrix_inv(MatrixObject *self) { - if(!Matrix_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; return Matrix_Invert(self); @@ -1052,33 +1042,15 @@ static PyObject *Matrix_getColSize( MatrixObject * self, void *type ) return PyLong_FromLong((long) self->colSize); } -static PyObject *Matrix_getOwner( MatrixObject * self, void *type ) -{ - if(self->cb_user==NULL) { - Py_RETURN_NONE; - } - else { - Py_INCREF(self->cb_user); - return self->cb_user; - } -} - -static PyObject *Matrix_getWrapped( MatrixObject * self, void *type ) -{ - if (self->wrapped == Py_WRAP) - Py_RETURN_TRUE; - else - Py_RETURN_FALSE; -} - /*****************************************************************************/ /* Python attributes get/set structure: */ /*****************************************************************************/ static PyGetSetDef Matrix_getseters[] = { {"rowSize", (getter)Matrix_getRowSize, (setter)NULL, "", NULL}, {"colSize", (getter)Matrix_getColSize, (setter)NULL, "", NULL}, - {"wrapped", (getter)Matrix_getWrapped, (setter)NULL, "", NULL}, - {"__owner__",(getter)Matrix_getOwner, (setter)NULL, "Read only owner for vectors that depend on another object", NULL}, + {"wrapped", (getter)BaseMathObject_getWrapped, (setter)NULL, "", NULL}, + {"__owner__",(getter)BaseMathObject_getOwner, (setter)NULL, "", + NULL}, {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ }; @@ -1094,7 +1066,7 @@ PyTypeObject matrix_Type = { "matrix", /*tp_name*/ sizeof(MatrixObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ - (destructor)Matrix_dealloc, /*tp_dealloc*/ + (destructor)BaseMathObject_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -1245,7 +1217,7 @@ static PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* double dot = 0.0f; int x, y, z = 0; - if(!Matrix_ReadCallback(mat) || !Vector_ReadCallback(vec)) + if(!BaseMath_ReadCallback(mat) || !BaseMath_ReadCallback(vec)) return NULL; if(mat->rowSize != vec->size){ diff --git a/source/blender/python/generic/matrix.h b/source/blender/python/generic/matrix.h index cc3928f1632..4b073668969 100644 --- a/source/blender/python/generic/matrix.h +++ b/source/blender/python/generic/matrix.h @@ -37,16 +37,19 @@ extern PyTypeObject matrix_Type; #define MatrixObject_Check(v) ((v)->ob_type == &matrix_Type) typedef float **ptRow; -typedef struct _Matrix { - PyObject_VAR_HEAD - ptRow matrix; /*ptr to the contigPtr (accessor)*/ - float* contigPtr; /*1D array of data (alias)*/ - PyObject* cb_user; /* if this vector references another object, otherwise NULL, *Note* this owns its reference */ - unsigned char rowSize; - unsigned char colSize; - unsigned char wrapped; /*is wrapped data?*/ +typedef struct _Matrix { /* keep aligned with BaseMathObject in Mathutils.h */ + PyObject_VAR_HEAD + float *contigPtr; /*1D array of data (alias)*/ + PyObject *cb_user; /* if this vector references another object, otherwise NULL, *Note* this owns its reference */ unsigned char cb_type; /* which user funcs do we adhere to, RNA, GameObject, etc */ - unsigned int cb_subtype; /* subtype: location, rotation... to avoid defining many new functions for every attribute of the same type */ + unsigned char cb_subtype; /* subtype: location, rotation... to avoid defining many new functions for every attribute of the same type */ + unsigned char wrapped; /*is wrapped data?*/ + /* end BaseMathObject */ + + unsigned char rowSize; + unsigned int colSize; + ptRow matrix; /*ptr to the contigPtr (accessor)*/ + } MatrixObject; /*struct data contains a pointer to the actual data that the diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c index 8a3ded80455..b1e9f4a1d31 100644 --- a/source/blender/python/generic/quat.c +++ b/source/blender/python/generic/quat.c @@ -78,7 +78,7 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw PyObject *listObject = NULL, *n, *q; int size, i; float quat[4], scalar; - double norm = 0.0f, angle = 0.0f; + double angle = 0.0f; size = PyTuple_GET_SIZE(args); if (size == 1 || size == 2) { //seq? @@ -152,28 +152,19 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw } scalar = PyFloat_AsDouble(q); + Py_DECREF(q); + if (scalar==-1 && PyErr_Occurred()) { - Py_DECREF(q); PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); return NULL; } - quat[i] = scalar; - Py_DECREF(q); - } - if(size == 3){ //calculate the quat based on axis/angle - norm = sqrt(quat[0] * quat[0] + quat[1] * quat[1] + quat[2] * quat[2]); - quat[0] /= (float)norm; - quat[1] /= (float)norm; - quat[2] /= (float)norm; - - angle = angle * (Py_PI / 180); - quat[3] =(float) (sin(angle/ 2.0f)) * quat[2]; - quat[2] =(float) (sin(angle/ 2.0f)) * quat[1]; - quat[1] =(float) (sin(angle/ 2.0f)) * quat[0]; - quat[0] =(float) (cos(angle/ 2.0f)); } + if(size == 3) //calculate the quat based on axis/angle + AxisAngleToQuat(quat, quat, angle * (Py_PI / 180)); // TODO - 2.5 use radians, note using quat for src and target is ok here + + return newQuaternionObject(quat, Py_NEW); } @@ -189,9 +180,15 @@ static PyObject *Quaternion_ToEuler(QuaternionObject * self, PyObject *args) if(!PyArg_ParseTuple(args, "|O!:toEuler", &euler_Type, &eul_compat)) return NULL; + if(!BaseMath_ReadCallback(self)) + return NULL; + if(eul_compat) { float mat[3][3], eul_compatf[3]; + if(!BaseMath_ReadCallback(eul_compat)) + return NULL; + for(x = 0; x < 3; x++) { eul_compatf[x] = eul_compat->eul[x] * ((float)Py_PI / 180); } @@ -214,8 +211,11 @@ static PyObject *Quaternion_ToEuler(QuaternionObject * self, PyObject *args) static PyObject *Quaternion_ToMatrix(QuaternionObject * self) { float mat[9] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}; - QuatToMat3(self->quat, (float (*)[3]) mat); + if(!BaseMath_ReadCallback(self)) + return NULL; + + QuatToMat3(self->quat, (float (*)[3]) mat); return newMatrixObject(mat, 3, 3, Py_NEW); } @@ -230,6 +230,9 @@ static PyObject *Quaternion_Cross(QuaternionObject * self, QuaternionObject * va return NULL; } + if(!BaseMath_ReadCallback(self) || !BaseMath_ReadCallback(value)) + return NULL; + QuatMul(quat, self->quat, value->quat); return newQuaternionObject(quat, Py_NEW); } @@ -238,25 +241,27 @@ static PyObject *Quaternion_Cross(QuaternionObject * self, QuaternionObject * va //return the dot quat static PyObject *Quaternion_Dot(QuaternionObject * self, QuaternionObject * value) { - int x; - double dot = 0.0; - if (!QuaternionObject_Check(value)) { PyErr_SetString( PyExc_TypeError, "quat.dot(value): expected a quaternion argument" ); return NULL; } - - for(x = 0; x < 4; x++) { - dot += self->quat[x] * value->quat[x]; - } - return PyFloat_FromDouble(dot); + + if(!BaseMath_ReadCallback(self) || !BaseMath_ReadCallback(value)) + return NULL; + + return PyFloat_FromDouble(QuatDot(self->quat, value->quat)); } //----------------------------Quaternion.normalize()---------------- //normalize the axis of rotation of [theta,vector] static PyObject *Quaternion_Normalize(QuaternionObject * self) { + if(!BaseMath_ReadCallback(self)) + return NULL; + NormalQuat(self->quat); + + BaseMath_WriteCallback(self); Py_INCREF(self); return (PyObject*)self; } @@ -264,20 +269,12 @@ static PyObject *Quaternion_Normalize(QuaternionObject * self) //invert the quat static PyObject *Quaternion_Inverse(QuaternionObject * self) { - double mag = 0.0f; - int x; + if(!BaseMath_ReadCallback(self)) + return NULL; - for(x = 1; x < 4; x++) { - self->quat[x] = -self->quat[x]; - } - for(x = 0; x < 4; x++) { - mag += (self->quat[x] * self->quat[x]); - } - mag = sqrt(mag); - for(x = 0; x < 4; x++) { - self->quat[x] /= (float)(mag * mag); - } + QuatInv(self->quat); + BaseMath_WriteCallback(self); Py_INCREF(self); return (PyObject*)self; } @@ -285,11 +282,12 @@ static PyObject *Quaternion_Inverse(QuaternionObject * self) //generate the identity quaternion static PyObject *Quaternion_Identity(QuaternionObject * self) { - self->quat[0] = 1.0; - self->quat[1] = 0.0; - self->quat[2] = 0.0; - self->quat[3] = 0.0; + if(!BaseMath_ReadCallback(self)) + return NULL; + + QuatOne(self->quat); + BaseMath_WriteCallback(self); Py_INCREF(self); return (PyObject*)self; } @@ -297,10 +295,12 @@ static PyObject *Quaternion_Identity(QuaternionObject * self) //negate the quat static PyObject *Quaternion_Negate(QuaternionObject * self) { - int x; - for(x = 0; x < 4; x++) { - self->quat[x] = -self->quat[x]; - } + if(!BaseMath_ReadCallback(self)) + return NULL; + + QuatMulf(self->quat, -1.0f); + + BaseMath_WriteCallback(self); Py_INCREF(self); return (PyObject*)self; } @@ -308,10 +308,12 @@ static PyObject *Quaternion_Negate(QuaternionObject * self) //negate the vector part static PyObject *Quaternion_Conjugate(QuaternionObject * self) { - int x; - for(x = 1; x < 4; x++) { - self->quat[x] = -self->quat[x]; - } + if(!BaseMath_ReadCallback(self)) + return NULL; + + QuatConj(self->quat); + + BaseMath_WriteCallback(self); Py_INCREF(self); return (PyObject*)self; } @@ -319,18 +321,10 @@ static PyObject *Quaternion_Conjugate(QuaternionObject * self) //return a copy of the quat static PyObject *Quaternion_copy(QuaternionObject * self) { - return newQuaternionObject(self->quat, Py_NEW); -} + if(!BaseMath_ReadCallback(self)) + return NULL; -//----------------------------dealloc()(internal) ------------------ -//free the py_object -static void Quaternion_dealloc(QuaternionObject * self) -{ - //only free py_data - if(self->data.py_data){ - PyMem_Free(self->data.py_data); - } - PyObject_DEL(self); + return newQuaternionObject(self->quat, Py_NEW); } //----------------------------print object (internal)-------------- @@ -338,6 +332,10 @@ static void Quaternion_dealloc(QuaternionObject * self) static PyObject *Quaternion_repr(QuaternionObject * self) { char str[64]; + + if(!BaseMath_ReadCallback(self)) + return NULL; + sprintf(str, "[%.6f, %.6f, %.6f, %.6f](quaternion)", self->quat[0], self->quat[1], self->quat[2], self->quat[3]); return PyUnicode_FromString(str); } @@ -348,15 +346,24 @@ static PyObject* Quaternion_richcmpr(PyObject *objectA, PyObject *objectB, int c QuaternionObject *quatA = NULL, *quatB = NULL; int result = 0; - if (!QuaternionObject_Check(objectA) || !QuaternionObject_Check(objectB)){ + if(QuaternionObject_Check(objectA)) { + quatA = (QuaternionObject*)objectA; + if(!BaseMath_ReadCallback(quatA)) + return NULL; + } + if(QuaternionObject_Check(objectB)) { + quatB = (QuaternionObject*)objectB; + if(!BaseMath_ReadCallback(quatB)) + return NULL; + } + + if (!quatA || !quatB){ if (comparison_type == Py_NE){ Py_RETURN_TRUE; }else{ Py_RETURN_FALSE; } } - quatA = (QuaternionObject*)objectA; - quatB = (QuaternionObject*)objectB; switch (comparison_type){ case Py_EQ: @@ -393,10 +400,16 @@ static int Quaternion_len(QuaternionObject * self) //sequence accessor (get) static PyObject *Quaternion_item(QuaternionObject * self, int i) { + if(i<0) i= 4-i; + if(i < 0 || i >= 4) { PyErr_SetString(PyExc_IndexError, "quaternion[attribute]: array index out of range\n"); return NULL; } + + if(!BaseMath_ReadIndexCallback(self, i)) + return NULL; + return PyFloat_FromDouble(self->quat[i]); } @@ -404,21 +417,23 @@ static PyObject *Quaternion_item(QuaternionObject * self, int i) //sequence accessor (set) static int Quaternion_ass_item(QuaternionObject * self, int i, PyObject * ob) { - PyObject *f = NULL; - - f = PyNumber_Float(ob); - if(f == NULL) { // parsed item not a number - PyErr_SetString(PyExc_TypeError, "quaternion[attribute] = x: argument not a number\n"); + float scalar= (float)PyFloat_AsDouble(ob); + if(scalar==-1.0f && PyErr_Occurred()) { /* parsed item not a number */ + PyErr_SetString(PyExc_TypeError, "quaternion[index] = x: index argument not a number\n"); return -1; } + if(i<0) i= 4-i; + if(i < 0 || i >= 4){ - Py_DECREF(f); PyErr_SetString(PyExc_IndexError, "quaternion[attribute] = x: array assignment index out of range\n"); return -1; } - self->quat[i] = (float)PyFloat_AS_DOUBLE(f); - Py_DECREF(f); + self->quat[i] = scalar; + + if(!BaseMath_WriteIndexCallback(self, i)) + return -1; + return 0; } //----------------------------object[z:y]------------------------ @@ -428,6 +443,9 @@ static PyObject *Quaternion_slice(QuaternionObject * self, int begin, int end) PyObject *list = NULL; int count; + if(!BaseMath_ReadCallback(self)) + return NULL; + CLAMP(begin, 0, 4); if (end<0) end= 5+end; CLAMP(end, 0, 4); @@ -443,12 +461,14 @@ static PyObject *Quaternion_slice(QuaternionObject * self, int begin, int end) } //----------------------------object[z:y]------------------------ //sequence slice (set) -static int Quaternion_ass_slice(QuaternionObject * self, int begin, int end, - PyObject * seq) +static int Quaternion_ass_slice(QuaternionObject * self, int begin, int end, PyObject * seq) { int i, y, size = 0; float quat[4]; - PyObject *q, *f; + PyObject *q; + + if(!BaseMath_ReadCallback(self)) + return -1; CLAMP(begin, 0, 4); if (end<0) end= 5+end; @@ -468,21 +488,19 @@ static int Quaternion_ass_slice(QuaternionObject * self, int begin, int end, return -1; } - f = PyNumber_Float(q); - if(f == NULL) { // parsed item not a number - Py_DECREF(q); + quat[i]= (float)PyFloat_AsDouble(q); + Py_DECREF(q); + + if(quat[i]==-1.0f && PyErr_Occurred()) { /* parsed item not a number */ PyErr_SetString(PyExc_TypeError, "quaternion[begin:end] = []: sequence argument not a number\n"); return -1; } - - quat[i] = (float)PyFloat_AS_DOUBLE(f); - Py_DECREF(f); - Py_DECREF(q); } //parsed well - now set in vector - for(y = 0; y < size; y++){ + for(y = 0; y < size; y++) self->quat[begin + y] = quat[y]; - } + + BaseMath_WriteCallback(self); return 0; } //------------------------NUMERIC PROTOCOLS---------------------- @@ -490,7 +508,6 @@ static int Quaternion_ass_slice(QuaternionObject * self, int begin, int end, //addition static PyObject *Quaternion_add(PyObject * q1, PyObject * q2) { - int x; float quat[4]; QuaternionObject *quat1 = NULL, *quat2 = NULL; @@ -498,14 +515,13 @@ static PyObject *Quaternion_add(PyObject * q1, PyObject * q2) PyErr_SetString(PyExc_AttributeError, "Quaternion addition: arguments not valid for this operation....\n"); return NULL; } - quat1 = (QuaternionObject*)q1; quat2 = (QuaternionObject*)q2; - for(x = 0; x < 4; x++) { - quat[x] = quat1->quat[x] + quat2->quat[x]; - } + if(!BaseMath_ReadCallback(quat1) || !BaseMath_ReadCallback(quat2)) + return NULL; + QuatAdd(quat, quat1->quat, quat2->quat, 1.0f); return newQuaternionObject(quat, Py_NEW); } //------------------------obj - obj------------------------------ @@ -524,6 +540,9 @@ static PyObject *Quaternion_sub(PyObject * q1, PyObject * q2) quat1 = (QuaternionObject*)q1; quat2 = (QuaternionObject*)q2; + if(!BaseMath_ReadCallback(quat1) || !BaseMath_ReadCallback(quat2)) + return NULL; + for(x = 0; x < 4; x++) { quat[x] = quat1->quat[x] - quat2->quat[x]; } @@ -534,29 +553,31 @@ static PyObject *Quaternion_sub(PyObject * q1, PyObject * q2) //mulplication static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2) { - int x; float quat[4], scalar; - double dot = 0.0f; QuaternionObject *quat1 = NULL, *quat2 = NULL; VectorObject *vec = NULL; - quat1 = (QuaternionObject*)q1; - quat2 = (QuaternionObject*)q2; + if(QuaternionObject_Check(q1)) { + quat1 = (QuaternionObject*)q1; + if(!BaseMath_ReadCallback(quat1)) + return NULL; + } + if(QuaternionObject_Check(q2)) { + quat2 = (QuaternionObject*)q2; + if(!BaseMath_ReadCallback(quat2)) + return NULL; + } - if(QuaternionObject_Check(q1) && QuaternionObject_Check(q2)) { /* QUAT*QUAT (dot product) */ - for(x = 0; x < 4; x++) { - dot += quat1->quat[x] * quat1->quat[x]; - } - return PyFloat_FromDouble(dot); + if(quat1 && quat2) { /* QUAT*QUAT (dot product) */ + return PyFloat_FromDouble(QuatDot(quat1->quat, quat2->quat)); } /* the only case this can happen (for a supported type is "FLOAT*QUAT" ) */ if(!QuaternionObject_Check(q1)) { scalar= PyFloat_AsDouble(q1); if ((scalar == -1.0 && PyErr_Occurred())==0) { /* FLOAT*QUAT */ - for(x = 0; x < 4; x++) { - quat[x] = quat2->quat[x] * scalar; - } + QUATCOPY(quat, quat2->quat); + QuatMulf(quat, scalar); return newQuaternionObject(quat, Py_NEW); } PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: val * quat, val is not an acceptable type"); @@ -574,9 +595,8 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2) scalar= PyFloat_AsDouble(q2); if ((scalar == -1.0 && PyErr_Occurred())==0) { /* QUAT*FLOAT */ - for(x = 0; x < 4; x++) { - quat[x] = quat1->quat[x] * scalar; - } + QUATCOPY(quat, quat1->quat); + QuatMulf(quat, scalar); return newQuaternionObject(quat, Py_NEW); } } @@ -625,63 +645,17 @@ static PyNumberMethods Quaternion_NumMethods = { static PyObject *Quaternion_getAxis( QuaternionObject * self, void *type ) { - switch( (long)type ) { - case 'W': - return PyFloat_FromDouble(self->quat[0]); - case 'X': - return PyFloat_FromDouble(self->quat[1]); - case 'Y': - return PyFloat_FromDouble(self->quat[2]); - case 'Z': - return PyFloat_FromDouble(self->quat[3]); - } - - PyErr_SetString(PyExc_SystemError, "corrupt quaternion, cannot get axis"); - return NULL; + return Quaternion_item(self, GET_INT_FROM_POINTER(type)); } static int Quaternion_setAxis( QuaternionObject * self, PyObject * value, void * type ) { - float param= (float)PyFloat_AsDouble( value ); - - if (param==-1 && PyErr_Occurred()) { - PyErr_SetString( PyExc_TypeError, "expected a number for the vector axis" ); - return -1; - } - switch( (long)type ) { - case 'W': - self->quat[0]= param; - break; - case 'X': - self->quat[1]= param; - break; - case 'Y': - self->quat[2]= param; - break; - case 'Z': - self->quat[3]= param; - break; - } - - return 0; -} - -static PyObject *Quaternion_getWrapped( QuaternionObject * self, void *type ) -{ - if (self->wrapped == Py_WRAP) - Py_RETURN_TRUE; - else - Py_RETURN_FALSE; + return Quaternion_ass_item(self, GET_INT_FROM_POINTER(type), value); } static PyObject *Quaternion_getMagnitude( QuaternionObject * self, void *type ) { - double mag = 0.0; - int i; - for(i = 0; i < 4; i++) { - mag += self->quat[i] * self->quat[i]; - } - return PyFloat_FromDouble(sqrt(mag)); + return PyFloat_FromDouble(sqrt(QuatDot(self->quat, self->quat))); } static PyObject *Quaternion_getAngle( QuaternionObject * self, void *type ) @@ -720,19 +694,19 @@ static PyGetSetDef Quaternion_getseters[] = { {"w", (getter)Quaternion_getAxis, (setter)Quaternion_setAxis, "Quaternion W value", - (void *)'W'}, + (void *)0}, {"x", (getter)Quaternion_getAxis, (setter)Quaternion_setAxis, "Quaternion X axis", - (void *)'X'}, + (void *)1}, {"y", (getter)Quaternion_getAxis, (setter)Quaternion_setAxis, "Quaternion Y axis", - (void *)'Y'}, + (void *)2}, {"z", (getter)Quaternion_getAxis, (setter)Quaternion_setAxis, "Quaternion Z axis", - (void *)'Z'}, + (void *)3}, {"magnitude", (getter)Quaternion_getMagnitude, (setter)NULL, "Size of the quaternion", @@ -746,9 +720,14 @@ static PyGetSetDef Quaternion_getseters[] = { "quaternion axis as a vector", NULL}, {"wrapped", - (getter)Quaternion_getWrapped, (setter)NULL, + (getter)BaseMathObject_getWrapped, (setter)NULL, "True when this wraps blenders internal data", NULL}, + {"__owner__", + (getter)BaseMathObject_getOwner, (setter)NULL, + "Read only owner for vectors that depend on another object", + NULL}, + {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ }; @@ -765,7 +744,7 @@ PyTypeObject quaternion_Type = { "quaternion", //tp_name sizeof(QuaternionObject), //tp_basicsize 0, //tp_itemsize - (destructor)Quaternion_dealloc, //tp_dealloc + (destructor)BaseMathObject_dealloc, //tp_dealloc 0, //tp_print 0, //tp_getattr 0, //tp_setattr @@ -817,26 +796,22 @@ PyTypeObject quaternion_Type = { PyObject *newQuaternionObject(float *quat, int type) { QuaternionObject *self; - int x; self = PyObject_NEW(QuaternionObject, &quaternion_Type); - self->data.blend_data = NULL; - self->data.py_data = NULL; + + /* init callbacks as NULL */ + self->cb_user= NULL; + self->cb_type= self->cb_subtype= 0; if(type == Py_WRAP){ - self->data.blend_data = quat; - self->quat = self->data.blend_data; + self->quat = quat; self->wrapped = Py_WRAP; }else if (type == Py_NEW){ - self->data.py_data = PyMem_Malloc(4 * sizeof(float)); - self->quat = self->data.py_data; + self->quat = PyMem_Malloc(4 * sizeof(float)); if(!quat) { //new empty - Quaternion_Identity(self); - Py_DECREF(self); + QuatOne(self->quat); }else{ - for(x = 0; x < 4; x++){ - self->quat[x] = quat[x]; - } + QUATCOPY(self->quat, quat); } self->wrapped = Py_NEW; }else{ //bad type @@ -844,3 +819,16 @@ PyObject *newQuaternionObject(float *quat, int type) } return (PyObject *) self; } + +PyObject *newQuaternionObject_cb(PyObject *cb_user, int cb_type, int cb_subtype) +{ + QuaternionObject *self= (QuaternionObject *)newQuaternionObject(NULL, Py_NEW); + if(self) { + Py_INCREF(cb_user); + self->cb_user= cb_user; + self->cb_type= (unsigned char)cb_type; + self->cb_subtype= (unsigned char)cb_subtype; + } + + return (PyObject *)self; +} diff --git a/source/blender/python/generic/quat.h b/source/blender/python/generic/quat.h index ebbac26e39c..2e74b5fa7f9 100644 --- a/source/blender/python/generic/quat.h +++ b/source/blender/python/generic/quat.h @@ -38,14 +38,15 @@ extern PyTypeObject quaternion_Type; #define QuaternionObject_Check(v) (Py_TYPE(v) == &quaternion_Type) -typedef struct { +typedef struct { /* keep aligned with BaseMathObject in Mathutils.h */ PyObject_VAR_HEAD - struct{ - float *py_data; //python managed - float *blend_data; //blender managed - }data; - float *quat; //1D array of data (alias) - int wrapped; //is wrapped data? + float *quat; /* 1D array of data (alias) */ + PyObject *cb_user; /* if this vector references another object, otherwise NULL, *Note* this owns its reference */ + unsigned char cb_type; /* which user funcs do we adhere to, RNA, GameObject, etc */ + unsigned char cb_subtype; /* subtype: location, rotation... to avoid defining many new functions for every attribute of the same type */ + unsigned char wrapped; /* wrapped data type? */ + /* end BaseMathObject */ + } QuaternionObject; /*struct data contains a pointer to the actual data that the @@ -55,5 +56,6 @@ blender (stored in blend_data). This is an either/or struct not both*/ //prototypes PyObject *newQuaternionObject( float *quat, int type ); +PyObject *newQuaternionObject_cb(PyObject *cb_user, int cb_type, int cb_subtype); #endif /* EXPP_quat_h */ diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index dea5bc93898..d68d3f41370 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -144,7 +144,7 @@ static PyObject *Vector_Zero(VectorObject * self) self->vec[i] = 0.0f; } - Vector_WriteCallback(self); + BaseMath_WriteCallback(self); Py_INCREF(self); return (PyObject*)self; } @@ -155,7 +155,7 @@ static PyObject *Vector_Normalize(VectorObject * self) int i; float norm = 0.0f; - if(!Vector_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; for(i = 0; i < self->size; i++) { @@ -166,7 +166,7 @@ static PyObject *Vector_Normalize(VectorObject * self) self->vec[i] /= norm; } - Vector_WriteCallback(self); + BaseMath_WriteCallback(self); Py_INCREF(self); return (PyObject*)self; } @@ -266,7 +266,7 @@ static PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) return NULL; } - if(!Vector_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; if (strack) { @@ -385,7 +385,7 @@ static PyObject *Vector_Reflect( VectorObject * self, VectorObject * value ) return NULL; } - if(!Vector_ReadCallback(self) || !Vector_ReadCallback(value)) + if(!BaseMath_ReadCallback(self) || !BaseMath_ReadCallback(value)) return NULL; mirror[0] = value->vec[0]; @@ -431,7 +431,7 @@ static PyObject *Vector_Cross( VectorObject * self, VectorObject * value ) return NULL; } - if(!Vector_ReadCallback(self) || !Vector_ReadCallback(value)) + if(!BaseMath_ReadCallback(self) || !BaseMath_ReadCallback(value)) return NULL; vecCross = (VectorObject *)newVectorObject(NULL, 3, Py_NEW); @@ -454,7 +454,7 @@ static PyObject *Vector_Dot( VectorObject * self, VectorObject * value ) return NULL; } - if(!Vector_ReadCallback(self) || !Vector_ReadCallback(value)) + if(!BaseMath_ReadCallback(self) || !BaseMath_ReadCallback(value)) return NULL; for(x = 0; x < self->size; x++) { @@ -467,24 +467,12 @@ static PyObject *Vector_Dot( VectorObject * self, VectorObject * value ) return a copy of the vector */ static PyObject *Vector_copy(VectorObject * self) { - if(!Vector_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; return newVectorObject(self->vec, self->size, Py_NEW); } -/*----------------------------dealloc()(internal) ---------------- - free the py_object */ -static void Vector_dealloc(VectorObject * self) -{ - /* only free non wrapped */ - if(self->wrapped != Py_WRAP) - PyMem_Free(self->vec); - - Py_XDECREF(self->cb_user); - PyObject_DEL(self); -} - /*----------------------------print object (internal)------------- print the object to screen */ static PyObject *Vector_repr(VectorObject * self) @@ -492,7 +480,7 @@ static PyObject *Vector_repr(VectorObject * self) int i; char buffer[48], str[1024]; - if(!Vector_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; BLI_strncpy(str,"[",1024); @@ -520,12 +508,14 @@ static int Vector_len(VectorObject * self) sequence accessor (get)*/ static PyObject *Vector_item(VectorObject * self, int i) { + if(i<0) i= self->size-i; + if(i < 0 || i >= self->size) { PyErr_SetString(PyExc_IndexError,"vector[index]: out of range\n"); return NULL; } - if(!Vector_ReadIndexCallback(self, i)) + if(!BaseMath_ReadIndexCallback(self, i)) return NULL; return PyFloat_FromDouble(self->vec[i]); @@ -541,13 +531,15 @@ static int Vector_ass_item(VectorObject * self, int i, PyObject * ob) return -1; } + if(i<0) i= self->size-i; + if(i < 0 || i >= self->size){ PyErr_SetString(PyExc_IndexError, "vector[index] = x: assignment index out of range\n"); return -1; } self->vec[i] = scalar; - if(!Vector_WriteIndexCallback(self, i)) + if(!BaseMath_WriteIndexCallback(self, i)) return -1; return 0; } @@ -559,7 +551,7 @@ static PyObject *Vector_slice(VectorObject * self, int begin, int end) PyObject *list = NULL; int count; - if(!Vector_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; CLAMP(begin, 0, self->size); @@ -584,7 +576,7 @@ static int Vector_ass_slice(VectorObject * self, int begin, int end, float vec[4], scalar; PyObject *v; - if(!Vector_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return -1; CLAMP(begin, 0, self->size); @@ -620,7 +612,7 @@ static int Vector_ass_slice(VectorObject * self, int begin, int end, self->vec[begin + y] = vec[y]; } - if(!Vector_WriteCallback(self)) + if(!BaseMath_WriteCallback(self)) return -1; return 0; @@ -644,7 +636,7 @@ static PyObject *Vector_add(PyObject * v1, PyObject * v2) /* make sure v1 is always the vector */ if (vec1 && vec2 ) { - if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2)) + if(!BaseMath_ReadCallback(vec1) || !BaseMath_ReadCallback(vec2)) return NULL; /*VECTOR + VECTOR*/ @@ -679,7 +671,7 @@ static PyObject *Vector_iadd(PyObject * v1, PyObject * v2) /* make sure v1 is always the vector */ if (vec1 && vec2 ) { - if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2)) + if(!BaseMath_ReadCallback(vec1) || !BaseMath_ReadCallback(vec2)) return NULL; /*VECTOR + VECTOR*/ @@ -694,7 +686,7 @@ static PyObject *Vector_iadd(PyObject * v1, PyObject * v2) return v1; } - Vector_WriteCallback(vec1); + BaseMath_WriteCallback(vec1); PyErr_SetString(PyExc_AttributeError, "Vector addition: arguments not valid for this operation....\n"); return NULL; } @@ -714,7 +706,7 @@ static PyObject *Vector_sub(PyObject * v1, PyObject * v2) vec1 = (VectorObject*)v1; vec2 = (VectorObject*)v2; - if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2)) + if(!BaseMath_ReadCallback(vec1) || !BaseMath_ReadCallback(vec2)) return NULL; if(vec1->size != vec2->size) { @@ -747,14 +739,14 @@ static PyObject *Vector_isub(PyObject * v1, PyObject * v2) return NULL; } - if(!Vector_ReadCallback(vec1) || !Vector_ReadCallback(vec2)) + if(!BaseMath_ReadCallback(vec1) || !BaseMath_ReadCallback(vec2)) return NULL; for(i = 0; i < vec1->size; i++) { vec1->vec[i] = vec1->vec[i] - vec2->vec[i]; } - Vector_WriteCallback(vec1); + BaseMath_WriteCallback(vec1); Py_INCREF( v1 ); return v1; } @@ -768,12 +760,12 @@ static PyObject *Vector_mul(PyObject * v1, PyObject * v2) if VectorObject_Check(v1) { vec1= (VectorObject *)v1; - if(!Vector_ReadCallback(vec1)) + if(!BaseMath_ReadCallback(vec1)) return NULL; } if VectorObject_Check(v2) { vec2= (VectorObject *)v2; - if(!Vector_ReadCallback(vec2)) + if(!BaseMath_ReadCallback(vec2)) return NULL; } @@ -805,7 +797,8 @@ static PyObject *Vector_mul(PyObject * v1, PyObject * v2) /* VEC * MATRIX */ return row_vector_multiplication(vec1, (MatrixObject*)v2); } else if (QuaternionObject_Check(v2)) { - QuaternionObject *quat = (QuaternionObject*)v2; + QuaternionObject *quat = (QuaternionObject*)v2; /* quat_rotation validates */ + if(vec1->size != 3) { PyErr_SetString(PyExc_TypeError, "Vector multiplication: only 3D vector rotations (with quats) currently supported\n"); return NULL; @@ -835,7 +828,7 @@ static PyObject *Vector_imul(PyObject * v1, PyObject * v2) int i; float scalar; - if(!Vector_ReadCallback(vec)) + if(!BaseMath_ReadCallback(vec)) return NULL; /* only support vec*=float and vec*=mat @@ -845,7 +838,7 @@ static PyObject *Vector_imul(PyObject * v1, PyObject * v2) int x,y, size = vec->size; MatrixObject *mat= (MatrixObject*)v2; - if(!Vector_ReadCallback(mat)) + if(!BaseMath_ReadCallback(mat)) return NULL; if(mat->colSize != size){ @@ -883,7 +876,7 @@ static PyObject *Vector_imul(PyObject * v1, PyObject * v2) return NULL; } - Vector_WriteCallback(vec); + BaseMath_WriteCallback(vec); Py_INCREF( v1 ); return v1; } @@ -902,7 +895,7 @@ static PyObject *Vector_div(PyObject * v1, PyObject * v2) } vec1 = (VectorObject*)v1; /* vector */ - if(!Vector_ReadCallback(vec1)) + if(!BaseMath_ReadCallback(vec1)) return NULL; scalar = (float)PyFloat_AsDouble(v2); @@ -930,7 +923,7 @@ static PyObject *Vector_idiv(PyObject * v1, PyObject * v2) float scalar; VectorObject *vec1 = (VectorObject*)v1; - if(!Vector_ReadCallback(vec1)) + if(!BaseMath_ReadCallback(vec1)) return NULL; scalar = (float)PyFloat_AsDouble(v2); @@ -947,7 +940,7 @@ static PyObject *Vector_idiv(PyObject * v1, PyObject * v2) vec1->vec[i] /= scalar; } - Vector_WriteCallback(vec1); + BaseMath_WriteCallback(vec1); Py_INCREF( v1 ); return v1; @@ -960,7 +953,7 @@ static PyObject *Vector_neg(VectorObject *self) int i; float vec[4]; - if(!Vector_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; for(i = 0; i < self->size; i++){ @@ -1008,7 +1001,7 @@ static PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int compa vecA = (VectorObject*)objectA; vecB = (VectorObject*)objectB; - if(!Vector_ReadCallback(vecA) || !Vector_ReadCallback(vecB)) + if(!BaseMath_ReadCallback(vecA) || !BaseMath_ReadCallback(vecB)) return NULL; if (vecA->size != vecB->size){ @@ -1137,12 +1130,12 @@ static PyNumberMethods Vector_NumMethods = { static PyObject *Vector_getAxis( VectorObject * self, void *type ) { - return Vector_item(self, (int)type); + return Vector_item(self, GET_INT_FROM_POINTER(type)); } static int Vector_setAxis( VectorObject * self, PyObject * value, void * type ) { - return Vector_ass_item(self, (int)type, value); + return Vector_ass_item(self, GET_INT_FROM_POINTER(type), value); } /* vector.length */ @@ -1151,7 +1144,7 @@ static PyObject *Vector_getLength( VectorObject * self, void *type ) double dot = 0.0f; int i; - if(!Vector_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; for(i = 0; i < self->size; i++){ @@ -1165,7 +1158,7 @@ static int Vector_setLength( VectorObject * self, PyObject * value ) double dot = 0.0f, param; int i; - if(!Vector_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return -1; param= PyFloat_AsDouble( value ); @@ -1203,30 +1196,11 @@ static int Vector_setLength( VectorObject * self, PyObject * value ) self->vec[i]= self->vec[i] / (float)dot; } - Vector_WriteCallback(self); /* checked alredy */ + BaseMath_WriteCallback(self); /* checked alredy */ return 0; } -static PyObject *Vector_getWrapped( VectorObject * self, void *type ) -{ - if (self->wrapped == Py_WRAP) - Py_RETURN_TRUE; - else - Py_RETURN_FALSE; -} - -static PyObject *Vector_getOwner( VectorObject * self, void *type ) -{ - if(self->cb_user==NULL) { - Py_RETURN_NONE; - } - else { - Py_INCREF(self->cb_user); - return self->cb_user; - } -} - /* Get a new Vector according to the provided swizzle. This function has little error checking, as we are in control of the inputs: the closure is set by us in Vector_createSwizzleGetSeter. */ @@ -1237,7 +1211,7 @@ static PyObject *Vector_getSwizzle(VectorObject * self, void *closure) float vec[MAX_DIMENSIONS]; unsigned int swizzleClosure; - if(!Vector_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; /* Unpack the axes from the closure into an array. */ @@ -1277,7 +1251,7 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur float vecTemp[MAX_DIMENSIONS]; - if(!Vector_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return -1; /* Check that the closure can be used with this vector: even 2D vectors have @@ -1309,7 +1283,7 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur axisB++; } memcpy(self->vec, vecTemp, axisB * sizeof(float)); - /* continue with Vector_WriteCallback at the end */ + /* continue with BaseMathObject_WriteCallback at the end */ } else if (PyList_Check(value)) { @@ -1335,7 +1309,7 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur axisB++; } memcpy(self->vec, vecTemp, axisB * sizeof(float)); - /* continue with Vector_WriteCallback at the end */ + /* continue with BaseMathObject_WriteCallback at the end */ } else if (((scalarVal = (float)PyFloat_AsDouble(value)) == -1.0 && PyErr_Occurred())==0) { @@ -1348,14 +1322,14 @@ static int Vector_setSwizzle(VectorObject * self, PyObject * value, void *closur swizzleClosure = swizzleClosure >> SWIZZLE_BITS_PER_AXIS; } - /* continue with Vector_WriteCallback at the end */ + /* continue with BaseMathObject_WriteCallback at the end */ } else { PyErr_SetString( PyExc_TypeError, "Expected a Vector, list or scalar value." ); return -1; } - if(!Vector_WriteCallback(vecVal)) + if(!BaseMath_WriteCallback(vecVal)) return -1; else return 0; @@ -1390,11 +1364,11 @@ static PyGetSetDef Vector_getseters[] = { "Vector Length", NULL}, {"wrapped", - (getter)Vector_getWrapped, (setter)NULL, + (getter)BaseMathObject_getWrapped, (setter)NULL, "True when this wraps blenders internal data", NULL}, {"__owner__", - (getter)Vector_getOwner, (setter)NULL, + (getter)BaseMathObject_getOwner, (setter)NULL, "Read only owner for vectors that depend on another object", NULL}, @@ -1803,7 +1777,7 @@ PyTypeObject vector_Type = { /* Methods to implement standard operations */ - ( destructor ) Vector_dealloc,/* destructor tp_dealloc; */ + ( destructor ) BaseMathObject_dealloc,/* destructor tp_dealloc; */ NULL, /* printfunc tp_print; */ NULL, /* getattrfunc tp_getattr; */ NULL, /* setattrfunc tp_setattr; */ @@ -1920,7 +1894,7 @@ PyObject *newVectorObject(float *vec, int size, int type) PyObject *newVectorObject_cb(PyObject *cb_user, int size, int cb_type, int cb_subtype) { float dummy[4] = {0.0, 0.0, 0.0, 0.0}; /* dummy init vector, callbacks will be used on access */ - VectorObject *self= newVectorObject(dummy, size, Py_NEW); + VectorObject *self= (VectorObject *)newVectorObject(dummy, size, Py_NEW); if(self) { Py_INCREF(cb_user); self->cb_user= cb_user; @@ -1928,7 +1902,7 @@ PyObject *newVectorObject_cb(PyObject *cb_user, int size, int cb_type, int cb_su self->cb_subtype= (unsigned char)cb_subtype; } - return self; + return (PyObject *)self; } //-----------------row_vector_multiplication (internal)----------- @@ -1952,7 +1926,7 @@ static PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat } } - if(!Vector_ReadCallback(vec) || !Matrix_ReadCallback(mat)) + if(!BaseMath_ReadCallback(vec) || !BaseMath_ReadCallback(mat)) return NULL; for(x = 0; x < vec_size; x++){ @@ -1975,13 +1949,13 @@ static PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat static PyObject *Vector_Negate(VectorObject * self) { int i; - if(!Vector_ReadCallback(self)) + if(!BaseMath_ReadCallback(self)) return NULL; for(i = 0; i < self->size; i++) self->vec[i] = -(self->vec[i]); - Vector_WriteCallback(self); // alredy checked for error + BaseMath_WriteCallback(self); // alredy checked for error Py_INCREF(self); return (PyObject*)self; diff --git a/source/blender/python/generic/vector.h b/source/blender/python/generic/vector.h index 82dbf13b9aa..f519b2808cb 100644 --- a/source/blender/python/generic/vector.h +++ b/source/blender/python/generic/vector.h @@ -37,15 +37,16 @@ extern PyTypeObject vector_Type; #define VectorObject_Check(v) (((PyObject *)v)->ob_type == &vector_Type) -typedef struct { +typedef struct { /* keep aligned with BaseMathObject in Mathutils.h */ PyObject_VAR_HEAD float *vec; /*1D array of data (alias), wrapped status depends on wrapped status */ PyObject *cb_user; /* if this vector references another object, otherwise NULL, *Note* this owns its reference */ - unsigned char size; /* vec size 2,3 or 4 */ - unsigned char wrapped; /* wrapped data type? */ unsigned char cb_type; /* which user funcs do we adhere to, RNA, GameObject, etc */ unsigned char cb_subtype; /* subtype: location, rotation... to avoid defining many new functions for every attribute of the same type */ - + unsigned char wrapped; /* wrapped data type? */ + /* end BaseMathObject */ + + unsigned char size; /* vec size 2,3 or 4 */ } VectorObject; /*prototypes*/ diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 3cef6e14861..0b8a7df1ae1 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -44,8 +44,8 @@ #ifdef USE_MATHUTILS #include "../generic/Mathutils.h" /* so we can have mathutils callbacks */ -/* bpyrna vector callbacks */ -static int mathutils_rna_vector_cb_index= -1; /* index for our callbacks */ +/* bpyrna vector/euler/quat callbacks */ +static int mathutils_rna_array_cb_index= -1; /* index for our callbacks */ static int mathutils_rna_generic_check(BPy_PropertyRNA *self) { @@ -88,7 +88,7 @@ static int mathutils_rna_vector_set_index(BPy_PropertyRNA *self, int subtype, fl return 1; } -Mathutils_Callback mathutils_rna_vector_cb = { +Mathutils_Callback mathutils_rna_array_cb = { mathutils_rna_generic_check, mathutils_rna_vector_get, mathutils_rna_vector_set, @@ -234,26 +234,41 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop) PyObject *ret = pyrna_prop_CreatePyObject(ptr, prop); #ifdef USE_MATHUTILS + /* return a mathutils vector where possible */ if(RNA_property_type(prop)==PROP_FLOAT) { - if(RNA_property_subtype(prop)==PROP_VECTOR) { + switch(RNA_property_subtype(prop)) { + case PROP_VECTOR: if(len>=2 && len <= 4) { - PyObject *vec_cb= newVectorObject_cb(ret, len, mathutils_rna_vector_cb_index, 0); + PyObject *vec_cb= newVectorObject_cb(ret, len, mathutils_rna_array_cb_index, 0); Py_DECREF(ret); /* the vector owns now */ ret= vec_cb; /* return the vector instead */ } - } - else if(RNA_property_subtype(prop)==PROP_MATRIX) { + break; + case PROP_MATRIX: if(len==16) { - PyObject *mat_cb= newMatrixObject_cb(ret, 4,4, mathutils_rna_vector_cb_index, 0); + PyObject *mat_cb= newMatrixObject_cb(ret, 4,4, mathutils_rna_matrix_cb_index, 0); Py_DECREF(ret); /* the matrix owns now */ ret= mat_cb; /* return the matrix instead */ } else if (len==9) { - PyObject *mat_cb= newMatrixObject_cb(ret, 3,3, mathutils_rna_vector_cb_index, 0); + PyObject *mat_cb= newMatrixObject_cb(ret, 3,3, mathutils_rna_matrix_cb_index, 0); Py_DECREF(ret); /* the matrix owns now */ ret= mat_cb; /* return the matrix instead */ } + break; + case PROP_ROTATION: + if(len==3) { /* euler */ + PyObject *eul_cb= newEulerObject_cb(ret, mathutils_rna_array_cb_index, 0); + Py_DECREF(ret); /* the matrix owns now */ + ret= eul_cb; /* return the matrix instead */ + } + else if (len==4) { + PyObject *quat_cb= newQuaternionObject_cb(ret, mathutils_rna_array_cb_index, 0); + Py_DECREF(ret); /* the matrix owns now */ + ret= quat_cb; /* return the matrix instead */ + } + break; } } @@ -377,12 +392,15 @@ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, const char *error_prefi static PyObject * pyrna_func_call(PyObject * self, PyObject *args, PyObject *kw); -PyObject *pyrna_func_to_py(PointerRNA *ptr, FunctionRNA *func) +PyObject *pyrna_func_to_py(BPy_StructRNA *pyrna, FunctionRNA *func) { static PyMethodDef func_meth = {"", (PyCFunction)pyrna_func_call, METH_VARARGS|METH_KEYWORDS, "python rna function"}; PyObject *self= PyTuple_New(2); PyObject *ret; - PyTuple_SET_ITEM(self, 0, pyrna_struct_CreatePyObject(ptr)); + + PyTuple_SET_ITEM(self, 0, (PyObject *)pyrna); + Py_INCREF(pyrna); + PyTuple_SET_ITEM(self, 1, PyCObject_FromVoidPtr((void *)func, NULL)); ret= PyCFunction_New(&func_meth, self); @@ -407,23 +425,23 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v #ifdef USE_MATHUTILS if(MatrixObject_Check(value)) { MatrixObject *mat = (MatrixObject*)value; - if(!Matrix_ReadCallback(mat)) + if(!BaseMath_ReadCallback(mat)) return -1; py_len = mat->rowSize * mat->colSize; - } else // continue... + } else /* continue... */ #endif if (PySequence_Check(value)) { py_len= (int)PySequence_Length(value); } else { - PyErr_SetString(PyExc_TypeError, "expected a python sequence type assigned to an RNA array."); + PyErr_Format(PyExc_TypeError, "RNA array assignment expected a sequence instead of %s instance.", Py_TYPE(value)->tp_name); return -1; } /* done getting the length */ if (py_len != len) { - PyErr_SetString(PyExc_AttributeError, "python sequence length did not match the RNA array."); + PyErr_Format(PyExc_AttributeError, "python sequence length %d did not match the RNA array length %d.", py_len, len); return -1; } @@ -493,7 +511,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v if(MatrixObject_Check(value) && RNA_property_subtype(prop) == PROP_MATRIX) { MatrixObject *mat = (MatrixObject*)value; memcpy(param_arr, mat->contigPtr, sizeof(float) * len); - } else // continue... + } else /* continue... */ #endif { /* collect the variables */ @@ -1036,7 +1054,7 @@ static PyObject *pyrna_struct_getattro( BPy_StructRNA * self, PyObject *pyname ) ret = pyrna_prop_to_py(&self->ptr, prop); } else if ((func = RNA_struct_find_function(&self->ptr, name))) { - ret = pyrna_func_to_py(&self->ptr, func); + ret = pyrna_func_to_py(self, func); } else if (self->ptr.type == &RNA_Context) { PointerRNA newptr; @@ -1786,7 +1804,7 @@ PyObject *BPY_rna_module( void ) PointerRNA ptr; #ifdef USE_MATHUTILS // register mathutils callbacks, ok to run more then once. - mathutils_rna_vector_cb_index= Mathutils_RegisterCallback(&mathutils_rna_vector_cb); + mathutils_rna_array_cb_index= Mathutils_RegisterCallback(&mathutils_rna_array_cb); mathutils_rna_matrix_cb_index= Mathutils_RegisterCallback(&mathutils_rna_matrix_cb); #endif diff --git a/source/gameengine/Expressions/KX_Python.h b/source/gameengine/Expressions/KX_Python.h index b8006fdf0ed..61f7ef05042 100644 --- a/source/gameengine/Expressions/KX_Python.h +++ b/source/gameengine/Expressions/KX_Python.h @@ -32,6 +32,8 @@ //#define USE_DL_EXPORT #include "Python.h" +#define USE_MATHUTILS // Blender 2.5x api will use mathutils, for a while we might want to test without it + #ifdef __FreeBSD__ #include #if __FreeBSD_version > 500039 diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index defb6853e67..2d4cc612aef 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -331,13 +331,18 @@ PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef } case KX_PYATTRIBUTE_TYPE_VECTOR: { - PyObject* resultlist = PyList_New(3); MT_Vector3 *val = reinterpret_cast(ptr); +#ifdef USE_MATHUTILS + float fval[3]= {(*val)[0], (*val)[1], (*val)[2]}; + return newVectorObject(fval, 3, Py_NEW); +#else + PyObject* resultlist = PyList_New(3); for (unsigned int i=0; i<3; i++) { PyList_SET_ITEM(resultlist,i,PyFloat_FromDouble((*val)[i])); } return resultlist; +#endif } case KX_PYATTRIBUTE_TYPE_STRING: { diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 96c75b710a3..3b5eebe9893 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -41,13 +41,15 @@ #include "MT_Vector3.h" #include "SG_QList.h" -#define USE_MATHUTILS // Blender 2.5x api will use mathutils, for a while we might want to test without it - /*------------------------------ * Python defines ------------------------------*/ - +#ifdef USE_MATHUTILS +extern "C" { +#include "../../blender/python/generic/Mathutils.h" /* so we can have mathutils callbacks */ +} +#endif #if PY_VERSION_HEX > 0x03000000 #define PyString_FromString PyUnicode_FromString diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index a3b2ba79e11..577f767b475 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1184,11 +1184,7 @@ CListValue* KX_GameObject::GetChildrenRecursive() return list; } - #ifdef USE_MATHUTILS -extern "C" { -#include "../../blender/python/generic/Mathutils.h" /* so we can have mathutils callbacks */ -} /* These require an SGNode */ #define MATHUTILS_VEC_CB_POS_LOCAL 1 @@ -1880,12 +1876,7 @@ int KX_GameObject::pyattr_set_worldOrientation(void *self_v, const KX_PYATTRIBUT if (!PyOrientationTo(value, rot, "gameOb.worldOrientation = sequence: KX_GameObject, ")) return PY_SET_ATTR_FAIL; - if (self->GetSGNode() && self->GetSGNode()->GetSGParent()) { - self->NodeSetLocalOrientation(self->GetSGNode()->GetSGParent()->GetWorldOrientation().inverse()*rot); - } - else { - self->NodeSetLocalOrientation(rot); - } + self->NodeSetGlobalOrientation(rot); self->NodeUpdateGS(0.f); return PY_SET_ATTR_SUCCESS; diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index eaae04d406d..62e61667c56 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -396,9 +396,14 @@ PyAttributeDef KX_ObjectActuator::Attributes[] = { KX_PYATTRIBUTE_BOOL_RW("useLocalDLoc", KX_ObjectActuator, m_bitLocalFlag.DLoc), KX_PYATTRIBUTE_VECTOR_RW_CHECK("dRot", -1000, 1000, false, KX_ObjectActuator, m_drot, PyUpdateFuzzyFlags), KX_PYATTRIBUTE_BOOL_RW("useLocalDRot", KX_ObjectActuator, m_bitLocalFlag.DRot), +#ifdef USE_MATHUTILS + KX_PYATTRIBUTE_RW_FUNCTION("linV", KX_ObjectActuator, pyattr_get_linV, pyattr_set_linV), + KX_PYATTRIBUTE_RW_FUNCTION("angV", KX_ObjectActuator, pyattr_get_angV, pyattr_set_angV), +#else KX_PYATTRIBUTE_VECTOR_RW_CHECK("linV", -1000, 1000, false, KX_ObjectActuator, m_linear_velocity, PyUpdateFuzzyFlags), - KX_PYATTRIBUTE_BOOL_RW("useLocalLinV", KX_ObjectActuator, m_bitLocalFlag.LinearVelocity), KX_PYATTRIBUTE_VECTOR_RW_CHECK("angV", -1000, 1000, false, KX_ObjectActuator, m_angular_velocity, PyUpdateFuzzyFlags), +#endif + KX_PYATTRIBUTE_BOOL_RW("useLocalLinV", KX_ObjectActuator, m_bitLocalFlag.LinearVelocity), KX_PYATTRIBUTE_BOOL_RW("useLocalAngV", KX_ObjectActuator, m_bitLocalFlag.AngularVelocity), KX_PYATTRIBUTE_SHORT_RW("damping", 0, 1000, false, KX_ObjectActuator, m_damping), KX_PYATTRIBUTE_RW_FUNCTION("forceLimitX", KX_ObjectActuator, pyattr_get_forceLimitX, pyattr_set_forceLimitX), @@ -425,6 +430,129 @@ int KX_ObjectActuator::py_setattro(PyObject *attr, PyObject *value) /* Attribute get/set functions */ +#ifdef USE_MATHUTILS + +/* These require an SGNode */ +#define MATHUTILS_VEC_CB_LINV 1 +#define MATHUTILS_VEC_CB_ANGV 2 + +static int mathutils_kxobactu_vector_cb_index= -1; /* index for our callbacks */ + +static int mathutils_obactu_generic_check(PyObject *self_v) +{ + KX_ObjectActuator* self= static_castBGE_PROXY_REF(self_v); + if(self==NULL) + return 0; + + return 1; +} + +static int mathutils_obactu_vector_get(PyObject *self_v, int subtype, float *vec_from) +{ + KX_ObjectActuator* self= static_castBGE_PROXY_REF(self_v); + if(self==NULL) + return 0; + + switch(subtype) { + case MATHUTILS_VEC_CB_LINV: + self->m_linear_velocity.getValue(vec_from); + break; + case MATHUTILS_VEC_CB_ANGV: + self->m_angular_velocity.getValue(vec_from); + break; + } + + return 1; +} + +static int mathutils_obactu_vector_set(PyObject *self_v, int subtype, float *vec_to) +{ + KX_ObjectActuator* self= static_castBGE_PROXY_REF(self_v); + if(self==NULL) + return 0; + + switch(subtype) { + case MATHUTILS_VEC_CB_LINV: + self->m_linear_velocity.setValue(vec_to); + break; + case MATHUTILS_VEC_CB_ANGV: + self->m_angular_velocity.setValue(vec_to); + break; + } + + return 1; +} + +static int mathutils_obactu_vector_get_index(PyObject *self_v, int subtype, float *vec_from, int index) +{ + float f[4]; + /* lazy, avoid repeteing the case statement */ + if(!mathutils_obactu_vector_get(self_v, subtype, f)) + return 0; + + vec_from[index]= f[index]; + return 1; +} + +static int mathutils_obactu_vector_set_index(PyObject *self_v, int subtype, float *vec_to, int index) +{ + float f= vec_to[index]; + + /* lazy, avoid repeteing the case statement */ + if(!mathutils_obactu_vector_get(self_v, subtype, vec_to)) + return 0; + + vec_to[index]= f; + mathutils_obactu_vector_set(self_v, subtype, vec_to); + + return 1; +} + +Mathutils_Callback mathutils_obactu_vector_cb = { + mathutils_obactu_generic_check, + mathutils_obactu_vector_get, + mathutils_obactu_vector_set, + mathutils_obactu_vector_get_index, + mathutils_obactu_vector_set_index +}; + +PyObject* KX_ObjectActuator::pyattr_get_linV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxobactu_vector_cb_index, MATHUTILS_VEC_CB_LINV); +} + +int KX_ObjectActuator::pyattr_set_linV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) +{ + KX_ObjectActuator* self= static_cast(self_v); + if (!PyVecTo(value, self->m_linear_velocity)) + return PY_SET_ATTR_FAIL; + + return PY_SET_ATTR_SUCCESS; +} + +PyObject* KX_ObjectActuator::pyattr_get_angV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxobactu_vector_cb_index, MATHUTILS_VEC_CB_ANGV); +} + +int KX_ObjectActuator::pyattr_set_angV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) +{ + KX_ObjectActuator* self= static_cast(self_v); + if (!PyVecTo(value, self->m_angular_velocity)) + return PY_SET_ATTR_FAIL; + + return PY_SET_ATTR_SUCCESS; +} + + +void KX_ObjectActuator_Mathutils_Callback_Init(void) +{ + // register mathutils callbacks, ok to run more then once. + mathutils_kxobactu_vector_cb_index= Mathutils_RegisterCallback(&mathutils_obactu_vector_cb); +} + +#endif // USE_MATHUTILS + PyObject* KX_ObjectActuator::pyattr_get_forceLimitX(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_ObjectActuator* self = reinterpret_cast(self_v); diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h index f9bd2a0c748..6ca442b2ec2 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.h +++ b/source/gameengine/Ketsji/KX_ObjectActuator.h @@ -35,6 +35,10 @@ #include "SCA_IActuator.h" #include "MT_Vector3.h" +#ifdef USE_MATHUTILS +void KX_ObjectActuator_Mathutils_Callback_Init(void); +#endif + class KX_GameObject; // @@ -197,6 +201,13 @@ public: static PyObject* pyattr_get_reference(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_reference(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); +#ifdef USE_MATHUTILS + static PyObject* pyattr_get_linV(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_linV(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); + static PyObject* pyattr_get_angV(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); + static int pyattr_set_angV(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); +#endif + // This lets the attribute macros use UpdateFuzzyFlags() static int PyUpdateFuzzyFlags(void *self, const PyAttributeDef *attrdef) { diff --git a/source/gameengine/Ketsji/KX_PyMath.cpp b/source/gameengine/Ketsji/KX_PyMath.cpp index 051d7ae7dba..ee9fed5d30a 100644 --- a/source/gameengine/Ketsji/KX_PyMath.cpp +++ b/source/gameengine/Ketsji/KX_PyMath.cpp @@ -46,35 +46,6 @@ #include "KX_Python.h" #include "KX_PyMath.h" -bool PyObject_IsMT_Matrix(PyObject *pymat, unsigned int rank) -{ - if (!pymat) - return false; - - unsigned int y; - if (PySequence_Check(pymat)) - { - unsigned int rows = PySequence_Size(pymat); - if (rows != rank) - return false; - - bool ismatrix = true; - for (y = 0; y < rank && ismatrix; y++) - { - PyObject *pyrow = PySequence_GetItem(pymat, y); /* new ref */ - if (PySequence_Check(pyrow)) - { - if (((unsigned int)PySequence_Size(pyrow)) != rank) - ismatrix = false; - } else - ismatrix = false; - Py_DECREF(pyrow); - } - return ismatrix; - } - return false; -} - bool PyOrientationTo(PyObject* pyval, MT_Matrix3x3 &rot, const char *error_prefix) { int size= PySequence_Size(pyval); @@ -110,12 +81,10 @@ bool PyOrientationTo(PyObject* pyval, MT_Matrix3x3 &rot, const char *error_prefi PyObject* PyObjectFrom(const MT_Matrix4x4 &mat) { -#if 0 - return Py_BuildValue("[[ffff][ffff][ffff][ffff]]", - mat[0][0], mat[0][1], mat[0][2], mat[0][3], - mat[1][0], mat[1][1], mat[1][2], mat[1][3], - mat[2][0], mat[2][1], mat[2][2], mat[2][3], - mat[3][0], mat[3][1], mat[3][2], mat[3][3]); +#ifdef USE_MATHUTILS + float fmat[16]; + mat.getValue(fmat); + return newMatrixObject(fmat, 4, 4, Py_NEW); #else PyObject *list = PyList_New(4); PyObject *sublist; @@ -136,11 +105,10 @@ PyObject* PyObjectFrom(const MT_Matrix4x4 &mat) PyObject* PyObjectFrom(const MT_Matrix3x3 &mat) { -#if 0 - return Py_BuildValue("[[fff][fff][fff]]", - mat[0][0], mat[0][1], mat[0][2], - mat[1][0], mat[1][1], mat[1][2], - mat[2][0], mat[2][1], mat[2][2]); +#ifdef USE_MATHUTILS + float fmat[9]; + mat.getValue3x3(fmat); + return newMatrixObject(fmat, 3, 3, Py_NEW); #else PyObject *list = PyList_New(3); PyObject *sublist; @@ -160,9 +128,9 @@ PyObject* PyObjectFrom(const MT_Matrix3x3 &mat) PyObject* PyObjectFrom(const MT_Tuple4 &vec) { -#if 0 - return Py_BuildValue("[ffff]", - vec[0], vec[1], vec[2], vec[3]); +#ifdef USE_MATHUTILS + float fvec[4]= {vec[0], vec[1], vec[2], vec[3]}; + return newVectorObject(fvec, 4, Py_WRAP); #else PyObject *list = PyList_New(4); PyList_SET_ITEM(list, 0, PyFloat_FromDouble(vec[0])); @@ -175,9 +143,9 @@ PyObject* PyObjectFrom(const MT_Tuple4 &vec) PyObject* PyObjectFrom(const MT_Tuple3 &vec) { -#if 0 - return Py_BuildValue("[fff]", - vec[0], vec[1], vec[2]); +#ifdef USE_MATHUTILS + float fvec[3]= {vec[0], vec[1], vec[2]}; + return newVectorObject(fvec, 3, Py_WRAP); #else PyObject *list = PyList_New(3); PyList_SET_ITEM(list, 0, PyFloat_FromDouble(vec[0])); @@ -189,9 +157,9 @@ PyObject* PyObjectFrom(const MT_Tuple3 &vec) PyObject* PyObjectFrom(const MT_Tuple2 &vec) { -#if 0 - return Py_BuildValue("[ff]", - vec[0], vec[1]); +#ifdef USE_MATHUTILS + float fvec[2]= {vec[0], vec[1]}; + return newVectorObject(fvec, 2, Py_WRAP); #else PyObject *list = PyList_New(2); PyList_SET_ITEM(list, 0, PyFloat_FromDouble(vec[0])); diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h index a7ce4bc6930..90a13425aa0 100644 --- a/source/gameengine/Ketsji/KX_PyMath.h +++ b/source/gameengine/Ketsji/KX_PyMath.h @@ -31,6 +31,12 @@ #ifndef __KX_PYMATH_H__ #define __KX_PYMATH_H__ +#ifdef USE_MATHUTILS +extern "C" { +#include "../../blender/python/generic/Mathutils.h" /* so we can have mathutils callbacks */ +} +#endif + #include "MT_Point2.h" #include "MT_Point3.h" #include "MT_Vector2.h" @@ -98,7 +104,28 @@ bool PyMatTo(PyObject* pymat, T& mat) template bool PyVecTo(PyObject* pyval, T& vec) { - +#ifdef USE_MATHUTILS + /* no need for BaseMath_ReadCallback() here, reading the sequences will do this */ + + if(VectorObject_Check(pyval)) { + VectorObject *pyvec= (VectorObject *)pyval; + if (pyvec->size != Size(vec)) { + PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", pyvec->size, Size(vec)); + return false; + } + vec.getValue((float *) pyvec->vec); + return true; + } + else if(EulerObject_Check(pyval)) { + EulerObject *pyeul= (EulerObject *)pyval; + if (3 != Size(vec)) { + PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", 3, Size(vec)); + return false; + } + vec.getValue((float *) pyeul->eul); + return true; + } else +#endif if(PyTuple_Check(pyval)) { unsigned int numitems = PyTuple_GET_SIZE(pyval); @@ -186,10 +213,4 @@ PyObject* PyObjectFrom(const MT_Tuple3 &vec); */ PyObject* PyObjectFrom(const MT_Tuple4 &pos); -/** - * True if the given PyObject can be converted to an MT_Matrix - * @param rank = 3 (for MT_Matrix3x3) or 4 (for MT_Matrix4x4) - */ -bool PyObject_IsMT_Matrix(PyObject *pymat, unsigned int rank); - #endif diff --git a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp index 05cb818fdd9..d5d0fe3123c 100644 --- a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp +++ b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp @@ -235,7 +235,8 @@ void initPyTypes(void) #ifdef USE_MATHUTILS /* Init mathutils callbacks */ KX_GameObject_Mathutils_Callback_Init(); + KX_ObjectActuator_Mathutils_Callback_Init(); #endif } -#endif \ No newline at end of file +#endif -- cgit v1.2.3 From deffe4a315f30a8f8a2a2e2f23f16cfcb0ac5f18 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 25 Jun 2009 10:52:09 +0000 Subject: NLA SoC: Armature Drawing Code Fixes * Compiling broke for some users on this file due to my scaling-fixes commit. Dunno why this didn't give any errors here (silly compiler!) * Restored code to make ghost poses (and supposedly paths) work again. This doesn't totally seem to be the case yet though. --- source/blender/editors/space_view3d/drawarmature.c | 58 +++++++++------------- 1 file changed, 23 insertions(+), 35 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 68a9bf3f555..a4332ea1709 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -37,6 +37,7 @@ #include "MEM_guardedalloc.h" +#include "DNA_anim_types.h" #include "DNA_action_types.h" #include "DNA_armature_types.h" #include "DNA_constraint_types.h" @@ -52,6 +53,7 @@ #include "BLI_blenlib.h" #include "BLI_arithb.h" +#include "BKE_animsys.h" #include "BKE_action.h" #include "BKE_armature.h" #include "BKE_constraint.h" @@ -61,6 +63,7 @@ #include "BKE_global.h" #include "BKE_main.h" #include "BKE_modifier.h" +#include "BKE_nla.h" #include "BKE_object.h" #include "BKE_utildefines.h" @@ -2019,10 +2022,9 @@ static void draw_ebones(View3D *v3d, RegionView3D *rv3d, Object *ob, int dt) */ static void draw_pose_paths(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob) { + AnimData *adt= BKE_animdata_from_id(&ob->id); bArmature *arm= ob->data; bPoseChannel *pchan; - // bAction *act; // XXX old animsys - watch it! - // bActionChannel *achan; ActKeyColumn *ak; ListBase keys; float *fp, *fp_start; @@ -2168,14 +2170,11 @@ static void draw_pose_paths(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec /* build list of all keyframes in active action for pchan */ keys.first = keys.last = NULL; - #if 0 // XXX old animation system - act= ob->action; - if (act) { - achan= get_action_channel(act, pchan->name); - if (achan) - ipo_to_keylist(achan->ipo, &keys, NULL, NULL); + if (adt) { + bActionGroup *agrp= action_groups_find_named(adt->action, pchan->name); + if (agrp) + agroup_to_keylist(agrp, &keys, NULL, NULL); } - #endif // XXX old animation system /* Draw slightly-larger yellow dots at each keyframe */ UI_ThemeColor(TH_VERTEX_SELECT); @@ -2254,6 +2253,7 @@ static void ghost_poses_tag_unselected(Object *ob, short unset) static void draw_ghost_poses_range(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base) { Object *ob= base->object; + AnimData *adt= BKE_animdata_from_id(&ob->id); bArmature *arm= ob->data; bPose *posen, *poseo; float start, end, stepsize, range, colfac; @@ -2290,7 +2290,7 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, RegionView3D *rv3d colfac = (end - (float)CFRA) / range; UI_ThemeColorShadeAlpha(TH_WIRE, 0, -128-(int)(120.0*sqrt(colfac))); - //do_all_pose_actions(scene, ob); // XXX old animation system + BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL); where_is_pose(scene, ob); draw_pose_channels(scene, v3d, rv3d, base, OB_WIRE); } @@ -2315,7 +2315,8 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, RegionView3D *rv3d static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base) { Object *ob= base->object; - bAction *act= ob->action; // XXX old animsys stuff... watch it! + AnimData *adt= BKE_animdata_from_id(&ob->id); + bAction *act= (adt) ? adt->action : NULL; bArmature *arm= ob->data; bPose *posen, *poseo; ListBase keys= {NULL, NULL}; @@ -2366,7 +2367,7 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, RegionView3D *rv3d, CFRA= (int)ak->cfra; - //do_all_pose_actions(scene, ob); // XXX old animation system + BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL); where_is_pose(scene, ob); draw_pose_channels(scene, v3d, rv3d, base, OB_WIRE); } @@ -2391,38 +2392,27 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, RegionView3D *rv3d, static void draw_ghost_poses(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base) { Object *ob= base->object; + AnimData *adt= BKE_animdata_from_id(&ob->id); bArmature *arm= ob->data; bPose *posen, *poseo; - //bActionStrip *strip; float cur, start, end, stepsize, range, colfac, actframe, ctime; - int cfrao, maptime, flago; + int cfrao, flago; /* pre conditions, get an action with sufficient frames */ - //if (ob->action==NULL) - // return; + if ELEM(NULL, adt, adt->action) + return; - calc_action_range(ob->action, &start, &end, 0); + calc_action_range(adt->action, &start, &end, 0); if (start == end) return; stepsize= (float)(arm->ghostsize); range= (float)(arm->ghostep)*stepsize + 0.5f; /* plus half to make the for loop end correct */ -#if 0 // XXX old animation system - /* we only map time for armature when an active strip exists */ - for (strip=ob->nlastrips.first; strip; strip=strip->next) - if (strip->flag & ACTSTRIP_ACTIVE) - break; -#endif // XXX old animsys - - //maptime= (strip!=NULL); - maptime= 0; - /* store values */ ob->flag &= ~OB_POSEMODE; cfrao= CFRA; - if (maptime) actframe= get_action_frame(ob, (float)CFRA); - else actframe= (float)CFRA; + actframe= BKE_nla_tweakedit_remap(adt, (float)CFRA, 0); flago= arm->flag; arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES); @@ -2444,11 +2434,10 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base /* only within action range */ if (actframe+ctime >= start && actframe+ctime <= end) { - if (maptime) CFRA= (int)get_action_frame_inv(ob, actframe+ctime); - else CFRA= (int)floor(actframe+ctime); + CFRA= (int)BKE_nla_tweakedit_remap(adt, actframe+ctime, 1); if (CFRA != cfrao) { - //do_all_pose_actions(scene, ob); // xxx old animation system crap + BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL); where_is_pose(scene, ob); draw_pose_channels(scene, v3d, rv3d, base, OB_WIRE); } @@ -2460,11 +2449,10 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base /* only within action range */ if ((actframe-ctime >= start) && (actframe-ctime <= end)) { - if (maptime) CFRA= (int)get_action_frame_inv(ob, actframe-ctime); - else CFRA= (int)floor(actframe-ctime); + CFRA= (int)BKE_nla_tweakedit_remap(adt, actframe-ctime, 1); if (CFRA != cfrao) { - //do_all_pose_actions(scene, ob); // XXX old animation system crap... + BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL); where_is_pose(scene, ob); draw_pose_channels(scene, v3d, rv3d, base, OB_WIRE); } -- cgit v1.2.3 From 6510da4ce2c7d3ffef9d95d7adedd31f59c1fc4b Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 25 Jun 2009 12:30:49 +0000 Subject: NLA SoC: Fix transforms for transition strips. --- .../editors/transform/transform_conversions.c | 68 ++++++++++++---------- .../blender/editors/transform/transform_generics.c | 16 ++++- source/blender/makesrna/intern/rna_nla.c | 49 ++++++++++++---- 3 files changed, 88 insertions(+), 45 deletions(-) (limited to 'source') diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 08ce1b1d554..3bc950d5863 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2620,9 +2620,12 @@ static void createTransNlaData(bContext *C, TransInfo *t) /* only consider selected strips */ for (strip= nlt->strips.first; strip; strip= strip->next) { // TODO: we can make strips have handles later on... - if (strip->flag & NLASTRIP_FLAG_SELECT) { - if (FrameOnMouseSide(side, strip->start, (float)CFRA)) count++; - if (FrameOnMouseSide(side, strip->end, (float)CFRA)) count++; + /* transition strips can't get directly transformed */ + if (strip->type != NLASTRIP_TYPE_TRANSITION) { + if (strip->flag & NLASTRIP_FLAG_SELECT) { + if (FrameOnMouseSide(side, strip->start, (float)CFRA)) count++; + if (FrameOnMouseSide(side, strip->end, (float)CFRA)) count++; + } } } } @@ -2652,34 +2655,37 @@ static void createTransNlaData(bContext *C, TransInfo *t) /* only consider selected strips */ for (strip= nlt->strips.first; strip; strip= strip->next) { // TODO: we can make strips have handles later on... - if (strip->flag & NLASTRIP_FLAG_SELECT) { - if (FrameOnMouseSide(side, strip->start, (float)CFRA)) - { - /* init the 'extra' data for NLA strip handles first */ - tdn->strip= strip; - tdn->val= strip->start; - tdn->handle= 0; - - /* now, link the transform data up to this data */ - td->val= &tdn->val; - td->ival= tdn->val; - td->extra= tdn; - td++; - tdn++; - } - if (FrameOnMouseSide(side, strip->end, (float)CFRA)) - { - /* init the 'extra' data for NLA strip handles first */ - tdn->strip= strip; - tdn->val= strip->end; - tdn->handle= 1; - - /* now, link the transform data up to this data */ - td->val= &tdn->val; - td->ival= tdn->val; - td->extra= tdn; - td++; - tdn++; + /* transition strips can't get directly transformed */ + if (strip->type != NLASTRIP_TYPE_TRANSITION) { + if (strip->flag & NLASTRIP_FLAG_SELECT) { + if (FrameOnMouseSide(side, strip->start, (float)CFRA)) + { + /* init the 'extra' data for NLA strip handles first */ + tdn->strip= strip; + tdn->val= strip->start; + tdn->handle= 0; + + /* now, link the transform data up to this data */ + td->val= &tdn->val; + td->ival= tdn->val; + td->extra= tdn; + td++; + tdn++; + } + if (FrameOnMouseSide(side, strip->end, (float)CFRA)) + { + /* init the 'extra' data for NLA strip handles first */ + tdn->strip= strip; + tdn->val= strip->end; + tdn->handle= 1; + + /* now, link the transform data up to this data */ + td->val= &tdn->val; + td->ival= tdn->val; + td->extra= tdn; + td++; + tdn++; + } } } } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index db7c6d6ee99..1474a30fbed 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -358,11 +358,21 @@ void recalcData(TransInfo *t) * ones (i.e. don't go through RNA), as we get some artifacts... */ if (t->state == TRANS_CANCEL) { - /* write the value set by the transform tools to the appropriate property using RNA */ - if (tdn->handle) + /* clear the values by directly overwriting the originals, but also need to restore + * endpoints of neighboring transition-strips + */ + if (tdn->handle) { strip->end= tdn->val; - else + + if ((strip->next) && (strip->next->type == NLASTRIP_TYPE_TRANSITION)) + strip->next->start= tdn->val; + } + else { strip->start= tdn->val; + + if ((strip->prev) && (strip->prev->type == NLASTRIP_TYPE_TRANSITION)) + strip->prev->end= tdn->val; + } } else { PointerRNA strip_ptr; diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index dacd257dc17..84a84492ea3 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -40,17 +40,30 @@ #include #include +/* temp constant defined for these funcs only... */ +#define NLASTRIP_MIN_LEN_THRESH 0.1f + static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) { NlaStrip *data= (NlaStrip*)ptr->data; /* clamp value to lie within valid limits * - cannot start past the end of the strip + some flexibility threshold - * - cannot start before the previous strip (if present) ends + * - cannot start before the previous strip (if present) ends + * -> but if it was a transition, we could go up to the start of the strip + some flexibility threshold + * as long as we re-adjust the transition afterwards * - minimum frame is -MAXFRAME so that we don't get clipping on frame 0 */ if (data->prev) { - CLAMP(value, data->prev->end, data->end-0.1f); + if (data->prev->type == NLASTRIP_TYPE_TRANSITION) { + CLAMP(value, data->prev->start+NLASTRIP_MIN_LEN_THRESH, data->end-NLASTRIP_MIN_LEN_THRESH); + + /* readjust the transition to stick to the endpoints of the action-clips */ + data->prev->end= value; + } + else { + CLAMP(value, data->prev->end, data->end-NLASTRIP_MIN_LEN_THRESH); + } } else { CLAMP(value, -MAXFRAME, data->end); @@ -61,28 +74,42 @@ static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value) { NlaStrip *data= (NlaStrip*)ptr->data; - float len, actlen; /* clamp value to lie within valid limits * - must not have zero or negative length strip, so cannot start before the first frame * + some minimum-strip-length threshold * - cannot end later than the start of the next strip (if present) + * -> but if it was a transition, we could go up to the start of the end - some flexibility threshold + * as long as we re-adjust the transition afterwards */ if (data->next) { - CLAMP(value, data->start+0.1f, data->next->start); + if (data->next->type == NLASTRIP_TYPE_TRANSITION) { + CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, data->next->end-NLASTRIP_MIN_LEN_THRESH); + + /* readjust the transition to stick to the endpoints of the action-clips */ + data->next->start= value; + } + else { + CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, data->next->start); + } } else { - CLAMP(value, data->start+0.1f, MAXFRAME); + CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, MAXFRAME); } data->end= value; - /* calculate the lengths the strip and its action (if applicable) */ - len= data->end - data->start; - actlen= data->actend - data->actstart; - if (IS_EQ(actlen, 0.0f)) actlen= 1.0f; - /* now, adjust the 'scale' setting to reflect this (so that this change can be valid) */ - data->scale= len / ((actlen) * data->repeat); + /* calculate the lengths the strip and its action (if applicable) */ + if (data->type == NLASTRIP_TYPE_CLIP) { + float len, actlen; + + len= data->end - data->start; + actlen= data->actend - data->actstart; + if (IS_EQ(actlen, 0.0f)) actlen= 1.0f; + + /* now, adjust the 'scale' setting to reflect this (so that this change can be valid) */ + data->scale= len / ((actlen) * data->repeat); + } } static void rna_NlaStrip_scale_set(PointerRNA *ptr, float value) -- cgit v1.2.3 From 47ca543b32e74b67e5f8eb6265cc08f93018b002 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 25 Jun 2009 15:41:27 +0000 Subject: 2.5 Rendering preview icons is back! Note for Andrea: the render code has been decoupled from drawing, it needs Scene context to be able to run... At the moment only the search menu calls the new render code (which is the ID browse menu default anyway) --- source/blender/editors/include/ED_previewrender.h | 6 +- source/blender/editors/interface/interface_icons.c | 63 ++--- .../blender/editors/interface/interface_intern.h | 5 + .../editors/interface/interface_templates.c | 3 + source/blender/editors/preview/previewrender.c | 256 +++------------------ 5 files changed, 69 insertions(+), 264 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/ED_previewrender.h b/source/blender/editors/include/ED_previewrender.h index c74cb0f9958..10067510e53 100644 --- a/source/blender/editors/include/ED_previewrender.h +++ b/source/blender/editors/include/ED_previewrender.h @@ -29,17 +29,14 @@ struct View3D; struct SpaceButs; struct RenderInfo; +struct Scene; struct Image; -struct ScrArea; -struct uiBlock; struct Render; struct bContext; struct ID; #define PREVIEW_RENDERSIZE 140 -typedef void (*VectorDrawFunc)(int x, int y, int w, int h, float alpha); - /* stores rendered preview - is also used for icons */ typedef struct RenderInfo { int pr_rectx; @@ -74,6 +71,7 @@ void ED_preview_init_dbase(void); void ED_preview_free_dbase(void); void ED_preview_shader_job(const struct bContext *C, void *owner, struct ID *id, int sizex, int sizey); +void ED_preview_iconrender(struct Scene *scene, struct ID *id, int *rect, int sizex, int sizey); void ED_preview_draw(const struct bContext *C, void *idp, rcti *rect); diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index df069069a33..6b566012525 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -41,28 +41,30 @@ #include "BLI_blenlib.h" #include "BLI_storage_types.h" +#include "DNA_material_types.h" #include "DNA_screen_types.h" +#include "DNA_scene_types.h" #include "DNA_userdef_types.h" - -#include "BKE_utildefines.h" #include "BKE_image.h" #include "BKE_icons.h" +#include "BKE_utildefines.h" #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" #include "BIF_gl.h" #include "BIF_glutil.h" -#include "UI_interface.h" -#include "UI_interface_icons.h" -// XXX #include "BIF_previewrender.h" -// XXX #include "BIF_screen.h" +#include "ED_datafiles.h" +#include "ED_previewrender.h" +#include "UI_interface.h" +#include "UI_interface_icons.h" #include "UI_resources.h" /* elubie: should be removed once the enum for the ICONS is in BIF_preview_icons.h */ + #include "interface_intern.h" -#include "ED_datafiles.h" + #define ICON_IMAGE_W 600 #define ICON_IMAGE_H 640 @@ -650,7 +652,6 @@ void UI_icons_init(int first_dyn_id) init_internal_icons(); } -#if 0 static void icon_copy_rect(ImBuf *ibuf, unsigned int w, unsigned int h, unsigned int *rect) { struct ImBuf *ima; @@ -771,18 +772,14 @@ static void set_alpha(char* cp, int sizex, int sizey, char alpha) } } } -#endif /* only called when icon has changed */ /* only call with valid pointer from UI_icon_draw */ -static void icon_set_image(ID *id, DrawInfo *di, PreviewImage* prv_img, int miplevel) +static void icon_set_image(Scene *scene, ID *id, PreviewImage* prv_img, int miplevel) { -#if 0 // XXX - preview renders have to be redesigned - possibly low level op (elubie) RenderInfo ri; unsigned int pr_size = 0; - if (!di) return; - if (!prv_img) { printf("No preview image for this ID: %s\n", id->name); return; @@ -798,13 +795,12 @@ static void icon_set_image(ID *id, DrawInfo *di, PreviewImage* prv_img, int mipl ri.curtile= 0; ri.tottile= 0; - ri.rect = NULL; ri.pr_rectx = prv_img->w[miplevel]; ri.pr_recty = prv_img->h[miplevel]; - pr_size = ri.pr_rectx*ri.pr_recty*sizeof(unsigned int); + ri.rect = MEM_callocN(pr_size, "pr icon rect"); - BIF_previewrender(id, &ri, NULL, PR_ICON_RENDER); + ED_preview_iconrender(scene, id, ri.rect, ri.pr_rectx, ri.pr_recty); /* world is rendered with alpha=0, so it wasn't displayed this could be render option for sky to, for later */ @@ -818,15 +814,11 @@ static void icon_set_image(ID *id, DrawInfo *di, PreviewImage* prv_img, int mipl } } - if (ri.rect) { - memcpy(prv_img->rect[miplevel], ri.rect, pr_size); + memcpy(prv_img->rect[miplevel], ri.rect, pr_size); - /* and clean up */ - MEM_freeN(ri.rect); - ri.rect = 0; - } + /* and clean up */ + MEM_freeN(ri.rect); } -#endif } static void icon_draw_rect(float x, float y, int w, int h, float aspect, int rw, int rh, unsigned int *rect) @@ -912,14 +904,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, int mipl PreviewImage* pi = BKE_previewimg_get((ID*)icon->obj); if (pi) { - if (!nocreate && (pi->changed[miplevel] ||!pi->rect[miplevel])) /* changed only ever set by dynamic icons */ - { - // XXX waitcursor(1); - /* create the preview rect if necessary */ - icon_set_image((ID*)icon->obj, icon->drawinfo, pi, miplevel); - pi->changed[miplevel] = 0; - // XXX waitcursor(0); - } + /* no create icon on this level in code */ if (!pi->rect[miplevel]) return; /* something has gone wrong! */ @@ -928,6 +913,22 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, int mipl } } +void ui_id_icon_render(Scene *scene, ID *id) +{ + PreviewImage *pi = BKE_previewimg_get(id); + + if (pi) { + if ((pi->changed[0] ||!pi->rect[0])) /* changed only ever set by dynamic icons */ + { + /* create the preview rect if necessary */ + icon_set_image(scene, id, pi, 0); + pi->changed[0] = 0; + } + } +} + + + static void icon_draw_mipmap(float x, float y, int icon_id, float aspect, int miplevel, int nocreate) { int draw_size = preview_size(miplevel); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 379c11a6f31..c27eafd501c 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -44,6 +44,8 @@ struct uiStyle; struct uiWidgetColors; struct uiLayout; struct bContextStore; +struct Scene; +struct ID; /* ****************** general defines ************** */ @@ -425,6 +427,9 @@ void ui_draw_menu_item(struct uiFontStyle *fstyle, rcti *rect, char *name, int i /* interface_style.c */ void uiStyleInit(void); +/* interface_icons.c */ +void ui_id_icon_render(struct Scene *scene, struct ID *id); + /* resources.c */ void init_userdef_do_versions(void); void ui_theme_init_userdef(void); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index dd87ee15474..37b2a4af84e 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -46,6 +46,7 @@ #include "UI_interface.h" #include "UI_resources.h" +#include "interface_intern.h" void ui_template_fix_linking() { @@ -160,6 +161,8 @@ static void id_search_cb(const struct bContext *C, void *arg_litem, char *str, u case ID_WO: /* fall through */ case ID_LA: /* fall through */ iconid= BKE_icon_getid(id); + /* checks if not exists, or changed */ + ui_id_icon_render(CTX_data_scene(C), id); break; default: break; diff --git a/source/blender/editors/preview/previewrender.c b/source/blender/editors/preview/previewrender.c index 1ce20fcb0af..1efa5108b96 100644 --- a/source/blender/editors/preview/previewrender.c +++ b/source/blender/editors/preview/previewrender.c @@ -114,46 +114,12 @@ typedef struct ShaderPreview { ID *id; int sizex, sizey; + int *pr_rect; int pr_method; } ShaderPreview; -static void set_previewrect(ScrArea *sa, RenderInfo *ri) -{ - ARegion *ar= NULL; // XXX - rctf viewplane; - - BLI_init_rctf(&viewplane, PR_XMIN, PR_XMAX, PR_YMIN, PR_YMAX); - -// ui_graphics_to_window_rct(ar->win, &viewplane, &ri->disprect); - - /* correction for gla draw */ - BLI_translate_rcti(&ri->disprect, -ar->winrct.xmin, -ar->winrct.ymin); - - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - - glaDefine2DArea(&ar->winrct); - - ri->pr_rectx= (ri->disprect.xmax-ri->disprect.xmin); - ri->pr_recty= (ri->disprect.ymax-ri->disprect.ymin); -} - -static void end_previewrect(ARegion *ar) -{ - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - - // restore viewport / scissor which was set by glaDefine2DArea - glViewport(ar->winrct.xmin, ar->winrct.ymin, ar->winx, ar->winy); - glScissor(ar->winrct.xmin, ar->winrct.ymin, ar->winx, ar->winy); - -} /* unused now */ void draw_tex_crop(Tex *tex) @@ -438,196 +404,6 @@ static Scene *preview_prepare_scene(Scene *scene, int id_type, ShaderPreview *sp return NULL; } -void previewrender_progress(void *handle, RenderResult *rr, volatile rcti *renrect) -{ - SpaceButs *sbuts= NULL; // XXX - RenderLayer *rl; - RenderInfo *ri= sbuts->ri; - float ofsx, ofsy; - - if(renrect) return; - - rl= rr->layers.first; - - ofsx= ri->disprect.xmin + rr->tilerect.xmin; - ofsy= ri->disprect.ymin + rr->tilerect.ymin; - - glDrawBuffer(GL_FRONT); - glaDrawPixelsSafe_to32(ofsx, ofsy, rr->rectx, rr->recty, rr->rectx, rl->rectf); - bglFlush(); - glDrawBuffer(GL_BACK); -} - - -/* called by interface_icons.c, or by BIF_previewrender_buts or by nodes... */ -void BIF_previewrender(Scene *scene, struct ID *id, struct RenderInfo *ri, struct ScrArea *area, int pr_method) -{ - SpaceButs *sbuts= NULL; // XXX - Render *re; - RenderStats *rstats; - Scene *sce; - int oldx= ri->pr_rectx, oldy= ri->pr_recty; - char name [32]; - - if(ri->tottile && ri->curtile>=ri->tottile) return; - - /* check for return with a new event */ - if(pr_method!=PR_ICON_RENDER && qtest()) { -// if(area) -// addafterqueue(area->win, RENDERPREVIEW, 1); - return; - } - - /* get the stuff from the builtin preview dbase */ -// sce= preview_prepare_scene(scene, ri, GS(id->name), id, pr_method); - if(sce==NULL) return; - - /* set drawing conditions OK */ - if(area) { - sbuts= area->spacedata.first; /* needed for flag */ - - set_previewrect(area, ri); // uses UImat - - /* because preview render size can differs */ - if(ri->rect && (oldx!=ri->pr_rectx || oldy!=ri->pr_recty)) { - MEM_freeN(ri->rect); - ri->rect= NULL; - ri->curtile= 0; - } - } - -// XXX sprintf(name, "ButsPreview %d", area?area->win:0); - re= RE_GetRender(name); - - /* full refreshed render from first tile */ - if(re==NULL || ri->curtile==0) { - - re= RE_NewRender(name); - - /* handle cases */ - if(pr_method==PR_DRAW_RENDER) { -// RE_display_draw_cb(re, previewrender_progress); -// RE_test_break_cb(re, qtest); - sce->r.scemode |= R_NODE_PREVIEW; - if(sbuts->flag & SB_PRV_OSA) - sce->r.mode |= R_OSA; - sce->r.scemode &= ~R_NO_IMAGE_LOAD; - } - else if(pr_method==PR_DO_RENDER) { -// RE_test_break_cb(re, qtest); - sce->r.scemode |= R_NODE_PREVIEW; - sce->r.scemode &= ~R_NO_IMAGE_LOAD; - } - else { /* PR_ICON_RENDER */ - sce->r.scemode &= ~R_NODE_PREVIEW; - sce->r.scemode |= R_NO_IMAGE_LOAD; - } - - /* allocates render result */ - RE_InitState(re, NULL, &sce->r, ri->pr_rectx, ri->pr_recty, NULL); - - /* enforce preview image clear */ - if(GS(id->name)==ID_MA) { - Material *ma= (Material *)id; - ntreeClearPreview(ma->nodetree); - } - } - /* entire cycle for render engine */ - RE_SetCamera(re, sce->camera); - RE_Database_FromScene(re, sce, 1); - RE_TileProcessor(re, ri->curtile, 0); // actual render engine - RE_Database_Free(re); - - /* handle results */ - if(pr_method==PR_ICON_RENDER) { - if(ri->rect==NULL) - ri->rect= MEM_mallocN(sizeof(int)*ri->pr_rectx*ri->pr_recty, "BIF_previewrender"); - RE_ResultGet32(re, ri->rect); - } - else { - rstats= RE_GetStats(re); - - if(rstats->partsdone!=ri->curtile) { - if(ri->rect==NULL) - ri->rect= MEM_mallocN(sizeof(int)*ri->pr_rectx*ri->pr_recty, "BIF_previewrender"); - RE_ResultGet32(re, ri->rect); - } - - if(rstats->totpart==rstats->partsdone && rstats->partsdone) { - // allqueues - } - else { -// if(pr_method==PR_DRAW_RENDER && qtest()) -// addafterqueue(area->win, RENDERPREVIEW, 1); - } - - ri->curtile= rstats->partsdone; - ri->tottile= rstats->totpart; - } - - /* unassign the pointers, reset vars */ -// preview_prepare_scene(scene, ri, GS(id->name), NULL, 0); - -} - - -/* afterqueue call */ -void BIF_previewrender_buts(Scene *scene, SpaceButs *sbuts) -{ -// ScrArea *sa= NULL; // XXX - ARegion *ar= NULL; // XXX - uiBlock *block; - struct ID* id = 0; -// struct ID* idfrom = 0; - struct ID* idshow = 0; - Object *ob; - - if (!sbuts->ri) return; - - -// block= uiFindOpenPanelBlockName(&sa->uiblocks, "Preview"); - if(block==NULL) return; - - ob= ((scene->basact)? (scene->basact)->object: 0); - - /* we cant trust this global lockpoin.. for example with headerless window */ -// buttons_active_id(&id, &idfrom); - sbuts->lockpoin= id; - - if(sbuts->mainb==CONTEXT_SHADING) { - int tab= TAB_SHADING_MAT; // XXX sbuts->tab[CONTEXT_SHADING]; - - if(tab==TAB_SHADING_MAT) - idshow = sbuts->lockpoin; - else if(tab==TAB_SHADING_TEX) - idshow = sbuts->lockpoin; - else if(tab==TAB_SHADING_LAMP) { - if(ob && ob->type==OB_LAMP) idshow= ob->data; - } - else if(tab==TAB_SHADING_WORLD) - idshow = sbuts->lockpoin; - } - else if(sbuts->mainb==CONTEXT_OBJECT) { - if(ob && ob->type==OB_LAMP) idshow = ob->data; - } - - if (idshow) { - BKE_icon_changed(BKE_icon_getid(idshow)); -// uiPanelPush(block); -// BIF_previewrender(scene, idshow, sbuts->ri, sbuts->area, PR_DRAW_RENDER); -// uiPanelPop(block); - end_previewrect(ar); - } - else { - /* no active block to draw. But we do draw black if possible */ - if(sbuts->ri->rect) { - memset(sbuts->ri->rect, 0, sizeof(int)*sbuts->ri->pr_rectx*sbuts->ri->pr_recty); - sbuts->ri->tottile= 10000; -// addqueue(sa->win, REDRAW, 1); - } - return; - } -} /* new UI convention: draw is in pixel space already. */ /* uses ROUNDBOX button in block to get the rect */ @@ -1006,7 +782,7 @@ static void shader_preview_updatejob(void *spv) } -/* runs inside thread */ +/* runs inside thread for material, in foreground for icons */ static void shader_preview_startjob(void *customdata, short *stop, short *do_update) { ShaderPreview *sp= customdata; @@ -1064,9 +840,8 @@ static void shader_preview_startjob(void *customdata, short *stop, short *do_upd /* handle results */ if(sp->pr_method==PR_ICON_RENDER) { - //if(ri->rect==NULL) - // ri->rect= MEM_mallocN(sizeof(int)*ri->pr_rectx*ri->pr_recty, "BIF_previewrender"); - //RE_ResultGet32(re, ri->rect); + if(sp->pr_rect) + RE_ResultGet32(re, sp->pr_rect); } else { /* validate owner */ @@ -1113,6 +888,29 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, int sizex, in WM_jobs_callbacks(steve, shader_preview_startjob, NULL, shader_preview_updatejob); WM_jobs_start(CTX_wm_manager(C), steve); + + /* signal to rerender icon in menus */ + BKE_icon_changed(BKE_icon_getid(id)); } +/* rect should be allocated, sizex/sizy pixels, 32 bits */ +void ED_preview_iconrender(Scene *scene, ID *id, int *rect, int sizex, int sizey) +{ + ShaderPreview *sp= MEM_callocN(sizeof(ShaderPreview), "ShaderPreview"); + short stop=0, do_update=0; + + /* customdata for preview thread */ + sp->scene= scene; + sp->sizex= sizex; + sp->sizey= sizey; + sp->pr_method= PR_ICON_RENDER; + sp->pr_rect= rect; + sp->id = id; + + shader_preview_startjob(sp, &stop, &do_update); + + MEM_freeN(sp); +} + + -- cgit v1.2.3 From 4b914c7f75faa65a7d2a991b7904c18051d13a13 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 25 Jun 2009 20:47:41 +0000 Subject: Made Mathutils use radians rather then degrees. defining USE_MATHUTILS_DEG for testing existing scripts. Added conversion for BGE Quaternion WXYZ (Blender/C) -> XYZW (Moto C++). BGE Python API now uses WXYZ following mathutils (break script warning). --- source/blender/python/generic/Mathutils.c | 17 ++++++++++-- source/blender/python/generic/Mathutils.h | 2 ++ source/blender/python/generic/euler.c | 34 +++++++++++++++++++---- source/blender/python/generic/matrix.c | 8 +++++- source/blender/python/generic/quat.c | 29 ++++++++++++------- source/blender/python/generic/vector.c | 2 +- source/gameengine/Converter/BL_ActionActuator.cpp | 6 ++-- source/gameengine/Ketsji/KX_PyMath.cpp | 26 ++++++++++++++++- source/gameengine/Ketsji/KX_PyMath.h | 20 +++++++++++++ 9 files changed, 120 insertions(+), 24 deletions(-) (limited to 'source') diff --git a/source/blender/python/generic/Mathutils.c b/source/blender/python/generic/Mathutils.c index d7330ac46c0..ec94a48ddbd 100644 --- a/source/blender/python/generic/Mathutils.c +++ b/source/blender/python/generic/Mathutils.c @@ -275,8 +275,11 @@ static PyObject *M_Mathutils_AngleBetweenVecs(PyObject * self, PyObject * args) angleRads = (double)saacos(dot); +#ifdef USE_MATHUTILS_DEG return PyFloat_FromDouble(angleRads * (180/ Py_PI)); - +#else + return PyFloat_FromDouble(angleRads); +#endif AttributeError1: PyErr_SetString(PyExc_AttributeError, "Mathutils.AngleBetweenVecs(): expects (2) VECTOR objects of the same size\n"); return NULL; @@ -364,12 +367,19 @@ static PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args) PyErr_SetString(PyExc_TypeError, "Mathutils.RotationMatrix(): expected float int and optional string and vector\n"); return NULL; } - + +#ifdef USE_MATHUTILS_DEG /* Clamp to -360:360 */ while (angle<-360.0f) angle+=360.0; while (angle>360.0f) angle-=360.0; +#else + while (angle<-(Py_PI*2)) + angle+=(Py_PI*2); + while (angle>(Py_PI*2)) + angle-=(Py_PI*2); +#endif if(matSize != 2 && matSize != 3 && matSize != 4) { PyErr_SetString(PyExc_AttributeError, "Mathutils.RotationMatrix(): can only return a 2x2 3x3 or 4x4 matrix\n"); @@ -399,8 +409,11 @@ static PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args) return NULL; } +#ifdef USE_MATHUTILS_DEG //convert to radians angle = angle * (float) (Py_PI / 180); +#endif + if(axis == NULL && matSize == 2) { //2D rotation matrix mat[0] = (float) cos (angle); diff --git a/source/blender/python/generic/Mathutils.h b/source/blender/python/generic/Mathutils.h index d234ebf1452..6a4e28d6068 100644 --- a/source/blender/python/generic/Mathutils.h +++ b/source/blender/python/generic/Mathutils.h @@ -38,6 +38,8 @@ #include "quat.h" #include "euler.h" +/* #define USE_MATHUTILS_DEG - for backwards compat */ + /* Can cast different mathutils types to this, use for generic funcs */ typedef struct { diff --git a/source/blender/python/generic/euler.c b/source/blender/python/generic/euler.c index eb9358774e1..9041eb84a3d 100644 --- a/source/blender/python/generic/euler.c +++ b/source/blender/python/generic/euler.c @@ -70,7 +70,7 @@ static PyObject *Euler_new(PyObject * self, PyObject * args) PyObject *listObject = NULL; int size, i; - float eul[3], scalar; + float eul[3]; PyObject *e; size = PyTuple_GET_SIZE(args); @@ -102,15 +102,13 @@ static PyObject *Euler_new(PyObject * self, PyObject * args) return NULL; } - scalar= (float)PyFloat_AsDouble(e); + eul[i]= (float)PyFloat_AsDouble(e); Py_DECREF(e); - if(scalar==-1 && PyErr_Occurred()) { // parsed item is not a number + if(eul[i]==-1 && PyErr_Occurred()) { // parsed item is not a number PyErr_SetString(PyExc_TypeError, "Mathutils.Euler(): 3d numeric sequence expected\n"); return NULL; } - - eul[i]= scalar; } return newEulerObject(eul, Py_NEW); } @@ -126,10 +124,15 @@ static PyObject *Euler_ToQuat(EulerObject * self) if(!BaseMath_ReadCallback(self)) return NULL; +#ifdef USE_MATHUTILS_DEG for(x = 0; x < 3; x++) { eul[x] = self->eul[x] * ((float)Py_PI / 180); } EulToQuat(eul, quat); +#else + EulToQuat(self->eul, quat); +#endif + return newQuaternionObject(quat, Py_NEW); } //----------------------------Euler.toMatrix()--------------------- @@ -143,10 +146,14 @@ static PyObject *Euler_ToMatrix(EulerObject * self) if(!BaseMath_ReadCallback(self)) return NULL; +#ifdef USE_MATHUTILS_DEG for(x = 0; x < 3; x++) { eul[x] = self->eul[x] * ((float)Py_PI / 180); } EulToMat3(eul, (float (*)[3]) mat); +#else + EulToMat3(self->eul, (float (*)[3]) mat); +#endif return newMatrixObject(mat, 3, 3 , Py_NEW); } //----------------------------Euler.unique()----------------------- @@ -161,10 +168,12 @@ static PyObject *Euler_Unique(EulerObject * self) if(!BaseMath_ReadCallback(self)) return NULL; +#ifdef USE_MATHUTILS_DEG //radians heading = self->eul[0] * (float)Py_PI / 180; pitch = self->eul[1] * (float)Py_PI / 180; bank = self->eul[2] * (float)Py_PI / 180; +#endif //wrap heading in +180 / -180 pitch += Py_PI; @@ -195,10 +204,12 @@ static PyObject *Euler_Unique(EulerObject * self) heading -= (floor(heading * Opi2)) * pi2; heading -= Py_PI; +#ifdef USE_MATHUTILS_DEG //back to degrees self->eul[0] = (float)(heading * 180 / (float)Py_PI); self->eul[1] = (float)(pitch * 180 / (float)Py_PI); self->eul[2] = (float)(bank * 180 / (float)Py_PI); +#endif BaseMath_WriteCallback(self); Py_INCREF(self); @@ -237,16 +248,21 @@ static PyObject *Euler_Rotate(EulerObject * self, PyObject *args) if(!BaseMath_ReadCallback(self)) return NULL; +#ifdef USE_MATHUTILS_DEG //covert to radians angle *= ((float)Py_PI / 180); for(x = 0; x < 3; x++) { self->eul[x] *= ((float)Py_PI / 180); } +#endif euler_rot(self->eul, angle, *axis); + +#ifdef USE_MATHUTILS_DEG //convert back from radians for(x = 0; x < 3; x++) { self->eul[x] *= (180 / (float)Py_PI); } +#endif BaseMath_WriteCallback(self); Py_INCREF(self); @@ -266,17 +282,23 @@ static PyObject *Euler_MakeCompatible(EulerObject * self, EulerObject *value) if(!BaseMath_ReadCallback(self) || !BaseMath_ReadCallback(value)) return NULL; +#ifdef USE_MATHUTILS_DEG //covert to radians for(x = 0; x < 3; x++) { self->eul[x] = self->eul[x] * ((float)Py_PI / 180); eul_from_rad[x] = value->eul[x] * ((float)Py_PI / 180); } compatible_eul(self->eul, eul_from_rad); +#else + compatible_eul(self->eul, value->eul); +#endif + +#ifdef USE_MATHUTILS_DEG //convert back from radians for(x = 0; x < 3; x++) { self->eul[x] *= (180 / (float)Py_PI); } - +#endif BaseMath_WriteCallback(self); Py_INCREF(self); return (PyObject *)self; diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c index ef4f7280cdc..b546aa1226c 100644 --- a/source/blender/python/generic/matrix.c +++ b/source/blender/python/generic/matrix.c @@ -257,10 +257,14 @@ PyObject *Matrix_toEuler(MatrixObject * self, PyObject *args) if(eul_compat) { if(!BaseMath_ReadCallback(eul_compat)) return NULL; - + +#ifdef USE_MATHUTILS_DEG for(x = 0; x < 3; x++) { eul_compatf[x] = eul_compat->eul[x] * ((float)Py_PI / 180); } +#else + VECCOPY(eul_compatf, eul_compat->eul); +#endif } /*must be 3-4 cols, 3-4 rows, square matrix*/ @@ -278,10 +282,12 @@ PyObject *Matrix_toEuler(MatrixObject * self, PyObject *args) PyErr_SetString(PyExc_AttributeError, "Matrix.toEuler(): inappropriate matrix size - expects 3x3 or 4x4 matrix\n"); return NULL; } +#ifdef USE_MATHUTILS_DEG /*have to convert to degrees*/ for(x = 0; x < 3; x++) { eul[x] *= (float) (180 / Py_PI); } +#endif return newEulerObject(eul, Py_NEW); } /*---------------------------Matrix.resize4x4() ------------------*/ diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c index b1e9f4a1d31..e7413d38ee5 100644 --- a/source/blender/python/generic/quat.c +++ b/source/blender/python/generic/quat.c @@ -77,7 +77,7 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw { PyObject *listObject = NULL, *n, *q; int size, i; - float quat[4], scalar; + float quat[4]; double angle = 0.0f; size = PyTuple_GET_SIZE(args); @@ -151,19 +151,21 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw return NULL; } - scalar = PyFloat_AsDouble(q); + quat[i] = PyFloat_AsDouble(q); Py_DECREF(q); - if (scalar==-1 && PyErr_Occurred()) { + if (quat[i]==-1 && PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "Mathutils.Quaternion(): 4d numeric sequence expected or 3d vector and number\n"); return NULL; } - quat[i] = scalar; } if(size == 3) //calculate the quat based on axis/angle - AxisAngleToQuat(quat, quat, angle * (Py_PI / 180)); // TODO - 2.5 use radians, note using quat for src and target is ok here - +#ifdef USE_MATHUTILS_DEG + AxisAngleToQuat(quat, quat, angle * (Py_PI / 180)); +#else + AxisAngleToQuat(quat, quat, angle); +#endif return newQuaternionObject(quat, Py_NEW); } @@ -189,28 +191,33 @@ static PyObject *Quaternion_ToEuler(QuaternionObject * self, PyObject *args) if(!BaseMath_ReadCallback(eul_compat)) return NULL; + QuatToMat3(self->quat, mat); + +#ifdef USE_MATHUTILS_DEG for(x = 0; x < 3; x++) { eul_compatf[x] = eul_compat->eul[x] * ((float)Py_PI / 180); } - - QuatToMat3(self->quat, mat); Mat3ToCompatibleEul(mat, eul, eul_compatf); +#else + Mat3ToCompatibleEul(mat, eul, eul_compat->eul); +#endif } else { QuatToEul(self->quat, eul); } - +#ifdef USE_MATHUTILS_DEG for(x = 0; x < 3; x++) { eul[x] *= (180 / (float)Py_PI); } +#endif return newEulerObject(eul, Py_NEW); } //----------------------------Quaternion.toMatrix()------------------ //return the quat as a matrix static PyObject *Quaternion_ToMatrix(QuaternionObject * self) { - float mat[9] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}; + float mat[9]; /* all values are set */ if(!BaseMath_ReadCallback(self)) return NULL; @@ -662,7 +669,9 @@ static PyObject *Quaternion_getAngle( QuaternionObject * self, void *type ) { double ang = self->quat[0]; ang = 2 * (saacos(ang)); +#ifdef USE_MATHUTILS_DEG ang *= (180 / Py_PI); +#endif return PyFloat_FromDouble(ang); } diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index d68d3f41370..9ce0a7ca2f9 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -1771,7 +1771,7 @@ PyTypeObject vector_Type = { 0, /* ob_size */ #endif /* For printing, in format "." */ - "Blender Vector", /* char *tp_name; */ + "vector", /* char *tp_name; */ sizeof( VectorObject ), /* int tp_basicsize; */ 0, /* tp_itemsize; For allocation */ diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index c0d28d28bda..ce4311f57bf 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -962,9 +962,9 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, else { MT_Vector3 loc; MT_Vector3 size; - MT_Vector4 quat; + MT_Quaternion quat; - if (!PyVecTo(pyloc, loc) || !PyVecTo(pysize, size) || !PyVecTo(pyquat, quat)) + if (!PyVecTo(pyloc, loc) || !PyVecTo(pysize, size) || !PyQuatTo(pyquat, quat)) return NULL; // same as above @@ -977,7 +977,7 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, // for some reason loc.setValue(pchan->loc) fails pchan->loc[0]= loc[0]; pchan->loc[1]= loc[1]; pchan->loc[2]= loc[2]; pchan->size[0]= size[0]; pchan->size[1]= size[1]; pchan->size[2]= size[2]; - pchan->quat[0]= quat[0]; pchan->quat[1]= quat[1]; pchan->quat[2]= quat[2]; pchan->quat[3]= quat[3]; + pchan->quat[0]= quat[3]; pchan->quat[1]= quat[0]; pchan->quat[2]= quat[1]; pchan->quat[3]= quat[2]; /* notice xyzw -> wxyz is intentional */ } pchan->flag |= POSE_ROT|POSE_LOC|POSE_SIZE; diff --git a/source/gameengine/Ketsji/KX_PyMath.cpp b/source/gameengine/Ketsji/KX_PyMath.cpp index ee9fed5d30a..76cfb0e572d 100644 --- a/source/gameengine/Ketsji/KX_PyMath.cpp +++ b/source/gameengine/Ketsji/KX_PyMath.cpp @@ -53,7 +53,7 @@ bool PyOrientationTo(PyObject* pyval, MT_Matrix3x3 &rot, const char *error_prefi if (size == 4) { MT_Quaternion qrot; - if (PyVecTo(pyval, qrot)) + if (PyQuatTo(pyval, qrot)) { rot.setRotation(qrot); return true; @@ -79,6 +79,21 @@ bool PyOrientationTo(PyObject* pyval, MT_Matrix3x3 &rot, const char *error_prefi return false; } +bool PyQuatTo(PyObject* pyval, MT_Quaternion &qrot) +{ + if(!PyVecTo(pyval, qrot)) + return false; + + /* annoying!, Blender/Mathutils have the W axis first! */ + MT_Scalar w= qrot[0]; /* from python, this is actually the W */ + qrot[0]= qrot[1]; + qrot[1]= qrot[2]; + qrot[2]= qrot[3]; + qrot[3]= w; + + return true; +} + PyObject* PyObjectFrom(const MT_Matrix4x4 &mat) { #ifdef USE_MATHUTILS @@ -126,6 +141,15 @@ PyObject* PyObjectFrom(const MT_Matrix3x3 &mat) #endif } +#ifdef USE_MATHUTILS +PyObject* PyObjectFrom(const MT_Quaternion &qrot) +{ + /* NOTE, were re-ordering here for Mathutils compat */ + float fvec[4]= {qrot[3], qrot[0], qrot[1], qrot[2]}; + return newQuaternionObject(fvec, Py_WRAP); +} +#endif + PyObject* PyObjectFrom(const MT_Tuple4 &vec) { #ifdef USE_MATHUTILS diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h index 90a13425aa0..f37925bb0ab 100644 --- a/source/gameengine/Ketsji/KX_PyMath.h +++ b/source/gameengine/Ketsji/KX_PyMath.h @@ -116,6 +116,16 @@ bool PyVecTo(PyObject* pyval, T& vec) vec.getValue((float *) pyvec->vec); return true; } + else if(QuaternionObject_Check(pyval)) { + QuaternionObject *pyquat= (QuaternionObject *)pyval; + if (4 != Size(vec)) { + PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", 4, Size(vec)); + return false; + } + /* xyzw -> wxyz reordering is done by PyQuatTo */ + vec.getValue((float *) pyquat->quat); + return true; + } else if(EulerObject_Check(pyval)) { EulerObject *pyeul= (EulerObject *)pyval; if (3 != Size(vec)) { @@ -186,6 +196,9 @@ bool PyVecTo(PyObject* pyval, T& vec) return false; } + +bool PyQuatTo(PyObject* pyval, MT_Quaternion &qrot); + bool PyOrientationTo(PyObject* pyval, MT_Matrix3x3 &mat, const char *error_prefix); /** @@ -208,6 +221,13 @@ PyObject* PyObjectFrom(const MT_Tuple2 &vec); */ PyObject* PyObjectFrom(const MT_Tuple3 &vec); +#ifdef USE_MATHUTILS +/** + * Converts an MT_Quaternion to a python object. + */ +PyObject* PyObjectFrom(const MT_Quaternion &qrot); +#endif + /** * Converts an MT_Tuple4 to a python object. */ -- cgit v1.2.3 From 07e9c4ef2b221a245497d75336fd5ece12d98682 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 26 Jun 2009 12:55:46 +0000 Subject: 2.5 Makes toolbar region in 3d editor work correctly overlapping, also when area is subdivided in 4-split, and/or with properties region. --- source/blender/editors/screen/area.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 07d8fb370e6..535e99ccfef 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -259,14 +259,16 @@ static void region_scissor_winrct(ARegion *ar, rcti *winrct) while(ar->prev) { ar= ar->prev; - if(ar->flag & RGN_FLAG_HIDDEN); - else if(ar->alignment==RGN_OVERLAP_LEFT) { - winrct->xmin= ar->winrct.xmax + 1; - } - else if(ar->alignment==RGN_OVERLAP_RIGHT) { - winrct->xmax= ar->winrct.xmin - 1; + if(BLI_isect_rcti(winrct, &ar->winrct, NULL)) { + if(ar->flag & RGN_FLAG_HIDDEN); + else if(ar->alignment==RGN_OVERLAP_LEFT) { + winrct->xmin= ar->winrct.xmax + 1; + } + else if(ar->alignment==RGN_OVERLAP_RIGHT) { + winrct->xmax= ar->winrct.xmin - 1; + } + else break; } - else break; } } -- cgit v1.2.3 From 524b8614373df3e1eb212939f048a79b75450c28 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 26 Jun 2009 15:48:09 +0000 Subject: 2.5 Part one (of probably many :) of Operator review/validation. Nothing final nor defined, it's reseach :) - Added tool buttons in "Toolbar" (Tkey). Just four examples for objectmode, and six for mesh editmode. (Review in progress is operator internal state vs context, what do redo exactly, undo vs redo syncing, when op->invoke or not, etc. This has to be pinned down exactly and frozen asap) - On undo, clear redo-operator-stack for now (won't work) - Added call to better detect active/current view3d region. ED_view3d_context_rv3d(C) - Fixed some operators that missed correct redo (add-prim etc). Later more fun! --- source/blender/editors/include/ED_object.h | 1 + source/blender/editors/include/ED_view3d.h | 2 + source/blender/editors/interface/interface_panel.c | 2 +- source/blender/editors/mesh/editmesh_add.c | 2 +- source/blender/editors/mesh/editmesh_mods.c | 2 +- source/blender/editors/mesh/editmesh_tools.c | 6 +-- source/blender/editors/object/object_edit.c | 15 ++++--- source/blender/editors/space_view3d/space_view3d.c | 18 ++++++++ .../blender/editors/space_view3d/view3d_toolbar.c | 51 +++++++++++++++++++++- source/blender/editors/util/undo.c | 2 + source/blender/windowmanager/WM_api.h | 6 ++- source/blender/windowmanager/intern/wm.c | 12 +++++ 12 files changed, 104 insertions(+), 15 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index bfa819632c9..e4e4b1d0486 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -63,6 +63,7 @@ struct Base *ED_object_add_duplicate(struct Scene *scene, struct Base *base, int #define EM_FREEDATA 1 #define EM_FREEUNDO 2 #define EM_WAITCURSOR 4 +#define EM_DO_UNDO 8 void ED_object_exit_editmode(struct bContext *C, int flag); void ED_object_enter_editmode(struct bContext *C, int flag); diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 38e52a8f59c..b576299c1d0 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -132,6 +132,8 @@ int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, in /* modes */ void ED_view3d_exit_paint_modes(struct bContext *C); +/* get 3d region from context, also if mouse is in header or toolbar */ +struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C); #endif /* ED_VIEW3D_H */ diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 72076175ad5..06dc5d1e606 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -104,7 +104,7 @@ static int panel_aligned(ScrArea *sa, ARegion *ar) SpaceButs *sbuts= sa->spacedata.first; return sbuts->align; } - else if(ar->regiontype==RGN_TYPE_UI) + else if(ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS)) return BUT_VERTICAL; return 0; diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 57fb2c19c75..8483aee52f4 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -1276,7 +1276,7 @@ static float new_primitive_matrix(bContext *C, float primmat[][4]) Object *obedit= CTX_data_edit_object(C); Scene *scene = CTX_data_scene(C); View3D *v3d =CTX_wm_view3d(C); - RegionView3D *rv3d= CTX_wm_region_view3d(C); + RegionView3D *rv3d= ED_view3d_context_rv3d(C); float *curs, mat[3][3], vmat[3][3], cmat[3][3], imat[3][3]; Mat4One(primmat); diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 7e9fcb10984..70a0c6b82da 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -3242,7 +3242,7 @@ static int toggle_select_all_exec(bContext *C, wmOperator *op) void MESH_OT_select_all_toggle(wmOperatorType *ot) { /* identifiers */ - ot->name= "Select or Deselect All"; + ot->name= "Select/Deselect All"; ot->idname= "MESH_OT_select_all_toggle"; /* api callbacks */ diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index b26fded4fb6..dc9c8c6b6d2 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -787,7 +787,7 @@ static int extrude_repeat_mesh(bContext *C, wmOperator *op) Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - RegionView3D *rv3d = CTX_wm_region_view3d(C); + RegionView3D *rv3d = ED_view3d_context_rv3d(C); int steps = RNA_int_get(op->ptr,"steps"); @@ -949,7 +949,7 @@ static int spin_mesh_invoke(bContext *C, wmOperator *op, wmEvent *event) { Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); - RegionView3D *rv3d= CTX_wm_region_view3d(C); + RegionView3D *rv3d= ED_view3d_context_rv3d(C); RNA_float_set_array(op->ptr, "center", give_cursor(scene, v3d)); RNA_float_set_array(op->ptr, "axis", rv3d->viewinv[2]); @@ -1056,7 +1056,7 @@ static int screw_mesh_invoke(bContext *C, wmOperator *op, wmEvent *event) { Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); - RegionView3D *rv3d= CTX_wm_region_view3d(C); + RegionView3D *rv3d= ED_view3d_context_rv3d(C); RNA_float_set_array(op->ptr, "center", give_cursor(scene, v3d)); RNA_float_set_array(op->ptr, "axis", rv3d->viewinv[1]); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 7a75e3875ea..8102b1bfb9c 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -340,7 +340,7 @@ static int object_add_mesh_exec(bContext *C, wmOperator *op) if(obedit==NULL || obedit->type!=OB_MESH) { object_add_type(C, OB_MESH); - ED_object_enter_editmode(C, 0); + ED_object_enter_editmode(C, EM_DO_UNDO); newob = 1; } else DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); @@ -398,8 +398,8 @@ void OBJECT_OT_mesh_add(wmOperatorType *ot) ot->poll= ED_operator_scene_editable; - /* flags */ - ot->flag= 0; + /* flags: no register or undo, this operator calls operators */ + ot->flag= 0; //OPTYPE_REGISTER|OPTYPE_UNDO; RNA_def_enum(ot->srna, "type", prop_mesh_types, 0, "Primitive", ""); } @@ -1395,7 +1395,8 @@ static int parent_clear_exec(bContext *C, wmOperator *op) DAG_scene_sort(CTX_data_scene(C)); ED_anim_dag_flush_update(C); - + WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); + return OPERATOR_FINISHED; } @@ -2600,7 +2601,8 @@ static int parent_set_exec(bContext *C, wmOperator *op) CTX_DATA_END; DAG_scene_sort(CTX_data_scene(C)); - ED_anim_dag_flush_update(C); + ED_anim_dag_flush_update(C); + WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); return OPERATOR_FINISHED; } @@ -2648,7 +2650,7 @@ void OBJECT_OT_parent_set(wmOperatorType *ot) ot->poll= ED_operator_object_active; /* flags */ - ot->flag= 0; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; RNA_def_enum(ot->srna, "type", prop_make_parent_types, 0, "Type", ""); } @@ -3349,6 +3351,7 @@ void ED_object_enter_editmode(bContext *C, int flag) WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, scene); } + if(flag & EM_DO_UNDO) ED_undo_push(C, "Enter Editmode"); if(flag & EM_WAITCURSOR) waitcursor(0); } diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 2d6a57d5a34..625b1838951 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -122,6 +122,24 @@ ARegion *view3d_has_tools_region(ScrArea *sa) return arnew; } +/* ****************************************************** */ + +/* function to always find a regionview3d context inside 3D window */ +RegionView3D *ED_view3d_context_rv3d(bContext *C) +{ + RegionView3D *rv3d= CTX_wm_region_view3d(C); + + if(rv3d==NULL) { + ScrArea *sa =CTX_wm_area(C); + if(sa->spacetype==SPACE_VIEW3D) { + ARegion *ar; + for(ar= sa->regionbase.first; ar; ar= ar->next) + if(ar->regiontype==RGN_TYPE_WINDOW) + return ar->regiondata; + } + } + return rv3d; +} /* ******************** default callbacks for view3d space ***************** */ diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 15254ba505e..88af60ac0f4 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -134,7 +134,7 @@ static void view3d_panel_operator_redo(const bContext *C, Panel *pa) if(op==NULL) return; - if(op->type->poll && op->type->poll(C)==0) + if(op->type->poll && op->type->poll((bContext *)C)==0) return; uiBlockSetFunc(block, redo_cb, op, NULL); @@ -148,10 +148,59 @@ static void view3d_panel_operator_redo(const bContext *C, Panel *pa) uiDefAutoButsRNA(C, pa->layout, &ptr, 1); } +static void view3d_panel_tools(const bContext *C, Panel *pa) +{ + Object *obedit= CTX_data_edit_object(C); +// Object *obact = CTX_data_active_object(C); + uiLayout *col; + + if(obedit) { + if(obedit->type==OB_MESH) { + + // void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDProperty *properties, int context) + col= uiLayoutColumn(pa->layout, 1); + uiItemFullO(col, NULL, 0, "MESH_OT_delete", NULL, WM_OP_INVOKE_REGION_WIN); + + col= uiLayoutColumn(pa->layout, 1); + uiItemFullO(col, NULL, 0, "MESH_OT_subdivide", NULL, WM_OP_INVOKE_REGION_WIN); + + col= uiLayoutColumn(pa->layout, 1); + uiItemFullO(col, NULL, 0, "MESH_OT_primitive_monkey_add", NULL, WM_OP_INVOKE_REGION_WIN); + uiItemFullO(col, NULL, 0, "MESH_OT_primitive_uv_sphere_add", NULL, WM_OP_INVOKE_REGION_WIN); + + col= uiLayoutColumn(pa->layout, 1); + uiItemFullO(col, NULL, 0, "MESH_OT_select_all_toggle", NULL, WM_OP_INVOKE_REGION_WIN); + + col= uiLayoutColumn(pa->layout, 1); + uiItemFullO(col, NULL, 0, "MESH_OT_spin", NULL, WM_OP_INVOKE_REGION_WIN); + uiItemFullO(col, NULL, 0, "MESH_OT_screw", NULL, WM_OP_INVOKE_REGION_WIN); + + } + } + else { + + col= uiLayoutColumn(pa->layout, 1); + uiItemFullO(col, NULL, 0, "OBJECT_OT_delete", NULL, WM_OP_INVOKE_REGION_WIN); + uiItemFullO(col, NULL, 0, "OBJECT_OT_primitive_add", NULL, WM_OP_INVOKE_REGION_WIN); + + col= uiLayoutColumn(pa->layout, 1); + uiItemFullO(col, NULL, 0, "OBJECT_OT_parent_set", NULL, WM_OP_INVOKE_REGION_WIN); + uiItemFullO(col, NULL, 0, "OBJECT_OT_parent_clear", NULL, WM_OP_INVOKE_REGION_WIN); + + } +} + + void view3d_toolbar_register(ARegionType *art) { PanelType *pt; + pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel tools"); + strcpy(pt->idname, "VIEW3D_PT_tools"); + strcpy(pt->label, "Tools"); + pt->draw= view3d_panel_tools; + BLI_addtail(&art->paneltypes, pt); + pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel last operator"); strcpy(pt->idname, "VIEW3D_PT_last_operator"); strcpy(pt->label, "Last Operator"); diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 62ce76a7614..1d79c542fa9 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -183,6 +183,8 @@ void ED_undo_redo(bContext *C) static int ed_undo_exec(bContext *C, wmOperator *op) { + /* "last operator" should disappear, later we can tie ths with undo stack nicer */ + WM_operator_stack_clear(C); return ed_undo_step(C, 1); } static int ed_redo_exec(bContext *C, wmOperator *op) diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 7acb2921bec..92b71e9fff0 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -129,6 +129,8 @@ int WM_operator_redo_popup (struct bContext *C, struct wmOperator *op); /* operator api */ void WM_operator_free (struct wmOperator *op); +void WM_operator_stack_clear(struct bContext *C); + wmOperatorType *WM_operatortype_find(const char *idname); wmOperatorType *WM_operatortype_first(void); void WM_operatortype_append (void (*opfunc)(wmOperatorType*)); @@ -212,8 +214,8 @@ void WM_jobs_stop(struct wmWindowManager *wm, void *owner); void WM_jobs_stop_all(struct wmWindowManager *wm); /* clipboard */ -char *WM_clipboard_text_get(int selection); -void WM_clipboard_text_set(char *buf, int selection); +char *WM_clipboard_text_get(int selection); +void WM_clipboard_text_set(char *buf, int selection); #endif /* WM_API_H */ diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 37fdc9fa2c5..7dec14664ae 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -95,6 +95,18 @@ void wm_operator_register(wmWindowManager *wm, wmOperator *op) } +void WM_operator_stack_clear(bContext *C) +{ + wmWindowManager *wm= CTX_wm_manager(C); + wmOperator *op; + + while((op= wm->operators.first)) { + BLI_remlink(&wm->operators, op); + WM_operator_free(op); + } + +} + /* ****************************************** */ void wm_check(bContext *C) -- cgit v1.2.3 From 13d18c5f777710fc396adde64725ecc5ecee019b Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 27 Jun 2009 00:40:25 +0000 Subject: NLA SoC: Theme colours in old defaults files for NLA now get replaced with the nice new colours --- source/blender/editors/interface/resources.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 4b2d5af956d..2798f7a473f 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1075,19 +1075,6 @@ void init_userdef_do_versions(void) SETCOL(btheme->ttime.cframe, 0x60, 0xc0, 0x40, 255); } } - if ((G.main->versionfile < 245) || (G.main->versionfile == 245 && G.main->subversionfile < 11)) { - bTheme *btheme; - for (btheme= U.themes.first; btheme; btheme= btheme->next) { - /* these should all use the same color */ - SETCOL(btheme->tv3d.cframe, 0x60, 0xc0, 0x40, 255); - SETCOL(btheme->tipo.cframe, 0x60, 0xc0, 0x40, 255); - SETCOL(btheme->tact.cframe, 0x60, 0xc0, 0x40, 255); - SETCOL(btheme->tnla.cframe, 0x60, 0xc0, 0x40, 255); - SETCOL(btheme->tseq.cframe, 0x60, 0xc0, 0x40, 255); - SETCOL(btheme->tsnd.cframe, 0x60, 0xc0, 0x40, 255); - SETCOL(btheme->ttime.cframe, 0x60, 0xc0, 0x40, 255); - } - } if ((G.main->versionfile < 245) || (G.main->versionfile == 245 && G.main->subversionfile < 13)) { bTheme *btheme; for (btheme= U.themes.first; btheme; btheme= btheme->next) { @@ -1210,6 +1197,13 @@ void init_userdef_do_versions(void) /* Graph Editor - Group Channel color */ SETCOL(btheme->tipo.group, 79, 101, 73, 255); SETCOL(btheme->tipo.group_active, 135, 177, 125, 255); + + /* Nla Editor - (Object) Channel color */ + SETCOL(btheme->tnla.ds_channel, 82, 96, 110, 255); + SETCOL(btheme->tnla.ds_subchannel, 124, 137, 150, 255); + /* NLA Editor - New Strip colors */ + SETCOL(btheme->tnla.strip, 12, 10, 10, 128); + SETCOL(btheme->tnla.strip_select, 255, 140, 0, 255); } /* adjust grease-pencil distances */ -- cgit v1.2.3 From d839a9ae9ccbf17375e28cc92aa75a0cb4cf6b11 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 27 Jun 2009 01:10:39 +0000 Subject: RNA * Added support for passing collections to/from RNA functions, this is done using a ListBase of CollectionPointerLink, which is a standard ListBase link + PointerRNA. * Added editable active uv/vcol layer to Mesh. * Armature.bones now includes all bones, not only the ones without parents. * Modifier UV layer fields now are allowed to be empty, previously this would set the name during modifier evaluation if there was none. --- source/blender/blenkernel/intern/modifier.c | 26 +++++------ source/blender/makesrna/intern/makesrna.c | 11 ++++- source/blender/makesrna/intern/rna_access.c | 11 +++++ source/blender/makesrna/intern/rna_armature.c | 25 ++++++++++ source/blender/makesrna/intern/rna_constraint.c | 15 +++--- source/blender/makesrna/intern/rna_main.c | 2 +- source/blender/makesrna/intern/rna_mesh.c | 62 +++++++++++++++++++++++++ source/blender/python/intern/bpy_rna.c | 34 ++++++++++++-- 8 files changed, 158 insertions(+), 28 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index bf3d27cafbf..1a6f57e75c4 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -3543,7 +3543,7 @@ static void displaceModifier_updateDepgraph( } } -static void validate_layer_name(const CustomData *data, int type, char *name) +static void validate_layer_name(const CustomData *data, int type, char *name, char *outname) { int index = -1; @@ -3556,8 +3556,10 @@ static void validate_layer_name(const CustomData *data, int type, char *name) * deleted, so assign the active layer to name */ index = CustomData_get_active_layer_index(data, CD_MTFACE); - strcpy(name, data->layers[index].name); + strcpy(outname, data->layers[index].name); } + else + strcpy(outname, name); } static void get_texture_coords(DisplaceModifierData *dmd, Object *ob, @@ -3583,12 +3585,11 @@ static void get_texture_coords(DisplaceModifierData *dmd, Object *ob, char *done = MEM_callocN(sizeof(*done) * numVerts, "get_texture_coords done"); int numFaces = dm->getNumFaces(dm); + char uvname[32]; MTFace *tf; - validate_layer_name(&dm->faceData, CD_MTFACE, dmd->uvlayer_name); - - tf = CustomData_get_layer_named(&dm->faceData, CD_MTFACE, - dmd->uvlayer_name); + validate_layer_name(&dm->faceData, CD_MTFACE, dmd->uvlayer_name, uvname); + tf = CustomData_get_layer_named(&dm->faceData, CD_MTFACE, uvname); /* verts are given the UV from the first face that uses them */ for(i = 0, mf = mface; i < numFaces; ++i, ++mf, ++tf) { @@ -3884,6 +3885,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, Projector projectors[MOD_UVPROJECT_MAXPROJECTORS]; int num_projectors = 0; float aspect; + char uvname[32]; if(umd->aspecty != 0) aspect = umd->aspectx / umd->aspecty; else aspect = 1.0f; @@ -3898,12 +3900,11 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, if(!dm->getFaceDataArray(dm, CD_MTFACE)) return dm; /* make sure we're using an existing layer */ - validate_layer_name(&dm->faceData, CD_MTFACE, umd->uvlayer_name); + validate_layer_name(&dm->faceData, CD_MTFACE, umd->uvlayer_name, uvname); /* make sure we are not modifying the original UV layer */ tface = CustomData_duplicate_referenced_layer_named(&dm->faceData, - CD_MTFACE, - umd->uvlayer_name); + CD_MTFACE, uvname); numVerts = dm->getNumVerts(dm); @@ -5185,12 +5186,11 @@ static void wavemod_get_texture_coords(WaveModifierData *wmd, Object *ob, char *done = MEM_callocN(sizeof(*done) * numVerts, "get_texture_coords done"); int numFaces = dm->getNumFaces(dm); + char uvname[32]; MTFace *tf; - validate_layer_name(&dm->faceData, CD_MTFACE, wmd->uvlayer_name); - - tf = CustomData_get_layer_named(&dm->faceData, CD_MTFACE, - wmd->uvlayer_name); + validate_layer_name(&dm->faceData, CD_MTFACE, wmd->uvlayer_name, uvname); + tf = CustomData_get_layer_named(&dm->faceData, CD_MTFACE, uvname); /* verts are given the UV from the first face that uses them */ for(i = 0, mf = mface; i < numFaces; ++i, ++mf, ++tf) { diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index e7ca3fc5932..475db3955b6 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -248,8 +248,7 @@ static const char *rna_parameter_type_name(PropertyRNA *parm) return rna_find_dna_type((const char *)pparm->type); } case PROP_COLLECTION: { - CollectionPropertyRNA *cparm= (CollectionPropertyRNA*)parm; - return rna_find_dna_type((const char *)cparm->type); + return "ListBase"; } default: return ""; @@ -1116,9 +1115,11 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA funcname= rna_alloc_function_name(srna->identifier, func->identifier, "call"); + /* function definition */ fprintf(f, "void %s(bContext *C, ReportList *reports, PointerRNA *_ptr, ParameterList *_parms)", funcname); fprintf(f, "\n{\n"); + /* variable definitions */ if((func->flag & FUNC_NO_SELF)==0) { if(dsrna->dnaname) fprintf(f, "\tstruct %s *_self;\n", dsrna->dnaname); else fprintf(f, "\tstruct %s *_self;\n", srna->identifier); @@ -1135,6 +1136,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA fprintf(f, ";\n"); fprintf(f, "\t\n"); + /* assign self */ if((func->flag & FUNC_NO_SELF)==0) { if(dsrna->dnaname) fprintf(f, "\t_self= (struct %s *)_ptr->data;\n", dsrna->dnaname); else fprintf(f, "\t_self= (struct %s *)_ptr->data;\n", srna->identifier); @@ -1405,6 +1407,7 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA dsrna= rna_find_struct_def(srna); func= dfunc->func; + /* return type */ for(dparm= dfunc->cont.properties.first; dparm; dparm= dparm->next) { if(dparm->prop==func->ret) { if(dparm->prop->arraylength) @@ -1418,13 +1421,16 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA } } + /* void if nothing to return */ if(!dparm) fprintf(f, "void "); + /* function name */ fprintf(f, "%s(", dfunc->call); first= 1; + /* self, context and reports parameters */ if((func->flag & FUNC_NO_SELF)==0) { if(dsrna->dnaname) fprintf(f, "struct %s *_self", dsrna->dnaname); else fprintf(f, "struct %s *_self", srna->identifier); @@ -1443,6 +1449,7 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA fprintf(f, "ReportList *reports"); } + /* defined parameters */ for(dparm= dfunc->cont.properties.first; dparm; dparm= dparm->next) { if(dparm->prop==func->ret) continue; diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 66127ebc6df..7defb0676c6 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -2457,6 +2457,17 @@ ParameterList *RNA_parameter_list_create(PointerRNA *ptr, FunctionRNA *func) void RNA_parameter_list_free(ParameterList *parms) { + PropertyRNA *parm; + int tot; + + parm= parms->func->cont.properties.first; + for(tot= 0; parm; parm= parm->next) { + if(parm->type == PROP_COLLECTION) + BLI_freelistN((ListBase*)((char*)parms->data+tot)); + + tot+= rna_parameter_size(parm); + } + MEM_freeN(parms->data); parms->data= NULL; diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 0f437f8f1a8..caa970eff57 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -443,6 +443,30 @@ void rna_EditBone_tail_selected_set(PointerRNA *ptr, int value) else data->flag &= ~BONE_TIPSEL; } +static void rna_Armature_bones_next(CollectionPropertyIterator *iter) +{ + ListBaseIterator *internal= iter->internal; + Bone *bone= (Bone*)internal->link; + + if(bone->childbase.first) + internal->link= (Link*)bone->childbase.first; + else if(bone->next) + internal->link= (Link*)bone->next; + else { + internal->link= NULL; + + do { + bone= bone->parent; + if(bone && bone->next) { + internal->link= (Link*)bone->next; + break; + } + } while(bone); + } + + iter->valid= (internal->link != NULL); +} + #else static void rna_def_bone_common(StructRNA *srna, int editbone) @@ -660,6 +684,7 @@ void rna_def_armature(BlenderRNA *brna) /* Collections */ prop= RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "bonebase", NULL); + RNA_def_property_collection_funcs(prop, 0, "rna_Armature_bones_next", 0, 0, 0, 0, 0, 0, 0); RNA_def_property_struct_type(prop, "Bone"); RNA_def_property_ui_text(prop, "Bones", ""); diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 80c145911b1..8200a21f4ac 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -534,6 +534,14 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna) srna= RNA_def_struct(brna, "CopyLocationConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copies the location of the target."); + + RNA_def_struct_sdna(srna, "bConstraint"); + + prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_PERCENTAGE); + RNA_def_property_float_sdna(prop, NULL, "headtail"); + RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1."); + RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_struct_sdna_from(srna, "bLocateLikeConstraint", "data"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); @@ -582,13 +590,6 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_OFFSET); RNA_def_property_ui_text(prop, "Offset", "Add original location into copied location."); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); - - RNA_def_struct_sdna(srna, "bConstraint"); - - prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_PERCENTAGE); - RNA_def_property_float_sdna(prop, NULL, "headtail"); - RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1."); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_minmax(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 8d98036290a..26fc3c2941e 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -264,7 +264,7 @@ void RNA_def_main(BlenderRNA *brna) { prop= RNA_def_property(srna, lists[i][0], PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, lists[i][1]); - RNA_def_property_collection_funcs(prop, lists[i][2], "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, "add_mesh", "remove_mesh"); + RNA_def_property_collection_funcs(prop, lists[i][2], "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0, 0); RNA_def_property_ui_text(prop, lists[i][3], lists[i][4]); } diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index da90b9f4c76..e56760f5ca3 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -234,6 +234,29 @@ static int rna_Mesh_uv_layers_length(PointerRNA *ptr) return rna_CustomDataLayer_length(ptr, CD_MTFACE); } +static PointerRNA rna_Mesh_active_uv_layer_get(PointerRNA *ptr) +{ + Mesh *me= (Mesh*)ptr->data; + int index= CustomData_get_active_layer_index(&me->fdata, CD_MTFACE); + CustomDataLayer *cdl= (index == -1)? NULL: &me->fdata.layers[index]; + + return rna_pointer_inherit_refine(ptr, &RNA_MeshTextureFaceLayer, cdl); +} + +static void rna_Mesh_active_uv_layer_set(PointerRNA *ptr, PointerRNA value) +{ + Mesh *me= (Mesh*)ptr->data; + CustomDataLayer *cdl; + int a; + + for(cdl=me->fdata.layers, a=0; afdata.totlayer; cdl++, a++) { + if(value.data == cdl) { + CustomData_set_layer_active_index(&me->fdata, CD_MTFACE, a); + return; + } + } +} + static void rna_MeshTextureFace_uv1_get(PointerRNA *ptr, float *values) { MTFace *mtface= (MTFace*)ptr->data; @@ -348,6 +371,29 @@ static int rna_Mesh_vcol_layers_length(PointerRNA *ptr) return rna_CustomDataLayer_length(ptr, CD_MCOL); } +static PointerRNA rna_Mesh_active_vcol_layer_get(PointerRNA *ptr) +{ + Mesh *me= (Mesh*)ptr->data; + int index= CustomData_get_active_layer_index(&me->fdata, CD_MCOL); + CustomDataLayer *cdl= (index == -1)? NULL: &me->fdata.layers[index]; + + return rna_pointer_inherit_refine(ptr, &RNA_MeshColorLayer, cdl); +} + +static void rna_Mesh_active_vcol_layer_set(PointerRNA *ptr, PointerRNA value) +{ + Mesh *me= (Mesh*)ptr->data; + CustomDataLayer *cdl; + int a; + + for(cdl=me->fdata.layers, a=0; afdata.totlayer; cdl++, a++) { + if(value.data == cdl) { + CustomData_set_layer_active_index(&me->fdata, CD_MCOL, a); + return; + } + } +} + static void rna_MeshColorLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->id.data; @@ -1075,18 +1121,34 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_struct_type(prop, "MeshSticky"); RNA_def_property_ui_text(prop, "Sticky", "Sticky texture coordinates."); + /* UV layers */ + prop= RNA_def_property(srna, "uv_layers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_layers_begin", 0, 0, 0, "rna_Mesh_uv_layers_length", 0, 0, 0, 0); RNA_def_property_struct_type(prop, "MeshTextureFaceLayer"); RNA_def_property_ui_text(prop, "UV Layers", ""); + prop= RNA_def_property(srna, "active_uv_layer", PROP_POINTER, PROP_UNSIGNED); + RNA_def_property_struct_type(prop, "MeshTextureFaceLayer"); + RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_uv_layer_get", "rna_Mesh_active_uv_layer_set", NULL); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Active UV Layer", "Active UV layer."); + + /* VCol layers */ + prop= RNA_def_property(srna, "vcol_layers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); RNA_def_property_collection_funcs(prop, "rna_Mesh_vcol_layers_begin", 0, 0, 0, "rna_Mesh_vcol_layers_length", 0, 0, 0, 0); RNA_def_property_struct_type(prop, "MeshColorLayer"); RNA_def_property_ui_text(prop, "Vertex Color Layers", ""); + prop= RNA_def_property(srna, "active_vcol_layer", PROP_POINTER, PROP_UNSIGNED); + RNA_def_property_struct_type(prop, "MeshColorLayer"); + RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_vcol_layer_get", "rna_Mesh_active_vcol_layer_set", NULL); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Active Vertex Color Layer", "Active vertex color layer."); + prop= RNA_def_property(srna, "float_layers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", 0, 0, 0, "rna_Mesh_float_layers_length", 0, 0, 0, 0); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 0b8a7df1ae1..558722cc5e6 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -269,6 +269,8 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop) ret= quat_cb; /* return the matrix instead */ } break; + default: + break; } } @@ -677,6 +679,10 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v int seq_len, i; PyObject *item; PointerRNA itemptr; + ListBase *lb; + CollectionPointerLink *link; + + lb= (data)? (ListBase*)data: NULL; /* convert a sequence of dict's into a collection */ if(!PySequence_Check(value)) { @@ -692,8 +698,15 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v Py_XDECREF(item); return -1; } - - RNA_property_collection_add(ptr, prop, &itemptr); + + if(lb) { + link= MEM_callocN(sizeof(CollectionPointerLink), "PyCollectionPointerLink"); + link->ptr= itemptr; + BLI_addtail(lb, link); + } + else + RNA_property_collection_add(ptr, prop, &itemptr); + if(pyrna_pydict_to_props(&itemptr, item, "Converting a python list to an RNA collection")==-1) { Py_DECREF(item); return -1; @@ -1380,10 +1393,21 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data) break; } case PROP_COLLECTION: - /* XXX not supported yet - * ret = pyrna_prop_CreatePyObject(ptr, prop); */ - ret = NULL; + { + ListBase *lb= (ListBase*)data; + CollectionPointerLink *link; + PyObject *linkptr; + + ret = PyList_New(0); + + for(link=lb->first; link; link=link->next) { + linkptr= pyrna_struct_CreatePyObject(&link->ptr); + PyList_Append(ret, linkptr); + Py_DECREF(linkptr); + } + break; + } default: PyErr_Format(PyExc_AttributeError, "RNA Error: unknown type \"%d\" (pyrna_param_to_py)", type); ret = NULL; -- cgit v1.2.3 From 222fe6b1a5d49f67177cbb762f55a0e482145f5d Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 27 Jun 2009 01:15:31 +0000 Subject: UI * Search popup + autocomplete for bones, vertex groups, etc. This is done with layout.item_pointerR, specifying an RNA collection to take the items from. Used by constraints and modifiers. * Some tests with the List template, ignore those for now.. --- source/blender/editors/include/UI_interface.h | 5 +- source/blender/editors/interface/interface.c | 88 +---- .../blender/editors/interface/interface_handlers.c | 26 +- source/blender/editors/interface/interface_icons.c | 21 ++ .../blender/editors/interface/interface_intern.h | 8 +- .../blender/editors/interface/interface_layout.c | 150 +++++++- .../blender/editors/interface/interface_regions.c | 29 +- .../editors/interface/interface_templates.c | 383 +++++++++++---------- source/blender/editors/interface/interface_utils.c | 7 +- source/blender/makesrna/intern/rna_ui_api.c | 17 +- 10 files changed, 451 insertions(+), 283 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index f5e2b45d41e..b6d71759373 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -609,7 +609,7 @@ uiBlock *uiLayoutFreeBlock(uiLayout *layout); /* templates */ void uiTemplateHeader(uiLayout *layout, struct bContext *C); void uiTemplateID(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, - char *newop, char *openop, char *unlinkop); + char *newop, char *unlinkop); uiLayout *uiTemplateModifier(uiLayout *layout, struct PointerRNA *ptr); uiLayout *uiTemplateConstraint(uiLayout *layout, struct PointerRNA *ptr); void uiTemplatePreview(uiLayout *layout, struct ID *id); @@ -617,7 +617,7 @@ void uiTemplateColorRamp(uiLayout *layout, struct ColorBand *coba, int expand); void uiTemplateCurveMapping(uiLayout *layout, struct CurveMapping *cumap, int type); void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, char *propname); void uiTemplateImageLayers(uiLayout *layout, struct bContext *C, struct Image *ima, struct ImageUser *iuser); -void uiTemplateList(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *activeprop, int items); +ListBase uiTemplateList(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *activeprop, int rows, int columns, int compact); /* items */ void uiItemO(uiLayout *layout, char *name, int icon, char *opname); @@ -634,6 +634,7 @@ void uiItemR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, cha void uiItemFullR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int expand, int slider, int toggle); void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int value); void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname); +void uiItemPointerR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname); void uiItemL(uiLayout *layout, char *name, int icon); /* label */ void uiItemM(uiLayout *layout, struct bContext *C, char *name, int icon, char *menuname); /* menu */ diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 73425eac0e1..3a61237e1cb 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -80,7 +80,6 @@ */ static void ui_free_but(const bContext *C, uiBut *but); -static void ui_rna_ID_autocomplete(bContext *C, char *str, void *arg_but); /* ************* translation ************** */ @@ -1334,61 +1333,6 @@ void ui_get_but_string(uiBut *but, char *str, int maxlen) } } -static void ui_rna_ID_collection(bContext *C, uiBut *but, PointerRNA *ptr, PropertyRNA **prop) -{ - StructRNA *srna; - - /* look for collection property in Main */ - RNA_pointer_create(NULL, &RNA_Main, CTX_data_main(C), ptr); - - *prop= NULL; - - RNA_STRUCT_BEGIN(ptr, iprop) { - /* if it's a collection and has same pointer type, we've got it */ - if(RNA_property_type(iprop) == PROP_COLLECTION) { - srna= RNA_property_pointer_type(ptr, iprop); - - if(RNA_property_pointer_type(ptr, but->rnaprop) == srna) { - *prop= iprop; - break; - } - } - } - RNA_STRUCT_END; -} - -/* autocomplete callback for RNA pointers */ -static void ui_rna_ID_autocomplete(bContext *C, char *str, void *arg_but) -{ - uiBut *but= arg_but; - AutoComplete *autocpl; - PointerRNA ptr; - PropertyRNA *prop; - char *name; - - if(str[0]==0) return; - - /* get the collection */ - ui_rna_ID_collection(C, but, &ptr, &prop); - if(prop==NULL) return; - - autocpl= autocomplete_begin(str, ui_get_but_string_max_length(but)); - - /* loop over items in collection */ - RNA_PROP_BEGIN(&ptr, itemptr, prop) { - name= RNA_struct_name_get_alloc(&itemptr, NULL, 0); - - /* test item name */ - if(name) { - autocomplete_do_name(autocpl, name); - MEM_freeN(name); - } - } - RNA_PROP_END; - - autocomplete_end(autocpl, str); -} - int ui_set_but_string(bContext *C, uiBut *but, const char *str) { if(but->rnaprop && ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) { @@ -1407,21 +1351,21 @@ int ui_set_but_string(bContext *C, uiBut *but, const char *str) PointerRNA ptr, rptr; PropertyRNA *prop; - /* XXX only ID pointers at the moment, needs to support - * custom collection too for bones, vertex groups, .. */ - ui_rna_ID_collection(C, but, &ptr, &prop); - if(str == NULL || str[0] == '\0') { - memset(&rptr, 0, sizeof(rptr)); - RNA_property_pointer_set(&but->rnapoin, but->rnaprop, rptr); + RNA_property_pointer_set(&but->rnapoin, but->rnaprop, PointerRNA_NULL); return 1; } - else if(prop && RNA_property_collection_lookup_string(&ptr, prop, str, &rptr)) { - RNA_property_pointer_set(&but->rnapoin, but->rnaprop, rptr); + else { + ptr= but->rnasearchpoin; + prop= but->rnasearchprop; + + if(prop && RNA_property_collection_lookup_string(&ptr, prop, str, &rptr)) + RNA_property_pointer_set(&but->rnapoin, but->rnaprop, rptr); + return 1; } - else - return 0; + + return 0; } } } @@ -2133,7 +2077,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short rgb_to_hsv(rgb[0], rgb[1], rgb[2], but->hsv, but->hsv+1, but->hsv+2); } - if((block->flag & UI_BLOCK_LOOP) || ELEM6(but->type, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM)) { + if((block->flag & UI_BLOCK_LOOP) || ELEM7(but->type, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM, SEARCH_MENU)) { but->flag |= UI_TEXT_LEFT; } @@ -2289,10 +2233,6 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, but->rnaindex= index; else but->rnaindex= 0; - - if(type == IDPOIN) - uiButSetCompleteFunc(but, ui_rna_ID_autocomplete, but); - } if(icon) { @@ -2408,7 +2348,11 @@ void autocomplete_do_name(AutoComplete *autocpl, const char *name) else { /* remove from truncate what is not in bone->name */ for(a=0; amaxlen-1; a++) { - if(truncate[a]!=name[a]) + if(name[a] == 0) { + truncate[a]= 0; + break; + } + else if(truncate[a]!=name[a]) truncate[a]= 0; } } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 2382af53a11..5049fc0b130 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1223,8 +1223,14 @@ static int ui_textedit_autocomplete(bContext *C, uiBut *but, uiHandleButtonData int changed= 1; str= data->str; - but->autocomplete_func(C, str, but->autofunc_arg); + + if(data->searchbox) + ui_searchbox_autocomplete(C, data->searchbox, but, data->str); + else + but->autocomplete_func(C, str, but->autofunc_arg); + but->pos= strlen(str); + but->selsta= but->selend= but->pos; return changed; } @@ -1351,14 +1357,14 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa return; for(but= actbut->next; but; but= but->next) { - if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) { + if(ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) { data->postbut= but; data->posttype= BUTTON_ACTIVATE_TEXT_EDITING; return; } } for(but= block->buttons.first; but!=actbut; but= but->next) { - if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) { + if(ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) { data->postbut= but; data->posttype= BUTTON_ACTIVATE_TEXT_EDITING; return; @@ -1375,14 +1381,14 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa return; for(but= actbut->prev; but; but= but->prev) { - if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) { + if(ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) { data->postbut= but; data->posttype= BUTTON_ACTIVATE_TEXT_EDITING; return; } } for(but= block->buttons.last; but!=actbut; but= but->prev) { - if(ELEM5(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI)) { + if(ELEM7(but->type, TEX, NUM, NUMABS, NUMSLI, HSVSLI, IDPOIN, SEARCH_MENU)) { data->postbut= but; data->posttype= BUTTON_ACTIVATE_TEXT_EDITING; return; @@ -1506,7 +1512,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle case TABKEY: /* there is a key conflict here, we can't tab with autocomplete */ - if(but->autocomplete_func) { + if(but->autocomplete_func || data->searchbox) { changed= ui_textedit_autocomplete(C, but, data); retval= WM_UI_HANDLER_BREAK; } @@ -4103,7 +4109,7 @@ static int ui_handle_menu_return_submenu(bContext *C, wmEvent *event, uiPopupBlo uiBlock *block; uiHandleButtonData *data; uiPopupBlockHandle *submenu; - int mx, my; + int mx, my, update; ar= menu->region; block= ar->uiblocks.first; @@ -4121,14 +4127,16 @@ static int ui_handle_menu_return_submenu(bContext *C, wmEvent *event, uiPopupBlo menu->butretval= data->retval; } } - else if(submenu->menuretval == UI_RETURN_UPDATE) + + update= (submenu->menuretval == UI_RETURN_UPDATE); + if(update) menu->menuretval = UI_RETURN_UPDATE; /* now let activated button in this menu exit, which * will actually close the submenu too */ ui_handle_button_return_submenu(C, event, but); - if(submenu->menuretval == UI_RETURN_UPDATE) + if(update) submenu->menuretval = 0; } diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 6b566012525..4d8ec5996be 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -927,7 +927,28 @@ void ui_id_icon_render(Scene *scene, ID *id) } } +int ui_id_icon_get(Scene *scene, ID *id) +{ + int iconid= 0; + + /* icon */ + switch(GS(id->name)) + { + case ID_MA: /* fall through */ + case ID_TE: /* fall through */ + case ID_IM: /* fall through */ + case ID_WO: /* fall through */ + case ID_LA: /* fall through */ + iconid= BKE_icon_getid(id); + /* checks if not exists, or changed */ + ui_id_icon_render(scene, id); + break; + default: + break; + } + return iconid; +} static void icon_draw_mipmap(float x, float y, int icon_id, float aspect, int miplevel, int nocreate) { diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index c27eafd501c..1b16155c7e6 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -211,6 +211,9 @@ struct uiBut { struct PropertyRNA *rnaprop; int rnaindex; + struct PointerRNA rnasearchpoin; + struct PropertyRNA *rnasearchprop; + /* Operator data */ struct wmOperatorType *optype; int opcontext; @@ -371,6 +374,7 @@ void ui_tooltip_free(struct bContext *C, struct ARegion *ar); ARegion *ui_searchbox_create(struct bContext *C, struct ARegion *butregion, uiBut *but); int ui_searchbox_inside(struct ARegion *ar, int x, int y); void ui_searchbox_update(struct bContext *C, struct ARegion *ar, uiBut *but, int reset); +void ui_searchbox_autocomplete(struct bContext *C, struct ARegion *ar, uiBut *but, char *str); void ui_searchbox_event(struct bContext *C, struct ARegion *ar, uiBut *but, struct wmEvent *event); void ui_searchbox_apply(uiBut *but, struct ARegion *ar); void ui_searchbox_free(struct bContext *C, struct ARegion *ar); @@ -429,6 +433,7 @@ void uiStyleInit(void); /* interface_icons.c */ void ui_id_icon_render(struct Scene *scene, struct ID *id); +int ui_id_icon_get(struct Scene *scene, struct ID *id); /* resources.c */ void init_userdef_do_versions(void); @@ -437,8 +442,9 @@ void ui_resources_init(void); void ui_resources_free(void); /* interface_layout.c */ -void ui_layout_add_but(struct uiLayout *layout, uiBut *but); +void ui_layout_add_but(uiLayout *layout, uiBut *but); int ui_but_can_align(uiBut *but); +void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRNA *searchptr, PropertyRNA *searchprop); /* interface_anim.c */ void ui_but_anim_flag(uiBut *but, float cfra); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 03da6861974..94280ec37d3 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -455,9 +455,10 @@ static void ui_item_enum_row(uiLayout *layout, uiBlock *block, PointerRNA *ptr, } /* create label + button for RNA property */ -static void ui_item_with_label(uiLayout *layout, uiBlock *block, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int x, int y, int w, int h) +static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int x, int y, int w, int h) { uiLayout *sub; + uiBut *but; PropertySubType subtype; sub= uiLayoutRow(layout, 0); @@ -473,12 +474,13 @@ static void ui_item_with_label(uiLayout *layout, uiBlock *block, char *name, int if(subtype == PROP_FILEPATH || subtype == PROP_DIRPATH) { uiBlockSetCurLayout(block, uiLayoutRow(sub, 1)); uiDefAutoButR(block, ptr, prop, index, "", icon, x, y, w-UI_UNIT_X, h); - uiDefIconBut(block, BUT, 0, ICON_FILESEL, x, y, UI_UNIT_X, h, NULL, 0.0f, 0.0f, 0.0f, 0.0f, "DUMMY file select button"); /* XXX */ + but= uiDefIconBut(block, BUT, 0, ICON_FILESEL, x, y, UI_UNIT_X, h, NULL, 0.0f, 0.0f, 0.0f, 0.0f, "DUMMY file select button"); /* XXX */ } else - uiDefAutoButR(block, ptr, prop, index, "", icon, x, y, w, h); + but= uiDefAutoButR(block, ptr, prop, index, "", icon, x, y, w, h); uiBlockSetCurLayout(block, layout); + return but; } /********************* Button Items *************************/ @@ -782,8 +784,10 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper else if(type == PROP_ENUM && expand) ui_item_enum_row(layout, block, ptr, prop, name, 0, 0, w, h); /* property with separate label */ - else if(type == PROP_ENUM || type == PROP_STRING || type == PROP_POINTER) - ui_item_with_label(layout, block, name, icon, ptr, prop, index, 0, 0, w, h); + else if(type == PROP_ENUM || type == PROP_STRING || type == PROP_POINTER) { + but= ui_item_with_label(layout, block, name, icon, ptr, prop, index, 0, 0, w, h); + ui_but_add_search(but, ptr, prop, NULL, NULL); + } /* single button */ else { but= uiDefAutoButR(block, ptr, prop, index, (char*)name, icon, 0, 0, w, h); @@ -854,6 +858,142 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname) } } +/* Pointer RNA button with search */ + +static void rna_search_cb(const struct bContext *C, void *arg_but, char *str, uiSearchItems *items) +{ + Scene *scene= CTX_data_scene(C); + uiBut *but= arg_but; + char *name; + int i, iconid; + + i = 0; + RNA_PROP_BEGIN(&but->rnasearchpoin, itemptr, but->rnasearchprop) { + iconid= 0; + if(RNA_struct_is_ID(itemptr.type)) + iconid= ui_id_icon_get(scene, itemptr.data); + + name= RNA_struct_name_get_alloc(&itemptr, NULL, 0); + + if(name) { + if(BLI_strcasestr(name, str)) { + if(!uiSearchItemAdd(items, name, SET_INT_IN_POINTER(i), iconid)) { + MEM_freeN(name); + break; + } + } + + MEM_freeN(name); + } + + i++; + } + RNA_PROP_END; +} + +static void search_id_collection(StructRNA *ptype, PointerRNA *ptr, PropertyRNA **prop) +{ + StructRNA *srna; + + /* look for collection property in Main */ + RNA_main_pointer_create(G.main, ptr); + + *prop= NULL; + + RNA_STRUCT_BEGIN(ptr, iprop) { + /* if it's a collection and has same pointer type, we've got it */ + if(RNA_property_type(iprop) == PROP_COLLECTION) { + srna= RNA_property_pointer_type(ptr, iprop); + + if(ptype == srna) { + *prop= iprop; + break; + } + } + } + RNA_STRUCT_END; +} + +void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRNA *searchptr, PropertyRNA *searchprop) +{ + StructRNA *ptype; + PointerRNA sptr; + + /* for ID's we do automatic lookup */ + if(!searchprop) { + if(RNA_property_type(prop) == PROP_POINTER) { + ptype= RNA_property_pointer_type(ptr, prop); + search_id_collection(ptype, &sptr, &searchprop); + searchptr= &sptr; + } + } + + /* turn button into search button */ + if(searchprop) { + but->type= SEARCH_MENU; + but->hardmax= MAX2(but->hardmax, 256); + but->rnasearchpoin= *searchptr; + but->rnasearchprop= searchprop; + but->flag |= UI_ICON_LEFT|UI_TEXT_LEFT; + + uiButSetSearchFunc(but, rna_search_cb, but, NULL); + } +} + +void uiItemPointerR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname) +{ + PropertyRNA *prop, *searchprop; + PropertyType type; + uiBut *but; + uiBlock *block; + StructRNA *icontype; + int w, h; + + /* validate arguments */ + if(!ptr->data || !searchptr->data) + return; + + prop= RNA_struct_find_property(ptr, propname); + + if(!prop) { + printf("uiItemPointerR: property not found: %s\n", propname); + return; + } + + type= RNA_property_type(prop); + if(!ELEM(type, PROP_POINTER, PROP_STRING)) { + printf("uiItemPointerR: property %s must be a pointer or string.\n", propname); + return; + } + + searchprop= RNA_struct_find_property(searchptr, searchpropname); + + if(!searchprop || RNA_property_type(searchprop) != PROP_COLLECTION) { + printf("uiItemPointerR: search collection property not found: %s\n", searchpropname); + return; + } + + /* get icon & name */ + if(!icon) { + if(type == PROP_POINTER) + icontype= RNA_property_pointer_type(ptr, prop); + else + icontype= RNA_property_pointer_type(searchptr, searchprop); + + icon= RNA_struct_ui_icon(icontype); + } + if(!name) + name= (char*)RNA_property_ui_name(prop); + + /* create button */ + block= uiLayoutGetBlock(layout); + + ui_item_rna_size(layout, name, icon, prop, 0, &w, &h); + but= ui_item_with_label(layout, block, name, icon, ptr, prop, 0, 0, 0, w, h); + + ui_but_add_search(but, ptr, prop, searchptr, searchprop); +} + /* menu item */ static void ui_item_menutype_func(bContext *C, uiLayout *layout, void *arg_mt) { diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index a1dae39d687..61cf612e912 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -435,6 +435,8 @@ struct uiSearchItems { char **names; void **pointers; int *icons; + + AutoComplete *autocpl; }; typedef struct uiSearchboxData { @@ -451,6 +453,11 @@ typedef struct uiSearchboxData { /* returns zero if nothing to add */ int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int iconid) { + /* hijack for autocomplete */ + if(items->autocpl) { + autocomplete_do_name(items->autocpl, name); + return 1; + } if(items->totitem>=items->maxitem) { items->more= 1; @@ -622,6 +629,18 @@ void ui_searchbox_update(bContext *C, ARegion *ar, uiBut *but, int reset) ED_region_tag_redraw(ar); } +void ui_searchbox_autocomplete(bContext *C, ARegion *ar, uiBut *but, char *str) +{ + uiSearchboxData *data= ar->regiondata; + + data->items.autocpl= autocomplete_begin(str, ui_get_but_string_max_length(but)); + + but->search_func(C, but->search_arg, but->editstr, &data->items); + + autocomplete_end(data->items.autocpl, str); + data->items.autocpl= NULL; +} + static void ui_searchbox_region_draw(const bContext *C, ARegion *ar) { uiSearchboxData *data= ar->regiondata; @@ -683,7 +702,7 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) uiSearchboxData *data; float aspect= but->block->aspect; float x1f, x2f, y1f, y2f; - int x1, x2, y1, y2, winx, winy; + int x1, x2, y1, y2, winx, winy, ofsx, ofsy; /* create area region */ ar= ui_add_temporary_region(CTX_wm_screen(C)); @@ -736,6 +755,14 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) x2f= but->x2 + 5; /* symmetrical */ y2f= but->y1; y1f= y2f - uiSearchBoxhHeight(); + + ofsx= (but->block->panel)? but->block->panel->ofsx: 0; + ofsy= (but->block->panel)? but->block->panel->ofsy: 0; + + x1f += ofsx; + x2f += ofsx; + y1f += ofsy; + y2f += ofsy; /* minimal width */ if(x2f - x1f < 150) x2f= x1f+150; // XXX arbitrary diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 37b2a4af84e..a006187c4aa 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -27,12 +27,14 @@ #include "MEM_guardedalloc.h" +#include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "BLI_string.h" #include "BKE_context.h" #include "BKE_icons.h" +#include "BKE_global.h" #include "BKE_library.h" #include "BKE_utildefines.h" @@ -62,121 +64,51 @@ void uiTemplateHeader(uiLayout *layout, bContext *C) ED_area_header_standardbuttons(C, block, 0); } -/******************* Header ID Template ************************/ +/********************** Search Callbacks *************************/ typedef struct TemplateID { PointerRNA ptr; PropertyRNA *prop; - int flag; - short browse; - - char newop[256]; - char openop[256]; - char unlinkop[256]; - - short idtype; + ListBase *idlb; } TemplateID; -static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) +/* Search browse menu, assign */ +static void id_search_call_cb(struct bContext *C, void *arg_template, void *item) { - TemplateID *template= (TemplateID*)arg_litem; - PointerRNA idptr= RNA_property_pointer_get(&template->ptr, template->prop); - ID *id= idptr.data; - int event= GET_INT_FROM_POINTER(arg_event); - - if(event == UI_ID_BROWSE && template->browse == 32767) - event= UI_ID_ADD_NEW; - else if(event == UI_ID_BROWSE && template->browse == 32766) - event= UI_ID_OPEN; + TemplateID *template= (TemplateID*)arg_template; - switch(event) { - case UI_ID_BROWSE: - printf("warning, id browse shouldnt come here\n"); - break; - case UI_ID_DELETE: - memset(&idptr, 0, sizeof(idptr)); - RNA_property_pointer_set(&template->ptr, template->prop, idptr); - RNA_property_update(C, &template->ptr, template->prop); - break; - case UI_ID_FAKE_USER: - if(id) { - if(id->flag & LIB_FAKEUSER) id->us++; - else id->us--; - } - else return; - break; - case UI_ID_PIN: - break; - case UI_ID_ADD_NEW: - WM_operator_name_call(C, template->newop, WM_OP_INVOKE_REGION_WIN, NULL); - break; - case UI_ID_OPEN: - WM_operator_name_call(C, template->openop, WM_OP_INVOKE_REGION_WIN, NULL); - break; -#if 0 - case UI_ID_ALONE: - if(!id || id->us < 1) - return; - break; - case UI_ID_LOCAL: - if(!id || id->us < 1) - return; - break; - case UI_ID_AUTO_NAME: - break; -#endif - } -} - -/* ID Search browse menu, assign */ -static void id_search_call_cb(struct bContext *C, void *arg_litem, void *item) -{ + /* ID */ if(item) { - TemplateID *template= (TemplateID*)arg_litem; - PointerRNA idptr= RNA_property_pointer_get(&template->ptr, template->prop); + PointerRNA idptr; RNA_id_pointer_create(item, &idptr); RNA_property_pointer_set(&template->ptr, template->prop, idptr); RNA_property_update(C, &template->ptr, template->prop); - } + } } /* ID Search browse menu, do the search */ -static void id_search_cb(const struct bContext *C, void *arg_litem, char *str, uiSearchItems *items) +static void id_search_cb(const struct bContext *C, void *arg_template, char *str, uiSearchItems *items) { - TemplateID *template= (TemplateID*)arg_litem; - ListBase *lb= wich_libbase(CTX_data_main(C), template->idtype); + TemplateID *template= (TemplateID*)arg_template; + Scene *scene= CTX_data_scene(C); + ListBase *lb= template->idlb; ID *id; - + int iconid; + + /* ID listbase */ for(id= lb->first; id; id= id->next) { - int iconid= 0; - - /* icon */ - switch(GS(id->name)) - { - case ID_MA: /* fall through */ - case ID_TE: /* fall through */ - case ID_IM: /* fall through */ - case ID_WO: /* fall through */ - case ID_LA: /* fall through */ - iconid= BKE_icon_getid(id); - /* checks if not exists, or changed */ - ui_id_icon_render(CTX_data_scene(C), id); - break; - default: - break; - } - - if(BLI_strcasestr(id->name+2, str)) { - if(0==uiSearchItemAdd(items, id->name+2, id, iconid)) + iconid= ui_id_icon_get(scene, id); + + if(BLI_strcasestr(id->name+2, str)) + if(!uiSearchItemAdd(items, id->name+2, id, iconid)) break; - } } } /* ID Search browse menu, open */ -static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem) +static uiBlock *search_menu(bContext *C, ARegion *ar, void *arg_litem) { static char search[256]; static TemplateID template; @@ -213,17 +145,57 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem) return block; } -/* ****************** */ +/************************ ID Template ***************************/ +static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) +{ + TemplateID *template= (TemplateID*)arg_litem; + PointerRNA idptr= RNA_property_pointer_get(&template->ptr, template->prop); + ID *id= idptr.data; + int event= GET_INT_FROM_POINTER(arg_event); + + switch(event) { + case UI_ID_BROWSE: + case UI_ID_PIN: + case UI_ID_OPEN: + case UI_ID_ADD_NEW: + printf("warning, id event %d shouldnt come here\n", event); + break; + case UI_ID_DELETE: + memset(&idptr, 0, sizeof(idptr)); + RNA_property_pointer_set(&template->ptr, template->prop, idptr); + RNA_property_update(C, &template->ptr, template->prop); + break; + case UI_ID_FAKE_USER: + if(id) { + if(id->flag & LIB_FAKEUSER) id->us++; + else id->us--; + } + else return; + break; +#if 0 + case UI_ID_ALONE: + if(!id || id->us < 1) + return; + break; + case UI_ID_LOCAL: + if(!id || id->us < 1) + return; + break; + case UI_ID_AUTO_NAME: + break; +#endif + } +} -static void template_header_ID(bContext *C, uiBlock *block, TemplateID *template, StructRNA *type) +static void template_ID(bContext *C, uiBlock *block, TemplateID *template, StructRNA *type, int flag, char *newop, char *unlinkop) { uiBut *but; PointerRNA idptr; ListBase *lb; idptr= RNA_property_pointer_get(&template->ptr, template->prop); - lb= wich_libbase(CTX_data_main(C), template->idtype); + lb= template->idlb; if(idptr.type) type= idptr.type; @@ -231,29 +203,8 @@ static void template_header_ID(bContext *C, uiBlock *block, TemplateID *template uiDefIconBut(block, LABEL, 0, RNA_struct_ui_icon(type), 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); uiBlockBeginAlign(block); - if(template->flag & UI_ID_BROWSE) { - /* - char *extrastr, *str; - - if((template->flag & UI_ID_ADD_NEW) && (template->flag & UI_ID_OPEN)) - extrastr= "OPEN NEW %x 32766 |ADD NEW %x 32767"; - else if(template->flag & UI_ID_ADD_NEW) - extrastr= "ADD NEW %x 32767"; - else if(template->flag & UI_ID_OPEN) - extrastr= "OPEN NEW %x 32766"; - else - extrastr= NULL; - - duptemplate= MEM_dupallocN(template); - IDnames_to_pupstring(&str, NULL, extrastr, lb, idptr.data, &duptemplate->browse); - - but= uiDefButS(block, MENU, 0, str, 0, 0, UI_UNIT_X, UI_UNIT_Y, &duptemplate->browse, 0, 0, 0, 0, "Browse existing choices, or add new"); - uiButSetNFunc(but, template_id_cb, duptemplate, SET_INT_IN_POINTER(UI_ID_BROWSE)); - - MEM_freeN(str); - */ - uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X, UI_UNIT_Y, "Browse ID data"); - } + if(flag & UI_ID_BROWSE) + uiDefBlockButN(block, search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X, UI_UNIT_Y, "Browse ID data"); /* text button with name */ if(idptr.data) { @@ -265,11 +216,11 @@ static void template_header_ID(bContext *C, uiBlock *block, TemplateID *template uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_RENAME)); } - if(template->flag & UI_ID_ADD_NEW) { + if(flag & UI_ID_ADD_NEW) { int w= idptr.data?UI_UNIT_X:UI_UNIT_X*6; - if(template->newop[0]) { - but= uiDefIconTextButO(block, BUT, template->newop, WM_OP_EXEC_REGION_WIN, ICON_ZOOMIN, "Add New", 0, 0, w, UI_UNIT_Y, NULL); + if(newop) { + but= uiDefIconTextButO(block, BUT, newop, WM_OP_EXEC_REGION_WIN, ICON_ZOOMIN, "Add New", 0, 0, w, UI_UNIT_Y, NULL); } else { but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, "Add New", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); @@ -278,9 +229,9 @@ static void template_header_ID(bContext *C, uiBlock *block, TemplateID *template } /* delete button */ - if(idptr.data && (template->flag & UI_ID_DELETE)) { - if(template->unlinkop[0]) { - but= uiDefIconButO(block, BUT, template->unlinkop, WM_OP_EXEC_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL); + if(idptr.data && (flag & UI_ID_DELETE)) { + if(unlinkop) { + but= uiDefIconButO(block, BUT, unlinkop, WM_OP_EXEC_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL); } else { but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); @@ -291,12 +242,13 @@ static void template_header_ID(bContext *C, uiBlock *block, TemplateID *template uiBlockEndAlign(block); } -void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop) +void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *newop, char *unlinkop) { TemplateID *template; uiBlock *block; PropertyRNA *prop; StructRNA *type; + int flag; if(!ptr->data) return; @@ -311,26 +263,19 @@ void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname template= MEM_callocN(sizeof(TemplateID), "TemplateID"); template->ptr= *ptr; template->prop= prop; - template->flag= UI_ID_BROWSE|UI_ID_RENAME|UI_ID_DELETE; - if(newop) { - template->flag |= UI_ID_ADD_NEW; - BLI_strncpy(template->newop, newop, sizeof(template->newop)); - } - if(openop) { - template->flag |= UI_ID_OPEN; - BLI_strncpy(template->openop, openop, sizeof(template->openop)); - } - if(unlinkop) - BLI_strncpy(template->unlinkop, unlinkop, sizeof(template->unlinkop)); + flag= UI_ID_BROWSE|UI_ID_RENAME|UI_ID_DELETE; + + if(newop) + flag |= UI_ID_ADD_NEW; type= RNA_property_pointer_type(ptr, prop); - template->idtype = RNA_type_to_ID_code(type); + template->idlb= wich_libbase(CTX_data_main(C), RNA_type_to_ID_code(type)); - if(template->idtype) { + if(template->idlb) { uiLayoutRow(layout, 1); block= uiLayoutGetBlock(layout); - template_header_ID(C, block, template, type); + template_ID(C, block, template, type, flag, newop, unlinkop); } MEM_freeN(template); @@ -1529,6 +1474,7 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, char *propname) /************************* List Template **************************/ +#if 0 typedef struct ListItem { PointerRNA ptr; PropertyRNA *prop; @@ -1560,50 +1506,52 @@ static void list_item_cb(bContext *C, void *arg_item, void *arg_unused) } } } +#endif -void uiTemplateList(uiLayout *layout, PointerRNA *ptr, char *propname, char *activepropname, int items) +ListBase uiTemplateList(uiLayout *layout, PointerRNA *ptr, char *propname, char *activepropname, int rows, int columns, int compact) { + CollectionPointerLink *link; PropertyRNA *prop, *activeprop; PropertyType type, activetype; PointerRNA activeptr; uiLayout *box, *row, *col; uiBlock *block; uiBut *but; - char *name, *activename= NULL; - int i= 1, activei= 0, len; + ListBase lb; + char *name, *activename= NULL, str[32]; + int i= 1, activei= 0, len, items, found; static int scroll = 1; + + lb.first= lb.last= NULL; /* validate arguments */ if(!ptr->data) - return; + return lb; prop= RNA_struct_find_property(ptr, propname); if(!prop) { printf("uiTemplateList: property not found: %s\n", propname); - return; + return lb; } activeprop= RNA_struct_find_property(ptr, activepropname); if(!activeprop) { printf("uiTemplateList: property not found: %s\n", activepropname); - return; + return lb; } type= RNA_property_type(prop); if(type != PROP_COLLECTION) { printf("uiTemplateList: expected collection property.\n"); - return; + return lb; } activetype= RNA_property_type(activeprop); if(!ELEM3(activetype, PROP_POINTER, PROP_INT, PROP_STRING)) { printf("uiTemplateList: expected pointer, integer or string property.\n"); - return; + return lb; } - if(items == 0) - items= 5; - /* get active data */ if(activetype == PROP_POINTER) activeptr= RNA_property_pointer_get(ptr, activeprop); @@ -1612,62 +1560,119 @@ void uiTemplateList(uiLayout *layout, PointerRNA *ptr, char *propname, char *act else if(activetype == PROP_STRING) activename= RNA_property_string_get_alloc(ptr, activeprop, NULL, 0); - box= uiLayoutBox(layout); - row= uiLayoutRow(box, 0); - col = uiLayoutColumn(row, 1); + block= uiLayoutGetBlock(layout); - block= uiLayoutGetBlock(col); - uiBlockSetEmboss(block, UI_EMBOSSN); + if(compact) { + /* compact layout */ + found= 0; + + row= uiLayoutRow(layout, 1); + + RNA_PROP_BEGIN(ptr, itemptr, prop) { + if(activetype == PROP_POINTER) + found= (activeptr.data == itemptr.data); + else if(activetype == PROP_INT) + found= (activei == i); + else if(activetype == PROP_STRING) + found= (strcmp(activename, name) == 0); + + if(found) { + name= RNA_struct_name_get_alloc(&itemptr, NULL, 0); + if(name) { + uiItemL(row, name, RNA_struct_ui_icon(itemptr.type)); + MEM_freeN(name); + } + + link= MEM_callocN(sizeof(CollectionPointerLink), "uiTemplateList return"); + link->ptr= itemptr; + BLI_addtail(&lb, link); + } + + i++; + } + RNA_PROP_END; - len= RNA_property_collection_length(ptr, prop); - scroll= MIN2(scroll, len-items+1); - scroll= MAX2(scroll, 1); + if(i == 1) + uiItemL(row, "", 0); - RNA_PROP_BEGIN(ptr, itemptr, prop) { - if(i >= scroll && iptr= *ptr; - item->prop= prop; - item->activeprop= activeprop; - item->activeptr= itemptr; - item->activei= i; + box= uiLayoutBox(layout); + row= uiLayoutRow(box, 0); + col = uiLayoutColumn(row, 1); + + uiBlockSetEmboss(block, UI_EMBOSSN); + + len= RNA_property_collection_length(ptr, prop); + scroll= MIN2(scroll, len-items+1); + scroll= MAX2(scroll, 1); + + RNA_PROP_BEGIN(ptr, itemptr, prop) { + if(i >= scroll && iptr= *ptr; + item->prop= prop; + item->activeprop= activeprop; + item->activeptr= itemptr; + item->activei= i; + + if(activetype == PROP_POINTER) + item->selected= (activeptr.data == itemptr.data)? i: -1; + else if(activetype == PROP_INT) + item->selected= (activei == i)? i: -1; + else if(activetype == PROP_STRING) + item->selected= (strcmp(activename, name) == 0)? i: -1; +#endif - if(activetype == PROP_POINTER) - item->selected= (activeptr.data == itemptr.data)? i: -1; - else if(activetype == PROP_INT) - item->selected= (activei == i)? i: -1; - else if(activetype == PROP_STRING) - item->selected= (strcmp(activename, name) == 0)? i: -1; + //but= uiDefIconTextButI(block, ROW, 0, RNA_struct_ui_icon(itemptr.type), name, 0,0,UI_UNIT_X*10,UI_UNIT_Y, &item->selected, 0, i, 0, 0, ""); + but= uiDefIconTextButR(block, ROW, 0, RNA_struct_ui_icon(itemptr.type), name, 0,0,UI_UNIT_X*10,UI_UNIT_Y, ptr, activepropname, 0/*&item->selected*/, 0, i, 0, 0, ""); + uiButSetFlag(but, UI_ICON_LEFT|UI_TEXT_LEFT); + //uiButSetNFunc(but, list_item_cb, item, NULL); - but= uiDefIconTextButI(block, ROW, 0, RNA_struct_ui_icon(itemptr.type), name, 0,0,UI_UNIT_X*10,UI_UNIT_Y, &item->selected, 0, i, 0, 0, ""); - uiButSetFlag(but, UI_ICON_LEFT|UI_TEXT_LEFT); - uiButSetNFunc(but, list_item_cb, item, NULL); + MEM_freeN(name); - MEM_freeN(name); + link= MEM_callocN(sizeof(CollectionPointerLink), "uiTemplateList return"); + link->ptr= itemptr; + BLI_addtail(&lb, link); + } } + + i++; } + RNA_PROP_END; - i++; - } - RNA_PROP_END; + while(i < scroll+items) { + if(i >= scroll) + uiItemL(col, "", 0); + i++; + } - while(i < scroll+items) { - if(i >= scroll) - uiItemL(col, "", 0); - i++; - } + uiBlockSetEmboss(block, UI_EMBOSS); - uiBlockSetEmboss(block, UI_EMBOSS); + if(len > items) { + col= uiLayoutColumn(row, 0); + uiDefButI(block, SCROLL, 0, "", 0,0,UI_UNIT_X*0.75,UI_UNIT_Y*items, &scroll, 1, len-items+1, items, 0, ""); + } - if(len > items) { - col= uiLayoutColumn(row, 0); - uiDefButI(block, SCROLL, 0, "", 0,0,UI_UNIT_X*0.75,UI_UNIT_Y*items, &scroll, 1, len-items+1, items, 0, ""); + //uiDefButI(block, SCROLL, 0, "", 0,0,UI_UNIT_X*15,UI_UNIT_Y*0.75, &scroll, 1, 16-5, 5, 0, ""); } - //uiDefButI(block, SCROLL, 0, "", 0,0,UI_UNIT_X*15,UI_UNIT_Y*0.75, &scroll, 1, 16-5, 5, 0, ""); + return lb; } diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index e67e5b5a871..3ed81a3e9bc 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -111,7 +111,12 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind but= uiDefButR(block, MENU, 0, NULL, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL); break; case PROP_STRING: - but= uiDefButR(block, TEX, 0, name, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL); + if(icon && name && strcmp(name, "") == 0) + but= uiDefIconButR(block, TEX, 0, icon, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL); + else if(icon) + but= uiDefIconTextButR(block, TEX, 0, icon, name, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL); + else + but= uiDefButR(block, TEX, 0, name, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL); break; case PROP_POINTER: { PointerRNA pptr; diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 75de9d53766..a4aa60775f2 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -136,6 +136,14 @@ void RNA_api_ui_layout(StructRNA *srna) parm= RNA_def_string(func, "value", "", 0, "", "Enum property value."); RNA_def_property_flag(parm, PROP_REQUIRED);*/ + func= RNA_def_function(srna, "item_pointerR", "uiItemPointerR"); + api_ui_item_common(func); + api_ui_item_rna_common(func); + parm= RNA_def_pointer(func, "search_data", "AnyType", "", "Data from which to take collection to search in."); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); + parm= RNA_def_string(func, "search_property", "", 0, "", "Identifier of search collection property."); + RNA_def_property_flag(parm, PROP_REQUIRED); + func= RNA_def_function(srna, "itemO", "uiItemO"); api_ui_item_op_common(func); @@ -211,7 +219,6 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_function_flag(func, FUNC_USE_CONTEXT); api_ui_item_rna_common(func); RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block."); - RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a new ID block."); RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block."); func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier"); @@ -252,9 +259,13 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "template_list", "uiTemplateList"); api_ui_item_rna_common(func); - parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, indicating the active element."); + parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element."); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_int(func, "items", 5, 0, INT_MAX, "", "Number of items to display.", 0, INT_MAX); + parm= RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display.", 0, INT_MAX); + parm= RNA_def_int(func, "columns", 5, 0, INT_MAX, "", "Number of columns to display.", 0, INT_MAX); + parm= RNA_def_boolean(func, "compact", 0, "", "Use compact, single row list template."); + parm= RNA_def_collection(func, "items", 0, "", "Items visible in the list."); + RNA_def_function_return(func, parm); } #endif -- cgit v1.2.3 From f508319fc8c54e918446482392ab6e1b01c63fe6 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 27 Jun 2009 04:56:20 +0000 Subject: NLA SoC: Apply-Scale Operator now recalculates action length after scale is applied --- source/blender/editors/space_nla/nla_edit.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index df30e112b5a..44528714732 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -769,8 +769,12 @@ static int nlaedit_apply_scale_exec (bContext *C, wmOperator *op) bed.data= strip; ANIM_animchanneldata_keys_bezier_loop(&bed, strip->act, ALE_ACT, NULL, bezt_apply_nlamapping, calchandles_fcurve, 0); - /* clear scale of strip now that it has been applied, but leave everything else alone */ + /* clear scale of strip now that it has been applied, + * and recalculate the extents of the action now that it has been scaled + * but leave everything else alone + */ strip->scale= 1.0f; + calc_action_range(strip->act, &strip->actstart, &strip->actend, 1); } } } -- cgit v1.2.3 From 5d6ef223fb28b35ff441d59e7b753c030a27d788 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sat, 27 Jun 2009 11:57:50 +0000 Subject: 2.5 RNA: * Started Wrapping softbody RNA. --- source/blender/makesrna/intern/rna_object_force.c | 97 +++++++++++++++++++++++ 1 file changed, 97 insertions(+) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index bc3f0733a0d..f9a93a0a5a2 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -268,6 +268,7 @@ static void rna_def_field(BlenderRNA *brna) srna= RNA_def_struct(brna, "FieldSettings", NULL); RNA_def_struct_sdna(srna, "PartDeflect"); RNA_def_struct_ui_text(srna, "Field Settings", "Field settings for an object in physics simulation."); + RNA_def_struct_ui_icon(srna, ICON_PHYSICS); /* Enums */ @@ -410,10 +411,106 @@ static void rna_def_game_softbody(BlenderRNA *brna) static void rna_def_softbody(BlenderRNA *brna) { StructRNA *srna; + PropertyRNA *prop; srna= RNA_def_struct(brna, "SoftBodySettings", NULL); RNA_def_struct_sdna(srna, "SoftBody"); RNA_def_struct_ui_text(srna, "Soft Body Settings", "Soft body simulation settings for an object."); + + /* General Settings */ + + prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "mediafrict"); + RNA_def_property_range(prop, 0.0f, 50.0f); + RNA_def_property_ui_text(prop, "Friction", "General media friction for point movements"); + + prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "nodemass"); + RNA_def_property_range(prop, 0.0f, 50000.0f); + RNA_def_property_ui_text(prop, "Mass", ""); + + prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "grav"); + RNA_def_property_range(prop, -10.0f, 10.0f); + RNA_def_property_ui_text(prop, "Gravitation", "Apply gravitation to point movement"); + + prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "physics_speed"); + RNA_def_property_range(prop, 0.01f, 100.0f); + RNA_def_property_ui_text(prop, "Speed", "Tweak timing for physics to control frequency and speed"); + + /* Goal */ + + /*prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "vertgroup"); + RNA_def_property_ui_text(prop, "Vertex Group", "Use control point weight values");*/ + + prop= RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "mingoal"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Goal Minimum", "Goal minimum, vertex group weights are scaled to match this range."); + + prop= RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "maxgoal"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Goal Maximum", "Goal maximum, vertex group weights are scaled to match this range."); + + prop= RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "defgoal"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Goal Default", "Default Goal (vertex target position) value, when no Vertex Group used."); + + prop= RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "goalspring"); + RNA_def_property_range(prop, 0.0f, 0.999f); + RNA_def_property_ui_text(prop, "Goal Stiffness", "Goal (vertex target position) spring stiffness."); + + prop= RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "goalfrict"); + RNA_def_property_range(prop, 0.0f, 50.0f); + RNA_def_property_ui_text(prop, "Goal Damping", "Goal (vertex target position) friction."); + + /* Edge Spring Settings */ + + prop= RNA_def_property(srna, "pull", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "inspring"); + RNA_def_property_range(prop, 0.0f, 0.999f); + RNA_def_property_ui_text(prop, "Pull", "Edge spring stiffness when longer than rest length"); + + prop= RNA_def_property(srna, "push", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "inpush"); + RNA_def_property_range(prop, 0.0f, 0.999f); + RNA_def_property_ui_text(prop, "Push", "Edge spring stiffness when shorter than rest length"); + + prop= RNA_def_property(srna, "damp", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "infrict"); + RNA_def_property_range(prop, 0.0f, 50.0f); + RNA_def_property_ui_text(prop, "Damp", "Edge spring friction"); + + prop= RNA_def_property(srna, "spring_lenght", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "springpreload"); + RNA_def_property_range(prop, 0.0f, 200.0f); + RNA_def_property_ui_text(prop, "SL", "Alter spring lenght to shrink/blow up (unit %) 0 to disable"); + + prop= RNA_def_property(srna, "aero", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "aeroedge"); + RNA_def_property_range(prop, 0.0f, 30000.0f); + RNA_def_property_ui_text(prop, "Aero", "Make edges 'sail'"); + + prop= RNA_def_property(srna, "plastic", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "plastic"); + RNA_def_property_range(prop, 0.0f, 100.0f); + RNA_def_property_ui_text(prop, "Plastic", "Permanent deform"); + + prop= RNA_def_property(srna, "bending", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "secondspring"); + RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_ui_text(prop, "Bending", "Bending Stiffness"); + + prop= RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "shearstiff"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Shear", "Shear Stiffness"); } void RNA_def_object_force(BlenderRNA *brna) -- cgit v1.2.3 From d3557fc487bc5e5c02c9758b6a05200575e82e84 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 27 Jun 2009 12:35:11 +0000 Subject: NLA SoC: Recoded the strip<->global time conversion code * Strip evaluation now takes into account repeats * Increasing the number of repeats lengthens the strip, while decreasing the number of repeats does the opposite. TODO: - inverse correction doesn't take into account repeats != 1, so tweaking strips with repeats is currently not recommended! --- source/blender/blenkernel/intern/nla.c | 44 ++++++++++++++++++++++++-------- source/blender/makesrna/intern/rna_nla.c | 24 ++++++++++++++++- 2 files changed, 56 insertions(+), 12 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 747113b6531..760139bee15 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -331,7 +331,7 @@ NlaStrip *add_nlastrip_to_stack (AnimData *adt, bAction *act) */ static float nlastrip_get_frame_actionclip (NlaStrip *strip, float cframe, short invert) { - float length, actlength, repeat, scale; + float actlength, repeat, scale; /* get number of repeats */ if (IS_EQ(strip->repeat, 0.0f)) strip->repeat = 1.0f; @@ -345,24 +345,46 @@ static float nlastrip_get_frame_actionclip (NlaStrip *strip, float cframe, short actlength = strip->actend - strip->actstart; if (IS_EQ(actlength, 0.0f)) actlength = 1.0f; - /* length of strip */ - length= actlength * scale * repeat; - if (IS_EQ(length, 0.0f)) length= strip->end - strip->start; - /* reversed = play strip backwards */ if (strip->flag & NLASTRIP_FLAG_REVERSE) { /* invert = convert action-strip time to global time */ if (invert) - return length*(strip->actend - cframe)/(repeat*actlength) + strip->start; - else - return strip->actend - repeat*actlength*(cframe - strip->start)/length; + return scale*(strip->actend - cframe) + strip->start; // FIXME: this doesn't work for multiple repeats yet + else { + if (IS_EQ(cframe, strip->end) && IS_EQ(strip->repeat, ((int)strip->repeat))) { + /* this case prevents the motion snapping back to the first frame at the end of the strip + * by catching the case where repeats is a whole number, which means that the end of the strip + * could also be interpreted as the end of the start of a repeat + */ + return strip->actstart; + } + else { + /* - the 'fmod(..., actlength*scale)' is needed to get the repeats working + * - the '/ scale' is needed to ensure that scaling influences the timing within the repeat + */ + return strip->actend - fmod(cframe - strip->start, actlength*scale) / scale; + } + } } else { /* invert = convert action-strip time to global time */ if (invert) - return length*(cframe - strip->actstart)/(repeat*actlength) + strip->start; - else - return repeat*actlength*(cframe - strip->start)/length + strip->actstart; + return scale*(cframe - strip->actstart) + strip->start; // FIXME: this doesn't work for mutiple repeats yet + else { + if (IS_EQ(cframe, strip->end) && IS_EQ(strip->repeat, ((int)strip->repeat))) { + /* this case prevents the motion snapping back to the first frame at the end of the strip + * by catching the case where repeats is a whole number, which means that the end of the strip + * could also be interpreted as the end of the start of a repeat + */ + return strip->actend; + } + else { + /* - the 'fmod(..., actlength*scale)' is needed to get the repeats working + * - the '/ scale' is needed to ensure that scaling influences the timing within the repeat + */ + return strip->actstart + fmod(cframe - strip->start, actlength*scale) / scale; + } + } } } diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 84a84492ea3..5dc624b67bc 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -133,6 +133,27 @@ static void rna_NlaStrip_scale_set(PointerRNA *ptr, float value) printf("NlaStrip Set Scale Error (in RNA): Scale = %0.4f, Repeat = %0.4f \n", data->scale, data->repeat); } +static void rna_NlaStrip_repeat_set(PointerRNA *ptr, float value) +{ + NlaStrip *data= (NlaStrip*)ptr->data; + float actlen, mapping; + + /* set scale value */ + CLAMP(value, 0.01f, 1000.0f); /* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */ + data->repeat= value; + + /* calculate existing factors */ + actlen= data->actend - data->actstart; + if (IS_EQ(actlen, 0.0f)) actlen= 1.0f; + mapping= data->scale * data->repeat; + + /* adjust endpoint of strip in response to this */ + if (IS_EQ(mapping, 0.0f) == 0) + data->end = (actlen * mapping) + data->start; + else + printf("NlaStrip Set Repeat Error (in RNA): Scale = %0.4f, Repeat = %0.4f \n", data->scale, data->repeat); +} + static void rna_NlaStrip_blend_in_set(PointerRNA *ptr, float value) { NlaStrip *data= (NlaStrip*)ptr->data; @@ -265,7 +286,8 @@ void rna_def_nlastrip(BlenderRNA *brna) /* Action Reuse */ prop= RNA_def_property(srna, "repeat", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "repeat"); - RNA_def_property_range(prop, 1.0f, 1000.0f); /* these limits have currently be chosen arbitarily, but could be extended (minimum should still be > 0 though) if needed... */ + RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_repeat_set", NULL); + RNA_def_property_range(prop, 0.1f, 1000.0f); /* these limits have currently be chosen arbitarily, but could be extended (minimum should still be > 0 though) if needed... */ RNA_def_property_ui_text(prop, "Repeat", "Number of times to repeat the "); prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE); -- cgit v1.2.3 From d55b46041947ee23e8f92393a53ed4dec7c5071a Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 27 Jun 2009 12:41:28 +0000 Subject: 2.5 Bugreport; on dragging area edges, the mouse-release event was swallowed by the panel animation handler. Thanks Pablo Vazquez for report. :) --- source/blender/editors/interface/interface_panel.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 06dc5d1e606..eaf78ae89ef 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -1288,6 +1288,7 @@ int ui_handler_panel_region(bContext *C, wmEvent *event) /**************** window level modal panel interaction **************/ +/* note, this is modal handler and should not swallow events for animation */ static int ui_handler_panel(bContext *C, wmEvent *event, void *userdata) { Panel *panel= userdata; @@ -1303,8 +1304,6 @@ static int ui_handler_panel(bContext *C, wmEvent *event, void *userdata) panel_activate_state(C, panel, PANEL_STATE_ANIMATION); else panel_activate_state(C, panel, PANEL_STATE_EXIT); - - return WM_UI_HANDLER_BREAK; } else if(event->type == MOUSEMOVE) { if(data->state == PANEL_STATE_WAIT_UNTAB) -- cgit v1.2.3 From bc0cd9607e1e2d25f92216332d73c23ef1e7c786 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 27 Jun 2009 13:00:22 +0000 Subject: NLA SoC: Move Strips Up/Down Operators These operators may be temporary only, depending on if a workable solution via transform is found. * PageUp moves strips into the track above if there's space * PageDown moves strips into the track below if there's space * Also fixed a button-alignment bug in the DopeSheet header --- .../blender/editors/space_action/action_header.c | 3 +- source/blender/editors/space_nla/nla_edit.c | 154 +++++++++++++++++++++ source/blender/editors/space_nla/nla_header.c | 5 + source/blender/editors/space_nla/nla_intern.h | 3 + source/blender/editors/space_nla/nla_ops.c | 9 ++ 5 files changed, 173 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index a9ce145088d..62e7a2d8e3f 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -398,7 +398,8 @@ void action_header_buttons(const bContext *C, ARegion *ar) /* COPY PASTE */ uiBlockBeginAlign(block); uiDefIconButO(block, BUT, "ACT_OT_copy", WM_OP_INVOKE_REGION_WIN, ICON_COPYDOWN, xco,yco,XIC,YIC, "Copies the selected keyframes to the buffer."); - uiDefIconButO(block, BUT, "ACT_OT_paste", WM_OP_INVOKE_REGION_WIN, ICON_COPYDOWN, xco,yco,XIC,YIC, "Pastes the keyframes from the buffer into the selected channels."); + xco += XIC; + uiDefIconButO(block, BUT, "ACT_OT_paste", WM_OP_INVOKE_REGION_WIN, ICON_PASTEDOWN, xco,yco,XIC,YIC, "Pastes the keyframes from the buffer into the selected channels."); uiBlockEndAlign(block); xco += (XIC + 8); diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 44528714732..efde2d0b537 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -706,6 +706,160 @@ void NLAEDIT_OT_split (wmOperatorType *ot) /* *********************************************** */ /* NLA Editing Operations (Modifying) */ +/* ******************** Move Strips Up Operator ************************** */ +/* Tries to move the selected strips into the track above if possible. */ + +static int nlaedit_move_up_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + BeztEditData bed; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the editable tracks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* init the editing data */ + memset(&bed, 0, sizeof(BeztEditData)); + + /* since we're potentially moving strips from lower tracks to higher tracks, we should + * loop over the tracks in reverse order to avoid moving earlier strips up multiple tracks + */ + for (ale= anim_data.last; ale; ale= ale->prev) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaTrack *nltn= nlt->next; + NlaStrip *strip, *stripn; + + /* if this track has no tracks after it, skip for now... */ + if (nltn == NULL) + continue; + + /* for every selected strip, try to move */ + for (strip= nlt->strips.first; strip; strip= stripn) { + stripn= strip->next; + + if (strip->flag & NLASTRIP_FLAG_SELECT) { + /* check if the track above has room for this strip */ + if (BKE_nlatrack_has_space(nltn, strip->start, strip->end)) { + /* remove from its current track, and add to the one above (it 'should' work, so no need to worry) */ + BLI_remlink(&nlt->strips, strip); + BKE_nlatrack_add_strip(nltn, strip); + } + } + } + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done */ + return OPERATOR_FINISHED; +} + +void NLAEDIT_OT_move_up (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Move Strips Up"; + ot->idname= "NLAEDIT_OT_move_up"; + ot->description= "Move selected strips up a track if there's room."; + + /* api callbacks */ + ot->exec= nlaedit_move_up_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/* ******************** Move Strips Down Operator ************************** */ +/* Tries to move the selected strips into the track above if possible. */ + +static int nlaedit_move_down_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + BeztEditData bed; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the editable tracks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* init the editing data */ + memset(&bed, 0, sizeof(BeztEditData)); + + /* loop through the tracks in normal order, since we're pushing strips down, + * strips won't get operated on twice + */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaTrack *nltp= nlt->prev; + NlaStrip *strip, *stripn; + + /* if this track has no tracks before it, skip for now... */ + if (nltp == NULL) + continue; + + /* for every selected strip, try to move */ + for (strip= nlt->strips.first; strip; strip= stripn) { + stripn= strip->next; + + if (strip->flag & NLASTRIP_FLAG_SELECT) { + /* check if the track below has room for this strip */ + if (BKE_nlatrack_has_space(nltp, strip->start, strip->end)) { + /* remove from its current track, and add to the one above (it 'should' work, so no need to worry) */ + BLI_remlink(&nlt->strips, strip); + BKE_nlatrack_add_strip(nltp, strip); + } + } + } + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done */ + return OPERATOR_FINISHED; +} + +void NLAEDIT_OT_move_down (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Move Strips Down"; + ot->idname= "NLAEDIT_OT_move_down"; + ot->description= "Move selected strips down a track if there's room."; + + /* api callbacks */ + ot->exec= nlaedit_move_down_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /* ******************** Apply Scale Operator ***************************** */ /* Reset the scaling of the selected strips to 1.0f */ diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index 11dfc5575b1..939e886abeb 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -159,6 +159,11 @@ static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemO(layout, NULL, 0, "NLAEDIT_OT_apply_scale"); uiItemO(layout, NULL, 0, "NLAEDIT_OT_clear_scale"); + + uiItemS(layout); + + uiItemO(layout, NULL, 0, "NLAEDIT_OT_move_up"); + uiItemO(layout, NULL, 0, "NLAEDIT_OT_move_down"); } static void nla_addmenu(bContext *C, uiLayout *layout, void *arg_unused) diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 17fad5db47f..7056139d734 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -99,6 +99,9 @@ void NLAEDIT_OT_duplicate(wmOperatorType *ot); void NLAEDIT_OT_delete(wmOperatorType *ot); void NLAEDIT_OT_split(wmOperatorType *ot); +void NLAEDIT_OT_move_up(wmOperatorType *ot); +void NLAEDIT_OT_move_down(wmOperatorType *ot); + void NLAEDIT_OT_apply_scale(wmOperatorType *ot); void NLAEDIT_OT_clear_scale(wmOperatorType *ot); diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 531e049d29a..35db79a0b38 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -150,6 +150,9 @@ void nla_operatortypes(void) WM_operatortype_append(NLAEDIT_OT_delete); WM_operatortype_append(NLAEDIT_OT_split); + WM_operatortype_append(NLAEDIT_OT_move_up); + WM_operatortype_append(NLAEDIT_OT_move_down); + WM_operatortype_append(NLAEDIT_OT_apply_scale); WM_operatortype_append(NLAEDIT_OT_clear_scale); } @@ -242,8 +245,14 @@ static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) /* split */ WM_keymap_add_item(keymap, "NLAEDIT_OT_split", YKEY, KM_PRESS, 0, 0); + /* move up */ + WM_keymap_add_item(keymap, "NLAEDIT_OT_move_up", PAGEUPKEY, KM_PRESS, 0, 0); + /* move down */ + WM_keymap_add_item(keymap, "NLAEDIT_OT_move_down", PAGEDOWNKEY, KM_PRESS, 0, 0); + /* apply scale */ WM_keymap_add_item(keymap, "NLAEDIT_OT_apply_scale", AKEY, KM_PRESS, KM_CTRL, 0); + /* clear scale */ WM_keymap_add_item(keymap, "NLAEDIT_OT_clear_scale", SKEY, KM_PRESS, KM_ALT, 0); /* transform system */ -- cgit v1.2.3 From 5d6801a472d2d87c4ae0e20a6ee1ca6db54e5934 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 27 Jun 2009 13:10:18 +0000 Subject: 2.5 Mesh editmode fix: Add new primitive often was on wrong location. Viva Vazquez testing! :) --- source/blender/editors/mesh/editmesh_add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 8483aee52f4..12138ee13d2 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -1295,9 +1295,9 @@ static float new_primitive_matrix(bContext *C, float primmat[][4]) /* center */ curs= give_cursor(scene, v3d); VECCOPY(primmat[3], curs); + VECSUB(primmat[3], primmat[3], obedit->obmat[3]); Mat3Inv(imat, mat); Mat3MulVecfl(imat, primmat[3]); - VECSUB(primmat[3], primmat[3], obedit->obmat[3]); if(v3d) return v3d->grid; return 1.0f; -- cgit v1.2.3 From ce15921a68248065800da74360530a5c8c849f46 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sat, 27 Jun 2009 13:20:19 +0000 Subject: 2.5 RNA: * Added more softbody properties (collision, solver) and some flags in object RNA. --- source/blender/makesrna/intern/rna_object.c | 35 ++++++++++ source/blender/makesrna/intern/rna_object_force.c | 81 ++++++++++++++++++++--- 2 files changed, 108 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 3721c7d4ccb..3e320ca0b8c 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -33,6 +33,7 @@ #include "DNA_customdata_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" +#include "DNA_object_force.h" #include "DNA_object_types.h" #include "DNA_property_types.h" #include "DNA_scene_types.h" @@ -1119,6 +1120,40 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_POSEMODE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Pose Mode", "Object with armature data is in pose mode."); + + /* Softbody Flags */ + + prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_ENABLE); + RNA_def_property_ui_text(prop, "Enable Softbody", "Sets object to become soft body"); + + prop= RNA_def_property(srna, "use_goal", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_GOAL); + RNA_def_property_ui_text(prop, "Use Goal", "Define forces for vertices to stick to animated position"); + + prop= RNA_def_property(srna, "use_edges", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_EDGES); + RNA_def_property_ui_text(prop, "Use Edges", "Use Edges as springs"); + + prop= RNA_def_property(srna, "stiff_quads", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_QUADS); + RNA_def_property_ui_text(prop, "Stiff Quads", "Adds diagonal springs on 4-gons"); + + prop= RNA_def_property(srna, "edge_collision", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_EDGECOLL); + RNA_def_property_ui_text(prop, "Edge Collision", "Edge collide too"); + + prop= RNA_def_property(srna, "face_collision", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_FACECOLL); + RNA_def_property_ui_text(prop, "Face Collision", "Faces collide too SLOOOOOW warning"); + + prop= RNA_def_property(srna, "new_aero", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_AERO_ANGLE); + RNA_def_property_ui_text(prop, "N", "New aero(uses angle and length)"); + + prop= RNA_def_property(srna, "selfcollision", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_SELF); + RNA_def_property_ui_text(prop, "Self Collision", "Enable naive vertex ball self collision"); // XXX this stuff should be moved to AnimData... /* diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index f9a93a0a5a2..01901596155 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -412,6 +412,14 @@ static void rna_def_softbody(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; + + static EnumPropertyItem collision_type_items[] = { + {SBC_MODE_MANUAL, "MANUAL", 0, "Manual", "Manual adjust"}, + {SBC_MODE_AVG, "AVERAGE", 0, "Average", "Average Spring lenght * Ball Size"}, + {SBC_MODE_MIN, "MINIMAL", 0, "Minimal", "Minimal Spring lenght * Ball Size"}, + {SBC_MODE_MAX, "MAXIMAL", 0, "Maximal", "Maximal Spring lenght * Ball Size"}, + {SBC_MODE_AVGMINMAX, "MINMAX", 0, "AvMinMax", "(Min+Max)/2 * Ball Size"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SoftBodySettings", NULL); RNA_def_struct_sdna(srna, "SoftBody"); @@ -474,43 +482,100 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "pull", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "inspring"); - RNA_def_property_range(prop, 0.0f, 0.999f); + RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Pull", "Edge spring stiffness when longer than rest length"); prop= RNA_def_property(srna, "push", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "inpush"); - RNA_def_property_range(prop, 0.0f, 0.999f); + RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Push", "Edge spring stiffness when shorter than rest length"); prop= RNA_def_property(srna, "damp", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "infrict"); - RNA_def_property_range(prop, 0.0f, 50.0f); + RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Damp", "Edge spring friction"); prop= RNA_def_property(srna, "spring_lenght", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "springpreload"); - RNA_def_property_range(prop, 0.0f, 200.0f); + RNA_def_property_range(prop, 0.0f, 200.0f); RNA_def_property_ui_text(prop, "SL", "Alter spring lenght to shrink/blow up (unit %) 0 to disable"); prop= RNA_def_property(srna, "aero", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aeroedge"); - RNA_def_property_range(prop, 0.0f, 30000.0f); + RNA_def_property_range(prop, 0.0f, 30000.0f); RNA_def_property_ui_text(prop, "Aero", "Make edges 'sail'"); prop= RNA_def_property(srna, "plastic", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "plastic"); - RNA_def_property_range(prop, 0.0f, 100.0f); + RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Plastic", "Permanent deform"); prop= RNA_def_property(srna, "bending", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "secondspring"); - RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Bending", "Bending Stiffness"); prop= RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shearstiff"); - RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Shear", "Shear Stiffness"); + + /* Collision */ + + prop= RNA_def_property(srna, "collision_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "sbc_mode"); + RNA_def_property_enum_items(prop, collision_type_items); + RNA_def_property_ui_text(prop, "Collision Type", "Choose Collision Type"); + + prop= RNA_def_property(srna, "ball_size", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "colball"); + RNA_def_property_range(prop, -10.0f, 10.0f); + RNA_def_property_ui_text(prop, "Ball Size", "Absolute ball size or factor if not manual adjusted"); + + prop= RNA_def_property(srna, "ball_stiff", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "ballstiff"); + RNA_def_property_range(prop, 0.001f, 100.0f); + RNA_def_property_ui_text(prop, "Ball Size", "Ball inflating presure"); + + prop= RNA_def_property(srna, "ball_damp", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "balldamp"); + RNA_def_property_range(prop, 0.001f, 1.0f); + RNA_def_property_ui_text(prop, "Ball Size", "Blending to inelastic collision"); + + /* Solver */ + + prop= RNA_def_property(srna, "error_limit", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "rklimit"); + RNA_def_property_range(prop, 0.001f, 10.0f); + RNA_def_property_ui_text(prop, "Error Limit", "The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed"); + + prop= RNA_def_property(srna, "minstep", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "minloops"); + RNA_def_property_range(prop, 0, 30000); + RNA_def_property_ui_text(prop, "Min Step", "Minimal # solver steps/frame"); + + prop= RNA_def_property(srna, "maxstep", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "maxloops"); + RNA_def_property_range(prop, 0, 30000); + RNA_def_property_ui_text(prop, "Max Step", "Maximal # solver steps/frame"); + + prop= RNA_def_property(srna, "choke", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "choke"); + RNA_def_property_range(prop, 0, 100); + RNA_def_property_ui_text(prop, "Choke", "'Viscosity' inside collision target"); + + prop= RNA_def_property(srna, "fuzzy", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "fuzzyness"); + RNA_def_property_range(prop, 1, 100); + RNA_def_property_ui_text(prop, "Fuzzy", "Fuzzyness while on collision, high values make collsion handling faster but less stable"); + + prop= RNA_def_property(srna, "auto_step", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_OLDERR); + RNA_def_property_ui_text(prop, "V", "Use velocities for automagic step sizes"); + + prop= RNA_def_property(srna, "diagnose", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_MONITOR); + RNA_def_property_ui_text(prop, "Print Performance to Console", "Turn on SB diagnose console prints"); } void RNA_def_object_force(BlenderRNA *brna) -- cgit v1.2.3 From 1d135cb95595f32164cb485115b8693cadb99b02 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 27 Jun 2009 14:02:21 +0000 Subject: RNA: move softbody flags from Object to SoftBodySettings. --- source/blender/makesrna/intern/rna_object.c | 34 ------ source/blender/makesrna/intern/rna_object_force.c | 142 ++++++++++++++++++++++ 2 files changed, 142 insertions(+), 34 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 3e320ca0b8c..5b553469bc8 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1120,40 +1120,6 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_POSEMODE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Pose Mode", "Object with armature data is in pose mode."); - - /* Softbody Flags */ - - prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_ENABLE); - RNA_def_property_ui_text(prop, "Enable Softbody", "Sets object to become soft body"); - - prop= RNA_def_property(srna, "use_goal", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_GOAL); - RNA_def_property_ui_text(prop, "Use Goal", "Define forces for vertices to stick to animated position"); - - prop= RNA_def_property(srna, "use_edges", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_EDGES); - RNA_def_property_ui_text(prop, "Use Edges", "Use Edges as springs"); - - prop= RNA_def_property(srna, "stiff_quads", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_QUADS); - RNA_def_property_ui_text(prop, "Stiff Quads", "Adds diagonal springs on 4-gons"); - - prop= RNA_def_property(srna, "edge_collision", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_EDGECOLL); - RNA_def_property_ui_text(prop, "Edge Collision", "Edge collide too"); - - prop= RNA_def_property(srna, "face_collision", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_FACECOLL); - RNA_def_property_ui_text(prop, "Face Collision", "Faces collide too SLOOOOOW warning"); - - prop= RNA_def_property(srna, "new_aero", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_AERO_ANGLE); - RNA_def_property_ui_text(prop, "N", "New aero(uses angle and length)"); - - prop= RNA_def_property(srna, "selfcollision", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_SELF); - RNA_def_property_ui_text(prop, "Self Collision", "Enable naive vertex ball self collision"); // XXX this stuff should be moved to AnimData... /* diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 01901596155..07408c59538 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -113,6 +113,113 @@ static void rna_Cache_idname_change(bContext *C, PointerRNA *ptr) BLI_freelistN(&pidlist); } + +static int rna_SoftBodySettings_use_edges_get(PointerRNA *ptr) +{ + Object *data= (Object*)(ptr->data); + return (((data->softflag) & OB_SB_EDGES) != 0); +} + +static void rna_SoftBodySettings_use_edges_set(PointerRNA *ptr, int value) +{ + Object *data= (Object*)(ptr->data); + if(value) data->softflag |= OB_SB_EDGES; + else data->softflag &= ~OB_SB_EDGES; +} + +static int rna_SoftBodySettings_use_goal_get(PointerRNA *ptr) +{ + Object *data= (Object*)(ptr->data); + return (((data->softflag) & OB_SB_GOAL) != 0); +} + +static void rna_SoftBodySettings_use_goal_set(PointerRNA *ptr, int value) +{ + Object *data= (Object*)(ptr->data); + if(value) data->softflag |= OB_SB_GOAL; + else data->softflag &= ~OB_SB_GOAL; +} + +static int rna_SoftBodySettings_stiff_quads_get(PointerRNA *ptr) +{ + Object *data= (Object*)(ptr->data); + return (((data->softflag) & OB_SB_QUADS) != 0); +} + +static void rna_SoftBodySettings_stiff_quads_set(PointerRNA *ptr, int value) +{ + Object *data= (Object*)(ptr->data); + if(value) data->softflag |= OB_SB_QUADS; + else data->softflag &= ~OB_SB_QUADS; +} + +static int rna_SoftBodySettings_self_collision_get(PointerRNA *ptr) +{ + Object *data= (Object*)(ptr->data); + return (((data->softflag) & OB_SB_SELF) != 0); +} + +static void rna_SoftBodySettings_self_collision_set(PointerRNA *ptr, int value) +{ + Object *data= (Object*)(ptr->data); + if(value) data->softflag |= OB_SB_SELF; + else data->softflag &= ~OB_SB_SELF; +} + +static int rna_SoftBodySettings_new_aero_get(PointerRNA *ptr) +{ + Object *data= (Object*)(ptr->data); + return (((data->softflag) & OB_SB_AERO_ANGLE) != 0); +} + +static void rna_SoftBodySettings_new_aero_set(PointerRNA *ptr, int value) +{ + Object *data= (Object*)(ptr->data); + if(value) data->softflag |= OB_SB_AERO_ANGLE; + else data->softflag &= ~OB_SB_AERO_ANGLE; +} + +static int rna_SoftBodySettings_enabled_get(PointerRNA *ptr) +{ + Object *data= (Object*)(ptr->data); + return (((data->softflag) & OB_SB_ENABLE) != 0); +} + +#if 0 +static void rna_SoftBodySettings_enabled_set(PointerRNA *ptr, int value) +{ + Object *data= (Object*)(ptr->data); + if(value) data->softflag |= OB_SB_ENABLE; + else data->softflag &= ~OB_SB_ENABLE; +} +#endif + +static int rna_SoftBodySettings_face_collision_get(PointerRNA *ptr) +{ + Object *data= (Object*)(ptr->data); + return (((data->softflag) & OB_SB_FACECOLL) != 0); +} + +static void rna_SoftBodySettings_face_collision_set(PointerRNA *ptr, int value) +{ + Object *data= (Object*)(ptr->data); + if(value) data->softflag |= OB_SB_FACECOLL; + else data->softflag &= ~OB_SB_FACECOLL; +} + +static int rna_SoftBodySettings_edge_collision_get(PointerRNA *ptr) +{ + Object *data= (Object*)(ptr->data); + return (((data->softflag) & OB_SB_EDGECOLL) != 0); +} + +static void rna_SoftBodySettings_edge_collision_set(PointerRNA *ptr, int value) +{ + Object *data= (Object*)(ptr->data); + if(value) data->softflag |= OB_SB_EDGECOLL; + else data->softflag &= ~OB_SB_EDGECOLL; +} + #else static void rna_def_pointcache(BlenderRNA *brna) @@ -576,6 +683,41 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "diagnose", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_MONITOR); RNA_def_property_ui_text(prop, "Print Performance to Console", "Turn on SB diagnose console prints"); + + /* Flags */ + + prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_enabled_get", "rna_SoftBodySettings_enabled_set"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Enable", "Sets object to become soft body."); + + prop= RNA_def_property(srna, "use_goal", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_use_goal_get", "rna_SoftBodySettings_use_goal_set"); + RNA_def_property_ui_text(prop, "Use Goal", "Define forces for vertices to stick to animated position."); + + prop= RNA_def_property(srna, "use_edges", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_use_edges_get", "rna_SoftBodySettings_use_edges_set"); + RNA_def_property_ui_text(prop, "Use Edges", "Use Edges as springs"); + + prop= RNA_def_property(srna, "stiff_quads", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_stiff_quads_get", "rna_SoftBodySettings_stiff_quads_set"); + RNA_def_property_ui_text(prop, "Stiff Quads", "Adds diagonal springs on 4-gons."); + + prop= RNA_def_property(srna, "edge_collision", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_edge_collision_get", "rna_SoftBodySettings_edge_collision_set"); + RNA_def_property_ui_text(prop, "Edge Collision", "Edges collide too."); + + prop= RNA_def_property(srna, "face_collision", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_face_collision_get", "rna_SoftBodySettings_face_collision_set"); + RNA_def_property_ui_text(prop, "Face Collision", "Faces collide too, SLOOOOOW warning."); + + prop= RNA_def_property(srna, "new_aero", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_new_aero_get", "rna_SoftBodySettings_new_aero_set"); + RNA_def_property_ui_text(prop, "N", "New aero(uses angle and length)."); + + prop= RNA_def_property(srna, "self_collision", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_self_collision_get", "rna_SoftBodySettings_self_collision_set"); + RNA_def_property_ui_text(prop, "Self Collision", "Enable naive vertex ball self collision."); } void RNA_def_object_force(BlenderRNA *brna) -- cgit v1.2.3 From c9513df56196c119dfa947fe76a96ddf095b3c5c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 27 Jun 2009 14:35:24 +0000 Subject: UI: * Fix issue with icon not being left-aligned in text field. * Put modifier tab after data tab in buttons header. --- source/blender/editors/interface/interface.c | 9 +++------ source/blender/editors/space_buttons/buttons_header.c | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 3a61237e1cb..a9866d8898e 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2077,13 +2077,10 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short rgb_to_hsv(rgb[0], rgb[1], rgb[2], but->hsv, but->hsv+1, but->hsv+2); } - if((block->flag & UI_BLOCK_LOOP) || ELEM7(but->type, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM, SEARCH_MENU)) { - but->flag |= UI_TEXT_LEFT; - } - - if(but->type==BUT_TOGDUAL) { + if((block->flag & UI_BLOCK_LOOP) || ELEM7(but->type, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM, SEARCH_MENU)) + but->flag |= (UI_TEXT_LEFT|UI_ICON_LEFT); + else if(but->type==BUT_TOGDUAL) but->flag |= UI_ICON_LEFT; - } but->flag |= (block->flag & UI_BUT_ALIGN); diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c index 79284ada483..7c622f172a2 100644 --- a/source/blender/editors/space_buttons/buttons_header.c +++ b/source/blender/editors/space_buttons/buttons_header.c @@ -173,10 +173,10 @@ void buttons_header_buttons(const bContext *C, ARegion *ar) uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_OBJECT_DATA, xco+=XIC, yco, XIC, YIC, &(sbuts->mainb), 0.0, (float)BCONTEXT_OBJECT, 0, 0, "Object"); if(sbuts->pathflag & (1<mainb), 0.0, (float)BCONTEXT_CONSTRAINT, 0, 0, "Constraint"); - if(sbuts->pathflag & (1<mainb), 0.0, (float)BCONTEXT_MODIFIER, 0, 0, "Modifier"); if(sbuts->pathflag & (1<dataicon, xco+=XIC, yco, XIC, YIC, &(sbuts->mainb), 0.0, (float)BCONTEXT_DATA, 0, 0, "Object Data"); + if(sbuts->pathflag & (1<mainb), 0.0, (float)BCONTEXT_MODIFIER, 0, 0, "Modifier"); if(sbuts->pathflag & (1<mainb), 0.0, (float)BCONTEXT_BONE, 0, 0, "Bone"); if(sbuts->pathflag & (1< Date: Sat, 27 Jun 2009 15:21:37 +0000 Subject: 2.5 Test commit; toolbar has 'add operator' menu in mesh editmode. Nothing stored, freed here... Also: removed reading .B.blend, since a much better default has been compiled in now, prevents confusing testers who run 2.5 for the first time. :) Of course .B25.blend still works. --- source/blender/editors/object/object_edit.c | 10 +-- .../blender/editors/space_view3d/view3d_toolbar.c | 98 ++++++++++++++++++---- source/blender/windowmanager/intern/wm_files.c | 2 - 3 files changed, 89 insertions(+), 21 deletions(-) (limited to 'source') diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 8102b1bfb9c..c436ccdb328 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -388,7 +388,7 @@ static int object_add_mesh_exec(bContext *C, wmOperator *op) void OBJECT_OT_mesh_add(wmOperatorType *ot) { /* identifiers */ - ot->name= "Mesh"; + ot->name= "Add Mesh"; ot->description = "Add a mesh object to the scene."; ot->idname= "OBJECT_OT_mesh_add"; @@ -462,7 +462,7 @@ static int object_add_curve_invoke(bContext *C, wmOperator *op, wmEvent *event) void OBJECT_OT_curve_add(wmOperatorType *ot) { /* identifiers */ - ot->name= "Curve"; + ot->name= "Add Curve"; ot->description = "Add a curve object to the scene."; ot->idname= "OBJECT_OT_curve_add"; @@ -520,7 +520,7 @@ static int object_add_surface_exec(bContext *C, wmOperator *op) void OBJECT_OT_surface_add(wmOperatorType *ot) { /* identifiers */ - ot->name= "Surface"; + ot->name= "Add Surface"; ot->description = "Add a surface object to the scene."; ot->idname= "OBJECT_OT_surface_add"; @@ -557,7 +557,7 @@ static int object_add_text_exec(bContext *C, wmOperator *op) void OBJECT_OT_text_add(wmOperatorType *ot) { /* identifiers */ - ot->name= "Text"; + ot->name= "Add Text"; ot->description = "Add a text object to the scene"; ot->idname= "OBJECT_OT_text_add"; @@ -602,7 +602,7 @@ static int object_armature_add_exec(bContext *C, wmOperator *op) void OBJECT_OT_armature_add(wmOperatorType *ot) { /* identifiers */ - ot->name= "Armature"; + ot->name= "Add Armature"; ot->description = "Add an armature object to the scene."; ot->idname= "OBJECT_OT_armature_add"; diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 88af60ac0f4..34a935103a7 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -148,8 +148,82 @@ static void view3d_panel_operator_redo(const bContext *C, Panel *pa) uiDefAutoButsRNA(C, pa->layout, &ptr, 1); } +/* ******************* */ + +typedef struct CustomTool { + struct CustomTool *next, *prev; + char opname[OP_MAX_TYPENAME]; +} CustomTool; + +static void operator_call_cb(struct bContext *C, void *arg_listbase, void *arg2) +{ + wmOperatorType *ot= arg2; + + if(ot) { + CustomTool *ct= MEM_callocN(sizeof(CustomTool), "CustomTool"); + + BLI_addtail(arg_listbase, ct); + BLI_strncpy(ct->opname, ot->idname, OP_MAX_TYPENAME); + } + +} + +static void operator_search_cb(const struct bContext *C, void *arg, char *str, uiSearchItems *items) +{ + wmOperatorType *ot = WM_operatortype_first(); + + for(; ot; ot= ot->next) { + + if(BLI_strcasestr(ot->name, str)) { + if(ot->poll==NULL || ot->poll((bContext *)C)) { + + if(0==uiSearchItemAdd(items, ot->name, ot, 0)) + break; + } + } + } +} + + +/* ID Search browse menu, open */ +static uiBlock *tool_search_menu(bContext *C, ARegion *ar, void *arg_listbase) +{ + static char search[OP_MAX_TYPENAME]; + wmEvent event; + wmWindow *win= CTX_wm_window(C); + uiBlock *block; + uiBut *but; + + /* clear initial search string, then all items show */ + search[0]= 0; + + block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS); + uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1); + + /* fake button, it holds space for search items */ + uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); + + but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, OP_MAX_TYPENAME, 10, 0, 150, 19, ""); + uiButSetSearchFunc(but, operator_search_cb, arg_listbase, operator_call_cb); + + uiBoundsBlock(block, 6); + uiBlockSetDirection(block, UI_DOWN); + uiEndBlock(C, block); + + event= *(win->eventstate); /* XXX huh huh? make api call */ + event.type= EVT_BUT_OPEN; + event.val= KM_PRESS; + event.customdata= but; + event.customdatafree= FALSE; + wm_event_add(win, &event); + + return block; +} + + static void view3d_panel_tools(const bContext *C, Panel *pa) { + static ListBase tools= {NULL, NULL}; Object *obedit= CTX_data_edit_object(C); // Object *obact = CTX_data_active_object(C); uiLayout *col; @@ -157,24 +231,20 @@ static void view3d_panel_tools(const bContext *C, Panel *pa) if(obedit) { if(obedit->type==OB_MESH) { - // void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDProperty *properties, int context) - col= uiLayoutColumn(pa->layout, 1); - uiItemFullO(col, NULL, 0, "MESH_OT_delete", NULL, WM_OP_INVOKE_REGION_WIN); - - col= uiLayoutColumn(pa->layout, 1); - uiItemFullO(col, NULL, 0, "MESH_OT_subdivide", NULL, WM_OP_INVOKE_REGION_WIN); - - col= uiLayoutColumn(pa->layout, 1); - uiItemFullO(col, NULL, 0, "MESH_OT_primitive_monkey_add", NULL, WM_OP_INVOKE_REGION_WIN); - uiItemFullO(col, NULL, 0, "MESH_OT_primitive_uv_sphere_add", NULL, WM_OP_INVOKE_REGION_WIN); - - col= uiLayoutColumn(pa->layout, 1); - uiItemFullO(col, NULL, 0, "MESH_OT_select_all_toggle", NULL, WM_OP_INVOKE_REGION_WIN); - col= uiLayoutColumn(pa->layout, 1); uiItemFullO(col, NULL, 0, "MESH_OT_spin", NULL, WM_OP_INVOKE_REGION_WIN); uiItemFullO(col, NULL, 0, "MESH_OT_screw", NULL, WM_OP_INVOKE_REGION_WIN); + if(tools.first) { + CustomTool *ct; + + for(ct= tools.first; ct; ct= ct->next) { + col= uiLayoutColumn(pa->layout, 1); + uiItemFullO(col, NULL, 0, ct->opname, NULL, WM_OP_INVOKE_REGION_WIN); + } + } + col= uiLayoutColumn(pa->layout, 1); + uiDefBlockBut(uiLayoutGetBlock(pa->layout), tool_search_menu, &tools, "Add Operator", 0, 0, UI_UNIT_X, UI_UNIT_Y, "Add tool"); } } else { diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index d13d8ec6ccc..861080f30ba 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -294,8 +294,6 @@ int WM_read_homefile(bContext *C, wmOperator *op) G.relbase_valid = 0; if (!from_memory) { BLI_make_file_string(G.sce, tstr, home, ".B25.blend"); - if(!BLI_exists(tstr)) - BLI_make_file_string(G.sce, tstr, home, ".B.blend"); } strcpy(scestr, G.sce); /* temporary store */ -- cgit v1.2.3 From 912c2f440b447aa8cae9f3e3a86acf51cd495e3d Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sat, 27 Jun 2009 15:28:58 +0000 Subject: Pointcache refresh part 2 * Based on what happens during simulation the cache is marked (also in cache panel, this could possibly be extended to 3d view as well) as: - exact (not marked) - outdated (simulation is not done completely with current settings) - non-exact (frames were skipped during simulation) * The parameter "cache step" effects the number of frames between saved cache frames. - This can save a lot of memory (or disk space) if absolutely frame accurate simulation is not required. - Speeds up the "quick caching" very much. - Frames between cached frames are interpolated from the cached frames. - Current default value of 10 frames works nicely with up/down-arrows (skip 10 frames forwards/backwards on timeline), but can be changed if wanted. * The caching can work in normal or "quick" mode: [Normal cache] - Basic: Calculate what even happens (settings change, big frame steps etc.) and cache results, if possible try to use "cache step" when saving cache frames. - Becomes non-exact: After larger than 1 frame steps. - Becomes outdated: After any change effecting the simulation other than frame steps. - Pros/cons: Freedom of doing anything and playing with particles, but exact results have to calculated from the beginning. [Quick cache] - Basic: Calculate simulation up to current frame automatically on changes with cache step sized jumps in simulation. With multiple "quick cached" simulations the smallest cache step is used. - Becomes non-exact: Always from frame 1 (unless cache step = 1). - Becomes outdated: Never. - Pros/cons: Not very accurate, but super fast! - Todo: Transform of any animated (non-autokeyed) object is locked! Probably needs some tinkering with anim sys overrides. * The simulation can be run forwards or backwards even if it's cache is outdated or non-exact, the following rules apply in these situations: - step forwards (to unknown) -> simulate from last exact frame, store result - step backwards (to known) -> result is interpolated from existing frames, store result, clear cache forwards if current frame is after last exact frame * "Calculate to current frame" runs the simulation from start to current frame with a frame steps of 1. - Baking does the same, but runs the simulation all the way to the end of simulation. - Rendering does this automatically if the simulation is outdated of non-exact, so all rendered simulations will always be updated and exact. * Every cache panel also holds buttons to "Bake all dynamics", "Free all dynamics" and "Update all dynamics to current frame". * Cloth simulation supports the new cache too. --- source/blender/blenkernel/BKE_cloth.h | 5 +- source/blender/blenkernel/BKE_particle.h | 1 - source/blender/blenkernel/BKE_pointcache.h | 13 +- source/blender/blenkernel/intern/cloth.c | 164 ++++--- source/blender/blenkernel/intern/implicit.c | 10 +- source/blender/blenkernel/intern/particle.c | 27 +- source/blender/blenkernel/intern/particle_system.c | 57 ++- source/blender/blenkernel/intern/pointcache.c | 475 +++++++++++++-------- source/blender/blenloader/intern/readfile.c | 13 +- source/blender/blenloader/intern/writefile.c | 5 +- source/blender/editors/physics/ed_pointcache.c | 122 +++++- .../editors/transform/transform_conversions.c | 6 + source/blender/makesdna/DNA_object_force.h | 9 +- source/blender/makesrna/intern/rna_cloth.c | 43 ++ source/blender/makesrna/intern/rna_object_force.c | 49 ++- source/blender/render/intern/source/pipeline.c | 1 + .../blender/windowmanager/intern/wm_event_system.c | 3 + 17 files changed, 689 insertions(+), 314 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h index e09be838f06..4270c677338 100644 --- a/source/blender/blenkernel/BKE_cloth.h +++ b/source/blender/blenkernel/BKE_cloth.h @@ -46,6 +46,7 @@ #include "DNA_meshdata_types.h" #include "DNA_modifier_types.h" #include "DNA_object_types.h" +#include "DNA_scene_types.h" #include "BKE_collision.h" @@ -245,8 +246,8 @@ void bvhtree_update_from_cloth ( ClothModifierData *clmd, int moving ); void bvhselftree_update_from_cloth ( ClothModifierData *clmd, int moving ); // needed for editmesh.c -void cloth_write_cache ( Object *ob, ClothModifierData *clmd, float framenr ); -int cloth_read_cache ( Object *ob, ClothModifierData *clmd, float framenr ); +void cloth_write_cache( Object *ob, ClothModifierData *clmd, int framenr ); +int cloth_read_cache( Scene *scene, Object *ob, ClothModifierData *clmd, float framenr, int *old_framenr ); // needed for button_object.c void cloth_clear_cache ( Object *ob, ClothModifierData *clmd, float framenr ); diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index 0ecd71fc4a3..08aa111e0e6 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -252,7 +252,6 @@ struct ParticleSystemModifierData *psys_get_modifier(struct Object *ob, struct P struct ParticleSettings *psys_new_settings(char *name, struct Main *main); struct ParticleSettings *psys_copy_settings(struct ParticleSettings *part); -int psys_count_autocache(struct Scene *scene, struct ParticleSettings *part); void psys_flush_particle_settings(struct Scene *scene, struct ParticleSettings *part, int recalc); void make_local_particlesettings(struct ParticleSettings *part); diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index b79357edf36..3f1c45d28ec 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -93,7 +93,7 @@ typedef struct PTCacheWriter { int cfra; int totelem; - float *(*elem_ptr)(int index, void *calldata); + void (*set_elem)(int index, void *calldata, float *data); void *calldata; } PTCacheWriter; @@ -103,12 +103,10 @@ typedef struct PTCacheReader { float cfra; int totelem; - void (*set_elem)(int index, void *calldata, float *data); - void (*interpolate_elem)(int index, void *calldata, float frs_sec, float cfra, int cfra1, int cfra2, float *data1, float *data2); + void (*set_elem)(int elem_index, void *calldata, float *data); + void (*interpolate_elem)(int index, void *calldata, float frs_sec, float cfra, float cfra1, float cfra2, float *data1, float *data2); void *calldata; - int allow_interpolate; - int allow_old; int *old_frame; } PTCacheReader; @@ -116,6 +114,7 @@ typedef struct PTCacheBaker { struct Scene *scene; int bake; int render; + int quick_step; struct PTCacheID *pid; int (*break_test)(void *data); void *break_data; @@ -146,6 +145,8 @@ void BKE_ptcache_file_close(PTCacheFile *pf); int BKE_ptcache_file_read_floats(PTCacheFile *pf, float *f, int tot); int BKE_ptcache_file_write_floats(PTCacheFile *pf, float *f, int tot); +void BKE_ptcache_update_info(PTCacheID *pid); + /* General cache reading/writing */ int BKE_ptcache_read_cache(PTCacheReader *reader); int BKE_ptcache_write_cache(PTCacheWriter *writer); @@ -160,7 +161,7 @@ void BKE_ptcache_free(struct PointCache *cache); struct PointCache *BKE_ptcache_copy(struct PointCache *cache); /* Baking */ -void BKE_ptcache_autocache_all(struct Scene *scene); +void BKE_ptcache_quick_cache_all(struct Scene *scene); void BKE_ptcache_make_cache(struct PTCacheBaker* baker); void BKE_ptcache_toggle_disk_cache(struct PTCacheID *pid); diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index e98d7bb01a4..08caea565aa 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -33,6 +33,7 @@ #include "DNA_mesh_types.h" #include "DNA_object_force.h" #include "DNA_scene_types.h" +#include "DNA_particle_types.h" #include "BKE_deform.h" #include "BKE_DerivedMesh.h" @@ -42,6 +43,7 @@ #include "BKE_object.h" #include "BKE_modifier.h" #include "BKE_utildefines.h" +#include "BKE_particle.h" #include "BKE_pointcache.h" @@ -339,78 +341,99 @@ void bvhselftree_update_from_cloth(ClothModifierData *clmd, int moving) } int modifiers_indexInObject(Object *ob, ModifierData *md_seek); +static void cloth_write_state(int index, Cloth *cloth, float *data) +{ + ClothVertex *vert = cloth->verts + index; -int cloth_read_cache(Object *ob, ClothModifierData *clmd, float framenr) + memcpy(data, vert->x, 3 * sizeof(float)); + memcpy(data + 3, vert->xconst, 3 * sizeof(float)); + memcpy(data + 6, vert->v, 3 * sizeof(float)); +} +static void cloth_read_state(int index, Cloth *cloth, float *data) { - PTCacheID pid; - PTCacheFile *pf; - Cloth *cloth = clmd->clothObject; - unsigned int a, ret = 1; + ClothVertex *vert = cloth->verts + index; - if(!cloth) - return 0; - - BKE_ptcache_id_from_cloth(&pid, ob, clmd); - pf = BKE_ptcache_file_open(&pid, PTCACHE_FILE_READ, framenr); - if(pf) { - for(a = 0; a < cloth->numverts; a++) { - if(!BKE_ptcache_file_read_floats(pf, cloth->verts[a].x, 3)) { - ret = 0; - break; - } - if(!BKE_ptcache_file_read_floats(pf, cloth->verts[a].xconst, 3)) { - ret = 0; - break; - } - if(!BKE_ptcache_file_read_floats(pf, cloth->verts[a].v, 3)) { - ret = 0; - break; - } - } - - BKE_ptcache_file_close(pf); - } - else - ret = 0; - - return ret; + memcpy(vert->x, data, 3 * sizeof(float)); + memcpy(vert->xconst, data + 3, 3 * sizeof(float)); + memcpy(vert->v, data + 6, 3 * sizeof(float)); } +static void cloth_cache_interpolate(int index, Cloth *cloth, float frs_sec, float cfra, float cfra1, float cfra2, float *data1, float *data2) +{ + ClothVertex *vert = cloth->verts + index; + ParticleKey keys[4]; + float dfra; -void cloth_clear_cache(Object *ob, ClothModifierData *clmd, float framenr) + if(cfra1 == cfra2) { + cloth_read_state(index, cloth, data1); + return; + } + + memcpy(keys[1].co, data1, 3 * sizeof(float)); + memcpy(keys[1].vel, data1 + 6, 3 * sizeof(float)); + + memcpy(keys[2].co, data2, 3 * sizeof(float)); + memcpy(keys[2].vel, data2 + 6, 3 * sizeof(float)); + + dfra = cfra2 - cfra1; + + VecMulf(keys[1].vel, dfra); + VecMulf(keys[2].vel, dfra); + + psys_interpolate_particle(-1, keys, (cfra - cfra1) / dfra, keys, 1); + + VecMulf(keys->vel, 1.0f / dfra); + + memcpy(vert->x, keys->co, 3 * sizeof(float)); + memcpy(vert->v, keys->vel, 3 * sizeof(float)); + + /* not sure what to do with this - jahka */ + memcpy(vert->xconst, data1 + 3, 3 * sizeof(float)); +} +void cloth_write_cache(Object *ob, ClothModifierData *clmd, int cfra) { + PTCacheWriter writer; PTCacheID pid; - + BKE_ptcache_id_from_cloth(&pid, ob, clmd); - // don't do anything as long as we're in editmode! - if(pid.cache->flag & PTCACHE_BAKE_EDIT_ACTIVE) - return; - - BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_AFTER, framenr); + writer.calldata = clmd->clothObject; + writer.cfra = cfra; + writer.set_elem = cloth_write_state; + writer.pid = &pid; + writer.totelem = clmd->clothObject->numverts; + + BKE_ptcache_write_cache(&writer); } -void cloth_write_cache(Object *ob, ClothModifierData *clmd, float framenr) +int cloth_read_cache(Scene *scene, Object *ob, ClothModifierData *clmd, float cfra, int *old_framenr) { - Cloth *cloth = clmd->clothObject; + PTCacheReader reader; PTCacheID pid; - PTCacheFile *pf; - unsigned int a; - if(!cloth) - return; + BKE_ptcache_id_from_cloth(&pid, ob, clmd); + + reader.calldata = clmd->clothObject; + reader.cfra = cfra; + reader.interpolate_elem = cloth_cache_interpolate; + reader.old_frame = old_framenr; + reader.pid = &pid; + reader.scene = scene; + reader.set_elem = cloth_read_state; + reader.totelem = clmd->clothObject->numverts; + + return BKE_ptcache_read_cache(&reader); +} +void cloth_clear_cache(Object *ob, ClothModifierData *clmd, float framenr) +{ + PTCacheID pid; BKE_ptcache_id_from_cloth(&pid, ob, clmd); - pf = BKE_ptcache_file_open(&pid, PTCACHE_FILE_WRITE, framenr); - if(!pf) + + // don't do anything as long as we're in editmode! + if(pid.cache->flag & PTCACHE_BAKE_EDIT_ACTIVE) return; - for(a = 0; a < cloth->numverts; a++) { - BKE_ptcache_file_write_floats(pf, cloth->verts[a].x, 3); - BKE_ptcache_file_write_floats(pf, cloth->verts[a].xconst, 3); - BKE_ptcache_file_write_floats(pf, cloth->verts[a].v, 3); - } - - BKE_ptcache_file_close(pf); + BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_AFTER, framenr); } static int do_init_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *result, int framenr) @@ -486,6 +509,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, PTCacheID pid; float timescale; int framedelta, framenr, startframe, endframe; + int cache_result, old_framenr; clmd->scene= scene; /* nice to pass on later :) */ framenr= (int)scene->r.cfra; @@ -499,6 +523,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, if(!result) { cache->flag &= ~PTCACHE_SIMULATION_VALID; cache->simframe= 0; + cache->last_exact= 0; return dm; } @@ -510,6 +535,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, if(result->getNumVerts(result) != clmd->clothObject->numverts) { cache->flag &= ~PTCACHE_SIMULATION_VALID; cache->simframe= 0; + cache->last_exact= 0; return result; } } @@ -521,6 +547,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, if(BKE_ptcache_get_continue_physics()) { cache->flag &= ~PTCACHE_SIMULATION_VALID; cache->simframe= 0; + cache->last_exact= 0; /* do simulation */ if(!do_init_cloth(ob, clmd, result, framenr)) @@ -536,6 +563,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, if(framenr < startframe) { cache->flag &= ~PTCACHE_SIMULATION_VALID; cache->simframe= 0; + cache->last_exact= 0; return result; } else if(framenr > endframe) { @@ -552,7 +580,9 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, return result; /* try to read from cache */ - if(cloth_read_cache(ob, clmd, framenr)) { + cache_result = cloth_read_cache(scene, ob, clmd, framenr, &old_framenr); + + if(cache_result == PTCACHE_READ_EXACT || cache_result == PTCACHE_READ_INTERPOLATED) { cache->flag |= PTCACHE_SIMULATION_VALID; cache->simframe= framenr; @@ -561,25 +591,40 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, return result; } + else if(cache_result==PTCACHE_READ_OLD) { + BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_FREE); + + implicit_set_positions(clmd); + + cache->flag |= PTCACHE_SIMULATION_VALID; + cache->simframe= old_framenr; + } else if(ob->id.lib || (cache->flag & PTCACHE_BAKED)) { /* if baked and nothing in cache, do nothing */ cache->flag &= ~PTCACHE_SIMULATION_VALID; cache->simframe= 0; + cache->last_exact= 0; return result; } if(framenr == startframe) { + if(cache->flag & PTCACHE_REDO_NEEDED) { + BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED); + do_init_cloth(ob, clmd, result, framenr); + } cache->flag |= PTCACHE_SIMULATION_VALID; cache->simframe= framenr; /* don't write cache on first frame, but on second frame write * cache for frame 1 and 2 */ } - else if(framedelta == 1) { + else { /* if on second frame, write cache for first frame */ - if(framenr == startframe+1) + if(cache->simframe == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0)) cloth_write_cache(ob, clmd, startframe); + clmd->sim_parms->timescale *= framenr - cache->simframe; + /* do simulation */ cache->flag |= PTCACHE_SIMULATION_VALID; cache->simframe= framenr; @@ -587,16 +632,13 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, if(!do_step_cloth(ob, clmd, result, framenr)) { cache->flag &= ~PTCACHE_SIMULATION_VALID; cache->simframe= 0; + cache->last_exact= 0; } else cloth_write_cache(ob, clmd, framenr); cloth_to_object (ob, clmd, result); } - else { - cache->flag &= ~PTCACHE_SIMULATION_VALID; - cache->simframe= 0; - } return result; } diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index 40c98c1d9cc..fc5213d5532 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -1600,6 +1600,10 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase if(clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_ENABLED) { + float temp = clmd->sim_parms->stepsPerFrame; + /* not too nice hack, but collisions need this correction -jahka */ + clmd->sim_parms->stepsPerFrame /= clmd->sim_parms->timescale; + // collisions // itstart(); @@ -1614,7 +1618,7 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase // call collision function // TODO: check if "step" or "step+dt" is correct - dg - result = cloth_bvh_objcollision(ob, clmd, step, dt); + result = cloth_bvh_objcollision(ob, clmd, step/clmd->sim_parms->timescale, dt/clmd->sim_parms->timescale); // correct velocity again, just to be sure we had to change it due to adaptive collisions for(i = 0; i < numverts; i++) @@ -1637,6 +1641,9 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase } } + /* restore original stepsPerFrame */ + clmd->sim_parms->stepsPerFrame = temp; + // X = Xnew; cp_lfvector(id->X, id->Xnew, numverts); @@ -1654,7 +1661,6 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase simulate_implicit_euler(id->Vnew, id->X, id->V, id->F, id->dFdV, id->dFdX, dt / 2.0f, id->A, id->B, id->dV, id->S, id->z, id->olddV, id->P, id->Pinv, id->M, id->bigI); } - } else { diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 5b3720cd6b0..04215b1ddd1 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -236,31 +236,6 @@ Object *psys_find_object(Scene *scene, ParticleSystem *psys) return NULL; } -int psys_count_autocache(Scene *scene, ParticleSettings *part) -{ - Base *base = scene->base.first; - ParticleSystem *psys; - PTCacheID pid; - int autocache_count= 0; - - for(base = scene->base.first; base; base = base->next) { - for(psys = base->object->particlesystem.first; psys; psys=psys->next) { - if(part && psys->part != part) - continue; - - BKE_ptcache_id_from_particles(&pid, base->object, psys); - - if((psys->pointcache->flag & PTCACHE_BAKED) - || (psys->pointcache->flag & PTCACHE_AUTOCACHE)==0) - continue; - - if((psys->pointcache->flag & PTCACHE_OUTDATED) - || BKE_ptcache_id_exist(&pid, CFRA)==0) - autocache_count++; - } - } - return autocache_count; -} /* change object's active particle system */ void psys_change_act(void *ob_v, void *act_v) { @@ -3740,6 +3715,8 @@ int psys_get_particle_state(struct Scene *scene, Object *ob, ParticleSystem *psy if((pa->alive==PARS_UNBORN && (part->flag & PART_UNBORN)==0) || (pa->alive==PARS_DEAD && (part->flag & PART_DIED)==0)) return 0; + + state->time = MIN2(state->time, pa->dietime); } if(psys->flag & PSYS_KEYED){ diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 97b1956bba9..591b6ca9be5 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -2205,11 +2205,9 @@ void psys_get_pointcache_start_end(Scene *scene, ParticleSystem *psys, int *sfra *sfra = MAX2(1, (int)part->sta); *efra = MIN2((int)(part->end + part->lifetime + 1.0), scene->r.efra); } -static float *particle_state_ptr(int index, void *psys_ptr) +static void particle_write_state(int index, ParticleSystem *psys, float *data) { - ParticleSystem *psys= psys_ptr; - - return (float *)(&(psys->particles+index)->state); + memcpy(data, (float *)(&(psys->particles+index)->state), sizeof(ParticleKey)); } static void particle_read_state(int index, void *psys_ptr, float *data) { @@ -2222,24 +2220,35 @@ static void particle_read_state(int index, void *psys_ptr, float *data) copy_particle_key(&pa->state, key, 1); } -static void particle_cache_interpolate(int index, void *psys_ptr, float frs_sec, float cfra, int cfra1, int cfra2, float *data1, float *data2) +static void particle_cache_interpolate(int index, void *psys_ptr, float frs_sec, float cfra, float cfra1, float cfra2, float *data1, float *data2) { ParticleSystem *psys= psys_ptr; ParticleData *pa = psys->particles + index; ParticleKey keys[4]; - float dfra; + float dfra, cfra1f = (float)cfra1, cfra2f(float); + + cfra = MIN2(cfra, pa->dietime); + cfra1 = MIN2(cfra1, pa->dietime); + cfra2 = MIN2(cfra2, pa->dietime); keys[1] = *((ParticleKey*)data1); keys[2] = *((ParticleKey*)data2); - dfra = keys[2].time - keys[1].time; + if(cfra1 == cfra2) { + copy_particle_key(&pa->state, &keys[1], 1); + return; + } + + dfra = cfra2 - cfra1; VecMulf(keys[1].vel, dfra / frs_sec); VecMulf(keys[2].vel, dfra / frs_sec); - psys_interpolate_particle(-1, keys, (keys[1].time - cfra) / dfra, &pa->state, 1); + psys_interpolate_particle(-1, keys, (cfra - cfra1) / dfra, &pa->state, 1); VecMulf(pa->state.vel, frs_sec / dfra); + + pa->state.time = cfra; } static void write_particles_to_cache(Object *ob, ParticleSystem *psys, int cfra) { @@ -2250,22 +2259,20 @@ static void write_particles_to_cache(Object *ob, ParticleSystem *psys, int cfra) writer.calldata = psys; writer.cfra = cfra; - writer.elem_ptr = particle_state_ptr; + writer.set_elem = particle_write_state; writer.pid = &pid; writer.totelem = psys->totpart; BKE_ptcache_write_cache(&writer); } -static int get_particles_from_cache(Scene *scene, Object *ob, ParticleSystem *psys, float cfra, int allow_interpolate, int allow_old, int *old_frame) +static int get_particles_from_cache(Scene *scene, Object *ob, ParticleSystem *psys, float cfra, int *old_frame) { PTCacheReader reader; PTCacheID pid; BKE_ptcache_id_from_particles(&pid, ob, psys); - reader.allow_interpolate = allow_interpolate; - reader.allow_old = allow_old; reader.calldata = psys; reader.cfra = cfra; reader.interpolate_elem = particle_cache_interpolate; @@ -2402,6 +2409,8 @@ static void add_to_effectors(ListBase *lb, Scene *scene, Object *ob, Object *obs Object *tob; for(i=0; epsys; epsys=epsys->next,i++){ + if(!psys_check_enabled(ob, epsys)) + continue; type=0; if(epsys!=psys || (psys->part->flag & PART_SELF_EFFECT)){ epart=epsys->part; @@ -4366,7 +4375,7 @@ static void cached_step(Scene *scene, Object *ob, ParticleSystemModifierData *ps pa->alive = PARS_UNBORN; else if(dietime <= cfra){ if(dietime > psys->cfra){ - state.time = pa->dietime; + state.time = dietime; psys_get_particle_state(scene, ob,psys,p,&state,1); push_reaction(ob,psys,p,PART_EVENT_DEATH,&state); } @@ -4668,9 +4677,9 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle /* try to read from the cache */ if(usecache) { - int result = get_particles_from_cache(scene, ob, psys, (float)framenr, 0, 1, &old_framenr); + int result = get_particles_from_cache(scene, ob, psys, (float)framenr, &old_framenr); - if(result == PTCACHE_READ_EXACT) { + if(result == PTCACHE_READ_EXACT || result == PTCACHE_READ_INTERPOLATED) { //if(part->phystype==PART_PHYS_KEYED && psys->flag&PSYS_FIRST_KEYED) { // psys_count_keyed_targets(ob,psys); // set_keyed_keys(scene, ob, psys); @@ -4687,15 +4696,12 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle cache->simframe= framenr; cache->flag |= PTCACHE_SIMULATION_VALID; - if(cache->flag & PTCACHE_OUTDATED) - BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_FREE); + if(result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED) + write_particles_to_cache(ob, psys, cfra); return; } - else if((cache->flag & PTCACHE_AUTOCACHE)==0 && result==PTCACHE_READ_OLD) { - /* clear cache after current frame */ - BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_FREE); - + else if(result==PTCACHE_READ_OLD) { /* set old cfra */ psys->cfra = (float)old_framenr; @@ -4715,15 +4721,6 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle psys->recalc = 0; return; } - - if(framenr != startframe && framedelta != 1 && cache->flag & PTCACHE_AUTOCACHE) { - //psys_reset(psys, PSYS_RESET_CACHE_MISS); - /* make sure cache is recalculated */ - BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_FRAME, (int)cfra); - psys->cfra = cfra; - psys->recalc = 0; - return; - } } else { cache->flag &= ~PTCACHE_SIMULATION_VALID; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index b514ac026fb..64473d07151 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -303,7 +303,7 @@ static int ptcache_pid_elemsize(PTCacheID *pid) else if(pid->type==PTCACHE_TYPE_PARTICLES) return sizeof(ParticleKey); else if(pid->type==PTCACHE_TYPE_CLOTH) - return 0; // TODO + return 9 * sizeof(float); return 0; } @@ -321,10 +321,11 @@ static int ptcache_pid_totelem(PTCacheID *pid) return 0; } -void ptcache_update_info(PTCacheID *pid) +void BKE_ptcache_update_info(PTCacheID *pid) { PointCache *cache = pid->cache; int totframes = 0; + char mem_info[64]; if(cache->flag & PTCACHE_DISK_CACHE) { int cfra = cache->startframe; @@ -334,7 +335,7 @@ void ptcache_update_info(PTCacheID *pid) totframes++; } - sprintf(cache->info, "%i frames on disk.", totframes); + sprintf(mem_info, "%i frames on disk", totframes); } else { PTCacheMem *pm = cache->mem_cache.first; @@ -351,11 +352,20 @@ void ptcache_update_info(PTCacheID *pid) mb = (bytes > 1024.0f * 1024.0f); - sprintf(cache->info, "%i frames in memory (%.1f %s).", + sprintf(mem_info, "%i frames in memory (%.1f %s)", totframes, bytes / (mb ? 1024.0f * 1024.0f : 1024.0f), mb ? "Mb" : "kb"); } + + if(cache->flag & PTCACHE_OUTDATED) { + sprintf(cache->info, "%s, cache is outdated!", mem_info); + } + else if(cache->flag & PTCACHE_FRAMES_SKIPPED) { + sprintf(cache->info, "%s, not exact since frame %i.", mem_info, cache->last_exact); + } + else + sprintf(cache->info, "%s.", mem_info); } /* reads cache from disk or memory */ /* possible to get old or interpolated result */ @@ -370,10 +380,13 @@ int BKE_ptcache_read_cache(PTCacheReader *reader) int elemsize = ptcache_pid_elemsize(pid); int i, incr = elemsize / sizeof(float); float frs_sec = reader->scene->r.frs_sec; + int cfra1=0, cfra2; + int ret = 0; if(totelem == 0) return 0; + /* first check if we have the actual frame cached */ if(cfra == (float)cfrai) { if(pid->cache->flag & PTCACHE_DISK_CACHE) { @@ -419,130 +432,147 @@ int BKE_ptcache_read_cache(PTCacheReader *reader) MEM_freeN(data); } - return PTCACHE_READ_EXACT; + ret = PTCACHE_READ_EXACT; } - /* no exact cache frame found so try to find cached frames around cfra */ - if(reader->allow_interpolate || reader->allow_old) { - int cfra1, cfra2; - if(pid->cache->flag & PTCACHE_DISK_CACHE) { - pf=NULL; - while(cfrai > pid->cache->startframe && !pf) { - cfrai--; - pf= BKE_ptcache_file_open(pid, PTCACHE_FILE_READ, cfrai); - cfra1 = cfrai; - } + if(ret) + ; + /* no exact cache frame found so try to find cached frames around cfra */ + else if(pid->cache->flag & PTCACHE_DISK_CACHE) { + pf=NULL; + while(cfrai > pid->cache->startframe && !pf) { + cfrai--; + pf= BKE_ptcache_file_open(pid, PTCACHE_FILE_READ, cfrai); + cfra1 = cfrai; + } + if(reader->old_frame) *(reader->old_frame) = cfrai; - cfrai = (int)cfra; - while(cfrai < pid->cache->endframe && !pf2) { - cfrai++; - pf2= BKE_ptcache_file_open(pid, PTCACHE_FILE_READ, cfrai); - cfra2 = cfrai; - } + cfrai = (int)cfra; + while(cfrai < pid->cache->endframe && !pf2) { + cfrai++; + pf2= BKE_ptcache_file_open(pid, PTCACHE_FILE_READ, cfrai); + cfra2 = cfrai; } - else if(pid->cache->mem_cache.first){ - pm = pid->cache->mem_cache.first; + } + else if(pid->cache->mem_cache.first){ + pm = pid->cache->mem_cache.first; - while(pm->next && pm->next->frame < cfra) - pm= pm->next; + while(pm->next && pm->next->frame < cfra) + pm= pm->next; - if(pm) { + if(pm) { + if(reader->old_frame) *(reader->old_frame) = pm->frame; - cfra1 = pm->frame; - } + cfra1 = pm->frame; + } - pm2 = pid->cache->mem_cache.last; + pm2 = pid->cache->mem_cache.last; - while(pm2->prev && pm2->frame > cfra) + if(pm2 && pm2->frame < cfra) + pm2 = NULL; + else { + while(pm2->prev && pm2->prev->frame > cfra) pm2= pm2->prev; if(pm2) cfra2 = pm2->frame; } + } - if(reader->allow_interpolate && ((pf && pf2) || (pm && pm2))) { - /* interpolate from nearest frames */ - float *data1, *data2; + if(ret) + ; + else if((pf && pf2) || (pm && pm2)) { + /* interpolate from nearest frames if cache isn't outdated */ + float *data1, *data2; - if(pm) { - data1 = pm->data; - data2 = pm2->data; - } - else { - data1 = MEM_callocN(elemsize, "pointcache read data1"); - data2 = MEM_callocN(elemsize, "pointcache read data2"); - } + if(pm) { + data1 = pm->data; + data2 = pm2->data; + } + else { + data1 = MEM_callocN(elemsize, "pointcache read data1"); + data2 = MEM_callocN(elemsize, "pointcache read data2"); + } - for(i=0; iinterpolate_elem(i, reader->calldata, frs_sec, cfra, cfra1, cfra2, data1, data2); + for(i=0; iinterpolate_elem(i, reader->calldata, frs_sec, cfra, cfra1, cfra2, data1, data2); - data1 += incr; - data2 += incr; + if(!BKE_ptcache_file_read_floats(pf2, data2, incr)) { + BKE_ptcache_file_close(pf); + BKE_ptcache_file_close(pf2); + MEM_freeN(data1); + MEM_freeN(data2); + return 0; } + reader->interpolate_elem(i, reader->calldata, frs_sec, cfra, (float)cfra1, (float)cfra2, data1, data2); } + else { + reader->interpolate_elem(i, reader->calldata, frs_sec, cfra, (float)cfra1, (float)cfra2, data1, data2); + data1 += incr; + data2 += incr; + } + } - if(pf) { + if(pf) { + BKE_ptcache_file_close(pf); + BKE_ptcache_file_close(pf2); + MEM_freeN(data1); + MEM_freeN(data2); + } + + ret = PTCACHE_READ_INTERPOLATED; + } + else if(pf || pm) { + /* use last valid cache frame */ + float *data; + + /* don't read cache if allready simulated past cached frame */ + if(cfra1 && cfra1 <= pid->cache->simframe) { + if(pf) BKE_ptcache_file_close(pf); + if(pf2) BKE_ptcache_file_close(pf2); - MEM_freeN(data1); - MEM_freeN(data2); - } - return PTCACHE_READ_INTERPOLATED; + return 0; } - else if(reader->allow_old && (pf || pm)) { - /* use last valid cache frame */ - float *data; - if(pm) - data = pm->data; - else - data = MEM_callocN(elemsize, "pointcache read data"); - - for(i=0; iset_elem(i, reader->calldata, data); - } - else { - reader->set_elem(i, reader->calldata, data); - data += incr; - } - } + if(pm) + data = pm->data; + else + data = MEM_callocN(elemsize, "pointcache read data"); + for(i=0; iset_elem(i, reader->calldata, data); } - if(pf2) - BKE_ptcache_file_close(pf2); + else { + reader->set_elem(i, reader->calldata, data); + data += incr; + } + } - return PTCACHE_READ_OLD; + if(pf) { + BKE_ptcache_file_close(pf); + MEM_freeN(data); } + if(pf2) + BKE_ptcache_file_close(pf2); + + ret = PTCACHE_READ_OLD; } if(pf) @@ -550,7 +580,20 @@ int BKE_ptcache_read_cache(PTCacheReader *reader) if(pf2) BKE_ptcache_file_close(pf2); - return 0; + if((pid->cache->flag & PTCACHE_QUICK_CACHE)==0) { + /* clear invalid cache frames so that better stuff can be simulated */ + if(pid->cache->flag & PTCACHE_OUTDATED) { + BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_AFTER, cfra); + } + else if(pid->cache->flag & PTCACHE_FRAMES_SKIPPED) { + if(cfra <= pid->cache->last_exact) + pid->cache->flag &= ~PTCACHE_FRAMES_SKIPPED; + + BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_AFTER, MAX2(cfra,pid->cache->last_exact)); + } + } + + return ret; } /* writes cache to disk or memory */ int BKE_ptcache_write_cache(PTCacheWriter *writer) @@ -559,57 +602,118 @@ int BKE_ptcache_write_cache(PTCacheWriter *writer) PTCacheFile *pf= NULL; int elemsize = ptcache_pid_elemsize(writer->pid); int i, incr = elemsize / sizeof(float); + int add = 0, overwrite = 0, ocfra; + float temp[14]; if(writer->totelem == 0 || writer->cfra <= 0) return 0; if(cache->flag & PTCACHE_DISK_CACHE) { - pf = BKE_ptcache_file_open(writer->pid, PTCACHE_FILE_WRITE, writer->cfra); - if(!pf) - return 0; + /* allways start from scratch on the first frame */ + if(writer->cfra == cache->startframe) { + BKE_ptcache_id_clear(writer->pid, PTCACHE_CLEAR_ALL, writer->cfra); + cache->flag &= ~PTCACHE_REDO_NEEDED; + add = 1; + } + else { + int cfra = cache->endframe; + /* find last cached frame */ + while(cfra > cache->startframe && !BKE_ptcache_id_exist(writer->pid, cfra)) + cfra--; + + /* find second last cached frame */ + ocfra = cfra-1; + while(ocfra > cache->startframe && !BKE_ptcache_id_exist(writer->pid, ocfra)) + ocfra--; + + if(writer->cfra > cfra) { + if(ocfra >= cache->startframe && cfra - ocfra < cache->step) + overwrite = 1; + else + add = 1; + } + } - for(i=0; itotelem; i++) - BKE_ptcache_file_write_floats(pf, writer->elem_ptr(i, writer->calldata), incr); + if(add || overwrite) { + if(overwrite) + BKE_ptcache_id_clear(writer->pid, PTCACHE_CLEAR_FRAME, ocfra); + + pf = BKE_ptcache_file_open(writer->pid, PTCACHE_FILE_WRITE, writer->cfra); + if(!pf) + return 0; + + for(i=0; itotelem; i++) { + writer->set_elem(i, writer->calldata, &temp); + BKE_ptcache_file_write_floats(pf, &temp, incr); + } + } } else { - PTCacheMem *pm = MEM_callocN(sizeof(PTCacheMem), "Pointcache mem"); + PTCacheMem *pm; PTCacheMem *pm2; float *pmdata; - pm->data = MEM_callocN(elemsize * writer->totelem, "Pointcache mem data"); - pmdata = pm->data; + pm2 = cache->mem_cache.first; + + /* allways start from scratch on the first frame */ + if(writer->cfra == cache->startframe) { + BKE_ptcache_id_clear(writer->pid, PTCACHE_CLEAR_ALL, writer->cfra); + cache->flag &= ~PTCACHE_REDO_NEEDED; + add = 1; + } + else { + pm2 = cache->mem_cache.last; + + if(pm2 && writer->cfra > pm2->frame) { + if(pm2 && pm2->prev && pm2->frame - pm2->prev->frame < cache->step) + overwrite = 1; + else + add = 1; + } + } - for(i=0; itotelem; i++, pmdata+=incr) - memcpy(pmdata, writer->elem_ptr(i, writer->calldata), elemsize); + if(overwrite) { + pm = cache->mem_cache.last; + pmdata = pm->data; - pm->frame = writer->cfra; - pm->totpoint = writer->totelem; + for(i=0; itotelem; i++, pmdata+=incr) { + writer->set_elem(i, writer->calldata, &temp); + memcpy(pmdata, &temp, elemsize); + } - /* find add location */ - pm2 = cache->mem_cache.first; - if(!pm2) - BLI_addtail(&cache->mem_cache, pm); - else if(pm2->frame == writer->cfra) { - /* overwrite same frame */ - MEM_freeN(pm2->data); - pm2->data = pm->data; - MEM_freeN(pm); + pm->frame = writer->cfra; } - else { - while(pm2->next && pm2->next->frame < writer->cfra) - pm2 = pm2->next; + else if(add) { + pm = MEM_callocN(sizeof(PTCacheMem), "Pointcache mem"); + pm->data = MEM_callocN(elemsize * writer->totelem, "Pointcache mem data"); + pmdata = pm->data; + + for(i=0; itotelem; i++, pmdata+=incr) { + writer->set_elem(i, writer->calldata, &temp); + memcpy(pmdata, &temp, elemsize); + } + + pm->frame = writer->cfra; + pm->totpoint = writer->totelem; - BLI_insertlinkafter(&cache->mem_cache, pm2, pm); + BLI_addtail(&cache->mem_cache, pm); } } - if(writer->cfra - cache->last_exact == 1) - cache->last_exact = writer->cfra; + if(add || overwrite) { + if(writer->cfra - cache->last_exact == 1 + || writer->cfra == cache->startframe) { + cache->last_exact = writer->cfra; + cache->flag &= ~PTCACHE_FRAMES_SKIPPED; + } + else + cache->flag |= PTCACHE_FRAMES_SKIPPED; + } if(pf) BKE_ptcache_file_close(pf); - ptcache_update_info(writer->pid); + BKE_ptcache_update_info(writer->pid); return 1; } @@ -730,7 +834,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, int cfra) break; } - ptcache_update_info(pid); + BKE_ptcache_update_info(pid); } int BKE_ptcache_id_exist(PTCacheID *pid, int cfra) @@ -762,6 +866,9 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra PointCache *cache; float offset, time, nexttime; + /* TODO: this has to be sorter out once bsystem_time gets redone, */ + /* now caches can handle interpolating etc. too - jahka */ + /* time handling for point cache: * - simulation time is scaled by result of bsystem_time * - for offsetting time only time offset is taken into account, since @@ -798,7 +905,7 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode) { PointCache *cache; - int reset, clear, current, after; + int reset, clear, after; if(!pid->cache) return 0; @@ -806,23 +913,17 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode) cache= pid->cache; reset= 0; clear= 0; - current= 0; after= 0; if(mode == PTCACHE_RESET_DEPSGRAPH) { if(!(cache->flag & PTCACHE_BAKED) && !BKE_ptcache_get_continue_physics()) { - if(cache->flag & PTCACHE_AUTOCACHE) { - reset= 1; + if(cache->flag & PTCACHE_QUICK_CACHE) clear= 1; - } - else { - current= 1; - after= 1; - cache->flag |= PTCACHE_OUTDATED; - } + + after= 1; } - else - cache->flag |= PTCACHE_OUTDATED; + + cache->flag |= PTCACHE_OUTDATED; } else if(mode == PTCACHE_RESET_BAKED) { if(!BKE_ptcache_get_continue_physics()) { @@ -839,17 +940,9 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode) if(!(cache->flag & PTCACHE_BAKED)) clear= 1; } - else if(mode == PTCACHE_RESET_FREE) { - if(!(cache->flag & PTCACHE_BAKED) && !BKE_ptcache_get_continue_physics()) { - if((cache->flag & PTCACHE_AUTOCACHE)==0) { - current= 1; - after= 1; - } - } - } if(reset) { - cache->flag &= ~(PTCACHE_OUTDATED|PTCACHE_SIMULATION_VALID); + cache->flag &= ~(PTCACHE_REDO_NEEDED|PTCACHE_SIMULATION_VALID); cache->simframe= 0; cache->last_exact= 0; @@ -862,12 +955,10 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode) } if(clear) BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); - if(after) + else if(after) BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_AFTER, CFRA); - if(current) - BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_FRAME, CFRA); - return (reset || clear || current || after); + return (reset || clear || after); } int BKE_ptcache_object_reset(Scene *scene, Object *ob, int mode) @@ -987,6 +1078,7 @@ PointCache *BKE_ptcache_add() cache= MEM_callocN(sizeof(PointCache), "PointCache"); cache->startframe= 1; cache->endframe= 250; + cache->step= 10; return cache; } @@ -1019,7 +1111,39 @@ PointCache *BKE_ptcache_copy(PointCache *cache) /* Baking */ -void BKE_ptcache_autocache_all(Scene *scene) +static int count_quick_cache(Scene *scene, int *quick_step) +{ + Base *base = scene->base.first; + PTCacheID *pid; + ListBase pidlist; + int autocache_count= 0; + + for(base = scene->base.first; base; base = base->next) { + if(base->object) { + BKE_ptcache_ids_from_object(&pidlist, base->object); + + for(pid=pidlist.first; pid; pid=pid->next) { + if((pid->cache->flag & PTCACHE_BAKED) + || (pid->cache->flag & PTCACHE_QUICK_CACHE)==0) + continue; + + if(pid->cache->flag & PTCACHE_OUTDATED || (pid->cache->flag & PTCACHE_SIMULATION_VALID)==0) { + if(!autocache_count) + *quick_step = pid->cache->step; + else + *quick_step = MIN2(*quick_step, pid->cache->step); + + autocache_count++; + } + } + + BLI_freelistN(&pidlist); + } + } + + return autocache_count; +} +void BKE_ptcache_quick_cache_all(Scene *scene) { PTCacheBaker baker; @@ -1032,7 +1156,7 @@ void BKE_ptcache_autocache_all(Scene *scene) baker.render=0; baker.scene=scene; - if(psys_count_autocache(scene, NULL)) + if(count_quick_cache(scene, &baker.quick_step)) BKE_ptcache_make_cache(&baker); } @@ -1050,11 +1174,10 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) int endframe = CFRA; int bake = baker->bake; int render = baker->render; + int step = baker->quick_step; G.afbreek = 0; - //printf("Caching physics..."); - /* set caches to baking mode and figure out start frame */ if(pid) { /* cache/bake a single object */ @@ -1063,7 +1186,7 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) if(pid->type==PTCACHE_TYPE_PARTICLES) psys_get_pointcache_start_end(scene, pid->data, &cache->startframe, &cache->endframe); - if(bake || cache->flag & PTCACHE_OUTDATED) + if(bake || cache->flag & PTCACHE_REDO_NEEDED) BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); startframe = MAX2(cache->last_exact, cache->startframe); @@ -1072,8 +1195,9 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) endframe = cache->endframe; cache->flag |= PTCACHE_BAKING; } - else + else { endframe = MIN2(endframe, cache->endframe); + } cache->flag &= ~PTCACHE_BAKED; } @@ -1088,31 +1212,30 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) if(pid->type==PTCACHE_TYPE_PARTICLES) psys_get_pointcache_start_end(scene, pid->data, &cache->startframe, &cache->endframe); - if(cache->flag & PTCACHE_OUTDATED) + if((cache->flag & PTCACHE_REDO_NEEDED || (cache->flag & PTCACHE_SIMULATION_VALID)==0) + && ((cache->flag & PTCACHE_QUICK_CACHE)==0 || render || bake)) BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); startframe = MIN2(startframe, cache->startframe); - if(bake) { - endframe = MAX2(endframe, cache->endframe); + if(bake || render) { cache->flag |= PTCACHE_BAKING; + + if(bake) + endframe = MAX2(endframe, cache->endframe); } - else if(render) - cache->flag |= PTCACHE_BAKING; cache->flag &= ~PTCACHE_BAKED; } } - BLI_freelistN(&pidlist); } CFRA= startframe; scene->r.framelen = 1.0; - scene_update_for_newframe(scene, scene->lay); - for(; CFRA <= endframe; CFRA++) { + for(; CFRA <= endframe; CFRA+=step) { float prog; if(bake) @@ -1133,7 +1256,8 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) /* clear baking flag */ if(pid) { - cache->flag &= ~(PTCACHE_BAKING|PTCACHE_OUTDATED); + cache->flag &= ~(PTCACHE_BAKING|PTCACHE_REDO_NEEDED); + cache->flag |= PTCACHE_SIMULATION_VALID; if(bake) cache->flag |= PTCACHE_BAKED; } @@ -1141,17 +1265,26 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) BKE_ptcache_ids_from_object(&pidlist, base->object); for(pid=pidlist.first; pid; pid=pid->next) { - cache->flag &= ~(PTCACHE_BAKING|PTCACHE_OUTDATED); + cache = pid->cache; + + if(step > 1) + cache->flag &= ~(PTCACHE_BAKING|PTCACHE_OUTDATED); + else + cache->flag &= ~(PTCACHE_BAKING|PTCACHE_REDO_NEEDED); + + cache->flag |= PTCACHE_SIMULATION_VALID; + if(bake) cache->flag |= PTCACHE_BAKED; } + BLI_freelistN(&pidlist); } - - //printf("done!\n"); scene->r.framelen = frameleno; CFRA = cfrao; scene_update_for_newframe(scene, scene->lay); + + /* TODO: call redraw all windows somehow */ } void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) { @@ -1161,6 +1294,7 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) { int totelem=0; int float_count=0; int tot; + int last_exact = cache->last_exact; if (!G.relbase_valid){ cache->flag &= ~PTCACHE_DISK_CACHE; @@ -1230,6 +1364,7 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) { } pm->frame = cfra; + pm->totpoint = totelem; BLI_addtail(&pid->cache->mem_cache, pm); @@ -1241,4 +1376,8 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) { BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); cache->flag &= ~PTCACHE_DISK_CACHE; } + + cache->last_exact = last_exact; + + BKE_ptcache_update_info(pid); } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 7921740cbe8..441e8aff2d6 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9013,6 +9013,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) Tex *tx; ParticleSettings *part; Object *ob; + PTCacheID *pid; + ListBase pidlist; for(screen= main->screen.first; screen; screen= screen->id.next) { do_versions_windowmanager_2_50(screen); @@ -9073,14 +9075,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } /* set old pointcaches to have disk cache flag */ for(ob = main->object.first; ob; ob= ob->id.next) { - ParticleSystem *psys = ob->particlesystem.first; - for(; psys; psys=psys->next) { - if(psys->pointcache) - psys->pointcache->flag |= PTCACHE_DISK_CACHE; - } + BKE_ptcache_ids_from_object(&pidlist, ob); + + for(pid=pidlist.first; pid; pid=pid->next) + pid->cache->flag |= PTCACHE_DISK_CACHE; - /* TODO: softbody & cloth caches */ + BLI_freelistN(&pidlist); } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index ef1e7d70a1e..c433232d084 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -552,6 +552,7 @@ static void write_userdef(WriteData *wd) /* TODO: replace *cache with *cachelist once it's coded */ #define PTCACHE_WRITE_PSYS 0 +#define PTCACHE_WRITE_CLOTH 1 static void write_pointcaches(WriteData *wd, PointCache *cache, int type) { writestruct(wd, DATA, "PointCache", 1, cache); @@ -563,6 +564,8 @@ static void write_pointcaches(WriteData *wd, PointCache *cache, int type) writestruct(wd, DATA, "PTCacheMem", 1, pm); if(type==PTCACHE_WRITE_PSYS) writestruct(wd, DATA, "ParticleKey", pm->totpoint, pm->data); + else if(type==PTCACHE_WRITE_CLOTH) + writedata(wd, DATA, 9 * sizeof(float) * pm->totpoint, pm->data); } } } @@ -1025,7 +1028,7 @@ static void write_modifiers(WriteData *wd, ListBase *modbase, int write_undo) writestruct(wd, DATA, "ClothSimSettings", 1, clmd->sim_parms); writestruct(wd, DATA, "ClothCollSettings", 1, clmd->coll_parms); - writestruct(wd, DATA, "PointCache", 1, clmd->point_cache); + write_pointcaches(wd, clmd->point_cache, PTCACHE_WRITE_CLOTH); } else if(md->type==eModifierType_Fluidsim) { FluidsimModifierData *fluidmd = (FluidsimModifierData*) md; diff --git a/source/blender/editors/physics/ed_pointcache.c b/source/blender/editors/physics/ed_pointcache.c index 3374e05883c..893c59a521d 100644 --- a/source/blender/editors/physics/ed_pointcache.c +++ b/source/blender/editors/physics/ed_pointcache.c @@ -31,6 +31,7 @@ #include "DNA_scene_types.h" #include "DNA_object_force.h" +#include "DNA_modifier_types.h" #include "BKE_context.h" #include "BKE_particle.h" @@ -39,7 +40,7 @@ #include "BKE_utildefines.h" #include "BKE_pointcache.h" #include "BKE_global.h" -#include "BKE_multires.h" +#include "BKE_modifier.h" #include "BLI_blenlib.h" @@ -81,6 +82,7 @@ static int ptcache_bake_all_exec(bContext *C, wmOperator *op) baker.pid = NULL; baker.bake = RNA_boolean_get(op->ptr, "bake"); baker.render = 0; + baker.quick_step = 1; baker.break_test = cache_break_test; baker.break_data = NULL; baker.progressbar = (void (*)(void *, int))WM_timecursor; @@ -104,12 +106,11 @@ static int ptcache_free_bake_all_exec(bContext *C, wmOperator *op) for(pid=pidlist.first; pid; pid=pid->next) { pid->cache->flag &= ~PTCACHE_BAKED; - BKE_ptcache_id_reset(scene, pid, PTCACHE_RESET_OUTDATED); } + + BLI_freelistN(&pidlist); } - BLI_freelistN(&pidlist); - WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); return OPERATOR_FINISHED; @@ -127,6 +128,8 @@ void PTCACHE_OT_bake_all(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_boolean(ot->srna, "bake", 0, "Bake", ""); } void PTCACHE_OT_free_bake_all(wmOperatorType *ot) { @@ -142,6 +145,112 @@ void PTCACHE_OT_free_bake_all(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/**************************** cloth **********************************/ +static int ptcache_bake_cloth_poll(bContext *C) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_active_object(C); + ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth); + + if(!scene || !ob || ob->id.lib || !clmd) + return 0; + + return 1; +} + +static int ptcache_bake_cloth_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_active_object(C); + ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth); + PTCacheID pid; + PTCacheBaker baker; + + BKE_ptcache_id_from_cloth(&pid, ob, clmd); + + baker.scene = scene; + baker.pid = &pid; + baker.bake = RNA_boolean_get(op->ptr, "bake"); + baker.render = 0; + baker.quick_step = 1; + baker.break_test = cache_break_test; + baker.break_data = NULL; + baker.progressbar = WM_timecursor; + baker.progresscontext = CTX_wm_window(C); + + BKE_ptcache_make_cache(&baker); + + WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); + + return OPERATOR_FINISHED; +} +static int ptcache_free_bake_cloth_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_active_object(C); + ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth); + PTCacheID pid; + + BKE_ptcache_id_from_cloth(&pid, ob, clmd); + pid.cache->flag &= ~PTCACHE_BAKED; + + WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); + + return OPERATOR_FINISHED; +} +void PTCACHE_OT_cache_cloth(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Bake Cloth"; + ot->idname= "PTCACHE_OT_cache_cloth"; + + /* api callbacks */ + ot->exec= ptcache_bake_cloth_exec; + ot->poll= ptcache_bake_cloth_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_boolean(ot->srna, "bake", 0, "Bake", ""); +} +void PTCACHE_OT_free_bake_cloth(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Free Cloth Bake"; + ot->idname= "PTCACHE_OT_free_bake_cloth"; + + /* api callbacks */ + ot->exec= ptcache_free_bake_cloth_exec; + ot->poll= ptcache_bake_cloth_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} +static int ptcache_bake_from_cloth_cache_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_active_object(C); + ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth); + PTCacheID pid; + + BKE_ptcache_id_from_cloth(&pid, ob, clmd); + pid.cache->flag |= PTCACHE_BAKED; + + return OPERATOR_FINISHED; +} +void PTCACHE_OT_bake_from_cloth_cache(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Bake From Cache"; + ot->idname= "PTCACHE_OT_bake_from_cloth_cache"; + + /* api callbacks */ + ot->exec= ptcache_bake_from_cloth_cache_exec; + ot->poll= ptcache_bake_cloth_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /**************************** particles **********************************/ static int ptcache_bake_particle_system_poll(bContext *C) { @@ -168,6 +277,7 @@ static int ptcache_bake_particle_system_exec(bContext *C, wmOperator *op) baker.pid = &pid; baker.bake = RNA_boolean_get(op->ptr, "bake"); baker.render = 0; + baker.quick_step = 1; baker.break_test = cache_break_test; baker.break_data = NULL; baker.progressbar = (void (*)(void *, int))WM_timecursor; @@ -188,7 +298,6 @@ static int ptcache_free_bake_particle_system_exec(bContext *C, wmOperator *op) BKE_ptcache_id_from_particles(&pid, ob, psys); psys->pointcache->flag &= ~PTCACHE_BAKED; - BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED); WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); @@ -256,6 +365,9 @@ void ED_operatortypes_pointcache(void) WM_operatortype_append(PTCACHE_OT_cache_particle_system); WM_operatortype_append(PTCACHE_OT_free_bake_particle_system); WM_operatortype_append(PTCACHE_OT_bake_from_particles_cache); + WM_operatortype_append(PTCACHE_OT_cache_cloth); + WM_operatortype_append(PTCACHE_OT_free_bake_cloth); + WM_operatortype_append(PTCACHE_OT_bake_from_cloth_cache); } //void ED_keymap_pointcache(wmWindowManager *wm) diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index bb1f09ec44e..490ce820b30 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4674,6 +4674,12 @@ void special_aftertrans_update(TransInfo *t) /* pointcache refresh */ if (BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH)) ob->recalc |= OB_RECALC_DATA; + + /* Needed for proper updating of "quick cached" dynamics. */ + /* Creates troubles for moving animated objects without */ + /* autokey though, probably needed is an anim sys override? */ + /* Please remove if some other solution is found. -jahka */ + DAG_object_flush_update(scene, ob, OB_RECALC_OB); /* Set autokey if necessary */ if (!cancelled) diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index a8d402fc503..88d9894cf7a 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -82,7 +82,8 @@ typedef struct PTCacheMem { } PTCacheMem; typedef struct PointCache { - int flag, rt; /* generic flag */ + int flag; /* generic flag */ + int step; /* frames between cached frames */ int simframe; /* current frame of simulation (only if SIMULATION_VALID) */ int startframe; /* simulation start frame */ int endframe; /* simulation end frame */ @@ -263,7 +264,11 @@ typedef struct SoftBody { #define PTCACHE_BAKE_EDIT 16 #define PTCACHE_BAKE_EDIT_ACTIVE 32 #define PTCACHE_DISK_CACHE 64 -#define PTCACHE_AUTOCACHE 128 +#define PTCACHE_QUICK_CACHE 128 +#define PTCACHE_FRAMES_SKIPPED 256 + +/* PTCACHE_OUTDATED + PTCACHE_FRAMES_SKIPPED */ +#define PTCACHE_REDO_NEEDED 258 /* ob->softflag */ #define OB_SB_ENABLE 1 diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index 361c1b61303..cefd2316fbf 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -34,9 +34,24 @@ #include "BKE_modifier.h" #include "DNA_cloth_types.h" +#include "DNA_object_types.h" +#include "DNA_scene_types.h" + +#include "WM_types.h" #ifdef RNA_RUNTIME +#include "BKE_context.h" +#include "BKE_depsgraph.h" + +static void rna_cloth_update(bContext *C, PointerRNA *ptr) +{ + Scene *scene = CTX_data_scene(C); + Object *ob = ptr->id.data; + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); +} + static void rna_ClothSettings_max_bend_set(struct PointerRNA *ptr, float value) { ClothSimSettings *settings = (ClothSimSettings*)ptr->data; @@ -165,42 +180,50 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "mingoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Minimum", "Goal minimum, vertex group weights are scaled to match this range."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxgoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Maximum", "Goal maximum, vertex group weights are scaled to match this range."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "defgoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Default", "Default Goal (vertex target position) value, when no Vertex Group used."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalspring"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Goal Stiffness", "Goal (vertex target position) spring stiffness."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalfrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Goal Damping", "Goal (vertex target position) friction."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); /* mass */ prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Mass", "Mass of cloth material."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "mass_vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ClothSettings_mass_vgroup_get", "rna_ClothSettings_mass_vgroup_length", "rna_ClothSettings_mass_vgroup_set"); RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex group for fine control over mass distribution."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_VECTOR); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, -100.0, 100.0); RNA_def_property_float_funcs(prop, "rna_ClothSettings_gravity_get", "rna_ClothSettings_gravity_set", NULL); RNA_def_property_ui_text(prop, "Gravity", "Gravity or external force vector."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); /* various */ @@ -208,61 +231,73 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "Cvi"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Air Damping", "Air has normally some thickness which slows falling things down."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "pin_cloth", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_GOAL); RNA_def_property_ui_text(prop, "Pin Cloth", "Define forces for vertices to stick to animated position."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "pin_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalspring"); RNA_def_property_range(prop, 0.0f, 50.0); RNA_def_property_ui_text(prop, "Pin Stiffness", "Pin (vertex target position) spring stiffness."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "stepsPerFrame"); RNA_def_property_range(prop, 4, 80); RNA_def_property_ui_text(prop, "Quality", "Quality of the simulation in steps per frame (higher is better quality but slower)."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); /* springs */ prop= RNA_def_property(srna, "stiffness_scaling", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_SCALING); RNA_def_property_ui_text(prop, "Stiffness Scaling", "If enabled, stiffness can be scaled along a weight painted vertex group."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "spring_damping", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "Cdis"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Spring Damping", "Damping of cloth velocity (higher = more smooth, less jiggling)"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "structural_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "structural"); RNA_def_property_range(prop, 1.0f, 10000.0f); RNA_def_property_ui_text(prop, "Structural Stiffness", "Overall stiffness of structure."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "structural_stiffness_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max_struct"); RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_float_funcs(prop, NULL, "rna_ClothSettings_max_struct_set", NULL); RNA_def_property_ui_text(prop, "Structural Stiffness Maximum", "Maximum structural stiffness value."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "structural_stiffness_vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ClothSettings_struct_vgroup_get", "rna_ClothSettings_struct_vgroup_length", "rna_ClothSettings_struct_vgroup_set"); RNA_def_property_ui_text(prop, "Structural Stiffness Vertex Group", "Vertex group for fine control over structural stiffness."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "bending_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bending"); RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_ui_text(prop, "Bending Stiffness", "Wrinkle coefficient (higher = less smaller but more big wrinkles)."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "bending_stiffness_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max_bend"); RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_float_funcs(prop, NULL, "rna_ClothSettings_max_bend_set", NULL); RNA_def_property_ui_text(prop, "Bending Stiffness Maximum", "Maximum bending stiffness value."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "bending_vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ClothSettings_bend_vgroup_get", "rna_ClothSettings_bend_vgroup_length", "rna_ClothSettings_bend_vgroup_set"); RNA_def_property_ui_text(prop, "Bending Stiffness Vertex Group", "Vertex group for fine control over bending stiffness."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); /* unused */ @@ -323,40 +358,48 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "enable_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_ENABLED); RNA_def_property_ui_text(prop, "Enable Collision", "Enable collisions with other objects."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "min_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "epsilon"); RNA_def_property_range(prop, 0.001f, 1.0f); RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance between collision objects before collision response takes in, can be changed for each frame."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 80.0f); RNA_def_property_ui_text(prop, "Friction", "Friction force if a collision happened (0=movement not changed, 100=no movement left)"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "collision_quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "loop_count"); RNA_def_property_range(prop, 1, 20); RNA_def_property_ui_text(prop, "Collision Quality", "How many collision iterations should be done. (higher is better quality but slower)"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); /* self collision */ prop= RNA_def_property(srna, "enable_self_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_SELF); RNA_def_property_ui_text(prop, "Enable Self Collision", "Enable self collisions."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "self_min_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "selfepsilon"); RNA_def_property_range(prop, 0.5f, 1.0f); RNA_def_property_ui_text(prop, "Self Minimum Distance", "0.5 means no distance at all, 1.0 is maximum distance"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "self_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 80.0f); RNA_def_property_ui_text(prop, "Self Friction", "Friction/damping with self contact."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "self_collision_quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "self_loop_count"); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Self Collision Quality", "How many self collision iterations should be done. (higher is better quality but slower), can be changed for each frame."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); } void RNA_def_cloth(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 07408c59538..4d8c728db12 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -31,6 +31,7 @@ #include "DNA_object_types.h" #include "DNA_object_force.h" +#include "DNA_scene_types.h" #include "WM_types.h" @@ -40,9 +41,38 @@ #include "BKE_context.h" #include "BKE_pointcache.h" +#include "BKE_depsgraph.h" #include "BLI_blenlib.h" +static void rna_Cache_change(bContext *C, PointerRNA *ptr) +{ + Scene *scene = CTX_data_scene(C); + Object *ob = CTX_data_active_object(C); + PointCache *cache = (PointCache*)ptr->data; + PTCacheID *pid = NULL; + ListBase pidlist; + + if(!ob) + return; + + cache->flag |= PTCACHE_OUTDATED; + + BKE_ptcache_ids_from_object(&pidlist, ob); + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + + for(pid=pidlist.first; pid; pid=pid->next) { + if(pid->cache==cache) + break; + } + + if(pid) + BKE_ptcache_update_info(pid); + + BLI_freelistN(&pidlist); +} + static void rna_Cache_toggle_disk_cache(bContext *C, PointerRNA *ptr) { Object *ob = CTX_data_active_object(C); @@ -240,6 +270,12 @@ static void rna_def_pointcache(BlenderRNA *brna) RNA_def_property_range(prop, 1, 300000); RNA_def_property_ui_text(prop, "End", "Frame on which the simulation stops."); + prop= RNA_def_property(srna, "step", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "step"); + RNA_def_property_range(prop, 1, 20); + RNA_def_property_ui_text(prop, "Cache Step", "Number of frames between cached frames."); + RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change"); + /* flags */ prop= RNA_def_property(srna, "baked", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_BAKED); @@ -257,21 +293,24 @@ static void rna_def_pointcache(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Cache is outdated", ""); + prop= RNA_def_property(srna, "frames_skipped", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_FRAMES_SKIPPED); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Name", "Cache name"); RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change"); - prop= RNA_def_property(srna, "autocache", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_AUTOCACHE); - RNA_def_property_ui_text(prop, "Auto Cache", "Cache changes automatically"); - //RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_toggle_autocache"); + prop= RNA_def_property(srna, "quick_cache", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_QUICK_CACHE); + RNA_def_property_ui_text(prop, "Quick Cache", "Update simulation with cache steps"); + RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change"); prop= RNA_def_property(srna, "info", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "info"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Cache Info", "Info on current cache status."); - } static void rna_def_collision(BlenderRNA *brna) diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 5eec13ed7fe..ccc793e4235 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -2421,6 +2421,7 @@ static void update_physics_cache(Render *re, Scene *scene) baker.pid = NULL; baker.bake = 0; baker.render = 1; + baker.quick_step = 1; baker.break_test = re->test_break; baker.break_data = re->tbh; baker.progressbar = NULL; diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index ea6a65859e5..286d1216f66 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -49,6 +49,7 @@ #include "BKE_report.h" #include "BKE_scene.h" #include "BKE_utildefines.h" +#include "BKE_pointcache.h" #include "ED_fileselect.h" #include "ED_screen.h" @@ -234,6 +235,8 @@ void wm_event_do_notifiers(bContext *C) for(base= scene->base.first; base; base= base->next) { object_handle_update(scene, base->object); } + + BKE_ptcache_quick_cache_all(scene); } } CTX_wm_window_set(C, NULL); -- cgit v1.2.3 From 7b547f7ce7351548a5dd4518ae1fc1ad9a726cbd Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sat, 27 Jun 2009 15:41:47 +0000 Subject: Particle ID block controls: * Adding/removing particle systems to an object. * Changing of particle settings. * Currently showing an object's particle systems in a list (like materials). --- source/blender/blenkernel/BKE_particle.h | 3 + source/blender/blenkernel/intern/depsgraph.c | 2 +- source/blender/blenkernel/intern/modifier.c | 3 + source/blender/blenkernel/intern/particle.c | 74 +++++++++++++- .../blender/editors/space_buttons/buttons_intern.h | 5 + source/blender/editors/space_buttons/buttons_ops.c | 107 +++++++++++++++++++++ .../blender/editors/space_buttons/space_buttons.c | 5 + source/blender/makesrna/intern/rna_object.c | 23 +++++ source/blender/makesrna/intern/rna_particle.c | 33 ++++++- 9 files changed, 248 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index 08aa111e0e6..4d9916b9557 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -217,6 +217,7 @@ char *psys_menu_string(struct Object *ob, int for_sb); struct ParticleSystem *psys_get_current(struct Object *ob); short psys_get_current_num(struct Object *ob); +void psys_set_current_num(Object *ob, int index); struct Object *psys_find_object(struct Scene *scene, struct ParticleSystem *psys); //struct ParticleSystem *psys_get(struct Object *ob, int index); struct ParticleData *psys_get_selected_particle(struct ParticleSystem *psys, int *index); @@ -250,6 +251,8 @@ void copy_particle_key(struct ParticleKey *to, struct ParticleKey *from, int tim void psys_particle_on_emitter(struct ParticleSystemModifierData *psmd, int distr, int index, int index_dmcache, float *fuv, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor); struct ParticleSystemModifierData *psys_get_modifier(struct Object *ob, struct ParticleSystem *psys); +void object_add_particle_system_slot(struct Scene *scene, struct Object *ob); +void object_remove_particle_system_slot(struct Scene *scene, struct Object *ob); struct ParticleSettings *psys_new_settings(char *name, struct Main *main); struct ParticleSettings *psys_copy_settings(struct ParticleSettings *part); void psys_flush_particle_settings(struct Scene *scene, struct ParticleSettings *part, int recalc); diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index b57b8b7a6da..a36b825293e 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -559,7 +559,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O dag_add_relation(dag, node, node, DAG_RL_OB_DATA, "Particle-Object Relation"); - if(psys->flag & PSYS_DISABLED || psys->flag & PSYS_DELETE) + if(!psys_check_enabled(ob, psys)) continue; if(part->phystype==PART_PHYS_KEYED && psys->keyed_ob && diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 1a6f57e75c4..80a9f173d6a 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -6295,6 +6295,9 @@ CustomDataMask particleSystemModifier_requiredDataMask(Object *ob, ModifierData MTex *mtex; int i; + if(!psmd->psys->part) + return 0; + ma= give_current_material(ob, psmd->psys->part->omat); if(ma) { for(i=0; iparticlesystem.first, i=0; psys; psys=psys->next, i++) { + if(i == index - 1) + psys->flag |= PSYS_CURRENT; + else + psys->flag &= ~PSYS_CURRENT; + } +} Object *psys_find_object(Scene *scene, ParticleSystem *psys) { Base *base = scene->base.first; @@ -307,7 +321,7 @@ int psys_check_enabled(Object *ob, ParticleSystem *psys) ParticleSystemModifierData *psmd; Mesh *me; - if(psys->flag & PSYS_DISABLED || psys->flag & PSYS_DELETE) + if(psys->flag & PSYS_DISABLED || psys->flag & PSYS_DELETE || !psys->part) return 0; if(ob->type == OB_MESH) { @@ -2915,6 +2929,61 @@ void psys_mat_hair_to_global(Object *ob, DerivedMesh *dm, short from, ParticleDa /************************************************/ /* ParticleSettings handling */ /************************************************/ +void object_add_particle_system_slot(Scene *scene, Object *ob) +{ + ParticleSystem *psys; + ModifierData *md; + ParticleSystemModifierData *psmd; + + if(!ob || ob->type != OB_MESH) + return; + + psys = ob->particlesystem.first; + for(; psys; psys=psys->next) + psys->flag &= ~PSYS_CURRENT; + + psys = MEM_callocN(sizeof(ParticleSystem), "particle_system"); + psys->pointcache = BKE_ptcache_add(); + BLI_addtail(&ob->particlesystem, psys); + + psys->part = psys_new_settings("PSys", NULL); + + md= modifier_new(eModifierType_ParticleSystem); + sprintf(md->name, "ParticleSystem %i", BLI_countlist(&ob->particlesystem)); + psmd= (ParticleSystemModifierData*) md; + psmd->psys=psys; + BLI_addtail(&ob->modifiers, md); + + psys->totpart=0; + psys->flag = PSYS_ENABLED|PSYS_CURRENT; + psys->cfra=bsystem_time(scene,ob,scene->r.cfra+1,0.0); + + DAG_scene_sort(scene); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); +} +void object_remove_particle_system_slot(Scene *scene, Object *ob) +{ + ParticleSystem *psys = psys_get_current(ob); + ParticleSystemModifierData *psmd; + + if(!psys) + return; + + /* clear modifier */ + psmd= psys_get_modifier(ob, psys); + BLI_remlink(&ob->modifiers, psmd); + modifier_free((ModifierData *)psmd); + + /* clear particle system */ + BLI_remlink(&ob->particlesystem, psys); + psys_free(ob,psys); + + if(ob->particlesystem.first) + ((ParticleSystem *) ob->particlesystem.first)->flag |= PSYS_CURRENT; + + DAG_scene_sort(scene); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); +} static void default_particle_settings(ParticleSettings *part) { int i; @@ -3001,6 +3070,9 @@ ParticleSettings *psys_new_settings(char *name, Main *main) { ParticleSettings *part; + if(main==NULL) + main = G.main; + part= alloc_libblock(&main->particle, ID_PA, name); default_particle_settings(part); diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h index b213e4288be..13ea778fb00 100644 --- a/source/blender/editors/space_buttons/buttons_intern.h +++ b/source/blender/editors/space_buttons/buttons_intern.h @@ -71,5 +71,10 @@ void MATERIAL_OT_new(struct wmOperatorType *ot); void TEXTURE_OT_new(struct wmOperatorType *ot); void WORLD_OT_new(struct wmOperatorType *ot); +void OBJECT_OT_particle_system_slot_add(struct wmOperatorType *ot); +void OBJECT_OT_particle_system_slot_remove(struct wmOperatorType *ot); + +void PARTICLE_OT_new(struct wmOperatorType *ot); + #endif /* ED_BUTTONS_INTERN_H */ diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 6755a2be1b7..6ca92674c6e 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -42,6 +42,7 @@ #include "BKE_font.h" #include "BKE_library.h" #include "BKE_material.h" +#include "BKE_particle.h" #include "BKE_texture.h" #include "BKE_utildefines.h" #include "BKE_world.h" @@ -407,3 +408,109 @@ void WORLD_OT_new(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } + + +/********************** particle system slot operators *********************/ + +static int particle_system_slot_add_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Scene *scene = CTX_data_scene(C); + + if(!scene || !ob) + return OPERATOR_CANCELLED; + + object_add_particle_system_slot(scene, ob); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_particle_system_slot_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Particle System Slot"; + ot->idname= "OBJECT_OT_particle_system_slot_add"; + + /* api callbacks */ + ot->exec= particle_system_slot_add_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int particle_system_slot_remove_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Scene *scene = CTX_data_scene(C); + + if(!scene || !ob) + return OPERATOR_CANCELLED; + + object_remove_particle_system_slot(scene, ob); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_particle_system_slot_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Particle System Slot"; + ot->idname= "OBJECT_OT_particle_system_slot_remove"; + + /* api callbacks */ + ot->exec= particle_system_slot_remove_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************** new particle settings operator *********************/ + +static int new_particle_settings_exec(bContext *C, wmOperator *op) +{ + Scene *scene = CTX_data_scene(C); + ParticleSettings *part= CTX_data_pointer_get_type(C, "particle_settings", &RNA_ParticleSettings).data; + Object *ob; + PointerRNA ptr; + + /* add or copy particle setting */ + if(part) + part= psys_copy_settings(part); + else + part= psys_new_settings("PSys", NULL); + + /* attempt to assign to material slot */ + ptr= CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); + + if(ptr.data) { + ParticleSystem *psys = (ParticleSystem*)ptr.data; + ob= ptr.id.data; + + if(psys->part) + psys->part->id.us--; + + psys->part = part; + + DAG_scene_sort(scene); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + } + + return OPERATOR_FINISHED; +} + +void PARTICLE_OT_new(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "New Particle Settings"; + ot->idname= "PARTICLE_OT_new"; + + /* api callbacks */ + ot->exec= new_particle_settings_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 483a1dc6100..7954d5254cc 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -219,6 +219,11 @@ void buttons_operatortypes(void) WM_operatortype_append(MATERIAL_OT_new); WM_operatortype_append(TEXTURE_OT_new); WM_operatortype_append(WORLD_OT_new); + + WM_operatortype_append(OBJECT_OT_particle_system_slot_add); + WM_operatortype_append(OBJECT_OT_particle_system_slot_remove); + + WM_operatortype_append(PARTICLE_OT_new); } void buttons_keymap(struct wmWindowManager *wm) diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 5b553469bc8..9b3100c733b 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -241,6 +241,25 @@ static PointerRNA rna_Object_active_material_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_MaterialSlot, ob->mat+ob->actcol); } +static void rna_Object_active_particle_system_index_range(PointerRNA *ptr, int *min, int *max) +{ + Object *ob= (Object*)ptr->id.data; + *min= 1; + *max= BLI_countlist(&ob->particlesystem); +} + +static int rna_Object_active_particle_system_index_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + return psys_get_current_num(ob) + 1; +} + +static void rna_Object_active_particle_system_index_set(struct PointerRNA *ptr, int value) +{ + Object *ob= (Object*)ptr->id.data; + psys_set_current_num(ob, value); +} + #if 0 static void rna_Object_active_material_set(PointerRNA *ptr, PointerRNA value) { @@ -929,6 +948,10 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, "rna_Object_active_particle_system_get", NULL, NULL); RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed"); + prop= RNA_def_property(srna, "active_particle_system_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_funcs(prop, "rna_Object_active_particle_system_index_get", "rna_Object_active_particle_system_index_set", "rna_Object_active_particle_system_index_range"); + RNA_def_property_ui_text(prop, "Active Particle System Index", "Index of active particle system slot."); + /* restrict */ prop= RNA_def_property(srna, "restrict_view", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index ae53c815ed9..d60a215b498 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -81,13 +81,11 @@ static void rna_Particle_reset(bContext *C, PointerRNA *ptr) if(ob) { DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - //WM_event_add_notifier(C, NC_SCENE|ND_CACHE_PHYSICS, scene); } } else { part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET); - //WM_event_add_notifier(C, NC_SCENE|ND_CACHE_PHYSICS, scene); } } @@ -104,13 +102,11 @@ static void rna_Particle_change_type(bContext *C, PointerRNA *ptr) if(ob) { DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - //WM_event_add_notifier(C, NC_SCENE|ND_CACHE_PHYSICS, scene); } } else { part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET|PSYS_RECALC_TYPE); - //WM_event_add_notifier(C, NC_SCENE|ND_CACHE_PHYSICS, scene); } } @@ -134,6 +130,27 @@ static void rna_Particle_redo_child(bContext *C, PointerRNA *ptr) psys_flush_particle_settings(scene, part, PSYS_RECALC_CHILD); } } +static PointerRNA rna_particle_settings_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + ParticleSettings *part = psys_get_current(ob)->part; + + return rna_pointer_inherit_refine(ptr, &RNA_ParticleSettings, part); +} + +static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value) +{ + Object *ob= (Object*)ptr->id.data; + ParticleSystem *psys = psys_get_current(ob); + + if(psys->part) + psys->part->id.us--; + + psys->part = (ParticleSettings *)value.data; + + if(psys->part) + psys->part->id.us++; +} static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value) { ParticleSettings *settings = (ParticleSettings*)ptr->data; @@ -1493,9 +1510,15 @@ static void rna_def_particle_system(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_struct_name_property(srna, prop); + /* access to particle settings is redirected through functions */ + /* to allow proper id-buttons functionality */ prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "part"); + //RNA_def_property_pointer_sdna(prop, NULL, "part"); + RNA_def_property_struct_type(prop, "ParticleSettings"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_pointer_funcs(prop, "rna_particle_settings_get", "rna_particle_settings_set", NULL); RNA_def_property_ui_text(prop, "Settings", "Particle system settings."); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "particles", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "particles", "totpart"); -- cgit v1.2.3 From c79e57dba8f436e0b3a9b231f70a2ba121438907 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 27 Jun 2009 16:35:42 +0000 Subject: 2.5 Two bugfixes: - When making 2d windows small (zero sized) the view2d data could get corrupted with NaN values. Clipped values correctly to 1. - Search menu (ctrl+alt+f) had wrong color for selected text in text button --- source/blender/editors/interface/interface_widgets.c | 2 +- source/blender/editors/interface/view2d.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 735cfe742c6..ddf31c0db66 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1028,7 +1028,7 @@ static struct uiWidgetColors wcol_menu_back= { {0, 0, 0, 255}, {25, 25, 25, 230}, {45, 45, 45, 230}, - {255, 255, 255, 255}, + {100, 100, 100, 255}, {255, 255, 255, 255}, {255, 255, 255, 255}, diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 4621be6eda0..aa5aa65d300 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -316,6 +316,12 @@ void UI_view2d_curRect_validate(View2D *v2d) if (v2d->keepzoom & V2D_LOCKZOOM_Y) height= winy; + /* values used to divide, so make it safe */ + if(width<1) width= 1; + if(height<1) height= 1; + if(winx<1) winx= 1; + if(winy<1) winy= 1; + /* keepzoom (V2D_KEEPZOOM set), indicates that zoom level on each axis must not exceed limits * NOTE: in general, it is not expected that the lock-zoom will be used in conjunction with this */ -- cgit v1.2.3 From b097f7250d46b191734acef65e7a87ea8c4afff0 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sat, 27 Jun 2009 17:10:19 +0000 Subject: 2.5/Sculpt: Removed a bunch of old code that was #ifdef'd out. Mostly relates to partial visibility and partial redraw. Both of these are important features, but need better design updated for 2.5. Also removed the old (huge/ugly!) sculpt() function that is now handled by the stroke operator code. --- source/blender/editors/sculpt_paint/sculpt.c | 584 --------------------------- 1 file changed, 584 deletions(-) (limited to 'source') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index f40880b901f..318abf792c1 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -738,37 +738,6 @@ static void sculpt_add_damaged_rect(SculptSession *ss) } } -/* Clears the depth buffer in each modified area. */ -#if 0 -static void sculpt_clear_damaged_areas(SculptSession *ss) -{ - RectNode *rn= NULL; - - for(rn = ss->damaged_rects.first; rn; rn = rn->next) { - rcti clp = rn->r; - rcti *win = NULL; /*XXX: &curarea->winrct; */ - - clp.xmin += win->xmin; - clp.xmax += win->xmin; - clp.ymin += win->ymin; - clp.ymax += win->ymin; - - if(clp.xmin < win->xmax && clp.xmax > win->xmin && - clp.ymin < win->ymax && clp.ymax > win->ymin) { - if(clp.xmin < win->xmin) clp.xmin = win->xmin; - if(clp.ymin < win->ymin) clp.ymin = win->ymin; - if(clp.xmax > win->xmax) clp.xmax = win->xmax; - if(clp.ymax > win->ymax) clp.ymax = win->ymax; - - glScissor(clp.xmin + 1, clp.ymin + 1, - clp.xmax - clp.xmin - 2, - clp.ymax - clp.ymin - 2); - } - - glClear(GL_DEPTH_BUFFER_BIT); - } -} -#endif static void do_brush_action(Sculpt *sd, StrokeCache *cache) { SculptSession *ss = sd->session; @@ -987,25 +956,6 @@ static void sculpt_update_tex(Sculpt *sd) } } -void sculptmode_selectbrush_menu(void) -{ - /* XXX: I guess menus belong elsewhere too? - - Sculpt *sd= sculpt_data(); - int val; - - pupmenu_set_active(sd->brush_type); - - val= pupmenu("Select Brush%t|Draw|Smooth|Pinch|Inflate|Grab|Layer|Flatten"); - - if(val>0) { - sd->brush_type= val; - - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWBUTSEDIT, 1); - }*/ -} - static void sculptmode_update_all_projverts(SculptSession *ss) { unsigned i; @@ -1084,89 +1034,6 @@ static void sculpt_update_mesh_elements(bContext *C) } } -/* XXX: lots of drawing code (partial redraw), has to go elsewhere */ -#if 0 -void sculptmode_draw_wires(SculptSession *ss, int only_damaged) -{ - Mesh *me = get_mesh(OBACT); - int i; - - bglPolygonOffset(1.0); - glDepthMask(0); - BIF_ThemeColor((OBACT==OBACT)?TH_ACTIVE:TH_SELECT); - - for(i=0; itotedge; i++) { - MEdge *med= &me->medge[i]; - - if((!only_damaged || (ss->projverts[med->v1].inside || ss->projverts[med->v2].inside)) && - (med->flag & ME_EDGEDRAW)) { - glDrawElements(GL_LINES, 2, GL_UNSIGNED_INT, &med->v1); - } - } - - glDepthMask(1); - bglPolygonOffset(0.0); -} - -void sculptmode_draw_mesh(int only_damaged) -{ - int i, j, dt, drawCurrentMat = 1, matnr= -1; - SculptSession *ss = sculpt_session(); - - sculpt_update_mesh_elements(ss, OBACT); - - persp(PERSP_VIEW); - mymultmatrix(OBACT->obmat); - glEnable(GL_DEPTH_TEST); - glEnable(GL_LIGHTING); - /* XXX: GPU_set_object_materials(G.scene, OBACT, 0, NULL); */ - glEnable(GL_CULL_FACE); - - glShadeModel(GL_SMOOTH); - - glVertexPointer(3, GL_FLOAT, sizeof(MVert), &cache->mvert[0].co); - glNormalPointer(GL_SHORT, sizeof(MVert), &cache->mvert[0].no); - - dt= MIN2(G.vd->drawtype, OBACT->dt); - if(dt==OB_WIRE) - glColorMask(0,0,0,0); - - for(i=0; itotface; ++i) { - MFace *f= &ss->mface[i]; - char inside= 0; - int new_matnr= f->mat_nr + 1; - - if(new_matnr != matnr) - drawCurrentMat= GPU_enable_material(matnr = new_matnr, NULL); - - /* If only_damaged!=0, only draw faces that are partially - inside the area(s) modified by the brush */ - if(only_damaged) { - for(j=0; j<(f->v4?4:3); ++j) { - if(ss->projverts[*((&f->v1)+j)].inside) { - inside= 1; - break; - } - } - } - else - inside= 1; - - if(inside && drawCurrentMat) - glDrawElements(f->v4?GL_QUADS:GL_TRIANGLES, f->v4?4:3, GL_UNSIGNED_INT, &f->v1); - } - - glDisable(GL_CULL_FACE); - glDisable(GL_LIGHTING); - glColorMask(1,1,1,1); - - if(dt==OB_WIRE || (OBACT->dtx & OB_DRAWWIRE)) - sculptmode_draw_wires(ss, only_damaged); - - glDisable(GL_DEPTH_TEST); -} -#endif - static int sculpt_mode_poll(bContext *C) { return G.f & G_SCULPTMODE; @@ -1718,454 +1585,3 @@ void ED_operatortypes_sculpt() WM_operatortype_append(SCULPT_OT_sculptmode_toggle); WM_operatortype_append(SCULPT_OT_brush_curve_preset); } - -void sculpt(Sculpt *sd) -{ -#if 0 - SculptSession *ss= sd->session; - Object *ob= NULL; /*XXX */ - Mesh *me; - MultiresModifierData *mmd = NULL; - /* lastSigMouse is for the rake, to store the last place the mouse movement was significant */ - short mouse[2], mvalo[2], lastSigMouse[2],firsttime=1, mousebut; - short modifier_calculations= 0; - BrushAction *a = MEM_callocN(sizeof(BrushAction), "brush action"); - short spacing= 32000; - int scissor_box[4]; - float offsetRot; - int smooth_stroke = 0, i; - int anchored, rake = 0 /* XXX: rake = ? */; - - /* XXX: checking that sculpting is allowed - if(!(G.f & G_SCULPTMODE) || G.obedit || !ob || ob->id.lib || !get_mesh(ob) || (get_mesh(ob)->totface == 0)) - return; - if(!(ob->lay & G.vd->lay)) - error("Active object is not in this layer"); - if(ob_get_keyblock(ob)) { - if(!(ob->shapeflag & OB_SHAPE_LOCK)) { - error("Cannot sculpt on unlocked shape key"); - return; - } - }*/ - - anchored = sd->brush->flag & BRUSH_ANCHORED; - smooth_stroke = (sd->flags & SCULPT_INPUT_SMOOTH) && (sd->brush->sculpt_tool != SCULPT_TOOL_GRAB) && !anchored; - - if(smooth_stroke) - sculpt_stroke_new(256); - - ss->damaged_rects.first = ss->damaged_rects.last = NULL; - ss->damaged_verts.first = ss->damaged_verts.last = NULL; - ss->vertexcosnos = NULL; - - mmd = sculpt_multires_active(ob); - - /* Check that vertex users are up-to-date */ - if(ob != active_ob || !ss->vertex_users || ss->vertex_users_size != cache->totvert) { - sculpt_vertexusers_free(ss); - calc_vertex_users(ss); - if(ss->projverts) - MEM_freeN(ss->projverts); - ss->projverts = NULL; - active_ob= ob; - } - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - - /*XXX: - persp(PERSP_VIEW); - getmouseco_areawin(mvalo);*/ - - /* Init texture - FIXME: Shouldn't be doing this every time! */ - if(sd->tex_mode!=SCULPTREPT_3D) - sculptmode_update_tex(sd); - - /*XXX: getmouseco_areawin(mouse); */ - mvalo[0]= mouse[0]; - mvalo[1]= mouse[1]; - lastSigMouse[0]=mouse[0]; - lastSigMouse[1]=mouse[1]; - mousebut = 0; /* XXX: L_MOUSE; */ - - /* If modifier_calculations is true, then extra time must be spent - updating the mesh. This takes a *lot* longer, so it's worth - skipping if the modifier stack is empty. */ - modifier_calculations= sculpt_modifiers_active(ob); - - if(modifier_calculations) - ss->vertexcosnos= mesh_get_mapped_verts_nors(NULL, ob); /* XXX: scene = ? */ - sculptmode_update_all_projverts(ss); - - /* Capture original copy */ - if(sd->flags & SCULPT_DRAW_FAST) - glAccum(GL_LOAD, 1); - - /* Get original scissor box */ - glGetIntegerv(GL_SCISSOR_BOX, scissor_box); - - /* For raking, get the original angle*/ - offsetRot=sculpt_tex_angle(sd); - - me = get_mesh(ob); - - while (/*XXX:get_mbut() & mousebut*/0) { - /* XXX: getmouseco_areawin(mouse); */ - /* If rake, and the mouse has moved over 10 pixels (euclidean) (prevents jitter) then get the new angle */ - if (rake && (pow(lastSigMouse[0]-mouse[0],2)+pow(lastSigMouse[1]-mouse[1],2))>100){ - /*Nasty looking, but just orig + new angle really*/ - set_tex_angle(sd, offsetRot+180.+to_deg(atan2((float)(mouse[1]-lastSigMouse[1]),(float)(mouse[0]-lastSigMouse[0])))); - lastSigMouse[0]=mouse[0]; - lastSigMouse[1]=mouse[1]; - } - - if(firsttime || mouse[0]!=mvalo[0] || mouse[1]!=mvalo[1] || - sd->brush->flag & BRUSH_AIRBRUSH) { - a->firsttime = firsttime; - firsttime= 0; - - if(smooth_stroke) - sculpt_stroke_add_point(ss->stroke, mouse[0], mouse[1]); - - spacing+= sqrt(pow(mvalo[0]-mouse[0],2)+pow(mvalo[1]-mouse[1],2)); - - if(modifier_calculations && !ss->vertexcosnos) - ss->vertexcosnos= mesh_get_mapped_verts_nors(NULL, ob); /*XXX scene = ? */ - - if(sd->brush->sculpt_tool != SCULPT_TOOL_GRAB) { - if(anchored) { - /* Restore the mesh before continuing with anchored stroke */ - /*if(a->mesh_store) { - for(i = 0; i < cache->totvert; ++i) { - VecCopyf(cache->mvert[i].co, &a->mesh_store[i].x); - cache->mvert[i].no[0] = a->orig_norms[i][0]; - cache->mvert[i].no[1] = a->orig_norms[i][1]; - cache->mvert[i].no[2] = a->orig_norms[i][2]; - } - }*/ - - //do_symmetrical_brush_actions(sd, a, mouse, NULL); - } - else { - if(smooth_stroke) { - sculpt_stroke_apply(sd, ss->stroke); - } - else if(sd->spacing==0 || spacing>sd->spacing) { - //do_symmetrical_brush_actions(sd, a, mouse, NULL); - spacing= 0; - } - } - } - else { - //do_symmetrical_brush_actions(sd, a, mouse, mvalo); - //unproject(ss, sd->pivot, mouse[0], mouse[1], a->depth); - } - - if((!ss->multires && modifier_calculations) || ob_get_keyblock(ob)) { - /* XXX: DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); */ } - - if(modifier_calculations || sd->brush->sculpt_tool == SCULPT_TOOL_GRAB || !(sd->flags & SCULPT_DRAW_FAST)) { - calc_damaged_verts(ss, a); - /*XXX: scrarea_do_windraw(curarea); - screen_swapbuffers(); */ - } else { /* Optimized drawing */ - calc_damaged_verts(ss, a); - - /* Draw the stored image to the screen */ - glAccum(GL_RETURN, 1); - - sculpt_clear_damaged_areas(ss); - - /* Draw all the polygons that are inside the modified area(s) */ - glScissor(scissor_box[0], scissor_box[1], scissor_box[2], scissor_box[3]); - /* XXX: sculptmode_draw_mesh(1); */ - glAccum(GL_LOAD, 1); - - projverts_clear_inside(ss); - - /* XXX: persp(PERSP_WIN); */ - glDisable(GL_DEPTH_TEST); - - /* Draw cursor */ - if(sd->flags & SCULPT_TOOL_DRAW) - fdrawXORcirc((float)mouse[0],(float)mouse[1],sd->brush->size); - /* XXX: if(smooth_stroke) - sculpt_stroke_draw(); - - myswapbuffers(); */ - } - - BLI_freelistN(&ss->damaged_rects); - ss->damaged_rects.first = ss->damaged_rects.last = NULL; - - mvalo[0]= mouse[0]; - mvalo[1]= mouse[1]; - - if(ss->vertexcosnos) { - MEM_freeN(ss->vertexcosnos); - ss->vertexcosnos= NULL; - } - - } - else { /*XXX:BIF_wait_for_statechange();*/ } - } - - /* Set the rotation of the brush back to what it was before any rake */ - set_tex_angle(sd, offsetRot); - - if(smooth_stroke) { - sculpt_stroke_apply_all(sd, ss->stroke); - calc_damaged_verts(ss, a); - BLI_freelistN(&ss->damaged_rects); - } - - //if(a->layer_disps) MEM_freeN(a->layer_disps); - //if(a->mesh_store) MEM_freeN(a->mesh_store); - //if(a->orig_norms) MEM_freeN(a->orig_norms); - for(i=0; i<8; ++i) - BLI_freelistN(&a->grab_active_verts[i]); - MEM_freeN(a); - sculpt_stroke_free(ss->stroke); - ss->stroke = NULL; - - if(mmd) { - if(mmd->undo_verts && mmd->undo_verts != cache->mvert) - MEM_freeN(mmd->undo_verts); - - mmd->undo_verts = cache->mvert; - mmd->undo_verts_tot = cache->totvert; - } - - //sculpt_undo_push(sd); - - /* XXX: if(G.vd->depths) G.vd->depths->damaged= 1; - allqueue(REDRAWVIEW3D, 0); */ -#endif -} - -/* Partial Mesh Visibility */ - -/* XXX: Partial vis. always was a mess, have to figure something out */ -#if 0 -/* mode: 0=hide outside selection, 1=hide inside selection */ -static void sculptmode_do_pmv(Object *ob, rcti *hb_2d, int mode) -{ - Mesh *me= get_mesh(ob); - float hidebox[6][3]; - vec3f plane_normals[4]; - float plane_ds[4]; - unsigned i, j; - unsigned ndx_show, ndx_hide; - MVert *nve; - unsigned face_cnt_show= 0, face_ndx_show= 0; - unsigned edge_cnt_show= 0, edge_ndx_show= 0; - unsigned *old_map= NULL; - const unsigned SHOW= 0, HIDE=1; - - /* Convert hide box from 2D to 3D */ - unproject(hidebox[0], hb_2d->xmin, hb_2d->ymax, 1); - unproject(hidebox[1], hb_2d->xmax, hb_2d->ymax, 1); - unproject(hidebox[2], hb_2d->xmax, hb_2d->ymin, 1); - unproject(hidebox[3], hb_2d->xmin, hb_2d->ymin, 1); - unproject(hidebox[4], hb_2d->xmin, hb_2d->ymax, 0); - unproject(hidebox[5], hb_2d->xmax, hb_2d->ymin, 0); - - /* Calculate normals for each side of hide box */ - CalcNormFloat(hidebox[0], hidebox[1], hidebox[4], &plane_normals[0].x); - CalcNormFloat(hidebox[1], hidebox[2], hidebox[5], &plane_normals[1].x); - CalcNormFloat(hidebox[2], hidebox[3], hidebox[5], &plane_normals[2].x); - CalcNormFloat(hidebox[3], hidebox[0], hidebox[4], &plane_normals[3].x); - - /* Calculate D for each side of hide box */ - for(i= 0; i<4; ++i) - plane_ds[i]= hidebox[i][0]*plane_normals[i].x + hidebox[i][1]*plane_normals[i].y + - hidebox[i][2]*plane_normals[i].z; - - /* Add partial visibility to mesh */ - if(!me->pv) { - me->pv= MEM_callocN(sizeof(PartialVisibility),"PartialVisibility"); - } else { - old_map= MEM_callocN(sizeof(unsigned)*me->pv->totvert,"PMV oldmap"); - for(i=0; ipv->totvert; ++i) { - old_map[i]= me->pv->vert_map[i]totvert?0:1; - } - mesh_pmv_revert(ob, me); - } - - /* Kill sculpt data */ - active_ob= NULL; - - /* Initalize map with which verts are to be hidden */ - me->pv->vert_map= MEM_mallocN(sizeof(unsigned)*me->totvert, "PMV vertmap"); - me->pv->totvert= me->totvert; - me->totvert= 0; - for(i=0; ipv->totvert; ++i) { - me->pv->vert_map[i]= mode ? HIDE:SHOW; - for(j=0; j<4; ++j) { - if(me->mvert[i].co[0] * plane_normals[j].x + - me->mvert[i].co[1] * plane_normals[j].y + - me->mvert[i].co[2] * plane_normals[j].z < plane_ds[j] ) { - me->pv->vert_map[i]= mode ? SHOW:HIDE; /* Vert is outside the hide box */ - break; - } - } - if(old_map && old_map[i]) me->pv->vert_map[i]= 1; - if(!me->pv->vert_map[i]) ++me->totvert; - - } - if(old_map) MEM_freeN(old_map); - - /* Find out how many faces to show */ - for(i=0; itotface; ++i) { - if(!me->pv->vert_map[me->mface[i].v1] && - !me->pv->vert_map[me->mface[i].v2] && - !me->pv->vert_map[me->mface[i].v3]) { - if(me->mface[i].v4) { - if(!me->pv->vert_map[me->mface[i].v4]) - ++face_cnt_show; - } - else ++face_cnt_show; - } - } - /* Find out how many edges to show */ - for(i=0; itotedge; ++i) { - if(!me->pv->vert_map[me->medge[i].v1] && - !me->pv->vert_map[me->medge[i].v2]) - ++edge_cnt_show; - } - - /* Create new vert array and reset each vert's map with map[old]=new index */ - nve= MEM_mallocN(sizeof(MVert)*me->pv->totvert, "PMV verts"); - ndx_show= 0; ndx_hide= me->totvert; - for(i=0; ipv->totvert; ++i) { - if(me->pv->vert_map[i]) { - me->pv->vert_map[i]= ndx_hide; - nve[me->pv->vert_map[i]]= me->mvert[i]; - ++ndx_hide; - } else { - me->pv->vert_map[i]= ndx_show; - nve[me->pv->vert_map[i]]= me->mvert[i]; - ++ndx_show; - } - } - CustomData_free_layer_active(&me->vdata, CD_MVERT, me->pv->totvert); - me->mvert= CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN, nve, me->totvert); - - /* Create new face array */ - me->pv->old_faces= me->mface; - me->pv->totface= me->totface; - me->mface= MEM_mallocN(sizeof(MFace)*face_cnt_show, "PMV faces"); - for(i=0; itotface; ++i) { - MFace *pr_f= &me->pv->old_faces[i]; - char show= 0; - - if(me->pv->vert_map[pr_f->v1] < me->totvert && - me->pv->vert_map[pr_f->v2] < me->totvert && - me->pv->vert_map[pr_f->v3] < me->totvert) { - if(pr_f->v4) { - if(me->pv->vert_map[pr_f->v4] < me->totvert) - show= 1; - } - else show= 1; - } - - if(show) { - MFace *cr_f= &me->mface[face_ndx_show]; - *cr_f= *pr_f; - cr_f->v1= me->pv->vert_map[pr_f->v1]; - cr_f->v2= me->pv->vert_map[pr_f->v2]; - cr_f->v3= me->pv->vert_map[pr_f->v3]; - cr_f->v4= pr_f->v4 ? me->pv->vert_map[pr_f->v4] : 0; - test_index_face(cr_f,NULL,0,pr_f->v4?4:3); - ++face_ndx_show; - } - } - me->totface= face_cnt_show; - CustomData_set_layer(&me->fdata, CD_MFACE, me->mface); - - /* Create new edge array */ - me->pv->old_edges= me->medge; - me->pv->totedge= me->totedge; - me->medge= MEM_mallocN(sizeof(MEdge)*edge_cnt_show, "PMV edges"); - me->pv->edge_map= MEM_mallocN(sizeof(int)*me->pv->totedge,"PMV edgemap"); - for(i=0; itotedge; ++i) { - if(me->pv->vert_map[me->pv->old_edges[i].v1] < me->totvert && - me->pv->vert_map[me->pv->old_edges[i].v2] < me->totvert) { - MEdge *cr_e= &me->medge[edge_ndx_show]; - me->pv->edge_map[i]= edge_ndx_show; - *cr_e= me->pv->old_edges[i]; - cr_e->v1= me->pv->vert_map[me->pv->old_edges[i].v1]; - cr_e->v2= me->pv->vert_map[me->pv->old_edges[i].v2]; - ++edge_ndx_show; - } - else me->pv->edge_map[i]= -1; - } - me->totedge= edge_cnt_show; - CustomData_set_layer(&me->edata, CD_MEDGE, me->medge); - - /* XXX: DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); */ -} - -static rcti sculptmode_pmv_box() -{ - /*XXX: short down[2], mouse[2]; - rcti ret; - - getmouseco_areawin(down); - - while((get_mbut()&L_MOUSE) || (get_mbut()&R_MOUSE)) { - getmouseco_areawin(mouse); - - scrarea_do_windraw(curarea); - - persp(PERSP_WIN); - glLineWidth(2); - setlinestyle(2); - sdrawXORline(down[0],down[1],mouse[0],down[1]); - sdrawXORline(mouse[0],down[1],mouse[0],mouse[1]); - sdrawXORline(mouse[0],mouse[1],down[0],mouse[1]); - sdrawXORline(down[0],mouse[1],down[0],down[1]); - setlinestyle(0); - glLineWidth(1); - persp(PERSP_VIEW); - - screen_swapbuffers(); - backdrawview3d(0); - } - - ret.xmin= down[0]mouse[0]?down[0]:mouse[0]; - ret.ymax= down[1]>mouse[1]?down[1]:mouse[1]; - return ret;*/ -} - -void sculptmode_pmv(int mode) -{ - Object *ob= NULL; /*XXX: OBACT; */ - rcti hb_2d; - - if(ob_get_key(ob)) { - error("Cannot hide mesh with shape keys enabled"); - return; - } - - hb_2d= sculptmode_pmv_box(); /* Get 2D hide box */ - - sculptmode_correct_state(); - - waitcursor(1); - - if(hb_2d.xmax-hb_2d.xmin > 3 && hb_2d.ymax-hb_2d.ymin > 3) { - init_sculptmatrices(); - - sculptmode_do_pmv(ob,&hb_2d,mode); - } - else mesh_pmv_off(ob, get_mesh(ob)); - - /*XXX: scrarea_do_windraw(curarea); */ - - waitcursor(0); -} -#endif -- cgit v1.2.3 From 67073db49ced1bb561783a7f4cb862c1bad0e865 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sat, 27 Jun 2009 21:14:04 +0000 Subject: 2.5/Sculpt: Improved sculpting in perspective mode; starting a stroke on the background would sometimes result in the brush having a huge effect on the mesh. Fixed by waiting to start the stroke until the mouse moves over the model. The fix is not quite perfect, because detection of the edge of the model is based on the depth buffer, so other things that change the depth buffer, like the grid and axis lines in the 3d view, can throw off the calculation. --- source/blender/editors/sculpt_paint/sculpt.c | 56 ++++++++++++++++++---------- 1 file changed, 36 insertions(+), 20 deletions(-) (limited to 'source') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 318abf792c1..8f0b52ef3a1 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1343,9 +1343,6 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *even Sculpt *sd = CTX_data_tool_settings(C)->sculpt; view3d_operator_needs_opengl(C); - sculpt_brush_stroke_init_properties(C, op, event, sd->session); - - sculptmode_update_all_projverts(sd->session); /* TODO: Shouldn't really have to do this at the start of every stroke, but sculpt would need some sort of notification when @@ -1414,34 +1411,53 @@ static int sculpt_brush_stroke_modal(bContext *C, wmOperator *op, wmEvent *event { PointerRNA itemptr; Sculpt *sd = CTX_data_tool_settings(C)->sculpt; + ARegion *ar = CTX_wm_region(C); float center[3]; int mouse[2] = {event->x, event->y}; + float cur_depth; sculpt_update_mesh_elements(C); - unproject(sd->session->cache->mats, center, event->x, event->y, - read_cached_depth(&sd->session->cache->vc, event->x, event->y)); + if(!sd->session->cache) { + ViewContext vc; + view3d_set_viewcontext(C, &vc); + cur_depth = read_cached_depth(&vc, event->x, event->y); - /* Add to stroke */ - RNA_collection_add(op->ptr, "stroke", &itemptr); - RNA_float_set_array(&itemptr, "location", center); - RNA_int_set_array(&itemptr, "mouse", mouse); - RNA_boolean_set(&itemptr, "flip", event->shift); - sculpt_update_cache_variants(sd, &itemptr); + /* Don't start the stroke until a valid depth is found */ + if(cur_depth < 1.0 - FLT_EPSILON) { + sculpt_brush_stroke_init_properties(C, op, event, sd->session); + sculptmode_update_all_projverts(sd->session); + } - sculpt_restore_mesh(sd); - do_symmetrical_brush_actions(CTX_data_tool_settings(C)->sculpt, sd->session->cache); + ED_region_tag_redraw(ar); + } - sculpt_flush_update(C); - sculpt_post_stroke_free(sd->session); + if(sd->session->cache) { + cur_depth = read_cached_depth(&sd->session->cache->vc, event->x, event->y); + unproject(sd->session->cache->mats, center, event->x, event->y, cur_depth); - /* Finished */ - if(event->type == LEFTMOUSE && event->val == 0) { - request_depth_update(sd->session->cache->vc.rv3d); + /* Add to stroke */ + RNA_collection_add(op->ptr, "stroke", &itemptr); + RNA_float_set_array(&itemptr, "location", center); + RNA_int_set_array(&itemptr, "mouse", mouse); + RNA_boolean_set(&itemptr, "flip", event->shift); + sculpt_update_cache_variants(sd, &itemptr); + + sculpt_restore_mesh(sd); + do_symmetrical_brush_actions(CTX_data_tool_settings(C)->sculpt, sd->session->cache); - sculpt_cache_free(sd->session->cache); + sculpt_flush_update(C); + sculpt_post_stroke_free(sd->session); + } - sculpt_undo_push(C, sd); + /* Finished */ + if(event->type == LEFTMOUSE && event->val == 0) { + if(sd->session->cache) { + request_depth_update(sd->session->cache->vc.rv3d); + sculpt_cache_free(sd->session->cache); + sd->session->cache = NULL; + sculpt_undo_push(C, sd); + } return OPERATOR_FINISHED; } -- cgit v1.2.3 From aa933d2c9fbffbeccc2f13d69f10120e8bfe55b8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 27 Jun 2009 23:54:20 +0000 Subject: BGE Redraw problem: at the moment only files from blender 2.4x will display in 2.5x, compared area and window structs in both cases and dont see any differences. This doesnt fix the problem but corrects a few things related to window drawing with the BGE, also adds a hack because I noticed the window and area pointers in the KX_BlenderCanvas were offset after initialized, maybe need to use ? --- .../BlenderRoutines/BL_KetsjiEmbedStart.cpp | 41 ++++++++-------------- source/gameengine/BlenderRoutines/CMakeLists.txt | 3 +- .../BlenderRoutines/KX_BlenderCanvas.cpp | 12 +++++-- .../gameengine/BlenderRoutines/KX_BlenderCanvas.h | 4 +-- source/gameengine/BlenderRoutines/SConscript | 3 +- 5 files changed, 31 insertions(+), 32 deletions(-) (limited to 'source') diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 44678cb73eb..fb222b419c3 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -65,6 +65,14 @@ #include "SYS_System.h" +#include "GPU_extensions.h" +#include "Value.h" + + + +#ifdef __cplusplus +extern "C" { +#endif /***/ #include "DNA_view3d_types.h" #include "DNA_screen_types.h" @@ -77,21 +85,13 @@ //XXX #include "BIF_scrarea.h" #include "BKE_main.h" -//#include "BKE_context.h" #include "BLI_blenlib.h" #include "BLO_readfile.h" #include "DNA_scene_types.h" /***/ -#include "GPU_extensions.h" -#include "Value.h" - - - -#ifdef __cplusplus -extern "C" { -#endif //XXX #include "BSE_headerbuttons.h" +#include "BKE_context.h" #include "../../blender/windowmanager/WM_types.h" #include "../../blender/windowmanager/wm_window.h" #include "../../blender/windowmanager/wm_event_system.h" @@ -118,19 +118,10 @@ static BlendFileData *load_game_data(char *filename) return bfd; } - -/* screw it, BKE_context.h is complaining! */ -extern "C" struct wmWindow *CTX_wm_window(const bContext *C); -extern "C" struct ScrArea *CTX_wm_area(const bContext *C); -extern "C" struct ARegion *CTX_wm_region(const bContext *C); -extern "C" struct Scene *CTX_data_scene(const bContext *C); -extern "C" struct Main *CTX_data_main(const bContext *C); - extern "C" void StartKetsjiShell(struct bContext *C, int always_use_expand_framing) { /* context values */ struct wmWindow *win= CTX_wm_window(C); - struct ScrArea *area= CTX_wm_area(C); // curarea struct ARegion *ar= CTX_wm_region(C); struct Scene *scene= CTX_data_scene(C); struct Main* maggie1= CTX_data_main(C); @@ -159,8 +150,8 @@ extern "C" void StartKetsjiShell(struct bContext *C, int always_use_expand_frami do { - View3D *v3d= (View3D*) area->spacedata.first; - RegionView3D *rv3d= (RegionView3D*) ar->regiondata; + View3D *v3d= CTX_wm_view3d(C); + RegionView3D *rv3d= CTX_wm_region_view3d(C); // get some preferences SYS_SystemHandle syshandle = SYS_GetSystem(); @@ -239,13 +230,12 @@ extern "C" void StartKetsjiShell(struct bContext *C, int always_use_expand_frami scene->camera= v3d->camera; } - // some blender stuff MT_CmMatrix4x4 projmat; MT_CmMatrix4x4 viewmat; float camzoom; int i; - + for (i = 0; i < 16; i++) { float *viewmat_linear= (float*) rv3d->viewmat; @@ -257,7 +247,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, int always_use_expand_frami projmat.setElem(i, projmat_linear[i]); } - if(v3d->persp==V3D_CAMOB) { + if(rv3d->persp==V3D_CAMOB) { camzoom = (1.41421 + (rv3d->camzoom / 50.0)); camzoom *= camzoom; } @@ -348,10 +338,10 @@ extern "C" void StartKetsjiShell(struct bContext *C, int always_use_expand_frami if (exitrequested != KX_EXIT_REQUEST_QUIT_GAME) { - if (v3d->persp != V3D_CAMOB) + if (rv3d->persp != V3D_CAMOB) { ketsjiengine->EnableCameraOverride(startscenename); - ketsjiengine->SetCameraOverrideUseOrtho((v3d->persp == V3D_ORTHO)); + ketsjiengine->SetCameraOverrideUseOrtho((rv3d->persp == V3D_ORTHO)); ketsjiengine->SetCameraOverrideProjectionMatrix(projmat); ketsjiengine->SetCameraOverrideViewMatrix(viewmat); ketsjiengine->SetCameraOverrideClipping(v3d->near, v3d->far); @@ -587,7 +577,6 @@ extern "C" void StartKetsjiShell(struct bContext *C, int always_use_expand_frami } extern "C" void StartKetsjiShellSimulation(struct wmWindow *win, - struct ScrArea *area, struct ARegion *ar, char* scenename, struct Main* maggie, diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt index 3b690a21584..2874a0273cc 100644 --- a/source/gameengine/BlenderRoutines/CMakeLists.txt +++ b/source/gameengine/BlenderRoutines/CMakeLists.txt @@ -19,7 +19,8 @@ SET(INC ../../../source/blender/windowmanager ../../../source/blender ../../../source/blender/include - ../../../source/blender/makesdna + ../../../source/blender/makesdna + ../../../source/blender/makesrna ../../../source/gameengine/Rasterizer ../../../source/gameengine/GameLogic ../../../source/gameengine/Expressions diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp index aa83d17a03a..43d67e111f3 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp @@ -28,15 +28,23 @@ #include "KX_BlenderCanvas.h" #include "DNA_screen_types.h" +#include "stdio.h" #ifdef HAVE_CONFIG_H #include #endif +// temp hack, prevents pointers being offset somehow, will need to look into this later - Campbell +ARegion *m_ar; +wmWindow *m_win; + + KX_BlenderCanvas::KX_BlenderCanvas(struct wmWindow *win, ARegion *ar) : -m_win(win), -m_ar(ar) +__m_win(win), +__m_ar(ar) { + m_ar= ar; + m_win= win; } KX_BlenderCanvas::~KX_BlenderCanvas() diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h index fd41fb90f2f..41bbec7770c 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h @@ -163,8 +163,8 @@ public: private: /** Blender area the game engine is running within */ - struct ARegion* m_ar; - struct wmWindow* m_win; + struct ARegion* __m_ar; + struct wmWindow* __m_win; RAS_Rect m_area_rect; }; diff --git a/source/gameengine/BlenderRoutines/SConscript b/source/gameengine/BlenderRoutines/SConscript index c2094a15825..fc12f453d86 100644 --- a/source/gameengine/BlenderRoutines/SConscript +++ b/source/gameengine/BlenderRoutines/SConscript @@ -11,7 +11,8 @@ incs += ' #intern/ghost/include' incs += ' #intern/moto/include #source/gameengine/Ketsji #source/blender/blenlib' incs += ' #source/blender/blenkernel #source/blender' incs += ' #source/blender/blenfont #source/blender/editors/include' -incs += ' #source/blender/makesdna #source/gameengine/Rasterizer #source/gameengine/GameLogic' +incs += ' #source/blender/makesdna #source/blender/makesrna' +incs += ' #source/gameengine/Rasterizer #source/gameengine/GameLogic' incs += ' #source/gameengine/Expressions #source/gameengine/Network' incs += ' #source/gameengine/SceneGraph #source/gameengine/Physics/common' incs += ' #source/gameengine/Physics/Bullet' -- cgit v1.2.3 From 388e59a76811b11271660563a16648785e929095 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 28 Jun 2009 02:37:07 +0000 Subject: BGE Fix for no redrawing. Was caused by un-initialized engine ticrate, do_versions was working on 2.4x but isnt in 2.5 so just add a zero check when getting from the world. --- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 1a417110c08..cc0f50d9e7a 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -396,9 +396,9 @@ void KX_KetsjiEngine::StartEngine(bool clearIpo) World* world = m_scenes[0]->GetBlenderScene()->world; if (world) { - m_ticrate = world->ticrate; - m_maxLogicFrame = world->maxlogicstep; - m_maxPhysicsFrame = world->maxphystep; + m_ticrate = world->ticrate ? world->ticrate : DEFAULT_LOGIC_TIC_RATE; + m_maxLogicFrame = world->maxlogicstep ? world->maxlogicstep : 5; + m_maxPhysicsFrame = world->maxphystep ? world->maxlogicstep : 5; } else { -- cgit v1.2.3 From 7271f86be58d0705dd5abc01ac508e1775951fa8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 28 Jun 2009 02:47:49 +0000 Subject: removed un-needed hack, something weired was going on when debugging that made the pointers to these functions change after initialization. --- source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp | 10 ++-------- source/gameengine/BlenderRoutines/KX_BlenderCanvas.h | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp index 43d67e111f3..360794ceb33 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp @@ -34,17 +34,11 @@ #include #endif -// temp hack, prevents pointers being offset somehow, will need to look into this later - Campbell -ARegion *m_ar; -wmWindow *m_win; - KX_BlenderCanvas::KX_BlenderCanvas(struct wmWindow *win, ARegion *ar) : -__m_win(win), -__m_ar(ar) +m_win(win), +m_ar(ar) { - m_ar= ar; - m_win= win; } KX_BlenderCanvas::~KX_BlenderCanvas() diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h index 41bbec7770c..fd41fb90f2f 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h @@ -163,8 +163,8 @@ public: private: /** Blender area the game engine is running within */ - struct ARegion* __m_ar; - struct wmWindow* __m_win; + struct ARegion* m_ar; + struct wmWindow* m_win; RAS_Rect m_area_rect; }; -- cgit v1.2.3 From 61e30f0f001285dcbf0c7ec8ba44151544bfc8d9 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 28 Jun 2009 03:13:01 +0000 Subject: NLA SoC: Renamed NLA-Editor operators to be more in line with those in other editors --- source/blender/editors/space_nla/nla_buttons.c | 4 +- source/blender/editors/space_nla/nla_edit.c | 46 ++++++++--------- source/blender/editors/space_nla/nla_header.c | 32 ++++++------ source/blender/editors/space_nla/nla_intern.h | 30 +++++------ source/blender/editors/space_nla/nla_ops.c | 70 +++++++++++++------------- source/blender/editors/space_nla/nla_select.c | 16 +++--- 6 files changed, 99 insertions(+), 99 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index a25f741c193..003eba64ed9 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -381,10 +381,10 @@ static int nla_properties(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void NLAEDIT_OT_properties(wmOperatorType *ot) +void NLA_OT_properties(wmOperatorType *ot) { ot->name= "Properties"; - ot->idname= "NLAEDIT_OT_properties"; + ot->idname= "NLA_OT_properties"; ot->exec= nla_properties; ot->poll= ED_operator_nla_active; diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index efde2d0b537..bcf3bd4746a 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -139,11 +139,11 @@ static int nlaedit_enable_tweakmode_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void NLAEDIT_OT_tweakmode_enter (wmOperatorType *ot) +void NLA_OT_tweakmode_enter (wmOperatorType *ot) { /* identifiers */ ot->name= "Enter Tweak Mode"; - ot->idname= "NLAEDIT_OT_tweakmode_enter"; + ot->idname= "NLA_OT_tweakmode_enter"; ot->description= "Enter tweaking mode for the action referenced by the active strip."; /* api callbacks */ @@ -205,11 +205,11 @@ static int nlaedit_disable_tweakmode_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void NLAEDIT_OT_tweakmode_exit (wmOperatorType *ot) +void NLA_OT_tweakmode_exit (wmOperatorType *ot) { /* identifiers */ ot->name= "Exit Tweak Mode"; - ot->idname= "NLAEDIT_OT_tweakmode_exit"; + ot->idname= "NLA_OT_tweakmode_exit"; ot->description= "Exit tweaking mode for the action referenced by the active strip."; /* api callbacks */ @@ -239,7 +239,7 @@ static int nlaedit_add_actionclip_invoke (bContext *C, wmOperator *op, wmEvent * /* loop through Actions in Main database, adding as items in the menu */ for (act= m->action.first; act; act= act->id.next) - uiItemStringO(layout, act->id.name+2, 0, "NLAEDIT_OT_add_actionclip", "action", act->id.name); + uiItemStringO(layout, act->id.name+2, 0, "NLA_OT_add_actionclip", "action", act->id.name); uiItemS(layout); uiPupMenuEnd(C, pup); @@ -322,11 +322,11 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void NLAEDIT_OT_add_actionclip (wmOperatorType *ot) +void NLA_OT_add_actionclip (wmOperatorType *ot) { /* identifiers */ ot->name= "Add Action Strip"; - ot->idname= "NLAEDIT_OT_add_actionclip"; + ot->idname= "NLA_OT_add_actionclip"; ot->description= "Add an Action-Clip strip (i.e. an NLA Strip referencing an Action) to the active track."; /* api callbacks */ @@ -431,11 +431,11 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op) } } -void NLAEDIT_OT_add_transition (wmOperatorType *ot) +void NLA_OT_add_transition (wmOperatorType *ot) { /* identifiers */ ot->name= "Add Transition"; - ot->idname= "NLAEDIT_OT_add_transition"; + ot->idname= "NLA_OT_add_transition"; ot->description= "Add a transition strip between two adjacent selected strips."; /* api callbacks */ @@ -529,11 +529,11 @@ static int nlaedit_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_FINISHED; } -void NLAEDIT_OT_duplicate (wmOperatorType *ot) +void NLA_OT_duplicate (wmOperatorType *ot) { /* identifiers */ ot->name= "Duplicate Strips"; - ot->idname= "NLAEDIT_OT_duplicate"; + ot->idname= "NLA_OT_duplicate"; ot->description= "Duplicate selected NLA-Strips, adding the new strips in new tracks above the originals."; /* api callbacks */ @@ -592,11 +592,11 @@ static int nlaedit_delete_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void NLAEDIT_OT_delete (wmOperatorType *ot) +void NLA_OT_delete (wmOperatorType *ot) { /* identifiers */ ot->name= "Delete Strips"; - ot->idname= "NLAEDIT_OT_delete"; + ot->idname= "NLA_OT_delete"; ot->description= "Delete selected strips."; /* api callbacks */ @@ -688,11 +688,11 @@ static int nlaedit_split_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void NLAEDIT_OT_split (wmOperatorType *ot) +void NLA_OT_split (wmOperatorType *ot) { /* identifiers */ ot->name= "Split Strips"; - ot->idname= "NLAEDIT_OT_split"; + ot->idname= "NLA_OT_split"; ot->description= "Split selected strips at their midpoints."; /* api callbacks */ @@ -768,11 +768,11 @@ static int nlaedit_move_up_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void NLAEDIT_OT_move_up (wmOperatorType *ot) +void NLA_OT_move_up (wmOperatorType *ot) { /* identifiers */ ot->name= "Move Strips Up"; - ot->idname= "NLAEDIT_OT_move_up"; + ot->idname= "NLA_OT_move_up"; ot->description= "Move selected strips up a track if there's room."; /* api callbacks */ @@ -845,11 +845,11 @@ static int nlaedit_move_down_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void NLAEDIT_OT_move_down (wmOperatorType *ot) +void NLA_OT_move_down (wmOperatorType *ot) { /* identifiers */ ot->name= "Move Strips Down"; - ot->idname= "NLAEDIT_OT_move_down"; + ot->idname= "NLA_OT_move_down"; ot->description= "Move selected strips down a track if there's room."; /* api callbacks */ @@ -944,11 +944,11 @@ static int nlaedit_apply_scale_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void NLAEDIT_OT_apply_scale (wmOperatorType *ot) +void NLA_OT_apply_scale (wmOperatorType *ot) { /* identifiers */ ot->name= "Apply Scale"; - ot->idname= "NLAEDIT_OT_apply_scale"; + ot->idname= "NLA_OT_apply_scale"; ot->description= "Apply scaling of selected strips to their referenced Actions."; /* api callbacks */ @@ -1005,11 +1005,11 @@ static int nlaedit_clear_scale_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void NLAEDIT_OT_clear_scale (wmOperatorType *ot) +void NLA_OT_clear_scale (wmOperatorType *ot) { /* identifiers */ ot->name= "Clear Scale"; - ot->idname= "NLAEDIT_OT_clear_scale"; + ot->idname= "NLA_OT_clear_scale"; ot->description= "Reset scaling of selected strips."; /* api callbacks */ diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index 939e886abeb..fc6db76ba65 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -90,7 +90,7 @@ static void nla_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) RNA_pointer_create(&sc->id, &RNA_SpaceNLA, snla, &spaceptr); /* create menu */ - uiItemO(layout, NULL, ICON_MENU_PANEL, "NLAEDIT_OT_properties"); + uiItemO(layout, NULL, ICON_MENU_PANEL, "NLA_OT_properties"); uiItemS(layout); @@ -104,9 +104,9 @@ static void nla_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); if (scene->flag & SCE_NLA_EDIT_ON) - uiItemO(layout, NULL, 0, "NLAEDIT_OT_tweakmode_exit"); + uiItemO(layout, NULL, 0, "NLA_OT_tweakmode_exit"); else - uiItemO(layout, NULL, 0, "NLAEDIT_OT_tweakmode_enter"); + uiItemO(layout, NULL, 0, "NLA_OT_tweakmode_enter"); uiItemS(layout); @@ -125,13 +125,13 @@ static void nla_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) static void nla_selectmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiItemO(layout, NULL, 0, "NLAEDIT_OT_select_all_toggle"); - uiItemBooleanO(layout, "Invert All", 0, "NLAEDIT_OT_select_all_toggle", "invert", 1); + uiItemO(layout, NULL, 0, "NLA_OT_select_all_toggle"); + uiItemBooleanO(layout, "Invert All", 0, "NLA_OT_select_all_toggle", "invert", 1); uiItemS(layout); - uiItemO(layout, NULL, 0, "NLAEDIT_OT_select_border"); - uiItemBooleanO(layout, "Border Axis Range", 0, "NLAEDIT_OT_select_border", "axis_range", 1); + uiItemO(layout, NULL, 0, "NLA_OT_select_border"); + uiItemBooleanO(layout, "Border Axis Range", 0, "NLA_OT_select_border", "axis_range", 1); } static void nla_edit_transformmenu(bContext *C, uiLayout *layout, void *arg_unused) @@ -148,28 +148,28 @@ static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); - uiItemO(layout, NULL, 0, "NLAEDIT_OT_duplicate"); - uiItemO(layout, NULL, 0, "NLAEDIT_OT_split"); + uiItemO(layout, NULL, 0, "NLA_OT_duplicate"); + uiItemO(layout, NULL, 0, "NLA_OT_split"); uiItemS(layout); - uiItemO(layout, NULL, 0, "NLAEDIT_OT_delete"); + uiItemO(layout, NULL, 0, "NLA_OT_delete"); uiItemS(layout); - uiItemO(layout, NULL, 0, "NLAEDIT_OT_apply_scale"); - uiItemO(layout, NULL, 0, "NLAEDIT_OT_clear_scale"); + uiItemO(layout, NULL, 0, "NLA_OT_apply_scale"); + uiItemO(layout, NULL, 0, "NLA_OT_clear_scale"); uiItemS(layout); - uiItemO(layout, NULL, 0, "NLAEDIT_OT_move_up"); - uiItemO(layout, NULL, 0, "NLAEDIT_OT_move_down"); + uiItemO(layout, NULL, 0, "NLA_OT_move_up"); + uiItemO(layout, NULL, 0, "NLA_OT_move_down"); } static void nla_addmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiItemO(layout, NULL, 0, "NLAEDIT_OT_add_actionclip"); - uiItemO(layout, NULL, 0, "NLAEDIT_OT_add_transition"); + uiItemO(layout, NULL, 0, "NLA_OT_add_actionclip"); + uiItemO(layout, NULL, 0, "NLA_OT_add_transition"); uiItemS(layout); diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 7056139d734..f8df41d6225 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -54,7 +54,7 @@ ARegion *nla_has_buttons_region(ScrArea *sa); void nla_buttons_register(ARegionType *art); -void NLAEDIT_OT_properties(wmOperatorType *ot); +void NLA_OT_properties(wmOperatorType *ot); /* **************************************** */ /* nla_draw.c */ @@ -80,30 +80,30 @@ enum { /* --- */ -void NLAEDIT_OT_select_all_toggle(wmOperatorType *ot); -void NLAEDIT_OT_select_border(wmOperatorType *ot); -void NLAEDIT_OT_click_select(wmOperatorType *ot); +void NLA_OT_select_all_toggle(wmOperatorType *ot); +void NLA_OT_select_border(wmOperatorType *ot); +void NLA_OT_click_select(wmOperatorType *ot); /* **************************************** */ /* nla_edit.c */ -void NLAEDIT_OT_tweakmode_enter(wmOperatorType *ot); -void NLAEDIT_OT_tweakmode_exit(wmOperatorType *ot); +void NLA_OT_tweakmode_enter(wmOperatorType *ot); +void NLA_OT_tweakmode_exit(wmOperatorType *ot); /* --- */ -void NLAEDIT_OT_add_actionclip(wmOperatorType *ot); -void NLAEDIT_OT_add_transition(wmOperatorType *ot); +void NLA_OT_add_actionclip(wmOperatorType *ot); +void NLA_OT_add_transition(wmOperatorType *ot); -void NLAEDIT_OT_duplicate(wmOperatorType *ot); -void NLAEDIT_OT_delete(wmOperatorType *ot); -void NLAEDIT_OT_split(wmOperatorType *ot); +void NLA_OT_duplicate(wmOperatorType *ot); +void NLA_OT_delete(wmOperatorType *ot); +void NLA_OT_split(wmOperatorType *ot); -void NLAEDIT_OT_move_up(wmOperatorType *ot); -void NLAEDIT_OT_move_down(wmOperatorType *ot); +void NLA_OT_move_up(wmOperatorType *ot); +void NLA_OT_move_down(wmOperatorType *ot); -void NLAEDIT_OT_apply_scale(wmOperatorType *ot); -void NLAEDIT_OT_clear_scale(wmOperatorType *ot); +void NLA_OT_apply_scale(wmOperatorType *ot); +void NLA_OT_clear_scale(wmOperatorType *ot); /* **************************************** */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 35db79a0b38..d7bd894ce4d 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -126,7 +126,7 @@ short nlaedit_is_tweakmode_on (bAnimContext *ac) void nla_operatortypes(void) { /* view */ - WM_operatortype_append(NLAEDIT_OT_properties); + WM_operatortype_append(NLA_OT_properties); /* channels */ WM_operatortype_append(NLA_OT_channels_click); @@ -135,26 +135,26 @@ void nla_operatortypes(void) WM_operatortype_append(NLA_OT_delete_tracks); /* select */ - WM_operatortype_append(NLAEDIT_OT_click_select); - WM_operatortype_append(NLAEDIT_OT_select_border); - WM_operatortype_append(NLAEDIT_OT_select_all_toggle); + WM_operatortype_append(NLA_OT_click_select); + WM_operatortype_append(NLA_OT_select_border); + WM_operatortype_append(NLA_OT_select_all_toggle); /* edit */ - WM_operatortype_append(NLAEDIT_OT_tweakmode_enter); - WM_operatortype_append(NLAEDIT_OT_tweakmode_exit); + WM_operatortype_append(NLA_OT_tweakmode_enter); + WM_operatortype_append(NLA_OT_tweakmode_exit); - WM_operatortype_append(NLAEDIT_OT_add_actionclip); - WM_operatortype_append(NLAEDIT_OT_add_transition); + WM_operatortype_append(NLA_OT_add_actionclip); + WM_operatortype_append(NLA_OT_add_transition); - WM_operatortype_append(NLAEDIT_OT_duplicate); - WM_operatortype_append(NLAEDIT_OT_delete); - WM_operatortype_append(NLAEDIT_OT_split); + WM_operatortype_append(NLA_OT_duplicate); + WM_operatortype_append(NLA_OT_delete); + WM_operatortype_append(NLA_OT_split); - WM_operatortype_append(NLAEDIT_OT_move_up); - WM_operatortype_append(NLAEDIT_OT_move_down); + WM_operatortype_append(NLA_OT_move_up); + WM_operatortype_append(NLA_OT_move_down); - WM_operatortype_append(NLAEDIT_OT_apply_scale); - WM_operatortype_append(NLAEDIT_OT_clear_scale); + WM_operatortype_append(NLA_OT_apply_scale); + WM_operatortype_append(NLA_OT_clear_scale); } /* ************************** registration - keymaps **********************************/ @@ -208,19 +208,19 @@ static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) /* selection */ /* click select */ - WM_keymap_add_item(keymap, "NLAEDIT_OT_click_select", SELECTMOUSE, KM_PRESS, 0, 0); - kmi= WM_keymap_add_item(keymap, "NLAEDIT_OT_click_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "NLA_OT_click_select", SELECTMOUSE, KM_PRESS, 0, 0); + kmi= WM_keymap_add_item(keymap, "NLA_OT_click_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", 1); - kmi= WM_keymap_add_item(keymap, "NLAEDIT_OT_click_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); + kmi= WM_keymap_add_item(keymap, "NLA_OT_click_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); RNA_enum_set(kmi->ptr, "left_right", NLAEDIT_LRSEL_TEST); /* deselect all */ - WM_keymap_add_item(keymap, "NLAEDIT_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "NLAEDIT_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); + WM_keymap_add_item(keymap, "NLA_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "NLA_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); /* borderselect */ - WM_keymap_add_item(keymap, "NLAEDIT_OT_select_border", BKEY, KM_PRESS, 0, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "NLAEDIT_OT_select_border", BKEY, KM_PRESS, KM_ALT, 0)->ptr, "axis_range", 1); + WM_keymap_add_item(keymap, "NLA_OT_select_border", BKEY, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "NLA_OT_select_border", BKEY, KM_PRESS, KM_ALT, 0)->ptr, "axis_range", 1); /* editing */ @@ -228,32 +228,32 @@ static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) * - enter and exit are separate operators with the same hotkey... * This works as they use different poll()'s */ - WM_keymap_add_item(keymap, "NLAEDIT_OT_tweakmode_enter", TABKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "NLAEDIT_OT_tweakmode_exit", TABKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "NLA_OT_tweakmode_enter", TABKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "NLA_OT_tweakmode_exit", TABKEY, KM_PRESS, 0, 0); /* add strips */ - WM_keymap_add_item(keymap, "NLAEDIT_OT_add_actionclip", AKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "NLAEDIT_OT_add_transition", TKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "NLA_OT_add_actionclip", AKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "NLA_OT_add_transition", TKEY, KM_PRESS, KM_SHIFT, 0); /* duplicate */ - WM_keymap_add_item(keymap, "NLAEDIT_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "NLA_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); /* delete */ - WM_keymap_add_item(keymap, "NLAEDIT_OT_delete", XKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "NLAEDIT_OT_delete", DELKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "NLA_OT_delete", XKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "NLA_OT_delete", DELKEY, KM_PRESS, 0, 0); /* split */ - WM_keymap_add_item(keymap, "NLAEDIT_OT_split", YKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "NLA_OT_split", YKEY, KM_PRESS, 0, 0); /* move up */ - WM_keymap_add_item(keymap, "NLAEDIT_OT_move_up", PAGEUPKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "NLA_OT_move_up", PAGEUPKEY, KM_PRESS, 0, 0); /* move down */ - WM_keymap_add_item(keymap, "NLAEDIT_OT_move_down", PAGEDOWNKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "NLA_OT_move_down", PAGEDOWNKEY, KM_PRESS, 0, 0); /* apply scale */ - WM_keymap_add_item(keymap, "NLAEDIT_OT_apply_scale", AKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "NLA_OT_apply_scale", AKEY, KM_PRESS, KM_CTRL, 0); /* clear scale */ - WM_keymap_add_item(keymap, "NLAEDIT_OT_clear_scale", SKEY, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "NLA_OT_clear_scale", SKEY, KM_PRESS, KM_ALT, 0); /* transform system */ transform_keymap_for_space(wm, keymap, SPACE_NLA); @@ -267,7 +267,7 @@ void nla_keymap(wmWindowManager *wm) /* keymap for all regions */ keymap= WM_keymap_listbase(wm, "NLA Generic", SPACE_NLA, 0); - WM_keymap_add_item(keymap, "NLAEDIT_OT_properties", NKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "NLA_OT_properties", NKEY, KM_PRESS, 0, 0); /* channels */ /* Channels are not directly handled by the NLA Editor module, but are inherited from the Animation module. diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 28027d0d9cd..c238818dd1e 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -191,11 +191,11 @@ static int nlaedit_deselectall_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void NLAEDIT_OT_select_all_toggle (wmOperatorType *ot) +void NLA_OT_select_all_toggle (wmOperatorType *ot) { /* identifiers */ ot->name= "Select All"; - ot->idname= "NLAEDIT_OT_select_all_toggle"; + ot->idname= "NLA_OT_select_all_toggle"; /* api callbacks */ ot->exec= nlaedit_deselectall_exec; @@ -327,11 +327,11 @@ static int nlaedit_borderselect_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void NLAEDIT_OT_select_border(wmOperatorType *ot) +void NLA_OT_select_border(wmOperatorType *ot) { /* identifiers */ ot->name= "Border Select"; - ot->idname= "NLAEDIT_OT_select_border"; + ot->idname= "NLA_OT_select_border"; /* api callbacks */ ot->invoke= WM_border_select_invoke; @@ -434,7 +434,7 @@ static void mouse_nla_strips (bContext *C, bAnimContext *ac, int mval[2], short * now that we've found our target... */ if (scene->flag & SCE_NLA_EDIT_ON) - WM_operator_name_call(C, "NLAEDIT_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, NULL); + WM_operator_name_call(C, "NLA_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, NULL); /* for replacing selection, firstly need to clear existing selection */ if (select_mode == SELECT_REPLACE) { @@ -488,7 +488,7 @@ static void nlaedit_mselect_leftright (bContext *C, bAnimContext *ac, short left /* if currently in tweakmode, exit tweakmode first */ if (scene->flag & SCE_NLA_EDIT_ON) - WM_operator_name_call(C, "NLAEDIT_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, NULL); + WM_operator_name_call(C, "NLA_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, NULL); /* if select mode is replace, deselect all keyframes (and channels) first */ if (select_mode==SELECT_REPLACE) { @@ -589,11 +589,11 @@ static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; } -void NLAEDIT_OT_click_select (wmOperatorType *ot) +void NLA_OT_click_select (wmOperatorType *ot) { /* identifiers */ ot->name= "Mouse Select"; - ot->idname= "NLAEDIT_OT_click_select"; + ot->idname= "NLA_OT_click_select"; /* api callbacks - absolutely no exec() this yet... */ ot->invoke= nlaedit_clickselect_invoke; -- cgit v1.2.3 From aa4ed13e4a216a3464f7b9d6643c195927aea98a Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 28 Jun 2009 07:32:00 +0000 Subject: NLA SoC: NLA Mapping Cleanup While trying to fix the mapping conversions for repeat, I came across some limitations with the current (soon to be previous) mapping methods. Now the mapping conversions should work nicely for all places that use them. --- source/blender/blenkernel/BKE_nla.h | 17 ++++++- source/blender/blenkernel/intern/anim_sys.c | 2 +- source/blender/blenkernel/intern/nla.c | 59 ++++++++++++++-------- source/blender/blenkernel/nla_private.h | 3 +- source/blender/editors/animation/anim_draw.c | 16 +++--- source/blender/editors/space_action/action_edit.c | 6 +-- .../blender/editors/space_action/action_select.c | 12 ++--- source/blender/editors/space_graph/graph_edit.c | 8 +-- source/blender/editors/space_graph/graph_select.c | 8 +-- source/blender/editors/space_nla/nla_edit.c | 6 +-- source/blender/editors/space_view3d/drawarmature.c | 4 +- source/blender/editors/transform/transform.c | 16 +++--- .../editors/transform/transform_conversions.c | 14 ++--- 13 files changed, 103 insertions(+), 68 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index cc73ac02690..e2b1dd89deb 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -73,7 +73,22 @@ void BKE_nla_action_pushdown(struct AnimData *adt); short BKE_nla_tweakmode_enter(struct AnimData *adt); void BKE_nla_tweakmode_exit(struct AnimData *adt); -float BKE_nla_tweakedit_remap(struct AnimData *adt, float cframe, short invert); +/* ----------------------------- */ +/* Time Mapping */ + +/* time mapping conversion modes */ +enum { + /* convert from global time to strip time - for evaluation */ + NLATIME_CONVERT_EVAL = 0, + /* convert from global time to strip time - for editing corrections */ + // XXX old 0 invert + NLATIME_CONVERT_UNMAP, + /* convert from strip time to global time */ + // xxx old 1 invert + NLATIME_CONVERT_MAP, +} eNlaTime_ConvertModes; + +float BKE_nla_tweakedit_remap(struct AnimData *adt, float cframe, short mode); #endif diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 288867505be..4c0c30fe5c1 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -604,7 +604,7 @@ static void nlastrip_evaluate_controls (NlaStrip *strip, float ctime) { /* firstly, analytically generate values for influence and time (if applicable) */ if ((strip->flag & NLASTRIP_FLAG_USR_TIME) == 0) - strip->strip_time= nlastrip_get_frame(strip, ctime, 0); + strip->strip_time= nlastrip_get_frame(strip, ctime, NLATIME_CONVERT_EVAL); if ((strip->flag & NLASTRIP_FLAG_USR_INFLUENCE) == 0) strip->influence= nlastrip_get_influence(strip, ctime); diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 760139bee15..2b95584dc25 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -329,7 +329,7 @@ NlaStrip *add_nlastrip_to_stack (AnimData *adt, bAction *act) /* non clipped mapping for strip-time <-> global time (for Action-Clips) * invert = convert action-strip time to global time */ -static float nlastrip_get_frame_actionclip (NlaStrip *strip, float cframe, short invert) +static float nlastrip_get_frame_actionclip (NlaStrip *strip, float cframe, short mode) { float actlength, repeat, scale; @@ -347,9 +347,20 @@ static float nlastrip_get_frame_actionclip (NlaStrip *strip, float cframe, short /* reversed = play strip backwards */ if (strip->flag & NLASTRIP_FLAG_REVERSE) { - /* invert = convert action-strip time to global time */ - if (invert) - return scale*(strip->actend - cframe) + strip->start; // FIXME: this doesn't work for multiple repeats yet + // FIXME: this won't work right with Graph Editor? + if (mode == NLATIME_CONVERT_MAP) { + return strip->end - scale*(cframe - strip->actstart); + } + else if (mode == NLATIME_CONVERT_UNMAP) { + int repeatsNum = (int)((cframe - strip->start) / (actlength * scale)); + + /* this method doesn't clip the values to lie within the action range only + * - the '(repeatsNum * actlength * scale)' compensates for the fmod(...) + * - the fmod(...) works in the same way as for eval + */ + return strip->actend - (repeatsNum * actlength * scale) + - (fmod(cframe - strip->start, actlength*scale) / scale); + } else { if (IS_EQ(cframe, strip->end) && IS_EQ(strip->repeat, ((int)strip->repeat))) { /* this case prevents the motion snapping back to the first frame at the end of the strip @@ -367,10 +378,20 @@ static float nlastrip_get_frame_actionclip (NlaStrip *strip, float cframe, short } } else { - /* invert = convert action-strip time to global time */ - if (invert) - return scale*(cframe - strip->actstart) + strip->start; // FIXME: this doesn't work for mutiple repeats yet - else { + if (mode == NLATIME_CONVERT_MAP) { + return strip->start + scale*(cframe - strip->actstart); + } + else if (mode == NLATIME_CONVERT_UNMAP) { + int repeatsNum = (int)((cframe - strip->start) / (actlength * scale)); + + /* this method doesn't clip the values to lie within the action range only + * - the '(repeatsNum * actlength * scale)' compensates for the fmod(...) + * - the fmod(...) works in the same way as for eval + */ + return strip->actstart + (repeatsNum * actlength * scale) + + (fmod(cframe - strip->start, actlength*scale) / scale); + } + else /* if (mode == NLATIME_CONVERT_EVAL) */{ if (IS_EQ(cframe, strip->end) && IS_EQ(strip->repeat, ((int)strip->repeat))) { /* this case prevents the motion snapping back to the first frame at the end of the strip * by catching the case where repeats is a whole number, which means that the end of the strip @@ -391,7 +412,7 @@ static float nlastrip_get_frame_actionclip (NlaStrip *strip, float cframe, short /* non clipped mapping for strip-time <-> global time (for Transitions) * invert = convert action-strip time to global time */ -static float nlastrip_get_frame_transition (NlaStrip *strip, float cframe, short invert) +static float nlastrip_get_frame_transition (NlaStrip *strip, float cframe, short mode) { float length; @@ -400,15 +421,13 @@ static float nlastrip_get_frame_transition (NlaStrip *strip, float cframe, short /* reversed = play strip backwards */ if (strip->flag & NLASTRIP_FLAG_REVERSE) { - /* invert = convert within-strip-time to global time */ - if (invert) + if (mode == NLATIME_CONVERT_MAP) return strip->end - (length * cframe); else return (strip->end - cframe) / length; } else { - /* invert = convert within-strip-time to global time */ - if (invert) + if (mode == NLATIME_CONVERT_MAP) return (length * cframe) + strip->start; else return (cframe - strip->start) / length; @@ -416,31 +435,31 @@ static float nlastrip_get_frame_transition (NlaStrip *strip, float cframe, short } /* non clipped mapping for strip-time <-> global time - * invert = convert action-strip time to global time + * mode = eNlaTime_ConvertModes[] -> NLATIME_CONVERT_* * * only secure for 'internal' (i.e. within AnimSys evaluation) operations, * but should not be directly relied on for stuff which interacts with editors */ -float nlastrip_get_frame (NlaStrip *strip, float cframe, short invert) +float nlastrip_get_frame (NlaStrip *strip, float cframe, short mode) { switch (strip->type) { case NLASTRIP_TYPE_TRANSITION: /* transition */ - return nlastrip_get_frame_transition(strip, cframe, invert); + return nlastrip_get_frame_transition(strip, cframe, mode); case NLASTRIP_TYPE_CLIP: /* action-clip (default) */ default: - return nlastrip_get_frame_actionclip(strip, cframe, invert); + return nlastrip_get_frame_actionclip(strip, cframe, mode); } } /* Non clipped mapping for strip-time <-> global time - * invert = convert strip-time to global time + * mode = eNlaTime_ConvertModesp[] -> NLATIME_CONVERT_* * * Public API method - perform this mapping using the given AnimData block * and perform any necessary sanity checks on the value */ -float BKE_nla_tweakedit_remap (AnimData *adt, float cframe, short invert) +float BKE_nla_tweakedit_remap (AnimData *adt, float cframe, short mode) { NlaStrip *strip; @@ -469,7 +488,7 @@ float BKE_nla_tweakedit_remap (AnimData *adt, float cframe, short invert) return cframe; /* perform the correction now... */ - return nlastrip_get_frame(strip, cframe, invert); + return nlastrip_get_frame(strip, cframe, mode); } /* *************************************************** */ diff --git a/source/blender/blenkernel/nla_private.h b/source/blender/blenkernel/nla_private.h index af886fb7de8..1514a79f03b 100644 --- a/source/blender/blenkernel/nla_private.h +++ b/source/blender/blenkernel/nla_private.h @@ -73,6 +73,7 @@ typedef struct NlaEvalChannel { /* --------------- NLA Functions (not to be used as a proper API) ----------------------- */ /* convert from strip time <-> global time */ -float nlastrip_get_frame(NlaStrip *strip, float cframe, short invert); +float nlastrip_get_frame(NlaStrip *strip, float cframe, short mode); + #endif // NLA_PRIVATE diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 6d079fe148a..f7702379645 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -270,8 +270,8 @@ void ANIM_nla_mapping_draw(gla2DDrawInfo *di, AnimData *adt, short restore) gla2DGetMap(di, &stored); map= stored; - map.xmin= BKE_nla_tweakedit_remap(adt, map.xmin, 0); - map.xmax= BKE_nla_tweakedit_remap(adt, map.xmax, 0); + map.xmin= BKE_nla_tweakedit_remap(adt, map.xmin, NLATIME_CONVERT_MAP); + map.xmax= BKE_nla_tweakedit_remap(adt, map.xmax, NLATIME_CONVERT_MAP); if (map.xmin == map.xmax) map.xmax += 1.0f; gla2DSetMap(di, &map); @@ -289,11 +289,11 @@ static short bezt_nlamapping_restore(BeztEditData *bed, BezTriple *bezt) /* adjust BezTriple handles only if allowed to */ if (only_keys == 0) { - bezt->vec[0][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[0][0], 0); - bezt->vec[2][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[2][0], 0); + bezt->vec[0][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[0][0], NLATIME_CONVERT_UNMAP); + bezt->vec[2][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[2][0], NLATIME_CONVERT_UNMAP); } - bezt->vec[1][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[1][0], 0); + bezt->vec[1][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[1][0], NLATIME_CONVERT_UNMAP); return 0; } @@ -307,11 +307,11 @@ static short bezt_nlamapping_apply(BeztEditData *bed, BezTriple *bezt) /* adjust BezTriple handles only if allowed to */ if (only_keys == 0) { - bezt->vec[0][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[0][0], 1); - bezt->vec[2][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[2][0], 1); + bezt->vec[0][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[0][0], NLATIME_CONVERT_MAP); + bezt->vec[2][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[2][0], NLATIME_CONVERT_MAP); } - bezt->vec[1][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[1][0], 1); + bezt->vec[1][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[1][0], NLATIME_CONVERT_MAP); return 0; } diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 61dbc41e7c8..dd351c92cf2 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -121,8 +121,8 @@ static void get_keyframe_extents (bAnimContext *ac, float *min, float *max) calc_fcurve_range(fcu, &tmin, &tmax); if (adt) { - tmin= BKE_nla_tweakedit_remap(adt, tmin, 1); - tmax= BKE_nla_tweakedit_remap(adt, tmax, 1); + tmin= BKE_nla_tweakedit_remap(adt, tmin, NLATIME_CONVERT_MAP); + tmax= BKE_nla_tweakedit_remap(adt, tmax, NLATIME_CONVERT_MAP); } /* try to set cur using these values, if they're more extreme than previously set values */ @@ -406,7 +406,7 @@ static void insert_action_keys(bAnimContext *ac, short mode) /* adjust current frame for NLA-scaling */ if (adt) - cfra= BKE_nla_tweakedit_remap(adt, (float)CFRA, 0); + cfra= BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); else cfra= (float)CFRA; diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 451d120ff9b..d45e32dd3bb 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -255,8 +255,8 @@ static void borderselect_action (bAnimContext *ac, rcti rect, short mode, short if (ELEM(mode, ACTKEYS_BORDERSEL_FRAMERANGE, ACTKEYS_BORDERSEL_ALLKEYS)) { /* if channel is mapped in NLA, apply correction */ if (adt) { - bed.f1= BKE_nla_tweakedit_remap(adt, rectf.xmin, 0); - bed.f2= BKE_nla_tweakedit_remap(adt, rectf.xmax, 0); + bed.f1= BKE_nla_tweakedit_remap(adt, rectf.xmin, NLATIME_CONVERT_UNMAP); + bed.f2= BKE_nla_tweakedit_remap(adt, rectf.xmax, NLATIME_CONVERT_UNMAP); } else { bed.f1= rectf.xmin; @@ -504,7 +504,7 @@ static void columnselect_action_keys (bAnimContext *ac, short mode) for (ce= bed.list.first; ce; ce= ce->next) { /* set frame for validation callback to refer to */ if (adt) - bed.f1= BKE_nla_tweakedit_remap(adt, ce->cfra, 0); + bed.f1= BKE_nla_tweakedit_remap(adt, ce->cfra, NLATIME_CONVERT_UNMAP); else bed.f1= ce->cfra; @@ -707,7 +707,7 @@ static void actkeys_mselect_column(bAnimContext *ac, short select_mode, float se /* set frame for validation callback to refer to */ if (adt) - bed.f1= BKE_nla_tweakedit_remap(adt, selx, 0); + bed.f1= BKE_nla_tweakedit_remap(adt, selx, NLATIME_CONVERT_UNMAP); else bed.f1= selx; @@ -779,8 +779,8 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short select_mode, /* apply NLA-scaling correction? */ if (adt) { - xmin= BKE_nla_tweakedit_remap(adt, rectf.xmin, 0); - xmax= BKE_nla_tweakedit_remap(adt, rectf.xmax, 0); + xmin= BKE_nla_tweakedit_remap(adt, rectf.xmin, NLATIME_CONVERT_UNMAP); + xmax= BKE_nla_tweakedit_remap(adt, rectf.xmax, NLATIME_CONVERT_UNMAP); } else { xmin= rectf.xmin; diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index fc04308077c..e38c24ed223 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -123,8 +123,8 @@ static void get_graph_keyframe_extents (bAnimContext *ac, float *xmin, float *xm calc_fcurve_bounds(fcu, &txmin, &txmax, &tymin, &tymax); if (adt) { - txmin= BKE_nla_tweakedit_remap(adt, txmin, 1); - txmax= BKE_nla_tweakedit_remap(adt, txmax, 1); + txmin= BKE_nla_tweakedit_remap(adt, txmin, NLATIME_CONVERT_MAP); + txmax= BKE_nla_tweakedit_remap(adt, txmax, NLATIME_CONVERT_MAP); } /* try to set cur using these values, if they're more extreme than previously set values */ @@ -288,7 +288,7 @@ static void create_ghost_curves (bAnimContext *ac, int start, int end) /* use the sampling callback at 1-frame intervals from start to end frames */ for (cfra= start; cfra <= end; cfra++, fpt++) { - float cfrae= BKE_nla_tweakedit_remap(adt, cfra, 0); + float cfrae= BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP); fpt->vec[0]= cfrae; fpt->vec[1]= fcurve_samplingcb_evalcurve(fcu, NULL, cfrae); @@ -427,7 +427,7 @@ static int graphkeys_click_insert_exec (bContext *C, wmOperator *op) /* apply inverse NLA-mapping to frame to get correct time in un-scaled action */ adt= ANIM_nla_mapping_get(&ac, ale); - frame= BKE_nla_tweakedit_remap(adt, frame, 0); + frame= BKE_nla_tweakedit_remap(adt, frame, NLATIME_CONVERT_UNMAP); /* insert keyframe on the specified frame + value */ insert_vert_fcurve((FCurve *)ale->data, frame, val, 0); diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index d600396fd77..afe66ed179e 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -238,8 +238,8 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho if (mode != BEZT_OK_VALUERANGE) { /* if channel is mapped in NLA, apply correction */ if (adt) { - bed.f1= BKE_nla_tweakedit_remap(adt, rectf.xmin, 0); - bed.f2= BKE_nla_tweakedit_remap(adt, rectf.xmax, 0); + bed.f1= BKE_nla_tweakedit_remap(adt, rectf.xmin, NLATIME_CONVERT_UNMAP); + bed.f2= BKE_nla_tweakedit_remap(adt, rectf.xmax, NLATIME_CONVERT_UNMAP); } else { bed.f1= rectf.xmin; @@ -459,7 +459,7 @@ static void columnselect_graph_keys (bAnimContext *ac, short mode) for (ce= bed.list.first; ce; ce= ce->next) { /* set frame for validation callback to refer to */ if (ale) - bed.f1= BKE_nla_tweakedit_remap(adt, ce->cfra, 0); + bed.f1= BKE_nla_tweakedit_remap(adt, ce->cfra, NLATIME_CONVERT_UNMAP); else bed.f1= ce->cfra; @@ -841,7 +841,7 @@ static void graphkeys_mselect_column (bAnimContext *ac, int mval[2], short selec /* set frame for validation callback to refer to */ if (adt) - bed.f1= BKE_nla_tweakedit_remap(adt, selx, 0); + bed.f1= BKE_nla_tweakedit_remap(adt, selx, NLATIME_CONVERT_UNMAP); else bed.f1= selx; diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index bcf3bd4746a..6d82e3d4be2 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -870,9 +870,9 @@ static short bezt_apply_nlamapping (BeztEditData *bed, BezTriple *bezt) NlaStrip *strip= (NlaStrip *)bed->data; /* adjust all the times */ - bezt->vec[0][0]= nlastrip_get_frame(strip, bezt->vec[0][0], 1); - bezt->vec[1][0]= nlastrip_get_frame(strip, bezt->vec[1][0], 1); - bezt->vec[2][0]= nlastrip_get_frame(strip, bezt->vec[2][0], 1); + bezt->vec[0][0]= nlastrip_get_frame(strip, bezt->vec[0][0], NLATIME_CONVERT_MAP); + bezt->vec[1][0]= nlastrip_get_frame(strip, bezt->vec[1][0], NLATIME_CONVERT_MAP); + bezt->vec[2][0]= nlastrip_get_frame(strip, bezt->vec[2][0], NLATIME_CONVERT_MAP); /* nothing to return or else we exit */ return 0; diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index a4332ea1709..0827bcaa9ae 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -2434,7 +2434,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base /* only within action range */ if (actframe+ctime >= start && actframe+ctime <= end) { - CFRA= (int)BKE_nla_tweakedit_remap(adt, actframe+ctime, 1); + CFRA= (int)BKE_nla_tweakedit_remap(adt, actframe+ctime, NLATIME_CONVERT_MAP); if (CFRA != cfrao) { BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL); @@ -2449,7 +2449,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base /* only within action range */ if ((actframe-ctime >= start) && (actframe-ctime <= end)) { - CFRA= (int)BKE_nla_tweakedit_remap(adt, actframe-ctime, 1); + CFRA= (int)BKE_nla_tweakedit_remap(adt, actframe-ctime, NLATIME_CONVERT_MAP); if (CFRA != cfrao) { BKE_animsys_evaluate_animdata(&ob->id, adt, (float)CFRA, ADT_RECALC_ALL); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index ded6edbbb0e..9d8371afd61 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -4365,7 +4365,7 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, AnimData *adt, sho /* convert frame to nla-action time (if needed) */ if (adt) - val= BKE_nla_tweakedit_remap(adt, *(td->val), 1); + val= BKE_nla_tweakedit_remap(adt, *(td->val), NLATIME_CONVERT_MAP); else val= *(td->val); @@ -4377,7 +4377,7 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, AnimData *adt, sho /* convert frame out of nla-action time */ if (adt) - *(td->val)= BKE_nla_tweakedit_remap(adt, val, 0); + *(td->val)= BKE_nla_tweakedit_remap(adt, val, NLATIME_CONVERT_UNMAP); else *(td->val)= val; } @@ -4387,7 +4387,7 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, AnimData *adt, sho /* convert frame to nla-action time (if needed) */ if (adt) - val= BKE_nla_tweakedit_remap(adt, *(td->val), 1); + val= BKE_nla_tweakedit_remap(adt, *(td->val), NLATIME_CONVERT_MAP); else val= *(td->val); @@ -4397,7 +4397,7 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, AnimData *adt, sho /* convert frame out of nla-action time */ if (adt) - *(td->val)= BKE_nla_tweakedit_remap(adt, val, 0); + *(td->val)= BKE_nla_tweakedit_remap(adt, val, NLATIME_CONVERT_UNMAP); else *(td->val)= val; } @@ -4487,9 +4487,9 @@ static void applyTimeTranslate(TransInfo *t, float sval) deltax= (float)( floor(deltax + 0.5f) ); } - val = BKE_nla_tweakedit_remap(adt, td->ival, 1); + val = BKE_nla_tweakedit_remap(adt, td->ival, NLATIME_CONVERT_MAP); val += deltax; - *(td->val) = BKE_nla_tweakedit_remap(adt, val, 0); + *(td->val) = BKE_nla_tweakedit_remap(adt, val, NLATIME_CONVERT_UNMAP); } else { deltax = val = t->values[0]; @@ -4614,7 +4614,7 @@ static void applyTimeSlide(TransInfo *t, float sval) /* apply NLA-mapping to necessary values */ if (adt) - cval= BKE_nla_tweakedit_remap(adt, cval, 0); + cval= BKE_nla_tweakedit_remap(adt, cval, NLATIME_CONVERT_UNMAP); /* only apply to data if in range */ if ((sval > minx) && (sval < maxx)) { @@ -4726,7 +4726,7 @@ static void applyTimeScale(TransInfo *t) { /* check if any need to apply nla-mapping */ if (adt) - startx= BKE_nla_tweakedit_remap(adt, startx, 0); + startx= BKE_nla_tweakedit_remap(adt, startx, NLATIME_CONVERT_UNMAP); /* now, calculate the new value */ *(td->val) = td->ival - startx; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index d23f8fdfe40..b2afaac23de 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -3080,7 +3080,7 @@ static void createTransActionData(bContext *C, TransInfo *t) * higher scaling ratios, but is faster than converting all points) */ if (adt) - cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, 0); + cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); else cfra = (float)CFRA; @@ -3134,7 +3134,7 @@ static void createTransActionData(bContext *C, TransInfo *t) * higher scaling ratios, but is faster than converting all points) */ if (adt) - cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, 0); + cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); else cfra = (float)CFRA; @@ -3180,13 +3180,13 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, AnimData *adt, */ if (adt) { - td2d->loc[0] = BKE_nla_tweakedit_remap(adt, loc[0], 0); + td2d->loc[0] = BKE_nla_tweakedit_remap(adt, loc[0], NLATIME_CONVERT_UNMAP); td2d->loc[1] = loc[1]; td2d->loc[2] = 0.0f; td2d->loc2d = loc; td->loc = td2d->loc; - td->center[0] = BKE_nla_tweakedit_remap(adt, cent[0], 0); + td->center[0] = BKE_nla_tweakedit_remap(adt, cent[0], NLATIME_CONVERT_UNMAP); td->center[1] = cent[1]; td->center[2] = 0.0f; @@ -3277,7 +3277,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) * higher scaling ratios, but is faster than converting all points) */ if (adt) - cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, 0); + cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); else cfra = (float)CFRA; @@ -3336,7 +3336,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) * higher scaling ratios, but is faster than converting all points) */ if (adt) - cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, 0); + cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); else cfra = (float)CFRA; @@ -3622,7 +3622,7 @@ void flushTransGraphData(TransInfo *t) /* we need to unapply the nla-scaling from the time in some situations */ if (adt) - td2d->loc2d[0]= BKE_nla_tweakedit_remap(adt, td2d->loc[0], 0); + td2d->loc2d[0]= BKE_nla_tweakedit_remap(adt, td2d->loc[0], NLATIME_CONVERT_UNMAP); else td2d->loc2d[0]= td2d->loc[0]; -- cgit v1.2.3 From 6998a0f47b673591f8561cda35d50e93979de32c Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 28 Jun 2009 09:35:37 +0000 Subject: 2.5 Bugfixes: - Preview Icon for render result crashed, there was still need for a scene pointer to be passed on. - Added quick fix for preventing shaded drawmode to call render while rendering is in progress. It crashes badly. Rendering while UI is alive is still in probation, most UI stuff will probably get blocked, with exception from inspecting buttons and using the image window. --- source/blender/blenkernel/intern/displist.c | 36 ++++++++++++++-------- source/blender/blenkernel/intern/image.c | 2 +- source/blender/editors/interface/interface_icons.c | 17 +++++++--- 3 files changed, 36 insertions(+), 19 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 736165a8a98..cdf4b90cee1 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -315,13 +315,19 @@ static void init_fastshade_shadeinput(Render *re) static Render *fastshade_get_render(Scene *scene) { - Render *re= RE_GetRender("_Shade View_"); - if(re==NULL) { - re= RE_NewRender("_Shade View_"); - - RE_Database_Baking(re, scene, 0, 0); /* 0= no faces */ + /* XXX ugly global still, but we can't do preview while rendering */ + if(G.rendering==0) { + + Render *re= RE_GetRender("_Shade View_"); + if(re==NULL) { + re= RE_NewRender("_Shade View_"); + + RE_Database_Baking(re, scene, 0, 0); /* 0= no faces */ + } + return re; } - return re; + + return NULL; } /* called on file reading */ @@ -611,18 +617,20 @@ static void mesh_create_shadedColors(Render *re, Object *ob, int onlyForMesh, un void shadeMeshMCol(Scene *scene, Object *ob, Mesh *me) { + Render *re= fastshade_get_render(scene); int a; char *cp; unsigned int *mcol= (unsigned int*)me->mcol; - Render *re= fastshade_get_render(scene); - mesh_create_shadedColors(re, ob, 1, &mcol, NULL); - me->mcol= (MCol*)mcol; + if(re) { + mesh_create_shadedColors(re, ob, 1, &mcol, NULL); + me->mcol= (MCol*)mcol; - /* swap bytes */ - for(cp= (char *)me->mcol, a= 4*me->totface; a>0; a--, cp+=4) { - SWAP(char, cp[0], cp[3]); - SWAP(char, cp[1], cp[2]); + /* swap bytes */ + for(cp= (char *)me->mcol, a= 4*me->totface; a>0; a--, cp+=4) { + SWAP(char, cp[0], cp[3]); + SWAP(char, cp[1], cp[2]); + } } } @@ -641,6 +649,8 @@ void shadeDispList(Scene *scene, Base *base) int a, need_orco; re= fastshade_get_render(scene); + if(re==NULL) + return; dl = find_displist(&ob->disp, DL_VERTCOL); if (dl) { diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 8eef9984c92..6b231cfc702 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1812,7 +1812,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser) Render *re= NULL; RenderResult *rr= NULL; - if(iuser->scene) { + if(iuser && iuser->scene) { re= RE_GetRender(iuser->scene->id.name); rr= RE_GetResult(re); } diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 4d8ec5996be..315b8693905 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -728,21 +728,28 @@ static void icon_create_mipmap(struct PreviewImage* prv_img, int miplevel) } /* create single icon from jpg, png etc. */ -static void icon_from_image(Image *img, int miplevel) +static void icon_from_image(Scene *scene, Image *img, int miplevel) { + ImBuf *ibuf= NULL; + ImageUser iuser; + PreviewImage *pi; unsigned int pr_size; short image_loaded = 0; - struct ImBuf* ibuf=NULL; - PreviewImage* pi; /* img->ok is zero when Image cannot load */ if (img==NULL || img->ok==0) return; + /* setup dummy image user */ + memset(&iuser, 0, sizeof(ImageUser)); + iuser.ok= iuser.framenr= 1; + iuser.scene= scene; + /* elubie: this needs to be changed: here image is always loaded if not already there. Very expensive for large images. Need to find a way to only get existing ibuf */ - ibuf = BKE_image_get_ibuf(img, NULL); + + ibuf = BKE_image_get_ibuf(img, &iuser); if(ibuf==NULL || ibuf->rect==NULL) { return; } @@ -788,7 +795,7 @@ static void icon_set_image(Scene *scene, ID *id, PreviewImage* prv_img, int mipl /* no drawing (see last parameter doDraw, just calculate preview image - hopefully small enough to be fast */ if (GS(id->name) == ID_IM) - icon_from_image((struct Image*)id, miplevel); + icon_from_image(scene, (struct Image*)id, miplevel); else { /* create the preview rect */ icon_create_mipmap(prv_img, miplevel); -- cgit v1.2.3 From 6b9f3b5f5c8d918585e01461a6202ae3df2df621 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 28 Jun 2009 11:22:26 +0000 Subject: BGE Python API Remove the last of the odd C++/python wrapper code from http://www.python.org/doc/PyCPP.html (~1998) * Use python subclasses rather then having fake subclassing through get/set attributes calling parent types. * PyObject getset arrays are created while initializing the types, converted from our own attribute arrays. This way python deals with subclasses and we dont have to define getattro or setattro functions for each type. * GameObjects and Scenes no longer have attribute access to properties. only dictionary style access - ob['prop'] * remove each class's get/set/dir functions. * remove isA() methods, can use PyObject_TypeCheck() in C and issubclass() in python. * remove Parents[] array for each C++ class, was only used for isA() and wasnt correct in quite a few cases. * remove PyTypeObject that was being passed as the last argument to each class (the parent classes too). TODO - * Light and VertexProxy need to be converted to using attributes. * memory for getset arrays is never freed, not that bad since its will only allocates once. --- source/gameengine/Converter/BL_ActionActuator.cpp | 33 +--- source/gameengine/Converter/BL_ActionActuator.h | 9 +- .../Converter/BL_ShapeActionActuator.cpp | 33 +--- .../gameengine/Converter/BL_ShapeActionActuator.h | 9 +- source/gameengine/Expressions/ListValue.cpp | 35 +--- source/gameengine/Expressions/ListValue.h | 4 +- source/gameengine/Expressions/PyObjectPlus.cpp | 194 ++++----------------- source/gameengine/Expressions/PyObjectPlus.h | 75 +------- source/gameengine/Expressions/Value.cpp | 99 ++--------- source/gameengine/Expressions/Value.h | 14 +- .../gameengine/GameLogic/SCA_2DFilterActuator.cpp | 43 ++--- source/gameengine/GameLogic/SCA_2DFilterActuator.h | 13 +- source/gameengine/GameLogic/SCA_ANDController.cpp | 34 ++-- source/gameengine/GameLogic/SCA_ANDController.h | 10 +- source/gameengine/GameLogic/SCA_ActuatorSensor.cpp | 38 ++-- source/gameengine/GameLogic/SCA_ActuatorSensor.h | 7 +- source/gameengine/GameLogic/SCA_AlwaysSensor.cpp | 34 ++-- source/gameengine/GameLogic/SCA_AlwaysSensor.h | 12 +- source/gameengine/GameLogic/SCA_DelaySensor.cpp | 39 ++--- source/gameengine/GameLogic/SCA_DelaySensor.h | 7 +- .../GameLogic/SCA_ExpressionController.cpp | 5 +- .../GameLogic/SCA_ExpressionController.h | 11 +- source/gameengine/GameLogic/SCA_IActuator.cpp | 5 +- source/gameengine/GameLogic/SCA_IActuator.h | 3 +- source/gameengine/GameLogic/SCA_IController.cpp | 40 ++--- source/gameengine/GameLogic/SCA_IController.h | 6 +- source/gameengine/GameLogic/SCA_ILogicBrick.cpp | 43 ++--- source/gameengine/GameLogic/SCA_ILogicBrick.h | 6 +- source/gameengine/GameLogic/SCA_IObject.cpp | 39 ++--- source/gameengine/GameLogic/SCA_IObject.h | 7 +- source/gameengine/GameLogic/SCA_ISensor.cpp | 37 ++-- source/gameengine/GameLogic/SCA_ISensor.h | 7 +- source/gameengine/GameLogic/SCA_JoystickSensor.cpp | 42 ++--- source/gameengine/GameLogic/SCA_JoystickSensor.h | 7 +- source/gameengine/GameLogic/SCA_KeyboardSensor.cpp | 40 ++--- source/gameengine/GameLogic/SCA_KeyboardSensor.h | 7 +- source/gameengine/GameLogic/SCA_MouseSensor.cpp | 40 ++--- source/gameengine/GameLogic/SCA_MouseSensor.h | 7 +- source/gameengine/GameLogic/SCA_NANDController.cpp | 34 ++-- source/gameengine/GameLogic/SCA_NANDController.h | 6 +- source/gameengine/GameLogic/SCA_NORController.cpp | 34 ++-- source/gameengine/GameLogic/SCA_NORController.h | 10 +- source/gameengine/GameLogic/SCA_ORController.cpp | 35 ++-- source/gameengine/GameLogic/SCA_ORController.h | 9 +- .../gameengine/GameLogic/SCA_PropertyActuator.cpp | 37 ++-- source/gameengine/GameLogic/SCA_PropertyActuator.h | 8 +- source/gameengine/GameLogic/SCA_PropertySensor.cpp | 39 ++--- source/gameengine/GameLogic/SCA_PropertySensor.h | 7 +- .../gameengine/GameLogic/SCA_PythonController.cpp | 46 ++--- source/gameengine/GameLogic/SCA_PythonController.h | 6 +- source/gameengine/GameLogic/SCA_RandomActuator.cpp | 39 ++--- source/gameengine/GameLogic/SCA_RandomActuator.h | 7 +- source/gameengine/GameLogic/SCA_RandomSensor.cpp | 39 ++--- source/gameengine/GameLogic/SCA_RandomSensor.h | 7 +- source/gameengine/GameLogic/SCA_XNORController.cpp | 34 ++-- source/gameengine/GameLogic/SCA_XNORController.h | 5 +- source/gameengine/GameLogic/SCA_XORController.cpp | 34 ++-- source/gameengine/GameLogic/SCA_XORController.h | 10 +- source/gameengine/Ketsji/BL_Shader.cpp | 36 ++-- source/gameengine/Ketsji/BL_Shader.h | 4 +- .../Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp | 40 ++--- .../Ketsji/KXNetwork/KX_NetworkMessageActuator.h | 7 +- .../Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp | 40 ++--- .../Ketsji/KXNetwork/KX_NetworkMessageSensor.h | 7 +- source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 42 ++--- source/gameengine/Ketsji/KX_BlenderMaterial.h | 7 +- source/gameengine/Ketsji/KX_CDActuator.cpp | 46 ++--- source/gameengine/Ketsji/KX_CDActuator.h | 7 +- source/gameengine/Ketsji/KX_Camera.cpp | 43 +---- source/gameengine/Ketsji/KX_Camera.h | 7 +- source/gameengine/Ketsji/KX_CameraActuator.cpp | 38 ++-- source/gameengine/Ketsji/KX_CameraActuator.h | 8 +- source/gameengine/Ketsji/KX_ConstraintActuator.cpp | 41 ++--- source/gameengine/Ketsji/KX_ConstraintActuator.h | 7 +- source/gameengine/Ketsji/KX_ConstraintWrapper.cpp | 41 ++--- source/gameengine/Ketsji/KX_ConstraintWrapper.h | 5 +- source/gameengine/Ketsji/KX_GameActuator.cpp | 46 ++--- source/gameengine/Ketsji/KX_GameActuator.h | 7 +- source/gameengine/Ketsji/KX_GameObject.cpp | 153 ++-------------- source/gameengine/Ketsji/KX_GameObject.h | 15 +- source/gameengine/Ketsji/KX_IpoActuator.cpp | 38 ++-- source/gameengine/Ketsji/KX_IpoActuator.h | 7 +- source/gameengine/Ketsji/KX_Light.cpp | 44 ++--- source/gameengine/Ketsji/KX_Light.h | 6 +- source/gameengine/Ketsji/KX_MeshProxy.cpp | 38 ++-- source/gameengine/Ketsji/KX_MeshProxy.h | 3 - source/gameengine/Ketsji/KX_MouseFocusSensor.cpp | 36 ++-- source/gameengine/Ketsji/KX_MouseFocusSensor.h | 5 +- source/gameengine/Ketsji/KX_NearSensor.cpp | 49 ++---- source/gameengine/Ketsji/KX_NearSensor.h | 9 +- source/gameengine/Ketsji/KX_ObjectActuator.cpp | 40 ++--- source/gameengine/Ketsji/KX_ObjectActuator.h | 7 +- source/gameengine/Ketsji/KX_ParentActuator.cpp | 38 ++-- source/gameengine/Ketsji/KX_ParentActuator.h | 7 +- .../gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp | 50 ++---- source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h | 6 +- source/gameengine/Ketsji/KX_PolyProxy.cpp | 28 ++- source/gameengine/Ketsji/KX_PolyProxy.h | 2 - source/gameengine/Ketsji/KX_PolygonMaterial.cpp | 37 ++-- source/gameengine/Ketsji/KX_PolygonMaterial.h | 5 +- source/gameengine/Ketsji/KX_PyMath.h | 12 +- source/gameengine/Ketsji/KX_PythonInitTypes.cpp | 190 ++++++++++++-------- source/gameengine/Ketsji/KX_RadarSensor.cpp | 43 ++--- source/gameengine/Ketsji/KX_RadarSensor.h | 7 +- source/gameengine/Ketsji/KX_RaySensor.cpp | 40 ++--- source/gameengine/Ketsji/KX_RaySensor.h | 8 +- .../gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp | 40 ++--- .../gameengine/Ketsji/KX_SCA_AddObjectActuator.h | 7 +- .../gameengine/Ketsji/KX_SCA_DynamicActuator.cpp | 46 ++--- source/gameengine/Ketsji/KX_SCA_DynamicActuator.h | 8 +- .../gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp | 38 ++-- .../gameengine/Ketsji/KX_SCA_EndObjectActuator.h | 6 +- .../Ketsji/KX_SCA_ReplaceMeshActuator.cpp | 46 ++--- .../gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h | 9 +- source/gameengine/Ketsji/KX_Scene.cpp | 87 ++------- source/gameengine/Ketsji/KX_Scene.h | 8 - source/gameengine/Ketsji/KX_SceneActuator.cpp | 47 ++--- source/gameengine/Ketsji/KX_SceneActuator.h | 7 +- source/gameengine/Ketsji/KX_SoundActuator.cpp | 42 ++--- source/gameengine/Ketsji/KX_SoundActuator.h | 7 +- source/gameengine/Ketsji/KX_StateActuator.cpp | 44 ++--- source/gameengine/Ketsji/KX_StateActuator.h | 9 +- source/gameengine/Ketsji/KX_TouchSensor.cpp | 39 ++--- source/gameengine/Ketsji/KX_TouchSensor.h | 7 +- source/gameengine/Ketsji/KX_TrackToActuator.cpp | 46 ++--- source/gameengine/Ketsji/KX_TrackToActuator.h | 5 +- source/gameengine/Ketsji/KX_VehicleWrapper.cpp | 39 ++--- source/gameengine/Ketsji/KX_VehicleWrapper.h | 5 +- source/gameengine/Ketsji/KX_VertexProxy.cpp | 89 +++++----- source/gameengine/Ketsji/KX_VertexProxy.h | 3 - source/gameengine/Ketsji/KX_VisibilityActuator.cpp | 46 ++--- source/gameengine/Ketsji/KX_VisibilityActuator.h | 8 +- 132 files changed, 951 insertions(+), 2729 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index ce4311f57bf..1787909b064 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -1006,19 +1006,17 @@ PyTypeObject BL_ActionActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; -PyParentObject BL_ActionActuator::Parents[] = { - &BL_ActionActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL -}; PyMethodDef BL_ActionActuator::Methods[] = { //Deprecated -----> @@ -1065,19 +1063,6 @@ PyAttributeDef BL_ActionActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* BL_ActionActuator::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IActuator); -} - -PyObject* BL_ActionActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int BL_ActionActuator::py_setattro(PyObject *attr, PyObject* value) { - py_setattro_up(SCA_IActuator); -} - - PyObject* BL_ActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { BL_ActionActuator* self= static_cast(self_v); diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h index 422b16bb3ec..e328ce126ca 100644 --- a/source/gameengine/Converter/BL_ActionActuator.h +++ b/source/gameengine/Converter/BL_ActionActuator.h @@ -49,9 +49,8 @@ public: short blendin, short priority, short end_reset, - float stride, - PyTypeObject* T=&Type) - : SCA_IActuator(gameobj,T), + float stride) + : SCA_IActuator(gameobj), m_lastpos(0, 0, 0), m_blendframe(0), @@ -113,10 +112,6 @@ public: KX_PYMETHOD_DOC(BL_ActionActuator,setChannel); - virtual PyObject* py_getattro(PyObject* attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject* attr, PyObject* value); - static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index 7aa8714de3a..b92e94b6e04 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -428,19 +428,17 @@ PyTypeObject BL_ShapeActionActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; -PyParentObject BL_ShapeActionActuator::Parents[] = { - &BL_ShapeActionActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL -}; PyMethodDef BL_ShapeActionActuator::Methods[] = { {"setAction", (PyCFunction) BL_ShapeActionActuator::sPySetAction, METH_VARARGS, (PY_METHODCHAR)SetAction_doc}, @@ -480,19 +478,6 @@ PyAttributeDef BL_ShapeActionActuator::Attributes[] = { { NULL } //Sentinel }; - -PyObject* BL_ShapeActionActuator::py_getattro(PyObject* attr) { - py_getattro_up(SCA_IActuator); -} - -PyObject* BL_ShapeActionActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int BL_ShapeActionActuator::py_setattro(PyObject *attr, PyObject* value) { - py_setattro_up(SCA_IActuator); -} - /* setStart */ const char BL_ShapeActionActuator::GetAction_doc[] = "getAction()\n" diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.h b/source/gameengine/Converter/BL_ShapeActionActuator.h index d268eef6d23..890fe3f9de9 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.h +++ b/source/gameengine/Converter/BL_ShapeActionActuator.h @@ -50,9 +50,8 @@ public: short playtype, short blendin, short priority, - float stride, - PyTypeObject* T=&Type) - : SCA_IActuator(gameobj,T), + float stride) + : SCA_IActuator(gameobj), m_lastpos(0, 0, 0), m_blendframe(0), @@ -106,10 +105,6 @@ public: KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetType); KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetType); - virtual PyObject* py_getattro(PyObject* attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject* attr, PyObject* value); - static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 59344ddb7b7..4cad4728521 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -289,25 +289,17 @@ PyTypeObject CListValue::Type = { 0, /*tp_hash*/ 0, /*tp_call */ 0, - py_base_getattro, - py_base_setattro, + NULL, //py_base_getattro, + NULL, //py_base_setattro, 0, - Py_TPFLAGS_DEFAULT, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject CListValue::Parents[] = { - &CListValue::Type, - &CValue::Type, - NULL + Methods, + 0, + 0, + &CValue::Type }; - - - PyMethodDef CListValue::Methods[] = { /* List style access */ {"append", (PyCFunction)CListValue::sPyappend,METH_O}, @@ -329,21 +321,12 @@ PyAttributeDef CListValue::Attributes[] = { { NULL } //Sentinel }; -PyObject* CListValue::py_getattro(PyObject* attr) { - py_getattro_up(CValue); -} - -PyObject* CListValue::py_getattro_dict() { - py_getattro_dict_up(CValue); -} - - ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// -CListValue::CListValue(PyTypeObject *T ) -: CPropValue(T) +CListValue::CListValue() +: CPropValue() { m_bReleaseContents=true; } diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h index 68e900e25e0..98e6f216f11 100644 --- a/source/gameengine/Expressions/ListValue.h +++ b/source/gameengine/Expressions/ListValue.h @@ -24,7 +24,7 @@ class CListValue : public CPropValue //PLUGIN_DECLARE_SERIAL (CListValue,CValue) public: - CListValue(PyTypeObject *T = &Type); + CListValue(); virtual ~CListValue(); void AddConfigurationData(CValue* menuvalue); @@ -60,8 +60,6 @@ public: bool CheckEqual(CValue* first,CValue* second); - virtual PyObject* py_getattro(PyObject* attr); - virtual PyObject* py_getattro_dict(); virtual PyObject* py_repr(void) { PyObject *py_proxy= this->GetProxy(); PyObject *py_list= PySequence_List(py_proxy); diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 2d4cc612aef..552e839d2b8 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -75,10 +75,15 @@ PyTypeObject PyObjectPlus::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + NULL // no subtype }; @@ -105,9 +110,8 @@ void PyObjectPlus::py_base_dealloc(PyObject *self) // python wrapper PyObject_DEL( self ); }; -PyObjectPlus::PyObjectPlus(PyTypeObject *T) : SG_QList() // constructor +PyObjectPlus::PyObjectPlus() : SG_QList() // constructor { - MT_assert(T != NULL); m_proxy= NULL; }; @@ -115,77 +119,20 @@ PyObjectPlus::PyObjectPlus(PyTypeObject *T) : SG_QList() // constructor * PyObjectPlus Methods -- Every class, even the abstract one should have a Methods ------------------------------*/ PyMethodDef PyObjectPlus::Methods[] = { - {"isA", (PyCFunction) sPyisA, METH_O}, {NULL, NULL} /* Sentinel */ }; +#define attr_invalid (&(PyObjectPlus::Attributes[0])) PyAttributeDef PyObjectPlus::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("invalid", PyObjectPlus, pyattr_get_invalid), {NULL} //Sentinel }; -PyObject* PyObjectPlus::pyattr_get_invalid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) -{ - Py_RETURN_FALSE; -} - -/*------------------------------ - * PyObjectPlus Parents -- Every class, even the abstract one should have parents -------------------------------*/ -PyParentObject PyObjectPlus::Parents[] = {&PyObjectPlus::Type, NULL}; - -/*------------------------------ - * PyObjectPlus attributes -- attributes -------------------------------*/ - -/* This should be the entry in Type since it takes the C++ class from PyObjectPlus_Proxy */ -PyObject *PyObjectPlus::py_base_getattro(PyObject * self, PyObject *attr) -{ - PyObjectPlus *self_plus= BGE_PROXY_REF(self); - if(self_plus==NULL) { - if(!strcmp("invalid", PyString_AsString(attr))) { - Py_RETURN_TRUE; - } - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); - return NULL; - } - - PyObject *ret= self_plus->py_getattro(attr); - - /* Attribute not found, was this a __dict__ lookup?, otherwise set an error if none is set */ - if(ret==NULL) { - char *attr_str= PyString_AsString(attr); - - if (strcmp(attr_str, "__dict__")==0) - { - /* the error string will probably not - * be set but just incase clear it */ - PyErr_Clear(); - ret= self_plus->py_getattro_dict(); - } - else if (!PyErr_Occurred()) { - /* We looked for an attribute but it wasnt found - * since py_getattro didnt set the error, set it here */ - PyErr_Format(PyExc_AttributeError, "'%s' object has no attribute '%s'", self->ob_type->tp_name, attr_str); - } - } - return ret; -} -/* This should be the entry in Type since it takes the C++ class from PyObjectPlus_Proxy */ -int PyObjectPlus::py_base_setattro(PyObject *self, PyObject *attr, PyObject *value) -{ - PyObjectPlus *self_plus= BGE_PROXY_REF(self); - if(self_plus==NULL) { - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); - return -1; - } - - if (value==NULL) - return self_plus->py_delattro(attr); - - return self_plus->py_setattro(attr, value); +PyObject* PyObjectPlus::pyattr_get_invalid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) +{ + return PyBool_FromLong(self_v ? 1:0); } PyObject *PyObjectPlus::py_base_repr(PyObject *self) // This should be the entry in Type. @@ -200,42 +147,19 @@ PyObject *PyObjectPlus::py_base_repr(PyObject *self) // This should be the ent return self_plus->py_repr(); } -PyObject *PyObjectPlus::py_getattro(PyObject* attr) +/* note, this is called as a python 'getset, where the PyAttributeDef is the closure */ +PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef *attrdef) { - PyObject *descr = PyDict_GetItem(Type.tp_dict, attr); \ - if (descr == NULL) { - return NULL; /* py_base_getattro sets the error, this way we can avoid setting the error at many levels */ - } else { - /* Copied from py_getattro_up */ - if (PyCObject_Check(descr)) { - return py_get_attrdef((void *)this, (const PyAttributeDef*)PyCObject_AsVoidPtr(descr)); - } else if (descr->ob_type->tp_descr_get) { - return PyCFunction_New(((PyMethodDescrObject *)descr)->d_method, this->m_proxy); - } else { - return NULL; - } - /* end py_getattro_up copy */ - } -} - -PyObject* PyObjectPlus::py_getattro_dict() { - return py_getattr_dict(NULL, Type.tp_dict); -} + void *self= (void *)(BGE_PROXY_REF(self_py)); + if(self==NULL) { + if(attrdef == attr_invalid) + Py_RETURN_TRUE; // dont bother running the function -int PyObjectPlus::py_delattro(PyObject* attr) -{ - PyErr_SetString(PyExc_AttributeError, "attribute cant be deleted"); - return 1; -} + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + return NULL; + } -int PyObjectPlus::py_setattro(PyObject *attr, PyObject* value) -{ - PyErr_SetString(PyExc_AttributeError, "attribute cant be set"); - return PY_SET_ATTR_MISSING; -} -PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef) -{ if (attrdef->m_type == KX_PYATTRIBUTE_TYPE_DUMMY) { // fake attribute, ignore @@ -355,8 +279,15 @@ PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef } } -int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyObject *value) +/* note, this is called as a python getset */ +int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAttributeDef *attrdef) { + void *self= (void *)(BGE_PROXY_REF(self_py)); + if(self==NULL) { + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + return PY_SET_ATTR_FAIL; + } + void *undoBuffer = NULL; void *sourceBuffer = NULL; size_t bufferSize = 0; @@ -834,48 +765,6 @@ PyObject *PyObjectPlus::py_repr(void) return NULL; } -/*------------------------------ - * PyObjectPlus isA -- the isA functions -------------------------------*/ -bool PyObjectPlus::isA(PyTypeObject *T) // if called with a Type, use "typename" -{ - int i; - PyParentObject P; - PyParentObject *Ps = GetParents(); - - for (P = Ps[i=0]; P != NULL; P = Ps[i++]) - if (P==T) - return true; - - return false; -} - - -bool PyObjectPlus::isA(const char *mytypename) // check typename of each parent -{ - int i; - PyParentObject P; - PyParentObject *Ps = GetParents(); - - for (P = Ps[i=0]; P != NULL; P = Ps[i++]) - if (strcmp(P->tp_name, mytypename)==0) - return true; - - return false; -} - -PyObject *PyObjectPlus::PyisA(PyObject *value) // Python wrapper for isA -{ - if (PyType_Check(value)) { - return PyBool_FromLong(isA((PyTypeObject *)value)); - } else if (PyString_Check(value)) { - return PyBool_FromLong(isA(PyString_AsString(value))); - } - PyErr_SetString(PyExc_TypeError, "object.isA(value): expected a type or a string"); - return NULL; -} - - void PyObjectPlus::ProcessReplica() { /* Clear the proxy, will be created again if needed with GetProxy() @@ -900,27 +789,6 @@ void PyObjectPlus::InvalidateProxy() // check typename of each parent } } -/* Utility function called by the macro py_getattro_up() - * for getting ob.__dict__() values from our PyObject - * this is used by python for doing dir() on an object, so its good - * if we return a list of attributes and methods. - * - * Other then making dir() useful the value returned from __dict__() is not useful - * since every value is a Py_None - * */ -PyObject *py_getattr_dict(PyObject *pydict, PyObject *tp_dict) -{ - if(pydict==NULL) { /* incase calling __dict__ on the parent of this object raised an error */ - PyErr_Clear(); - pydict = PyDict_New(); - } - - PyDict_Update(pydict, tp_dict); - return pydict; -} - - - PyObject *PyObjectPlus::GetProxy_Ext(PyObjectPlus *self, PyTypeObject *tp) { if (self->m_proxy==NULL) diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 3b5eebe9893..0fe3e9f083d 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -155,41 +155,10 @@ typedef struct { static PyTypeObject Type; \ static PyMethodDef Methods[]; \ static PyAttributeDef Attributes[]; \ - static PyParentObject Parents[]; \ virtual PyTypeObject *GetType(void) {return &Type;}; \ - virtual PyParentObject *GetParents(void) {return Parents;} \ virtual PyObject *GetProxy() {return GetProxy_Ext(this, &Type);}; \ virtual PyObject *NewProxy(bool py_owns) {return NewProxy_Ext(this, &Type, py_owns);}; \ - - - - // This defines the py_getattro_up macro - // which allows attribute and method calls - // to be properly passed up the hierarchy. - // - // Note, PyDict_GetItem() WONT set an exception! - // let the py_base_getattro function do this. - -#define py_getattro_up(Parent) \ - \ - PyObject *descr = PyDict_GetItem(Type.tp_dict, attr); \ - \ - if(descr) { \ - if (PyCObject_Check(descr)) { \ - return py_get_attrdef((void *)this, (const PyAttributeDef*)PyCObject_AsVoidPtr(descr)); \ - } else if (descr->ob_type->tp_descr_get) { \ - return PyCFunction_New(((PyMethodDescrObject *)descr)->d_method, this->m_proxy); \ - } else { \ - return NULL; \ - } \ - } else { \ - return Parent::py_getattro(attr); \ - } - -#define py_getattro_dict_up(Parent) \ - return py_getattr_dict(Parent::py_getattro_dict(), Type.tp_dict); - /* * nonzero values are an error for setattr * however because of the nested lookups we need to know if the errors @@ -201,29 +170,6 @@ typedef struct { #define PY_SET_ATTR_MISSING -1 #define PY_SET_ATTR_SUCCESS 0 -#define py_setattro_up(Parent) \ - PyObject *descr = PyDict_GetItem(Type.tp_dict, attr); \ - \ - if(descr) { \ - if (PyCObject_Check(descr)) { \ - const PyAttributeDef* attrdef= reinterpret_cast(PyCObject_AsVoidPtr(descr)); \ - if (attrdef->m_access == KX_PYATTRIBUTE_RO) { \ - PyErr_Format(PyExc_AttributeError, "\"%s\" is read only", PyString_AsString(attr)); \ - return PY_SET_ATTR_FAIL; \ - } \ - else { \ - return py_set_attrdef((void *)this, attrdef, value); \ - } \ - } else { \ - PyErr_Format(PyExc_AttributeError, "\"%s\" cannot be set", PyString_AsString(attr)); \ - return PY_SET_ATTR_FAIL; \ - } \ - } else { \ - PyErr_Clear(); \ - return Parent::py_setattro(attr, value); \ - } - - /** * These macros are helpfull when embedding Python routines. The second * macro is one that also requires a documentation string @@ -493,7 +439,7 @@ class PyObjectPlus : public SG_QList Py_Header; // Always start with Py_Header public: - PyObjectPlus(PyTypeObject *T); + PyObjectPlus(); PyObject *m_proxy; /* actually a PyObjectPlus_Proxy */ @@ -501,30 +447,17 @@ public: /* These static functions are referenced by ALL PyObjectPlus_Proxy types * they take the C++ reference from the PyObjectPlus_Proxy and call - * its own virtual py_getattro, py_setattro etc. functions. + * its own virtual py_repr, py_base_dealloc ,etc. functions. */ static void py_base_dealloc(PyObject *self); - static PyObject* py_base_getattro(PyObject * self, PyObject *attr); - static int py_base_setattro(PyObject *self, PyObject *attr, PyObject *value); static PyObject* py_base_repr(PyObject *self); /* These are all virtual python methods that are defined in each class * Our own fake subclassing calls these on each class, then calls the parent */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_delattro(PyObject *attr); - virtual int py_setattro(PyObject *attr, PyObject *value); virtual PyObject* py_repr(void); - static PyObject* py_get_attrdef(void *self, const PyAttributeDef *attrdef); - static int py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyObject *value); - - /* isA() methods, shonky replacement for pythons issubclass() - * which we cant use because we have our own subclass system */ - bool isA(PyTypeObject *T); - bool isA(const char *mytypename); - - KX_PYMETHOD_O(PyObjectPlus,isA); + static PyObject* py_get_attrdef(PyObject *self_py, const PyAttributeDef *attrdef); + static int py_set_attrdef(PyObject *self_py, PyObject *value, const PyAttributeDef *attrdef); /* Kindof dumb, always returns True, the false case is checked for, before this function gets accessed */ static PyObject* pyattr_get_invalid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 61dabff510b..45eb15ecd08 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -54,15 +54,15 @@ PyTypeObject CValue::Type = { py_base_repr, 0, 0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject CValue::Parents[] = { - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &PyObjectPlus::Type }; PyMethodDef CValue::Methods[] = { @@ -100,8 +100,8 @@ std::vector gRefList; //int gRefCountValue; #endif -CValue::CValue(PyTypeObject *T) - : PyObjectPlus(T), +CValue::CValue() + : PyObjectPlus(), #else CValue::CValue() : @@ -553,30 +553,6 @@ PyAttributeDef CValue::Attributes[] = { { NULL } //Sentinel }; - -PyObject* CValue::py_getattro(PyObject *attr) -{ - char *attr_str= PyString_AsString(attr); - CValue* resultattr = GetProperty(attr_str); - if (resultattr) - { - /* only show the wanting here because python inspects for __class__ and KX_MeshProxy uses CValues name attr */ - ShowDeprecationWarning("val = ob.attr", "val = ob['attr']"); - - PyObject* pyconvert = resultattr->ConvertValueToPython(); - - if (pyconvert) - return pyconvert; - else - return resultattr->GetProxy(); - } - py_getattro_up(PyObjectPlus); -} - -PyObject* CValue::py_getattro_dict() { - py_getattro_dict_up(PyObjectPlus); -} - PyObject * CValue::pyattr_get_name(void * self_v, const KX_PYATTRIBUTE_DEF * attrdef) { CValue * self = static_cast (self_v); return PyString_FromString(self->GetName()); @@ -637,7 +613,7 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) } else if (BGE_PROXY_CHECK_TYPE(pyobj)) /* Note, dont let these get assigned to GameObject props, must check elsewhere */ { - if (BGE_PROXY_REF(pyobj) && (BGE_PROXY_REF(pyobj))->isA(&CValue::Type)) + if (BGE_PROXY_REF(pyobj) && PyObject_TypeCheck(BGE_PROXY_REF(pyobj), &CValue::Type)) { vallie = (static_cast(BGE_PROXY_REF(pyobj)))->AddRef(); } else { @@ -656,57 +632,6 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) } -int CValue::py_delattro(PyObject *attr) -{ - ShowDeprecationWarning("del ob.attr", "del ob['attr']"); - - char *attr_str= PyString_AsString(attr); - if (RemoveProperty(attr_str)) - return 0; - - PyErr_Format(PyExc_AttributeError, "attribute \"%s\" dosnt exist", attr_str); - return PY_SET_ATTR_MISSING; -} - -int CValue::py_setattro(PyObject *attr, PyObject* pyobj) -{ - ShowDeprecationWarning("ob.attr = val", "ob['attr'] = val"); - - char *attr_str= PyString_AsString(attr); - CValue* oldprop = GetProperty(attr_str); - CValue* vallie; - - /* Dissallow python to assign GameObjects, Scenes etc as values */ - if ((BGE_PROXY_CHECK_TYPE(pyobj)==0) && (vallie = ConvertPythonToValue(pyobj, "cvalue.attr = value: "))) - { - if (oldprop) - oldprop->SetValue(vallie); - else - SetProperty(attr_str, vallie); - - vallie->Release(); - } - else { - // ConvertPythonToValue sets the error message - // must return missing so KX_GameObect knows this - // attribute was not a function or bult in attribute, - // - // CValue attributes override internal attributes - // so if it exists as a CValue attribute already, - // assume your trying to set it to a differnt CValue attribute - // otherwise return PY_SET_ATTR_MISSING so children - // classes know they can set it without conflict - - if (GetProperty(attr_str)) - return PY_SET_ATTR_COERCE_FAIL; /* failed to set an existing attribute */ - else - return PY_SET_ATTR_MISSING; /* allow the KX_GameObject dict to set */ - } - - //PyObjectPlus::py_setattro(attr,value); - return PY_SET_ATTR_SUCCESS; -}; - PyObject* CValue::ConvertKeysToPython( void ) { PyObject *pylist = PyList_New( 0 ); diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 29ef19b46c9..9da75b96e78 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -215,26 +215,18 @@ public: // Construction / Destruction #ifndef NO_EXP_PYTHON_EMBEDDING - CValue(PyTypeObject *T = &Type); + CValue(); //static PyObject* PyMake(PyObject*,PyObject*); virtual PyObject *py_repr(void) { return PyString_FromString((const char*)GetText()); } - - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); virtual PyObject* ConvertValueToPython() { return NULL; } virtual CValue* ConvertPythonToValue(PyObject* pyobj, const char *error_prefix); - - - virtual int py_delattro(PyObject *attr); - virtual int py_setattro(PyObject *attr, PyObject* value); static PyObject * pyattr_get_name(void * self, const KX_PYATTRIBUTE_DEF * attrdef); @@ -417,8 +409,8 @@ class CPropValue : public CValue public: #ifndef NO_EXP_PYTHON_EMBEDDING - CPropValue(PyTypeObject* T=&Type) : - CValue(T), + CPropValue() : + CValue(), #else CPropValue() : #endif //NO_EXP_PYTHON_EMBEDDING diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index caed85b9938..8e54043a1a2 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -42,9 +42,8 @@ SCA_2DFilterActuator::SCA_2DFilterActuator( float float_arg, int int_arg, RAS_IRasterizer* rasterizer, - RAS_IRenderTools* rendertools, - PyTypeObject* T) - : SCA_IActuator(gameobj, T), + RAS_IRenderTools* rendertools) + : SCA_IActuator(gameobj), m_type(type), m_disableMotionBlur(flag), m_float_arg(float_arg), @@ -125,22 +124,17 @@ PyTypeObject SCA_2DFilterActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - - -PyParentObject SCA_2DFilterActuator::Parents[] = { - &SCA_2DFilterActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; - PyMethodDef SCA_2DFilterActuator::Methods[] = { /* add python functions to deal with m_msg... */ {NULL,NULL} @@ -154,18 +148,3 @@ PyAttributeDef SCA_2DFilterActuator::Attributes[] = { KX_PYATTRIBUTE_FLOAT_RW("value", 0.0, 100.0, SCA_2DFilterActuator, m_float_arg), { NULL } //Sentinel }; - -PyObject* SCA_2DFilterActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* SCA_2DFilterActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int SCA_2DFilterActuator::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(SCA_IActuator); -} - diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.h b/source/gameengine/GameLogic/SCA_2DFilterActuator.h index 13b9997a010..c357c4f3e37 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.h +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.h @@ -56,23 +56,12 @@ public: float float_arg, int int_arg, RAS_IRasterizer* rasterizer, - RAS_IRenderTools* rendertools, - PyTypeObject* T=&Type - ); + RAS_IRenderTools* rendertools); void SetShaderText(const char *text); virtual ~SCA_2DFilterActuator(); virtual bool Update(); virtual CValue* GetReplica(); - - /* --------------------------------------------------------------------- */ - /* Python interface ---------------------------------------------------- */ - /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); - }; #endif diff --git a/source/gameengine/GameLogic/SCA_ANDController.cpp b/source/gameengine/GameLogic/SCA_ANDController.cpp index 87f7c612e7c..fc2f9cdf27d 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.cpp +++ b/source/gameengine/GameLogic/SCA_ANDController.cpp @@ -42,10 +42,9 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ -SCA_ANDController::SCA_ANDController(SCA_IObject* gameobj, - PyTypeObject* T) +SCA_ANDController::SCA_ANDController(SCA_IObject* gameobj) : - SCA_IController(gameobj,T) + SCA_IController(gameobj) { } @@ -117,18 +116,15 @@ PyTypeObject SCA_ANDController::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_ANDController::Parents[] = { - &SCA_ANDController::Type, - &SCA_IController::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IController::Type }; PyMethodDef SCA_ANDController::Methods[] = { @@ -139,12 +135,4 @@ PyAttributeDef SCA_ANDController::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_ANDController::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IController); -} - -PyObject* SCA_ANDController::py_getattro_dict() { - py_getattro_dict_up(SCA_IController); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_ANDController.h b/source/gameengine/GameLogic/SCA_ANDController.h index 9a359d57cb4..cb16d7fca01 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.h +++ b/source/gameengine/GameLogic/SCA_ANDController.h @@ -39,18 +39,10 @@ class SCA_ANDController : public SCA_IController Py_Header; //virtual void Trigger(class SCA_LogicManager* logicmgr); public: - SCA_ANDController(SCA_IObject* gameobj,PyTypeObject* T=&Type); + SCA_ANDController(SCA_IObject* gameobj); virtual ~SCA_ANDController(); virtual CValue* GetReplica(); virtual void Trigger(SCA_LogicManager* logicmgr); - - /* --------------------------------------------------------------------- */ - /* Python interface ---------------------------------------------------- */ - /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - }; #endif //__KX_ANDCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index 4dad65c5a25..b6a9471f23c 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -40,9 +40,8 @@ SCA_ActuatorSensor::SCA_ActuatorSensor(SCA_EventManager* eventmgr, SCA_IObject* gameobj, - const STR_String& actname, - PyTypeObject* T ) - : SCA_ISensor(gameobj,eventmgr,T), + const STR_String& actname) + : SCA_ISensor(gameobj,eventmgr), m_checkactname(actname) { m_actuator = GetParent()->FindActuator(m_checkactname); @@ -139,18 +138,15 @@ PyTypeObject SCA_ActuatorSensor::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_ActuatorSensor::Parents[] = { - &SCA_ActuatorSensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_ISensor::Type }; PyMethodDef SCA_ActuatorSensor::Methods[] = { @@ -166,18 +162,6 @@ PyAttributeDef SCA_ActuatorSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_ActuatorSensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_ActuatorSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int SCA_ActuatorSensor::py_setattro(PyObject *attr, PyObject *value) { - py_setattro_up(SCA_ISensor); -} - int SCA_ActuatorSensor::CheckActuator(void *self, const PyAttributeDef*) { SCA_ActuatorSensor* sensor = reinterpret_cast(self); diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.h b/source/gameengine/GameLogic/SCA_ActuatorSensor.h index 6655e08dc70..cf8e735cad4 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.h +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.h @@ -46,8 +46,7 @@ class SCA_ActuatorSensor : public SCA_ISensor public: SCA_ActuatorSensor(class SCA_EventManager* eventmgr, SCA_IObject* gameobj, - const STR_String& actname, - PyTypeObject* T=&Type ); + const STR_String& actname); virtual ~SCA_ActuatorSensor(); virtual CValue* GetReplica(); @@ -61,10 +60,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - /* 3. setProperty */ KX_PYMETHOD_DOC_VARARGS(SCA_ActuatorSensor,SetActuator); /* 4. getProperty */ diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp index ff02680f191..a14db7debd9 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp @@ -48,9 +48,8 @@ /* ------------------------------------------------------------------------- */ SCA_AlwaysSensor::SCA_AlwaysSensor(class SCA_EventManager* eventmgr, - SCA_IObject* gameobj, - PyTypeObject* T) - : SCA_ISensor(gameobj,eventmgr, T) + SCA_IObject* gameobj) + : SCA_ISensor(gameobj,eventmgr) { //SetDrawColor(255,0,0); Init(); @@ -122,18 +121,15 @@ PyTypeObject SCA_AlwaysSensor::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_AlwaysSensor::Parents[] = { - &SCA_AlwaysSensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_ISensor::Type }; PyMethodDef SCA_AlwaysSensor::Methods[] = { @@ -144,12 +140,4 @@ PyAttributeDef SCA_AlwaysSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_AlwaysSensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_AlwaysSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.h b/source/gameengine/GameLogic/SCA_AlwaysSensor.h index 0f85a641ef1..d58e05564d1 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.h +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.h @@ -39,22 +39,12 @@ class SCA_AlwaysSensor : public SCA_ISensor bool m_alwaysresult; public: SCA_AlwaysSensor(class SCA_EventManager* eventmgr, - SCA_IObject* gameobj, - PyTypeObject* T =&Type); + SCA_IObject* gameobj); virtual ~SCA_AlwaysSensor(); virtual CValue* GetReplica(); virtual bool Evaluate(); virtual bool IsPositiveTrigger(); virtual void Init(); - - - /* --------------------------------------------------------------------- */ - /* Python interface ---------------------------------------------------- */ - /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - }; #endif //__KX_ALWAYSSENSOR diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp index dcdae0b4e75..afc9028d95d 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.cpp +++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp @@ -51,9 +51,8 @@ SCA_DelaySensor::SCA_DelaySensor(class SCA_EventManager* eventmgr, SCA_IObject* gameobj, int delay, int duration, - bool repeat, - PyTypeObject* T) - : SCA_ISensor(gameobj,eventmgr, T), + bool repeat) + : SCA_ISensor(gameobj,eventmgr), m_repeat(repeat), m_delay(delay), m_duration(duration) @@ -148,18 +147,15 @@ PyTypeObject SCA_DelaySensor::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_DelaySensor::Parents[] = { - &SCA_DelaySensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_ISensor::Type }; PyMethodDef SCA_DelaySensor::Methods[] = { @@ -183,19 +179,6 @@ PyAttributeDef SCA_DelaySensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_DelaySensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_DelaySensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int SCA_DelaySensor::py_setattro(PyObject *attr, PyObject *value) { - py_setattro_up(SCA_ISensor); -} - - const char SCA_DelaySensor::SetDelay_doc[] = "setDelay(delay)\n" "\t- delay: length of the initial OFF period as number of frame\n" diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.h b/source/gameengine/GameLogic/SCA_DelaySensor.h index 5ccb33f8a16..8270e8959b7 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.h +++ b/source/gameengine/GameLogic/SCA_DelaySensor.h @@ -47,8 +47,7 @@ public: SCA_IObject* gameobj, int delay, int duration, - bool repeat, - PyTypeObject* T =&Type); + bool repeat); virtual ~SCA_DelaySensor(); virtual CValue* GetReplica(); virtual bool Evaluate(); @@ -59,10 +58,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); /* setProperty */ KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetDelay); diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.cpp b/source/gameengine/GameLogic/SCA_ExpressionController.cpp index 8e044b89c71..60969300474 100644 --- a/source/gameengine/GameLogic/SCA_ExpressionController.cpp +++ b/source/gameengine/GameLogic/SCA_ExpressionController.cpp @@ -46,9 +46,8 @@ /* ------------------------------------------------------------------------- */ SCA_ExpressionController::SCA_ExpressionController(SCA_IObject* gameobj, - const STR_String& exprtext, - PyTypeObject* T) - :SCA_IController(gameobj,T), + const STR_String& exprtext) + :SCA_IController(gameobj), m_exprText(exprtext), m_exprCache(NULL) { diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.h b/source/gameengine/GameLogic/SCA_ExpressionController.h index 6a34d7b2dff..705f6dfc415 100644 --- a/source/gameengine/GameLogic/SCA_ExpressionController.h +++ b/source/gameengine/GameLogic/SCA_ExpressionController.h @@ -42,8 +42,7 @@ class SCA_ExpressionController : public SCA_IController public: SCA_ExpressionController(SCA_IObject* gameobj, - const STR_String& exprtext, - PyTypeObject* T=&Type ); + const STR_String& exprtext); virtual ~SCA_ExpressionController(); virtual CValue* GetReplica(); @@ -54,14 +53,6 @@ public: * so that self references are removed before the controller itself is released */ virtual void Delete(); - - /* --------------------------------------------------------------------- */ - /* Python interface ---------------------------------------------------- */ - /* --------------------------------------------------------------------- */ - -// virtual PyObject* py_getattro(PyObject *attr); -// virtual PyObject* py_getattro_dict(); - }; #endif //__KX_EXPRESSIONCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_IActuator.cpp b/source/gameengine/GameLogic/SCA_IActuator.cpp index be7c2651686..0fda75590c1 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.cpp +++ b/source/gameengine/GameLogic/SCA_IActuator.cpp @@ -34,9 +34,8 @@ using namespace std; -SCA_IActuator::SCA_IActuator(SCA_IObject* gameobj, - PyTypeObject* T) : - SCA_ILogicBrick(gameobj,T), +SCA_IActuator::SCA_IActuator(SCA_IObject* gameobj) : + SCA_ILogicBrick(gameobj), m_links(0), m_posevent(false), m_negevent(false) diff --git a/source/gameengine/GameLogic/SCA_IActuator.h b/source/gameengine/GameLogic/SCA_IActuator.h index 27afcbc386b..13c718ee837 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.h +++ b/source/gameengine/GameLogic/SCA_IActuator.h @@ -61,8 +61,7 @@ public: * This class also inherits the default copy constructors */ - SCA_IActuator(SCA_IObject* gameobj, - PyTypeObject* T =&Type); + SCA_IActuator(SCA_IObject* gameobj); /** * UnlinkObject(...) diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp index f2c3c83a2d9..7880daf0eb4 100644 --- a/source/gameengine/GameLogic/SCA_IController.cpp +++ b/source/gameengine/GameLogic/SCA_IController.cpp @@ -37,10 +37,9 @@ #include #endif -SCA_IController::SCA_IController(SCA_IObject* gameobj, - PyTypeObject* T) +SCA_IController::SCA_IController(SCA_IObject* gameobj) : - SCA_ILogicBrick(gameobj,T), + SCA_ILogicBrick(gameobj), m_statemask(0), m_justActivated(false) { @@ -217,16 +216,15 @@ PyTypeObject SCA_IController::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_IController::Parents[] = { - &SCA_IController::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_ILogicBrick::Type }; PyMethodDef SCA_IController::Methods[] = { @@ -248,22 +246,6 @@ PyAttributeDef SCA_IController::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_IController::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_ILogicBrick); -} - -PyObject* SCA_IController::py_getattro_dict() { - py_getattro_dict_up(SCA_ILogicBrick); -} - -int SCA_IController::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_ILogicBrick); -} - - - PyObject* SCA_IController::PyGetActuators() { ShowDeprecationWarning("getActuators()", "the actuators property"); diff --git a/source/gameengine/GameLogic/SCA_IController.h b/source/gameengine/GameLogic/SCA_IController.h index a52c57ab3ed..523878bee26 100644 --- a/source/gameengine/GameLogic/SCA_IController.h +++ b/source/gameengine/GameLogic/SCA_IController.h @@ -47,7 +47,7 @@ protected: bool m_justActivated; bool m_bookmark; public: - SCA_IController(SCA_IObject* gameobj,PyTypeObject* T); + SCA_IController(SCA_IObject* gameobj); virtual ~SCA_IController(); virtual void Trigger(class SCA_LogicManager* logicmgr)=0; void LinkToSensor(SCA_ISensor* sensor); @@ -98,10 +98,6 @@ public: } } - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - KX_PYMETHOD_NOARGS(SCA_IController,GetSensors); KX_PYMETHOD_NOARGS(SCA_IController,GetActuators); KX_PYMETHOD_O(SCA_IController,GetSensor); diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 2dc80f54568..d747daec2b4 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -35,10 +35,9 @@ SCA_LogicManager* SCA_ILogicBrick::m_sCurrentLogicManager = NULL; -SCA_ILogicBrick::SCA_ILogicBrick(SCA_IObject* gameobj, - PyTypeObject* T) +SCA_ILogicBrick::SCA_ILogicBrick(SCA_IObject* gameobj) : - CValue(T), + CValue(), m_gameobj(gameobj), m_Execute_Priority(0), m_Execute_Ueber_Priority(0), @@ -195,22 +194,17 @@ PyTypeObject SCA_ILogicBrick::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject SCA_ILogicBrick::Parents[] = { - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &CValue::Type }; - - PyMethodDef SCA_ILogicBrick::Methods[] = { // --> Deprecated {"getOwner", (PyCFunction) SCA_ILogicBrick::sPyGetOwner, METH_NOARGS}, @@ -245,21 +239,6 @@ int SCA_ILogicBrick::CheckProperty(void *self, const PyAttributeDef *attrdef) return 0; } -PyObject* SCA_ILogicBrick::py_getattro(PyObject *attr) -{ - py_getattro_up(CValue); -} - -PyObject* SCA_ILogicBrick::py_getattro_dict() { - py_getattro_dict_up(CValue); -} - -int SCA_ILogicBrick::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(CValue); -} - - PyObject* SCA_ILogicBrick::PyGetOwner() { ShowDeprecationWarning("getOwner()", "the owner property"); diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index 779e5397a6a..50679856802 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -53,7 +53,7 @@ protected: CValue* GetEvent(); public: - SCA_ILogicBrick(SCA_IObject* gameobj,PyTypeObject* T ); + SCA_ILogicBrick(SCA_IObject* gameobj); virtual ~SCA_ILogicBrick(); void SetExecutePriority(int execute_Priority); @@ -121,10 +121,6 @@ public: } virtual bool LessComparedTo(SCA_ILogicBrick* other); - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); static class SCA_LogicManager* m_sCurrentLogicManager; diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index 9876f2512c0..698e845466a 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -41,8 +41,11 @@ MT_Point3 SCA_IObject::m_sDummy=MT_Point3(0,0,0); SG_QList SCA_IObject::m_activeBookmarkedControllers; -SCA_IObject::SCA_IObject(PyTypeObject* T): CValue(T), m_initState(0), m_state(0), m_firstState(NULL) - +SCA_IObject::SCA_IObject(): + CValue(), + m_initState(0), + m_state(0), + m_firstState(NULL) { m_suspended = false; } @@ -347,22 +350,17 @@ PyTypeObject SCA_IObject::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject SCA_IObject::Parents[] = { - &SCA_IObject::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &CValue::Type }; - - PyMethodDef SCA_IObject::Methods[] = { //{"setOrientation", (PyCFunction) SCA_IObject::sPySetOrientation, METH_VARARGS}, //{"getOrientation", (PyCFunction) SCA_IObject::sPyGetOrientation, METH_VARARGS}, @@ -372,12 +370,3 @@ PyMethodDef SCA_IObject::Methods[] = { PyAttributeDef SCA_IObject::Attributes[] = { { NULL } //Sentinel }; - - -PyObject* SCA_IObject::py_getattro(PyObject *attr) { - py_getattro_up(CValue); -} - -PyObject* SCA_IObject::py_getattro_dict() { - py_getattro_dict_up(CValue); -} diff --git a/source/gameengine/GameLogic/SCA_IObject.h b/source/gameengine/GameLogic/SCA_IObject.h index eae427741ca..3060410dc6b 100644 --- a/source/gameengine/GameLogic/SCA_IObject.h +++ b/source/gameengine/GameLogic/SCA_IObject.h @@ -105,7 +105,7 @@ protected: public: - SCA_IObject(PyTypeObject* T=&Type); + SCA_IObject(); virtual ~SCA_IObject(); SCA_ControllerList& GetControllers() @@ -199,15 +199,12 @@ public: unsigned int GetState(void) { return m_state; } // const class MT_Point3& ConvertPythonPylist(PyObject* pylist); - - // here come the python forwarded methods - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); virtual int GetGameObjectType() {return -1;} typedef enum ObjectTypes { OBJ_ARMATURE=0, + OBJ_CAMERA=1, }ObjectTypes; }; diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 2783bf14600..de7030197b2 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -50,9 +50,8 @@ void SCA_ISensor::ReParent(SCA_IObject* parent) SCA_ISensor::SCA_ISensor(SCA_IObject* gameobj, - class SCA_EventManager* eventmgr, - PyTypeObject* T ) : - SCA_ILogicBrick(gameobj,T) + class SCA_EventManager* eventmgr) : + SCA_ILogicBrick(gameobj) { m_links = 0; m_suspended = false; @@ -490,18 +489,17 @@ PyTypeObject SCA_ISensor::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_ILogicBrick::Type }; -PyParentObject SCA_ISensor::Parents[] = { - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL -}; PyMethodDef SCA_ISensor::Methods[] = { //Deprecated functions -----> {"isPositive", (PyCFunction) SCA_ISensor::sPyIsPositive, @@ -548,19 +546,6 @@ PyAttributeDef SCA_ISensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_ISensor::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_ILogicBrick); -} - -PyObject* SCA_ISensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ILogicBrick); -} - -int SCA_ISensor::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_ILogicBrick); -} PyObject* SCA_ISensor::pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index 9bbd6ed41e4..81864ab6a34 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -101,8 +101,7 @@ public: }; SCA_ISensor(SCA_IObject* gameobj, - class SCA_EventManager* eventmgr, - PyTypeObject* T );; + class SCA_EventManager* eventmgr);; ~SCA_ISensor(); virtual void ReParent(SCA_IObject* parent); @@ -173,10 +172,6 @@ public: { return !m_links; } /* Python functions: */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); //Deprecated functions -----> KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,IsPositive); diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index 336529667d7..645c73efaa4 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -46,9 +46,8 @@ SCA_JoystickSensor::SCA_JoystickSensor(class SCA_JoystickManager* eventmgr, short int joymode, int axis, int axisf,int prec, int button, - int hat, int hatf, bool allevents, - PyTypeObject* T ) - :SCA_ISensor(gameobj,eventmgr,T), + int hat, int hatf, bool allevents) + :SCA_ISensor(gameobj,eventmgr), m_pJoystickMgr(eventmgr), m_axis(axis), m_axisf(axisf), @@ -270,22 +269,17 @@ PyTypeObject SCA_JoystickSensor::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - - -PyParentObject SCA_JoystickSensor::Parents[] = { - &SCA_JoystickSensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_ISensor::Type }; - PyMethodDef SCA_JoystickSensor::Methods[] = { //Deprecated functions ------> {"getIndex", (PyCFunction) SCA_JoystickSensor::sPyGetIndex, METH_NOARGS, (PY_METHODCHAR)GetIndex_doc}, @@ -328,20 +322,6 @@ PyAttributeDef SCA_JoystickSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_JoystickSensor::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_JoystickSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int SCA_JoystickSensor::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_ISensor); -} - /* get index ---------------------------------------------------------- */ const char SCA_JoystickSensor::GetIndex_doc[] = diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.h b/source/gameengine/GameLogic/SCA_JoystickSensor.h index e6a1d2eef32..32f8ce567d2 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.h +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.h @@ -106,8 +106,7 @@ public: short int joymode, int axis, int axisf,int prec, int button, - int hat, int hatf, bool allevents, - PyTypeObject* T=&Type ); + int hat, int hatf, bool allevents); virtual ~SCA_JoystickSensor(); virtual CValue* GetReplica(); @@ -123,10 +122,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - /* Joystick Index */ KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetIndex); KX_PYMETHOD_DOC_O(SCA_JoystickSensor,SetIndex); diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index f8ee8ed8b41..34ade17ffb7 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -48,9 +48,8 @@ SCA_KeyboardSensor::SCA_KeyboardSensor(SCA_KeyboardManager* keybdmgr, bool bAllKeys, const STR_String& targetProp, const STR_String& toggleProp, - SCA_IObject* gameobj, - PyTypeObject* T ) - :SCA_ISensor(gameobj,keybdmgr,T), + SCA_IObject* gameobj) + :SCA_ISensor(gameobj,keybdmgr), m_pKeyboardMgr(keybdmgr), m_hotkey(hotkey), m_qual(qual), @@ -632,18 +631,15 @@ PyTypeObject SCA_KeyboardSensor::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_KeyboardSensor::Parents[] = { - &SCA_KeyboardSensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_ISensor::Type }; PyMethodDef SCA_KeyboardSensor::Methods[] = { @@ -672,20 +668,6 @@ PyAttributeDef SCA_KeyboardSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_KeyboardSensor::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_KeyboardSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int SCA_KeyboardSensor::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_ISensor); -} - PyObject* SCA_KeyboardSensor::pyattr_get_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h index 033225cd9be..3185b386d41 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h @@ -94,8 +94,7 @@ public: bool bAllKeys, const STR_String& targetProp, const STR_String& toggleProp, - SCA_IObject* gameobj, - PyTypeObject* T=&Type ); + SCA_IObject* gameobj); virtual ~SCA_KeyboardSensor(); virtual CValue* GetReplica(); virtual void Init(); @@ -110,10 +109,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - //Deprecated functions -----> /** 1. GetKey : check which key this sensor looks at */ KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetKey); diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index c5e1c3c0441..3a1e6191fdb 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -49,9 +49,8 @@ SCA_MouseSensor::SCA_MouseSensor(SCA_MouseManager* eventmgr, int startx,int starty, short int mousemode, - SCA_IObject* gameobj, - PyTypeObject* T) - : SCA_ISensor(gameobj,eventmgr, T), + SCA_IObject* gameobj) + : SCA_ISensor(gameobj,eventmgr), m_pMouseMgr(eventmgr), m_x(startx), m_y(starty) @@ -313,18 +312,15 @@ PyTypeObject SCA_MouseSensor::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_MouseSensor::Parents[] = { - &SCA_MouseSensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_ISensor::Type }; PyMethodDef SCA_MouseSensor::Methods[] = { @@ -342,18 +338,4 @@ PyAttributeDef SCA_MouseSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_MouseSensor::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_MouseSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int SCA_MouseSensor::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_ISensor); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.h b/source/gameengine/GameLogic/SCA_MouseSensor.h index 6d6302b514a..47f0378bf69 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.h +++ b/source/gameengine/GameLogic/SCA_MouseSensor.h @@ -92,8 +92,7 @@ class SCA_MouseSensor : public SCA_ISensor SCA_MouseSensor(class SCA_MouseManager* keybdmgr, int startx,int starty, short int mousemode, - SCA_IObject* gameobj, - PyTypeObject* T=&Type ); + SCA_IObject* gameobj); virtual ~SCA_MouseSensor(); virtual CValue* GetReplica(); @@ -109,10 +108,6 @@ class SCA_MouseSensor : public SCA_ISensor /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - //Deprecated functions -----> /* read x-coordinate */ KX_PYMETHOD_DOC_NOARGS(SCA_MouseSensor,GetXPosition); diff --git a/source/gameengine/GameLogic/SCA_NANDController.cpp b/source/gameengine/GameLogic/SCA_NANDController.cpp index d27aea5e6f7..d4a6a444b97 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.cpp +++ b/source/gameengine/GameLogic/SCA_NANDController.cpp @@ -42,10 +42,9 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ -SCA_NANDController::SCA_NANDController(SCA_IObject* gameobj, - PyTypeObject* T) +SCA_NANDController::SCA_NANDController(SCA_IObject* gameobj) : - SCA_IController(gameobj,T) + SCA_IController(gameobj) { } @@ -117,18 +116,15 @@ PyTypeObject SCA_NANDController::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_NANDController::Parents[] = { - &SCA_NANDController::Type, - &SCA_IController::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IController::Type }; PyMethodDef SCA_NANDController::Methods[] = { @@ -139,12 +135,4 @@ PyAttributeDef SCA_NANDController::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_NANDController::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IController); -} - -PyObject* SCA_NANDController::py_getattro_dict() { - py_getattro_dict_up(SCA_IController); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_NANDController.h b/source/gameengine/GameLogic/SCA_NANDController.h index 0ae0ff19745..36a145e5f2b 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.h +++ b/source/gameengine/GameLogic/SCA_NANDController.h @@ -39,7 +39,7 @@ class SCA_NANDController : public SCA_IController Py_Header; //virtual void Trigger(class SCA_LogicManager* logicmgr); public: - SCA_NANDController(SCA_IObject* gameobj,PyTypeObject* T=&Type); + SCA_NANDController(SCA_IObject* gameobj); virtual ~SCA_NANDController(); virtual CValue* GetReplica(); virtual void Trigger(SCA_LogicManager* logicmgr); @@ -47,10 +47,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - }; #endif //__KX_NANDCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_NORController.cpp b/source/gameengine/GameLogic/SCA_NORController.cpp index 6c9141636b2..67e0916ecc1 100644 --- a/source/gameengine/GameLogic/SCA_NORController.cpp +++ b/source/gameengine/GameLogic/SCA_NORController.cpp @@ -42,10 +42,9 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ -SCA_NORController::SCA_NORController(SCA_IObject* gameobj, - PyTypeObject* T) +SCA_NORController::SCA_NORController(SCA_IObject* gameobj) : - SCA_IController(gameobj,T) + SCA_IController(gameobj) { } @@ -117,18 +116,15 @@ PyTypeObject SCA_NORController::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_NORController::Parents[] = { - &SCA_NORController::Type, - &SCA_IController::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IController::Type }; PyMethodDef SCA_NORController::Methods[] = { @@ -139,12 +135,4 @@ PyAttributeDef SCA_NORController::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_NORController::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IController); -} - -PyObject* SCA_NORController::py_getattro_dict() { - py_getattro_dict_up(SCA_IController); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_NORController.h b/source/gameengine/GameLogic/SCA_NORController.h index 06cbb70a489..b96232375d6 100644 --- a/source/gameengine/GameLogic/SCA_NORController.h +++ b/source/gameengine/GameLogic/SCA_NORController.h @@ -39,18 +39,10 @@ class SCA_NORController : public SCA_IController Py_Header; //virtual void Trigger(class SCA_LogicManager* logicmgr); public: - SCA_NORController(SCA_IObject* gameobj,PyTypeObject* T=&Type); + SCA_NORController(SCA_IObject* gameobj); virtual ~SCA_NORController(); virtual CValue* GetReplica(); virtual void Trigger(SCA_LogicManager* logicmgr); - - /* --------------------------------------------------------------------- */ - /* Python interface ---------------------------------------------------- */ - /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - }; #endif //__KX_NORCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_ORController.cpp b/source/gameengine/GameLogic/SCA_ORController.cpp index 42c0a67d657..1dd81668482 100644 --- a/source/gameengine/GameLogic/SCA_ORController.cpp +++ b/source/gameengine/GameLogic/SCA_ORController.cpp @@ -42,9 +42,8 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ -SCA_ORController::SCA_ORController(SCA_IObject* gameobj, - PyTypeObject* T) - :SCA_IController(gameobj, T) +SCA_ORController::SCA_ORController(SCA_IObject* gameobj) + :SCA_IController(gameobj) { } @@ -111,18 +110,15 @@ PyTypeObject SCA_ORController::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_ORController::Parents[] = { - &SCA_ORController::Type, - &SCA_IController::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IController::Type }; PyMethodDef SCA_ORController::Methods[] = { @@ -133,13 +129,4 @@ PyAttributeDef SCA_ORController::Attributes[] = { { NULL } //Sentinel }; - -PyObject* SCA_ORController::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IController); -} - -PyObject* SCA_ORController::py_getattro_dict() { - py_getattro_dict_up(SCA_IController); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_ORController.h b/source/gameengine/GameLogic/SCA_ORController.h index 66f772c739e..09d31a85190 100644 --- a/source/gameengine/GameLogic/SCA_ORController.h +++ b/source/gameengine/GameLogic/SCA_ORController.h @@ -39,18 +39,11 @@ class SCA_ORController : public SCA_IController Py_Header; //virtual void Trigger(class SCA_LogicManager* logicmgr); public: - SCA_ORController(SCA_IObject* gameobj, PyTypeObject* T=&Type); + SCA_ORController(SCA_IObject* gameobj); virtual ~SCA_ORController(); virtual CValue* GetReplica(); virtual void Trigger(SCA_LogicManager* logicmgr); - - /* --------------------------------------------------------------------- */ - /* Python interface ---------------------------------------------------- */ - /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); }; #endif //__KX_ORCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index 4faa4b55d4a..7eb088bef98 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -42,8 +42,8 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ -SCA_PropertyActuator::SCA_PropertyActuator(SCA_IObject* gameobj,SCA_IObject* sourceObj,const STR_String& propname,const STR_String& expr,int acttype,PyTypeObject* T ) - : SCA_IActuator(gameobj,T), +SCA_PropertyActuator::SCA_PropertyActuator(SCA_IObject* gameobj,SCA_IObject* sourceObj,const STR_String& propname,const STR_String& expr,int acttype) + : SCA_IActuator(gameobj), m_type(acttype), m_propname(propname), m_exprtxt(expr), @@ -245,18 +245,15 @@ PyTypeObject SCA_PropertyActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_PropertyActuator::Parents[] = { - &SCA_PropertyActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; PyMethodDef SCA_PropertyActuator::Methods[] = { @@ -276,18 +273,6 @@ PyAttributeDef SCA_PropertyActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_PropertyActuator::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IActuator); -} - -PyObject* SCA_PropertyActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int SCA_PropertyActuator::py_setattro(PyObject *attr, PyObject *value) { - py_setattro_up(SCA_IActuator); -} - /* 1. setProperty */ const char SCA_PropertyActuator::SetProperty_doc[] = "setProperty(name)\n" diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.h b/source/gameengine/GameLogic/SCA_PropertyActuator.h index a8df08dfc6e..8fb2e7a7bc5 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.h +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.h @@ -64,9 +64,7 @@ public: SCA_IObject* sourceObj, const STR_String& propname, const STR_String& expr, - int acttype, - PyTypeObject* T=&Type - ); + int acttype); ~SCA_PropertyActuator(); @@ -86,10 +84,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - // python wrapped methods KX_PYMETHOD_DOC(SCA_PropertyActuator,SetProperty); KX_PYMETHOD_DOC(SCA_PropertyActuator,GetProperty); diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index 3b343af3cba..b1571164774 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -48,9 +48,8 @@ SCA_PropertySensor::SCA_PropertySensor(SCA_EventManager* eventmgr, const STR_String& propname, const STR_String& propval, const STR_String& propmaxval, - KX_PROPSENSOR_TYPE checktype, - PyTypeObject* T ) - : SCA_ISensor(gameobj,eventmgr,T), + KX_PROPSENSOR_TYPE checktype) + : SCA_ISensor(gameobj,eventmgr), m_checktype(checktype), m_checkpropval(propval), m_checkpropmaxval(propmaxval), @@ -320,18 +319,15 @@ PyTypeObject SCA_PropertySensor::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_PropertySensor::Parents[] = { - &SCA_PropertySensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_ISensor::Type }; PyMethodDef SCA_PropertySensor::Methods[] = { @@ -353,19 +349,6 @@ PyAttributeDef SCA_PropertySensor::Attributes[] = { { NULL } //Sentinel }; - -PyObject* SCA_PropertySensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_PropertySensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int SCA_PropertySensor::py_setattro(PyObject *attr, PyObject *value) { - py_setattro_up(SCA_ISensor); -} - /* 1. getType */ const char SCA_PropertySensor::GetType_doc[] = "getType()\n" diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.h b/source/gameengine/GameLogic/SCA_PropertySensor.h index 538ecd65949..3513fcdf5ae 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.h +++ b/source/gameengine/GameLogic/SCA_PropertySensor.h @@ -67,8 +67,7 @@ public: const STR_String& propname, const STR_String& propval, const STR_String& propmaxval, - KX_PROPSENSOR_TYPE checktype, - PyTypeObject* T=&Type ); + KX_PROPSENSOR_TYPE checktype); /** * For property sensor, it is used to release the pre-calculated expression @@ -89,10 +88,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - /* 1. getType */ KX_PYMETHOD_DOC_NOARGS(SCA_PropertySensor,GetType); /* 2. setType */ diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 80e4f54c9c5..fb12674ebed 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -47,10 +47,8 @@ SCA_PythonController* SCA_PythonController::m_sCurrentController = NULL; -SCA_PythonController::SCA_PythonController(SCA_IObject* gameobj, - int mode, - PyTypeObject* T) - : SCA_IController(gameobj, T), +SCA_PythonController::SCA_PythonController(SCA_IObject* gameobj, int mode) + : SCA_IController(gameobj), m_bytecode(NULL), m_function(NULL), m_function_argc(0), @@ -246,18 +244,17 @@ PyTypeObject SCA_PythonController::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IController::Type }; -PyParentObject SCA_PythonController::Parents[] = { - &SCA_PythonController::Type, - &SCA_IController::Type, - &CValue::Type, - NULL -}; PyMethodDef SCA_PythonController::Methods[] = { {"activate", (PyCFunction) SCA_PythonController::sPyActivate, METH_O}, {"deactivate", (PyCFunction) SCA_PythonController::sPyDeActivate, METH_O}, @@ -490,22 +487,6 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) m_sCurrentController = NULL; } - - -PyObject* SCA_PythonController::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IController); -} - -PyObject* SCA_PythonController::py_getattro_dict() { - py_getattro_dict_up(SCA_IController); -} - -int SCA_PythonController::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_IController); -} - PyObject* SCA_PythonController::PyActivate(PyObject *value) { if(m_sCurrentController != this) { @@ -565,10 +546,15 @@ PyObject* SCA_PythonController::PySetScript(PyObject* value) PyObject* SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { + //SCA_PythonController* self= static_cast(static_cast(static_cast(static_cast(static_cast(self_v))))); + // static_cast(dynamic_cast(obj)) - static_cast(obj) + SCA_PythonController* self= static_cast(self_v); return PyString_FromString(self->m_scriptText); } + + int SCA_PythonController::pyattr_set_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { SCA_PythonController* self= static_cast(self_v); diff --git a/source/gameengine/GameLogic/SCA_PythonController.h b/source/gameengine/GameLogic/SCA_PythonController.h index 0c2af79c3a3..9311b3f355e 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.h +++ b/source/gameengine/GameLogic/SCA_PythonController.h @@ -72,7 +72,7 @@ class SCA_PythonController : public SCA_IController //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, int mode, PyTypeObject* T = &Type); + SCA_PythonController(SCA_IObject* gameobj, int mode); virtual ~SCA_PythonController(); virtual CValue* GetReplica(); @@ -96,10 +96,6 @@ 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); diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index a722590dd10..a272306bd1d 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -50,9 +50,8 @@ SCA_RandomActuator::SCA_RandomActuator(SCA_IObject *gameobj, SCA_RandomActuator::KX_RANDOMACT_MODE mode, float para1, float para2, - const STR_String &propName, - PyTypeObject* T) - : SCA_IActuator(gameobj, T), + const STR_String &propName) + : SCA_IActuator(gameobj), m_propname(propName), m_parameter1(para1), m_parameter2(para2), @@ -333,18 +332,15 @@ PyTypeObject SCA_RandomActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_RandomActuator::Parents[] = { - &SCA_RandomActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; PyMethodDef SCA_RandomActuator::Methods[] = { @@ -400,19 +396,6 @@ int SCA_RandomActuator::pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_ } } -PyObject* SCA_RandomActuator::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IActuator); -} - -PyObject* SCA_RandomActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int SCA_RandomActuator::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_IActuator); -} - /* 1. setSeed */ const char SCA_RandomActuator::SetSeed_doc[] = "setSeed(seed)\n" diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.h b/source/gameengine/GameLogic/SCA_RandomActuator.h index 59863589b60..c7d3fe21217 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.h +++ b/source/gameengine/GameLogic/SCA_RandomActuator.h @@ -85,8 +85,7 @@ class SCA_RandomActuator : public SCA_IActuator KX_RANDOMACT_MODE mode, float para1, float para2, - const STR_String &propName, - PyTypeObject* T=&Type); + const STR_String &propName); virtual ~SCA_RandomActuator(); virtual bool Update(); @@ -97,10 +96,6 @@ class SCA_RandomActuator : public SCA_IActuator /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - static PyObject* pyattr_get_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index d5cbeef01ae..8a6f42c9926 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -46,9 +46,8 @@ SCA_RandomSensor::SCA_RandomSensor(SCA_EventManager* eventmgr, SCA_IObject* gameobj, - int startseed, - PyTypeObject* T) - : SCA_ISensor(gameobj,eventmgr, T) + int startseed) + : SCA_ISensor(gameobj,eventmgr) { m_basegenerator = new SCA_RandomNumberGenerator(startseed); Init(); @@ -148,18 +147,15 @@ PyTypeObject SCA_RandomSensor::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_RandomSensor::Parents[] = { - &SCA_RandomSensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_ISensor::Type }; PyMethodDef SCA_RandomSensor::Methods[] = { @@ -177,19 +173,6 @@ PyAttributeDef SCA_RandomSensor::Attributes[] = { {NULL} //Sentinel }; -PyObject* SCA_RandomSensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_RandomSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int SCA_RandomSensor::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_ISensor); -} - /* 1. setSeed */ const char SCA_RandomSensor::SetSeed_doc[] = "setSeed(seed)\n" diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.h b/source/gameengine/GameLogic/SCA_RandomSensor.h index b2bf2440966..5e66c36cccf 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.h +++ b/source/gameengine/GameLogic/SCA_RandomSensor.h @@ -48,8 +48,7 @@ class SCA_RandomSensor : public SCA_ISensor public: SCA_RandomSensor(class SCA_EventManager* rndmgr, SCA_IObject* gameobj, - int startseed, - PyTypeObject* T=&Type); + int startseed); virtual ~SCA_RandomSensor(); virtual CValue* GetReplica(); virtual void ProcessReplica(); @@ -61,10 +60,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - /* 1. setSeed */ KX_PYMETHOD_DOC_VARARGS(SCA_RandomSensor,SetSeed); /* 2. getSeed */ diff --git a/source/gameengine/GameLogic/SCA_XNORController.cpp b/source/gameengine/GameLogic/SCA_XNORController.cpp index aee8e26c21a..584a6b18f58 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.cpp +++ b/source/gameengine/GameLogic/SCA_XNORController.cpp @@ -42,10 +42,9 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ -SCA_XNORController::SCA_XNORController(SCA_IObject* gameobj, - PyTypeObject* T) +SCA_XNORController::SCA_XNORController(SCA_IObject* gameobj) : - SCA_IController(gameobj,T) + SCA_IController(gameobj) { } @@ -121,18 +120,15 @@ PyTypeObject SCA_XNORController::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_XNORController::Parents[] = { - &SCA_XNORController::Type, - &SCA_IController::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IController::Type }; PyMethodDef SCA_XNORController::Methods[] = { @@ -143,12 +139,4 @@ PyAttributeDef SCA_XNORController::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_XNORController::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IController); -} - -PyObject* SCA_XNORController::py_getattro_dict() { - py_getattro_dict_up(SCA_IController); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_XNORController.h b/source/gameengine/GameLogic/SCA_XNORController.h index 4aad5763cb0..18e77fae665 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.h +++ b/source/gameengine/GameLogic/SCA_XNORController.h @@ -39,7 +39,7 @@ class SCA_XNORController : public SCA_IController Py_Header; //virtual void Trigger(class SCA_LogicManager* logicmgr); public: - SCA_XNORController(SCA_IObject* gameobj,PyTypeObject* T=&Type); + SCA_XNORController(SCA_IObject* gameobj); virtual ~SCA_XNORController(); virtual CValue* GetReplica(); virtual void Trigger(SCA_LogicManager* logicmgr); @@ -48,9 +48,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - }; #endif //__KX_XNORCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_XORController.cpp b/source/gameengine/GameLogic/SCA_XORController.cpp index 5afb3a750f5..9f570acb009 100644 --- a/source/gameengine/GameLogic/SCA_XORController.cpp +++ b/source/gameengine/GameLogic/SCA_XORController.cpp @@ -42,10 +42,9 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ -SCA_XORController::SCA_XORController(SCA_IObject* gameobj, - PyTypeObject* T) +SCA_XORController::SCA_XORController(SCA_IObject* gameobj) : - SCA_IController(gameobj,T) + SCA_IController(gameobj) { } @@ -121,18 +120,15 @@ PyTypeObject SCA_XORController::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_XORController::Parents[] = { - &SCA_XORController::Type, - &SCA_IController::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IController::Type }; PyMethodDef SCA_XORController::Methods[] = { @@ -143,12 +139,4 @@ PyAttributeDef SCA_XORController::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_XORController::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IController); -} - -PyObject* SCA_XORController::py_getattro_dict() { - py_getattro_dict_up(SCA_IController); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_XORController.h b/source/gameengine/GameLogic/SCA_XORController.h index feb9f2ed07c..2607a533661 100644 --- a/source/gameengine/GameLogic/SCA_XORController.h +++ b/source/gameengine/GameLogic/SCA_XORController.h @@ -39,18 +39,10 @@ class SCA_XORController : public SCA_IController Py_Header; //virtual void Trigger(class SCA_LogicManager* logicmgr); public: - SCA_XORController(SCA_IObject* gameobj,PyTypeObject* T=&Type); + SCA_XORController(SCA_IObject* gameobj); virtual ~SCA_XORController(); virtual CValue* GetReplica(); virtual void Trigger(SCA_LogicManager* logicmgr); - - /* --------------------------------------------------------------------- */ - /* Python interface ---------------------------------------------------- */ - /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - }; #endif //__KX_XORCONTROLLER diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index c5c517c8a65..b595aab578f 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -113,8 +113,8 @@ bool BL_Shader::Ok()const return (mShader !=0 && mOk && mUse); } -BL_Shader::BL_Shader(PyTypeObject *T) -: PyObjectPlus(T), +BL_Shader::BL_Shader() +: PyObjectPlus(), mShader(0), mPass(1), mOk(0), @@ -728,17 +728,6 @@ void BL_Shader::SetUniform(int uniform, const int* val, int len) } } - -PyObject* BL_Shader::py_getattro(PyObject *attr) -{ - py_getattro_up(PyObjectPlus); -} - -PyObject* BL_Shader::py_getattro_dict() { - py_getattro_dict_up(PyObjectPlus); -} - - PyMethodDef BL_Shader::Methods[] = { // creation @@ -793,20 +782,17 @@ PyTypeObject BL_Shader::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - - -PyParentObject BL_Shader::Parents[] = { - &BL_Shader::Type, - &PyObjectPlus::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &PyObjectPlus::Type }; - KX_PYMETHODDEF_DOC( BL_Shader, setSource," setSource(vertexProgram, fragmentProgram)" ) { if(mShader !=0 && mOk ) diff --git a/source/gameengine/Ketsji/BL_Shader.h b/source/gameengine/Ketsji/BL_Shader.h index 7db40e778ae..517f3151909 100644 --- a/source/gameengine/Ketsji/BL_Shader.h +++ b/source/gameengine/Ketsji/BL_Shader.h @@ -120,7 +120,7 @@ private: void ClearUniforms(); public: - BL_Shader(PyTypeObject *T=&Type); + BL_Shader(); virtual ~BL_Shader(); // Unused for now tangent is set as @@ -202,8 +202,6 @@ public: void SetUniform(int uniform, const int val); // Python interface - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); virtual PyObject* py_repr(void) { return PyString_FromFormat("BL_Shader\n\tvertex shader:%s\n\n\tfragment shader%s\n\n", vertProg, fragProg); } // ----------------------------------- diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp index 63773352d96..60805916a20 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp @@ -41,9 +41,8 @@ KX_NetworkMessageActuator::KX_NetworkMessageActuator( const STR_String &toPropName, const STR_String &subject, int bodyType, - const STR_String &body, - PyTypeObject* T) : - SCA_IActuator(gameobj,T), + const STR_String &body) : + SCA_IActuator(gameobj), m_networkscene(networkscene), m_toPropName(toPropName), m_subject(subject), @@ -119,18 +118,15 @@ PyTypeObject KX_NetworkMessageActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_NetworkMessageActuator::Parents[] = { - &KX_NetworkMessageActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; PyMethodDef KX_NetworkMessageActuator::Methods[] = { @@ -155,18 +151,6 @@ PyAttributeDef KX_NetworkMessageActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_NetworkMessageActuator::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_NetworkMessageActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_NetworkMessageActuator::py_setattro(PyObject *attr, PyObject *value) { - py_setattro_up(SCA_IActuator); -} - // Deprecated -----> // 1. SetToPropName PyObject* KX_NetworkMessageActuator::PySetToPropName( @@ -240,4 +224,4 @@ PyObject* KX_NetworkMessageActuator::PySetBody( Py_RETURN_NONE; } -// <----- Deprecated \ No newline at end of file +// <----- Deprecated diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h index cf92fd46fe0..b4f55f2a466 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h @@ -50,8 +50,7 @@ public: const STR_String &toPropName, const STR_String &subject, int bodyType, - const STR_String &body, - PyTypeObject* T=&Type); + const STR_String &body); virtual ~KX_NetworkMessageActuator(); virtual bool Update(); @@ -61,10 +60,6 @@ public: /* Python interface ------------------------------------------- */ /* ------------------------------------------------------------ */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - // Deprecated -----> KX_PYMETHOD(KX_NetworkMessageActuator, SetToPropName); KX_PYMETHOD(KX_NetworkMessageActuator, SetSubject); diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index 8ddcd87b66f..da43893cee3 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -50,10 +50,9 @@ KX_NetworkMessageSensor::KX_NetworkMessageSensor( class KX_NetworkEventManager* eventmgr, // our eventmanager class NG_NetworkScene *NetworkScene, // our scene SCA_IObject* gameobj, // the sensor controlling object - const STR_String &subject, - PyTypeObject* T + const STR_String &subject ) : - SCA_ISensor(gameobj,eventmgr,T), + SCA_ISensor(gameobj,eventmgr), m_Networkeventmgr(eventmgr), m_NetworkScene(NetworkScene), m_subject(subject), @@ -183,18 +182,15 @@ PyTypeObject KX_NetworkMessageSensor::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_NetworkMessageSensor::Parents[] = { - &KX_NetworkMessageSensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_ISensor::Type }; PyMethodDef KX_NetworkMessageSensor::Methods[] = { @@ -226,18 +222,6 @@ PyAttributeDef KX_NetworkMessageSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_NetworkMessageSensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_ISensor); -} - -PyObject* KX_NetworkMessageSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int KX_NetworkMessageSensor::py_setattro(PyObject *attr, PyObject *value) { - return SCA_ISensor::py_setattro(attr, value); -} - PyObject* KX_NetworkMessageSensor::pyattr_get_bodies(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_NetworkMessageSensor *self = static_cast(self_v); @@ -328,4 +312,4 @@ PyObject* KX_NetworkMessageSensor::PyGetSubjects() return (new CListValue())->NewProxy(true); } } -// <----- Deprecated \ No newline at end of file +// <----- Deprecated diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h index 53183f33826..ade87697303 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h @@ -57,8 +57,7 @@ public: KX_NetworkEventManager* eventmgr, // our eventmanager NG_NetworkScene *NetworkScene, // our scene SCA_IObject* gameobj, // the sensor controlling object - const STR_String &subject, - PyTypeObject* T=&Type + const STR_String &subject ); virtual ~KX_NetworkMessageSensor(); @@ -72,10 +71,6 @@ public: /* Python interface -------------------------------------------- */ /* ------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - // Deprecated -----> KX_PYMETHOD_DOC_O(KX_NetworkMessageSensor, SetSubjectFilterText); KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetFrameMessageCount); diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 30057fc039d..9e3b718a87a 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -42,10 +42,8 @@ BL_BlenderShader *KX_BlenderMaterial::mLastBlenderShader = NULL; //static PyObject *gTextureDict = 0; -KX_BlenderMaterial::KX_BlenderMaterial( - PyTypeObject *T - ) -: PyObjectPlus(T), +KX_BlenderMaterial::KX_BlenderMaterial() +: PyObjectPlus(), RAS_IPolyMaterial(), mMaterial(NULL), mShader(0), @@ -814,35 +812,17 @@ PyTypeObject KX_BlenderMaterial::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - - -PyParentObject KX_BlenderMaterial::Parents[] = { - &KX_BlenderMaterial::Type, - &PyObjectPlus::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &PyObjectPlus::Type }; - -PyObject* KX_BlenderMaterial::py_getattro(PyObject *attr) -{ - py_getattro_up(PyObjectPlus); -} - -PyObject* KX_BlenderMaterial::py_getattro_dict() { - py_getattro_dict_up(PyObjectPlus); -} - -int KX_BlenderMaterial::py_setattro(PyObject *attr, PyObject *pyvalue) -{ - return PyObjectPlus::py_setattro(attr, pyvalue); -} - - KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()") { if( !GLEW_ARB_fragment_shader) { diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index b29f2df98db..6eb9647a595 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -23,9 +23,7 @@ class KX_BlenderMaterial : public PyObjectPlus, public RAS_IPolyMaterial Py_Header; public: // -------------------------------- - KX_BlenderMaterial( - PyTypeObject* T=&Type - ); + KX_BlenderMaterial(); void Initialize( class KX_Scene* scene, BL_Material* mat, @@ -83,9 +81,6 @@ public: ); // -------------------------------- - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *pyvalue); virtual PyObject* py_repr(void) { return PyString_FromString(mMaterial->matname.ReadPtr()); } KX_PYMETHOD_DOC( KX_BlenderMaterial, getShader ); diff --git a/source/gameengine/Ketsji/KX_CDActuator.cpp b/source/gameengine/Ketsji/KX_CDActuator.cpp index 8511526fd5f..6e01bf0dded 100644 --- a/source/gameengine/Ketsji/KX_CDActuator.cpp +++ b/source/gameengine/Ketsji/KX_CDActuator.cpp @@ -48,9 +48,8 @@ KX_CDActuator::KX_CDActuator(SCA_IObject* gameobject, KX_CDACT_TYPE type, int track, short start, - short end, - PyTypeObject* T) - : SCA_IActuator(gameobject,T) + short end) + : SCA_IActuator(gameobject) { m_soundscene = soundscene; m_type = type; @@ -172,24 +171,17 @@ PyTypeObject KX_CDActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject KX_CDActuator::Parents[] = { - &KX_CDActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; - - PyMethodDef KX_CDActuator::Methods[] = { // Deprecated -----> {"setGain",(PyCFunction) KX_CDActuator::sPySetGain,METH_VARARGS,NULL}, @@ -217,22 +209,6 @@ int KX_CDActuator::pyattr_setGain(void *self, const struct KX_PYATTRIBUTE_DEF *a return PY_SET_ATTR_SUCCESS; } -PyObject* KX_CDActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_CDActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_CDActuator::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_IActuator); -} - - - KX_PYMETHODDEF_DOC_NOARGS(KX_CDActuator, startCD, "startCD()\n" "\tStarts the CD playing.\n") diff --git a/source/gameengine/Ketsji/KX_CDActuator.h b/source/gameengine/Ketsji/KX_CDActuator.h index 2fd05ab72e5..b01ad73777e 100644 --- a/source/gameengine/Ketsji/KX_CDActuator.h +++ b/source/gameengine/Ketsji/KX_CDActuator.h @@ -68,8 +68,7 @@ public: KX_CDACT_TYPE type, int track, short start, - short end, - PyTypeObject* T=&Type); + short end); ~KX_CDActuator(); @@ -81,10 +80,6 @@ public: /* Python interface --------------------------------------------------- */ /* -------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - // Deprecated -----> KX_PYMETHOD_VARARGS(KX_CDActuator,SetGain); KX_PYMETHOD_VARARGS(KX_CDActuator,GetGain); diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 40f6c99c03c..4ccbf73b417 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -42,10 +42,9 @@ KX_Camera::KX_Camera(void* sgReplicationInfo, SG_Callbacks callbacks, const RAS_CameraData& camdata, bool frustum_culling, - bool delete_node, - PyTypeObject *T) + bool delete_node) : - KX_GameObject(sgReplicationInfo,callbacks,T), + KX_GameObject(sgReplicationInfo,callbacks), m_camdata(camdata), m_dirty(true), m_normalized(false), @@ -551,41 +550,17 @@ PyTypeObject KX_Camera::Type = { &KX_GameObject::Sequence, &KX_GameObject::Mapping, 0,0,0, - py_base_getattro, - py_base_setattro, + NULL, //py_base_getattro, + NULL, //py_base_setattro, 0, - Py_TPFLAGS_DEFAULT, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, - Methods -}; - - - - - - -PyParentObject KX_Camera::Parents[] = { - &KX_Camera::Type, - &KX_GameObject::Type, - &SCA_IObject::Type, - &CValue::Type, - NULL + Methods, + 0, + 0, + &KX_GameObject::Type }; -PyObject* KX_Camera::py_getattro(PyObject *attr) -{ - py_getattro_up(KX_GameObject); -} - -PyObject* KX_Camera::py_getattro_dict() { - py_getattro_dict_up(KX_GameObject); -} - -int KX_Camera::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(KX_GameObject); -} - KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, sphereInsideFrustum, "sphereInsideFrustum(center, radius) -> Integer\n" "\treturns INSIDE, OUTSIDE or INTERSECT if the given sphere is\n" diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index aef21cd91e4..74c8e6d4e4f 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -143,7 +143,7 @@ public: enum { INSIDE, INTERSECT, OUTSIDE } ; - KX_Camera(void* sgReplicationInfo,SG_Callbacks callbacks,const RAS_CameraData& camdata, bool frustum_culling = true, bool delete_node = false, PyTypeObject *T = &Type); + KX_Camera(void* sgReplicationInfo,SG_Callbacks callbacks,const RAS_CameraData& camdata, bool frustum_culling = true, bool delete_node = false); virtual ~KX_Camera(); /** @@ -265,6 +265,7 @@ public: */ int GetViewportTop() const; + virtual int GetGameObjectType() { return OBJ_CAMERA; } KX_PYMETHOD_DOC_VARARGS(KX_Camera, sphereInsideFrustum); KX_PYMETHOD_DOC_O(KX_Camera, boxInsideFrustum); @@ -282,10 +283,6 @@ public: KX_PYMETHOD_DOC_O(KX_Camera, getScreenPosition); KX_PYMETHOD_DOC_VARARGS(KX_Camera, getScreenVect); KX_PYMETHOD_DOC_VARARGS(KX_Camera, getScreenRay); - - virtual PyObject* py_getattro(PyObject *attr); /* lens, near, far, projection_matrix */ - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *pyvalue); static PyObject* pyattr_get_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index f8557dac2c4..b960ae25841 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -56,10 +56,9 @@ KX_CameraActuator::KX_CameraActuator( float hght, float minhght, float maxhght, - bool xytog, - PyTypeObject* T + bool xytog ): - SCA_IActuator(gameobj, T), + SCA_IActuator(gameobj), m_ob (obj), m_height (hght), m_minHeight (minhght), @@ -386,18 +385,15 @@ PyTypeObject KX_CameraActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_CameraActuator::Parents[] = { - &KX_CameraActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; PyMethodDef KX_CameraActuator::Methods[] = { @@ -424,18 +420,6 @@ PyAttributeDef KX_CameraActuator::Attributes[] = { {NULL} }; -PyObject* KX_CameraActuator::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_CameraActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_CameraActuator::py_setattro(PyObject *attr, PyObject* value) { - py_setattro_up(SCA_IActuator); -} - /* get obj ---------------------------------------------------------- */ const char KX_CameraActuator::GetObject_doc[] = "getObject(name_only = 1)\n" diff --git a/source/gameengine/Ketsji/KX_CameraActuator.h b/source/gameengine/Ketsji/KX_CameraActuator.h index efa4e2f38d7..057c6fed770 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.h +++ b/source/gameengine/Ketsji/KX_CameraActuator.h @@ -91,9 +91,7 @@ private : float hght, float minhght, float maxhght, - bool xytog, - PyTypeObject* T=&Type - + bool xytog ); @@ -120,10 +118,6 @@ private : /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); - /* set object to look at */ KX_PYMETHOD_DOC_O(KX_CameraActuator,SetObject); /* get current object */ diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index bd03dea486b..7e5a2e31907 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -54,9 +54,8 @@ KX_ConstraintActuator::KX_ConstraintActuator(SCA_IObject *gameobj, int locrotxyz, int time, int option, - char *property, - PyTypeObject* T) : - SCA_IActuator(gameobj, T), + char *property) : + SCA_IActuator(gameobj), m_refDirVector(refDir), m_currentTime(0) { @@ -582,18 +581,15 @@ PyTypeObject KX_ConstraintActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_ConstraintActuator::Parents[] = { - &KX_ConstraintActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; PyMethodDef KX_ConstraintActuator::Methods[] = { @@ -639,21 +635,6 @@ PyAttributeDef KX_ConstraintActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_ConstraintActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_ConstraintActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_ConstraintActuator::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(SCA_IActuator); -} - - int KX_ConstraintActuator::pyattr_check_direction(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) { KX_ConstraintActuator* act = static_cast(self); diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.h b/source/gameengine/Ketsji/KX_ConstraintActuator.h index 40607b44947..677904aedc9 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.h +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.h @@ -126,8 +126,7 @@ protected: int locrot, int time, int option, - char *property, - PyTypeObject* T=&Type); + char *property); virtual ~KX_ConstraintActuator(); virtual CValue* GetReplica() { KX_ConstraintActuator* replica = new KX_ConstraintActuator(*this); @@ -141,10 +140,6 @@ protected: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); - static int pyattr_check_direction(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_check_min(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index c5cf67af67d..be23eff6ac0 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -38,8 +38,8 @@ KX_ConstraintWrapper::KX_ConstraintWrapper( PHY_ConstraintType ctype, int constraintId, - PHY_IPhysicsEnvironment* physenv,PyTypeObject *T) : - PyObjectPlus(T), + PHY_IPhysicsEnvironment* physenv) : + PyObjectPlus(), m_constraintId(constraintId), m_constraintType(ctype), m_physenv(physenv) @@ -100,36 +100,17 @@ PyTypeObject KX_ConstraintWrapper::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_ConstraintWrapper::Parents[] = { - &KX_ConstraintWrapper::Type, - NULL -}; - -//here you can search for existing data members (like mass,friction etc.) -PyObject* KX_ConstraintWrapper::py_getattro(PyObject *attr) -{ - py_getattro_up(PyObjectPlus); -} - -PyObject* KX_ConstraintWrapper::py_getattro_dict() { - py_getattro_dict_up(PyObjectPlus); -} - -int KX_ConstraintWrapper::py_setattro(PyObject *attr,PyObject* value) -{ - py_setattro_up(PyObjectPlus); + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &PyObjectPlus::Type }; - - - - PyMethodDef KX_ConstraintWrapper::Methods[] = { {"getConstraintId",(PyCFunction) KX_ConstraintWrapper::sPyGetConstraintId, METH_NOARGS}, {"setParam",(PyCFunction) KX_ConstraintWrapper::sPySetParam, METH_VARARGS}, diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.h b/source/gameengine/Ketsji/KX_ConstraintWrapper.h index 03813e0f167..74670944415 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.h +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.h @@ -35,11 +35,8 @@ class KX_ConstraintWrapper : public PyObjectPlus { Py_Header; - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); public: - KX_ConstraintWrapper(PHY_ConstraintType ctype,int constraintId,class PHY_IPhysicsEnvironment* physenv,PyTypeObject *T = &Type); + KX_ConstraintWrapper(PHY_ConstraintType ctype,int constraintId,class PHY_IPhysicsEnvironment* physenv); virtual ~KX_ConstraintWrapper (); int getConstraintId() { return m_constraintId;}; diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index 28bf12f5e87..2a769cf6c66 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -49,9 +49,8 @@ KX_GameActuator::KX_GameActuator(SCA_IObject *gameobj, const STR_String& filename, const STR_String& loadinganimationname, KX_Scene* scene, - KX_KetsjiEngine* ketsjiengine, - PyTypeObject* T) - : SCA_IActuator(gameobj, T) + KX_KetsjiEngine* ketsjiengine) + : SCA_IActuator(gameobj) { m_mode = mode; m_filename = filename; @@ -225,25 +224,17 @@ PyTypeObject KX_GameActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject KX_GameActuator::Parents[] = -{ - &KX_GameActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; - - PyMethodDef KX_GameActuator::Methods[] = { // Deprecated -----> @@ -259,21 +250,6 @@ PyAttributeDef KX_GameActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_GameActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_GameActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_GameActuator::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_IActuator); -} - - // Deprecated -----> /* getFile */ const char KX_GameActuator::GetFile_doc[] = diff --git a/source/gameengine/Ketsji/KX_GameActuator.h b/source/gameengine/Ketsji/KX_GameActuator.h index b2b1d6ec2b9..cabbf827b40 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.h +++ b/source/gameengine/Ketsji/KX_GameActuator.h @@ -65,8 +65,7 @@ protected: const STR_String& filename, const STR_String& loadinganimationname, KX_Scene* scene, - KX_KetsjiEngine* ketsjiEngine, - PyTypeObject* T=&Type); + KX_KetsjiEngine* ketsjiEngine); virtual ~KX_GameActuator(); virtual CValue* GetReplica(); @@ -77,10 +76,6 @@ protected: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - // Deprecated functions -----> KX_PYMETHOD_DOC(KX_GameActuator,GetFile); KX_PYMETHOD_DOC(KX_GameActuator,SetFile); diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 577f767b475..30b3cb201a7 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -86,10 +86,8 @@ static MT_Matrix3x3 dummy_orientation = MT_Matrix3x3( 1.0, 0.0, 0.0, KX_GameObject::KX_GameObject( void* sgReplicationInfo, - SG_Callbacks callbacks, - PyTypeObject* T -) : - SCA_IObject(T), + SG_Callbacks callbacks) + : SCA_IObject(), m_bDyna(false), m_layer(0), m_pBlenderObject(NULL), @@ -1674,24 +1672,15 @@ PyTypeObject KX_GameObject::Type = { &Sequence, &Mapping, 0,0,0, - py_base_getattro, - py_base_setattro, + NULL, //py_base_getattro, + NULL, //py_base_setattro, 0, - Py_TPFLAGS_DEFAULT, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, - Methods -}; - - - - - - -PyParentObject KX_GameObject::Parents[] = { - &KX_GameObject::Type, - &SCA_IObject::Type, - &CValue::Type, - NULL + Methods, + 0, + 0, + &SCA_IObject::Type }; PyObject* KX_GameObject::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -1922,7 +1911,7 @@ PyObject* KX_GameObject::pyattr_get_localScaling(void *self_v, const KX_PYATTRIB #ifdef USE_MATHUTILS return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_LOCAL); #else - return PyObjectFrom(self->NodeGetLocalScale()); + return PyObjectFrom(self->NodeGetLocalScaling()); #endif } @@ -2047,128 +2036,6 @@ PyObject* KX_GameObject::pyattr_get_attrDict(void *self_v, const KX_PYATTRIBUTE_ return self->m_attr_dict; } -/* We need these because the macros have a return in them */ -PyObject* KX_GameObject::py_getattro__internal(PyObject *attr) -{ - py_getattro_up(SCA_IObject); -} - -int KX_GameObject::py_setattro__internal(PyObject *attr, PyObject *value) // py_setattro method -{ - py_setattro_up(SCA_IObject); -} - - -PyObject* KX_GameObject::py_getattro(PyObject *attr) -{ - PyObject *object= py_getattro__internal(attr); - - if (object==NULL && m_attr_dict) - { - /* backup the exception incase the attr doesnt exist in the dict either */ - PyObject *err_type, *err_value, *err_tb; - PyErr_Fetch(&err_type, &err_value, &err_tb); - - object= PyDict_GetItem(m_attr_dict, attr); - if (object) { - Py_INCREF(object); - - PyErr_Clear(); - Py_XDECREF( err_type ); - Py_XDECREF( err_value ); - Py_XDECREF( err_tb ); - } - else { - PyErr_Restore(err_type, err_value, err_tb); /* use the error from the parent function */ - } - } - return object; -} - -PyObject* KX_GameObject::py_getattro_dict() { - //py_getattro_dict_up(SCA_IObject); - PyObject *dict= py_getattr_dict(SCA_IObject::py_getattro_dict(), Type.tp_dict); - if(dict==NULL) - return NULL; - - /* normally just return this but KX_GameObject has some more items */ - - - /* Not super fast getting as a list then making into dict keys but its only for dir() */ - PyObject *list= ConvertKeysToPython(); - if(list) - { - int i; - for(i=0; i= 0x02060000) PyVarObject_HEAD_INIT(NULL, 0) @@ -297,20 +289,15 @@ PyTypeObject KX_LightObject::Type = { &KX_GameObject::Sequence, &KX_GameObject::Mapping, 0,0,0, - py_base_getattro, - py_base_setattro, + NULL, //py_base_getattro, + NULL, //py_base_setattro, 0, - Py_TPFLAGS_DEFAULT, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_LightObject::Parents[] = { - &KX_LightObject::Type, - &KX_GameObject::Type, - &SCA_IObject::Type, - &CValue::Type, - NULL + Methods, + 0, + 0, + &KX_GameObject::Type }; PyMethodDef KX_LightObject::Methods[] = { @@ -401,14 +388,3 @@ int KX_LightObject::pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attr return PY_SET_ATTR_SUCCESS; } - - -PyObject* KX_LightObject::py_getattro(PyObject *attr) -{ - py_getattro_up(KX_GameObject); -} - -int KX_LightObject::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(KX_GameObject); -} diff --git a/source/gameengine/Ketsji/KX_Light.h b/source/gameengine/Ketsji/KX_Light.h index 358c705080a..0b7ccbe81ab 100644 --- a/source/gameengine/Ketsji/KX_Light.h +++ b/source/gameengine/Ketsji/KX_Light.h @@ -49,7 +49,7 @@ protected: Scene* m_blenderscene; public: - KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,class RAS_IRenderTools* rendertools,const struct RAS_LightObject& lightobj, bool glsl, PyTypeObject *T = &Type); + KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,class RAS_IRenderTools* rendertools,const struct RAS_LightObject& lightobj, bool glsl); virtual ~KX_LightObject(); virtual CValue* GetReplica(); RAS_LightObject* GetLightData() { return &m_lightobj;} @@ -64,10 +64,6 @@ public: void BindShadowBuffer(class RAS_IRasterizer *ras, class KX_Camera *cam, class MT_Transform& camtrans); void UnbindShadowBuffer(class RAS_IRasterizer *ras); void Update(); - - virtual PyObject* py_getattro(PyObject *attr); /* lens, near, far, projection_matrix */ - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *pyvalue); /* attributes */ static PyObject* pyattr_get_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index 11effa1ca98..79aa887601a 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -63,17 +63,15 @@ PyTypeObject KX_MeshProxy::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_MeshProxy::Parents[] = { - &KX_MeshProxy::Type, - &CValue::Type, - &PyObjectPlus::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &CValue::Type }; PyMethodDef KX_MeshProxy::Methods[] = { @@ -106,24 +104,8 @@ void KX_MeshProxy::SetMeshModified(bool v) m_meshobj->SetMeshModified(v); } - -PyObject* KX_MeshProxy::py_getattro(PyObject *attr) -{ - py_getattro_up(CValue); -} - -PyObject* KX_MeshProxy::py_getattro_dict() { - py_getattro_dict_up(CValue); -} - -int KX_MeshProxy::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(CValue); -} - - KX_MeshProxy::KX_MeshProxy(RAS_MeshObject* mesh) - : CValue(&Type), m_meshobj(mesh) + : CValue(), m_meshobj(mesh) { } diff --git a/source/gameengine/Ketsji/KX_MeshProxy.h b/source/gameengine/Ketsji/KX_MeshProxy.h index bfdd4be4118..4b6543677ad 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.h +++ b/source/gameengine/Ketsji/KX_MeshProxy.h @@ -56,9 +56,6 @@ public: virtual CValue* GetReplica(); // stuff for python integration - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); KX_PYMETHOD(KX_MeshProxy,GetNumMaterials); // Deprecated KX_PYMETHOD(KX_MeshProxy,GetMaterialName); diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index fde10a493db..e38ec702acd 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -63,9 +63,8 @@ KX_MouseFocusSensor::KX_MouseFocusSensor(SCA_MouseManager* eventmgr, int focusmode, KX_Scene* kxscene, KX_KetsjiEngine *kxengine, - SCA_IObject* gameobj, - PyTypeObject* T) - : SCA_MouseSensor(eventmgr, startx, starty, mousemode, gameobj, T), + SCA_IObject* gameobj) + : SCA_MouseSensor(eventmgr, startx, starty, mousemode, gameobj), m_focusmode(focusmode), m_kxscene(kxscene), m_kxengine(kxengine) @@ -357,19 +356,15 @@ PyTypeObject KX_MouseFocusSensor::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_MouseFocusSensor::Parents[] = { - &KX_MouseFocusSensor::Type, - &SCA_MouseSensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_MouseSensor::Type }; PyMethodDef KX_MouseFocusSensor::Methods[] = { @@ -393,15 +388,6 @@ PyAttributeDef KX_MouseFocusSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_MouseFocusSensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_MouseSensor); -} - -PyObject* KX_MouseFocusSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_MouseSensor); -} - - const char KX_MouseFocusSensor::GetHitObject_doc[] = "getHitObject()\n" "\tReturns the object that was hit by this ray.\n"; diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h index 29d674eb305..dfada7a59cc 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h @@ -56,8 +56,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor int focusmode, KX_Scene* kxscene, KX_KetsjiEngine* kxengine, - SCA_IObject* gameobj, - PyTypeObject* T=&Type ); + SCA_IObject* gameobj); virtual ~KX_MouseFocusSensor() { ; }; virtual CValue* GetReplica() { @@ -89,8 +88,6 @@ class KX_MouseFocusSensor : public SCA_MouseSensor /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRayTarget); KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRaySource); diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp index 44842b7f5b3..64f6b9306a0 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.cpp +++ b/source/gameengine/Ketsji/KX_NearSensor.cpp @@ -48,15 +48,13 @@ KX_NearSensor::KX_NearSensor(SCA_EventManager* eventmgr, bool bFindMaterial, const STR_String& touchedpropname, class KX_Scene* scene, - PHY_IPhysicsController* ctrl, - PyTypeObject* T) + PHY_IPhysicsController* ctrl) :KX_TouchSensor(eventmgr, gameobj, bFindMaterial, false, - touchedpropname, - /* scene, */ - T), + touchedpropname + /*, scene */), m_Margin(margin), m_ResetMargin(resetmargin) @@ -273,25 +271,17 @@ PyTypeObject KX_NearSensor::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject KX_NearSensor::Parents[] = { - &KX_NearSensor::Type, - &KX_TouchSensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &KX_TouchSensor::Type }; - - PyMethodDef KX_NearSensor::Methods[] = { //No methods {NULL,NULL} //Sentinel @@ -302,18 +292,3 @@ PyAttributeDef KX_NearSensor::Attributes[] = { KX_PYATTRIBUTE_FLOAT_RW_CHECK("resetDistance", 0, 100, KX_NearSensor, m_ResetMargin, CheckResetDistance), {NULL} //Sentinel }; - - -PyObject* KX_NearSensor::py_getattro(PyObject *attr) -{ - py_getattro_up(KX_TouchSensor); -} - -PyObject* KX_NearSensor::py_getattro_dict() { - py_getattro_dict_up(KX_TouchSensor); -} - -int KX_NearSensor::py_setattro(PyObject*attr, PyObject* value) -{ - py_setattro_up(KX_TouchSensor); -} diff --git a/source/gameengine/Ketsji/KX_NearSensor.h b/source/gameengine/Ketsji/KX_NearSensor.h index 63099e181a0..f3c1d74805c 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.h +++ b/source/gameengine/Ketsji/KX_NearSensor.h @@ -54,8 +54,7 @@ public: bool bFindMaterial, const STR_String& touchedpropname, class KX_Scene* scene, - PHY_IPhysicsController* ctrl, - PyTypeObject* T=&Type); + PHY_IPhysicsController* ctrl); /* public: KX_NearSensor(class SCA_EventManager* eventmgr, @@ -64,8 +63,7 @@ public: double resetmargin, bool bFindMaterial, const STR_String& touchedpropname, - class KX_Scene* scene, - PyTypeObject* T=&Type); + class KX_Scene* scene); */ virtual ~KX_NearSensor(); virtual void SynchronizeTransform(); @@ -83,9 +81,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); //No methods diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 62e61667c56..15e82581bc6 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -53,10 +53,9 @@ KX_ObjectActuator( const MT_Vector3& linV, const MT_Vector3& angV, const short damping, - const KX_LocalFlags& flag, - PyTypeObject* T + const KX_LocalFlags& flag ) : - SCA_IActuator(gameobj,T), + SCA_IActuator(gameobj), m_force(force), m_torque(torque), m_dloc(dloc), @@ -343,18 +342,15 @@ PyTypeObject KX_ObjectActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_ObjectActuator::Parents[] = { - &KX_ObjectActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; PyMethodDef KX_ObjectActuator::Methods[] = { @@ -414,20 +410,6 @@ PyAttributeDef KX_ObjectActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_ObjectActuator::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IActuator); -} - - -PyObject* KX_ObjectActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_ObjectActuator::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_IActuator); -} - /* Attribute get/set functions */ #ifdef USE_MATHUTILS diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h index 6ca442b2ec2..20aec9e0e86 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.h +++ b/source/gameengine/Ketsji/KX_ObjectActuator.h @@ -135,8 +135,7 @@ public: const MT_Vector3& linV, const MT_Vector3& angV, const short damping, - const KX_LocalFlags& flag, - PyTypeObject* T=&Type + const KX_LocalFlags& flag ); ~KX_ObjectActuator(); CValue* GetReplica(); @@ -163,10 +162,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForce); KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForce); diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index cd2ed456c48..a68bafc4d86 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -50,9 +50,8 @@ KX_ParentActuator::KX_ParentActuator(SCA_IObject *gameobj, int mode, bool addToCompound, bool ghost, - SCA_IObject *ob, - PyTypeObject* T) - : SCA_IActuator(gameobj, T), + SCA_IObject *ob) + : SCA_IActuator(gameobj), m_mode(mode), m_addToCompound(addToCompound), m_ghost(ghost), @@ -158,18 +157,15 @@ PyTypeObject KX_ParentActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_ParentActuator::Parents[] = { - &KX_ParentActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; PyMethodDef KX_ParentActuator::Methods[] = { @@ -217,18 +213,6 @@ int KX_ParentActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUTE } -PyObject* KX_ParentActuator::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_ParentActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_ParentActuator::py_setattro(PyObject *attr, PyObject* value) { - py_setattro_up(SCA_IActuator); -} - /* Deprecated -----> */ /* 1. setObject */ const char KX_ParentActuator::SetObject_doc[] = diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h index 148375e994c..aeb39eabf89 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.h +++ b/source/gameengine/Ketsji/KX_ParentActuator.h @@ -68,8 +68,7 @@ class KX_ParentActuator : public SCA_IActuator int mode, bool addToCompound, bool ghost, - SCA_IObject *ob, - PyTypeObject* T=&Type); + SCA_IObject *ob); virtual ~KX_ParentActuator(); virtual bool Update(); @@ -82,10 +81,6 @@ class KX_ParentActuator : public SCA_IActuator /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); - /* These are used to get and set m_ob */ static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp index c968e50957e..fb6bc8b898d 100644 --- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp +++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp @@ -39,8 +39,8 @@ KX_PhysicsObjectWrapper::KX_PhysicsObjectWrapper( PHY_IPhysicsController* ctrl, - PHY_IPhysicsEnvironment* physenv,PyTypeObject *T) : - PyObjectPlus(T), + PHY_IPhysicsEnvironment* physenv) : + PyObjectPlus(), m_ctrl(ctrl), m_physenv(physenv) { @@ -130,45 +130,17 @@ PyTypeObject KX_PhysicsObjectWrapper::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_PhysicsObjectWrapper::Parents[] = { - &KX_PhysicsObjectWrapper::Type, - NULL -}; - -PyObject* KX_PhysicsObjectWrapper::py_getattro(PyObject *attr) -{ - py_getattro_up(PyObjectPlus); -} - -PyObject* KX_PhysicsObjectWrapper::py_getattro_dict() { - py_getattro_dict_up(PyObjectPlus); -} - -int KX_PhysicsObjectWrapper::py_setattro(PyObject *attr,PyObject *pyobj) -{ - int result = 1; - - if (PyInt_Check(pyobj)) - { - result = 0; - } - if (PyString_Check(pyobj)) - { - result = 0; - } - if (result) - result = PyObjectPlus::py_setattro(attr,pyobj); - - return result; + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &PyObjectPlus::Type }; - PyMethodDef KX_PhysicsObjectWrapper::Methods[] = { {"setPosition",(PyCFunction) KX_PhysicsObjectWrapper::sPySetPosition, METH_VARARGS}, {"setLinearVelocity",(PyCFunction) KX_PhysicsObjectWrapper::sPySetLinearVelocity, METH_VARARGS}, diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h index 1b59686babc..fa6fd1d1f2a 100644 --- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h +++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h @@ -35,12 +35,8 @@ class KX_PhysicsObjectWrapper : public PyObjectPlus { Py_Header; - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); public: - KX_PhysicsObjectWrapper(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsEnvironment* physenv,PyTypeObject *T = &Type); + KX_PhysicsObjectWrapper(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsEnvironment* physenv); virtual ~KX_PhysicsObjectWrapper(); KX_PYMETHOD_VARARGS(KX_PhysicsObjectWrapper,SetPosition); diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index b56b5500c39..babead25274 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -56,17 +56,15 @@ PyTypeObject KX_PolyProxy::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_PolyProxy::Parents[] = { - &KX_PolyProxy::Type, - &CValue::Type, - &PyObjectPlus::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &CValue::Type }; PyMethodDef KX_PolyProxy::Methods[] = { @@ -98,6 +96,7 @@ PyAttributeDef KX_PolyProxy::Attributes[] = { { NULL } //Sentinel }; +#if 0 PyObject* KX_PolyProxy::py_getattro(PyObject *attr) { char *attr_str= PyString_AsString(attr); @@ -162,12 +161,9 @@ PyObject* KX_PolyProxy::py_getattro(PyObject *attr) { return PyInt_FromLong(m_polygon->IsCollider()); } - py_getattro_up(CValue); -} - -PyObject* KX_PolyProxy::py_getattro_dict() { - py_getattro_dict_up(CValue); + // py_getattro_up(CValue); // XXX -- todo, make all these attributes } +#endif KX_PolyProxy::KX_PolyProxy(const RAS_MeshObject*mesh, RAS_Polygon* polygon) : m_polygon(polygon), diff --git a/source/gameengine/Ketsji/KX_PolyProxy.h b/source/gameengine/Ketsji/KX_PolyProxy.h index d8fd36fec6c..e619617d312 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.h +++ b/source/gameengine/Ketsji/KX_PolyProxy.h @@ -52,8 +52,6 @@ public: // stuff for python integration - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getMaterialIndex) KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getNumVertex) diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index 506c167a905..8d8492cc062 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -51,8 +51,8 @@ #include "KX_PyMath.h" -KX_PolygonMaterial::KX_PolygonMaterial(PyTypeObject *T) - : PyObjectPlus(T), +KX_PolygonMaterial::KX_PolygonMaterial() + : PyObjectPlus(), RAS_IPolyMaterial(), m_tface(NULL), @@ -256,32 +256,17 @@ PyTypeObject KX_PolygonMaterial::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_PolygonMaterial::Parents[] = { - &KX_PolygonMaterial::Type, - &PyObjectPlus::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &PyObjectPlus::Type }; -PyObject* KX_PolygonMaterial::py_getattro(PyObject *attr) -{ - py_getattro_up(PyObjectPlus); -} - -PyObject* KX_PolygonMaterial::py_getattro_dict() { - py_getattro_dict_up(PyObjectPlus); -} - -int KX_PolygonMaterial::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(PyObjectPlus); -} - KX_PYMETHODDEF_DOC(KX_PolygonMaterial, setCustomMaterial, "setCustomMaterial(material)") { PyObject *material; diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index 89ecb026da9..481c429f658 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -57,7 +57,7 @@ private: mutable int m_pass; public: - KX_PolygonMaterial(PyTypeObject *T = &Type); + KX_PolygonMaterial(); void Initialize(const STR_String &texname, Material* ma, int materialindex, @@ -116,9 +116,6 @@ public: KX_PYMETHOD_DOC(KX_PolygonMaterial, setCustomMaterial); KX_PYMETHOD_DOC(KX_PolygonMaterial, loadProgram); - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *pyvalue); virtual PyObject* py_repr(void) { return PyString_FromString(m_material ? ((ID *)m_material)->name+2 : ""); } static PyObject* pyattr_get_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h index f37925bb0ab..4fd16089ee2 100644 --- a/source/gameengine/Ketsji/KX_PyMath.h +++ b/source/gameengine/Ketsji/KX_PyMath.h @@ -31,12 +31,6 @@ #ifndef __KX_PYMATH_H__ #define __KX_PYMATH_H__ -#ifdef USE_MATHUTILS -extern "C" { -#include "../../blender/python/generic/Mathutils.h" /* so we can have mathutils callbacks */ -} -#endif - #include "MT_Point2.h" #include "MT_Point3.h" #include "MT_Vector2.h" @@ -48,6 +42,12 @@ extern "C" { #include "KX_Python.h" #include "PyObjectPlus.h" +#ifdef USE_MATHUTILS +extern "C" { +#include "../../blender/python/generic/Mathutils.h" /* so we can have mathutils callbacks */ +} +#endif + inline unsigned int Size(const MT_Matrix4x4&) { return 4; } inline unsigned int Size(const MT_Matrix3x3&) { return 3; } inline unsigned int Size(const MT_Tuple2&) { return 2; } diff --git a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp index d5d0fe3123c..b7a573fd0d3 100644 --- a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp +++ b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp @@ -128,28 +128,62 @@ void initPyObjectPlusType(PyTypeObject **parents) } } +/* +typedef PyObject *(*getter)(PyObject *, void *); +typedef int (*setter)(PyObject *, PyObject *, void *); +*/ - - -static void PyType_Ready_ADD(PyObject *dict, PyTypeObject *tp, PyAttributeDef *attributes) +static void PyType_Ready_ADD(PyObject *dict, PyTypeObject *tp, PyAttributeDef *attributes, int init_getset) { PyAttributeDef *attr; - PyObject *item; - - PyType_Ready(tp); - PyDict_SetItemString(dict, tp->tp_name, reinterpret_cast(tp)); + + if(init_getset) { + /* we need to do this for all types before calling PyType_Ready + * since they will call the parents PyType_Ready and those might not have initialized vars yet */ + + //if(tp->tp_base==NULL) + // printf("Debug: No Parents - '%s'\n" , tp->tp_name); + + if(tp->tp_getset==NULL && attributes->m_name) { + PyGetSetDef *attr_getset; + int attr_tot= 0; + + for(attr= attributes; attr->m_name; attr++, attr_tot++) {}; + + tp->tp_getset = attr_getset = reinterpret_cast(PyMem_Malloc((attr_tot+1) * sizeof(PyGetSetDef))); // XXX - Todo, free + + + for(attr= attributes; attr->m_name; attr++, attr_getset++) { + attr_getset->name= (char *)attr->m_name; + attr_getset->doc= NULL; + + attr_getset->get= reinterpret_cast(PyObjectPlus::py_get_attrdef); + + if(attr->m_access==KX_PYATTRIBUTE_RO) + attr_getset->set= NULL; + else + attr_getset->set= reinterpret_cast(PyObjectPlus::py_set_attrdef); + + attr_getset->closure= reinterpret_cast(attr); + } + + memset(attr_getset, 0, sizeof(PyGetSetDef)); + } + + + return; + } else { - /* store attr defs in the tp_dict for to avoid string lookups */ - for(attr= attributes; attr->m_name; attr++) { - item= PyCObject_FromVoidPtr(attr, NULL); - PyDict_SetItemString(tp->tp_dict, attr->m_name, item); - Py_DECREF(item); + PyObject *item; + + PyType_Ready(tp); + PyDict_SetItemString(dict, tp->tp_name, reinterpret_cast(tp)); } } -#define PyType_Ready_Attr(d, n) PyType_Ready_ADD(d, &n::Type, n::Attributes) +#define PyType_Ready_Attr(d, n, i) PyType_Ready_ADD(d, &n::Type, n::Attributes, i) void initPyTypes(void) { @@ -165,70 +199,74 @@ void initPyTypes(void) PyDict_SetItemString(PySys_GetObject((char *)"modules"), (char *)"GameTypes", mod); Py_DECREF(mod); - PyType_Ready_Attr(dict, BL_ActionActuator); - PyType_Ready_Attr(dict, BL_Shader); - PyType_Ready_Attr(dict, BL_ShapeActionActuator); - PyType_Ready_Attr(dict, CListValue); - PyType_Ready_Attr(dict, CValue); - PyType_Ready_Attr(dict, KX_BlenderMaterial); - PyType_Ready_Attr(dict, KX_CDActuator); - PyType_Ready_Attr(dict, KX_Camera); - PyType_Ready_Attr(dict, KX_CameraActuator); - PyType_Ready_Attr(dict, KX_ConstraintActuator); - PyType_Ready_Attr(dict, KX_ConstraintWrapper); - PyType_Ready_Attr(dict, KX_GameActuator); - PyType_Ready_Attr(dict, KX_GameObject); - PyType_Ready_Attr(dict, KX_IpoActuator); - PyType_Ready_Attr(dict, KX_LightObject); - PyType_Ready_Attr(dict, KX_MeshProxy); - PyType_Ready_Attr(dict, KX_MouseFocusSensor); - PyType_Ready_Attr(dict, KX_NearSensor); - PyType_Ready_Attr(dict, KX_NetworkMessageActuator); - PyType_Ready_Attr(dict, KX_NetworkMessageSensor); - PyType_Ready_Attr(dict, KX_ObjectActuator); - PyType_Ready_Attr(dict, KX_ParentActuator); - PyType_Ready_Attr(dict, KX_PhysicsObjectWrapper); - PyType_Ready_Attr(dict, KX_PolyProxy); - PyType_Ready_Attr(dict, KX_PolygonMaterial); - PyType_Ready_Attr(dict, KX_RadarSensor); - PyType_Ready_Attr(dict, KX_RaySensor); - PyType_Ready_Attr(dict, KX_SCA_AddObjectActuator); - PyType_Ready_Attr(dict, KX_SCA_DynamicActuator); - PyType_Ready_Attr(dict, KX_SCA_EndObjectActuator); - PyType_Ready_Attr(dict, KX_SCA_ReplaceMeshActuator); - PyType_Ready_Attr(dict, KX_Scene); - PyType_Ready_Attr(dict, KX_SceneActuator); - PyType_Ready_Attr(dict, KX_SoundActuator); - PyType_Ready_Attr(dict, KX_StateActuator); - PyType_Ready_Attr(dict, KX_TouchSensor); - PyType_Ready_Attr(dict, KX_TrackToActuator); - PyType_Ready_Attr(dict, KX_VehicleWrapper); - PyType_Ready_Attr(dict, KX_VertexProxy); - PyType_Ready_Attr(dict, KX_VisibilityActuator); - PyType_Ready_Attr(dict, PyObjectPlus); - PyType_Ready_Attr(dict, SCA_2DFilterActuator); - PyType_Ready_Attr(dict, SCA_ANDController); - PyType_Ready_Attr(dict, SCA_ActuatorSensor); - PyType_Ready_Attr(dict, SCA_AlwaysSensor); - PyType_Ready_Attr(dict, SCA_DelaySensor); - PyType_Ready_Attr(dict, SCA_ILogicBrick); - PyType_Ready_Attr(dict, SCA_IObject); - PyType_Ready_Attr(dict, SCA_ISensor); - PyType_Ready_Attr(dict, SCA_JoystickSensor); - PyType_Ready_Attr(dict, SCA_KeyboardSensor); - PyType_Ready_Attr(dict, SCA_MouseSensor); - PyType_Ready_Attr(dict, SCA_NANDController); - PyType_Ready_Attr(dict, SCA_NORController); - PyType_Ready_Attr(dict, SCA_ORController); - PyType_Ready_Attr(dict, SCA_PropertyActuator); - PyType_Ready_Attr(dict, SCA_PropertySensor); - PyType_Ready_Attr(dict, SCA_PythonController); - PyType_Ready_Attr(dict, SCA_RandomActuator); - PyType_Ready_Attr(dict, SCA_RandomSensor); - PyType_Ready_Attr(dict, SCA_XNORController); - PyType_Ready_Attr(dict, SCA_XORController); - PyType_Ready_Attr(dict, SCA_IController); + for(int init_getset= 1; init_getset > -1; init_getset--) { /* run twice, once to init the getsets another to run PyType_Ready */ + PyType_Ready_Attr(dict, BL_ActionActuator, init_getset); + PyType_Ready_Attr(dict, BL_Shader, init_getset); + PyType_Ready_Attr(dict, BL_ShapeActionActuator, init_getset); + PyType_Ready_Attr(dict, CListValue, init_getset); + PyType_Ready_Attr(dict, CValue, init_getset); + PyType_Ready_Attr(dict, KX_BlenderMaterial, init_getset); + PyType_Ready_Attr(dict, KX_CDActuator, init_getset); + PyType_Ready_Attr(dict, KX_Camera, init_getset); + PyType_Ready_Attr(dict, KX_CameraActuator, init_getset); + PyType_Ready_Attr(dict, KX_ConstraintActuator, init_getset); + PyType_Ready_Attr(dict, KX_ConstraintWrapper, init_getset); + PyType_Ready_Attr(dict, KX_GameActuator, init_getset); + PyType_Ready_Attr(dict, KX_GameObject, init_getset); + PyType_Ready_Attr(dict, KX_IpoActuator, init_getset); + PyType_Ready_Attr(dict, KX_LightObject, init_getset); + PyType_Ready_Attr(dict, KX_MeshProxy, init_getset); + PyType_Ready_Attr(dict, KX_MouseFocusSensor, init_getset); + PyType_Ready_Attr(dict, KX_NearSensor, init_getset); + PyType_Ready_Attr(dict, KX_NetworkMessageActuator, init_getset); + PyType_Ready_Attr(dict, KX_NetworkMessageSensor, init_getset); + PyType_Ready_Attr(dict, KX_ObjectActuator, init_getset); + PyType_Ready_Attr(dict, KX_ParentActuator, init_getset); + PyType_Ready_Attr(dict, KX_PhysicsObjectWrapper, init_getset); + PyType_Ready_Attr(dict, KX_PolyProxy, init_getset); + PyType_Ready_Attr(dict, KX_PolygonMaterial, init_getset); + PyType_Ready_Attr(dict, KX_RadarSensor, init_getset); + PyType_Ready_Attr(dict, KX_RaySensor, init_getset); + PyType_Ready_Attr(dict, KX_SCA_AddObjectActuator, init_getset); + PyType_Ready_Attr(dict, KX_SCA_DynamicActuator, init_getset); + PyType_Ready_Attr(dict, KX_SCA_EndObjectActuator, init_getset); + PyType_Ready_Attr(dict, KX_SCA_ReplaceMeshActuator, init_getset); + PyType_Ready_Attr(dict, KX_Scene, init_getset); + PyType_Ready_Attr(dict, KX_SceneActuator, init_getset); + PyType_Ready_Attr(dict, KX_SoundActuator, init_getset); + PyType_Ready_Attr(dict, KX_StateActuator, init_getset); + PyType_Ready_Attr(dict, KX_TouchSensor, init_getset); + PyType_Ready_Attr(dict, KX_TrackToActuator, init_getset); + PyType_Ready_Attr(dict, KX_VehicleWrapper, init_getset); + PyType_Ready_Attr(dict, KX_VertexProxy, init_getset); + PyType_Ready_Attr(dict, KX_VisibilityActuator, init_getset); + PyType_Ready_Attr(dict, PyObjectPlus, init_getset); + PyType_Ready_Attr(dict, SCA_2DFilterActuator, init_getset); + PyType_Ready_Attr(dict, SCA_ANDController, init_getset); + PyType_Ready_Attr(dict, SCA_ActuatorSensor, init_getset); + PyType_Ready_Attr(dict, SCA_AlwaysSensor, init_getset); + PyType_Ready_Attr(dict, SCA_DelaySensor, init_getset); + PyType_Ready_Attr(dict, SCA_ILogicBrick, init_getset); + PyType_Ready_Attr(dict, SCA_IObject, init_getset); + PyType_Ready_Attr(dict, SCA_ISensor, init_getset); + PyType_Ready_Attr(dict, SCA_JoystickSensor, init_getset); + PyType_Ready_Attr(dict, SCA_KeyboardSensor, init_getset); + PyType_Ready_Attr(dict, SCA_MouseSensor, init_getset); + PyType_Ready_Attr(dict, SCA_NANDController, init_getset); + PyType_Ready_Attr(dict, SCA_NORController, init_getset); + PyType_Ready_Attr(dict, SCA_ORController, init_getset); + PyType_Ready_Attr(dict, SCA_PropertyActuator, init_getset); + PyType_Ready_Attr(dict, SCA_PropertySensor, init_getset); + PyType_Ready_Attr(dict, SCA_PythonController, init_getset); + PyType_Ready_Attr(dict, SCA_RandomActuator, init_getset); + PyType_Ready_Attr(dict, SCA_RandomSensor, init_getset); + PyType_Ready_Attr(dict, SCA_XNORController, init_getset); + PyType_Ready_Attr(dict, SCA_XORController, init_getset); + PyType_Ready_Attr(dict, SCA_IController, init_getset); + } + + /* Normal python type */ PyType_Ready(&KX_PythonSeq_Type); diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index 064dc9126ac..3423fec99e0 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -49,8 +49,7 @@ KX_RadarSensor::KX_RadarSensor(SCA_EventManager* eventmgr, double resetmargin, bool bFindMaterial, const STR_String& touchedpropname, - class KX_Scene* kxscene, - PyTypeObject* T) + class KX_Scene* kxscene) : KX_NearSensor( eventmgr, @@ -61,8 +60,8 @@ KX_RadarSensor::KX_RadarSensor(SCA_EventManager* eventmgr, bFindMaterial, touchedpropname, kxscene, - physCtrl, - T), + physCtrl), + m_coneradius(coneradius), m_coneheight(coneheight), m_axis(axis) @@ -246,20 +245,15 @@ PyTypeObject KX_RadarSensor::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_RadarSensor::Parents[] = { - &KX_RadarSensor::Type, - &KX_NearSensor::Type, - &KX_TouchSensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &KX_NearSensor::Type }; PyMethodDef KX_RadarSensor::Methods[] = { @@ -283,16 +277,3 @@ PyAttributeDef KX_RadarSensor::Attributes[] = { {NULL} //Sentinel }; -PyObject* KX_RadarSensor::py_getattro(PyObject *attr) -{ - py_getattro_up(KX_NearSensor); -} - -PyObject* KX_RadarSensor::py_getattro_dict() { - py_getattro_dict_up(KX_NearSensor); -} - -int KX_RadarSensor::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(KX_NearSensor); -} diff --git a/source/gameengine/Ketsji/KX_RadarSensor.h b/source/gameengine/Ketsji/KX_RadarSensor.h index 2e5a0e68bed..344be0e399f 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.h +++ b/source/gameengine/Ketsji/KX_RadarSensor.h @@ -70,8 +70,7 @@ public: double resetmargin, bool bFindMaterial, const STR_String& touchedpropname, - class KX_Scene* kxscene, - PyTypeObject* T = &Type); + class KX_Scene* kxscene); KX_RadarSensor(); virtual ~KX_RadarSensor(); virtual void SynchronizeTransform(); @@ -89,9 +88,7 @@ public: KX_RADAR_AXIS_NEG_Z }; - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); + /* python */ virtual sensortype GetSensorType() { return ST_RADAR; } //Deprecated -----> diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index 78a61e9d95e..ebdef526eae 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -55,9 +55,8 @@ KX_RaySensor::KX_RaySensor(class SCA_EventManager* eventmgr, bool bXRay, double distance, int axis, - KX_Scene* ketsjiScene, - PyTypeObject* T) - : SCA_ISensor(gameobj,eventmgr, T), + KX_Scene* ketsjiScene) + : SCA_ISensor(gameobj,eventmgr), m_propertyname(propname), m_bFindMaterial(bFindMaterial), m_bXRay(bXRay), @@ -337,19 +336,16 @@ PyTypeObject KX_RaySensor::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods - -}; + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_ISensor::Type -PyParentObject KX_RaySensor::Parents[] = { - &KX_RaySensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL }; PyMethodDef KX_RaySensor::Methods[] = { @@ -447,18 +443,4 @@ PyObject* KX_RaySensor::PyGetHitNormal() return retVal; } - - -PyObject* KX_RaySensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_ISensor); -} - -PyObject* KX_RaySensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int KX_RaySensor::py_setattro(PyObject *attr, PyObject *value) { - py_setattro_up(SCA_ISensor); -} - // <----- Deprecated diff --git a/source/gameengine/Ketsji/KX_RaySensor.h b/source/gameengine/Ketsji/KX_RaySensor.h index 9efb046742f..530c8ce54e5 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.h +++ b/source/gameengine/Ketsji/KX_RaySensor.h @@ -62,8 +62,7 @@ public: bool bXRay, double distance, int axis, - class KX_Scene* ketsjiScene, - PyTypeObject* T = &Type); + class KX_Scene* ketsjiScene); virtual ~KX_RaySensor(); virtual CValue* GetReplica(); @@ -84,11 +83,6 @@ public: KX_RAY_AXIS_NEG_Y, KX_RAY_AXIS_NEG_Z }; - - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); // Deprecated -----> KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetHitObject); diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index 75435b97797..2a4ae3a2abd 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -55,10 +55,9 @@ KX_SCA_AddObjectActuator::KX_SCA_AddObjectActuator(SCA_IObject *gameobj, const float *linvel, bool linv_local, const float *angvel, - bool angv_local, - PyTypeObject* T) + bool angv_local) : - SCA_IActuator(gameobj, T), + SCA_IActuator(gameobj), m_OriginalObject(original), m_scene(scene), @@ -188,19 +187,17 @@ PyTypeObject KX_SCA_AddObjectActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; -PyParentObject KX_SCA_AddObjectActuator::Parents[] = { - &KX_SCA_AddObjectActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL -}; PyMethodDef KX_SCA_AddObjectActuator::Methods[] = { // ---> deprecated {"setTime", (PyCFunction) KX_SCA_AddObjectActuator::sPySetTime, METH_O, (PY_METHODCHAR)SetTime_doc}, @@ -263,21 +260,6 @@ PyObject* KX_SCA_AddObjectActuator::pyattr_get_objectLastCreated(void *self, con return actuator->m_lastCreatedObject->GetProxy(); } - -PyObject* KX_SCA_AddObjectActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_SCA_AddObjectActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_SCA_AddObjectActuator::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(SCA_IActuator); -} - /* 1. setObject */ const char KX_SCA_AddObjectActuator::SetObject_doc[] = "setObject(object)\n" diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h index 6746b7d1bc6..3151e7a89ca 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h @@ -88,8 +88,7 @@ public: const float *linvel, bool linv_local, const float *angvel, - bool angv_local, - PyTypeObject* T=&Type + bool angv_local ); ~KX_SCA_AddObjectActuator(void); @@ -110,10 +109,6 @@ public: virtual bool Update(); - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); - SCA_IObject* GetLastCreatedObject( ) const ; diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp index a50764a54e6..8626512fdf3 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp @@ -47,9 +47,7 @@ /* Integration hooks ------------------------------------------------------- */ - PyTypeObject - -KX_SCA_DynamicActuator::Type = { +PyTypeObject KX_SCA_DynamicActuator::Type = { #if (PY_VERSION_HEX >= 0x02060000) PyVarObject_HEAD_INIT(NULL, 0) #else @@ -67,21 +65,17 @@ KX_SCA_DynamicActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_SCA_DynamicActuator::Parents[] = { - &KX_SCA_DynamicActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; - PyMethodDef KX_SCA_DynamicActuator::Methods[] = { // ---> deprecated KX_PYMETHODTABLE(KX_SCA_DynamicActuator, setOperation), @@ -96,21 +90,6 @@ PyAttributeDef KX_SCA_DynamicActuator::Attributes[] = { }; -PyObject* KX_SCA_DynamicActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_SCA_DynamicActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_SCA_DynamicActuator::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(SCA_IActuator); -} - - /* 1. setOperation */ KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, setOperation, "setOperation(operation?)\n" @@ -152,10 +131,9 @@ KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, getOperation, KX_SCA_DynamicActuator::KX_SCA_DynamicActuator(SCA_IObject *gameobj, short dyn_operation, - float setmass, - PyTypeObject* T) : + float setmass) : - SCA_IActuator(gameobj, T), + SCA_IActuator(gameobj), m_dyn_operation(dyn_operation), m_setmass(setmass) { diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h index 4add707f8cd..8b598c9ecfa 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h @@ -50,8 +50,7 @@ class KX_SCA_DynamicActuator : public SCA_IActuator KX_SCA_DynamicActuator( SCA_IObject* gameobj, short dyn_operation, - float setmass, - PyTypeObject* T=&Type + float setmass ); ~KX_SCA_DynamicActuator( @@ -73,11 +72,6 @@ class KX_SCA_DynamicActuator : public SCA_IActuator KX_DYN_SET_MASS, }; - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - /* 1. setOperation */ KX_PYMETHOD_DOC(KX_SCA_DynamicActuator,setOperation); KX_PYMETHOD_DOC(KX_SCA_DynamicActuator,getOperation); diff --git a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp index 728254e7f48..bf1ada97b9e 100644 --- a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp @@ -43,9 +43,8 @@ #endif KX_SCA_EndObjectActuator::KX_SCA_EndObjectActuator(SCA_IObject *gameobj, - SCA_IScene* scene, - PyTypeObject* T): - SCA_IActuator(gameobj, T), + SCA_IScene* scene): + SCA_IActuator(gameobj), m_scene(scene) { // intentionally empty @@ -109,23 +108,17 @@ PyTypeObject KX_SCA_EndObjectActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - - -PyParentObject KX_SCA_EndObjectActuator::Parents[] = { - &KX_SCA_EndObjectActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; - - PyMethodDef KX_SCA_EndObjectActuator::Methods[] = { {NULL,NULL} //Sentinel }; @@ -134,13 +127,4 @@ PyAttributeDef KX_SCA_EndObjectActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_SCA_EndObjectActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_SCA_EndObjectActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - /* eof */ diff --git a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h index 70d72f1f8da..782a24b1ef1 100644 --- a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h @@ -47,8 +47,7 @@ class KX_SCA_EndObjectActuator : public SCA_IActuator public: KX_SCA_EndObjectActuator( SCA_IObject* gameobj, - SCA_IScene* scene, - PyTypeObject* T=&Type + SCA_IScene* scene ); ~KX_SCA_EndObjectActuator(); @@ -63,9 +62,6 @@ class KX_SCA_EndObjectActuator : public SCA_IActuator /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); }; /* end of class KX_EditObjectActuator : public SCA_PropertyActuator */ diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp index 00842d7012a..873272a37f9 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp @@ -50,9 +50,7 @@ /* Integration hooks ------------------------------------------------------- */ - PyTypeObject - -KX_SCA_ReplaceMeshActuator::Type = { +PyTypeObject KX_SCA_ReplaceMeshActuator::Type = { #if (PY_VERSION_HEX >= 0x02060000) PyVarObject_HEAD_INIT(NULL, 0) #else @@ -70,22 +68,17 @@ KX_SCA_ReplaceMeshActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_SCA_ReplaceMeshActuator::Parents[] = { - &KX_SCA_ReplaceMeshActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; - - PyMethodDef KX_SCA_ReplaceMeshActuator::Methods[] = { KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, instantReplaceMesh), // Deprecated -----> @@ -99,20 +92,6 @@ PyAttributeDef KX_SCA_ReplaceMeshActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_SCA_ReplaceMeshActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_SCA_ReplaceMeshActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_SCA_ReplaceMeshActuator::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(SCA_IActuator); -} - PyObject* KX_SCA_ReplaceMeshActuator::pyattr_get_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) { KX_SCA_ReplaceMeshActuator* actuator = static_cast(self); @@ -178,10 +157,9 @@ KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, instantReplaceMesh, KX_SCA_ReplaceMeshActuator::KX_SCA_ReplaceMeshActuator(SCA_IObject *gameobj, class RAS_MeshObject *mesh, - SCA_IScene* scene, - PyTypeObject* T) : + SCA_IScene* scene) : - SCA_IActuator(gameobj, T), + SCA_IActuator(gameobj), m_mesh(mesh), m_scene(scene) { diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h index 0e7f7852701..6a68bd88cc5 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h @@ -55,9 +55,7 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator KX_SCA_ReplaceMeshActuator( SCA_IObject* gameobj, RAS_MeshObject *mesh, - SCA_IScene* scene, - PyTypeObject* T=&Type - ); + SCA_IScene* scene); ~KX_SCA_ReplaceMeshActuator( ); @@ -71,10 +69,7 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator void InstantReplaceMesh(); - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); - + /* python api */ static PyObject* pyattr_get_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index c0d8a7090c4..f2bbc8e6fef 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -138,7 +138,7 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice, class SND_IAudioDevice* adi, const STR_String& sceneName, Scene *scene): - PyObjectPlus(&KX_Scene::Type), + PyObjectPlus(), m_keyboardmgr(NULL), m_mousemgr(NULL), m_sceneConverter(NULL), @@ -1630,16 +1630,15 @@ PyTypeObject KX_Scene::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_Scene::Parents[] = { - &KX_Scene::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &CValue::Type }; PyMethodDef KX_Scene::Methods[] = { @@ -1730,72 +1729,6 @@ PyAttributeDef KX_Scene::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_Scene::py_getattro__internal(PyObject *attr) -{ - py_getattro_up(PyObjectPlus); -} - -int KX_Scene::py_setattro__internal(PyObject *attr, PyObject *value) -{ - py_setattro_up(PyObjectPlus); -} - -PyObject* KX_Scene::py_getattro(PyObject *attr) -{ - PyObject *object = py_getattro__internal(attr); - - if (object==NULL) - { - PyErr_Clear(); - object = PyDict_GetItem(m_attr_dict, attr); - if(object) { - Py_INCREF(object); - } - else { - PyErr_Format(PyExc_AttributeError, "value = scene.myAttr: KX_Scene, attribute \"%s\" not found", PyString_AsString(attr)); - } - } - - return object; -} - -PyObject* KX_Scene::py_getattro_dict() { - //py_getattro_dict_up(PyObjectPlus); - - PyObject *dict= py_getattr_dict(PyObjectPlus::py_getattro_dict(), Type.tp_dict); - if(dict==NULL) - return NULL; - - /* normally just return this but KX_Scene has some more items */ - - PyDict_Update(dict, m_attr_dict); - return dict; -} - -int KX_Scene::py_setattro(PyObject *attr, PyObject *value) -{ - int ret= py_setattro__internal(attr, value); - - if (ret==PY_SET_ATTR_MISSING) { - if (PyDict_SetItem(m_attr_dict, attr, value)==0) { - PyErr_Clear(); - ret= PY_SET_ATTR_SUCCESS; - } - else { - PyErr_SetString(PyExc_AttributeError, "scene.UserAttr = value: KX_Scenes, failed assigning value to internal dictionary"); - ret= PY_SET_ATTR_FAIL; - } - } - - return ret; -} - -int KX_Scene::py_delattro(PyObject *attr) -{ - PyDict_DelItem(m_attr_dict, attr); - return 0; -} - KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getLightList, "getLightList() -> list [KX_Light]\n" "Returns a list of all lights in the scene.\n" diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 79d3f7fd828..edc4297ff14 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -563,15 +563,7 @@ public: static PyObject* pyattr_get_active_camera(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); - virtual PyObject* py_getattro(PyObject *attr); /* name, active_camera, gravity, suspended, viewport, framing, activity_culling, activity_culling_radius */ - virtual PyObject* py_getattro_dict(); - - virtual int py_setattro(PyObject *attr, PyObject *value); - virtual int py_delattro(PyObject *attr); virtual PyObject* py_repr(void) { return PyString_FromString(GetName().ReadPtr()); } - - PyObject* py_getattro__internal(PyObject *attr); - int py_setattro__internal(PyObject *attr, PyObject *pyvalue); /** * Sets the time the scene was suspended diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index 1b790ec9824..16521f2ddcc 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -49,9 +49,8 @@ KX_SceneActuator::KX_SceneActuator(SCA_IObject *gameobj, KX_Scene *scene, KX_KetsjiEngine* ketsjiEngine, const STR_String& nextSceneName, - KX_Camera* camera, - PyTypeObject* T) - : SCA_IActuator(gameobj, T) + KX_Camera* camera) + : SCA_IActuator(gameobj) { m_mode = mode; m_scene = scene; @@ -134,7 +133,7 @@ bool KX_SceneActuator::Update() { // if no camera is set and the parent object is a camera, use it as the camera SCA_IObject* parent = GetParent(); - if (parent->isA(&KX_Camera::Type)) + if (parent->GetGameObjectType()==SCA_IObject::OBJ_CAMERA) { m_scene->SetActiveCamera((KX_Camera*)parent); } @@ -240,25 +239,17 @@ PyTypeObject KX_SceneActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject KX_SceneActuator::Parents[] = -{ - &KX_SceneActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; - - PyMethodDef KX_SceneActuator::Methods[] = { //Deprecated functions ------> @@ -280,20 +271,6 @@ PyAttributeDef KX_SceneActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_SceneActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_SceneActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_SceneActuator::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_IActuator); -} - PyObject* KX_SceneActuator::pyattr_get_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) { KX_SceneActuator* actuator = static_cast(self); diff --git a/source/gameengine/Ketsji/KX_SceneActuator.h b/source/gameengine/Ketsji/KX_SceneActuator.h index 2412dd02590..86de3395d1e 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.h +++ b/source/gameengine/Ketsji/KX_SceneActuator.h @@ -77,8 +77,7 @@ class KX_SceneActuator : public SCA_IActuator KX_Scene* scene, KX_KetsjiEngine* ketsjiEngine, const STR_String& nextSceneName, - KX_Camera* camera, - PyTypeObject* T=&Type); + KX_Camera* camera); virtual ~KX_SceneActuator(); virtual CValue* GetReplica(); @@ -92,10 +91,6 @@ class KX_SceneActuator : public SCA_IActuator /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - /* 1. set */ /* Removed */ diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index c13271f66a5..28e46cc9fa2 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -50,9 +50,8 @@ KX_SoundActuator::KX_SoundActuator(SCA_IObject* gameobj, SND_Scene* sndscene, KX_SOUNDACT_TYPE type, short start, - short end, - PyTypeObject* T) - : SCA_IActuator(gameobj,T) + short end) + : SCA_IActuator(gameobj) { m_soundObject = sndobj; m_soundScene = sndscene; @@ -251,24 +250,17 @@ PyTypeObject KX_SoundActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject KX_SoundActuator::Parents[] = { - &KX_SoundActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; - - PyMethodDef KX_SoundActuator::Methods[] = { // Deprecated -----> {"setFilename", (PyCFunction) KX_SoundActuator::sPySetFilename, METH_VARARGS,NULL}, @@ -340,18 +332,6 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, stopSound, } /* Atribute setting and getting -------------------------------------------- */ -PyObject* KX_SoundActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_SoundActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_SoundActuator::py_setattro(PyObject *attr, PyObject* value) { - py_setattro_up(SCA_IActuator); -} PyObject* KX_SoundActuator::pyattr_get_filename(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) { diff --git a/source/gameengine/Ketsji/KX_SoundActuator.h b/source/gameengine/Ketsji/KX_SoundActuator.h index a7491355667..adafee0a30b 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.h +++ b/source/gameengine/Ketsji/KX_SoundActuator.h @@ -66,8 +66,7 @@ public: class SND_Scene* sndscene, KX_SOUNDACT_TYPE type, short start, - short end, - PyTypeObject* T=&Type); + short end); ~KX_SoundActuator(); @@ -81,10 +80,6 @@ public: /* Python interface --------------------------------------------------- */ /* -------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); - KX_PYMETHOD_DOC_NOARGS(KX_SoundActuator, startSound); KX_PYMETHOD_DOC_NOARGS(KX_SoundActuator, pauseSound); KX_PYMETHOD_DOC_NOARGS(KX_SoundActuator, stopSound); diff --git a/source/gameengine/Ketsji/KX_StateActuator.cpp b/source/gameengine/Ketsji/KX_StateActuator.cpp index f6979eee0f4..ad21258a3b6 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.cpp +++ b/source/gameengine/Ketsji/KX_StateActuator.cpp @@ -38,10 +38,9 @@ KX_StateActuator::KX_StateActuator( SCA_IObject* gameobj, int operation, - unsigned int mask, - PyTypeObject* T + unsigned int mask ) - : SCA_IActuator(gameobj,T), + : SCA_IActuator(gameobj), m_operation(operation), m_mask(mask) { @@ -155,23 +154,18 @@ PyTypeObject KX_StateActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject -KX_StateActuator::Parents[] = { - &KX_StateActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; -PyMethodDef -KX_StateActuator::Methods[] = { +PyMethodDef KX_StateActuator::Methods[] = { // deprecated --> {"setOperation", (PyCFunction) KX_StateActuator::sPySetOperation, METH_VARARGS, (PY_METHODCHAR)SetOperation_doc}, @@ -187,20 +181,6 @@ PyAttributeDef KX_StateActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_StateActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_StateActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_StateActuator::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(SCA_IActuator); -} - /* set operation ---------------------------------------------------------- */ const char diff --git a/source/gameengine/Ketsji/KX_StateActuator.h b/source/gameengine/Ketsji/KX_StateActuator.h index a4191a4c5fd..ce86c4b44fe 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.h +++ b/source/gameengine/Ketsji/KX_StateActuator.h @@ -66,9 +66,8 @@ class KX_StateActuator : public SCA_IActuator KX_StateActuator( SCA_IObject* gameobj, int operation, - unsigned int mask, - PyTypeObject* T=&Type - ); + unsigned int mask + ); virtual ~KX_StateActuator( @@ -89,10 +88,6 @@ class KX_StateActuator : public SCA_IActuator /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); //KX_PYMETHOD_DOC KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetOperation); KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetMask); diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index c06acd4a873..8686de8f2ca 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -97,8 +97,8 @@ bool KX_TouchSensor::Evaluate() return result; } -KX_TouchSensor::KX_TouchSensor(SCA_EventManager* eventmgr,KX_GameObject* gameobj,bool bFindMaterial,bool bTouchPulse,const STR_String& touchedpropname,PyTypeObject* T) -:SCA_ISensor(gameobj,eventmgr,T), +KX_TouchSensor::KX_TouchSensor(SCA_EventManager* eventmgr,KX_GameObject* gameobj,bool bFindMaterial,bool bTouchPulse,const STR_String& touchedpropname) +:SCA_ISensor(gameobj,eventmgr), m_touchedpropname(touchedpropname), m_bFindMaterial(bFindMaterial), m_bTouchPulse(bTouchPulse), @@ -311,18 +311,15 @@ PyTypeObject KX_TouchSensor::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_TouchSensor::Parents[] = { - &KX_TouchSensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_ISensor::Type }; PyMethodDef KX_TouchSensor::Methods[] = { @@ -348,20 +345,6 @@ PyAttributeDef KX_TouchSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_TouchSensor::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_ISensor); -} - -PyObject* KX_TouchSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int KX_TouchSensor::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_ISensor); -} - /* Python API */ /* 1. setProperty */ diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index 476c63e89db..6cbf5b15e3b 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -79,8 +79,7 @@ public: class KX_GameObject* gameobj, bool bFindMaterial, bool bTouchPulse, - const STR_String& touchedpropname, - PyTypeObject* T=&Type) ; + const STR_String& touchedpropname) ; virtual ~KX_TouchSensor(); virtual CValue* GetReplica(); @@ -121,10 +120,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); //Deprecated -----> /* 1. setProperty */ diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index 5a50d0fb944..12f0137977a 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -59,10 +59,8 @@ KX_TrackToActuator::KX_TrackToActuator(SCA_IObject *gameobj, int time, bool allow3D, int trackflag, - int upflag, - PyTypeObject* T) - : - SCA_IActuator(gameobj, T) + int upflag) + : SCA_IActuator(gameobj) { m_time = time; m_allow3D = allow3D; @@ -74,7 +72,6 @@ KX_TrackToActuator::KX_TrackToActuator(SCA_IObject *gameobj, if (m_object) m_object->RegisterActuator(this); - if (gameobj->isA(&KX_GameObject::Type)) { // if the object is vertex parented, don't check parent orientation as the link is broken if (!((KX_GameObject*)gameobj)->IsVertexParent()){ @@ -451,24 +448,17 @@ PyTypeObject KX_TrackToActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject KX_TrackToActuator::Parents[] = { - &KX_TrackToActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; - - PyMethodDef KX_TrackToActuator::Methods[] = { // ---> deprecated {"setTime", (PyCFunction) KX_TrackToActuator::sPySetTime, METH_VARARGS, (PY_METHODCHAR)SetTime_doc}, @@ -518,20 +508,6 @@ int KX_TrackToActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUT } -PyObject* KX_TrackToActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_TrackToActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_TrackToActuator::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(SCA_IActuator); -} - /* 1. setObject */ const char KX_TrackToActuator::SetObject_doc[] = "setObject(object)\n" diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.h b/source/gameengine/Ketsji/KX_TrackToActuator.h index c4cc2b1f062..801e695bb9b 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.h +++ b/source/gameengine/Ketsji/KX_TrackToActuator.h @@ -56,7 +56,7 @@ class KX_TrackToActuator : public SCA_IActuator public: KX_TrackToActuator(SCA_IObject* gameobj, SCA_IObject *ob, int time, - bool threedee,int trackflag,int upflag, PyTypeObject* T=&Type); + bool threedee,int trackflag,int upflag); virtual ~KX_TrackToActuator(); virtual CValue* GetReplica() { KX_TrackToActuator* replica = new KX_TrackToActuator(*this); @@ -70,9 +70,6 @@ class KX_TrackToActuator : public SCA_IActuator virtual bool Update(double curtime, bool frame); /* Python part */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); /* These are used to get and set m_ob */ static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp index 8146d04a878..b742c9d145a 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp @@ -16,8 +16,8 @@ KX_VehicleWrapper::KX_VehicleWrapper( PHY_IVehicle* vehicle, - PHY_IPhysicsEnvironment* physenv,PyTypeObject *T) : - PyObjectPlus(T), + PHY_IPhysicsEnvironment* physenv) : + PyObjectPlus(), m_vehicle(vehicle), m_physenv(physenv) { @@ -290,34 +290,17 @@ PyTypeObject KX_VehicleWrapper::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_VehicleWrapper::Parents[] = { - &KX_VehicleWrapper::Type, - &PyObjectPlus::Type, - NULL -}; - -PyObject* KX_VehicleWrapper::py_getattro(PyObject *attr) -{ - //here you can search for existing data members (like mass,friction etc.) - py_getattro_up(PyObjectPlus); -} - -PyObject* KX_VehicleWrapper::py_getattro_dict() { - py_getattro_dict_up(PyObjectPlus); -} - -int KX_VehicleWrapper::py_setattro(PyObject *attr,PyObject* value) -{ - py_setattro_up(PyObjectPlus); + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &PyObjectPlus::Type }; - PyMethodDef KX_VehicleWrapper::Methods[] = { {"addWheel",(PyCFunction) KX_VehicleWrapper::sPyAddWheel, METH_VARARGS}, {"getNumWheels",(PyCFunction) KX_VehicleWrapper::sPyGetNumWheels, METH_VARARGS}, diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.h b/source/gameengine/Ketsji/KX_VehicleWrapper.h index c2b5e3d9251..d7f2da5cd7c 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.h +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.h @@ -12,14 +12,11 @@ class PHY_IMotionState; class KX_VehicleWrapper : public PyObjectPlus { Py_Header; - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); std::vector m_motionStates; public: - KX_VehicleWrapper(PHY_IVehicle* vehicle,class PHY_IPhysicsEnvironment* physenv,PyTypeObject *T = &Type); + KX_VehicleWrapper(PHY_IVehicle* vehicle,class PHY_IPhysicsEnvironment* physenv); virtual ~KX_VehicleWrapper (); int getConstraintId(); diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index 4b0ad083473..e4192bf7d67 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -54,17 +54,15 @@ PyTypeObject KX_VertexProxy::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_VertexProxy::Parents[] = { - &KX_VertexProxy::Type, - &CValue::Type, - &PyObjectPlus::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &CValue::Type }; PyMethodDef KX_VertexProxy::Methods[] = { @@ -85,33 +83,34 @@ PyMethodDef KX_VertexProxy::Methods[] = { PyAttributeDef KX_VertexProxy::Attributes[] = { //KX_PYATTRIBUTE_TODO("DummyProps"), - + KX_PYATTRIBUTE_DUMMY("x"), KX_PYATTRIBUTE_DUMMY("y"), KX_PYATTRIBUTE_DUMMY("z"), - + KX_PYATTRIBUTE_DUMMY("r"), KX_PYATTRIBUTE_DUMMY("g"), KX_PYATTRIBUTE_DUMMY("b"), KX_PYATTRIBUTE_DUMMY("a"), - + KX_PYATTRIBUTE_DUMMY("u"), KX_PYATTRIBUTE_DUMMY("v"), - + KX_PYATTRIBUTE_DUMMY("u2"), KX_PYATTRIBUTE_DUMMY("v2"), - + KX_PYATTRIBUTE_DUMMY("XYZ"), KX_PYATTRIBUTE_DUMMY("UV"), - + KX_PYATTRIBUTE_DUMMY("color"), KX_PYATTRIBUTE_DUMMY("colour"), - + KX_PYATTRIBUTE_DUMMY("normal"), - + { NULL } //Sentinel }; +#if 0 PyObject* KX_VertexProxy::py_getattro(PyObject *attr) { @@ -141,8 +140,8 @@ KX_VertexProxy::py_getattro(PyObject *attr) if (attr_str[0]=='v') return PyFloat_FromDouble(m_vertex->getUV1()[1]); } - - + + if (!strcmp(attr_str, "XYZ")) return PyObjectFrom(MT_Vector3(m_vertex->getXYZ())); @@ -156,19 +155,18 @@ KX_VertexProxy::py_getattro(PyObject *attr) color /= 255.0; return PyObjectFrom(color); } - + if (!strcmp(attr_str, "normal")) { return PyObjectFrom(MT_Vector3(m_vertex->getNormal())); } - + py_getattro_up(CValue); } +#endif -PyObject* KX_VertexProxy::py_getattro_dict() { - py_getattro_dict_up(CValue); -} +#if 0 int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) { char *attr_str= PyString_AsString(attr); @@ -185,7 +183,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) } return PY_SET_ATTR_FAIL; } - + if (!strcmp(attr_str, "UV")) { MT_Point2 vec; @@ -197,7 +195,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) } return PY_SET_ATTR_FAIL; } - + if (!strcmp(attr_str, "color") || !strcmp(attr_str, "colour")) { MT_Vector4 vec; @@ -209,7 +207,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) } return PY_SET_ATTR_FAIL; } - + if (!strcmp(attr_str, "normal")) { MT_Vector3 vec; @@ -222,7 +220,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) return PY_SET_ATTR_FAIL; } } - + if (PyFloat_Check(pyvalue)) { float val = PyFloat_AsDouble(pyvalue); @@ -235,7 +233,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) m_mesh->SetMeshModified(true); return PY_SET_ATTR_SUCCESS; } - + if (!strcmp(attr_str, "y")) { pos.y() = val; @@ -243,7 +241,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) m_mesh->SetMeshModified(true); return PY_SET_ATTR_SUCCESS; } - + if (!strcmp(attr_str, "z")) { pos.z() = val; @@ -251,7 +249,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) m_mesh->SetMeshModified(true); return PY_SET_ATTR_SUCCESS; } - + // uv MT_Point2 uv = m_vertex->getUV1(); if (!strcmp(attr_str, "u")) @@ -287,7 +285,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) m_mesh->SetMeshModified(true); return PY_SET_ATTR_SUCCESS; } - + // col unsigned int icol = *((const unsigned int *)m_vertex->getRGBA()); unsigned char *cp = (unsigned char*) &icol; @@ -321,9 +319,10 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) return PY_SET_ATTR_SUCCESS; } } - + return CValue::py_setattro(attr, pyvalue); } +#endif KX_VertexProxy::KX_VertexProxy(KX_MeshProxy*mesh, RAS_TexVert* vertex) : m_vertex(vertex), @@ -339,7 +338,7 @@ KX_VertexProxy::~KX_VertexProxy() // stuff for cvalue related things CValue* KX_VertexProxy::Calc(VALUE_OPERATOR, CValue *) { return NULL;} -CValue* KX_VertexProxy::CalcFinal(VALUE_DATA_TYPE, VALUE_OPERATOR, CValue *) { return NULL;} +CValue* KX_VertexProxy::CalcFinal(VALUE_DATA_TYPE, VALUE_OPERATOR, CValue *) { return NULL;} STR_String sVertexName="vertex"; const STR_String & KX_VertexProxy::GetText() {return sVertexName;}; double KX_VertexProxy::GetNumber() { return -1;} @@ -348,7 +347,7 @@ void KX_VertexProxy::SetName(const char *) { }; CValue* KX_VertexProxy::GetReplica() { return NULL;} // stuff for python integration - + PyObject* KX_VertexProxy::PyGetXYZ() { return PyObjectFrom(MT_Point3(m_vertex->getXYZ())); @@ -359,7 +358,7 @@ PyObject* KX_VertexProxy::PySetXYZ(PyObject* value) MT_Point3 vec; if (!PyVecTo(value, vec)) return NULL; - + m_vertex->SetXYZ(vec); m_mesh->SetMeshModified(true); Py_RETURN_NONE; @@ -375,7 +374,7 @@ PyObject* KX_VertexProxy::PySetNormal(PyObject* value) MT_Vector3 vec; if (!PyVecTo(value, vec)) return NULL; - + m_vertex->SetNormal(vec); m_mesh->SetMeshModified(true); Py_RETURN_NONE; @@ -396,7 +395,7 @@ PyObject* KX_VertexProxy::PySetRGBA(PyObject* value) m_mesh->SetMeshModified(true); Py_RETURN_NONE; } - else { + else { MT_Vector4 vec; if (PyVecTo(value, vec)) { @@ -405,7 +404,7 @@ PyObject* KX_VertexProxy::PySetRGBA(PyObject* value) Py_RETURN_NONE; } } - + PyErr_SetString(PyExc_TypeError, "vert.setRGBA(value): KX_VertexProxy, expected a 4D vector or an int"); return NULL; } @@ -421,7 +420,7 @@ PyObject* KX_VertexProxy::PySetUV(PyObject* value) MT_Point2 vec; if (!PyVecTo(value, vec)) return NULL; - + m_vertex->SetUV(vec); m_mesh->SetMeshModified(true); Py_RETURN_NONE; @@ -436,14 +435,14 @@ PyObject* KX_VertexProxy::PySetUV2(PyObject* args) { MT_Point2 vec; unsigned int unit= RAS_TexVert::SECOND_UV; - + PyObject* list= NULL; if(!PyArg_ParseTuple(args, "O|i:setUV2", &list, &unit)) return NULL; - + if (!PyVecTo(list, vec)) return NULL; - + m_vertex->SetFlag((m_vertex->getFlag()|RAS_TexVert::SECOND_UV)); m_vertex->SetUnit(unit); m_vertex->SetUV2(vec); diff --git a/source/gameengine/Ketsji/KX_VertexProxy.h b/source/gameengine/Ketsji/KX_VertexProxy.h index 42db5fbc322..13c57e9f556 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.h +++ b/source/gameengine/Ketsji/KX_VertexProxy.h @@ -53,9 +53,6 @@ public: // stuff for python integration - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *pyvalue); KX_PYMETHOD_NOARGS(KX_VertexProxy,GetXYZ); KX_PYMETHOD_O(KX_VertexProxy,SetXYZ); diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp index d848065ad73..260d764beec 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp @@ -39,10 +39,9 @@ KX_VisibilityActuator::KX_VisibilityActuator( SCA_IObject* gameobj, bool visible, bool occlusion, - bool recursive, - PyTypeObject* T + bool recursive ) - : SCA_IActuator(gameobj,T), + : SCA_IActuator(gameobj), m_visible(visible), m_occlusion(occlusion), m_recursive(recursive) @@ -109,24 +108,18 @@ PyTypeObject KX_VisibilityActuator::Type = { 0, py_base_repr, 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods - -}; - -PyParentObject -KX_VisibilityActuator::Parents[] = { - &KX_VisibilityActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + NULL, //py_base_getattro, + NULL, //py_base_setattro, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type }; -PyMethodDef -KX_VisibilityActuator::Methods[] = { +PyMethodDef KX_VisibilityActuator::Methods[] = { // Deprecated -----> {"set", (PyCFunction) KX_VisibilityActuator::sPySetVisible, METH_VARARGS, (PY_METHODCHAR) SetVisible_doc}, @@ -141,21 +134,6 @@ PyAttributeDef KX_VisibilityActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_VisibilityActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_VisibilityActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_VisibilityActuator::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_IActuator); -} - - /* set visibility ---------------------------------------------------------- */ const char KX_VisibilityActuator::SetVisible_doc[] = diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.h b/source/gameengine/Ketsji/KX_VisibilityActuator.h index 45aba50f645..3ad50c6cea2 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.h +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.h @@ -48,9 +48,7 @@ class KX_VisibilityActuator : public SCA_IActuator SCA_IObject* gameobj, bool visible, bool occlusion, - bool recursive, - PyTypeObject* T=&Type - ); + bool recursive); virtual ~KX_VisibilityActuator( @@ -69,10 +67,6 @@ class KX_VisibilityActuator : public SCA_IActuator /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - // Deprecated -----> KX_PYMETHOD_DOC_VARARGS(KX_VisibilityActuator,SetVisible); // <----- -- cgit v1.2.3 From 8bf355533e9868f0c39f1e9330753d9da5810b83 Mon Sep 17 00:00:00 2001 From: Elia Sarti Date: Sun, 28 Jun 2009 11:37:45 +0000 Subject: Zeroing listbase result for context data collection get when no data is found. Caused crash for uninitialized pointers when getting collection data for editors not supporting that member, e.g. "deselect all" operator in non-3dview editors. --- source/blender/blenkernel/intern/context.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 90880e354ec..fbad585d9b7 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -358,6 +358,9 @@ static int ctx_data_collection_get(const bContext *C, const char *member, ListBa return 1; } + list->first= NULL; + list->last= NULL; + return 0; } -- cgit v1.2.3 From 7d88981a24e16c9ddd5d882183d9421e7ce90d23 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 28 Jun 2009 12:30:50 +0000 Subject: 2.5 Menu usage: enabled arrow-key based browsing, especially for open and close sublevels. Only thing missing is to prevent sublevel to open on creating menu (like SHIFT+A now), this is design conflict in code. (It sends fake mouse move events causing it) Implementation note; the 'auto open sublevel' feature gets triggered with new state var, that checks if mouse was used or not. Also: on render in editmode, editmode result gets stored, as usual for 2.4x. --- .../blender/editors/interface/interface_handlers.c | 21 +++++++++++++++++---- source/blender/editors/screen/screen_ops.c | 5 ++++- 2 files changed, 21 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 5049fc0b130..92c888ac772 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -112,6 +112,9 @@ typedef struct uiHandleButtonData { /* tooltip */ ARegion *tooltip; wmTimer *tooltiptimer; + + /* auto open */ + int used_mouse; wmTimer *autoopentimer; /* text selection/editing */ @@ -3344,7 +3347,7 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s /* automatic open pulldown block timer */ if(ELEM3(but->type, BLOCK, PULLDOWN, ICONTEXTROW)) { - if(!data->autoopentimer) { + if(data->used_mouse && !data->autoopentimer) { int time; if(but->block->auto_open==2) time= 1; // test for toolbox @@ -3447,6 +3450,9 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA if(but->block->auto_open_last+BUTTON_AUTO_OPEN_THRESH < PIL_check_seconds_timer()) but->block->auto_open= 0; + if(type == BUTTON_ACTIVATE_OVER) { + data->used_mouse= 1; + } button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); if(type == BUTTON_ACTIVATE_OPEN) { @@ -3765,12 +3771,19 @@ static void ui_handle_button_return_submenu(bContext *C, wmEvent *event, uiBut * button_activate_exit(C, data, but, 1); } else if(menu->menuretval == UI_RETURN_OUT) { - if(ui_mouse_inside_button(data->region, but, event->x, event->y)) { + if(event->type==MOUSEMOVE && ui_mouse_inside_button(data->region, but, event->x, event->y)) { button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); } else { - data->cancel= 1; - button_activate_exit(C, data, but, 1); + but= ui_but_find_activated(data->region); + if(but) { + but->active->used_mouse= 0; + button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); + } + else { + data->cancel= 1; + button_activate_exit(C, data, but, 1); + } } } } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 2aa6758850e..dcfdfbf8285 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -59,6 +59,7 @@ #include "ED_util.h" #include "ED_screen.h" #include "ED_mesh.h" +#include "ED_object.h" #include "ED_screen_types.h" #include "RE_pipeline.h" @@ -2509,7 +2510,9 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) /* flush multires changes (for sculpt) */ multires_force_update(CTX_data_active_object(C)); - // get editmode results + /* get editmode results */ + ED_object_exit_editmode(C, 0); /* 0 = does not exit editmode */ + // store spare // get view3d layer, local layer, make this nice api call to render // store spare -- cgit v1.2.3 From 1b5851b4f963f32890ea7479ba410844bb906b5e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 28 Jun 2009 13:27:06 +0000 Subject: PyNumberMethods needed ifdefs for python3.x and some other corrections. --- source/blender/python/generic/BGL.c | 9 +++++-- source/blender/python/generic/Mathutils.c | 2 +- source/blender/python/generic/euler.c | 13 +++++++--- source/blender/python/generic/matrix.c | 41 ++++++++++++++++++++++++++++++ source/blender/python/generic/quat.c | 42 +++++++++++++++++++++++++++++-- source/blender/python/generic/vector.c | 40 +++++++++++++++++++++++++++++ 6 files changed, 139 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/python/generic/BGL.c b/source/blender/python/generic/BGL.c index a90fabd3586..de82781cf3a 100644 --- a/source/blender/python/generic/BGL.c +++ b/source/blender/python/generic/BGL.c @@ -83,8 +83,13 @@ static PyObject *Buffer_getattr( PyObject * self, char *name ); static PyObject *Buffer_repr( PyObject * self ); PyTypeObject buffer_Type = { - PyObject_HEAD_INIT( NULL ) /* required python macro */ - 0, /*ob_size */ +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "buffer", /*tp_name */ sizeof( Buffer ), /*tp_basicsize */ 0, /*tp_itemsize */ diff --git a/source/blender/python/generic/Mathutils.c b/source/blender/python/generic/Mathutils.c index ec94a48ddbd..ffb110376b0 100644 --- a/source/blender/python/generic/Mathutils.c +++ b/source/blender/python/generic/Mathutils.c @@ -1244,7 +1244,7 @@ PyObject *BaseMathObject_getOwner( BaseMathObject * self, void *type ) PyObject *BaseMathObject_getWrapped( BaseMathObject *self, void *type ) { - PyBool_FromLong((self->wrapped == Py_WRAP) ? 1:0); + return PyBool_FromLong((self->wrapped == Py_WRAP) ? 1:0); } void BaseMathObject_dealloc(BaseMathObject * self) diff --git a/source/blender/python/generic/euler.c b/source/blender/python/generic/euler.c index 9041eb84a3d..769c82ed034 100644 --- a/source/blender/python/generic/euler.c +++ b/source/blender/python/generic/euler.c @@ -65,7 +65,7 @@ static struct PyMethodDef Euler_methods[] = { //----------------------------------Mathutils.Euler() ------------------- //makes a new euler for you to play with -static PyObject *Euler_new(PyObject * self, PyObject * args) +static PyObject *Euler_new(PyObject * self, PyObject * args, PyObject * kwargs) { PyObject *listObject = NULL; @@ -173,8 +173,13 @@ static PyObject *Euler_Unique(EulerObject * self) heading = self->eul[0] * (float)Py_PI / 180; pitch = self->eul[1] * (float)Py_PI / 180; bank = self->eul[2] * (float)Py_PI / 180; +#else + heading = self->eul[0]; + pitch = self->eul[1]; + bank = self->eul[2]; #endif + //wrap heading in +180 / -180 pitch += Py_PI; pitch -= floor(pitch * Opi2) * pi2; @@ -271,8 +276,10 @@ static PyObject *Euler_Rotate(EulerObject * self, PyObject *args) static PyObject *Euler_MakeCompatible(EulerObject * self, EulerObject *value) { +#ifdef USE_MATHUTILS_DEG float eul_from_rad[3]; int x; +#endif if(!EulerObject_Check(value)) { PyErr_SetString(PyExc_TypeError, "euler.makeCompatible(euler):expected a single euler argument."); @@ -460,7 +467,7 @@ static int Euler_ass_slice(EulerObject * self, int begin, int end, PyObject *e; if(!BaseMath_ReadCallback(self)) - return NULL; + return -1; CLAMP(begin, 0, 3); if (end<0) end= 4+end; @@ -636,5 +643,5 @@ PyObject *newEulerObject_cb(PyObject *cb_user, int cb_type, int cb_subtype) self->cb_subtype= (unsigned char)cb_subtype; } - return self; + return (PyObject *)self; } diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c index b546aa1226c..311a14fbb0a 100644 --- a/source/blender/python/generic/matrix.c +++ b/source/blender/python/generic/matrix.c @@ -1012,6 +1012,46 @@ static PySequenceMethods Matrix_SeqMethods = { (ssizeobjargproc) Matrix_ass_item, /* sq_ass_item */ (ssizessizeobjargproc) Matrix_ass_slice, /* sq_ass_slice */ }; + + +#if (PY_VERSION_HEX >= 0x03000000) +static PyNumberMethods Matrix_NumMethods = { + (binaryfunc) Matrix_add, /*nb_add*/ + (binaryfunc) Matrix_sub, /*nb_subtract*/ + (binaryfunc) Matrix_mul, /*nb_multiply*/ + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + (unaryfunc) 0, /*nb_negative*/ + (unaryfunc) 0, /*tp_positive*/ + (unaryfunc) 0, /*tp_absolute*/ + (inquiry) 0, /*tp_bool*/ + (unaryfunc) Matrix_inv, /*nb_invert*/ + 0, /*nb_lshift*/ + (binaryfunc)0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + 0, /*nb_int*/ + 0, /*nb_reserved*/ + 0, /*nb_float*/ + 0, /* nb_inplace_add */ + 0, /* nb_inplace_subtract */ + 0, /* nb_inplace_multiply */ + 0, /* nb_inplace_remainder */ + 0, /* nb_inplace_power */ + 0, /* nb_inplace_lshift */ + 0, /* nb_inplace_rshift */ + 0, /* nb_inplace_and */ + 0, /* nb_inplace_xor */ + 0, /* nb_inplace_or */ + 0, /* nb_floor_divide */ + 0, /* nb_true_divide */ + 0, /* nb_inplace_floor_divide */ + 0, /* nb_inplace_true_divide */ + 0, /* nb_index */ +}; +#else static PyNumberMethods Matrix_NumMethods = { (binaryfunc) Matrix_add, /* __add__ */ (binaryfunc) Matrix_sub, /* __sub__ */ @@ -1037,6 +1077,7 @@ static PyNumberMethods Matrix_NumMethods = { (unaryfunc) 0, /* __oct__ */ (unaryfunc) 0, /* __hex__ */ }; +#endif static PyObject *Matrix_getRowSize( MatrixObject * self, void *type ) { diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c index e7413d38ee5..7cd3cf738dd 100644 --- a/source/blender/python/generic/quat.c +++ b/source/blender/python/generic/quat.c @@ -622,6 +622,45 @@ static PySequenceMethods Quaternion_SeqMethods = { (ssizeobjargproc) Quaternion_ass_item, /* sq_ass_item */ (ssizessizeobjargproc) Quaternion_ass_slice, /* sq_ass_slice */ }; + +#if (PY_VERSION_HEX >= 0x03000000) +static PyNumberMethods Quaternion_NumMethods = { + (binaryfunc) Quaternion_add, /*nb_add*/ + (binaryfunc) Quaternion_sub, /*nb_subtract*/ + (binaryfunc) Quaternion_mul, /*nb_multiply*/ + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + (unaryfunc) 0, /*nb_negative*/ + (unaryfunc) 0, /*tp_positive*/ + (unaryfunc) 0, /*tp_absolute*/ + (inquiry) 0, /*tp_bool*/ + (unaryfunc) 0, /*nb_invert*/ + 0, /*nb_lshift*/ + (binaryfunc)0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + 0, /*nb_int*/ + 0, /*nb_reserved*/ + 0, /*nb_float*/ + 0, /* nb_inplace_add */ + 0, /* nb_inplace_subtract */ + 0, /* nb_inplace_multiply */ + 0, /* nb_inplace_remainder */ + 0, /* nb_inplace_power */ + 0, /* nb_inplace_lshift */ + 0, /* nb_inplace_rshift */ + 0, /* nb_inplace_and */ + 0, /* nb_inplace_xor */ + 0, /* nb_inplace_or */ + 0, /* nb_floor_divide */ + 0, /* nb_true_divide */ + 0, /* nb_inplace_floor_divide */ + 0, /* nb_inplace_true_divide */ + 0, /* nb_index */ +}; +#else static PyNumberMethods Quaternion_NumMethods = { (binaryfunc) Quaternion_add, /* __add__ */ (binaryfunc) Quaternion_sub, /* __sub__ */ @@ -646,9 +685,8 @@ static PyNumberMethods Quaternion_NumMethods = { (unaryfunc) 0, /* __float__ */ (unaryfunc) 0, /* __oct__ */ (unaryfunc) 0, /* __hex__ */ - }; - +#endif static PyObject *Quaternion_getAxis( QuaternionObject * self, void *type ) { diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index 9ce0a7ca2f9..d8d4c33b6f8 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -1077,6 +1077,44 @@ static PySequenceMethods Vector_SeqMethods = { (ssizessizeobjargproc) Vector_ass_slice, /* sq_ass_slice */ }; +#if (PY_VERSION_HEX >= 0x03000000) +static PyNumberMethods Vector_NumMethods = { + (binaryfunc) Vector_add, /*nb_add*/ + (binaryfunc) Vector_sub, /*nb_subtract*/ + (binaryfunc) Vector_mul, /*nb_multiply*/ + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + (unaryfunc) Vector_neg, /*nb_negative*/ + (unaryfunc) 0, /*tp_positive*/ + (unaryfunc) 0, /*tp_absolute*/ + (inquiry) 0, /*tp_bool*/ + (unaryfunc) 0, /*nb_invert*/ + 0, /*nb_lshift*/ + (binaryfunc)0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + 0, /*nb_int*/ + 0, /*nb_reserved*/ + 0, /*nb_float*/ + Vector_iadd, /* nb_inplace_add */ + Vector_isub, /* nb_inplace_subtract */ + Vector_imul, /* nb_inplace_multiply */ + 0, /* nb_inplace_remainder */ + 0, /* nb_inplace_power */ + 0, /* nb_inplace_lshift */ + 0, /* nb_inplace_rshift */ + 0, /* nb_inplace_and */ + 0, /* nb_inplace_xor */ + 0, /* nb_inplace_or */ + 0, /* nb_floor_divide */ + Vector_div, /* nb_true_divide */ + 0, /* nb_inplace_floor_divide */ + Vector_idiv, /* nb_inplace_true_divide */ + 0, /* nb_index */ +}; +#else static PyNumberMethods Vector_NumMethods = { (binaryfunc) Vector_add, /* __add__ */ (binaryfunc) Vector_sub, /* __sub__ */ @@ -1122,6 +1160,8 @@ static PyNumberMethods Vector_NumMethods = { (binaryfunc) NULL, /*__ifloordiv__*/ (binaryfunc) NULL, /*__itruediv__*/ }; +#endif + /*------------------PY_OBECT DEFINITION--------------------------*/ /* -- cgit v1.2.3 From 5d6485f06efcc277e7f42cb355ece601b4cf6cf4 Mon Sep 17 00:00:00 2001 From: Elia Sarti Date: Sun, 28 Jun 2009 13:41:50 +0000 Subject: 2.5 / RNA Return right size for PROP_COLLECTION parameters --- source/blender/makesrna/intern/rna_define.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index bd449acc050..0ef89490b3d 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -2249,7 +2249,6 @@ int rna_parameter_size(PropertyRNA *parm) #endif } case PROP_COLLECTION: - /* XXX does not work yet */ return sizeof(ListBase); } } -- cgit v1.2.3 From 13ec1fbfa4e520b5c85c2909f1b310bc5f9bf48b Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 28 Jun 2009 16:31:20 +0000 Subject: 2.5 Starting GE should initialize opengl for the 3d region. --- source/blender/editors/space_view3d/view3d_view.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 782d426641f..b57f4a91004 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1431,6 +1431,9 @@ static int game_engine_exec(bContext *C, wmOperator *unused) Scene *startscene = CTX_data_scene(C); #if GAMEBLENDER == 1 + + view3d_operator_needs_opengl(C); + SaveState(C); StartKetsjiShell(C, 1); RestoreState(C); -- cgit v1.2.3 From bb1f24ac443bcc386cf2cc3765609aaf9bf51db1 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 28 Jun 2009 18:09:19 +0000 Subject: 2.5 Make include to make GE compile. Py 2.3 doesnt compile expressions/Value.cpp btw... Value.cpp:616: error: 'class PyObjectPlus' has no member named 'ob_type' Probably need to wait for py 3.1 :) --- source/gameengine/BlenderRoutines/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/gameengine/BlenderRoutines/Makefile b/source/gameengine/BlenderRoutines/Makefile index 549e466c4e0..ffa99a0c1b2 100644 --- a/source/gameengine/BlenderRoutines/Makefile +++ b/source/gameengine/BlenderRoutines/Makefile @@ -54,6 +54,7 @@ CPPFLAGS += -I../../blender/render/extern/include CPPFLAGS += -I../../blender/blenloader CPPFLAGS += -I../../blender/blenfont CPPFLAGS += -I../../blender/gpu +CPPFLAGS += -I../../blender/makesrna CPPFLAGS += -I../Converter CPPFLAGS += -I../Expressions CPPFLAGS += -I../GameLogic -- cgit v1.2.3 From 26c7c01c32957f17a3f6cffb52975eddc7cd40f1 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 29 Jun 2009 01:00:35 +0000 Subject: NLA SoC: Lines are now drawn on action-clip strips for indicating the timing of repeats --- source/blender/editors/space_nla/nla_draw.c | 17 +++++++++++++++++ source/blender/makesrna/intern/rna_nla.c | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 51c1960c4c6..6d4f65fe249 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -293,6 +293,23 @@ static void nla_draw_strip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2 /* draw outline */ gl_round_box_shade(GL_LINE_LOOP, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1); + /* if action-clip strip, draw lines delimiting repeats too (in the same colour */ + if ((strip->type == NLASTRIP_TYPE_CLIP) && IS_EQ(strip->repeat, 1.0f)==0) { + float repeatLen = (strip->actend - strip->actstart) * strip->scale; + int i; + + /* only draw lines for whole-numbered repeats, starting from the first full-repeat + * up to the last full repeat (but not if it lies on the end of the strip) + */ + for (i = 1; i < strip->repeat; i++) { + float repeatPos = strip->start + (repeatLen * i); + + /* don't draw if line would end up on or after the end of the strip */ + if (repeatPos < strip->end) + fdrawline(repeatPos, yminc, repeatPos, ymaxc); + } + } + /* reset linestyle */ setlinestyle(0); } diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 5dc624b67bc..965692212a5 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -288,7 +288,7 @@ void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "repeat"); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_repeat_set", NULL); RNA_def_property_range(prop, 0.1f, 1000.0f); /* these limits have currently be chosen arbitarily, but could be extended (minimum should still be > 0 though) if needed... */ - RNA_def_property_ui_text(prop, "Repeat", "Number of times to repeat the "); + RNA_def_property_ui_text(prop, "Repeat", "Number of times to repeat the action range."); prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scale"); -- cgit v1.2.3 From c50bbe5ae726edfb265bd54cb7ce0e547e3f4b31 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 29 Jun 2009 02:25:54 +0000 Subject: BGE Py API using python3 c/api calls. include bpy_compat.h to support py2.x --- source/gameengine/Converter/BL_ActionActuator.cpp | 12 +++--- .../Converter/BL_ShapeActionActuator.cpp | 8 ++-- source/gameengine/Expressions/BoolValue.cpp | 2 +- source/gameengine/Expressions/IntValue.cpp | 2 +- source/gameengine/Expressions/ListValue.cpp | 22 +++++------ source/gameengine/Expressions/PyObjectPlus.cpp | 44 +++++++++++----------- source/gameengine/Expressions/PyObjectPlus.h | 16 ++------ source/gameengine/Expressions/StringValue.h | 2 +- source/gameengine/Expressions/Value.cpp | 14 ++++--- source/gameengine/Expressions/Value.h | 2 +- source/gameengine/GameLogic/SCA_ActuatorSensor.cpp | 2 +- source/gameengine/GameLogic/SCA_DelaySensor.cpp | 4 +- source/gameengine/GameLogic/SCA_IController.cpp | 8 ++-- source/gameengine/GameLogic/SCA_ILogicBrick.cpp | 4 +- source/gameengine/GameLogic/SCA_ISensor.cpp | 10 ++--- source/gameengine/GameLogic/SCA_JoystickSensor.cpp | 34 ++++++++--------- source/gameengine/GameLogic/SCA_KeyboardSensor.cpp | 24 ++++++------ source/gameengine/GameLogic/SCA_MouseSensor.cpp | 10 ++--- .../gameengine/GameLogic/SCA_PropertyActuator.cpp | 4 +- source/gameengine/GameLogic/SCA_PropertySensor.cpp | 6 +-- .../gameengine/GameLogic/SCA_PythonController.cpp | 16 ++++---- source/gameengine/GameLogic/SCA_RandomActuator.cpp | 12 +++--- source/gameengine/GameLogic/SCA_RandomSensor.cpp | 10 ++--- source/gameengine/Ketsji/BL_Shader.cpp | 8 ++-- source/gameengine/Ketsji/BL_Shader.h | 2 +- .../Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp | 6 +-- source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 2 +- source/gameengine/Ketsji/KX_BlenderMaterial.h | 2 +- source/gameengine/Ketsji/KX_CDActuator.cpp | 4 +- source/gameengine/Ketsji/KX_Camera.cpp | 20 +++++----- source/gameengine/Ketsji/KX_CameraActuator.cpp | 4 +- source/gameengine/Ketsji/KX_ConstraintActuator.cpp | 12 +++--- source/gameengine/Ketsji/KX_ConstraintWrapper.cpp | 2 +- source/gameengine/Ketsji/KX_GameActuator.cpp | 2 +- source/gameengine/Ketsji/KX_GameObject.cpp | 30 +++++++-------- source/gameengine/Ketsji/KX_GameObject.h | 2 +- source/gameengine/Ketsji/KX_IpoActuator.cpp | 2 +- source/gameengine/Ketsji/KX_Light.cpp | 10 ++--- source/gameengine/Ketsji/KX_MeshProxy.cpp | 20 +++++----- source/gameengine/Ketsji/KX_ObjectActuator.cpp | 6 +-- source/gameengine/Ketsji/KX_ParentActuator.cpp | 2 +- source/gameengine/Ketsji/KX_PolyProxy.cpp | 36 +++++++++--------- source/gameengine/Ketsji/KX_PolygonMaterial.cpp | 8 ++-- source/gameengine/Ketsji/KX_PolygonMaterial.h | 2 +- .../gameengine/Ketsji/KX_PyConstraintBinding.cpp | 2 +- source/gameengine/Ketsji/KX_PythonInit.cpp | 38 +++++++++---------- source/gameengine/Ketsji/KX_PythonSeq.cpp | 12 +++--- .../gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp | 6 +-- .../gameengine/Ketsji/KX_SCA_DynamicActuator.cpp | 2 +- .../Ketsji/KX_SCA_ReplaceMeshActuator.cpp | 2 +- source/gameengine/Ketsji/KX_Scene.cpp | 4 +- source/gameengine/Ketsji/KX_Scene.h | 2 +- source/gameengine/Ketsji/KX_SceneActuator.cpp | 6 +-- source/gameengine/Ketsji/KX_SoundActuator.cpp | 14 +++---- source/gameengine/Ketsji/KX_TouchSensor.cpp | 8 ++-- source/gameengine/Ketsji/KX_TrackToActuator.cpp | 6 +-- source/gameengine/Ketsji/KX_VehicleWrapper.cpp | 6 +-- source/gameengine/Ketsji/KX_VertexProxy.cpp | 10 ++--- .../gameengine/VideoTexture/FilterBlueScreen.cpp | 20 +++++----- source/gameengine/VideoTexture/FilterColor.cpp | 8 ++-- source/gameengine/VideoTexture/FilterNormal.cpp | 4 +- source/gameengine/VideoTexture/ImageRender.cpp | 16 ++++---- source/gameengine/VideoTexture/ImageViewport.cpp | 16 ++++---- source/gameengine/VideoTexture/VideoBase.cpp | 4 +- source/gameengine/VideoTexture/VideoFFmpeg.cpp | 4 +- source/gameengine/VideoTexture/blendVideoTex.cpp | 2 +- 66 files changed, 317 insertions(+), 325 deletions(-) (limited to 'source') diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 1787909b064..d9e65c53fac 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -446,7 +446,7 @@ PyObject* BL_ActionActuator::PyGetAction(PyObject* args, ShowDeprecationWarning("getAction()", "the action property"); if (m_action){ - return PyString_FromString(m_action->id.name+2); + return PyUnicode_FromString(m_action->id.name+2); } Py_RETURN_NONE; } @@ -796,7 +796,7 @@ PyObject* BL_ActionActuator::PySetFrameProperty(PyObject* args, } PyObject* BL_ActionActuator::PyGetChannel(PyObject* value) { - char *string= PyString_AsString(value); + char *string= _PyUnicode_AsString(value); if (!string) { PyErr_SetString(PyExc_TypeError, "expected a single string"); @@ -888,7 +888,7 @@ PyObject* BL_ActionActuator::PySetType(PyObject* args, PyObject* BL_ActionActuator::PyGetContinue() { ShowDeprecationWarning("getContinue()", "the continue property"); - return PyInt_FromLong((long)(m_end_reset==0)); + return PyLong_FromSsize_t((long)(m_end_reset==0)); } PyObject* BL_ActionActuator::PySetContinue(PyObject* value) { @@ -1066,21 +1066,21 @@ PyAttributeDef BL_ActionActuator::Attributes[] = { PyObject* BL_ActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { BL_ActionActuator* self= static_cast(self_v); - return PyString_FromString(self->GetAction() ? self->GetAction()->id.name+2 : ""); + return PyUnicode_FromString(self->GetAction() ? self->GetAction()->id.name+2 : ""); } int BL_ActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { BL_ActionActuator* self= static_cast(self_v); - if (!PyString_Check(value)) + if (!PyUnicode_Check(value)) { PyErr_SetString(PyExc_ValueError, "actuator.action = val: Action Actuator, expected the string name of the action"); return PY_SET_ATTR_FAIL; } bAction *action= NULL; - STR_String val = PyString_AsString(value); + STR_String val = _PyUnicode_AsString(value); if (val != "") { diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index b92e94b6e04..4c9a584d72b 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -486,7 +486,7 @@ const char BL_ShapeActionActuator::GetAction_doc[] = PyObject* BL_ShapeActionActuator::PyGetAction() { ShowDeprecationWarning("getAction()", "the action property"); if (m_action){ - return PyString_FromString(m_action->id.name+2); + return PyUnicode_FromString(m_action->id.name+2); } Py_RETURN_NONE; } @@ -845,21 +845,21 @@ PyObject* BL_ShapeActionActuator::PySetType(PyObject* args) { PyObject* BL_ShapeActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { BL_ShapeActionActuator* self= static_cast(self_v); - return PyString_FromString(self->GetAction() ? self->GetAction()->id.name+2 : ""); + return PyUnicode_FromString(self->GetAction() ? self->GetAction()->id.name+2 : ""); } int BL_ShapeActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { BL_ShapeActionActuator* self= static_cast(self_v); /* exact copy of BL_ActionActuator's function from here down */ - if (!PyString_Check(value)) + if (!PyUnicode_Check(value)) { PyErr_SetString(PyExc_ValueError, "actuator.action = val: Shape Action Actuator, expected the string name of the action"); return PY_SET_ATTR_FAIL; } bAction *action= NULL; - STR_String val = PyString_AsString(value); + STR_String val = _PyUnicode_AsString(value); if (val != "") { diff --git a/source/gameengine/Expressions/BoolValue.cpp b/source/gameengine/Expressions/BoolValue.cpp index d90da8b3a92..1102b12fdc4 100644 --- a/source/gameengine/Expressions/BoolValue.cpp +++ b/source/gameengine/Expressions/BoolValue.cpp @@ -210,5 +210,5 @@ CValue* CBoolValue::GetReplica() PyObject* CBoolValue::ConvertValueToPython() { - return PyInt_FromLong(m_bool != 0); + return PyBool_FromLong(m_bool != 0); } diff --git a/source/gameengine/Expressions/IntValue.cpp b/source/gameengine/Expressions/IntValue.cpp index 227518e9439..b782de4bef6 100644 --- a/source/gameengine/Expressions/IntValue.cpp +++ b/source/gameengine/Expressions/IntValue.cpp @@ -330,7 +330,7 @@ void CIntValue::SetValue(CValue* newval) PyObject* CIntValue::ConvertValueToPython() { if((m_int > INT_MIN) && (m_int < INT_MAX)) - return PyInt_FromLong(m_int); + return PyLong_FromSsize_t(m_int); else return PyLong_FromLongLong(m_int); } diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 4cad4728521..34a357aa5f1 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -76,9 +76,9 @@ PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex) return NULL; } - if (PyString_Check(pyindex)) + if (PyUnicode_Check(pyindex)) { - CValue *item = ((CListValue*) list)->FindValue(PyString_AsString(pyindex)); + CValue *item = ((CListValue*) list)->FindValue(_PyUnicode_AsString(pyindex)); if (item) { PyObject* pyobj = item->ConvertValueToPython(); if(pyobj) @@ -87,14 +87,14 @@ PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex) return item->GetProxy(); } } - else if (PyInt_Check(pyindex)) + else if (PyLong_Check(pyindex)) { - int index = PyInt_AsLong(pyindex); + int index = PyLong_AsSsize_t(pyindex); return listvalue_buffer_item(self, index); /* wont add a ref */ } PyObject *pyindex_str = PyObject_Repr(pyindex); /* new ref */ - PyErr_Format(PyExc_KeyError, "CList[key]: '%s' key not in list", PyString_AsString(pyindex_str)); + PyErr_Format(PyExc_KeyError, "CList[key]: '%s' key not in list", _PyUnicode_AsString(pyindex_str)); Py_DECREF(pyindex_str); return NULL; } @@ -220,8 +220,8 @@ static int listvalue_buffer_contains(PyObject *self_v, PyObject *value) return -1; } - if (PyString_Check(value)) { - if (self->FindValue((const char *)PyString_AsString(value))) { + if (PyUnicode_Check(value)) { + if (self->FindValue((const char *)_PyUnicode_AsString(value))) { return 1; } } @@ -542,7 +542,7 @@ PyObject* CListValue::Pyindex(PyObject *value) CValue* elem = GetValue(i); if (checkobj==elem || CheckEqual(checkobj,elem)) { - result = PyInt_FromLong(i); + result = PyLong_FromSsize_t(i); break; } } @@ -565,7 +565,7 @@ PyObject* CListValue::Pycount(PyObject* value) if (checkobj==NULL) { /* in this case just return that there are no items in the list */ PyErr_Clear(); - return PyInt_FromLong(0); + return PyLong_FromSsize_t(0); } int numelem = GetCount(); @@ -579,7 +579,7 @@ PyObject* CListValue::Pycount(PyObject* value) } checkobj->Release(); - return PyInt_FromLong(numfound); + return PyLong_FromSsize_t(numfound); } /* Matches python dict.get(key, [default]) */ @@ -606,7 +606,7 @@ PyObject* CListValue::Pyget(PyObject *args) /* Matches python dict.has_key() */ PyObject* CListValue::Pyhas_key(PyObject* value) { - if (PyString_Check(value) && FindValue((const char *)PyString_AsString(value))) + if (PyUnicode_Check(value) && FindValue((const char *)_PyUnicode_AsString(value))) Py_RETURN_TRUE; Py_RETURN_FALSE; diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 552e839d2b8..863390f209d 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -183,14 +183,14 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef * { bool *val = reinterpret_cast(ptr); ptr += sizeof(bool); - PyList_SET_ITEM(resultlist,i,PyInt_FromLong(*val)); + PyList_SET_ITEM(resultlist,i,PyLong_FromSsize_t(*val)); break; } case KX_PYATTRIBUTE_TYPE_SHORT: { short int *val = reinterpret_cast(ptr); ptr += sizeof(short int); - PyList_SET_ITEM(resultlist,i,PyInt_FromLong(*val)); + PyList_SET_ITEM(resultlist,i,PyLong_FromSsize_t(*val)); break; } case KX_PYATTRIBUTE_TYPE_ENUM: @@ -205,7 +205,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef * { int *val = reinterpret_cast(ptr); ptr += sizeof(int); - PyList_SET_ITEM(resultlist,i,PyInt_FromLong(*val)); + PyList_SET_ITEM(resultlist,i,PyLong_FromSsize_t(*val)); break; } case KX_PYATTRIBUTE_TYPE_FLOAT: @@ -229,12 +229,12 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef * case KX_PYATTRIBUTE_TYPE_BOOL: { bool *val = reinterpret_cast(ptr); - return PyInt_FromLong(*val); + return PyLong_FromSsize_t(*val); } case KX_PYATTRIBUTE_TYPE_SHORT: { short int *val = reinterpret_cast(ptr); - return PyInt_FromLong(*val); + return PyLong_FromSsize_t(*val); } case KX_PYATTRIBUTE_TYPE_ENUM: // enum are like int, just make sure the field size is the same @@ -246,7 +246,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef * case KX_PYATTRIBUTE_TYPE_INT: { int *val = reinterpret_cast(ptr); - return PyInt_FromLong(*val); + return PyLong_FromSsize_t(*val); } case KX_PYATTRIBUTE_TYPE_FLOAT: { @@ -271,7 +271,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef * case KX_PYATTRIBUTE_TYPE_STRING: { STR_String *val = reinterpret_cast(ptr); - return PyString_FromString(*val); + return PyUnicode_FromString(*val); } default: return NULL; @@ -352,9 +352,9 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt { bool *var = reinterpret_cast(ptr); ptr += sizeof(bool); - if (PyInt_Check(item)) + if (PyLong_Check(item)) { - *var = (PyInt_AsLong(item) != 0); + *var = (PyLong_AsSsize_t(item) != 0); } else if (PyBool_Check(item)) { @@ -371,9 +371,9 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt { short int *var = reinterpret_cast(ptr); ptr += sizeof(short int); - if (PyInt_Check(item)) + if (PyLong_Check(item)) { - long val = PyInt_AsLong(item); + long val = PyLong_AsSsize_t(item); if (attrdef->m_clamp) { if (val < attrdef->m_imin) @@ -407,9 +407,9 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt { int *var = reinterpret_cast(ptr); ptr += sizeof(int); - if (PyInt_Check(item)) + if (PyLong_Check(item)) { - long val = PyInt_AsLong(item); + long val = PyLong_AsSsize_t(item); if (attrdef->m_clamp) { if (val < attrdef->m_imin) @@ -542,9 +542,9 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt case KX_PYATTRIBUTE_TYPE_BOOL: { bool *var = reinterpret_cast(ptr); - if (PyInt_Check(value)) + if (PyLong_Check(value)) { - *var = (PyInt_AsLong(value) != 0); + *var = (PyLong_AsSsize_t(value) != 0); } else if (PyBool_Check(value)) { @@ -560,9 +560,9 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt case KX_PYATTRIBUTE_TYPE_SHORT: { short int *var = reinterpret_cast(ptr); - if (PyInt_Check(value)) + if (PyLong_Check(value)) { - long val = PyInt_AsLong(value); + long val = PyLong_AsSsize_t(value); if (attrdef->m_clamp) { if (val < attrdef->m_imin) @@ -595,9 +595,9 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt case KX_PYATTRIBUTE_TYPE_INT: { int *var = reinterpret_cast(ptr); - if (PyInt_Check(value)) + if (PyLong_Check(value)) { - long val = PyInt_AsLong(value); + long val = PyLong_AsSsize_t(value); if (attrdef->m_clamp) { if (val < attrdef->m_imin) @@ -682,9 +682,9 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt case KX_PYATTRIBUTE_TYPE_STRING: { STR_String *var = reinterpret_cast(ptr); - if (PyString_Check(value)) + if (PyUnicode_Check(value)) { - char *val = PyString_AsString(value); + char *val = _PyUnicode_AsString(value); if (attrdef->m_clamp) { if (strlen(val) < attrdef->m_imin) @@ -859,7 +859,7 @@ void PyObjectPlus::ShowDeprecationWarning_func(const char* old_way,const char* n co_filename= PyObject_GetAttrString(f_code, "co_filename"); if (co_filename) { - printf("\t%s:%d\n", PyString_AsString(co_filename), (int)PyInt_AsLong(f_lineno)); + printf("\t%s:%d\n", _PyUnicode_AsString(co_filename), (int)PyLong_AsSsize_t(f_lineno)); Py_DECREF(f_lineno); Py_DECREF(f_code); diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 0fe3e9f083d..ee69e7d3b07 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -51,19 +51,9 @@ extern "C" { } #endif -#if PY_VERSION_HEX > 0x03000000 -#define PyString_FromString PyUnicode_FromString -#define PyString_FromFormat PyUnicode_FromFormat -#define PyString_Check PyUnicode_Check -#define PyString_Size PyUnicode_GetSize - -#define PyInt_FromLong PyLong_FromSsize_t -#define PyInt_AsLong PyLong_AsSsize_t -#define PyString_AsString _PyUnicode_AsString -#define PyInt_Check PyLong_Check -#define PyInt_AS_LONG PyLong_AsLong // TODO - check this one -#endif - +extern "C" { +#include "../../blender/python/intern/bpy_compat.h" +} /* diff --git a/source/gameengine/Expressions/StringValue.h b/source/gameengine/Expressions/StringValue.h index 52f8a580f4d..c580e8fd23a 100644 --- a/source/gameengine/Expressions/StringValue.h +++ b/source/gameengine/Expressions/StringValue.h @@ -40,7 +40,7 @@ public: virtual void SetValue(CValue* newval) { m_strString = newval->GetText(); SetModified(true); }; virtual CValue* GetReplica(); virtual PyObject* ConvertValueToPython() { - return PyString_FromString(m_strString.Ptr()); + return PyUnicode_FromString(m_strString.Ptr()); } private: diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 45eb15ecd08..a9b44495495 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -74,7 +74,7 @@ PyObject* CValue::PyGetName() { ShowDeprecationWarning("getName()", "the name property"); - return PyString_FromString(this->GetName()); + return PyUnicode_FromString(this->GetName()); } /*#define CVALUE_DEBUG*/ @@ -555,7 +555,7 @@ PyAttributeDef CValue::Attributes[] = { PyObject * CValue::pyattr_get_name(void * self_v, const KX_PYATTRIBUTE_DEF * attrdef) { CValue * self = static_cast (self_v); - return PyString_FromString(self->GetName()); + return PyUnicode_FromString(self->GetName()); } CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) @@ -599,21 +599,23 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) { vallie = new CFloatValue( (float)PyFloat_AsDouble(pyobj) ); } else +#if PY_VERSION_HEX < 0x03000000 if (PyInt_Check(pyobj)) { vallie = new CIntValue( (cInt)PyInt_AS_LONG(pyobj) ); } else +#endif if (PyLong_Check(pyobj)) { vallie = new CIntValue( (cInt)PyLong_AsLongLong(pyobj) ); } else - if (PyString_Check(pyobj)) + if (PyUnicode_Check(pyobj)) { - vallie = new CStringValue(PyString_AsString(pyobj),""); + vallie = new CStringValue(_PyUnicode_AsString(pyobj),""); } else if (BGE_PROXY_CHECK_TYPE(pyobj)) /* Note, dont let these get assigned to GameObject props, must check elsewhere */ { - if (BGE_PROXY_REF(pyobj) && PyObject_TypeCheck(BGE_PROXY_REF(pyobj), &CValue::Type)) + if (BGE_PROXY_REF(pyobj) && PyObject_TypeCheck((PyObject *)BGE_PROXY_REF(pyobj), &CValue::Type)) { vallie = (static_cast(BGE_PROXY_REF(pyobj)))->AddRef(); } else { @@ -642,7 +644,7 @@ PyObject* CValue::ConvertKeysToPython( void ) std::map::iterator it; for (it= m_pNamedPropertyArray->begin(); (it != m_pNamedPropertyArray->end()); it++) { - pystr = PyString_FromString( (*it).first ); + pystr = PyUnicode_FromString( (*it).first ); PyList_Append(pylist, pystr); Py_DECREF( pystr ); } diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 9da75b96e78..8c9f99b335e 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -219,7 +219,7 @@ public: //static PyObject* PyMake(PyObject*,PyObject*); virtual PyObject *py_repr(void) { - return PyString_FromString((const char*)GetText()); + return PyUnicode_FromString((const char*)GetText()); } virtual PyObject* ConvertValueToPython() { diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index b6a9471f23c..9d2642ba01a 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -181,7 +181,7 @@ const char SCA_ActuatorSensor::GetActuator_doc[] = PyObject* SCA_ActuatorSensor::PyGetActuator() { ShowDeprecationWarning("getActuator()", "the actuator property"); - return PyString_FromString(m_checkactname); + return PyUnicode_FromString(m_checkactname); } /* 4. setActuator */ diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp index afc9028d95d..db6a6af7928 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.cpp +++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp @@ -245,7 +245,7 @@ const char SCA_DelaySensor::GetDelay_doc[] = PyObject* SCA_DelaySensor::PyGetDelay() { ShowDeprecationWarning("getDelay()", "the delay property"); - return PyInt_FromLong(m_delay); + return PyLong_FromSsize_t(m_delay); } const char SCA_DelaySensor::GetDuration_doc[] = @@ -254,7 +254,7 @@ const char SCA_DelaySensor::GetDuration_doc[] = PyObject* SCA_DelaySensor::PyGetDuration() { ShowDeprecationWarning("getDuration()", "the duration property"); - return PyInt_FromLong(m_duration); + return PyLong_FromSsize_t(m_duration); } const char SCA_DelaySensor::GetRepeat_doc[] = diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp index 7880daf0eb4..4b7c462b6f7 100644 --- a/source/gameengine/GameLogic/SCA_IController.cpp +++ b/source/gameengine/GameLogic/SCA_IController.cpp @@ -263,7 +263,7 @@ PyObject* SCA_IController::PyGetSensor(PyObject* value) { ShowDeprecationWarning("getSensor(string)", "the sensors[string] property"); - char *scriptArg = PyString_AsString(value); + char *scriptArg = _PyUnicode_AsString(value); if (scriptArg==NULL) { PyErr_SetString(PyExc_TypeError, "controller.getSensor(string): Python Controller, expected a string (sensor name)"); return NULL; @@ -287,7 +287,7 @@ PyObject* SCA_IController::PyGetActuator(PyObject* value) { ShowDeprecationWarning("getActuator(string)", "the actuators[string] property"); - char *scriptArg = PyString_AsString(value); + char *scriptArg = _PyUnicode_AsString(value); if (scriptArg==NULL) { PyErr_SetString(PyExc_TypeError, "controller.getActuator(string): Python Controller, expected a string (actuator name)"); return NULL; @@ -322,13 +322,13 @@ PyObject* SCA_IController::PyGetSensors() PyObject* SCA_IController::PyGetState() { ShowDeprecationWarning("getState()", "the state property"); - return PyInt_FromLong(m_statemask); + return PyLong_FromSsize_t(m_statemask); } PyObject* SCA_IController::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_IController* self= static_cast(self_v); - return PyInt_FromLong(self->m_statemask); + return PyLong_FromSsize_t(self->m_statemask); } PyObject* SCA_IController::pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index d747daec2b4..9d0b9b30ff6 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -275,7 +275,7 @@ PyObject* SCA_ILogicBrick::PySetExecutePriority(PyObject* args) PyObject* SCA_ILogicBrick::PyGetExecutePriority() { ShowDeprecationWarning("getExecutePriority()", "the executePriority property"); - return PyInt_FromLong(m_Execute_Priority); + return PyLong_FromSsize_t(m_Execute_Priority); } @@ -305,5 +305,5 @@ bool SCA_ILogicBrick::PyArgToBool(int boolArg) PyObject* SCA_ILogicBrick::BoolToPyArg(bool boolarg) { - return PyInt_FromLong(boolarg? KX_TRUE: KX_FALSE); + return PyLong_FromSsize_t(boolarg? KX_TRUE: KX_FALSE); } diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index de7030197b2..d68afebbc20 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -300,7 +300,7 @@ PyObject* SCA_ISensor::PyIsPositive() { ShowDeprecationWarning("isPositive()", "the read-only positive property"); int retval = GetState(); - return PyInt_FromLong(retval); + return PyLong_FromSsize_t(retval); } const char SCA_ISensor::IsTriggered_doc[] = @@ -313,7 +313,7 @@ PyObject* SCA_ISensor::PyIsTriggered() int retval = 0; if (SCA_PythonController::m_sCurrentController) retval = SCA_PythonController::m_sCurrentController->IsTriggered(this); - return PyInt_FromLong(retval); + return PyLong_FromSsize_t(retval); } /** @@ -354,7 +354,7 @@ const char SCA_ISensor::GetFrequency_doc[] = PyObject* SCA_ISensor::PyGetFrequency() { ShowDeprecationWarning("getFrequency()", "the frequency property"); - return PyInt_FromLong(m_pulse_frequency); + return PyLong_FromSsize_t(m_pulse_frequency); } /** @@ -553,13 +553,13 @@ PyObject* SCA_ISensor::pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_D int retval = 0; if (SCA_PythonController::m_sCurrentController) retval = SCA_PythonController::m_sCurrentController->IsTriggered(self); - return PyInt_FromLong(retval); + return PyLong_FromSsize_t(retval); } PyObject* SCA_ISensor::pyattr_get_positive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_ISensor* self= static_cast(self_v); - return PyInt_FromLong(self->GetState()); + return PyLong_FromSsize_t(self->GetState()); } int SCA_ISensor::pyattr_check_level(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index 645c73efaa4..f91ccff799c 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -329,7 +329,7 @@ const char SCA_JoystickSensor::GetIndex_doc[] = "\tReturns the joystick index to use.\n"; PyObject* SCA_JoystickSensor::PyGetIndex( ) { ShowDeprecationWarning("getIndex()", "the index property"); - return PyInt_FromLong(m_joyindex); + return PyLong_FromSsize_t(m_joyindex); } @@ -339,7 +339,7 @@ const char SCA_JoystickSensor::SetIndex_doc[] = "\tSets the joystick index to use.\n"; PyObject* SCA_JoystickSensor::PySetIndex( PyObject* value ) { ShowDeprecationWarning("setIndex()", "the index property"); - int index = PyInt_AsLong( value ); /* -1 on error, will raise an error in this case */ + int index = PyLong_AsSsize_t( value ); /* -1 on error, will raise an error in this case */ if (index < 0 || index >= JOYINDEX_MAX) { PyErr_SetString(PyExc_ValueError, "joystick index out of range or not an int"); return NULL; @@ -390,7 +390,7 @@ PyObject* SCA_JoystickSensor::PyGetAxisValue( ) { PyObject *list= PyList_New(axis_index); while(axis_index--) { - PyList_SET_ITEM(list, axis_index, PyInt_FromLong(joy->GetAxisPosition(axis_index))); + PyList_SET_ITEM(list, axis_index, PyLong_FromSsize_t(joy->GetAxisPosition(axis_index))); } return list; @@ -403,7 +403,7 @@ const char SCA_JoystickSensor::GetThreshold_doc[] = "\tReturns the threshold of the axis.\n"; PyObject* SCA_JoystickSensor::PyGetThreshold( ) { ShowDeprecationWarning("getThreshold()", "the threshold property"); - return PyInt_FromLong(m_precision); + return PyLong_FromSsize_t(m_precision); } @@ -427,7 +427,7 @@ const char SCA_JoystickSensor::GetButton_doc[] = "\tReturns the current button this sensor is checking.\n"; PyObject* SCA_JoystickSensor::PyGetButton( ) { ShowDeprecationWarning("getButton()", "the button property"); - return PyInt_FromLong(m_button); + return PyLong_FromSsize_t(m_button); } /* set button -------------------------------------------------------- */ @@ -436,7 +436,7 @@ const char SCA_JoystickSensor::SetButton_doc[] = "\tSets the button the sensor reacts to.\n"; PyObject* SCA_JoystickSensor::PySetButton( PyObject* value ) { ShowDeprecationWarning("setButton()", "the button property"); - int button = PyInt_AsLong(value); + int button = PyLong_AsSsize_t(value); if(button==-1 && PyErr_Occurred()) { PyErr_SetString(PyExc_ValueError, "expected an int"); return NULL; @@ -467,7 +467,7 @@ PyObject* SCA_JoystickSensor::PyGetButtonActiveList( ) { if(joy) { for (i=0; i < joy->GetNumberOfButtons(); i++) { if (joy->aButtonPressIsPositive(i)) { - value = PyInt_FromLong(i); + value = PyLong_FromSsize_t(i); PyList_Append(ls, value); Py_DECREF(value); } @@ -529,7 +529,7 @@ PyObject* SCA_JoystickSensor::PyNumberOfAxes( ) { ShowDeprecationWarning("getNumAxes()", "the numAxis property"); SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); // when the joystick is null their is 0 exis still. dumb but scripters should use isConnected() - return PyInt_FromLong( joy ? joy->GetNumberOfAxes() : 0 ); + return PyLong_FromSsize_t( joy ? joy->GetNumberOfAxes() : 0 ); } @@ -539,7 +539,7 @@ const char SCA_JoystickSensor::NumberOfButtons_doc[] = PyObject* SCA_JoystickSensor::PyNumberOfButtons( ) { ShowDeprecationWarning("getNumButtons()", "the numButtons property"); SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); - return PyInt_FromLong( joy ? joy->GetNumberOfButtons() : 0 ); + return PyLong_FromSsize_t( joy ? joy->GetNumberOfButtons() : 0 ); } @@ -549,7 +549,7 @@ const char SCA_JoystickSensor::NumberOfHats_doc[] = PyObject* SCA_JoystickSensor::PyNumberOfHats( ) { ShowDeprecationWarning("getNumHats()", "the numHats property"); SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); - return PyInt_FromLong( joy ? joy->GetNumberOfHats() : 0 ); + return PyLong_FromSsize_t( joy ? joy->GetNumberOfHats() : 0 ); } const char SCA_JoystickSensor::Connected_doc[] = @@ -571,7 +571,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYAT PyObject *list= PyList_New(axis_index); while(axis_index--) { - PyList_SET_ITEM(list, axis_index, PyInt_FromLong(joy->GetAxisPosition(axis_index))); + PyList_SET_ITEM(list, axis_index, PyLong_FromSsize_t(joy->GetAxisPosition(axis_index))); } return list; @@ -587,7 +587,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYAT return NULL; } - return PyInt_FromLong(joy->GetAxisPosition(self->m_axis-1)); + return PyLong_FromSsize_t(joy->GetAxisPosition(self->m_axis-1)); } PyObject* SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -599,7 +599,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATT PyObject *list= PyList_New(hat_index); while(hat_index--) { - PyList_SET_ITEM(list, hat_index, PyInt_FromLong(joy->GetHat(hat_index))); + PyList_SET_ITEM(list, hat_index, PyLong_FromSsize_t(joy->GetHat(hat_index))); } return list; @@ -610,28 +610,28 @@ PyObject* SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATT SCA_JoystickSensor* self= static_cast(self_v); SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); - return PyInt_FromLong(joy->GetHat(self->m_hat-1)); + return PyLong_FromSsize_t(joy->GetHat(self->m_hat-1)); } PyObject* SCA_JoystickSensor::pyattr_get_num_axis(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); - return PyInt_FromLong( joy ? joy->GetNumberOfAxes() : 0 ); + return PyLong_FromSsize_t( joy ? joy->GetNumberOfAxes() : 0 ); } PyObject* SCA_JoystickSensor::pyattr_get_num_buttons(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); - return PyInt_FromLong( joy ? joy->GetNumberOfButtons() : 0 ); + return PyLong_FromSsize_t( joy ? joy->GetNumberOfButtons() : 0 ); } PyObject* SCA_JoystickSensor::pyattr_get_num_hats(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); - return PyInt_FromLong( joy ? joy->GetNumberOfHats() : 0 ); + return PyLong_FromSsize_t( joy ? joy->GetNumberOfHats() : 0 ); } PyObject* SCA_JoystickSensor::pyattr_get_connected(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index 34ade17ffb7..cbf25f10291 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -417,7 +417,7 @@ const char SCA_KeyboardSensor::GetKey_doc[] = PyObject* SCA_KeyboardSensor::PyGetKey() { ShowDeprecationWarning("getKey()", "the key property"); - return PyInt_FromLong(m_hotkey); + return PyLong_FromSsize_t(m_hotkey); } /** 2. SetKey: change the key to look at */ @@ -449,7 +449,7 @@ const char SCA_KeyboardSensor::GetHold1_doc[] = PyObject* SCA_KeyboardSensor::PyGetHold1() { ShowDeprecationWarning("getHold1()", "the hold1 property"); - return PyInt_FromLong(m_qual); + return PyLong_FromSsize_t(m_qual); } /** 4. SetHold1: change the first bucky bit */ @@ -481,7 +481,7 @@ const char SCA_KeyboardSensor::GetHold2_doc[] = PyObject* SCA_KeyboardSensor::PyGetHold2() { ShowDeprecationWarning("getHold2()", "the hold2 property"); - return PyInt_FromLong(m_qual2); + return PyLong_FromSsize_t(m_qual2); } /** 6. SetHold2: change the second bucky bit */ @@ -531,8 +531,8 @@ PyObject* SCA_KeyboardSensor::PyGetPressedKeys() || (inevent.m_status == SCA_InputEvent::KX_JUSTRELEASED)) { PyObject* keypair = PyList_New(2); - PyList_SET_ITEM(keypair,0,PyInt_FromLong(i)); - PyList_SET_ITEM(keypair,1,PyInt_FromLong(inevent.m_status)); + PyList_SET_ITEM(keypair,0,PyLong_FromSsize_t(i)); + PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status)); PyList_SET_ITEM(resultlist,index,keypair); index++; @@ -571,8 +571,8 @@ PyObject* SCA_KeyboardSensor::PyGetCurrentlyPressedKeys() || (inevent.m_status == SCA_InputEvent::KX_JUSTACTIVATED)) { PyObject* keypair = PyList_New(2); - PyList_SET_ITEM(keypair,0,PyInt_FromLong(i)); - PyList_SET_ITEM(keypair,1,PyInt_FromLong(inevent.m_status)); + PyList_SET_ITEM(keypair,0,PyLong_FromSsize_t(i)); + PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status)); PyList_SET_ITEM(resultlist,index,keypair); index++; @@ -591,12 +591,12 @@ KX_PYMETHODDEF_DOC_O(SCA_KeyboardSensor, getKeyStatus, "getKeyStatus(keycode)\n" "\tGet the given key's status (KX_NO_INPUTSTATUS, KX_JUSTACTIVATED, KX_ACTIVE or KX_JUSTRELEASED).\n") { - if (!PyInt_Check(value)) { + if (!PyLong_Check(value)) { PyErr_SetString(PyExc_ValueError, "sensor.getKeyStatus(int): Keyboard Sensor, expected an int"); return NULL; } - int keycode = PyInt_AsLong(value); + int keycode = PyLong_AsSsize_t(value); if ((keycode < SCA_IInputDevice::KX_BEGINKEY) || (keycode > SCA_IInputDevice::KX_ENDKEY)){ @@ -606,7 +606,7 @@ KX_PYMETHODDEF_DOC_O(SCA_KeyboardSensor, getKeyStatus, SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice(); const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) keycode); - return PyInt_FromLong(inevent.m_status); + return PyLong_FromSsize_t(inevent.m_status); } /* ------------------------------------------------------------------------- */ @@ -683,8 +683,8 @@ PyObject* SCA_KeyboardSensor::pyattr_get_events(void *self_v, const KX_PYATTRIBU if (inevent.m_status != SCA_InputEvent::KX_NO_INPUTSTATUS) { PyObject* keypair = PyList_New(2); - PyList_SET_ITEM(keypair,0,PyInt_FromLong(i)); - PyList_SET_ITEM(keypair,1,PyInt_FromLong(inevent.m_status)); + PyList_SET_ITEM(keypair,0,PyLong_FromSsize_t(i)); + PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status)); PyList_Append(resultlist,keypair); } } diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index 3a1e6191fdb..608aa043461 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -253,7 +253,7 @@ const char SCA_MouseSensor::GetXPosition_doc[] = "\tpixels\n"; PyObject* SCA_MouseSensor::PyGetXPosition() { ShowDeprecationWarning("getXPosition()", "the position property"); - return PyInt_FromLong(m_x); + return PyLong_FromSsize_t(m_x); } /* get y position ---------------------------------------------------------- */ @@ -264,7 +264,7 @@ const char SCA_MouseSensor::GetYPosition_doc[] = "\tpixels\n"; PyObject* SCA_MouseSensor::PyGetYPosition() { ShowDeprecationWarning("getYPosition()", "the position property"); - return PyInt_FromLong(m_y); + return PyLong_FromSsize_t(m_y); } //<----- Deprecated @@ -272,9 +272,9 @@ KX_PYMETHODDEF_DOC_O(SCA_MouseSensor, getButtonStatus, "getButtonStatus(button)\n" "\tGet the given button's status (KX_INPUT_NONE, KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED).\n") { - if (PyInt_Check(value)) + if (PyLong_Check(value)) { - int button = PyInt_AsLong(value); + int button = PyLong_AsSsize_t(value); if ((button < SCA_IInputDevice::KX_LEFTMOUSE) || (button > SCA_IInputDevice::KX_RIGHTMOUSE)){ @@ -284,7 +284,7 @@ KX_PYMETHODDEF_DOC_O(SCA_MouseSensor, getButtonStatus, SCA_IInputDevice* mousedev = m_pMouseMgr->GetInputDevice(); const SCA_InputEvent& event = mousedev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) button); - return PyInt_FromLong(event.m_status); + return PyLong_FromSsize_t(event.m_status); } Py_RETURN_NONE; diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index 7eb088bef98..f3c0a76a9f2 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -307,7 +307,7 @@ const char SCA_PropertyActuator::GetProperty_doc[] = PyObject* SCA_PropertyActuator::PyGetProperty(PyObject* args, PyObject* kwds) { ShowDeprecationWarning("getProperty()", "the 'propName' property"); - return PyString_FromString(m_propname); + return PyUnicode_FromString(m_propname); } /* 3. setValue */ @@ -337,7 +337,7 @@ const char SCA_PropertyActuator::GetValue_doc[] = PyObject* SCA_PropertyActuator::PyGetValue(PyObject* args, PyObject* kwds) { ShowDeprecationWarning("getValue()", "the value property"); - return PyString_FromString(m_exprtxt); + return PyUnicode_FromString(m_exprtxt); } /* eof */ diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index b1571164774..ea928bb1c8f 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -356,7 +356,7 @@ const char SCA_PropertySensor::GetType_doc[] = PyObject* SCA_PropertySensor::PyGetType() { ShowDeprecationWarning("getType()", "the mode property"); - return PyInt_FromLong(m_checktype); + return PyLong_FromSsize_t(m_checktype); } /* 2. setType */ @@ -390,7 +390,7 @@ const char SCA_PropertySensor::GetProperty_doc[] = PyObject* SCA_PropertySensor::PyGetProperty() { ShowDeprecationWarning("getProperty()", "the 'propName' property"); - return PyString_FromString(m_checkpropname); + return PyUnicode_FromString(m_checkpropname); } /* 4. setProperty */ @@ -427,7 +427,7 @@ const char SCA_PropertySensor::GetValue_doc[] = PyObject* SCA_PropertySensor::PyGetValue() { ShowDeprecationWarning("getValue()", "the value property"); - return PyString_FromString(m_checkpropval); + return PyUnicode_FromString(m_checkpropval); } /* 6. setValue */ diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index fb12674ebed..7eecb6ccc98 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -148,7 +148,7 @@ void SCA_PythonController::SetDictionary(PyObject* pythondictionary) /* Without __file__ set the sys.argv[0] is used for the filename * which ends up with lines from the blender binary being printed in the console */ - PyDict_SetItemString(m_pythondictionary, "__file__", PyString_FromString(m_scriptName.Ptr())); + PyDict_SetItemString(m_pythondictionary, "__file__", PyUnicode_FromString(m_scriptName.Ptr())); } @@ -178,9 +178,9 @@ SCA_IActuator* SCA_PythonController::LinkedActuatorFromPy(PyObject *value) std::vector lacts = m_sCurrentController->GetLinkedActuators(); std::vector::iterator it; - if (PyString_Check(value)) { + if (PyUnicode_Check(value)) { /* get the actuator from the name */ - char *name= PyString_AsString(value); + char *name= _PyUnicode_AsString(value); for(it = lacts.begin(); it!= lacts.end(); ++it) { if( name == (*it)->GetName() ) { return *it; @@ -198,7 +198,7 @@ SCA_IActuator* SCA_PythonController::LinkedActuatorFromPy(PyObject *value) /* set the exception */ PyObject *value_str = PyObject_Repr(value); /* new ref */ - PyErr_Format(PyExc_ValueError, "'%s' not in this python controllers actuator list", PyString_AsString(value_str)); + PyErr_Format(PyExc_ValueError, "'%s' not in this python controllers actuator list", _PyUnicode_AsString(value_str)); Py_DECREF(value_str); return false; @@ -521,13 +521,13 @@ PyObject* SCA_PythonController::PyDeActivate(PyObject *value) PyObject* SCA_PythonController::PyGetScript() { ShowDeprecationWarning("getScript()", "the script property"); - return PyString_FromString(m_scriptText); + return PyUnicode_FromString(m_scriptText); } /* 2. setScript */ PyObject* SCA_PythonController::PySetScript(PyObject* value) { - char *scriptArg = PyString_AsString(value); + char *scriptArg = _PyUnicode_AsString(value); ShowDeprecationWarning("setScript()", "the script property"); @@ -550,7 +550,7 @@ PyObject* SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRI // static_cast(dynamic_cast(obj)) - static_cast(obj) SCA_PythonController* self= static_cast(self_v); - return PyString_FromString(self->m_scriptText); + return PyUnicode_FromString(self->m_scriptText); } @@ -559,7 +559,7 @@ int SCA_PythonController::pyattr_set_script(void *self_v, const KX_PYATTRIBUTE_D { SCA_PythonController* self= static_cast(self_v); - char *scriptArg = PyString_AsString(value); + char *scriptArg = _PyUnicode_AsString(value); if (scriptArg==NULL) { PyErr_SetString(PyExc_TypeError, "controller.script = string: Python Controller, expected a string script text"); diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index a272306bd1d..0474cb4ab5f 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -380,14 +380,14 @@ PyAttributeDef SCA_RandomActuator::Attributes[] = { PyObject* SCA_RandomActuator::pyattr_get_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) { SCA_RandomActuator* act = static_cast(self); - return PyInt_FromLong(act->m_base->GetSeed()); + return PyLong_FromSsize_t(act->m_base->GetSeed()); } int SCA_RandomActuator::pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { SCA_RandomActuator* act = static_cast(self); - if (PyInt_Check(value)) { - int ival = PyInt_AsLong(value); + if (PyLong_Check(value)) { + int ival = PyLong_AsSsize_t(value); act->m_base->SetSeed(ival); return PY_SET_ATTR_SUCCESS; } else { @@ -422,7 +422,7 @@ const char SCA_RandomActuator::GetSeed_doc[] = PyObject* SCA_RandomActuator::PyGetSeed() { ShowDeprecationWarning("getSeed()", "the seed property"); - return PyInt_FromLong(m_base->GetSeed()); + return PyLong_FromSsize_t(m_base->GetSeed()); } /* 4. getPara1 */ @@ -456,7 +456,7 @@ const char SCA_RandomActuator::GetDistribution_doc[] = PyObject* SCA_RandomActuator::PyGetDistribution() { ShowDeprecationWarning("getDistribution()", "the distribution property"); - return PyInt_FromLong(m_distribution); + return PyLong_FromSsize_t(m_distribution); } /* 9. setProperty */ @@ -491,7 +491,7 @@ const char SCA_RandomActuator::GetProperty_doc[] = PyObject* SCA_RandomActuator::PyGetProperty() { ShowDeprecationWarning("getProperty()", "the 'propName' property"); - return PyString_FromString(m_propname); + return PyUnicode_FromString(m_propname); } /* 11. setBoolConst */ diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 8a6f42c9926..9d3501ab4ed 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -199,7 +199,7 @@ const char SCA_RandomSensor::GetSeed_doc[] = "\tequal series.\n"; PyObject* SCA_RandomSensor::PyGetSeed() { ShowDeprecationWarning("getSeed()", "the seed property"); - return PyInt_FromLong(m_basegenerator->GetSeed()); + return PyLong_FromSsize_t(m_basegenerator->GetSeed()); } /* 3. getLastDraw */ @@ -208,24 +208,24 @@ const char SCA_RandomSensor::GetLastDraw_doc[] = "\tReturn the last value that was drawn.\n"; PyObject* SCA_RandomSensor::PyGetLastDraw() { ShowDeprecationWarning("getLastDraw()", "the lastDraw property"); - return PyInt_FromLong(m_lastdraw); + return PyLong_FromSsize_t(m_lastdraw); } PyObject* SCA_RandomSensor::pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_RandomSensor* self= static_cast(self_v); - return PyInt_FromLong(self->m_basegenerator->GetSeed()); + return PyLong_FromSsize_t(self->m_basegenerator->GetSeed()); } int SCA_RandomSensor::pyattr_set_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { SCA_RandomSensor* self= static_cast(self_v); - if (!PyInt_Check(value)) { + if (!PyLong_Check(value)) { PyErr_SetString(PyExc_TypeError, "sensor.seed = int: Random Sensor, expected an integer"); return PY_SET_ATTR_FAIL; } - self->m_basegenerator->SetSeed(PyInt_AsLong(value)); + self->m_basegenerator->SetSeed(PyLong_AsSsize_t(value)); return PY_SET_ATTR_SUCCESS; } diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index b595aab578f..b6debb4c62c 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -834,17 +834,17 @@ KX_PYMETHODDEF_DOC( BL_Shader, delSource, "delSource( )" ) KX_PYMETHODDEF_DOC( BL_Shader, isValid, "isValid()" ) { - return PyInt_FromLong( ( mShader !=0 && mOk ) ); + return PyLong_FromSsize_t( ( mShader !=0 && mOk ) ); } KX_PYMETHODDEF_DOC( BL_Shader, getVertexProg ,"getVertexProg( )" ) { - return PyString_FromString(vertProg?vertProg:""); + return PyUnicode_FromString(vertProg?vertProg:""); } KX_PYMETHODDEF_DOC( BL_Shader, getFragmentProg ,"getFragmentProg( )" ) { - return PyString_FromString(fragProg?fragProg:""); + return PyUnicode_FromString(fragProg?fragProg:""); } KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()") @@ -1209,7 +1209,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformiv, "setUniformiv( uniform_name, (list2 for(unsigned int i=0; (imatname.ReadPtr()); } + virtual PyObject* py_repr(void) { return PyUnicode_FromString(mMaterial->matname.ReadPtr()); } KX_PYMETHOD_DOC( KX_BlenderMaterial, getShader ); KX_PYMETHOD_DOC( KX_BlenderMaterial, getMaterialIndex ); diff --git a/source/gameengine/Ketsji/KX_CDActuator.cpp b/source/gameengine/Ketsji/KX_CDActuator.cpp index 6e01bf0dded..d025dbfa469 100644 --- a/source/gameengine/Ketsji/KX_CDActuator.cpp +++ b/source/gameengine/Ketsji/KX_CDActuator.cpp @@ -249,8 +249,8 @@ KX_PYMETHODDEF_DOC_O(KX_CDActuator, playTrack, "playTrack(trackNumber)\n" "\tPlays the track selected.\n") { - if (PyInt_Check(value)) { - int track = PyInt_AsLong(value); + if (PyLong_Check(value)) { + int track = PyLong_AsSsize_t(value); SND_CDObject::Instance()->SetPlaymode(SND_CD_TRACK); SND_CDObject::Instance()->SetTrack(track); SND_CDObject::Instance()->SetPlaystate(SND_MUST_PLAY); diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 4ccbf73b417..85fa579167b 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -586,7 +586,7 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, sphereInsideFrustum, MT_Point3 center; if (PyVecTo(pycenter, center)) { - return PyInt_FromLong(SphereInsideFrustum(center, radius)); /* new ref */ + return PyLong_FromSsize_t(SphereInsideFrustum(center, radius)); /* new ref */ } } @@ -637,7 +637,7 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, boxInsideFrustum, return NULL; } - return PyInt_FromLong(BoxInsideFrustum(box)); /* new ref */ + return PyLong_FromSsize_t(BoxInsideFrustum(box)); /* new ref */ } KX_PYMETHODDEF_DOC_O(KX_Camera, pointInsideFrustum, @@ -659,7 +659,7 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, pointInsideFrustum, MT_Point3 point; if (PyVecTo(value, point)) { - return PyInt_FromLong(PointInsideFrustum(point)); /* new ref */ + return PyLong_FromSsize_t(PointInsideFrustum(point)); /* new ref */ } PyErr_SetString(PyExc_TypeError, "camera.pointInsideFrustum(point): KX_Camera, expected point argument."); @@ -927,11 +927,11 @@ PyObject* KX_Camera::pyattr_get_world_to_camera(void *self_v, const KX_PYATTRIBU PyObject* KX_Camera::pyattr_get_INSIDE(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) -{ return PyInt_FromLong(INSIDE); } +{ return PyLong_FromSsize_t(INSIDE); } PyObject* KX_Camera::pyattr_get_OUTSIDE(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) -{ return PyInt_FromLong(OUTSIDE); } +{ return PyLong_FromSsize_t(OUTSIDE); } PyObject* KX_Camera::pyattr_get_INTERSECT(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) -{ return PyInt_FromLong(INTERSECT); } +{ return PyLong_FromSsize_t(INTERSECT); } bool ConvertPythonToCamera(PyObject * value, KX_Camera **object, bool py_none_ok, const char *error_prefix) @@ -953,14 +953,14 @@ bool ConvertPythonToCamera(PyObject * value, KX_Camera **object, bool py_none_ok } } - if (PyString_Check(value)) { - STR_String value_str = PyString_AsString(value); + if (PyUnicode_Check(value)) { + STR_String value_str = _PyUnicode_AsString(value); *object = KX_GetActiveScene()->FindCamera(value_str); if (*object) { return true; } else { - PyErr_Format(PyExc_ValueError, "%s, requested name \"%s\" did not match any KX_Camera in this scene", error_prefix, PyString_AsString(value)); + PyErr_Format(PyExc_ValueError, "%s, requested name \"%s\" did not match any KX_Camera in this scene", error_prefix, _PyUnicode_AsString(value)); return false; } } @@ -1117,7 +1117,7 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenRay, PyTuple_SET_ITEM(argValue, 0, PyObjectFrom(vect)); PyTuple_SET_ITEM(argValue, 1, PyFloat_FromDouble(dist)); if (propName) - PyTuple_SET_ITEM(argValue, 2, PyString_FromString(propName)); + PyTuple_SET_ITEM(argValue, 2, PyUnicode_FromString(propName)); PyObject* ret= this->PyrayCastTo(argValue,NULL); Py_DECREF(argValue); diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index b960ae25841..e2c3ecb1b3e 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -438,7 +438,7 @@ PyObject* KX_CameraActuator::PyGetObject(PyObject* args) Py_RETURN_NONE; if (ret_name_only) - return PyString_FromString(m_ob->GetName().ReadPtr()); + return PyUnicode_FromString(m_ob->GetName().ReadPtr()); else return m_ob->GetProxy(); } @@ -563,7 +563,7 @@ const char KX_CameraActuator::GetXY_doc[] = PyObject* KX_CameraActuator::PyGetXY() { ShowDeprecationWarning("getXY()", "the xy property"); - return PyInt_FromLong(m_x); + return PyLong_FromSsize_t(m_x); } PyObject* KX_CameraActuator::pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index 7e5a2e31907..8470c2c1f5f 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -672,7 +672,7 @@ const char KX_ConstraintActuator::GetDamp_doc[] = "\tReturns the damping parameter.\n"; PyObject* KX_ConstraintActuator::PyGetDamp(){ ShowDeprecationWarning("getDamp()", "the damp property"); - return PyInt_FromLong(m_posDampTime); + return PyLong_FromSsize_t(m_posDampTime); } /* 2. setRotDamp */ @@ -699,7 +699,7 @@ const char KX_ConstraintActuator::GetRotDamp_doc[] = "\tReturns the damping time for application of the constraint.\n"; PyObject* KX_ConstraintActuator::PyGetRotDamp(){ ShowDeprecationWarning("getRotDamp()", "the rotDamp property"); - return PyInt_FromLong(m_rotDampTime); + return PyLong_FromSsize_t(m_rotDampTime); } /* 2. setDirection */ @@ -772,7 +772,7 @@ const char KX_ConstraintActuator::GetOption_doc[] = "\tReturns the option parameter.\n"; PyObject* KX_ConstraintActuator::PyGetOption(){ ShowDeprecationWarning("getOption()", "the option property"); - return PyInt_FromLong(m_option); + return PyLong_FromSsize_t(m_option); } /* 2. setTime */ @@ -801,7 +801,7 @@ const char KX_ConstraintActuator::GetTime_doc[] = "\tReturns the time parameter.\n"; PyObject* KX_ConstraintActuator::PyGetTime(){ ShowDeprecationWarning("getTime()", "the time property"); - return PyInt_FromLong(m_activeTime); + return PyLong_FromSsize_t(m_activeTime); } /* 2. setProperty */ @@ -830,7 +830,7 @@ const char KX_ConstraintActuator::GetProperty_doc[] = "\tReturns the property parameter.\n"; PyObject* KX_ConstraintActuator::PyGetProperty(){ ShowDeprecationWarning("getProperty()", "the 'property' property"); - return PyString_FromString(m_property.Ptr()); + return PyUnicode_FromString(m_property.Ptr()); } /* 4. setDistance */ @@ -959,7 +959,7 @@ const char KX_ConstraintActuator::GetLimit_doc[] = "\tReturns the type of constraint.\n"; PyObject* KX_ConstraintActuator::PyGetLimit() { ShowDeprecationWarning("setLimit()", "the limit property"); - return PyInt_FromLong(m_locrot); + return PyLong_FromSsize_t(m_locrot); } /* eof */ diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index be23eff6ac0..955dd18d43e 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -51,7 +51,7 @@ KX_ConstraintWrapper::~KX_ConstraintWrapper() PyObject* KX_ConstraintWrapper::PyGetConstraintId() { - return PyInt_FromLong(m_constraintId); + return PyLong_FromSsize_t(m_constraintId); } diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index 2a769cf6c66..029f1f07861 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -258,7 +258,7 @@ const char KX_GameActuator::GetFile_doc[] = PyObject* KX_GameActuator::PyGetFile(PyObject* args, PyObject* kwds) { ShowDeprecationWarning("getFile()", "the fileName property"); - return PyString_FromString(m_filename); + return PyUnicode_FromString(m_filename); } /* setFile */ diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 30b3cb201a7..5798830e243 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1496,7 +1496,7 @@ PyObject* KX_GameObject::PyGetPosition() static PyObject *Map_GetItem(PyObject *self_v, PyObject *item) { KX_GameObject* self= static_castBGE_PROXY_REF(self_v); - const char *attr_str= PyString_AsString(item); + const char *attr_str= _PyUnicode_AsString(item); CValue* resultattr; PyObject* pyconvert; @@ -1530,7 +1530,7 @@ static PyObject *Map_GetItem(PyObject *self_v, PyObject *item) static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) { KX_GameObject* self= static_castBGE_PROXY_REF(self_v); - const char *attr_str= PyString_AsString(key); + const char *attr_str= _PyUnicode_AsString(key); if(attr_str==NULL) PyErr_Clear(); @@ -1624,7 +1624,7 @@ static int Seq_Contains(PyObject *self_v, PyObject *value) return -1; } - if(PyString_Check(value) && self->GetProperty(PyString_AsString(value))) + if(PyUnicode_Check(value) && self->GetProperty(_PyUnicode_AsString(value))) return 1; if (self->m_attr_dict && PyDict_GetItem(self->m_attr_dict, value)) @@ -1686,7 +1686,7 @@ PyTypeObject KX_GameObject::Type = { PyObject* KX_GameObject::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_GameObject* self= static_cast(self_v); - return PyString_FromString(self->GetName().ReadPtr()); + return PyUnicode_FromString(self->GetName().ReadPtr()); } PyObject* KX_GameObject::pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -1959,13 +1959,13 @@ PyObject* KX_GameObject::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF KX_GameObject* self= static_cast(self_v); int state = 0; state |= self->GetState(); - return PyInt_FromLong(state); + return PyLong_FromSsize_t(state); } int KX_GameObject::pyattr_set_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { KX_GameObject* self= static_cast(self_v); - int state_i = PyInt_AsLong(value); + int state_i = PyLong_AsSsize_t(value); unsigned int state = 0; if (state_i == -1 && PyErr_Occurred()) { @@ -2179,7 +2179,7 @@ PyObject* KX_GameObject::PySetOcclusion(PyObject* args) PyObject* KX_GameObject::PyGetVisible() { ShowDeprecationWarning("getVisible()", "the visible property"); - return PyInt_FromLong(m_bVisible); + return PyLong_FromSsize_t(m_bVisible); } PyObject* KX_GameObject::PyGetState() @@ -2187,13 +2187,13 @@ PyObject* KX_GameObject::PyGetState() ShowDeprecationWarning("getState()", "the state property"); int state = 0; state |= GetState(); - return PyInt_FromLong(state); + return PyLong_FromSsize_t(state); } PyObject* KX_GameObject::PySetState(PyObject* value) { ShowDeprecationWarning("setState()", "the state property"); - int state_i = PyInt_AsLong(value); + int state_i = PyLong_AsSsize_t(value); unsigned int state = 0; if (state_i == -1 && PyErr_Occurred()) { @@ -2499,7 +2499,7 @@ PyObject* KX_GameObject::PyGetPhysicsId() { physid= (uint_ptr)ctrl->GetUserData(); } - return PyInt_FromLong((long)physid); + return PyLong_FromSsize_t((long)physid); } PyObject* KX_GameObject::PyGetPropertyNames() @@ -2875,8 +2875,8 @@ PyObject* KX_GameObject::Pyget(PyObject *args) return NULL; - if(PyString_Check(key)) { - CValue *item = GetProperty(PyString_AsString(key)); + if(PyUnicode_Check(key)) { + CValue *item = GetProperty(_PyUnicode_AsString(key)); if (item) { ret = item->ConvertValueToPython(); if(ret) @@ -2945,13 +2945,13 @@ bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py } } - if (PyString_Check(value)) { - *object = (KX_GameObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String( PyString_AsString(value) )); + if (PyUnicode_Check(value)) { + *object = (KX_GameObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String( _PyUnicode_AsString(value) )); if (*object) { return true; } else { - PyErr_Format(PyExc_ValueError, "%s, requested name \"%s\" did not match any KX_GameObject in this scene", error_prefix, PyString_AsString(value)); + PyErr_Format(PyExc_ValueError, "%s, requested name \"%s\" did not match any KX_GameObject in this scene", error_prefix, _PyUnicode_AsString(value)); return false; } } diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 1abd4399295..947cc9959ff 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -809,7 +809,7 @@ public: */ virtual PyObject* py_repr(void) { - return PyString_FromString(GetName().ReadPtr()); + return PyUnicode_FromString(GetName().ReadPtr()); } KX_PYMETHOD_NOARGS(KX_GameObject,GetPosition); diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index 18e91250233..0edb6747f2f 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -673,7 +673,7 @@ const char KX_IpoActuator::GetType_doc[] = "\tReturns the operation mode of the actuator.\n"; PyObject* KX_IpoActuator::PyGetType() { ShowDeprecationWarning("getType()", "the mode property"); - return PyInt_FromLong(m_type); + return PyLong_FromSsize_t(m_type); } /* 10. setForceIpoActsLocal: */ diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index c7d8ab4f0d1..08542ec1602 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -349,11 +349,11 @@ PyObject* KX_LightObject::pyattr_get_typeconst(void *self_v, const KX_PYATTRIBUT const char* type = attrdef->m_name; if(strcmp(type, "SPOT")) { - retvalue = PyInt_FromLong(RAS_LightObject::LIGHT_SPOT); + retvalue = PyLong_FromSsize_t(RAS_LightObject::LIGHT_SPOT); } else if (strcmp(type, "SUN")) { - retvalue = PyInt_FromLong(RAS_LightObject::LIGHT_SUN); + retvalue = PyLong_FromSsize_t(RAS_LightObject::LIGHT_SUN); } else if (strcmp(type, "NORMAL")) { - retvalue = PyInt_FromLong(RAS_LightObject::LIGHT_NORMAL); + retvalue = PyLong_FromSsize_t(RAS_LightObject::LIGHT_NORMAL); } return retvalue; @@ -362,13 +362,13 @@ PyObject* KX_LightObject::pyattr_get_typeconst(void *self_v, const KX_PYATTRIBUT PyObject* KX_LightObject::pyattr_get_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_LightObject* self = static_cast(self_v); - return PyInt_FromLong(self->m_lightobj.m_type); + return PyLong_FromSsize_t(self->m_lightobj.m_type); } int KX_LightObject::pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value) { KX_LightObject* self = static_cast(self_v); - int val = PyInt_AsLong(value); + int val = PyLong_AsSsize_t(value); if((val==-1 && PyErr_Occurred()) || val<0 || val>2) { PyErr_SetString(PyExc_ValueError, "light.type= val: KX_LightObject, expected an int between 0 and 2"); return PY_SET_ATTR_FAIL; diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index 79aa887601a..2c0c31c96c4 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -132,14 +132,14 @@ PyObject* KX_MeshProxy::PyGetNumMaterials(PyObject* args, PyObject* kwds) { int num = m_meshobj->NumMaterials(); ShowDeprecationWarning("getNumMaterials()", "the numMaterials property"); - return PyInt_FromLong(num); + return PyLong_FromSsize_t(num); } PyObject* KX_MeshProxy::PyGetNumPolygons() { int num = m_meshobj->NumPolygons(); ShowDeprecationWarning("getNumPolygons()", "the numPolygons property"); - return PyInt_FromLong(num); + return PyLong_FromSsize_t(num); } PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds) @@ -155,7 +155,7 @@ PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds) return NULL; } - return PyString_FromString(matname.Ptr()); + return PyUnicode_FromString(matname.Ptr()); } @@ -173,7 +173,7 @@ PyObject* KX_MeshProxy::PyGetTextureName(PyObject* args, PyObject* kwds) return NULL; } - return PyString_FromString(matname.Ptr()); + return PyUnicode_FromString(matname.Ptr()); } @@ -196,7 +196,7 @@ PyObject* KX_MeshProxy::PyGetVertexArrayLength(PyObject* args, PyObject* kwds) length = m_meshobj->NumVertices(mat); } - return PyInt_FromLong(length); + return PyLong_FromSsize_t(length); } @@ -286,12 +286,12 @@ PyObject* KX_MeshProxy::pyattr_get_materials(void *self_v, const KX_PYATTRIBUTE_ PyObject * KX_MeshProxy::pyattr_get_numMaterials(void * selfv, const KX_PYATTRIBUTE_DEF * attrdef) { KX_MeshProxy * self = static_cast (selfv); - return PyInt_FromLong(self->m_meshobj->NumMaterials()); + return PyLong_FromSsize_t(self->m_meshobj->NumMaterials()); } PyObject * KX_MeshProxy::pyattr_get_numPolygons(void * selfv, const KX_PYATTRIBUTE_DEF * attrdef) { KX_MeshProxy * self = static_cast (selfv); - return PyInt_FromLong(self->m_meshobj->NumPolygons()); + return PyLong_FromSsize_t(self->m_meshobj->NumPolygons()); } /* a close copy of ConvertPythonToGameObject but for meshes */ @@ -314,13 +314,13 @@ bool ConvertPythonToMesh(PyObject * value, RAS_MeshObject **object, bool py_none } } - if (PyString_Check(value)) { - *object = (RAS_MeshObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetMeshByName(STR_String( PyString_AsString(value) )); + if (PyUnicode_Check(value)) { + *object = (RAS_MeshObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetMeshByName(STR_String( _PyUnicode_AsString(value) )); if (*object) { return true; } else { - PyErr_Format(PyExc_ValueError, "%s, requested name \"%s\" did not match any KX_MeshProxy in this scene", error_prefix, PyString_AsString(value)); + PyErr_Format(PyExc_ValueError, "%s, requested name \"%s\" did not match any KX_MeshProxy in this scene", error_prefix, _PyUnicode_AsString(value)); return false; } } diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 15e82581bc6..b13c225a16f 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -556,7 +556,7 @@ int KX_ObjectActuator::pyattr_set_forceLimitX(void *self_v, const KX_PYATTRIBUTE { self->m_drot[0] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 0)); self->m_dloc[0] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 1)); - self->m_bitLocalFlag.Torque = (PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 2)) != 0); + self->m_bitLocalFlag.Torque = (PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 2)) != 0); if (!PyErr_Occurred()) { @@ -592,7 +592,7 @@ int KX_ObjectActuator::pyattr_set_forceLimitY(void *self_v, const KX_PYATTRIBUTE { self->m_drot[1] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 0)); self->m_dloc[1] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 1)); - self->m_bitLocalFlag.DLoc = (PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 2)) != 0); + self->m_bitLocalFlag.DLoc = (PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 2)) != 0); if (!PyErr_Occurred()) { @@ -628,7 +628,7 @@ int KX_ObjectActuator::pyattr_set_forceLimitZ(void *self_v, const KX_PYATTRIBUTE { self->m_drot[2] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 0)); self->m_dloc[2] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 1)); - self->m_bitLocalFlag.DRot = (PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 2)) != 0); + self->m_bitLocalFlag.DRot = (PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 2)) != 0); if (!PyErr_Occurred()) { diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index a68bafc4d86..fb2fd614062 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -257,7 +257,7 @@ PyObject* KX_ParentActuator::PyGetObject(PyObject* args) Py_RETURN_NONE; if (ret_name_only) - return PyString_FromString(m_ob->GetName().ReadPtr()); + return PyUnicode_FromString(m_ob->GetName().ReadPtr()); else return m_ob->GetProxy(); } diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index babead25274..7fd667eeaf3 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -99,14 +99,14 @@ PyAttributeDef KX_PolyProxy::Attributes[] = { #if 0 PyObject* KX_PolyProxy::py_getattro(PyObject *attr) { - char *attr_str= PyString_AsString(attr); + char *attr_str= _PyUnicode_AsString(attr); if (!strcmp(attr_str, "matname")) { - return PyString_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName()); + return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName()); } if (!strcmp(attr_str, "texture")) { - return PyString_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName()); + return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName()); } if (!strcmp(attr_str, "material")) { @@ -135,31 +135,31 @@ PyObject* KX_PolyProxy::py_getattro(PyObject *attr) // found it break; } - return PyInt_FromLong(matid); + return PyLong_FromSsize_t(matid); } if (!strcmp(attr_str, "v1")) { - return PyInt_FromLong(m_polygon->GetVertexOffset(0)); + return PyLong_FromSsize_t(m_polygon->GetVertexOffset(0)); } if (!strcmp(attr_str, "v2")) { - return PyInt_FromLong(m_polygon->GetVertexOffset(1)); + return PyLong_FromSsize_t(m_polygon->GetVertexOffset(1)); } if (!strcmp(attr_str, "v3")) { - return PyInt_FromLong(m_polygon->GetVertexOffset(2)); + return PyLong_FromSsize_t(m_polygon->GetVertexOffset(2)); } if (!strcmp(attr_str, "v4")) { - return PyInt_FromLong(((m_polygon->VertexCount()>3)?m_polygon->GetVertexOffset(3):0)); + return PyLong_FromSsize_t(((m_polygon->VertexCount()>3)?m_polygon->GetVertexOffset(3):0)); } if (!strcmp(attr_str, "visible")) { - return PyInt_FromLong(m_polygon->IsVisible()); + return PyLong_FromSsize_t(m_polygon->IsVisible()); } if (!strcmp(attr_str, "collide")) { - return PyInt_FromLong(m_polygon->IsCollider()); + return PyLong_FromSsize_t(m_polygon->IsCollider()); } // py_getattro_up(CValue); // XXX -- todo, make all these attributes } @@ -200,37 +200,37 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterialIndex, // found it break; } - return PyInt_FromLong(matid); + return PyLong_FromSsize_t(matid); } KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getNumVertex, "getNumVertex() : returns the number of vertex of the polygon, 3 or 4\n") { - return PyInt_FromLong(m_polygon->VertexCount()); + return PyLong_FromSsize_t(m_polygon->VertexCount()); } KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, isVisible, "isVisible() : returns whether the polygon is visible or not\n") { - return PyInt_FromLong(m_polygon->IsVisible()); + return PyLong_FromSsize_t(m_polygon->IsVisible()); } KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, isCollider, "isCollider() : returns whether the polygon is receives collision or not\n") { - return PyInt_FromLong(m_polygon->IsCollider()); + return PyLong_FromSsize_t(m_polygon->IsCollider()); } KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterialName, "getMaterialName() : returns the polygon material name, \"NoMaterial\" if no material\n") { - return PyString_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName()); + return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName()); } KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getTextureName, "getTexturelName() : returns the polygon texture name, \"NULL\" if no texture\n") { - return PyString_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName()); + return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName()); } KX_PYMETHODDEF_DOC(KX_PolyProxy, getVertexIndex, @@ -251,9 +251,9 @@ KX_PYMETHODDEF_DOC(KX_PolyProxy, getVertexIndex, } if (index < m_polygon->VertexCount()) { - return PyInt_FromLong(m_polygon->GetVertexOffset(index)); + return PyLong_FromSsize_t(m_polygon->GetVertexOffset(index)); } - return PyInt_FromLong(0); + return PyLong_FromSsize_t(0); } KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMesh, diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index 8d8492cc062..4d5e7ca565b 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -115,7 +115,7 @@ bool KX_PolygonMaterial::Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingI PyObject *ret = PyObject_CallMethod(m_pymaterial, "activate", "(NNO)", pyRasty, pyCachingInfo, (PyObject*) this->m_proxy); if (ret) { - bool value = PyInt_AsLong(ret); + bool value = PyLong_AsSsize_t(ret); Py_DECREF(ret); dopass = value; } @@ -332,13 +332,13 @@ KX_PYMETHODDEF_DOC(KX_PolygonMaterial, activate, "activate(rasty, cachingInfo)") PyObject* KX_PolygonMaterial::pyattr_get_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_PolygonMaterial* self= static_cast(self_v); - return PyString_FromString(self->m_texturename.ReadPtr()); + return PyUnicode_FromString(self->m_texturename.ReadPtr()); } PyObject* KX_PolygonMaterial::pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_PolygonMaterial* self= static_cast(self_v); - return PyString_FromString(self->m_materialname.ReadPtr()); + return PyUnicode_FromString(self->m_materialname.ReadPtr()); } /* this does not seem useful */ @@ -355,7 +355,7 @@ PyObject* KX_PolygonMaterial::pyattr_get_gl_texture(void *self_v, const KX_PYATT if (self->m_tface && self->m_tface->tpage) bindcode= self->m_tface->tpage->bindcode; - return PyInt_FromLong(bindcode); + return PyLong_FromSsize_t(bindcode); } diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index 481c429f658..266b4d7e789 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -116,7 +116,7 @@ public: KX_PYMETHOD_DOC(KX_PolygonMaterial, setCustomMaterial); KX_PYMETHOD_DOC(KX_PolygonMaterial, loadProgram); - virtual PyObject* py_repr(void) { return PyString_FromString(m_material ? ((ID *)m_material)->name+2 : ""); } + virtual PyObject* py_repr(void) { return PyUnicode_FromString(m_material ? ((ID *)m_material)->name+2 : ""); } static PyObject* pyattr_get_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index 4ec901a2f5e..94e8d1fd583 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -640,7 +640,7 @@ PyObject* initPythonConstraintBinding() // Add some symbolic constants to the module d = PyModule_GetDict(m); - ErrorObject = PyString_FromString("PhysicsConstraints.error"); + ErrorObject = PyUnicode_FromString("PhysicsConstraints.error"); PyDict_SetItemString(d, "error", ErrorObject); Py_DECREF(ErrorObject); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 736460d33db..eead7a51885 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -130,10 +130,10 @@ void KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,cons } /* Macro for building the keyboard translation */ -//#define KX_MACRO_addToDict(dict, name) PyDict_SetItemString(dict, #name, PyInt_FromLong(SCA_IInputDevice::KX_##name)) -#define KX_MACRO_addToDict(dict, name) PyDict_SetItemString(dict, #name, item=PyInt_FromLong(name)); Py_DECREF(item) +//#define KX_MACRO_addToDict(dict, name) PyDict_SetItemString(dict, #name, PyLong_FromSsize_t(SCA_IInputDevice::KX_##name)) +#define KX_MACRO_addToDict(dict, name) PyDict_SetItemString(dict, #name, item=PyLong_FromSsize_t(name)); Py_DECREF(item) /* For the defines for types from logic bricks, we do stuff explicitly... */ -#define KX_MACRO_addTypesToDict(dict, name, name2) PyDict_SetItemString(dict, #name, item=PyInt_FromLong(name2)); Py_DECREF(item) +#define KX_MACRO_addTypesToDict(dict, name, name2) PyDict_SetItemString(dict, #name, item=PyLong_FromSsize_t(name2)); Py_DECREF(item) // temporarily python stuff, will be put in another place later ! @@ -181,7 +181,7 @@ static PyObject* gPyExpandPath(PyObject*, PyObject* args) BLI_strncpy(expanded, filename, FILE_MAXDIR + FILE_MAXFILE); BLI_convertstringcode(expanded, gp_GamePythonPath); - return PyString_FromString(expanded); + return PyUnicode_FromString(expanded); } static char gPySendMessage_doc[] = @@ -306,7 +306,7 @@ static PyObject* gPySetMaxLogicFrame(PyObject*, PyObject* args) static PyObject* gPyGetMaxLogicFrame(PyObject*) { - return PyInt_FromLong(KX_KetsjiEngine::GetMaxLogicFrame()); + return PyLong_FromSsize_t(KX_KetsjiEngine::GetMaxLogicFrame()); } static PyObject* gPySetMaxPhysicsFrame(PyObject*, PyObject* args) @@ -321,7 +321,7 @@ static PyObject* gPySetMaxPhysicsFrame(PyObject*, PyObject* args) static PyObject* gPyGetMaxPhysicsFrame(PyObject*) { - return PyInt_FromLong(KX_KetsjiEngine::GetMaxPhysicsFrame()); + return PyLong_FromSsize_t(KX_KetsjiEngine::GetMaxPhysicsFrame()); } static PyObject* gPySetPhysicsTicRate(PyObject*, PyObject* args) @@ -386,7 +386,7 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args) while ((dirp = readdir(dp)) != NULL) { if (BLI_testextensie(dirp->d_name, ".blend")) { - value = PyString_FromString(dirp->d_name); + value = PyUnicode_FromString(dirp->d_name); PyList_Append(list, value); Py_DECREF(value); } @@ -500,7 +500,7 @@ static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *) static PyObject *gEvalExpression(PyObject*, PyObject* value) { - char* txt= PyString_AsString(value); + char* txt= _PyUnicode_AsString(value); if (txt==NULL) { PyErr_SetString(PyExc_TypeError, "Expression.calc(text): expects a single string argument"); @@ -558,14 +558,14 @@ static struct PyMethodDef game_methods[] = { static PyObject* gPyGetWindowHeight(PyObject*, PyObject* args) { - return PyInt_FromLong((gp_Canvas ? gp_Canvas->GetHeight() : 0)); + return PyLong_FromSsize_t((gp_Canvas ? gp_Canvas->GetHeight() : 0)); } static PyObject* gPyGetWindowWidth(PyObject*, PyObject* args) { - return PyInt_FromLong((gp_Canvas ? gp_Canvas->GetWidth() : 0)); + return PyLong_FromSsize_t((gp_Canvas ? gp_Canvas->GetWidth() : 0)); } @@ -893,7 +893,7 @@ static PyObject* gPyGetGLSLMaterialSetting(PyObject*, } enabled = ((G.fileflags & flag) != 0); - return PyInt_FromLong(enabled); + return PyLong_FromSsize_t(enabled); } #define KX_TEXFACE_MATERIAL 0 @@ -937,7 +937,7 @@ static PyObject* gPyGetMaterialType(PyObject*) else flag = KX_TEXFACE_MATERIAL; - return PyInt_FromLong(flag); + return PyLong_FromSsize_t(flag); } static PyObject* gPyDrawLine(PyObject*, PyObject* args) @@ -1075,7 +1075,7 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack PyDict_SetItemString(d, "globalDict", item=PyDict_New()); Py_DECREF(item); - ErrorObject = PyString_FromString("GameLogic.error"); + ErrorObject = PyUnicode_FromString("GameLogic.error"); PyDict_SetItemString(d, "error", ErrorObject); Py_DECREF(ErrorObject); @@ -1362,7 +1362,7 @@ PyObject *KXpy_import(PyObject *self, PyObject *args) /* check for builtin modules */ m = PyImport_AddModule("sys"); l = PyObject_GetAttrString(m, "builtin_module_names"); - n = PyString_FromString(name); + n = PyUnicode_FromString(name); if (PySequence_Contains(l, n)) { return PyImport_ImportModuleEx(name, globals, locals, fromlist); @@ -1538,7 +1538,7 @@ static void initPySysObjects__append(PyObject *sys_path, char *filename) BLI_split_dirfile_basic(filename, expanded, NULL); /* get the dir part of filename only */ BLI_convertstringcode(expanded, gp_GamePythonPath); /* filename from lib->filename is (always?) absolute, so this may not be needed but it wont hurt */ BLI_cleanup_file(gp_GamePythonPath, expanded); /* Dont use BLI_cleanup_dir because it adds a slash - BREAKS WIN32 ONLY */ - item= PyString_FromString(expanded); + item= PyUnicode_FromString(expanded); // printf("SysPath - '%s', '%s', '%s'\n", expanded, filename, gp_GamePythonPath); @@ -1735,7 +1735,7 @@ PyObject* initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas) // Add some symbolic constants to the module d = PyModule_GetDict(m); - ErrorObject = PyString_FromString("Rasterizer.error"); + ErrorObject = PyUnicode_FromString("Rasterizer.error"); PyDict_SetItemString(d, "error", ErrorObject); Py_DECREF(ErrorObject); @@ -1813,10 +1813,10 @@ static PyObject* gPyEventToCharacter(PyObject*, PyObject* args) if(IsPrintable(event)) { char ch[2] = {'\0', '\0'}; ch[0] = ToCharacter(event, (bool)shift); - return PyString_FromString(ch); + return PyUnicode_FromString(ch); } else { - return PyString_FromString(""); + return PyUnicode_FromString(""); } } @@ -2044,7 +2044,7 @@ int saveGamePythonConfig( char **marshal_buffer) char *marshal_cstring; #if PY_VERSION_HEX < 0x03000000 - marshal_cstring = PyString_AsString(pyGlobalDictMarshal); + marshal_cstring = _PyUnicode_AsString(pyGlobalDictMarshal); marshal_length= PyString_Size(pyGlobalDictMarshal); #else // py3 uses byte arrays marshal_cstring = PyBytes_AsString(pyGlobalDictMarshal); diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp index 524d957a80c..5b4d77156db 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.cpp +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -221,11 +221,11 @@ static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) return NULL; } - if (PyInt_Check(key)) { - return KX_PythonSeq_getIndex(self, PyInt_AS_LONG( key )); + if (PyLong_Check(key)) { + return KX_PythonSeq_getIndex(self, PyLong_AsSsize_t( key )); } - else if ( PyString_Check(key) ) { - char *name = PyString_AsString(key); + else if ( PyUnicode_Check(key) ) { + char *name = _PyUnicode_AsString(key); PyObjectPlus *ret = KX_PythonSeq_subscript__internal(self, name); if(ret) { @@ -250,12 +250,12 @@ static int KX_PythonSeq_contains(PyObject *self, PyObject *key) PyErr_SetString(PyExc_SystemError, "key in seq, KX_PythonSeq: "BGE_PROXY_ERROR_MSG); return -1; } - if(!PyString_Check(key)) { + if(!PyUnicode_Check(key)) { PyErr_SetString(PyExc_SystemError, "key in seq, KX_PythonSeq: key must be a string"); return -1; } - if(KX_PythonSeq_subscript__internal(self, PyString_AsString(key))) + if(KX_PythonSeq_subscript__internal(self, _PyUnicode_AsString(key))) return 1; return 0; diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index 2a4ae3a2abd..69214dbbbcf 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -298,7 +298,7 @@ const char KX_SCA_AddObjectActuator::SetTime_doc[] = PyObject* KX_SCA_AddObjectActuator::PySetTime(PyObject* value) { ShowDeprecationWarning("setTime()", "the time property"); - int deltatime = PyInt_AsLong(value); + int deltatime = PyLong_AsSsize_t(value); if (deltatime==-1 && PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "expected an int"); return NULL; @@ -321,7 +321,7 @@ const char KX_SCA_AddObjectActuator::GetTime_doc[] = PyObject* KX_SCA_AddObjectActuator::PyGetTime() { ShowDeprecationWarning("getTime()", "the time property"); - return PyInt_FromLong(m_timeProp); + return PyLong_FromSsize_t(m_timeProp); } @@ -343,7 +343,7 @@ PyObject* KX_SCA_AddObjectActuator::PyGetObject(PyObject* args) Py_RETURN_NONE; if (ret_name_only) - return PyString_FromString(m_OriginalObject->GetName().ReadPtr()); + return PyUnicode_FromString(m_OriginalObject->GetName().ReadPtr()); else return m_OriginalObject->GetProxy(); } diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp index 8626512fdf3..3cff9457c34 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp @@ -121,7 +121,7 @@ KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, getOperation, ) { ShowDeprecationWarning("getOperation()", "the mode property"); - return PyInt_FromLong((long)m_dyn_operation); + return PyLong_FromSsize_t((long)m_dyn_operation); } diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp index 873272a37f9..ee50008edae 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp @@ -140,7 +140,7 @@ KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, getMesh, if (!m_mesh) Py_RETURN_NONE; - return PyString_FromString(const_cast(m_mesh->GetName().ReadPtr())); + return PyUnicode_FromString(const_cast(m_mesh->GetName().ReadPtr())); } diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index f2bbc8e6fef..5f3ed690adc 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1653,7 +1653,7 @@ PyMethodDef KX_Scene::Methods[] = { PyObject* KX_Scene::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_Scene* self= static_cast(self_v); - return PyString_FromString(self->GetName().ReadPtr()); + return PyUnicode_FromString(self->GetName().ReadPtr()); } PyObject* KX_Scene::pyattr_get_objects(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -1753,7 +1753,7 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getName, ) { ShowDeprecationWarning("getName()", "the name property"); - return PyString_FromString(GetName()); + return PyUnicode_FromString(GetName()); } KX_PYMETHODDEF_DOC(KX_Scene, addObject, diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index edc4297ff14..2792f1f5fe4 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -563,7 +563,7 @@ public: static PyObject* pyattr_get_active_camera(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); - virtual PyObject* py_repr(void) { return PyString_FromString(GetName().ReadPtr()); } + virtual PyObject* py_repr(void) { return PyUnicode_FromString(GetName().ReadPtr()); } /** * Sets the time the scene was suspended diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index 16521f2ddcc..76869f82c1a 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -332,7 +332,7 @@ const char KX_SceneActuator::GetUseRestart_doc[] = PyObject* KX_SceneActuator::PyGetUseRestart() { ShowDeprecationWarning("getUseRestart()", "the useRestart property"); - return PyInt_FromLong(!(m_restart == 0)); + return PyLong_FromSsize_t(!(m_restart == 0)); } @@ -368,7 +368,7 @@ const char KX_SceneActuator::GetScene_doc[] = PyObject* KX_SceneActuator::PyGetScene() { ShowDeprecationWarning("getScene()", "the scene property"); - return PyString_FromString(m_nextSceneName); + return PyUnicode_FromString(m_nextSceneName); } @@ -409,7 +409,7 @@ PyObject* KX_SceneActuator::PyGetCamera() { ShowDeprecationWarning("getCamera()", "the camera property"); if (m_camera) { - return PyString_FromString(m_camera->GetName()); + return PyUnicode_FromString(m_camera->GetName()); } else { Py_RETURN_NONE; diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index 28e46cc9fa2..0ad699fd811 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -338,7 +338,7 @@ PyObject* KX_SoundActuator::pyattr_get_filename(void *self, const struct KX_PYAT KX_SoundActuator * actuator = static_cast (self); if (!actuator->m_soundObject) { - return PyString_FromString(""); + return PyUnicode_FromString(""); } STR_String objectname = actuator->m_soundObject->GetObjectName(); char* name = objectname.Ptr(); @@ -347,7 +347,7 @@ PyObject* KX_SoundActuator::pyattr_get_filename(void *self, const struct KX_PYAT PyErr_SetString(PyExc_RuntimeError, "value = actuator.fileName: KX_SoundActuator, unable to get sound fileName"); return NULL; } else - return PyString_FromString(name); + return PyUnicode_FromString(name); } PyObject* KX_SoundActuator::pyattr_get_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) @@ -382,7 +382,7 @@ PyObject* KX_SoundActuator::pyattr_get_looping(void *self, const struct KX_PYATT { KX_SoundActuator * actuator = static_cast (self); int looping = (actuator->m_soundObject) ? actuator->m_soundObject->GetLoopMode() : (int)SND_LOOP_OFF; - PyObject* result = PyInt_FromLong(looping); + PyObject* result = PyLong_FromSsize_t(looping); return result; } @@ -560,7 +560,7 @@ PyObject* KX_SoundActuator::PyGetFilename() ShowDeprecationWarning("getFilename()", "the fileName property"); if (!m_soundObject) { - return PyString_FromString(""); + return PyUnicode_FromString(""); } STR_String objectname = m_soundObject->GetObjectName(); char* name = objectname.Ptr(); @@ -569,7 +569,7 @@ PyObject* KX_SoundActuator::PyGetFilename() PyErr_SetString(PyExc_RuntimeError, "Unable to get sound fileName"); return NULL; } else - return PyString_FromString(name); + return PyUnicode_FromString(name); } PyObject* KX_SoundActuator::PySetGain(PyObject* args) @@ -669,7 +669,7 @@ PyObject* KX_SoundActuator::PyGetLooping() { ShowDeprecationWarning("getLooping()", "the looping property"); int looping = (m_soundObject) ? m_soundObject->GetLoopMode() : (int)SND_LOOP_OFF; - PyObject* result = PyInt_FromLong(looping); + PyObject* result = PyLong_FromSsize_t(looping); return result; } @@ -757,7 +757,7 @@ PyObject* KX_SoundActuator::PySetType(PyObject* args) PyObject* KX_SoundActuator::PyGetType() { ShowDeprecationWarning("getType()", "the mode property"); - return PyInt_FromLong(m_type); + return PyLong_FromSsize_t(m_type); } // <----- diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 8686de8f2ca..32c19df3542 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -357,7 +357,7 @@ const char KX_TouchSensor::SetProperty_doc[] = PyObject* KX_TouchSensor::PySetProperty(PyObject* value) { ShowDeprecationWarning("setProperty()", "the propName property"); - char *nameArg= PyString_AsString(value); + char *nameArg= _PyUnicode_AsString(value); if (nameArg==NULL) { PyErr_SetString(PyExc_ValueError, "expected a "); return NULL; @@ -375,7 +375,7 @@ const char KX_TouchSensor::GetProperty_doc[] = PyObject* KX_TouchSensor::PyGetProperty() { ShowDeprecationWarning("getProperty()", "the propName property"); - return PyString_FromString(m_touchedpropname); + return PyUnicode_FromString(m_touchedpropname); } const char KX_TouchSensor::GetHitObject_doc[] = @@ -416,7 +416,7 @@ const char KX_TouchSensor::GetTouchMaterial_doc[] = PyObject* KX_TouchSensor::PyGetTouchMaterial() { ShowDeprecationWarning("getTouchMaterial()", "the useMaterial property"); - return PyInt_FromLong(m_bFindMaterial); + return PyLong_FromSsize_t(m_bFindMaterial); } /* 6. setTouchMaterial */ @@ -429,7 +429,7 @@ const char KX_TouchSensor::SetTouchMaterial_doc[] = PyObject* KX_TouchSensor::PySetTouchMaterial(PyObject *value) { ShowDeprecationWarning("setTouchMaterial()", "the useMaterial property"); - int pulseArg = PyInt_AsLong(value); + int pulseArg = PyLong_AsSsize_t(value); if(pulseArg ==-1 && PyErr_Occurred()) { PyErr_SetString(PyExc_ValueError, "expected a bool"); diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index 12f0137977a..49737a6dfc2 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -552,7 +552,7 @@ PyObject* KX_TrackToActuator::PyGetObject(PyObject* args) Py_RETURN_NONE; if (ret_name_only) - return PyString_FromString(m_object->GetName()); + return PyUnicode_FromString(m_object->GetName()); else return m_object->GetProxy(); } @@ -589,7 +589,7 @@ const char KX_TrackToActuator::GetTime_doc[] = PyObject* KX_TrackToActuator::PyGetTime() { ShowDeprecationWarning("getTime()", "the timer property"); - return PyInt_FromLong(m_time); + return PyLong_FromSsize_t(m_time); } @@ -601,7 +601,7 @@ const char KX_TrackToActuator::GetUse3D_doc[] = PyObject* KX_TrackToActuator::PyGetUse3D() { ShowDeprecationWarning("setTime()", "the use3D property"); - return PyInt_FromLong(!(m_allow3D == 0)); + return PyLong_FromSsize_t(!(m_allow3D == 0)); } diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp index b742c9d145a..484c8f38b3f 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp @@ -127,13 +127,13 @@ PyObject* KX_VehicleWrapper::PyGetWheelOrientationQuaternion(PyObject* args) PyObject* KX_VehicleWrapper::PyGetNumWheels(PyObject* args) { - return PyInt_FromLong(m_vehicle->GetNumWheels()); + return PyLong_FromSsize_t(m_vehicle->GetNumWheels()); } PyObject* KX_VehicleWrapper::PyGetConstraintId(PyObject* args) { - return PyInt_FromLong(m_vehicle->GetUserConstraintId()); + return PyLong_FromSsize_t(m_vehicle->GetUserConstraintId()); } @@ -264,7 +264,7 @@ PyObject* KX_VehicleWrapper::PySetSteeringValue(PyObject* args) PyObject* KX_VehicleWrapper::PyGetConstraintType(PyObject* args) { - return PyInt_FromLong(m_vehicle->GetUserConstraintType()); + return PyLong_FromSsize_t(m_vehicle->GetUserConstraintType()); } diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index e4192bf7d67..34a84f908a8 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -114,7 +114,7 @@ PyAttributeDef KX_VertexProxy::Attributes[] = { PyObject* KX_VertexProxy::py_getattro(PyObject *attr) { - char *attr_str= PyString_AsString(attr); + char *attr_str= _PyUnicode_AsString(attr); if (attr_str[1]=='\0') { // Group single letters // pos if (attr_str[0]=='x') @@ -169,7 +169,7 @@ KX_VertexProxy::py_getattro(PyObject *attr) #if 0 int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) { - char *attr_str= PyString_AsString(attr); + char *attr_str= _PyUnicode_AsString(attr); if (PySequence_Check(pyvalue)) { if (!strcmp(attr_str, "XYZ")) @@ -384,13 +384,13 @@ PyObject* KX_VertexProxy::PySetNormal(PyObject* value) PyObject* KX_VertexProxy::PyGetRGBA() { int *rgba = (int *) m_vertex->getRGBA(); - return PyInt_FromLong(*rgba); + return PyLong_FromSsize_t(*rgba); } PyObject* KX_VertexProxy::PySetRGBA(PyObject* value) { - if PyInt_Check(value) { - int rgba = PyInt_AsLong(value); + if PyLong_Check(value) { + int rgba = PyLong_AsSsize_t(value); m_vertex->SetRGBA(rgba); m_mesh->SetMeshModified(true); Py_RETURN_NONE; diff --git a/source/gameengine/VideoTexture/FilterBlueScreen.cpp b/source/gameengine/VideoTexture/FilterBlueScreen.cpp index 6b23105a278..6d26e5b6d35 100644 --- a/source/gameengine/VideoTexture/FilterBlueScreen.cpp +++ b/source/gameengine/VideoTexture/FilterBlueScreen.cpp @@ -81,17 +81,17 @@ static int setColor (PyFilter * self, PyObject * value, void * closure) { // check validity of parameter if (value == NULL || !PySequence_Check(value) || PySequence_Length(value) != 3 - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 0)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 1)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 2))) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 0)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 1)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 2))) { PyErr_SetString(PyExc_TypeError, "The value must be a sequence of 3 ints"); return -1; } // set color - getFilter(self)->setColor((unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 0))), - (unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 1))), - (unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 2)))); + getFilter(self)->setColor((unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 0))), + (unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 1))), + (unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 2)))); // success return 0; } @@ -108,15 +108,15 @@ static int setLimits (PyFilter * self, PyObject * value, void * closure) { // check validity of parameter if (value == NULL || !PySequence_Check(value) || PySequence_Length(value) != 2 - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 0)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 1))) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 0)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 1))) { PyErr_SetString(PyExc_TypeError, "The value must be a sequence of 2 ints"); return -1; } // set limits - getFilter(self)->setLimits((unsigned short)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 0))), - (unsigned short)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 1)))); + getFilter(self)->setLimits((unsigned short)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 0))), + (unsigned short)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 1)))); // success return 0; } diff --git a/source/gameengine/VideoTexture/FilterColor.cpp b/source/gameengine/VideoTexture/FilterColor.cpp index 5ff1f7f11ce..eb86f520e02 100644 --- a/source/gameengine/VideoTexture/FilterColor.cpp +++ b/source/gameengine/VideoTexture/FilterColor.cpp @@ -147,10 +147,10 @@ static int setMatrix (PyFilter * self, PyObject * value, void * closure) for (int c = 0; valid && c < 5; ++c) { // item must be int - valid = PyInt_Check(PySequence_Fast_GET_ITEM(row, c)); + valid = PyLong_Check(PySequence_Fast_GET_ITEM(row, c)); // if it is valid, save it in matrix if (valid) - mat[r][c] = short(PyInt_AsLong(PySequence_Fast_GET_ITEM(row, c))); + mat[r][c] = short(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(row, c))); } } // if parameter is not valid, report error @@ -286,10 +286,10 @@ static int setLevels (PyFilter * self, PyObject * value, void * closure) for (int c = 0; valid && c < 2; ++c) { // item must be int - valid = PyInt_Check(PySequence_Fast_GET_ITEM(row, c)); + valid = PyLong_Check(PySequence_Fast_GET_ITEM(row, c)); // if it is valid, save it in matrix if (valid) - lev[r][c] = (unsigned short)(PyInt_AsLong(PySequence_Fast_GET_ITEM(row, c))); + lev[r][c] = (unsigned short)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(row, c))); } } // if parameter is not valid, report error diff --git a/source/gameengine/VideoTexture/FilterNormal.cpp b/source/gameengine/VideoTexture/FilterNormal.cpp index 9a2b1e90d5a..002be6c3189 100644 --- a/source/gameengine/VideoTexture/FilterNormal.cpp +++ b/source/gameengine/VideoTexture/FilterNormal.cpp @@ -72,13 +72,13 @@ static PyObject * getColor (PyFilter * self, void * closure) static int setColor (PyFilter * self, PyObject * value, void * closure) { // check validity of parameter - if (value == NULL || !PyInt_Check(value)) + if (value == NULL || !PyLong_Check(value)) { PyErr_SetString(PyExc_TypeError, "filt.colorIdx = int: VideoTexture.FilterNormal, expected the value must be a int"); return -1; } // set color index - getFilter(self)->setColor((unsigned short)(PyInt_AsLong(value))); + getFilter(self)->setColor((unsigned short)(PyLong_AsSsize_t(value))); // success return 0; } diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index c4fb1fefd9c..d8be08e0eb5 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -331,19 +331,19 @@ static int setBackground (PyImage * self, PyObject * value, void * closure) { // check validity of parameter if (value == NULL || !PySequence_Check(value) || PySequence_Length(value) != 4 - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 0)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 1)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 2)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 3))) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 0)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 1)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 2)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 3))) { PyErr_SetString(PyExc_TypeError, "The value must be a sequence of 4 integer between 0 and 255"); return -1; } // set background color - getImageRender(self)->setBackground((unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 0))), - (unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 1))), - (unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 2))), - (unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 3)))); + getImageRender(self)->setBackground((unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 0))), + (unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 1))), + (unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 2))), + (unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 3)))); // success return 0; } diff --git a/source/gameengine/VideoTexture/ImageViewport.cpp b/source/gameengine/VideoTexture/ImageViewport.cpp index d2c23e758f6..55b14396280 100644 --- a/source/gameengine/VideoTexture/ImageViewport.cpp +++ b/source/gameengine/VideoTexture/ImageViewport.cpp @@ -218,16 +218,16 @@ static int ImageViewport_setPosition (PyImage * self, PyObject * value, void * c { // check validity of parameter if (value == NULL || !PySequence_Check(value) || PySequence_Length(value) != 2 - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 0)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 1))) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 0)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 1))) { PyErr_SetString(PyExc_TypeError, "The value must be a sequence of 2 ints"); return -1; } // set position GLint pos [] = { - GLint(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 0))), - GLint(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 1))) + GLint(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 0))), + GLint(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 1))) }; getImageViewport(self)->setPosition(pos); // success @@ -246,16 +246,16 @@ int ImageViewport_setCaptureSize (PyImage * self, PyObject * value, void * closu { // check validity of parameter if (value == NULL || !PySequence_Check(value) || PySequence_Length(value) != 2 - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 0)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 1))) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 0)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 1))) { PyErr_SetString(PyExc_TypeError, "The value must be a sequence of 2 ints"); return -1; } // set capture size short size [] = { - short(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 0))), - short(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 1))) + short(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 0))), + short(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 1))) }; getImageViewport(self)->setCaptureSize(size); // success diff --git a/source/gameengine/VideoTexture/VideoBase.cpp b/source/gameengine/VideoTexture/VideoBase.cpp index 5d449a158d8..5de7a9e80a9 100644 --- a/source/gameengine/VideoTexture/VideoBase.cpp +++ b/source/gameengine/VideoTexture/VideoBase.cpp @@ -167,13 +167,13 @@ PyObject * Video_getRepeat (PyImage * self, void * closure) int Video_setRepeat (PyImage * self, PyObject * value, void * closure) { // check validity of parameter - if (value == NULL || !PyInt_Check(value)) + if (value == NULL || !PyLong_Check(value)) { PyErr_SetString(PyExc_TypeError, "The value must be an int"); return -1; } // set repeat - getVideo(self)->setRepeat(int(PyInt_AsLong(value))); + getVideo(self)->setRepeat(int(PyLong_AsSsize_t(value))); // success return 0; } diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp index 1a5481488c0..cf4ea88c1b5 100644 --- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp +++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp @@ -1095,13 +1095,13 @@ PyObject * VideoFFmpeg_getPreseek (PyImage *self, void * closure) int VideoFFmpeg_setPreseek (PyImage * self, PyObject * value, void * closure) { // check validity of parameter - if (value == NULL || !PyInt_Check(value)) + if (value == NULL || !PyLong_Check(value)) { PyErr_SetString(PyExc_TypeError, "The value must be an integer"); return -1; } // set preseek - getFFmpeg(self)->setPreseek(PyInt_AsLong(value)); + getFFmpeg(self)->setPreseek(PyLong_AsSsize_t(value)); // success return 0; } diff --git a/source/gameengine/VideoTexture/blendVideoTex.cpp b/source/gameengine/VideoTexture/blendVideoTex.cpp index dad52a426b6..22171f69321 100644 --- a/source/gameengine/VideoTexture/blendVideoTex.cpp +++ b/source/gameengine/VideoTexture/blendVideoTex.cpp @@ -67,7 +67,7 @@ static PyObject * getMaterialID (PyObject *self, PyObject *args) // get last error description static PyObject * getLastError (PyObject *self, PyObject *args) { - return PyString_FromString(Exception::m_lastError.c_str()); + return PyUnicode_FromString(Exception::m_lastError.c_str()); } // set log file -- cgit v1.2.3 From 2c3e8850a53020310a6a8f5c51b764ca261c24c0 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 29 Jun 2009 03:02:41 +0000 Subject: NLA SoC: Insert Keyframe Operator Tweaks (Anim Editor Versions) * Insert Keyframe (IKEY) operator for Graph Editor * Renamed the DopeSheet version to make it more consistent with the other keyframing operators --- source/blender/editors/space_action/action_edit.c | 8 +- .../blender/editors/space_action/action_header.c | 2 +- .../blender/editors/space_action/action_intern.h | 2 +- source/blender/editors/space_action/action_ops.c | 4 +- source/blender/editors/space_graph/graph_edit.c | 98 +++++++++++++++++++++- source/blender/editors/space_graph/graph_header.c | 2 +- source/blender/editors/space_graph/graph_intern.h | 1 + source/blender/editors/space_graph/graph_ops.c | 2 + 8 files changed, 109 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index dd351c92cf2..505ff18d7bd 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -433,10 +433,10 @@ static int actkeys_insertkey_exec(bContext *C, wmOperator *op) if (ac.datatype == ANIMCONT_GPENCIL) return OPERATOR_CANCELLED; - /* get snapping mode */ + /* what channels to affect? */ mode= RNA_enum_get(op->ptr, "type"); - /* snap keyframes */ + /* insert keyframes */ insert_action_keys(&ac, mode); /* validate keyframes after editing */ @@ -448,11 +448,11 @@ static int actkeys_insertkey_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ACT_OT_insert (wmOperatorType *ot) +void ACT_OT_insert_keyframe (wmOperatorType *ot) { /* identifiers */ ot->name= "Insert Keyframes"; - ot->idname= "ACT_OT_insert"; + ot->idname= "ACT_OT_insert_keyframe"; /* api callbacks */ ot->invoke= WM_menu_invoke; diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index 62e7a2d8e3f..b2614411002 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -211,7 +211,7 @@ static void act_editmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); - uiItemO(layout, NULL, 0, "ACT_OT_insert"); + uiItemO(layout, NULL, 0, "ACT_OT_insert_keyframe"); uiItemS(layout); diff --git a/source/blender/editors/space_action/action_intern.h b/source/blender/editors/space_action/action_intern.h index 6ccdc07421b..26655892176 100644 --- a/source/blender/editors/space_action/action_intern.h +++ b/source/blender/editors/space_action/action_intern.h @@ -83,7 +83,7 @@ void ACT_OT_view_all(struct wmOperatorType *ot); void ACT_OT_copy(struct wmOperatorType *ot); void ACT_OT_paste(struct wmOperatorType *ot); -void ACT_OT_insert(struct wmOperatorType *ot); +void ACT_OT_insert_keyframe(struct wmOperatorType *ot); void ACT_OT_duplicate(struct wmOperatorType *ot); void ACT_OT_delete(struct wmOperatorType *ot); void ACT_OT_clean(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index c023062453c..674506ddba0 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -79,7 +79,7 @@ void action_operatortypes(void) WM_operatortype_append(ACT_OT_clean); WM_operatortype_append(ACT_OT_delete); WM_operatortype_append(ACT_OT_duplicate); - WM_operatortype_append(ACT_OT_insert); + WM_operatortype_append(ACT_OT_insert_keyframe); WM_operatortype_append(ACT_OT_copy); WM_operatortype_append(ACT_OT_paste); @@ -142,7 +142,7 @@ static void action_keymap_keyframes (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "ACT_OT_delete", DELKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "ACT_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "ACT_OT_insert", IKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "ACT_OT_insert_keyframe", IKEY, KM_PRESS, 0, 0); /* copy/paste */ WM_keymap_add_item(keymap, "ACT_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0); diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index e38c24ed223..1fc4572b9c6 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -399,7 +399,103 @@ void GRAPH_OT_ghost_curves_clear (wmOperatorType *ot) /* ************************************************************************** */ /* GENERAL STUFF */ -// TODO: insertkey +/* ******************** Insert Keyframes Operator ************************* */ + +/* defines for insert keyframes tool */ +EnumPropertyItem prop_graphkeys_insertkey_types[] = { + {1, "ALL", 0, "All Channels", ""}, + {2, "SEL", 0, "Only Selected Channels", ""}, + {0, NULL, 0, NULL, NULL} +}; + +/* this function is responsible for snapping keyframes to frame-times */ +static void insert_graph_keys(bAnimContext *ac, short mode) +{ + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + Scene *scene= ac->scene; + float cfra= (float)CFRA; + short flag = 0; + + /* filter data */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + if (mode == 2) filter |= ANIMFILTER_SEL; + + ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); + + /* init keyframing flag */ + if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX; + if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED; + // if (IS_AUTOKEY_MODE(EDITKEYS)) flag |= INSERTKEY_REPLACE; + + /* insert keyframes */ + for (ale= anim_data.first; ale; ale= ale->next) { + AnimData *adt= ANIM_nla_mapping_get(ac, ale); + FCurve *fcu= (FCurve *)ale->key_data; + + /* adjust current frame for NLA-mapping */ + if (adt) + cfra= BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); + else + cfra= (float)CFRA; + + /* if there's an id */ + if (ale->id) + insert_keyframe(ale->id, NULL, ((fcu->grp)?(fcu->grp->name):(NULL)), fcu->rna_path, fcu->array_index, cfra, flag); + else + insert_vert_fcurve(fcu, cfra, fcu->curval, 0); + } + + BLI_freelistN(&anim_data); +} + +/* ------------------- */ + +static int graphkeys_insertkey_exec(bContext *C, wmOperator *op) +{ + bAnimContext ac; + short mode; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + if (ac.datatype == ANIMCONT_GPENCIL) + return OPERATOR_CANCELLED; + + /* which channels to affect? */ + mode= RNA_enum_get(op->ptr, "type"); + + /* insert keyframes */ + insert_graph_keys(&ac, mode); + + /* validate keyframes after editing */ + ANIM_editkeyframes_refresh(&ac); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + + return OPERATOR_FINISHED; +} + +void GRAPH_OT_insert_keyframe (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Insert Keyframes"; + ot->idname= "GRAPH_OT_insert_keyframe"; + + /* api callbacks */ + ot->invoke= WM_menu_invoke; + ot->exec= graphkeys_insertkey_exec; + ot->poll= ED_operator_ipo_active; // xxx + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* id-props */ + RNA_def_enum(ot->srna, "type", prop_graphkeys_insertkey_types, 0, "Type", ""); +} /* ******************** Click-Insert Keyframes Operator ************************* */ diff --git a/source/blender/editors/space_graph/graph_header.c b/source/blender/editors/space_graph/graph_header.c index 0bd08625d68..b07bd4b0ded 100644 --- a/source/blender/editors/space_graph/graph_header.c +++ b/source/blender/editors/space_graph/graph_header.c @@ -201,7 +201,7 @@ static void graph_editmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); - //uiItemO(layout, NULL, 0, "GRAPH_OT_insert"); + uiItemO(layout, NULL, 0, "GRAPH_OT_insert_keyframe"); uiItemO(layout, NULL, 0, "GRAPH_OT_fmodifier_add"); uiItemS(layout); diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h index 93e3df1c728..d520a63c126 100644 --- a/source/blender/editors/space_graph/graph_intern.h +++ b/source/blender/editors/space_graph/graph_intern.h @@ -86,6 +86,7 @@ void GRAPH_OT_previewrange_set(struct wmOperatorType *ot); void GRAPH_OT_view_all(struct wmOperatorType *ot); void GRAPH_OT_click_insert(struct wmOperatorType *ot); +void GRAPH_OT_insert_keyframe(struct wmOperatorType *ot); void GRAPH_OT_copy(struct wmOperatorType *ot); void GRAPH_OT_paste(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index f7799023f34..012bfd944b4 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -132,6 +132,7 @@ void graphedit_operatortypes(void) WM_operatortype_append(GRAPH_OT_copy); WM_operatortype_append(GRAPH_OT_paste); + WM_operatortype_append(GRAPH_OT_insert_keyframe); WM_operatortype_append(GRAPH_OT_click_insert); /* F-Curve Modifiers */ @@ -209,6 +210,7 @@ static void graphedit_keymap_keyframes (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "GRAPH_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); /* insertkey */ + WM_keymap_add_item(keymap, "GRAPH_OT_insert_keyframe", IKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "GRAPH_OT_click_insert", LEFTMOUSE, KM_PRESS, KM_CTRL, 0); /* copy/paste */ -- cgit v1.2.3 From 7ca31bb171b2c94f8e9b928990363a42af8716fb Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 29 Jun 2009 11:29:52 +0000 Subject: 2.5 Search Menu: added feature that on opening, it shows the current ID block, and selects it. Same can be used for other searches, just pass on pointer to active item for the search callback. Also fixed arrow triangle draw for search. --- source/blender/editors/include/UI_interface.h | 2 +- source/blender/editors/interface/interface.c | 6 +-- .../blender/editors/interface/interface_layout.c | 2 +- .../blender/editors/interface/interface_regions.c | 53 ++++++++++++++++++++-- .../editors/interface/interface_templates.c | 6 ++- source/blender/editors/interface/interface_utils.c | 2 +- source/blender/editors/space_info/info_header.c | 2 +- .../blender/editors/space_view3d/view3d_toolbar.c | 2 +- 8 files changed, 61 insertions(+), 14 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index b6d71759373..333536137cc 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -456,7 +456,7 @@ typedef void (*uiBlockHandleFunc)(struct bContext *C, void *arg, int event); /* use inside searchfunc to add items */ int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int iconid); /* bfunc gets search item *poin as arg2, or if NULL the old string */ -void uiButSetSearchFunc (uiBut *but, uiButSearchFunc sfunc, void *arg1, uiButHandleFunc bfunc); +void uiButSetSearchFunc (uiBut *but, uiButSearchFunc sfunc, void *arg1, uiButHandleFunc bfunc, void *active); /* height in pixels, it's using hardcoded values still */ int uiSearchBoxhHeight(void); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index a9866d8898e..fcea74cc22b 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2919,15 +2919,15 @@ uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxle } /* arg is user value, searchfunc and handlefunc both get it as arg */ -void uiButSetSearchFunc(uiBut *but, uiButSearchFunc sfunc, void *arg, uiButHandleFunc bfunc) +/* if active set, button opens with this item visible and selected */ +void uiButSetSearchFunc(uiBut *but, uiButSearchFunc sfunc, void *arg, uiButHandleFunc bfunc, void *active) { but->search_func= sfunc; but->search_arg= arg; - uiButSetFunc(but, bfunc, arg, NULL); + uiButSetFunc(but, bfunc, arg, active); } - /* Program Init/Exit */ void UI_init(void) diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 94280ec37d3..f9816235b88 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -936,7 +936,7 @@ void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRN but->rnasearchprop= searchprop; but->flag |= UI_ICON_LEFT|UI_TEXT_LEFT; - uiButSetSearchFunc(but, rna_search_cb, but, NULL); + uiButSetSearchFunc(but, rna_search_cb, but, NULL, NULL); } } diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 61cf612e912..49e3abf4d0c 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -437,6 +437,7 @@ struct uiSearchItems { int *icons; AutoComplete *autocpl; + void *active; }; typedef struct uiSearchboxData { @@ -459,6 +460,14 @@ int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int icon return 1; } + /* hijack for finding active item */ + if(items->active) { + if(poin==items->active) + items->offset_i= items->totitem; + items->totitem++; + return 1; + } + if(items->totitem>=items->maxitem) { items->more= 1; return 0; @@ -597,20 +606,52 @@ void ui_searchbox_update(bContext *C, ARegion *ar, uiBut *but, int reset) /* reset vars */ data->items.totitem= 0; data->items.more= 0; - if(reset==0) + if(reset==0) { data->items.offset_i= data->items.offset; + } else { data->items.offset_i= data->items.offset= 0; data->active= 0; + + /* handle active */ + if(but->search_func && but->func_arg2) { + data->items.active= but->func_arg2; + but->search_func(C, but->search_arg, but->editstr, &data->items); + data->items.active= NULL; + + /* found active item, calculate real offset by centering it */ + if(data->items.totitem) { + /* first case, begin of list */ + if(data->items.offset_i < data->items.maxitem) { + data->active= data->items.offset_i+1; + data->items.offset_i= 0; + } + else { + /* second case, end of list */ + if(data->items.totitem - data->items.offset_i <= data->items.maxitem) { + data->active= 1 + data->items.offset_i - data->items.totitem + data->items.maxitem; + data->items.offset_i= data->items.totitem - data->items.maxitem; + } + else { + /* center active item */ + data->items.offset_i -= data->items.maxitem/2; + data->active= 1 + data->items.maxitem/2; + } + } + } + data->items.offset= data->items.offset_i; + data->items.totitem= 0; + } } /* callback */ if(but->search_func) but->search_func(C, but->search_arg, but->editstr, &data->items); - if(reset) { + /* handle case where editstr is equal to one of items */ + if(reset && data->active==0) { int a; - /* handle case where editstr is equal to one of items */ + for(a=0; aitems.totitem; a++) { char *cpoin= strchr(data->items.names[a], '|'); @@ -666,13 +707,15 @@ static void ui_searchbox_region_draw(const bContext *C, ARegion *ar) } /* indicate more */ if(data->items.more) { + ui_searchbox_butrect(&rect, data, data->items.maxitem-1); glEnable(GL_BLEND); - UI_icon_draw((data->bbox.xmax-data->bbox.xmin)/2, 8, ICON_TRIA_DOWN); + UI_icon_draw((rect.xmax-rect.xmin)/2, rect.ymin-9, ICON_TRIA_DOWN); glDisable(GL_BLEND); } if(data->items.offset) { + ui_searchbox_butrect(&rect, data, 0); glEnable(GL_BLEND); - UI_icon_draw((data->bbox.xmax-data->bbox.xmin)/2, data->bbox.ymax-13, ICON_TRIA_UP); + UI_icon_draw((rect.xmax-rect.xmin)/2, rect.ymax-7, ICON_TRIA_UP); glDisable(GL_BLEND); } } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index a006187c4aa..b128da7b97f 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -112,6 +112,7 @@ static uiBlock *search_menu(bContext *C, ARegion *ar, void *arg_litem) { static char search[256]; static TemplateID template; + PointerRNA idptr; wmEvent event; wmWindow *win= CTX_wm_window(C); uiBlock *block; @@ -122,6 +123,9 @@ static uiBlock *search_menu(bContext *C, ARegion *ar, void *arg_litem) /* arg_litem is malloced, can be freed by parent button */ template= *((TemplateID*)arg_litem); + /* get active id for showing first item */ + idptr= RNA_property_pointer_get(&template.ptr, template.prop); + block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS); uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1); @@ -129,7 +133,7 @@ static uiBlock *search_menu(bContext *C, ARegion *ar, void *arg_litem) uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 0, 150, 19, ""); - uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb); + uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb, idptr.data); uiBoundsBlock(block, 6); uiBlockSetDirection(block, UI_DOWN); diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 3ed81a3e9bc..eb79848d7d2 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -327,7 +327,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_params) uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 0, 150, 19, ""); - uiButSetSearchFunc(but, id_search_cb, ¶ms, id_search_call_cb); + uiButSetSearchFunc(but, id_search_cb, ¶ms, id_search_call_cb, NULL); uiBoundsBlock(block, 6); uiBlockSetDirection(block, UI_DOWN); diff --git a/source/blender/editors/space_info/info_header.c b/source/blender/editors/space_info/info_header.c index 7b65a70117c..7d6e2ca05c0 100644 --- a/source/blender/editors/space_info/info_header.c +++ b/source/blender/editors/space_info/info_header.c @@ -491,7 +491,7 @@ void info_header_buttons(const bContext *C, ARegion *ar) static char search[256]= ""; uiBut *but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, xco+5, yco, 120, 19, ""); - uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb); + uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb, NULL); xco+= 125; } diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 34a935103a7..ea365d59ac7 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -204,7 +204,7 @@ static uiBlock *tool_search_menu(bContext *C, ARegion *ar, void *arg_listbase) uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, OP_MAX_TYPENAME, 10, 0, 150, 19, ""); - uiButSetSearchFunc(but, operator_search_cb, arg_listbase, operator_call_cb); + uiButSetSearchFunc(but, operator_search_cb, arg_listbase, operator_call_cb, NULL); uiBoundsBlock(block, 6); uiBlockSetDirection(block, UI_DOWN); -- cgit v1.2.3 From 9a7ea9664e27679935adaea3093630d7a6a30b5d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 29 Jun 2009 12:06:46 +0000 Subject: BGE PyAPI support for subclassing any BGE game type from python, scripters define extra functions on gameObjects. Adding a UI to set the type on startup can be added easily. # ---- class myPlayer(GameTypes.KX_GameObject): def die(self): # ... do stuff ... self.endObject() # make an instance player = myPlayer(gameOb) # gameOb is made invalid now. player.die() # ---- One limitation (which could also be an advantage), is making the subclass instance will return that subclass everywhere, you cant have 2 different subclasses of the same BGE data at once. --- source/blender/python/intern/bpy_rna.c | 2 +- source/blender/windowmanager/WM_api.h | 2 +- source/blender/windowmanager/intern/wm_keymap.c | 2 +- source/gameengine/Converter/BL_ActionActuator.cpp | 10 +- .../Converter/BL_ShapeActionActuator.cpp | 9 +- source/gameengine/Expressions/BoolValue.cpp | 1 - source/gameengine/Expressions/ListValue.cpp | 10 +- source/gameengine/Expressions/PyObjectPlus.cpp | 111 +++++++++++++++++---- source/gameengine/Expressions/PyObjectPlus.h | 4 +- source/gameengine/Expressions/Value.cpp | 21 ++-- .../gameengine/GameLogic/SCA_2DFilterActuator.cpp | 9 +- source/gameengine/GameLogic/SCA_ANDController.cpp | 9 +- source/gameengine/GameLogic/SCA_ActuatorSensor.cpp | 9 +- source/gameengine/GameLogic/SCA_AlwaysSensor.cpp | 9 +- source/gameengine/GameLogic/SCA_DelaySensor.cpp | 9 +- source/gameengine/GameLogic/SCA_IController.cpp | 9 +- source/gameengine/GameLogic/SCA_ILogicBrick.cpp | 9 +- source/gameengine/GameLogic/SCA_IObject.cpp | 54 +--------- source/gameengine/GameLogic/SCA_ISensor.cpp | 9 +- source/gameengine/GameLogic/SCA_JoystickSensor.cpp | 9 +- source/gameengine/GameLogic/SCA_KeyboardSensor.cpp | 9 +- source/gameengine/GameLogic/SCA_LogicManager.cpp | 1 + source/gameengine/GameLogic/SCA_MouseSensor.cpp | 9 +- source/gameengine/GameLogic/SCA_NANDController.cpp | 9 +- source/gameengine/GameLogic/SCA_NORController.cpp | 9 +- source/gameengine/GameLogic/SCA_ORController.cpp | 9 +- .../gameengine/GameLogic/SCA_PropertyActuator.cpp | 9 +- source/gameengine/GameLogic/SCA_PropertySensor.cpp | 9 +- .../gameengine/GameLogic/SCA_PythonController.cpp | 11 +- source/gameengine/GameLogic/SCA_RandomActuator.cpp | 9 +- source/gameengine/GameLogic/SCA_RandomSensor.cpp | 9 +- source/gameengine/GameLogic/SCA_XNORController.cpp | 9 +- source/gameengine/GameLogic/SCA_XORController.cpp | 9 +- source/gameengine/Ketsji/BL_Shader.cpp | 9 +- .../Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp | 9 +- .../Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp | 9 +- source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 9 +- source/gameengine/Ketsji/KX_CDActuator.cpp | 9 +- source/gameengine/Ketsji/KX_Camera.cpp | 8 +- source/gameengine/Ketsji/KX_CameraActuator.cpp | 9 +- source/gameengine/Ketsji/KX_ConstraintActuator.cpp | 9 +- source/gameengine/Ketsji/KX_ConstraintWrapper.cpp | 9 +- source/gameengine/Ketsji/KX_GameActuator.cpp | 9 +- source/gameengine/Ketsji/KX_GameObject.cpp | 10 +- source/gameengine/Ketsji/KX_IpoActuator.cpp | 9 +- source/gameengine/Ketsji/KX_Light.cpp | 8 +- source/gameengine/Ketsji/KX_MeshProxy.cpp | 9 +- source/gameengine/Ketsji/KX_MouseFocusSensor.cpp | 9 +- source/gameengine/Ketsji/KX_NearSensor.cpp | 9 +- source/gameengine/Ketsji/KX_ObjectActuator.cpp | 9 +- source/gameengine/Ketsji/KX_ParentActuator.cpp | 9 +- .../gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp | 9 +- source/gameengine/Ketsji/KX_PolyProxy.cpp | 9 +- source/gameengine/Ketsji/KX_PolygonMaterial.cpp | 9 +- source/gameengine/Ketsji/KX_PyMath.h | 2 +- source/gameengine/Ketsji/KX_PythonInitTypes.cpp | 49 --------- source/gameengine/Ketsji/KX_RadarSensor.cpp | 9 +- source/gameengine/Ketsji/KX_RaySensor.cpp | 9 +- .../gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp | 9 +- .../gameengine/Ketsji/KX_SCA_DynamicActuator.cpp | 9 +- .../gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp | 9 +- .../Ketsji/KX_SCA_ReplaceMeshActuator.cpp | 9 +- source/gameengine/Ketsji/KX_Scene.cpp | 9 +- source/gameengine/Ketsji/KX_SceneActuator.cpp | 9 +- source/gameengine/Ketsji/KX_SoundActuator.cpp | 9 +- source/gameengine/Ketsji/KX_StateActuator.cpp | 9 +- source/gameengine/Ketsji/KX_TouchSensor.cpp | 9 +- source/gameengine/Ketsji/KX_TrackToActuator.cpp | 9 +- source/gameengine/Ketsji/KX_VehicleWrapper.cpp | 9 +- source/gameengine/Ketsji/KX_VertexProxy.cpp | 9 +- source/gameengine/Ketsji/KX_VisibilityActuator.cpp | 9 +- 71 files changed, 358 insertions(+), 434 deletions(-) (limited to 'source') diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 558722cc5e6..f07c85f7083 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -204,13 +204,13 @@ static long pyrna_struct_hash( BPy_StructRNA * self ) /* use our own dealloc so we can free a property if we use one */ static void pyrna_struct_dealloc( BPy_StructRNA * self ) { - /* Note!! for some weired reason calling PyObject_DEL() directly crashes blender! */ if (self->freeptr && self->ptr.data) { IDP_FreeProperty(self->ptr.data); MEM_freeN(self->ptr.data); self->ptr.data= NULL; } + /* Note, for subclassed PyObjects we cant just call PyObject_DEL() directly or it will crash */ Py_TYPE(self)->tp_free(self); return; } diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 92b71e9fff0..ffeb342df77 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -79,7 +79,7 @@ void WM_keymap_tweak (ListBase *lb, short type, short val, int modifier, short ListBase *WM_keymap_listbase (struct wmWindowManager *wm, const char *nameid, int spaceid, int regionid); -char *WM_key_event_string(short type); +const char *WM_key_event_string(short type); char *WM_key_event_operator_string(const struct bContext *C, const char *opname, int opcontext, struct IDProperty *properties, char *str, int len); /* handlers */ diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 85028e3ea1a..b914e63788d 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -154,7 +154,7 @@ ListBase *WM_keymap_listbase(wmWindowManager *wm, const char *nameid, int spacei /* ***************** get string from key events **************** */ -char *WM_key_event_string(short type) +const char *WM_key_event_string(short type) { const char *name= NULL; if(RNA_enum_name(event_type_items, (int)type, &name)) diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index d9e65c53fac..bed99a4f502 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -1005,19 +1005,17 @@ PyTypeObject BL_ActionActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; - PyMethodDef BL_ActionActuator::Methods[] = { //Deprecated -----> {"setAction", (PyCFunction) BL_ActionActuator::sPySetAction, METH_VARARGS, (PY_METHODCHAR)SetAction_doc}, diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index 4c9a584d72b..970539777f4 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -427,16 +427,15 @@ PyTypeObject BL_ShapeActionActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; diff --git a/source/gameengine/Expressions/BoolValue.cpp b/source/gameengine/Expressions/BoolValue.cpp index 1102b12fdc4..6779c2ea780 100644 --- a/source/gameengine/Expressions/BoolValue.cpp +++ b/source/gameengine/Expressions/BoolValue.cpp @@ -29,7 +29,6 @@ const STR_String CBoolValue::sTrueString = "TRUE"; const STR_String CBoolValue::sFalseString = "FALSE"; - CBoolValue::CBoolValue() /* pre: false diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 34a357aa5f1..38b00dcc8fb 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -225,7 +225,7 @@ static int listvalue_buffer_contains(PyObject *self_v, PyObject *value) return 1; } } - else if (BGE_PROXY_CHECK_TYPE(value)) { /* not dict like at all but this worked before __contains__ was used */ + else if (PyObject_TypeCheck(value, &CValue::Type)) { /* not dict like at all but this worked before __contains__ was used */ CValue *item= static_cast(BGE_PROXY_REF(value)); for (int i=0; i < self->GetCount(); i++) if (self->GetValue(i) == item) // Com @@ -289,15 +289,17 @@ PyTypeObject CListValue::Type = { 0, /*tp_hash*/ 0, /*tp_call */ 0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, + NULL, + NULL, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &CValue::Type + &CValue::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef CListValue::Methods[] = { diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 863390f209d..475953749de 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -74,10 +74,7 @@ PyTypeObject PyObjectPlus::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, @@ -96,6 +93,88 @@ PyObjectPlus::~PyObjectPlus() // assert(ob_refcnt==0); } + +PyObject *PyObjectPlus::py_base_repr(PyObject *self) // This should be the entry in Type. +{ + PyObjectPlus *self_plus= BGE_PROXY_REF(self); + if(self_plus==NULL) { + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + return NULL; + } + + return self_plus->py_repr(); +} + + +PyObject * PyObjectPlus::py_base_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + PyTypeObject *base_type; + PyObjectPlus_Proxy *base = NULL; + + if (!PyArg_ParseTuple(args, "O:Base PyObjectPlus", &base)) + return NULL; + + /* the 'base' PyObject may be subclassed (multiple times even) + * we need to find the first C++ defined class to check 'type' + * is a subclass of the base arguments type. + * + * This way we can share one tp_new function for every PyObjectPlus + * + * eg. + * + * # CustomOb is called 'type' in this C code + * class CustomOb(GameTypes.KX_GameObject): + * pass + * + * # this calls py_base_new(...), the type of 'CustomOb' is checked to be a subclass of the 'cont.owner' type + * ob = CustomOb(cont.owner) + * + * */ + base_type= Py_TYPE(base); + while(base_type && !BGE_PROXY_CHECK_TYPE(base_type)) + base_type= base_type->tp_base; + + if(base_type==NULL || !BGE_PROXY_CHECK_TYPE(base_type)) { + PyErr_SetString(PyExc_TypeError, "can't subclass from a blender game type because the argument given is not a game class or subclass"); + return NULL; + } + + /* use base_type rather then Py_TYPE(base) because we could alredy be subtyped */ + if(!PyType_IsSubtype(type, base_type)) { + PyErr_Format(PyExc_TypeError, "can't subclass blender game type <%s> from <%s> because it is not a subclass", base_type->tp_name, type->tp_name); + return NULL; + } + + /* invalidate the existing base and return a new subclassed one, + * this is a bit dodgy in that it also attaches its self to the existing object + * which is not really 'correct' python OO but for our use its OK. */ + + PyObjectPlus_Proxy *ret = (PyObjectPlus_Proxy *) type->tp_alloc(type, 0); /* starts with 1 ref, used for the return ref' */ + ret->ref= base->ref; + base->ref= NULL; /* invalidate! disallow further access */ + + ret->py_owns= base->py_owns; + + ret->ref->m_proxy= NULL; + + /* 'base' may be free'd after this func finished but not necessarily + * there is no reference to the BGE data now so it will throw an error on access */ + Py_DECREF(base); + + ret->ref->m_proxy= (PyObject *)ret; /* no need to add a ref because one is added when creating. */ + Py_INCREF(ret); /* we return a new ref but m_proxy holds a ref so we need to add one */ + + + /* 'ret' will have 2 references. + * - One ref is needed because ret->ref->m_proxy holds a refcount to the current proxy. + * - Another is needed for returning the value. + * + * So we should be ok with 2 refs, but for some reason this crashes. so adding a new ref... + * */ + + return (PyObject *)ret; +} + void PyObjectPlus::py_base_dealloc(PyObject *self) // python wrapper { PyObjectPlus *self_plus= BGE_PROXY_REF(self); @@ -104,17 +183,23 @@ void PyObjectPlus::py_base_dealloc(PyObject *self) // python wrapper self_plus->m_proxy = NULL; /* Need this to stop ~PyObjectPlus from decrefing m_proxy otherwise its decref'd twice and py-debug crashes */ delete self_plus; } - + BGE_PROXY_REF(self)= NULL; // not really needed } + +#if 0 + /* is ok normally but not for subtyping, use tp_free instead. */ PyObject_DEL( self ); +#else + Py_TYPE(self)->tp_free(self); +#endif }; PyObjectPlus::PyObjectPlus() : SG_QList() // constructor { m_proxy= NULL; }; - + /*------------------------------ * PyObjectPlus Methods -- Every class, even the abstract one should have a Methods ------------------------------*/ @@ -131,20 +216,8 @@ PyAttributeDef PyObjectPlus::Attributes[] = { PyObject* PyObjectPlus::pyattr_get_invalid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) -{ - return PyBool_FromLong(self_v ? 1:0); -} - -PyObject *PyObjectPlus::py_base_repr(PyObject *self) // This should be the entry in Type. { - - PyObjectPlus *self_plus= BGE_PROXY_REF(self); - if(self_plus==NULL) { - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); - return NULL; - } - - return self_plus->py_repr(); + return PyBool_FromLong(self_v ? 1:0); } /* note, this is called as a python 'getset, where the PyAttributeDef is the closure */ diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index ee69e7d3b07..a18df9d36a9 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -135,7 +135,7 @@ typedef struct { #define BGE_PROXY_PYOWNS(_self) (((PyObjectPlus_Proxy *)_self)->py_owns) /* Note, sometimes we dont care what BGE type this is as long as its a proxy */ -#define BGE_PROXY_CHECK_TYPE(_self) ((_self)->ob_type->tp_dealloc == PyObjectPlus::py_base_dealloc) +#define BGE_PROXY_CHECK_TYPE(_type) ((_type)->tp_dealloc == PyObjectPlus::py_base_dealloc) // This must be the first line of each @@ -439,6 +439,8 @@ public: * they take the C++ reference from the PyObjectPlus_Proxy and call * its own virtual py_repr, py_base_dealloc ,etc. functions. */ + + static PyObject* py_base_new(PyTypeObject *type, PyObject *args, PyObject *kwds); /* allows subclassing */ static void py_base_dealloc(PyObject *self); static PyObject* py_base_repr(PyObject *self); diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index a9b44495495..d8c81f56f66 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -54,15 +54,17 @@ PyTypeObject CValue::Type = { py_base_repr, 0, 0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, + NULL, + NULL, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &PyObjectPlus::Type + &PyObjectPlus::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef CValue::Methods[] = { @@ -613,18 +615,9 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) { vallie = new CStringValue(_PyUnicode_AsString(pyobj),""); } else - if (BGE_PROXY_CHECK_TYPE(pyobj)) /* Note, dont let these get assigned to GameObject props, must check elsewhere */ + if (PyObject_TypeCheck(pyobj, &CValue::Type)) /* Note, dont let these get assigned to GameObject props, must check elsewhere */ { - if (BGE_PROXY_REF(pyobj) && PyObject_TypeCheck((PyObject *)BGE_PROXY_REF(pyobj), &CValue::Type)) - { - vallie = (static_cast(BGE_PROXY_REF(pyobj)))->AddRef(); - } else { - - if(BGE_PROXY_REF(pyobj)) /* this is not a CValue */ - PyErr_Format(PyExc_TypeError, "%sgame engine python type cannot be used as a property", error_prefix); - else /* PyObjectPlus_Proxy has been removed, cant use */ - PyErr_Format(PyExc_SystemError, "%s"BGE_PROXY_ERROR_MSG, error_prefix); - } + vallie = (static_cast(BGE_PROXY_REF(pyobj)))->AddRef(); } else { /* return an error value from the caller */ diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index 8e54043a1a2..04d46e259d3 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -123,16 +123,15 @@ PyTypeObject SCA_2DFilterActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_2DFilterActuator::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_ANDController.cpp b/source/gameengine/GameLogic/SCA_ANDController.cpp index fc2f9cdf27d..78e1350428e 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.cpp +++ b/source/gameengine/GameLogic/SCA_ANDController.cpp @@ -115,16 +115,15 @@ PyTypeObject SCA_ANDController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IController::Type + &SCA_IController::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_ANDController::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index 9d2642ba01a..bdcc923e1d9 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -137,16 +137,15 @@ PyTypeObject SCA_ActuatorSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_ISensor::Type + &SCA_ISensor::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_ActuatorSensor::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp index a14db7debd9..ddb54c580b8 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp @@ -120,16 +120,15 @@ PyTypeObject SCA_AlwaysSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_ISensor::Type + &SCA_ISensor::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_AlwaysSensor::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp index db6a6af7928..11c6996a0a1 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.cpp +++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp @@ -146,16 +146,15 @@ PyTypeObject SCA_DelaySensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_ISensor::Type + &SCA_ISensor::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_DelaySensor::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp index 4b7c462b6f7..7cbb728753a 100644 --- a/source/gameengine/GameLogic/SCA_IController.cpp +++ b/source/gameengine/GameLogic/SCA_IController.cpp @@ -215,16 +215,15 @@ PyTypeObject SCA_IController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_ILogicBrick::Type + &SCA_ILogicBrick::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_IController::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 9d0b9b30ff6..ccb79a2d49f 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -193,16 +193,15 @@ PyTypeObject SCA_ILogicBrick::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &CValue::Type + &CValue::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_ILogicBrick::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index 698e845466a..6cd11f9e553 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -221,51 +221,6 @@ SCA_IActuator* SCA_IObject::FindActuator(const STR_String& actuatorname) } - -#if 0 -const MT_Point3& SCA_IObject::ConvertPythonPylist(PyObject* pylist) -{ - bool error = false; - m_sDummy = MT_Vector3(0,0,0); - if (pylist->ob_type == &CListValue::Type) - { - CListValue* listval = (CListValue*) pylist; - int numelem = listval->GetCount(); - if ( numelem <= 3) - { - int index; - for (index = 0;indexGetValue(index)->GetNumber(); - } - } else - { - error = true; - } - - } else - { - - // assert the list is long enough... - int numitems = PyList_Size(pylist); - if (numitems <= 3) - { - int index; - for (index=0;indexActivate(m_triggeredControllerSet); // so that the controller knows which sensor has activited it // only needed for python controller + // Note that this is safe even if the controller is subclassed. if (controller->GetType() == &SCA_PythonController::Type) { SCA_PythonController* pythonController = (SCA_PythonController*)controller; diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index 608aa043461..49fa19dce38 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -311,16 +311,15 @@ PyTypeObject SCA_MouseSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_ISensor::Type + &SCA_ISensor::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_MouseSensor::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_NANDController.cpp b/source/gameengine/GameLogic/SCA_NANDController.cpp index d4a6a444b97..c00e5d6e617 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.cpp +++ b/source/gameengine/GameLogic/SCA_NANDController.cpp @@ -115,16 +115,15 @@ PyTypeObject SCA_NANDController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IController::Type + &SCA_IController::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_NANDController::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_NORController.cpp b/source/gameengine/GameLogic/SCA_NORController.cpp index 67e0916ecc1..9762d44fd5d 100644 --- a/source/gameengine/GameLogic/SCA_NORController.cpp +++ b/source/gameengine/GameLogic/SCA_NORController.cpp @@ -115,16 +115,15 @@ PyTypeObject SCA_NORController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IController::Type + &SCA_IController::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_NORController::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_ORController.cpp b/source/gameengine/GameLogic/SCA_ORController.cpp index 1dd81668482..a526dd8353c 100644 --- a/source/gameengine/GameLogic/SCA_ORController.cpp +++ b/source/gameengine/GameLogic/SCA_ORController.cpp @@ -109,16 +109,15 @@ PyTypeObject SCA_ORController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IController::Type + &SCA_IController::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_ORController::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index f3c0a76a9f2..215e30eceaf 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -244,16 +244,15 @@ PyTypeObject SCA_PropertyActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_PropertyActuator::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index ea928bb1c8f..6d2e1a0aca5 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -318,16 +318,15 @@ PyTypeObject SCA_PropertySensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_ISensor::Type + &SCA_ISensor::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_PropertySensor::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 7eecb6ccc98..ffd95f00699 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -187,7 +187,7 @@ SCA_IActuator* SCA_PythonController::LinkedActuatorFromPy(PyObject *value) } } } - else if (BGE_PROXY_CHECK_TYPE(value)) { + else if (PyObject_TypeCheck(value, &SCA_IActuator::Type)) { PyObjectPlus *value_plus= BGE_PROXY_REF(value); for(it = lacts.begin(); it!= lacts.end(); ++it) { if( static_cast(value_plus) == (*it) ) { @@ -243,16 +243,15 @@ PyTypeObject SCA_PythonController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IController::Type + &SCA_IController::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_PythonController::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index 0474cb4ab5f..e903d10f9a5 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -331,16 +331,15 @@ PyTypeObject SCA_RandomActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_RandomActuator::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index 9d3501ab4ed..e036a77707e 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -146,16 +146,15 @@ PyTypeObject SCA_RandomSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_ISensor::Type + &SCA_ISensor::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_RandomSensor::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_XNORController.cpp b/source/gameengine/GameLogic/SCA_XNORController.cpp index 584a6b18f58..527adc70cc6 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.cpp +++ b/source/gameengine/GameLogic/SCA_XNORController.cpp @@ -119,16 +119,15 @@ PyTypeObject SCA_XNORController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IController::Type + &SCA_IController::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_XNORController::Methods[] = { diff --git a/source/gameengine/GameLogic/SCA_XORController.cpp b/source/gameengine/GameLogic/SCA_XORController.cpp index 9f570acb009..c0916224fe6 100644 --- a/source/gameengine/GameLogic/SCA_XORController.cpp +++ b/source/gameengine/GameLogic/SCA_XORController.cpp @@ -119,16 +119,15 @@ PyTypeObject SCA_XORController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IController::Type + &SCA_IController::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_XORController::Methods[] = { diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index b6debb4c62c..8bde5dd3a51 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -781,16 +781,15 @@ PyTypeObject BL_Shader::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &PyObjectPlus::Type + &PyObjectPlus::Type, + 0,0,0,0,0,0, + py_base_new }; KX_PYMETHODDEF_DOC( BL_Shader, setSource," setSource(vertexProgram, fragmentProgram)" ) diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp index 60805916a20..7cb287d02b2 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp @@ -117,16 +117,15 @@ PyTypeObject KX_NetworkMessageActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_NetworkMessageActuator::Methods[] = { diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index bfc49040794..78dda1f6db7 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -181,16 +181,15 @@ PyTypeObject KX_NetworkMessageSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_ISensor::Type + &SCA_ISensor::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_NetworkMessageSensor::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index ea819cea5f2..314becc702d 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -811,16 +811,15 @@ PyTypeObject KX_BlenderMaterial::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &PyObjectPlus::Type + &PyObjectPlus::Type, + 0,0,0,0,0,0, + py_base_new }; KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()") diff --git a/source/gameengine/Ketsji/KX_CDActuator.cpp b/source/gameengine/Ketsji/KX_CDActuator.cpp index d025dbfa469..bfca81f45d9 100644 --- a/source/gameengine/Ketsji/KX_CDActuator.cpp +++ b/source/gameengine/Ketsji/KX_CDActuator.cpp @@ -170,16 +170,15 @@ PyTypeObject KX_CDActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_CDActuator::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 85fa579167b..f762699f780 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -550,15 +550,17 @@ PyTypeObject KX_Camera::Type = { &KX_GameObject::Sequence, &KX_GameObject::Mapping, 0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, + NULL, + NULL, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &KX_GameObject::Type + &KX_GameObject::Type, + 0,0,0,0,0,0, + py_base_new }; KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, sphereInsideFrustum, diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index e2c3ecb1b3e..3d3b68ed85d 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -384,16 +384,15 @@ PyTypeObject KX_CameraActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_CameraActuator::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index 8470c2c1f5f..d09eae647c8 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -580,16 +580,15 @@ PyTypeObject KX_ConstraintActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_ConstraintActuator::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index 955dd18d43e..ec7bb470235 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -99,16 +99,15 @@ PyTypeObject KX_ConstraintWrapper::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &PyObjectPlus::Type + &PyObjectPlus::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_ConstraintWrapper::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index 029f1f07861..560c7fa4bb4 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -223,16 +223,15 @@ PyTypeObject KX_GameActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_GameActuator::Methods[] = diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 5798830e243..bf80eec36d9 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1562,7 +1562,7 @@ static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) int set= 0; /* as CValue */ - if(attr_str && BGE_PROXY_CHECK_TYPE(val)==0) /* dont allow GameObjects for eg to be assigned to CValue props */ + if(attr_str && PyObject_TypeCheck(val, &PyObjectPlus::Type)==0) /* dont allow GameObjects for eg to be assigned to CValue props */ { CValue* vallie = self->ConvertPythonToValue(val, ""); /* error unused */ @@ -1672,15 +1672,17 @@ PyTypeObject KX_GameObject::Type = { &Sequence, &Mapping, 0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, + NULL, + NULL, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IObject::Type + &SCA_IObject::Type, + 0,0,0,0,0,0, + py_base_new }; PyObject* KX_GameObject::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index 0edb6747f2f..73a370a1681 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -428,16 +428,15 @@ PyTypeObject KX_IpoActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_IpoActuator::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index 08542ec1602..fb385f8a9a2 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -289,15 +289,17 @@ PyTypeObject KX_LightObject::Type = { &KX_GameObject::Sequence, &KX_GameObject::Mapping, 0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, + NULL, + NULL, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &KX_GameObject::Type + &KX_GameObject::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_LightObject::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index 2c0c31c96c4..96e8f61e4c8 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -62,16 +62,15 @@ PyTypeObject KX_MeshProxy::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &CValue::Type + &CValue::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_MeshProxy::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index e38ec702acd..ba4b47cb03f 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -355,16 +355,15 @@ PyTypeObject KX_MouseFocusSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_MouseSensor::Type + &SCA_MouseSensor::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_MouseFocusSensor::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp index 64f6b9306a0..1a211a64b35 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.cpp +++ b/source/gameengine/Ketsji/KX_NearSensor.cpp @@ -270,16 +270,15 @@ PyTypeObject KX_NearSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &KX_TouchSensor::Type + &KX_TouchSensor::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_NearSensor::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index b13c225a16f..ae340d12be4 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -341,16 +341,15 @@ PyTypeObject KX_ObjectActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_ObjectActuator::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index fb2fd614062..befa2aaff56 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -156,16 +156,15 @@ PyTypeObject KX_ParentActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_ParentActuator::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp index fb6bc8b898d..7bce311f1b6 100644 --- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp +++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp @@ -129,16 +129,15 @@ PyTypeObject KX_PhysicsObjectWrapper::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &PyObjectPlus::Type + &PyObjectPlus::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_PhysicsObjectWrapper::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index 7fd667eeaf3..a1571b17756 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -55,16 +55,15 @@ PyTypeObject KX_PolyProxy::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &CValue::Type + &CValue::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_PolyProxy::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index 4d5e7ca565b..9bc84127572 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -255,16 +255,15 @@ PyTypeObject KX_PolygonMaterial::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &PyObjectPlus::Type + &PyObjectPlus::Type, + 0,0,0,0,0,0, + py_base_new }; KX_PYMETHODDEF_DOC(KX_PolygonMaterial, setCustomMaterial, "setCustomMaterial(material)") diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h index 4fd16089ee2..9ee11c9e745 100644 --- a/source/gameengine/Ketsji/KX_PyMath.h +++ b/source/gameengine/Ketsji/KX_PyMath.h @@ -154,7 +154,7 @@ bool PyVecTo(PyObject* pyval, T& vec) return true; } - else if (BGE_PROXY_CHECK_TYPE(pyval)) + else if (PyObject_TypeCheck(pyval, &PyObjectPlus::Type)) { /* note, include this check because PySequence_Check does too much introspection * on the PyObject (like getting its __class__, on a BGE type this means searching up * the parent list each time only to discover its not a sequence. diff --git a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp index b7a573fd0d3..8ff0bfd5379 100644 --- a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp +++ b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp @@ -87,52 +87,6 @@ #include "SCA_RandomActuator.h" #include "SCA_IController.h" - -void initPyObjectPlusType(PyTypeObject **parents) -{ - int i; - - for (i=0; parents[i]; i++) { - if(PyType_Ready(parents[i]) < 0) { - /* This is very very unlikely */ - printf("Error, pytype could not initialize, Blender may crash \"%s\"\n", parents[i]->tp_name); - return; - } - -#if 0 - PyObject_Print(reinterpret_castparents[i], stderr, 0); - fprintf(stderr, "\n"); - PyObject_Print(parents[i]->tp_dict, stderr, 0); - fprintf(stderr, "\n\n"); -#endif - - } - - PyObject *dict= NULL; - - while(i) { - i--; - - if (dict) { - PyDict_Update(parents[i]->tp_dict, dict); - } - dict= parents[i]->tp_dict; - -#if 1 - PyObject_Print(reinterpret_cast(parents[i]), stderr, 0); - fprintf(stderr, "\n"); - PyObject_Print(parents[i]->tp_dict, stderr, 0); - fprintf(stderr, "\n\n"); -#endif - - } -} - -/* -typedef PyObject *(*getter)(PyObject *, void *); -typedef int (*setter)(PyObject *, PyObject *, void *); -*/ - static void PyType_Ready_ADD(PyObject *dict, PyTypeObject *tp, PyAttributeDef *attributes, int init_getset) { PyAttributeDef *attr; @@ -169,9 +123,6 @@ static void PyType_Ready_ADD(PyObject *dict, PyTypeObject *tp, PyAttributeDef *a memset(attr_getset, 0, sizeof(PyGetSetDef)); } - - - return; } else { PyObject *item; diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index 3423fec99e0..e39d3756b71 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -244,16 +244,15 @@ PyTypeObject KX_RadarSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &KX_NearSensor::Type + &KX_NearSensor::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_RadarSensor::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index ebdef526eae..3f27496df71 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -335,16 +335,15 @@ PyTypeObject KX_RaySensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_ISensor::Type + &SCA_ISensor::Type, + 0,0,0,0,0,0, + py_base_new }; diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index 69214dbbbcf..239c4a0be67 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -186,16 +186,15 @@ PyTypeObject KX_SCA_AddObjectActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_SCA_AddObjectActuator::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp index 3cff9457c34..423fd0db7f2 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp @@ -64,16 +64,15 @@ PyTypeObject KX_SCA_DynamicActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_SCA_DynamicActuator::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp index bf1ada97b9e..47c5c3aeeeb 100644 --- a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp @@ -107,16 +107,15 @@ PyTypeObject KX_SCA_EndObjectActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_SCA_EndObjectActuator::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp index ee50008edae..2884bb76565 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp @@ -67,16 +67,15 @@ PyTypeObject KX_SCA_ReplaceMeshActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_SCA_ReplaceMeshActuator::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 5f3ed690adc..51f5276e075 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1629,16 +1629,15 @@ PyTypeObject KX_Scene::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &CValue::Type + &CValue::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_Scene::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index 76869f82c1a..5528e58ef77 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -238,16 +238,15 @@ PyTypeObject KX_SceneActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_SceneActuator::Methods[] = diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index 0ad699fd811..673f42283dd 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -249,16 +249,15 @@ PyTypeObject KX_SoundActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_SoundActuator::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_StateActuator.cpp b/source/gameengine/Ketsji/KX_StateActuator.cpp index ad21258a3b6..9815d6274aa 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.cpp +++ b/source/gameengine/Ketsji/KX_StateActuator.cpp @@ -153,16 +153,15 @@ PyTypeObject KX_StateActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_StateActuator::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 32c19df3542..b0cf172c27a 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -310,16 +310,15 @@ PyTypeObject KX_TouchSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_ISensor::Type + &SCA_ISensor::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_TouchSensor::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index 49737a6dfc2..e8a06d8d619 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -447,16 +447,15 @@ PyTypeObject KX_TrackToActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_TrackToActuator::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp index 484c8f38b3f..7001bfc8b7e 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp @@ -289,16 +289,15 @@ PyTypeObject KX_VehicleWrapper::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &PyObjectPlus::Type + &PyObjectPlus::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_VehicleWrapper::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index 34a84f908a8..cb8c891969d 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -53,16 +53,15 @@ PyTypeObject KX_VertexProxy::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &CValue::Type + &CValue::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_VertexProxy::Methods[] = { diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp index 260d764beec..3561ccde9d9 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp @@ -107,16 +107,15 @@ PyTypeObject KX_VisibilityActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - NULL, //py_base_getattro, - NULL, //py_base_setattro, - 0, + 0,0,0,0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, 0, 0, - &SCA_IActuator::Type + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_VisibilityActuator::Methods[] = { -- cgit v1.2.3 From e7928dd4b4b797295e2a3c6f73a57cb242c3423e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 29 Jun 2009 19:15:51 +0000 Subject: RNA Implementation of RNA side of foreach_get/foreach_set, Campbell will do python code. Three functions for efficiently setting some property for all items in a collection. RNA_property_collection_raw_array gives access to the properties as an array with length, stride, and type specified, if this is possible, i.e. not when it uses a ListBase, or if a manual get/set function is implemented. Two other functions take a C array pointer and get/set it using the a collection + property name, using efficient array access if possible, and otherwise using slower RNA iterator. RNA_property_collection_raw_get RNA_property_collection_raw_set The number of type conversion required here got a bit out of hand, it could be more efficient still if checking for more cases, but function is already long enough. Example: http://www.pasteall.org/6362/c --- source/blender/makesrna/RNA_access.h | 5 + source/blender/makesrna/RNA_types.h | 19 +- source/blender/makesrna/intern/makesrna.c | 89 +++++- source/blender/makesrna/intern/rna_access.c | 307 +++++++++++++++++++++ source/blender/makesrna/intern/rna_define.c | 12 +- source/blender/makesrna/intern/rna_internal.h | 1 + .../blender/makesrna/intern/rna_internal_types.h | 4 + source/blender/makesrna/intern/rna_rna.c | 18 +- 8 files changed, 427 insertions(+), 28 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 9f7559312ed..1f856062533 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -600,6 +600,11 @@ int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop); int RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr); int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr); +/* efficient functions to set properties for arrays */ +int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, PropertyRNA *itemprop, RawArray *array); +int RNA_property_collection_raw_get(struct ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, char *propname, void *array, RawPropertyType type, int len); +int RNA_property_collection_raw_set(struct ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, char *propname, void *array, RawPropertyType type, int len); + /* to create ID property groups */ void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop); void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop); diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 75f52ededd0..923191cba78 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -110,7 +110,9 @@ typedef enum PropertyFlag { PROP_BUILTIN = 128, PROP_EXPORT = 256, PROP_RUNTIME = 512, - PROP_IDPROPERTY = 1024 + PROP_IDPROPERTY = 1024, + PROP_RAW_ACCESS = 8192, + PROP_RAW_ARRAY = 16384, } PropertyFlag; typedef struct CollectionPropertyIterator { @@ -132,6 +134,21 @@ typedef struct CollectionPointerLink { PointerRNA ptr; } CollectionPointerLink; +typedef enum RawPropertyType { + PROP_RAW_CHAR, + PROP_RAW_SHORT, + PROP_RAW_INT, + PROP_RAW_FLOAT, + PROP_RAW_DOUBLE +} RawPropertyType; + +typedef struct RawArray { + void *array; + RawPropertyType type; + int len; + int stride; +} RawArray; + /* Iterator Utility */ typedef struct EnumPropertyItem { diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 475db3955b6..c42bc866f99 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -762,6 +762,42 @@ static char *rna_def_property_end_func(FILE *f, StructRNA *srna, PropertyRNA *pr return func; } +static void rna_set_raw_property(PropertyDefRNA *dp, PropertyRNA *prop) +{ + if(dp->dnapointerlevel != 0) + return; + if(!dp->dnatype || !dp->dnaname || !dp->dnastructname) + return; + + if(strcmp(dp->dnatype, "char") == 0) { + prop->rawtype= PROP_RAW_CHAR; + prop->flag |= PROP_RAW_ACCESS; + } + else if(strcmp(dp->dnatype, "short") == 0) { + prop->rawtype= PROP_RAW_SHORT; + prop->flag |= PROP_RAW_ACCESS; + } + else if(strcmp(dp->dnatype, "int") == 0) { + prop->rawtype= PROP_RAW_INT; + prop->flag |= PROP_RAW_ACCESS; + } + else if(strcmp(dp->dnatype, "float") == 0) { + prop->rawtype= PROP_RAW_FLOAT; + prop->flag |= PROP_RAW_ACCESS; + } + else if(strcmp(dp->dnatype, "double") == 0) { + prop->rawtype= PROP_RAW_DOUBLE; + prop->flag |= PROP_RAW_ACCESS; + } +} + +static void rna_set_raw_offset(FILE *f, StructRNA *srna, PropertyRNA *prop) +{ + PropertyDefRNA *dp= rna_find_struct_property_def(srna, prop); + + fprintf(f, "\toffsetof(%s, %s), %d", dp->dnastructname, dp->dnaname, prop->rawtype); +} + static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) { PropertyRNA *prop; @@ -773,6 +809,9 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; if(!prop->arraylength) { + if(!bprop->get && !bprop->set && !dp->booleanbit) + rna_set_raw_property(dp, prop); + bprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)bprop->get); bprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)bprop->set); } @@ -786,10 +825,16 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) IntPropertyRNA *iprop= (IntPropertyRNA*)prop; if(!prop->arraylength) { + if(!iprop->get && !iprop->set) + rna_set_raw_property(dp, prop); + iprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)iprop->get); iprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)iprop->set); } else { + if(!iprop->getarray && !iprop->setarray) + rna_set_raw_property(dp, prop); + iprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)iprop->getarray); iprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)iprop->setarray); } @@ -799,10 +844,16 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; if(!prop->arraylength) { + if(!fprop->get && !fprop->set) + rna_set_raw_property(dp, prop); + fprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)fprop->get); fprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)fprop->set); } else { + if(!fprop->getarray && !fprop->setarray) + rna_set_raw_property(dp, prop); + fprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)fprop->getarray); fprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)fprop->setarray); } @@ -841,6 +892,13 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) else if(dp->dnalengthname || dp->dnalengthfixed) cprop->length= (void*)rna_def_property_length_func(f, srna, prop, dp, (char*)cprop->length); + /* test if we can allow raw array access, if it is using our standard + * array get/next function, we can be sure it is an actual array */ + if(cprop->next && cprop->get) + if(strcmp((char*)cprop->next, "rna_iterator_array_next") == 0 && + strcmp((char*)cprop->get, "rna_iterator_array_get") == 0) + prop->flag |= PROP_RAW_ARRAY; + cprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)cprop->get); cprop->begin= (void*)rna_def_property_begin_func(f, srna, prop, dp, (char*)cprop->begin); cprop->next= (void*)rna_def_property_next_func(f, srna, prop, dp, (char*)cprop->next); @@ -1538,7 +1596,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr DefRNA.error= 1; } break; - } + } case PROP_BOOLEAN: { BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; unsigned int i; @@ -1558,7 +1616,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr fprintf(f, "};\n\n"); } break; - } + } case PROP_INT: { IntPropertyRNA *iprop= (IntPropertyRNA*)prop; unsigned int i; @@ -1578,7 +1636,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr fprintf(f, "};\n\n"); } break; - } + } case PROP_FLOAT: { FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; unsigned int i; @@ -1598,7 +1656,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr fprintf(f, "};\n\n"); } break; - } + } default: break; } @@ -1613,10 +1671,14 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr rna_print_c_string(f, prop->identifier); fprintf(f, ", %d, ", prop->flag); rna_print_c_string(f, prop->name); fprintf(f, ",\n\t"); - rna_print_c_string(f, prop->description); fprintf(f, ",\n"); - fprintf(f, "%d, ", prop->icon); + rna_print_c_string(f, prop->description); fprintf(f, ",\n\t"); + fprintf(f, "%d,\n", prop->icon); fprintf(f, "\t%s, %s, %d,\n", rna_property_typename(prop->type), rna_property_subtypename(prop->subtype), prop->arraylength); - fprintf(f, "\t%s, %d, %s},\n", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable)); + fprintf(f, "\t%s, %d, %s,\n", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable)); + + if(prop->flag & PROP_RAW_ACCESS) rna_set_raw_offset(f, srna, prop); + else fprintf(f, "\t0, 0"); + fprintf(f, "},\n"); switch(prop->type) { case PROP_BOOLEAN: { @@ -1625,7 +1687,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr if(prop->arraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); else fprintf(f, "NULL\n"); break; - } + } case PROP_INT: { IntPropertyRNA *iprop= (IntPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %s, %s,\n\t", rna_function_string(iprop->get), rna_function_string(iprop->set), rna_function_string(iprop->getarray), rna_function_string(iprop->setarray), rna_function_string(iprop->range)); @@ -1638,7 +1700,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr if(prop->arraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); else fprintf(f, "NULL\n"); break; - } + } case PROP_FLOAT: { FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %s, %s, ", rna_function_string(fprop->get), rna_function_string(fprop->set), rna_function_string(fprop->getarray), rna_function_string(fprop->setarray), rna_function_string(fprop->range)); @@ -1652,13 +1714,13 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr if(prop->arraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); else fprintf(f, "NULL\n"); break; - } + } case PROP_STRING: { StringPropertyRNA *sprop= (StringPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %d, ", rna_function_string(sprop->get), rna_function_string(sprop->length), rna_function_string(sprop->set), sprop->maxlength); rna_print_c_string(f, sprop->defaultvalue); fprintf(f, "\n"); break; - } + } case PROP_ENUM: { EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, ", rna_function_string(eprop->get), rna_function_string(eprop->set), rna_function_string(eprop->itemf)); @@ -1668,14 +1730,14 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr fprintf(f, "NULL, "); fprintf(f, "%d, %d\n", eprop->totitem, eprop->defaultvalue); break; - } + } case PROP_POINTER: { PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, ", rna_function_string(pprop->get), rna_function_string(pprop->set), rna_function_string(pprop->typef)); if(pprop->type) fprintf(f, "&RNA_%s\n", (char*)pprop->type); else fprintf(f, "NULL\n"); break; - } + } case PROP_COLLECTION: { CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, ", rna_function_string(cprop->begin), rna_function_string(cprop->next), rna_function_string(cprop->end), rna_function_string(cprop->get), rna_function_string(cprop->length), rna_function_string(cprop->lookupint), rna_function_string(cprop->lookupstring)); @@ -1890,6 +1952,7 @@ static void rna_generate(BlenderRNA *brna, FILE *f, char *filename, char *api_fi fprintf(f, "#include \n"); fprintf(f, "#include \n"); fprintf(f, "#include \n\n"); + fprintf(f, "#include \n\n"); fprintf(f, "#include \"DNA_ID.h\"\n"); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 7defb0676c6..d3e4780c7fd 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1522,6 +1522,313 @@ int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, co } } +int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, PropertyRNA *itemprop, RawArray *array) +{ + CollectionPropertyIterator iter; + ArrayIterator *internal; + char *arrayp; + + if(!(prop->flag & PROP_RAW_ARRAY) || !(itemprop->flag & PROP_RAW_ACCESS)) + return 0; + + RNA_property_collection_begin(ptr, prop, &iter); + + if(iter.valid) { + /* get data from array iterator and item property */ + internal= iter.internal; + arrayp= (iter.valid)? iter.ptr.data: NULL; + + if(internal->skip || !RNA_property_editable(&iter.ptr, itemprop)) { + /* we might skip some items, so it's not a proper array */ + RNA_property_collection_end(&iter); + return 0; + } + + array->array= arrayp + itemprop->rawoffset; + array->stride= internal->itemsize; + array->len= ((char*)internal->endptr - arrayp)/internal->itemsize; + array->type= itemprop->rawtype; + } + else + memset(array, 0, sizeof(RawArray)); + + RNA_property_collection_end(&iter); + + return 1; +} + +#define RAW_GET(dtype, var, raw, a) \ +{ \ + switch(raw.type) { \ + case PROP_RAW_CHAR: var = (dtype)((char*)raw.array)[a]; break; \ + case PROP_RAW_SHORT: var = (dtype)((short*)raw.array)[a]; break; \ + case PROP_RAW_INT: var = (dtype)((int*)raw.array)[a]; break; \ + case PROP_RAW_FLOAT: var = (dtype)((float*)raw.array)[a]; break; \ + case PROP_RAW_DOUBLE: var = (dtype)((double*)raw.array)[a]; break; \ + default: var = (dtype)0; \ + } \ +} + +#define RAW_SET(dtype, raw, a, var) \ +{ \ + switch(raw.type) { \ + case PROP_RAW_CHAR: ((char*)raw.array)[a] = (char)var; break; \ + case PROP_RAW_SHORT: ((short*)raw.array)[a] = (short)var; break; \ + case PROP_RAW_INT: ((int*)raw.array)[a] = (int)var; break; \ + case PROP_RAW_FLOAT: ((float*)raw.array)[a] = (float)var; break; \ + case PROP_RAW_DOUBLE: ((double*)raw.array)[a] = (double)var; break; \ + } \ +} + +static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, char *propname, void *inarray, RawPropertyType intype, int inlen, int set) +{ + StructRNA *ptype; + PointerRNA itemptr; + PropertyRNA *itemprop, *iprop; + PropertyType itemtype; + RawArray in; + int itemlen= 0; + + /* initialize in array, stride assumed 0 in following code */ + in.array= inarray; + in.type= intype; + in.len= inlen; + in.stride= 0; + + ptype= RNA_property_pointer_type(ptr, prop); + + /* try to get item property pointer */ + RNA_pointer_create(NULL, ptype, NULL, &itemptr); + itemprop= RNA_struct_find_property(&itemptr, propname); + + if(itemprop) { + /* we have item property pointer */ + RawArray out; + + /* check type */ + itemtype= RNA_property_type(itemprop); + + if(!ELEM3(itemtype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) { + BKE_report(reports, RPT_ERROR, "Only boolean, int and float properties supported."); + return 0; + } + + /* check item array */ + itemlen= RNA_property_array_length(itemprop); + + /* try to access as raw array */ + if(RNA_property_collection_raw_array(ptr, prop, itemprop, &out)) { + if(in.len != itemlen*out.len) { + BKE_reportf(reports, RPT_ERROR, "Array length mismatch (expected %d, got %d).", out.len*itemlen, in.len); + return 0; + } + + /* matching raw types */ + if(out.type == in.type) { + void *inp= in.array; + void *outp= out.array; + int a, size; + + itemlen= (itemlen == 0)? 1: itemlen; + + switch(out.type) { + case PROP_RAW_CHAR: size= sizeof(char)*itemlen; break; + case PROP_RAW_SHORT: size= sizeof(short)*itemlen; break; + case PROP_RAW_INT: size= sizeof(int)*itemlen; break; + case PROP_RAW_FLOAT: size= sizeof(float)*itemlen; break; + case PROP_RAW_DOUBLE: size= sizeof(double)*itemlen; break; + } + + for(a=0; a in.len) { + BKE_reportf(reports, RPT_ERROR, "Array length mismatch (got %d, expected more).", in.len); + err= 1; + break; + } + + if(itemlen == 0) { + /* handle conversions */ + if(set) { + switch(itemtype) { + case PROP_BOOLEAN: { + int b; + RAW_GET(int, b, in, a); + RNA_property_boolean_set(&itemptr, iprop, b); + break; + } + case PROP_INT: { + int i; + RAW_GET(int, i, in, a); + RNA_property_int_set(&itemptr, iprop, i); + break; + } + case PROP_FLOAT: { + float f; + RAW_GET(float, f, in, a); + RNA_property_float_set(&itemptr, iprop, f); + break; + } + default: + break; + } + } + else { + switch(itemtype) { + case PROP_BOOLEAN: { + int b= RNA_property_boolean_get(&itemptr, iprop); + RAW_SET(int, in, a, b); + break; + } + case PROP_INT: { + int i= RNA_property_int_get(&itemptr, iprop); + RAW_SET(int, in, a, i); + break; + } + case PROP_FLOAT: { + float f= RNA_property_float_get(&itemptr, iprop); + RAW_SET(float, in, a, f); + break; + } + default: + break; + } + } + a++; + } + else { + /* allocate temporary array if needed */ + if(tmparray && tmplen != itemlen) { + MEM_freeN(tmparray); + tmparray= NULL; + } + if(!tmparray) { + tmparray= MEM_callocN(sizeof(float)*itemlen, "RNA tmparray\n"); + tmplen= itemlen; + } + + /* handle conversions */ + if(set) { + switch(itemtype) { + case PROP_BOOLEAN: { + for(j=0; jcont.properties.last; for (; dprop; dprop= dprop->prev) if (dprop->prop==prop) @@ -150,7 +150,7 @@ PropertyDefRNA *rna_find_property_def(PropertyRNA *prop) return NULL; } - dprop= rna_find_struct_property_def(prop); + dprop= rna_find_struct_property_def(DefRNA.laststruct, prop); if (dprop) return dprop; @@ -1311,7 +1311,7 @@ static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop, const char *stru StructDefRNA *ds; PropertyDefRNA *dp; - dp= rna_find_struct_property_def(prop); + dp= rna_find_struct_property_def(DefRNA.laststruct, prop); if (dp==NULL) return NULL; ds= rna_find_struct_def((StructRNA*)dp->cont); @@ -1371,7 +1371,7 @@ void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *struc RNA_def_property_boolean_sdna(prop, structname, propname, booleanbit); - dp= rna_find_struct_property_def(prop); + dp= rna_find_struct_property_def(DefRNA.laststruct, prop); if(dp) dp->booleannegative= 1; @@ -1468,7 +1468,7 @@ void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structnam RNA_def_property_enum_sdna(prop, structname, propname); - dp= rna_find_struct_property_def(prop); + dp= rna_find_struct_property_def(DefRNA.laststruct, prop); if(dp) dp->enumbitflags= 1; diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 7538f103245..3d66682771d 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -255,6 +255,7 @@ void rna_freelistN(struct ListBase *listbase); StructDefRNA *rna_find_struct_def(StructRNA *srna); FunctionDefRNA *rna_find_function_def(FunctionRNA *func); PropertyDefRNA *rna_find_parameter_def(PropertyRNA *parm); +PropertyDefRNA *rna_find_struct_property_def(StructRNA *srna, PropertyRNA *prop); /* Pointer Handling */ diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 8bae21cca2b..401b430ebc9 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -146,6 +146,10 @@ struct PropertyRNA { /* callback for testing if editable/evaluated */ EditableFunc editable; + + /* raw access */ + int rawoffset; + RawPropertyType rawtype; }; /* Property Types */ diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 6fa275cec91..14db8ea3377 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -309,14 +309,16 @@ PointerRNA rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key } } while((srna=srna->base)); - group= RNA_struct_idproperties(ptr, 0); - - if(group) { - for(idp=group->data.group.first; idp; idp=idp->next) { - if(strcmp(idp->name, key) == 0) { - propptr.type= &RNA_Property; - propptr.data= idp; - return propptr; + if(ptr->data) { + group= RNA_struct_idproperties(ptr, 0); + + if(group) { + for(idp=group->data.group.first; idp; idp=idp->next) { + if(strcmp(idp->name, key) == 0) { + propptr.type= &RNA_Property; + propptr.data= idp; + return propptr; + } } } } -- cgit v1.2.3 From d9b74dcbc9fda3d706b41337c25b143e42ad4ddd Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 29 Jun 2009 19:37:09 +0000 Subject: 2.5: fix for compile error after recent search menu commit. --- source/blender/windowmanager/intern/wm_operators.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 410cd11f1bf..7f9a2153dc3 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -418,7 +418,7 @@ static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *arg_op) uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_RET_1); but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 10, 180, 19, ""); - uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb); + uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb, NULL); /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxhHeight(), 180, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); -- cgit v1.2.3 From 5e20f574310626c453b7372c6e3d0dcf2c575b74 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Mon, 29 Jun 2009 20:23:40 +0000 Subject: 2.5 filebrowser * start of filebrowser RNA * system files, bookmarks, etc. now nicely inside panels to allow collapsing etc. * filebrowser header now defined in space_filebrowser.py TODO: * button type for bookmarks etc. not final yet, at least should get centered still. Suggestions welcome here. --- source/blender/blenloader/intern/readfile.c | 15 --- source/blender/editors/include/ED_fileselect.h | 32 +----- source/blender/editors/interface/interface_panel.c | 4 + source/blender/editors/space_file/file_draw.c | 128 --------------------- source/blender/editors/space_file/file_intern.h | 9 +- source/blender/editors/space_file/file_ops.c | 109 +++++++----------- source/blender/editors/space_file/file_panels.c | 124 ++++++++++++++++++++ source/blender/editors/space_file/filelist.c | 8 +- source/blender/editors/space_file/filelist.h | 1 - source/blender/editors/space_file/filesel.c | 2 +- source/blender/editors/space_file/space_file.c | 118 +++++++++---------- source/blender/makesdna/DNA_space_types.h | 48 +++++++- source/blender/makesrna/RNA_access.h | 2 + source/blender/makesrna/intern/rna_space.c | 123 +++++++++++++++++++- source/blender/windowmanager/WM_types.h | 5 + .../blender/windowmanager/intern/wm_event_system.c | 2 +- 16 files changed, 413 insertions(+), 317 deletions(-) create mode 100644 source/blender/editors/space_file/file_panels.c (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 441e8aff2d6..1dd206e6cce 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5595,21 +5595,6 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) /* temporarily hide it */ ar->flag = RGN_FLAG_HIDDEN; break; - - case SPACE_FILE: - /* channel (bookmarks/directories) region */ - ar= MEM_callocN(sizeof(ARegion), "area region from do_versions"); - BLI_addtail(lb, ar); - ar->regiontype= RGN_TYPE_CHANNELS; - ar->alignment= RGN_ALIGN_LEFT; - ar->v2d.scroll= V2D_SCROLL_RIGHT; - /* button UI region */ - ar= MEM_callocN(sizeof(ARegion), "area region from do_versions"); - BLI_addtail(lb, ar); - ar->regiontype= RGN_TYPE_UI; - ar->alignment= RGN_ALIGN_TOP; - break; - #if 0 case SPACE_BUTS: /* context UI region */ diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index 34aefa91225..01882ecd9bc 100644 --- a/source/blender/editors/include/ED_fileselect.h +++ b/source/blender/editors/include/ED_fileselect.h @@ -29,34 +29,8 @@ #define ED_FILES_H struct SpaceFile; - -#define FILE_SHORTDISPLAY 1 -#define FILE_LONGDISPLAY 2 -#define FILE_IMGDISPLAY 3 - -typedef struct FileSelectParams { - char title[24]; /* title, also used for the text of the execute button */ - char dir[240]; /* directory */ - char file[80]; /* file */ - - short flag; /* settings for filter, hiding files and display mode */ - short sort; /* sort order */ - short display; /* display mode flag */ - short filter; /* filter when (flags & FILE_FILTER) is true */ - - /* XXX - temporary, better move to filelist */ - short active_bookmark; - int active_file; - int selstate; - - /* XXX --- still unused -- */ - short f_fp; /* show font preview */ - char fp_str[8]; /* string to use for font preview */ - - char *pupmenu; /* allows menu for save options - result stored in menup */ - short menu; /* currently selected option in pupmenu */ - /* XXX --- end unused -- */ -} FileSelectParams; +struct ARegion; +struct FileSelectParams; #define FILE_LAYOUT_HOR 1 #define FILE_LAYOUT_VER 2 @@ -93,7 +67,7 @@ typedef struct FileLayout float column_widths[MAX_FILE_COLUMN]; } FileLayout; -FileSelectParams* ED_fileselect_get_params(struct SpaceFile *sfile); +struct FileSelectParams* ED_fileselect_get_params(struct SpaceFile *sfile); short ED_fileselect_set_params(struct SpaceFile *sfile, const char *title, const char *path, short flag, short display, short filter, short sort); diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index eaf78ae89ef..a20884a61a3 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -104,6 +104,8 @@ static int panel_aligned(ScrArea *sa, ARegion *ar) SpaceButs *sbuts= sa->spacedata.first; return sbuts->align; } + else if(sa->spacetype==SPACE_FILE && ar->regiontype == RGN_TYPE_CHANNELS) + return BUT_VERTICAL; else if(ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS)) return BUT_VERTICAL; @@ -126,6 +128,8 @@ static int panels_re_align(ScrArea *sa, ARegion *ar, Panel **r_pa) } else if(ar->regiontype==RGN_TYPE_UI) return 1; + else if(sa->spacetype==SPACE_FILE && ar->regiontype == RGN_TYPE_CHANNELS) + return 1; /* in case panel is added or disappears */ for(pa=ar->panels.first; pa; pa=pa->next) { diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index bb47d3458fe..02ee8f508c1 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -550,132 +550,4 @@ void file_draw_list(const bContext *C, ARegion *ar) } } -static void file_draw_fsmenu_category_name(ARegion *ar, const char *category_name, short *starty) -{ - short sx, sy; - int bmwidth = ar->v2d.cur.xmax - ar->v2d.cur.xmin - 2*TILE_BORDER_X - ICON_DEFAULT_WIDTH - 4; - int fontsize = file_font_pointsize(); - - sx = ar->v2d.cur.xmin + TILE_BORDER_X; - sy = *starty; - - UI_ThemeColor(TH_TEXT_HI); - file_draw_string(sx, sy, category_name, bmwidth, fontsize, FILE_SHORTEN_END); - - sy -= fontsize*2.0f; - - *starty= sy; -} - -static void file_draw_fsmenu_category(const bContext *C, ARegion *ar, FSMenuCategory category, short *starty) -{ - struct FSMenu* fsmenu = fsmenu_get(); - char bookmark[FILE_MAX]; - int nentries = fsmenu_get_nentries(fsmenu, category); - - short sx, sy, xpos, ypos; - int bmwidth = ar->v2d.cur.xmax - ar->v2d.cur.xmin - 2*TILE_BORDER_X - ICON_DEFAULT_WIDTH - 4; - int fontsize = file_font_pointsize(); - int cat_icon; - int i; - - sx = ar->v2d.cur.xmin + TILE_BORDER_X; - sy = *starty; - - switch(category) { - case FS_CATEGORY_SYSTEM: - cat_icon = ICON_DISK_DRIVE; break; - case FS_CATEGORY_BOOKMARKS: - cat_icon = ICON_BOOKMARKS; break; - case FS_CATEGORY_RECENT: - cat_icon = ICON_FILE_FOLDER; break; - } - - for (i=0; i< nentries && (sy > ar->v2d.cur.ymin) ;++i) { - char *fname = fsmenu_get_entry(fsmenu, category, i); - - if (fname) { - int sl; - BLI_strncpy(bookmark, fname, FILE_MAX); - - sl = strlen(bookmark)-1; - if (sl > 1) { - while (bookmark[sl] == '\\' || bookmark[sl] == '/') { - bookmark[sl] = '\0'; - sl--; - } - } - - if (fsmenu_is_selected(fsmenu, category, i) ) { - UI_ThemeColor(TH_HILITE); - uiRoundBox(sx, sy - fontsize*2.0f, ar->v2d.cur.xmax - TILE_BORDER_X, sy, 4.0f); - UI_ThemeColor(TH_TEXT); - } else { - UI_ThemeColor(TH_TEXT_HI); - } - - xpos = sx; - ypos = sy - (TILE_BORDER_Y * 0.5); - - file_draw_icon(xpos, ypos, cat_icon, ICON_DEFAULT_WIDTH, ICON_DEFAULT_WIDTH); - xpos += ICON_DEFAULT_WIDTH + 4; - file_draw_string(xpos, ypos, bookmark, bmwidth, fontsize, FILE_SHORTEN_FRONT); - sy -= fontsize*2.0; - fsmenu_set_pos(fsmenu, category, i, xpos, ypos); - } - } - - *starty = sy; -} - -void file_draw_fsmenu_operator(const bContext *C, ARegion *ar, wmOperator *op, short *starty) -{ - uiStyle *style= U.uistyles.first; - uiBlock *block; - uiLayout *layout; - int sy; - - sy= *starty; - - block= uiBeginBlock(C, ar, "file_options", UI_EMBOSS); - layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, TILE_BORDER_X, sy, ar->winx-2*TILE_BORDER_X, 20, style); - - RNA_STRUCT_BEGIN(op->ptr, prop) { - if(strcmp(RNA_property_identifier(prop), "rna_type") == 0) - continue; - if(strcmp(RNA_property_identifier(prop), "filename") == 0) - continue; - - uiItemFullR(layout, NULL, 0, op->ptr, prop, -1, 0, 0, 0, 0); - } - RNA_STRUCT_END; - - uiBlockLayoutResolve(C, block, NULL, &sy); - uiEndBlock(C, block); - uiDrawBlock(C, block); - - *starty= sy; -} - -void file_draw_fsmenu(const bContext *C, ARegion *ar) -{ - SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); - int linestep = file_font_pointsize()*2.0f; - short sy= ar->v2d.cur.ymax-2*TILE_BORDER_Y; - - file_draw_fsmenu_category_name(ar, "SYSTEM", &sy); - file_draw_fsmenu_category(C, ar, FS_CATEGORY_SYSTEM, &sy); - sy -= linestep; - file_draw_fsmenu_category_name(ar, "BOOKMARKS", &sy); - file_draw_fsmenu_category(C, ar, FS_CATEGORY_BOOKMARKS, &sy); - sy -= linestep; - file_draw_fsmenu_category_name(ar, "RECENT", &sy); - file_draw_fsmenu_category(C, ar, FS_CATEGORY_RECENT, &sy); - - if(sfile->op) { - sy -= linestep; - file_draw_fsmenu_category_name(ar, "OPTIONS", &sy); - file_draw_fsmenu_operator(C, ar, sfile->op, &sy); - } -} diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 642189ad3fd..6ce30bb48cb 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -30,6 +30,9 @@ /* internal exports only */ +struct ARegion; +struct ARegionType; +struct SpaceFile; /* file_header.c */ void file_header_buttons(const bContext *C, ARegion *ar); @@ -45,7 +48,6 @@ void file_draw_buttons(const bContext *C, ARegion *ar); void file_calc_previews(const bContext *C, ARegion *ar); void file_draw_previews(const bContext *C, ARegion *ar); void file_draw_list(const bContext *C, ARegion *ar); -void file_draw_fsmenu(const bContext *C, ARegion *ar); /* file_ops.h */ struct wmOperatorType; @@ -66,11 +68,14 @@ void FILE_OT_bookmark_toggle(struct wmOperatorType *ot); int file_exec(bContext *C, struct wmOperator *unused); int file_cancel_exec(bContext *C, struct wmOperator *unused); int file_parent_exec(bContext *C, struct wmOperator *unused); -int file_hilight_set(SpaceFile *sfile, ARegion *ar, int mx, int my); +int file_hilight_set(struct SpaceFile *sfile, struct ARegion *ar, int mx, int my); /* filesel.c */ float file_string_width(const char* str); float file_font_pointsize(); +/* file_panels.c */ +void file_panels_register(struct ARegionType *art); + #endif /* ED_FILE_INTERN_H */ diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index ab02147d020..ebece6dd5e6 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -42,6 +42,8 @@ #include "ED_screen.h" #include "ED_fileselect.h" +#include "MEM_guardedalloc.h" + #include "RNA_access.h" #include "RNA_define.h" @@ -234,7 +236,7 @@ static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event) /* single select, deselect all selected first */ file_deselect_all(sfile); file_select(sfile, ar, &rect, val ); - WM_event_add_notifier(C, NC_WINDOW, NULL); + WM_event_add_notifier(C, NC_FILE|ND_PARAMS, NULL); } return OPERATOR_FINISHED; } @@ -299,75 +301,25 @@ void FILE_OT_select_all_toggle(wmOperatorType *ot) /* ---------- BOOKMARKS ----------- */ -static int file_select_bookmark_category(SpaceFile* sfile, ARegion* ar, short x, short y, FSMenuCategory category) -{ - struct FSMenu* fsmenu = fsmenu_get(); - int nentries = fsmenu_get_nentries(fsmenu, category); - int linestep = file_font_pointsize()*2.0f; - short xs, ys; - int i; - int selected = -1; - - for (i=0; i < nentries; ++i) { - fsmenu_get_pos(fsmenu, category, i, &xs, &ys); - if ( (y<=ys) && (y>ys-linestep) ) { - fsmenu_select_entry(fsmenu, category, i); - selected = i; - break; - } - } - return selected; -} - -static void file_select_bookmark(SpaceFile* sfile, ARegion* ar, short x, short y) -{ - float fx, fy; - int selected; - FSMenuCategory category = FS_CATEGORY_SYSTEM; - - if (BLI_in_rcti(&ar->v2d.mask, x, y)) { - char *entry; - - UI_view2d_region_to_view(&ar->v2d, x, y, &fx, &fy); - selected = file_select_bookmark_category(sfile, ar, fx, fy, FS_CATEGORY_SYSTEM); - if (selected<0) { - category = FS_CATEGORY_BOOKMARKS; - selected = file_select_bookmark_category(sfile, ar, fx, fy, category); - } - if (selected<0) { - category = FS_CATEGORY_RECENT; - selected = file_select_bookmark_category(sfile, ar, fx, fy, category); - } - - if (selected>=0) { - entry= fsmenu_get_entry(fsmenu_get(), category, selected); - /* which string */ - if (entry) { - FileSelectParams* params = sfile->params; - BLI_strncpy(params->dir, entry, sizeof(params->dir)); - BLI_cleanup_dir(G.sce, params->dir); - filelist_free(sfile->files); - filelist_setdir(sfile->files, params->dir); - params->file[0] = '\0'; - params->active_file = -1; - } - } - } -} - static int bookmark_select_invoke(bContext *C, wmOperator *op, wmEvent *event) { - ScrArea *sa= CTX_wm_area(C); - ARegion *ar= CTX_wm_region(C); SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); - short x, y; + if(RNA_struct_find_property(op->ptr, "dir")) { + char entry[256]; + FileSelectParams* params = sfile->params; - x = event->x - ar->winrct.xmin; - y = event->y - ar->winrct.ymin; + RNA_string_get(op->ptr, "dir", entry); + BLI_strncpy(params->dir, entry, sizeof(params->dir)); + BLI_cleanup_dir(G.sce, params->dir); + filelist_free(sfile->files); + filelist_setdir(sfile->files, params->dir); + params->file[0] = '\0'; + params->active_file = -1; - file_select_bookmark(sfile, ar, x, y); - ED_area_tag_redraw(sa); + WM_event_add_notifier(C, NC_FILE|ND_PARAMS, NULL); + } + return OPERATOR_FINISHED; } @@ -380,6 +332,8 @@ void FILE_OT_select_bookmark(wmOperatorType *ot) /* api callbacks */ ot->invoke= bookmark_select_invoke; ot->poll= ED_operator_file_active; + + RNA_def_string(ot->srna, "dir", "", 256, "Dir", ""); } static int loadimages_invoke(bContext *C, wmOperator *op, wmEvent *event) @@ -548,7 +502,7 @@ int file_parent_exec(bContext *C, wmOperator *unused) filelist_free(sfile->files); sfile->params->active_file = -1; } - ED_area_tag_redraw(CTX_wm_area(C)); + WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); return OPERATOR_FINISHED; @@ -575,8 +529,8 @@ int file_refresh_exec(bContext *C, wmOperator *unused) filelist_setdir(sfile->files, sfile->params->dir); filelist_free(sfile->files); sfile->params->active_file = -1; - } - ED_area_tag_redraw(CTX_wm_area(C)); + } + WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); return OPERATOR_FINISHED; @@ -596,12 +550,29 @@ void FILE_OT_refresh(struct wmOperatorType *ot) struct ARegion *file_buttons_region(struct ScrArea *sa) { - ARegion *ar; + ARegion *ar, *arnew; for(ar= sa->regionbase.first; ar; ar= ar->next) if(ar->regiontype==RGN_TYPE_CHANNELS) return ar; - return NULL; + + /* add subdiv level; after header */ + for(ar= sa->regionbase.first; ar; ar= ar->next) + if(ar->regiontype==RGN_TYPE_HEADER) + break; + + /* is error! */ + if(ar==NULL) return NULL; + + arnew= MEM_callocN(sizeof(ARegion), "buttons for file panels"); + + BLI_insertlinkafter(&sa->regionbase, ar, arnew); + arnew->regiontype= RGN_TYPE_CHANNELS; + arnew->alignment= RGN_ALIGN_LEFT; + + arnew->flag = RGN_FLAG_HIDDEN; + + return arnew; } int file_bookmark_toggle_exec(bContext *C, wmOperator *unused) diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c new file mode 100644 index 00000000000..815345f34c8 --- /dev/null +++ b/source/blender/editors/space_file/file_panels.c @@ -0,0 +1,124 @@ +#include "BKE_context.h" +#include "BKE_screen.h" + +#include "BLI_blenlib.h" + +#include "DNA_screen_types.h" +#include "DNA_space_types.h" +#include "DNA_userdef_types.h" +#include "DNA_windowmanager_types.h" + +#include "MEM_guardedalloc.h" + +#include "RNA_access.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "file_intern.h" +#include "fsmenu.h" + +#include + +static void do_file_panel_events(bContext *C, void *arg, int event) +{ + +} + +static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory category, int icon) +{ + uiBlock *block; + uiStyle *style= U.uistyles.first; + int i; + int fontsize = file_font_pointsize(); + struct FSMenu* fsmenu = fsmenu_get(); + int nentries = fsmenu_get_nentries(fsmenu, category); + + uiLayoutSetAlignment(pa->layout, UI_LAYOUT_ALIGN_LEFT); + block= uiLayoutFreeBlock(pa->layout); + uiBlockSetHandleFunc(block, do_file_panel_events, NULL); + uiBlockSetEmboss(block, UI_EMBOSSP); + uiBlockBeginAlign(block); + for (i=0; i< nentries;++i) { + char *fname = fsmenu_get_entry(fsmenu, category, i); + uiItemStringO(pa->layout, fname, icon, "FILE_OT_select_bookmark", "dir", fname); + } + uiBlockEndAlign(block); +} + +static void file_panel_system(const bContext *C, Panel *pa) +{ + file_panel_category(C, pa, FS_CATEGORY_SYSTEM, ICON_DISK_DRIVE); +} + +static void file_panel_bookmarks(const bContext *C, Panel *pa) +{ + file_panel_category(C, pa, FS_CATEGORY_BOOKMARKS, ICON_BOOKMARKS); +} + + +static void file_panel_recent(const bContext *C, Panel *pa) +{ + file_panel_category(C, pa, FS_CATEGORY_RECENT, ICON_FILE_FOLDER); +} + + +static void file_panel_operator(const bContext *C, Panel *pa) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + struct wmOperator *op = sfile ? sfile->op : NULL; + uiBlock *block; + int sy; + + block= uiLayoutFreeBlock(pa->layout); + uiBlockSetHandleFunc(block, do_file_panel_events, NULL); + + sy= 0; + if (op) { + uiBlockBeginAlign(block); + RNA_STRUCT_BEGIN(op->ptr, prop) { + if(strcmp(RNA_property_identifier(prop), "rna_type") == 0) + continue; + if(strcmp(RNA_property_identifier(prop), "filename") == 0) + continue; + + uiItemFullR(pa->layout, NULL, 0, op->ptr, prop, -1, 0, 0, 0, 0); + } + RNA_STRUCT_END; + uiBlockEndAlign(block); + } + uiBlockLayoutResolve(C, block, NULL, &sy); + uiEndBlock(C, block); + uiDrawBlock(C, block); +} + + +void file_panels_register(ARegionType *art) +{ + PanelType *pt; + + pt= MEM_callocN(sizeof(PanelType), "spacetype file system directories"); + strcpy(pt->idname, "FILE_PT_system"); + strcpy(pt->label, "System"); + pt->draw= file_panel_system; + BLI_addtail(&art->paneltypes, pt); + + pt= MEM_callocN(sizeof(PanelType), "spacetype file bookmarks"); + strcpy(pt->idname, "FILE_PT_bookmarks"); + strcpy(pt->label, "Bookmarks"); + pt->draw= file_panel_bookmarks; + BLI_addtail(&art->paneltypes, pt); + + pt= MEM_callocN(sizeof(PanelType), "spacetype file recent directories"); + strcpy(pt->idname, "FILE_PT_recent"); + strcpy(pt->label, "Recent"); + pt->draw= file_panel_recent; + BLI_addtail(&art->paneltypes, pt); + + pt= MEM_callocN(sizeof(PanelType), "spacetype file operator properties"); + strcpy(pt->idname, "FILE_PT_operator"); + strcpy(pt->label, "Operator"); + pt->draw= file_panel_operator; + BLI_addtail(&art->paneltypes, pt); +} \ No newline at end of file diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 766dec7c064..573aed72728 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -823,16 +823,16 @@ void filelist_sort(struct FileList* filelist, short sort) int num;/* , act= 0; */ switch(sort) { - case FILE_SORTALPHA: + case FILE_SORT_ALPHA: qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_name); break; - case FILE_SORTDATE: + case FILE_SORT_TIME: qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_date); break; - case FILE_SORTSIZE: + case FILE_SORT_SIZE: qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_size); break; - case FILE_SORTEXTENS: + case FILE_SORT_EXTENSION: qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_extension); } diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h index f10c89926d6..e929e028849 100644 --- a/source/blender/editors/space_file/filelist.h +++ b/source/blender/editors/space_file/filelist.h @@ -49,7 +49,6 @@ void filelist_free_icons(); struct FileList * filelist_copy(struct FileList* filelist); int filelist_find(struct FileList* filelist, char *file); void filelist_free(struct FileList* filelist); -void filelist_freelib(struct FileList* filelist); void filelist_sort(struct FileList* filelist, short sort); int filelist_numfiles(struct FileList* filelist); const char * filelist_dir(struct FileList* filelist); diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 479d9cabc55..ea42ad80fe6 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -84,7 +84,7 @@ FileSelectParams* ED_fileselect_get_params(struct SpaceFile *sfile) { if (!sfile->params) { - ED_fileselect_set_params(sfile, "", "/", 0, FILE_SHORTDISPLAY, 0, FILE_SORTALPHA); + ED_fileselect_set_params(sfile, "", "/", 0, FILE_SHORTDISPLAY, 0, FILE_SORT_ALPHA); } return sfile->params; } diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 37d8f2bffa4..4ed92d3f5d9 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -163,6 +163,46 @@ static SpaceLink *file_duplicate(SpaceLink *sl) return (SpaceLink *)sfilen; } +static void file_refresh(const bContext *C, ScrArea *sa) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + FileSelectParams *params = ED_fileselect_get_params(sfile); + + if (!sfile->files) { + sfile->files = filelist_new(); + filelist_setdir(sfile->files, params->dir); + params->active_file = -1; // added this so it opens nicer (ton) + } + filelist_hidedot(sfile->files, params->flag & FILE_HIDE_DOT); + if (filelist_empty(sfile->files)) + { + filelist_readdir(sfile->files); + } + filelist_setfilter(sfile->files, params->flag & FILE_FILTER ? params->filter : 0); + if(params->sort!=FILE_SORT_NONE) filelist_sort(sfile->files, params->sort); +} + +static void file_listener(ScrArea *sa, wmNotifier *wmn) +{ + SpaceFile* sfile = (SpaceFile*)sa->spacedata.first; + + /* context changes */ + switch(wmn->category) { + case NC_FILE: + switch (wmn->data) { + case ND_FILELIST: + if (sfile->files) filelist_free(sfile->files); + ED_area_tag_refresh(sa); + ED_area_tag_redraw(sa); + break; + case ND_PARAMS: + ED_area_tag_refresh(sa); + ED_area_tag_redraw(sa); + break; + } + break; + } +} /* add handlers, stuff you only do once or on area/region changes */ static void file_main_area_init(wmWindowManager *wm, ARegion *ar) @@ -188,31 +228,9 @@ static void file_main_area_draw(const bContext *C, ARegion *ar) View2D *v2d= &ar->v2d; View2DScrollers *scrollers; float col[3]; - - if (!sfile->files) { - sfile->files = filelist_new(); - filelist_setdir(sfile->files, params->dir); - params->active_file = -1; // added this so it opens nicer (ton) - } layout = ED_fileselect_get_layout(sfile, ar); - if (filelist_empty(sfile->files)) - { - unsigned int filter = 0; - filelist_hidedot(sfile->files, params->flag & FILE_HIDE_DOT); - if (params->flag & FILE_FILTER) { - filter = params->filter ; - } else { - filter = 0; - } - - filelist_setfilter(sfile->files, filter); - filelist_readdir(sfile->files); - - if(params->sort!=FILE_SORTALPHA) filelist_sort(sfile->files, params->sort); - } - /* clear and setup matrix */ UI_GetThemeColor3fv(TH_BACK, col); glClearColor(col[0], col[1], col[2], 0.0); @@ -280,6 +298,7 @@ void file_operatortypes(void) void file_keymap(struct wmWindowManager *wm) { ListBase *keymap= WM_keymap_listbase(wm, "File", SPACE_FILE, 0); + WM_keymap_add_item(keymap, "FILE_OT_bookmark_toggle", NKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_select_border", BKEY, KM_PRESS, 0, 0); @@ -295,56 +314,31 @@ void file_keymap(struct wmWindowManager *wm) static void file_channel_area_init(wmWindowManager *wm, ARegion *ar) { - ListBase *keymap; - - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy); - - /* own keymap */ - keymap= WM_keymap_listbase(wm, "FileBookmark", SPACE_FILE, 0); - WM_event_add_keymap_handler_bb(&ar->handlers, keymap, NULL, NULL); + ED_region_panels_init(wm, ar); } static void file_channel_area_draw(const bContext *C, ARegion *ar) { - View2D *v2d= &ar->v2d; - float col[3]; - - UI_GetThemeColor3fv(TH_PANEL, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - /* data... */ - UI_view2d_view_ortho(C, v2d); + ED_region_panels(C, ar, 1, NULL); +} - file_draw_fsmenu(C, ar); +static void file_channel_area_listener(ARegion *ar, wmNotifier *wmn) +{ + /* context changes */ + switch(wmn->category) { + + } } /* add handlers, stuff you only do once or on area/region changes */ static void file_header_area_init(wmWindowManager *wm, ARegion *ar) { - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); + ED_region_header_init(ar); } static void file_header_area_draw(const bContext *C, ARegion *ar) { - float col[3]; - - /* clear */ - if(ED_screen_area_active(C)) - UI_GetThemeColor3fv(TH_HEADER, col); - else - UI_GetThemeColor3fv(TH_HEADERDESEL, col); - - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - /* set view2d view matrix for scrolling (without scrollers) */ - UI_view2d_view_ortho(C, &ar->v2d); - - file_header_buttons(C, ar); - - /* restore view matrix? */ - UI_view2d_view_restore(C); + ED_region_header(C, ar); } /* add handlers, stuff you only do once or on area/region changes */ @@ -386,6 +380,8 @@ void ED_spacetype_file(void) st->free= file_free; st->init= file_init; st->duplicate= file_duplicate; + st->refresh= file_refresh; + st->listener= file_listener; st->operatortypes= file_operatortypes; st->keymap= file_keymap; @@ -405,6 +401,7 @@ void ED_spacetype_file(void) art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; art->init= file_header_area_init; art->draw= file_header_area_draw; + // art->listener= file_header_area_listener; BLI_addhead(&st->regiontypes, art); /* regions: ui */ @@ -421,10 +418,13 @@ void ED_spacetype_file(void) art->regionid = RGN_TYPE_CHANNELS; art->minsizex= 240; art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; + art->listener= file_channel_area_listener; art->init= file_channel_area_init; art->draw= file_channel_area_draw; BLI_addhead(&st->regiontypes, art); - + file_panels_register(art); + + BKE_spacetype_register(st); } diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 9dc7e07a95c..53dc5ed26e8 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -165,6 +165,48 @@ typedef struct SpaceSeq { struct bGPdata *gpd; /* grease-pencil data */ } SpaceSeq; +typedef struct FileSelectParams { + char title[24]; /* title, also used for the text of the execute button */ + char dir[240]; /* directory */ + char file[80]; /* file */ + + short flag; /* settings for filter, hiding files and display mode */ + short sort; /* sort order */ + short display; /* display mode flag */ + short filter; /* filter when (flags & FILE_FILTER) is true */ + + /* XXX - temporary, better move to filelist */ + short active_bookmark; + short pad; + int active_file; + int selstate; + + /* XXX --- still unused -- */ + short f_fp; /* show font preview */ + short menu; /* currently selected option in pupmenu */ + char fp_str[8]; /* string to use for font preview */ + + char *pupmenu; /* allows menu for save options - result stored in menup */ + + /* XXX --- end unused -- */ +} FileSelectParams; + +/* FileSelectParams.display */ +enum FileDisplayTypeE { + FILE_SHORTDISPLAY = 1, + FILE_LONGDISPLAY, + FILE_IMGDISPLAY +}; + +/* FileSelectParams.sort */ +enum FileSortTypeE { + FILE_SORT_NONE = 0, + FILE_SORT_ALPHA = 1, + FILE_SORT_EXTENSION, + FILE_SORT_TIME, + FILE_SORT_SIZE +}; + typedef struct SpaceFile { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ @@ -554,12 +596,6 @@ typedef struct SpaceImaSel { #define FILE_FILTER 256 #define FILE_BOOKMARKS 512 -/* sfile->sort */ -#define FILE_SORTALPHA 0 -#define FILE_SORTDATE 1 -#define FILE_SORTSIZE 2 -#define FILE_SORTEXTENS 3 - /* files in filesel list: 2=ACTIVE */ #define HILITE 1 #define BLENDERFILE 4 diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 1f856062533..3c205020ba7 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -174,6 +174,7 @@ extern StructRNA RNA_ExplodeModifier; extern StructRNA RNA_ExpressionController; extern StructRNA RNA_Event; extern StructRNA RNA_FCurve; +extern StructRNA RNA_FileSelectParams; extern StructRNA RNA_FModifier; extern StructRNA RNA_FModifierCycles; extern StructRNA RNA_FModifierEnvelope; @@ -369,6 +370,7 @@ extern StructRNA RNA_SpaceImageEditor; extern StructRNA RNA_SpaceOutliner; extern StructRNA RNA_SpaceSequenceEditor; extern StructRNA RNA_SpaceTextEditor; +extern StructRNA RNA_SpaceFileBrowser; extern StructRNA RNA_SpaceUVEditor; extern StructRNA RNA_SpeedControlSequence; extern StructRNA RNA_SpotLamp; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index d5ac0d6e427..ae3b249e51f 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -96,8 +96,8 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr) return &RNA_SpaceOutliner; case SPACE_BUTS: return &RNA_SpaceButtonsWindow; - /* case SPACE_FILE: - return &RNA_SpaceFileBrowser;*/ + case SPACE_FILE: + return &RNA_SpaceFileBrowser; case SPACE_IMAGE: return &RNA_SpaceImageEditor; /*case SPACE_INFO: @@ -210,6 +210,13 @@ void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value) st->top= 0; } +void rna_SpaceFileBrowser_params_set(PointerRNA *ptr, PointerRNA value) +{ + SpaceFile *sfile= (SpaceFile*)(ptr->data); + + sfile->params= value.data; +} + /* Space Buttons */ StructRNA *rna_SpaceButtonsWindow_pin_id_typef(PointerRNA *ptr) @@ -860,12 +867,124 @@ static void rna_def_space_text(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool."); } +static void rna_def_fileselect_params(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem file_display_items[] = { + {FILE_SHORTDISPLAY, "FILE_SHORTDISPLAY", ICON_SHORTDISPLAY, "Short List", "Display files as short list"}, + {FILE_LONGDISPLAY, "FILE_LONGDISPLAY", ICON_LONGDISPLAY, "Long List", "Display files as a detailed list"}, + {FILE_IMGDISPLAY, "FILE_IMGDISPLAY", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem file_sort_items[] = { + {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_SORTALPHA, "Sort alphabetically", "Sort the file list alphabetically."}, + {FILE_SORT_EXTENSION, "FILE_SORT_EXTENSION", ICON_SORTBYEXT, "Sort by extension", "Sort the file list by extension."}, + {FILE_SORT_TIME, "FILE_SORT_TIME", ICON_SORTTIME, "Sort by time", "Sort files by modification time."}, + {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_SORTSIZE, "Sort by size", "Sort files by size."}, + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "FileSelectParams", NULL); + RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters."); + + prop= RNA_def_property(srna, "display", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "display"); + RNA_def_property_enum_items(prop, file_display_items); + RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list"); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "do_filter", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER); + RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files."); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "hide_dot", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_HIDE_DOT); + RNA_def_property_ui_text(prop, "Hide Dot Files", "Hide hidden dot files."); + RNA_def_property_update(prop, NC_FILE | ND_FILELIST , NULL); + + prop= RNA_def_property(srna, "sort", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "sort"); + RNA_def_property_enum_items(prop, file_sort_items); + RNA_def_property_ui_text(prop, "Sort", ""); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_image", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", IMAGEFILE); + RNA_def_property_ui_text(prop, "Filter Images", "Show image files."); + RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_blender", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", BLENDERFILE); + RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files."); + RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_movie", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", MOVIEFILE); + RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files."); + RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_script", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", PYSCRIPTFILE); + RNA_def_property_ui_text(prop, "Filter Script", "Show script files."); + RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_font", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", FTFONTFILE); + RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files."); + RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_sound", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", SOUNDFILE); + RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files."); + RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_text", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", TEXTFILE); + RNA_def_property_ui_text(prop, "Filter Text", "Show text files."); + RNA_def_property_ui_icon(prop, ICON_FILE_BLANK, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_folder", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", FOLDERFILE); + RNA_def_property_ui_text(prop, "Filter Folder", "Show folders."); + RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + +} + +static void rna_def_space_filebrowser(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "SpaceFileBrowser", "Space"); + RNA_def_struct_sdna(srna, "SpaceFile"); + RNA_def_struct_ui_text(srna, "Space File Browser", "File browser space data."); + + prop= RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "params"); + RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceFileBrowser_params_set", NULL); + RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser."); + +} + void RNA_def_space(BlenderRNA *brna) { rna_def_space(brna); rna_def_space_image(brna); rna_def_space_sequencer(brna); rna_def_space_text(brna); + rna_def_fileselect_params(brna); + rna_def_space_filebrowser(brna); rna_def_space_outliner(brna); rna_def_background_image(brna); rna_def_space_3dview(brna); diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 9b987cdfa51..e3a7a906fef 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -128,6 +128,7 @@ typedef struct wmNotifier { #define NC_BRUSH (11<<24) #define NC_TEXT (12<<24) #define NC_WORLD (13<<24) +#define NC_FILE (14<<24) /* data type, 256 entries is enough, it can overlap */ #define NOTE_DATA 0x00FF0000 @@ -182,6 +183,10 @@ typedef struct wmNotifier { /* NC_TEXT Text */ #define ND_CURSOR (50<<16) #define ND_DISPLAY (51<<16) + + /* NC_FILE Filebrowser */ +#define ND_PARAMS (60<<16) +#define ND_FILELIST (61<<16) /* subtype, 256 entries too */ #define NOTE_SUBTYPE 0x0000FF00 diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 286d1216f66..189594a4947 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -776,7 +776,7 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa case EVT_FILESELECT_OPEN: case EVT_FILESELECT_FULL_OPEN: { - short flag =0; short display =FILE_SHORTDISPLAY; short filter =0; short sort =FILE_SORTALPHA; + short flag =0; short display =FILE_SHORTDISPLAY; short filter =0; short sort =FILE_SORT_ALPHA; char *path= RNA_string_get_alloc(handler->op->ptr, "filename", NULL, 0); if(event->val==EVT_FILESELECT_OPEN) -- cgit v1.2.3 From 84cd5a6cfbd607e73f8b2f522983520b18b1b63b Mon Sep 17 00:00:00 2001 From: Tom Musgrove Date: Mon, 29 Jun 2009 21:07:33 +0000 Subject: This commit adds Alt-LMB as an alternative to MMB, and CTRL-ALT-LMB as an alternative to CTRL-MMB so that laptop users can use 2.5 --- source/blender/editors/interface/view2d_ops.c | 6 +++++- source/blender/editors/space_image/space_image.c | 2 ++ source/blender/editors/space_text/space_text.c | 2 ++ source/blender/editors/space_view3d/view3d_ops.c | 6 ++++++ 4 files changed, 15 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index bd1c734b870..b86150f86bf 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1356,7 +1356,8 @@ void UI_view2d_keymap(wmWindowManager *wm) /* pan/scroll */ WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, KM_SHIFT, 0); - + WM_keymap_add_item(keymap, "VIEW2D_OT_pan", LEFTMOUSE, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_right", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_left", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0); @@ -1379,6 +1380,7 @@ void UI_view2d_keymap(wmWindowManager *wm) /* zoom - drag */ WM_keymap_add_item(keymap, "VIEW2D_OT_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "VIEW2D_OT_zoom", LEFTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0); /* no MMB on laptops */ /* borderzoom - drag */ WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_border", BKEY, KM_PRESS, KM_SHIFT, 0); @@ -1389,9 +1391,11 @@ void UI_view2d_keymap(wmWindowManager *wm) /* Alternative keymap for buttons listview */ keymap= WM_keymap_listbase(wm, "View2D Buttons List", 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "VIEW2D_OT_pan", LEFTMOUSE, KM_PRESS, KM_ALT, 0); /* no MMB on laptops */ WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_down", WHEELDOWNMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_up", WHEELUPMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "VIEW2D_OT_zoom", LEFTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0); /* no MMB on laptops */ WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_out", PADMINUS, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_in", PADPLUSKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_reset", HOMEKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 7d6faa00dfc..d05511b67ba 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -216,12 +216,14 @@ void image_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "IMAGE_OT_view_all", HOMEKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_pan", MIDDLEMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "IMAGE_OT_view_pan", LEFTMOUSE, KM_PRESS, KM_ALT, 0); /* no MMB on laptops */ WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_in", WHEELINMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_out", WHEELOUTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_in", PADPLUSKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_out", PADMINUS, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom", LEFTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0); /* no MMB on laptops */ RNA_float_set(WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_ratio", PAD8, KM_PRESS, KM_SHIFT, 0)->ptr, "ratio", 8.0f); RNA_float_set(WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_ratio", PAD4, KM_PRESS, KM_SHIFT, 0)->ptr, "ratio", 4.0f); diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 8759fd00f74..fb05e3ecaac 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -276,6 +276,8 @@ static void text_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "TEXT_OT_overwrite_toggle", INSERTKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "TEXT_OT_scroll", MIDDLEMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "TEXT_OT_scroll", LEFTMOUSE, KM_PRESS, KM_ALT, 0); /* no MMB on laptops */ + WM_keymap_add_item(keymap, "TEXT_OT_scroll_bar", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "TEXT_OT_cursor_set", LEFTMOUSE, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "TEXT_OT_cursor_set", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "select", 1); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 6cb1051ce4a..9505e3be4fd 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -139,8 +139,14 @@ void view3d_keymap(wmWindowManager *wm) WM_keymap_verify_item(keymap, "VIEW3D_OT_cursor3d", ACTIONMOUSE, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "VIEW3D_OT_viewrotate", MIDDLEMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "VIEW3D_OT_viewrotate", LEFTMOUSE, KM_PRESS, KM_ALT, 0); /* no MMB on laptops */ + WM_keymap_verify_item(keymap, "VIEW3D_OT_viewmove", MIDDLEMOUSE, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "VIEW3D_OT_viewmove", LEFTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0); /* no MMB on laptops */ + WM_keymap_verify_item(keymap, "VIEW3D_OT_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "VIEW3D_OT_zoom", LEFTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0); /* no MMB on laptops */ + WM_keymap_verify_item(keymap, "VIEW3D_OT_viewcenter", PADPERIOD, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "VIEW3D_OT_smoothview", TIMER1, KM_ANY, KM_ANY, 0); -- cgit v1.2.3 From 17d5bfd9709583cb58c030ecea3f7d3fb44a81ad Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Mon, 29 Jun 2009 22:16:48 +0000 Subject: 2.5 file browser * bookmark operators: add and delete bookmark * first start at menus in file browser: Directory and Bookmarks * Adding a bookmark via menu or via CTRL+B * Remove a bookmark with the X button next to it. --- source/blender/editors/space_file/file_intern.h | 2 + source/blender/editors/space_file/file_ops.c | 65 +++++++++++++++++++++++++ source/blender/editors/space_file/file_panels.c | 13 +++-- source/blender/editors/space_file/space_file.c | 4 +- 4 files changed, 78 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 6ce30bb48cb..fd37bb75685 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -58,6 +58,8 @@ void FILE_OT_select(struct wmOperatorType *ot); void FILE_OT_select_all_toggle(struct wmOperatorType *ot); void FILE_OT_select_border(struct wmOperatorType *ot); void FILE_OT_select_bookmark(struct wmOperatorType *ot); +void FILE_OT_add_bookmark(struct wmOperatorType *ot); +void FILE_OT_delete_bookmark(struct wmOperatorType *ot); void FILE_OT_loadimages(struct wmOperatorType *ot); void FILE_OT_exec(struct wmOperatorType *ot); void FILE_OT_cancel(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index ebece6dd5e6..dd20c8e8224 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -336,6 +336,71 @@ void FILE_OT_select_bookmark(wmOperatorType *ot) RNA_def_string(ot->srna, "dir", "", 256, "Dir", ""); } +static int bookmark_add_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + ScrArea *sa= CTX_wm_area(C); + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + struct FSMenu* fsmenu = fsmenu_get(); + struct FileSelectParams* params= ED_fileselect_get_params(sfile); + + if (params->dir[0] != '\0') { + char name[FILE_MAX]; + + fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, params->dir, 0, 1); + BLI_make_file_string("/", name, BLI_gethome(), ".Bfs"); + fsmenu_write_file(fsmenu, name); + } + + ED_area_tag_redraw(sa); + return OPERATOR_FINISHED; +} + +void FILE_OT_add_bookmark(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Bookmark"; + ot->idname= "FILE_OT_add_bookmark"; + + /* api callbacks */ + ot->invoke= bookmark_add_invoke; + ot->poll= ED_operator_file_active; +} + +static int bookmark_delete_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + ScrArea *sa= CTX_wm_area(C); + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + struct FSMenu* fsmenu = fsmenu_get(); + int nentries = fsmenu_get_nentries(fsmenu, FS_CATEGORY_BOOKMARKS); + if(RNA_struct_find_property(op->ptr, "index")) { + int index = RNA_int_get(op->ptr, "index"); + if ( (index >-1) && (index < nentries)) { + char name[FILE_MAX]; + + fsmenu_remove_entry(fsmenu, FS_CATEGORY_BOOKMARKS, index); + BLI_make_file_string("/", name, BLI_gethome(), ".Bfs"); + fsmenu_write_file(fsmenu, name); + ED_area_tag_redraw(sa); + } + } + + return OPERATOR_FINISHED; +} + +void FILE_OT_delete_bookmark(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Delete Bookmark"; + ot->idname= "FILE_OT_delete_bookmark"; + + /* api callbacks */ + ot->invoke= bookmark_delete_invoke; + ot->poll= ED_operator_file_active; + + RNA_def_int(ot->srna, "index", -1, -1, 20000, "Index", "", -1, 20000); +} + + static int loadimages_invoke(bContext *C, wmOperator *op, wmEvent *event) { ScrArea *sa= CTX_wm_area(C); diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 815345f34c8..b370624d312 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -26,7 +26,7 @@ static void do_file_panel_events(bContext *C, void *arg, int event) } -static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory category, int icon) +static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory category, int icon, int allow_delete) { uiBlock *block; uiStyle *style= U.uistyles.first; @@ -41,26 +41,29 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat uiBlockSetEmboss(block, UI_EMBOSSP); uiBlockBeginAlign(block); for (i=0; i< nentries;++i) { + uiLayout* layout = uiLayoutRow(pa->layout, UI_LAYOUT_ALIGN_LEFT); char *fname = fsmenu_get_entry(fsmenu, category, i); - uiItemStringO(pa->layout, fname, icon, "FILE_OT_select_bookmark", "dir", fname); + uiItemStringO(layout, fname, icon, "FILE_OT_select_bookmark", "dir", fname); + if (allow_delete) + uiItemIntO(layout, "", ICON_X, "FILE_OT_delete_bookmark", "index", i); } uiBlockEndAlign(block); } static void file_panel_system(const bContext *C, Panel *pa) { - file_panel_category(C, pa, FS_CATEGORY_SYSTEM, ICON_DISK_DRIVE); + file_panel_category(C, pa, FS_CATEGORY_SYSTEM, ICON_DISK_DRIVE, 0); } static void file_panel_bookmarks(const bContext *C, Panel *pa) { - file_panel_category(C, pa, FS_CATEGORY_BOOKMARKS, ICON_BOOKMARKS); + file_panel_category(C, pa, FS_CATEGORY_BOOKMARKS, ICON_BOOKMARKS, 1); } static void file_panel_recent(const bContext *C, Panel *pa) { - file_panel_category(C, pa, FS_CATEGORY_RECENT, ICON_FILE_FOLDER); + file_panel_category(C, pa, FS_CATEGORY_RECENT, ICON_FILE_FOLDER, 0); } diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 4ed92d3f5d9..3824c23cb48 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -292,6 +292,8 @@ void file_operatortypes(void) WM_operatortype_append(FILE_OT_parent); WM_operatortype_append(FILE_OT_refresh); WM_operatortype_append(FILE_OT_bookmark_toggle); + WM_operatortype_append(FILE_OT_add_bookmark); + WM_operatortype_append(FILE_OT_delete_bookmark); } /* NOTE: do not add .blend file reading on this level */ @@ -304,7 +306,7 @@ void file_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "FILE_OT_select_border", BKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_highlight", MOUSEMOVE, KM_ANY, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_parent", PKEY, KM_PRESS, 0, 0); - + WM_keymap_add_item(keymap, "FILE_OT_add_bookmark", BKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "FILE_OT_loadimages", TIMER1, KM_ANY, KM_ANY, 0); keymap= WM_keymap_listbase(wm, "FileBookmark", SPACE_FILE, 0); -- cgit v1.2.3 From da32a0594b80aa5f980e17f446eb2d20c76272c5 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Mon, 29 Jun 2009 23:21:11 +0000 Subject: 2.5 file browser * remove '.' and '..' from file browser list. sigh! * removed delete buttons from automatically added bookmarks (Desktop and Documents) Note: please check on non-Windows platforms --- source/blender/blenlib/intern/storage.c | 42 +++++-------------------- source/blender/editors/space_file/file_ops.c | 19 ++++------- source/blender/editors/space_file/file_panels.c | 2 +- source/blender/editors/space_file/fsmenu.c | 39 ++--------------------- source/blender/editors/space_file/fsmenu.h | 13 ++------ 5 files changed, 19 insertions(+), 96 deletions(-) (limited to 'source') diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 0ae17a13e43..3204d5f74e1 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -218,7 +218,7 @@ void BLI_builddir(char *dirname, char *relname) { struct dirent *fname; struct dirlink *dlink; - int rellen, newnum = 0, seen_ = 0, seen__ = 0; + int rellen, newnum = 0, ignore; char buf[256]; DIR *dir; @@ -238,21 +238,17 @@ void BLI_builddir(char *dirname, char *relname) if ( (dir = (DIR *)opendir(".")) ){ while ((fname = (struct dirent*) readdir(dir)) != NULL) { - if(hide_dot && fname->d_name[0]=='.' && fname->d_name[1]!='.' && fname->d_name[1]!=0); + if(hide_dot && fname->d_name[0]=='.' && fname->d_name[1]!='.' && fname->d_name[1]!=0) { + } + else if ( ( (fname->d_name[0] == '.') && (fname->d_name[1] == 0) ) || + ( (fname->d_name[0] == '.') && (fname->d_name[1] == '.') && (fname->d_name[2] == 0)) ) { + /* ignore '.' and '..' */ + } else { - dlink = (struct dirlink *)malloc(sizeof(struct dirlink)); if (dlink){ strcpy(buf+rellen,fname->d_name); - dlink->name = BLI_strdup(buf); - - if (dlink->name[0] == '.') { - if (dlink->name[1] == 0) seen_ = 1; - else if (dlink->name[1] == '.') { - if (dlink->name[2] == 0) seen__ = 1; - } - } BLI_addhead(dirbase,dlink); newnum++; } @@ -260,30 +256,6 @@ void BLI_builddir(char *dirname, char *relname) } if (newnum){ -#ifndef WIN32 - if (seen_ == 0) { /* Cachefs PATCH */ - dlink = (struct dirlink *)malloc(sizeof(struct dirlink)); - strcpy(buf+rellen,"./."); - dlink->name = BLI_strdup(buf); - BLI_addhead(dirbase,dlink); - newnum++; - } - if (seen__ == 0) { /* MAC PATCH */ - dlink = (struct dirlink *)malloc(sizeof(struct dirlink)); - strcpy(buf+rellen,"./.."); - dlink->name = BLI_strdup(buf); - BLI_addhead(dirbase,dlink); - newnum++; - } -#else // WIN32 - if (seen_ == 0) { /* should only happen for root paths like "C:\" */ - dlink = (struct dirlink *)malloc(sizeof(struct dirlink)); - strcpy(buf+rellen,"."); - dlink->name = BLI_strdup(buf); - BLI_addhead(dirbase,dlink); - newnum++; - } -#endif if (files) files=(struct direntry *)realloc(files,(totnum+newnum) * sizeof(struct direntry)); else files=(struct direntry *)malloc(newnum * sizeof(struct direntry)); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index dd20c8e8224..3e24f360e40 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -137,22 +137,15 @@ static void file_select(SpaceFile* sfile, ARegion* ar, const rcti* rect, short v params->active_file = last_file; if(file && S_ISDIR(file->type)) { - /* the path is too long and we are not going up! */ - if (strcmp(file->relname, ".") && - strcmp(file->relname, "..") && - strlen(params->dir) + strlen(file->relname) >= FILE_MAX ) + /* the path is too long! */ + if (strlen(params->dir) + strlen(file->relname) >= FILE_MAX ) { // XXX error("Path too long, cannot enter this directory"); } else { - if (strcmp(file->relname, "..")==0) { - /* avoids /../../ */ - BLI_parent_dir(params->dir); - } else { - strcat(params->dir, file->relname); - strcat(params->dir,"/"); - params->file[0] = '\0'; - BLI_cleanup_dir(G.sce, params->dir); - } + strcat(params->dir, file->relname); + strcat(params->dir,"/"); + params->file[0] = '\0'; + BLI_cleanup_dir(G.sce, params->dir); filelist_setdir(sfile->files, params->dir); filelist_free(sfile->files); params->active_file = -1; diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index b370624d312..560c509ddcb 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -44,7 +44,7 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat uiLayout* layout = uiLayoutRow(pa->layout, UI_LAYOUT_ALIGN_LEFT); char *fname = fsmenu_get_entry(fsmenu, category, i); uiItemStringO(layout, fname, icon, "FILE_OT_select_bookmark", "dir", fname); - if (allow_delete) + if (allow_delete && fsmenu_can_save(fsmenu, category, i) ) uiItemIntO(layout, "", ICON_X, "FILE_OT_delete_bookmark", "index", i); } uiBlockEndAlign(block); diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 59e8dcf82e6..a87ad4c4fd8 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -65,7 +65,6 @@ struct _FSMenuEntry { char *path; short save; - short xs, ys; }; typedef struct FSMenu @@ -74,9 +73,6 @@ typedef struct FSMenu FSMenuEntry *fsmenu_bookmarks; FSMenuEntry *fsmenu_recent; - FSMenuCategory selected_category; - int selected_entry; - } FSMenu; static FSMenu *g_fsmenu = NULL; @@ -89,17 +85,6 @@ struct FSMenu* fsmenu_get(void) return g_fsmenu; } -void fsmenu_select_entry(struct FSMenu* fsmenu, FSMenuCategory category, int index) -{ - fsmenu->selected_category = category; - fsmenu->selected_entry = index; -} - -int fsmenu_is_selected(struct FSMenu* fsmenu, FSMenuCategory category, int index) -{ - return (category==fsmenu->selected_category) && (index==fsmenu->selected_entry); -} - static FSMenuEntry *fsmenu_get_category(struct FSMenu* fsmenu, FSMenuCategory category) { FSMenuEntry *fsms = NULL; @@ -154,36 +139,16 @@ char *fsmenu_get_entry(struct FSMenu* fsmenu, FSMenuCategory category, int idx) return fsme?fsme->path:NULL; } -void fsmenu_set_pos(struct FSMenu* fsmenu, FSMenuCategory category, int idx, short xs, short ys) +short fsmenu_can_save (struct FSMenu* fsmenu, FSMenuCategory category, int idx) { FSMenuEntry *fsme; for (fsme= fsmenu_get_category(fsmenu, category); fsme && idx; fsme= fsme->next) idx--; - if (fsme) { - fsme->xs = xs; - fsme->ys = ys; - } + return fsme?fsme->save:0; } -int fsmenu_get_pos (struct FSMenu* fsmenu, FSMenuCategory category, int idx, short* xs, short* ys) -{ - FSMenuEntry *fsme; - - for (fsme= fsmenu_get_category(fsmenu, category); fsme && idx; fsme= fsme->next) - idx--; - - if (fsme) { - *xs = fsme->xs; - *ys = fsme->ys; - return 1; - } - - return 0; -} - - void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, char *path, int sorted, short save) { FSMenuEntry *prev; diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h index c51c45b7dc4..2cab622d523 100644 --- a/source/blender/editors/space_file/fsmenu.h +++ b/source/blender/editors/space_file/fsmenu.h @@ -52,22 +52,15 @@ int fsmenu_get_nentries (struct FSMenu* fsmenu, FSMenuCategory category); */ char* fsmenu_get_entry (struct FSMenu* fsmenu, FSMenuCategory category, int index); -void fsmenu_select_entry (struct FSMenu* fsmenu, FSMenuCategory category, int index); - -int fsmenu_is_selected (struct FSMenu* fsmenu, FSMenuCategory category, int index); - - /** Sets the position of the fsmenu entry at @a index */ -void fsmenu_set_pos (struct FSMenu* fsmenu, FSMenuCategory category, int index, short xs, short ys); - - /** Returns the position of the fsmenu entry at @a index. return value is 1 if successful, 0 otherwise */ -int fsmenu_get_pos (struct FSMenu* fsmenu, FSMenuCategory category, int index, short* xs, short* ys); - /** Inserts a new fsmenu entry with the given @a path. * Duplicate entries are not added. * @param sorted Should entry be inserted in sorted order? */ void fsmenu_insert_entry (struct FSMenu* fsmenu, FSMenuCategory category, char *path, int sorted, short save); + /** Return whether the entry was created by the user and can be saved and deleted */ +short fsmenu_can_save (struct FSMenu* fsmenu, FSMenuCategory category, int index); + /** Removes the fsmenu entry at the given @a index. */ void fsmenu_remove_entry (struct FSMenu* fsmenu, FSMenuCategory category, int index); -- cgit v1.2.3 From f60760e2e2922a9e600cc67cafbb2e61869e4bb4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 30 Jun 2009 00:42:17 +0000 Subject: Python API Mathutils support for subclassing Vector, Quat, Euler and Matrix types. Removed C docstrings, prefer to make sure our epydocs are well maintained rather then duplicate, vague doc strings. Will convert scripts to detect missing docs from the BGE. --- source/blender/python/generic/Geometry.c | 12 +- source/blender/python/generic/Mathutils.c | 34 +- source/blender/python/generic/euler.c | 75 ++- source/blender/python/generic/euler.h | 5 +- source/blender/python/generic/matrix.c | 89 ++- source/blender/python/generic/matrix.h | 5 +- source/blender/python/generic/quat.c | 68 +-- source/blender/python/generic/quat.h | 5 +- source/blender/python/generic/vector.c | 752 ++++++++++++------------- source/blender/python/generic/vector.h | 5 +- source/gameengine/Expressions/PyObjectPlus.cpp | 2 +- source/gameengine/Ketsji/KX_PyMath.cpp | 12 +- 12 files changed, 510 insertions(+), 554 deletions(-) (limited to 'source') diff --git a/source/blender/python/generic/Geometry.c b/source/blender/python/generic/Geometry.c index 8a748241570..b4a34d30051 100644 --- a/source/blender/python/generic/Geometry.c +++ b/source/blender/python/generic/Geometry.c @@ -273,7 +273,7 @@ static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args ) /*X of vert, Y of hoz. no calculation needed */ newvec[0]= a1x; newvec[1]= b1y; - return newVectorObject(newvec, 2, Py_NEW); + return newVectorObject(newvec, 2, Py_NEW, NULL); } yi = (float)(((b1y / fabs(b1x - b2x)) * fabs(b2x - a1x)) + ((b2y / fabs(b1x - b2x)) * fabs(b1x - a1x))); @@ -285,7 +285,7 @@ static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args ) } newvec[0]= a1x; newvec[1]= yi; - return newVectorObject(newvec, 2, Py_NEW); + return newVectorObject(newvec, 2, Py_NEW, NULL); } else if (fabs(a2y-a1y) < eul) { /* hoz line1 */ if (fabs(b2y-b1y) < eul) { /*hoz line2*/ Py_RETURN_NONE; /*2 hoz lines dont intersect*/ @@ -300,7 +300,7 @@ static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args ) } newvec[0]= xi; newvec[1]= a1y; - return newVectorObject(newvec, 2, Py_NEW); + return newVectorObject(newvec, 2, Py_NEW, NULL); } b1 = (a2y-a1y)/(a2x-a1x); @@ -317,7 +317,7 @@ static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args ) if ((a1x-xi)*(xi-a2x) >= 0 && (b1x-xi)*(xi-b2x) >= 0 && (a1y-yi)*(yi-a2y) >= 0 && (b1y-yi)*(yi-b2y)>=0) { newvec[0]= xi; newvec[1]= yi; - return newVectorObject(newvec, 2, Py_NEW); + return newVectorObject(newvec, 2, Py_NEW, NULL); } Py_RETURN_NONE; } @@ -355,7 +355,7 @@ static PyObject *M_Geometry_ClosestPointOnLine( PyObject * self, PyObject * args lambda = lambda_cp_line_ex(pt_in, l1, l2, pt_out); ret = PyTuple_New(2); - PyTuple_SET_ITEM( ret, 0, newVectorObject(pt_out, 3, Py_NEW) ); + PyTuple_SET_ITEM( ret, 0, newVectorObject(pt_out, 3, Py_NEW, NULL) ); PyTuple_SET_ITEM( ret, 1, PyFloat_FromDouble(lambda) ); return ret; } @@ -535,7 +535,7 @@ static PyObject *M_Geometry_BezierInterp( PyObject * self, PyObject * args ) list= PyList_New(resolu); fp= coord_array; for(i=0; iquat[3]*quat->quat[3]*vec->vec[2] - 2*quat->quat[0]*quat->quat[2]*vec->vec[0] - quat->quat[2]*quat->quat[2]*vec->vec[2] + 2*quat->quat[0]*quat->quat[1]*vec->vec[1] - quat->quat[1]*quat->quat[1]*vec->vec[2] + quat->quat[0]*quat->quat[0]*vec->vec[2]; - return newVectorObject(rot, 3, Py_NEW); + return newVectorObject(rot, 3, Py_NEW, NULL); } }else if(VectorObject_Check(arg1)){ vec = (VectorObject*)arg1; @@ -201,7 +201,7 @@ PyObject *quat_rotation(PyObject *arg1, PyObject *arg2) quat->quat[3]*quat->quat[3]*vec->vec[2] - 2*quat->quat[0]*quat->quat[2]*vec->vec[0] - quat->quat[2]*quat->quat[2]*vec->vec[2] + 2*quat->quat[0]*quat->quat[1]*vec->vec[1] - quat->quat[1]*quat->quat[1]*vec->vec[2] + quat->quat[0]*quat->quat[0]*vec->vec[2]; - return newVectorObject(rot, 3, Py_NEW); + return newVectorObject(rot, 3, Py_NEW, NULL); } } @@ -311,7 +311,7 @@ static PyObject *M_Mathutils_MidpointVecs(PyObject * self, PyObject * args) for(x = 0; x < vec1->size; x++) { vec[x] = 0.5f * (vec1->vec[x] + vec2->vec[x]); } - return newVectorObject(vec, vec1->size, Py_NEW); + return newVectorObject(vec, vec1->size, Py_NEW, NULL); } //----------------------------------Mathutils.ProjectVecs() ------------- //projects vector 1 onto vector 2 @@ -348,7 +348,7 @@ static PyObject *M_Mathutils_ProjectVecs(PyObject * self, PyObject * args) for(x = 0; x < size; x++) { vec[x] = (float)(dot * vec2->vec[x]); } - return newVectorObject(vec, size, Py_NEW); + return newVectorObject(vec, size, Py_NEW, NULL); } //----------------------------------MATRIX FUNCTIONS-------------------- //----------------------------------Mathutils.RotationMatrix() ---------- @@ -493,7 +493,7 @@ static PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args) mat[3] = 0.0f; } //pass to matrix creation - return newMatrixObject(mat, matSize, matSize, Py_NEW); + return newMatrixObject(mat, matSize, matSize, Py_NEW, NULL); } //----------------------------------Mathutils.TranslationMatrix() ------- //creates a translation matrix @@ -520,7 +520,7 @@ static PyObject *M_Mathutils_TranslationMatrix(PyObject * self, VectorObject * v mat[13] = vec->vec[1]; mat[14] = vec->vec[2]; - return newMatrixObject(mat, 4, 4, Py_NEW); + return newMatrixObject(mat, 4, 4, Py_NEW, NULL); } //----------------------------------Mathutils.ScaleMatrix() ------------- //mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. @@ -598,7 +598,7 @@ static PyObject *M_Mathutils_ScaleMatrix(PyObject * self, PyObject * args) mat[3] = 0.0f; } //pass to matrix creation - return newMatrixObject(mat, matSize, matSize, Py_NEW); + return newMatrixObject(mat, matSize, matSize, Py_NEW, NULL); } //----------------------------------Mathutils.OrthoProjectionMatrix() --- //mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. @@ -701,7 +701,7 @@ static PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * a mat[3] = 0.0f; } //pass to matrix creation - return newMatrixObject(mat, matSize, matSize, Py_NEW); + return newMatrixObject(mat, matSize, matSize, Py_NEW, NULL); } //----------------------------------Mathutils.ShearMatrix() ------------- //creates a shear matrix @@ -768,7 +768,7 @@ static PyObject *M_Mathutils_ShearMatrix(PyObject * self, PyObject * args) mat[3] = 0.0f; } //pass to matrix creation - return newMatrixObject(mat, matSize, matSize, Py_NEW); + return newMatrixObject(mat, matSize, matSize, Py_NEW, NULL); } //----------------------------------QUATERNION FUNCTIONS----------------- @@ -801,7 +801,7 @@ static PyObject *M_Mathutils_DifferenceQuats(PyObject * self, PyObject * args) tempQuat[x] /= (float)(dot * dot); } QuatMul(quat, tempQuat, quatV->quat); - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } //----------------------------------Mathutils.Slerp() ------------------ //attemps to interpolate 2 quaternions and return the result @@ -862,7 +862,7 @@ static PyObject *M_Mathutils_Slerp(PyObject * self, PyObject * args) quat[2] = (float)(quat_u[2] * x + quat_v[2] * y); quat[3] = (float)(quat_u[3] * x + quat_v[3] * y); - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } //----------------------------------EULER FUNCTIONS---------------------- //---------------------------------INTERSECTION FUNCTIONS-------------------- @@ -936,7 +936,7 @@ static PyObject *M_Mathutils_Intersect( PyObject * self, PyObject * args ) VecMulf(dir, t); VecAddf(pvec, orig, dir); - return newVectorObject(pvec, 3, Py_NEW); + return newVectorObject(pvec, 3, Py_NEW, NULL); } //----------------------------------Mathutils.LineIntersect() ------------------- /* Line-Line intersection using algorithm from mathworld.wolfram.com */ @@ -993,8 +993,8 @@ static PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args ) } else { tuple = PyTuple_New( 2 ); - PyTuple_SetItem( tuple, 0, newVectorObject(i1, vec1->size, Py_NEW) ); - PyTuple_SetItem( tuple, 1, newVectorObject(i2, vec1->size, Py_NEW) ); + PyTuple_SetItem( tuple, 0, newVectorObject(i1, vec1->size, Py_NEW, NULL) ); + PyTuple_SetItem( tuple, 1, newVectorObject(i2, vec1->size, Py_NEW, NULL) ); return tuple; } } @@ -1055,7 +1055,7 @@ static PyObject *M_Mathutils_QuadNormal( PyObject * self, PyObject * args ) VecAddf(n1, n2, n1); Normalize(n1); - return newVectorObject(n1, 3, Py_NEW); + return newVectorObject(n1, 3, Py_NEW, NULL); } //----------------------------Mathutils.TriangleNormal() ------------------- @@ -1091,7 +1091,7 @@ static PyObject *M_Mathutils_TriangleNormal( PyObject * self, PyObject * args ) Crossf(n, e2, e1); Normalize(n); - return newVectorObject(n, 3, Py_NEW); + return newVectorObject(n, 3, Py_NEW, NULL); } //--------------------------------- AREA FUNCTIONS-------------------- @@ -1254,6 +1254,6 @@ void BaseMathObject_dealloc(BaseMathObject * self) PyMem_Free(self->data); Py_XDECREF(self->cb_user); - PyObject_DEL(self); + Py_TYPE(self)->tp_free(self); // PyObject_DEL(self); // breaks subtypes } diff --git a/source/blender/python/generic/euler.c b/source/blender/python/generic/euler.c index 769c82ed034..1e0632f4040 100644 --- a/source/blender/python/generic/euler.c +++ b/source/blender/python/generic/euler.c @@ -34,13 +34,6 @@ //-------------------------DOC STRINGS --------------------------- -static char Euler_Zero_doc[] = "() - set all values in the euler to 0"; -static char Euler_Unique_doc[] ="() - sets the euler rotation a unique shortest arc rotation - tests for gimbal lock"; -static char Euler_ToMatrix_doc[] = "() - returns a rotation matrix representing the euler rotation"; -static char Euler_ToQuat_doc[] = "() - returns a quaternion representing the euler rotation"; -static char Euler_Rotate_doc[] = "() - rotate a euler by certain amount around an axis of rotation"; -static char Euler_copy_doc[] = "() - returns a copy of the euler."; -static char Euler_MakeCompatible_doc[] = "(euler) - Make this user compatible with another (no axis flipping)."; static PyObject *Euler_Zero( EulerObject * self ); static PyObject *Euler_Unique( EulerObject * self ); @@ -52,22 +45,21 @@ static PyObject *Euler_copy( EulerObject * self, PyObject *args ); //-----------------------METHOD DEFINITIONS ---------------------- static struct PyMethodDef Euler_methods[] = { - {"zero", (PyCFunction) Euler_Zero, METH_NOARGS, Euler_Zero_doc}, - {"unique", (PyCFunction) Euler_Unique, METH_NOARGS, Euler_Unique_doc}, - {"toMatrix", (PyCFunction) Euler_ToMatrix, METH_NOARGS, Euler_ToMatrix_doc}, - {"toQuat", (PyCFunction) Euler_ToQuat, METH_NOARGS, Euler_ToQuat_doc}, - {"rotate", (PyCFunction) Euler_Rotate, METH_VARARGS, Euler_Rotate_doc}, - {"makeCompatible", (PyCFunction) Euler_MakeCompatible, METH_O, Euler_MakeCompatible_doc}, - {"__copy__", (PyCFunction) Euler_copy, METH_VARARGS, Euler_copy_doc}, - {"copy", (PyCFunction) Euler_copy, METH_VARARGS, Euler_copy_doc}, + {"zero", (PyCFunction) Euler_Zero, METH_NOARGS, NULL}, + {"unique", (PyCFunction) Euler_Unique, METH_NOARGS, NULL}, + {"toMatrix", (PyCFunction) Euler_ToMatrix, METH_NOARGS, NULL}, + {"toQuat", (PyCFunction) Euler_ToQuat, METH_NOARGS, NULL}, + {"rotate", (PyCFunction) Euler_Rotate, METH_VARARGS, NULL}, + {"makeCompatible", (PyCFunction) Euler_MakeCompatible, METH_O, NULL}, + {"__copy__", (PyCFunction) Euler_copy, METH_VARARGS, NULL}, + {"copy", (PyCFunction) Euler_copy, METH_VARARGS, NULL}, {NULL, NULL, 0, NULL} }; //----------------------------------Mathutils.Euler() ------------------- //makes a new euler for you to play with -static PyObject *Euler_new(PyObject * self, PyObject * args, PyObject * kwargs) +static PyObject *Euler_new(PyTypeObject * type, PyObject * args, PyObject * kwargs) { - PyObject *listObject = NULL; int size, i; float eul[3]; @@ -84,7 +76,7 @@ static PyObject *Euler_new(PyObject * self, PyObject * args, PyObject * kwargs) } } else if (size == 0) { //returns a new empty 3d euler - return newEulerObject(NULL, Py_NEW); + return newEulerObject(NULL, Py_NEW, NULL); } else { listObject = args; } @@ -110,7 +102,7 @@ static PyObject *Euler_new(PyObject * self, PyObject * args, PyObject * kwargs) return NULL; } } - return newEulerObject(eul, Py_NEW); + return newEulerObject(eul, Py_NEW, NULL); } //-----------------------------METHODS---------------------------- @@ -118,8 +110,11 @@ static PyObject *Euler_new(PyObject * self, PyObject * args, PyObject * kwargs) //return a quaternion representation of the euler static PyObject *Euler_ToQuat(EulerObject * self) { - float eul[3], quat[4]; + float quat[4]; +#ifdef USE_MATHUTILS_DEG + float eul[3]; int x; +#endif if(!BaseMath_ReadCallback(self)) return NULL; @@ -133,7 +128,7 @@ static PyObject *Euler_ToQuat(EulerObject * self) EulToQuat(self->eul, quat); #endif - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } //----------------------------Euler.toMatrix()--------------------- //return a matrix representation of the euler @@ -154,16 +149,17 @@ static PyObject *Euler_ToMatrix(EulerObject * self) #else EulToMat3(self->eul, (float (*)[3]) mat); #endif - return newMatrixObject(mat, 3, 3 , Py_NEW); + return newMatrixObject(mat, 3, 3 , Py_NEW, NULL); } //----------------------------Euler.unique()----------------------- //sets the x,y,z values to a unique euler rotation static PyObject *Euler_Unique(EulerObject * self) { +#define PI_2 (Py_PI * 2.0) +#define PI_HALF (Py_PI / 2.0) +#define PI_INV (1.0 / Py_PI) + double heading, pitch, bank; - double pi2 = Py_PI * 2.0f; - double piO2 = Py_PI / 2.0f; - double Opi2 = 1.0f / pi2; if(!BaseMath_ReadCallback(self)) return NULL; @@ -179,34 +175,33 @@ static PyObject *Euler_Unique(EulerObject * self) bank = self->eul[2]; #endif - //wrap heading in +180 / -180 pitch += Py_PI; - pitch -= floor(pitch * Opi2) * pi2; + pitch -= floor(pitch * PI_INV) * PI_2; pitch -= Py_PI; - if(pitch < -piO2) { + if(pitch < -PI_HALF) { pitch = -Py_PI - pitch; heading += Py_PI; bank += Py_PI; - } else if(pitch > piO2) { + } else if(pitch > PI_HALF) { pitch = Py_PI - pitch; heading += Py_PI; bank += Py_PI; } //gimbal lock test - if(fabs(pitch) > piO2 - 1e-4) { + if(fabs(pitch) > PI_HALF - 1e-4) { heading += bank; bank = 0.0f; } else { bank += Py_PI; - bank -= (floor(bank * Opi2)) * pi2; + bank -= (floor(bank * PI_INV)) * PI_2; bank -= Py_PI; } heading += Py_PI; - heading -= (floor(heading * Opi2)) * pi2; + heading -= (floor(heading * PI_INV)) * PI_2; heading -= Py_PI; #ifdef USE_MATHUTILS_DEG @@ -318,7 +313,7 @@ static PyObject *Euler_copy(EulerObject * self, PyObject *args) if(!BaseMath_ReadCallback(self)) return NULL; - return newEulerObject(self->eul, Py_NEW); + return newEulerObject(self->eul, Py_NEW, Py_TYPE(self)); } //----------------------------print object (internal)-------------- @@ -383,8 +378,7 @@ static PyObject* Euler_richcmpr(PyObject *objectA, PyObject *objectB, int compar Py_RETURN_FALSE; } } -//------------------------tp_doc -static char EulerObject_doc[] = "This is a wrapper for euler objects."; + //---------------------SEQUENCE PROTOCOLS------------------------ //----------------------------len(object)------------------------ //sequence length @@ -569,8 +563,8 @@ PyTypeObject euler_Type = { 0, //tp_getattro 0, //tp_setattro 0, //tp_as_buffer - Py_TPFLAGS_DEFAULT, //tp_flags - EulerObject_doc, //tp_doc + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, //tp_flags + 0, //tp_doc 0, //tp_traverse 0, //tp_clear (richcmpfunc)Euler_richcmpr, //tp_richcompare @@ -603,12 +597,13 @@ PyTypeObject euler_Type = { (i.e. it was allocated elsewhere by MEM_mallocN()) pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON (i.e. it must be created here with PyMEM_malloc())*/ -PyObject *newEulerObject(float *eul, int type) +PyObject *newEulerObject(float *eul, int type, PyTypeObject *base_type) { EulerObject *self; int x; - self = PyObject_NEW(EulerObject, &euler_Type); + if(base_type) self = base_type->tp_alloc(base_type, 0); + else self = PyObject_NEW(EulerObject, &euler_Type); /* init callbacks as NULL */ self->cb_user= NULL; @@ -635,7 +630,7 @@ PyObject *newEulerObject(float *eul, int type) PyObject *newEulerObject_cb(PyObject *cb_user, int cb_type, int cb_subtype) { - EulerObject *self= (EulerObject *)newEulerObject(NULL, Py_NEW); + EulerObject *self= (EulerObject *)newEulerObject(NULL, Py_NEW, NULL); if(self) { Py_INCREF(cb_user); self->cb_user= cb_user; diff --git a/source/blender/python/generic/euler.h b/source/blender/python/generic/euler.h index 0bff6de6964..a3706d53756 100644 --- a/source/blender/python/generic/euler.h +++ b/source/blender/python/generic/euler.h @@ -35,8 +35,7 @@ #include "../intern/bpy_compat.h" extern PyTypeObject euler_Type; - -#define EulerObject_Check(v) (Py_TYPE(v) == &euler_Type) +#define EulerObject_Check(_v) PyObject_TypeCheck((_v), &euler_Type) typedef struct { PyObject_VAR_HEAD @@ -55,7 +54,7 @@ be stored in py_data) or be a wrapper for data allocated through blender (stored in blend_data). This is an either/or struct not both*/ //prototypes -PyObject *newEulerObject( float *eul, int type ); +PyObject *newEulerObject( float *eul, int type, PyTypeObject *base_type); PyObject *newEulerObject_cb(PyObject *cb_user, int cb_type, int cb_subtype); #endif /* EXPP_euler_h */ diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c index 311a14fbb0a..41411559fe0 100644 --- a/source/blender/python/generic/matrix.c +++ b/source/blender/python/generic/matrix.c @@ -97,18 +97,6 @@ Mathutils_Callback mathutils_matrix_vector_cb = { /* matrix vector callbacks, this is so you can do matrix[i][j] = val */ /*-------------------------DOC STRINGS ---------------------------*/ -static char Matrix_Zero_doc[] = "() - set all values in the matrix to 0"; -static char Matrix_Identity_doc[] = "() - set the square matrix to it's identity matrix"; -static char Matrix_Transpose_doc[] = "() - set the matrix to it's transpose"; -static char Matrix_Determinant_doc[] = "() - return the determinant of the matrix"; -static char Matrix_Invert_doc[] = "() - set the matrix to it's inverse if an inverse is possible"; -static char Matrix_TranslationPart_doc[] = "() - return a vector encompassing the translation of the matrix"; -static char Matrix_RotationPart_doc[] = "() - return a vector encompassing the rotation of the matrix"; -static char Matrix_scalePart_doc[] = "() - convert matrix to a 3D vector"; -static char Matrix_Resize4x4_doc[] = "() - resize the matrix to a 4x4 square matrix"; -static char Matrix_toEuler_doc[] = "(eul_compat) - convert matrix to a euler angle rotation, optional euler argument that the new euler will be made compatible with."; -static char Matrix_toQuat_doc[] = "() - convert matrix to a quaternion rotation"; -static char Matrix_copy_doc[] = "() - return a copy of the matrix"; static PyObject *Matrix_Zero( MatrixObject * self ); static PyObject *Matrix_Identity( MatrixObject * self ); @@ -125,19 +113,19 @@ static PyObject *Matrix_copy( MatrixObject * self ); /*-----------------------METHOD DEFINITIONS ----------------------*/ static struct PyMethodDef Matrix_methods[] = { - {"zero", (PyCFunction) Matrix_Zero, METH_NOARGS, Matrix_Zero_doc}, - {"identity", (PyCFunction) Matrix_Identity, METH_NOARGS, Matrix_Identity_doc}, - {"transpose", (PyCFunction) Matrix_Transpose, METH_NOARGS, Matrix_Transpose_doc}, - {"determinant", (PyCFunction) Matrix_Determinant, METH_NOARGS, Matrix_Determinant_doc}, - {"invert", (PyCFunction) Matrix_Invert, METH_NOARGS, Matrix_Invert_doc}, - {"translationPart", (PyCFunction) Matrix_TranslationPart, METH_NOARGS, Matrix_TranslationPart_doc}, - {"rotationPart", (PyCFunction) Matrix_RotationPart, METH_NOARGS, Matrix_RotationPart_doc}, - {"scalePart", (PyCFunction) Matrix_scalePart, METH_NOARGS, Matrix_scalePart_doc}, - {"resize4x4", (PyCFunction) Matrix_Resize4x4, METH_NOARGS, Matrix_Resize4x4_doc}, - {"toEuler", (PyCFunction) Matrix_toEuler, METH_VARARGS, Matrix_toEuler_doc}, - {"toQuat", (PyCFunction) Matrix_toQuat, METH_NOARGS, Matrix_toQuat_doc}, - {"copy", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc}, - {"__copy__", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc}, + {"zero", (PyCFunction) Matrix_Zero, METH_NOARGS, NULL}, + {"identity", (PyCFunction) Matrix_Identity, METH_NOARGS, NULL}, + {"transpose", (PyCFunction) Matrix_Transpose, METH_NOARGS, NULL}, + {"determinant", (PyCFunction) Matrix_Determinant, METH_NOARGS, NULL}, + {"invert", (PyCFunction) Matrix_Invert, METH_NOARGS, NULL}, + {"translationPart", (PyCFunction) Matrix_TranslationPart, METH_NOARGS, NULL}, + {"rotationPart", (PyCFunction) Matrix_RotationPart, METH_NOARGS, NULL}, + {"scalePart", (PyCFunction) Matrix_scalePart, METH_NOARGS, NULL}, + {"resize4x4", (PyCFunction) Matrix_Resize4x4, METH_NOARGS, NULL}, + {"toEuler", (PyCFunction) Matrix_toEuler, METH_VARARGS, NULL}, + {"toQuat", (PyCFunction) Matrix_toQuat, METH_NOARGS, NULL}, + {"copy", (PyCFunction) Matrix_copy, METH_NOARGS, NULL}, + {"__copy__", (PyCFunction) Matrix_copy, METH_NOARGS, NULL}, {NULL, NULL, 0, NULL} }; @@ -158,7 +146,7 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) PyErr_SetString(PyExc_AttributeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); return NULL; } else if (argSize == 0) { //return empty 4D matrix - return (PyObject *) newMatrixObject(NULL, 4, 4, Py_NEW); + return (PyObject *) newMatrixObject(NULL, 4, 4, Py_NEW, NULL); }else if (argSize == 1){ //copy constructor for matrix objects argObject = PyTuple_GET_ITEM(args, 0); @@ -167,11 +155,7 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) if(!BaseMath_ReadCallback(mat)) return NULL; - argSize = mat->rowSize; //rows - seqSize = mat->colSize; //col - for(i = 0; i < (seqSize * argSize); i++){ - matrix[i] = mat->contigPtr[i]; - } + memcpy(matrix, mat->contigPtr, sizeof(float) * mat->rowSize * mat->colSize); } }else{ //2-4 arguments (all seqs? all same size?) for(i =0; i < argSize; i++){ @@ -216,7 +200,7 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) } } } - return newMatrixObject(matrix, argSize, seqSize, Py_NEW); + return newMatrixObject(matrix, argSize, seqSize, Py_NEW, NULL); } /*-----------------------------METHODS----------------------------*/ @@ -239,14 +223,16 @@ static PyObject *Matrix_toQuat(MatrixObject * self) Mat4ToQuat((float (*)[4])*self->matrix, quat); } - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } /*---------------------------Matrix.toEuler() --------------------*/ PyObject *Matrix_toEuler(MatrixObject * self, PyObject *args) { float eul[3], eul_compatf[3]; EulerObject *eul_compat = NULL; +#ifdef USE_MATHUTILS_DEG int x; +#endif if(!BaseMath_ReadCallback(self)) return NULL; @@ -288,7 +274,7 @@ PyObject *Matrix_toEuler(MatrixObject * self, PyObject *args) eul[x] *= (float) (180 / Py_PI); } #endif - return newEulerObject(eul, Py_NEW); + return newEulerObject(eul, Py_NEW, NULL); } /*---------------------------Matrix.resize4x4() ------------------*/ PyObject *Matrix_Resize4x4(MatrixObject * self) @@ -364,7 +350,7 @@ PyObject *Matrix_TranslationPart(MatrixObject * self) vec[1] = self->matrix[3][1]; vec[2] = self->matrix[3][2]; - return newVectorObject(vec, 3, Py_NEW); + return newVectorObject(vec, 3, Py_NEW, NULL); } /*---------------------------Matrix.rotationPart() ---------------*/ PyObject *Matrix_RotationPart(MatrixObject * self) @@ -390,7 +376,7 @@ PyObject *Matrix_RotationPart(MatrixObject * self) mat[7] = self->matrix[2][1]; mat[8] = self->matrix[2][2]; - return newMatrixObject(mat, 3, 3, Py_NEW); + return newMatrixObject(mat, 3, 3, Py_NEW, Py_TYPE(self)); } /*---------------------------Matrix.scalePart() --------------------*/ PyObject *Matrix_scalePart(MatrixObject * self) @@ -419,7 +405,7 @@ PyObject *Matrix_scalePart(MatrixObject * self) scale[0]= tmat[0][0]; scale[1]= tmat[1][1]; scale[2]= tmat[2][2]; - return newVectorObject(scale, 3, Py_NEW); + return newVectorObject(scale, 3, Py_NEW, NULL); } /*---------------------------Matrix.invert() ---------------------*/ PyObject *Matrix_Invert(MatrixObject * self) @@ -589,7 +575,7 @@ PyObject *Matrix_copy(MatrixObject * self) if(!BaseMath_ReadCallback(self)) return NULL; - return (PyObject*)(MatrixObject*)newMatrixObject((float (*))*self->matrix, self->rowSize, self->colSize, Py_NEW); + return (PyObject*)newMatrixObject((float (*))*self->matrix, self->rowSize, self->colSize, Py_NEW, Py_TYPE(self)); } /*----------------------------print object (internal)-------------*/ @@ -674,8 +660,7 @@ static PyObject* Matrix_richcmpr(PyObject *objectA, PyObject *objectB, int compa Py_RETURN_FALSE; } } -/*------------------------tp_doc*/ -static char MatrixObject_doc[] = "This is a wrapper for matrix objects."; + /*---------------------SEQUENCE PROTOCOLS------------------------ ----------------------------len(object)------------------------ sequence length*/ @@ -882,7 +867,7 @@ static PyObject *Matrix_add(PyObject * m1, PyObject * m2) } } - return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW); + return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW, NULL); } /*------------------------obj - obj------------------------------ subtraction*/ @@ -915,7 +900,7 @@ static PyObject *Matrix_sub(PyObject * m1, PyObject * m2) } } - return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW); + return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW, NULL); } /*------------------------obj * obj------------------------------ mulplication*/ @@ -954,7 +939,7 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) } } - return newMatrixObject(mat, mat1->rowSize, mat2->colSize, Py_NEW); + return newMatrixObject(mat, mat1->rowSize, mat2->colSize, Py_NEW, NULL); } if(mat1==NULL){ @@ -965,7 +950,7 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) mat[((x * mat2->colSize) + y)] = scalar * mat2->matrix[x][y]; } } - return newMatrixObject(mat, mat2->rowSize, mat2->colSize, Py_NEW); + return newMatrixObject(mat, mat2->rowSize, mat2->colSize, Py_NEW, NULL); } PyErr_SetString(PyExc_TypeError, "Matrix multiplication: arguments not acceptable for this operation"); @@ -984,7 +969,7 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) mat[((x * mat1->colSize) + y)] = scalar * mat1->matrix[x][y]; } } - return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW); + return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW, NULL); } } PyErr_SetString(PyExc_TypeError, "Matrix multiplication: arguments not acceptable for this operation"); @@ -1128,8 +1113,8 @@ PyTypeObject matrix_Type = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT, /*tp_flags*/ - MatrixObject_doc, /*tp_doc*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ (richcmpfunc)Matrix_richcmpr, /*tp_richcompare*/ @@ -1173,7 +1158,7 @@ self->matrix[1][1] = self->contigPtr[4] */ (i.e. it was allocated elsewhere by MEM_mallocN()) pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON (i.e. it must be created here with PyMEM_malloc())*/ -PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type) +PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type, PyTypeObject *base_type) { MatrixObject *self; int x, row, col; @@ -1184,7 +1169,9 @@ PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type) return NULL; } - self = PyObject_NEW(MatrixObject, &matrix_Type); + if(base_type) self = (MatrixObject *)base_type->tp_alloc(base_type, 0); + else self = PyObject_NEW(MatrixObject, &matrix_Type); + self->rowSize = rowSize; self->colSize = colSize; @@ -1242,7 +1229,7 @@ PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type) PyObject *newMatrixObject_cb(PyObject *cb_user, int rowSize, int colSize, int cb_type, int cb_subtype) { - MatrixObject *self= (MatrixObject *)newMatrixObject(NULL, rowSize, colSize, Py_NEW); + MatrixObject *self= (MatrixObject *)newMatrixObject(NULL, rowSize, colSize, Py_NEW, NULL); if(self) { Py_INCREF(cb_user); self->cb_user= cb_user; @@ -1287,5 +1274,5 @@ static PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vecNew[z++] = (float)dot; dot = 0.0f; } - return newVectorObject(vecNew, vec->size, Py_NEW); + return newVectorObject(vecNew, vec->size, Py_NEW, NULL); } diff --git a/source/blender/python/generic/matrix.h b/source/blender/python/generic/matrix.h index 4b073668969..856c711c4ef 100644 --- a/source/blender/python/generic/matrix.h +++ b/source/blender/python/generic/matrix.h @@ -33,8 +33,7 @@ #include extern PyTypeObject matrix_Type; - -#define MatrixObject_Check(v) ((v)->ob_type == &matrix_Type) +#define MatrixObject_Check(_v) PyObject_TypeCheck((_v), &matrix_Type) typedef float **ptRow; typedef struct _Matrix { /* keep aligned with BaseMathObject in Mathutils.h */ @@ -58,7 +57,7 @@ be stored in py_data) or be a wrapper for data allocated through blender (stored in blend_data). This is an either/or struct not both*/ /*prototypes*/ -PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type); +PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type, PyTypeObject *base_type); PyObject *newMatrixObject_cb(PyObject *user, int rowSize, int colSize, int cb_type, int cb_subtype); extern int mathutils_matrix_vector_cb_index; diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c index 7cd3cf738dd..81d69834469 100644 --- a/source/blender/python/generic/quat.c +++ b/source/blender/python/generic/quat.c @@ -34,16 +34,6 @@ //-------------------------DOC STRINGS --------------------------- -static char Quaternion_Identity_doc[] = "() - set the quaternion to it's identity (1, vector)"; -static char Quaternion_Negate_doc[] = "() - set all values in the quaternion to their negative"; -static char Quaternion_Conjugate_doc[] = "() - set the quaternion to it's conjugate"; -static char Quaternion_Inverse_doc[] = "() - set the quaternion to it's inverse"; -static char Quaternion_Normalize_doc[] = "() - normalize the vector portion of the quaternion"; -static char Quaternion_ToEuler_doc[] = "(eul_compat) - return a euler rotation representing the quaternion, optional euler argument that the new euler will be made compatible with."; -static char Quaternion_ToMatrix_doc[] = "() - return a rotation matrix representing the quaternion"; -static char Quaternion_Cross_doc[] = "(other) - return the cross product between this quaternion and another"; -static char Quaternion_Dot_doc[] = "(other) - return the dot product between this quaternion and another"; -static char Quaternion_copy_doc[] = "() - return a copy of the quat"; static PyObject *Quaternion_Identity( QuaternionObject * self ); static PyObject *Quaternion_Negate( QuaternionObject * self ); @@ -58,17 +48,17 @@ static PyObject *Quaternion_copy( QuaternionObject * self ); //-----------------------METHOD DEFINITIONS ---------------------- static struct PyMethodDef Quaternion_methods[] = { - {"identity", (PyCFunction) Quaternion_Identity, METH_NOARGS, Quaternion_Identity_doc}, - {"negate", (PyCFunction) Quaternion_Negate, METH_NOARGS, Quaternion_Negate_doc}, - {"conjugate", (PyCFunction) Quaternion_Conjugate, METH_NOARGS, Quaternion_Conjugate_doc}, - {"inverse", (PyCFunction) Quaternion_Inverse, METH_NOARGS, Quaternion_Inverse_doc}, - {"normalize", (PyCFunction) Quaternion_Normalize, METH_NOARGS, Quaternion_Normalize_doc}, - {"toEuler", (PyCFunction) Quaternion_ToEuler, METH_VARARGS, Quaternion_ToEuler_doc}, - {"toMatrix", (PyCFunction) Quaternion_ToMatrix, METH_NOARGS, Quaternion_ToMatrix_doc}, - {"cross", (PyCFunction) Quaternion_Cross, METH_O, Quaternion_Cross_doc}, - {"dot", (PyCFunction) Quaternion_Dot, METH_O, Quaternion_Dot_doc}, - {"__copy__", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc}, - {"copy", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc}, + {"identity", (PyCFunction) Quaternion_Identity, METH_NOARGS, NULL}, + {"negate", (PyCFunction) Quaternion_Negate, METH_NOARGS, NULL}, + {"conjugate", (PyCFunction) Quaternion_Conjugate, METH_NOARGS, NULL}, + {"inverse", (PyCFunction) Quaternion_Inverse, METH_NOARGS, NULL}, + {"normalize", (PyCFunction) Quaternion_Normalize, METH_NOARGS, NULL}, + {"toEuler", (PyCFunction) Quaternion_ToEuler, METH_VARARGS, NULL}, + {"toMatrix", (PyCFunction) Quaternion_ToMatrix, METH_NOARGS, NULL}, + {"cross", (PyCFunction) Quaternion_Cross, METH_O, NULL}, + {"dot", (PyCFunction) Quaternion_Dot, METH_O, NULL}, + {"__copy__", (PyCFunction) Quaternion_copy, METH_NOARGS, NULL}, + {"copy", (PyCFunction) Quaternion_copy, METH_NOARGS, NULL}, {NULL, NULL, 0, NULL} }; @@ -127,7 +117,7 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw } } } else if (size == 0) { //returns a new empty quat - return newQuaternionObject(NULL, Py_NEW); + return newQuaternionObject(NULL, Py_NEW, NULL); } else { listObject = args; } @@ -167,7 +157,7 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw AxisAngleToQuat(quat, quat, angle); #endif - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } //-----------------------------METHODS------------------------------ @@ -211,7 +201,7 @@ static PyObject *Quaternion_ToEuler(QuaternionObject * self, PyObject *args) eul[x] *= (180 / (float)Py_PI); } #endif - return newEulerObject(eul, Py_NEW); + return newEulerObject(eul, Py_NEW, NULL); } //----------------------------Quaternion.toMatrix()------------------ //return the quat as a matrix @@ -223,7 +213,7 @@ static PyObject *Quaternion_ToMatrix(QuaternionObject * self) return NULL; QuatToMat3(self->quat, (float (*)[3]) mat); - return newMatrixObject(mat, 3, 3, Py_NEW); + return newMatrixObject(mat, 3, 3, Py_NEW, NULL); } //----------------------------Quaternion.cross(other)------------------ @@ -241,7 +231,7 @@ static PyObject *Quaternion_Cross(QuaternionObject * self, QuaternionObject * va return NULL; QuatMul(quat, self->quat, value->quat); - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } //----------------------------Quaternion.dot(other)------------------ @@ -331,7 +321,7 @@ static PyObject *Quaternion_copy(QuaternionObject * self) if(!BaseMath_ReadCallback(self)) return NULL; - return newQuaternionObject(self->quat, Py_NEW); + return newQuaternionObject(self->quat, Py_NEW, Py_TYPE(self)); } //----------------------------print object (internal)-------------- @@ -394,8 +384,7 @@ static PyObject* Quaternion_richcmpr(PyObject *objectA, PyObject *objectB, int c Py_RETURN_FALSE; } } -//------------------------tp_doc -static char QuaternionObject_doc[] = "This is a wrapper for quaternion objects."; + //---------------------SEQUENCE PROTOCOLS------------------------ //----------------------------len(object)------------------------ //sequence length @@ -529,7 +518,7 @@ static PyObject *Quaternion_add(PyObject * q1, PyObject * q2) return NULL; QuatAdd(quat, quat1->quat, quat2->quat, 1.0f); - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } //------------------------obj - obj------------------------------ //subtraction @@ -554,7 +543,7 @@ static PyObject *Quaternion_sub(PyObject * q1, PyObject * q2) quat[x] = quat1->quat[x] - quat2->quat[x]; } - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } //------------------------obj * obj------------------------------ //mulplication @@ -585,7 +574,7 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2) if ((scalar == -1.0 && PyErr_Occurred())==0) { /* FLOAT*QUAT */ QUATCOPY(quat, quat2->quat); QuatMulf(quat, scalar); - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: val * quat, val is not an acceptable type"); return NULL; @@ -604,7 +593,7 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2) if ((scalar == -1.0 && PyErr_Occurred())==0) { /* QUAT*FLOAT */ QUATCOPY(quat, quat1->quat); QuatMulf(quat, scalar); - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } } @@ -730,7 +719,7 @@ static PyObject *Quaternion_getAxisVec( QuaternionObject * self, void *type ) EXPP_FloatsAreEqual(vec[2], 0.0f, 10) ){ vec[0] = 1.0f; } - return (PyObject *) newVectorObject(vec, 3, Py_NEW); + return (PyObject *) newVectorObject(vec, 3, Py_NEW, NULL); } @@ -806,8 +795,8 @@ PyTypeObject quaternion_Type = { 0, //tp_getattro 0, //tp_setattro 0, //tp_as_buffer - Py_TPFLAGS_DEFAULT, //tp_flags - QuaternionObject_doc, //tp_doc + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, //tp_flags + 0, //tp_doc 0, //tp_traverse 0, //tp_clear (richcmpfunc)Quaternion_richcmpr, //tp_richcompare @@ -840,11 +829,12 @@ PyTypeObject quaternion_Type = { (i.e. it was allocated elsewhere by MEM_mallocN()) pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON (i.e. it must be created here with PyMEM_malloc())*/ -PyObject *newQuaternionObject(float *quat, int type) +PyObject *newQuaternionObject(float *quat, int type, PyTypeObject *base_type) { QuaternionObject *self; - self = PyObject_NEW(QuaternionObject, &quaternion_Type); + if(base_type) self = base_type->tp_alloc(base_type, 0); + else self = PyObject_NEW(QuaternionObject, &quaternion_Type); /* init callbacks as NULL */ self->cb_user= NULL; @@ -869,7 +859,7 @@ PyObject *newQuaternionObject(float *quat, int type) PyObject *newQuaternionObject_cb(PyObject *cb_user, int cb_type, int cb_subtype) { - QuaternionObject *self= (QuaternionObject *)newQuaternionObject(NULL, Py_NEW); + QuaternionObject *self= (QuaternionObject *)newQuaternionObject(NULL, Py_NEW, NULL); if(self) { Py_INCREF(cb_user); self->cb_user= cb_user; diff --git a/source/blender/python/generic/quat.h b/source/blender/python/generic/quat.h index 2e74b5fa7f9..a7cfb7898b1 100644 --- a/source/blender/python/generic/quat.h +++ b/source/blender/python/generic/quat.h @@ -35,8 +35,7 @@ #include "../intern/bpy_compat.h" extern PyTypeObject quaternion_Type; - -#define QuaternionObject_Check(v) (Py_TYPE(v) == &quaternion_Type) +#define QuaternionObject_Check(_v) PyObject_TypeCheck((_v), &quaternion_Type) typedef struct { /* keep aligned with BaseMathObject in Mathutils.h */ PyObject_VAR_HEAD @@ -55,7 +54,7 @@ be stored in py_data) or be a wrapper for data allocated through blender (stored in blend_data). This is an either/or struct not both*/ //prototypes -PyObject *newQuaternionObject( float *quat, int type ); +PyObject *newQuaternionObject( float *quat, int type, PyTypeObject *base_type); PyObject *newQuaternionObject_cb(PyObject *cb_user, int cb_type, int cb_subtype); #endif /* EXPP_quat_h */ diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index d8d4c33b6f8..0af646bd82f 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -41,19 +41,6 @@ static PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat); /* utility func */ -/*-------------------------DOC STRINGS ---------------------------*/ -static char Vector_Zero_doc[] = "() - set all values in the vector to 0"; -static char Vector_Normalize_doc[] = "() - normalize the vector"; -static char Vector_Negate_doc[] = "() - changes vector to it's additive inverse"; -static char Vector_Resize2D_doc[] = "() - resize a vector to [x,y]"; -static char Vector_Resize3D_doc[] = "() - resize a vector to [x,y,z]"; -static char Vector_Resize4D_doc[] = "() - resize a vector to [x,y,z,w]"; -static char Vector_ToTrackQuat_doc[] = "(track, up) - extract a quaternion from the vector and the track and up axis"; -static char Vector_Reflect_doc[] = "(mirror) - return a vector reflected on the mirror normal"; -static char Vector_Cross_doc[] = "(other) - return the cross product between this vector and another"; -static char Vector_Dot_doc[] = "(other) - return the dot product between this vector and another"; -static char Vector_copy_doc[] = "() - return a copy of the vector"; -static char Vector_swizzle_doc[] = "Swizzle: Get or set axes in specified order"; /*-----------------------METHOD DEFINITIONS ----------------------*/ static PyObject *Vector_Zero( VectorObject * self ); static PyObject *Vector_Normalize( VectorObject * self ); @@ -68,18 +55,18 @@ static PyObject *Vector_Dot( VectorObject * self, VectorObject * value ); static PyObject *Vector_copy( VectorObject * self ); static struct PyMethodDef Vector_methods[] = { - {"zero", (PyCFunction) Vector_Zero, METH_NOARGS, Vector_Zero_doc}, - {"normalize", (PyCFunction) Vector_Normalize, METH_NOARGS, Vector_Normalize_doc}, - {"negate", (PyCFunction) Vector_Negate, METH_NOARGS, Vector_Negate_doc}, - {"resize2D", (PyCFunction) Vector_Resize2D, METH_NOARGS, Vector_Resize2D_doc}, - {"resize3D", (PyCFunction) Vector_Resize3D, METH_NOARGS, Vector_Resize3D_doc}, - {"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, Vector_Resize4D_doc}, - {"toTrackQuat", ( PyCFunction ) Vector_ToTrackQuat, METH_VARARGS, Vector_ToTrackQuat_doc}, - {"reflect", ( PyCFunction ) Vector_Reflect, METH_O, Vector_Reflect_doc}, - {"cross", ( PyCFunction ) Vector_Cross, METH_O, Vector_Dot_doc}, - {"dot", ( PyCFunction ) Vector_Dot, METH_O, Vector_Cross_doc}, - {"copy", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc}, - {"__copy__", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc}, + {"zero", (PyCFunction) Vector_Zero, METH_NOARGS, NULL}, + {"normalize", (PyCFunction) Vector_Normalize, METH_NOARGS, NULL}, + {"negate", (PyCFunction) Vector_Negate, METH_NOARGS, NULL}, + {"resize2D", (PyCFunction) Vector_Resize2D, METH_NOARGS, NULL}, + {"resize3D", (PyCFunction) Vector_Resize3D, METH_NOARGS, NULL}, + {"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, NULL}, + {"toTrackQuat", ( PyCFunction ) Vector_ToTrackQuat, METH_VARARGS, NULL}, + {"reflect", ( PyCFunction ) Vector_Reflect, METH_O, NULL}, + {"cross", ( PyCFunction ) Vector_Cross, METH_O, NULL}, + {"dot", ( PyCFunction ) Vector_Dot, METH_O, NULL}, + {"copy", (PyCFunction) Vector_copy, METH_NOARGS, NULL}, + {"__copy__", (PyCFunction) Vector_copy, METH_NOARGS, NULL}, {NULL, NULL, 0, NULL} }; @@ -104,7 +91,7 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds) } } else if (size == 0) { //returns a new empty 3d vector - return newVectorObject(NULL, 3, Py_NEW); + return newVectorObject(NULL, 3, Py_NEW, type); } else { listObject = args; } @@ -131,7 +118,7 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds) vec[i]= f; Py_DECREF(v); } - return newVectorObject(vec, size, Py_NEW); + return newVectorObject(vec, size, Py_NEW, type); } /*-----------------------------METHODS---------------------------- */ @@ -362,7 +349,7 @@ static PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) vectoquat(vec, track, up, quat); - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } /*----------------------------Vector.reflect(mirror) ---------------------- @@ -414,7 +401,7 @@ static PyObject *Vector_Reflect( VectorObject * self, VectorObject * value ) reflect[1] = (dot2 * mirror[1]) - vec[1]; reflect[2] = (dot2 * mirror[2]) - vec[2]; - return newVectorObject(reflect, self->size, Py_NEW); + return newVectorObject(reflect, self->size, Py_NEW, NULL); } static PyObject *Vector_Cross( VectorObject * self, VectorObject * value ) @@ -434,7 +421,7 @@ static PyObject *Vector_Cross( VectorObject * self, VectorObject * value ) if(!BaseMath_ReadCallback(self) || !BaseMath_ReadCallback(value)) return NULL; - vecCross = (VectorObject *)newVectorObject(NULL, 3, Py_NEW); + vecCross = (VectorObject *)newVectorObject(NULL, 3, Py_NEW, NULL); Crossf(vecCross->vec, self->vec, value->vec); return (PyObject *)vecCross; } @@ -470,7 +457,7 @@ static PyObject *Vector_copy(VectorObject * self) if(!BaseMath_ReadCallback(self)) return NULL; - return newVectorObject(self->vec, self->size, Py_NEW); + return newVectorObject(self->vec, self->size, Py_NEW, Py_TYPE(self)); } /*----------------------------print object (internal)------------- @@ -647,7 +634,7 @@ static PyObject *Vector_add(PyObject * v1, PyObject * v2) for(i = 0; i < vec1->size; i++) { vec[i] = vec1->vec[i] + vec2->vec[i]; } - return newVectorObject(vec, vec1->size, Py_NEW); + return newVectorObject(vec, vec1->size, Py_NEW, NULL); } PyErr_SetString(PyExc_AttributeError, "Vector addition: arguments not valid for this operation....\n"); @@ -717,7 +704,7 @@ static PyObject *Vector_sub(PyObject * v1, PyObject * v2) vec[i] = vec1->vec[i] - vec2->vec[i]; } - return newVectorObject(vec, vec1->size, Py_NEW); + return newVectorObject(vec, vec1->size, Py_NEW, NULL); } /*------------------------obj -= obj------------------------------ @@ -812,7 +799,7 @@ static PyObject *Vector_mul(PyObject * v1, PyObject * v2) for(i = 0; i < vec1->size; i++) { vec[i] = vec1->vec[i] * scalar; } - return newVectorObject(vec, vec1->size, Py_NEW); + return newVectorObject(vec, vec1->size, Py_NEW, NULL); } @@ -912,7 +899,7 @@ static PyObject *Vector_div(PyObject * v1, PyObject * v2) for(i = 0; i < vec1->size; i++) { vec[i] = vec1->vec[i] / scalar; } - return newVectorObject(vec, vec1->size, Py_NEW); + return newVectorObject(vec, vec1->size, Py_NEW, NULL); } /*------------------------obj /= obj------------------------------ @@ -960,11 +947,9 @@ static PyObject *Vector_neg(VectorObject *self) vec[i] = -self->vec[i]; } - return newVectorObject(vec, self->size, Py_NEW); + return newVectorObject(vec, self->size, Py_NEW, Py_TYPE(self)); } -/*------------------------tp_doc*/ -static char VectorObject_doc[] = "This is a wrapper for vector objects."; /*------------------------vec_magnitude_nosqrt (internal) - for comparing only */ static double vec_magnitude_nosqrt(float *data, int size) { @@ -1265,7 +1250,7 @@ static PyObject *Vector_getSwizzle(VectorObject * self, void *closure) axisA++; } - return newVectorObject(vec, axisA, Py_NEW); + return newVectorObject(vec, axisA, Py_NEW, Py_TYPE(self)); } /* Set the items of this vector using a swizzle. @@ -1413,342 +1398,342 @@ static PyGetSetDef Vector_getseters[] = { NULL}, /* autogenerated swizzle attrs, see python script below */ - {"xx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, Vector_swizzle_doc, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<tp_alloc(base_type, 0); + else self = PyObject_NEW(VectorObject, &vector_Type); if(size > 4 || size < 2) return NULL; @@ -1934,7 +1922,7 @@ PyObject *newVectorObject(float *vec, int size, int type) PyObject *newVectorObject_cb(PyObject *cb_user, int size, int cb_type, int cb_subtype) { float dummy[4] = {0.0, 0.0, 0.0, 0.0}; /* dummy init vector, callbacks will be used on access */ - VectorObject *self= (VectorObject *)newVectorObject(dummy, size, Py_NEW); + VectorObject *self= (VectorObject *)newVectorObject(dummy, size, Py_NEW, NULL); if(self) { Py_INCREF(cb_user); self->cb_user= cb_user; @@ -1981,7 +1969,7 @@ static PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat vecNew[z++] = (float)dot; dot = 0.0f; } - return newVectorObject(vecNew, vec_size, Py_NEW); + return newVectorObject(vecNew, vec_size, Py_NEW, NULL); } /*----------------------------Vector.negate() -------------------- diff --git a/source/blender/python/generic/vector.h b/source/blender/python/generic/vector.h index f519b2808cb..f6babac7ed9 100644 --- a/source/blender/python/generic/vector.h +++ b/source/blender/python/generic/vector.h @@ -34,8 +34,7 @@ #include "../intern/bpy_compat.h" extern PyTypeObject vector_Type; - -#define VectorObject_Check(v) (((PyObject *)v)->ob_type == &vector_Type) +#define VectorObject_Check(_v) PyObject_TypeCheck((_v), &vector_Type) typedef struct { /* keep aligned with BaseMathObject in Mathutils.h */ PyObject_VAR_HEAD @@ -50,7 +49,7 @@ typedef struct { /* keep aligned with BaseMathObject in Mathutils.h */ } VectorObject; /*prototypes*/ -PyObject *newVectorObject(float *vec, int size, int type); +PyObject *newVectorObject(float *vec, int size, int type, PyTypeObject *base_type); PyObject *newVectorObject_cb(PyObject *user, int size, int callback_type, int subtype); #endif /* EXPP_vector_h */ diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 475953749de..729fff31052 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -331,7 +331,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef * MT_Vector3 *val = reinterpret_cast(ptr); #ifdef USE_MATHUTILS float fval[3]= {(*val)[0], (*val)[1], (*val)[2]}; - return newVectorObject(fval, 3, Py_NEW); + return newVectorObject(fval, 3, Py_NEW, NULL); #else PyObject* resultlist = PyList_New(3); for (unsigned int i=0; i<3; i++) diff --git a/source/gameengine/Ketsji/KX_PyMath.cpp b/source/gameengine/Ketsji/KX_PyMath.cpp index 76cfb0e572d..6d33c38190c 100644 --- a/source/gameengine/Ketsji/KX_PyMath.cpp +++ b/source/gameengine/Ketsji/KX_PyMath.cpp @@ -99,7 +99,7 @@ PyObject* PyObjectFrom(const MT_Matrix4x4 &mat) #ifdef USE_MATHUTILS float fmat[16]; mat.getValue(fmat); - return newMatrixObject(fmat, 4, 4, Py_NEW); + return newMatrixObject(fmat, 4, 4, Py_NEW, NULL); #else PyObject *list = PyList_New(4); PyObject *sublist; @@ -123,7 +123,7 @@ PyObject* PyObjectFrom(const MT_Matrix3x3 &mat) #ifdef USE_MATHUTILS float fmat[9]; mat.getValue3x3(fmat); - return newMatrixObject(fmat, 3, 3, Py_NEW); + return newMatrixObject(fmat, 3, 3, Py_NEW, NULL); #else PyObject *list = PyList_New(3); PyObject *sublist; @@ -146,7 +146,7 @@ PyObject* PyObjectFrom(const MT_Quaternion &qrot) { /* NOTE, were re-ordering here for Mathutils compat */ float fvec[4]= {qrot[3], qrot[0], qrot[1], qrot[2]}; - return newQuaternionObject(fvec, Py_WRAP); + return newQuaternionObject(fvec, Py_WRAP, NULL); } #endif @@ -154,7 +154,7 @@ PyObject* PyObjectFrom(const MT_Tuple4 &vec) { #ifdef USE_MATHUTILS float fvec[4]= {vec[0], vec[1], vec[2], vec[3]}; - return newVectorObject(fvec, 4, Py_WRAP); + return newVectorObject(fvec, 4, Py_WRAP, NULL); #else PyObject *list = PyList_New(4); PyList_SET_ITEM(list, 0, PyFloat_FromDouble(vec[0])); @@ -169,7 +169,7 @@ PyObject* PyObjectFrom(const MT_Tuple3 &vec) { #ifdef USE_MATHUTILS float fvec[3]= {vec[0], vec[1], vec[2]}; - return newVectorObject(fvec, 3, Py_WRAP); + return newVectorObject(fvec, 3, Py_WRAP, NULL); #else PyObject *list = PyList_New(3); PyList_SET_ITEM(list, 0, PyFloat_FromDouble(vec[0])); @@ -183,7 +183,7 @@ PyObject* PyObjectFrom(const MT_Tuple2 &vec) { #ifdef USE_MATHUTILS float fvec[2]= {vec[0], vec[1]}; - return newVectorObject(fvec, 2, Py_WRAP); + return newVectorObject(fvec, 2, Py_WRAP, NULL); #else PyObject *list = PyList_New(2); PyList_SET_ITEM(list, 0, PyFloat_FromDouble(vec[0])); -- cgit v1.2.3 From 0c14be3b5820d7130a281e95da664753a0ff2793 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Tue, 30 Jun 2009 06:27:48 +0000 Subject: 2.5 file browser * adding GPL copyright header. --- source/blender/editors/space_file/file_panels.c | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'source') diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 560c509ddcb..a9a93d93de0 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -1,3 +1,31 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation, Andrea Weikert + * + * ***** END GPL LICENSE BLOCK ***** + */ + #include "BKE_context.h" #include "BKE_screen.h" -- cgit v1.2.3 From 30dcada24d1820e5aed4e1a671543e040918e910 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 30 Jun 2009 12:52:16 +0000 Subject: python access to RNA arrays. coords = array.array('f', [0.0]) * len(me.verts) * 3 m.verts.foreach_get('co', coords) the reverse works with set also. currently works for python buffers or sequences (slower) Quick speed test with 1,179,654 verts. *foreach_get* list 0.377 array 0.032 py 10.29 *foreach_set* list 0.184 array 0.028 py 9.79 where python was done like this... ---- i= 0 for v in m.verts: co = v.co l[i] = co[0]; l[i+1] = co[0]; l[i+2] = co[0] i+=3 ---- some of the error checking here needs to be cleaned up to account for different invalid bad inputs. --- source/blender/makesrna/RNA_access.h | 3 + source/blender/makesrna/intern/rna_access.c | 25 ++- source/blender/python/intern/bpy_rna.c | 252 +++++++++++++++++++++++++++- 3 files changed, 265 insertions(+), 15 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 3c205020ba7..d69439e25bc 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -606,6 +606,9 @@ int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, co int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, PropertyRNA *itemprop, RawArray *array); int RNA_property_collection_raw_get(struct ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, char *propname, void *array, RawPropertyType type, int len); int RNA_property_collection_raw_set(struct ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, char *propname, void *array, RawPropertyType type, int len); +int RNA_raw_type_sizeof(RawPropertyType type); +RawPropertyType RNA_property_raw_type(PropertyRNA *prop); + /* to create ID property groups */ void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index d3e4780c7fd..36adc9a7c10 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1580,6 +1580,17 @@ int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, Proper } \ } +int RNA_raw_type_sizeof(RawPropertyType type) +{ + switch(type) { + case PROP_RAW_CHAR: return sizeof(char); + case PROP_RAW_SHORT: return sizeof(short); + case PROP_RAW_INT: return sizeof(int); + case PROP_RAW_FLOAT: return sizeof(float); + case PROP_RAW_DOUBLE: return sizeof(double); + } +} + static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, char *propname, void *inarray, RawPropertyType intype, int inlen, int set) { StructRNA *ptype; @@ -1630,14 +1641,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro int a, size; itemlen= (itemlen == 0)? 1: itemlen; - - switch(out.type) { - case PROP_RAW_CHAR: size= sizeof(char)*itemlen; break; - case PROP_RAW_SHORT: size= sizeof(short)*itemlen; break; - case PROP_RAW_INT: size= sizeof(int)*itemlen; break; - case PROP_RAW_FLOAT: size= sizeof(float)*itemlen; break; - case PROP_RAW_DOUBLE: size= sizeof(double)*itemlen; break; - } + size= RNA_raw_type_sizeof(out.type) * itemlen; for(a=0; arawtype; +} + int RNA_property_collection_raw_get(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, char *propname, void *array, RawPropertyType type, int len) { return rna_raw_access(reports, ptr, prop, propname, array, type, len, 0); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index f07c85f7083..53f7f532b8b 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1130,7 +1130,7 @@ static int pyrna_struct_setattro( BPy_StructRNA * self, PyObject *pyname, PyObje return pyrna_py_to_prop(&self->ptr, prop, NULL, value); } -PyObject *pyrna_prop_keys(BPy_PropertyRNA *self) +static PyObject *pyrna_prop_keys(BPy_PropertyRNA *self) { PyObject *ret; if (RNA_property_type(self->prop) != PROP_COLLECTION) { @@ -1162,7 +1162,7 @@ PyObject *pyrna_prop_keys(BPy_PropertyRNA *self) return ret; } -PyObject *pyrna_prop_items(BPy_PropertyRNA *self) +static PyObject *pyrna_prop_items(BPy_PropertyRNA *self) { PyObject *ret; if (RNA_property_type(self->prop) != PROP_COLLECTION) { @@ -1203,7 +1203,7 @@ PyObject *pyrna_prop_items(BPy_PropertyRNA *self) } -PyObject *pyrna_prop_values(BPy_PropertyRNA *self) +static PyObject *pyrna_prop_values(BPy_PropertyRNA *self) { PyObject *ret; @@ -1225,6 +1225,240 @@ PyObject *pyrna_prop_values(BPy_PropertyRNA *self) return ret; } +static void foreach_attr_type( BPy_PropertyRNA *self, char *attr, + /* values to assign */ + RawPropertyType *raw_type, int *attr_tot, int *attr_signed ) +{ + PropertyRNA *prop; + *raw_type= -1; + *attr_tot= 0; + *attr_signed= 0; + + RNA_PROP_BEGIN(&self->ptr, itemptr, self->prop) { + prop = RNA_struct_find_property(&itemptr, attr); + *raw_type= RNA_property_raw_type(prop); + *attr_tot = RNA_property_array_length(prop); + *attr_signed= (RNA_property_subtype(prop)==PROP_UNSIGNED) ? 0:1; + break; + } + RNA_PROP_END; +} + +/* pyrna_prop_foreach_get/set both use this */ +static int foreach_parse_args( + BPy_PropertyRNA *self, PyObject *args, + + /*values to assign */ + char **attr, PyObject **seq, int *tot, int *size, RawPropertyType *raw_type, int *attr_tot, int *attr_signed) +{ + int array_tot; + int target_tot; + + *size= *raw_type= *attr_tot= *attr_signed= 0; + + if(!PyArg_ParseTuple(args, "sO", attr, seq) || (!PySequence_Check(*seq) && PyObject_CheckBuffer(*seq))) { + PyErr_SetString( PyExc_TypeError, "foreach_get(attr, sequence) expects a string and a sequence" ); + return -1; + } + + *tot= PySequence_Length(*seq); // TODO - buffer may not be a sequence! array.array() is tho. + + if(*tot>0) { + foreach_attr_type(self, *attr, raw_type, attr_tot, attr_signed); + *size= RNA_raw_type_sizeof(*raw_type); + +#if 0 // works fine but not strictly needed, we could allow RNA_property_collection_raw_* to do the checks + if((*attr_tot) < 1) + *attr_tot= 1; + + if (RNA_property_type(self->prop) == PROP_COLLECTION) + array_tot = RNA_property_collection_length(&self->ptr, self->prop); + else + array_tot = RNA_property_array_length(self->prop); + + + target_tot= array_tot * (*attr_tot); + + /* rna_access.c - rna_raw_access(...) uses this same method */ + if(target_tot != (*tot)) { + PyErr_Format( PyExc_TypeError, "foreach_get(attr, sequence) sequence length mismatch given %d, needed %d", *tot, target_tot); + return -1; + } +#endif + } + + return 0; +} + +static int foreach_compat_buffer(RawPropertyType raw_type, int attr_signed, const char *format) +{ + char f = format ? *format:'B'; /* B is assumed when not set */ + + switch(raw_type) { + case PROP_RAW_CHAR: + if (attr_signed) return (f=='b') ? 1:0; + else return (f=='B') ? 1:0; + case PROP_RAW_SHORT: + if (attr_signed) return (f=='h') ? 1:0; + else return (f=='H') ? 1:0; + case PROP_RAW_INT: + if (attr_signed) return (f=='i') ? 1:0; + else return (f=='I') ? 1:0; + case PROP_RAW_FLOAT: + return (f=='f') ? 1:0; + case PROP_RAW_DOUBLE: + return (f=='d') ? 1:0; + } + + return 0; +} + +static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set) +{ + PyObject *item; + int i=0, ok, buffer_is_compat; + void *array= NULL; + + /* get/set both take the same args currently */ + char *attr; + PyObject *seq; + int tot, size, attr_tot, attr_signed; + RawPropertyType raw_type; + + if(foreach_parse_args(self, args, &attr, &seq, &tot, &size, &raw_type, &attr_tot, &attr_signed) < 0) + return NULL; + + if(tot==0) + Py_RETURN_NONE; + + + + if(set) { /* get the array from python */ + buffer_is_compat = 0; + if(PyObject_CheckBuffer(seq)) { + Py_buffer buf; + PyObject_GetBuffer(seq, &buf, PyBUF_SIMPLE | PyBUF_FORMAT); + + /* check if the buffer matches, TODO - signed/unsigned types */ + + buffer_is_compat = foreach_compat_buffer(raw_type, attr_signed, buf.format); + + if(buffer_is_compat) { + ok = RNA_property_collection_raw_set(NULL, &self->ptr, self->prop, attr, buf.buf, raw_type, tot); + } + + PyBuffer_Release(&buf); + } + + /* could not use the buffer, fallback to sequence */ + if(!buffer_is_compat) { + array= PyMem_Malloc(size * tot); + + for( ; iptr, self->prop, attr, array, raw_type, tot); + } + } + else { + buffer_is_compat = 0; + if(PyObject_CheckBuffer(seq)) { + Py_buffer buf; + PyObject_GetBuffer(seq, &buf, PyBUF_SIMPLE | PyBUF_FORMAT); + + /* check if the buffer matches, TODO - signed/unsigned types */ + + buffer_is_compat = foreach_compat_buffer(raw_type, attr_signed, buf.format); + + if(buffer_is_compat) { + ok = RNA_property_collection_raw_get(NULL, &self->ptr, self->prop, attr, buf.buf, raw_type, tot); + } + + PyBuffer_Release(&buf); + } + + /* could not use the buffer, fallback to sequence */ + if(!buffer_is_compat) { + array= PyMem_Malloc(size * tot); + + ok = RNA_property_collection_raw_get(NULL, &self->ptr, self->prop, attr, array, raw_type, tot); + + if(!ok) i= tot; /* skip the loop */ + + for( ; i Date: Tue, 30 Jun 2009 18:29:30 +0000 Subject: 2.5 filebrowser * Hide dot operator (HKEY) for theeth --- source/blender/editors/space_file/file_intern.h | 1 + source/blender/editors/space_file/file_ops.c | 27 +++++++++++++++++++++++++ source/blender/editors/space_file/space_file.c | 4 +++- 3 files changed, 31 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index fd37bb75685..668e14c95e6 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -60,6 +60,7 @@ void FILE_OT_select_border(struct wmOperatorType *ot); void FILE_OT_select_bookmark(struct wmOperatorType *ot); void FILE_OT_add_bookmark(struct wmOperatorType *ot); void FILE_OT_delete_bookmark(struct wmOperatorType *ot); +void FILE_OT_hidedot(struct wmOperatorType *ot); void FILE_OT_loadimages(struct wmOperatorType *ot); void FILE_OT_exec(struct wmOperatorType *ot); void FILE_OT_cancel(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 3e24f360e40..aaa1793efbb 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -606,6 +606,33 @@ void FILE_OT_refresh(struct wmOperatorType *ot) ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ } +int file_hidedot_exec(bContext *C, wmOperator *unused) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + + if(sfile->params) { + sfile->params->flag ^= FILE_HIDE_DOT; + filelist_free(sfile->files); + sfile->params->active_file = -1; + WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + } + + return OPERATOR_FINISHED; + +} + + +void FILE_OT_hidedot(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Toggle Hide Dot Files"; + ot->idname= "FILE_OT_hidedot"; + + /* api callbacks */ + ot->exec= file_hidedot_exec; + ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ +} + struct ARegion *file_buttons_region(struct ScrArea *sa) { ARegion *ar, *arnew; diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 3824c23cb48..156c7d6f9be 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -294,6 +294,7 @@ void file_operatortypes(void) WM_operatortype_append(FILE_OT_bookmark_toggle); WM_operatortype_append(FILE_OT_add_bookmark); WM_operatortype_append(FILE_OT_delete_bookmark); + WM_operatortype_append(FILE_OT_hidedot); } /* NOTE: do not add .blend file reading on this level */ @@ -307,8 +308,9 @@ void file_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "FILE_OT_highlight", MOUSEMOVE, KM_ANY, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_parent", PKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_add_bookmark", BKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "FILE_OT_hidedot", HKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_loadimages", TIMER1, KM_ANY, KM_ANY, 0); - + keymap= WM_keymap_listbase(wm, "FileBookmark", SPACE_FILE, 0); WM_keymap_add_item(keymap, "FILE_OT_select_bookmark", LEFTMOUSE, KM_PRESS, 0, 0); } -- cgit v1.2.3 From 80ee09bb9a03a58019b2054d7e0d280658858656 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 30 Jun 2009 19:10:14 +0000 Subject: RNA * Add Image.dirty boolean. * Added Window struct, with editable Window.screen. * Make Screen.scene editable. --- source/blender/makesdna/DNA_screen_types.h | 1 + source/blender/makesdna/DNA_windowmanager_types.h | 3 +- source/blender/makesrna/intern/rna_access.c | 1 + source/blender/makesrna/intern/rna_context.c | 8 ++-- source/blender/makesrna/intern/rna_image.c | 19 ++++++++++ source/blender/makesrna/intern/rna_screen.c | 28 ++++++++++++++ source/blender/makesrna/intern/rna_wm.c | 46 +++++++++++++++++++++++ 7 files changed, 101 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index 4891f44e1cd..7bc94195204 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -53,6 +53,7 @@ typedef struct bScreen { ListBase regionbase; /* screen level regions (menus), runtime only */ struct Scene *scene; + struct Scene *newscene; /* temporary when switching */ short full; /* fade out? */ short winid; /* winid from WM, starts with 1 */ diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index e02d2984771..b63fb35c193 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -88,7 +88,8 @@ typedef struct wmWindow { int winid, pad; /* winid also in screens, is for retrieving this window after read */ - struct bScreen *screen; /* active screen */ + struct bScreen *screen; /* active screen */ + struct bScreen *newscreen; /* temporary when switching */ char screenname[32]; /* MAX_ID_NAME for matching window with active screen after file read */ short posx, posy, sizex, sizey; /* window coords */ diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 36adc9a7c10..9ebb778707c 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1588,6 +1588,7 @@ int RNA_raw_type_sizeof(RawPropertyType type) case PROP_RAW_INT: return sizeof(int); case PROP_RAW_FLOAT: return sizeof(float); case PROP_RAW_DOUBLE: return sizeof(double); + default: return 0; } } diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c index 07a50235733..378498c8e0a 100644 --- a/source/blender/makesrna/intern/rna_context.c +++ b/source/blender/makesrna/intern/rna_context.c @@ -40,11 +40,11 @@ static PointerRNA rna_Context_manager_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_WindowManager, CTX_wm_manager(C)); } -/*static PointerRNA rna_Context_window_get(PointerRNA *ptr) +static PointerRNA rna_Context_window_get(PointerRNA *ptr) { bContext *C= (bContext*)ptr->data; return rna_pointer_inherit_refine(ptr, &RNA_Window, CTX_wm_window(C)); -}*/ +} static PointerRNA rna_Context_screen_get(PointerRNA *ptr) { @@ -113,10 +113,10 @@ void RNA_def_context(BlenderRNA *brna) RNA_def_property_struct_type(prop, "WindowManager"); RNA_def_property_pointer_funcs(prop, "rna_Context_manager_get", NULL, NULL); - /* prop= RNA_def_property(srna, "window", PROP_POINTER, PROP_NONE); + prop= RNA_def_property(srna, "window", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Window"); - RNA_def_property_pointer_funcs(prop, "rna_Context_window_get", NULL, NULL); */ + RNA_def_property_pointer_funcs(prop, "rna_Context_window_get", NULL, NULL); prop= RNA_def_property(srna, "screen", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 4a6fdf5a734..c74e46c17da 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -39,6 +39,8 @@ #ifdef RNA_RUNTIME +#include "IMB_imbuf_types.h" + static void rna_Image_animated_update(bContext *C, PointerRNA *ptr) { Image *ima= (Image*)ptr->data; @@ -52,6 +54,18 @@ static void rna_Image_animated_update(bContext *C, PointerRNA *ptr) } } +static int rna_Image_dirty_get(PointerRNA *ptr) +{ + Image *ima= (Image*)ptr->data; + ImBuf *ibuf; + + for(ibuf=ima->ibufs.first; ibuf; ibuf=ibuf->next) + if(ibuf->userflags & IB_BITMAPDIRTY) + return 1; + + return 0; +} + #else static void rna_def_imageuser(BlenderRNA *brna) @@ -174,6 +188,11 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha."); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + prop= RNA_def_property(srna, "dirty", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Dirty", "Image has changed and is not saved."); + /* generated image (image_generated_change_cb) */ prop= RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "gen_type"); diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index b7279757455..a4ba6ec172b 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -42,6 +42,31 @@ EnumPropertyItem region_type_items[] = { #ifdef RNA_RUNTIME +#include "WM_api.h" +#include "WM_types.h" + +static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value) +{ + bScreen *sc= (bScreen*)ptr->data; + + if(value.data == NULL) + return; + + /* exception: can't set screens inside of area/region handers */ + sc->newscene= value.data; +} + +static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr) +{ + bScreen *sc= (bScreen*)ptr->data; + + /* exception: can't set screens inside of area/region handers */ + if(sc->newscene) { + WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, sc->newscene); + sc->newscene= NULL; + } +} + #else static void rna_def_scrarea(BlenderRNA *brna) @@ -94,6 +119,9 @@ static void rna_def_bscreen(BlenderRNA *brna) prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen."); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Screen_scene_set", NULL); + RNA_def_property_update(prop, 0, "rna_Screen_scene_update"); prop= RNA_def_property(srna, "areas", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "areabase", NULL); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 1bfc3b6f8f6..f8ab3a86744 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -147,6 +147,8 @@ EnumPropertyItem event_type_items[] = { #ifdef RNA_RUNTIME +#include "WM_api.h" + #include "BKE_idprop.h" static wmOperator *rna_OperatorProperties_find_operator(PointerRNA *ptr) @@ -215,6 +217,28 @@ static int rna_Event_ascii_length(PointerRNA *ptr) return (event->ascii)? 1 : 0; } +static void rna_Window_screen_set(PointerRNA *ptr, PointerRNA value) +{ + wmWindow *win= (wmWindow*)ptr->data; + + if(value.data == NULL) + return; + + /* exception: can't set screens inside of area/region handers */ + win->newscreen= value.data; +} + +static void rna_Window_screen_update(bContext *C, PointerRNA *ptr) +{ + wmWindow *win= (wmWindow*)ptr->data; + + /* exception: can't set screens inside of area/region handers */ + if(win->newscreen) { + WM_event_add_notifier(C, NC_SCREEN|ND_SCREENBROWSE, win->newscreen); + win->newscreen= NULL; + } +} + #else static void rna_def_operator(BlenderRNA *brna) @@ -349,6 +373,23 @@ static void rna_def_event(BlenderRNA *brna) RNA_def_property_ui_text(prop, "OS Key", "True when the shift key is held."); } +static void rna_def_window(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "Window", NULL); + RNA_def_struct_ui_text(srna, "Window", "Open window."); + RNA_def_struct_sdna(srna, "wmWindow"); + + prop= RNA_def_property(srna, "screen", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_struct_type(prop, "Screen"); + RNA_def_property_ui_text(prop, "Screen", "Active screen showing in the window."); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Window_screen_set", NULL); + RNA_def_property_update(prop, 0, "rna_Window_screen_update"); +} + static void rna_def_windowmanager(BlenderRNA *brna) { StructRNA *srna; @@ -362,6 +403,10 @@ static void rna_def_windowmanager(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Operator"); RNA_def_property_ui_text(prop, "Operators", "Operator registry."); + prop= RNA_def_property(srna, "windows", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "Window"); + RNA_def_property_ui_text(prop, "Windows", "Open windows."); + RNA_api_wm(srna); } @@ -371,6 +416,7 @@ void RNA_def_wm(BlenderRNA *brna) rna_def_operator_utils(brna); rna_def_operator_filelist_element(brna); rna_def_event(brna); + rna_def_window(brna); rna_def_windowmanager(brna); } -- cgit v1.2.3 From 37864a4273a5f9217f9b5995dc70212bb97a6cf6 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 30 Jun 2009 19:20:45 +0000 Subject: 2.5 Image Window * Unpack operator now works. * Some small layout code tweaks. Info Window Header * Moved to python UI code. * template_running_jobs, template_operator_search added. * Ported external data operators: pack/unpack all, make paths relative/absolute, find/report missing files. Also * Report RPT_INFO too, not only warnings and errors. * Run UI handle functions after RNA and Operators. * Rename particle system add/remove operators, to not include "slot", that's only there for materials because that's what they are called now in RNA. --- source/blender/blenkernel/BKE_packedFile.h | 54 ++- source/blender/blenkernel/BKE_particle.h | 4 +- source/blender/blenkernel/BKE_report.h | 5 +- source/blender/blenkernel/intern/font.c | 8 +- source/blender/blenkernel/intern/image.c | 4 +- source/blender/blenkernel/intern/packedFile.c | 227 +++------ source/blender/blenkernel/intern/particle.c | 4 +- source/blender/blenkernel/intern/report.c | 4 +- source/blender/editors/include/UI_interface.h | 2 + .../blender/editors/interface/interface_handlers.c | 20 +- .../blender/editors/interface/interface_regions.c | 2 + .../editors/interface/interface_templates.c | 103 ++++- .../blender/editors/space_buttons/buttons_intern.h | 4 +- source/blender/editors/space_buttons/buttons_ops.c | 20 +- .../blender/editors/space_buttons/space_buttons.c | 4 +- source/blender/editors/space_image/image_buttons.c | 4 +- source/blender/editors/space_image/image_ops.c | 95 +++- source/blender/editors/space_info/info_header.c | 507 --------------------- source/blender/editors/space_info/info_intern.h | 7 + source/blender/editors/space_info/info_ops.c | 397 ++++++++++++++++ source/blender/editors/space_info/space_info.c | 28 +- source/blender/makesrna/intern/rna_ui_api.c | 5 + source/blender/python/intern/bpy_operator_wrap.c | 3 +- source/blender/windowmanager/intern/wm_files.c | 2 +- 24 files changed, 766 insertions(+), 747 deletions(-) delete mode 100644 source/blender/editors/space_info/info_header.c create mode 100644 source/blender/editors/space_info/info_ops.c (limited to 'source') diff --git a/source/blender/blenkernel/BKE_packedFile.h b/source/blender/blenkernel/BKE_packedFile.h index 2d5acc51b7b..efd930d375a 100644 --- a/source/blender/blenkernel/BKE_packedFile.h +++ b/source/blender/blenkernel/BKE_packedFile.h @@ -31,31 +31,43 @@ #ifndef BKE_PACKEDFILE_H #define BKE_PACKEDFILE_H -#define RET_OK 0 -#define RET_ERROR 1 +#define RET_OK 0 +#define RET_ERROR 1 -struct PackedFile; -struct VFont; struct bSample; struct bSound; struct Image; +struct Main; +struct PackedFile; +struct ReportList; +struct VFont; + +/* pack */ +struct PackedFile *newPackedFile(struct ReportList *reports, char *filename); +struct PackedFile *newPackedFileMemory(void *mem, int memlen); + +void packAll(struct Main *bmain, struct ReportList *reports); + +/* unpack */ +char *unpackFile(struct ReportList *reports, char *abs_name, char *local_name, struct PackedFile *pf, int how); +int unpackVFont(struct ReportList *reports, struct VFont *vfont, int how); +int unpackSample(struct ReportList *reports, struct bSample *sample, int how); +int unpackImage(struct ReportList *reports, struct Image *ima, int how); +void unpackAll(struct Main *bmain, struct ReportList *reports, int how); + +int writePackedFile(struct ReportList *reports, char *filename, struct PackedFile *pf, int guimode); + +/* free */ +void freePackedFile(struct PackedFile *pf); + +/* info */ +int countPackedFiles(struct Main *bmain); +int checkPackedFile(char *filename, struct PackedFile *pf); + +/* read */ +int seekPackedFile(struct PackedFile *pf, int offset, int whence); +void rewindPackedFile(struct PackedFile *pf); +int readPackedFile(struct PackedFile *pf, void *data, int size); -struct PackedFile * newPackedFile(char * filename); -struct PackedFile * newPackedFileMemory(void *mem, int memlen); - -int seekPackedFile(struct PackedFile * pf, int offset, int whence); -void rewindPackedFile(struct PackedFile * pf); -int readPackedFile(struct PackedFile * pf, void * data, int size); -int countPackedFiles(void); -void freePackedFile(struct PackedFile * pf); -void packAll(void); -int writePackedFile(char * filename, struct PackedFile *pf, int guimode); -int checkPackedFile(char * filename, struct PackedFile * pf); -char * unpackFile(char * abs_name, char * local_name, struct PackedFile * pf, int how); -int unpackVFont(struct VFont * vfont, int how); -int unpackSample(struct bSample *sample, int how); -int unpackImage(struct Image * ima, int how); -void unpackAll(int how); - #endif diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index 4d9916b9557..73f0195d1d8 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -251,8 +251,8 @@ void copy_particle_key(struct ParticleKey *to, struct ParticleKey *from, int tim void psys_particle_on_emitter(struct ParticleSystemModifierData *psmd, int distr, int index, int index_dmcache, float *fuv, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor); struct ParticleSystemModifierData *psys_get_modifier(struct Object *ob, struct ParticleSystem *psys); -void object_add_particle_system_slot(struct Scene *scene, struct Object *ob); -void object_remove_particle_system_slot(struct Scene *scene, struct Object *ob); +void object_add_particle_system(struct Scene *scene, struct Object *ob); +void object_remove_particle_system(struct Scene *scene, struct Object *ob); struct ParticleSettings *psys_new_settings(char *name, struct Main *main); struct ParticleSettings *psys_copy_settings(struct ParticleSettings *part); void psys_flush_particle_settings(struct Scene *scene, struct ParticleSettings *part, int recalc); diff --git a/source/blender/blenkernel/BKE_report.h b/source/blender/blenkernel/BKE_report.h index 21221026b8b..1bb7152fbf3 100644 --- a/source/blender/blenkernel/BKE_report.h +++ b/source/blender/blenkernel/BKE_report.h @@ -34,7 +34,10 @@ extern "C" { #include "DNA_listBase.h" -/* Reporting Information and Errors */ +/* Reporting Information and Errors + * + * These functions also accept NULL in case no error reporting + * is needed. */ typedef enum ReportType { RPT_DEBUG = 0, diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 60a7ffc28d9..70901778585 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -333,11 +333,11 @@ static VFontData *vfont_get_data(VFont *vfont) BLI_addtail(&ttfdata, tmpfnt); } } else { - pf= newPackedFile(vfont->name); + pf= newPackedFile(NULL, vfont->name); if(!tmpfnt) { - tpf= newPackedFile(vfont->name); + tpf= newPackedFile(NULL, vfont->name); // Add temporary packed file to globals tmpfnt= (struct TmpFont *) MEM_callocN(sizeof(struct TmpFont), "temp_font"); @@ -385,8 +385,8 @@ VFont *load_vfont(char *name) strcpy(dir, name); BLI_splitdirstring(dir, filename); - pf= newPackedFile(name); - tpf= newPackedFile(name); + pf= newPackedFile(NULL, name); + tpf= newPackedFile(NULL, name); is_builtin= 0; } diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 6b231cfc702..ef0984bf93d 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1431,7 +1431,7 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal) /* try to repack file */ if(ima->packedfile) { PackedFile *pf; - pf = newPackedFile(ima->name); + pf = newPackedFile(NULL, ima->name); if (pf) { freePackedFile(ima->packedfile); ima->packedfile = pf; @@ -1750,7 +1750,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra) /* make packed file for autopack */ if ((ima->packedfile == NULL) && (G.fileflags & G_AUTOPACK)) - ima->packedfile = newPackedFile(str); + ima->packedfile = newPackedFile(NULL, str); } if(ima->flag & IMA_DO_PREMUL) diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 22e4e8a8309..4d88556d8bf 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -61,8 +61,9 @@ #include "BKE_image.h" #include "BKE_font.h" #include "BKE_packedFile.h" +#include "BKE_report.h" -int seekPackedFile(PackedFile * pf, int offset, int whence) +int seekPackedFile(PackedFile *pf, int offset, int whence) { int oldseek = -1, seek = 0; @@ -92,12 +93,12 @@ int seekPackedFile(PackedFile * pf, int offset, int whence) return(oldseek); } -void rewindPackedFile(PackedFile * pf) +void rewindPackedFile(PackedFile *pf) { seekPackedFile(pf, 0, SEEK_SET); } -int readPackedFile(PackedFile * pf, void * data, int size) +int readPackedFile(PackedFile *pf, void *data, int size) { if ((pf != NULL) && (size >= 0) && (data != NULL)) { if (size + pf->seek > pf->size) { @@ -118,66 +119,55 @@ int readPackedFile(PackedFile * pf, void * data, int size) return(size); } -int countPackedFiles() +int countPackedFiles(Main *bmain) { - int count = 0; Image *ima; VFont *vf; bSample *sample; + int count = 0; // let's check if there are packed files... - ima = G.main->image.first; - while (ima) { - if (ima->packedfile) { + for(ima=bmain->image.first; ima; ima=ima->id.next) + if(ima->packedfile) count++; - } - ima= ima->id.next; - } - vf = G.main->vfont.first; - while (vf) { - if (vf->packedfile) { + for(vf=bmain->vfont.first; vf; vf=vf->id.next) + if(vf->packedfile) count++; - } - vf = vf->id.next; - } - sample = samples->first; - while (sample) { - if (sample->packedfile) { - count++; - } - sample = sample->id.next; - } + if(samples) + for(sample=samples->first; sample; sample=sample->id.next) + if(sample->packedfile) + count++; - return(count); + return count; } -void freePackedFile(PackedFile * pf) +void freePackedFile(PackedFile *pf) { - if (pf) { + if(pf) { MEM_freeN(pf->data); MEM_freeN(pf); - } else { - printf("freePackedFile: Trying to free a NULL pointer\n"); } + else + printf("freePackedFile: Trying to free a NULL pointer\n"); } -PackedFile * newPackedFileMemory(void *mem, int memlen) +PackedFile *newPackedFileMemory(void *mem, int memlen) { - PackedFile * pf = MEM_callocN(sizeof(*pf), "PackedFile"); + PackedFile *pf = MEM_callocN(sizeof(*pf), "PackedFile"); pf->data = mem; pf->size = memlen; return pf; } -PackedFile * newPackedFile(char * filename) +PackedFile *newPackedFile(ReportList *reports, char *filename) { - PackedFile * pf = NULL; + PackedFile *pf = NULL; int file, filelen; char name[FILE_MAXDIR+FILE_MAXFILE]; - void * data; + void *data; //XXX waitcursor(1); @@ -191,7 +181,7 @@ PackedFile * newPackedFile(char * filename) file= open(name, O_BINARY|O_RDONLY); if (file <= 0) { - // error("Can't open file: %s", name); + BKE_reportf(reports, RPT_ERROR, "Can't open file: %s", name); } else { filelen = BLI_filesize(file); @@ -214,36 +204,24 @@ PackedFile * newPackedFile(char * filename) return (pf); } -void packAll() +void packAll(Main *bmain, ReportList *reports) { Image *ima; VFont *vf; bSample *sample; - ima = G.main->image.first; - while (ima) { - if (ima->packedfile == NULL) { - ima->packedfile = newPackedFile(ima->name); - } - ima= ima->id.next; - } - - vf = G.main->vfont.first; - while (vf) { - if (vf->packedfile == NULL) { - vf->packedfile = newPackedFile(vf->name); - } - vf = vf->id.next; - } + for(ima=bmain->image.first; ima; ima=ima->id.next) + if(ima->packedfile == NULL) + ima->packedfile = newPackedFile(reports, ima->name); + for(vf=bmain->vfont.first; vf; vf=vf->id.next) + if(vf->packedfile == NULL) + vf->packedfile = newPackedFile(reports, vf->name); - sample = samples->first; - while (sample) { - if (sample->packedfile == NULL) { - sound_set_packedfile(sample, newPackedFile(sample->name)); - } - sample = sample->id.next; - } + if(samples) + for(sample=samples->first; sample; sample=sample->id.next) + if(sample->packedfile == NULL) + sound_set_packedfile(sample, newPackedFile(reports, sample->name)); } @@ -252,10 +230,10 @@ void packAll() // attempt to create a function that generates an unique filename // this will work when all funtions in fileops.c understand relative filenames... -char * find_new_name(char * name) +char *find_new_name(char *name) { char tempname[FILE_MAXDIR + FILE_MAXFILE]; - char * newname; + char *newname; if (fop_exists(name)) { for (number = 1; number <= 999; number++) { @@ -274,13 +252,13 @@ char * find_new_name(char * name) */ -int writePackedFile(char * filename, PackedFile *pf, int guimode) +int writePackedFile(ReportList *reports, char *filename, PackedFile *pf, int guimode) { int file, number, remove_tmp = FALSE; int ret_value = RET_OK; char name[FILE_MAXDIR + FILE_MAXFILE]; char tempname[FILE_MAXDIR + FILE_MAXFILE]; -/* void * data; */ +/* void *data; */ if (guimode); //XXX waitcursor(1); @@ -305,23 +283,23 @@ int writePackedFile(char * filename, PackedFile *pf, int guimode) file = open(name, O_BINARY + O_WRONLY + O_CREAT + O_TRUNC, 0666); if (file >= 0) { if (write(file, pf->data, pf->size) != pf->size) { - if(guimode) ; //XXX error("Error writing file: %s", name); + BKE_reportf(reports, RPT_ERROR, "Error writing file: %s", name); ret_value = RET_ERROR; } close(file); } else { - if(guimode); //XXX error("Error creating file: %s", name); + BKE_reportf(reports, RPT_ERROR, "Error creating file: %s", name); ret_value = RET_ERROR; } if (remove_tmp) { if (ret_value == RET_ERROR) { if (BLI_rename(tempname, name) != 0) { - if(guimode); //XXX error("Error restoring tempfile. Check files: '%s' '%s'", tempname, name); + BKE_reportf(reports, RPT_ERROR, "Error restoring tempfile. Check files: '%s' '%s'", tempname, name); } } else { if (BLI_delete(tempname, 0, 0) != 0) { - if(guimode); //XXX error("Error deleting '%s' (ignored)"); + BKE_reportf(reports, RPT_ERROR, "Error deleting '%s' (ignored)", tempname); } } } @@ -342,7 +320,7 @@ PF_NOFILE - the original file doens't exist */ -int checkPackedFile(char * filename, PackedFile * pf) +int checkPackedFile(char *filename, PackedFile *pf) { struct stat st; int ret_val, i, len, file; @@ -390,68 +368,23 @@ int checkPackedFile(char * filename, PackedFile * pf) /* -unpackFile() looks at the existing files (abs_name, local_name) and a packed file. -If how == PF_ASK it offers the user a couple of options what to do with the packed file. + unpackFile() looks at the existing files (abs_name, local_name) and a packed file. -It returns a char * to the existing file name / new file name or NULL when +It returns a char *to the existing file name / new file name or NULL when there was an error or when the user desides to cancel the operation. */ -char *unpackFile(char * abs_name, char * local_name, PackedFile * pf, int how) +char *unpackFile(ReportList *reports, char *abs_name, char *local_name, PackedFile *pf, int how) { - char menu[6 * (FILE_MAXDIR + FILE_MAXFILE + 100)]; + char menu[6 *(FILE_MAXDIR + FILE_MAXFILE + 100)]; char line[FILE_MAXDIR + FILE_MAXFILE + 100]; - char * newname = NULL, * temp = NULL; + char *newname = NULL, *temp = NULL; // char newabs[FILE_MAXDIR + FILE_MAXFILE]; // char newlocal[FILE_MAXDIR + FILE_MAXFILE]; if (pf != NULL) { - if (how == PF_ASK) { - sprintf(menu, "UnPack file%%t|Remove Pack %%x%d", PF_REMOVE); - - if (strcmp(abs_name, local_name)) { - switch (checkPackedFile(local_name, pf)) { - case PF_NOFILE: - sprintf(line, "|Create %s%%x%d", local_name, PF_WRITE_LOCAL); - strcat(menu, line); - break; - case PF_EQUAL: - sprintf(line, "|Use %s (identical)%%x%d", local_name, PF_USE_LOCAL); - strcat(menu, line); - break; - case PF_DIFFERS: - sprintf(line, "|Use %s (differs)%%x%d", local_name, PF_USE_LOCAL); - strcat(menu, line); - sprintf(line, "|Overwrite %s%%x%d", local_name, PF_WRITE_LOCAL); - strcat(menu, line); - break; - } - // sprintf(line, "|%%x%d", PF_INVALID); - // strcat(menu, line); - } - - switch (checkPackedFile(abs_name, pf)) { - case PF_NOFILE: - sprintf(line, "|Create %s%%x%d", abs_name, PF_WRITE_ORIGINAL); - strcat(menu, line); - break; - case PF_EQUAL: - sprintf(line, "|Use %s (identical)%%x%d", abs_name, PF_USE_ORIGINAL); - strcat(menu, line); - break; - case PF_DIFFERS: - sprintf(line, "|Use %s (differs)%%x%d", abs_name, PF_USE_ORIGINAL); - strcat(menu, line); - sprintf(line, "|Overwrite %s%%x%d", abs_name, PF_WRITE_ORIGINAL); - strcat(menu, line); - break; - } - - //XXX how = pupmenu(menu); - } - switch (how) { case -1: case PF_KEEP: @@ -467,7 +400,7 @@ char *unpackFile(char * abs_name, char * local_name, PackedFile * pf, int how) } // else fall through and create it case PF_WRITE_LOCAL: - if (writePackedFile(local_name, pf, 1) == RET_OK) { + if (writePackedFile(reports, local_name, pf, 1) == RET_OK) { temp = local_name; } break; @@ -479,7 +412,7 @@ char *unpackFile(char * abs_name, char * local_name, PackedFile * pf, int how) } // else fall through and create it case PF_WRITE_ORIGINAL: - if (writePackedFile(abs_name, pf, 1) == RET_OK) { + if (writePackedFile(reports, abs_name, pf, 1) == RET_OK) { temp = abs_name; } break; @@ -498,10 +431,10 @@ char *unpackFile(char * abs_name, char * local_name, PackedFile * pf, int how) } -int unpackVFont(VFont * vfont, int how) +int unpackVFont(ReportList *reports, VFont *vfont, int how) { char localname[FILE_MAXDIR + FILE_MAXFILE], fi[FILE_MAXFILE]; - char * newname; + char *newname; int ret_value = RET_ERROR; if (vfont != NULL) { @@ -510,7 +443,7 @@ int unpackVFont(VFont * vfont, int how) sprintf(localname, "//fonts/%s", fi); - newname = unpackFile(vfont->name, localname, vfont->packedfile, how); + newname = unpackFile(reports, vfont->name, localname, vfont->packedfile, how); if (newname != NULL) { ret_value = RET_OK; freePackedFile(vfont->packedfile); @@ -523,10 +456,10 @@ int unpackVFont(VFont * vfont, int how) return (ret_value); } -int unpackSample(bSample *sample, int how) +int unpackSample(ReportList *reports, bSample *sample, int how) { char localname[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX]; - char * newname; + char *newname; int ret_value = RET_ERROR; PackedFile *pf; @@ -535,7 +468,7 @@ int unpackSample(bSample *sample, int how) BLI_splitdirstring(localname, fi); sprintf(localname, "//samples/%s", fi); - newname = unpackFile(sample->name, localname, sample->packedfile, how); + newname = unpackFile(reports, sample->name, localname, sample->packedfile, how); if (newname != NULL) { strcpy(sample->name, newname); MEM_freeN(newname); @@ -553,10 +486,10 @@ int unpackSample(bSample *sample, int how) return(ret_value); } -int unpackImage(Image * ima, int how) +int unpackImage(ReportList *reports, Image *ima, int how) { char localname[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX]; - char * newname; + char *newname; int ret_value = RET_ERROR; if (ima != NULL) { @@ -564,7 +497,7 @@ int unpackImage(Image * ima, int how) BLI_splitdirstring(localname, fi); sprintf(localname, "//textures/%s", fi); - newname = unpackFile(ima->name, localname, ima->packedfile, how); + newname = unpackFile(reports, ima->name, localname, ima->packedfile, how); if (newname != NULL) { ret_value = RET_OK; freePackedFile(ima->packedfile); @@ -578,33 +511,23 @@ int unpackImage(Image * ima, int how) return(ret_value); } -void unpackAll(int how) +void unpackAll(Main *bmain, ReportList *reports, int how) { Image *ima; VFont *vf; bSample *sample; - - ima = G.main->image.first; - while (ima) { - if (ima->packedfile) { - unpackImage(ima, how); - } - ima= ima->id.next; - } - - vf = G.main->vfont.first; - while (vf) { - if (vf->packedfile) { - unpackVFont(vf, how); - } - vf = vf->id.next; - } - sample = samples->first; - while (sample) { - if (sample->packedfile) { - unpackSample(sample, how); - } - sample = sample->id.next; - } + for(ima=bmain->image.first; ima; ima=ima->id.next) + if(ima->packedfile) + unpackImage(reports, ima, how); + + for(vf=bmain->vfont.first; vf; vf=vf->id.next) + if(vf->packedfile) + unpackVFont(reports, vf, how); + + if(samples) + for(sample=samples->first; sample; sample=sample->id.next) + if(sample->packedfile) + unpackSample(reports, sample, how); } + diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 2474053298d..31e60e985d5 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -2929,7 +2929,7 @@ void psys_mat_hair_to_global(Object *ob, DerivedMesh *dm, short from, ParticleDa /************************************************/ /* ParticleSettings handling */ /************************************************/ -void object_add_particle_system_slot(Scene *scene, Object *ob) +void object_add_particle_system(Scene *scene, Object *ob) { ParticleSystem *psys; ModifierData *md; @@ -2961,7 +2961,7 @@ void object_add_particle_system_slot(Scene *scene, Object *ob) DAG_scene_sort(scene); DAG_object_flush_update(scene, ob, OB_RECALC_DATA); } -void object_remove_particle_system_slot(Scene *scene, Object *ob) +void object_remove_particle_system(Scene *scene, Object *ob) { ParticleSystem *psys = psys_get_current(ob); ParticleSystemModifierData *psmd; diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c index 116fd069948..8de8cf8d0f4 100644 --- a/source/blender/blenkernel/intern/report.c +++ b/source/blender/blenkernel/intern/report.c @@ -65,8 +65,8 @@ void BKE_reports_init(ReportList *reports, int flag) memset(reports, 0, sizeof(ReportList)); - reports->storelevel= RPT_WARNING; - reports->printlevel= RPT_WARNING; + reports->storelevel= RPT_INFO; + reports->printlevel= RPT_INFO; reports->flag= flag; } diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 333536137cc..5000dca3743 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -618,6 +618,8 @@ void uiTemplateCurveMapping(uiLayout *layout, struct CurveMapping *cumap, int ty void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, char *propname); void uiTemplateImageLayers(uiLayout *layout, struct bContext *C, struct Image *ima, struct ImageUser *iuser); ListBase uiTemplateList(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *activeprop, int rows, int columns, int compact); +void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C); +void uiTemplateOperatorSearch(uiLayout *layout); /* items */ void uiItemO(uiLayout *layout, char *name, int icon, char *opname); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 92c888ac772..7ad422ef3b5 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -287,16 +287,6 @@ static void ui_apply_but_funcs_after(bContext *C) if(after.context) CTX_store_set(C, after.context); - if(after.func) - after.func(C, after.func_arg1, after.func_arg2); - if(after.funcN) - after.funcN(C, after.func_argN, after.func_arg2); - - if(after.handle_func) - after.handle_func(C, after.handle_func_arg, after.retval); - if(after.butm_func) - after.butm_func(C, after.butm_func_arg, after.a2); - if(after.optype) WM_operator_name_call(C, after.optype->idname, after.opcontext, after.opptr); if(after.opptr) { @@ -311,6 +301,16 @@ static void ui_apply_but_funcs_after(bContext *C) CTX_store_set(C, NULL); CTX_store_free(after.context); } + + if(after.func) + after.func(C, after.func_arg1, after.func_arg2); + if(after.funcN) + after.funcN(C, after.func_argN, after.func_arg2); + + if(after.handle_func) + after.handle_func(C, after.handle_func_arg, after.retval); + if(after.butm_func) + after.butm_func(C, after.butm_func_arg, after.a2); } } diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 49e3abf4d0c..27fb0731d67 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2762,6 +2762,8 @@ void uiPupMenuReports(bContext *C, ReportList *reports) BLI_dynstr_appendf(ds, "Error %%i%d%%t|%s", ICON_ERROR, report->message); else if(report->type >= RPT_WARNING) BLI_dynstr_appendf(ds, "Warning %%i%d%%t|%s", ICON_ERROR, report->message); + else if(report->type >= RPT_INFO) + BLI_dynstr_appendf(ds, "Info %%t|%s", report->message); } str= BLI_dynstr_get_cstring(ds); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index b128da7b97f..8b3f2bf4100 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -161,9 +161,15 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) switch(event) { case UI_ID_BROWSE: case UI_ID_PIN: + printf("warning, id event %d shouldnt come here\n", event); + break; case UI_ID_OPEN: case UI_ID_ADD_NEW: - printf("warning, id event %d shouldnt come here\n", event); + if(template->idlb->last) { + RNA_id_pointer_create(template->idlb->last, &idptr); + RNA_property_pointer_set(&template->ptr, template->prop, idptr); + RNA_property_update(C, &template->ptr, template->prop); + } break; case UI_ID_DELETE: memset(&idptr, 0, sizeof(idptr)); @@ -201,12 +207,13 @@ static void template_ID(bContext *C, uiBlock *block, TemplateID *template, Struc idptr= RNA_property_pointer_get(&template->ptr, template->prop); lb= template->idlb; + uiBlockBeginAlign(block); + if(idptr.type) type= idptr.type; if(type) uiDefIconBut(block, LABEL, 0, RNA_struct_ui_icon(type), 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); - uiBlockBeginAlign(block); if(flag & UI_ID_BROWSE) uiDefBlockButN(block, search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X, UI_UNIT_Y, "Browse ID data"); @@ -225,6 +232,7 @@ static void template_ID(bContext *C, uiBlock *block, TemplateID *template, Struc if(newop) { but= uiDefIconTextButO(block, BUT, newop, WM_OP_EXEC_REGION_WIN, ICON_ZOOMIN, "Add New", 0, 0, w, UI_UNIT_Y, NULL); + uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); } else { but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, "Add New", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); @@ -1680,3 +1688,94 @@ ListBase uiTemplateList(uiLayout *layout, PointerRNA *ptr, char *propname, char return lb; } +/************************* Operator Search Template **************************/ + +static void operator_call_cb(struct bContext *C, void *arg1, void *arg2) +{ + wmOperatorType *ot= arg2; + + if(ot) + WM_operator_name_call(C, ot->idname, WM_OP_INVOKE_DEFAULT, NULL); +} + +static void operator_search_cb(const struct bContext *C, void *arg, char *str, uiSearchItems *items) +{ + wmOperatorType *ot = WM_operatortype_first(); + + for(; ot; ot= ot->next) { + + if(BLI_strcasestr(ot->name, str)) { + if(ot->poll==NULL || ot->poll((bContext *)C)) { + char name[256]; + int len= strlen(ot->name); + + /* display name for menu, can hold hotkey */ + BLI_strncpy(name, ot->name, 256); + + /* check for hotkey */ + if(len < 256-6) { + if(WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, &name[len+1], 256-len-1)) + name[len]= '|'; + } + + if(0==uiSearchItemAdd(items, name, ot, 0)) + break; + } + } + } +} + +void uiTemplateOperatorSearch(uiLayout *layout) +{ + uiBlock *block; + uiBut *but; + static char search[256]= ""; + + block= uiLayoutGetBlock(layout); + uiBlockSetCurLayout(block, layout); + + but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 0, 0, UI_UNIT_X*6, UI_UNIT_Y, ""); + uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb, NULL); +} + +/************************* Running Jobs Template **************************/ + +#define B_STOPRENDER 1 +#define B_STOPCAST 2 +#define B_STOPANIM 3 + +static void do_running_jobs(bContext *C, void *arg, int event) +{ + switch(event) { + case B_STOPRENDER: + G.afbreek= 1; + break; + case B_STOPCAST: + WM_jobs_stop(CTX_wm_manager(C), CTX_wm_screen(C)); + break; + case B_STOPANIM: + ED_screen_animation_timer(C, 0, 0); + break; + } +} + +void uiTemplateRunningJobs(uiLayout *layout, bContext *C) +{ + bScreen *screen= CTX_wm_screen(C); + Scene *scene= CTX_data_scene(C); + wmWindowManager *wm= CTX_wm_manager(C); + uiBlock *block; + + block= uiLayoutGetBlock(layout); + uiBlockSetCurLayout(block, layout); + + uiBlockSetHandleFunc(block, do_running_jobs, NULL); + + if(WM_jobs_test(wm, scene)) + uiDefIconTextBut(block, BUT, B_STOPRENDER, ICON_REC, "Render", 0,0,75,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Stop rendering"); + if(WM_jobs_test(wm, screen)) + uiDefIconTextBut(block, BUT, B_STOPCAST, ICON_REC, "Capture", 0,0,85,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Stop screencast"); + if(screen->animtimer) + uiDefIconTextBut(block, BUT, B_STOPANIM, ICON_REC, "Anim Player", 0,0,85,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Stop animation playback"); +} + diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h index 13ea778fb00..65c2976d57c 100644 --- a/source/blender/editors/space_buttons/buttons_intern.h +++ b/source/blender/editors/space_buttons/buttons_intern.h @@ -71,8 +71,8 @@ void MATERIAL_OT_new(struct wmOperatorType *ot); void TEXTURE_OT_new(struct wmOperatorType *ot); void WORLD_OT_new(struct wmOperatorType *ot); -void OBJECT_OT_particle_system_slot_add(struct wmOperatorType *ot); -void OBJECT_OT_particle_system_slot_remove(struct wmOperatorType *ot); +void OBJECT_OT_particle_system_add(struct wmOperatorType *ot); +void OBJECT_OT_particle_system_remove(struct wmOperatorType *ot); void PARTICLE_OT_new(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 6ca92674c6e..df3e8c62d37 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -412,7 +412,7 @@ void WORLD_OT_new(wmOperatorType *ot) /********************** particle system slot operators *********************/ -static int particle_system_slot_add_exec(bContext *C, wmOperator *op) +static int particle_system_add_exec(bContext *C, wmOperator *op) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Scene *scene = CTX_data_scene(C); @@ -420,26 +420,26 @@ static int particle_system_slot_add_exec(bContext *C, wmOperator *op) if(!scene || !ob) return OPERATOR_CANCELLED; - object_add_particle_system_slot(scene, ob); + object_add_particle_system(scene, ob); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); return OPERATOR_FINISHED; } -void OBJECT_OT_particle_system_slot_add(wmOperatorType *ot) +void OBJECT_OT_particle_system_add(wmOperatorType *ot) { /* identifiers */ ot->name= "Add Particle System Slot"; - ot->idname= "OBJECT_OT_particle_system_slot_add"; + ot->idname= "OBJECT_OT_particle_system_add"; /* api callbacks */ - ot->exec= particle_system_slot_add_exec; + ot->exec= particle_system_add_exec; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int particle_system_slot_remove_exec(bContext *C, wmOperator *op) +static int particle_system_remove_exec(bContext *C, wmOperator *op) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Scene *scene = CTX_data_scene(C); @@ -447,20 +447,20 @@ static int particle_system_slot_remove_exec(bContext *C, wmOperator *op) if(!scene || !ob) return OPERATOR_CANCELLED; - object_remove_particle_system_slot(scene, ob); + object_remove_particle_system(scene, ob); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); return OPERATOR_FINISHED; } -void OBJECT_OT_particle_system_slot_remove(wmOperatorType *ot) +void OBJECT_OT_particle_system_remove(wmOperatorType *ot) { /* identifiers */ ot->name= "Remove Particle System Slot"; - ot->idname= "OBJECT_OT_particle_system_slot_remove"; + ot->idname= "OBJECT_OT_particle_system_remove"; /* api callbacks */ - ot->exec= particle_system_slot_remove_exec; + ot->exec= particle_system_remove_exec; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 7954d5254cc..f9732551545 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -220,8 +220,8 @@ void buttons_operatortypes(void) WM_operatortype_append(TEXTURE_OT_new); WM_operatortype_append(WORLD_OT_new); - WM_operatortype_append(OBJECT_OT_particle_system_slot_add); - WM_operatortype_append(OBJECT_OT_particle_system_slot_remove); + WM_operatortype_append(OBJECT_OT_particle_system_add); + WM_operatortype_append(OBJECT_OT_particle_system_remove); WM_operatortype_append(PARTICLE_OT_new); } diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index a08a23c1263..edf9bcbd896 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -1088,7 +1088,7 @@ static void image_pack_cb(bContext *C, void *ima_v, void *iuser_v) } if ((G.fileflags & G_AUTOPACK) == 0) { - unpackImage(ima, PF_ASK); + unpackImage(NULL, ima, PF_ASK); /* XXX report errors */ ED_undo_push(C, "Unpack image"); } } @@ -1097,7 +1097,7 @@ static void image_pack_cb(bContext *C, void *ima_v, void *iuser_v) if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) { // XXX error("Can't pack painted image. Save image or use Repack as PNG."); } else { - ima->packedfile = newPackedFile(ima->name); + ima->packedfile = newPackedFile(NULL, ima->name); /* XXX report errors */ ED_undo_push(C, "Pack image"); } } diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 8f9bb0d05fe..24781cc115e 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1114,7 +1114,7 @@ static int pack_exec(bContext *C, wmOperator *op) if(as_png) BKE_image_memorypack(ima); else - ima->packedfile= newPackedFile(ima->name); + ima->packedfile= newPackedFile(op->reports, ima->name); return OPERATOR_FINISHED; } @@ -1162,13 +1162,96 @@ void IMAGE_OT_pack(wmOperatorType *ot) /********************* unpack operator *********************/ +/* XXX move this to some place where it can be reused */ + +const EnumPropertyItem unpack_method_items[] = { + {PF_USE_LOCAL, "USE_LOCAL", 0, "Use Local File", ""}, + {PF_WRITE_LOCAL, "WRITE_LOCAL", 0, "Write Local File (overwrite existing)", ""}, + {PF_USE_ORIGINAL, "USE_ORIGINAL", 0, "Use Original File", ""}, + {PF_WRITE_ORIGINAL, "WRITE_ORIGINAL", 0, "Write Original File (overwrite existing)", ""}, + {0, NULL, 0, NULL, NULL}}; + +void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder, PackedFile *pf) +{ + uiPopupMenu *pup; + uiLayout *layout; + char line[FILE_MAXDIR + FILE_MAXFILE + 100]; + char local_name[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX]; + + strcpy(local_name, abs_name); + BLI_splitdirstring(local_name, fi); + sprintf(local_name, "//%s/%s", folder, fi); + + pup= uiPupMenuBegin(C, "Unpack file", 0); + layout= uiPupMenuLayout(pup); + + uiItemEnumO(layout, "Remove Pack", 0, opname, "method", PF_REMOVE); + + if(strcmp(abs_name, local_name)) { + switch(checkPackedFile(local_name, pf)) { + case PF_NOFILE: + sprintf(line, "Create %s", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_LOCAL); + break; + case PF_EQUAL: + sprintf(line, "Use %s (identical)", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_USE_LOCAL); + break; + case PF_DIFFERS: + sprintf(line, "Use %s (differs)", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_USE_LOCAL); + sprintf(line, "Overwrite %s", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_LOCAL); + break; + } + } + + switch(checkPackedFile(abs_name, pf)) { + case PF_NOFILE: + sprintf(line, "Create %s", abs_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_ORIGINAL); + break; + case PF_EQUAL: + sprintf(line, "Use %s (identical)", abs_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_USE_ORIGINAL); + break; + case PF_DIFFERS: + sprintf(line, "Use %s (differs)", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_USE_ORIGINAL); + sprintf(line, "Overwrite %s", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_ORIGINAL); + break; + } + + uiPupMenuEnd(C, pup); +} + static int unpack_exec(bContext *C, wmOperator *op) { Image *ima= CTX_data_edit_image(C); + int method= RNA_enum_get(op->ptr, "method"); - if(!ima) + if(!ima || !ima->packedfile) + return OPERATOR_CANCELLED; + + if(ima->source==IMA_SRC_SEQUENCE || ima->source==IMA_SRC_MOVIE) { + BKE_report(op->reports, RPT_ERROR, "Can't unpack movie or image sequence."); return OPERATOR_CANCELLED; - if(!ima->packedfile) + } + + if(G.fileflags & G_AUTOPACK) + BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save."); + + unpackImage(op->reports, ima, method); + + return OPERATOR_FINISHED; +} + +static int unpack_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + Image *ima= CTX_data_edit_image(C); + + if(!ima || !ima->packedfile) return OPERATOR_CANCELLED; if(ima->source==IMA_SRC_SEQUENCE || ima->source==IMA_SRC_MOVIE) { @@ -1179,7 +1262,7 @@ static int unpack_exec(bContext *C, wmOperator *op) if(G.fileflags & G_AUTOPACK) BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save."); - unpackImage(ima, PF_ASK); + unpack_menu(C, "IMAGE_OT_unpack", ima->name, "textures", ima->packedfile); return OPERATOR_FINISHED; } @@ -1192,10 +1275,14 @@ void IMAGE_OT_unpack(wmOperatorType *ot) /* api callbacks */ ot->exec= unpack_exec; + ot->invoke= unpack_invoke; ot->poll= space_image_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack."); } /******************** sample image operator ********************/ diff --git a/source/blender/editors/space_info/info_header.c b/source/blender/editors/space_info/info_header.c deleted file mode 100644 index 7d6e2ca05c0..00000000000 --- a/source/blender/editors/space_info/info_header.c +++ /dev/null @@ -1,507 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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) 2008 Blender Foundation. - * All rights reserved. - * - * - * Contributor(s): Blender Foundation - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include - -#include "DNA_packedFile_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_userdef_types.h" -#include "DNA_windowmanager_types.h" - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_bpath.h" - -#include "BKE_context.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_main.h" -#include "BKE_packedFile.h" -#include "BKE_screen.h" - -#include "ED_screen.h" -#include "ED_types.h" -#include "ED_util.h" - -#include "WM_api.h" -#include "WM_types.h" - -#include "BIF_gl.h" -#include "BIF_glutil.h" - -#include "UI_interface.h" -#include "UI_resources.h" -#include "UI_view2d.h" - -#include "IMB_imbuf_types.h" - -#include "info_intern.h" - -static int pupmenu() {return 0;} -static int okee() {return 0;} -static int error() {return 0;} - -/* ************************ header area region *********************** */ - -#define B_STOPRENDER 1 -#define B_STOPCAST 2 -#define B_STOPANIM 3 - -static void do_viewmenu(bContext *C, void *arg, int event) -{ -} - -static uiBlock *dummy_viewmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - ScrArea *curarea= CTX_wm_area(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "dummy_viewmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_viewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - uiEndBlock(C, block); - - return block; -} - -static int buttons_do_unpack() -{ - int how; - char menu[2048]; - char *line = menu; - int ret_value = 1, count = 0; - - count = countPackedFiles(); - - if(!count) { - pupmenu("No packed files. Autopack disabled"); - return ret_value; - } - if (count == 1) - line += sprintf(line, "Unpack 1 file%%t"); - else - line += sprintf(line, "Unpack %d files%%t", count); - - line += sprintf(line, "|Use files in current directory (create when necessary)%%x%d", PF_USE_LOCAL); - line += sprintf(line, "|Write files to current directory (overwrite existing files)%%x%d", PF_WRITE_LOCAL); - line += sprintf(line, "|%%l|Use files in original location (create when necessary)%%x%d", PF_USE_ORIGINAL); - line += sprintf(line, "|Write files to original location (overwrite existing files)%%x%d", PF_WRITE_ORIGINAL); - line += sprintf(line, "|%%l|Disable AutoPack, keep all packed files %%x%d", PF_KEEP); - line += sprintf(line, "|Ask for each file %%x%d", PF_ASK); - - how = pupmenu(menu); - - if(how == -1) - ret_value = 0; - else { - if (how != PF_KEEP) unpackAll(how); - G.fileflags &= ~G_AUTOPACK; - } - - return ret_value; -} - -static void check_packAll() -{ - // first check for dirty images - Image *ima; - - for(ima = G.main->image.first; ima; ima= ima->id.next) { - if (ima->ibufs.first) { /* XXX FIX */ - ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL); - - if (ibuf && (ibuf->userflags &= IB_BITMAPDIRTY)) - break; - } - } - - if (ima == NULL || okee("Some images are painted on. These changes will be lost. Continue ?")) { - packAll(); - G.fileflags |= G_AUTOPACK; - } -} - -static void do_info_externalfiles(bContext *C, void *arg, int event) -{ - switch (event) { - - case 1: /* pack data */ - check_packAll(); - break; - case 3: /* unpack data */ - if (buttons_do_unpack() != 0) { - /* Clear autopack bit only if user selected one of the unpack options */ - G.fileflags &= ~G_AUTOPACK; - } - break; - case 10: /* make all paths relative */ - if (G.relbase_valid) { - int tot,changed,failed,linked; - char str[512]; - char txtname[24]; /* text block name */ - txtname[0] = '\0'; - makeFilesRelative(txtname, &tot, &changed, &failed, &linked); - if (failed) sprintf(str, "Make Relative%%t|Total files %i|Changed %i|Failed %i, See Text \"%s\"|Linked %i", tot, changed, failed, txtname, linked); - else sprintf(str, "Make Relative%%t|Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); - pupmenu(str); - } else { - pupmenu("Can't set relative paths with an unsaved blend file"); - } - break; - case 11: /* make all paths absolute */ - { - int tot,changed,failed,linked; - char str[512]; - char txtname[24]; /* text block name */ - txtname[0] = '\0'; - makeFilesAbsolute(txtname, &tot, &changed, &failed, &linked); - sprintf(str, "Make Absolute%%t|Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); - if (failed) sprintf(str, "Make Absolute%%t|Total files %i|Changed %i|Failed %i, See Text \"%s\"|Linked %i", tot, changed, failed, txtname, linked); - else sprintf(str, "Make Absolute%%t|Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); - - pupmenu(str); - } - break; - case 12: /* check images exist */ - { - char txtname[24]; /* text block name */ - txtname[0] = '\0'; - - /* run the missing file check */ - checkMissingFiles( txtname ); - - if (txtname[0] == '\0') { - okee("No external files missing"); - } else { - char str[128]; - sprintf(str, "Missing files listed in Text \"%s\"", txtname ); - error(str); - } - } - break; - case 13: /* search for referenced files that are not available */ -// XXX if(curarea->spacetype==SPACE_INFO) { -// ScrArea *sa; -// sa= closest_bigger_area(); -// areawinset(sa->win); -// } -// activate_fileselect(FILE_SPECIAL, "Find Missing Files", "", findMissingFiles); - break; - } - -} - - -uiBlock *info_externalfiles(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "info_externalfiles", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_info_externalfiles, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack into .blend file", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unpack into Files...", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make all Paths Relative", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 10, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make all Paths Absolute", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Report Missing Files...", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 12, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Missing Files...", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 13, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - - - -static void info_filemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - - uiLayoutSetOperatorContext(layout, WM_OP_EXEC_AREA); - uiItemO(layout, NULL, 0, "WM_OT_read_homefile"); - uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_AREA); - uiItemO(layout, NULL, 0, "WM_OT_open_mainfile"); -// uiDefIconTextBlockBut(block, info_openrecentmenu, NULL, ICON_RIGHTARROW_THIN, "Open Recent",0, yco-=20, 120, 19, ""); -// uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recover Last Session", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - - uiItemS(layout); - - uiLayoutSetOperatorContext(layout, WM_OP_EXEC_AREA); - uiItemO(layout, NULL, 0, "WM_OT_save_mainfile"); - uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_AREA); - uiItemO(layout, NULL, 0, "WM_OT_save_as_mainfile"); - -#if 0 - if(U.flag & USER_FILECOMPRESS) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Compress File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 35, "Enable file compression"); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Compress File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 35, "Enable file compression"); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Rendered Image...|F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Screenshot Subwindow|Ctrl F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 24, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Screenshot All|Ctrl Shift F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 25, ""); -#if GAMEBLENDER == 1 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Game As Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, ""); -#endif - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Default Settings|Ctrl U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 31, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Load Factory Settings", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 32, ""); - - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Append or Link|Shift F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Append or Link (Image Browser)|Ctrl F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); -// uiDefIconTextBlockBut(block, info_file_importmenu, NULL, ICON_RIGHTARROW_THIN, "Import", 0, yco-=20, menuwidth, 19, ""); -// uiDefIconTextBlockBut(block, info_file_exportmenu, NULL, ICON_RIGHTARROW_THIN, "Export", 0, yco-=20, menuwidth, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, info_externalfiles, NULL, ICON_RIGHTARROW_THIN, "External Data",0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Quit Blender|Ctrl Q", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - uiBlockSetDirection(block, UI_DOWN); - uiTextBoundsBlock(block, 80); - - uiEndBlock(C, block); - return block; -#endif -} - - -static void do_info_buttons(bContext *C, void *arg, int event) -{ - switch(event) { - case B_STOPRENDER: - G.afbreek= 1; - break; - case B_STOPCAST: - WM_jobs_stop(CTX_wm_manager(C), CTX_wm_screen(C)); - break; - case B_STOPANIM: - ED_screen_animation_timer(C, 0, 0); - break; - } -} - -static void screen_idpoin_handle(bContext *C, ID *id, int event) -{ - switch(event) { - case UI_ID_BROWSE: - /* exception: can't set screens inside of area/region handers */ - WM_event_add_notifier(C, NC_SCREEN|ND_SCREENBROWSE, id); - break; - case UI_ID_DELETE: - ED_undo_push(C, ""); - break; - case UI_ID_RENAME: - break; - case UI_ID_ADD_NEW: - /* XXX not implemented */ - break; - case UI_ID_OPEN: - /* XXX not implemented */ - break; - case UI_ID_ALONE: - /* XXX not implemented */ - break; - case UI_ID_PIN: - break; - } -} - -static void scene_idpoin_handle(bContext *C, ID *id, int event) -{ - switch(event) { - case UI_ID_BROWSE: - /* exception: can't set screens inside of area/region handers */ - WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, id); - break; - case UI_ID_DELETE: - ED_undo_push(C, ""); - break; - case UI_ID_RENAME: - break; - case UI_ID_ADD_NEW: - /* XXX not implemented */ - break; - case UI_ID_OPEN: - /* XXX not implemented */ - break; - case UI_ID_ALONE: - /* XXX not implemented */ - break; - case UI_ID_PIN: - break; - } -} - -static void operator_call_cb(struct bContext *C, void *arg1, void *arg2) -{ - wmOperatorType *ot= arg2; - - if(ot) - WM_operator_name_call(C, ot->idname, WM_OP_INVOKE_DEFAULT, NULL); -} - -static void operator_search_cb(const struct bContext *C, void *arg, char *str, uiSearchItems *items) -{ - wmOperatorType *ot = WM_operatortype_first(); - - for(; ot; ot= ot->next) { - - if(BLI_strcasestr(ot->name, str)) { - if(ot->poll==NULL || ot->poll((bContext *)C)) { - char name[256]; - int len= strlen(ot->name); - - /* display name for menu, can hold hotkey */ - BLI_strncpy(name, ot->name, 256); - - /* check for hotkey */ - if(len < 256-6) { - if(WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, &name[len+1], 256-len-1)) - name[len]= '|'; - } - - if(0==uiSearchItemAdd(items, name, ot, 0)) - break; - } - } - } -} - -void info_header_buttons(const bContext *C, ARegion *ar) -{ - wmWindow *win= CTX_wm_window(C); - bScreen *screen= CTX_wm_screen(C); - ScrArea *sa= CTX_wm_area(C); - uiBlock *block; - int xco, yco= 3; - - block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS); - uiBlockSetHandleFunc(block, do_info_buttons, NULL); - - xco= ED_area_header_standardbuttons(C, block, yco); - - if((sa->flag & HEADER_NO_PULLDOWN)==0) { - int xmax; - - xmax= GetButStringLength("File"); - uiDefMenuBut(block, info_filemenu, NULL, "File", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - xmax= GetButStringLength("Add"); - uiDefPulldownBut(block, dummy_viewmenu, sa, "Add", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - xmax= GetButStringLength("Timeline"); - uiDefPulldownBut(block, dummy_viewmenu, sa, "Timeline", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - xmax= GetButStringLength("Game"); - uiDefPulldownBut(block, dummy_viewmenu, sa, "Game", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - xmax= GetButStringLength("Render"); - uiDefPulldownBut(block, dummy_viewmenu, sa, "Render", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - xmax= GetButStringLength("Help"); - uiDefPulldownBut(block, dummy_viewmenu, NULL, "Help", xco, yco, xmax-3, 20, ""); - xco+= xmax; - } - - uiBlockSetEmboss(block, UI_EMBOSS); - - if(screen->full==0) { - xco= uiDefIDPoinButs(block, CTX_data_main(C), NULL, (ID*)win->screen, ID_SCR, NULL, xco, yco, - screen_idpoin_handle, UI_ID_BROWSE|UI_ID_RENAME|UI_ID_ADD_NEW|UI_ID_DELETE); - xco += 8; - xco= uiDefIDPoinButs(block, CTX_data_main(C), NULL, (ID*)screen->scene, ID_SCE, NULL, xco, yco, - scene_idpoin_handle, UI_ID_BROWSE|UI_ID_RENAME|UI_ID_ADD_NEW|UI_ID_DELETE); - xco += 8; - } - - if(WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C))) { - uiDefIconTextBut(block, BUT, B_STOPRENDER, ICON_REC, "Render", xco+5,yco,75,19, NULL, 0.0f, 0.0f, 0, 0, "Stop rendering"); - xco+= 80; - } - if(WM_jobs_test(CTX_wm_manager(C), CTX_wm_screen(C))) { - uiDefIconTextBut(block, BUT, B_STOPCAST, ICON_REC, "Capture", xco+5,yco,85,19, NULL, 0.0f, 0.0f, 0, 0, "Stop screencast"); - xco+= 90; - } - if(screen->animtimer) { - uiDefIconTextBut(block, BUT, B_STOPANIM, ICON_REC, "Anim Player", xco+5,yco,85,19, NULL, 0.0f, 0.0f, 0, 0, "Stop animation playback"); - xco+= 90; - } - - { - static char search[256]= ""; - uiBut *but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, xco+5, yco, 120, 19, ""); - - uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb, NULL); - - xco+= 125; - } - - - /* always as last */ - UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); - - uiEndBlock(C, block); - uiDrawBlock(C, block); -} - - diff --git a/source/blender/editors/space_info/info_intern.h b/source/blender/editors/space_info/info_intern.h index 213c0688f20..519364b58d9 100644 --- a/source/blender/editors/space_info/info_intern.h +++ b/source/blender/editors/space_info/info_intern.h @@ -30,10 +30,17 @@ /* internal exports only */ +struct wmOperatorType; /* info_header.c */ void info_header_buttons(const bContext *C, ARegion *ar); +void FILE_OT_pack_all(struct wmOperatorType *ot); +void FILE_OT_unpack_all(struct wmOperatorType *ot); +void FILE_OT_make_paths_relative(struct wmOperatorType *ot); +void FILE_OT_make_paths_absolute(struct wmOperatorType *ot); +void FILE_OT_report_missing_files(struct wmOperatorType *ot); +void FILE_OT_find_missing_files(struct wmOperatorType *ot); #endif /* ED_INFO_INTERN_H */ diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c new file mode 100644 index 00000000000..56f925a2e81 --- /dev/null +++ b/source/blender/editors/space_info/info_ops.c @@ -0,0 +1,397 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2008 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "DNA_packedFile_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_userdef_types.h" +#include "DNA_windowmanager_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" +#include "BLI_bpath.h" + +#include "BKE_context.h" +#include "BKE_global.h" +#include "BKE_image.h" +#include "BKE_main.h" +#include "BKE_packedFile.h" +#include "BKE_report.h" +#include "BKE_screen.h" + +#include "ED_screen.h" +#include "ED_types.h" +#include "ED_util.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "BIF_gl.h" +#include "BIF_glutil.h" + +#include "UI_interface.h" +#include "UI_resources.h" + +#include "IMB_imbuf_types.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "WM_types.h" + +#include "info_intern.h" + +/********************* pack all operator *********************/ + +static int pack_all_exec(bContext *C, wmOperator *op) +{ + Main *bmain= CTX_data_main(C); + + packAll(bmain, op->reports); + G.fileflags |= G_AUTOPACK; + + return OPERATOR_FINISHED; +} + +static int pack_all_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + Main *bmain= CTX_data_main(C); + Image *ima; + ImBuf *ibuf; + + // first check for dirty images + for(ima=bmain->image.first; ima; ima=ima->id.next) { + if(ima->ibufs.first) { /* XXX FIX */ + ibuf= BKE_image_get_ibuf(ima, NULL); + + if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) + break; + } + } + + if(ima) { + uiPupMenuOkee(C, "FILE_OT_pack_all", "Some images are painted on. These changes will be lost. Continue?"); + return OPERATOR_CANCELLED; + } + + return pack_all_exec(C, op); +} + +void FILE_OT_pack_all(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Pack All"; + ot->idname= "FILE_OT_pack_all"; + + /* api callbacks */ + ot->exec= pack_all_exec; + ot->invoke= pack_all_invoke; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************* unpack all operator *********************/ + +static const EnumPropertyItem unpack_all_method_items[] = { + {PF_USE_LOCAL, "USE_LOCAL", 0, "Use files in current directory (create when necessary)", ""}, + {PF_WRITE_LOCAL, "WRITE_LOCAL", 0, "Write files to current directory (overwrite existing files)", ""}, + {PF_USE_ORIGINAL, "USE_ORIGINAL", 0, "Use files in original location (create when necessary)", ""}, + {PF_WRITE_ORIGINAL, "WRITE_ORIGINAL", 0, "Write files to original location (overwrite existing files)", ""}, + {PF_KEEP, "KEEP", 0, "Disable AutoPack, keep all packed files", ""}, + {PF_ASK, "ASK", 0, "Ask for each file", ""}, + {0, NULL, 0, NULL, NULL}}; + +static int unpack_all_exec(bContext *C, wmOperator *op) +{ + Main *bmain= CTX_data_main(C); + int method= RNA_enum_get(op->ptr, "method"); + + if(method != PF_KEEP) unpackAll(bmain, op->reports, method); /* XXX PF_ASK can't work here */ + G.fileflags &= ~G_AUTOPACK; + + return OPERATOR_FINISHED; +} + +static int unpack_all_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + Main *bmain= CTX_data_main(C); + uiPopupMenu *pup; + uiLayout *layout; + char title[128]; + int count = 0; + + count = countPackedFiles(bmain); + + if(!count) { + BKE_report(op->reports, RPT_WARNING, "No packed files. Autopack disabled."); + G.fileflags &= ~G_AUTOPACK; + return OPERATOR_CANCELLED; + } + + if(count == 1) + sprintf(title, "Unpack 1 file"); + else + sprintf(title, "Unpack %d files", count); + + pup= uiPupMenuBegin(C, title, 0); + layout= uiPupMenuLayout(pup); + + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); + uiItemsEnumO(layout, "FILE_OT_unpack_all", "method"); + + uiPupMenuEnd(C, pup); + + return OPERATOR_CANCELLED; +} + +void FILE_OT_unpack_all(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Unpack All"; + ot->idname= "FILE_OT_unpack_all"; + + /* api callbacks */ + ot->exec= unpack_all_exec; + ot->invoke= unpack_all_invoke; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_enum(ot->srna, "method", unpack_all_method_items, PF_USE_LOCAL, "Method", "How to unpack."); +} + +/********************* make paths relative operator *********************/ + +static int make_paths_relative_exec(bContext *C, wmOperator *op) +{ + char txtname[24]; /* text block name */ + int tot, changed, failed, linked; + + if(!G.relbase_valid) { + BKE_report(op->reports, RPT_WARNING, "Can't set relative paths with an unsaved blend file."); + return OPERATOR_CANCELLED; + } + + txtname[0] = '\0'; + makeFilesRelative(txtname, &tot, &changed, &failed, &linked); + + if(failed) + BKE_reportf(op->reports, RPT_ERROR, "Total files %i|Changed %i|Failed %i, See Text \"%s\"|Linked %i", tot, changed, failed, txtname, linked); + else + BKE_reportf(op->reports, RPT_INFO, "Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); + + return OPERATOR_FINISHED; +} + +void FILE_OT_make_paths_relative(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Make All Paths Relative"; + ot->idname= "FILE_OT_make_paths_relative"; + + /* api callbacks */ + ot->exec= make_paths_relative_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************* make paths absolute operator *********************/ + +static int make_paths_absolute_exec(bContext *C, wmOperator *op) +{ + char txtname[24]; /* text block name */ + int tot, changed, failed, linked; + + if(!G.relbase_valid) { + BKE_report(op->reports, RPT_WARNING, "Can't set absolute paths with an unsaved blend file."); + return OPERATOR_CANCELLED; + } + + txtname[0] = '\0'; + makeFilesAbsolute(txtname, &tot, &changed, &failed, &linked); + + if(failed) + BKE_reportf(op->reports, RPT_ERROR, "Total files %i|Changed %i|Failed %i, See Text \"%s\"|Linked %i", tot, changed, failed, txtname, linked); + else + BKE_reportf(op->reports, RPT_INFO, "Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); + + return OPERATOR_FINISHED; +} + +void FILE_OT_make_paths_absolute(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Make All Paths Absolute"; + ot->idname= "FILE_OT_make_paths_absolute"; + + /* api callbacks */ + ot->exec= make_paths_absolute_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************* report missing files operator *********************/ + +static int report_missing_files_exec(bContext *C, wmOperator *op) +{ + char txtname[24]; /* text block name */ + + txtname[0] = '\0'; + + /* run the missing file check */ + checkMissingFiles(txtname); + + if(txtname[0] == '\0') + BKE_report(op->reports, RPT_INFO, "No external files missing."); + else + BKE_reportf(op->reports, RPT_ERROR, "Missing files listed in Text \"%s\"", txtname); + + return OPERATOR_FINISHED; +} + +void FILE_OT_report_missing_files(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Report Missing Files..."; + ot->idname= "FILE_OT_report_missing_files"; + + /* api callbacks */ + ot->exec= report_missing_files_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************* find missing files operator *********************/ + +static int find_missing_files_exec(bContext *C, wmOperator *op) +{ + char *filename; + + filename= RNA_string_get_alloc(op->ptr, "filename", NULL, 0); + findMissingFiles(filename); + MEM_freeN(filename); + + return OPERATOR_FINISHED; +} + +static int find_missing_files_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + /* XXX file open button text "Find Missing Files" */ + WM_event_add_fileselect(C, op); + return OPERATOR_RUNNING_MODAL; +} + +void FILE_OT_find_missing_files(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Find Missing Files..."; + ot->idname= "FILE_OT_find_missing_files"; + + /* api callbacks */ + ot->exec= find_missing_files_exec; + ot->invoke= find_missing_files_invoke; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_string_file_path(ot->srna, "filename", "", FILE_MAX, "Filename", "File path of image to open."); +} + +#if 0 +static void info_filemenu(bContext *C, uiLayout *layout, void *arg_unused) +{ + + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_AREA); + uiItemO(layout, NULL, 0, "WM_OT_read_homefile"); + uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_AREA); + uiItemO(layout, NULL, 0, "WM_OT_open_mainfile"); +// uiDefIconTextBlockBut(block, info_openrecentmenu, NULL, ICON_RIGHTARROW_THIN, "Open Recent",0, yco-=20, 120, 19, ""); +// uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recover Last Session", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); + + uiItemS(layout); + + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_AREA); + uiItemO(layout, NULL, 0, "WM_OT_save_mainfile"); + uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_AREA); + uiItemO(layout, NULL, 0, "WM_OT_save_as_mainfile"); + +#if 0 + if(U.flag & USER_FILECOMPRESS) { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Compress File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 35, "Enable file compression"); + } else { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Compress File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 35, "Enable file compression"); + } + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Rendered Image...|F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Screenshot Subwindow|Ctrl F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 24, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Screenshot All|Ctrl Shift F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 25, ""); +#if GAMEBLENDER == 1 + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Game As Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, ""); +#endif + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Default Settings|Ctrl U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 31, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Load Factory Settings", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 32, ""); + + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Append or Link|Shift F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Append or Link (Image Browser)|Ctrl F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); +// uiDefIconTextBlockBut(block, info_file_importmenu, NULL, ICON_RIGHTARROW_THIN, "Import", 0, yco-=20, menuwidth, 19, ""); +// uiDefIconTextBlockBut(block, info_file_exportmenu, NULL, ICON_RIGHTARROW_THIN, "Export", 0, yco-=20, menuwidth, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, info_externalfiles, NULL, ICON_RIGHTARROW_THIN, "External Data",0, yco-=20, 120, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Quit Blender|Ctrl Q", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); + uiBlockSetDirection(block, UI_DOWN); + uiTextBoundsBlock(block, 80); + + uiEndBlock(C, block); + return block; +#endif +} +#endif + diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index d72ecd60da9..7b24e8f4e07 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -151,7 +151,12 @@ static void info_main_area_draw(const bContext *C, ARegion *ar) void info_operatortypes(void) { - + WM_operatortype_append(FILE_OT_pack_all); + WM_operatortype_append(FILE_OT_unpack_all); + WM_operatortype_append(FILE_OT_make_paths_relative); + WM_operatortype_append(FILE_OT_make_paths_absolute); + WM_operatortype_append(FILE_OT_report_missing_files); + WM_operatortype_append(FILE_OT_find_missing_files); } void info_keymap(struct wmWindowManager *wm) @@ -162,29 +167,12 @@ void info_keymap(struct wmWindowManager *wm) /* add handlers, stuff you only do once or on area/region changes */ static void info_header_area_init(wmWindowManager *wm, ARegion *ar) { - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); + ED_region_header_init(ar); } static void info_header_area_draw(const bContext *C, ARegion *ar) { - float col[3]; - - /* clear */ - if(ED_screen_area_active(C)) - UI_GetThemeColor3fv(TH_HEADER, col); - else - UI_GetThemeColor3fv(TH_HEADERDESEL, col); - - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - /* set view2d view matrix for scrolling (without scrollers) */ - UI_view2d_view_ortho(C, &ar->v2d); - - info_header_buttons(C, ar); - - /* restore view matrix? */ - UI_view2d_view_restore(C); + ED_region_header(C, ar); } static void info_main_area_listener(ARegion *ar, wmNotifier *wmn) diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index a4aa60775f2..b70112eebed 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -266,6 +266,11 @@ void RNA_api_ui_layout(StructRNA *srna) parm= RNA_def_boolean(func, "compact", 0, "", "Use compact, single row list template."); parm= RNA_def_collection(func, "items", 0, "", "Items visible in the list."); RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "template_running_jobs", "uiTemplateRunningJobs"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); + + func= RNA_def_function(srna, "template_operator_search", "uiTemplateOperatorSearch"); } #endif diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index b7e3c86dd91..60a9afda0c4 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -353,7 +353,8 @@ PyObject *PYOP_wrap_add(PyObject *self, PyObject *py_class) /* remove if it already exists */ if ((ot=WM_operatortype_find(idname))) { - Py_XDECREF((PyObject*)ot->pyop_data); + if(ot->pyop_data) + Py_XDECREF((PyObject*)ot->pyop_data); WM_operatortype_remove(idname); } diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 861080f30ba..29ec58befd9 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -575,7 +575,7 @@ void WM_write_file(bContext *C, char *target, ReportList *reports) // } if (G.fileflags & G_AUTOPACK) { - packAll(); + packAll(G.main, reports); } ED_object_exit_editmode(C, 0); -- cgit v1.2.3 From a50dfe7ce495dd93d220572a0bb145fd6224d161 Mon Sep 17 00:00:00 2001 From: Shaul Kedem Date: Tue, 30 Jun 2009 19:29:40 +0000 Subject: second part of python2.6 upgrade in cmake, now it will copy the dlls too --- source/creator/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index ade5a2a64a8..cd0d551211f 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -151,7 +151,7 @@ IF(WIN32) COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\ui\\*.*\" \"${TARGETDIR}\\.blender\\ui\" COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\plugins\\*.*\" \"${TARGETDIR}\\plugins\" COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\text\\*.*\" \"${TARGETDIR}\" - COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\windows\\extra\\python25.zip\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\windows\\extra\\python26.zip\" \"${TARGETDIR}\\\" ) FILE(TO_NATIVE_PATH "${LIBDIR}" WIN_LIBDIR) @@ -164,7 +164,8 @@ IF(WIN32) COMMAND copy /Y \"${WIN_LIBDIR}\\sdl\\lib\\SDL.dll\" \"${TARGETDIR}\\\" COMMAND copy /Y \"${WIN_LIBDIR}\\zlib\\lib\\zlib.dll\" \"${TARGETDIR}\\\" COMMAND copy /Y \"${WIN_LIBDIR}\\tiff\\lib\\libtiff.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python25.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python26.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python26_d.dll\" \"${TARGETDIR}\\\" COMMAND copy /Y \"${WIN_LIBDIR}\\pthreads\\lib\\pthreadVC2.dll\" \"${TARGETDIR}\\\" ) -- cgit v1.2.3 From 03e11e1e55efe0b39cec9a85be7c449e3274ab21 Mon Sep 17 00:00:00 2001 From: Tom Musgrove Date: Tue, 30 Jun 2009 20:14:53 +0000 Subject: Reverting changes made for laptop/two button mice - will make the changes available as a patch. --- source/blender/editors/interface/view2d_ops.c | 6 +----- source/blender/editors/space_image/space_image.c | 2 -- source/blender/editors/space_text/space_text.c | 2 -- source/blender/editors/space_view3d/view3d_ops.c | 6 ------ 4 files changed, 1 insertion(+), 15 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index b86150f86bf..bd1c734b870 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1356,8 +1356,7 @@ void UI_view2d_keymap(wmWindowManager *wm) /* pan/scroll */ WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "VIEW2D_OT_pan", LEFTMOUSE, KM_PRESS, KM_ALT, 0); - + WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_right", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_left", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0); @@ -1380,7 +1379,6 @@ void UI_view2d_keymap(wmWindowManager *wm) /* zoom - drag */ WM_keymap_add_item(keymap, "VIEW2D_OT_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "VIEW2D_OT_zoom", LEFTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0); /* no MMB on laptops */ /* borderzoom - drag */ WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_border", BKEY, KM_PRESS, KM_SHIFT, 0); @@ -1391,11 +1389,9 @@ void UI_view2d_keymap(wmWindowManager *wm) /* Alternative keymap for buttons listview */ keymap= WM_keymap_listbase(wm, "View2D Buttons List", 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "VIEW2D_OT_pan", LEFTMOUSE, KM_PRESS, KM_ALT, 0); /* no MMB on laptops */ WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_down", WHEELDOWNMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_up", WHEELUPMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "VIEW2D_OT_zoom", LEFTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0); /* no MMB on laptops */ WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_out", PADMINUS, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_in", PADPLUSKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_reset", HOMEKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index d05511b67ba..7d6faa00dfc 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -216,14 +216,12 @@ void image_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "IMAGE_OT_view_all", HOMEKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_pan", MIDDLEMOUSE, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "IMAGE_OT_view_pan", LEFTMOUSE, KM_PRESS, KM_ALT, 0); /* no MMB on laptops */ WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_in", WHEELINMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_out", WHEELOUTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_in", PADPLUSKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_out", PADMINUS, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom", LEFTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0); /* no MMB on laptops */ RNA_float_set(WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_ratio", PAD8, KM_PRESS, KM_SHIFT, 0)->ptr, "ratio", 8.0f); RNA_float_set(WM_keymap_add_item(keymap, "IMAGE_OT_view_zoom_ratio", PAD4, KM_PRESS, KM_SHIFT, 0)->ptr, "ratio", 4.0f); diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index fb05e3ecaac..8759fd00f74 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -276,8 +276,6 @@ static void text_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "TEXT_OT_overwrite_toggle", INSERTKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "TEXT_OT_scroll", MIDDLEMOUSE, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "TEXT_OT_scroll", LEFTMOUSE, KM_PRESS, KM_ALT, 0); /* no MMB on laptops */ - WM_keymap_add_item(keymap, "TEXT_OT_scroll_bar", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "TEXT_OT_cursor_set", LEFTMOUSE, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "TEXT_OT_cursor_set", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "select", 1); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 9505e3be4fd..6cb1051ce4a 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -139,14 +139,8 @@ void view3d_keymap(wmWindowManager *wm) WM_keymap_verify_item(keymap, "VIEW3D_OT_cursor3d", ACTIONMOUSE, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "VIEW3D_OT_viewrotate", MIDDLEMOUSE, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "VIEW3D_OT_viewrotate", LEFTMOUSE, KM_PRESS, KM_ALT, 0); /* no MMB on laptops */ - WM_keymap_verify_item(keymap, "VIEW3D_OT_viewmove", MIDDLEMOUSE, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "VIEW3D_OT_viewmove", LEFTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0); /* no MMB on laptops */ - WM_keymap_verify_item(keymap, "VIEW3D_OT_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "VIEW3D_OT_zoom", LEFTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0); /* no MMB on laptops */ - WM_keymap_verify_item(keymap, "VIEW3D_OT_viewcenter", PADPERIOD, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "VIEW3D_OT_smoothview", TIMER1, KM_ANY, KM_ANY, 0); -- cgit v1.2.3 From 60c2599a1a5990c66eb8e7c4d9d9959526a3cc2d Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Tue, 30 Jun 2009 20:34:00 +0000 Subject: 2.5 filebrowser * show only name of the last directory for the bookmark * small fix of projectfile: header BLI_fileops.h was moved Note: full path should appear in tool tip later, also for renaming bookmarks later on. --- source/blender/blenlib/BLI_util.h | 1 + source/blender/blenlib/intern/util.c | 19 +++++++++++++++++++ source/blender/editors/space_file/file_panels.c | 14 ++++++++++++-- 3 files changed, 32 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenlib/BLI_util.h b/source/blender/blenlib/BLI_util.h index 30c9fc353b3..a138ea780ea 100644 --- a/source/blender/blenlib/BLI_util.h +++ b/source/blender/blenlib/BLI_util.h @@ -50,6 +50,7 @@ void BLI_make_existing_file(char *name); void BLI_split_dirfile(char *string, char *dir, char *file); void BLI_split_dirfile_basic(const char *string, char *dir, char *file); void BLI_join_dirfile(char *string, const char *dir, const char *file); +void BLI_getlastdir(const char* dir, char *last, int maxlen); int BLI_testextensie(const char *str, const char *ext); void BLI_uniquename(struct ListBase *list, void *vlink, char defname[], char delim, short name_offs, short len); void BLI_newname(char * name, int add); diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 26f4c2dd415..b9d4daaf5b2 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -736,6 +736,25 @@ void BLI_splitdirstring(char *di, char *fi) } } +void BLI_getlastdir(const char* dir, char *last, int maxlen) +{ + char *s = dir; + char *lslash = NULL; + char *prevslash = NULL; + while (*s) { + if ((*s == '\\') || (*s == '/')) { + prevslash = lslash; + lslash = s; + } + s++; + } + if (prevslash) { + BLI_strncpy(last, prevslash+1, maxlen); + } else { + BLI_strncpy(last, dir, maxlen); + } +} + char *BLI_gethome(void) { #if !defined(WIN32) return getenv("HOME"); diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index a9a93d93de0..29c759d43c0 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -69,9 +69,19 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat uiBlockSetEmboss(block, UI_EMBOSSP); uiBlockBeginAlign(block); for (i=0; i< nentries;++i) { + char dir[FILE_MAX]; + char temp[FILE_MAX]; uiLayout* layout = uiLayoutRow(pa->layout, UI_LAYOUT_ALIGN_LEFT); - char *fname = fsmenu_get_entry(fsmenu, category, i); - uiItemStringO(layout, fname, icon, "FILE_OT_select_bookmark", "dir", fname); + char *entry = fsmenu_get_entry(fsmenu, category, i); + + /* create nice bookmark name, shows last directory in the full path currently */ + BLI_strncpy(temp, entry, FILE_MAX); + BLI_add_slash(temp); + BLI_getlastdir(temp, dir, FILE_MAX); + BLI_del_slash(dir); + + /* operator shows the short bookmark name, should eventually have tooltip */ + uiItemStringO(layout, dir, icon, "FILE_OT_select_bookmark", "dir", entry); if (allow_delete && fsmenu_can_save(fsmenu, category, i) ) uiItemIntO(layout, "", ICON_X, "FILE_OT_delete_bookmark", "index", i); } -- cgit v1.2.3 From 5403edf8ff266fc8829525b5784c53598f8c4e0f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 30 Jun 2009 21:59:21 +0000 Subject: disabling foreach_get/set for python2.x, since it uses new buffer api. --- source/blender/python/intern/bpy_rna.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 53f7f532b8b..e13f02c5529 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1225,6 +1225,7 @@ static PyObject *pyrna_prop_values(BPy_PropertyRNA *self) return ret; } +#if (PY_VERSION_HEX >= 0x03000000) /* foreach needs py3 */ static void foreach_attr_type( BPy_PropertyRNA *self, char *attr, /* values to assign */ RawPropertyType *raw_type, int *attr_tot, int *attr_signed ) @@ -1457,7 +1458,7 @@ static PyObject *pyrna_prop_foreach_set(BPy_PropertyRNA *self, PyObject *args) { return foreach_getset(self, args, 1); } - +#endif /* #if (PY_VERSION_HEX >= 0x03000000) */ /* A bit of a kludge, make a list out of a collection or array, * then return the lists iter function, not especially fast but convenient for now */ @@ -1502,9 +1503,11 @@ static struct PyMethodDef pyrna_prop_methods[] = { {"items", (PyCFunction)pyrna_prop_items, METH_NOARGS,NULL}, {"values", (PyCFunction)pyrna_prop_values, METH_NOARGS, NULL}, +#if (PY_VERSION_HEX >= 0x03000000) /* array accessor function */ {"foreach_get", (PyCFunction)pyrna_prop_foreach_get, METH_VARARGS, NULL}, {"foreach_set", (PyCFunction)pyrna_prop_foreach_set, METH_VARARGS, NULL}, +#endif {NULL, NULL, 0, NULL} }; -- cgit v1.2.3 From 0fabb2039b3e85ae7b7b712e5dc1b7ba22929440 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Tue, 30 Jun 2009 23:06:50 +0000 Subject: 2.5/Sculpt: == Re-added smooth stroke == UI: toggle is just in the sculpt menu for now. Also changes the sculpt paint cursor slightly, draws a line between previous and current locations. It's a different implementation than in 2.4, works like this: The stroke interpolates between the last mouse location and the current location, weighted towards the previous location. If the stroke gets within a certain radius of the current mouse location, the stroke stops. This radius allows for sharp turns in the stroke. Todo: there are two hard-coded parameters that should become user settable, that's the weighting between previous and current locations, and most important, the no-update radius. Note also that this option was added as a per-brush flag, worth discussing whether that's the correct place, or whether it should be a sculpt setting like symmetry? == Improved stroke spacing == The previous implementation of stroke spacing simply guaranteed that stroke dots would not occur any closer than the space setting. It now forces stroke dots to always be the specified distance apart. Todo: Performance gets pretty awful with a small spacing setting, this needs optimization. --- source/blender/editors/sculpt_paint/sculpt.c | 144 ++++++++++++++++----- .../blender/editors/space_view3d/view3d_header.c | 1 + source/blender/makesdna/DNA_brush_types.h | 1 + source/blender/makesrna/intern/rna_brush.c | 4 + 4 files changed, 119 insertions(+), 31 deletions(-) (limited to 'source') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 8f0b52ef3a1..a2b883eabfc 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -156,7 +156,6 @@ typedef struct StrokeCache { float old_grab_location[3]; int symmetry; /* Symmetry index between 0 and 7 */ float view_normal[3], view_normal_symmetry[3]; - int last_dot[2]; /* Last location of stroke application */ int last_rake[2]; /* Last location of updating rake rotation */ } StrokeCache; @@ -849,15 +848,6 @@ static void do_symmetrical_brush_actions(Sculpt *sd, StrokeCache *cache) const char symm = sd->flags & 7; int i; - /* Brush spacing: only apply dot if next dot is far enough away */ - if((sd->brush->flag & BRUSH_SPACE) && !(sd->brush->flag & BRUSH_ANCHORED) && !cache->first_time) { - int dx = cache->last_dot[0] - cache->mouse[0]; - int dy = cache->last_dot[1] - cache->mouse[1]; - if(sqrt(dx*dx+dy*dy) < sd->brush->spacing) - return; - } - memcpy(cache->last_dot, cache->mouse, sizeof(int) * 2); - VecCopyf(cache->location, cache->true_location); VecCopyf(cache->grab_delta_symmetry, cache->grab_delta); cache->symmetry = 0; @@ -1050,16 +1040,21 @@ static void draw_paint_cursor(bContext *C, int x, int y, void *customdata) { Sculpt *sd= CTX_data_tool_settings(C)->sculpt; - glTranslatef((float)x, (float)y, 0.0f); - glColor4ub(255, 100, 100, 128); glEnable( GL_LINE_SMOOTH ); glEnable(GL_BLEND); + + glTranslatef((float)x, (float)y, 0.0f); glutil_draw_lined_arc(0.0, M_PI*2.0, sd->brush->size, 40); + glTranslatef((float)-x, (float)-y, 0.0f); + + if(sd->session && sd->session->cache && sd->brush && (sd->brush->flag & BRUSH_SMOOTH_STROKE)) { + ARegion *ar = CTX_wm_region(C); + sdrawline(x, y, sd->session->cache->mouse[0] - ar->winrct.xmin, sd->session->cache->mouse[1] - ar->winrct.ymin); + } + glDisable(GL_BLEND); glDisable( GL_LINE_SMOOTH ); - - glTranslatef((float)-x, (float)-y, 0.0f); } static void toggle_paint_cursor(bContext *C) @@ -1202,6 +1197,9 @@ static void sculpt_update_cache_invariants(Sculpt *sd, bContext *C, wmOperator * RNA_int_get_array(op->ptr, "initial_mouse", cache->initial_mouse); cache->depth = RNA_float_get(op->ptr, "depth"); + cache->mouse[0] = cache->initial_mouse[0]; + cache->mouse[1] = cache->initial_mouse[1]; + /* Truly temporary data that isn't stored in properties */ view3d_set_viewcontext(C, &cache->vc); @@ -1407,13 +1405,99 @@ static void sculpt_flush_update(bContext *C) ED_region_tag_redraw(ar); } -static int sculpt_brush_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) +/* Returns zero if no sculpt changes should be made, non-zero otherwise */ +static int sculpt_smooth_stroke(Sculpt *s, int output[2], wmEvent *event) { + output[0] = event->x; + output[1] = event->y; + + if(s->brush->flag & BRUSH_SMOOTH_STROKE && s->brush->sculpt_tool != SCULPT_TOOL_GRAB) { + StrokeCache *cache = s->session->cache; + float u = .9, v = 1.0 - u; + int dx = cache->mouse[0] - event->x, dy = cache->mouse[1] - event->y; + int radius = 50; + + /* If the mouse is moving within the radius of the last move, + don't update the mouse position. This allows sharp turns. */ + if(dx*dx + dy*dy < radius*radius) + return 0; + + output[0] = event->x * v + cache->mouse[0] * u; + output[1] = event->y * v + cache->mouse[1] * u; + } + + return 1; +} + +/* Returns zero if the stroke dots should not be spaced, non-zero otherwise */ +int sculpt_space_stroke_enabled(Sculpt *s) +{ + Brush *br = s->brush; + return (br->flag & BRUSH_SPACE) && !(br->flag & BRUSH_ANCHORED) && (br->sculpt_tool != SCULPT_TOOL_GRAB); +} + +/* Put the location of the next sculpt stroke dot into the stroke RNA and apply it to the mesh */ +static void sculpt_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *event, int mouse[2]) +{ + Sculpt *sd = CTX_data_tool_settings(C)->sculpt; + StrokeCache *cache = sd->session->cache; PointerRNA itemptr; + float cur_depth; + float center[3]; + + cur_depth = read_cached_depth(&cache->vc, mouse[0], mouse[1]); + unproject(sd->session->cache->mats, center, mouse[0], mouse[1], cur_depth); + + /* Add to stroke */ + RNA_collection_add(op->ptr, "stroke", &itemptr); + RNA_float_set_array(&itemptr, "location", center); + RNA_int_set_array(&itemptr, "mouse", mouse); + RNA_boolean_set(&itemptr, "flip", event->shift); + sculpt_update_cache_variants(sd, &itemptr); + + sculpt_restore_mesh(sd); + do_symmetrical_brush_actions(sd, cache); + + sculpt_post_stroke_free(sd->session); +} + +/* For brushes with stroke spacing enabled, moves mouse in steps + towards the final mouse location. */ +static int sculpt_space_stroke(bContext *C, wmOperator *op, wmEvent *event, Sculpt *s, const int final_mouse[2]) +{ + StrokeCache *cache = s->session->cache; + int cnt = 0; + + if(sculpt_space_stroke_enabled(s)) { + float vec[2] = {final_mouse[0] - cache->mouse[0], final_mouse[1] - cache->mouse[1]}; + int mouse[2] = {cache->mouse[0], cache->mouse[1]}; + float length, scale; + int steps = 0, i; + + /* Normalize the vector between the last stroke dot and the goal */ + length = sqrt(vec[0]*vec[0] + vec[1]*vec[1]); + + if(length > FLT_EPSILON) { + scale = s->brush->spacing / length; + vec[0] *= scale; + vec[1] *= scale; + + steps = (int)(length / s->brush->spacing); + for(i = 0; i < steps; ++i, ++cnt) { + mouse[0] += vec[0]; + mouse[1] += vec[1]; + sculpt_brush_stroke_add_step(C, op, event, mouse); + } + } + } + + return cnt; +} + +static int sculpt_brush_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) +{ Sculpt *sd = CTX_data_tool_settings(C)->sculpt; ARegion *ar = CTX_wm_region(C); - float center[3]; - int mouse[2] = {event->x, event->y}; float cur_depth; sculpt_update_mesh_elements(C); @@ -1433,21 +1517,19 @@ static int sculpt_brush_stroke_modal(bContext *C, wmOperator *op, wmEvent *event } if(sd->session->cache) { - cur_depth = read_cached_depth(&sd->session->cache->vc, event->x, event->y); - unproject(sd->session->cache->mats, center, event->x, event->y, cur_depth); - - /* Add to stroke */ - RNA_collection_add(op->ptr, "stroke", &itemptr); - RNA_float_set_array(&itemptr, "location", center); - RNA_int_set_array(&itemptr, "mouse", mouse); - RNA_boolean_set(&itemptr, "flip", event->shift); - sculpt_update_cache_variants(sd, &itemptr); + int mouse[2]; - sculpt_restore_mesh(sd); - do_symmetrical_brush_actions(CTX_data_tool_settings(C)->sculpt, sd->session->cache); - - sculpt_flush_update(C); - sculpt_post_stroke_free(sd->session); + if(sculpt_smooth_stroke(sd, mouse, event)) { + if(sculpt_space_stroke_enabled(sd)) { + if(!sculpt_space_stroke(C, op, event, sd, mouse)) + ED_region_tag_redraw(ar); + } + else + sculpt_brush_stroke_add_step(C, op, event, mouse); + sculpt_flush_update(C); + } + else + ED_region_tag_redraw(ar); } /* Finished */ diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 79ea90864f3..5edcd203e16 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -4557,6 +4557,7 @@ static void view3d_sculpt_menu(bContext *C, uiLayout *layout, void *arg_unused) uiItemR(layout, NULL, 0, &rna, "rake", 0, 0, 0); uiItemR(layout, NULL, 0, &rna, "anchored", 0, 0, 0); uiItemR(layout, NULL, 0, &rna, "space", 0, 0, 0); + uiItemR(layout, NULL, 0, &rna, "smooth_stroke", 0, 0, 0); uiItemR(layout, NULL, 0, &rna, "flip_direction", 0, 0, 0); } diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 8ce0b439b29..93a974c1180 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -84,6 +84,7 @@ typedef struct Brush { #define BRUSH_ANCHORED 256 #define BRUSH_DIR_IN 512 #define BRUSH_SPACE 1024 +#define BRUSH_SMOOTH_STROKE 2048 /* Brush.blend */ #define BRUSH_BLEND_MIX 0 diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 90617d01833..7355261c5aa 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -184,6 +184,10 @@ void rna_def_brush(BlenderRNA *brna) prop= RNA_def_property(srna, "space", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE); RNA_def_property_ui_text(prop, "Space", "Limit brush application to the distance specified by spacing."); + + prop= RNA_def_property(srna, "smooth_stroke", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SMOOTH_STROKE); + RNA_def_property_ui_text(prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path."); /* not exposed in the interface yet prop= RNA_def_property(srna, "fixed_tex", PROP_BOOLEAN, PROP_NONE); -- cgit v1.2.3 From 66c86278204a3b9fac090c36539ce8efcb2bf0ba Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 1 Jul 2009 01:17:58 +0000 Subject: NLA SoC: Renamed a few options for the Mirror operators since their purpose wasn't clear (in practice) --- source/blender/editors/space_action/action_edit.c | 8 ++++---- source/blender/editors/space_action/action_header.c | 16 ++++++++-------- source/blender/editors/space_graph/graph_edit.c | 8 ++++---- source/blender/editors/space_graph/graph_header.c | 16 ++++++++-------- 4 files changed, 24 insertions(+), 24 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 505ff18d7bd..910bcbef7e0 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -1198,10 +1198,10 @@ void ACT_OT_snap (wmOperatorType *ot) /* defines for mirror keyframes tool */ EnumPropertyItem prop_actkeys_mirror_types[] = { - {ACTKEYS_MIRROR_CFRA, "CFRA", 0, "Current frame", ""}, - {ACTKEYS_MIRROR_YAXIS, "YAXIS", 0, "Vertical Axis", ""}, - {ACTKEYS_MIRROR_XAXIS, "XAXIS", 0, "Horizontal Axis", ""}, - {ACTKEYS_MIRROR_MARKER, "MARKER", 0, "First Selected Marker", ""}, + {ACTKEYS_MIRROR_CFRA, "CFRA", 0, "By Times over Current frame", ""}, + {ACTKEYS_MIRROR_YAXIS, "YAXIS", 0, "By Times over Time=0", ""}, + {ACTKEYS_MIRROR_XAXIS, "XAXIS", 0, "By Values over Value=0", ""}, + {ACTKEYS_MIRROR_MARKER, "MARKER", 0, "By Times over First Selected Marker", ""}, {0, NULL, 0, NULL, NULL} }; diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index b2614411002..f4bb5b335a4 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -167,18 +167,18 @@ static void act_edit_transformmenu(bContext *C, uiLayout *layout, void *arg_unus static void act_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiItemEnumO(layout, "To Current Frame", 0, "ACT_OT_snap", "mode", ACTKEYS_SNAP_CFRA); - uiItemEnumO(layout, "To Nearest Frame", 0, "ACT_OT_snap", "mode", ACTKEYS_SNAP_NEAREST_FRAME); - uiItemEnumO(layout, "To Nearest Second", 0, "ACT_OT_snap", "mode", ACTKEYS_SNAP_NEAREST_SECOND); - uiItemEnumO(layout, "To Nearest Marker", 0, "ACT_OT_snap", "mode", ACTKEYS_SNAP_NEAREST_MARKER); + uiItemEnumO(layout, NULL, 0, "ACT_OT_snap", "type", ACTKEYS_SNAP_CFRA); + uiItemEnumO(layout, NULL, 0, "ACT_OT_snap", "type", ACTKEYS_SNAP_NEAREST_FRAME); + uiItemEnumO(layout, NULL, 0, "ACT_OT_snap", "type", ACTKEYS_SNAP_NEAREST_SECOND); + uiItemEnumO(layout, NULL, 0, "ACT_OT_snap", "type", ACTKEYS_SNAP_NEAREST_MARKER); } static void act_edit_mirrormenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiItemEnumO(layout, "Over Current Frame", 0, "ACT_OT_mirror", "mode", ACTKEYS_MIRROR_CFRA); - uiItemEnumO(layout, "Over Vertical Axis", 0, "ACT_OT_mirror", "mode", ACTKEYS_MIRROR_YAXIS); - uiItemEnumO(layout, "Over Horizontal Axis", 0, "ACT_OT_mirror", "mode", ACTKEYS_MIRROR_XAXIS); - uiItemEnumO(layout, "Over Selected Marker", 0, "ACT_OT_mirror", "mode", ACTKEYS_MIRROR_MARKER); + uiItemEnumO(layout, NULL, 0, "ACT_OT_mirror", "type", ACTKEYS_MIRROR_CFRA); + uiItemEnumO(layout, NULL, 0, "ACT_OT_mirror", "type", ACTKEYS_MIRROR_YAXIS); + uiItemEnumO(layout, NULL, 0, "ACT_OT_mirror", "type", ACTKEYS_MIRROR_XAXIS); + uiItemEnumO(layout, NULL, 0, "ACT_OT_mirror", "type", ACTKEYS_MIRROR_MARKER); } static void act_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unused) diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 1fc4572b9c6..4ea14a365e4 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1581,10 +1581,10 @@ void GRAPH_OT_snap (wmOperatorType *ot) /* defines for mirror keyframes tool */ EnumPropertyItem prop_graphkeys_mirror_types[] = { - {GRAPHKEYS_MIRROR_CFRA, "CFRA", 0, "Current frame", ""}, - {GRAPHKEYS_MIRROR_YAXIS, "YAXIS", 0, "Vertical Axis", ""}, - {GRAPHKEYS_MIRROR_XAXIS, "XAXIS", 0, "Horizontal Axis", ""}, - {GRAPHKEYS_MIRROR_MARKER, "MARKER", 0, "First Selected Marker", ""}, + {GRAPHKEYS_MIRROR_CFRA, "CFRA", 0, "By Times over Current frame", ""}, + {GRAPHKEYS_MIRROR_YAXIS, "YAXIS", 0, "By Times over Time=0", ""}, + {GRAPHKEYS_MIRROR_XAXIS, "XAXIS", 0, "By Values over Value=0", ""}, + {GRAPHKEYS_MIRROR_MARKER, "MARKER", 0, "By Times over First Selected Marker", ""}, {0, NULL, 0, NULL, NULL} }; diff --git a/source/blender/editors/space_graph/graph_header.c b/source/blender/editors/space_graph/graph_header.c index b07bd4b0ded..6c12b44f082 100644 --- a/source/blender/editors/space_graph/graph_header.c +++ b/source/blender/editors/space_graph/graph_header.c @@ -157,18 +157,18 @@ static void graph_edit_transformmenu(bContext *C, uiLayout *layout, void *arg_un static void graph_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiItemEnumO(layout, "To Current Frame", 0, "GRAPH_OT_snap", "mode", GRAPHKEYS_SNAP_CFRA); - uiItemEnumO(layout, "To Nearest Frame", 0, "GRAPH_OT_snap", "mode", GRAPHKEYS_SNAP_NEAREST_FRAME); - uiItemEnumO(layout, "To Nearest Second", 0, "GRAPH_OT_snap", "mode", GRAPHKEYS_SNAP_NEAREST_SECOND); - uiItemEnumO(layout, "To Nearest Marker", 0, "GRAPH_OT_snap", "mode", GRAPHKEYS_SNAP_NEAREST_MARKER); + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_CFRA); + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_NEAREST_FRAME); + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_NEAREST_SECOND); + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_NEAREST_MARKER); } static void graph_edit_mirrormenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiItemEnumO(layout, "Over Current Frame", 0, "GRAPH_OT_mirror", "mode", GRAPHKEYS_MIRROR_CFRA); - uiItemEnumO(layout, "Over Vertical Axis", 0, "GRAPH_OT_mirror", "mode", GRAPHKEYS_MIRROR_YAXIS); - uiItemEnumO(layout, "Over Horizontal Axis", 0, "GRAPH_OT_mirror", "mode", GRAPHKEYS_MIRROR_XAXIS); - uiItemEnumO(layout, "Over Selected Marker", 0, "GRAPH_OT_mirror", "mode", GRAPHKEYS_MIRROR_MARKER); + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_mirror", "type", GRAPHKEYS_MIRROR_CFRA); + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_mirror", "type", GRAPHKEYS_MIRROR_YAXIS); + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_mirror", "type", GRAPHKEYS_MIRROR_XAXIS); + uiItemEnumO(layout, NULL, 0, "GRAPH_OT_mirror", "type", GRAPHKEYS_MIRROR_MARKER); } static void graph_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unused) -- cgit v1.2.3 From 82055c82170885249bf922b05a5c7a3186c07c71 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 1 Jul 2009 12:19:00 +0000 Subject: RNA * Mesh.add_geometry, Mesh.update and make indices editable. This is without checking if they are valid still, no time now to implement this. * Also fix warnings in rna_ui.c, and a bug in CDDM_calc_edges. Example code: co = [0.0, 0.0, 0.0] + [1.0, 0.0, 0.0] + [0.0, 1.0, 0.0] + [1.0, 1.0, 0.0] faces = [0, 1, 2, 0] + [1, 3, 2, 0] mesh.add_geometry(4, 0, 2) mesh.verts.foreach_set("co", co) mesh.faces.foreach_set("verts", faces) mesh.update() --- source/blender/blenkernel/intern/cdderivedmesh.c | 2 +- source/blender/makesrna/intern/rna_mesh.c | 5 +- source/blender/makesrna/intern/rna_mesh_api.c | 217 ++++++++++++++++++----- source/blender/makesrna/intern/rna_ui.c | 16 +- 4 files changed, 186 insertions(+), 54 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 57ef920f75b..706eece108c 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -1220,7 +1220,7 @@ void CDDM_calc_edges(DerivedMesh *dm) BLI_edgehashIterator_free(ehi); /* free old CustomData and assign new one */ - CustomData_free(&dm->edgeData, dm->numVertData); + CustomData_free(&dm->edgeData, dm->numEdgeData); dm->edgeData = edgeData; dm->numEdgeData = numEdges; diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index e56760f5ca3..41d64a8dbb9 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -716,8 +716,8 @@ static void rna_def_medge(BlenderRNA *brna) prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "v1"); RNA_def_property_array(prop, 2); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Vertices", "Vertex indices"); + // XXX allows creating invalid meshes prop= RNA_def_property(srna, "crease", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_MEdge_crease_get", "rna_MEdge_crease_set", NULL); @@ -758,8 +758,8 @@ static void rna_def_mface(BlenderRNA *brna) prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "v1"); RNA_def_property_array(prop, 4); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Vertices", "Vertex indices"); + // XXX allows creating invalid meshes prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "mat_nr"); @@ -1104,7 +1104,6 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "mvert", "totvert"); RNA_def_property_struct_type(prop, "MeshVertex"); RNA_def_property_ui_text(prop, "Vertices", "Vertices of the mesh."); - // XXX RNA_def_property_collection_funcs(prop, "rna_Mesh_verts_begin", 0, 0, 0, 0, 0, 0, "add_verts", "remove_verts"); prop= RNA_def_property(srna, "edges", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "medge", "totedge"); diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c index 26fb77777d7..c98b3fb7b09 100644 --- a/source/blender/makesrna/intern/rna_mesh_api.c +++ b/source/blender/makesrna/intern/rna_mesh_api.c @@ -34,74 +34,207 @@ #ifdef RNA_RUNTIME +#include "DNA_mesh_types.h" +#include "DNA_scene_types.h" + #include "BKE_customdata.h" +#include "BKE_depsgraph.h" #include "BKE_DerivedMesh.h" +#include "BKE_main.h" +#include "BKE_mesh.h" -#include "DNA_mesh_types.h" -#include "DNA_scene_types.h" +#include "BLI_edgehash.h" -/* -void rna_Mesh_copy(Mesh *me, Mesh *from) +#include "WM_api.h" +#include "WM_types.h" + +static void rna_Mesh_calc_edges(Mesh *mesh) { - copy_mesh_data(me, from); + CustomData edata; + EdgeHashIterator *ehi; + MFace *mf = mesh->mface; + MEdge *med; + EdgeHash *eh = BLI_edgehash_new(); + int i, *index, totedge, totface = mesh->totface; + + for (i = 0; i < totface; i++, mf++) { + if (!BLI_edgehash_haskey(eh, mf->v1, mf->v2)) + BLI_edgehash_insert(eh, mf->v1, mf->v2, NULL); + if (!BLI_edgehash_haskey(eh, mf->v2, mf->v3)) + BLI_edgehash_insert(eh, mf->v2, mf->v3, NULL); + + if (mf->v4) { + if (!BLI_edgehash_haskey(eh, mf->v3, mf->v4)) + BLI_edgehash_insert(eh, mf->v3, mf->v4, NULL); + if (!BLI_edgehash_haskey(eh, mf->v4, mf->v1)) + BLI_edgehash_insert(eh, mf->v4, mf->v1, NULL); + } else { + if (!BLI_edgehash_haskey(eh, mf->v3, mf->v1)) + BLI_edgehash_insert(eh, mf->v3, mf->v1, NULL); + } + } + + totedge = BLI_edgehash_size(eh); + + /* write new edges into a temporary CustomData */ + memset(&edata, 0, sizeof(edata)); + CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge); + + ehi = BLI_edgehashIterator_new(eh); + med = CustomData_get_layer(&edata, CD_MEDGE); + for(i = 0; !BLI_edgehashIterator_isDone(ehi); + BLI_edgehashIterator_step(ehi), ++i, ++med, ++index) { + BLI_edgehashIterator_getKey(ehi, (int*)&med->v1, (int*)&med->v2); + + med->flag = ME_EDGEDRAW|ME_EDGERENDER; + } + BLI_edgehashIterator_free(ehi); + + /* free old CustomData and assign new one */ + CustomData_free(&mesh->edata, mesh->totedge); + mesh->edata = edata; + mesh->totedge = totedge; + + mesh->medge = CustomData_get_layer(&mesh->edata, CD_MEDGE); + + BLI_edgehash_free(eh, NULL); } -void rna_Mesh_copy_applied(Mesh *me, Scene *sce, Object *ob) +static void rna_Mesh_update(Mesh *mesh, bContext *C) { - DerivedMesh *dm= mesh_create_derived_view(sce, ob, CD_MASK_MESH); - DM_to_mesh(dm, me); - dm->release(dm); + Main *bmain= CTX_data_main(C); + Object *ob; + + if(mesh->totface && mesh->totedge == 0) + rna_Mesh_calc_edges(mesh); + + mesh_calc_normals(mesh->mvert, mesh->totvert, mesh->mface, mesh->totface, NULL); + + for(ob=bmain->object.first; ob; ob=ob->id.next) { + if(ob->data == mesh) { + ob->recalc |= OB_RECALC_DATA; + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + } + } } -*/ -void rna_Mesh_transform(Mesh *me, float **mat) +static void rna_Mesh_add_verts(Mesh *mesh, int len) { + CustomData vdata; + MVert *mvert; + int i, totvert; + + if(len == 0) + return; + + totvert= mesh->totvert + len; + CustomData_copy(&mesh->vdata, &vdata, CD_MASK_MESH, CD_DEFAULT, totvert); + CustomData_copy_data(&mesh->vdata, &vdata, 0, 0, mesh->totvert); + + if(!CustomData_has_layer(&vdata, CD_MVERT)) + CustomData_add_layer(&vdata, CD_MVERT, CD_CALLOC, NULL, totvert); + + CustomData_free(&mesh->vdata, mesh->totvert); + mesh->vdata= vdata; + mesh_update_customdata_pointers(mesh); + + /* scan the input list and insert the new vertices */ + + mvert= &mesh->mvert[mesh->totvert]; + for(i=0; iflag |= SELECT; + + /* set final vertex list size */ + mesh->totvert= totvert; } -#if 0 -/* extern struct EditVert *addvertlist(EditMesh *em, float *vec, struct EditVert *example); */ +static void rna_Mesh_add_edges(Mesh *mesh, int len) +{ + CustomData edata; + MEdge *medge; + int i, totedge; + + if(len == 0) + return; + + totedge= mesh->totedge+len; + + /* update customdata */ + CustomData_copy(&mesh->edata, &edata, CD_MASK_MESH, CD_DEFAULT, totedge); + CustomData_copy_data(&mesh->edata, &edata, 0, 0, mesh->totedge); -static void rna_Mesh_verts_add(PointerRNA *ptr, PointerRNA *ptr_item) + if(!CustomData_has_layer(&edata, CD_MEDGE)) + CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge); + + CustomData_free(&mesh->edata, mesh->totedge); + mesh->edata= edata; + mesh_update_customdata_pointers(mesh); + + /* set default flags */ + medge= &mesh->medge[mesh->totedge]; + for(i=0; iflag= ME_EDGEDRAW|ME_EDGERENDER|SELECT; + + mesh->totedge= totedge; +} + +static void rna_Mesh_add_faces(Mesh *mesh, int len) { - //Mesh *me= (Mesh*)ptr->data; + CustomData fdata; + MFace *mface; + int i, totface; - /* - // XXX if item is not MVert we fail silently - if (item->type == RNA_MeshVertex) + if(len == 0) return; - // XXX this must be slow... - EditMesh *em= BKE_mesh_get_editmesh(me); + totface= mesh->totface + len; /* new face count */ + + /* update customdata */ + CustomData_copy(&mesh->fdata, &fdata, CD_MASK_MESH, CD_DEFAULT, totface); + CustomData_copy_data(&mesh->fdata, &fdata, 0, 0, mesh->totface); + + if(!CustomData_has_layer(&fdata, CD_MFACE)) + CustomData_add_layer(&fdata, CD_MFACE, CD_CALLOC, NULL, totface); + + CustomData_free(&mesh->fdata, mesh->totface); + mesh->fdata= fdata; + mesh_update_customdata_pointers(mesh); - MVert *v = (MVert*)ptr_item->ptr->data; - addvertlist(em, v->co, NULL); + /* set default flags */ + mface= &mesh->mface[mesh->totface]; + for(i=0; iflag= SELECT; - BKE_mesh_end_editmesh(me, em); - */ + mesh->totface= totface; +} + +static void rna_Mesh_add_geometry(Mesh *mesh, int verts, int edges, int faces) +{ + if(verts) + rna_Mesh_add_verts(mesh, verts); + if(edges) + rna_Mesh_add_edges(mesh, edges); + if(faces) + rna_Mesh_add_faces(mesh, faces); } -#endif #else void RNA_api_mesh(StructRNA *srna) { - /*FunctionRNA *func; - PropertyRNA *prop;*/ - - /* - func= RNA_def_function(srna, "copy", "rna_Mesh_copy"); - RNA_def_function_ui_description(func, "Copy mesh data."); - prop= RNA_def_pointer(func, "src", "Mesh", "", "A mesh to copy data from."); - RNA_def_property_flag(prop, PROP_REQUIRED);*/ - - /* - func= RNA_def_function(srna, "add_geom", "rna_Mesh_add_geom"); - RNA_def_function_ui_description(func, "Add geometry data to mesh."); - prop= RNA_def_collection(func, "verts", "?", "", "Vertices."); - RNA_def_property_flag(prop, PROP_REQUIRED); - prop= RNA_def_collection(func, "faces", "?", "", "Faces."); - RNA_def_property_flag(prop, PROP_REQUIRED); - */ + FunctionRNA *func; + PropertyRNA *parm; + + func= RNA_def_function(srna, "add_geometry", "rna_Mesh_add_geometry"); + parm= RNA_def_int(func, "verts", 0, 0, INT_MAX, "Number", "Number of vertices to add.", 0, INT_MAX); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_int(func, "edges", 0, 0, INT_MAX, "Number", "Number of edges to add.", 0, INT_MAX); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_int(func, "faces", 0, 0, INT_MAX, "Number", "Number of faces to add.", 0, INT_MAX); + RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "update", "rna_Mesh_update"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); } #endif diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 825b3711b97..eef221e45a4 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -416,12 +416,12 @@ static int rna_UILayout_active_get(struct PointerRNA *ptr) static void rna_UILayout_active_set(struct PointerRNA *ptr, int value) { - return uiLayoutSetActive(ptr->data, value); + uiLayoutSetActive(ptr->data, value); } static void rna_UILayout_op_context_set(struct PointerRNA *ptr, int value) { - return uiLayoutSetOperatorContext(ptr->data, value); + uiLayoutSetOperatorContext(ptr->data, value); } static int rna_UILayout_op_context_get(struct PointerRNA *ptr) @@ -436,7 +436,7 @@ static int rna_UILayout_enabled_get(struct PointerRNA *ptr) static void rna_UILayout_enabled_set(struct PointerRNA *ptr, int value) { - return uiLayoutSetEnabled(ptr->data, value); + uiLayoutSetEnabled(ptr->data, value); } static int rna_UILayout_red_alert_get(struct PointerRNA *ptr) @@ -446,7 +446,7 @@ static int rna_UILayout_red_alert_get(struct PointerRNA *ptr) static void rna_UILayout_red_alert_set(struct PointerRNA *ptr, int value) { - return uiLayoutSetRedAlert(ptr->data, value); + uiLayoutSetRedAlert(ptr->data, value); } static int rna_UILayout_keep_aspect_get(struct PointerRNA *ptr) @@ -456,7 +456,7 @@ static int rna_UILayout_keep_aspect_get(struct PointerRNA *ptr) static void rna_UILayout_keep_aspect_set(struct PointerRNA *ptr, int value) { - return uiLayoutSetKeepAspect(ptr->data, value); + uiLayoutSetKeepAspect(ptr->data, value); } static int rna_UILayout_alignment_get(struct PointerRNA *ptr) @@ -466,7 +466,7 @@ static int rna_UILayout_alignment_get(struct PointerRNA *ptr) static void rna_UILayout_alignment_set(struct PointerRNA *ptr, int value) { - return uiLayoutSetAlignment(ptr->data, value); + uiLayoutSetAlignment(ptr->data, value); } static float rna_UILayout_scale_x_get(struct PointerRNA *ptr) @@ -476,7 +476,7 @@ static float rna_UILayout_scale_x_get(struct PointerRNA *ptr) static void rna_UILayout_scale_x_set(struct PointerRNA *ptr, float value) { - return uiLayoutSetScaleX(ptr->data, value); + uiLayoutSetScaleX(ptr->data, value); } static float rna_UILayout_scale_y_get(struct PointerRNA *ptr) @@ -486,7 +486,7 @@ static float rna_UILayout_scale_y_get(struct PointerRNA *ptr) static void rna_UILayout_scale_y_set(struct PointerRNA *ptr, float value) { - return uiLayoutSetScaleY(ptr->data, value); + uiLayoutSetScaleY(ptr->data, value); } #else // RNA_RUNTIME -- cgit v1.2.3 From 1a86cd6dcda1b6bca338d096b6a4b332d0b39822 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 1 Jul 2009 13:31:36 +0000 Subject: slice support working in py3 for Vector and Matrix types. Added slice to PyRNA collections and arrays (py3 only). eg. some_verts = mesh.verts[0:10] some_rna_array[4:-1] = [0,1,2,3] Collections dont support assignment, when assigning slices, resizing the array isnt support like with python lists. --- source/blender/python/generic/matrix.c | 82 +++++++++- source/blender/python/generic/vector.c | 92 ++++++++++- source/blender/python/intern/bpy_rna.c | 285 ++++++++++++++++++++++++--------- 3 files changed, 380 insertions(+), 79 deletions(-) (limited to 'source') diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c index 41411559fe0..34d29dacdd1 100644 --- a/source/blender/python/generic/matrix.c +++ b/source/blender/python/generic/matrix.c @@ -760,8 +760,7 @@ static PyObject *Matrix_slice(MatrixObject * self, int begin, int end) } /*----------------------------object[z:y]------------------------ sequence slice (set)*/ -static int Matrix_ass_slice(MatrixObject * self, int begin, int end, - PyObject * seq) +static int Matrix_ass_slice(MatrixObject * self, int begin, int end, PyObject * seq) { int i, x, y, size, sub_size = 0; float mat[16], f; @@ -999,6 +998,83 @@ static PySequenceMethods Matrix_SeqMethods = { }; + +#if (PY_VERSION_HEX >= 0x03000000) +static PyObject *Matrix_subscript(MatrixObject* self, PyObject* item) +{ + if (PyIndex_Check(item)) { + Py_ssize_t i; + i = PyNumber_AsSsize_t(item, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return NULL; + if (i < 0) + i += self->rowSize; + return Matrix_item(self, i); + } else if (PySlice_Check(item)) { + Py_ssize_t start, stop, step, slicelength; + + if (PySlice_GetIndicesEx((PySliceObject*)item, self->rowSize, &start, &stop, &step, &slicelength) < 0) + return NULL; + + if (slicelength <= 0) { + return PyList_New(0); + } + else if (step == 1) { + return Matrix_slice(self, start, stop); + } + else { + PyErr_SetString(PyExc_TypeError, "slice steps not supported with matricies"); + return NULL; + } + } + else { + PyErr_Format(PyExc_TypeError, + "vector indices must be integers, not %.200s", + item->ob_type->tp_name); + return NULL; + } +} + +static int Matrix_ass_subscript(MatrixObject* self, PyObject* item, PyObject* value) +{ + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return -1; + if (i < 0) + i += self->rowSize; + return Matrix_ass_item(self, i, value); + } + else if (PySlice_Check(item)) { + Py_ssize_t start, stop, step, slicelength; + + if (PySlice_GetIndicesEx((PySliceObject*)item, self->rowSize, &start, &stop, &step, &slicelength) < 0) + return -1; + + if (step == 1) + return Matrix_ass_slice(self, start, stop, value); + else { + PyErr_SetString(PyExc_TypeError, "slice steps not supported with matricies"); + return -1; + } + } + else { + PyErr_Format(PyExc_TypeError, + "matrix indices must be integers, not %.200s", + item->ob_type->tp_name); + return -1; + } +} + +static PyMappingMethods Matrix_AsMapping = { + (lenfunc)Matrix_len, + (binaryfunc)Matrix_subscript, + (objobjargproc)Matrix_ass_subscript +}; +#endif /* (PY_VERSION_HEX >= 0x03000000) */ + + + #if (PY_VERSION_HEX >= 0x03000000) static PyNumberMethods Matrix_NumMethods = { (binaryfunc) Matrix_add, /*nb_add*/ @@ -1106,7 +1182,7 @@ PyTypeObject matrix_Type = { (reprfunc) Matrix_repr, /*tp_repr*/ &Matrix_NumMethods, /*tp_as_number*/ &Matrix_SeqMethods, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ + &Matrix_AsMapping, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index 0af646bd82f..5abc68c63ca 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -1051,16 +1051,100 @@ static PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int compa Py_RETURN_FALSE; } } + /*-----------------PROTCOL DECLARATIONS--------------------------*/ static PySequenceMethods Vector_SeqMethods = { (inquiry) Vector_len, /* sq_length */ (binaryfunc) 0, /* sq_concat */ - (ssizeargfunc) 0, /* sq_repeat */ + (ssizeargfunc) 0, /* sq_repeat */ (ssizeargfunc) Vector_item, /* sq_item */ - (ssizessizeargfunc) Vector_slice, /* sq_slice */ +#if (PY_VERSION_HEX < 0x03000000) + (ssizessizeargfunc) Vector_slice, /* sq_slice */ /* PY2 ONLY */ +#else + NULL, +#endif (ssizeobjargproc) Vector_ass_item, /* sq_ass_item */ - (ssizessizeobjargproc) Vector_ass_slice, /* sq_ass_slice */ +#if (PY_VERSION_HEX < 0x03000000) + (ssizessizeobjargproc) Vector_ass_slice, /* sq_ass_slice */ /* PY2 ONLY */ +#else + NULL, +#endif +}; + + +#if (PY_VERSION_HEX >= 0x03000000) +static PyObject *Vector_subscript(VectorObject* self, PyObject* item) +{ + if (PyIndex_Check(item)) { + Py_ssize_t i; + i = PyNumber_AsSsize_t(item, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return NULL; + if (i < 0) + i += self->size; + return Vector_item(self, i); + } else if (PySlice_Check(item)) { + Py_ssize_t start, stop, step, slicelength; + + if (PySlice_GetIndicesEx((PySliceObject*)item, self->size, &start, &stop, &step, &slicelength) < 0) + return NULL; + + if (slicelength <= 0) { + return PyList_New(0); + } + else if (step == 1) { + return Vector_slice(self, start, stop); + } + else { + PyErr_SetString(PyExc_TypeError, "slice steps not supported with vectors"); + return NULL; + } + } + else { + PyErr_Format(PyExc_TypeError, + "vector indices must be integers, not %.200s", + item->ob_type->tp_name); + return NULL; + } +} + +static int Vector_ass_subscript(VectorObject* self, PyObject* item, PyObject* value) +{ + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return -1; + if (i < 0) + i += self->size; + return Vector_ass_item(self, i, value); + } + else if (PySlice_Check(item)) { + Py_ssize_t start, stop, step, slicelength; + + if (PySlice_GetIndicesEx((PySliceObject*)item, self->size, &start, &stop, &step, &slicelength) < 0) + return -1; + + if (step == 1) + return Vector_ass_slice(self, start, stop, value); + else { + PyErr_SetString(PyExc_TypeError, "slice steps not supported with vectors"); + return -1; + } + } + else { + PyErr_Format(PyExc_TypeError, + "vector indices must be integers, not %.200s", + item->ob_type->tp_name); + return -1; + } +} + +static PyMappingMethods Vector_AsMapping = { + (lenfunc)Vector_len, + (binaryfunc)Vector_subscript, + (objobjargproc)Vector_ass_subscript }; +#endif /* (PY_VERSION_HEX >= 0x03000000) */ #if (PY_VERSION_HEX >= 0x03000000) static PyNumberMethods Vector_NumMethods = { @@ -1813,7 +1897,7 @@ PyTypeObject vector_Type = { &Vector_NumMethods, /* PyNumberMethods *tp_as_number; */ &Vector_SeqMethods, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ + &Vector_AsMapping, /* PyMappingMethods *tp_as_mapping; */ /* More standard operations (here for binary compatibility) */ diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index e13f02c5529..4729620bb8a 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -35,6 +35,7 @@ #include "RNA_define.h" /* for defining our own rna */ #include "MEM_guardedalloc.h" +#include "BKE_utildefines.h" #include "BKE_context.h" #include "BKE_global.h" /* evil G.* */ #include "BKE_report.h" @@ -820,108 +821,246 @@ static Py_ssize_t pyrna_prop_len( BPy_PropertyRNA * self ) return len; } -static PyObject *pyrna_prop_subscript( BPy_PropertyRNA * self, PyObject *key ) +/* internal use only */ +static PyObject *prop_subscript_collection_int(BPy_PropertyRNA * self, int keynum) { - PyObject *ret; PointerRNA newptr; - int keynum = 0; - char *keyname = NULL; - + + if(keynum < 0) keynum += RNA_property_collection_length(&self->ptr, self->prop); + + if(RNA_property_collection_lookup_int(&self->ptr, self->prop, keynum, &newptr)) + return pyrna_struct_CreatePyObject(&newptr); + + PyErr_SetString(PyExc_IndexError, "out of range"); + return NULL; +} +static PyObject *prop_subscript_array_int(BPy_PropertyRNA * self, int keynum) +{ + int len= RNA_property_array_length(self->prop); + + if(keynum < 0) keynum += len; + + if(keynum >= 0 && keynum < len) + return pyrna_prop_to_py_index(&self->ptr, self->prop, keynum); + + PyErr_SetString(PyExc_IndexError, "out of range"); + return NULL; +} + +static PyObject *prop_subscript_collection_str(BPy_PropertyRNA * self, char *keyname) +{ + PointerRNA newptr; + if(RNA_property_collection_lookup_string(&self->ptr, self->prop, keyname, &newptr)) + return pyrna_struct_CreatePyObject(&newptr); + + PyErr_SetString(PyExc_KeyError, "key not found"); + return NULL; +} +/* static PyObject *prop_subscript_array_str(BPy_PropertyRNA * self, char *keyname) */ + + + + +#if PY_VERSION_HEX >= 0x03000000 +static PyObject *prop_subscript_collection_slice(BPy_PropertyRNA * self, int start, int stop) +{ + PointerRNA newptr; + PyObject *list = PyList_New(stop - start); + int count; + + start = MIN2(start,stop); /* values are clamped from */ + + for(count = start; count < stop; count++) { + if(RNA_property_collection_lookup_int(&self->ptr, self->prop, count - start, &newptr)) { + PyList_SetItem(list, count - start, pyrna_struct_CreatePyObject(&newptr)); + } + else { + Py_DECREF(list); + + PyErr_SetString(PyExc_RuntimeError, "error getting an rna struct from a collection"); + return NULL; + } + } + + return list; +} +static PyObject *prop_subscript_array_slice(BPy_PropertyRNA * self, int start, int stop) +{ + PyObject *list = PyList_New(stop - start); + int count; + + start = MIN2(start,stop); /* values are clamped from PySlice_GetIndicesEx */ + + for(count = start; count < stop; count++) + PyList_SetItem(list, count - start, pyrna_prop_to_py_index(&self->ptr, self->prop, count)); + + return list; +} +#endif + +static PyObject *prop_subscript_collection(BPy_PropertyRNA * self, PyObject *key) +{ if (PyUnicode_Check(key)) { - keyname = _PyUnicode_AsString(key); - } else if (PyLong_Check(key)) { - keynum = PyLong_AsSsize_t(key); - } else { + return prop_subscript_collection_str(self, _PyUnicode_AsString(key)); + } + else if (PyLong_Check(key)) { + return prop_subscript_collection_int(self, PyLong_AsSsize_t(key)); + } +#if PY_VERSION_HEX >= 0x03000000 + else if (PySlice_Check(key)) { + int len= RNA_property_collection_length(&self->ptr, self->prop); + Py_ssize_t start, stop, step, slicelength; + + if (PySlice_GetIndicesEx((PySliceObject*)key, len, &start, &stop, &step, &slicelength) < 0) + return NULL; + + if (slicelength <= 0) { + return PyList_New(0); + } + else if (step == 1) { + return prop_subscript_collection_slice(self, start, stop); + } + else { + PyErr_SetString(PyExc_TypeError, "slice steps not supported with rna"); + return NULL; + } + } +#endif + else { PyErr_SetString(PyExc_AttributeError, "invalid key, key must be a string or an int"); return NULL; } - - if (RNA_property_type(self->prop) == PROP_COLLECTION) { - int ok; - if (keyname) ok = RNA_property_collection_lookup_string(&self->ptr, self->prop, keyname, &newptr); - else ok = RNA_property_collection_lookup_int(&self->ptr, self->prop, keynum, &newptr); - - if (ok) { - ret = pyrna_struct_CreatePyObject(&newptr); - } else { - PyErr_SetString(PyExc_AttributeError, "out of range"); - ret = NULL; +} + +static PyObject *prop_subscript_array(BPy_PropertyRNA * self, PyObject *key) +{ + /*if (PyUnicode_Check(key)) { + return prop_subscript_array_str(self, _PyUnicode_AsString(key)); + } else*/ + if (PyLong_Check(key)) { + return prop_subscript_array_int(self, PyLong_AsSsize_t(key)); + } +#if PY_VERSION_HEX >= 0x03000000 + else if (PySlice_Check(key)) { + int len= RNA_property_array_length(self->prop); + Py_ssize_t start, stop, step, slicelength; + + if (PySlice_GetIndicesEx((PySliceObject*)key, len, &start, &stop, &step, &slicelength) < 0) + return NULL; + + if (slicelength <= 0) { + return PyList_New(0); } - - } else if (keyname) { - PyErr_SetString(PyExc_AttributeError, "string keys are only supported for collections"); - ret = NULL; - } else { - int len = RNA_property_array_length(self->prop); - - if (len==0) { /* not an array*/ - PyErr_Format(PyExc_AttributeError, "not an array or collection %d", keynum); - ret = NULL; + else if (step == 1) { + return prop_subscript_array_slice(self, start, stop); } - - if (keynum >= len){ - PyErr_SetString(PyExc_AttributeError, "index out of range"); - ret = NULL; - } else { /* not an array*/ - ret = pyrna_prop_to_py_index(&self->ptr, self->prop, keynum); + else { + PyErr_SetString(PyExc_TypeError, "slice steps not supported with rna"); + return NULL; } } - - return ret; +#endif + else { + PyErr_SetString(PyExc_AttributeError, "invalid key, key must be an int"); + return NULL; + } } +static PyObject *pyrna_prop_subscript( BPy_PropertyRNA * self, PyObject *key ) +{ + if (RNA_property_type(self->prop) == PROP_COLLECTION) { + return prop_subscript_collection(self, key); + } else if (RNA_property_array_length(self->prop)) { /* arrays are currently fixed length, zero length means its not an array */ + return prop_subscript_array(self, key); + } else { + PyErr_SetString(PyExc_TypeError, "rna type is not an array or a collection"); + return NULL; + } + +} -static int pyrna_prop_assign_subscript( BPy_PropertyRNA * self, PyObject *key, PyObject *value ) +#if PY_VERSION_HEX >= 0x03000000 +static int prop_subscript_ass_array_slice(BPy_PropertyRNA * self, int begin, int end, PyObject *value) { - int ret = 0; - int keynum = 0; - char *keyname = NULL; + int count; + + /* values are clamped from */ + begin = MIN2(begin,end); + + for(count = begin; count < end; count++) { + if(pyrna_py_to_prop_index(&self->ptr, self->prop, count - begin, value) == -1) { + /* TODO - this is wrong since some values have been assigned... will need to fix that */ + return -1; /* pyrna_struct_CreatePyObject should set the error */ + } + } + + return 0; +} +#endif + +static int prop_subscript_ass_array_int(BPy_PropertyRNA * self, int keynum, PyObject *value) +{ + + int len= RNA_property_array_length(self->prop); + + if(keynum < 0) keynum += len; + + if(keynum >= 0 && keynum < len) + return pyrna_py_to_prop_index(&self->ptr, self->prop, keynum, value); + + PyErr_SetString(PyExc_IndexError, "out of range"); + return -1; +} + +static int pyrna_prop_ass_subscript( BPy_PropertyRNA * self, PyObject *key, PyObject *value ) +{ + /* char *keyname = NULL; */ /* not supported yet */ if (!RNA_property_editable(&self->ptr, self->prop)) { PyErr_Format( PyExc_AttributeError, "PropertyRNA - attribute \"%s\" from \"%s\" is read-only", RNA_property_identifier(self->prop), RNA_struct_identifier(self->ptr.type) ); return -1; } - if (PyUnicode_Check(key)) { - keyname = _PyUnicode_AsString(key); - } else if (PyLong_Check(key)) { - keynum = PyLong_AsSsize_t(key); - } else { - PyErr_SetString(PyExc_AttributeError, "PropertyRNA - invalid key, key must be a string or an int"); + /* maybe one day we can support this... */ + if (RNA_property_type(self->prop) == PROP_COLLECTION) { + PyErr_Format( PyExc_AttributeError, "PropertyRNA - attribute \"%s\" from \"%s\" is a collection, assignment not supported", RNA_property_identifier(self->prop), RNA_struct_identifier(self->ptr.type) ); return -1; } - - if (RNA_property_type(self->prop) == PROP_COLLECTION) { - PyErr_SetString(PyExc_AttributeError, "PropertyRNA - assignment is not supported for collections (yet)"); - ret = -1; - } else if (keyname) { - PyErr_SetString(PyExc_AttributeError, "PropertyRNA - string keys are only supported for collections"); - ret = -1; - } else { - int len = RNA_property_array_length(self->prop); - - if (len==0) { /* not an array*/ - PyErr_Format(PyExc_AttributeError, "PropertyRNA - not an array or collection %d", keynum); - ret = -1; + + if (PyLong_Check(key)) { + return prop_subscript_ass_array_int(self, PyLong_AsSsize_t(key), value); + } +#if PY_VERSION_HEX >= 0x03000000 + else if (PySlice_Check(key)) { + int len= RNA_property_array_length(self->prop); + Py_ssize_t start, stop, step, slicelength; + + if (PySlice_GetIndicesEx((PySliceObject*)key, len, &start, &stop, &step, &slicelength) < 0) + return -1; + + if (slicelength <= 0) { + return 0; } - - if (keynum >= len){ - PyErr_SetString(PyExc_AttributeError, "PropertyRNA - index out of range"); - ret = -1; - } else { - ret = pyrna_py_to_prop_index(&self->ptr, self->prop, keynum, value); + else if (step == 1) { + return prop_subscript_ass_array_slice(self, start, stop, value); + } + else { + PyErr_SetString(PyExc_TypeError, "slice steps not supported with rna"); + return -1; } } - - return ret; +#endif + else { + PyErr_SetString(PyExc_AttributeError, "invalid key, key must be an int"); + return -1; + } } - static PyMappingMethods pyrna_prop_as_mapping = { ( lenfunc ) pyrna_prop_len, /* mp_length */ ( binaryfunc ) pyrna_prop_subscript, /* mp_subscript */ - ( objobjargproc ) pyrna_prop_assign_subscript, /* mp_ass_subscript */ + ( objobjargproc ) pyrna_prop_ass_subscript, /* mp_ass_subscript */ }; static int pyrna_prop_contains(BPy_PropertyRNA * self, PyObject *value) @@ -1252,8 +1391,10 @@ static int foreach_parse_args( /*values to assign */ char **attr, PyObject **seq, int *tot, int *size, RawPropertyType *raw_type, int *attr_tot, int *attr_signed) { +#if 0 int array_tot; int target_tot; +#endif *size= *raw_type= *attr_tot= *attr_signed= 0; @@ -1340,7 +1481,7 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set) Py_buffer buf; PyObject_GetBuffer(seq, &buf, PyBUF_SIMPLE | PyBUF_FORMAT); - /* check if the buffer matches, TODO - signed/unsigned types */ + /* check if the buffer matches */ buffer_is_compat = foreach_compat_buffer(raw_type, attr_signed, buf.format); -- cgit v1.2.3 From 594c8802d748dc0701af491e8a2c590f2d2e0038 Mon Sep 17 00:00:00 2001 From: Elia Sarti Date: Wed, 1 Jul 2009 19:56:50 +0000 Subject: Added support for collection parameters also for RNA_function_call_direct family of functions. The syntax for passing collection parameters is similar to passing pointers where you pass first the RNA type and then the ListBase representing the collection. The format specifier is "C" instead of "O", e.g. RNA_function_call_direct_lookup(C, reports, ptr, "do_something", "sC", "some string value", &RNA_SomeItemType, listbase); Note that from python you could in theory pass collections of items each of a different type while using this API you can't. I don't think this should be a problem as RNA supports collections this way anyway (i.e. where items are all of the same type or inherit from the same base type). Also a small fix for pointer parameters. --- source/blender/makesrna/intern/rna_access.c | 60 +++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 11 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 9ebb778707c..cc8704dc350 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -3050,23 +3050,46 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop if(prop->flag & PROP_RNAPTR) { *((PointerRNA*)dest)= *((PointerRNA*)src); + break; + } + + if (ptype!=srna && !RNA_struct_is_a(srna, ptype)) { + fprintf(stderr, "%s.%s: wrong type for parameter %s, an object of type %s was expected, passed an object of type %s\n", tid, fid, pid, RNA_struct_identifier(ptype), RNA_struct_identifier(srna)); + return -1; } - else if (ptype!=srna) { - if (!RNA_struct_is_a(srna, ptype)) { - fprintf(stderr, "%s.%s: wrong type for parameter %s, an object of type %s was expected, passed an object of type %s\n", tid, fid, pid, RNA_struct_identifier(ptype), RNA_struct_identifier(ptype)); - return -1; - } - - *((void**)dest)= *((void**)src); - } + + *((void**)dest)= *((void**)src); break; } case PROP_COLLECTION: { - /* XXX collections are not supported yet */ - fprintf(stderr, "%s.%s: for parameter %s, collections are not supported yet\n", tid, fid, pid); - return -1; + StructRNA *ptype; + ListBase *lb, *clb; + Link *link; + CollectionPointerLink *clink; + + if (ftype!='C') { + fprintf(stderr, "%s.%s: wrong type for parameter %s, a collection was expected\n", tid, fid, pid); + return -1; + } + + lb= (ListBase *)src; + clb= (ListBase *)dest; + ptype= RNA_property_pointer_type(ptr, prop); + + if (ptype!=srna && !RNA_struct_is_a(srna, ptype)) { + fprintf(stderr, "%s.%s: wrong type for parameter %s, a collection of objects of type %s was expected, passed a collection of objects of type %s\n", tid, fid, pid, RNA_struct_identifier(ptype), RNA_struct_identifier(srna)); + return -1; + } + + for (link= lb->first; link; link= link->next) { + clink= MEM_callocN(sizeof(CollectionPointerLink), "CCollectionPointerLink"); + RNA_pointer_create(NULL, srna, link, &clink->ptr); + BLI_addtail(clb, clink); + } + + break; } default: { @@ -3164,6 +3187,13 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, srna, tid, fid, pid); break; } + case PROP_COLLECTION: + { + StructRNA *srna= va_arg(args, StructRNA*); + ListBase *arg= va_arg(args, ListBase*); + err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, srna, tid, fid, pid); + break; + } default: { /* handle errors */ @@ -3221,6 +3251,13 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata, srna, tid, fid, pid); break; } + case PROP_COLLECTION: + { + StructRNA *srna= va_arg(args, StructRNA*); + ListBase **arg= va_arg(args, ListBase**); + err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata, srna, tid, fid, pid); + break; + } default: { /* handle errors */ @@ -3249,3 +3286,4 @@ int RNA_function_call_direct_va_lookup(bContext *C, ReportList *reports, Pointer return 0; } + -- cgit v1.2.3 From 666ce6de80935c614c7e700c6a3f9775edb15ac2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 1 Jul 2009 20:55:32 +0000 Subject: needed for building with py2 --- source/blender/python/generic/matrix.c | 4 ++++ source/blender/python/generic/vector.c | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'source') diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c index 34d29dacdd1..5bdbf804618 100644 --- a/source/blender/python/generic/matrix.c +++ b/source/blender/python/generic/matrix.c @@ -1182,7 +1182,11 @@ PyTypeObject matrix_Type = { (reprfunc) Matrix_repr, /*tp_repr*/ &Matrix_NumMethods, /*tp_as_number*/ &Matrix_SeqMethods, /*tp_as_sequence*/ +#if (PY_VERSION_HEX >= 0x03000000) &Matrix_AsMapping, /*tp_as_mapping*/ +#else + 0, +#endif 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index 5abc68c63ca..b4c74787e05 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -1897,7 +1897,11 @@ PyTypeObject vector_Type = { &Vector_NumMethods, /* PyNumberMethods *tp_as_number; */ &Vector_SeqMethods, /* PySequenceMethods *tp_as_sequence; */ +#if (PY_VERSION_HEX >= 0x03000000) &Vector_AsMapping, /* PyMappingMethods *tp_as_mapping; */ +#else + NULL, +#endif /* More standard operations (here for binary compatibility) */ -- cgit v1.2.3 From cda566d6464cac92a766df0b065d43d8240e23f2 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 1 Jul 2009 22:16:16 +0000 Subject: 2.5: Fix a case of using freed memory in event handling. --- source/blender/windowmanager/intern/wm_event_system.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 189594a4947..e520067b9e5 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -733,17 +733,20 @@ static int wm_handler_ui_call(bContext *C, wmEventHandler *handler, wmEvent *eve ScrArea *area= CTX_wm_area(C); ARegion *region= CTX_wm_region(C); ARegion *menu= CTX_wm_menu(C); - int retval; + int retval, always_pass; /* we set context to where ui handler came from */ if(handler->ui_area) CTX_wm_area_set(C, handler->ui_area); if(handler->ui_region) CTX_wm_region_set(C, handler->ui_region); if(handler->ui_menu) CTX_wm_menu_set(C, handler->ui_menu); + /* in advance to avoid access to freed event on window close */ + always_pass= wm_event_always_pass(event); + retval= handler->ui_handle(C, event, handler->ui_userdata); /* putting back screen context */ - if((retval != WM_UI_HANDLER_BREAK) || wm_event_always_pass(event)) { + if((retval != WM_UI_HANDLER_BREAK) || always_pass) { CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); CTX_wm_menu_set(C, menu); @@ -872,6 +875,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) { wmEventHandler *handler, *nexthandler; int action= WM_HANDLER_CONTINUE; + int always_pass; if(handlers==NULL) return action; @@ -881,6 +885,8 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) /* optional boundbox */ if(handler_boundbox_test(handler, event)) { + /* in advance to avoid access to freed event on window close */ + always_pass= wm_event_always_pass(event); /* modal+blocking handler */ if(handler->flag & WM_HANDLER_BLOCKING) @@ -912,7 +918,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) action= wm_handler_operator_call(C, handlers, handler, event, NULL); } - if(!wm_event_always_pass(event) && action==WM_HANDLER_BREAK) + if(!always_pass && action==WM_HANDLER_BREAK) break; } -- cgit v1.2.3 From 421f44278cebff49a1485251f92a4277934c4e4c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 1 Jul 2009 22:25:49 +0000 Subject: 2.5: Lists for vertex groups, shape keys, uvs, vertex colors. RNA * Added the relevant active_*_index properties, with proper get/set/range, updates and notifiers. * Context.tool_settings. * ToolSettings.vertex_group_weight. Operators * MESH_OT_uv_texture_add/remove * MESH_OT_vertex_color_add/remove * MESH_OT_sticky_add/remove * OBJECT_OT_vertex_group_add/remove/assign/remove_from/ select/deselect/copy/copy_to_linked * OBJECT_OT_shape_key_add/remove UI * Some updates and cleanups in list template code. Known issue: when going in & out of editmode, uv textures and vertex colors dissappear. I thought me->edit_mesh would be NULL when not in edit mode but it is not? --- source/blender/blenkernel/intern/particle.c | 2 +- source/blender/blenloader/intern/readfile.c | 6 +- source/blender/editors/include/ED_mesh.h | 4 +- source/blender/editors/include/UI_interface.h | 2 +- source/blender/editors/interface/interface.c | 4 +- .../editors/interface/interface_templates.c | 204 ++- .../blender/editors/interface/interface_widgets.c | 4 +- source/blender/editors/mesh/editdeform.c | 1110 ---------------- source/blender/editors/mesh/mesh_intern.h | 9 + source/blender/editors/mesh/mesh_layers.c | 424 ++++++ source/blender/editors/mesh/mesh_ops.c | 6 + source/blender/editors/object/editkey.c | 144 ++- source/blender/editors/object/object_intern.h | 14 + source/blender/editors/object/object_ops.c | 12 + source/blender/editors/object/object_vgroup.c | 1344 ++++++++++++++++++++ .../blender/editors/space_buttons/space_buttons.c | 1 + source/blender/makesdna/DNA_scene_types.h | 6 +- source/blender/makesdna/DNA_screen_types.h | 3 + source/blender/makesrna/intern/rna_constraint.c | 4 +- source/blender/makesrna/intern/rna_context.c | 12 + source/blender/makesrna/intern/rna_mesh.c | 230 +++- source/blender/makesrna/intern/rna_object.c | 103 +- source/blender/makesrna/intern/rna_scene.c | 5 + source/blender/makesrna/intern/rna_ui_api.c | 2 + 24 files changed, 2330 insertions(+), 1325 deletions(-) delete mode 100644 source/blender/editors/mesh/editdeform.c create mode 100644 source/blender/editors/mesh/mesh_layers.c create mode 100644 source/blender/editors/object/object_vgroup.c (limited to 'source') diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 31e60e985d5..5bf9335d211 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -230,7 +230,7 @@ void psys_set_current_num(Object *ob, int index) if(ob==0) return; for(psys=ob->particlesystem.first, i=0; psys; psys=psys->next, i++) { - if(i == index - 1) + if(i == index) psys->flag |= PSYS_CURRENT; else psys->flag &= ~PSYS_CURRENT; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 1dd206e6cce..c89f515f319 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9011,12 +9011,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main) */ //do_versions_ipos_to_animato(main); - /* struct audio data moved to renderdata */ + /* toolsettings */ for(scene= main->scene.first; scene; scene= scene->id.next) { scene->r.audio = scene->audio; - if(!scene->toolsettings->uv_selectmode) + if(!scene->toolsettings->uv_selectmode) { scene->toolsettings->uv_selectmode= UV_SELECT_VERTEX; + scene->toolsettings->vgroup_weight= 1.0f; + } } /* shader, composit and texture node trees have id.name empty, put something in diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 937f6384f6a..8952305d6ab 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -110,7 +110,6 @@ void undo_push_mesh(struct bContext *C, char *name); struct EditFace *EM_get_actFace(struct EditMesh *em, int sloppy); void EM_set_actFace(struct EditMesh *em, struct EditFace *efa); float EM_face_area(struct EditFace *efa); -void EM_add_data_layer(struct EditMesh *em, struct CustomData *data, int type); void EM_select_edge(struct EditEdge *eed, int sel); void EM_select_face(struct EditFace *efa, int sel); @@ -134,6 +133,9 @@ struct UvVertMap *EM_make_uv_vert_map(struct EditMesh *em, int selected, int do_ struct UvMapVert *EM_get_uv_map_vert(struct UvVertMap *vmap, unsigned int v); void EM_free_uv_vert_map(struct UvVertMap *vmap); +void EM_add_data_layer(struct EditMesh *em, struct CustomData *data, int type); +void EM_free_data_layer(struct EditMesh *em, struct CustomData *data, int type); + /* editmesh_mods.c */ extern unsigned int em_vertoffs, em_solidoffs, em_wireoffs; diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 5000dca3743..cc8b936b04f 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -617,7 +617,7 @@ void uiTemplateColorRamp(uiLayout *layout, struct ColorBand *coba, int expand); void uiTemplateCurveMapping(uiLayout *layout, struct CurveMapping *cumap, int type); void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, char *propname); void uiTemplateImageLayers(uiLayout *layout, struct bContext *C, struct Image *ima, struct ImageUser *iuser); -ListBase uiTemplateList(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *activeprop, int rows, int columns, int compact); +ListBase uiTemplateList(uiLayout *layout, struct PointerRNA *ptr, char *propname, struct PointerRNA *activeptr, char *activeprop, int rows, int columns, int compact); void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C); void uiTemplateOperatorSearch(uiLayout *layout); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index fcea74cc22b..00ec875bd86 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2184,7 +2184,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, RNA_property_int_range(ptr, prop, &hardmin, &hardmax); RNA_property_int_ui_range(ptr, prop, &softmin, &softmax, &step); - if(min == max) { + if(type != ROW && min == max) { min= hardmin; max= hardmax; } @@ -2199,7 +2199,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, RNA_property_float_range(ptr, prop, &hardmin, &hardmax); RNA_property_float_ui_range(ptr, prop, &softmin, &softmax, &step, &precision); - if(min == max) { + if(type != ROW && min == max) { min= hardmin; max= hardmax; } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 8b3f2bf4100..8f1d57b28ed 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1486,93 +1486,63 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, char *propname) /************************* List Template **************************/ -#if 0 -typedef struct ListItem { - PointerRNA ptr; - PropertyRNA *prop; - PropertyRNA *activeprop; - - PointerRNA activeptr; - int activei; - - int selected; -} ListItem; - -static void list_item_cb(bContext *C, void *arg_item, void *arg_unused) -{ - ListItem *item= (ListItem*)arg_item; - PropertyType activetype; - char *activename; - - if(item->selected) { - activetype= RNA_property_type(item->activeprop); - - if(activetype == PROP_POINTER) - RNA_property_pointer_set(&item->ptr, item->activeprop, item->activeptr); - else if(activetype == PROP_INT) - RNA_property_int_set(&item->ptr, item->activeprop, item->activei); - else if(activetype == PROP_STRING) { - activename= RNA_struct_name_get_alloc(&item->activeptr, NULL, 0); - RNA_property_string_set(&item->ptr, item->activeprop, activename); - MEM_freeN(activename); - } - } -} -#endif - -ListBase uiTemplateList(uiLayout *layout, PointerRNA *ptr, char *propname, char *activepropname, int rows, int columns, int compact) +ListBase uiTemplateList(uiLayout *layout, PointerRNA *ptr, char *propname, PointerRNA *activeptr, char *activepropname, int rows, int columns, int compact) { CollectionPointerLink *link; - PropertyRNA *prop, *activeprop; + PropertyRNA *prop= NULL, *activeprop; PropertyType type, activetype; - PointerRNA activeptr; uiLayout *box, *row, *col; uiBlock *block; uiBut *but; + Panel *pa; ListBase lb; - char *name, *activename= NULL, str[32]; - int i= 1, activei= 0, len, items, found; - static int scroll = 1; + char *name, str[32]; + int i= 0, activei= 0, len, items, found, min, max; lb.first= lb.last= NULL; /* validate arguments */ - if(!ptr->data) + block= uiLayoutGetBlock(layout); + pa= block->panel; + + if(!pa) { + printf("uiTemplateList: only works inside a panel.\n"); return lb; - - prop= RNA_struct_find_property(ptr, propname); - if(!prop) { - printf("uiTemplateList: property not found: %s\n", propname); + } + + if(!activeptr->data) return lb; + + if(ptr->data) { + prop= RNA_struct_find_property(ptr, propname); + if(!prop) { + printf("uiTemplateList: property not found: %s\n", propname); + return lb; + } } - activeprop= RNA_struct_find_property(ptr, activepropname); + activeprop= RNA_struct_find_property(activeptr, activepropname); if(!activeprop) { printf("uiTemplateList: property not found: %s\n", activepropname); return lb; } - type= RNA_property_type(prop); - if(type != PROP_COLLECTION) { - printf("uiTemplateList: expected collection property.\n"); - return lb; + if(prop) { + type= RNA_property_type(prop); + if(type != PROP_COLLECTION) { + printf("uiTemplateList: expected collection property.\n"); + return lb; + } } activetype= RNA_property_type(activeprop); - if(!ELEM3(activetype, PROP_POINTER, PROP_INT, PROP_STRING)) { - printf("uiTemplateList: expected pointer, integer or string property.\n"); + if(activetype != PROP_INT) { + printf("uiTemplateList: expected integer property.\n"); return lb; } /* get active data */ - if(activetype == PROP_POINTER) - activeptr= RNA_property_pointer_get(ptr, activeprop); - else if(activetype == PROP_INT) - activei= RNA_property_int_get(ptr, activeprop); - else if(activetype == PROP_STRING) - activename= RNA_property_string_get_alloc(ptr, activeprop, NULL, 0); - - block= uiLayoutGetBlock(layout); + activei= RNA_property_int_get(activeptr, activeprop); if(compact) { /* compact layout */ @@ -1580,111 +1550,105 @@ ListBase uiTemplateList(uiLayout *layout, PointerRNA *ptr, char *propname, char row= uiLayoutRow(layout, 1); - RNA_PROP_BEGIN(ptr, itemptr, prop) { - if(activetype == PROP_POINTER) - found= (activeptr.data == itemptr.data); - else if(activetype == PROP_INT) + if(ptr->data && prop) { + /* create list items */ + RNA_PROP_BEGIN(ptr, itemptr, prop) { found= (activei == i); - else if(activetype == PROP_STRING) - found= (strcmp(activename, name) == 0); - - if(found) { - name= RNA_struct_name_get_alloc(&itemptr, NULL, 0); - if(name) { - uiItemL(row, name, RNA_struct_ui_icon(itemptr.type)); - MEM_freeN(name); + + if(found) { + /* create button */ + name= RNA_struct_name_get_alloc(&itemptr, NULL, 0); + if(name) { + uiItemL(row, name, RNA_struct_ui_icon(itemptr.type)); + MEM_freeN(name); + } + + /* add to list to return */ + link= MEM_callocN(sizeof(CollectionPointerLink), "uiTemplateList return"); + link->ptr= itemptr; + BLI_addtail(&lb, link); } - link= MEM_callocN(sizeof(CollectionPointerLink), "uiTemplateList return"); - link->ptr= itemptr; - BLI_addtail(&lb, link); + i++; } - - i++; + RNA_PROP_END; } - RNA_PROP_END; - if(i == 1) + /* if not found, add in dummy button */ + if(i == 0) uiItemL(row, "", 0); - sprintf(str, "%d :", i-1); - but= uiDefIconTextButR(block, NUM, 0, 0, str, 0,0,UI_UNIT_X*5,UI_UNIT_Y, ptr, activepropname, 0, 0, 0, 0, 0, ""); - if(i == 1) + /* next/prev button */ + sprintf(str, "%d :", i); + but= uiDefIconTextButR(block, NUM, 0, 0, str, 0,0,UI_UNIT_X*5,UI_UNIT_Y, activeptr, activepropname, 0, 0, 0, 0, 0, ""); + if(i == 0) uiButSetFlag(but, UI_BUT_DISABLED); } else { + /* default rows/columns */ if(rows == 0) rows= 5; if(columns == 0) columns= 1; - items= rows*columns; - + /* layout */ box= uiLayoutBox(layout); row= uiLayoutRow(box, 0); col = uiLayoutColumn(row, 1); uiBlockSetEmboss(block, UI_EMBOSSN); - len= RNA_property_collection_length(ptr, prop); - scroll= MIN2(scroll, len-items+1); - scroll= MAX2(scroll, 1); + /* init numbers */ + RNA_property_int_range(activeptr, activeprop, &min, &max); - RNA_PROP_BEGIN(ptr, itemptr, prop) { - if(i >= scroll && iptr= *ptr; - item->prop= prop; - item->activeprop= activeprop; - item->activeptr= itemptr; - item->activei= i; - - if(activetype == PROP_POINTER) - item->selected= (activeptr.data == itemptr.data)? i: -1; - else if(activetype == PROP_INT) - item->selected= (activei == i)? i: -1; - else if(activetype == PROP_STRING) - item->selected= (strcmp(activename, name) == 0)? i: -1; -#endif + pa->list_scroll= MIN2(pa->list_scroll, len-items); + pa->list_scroll= MAX2(pa->list_scroll, 0); - //but= uiDefIconTextButI(block, ROW, 0, RNA_struct_ui_icon(itemptr.type), name, 0,0,UI_UNIT_X*10,UI_UNIT_Y, &item->selected, 0, i, 0, 0, ""); - but= uiDefIconTextButR(block, ROW, 0, RNA_struct_ui_icon(itemptr.type), name, 0,0,UI_UNIT_X*10,UI_UNIT_Y, ptr, activepropname, 0/*&item->selected*/, 0, i, 0, 0, ""); - uiButSetFlag(but, UI_ICON_LEFT|UI_TEXT_LEFT); - //uiButSetNFunc(but, list_item_cb, item, NULL); + if(ptr->data && prop) { + /* create list items */ + RNA_PROP_BEGIN(ptr, itemptr, prop) { + if(i >= pa->list_scroll && ilist_scroll+items) { + name= RNA_struct_name_get_alloc(&itemptr, NULL, 0); - MEM_freeN(name); + if(name) { + /* create button */ + but= uiDefIconTextButR(block, ROW, 0, RNA_struct_ui_icon(itemptr.type), name, 0,0,UI_UNIT_X*10,UI_UNIT_Y, activeptr, activepropname, 0, 0, i, 0, 0, ""); + uiButSetFlag(but, UI_ICON_LEFT|UI_TEXT_LEFT); + MEM_freeN(name); + } + + /* add to list to return */ link= MEM_callocN(sizeof(CollectionPointerLink), "uiTemplateList return"); link->ptr= itemptr; BLI_addtail(&lb, link); } - } - i++; + i++; + } + RNA_PROP_END; } - RNA_PROP_END; - while(i < scroll+items) { - if(i >= scroll) + /* add dummy buttons to fill space */ + while(i < pa->list_scroll+items) { + if(i >= pa->list_scroll) uiItemL(col, "", 0); i++; } uiBlockSetEmboss(block, UI_EMBOSS); + /* add scrollbar */ if(len > items) { col= uiLayoutColumn(row, 0); - uiDefButI(block, SCROLL, 0, "", 0,0,UI_UNIT_X*0.75,UI_UNIT_Y*items, &scroll, 1, len-items+1, items, 0, ""); + uiDefButI(block, SCROLL, 0, "", 0,0,UI_UNIT_X*0.75,UI_UNIT_Y*items, &pa->list_scroll, 0, len-items, items, 0, ""); } - - //uiDefButI(block, SCROLL, 0, "", 0,0,UI_UNIT_X*15,UI_UNIT_Y*0.75, &scroll, 1, 16-5, 5, 0, ""); } + /* return items in list */ return lb; } diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index ddf31c0db66..ed2d00cb00d 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1679,12 +1679,12 @@ static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat rect1= *rect; if(horizontal) { - fac= (rect->xmax - rect->xmin)/(size-1); + fac= (rect->xmax - rect->xmin)/(size); rect1.xmin= rect1.xmin + ceil(fac*(value - but->softmin)); rect1.xmax= rect1.xmin + ceil(fac*(but->a1 - but->softmin)); } else { - fac= (rect->ymax - rect->ymin)/(size-1); + fac= (rect->ymax - rect->ymin)/(size); rect1.ymax= rect1.ymax - ceil(fac*(value - but->softmin)); rect1.ymin= rect1.ymax - ceil(fac*(but->a1 - but->softmin)); } diff --git a/source/blender/editors/mesh/editdeform.c b/source/blender/editors/mesh/editdeform.c deleted file mode 100644 index 3ccd4d56ece..00000000000 --- a/source/blender/editors/mesh/editdeform.c +++ /dev/null @@ -1,1110 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - * Creator-specific support for vertex deformation groups - * Added: apply deform function (ton) - */ - -#include - -#include "MEM_guardedalloc.h" - -#include "DNA_cloth_types.h" -#include "DNA_curve_types.h" -#include "DNA_lattice_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" -#include "DNA_object_force.h" -#include "DNA_scene_types.h" -#include "DNA_particle_types.h" -#include "DNA_windowmanager_types.h" - -#include "BLI_blenlib.h" -#include "BLI_editVert.h" - -#include "BKE_customdata.h" -#include "BKE_DerivedMesh.h" -#include "BKE_depsgraph.h" -#include "BKE_deform.h" -#include "BKE_displist.h" -#include "BKE_global.h" -#include "BKE_lattice.h" -#include "BKE_mesh.h" -#include "BKE_utildefines.h" - -#include "ED_mesh.h" -#include "ED_view3d.h" -#include "mesh_intern.h" - -/* XXX */ -static void BIF_undo_push() {} -static void error() {} - -static Lattice *def_get_lattice(Object *ob) -{ - if(ob->type==OB_LATTICE) { - Lattice *lt= ob->data; - if(lt->editlatt) - return lt->editlatt; - return lt; - } - return NULL; -} - -/* only in editmode */ -void sel_verts_defgroup (Object *obedit, int select) -{ - EditVert *eve; - Object *ob; - int i; - MDeformVert *dvert; - - ob= obedit; - - if (!ob) - return; - - switch (ob->type){ - case OB_MESH: - { - Mesh *me= ob->data; - EditMesh *em = BKE_mesh_get_editmesh(me); - - for (eve=em->verts.first; eve; eve=eve->next){ - dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); - - if (dvert && dvert->totweight){ - for (i=0; itotweight; i++){ - if (dvert->dw[i].def_nr == (ob->actdef-1)){ - if (select) eve->f |= SELECT; - else eve->f &= ~SELECT; - - break; - } - } - } - } - /* this has to be called, because this function operates on vertices only */ - if(select) EM_select_flush(em); // vertices to edges/faces - else EM_deselect_flush(em); - - BKE_mesh_end_editmesh(me, em); - } - break; - case OB_LATTICE: - { - Lattice *lt= def_get_lattice(ob); - - if(lt->dvert) { - BPoint *bp; - int a, tot; - - dvert= lt->dvert; - - tot= lt->pntsu*lt->pntsv*lt->pntsw; - for(a=0, bp= lt->def; atotweight; i++){ - if (dvert->dw[i].def_nr == (ob->actdef-1)) { - if(select) bp->f1 |= SELECT; - else bp->f1 &= ~SELECT; - - break; - } - } - } - } - } - break; - - default: - break; - } -} - -/* check if deform vertex has defgroup index */ -MDeformWeight *get_defweight (MDeformVert *dv, int defgroup) -{ - int i; - - if (!dv || defgroup<0) - return NULL; - - for (i=0; itotweight; i++){ - if (dv->dw[i].def_nr == defgroup) - return dv->dw+i; - } - return NULL; -} - -/* Ensures that mv has a deform weight entry for - the specified defweight group */ -/* Note this function is mirrored in editmesh_tools.c, for use for editvertices */ -MDeformWeight *verify_defweight (MDeformVert *dv, int defgroup) -{ - MDeformWeight *newdw; - - /* do this check always, this function is used to check for it */ - if (!dv || defgroup<0) - return NULL; - - newdw = get_defweight (dv, defgroup); - if (newdw) - return newdw; - - newdw = MEM_callocN (sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight"); - if (dv->dw){ - memcpy (newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight); - MEM_freeN (dv->dw); - } - dv->dw=newdw; - - dv->dw[dv->totweight].weight=0.0f; - dv->dw[dv->totweight].def_nr=defgroup; - /* Group index */ - - dv->totweight++; - - return dv->dw+(dv->totweight-1); -} - -bDeformGroup *add_defgroup_name (Object *ob, char *name) -{ - bDeformGroup *defgroup; - - if (!ob) - return NULL; - - defgroup = MEM_callocN (sizeof(bDeformGroup), "add deformGroup"); - - BLI_strncpy (defgroup->name, name, 32); - - BLI_addtail(&ob->defbase, defgroup); - unique_vertexgroup_name(defgroup, ob); - - ob->actdef = BLI_countlist(&ob->defbase); - - return defgroup; -} - -void add_defgroup (Object *ob) -{ - add_defgroup_name (ob, "Group"); -} - - -void duplicate_defgroup ( Object *ob ) -{ - bDeformGroup *dg, *cdg; - char name[32], s[32]; - MDeformWeight *org, *cpy; - MDeformVert *dvert, *dvert_array; - int i, idg, icdg, dvert_tot; - - if (ob->type != OB_MESH && ob->type != OB_LATTICE) - return; - - dg = BLI_findlink (&ob->defbase, (ob->actdef-1)); - if (!dg) - return; - - if (strstr(dg->name, "_copy")) { - BLI_strncpy (name, dg->name, 32); /* will be renamed _copy.001... etc */ - } else { - BLI_snprintf (name, 32, "%s_copy", dg->name); - while (get_named_vertexgroup (ob, name)) { - if ((strlen (name) + 6) > 32) { - error ("Error: the name for the new group is > 32 characters"); - return; - } - strcpy (s, name); - BLI_snprintf (name, 32, "%s_copy", s); - } - } - - cdg = copy_defgroup (dg); - strcpy (cdg->name, name); - unique_vertexgroup_name(cdg, ob); - - BLI_addtail (&ob->defbase, cdg); - - idg = (ob->actdef-1); - ob->actdef = BLI_countlist (&ob->defbase); - icdg = (ob->actdef-1); - - if(ob->type == OB_MESH) { - Mesh *me = get_mesh (ob); - dvert_array= me->dvert; - dvert_tot= me->totvert; - } - else if (ob->type == OB_LATTICE) { - Lattice *lt= (Lattice *)ob->data; - dvert_array= lt->dvert; - dvert_tot= lt->pntsu*lt->pntsv*lt->pntsw; - } - - if (!dvert_array) - return; - - for (i = 0; i < dvert_tot; i++) { - dvert = dvert_array+i; - org = get_defweight (dvert, idg); - if (org) { - float weight = org->weight; - /* verify_defweight re-allocs org so need to store the weight first */ - cpy = verify_defweight (dvert, icdg); - cpy->weight = weight; - } - } -} - -static void del_defgroup_update_users(Object *ob, int id) -{ - ExplodeModifierData *emd; - ModifierData *md; - ParticleSystem *psys; - ClothModifierData *clmd; - ClothSimSettings *clsim; - int a; - - /* these cases don't use names to refer to vertex groups, so when - * they get deleted the numbers get out of sync, this corrects that */ - - if(ob->soft) { - if(ob->soft->vertgroup == id) - ob->soft->vertgroup= 0; - else if(ob->soft->vertgroup > id) - ob->soft->vertgroup--; - } - - for(md=ob->modifiers.first; md; md=md->next) { - if(md->type == eModifierType_Explode) { - emd= (ExplodeModifierData*)md; - - if(emd->vgroup == id) - emd->vgroup= 0; - else if(emd->vgroup > id) - emd->vgroup--; - } - else if(md->type == eModifierType_Cloth) { - clmd= (ClothModifierData*)md; - clsim= clmd->sim_parms; - - if(clsim) { - if(clsim->vgroup_mass == id) - clsim->vgroup_mass= 0; - else if(clsim->vgroup_mass > id) - clsim->vgroup_mass--; - - if(clsim->vgroup_bend == id) - clsim->vgroup_bend= 0; - else if(clsim->vgroup_bend > id) - clsim->vgroup_bend--; - - if(clsim->vgroup_struct == id) - clsim->vgroup_struct= 0; - else if(clsim->vgroup_struct > id) - clsim->vgroup_struct--; - } - } - } - - for(psys=ob->particlesystem.first; psys; psys=psys->next) { - for(a=0; avgroup[a] == id) - psys->vgroup[a]= 0; - else if(psys->vgroup[a] > id) - psys->vgroup[a]--; - } -} - -void del_defgroup_in_object_mode ( Object *ob ) -{ - bDeformGroup *dg; - MDeformVert *dvert_array, *dvert; - - int i, e, dvert_tot; - - if ((!ob) || (ob->type != OB_MESH && ob->type != OB_LATTICE)) - return; - - if(ob->type == OB_MESH) { - Mesh *me = get_mesh (ob); - dvert_array= me->dvert; - dvert_tot= me->totvert; - } - else if (ob->type == OB_LATTICE) { - Lattice *lt= (Lattice *)ob->data; - dvert_array= lt->dvert; - dvert_tot= lt->pntsu*lt->pntsv*lt->pntsw; - } - - dg = BLI_findlink (&ob->defbase, (ob->actdef-1)); - if (!dg) - return; - - if (dvert_array) { - for (i = 0; i < dvert_tot; i++) { - dvert = dvert_array + i; - if (dvert) { - if (get_defweight (dvert, (ob->actdef-1))) - remove_vert_defgroup (ob, dg, i); - } - } - - for (i = 0; i < dvert_tot; i++) { - dvert = dvert_array+i; - if (dvert) { - for (e = 0; e < dvert->totweight; e++) { - if (dvert->dw[e].def_nr > (ob->actdef-1)) - dvert->dw[e].def_nr--; - } - } - } - } - - del_defgroup_update_users(ob, ob->actdef); - - /* Update the active deform index if necessary */ - if (ob->actdef == BLI_countlist(&ob->defbase)) - ob->actdef--; - - /* Remove the group */ - BLI_freelinkN (&ob->defbase, dg); -} - -void del_defgroup (Object *ob) -{ - bDeformGroup *defgroup; - int i; - - if (!ob) - return; - - if (!ob->actdef) - return; - - defgroup = BLI_findlink(&ob->defbase, ob->actdef-1); - if (!defgroup) - return; - - /* Make sure that no verts are using this group */ - remove_verts_defgroup(ob, 1); - - /* Make sure that any verts with higher indices are adjusted accordingly */ - if(ob->type==OB_MESH) { - Mesh *me= ob->data; - EditMesh *em = BKE_mesh_get_editmesh(me); - EditVert *eve; - MDeformVert *dvert; - - for (eve=em->verts.first; eve; eve=eve->next){ - dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); - - if (dvert) - for (i=0; itotweight; i++) - if (dvert->dw[i].def_nr > (ob->actdef-1)) - dvert->dw[i].def_nr--; - } - BKE_mesh_end_editmesh(me, em); - } - else if(ob->type==OB_LATTICE) { - Lattice *lt= def_get_lattice(ob); - BPoint *bp; - MDeformVert *dvert= lt->dvert; - int a, tot; - - if (dvert) { - tot= lt->pntsu*lt->pntsv*lt->pntsw; - for(a=0, bp= lt->def; atotweight; i++){ - if (dvert->dw[i].def_nr > (ob->actdef-1)) - dvert->dw[i].def_nr--; - } - } - } - } - - del_defgroup_update_users(ob, ob->actdef); - - /* Update the active deform index if necessary */ - if (ob->actdef==BLI_countlist(&ob->defbase)) - ob->actdef--; - - /* Remove the group */ - BLI_freelinkN (&ob->defbase, defgroup); - - /* remove all dverts */ - if(ob->actdef==0) { - if(ob->type==OB_MESH) { - Mesh *me= ob->data; - CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert); - me->dvert= NULL; - } - else if(ob->type==OB_LATTICE) { - Lattice *lt= def_get_lattice(ob); - if (lt->dvert) { - MEM_freeN(lt->dvert); - lt->dvert= NULL; - } - } - } -} - -void del_all_defgroups (Object *ob) -{ - /* Sanity check */ - if (ob == NULL) - return; - - /* Remove all DVerts */ - if (ob->type==OB_MESH) { - Mesh *me= ob->data; - CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert); - me->dvert= NULL; - } - else if(ob->type==OB_LATTICE) { - Lattice *lt= def_get_lattice(ob); - if (lt->dvert) { - MEM_freeN(lt->dvert); - lt->dvert= NULL; - } - } - - /* Remove all DefGroups */ - BLI_freelistN(&ob->defbase); - - /* Fix counters/indices */ - ob->actdef= 0; -} - -void create_dverts(ID *id) -{ - /* create deform verts - */ - - if( GS(id->name)==ID_ME) { - Mesh *me= (Mesh *)id; - me->dvert= CustomData_add_layer(&me->vdata, CD_MDEFORMVERT, CD_CALLOC, NULL, me->totvert); - } - else if( GS(id->name)==ID_LT) { - Lattice *lt= (Lattice *)id; - lt->dvert= MEM_callocN(sizeof(MDeformVert)*lt->pntsu*lt->pntsv*lt->pntsw, "lattice deformVert"); - } -} - -/* for mesh in object mode - lattice can be in editmode */ -void remove_vert_def_nr (Object *ob, int def_nr, int vertnum) -{ - /* This routine removes the vertex from the deform - * group with number def_nr. - * - * This routine is meant to be fast, so it is the - * responsibility of the calling routine to: - * a) test whether ob is non-NULL - * b) test whether ob is a mesh - * c) calculate def_nr - */ - - MDeformWeight *newdw; - MDeformVert *dvert= NULL; - int i; - - /* get the deform vertices corresponding to the - * vertnum - */ - if(ob->type==OB_MESH) { - if( ((Mesh*)ob->data)->dvert ) - dvert = ((Mesh*)ob->data)->dvert + vertnum; - } - else if(ob->type==OB_LATTICE) { - Lattice *lt= def_get_lattice(ob); - - if(lt->dvert) - dvert = lt->dvert + vertnum; - } - - if(dvert==NULL) - return; - - /* for all of the deform weights in the - * deform vert - */ - for (i=dvert->totweight - 1 ; i>=0 ; i--){ - - /* if the def_nr is the same as the one - * for our weight group then remove it - * from this deform vert. - */ - if (dvert->dw[i].def_nr == def_nr) { - dvert->totweight--; - - /* if there are still other deform weights - * attached to this vert then remove this - * deform weight, and reshuffle the others - */ - if (dvert->totweight) { - newdw = MEM_mallocN (sizeof(MDeformWeight)*(dvert->totweight), - "deformWeight"); - if (dvert->dw){ - memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*i); - memcpy (newdw+i, dvert->dw+i+1, - sizeof(MDeformWeight)*(dvert->totweight-i)); - MEM_freeN (dvert->dw); - } - dvert->dw=newdw; - } - /* if there are no other deform weights - * left then just remove the deform weight - */ - else { - MEM_freeN (dvert->dw); - dvert->dw = NULL; - break; - } - } - } - -} - -/* for Mesh in Object mode */ -/* allows editmode for Lattice */ -void add_vert_defnr (Object *ob, int def_nr, int vertnum, - float weight, int assignmode) -{ - /* add the vert to the deform group with the - * specified number - */ - MDeformVert *dv= NULL; - MDeformWeight *newdw; - int i; - - /* get the vert */ - if(ob->type==OB_MESH) { - if(((Mesh*)ob->data)->dvert) - dv = ((Mesh*)ob->data)->dvert + vertnum; - } - else if(ob->type==OB_LATTICE) { - Lattice *lt= def_get_lattice(ob); - - if(lt->dvert) - dv = lt->dvert + vertnum; - } - - if(dv==NULL) - return; - - /* Lets first check to see if this vert is - * already in the weight group -- if so - * lets update it - */ - for (i=0; itotweight; i++){ - - /* if this weight cooresponds to the - * deform group, then add it using - * the assign mode provided - */ - if (dv->dw[i].def_nr == def_nr){ - - switch (assignmode) { - case WEIGHT_REPLACE: - dv->dw[i].weight=weight; - break; - case WEIGHT_ADD: - dv->dw[i].weight+=weight; - if (dv->dw[i].weight >= 1.0) - dv->dw[i].weight = 1.0; - break; - case WEIGHT_SUBTRACT: - dv->dw[i].weight-=weight; - /* if the weight is zero or less then - * remove the vert from the deform group - */ - if (dv->dw[i].weight <= 0.0) - remove_vert_def_nr(ob, def_nr, vertnum); - break; - } - return; - } - } - - /* if the vert wasn't in the deform group then - * we must take a different form of action ... - */ - - switch (assignmode) { - case WEIGHT_SUBTRACT: - /* if we are subtracting then we don't - * need to do anything - */ - return; - - case WEIGHT_REPLACE: - case WEIGHT_ADD: - /* if we are doing an additive assignment, then - * we need to create the deform weight - */ - newdw = MEM_callocN (sizeof(MDeformWeight)*(dv->totweight+1), - "deformWeight"); - if (dv->dw){ - memcpy (newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight); - MEM_freeN (dv->dw); - } - dv->dw=newdw; - - dv->dw[dv->totweight].weight=weight; - dv->dw[dv->totweight].def_nr=def_nr; - - dv->totweight++; - break; - } -} - -/* called while not in editmode */ -void add_vert_to_defgroup (Object *ob, bDeformGroup *dg, int vertnum, - float weight, int assignmode) -{ - /* add the vert to the deform group with the - * specified assign mode - */ - int def_nr; - - /* get the deform group number, exit if - * it can't be found - */ - def_nr = get_defgroup_num(ob, dg); - if (def_nr < 0) return; - - /* if there's no deform verts then - * create some - */ - if(ob->type==OB_MESH) { - if (!((Mesh*)ob->data)->dvert) - create_dverts(ob->data); - } - else if(ob->type==OB_LATTICE) { - if (!((Lattice*)ob->data)->dvert) - create_dverts(ob->data); - } - - /* call another function to do the work - */ - add_vert_defnr (ob, def_nr, vertnum, weight, assignmode); -} - -/* Only available in editmode */ -void assign_verts_defgroup (Object *obedit, float weight) -{ - Object *ob; - EditVert *eve; - bDeformGroup *dg, *eg; - MDeformWeight *newdw; - MDeformVert *dvert; - int i, done; - -// XXX if(multires_level1_test()) return; - - ob= obedit; - - if (!ob) - return; - - dg=BLI_findlink(&ob->defbase, ob->actdef-1); - if (!dg){ - error ("No vertex group is active"); - return; - } - - switch (ob->type){ - case OB_MESH: - { - Mesh *me= ob->data; - EditMesh *em = BKE_mesh_get_editmesh(me); - - if (!CustomData_has_layer(&em->vdata, CD_MDEFORMVERT)) - EM_add_data_layer(em, &em->vdata, CD_MDEFORMVERT); - - /* Go through the list of editverts and assign them */ - for (eve=em->verts.first; eve; eve=eve->next){ - dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); - - if (dvert && (eve->f & 1)){ - done=0; - /* See if this vert already has a reference to this group */ - /* If so: Change its weight */ - done=0; - for (i=0; itotweight; i++){ - eg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr); - /* Find the actual group */ - if (eg==dg){ - dvert->dw[i].weight= weight; - done=1; - break; - } - } - /* If not: Add the group and set its weight */ - if (!done){ - newdw = MEM_callocN (sizeof(MDeformWeight)*(dvert->totweight+1), "deformWeight"); - if (dvert->dw){ - memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*dvert->totweight); - MEM_freeN (dvert->dw); - } - dvert->dw=newdw; - - dvert->dw[dvert->totweight].weight= weight; - dvert->dw[dvert->totweight].def_nr= ob->actdef-1; - - dvert->totweight++; - - } - } - } - BKE_mesh_end_editmesh(me, em); - } - break; - case OB_LATTICE: - { - Lattice *lt= def_get_lattice(ob); - BPoint *bp; - int a, tot; - - if(lt->dvert==NULL) - create_dverts(<->id); - - tot= lt->pntsu*lt->pntsv*lt->pntsw; - for(a=0, bp= lt->def; af1 & SELECT) - add_vert_defnr (ob, ob->actdef-1, a, weight, WEIGHT_REPLACE); - } - } - break; - default: - printf ("Assigning deformation groups to unknown object type\n"); - break; - } - -} - -/* mesh object mode, lattice can be in editmode */ -void remove_vert_defgroup (Object *ob, bDeformGroup *dg, int vertnum) -{ - /* This routine removes the vertex from the specified - * deform group. - */ - - int def_nr; - - /* if the object is NULL abort - */ - if (!ob) - return; - - /* get the deform number that cooresponds - * to this deform group, and abort if it - * can not be found. - */ - def_nr = get_defgroup_num(ob, dg); - if (def_nr < 0) return; - - /* call another routine to do the work - */ - remove_vert_def_nr (ob, def_nr, vertnum); -} - -/* for mesh in object mode lattice can be in editmode */ -static float get_vert_def_nr (Object *ob, int def_nr, int vertnum) -{ - MDeformVert *dvert= NULL; - int i; - - /* get the deform vertices corresponding to the - * vertnum - */ - if(ob->type==OB_MESH) { - if( ((Mesh*)ob->data)->dvert ) - dvert = ((Mesh*)ob->data)->dvert + vertnum; - } - else if(ob->type==OB_LATTICE) { - Lattice *lt= def_get_lattice(ob); - - if(lt->dvert) - dvert = lt->dvert + vertnum; - } - - if(dvert==NULL) - return 0.0f; - - for(i=dvert->totweight-1 ; i>=0 ; i--) - if(dvert->dw[i].def_nr == def_nr) - return dvert->dw[i].weight; - - return 0.0f; -} - -/* mesh object mode, lattice can be in editmode */ -float get_vert_defgroup (Object *ob, bDeformGroup *dg, int vertnum) -{ - int def_nr; - - if(!ob) - return 0.0f; - - def_nr = get_defgroup_num(ob, dg); - if(def_nr < 0) return 0.0f; - - return get_vert_def_nr (ob, def_nr, vertnum); -} - -/* Only available in editmode */ -/* removes from active defgroup, if allverts==0 only selected vertices */ -void remove_verts_defgroup (Object *obedit, int allverts) -{ - Object *ob; - EditVert *eve; - MDeformVert *dvert; - MDeformWeight *newdw; - bDeformGroup *dg, *eg; - int i; - -// XXX if(multires_level1_test()) return; - - ob= obedit; - - if (!ob) - return; - - dg=BLI_findlink(&ob->defbase, ob->actdef-1); - if (!dg){ - error ("No vertex group is active"); - return; - } - - switch (ob->type){ - case OB_MESH: - { - Mesh *me= ob->data; - EditMesh *em = BKE_mesh_get_editmesh(me); - - for (eve=em->verts.first; eve; eve=eve->next){ - dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); - - if (dvert && dvert->dw && ((eve->f & 1) || allverts)){ - for (i=0; itotweight; i++){ - /* Find group */ - eg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr); - if (eg == dg){ - dvert->totweight--; - if (dvert->totweight){ - newdw = MEM_mallocN (sizeof(MDeformWeight)*(dvert->totweight), "deformWeight"); - - if (dvert->dw){ - memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*i); - memcpy (newdw+i, dvert->dw+i+1, sizeof(MDeformWeight)*(dvert->totweight-i)); - MEM_freeN (dvert->dw); - } - dvert->dw=newdw; - } - else{ - MEM_freeN (dvert->dw); - dvert->dw=NULL; - break; - } - } - } - } - } - BKE_mesh_end_editmesh(me, em); - } - break; - case OB_LATTICE: - { - Lattice *lt= def_get_lattice(ob); - - if(lt->dvert) { - BPoint *bp; - int a, tot= lt->pntsu*lt->pntsv*lt->pntsw; - - for(a=0, bp= lt->def; af1 & SELECT)) - remove_vert_defgroup (ob, dg, a); - } - } - } - break; - - default: - printf ("Removing deformation groups from unknown object type\n"); - break; - } -} - -/* Only available in editmode */ -/* removes from all defgroup, if allverts==0 only selected vertices */ -void remove_verts_defgroups(Object *obedit, int allverts) -{ - Object *ob; - int actdef, defCount; - -// XXX if (multires_level1_test()) return; - - ob= obedit; - if (ob == NULL) return; - - actdef= ob->actdef; - defCount= BLI_countlist(&ob->defbase); - - if (defCount == 0) { - error("Object has no vertex groups"); - return; - } - - /* To prevent code redundancy, we just use remove_verts_defgroup, but that - * only operates on the active vgroup. So we iterate through all groups, by changing - * active group index - */ - for (ob->actdef= 1; ob->actdef <= defCount; ob->actdef++) - remove_verts_defgroup(ob, allverts); - - ob->actdef= actdef; -} - -void vertexgroup_select_by_name(Object *ob, char *name) -{ - bDeformGroup *curdef; - int actdef= 1; - - if(ob==NULL) return; - - for (curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++){ - if (!strcmp(curdef->name, name)) { - ob->actdef= actdef; - return; - } - } - ob->actdef=0; // this signals on painting to create a new one, if a bone in posemode is selected */ -} - -/* This function provides a shortcut for adding/removing verts from - * vertex groups. It is called by the Ctrl-G hotkey in EditMode for Meshes - * and Lattices. (currently only restricted to those two) - * It is only responsible for - */ -void vgroup_assign_with_menu(Scene *scene, Object *ob) -{ - VPaint *wp= scene->toolsettings->wpaint; - int defCount; - int mode= 0; - - /* prevent crashes */ - if (wp==NULL || ob==NULL) return; - - defCount= BLI_countlist(&ob->defbase); - - /* give user choices of adding to current/new or removing from current */ -// XXX if (defCount && ob->actdef) -// mode = pupmenu("Vertex Groups %t|Add Selected to New Group %x1|Add Selected to Active Group %x2|Remove Selected from Active Group %x3|Remove Selected from All Groups %x4"); -// else -// mode= pupmenu("Vertex Groups %t|Add Selected to New Group %x1"); - - /* handle choices */ - switch (mode) { - case 1: /* add to new group */ - add_defgroup(ob); - assign_verts_defgroup(ob, wp->brush->alpha); - BIF_undo_push("Assign to vertex group"); - break; - case 2: /* add to current group */ - assign_verts_defgroup(ob, wp->brush->alpha); - BIF_undo_push("Assign to vertex group"); - break; - case 3: /* remove from current group */ - remove_verts_defgroup(ob, 0); - BIF_undo_push("Remove from vertex group"); - break; - case 4: /* remove from all groups */ - remove_verts_defgroups(ob, 0); - BIF_undo_push("Remove from all vertex groups"); - break; - } -} - -/* This function provides a shortcut for commonly used vertex group - * functions - change weight (not implemented), change active group, delete active group, - * when Ctrl-Shift-G is used in EditMode, for Meshes and Lattices (only for now). - */ -void vgroup_operation_with_menu(Object *ob) -{ - int defCount; - int mode= 0; - - /* prevent crashes and useless cases */ - if (ob==NULL) return; - - defCount= BLI_countlist(&ob->defbase); - if (defCount == 0) return; - - /* give user choices of adding to current/new or removing from current */ -// XXX if (ob->actdef) -// mode = pupmenu("Vertex Groups %t|Change Active Group%x1|Delete Active Group%x2|Delete All Groups%x3"); -// else -// mode= pupmenu("Vertex Groups %t|Change Active Group%x1|Delete All Groups%x3"); - - /* handle choices */ - switch (mode) { - case 1: /* change active group*/ - { - char *menustr= NULL; // XXX get_vertexgroup_menustr(ob); - short nr; - - if (menustr) { -// XXX nr= pupmenu(menustr); - - if ((nr >= 1) && (nr <= defCount)) - ob->actdef= nr; - - MEM_freeN(menustr); - } - } - break; - case 2: /* delete active group */ - { - del_defgroup(ob); - BIF_undo_push("Delete vertex group"); - } - break; - case 3: /* delete all groups */ - { - del_all_defgroups(ob); - BIF_undo_push("Delete all vertex groups"); - } - break; - } -} - - diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 83a4211dda1..22e3b4060a4 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -234,5 +234,14 @@ void MESH_OT_colors_mirror(struct wmOperatorType *ot); void MESH_OT_delete(struct wmOperatorType *ot); void MESH_OT_rip(struct wmOperatorType *ot); +/* ******************* mesh_layers.c */ + +void MESH_OT_uv_texture_add(struct wmOperatorType *ot); +void MESH_OT_uv_texture_remove(struct wmOperatorType *ot); +void MESH_OT_vertex_color_add(struct wmOperatorType *ot); +void MESH_OT_vertex_color_remove(struct wmOperatorType *ot); +void MESH_OT_sticky_add(struct wmOperatorType *ot); +void MESH_OT_sticky_remove(struct wmOperatorType *ot); + #endif // MESH_INTERN_H diff --git a/source/blender/editors/mesh/mesh_layers.c b/source/blender/editors/mesh/mesh_layers.c new file mode 100644 index 00000000000..99d50d1a9b0 --- /dev/null +++ b/source/blender/editors/mesh/mesh_layers.c @@ -0,0 +1,424 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "MEM_guardedalloc.h" + +#include "DNA_customdata_types.h" +#include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" +#include "DNA_object_types.h" +#include "DNA_scene_types.h" +#include "DNA_windowmanager_types.h" + +#include "BKE_context.h" +#include "BKE_customdata.h" +#include "BKE_depsgraph.h" +#include "BKE_displist.h" +#include "BKE_global.h" +#include "BKE_mesh.h" + +#include "BLI_editVert.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "ED_mesh.h" +#include "ED_view3d.h" + +#include "mesh_intern.h" + +static void delete_customdata_layer(Mesh *me, CustomDataLayer *layer) +{ + CustomData *data= (me->edit_mesh)? &me->edit_mesh->fdata: &me->fdata; + void *actlayerdata, *rndlayerdata, *clonelayerdata, *masklayerdata, *layerdata=layer->data; + int type= layer->type; + int index= CustomData_get_layer_index(data, type); + int i, actindex, rndindex, cloneindex, maskindex; + + /* ok, deleting a non-active layer needs to preserve the active layer indices. + to do this, we store a pointer to the .data member of both layer and the active layer, + (to detect if we're deleting the active layer or not), then use the active + layer data pointer to find where the active layer has ended up. + + this is necassary because the deletion functions only support deleting the active + layer. */ + actlayerdata = data->layers[CustomData_get_active_layer_index(data, type)].data; + rndlayerdata = data->layers[CustomData_get_render_layer_index(data, type)].data; + clonelayerdata = data->layers[CustomData_get_clone_layer_index(data, type)].data; + masklayerdata = data->layers[CustomData_get_mask_layer_index(data, type)].data; + CustomData_set_layer_active(data, type, layer - &data->layers[index]); + + if(me->edit_mesh) { + EM_free_data_layer(me->edit_mesh, data, type); + } + else { + CustomData_free_layer_active(data, type, me->totface); + mesh_update_customdata_pointers(me); + } + + if(!CustomData_has_layer(data, type)) + if(type == CD_MCOL && (G.f & G_VERTEXPAINT)) + G.f &= ~G_VERTEXPAINT; /* get out of vertexpaint mode */ + + /* reconstruct active layer */ + if (actlayerdata != layerdata) { + /* find index */ + actindex = CustomData_get_layer_index(data, type); + for (i=actindex; itotlayer; i++) { + if (data->layers[i].data == actlayerdata) { + actindex = i - actindex; + break; + } + } + + /* set index */ + CustomData_set_layer_active(data, type, actindex); + } + + if (rndlayerdata != layerdata) { + /* find index */ + rndindex = CustomData_get_layer_index(data, type); + for (i=rndindex; itotlayer; i++) { + if (data->layers[i].data == rndlayerdata) { + rndindex = i - rndindex; + break; + } + } + + /* set index */ + CustomData_set_layer_render(data, type, rndindex); + } + + if (clonelayerdata != layerdata) { + /* find index */ + cloneindex = CustomData_get_layer_index(data, type); + for (i=cloneindex; itotlayer; i++) { + if (data->layers[i].data == clonelayerdata) { + cloneindex = i - cloneindex; + break; + } + } + + /* set index */ + CustomData_set_layer_clone(data, type, cloneindex); + } + + if (masklayerdata != layerdata) { + /* find index */ + maskindex = CustomData_get_layer_index(data, type); + for (i=maskindex; itotlayer; i++) { + if (data->layers[i].data == masklayerdata) { + maskindex = i - maskindex; + break; + } + } + + /* set index */ + CustomData_set_layer_mask(data, type, maskindex); + } +} + +/*********************** UV texture operators ************************/ + +static int uv_texture_add_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Mesh *me; + EditMesh *em; + int layernum; + + if(!ob || ob->type!=OB_MESH) + return OPERATOR_CANCELLED; + + me= (Mesh*)ob->data; + + if(scene->obedit == ob) { + em= me->edit_mesh; + + layernum= CustomData_number_of_layers(&em->fdata, CD_MTFACE); + if(layernum >= MAX_MTFACE) + return OPERATOR_CANCELLED; + + EM_add_data_layer(em, &em->fdata, CD_MTFACE); + CustomData_set_layer_active(&em->fdata, CD_MTFACE, layernum); + } + else if(ob) { + layernum= CustomData_number_of_layers(&me->fdata, CD_MTFACE); + if(layernum >= MAX_MTFACE) + return OPERATOR_CANCELLED; + + if(me->mtface) + CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DUPLICATE, me->mtface, me->totface); + else + CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT, NULL, me->totface); + + CustomData_set_layer_active(&me->fdata, CD_MTFACE, layernum); + mesh_update_customdata_pointers(me); + } + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void MESH_OT_uv_texture_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add UV Texture"; + ot->idname= "MESH_OT_uv_texture_add"; + + /* api callbacks */ + ot->exec= uv_texture_add_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int uv_texture_remove_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Mesh *me; + CustomDataLayer *cdl; + int index; + + if(!ob || ob->type!=OB_MESH) + return OPERATOR_CANCELLED; + + me= (Mesh*)ob->data; + index= CustomData_get_active_layer_index(&me->fdata, CD_MTFACE); + cdl= (index == -1)? NULL: &me->fdata.layers[index]; + + if(!cdl) + return OPERATOR_CANCELLED; + + delete_customdata_layer(me, cdl); + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void MESH_OT_uv_texture_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove UV Texture"; + ot->idname= "MESH_OT_uv_texture_remove"; + + /* api callbacks */ + ot->exec= uv_texture_remove_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/*********************** vertex color operators ************************/ + +static int vertex_color_add_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Mesh *me; + EditMesh *em; + MCol *mcol; + int layernum; + + if(!ob || ob->type!=OB_MESH) + return OPERATOR_CANCELLED; + + me= (Mesh*)ob->data; + + if(scene->obedit == ob) { + em= me->edit_mesh; + + layernum= CustomData_number_of_layers(&em->fdata, CD_MCOL); + if(layernum >= MAX_MCOL) + return OPERATOR_CANCELLED; + + EM_add_data_layer(em, &em->fdata, CD_MCOL); + CustomData_set_layer_active(&em->fdata, CD_MCOL, layernum); + } + else { + layernum= CustomData_number_of_layers(&me->fdata, CD_MCOL); + if(layernum >= MAX_MCOL) + return OPERATOR_CANCELLED; + + mcol= me->mcol; + + if(me->mcol) + CustomData_add_layer(&me->fdata, CD_MCOL, CD_DUPLICATE, me->mcol, me->totface); + else + CustomData_add_layer(&me->fdata, CD_MCOL, CD_DEFAULT, NULL, me->totface); + + CustomData_set_layer_active(&me->fdata, CD_MCOL, layernum); + mesh_update_customdata_pointers(me); + + if(!mcol) + shadeMeshMCol(scene, ob, me); + } + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void MESH_OT_vertex_color_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Vertex Color"; + ot->idname= "MESH_OT_vertex_color_add"; + + /* api callbacks */ + ot->exec= vertex_color_add_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_color_remove_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Mesh *me; + CustomDataLayer *cdl; + int index; + + if(!ob || ob->type!=OB_MESH) + return OPERATOR_CANCELLED; + + me= (Mesh*)ob->data; + index= CustomData_get_active_layer_index(&me->fdata, CD_MCOL); + cdl= (index == -1)? NULL: &me->fdata.layers[index]; + + if(!cdl) + return OPERATOR_CANCELLED; + + delete_customdata_layer(me, cdl); + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void MESH_OT_vertex_color_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Vertex Color"; + ot->idname= "MESH_OT_vertex_color_remove"; + + /* api callbacks */ + ot->exec= vertex_color_remove_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/*********************** sticky operators ************************/ + +static int sticky_add_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Mesh *me; + + if(!ob || ob->type!=OB_MESH) + return OPERATOR_CANCELLED; + + me= (Mesh*)ob->data; + + if(me->msticky) + return OPERATOR_CANCELLED; + + // XXX RE_make_sticky(); + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void MESH_OT_sticky_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Sticky"; + ot->idname= "MESH_OT_sticky_add"; + + /* api callbacks */ + ot->exec= sticky_add_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int sticky_remove_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Mesh *me; + + if(!ob || ob->type!=OB_MESH) + return OPERATOR_CANCELLED; + + me= (Mesh*)ob->data; + + if(!me->msticky) + return OPERATOR_CANCELLED; + + CustomData_free_layer_active(&me->vdata, CD_MSTICKY, me->totvert); + me->msticky= NULL; + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void MESH_OT_sticky_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Sticky"; + ot->idname= "MESH_OT_sticky_remove"; + + /* api callbacks */ + ot->exec= sticky_remove_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 5a86180a60f..2a9357ed0f0 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -183,6 +183,12 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_knife_cut); WM_operatortype_append(MESH_OT_rip); + WM_operatortype_append(MESH_OT_uv_texture_add); + WM_operatortype_append(MESH_OT_uv_texture_remove); + WM_operatortype_append(MESH_OT_vertex_color_add); + WM_operatortype_append(MESH_OT_vertex_color_remove); + WM_operatortype_append(MESH_OT_sticky_add); + WM_operatortype_append(MESH_OT_sticky_remove); } /* note mesh keymap also for other space? */ diff --git a/source/blender/editors/object/editkey.c b/source/blender/editors/object/editkey.c index 913046c5ab8..1c31c7c7653 100644 --- a/source/blender/editors/object/editkey.c +++ b/source/blender/editors/object/editkey.c @@ -55,6 +55,7 @@ #include "BKE_action.h" #include "BKE_anim.h" +#include "BKE_context.h" #include "BKE_curve.h" #include "BKE_depsgraph.h" #include "BKE_global.h" @@ -70,11 +71,15 @@ #include "ED_object.h" +#include "RNA_access.h" + +#include "WM_api.h" +#include "WM_types.h" + #include "object_intern.h" /* XXX */ static void BIF_undo_push() {} -static void error() {} /* XXX */ #if 0 // XXX old animation system @@ -394,25 +399,6 @@ void insert_curvekey(Scene *scene, Curve *cu, short rel) /* ******************** */ -void insert_shapekey(Scene *scene, Object *ob) -{ - if(get_mesh(ob) && get_mesh(ob)->mr) { - error("Cannot create shape keys on a multires mesh."); - } - else { - Key *key; - - if(ob->type==OB_MESH) insert_meshkey(scene, ob->data, 1); - else if ELEM(ob->type, OB_CURVE, OB_SURF) insert_curvekey(scene, ob->data, 1); - else if(ob->type==OB_LATTICE) insert_lattkey(scene, ob->data, 1); - - key= ob_get_key(ob); - ob->shapenr= BLI_countlist(&key->block); - - BIF_undo_push("Add Shapekey"); - } -} - void delete_key(Scene *scene, Object *ob) { KeyBlock *kb, *rkb; @@ -473,6 +459,123 @@ void delete_key(Scene *scene, Object *ob) BIF_undo_push("Delete Shapekey"); } +/********************** shape key operators *********************/ + +static int shape_key_add_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Key *key; + + if(!ob) + return OPERATOR_CANCELLED; + + if(ob->type==OB_MESH) insert_meshkey(scene, ob->data, 1); + else if ELEM(ob->type, OB_CURVE, OB_SURF) insert_curvekey(scene, ob->data, 1); + else if(ob->type==OB_LATTICE) insert_lattkey(scene, ob->data, 1); + + key= ob_get_key(ob); + ob->shapenr= BLI_countlist(&key->block); + + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_shape_key_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Shape Key"; + ot->idname= "OBJECT_OT_shape_key_add"; + + /* api callbacks */ + ot->exec= shape_key_add_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int shape_key_remove_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Scene *scene= CTX_data_scene(C); + Main *bmain= CTX_data_main(C); + KeyBlock *kb, *rkb; + Key *key; + //IpoCurve *icu; + + if(!ob) + return OPERATOR_CANCELLED; + + key= ob_get_key(ob); + if(key==NULL) + return OPERATOR_CANCELLED; + + kb= BLI_findlink(&key->block, ob->shapenr-1); + + if(kb) { + for(rkb= key->block.first; rkb; rkb= rkb->next) + if(rkb->relative == ob->shapenr-1) + rkb->relative= 0; + + BLI_remlink(&key->block, kb); + key->totkey--; + if(key->refkey== kb) + key->refkey= key->block.first; + + if(kb->data) MEM_freeN(kb->data); + MEM_freeN(kb); + + for(kb= key->block.first; kb; kb= kb->next) + if(kb->adrcode>=ob->shapenr) + kb->adrcode--; + +#if 0 // XXX old animation system + if(key->ipo) { + + for(icu= key->ipo->curve.first; icu; icu= icu->next) { + if(icu->adrcode==ob->shapenr-1) { + BLI_remlink(&key->ipo->curve, icu); + free_ipo_curve(icu); + break; + } + } + for(icu= key->ipo->curve.first; icu; icu= icu->next) + if(icu->adrcode>=ob->shapenr) + icu->adrcode--; + } +#endif // XXX old animation system + + if(ob->shapenr>1) ob->shapenr--; + } + + if(key->totkey==0) { + if(GS(key->from->name)==ID_ME) ((Mesh *)key->from)->key= NULL; + else if(GS(key->from->name)==ID_CU) ((Curve *)key->from)->key= NULL; + else if(GS(key->from->name)==ID_LT) ((Lattice *)key->from)->key= NULL; + + free_libblock_us(&(bmain->key), key); + } + + DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_shape_key_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Shape Key"; + ot->idname= "OBJECT_OT_shape_key_remove"; + + /* api callbacks */ + ot->exec= shape_key_remove_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + void move_keys(Object *ob) { #if 0 @@ -560,3 +663,4 @@ void move_keys(Object *ob) BIF_undo_push("Move Shapekey(s)"); #endif } + diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 1eb867e19a0..a52acdd4e1e 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -92,5 +92,19 @@ void OBJECT_OT_modifier_mdef_bind(struct wmOperatorType *ot); /* editconstraint.c */ void OBJECT_OT_constraint_add(struct wmOperatorType *ot); +/* object_vgroup.c */ +void OBJECT_OT_vertex_group_add(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_remove(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_assign(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_remove_from(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_select(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_deselect(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_copy_to_linked(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_copy(struct wmOperatorType *ot); + +/* editkey.c */ +void OBJECT_OT_shape_key_add(struct wmOperatorType *ot); +void OBJECT_OT_shape_key_remove(struct wmOperatorType *ot); + #endif /* ED_OBJECT_INTERN_H */ diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index cfee6a55152..6fa78a53840 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -104,6 +104,18 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_modifier_mdef_bind); WM_operatortype_append(OBJECT_OT_constraint_add); + + WM_operatortype_append(OBJECT_OT_vertex_group_add); + WM_operatortype_append(OBJECT_OT_vertex_group_remove); + WM_operatortype_append(OBJECT_OT_vertex_group_assign); + WM_operatortype_append(OBJECT_OT_vertex_group_remove_from); + WM_operatortype_append(OBJECT_OT_vertex_group_select); + WM_operatortype_append(OBJECT_OT_vertex_group_deselect); + WM_operatortype_append(OBJECT_OT_vertex_group_copy_to_linked); + WM_operatortype_append(OBJECT_OT_vertex_group_copy); + + WM_operatortype_append(OBJECT_OT_shape_key_add); + WM_operatortype_append(OBJECT_OT_shape_key_remove); } void ED_keymap_object(wmWindowManager *wm) diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c new file mode 100644 index 00000000000..fb71fc09108 --- /dev/null +++ b/source/blender/editors/object/object_vgroup.c @@ -0,0 +1,1344 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + * Creator-specific support for vertex deformation groups + * Added: apply deform function (ton) + */ + +#include + +#include "MEM_guardedalloc.h" + +#include "DNA_cloth_types.h" +#include "DNA_curve_types.h" +#include "DNA_lattice_types.h" +#include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" +#include "DNA_modifier_types.h" +#include "DNA_object_types.h" +#include "DNA_object_force.h" +#include "DNA_scene_types.h" +#include "DNA_particle_types.h" +#include "DNA_windowmanager_types.h" + +#include "BLI_blenlib.h" +#include "BLI_editVert.h" + +#include "BKE_context.h" +#include "BKE_customdata.h" +#include "BKE_deform.h" +#include "BKE_depsgraph.h" +#include "BKE_DerivedMesh.h" +#include "BKE_displist.h" +#include "BKE_global.h" +#include "BKE_lattice.h" +#include "BKE_mesh.h" +#include "BKE_utildefines.h" + +#include "RNA_access.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "ED_mesh.h" +#include "ED_view3d.h" + +#include "object_intern.h" + +/* XXX */ +static void BIF_undo_push() {} +static void error() {} + +static Lattice *def_get_lattice(Object *ob) +{ + if(ob->type==OB_LATTICE) { + Lattice *lt= ob->data; + if(lt->editlatt) + return lt->editlatt; + return lt; + } + return NULL; +} + +/* only in editmode */ +void sel_verts_defgroup (Object *obedit, int select) +{ + EditVert *eve; + Object *ob; + int i; + MDeformVert *dvert; + + ob= obedit; + + if (!ob) + return; + + switch (ob->type){ + case OB_MESH: + { + Mesh *me= ob->data; + EditMesh *em = BKE_mesh_get_editmesh(me); + + for (eve=em->verts.first; eve; eve=eve->next){ + dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); + + if (dvert && dvert->totweight){ + for (i=0; itotweight; i++){ + if (dvert->dw[i].def_nr == (ob->actdef-1)){ + if (select) eve->f |= SELECT; + else eve->f &= ~SELECT; + + break; + } + } + } + } + /* this has to be called, because this function operates on vertices only */ + if(select) EM_select_flush(em); // vertices to edges/faces + else EM_deselect_flush(em); + + BKE_mesh_end_editmesh(me, em); + } + break; + case OB_LATTICE: + { + Lattice *lt= def_get_lattice(ob); + + if(lt->dvert) { + BPoint *bp; + int a, tot; + + dvert= lt->dvert; + + tot= lt->pntsu*lt->pntsv*lt->pntsw; + for(a=0, bp= lt->def; atotweight; i++){ + if (dvert->dw[i].def_nr == (ob->actdef-1)) { + if(select) bp->f1 |= SELECT; + else bp->f1 &= ~SELECT; + + break; + } + } + } + } + } + break; + + default: + break; + } +} + +/* check if deform vertex has defgroup index */ +MDeformWeight *get_defweight (MDeformVert *dv, int defgroup) +{ + int i; + + if (!dv || defgroup<0) + return NULL; + + for (i=0; itotweight; i++){ + if (dv->dw[i].def_nr == defgroup) + return dv->dw+i; + } + return NULL; +} + +/* Ensures that mv has a deform weight entry for + the specified defweight group */ +/* Note this function is mirrored in editmesh_tools.c, for use for editvertices */ +MDeformWeight *verify_defweight (MDeformVert *dv, int defgroup) +{ + MDeformWeight *newdw; + + /* do this check always, this function is used to check for it */ + if (!dv || defgroup<0) + return NULL; + + newdw = get_defweight (dv, defgroup); + if (newdw) + return newdw; + + newdw = MEM_callocN (sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight"); + if (dv->dw){ + memcpy (newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight); + MEM_freeN (dv->dw); + } + dv->dw=newdw; + + dv->dw[dv->totweight].weight=0.0f; + dv->dw[dv->totweight].def_nr=defgroup; + /* Group index */ + + dv->totweight++; + + return dv->dw+(dv->totweight-1); +} + +bDeformGroup *add_defgroup_name (Object *ob, char *name) +{ + bDeformGroup *defgroup; + + if (!ob) + return NULL; + + defgroup = MEM_callocN (sizeof(bDeformGroup), "add deformGroup"); + + BLI_strncpy (defgroup->name, name, 32); + + BLI_addtail(&ob->defbase, defgroup); + unique_vertexgroup_name(defgroup, ob); + + ob->actdef = BLI_countlist(&ob->defbase); + + return defgroup; +} + +void add_defgroup (Object *ob) +{ + add_defgroup_name (ob, "Group"); +} + + +void duplicate_defgroup ( Object *ob ) +{ + bDeformGroup *dg, *cdg; + char name[32], s[32]; + MDeformWeight *org, *cpy; + MDeformVert *dvert, *dvert_array; + int i, idg, icdg, dvert_tot; + + if (ob->type != OB_MESH && ob->type != OB_LATTICE) + return; + + dg = BLI_findlink (&ob->defbase, (ob->actdef-1)); + if (!dg) + return; + + if (strstr(dg->name, "_copy")) { + BLI_strncpy (name, dg->name, 32); /* will be renamed _copy.001... etc */ + } else { + BLI_snprintf (name, 32, "%s_copy", dg->name); + while (get_named_vertexgroup (ob, name)) { + if ((strlen (name) + 6) > 32) { + error ("Error: the name for the new group is > 32 characters"); + return; + } + strcpy (s, name); + BLI_snprintf (name, 32, "%s_copy", s); + } + } + + cdg = copy_defgroup (dg); + strcpy (cdg->name, name); + unique_vertexgroup_name(cdg, ob); + + BLI_addtail (&ob->defbase, cdg); + + idg = (ob->actdef-1); + ob->actdef = BLI_countlist (&ob->defbase); + icdg = (ob->actdef-1); + + if(ob->type == OB_MESH) { + Mesh *me = get_mesh (ob); + dvert_array= me->dvert; + dvert_tot= me->totvert; + } + else if (ob->type == OB_LATTICE) { + Lattice *lt= (Lattice *)ob->data; + dvert_array= lt->dvert; + dvert_tot= lt->pntsu*lt->pntsv*lt->pntsw; + } + + if (!dvert_array) + return; + + for (i = 0; i < dvert_tot; i++) { + dvert = dvert_array+i; + org = get_defweight (dvert, idg); + if (org) { + float weight = org->weight; + /* verify_defweight re-allocs org so need to store the weight first */ + cpy = verify_defweight (dvert, icdg); + cpy->weight = weight; + } + } +} + +static void del_defgroup_update_users(Object *ob, int id) +{ + ExplodeModifierData *emd; + ModifierData *md; + ParticleSystem *psys; + ClothModifierData *clmd; + ClothSimSettings *clsim; + int a; + + /* these cases don't use names to refer to vertex groups, so when + * they get deleted the numbers get out of sync, this corrects that */ + + if(ob->soft) { + if(ob->soft->vertgroup == id) + ob->soft->vertgroup= 0; + else if(ob->soft->vertgroup > id) + ob->soft->vertgroup--; + } + + for(md=ob->modifiers.first; md; md=md->next) { + if(md->type == eModifierType_Explode) { + emd= (ExplodeModifierData*)md; + + if(emd->vgroup == id) + emd->vgroup= 0; + else if(emd->vgroup > id) + emd->vgroup--; + } + else if(md->type == eModifierType_Cloth) { + clmd= (ClothModifierData*)md; + clsim= clmd->sim_parms; + + if(clsim) { + if(clsim->vgroup_mass == id) + clsim->vgroup_mass= 0; + else if(clsim->vgroup_mass > id) + clsim->vgroup_mass--; + + if(clsim->vgroup_bend == id) + clsim->vgroup_bend= 0; + else if(clsim->vgroup_bend > id) + clsim->vgroup_bend--; + + if(clsim->vgroup_struct == id) + clsim->vgroup_struct= 0; + else if(clsim->vgroup_struct > id) + clsim->vgroup_struct--; + } + } + } + + for(psys=ob->particlesystem.first; psys; psys=psys->next) { + for(a=0; avgroup[a] == id) + psys->vgroup[a]= 0; + else if(psys->vgroup[a] > id) + psys->vgroup[a]--; + } +} + +void del_defgroup_in_object_mode ( Object *ob ) +{ + bDeformGroup *dg; + MDeformVert *dvert_array, *dvert; + + int i, e, dvert_tot; + + if ((!ob) || (ob->type != OB_MESH && ob->type != OB_LATTICE)) + return; + + if(ob->type == OB_MESH) { + Mesh *me = get_mesh (ob); + dvert_array= me->dvert; + dvert_tot= me->totvert; + } + else if (ob->type == OB_LATTICE) { + Lattice *lt= (Lattice *)ob->data; + dvert_array= lt->dvert; + dvert_tot= lt->pntsu*lt->pntsv*lt->pntsw; + } + + dg = BLI_findlink (&ob->defbase, (ob->actdef-1)); + if (!dg) + return; + + if (dvert_array) { + for (i = 0; i < dvert_tot; i++) { + dvert = dvert_array + i; + if (dvert) { + if (get_defweight (dvert, (ob->actdef-1))) + remove_vert_defgroup (ob, dg, i); + } + } + + for (i = 0; i < dvert_tot; i++) { + dvert = dvert_array+i; + if (dvert) { + for (e = 0; e < dvert->totweight; e++) { + if (dvert->dw[e].def_nr > (ob->actdef-1)) + dvert->dw[e].def_nr--; + } + } + } + } + + del_defgroup_update_users(ob, ob->actdef); + + /* Update the active deform index if necessary */ + if (ob->actdef == BLI_countlist(&ob->defbase)) + ob->actdef--; + + /* Remove the group */ + BLI_freelinkN (&ob->defbase, dg); +} + +void del_defgroup (Object *ob) +{ + bDeformGroup *defgroup; + int i; + + if (!ob) + return; + + if (!ob->actdef) + return; + + defgroup = BLI_findlink(&ob->defbase, ob->actdef-1); + if (!defgroup) + return; + + /* Make sure that no verts are using this group */ + remove_verts_defgroup(ob, 1); + + /* Make sure that any verts with higher indices are adjusted accordingly */ + if(ob->type==OB_MESH) { + Mesh *me= ob->data; + EditMesh *em = BKE_mesh_get_editmesh(me); + EditVert *eve; + MDeformVert *dvert; + + for (eve=em->verts.first; eve; eve=eve->next){ + dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); + + if (dvert) + for (i=0; itotweight; i++) + if (dvert->dw[i].def_nr > (ob->actdef-1)) + dvert->dw[i].def_nr--; + } + BKE_mesh_end_editmesh(me, em); + } + else if(ob->type==OB_LATTICE) { + Lattice *lt= def_get_lattice(ob); + BPoint *bp; + MDeformVert *dvert= lt->dvert; + int a, tot; + + if (dvert) { + tot= lt->pntsu*lt->pntsv*lt->pntsw; + for(a=0, bp= lt->def; atotweight; i++){ + if (dvert->dw[i].def_nr > (ob->actdef-1)) + dvert->dw[i].def_nr--; + } + } + } + } + + del_defgroup_update_users(ob, ob->actdef); + + /* Update the active deform index if necessary */ + if (ob->actdef==BLI_countlist(&ob->defbase)) + ob->actdef--; + + /* Remove the group */ + BLI_freelinkN (&ob->defbase, defgroup); + + /* remove all dverts */ + if(ob->actdef==0) { + if(ob->type==OB_MESH) { + Mesh *me= ob->data; + CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert); + me->dvert= NULL; + } + else if(ob->type==OB_LATTICE) { + Lattice *lt= def_get_lattice(ob); + if (lt->dvert) { + MEM_freeN(lt->dvert); + lt->dvert= NULL; + } + } + } +} + +void del_all_defgroups (Object *ob) +{ + /* Sanity check */ + if (ob == NULL) + return; + + /* Remove all DVerts */ + if (ob->type==OB_MESH) { + Mesh *me= ob->data; + CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert); + me->dvert= NULL; + } + else if(ob->type==OB_LATTICE) { + Lattice *lt= def_get_lattice(ob); + if (lt->dvert) { + MEM_freeN(lt->dvert); + lt->dvert= NULL; + } + } + + /* Remove all DefGroups */ + BLI_freelistN(&ob->defbase); + + /* Fix counters/indices */ + ob->actdef= 0; +} + +void create_dverts(ID *id) +{ + /* create deform verts + */ + + if( GS(id->name)==ID_ME) { + Mesh *me= (Mesh *)id; + me->dvert= CustomData_add_layer(&me->vdata, CD_MDEFORMVERT, CD_CALLOC, NULL, me->totvert); + } + else if( GS(id->name)==ID_LT) { + Lattice *lt= (Lattice *)id; + lt->dvert= MEM_callocN(sizeof(MDeformVert)*lt->pntsu*lt->pntsv*lt->pntsw, "lattice deformVert"); + } +} + +/* for mesh in object mode + lattice can be in editmode */ +void remove_vert_def_nr (Object *ob, int def_nr, int vertnum) +{ + /* This routine removes the vertex from the deform + * group with number def_nr. + * + * This routine is meant to be fast, so it is the + * responsibility of the calling routine to: + * a) test whether ob is non-NULL + * b) test whether ob is a mesh + * c) calculate def_nr + */ + + MDeformWeight *newdw; + MDeformVert *dvert= NULL; + int i; + + /* get the deform vertices corresponding to the + * vertnum + */ + if(ob->type==OB_MESH) { + if( ((Mesh*)ob->data)->dvert ) + dvert = ((Mesh*)ob->data)->dvert + vertnum; + } + else if(ob->type==OB_LATTICE) { + Lattice *lt= def_get_lattice(ob); + + if(lt->dvert) + dvert = lt->dvert + vertnum; + } + + if(dvert==NULL) + return; + + /* for all of the deform weights in the + * deform vert + */ + for (i=dvert->totweight - 1 ; i>=0 ; i--){ + + /* if the def_nr is the same as the one + * for our weight group then remove it + * from this deform vert. + */ + if (dvert->dw[i].def_nr == def_nr) { + dvert->totweight--; + + /* if there are still other deform weights + * attached to this vert then remove this + * deform weight, and reshuffle the others + */ + if (dvert->totweight) { + newdw = MEM_mallocN (sizeof(MDeformWeight)*(dvert->totweight), + "deformWeight"); + if (dvert->dw){ + memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*i); + memcpy (newdw+i, dvert->dw+i+1, + sizeof(MDeformWeight)*(dvert->totweight-i)); + MEM_freeN (dvert->dw); + } + dvert->dw=newdw; + } + /* if there are no other deform weights + * left then just remove the deform weight + */ + else { + MEM_freeN (dvert->dw); + dvert->dw = NULL; + break; + } + } + } + +} + +/* for Mesh in Object mode */ +/* allows editmode for Lattice */ +void add_vert_defnr (Object *ob, int def_nr, int vertnum, + float weight, int assignmode) +{ + /* add the vert to the deform group with the + * specified number + */ + MDeformVert *dv= NULL; + MDeformWeight *newdw; + int i; + + /* get the vert */ + if(ob->type==OB_MESH) { + if(((Mesh*)ob->data)->dvert) + dv = ((Mesh*)ob->data)->dvert + vertnum; + } + else if(ob->type==OB_LATTICE) { + Lattice *lt= def_get_lattice(ob); + + if(lt->dvert) + dv = lt->dvert + vertnum; + } + + if(dv==NULL) + return; + + /* Lets first check to see if this vert is + * already in the weight group -- if so + * lets update it + */ + for (i=0; itotweight; i++){ + + /* if this weight cooresponds to the + * deform group, then add it using + * the assign mode provided + */ + if (dv->dw[i].def_nr == def_nr){ + + switch (assignmode) { + case WEIGHT_REPLACE: + dv->dw[i].weight=weight; + break; + case WEIGHT_ADD: + dv->dw[i].weight+=weight; + if (dv->dw[i].weight >= 1.0) + dv->dw[i].weight = 1.0; + break; + case WEIGHT_SUBTRACT: + dv->dw[i].weight-=weight; + /* if the weight is zero or less then + * remove the vert from the deform group + */ + if (dv->dw[i].weight <= 0.0) + remove_vert_def_nr(ob, def_nr, vertnum); + break; + } + return; + } + } + + /* if the vert wasn't in the deform group then + * we must take a different form of action ... + */ + + switch (assignmode) { + case WEIGHT_SUBTRACT: + /* if we are subtracting then we don't + * need to do anything + */ + return; + + case WEIGHT_REPLACE: + case WEIGHT_ADD: + /* if we are doing an additive assignment, then + * we need to create the deform weight + */ + newdw = MEM_callocN (sizeof(MDeformWeight)*(dv->totweight+1), + "deformWeight"); + if (dv->dw){ + memcpy (newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight); + MEM_freeN (dv->dw); + } + dv->dw=newdw; + + dv->dw[dv->totweight].weight=weight; + dv->dw[dv->totweight].def_nr=def_nr; + + dv->totweight++; + break; + } +} + +/* called while not in editmode */ +void add_vert_to_defgroup (Object *ob, bDeformGroup *dg, int vertnum, + float weight, int assignmode) +{ + /* add the vert to the deform group with the + * specified assign mode + */ + int def_nr; + + /* get the deform group number, exit if + * it can't be found + */ + def_nr = get_defgroup_num(ob, dg); + if (def_nr < 0) return; + + /* if there's no deform verts then + * create some + */ + if(ob->type==OB_MESH) { + if (!((Mesh*)ob->data)->dvert) + create_dverts(ob->data); + } + else if(ob->type==OB_LATTICE) { + if (!((Lattice*)ob->data)->dvert) + create_dverts(ob->data); + } + + /* call another function to do the work + */ + add_vert_defnr (ob, def_nr, vertnum, weight, assignmode); +} + +/* Only available in editmode */ +void assign_verts_defgroup (Object *ob, float weight) +{ + EditVert *eve; + bDeformGroup *dg, *eg; + MDeformWeight *newdw; + MDeformVert *dvert; + int i, done; + + if (!ob) + return; + + dg=BLI_findlink(&ob->defbase, ob->actdef-1); + if (!dg){ + error ("No vertex group is active"); + return; + } + + switch (ob->type){ + case OB_MESH: + { + Mesh *me= ob->data; + EditMesh *em = BKE_mesh_get_editmesh(me); + + if (!CustomData_has_layer(&em->vdata, CD_MDEFORMVERT)) + EM_add_data_layer(em, &em->vdata, CD_MDEFORMVERT); + + /* Go through the list of editverts and assign them */ + for (eve=em->verts.first; eve; eve=eve->next){ + dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); + + if (dvert && (eve->f & 1)){ + done=0; + /* See if this vert already has a reference to this group */ + /* If so: Change its weight */ + done=0; + for (i=0; itotweight; i++){ + eg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr); + /* Find the actual group */ + if (eg==dg){ + dvert->dw[i].weight= weight; + done=1; + break; + } + } + /* If not: Add the group and set its weight */ + if (!done){ + newdw = MEM_callocN (sizeof(MDeformWeight)*(dvert->totweight+1), "deformWeight"); + if (dvert->dw){ + memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*dvert->totweight); + MEM_freeN (dvert->dw); + } + dvert->dw=newdw; + + dvert->dw[dvert->totweight].weight= weight; + dvert->dw[dvert->totweight].def_nr= ob->actdef-1; + + dvert->totweight++; + + } + } + } + BKE_mesh_end_editmesh(me, em); + } + break; + case OB_LATTICE: + { + Lattice *lt= def_get_lattice(ob); + BPoint *bp; + int a, tot; + + if(lt->dvert==NULL) + create_dverts(<->id); + + tot= lt->pntsu*lt->pntsv*lt->pntsw; + for(a=0, bp= lt->def; af1 & SELECT) + add_vert_defnr (ob, ob->actdef-1, a, weight, WEIGHT_REPLACE); + } + } + break; + default: + printf ("Assigning deformation groups to unknown object type\n"); + break; + } + +} + +/* mesh object mode, lattice can be in editmode */ +void remove_vert_defgroup (Object *ob, bDeformGroup *dg, int vertnum) +{ + /* This routine removes the vertex from the specified + * deform group. + */ + + int def_nr; + + /* if the object is NULL abort + */ + if (!ob) + return; + + /* get the deform number that cooresponds + * to this deform group, and abort if it + * can not be found. + */ + def_nr = get_defgroup_num(ob, dg); + if (def_nr < 0) return; + + /* call another routine to do the work + */ + remove_vert_def_nr (ob, def_nr, vertnum); +} + +/* for mesh in object mode lattice can be in editmode */ +static float get_vert_def_nr (Object *ob, int def_nr, int vertnum) +{ + MDeformVert *dvert= NULL; + int i; + + /* get the deform vertices corresponding to the + * vertnum + */ + if(ob->type==OB_MESH) { + if( ((Mesh*)ob->data)->dvert ) + dvert = ((Mesh*)ob->data)->dvert + vertnum; + } + else if(ob->type==OB_LATTICE) { + Lattice *lt= def_get_lattice(ob); + + if(lt->dvert) + dvert = lt->dvert + vertnum; + } + + if(dvert==NULL) + return 0.0f; + + for(i=dvert->totweight-1 ; i>=0 ; i--) + if(dvert->dw[i].def_nr == def_nr) + return dvert->dw[i].weight; + + return 0.0f; +} + +/* mesh object mode, lattice can be in editmode */ +float get_vert_defgroup (Object *ob, bDeformGroup *dg, int vertnum) +{ + int def_nr; + + if(!ob) + return 0.0f; + + def_nr = get_defgroup_num(ob, dg); + if(def_nr < 0) return 0.0f; + + return get_vert_def_nr (ob, def_nr, vertnum); +} + +/* Only available in editmode */ +/* removes from active defgroup, if allverts==0 only selected vertices */ +void remove_verts_defgroup (Object *ob, int allverts) +{ + EditVert *eve; + MDeformVert *dvert; + MDeformWeight *newdw; + bDeformGroup *dg, *eg; + int i; + + if (!ob) + return; + + dg=BLI_findlink(&ob->defbase, ob->actdef-1); + if (!dg){ + error ("No vertex group is active"); + return; + } + + switch (ob->type){ + case OB_MESH: + { + Mesh *me= ob->data; + EditMesh *em = BKE_mesh_get_editmesh(me); + + for (eve=em->verts.first; eve; eve=eve->next){ + dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); + + if (dvert && dvert->dw && ((eve->f & 1) || allverts)){ + for (i=0; itotweight; i++){ + /* Find group */ + eg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr); + if (eg == dg){ + dvert->totweight--; + if (dvert->totweight){ + newdw = MEM_mallocN (sizeof(MDeformWeight)*(dvert->totweight), "deformWeight"); + + if (dvert->dw){ + memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*i); + memcpy (newdw+i, dvert->dw+i+1, sizeof(MDeformWeight)*(dvert->totweight-i)); + MEM_freeN (dvert->dw); + } + dvert->dw=newdw; + } + else{ + MEM_freeN (dvert->dw); + dvert->dw=NULL; + break; + } + } + } + } + } + BKE_mesh_end_editmesh(me, em); + } + break; + case OB_LATTICE: + { + Lattice *lt= def_get_lattice(ob); + + if(lt->dvert) { + BPoint *bp; + int a, tot= lt->pntsu*lt->pntsv*lt->pntsw; + + for(a=0, bp= lt->def; af1 & SELECT)) + remove_vert_defgroup (ob, dg, a); + } + } + } + break; + + default: + printf ("Removing deformation groups from unknown object type\n"); + break; + } +} + +/* Only available in editmode */ +/* removes from all defgroup, if allverts==0 only selected vertices */ +void remove_verts_defgroups(Object *ob, int allverts) +{ + int actdef, defCount; + + if (ob == NULL) return; + + actdef= ob->actdef; + defCount= BLI_countlist(&ob->defbase); + + if (defCount == 0) { + error("Object has no vertex groups"); + return; + } + + /* To prevent code redundancy, we just use remove_verts_defgroup, but that + * only operates on the active vgroup. So we iterate through all groups, by changing + * active group index + */ + for (ob->actdef= 1; ob->actdef <= defCount; ob->actdef++) + remove_verts_defgroup(ob, allverts); + + ob->actdef= actdef; +} + +void vertexgroup_select_by_name(Object *ob, char *name) +{ + bDeformGroup *curdef; + int actdef= 1; + + if(ob==NULL) return; + + for (curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++){ + if (!strcmp(curdef->name, name)) { + ob->actdef= actdef; + return; + } + } + ob->actdef=0; // this signals on painting to create a new one, if a bone in posemode is selected */ +} + +/* This function provides a shortcut for adding/removing verts from + * vertex groups. It is called by the Ctrl-G hotkey in EditMode for Meshes + * and Lattices. (currently only restricted to those two) + * It is only responsible for + */ +void vgroup_assign_with_menu(Scene *scene, Object *ob) +{ + VPaint *wp= scene->toolsettings->wpaint; + int defCount; + int mode= 0; + + /* prevent crashes */ + if (wp==NULL || ob==NULL) return; + + defCount= BLI_countlist(&ob->defbase); + + /* give user choices of adding to current/new or removing from current */ +// XXX if (defCount && ob->actdef) +// mode = pupmenu("Vertex Groups %t|Add Selected to New Group %x1|Add Selected to Active Group %x2|Remove Selected from Active Group %x3|Remove Selected from All Groups %x4"); +// else +// mode= pupmenu("Vertex Groups %t|Add Selected to New Group %x1"); + + /* handle choices */ + switch (mode) { + case 1: /* add to new group */ + add_defgroup(ob); + assign_verts_defgroup(ob, wp->brush->alpha); + BIF_undo_push("Assign to vertex group"); + break; + case 2: /* add to current group */ + assign_verts_defgroup(ob, wp->brush->alpha); + BIF_undo_push("Assign to vertex group"); + break; + case 3: /* remove from current group */ + remove_verts_defgroup(ob, 0); + BIF_undo_push("Remove from vertex group"); + break; + case 4: /* remove from all groups */ + remove_verts_defgroups(ob, 0); + BIF_undo_push("Remove from all vertex groups"); + break; + } +} + +/* This function provides a shortcut for commonly used vertex group + * functions - change weight (not implemented), change active group, delete active group, + * when Ctrl-Shift-G is used in EditMode, for Meshes and Lattices (only for now). + */ +void vgroup_operation_with_menu(Object *ob) +{ + int defCount; + int mode= 0; + + /* prevent crashes and useless cases */ + if (ob==NULL) return; + + defCount= BLI_countlist(&ob->defbase); + if (defCount == 0) return; + + /* give user choices of adding to current/new or removing from current */ +// XXX if (ob->actdef) +// mode = pupmenu("Vertex Groups %t|Change Active Group%x1|Delete Active Group%x2|Delete All Groups%x3"); +// else +// mode= pupmenu("Vertex Groups %t|Change Active Group%x1|Delete All Groups%x3"); + + /* handle choices */ + switch (mode) { + case 1: /* change active group*/ + { + char *menustr= NULL; // XXX get_vertexgroup_menustr(ob); + short nr; + + if (menustr) { +// XXX nr= pupmenu(menustr); + + if ((nr >= 1) && (nr <= defCount)) + ob->actdef= nr; + + MEM_freeN(menustr); + } + } + break; + case 2: /* delete active group */ + { + del_defgroup(ob); + BIF_undo_push("Delete vertex group"); + } + break; + case 3: /* delete all groups */ + { + del_all_defgroups(ob); + BIF_undo_push("Delete all vertex groups"); + } + break; + } +} + +/********************** vertex group operators *********************/ + +static int vertex_group_add_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Scene *scene= CTX_data_scene(C); + + if(!ob) + return OPERATOR_CANCELLED; + + add_defgroup(ob); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Vertex Group"; + ot->idname= "OBJECT_OT_vertex_group_add"; + + /* api callbacks */ + ot->exec= vertex_group_add_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_group_remove_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Scene *scene= CTX_data_scene(C); + + if(!ob) + return OPERATOR_CANCELLED; + + if(scene->obedit == ob) { + del_defgroup(ob); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + } + else { + del_defgroup_in_object_mode(ob); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + } + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Vertex Group"; + ot->idname= "OBJECT_OT_vertex_group_remove"; + + /* api callbacks */ + ot->exec= vertex_group_remove_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_group_assign_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); + Object *ob= CTX_data_edit_object(C); + + if(!ob) + return OPERATOR_CANCELLED; + + assign_verts_defgroup(ob, ts->vgroup_weight); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_assign(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Assign Vertex Group"; + ot->idname= "OBJECT_OT_vertex_group_assign"; + + /* api callbacks */ + ot->exec= vertex_group_assign_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_group_remove_from_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_edit_object(C); + + if(!ob) + return OPERATOR_CANCELLED; + + remove_verts_defgroup(ob, 0); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove from Vertex Group"; + ot->idname= "OBJECT_OT_vertex_group_remove_from"; + + /* api callbacks */ + ot->exec= vertex_group_remove_from_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_group_select_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_edit_object(C); + + if(!ob) + return OPERATOR_CANCELLED; + + sel_verts_defgroup(ob, 1); /* runs countall() */ + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_select(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Select Vertex Group"; + ot->idname= "OBJECT_OT_vertex_group_select"; + + /* api callbacks */ + ot->exec= vertex_group_select_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_group_deselect_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_edit_object(C); + + if(!ob) + return OPERATOR_CANCELLED; + + sel_verts_defgroup(ob, 0); /* runs countall() */ + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_deselect(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Deselect Vertex Group"; + ot->idname= "OBJECT_OT_vertex_group_deselect"; + + /* api callbacks */ + ot->exec= vertex_group_deselect_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_group_copy_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + + if(!ob) + return OPERATOR_CANCELLED; + + duplicate_defgroup(ob); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_copy(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Copy Vertex Group"; + ot->idname= "OBJECT_OT_vertex_group_copy"; + + /* api callbacks */ + ot->exec= vertex_group_copy_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_group_copy_to_linked_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Base *base; + int retval= OPERATOR_CANCELLED; + + if(!ob) + return retval; + + for(base=scene->base.first; base; base= base->next) { + if(base->object->type==ob->type) { + if(base->object!=ob && base->object->data==ob->data) { + BLI_freelistN(&base->object->defbase); + BLI_duplicatelist(&base->object->defbase, &ob->defbase); + base->object->actdef= ob->actdef; + + DAG_object_flush_update(scene, base->object, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, base->object); + + retval = OPERATOR_FINISHED; + } + } + } + + return retval; +} + +void OBJECT_OT_vertex_group_copy_to_linked(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Copy Vertex Group to Linked"; + ot->idname= "OBJECT_OT_vertex_group_copy_to_linked"; + + /* api callbacks */ + ot->exec= vertex_group_copy_to_linked_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index f9732551545..b89a13ce218 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -331,6 +331,7 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn) case NC_SCENE: switch(wmn->data) { case ND_FRAME: + case ND_MODE: ED_area_tag_redraw(sa); break; diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 828721f0abb..31724bb5665 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -439,6 +439,9 @@ typedef struct ToolSettings { VPaint *wpaint; /* weight paint */ Sculpt *sculpt; + /* Vertex groups */ + float vgroup_weight; + /* Subdivide Settings */ short cornertype; short editbutflag; @@ -470,7 +473,6 @@ typedef struct ToolSettings { float uvcalc_radius; float uvcalc_cubesize; float uvcalc_margin; - float pad; short uvcalc_mapdir; short uvcalc_mapalign; short uvcalc_flag; @@ -537,7 +539,7 @@ typedef struct ToolSettings { /* Alt+RMB option */ char edge_mode; - /* transform */ + /* Transform */ short snap_mode, snap_flag, snap_target; short proportional, prop_mode; } ToolSettings; diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index 7bc94195204..d9d68490425 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -105,6 +105,9 @@ typedef struct Panel { /* the part from uiBlock that needs saved in file */ int sortorder; /* panels are aligned according to increasing sortorder */ struct Panel *paneltab; /* this panel is tabbed in *paneltab */ void *activedata; /* runtime for panel manipulation */ + + int list_scroll, list_size; + char list_search[64]; } Panel; typedef struct Header { diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 8200a21f4ac..5c4b6a95524 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -535,10 +535,8 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna) srna= RNA_def_struct(brna, "CopyLocationConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copies the location of the target."); - RNA_def_struct_sdna(srna, "bConstraint"); - prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_PERCENTAGE); - RNA_def_property_float_sdna(prop, NULL, "headtail"); + RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1."); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c index 378498c8e0a..7fa27348002 100644 --- a/source/blender/makesrna/intern/rna_context.c +++ b/source/blender/makesrna/intern/rna_context.c @@ -96,6 +96,12 @@ static PointerRNA rna_Context_scene_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_Scene, CTX_data_scene(C)); } +static PointerRNA rna_Context_tool_settings_get(PointerRNA *ptr) +{ + bContext *C= (bContext*)ptr->data; + return rna_pointer_inherit_refine(ptr, &RNA_ToolSettings, CTX_data_tool_settings(C)); +} + #else void RNA_def_context(BlenderRNA *brna) @@ -153,6 +159,12 @@ void RNA_def_context(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Scene"); RNA_def_property_pointer_funcs(prop, "rna_Context_scene_get", NULL, NULL); + + prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_struct_type(prop, "ToolSettings"); + RNA_def_property_pointer_funcs(prop, "rna_Context_tool_settings_get", NULL, NULL); + } #endif diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 41d64a8dbb9..39fa6f36f23 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -34,10 +34,37 @@ #include "DNA_meshdata_types.h" #include "DNA_object_types.h" -#include "BKE_customdata.h" - #ifdef RNA_RUNTIME +#include "DNA_scene_types.h" + +#include "BLI_editVert.h" + +#include "BKE_customdata.h" +#include "BKE_depsgraph.h" +#include "BKE_main.h" +#include "BKE_mesh.h" +#include "BKE_utildefines.h" + +#include "WM_api.h" +#include "WM_types.h" + +static void rna_Mesh_update_data(bContext *C, PointerRNA *ptr) +{ + Main *bmain= CTX_data_main(C); + Scene *scene= CTX_data_scene(C); + ID *id= ptr->id.data; + Object *ob; + + for(ob=bmain->object.first; ob; ob= ob->id.next) { + if(ob->data == id) { + /* XXX this will loop over all objects again (slow) */ + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + } + } +} + static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value) { MVert *mvert= (MVert*)ptr->data; @@ -183,13 +210,19 @@ static void rna_MeshFace_material_index_range(PointerRNA *ptr, int *min, int *ma *max= me->totcol-1; } +static CustomData *rna_mesh_fdata(Mesh *me) +{ + return (me->edit_mesh)? &me->edit_mesh->fdata: &me->fdata; +} + static int rna_CustomDataLayer_length(PointerRNA *ptr, int type) { Mesh *me= (Mesh*)ptr->id.data; + CustomData *fdata= rna_mesh_fdata(me); CustomDataLayer *layer; int i, length= 0; - for(layer=me->fdata.layers, i=0; ifdata.totlayer; layer++, i++) + for(layer=fdata->layers, i=0; itotlayer; layer++, i++) if(layer->type == type) length++; @@ -199,64 +232,96 @@ static int rna_CustomDataLayer_length(PointerRNA *ptr, int type) static int rna_CustomDataLayer_active_get(PointerRNA *ptr, int type, int render) { Mesh *me= (Mesh*)ptr->id.data; - int n= ((CustomDataLayer*)ptr->data) - me->fdata.layers; + CustomData *fdata= rna_mesh_fdata(me); + int n= ((CustomDataLayer*)ptr->data) - fdata->layers; - if(render) return (n == CustomData_get_render_layer_index(&me->fdata, type)); - else return (n == CustomData_get_active_layer_index(&me->fdata, type)); + if(render) return (n == CustomData_get_render_layer_index(fdata, type)); + else return (n == CustomData_get_active_layer_index(fdata, type)); } static void rna_CustomDataLayer_active_set(PointerRNA *ptr, int value, int type, int render) { Mesh *me= (Mesh*)ptr->id.data; - int n= ((CustomDataLayer*)ptr->data) - me->fdata.layers; + CustomData *fdata= rna_mesh_fdata(me); + int n= ((CustomDataLayer*)ptr->data) - fdata->layers; if(value == 0) return; - if(render) CustomData_set_layer_render_index(&me->fdata, type, n); - else CustomData_set_layer_active_index(&me->fdata, type, n); + if(render) CustomData_set_layer_render_index(fdata, type, n); + else CustomData_set_layer_active_index(fdata, type, n); } -static int rna_uv_layer_check(CollectionPropertyIterator *iter, void *data) +static int rna_uv_texture_check(CollectionPropertyIterator *iter, void *data) { CustomDataLayer *layer= (CustomDataLayer*)data; return (layer->type != CD_MTFACE); } -static void rna_Mesh_uv_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Mesh_uv_textures_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->data; - rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_uv_layer_check); + CustomData *fdata= rna_mesh_fdata(me); + rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, rna_uv_texture_check); } -static int rna_Mesh_uv_layers_length(PointerRNA *ptr) +static int rna_Mesh_uv_textures_length(PointerRNA *ptr) { return rna_CustomDataLayer_length(ptr, CD_MTFACE); } -static PointerRNA rna_Mesh_active_uv_layer_get(PointerRNA *ptr) +static PointerRNA rna_Mesh_active_uv_texture_get(PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->data; - int index= CustomData_get_active_layer_index(&me->fdata, CD_MTFACE); - CustomDataLayer *cdl= (index == -1)? NULL: &me->fdata.layers[index]; + CustomData *fdata= rna_mesh_fdata(me); + int index= CustomData_get_active_layer_index(fdata, CD_MTFACE); + CustomDataLayer *cdl= (index == -1)? NULL: &fdata->layers[index]; return rna_pointer_inherit_refine(ptr, &RNA_MeshTextureFaceLayer, cdl); } -static void rna_Mesh_active_uv_layer_set(PointerRNA *ptr, PointerRNA value) +static void rna_Mesh_active_uv_texture_set(PointerRNA *ptr, PointerRNA value) { Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); CustomDataLayer *cdl; int a; - for(cdl=me->fdata.layers, a=0; afdata.totlayer; cdl++, a++) { + for(cdl=fdata->layers, a=0; atotlayer; cdl++, a++) { if(value.data == cdl) { - CustomData_set_layer_active_index(&me->fdata, CD_MTFACE, a); + CustomData_set_layer_active_index(fdata, CD_MTFACE, a); + mesh_update_customdata_pointers(me); return; } } } +static int rna_Mesh_active_uv_texture_index_get(PointerRNA *ptr) +{ + Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); + return CustomData_get_active_layer(fdata, CD_MTFACE); +} + +static void rna_Mesh_active_uv_texture_index_set(PointerRNA *ptr, int value) +{ + Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); + + CustomData_set_layer_active(fdata, CD_MTFACE, value); + mesh_update_customdata_pointers(me); +} + +static void rna_Mesh_active_uv_texture_index_range(PointerRNA *ptr, int *min, int *max) +{ + Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); + + *min= 0; + *max= CustomData_number_of_layers(fdata, CD_MTFACE)-1; + *max= MAX2(0, *max); +} + static void rna_MeshTextureFace_uv1_get(PointerRNA *ptr, float *values) { MTFace *mtface= (MTFace*)ptr->data; @@ -354,46 +419,84 @@ static void rna_MeshTextureFaceLayer_active_set(PointerRNA *ptr, int value) rna_CustomDataLayer_active_set(ptr, value, CD_MTFACE, 0); } -static int rna_vcol_layer_check(CollectionPropertyIterator *iter, void *data) +static void rna_MeshTextureFaceLayer_name_set(PointerRNA *ptr, const char *value) +{ + Mesh *me= (Mesh*)ptr->id.data; + CustomDataLayer *cdl= (CustomDataLayer*)ptr->data; + BLI_strncpy(cdl->name, value, sizeof(cdl->name)); + CustomData_set_layer_unique_name(&me->fdata, cdl - me->fdata.layers); +} + +static int rna_vertex_color_check(CollectionPropertyIterator *iter, void *data) { CustomDataLayer *layer= (CustomDataLayer*)data; return (layer->type != CD_MCOL); } -static void rna_Mesh_vcol_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Mesh_vertex_colors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->data; - rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_vcol_layer_check); + CustomData *fdata= rna_mesh_fdata(me); + rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, rna_vertex_color_check); } -static int rna_Mesh_vcol_layers_length(PointerRNA *ptr) +static int rna_Mesh_vertex_colors_length(PointerRNA *ptr) { return rna_CustomDataLayer_length(ptr, CD_MCOL); } -static PointerRNA rna_Mesh_active_vcol_layer_get(PointerRNA *ptr) +static PointerRNA rna_Mesh_active_vertex_color_get(PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->data; - int index= CustomData_get_active_layer_index(&me->fdata, CD_MCOL); - CustomDataLayer *cdl= (index == -1)? NULL: &me->fdata.layers[index]; + CustomData *fdata= rna_mesh_fdata(me); + int index= CustomData_get_active_layer_index(fdata, CD_MCOL); + CustomDataLayer *cdl= (index == -1)? NULL: &fdata->layers[index]; return rna_pointer_inherit_refine(ptr, &RNA_MeshColorLayer, cdl); } -static void rna_Mesh_active_vcol_layer_set(PointerRNA *ptr, PointerRNA value) +static void rna_Mesh_active_vertex_color_set(PointerRNA *ptr, PointerRNA value) { Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); CustomDataLayer *cdl; int a; - for(cdl=me->fdata.layers, a=0; afdata.totlayer; cdl++, a++) { + for(cdl=fdata->layers, a=0; atotlayer; cdl++, a++) { if(value.data == cdl) { - CustomData_set_layer_active_index(&me->fdata, CD_MCOL, a); + CustomData_set_layer_active_index(fdata, CD_MCOL, a); + mesh_update_customdata_pointers(me); return; } } } +static int rna_Mesh_active_vertex_color_index_get(PointerRNA *ptr) +{ + Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); + return CustomData_get_active_layer(fdata, CD_MCOL); +} + +static void rna_Mesh_active_vertex_color_index_set(PointerRNA *ptr, int value) +{ + Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); + + CustomData_set_layer_active(fdata, CD_MCOL, value); + mesh_update_customdata_pointers(me); +} + +static void rna_Mesh_active_vertex_color_index_range(PointerRNA *ptr, int *min, int *max) +{ + Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); + + *min= 0; + *max= CustomData_number_of_layers(fdata, CD_MCOL)-1; + *max= MAX2(0, *max); +} + static void rna_MeshColorLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->id.data; @@ -427,6 +530,14 @@ static void rna_MeshColorLayer_active_set(PointerRNA *ptr, int value) rna_CustomDataLayer_active_set(ptr, value, CD_MCOL, 0); } +static void rna_MeshColorLayer_name_set(PointerRNA *ptr, const char *value) +{ + Mesh *me= (Mesh*)ptr->id.data; + CustomDataLayer *cdl= (CustomDataLayer*)ptr->data; + BLI_strncpy(cdl->name, value, sizeof(cdl->name)); + CustomData_set_layer_unique_name(&me->fdata, cdl - me->fdata.layers); +} + static void rna_MeshFloatPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->id.data; @@ -449,7 +560,8 @@ static int rna_float_layer_check(CollectionPropertyIterator *iter, void *data) static void rna_Mesh_float_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->data; - rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_float_layer_check); + CustomData *fdata= rna_mesh_fdata(me); + rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, rna_float_layer_check); } static int rna_Mesh_float_layers_length(PointerRNA *ptr) @@ -479,7 +591,8 @@ static int rna_MeshIntPropertyLayer_data_length(PointerRNA *ptr) static void rna_Mesh_int_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->data; - rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_int_layer_check); + CustomData *fdata= rna_mesh_fdata(me); + rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, rna_int_layer_check); } static int rna_Mesh_int_layers_length(PointerRNA *ptr) @@ -509,7 +622,8 @@ static int rna_MeshStringPropertyLayer_data_length(PointerRNA *ptr) static void rna_Mesh_string_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->data; - rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_string_layer_check); + CustomData *fdata= rna_mesh_fdata(me); + rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, rna_string_layer_check); } static int rna_Mesh_string_layers_length(PointerRNA *ptr) @@ -568,17 +682,18 @@ static char *rna_MeshVertex_path(PointerRNA *ptr) static char *rna_MeshTextureFaceLayer_path(PointerRNA *ptr) { - return BLI_sprintfN("uv_layers[%s]", ((CustomDataLayer*)ptr->data)->name); + return BLI_sprintfN("uv_textures[%s]", ((CustomDataLayer*)ptr->data)->name); } static char *rna_CustomDataData_path(PointerRNA *ptr, char *collection, int type) { Mesh *me= (Mesh*)ptr->id.data; + CustomData *fdata= rna_mesh_fdata(me); CustomDataLayer *cdl; int a; size_t b; - for(cdl=me->fdata.layers, a=0; afdata.totlayer; cdl++, a++) { + for(cdl=fdata->layers, a=0; atotlayer; cdl++, a++) { if(cdl->type == type) { b= ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type); if(b >= 0 && b < me->totface) @@ -591,17 +706,17 @@ static char *rna_CustomDataData_path(PointerRNA *ptr, char *collection, int type static char *rna_MeshTextureFace_path(PointerRNA *ptr) { - return rna_CustomDataData_path(ptr, "uv_layers", CD_MTFACE); + return rna_CustomDataData_path(ptr, "uv_textures", CD_MTFACE); } static char *rna_MeshColorLayer_path(PointerRNA *ptr) { - return BLI_sprintfN("vcol_layers[%s]", ((CustomDataLayer*)ptr->data)->name); + return BLI_sprintfN("vertex_colors[%s]", ((CustomDataLayer*)ptr->data)->name); } static char *rna_MeshColor_path(PointerRNA *ptr) { - return rna_CustomDataData_path(ptr, "vcol_layers", CD_MCOL); + return rna_CustomDataData_path(ptr, "vertex_colors", CD_MCOL); } static char *rna_MeshSticky_path(PointerRNA *ptr) @@ -798,6 +913,7 @@ static void rna_def_mtface(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshTextureFaceLayer_name_set"); RNA_def_property_ui_text(prop, "Name", ""); prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); @@ -935,6 +1051,7 @@ static void rna_def_mcol(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshColorLayer_name_set"); RNA_def_property_ui_text(prop, "Name", ""); prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); @@ -1120,33 +1237,45 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_struct_type(prop, "MeshSticky"); RNA_def_property_ui_text(prop, "Sticky", "Sticky texture coordinates."); - /* UV layers */ + /* UV textures */ - prop= RNA_def_property(srna, "uv_layers", PROP_COLLECTION, PROP_NONE); + prop= RNA_def_property(srna, "uv_textures", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); - RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_layers_begin", 0, 0, 0, "rna_Mesh_uv_layers_length", 0, 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", 0, 0, 0, "rna_Mesh_uv_textures_length", 0, 0, 0, 0); RNA_def_property_struct_type(prop, "MeshTextureFaceLayer"); - RNA_def_property_ui_text(prop, "UV Layers", ""); + RNA_def_property_ui_text(prop, "UV Textures", ""); - prop= RNA_def_property(srna, "active_uv_layer", PROP_POINTER, PROP_UNSIGNED); + prop= RNA_def_property(srna, "active_uv_texture", PROP_POINTER, PROP_UNSIGNED); RNA_def_property_struct_type(prop, "MeshTextureFaceLayer"); - RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_uv_layer_get", "rna_Mesh_active_uv_layer_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_uv_texture_get", "rna_Mesh_active_uv_texture_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Active UV Layer", "Active UV layer."); + RNA_def_property_ui_text(prop, "Active UV Texture", "Active UV texture."); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "active_uv_texture_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_funcs(prop, "rna_Mesh_active_uv_texture_index_get", "rna_Mesh_active_uv_texture_index_set", "rna_Mesh_active_uv_texture_index_range"); + RNA_def_property_ui_text(prop, "Active UV Texture Index", "Active UV texture index."); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); - /* VCol layers */ + /* Vertex colors */ - prop= RNA_def_property(srna, "vcol_layers", PROP_COLLECTION, PROP_NONE); + prop= RNA_def_property(srna, "vertex_colors", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); - RNA_def_property_collection_funcs(prop, "rna_Mesh_vcol_layers_begin", 0, 0, 0, "rna_Mesh_vcol_layers_length", 0, 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Mesh_vertex_colors_begin", 0, 0, 0, "rna_Mesh_vertex_colors_length", 0, 0, 0, 0); RNA_def_property_struct_type(prop, "MeshColorLayer"); - RNA_def_property_ui_text(prop, "Vertex Color Layers", ""); + RNA_def_property_ui_text(prop, "Vertex Colors", ""); - prop= RNA_def_property(srna, "active_vcol_layer", PROP_POINTER, PROP_UNSIGNED); + prop= RNA_def_property(srna, "active_vertex_color", PROP_POINTER, PROP_UNSIGNED); RNA_def_property_struct_type(prop, "MeshColorLayer"); - RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_vcol_layer_get", "rna_Mesh_active_vcol_layer_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_vertex_color_get", "rna_Mesh_active_vertex_color_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Vertex Color Layer", "Active vertex color layer."); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "active_vertex_color_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_funcs(prop, "rna_Mesh_active_vertex_color_index_get", "rna_Mesh_active_vertex_color_index_set", "rna_Mesh_active_vertex_color_index_range"); + RNA_def_property_ui_text(prop, "Active Vertex Color Index", "Active vertex color index."); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "float_layers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); @@ -1182,6 +1311,7 @@ static void rna_def_mesh(BlenderRNA *brna) prop= RNA_def_property(srna, "double_sided", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_TWOSIDED); RNA_def_property_ui_text(prop, "Double Sided", "Render/display the mesh with double or single sided lighting"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "texco_mesh", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "texcomesh"); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 9b3100c733b..947846f8d8d 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -42,10 +42,13 @@ #ifdef RNA_RUNTIME +#include "DNA_key_types.h" + #include "BKE_armature.h" #include "BKE_context.h" #include "BKE_curve.h" #include "BKE_depsgraph.h" +#include "BKE_key.h" #include "BKE_material.h" #include "BKE_mesh.h" #include "BKE_particle.h" @@ -131,6 +134,27 @@ static PointerRNA rna_Object_active_vertex_group_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_VertexGroup, BLI_findlink(&ob->defbase, ob->actdef)); } +static int rna_Object_active_vertex_group_index_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + return MAX2(ob->actdef-1, 0); +} + +static void rna_Object_active_vertex_group_index_set(PointerRNA *ptr, int value) +{ + Object *ob= (Object*)ptr->id.data; + ob->actdef= value+1; +} + +static void rna_Object_active_vertex_group_index_range(PointerRNA *ptr, int *min, int *max) +{ + Object *ob= (Object*)ptr->id.data; + + *min= 0; + *max= BLI_countlist(&ob->defbase)-1; + *max= MAX2(0, *max); +} + void rna_object_vgroup_name_index_get(PointerRNA *ptr, char *value, int index) { Object *ob= (Object*)ptr->id.data; @@ -228,11 +252,23 @@ void rna_object_vcollayer_name_set(PointerRNA *ptr, const char *value, char *res BLI_strncpy(result, "", maxlen); } +static int rna_Object_active_material_index_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + return MAX2(ob->actcol-1, 0); +} + +static void rna_Object_active_material_index_set(PointerRNA *ptr, int value) +{ + Object *ob= (Object*)ptr->id.data; + ob->actcol= value+1; +} + static void rna_Object_active_material_index_range(PointerRNA *ptr, int *min, int *max) { Object *ob= (Object*)ptr->id.data; - *min= 1; - *max= ob->totcol; + *min= 0; + *max= MAX2(ob->totcol-1, 0); } static PointerRNA rna_Object_active_material_get(PointerRNA *ptr) @@ -244,14 +280,15 @@ static PointerRNA rna_Object_active_material_get(PointerRNA *ptr) static void rna_Object_active_particle_system_index_range(PointerRNA *ptr, int *min, int *max) { Object *ob= (Object*)ptr->id.data; - *min= 1; - *max= BLI_countlist(&ob->particlesystem); + *min= 0; + *max= BLI_countlist(&ob->particlesystem)-1; + *max= MAX2(0, *max); } static int rna_Object_active_particle_system_index_get(PointerRNA *ptr) { Object *ob= (Object*)ptr->id.data; - return psys_get_current_num(ob) + 1; + return psys_get_current_num(ob); } static void rna_Object_active_particle_system_index_set(struct PointerRNA *ptr, int value) @@ -384,6 +421,41 @@ static void rna_GameObjectSettings_state_set(PointerRNA *ptr, const int *values) } } +static void rna_Object_active_shape_key_index_range(PointerRNA *ptr, int *min, int *max) +{ + Object *ob= (Object*)ptr->id.data; + Key *key= ob_get_key(ob); + + *min= 0; + *max= (key)? BLI_countlist(&key->block)-1: 0; + *max= MAX2(0, *max); +} + +static int rna_Object_active_shape_key_index_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + + return MAX2(ob->shapenr-1, 0); +} + +static void rna_Object_active_shape_key_index_set(PointerRNA *ptr, int value) +{ + Object *ob= (Object*)ptr->id.data; + + ob->shapenr= value+1; + ob->shapeflag |= OB_SHAPE_TEMPLOCK; +} + +static void rna_Object_shape_key_lock_set(PointerRNA *ptr, int value) +{ + Object *ob= (Object*)ptr->id.data; + + if(value) ob->shapeflag |= OB_SHAPE_LOCK; + else ob->shapeflag &= ~OB_SHAPE_LOCK; + + ob->shapeflag &= ~OB_SHAPE_TEMPLOCK; +} + #else static void rna_def_vertex_group(BlenderRNA *brna) @@ -814,7 +886,7 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "active_material_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "actcol"); - RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Object_active_material_index_range"); + RNA_def_property_int_funcs(prop, "rna_Object_active_material_index_get", "rna_Object_active_material_index_set", "rna_Object_active_material_index_range"); RNA_def_property_ui_text(prop, "Active Material Index", "Index of active material slot."); /* transform */ @@ -895,8 +967,15 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "active_vertex_group", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "VertexGroup"); - RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", "rna_Object_active_vertex_group_set", NULL); RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + + prop= RNA_def_property(srna, "active_vertex_group_index", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "actdef"); + RNA_def_property_int_funcs(prop, "rna_Object_active_vertex_group_index_get", "rna_Object_active_vertex_group_index_set", "rna_Object_active_vertex_group_index_range"); + RNA_def_property_ui_text(prop, "Active Vertex Group Index", "Active index in vertex group array."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); /* empty */ @@ -1171,13 +1250,15 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "shape_key_lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_LOCK); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_boolean_funcs(prop, NULL, "rna_Object_shape_key_lock_set"); RNA_def_property_ui_text(prop, "Shape Key Lock", "Always show the current Shape for this Object."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); - prop= RNA_def_property(srna, "active_shape_key", PROP_INT, PROP_NONE); + prop= RNA_def_property(srna, "active_shape_key_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "shapenr"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Active Shape Key", "Current shape key index."); + RNA_def_property_int_funcs(prop, "rna_Object_active_shape_key_index_get", "rna_Object_active_shape_key_index_set", "rna_Object_active_shape_key_index_range"); + RNA_def_property_ui_text(prop, "Active Shape Key Index", "Current shape key index."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); RNA_api_object(srna); } diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 47c9025149a..5f03b7167f4 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -245,6 +245,11 @@ void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, mesh_select_mode_items); RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Mesh selection and display mode."); + prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_PERCENTAGE); + RNA_def_property_float_sdna(prop, NULL, "vgroup_weight"); + RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups."); + + /* Sculpt */ rna_def_sculpt(brna); } diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index b70112eebed..3df3fad3f15 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -259,6 +259,8 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "template_list", "uiTemplateList"); api_ui_item_rna_common(func); + parm= RNA_def_pointer(func, "active_data", "AnyType", "", "Data from which to take property for the active element."); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element."); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display.", 0, INT_MAX); -- cgit v1.2.3 From ede921fdfac1c76b8c54cae1723fbe9efd891939 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 2 Jul 2009 01:01:18 +0000 Subject: NLA SoC: Proper poll callbacks for Graph Editor For now, some of these polls may be a bit too restrictive, but at least we have some unified+cleaned bases to work from now (instead of relying on the generic ED_operator_area_active). --- source/blender/editors/space_graph/graph_buttons.c | 28 -- source/blender/editors/space_graph/graph_draw.c | 40 --- source/blender/editors/space_graph/graph_edit.c | 46 ++-- source/blender/editors/space_graph/graph_intern.h | 9 + source/blender/editors/space_graph/graph_ops.c | 2 +- source/blender/editors/space_graph/graph_select.c | 8 +- source/blender/editors/space_graph/graph_utils.c | 288 +++++++++++++++++++++ 7 files changed, 325 insertions(+), 96 deletions(-) create mode 100644 source/blender/editors/space_graph/graph_utils.c (limited to 'source') diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index ea4f017c9bb..f2dcd297866 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -1000,34 +1000,6 @@ static void graph_panel_modifiers(const bContext *C, Panel *pa) /* ******************* general ******************************** */ -/* Find 'active' F-Curve. It must be editable, since that's the purpose of these buttons (subject to change). - * We return the 'wrapper' since it contains valuable context info (about hierarchy), which will need to be freed - * when the caller is done with it. - */ -// TODO: move this to anim api with another name? -bAnimListElem *get_active_fcurve_channel (bAnimContext *ac) -{ - ListBase anim_data = {NULL, NULL}; - int filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_ACTIVE | ANIMFILTER_CURVESONLY); - int items = ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); - - /* We take the first F-Curve only, since some other ones may have had 'active' flag set - * if they were from linked data. - */ - if (items) { - bAnimListElem *ale= (bAnimListElem *)anim_data.first; - - /* remove first item from list, then free the rest of the list and return the stored one */ - BLI_remlink(&anim_data, ale); - BLI_freelistN(&anim_data); - - return ale; - } - - /* no active F-Curve */ - return NULL; -} - void graph_buttons_register(ARegionType *art) { PanelType *pt; diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 6393b6877b9..66168f2ed87 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -775,46 +775,6 @@ void graph_draw_ghost_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, Vie glDisable(GL_BLEND); } -/* check if any FModifiers to draw controls for - fcm is 'active' modifier */ -static short fcurve_needs_draw_fmodifier_controls (FCurve *fcu, FModifier *fcm) -{ - /* don't draw if there aren't any modifiers at all */ - if (fcu->modifiers.first == NULL) - return 0; - - /* if there's an active modifier - don't draw if it doesn't drastically - * alter the curve... - */ - if (fcm) { - switch (fcm->type) { - /* clearly harmless */ - case FMODIFIER_TYPE_CYCLES: - return 0; - - /* borderline... */ - case FMODIFIER_TYPE_NOISE: - return 0; - } - } - - /* if only one modifier - don't draw if it is muted or disabled */ - if (fcu->modifiers.first == fcu->modifiers.last) { - fcm= fcu->modifiers.first; - if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) - return 0; - } - - /* if only active modifier - don't draw if it is muted or disabled */ - if (fcm) { - if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) - return 0; - } - - /* if we're still here, this means that there are modifiers with controls to be drawn */ - // FIXME: what happens if all the modifiers were muted/disabled - return 1; -} - /* This is called twice from space_graph.c -> graph_main_area_draw() * Unselected then selected F-Curves are drawn so that they do not occlude each other. */ diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 4ea14a365e4..ca47e69cc75 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -189,7 +189,7 @@ void GRAPH_OT_previewrange_set (wmOperatorType *ot) /* api callbacks */ ot->exec= graphkeys_previewrange_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_visible_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -236,7 +236,7 @@ void GRAPH_OT_view_all (wmOperatorType *ot) /* api callbacks */ ot->exec= graphkeys_viewall_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_visible_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -347,7 +347,7 @@ void GRAPH_OT_ghost_curves_create (wmOperatorType *ot) /* api callbacks */ ot->exec= graphkeys_create_ghostcurves_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_visible_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -390,7 +390,7 @@ void GRAPH_OT_ghost_curves_clear (wmOperatorType *ot) /* api callbacks */ ot->exec= graphkeys_clear_ghostcurves_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_ipo_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -488,7 +488,7 @@ void GRAPH_OT_insert_keyframe (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= graphkeys_insertkey_exec; - ot->poll= ED_operator_ipo_active; // xxx + ot->poll= graphop_editable_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -575,7 +575,7 @@ void GRAPH_OT_click_insert (wmOperatorType *ot) /* api callbacks */ ot->invoke= graphkeys_click_insert_invoke; ot->exec= graphkeys_click_insert_exec; - ot->poll= ED_operator_areaactive; // XXX active + editable poll + ot->poll= graphop_active_fcurve_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -657,7 +657,7 @@ void GRAPH_OT_copy (wmOperatorType *ot) /* api callbacks */ ot->exec= graphkeys_copy_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_editable_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -696,7 +696,7 @@ void GRAPH_OT_paste (wmOperatorType *ot) /* api callbacks */ ot->exec= graphkeys_paste_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_editable_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -764,7 +764,7 @@ void GRAPH_OT_duplicate (wmOperatorType *ot) /* api callbacks */ ot->invoke= graphkeys_duplicate_invoke; ot->exec= graphkeys_duplicate_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_editable_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -825,7 +825,7 @@ void GRAPH_OT_delete (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_operator_confirm; ot->exec= graphkeys_delete_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_editable_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -886,7 +886,7 @@ void GRAPH_OT_clean (wmOperatorType *ot) /* api callbacks */ //ot->invoke= // XXX we need that number popup for this! ot->exec= graphkeys_clean_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_editable_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -967,7 +967,7 @@ void GRAPH_OT_bake (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_operator_confirm; // FIXME... ot->exec= graphkeys_bake_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_editable_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1092,7 +1092,7 @@ void GRAPH_OT_sample (wmOperatorType *ot) /* api callbacks */ ot->exec= graphkeys_sample_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_editable_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1167,7 +1167,7 @@ void GRAPH_OT_extrapolation_type (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= graphkeys_expo_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_editable_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1235,7 +1235,7 @@ void GRAPH_OT_interpolation_type (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= graphkeys_ipo_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_editable_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1322,7 +1322,7 @@ void GRAPH_OT_handletype (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= graphkeys_handletype_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_editable_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1411,7 +1411,7 @@ void GRAPH_OT_euler_filter (wmOperatorType *ot) /* api callbacks */ ot->exec= graphkeys_euler_filter_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_editable_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1438,7 +1438,7 @@ static int graphkeys_framejump_exec(bContext *C, wmOperator *op) memset(&bed, 0, sizeof(BeztEditData)); /* loop over action data, averaging values */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); for (ale= anim_data.first; ale; ale= ale->next) { @@ -1476,7 +1476,7 @@ void GRAPH_OT_frame_jump (wmOperatorType *ot) /* api callbacks */ ot->exec= graphkeys_framejump_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_visible_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1568,7 +1568,7 @@ void GRAPH_OT_snap (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= graphkeys_snap_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_editable_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1679,7 +1679,7 @@ void GRAPH_OT_mirror (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= graphkeys_mirror_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_editable_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1732,7 +1732,7 @@ void GRAPH_OT_smooth (wmOperatorType *ot) /* api callbacks */ ot->exec= graphkeys_smooth_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_editable_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1795,7 +1795,7 @@ void GRAPH_OT_fmodifier_add (wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= graph_fmodifier_add_exec; - ot->poll= ED_operator_areaactive; // XXX need active F-Curve + ot->poll= graphop_active_fcurve_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h index d520a63c126..fd7fe7cc6c9 100644 --- a/source/blender/editors/space_graph/graph_intern.h +++ b/source/blender/editors/space_graph/graph_intern.h @@ -141,8 +141,17 @@ void GRAPH_OT_ghost_curves_clear(struct wmOperatorType *ot); void GRAPH_OT_properties(struct wmOperatorType *ot); void graph_buttons_register(struct ARegionType *art); +/* ***************************************** */ +/* graph_utils.c */ + struct bAnimListElem *get_active_fcurve_channel(struct bAnimContext *ac); +short fcurve_needs_draw_fmodifier_controls(struct FCurve *fcu, struct FModifier *fcm); + +int graphop_visible_keyframes_poll(struct bContext *C); +int graphop_editable_keyframes_poll(struct bContext *C); +int graphop_active_fcurve_poll(struct bContext *C); + /* ***************************************** */ /* graph_ops.c */ void graphedit_keymap(struct wmWindowManager *wm); diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 012bfd944b4..d5e93dafaf0 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -92,7 +92,7 @@ void GRAPH_OT_view_togglehandles (wmOperatorType *ot) /* callbacks */ ot->exec= view_toggle_handles_exec; - ot->poll= ED_operator_areaactive; + ot->poll= ED_operator_ipo_active; } /* ************************** registration - operator types **********************************/ diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index afe66ed179e..11af86ca83b 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -182,7 +182,7 @@ void GRAPH_OT_select_all_toggle (wmOperatorType *ot) /* api callbacks */ ot->exec= graphkeys_deselectall_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_visible_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/; @@ -316,7 +316,7 @@ void GRAPH_OT_select_border(wmOperatorType *ot) ot->exec= graphkeys_borderselect_exec; ot->modal= WM_border_select_modal; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_visible_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/; @@ -506,7 +506,7 @@ void GRAPH_OT_select_column (wmOperatorType *ot) /* api callbacks */ ot->exec= graphkeys_columnselect_exec; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_visible_keyframes_poll; /* flags */ ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/; @@ -926,7 +926,7 @@ void GRAPH_OT_clickselect (wmOperatorType *ot) /* api callbacks */ ot->invoke= graphkeys_clickselect_invoke; - ot->poll= ED_operator_areaactive; + ot->poll= graphop_visible_keyframes_poll; /* id-props */ // XXX should we make this into separate operators? diff --git a/source/blender/editors/space_graph/graph_utils.c b/source/blender/editors/space_graph/graph_utils.c new file mode 100644 index 00000000000..b1ec795a089 --- /dev/null +++ b/source/blender/editors/space_graph/graph_utils.c @@ -0,0 +1,288 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation, Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include +#include +#include + +#include "DNA_anim_types.h" +#include "DNA_action_types.h" +#include "DNA_object_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_userdef_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_arithb.h" +#include "BLI_blenlib.h" +#include "BLI_editVert.h" +#include "BLI_rand.h" + +#include "BKE_animsys.h" +#include "BKE_action.h" +#include "BKE_context.h" +#include "BKE_curve.h" +#include "BKE_customdata.h" +#include "BKE_depsgraph.h" +#include "BKE_fcurve.h" +#include "BKE_object.h" +#include "BKE_global.h" +#include "BKE_scene.h" +#include "BKE_screen.h" +#include "BKE_utildefines.h" + +#include "BIF_gl.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "ED_anim_api.h" +#include "ED_keyframing.h" +#include "ED_screen.h" +#include "ED_types.h" +#include "ED_util.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "graph_intern.h" // own include + +/* ************************************************************** */ +/* Active F-Curve */ + +/* Find 'active' F-Curve. It must be editable, since that's the purpose of these buttons (subject to change). + * We return the 'wrapper' since it contains valuable context info (about hierarchy), which will need to be freed + * when the caller is done with it. + */ +bAnimListElem *get_active_fcurve_channel (bAnimContext *ac) +{ + ListBase anim_data = {NULL, NULL}; + int filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_ACTIVE | ANIMFILTER_CURVESONLY); + int items = ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); + + /* We take the first F-Curve only, since some other ones may have had 'active' flag set + * if they were from linked data. + */ + if (items) { + bAnimListElem *ale= (bAnimListElem *)anim_data.first; + + /* remove first item from list, then free the rest of the list and return the stored one */ + BLI_remlink(&anim_data, ale); + BLI_freelistN(&anim_data); + + return ale; + } + + /* no active F-Curve */ + return NULL; +} + +/* ************************************************************** */ +/* Operator Polling Callbacks */ + +/* check if any FModifiers to draw controls for - fcm is 'active' modifier + * used for the polling callbacks + also for drawing + */ +short fcurve_needs_draw_fmodifier_controls (FCurve *fcu, FModifier *fcm) +{ + /* don't draw if there aren't any modifiers at all */ + if (fcu->modifiers.first == NULL) + return 0; + + /* if there's an active modifier - don't draw if it doesn't drastically + * alter the curve... + */ + if (fcm) { + switch (fcm->type) { + /* clearly harmless */ + case FMODIFIER_TYPE_CYCLES: + return 0; + + /* borderline... */ + case FMODIFIER_TYPE_NOISE: + return 0; + } + } + + /* if only one modifier - don't draw if it is muted or disabled */ + if (fcu->modifiers.first == fcu->modifiers.last) { + fcm= fcu->modifiers.first; + if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) + return 0; + } + + /* if only active modifier - don't draw if it is muted or disabled */ + if (fcm) { + if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) + return 0; + } + + /* if we're still here, this means that there are modifiers with controls to be drawn */ + // FIXME: what happens if all the modifiers were muted/disabled + return 1; +} + +/* ------------------- */ + +/* Check if there are any visible keyframes (for selection tools) */ +int graphop_visible_keyframes_poll (bContext *C) +{ + bAnimContext ac; + bAnimListElem *ale; + ListBase anim_data = {NULL, NULL}; + ScrArea *sa= CTX_wm_area(C); + int filter, items; + short found = 0; + + /* firstly, check if in Graph Editor */ + // TODO: also check for region? + if ((sa == NULL) || (sa->spacetype != SPACE_IPO)) + return 0; + + /* try to init Anim-Context stuff ourselves and check */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return 0; + + /* loop over the visible (selection doesn't matter) F-Curves, and see if they're suitable + * stopping on the first successful match + */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); + items = ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + if (items == 0) + return 0; + + for (ale = anim_data.first; ale; ale= ale->next) { + FCurve *fcu= (FCurve *)ale->data; + FModifier *fcm; + + /* visible curves for selection must fulfull the following criteria: + * - it has bezier keyframes + * - F-Curve modifiers do not interfere with the result too much + * (i.e. the modifier-control drawing check returns false) + */ + if (fcu->bezt == NULL) + continue; + fcm= fcurve_find_active_modifier(fcu); + + found= (fcurve_needs_draw_fmodifier_controls(fcu, fcm) == 0); + if (found) break; + } + + /* cleanup and return findings */ + BLI_freelistN(&anim_data); + return found; +} + +/* Check if there are any visible + editable keyframes (for editing tools) */ +int graphop_editable_keyframes_poll (bContext *C) +{ + bAnimContext ac; + bAnimListElem *ale; + ListBase anim_data = {NULL, NULL}; + ScrArea *sa= CTX_wm_area(C); + int filter, items; + short found = 0; + + /* firstly, check if in Graph Editor */ + // TODO: also check for region? + if ((sa == NULL) || (sa->spacetype != SPACE_IPO)) + return 0; + + /* try to init Anim-Context stuff ourselves and check */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return 0; + + /* loop over the editable (selected + editable) F-Curves, and see if they're suitable + * stopping on the first successful match + */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + items = ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + if (items == 0) + return 0; + + for (ale = anim_data.first; ale; ale= ale->next) { + FCurve *fcu= (FCurve *)ale->data; + FModifier *fcm; + + /* editable curves must fulfull the following criteria: + * - it has bezier keyframes + * - it must not be protected from editing (this is already checked for with the foredit flag + * - F-Curve modifiers do not interfere with the result too much + * (i.e. the modifier-control drawing check returns false) + */ + if (fcu->bezt == NULL) + continue; + fcm= fcurve_find_active_modifier(fcu); + + found= (fcurve_needs_draw_fmodifier_controls(fcu, fcm) == 0); + if (found) break; + } + + /* cleanup and return findings */ + BLI_freelistN(&anim_data); + return found; +} + +/* has active F-Curve that's editable */ +int graphop_active_fcurve_poll (bContext *C) +{ + bAnimContext ac; + bAnimListElem *ale; + ScrArea *sa= CTX_wm_area(C); + short has_fcurve= 0; + + /* firstly, check if in Graph Editor */ + // TODO: also check for region? + if ((sa == NULL) || (sa->spacetype != SPACE_IPO)) + return 0; + + /* try to init Anim-Context stuff ourselves and check */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return 0; + + /* try to get the Active F-Curve */ + ale= get_active_fcurve_channel(&ac); + if (ale == NULL) + return 0; + + /* free temp data... */ + has_fcurve= ((ale->data) && (ale->type == ANIMTYPE_FCURVE)); + MEM_freeN(ale); + + /* return success */ + return has_fcurve; +} + +/* ************************************************************** */ -- cgit v1.2.3 From 1588de008a7c9c80d193034c0f8b4dc766620a38 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 2 Jul 2009 02:12:37 +0000 Subject: NLA SoC: Separated 'Built-In Function Generator' FModifier into a separate FModifier Started cleaning up FModifiers in preparation for allowing them to be used on NLA Strips. This commit separates the 'Built-in Function' mode for the Generator modifier out into its own modifier, since it was being quite frequently used (and the RNA wrapping for this used to be quite hackish). BACKWARDS COMPATABILITY WARNING: Old files with FModifiers saved (i.e. old 2.5 files, but not any others) will not load correctly as a result of these changes (the wrong modifiers will be shown). I've decided that there are not likely to be many files affected by this yet, but doing this will result in a much nicer modifiers-define list in the long run. --- source/blender/blenkernel/intern/fcurve.c | 256 +++++++++++---------- source/blender/editors/space_graph/graph_buttons.c | 129 ++++------- source/blender/editors/space_graph/graph_intern.h | 2 + source/blender/makesdna/DNA_anim_types.h | 45 ++-- source/blender/makesrna/RNA_access.h | 2 +- source/blender/makesrna/intern/rna_fcurve.c | 109 ++------- 6 files changed, 231 insertions(+), 312 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 27ca6332cdc..e52c63d1b21 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1,5 +1,5 @@ /** - * $Id: fcurve.c 21023 2009-06-20 04:02:49Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -1314,11 +1314,6 @@ static FModifierTypeInfo FMI_MODNAME = { * 1) simple polynomial generator: * - Exanded form - (y = C[0]*(x^(n)) + C[1]*(x^(n-1)) + ... + C[n]) * - Factorised form - (y = (C[0][0]*x + C[0][1]) * (C[1][0]*x + C[1][1]) * ... * (C[n][0]*x + C[n][1])) - * 2) simple builin 'functions': - * of the form (y = C[0] * fn( C[1]*x + C[2] ) + C[3]) - * where fn() can be any one of: - * sin, cos, tan, ln, sqrt - * 3) expression... */ static void fcm_generator_free (FModifier *fcm) @@ -1408,45 +1403,11 @@ static void fcm_generator_verify (FModifier *fcm) data->coefficients= nc; data->arraysize= data->poly_order * 2; } - } - break; - - case FCM_GENERATOR_FUNCTION: /* builtin function */ - { - /* arraysize needs to be 4*/ - if (data->arraysize != 4) { - float *nc; - - /* free the old data */ - if (data->coefficients) - MEM_freeN(data->coefficients); - - /* make new coefficients array, and init using default values */ - nc= data->coefficients= MEM_callocN(sizeof(float)*4, "FMod_Generator_Coefs"); - data->arraysize= 4; - - nc[0]= 1.0f; - nc[1]= 1.0f; - nc[2]= 0.0f; - nc[3]= 0.0f; - } } break; } } -/* Unary 'normalised sine' function - * y = sin(PI + x) / (PI * x), - * except for x = 0 when y = 1. - */ -static double sinc (double x) -{ - if (fabs(x) < 0.0001) - return 1.0; - else - return sin(M_PI * x) / (M_PI * x); -} - static void fcm_generator_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) { FMod_Generator *data= (FMod_Generator *)fcm->data; @@ -1509,86 +1470,6 @@ static void fcm_generator_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, } } break; - - case FCM_GENERATOR_FUNCTION: /* builtin function */ - { - double arg= data->coefficients[1]*evaltime + data->coefficients[2]; - double (*fn)(double v) = NULL; - - /* get function pointer to the func to use: - * WARNING: must perform special argument validation hereto guard against crashes - */ - switch (data->func_type) - { - /* simple ones */ - case FCM_GENERATOR_FN_SIN: /* sine wave */ - fn= sin; - break; - case FCM_GENERATOR_FN_COS: /* cosine wave */ - fn= cos; - break; - case FCM_GENERATOR_FN_SINC: /* normalised sine wave */ - fn= sinc; - break; - - /* validation required */ - case FCM_GENERATOR_FN_TAN: /* tangent wave */ - { - /* check that argument is not on one of the discontinuities (i.e. 90deg, 270 deg, etc) */ - if IS_EQ(fmod((arg - M_PI_2), M_PI), 0.0) { - if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0) - *cvalue = 0.0f; /* no value possible here */ - } - else - fn= tan; - } - break; - case FCM_GENERATOR_FN_LN: /* natural log */ - { - /* check that value is greater than 1? */ - if (arg > 1.0f) { - fn= log; - } - else { - if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0) - *cvalue = 0.0f; /* no value possible here */ - } - } - break; - case FCM_GENERATOR_FN_SQRT: /* square root */ - { - /* no negative numbers */ - if (arg > 0.0f) { - fn= sqrt; - } - else { - if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0) - *cvalue = 0.0f; /* no value possible here */ - } - } - break; - - default: - printf("Invalid Function-Generator for F-Modifier - %d \n", data->func_type); - } - - /* execute function callback to set value if appropriate */ - if (fn) { - float value= (float)(data->coefficients[0]*fn(arg) + data->coefficients[3]); - - if (data->flag & FCM_GENERATOR_ADDITIVE) - *cvalue += value; - else - *cvalue= value; - } - } - break; - -#ifndef DISABLE_PYTHON - case FCM_GENERATOR_EXPRESSION: /* py-expression */ - // TODO... - break; -#endif /* DISABLE_PYTHON */ } } @@ -1607,6 +1488,128 @@ static FModifierTypeInfo FMI_GENERATOR = { fcm_generator_evaluate /* evaluate */ }; +/* Built-In Function Generator F-Curve Modifier --------------------------- */ + +/* This uses the general equation for equations: + * y = amplitude * fn(phase_multiplier*x + phase_offset) + y_offset + * + * where amplitude, phase_multiplier/offset, y_offset are user-defined coefficients, + * x is the evaluation 'time', and 'y' is the resultant value + * + * Functions available are + * sin, cos, tan, sinc (normalised sin), natural log, square root + */ + +static void fcm_fn_generator_new_data (void *mdata) +{ + FMod_FunctionGenerator *data= (FMod_FunctionGenerator *)mdata; + + /* set amplitude and phase multiplier to 1.0f so that something is generated */ + data->amplitude= 1.0f; + data->phase_multiplier= 1.0f; +} + +/* Unary 'normalised sine' function + * y = sin(PI + x) / (PI * x), + * except for x = 0 when y = 1. + */ +static double sinc (double x) +{ + if (fabs(x) < 0.0001) + return 1.0; + else + return sin(M_PI * x) / (M_PI * x); +} + +static void fcm_fn_generator_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) +{ + FMod_FunctionGenerator *data= (FMod_FunctionGenerator *)fcm->data; + double arg= data->phase_multiplier*evaltime + data->phase_offset; + double (*fn)(double v) = NULL; + + /* get function pointer to the func to use: + * WARNING: must perform special argument validation hereto guard against crashes + */ + switch (data->type) + { + /* simple ones */ + case FCM_GENERATOR_FN_SIN: /* sine wave */ + fn= sin; + break; + case FCM_GENERATOR_FN_COS: /* cosine wave */ + fn= cos; + break; + case FCM_GENERATOR_FN_SINC: /* normalised sine wave */ + fn= sinc; + break; + + /* validation required */ + case FCM_GENERATOR_FN_TAN: /* tangent wave */ + { + /* check that argument is not on one of the discontinuities (i.e. 90deg, 270 deg, etc) */ + if IS_EQ(fmod((arg - M_PI_2), M_PI), 0.0) { + if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0) + *cvalue = 0.0f; /* no value possible here */ + } + else + fn= tan; + } + break; + case FCM_GENERATOR_FN_LN: /* natural log */ + { + /* check that value is greater than 1? */ + if (arg > 1.0f) { + fn= log; + } + else { + if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0) + *cvalue = 0.0f; /* no value possible here */ + } + } + break; + case FCM_GENERATOR_FN_SQRT: /* square root */ + { + /* no negative numbers */ + if (arg > 0.0f) { + fn= sqrt; + } + else { + if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0) + *cvalue = 0.0f; /* no value possible here */ + } + } + break; + + default: + printf("Invalid Function-Generator for F-Modifier - %d \n", data->type); + } + + /* execute function callback to set value if appropriate */ + if (fn) { + float value= (float)(data->amplitude*fn(arg) + data->value_offset); + + if (data->flag & FCM_GENERATOR_ADDITIVE) + *cvalue += value; + else + *cvalue= value; + } +} + +static FModifierTypeInfo FMI_FN_GENERATOR = { + FMODIFIER_TYPE_FN_GENERATOR, /* type */ + sizeof(FMod_FunctionGenerator), /* size */ + FMI_TYPE_GENERATE_CURVE, /* action type */ + FMI_REQUIRES_NOTHING, /* requirements */ + "Built-In Function", /* name */ + "FMod_FunctionGenerator", /* struct name */ + NULL, /* free data */ + NULL, /* copy data */ + fcm_fn_generator_new_data, /* new data */ + NULL, /* verify */ + NULL, /* evaluate time */ + fcm_fn_generator_evaluate /* evaluate */ +}; + /* Envelope F-Curve Modifier --------------------------- */ static void fcm_envelope_free (FModifier *fcm) @@ -2081,12 +2084,13 @@ static void fmods_init_typeinfo () { fmodifiersTypeInfo[0]= NULL; /* 'Null' F-Curve Modifier */ fmodifiersTypeInfo[1]= &FMI_GENERATOR; /* Generator F-Curve Modifier */ - fmodifiersTypeInfo[2]= &FMI_ENVELOPE; /* Envelope F-Curve Modifier */ - fmodifiersTypeInfo[3]= &FMI_CYCLES; /* Cycles F-Curve Modifier */ - fmodifiersTypeInfo[4]= &FMI_NOISE; /* Apply-Noise F-Curve Modifier */ - fmodifiersTypeInfo[5]= NULL/*&FMI_FILTER*/; /* Filter F-Curve Modifier */ // XXX unimplemented - fmodifiersTypeInfo[6]= &FMI_PYTHON; /* Custom Python F-Curve Modifier */ - fmodifiersTypeInfo[7]= &FMI_LIMITS; /* Limits F-Curve Modifier */ + fmodifiersTypeInfo[2]= &FMI_FN_GENERATOR; /* Built-In Function Generator F-Curve Modifier */ + fmodifiersTypeInfo[3]= &FMI_ENVELOPE; /* Envelope F-Curve Modifier */ + fmodifiersTypeInfo[4]= &FMI_CYCLES; /* Cycles F-Curve Modifier */ + fmodifiersTypeInfo[5]= &FMI_NOISE; /* Apply-Noise F-Curve Modifier */ + fmodifiersTypeInfo[6]= NULL/*&FMI_FILTER*/; /* Filter F-Curve Modifier */ // XXX unimplemented + fmodifiersTypeInfo[7]= &FMI_PYTHON; /* Custom Python F-Curve Modifier */ + fmodifiersTypeInfo[8]= &FMI_LIMITS; /* Limits F-Curve Modifier */ } /* This function should be used for getting the appropriate type-info when only diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index f2dcd297866..e68ee53521d 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -404,8 +404,7 @@ static void delete_fmodifier_cb (bContext *C, void *fcu_v, void *fcm_v) static void draw_modifier__generator(uiBlock *block, FCurve *fcu, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) { FMod_Generator *data= (FMod_Generator *)fcm->data; - char gen_mode[]="Generator Type%t|Expanded Polynomial%x0|Factorised Polynomial%x1|Built-In Function%x2|Expression%x3"; - char fn_type[]="Built-In Function%t|Sin%x0|Cos%x1|Tan%x2|Square Root%x3|Natural Log%x4|Normalised Sin%x5"; + char gen_mode[]="Generator Type%t|Expanded Polynomial%x0|Factorised Polynomial%x1"; int cy= *yco - 30; uiBut *but; @@ -418,22 +417,16 @@ static void draw_modifier__generator(uiBlock *block, FCurve *fcu, FModifier *fcm case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* factorised polynomial */ (*height) += 20 * data->poly_order + 15; break; - case FCM_GENERATOR_FUNCTION: /* builtin function */ - (*height) += 55; // xxx - break; - case FCM_GENERATOR_EXPRESSION: /* py-expression */ - // xxx nothing to draw - break; } /* basic settings (backdrop + mode selector + some padding) */ DRAW_BACKDROP((*height)); uiBlockBeginAlign(block); - but= uiDefButS(block, MENU, B_FMODIFIER_REDRAW, gen_mode, 10,cy,width-30,19, &data->mode, 0, 0, 0, 0, "Selects type of generator algorithm."); + but= uiDefButI(block, MENU, B_FMODIFIER_REDRAW, gen_mode, 10,cy,width-30,19, &data->mode, 0, 0, 0, 0, "Selects type of generator algorithm."); uiButSetFunc(but, validate_fmodifier_cb, fcu, fcm); cy -= 20; - uiDefButBitS(block, TOG, FCM_GENERATOR_ADDITIVE, B_FMODIFIER_REDRAW, "Additive", 10,cy,width-30,19, &data->flag, 0, 0, 0, 0, "Values generated by this modifier are applied on top of the existing values instead of overwriting them"); + uiDefButBitI(block, TOG, FCM_GENERATOR_ADDITIVE, B_FMODIFIER_REDRAW, "Additive", 10,cy,width-30,19, &data->flag, 0, 0, 0, 0, "Values generated by this modifier are applied on top of the existing values instead of overwriting them"); cy -= 35; uiBlockEndAlign(block); @@ -446,7 +439,7 @@ static void draw_modifier__generator(uiBlock *block, FCurve *fcu, FModifier *fcm unsigned int i; /* draw polynomial order selector */ - but= uiDefButS(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 10,cy,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1"); + but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 10,cy,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1"); uiButSetFunc(but, validate_fmodifier_cb, fcu, fcm); cy -= 35; @@ -481,7 +474,7 @@ static void draw_modifier__generator(uiBlock *block, FCurve *fcu, FModifier *fcm unsigned int i; /* draw polynomial order selector */ - but= uiDefButS(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 10,cy,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1"); + but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 10,cy,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1"); uiButSetFunc(but, validate_fmodifier_cb, fcu, fcm); cy -= 35; @@ -510,82 +503,42 @@ static void draw_modifier__generator(uiBlock *block, FCurve *fcu, FModifier *fcm } } break; - - case FCM_GENERATOR_FUNCTION: /* built-in function */ - { - float *cp= data->coefficients; - - /* draw function selector */ - but= uiDefButS(block, MENU, B_FMODIFIER_REDRAW, fn_type, 10,cy,width-30,19, &data->func_type, 0, 0, 0, 0, "Built-In Function to use"); - uiButSetFunc(but, validate_fmodifier_cb, fcu, fcm); - cy -= 35; - - /* draw controls for equation of coefficients */ - /* row 1 */ - { - uiDefBut(block, LABEL, 1, "y = ", 0, cy, 50, 20, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 50, cy, 150, 20, cp+3, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient (D) for function"); - uiDefBut(block, LABEL, 1, "+", 200, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); - cy -= 20; - } - - /* row 2 */ - { - char func_name[32]; - - /* coefficient outside bracket */ - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 5, cy, 80, 20, cp, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient (A) for function"); - - /* opening bracket */ - switch (data->func_type) - { - case FCM_GENERATOR_FN_SIN: /* sine wave */ - sprintf(func_name, "sin("); - break; - case FCM_GENERATOR_FN_COS: /* cosine wave */ - sprintf(func_name, "cos("); - break; - case FCM_GENERATOR_FN_TAN: /* tangent wave */ - sprintf(func_name, "tan("); - break; - case FCM_GENERATOR_FN_LN: /* natural log */ - sprintf(func_name, "ln("); - break; - case FCM_GENERATOR_FN_SQRT: /* square root */ - sprintf(func_name, "sqrt("); - break; - case FCM_GENERATOR_FN_SINC: /* normalised sine wave */ - sprintf(func_name, "sinc("); - break; - default: /* unknown */ - sprintf(func_name, "("); - break; - } - uiDefBut(block, LABEL, 1, func_name, 85, cy, 40, 20, NULL, 0.0, 0.0, 0, 0, ""); - - /* coefficients inside bracket */ - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 120, cy, 75, 20, cp+1, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient (B) of x"); - - uiDefBut(block, LABEL, 1, "x+", 195, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 225, cy, 80, 20, cp+2, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient (C) of function"); - - /* closing bracket */ - uiDefBut(block, LABEL, 1, ")", 300, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); - cy -= 20; - } - } - break; - - case FCM_GENERATOR_EXPRESSION: /* py-expression */ - // TODO... - break; } } /* --------------- */ +/* draw settings for noise modifier */ +static void draw_modifier__fn_generator(uiBlock *block, FCurve *fcu, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) +{ + FMod_FunctionGenerator *data= (FMod_FunctionGenerator *)fcm->data; + int cy= (*yco - 30), cy1= (*yco - 50), cy2= (*yco - 70); + char fn_type[]="Built-In Function%t|Sin%x0|Cos%x1|Tan%x2|Square Root%x3|Natural Log%x4|Normalised Sin%x5"; + + /* set the height */ + (*height) = 80; + + /* basic settings (backdrop + some padding) */ + DRAW_BACKDROP((*height)); + + uiDefButI(block, MENU, B_FMODIFIER_REDRAW, fn_type, + 3, cy, 300, 20, &data->type, 0, 0, 0, 0, "Type of function used to generate values"); + + + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Amplitude:", + 3, cy1, 150, 20, &data->amplitude, 0.000001, 10000.0, 0.01, 3, "Scale factor determining the maximum/minimum values."); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Value Offset:", + 3, cy2, 150, 20, &data->value_offset, 0.0, 10000.0, 0.01, 3, "Constant factor to offset values by."); + + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Phase Multiplier:", + 155, cy1, 150, 20, &data->phase_multiplier, 0.0, 100000.0, 0.1, 3, "Scale factor determining the 'speed' of the function."); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Phase Offset:", + 155, cy2, 150, 20, &data->phase_offset, 0.0, 100000.0, 0.1, 3, "Constant factor to offset time by for function."); + +} + +/* --------------- */ + /* draw settings for cycles modifier */ static void draw_modifier__cycles(uiBlock *block, FCurve *fcu, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) { @@ -621,7 +574,7 @@ static void draw_modifier__noise(uiBlock *block, FCurve *fcu, FModifier *fcm, in { FMod_Noise *data= (FMod_Noise *)fcm->data; int cy= (*yco - 30), cy1= (*yco - 50), cy2= (*yco - 70); - char cyc_mode[]="Modification %t|Replace %x0|Add %x1|Subtract %x2|Multiply %x3"; + char blend_mode[]="Modification %t|Replace %x0|Add %x1|Subtract %x2|Multiply %x3"; /* set the height */ (*height) = 80; @@ -629,8 +582,8 @@ static void draw_modifier__noise(uiBlock *block, FCurve *fcu, FModifier *fcm, in /* basic settings (backdrop + some padding) */ DRAW_BACKDROP((*height)); - uiDefButS(block, MENU, B_FMODIFIER_REDRAW, cyc_mode, - 3, cy, 150, 20, &data->modification, 0, 0, 0, 0, "Method of modifying the existing F-Curve use before first keyframe"); + uiDefButS(block, MENU, B_FMODIFIER_REDRAW, blend_mode, + 3, cy, 150, 20, &data->modification, 0, 0, 0, 0, "Method of combining the results of this modifier and other modifiers."); uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Size:", 3, cy1, 150, 20, &data->size, 0.000001, 10000.0, 0.01, 3, ""); @@ -946,6 +899,10 @@ static void graph_panel_modifier_draw(uiBlock *block, FCurve *fcu, FModifier *fc draw_modifier__generator(block, fcu, fcm, yco, &height, width, active, rb_col); break; + case FMODIFIER_TYPE_FN_GENERATOR: /* Built-In Function Generator */ + draw_modifier__fn_generator(block, fcu, fcm, yco, &height, width, active, rb_col); + break; + case FMODIFIER_TYPE_CYCLES: /* Cycles */ draw_modifier__cycles(block, fcu, fcm, yco, &height, width, active, rb_col); break; diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h index fd7fe7cc6c9..86e5451122d 100644 --- a/source/blender/editors/space_graph/graph_intern.h +++ b/source/blender/editors/space_graph/graph_intern.h @@ -32,6 +32,8 @@ struct bContext; struct wmWindowManager; struct bAnimContext; struct bAnimListElem; +struct FCurve; +struct FModifier; struct SpaceIpo; struct ScrArea; struct ARegion; diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index 2b089530236..ad3edde6552 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -1,5 +1,5 @@ /** - * $Id: DNA_anim_types.h 21023 2009-06-20 04:02:49Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -66,6 +66,7 @@ typedef struct FModifier { enum { FMODIFIER_TYPE_NULL = 0, FMODIFIER_TYPE_GENERATOR, + FMODIFIER_TYPE_FN_GENERATOR, FMODIFIER_TYPE_ENVELOPE, FMODIFIER_TYPE_CYCLES, FMODIFIER_TYPE_NOISE, /* unimplemented - generate variations using some basic noise generator... */ @@ -91,39 +92,55 @@ enum { /* --- */ -/* generator modifier data */ +/* Generator modifier data */ typedef struct FMod_Generator { - /* generator based on PyExpression */ - char expression[256]; /* python expression to use as generator */ - /* general generator information */ float *coefficients; /* coefficients array */ unsigned int arraysize; /* size of the coefficients array */ - short poly_order; /* order of polynomial generated (i.e. 1 for linear, 2 for quadratic) */ - short func_type; /* builtin math function eFMod_Generator_Functions */ - - int pad; + int poly_order; /* order of polynomial generated (i.e. 1 for linear, 2 for quadratic) */ + int mode; /* which 'generator' to use eFMod_Generator_Modes */ /* settings */ - short flag; /* settings */ - short mode; /* which 'generator' to use eFMod_Generator_Modes */ + int flag; /* settings */ } FMod_Generator; /* generator modes */ enum { FCM_GENERATOR_POLYNOMIAL = 0, FCM_GENERATOR_POLYNOMIAL_FACTORISED, - FCM_GENERATOR_FUNCTION, - FCM_GENERATOR_EXPRESSION, } eFMod_Generator_Modes; -/* generator flags */ + +/* generator flags + * - shared by Generator and Function Generator + */ enum { /* generator works in conjunction with other modifiers (i.e. doesn't replace those before it) */ FCM_GENERATOR_ADDITIVE = (1<<0), } eFMod_Generator_Flags; + +/* 'Built-In Function' Generator modifier data + * + * This uses the general equation for equations: + * y = amplitude * fn(phase_multiplier*x + phase_offset) + y_offset + * + * where amplitude, phase_multiplier/offset, y_offset are user-defined coefficients, + * x is the evaluation 'time', and 'y' is the resultant value + */ +typedef struct FMod_FunctionGenerator { + /* coefficients for general equation (as above) */ + float amplitude; + float phase_multiplier; + float phase_offset; + float value_offset; + + /* flags */ + int type; /* eFMod_Generator_Functions */ + int flag; /* eFMod_Generator_flags */ +} FMod_FunctionGenerator; + /* 'function' generator types */ enum { FCM_GENERATOR_FN_SIN = 0, diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index dda0d57f8ad..cf74a863401 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -177,8 +177,8 @@ extern StructRNA RNA_FCurve; extern StructRNA RNA_FModifier; extern StructRNA RNA_FModifierCycles; extern StructRNA RNA_FModifierEnvelope; +extern StructRNA RNA_FModifierFunctionGenerator; extern StructRNA RNA_FModifierGenerator; -extern StructRNA RNA_FModifierGenerator_Function; extern StructRNA RNA_FModifierGenerator_PolyExpanded; extern StructRNA RNA_FModifierLimits; extern StructRNA RNA_FModifierNoise; diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index a1cd95c9d90..4a83b80a6cf 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -37,6 +37,7 @@ EnumPropertyItem fmodifier_type_items[] = { {FMODIFIER_TYPE_NULL, "NULL", 0, "Invalid", ""}, {FMODIFIER_TYPE_GENERATOR, "GENERATOR", 0, "Generator", ""}, + {FMODIFIER_TYPE_FN_GENERATOR, "FNGENERATOR", 0, "Built-In Function", ""}, {FMODIFIER_TYPE_ENVELOPE, "ENVELOPE", 0, "Envelope", ""}, {FMODIFIER_TYPE_CYCLES, "CYCLES", 0, "Cycles", ""}, {FMODIFIER_TYPE_NOISE, "NOISE", 0, "Noise", ""}, @@ -47,62 +48,6 @@ EnumPropertyItem fmodifier_type_items[] = { #ifdef RNA_RUNTIME -float FModGenFunc_amplitude_get(PointerRNA *ptr) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - return (data->coefficients) ? (float)data->coefficients[0] : 1.0f; -} - -void FModGenFunc_amplitude_set(PointerRNA *ptr, float value) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - if (data->coefficients) data->coefficients[0]= value; -} - -float FModGenFunc_pre_multiplier_get(PointerRNA *ptr) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - return (data->coefficients) ? (float)data->coefficients[1] : 1.0f; -} - -void FModGenFunc_pre_multiplier_set(PointerRNA *ptr, float value) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - if (data->coefficients) data->coefficients[1]= value; -} - -float FModGenFunc_x_offset_get(PointerRNA *ptr) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - return (data->coefficients) ? (float)data->coefficients[2] : 0.0f; -} - -void FModGenFunc_x_offset_set(PointerRNA *ptr, float value) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - if (data->coefficients) data->coefficients[2]= value; -} - -float FModGenFunc_y_offset_get(PointerRNA *ptr) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - return (data->coefficients) ? (float)data->coefficients[3] : 0.0f; -} - -void FModGenFunc_y_offset_set(PointerRNA *ptr, float value) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - if (data->coefficients) data->coefficients[3]= value; -} - /* --------- */ StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr) @@ -118,13 +63,12 @@ StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr) case FCM_GENERATOR_POLYNOMIAL: return &RNA_FModifierGenerator_PolyExpanded; //case FCM_GENERATOR_POLYNOMIAL_FACTORISED: - case FCM_GENERATOR_FUNCTION: - return &RNA_FModifierGenerator_Function; - //case FCM_GENERATOR_EXPRESSION: default: return &RNA_FModifierGenerator; } } + case FMODIFIER_TYPE_FN_GENERATOR: + return &RNA_FModifierFunctionGenerator; case FMODIFIER_TYPE_ENVELOPE: return &RNA_FModifierEnvelope; case FMODIFIER_TYPE_CYCLES: @@ -222,8 +166,6 @@ static void rna_def_fmodifier_generator_common(StructRNA *srna) static EnumPropertyItem prop_mode_items[] = { {FCM_GENERATOR_POLYNOMIAL, "POLYNOMIAL", 0, "Expanded Polynomial", ""}, {FCM_GENERATOR_POLYNOMIAL_FACTORISED, "POLYNOMIAL_FACTORISED", 0, "Factorised Polynomial", ""}, - {FCM_GENERATOR_FUNCTION, "FUNCTION", 0, "Built-In Function", ""}, - {FCM_GENERATOR_EXPRESSION, "EXPRESSION", 0, "Expression", ""}, {0, NULL, 0, NULL, NULL}}; /* struct wrapping settings */ @@ -273,7 +215,7 @@ static void rna_def_fmodifier_generator_polyexpanded(BlenderRNA *brna) //RNA_def_property_ui_text(prop, "Coefficients", "Coefficients for 'x' (starting from lowest power)."); } -static void rna_def_fmodifier_generator_function(BlenderRNA *brna) +static void rna_def_fmodifier_function_generator(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; @@ -286,35 +228,32 @@ static void rna_def_fmodifier_generator_function(BlenderRNA *brna) {4, "LN", 0, "Natural Logarithm", ""}, {5, "SINC", 0, "Normalised Sine", "sin(x) / x"}, {0, NULL, 0, NULL, NULL}}; - - - srna= RNA_def_struct(brna, "FModifierGenerator_Function", "FModifier"); - RNA_def_struct_ui_text(srna, "Built-In Function Generator", "Generates values for modified F-Curve using Built-In Function."); - - /* common settings */ - rna_def_fmodifier_generator_common(srna); - /* type */ - prop= RNA_def_property(srna, "func_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Type", "Type of Built-In function to use as generator."); + srna= RNA_def_struct(brna, "FModifierFunctionGenerator", "FModifier"); + RNA_def_struct_ui_text(srna, "Built-In Function F-Curve Modifier", "Generates values using a Built-In Function."); + RNA_def_struct_sdna_from(srna, "FMod_FunctionGenerator", "data"); /* coefficients */ prop= RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "FModGenFunc_amplitude_get", "FModGenFunc_amplitude_set", NULL); - RNA_def_property_ui_text(prop, "Amplitude", "Scale factor for y-values generated by the function."); + RNA_def_property_ui_text(prop, "Amplitude", "Scale factor determining the maximum/minimum values."); + + prop= RNA_def_property(srna, "phase_multiplier", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Phase Multiplier", "Scale factor determining the 'speed' of the function."); - prop= RNA_def_property(srna, "pre_multiplier", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "FModGenFunc_pre_multiplier_get", "FModGenFunc_pre_multiplier_set", NULL); - RNA_def_property_ui_text(prop, "PreMultiplier", "Scale factor for x-value inputs to function."); + prop= RNA_def_property(srna, "phase_offset", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Phase Offset", "Constant factor to offset time by for function."); - prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "FModGenFunc_x_offset_get", "FModGenFunc_x_offset_set", NULL); - RNA_def_property_ui_text(prop, "X Offset", "Offset for x-value inputs to function."); + prop= RNA_def_property(srna, "value_offset", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Value Offset", "Constant factor to offset values by."); - prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "FModGenFunc_y_offset_get", "FModGenFunc_y_offset_set", NULL); - RNA_def_property_ui_text(prop, "Y Offset", "Offset for y-values generated by the function."); + /* flags */ + prop= RNA_def_property(srna, "additive", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE); + RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them."); + + prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, prop_type_items); + RNA_def_property_ui_text(prop, "Type", "Type of built-in function to use."); } /* --------- */ @@ -646,7 +585,7 @@ void RNA_def_fcurve(BlenderRNA *brna) rna_def_fmodifier_generator(brna); rna_def_fmodifier_generator_polyexpanded(brna); - rna_def_fmodifier_generator_function(brna); + rna_def_fmodifier_function_generator(brna); rna_def_fmodifier_envelope(brna); rna_def_fmodifier_cycles(brna); rna_def_fmodifier_python(brna); -- cgit v1.2.3 From 78939898c735d6f2048e9fc2aa64a3188ff5732f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 2 Jul 2009 02:53:18 +0000 Subject: NLA SoC: Adding some files that seem to have been missed during some merges. Hopefully all of these should really be in the repositry... --- .../gameengine/Converter/BL_ModifierDeformer.cpp | 183 ++++++++++ source/gameengine/Converter/BL_ModifierDeformer.h | 107 ++++++ source/gameengine/Ketsji/KX_PythonSeq.cpp | 382 +++++++++++++++++++++ source/gameengine/Ketsji/KX_PythonSeq.h | 60 ++++ source/gameengine/PyDoc/API_intro.py | 103 ++++++ source/gameengine/SceneGraph/SG_DList.h | 161 +++++++++ source/gameengine/SceneGraph/SG_QList.h | 157 +++++++++ 7 files changed, 1153 insertions(+) create mode 100644 source/gameengine/Converter/BL_ModifierDeformer.cpp create mode 100644 source/gameengine/Converter/BL_ModifierDeformer.h create mode 100644 source/gameengine/Ketsji/KX_PythonSeq.cpp create mode 100644 source/gameengine/Ketsji/KX_PythonSeq.h create mode 100644 source/gameengine/PyDoc/API_intro.py create mode 100644 source/gameengine/SceneGraph/SG_DList.h create mode 100644 source/gameengine/SceneGraph/SG_QList.h (limited to 'source') diff --git a/source/gameengine/Converter/BL_ModifierDeformer.cpp b/source/gameengine/Converter/BL_ModifierDeformer.cpp new file mode 100644 index 00000000000..eb27820c92f --- /dev/null +++ b/source/gameengine/Converter/BL_ModifierDeformer.cpp @@ -0,0 +1,183 @@ +/** + * $Id: BL_ModifierDeformer.cpp 20741 2009-06-08 20:08:19Z blendix $ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifdef WIN32 +#pragma warning (disable : 4786) +#endif //WIN32 + +#include "MEM_guardedalloc.h" +#include "BL_ModifierDeformer.h" +#include "GEN_Map.h" +#include "STR_HashedString.h" +#include "RAS_IPolygonMaterial.h" +#include "BL_SkinMeshObject.h" +#include "PHY_IGraphicController.h" + +//#include "BL_ArmatureController.h" +#include "DNA_armature_types.h" +#include "DNA_action_types.h" +#include "DNA_key_types.h" +#include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" +#include "DNA_ipo_types.h" +#include "DNA_curve_types.h" +#include "DNA_modifier_types.h" +#include "DNA_scene_types.h" +#include "BKE_armature.h" +#include "BKE_action.h" +#include "BKE_key.h" +#include "BKE_ipo.h" +#include "MT_Point3.h" + +extern "C"{ + #include "BKE_customdata.h" + #include "BKE_DerivedMesh.h" + #include "BKE_lattice.h" + #include "BKE_modifier.h" +} + #include "BKE_utildefines.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" + +#define __NLA_DEFNORMALS +//#undef __NLA_DEFNORMALS + + +BL_ModifierDeformer::~BL_ModifierDeformer() +{ + if (m_dm) { + // deformedOnly is used as a user counter + if (--m_dm->deformedOnly == 0) { + m_dm->needsFree = 1; + m_dm->release(m_dm); + } + } +}; + +RAS_Deformer *BL_ModifierDeformer::GetReplica() +{ + BL_ModifierDeformer *result; + + result = new BL_ModifierDeformer(*this); + result->ProcessReplica(); + return result; +} + +void BL_ModifierDeformer::ProcessReplica() +{ + /* Note! - This is not inherited from PyObjectPlus */ + BL_ShapeDeformer::ProcessReplica(); + if (m_dm) + // by default try to reuse mesh, deformedOnly is used as a user count + m_dm->deformedOnly++; + // this will force an update and if the mesh cannot be reused, a new one will be created + m_lastModifierUpdate = -1; +} + +bool BL_ModifierDeformer::HasCompatibleDeformer(Object *ob) +{ + if (!ob->modifiers.first) + return false; + // soft body cannot use mesh modifiers + if ((ob->gameflag & OB_SOFT_BODY) != 0) + return false; + ModifierData* md; + for (md = (ModifierData*)ob->modifiers.first; md; md = (ModifierData*)md->next) { + if (modifier_dependsOnTime(md)) + continue; + if (!(md->mode & eModifierMode_Realtime)) + continue; + return true; + } + return false; +} + +bool BL_ModifierDeformer::Update(void) +{ + bool bShapeUpdate = BL_ShapeDeformer::Update(); + + if (bShapeUpdate || m_lastModifierUpdate != m_gameobj->GetLastFrame()) { + // static derived mesh are not updated + if (m_dm == NULL || m_bDynamic) { + /* execute the modifiers */ + Object* blendobj = m_gameobj->GetBlendObject(); + /* hack: the modifiers require that the mesh is attached to the object + It may not be the case here because of replace mesh actuator */ + Mesh *oldmesh = (Mesh*)blendobj->data; + blendobj->data = m_bmesh; + /* execute the modifiers */ + DerivedMesh *dm = mesh_create_derived_no_virtual(m_scene, blendobj, m_transverts, CD_MASK_MESH); + /* restore object data */ + blendobj->data = oldmesh; + /* free the current derived mesh and replace, (dm should never be NULL) */ + if (m_dm != NULL) { + // HACK! use deformedOnly as a user counter + if (--m_dm->deformedOnly == 0) { + m_dm->needsFree = 1; + m_dm->release(m_dm); + } + } + m_dm = dm; + // get rid of temporary data + m_dm->needsFree = 0; + m_dm->release(m_dm); + // HACK! use deformedOnly as a user counter + m_dm->deformedOnly = 1; + /* update the graphic controller */ + PHY_IGraphicController *ctrl = m_gameobj->GetGraphicController(); + if (ctrl) { + float min_r[3], max_r[3]; + INIT_MINMAX(min_r, max_r); + m_dm->getMinMax(m_dm, min_r, max_r); + ctrl->setLocalAabb(min_r, max_r); + } + } + m_lastModifierUpdate=m_gameobj->GetLastFrame(); + bShapeUpdate = true; + } + return bShapeUpdate; +} + +bool BL_ModifierDeformer::Apply(RAS_IPolyMaterial *mat) +{ + if (!Update()) + return false; + + // drawing is based on derived mesh, must set it in the mesh slots + int nmat = m_pMeshObject->NumMaterials(); + for (int imat=0; imatGetMeshMaterial(imat); + RAS_MeshSlot **slot = mmat->m_slots[(void*)m_gameobj]; + if(!slot || !*slot) + continue; + (*slot)->m_pDerivedMesh = m_dm; + } + return true; +} diff --git a/source/gameengine/Converter/BL_ModifierDeformer.h b/source/gameengine/Converter/BL_ModifierDeformer.h new file mode 100644 index 00000000000..74de54152eb --- /dev/null +++ b/source/gameengine/Converter/BL_ModifierDeformer.h @@ -0,0 +1,107 @@ +/** + * $Id: BL_ModifierDeformer.h 20741 2009-06-08 20:08:19Z blendix $ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef BL_MODIFIERDEFORMER +#define BL_MODIFIERDEFORMER + +#ifdef WIN32 +#pragma warning (disable:4786) // get rid of stupid stl-visual compiler debug warning +#endif //WIN32 + +#include "BL_ShapeDeformer.h" +#include "BL_DeformableGameObject.h" +#include + +struct DerivedMesh; +struct Object; + +class BL_ModifierDeformer : public BL_ShapeDeformer +{ +public: + static bool HasCompatibleDeformer(Object *ob); + + + BL_ModifierDeformer(BL_DeformableGameObject *gameobj, + Scene *scene, + Object *bmeshobj, + BL_SkinMeshObject *mesh) + : + BL_ShapeDeformer(gameobj,bmeshobj, mesh), + m_lastModifierUpdate(-1), + m_scene(scene), + m_dm(NULL) + { + m_recalcNormal = false; + }; + + /* this second constructor is needed for making a mesh deformable on the fly. */ + BL_ModifierDeformer(BL_DeformableGameObject *gameobj, + struct Scene *scene, + struct Object *bmeshobj_old, + struct Object *bmeshobj_new, + class BL_SkinMeshObject *mesh, + bool release_object, + BL_ArmatureObject* arma = NULL) + : + BL_ShapeDeformer(gameobj, bmeshobj_old, bmeshobj_new, mesh, release_object, false, arma), + m_lastModifierUpdate(-1), + m_scene(scene), + m_dm(NULL) + { + }; + + virtual void ProcessReplica(); + virtual RAS_Deformer *GetReplica(); + virtual ~BL_ModifierDeformer(); + virtual bool UseVertexArray() + { + return false; + } + + bool Update (void); + bool Apply(RAS_IPolyMaterial *mat); + void ForceUpdate() + { + m_lastModifierUpdate = -1.0; + }; + virtual struct DerivedMesh* GetFinalMesh() + { + return m_dm; + } + + +protected: + double m_lastModifierUpdate; + Scene *m_scene; + DerivedMesh *m_dm; + +}; + +#endif + diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp new file mode 100644 index 00000000000..cc8021fc2e4 --- /dev/null +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -0,0 +1,382 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: none of this file. + * + * Contributor(s): Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + * Readonly sequence wrapper for lookups on logic bricks + */ + + +#include "KX_PythonSeq.h" +#include "KX_GameObject.h" +#include "SCA_ISensor.h" +#include "SCA_IController.h" +#include "SCA_IActuator.h" + + +PyObject *KX_PythonSeq_CreatePyObject( PyObject *base, short type ) +{ + KX_PythonSeq *seq = PyObject_NEW( KX_PythonSeq, &KX_PythonSeq_Type); + seq->base = base; + Py_INCREF(base); /* so we can always access to check if its valid */ + seq->type = type; + seq->iter = -1; /* init */ + return (PyObject *)seq; + } + + static void KX_PythonSeq_dealloc( KX_PythonSeq * self ) +{ + Py_DECREF(self->base); + PyObject_DEL( self ); +} + +static Py_ssize_t KX_PythonSeq_len( PyObject * self ) +{ + PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); + + if(self_plus==NULL) { + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + return -1; + } + + switch(((KX_PythonSeq *)self)->type) { + case KX_PYGENSEQ_CONT_TYPE_SENSORS: + return ((SCA_IController *)self_plus)->GetLinkedSensors().size(); + case KX_PYGENSEQ_CONT_TYPE_ACTUATORS: + return ((SCA_IController *)self_plus)->GetLinkedActuators().size(); + case KX_PYGENSEQ_OB_TYPE_SENSORS: + return ((KX_GameObject *)self_plus)->GetSensors().size(); + case KX_PYGENSEQ_OB_TYPE_CONTROLLERS: + return ((KX_GameObject *)self_plus)->GetControllers().size(); + case KX_PYGENSEQ_OB_TYPE_ACTUATORS: + return ((KX_GameObject *)self_plus)->GetActuators().size(); + default: + /* Should never happen */ + PyErr_SetString(PyExc_SystemError, "invalid type, internal error"); + return -1; + } +} + +static PyObject *KX_PythonSeq_getIndex(PyObject* self, int index) +{ + PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); + + if(self_plus==NULL) { + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + return NULL; + } + + switch(((KX_PythonSeq *)self)->type) { + case KX_PYGENSEQ_CONT_TYPE_SENSORS: + { + vector& linkedsensors = ((SCA_IController *)self_plus)->GetLinkedSensors(); + if(index<0) index += linkedsensors.size(); + if(index<0 || index>= linkedsensors.size()) { + PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); + return NULL; + } + return linkedsensors[index]->GetProxy(); + } + case KX_PYGENSEQ_CONT_TYPE_ACTUATORS: + { + vector& linkedactuators = ((SCA_IController *)self_plus)->GetLinkedActuators(); + if(index<0) index += linkedactuators.size(); + if(index<0 || index>= linkedactuators.size()) { + PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); + return NULL; + } + return linkedactuators[index]->GetProxy(); + } + case KX_PYGENSEQ_OB_TYPE_SENSORS: + { + SCA_SensorList& linkedsensors= ((KX_GameObject *)self_plus)->GetSensors(); + if(index<0) index += linkedsensors.size(); + if(index<0 || index>= linkedsensors.size()) { + PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); + return NULL; + } + return linkedsensors[index]->GetProxy(); + } + case KX_PYGENSEQ_OB_TYPE_CONTROLLERS: + { + SCA_ControllerList& linkedcontrollers= ((KX_GameObject *)self_plus)->GetControllers(); + if(index<0) index += linkedcontrollers.size(); + if(index<0 || index>= linkedcontrollers.size()) { + PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); + return NULL; + } + return linkedcontrollers[index]->GetProxy(); + } + case KX_PYGENSEQ_OB_TYPE_ACTUATORS: + { + SCA_ActuatorList& linkedactuators= ((KX_GameObject *)self_plus)->GetActuators(); + if(index<0) index += linkedactuators.size(); + if(index<0 || index>= linkedactuators.size()) { + PyErr_SetString(PyExc_IndexError, "seq[i]: index out of range"); + return NULL; + } + return linkedactuators[index]->GetProxy(); + } + } + + PyErr_SetString(PyExc_SystemError, "invalid sequence type, this is a bug"); + return NULL; +} + + +static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) +{ + PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); + char *name = NULL; + + if(self_plus==NULL) { + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + return NULL; + } + + if (PyInt_Check(key)) { + return KX_PythonSeq_getIndex(self, PyInt_AS_LONG( key )); + } else if ( PyString_Check(key) ) { + name = PyString_AsString( key ); + } else { + PyErr_SetString( PyExc_TypeError, "expected a string or an index" ); + return NULL; + } + + switch(((KX_PythonSeq *)self)->type) { + case KX_PYGENSEQ_CONT_TYPE_SENSORS: + { + vector& linkedsensors = ((SCA_IController *)self_plus)->GetLinkedSensors(); + SCA_ISensor* sensor; + for (unsigned int index=0;indexGetName() == name) + return sensor->GetProxy(); + } + break; + } + case KX_PYGENSEQ_CONT_TYPE_ACTUATORS: + { + vector& linkedactuators = ((SCA_IController *)self_plus)->GetLinkedActuators(); + SCA_IActuator* actuator; + for (unsigned int index=0;indexGetName() == name) + return actuator->GetProxy(); + } + break; + } + case KX_PYGENSEQ_OB_TYPE_SENSORS: + { + SCA_SensorList& linkedsensors= ((KX_GameObject *)self_plus)->GetSensors(); + SCA_ISensor *sensor; + for (unsigned int index=0;indexGetName() == name) + return sensor->GetProxy(); + } + break; + } + case KX_PYGENSEQ_OB_TYPE_CONTROLLERS: + { + SCA_ControllerList& linkedcontrollers= ((KX_GameObject *)self_plus)->GetControllers(); + SCA_IController *controller; + for (unsigned int index=0;indexGetName() == name) + return controller->GetProxy(); + } + break; + } + case KX_PYGENSEQ_OB_TYPE_ACTUATORS: + { + SCA_ActuatorList& linkedactuators= ((KX_GameObject *)self_plus)->GetActuators(); + SCA_IActuator *actuator; + for (unsigned int index=0;indexGetName() == name) + return actuator->GetProxy(); + } + break; + } + } + + PyErr_Format( PyExc_KeyError, "requested item \"%s\" does not exist", name); + return NULL; +} + +static PyMappingMethods KX_PythonSeq_as_mapping = { + KX_PythonSeq_len, /* mp_length */ + KX_PythonSeq_subscript, /* mp_subscript */ + 0, /* mp_ass_subscript */ +}; + + +/* + * Initialize the interator index + */ + +static PyObject *KX_PythonSeq_getIter(KX_PythonSeq *self) +{ + if(BGE_PROXY_REF(self->base)==NULL) { + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + return NULL; + } + + /* create a new iterator if were alredy using this one */ + if (self->iter == -1) { + self->iter = 0; + Py_INCREF(self); + return (PyObject *)self; + } else { + return KX_PythonSeq_CreatePyObject(self->base, self->type); + } + } + + +/* + * Return next KX_PythonSeq iter. + */ + +static PyObject *KX_PythonSeq_nextIter(KX_PythonSeq *self) +{ + PyObject *object = KX_PythonSeq_getIndex((PyObject *)self, self->iter); + + self->iter++; + if( object==NULL ) { + self->iter= -1; /* for reuse */ + PyErr_SetString(PyExc_StopIteration, "iterator at end"); + } + return object; /* can be NULL for end of iterator */ +} + + +static int KX_PythonSeq_compare( KX_PythonSeq * a, KX_PythonSeq * b ) /* TODO - python3.x wants richcmp */ +{ + return ( a->type == b->type && a->base == b->base) ? 0 : -1; +} + +/* + * repr function + * convert to a list and get its string value + */ +static PyObject *KX_PythonSeq_repr( KX_PythonSeq * self ) +{ + PyObject *list = PySequence_List((PyObject *)self); + PyObject *repr = PyObject_Repr(list); + Py_DECREF(list); + return repr; +} + + +/*****************************************************************************/ +/* Python KX_PythonSeq_Type structure definition: */ +/*****************************************************************************/ +PyTypeObject KX_PythonSeq_Type = { +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif + /* For printing, in format "." */ + "KX_PythonSeq", /* char *tp_name; */ + sizeof( KX_PythonSeq ), /* int tp_basicsize; */ + 0, /* tp_itemsize; For allocation */ + + /* Methods to implement standard operations */ + + ( destructor ) KX_PythonSeq_dealloc, /* destructor tp_dealloc; */ + NULL, /* printfunc tp_print; */ + NULL, /* getattrfunc tp_getattr; */ + NULL, /* setattrfunc tp_setattr; */ + ( cmpfunc ) KX_PythonSeq_compare, /* cmpfunc tp_compare; */ + ( reprfunc ) KX_PythonSeq_repr, /* reprfunc tp_repr; */ + + /* Method suites for standard classes */ + + NULL, /* PyNumberMethods *tp_as_number; */ + NULL, /* PySequenceMethods *tp_as_sequence; */ + &KX_PythonSeq_as_mapping, /* PyMappingMethods *tp_as_mapping; */ + + /* More standard operations (here for binary compatibility) */ + + NULL, /* hashfunc tp_hash; */ + NULL, /* ternaryfunc tp_call; */ + NULL, /* reprfunc tp_str; */ + NULL, /* getattrofunc tp_getattro; */ + NULL, /* setattrofunc tp_setattro; */ + + /* Functions to access object as input/output buffer */ + NULL, /* PyBufferProcs *tp_as_buffer; */ + + /*** Flags to define presence of optional/expanded features ***/ + Py_TPFLAGS_DEFAULT, /* long tp_flags; */ + + NULL, /* char *tp_doc; Documentation string */ + /*** Assigned meaning in release 2.0 ***/ + /* call function for all accessible objects */ + NULL, /* traverseproc tp_traverse; */ + + /* delete references to contained objects */ + NULL, /* inquiry tp_clear; */ + + /*** Assigned meaning in release 2.1 ***/ + /*** rich comparisons ***/ + NULL, /* richcmpfunc tp_richcompare; */ + + /*** weak reference enabler ***/ + 0, /* long tp_weaklistoffset; */ + + /*** Added in release 2.2 ***/ + /* Iterators */ + ( getiterfunc) KX_PythonSeq_getIter, /* getiterfunc tp_iter; */ + ( iternextfunc ) KX_PythonSeq_nextIter, /* iternextfunc tp_iternext; */ + + /*** Attribute descriptor and subclassing stuff ***/ + NULL, /* struct PyMethodDef *tp_methods; */ + NULL, /* struct PyMemberDef *tp_members; */ + NULL, /* struct PyGetSetDef *tp_getset; */ + NULL, /* struct _typeobject *tp_base; */ + NULL, /* PyObject *tp_dict; */ + NULL, /* descrgetfunc tp_descr_get; */ + NULL, /* descrsetfunc tp_descr_set; */ + 0, /* long tp_dictoffset; */ + NULL, /* initproc tp_init; */ + NULL, /* allocfunc tp_alloc; */ + NULL, /* newfunc tp_new; */ + /* Low-level free-memory routine */ + NULL, /* freefunc tp_free; */ + /* For PyObject_IS_GC */ + NULL, /* inquiry tp_is_gc; */ + NULL, /* PyObject *tp_bases; */ + /* method resolution order */ + NULL, /* PyObject *tp_mro; */ + NULL, /* PyObject *tp_cache; */ + NULL, /* PyObject *tp_subclasses; */ + NULL, /* PyObject *tp_weaklist; */ + NULL +}; diff --git a/source/gameengine/Ketsji/KX_PythonSeq.h b/source/gameengine/Ketsji/KX_PythonSeq.h new file mode 100644 index 00000000000..15a016224a9 --- /dev/null +++ b/source/gameengine/Ketsji/KX_PythonSeq.h @@ -0,0 +1,60 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + * Readonly sequence wrapper for lookups on logic bricks + */ + +#ifndef _adr_py_seq_h_ // only process once, +#define _adr_py_seq_h_ // even if multiply included + +#include "PyObjectPlus.h" + +// ------------------------- +enum KX_PYGENSEQ_TYPE { + KX_PYGENSEQ_CONT_TYPE_SENSORS, + KX_PYGENSEQ_CONT_TYPE_ACTUATORS, + KX_PYGENSEQ_OB_TYPE_SENSORS, + KX_PYGENSEQ_OB_TYPE_CONTROLLERS, + KX_PYGENSEQ_OB_TYPE_ACTUATORS +}; + +/* The Main PyType Object defined in Main.c */ +extern PyTypeObject KX_PythonSeq_Type; + +#define BPy_KX_PythonSeq_Check(v) \ + ((v)->ob_type == &KX_PythonSeq_Type) + +typedef struct { + PyObject_VAR_HEAD + PyObject *base; + short type; + short iter; +} KX_PythonSeq; + +PyObject *KX_PythonSeq_CreatePyObject(PyObject *base, short type); + +#endif // _adr_py_seq_h_ diff --git a/source/gameengine/PyDoc/API_intro.py b/source/gameengine/PyDoc/API_intro.py new file mode 100644 index 00000000000..ad37e34fbac --- /dev/null +++ b/source/gameengine/PyDoc/API_intro.py @@ -0,0 +1,103 @@ +# This is not a real module, it's simply an introductory text. + +""" +The Blender Game Engine Python API Reference +============================================ + + See U{release notes} for updates, changes and new functionality in the Game Engine Python API. + + Top Module: + ----------- + + - L{GameLogic} + - L{GameKeys} + - L{GameTypes} + - L{Mathutils} + - L{Geometry} + - L{BGL} + + Undocumented modules: + --------------------- + - VideoTexture + - CValue + - Expression + - PhysicsConstraints + + +Introduction: +============= + + This reference documents the Blender Python API, a growing collection of + Python modules (libraries) that give access to part of the program's internal + data and functions. + + Through scripting Blender can be extended in real-time via + U{Python }, an impressive high level, multi-paradigm, open + source language. Newcomers are recommended to start with the tutorial that + comes with it. + + This opens many interesting possibilities not available with logic bricks. + + Game Engine API Stability: + -------------------------- + + When writing python scripts there are a number of situations you should avoid to prevent crashes or unstable behavior. + While the API tries to prevent problems there are some situations where error checking would be too time consuming. + + Known cases: + - Memory Limits. + + There is nothing stopping you from filling a list or making a string so big that that causes blender to run out of memory, in this case python should rasie a MemoryError, but its likely blender will crash before this point. + + - Accessing any data that has been freed. + + For instance accessing a KX_GameObject after its End Object actuator runs. + This will cause a SystemError, however for L{KX_MeshProxy}, L{KX_VertexProxy} and L{KX_VertexProxy} it will crash the blender game engine. + + See: L{GameTypes.PyObjectPlus.invalid} which many types inherit. + + - Mixing L{KX_GameObject} between scenes. + + For instance tracking/parenting an L{KX_GameObject} object to an object from other scene. + + External Modules: + ----------------- + + Since 2.49 support for importing modules has been added. + + This allows you to import any blender textblock with a .py extension. + + External python scripts may be imported as modules when the script is in the same directory as the blend file. + + The current blend files path is included in the sys.path for loading modules. + All linked libraries will also be included so you can be sure when linking in assets from another blend file the scripts will load too. + + A note to newbie script writers: + -------------------------------- + + Interpreted languages are known to be much slower than compiled code, but for + many applications the difference is negligible or acceptable. Also, with + profiling (or even simple direct timing with L{Blender.sys.time}) to + identify slow areas and well thought optimizations, the speed can be + I{considerably} improved in many cases. Try some of the best BPython scripts + to get an idea of what can be done, you may be surprised. + +@author: The Blender Python Team +@requires: Blender 2.49 or newer. +@version: 2.49 +@see: U{www.blender.org}: documentation and forum +@see: U{blenderartists.org}: user forum +@see: U{projects.blender.org} +@see: U{www.python.org} +@see: U{www.python.org/doc} +@see: U{Blending into Python}: User contributed documentation, featuring a blender/python cookbook with many examples. + +@note: the official version of this reference guide is only updated for each + new Blender release. But you can build the current SVN + version yourself: install epydoc, grab all files in the + source/gameengine/PyDoc/ folder of Blender's SVN and use the + epy_docgen.sh script also found there to generate the html docs. + Naturally you will also need a recent Blender binary to try the new + features. If you prefer not to compile it yourself, there is a testing + builds forum at U{blender.org}. +""" diff --git a/source/gameengine/SceneGraph/SG_DList.h b/source/gameengine/SceneGraph/SG_DList.h new file mode 100644 index 00000000000..eea19a85c7a --- /dev/null +++ b/source/gameengine/SceneGraph/SG_DList.h @@ -0,0 +1,161 @@ +/** + * $Id: SG_DList.h 20741 2009-06-08 20:08:19Z blendix $ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ +#ifndef __SG_DLIST +#define __SG_DLIST + +#include + +/** + * Double circular linked list + */ +class SG_DList +{ +protected : + SG_DList* m_flink; + SG_DList* m_blink; + +public: + template class iterator + { + private: + SG_DList& m_head; + T* m_current; + public: + typedef iterator _myT; + iterator(SG_DList& head) : m_head(head), m_current(NULL) {} + ~iterator() {} + + void begin() + { + m_current = (T*)m_head.Peek(); + } + void back() + { + m_current = (T*)m_head.Back(); + } + bool end() + { + return (m_current == (T*)m_head.Self()); + } + bool add_back(T* item) + { + return m_current->AddBack(item); + } + T* operator*() + { + return m_current; + } + _myT& operator++() + { + // no check of NULL! make sure you don't try to increment beyond end + m_current = (T*)m_current->Peek(); + return *this; + } + _myT& operator--() + { + // no check of NULL! make sure you don't try to increment beyond end + m_current = (T*)m_current->Back(); + return *this; + } + }; + + SG_DList() + { + m_flink = m_blink = this; + } + SG_DList(const SG_DList& other) + { + m_flink = m_blink = this; + } + virtual ~SG_DList() + { + Delink(); + } + + inline bool Empty() // Check for empty queue + { + return ( m_flink == this ); + } + bool AddBack( SG_DList *item ) // Add to the back + { + if (!item->Empty()) + return false; + item->m_blink = m_blink; + item->m_flink = this; + m_blink->m_flink = item; + m_blink = item; + return true; + } + bool AddFront( SG_DList *item ) // Add to the back + { + if (!item->Empty()) + return false; + item->m_flink = m_flink; + item->m_blink = this; + m_flink->m_blink = item; + m_flink = item; + return true; + } + SG_DList *Remove() // Remove from the front + { + if (Empty()) + { + return NULL; + } + SG_DList* item = m_flink; + m_flink = item->m_flink; + m_flink->m_blink = this; + item->m_flink = item->m_blink = item; + return item; + } + bool Delink() // Remove from the middle + { + if (Empty()) + return false; + m_blink->m_flink = m_flink; + m_flink->m_blink = m_blink; + m_flink = m_blink = this; + return true; + } + inline SG_DList *Peek() // Look at front without removing + { + return m_flink; + } + inline SG_DList *Back() // Look at front without removing + { + return m_blink; + } + inline SG_DList *Self() + { + return this; + } +}; + +#endif //__SG_DLIST + diff --git a/source/gameengine/SceneGraph/SG_QList.h b/source/gameengine/SceneGraph/SG_QList.h new file mode 100644 index 00000000000..6656f5a45c8 --- /dev/null +++ b/source/gameengine/SceneGraph/SG_QList.h @@ -0,0 +1,157 @@ +/** + * $Id: SG_QList.h 20741 2009-06-08 20:08:19Z blendix $ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ +#ifndef __SG_QLIST +#define __SG_QLIST + +#include "SG_DList.h" + +/** + * Double-Double circular linked list + * For storing an object is two lists simultaneously + */ +class SG_QList : public SG_DList +{ +protected : + SG_QList* m_fqlink; + SG_QList* m_bqlink; + +public: + template class iterator + { + private: + SG_QList& m_head; + T* m_current; + public: + typedef iterator _myT; + iterator(SG_QList& head, SG_QList* current=NULL) : m_head(head) { m_current = (T*)current; } + ~iterator() {} + + void begin() + { + m_current = (T*)m_head.QPeek(); + } + void back() + { + m_current = (T*)m_head.QBack(); + } + bool end() + { + return (m_current == (T*)m_head.Self()); + } + bool add_back(T* item) + { + return m_current->QAddBack(item); + } + T* operator*() + { + return m_current; + } + _myT& operator++() + { + m_current = (T*)m_current->QPeek(); + return *this; + } + _myT& operator--() + { + // no check on NULL! make sure you don't try to increment beyond end + m_current = (T*)m_current->QBack(); + return *this; + } + }; + + SG_QList() : SG_DList() + { + m_fqlink = m_bqlink = this; + } + SG_QList(const SG_QList& other) : SG_DList() + { + m_fqlink = m_bqlink = this; + } + virtual ~SG_QList() + { + QDelink(); + } + + inline bool QEmpty() // Check for empty queue + { + return ( m_fqlink == this ); + } + bool QAddBack( SG_QList *item ) // Add to the back + { + if (!item->QEmpty()) + return false; + item->m_bqlink = m_bqlink; + item->m_fqlink = this; + m_bqlink->m_fqlink = item; + m_bqlink = item; + return true; + } + bool QAddFront( SG_QList *item ) // Add to the back + { + if (!item->Empty()) + return false; + item->m_fqlink = m_fqlink; + item->m_bqlink = this; + m_fqlink->m_bqlink = item; + m_fqlink = item; + return true; + } + SG_QList *QRemove() // Remove from the front + { + if (QEmpty()) + { + return NULL; + } + SG_QList* item = m_fqlink; + m_fqlink = item->m_fqlink; + m_fqlink->m_bqlink = this; + item->m_fqlink = item->m_bqlink = item; + return item; + } + bool QDelink() // Remove from the middle + { + if (QEmpty()) + return false; + m_bqlink->m_fqlink = m_fqlink; + m_fqlink->m_bqlink = m_bqlink; + m_fqlink = m_bqlink = this; + return true; + } + inline SG_QList *QPeek() // Look at front without removing + { + return m_fqlink; + } + inline SG_QList *QBack() // Look at front without removing + { + return m_bqlink; + } +}; + +#endif //__SG_QLIST + -- cgit v1.2.3 From b1a106dd49a8653977cdfd722b1d30abf827fa28 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 2 Jul 2009 03:32:57 +0000 Subject: NLA SoC: Merge from 2.5 21210 to 21300 Note to self: the next merge will be messy again, since 2 commits occurred this one was complete --- source/blender/blenkernel/BKE_packedFile.h | 54 +- source/blender/blenkernel/BKE_particle.h | 4 +- source/blender/blenkernel/BKE_report.h | 5 +- source/blender/blenkernel/intern/cdderivedmesh.c | 2 +- source/blender/blenkernel/intern/context.c | 3 + source/blender/blenkernel/intern/displist.c | 36 +- source/blender/blenkernel/intern/font.c | 8 +- source/blender/blenkernel/intern/image.c | 6 +- source/blender/blenkernel/intern/packedFile.c | 227 ++-- source/blender/blenkernel/intern/particle.c | 6 +- source/blender/blenkernel/intern/report.c | 4 +- source/blender/blenlib/BLI_util.h | 1 + source/blender/blenlib/intern/storage.c | 42 +- source/blender/blenlib/intern/util.c | 19 + source/blender/blenloader/intern/readfile.c | 21 +- source/blender/editors/include/ED_fileselect.h | 32 +- source/blender/editors/include/ED_mesh.h | 4 +- source/blender/editors/include/UI_interface.h | 6 +- source/blender/editors/interface/interface.c | 10 +- .../blender/editors/interface/interface_handlers.c | 41 +- source/blender/editors/interface/interface_icons.c | 17 +- .../blender/editors/interface/interface_layout.c | 2 +- source/blender/editors/interface/interface_panel.c | 4 + .../blender/editors/interface/interface_regions.c | 55 +- .../editors/interface/interface_templates.c | 313 +++-- source/blender/editors/interface/interface_utils.c | 2 +- .../blender/editors/interface/interface_widgets.c | 4 +- source/blender/editors/mesh/editdeform.c | 1110 ---------------- source/blender/editors/mesh/mesh_intern.h | 9 + source/blender/editors/mesh/mesh_layers.c | 424 ++++++ source/blender/editors/mesh/mesh_ops.c | 6 + source/blender/editors/object/editkey.c | 144 ++- source/blender/editors/object/object_intern.h | 14 + source/blender/editors/object/object_ops.c | 12 + source/blender/editors/object/object_vgroup.c | 1344 ++++++++++++++++++++ source/blender/editors/screen/screen_ops.c | 5 +- source/blender/editors/sculpt_paint/sculpt.c | 144 ++- .../blender/editors/space_buttons/buttons_intern.h | 4 +- source/blender/editors/space_buttons/buttons_ops.c | 20 +- .../blender/editors/space_buttons/space_buttons.c | 5 +- source/blender/editors/space_file/file_draw.c | 128 -- source/blender/editors/space_file/file_intern.h | 12 +- source/blender/editors/space_file/file_ops.c | 210 +-- source/blender/editors/space_file/file_panels.c | 165 +++ source/blender/editors/space_file/filelist.c | 8 +- source/blender/editors/space_file/filelist.h | 1 - source/blender/editors/space_file/filesel.c | 2 +- source/blender/editors/space_file/fsmenu.c | 39 +- source/blender/editors/space_file/fsmenu.h | 13 +- source/blender/editors/space_file/space_file.c | 126 +- source/blender/editors/space_image/image_buttons.c | 4 +- source/blender/editors/space_image/image_ops.c | 95 +- source/blender/editors/space_info/info_header.c | 507 -------- source/blender/editors/space_info/info_intern.h | 7 + source/blender/editors/space_info/info_ops.c | 397 ++++++ source/blender/editors/space_info/space_info.c | 28 +- .../blender/editors/space_view3d/view3d_header.c | 1 + .../blender/editors/space_view3d/view3d_toolbar.c | 2 +- source/blender/editors/space_view3d/view3d_view.c | 3 + source/blender/makesdna/DNA_brush_types.h | 1 + source/blender/makesdna/DNA_scene_types.h | 6 +- source/blender/makesdna/DNA_screen_types.h | 4 + source/blender/makesdna/DNA_space_types.h | 48 +- source/blender/makesdna/DNA_windowmanager_types.h | 3 +- source/blender/makesrna/RNA_access.h | 10 + source/blender/makesrna/RNA_types.h | 19 +- source/blender/makesrna/intern/makesrna.c | 89 +- source/blender/makesrna/intern/rna_access.c | 377 +++++- source/blender/makesrna/intern/rna_brush.c | 4 + source/blender/makesrna/intern/rna_constraint.c | 4 +- source/blender/makesrna/intern/rna_context.c | 20 +- source/blender/makesrna/intern/rna_define.c | 13 +- source/blender/makesrna/intern/rna_image.c | 19 + source/blender/makesrna/intern/rna_internal.h | 1 + .../blender/makesrna/intern/rna_internal_types.h | 4 + source/blender/makesrna/intern/rna_mesh.c | 235 +++- source/blender/makesrna/intern/rna_mesh_api.c | 217 +++- source/blender/makesrna/intern/rna_object.c | 103 +- source/blender/makesrna/intern/rna_rna.c | 18 +- source/blender/makesrna/intern/rna_scene.c | 5 + source/blender/makesrna/intern/rna_screen.c | 28 + source/blender/makesrna/intern/rna_space.c | 123 +- source/blender/makesrna/intern/rna_ui.c | 16 +- source/blender/makesrna/intern/rna_ui_api.c | 7 + source/blender/makesrna/intern/rna_wm.c | 46 + source/blender/python/generic/BGL.c | 9 +- source/blender/python/generic/Geometry.c | 12 +- source/blender/python/generic/Mathutils.c | 36 +- source/blender/python/generic/euler.c | 84 +- source/blender/python/generic/euler.h | 5 +- source/blender/python/generic/matrix.c | 216 +++- source/blender/python/generic/matrix.h | 5 +- source/blender/python/generic/quat.c | 110 +- source/blender/python/generic/quat.h | 5 +- source/blender/python/generic/vector.c | 888 +++++++------ source/blender/python/generic/vector.h | 5 +- source/blender/python/intern/bpy_operator_wrap.c | 3 +- source/blender/python/intern/bpy_rna.c | 540 ++++++-- source/blender/windowmanager/WM_api.h | 2 +- source/blender/windowmanager/WM_types.h | 5 + .../blender/windowmanager/intern/wm_event_system.c | 14 +- source/blender/windowmanager/intern/wm_files.c | 2 +- source/blender/windowmanager/intern/wm_keymap.c | 2 +- source/blender/windowmanager/intern/wm_operators.c | 2 +- source/creator/CMakeLists.txt | 5 +- source/gameengine/BlenderRoutines/Makefile | 1 + source/gameengine/Converter/BL_ActionActuator.cpp | 43 +- source/gameengine/Converter/BL_ActionActuator.h | 9 +- .../Converter/BL_ShapeActionActuator.cpp | 40 +- .../gameengine/Converter/BL_ShapeActionActuator.h | 9 +- source/gameengine/Expressions/BoolValue.cpp | 3 +- source/gameengine/Expressions/IntValue.cpp | 2 +- source/gameengine/Expressions/ListValue.cpp | 59 +- source/gameengine/Expressions/ListValue.h | 4 +- source/gameengine/Expressions/PyObjectPlus.cpp | 333 ++--- source/gameengine/Expressions/PyObjectPlus.h | 95 +- source/gameengine/Expressions/StringValue.h | 2 +- source/gameengine/Expressions/Value.cpp | 124 +- source/gameengine/Expressions/Value.h | 16 +- .../gameengine/GameLogic/SCA_2DFilterActuator.cpp | 42 +- source/gameengine/GameLogic/SCA_2DFilterActuator.h | 13 +- source/gameengine/GameLogic/SCA_ANDController.cpp | 31 +- source/gameengine/GameLogic/SCA_ANDController.h | 10 +- source/gameengine/GameLogic/SCA_ActuatorSensor.cpp | 37 +- source/gameengine/GameLogic/SCA_ActuatorSensor.h | 7 +- source/gameengine/GameLogic/SCA_AlwaysSensor.cpp | 31 +- source/gameengine/GameLogic/SCA_AlwaysSensor.h | 12 +- source/gameengine/GameLogic/SCA_DelaySensor.cpp | 40 +- source/gameengine/GameLogic/SCA_DelaySensor.h | 7 +- .../GameLogic/SCA_ExpressionController.cpp | 5 +- .../GameLogic/SCA_ExpressionController.h | 11 +- source/gameengine/GameLogic/SCA_IActuator.cpp | 5 +- source/gameengine/GameLogic/SCA_IActuator.h | 3 +- source/gameengine/GameLogic/SCA_IController.cpp | 47 +- source/gameengine/GameLogic/SCA_IController.h | 6 +- source/gameengine/GameLogic/SCA_ILogicBrick.cpp | 44 +- source/gameengine/GameLogic/SCA_ILogicBrick.h | 6 +- source/gameengine/GameLogic/SCA_IObject.cpp | 81 +- source/gameengine/GameLogic/SCA_IObject.h | 7 +- source/gameengine/GameLogic/SCA_ISensor.cpp | 46 +- source/gameengine/GameLogic/SCA_ISensor.h | 7 +- source/gameengine/GameLogic/SCA_JoystickSensor.cpp | 73 +- source/gameengine/GameLogic/SCA_JoystickSensor.h | 7 +- source/gameengine/GameLogic/SCA_KeyboardSensor.cpp | 61 +- source/gameengine/GameLogic/SCA_KeyboardSensor.h | 7 +- source/gameengine/GameLogic/SCA_LogicManager.cpp | 1 + source/gameengine/GameLogic/SCA_MouseSensor.cpp | 47 +- source/gameengine/GameLogic/SCA_MouseSensor.h | 7 +- source/gameengine/GameLogic/SCA_NANDController.cpp | 31 +- source/gameengine/GameLogic/SCA_NANDController.h | 6 +- source/gameengine/GameLogic/SCA_NORController.cpp | 31 +- source/gameengine/GameLogic/SCA_NORController.h | 10 +- source/gameengine/GameLogic/SCA_ORController.cpp | 32 +- source/gameengine/GameLogic/SCA_ORController.h | 9 +- .../gameengine/GameLogic/SCA_PropertyActuator.cpp | 38 +- source/gameengine/GameLogic/SCA_PropertyActuator.h | 8 +- source/gameengine/GameLogic/SCA_PropertySensor.cpp | 42 +- source/gameengine/GameLogic/SCA_PropertySensor.h | 7 +- .../gameengine/GameLogic/SCA_PythonController.cpp | 63 +- source/gameengine/GameLogic/SCA_PythonController.h | 6 +- source/gameengine/GameLogic/SCA_RandomActuator.cpp | 48 +- source/gameengine/GameLogic/SCA_RandomActuator.h | 7 +- source/gameengine/GameLogic/SCA_RandomSensor.cpp | 46 +- source/gameengine/GameLogic/SCA_RandomSensor.h | 7 +- source/gameengine/GameLogic/SCA_XNORController.cpp | 31 +- source/gameengine/GameLogic/SCA_XNORController.h | 5 +- source/gameengine/GameLogic/SCA_XORController.cpp | 31 +- source/gameengine/GameLogic/SCA_XORController.h | 10 +- source/gameengine/Ketsji/BL_Shader.cpp | 43 +- source/gameengine/Ketsji/BL_Shader.h | 6 +- .../Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp | 37 +- .../Ketsji/KXNetwork/KX_NetworkMessageActuator.h | 7 +- .../Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp | 43 +- .../Ketsji/KXNetwork/KX_NetworkMessageSensor.h | 7 +- source/gameengine/Ketsji/KX_BlenderMaterial.cpp | 43 +- source/gameengine/Ketsji/KX_BlenderMaterial.h | 9 +- source/gameengine/Ketsji/KX_CDActuator.cpp | 47 +- source/gameengine/Ketsji/KX_CDActuator.h | 7 +- source/gameengine/Ketsji/KX_Camera.cpp | 65 +- source/gameengine/Ketsji/KX_Camera.h | 7 +- source/gameengine/Ketsji/KX_CameraActuator.cpp | 39 +- source/gameengine/Ketsji/KX_CameraActuator.h | 8 +- source/gameengine/Ketsji/KX_ConstraintActuator.cpp | 50 +- source/gameengine/Ketsji/KX_ConstraintActuator.h | 7 +- source/gameengine/Ketsji/KX_ConstraintWrapper.cpp | 42 +- source/gameengine/Ketsji/KX_ConstraintWrapper.h | 5 +- source/gameengine/Ketsji/KX_GameActuator.cpp | 45 +- source/gameengine/Ketsji/KX_GameActuator.h | 7 +- source/gameengine/Ketsji/KX_GameObject.cpp | 185 +-- source/gameengine/Ketsji/KX_GameObject.h | 17 +- source/gameengine/Ketsji/KX_IpoActuator.cpp | 37 +- source/gameengine/Ketsji/KX_IpoActuator.h | 7 +- source/gameengine/Ketsji/KX_Light.cpp | 56 +- source/gameengine/Ketsji/KX_Light.h | 6 +- source/gameengine/Ketsji/KX_MeshProxy.cpp | 55 +- source/gameengine/Ketsji/KX_MeshProxy.h | 3 - source/gameengine/Ketsji/KX_MouseFocusSensor.cpp | 33 +- source/gameengine/Ketsji/KX_MouseFocusSensor.h | 5 +- source/gameengine/Ketsji/KX_NearSensor.cpp | 46 +- source/gameengine/Ketsji/KX_NearSensor.h | 9 +- source/gameengine/Ketsji/KX_ObjectActuator.cpp | 43 +- source/gameengine/Ketsji/KX_ObjectActuator.h | 7 +- source/gameengine/Ketsji/KX_ParentActuator.cpp | 37 +- source/gameengine/Ketsji/KX_ParentActuator.h | 7 +- .../gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp | 49 +- source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h | 6 +- source/gameengine/Ketsji/KX_PolyProxy.cpp | 61 +- source/gameengine/Ketsji/KX_PolyProxy.h | 2 - source/gameengine/Ketsji/KX_PolygonMaterial.cpp | 44 +- source/gameengine/Ketsji/KX_PolygonMaterial.h | 7 +- .../gameengine/Ketsji/KX_PyConstraintBinding.cpp | 2 +- source/gameengine/Ketsji/KX_PyMath.cpp | 12 +- source/gameengine/Ketsji/KX_PyMath.h | 14 +- source/gameengine/Ketsji/KX_PythonInit.cpp | 38 +- source/gameengine/Ketsji/KX_PythonInitTypes.cpp | 205 ++- source/gameengine/Ketsji/KX_PythonSeq.cpp | 137 +- source/gameengine/Ketsji/KX_RadarSensor.cpp | 40 +- source/gameengine/Ketsji/KX_RadarSensor.h | 7 +- source/gameengine/Ketsji/KX_RaySensor.cpp | 39 +- source/gameengine/Ketsji/KX_RaySensor.h | 8 +- .../gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp | 45 +- .../gameengine/Ketsji/KX_SCA_AddObjectActuator.h | 7 +- .../gameengine/Ketsji/KX_SCA_DynamicActuator.cpp | 45 +- source/gameengine/Ketsji/KX_SCA_DynamicActuator.h | 8 +- .../gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp | 35 +- .../gameengine/Ketsji/KX_SCA_EndObjectActuator.h | 6 +- .../Ketsji/KX_SCA_ReplaceMeshActuator.cpp | 45 +- .../gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h | 9 +- source/gameengine/Ketsji/KX_Scene.cpp | 88 +- source/gameengine/Ketsji/KX_Scene.h | 10 +- source/gameengine/Ketsji/KX_SceneActuator.cpp | 50 +- source/gameengine/Ketsji/KX_SceneActuator.h | 7 +- source/gameengine/Ketsji/KX_SoundActuator.cpp | 53 +- source/gameengine/Ketsji/KX_SoundActuator.h | 7 +- source/gameengine/Ketsji/KX_StateActuator.cpp | 41 +- source/gameengine/Ketsji/KX_StateActuator.h | 9 +- source/gameengine/Ketsji/KX_TouchSensor.cpp | 44 +- source/gameengine/Ketsji/KX_TouchSensor.h | 7 +- source/gameengine/Ketsji/KX_TrackToActuator.cpp | 51 +- source/gameengine/Ketsji/KX_TrackToActuator.h | 5 +- source/gameengine/Ketsji/KX_VehicleWrapper.cpp | 44 +- source/gameengine/Ketsji/KX_VehicleWrapper.h | 5 +- source/gameengine/Ketsji/KX_VertexProxy.cpp | 96 +- source/gameengine/Ketsji/KX_VertexProxy.h | 3 - source/gameengine/Ketsji/KX_VisibilityActuator.cpp | 43 +- source/gameengine/Ketsji/KX_VisibilityActuator.h | 8 +- .../gameengine/VideoTexture/FilterBlueScreen.cpp | 20 +- source/gameengine/VideoTexture/FilterColor.cpp | 8 +- source/gameengine/VideoTexture/FilterNormal.cpp | 4 +- source/gameengine/VideoTexture/ImageRender.cpp | 16 +- source/gameengine/VideoTexture/ImageViewport.cpp | 16 +- source/gameengine/VideoTexture/VideoBase.cpp | 4 +- source/gameengine/VideoTexture/VideoFFmpeg.cpp | 4 +- source/gameengine/VideoTexture/blendVideoTex.cpp | 2 +- 254 files changed, 7348 insertions(+), 6441 deletions(-) delete mode 100644 source/blender/editors/mesh/editdeform.c create mode 100644 source/blender/editors/mesh/mesh_layers.c create mode 100644 source/blender/editors/object/object_vgroup.c create mode 100644 source/blender/editors/space_file/file_panels.c delete mode 100644 source/blender/editors/space_info/info_header.c create mode 100644 source/blender/editors/space_info/info_ops.c (limited to 'source') diff --git a/source/blender/blenkernel/BKE_packedFile.h b/source/blender/blenkernel/BKE_packedFile.h index 2d5acc51b7b..efd930d375a 100644 --- a/source/blender/blenkernel/BKE_packedFile.h +++ b/source/blender/blenkernel/BKE_packedFile.h @@ -31,31 +31,43 @@ #ifndef BKE_PACKEDFILE_H #define BKE_PACKEDFILE_H -#define RET_OK 0 -#define RET_ERROR 1 +#define RET_OK 0 +#define RET_ERROR 1 -struct PackedFile; -struct VFont; struct bSample; struct bSound; struct Image; +struct Main; +struct PackedFile; +struct ReportList; +struct VFont; + +/* pack */ +struct PackedFile *newPackedFile(struct ReportList *reports, char *filename); +struct PackedFile *newPackedFileMemory(void *mem, int memlen); + +void packAll(struct Main *bmain, struct ReportList *reports); + +/* unpack */ +char *unpackFile(struct ReportList *reports, char *abs_name, char *local_name, struct PackedFile *pf, int how); +int unpackVFont(struct ReportList *reports, struct VFont *vfont, int how); +int unpackSample(struct ReportList *reports, struct bSample *sample, int how); +int unpackImage(struct ReportList *reports, struct Image *ima, int how); +void unpackAll(struct Main *bmain, struct ReportList *reports, int how); + +int writePackedFile(struct ReportList *reports, char *filename, struct PackedFile *pf, int guimode); + +/* free */ +void freePackedFile(struct PackedFile *pf); + +/* info */ +int countPackedFiles(struct Main *bmain); +int checkPackedFile(char *filename, struct PackedFile *pf); + +/* read */ +int seekPackedFile(struct PackedFile *pf, int offset, int whence); +void rewindPackedFile(struct PackedFile *pf); +int readPackedFile(struct PackedFile *pf, void *data, int size); -struct PackedFile * newPackedFile(char * filename); -struct PackedFile * newPackedFileMemory(void *mem, int memlen); - -int seekPackedFile(struct PackedFile * pf, int offset, int whence); -void rewindPackedFile(struct PackedFile * pf); -int readPackedFile(struct PackedFile * pf, void * data, int size); -int countPackedFiles(void); -void freePackedFile(struct PackedFile * pf); -void packAll(void); -int writePackedFile(char * filename, struct PackedFile *pf, int guimode); -int checkPackedFile(char * filename, struct PackedFile * pf); -char * unpackFile(char * abs_name, char * local_name, struct PackedFile * pf, int how); -int unpackVFont(struct VFont * vfont, int how); -int unpackSample(struct bSample *sample, int how); -int unpackImage(struct Image * ima, int how); -void unpackAll(int how); - #endif diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index 4d9916b9557..73f0195d1d8 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -251,8 +251,8 @@ void copy_particle_key(struct ParticleKey *to, struct ParticleKey *from, int tim void psys_particle_on_emitter(struct ParticleSystemModifierData *psmd, int distr, int index, int index_dmcache, float *fuv, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor); struct ParticleSystemModifierData *psys_get_modifier(struct Object *ob, struct ParticleSystem *psys); -void object_add_particle_system_slot(struct Scene *scene, struct Object *ob); -void object_remove_particle_system_slot(struct Scene *scene, struct Object *ob); +void object_add_particle_system(struct Scene *scene, struct Object *ob); +void object_remove_particle_system(struct Scene *scene, struct Object *ob); struct ParticleSettings *psys_new_settings(char *name, struct Main *main); struct ParticleSettings *psys_copy_settings(struct ParticleSettings *part); void psys_flush_particle_settings(struct Scene *scene, struct ParticleSettings *part, int recalc); diff --git a/source/blender/blenkernel/BKE_report.h b/source/blender/blenkernel/BKE_report.h index 21221026b8b..1bb7152fbf3 100644 --- a/source/blender/blenkernel/BKE_report.h +++ b/source/blender/blenkernel/BKE_report.h @@ -34,7 +34,10 @@ extern "C" { #include "DNA_listBase.h" -/* Reporting Information and Errors */ +/* Reporting Information and Errors + * + * These functions also accept NULL in case no error reporting + * is needed. */ typedef enum ReportType { RPT_DEBUG = 0, diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 57ef920f75b..706eece108c 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -1220,7 +1220,7 @@ void CDDM_calc_edges(DerivedMesh *dm) BLI_edgehashIterator_free(ehi); /* free old CustomData and assign new one */ - CustomData_free(&dm->edgeData, dm->numVertData); + CustomData_free(&dm->edgeData, dm->numEdgeData); dm->edgeData = edgeData; dm->numEdgeData = numEdges; diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 90880e354ec..fbad585d9b7 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -358,6 +358,9 @@ static int ctx_data_collection_get(const bContext *C, const char *member, ListBa return 1; } + list->first= NULL; + list->last= NULL; + return 0; } diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 736165a8a98..cdf4b90cee1 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -315,13 +315,19 @@ static void init_fastshade_shadeinput(Render *re) static Render *fastshade_get_render(Scene *scene) { - Render *re= RE_GetRender("_Shade View_"); - if(re==NULL) { - re= RE_NewRender("_Shade View_"); - - RE_Database_Baking(re, scene, 0, 0); /* 0= no faces */ + /* XXX ugly global still, but we can't do preview while rendering */ + if(G.rendering==0) { + + Render *re= RE_GetRender("_Shade View_"); + if(re==NULL) { + re= RE_NewRender("_Shade View_"); + + RE_Database_Baking(re, scene, 0, 0); /* 0= no faces */ + } + return re; } - return re; + + return NULL; } /* called on file reading */ @@ -611,18 +617,20 @@ static void mesh_create_shadedColors(Render *re, Object *ob, int onlyForMesh, un void shadeMeshMCol(Scene *scene, Object *ob, Mesh *me) { + Render *re= fastshade_get_render(scene); int a; char *cp; unsigned int *mcol= (unsigned int*)me->mcol; - Render *re= fastshade_get_render(scene); - mesh_create_shadedColors(re, ob, 1, &mcol, NULL); - me->mcol= (MCol*)mcol; + if(re) { + mesh_create_shadedColors(re, ob, 1, &mcol, NULL); + me->mcol= (MCol*)mcol; - /* swap bytes */ - for(cp= (char *)me->mcol, a= 4*me->totface; a>0; a--, cp+=4) { - SWAP(char, cp[0], cp[3]); - SWAP(char, cp[1], cp[2]); + /* swap bytes */ + for(cp= (char *)me->mcol, a= 4*me->totface; a>0; a--, cp+=4) { + SWAP(char, cp[0], cp[3]); + SWAP(char, cp[1], cp[2]); + } } } @@ -641,6 +649,8 @@ void shadeDispList(Scene *scene, Base *base) int a, need_orco; re= fastshade_get_render(scene); + if(re==NULL) + return; dl = find_displist(&ob->disp, DL_VERTCOL); if (dl) { diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 60a7ffc28d9..70901778585 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -333,11 +333,11 @@ static VFontData *vfont_get_data(VFont *vfont) BLI_addtail(&ttfdata, tmpfnt); } } else { - pf= newPackedFile(vfont->name); + pf= newPackedFile(NULL, vfont->name); if(!tmpfnt) { - tpf= newPackedFile(vfont->name); + tpf= newPackedFile(NULL, vfont->name); // Add temporary packed file to globals tmpfnt= (struct TmpFont *) MEM_callocN(sizeof(struct TmpFont), "temp_font"); @@ -385,8 +385,8 @@ VFont *load_vfont(char *name) strcpy(dir, name); BLI_splitdirstring(dir, filename); - pf= newPackedFile(name); - tpf= newPackedFile(name); + pf= newPackedFile(NULL, name); + tpf= newPackedFile(NULL, name); is_builtin= 0; } diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 8eef9984c92..ef0984bf93d 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1431,7 +1431,7 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal) /* try to repack file */ if(ima->packedfile) { PackedFile *pf; - pf = newPackedFile(ima->name); + pf = newPackedFile(NULL, ima->name); if (pf) { freePackedFile(ima->packedfile); ima->packedfile = pf; @@ -1750,7 +1750,7 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra) /* make packed file for autopack */ if ((ima->packedfile == NULL) && (G.fileflags & G_AUTOPACK)) - ima->packedfile = newPackedFile(str); + ima->packedfile = newPackedFile(NULL, str); } if(ima->flag & IMA_DO_PREMUL) @@ -1812,7 +1812,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser) Render *re= NULL; RenderResult *rr= NULL; - if(iuser->scene) { + if(iuser && iuser->scene) { re= RE_GetRender(iuser->scene->id.name); rr= RE_GetResult(re); } diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 22e4e8a8309..4d88556d8bf 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -61,8 +61,9 @@ #include "BKE_image.h" #include "BKE_font.h" #include "BKE_packedFile.h" +#include "BKE_report.h" -int seekPackedFile(PackedFile * pf, int offset, int whence) +int seekPackedFile(PackedFile *pf, int offset, int whence) { int oldseek = -1, seek = 0; @@ -92,12 +93,12 @@ int seekPackedFile(PackedFile * pf, int offset, int whence) return(oldseek); } -void rewindPackedFile(PackedFile * pf) +void rewindPackedFile(PackedFile *pf) { seekPackedFile(pf, 0, SEEK_SET); } -int readPackedFile(PackedFile * pf, void * data, int size) +int readPackedFile(PackedFile *pf, void *data, int size) { if ((pf != NULL) && (size >= 0) && (data != NULL)) { if (size + pf->seek > pf->size) { @@ -118,66 +119,55 @@ int readPackedFile(PackedFile * pf, void * data, int size) return(size); } -int countPackedFiles() +int countPackedFiles(Main *bmain) { - int count = 0; Image *ima; VFont *vf; bSample *sample; + int count = 0; // let's check if there are packed files... - ima = G.main->image.first; - while (ima) { - if (ima->packedfile) { + for(ima=bmain->image.first; ima; ima=ima->id.next) + if(ima->packedfile) count++; - } - ima= ima->id.next; - } - vf = G.main->vfont.first; - while (vf) { - if (vf->packedfile) { + for(vf=bmain->vfont.first; vf; vf=vf->id.next) + if(vf->packedfile) count++; - } - vf = vf->id.next; - } - sample = samples->first; - while (sample) { - if (sample->packedfile) { - count++; - } - sample = sample->id.next; - } + if(samples) + for(sample=samples->first; sample; sample=sample->id.next) + if(sample->packedfile) + count++; - return(count); + return count; } -void freePackedFile(PackedFile * pf) +void freePackedFile(PackedFile *pf) { - if (pf) { + if(pf) { MEM_freeN(pf->data); MEM_freeN(pf); - } else { - printf("freePackedFile: Trying to free a NULL pointer\n"); } + else + printf("freePackedFile: Trying to free a NULL pointer\n"); } -PackedFile * newPackedFileMemory(void *mem, int memlen) +PackedFile *newPackedFileMemory(void *mem, int memlen) { - PackedFile * pf = MEM_callocN(sizeof(*pf), "PackedFile"); + PackedFile *pf = MEM_callocN(sizeof(*pf), "PackedFile"); pf->data = mem; pf->size = memlen; return pf; } -PackedFile * newPackedFile(char * filename) +PackedFile *newPackedFile(ReportList *reports, char *filename) { - PackedFile * pf = NULL; + PackedFile *pf = NULL; int file, filelen; char name[FILE_MAXDIR+FILE_MAXFILE]; - void * data; + void *data; //XXX waitcursor(1); @@ -191,7 +181,7 @@ PackedFile * newPackedFile(char * filename) file= open(name, O_BINARY|O_RDONLY); if (file <= 0) { - // error("Can't open file: %s", name); + BKE_reportf(reports, RPT_ERROR, "Can't open file: %s", name); } else { filelen = BLI_filesize(file); @@ -214,36 +204,24 @@ PackedFile * newPackedFile(char * filename) return (pf); } -void packAll() +void packAll(Main *bmain, ReportList *reports) { Image *ima; VFont *vf; bSample *sample; - ima = G.main->image.first; - while (ima) { - if (ima->packedfile == NULL) { - ima->packedfile = newPackedFile(ima->name); - } - ima= ima->id.next; - } - - vf = G.main->vfont.first; - while (vf) { - if (vf->packedfile == NULL) { - vf->packedfile = newPackedFile(vf->name); - } - vf = vf->id.next; - } + for(ima=bmain->image.first; ima; ima=ima->id.next) + if(ima->packedfile == NULL) + ima->packedfile = newPackedFile(reports, ima->name); + for(vf=bmain->vfont.first; vf; vf=vf->id.next) + if(vf->packedfile == NULL) + vf->packedfile = newPackedFile(reports, vf->name); - sample = samples->first; - while (sample) { - if (sample->packedfile == NULL) { - sound_set_packedfile(sample, newPackedFile(sample->name)); - } - sample = sample->id.next; - } + if(samples) + for(sample=samples->first; sample; sample=sample->id.next) + if(sample->packedfile == NULL) + sound_set_packedfile(sample, newPackedFile(reports, sample->name)); } @@ -252,10 +230,10 @@ void packAll() // attempt to create a function that generates an unique filename // this will work when all funtions in fileops.c understand relative filenames... -char * find_new_name(char * name) +char *find_new_name(char *name) { char tempname[FILE_MAXDIR + FILE_MAXFILE]; - char * newname; + char *newname; if (fop_exists(name)) { for (number = 1; number <= 999; number++) { @@ -274,13 +252,13 @@ char * find_new_name(char * name) */ -int writePackedFile(char * filename, PackedFile *pf, int guimode) +int writePackedFile(ReportList *reports, char *filename, PackedFile *pf, int guimode) { int file, number, remove_tmp = FALSE; int ret_value = RET_OK; char name[FILE_MAXDIR + FILE_MAXFILE]; char tempname[FILE_MAXDIR + FILE_MAXFILE]; -/* void * data; */ +/* void *data; */ if (guimode); //XXX waitcursor(1); @@ -305,23 +283,23 @@ int writePackedFile(char * filename, PackedFile *pf, int guimode) file = open(name, O_BINARY + O_WRONLY + O_CREAT + O_TRUNC, 0666); if (file >= 0) { if (write(file, pf->data, pf->size) != pf->size) { - if(guimode) ; //XXX error("Error writing file: %s", name); + BKE_reportf(reports, RPT_ERROR, "Error writing file: %s", name); ret_value = RET_ERROR; } close(file); } else { - if(guimode); //XXX error("Error creating file: %s", name); + BKE_reportf(reports, RPT_ERROR, "Error creating file: %s", name); ret_value = RET_ERROR; } if (remove_tmp) { if (ret_value == RET_ERROR) { if (BLI_rename(tempname, name) != 0) { - if(guimode); //XXX error("Error restoring tempfile. Check files: '%s' '%s'", tempname, name); + BKE_reportf(reports, RPT_ERROR, "Error restoring tempfile. Check files: '%s' '%s'", tempname, name); } } else { if (BLI_delete(tempname, 0, 0) != 0) { - if(guimode); //XXX error("Error deleting '%s' (ignored)"); + BKE_reportf(reports, RPT_ERROR, "Error deleting '%s' (ignored)", tempname); } } } @@ -342,7 +320,7 @@ PF_NOFILE - the original file doens't exist */ -int checkPackedFile(char * filename, PackedFile * pf) +int checkPackedFile(char *filename, PackedFile *pf) { struct stat st; int ret_val, i, len, file; @@ -390,68 +368,23 @@ int checkPackedFile(char * filename, PackedFile * pf) /* -unpackFile() looks at the existing files (abs_name, local_name) and a packed file. -If how == PF_ASK it offers the user a couple of options what to do with the packed file. + unpackFile() looks at the existing files (abs_name, local_name) and a packed file. -It returns a char * to the existing file name / new file name or NULL when +It returns a char *to the existing file name / new file name or NULL when there was an error or when the user desides to cancel the operation. */ -char *unpackFile(char * abs_name, char * local_name, PackedFile * pf, int how) +char *unpackFile(ReportList *reports, char *abs_name, char *local_name, PackedFile *pf, int how) { - char menu[6 * (FILE_MAXDIR + FILE_MAXFILE + 100)]; + char menu[6 *(FILE_MAXDIR + FILE_MAXFILE + 100)]; char line[FILE_MAXDIR + FILE_MAXFILE + 100]; - char * newname = NULL, * temp = NULL; + char *newname = NULL, *temp = NULL; // char newabs[FILE_MAXDIR + FILE_MAXFILE]; // char newlocal[FILE_MAXDIR + FILE_MAXFILE]; if (pf != NULL) { - if (how == PF_ASK) { - sprintf(menu, "UnPack file%%t|Remove Pack %%x%d", PF_REMOVE); - - if (strcmp(abs_name, local_name)) { - switch (checkPackedFile(local_name, pf)) { - case PF_NOFILE: - sprintf(line, "|Create %s%%x%d", local_name, PF_WRITE_LOCAL); - strcat(menu, line); - break; - case PF_EQUAL: - sprintf(line, "|Use %s (identical)%%x%d", local_name, PF_USE_LOCAL); - strcat(menu, line); - break; - case PF_DIFFERS: - sprintf(line, "|Use %s (differs)%%x%d", local_name, PF_USE_LOCAL); - strcat(menu, line); - sprintf(line, "|Overwrite %s%%x%d", local_name, PF_WRITE_LOCAL); - strcat(menu, line); - break; - } - // sprintf(line, "|%%x%d", PF_INVALID); - // strcat(menu, line); - } - - switch (checkPackedFile(abs_name, pf)) { - case PF_NOFILE: - sprintf(line, "|Create %s%%x%d", abs_name, PF_WRITE_ORIGINAL); - strcat(menu, line); - break; - case PF_EQUAL: - sprintf(line, "|Use %s (identical)%%x%d", abs_name, PF_USE_ORIGINAL); - strcat(menu, line); - break; - case PF_DIFFERS: - sprintf(line, "|Use %s (differs)%%x%d", abs_name, PF_USE_ORIGINAL); - strcat(menu, line); - sprintf(line, "|Overwrite %s%%x%d", abs_name, PF_WRITE_ORIGINAL); - strcat(menu, line); - break; - } - - //XXX how = pupmenu(menu); - } - switch (how) { case -1: case PF_KEEP: @@ -467,7 +400,7 @@ char *unpackFile(char * abs_name, char * local_name, PackedFile * pf, int how) } // else fall through and create it case PF_WRITE_LOCAL: - if (writePackedFile(local_name, pf, 1) == RET_OK) { + if (writePackedFile(reports, local_name, pf, 1) == RET_OK) { temp = local_name; } break; @@ -479,7 +412,7 @@ char *unpackFile(char * abs_name, char * local_name, PackedFile * pf, int how) } // else fall through and create it case PF_WRITE_ORIGINAL: - if (writePackedFile(abs_name, pf, 1) == RET_OK) { + if (writePackedFile(reports, abs_name, pf, 1) == RET_OK) { temp = abs_name; } break; @@ -498,10 +431,10 @@ char *unpackFile(char * abs_name, char * local_name, PackedFile * pf, int how) } -int unpackVFont(VFont * vfont, int how) +int unpackVFont(ReportList *reports, VFont *vfont, int how) { char localname[FILE_MAXDIR + FILE_MAXFILE], fi[FILE_MAXFILE]; - char * newname; + char *newname; int ret_value = RET_ERROR; if (vfont != NULL) { @@ -510,7 +443,7 @@ int unpackVFont(VFont * vfont, int how) sprintf(localname, "//fonts/%s", fi); - newname = unpackFile(vfont->name, localname, vfont->packedfile, how); + newname = unpackFile(reports, vfont->name, localname, vfont->packedfile, how); if (newname != NULL) { ret_value = RET_OK; freePackedFile(vfont->packedfile); @@ -523,10 +456,10 @@ int unpackVFont(VFont * vfont, int how) return (ret_value); } -int unpackSample(bSample *sample, int how) +int unpackSample(ReportList *reports, bSample *sample, int how) { char localname[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX]; - char * newname; + char *newname; int ret_value = RET_ERROR; PackedFile *pf; @@ -535,7 +468,7 @@ int unpackSample(bSample *sample, int how) BLI_splitdirstring(localname, fi); sprintf(localname, "//samples/%s", fi); - newname = unpackFile(sample->name, localname, sample->packedfile, how); + newname = unpackFile(reports, sample->name, localname, sample->packedfile, how); if (newname != NULL) { strcpy(sample->name, newname); MEM_freeN(newname); @@ -553,10 +486,10 @@ int unpackSample(bSample *sample, int how) return(ret_value); } -int unpackImage(Image * ima, int how) +int unpackImage(ReportList *reports, Image *ima, int how) { char localname[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX]; - char * newname; + char *newname; int ret_value = RET_ERROR; if (ima != NULL) { @@ -564,7 +497,7 @@ int unpackImage(Image * ima, int how) BLI_splitdirstring(localname, fi); sprintf(localname, "//textures/%s", fi); - newname = unpackFile(ima->name, localname, ima->packedfile, how); + newname = unpackFile(reports, ima->name, localname, ima->packedfile, how); if (newname != NULL) { ret_value = RET_OK; freePackedFile(ima->packedfile); @@ -578,33 +511,23 @@ int unpackImage(Image * ima, int how) return(ret_value); } -void unpackAll(int how) +void unpackAll(Main *bmain, ReportList *reports, int how) { Image *ima; VFont *vf; bSample *sample; - - ima = G.main->image.first; - while (ima) { - if (ima->packedfile) { - unpackImage(ima, how); - } - ima= ima->id.next; - } - - vf = G.main->vfont.first; - while (vf) { - if (vf->packedfile) { - unpackVFont(vf, how); - } - vf = vf->id.next; - } - sample = samples->first; - while (sample) { - if (sample->packedfile) { - unpackSample(sample, how); - } - sample = sample->id.next; - } + for(ima=bmain->image.first; ima; ima=ima->id.next) + if(ima->packedfile) + unpackImage(reports, ima, how); + + for(vf=bmain->vfont.first; vf; vf=vf->id.next) + if(vf->packedfile) + unpackVFont(reports, vf, how); + + if(samples) + for(sample=samples->first; sample; sample=sample->id.next) + if(sample->packedfile) + unpackSample(reports, sample, how); } + diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 2474053298d..5bf9335d211 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -230,7 +230,7 @@ void psys_set_current_num(Object *ob, int index) if(ob==0) return; for(psys=ob->particlesystem.first, i=0; psys; psys=psys->next, i++) { - if(i == index - 1) + if(i == index) psys->flag |= PSYS_CURRENT; else psys->flag &= ~PSYS_CURRENT; @@ -2929,7 +2929,7 @@ void psys_mat_hair_to_global(Object *ob, DerivedMesh *dm, short from, ParticleDa /************************************************/ /* ParticleSettings handling */ /************************************************/ -void object_add_particle_system_slot(Scene *scene, Object *ob) +void object_add_particle_system(Scene *scene, Object *ob) { ParticleSystem *psys; ModifierData *md; @@ -2961,7 +2961,7 @@ void object_add_particle_system_slot(Scene *scene, Object *ob) DAG_scene_sort(scene); DAG_object_flush_update(scene, ob, OB_RECALC_DATA); } -void object_remove_particle_system_slot(Scene *scene, Object *ob) +void object_remove_particle_system(Scene *scene, Object *ob) { ParticleSystem *psys = psys_get_current(ob); ParticleSystemModifierData *psmd; diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c index 116fd069948..8de8cf8d0f4 100644 --- a/source/blender/blenkernel/intern/report.c +++ b/source/blender/blenkernel/intern/report.c @@ -65,8 +65,8 @@ void BKE_reports_init(ReportList *reports, int flag) memset(reports, 0, sizeof(ReportList)); - reports->storelevel= RPT_WARNING; - reports->printlevel= RPT_WARNING; + reports->storelevel= RPT_INFO; + reports->printlevel= RPT_INFO; reports->flag= flag; } diff --git a/source/blender/blenlib/BLI_util.h b/source/blender/blenlib/BLI_util.h index 30c9fc353b3..a138ea780ea 100644 --- a/source/blender/blenlib/BLI_util.h +++ b/source/blender/blenlib/BLI_util.h @@ -50,6 +50,7 @@ void BLI_make_existing_file(char *name); void BLI_split_dirfile(char *string, char *dir, char *file); void BLI_split_dirfile_basic(const char *string, char *dir, char *file); void BLI_join_dirfile(char *string, const char *dir, const char *file); +void BLI_getlastdir(const char* dir, char *last, int maxlen); int BLI_testextensie(const char *str, const char *ext); void BLI_uniquename(struct ListBase *list, void *vlink, char defname[], char delim, short name_offs, short len); void BLI_newname(char * name, int add); diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 0ae17a13e43..3204d5f74e1 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -218,7 +218,7 @@ void BLI_builddir(char *dirname, char *relname) { struct dirent *fname; struct dirlink *dlink; - int rellen, newnum = 0, seen_ = 0, seen__ = 0; + int rellen, newnum = 0, ignore; char buf[256]; DIR *dir; @@ -238,21 +238,17 @@ void BLI_builddir(char *dirname, char *relname) if ( (dir = (DIR *)opendir(".")) ){ while ((fname = (struct dirent*) readdir(dir)) != NULL) { - if(hide_dot && fname->d_name[0]=='.' && fname->d_name[1]!='.' && fname->d_name[1]!=0); + if(hide_dot && fname->d_name[0]=='.' && fname->d_name[1]!='.' && fname->d_name[1]!=0) { + } + else if ( ( (fname->d_name[0] == '.') && (fname->d_name[1] == 0) ) || + ( (fname->d_name[0] == '.') && (fname->d_name[1] == '.') && (fname->d_name[2] == 0)) ) { + /* ignore '.' and '..' */ + } else { - dlink = (struct dirlink *)malloc(sizeof(struct dirlink)); if (dlink){ strcpy(buf+rellen,fname->d_name); - dlink->name = BLI_strdup(buf); - - if (dlink->name[0] == '.') { - if (dlink->name[1] == 0) seen_ = 1; - else if (dlink->name[1] == '.') { - if (dlink->name[2] == 0) seen__ = 1; - } - } BLI_addhead(dirbase,dlink); newnum++; } @@ -260,30 +256,6 @@ void BLI_builddir(char *dirname, char *relname) } if (newnum){ -#ifndef WIN32 - if (seen_ == 0) { /* Cachefs PATCH */ - dlink = (struct dirlink *)malloc(sizeof(struct dirlink)); - strcpy(buf+rellen,"./."); - dlink->name = BLI_strdup(buf); - BLI_addhead(dirbase,dlink); - newnum++; - } - if (seen__ == 0) { /* MAC PATCH */ - dlink = (struct dirlink *)malloc(sizeof(struct dirlink)); - strcpy(buf+rellen,"./.."); - dlink->name = BLI_strdup(buf); - BLI_addhead(dirbase,dlink); - newnum++; - } -#else // WIN32 - if (seen_ == 0) { /* should only happen for root paths like "C:\" */ - dlink = (struct dirlink *)malloc(sizeof(struct dirlink)); - strcpy(buf+rellen,"."); - dlink->name = BLI_strdup(buf); - BLI_addhead(dirbase,dlink); - newnum++; - } -#endif if (files) files=(struct direntry *)realloc(files,(totnum+newnum) * sizeof(struct direntry)); else files=(struct direntry *)malloc(newnum * sizeof(struct direntry)); diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 26f4c2dd415..b9d4daaf5b2 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -736,6 +736,25 @@ void BLI_splitdirstring(char *di, char *fi) } } +void BLI_getlastdir(const char* dir, char *last, int maxlen) +{ + char *s = dir; + char *lslash = NULL; + char *prevslash = NULL; + while (*s) { + if ((*s == '\\') || (*s == '/')) { + prevslash = lslash; + lslash = s; + } + s++; + } + if (prevslash) { + BLI_strncpy(last, prevslash+1, maxlen); + } else { + BLI_strncpy(last, dir, maxlen); + } +} + char *BLI_gethome(void) { #if !defined(WIN32) return getenv("HOME"); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 6df907fe132..0c1ba32c543 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5658,21 +5658,6 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) /* temporarily hide it */ ar->flag = RGN_FLAG_HIDDEN; break; - - case SPACE_FILE: - /* channel (bookmarks/directories) region */ - ar= MEM_callocN(sizeof(ARegion), "area region from do_versions"); - BLI_addtail(lb, ar); - ar->regiontype= RGN_TYPE_CHANNELS; - ar->alignment= RGN_ALIGN_LEFT; - ar->v2d.scroll= V2D_SCROLL_RIGHT; - /* button UI region */ - ar= MEM_callocN(sizeof(ARegion), "area region from do_versions"); - BLI_addtail(lb, ar); - ar->regiontype= RGN_TYPE_UI; - ar->alignment= RGN_ALIGN_TOP; - break; - #if 0 case SPACE_BUTS: /* context UI region */ @@ -9089,12 +9074,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main) */ //do_versions_ipos_to_animato(main); - /* struct audio data moved to renderdata */ + /* toolsettings */ for(scene= main->scene.first; scene; scene= scene->id.next) { scene->r.audio = scene->audio; - if(!scene->toolsettings->uv_selectmode) + if(!scene->toolsettings->uv_selectmode) { scene->toolsettings->uv_selectmode= UV_SELECT_VERTEX; + scene->toolsettings->vgroup_weight= 1.0f; + } } /* shader, composit and texture node trees have id.name empty, put something in diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index 34aefa91225..01882ecd9bc 100644 --- a/source/blender/editors/include/ED_fileselect.h +++ b/source/blender/editors/include/ED_fileselect.h @@ -29,34 +29,8 @@ #define ED_FILES_H struct SpaceFile; - -#define FILE_SHORTDISPLAY 1 -#define FILE_LONGDISPLAY 2 -#define FILE_IMGDISPLAY 3 - -typedef struct FileSelectParams { - char title[24]; /* title, also used for the text of the execute button */ - char dir[240]; /* directory */ - char file[80]; /* file */ - - short flag; /* settings for filter, hiding files and display mode */ - short sort; /* sort order */ - short display; /* display mode flag */ - short filter; /* filter when (flags & FILE_FILTER) is true */ - - /* XXX - temporary, better move to filelist */ - short active_bookmark; - int active_file; - int selstate; - - /* XXX --- still unused -- */ - short f_fp; /* show font preview */ - char fp_str[8]; /* string to use for font preview */ - - char *pupmenu; /* allows menu for save options - result stored in menup */ - short menu; /* currently selected option in pupmenu */ - /* XXX --- end unused -- */ -} FileSelectParams; +struct ARegion; +struct FileSelectParams; #define FILE_LAYOUT_HOR 1 #define FILE_LAYOUT_VER 2 @@ -93,7 +67,7 @@ typedef struct FileLayout float column_widths[MAX_FILE_COLUMN]; } FileLayout; -FileSelectParams* ED_fileselect_get_params(struct SpaceFile *sfile); +struct FileSelectParams* ED_fileselect_get_params(struct SpaceFile *sfile); short ED_fileselect_set_params(struct SpaceFile *sfile, const char *title, const char *path, short flag, short display, short filter, short sort); diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 937f6384f6a..8952305d6ab 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -110,7 +110,6 @@ void undo_push_mesh(struct bContext *C, char *name); struct EditFace *EM_get_actFace(struct EditMesh *em, int sloppy); void EM_set_actFace(struct EditMesh *em, struct EditFace *efa); float EM_face_area(struct EditFace *efa); -void EM_add_data_layer(struct EditMesh *em, struct CustomData *data, int type); void EM_select_edge(struct EditEdge *eed, int sel); void EM_select_face(struct EditFace *efa, int sel); @@ -134,6 +133,9 @@ struct UvVertMap *EM_make_uv_vert_map(struct EditMesh *em, int selected, int do_ struct UvMapVert *EM_get_uv_map_vert(struct UvVertMap *vmap, unsigned int v); void EM_free_uv_vert_map(struct UvVertMap *vmap); +void EM_add_data_layer(struct EditMesh *em, struct CustomData *data, int type); +void EM_free_data_layer(struct EditMesh *em, struct CustomData *data, int type); + /* editmesh_mods.c */ extern unsigned int em_vertoffs, em_solidoffs, em_wireoffs; diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index b6d71759373..cc8b936b04f 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -456,7 +456,7 @@ typedef void (*uiBlockHandleFunc)(struct bContext *C, void *arg, int event); /* use inside searchfunc to add items */ int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int iconid); /* bfunc gets search item *poin as arg2, or if NULL the old string */ -void uiButSetSearchFunc (uiBut *but, uiButSearchFunc sfunc, void *arg1, uiButHandleFunc bfunc); +void uiButSetSearchFunc (uiBut *but, uiButSearchFunc sfunc, void *arg1, uiButHandleFunc bfunc, void *active); /* height in pixels, it's using hardcoded values still */ int uiSearchBoxhHeight(void); @@ -617,7 +617,9 @@ void uiTemplateColorRamp(uiLayout *layout, struct ColorBand *coba, int expand); void uiTemplateCurveMapping(uiLayout *layout, struct CurveMapping *cumap, int type); void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, char *propname); void uiTemplateImageLayers(uiLayout *layout, struct bContext *C, struct Image *ima, struct ImageUser *iuser); -ListBase uiTemplateList(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *activeprop, int rows, int columns, int compact); +ListBase uiTemplateList(uiLayout *layout, struct PointerRNA *ptr, char *propname, struct PointerRNA *activeptr, char *activeprop, int rows, int columns, int compact); +void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C); +void uiTemplateOperatorSearch(uiLayout *layout); /* items */ void uiItemO(uiLayout *layout, char *name, int icon, char *opname); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index a9866d8898e..00ec875bd86 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2184,7 +2184,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, RNA_property_int_range(ptr, prop, &hardmin, &hardmax); RNA_property_int_ui_range(ptr, prop, &softmin, &softmax, &step); - if(min == max) { + if(type != ROW && min == max) { min= hardmin; max= hardmax; } @@ -2199,7 +2199,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, RNA_property_float_range(ptr, prop, &hardmin, &hardmax); RNA_property_float_ui_range(ptr, prop, &softmin, &softmax, &step, &precision); - if(min == max) { + if(type != ROW && min == max) { min= hardmin; max= hardmax; } @@ -2919,15 +2919,15 @@ uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxle } /* arg is user value, searchfunc and handlefunc both get it as arg */ -void uiButSetSearchFunc(uiBut *but, uiButSearchFunc sfunc, void *arg, uiButHandleFunc bfunc) +/* if active set, button opens with this item visible and selected */ +void uiButSetSearchFunc(uiBut *but, uiButSearchFunc sfunc, void *arg, uiButHandleFunc bfunc, void *active) { but->search_func= sfunc; but->search_arg= arg; - uiButSetFunc(but, bfunc, arg, NULL); + uiButSetFunc(but, bfunc, arg, active); } - /* Program Init/Exit */ void UI_init(void) diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 5049fc0b130..7ad422ef3b5 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -112,6 +112,9 @@ typedef struct uiHandleButtonData { /* tooltip */ ARegion *tooltip; wmTimer *tooltiptimer; + + /* auto open */ + int used_mouse; wmTimer *autoopentimer; /* text selection/editing */ @@ -284,16 +287,6 @@ static void ui_apply_but_funcs_after(bContext *C) if(after.context) CTX_store_set(C, after.context); - if(after.func) - after.func(C, after.func_arg1, after.func_arg2); - if(after.funcN) - after.funcN(C, after.func_argN, after.func_arg2); - - if(after.handle_func) - after.handle_func(C, after.handle_func_arg, after.retval); - if(after.butm_func) - after.butm_func(C, after.butm_func_arg, after.a2); - if(after.optype) WM_operator_name_call(C, after.optype->idname, after.opcontext, after.opptr); if(after.opptr) { @@ -308,6 +301,16 @@ static void ui_apply_but_funcs_after(bContext *C) CTX_store_set(C, NULL); CTX_store_free(after.context); } + + if(after.func) + after.func(C, after.func_arg1, after.func_arg2); + if(after.funcN) + after.funcN(C, after.func_argN, after.func_arg2); + + if(after.handle_func) + after.handle_func(C, after.handle_func_arg, after.retval); + if(after.butm_func) + after.butm_func(C, after.butm_func_arg, after.a2); } } @@ -3344,7 +3347,7 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s /* automatic open pulldown block timer */ if(ELEM3(but->type, BLOCK, PULLDOWN, ICONTEXTROW)) { - if(!data->autoopentimer) { + if(data->used_mouse && !data->autoopentimer) { int time; if(but->block->auto_open==2) time= 1; // test for toolbox @@ -3447,6 +3450,9 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA if(but->block->auto_open_last+BUTTON_AUTO_OPEN_THRESH < PIL_check_seconds_timer()) but->block->auto_open= 0; + if(type == BUTTON_ACTIVATE_OVER) { + data->used_mouse= 1; + } button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); if(type == BUTTON_ACTIVATE_OPEN) { @@ -3765,12 +3771,19 @@ static void ui_handle_button_return_submenu(bContext *C, wmEvent *event, uiBut * button_activate_exit(C, data, but, 1); } else if(menu->menuretval == UI_RETURN_OUT) { - if(ui_mouse_inside_button(data->region, but, event->x, event->y)) { + if(event->type==MOUSEMOVE && ui_mouse_inside_button(data->region, but, event->x, event->y)) { button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); } else { - data->cancel= 1; - button_activate_exit(C, data, but, 1); + but= ui_but_find_activated(data->region); + if(but) { + but->active->used_mouse= 0; + button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); + } + else { + data->cancel= 1; + button_activate_exit(C, data, but, 1); + } } } } diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 4d8ec5996be..315b8693905 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -728,21 +728,28 @@ static void icon_create_mipmap(struct PreviewImage* prv_img, int miplevel) } /* create single icon from jpg, png etc. */ -static void icon_from_image(Image *img, int miplevel) +static void icon_from_image(Scene *scene, Image *img, int miplevel) { + ImBuf *ibuf= NULL; + ImageUser iuser; + PreviewImage *pi; unsigned int pr_size; short image_loaded = 0; - struct ImBuf* ibuf=NULL; - PreviewImage* pi; /* img->ok is zero when Image cannot load */ if (img==NULL || img->ok==0) return; + /* setup dummy image user */ + memset(&iuser, 0, sizeof(ImageUser)); + iuser.ok= iuser.framenr= 1; + iuser.scene= scene; + /* elubie: this needs to be changed: here image is always loaded if not already there. Very expensive for large images. Need to find a way to only get existing ibuf */ - ibuf = BKE_image_get_ibuf(img, NULL); + + ibuf = BKE_image_get_ibuf(img, &iuser); if(ibuf==NULL || ibuf->rect==NULL) { return; } @@ -788,7 +795,7 @@ static void icon_set_image(Scene *scene, ID *id, PreviewImage* prv_img, int mipl /* no drawing (see last parameter doDraw, just calculate preview image - hopefully small enough to be fast */ if (GS(id->name) == ID_IM) - icon_from_image((struct Image*)id, miplevel); + icon_from_image(scene, (struct Image*)id, miplevel); else { /* create the preview rect */ icon_create_mipmap(prv_img, miplevel); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 94280ec37d3..f9816235b88 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -936,7 +936,7 @@ void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRN but->rnasearchprop= searchprop; but->flag |= UI_ICON_LEFT|UI_TEXT_LEFT; - uiButSetSearchFunc(but, rna_search_cb, but, NULL); + uiButSetSearchFunc(but, rna_search_cb, but, NULL, NULL); } } diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index eaf78ae89ef..a20884a61a3 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -104,6 +104,8 @@ static int panel_aligned(ScrArea *sa, ARegion *ar) SpaceButs *sbuts= sa->spacedata.first; return sbuts->align; } + else if(sa->spacetype==SPACE_FILE && ar->regiontype == RGN_TYPE_CHANNELS) + return BUT_VERTICAL; else if(ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS)) return BUT_VERTICAL; @@ -126,6 +128,8 @@ static int panels_re_align(ScrArea *sa, ARegion *ar, Panel **r_pa) } else if(ar->regiontype==RGN_TYPE_UI) return 1; + else if(sa->spacetype==SPACE_FILE && ar->regiontype == RGN_TYPE_CHANNELS) + return 1; /* in case panel is added or disappears */ for(pa=ar->panels.first; pa; pa=pa->next) { diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 61cf612e912..27fb0731d67 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -437,6 +437,7 @@ struct uiSearchItems { int *icons; AutoComplete *autocpl; + void *active; }; typedef struct uiSearchboxData { @@ -459,6 +460,14 @@ int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int icon return 1; } + /* hijack for finding active item */ + if(items->active) { + if(poin==items->active) + items->offset_i= items->totitem; + items->totitem++; + return 1; + } + if(items->totitem>=items->maxitem) { items->more= 1; return 0; @@ -597,20 +606,52 @@ void ui_searchbox_update(bContext *C, ARegion *ar, uiBut *but, int reset) /* reset vars */ data->items.totitem= 0; data->items.more= 0; - if(reset==0) + if(reset==0) { data->items.offset_i= data->items.offset; + } else { data->items.offset_i= data->items.offset= 0; data->active= 0; + + /* handle active */ + if(but->search_func && but->func_arg2) { + data->items.active= but->func_arg2; + but->search_func(C, but->search_arg, but->editstr, &data->items); + data->items.active= NULL; + + /* found active item, calculate real offset by centering it */ + if(data->items.totitem) { + /* first case, begin of list */ + if(data->items.offset_i < data->items.maxitem) { + data->active= data->items.offset_i+1; + data->items.offset_i= 0; + } + else { + /* second case, end of list */ + if(data->items.totitem - data->items.offset_i <= data->items.maxitem) { + data->active= 1 + data->items.offset_i - data->items.totitem + data->items.maxitem; + data->items.offset_i= data->items.totitem - data->items.maxitem; + } + else { + /* center active item */ + data->items.offset_i -= data->items.maxitem/2; + data->active= 1 + data->items.maxitem/2; + } + } + } + data->items.offset= data->items.offset_i; + data->items.totitem= 0; + } } /* callback */ if(but->search_func) but->search_func(C, but->search_arg, but->editstr, &data->items); - if(reset) { + /* handle case where editstr is equal to one of items */ + if(reset && data->active==0) { int a; - /* handle case where editstr is equal to one of items */ + for(a=0; aitems.totitem; a++) { char *cpoin= strchr(data->items.names[a], '|'); @@ -666,13 +707,15 @@ static void ui_searchbox_region_draw(const bContext *C, ARegion *ar) } /* indicate more */ if(data->items.more) { + ui_searchbox_butrect(&rect, data, data->items.maxitem-1); glEnable(GL_BLEND); - UI_icon_draw((data->bbox.xmax-data->bbox.xmin)/2, 8, ICON_TRIA_DOWN); + UI_icon_draw((rect.xmax-rect.xmin)/2, rect.ymin-9, ICON_TRIA_DOWN); glDisable(GL_BLEND); } if(data->items.offset) { + ui_searchbox_butrect(&rect, data, 0); glEnable(GL_BLEND); - UI_icon_draw((data->bbox.xmax-data->bbox.xmin)/2, data->bbox.ymax-13, ICON_TRIA_UP); + UI_icon_draw((rect.xmax-rect.xmin)/2, rect.ymax-7, ICON_TRIA_UP); glDisable(GL_BLEND); } } @@ -2719,6 +2762,8 @@ void uiPupMenuReports(bContext *C, ReportList *reports) BLI_dynstr_appendf(ds, "Error %%i%d%%t|%s", ICON_ERROR, report->message); else if(report->type >= RPT_WARNING) BLI_dynstr_appendf(ds, "Warning %%i%d%%t|%s", ICON_ERROR, report->message); + else if(report->type >= RPT_INFO) + BLI_dynstr_appendf(ds, "Info %%t|%s", report->message); } str= BLI_dynstr_get_cstring(ds); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index a006187c4aa..8f1d57b28ed 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -112,6 +112,7 @@ static uiBlock *search_menu(bContext *C, ARegion *ar, void *arg_litem) { static char search[256]; static TemplateID template; + PointerRNA idptr; wmEvent event; wmWindow *win= CTX_wm_window(C); uiBlock *block; @@ -122,6 +123,9 @@ static uiBlock *search_menu(bContext *C, ARegion *ar, void *arg_litem) /* arg_litem is malloced, can be freed by parent button */ template= *((TemplateID*)arg_litem); + /* get active id for showing first item */ + idptr= RNA_property_pointer_get(&template.ptr, template.prop); + block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS); uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1); @@ -129,7 +133,7 @@ static uiBlock *search_menu(bContext *C, ARegion *ar, void *arg_litem) uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 0, 150, 19, ""); - uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb); + uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb, idptr.data); uiBoundsBlock(block, 6); uiBlockSetDirection(block, UI_DOWN); @@ -157,9 +161,15 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) switch(event) { case UI_ID_BROWSE: case UI_ID_PIN: + printf("warning, id event %d shouldnt come here\n", event); + break; case UI_ID_OPEN: case UI_ID_ADD_NEW: - printf("warning, id event %d shouldnt come here\n", event); + if(template->idlb->last) { + RNA_id_pointer_create(template->idlb->last, &idptr); + RNA_property_pointer_set(&template->ptr, template->prop, idptr); + RNA_property_update(C, &template->ptr, template->prop); + } break; case UI_ID_DELETE: memset(&idptr, 0, sizeof(idptr)); @@ -197,12 +207,13 @@ static void template_ID(bContext *C, uiBlock *block, TemplateID *template, Struc idptr= RNA_property_pointer_get(&template->ptr, template->prop); lb= template->idlb; + uiBlockBeginAlign(block); + if(idptr.type) type= idptr.type; if(type) uiDefIconBut(block, LABEL, 0, RNA_struct_ui_icon(type), 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); - uiBlockBeginAlign(block); if(flag & UI_ID_BROWSE) uiDefBlockButN(block, search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X, UI_UNIT_Y, "Browse ID data"); @@ -221,6 +232,7 @@ static void template_ID(bContext *C, uiBlock *block, TemplateID *template, Struc if(newop) { but= uiDefIconTextButO(block, BUT, newop, WM_OP_EXEC_REGION_WIN, ICON_ZOOMIN, "Add New", 0, 0, w, UI_UNIT_Y, NULL); + uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); } else { but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, "Add New", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); @@ -1474,93 +1486,63 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, char *propname) /************************* List Template **************************/ -#if 0 -typedef struct ListItem { - PointerRNA ptr; - PropertyRNA *prop; - PropertyRNA *activeprop; - - PointerRNA activeptr; - int activei; - - int selected; -} ListItem; - -static void list_item_cb(bContext *C, void *arg_item, void *arg_unused) -{ - ListItem *item= (ListItem*)arg_item; - PropertyType activetype; - char *activename; - - if(item->selected) { - activetype= RNA_property_type(item->activeprop); - - if(activetype == PROP_POINTER) - RNA_property_pointer_set(&item->ptr, item->activeprop, item->activeptr); - else if(activetype == PROP_INT) - RNA_property_int_set(&item->ptr, item->activeprop, item->activei); - else if(activetype == PROP_STRING) { - activename= RNA_struct_name_get_alloc(&item->activeptr, NULL, 0); - RNA_property_string_set(&item->ptr, item->activeprop, activename); - MEM_freeN(activename); - } - } -} -#endif - -ListBase uiTemplateList(uiLayout *layout, PointerRNA *ptr, char *propname, char *activepropname, int rows, int columns, int compact) +ListBase uiTemplateList(uiLayout *layout, PointerRNA *ptr, char *propname, PointerRNA *activeptr, char *activepropname, int rows, int columns, int compact) { CollectionPointerLink *link; - PropertyRNA *prop, *activeprop; + PropertyRNA *prop= NULL, *activeprop; PropertyType type, activetype; - PointerRNA activeptr; uiLayout *box, *row, *col; uiBlock *block; uiBut *but; + Panel *pa; ListBase lb; - char *name, *activename= NULL, str[32]; - int i= 1, activei= 0, len, items, found; - static int scroll = 1; + char *name, str[32]; + int i= 0, activei= 0, len, items, found, min, max; lb.first= lb.last= NULL; /* validate arguments */ - if(!ptr->data) + block= uiLayoutGetBlock(layout); + pa= block->panel; + + if(!pa) { + printf("uiTemplateList: only works inside a panel.\n"); return lb; - - prop= RNA_struct_find_property(ptr, propname); - if(!prop) { - printf("uiTemplateList: property not found: %s\n", propname); + } + + if(!activeptr->data) return lb; + + if(ptr->data) { + prop= RNA_struct_find_property(ptr, propname); + if(!prop) { + printf("uiTemplateList: property not found: %s\n", propname); + return lb; + } } - activeprop= RNA_struct_find_property(ptr, activepropname); + activeprop= RNA_struct_find_property(activeptr, activepropname); if(!activeprop) { printf("uiTemplateList: property not found: %s\n", activepropname); return lb; } - type= RNA_property_type(prop); - if(type != PROP_COLLECTION) { - printf("uiTemplateList: expected collection property.\n"); - return lb; + if(prop) { + type= RNA_property_type(prop); + if(type != PROP_COLLECTION) { + printf("uiTemplateList: expected collection property.\n"); + return lb; + } } activetype= RNA_property_type(activeprop); - if(!ELEM3(activetype, PROP_POINTER, PROP_INT, PROP_STRING)) { - printf("uiTemplateList: expected pointer, integer or string property.\n"); + if(activetype != PROP_INT) { + printf("uiTemplateList: expected integer property.\n"); return lb; } /* get active data */ - if(activetype == PROP_POINTER) - activeptr= RNA_property_pointer_get(ptr, activeprop); - else if(activetype == PROP_INT) - activei= RNA_property_int_get(ptr, activeprop); - else if(activetype == PROP_STRING) - activename= RNA_property_string_get_alloc(ptr, activeprop, NULL, 0); - - block= uiLayoutGetBlock(layout); + activei= RNA_property_int_get(activeptr, activeprop); if(compact) { /* compact layout */ @@ -1568,111 +1550,196 @@ ListBase uiTemplateList(uiLayout *layout, PointerRNA *ptr, char *propname, char row= uiLayoutRow(layout, 1); - RNA_PROP_BEGIN(ptr, itemptr, prop) { - if(activetype == PROP_POINTER) - found= (activeptr.data == itemptr.data); - else if(activetype == PROP_INT) + if(ptr->data && prop) { + /* create list items */ + RNA_PROP_BEGIN(ptr, itemptr, prop) { found= (activei == i); - else if(activetype == PROP_STRING) - found= (strcmp(activename, name) == 0); - - if(found) { - name= RNA_struct_name_get_alloc(&itemptr, NULL, 0); - if(name) { - uiItemL(row, name, RNA_struct_ui_icon(itemptr.type)); - MEM_freeN(name); + + if(found) { + /* create button */ + name= RNA_struct_name_get_alloc(&itemptr, NULL, 0); + if(name) { + uiItemL(row, name, RNA_struct_ui_icon(itemptr.type)); + MEM_freeN(name); + } + + /* add to list to return */ + link= MEM_callocN(sizeof(CollectionPointerLink), "uiTemplateList return"); + link->ptr= itemptr; + BLI_addtail(&lb, link); } - link= MEM_callocN(sizeof(CollectionPointerLink), "uiTemplateList return"); - link->ptr= itemptr; - BLI_addtail(&lb, link); + i++; } - - i++; + RNA_PROP_END; } - RNA_PROP_END; - if(i == 1) + /* if not found, add in dummy button */ + if(i == 0) uiItemL(row, "", 0); - sprintf(str, "%d :", i-1); - but= uiDefIconTextButR(block, NUM, 0, 0, str, 0,0,UI_UNIT_X*5,UI_UNIT_Y, ptr, activepropname, 0, 0, 0, 0, 0, ""); - if(i == 1) + /* next/prev button */ + sprintf(str, "%d :", i); + but= uiDefIconTextButR(block, NUM, 0, 0, str, 0,0,UI_UNIT_X*5,UI_UNIT_Y, activeptr, activepropname, 0, 0, 0, 0, 0, ""); + if(i == 0) uiButSetFlag(but, UI_BUT_DISABLED); } else { + /* default rows/columns */ if(rows == 0) rows= 5; if(columns == 0) columns= 1; - items= rows*columns; - + /* layout */ box= uiLayoutBox(layout); row= uiLayoutRow(box, 0); col = uiLayoutColumn(row, 1); uiBlockSetEmboss(block, UI_EMBOSSN); - len= RNA_property_collection_length(ptr, prop); - scroll= MIN2(scroll, len-items+1); - scroll= MAX2(scroll, 1); + /* init numbers */ + RNA_property_int_range(activeptr, activeprop, &min, &max); + + len= max - min + 1; + items= rows*columns; - RNA_PROP_BEGIN(ptr, itemptr, prop) { - if(i >= scroll && ilist_scroll= MIN2(pa->list_scroll, len-items); + pa->list_scroll= MAX2(pa->list_scroll, 0); - if(name) { -#if 0 - ListItem *item= MEM_callocN(sizeof(ListItem), "uiTemplateList ListItem"); - - item->ptr= *ptr; - item->prop= prop; - item->activeprop= activeprop; - item->activeptr= itemptr; - item->activei= i; - - if(activetype == PROP_POINTER) - item->selected= (activeptr.data == itemptr.data)? i: -1; - else if(activetype == PROP_INT) - item->selected= (activei == i)? i: -1; - else if(activetype == PROP_STRING) - item->selected= (strcmp(activename, name) == 0)? i: -1; -#endif + if(ptr->data && prop) { + /* create list items */ + RNA_PROP_BEGIN(ptr, itemptr, prop) { + if(i >= pa->list_scroll && ilist_scroll+items) { + name= RNA_struct_name_get_alloc(&itemptr, NULL, 0); - //but= uiDefIconTextButI(block, ROW, 0, RNA_struct_ui_icon(itemptr.type), name, 0,0,UI_UNIT_X*10,UI_UNIT_Y, &item->selected, 0, i, 0, 0, ""); - but= uiDefIconTextButR(block, ROW, 0, RNA_struct_ui_icon(itemptr.type), name, 0,0,UI_UNIT_X*10,UI_UNIT_Y, ptr, activepropname, 0/*&item->selected*/, 0, i, 0, 0, ""); - uiButSetFlag(but, UI_ICON_LEFT|UI_TEXT_LEFT); - //uiButSetNFunc(but, list_item_cb, item, NULL); + if(name) { + /* create button */ + but= uiDefIconTextButR(block, ROW, 0, RNA_struct_ui_icon(itemptr.type), name, 0,0,UI_UNIT_X*10,UI_UNIT_Y, activeptr, activepropname, 0, 0, i, 0, 0, ""); + uiButSetFlag(but, UI_ICON_LEFT|UI_TEXT_LEFT); - MEM_freeN(name); + MEM_freeN(name); + } + /* add to list to return */ link= MEM_callocN(sizeof(CollectionPointerLink), "uiTemplateList return"); link->ptr= itemptr; BLI_addtail(&lb, link); } - } - i++; + i++; + } + RNA_PROP_END; } - RNA_PROP_END; - while(i < scroll+items) { - if(i >= scroll) + /* add dummy buttons to fill space */ + while(i < pa->list_scroll+items) { + if(i >= pa->list_scroll) uiItemL(col, "", 0); i++; } uiBlockSetEmboss(block, UI_EMBOSS); + /* add scrollbar */ if(len > items) { col= uiLayoutColumn(row, 0); - uiDefButI(block, SCROLL, 0, "", 0,0,UI_UNIT_X*0.75,UI_UNIT_Y*items, &scroll, 1, len-items+1, items, 0, ""); + uiDefButI(block, SCROLL, 0, "", 0,0,UI_UNIT_X*0.75,UI_UNIT_Y*items, &pa->list_scroll, 0, len-items, items, 0, ""); } - - //uiDefButI(block, SCROLL, 0, "", 0,0,UI_UNIT_X*15,UI_UNIT_Y*0.75, &scroll, 1, 16-5, 5, 0, ""); } + /* return items in list */ return lb; } +/************************* Operator Search Template **************************/ + +static void operator_call_cb(struct bContext *C, void *arg1, void *arg2) +{ + wmOperatorType *ot= arg2; + + if(ot) + WM_operator_name_call(C, ot->idname, WM_OP_INVOKE_DEFAULT, NULL); +} + +static void operator_search_cb(const struct bContext *C, void *arg, char *str, uiSearchItems *items) +{ + wmOperatorType *ot = WM_operatortype_first(); + + for(; ot; ot= ot->next) { + + if(BLI_strcasestr(ot->name, str)) { + if(ot->poll==NULL || ot->poll((bContext *)C)) { + char name[256]; + int len= strlen(ot->name); + + /* display name for menu, can hold hotkey */ + BLI_strncpy(name, ot->name, 256); + + /* check for hotkey */ + if(len < 256-6) { + if(WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, &name[len+1], 256-len-1)) + name[len]= '|'; + } + + if(0==uiSearchItemAdd(items, name, ot, 0)) + break; + } + } + } +} + +void uiTemplateOperatorSearch(uiLayout *layout) +{ + uiBlock *block; + uiBut *but; + static char search[256]= ""; + + block= uiLayoutGetBlock(layout); + uiBlockSetCurLayout(block, layout); + + but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 0, 0, UI_UNIT_X*6, UI_UNIT_Y, ""); + uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb, NULL); +} + +/************************* Running Jobs Template **************************/ + +#define B_STOPRENDER 1 +#define B_STOPCAST 2 +#define B_STOPANIM 3 + +static void do_running_jobs(bContext *C, void *arg, int event) +{ + switch(event) { + case B_STOPRENDER: + G.afbreek= 1; + break; + case B_STOPCAST: + WM_jobs_stop(CTX_wm_manager(C), CTX_wm_screen(C)); + break; + case B_STOPANIM: + ED_screen_animation_timer(C, 0, 0); + break; + } +} + +void uiTemplateRunningJobs(uiLayout *layout, bContext *C) +{ + bScreen *screen= CTX_wm_screen(C); + Scene *scene= CTX_data_scene(C); + wmWindowManager *wm= CTX_wm_manager(C); + uiBlock *block; + + block= uiLayoutGetBlock(layout); + uiBlockSetCurLayout(block, layout); + + uiBlockSetHandleFunc(block, do_running_jobs, NULL); + + if(WM_jobs_test(wm, scene)) + uiDefIconTextBut(block, BUT, B_STOPRENDER, ICON_REC, "Render", 0,0,75,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Stop rendering"); + if(WM_jobs_test(wm, screen)) + uiDefIconTextBut(block, BUT, B_STOPCAST, ICON_REC, "Capture", 0,0,85,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Stop screencast"); + if(screen->animtimer) + uiDefIconTextBut(block, BUT, B_STOPANIM, ICON_REC, "Anim Player", 0,0,85,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, "Stop animation playback"); +} + diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 3ed81a3e9bc..eb79848d7d2 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -327,7 +327,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_params) uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 0, 150, 19, ""); - uiButSetSearchFunc(but, id_search_cb, ¶ms, id_search_call_cb); + uiButSetSearchFunc(but, id_search_cb, ¶ms, id_search_call_cb, NULL); uiBoundsBlock(block, 6); uiBlockSetDirection(block, UI_DOWN); diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index ddf31c0db66..ed2d00cb00d 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1679,12 +1679,12 @@ static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat rect1= *rect; if(horizontal) { - fac= (rect->xmax - rect->xmin)/(size-1); + fac= (rect->xmax - rect->xmin)/(size); rect1.xmin= rect1.xmin + ceil(fac*(value - but->softmin)); rect1.xmax= rect1.xmin + ceil(fac*(but->a1 - but->softmin)); } else { - fac= (rect->ymax - rect->ymin)/(size-1); + fac= (rect->ymax - rect->ymin)/(size); rect1.ymax= rect1.ymax - ceil(fac*(value - but->softmin)); rect1.ymin= rect1.ymax - ceil(fac*(but->a1 - but->softmin)); } diff --git a/source/blender/editors/mesh/editdeform.c b/source/blender/editors/mesh/editdeform.c deleted file mode 100644 index 3ccd4d56ece..00000000000 --- a/source/blender/editors/mesh/editdeform.c +++ /dev/null @@ -1,1110 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - * Creator-specific support for vertex deformation groups - * Added: apply deform function (ton) - */ - -#include - -#include "MEM_guardedalloc.h" - -#include "DNA_cloth_types.h" -#include "DNA_curve_types.h" -#include "DNA_lattice_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" -#include "DNA_object_force.h" -#include "DNA_scene_types.h" -#include "DNA_particle_types.h" -#include "DNA_windowmanager_types.h" - -#include "BLI_blenlib.h" -#include "BLI_editVert.h" - -#include "BKE_customdata.h" -#include "BKE_DerivedMesh.h" -#include "BKE_depsgraph.h" -#include "BKE_deform.h" -#include "BKE_displist.h" -#include "BKE_global.h" -#include "BKE_lattice.h" -#include "BKE_mesh.h" -#include "BKE_utildefines.h" - -#include "ED_mesh.h" -#include "ED_view3d.h" -#include "mesh_intern.h" - -/* XXX */ -static void BIF_undo_push() {} -static void error() {} - -static Lattice *def_get_lattice(Object *ob) -{ - if(ob->type==OB_LATTICE) { - Lattice *lt= ob->data; - if(lt->editlatt) - return lt->editlatt; - return lt; - } - return NULL; -} - -/* only in editmode */ -void sel_verts_defgroup (Object *obedit, int select) -{ - EditVert *eve; - Object *ob; - int i; - MDeformVert *dvert; - - ob= obedit; - - if (!ob) - return; - - switch (ob->type){ - case OB_MESH: - { - Mesh *me= ob->data; - EditMesh *em = BKE_mesh_get_editmesh(me); - - for (eve=em->verts.first; eve; eve=eve->next){ - dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); - - if (dvert && dvert->totweight){ - for (i=0; itotweight; i++){ - if (dvert->dw[i].def_nr == (ob->actdef-1)){ - if (select) eve->f |= SELECT; - else eve->f &= ~SELECT; - - break; - } - } - } - } - /* this has to be called, because this function operates on vertices only */ - if(select) EM_select_flush(em); // vertices to edges/faces - else EM_deselect_flush(em); - - BKE_mesh_end_editmesh(me, em); - } - break; - case OB_LATTICE: - { - Lattice *lt= def_get_lattice(ob); - - if(lt->dvert) { - BPoint *bp; - int a, tot; - - dvert= lt->dvert; - - tot= lt->pntsu*lt->pntsv*lt->pntsw; - for(a=0, bp= lt->def; atotweight; i++){ - if (dvert->dw[i].def_nr == (ob->actdef-1)) { - if(select) bp->f1 |= SELECT; - else bp->f1 &= ~SELECT; - - break; - } - } - } - } - } - break; - - default: - break; - } -} - -/* check if deform vertex has defgroup index */ -MDeformWeight *get_defweight (MDeformVert *dv, int defgroup) -{ - int i; - - if (!dv || defgroup<0) - return NULL; - - for (i=0; itotweight; i++){ - if (dv->dw[i].def_nr == defgroup) - return dv->dw+i; - } - return NULL; -} - -/* Ensures that mv has a deform weight entry for - the specified defweight group */ -/* Note this function is mirrored in editmesh_tools.c, for use for editvertices */ -MDeformWeight *verify_defweight (MDeformVert *dv, int defgroup) -{ - MDeformWeight *newdw; - - /* do this check always, this function is used to check for it */ - if (!dv || defgroup<0) - return NULL; - - newdw = get_defweight (dv, defgroup); - if (newdw) - return newdw; - - newdw = MEM_callocN (sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight"); - if (dv->dw){ - memcpy (newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight); - MEM_freeN (dv->dw); - } - dv->dw=newdw; - - dv->dw[dv->totweight].weight=0.0f; - dv->dw[dv->totweight].def_nr=defgroup; - /* Group index */ - - dv->totweight++; - - return dv->dw+(dv->totweight-1); -} - -bDeformGroup *add_defgroup_name (Object *ob, char *name) -{ - bDeformGroup *defgroup; - - if (!ob) - return NULL; - - defgroup = MEM_callocN (sizeof(bDeformGroup), "add deformGroup"); - - BLI_strncpy (defgroup->name, name, 32); - - BLI_addtail(&ob->defbase, defgroup); - unique_vertexgroup_name(defgroup, ob); - - ob->actdef = BLI_countlist(&ob->defbase); - - return defgroup; -} - -void add_defgroup (Object *ob) -{ - add_defgroup_name (ob, "Group"); -} - - -void duplicate_defgroup ( Object *ob ) -{ - bDeformGroup *dg, *cdg; - char name[32], s[32]; - MDeformWeight *org, *cpy; - MDeformVert *dvert, *dvert_array; - int i, idg, icdg, dvert_tot; - - if (ob->type != OB_MESH && ob->type != OB_LATTICE) - return; - - dg = BLI_findlink (&ob->defbase, (ob->actdef-1)); - if (!dg) - return; - - if (strstr(dg->name, "_copy")) { - BLI_strncpy (name, dg->name, 32); /* will be renamed _copy.001... etc */ - } else { - BLI_snprintf (name, 32, "%s_copy", dg->name); - while (get_named_vertexgroup (ob, name)) { - if ((strlen (name) + 6) > 32) { - error ("Error: the name for the new group is > 32 characters"); - return; - } - strcpy (s, name); - BLI_snprintf (name, 32, "%s_copy", s); - } - } - - cdg = copy_defgroup (dg); - strcpy (cdg->name, name); - unique_vertexgroup_name(cdg, ob); - - BLI_addtail (&ob->defbase, cdg); - - idg = (ob->actdef-1); - ob->actdef = BLI_countlist (&ob->defbase); - icdg = (ob->actdef-1); - - if(ob->type == OB_MESH) { - Mesh *me = get_mesh (ob); - dvert_array= me->dvert; - dvert_tot= me->totvert; - } - else if (ob->type == OB_LATTICE) { - Lattice *lt= (Lattice *)ob->data; - dvert_array= lt->dvert; - dvert_tot= lt->pntsu*lt->pntsv*lt->pntsw; - } - - if (!dvert_array) - return; - - for (i = 0; i < dvert_tot; i++) { - dvert = dvert_array+i; - org = get_defweight (dvert, idg); - if (org) { - float weight = org->weight; - /* verify_defweight re-allocs org so need to store the weight first */ - cpy = verify_defweight (dvert, icdg); - cpy->weight = weight; - } - } -} - -static void del_defgroup_update_users(Object *ob, int id) -{ - ExplodeModifierData *emd; - ModifierData *md; - ParticleSystem *psys; - ClothModifierData *clmd; - ClothSimSettings *clsim; - int a; - - /* these cases don't use names to refer to vertex groups, so when - * they get deleted the numbers get out of sync, this corrects that */ - - if(ob->soft) { - if(ob->soft->vertgroup == id) - ob->soft->vertgroup= 0; - else if(ob->soft->vertgroup > id) - ob->soft->vertgroup--; - } - - for(md=ob->modifiers.first; md; md=md->next) { - if(md->type == eModifierType_Explode) { - emd= (ExplodeModifierData*)md; - - if(emd->vgroup == id) - emd->vgroup= 0; - else if(emd->vgroup > id) - emd->vgroup--; - } - else if(md->type == eModifierType_Cloth) { - clmd= (ClothModifierData*)md; - clsim= clmd->sim_parms; - - if(clsim) { - if(clsim->vgroup_mass == id) - clsim->vgroup_mass= 0; - else if(clsim->vgroup_mass > id) - clsim->vgroup_mass--; - - if(clsim->vgroup_bend == id) - clsim->vgroup_bend= 0; - else if(clsim->vgroup_bend > id) - clsim->vgroup_bend--; - - if(clsim->vgroup_struct == id) - clsim->vgroup_struct= 0; - else if(clsim->vgroup_struct > id) - clsim->vgroup_struct--; - } - } - } - - for(psys=ob->particlesystem.first; psys; psys=psys->next) { - for(a=0; avgroup[a] == id) - psys->vgroup[a]= 0; - else if(psys->vgroup[a] > id) - psys->vgroup[a]--; - } -} - -void del_defgroup_in_object_mode ( Object *ob ) -{ - bDeformGroup *dg; - MDeformVert *dvert_array, *dvert; - - int i, e, dvert_tot; - - if ((!ob) || (ob->type != OB_MESH && ob->type != OB_LATTICE)) - return; - - if(ob->type == OB_MESH) { - Mesh *me = get_mesh (ob); - dvert_array= me->dvert; - dvert_tot= me->totvert; - } - else if (ob->type == OB_LATTICE) { - Lattice *lt= (Lattice *)ob->data; - dvert_array= lt->dvert; - dvert_tot= lt->pntsu*lt->pntsv*lt->pntsw; - } - - dg = BLI_findlink (&ob->defbase, (ob->actdef-1)); - if (!dg) - return; - - if (dvert_array) { - for (i = 0; i < dvert_tot; i++) { - dvert = dvert_array + i; - if (dvert) { - if (get_defweight (dvert, (ob->actdef-1))) - remove_vert_defgroup (ob, dg, i); - } - } - - for (i = 0; i < dvert_tot; i++) { - dvert = dvert_array+i; - if (dvert) { - for (e = 0; e < dvert->totweight; e++) { - if (dvert->dw[e].def_nr > (ob->actdef-1)) - dvert->dw[e].def_nr--; - } - } - } - } - - del_defgroup_update_users(ob, ob->actdef); - - /* Update the active deform index if necessary */ - if (ob->actdef == BLI_countlist(&ob->defbase)) - ob->actdef--; - - /* Remove the group */ - BLI_freelinkN (&ob->defbase, dg); -} - -void del_defgroup (Object *ob) -{ - bDeformGroup *defgroup; - int i; - - if (!ob) - return; - - if (!ob->actdef) - return; - - defgroup = BLI_findlink(&ob->defbase, ob->actdef-1); - if (!defgroup) - return; - - /* Make sure that no verts are using this group */ - remove_verts_defgroup(ob, 1); - - /* Make sure that any verts with higher indices are adjusted accordingly */ - if(ob->type==OB_MESH) { - Mesh *me= ob->data; - EditMesh *em = BKE_mesh_get_editmesh(me); - EditVert *eve; - MDeformVert *dvert; - - for (eve=em->verts.first; eve; eve=eve->next){ - dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); - - if (dvert) - for (i=0; itotweight; i++) - if (dvert->dw[i].def_nr > (ob->actdef-1)) - dvert->dw[i].def_nr--; - } - BKE_mesh_end_editmesh(me, em); - } - else if(ob->type==OB_LATTICE) { - Lattice *lt= def_get_lattice(ob); - BPoint *bp; - MDeformVert *dvert= lt->dvert; - int a, tot; - - if (dvert) { - tot= lt->pntsu*lt->pntsv*lt->pntsw; - for(a=0, bp= lt->def; atotweight; i++){ - if (dvert->dw[i].def_nr > (ob->actdef-1)) - dvert->dw[i].def_nr--; - } - } - } - } - - del_defgroup_update_users(ob, ob->actdef); - - /* Update the active deform index if necessary */ - if (ob->actdef==BLI_countlist(&ob->defbase)) - ob->actdef--; - - /* Remove the group */ - BLI_freelinkN (&ob->defbase, defgroup); - - /* remove all dverts */ - if(ob->actdef==0) { - if(ob->type==OB_MESH) { - Mesh *me= ob->data; - CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert); - me->dvert= NULL; - } - else if(ob->type==OB_LATTICE) { - Lattice *lt= def_get_lattice(ob); - if (lt->dvert) { - MEM_freeN(lt->dvert); - lt->dvert= NULL; - } - } - } -} - -void del_all_defgroups (Object *ob) -{ - /* Sanity check */ - if (ob == NULL) - return; - - /* Remove all DVerts */ - if (ob->type==OB_MESH) { - Mesh *me= ob->data; - CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert); - me->dvert= NULL; - } - else if(ob->type==OB_LATTICE) { - Lattice *lt= def_get_lattice(ob); - if (lt->dvert) { - MEM_freeN(lt->dvert); - lt->dvert= NULL; - } - } - - /* Remove all DefGroups */ - BLI_freelistN(&ob->defbase); - - /* Fix counters/indices */ - ob->actdef= 0; -} - -void create_dverts(ID *id) -{ - /* create deform verts - */ - - if( GS(id->name)==ID_ME) { - Mesh *me= (Mesh *)id; - me->dvert= CustomData_add_layer(&me->vdata, CD_MDEFORMVERT, CD_CALLOC, NULL, me->totvert); - } - else if( GS(id->name)==ID_LT) { - Lattice *lt= (Lattice *)id; - lt->dvert= MEM_callocN(sizeof(MDeformVert)*lt->pntsu*lt->pntsv*lt->pntsw, "lattice deformVert"); - } -} - -/* for mesh in object mode - lattice can be in editmode */ -void remove_vert_def_nr (Object *ob, int def_nr, int vertnum) -{ - /* This routine removes the vertex from the deform - * group with number def_nr. - * - * This routine is meant to be fast, so it is the - * responsibility of the calling routine to: - * a) test whether ob is non-NULL - * b) test whether ob is a mesh - * c) calculate def_nr - */ - - MDeformWeight *newdw; - MDeformVert *dvert= NULL; - int i; - - /* get the deform vertices corresponding to the - * vertnum - */ - if(ob->type==OB_MESH) { - if( ((Mesh*)ob->data)->dvert ) - dvert = ((Mesh*)ob->data)->dvert + vertnum; - } - else if(ob->type==OB_LATTICE) { - Lattice *lt= def_get_lattice(ob); - - if(lt->dvert) - dvert = lt->dvert + vertnum; - } - - if(dvert==NULL) - return; - - /* for all of the deform weights in the - * deform vert - */ - for (i=dvert->totweight - 1 ; i>=0 ; i--){ - - /* if the def_nr is the same as the one - * for our weight group then remove it - * from this deform vert. - */ - if (dvert->dw[i].def_nr == def_nr) { - dvert->totweight--; - - /* if there are still other deform weights - * attached to this vert then remove this - * deform weight, and reshuffle the others - */ - if (dvert->totweight) { - newdw = MEM_mallocN (sizeof(MDeformWeight)*(dvert->totweight), - "deformWeight"); - if (dvert->dw){ - memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*i); - memcpy (newdw+i, dvert->dw+i+1, - sizeof(MDeformWeight)*(dvert->totweight-i)); - MEM_freeN (dvert->dw); - } - dvert->dw=newdw; - } - /* if there are no other deform weights - * left then just remove the deform weight - */ - else { - MEM_freeN (dvert->dw); - dvert->dw = NULL; - break; - } - } - } - -} - -/* for Mesh in Object mode */ -/* allows editmode for Lattice */ -void add_vert_defnr (Object *ob, int def_nr, int vertnum, - float weight, int assignmode) -{ - /* add the vert to the deform group with the - * specified number - */ - MDeformVert *dv= NULL; - MDeformWeight *newdw; - int i; - - /* get the vert */ - if(ob->type==OB_MESH) { - if(((Mesh*)ob->data)->dvert) - dv = ((Mesh*)ob->data)->dvert + vertnum; - } - else if(ob->type==OB_LATTICE) { - Lattice *lt= def_get_lattice(ob); - - if(lt->dvert) - dv = lt->dvert + vertnum; - } - - if(dv==NULL) - return; - - /* Lets first check to see if this vert is - * already in the weight group -- if so - * lets update it - */ - for (i=0; itotweight; i++){ - - /* if this weight cooresponds to the - * deform group, then add it using - * the assign mode provided - */ - if (dv->dw[i].def_nr == def_nr){ - - switch (assignmode) { - case WEIGHT_REPLACE: - dv->dw[i].weight=weight; - break; - case WEIGHT_ADD: - dv->dw[i].weight+=weight; - if (dv->dw[i].weight >= 1.0) - dv->dw[i].weight = 1.0; - break; - case WEIGHT_SUBTRACT: - dv->dw[i].weight-=weight; - /* if the weight is zero or less then - * remove the vert from the deform group - */ - if (dv->dw[i].weight <= 0.0) - remove_vert_def_nr(ob, def_nr, vertnum); - break; - } - return; - } - } - - /* if the vert wasn't in the deform group then - * we must take a different form of action ... - */ - - switch (assignmode) { - case WEIGHT_SUBTRACT: - /* if we are subtracting then we don't - * need to do anything - */ - return; - - case WEIGHT_REPLACE: - case WEIGHT_ADD: - /* if we are doing an additive assignment, then - * we need to create the deform weight - */ - newdw = MEM_callocN (sizeof(MDeformWeight)*(dv->totweight+1), - "deformWeight"); - if (dv->dw){ - memcpy (newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight); - MEM_freeN (dv->dw); - } - dv->dw=newdw; - - dv->dw[dv->totweight].weight=weight; - dv->dw[dv->totweight].def_nr=def_nr; - - dv->totweight++; - break; - } -} - -/* called while not in editmode */ -void add_vert_to_defgroup (Object *ob, bDeformGroup *dg, int vertnum, - float weight, int assignmode) -{ - /* add the vert to the deform group with the - * specified assign mode - */ - int def_nr; - - /* get the deform group number, exit if - * it can't be found - */ - def_nr = get_defgroup_num(ob, dg); - if (def_nr < 0) return; - - /* if there's no deform verts then - * create some - */ - if(ob->type==OB_MESH) { - if (!((Mesh*)ob->data)->dvert) - create_dverts(ob->data); - } - else if(ob->type==OB_LATTICE) { - if (!((Lattice*)ob->data)->dvert) - create_dverts(ob->data); - } - - /* call another function to do the work - */ - add_vert_defnr (ob, def_nr, vertnum, weight, assignmode); -} - -/* Only available in editmode */ -void assign_verts_defgroup (Object *obedit, float weight) -{ - Object *ob; - EditVert *eve; - bDeformGroup *dg, *eg; - MDeformWeight *newdw; - MDeformVert *dvert; - int i, done; - -// XXX if(multires_level1_test()) return; - - ob= obedit; - - if (!ob) - return; - - dg=BLI_findlink(&ob->defbase, ob->actdef-1); - if (!dg){ - error ("No vertex group is active"); - return; - } - - switch (ob->type){ - case OB_MESH: - { - Mesh *me= ob->data; - EditMesh *em = BKE_mesh_get_editmesh(me); - - if (!CustomData_has_layer(&em->vdata, CD_MDEFORMVERT)) - EM_add_data_layer(em, &em->vdata, CD_MDEFORMVERT); - - /* Go through the list of editverts and assign them */ - for (eve=em->verts.first; eve; eve=eve->next){ - dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); - - if (dvert && (eve->f & 1)){ - done=0; - /* See if this vert already has a reference to this group */ - /* If so: Change its weight */ - done=0; - for (i=0; itotweight; i++){ - eg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr); - /* Find the actual group */ - if (eg==dg){ - dvert->dw[i].weight= weight; - done=1; - break; - } - } - /* If not: Add the group and set its weight */ - if (!done){ - newdw = MEM_callocN (sizeof(MDeformWeight)*(dvert->totweight+1), "deformWeight"); - if (dvert->dw){ - memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*dvert->totweight); - MEM_freeN (dvert->dw); - } - dvert->dw=newdw; - - dvert->dw[dvert->totweight].weight= weight; - dvert->dw[dvert->totweight].def_nr= ob->actdef-1; - - dvert->totweight++; - - } - } - } - BKE_mesh_end_editmesh(me, em); - } - break; - case OB_LATTICE: - { - Lattice *lt= def_get_lattice(ob); - BPoint *bp; - int a, tot; - - if(lt->dvert==NULL) - create_dverts(<->id); - - tot= lt->pntsu*lt->pntsv*lt->pntsw; - for(a=0, bp= lt->def; af1 & SELECT) - add_vert_defnr (ob, ob->actdef-1, a, weight, WEIGHT_REPLACE); - } - } - break; - default: - printf ("Assigning deformation groups to unknown object type\n"); - break; - } - -} - -/* mesh object mode, lattice can be in editmode */ -void remove_vert_defgroup (Object *ob, bDeformGroup *dg, int vertnum) -{ - /* This routine removes the vertex from the specified - * deform group. - */ - - int def_nr; - - /* if the object is NULL abort - */ - if (!ob) - return; - - /* get the deform number that cooresponds - * to this deform group, and abort if it - * can not be found. - */ - def_nr = get_defgroup_num(ob, dg); - if (def_nr < 0) return; - - /* call another routine to do the work - */ - remove_vert_def_nr (ob, def_nr, vertnum); -} - -/* for mesh in object mode lattice can be in editmode */ -static float get_vert_def_nr (Object *ob, int def_nr, int vertnum) -{ - MDeformVert *dvert= NULL; - int i; - - /* get the deform vertices corresponding to the - * vertnum - */ - if(ob->type==OB_MESH) { - if( ((Mesh*)ob->data)->dvert ) - dvert = ((Mesh*)ob->data)->dvert + vertnum; - } - else if(ob->type==OB_LATTICE) { - Lattice *lt= def_get_lattice(ob); - - if(lt->dvert) - dvert = lt->dvert + vertnum; - } - - if(dvert==NULL) - return 0.0f; - - for(i=dvert->totweight-1 ; i>=0 ; i--) - if(dvert->dw[i].def_nr == def_nr) - return dvert->dw[i].weight; - - return 0.0f; -} - -/* mesh object mode, lattice can be in editmode */ -float get_vert_defgroup (Object *ob, bDeformGroup *dg, int vertnum) -{ - int def_nr; - - if(!ob) - return 0.0f; - - def_nr = get_defgroup_num(ob, dg); - if(def_nr < 0) return 0.0f; - - return get_vert_def_nr (ob, def_nr, vertnum); -} - -/* Only available in editmode */ -/* removes from active defgroup, if allverts==0 only selected vertices */ -void remove_verts_defgroup (Object *obedit, int allverts) -{ - Object *ob; - EditVert *eve; - MDeformVert *dvert; - MDeformWeight *newdw; - bDeformGroup *dg, *eg; - int i; - -// XXX if(multires_level1_test()) return; - - ob= obedit; - - if (!ob) - return; - - dg=BLI_findlink(&ob->defbase, ob->actdef-1); - if (!dg){ - error ("No vertex group is active"); - return; - } - - switch (ob->type){ - case OB_MESH: - { - Mesh *me= ob->data; - EditMesh *em = BKE_mesh_get_editmesh(me); - - for (eve=em->verts.first; eve; eve=eve->next){ - dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); - - if (dvert && dvert->dw && ((eve->f & 1) || allverts)){ - for (i=0; itotweight; i++){ - /* Find group */ - eg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr); - if (eg == dg){ - dvert->totweight--; - if (dvert->totweight){ - newdw = MEM_mallocN (sizeof(MDeformWeight)*(dvert->totweight), "deformWeight"); - - if (dvert->dw){ - memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*i); - memcpy (newdw+i, dvert->dw+i+1, sizeof(MDeformWeight)*(dvert->totweight-i)); - MEM_freeN (dvert->dw); - } - dvert->dw=newdw; - } - else{ - MEM_freeN (dvert->dw); - dvert->dw=NULL; - break; - } - } - } - } - } - BKE_mesh_end_editmesh(me, em); - } - break; - case OB_LATTICE: - { - Lattice *lt= def_get_lattice(ob); - - if(lt->dvert) { - BPoint *bp; - int a, tot= lt->pntsu*lt->pntsv*lt->pntsw; - - for(a=0, bp= lt->def; af1 & SELECT)) - remove_vert_defgroup (ob, dg, a); - } - } - } - break; - - default: - printf ("Removing deformation groups from unknown object type\n"); - break; - } -} - -/* Only available in editmode */ -/* removes from all defgroup, if allverts==0 only selected vertices */ -void remove_verts_defgroups(Object *obedit, int allverts) -{ - Object *ob; - int actdef, defCount; - -// XXX if (multires_level1_test()) return; - - ob= obedit; - if (ob == NULL) return; - - actdef= ob->actdef; - defCount= BLI_countlist(&ob->defbase); - - if (defCount == 0) { - error("Object has no vertex groups"); - return; - } - - /* To prevent code redundancy, we just use remove_verts_defgroup, but that - * only operates on the active vgroup. So we iterate through all groups, by changing - * active group index - */ - for (ob->actdef= 1; ob->actdef <= defCount; ob->actdef++) - remove_verts_defgroup(ob, allverts); - - ob->actdef= actdef; -} - -void vertexgroup_select_by_name(Object *ob, char *name) -{ - bDeformGroup *curdef; - int actdef= 1; - - if(ob==NULL) return; - - for (curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++){ - if (!strcmp(curdef->name, name)) { - ob->actdef= actdef; - return; - } - } - ob->actdef=0; // this signals on painting to create a new one, if a bone in posemode is selected */ -} - -/* This function provides a shortcut for adding/removing verts from - * vertex groups. It is called by the Ctrl-G hotkey in EditMode for Meshes - * and Lattices. (currently only restricted to those two) - * It is only responsible for - */ -void vgroup_assign_with_menu(Scene *scene, Object *ob) -{ - VPaint *wp= scene->toolsettings->wpaint; - int defCount; - int mode= 0; - - /* prevent crashes */ - if (wp==NULL || ob==NULL) return; - - defCount= BLI_countlist(&ob->defbase); - - /* give user choices of adding to current/new or removing from current */ -// XXX if (defCount && ob->actdef) -// mode = pupmenu("Vertex Groups %t|Add Selected to New Group %x1|Add Selected to Active Group %x2|Remove Selected from Active Group %x3|Remove Selected from All Groups %x4"); -// else -// mode= pupmenu("Vertex Groups %t|Add Selected to New Group %x1"); - - /* handle choices */ - switch (mode) { - case 1: /* add to new group */ - add_defgroup(ob); - assign_verts_defgroup(ob, wp->brush->alpha); - BIF_undo_push("Assign to vertex group"); - break; - case 2: /* add to current group */ - assign_verts_defgroup(ob, wp->brush->alpha); - BIF_undo_push("Assign to vertex group"); - break; - case 3: /* remove from current group */ - remove_verts_defgroup(ob, 0); - BIF_undo_push("Remove from vertex group"); - break; - case 4: /* remove from all groups */ - remove_verts_defgroups(ob, 0); - BIF_undo_push("Remove from all vertex groups"); - break; - } -} - -/* This function provides a shortcut for commonly used vertex group - * functions - change weight (not implemented), change active group, delete active group, - * when Ctrl-Shift-G is used in EditMode, for Meshes and Lattices (only for now). - */ -void vgroup_operation_with_menu(Object *ob) -{ - int defCount; - int mode= 0; - - /* prevent crashes and useless cases */ - if (ob==NULL) return; - - defCount= BLI_countlist(&ob->defbase); - if (defCount == 0) return; - - /* give user choices of adding to current/new or removing from current */ -// XXX if (ob->actdef) -// mode = pupmenu("Vertex Groups %t|Change Active Group%x1|Delete Active Group%x2|Delete All Groups%x3"); -// else -// mode= pupmenu("Vertex Groups %t|Change Active Group%x1|Delete All Groups%x3"); - - /* handle choices */ - switch (mode) { - case 1: /* change active group*/ - { - char *menustr= NULL; // XXX get_vertexgroup_menustr(ob); - short nr; - - if (menustr) { -// XXX nr= pupmenu(menustr); - - if ((nr >= 1) && (nr <= defCount)) - ob->actdef= nr; - - MEM_freeN(menustr); - } - } - break; - case 2: /* delete active group */ - { - del_defgroup(ob); - BIF_undo_push("Delete vertex group"); - } - break; - case 3: /* delete all groups */ - { - del_all_defgroups(ob); - BIF_undo_push("Delete all vertex groups"); - } - break; - } -} - - diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 83a4211dda1..22e3b4060a4 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -234,5 +234,14 @@ void MESH_OT_colors_mirror(struct wmOperatorType *ot); void MESH_OT_delete(struct wmOperatorType *ot); void MESH_OT_rip(struct wmOperatorType *ot); +/* ******************* mesh_layers.c */ + +void MESH_OT_uv_texture_add(struct wmOperatorType *ot); +void MESH_OT_uv_texture_remove(struct wmOperatorType *ot); +void MESH_OT_vertex_color_add(struct wmOperatorType *ot); +void MESH_OT_vertex_color_remove(struct wmOperatorType *ot); +void MESH_OT_sticky_add(struct wmOperatorType *ot); +void MESH_OT_sticky_remove(struct wmOperatorType *ot); + #endif // MESH_INTERN_H diff --git a/source/blender/editors/mesh/mesh_layers.c b/source/blender/editors/mesh/mesh_layers.c new file mode 100644 index 00000000000..99d50d1a9b0 --- /dev/null +++ b/source/blender/editors/mesh/mesh_layers.c @@ -0,0 +1,424 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "MEM_guardedalloc.h" + +#include "DNA_customdata_types.h" +#include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" +#include "DNA_object_types.h" +#include "DNA_scene_types.h" +#include "DNA_windowmanager_types.h" + +#include "BKE_context.h" +#include "BKE_customdata.h" +#include "BKE_depsgraph.h" +#include "BKE_displist.h" +#include "BKE_global.h" +#include "BKE_mesh.h" + +#include "BLI_editVert.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "ED_mesh.h" +#include "ED_view3d.h" + +#include "mesh_intern.h" + +static void delete_customdata_layer(Mesh *me, CustomDataLayer *layer) +{ + CustomData *data= (me->edit_mesh)? &me->edit_mesh->fdata: &me->fdata; + void *actlayerdata, *rndlayerdata, *clonelayerdata, *masklayerdata, *layerdata=layer->data; + int type= layer->type; + int index= CustomData_get_layer_index(data, type); + int i, actindex, rndindex, cloneindex, maskindex; + + /* ok, deleting a non-active layer needs to preserve the active layer indices. + to do this, we store a pointer to the .data member of both layer and the active layer, + (to detect if we're deleting the active layer or not), then use the active + layer data pointer to find where the active layer has ended up. + + this is necassary because the deletion functions only support deleting the active + layer. */ + actlayerdata = data->layers[CustomData_get_active_layer_index(data, type)].data; + rndlayerdata = data->layers[CustomData_get_render_layer_index(data, type)].data; + clonelayerdata = data->layers[CustomData_get_clone_layer_index(data, type)].data; + masklayerdata = data->layers[CustomData_get_mask_layer_index(data, type)].data; + CustomData_set_layer_active(data, type, layer - &data->layers[index]); + + if(me->edit_mesh) { + EM_free_data_layer(me->edit_mesh, data, type); + } + else { + CustomData_free_layer_active(data, type, me->totface); + mesh_update_customdata_pointers(me); + } + + if(!CustomData_has_layer(data, type)) + if(type == CD_MCOL && (G.f & G_VERTEXPAINT)) + G.f &= ~G_VERTEXPAINT; /* get out of vertexpaint mode */ + + /* reconstruct active layer */ + if (actlayerdata != layerdata) { + /* find index */ + actindex = CustomData_get_layer_index(data, type); + for (i=actindex; itotlayer; i++) { + if (data->layers[i].data == actlayerdata) { + actindex = i - actindex; + break; + } + } + + /* set index */ + CustomData_set_layer_active(data, type, actindex); + } + + if (rndlayerdata != layerdata) { + /* find index */ + rndindex = CustomData_get_layer_index(data, type); + for (i=rndindex; itotlayer; i++) { + if (data->layers[i].data == rndlayerdata) { + rndindex = i - rndindex; + break; + } + } + + /* set index */ + CustomData_set_layer_render(data, type, rndindex); + } + + if (clonelayerdata != layerdata) { + /* find index */ + cloneindex = CustomData_get_layer_index(data, type); + for (i=cloneindex; itotlayer; i++) { + if (data->layers[i].data == clonelayerdata) { + cloneindex = i - cloneindex; + break; + } + } + + /* set index */ + CustomData_set_layer_clone(data, type, cloneindex); + } + + if (masklayerdata != layerdata) { + /* find index */ + maskindex = CustomData_get_layer_index(data, type); + for (i=maskindex; itotlayer; i++) { + if (data->layers[i].data == masklayerdata) { + maskindex = i - maskindex; + break; + } + } + + /* set index */ + CustomData_set_layer_mask(data, type, maskindex); + } +} + +/*********************** UV texture operators ************************/ + +static int uv_texture_add_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Mesh *me; + EditMesh *em; + int layernum; + + if(!ob || ob->type!=OB_MESH) + return OPERATOR_CANCELLED; + + me= (Mesh*)ob->data; + + if(scene->obedit == ob) { + em= me->edit_mesh; + + layernum= CustomData_number_of_layers(&em->fdata, CD_MTFACE); + if(layernum >= MAX_MTFACE) + return OPERATOR_CANCELLED; + + EM_add_data_layer(em, &em->fdata, CD_MTFACE); + CustomData_set_layer_active(&em->fdata, CD_MTFACE, layernum); + } + else if(ob) { + layernum= CustomData_number_of_layers(&me->fdata, CD_MTFACE); + if(layernum >= MAX_MTFACE) + return OPERATOR_CANCELLED; + + if(me->mtface) + CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DUPLICATE, me->mtface, me->totface); + else + CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT, NULL, me->totface); + + CustomData_set_layer_active(&me->fdata, CD_MTFACE, layernum); + mesh_update_customdata_pointers(me); + } + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void MESH_OT_uv_texture_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add UV Texture"; + ot->idname= "MESH_OT_uv_texture_add"; + + /* api callbacks */ + ot->exec= uv_texture_add_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int uv_texture_remove_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Mesh *me; + CustomDataLayer *cdl; + int index; + + if(!ob || ob->type!=OB_MESH) + return OPERATOR_CANCELLED; + + me= (Mesh*)ob->data; + index= CustomData_get_active_layer_index(&me->fdata, CD_MTFACE); + cdl= (index == -1)? NULL: &me->fdata.layers[index]; + + if(!cdl) + return OPERATOR_CANCELLED; + + delete_customdata_layer(me, cdl); + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void MESH_OT_uv_texture_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove UV Texture"; + ot->idname= "MESH_OT_uv_texture_remove"; + + /* api callbacks */ + ot->exec= uv_texture_remove_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/*********************** vertex color operators ************************/ + +static int vertex_color_add_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Mesh *me; + EditMesh *em; + MCol *mcol; + int layernum; + + if(!ob || ob->type!=OB_MESH) + return OPERATOR_CANCELLED; + + me= (Mesh*)ob->data; + + if(scene->obedit == ob) { + em= me->edit_mesh; + + layernum= CustomData_number_of_layers(&em->fdata, CD_MCOL); + if(layernum >= MAX_MCOL) + return OPERATOR_CANCELLED; + + EM_add_data_layer(em, &em->fdata, CD_MCOL); + CustomData_set_layer_active(&em->fdata, CD_MCOL, layernum); + } + else { + layernum= CustomData_number_of_layers(&me->fdata, CD_MCOL); + if(layernum >= MAX_MCOL) + return OPERATOR_CANCELLED; + + mcol= me->mcol; + + if(me->mcol) + CustomData_add_layer(&me->fdata, CD_MCOL, CD_DUPLICATE, me->mcol, me->totface); + else + CustomData_add_layer(&me->fdata, CD_MCOL, CD_DEFAULT, NULL, me->totface); + + CustomData_set_layer_active(&me->fdata, CD_MCOL, layernum); + mesh_update_customdata_pointers(me); + + if(!mcol) + shadeMeshMCol(scene, ob, me); + } + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void MESH_OT_vertex_color_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Vertex Color"; + ot->idname= "MESH_OT_vertex_color_add"; + + /* api callbacks */ + ot->exec= vertex_color_add_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_color_remove_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Mesh *me; + CustomDataLayer *cdl; + int index; + + if(!ob || ob->type!=OB_MESH) + return OPERATOR_CANCELLED; + + me= (Mesh*)ob->data; + index= CustomData_get_active_layer_index(&me->fdata, CD_MCOL); + cdl= (index == -1)? NULL: &me->fdata.layers[index]; + + if(!cdl) + return OPERATOR_CANCELLED; + + delete_customdata_layer(me, cdl); + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void MESH_OT_vertex_color_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Vertex Color"; + ot->idname= "MESH_OT_vertex_color_remove"; + + /* api callbacks */ + ot->exec= vertex_color_remove_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/*********************** sticky operators ************************/ + +static int sticky_add_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Mesh *me; + + if(!ob || ob->type!=OB_MESH) + return OPERATOR_CANCELLED; + + me= (Mesh*)ob->data; + + if(me->msticky) + return OPERATOR_CANCELLED; + + // XXX RE_make_sticky(); + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void MESH_OT_sticky_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Sticky"; + ot->idname= "MESH_OT_sticky_add"; + + /* api callbacks */ + ot->exec= sticky_add_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int sticky_remove_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Mesh *me; + + if(!ob || ob->type!=OB_MESH) + return OPERATOR_CANCELLED; + + me= (Mesh*)ob->data; + + if(!me->msticky) + return OPERATOR_CANCELLED; + + CustomData_free_layer_active(&me->vdata, CD_MSTICKY, me->totvert); + me->msticky= NULL; + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void MESH_OT_sticky_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Sticky"; + ot->idname= "MESH_OT_sticky_remove"; + + /* api callbacks */ + ot->exec= sticky_remove_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 5a86180a60f..2a9357ed0f0 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -183,6 +183,12 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_knife_cut); WM_operatortype_append(MESH_OT_rip); + WM_operatortype_append(MESH_OT_uv_texture_add); + WM_operatortype_append(MESH_OT_uv_texture_remove); + WM_operatortype_append(MESH_OT_vertex_color_add); + WM_operatortype_append(MESH_OT_vertex_color_remove); + WM_operatortype_append(MESH_OT_sticky_add); + WM_operatortype_append(MESH_OT_sticky_remove); } /* note mesh keymap also for other space? */ diff --git a/source/blender/editors/object/editkey.c b/source/blender/editors/object/editkey.c index 913046c5ab8..1c31c7c7653 100644 --- a/source/blender/editors/object/editkey.c +++ b/source/blender/editors/object/editkey.c @@ -55,6 +55,7 @@ #include "BKE_action.h" #include "BKE_anim.h" +#include "BKE_context.h" #include "BKE_curve.h" #include "BKE_depsgraph.h" #include "BKE_global.h" @@ -70,11 +71,15 @@ #include "ED_object.h" +#include "RNA_access.h" + +#include "WM_api.h" +#include "WM_types.h" + #include "object_intern.h" /* XXX */ static void BIF_undo_push() {} -static void error() {} /* XXX */ #if 0 // XXX old animation system @@ -394,25 +399,6 @@ void insert_curvekey(Scene *scene, Curve *cu, short rel) /* ******************** */ -void insert_shapekey(Scene *scene, Object *ob) -{ - if(get_mesh(ob) && get_mesh(ob)->mr) { - error("Cannot create shape keys on a multires mesh."); - } - else { - Key *key; - - if(ob->type==OB_MESH) insert_meshkey(scene, ob->data, 1); - else if ELEM(ob->type, OB_CURVE, OB_SURF) insert_curvekey(scene, ob->data, 1); - else if(ob->type==OB_LATTICE) insert_lattkey(scene, ob->data, 1); - - key= ob_get_key(ob); - ob->shapenr= BLI_countlist(&key->block); - - BIF_undo_push("Add Shapekey"); - } -} - void delete_key(Scene *scene, Object *ob) { KeyBlock *kb, *rkb; @@ -473,6 +459,123 @@ void delete_key(Scene *scene, Object *ob) BIF_undo_push("Delete Shapekey"); } +/********************** shape key operators *********************/ + +static int shape_key_add_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Key *key; + + if(!ob) + return OPERATOR_CANCELLED; + + if(ob->type==OB_MESH) insert_meshkey(scene, ob->data, 1); + else if ELEM(ob->type, OB_CURVE, OB_SURF) insert_curvekey(scene, ob->data, 1); + else if(ob->type==OB_LATTICE) insert_lattkey(scene, ob->data, 1); + + key= ob_get_key(ob); + ob->shapenr= BLI_countlist(&key->block); + + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_shape_key_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Shape Key"; + ot->idname= "OBJECT_OT_shape_key_add"; + + /* api callbacks */ + ot->exec= shape_key_add_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int shape_key_remove_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Scene *scene= CTX_data_scene(C); + Main *bmain= CTX_data_main(C); + KeyBlock *kb, *rkb; + Key *key; + //IpoCurve *icu; + + if(!ob) + return OPERATOR_CANCELLED; + + key= ob_get_key(ob); + if(key==NULL) + return OPERATOR_CANCELLED; + + kb= BLI_findlink(&key->block, ob->shapenr-1); + + if(kb) { + for(rkb= key->block.first; rkb; rkb= rkb->next) + if(rkb->relative == ob->shapenr-1) + rkb->relative= 0; + + BLI_remlink(&key->block, kb); + key->totkey--; + if(key->refkey== kb) + key->refkey= key->block.first; + + if(kb->data) MEM_freeN(kb->data); + MEM_freeN(kb); + + for(kb= key->block.first; kb; kb= kb->next) + if(kb->adrcode>=ob->shapenr) + kb->adrcode--; + +#if 0 // XXX old animation system + if(key->ipo) { + + for(icu= key->ipo->curve.first; icu; icu= icu->next) { + if(icu->adrcode==ob->shapenr-1) { + BLI_remlink(&key->ipo->curve, icu); + free_ipo_curve(icu); + break; + } + } + for(icu= key->ipo->curve.first; icu; icu= icu->next) + if(icu->adrcode>=ob->shapenr) + icu->adrcode--; + } +#endif // XXX old animation system + + if(ob->shapenr>1) ob->shapenr--; + } + + if(key->totkey==0) { + if(GS(key->from->name)==ID_ME) ((Mesh *)key->from)->key= NULL; + else if(GS(key->from->name)==ID_CU) ((Curve *)key->from)->key= NULL; + else if(GS(key->from->name)==ID_LT) ((Lattice *)key->from)->key= NULL; + + free_libblock_us(&(bmain->key), key); + } + + DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_shape_key_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Shape Key"; + ot->idname= "OBJECT_OT_shape_key_remove"; + + /* api callbacks */ + ot->exec= shape_key_remove_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + void move_keys(Object *ob) { #if 0 @@ -560,3 +663,4 @@ void move_keys(Object *ob) BIF_undo_push("Move Shapekey(s)"); #endif } + diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 1eb867e19a0..a52acdd4e1e 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -92,5 +92,19 @@ void OBJECT_OT_modifier_mdef_bind(struct wmOperatorType *ot); /* editconstraint.c */ void OBJECT_OT_constraint_add(struct wmOperatorType *ot); +/* object_vgroup.c */ +void OBJECT_OT_vertex_group_add(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_remove(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_assign(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_remove_from(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_select(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_deselect(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_copy_to_linked(struct wmOperatorType *ot); +void OBJECT_OT_vertex_group_copy(struct wmOperatorType *ot); + +/* editkey.c */ +void OBJECT_OT_shape_key_add(struct wmOperatorType *ot); +void OBJECT_OT_shape_key_remove(struct wmOperatorType *ot); + #endif /* ED_OBJECT_INTERN_H */ diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index cfee6a55152..6fa78a53840 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -104,6 +104,18 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_modifier_mdef_bind); WM_operatortype_append(OBJECT_OT_constraint_add); + + WM_operatortype_append(OBJECT_OT_vertex_group_add); + WM_operatortype_append(OBJECT_OT_vertex_group_remove); + WM_operatortype_append(OBJECT_OT_vertex_group_assign); + WM_operatortype_append(OBJECT_OT_vertex_group_remove_from); + WM_operatortype_append(OBJECT_OT_vertex_group_select); + WM_operatortype_append(OBJECT_OT_vertex_group_deselect); + WM_operatortype_append(OBJECT_OT_vertex_group_copy_to_linked); + WM_operatortype_append(OBJECT_OT_vertex_group_copy); + + WM_operatortype_append(OBJECT_OT_shape_key_add); + WM_operatortype_append(OBJECT_OT_shape_key_remove); } void ED_keymap_object(wmWindowManager *wm) diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c new file mode 100644 index 00000000000..fb71fc09108 --- /dev/null +++ b/source/blender/editors/object/object_vgroup.c @@ -0,0 +1,1344 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + * Creator-specific support for vertex deformation groups + * Added: apply deform function (ton) + */ + +#include + +#include "MEM_guardedalloc.h" + +#include "DNA_cloth_types.h" +#include "DNA_curve_types.h" +#include "DNA_lattice_types.h" +#include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" +#include "DNA_modifier_types.h" +#include "DNA_object_types.h" +#include "DNA_object_force.h" +#include "DNA_scene_types.h" +#include "DNA_particle_types.h" +#include "DNA_windowmanager_types.h" + +#include "BLI_blenlib.h" +#include "BLI_editVert.h" + +#include "BKE_context.h" +#include "BKE_customdata.h" +#include "BKE_deform.h" +#include "BKE_depsgraph.h" +#include "BKE_DerivedMesh.h" +#include "BKE_displist.h" +#include "BKE_global.h" +#include "BKE_lattice.h" +#include "BKE_mesh.h" +#include "BKE_utildefines.h" + +#include "RNA_access.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "ED_mesh.h" +#include "ED_view3d.h" + +#include "object_intern.h" + +/* XXX */ +static void BIF_undo_push() {} +static void error() {} + +static Lattice *def_get_lattice(Object *ob) +{ + if(ob->type==OB_LATTICE) { + Lattice *lt= ob->data; + if(lt->editlatt) + return lt->editlatt; + return lt; + } + return NULL; +} + +/* only in editmode */ +void sel_verts_defgroup (Object *obedit, int select) +{ + EditVert *eve; + Object *ob; + int i; + MDeformVert *dvert; + + ob= obedit; + + if (!ob) + return; + + switch (ob->type){ + case OB_MESH: + { + Mesh *me= ob->data; + EditMesh *em = BKE_mesh_get_editmesh(me); + + for (eve=em->verts.first; eve; eve=eve->next){ + dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); + + if (dvert && dvert->totweight){ + for (i=0; itotweight; i++){ + if (dvert->dw[i].def_nr == (ob->actdef-1)){ + if (select) eve->f |= SELECT; + else eve->f &= ~SELECT; + + break; + } + } + } + } + /* this has to be called, because this function operates on vertices only */ + if(select) EM_select_flush(em); // vertices to edges/faces + else EM_deselect_flush(em); + + BKE_mesh_end_editmesh(me, em); + } + break; + case OB_LATTICE: + { + Lattice *lt= def_get_lattice(ob); + + if(lt->dvert) { + BPoint *bp; + int a, tot; + + dvert= lt->dvert; + + tot= lt->pntsu*lt->pntsv*lt->pntsw; + for(a=0, bp= lt->def; atotweight; i++){ + if (dvert->dw[i].def_nr == (ob->actdef-1)) { + if(select) bp->f1 |= SELECT; + else bp->f1 &= ~SELECT; + + break; + } + } + } + } + } + break; + + default: + break; + } +} + +/* check if deform vertex has defgroup index */ +MDeformWeight *get_defweight (MDeformVert *dv, int defgroup) +{ + int i; + + if (!dv || defgroup<0) + return NULL; + + for (i=0; itotweight; i++){ + if (dv->dw[i].def_nr == defgroup) + return dv->dw+i; + } + return NULL; +} + +/* Ensures that mv has a deform weight entry for + the specified defweight group */ +/* Note this function is mirrored in editmesh_tools.c, for use for editvertices */ +MDeformWeight *verify_defweight (MDeformVert *dv, int defgroup) +{ + MDeformWeight *newdw; + + /* do this check always, this function is used to check for it */ + if (!dv || defgroup<0) + return NULL; + + newdw = get_defweight (dv, defgroup); + if (newdw) + return newdw; + + newdw = MEM_callocN (sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight"); + if (dv->dw){ + memcpy (newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight); + MEM_freeN (dv->dw); + } + dv->dw=newdw; + + dv->dw[dv->totweight].weight=0.0f; + dv->dw[dv->totweight].def_nr=defgroup; + /* Group index */ + + dv->totweight++; + + return dv->dw+(dv->totweight-1); +} + +bDeformGroup *add_defgroup_name (Object *ob, char *name) +{ + bDeformGroup *defgroup; + + if (!ob) + return NULL; + + defgroup = MEM_callocN (sizeof(bDeformGroup), "add deformGroup"); + + BLI_strncpy (defgroup->name, name, 32); + + BLI_addtail(&ob->defbase, defgroup); + unique_vertexgroup_name(defgroup, ob); + + ob->actdef = BLI_countlist(&ob->defbase); + + return defgroup; +} + +void add_defgroup (Object *ob) +{ + add_defgroup_name (ob, "Group"); +} + + +void duplicate_defgroup ( Object *ob ) +{ + bDeformGroup *dg, *cdg; + char name[32], s[32]; + MDeformWeight *org, *cpy; + MDeformVert *dvert, *dvert_array; + int i, idg, icdg, dvert_tot; + + if (ob->type != OB_MESH && ob->type != OB_LATTICE) + return; + + dg = BLI_findlink (&ob->defbase, (ob->actdef-1)); + if (!dg) + return; + + if (strstr(dg->name, "_copy")) { + BLI_strncpy (name, dg->name, 32); /* will be renamed _copy.001... etc */ + } else { + BLI_snprintf (name, 32, "%s_copy", dg->name); + while (get_named_vertexgroup (ob, name)) { + if ((strlen (name) + 6) > 32) { + error ("Error: the name for the new group is > 32 characters"); + return; + } + strcpy (s, name); + BLI_snprintf (name, 32, "%s_copy", s); + } + } + + cdg = copy_defgroup (dg); + strcpy (cdg->name, name); + unique_vertexgroup_name(cdg, ob); + + BLI_addtail (&ob->defbase, cdg); + + idg = (ob->actdef-1); + ob->actdef = BLI_countlist (&ob->defbase); + icdg = (ob->actdef-1); + + if(ob->type == OB_MESH) { + Mesh *me = get_mesh (ob); + dvert_array= me->dvert; + dvert_tot= me->totvert; + } + else if (ob->type == OB_LATTICE) { + Lattice *lt= (Lattice *)ob->data; + dvert_array= lt->dvert; + dvert_tot= lt->pntsu*lt->pntsv*lt->pntsw; + } + + if (!dvert_array) + return; + + for (i = 0; i < dvert_tot; i++) { + dvert = dvert_array+i; + org = get_defweight (dvert, idg); + if (org) { + float weight = org->weight; + /* verify_defweight re-allocs org so need to store the weight first */ + cpy = verify_defweight (dvert, icdg); + cpy->weight = weight; + } + } +} + +static void del_defgroup_update_users(Object *ob, int id) +{ + ExplodeModifierData *emd; + ModifierData *md; + ParticleSystem *psys; + ClothModifierData *clmd; + ClothSimSettings *clsim; + int a; + + /* these cases don't use names to refer to vertex groups, so when + * they get deleted the numbers get out of sync, this corrects that */ + + if(ob->soft) { + if(ob->soft->vertgroup == id) + ob->soft->vertgroup= 0; + else if(ob->soft->vertgroup > id) + ob->soft->vertgroup--; + } + + for(md=ob->modifiers.first; md; md=md->next) { + if(md->type == eModifierType_Explode) { + emd= (ExplodeModifierData*)md; + + if(emd->vgroup == id) + emd->vgroup= 0; + else if(emd->vgroup > id) + emd->vgroup--; + } + else if(md->type == eModifierType_Cloth) { + clmd= (ClothModifierData*)md; + clsim= clmd->sim_parms; + + if(clsim) { + if(clsim->vgroup_mass == id) + clsim->vgroup_mass= 0; + else if(clsim->vgroup_mass > id) + clsim->vgroup_mass--; + + if(clsim->vgroup_bend == id) + clsim->vgroup_bend= 0; + else if(clsim->vgroup_bend > id) + clsim->vgroup_bend--; + + if(clsim->vgroup_struct == id) + clsim->vgroup_struct= 0; + else if(clsim->vgroup_struct > id) + clsim->vgroup_struct--; + } + } + } + + for(psys=ob->particlesystem.first; psys; psys=psys->next) { + for(a=0; avgroup[a] == id) + psys->vgroup[a]= 0; + else if(psys->vgroup[a] > id) + psys->vgroup[a]--; + } +} + +void del_defgroup_in_object_mode ( Object *ob ) +{ + bDeformGroup *dg; + MDeformVert *dvert_array, *dvert; + + int i, e, dvert_tot; + + if ((!ob) || (ob->type != OB_MESH && ob->type != OB_LATTICE)) + return; + + if(ob->type == OB_MESH) { + Mesh *me = get_mesh (ob); + dvert_array= me->dvert; + dvert_tot= me->totvert; + } + else if (ob->type == OB_LATTICE) { + Lattice *lt= (Lattice *)ob->data; + dvert_array= lt->dvert; + dvert_tot= lt->pntsu*lt->pntsv*lt->pntsw; + } + + dg = BLI_findlink (&ob->defbase, (ob->actdef-1)); + if (!dg) + return; + + if (dvert_array) { + for (i = 0; i < dvert_tot; i++) { + dvert = dvert_array + i; + if (dvert) { + if (get_defweight (dvert, (ob->actdef-1))) + remove_vert_defgroup (ob, dg, i); + } + } + + for (i = 0; i < dvert_tot; i++) { + dvert = dvert_array+i; + if (dvert) { + for (e = 0; e < dvert->totweight; e++) { + if (dvert->dw[e].def_nr > (ob->actdef-1)) + dvert->dw[e].def_nr--; + } + } + } + } + + del_defgroup_update_users(ob, ob->actdef); + + /* Update the active deform index if necessary */ + if (ob->actdef == BLI_countlist(&ob->defbase)) + ob->actdef--; + + /* Remove the group */ + BLI_freelinkN (&ob->defbase, dg); +} + +void del_defgroup (Object *ob) +{ + bDeformGroup *defgroup; + int i; + + if (!ob) + return; + + if (!ob->actdef) + return; + + defgroup = BLI_findlink(&ob->defbase, ob->actdef-1); + if (!defgroup) + return; + + /* Make sure that no verts are using this group */ + remove_verts_defgroup(ob, 1); + + /* Make sure that any verts with higher indices are adjusted accordingly */ + if(ob->type==OB_MESH) { + Mesh *me= ob->data; + EditMesh *em = BKE_mesh_get_editmesh(me); + EditVert *eve; + MDeformVert *dvert; + + for (eve=em->verts.first; eve; eve=eve->next){ + dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); + + if (dvert) + for (i=0; itotweight; i++) + if (dvert->dw[i].def_nr > (ob->actdef-1)) + dvert->dw[i].def_nr--; + } + BKE_mesh_end_editmesh(me, em); + } + else if(ob->type==OB_LATTICE) { + Lattice *lt= def_get_lattice(ob); + BPoint *bp; + MDeformVert *dvert= lt->dvert; + int a, tot; + + if (dvert) { + tot= lt->pntsu*lt->pntsv*lt->pntsw; + for(a=0, bp= lt->def; atotweight; i++){ + if (dvert->dw[i].def_nr > (ob->actdef-1)) + dvert->dw[i].def_nr--; + } + } + } + } + + del_defgroup_update_users(ob, ob->actdef); + + /* Update the active deform index if necessary */ + if (ob->actdef==BLI_countlist(&ob->defbase)) + ob->actdef--; + + /* Remove the group */ + BLI_freelinkN (&ob->defbase, defgroup); + + /* remove all dverts */ + if(ob->actdef==0) { + if(ob->type==OB_MESH) { + Mesh *me= ob->data; + CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert); + me->dvert= NULL; + } + else if(ob->type==OB_LATTICE) { + Lattice *lt= def_get_lattice(ob); + if (lt->dvert) { + MEM_freeN(lt->dvert); + lt->dvert= NULL; + } + } + } +} + +void del_all_defgroups (Object *ob) +{ + /* Sanity check */ + if (ob == NULL) + return; + + /* Remove all DVerts */ + if (ob->type==OB_MESH) { + Mesh *me= ob->data; + CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert); + me->dvert= NULL; + } + else if(ob->type==OB_LATTICE) { + Lattice *lt= def_get_lattice(ob); + if (lt->dvert) { + MEM_freeN(lt->dvert); + lt->dvert= NULL; + } + } + + /* Remove all DefGroups */ + BLI_freelistN(&ob->defbase); + + /* Fix counters/indices */ + ob->actdef= 0; +} + +void create_dverts(ID *id) +{ + /* create deform verts + */ + + if( GS(id->name)==ID_ME) { + Mesh *me= (Mesh *)id; + me->dvert= CustomData_add_layer(&me->vdata, CD_MDEFORMVERT, CD_CALLOC, NULL, me->totvert); + } + else if( GS(id->name)==ID_LT) { + Lattice *lt= (Lattice *)id; + lt->dvert= MEM_callocN(sizeof(MDeformVert)*lt->pntsu*lt->pntsv*lt->pntsw, "lattice deformVert"); + } +} + +/* for mesh in object mode + lattice can be in editmode */ +void remove_vert_def_nr (Object *ob, int def_nr, int vertnum) +{ + /* This routine removes the vertex from the deform + * group with number def_nr. + * + * This routine is meant to be fast, so it is the + * responsibility of the calling routine to: + * a) test whether ob is non-NULL + * b) test whether ob is a mesh + * c) calculate def_nr + */ + + MDeformWeight *newdw; + MDeformVert *dvert= NULL; + int i; + + /* get the deform vertices corresponding to the + * vertnum + */ + if(ob->type==OB_MESH) { + if( ((Mesh*)ob->data)->dvert ) + dvert = ((Mesh*)ob->data)->dvert + vertnum; + } + else if(ob->type==OB_LATTICE) { + Lattice *lt= def_get_lattice(ob); + + if(lt->dvert) + dvert = lt->dvert + vertnum; + } + + if(dvert==NULL) + return; + + /* for all of the deform weights in the + * deform vert + */ + for (i=dvert->totweight - 1 ; i>=0 ; i--){ + + /* if the def_nr is the same as the one + * for our weight group then remove it + * from this deform vert. + */ + if (dvert->dw[i].def_nr == def_nr) { + dvert->totweight--; + + /* if there are still other deform weights + * attached to this vert then remove this + * deform weight, and reshuffle the others + */ + if (dvert->totweight) { + newdw = MEM_mallocN (sizeof(MDeformWeight)*(dvert->totweight), + "deformWeight"); + if (dvert->dw){ + memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*i); + memcpy (newdw+i, dvert->dw+i+1, + sizeof(MDeformWeight)*(dvert->totweight-i)); + MEM_freeN (dvert->dw); + } + dvert->dw=newdw; + } + /* if there are no other deform weights + * left then just remove the deform weight + */ + else { + MEM_freeN (dvert->dw); + dvert->dw = NULL; + break; + } + } + } + +} + +/* for Mesh in Object mode */ +/* allows editmode for Lattice */ +void add_vert_defnr (Object *ob, int def_nr, int vertnum, + float weight, int assignmode) +{ + /* add the vert to the deform group with the + * specified number + */ + MDeformVert *dv= NULL; + MDeformWeight *newdw; + int i; + + /* get the vert */ + if(ob->type==OB_MESH) { + if(((Mesh*)ob->data)->dvert) + dv = ((Mesh*)ob->data)->dvert + vertnum; + } + else if(ob->type==OB_LATTICE) { + Lattice *lt= def_get_lattice(ob); + + if(lt->dvert) + dv = lt->dvert + vertnum; + } + + if(dv==NULL) + return; + + /* Lets first check to see if this vert is + * already in the weight group -- if so + * lets update it + */ + for (i=0; itotweight; i++){ + + /* if this weight cooresponds to the + * deform group, then add it using + * the assign mode provided + */ + if (dv->dw[i].def_nr == def_nr){ + + switch (assignmode) { + case WEIGHT_REPLACE: + dv->dw[i].weight=weight; + break; + case WEIGHT_ADD: + dv->dw[i].weight+=weight; + if (dv->dw[i].weight >= 1.0) + dv->dw[i].weight = 1.0; + break; + case WEIGHT_SUBTRACT: + dv->dw[i].weight-=weight; + /* if the weight is zero or less then + * remove the vert from the deform group + */ + if (dv->dw[i].weight <= 0.0) + remove_vert_def_nr(ob, def_nr, vertnum); + break; + } + return; + } + } + + /* if the vert wasn't in the deform group then + * we must take a different form of action ... + */ + + switch (assignmode) { + case WEIGHT_SUBTRACT: + /* if we are subtracting then we don't + * need to do anything + */ + return; + + case WEIGHT_REPLACE: + case WEIGHT_ADD: + /* if we are doing an additive assignment, then + * we need to create the deform weight + */ + newdw = MEM_callocN (sizeof(MDeformWeight)*(dv->totweight+1), + "deformWeight"); + if (dv->dw){ + memcpy (newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight); + MEM_freeN (dv->dw); + } + dv->dw=newdw; + + dv->dw[dv->totweight].weight=weight; + dv->dw[dv->totweight].def_nr=def_nr; + + dv->totweight++; + break; + } +} + +/* called while not in editmode */ +void add_vert_to_defgroup (Object *ob, bDeformGroup *dg, int vertnum, + float weight, int assignmode) +{ + /* add the vert to the deform group with the + * specified assign mode + */ + int def_nr; + + /* get the deform group number, exit if + * it can't be found + */ + def_nr = get_defgroup_num(ob, dg); + if (def_nr < 0) return; + + /* if there's no deform verts then + * create some + */ + if(ob->type==OB_MESH) { + if (!((Mesh*)ob->data)->dvert) + create_dverts(ob->data); + } + else if(ob->type==OB_LATTICE) { + if (!((Lattice*)ob->data)->dvert) + create_dverts(ob->data); + } + + /* call another function to do the work + */ + add_vert_defnr (ob, def_nr, vertnum, weight, assignmode); +} + +/* Only available in editmode */ +void assign_verts_defgroup (Object *ob, float weight) +{ + EditVert *eve; + bDeformGroup *dg, *eg; + MDeformWeight *newdw; + MDeformVert *dvert; + int i, done; + + if (!ob) + return; + + dg=BLI_findlink(&ob->defbase, ob->actdef-1); + if (!dg){ + error ("No vertex group is active"); + return; + } + + switch (ob->type){ + case OB_MESH: + { + Mesh *me= ob->data; + EditMesh *em = BKE_mesh_get_editmesh(me); + + if (!CustomData_has_layer(&em->vdata, CD_MDEFORMVERT)) + EM_add_data_layer(em, &em->vdata, CD_MDEFORMVERT); + + /* Go through the list of editverts and assign them */ + for (eve=em->verts.first; eve; eve=eve->next){ + dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); + + if (dvert && (eve->f & 1)){ + done=0; + /* See if this vert already has a reference to this group */ + /* If so: Change its weight */ + done=0; + for (i=0; itotweight; i++){ + eg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr); + /* Find the actual group */ + if (eg==dg){ + dvert->dw[i].weight= weight; + done=1; + break; + } + } + /* If not: Add the group and set its weight */ + if (!done){ + newdw = MEM_callocN (sizeof(MDeformWeight)*(dvert->totweight+1), "deformWeight"); + if (dvert->dw){ + memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*dvert->totweight); + MEM_freeN (dvert->dw); + } + dvert->dw=newdw; + + dvert->dw[dvert->totweight].weight= weight; + dvert->dw[dvert->totweight].def_nr= ob->actdef-1; + + dvert->totweight++; + + } + } + } + BKE_mesh_end_editmesh(me, em); + } + break; + case OB_LATTICE: + { + Lattice *lt= def_get_lattice(ob); + BPoint *bp; + int a, tot; + + if(lt->dvert==NULL) + create_dverts(<->id); + + tot= lt->pntsu*lt->pntsv*lt->pntsw; + for(a=0, bp= lt->def; af1 & SELECT) + add_vert_defnr (ob, ob->actdef-1, a, weight, WEIGHT_REPLACE); + } + } + break; + default: + printf ("Assigning deformation groups to unknown object type\n"); + break; + } + +} + +/* mesh object mode, lattice can be in editmode */ +void remove_vert_defgroup (Object *ob, bDeformGroup *dg, int vertnum) +{ + /* This routine removes the vertex from the specified + * deform group. + */ + + int def_nr; + + /* if the object is NULL abort + */ + if (!ob) + return; + + /* get the deform number that cooresponds + * to this deform group, and abort if it + * can not be found. + */ + def_nr = get_defgroup_num(ob, dg); + if (def_nr < 0) return; + + /* call another routine to do the work + */ + remove_vert_def_nr (ob, def_nr, vertnum); +} + +/* for mesh in object mode lattice can be in editmode */ +static float get_vert_def_nr (Object *ob, int def_nr, int vertnum) +{ + MDeformVert *dvert= NULL; + int i; + + /* get the deform vertices corresponding to the + * vertnum + */ + if(ob->type==OB_MESH) { + if( ((Mesh*)ob->data)->dvert ) + dvert = ((Mesh*)ob->data)->dvert + vertnum; + } + else if(ob->type==OB_LATTICE) { + Lattice *lt= def_get_lattice(ob); + + if(lt->dvert) + dvert = lt->dvert + vertnum; + } + + if(dvert==NULL) + return 0.0f; + + for(i=dvert->totweight-1 ; i>=0 ; i--) + if(dvert->dw[i].def_nr == def_nr) + return dvert->dw[i].weight; + + return 0.0f; +} + +/* mesh object mode, lattice can be in editmode */ +float get_vert_defgroup (Object *ob, bDeformGroup *dg, int vertnum) +{ + int def_nr; + + if(!ob) + return 0.0f; + + def_nr = get_defgroup_num(ob, dg); + if(def_nr < 0) return 0.0f; + + return get_vert_def_nr (ob, def_nr, vertnum); +} + +/* Only available in editmode */ +/* removes from active defgroup, if allverts==0 only selected vertices */ +void remove_verts_defgroup (Object *ob, int allverts) +{ + EditVert *eve; + MDeformVert *dvert; + MDeformWeight *newdw; + bDeformGroup *dg, *eg; + int i; + + if (!ob) + return; + + dg=BLI_findlink(&ob->defbase, ob->actdef-1); + if (!dg){ + error ("No vertex group is active"); + return; + } + + switch (ob->type){ + case OB_MESH: + { + Mesh *me= ob->data; + EditMesh *em = BKE_mesh_get_editmesh(me); + + for (eve=em->verts.first; eve; eve=eve->next){ + dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); + + if (dvert && dvert->dw && ((eve->f & 1) || allverts)){ + for (i=0; itotweight; i++){ + /* Find group */ + eg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr); + if (eg == dg){ + dvert->totweight--; + if (dvert->totweight){ + newdw = MEM_mallocN (sizeof(MDeformWeight)*(dvert->totweight), "deformWeight"); + + if (dvert->dw){ + memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*i); + memcpy (newdw+i, dvert->dw+i+1, sizeof(MDeformWeight)*(dvert->totweight-i)); + MEM_freeN (dvert->dw); + } + dvert->dw=newdw; + } + else{ + MEM_freeN (dvert->dw); + dvert->dw=NULL; + break; + } + } + } + } + } + BKE_mesh_end_editmesh(me, em); + } + break; + case OB_LATTICE: + { + Lattice *lt= def_get_lattice(ob); + + if(lt->dvert) { + BPoint *bp; + int a, tot= lt->pntsu*lt->pntsv*lt->pntsw; + + for(a=0, bp= lt->def; af1 & SELECT)) + remove_vert_defgroup (ob, dg, a); + } + } + } + break; + + default: + printf ("Removing deformation groups from unknown object type\n"); + break; + } +} + +/* Only available in editmode */ +/* removes from all defgroup, if allverts==0 only selected vertices */ +void remove_verts_defgroups(Object *ob, int allverts) +{ + int actdef, defCount; + + if (ob == NULL) return; + + actdef= ob->actdef; + defCount= BLI_countlist(&ob->defbase); + + if (defCount == 0) { + error("Object has no vertex groups"); + return; + } + + /* To prevent code redundancy, we just use remove_verts_defgroup, but that + * only operates on the active vgroup. So we iterate through all groups, by changing + * active group index + */ + for (ob->actdef= 1; ob->actdef <= defCount; ob->actdef++) + remove_verts_defgroup(ob, allverts); + + ob->actdef= actdef; +} + +void vertexgroup_select_by_name(Object *ob, char *name) +{ + bDeformGroup *curdef; + int actdef= 1; + + if(ob==NULL) return; + + for (curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++){ + if (!strcmp(curdef->name, name)) { + ob->actdef= actdef; + return; + } + } + ob->actdef=0; // this signals on painting to create a new one, if a bone in posemode is selected */ +} + +/* This function provides a shortcut for adding/removing verts from + * vertex groups. It is called by the Ctrl-G hotkey in EditMode for Meshes + * and Lattices. (currently only restricted to those two) + * It is only responsible for + */ +void vgroup_assign_with_menu(Scene *scene, Object *ob) +{ + VPaint *wp= scene->toolsettings->wpaint; + int defCount; + int mode= 0; + + /* prevent crashes */ + if (wp==NULL || ob==NULL) return; + + defCount= BLI_countlist(&ob->defbase); + + /* give user choices of adding to current/new or removing from current */ +// XXX if (defCount && ob->actdef) +// mode = pupmenu("Vertex Groups %t|Add Selected to New Group %x1|Add Selected to Active Group %x2|Remove Selected from Active Group %x3|Remove Selected from All Groups %x4"); +// else +// mode= pupmenu("Vertex Groups %t|Add Selected to New Group %x1"); + + /* handle choices */ + switch (mode) { + case 1: /* add to new group */ + add_defgroup(ob); + assign_verts_defgroup(ob, wp->brush->alpha); + BIF_undo_push("Assign to vertex group"); + break; + case 2: /* add to current group */ + assign_verts_defgroup(ob, wp->brush->alpha); + BIF_undo_push("Assign to vertex group"); + break; + case 3: /* remove from current group */ + remove_verts_defgroup(ob, 0); + BIF_undo_push("Remove from vertex group"); + break; + case 4: /* remove from all groups */ + remove_verts_defgroups(ob, 0); + BIF_undo_push("Remove from all vertex groups"); + break; + } +} + +/* This function provides a shortcut for commonly used vertex group + * functions - change weight (not implemented), change active group, delete active group, + * when Ctrl-Shift-G is used in EditMode, for Meshes and Lattices (only for now). + */ +void vgroup_operation_with_menu(Object *ob) +{ + int defCount; + int mode= 0; + + /* prevent crashes and useless cases */ + if (ob==NULL) return; + + defCount= BLI_countlist(&ob->defbase); + if (defCount == 0) return; + + /* give user choices of adding to current/new or removing from current */ +// XXX if (ob->actdef) +// mode = pupmenu("Vertex Groups %t|Change Active Group%x1|Delete Active Group%x2|Delete All Groups%x3"); +// else +// mode= pupmenu("Vertex Groups %t|Change Active Group%x1|Delete All Groups%x3"); + + /* handle choices */ + switch (mode) { + case 1: /* change active group*/ + { + char *menustr= NULL; // XXX get_vertexgroup_menustr(ob); + short nr; + + if (menustr) { +// XXX nr= pupmenu(menustr); + + if ((nr >= 1) && (nr <= defCount)) + ob->actdef= nr; + + MEM_freeN(menustr); + } + } + break; + case 2: /* delete active group */ + { + del_defgroup(ob); + BIF_undo_push("Delete vertex group"); + } + break; + case 3: /* delete all groups */ + { + del_all_defgroups(ob); + BIF_undo_push("Delete all vertex groups"); + } + break; + } +} + +/********************** vertex group operators *********************/ + +static int vertex_group_add_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Scene *scene= CTX_data_scene(C); + + if(!ob) + return OPERATOR_CANCELLED; + + add_defgroup(ob); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Vertex Group"; + ot->idname= "OBJECT_OT_vertex_group_add"; + + /* api callbacks */ + ot->exec= vertex_group_add_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_group_remove_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Scene *scene= CTX_data_scene(C); + + if(!ob) + return OPERATOR_CANCELLED; + + if(scene->obedit == ob) { + del_defgroup(ob); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + } + else { + del_defgroup_in_object_mode(ob); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + } + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Vertex Group"; + ot->idname= "OBJECT_OT_vertex_group_remove"; + + /* api callbacks */ + ot->exec= vertex_group_remove_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_group_assign_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); + Object *ob= CTX_data_edit_object(C); + + if(!ob) + return OPERATOR_CANCELLED; + + assign_verts_defgroup(ob, ts->vgroup_weight); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_assign(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Assign Vertex Group"; + ot->idname= "OBJECT_OT_vertex_group_assign"; + + /* api callbacks */ + ot->exec= vertex_group_assign_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_group_remove_from_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_edit_object(C); + + if(!ob) + return OPERATOR_CANCELLED; + + remove_verts_defgroup(ob, 0); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove from Vertex Group"; + ot->idname= "OBJECT_OT_vertex_group_remove_from"; + + /* api callbacks */ + ot->exec= vertex_group_remove_from_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_group_select_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_edit_object(C); + + if(!ob) + return OPERATOR_CANCELLED; + + sel_verts_defgroup(ob, 1); /* runs countall() */ + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_select(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Select Vertex Group"; + ot->idname= "OBJECT_OT_vertex_group_select"; + + /* api callbacks */ + ot->exec= vertex_group_select_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_group_deselect_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_edit_object(C); + + if(!ob) + return OPERATOR_CANCELLED; + + sel_verts_defgroup(ob, 0); /* runs countall() */ + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_deselect(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Deselect Vertex Group"; + ot->idname= "OBJECT_OT_vertex_group_deselect"; + + /* api callbacks */ + ot->exec= vertex_group_deselect_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_group_copy_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + + if(!ob) + return OPERATOR_CANCELLED; + + duplicate_defgroup(ob); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_vertex_group_copy(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Copy Vertex Group"; + ot->idname= "OBJECT_OT_vertex_group_copy"; + + /* api callbacks */ + ot->exec= vertex_group_copy_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int vertex_group_copy_to_linked_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + Base *base; + int retval= OPERATOR_CANCELLED; + + if(!ob) + return retval; + + for(base=scene->base.first; base; base= base->next) { + if(base->object->type==ob->type) { + if(base->object!=ob && base->object->data==ob->data) { + BLI_freelistN(&base->object->defbase); + BLI_duplicatelist(&base->object->defbase, &ob->defbase); + base->object->actdef= ob->actdef; + + DAG_object_flush_update(scene, base->object, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, base->object); + + retval = OPERATOR_FINISHED; + } + } + } + + return retval; +} + +void OBJECT_OT_vertex_group_copy_to_linked(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Copy Vertex Group to Linked"; + ot->idname= "OBJECT_OT_vertex_group_copy_to_linked"; + + /* api callbacks */ + ot->exec= vertex_group_copy_to_linked_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 14121ccdc4d..5bf090e459b 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -59,6 +59,7 @@ #include "ED_util.h" #include "ED_screen.h" #include "ED_mesh.h" +#include "ED_object.h" #include "ED_screen_types.h" #include "RE_pipeline.h" @@ -2515,7 +2516,9 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) /* flush multires changes (for sculpt) */ multires_force_update(CTX_data_active_object(C)); - // get editmode results + /* get editmode results */ + ED_object_exit_editmode(C, 0); /* 0 = does not exit editmode */ + // store spare // get view3d layer, local layer, make this nice api call to render // store spare diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 8f0b52ef3a1..a2b883eabfc 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -156,7 +156,6 @@ typedef struct StrokeCache { float old_grab_location[3]; int symmetry; /* Symmetry index between 0 and 7 */ float view_normal[3], view_normal_symmetry[3]; - int last_dot[2]; /* Last location of stroke application */ int last_rake[2]; /* Last location of updating rake rotation */ } StrokeCache; @@ -849,15 +848,6 @@ static void do_symmetrical_brush_actions(Sculpt *sd, StrokeCache *cache) const char symm = sd->flags & 7; int i; - /* Brush spacing: only apply dot if next dot is far enough away */ - if((sd->brush->flag & BRUSH_SPACE) && !(sd->brush->flag & BRUSH_ANCHORED) && !cache->first_time) { - int dx = cache->last_dot[0] - cache->mouse[0]; - int dy = cache->last_dot[1] - cache->mouse[1]; - if(sqrt(dx*dx+dy*dy) < sd->brush->spacing) - return; - } - memcpy(cache->last_dot, cache->mouse, sizeof(int) * 2); - VecCopyf(cache->location, cache->true_location); VecCopyf(cache->grab_delta_symmetry, cache->grab_delta); cache->symmetry = 0; @@ -1050,16 +1040,21 @@ static void draw_paint_cursor(bContext *C, int x, int y, void *customdata) { Sculpt *sd= CTX_data_tool_settings(C)->sculpt; - glTranslatef((float)x, (float)y, 0.0f); - glColor4ub(255, 100, 100, 128); glEnable( GL_LINE_SMOOTH ); glEnable(GL_BLEND); + + glTranslatef((float)x, (float)y, 0.0f); glutil_draw_lined_arc(0.0, M_PI*2.0, sd->brush->size, 40); + glTranslatef((float)-x, (float)-y, 0.0f); + + if(sd->session && sd->session->cache && sd->brush && (sd->brush->flag & BRUSH_SMOOTH_STROKE)) { + ARegion *ar = CTX_wm_region(C); + sdrawline(x, y, sd->session->cache->mouse[0] - ar->winrct.xmin, sd->session->cache->mouse[1] - ar->winrct.ymin); + } + glDisable(GL_BLEND); glDisable( GL_LINE_SMOOTH ); - - glTranslatef((float)-x, (float)-y, 0.0f); } static void toggle_paint_cursor(bContext *C) @@ -1202,6 +1197,9 @@ static void sculpt_update_cache_invariants(Sculpt *sd, bContext *C, wmOperator * RNA_int_get_array(op->ptr, "initial_mouse", cache->initial_mouse); cache->depth = RNA_float_get(op->ptr, "depth"); + cache->mouse[0] = cache->initial_mouse[0]; + cache->mouse[1] = cache->initial_mouse[1]; + /* Truly temporary data that isn't stored in properties */ view3d_set_viewcontext(C, &cache->vc); @@ -1407,13 +1405,99 @@ static void sculpt_flush_update(bContext *C) ED_region_tag_redraw(ar); } -static int sculpt_brush_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) +/* Returns zero if no sculpt changes should be made, non-zero otherwise */ +static int sculpt_smooth_stroke(Sculpt *s, int output[2], wmEvent *event) { + output[0] = event->x; + output[1] = event->y; + + if(s->brush->flag & BRUSH_SMOOTH_STROKE && s->brush->sculpt_tool != SCULPT_TOOL_GRAB) { + StrokeCache *cache = s->session->cache; + float u = .9, v = 1.0 - u; + int dx = cache->mouse[0] - event->x, dy = cache->mouse[1] - event->y; + int radius = 50; + + /* If the mouse is moving within the radius of the last move, + don't update the mouse position. This allows sharp turns. */ + if(dx*dx + dy*dy < radius*radius) + return 0; + + output[0] = event->x * v + cache->mouse[0] * u; + output[1] = event->y * v + cache->mouse[1] * u; + } + + return 1; +} + +/* Returns zero if the stroke dots should not be spaced, non-zero otherwise */ +int sculpt_space_stroke_enabled(Sculpt *s) +{ + Brush *br = s->brush; + return (br->flag & BRUSH_SPACE) && !(br->flag & BRUSH_ANCHORED) && (br->sculpt_tool != SCULPT_TOOL_GRAB); +} + +/* Put the location of the next sculpt stroke dot into the stroke RNA and apply it to the mesh */ +static void sculpt_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *event, int mouse[2]) +{ + Sculpt *sd = CTX_data_tool_settings(C)->sculpt; + StrokeCache *cache = sd->session->cache; PointerRNA itemptr; + float cur_depth; + float center[3]; + + cur_depth = read_cached_depth(&cache->vc, mouse[0], mouse[1]); + unproject(sd->session->cache->mats, center, mouse[0], mouse[1], cur_depth); + + /* Add to stroke */ + RNA_collection_add(op->ptr, "stroke", &itemptr); + RNA_float_set_array(&itemptr, "location", center); + RNA_int_set_array(&itemptr, "mouse", mouse); + RNA_boolean_set(&itemptr, "flip", event->shift); + sculpt_update_cache_variants(sd, &itemptr); + + sculpt_restore_mesh(sd); + do_symmetrical_brush_actions(sd, cache); + + sculpt_post_stroke_free(sd->session); +} + +/* For brushes with stroke spacing enabled, moves mouse in steps + towards the final mouse location. */ +static int sculpt_space_stroke(bContext *C, wmOperator *op, wmEvent *event, Sculpt *s, const int final_mouse[2]) +{ + StrokeCache *cache = s->session->cache; + int cnt = 0; + + if(sculpt_space_stroke_enabled(s)) { + float vec[2] = {final_mouse[0] - cache->mouse[0], final_mouse[1] - cache->mouse[1]}; + int mouse[2] = {cache->mouse[0], cache->mouse[1]}; + float length, scale; + int steps = 0, i; + + /* Normalize the vector between the last stroke dot and the goal */ + length = sqrt(vec[0]*vec[0] + vec[1]*vec[1]); + + if(length > FLT_EPSILON) { + scale = s->brush->spacing / length; + vec[0] *= scale; + vec[1] *= scale; + + steps = (int)(length / s->brush->spacing); + for(i = 0; i < steps; ++i, ++cnt) { + mouse[0] += vec[0]; + mouse[1] += vec[1]; + sculpt_brush_stroke_add_step(C, op, event, mouse); + } + } + } + + return cnt; +} + +static int sculpt_brush_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) +{ Sculpt *sd = CTX_data_tool_settings(C)->sculpt; ARegion *ar = CTX_wm_region(C); - float center[3]; - int mouse[2] = {event->x, event->y}; float cur_depth; sculpt_update_mesh_elements(C); @@ -1433,21 +1517,19 @@ static int sculpt_brush_stroke_modal(bContext *C, wmOperator *op, wmEvent *event } if(sd->session->cache) { - cur_depth = read_cached_depth(&sd->session->cache->vc, event->x, event->y); - unproject(sd->session->cache->mats, center, event->x, event->y, cur_depth); - - /* Add to stroke */ - RNA_collection_add(op->ptr, "stroke", &itemptr); - RNA_float_set_array(&itemptr, "location", center); - RNA_int_set_array(&itemptr, "mouse", mouse); - RNA_boolean_set(&itemptr, "flip", event->shift); - sculpt_update_cache_variants(sd, &itemptr); + int mouse[2]; - sculpt_restore_mesh(sd); - do_symmetrical_brush_actions(CTX_data_tool_settings(C)->sculpt, sd->session->cache); - - sculpt_flush_update(C); - sculpt_post_stroke_free(sd->session); + if(sculpt_smooth_stroke(sd, mouse, event)) { + if(sculpt_space_stroke_enabled(sd)) { + if(!sculpt_space_stroke(C, op, event, sd, mouse)) + ED_region_tag_redraw(ar); + } + else + sculpt_brush_stroke_add_step(C, op, event, mouse); + sculpt_flush_update(C); + } + else + ED_region_tag_redraw(ar); } /* Finished */ diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h index 13ea778fb00..65c2976d57c 100644 --- a/source/blender/editors/space_buttons/buttons_intern.h +++ b/source/blender/editors/space_buttons/buttons_intern.h @@ -71,8 +71,8 @@ void MATERIAL_OT_new(struct wmOperatorType *ot); void TEXTURE_OT_new(struct wmOperatorType *ot); void WORLD_OT_new(struct wmOperatorType *ot); -void OBJECT_OT_particle_system_slot_add(struct wmOperatorType *ot); -void OBJECT_OT_particle_system_slot_remove(struct wmOperatorType *ot); +void OBJECT_OT_particle_system_add(struct wmOperatorType *ot); +void OBJECT_OT_particle_system_remove(struct wmOperatorType *ot); void PARTICLE_OT_new(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 6ca92674c6e..df3e8c62d37 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -412,7 +412,7 @@ void WORLD_OT_new(wmOperatorType *ot) /********************** particle system slot operators *********************/ -static int particle_system_slot_add_exec(bContext *C, wmOperator *op) +static int particle_system_add_exec(bContext *C, wmOperator *op) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Scene *scene = CTX_data_scene(C); @@ -420,26 +420,26 @@ static int particle_system_slot_add_exec(bContext *C, wmOperator *op) if(!scene || !ob) return OPERATOR_CANCELLED; - object_add_particle_system_slot(scene, ob); + object_add_particle_system(scene, ob); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); return OPERATOR_FINISHED; } -void OBJECT_OT_particle_system_slot_add(wmOperatorType *ot) +void OBJECT_OT_particle_system_add(wmOperatorType *ot) { /* identifiers */ ot->name= "Add Particle System Slot"; - ot->idname= "OBJECT_OT_particle_system_slot_add"; + ot->idname= "OBJECT_OT_particle_system_add"; /* api callbacks */ - ot->exec= particle_system_slot_add_exec; + ot->exec= particle_system_add_exec; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static int particle_system_slot_remove_exec(bContext *C, wmOperator *op) +static int particle_system_remove_exec(bContext *C, wmOperator *op) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Scene *scene = CTX_data_scene(C); @@ -447,20 +447,20 @@ static int particle_system_slot_remove_exec(bContext *C, wmOperator *op) if(!scene || !ob) return OPERATOR_CANCELLED; - object_remove_particle_system_slot(scene, ob); + object_remove_particle_system(scene, ob); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); return OPERATOR_FINISHED; } -void OBJECT_OT_particle_system_slot_remove(wmOperatorType *ot) +void OBJECT_OT_particle_system_remove(wmOperatorType *ot) { /* identifiers */ ot->name= "Remove Particle System Slot"; - ot->idname= "OBJECT_OT_particle_system_slot_remove"; + ot->idname= "OBJECT_OT_particle_system_remove"; /* api callbacks */ - ot->exec= particle_system_slot_remove_exec; + ot->exec= particle_system_remove_exec; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 7954d5254cc..b89a13ce218 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -220,8 +220,8 @@ void buttons_operatortypes(void) WM_operatortype_append(TEXTURE_OT_new); WM_operatortype_append(WORLD_OT_new); - WM_operatortype_append(OBJECT_OT_particle_system_slot_add); - WM_operatortype_append(OBJECT_OT_particle_system_slot_remove); + WM_operatortype_append(OBJECT_OT_particle_system_add); + WM_operatortype_append(OBJECT_OT_particle_system_remove); WM_operatortype_append(PARTICLE_OT_new); } @@ -331,6 +331,7 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn) case NC_SCENE: switch(wmn->data) { case ND_FRAME: + case ND_MODE: ED_area_tag_redraw(sa); break; diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index bb47d3458fe..02ee8f508c1 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -550,132 +550,4 @@ void file_draw_list(const bContext *C, ARegion *ar) } } -static void file_draw_fsmenu_category_name(ARegion *ar, const char *category_name, short *starty) -{ - short sx, sy; - int bmwidth = ar->v2d.cur.xmax - ar->v2d.cur.xmin - 2*TILE_BORDER_X - ICON_DEFAULT_WIDTH - 4; - int fontsize = file_font_pointsize(); - - sx = ar->v2d.cur.xmin + TILE_BORDER_X; - sy = *starty; - - UI_ThemeColor(TH_TEXT_HI); - file_draw_string(sx, sy, category_name, bmwidth, fontsize, FILE_SHORTEN_END); - - sy -= fontsize*2.0f; - - *starty= sy; -} - -static void file_draw_fsmenu_category(const bContext *C, ARegion *ar, FSMenuCategory category, short *starty) -{ - struct FSMenu* fsmenu = fsmenu_get(); - char bookmark[FILE_MAX]; - int nentries = fsmenu_get_nentries(fsmenu, category); - - short sx, sy, xpos, ypos; - int bmwidth = ar->v2d.cur.xmax - ar->v2d.cur.xmin - 2*TILE_BORDER_X - ICON_DEFAULT_WIDTH - 4; - int fontsize = file_font_pointsize(); - int cat_icon; - int i; - - sx = ar->v2d.cur.xmin + TILE_BORDER_X; - sy = *starty; - - switch(category) { - case FS_CATEGORY_SYSTEM: - cat_icon = ICON_DISK_DRIVE; break; - case FS_CATEGORY_BOOKMARKS: - cat_icon = ICON_BOOKMARKS; break; - case FS_CATEGORY_RECENT: - cat_icon = ICON_FILE_FOLDER; break; - } - - for (i=0; i< nentries && (sy > ar->v2d.cur.ymin) ;++i) { - char *fname = fsmenu_get_entry(fsmenu, category, i); - - if (fname) { - int sl; - BLI_strncpy(bookmark, fname, FILE_MAX); - - sl = strlen(bookmark)-1; - if (sl > 1) { - while (bookmark[sl] == '\\' || bookmark[sl] == '/') { - bookmark[sl] = '\0'; - sl--; - } - } - - if (fsmenu_is_selected(fsmenu, category, i) ) { - UI_ThemeColor(TH_HILITE); - uiRoundBox(sx, sy - fontsize*2.0f, ar->v2d.cur.xmax - TILE_BORDER_X, sy, 4.0f); - UI_ThemeColor(TH_TEXT); - } else { - UI_ThemeColor(TH_TEXT_HI); - } - - xpos = sx; - ypos = sy - (TILE_BORDER_Y * 0.5); - - file_draw_icon(xpos, ypos, cat_icon, ICON_DEFAULT_WIDTH, ICON_DEFAULT_WIDTH); - xpos += ICON_DEFAULT_WIDTH + 4; - file_draw_string(xpos, ypos, bookmark, bmwidth, fontsize, FILE_SHORTEN_FRONT); - sy -= fontsize*2.0; - fsmenu_set_pos(fsmenu, category, i, xpos, ypos); - } - } - - *starty = sy; -} - -void file_draw_fsmenu_operator(const bContext *C, ARegion *ar, wmOperator *op, short *starty) -{ - uiStyle *style= U.uistyles.first; - uiBlock *block; - uiLayout *layout; - int sy; - - sy= *starty; - - block= uiBeginBlock(C, ar, "file_options", UI_EMBOSS); - layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, TILE_BORDER_X, sy, ar->winx-2*TILE_BORDER_X, 20, style); - - RNA_STRUCT_BEGIN(op->ptr, prop) { - if(strcmp(RNA_property_identifier(prop), "rna_type") == 0) - continue; - if(strcmp(RNA_property_identifier(prop), "filename") == 0) - continue; - - uiItemFullR(layout, NULL, 0, op->ptr, prop, -1, 0, 0, 0, 0); - } - RNA_STRUCT_END; - - uiBlockLayoutResolve(C, block, NULL, &sy); - uiEndBlock(C, block); - uiDrawBlock(C, block); - - *starty= sy; -} - -void file_draw_fsmenu(const bContext *C, ARegion *ar) -{ - SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); - int linestep = file_font_pointsize()*2.0f; - short sy= ar->v2d.cur.ymax-2*TILE_BORDER_Y; - - file_draw_fsmenu_category_name(ar, "SYSTEM", &sy); - file_draw_fsmenu_category(C, ar, FS_CATEGORY_SYSTEM, &sy); - sy -= linestep; - file_draw_fsmenu_category_name(ar, "BOOKMARKS", &sy); - file_draw_fsmenu_category(C, ar, FS_CATEGORY_BOOKMARKS, &sy); - sy -= linestep; - file_draw_fsmenu_category_name(ar, "RECENT", &sy); - file_draw_fsmenu_category(C, ar, FS_CATEGORY_RECENT, &sy); - - if(sfile->op) { - sy -= linestep; - file_draw_fsmenu_category_name(ar, "OPTIONS", &sy); - file_draw_fsmenu_operator(C, ar, sfile->op, &sy); - } -} diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 642189ad3fd..668e14c95e6 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -30,6 +30,9 @@ /* internal exports only */ +struct ARegion; +struct ARegionType; +struct SpaceFile; /* file_header.c */ void file_header_buttons(const bContext *C, ARegion *ar); @@ -45,7 +48,6 @@ void file_draw_buttons(const bContext *C, ARegion *ar); void file_calc_previews(const bContext *C, ARegion *ar); void file_draw_previews(const bContext *C, ARegion *ar); void file_draw_list(const bContext *C, ARegion *ar); -void file_draw_fsmenu(const bContext *C, ARegion *ar); /* file_ops.h */ struct wmOperatorType; @@ -56,6 +58,9 @@ void FILE_OT_select(struct wmOperatorType *ot); void FILE_OT_select_all_toggle(struct wmOperatorType *ot); void FILE_OT_select_border(struct wmOperatorType *ot); void FILE_OT_select_bookmark(struct wmOperatorType *ot); +void FILE_OT_add_bookmark(struct wmOperatorType *ot); +void FILE_OT_delete_bookmark(struct wmOperatorType *ot); +void FILE_OT_hidedot(struct wmOperatorType *ot); void FILE_OT_loadimages(struct wmOperatorType *ot); void FILE_OT_exec(struct wmOperatorType *ot); void FILE_OT_cancel(struct wmOperatorType *ot); @@ -66,11 +71,14 @@ void FILE_OT_bookmark_toggle(struct wmOperatorType *ot); int file_exec(bContext *C, struct wmOperator *unused); int file_cancel_exec(bContext *C, struct wmOperator *unused); int file_parent_exec(bContext *C, struct wmOperator *unused); -int file_hilight_set(SpaceFile *sfile, ARegion *ar, int mx, int my); +int file_hilight_set(struct SpaceFile *sfile, struct ARegion *ar, int mx, int my); /* filesel.c */ float file_string_width(const char* str); float file_font_pointsize(); +/* file_panels.c */ +void file_panels_register(struct ARegionType *art); + #endif /* ED_FILE_INTERN_H */ diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index ab02147d020..aaa1793efbb 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -42,6 +42,8 @@ #include "ED_screen.h" #include "ED_fileselect.h" +#include "MEM_guardedalloc.h" + #include "RNA_access.h" #include "RNA_define.h" @@ -135,22 +137,15 @@ static void file_select(SpaceFile* sfile, ARegion* ar, const rcti* rect, short v params->active_file = last_file; if(file && S_ISDIR(file->type)) { - /* the path is too long and we are not going up! */ - if (strcmp(file->relname, ".") && - strcmp(file->relname, "..") && - strlen(params->dir) + strlen(file->relname) >= FILE_MAX ) + /* the path is too long! */ + if (strlen(params->dir) + strlen(file->relname) >= FILE_MAX ) { // XXX error("Path too long, cannot enter this directory"); } else { - if (strcmp(file->relname, "..")==0) { - /* avoids /../../ */ - BLI_parent_dir(params->dir); - } else { - strcat(params->dir, file->relname); - strcat(params->dir,"/"); - params->file[0] = '\0'; - BLI_cleanup_dir(G.sce, params->dir); - } + strcat(params->dir, file->relname); + strcat(params->dir,"/"); + params->file[0] = '\0'; + BLI_cleanup_dir(G.sce, params->dir); filelist_setdir(sfile->files, params->dir); filelist_free(sfile->files); params->active_file = -1; @@ -234,7 +229,7 @@ static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event) /* single select, deselect all selected first */ file_deselect_all(sfile); file_select(sfile, ar, &rect, val ); - WM_event_add_notifier(C, NC_WINDOW, NULL); + WM_event_add_notifier(C, NC_FILE|ND_PARAMS, NULL); } return OPERATOR_FINISHED; } @@ -299,89 +294,106 @@ void FILE_OT_select_all_toggle(wmOperatorType *ot) /* ---------- BOOKMARKS ----------- */ -static int file_select_bookmark_category(SpaceFile* sfile, ARegion* ar, short x, short y, FSMenuCategory category) +static int bookmark_select_invoke(bContext *C, wmOperator *op, wmEvent *event) { - struct FSMenu* fsmenu = fsmenu_get(); - int nentries = fsmenu_get_nentries(fsmenu, category); - int linestep = file_font_pointsize()*2.0f; - short xs, ys; - int i; - int selected = -1; + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); - for (i=0; i < nentries; ++i) { - fsmenu_get_pos(fsmenu, category, i, &xs, &ys); - if ( (y<=ys) && (y>ys-linestep) ) { - fsmenu_select_entry(fsmenu, category, i); - selected = i; - break; - } + if(RNA_struct_find_property(op->ptr, "dir")) { + char entry[256]; + FileSelectParams* params = sfile->params; + + RNA_string_get(op->ptr, "dir", entry); + BLI_strncpy(params->dir, entry, sizeof(params->dir)); + BLI_cleanup_dir(G.sce, params->dir); + filelist_free(sfile->files); + filelist_setdir(sfile->files, params->dir); + params->file[0] = '\0'; + params->active_file = -1; + + WM_event_add_notifier(C, NC_FILE|ND_PARAMS, NULL); } - return selected; + + return OPERATOR_FINISHED; } -static void file_select_bookmark(SpaceFile* sfile, ARegion* ar, short x, short y) +void FILE_OT_select_bookmark(wmOperatorType *ot) { - float fx, fy; - int selected; - FSMenuCategory category = FS_CATEGORY_SYSTEM; - - if (BLI_in_rcti(&ar->v2d.mask, x, y)) { - char *entry; + /* identifiers */ + ot->name= "Select Directory"; + ot->idname= "FILE_OT_select_bookmark"; + + /* api callbacks */ + ot->invoke= bookmark_select_invoke; + ot->poll= ED_operator_file_active; - UI_view2d_region_to_view(&ar->v2d, x, y, &fx, &fy); - selected = file_select_bookmark_category(sfile, ar, fx, fy, FS_CATEGORY_SYSTEM); - if (selected<0) { - category = FS_CATEGORY_BOOKMARKS; - selected = file_select_bookmark_category(sfile, ar, fx, fy, category); - } - if (selected<0) { - category = FS_CATEGORY_RECENT; - selected = file_select_bookmark_category(sfile, ar, fx, fy, category); - } - - if (selected>=0) { - entry= fsmenu_get_entry(fsmenu_get(), category, selected); - /* which string */ - if (entry) { - FileSelectParams* params = sfile->params; - BLI_strncpy(params->dir, entry, sizeof(params->dir)); - BLI_cleanup_dir(G.sce, params->dir); - filelist_free(sfile->files); - filelist_setdir(sfile->files, params->dir); - params->file[0] = '\0'; - params->active_file = -1; - } - } - } + RNA_def_string(ot->srna, "dir", "", 256, "Dir", ""); } -static int bookmark_select_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int bookmark_add_invoke(bContext *C, wmOperator *op, wmEvent *event) { ScrArea *sa= CTX_wm_area(C); - ARegion *ar= CTX_wm_region(C); SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + struct FSMenu* fsmenu = fsmenu_get(); + struct FileSelectParams* params= ED_fileselect_get_params(sfile); - short x, y; - - x = event->x - ar->winrct.xmin; - y = event->y - ar->winrct.ymin; + if (params->dir[0] != '\0') { + char name[FILE_MAX]; + + fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, params->dir, 0, 1); + BLI_make_file_string("/", name, BLI_gethome(), ".Bfs"); + fsmenu_write_file(fsmenu, name); + } - file_select_bookmark(sfile, ar, x, y); ED_area_tag_redraw(sa); return OPERATOR_FINISHED; } -void FILE_OT_select_bookmark(wmOperatorType *ot) +void FILE_OT_add_bookmark(wmOperatorType *ot) { /* identifiers */ - ot->name= "Select Directory"; - ot->idname= "FILE_OT_select_bookmark"; + ot->name= "Add Bookmark"; + ot->idname= "FILE_OT_add_bookmark"; /* api callbacks */ - ot->invoke= bookmark_select_invoke; + ot->invoke= bookmark_add_invoke; ot->poll= ED_operator_file_active; } +static int bookmark_delete_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + ScrArea *sa= CTX_wm_area(C); + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + struct FSMenu* fsmenu = fsmenu_get(); + int nentries = fsmenu_get_nentries(fsmenu, FS_CATEGORY_BOOKMARKS); + if(RNA_struct_find_property(op->ptr, "index")) { + int index = RNA_int_get(op->ptr, "index"); + if ( (index >-1) && (index < nentries)) { + char name[FILE_MAX]; + + fsmenu_remove_entry(fsmenu, FS_CATEGORY_BOOKMARKS, index); + BLI_make_file_string("/", name, BLI_gethome(), ".Bfs"); + fsmenu_write_file(fsmenu, name); + ED_area_tag_redraw(sa); + } + } + + return OPERATOR_FINISHED; +} + +void FILE_OT_delete_bookmark(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Delete Bookmark"; + ot->idname= "FILE_OT_delete_bookmark"; + + /* api callbacks */ + ot->invoke= bookmark_delete_invoke; + ot->poll= ED_operator_file_active; + + RNA_def_int(ot->srna, "index", -1, -1, 20000, "Index", "", -1, 20000); +} + + static int loadimages_invoke(bContext *C, wmOperator *op, wmEvent *event) { ScrArea *sa= CTX_wm_area(C); @@ -548,7 +560,7 @@ int file_parent_exec(bContext *C, wmOperator *unused) filelist_free(sfile->files); sfile->params->active_file = -1; } - ED_area_tag_redraw(CTX_wm_area(C)); + WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); return OPERATOR_FINISHED; @@ -575,8 +587,8 @@ int file_refresh_exec(bContext *C, wmOperator *unused) filelist_setdir(sfile->files, sfile->params->dir); filelist_free(sfile->files); sfile->params->active_file = -1; - } - ED_area_tag_redraw(CTX_wm_area(C)); + } + WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); return OPERATOR_FINISHED; @@ -594,14 +606,58 @@ void FILE_OT_refresh(struct wmOperatorType *ot) ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ } +int file_hidedot_exec(bContext *C, wmOperator *unused) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + + if(sfile->params) { + sfile->params->flag ^= FILE_HIDE_DOT; + filelist_free(sfile->files); + sfile->params->active_file = -1; + WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + } + + return OPERATOR_FINISHED; + +} + + +void FILE_OT_hidedot(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Toggle Hide Dot Files"; + ot->idname= "FILE_OT_hidedot"; + + /* api callbacks */ + ot->exec= file_hidedot_exec; + ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ +} + struct ARegion *file_buttons_region(struct ScrArea *sa) { - ARegion *ar; + ARegion *ar, *arnew; for(ar= sa->regionbase.first; ar; ar= ar->next) if(ar->regiontype==RGN_TYPE_CHANNELS) return ar; - return NULL; + + /* add subdiv level; after header */ + for(ar= sa->regionbase.first; ar; ar= ar->next) + if(ar->regiontype==RGN_TYPE_HEADER) + break; + + /* is error! */ + if(ar==NULL) return NULL; + + arnew= MEM_callocN(sizeof(ARegion), "buttons for file panels"); + + BLI_insertlinkafter(&sa->regionbase, ar, arnew); + arnew->regiontype= RGN_TYPE_CHANNELS; + arnew->alignment= RGN_ALIGN_LEFT; + + arnew->flag = RGN_FLAG_HIDDEN; + + return arnew; } int file_bookmark_toggle_exec(bContext *C, wmOperator *unused) diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c new file mode 100644 index 00000000000..29c759d43c0 --- /dev/null +++ b/source/blender/editors/space_file/file_panels.c @@ -0,0 +1,165 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation, Andrea Weikert + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "BKE_context.h" +#include "BKE_screen.h" + +#include "BLI_blenlib.h" + +#include "DNA_screen_types.h" +#include "DNA_space_types.h" +#include "DNA_userdef_types.h" +#include "DNA_windowmanager_types.h" + +#include "MEM_guardedalloc.h" + +#include "RNA_access.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "file_intern.h" +#include "fsmenu.h" + +#include + +static void do_file_panel_events(bContext *C, void *arg, int event) +{ + +} + +static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory category, int icon, int allow_delete) +{ + uiBlock *block; + uiStyle *style= U.uistyles.first; + int i; + int fontsize = file_font_pointsize(); + struct FSMenu* fsmenu = fsmenu_get(); + int nentries = fsmenu_get_nentries(fsmenu, category); + + uiLayoutSetAlignment(pa->layout, UI_LAYOUT_ALIGN_LEFT); + block= uiLayoutFreeBlock(pa->layout); + uiBlockSetHandleFunc(block, do_file_panel_events, NULL); + uiBlockSetEmboss(block, UI_EMBOSSP); + uiBlockBeginAlign(block); + for (i=0; i< nentries;++i) { + char dir[FILE_MAX]; + char temp[FILE_MAX]; + uiLayout* layout = uiLayoutRow(pa->layout, UI_LAYOUT_ALIGN_LEFT); + char *entry = fsmenu_get_entry(fsmenu, category, i); + + /* create nice bookmark name, shows last directory in the full path currently */ + BLI_strncpy(temp, entry, FILE_MAX); + BLI_add_slash(temp); + BLI_getlastdir(temp, dir, FILE_MAX); + BLI_del_slash(dir); + + /* operator shows the short bookmark name, should eventually have tooltip */ + uiItemStringO(layout, dir, icon, "FILE_OT_select_bookmark", "dir", entry); + if (allow_delete && fsmenu_can_save(fsmenu, category, i) ) + uiItemIntO(layout, "", ICON_X, "FILE_OT_delete_bookmark", "index", i); + } + uiBlockEndAlign(block); +} + +static void file_panel_system(const bContext *C, Panel *pa) +{ + file_panel_category(C, pa, FS_CATEGORY_SYSTEM, ICON_DISK_DRIVE, 0); +} + +static void file_panel_bookmarks(const bContext *C, Panel *pa) +{ + file_panel_category(C, pa, FS_CATEGORY_BOOKMARKS, ICON_BOOKMARKS, 1); +} + + +static void file_panel_recent(const bContext *C, Panel *pa) +{ + file_panel_category(C, pa, FS_CATEGORY_RECENT, ICON_FILE_FOLDER, 0); +} + + +static void file_panel_operator(const bContext *C, Panel *pa) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + struct wmOperator *op = sfile ? sfile->op : NULL; + uiBlock *block; + int sy; + + block= uiLayoutFreeBlock(pa->layout); + uiBlockSetHandleFunc(block, do_file_panel_events, NULL); + + sy= 0; + if (op) { + uiBlockBeginAlign(block); + RNA_STRUCT_BEGIN(op->ptr, prop) { + if(strcmp(RNA_property_identifier(prop), "rna_type") == 0) + continue; + if(strcmp(RNA_property_identifier(prop), "filename") == 0) + continue; + + uiItemFullR(pa->layout, NULL, 0, op->ptr, prop, -1, 0, 0, 0, 0); + } + RNA_STRUCT_END; + uiBlockEndAlign(block); + } + uiBlockLayoutResolve(C, block, NULL, &sy); + uiEndBlock(C, block); + uiDrawBlock(C, block); +} + + +void file_panels_register(ARegionType *art) +{ + PanelType *pt; + + pt= MEM_callocN(sizeof(PanelType), "spacetype file system directories"); + strcpy(pt->idname, "FILE_PT_system"); + strcpy(pt->label, "System"); + pt->draw= file_panel_system; + BLI_addtail(&art->paneltypes, pt); + + pt= MEM_callocN(sizeof(PanelType), "spacetype file bookmarks"); + strcpy(pt->idname, "FILE_PT_bookmarks"); + strcpy(pt->label, "Bookmarks"); + pt->draw= file_panel_bookmarks; + BLI_addtail(&art->paneltypes, pt); + + pt= MEM_callocN(sizeof(PanelType), "spacetype file recent directories"); + strcpy(pt->idname, "FILE_PT_recent"); + strcpy(pt->label, "Recent"); + pt->draw= file_panel_recent; + BLI_addtail(&art->paneltypes, pt); + + pt= MEM_callocN(sizeof(PanelType), "spacetype file operator properties"); + strcpy(pt->idname, "FILE_PT_operator"); + strcpy(pt->label, "Operator"); + pt->draw= file_panel_operator; + BLI_addtail(&art->paneltypes, pt); +} \ No newline at end of file diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 766dec7c064..573aed72728 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -823,16 +823,16 @@ void filelist_sort(struct FileList* filelist, short sort) int num;/* , act= 0; */ switch(sort) { - case FILE_SORTALPHA: + case FILE_SORT_ALPHA: qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_name); break; - case FILE_SORTDATE: + case FILE_SORT_TIME: qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_date); break; - case FILE_SORTSIZE: + case FILE_SORT_SIZE: qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_size); break; - case FILE_SORTEXTENS: + case FILE_SORT_EXTENSION: qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_extension); } diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h index f10c89926d6..e929e028849 100644 --- a/source/blender/editors/space_file/filelist.h +++ b/source/blender/editors/space_file/filelist.h @@ -49,7 +49,6 @@ void filelist_free_icons(); struct FileList * filelist_copy(struct FileList* filelist); int filelist_find(struct FileList* filelist, char *file); void filelist_free(struct FileList* filelist); -void filelist_freelib(struct FileList* filelist); void filelist_sort(struct FileList* filelist, short sort); int filelist_numfiles(struct FileList* filelist); const char * filelist_dir(struct FileList* filelist); diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 9c0bcc6b991..e1d81138e5a 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -84,7 +84,7 @@ FileSelectParams* ED_fileselect_get_params(struct SpaceFile *sfile) { if (!sfile->params) { - ED_fileselect_set_params(sfile, "", "/", 0, FILE_SHORTDISPLAY, 0, FILE_SORTALPHA); + ED_fileselect_set_params(sfile, "", "/", 0, FILE_SHORTDISPLAY, 0, FILE_SORT_ALPHA); } return sfile->params; } diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 59e8dcf82e6..a87ad4c4fd8 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -65,7 +65,6 @@ struct _FSMenuEntry { char *path; short save; - short xs, ys; }; typedef struct FSMenu @@ -74,9 +73,6 @@ typedef struct FSMenu FSMenuEntry *fsmenu_bookmarks; FSMenuEntry *fsmenu_recent; - FSMenuCategory selected_category; - int selected_entry; - } FSMenu; static FSMenu *g_fsmenu = NULL; @@ -89,17 +85,6 @@ struct FSMenu* fsmenu_get(void) return g_fsmenu; } -void fsmenu_select_entry(struct FSMenu* fsmenu, FSMenuCategory category, int index) -{ - fsmenu->selected_category = category; - fsmenu->selected_entry = index; -} - -int fsmenu_is_selected(struct FSMenu* fsmenu, FSMenuCategory category, int index) -{ - return (category==fsmenu->selected_category) && (index==fsmenu->selected_entry); -} - static FSMenuEntry *fsmenu_get_category(struct FSMenu* fsmenu, FSMenuCategory category) { FSMenuEntry *fsms = NULL; @@ -154,36 +139,16 @@ char *fsmenu_get_entry(struct FSMenu* fsmenu, FSMenuCategory category, int idx) return fsme?fsme->path:NULL; } -void fsmenu_set_pos(struct FSMenu* fsmenu, FSMenuCategory category, int idx, short xs, short ys) +short fsmenu_can_save (struct FSMenu* fsmenu, FSMenuCategory category, int idx) { FSMenuEntry *fsme; for (fsme= fsmenu_get_category(fsmenu, category); fsme && idx; fsme= fsme->next) idx--; - if (fsme) { - fsme->xs = xs; - fsme->ys = ys; - } + return fsme?fsme->save:0; } -int fsmenu_get_pos (struct FSMenu* fsmenu, FSMenuCategory category, int idx, short* xs, short* ys) -{ - FSMenuEntry *fsme; - - for (fsme= fsmenu_get_category(fsmenu, category); fsme && idx; fsme= fsme->next) - idx--; - - if (fsme) { - *xs = fsme->xs; - *ys = fsme->ys; - return 1; - } - - return 0; -} - - void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, char *path, int sorted, short save) { FSMenuEntry *prev; diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h index c51c45b7dc4..2cab622d523 100644 --- a/source/blender/editors/space_file/fsmenu.h +++ b/source/blender/editors/space_file/fsmenu.h @@ -52,22 +52,15 @@ int fsmenu_get_nentries (struct FSMenu* fsmenu, FSMenuCategory category); */ char* fsmenu_get_entry (struct FSMenu* fsmenu, FSMenuCategory category, int index); -void fsmenu_select_entry (struct FSMenu* fsmenu, FSMenuCategory category, int index); - -int fsmenu_is_selected (struct FSMenu* fsmenu, FSMenuCategory category, int index); - - /** Sets the position of the fsmenu entry at @a index */ -void fsmenu_set_pos (struct FSMenu* fsmenu, FSMenuCategory category, int index, short xs, short ys); - - /** Returns the position of the fsmenu entry at @a index. return value is 1 if successful, 0 otherwise */ -int fsmenu_get_pos (struct FSMenu* fsmenu, FSMenuCategory category, int index, short* xs, short* ys); - /** Inserts a new fsmenu entry with the given @a path. * Duplicate entries are not added. * @param sorted Should entry be inserted in sorted order? */ void fsmenu_insert_entry (struct FSMenu* fsmenu, FSMenuCategory category, char *path, int sorted, short save); + /** Return whether the entry was created by the user and can be saved and deleted */ +short fsmenu_can_save (struct FSMenu* fsmenu, FSMenuCategory category, int index); + /** Removes the fsmenu entry at the given @a index. */ void fsmenu_remove_entry (struct FSMenu* fsmenu, FSMenuCategory category, int index); diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 37d8f2bffa4..156c7d6f9be 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -163,6 +163,46 @@ static SpaceLink *file_duplicate(SpaceLink *sl) return (SpaceLink *)sfilen; } +static void file_refresh(const bContext *C, ScrArea *sa) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + FileSelectParams *params = ED_fileselect_get_params(sfile); + + if (!sfile->files) { + sfile->files = filelist_new(); + filelist_setdir(sfile->files, params->dir); + params->active_file = -1; // added this so it opens nicer (ton) + } + filelist_hidedot(sfile->files, params->flag & FILE_HIDE_DOT); + if (filelist_empty(sfile->files)) + { + filelist_readdir(sfile->files); + } + filelist_setfilter(sfile->files, params->flag & FILE_FILTER ? params->filter : 0); + if(params->sort!=FILE_SORT_NONE) filelist_sort(sfile->files, params->sort); +} + +static void file_listener(ScrArea *sa, wmNotifier *wmn) +{ + SpaceFile* sfile = (SpaceFile*)sa->spacedata.first; + + /* context changes */ + switch(wmn->category) { + case NC_FILE: + switch (wmn->data) { + case ND_FILELIST: + if (sfile->files) filelist_free(sfile->files); + ED_area_tag_refresh(sa); + ED_area_tag_redraw(sa); + break; + case ND_PARAMS: + ED_area_tag_refresh(sa); + ED_area_tag_redraw(sa); + break; + } + break; + } +} /* add handlers, stuff you only do once or on area/region changes */ static void file_main_area_init(wmWindowManager *wm, ARegion *ar) @@ -188,31 +228,9 @@ static void file_main_area_draw(const bContext *C, ARegion *ar) View2D *v2d= &ar->v2d; View2DScrollers *scrollers; float col[3]; - - if (!sfile->files) { - sfile->files = filelist_new(); - filelist_setdir(sfile->files, params->dir); - params->active_file = -1; // added this so it opens nicer (ton) - } layout = ED_fileselect_get_layout(sfile, ar); - if (filelist_empty(sfile->files)) - { - unsigned int filter = 0; - filelist_hidedot(sfile->files, params->flag & FILE_HIDE_DOT); - if (params->flag & FILE_FILTER) { - filter = params->filter ; - } else { - filter = 0; - } - - filelist_setfilter(sfile->files, filter); - filelist_readdir(sfile->files); - - if(params->sort!=FILE_SORTALPHA) filelist_sort(sfile->files, params->sort); - } - /* clear and setup matrix */ UI_GetThemeColor3fv(TH_BACK, col); glClearColor(col[0], col[1], col[2], 0.0); @@ -274,20 +292,25 @@ void file_operatortypes(void) WM_operatortype_append(FILE_OT_parent); WM_operatortype_append(FILE_OT_refresh); WM_operatortype_append(FILE_OT_bookmark_toggle); + WM_operatortype_append(FILE_OT_add_bookmark); + WM_operatortype_append(FILE_OT_delete_bookmark); + WM_operatortype_append(FILE_OT_hidedot); } /* NOTE: do not add .blend file reading on this level */ void file_keymap(struct wmWindowManager *wm) { ListBase *keymap= WM_keymap_listbase(wm, "File", SPACE_FILE, 0); + WM_keymap_add_item(keymap, "FILE_OT_bookmark_toggle", NKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_select_border", BKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_highlight", MOUSEMOVE, KM_ANY, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_parent", PKEY, KM_PRESS, 0, 0); - + WM_keymap_add_item(keymap, "FILE_OT_add_bookmark", BKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "FILE_OT_hidedot", HKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_loadimages", TIMER1, KM_ANY, KM_ANY, 0); - + keymap= WM_keymap_listbase(wm, "FileBookmark", SPACE_FILE, 0); WM_keymap_add_item(keymap, "FILE_OT_select_bookmark", LEFTMOUSE, KM_PRESS, 0, 0); } @@ -295,56 +318,31 @@ void file_keymap(struct wmWindowManager *wm) static void file_channel_area_init(wmWindowManager *wm, ARegion *ar) { - ListBase *keymap; - - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy); - - /* own keymap */ - keymap= WM_keymap_listbase(wm, "FileBookmark", SPACE_FILE, 0); - WM_event_add_keymap_handler_bb(&ar->handlers, keymap, NULL, NULL); + ED_region_panels_init(wm, ar); } static void file_channel_area_draw(const bContext *C, ARegion *ar) { - View2D *v2d= &ar->v2d; - float col[3]; - - UI_GetThemeColor3fv(TH_PANEL, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - /* data... */ - UI_view2d_view_ortho(C, v2d); + ED_region_panels(C, ar, 1, NULL); +} - file_draw_fsmenu(C, ar); +static void file_channel_area_listener(ARegion *ar, wmNotifier *wmn) +{ + /* context changes */ + switch(wmn->category) { + + } } /* add handlers, stuff you only do once or on area/region changes */ static void file_header_area_init(wmWindowManager *wm, ARegion *ar) { - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); + ED_region_header_init(ar); } static void file_header_area_draw(const bContext *C, ARegion *ar) { - float col[3]; - - /* clear */ - if(ED_screen_area_active(C)) - UI_GetThemeColor3fv(TH_HEADER, col); - else - UI_GetThemeColor3fv(TH_HEADERDESEL, col); - - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - /* set view2d view matrix for scrolling (without scrollers) */ - UI_view2d_view_ortho(C, &ar->v2d); - - file_header_buttons(C, ar); - - /* restore view matrix? */ - UI_view2d_view_restore(C); + ED_region_header(C, ar); } /* add handlers, stuff you only do once or on area/region changes */ @@ -386,6 +384,8 @@ void ED_spacetype_file(void) st->free= file_free; st->init= file_init; st->duplicate= file_duplicate; + st->refresh= file_refresh; + st->listener= file_listener; st->operatortypes= file_operatortypes; st->keymap= file_keymap; @@ -405,6 +405,7 @@ void ED_spacetype_file(void) art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; art->init= file_header_area_init; art->draw= file_header_area_draw; + // art->listener= file_header_area_listener; BLI_addhead(&st->regiontypes, art); /* regions: ui */ @@ -421,10 +422,13 @@ void ED_spacetype_file(void) art->regionid = RGN_TYPE_CHANNELS; art->minsizex= 240; art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; + art->listener= file_channel_area_listener; art->init= file_channel_area_init; art->draw= file_channel_area_draw; BLI_addhead(&st->regiontypes, art); - + file_panels_register(art); + + BKE_spacetype_register(st); } diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index a08a23c1263..edf9bcbd896 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -1088,7 +1088,7 @@ static void image_pack_cb(bContext *C, void *ima_v, void *iuser_v) } if ((G.fileflags & G_AUTOPACK) == 0) { - unpackImage(ima, PF_ASK); + unpackImage(NULL, ima, PF_ASK); /* XXX report errors */ ED_undo_push(C, "Unpack image"); } } @@ -1097,7 +1097,7 @@ static void image_pack_cb(bContext *C, void *ima_v, void *iuser_v) if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) { // XXX error("Can't pack painted image. Save image or use Repack as PNG."); } else { - ima->packedfile = newPackedFile(ima->name); + ima->packedfile = newPackedFile(NULL, ima->name); /* XXX report errors */ ED_undo_push(C, "Pack image"); } } diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 8f9bb0d05fe..24781cc115e 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1114,7 +1114,7 @@ static int pack_exec(bContext *C, wmOperator *op) if(as_png) BKE_image_memorypack(ima); else - ima->packedfile= newPackedFile(ima->name); + ima->packedfile= newPackedFile(op->reports, ima->name); return OPERATOR_FINISHED; } @@ -1162,13 +1162,96 @@ void IMAGE_OT_pack(wmOperatorType *ot) /********************* unpack operator *********************/ +/* XXX move this to some place where it can be reused */ + +const EnumPropertyItem unpack_method_items[] = { + {PF_USE_LOCAL, "USE_LOCAL", 0, "Use Local File", ""}, + {PF_WRITE_LOCAL, "WRITE_LOCAL", 0, "Write Local File (overwrite existing)", ""}, + {PF_USE_ORIGINAL, "USE_ORIGINAL", 0, "Use Original File", ""}, + {PF_WRITE_ORIGINAL, "WRITE_ORIGINAL", 0, "Write Original File (overwrite existing)", ""}, + {0, NULL, 0, NULL, NULL}}; + +void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder, PackedFile *pf) +{ + uiPopupMenu *pup; + uiLayout *layout; + char line[FILE_MAXDIR + FILE_MAXFILE + 100]; + char local_name[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX]; + + strcpy(local_name, abs_name); + BLI_splitdirstring(local_name, fi); + sprintf(local_name, "//%s/%s", folder, fi); + + pup= uiPupMenuBegin(C, "Unpack file", 0); + layout= uiPupMenuLayout(pup); + + uiItemEnumO(layout, "Remove Pack", 0, opname, "method", PF_REMOVE); + + if(strcmp(abs_name, local_name)) { + switch(checkPackedFile(local_name, pf)) { + case PF_NOFILE: + sprintf(line, "Create %s", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_LOCAL); + break; + case PF_EQUAL: + sprintf(line, "Use %s (identical)", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_USE_LOCAL); + break; + case PF_DIFFERS: + sprintf(line, "Use %s (differs)", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_USE_LOCAL); + sprintf(line, "Overwrite %s", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_LOCAL); + break; + } + } + + switch(checkPackedFile(abs_name, pf)) { + case PF_NOFILE: + sprintf(line, "Create %s", abs_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_ORIGINAL); + break; + case PF_EQUAL: + sprintf(line, "Use %s (identical)", abs_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_USE_ORIGINAL); + break; + case PF_DIFFERS: + sprintf(line, "Use %s (differs)", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_USE_ORIGINAL); + sprintf(line, "Overwrite %s", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_ORIGINAL); + break; + } + + uiPupMenuEnd(C, pup); +} + static int unpack_exec(bContext *C, wmOperator *op) { Image *ima= CTX_data_edit_image(C); + int method= RNA_enum_get(op->ptr, "method"); - if(!ima) + if(!ima || !ima->packedfile) + return OPERATOR_CANCELLED; + + if(ima->source==IMA_SRC_SEQUENCE || ima->source==IMA_SRC_MOVIE) { + BKE_report(op->reports, RPT_ERROR, "Can't unpack movie or image sequence."); return OPERATOR_CANCELLED; - if(!ima->packedfile) + } + + if(G.fileflags & G_AUTOPACK) + BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save."); + + unpackImage(op->reports, ima, method); + + return OPERATOR_FINISHED; +} + +static int unpack_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + Image *ima= CTX_data_edit_image(C); + + if(!ima || !ima->packedfile) return OPERATOR_CANCELLED; if(ima->source==IMA_SRC_SEQUENCE || ima->source==IMA_SRC_MOVIE) { @@ -1179,7 +1262,7 @@ static int unpack_exec(bContext *C, wmOperator *op) if(G.fileflags & G_AUTOPACK) BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save."); - unpackImage(ima, PF_ASK); + unpack_menu(C, "IMAGE_OT_unpack", ima->name, "textures", ima->packedfile); return OPERATOR_FINISHED; } @@ -1192,10 +1275,14 @@ void IMAGE_OT_unpack(wmOperatorType *ot) /* api callbacks */ ot->exec= unpack_exec; + ot->invoke= unpack_invoke; ot->poll= space_image_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack."); } /******************** sample image operator ********************/ diff --git a/source/blender/editors/space_info/info_header.c b/source/blender/editors/space_info/info_header.c deleted file mode 100644 index 7b65a70117c..00000000000 --- a/source/blender/editors/space_info/info_header.c +++ /dev/null @@ -1,507 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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) 2008 Blender Foundation. - * All rights reserved. - * - * - * Contributor(s): Blender Foundation - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include - -#include "DNA_packedFile_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_userdef_types.h" -#include "DNA_windowmanager_types.h" - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_bpath.h" - -#include "BKE_context.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_main.h" -#include "BKE_packedFile.h" -#include "BKE_screen.h" - -#include "ED_screen.h" -#include "ED_types.h" -#include "ED_util.h" - -#include "WM_api.h" -#include "WM_types.h" - -#include "BIF_gl.h" -#include "BIF_glutil.h" - -#include "UI_interface.h" -#include "UI_resources.h" -#include "UI_view2d.h" - -#include "IMB_imbuf_types.h" - -#include "info_intern.h" - -static int pupmenu() {return 0;} -static int okee() {return 0;} -static int error() {return 0;} - -/* ************************ header area region *********************** */ - -#define B_STOPRENDER 1 -#define B_STOPCAST 2 -#define B_STOPANIM 3 - -static void do_viewmenu(bContext *C, void *arg, int event) -{ -} - -static uiBlock *dummy_viewmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - ScrArea *curarea= CTX_wm_area(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "dummy_viewmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_viewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nothing yet", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - uiEndBlock(C, block); - - return block; -} - -static int buttons_do_unpack() -{ - int how; - char menu[2048]; - char *line = menu; - int ret_value = 1, count = 0; - - count = countPackedFiles(); - - if(!count) { - pupmenu("No packed files. Autopack disabled"); - return ret_value; - } - if (count == 1) - line += sprintf(line, "Unpack 1 file%%t"); - else - line += sprintf(line, "Unpack %d files%%t", count); - - line += sprintf(line, "|Use files in current directory (create when necessary)%%x%d", PF_USE_LOCAL); - line += sprintf(line, "|Write files to current directory (overwrite existing files)%%x%d", PF_WRITE_LOCAL); - line += sprintf(line, "|%%l|Use files in original location (create when necessary)%%x%d", PF_USE_ORIGINAL); - line += sprintf(line, "|Write files to original location (overwrite existing files)%%x%d", PF_WRITE_ORIGINAL); - line += sprintf(line, "|%%l|Disable AutoPack, keep all packed files %%x%d", PF_KEEP); - line += sprintf(line, "|Ask for each file %%x%d", PF_ASK); - - how = pupmenu(menu); - - if(how == -1) - ret_value = 0; - else { - if (how != PF_KEEP) unpackAll(how); - G.fileflags &= ~G_AUTOPACK; - } - - return ret_value; -} - -static void check_packAll() -{ - // first check for dirty images - Image *ima; - - for(ima = G.main->image.first; ima; ima= ima->id.next) { - if (ima->ibufs.first) { /* XXX FIX */ - ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL); - - if (ibuf && (ibuf->userflags &= IB_BITMAPDIRTY)) - break; - } - } - - if (ima == NULL || okee("Some images are painted on. These changes will be lost. Continue ?")) { - packAll(); - G.fileflags |= G_AUTOPACK; - } -} - -static void do_info_externalfiles(bContext *C, void *arg, int event) -{ - switch (event) { - - case 1: /* pack data */ - check_packAll(); - break; - case 3: /* unpack data */ - if (buttons_do_unpack() != 0) { - /* Clear autopack bit only if user selected one of the unpack options */ - G.fileflags &= ~G_AUTOPACK; - } - break; - case 10: /* make all paths relative */ - if (G.relbase_valid) { - int tot,changed,failed,linked; - char str[512]; - char txtname[24]; /* text block name */ - txtname[0] = '\0'; - makeFilesRelative(txtname, &tot, &changed, &failed, &linked); - if (failed) sprintf(str, "Make Relative%%t|Total files %i|Changed %i|Failed %i, See Text \"%s\"|Linked %i", tot, changed, failed, txtname, linked); - else sprintf(str, "Make Relative%%t|Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); - pupmenu(str); - } else { - pupmenu("Can't set relative paths with an unsaved blend file"); - } - break; - case 11: /* make all paths absolute */ - { - int tot,changed,failed,linked; - char str[512]; - char txtname[24]; /* text block name */ - txtname[0] = '\0'; - makeFilesAbsolute(txtname, &tot, &changed, &failed, &linked); - sprintf(str, "Make Absolute%%t|Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); - if (failed) sprintf(str, "Make Absolute%%t|Total files %i|Changed %i|Failed %i, See Text \"%s\"|Linked %i", tot, changed, failed, txtname, linked); - else sprintf(str, "Make Absolute%%t|Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); - - pupmenu(str); - } - break; - case 12: /* check images exist */ - { - char txtname[24]; /* text block name */ - txtname[0] = '\0'; - - /* run the missing file check */ - checkMissingFiles( txtname ); - - if (txtname[0] == '\0') { - okee("No external files missing"); - } else { - char str[128]; - sprintf(str, "Missing files listed in Text \"%s\"", txtname ); - error(str); - } - } - break; - case 13: /* search for referenced files that are not available */ -// XXX if(curarea->spacetype==SPACE_INFO) { -// ScrArea *sa; -// sa= closest_bigger_area(); -// areawinset(sa->win); -// } -// activate_fileselect(FILE_SPECIAL, "Find Missing Files", "", findMissingFiles); - break; - } - -} - - -uiBlock *info_externalfiles(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "info_externalfiles", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_info_externalfiles, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack into .blend file", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unpack into Files...", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make all Paths Relative", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 10, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make all Paths Absolute", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Report Missing Files...", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 12, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Missing Files...", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 13, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - - - -static void info_filemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - - uiLayoutSetOperatorContext(layout, WM_OP_EXEC_AREA); - uiItemO(layout, NULL, 0, "WM_OT_read_homefile"); - uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_AREA); - uiItemO(layout, NULL, 0, "WM_OT_open_mainfile"); -// uiDefIconTextBlockBut(block, info_openrecentmenu, NULL, ICON_RIGHTARROW_THIN, "Open Recent",0, yco-=20, 120, 19, ""); -// uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recover Last Session", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - - uiItemS(layout); - - uiLayoutSetOperatorContext(layout, WM_OP_EXEC_AREA); - uiItemO(layout, NULL, 0, "WM_OT_save_mainfile"); - uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_AREA); - uiItemO(layout, NULL, 0, "WM_OT_save_as_mainfile"); - -#if 0 - if(U.flag & USER_FILECOMPRESS) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Compress File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 35, "Enable file compression"); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Compress File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 35, "Enable file compression"); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Rendered Image...|F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Screenshot Subwindow|Ctrl F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 24, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Screenshot All|Ctrl Shift F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 25, ""); -#if GAMEBLENDER == 1 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Game As Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, ""); -#endif - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Default Settings|Ctrl U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 31, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Load Factory Settings", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 32, ""); - - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Append or Link|Shift F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Append or Link (Image Browser)|Ctrl F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); -// uiDefIconTextBlockBut(block, info_file_importmenu, NULL, ICON_RIGHTARROW_THIN, "Import", 0, yco-=20, menuwidth, 19, ""); -// uiDefIconTextBlockBut(block, info_file_exportmenu, NULL, ICON_RIGHTARROW_THIN, "Export", 0, yco-=20, menuwidth, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, info_externalfiles, NULL, ICON_RIGHTARROW_THIN, "External Data",0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Quit Blender|Ctrl Q", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - uiBlockSetDirection(block, UI_DOWN); - uiTextBoundsBlock(block, 80); - - uiEndBlock(C, block); - return block; -#endif -} - - -static void do_info_buttons(bContext *C, void *arg, int event) -{ - switch(event) { - case B_STOPRENDER: - G.afbreek= 1; - break; - case B_STOPCAST: - WM_jobs_stop(CTX_wm_manager(C), CTX_wm_screen(C)); - break; - case B_STOPANIM: - ED_screen_animation_timer(C, 0, 0); - break; - } -} - -static void screen_idpoin_handle(bContext *C, ID *id, int event) -{ - switch(event) { - case UI_ID_BROWSE: - /* exception: can't set screens inside of area/region handers */ - WM_event_add_notifier(C, NC_SCREEN|ND_SCREENBROWSE, id); - break; - case UI_ID_DELETE: - ED_undo_push(C, ""); - break; - case UI_ID_RENAME: - break; - case UI_ID_ADD_NEW: - /* XXX not implemented */ - break; - case UI_ID_OPEN: - /* XXX not implemented */ - break; - case UI_ID_ALONE: - /* XXX not implemented */ - break; - case UI_ID_PIN: - break; - } -} - -static void scene_idpoin_handle(bContext *C, ID *id, int event) -{ - switch(event) { - case UI_ID_BROWSE: - /* exception: can't set screens inside of area/region handers */ - WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, id); - break; - case UI_ID_DELETE: - ED_undo_push(C, ""); - break; - case UI_ID_RENAME: - break; - case UI_ID_ADD_NEW: - /* XXX not implemented */ - break; - case UI_ID_OPEN: - /* XXX not implemented */ - break; - case UI_ID_ALONE: - /* XXX not implemented */ - break; - case UI_ID_PIN: - break; - } -} - -static void operator_call_cb(struct bContext *C, void *arg1, void *arg2) -{ - wmOperatorType *ot= arg2; - - if(ot) - WM_operator_name_call(C, ot->idname, WM_OP_INVOKE_DEFAULT, NULL); -} - -static void operator_search_cb(const struct bContext *C, void *arg, char *str, uiSearchItems *items) -{ - wmOperatorType *ot = WM_operatortype_first(); - - for(; ot; ot= ot->next) { - - if(BLI_strcasestr(ot->name, str)) { - if(ot->poll==NULL || ot->poll((bContext *)C)) { - char name[256]; - int len= strlen(ot->name); - - /* display name for menu, can hold hotkey */ - BLI_strncpy(name, ot->name, 256); - - /* check for hotkey */ - if(len < 256-6) { - if(WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, &name[len+1], 256-len-1)) - name[len]= '|'; - } - - if(0==uiSearchItemAdd(items, name, ot, 0)) - break; - } - } - } -} - -void info_header_buttons(const bContext *C, ARegion *ar) -{ - wmWindow *win= CTX_wm_window(C); - bScreen *screen= CTX_wm_screen(C); - ScrArea *sa= CTX_wm_area(C); - uiBlock *block; - int xco, yco= 3; - - block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS); - uiBlockSetHandleFunc(block, do_info_buttons, NULL); - - xco= ED_area_header_standardbuttons(C, block, yco); - - if((sa->flag & HEADER_NO_PULLDOWN)==0) { - int xmax; - - xmax= GetButStringLength("File"); - uiDefMenuBut(block, info_filemenu, NULL, "File", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - xmax= GetButStringLength("Add"); - uiDefPulldownBut(block, dummy_viewmenu, sa, "Add", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - xmax= GetButStringLength("Timeline"); - uiDefPulldownBut(block, dummy_viewmenu, sa, "Timeline", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - xmax= GetButStringLength("Game"); - uiDefPulldownBut(block, dummy_viewmenu, sa, "Game", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - xmax= GetButStringLength("Render"); - uiDefPulldownBut(block, dummy_viewmenu, sa, "Render", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - xmax= GetButStringLength("Help"); - uiDefPulldownBut(block, dummy_viewmenu, NULL, "Help", xco, yco, xmax-3, 20, ""); - xco+= xmax; - } - - uiBlockSetEmboss(block, UI_EMBOSS); - - if(screen->full==0) { - xco= uiDefIDPoinButs(block, CTX_data_main(C), NULL, (ID*)win->screen, ID_SCR, NULL, xco, yco, - screen_idpoin_handle, UI_ID_BROWSE|UI_ID_RENAME|UI_ID_ADD_NEW|UI_ID_DELETE); - xco += 8; - xco= uiDefIDPoinButs(block, CTX_data_main(C), NULL, (ID*)screen->scene, ID_SCE, NULL, xco, yco, - scene_idpoin_handle, UI_ID_BROWSE|UI_ID_RENAME|UI_ID_ADD_NEW|UI_ID_DELETE); - xco += 8; - } - - if(WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C))) { - uiDefIconTextBut(block, BUT, B_STOPRENDER, ICON_REC, "Render", xco+5,yco,75,19, NULL, 0.0f, 0.0f, 0, 0, "Stop rendering"); - xco+= 80; - } - if(WM_jobs_test(CTX_wm_manager(C), CTX_wm_screen(C))) { - uiDefIconTextBut(block, BUT, B_STOPCAST, ICON_REC, "Capture", xco+5,yco,85,19, NULL, 0.0f, 0.0f, 0, 0, "Stop screencast"); - xco+= 90; - } - if(screen->animtimer) { - uiDefIconTextBut(block, BUT, B_STOPANIM, ICON_REC, "Anim Player", xco+5,yco,85,19, NULL, 0.0f, 0.0f, 0, 0, "Stop animation playback"); - xco+= 90; - } - - { - static char search[256]= ""; - uiBut *but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, xco+5, yco, 120, 19, ""); - - uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb); - - xco+= 125; - } - - - /* always as last */ - UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); - - uiEndBlock(C, block); - uiDrawBlock(C, block); -} - - diff --git a/source/blender/editors/space_info/info_intern.h b/source/blender/editors/space_info/info_intern.h index 213c0688f20..519364b58d9 100644 --- a/source/blender/editors/space_info/info_intern.h +++ b/source/blender/editors/space_info/info_intern.h @@ -30,10 +30,17 @@ /* internal exports only */ +struct wmOperatorType; /* info_header.c */ void info_header_buttons(const bContext *C, ARegion *ar); +void FILE_OT_pack_all(struct wmOperatorType *ot); +void FILE_OT_unpack_all(struct wmOperatorType *ot); +void FILE_OT_make_paths_relative(struct wmOperatorType *ot); +void FILE_OT_make_paths_absolute(struct wmOperatorType *ot); +void FILE_OT_report_missing_files(struct wmOperatorType *ot); +void FILE_OT_find_missing_files(struct wmOperatorType *ot); #endif /* ED_INFO_INTERN_H */ diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c new file mode 100644 index 00000000000..56f925a2e81 --- /dev/null +++ b/source/blender/editors/space_info/info_ops.c @@ -0,0 +1,397 @@ +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2008 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "DNA_packedFile_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_userdef_types.h" +#include "DNA_windowmanager_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" +#include "BLI_bpath.h" + +#include "BKE_context.h" +#include "BKE_global.h" +#include "BKE_image.h" +#include "BKE_main.h" +#include "BKE_packedFile.h" +#include "BKE_report.h" +#include "BKE_screen.h" + +#include "ED_screen.h" +#include "ED_types.h" +#include "ED_util.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "BIF_gl.h" +#include "BIF_glutil.h" + +#include "UI_interface.h" +#include "UI_resources.h" + +#include "IMB_imbuf_types.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "WM_types.h" + +#include "info_intern.h" + +/********************* pack all operator *********************/ + +static int pack_all_exec(bContext *C, wmOperator *op) +{ + Main *bmain= CTX_data_main(C); + + packAll(bmain, op->reports); + G.fileflags |= G_AUTOPACK; + + return OPERATOR_FINISHED; +} + +static int pack_all_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + Main *bmain= CTX_data_main(C); + Image *ima; + ImBuf *ibuf; + + // first check for dirty images + for(ima=bmain->image.first; ima; ima=ima->id.next) { + if(ima->ibufs.first) { /* XXX FIX */ + ibuf= BKE_image_get_ibuf(ima, NULL); + + if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) + break; + } + } + + if(ima) { + uiPupMenuOkee(C, "FILE_OT_pack_all", "Some images are painted on. These changes will be lost. Continue?"); + return OPERATOR_CANCELLED; + } + + return pack_all_exec(C, op); +} + +void FILE_OT_pack_all(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Pack All"; + ot->idname= "FILE_OT_pack_all"; + + /* api callbacks */ + ot->exec= pack_all_exec; + ot->invoke= pack_all_invoke; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************* unpack all operator *********************/ + +static const EnumPropertyItem unpack_all_method_items[] = { + {PF_USE_LOCAL, "USE_LOCAL", 0, "Use files in current directory (create when necessary)", ""}, + {PF_WRITE_LOCAL, "WRITE_LOCAL", 0, "Write files to current directory (overwrite existing files)", ""}, + {PF_USE_ORIGINAL, "USE_ORIGINAL", 0, "Use files in original location (create when necessary)", ""}, + {PF_WRITE_ORIGINAL, "WRITE_ORIGINAL", 0, "Write files to original location (overwrite existing files)", ""}, + {PF_KEEP, "KEEP", 0, "Disable AutoPack, keep all packed files", ""}, + {PF_ASK, "ASK", 0, "Ask for each file", ""}, + {0, NULL, 0, NULL, NULL}}; + +static int unpack_all_exec(bContext *C, wmOperator *op) +{ + Main *bmain= CTX_data_main(C); + int method= RNA_enum_get(op->ptr, "method"); + + if(method != PF_KEEP) unpackAll(bmain, op->reports, method); /* XXX PF_ASK can't work here */ + G.fileflags &= ~G_AUTOPACK; + + return OPERATOR_FINISHED; +} + +static int unpack_all_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + Main *bmain= CTX_data_main(C); + uiPopupMenu *pup; + uiLayout *layout; + char title[128]; + int count = 0; + + count = countPackedFiles(bmain); + + if(!count) { + BKE_report(op->reports, RPT_WARNING, "No packed files. Autopack disabled."); + G.fileflags &= ~G_AUTOPACK; + return OPERATOR_CANCELLED; + } + + if(count == 1) + sprintf(title, "Unpack 1 file"); + else + sprintf(title, "Unpack %d files", count); + + pup= uiPupMenuBegin(C, title, 0); + layout= uiPupMenuLayout(pup); + + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); + uiItemsEnumO(layout, "FILE_OT_unpack_all", "method"); + + uiPupMenuEnd(C, pup); + + return OPERATOR_CANCELLED; +} + +void FILE_OT_unpack_all(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Unpack All"; + ot->idname= "FILE_OT_unpack_all"; + + /* api callbacks */ + ot->exec= unpack_all_exec; + ot->invoke= unpack_all_invoke; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_enum(ot->srna, "method", unpack_all_method_items, PF_USE_LOCAL, "Method", "How to unpack."); +} + +/********************* make paths relative operator *********************/ + +static int make_paths_relative_exec(bContext *C, wmOperator *op) +{ + char txtname[24]; /* text block name */ + int tot, changed, failed, linked; + + if(!G.relbase_valid) { + BKE_report(op->reports, RPT_WARNING, "Can't set relative paths with an unsaved blend file."); + return OPERATOR_CANCELLED; + } + + txtname[0] = '\0'; + makeFilesRelative(txtname, &tot, &changed, &failed, &linked); + + if(failed) + BKE_reportf(op->reports, RPT_ERROR, "Total files %i|Changed %i|Failed %i, See Text \"%s\"|Linked %i", tot, changed, failed, txtname, linked); + else + BKE_reportf(op->reports, RPT_INFO, "Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); + + return OPERATOR_FINISHED; +} + +void FILE_OT_make_paths_relative(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Make All Paths Relative"; + ot->idname= "FILE_OT_make_paths_relative"; + + /* api callbacks */ + ot->exec= make_paths_relative_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************* make paths absolute operator *********************/ + +static int make_paths_absolute_exec(bContext *C, wmOperator *op) +{ + char txtname[24]; /* text block name */ + int tot, changed, failed, linked; + + if(!G.relbase_valid) { + BKE_report(op->reports, RPT_WARNING, "Can't set absolute paths with an unsaved blend file."); + return OPERATOR_CANCELLED; + } + + txtname[0] = '\0'; + makeFilesAbsolute(txtname, &tot, &changed, &failed, &linked); + + if(failed) + BKE_reportf(op->reports, RPT_ERROR, "Total files %i|Changed %i|Failed %i, See Text \"%s\"|Linked %i", tot, changed, failed, txtname, linked); + else + BKE_reportf(op->reports, RPT_INFO, "Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); + + return OPERATOR_FINISHED; +} + +void FILE_OT_make_paths_absolute(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Make All Paths Absolute"; + ot->idname= "FILE_OT_make_paths_absolute"; + + /* api callbacks */ + ot->exec= make_paths_absolute_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************* report missing files operator *********************/ + +static int report_missing_files_exec(bContext *C, wmOperator *op) +{ + char txtname[24]; /* text block name */ + + txtname[0] = '\0'; + + /* run the missing file check */ + checkMissingFiles(txtname); + + if(txtname[0] == '\0') + BKE_report(op->reports, RPT_INFO, "No external files missing."); + else + BKE_reportf(op->reports, RPT_ERROR, "Missing files listed in Text \"%s\"", txtname); + + return OPERATOR_FINISHED; +} + +void FILE_OT_report_missing_files(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Report Missing Files..."; + ot->idname= "FILE_OT_report_missing_files"; + + /* api callbacks */ + ot->exec= report_missing_files_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************* find missing files operator *********************/ + +static int find_missing_files_exec(bContext *C, wmOperator *op) +{ + char *filename; + + filename= RNA_string_get_alloc(op->ptr, "filename", NULL, 0); + findMissingFiles(filename); + MEM_freeN(filename); + + return OPERATOR_FINISHED; +} + +static int find_missing_files_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + /* XXX file open button text "Find Missing Files" */ + WM_event_add_fileselect(C, op); + return OPERATOR_RUNNING_MODAL; +} + +void FILE_OT_find_missing_files(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Find Missing Files..."; + ot->idname= "FILE_OT_find_missing_files"; + + /* api callbacks */ + ot->exec= find_missing_files_exec; + ot->invoke= find_missing_files_invoke; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_string_file_path(ot->srna, "filename", "", FILE_MAX, "Filename", "File path of image to open."); +} + +#if 0 +static void info_filemenu(bContext *C, uiLayout *layout, void *arg_unused) +{ + + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_AREA); + uiItemO(layout, NULL, 0, "WM_OT_read_homefile"); + uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_AREA); + uiItemO(layout, NULL, 0, "WM_OT_open_mainfile"); +// uiDefIconTextBlockBut(block, info_openrecentmenu, NULL, ICON_RIGHTARROW_THIN, "Open Recent",0, yco-=20, 120, 19, ""); +// uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recover Last Session", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); + + uiItemS(layout); + + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_AREA); + uiItemO(layout, NULL, 0, "WM_OT_save_mainfile"); + uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_AREA); + uiItemO(layout, NULL, 0, "WM_OT_save_as_mainfile"); + +#if 0 + if(U.flag & USER_FILECOMPRESS) { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Compress File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 35, "Enable file compression"); + } else { + uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Compress File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 35, "Enable file compression"); + } + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Rendered Image...|F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Screenshot Subwindow|Ctrl F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 24, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Screenshot All|Ctrl Shift F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 25, ""); +#if GAMEBLENDER == 1 + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Game As Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, ""); +#endif + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Default Settings|Ctrl U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 31, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Load Factory Settings", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 32, ""); + + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Append or Link|Shift F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Append or Link (Image Browser)|Ctrl F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); +// uiDefIconTextBlockBut(block, info_file_importmenu, NULL, ICON_RIGHTARROW_THIN, "Import", 0, yco-=20, menuwidth, 19, ""); +// uiDefIconTextBlockBut(block, info_file_exportmenu, NULL, ICON_RIGHTARROW_THIN, "Export", 0, yco-=20, menuwidth, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBlockBut(block, info_externalfiles, NULL, ICON_RIGHTARROW_THIN, "External Data",0, yco-=20, 120, 19, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Quit Blender|Ctrl Q", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); + uiBlockSetDirection(block, UI_DOWN); + uiTextBoundsBlock(block, 80); + + uiEndBlock(C, block); + return block; +#endif +} +#endif + diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index d72ecd60da9..7b24e8f4e07 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -151,7 +151,12 @@ static void info_main_area_draw(const bContext *C, ARegion *ar) void info_operatortypes(void) { - + WM_operatortype_append(FILE_OT_pack_all); + WM_operatortype_append(FILE_OT_unpack_all); + WM_operatortype_append(FILE_OT_make_paths_relative); + WM_operatortype_append(FILE_OT_make_paths_absolute); + WM_operatortype_append(FILE_OT_report_missing_files); + WM_operatortype_append(FILE_OT_find_missing_files); } void info_keymap(struct wmWindowManager *wm) @@ -162,29 +167,12 @@ void info_keymap(struct wmWindowManager *wm) /* add handlers, stuff you only do once or on area/region changes */ static void info_header_area_init(wmWindowManager *wm, ARegion *ar) { - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); + ED_region_header_init(ar); } static void info_header_area_draw(const bContext *C, ARegion *ar) { - float col[3]; - - /* clear */ - if(ED_screen_area_active(C)) - UI_GetThemeColor3fv(TH_HEADER, col); - else - UI_GetThemeColor3fv(TH_HEADERDESEL, col); - - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - /* set view2d view matrix for scrolling (without scrollers) */ - UI_view2d_view_ortho(C, &ar->v2d); - - info_header_buttons(C, ar); - - /* restore view matrix? */ - UI_view2d_view_restore(C); + ED_region_header(C, ar); } static void info_main_area_listener(ARegion *ar, wmNotifier *wmn) diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 79ea90864f3..5edcd203e16 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -4557,6 +4557,7 @@ static void view3d_sculpt_menu(bContext *C, uiLayout *layout, void *arg_unused) uiItemR(layout, NULL, 0, &rna, "rake", 0, 0, 0); uiItemR(layout, NULL, 0, &rna, "anchored", 0, 0, 0); uiItemR(layout, NULL, 0, &rna, "space", 0, 0, 0); + uiItemR(layout, NULL, 0, &rna, "smooth_stroke", 0, 0, 0); uiItemR(layout, NULL, 0, &rna, "flip_direction", 0, 0, 0); } diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 34a935103a7..ea365d59ac7 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -204,7 +204,7 @@ static uiBlock *tool_search_menu(bContext *C, ARegion *ar, void *arg_listbase) uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, OP_MAX_TYPENAME, 10, 0, 150, 19, ""); - uiButSetSearchFunc(but, operator_search_cb, arg_listbase, operator_call_cb); + uiButSetSearchFunc(but, operator_search_cb, arg_listbase, operator_call_cb, NULL); uiBoundsBlock(block, 6); uiBlockSetDirection(block, UI_DOWN); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 782d426641f..b57f4a91004 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1431,6 +1431,9 @@ static int game_engine_exec(bContext *C, wmOperator *unused) Scene *startscene = CTX_data_scene(C); #if GAMEBLENDER == 1 + + view3d_operator_needs_opengl(C); + SaveState(C); StartKetsjiShell(C, 1); RestoreState(C); diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 8ce0b439b29..93a974c1180 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -84,6 +84,7 @@ typedef struct Brush { #define BRUSH_ANCHORED 256 #define BRUSH_DIR_IN 512 #define BRUSH_SPACE 1024 +#define BRUSH_SMOOTH_STROKE 2048 /* Brush.blend */ #define BRUSH_BLEND_MIX 0 diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index d0cd169905f..3549cdbe75f 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -439,6 +439,9 @@ typedef struct ToolSettings { VPaint *wpaint; /* weight paint */ Sculpt *sculpt; + /* Vertex groups */ + float vgroup_weight; + /* Subdivide Settings */ short cornertype; short editbutflag; @@ -470,7 +473,6 @@ typedef struct ToolSettings { float uvcalc_radius; float uvcalc_cubesize; float uvcalc_margin; - float pad; short uvcalc_mapdir; short uvcalc_mapalign; short uvcalc_flag; @@ -537,7 +539,7 @@ typedef struct ToolSettings { /* Alt+RMB option */ char edge_mode; - /* transform */ + /* Transform */ short snap_mode, snap_flag, snap_target; short proportional, prop_mode; } ToolSettings; diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index 4891f44e1cd..d9d68490425 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -53,6 +53,7 @@ typedef struct bScreen { ListBase regionbase; /* screen level regions (menus), runtime only */ struct Scene *scene; + struct Scene *newscene; /* temporary when switching */ short full; /* fade out? */ short winid; /* winid from WM, starts with 1 */ @@ -104,6 +105,9 @@ typedef struct Panel { /* the part from uiBlock that needs saved in file */ int sortorder; /* panels are aligned according to increasing sortorder */ struct Panel *paneltab; /* this panel is tabbed in *paneltab */ void *activedata; /* runtime for panel manipulation */ + + int list_scroll, list_size; + char list_search[64]; } Panel; typedef struct Header { diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index f66c0c31fda..329a3aac148 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -165,6 +165,48 @@ typedef struct SpaceSeq { struct bGPdata *gpd; /* grease-pencil data */ } SpaceSeq; +typedef struct FileSelectParams { + char title[24]; /* title, also used for the text of the execute button */ + char dir[240]; /* directory */ + char file[80]; /* file */ + + short flag; /* settings for filter, hiding files and display mode */ + short sort; /* sort order */ + short display; /* display mode flag */ + short filter; /* filter when (flags & FILE_FILTER) is true */ + + /* XXX - temporary, better move to filelist */ + short active_bookmark; + short pad; + int active_file; + int selstate; + + /* XXX --- still unused -- */ + short f_fp; /* show font preview */ + short menu; /* currently selected option in pupmenu */ + char fp_str[8]; /* string to use for font preview */ + + char *pupmenu; /* allows menu for save options - result stored in menup */ + + /* XXX --- end unused -- */ +} FileSelectParams; + +/* FileSelectParams.display */ +enum FileDisplayTypeE { + FILE_SHORTDISPLAY = 1, + FILE_LONGDISPLAY, + FILE_IMGDISPLAY +}; + +/* FileSelectParams.sort */ +enum FileSortTypeE { + FILE_SORT_NONE = 0, + FILE_SORT_ALPHA = 1, + FILE_SORT_EXTENSION, + FILE_SORT_TIME, + FILE_SORT_SIZE +}; + typedef struct SpaceFile { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ @@ -555,12 +597,6 @@ typedef struct SpaceImaSel { #define FILE_FILTER 256 #define FILE_BOOKMARKS 512 -/* sfile->sort */ -#define FILE_SORTALPHA 0 -#define FILE_SORTDATE 1 -#define FILE_SORTSIZE 2 -#define FILE_SORTEXTENS 3 - /* files in filesel list: 2=ACTIVE */ #define HILITE 1 #define BLENDERFILE 4 diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index e02d2984771..b63fb35c193 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -88,7 +88,8 @@ typedef struct wmWindow { int winid, pad; /* winid also in screens, is for retrieving this window after read */ - struct bScreen *screen; /* active screen */ + struct bScreen *screen; /* active screen */ + struct bScreen *newscreen; /* temporary when switching */ char screenname[32]; /* MAX_ID_NAME for matching window with active screen after file read */ short posx, posy, sizex, sizey; /* window coords */ diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index cf74a863401..c0a1c979147 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -174,6 +174,7 @@ extern StructRNA RNA_ExplodeModifier; extern StructRNA RNA_ExpressionController; extern StructRNA RNA_Event; extern StructRNA RNA_FCurve; +extern StructRNA RNA_FileSelectParams; extern StructRNA RNA_FModifier; extern StructRNA RNA_FModifierCycles; extern StructRNA RNA_FModifierEnvelope; @@ -374,6 +375,7 @@ extern StructRNA RNA_SpaceNLA; extern StructRNA RNA_SpaceOutliner; extern StructRNA RNA_SpaceSequenceEditor; extern StructRNA RNA_SpaceTextEditor; +extern StructRNA RNA_SpaceFileBrowser; extern StructRNA RNA_SpaceUVEditor; extern StructRNA RNA_SpeedControlSequence; extern StructRNA RNA_SpotLamp; @@ -605,6 +607,14 @@ int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop); int RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr); int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr); +/* efficient functions to set properties for arrays */ +int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, PropertyRNA *itemprop, RawArray *array); +int RNA_property_collection_raw_get(struct ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, char *propname, void *array, RawPropertyType type, int len); +int RNA_property_collection_raw_set(struct ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, char *propname, void *array, RawPropertyType type, int len); +int RNA_raw_type_sizeof(RawPropertyType type); +RawPropertyType RNA_property_raw_type(PropertyRNA *prop); + + /* to create ID property groups */ void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop); void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop); diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 75f52ededd0..923191cba78 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -110,7 +110,9 @@ typedef enum PropertyFlag { PROP_BUILTIN = 128, PROP_EXPORT = 256, PROP_RUNTIME = 512, - PROP_IDPROPERTY = 1024 + PROP_IDPROPERTY = 1024, + PROP_RAW_ACCESS = 8192, + PROP_RAW_ARRAY = 16384, } PropertyFlag; typedef struct CollectionPropertyIterator { @@ -132,6 +134,21 @@ typedef struct CollectionPointerLink { PointerRNA ptr; } CollectionPointerLink; +typedef enum RawPropertyType { + PROP_RAW_CHAR, + PROP_RAW_SHORT, + PROP_RAW_INT, + PROP_RAW_FLOAT, + PROP_RAW_DOUBLE +} RawPropertyType; + +typedef struct RawArray { + void *array; + RawPropertyType type; + int len; + int stride; +} RawArray; + /* Iterator Utility */ typedef struct EnumPropertyItem { diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 222b9bc4d29..4098ca70356 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -762,6 +762,42 @@ static char *rna_def_property_end_func(FILE *f, StructRNA *srna, PropertyRNA *pr return func; } +static void rna_set_raw_property(PropertyDefRNA *dp, PropertyRNA *prop) +{ + if(dp->dnapointerlevel != 0) + return; + if(!dp->dnatype || !dp->dnaname || !dp->dnastructname) + return; + + if(strcmp(dp->dnatype, "char") == 0) { + prop->rawtype= PROP_RAW_CHAR; + prop->flag |= PROP_RAW_ACCESS; + } + else if(strcmp(dp->dnatype, "short") == 0) { + prop->rawtype= PROP_RAW_SHORT; + prop->flag |= PROP_RAW_ACCESS; + } + else if(strcmp(dp->dnatype, "int") == 0) { + prop->rawtype= PROP_RAW_INT; + prop->flag |= PROP_RAW_ACCESS; + } + else if(strcmp(dp->dnatype, "float") == 0) { + prop->rawtype= PROP_RAW_FLOAT; + prop->flag |= PROP_RAW_ACCESS; + } + else if(strcmp(dp->dnatype, "double") == 0) { + prop->rawtype= PROP_RAW_DOUBLE; + prop->flag |= PROP_RAW_ACCESS; + } +} + +static void rna_set_raw_offset(FILE *f, StructRNA *srna, PropertyRNA *prop) +{ + PropertyDefRNA *dp= rna_find_struct_property_def(srna, prop); + + fprintf(f, "\toffsetof(%s, %s), %d", dp->dnastructname, dp->dnaname, prop->rawtype); +} + static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) { PropertyRNA *prop; @@ -773,6 +809,9 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; if(!prop->arraylength) { + if(!bprop->get && !bprop->set && !dp->booleanbit) + rna_set_raw_property(dp, prop); + bprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)bprop->get); bprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)bprop->set); } @@ -786,10 +825,16 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) IntPropertyRNA *iprop= (IntPropertyRNA*)prop; if(!prop->arraylength) { + if(!iprop->get && !iprop->set) + rna_set_raw_property(dp, prop); + iprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)iprop->get); iprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)iprop->set); } else { + if(!iprop->getarray && !iprop->setarray) + rna_set_raw_property(dp, prop); + iprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)iprop->getarray); iprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)iprop->setarray); } @@ -799,10 +844,16 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; if(!prop->arraylength) { + if(!fprop->get && !fprop->set) + rna_set_raw_property(dp, prop); + fprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)fprop->get); fprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)fprop->set); } else { + if(!fprop->getarray && !fprop->setarray) + rna_set_raw_property(dp, prop); + fprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)fprop->getarray); fprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)fprop->setarray); } @@ -841,6 +892,13 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) else if(dp->dnalengthname || dp->dnalengthfixed) cprop->length= (void*)rna_def_property_length_func(f, srna, prop, dp, (char*)cprop->length); + /* test if we can allow raw array access, if it is using our standard + * array get/next function, we can be sure it is an actual array */ + if(cprop->next && cprop->get) + if(strcmp((char*)cprop->next, "rna_iterator_array_next") == 0 && + strcmp((char*)cprop->get, "rna_iterator_array_get") == 0) + prop->flag |= PROP_RAW_ARRAY; + cprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)cprop->get); cprop->begin= (void*)rna_def_property_begin_func(f, srna, prop, dp, (char*)cprop->begin); cprop->next= (void*)rna_def_property_next_func(f, srna, prop, dp, (char*)cprop->next); @@ -1538,7 +1596,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr DefRNA.error= 1; } break; - } + } case PROP_BOOLEAN: { BooleanPropertyRNA *bprop= (BooleanPropertyRNA*)prop; unsigned int i; @@ -1558,7 +1616,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr fprintf(f, "};\n\n"); } break; - } + } case PROP_INT: { IntPropertyRNA *iprop= (IntPropertyRNA*)prop; unsigned int i; @@ -1578,7 +1636,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr fprintf(f, "};\n\n"); } break; - } + } case PROP_FLOAT: { FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; unsigned int i; @@ -1598,7 +1656,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr fprintf(f, "};\n\n"); } break; - } + } default: break; } @@ -1613,10 +1671,14 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr rna_print_c_string(f, prop->identifier); fprintf(f, ", %d, ", prop->flag); rna_print_c_string(f, prop->name); fprintf(f, ",\n\t"); - rna_print_c_string(f, prop->description); fprintf(f, ",\n"); - fprintf(f, "%d, ", prop->icon); + rna_print_c_string(f, prop->description); fprintf(f, ",\n\t"); + fprintf(f, "%d,\n", prop->icon); fprintf(f, "\t%s, %s, %d,\n", rna_property_typename(prop->type), rna_property_subtypename(prop->subtype), prop->arraylength); - fprintf(f, "\t%s, %d, %s},\n", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable)); + fprintf(f, "\t%s, %d, %s,\n", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable)); + + if(prop->flag & PROP_RAW_ACCESS) rna_set_raw_offset(f, srna, prop); + else fprintf(f, "\t0, 0"); + fprintf(f, "},\n"); switch(prop->type) { case PROP_BOOLEAN: { @@ -1625,7 +1687,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr if(prop->arraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); else fprintf(f, "NULL\n"); break; - } + } case PROP_INT: { IntPropertyRNA *iprop= (IntPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %s, %s,\n\t", rna_function_string(iprop->get), rna_function_string(iprop->set), rna_function_string(iprop->getarray), rna_function_string(iprop->setarray), rna_function_string(iprop->range)); @@ -1638,7 +1700,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr if(prop->arraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); else fprintf(f, "NULL\n"); break; - } + } case PROP_FLOAT: { FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %s, %s, ", rna_function_string(fprop->get), rna_function_string(fprop->set), rna_function_string(fprop->getarray), rna_function_string(fprop->setarray), rna_function_string(fprop->range)); @@ -1652,13 +1714,13 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr if(prop->arraylength) fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); else fprintf(f, "NULL\n"); break; - } + } case PROP_STRING: { StringPropertyRNA *sprop= (StringPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %d, ", rna_function_string(sprop->get), rna_function_string(sprop->length), rna_function_string(sprop->set), sprop->maxlength); rna_print_c_string(f, sprop->defaultvalue); fprintf(f, "\n"); break; - } + } case PROP_ENUM: { EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, ", rna_function_string(eprop->get), rna_function_string(eprop->set), rna_function_string(eprop->itemf)); @@ -1668,14 +1730,14 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr fprintf(f, "NULL, "); fprintf(f, "%d, %d\n", eprop->totitem, eprop->defaultvalue); break; - } + } case PROP_POINTER: { PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, ", rna_function_string(pprop->get), rna_function_string(pprop->set), rna_function_string(pprop->typef)); if(pprop->type) fprintf(f, "&RNA_%s\n", (char*)pprop->type); else fprintf(f, "NULL\n"); break; - } + } case PROP_COLLECTION: { CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, ", rna_function_string(cprop->begin), rna_function_string(cprop->next), rna_function_string(cprop->end), rna_function_string(cprop->get), rna_function_string(cprop->length), rna_function_string(cprop->lookupint), rna_function_string(cprop->lookupstring)); @@ -1891,6 +1953,7 @@ static void rna_generate(BlenderRNA *brna, FILE *f, char *filename, char *api_fi fprintf(f, "#include \n"); fprintf(f, "#include \n"); fprintf(f, "#include \n\n"); + fprintf(f, "#include \n\n"); fprintf(f, "#include \"DNA_ID.h\"\n"); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 7defb0676c6..cc8704dc350 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1522,6 +1522,323 @@ int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, co } } +int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, PropertyRNA *itemprop, RawArray *array) +{ + CollectionPropertyIterator iter; + ArrayIterator *internal; + char *arrayp; + + if(!(prop->flag & PROP_RAW_ARRAY) || !(itemprop->flag & PROP_RAW_ACCESS)) + return 0; + + RNA_property_collection_begin(ptr, prop, &iter); + + if(iter.valid) { + /* get data from array iterator and item property */ + internal= iter.internal; + arrayp= (iter.valid)? iter.ptr.data: NULL; + + if(internal->skip || !RNA_property_editable(&iter.ptr, itemprop)) { + /* we might skip some items, so it's not a proper array */ + RNA_property_collection_end(&iter); + return 0; + } + + array->array= arrayp + itemprop->rawoffset; + array->stride= internal->itemsize; + array->len= ((char*)internal->endptr - arrayp)/internal->itemsize; + array->type= itemprop->rawtype; + } + else + memset(array, 0, sizeof(RawArray)); + + RNA_property_collection_end(&iter); + + return 1; +} + +#define RAW_GET(dtype, var, raw, a) \ +{ \ + switch(raw.type) { \ + case PROP_RAW_CHAR: var = (dtype)((char*)raw.array)[a]; break; \ + case PROP_RAW_SHORT: var = (dtype)((short*)raw.array)[a]; break; \ + case PROP_RAW_INT: var = (dtype)((int*)raw.array)[a]; break; \ + case PROP_RAW_FLOAT: var = (dtype)((float*)raw.array)[a]; break; \ + case PROP_RAW_DOUBLE: var = (dtype)((double*)raw.array)[a]; break; \ + default: var = (dtype)0; \ + } \ +} + +#define RAW_SET(dtype, raw, a, var) \ +{ \ + switch(raw.type) { \ + case PROP_RAW_CHAR: ((char*)raw.array)[a] = (char)var; break; \ + case PROP_RAW_SHORT: ((short*)raw.array)[a] = (short)var; break; \ + case PROP_RAW_INT: ((int*)raw.array)[a] = (int)var; break; \ + case PROP_RAW_FLOAT: ((float*)raw.array)[a] = (float)var; break; \ + case PROP_RAW_DOUBLE: ((double*)raw.array)[a] = (double)var; break; \ + } \ +} + +int RNA_raw_type_sizeof(RawPropertyType type) +{ + switch(type) { + case PROP_RAW_CHAR: return sizeof(char); + case PROP_RAW_SHORT: return sizeof(short); + case PROP_RAW_INT: return sizeof(int); + case PROP_RAW_FLOAT: return sizeof(float); + case PROP_RAW_DOUBLE: return sizeof(double); + default: return 0; + } +} + +static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, char *propname, void *inarray, RawPropertyType intype, int inlen, int set) +{ + StructRNA *ptype; + PointerRNA itemptr; + PropertyRNA *itemprop, *iprop; + PropertyType itemtype; + RawArray in; + int itemlen= 0; + + /* initialize in array, stride assumed 0 in following code */ + in.array= inarray; + in.type= intype; + in.len= inlen; + in.stride= 0; + + ptype= RNA_property_pointer_type(ptr, prop); + + /* try to get item property pointer */ + RNA_pointer_create(NULL, ptype, NULL, &itemptr); + itemprop= RNA_struct_find_property(&itemptr, propname); + + if(itemprop) { + /* we have item property pointer */ + RawArray out; + + /* check type */ + itemtype= RNA_property_type(itemprop); + + if(!ELEM3(itemtype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) { + BKE_report(reports, RPT_ERROR, "Only boolean, int and float properties supported."); + return 0; + } + + /* check item array */ + itemlen= RNA_property_array_length(itemprop); + + /* try to access as raw array */ + if(RNA_property_collection_raw_array(ptr, prop, itemprop, &out)) { + if(in.len != itemlen*out.len) { + BKE_reportf(reports, RPT_ERROR, "Array length mismatch (expected %d, got %d).", out.len*itemlen, in.len); + return 0; + } + + /* matching raw types */ + if(out.type == in.type) { + void *inp= in.array; + void *outp= out.array; + int a, size; + + itemlen= (itemlen == 0)? 1: itemlen; + size= RNA_raw_type_sizeof(out.type) * itemlen; + + for(a=0; a in.len) { + BKE_reportf(reports, RPT_ERROR, "Array length mismatch (got %d, expected more).", in.len); + err= 1; + break; + } + + if(itemlen == 0) { + /* handle conversions */ + if(set) { + switch(itemtype) { + case PROP_BOOLEAN: { + int b; + RAW_GET(int, b, in, a); + RNA_property_boolean_set(&itemptr, iprop, b); + break; + } + case PROP_INT: { + int i; + RAW_GET(int, i, in, a); + RNA_property_int_set(&itemptr, iprop, i); + break; + } + case PROP_FLOAT: { + float f; + RAW_GET(float, f, in, a); + RNA_property_float_set(&itemptr, iprop, f); + break; + } + default: + break; + } + } + else { + switch(itemtype) { + case PROP_BOOLEAN: { + int b= RNA_property_boolean_get(&itemptr, iprop); + RAW_SET(int, in, a, b); + break; + } + case PROP_INT: { + int i= RNA_property_int_get(&itemptr, iprop); + RAW_SET(int, in, a, i); + break; + } + case PROP_FLOAT: { + float f= RNA_property_float_get(&itemptr, iprop); + RAW_SET(float, in, a, f); + break; + } + default: + break; + } + } + a++; + } + else { + /* allocate temporary array if needed */ + if(tmparray && tmplen != itemlen) { + MEM_freeN(tmparray); + tmparray= NULL; + } + if(!tmparray) { + tmparray= MEM_callocN(sizeof(float)*itemlen, "RNA tmparray\n"); + tmplen= itemlen; + } + + /* handle conversions */ + if(set) { + switch(itemtype) { + case PROP_BOOLEAN: { + for(j=0; jrawtype; +} + +int RNA_property_collection_raw_get(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, char *propname, void *array, RawPropertyType type, int len) +{ + return rna_raw_access(reports, ptr, prop, propname, array, type, len, 0); +} + +int RNA_property_collection_raw_set(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, char *propname, void *array, RawPropertyType type, int len) +{ + return rna_raw_access(reports, ptr, prop, propname, array, type, len, 1); +} + /* Standard iterator functions */ void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip) @@ -2733,23 +3050,46 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop if(prop->flag & PROP_RNAPTR) { *((PointerRNA*)dest)= *((PointerRNA*)src); + break; + } + + if (ptype!=srna && !RNA_struct_is_a(srna, ptype)) { + fprintf(stderr, "%s.%s: wrong type for parameter %s, an object of type %s was expected, passed an object of type %s\n", tid, fid, pid, RNA_struct_identifier(ptype), RNA_struct_identifier(srna)); + return -1; } - else if (ptype!=srna) { - if (!RNA_struct_is_a(srna, ptype)) { - fprintf(stderr, "%s.%s: wrong type for parameter %s, an object of type %s was expected, passed an object of type %s\n", tid, fid, pid, RNA_struct_identifier(ptype), RNA_struct_identifier(ptype)); - return -1; - } - - *((void**)dest)= *((void**)src); - } + + *((void**)dest)= *((void**)src); break; } case PROP_COLLECTION: { - /* XXX collections are not supported yet */ - fprintf(stderr, "%s.%s: for parameter %s, collections are not supported yet\n", tid, fid, pid); - return -1; + StructRNA *ptype; + ListBase *lb, *clb; + Link *link; + CollectionPointerLink *clink; + + if (ftype!='C') { + fprintf(stderr, "%s.%s: wrong type for parameter %s, a collection was expected\n", tid, fid, pid); + return -1; + } + + lb= (ListBase *)src; + clb= (ListBase *)dest; + ptype= RNA_property_pointer_type(ptr, prop); + + if (ptype!=srna && !RNA_struct_is_a(srna, ptype)) { + fprintf(stderr, "%s.%s: wrong type for parameter %s, a collection of objects of type %s was expected, passed a collection of objects of type %s\n", tid, fid, pid, RNA_struct_identifier(ptype), RNA_struct_identifier(srna)); + return -1; + } + + for (link= lb->first; link; link= link->next) { + clink= MEM_callocN(sizeof(CollectionPointerLink), "CCollectionPointerLink"); + RNA_pointer_create(NULL, srna, link, &clink->ptr); + BLI_addtail(clb, clink); + } + + break; } default: { @@ -2847,6 +3187,13 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, srna, tid, fid, pid); break; } + case PROP_COLLECTION: + { + StructRNA *srna= va_arg(args, StructRNA*); + ListBase *arg= va_arg(args, ListBase*); + err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, srna, tid, fid, pid); + break; + } default: { /* handle errors */ @@ -2904,6 +3251,13 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata, srna, tid, fid, pid); break; } + case PROP_COLLECTION: + { + StructRNA *srna= va_arg(args, StructRNA*); + ListBase **arg= va_arg(args, ListBase**); + err= rna_function_parameter_parse(&funcptr, parm, type, ftype, len, arg, retdata, srna, tid, fid, pid); + break; + } default: { /* handle errors */ @@ -2932,3 +3286,4 @@ int RNA_function_call_direct_va_lookup(bContext *C, ReportList *reports, Pointer return 0; } + diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 90617d01833..7355261c5aa 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -184,6 +184,10 @@ void rna_def_brush(BlenderRNA *brna) prop= RNA_def_property(srna, "space", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE); RNA_def_property_ui_text(prop, "Space", "Limit brush application to the distance specified by spacing."); + + prop= RNA_def_property(srna, "smooth_stroke", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SMOOTH_STROKE); + RNA_def_property_ui_text(prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path."); /* not exposed in the interface yet prop= RNA_def_property(srna, "fixed_tex", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 8200a21f4ac..5c4b6a95524 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -535,10 +535,8 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna) srna= RNA_def_struct(brna, "CopyLocationConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Copy Location Constraint", "Copies the location of the target."); - RNA_def_struct_sdna(srna, "bConstraint"); - prop= RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_PERCENTAGE); - RNA_def_property_float_sdna(prop, NULL, "headtail"); + RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1."); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c index 07a50235733..7fa27348002 100644 --- a/source/blender/makesrna/intern/rna_context.c +++ b/source/blender/makesrna/intern/rna_context.c @@ -40,11 +40,11 @@ static PointerRNA rna_Context_manager_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_WindowManager, CTX_wm_manager(C)); } -/*static PointerRNA rna_Context_window_get(PointerRNA *ptr) +static PointerRNA rna_Context_window_get(PointerRNA *ptr) { bContext *C= (bContext*)ptr->data; return rna_pointer_inherit_refine(ptr, &RNA_Window, CTX_wm_window(C)); -}*/ +} static PointerRNA rna_Context_screen_get(PointerRNA *ptr) { @@ -96,6 +96,12 @@ static PointerRNA rna_Context_scene_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_Scene, CTX_data_scene(C)); } +static PointerRNA rna_Context_tool_settings_get(PointerRNA *ptr) +{ + bContext *C= (bContext*)ptr->data; + return rna_pointer_inherit_refine(ptr, &RNA_ToolSettings, CTX_data_tool_settings(C)); +} + #else void RNA_def_context(BlenderRNA *brna) @@ -113,10 +119,10 @@ void RNA_def_context(BlenderRNA *brna) RNA_def_property_struct_type(prop, "WindowManager"); RNA_def_property_pointer_funcs(prop, "rna_Context_manager_get", NULL, NULL); - /* prop= RNA_def_property(srna, "window", PROP_POINTER, PROP_NONE); + prop= RNA_def_property(srna, "window", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Window"); - RNA_def_property_pointer_funcs(prop, "rna_Context_window_get", NULL, NULL); */ + RNA_def_property_pointer_funcs(prop, "rna_Context_window_get", NULL, NULL); prop= RNA_def_property(srna, "screen", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -153,6 +159,12 @@ void RNA_def_context(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Scene"); RNA_def_property_pointer_funcs(prop, "rna_Context_scene_get", NULL, NULL); + + prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_struct_type(prop, "ToolSettings"); + RNA_def_property_pointer_funcs(prop, "rna_Context_tool_settings_get", NULL, NULL); + } #endif diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index bd449acc050..715f03bb3f1 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -112,7 +112,7 @@ StructDefRNA *rna_find_struct_def(StructRNA *srna) return NULL; } -PropertyDefRNA *rna_find_struct_property_def(PropertyRNA *prop) +PropertyDefRNA *rna_find_struct_property_def(StructRNA *srna, PropertyRNA *prop) { StructDefRNA *dsrna; PropertyDefRNA *dprop; @@ -123,7 +123,7 @@ PropertyDefRNA *rna_find_struct_property_def(PropertyRNA *prop) return NULL; } - dsrna= rna_find_struct_def(DefRNA.laststruct); + dsrna= rna_find_struct_def(srna); dprop= dsrna->cont.properties.last; for (; dprop; dprop= dprop->prev) if (dprop->prop==prop) @@ -150,7 +150,7 @@ PropertyDefRNA *rna_find_property_def(PropertyRNA *prop) return NULL; } - dprop= rna_find_struct_property_def(prop); + dprop= rna_find_struct_property_def(DefRNA.laststruct, prop); if (dprop) return dprop; @@ -1311,7 +1311,7 @@ static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop, const char *stru StructDefRNA *ds; PropertyDefRNA *dp; - dp= rna_find_struct_property_def(prop); + dp= rna_find_struct_property_def(DefRNA.laststruct, prop); if (dp==NULL) return NULL; ds= rna_find_struct_def((StructRNA*)dp->cont); @@ -1371,7 +1371,7 @@ void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *struc RNA_def_property_boolean_sdna(prop, structname, propname, booleanbit); - dp= rna_find_struct_property_def(prop); + dp= rna_find_struct_property_def(DefRNA.laststruct, prop); if(dp) dp->booleannegative= 1; @@ -1468,7 +1468,7 @@ void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structnam RNA_def_property_enum_sdna(prop, structname, propname); - dp= rna_find_struct_property_def(prop); + dp= rna_find_struct_property_def(DefRNA.laststruct, prop); if(dp) dp->enumbitflags= 1; @@ -2249,7 +2249,6 @@ int rna_parameter_size(PropertyRNA *parm) #endif } case PROP_COLLECTION: - /* XXX does not work yet */ return sizeof(ListBase); } } diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 4a6fdf5a734..c74e46c17da 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -39,6 +39,8 @@ #ifdef RNA_RUNTIME +#include "IMB_imbuf_types.h" + static void rna_Image_animated_update(bContext *C, PointerRNA *ptr) { Image *ima= (Image*)ptr->data; @@ -52,6 +54,18 @@ static void rna_Image_animated_update(bContext *C, PointerRNA *ptr) } } +static int rna_Image_dirty_get(PointerRNA *ptr) +{ + Image *ima= (Image*)ptr->data; + ImBuf *ibuf; + + for(ibuf=ima->ibufs.first; ibuf; ibuf=ibuf->next) + if(ibuf->userflags & IB_BITMAPDIRTY) + return 1; + + return 0; +} + #else static void rna_def_imageuser(BlenderRNA *brna) @@ -174,6 +188,11 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha."); RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + prop= RNA_def_property(srna, "dirty", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Dirty", "Image has changed and is not saved."); + /* generated image (image_generated_change_cb) */ prop= RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "gen_type"); diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index c2f2e1d519f..5b8e7c76636 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -256,6 +256,7 @@ void rna_freelistN(struct ListBase *listbase); StructDefRNA *rna_find_struct_def(StructRNA *srna); FunctionDefRNA *rna_find_function_def(FunctionRNA *func); PropertyDefRNA *rna_find_parameter_def(PropertyRNA *parm); +PropertyDefRNA *rna_find_struct_property_def(StructRNA *srna, PropertyRNA *prop); /* Pointer Handling */ diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 8bae21cca2b..401b430ebc9 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -146,6 +146,10 @@ struct PropertyRNA { /* callback for testing if editable/evaluated */ EditableFunc editable; + + /* raw access */ + int rawoffset; + RawPropertyType rawtype; }; /* Property Types */ diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index e56760f5ca3..39fa6f36f23 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -34,10 +34,37 @@ #include "DNA_meshdata_types.h" #include "DNA_object_types.h" -#include "BKE_customdata.h" - #ifdef RNA_RUNTIME +#include "DNA_scene_types.h" + +#include "BLI_editVert.h" + +#include "BKE_customdata.h" +#include "BKE_depsgraph.h" +#include "BKE_main.h" +#include "BKE_mesh.h" +#include "BKE_utildefines.h" + +#include "WM_api.h" +#include "WM_types.h" + +static void rna_Mesh_update_data(bContext *C, PointerRNA *ptr) +{ + Main *bmain= CTX_data_main(C); + Scene *scene= CTX_data_scene(C); + ID *id= ptr->id.data; + Object *ob; + + for(ob=bmain->object.first; ob; ob= ob->id.next) { + if(ob->data == id) { + /* XXX this will loop over all objects again (slow) */ + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + } + } +} + static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value) { MVert *mvert= (MVert*)ptr->data; @@ -183,13 +210,19 @@ static void rna_MeshFace_material_index_range(PointerRNA *ptr, int *min, int *ma *max= me->totcol-1; } +static CustomData *rna_mesh_fdata(Mesh *me) +{ + return (me->edit_mesh)? &me->edit_mesh->fdata: &me->fdata; +} + static int rna_CustomDataLayer_length(PointerRNA *ptr, int type) { Mesh *me= (Mesh*)ptr->id.data; + CustomData *fdata= rna_mesh_fdata(me); CustomDataLayer *layer; int i, length= 0; - for(layer=me->fdata.layers, i=0; ifdata.totlayer; layer++, i++) + for(layer=fdata->layers, i=0; itotlayer; layer++, i++) if(layer->type == type) length++; @@ -199,64 +232,96 @@ static int rna_CustomDataLayer_length(PointerRNA *ptr, int type) static int rna_CustomDataLayer_active_get(PointerRNA *ptr, int type, int render) { Mesh *me= (Mesh*)ptr->id.data; - int n= ((CustomDataLayer*)ptr->data) - me->fdata.layers; + CustomData *fdata= rna_mesh_fdata(me); + int n= ((CustomDataLayer*)ptr->data) - fdata->layers; - if(render) return (n == CustomData_get_render_layer_index(&me->fdata, type)); - else return (n == CustomData_get_active_layer_index(&me->fdata, type)); + if(render) return (n == CustomData_get_render_layer_index(fdata, type)); + else return (n == CustomData_get_active_layer_index(fdata, type)); } static void rna_CustomDataLayer_active_set(PointerRNA *ptr, int value, int type, int render) { Mesh *me= (Mesh*)ptr->id.data; - int n= ((CustomDataLayer*)ptr->data) - me->fdata.layers; + CustomData *fdata= rna_mesh_fdata(me); + int n= ((CustomDataLayer*)ptr->data) - fdata->layers; if(value == 0) return; - if(render) CustomData_set_layer_render_index(&me->fdata, type, n); - else CustomData_set_layer_active_index(&me->fdata, type, n); + if(render) CustomData_set_layer_render_index(fdata, type, n); + else CustomData_set_layer_active_index(fdata, type, n); } -static int rna_uv_layer_check(CollectionPropertyIterator *iter, void *data) +static int rna_uv_texture_check(CollectionPropertyIterator *iter, void *data) { CustomDataLayer *layer= (CustomDataLayer*)data; return (layer->type != CD_MTFACE); } -static void rna_Mesh_uv_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Mesh_uv_textures_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->data; - rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_uv_layer_check); + CustomData *fdata= rna_mesh_fdata(me); + rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, rna_uv_texture_check); } -static int rna_Mesh_uv_layers_length(PointerRNA *ptr) +static int rna_Mesh_uv_textures_length(PointerRNA *ptr) { return rna_CustomDataLayer_length(ptr, CD_MTFACE); } -static PointerRNA rna_Mesh_active_uv_layer_get(PointerRNA *ptr) +static PointerRNA rna_Mesh_active_uv_texture_get(PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->data; - int index= CustomData_get_active_layer_index(&me->fdata, CD_MTFACE); - CustomDataLayer *cdl= (index == -1)? NULL: &me->fdata.layers[index]; + CustomData *fdata= rna_mesh_fdata(me); + int index= CustomData_get_active_layer_index(fdata, CD_MTFACE); + CustomDataLayer *cdl= (index == -1)? NULL: &fdata->layers[index]; return rna_pointer_inherit_refine(ptr, &RNA_MeshTextureFaceLayer, cdl); } -static void rna_Mesh_active_uv_layer_set(PointerRNA *ptr, PointerRNA value) +static void rna_Mesh_active_uv_texture_set(PointerRNA *ptr, PointerRNA value) { Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); CustomDataLayer *cdl; int a; - for(cdl=me->fdata.layers, a=0; afdata.totlayer; cdl++, a++) { + for(cdl=fdata->layers, a=0; atotlayer; cdl++, a++) { if(value.data == cdl) { - CustomData_set_layer_active_index(&me->fdata, CD_MTFACE, a); + CustomData_set_layer_active_index(fdata, CD_MTFACE, a); + mesh_update_customdata_pointers(me); return; } } } +static int rna_Mesh_active_uv_texture_index_get(PointerRNA *ptr) +{ + Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); + return CustomData_get_active_layer(fdata, CD_MTFACE); +} + +static void rna_Mesh_active_uv_texture_index_set(PointerRNA *ptr, int value) +{ + Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); + + CustomData_set_layer_active(fdata, CD_MTFACE, value); + mesh_update_customdata_pointers(me); +} + +static void rna_Mesh_active_uv_texture_index_range(PointerRNA *ptr, int *min, int *max) +{ + Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); + + *min= 0; + *max= CustomData_number_of_layers(fdata, CD_MTFACE)-1; + *max= MAX2(0, *max); +} + static void rna_MeshTextureFace_uv1_get(PointerRNA *ptr, float *values) { MTFace *mtface= (MTFace*)ptr->data; @@ -354,46 +419,84 @@ static void rna_MeshTextureFaceLayer_active_set(PointerRNA *ptr, int value) rna_CustomDataLayer_active_set(ptr, value, CD_MTFACE, 0); } -static int rna_vcol_layer_check(CollectionPropertyIterator *iter, void *data) +static void rna_MeshTextureFaceLayer_name_set(PointerRNA *ptr, const char *value) +{ + Mesh *me= (Mesh*)ptr->id.data; + CustomDataLayer *cdl= (CustomDataLayer*)ptr->data; + BLI_strncpy(cdl->name, value, sizeof(cdl->name)); + CustomData_set_layer_unique_name(&me->fdata, cdl - me->fdata.layers); +} + +static int rna_vertex_color_check(CollectionPropertyIterator *iter, void *data) { CustomDataLayer *layer= (CustomDataLayer*)data; return (layer->type != CD_MCOL); } -static void rna_Mesh_vcol_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Mesh_vertex_colors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->data; - rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_vcol_layer_check); + CustomData *fdata= rna_mesh_fdata(me); + rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, rna_vertex_color_check); } -static int rna_Mesh_vcol_layers_length(PointerRNA *ptr) +static int rna_Mesh_vertex_colors_length(PointerRNA *ptr) { return rna_CustomDataLayer_length(ptr, CD_MCOL); } -static PointerRNA rna_Mesh_active_vcol_layer_get(PointerRNA *ptr) +static PointerRNA rna_Mesh_active_vertex_color_get(PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->data; - int index= CustomData_get_active_layer_index(&me->fdata, CD_MCOL); - CustomDataLayer *cdl= (index == -1)? NULL: &me->fdata.layers[index]; + CustomData *fdata= rna_mesh_fdata(me); + int index= CustomData_get_active_layer_index(fdata, CD_MCOL); + CustomDataLayer *cdl= (index == -1)? NULL: &fdata->layers[index]; return rna_pointer_inherit_refine(ptr, &RNA_MeshColorLayer, cdl); } -static void rna_Mesh_active_vcol_layer_set(PointerRNA *ptr, PointerRNA value) +static void rna_Mesh_active_vertex_color_set(PointerRNA *ptr, PointerRNA value) { Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); CustomDataLayer *cdl; int a; - for(cdl=me->fdata.layers, a=0; afdata.totlayer; cdl++, a++) { + for(cdl=fdata->layers, a=0; atotlayer; cdl++, a++) { if(value.data == cdl) { - CustomData_set_layer_active_index(&me->fdata, CD_MCOL, a); + CustomData_set_layer_active_index(fdata, CD_MCOL, a); + mesh_update_customdata_pointers(me); return; } } } +static int rna_Mesh_active_vertex_color_index_get(PointerRNA *ptr) +{ + Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); + return CustomData_get_active_layer(fdata, CD_MCOL); +} + +static void rna_Mesh_active_vertex_color_index_set(PointerRNA *ptr, int value) +{ + Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); + + CustomData_set_layer_active(fdata, CD_MCOL, value); + mesh_update_customdata_pointers(me); +} + +static void rna_Mesh_active_vertex_color_index_range(PointerRNA *ptr, int *min, int *max) +{ + Mesh *me= (Mesh*)ptr->data; + CustomData *fdata= rna_mesh_fdata(me); + + *min= 0; + *max= CustomData_number_of_layers(fdata, CD_MCOL)-1; + *max= MAX2(0, *max); +} + static void rna_MeshColorLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->id.data; @@ -427,6 +530,14 @@ static void rna_MeshColorLayer_active_set(PointerRNA *ptr, int value) rna_CustomDataLayer_active_set(ptr, value, CD_MCOL, 0); } +static void rna_MeshColorLayer_name_set(PointerRNA *ptr, const char *value) +{ + Mesh *me= (Mesh*)ptr->id.data; + CustomDataLayer *cdl= (CustomDataLayer*)ptr->data; + BLI_strncpy(cdl->name, value, sizeof(cdl->name)); + CustomData_set_layer_unique_name(&me->fdata, cdl - me->fdata.layers); +} + static void rna_MeshFloatPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->id.data; @@ -449,7 +560,8 @@ static int rna_float_layer_check(CollectionPropertyIterator *iter, void *data) static void rna_Mesh_float_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->data; - rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_float_layer_check); + CustomData *fdata= rna_mesh_fdata(me); + rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, rna_float_layer_check); } static int rna_Mesh_float_layers_length(PointerRNA *ptr) @@ -479,7 +591,8 @@ static int rna_MeshIntPropertyLayer_data_length(PointerRNA *ptr) static void rna_Mesh_int_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->data; - rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_int_layer_check); + CustomData *fdata= rna_mesh_fdata(me); + rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, rna_int_layer_check); } static int rna_Mesh_int_layers_length(PointerRNA *ptr) @@ -509,7 +622,8 @@ static int rna_MeshStringPropertyLayer_data_length(PointerRNA *ptr) static void rna_Mesh_string_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->data; - rna_iterator_array_begin(iter, (void*)me->fdata.layers, sizeof(CustomDataLayer), me->fdata.totlayer, rna_string_layer_check); + CustomData *fdata= rna_mesh_fdata(me); + rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, rna_string_layer_check); } static int rna_Mesh_string_layers_length(PointerRNA *ptr) @@ -568,17 +682,18 @@ static char *rna_MeshVertex_path(PointerRNA *ptr) static char *rna_MeshTextureFaceLayer_path(PointerRNA *ptr) { - return BLI_sprintfN("uv_layers[%s]", ((CustomDataLayer*)ptr->data)->name); + return BLI_sprintfN("uv_textures[%s]", ((CustomDataLayer*)ptr->data)->name); } static char *rna_CustomDataData_path(PointerRNA *ptr, char *collection, int type) { Mesh *me= (Mesh*)ptr->id.data; + CustomData *fdata= rna_mesh_fdata(me); CustomDataLayer *cdl; int a; size_t b; - for(cdl=me->fdata.layers, a=0; afdata.totlayer; cdl++, a++) { + for(cdl=fdata->layers, a=0; atotlayer; cdl++, a++) { if(cdl->type == type) { b= ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type); if(b >= 0 && b < me->totface) @@ -591,17 +706,17 @@ static char *rna_CustomDataData_path(PointerRNA *ptr, char *collection, int type static char *rna_MeshTextureFace_path(PointerRNA *ptr) { - return rna_CustomDataData_path(ptr, "uv_layers", CD_MTFACE); + return rna_CustomDataData_path(ptr, "uv_textures", CD_MTFACE); } static char *rna_MeshColorLayer_path(PointerRNA *ptr) { - return BLI_sprintfN("vcol_layers[%s]", ((CustomDataLayer*)ptr->data)->name); + return BLI_sprintfN("vertex_colors[%s]", ((CustomDataLayer*)ptr->data)->name); } static char *rna_MeshColor_path(PointerRNA *ptr) { - return rna_CustomDataData_path(ptr, "vcol_layers", CD_MCOL); + return rna_CustomDataData_path(ptr, "vertex_colors", CD_MCOL); } static char *rna_MeshSticky_path(PointerRNA *ptr) @@ -716,8 +831,8 @@ static void rna_def_medge(BlenderRNA *brna) prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "v1"); RNA_def_property_array(prop, 2); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Vertices", "Vertex indices"); + // XXX allows creating invalid meshes prop= RNA_def_property(srna, "crease", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_MEdge_crease_get", "rna_MEdge_crease_set", NULL); @@ -758,8 +873,8 @@ static void rna_def_mface(BlenderRNA *brna) prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "v1"); RNA_def_property_array(prop, 4); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Vertices", "Vertex indices"); + // XXX allows creating invalid meshes prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "mat_nr"); @@ -798,6 +913,7 @@ static void rna_def_mtface(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshTextureFaceLayer_name_set"); RNA_def_property_ui_text(prop, "Name", ""); prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); @@ -935,6 +1051,7 @@ static void rna_def_mcol(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshColorLayer_name_set"); RNA_def_property_ui_text(prop, "Name", ""); prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); @@ -1104,7 +1221,6 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "mvert", "totvert"); RNA_def_property_struct_type(prop, "MeshVertex"); RNA_def_property_ui_text(prop, "Vertices", "Vertices of the mesh."); - // XXX RNA_def_property_collection_funcs(prop, "rna_Mesh_verts_begin", 0, 0, 0, 0, 0, 0, "add_verts", "remove_verts"); prop= RNA_def_property(srna, "edges", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "medge", "totedge"); @@ -1121,33 +1237,45 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_struct_type(prop, "MeshSticky"); RNA_def_property_ui_text(prop, "Sticky", "Sticky texture coordinates."); - /* UV layers */ + /* UV textures */ - prop= RNA_def_property(srna, "uv_layers", PROP_COLLECTION, PROP_NONE); + prop= RNA_def_property(srna, "uv_textures", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); - RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_layers_begin", 0, 0, 0, "rna_Mesh_uv_layers_length", 0, 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Mesh_uv_textures_begin", 0, 0, 0, "rna_Mesh_uv_textures_length", 0, 0, 0, 0); RNA_def_property_struct_type(prop, "MeshTextureFaceLayer"); - RNA_def_property_ui_text(prop, "UV Layers", ""); + RNA_def_property_ui_text(prop, "UV Textures", ""); - prop= RNA_def_property(srna, "active_uv_layer", PROP_POINTER, PROP_UNSIGNED); + prop= RNA_def_property(srna, "active_uv_texture", PROP_POINTER, PROP_UNSIGNED); RNA_def_property_struct_type(prop, "MeshTextureFaceLayer"); - RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_uv_layer_get", "rna_Mesh_active_uv_layer_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_uv_texture_get", "rna_Mesh_active_uv_texture_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Active UV Layer", "Active UV layer."); + RNA_def_property_ui_text(prop, "Active UV Texture", "Active UV texture."); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "active_uv_texture_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_funcs(prop, "rna_Mesh_active_uv_texture_index_get", "rna_Mesh_active_uv_texture_index_set", "rna_Mesh_active_uv_texture_index_range"); + RNA_def_property_ui_text(prop, "Active UV Texture Index", "Active UV texture index."); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); - /* VCol layers */ + /* Vertex colors */ - prop= RNA_def_property(srna, "vcol_layers", PROP_COLLECTION, PROP_NONE); + prop= RNA_def_property(srna, "vertex_colors", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); - RNA_def_property_collection_funcs(prop, "rna_Mesh_vcol_layers_begin", 0, 0, 0, "rna_Mesh_vcol_layers_length", 0, 0, 0, 0); + RNA_def_property_collection_funcs(prop, "rna_Mesh_vertex_colors_begin", 0, 0, 0, "rna_Mesh_vertex_colors_length", 0, 0, 0, 0); RNA_def_property_struct_type(prop, "MeshColorLayer"); - RNA_def_property_ui_text(prop, "Vertex Color Layers", ""); + RNA_def_property_ui_text(prop, "Vertex Colors", ""); - prop= RNA_def_property(srna, "active_vcol_layer", PROP_POINTER, PROP_UNSIGNED); + prop= RNA_def_property(srna, "active_vertex_color", PROP_POINTER, PROP_UNSIGNED); RNA_def_property_struct_type(prop, "MeshColorLayer"); - RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_vcol_layer_get", "rna_Mesh_active_vcol_layer_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_vertex_color_get", "rna_Mesh_active_vertex_color_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Vertex Color Layer", "Active vertex color layer."); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "active_vertex_color_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_funcs(prop, "rna_Mesh_active_vertex_color_index_get", "rna_Mesh_active_vertex_color_index_set", "rna_Mesh_active_vertex_color_index_range"); + RNA_def_property_ui_text(prop, "Active Vertex Color Index", "Active vertex color index."); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "float_layers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); @@ -1183,6 +1311,7 @@ static void rna_def_mesh(BlenderRNA *brna) prop= RNA_def_property(srna, "double_sided", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_TWOSIDED); RNA_def_property_ui_text(prop, "Double Sided", "Render/display the mesh with double or single sided lighting"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "texco_mesh", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "texcomesh"); diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c index 26fb77777d7..c98b3fb7b09 100644 --- a/source/blender/makesrna/intern/rna_mesh_api.c +++ b/source/blender/makesrna/intern/rna_mesh_api.c @@ -34,74 +34,207 @@ #ifdef RNA_RUNTIME +#include "DNA_mesh_types.h" +#include "DNA_scene_types.h" + #include "BKE_customdata.h" +#include "BKE_depsgraph.h" #include "BKE_DerivedMesh.h" +#include "BKE_main.h" +#include "BKE_mesh.h" -#include "DNA_mesh_types.h" -#include "DNA_scene_types.h" +#include "BLI_edgehash.h" -/* -void rna_Mesh_copy(Mesh *me, Mesh *from) +#include "WM_api.h" +#include "WM_types.h" + +static void rna_Mesh_calc_edges(Mesh *mesh) { - copy_mesh_data(me, from); + CustomData edata; + EdgeHashIterator *ehi; + MFace *mf = mesh->mface; + MEdge *med; + EdgeHash *eh = BLI_edgehash_new(); + int i, *index, totedge, totface = mesh->totface; + + for (i = 0; i < totface; i++, mf++) { + if (!BLI_edgehash_haskey(eh, mf->v1, mf->v2)) + BLI_edgehash_insert(eh, mf->v1, mf->v2, NULL); + if (!BLI_edgehash_haskey(eh, mf->v2, mf->v3)) + BLI_edgehash_insert(eh, mf->v2, mf->v3, NULL); + + if (mf->v4) { + if (!BLI_edgehash_haskey(eh, mf->v3, mf->v4)) + BLI_edgehash_insert(eh, mf->v3, mf->v4, NULL); + if (!BLI_edgehash_haskey(eh, mf->v4, mf->v1)) + BLI_edgehash_insert(eh, mf->v4, mf->v1, NULL); + } else { + if (!BLI_edgehash_haskey(eh, mf->v3, mf->v1)) + BLI_edgehash_insert(eh, mf->v3, mf->v1, NULL); + } + } + + totedge = BLI_edgehash_size(eh); + + /* write new edges into a temporary CustomData */ + memset(&edata, 0, sizeof(edata)); + CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge); + + ehi = BLI_edgehashIterator_new(eh); + med = CustomData_get_layer(&edata, CD_MEDGE); + for(i = 0; !BLI_edgehashIterator_isDone(ehi); + BLI_edgehashIterator_step(ehi), ++i, ++med, ++index) { + BLI_edgehashIterator_getKey(ehi, (int*)&med->v1, (int*)&med->v2); + + med->flag = ME_EDGEDRAW|ME_EDGERENDER; + } + BLI_edgehashIterator_free(ehi); + + /* free old CustomData and assign new one */ + CustomData_free(&mesh->edata, mesh->totedge); + mesh->edata = edata; + mesh->totedge = totedge; + + mesh->medge = CustomData_get_layer(&mesh->edata, CD_MEDGE); + + BLI_edgehash_free(eh, NULL); } -void rna_Mesh_copy_applied(Mesh *me, Scene *sce, Object *ob) +static void rna_Mesh_update(Mesh *mesh, bContext *C) { - DerivedMesh *dm= mesh_create_derived_view(sce, ob, CD_MASK_MESH); - DM_to_mesh(dm, me); - dm->release(dm); + Main *bmain= CTX_data_main(C); + Object *ob; + + if(mesh->totface && mesh->totedge == 0) + rna_Mesh_calc_edges(mesh); + + mesh_calc_normals(mesh->mvert, mesh->totvert, mesh->mface, mesh->totface, NULL); + + for(ob=bmain->object.first; ob; ob=ob->id.next) { + if(ob->data == mesh) { + ob->recalc |= OB_RECALC_DATA; + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + } + } } -*/ -void rna_Mesh_transform(Mesh *me, float **mat) +static void rna_Mesh_add_verts(Mesh *mesh, int len) { + CustomData vdata; + MVert *mvert; + int i, totvert; + + if(len == 0) + return; + + totvert= mesh->totvert + len; + CustomData_copy(&mesh->vdata, &vdata, CD_MASK_MESH, CD_DEFAULT, totvert); + CustomData_copy_data(&mesh->vdata, &vdata, 0, 0, mesh->totvert); + + if(!CustomData_has_layer(&vdata, CD_MVERT)) + CustomData_add_layer(&vdata, CD_MVERT, CD_CALLOC, NULL, totvert); + + CustomData_free(&mesh->vdata, mesh->totvert); + mesh->vdata= vdata; + mesh_update_customdata_pointers(mesh); + + /* scan the input list and insert the new vertices */ + + mvert= &mesh->mvert[mesh->totvert]; + for(i=0; iflag |= SELECT; + + /* set final vertex list size */ + mesh->totvert= totvert; } -#if 0 -/* extern struct EditVert *addvertlist(EditMesh *em, float *vec, struct EditVert *example); */ +static void rna_Mesh_add_edges(Mesh *mesh, int len) +{ + CustomData edata; + MEdge *medge; + int i, totedge; + + if(len == 0) + return; + + totedge= mesh->totedge+len; + + /* update customdata */ + CustomData_copy(&mesh->edata, &edata, CD_MASK_MESH, CD_DEFAULT, totedge); + CustomData_copy_data(&mesh->edata, &edata, 0, 0, mesh->totedge); -static void rna_Mesh_verts_add(PointerRNA *ptr, PointerRNA *ptr_item) + if(!CustomData_has_layer(&edata, CD_MEDGE)) + CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge); + + CustomData_free(&mesh->edata, mesh->totedge); + mesh->edata= edata; + mesh_update_customdata_pointers(mesh); + + /* set default flags */ + medge= &mesh->medge[mesh->totedge]; + for(i=0; iflag= ME_EDGEDRAW|ME_EDGERENDER|SELECT; + + mesh->totedge= totedge; +} + +static void rna_Mesh_add_faces(Mesh *mesh, int len) { - //Mesh *me= (Mesh*)ptr->data; + CustomData fdata; + MFace *mface; + int i, totface; - /* - // XXX if item is not MVert we fail silently - if (item->type == RNA_MeshVertex) + if(len == 0) return; - // XXX this must be slow... - EditMesh *em= BKE_mesh_get_editmesh(me); + totface= mesh->totface + len; /* new face count */ + + /* update customdata */ + CustomData_copy(&mesh->fdata, &fdata, CD_MASK_MESH, CD_DEFAULT, totface); + CustomData_copy_data(&mesh->fdata, &fdata, 0, 0, mesh->totface); + + if(!CustomData_has_layer(&fdata, CD_MFACE)) + CustomData_add_layer(&fdata, CD_MFACE, CD_CALLOC, NULL, totface); + + CustomData_free(&mesh->fdata, mesh->totface); + mesh->fdata= fdata; + mesh_update_customdata_pointers(mesh); - MVert *v = (MVert*)ptr_item->ptr->data; - addvertlist(em, v->co, NULL); + /* set default flags */ + mface= &mesh->mface[mesh->totface]; + for(i=0; iflag= SELECT; - BKE_mesh_end_editmesh(me, em); - */ + mesh->totface= totface; +} + +static void rna_Mesh_add_geometry(Mesh *mesh, int verts, int edges, int faces) +{ + if(verts) + rna_Mesh_add_verts(mesh, verts); + if(edges) + rna_Mesh_add_edges(mesh, edges); + if(faces) + rna_Mesh_add_faces(mesh, faces); } -#endif #else void RNA_api_mesh(StructRNA *srna) { - /*FunctionRNA *func; - PropertyRNA *prop;*/ - - /* - func= RNA_def_function(srna, "copy", "rna_Mesh_copy"); - RNA_def_function_ui_description(func, "Copy mesh data."); - prop= RNA_def_pointer(func, "src", "Mesh", "", "A mesh to copy data from."); - RNA_def_property_flag(prop, PROP_REQUIRED);*/ - - /* - func= RNA_def_function(srna, "add_geom", "rna_Mesh_add_geom"); - RNA_def_function_ui_description(func, "Add geometry data to mesh."); - prop= RNA_def_collection(func, "verts", "?", "", "Vertices."); - RNA_def_property_flag(prop, PROP_REQUIRED); - prop= RNA_def_collection(func, "faces", "?", "", "Faces."); - RNA_def_property_flag(prop, PROP_REQUIRED); - */ + FunctionRNA *func; + PropertyRNA *parm; + + func= RNA_def_function(srna, "add_geometry", "rna_Mesh_add_geometry"); + parm= RNA_def_int(func, "verts", 0, 0, INT_MAX, "Number", "Number of vertices to add.", 0, INT_MAX); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_int(func, "edges", 0, 0, INT_MAX, "Number", "Number of edges to add.", 0, INT_MAX); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_int(func, "faces", 0, 0, INT_MAX, "Number", "Number of faces to add.", 0, INT_MAX); + RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "update", "rna_Mesh_update"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); } #endif diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 3b54409ffb0..2be0d115dc9 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -42,10 +42,13 @@ #ifdef RNA_RUNTIME +#include "DNA_key_types.h" + #include "BKE_armature.h" #include "BKE_context.h" #include "BKE_curve.h" #include "BKE_depsgraph.h" +#include "BKE_key.h" #include "BKE_material.h" #include "BKE_mesh.h" #include "BKE_particle.h" @@ -131,6 +134,27 @@ static PointerRNA rna_Object_active_vertex_group_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_VertexGroup, BLI_findlink(&ob->defbase, ob->actdef)); } +static int rna_Object_active_vertex_group_index_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + return MAX2(ob->actdef-1, 0); +} + +static void rna_Object_active_vertex_group_index_set(PointerRNA *ptr, int value) +{ + Object *ob= (Object*)ptr->id.data; + ob->actdef= value+1; +} + +static void rna_Object_active_vertex_group_index_range(PointerRNA *ptr, int *min, int *max) +{ + Object *ob= (Object*)ptr->id.data; + + *min= 0; + *max= BLI_countlist(&ob->defbase)-1; + *max= MAX2(0, *max); +} + void rna_object_vgroup_name_index_get(PointerRNA *ptr, char *value, int index) { Object *ob= (Object*)ptr->id.data; @@ -228,11 +252,23 @@ void rna_object_vcollayer_name_set(PointerRNA *ptr, const char *value, char *res BLI_strncpy(result, "", maxlen); } +static int rna_Object_active_material_index_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + return MAX2(ob->actcol-1, 0); +} + +static void rna_Object_active_material_index_set(PointerRNA *ptr, int value) +{ + Object *ob= (Object*)ptr->id.data; + ob->actcol= value+1; +} + static void rna_Object_active_material_index_range(PointerRNA *ptr, int *min, int *max) { Object *ob= (Object*)ptr->id.data; - *min= 1; - *max= ob->totcol; + *min= 0; + *max= MAX2(ob->totcol-1, 0); } static PointerRNA rna_Object_active_material_get(PointerRNA *ptr) @@ -244,14 +280,15 @@ static PointerRNA rna_Object_active_material_get(PointerRNA *ptr) static void rna_Object_active_particle_system_index_range(PointerRNA *ptr, int *min, int *max) { Object *ob= (Object*)ptr->id.data; - *min= 1; - *max= BLI_countlist(&ob->particlesystem); + *min= 0; + *max= BLI_countlist(&ob->particlesystem)-1; + *max= MAX2(0, *max); } static int rna_Object_active_particle_system_index_get(PointerRNA *ptr) { Object *ob= (Object*)ptr->id.data; - return psys_get_current_num(ob) + 1; + return psys_get_current_num(ob); } static void rna_Object_active_particle_system_index_set(struct PointerRNA *ptr, int value) @@ -384,6 +421,41 @@ static void rna_GameObjectSettings_state_set(PointerRNA *ptr, const int *values) } } +static void rna_Object_active_shape_key_index_range(PointerRNA *ptr, int *min, int *max) +{ + Object *ob= (Object*)ptr->id.data; + Key *key= ob_get_key(ob); + + *min= 0; + *max= (key)? BLI_countlist(&key->block)-1: 0; + *max= MAX2(0, *max); +} + +static int rna_Object_active_shape_key_index_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + + return MAX2(ob->shapenr-1, 0); +} + +static void rna_Object_active_shape_key_index_set(PointerRNA *ptr, int value) +{ + Object *ob= (Object*)ptr->id.data; + + ob->shapenr= value+1; + ob->shapeflag |= OB_SHAPE_TEMPLOCK; +} + +static void rna_Object_shape_key_lock_set(PointerRNA *ptr, int value) +{ + Object *ob= (Object*)ptr->id.data; + + if(value) ob->shapeflag |= OB_SHAPE_LOCK; + else ob->shapeflag &= ~OB_SHAPE_LOCK; + + ob->shapeflag &= ~OB_SHAPE_TEMPLOCK; +} + #else static void rna_def_vertex_group(BlenderRNA *brna) @@ -814,7 +886,7 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "active_material_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "actcol"); - RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Object_active_material_index_range"); + RNA_def_property_int_funcs(prop, "rna_Object_active_material_index_get", "rna_Object_active_material_index_set", "rna_Object_active_material_index_range"); RNA_def_property_ui_text(prop, "Active Material Index", "Index of active material slot."); /* transform */ @@ -895,8 +967,15 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "active_vertex_group", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "VertexGroup"); - RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", "rna_Object_active_vertex_group_set", NULL); RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + + prop= RNA_def_property(srna, "active_vertex_group_index", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "actdef"); + RNA_def_property_int_funcs(prop, "rna_Object_active_vertex_group_index_get", "rna_Object_active_vertex_group_index_set", "rna_Object_active_vertex_group_index_range"); + RNA_def_property_ui_text(prop, "Active Vertex Group Index", "Active index in vertex group array."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); /* empty */ @@ -1148,13 +1227,15 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "shape_key_lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_LOCK); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_boolean_funcs(prop, NULL, "rna_Object_shape_key_lock_set"); RNA_def_property_ui_text(prop, "Shape Key Lock", "Always show the current Shape for this Object."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); - prop= RNA_def_property(srna, "active_shape_key", PROP_INT, PROP_NONE); + prop= RNA_def_property(srna, "active_shape_key_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "shapenr"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Active Shape Key", "Current shape key index."); + RNA_def_property_int_funcs(prop, "rna_Object_active_shape_key_index_get", "rna_Object_active_shape_key_index_set", "rna_Object_active_shape_key_index_range"); + RNA_def_property_ui_text(prop, "Active Shape Key Index", "Current shape key index."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); RNA_api_object(srna); } diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 6fa275cec91..14db8ea3377 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -309,14 +309,16 @@ PointerRNA rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key } } while((srna=srna->base)); - group= RNA_struct_idproperties(ptr, 0); - - if(group) { - for(idp=group->data.group.first; idp; idp=idp->next) { - if(strcmp(idp->name, key) == 0) { - propptr.type= &RNA_Property; - propptr.data= idp; - return propptr; + if(ptr->data) { + group= RNA_struct_idproperties(ptr, 0); + + if(group) { + for(idp=group->data.group.first; idp; idp=idp->next) { + if(strcmp(idp->name, key) == 0) { + propptr.type= &RNA_Property; + propptr.data= idp; + return propptr; + } } } } diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 47c9025149a..5f03b7167f4 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -245,6 +245,11 @@ void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, mesh_select_mode_items); RNA_def_property_ui_text(prop, "Mesh Selection Mode", "Mesh selection and display mode."); + prop= RNA_def_property(srna, "vertex_group_weight", PROP_FLOAT, PROP_PERCENTAGE); + RNA_def_property_float_sdna(prop, NULL, "vgroup_weight"); + RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups."); + + /* Sculpt */ rna_def_sculpt(brna); } diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index b7279757455..a4ba6ec172b 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -42,6 +42,31 @@ EnumPropertyItem region_type_items[] = { #ifdef RNA_RUNTIME +#include "WM_api.h" +#include "WM_types.h" + +static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value) +{ + bScreen *sc= (bScreen*)ptr->data; + + if(value.data == NULL) + return; + + /* exception: can't set screens inside of area/region handers */ + sc->newscene= value.data; +} + +static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr) +{ + bScreen *sc= (bScreen*)ptr->data; + + /* exception: can't set screens inside of area/region handers */ + if(sc->newscene) { + WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, sc->newscene); + sc->newscene= NULL; + } +} + #else static void rna_def_scrarea(BlenderRNA *brna) @@ -94,6 +119,9 @@ static void rna_def_bscreen(BlenderRNA *brna) prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen."); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Screen_scene_set", NULL); + RNA_def_property_update(prop, 0, "rna_Screen_scene_update"); prop= RNA_def_property(srna, "areas", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "areabase", NULL); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 9335b3619fc..b29186513f8 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -96,8 +96,8 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr) return &RNA_SpaceOutliner; case SPACE_BUTS: return &RNA_SpaceButtonsWindow; - /* case SPACE_FILE: - return &RNA_SpaceFileBrowser;*/ + case SPACE_FILE: + return &RNA_SpaceFileBrowser; case SPACE_IMAGE: return &RNA_SpaceImageEditor; /*case SPACE_INFO: @@ -210,6 +210,13 @@ void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value) st->top= 0; } +void rna_SpaceFileBrowser_params_set(PointerRNA *ptr, PointerRNA value) +{ + SpaceFile *sfile= (SpaceFile*)(ptr->data); + + sfile->params= value.data; +} + /* Space Buttons */ StructRNA *rna_SpaceButtonsWindow_pin_id_typef(PointerRNA *ptr) @@ -971,12 +978,124 @@ static void rna_def_space_nla(BlenderRNA *brna) // TODO... autosnap, dopesheet? } +static void rna_def_fileselect_params(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem file_display_items[] = { + {FILE_SHORTDISPLAY, "FILE_SHORTDISPLAY", ICON_SHORTDISPLAY, "Short List", "Display files as short list"}, + {FILE_LONGDISPLAY, "FILE_LONGDISPLAY", ICON_LONGDISPLAY, "Long List", "Display files as a detailed list"}, + {FILE_IMGDISPLAY, "FILE_IMGDISPLAY", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem file_sort_items[] = { + {FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_SORTALPHA, "Sort alphabetically", "Sort the file list alphabetically."}, + {FILE_SORT_EXTENSION, "FILE_SORT_EXTENSION", ICON_SORTBYEXT, "Sort by extension", "Sort the file list by extension."}, + {FILE_SORT_TIME, "FILE_SORT_TIME", ICON_SORTTIME, "Sort by time", "Sort files by modification time."}, + {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_SORTSIZE, "Sort by size", "Sort files by size."}, + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "FileSelectParams", NULL); + RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters."); + + prop= RNA_def_property(srna, "display", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "display"); + RNA_def_property_enum_items(prop, file_display_items); + RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list"); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "do_filter", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER); + RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files."); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "hide_dot", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_HIDE_DOT); + RNA_def_property_ui_text(prop, "Hide Dot Files", "Hide hidden dot files."); + RNA_def_property_update(prop, NC_FILE | ND_FILELIST , NULL); + + prop= RNA_def_property(srna, "sort", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "sort"); + RNA_def_property_enum_items(prop, file_sort_items); + RNA_def_property_ui_text(prop, "Sort", ""); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_image", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", IMAGEFILE); + RNA_def_property_ui_text(prop, "Filter Images", "Show image files."); + RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_blender", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", BLENDERFILE); + RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files."); + RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_movie", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", MOVIEFILE); + RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files."); + RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_script", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", PYSCRIPTFILE); + RNA_def_property_ui_text(prop, "Filter Script", "Show script files."); + RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_font", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", FTFONTFILE); + RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files."); + RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_sound", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", SOUNDFILE); + RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files."); + RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_text", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", TEXTFILE); + RNA_def_property_ui_text(prop, "Filter Text", "Show text files."); + RNA_def_property_ui_icon(prop, ICON_FILE_BLANK, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "filter_folder", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "filter", FOLDERFILE); + RNA_def_property_ui_text(prop, "Filter Folder", "Show folders."); + RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + +} + +static void rna_def_space_filebrowser(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "SpaceFileBrowser", "Space"); + RNA_def_struct_sdna(srna, "SpaceFile"); + RNA_def_struct_ui_text(srna, "Space File Browser", "File browser space data."); + + prop= RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "params"); + RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceFileBrowser_params_set", NULL); + RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser."); + +} + void RNA_def_space(BlenderRNA *brna) { rna_def_space(brna); rna_def_space_image(brna); rna_def_space_sequencer(brna); rna_def_space_text(brna); + rna_def_fileselect_params(brna); + rna_def_space_filebrowser(brna); rna_def_space_outliner(brna); rna_def_background_image(brna); rna_def_space_3dview(brna); diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 825b3711b97..eef221e45a4 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -416,12 +416,12 @@ static int rna_UILayout_active_get(struct PointerRNA *ptr) static void rna_UILayout_active_set(struct PointerRNA *ptr, int value) { - return uiLayoutSetActive(ptr->data, value); + uiLayoutSetActive(ptr->data, value); } static void rna_UILayout_op_context_set(struct PointerRNA *ptr, int value) { - return uiLayoutSetOperatorContext(ptr->data, value); + uiLayoutSetOperatorContext(ptr->data, value); } static int rna_UILayout_op_context_get(struct PointerRNA *ptr) @@ -436,7 +436,7 @@ static int rna_UILayout_enabled_get(struct PointerRNA *ptr) static void rna_UILayout_enabled_set(struct PointerRNA *ptr, int value) { - return uiLayoutSetEnabled(ptr->data, value); + uiLayoutSetEnabled(ptr->data, value); } static int rna_UILayout_red_alert_get(struct PointerRNA *ptr) @@ -446,7 +446,7 @@ static int rna_UILayout_red_alert_get(struct PointerRNA *ptr) static void rna_UILayout_red_alert_set(struct PointerRNA *ptr, int value) { - return uiLayoutSetRedAlert(ptr->data, value); + uiLayoutSetRedAlert(ptr->data, value); } static int rna_UILayout_keep_aspect_get(struct PointerRNA *ptr) @@ -456,7 +456,7 @@ static int rna_UILayout_keep_aspect_get(struct PointerRNA *ptr) static void rna_UILayout_keep_aspect_set(struct PointerRNA *ptr, int value) { - return uiLayoutSetKeepAspect(ptr->data, value); + uiLayoutSetKeepAspect(ptr->data, value); } static int rna_UILayout_alignment_get(struct PointerRNA *ptr) @@ -466,7 +466,7 @@ static int rna_UILayout_alignment_get(struct PointerRNA *ptr) static void rna_UILayout_alignment_set(struct PointerRNA *ptr, int value) { - return uiLayoutSetAlignment(ptr->data, value); + uiLayoutSetAlignment(ptr->data, value); } static float rna_UILayout_scale_x_get(struct PointerRNA *ptr) @@ -476,7 +476,7 @@ static float rna_UILayout_scale_x_get(struct PointerRNA *ptr) static void rna_UILayout_scale_x_set(struct PointerRNA *ptr, float value) { - return uiLayoutSetScaleX(ptr->data, value); + uiLayoutSetScaleX(ptr->data, value); } static float rna_UILayout_scale_y_get(struct PointerRNA *ptr) @@ -486,7 +486,7 @@ static float rna_UILayout_scale_y_get(struct PointerRNA *ptr) static void rna_UILayout_scale_y_set(struct PointerRNA *ptr, float value) { - return uiLayoutSetScaleY(ptr->data, value); + uiLayoutSetScaleY(ptr->data, value); } #else // RNA_RUNTIME diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index a4aa60775f2..3df3fad3f15 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -259,6 +259,8 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "template_list", "uiTemplateList"); api_ui_item_rna_common(func); + parm= RNA_def_pointer(func, "active_data", "AnyType", "", "Data from which to take property for the active element."); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); parm= RNA_def_string(func, "active_property", "", 0, "", "Identifier of property in data, for the active element."); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_int(func, "rows", 5, 0, INT_MAX, "", "Number of rows to display.", 0, INT_MAX); @@ -266,6 +268,11 @@ void RNA_api_ui_layout(StructRNA *srna) parm= RNA_def_boolean(func, "compact", 0, "", "Use compact, single row list template."); parm= RNA_def_collection(func, "items", 0, "", "Items visible in the list."); RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "template_running_jobs", "uiTemplateRunningJobs"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); + + func= RNA_def_function(srna, "template_operator_search", "uiTemplateOperatorSearch"); } #endif diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 1bfc3b6f8f6..f8ab3a86744 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -147,6 +147,8 @@ EnumPropertyItem event_type_items[] = { #ifdef RNA_RUNTIME +#include "WM_api.h" + #include "BKE_idprop.h" static wmOperator *rna_OperatorProperties_find_operator(PointerRNA *ptr) @@ -215,6 +217,28 @@ static int rna_Event_ascii_length(PointerRNA *ptr) return (event->ascii)? 1 : 0; } +static void rna_Window_screen_set(PointerRNA *ptr, PointerRNA value) +{ + wmWindow *win= (wmWindow*)ptr->data; + + if(value.data == NULL) + return; + + /* exception: can't set screens inside of area/region handers */ + win->newscreen= value.data; +} + +static void rna_Window_screen_update(bContext *C, PointerRNA *ptr) +{ + wmWindow *win= (wmWindow*)ptr->data; + + /* exception: can't set screens inside of area/region handers */ + if(win->newscreen) { + WM_event_add_notifier(C, NC_SCREEN|ND_SCREENBROWSE, win->newscreen); + win->newscreen= NULL; + } +} + #else static void rna_def_operator(BlenderRNA *brna) @@ -349,6 +373,23 @@ static void rna_def_event(BlenderRNA *brna) RNA_def_property_ui_text(prop, "OS Key", "True when the shift key is held."); } +static void rna_def_window(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "Window", NULL); + RNA_def_struct_ui_text(srna, "Window", "Open window."); + RNA_def_struct_sdna(srna, "wmWindow"); + + prop= RNA_def_property(srna, "screen", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_struct_type(prop, "Screen"); + RNA_def_property_ui_text(prop, "Screen", "Active screen showing in the window."); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Window_screen_set", NULL); + RNA_def_property_update(prop, 0, "rna_Window_screen_update"); +} + static void rna_def_windowmanager(BlenderRNA *brna) { StructRNA *srna; @@ -362,6 +403,10 @@ static void rna_def_windowmanager(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Operator"); RNA_def_property_ui_text(prop, "Operators", "Operator registry."); + prop= RNA_def_property(srna, "windows", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "Window"); + RNA_def_property_ui_text(prop, "Windows", "Open windows."); + RNA_api_wm(srna); } @@ -371,6 +416,7 @@ void RNA_def_wm(BlenderRNA *brna) rna_def_operator_utils(brna); rna_def_operator_filelist_element(brna); rna_def_event(brna); + rna_def_window(brna); rna_def_windowmanager(brna); } diff --git a/source/blender/python/generic/BGL.c b/source/blender/python/generic/BGL.c index a90fabd3586..de82781cf3a 100644 --- a/source/blender/python/generic/BGL.c +++ b/source/blender/python/generic/BGL.c @@ -83,8 +83,13 @@ static PyObject *Buffer_getattr( PyObject * self, char *name ); static PyObject *Buffer_repr( PyObject * self ); PyTypeObject buffer_Type = { - PyObject_HEAD_INIT( NULL ) /* required python macro */ - 0, /*ob_size */ +#if (PY_VERSION_HEX >= 0x02060000) + PyVarObject_HEAD_INIT(NULL, 0) +#else + /* python 2.5 and below */ + PyObject_HEAD_INIT( NULL ) /* required py macro */ + 0, /* ob_size */ +#endif "buffer", /*tp_name */ sizeof( Buffer ), /*tp_basicsize */ 0, /*tp_itemsize */ diff --git a/source/blender/python/generic/Geometry.c b/source/blender/python/generic/Geometry.c index 8a748241570..b4a34d30051 100644 --- a/source/blender/python/generic/Geometry.c +++ b/source/blender/python/generic/Geometry.c @@ -273,7 +273,7 @@ static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args ) /*X of vert, Y of hoz. no calculation needed */ newvec[0]= a1x; newvec[1]= b1y; - return newVectorObject(newvec, 2, Py_NEW); + return newVectorObject(newvec, 2, Py_NEW, NULL); } yi = (float)(((b1y / fabs(b1x - b2x)) * fabs(b2x - a1x)) + ((b2y / fabs(b1x - b2x)) * fabs(b1x - a1x))); @@ -285,7 +285,7 @@ static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args ) } newvec[0]= a1x; newvec[1]= yi; - return newVectorObject(newvec, 2, Py_NEW); + return newVectorObject(newvec, 2, Py_NEW, NULL); } else if (fabs(a2y-a1y) < eul) { /* hoz line1 */ if (fabs(b2y-b1y) < eul) { /*hoz line2*/ Py_RETURN_NONE; /*2 hoz lines dont intersect*/ @@ -300,7 +300,7 @@ static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args ) } newvec[0]= xi; newvec[1]= a1y; - return newVectorObject(newvec, 2, Py_NEW); + return newVectorObject(newvec, 2, Py_NEW, NULL); } b1 = (a2y-a1y)/(a2x-a1x); @@ -317,7 +317,7 @@ static PyObject *M_Geometry_LineIntersect2D( PyObject * self, PyObject * args ) if ((a1x-xi)*(xi-a2x) >= 0 && (b1x-xi)*(xi-b2x) >= 0 && (a1y-yi)*(yi-a2y) >= 0 && (b1y-yi)*(yi-b2y)>=0) { newvec[0]= xi; newvec[1]= yi; - return newVectorObject(newvec, 2, Py_NEW); + return newVectorObject(newvec, 2, Py_NEW, NULL); } Py_RETURN_NONE; } @@ -355,7 +355,7 @@ static PyObject *M_Geometry_ClosestPointOnLine( PyObject * self, PyObject * args lambda = lambda_cp_line_ex(pt_in, l1, l2, pt_out); ret = PyTuple_New(2); - PyTuple_SET_ITEM( ret, 0, newVectorObject(pt_out, 3, Py_NEW) ); + PyTuple_SET_ITEM( ret, 0, newVectorObject(pt_out, 3, Py_NEW, NULL) ); PyTuple_SET_ITEM( ret, 1, PyFloat_FromDouble(lambda) ); return ret; } @@ -535,7 +535,7 @@ static PyObject *M_Geometry_BezierInterp( PyObject * self, PyObject * args ) list= PyList_New(resolu); fp= coord_array; for(i=0; iquat[3]*quat->quat[3]*vec->vec[2] - 2*quat->quat[0]*quat->quat[2]*vec->vec[0] - quat->quat[2]*quat->quat[2]*vec->vec[2] + 2*quat->quat[0]*quat->quat[1]*vec->vec[1] - quat->quat[1]*quat->quat[1]*vec->vec[2] + quat->quat[0]*quat->quat[0]*vec->vec[2]; - return newVectorObject(rot, 3, Py_NEW); + return newVectorObject(rot, 3, Py_NEW, NULL); } }else if(VectorObject_Check(arg1)){ vec = (VectorObject*)arg1; @@ -201,7 +201,7 @@ PyObject *quat_rotation(PyObject *arg1, PyObject *arg2) quat->quat[3]*quat->quat[3]*vec->vec[2] - 2*quat->quat[0]*quat->quat[2]*vec->vec[0] - quat->quat[2]*quat->quat[2]*vec->vec[2] + 2*quat->quat[0]*quat->quat[1]*vec->vec[1] - quat->quat[1]*quat->quat[1]*vec->vec[2] + quat->quat[0]*quat->quat[0]*vec->vec[2]; - return newVectorObject(rot, 3, Py_NEW); + return newVectorObject(rot, 3, Py_NEW, NULL); } } @@ -311,7 +311,7 @@ static PyObject *M_Mathutils_MidpointVecs(PyObject * self, PyObject * args) for(x = 0; x < vec1->size; x++) { vec[x] = 0.5f * (vec1->vec[x] + vec2->vec[x]); } - return newVectorObject(vec, vec1->size, Py_NEW); + return newVectorObject(vec, vec1->size, Py_NEW, NULL); } //----------------------------------Mathutils.ProjectVecs() ------------- //projects vector 1 onto vector 2 @@ -348,7 +348,7 @@ static PyObject *M_Mathutils_ProjectVecs(PyObject * self, PyObject * args) for(x = 0; x < size; x++) { vec[x] = (float)(dot * vec2->vec[x]); } - return newVectorObject(vec, size, Py_NEW); + return newVectorObject(vec, size, Py_NEW, NULL); } //----------------------------------MATRIX FUNCTIONS-------------------- //----------------------------------Mathutils.RotationMatrix() ---------- @@ -493,7 +493,7 @@ static PyObject *M_Mathutils_RotationMatrix(PyObject * self, PyObject * args) mat[3] = 0.0f; } //pass to matrix creation - return newMatrixObject(mat, matSize, matSize, Py_NEW); + return newMatrixObject(mat, matSize, matSize, Py_NEW, NULL); } //----------------------------------Mathutils.TranslationMatrix() ------- //creates a translation matrix @@ -520,7 +520,7 @@ static PyObject *M_Mathutils_TranslationMatrix(PyObject * self, VectorObject * v mat[13] = vec->vec[1]; mat[14] = vec->vec[2]; - return newMatrixObject(mat, 4, 4, Py_NEW); + return newMatrixObject(mat, 4, 4, Py_NEW, NULL); } //----------------------------------Mathutils.ScaleMatrix() ------------- //mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. @@ -598,7 +598,7 @@ static PyObject *M_Mathutils_ScaleMatrix(PyObject * self, PyObject * args) mat[3] = 0.0f; } //pass to matrix creation - return newMatrixObject(mat, matSize, matSize, Py_NEW); + return newMatrixObject(mat, matSize, matSize, Py_NEW, NULL); } //----------------------------------Mathutils.OrthoProjectionMatrix() --- //mat is a 1D array of floats - row[0][0],row[0][1], row[1][0], etc. @@ -701,7 +701,7 @@ static PyObject *M_Mathutils_OrthoProjectionMatrix(PyObject * self, PyObject * a mat[3] = 0.0f; } //pass to matrix creation - return newMatrixObject(mat, matSize, matSize, Py_NEW); + return newMatrixObject(mat, matSize, matSize, Py_NEW, NULL); } //----------------------------------Mathutils.ShearMatrix() ------------- //creates a shear matrix @@ -768,7 +768,7 @@ static PyObject *M_Mathutils_ShearMatrix(PyObject * self, PyObject * args) mat[3] = 0.0f; } //pass to matrix creation - return newMatrixObject(mat, matSize, matSize, Py_NEW); + return newMatrixObject(mat, matSize, matSize, Py_NEW, NULL); } //----------------------------------QUATERNION FUNCTIONS----------------- @@ -801,7 +801,7 @@ static PyObject *M_Mathutils_DifferenceQuats(PyObject * self, PyObject * args) tempQuat[x] /= (float)(dot * dot); } QuatMul(quat, tempQuat, quatV->quat); - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } //----------------------------------Mathutils.Slerp() ------------------ //attemps to interpolate 2 quaternions and return the result @@ -862,7 +862,7 @@ static PyObject *M_Mathutils_Slerp(PyObject * self, PyObject * args) quat[2] = (float)(quat_u[2] * x + quat_v[2] * y); quat[3] = (float)(quat_u[3] * x + quat_v[3] * y); - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } //----------------------------------EULER FUNCTIONS---------------------- //---------------------------------INTERSECTION FUNCTIONS-------------------- @@ -936,7 +936,7 @@ static PyObject *M_Mathutils_Intersect( PyObject * self, PyObject * args ) VecMulf(dir, t); VecAddf(pvec, orig, dir); - return newVectorObject(pvec, 3, Py_NEW); + return newVectorObject(pvec, 3, Py_NEW, NULL); } //----------------------------------Mathutils.LineIntersect() ------------------- /* Line-Line intersection using algorithm from mathworld.wolfram.com */ @@ -993,8 +993,8 @@ static PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args ) } else { tuple = PyTuple_New( 2 ); - PyTuple_SetItem( tuple, 0, newVectorObject(i1, vec1->size, Py_NEW) ); - PyTuple_SetItem( tuple, 1, newVectorObject(i2, vec1->size, Py_NEW) ); + PyTuple_SetItem( tuple, 0, newVectorObject(i1, vec1->size, Py_NEW, NULL) ); + PyTuple_SetItem( tuple, 1, newVectorObject(i2, vec1->size, Py_NEW, NULL) ); return tuple; } } @@ -1055,7 +1055,7 @@ static PyObject *M_Mathutils_QuadNormal( PyObject * self, PyObject * args ) VecAddf(n1, n2, n1); Normalize(n1); - return newVectorObject(n1, 3, Py_NEW); + return newVectorObject(n1, 3, Py_NEW, NULL); } //----------------------------Mathutils.TriangleNormal() ------------------- @@ -1091,7 +1091,7 @@ static PyObject *M_Mathutils_TriangleNormal( PyObject * self, PyObject * args ) Crossf(n, e2, e1); Normalize(n); - return newVectorObject(n, 3, Py_NEW); + return newVectorObject(n, 3, Py_NEW, NULL); } //--------------------------------- AREA FUNCTIONS-------------------- @@ -1244,7 +1244,7 @@ PyObject *BaseMathObject_getOwner( BaseMathObject * self, void *type ) PyObject *BaseMathObject_getWrapped( BaseMathObject *self, void *type ) { - PyBool_FromLong((self->wrapped == Py_WRAP) ? 1:0); + return PyBool_FromLong((self->wrapped == Py_WRAP) ? 1:0); } void BaseMathObject_dealloc(BaseMathObject * self) @@ -1254,6 +1254,6 @@ void BaseMathObject_dealloc(BaseMathObject * self) PyMem_Free(self->data); Py_XDECREF(self->cb_user); - PyObject_DEL(self); + Py_TYPE(self)->tp_free(self); // PyObject_DEL(self); // breaks subtypes } diff --git a/source/blender/python/generic/euler.c b/source/blender/python/generic/euler.c index 9041eb84a3d..1e0632f4040 100644 --- a/source/blender/python/generic/euler.c +++ b/source/blender/python/generic/euler.c @@ -34,13 +34,6 @@ //-------------------------DOC STRINGS --------------------------- -static char Euler_Zero_doc[] = "() - set all values in the euler to 0"; -static char Euler_Unique_doc[] ="() - sets the euler rotation a unique shortest arc rotation - tests for gimbal lock"; -static char Euler_ToMatrix_doc[] = "() - returns a rotation matrix representing the euler rotation"; -static char Euler_ToQuat_doc[] = "() - returns a quaternion representing the euler rotation"; -static char Euler_Rotate_doc[] = "() - rotate a euler by certain amount around an axis of rotation"; -static char Euler_copy_doc[] = "() - returns a copy of the euler."; -static char Euler_MakeCompatible_doc[] = "(euler) - Make this user compatible with another (no axis flipping)."; static PyObject *Euler_Zero( EulerObject * self ); static PyObject *Euler_Unique( EulerObject * self ); @@ -52,22 +45,21 @@ static PyObject *Euler_copy( EulerObject * self, PyObject *args ); //-----------------------METHOD DEFINITIONS ---------------------- static struct PyMethodDef Euler_methods[] = { - {"zero", (PyCFunction) Euler_Zero, METH_NOARGS, Euler_Zero_doc}, - {"unique", (PyCFunction) Euler_Unique, METH_NOARGS, Euler_Unique_doc}, - {"toMatrix", (PyCFunction) Euler_ToMatrix, METH_NOARGS, Euler_ToMatrix_doc}, - {"toQuat", (PyCFunction) Euler_ToQuat, METH_NOARGS, Euler_ToQuat_doc}, - {"rotate", (PyCFunction) Euler_Rotate, METH_VARARGS, Euler_Rotate_doc}, - {"makeCompatible", (PyCFunction) Euler_MakeCompatible, METH_O, Euler_MakeCompatible_doc}, - {"__copy__", (PyCFunction) Euler_copy, METH_VARARGS, Euler_copy_doc}, - {"copy", (PyCFunction) Euler_copy, METH_VARARGS, Euler_copy_doc}, + {"zero", (PyCFunction) Euler_Zero, METH_NOARGS, NULL}, + {"unique", (PyCFunction) Euler_Unique, METH_NOARGS, NULL}, + {"toMatrix", (PyCFunction) Euler_ToMatrix, METH_NOARGS, NULL}, + {"toQuat", (PyCFunction) Euler_ToQuat, METH_NOARGS, NULL}, + {"rotate", (PyCFunction) Euler_Rotate, METH_VARARGS, NULL}, + {"makeCompatible", (PyCFunction) Euler_MakeCompatible, METH_O, NULL}, + {"__copy__", (PyCFunction) Euler_copy, METH_VARARGS, NULL}, + {"copy", (PyCFunction) Euler_copy, METH_VARARGS, NULL}, {NULL, NULL, 0, NULL} }; //----------------------------------Mathutils.Euler() ------------------- //makes a new euler for you to play with -static PyObject *Euler_new(PyObject * self, PyObject * args) +static PyObject *Euler_new(PyTypeObject * type, PyObject * args, PyObject * kwargs) { - PyObject *listObject = NULL; int size, i; float eul[3]; @@ -84,7 +76,7 @@ static PyObject *Euler_new(PyObject * self, PyObject * args) } } else if (size == 0) { //returns a new empty 3d euler - return newEulerObject(NULL, Py_NEW); + return newEulerObject(NULL, Py_NEW, NULL); } else { listObject = args; } @@ -110,7 +102,7 @@ static PyObject *Euler_new(PyObject * self, PyObject * args) return NULL; } } - return newEulerObject(eul, Py_NEW); + return newEulerObject(eul, Py_NEW, NULL); } //-----------------------------METHODS---------------------------- @@ -118,8 +110,11 @@ static PyObject *Euler_new(PyObject * self, PyObject * args) //return a quaternion representation of the euler static PyObject *Euler_ToQuat(EulerObject * self) { - float eul[3], quat[4]; + float quat[4]; +#ifdef USE_MATHUTILS_DEG + float eul[3]; int x; +#endif if(!BaseMath_ReadCallback(self)) return NULL; @@ -133,7 +128,7 @@ static PyObject *Euler_ToQuat(EulerObject * self) EulToQuat(self->eul, quat); #endif - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } //----------------------------Euler.toMatrix()--------------------- //return a matrix representation of the euler @@ -154,16 +149,17 @@ static PyObject *Euler_ToMatrix(EulerObject * self) #else EulToMat3(self->eul, (float (*)[3]) mat); #endif - return newMatrixObject(mat, 3, 3 , Py_NEW); + return newMatrixObject(mat, 3, 3 , Py_NEW, NULL); } //----------------------------Euler.unique()----------------------- //sets the x,y,z values to a unique euler rotation static PyObject *Euler_Unique(EulerObject * self) { +#define PI_2 (Py_PI * 2.0) +#define PI_HALF (Py_PI / 2.0) +#define PI_INV (1.0 / Py_PI) + double heading, pitch, bank; - double pi2 = Py_PI * 2.0f; - double piO2 = Py_PI / 2.0f; - double Opi2 = 1.0f / pi2; if(!BaseMath_ReadCallback(self)) return NULL; @@ -173,35 +169,39 @@ static PyObject *Euler_Unique(EulerObject * self) heading = self->eul[0] * (float)Py_PI / 180; pitch = self->eul[1] * (float)Py_PI / 180; bank = self->eul[2] * (float)Py_PI / 180; +#else + heading = self->eul[0]; + pitch = self->eul[1]; + bank = self->eul[2]; #endif //wrap heading in +180 / -180 pitch += Py_PI; - pitch -= floor(pitch * Opi2) * pi2; + pitch -= floor(pitch * PI_INV) * PI_2; pitch -= Py_PI; - if(pitch < -piO2) { + if(pitch < -PI_HALF) { pitch = -Py_PI - pitch; heading += Py_PI; bank += Py_PI; - } else if(pitch > piO2) { + } else if(pitch > PI_HALF) { pitch = Py_PI - pitch; heading += Py_PI; bank += Py_PI; } //gimbal lock test - if(fabs(pitch) > piO2 - 1e-4) { + if(fabs(pitch) > PI_HALF - 1e-4) { heading += bank; bank = 0.0f; } else { bank += Py_PI; - bank -= (floor(bank * Opi2)) * pi2; + bank -= (floor(bank * PI_INV)) * PI_2; bank -= Py_PI; } heading += Py_PI; - heading -= (floor(heading * Opi2)) * pi2; + heading -= (floor(heading * PI_INV)) * PI_2; heading -= Py_PI; #ifdef USE_MATHUTILS_DEG @@ -271,8 +271,10 @@ static PyObject *Euler_Rotate(EulerObject * self, PyObject *args) static PyObject *Euler_MakeCompatible(EulerObject * self, EulerObject *value) { +#ifdef USE_MATHUTILS_DEG float eul_from_rad[3]; int x; +#endif if(!EulerObject_Check(value)) { PyErr_SetString(PyExc_TypeError, "euler.makeCompatible(euler):expected a single euler argument."); @@ -311,7 +313,7 @@ static PyObject *Euler_copy(EulerObject * self, PyObject *args) if(!BaseMath_ReadCallback(self)) return NULL; - return newEulerObject(self->eul, Py_NEW); + return newEulerObject(self->eul, Py_NEW, Py_TYPE(self)); } //----------------------------print object (internal)-------------- @@ -376,8 +378,7 @@ static PyObject* Euler_richcmpr(PyObject *objectA, PyObject *objectB, int compar Py_RETURN_FALSE; } } -//------------------------tp_doc -static char EulerObject_doc[] = "This is a wrapper for euler objects."; + //---------------------SEQUENCE PROTOCOLS------------------------ //----------------------------len(object)------------------------ //sequence length @@ -460,7 +461,7 @@ static int Euler_ass_slice(EulerObject * self, int begin, int end, PyObject *e; if(!BaseMath_ReadCallback(self)) - return NULL; + return -1; CLAMP(begin, 0, 3); if (end<0) end= 4+end; @@ -562,8 +563,8 @@ PyTypeObject euler_Type = { 0, //tp_getattro 0, //tp_setattro 0, //tp_as_buffer - Py_TPFLAGS_DEFAULT, //tp_flags - EulerObject_doc, //tp_doc + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, //tp_flags + 0, //tp_doc 0, //tp_traverse 0, //tp_clear (richcmpfunc)Euler_richcmpr, //tp_richcompare @@ -596,12 +597,13 @@ PyTypeObject euler_Type = { (i.e. it was allocated elsewhere by MEM_mallocN()) pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON (i.e. it must be created here with PyMEM_malloc())*/ -PyObject *newEulerObject(float *eul, int type) +PyObject *newEulerObject(float *eul, int type, PyTypeObject *base_type) { EulerObject *self; int x; - self = PyObject_NEW(EulerObject, &euler_Type); + if(base_type) self = base_type->tp_alloc(base_type, 0); + else self = PyObject_NEW(EulerObject, &euler_Type); /* init callbacks as NULL */ self->cb_user= NULL; @@ -628,7 +630,7 @@ PyObject *newEulerObject(float *eul, int type) PyObject *newEulerObject_cb(PyObject *cb_user, int cb_type, int cb_subtype) { - EulerObject *self= (EulerObject *)newEulerObject(NULL, Py_NEW); + EulerObject *self= (EulerObject *)newEulerObject(NULL, Py_NEW, NULL); if(self) { Py_INCREF(cb_user); self->cb_user= cb_user; @@ -636,5 +638,5 @@ PyObject *newEulerObject_cb(PyObject *cb_user, int cb_type, int cb_subtype) self->cb_subtype= (unsigned char)cb_subtype; } - return self; + return (PyObject *)self; } diff --git a/source/blender/python/generic/euler.h b/source/blender/python/generic/euler.h index 0bff6de6964..a3706d53756 100644 --- a/source/blender/python/generic/euler.h +++ b/source/blender/python/generic/euler.h @@ -35,8 +35,7 @@ #include "../intern/bpy_compat.h" extern PyTypeObject euler_Type; - -#define EulerObject_Check(v) (Py_TYPE(v) == &euler_Type) +#define EulerObject_Check(_v) PyObject_TypeCheck((_v), &euler_Type) typedef struct { PyObject_VAR_HEAD @@ -55,7 +54,7 @@ be stored in py_data) or be a wrapper for data allocated through blender (stored in blend_data). This is an either/or struct not both*/ //prototypes -PyObject *newEulerObject( float *eul, int type ); +PyObject *newEulerObject( float *eul, int type, PyTypeObject *base_type); PyObject *newEulerObject_cb(PyObject *cb_user, int cb_type, int cb_subtype); #endif /* EXPP_euler_h */ diff --git a/source/blender/python/generic/matrix.c b/source/blender/python/generic/matrix.c index b546aa1226c..5bdbf804618 100644 --- a/source/blender/python/generic/matrix.c +++ b/source/blender/python/generic/matrix.c @@ -97,18 +97,6 @@ Mathutils_Callback mathutils_matrix_vector_cb = { /* matrix vector callbacks, this is so you can do matrix[i][j] = val */ /*-------------------------DOC STRINGS ---------------------------*/ -static char Matrix_Zero_doc[] = "() - set all values in the matrix to 0"; -static char Matrix_Identity_doc[] = "() - set the square matrix to it's identity matrix"; -static char Matrix_Transpose_doc[] = "() - set the matrix to it's transpose"; -static char Matrix_Determinant_doc[] = "() - return the determinant of the matrix"; -static char Matrix_Invert_doc[] = "() - set the matrix to it's inverse if an inverse is possible"; -static char Matrix_TranslationPart_doc[] = "() - return a vector encompassing the translation of the matrix"; -static char Matrix_RotationPart_doc[] = "() - return a vector encompassing the rotation of the matrix"; -static char Matrix_scalePart_doc[] = "() - convert matrix to a 3D vector"; -static char Matrix_Resize4x4_doc[] = "() - resize the matrix to a 4x4 square matrix"; -static char Matrix_toEuler_doc[] = "(eul_compat) - convert matrix to a euler angle rotation, optional euler argument that the new euler will be made compatible with."; -static char Matrix_toQuat_doc[] = "() - convert matrix to a quaternion rotation"; -static char Matrix_copy_doc[] = "() - return a copy of the matrix"; static PyObject *Matrix_Zero( MatrixObject * self ); static PyObject *Matrix_Identity( MatrixObject * self ); @@ -125,19 +113,19 @@ static PyObject *Matrix_copy( MatrixObject * self ); /*-----------------------METHOD DEFINITIONS ----------------------*/ static struct PyMethodDef Matrix_methods[] = { - {"zero", (PyCFunction) Matrix_Zero, METH_NOARGS, Matrix_Zero_doc}, - {"identity", (PyCFunction) Matrix_Identity, METH_NOARGS, Matrix_Identity_doc}, - {"transpose", (PyCFunction) Matrix_Transpose, METH_NOARGS, Matrix_Transpose_doc}, - {"determinant", (PyCFunction) Matrix_Determinant, METH_NOARGS, Matrix_Determinant_doc}, - {"invert", (PyCFunction) Matrix_Invert, METH_NOARGS, Matrix_Invert_doc}, - {"translationPart", (PyCFunction) Matrix_TranslationPart, METH_NOARGS, Matrix_TranslationPart_doc}, - {"rotationPart", (PyCFunction) Matrix_RotationPart, METH_NOARGS, Matrix_RotationPart_doc}, - {"scalePart", (PyCFunction) Matrix_scalePart, METH_NOARGS, Matrix_scalePart_doc}, - {"resize4x4", (PyCFunction) Matrix_Resize4x4, METH_NOARGS, Matrix_Resize4x4_doc}, - {"toEuler", (PyCFunction) Matrix_toEuler, METH_VARARGS, Matrix_toEuler_doc}, - {"toQuat", (PyCFunction) Matrix_toQuat, METH_NOARGS, Matrix_toQuat_doc}, - {"copy", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc}, - {"__copy__", (PyCFunction) Matrix_copy, METH_NOARGS, Matrix_copy_doc}, + {"zero", (PyCFunction) Matrix_Zero, METH_NOARGS, NULL}, + {"identity", (PyCFunction) Matrix_Identity, METH_NOARGS, NULL}, + {"transpose", (PyCFunction) Matrix_Transpose, METH_NOARGS, NULL}, + {"determinant", (PyCFunction) Matrix_Determinant, METH_NOARGS, NULL}, + {"invert", (PyCFunction) Matrix_Invert, METH_NOARGS, NULL}, + {"translationPart", (PyCFunction) Matrix_TranslationPart, METH_NOARGS, NULL}, + {"rotationPart", (PyCFunction) Matrix_RotationPart, METH_NOARGS, NULL}, + {"scalePart", (PyCFunction) Matrix_scalePart, METH_NOARGS, NULL}, + {"resize4x4", (PyCFunction) Matrix_Resize4x4, METH_NOARGS, NULL}, + {"toEuler", (PyCFunction) Matrix_toEuler, METH_VARARGS, NULL}, + {"toQuat", (PyCFunction) Matrix_toQuat, METH_NOARGS, NULL}, + {"copy", (PyCFunction) Matrix_copy, METH_NOARGS, NULL}, + {"__copy__", (PyCFunction) Matrix_copy, METH_NOARGS, NULL}, {NULL, NULL, 0, NULL} }; @@ -158,7 +146,7 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) PyErr_SetString(PyExc_AttributeError, "Mathutils.Matrix(): expects 0-4 numeric sequences of the same size\n"); return NULL; } else if (argSize == 0) { //return empty 4D matrix - return (PyObject *) newMatrixObject(NULL, 4, 4, Py_NEW); + return (PyObject *) newMatrixObject(NULL, 4, 4, Py_NEW, NULL); }else if (argSize == 1){ //copy constructor for matrix objects argObject = PyTuple_GET_ITEM(args, 0); @@ -167,11 +155,7 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) if(!BaseMath_ReadCallback(mat)) return NULL; - argSize = mat->rowSize; //rows - seqSize = mat->colSize; //col - for(i = 0; i < (seqSize * argSize); i++){ - matrix[i] = mat->contigPtr[i]; - } + memcpy(matrix, mat->contigPtr, sizeof(float) * mat->rowSize * mat->colSize); } }else{ //2-4 arguments (all seqs? all same size?) for(i =0; i < argSize; i++){ @@ -216,7 +200,7 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds) } } } - return newMatrixObject(matrix, argSize, seqSize, Py_NEW); + return newMatrixObject(matrix, argSize, seqSize, Py_NEW, NULL); } /*-----------------------------METHODS----------------------------*/ @@ -239,14 +223,16 @@ static PyObject *Matrix_toQuat(MatrixObject * self) Mat4ToQuat((float (*)[4])*self->matrix, quat); } - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } /*---------------------------Matrix.toEuler() --------------------*/ PyObject *Matrix_toEuler(MatrixObject * self, PyObject *args) { float eul[3], eul_compatf[3]; EulerObject *eul_compat = NULL; +#ifdef USE_MATHUTILS_DEG int x; +#endif if(!BaseMath_ReadCallback(self)) return NULL; @@ -288,7 +274,7 @@ PyObject *Matrix_toEuler(MatrixObject * self, PyObject *args) eul[x] *= (float) (180 / Py_PI); } #endif - return newEulerObject(eul, Py_NEW); + return newEulerObject(eul, Py_NEW, NULL); } /*---------------------------Matrix.resize4x4() ------------------*/ PyObject *Matrix_Resize4x4(MatrixObject * self) @@ -364,7 +350,7 @@ PyObject *Matrix_TranslationPart(MatrixObject * self) vec[1] = self->matrix[3][1]; vec[2] = self->matrix[3][2]; - return newVectorObject(vec, 3, Py_NEW); + return newVectorObject(vec, 3, Py_NEW, NULL); } /*---------------------------Matrix.rotationPart() ---------------*/ PyObject *Matrix_RotationPart(MatrixObject * self) @@ -390,7 +376,7 @@ PyObject *Matrix_RotationPart(MatrixObject * self) mat[7] = self->matrix[2][1]; mat[8] = self->matrix[2][2]; - return newMatrixObject(mat, 3, 3, Py_NEW); + return newMatrixObject(mat, 3, 3, Py_NEW, Py_TYPE(self)); } /*---------------------------Matrix.scalePart() --------------------*/ PyObject *Matrix_scalePart(MatrixObject * self) @@ -419,7 +405,7 @@ PyObject *Matrix_scalePart(MatrixObject * self) scale[0]= tmat[0][0]; scale[1]= tmat[1][1]; scale[2]= tmat[2][2]; - return newVectorObject(scale, 3, Py_NEW); + return newVectorObject(scale, 3, Py_NEW, NULL); } /*---------------------------Matrix.invert() ---------------------*/ PyObject *Matrix_Invert(MatrixObject * self) @@ -589,7 +575,7 @@ PyObject *Matrix_copy(MatrixObject * self) if(!BaseMath_ReadCallback(self)) return NULL; - return (PyObject*)(MatrixObject*)newMatrixObject((float (*))*self->matrix, self->rowSize, self->colSize, Py_NEW); + return (PyObject*)newMatrixObject((float (*))*self->matrix, self->rowSize, self->colSize, Py_NEW, Py_TYPE(self)); } /*----------------------------print object (internal)-------------*/ @@ -674,8 +660,7 @@ static PyObject* Matrix_richcmpr(PyObject *objectA, PyObject *objectB, int compa Py_RETURN_FALSE; } } -/*------------------------tp_doc*/ -static char MatrixObject_doc[] = "This is a wrapper for matrix objects."; + /*---------------------SEQUENCE PROTOCOLS------------------------ ----------------------------len(object)------------------------ sequence length*/ @@ -775,8 +760,7 @@ static PyObject *Matrix_slice(MatrixObject * self, int begin, int end) } /*----------------------------object[z:y]------------------------ sequence slice (set)*/ -static int Matrix_ass_slice(MatrixObject * self, int begin, int end, - PyObject * seq) +static int Matrix_ass_slice(MatrixObject * self, int begin, int end, PyObject * seq) { int i, x, y, size, sub_size = 0; float mat[16], f; @@ -882,7 +866,7 @@ static PyObject *Matrix_add(PyObject * m1, PyObject * m2) } } - return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW); + return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW, NULL); } /*------------------------obj - obj------------------------------ subtraction*/ @@ -915,7 +899,7 @@ static PyObject *Matrix_sub(PyObject * m1, PyObject * m2) } } - return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW); + return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW, NULL); } /*------------------------obj * obj------------------------------ mulplication*/ @@ -954,7 +938,7 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) } } - return newMatrixObject(mat, mat1->rowSize, mat2->colSize, Py_NEW); + return newMatrixObject(mat, mat1->rowSize, mat2->colSize, Py_NEW, NULL); } if(mat1==NULL){ @@ -965,7 +949,7 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) mat[((x * mat2->colSize) + y)] = scalar * mat2->matrix[x][y]; } } - return newMatrixObject(mat, mat2->rowSize, mat2->colSize, Py_NEW); + return newMatrixObject(mat, mat2->rowSize, mat2->colSize, Py_NEW, NULL); } PyErr_SetString(PyExc_TypeError, "Matrix multiplication: arguments not acceptable for this operation"); @@ -984,7 +968,7 @@ static PyObject *Matrix_mul(PyObject * m1, PyObject * m2) mat[((x * mat1->colSize) + y)] = scalar * mat1->matrix[x][y]; } } - return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW); + return newMatrixObject(mat, mat1->rowSize, mat1->colSize, Py_NEW, NULL); } } PyErr_SetString(PyExc_TypeError, "Matrix multiplication: arguments not acceptable for this operation"); @@ -1012,6 +996,123 @@ static PySequenceMethods Matrix_SeqMethods = { (ssizeobjargproc) Matrix_ass_item, /* sq_ass_item */ (ssizessizeobjargproc) Matrix_ass_slice, /* sq_ass_slice */ }; + + + +#if (PY_VERSION_HEX >= 0x03000000) +static PyObject *Matrix_subscript(MatrixObject* self, PyObject* item) +{ + if (PyIndex_Check(item)) { + Py_ssize_t i; + i = PyNumber_AsSsize_t(item, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return NULL; + if (i < 0) + i += self->rowSize; + return Matrix_item(self, i); + } else if (PySlice_Check(item)) { + Py_ssize_t start, stop, step, slicelength; + + if (PySlice_GetIndicesEx((PySliceObject*)item, self->rowSize, &start, &stop, &step, &slicelength) < 0) + return NULL; + + if (slicelength <= 0) { + return PyList_New(0); + } + else if (step == 1) { + return Matrix_slice(self, start, stop); + } + else { + PyErr_SetString(PyExc_TypeError, "slice steps not supported with matricies"); + return NULL; + } + } + else { + PyErr_Format(PyExc_TypeError, + "vector indices must be integers, not %.200s", + item->ob_type->tp_name); + return NULL; + } +} + +static int Matrix_ass_subscript(MatrixObject* self, PyObject* item, PyObject* value) +{ + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return -1; + if (i < 0) + i += self->rowSize; + return Matrix_ass_item(self, i, value); + } + else if (PySlice_Check(item)) { + Py_ssize_t start, stop, step, slicelength; + + if (PySlice_GetIndicesEx((PySliceObject*)item, self->rowSize, &start, &stop, &step, &slicelength) < 0) + return -1; + + if (step == 1) + return Matrix_ass_slice(self, start, stop, value); + else { + PyErr_SetString(PyExc_TypeError, "slice steps not supported with matricies"); + return -1; + } + } + else { + PyErr_Format(PyExc_TypeError, + "matrix indices must be integers, not %.200s", + item->ob_type->tp_name); + return -1; + } +} + +static PyMappingMethods Matrix_AsMapping = { + (lenfunc)Matrix_len, + (binaryfunc)Matrix_subscript, + (objobjargproc)Matrix_ass_subscript +}; +#endif /* (PY_VERSION_HEX >= 0x03000000) */ + + + +#if (PY_VERSION_HEX >= 0x03000000) +static PyNumberMethods Matrix_NumMethods = { + (binaryfunc) Matrix_add, /*nb_add*/ + (binaryfunc) Matrix_sub, /*nb_subtract*/ + (binaryfunc) Matrix_mul, /*nb_multiply*/ + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + (unaryfunc) 0, /*nb_negative*/ + (unaryfunc) 0, /*tp_positive*/ + (unaryfunc) 0, /*tp_absolute*/ + (inquiry) 0, /*tp_bool*/ + (unaryfunc) Matrix_inv, /*nb_invert*/ + 0, /*nb_lshift*/ + (binaryfunc)0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + 0, /*nb_int*/ + 0, /*nb_reserved*/ + 0, /*nb_float*/ + 0, /* nb_inplace_add */ + 0, /* nb_inplace_subtract */ + 0, /* nb_inplace_multiply */ + 0, /* nb_inplace_remainder */ + 0, /* nb_inplace_power */ + 0, /* nb_inplace_lshift */ + 0, /* nb_inplace_rshift */ + 0, /* nb_inplace_and */ + 0, /* nb_inplace_xor */ + 0, /* nb_inplace_or */ + 0, /* nb_floor_divide */ + 0, /* nb_true_divide */ + 0, /* nb_inplace_floor_divide */ + 0, /* nb_inplace_true_divide */ + 0, /* nb_index */ +}; +#else static PyNumberMethods Matrix_NumMethods = { (binaryfunc) Matrix_add, /* __add__ */ (binaryfunc) Matrix_sub, /* __sub__ */ @@ -1037,6 +1138,7 @@ static PyNumberMethods Matrix_NumMethods = { (unaryfunc) 0, /* __oct__ */ (unaryfunc) 0, /* __hex__ */ }; +#endif static PyObject *Matrix_getRowSize( MatrixObject * self, void *type ) { @@ -1080,15 +1182,19 @@ PyTypeObject matrix_Type = { (reprfunc) Matrix_repr, /*tp_repr*/ &Matrix_NumMethods, /*tp_as_number*/ &Matrix_SeqMethods, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ +#if (PY_VERSION_HEX >= 0x03000000) + &Matrix_AsMapping, /*tp_as_mapping*/ +#else + 0, +#endif 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT, /*tp_flags*/ - MatrixObject_doc, /*tp_doc*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ (richcmpfunc)Matrix_richcmpr, /*tp_richcompare*/ @@ -1132,7 +1238,7 @@ self->matrix[1][1] = self->contigPtr[4] */ (i.e. it was allocated elsewhere by MEM_mallocN()) pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON (i.e. it must be created here with PyMEM_malloc())*/ -PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type) +PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type, PyTypeObject *base_type) { MatrixObject *self; int x, row, col; @@ -1143,7 +1249,9 @@ PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type) return NULL; } - self = PyObject_NEW(MatrixObject, &matrix_Type); + if(base_type) self = (MatrixObject *)base_type->tp_alloc(base_type, 0); + else self = PyObject_NEW(MatrixObject, &matrix_Type); + self->rowSize = rowSize; self->colSize = colSize; @@ -1201,7 +1309,7 @@ PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type) PyObject *newMatrixObject_cb(PyObject *cb_user, int rowSize, int colSize, int cb_type, int cb_subtype) { - MatrixObject *self= (MatrixObject *)newMatrixObject(NULL, rowSize, colSize, Py_NEW); + MatrixObject *self= (MatrixObject *)newMatrixObject(NULL, rowSize, colSize, Py_NEW, NULL); if(self) { Py_INCREF(cb_user); self->cb_user= cb_user; @@ -1246,5 +1354,5 @@ static PyObject *column_vector_multiplication(MatrixObject * mat, VectorObject* vecNew[z++] = (float)dot; dot = 0.0f; } - return newVectorObject(vecNew, vec->size, Py_NEW); + return newVectorObject(vecNew, vec->size, Py_NEW, NULL); } diff --git a/source/blender/python/generic/matrix.h b/source/blender/python/generic/matrix.h index 4b073668969..856c711c4ef 100644 --- a/source/blender/python/generic/matrix.h +++ b/source/blender/python/generic/matrix.h @@ -33,8 +33,7 @@ #include extern PyTypeObject matrix_Type; - -#define MatrixObject_Check(v) ((v)->ob_type == &matrix_Type) +#define MatrixObject_Check(_v) PyObject_TypeCheck((_v), &matrix_Type) typedef float **ptRow; typedef struct _Matrix { /* keep aligned with BaseMathObject in Mathutils.h */ @@ -58,7 +57,7 @@ be stored in py_data) or be a wrapper for data allocated through blender (stored in blend_data). This is an either/or struct not both*/ /*prototypes*/ -PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type); +PyObject *newMatrixObject(float *mat, int rowSize, int colSize, int type, PyTypeObject *base_type); PyObject *newMatrixObject_cb(PyObject *user, int rowSize, int colSize, int cb_type, int cb_subtype); extern int mathutils_matrix_vector_cb_index; diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c index c004bcd1bf2..b9c491e24e4 100644 --- a/source/blender/python/generic/quat.c +++ b/source/blender/python/generic/quat.c @@ -34,16 +34,6 @@ //-------------------------DOC STRINGS --------------------------- -static char Quaternion_Identity_doc[] = "() - set the quaternion to it's identity (1, vector)"; -static char Quaternion_Negate_doc[] = "() - set all values in the quaternion to their negative"; -static char Quaternion_Conjugate_doc[] = "() - set the quaternion to it's conjugate"; -static char Quaternion_Inverse_doc[] = "() - set the quaternion to it's inverse"; -static char Quaternion_Normalize_doc[] = "() - normalize the vector portion of the quaternion"; -static char Quaternion_ToEuler_doc[] = "(eul_compat) - return a euler rotation representing the quaternion, optional euler argument that the new euler will be made compatible with."; -static char Quaternion_ToMatrix_doc[] = "() - return a rotation matrix representing the quaternion"; -static char Quaternion_Cross_doc[] = "(other) - return the cross product between this quaternion and another"; -static char Quaternion_Dot_doc[] = "(other) - return the dot product between this quaternion and another"; -static char Quaternion_copy_doc[] = "() - return a copy of the quat"; static PyObject *Quaternion_Identity( QuaternionObject * self ); static PyObject *Quaternion_Negate( QuaternionObject * self ); @@ -58,17 +48,17 @@ static PyObject *Quaternion_copy( QuaternionObject * self ); //-----------------------METHOD DEFINITIONS ---------------------- static struct PyMethodDef Quaternion_methods[] = { - {"identity", (PyCFunction) Quaternion_Identity, METH_NOARGS, Quaternion_Identity_doc}, - {"negate", (PyCFunction) Quaternion_Negate, METH_NOARGS, Quaternion_Negate_doc}, - {"conjugate", (PyCFunction) Quaternion_Conjugate, METH_NOARGS, Quaternion_Conjugate_doc}, - {"inverse", (PyCFunction) Quaternion_Inverse, METH_NOARGS, Quaternion_Inverse_doc}, - {"normalize", (PyCFunction) Quaternion_Normalize, METH_NOARGS, Quaternion_Normalize_doc}, - {"toEuler", (PyCFunction) Quaternion_ToEuler, METH_VARARGS, Quaternion_ToEuler_doc}, - {"toMatrix", (PyCFunction) Quaternion_ToMatrix, METH_NOARGS, Quaternion_ToMatrix_doc}, - {"cross", (PyCFunction) Quaternion_Cross, METH_O, Quaternion_Cross_doc}, - {"dot", (PyCFunction) Quaternion_Dot, METH_O, Quaternion_Dot_doc}, - {"__copy__", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc}, - {"copy", (PyCFunction) Quaternion_copy, METH_NOARGS, Quaternion_copy_doc}, + {"identity", (PyCFunction) Quaternion_Identity, METH_NOARGS, NULL}, + {"negate", (PyCFunction) Quaternion_Negate, METH_NOARGS, NULL}, + {"conjugate", (PyCFunction) Quaternion_Conjugate, METH_NOARGS, NULL}, + {"inverse", (PyCFunction) Quaternion_Inverse, METH_NOARGS, NULL}, + {"normalize", (PyCFunction) Quaternion_Normalize, METH_NOARGS, NULL}, + {"toEuler", (PyCFunction) Quaternion_ToEuler, METH_VARARGS, NULL}, + {"toMatrix", (PyCFunction) Quaternion_ToMatrix, METH_NOARGS, NULL}, + {"cross", (PyCFunction) Quaternion_Cross, METH_O, NULL}, + {"dot", (PyCFunction) Quaternion_Dot, METH_O, NULL}, + {"__copy__", (PyCFunction) Quaternion_copy, METH_NOARGS, NULL}, + {"copy", (PyCFunction) Quaternion_copy, METH_NOARGS, NULL}, {NULL, NULL, 0, NULL} }; @@ -127,7 +117,7 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw } } } else if (size == 0) { //returns a new empty quat - return newQuaternionObject(NULL, Py_NEW); + return newQuaternionObject(NULL, Py_NEW, NULL); } else { listObject = args; } @@ -167,7 +157,7 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw AxisAngleToQuat(quat, quat, angle); #endif - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } //-----------------------------METHODS------------------------------ @@ -211,7 +201,7 @@ static PyObject *Quaternion_ToEuler(QuaternionObject * self, PyObject *args) eul[x] *= (180 / (float)Py_PI); } #endif - return newEulerObject(eul, Py_NEW); + return newEulerObject(eul, Py_NEW, NULL); } //----------------------------Quaternion.toMatrix()------------------ //return the quat as a matrix @@ -223,7 +213,7 @@ static PyObject *Quaternion_ToMatrix(QuaternionObject * self) return NULL; QuatToMat3(self->quat, (float (*)[3]) mat); - return newMatrixObject(mat, 3, 3, Py_NEW); + return newMatrixObject(mat, 3, 3, Py_NEW, NULL); } //----------------------------Quaternion.cross(other)------------------ @@ -241,7 +231,7 @@ static PyObject *Quaternion_Cross(QuaternionObject * self, QuaternionObject * va return NULL; QuatMul(quat, self->quat, value->quat); - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } //----------------------------Quaternion.dot(other)------------------ @@ -331,7 +321,7 @@ static PyObject *Quaternion_copy(QuaternionObject * self) if(!BaseMath_ReadCallback(self)) return NULL; - return newQuaternionObject(self->quat, Py_NEW); + return newQuaternionObject(self->quat, Py_NEW, Py_TYPE(self)); } //----------------------------print object (internal)-------------- @@ -394,8 +384,7 @@ static PyObject* Quaternion_richcmpr(PyObject *objectA, PyObject *objectB, int c Py_RETURN_FALSE; } } -//------------------------tp_doc -static char QuaternionObject_doc[] = "This is a wrapper for quaternion objects."; + //---------------------SEQUENCE PROTOCOLS------------------------ //----------------------------len(object)------------------------ //sequence length @@ -529,7 +518,7 @@ static PyObject *Quaternion_add(PyObject * q1, PyObject * q2) return NULL; QuatAdd(quat, quat1->quat, quat2->quat, 1.0f); - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } //------------------------obj - obj------------------------------ //subtraction @@ -554,7 +543,7 @@ static PyObject *Quaternion_sub(PyObject * q1, PyObject * q2) quat[x] = quat1->quat[x] - quat2->quat[x]; } - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } //------------------------obj * obj------------------------------ //mulplication @@ -585,7 +574,7 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2) if ((scalar == -1.0 && PyErr_Occurred())==0) { /* FLOAT*QUAT */ QUATCOPY(quat, quat2->quat); QuatMulf(quat, scalar); - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } PyErr_SetString(PyExc_TypeError, "Quaternion multiplication: val * quat, val is not an acceptable type"); return NULL; @@ -604,7 +593,7 @@ static PyObject *Quaternion_mul(PyObject * q1, PyObject * q2) if ((scalar == -1.0 && PyErr_Occurred())==0) { /* QUAT*FLOAT */ QUATCOPY(quat, quat1->quat); QuatMulf(quat, scalar); - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } } @@ -622,6 +611,45 @@ static PySequenceMethods Quaternion_SeqMethods = { (ssizeobjargproc) Quaternion_ass_item, /* sq_ass_item */ (ssizessizeobjargproc) Quaternion_ass_slice, /* sq_ass_slice */ }; + +#if (PY_VERSION_HEX >= 0x03000000) +static PyNumberMethods Quaternion_NumMethods = { + (binaryfunc) Quaternion_add, /*nb_add*/ + (binaryfunc) Quaternion_sub, /*nb_subtract*/ + (binaryfunc) Quaternion_mul, /*nb_multiply*/ + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + (unaryfunc) 0, /*nb_negative*/ + (unaryfunc) 0, /*tp_positive*/ + (unaryfunc) 0, /*tp_absolute*/ + (inquiry) 0, /*tp_bool*/ + (unaryfunc) 0, /*nb_invert*/ + 0, /*nb_lshift*/ + (binaryfunc)0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + 0, /*nb_int*/ + 0, /*nb_reserved*/ + 0, /*nb_float*/ + 0, /* nb_inplace_add */ + 0, /* nb_inplace_subtract */ + 0, /* nb_inplace_multiply */ + 0, /* nb_inplace_remainder */ + 0, /* nb_inplace_power */ + 0, /* nb_inplace_lshift */ + 0, /* nb_inplace_rshift */ + 0, /* nb_inplace_and */ + 0, /* nb_inplace_xor */ + 0, /* nb_inplace_or */ + 0, /* nb_floor_divide */ + 0, /* nb_true_divide */ + 0, /* nb_inplace_floor_divide */ + 0, /* nb_inplace_true_divide */ + 0, /* nb_index */ +}; +#else static PyNumberMethods Quaternion_NumMethods = { (binaryfunc) Quaternion_add, /* __add__ */ (binaryfunc) Quaternion_sub, /* __sub__ */ @@ -646,9 +674,8 @@ static PyNumberMethods Quaternion_NumMethods = { (unaryfunc) 0, /* __float__ */ (unaryfunc) 0, /* __oct__ */ (unaryfunc) 0, /* __hex__ */ - }; - +#endif static PyObject *Quaternion_getAxis( QuaternionObject * self, void *type ) { @@ -692,7 +719,7 @@ static PyObject *Quaternion_getAxisVec( QuaternionObject * self, void *type ) EXPP_FloatsAreEqual(vec[2], 0.0f, 10) ){ vec[0] = 1.0f; } - return (PyObject *) newVectorObject(vec, 3, Py_NEW); + return (PyObject *) newVectorObject(vec, 3, Py_NEW, NULL); } @@ -768,8 +795,8 @@ PyTypeObject quaternion_Type = { 0, //tp_getattro 0, //tp_setattro 0, //tp_as_buffer - Py_TPFLAGS_DEFAULT, //tp_flags - QuaternionObject_doc, //tp_doc + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, //tp_flags + 0, //tp_doc 0, //tp_traverse 0, //tp_clear (richcmpfunc)Quaternion_richcmpr, //tp_richcompare @@ -802,11 +829,12 @@ PyTypeObject quaternion_Type = { (i.e. it was allocated elsewhere by MEM_mallocN()) pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON (i.e. it must be created here with PyMEM_malloc())*/ -PyObject *newQuaternionObject(float *quat, int type) +PyObject *newQuaternionObject(float *quat, int type, PyTypeObject *base_type) { QuaternionObject *self; - self = PyObject_NEW(QuaternionObject, &quaternion_Type); + if(base_type) self = base_type->tp_alloc(base_type, 0); + else self = PyObject_NEW(QuaternionObject, &quaternion_Type); /* init callbacks as NULL */ self->cb_user= NULL; @@ -831,7 +859,7 @@ PyObject *newQuaternionObject(float *quat, int type) PyObject *newQuaternionObject_cb(PyObject *cb_user, int cb_type, int cb_subtype) { - QuaternionObject *self= (QuaternionObject *)newQuaternionObject(NULL, Py_NEW); + QuaternionObject *self= (QuaternionObject *)newQuaternionObject(NULL, Py_NEW, NULL); if(self) { Py_INCREF(cb_user); self->cb_user= cb_user; diff --git a/source/blender/python/generic/quat.h b/source/blender/python/generic/quat.h index 2e74b5fa7f9..a7cfb7898b1 100644 --- a/source/blender/python/generic/quat.h +++ b/source/blender/python/generic/quat.h @@ -35,8 +35,7 @@ #include "../intern/bpy_compat.h" extern PyTypeObject quaternion_Type; - -#define QuaternionObject_Check(v) (Py_TYPE(v) == &quaternion_Type) +#define QuaternionObject_Check(_v) PyObject_TypeCheck((_v), &quaternion_Type) typedef struct { /* keep aligned with BaseMathObject in Mathutils.h */ PyObject_VAR_HEAD @@ -55,7 +54,7 @@ be stored in py_data) or be a wrapper for data allocated through blender (stored in blend_data). This is an either/or struct not both*/ //prototypes -PyObject *newQuaternionObject( float *quat, int type ); +PyObject *newQuaternionObject( float *quat, int type, PyTypeObject *base_type); PyObject *newQuaternionObject_cb(PyObject *cb_user, int cb_type, int cb_subtype); #endif /* EXPP_quat_h */ diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index 9ce0a7ca2f9..b4c74787e05 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -41,19 +41,6 @@ static PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat); /* utility func */ -/*-------------------------DOC STRINGS ---------------------------*/ -static char Vector_Zero_doc[] = "() - set all values in the vector to 0"; -static char Vector_Normalize_doc[] = "() - normalize the vector"; -static char Vector_Negate_doc[] = "() - changes vector to it's additive inverse"; -static char Vector_Resize2D_doc[] = "() - resize a vector to [x,y]"; -static char Vector_Resize3D_doc[] = "() - resize a vector to [x,y,z]"; -static char Vector_Resize4D_doc[] = "() - resize a vector to [x,y,z,w]"; -static char Vector_ToTrackQuat_doc[] = "(track, up) - extract a quaternion from the vector and the track and up axis"; -static char Vector_Reflect_doc[] = "(mirror) - return a vector reflected on the mirror normal"; -static char Vector_Cross_doc[] = "(other) - return the cross product between this vector and another"; -static char Vector_Dot_doc[] = "(other) - return the dot product between this vector and another"; -static char Vector_copy_doc[] = "() - return a copy of the vector"; -static char Vector_swizzle_doc[] = "Swizzle: Get or set axes in specified order"; /*-----------------------METHOD DEFINITIONS ----------------------*/ static PyObject *Vector_Zero( VectorObject * self ); static PyObject *Vector_Normalize( VectorObject * self ); @@ -68,18 +55,18 @@ static PyObject *Vector_Dot( VectorObject * self, VectorObject * value ); static PyObject *Vector_copy( VectorObject * self ); static struct PyMethodDef Vector_methods[] = { - {"zero", (PyCFunction) Vector_Zero, METH_NOARGS, Vector_Zero_doc}, - {"normalize", (PyCFunction) Vector_Normalize, METH_NOARGS, Vector_Normalize_doc}, - {"negate", (PyCFunction) Vector_Negate, METH_NOARGS, Vector_Negate_doc}, - {"resize2D", (PyCFunction) Vector_Resize2D, METH_NOARGS, Vector_Resize2D_doc}, - {"resize3D", (PyCFunction) Vector_Resize3D, METH_NOARGS, Vector_Resize3D_doc}, - {"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, Vector_Resize4D_doc}, - {"toTrackQuat", ( PyCFunction ) Vector_ToTrackQuat, METH_VARARGS, Vector_ToTrackQuat_doc}, - {"reflect", ( PyCFunction ) Vector_Reflect, METH_O, Vector_Reflect_doc}, - {"cross", ( PyCFunction ) Vector_Cross, METH_O, Vector_Dot_doc}, - {"dot", ( PyCFunction ) Vector_Dot, METH_O, Vector_Cross_doc}, - {"copy", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc}, - {"__copy__", (PyCFunction) Vector_copy, METH_NOARGS, Vector_copy_doc}, + {"zero", (PyCFunction) Vector_Zero, METH_NOARGS, NULL}, + {"normalize", (PyCFunction) Vector_Normalize, METH_NOARGS, NULL}, + {"negate", (PyCFunction) Vector_Negate, METH_NOARGS, NULL}, + {"resize2D", (PyCFunction) Vector_Resize2D, METH_NOARGS, NULL}, + {"resize3D", (PyCFunction) Vector_Resize3D, METH_NOARGS, NULL}, + {"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, NULL}, + {"toTrackQuat", ( PyCFunction ) Vector_ToTrackQuat, METH_VARARGS, NULL}, + {"reflect", ( PyCFunction ) Vector_Reflect, METH_O, NULL}, + {"cross", ( PyCFunction ) Vector_Cross, METH_O, NULL}, + {"dot", ( PyCFunction ) Vector_Dot, METH_O, NULL}, + {"copy", (PyCFunction) Vector_copy, METH_NOARGS, NULL}, + {"__copy__", (PyCFunction) Vector_copy, METH_NOARGS, NULL}, {NULL, NULL, 0, NULL} }; @@ -104,7 +91,7 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds) } } else if (size == 0) { //returns a new empty 3d vector - return newVectorObject(NULL, 3, Py_NEW); + return newVectorObject(NULL, 3, Py_NEW, type); } else { listObject = args; } @@ -131,7 +118,7 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds) vec[i]= f; Py_DECREF(v); } - return newVectorObject(vec, size, Py_NEW); + return newVectorObject(vec, size, Py_NEW, type); } /*-----------------------------METHODS---------------------------- */ @@ -362,7 +349,7 @@ static PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) vectoquat(vec, track, up, quat); - return newQuaternionObject(quat, Py_NEW); + return newQuaternionObject(quat, Py_NEW, NULL); } /*----------------------------Vector.reflect(mirror) ---------------------- @@ -414,7 +401,7 @@ static PyObject *Vector_Reflect( VectorObject * self, VectorObject * value ) reflect[1] = (dot2 * mirror[1]) - vec[1]; reflect[2] = (dot2 * mirror[2]) - vec[2]; - return newVectorObject(reflect, self->size, Py_NEW); + return newVectorObject(reflect, self->size, Py_NEW, NULL); } static PyObject *Vector_Cross( VectorObject * self, VectorObject * value ) @@ -434,7 +421,7 @@ static PyObject *Vector_Cross( VectorObject * self, VectorObject * value ) if(!BaseMath_ReadCallback(self) || !BaseMath_ReadCallback(value)) return NULL; - vecCross = (VectorObject *)newVectorObject(NULL, 3, Py_NEW); + vecCross = (VectorObject *)newVectorObject(NULL, 3, Py_NEW, NULL); Crossf(vecCross->vec, self->vec, value->vec); return (PyObject *)vecCross; } @@ -470,7 +457,7 @@ static PyObject *Vector_copy(VectorObject * self) if(!BaseMath_ReadCallback(self)) return NULL; - return newVectorObject(self->vec, self->size, Py_NEW); + return newVectorObject(self->vec, self->size, Py_NEW, Py_TYPE(self)); } /*----------------------------print object (internal)------------- @@ -647,7 +634,7 @@ static PyObject *Vector_add(PyObject * v1, PyObject * v2) for(i = 0; i < vec1->size; i++) { vec[i] = vec1->vec[i] + vec2->vec[i]; } - return newVectorObject(vec, vec1->size, Py_NEW); + return newVectorObject(vec, vec1->size, Py_NEW, NULL); } PyErr_SetString(PyExc_AttributeError, "Vector addition: arguments not valid for this operation....\n"); @@ -717,7 +704,7 @@ static PyObject *Vector_sub(PyObject * v1, PyObject * v2) vec[i] = vec1->vec[i] - vec2->vec[i]; } - return newVectorObject(vec, vec1->size, Py_NEW); + return newVectorObject(vec, vec1->size, Py_NEW, NULL); } /*------------------------obj -= obj------------------------------ @@ -812,7 +799,7 @@ static PyObject *Vector_mul(PyObject * v1, PyObject * v2) for(i = 0; i < vec1->size; i++) { vec[i] = vec1->vec[i] * scalar; } - return newVectorObject(vec, vec1->size, Py_NEW); + return newVectorObject(vec, vec1->size, Py_NEW, NULL); } @@ -912,7 +899,7 @@ static PyObject *Vector_div(PyObject * v1, PyObject * v2) for(i = 0; i < vec1->size; i++) { vec[i] = vec1->vec[i] / scalar; } - return newVectorObject(vec, vec1->size, Py_NEW); + return newVectorObject(vec, vec1->size, Py_NEW, NULL); } /*------------------------obj /= obj------------------------------ @@ -960,11 +947,9 @@ static PyObject *Vector_neg(VectorObject *self) vec[i] = -self->vec[i]; } - return newVectorObject(vec, self->size, Py_NEW); + return newVectorObject(vec, self->size, Py_NEW, Py_TYPE(self)); } -/*------------------------tp_doc*/ -static char VectorObject_doc[] = "This is a wrapper for vector objects."; /*------------------------vec_magnitude_nosqrt (internal) - for comparing only */ static double vec_magnitude_nosqrt(float *data, int size) { @@ -1066,17 +1051,139 @@ static PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int compa Py_RETURN_FALSE; } } + /*-----------------PROTCOL DECLARATIONS--------------------------*/ static PySequenceMethods Vector_SeqMethods = { (inquiry) Vector_len, /* sq_length */ (binaryfunc) 0, /* sq_concat */ - (ssizeargfunc) 0, /* sq_repeat */ + (ssizeargfunc) 0, /* sq_repeat */ (ssizeargfunc) Vector_item, /* sq_item */ - (ssizessizeargfunc) Vector_slice, /* sq_slice */ +#if (PY_VERSION_HEX < 0x03000000) + (ssizessizeargfunc) Vector_slice, /* sq_slice */ /* PY2 ONLY */ +#else + NULL, +#endif (ssizeobjargproc) Vector_ass_item, /* sq_ass_item */ - (ssizessizeobjargproc) Vector_ass_slice, /* sq_ass_slice */ +#if (PY_VERSION_HEX < 0x03000000) + (ssizessizeobjargproc) Vector_ass_slice, /* sq_ass_slice */ /* PY2 ONLY */ +#else + NULL, +#endif }; + + +#if (PY_VERSION_HEX >= 0x03000000) +static PyObject *Vector_subscript(VectorObject* self, PyObject* item) +{ + if (PyIndex_Check(item)) { + Py_ssize_t i; + i = PyNumber_AsSsize_t(item, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return NULL; + if (i < 0) + i += self->size; + return Vector_item(self, i); + } else if (PySlice_Check(item)) { + Py_ssize_t start, stop, step, slicelength; + + if (PySlice_GetIndicesEx((PySliceObject*)item, self->size, &start, &stop, &step, &slicelength) < 0) + return NULL; + + if (slicelength <= 0) { + return PyList_New(0); + } + else if (step == 1) { + return Vector_slice(self, start, stop); + } + else { + PyErr_SetString(PyExc_TypeError, "slice steps not supported with vectors"); + return NULL; + } + } + else { + PyErr_Format(PyExc_TypeError, + "vector indices must be integers, not %.200s", + item->ob_type->tp_name); + return NULL; + } +} + +static int Vector_ass_subscript(VectorObject* self, PyObject* item, PyObject* value) +{ + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return -1; + if (i < 0) + i += self->size; + return Vector_ass_item(self, i, value); + } + else if (PySlice_Check(item)) { + Py_ssize_t start, stop, step, slicelength; + + if (PySlice_GetIndicesEx((PySliceObject*)item, self->size, &start, &stop, &step, &slicelength) < 0) + return -1; + + if (step == 1) + return Vector_ass_slice(self, start, stop, value); + else { + PyErr_SetString(PyExc_TypeError, "slice steps not supported with vectors"); + return -1; + } + } + else { + PyErr_Format(PyExc_TypeError, + "vector indices must be integers, not %.200s", + item->ob_type->tp_name); + return -1; + } +} + +static PyMappingMethods Vector_AsMapping = { + (lenfunc)Vector_len, + (binaryfunc)Vector_subscript, + (objobjargproc)Vector_ass_subscript +}; +#endif /* (PY_VERSION_HEX >= 0x03000000) */ +#if (PY_VERSION_HEX >= 0x03000000) +static PyNumberMethods Vector_NumMethods = { + (binaryfunc) Vector_add, /*nb_add*/ + (binaryfunc) Vector_sub, /*nb_subtract*/ + (binaryfunc) Vector_mul, /*nb_multiply*/ + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + (unaryfunc) Vector_neg, /*nb_negative*/ + (unaryfunc) 0, /*tp_positive*/ + (unaryfunc) 0, /*tp_absolute*/ + (inquiry) 0, /*tp_bool*/ + (unaryfunc) 0, /*nb_invert*/ + 0, /*nb_lshift*/ + (binaryfunc)0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + 0, /*nb_int*/ + 0, /*nb_reserved*/ + 0, /*nb_float*/ + Vector_iadd, /* nb_inplace_add */ + Vector_isub, /* nb_inplace_subtract */ + Vector_imul, /* nb_inplace_multiply */ + 0, /* nb_inplace_remainder */ + 0, /* nb_inplace_power */ + 0, /* nb_inplace_lshift */ + 0, /* nb_inplace_rshift */ + 0, /* nb_inplace_and */ + 0, /* nb_inplace_xor */ + 0, /* nb_inplace_or */ + 0, /* nb_floor_divide */ + Vector_div, /* nb_true_divide */ + 0, /* nb_inplace_floor_divide */ + Vector_idiv, /* nb_inplace_true_divide */ + 0, /* nb_index */ +}; +#else static PyNumberMethods Vector_NumMethods = { (binaryfunc) Vector_add, /* __add__ */ (binaryfunc) Vector_sub, /* __sub__ */ @@ -1122,6 +1229,8 @@ static PyNumberMethods Vector_NumMethods = { (binaryfunc) NULL, /*__ifloordiv__*/ (binaryfunc) NULL, /*__itruediv__*/ }; +#endif + /*------------------PY_OBECT DEFINITION--------------------------*/ /* @@ -1225,7 +1334,7 @@ static PyObject *Vector_getSwizzle(VectorObject * self, void *closure) axisA++; } - return newVectorObject(vec, axisA, Py_NEW); + return newVectorObject(vec, axisA, Py_NEW, Py_TYPE(self)); } /* Set the items of this vector using a swizzle. @@ -1373,342 +1482,342 @@ static PyGetSetDef Vector_getseters[] = { NULL}, /* autogenerated swizzle attrs, see python script below */ - {"xx", (getter)Vector_getSwizzle, (setter)Vector_setSwizzle, Vector_swizzle_doc, (void *)((unsigned int)((0|SWIZZLE_VALID_AXIS) | ((0|SWIZZLE_VALID_AXIS)<= 0x03000000) + &Vector_AsMapping, /* PyMappingMethods *tp_as_mapping; */ +#else + NULL, +#endif /* More standard operations (here for binary compatibility) */ @@ -1802,8 +1915,8 @@ PyTypeObject vector_Type = { NULL, /* PyBufferProcs *tp_as_buffer; */ /*** Flags to define presence of optional/expanded features ***/ - Py_TPFLAGS_DEFAULT, - VectorObject_doc, /* char *tp_doc; Documentation string */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + NULL, /* char *tp_doc; Documentation string */ /*** Assigned meaning in release 2.0 ***/ /* call function for all accessible objects */ NULL, /* traverseproc tp_traverse; */ @@ -1855,10 +1968,13 @@ PyTypeObject vector_Type = { (i.e. it was allocated elsewhere by MEM_mallocN()) pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON (i.e. it must be created here with PyMEM_malloc())*/ -PyObject *newVectorObject(float *vec, int size, int type) +PyObject *newVectorObject(float *vec, int size, int type, PyTypeObject *base_type) { int i; - VectorObject *self = PyObject_NEW(VectorObject, &vector_Type); + VectorObject *self; + + if(base_type) self = base_type->tp_alloc(base_type, 0); + else self = PyObject_NEW(VectorObject, &vector_Type); if(size > 4 || size < 2) return NULL; @@ -1894,7 +2010,7 @@ PyObject *newVectorObject(float *vec, int size, int type) PyObject *newVectorObject_cb(PyObject *cb_user, int size, int cb_type, int cb_subtype) { float dummy[4] = {0.0, 0.0, 0.0, 0.0}; /* dummy init vector, callbacks will be used on access */ - VectorObject *self= (VectorObject *)newVectorObject(dummy, size, Py_NEW); + VectorObject *self= (VectorObject *)newVectorObject(dummy, size, Py_NEW, NULL); if(self) { Py_INCREF(cb_user); self->cb_user= cb_user; @@ -1941,7 +2057,7 @@ static PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat vecNew[z++] = (float)dot; dot = 0.0f; } - return newVectorObject(vecNew, vec_size, Py_NEW); + return newVectorObject(vecNew, vec_size, Py_NEW, NULL); } /*----------------------------Vector.negate() -------------------- diff --git a/source/blender/python/generic/vector.h b/source/blender/python/generic/vector.h index f519b2808cb..f6babac7ed9 100644 --- a/source/blender/python/generic/vector.h +++ b/source/blender/python/generic/vector.h @@ -34,8 +34,7 @@ #include "../intern/bpy_compat.h" extern PyTypeObject vector_Type; - -#define VectorObject_Check(v) (((PyObject *)v)->ob_type == &vector_Type) +#define VectorObject_Check(_v) PyObject_TypeCheck((_v), &vector_Type) typedef struct { /* keep aligned with BaseMathObject in Mathutils.h */ PyObject_VAR_HEAD @@ -50,7 +49,7 @@ typedef struct { /* keep aligned with BaseMathObject in Mathutils.h */ } VectorObject; /*prototypes*/ -PyObject *newVectorObject(float *vec, int size, int type); +PyObject *newVectorObject(float *vec, int size, int type, PyTypeObject *base_type); PyObject *newVectorObject_cb(PyObject *user, int size, int callback_type, int subtype); #endif /* EXPP_vector_h */ diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index b7e3c86dd91..60a9afda0c4 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -353,7 +353,8 @@ PyObject *PYOP_wrap_add(PyObject *self, PyObject *py_class) /* remove if it already exists */ if ((ot=WM_operatortype_find(idname))) { - Py_XDECREF((PyObject*)ot->pyop_data); + if(ot->pyop_data) + Py_XDECREF((PyObject*)ot->pyop_data); WM_operatortype_remove(idname); } diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 558722cc5e6..4729620bb8a 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -35,6 +35,7 @@ #include "RNA_define.h" /* for defining our own rna */ #include "MEM_guardedalloc.h" +#include "BKE_utildefines.h" #include "BKE_context.h" #include "BKE_global.h" /* evil G.* */ #include "BKE_report.h" @@ -204,13 +205,13 @@ static long pyrna_struct_hash( BPy_StructRNA * self ) /* use our own dealloc so we can free a property if we use one */ static void pyrna_struct_dealloc( BPy_StructRNA * self ) { - /* Note!! for some weired reason calling PyObject_DEL() directly crashes blender! */ if (self->freeptr && self->ptr.data) { IDP_FreeProperty(self->ptr.data); MEM_freeN(self->ptr.data); self->ptr.data= NULL; } + /* Note, for subclassed PyObjects we cant just call PyObject_DEL() directly or it will crash */ Py_TYPE(self)->tp_free(self); return; } @@ -820,108 +821,246 @@ static Py_ssize_t pyrna_prop_len( BPy_PropertyRNA * self ) return len; } -static PyObject *pyrna_prop_subscript( BPy_PropertyRNA * self, PyObject *key ) +/* internal use only */ +static PyObject *prop_subscript_collection_int(BPy_PropertyRNA * self, int keynum) { - PyObject *ret; PointerRNA newptr; - int keynum = 0; - char *keyname = NULL; - + + if(keynum < 0) keynum += RNA_property_collection_length(&self->ptr, self->prop); + + if(RNA_property_collection_lookup_int(&self->ptr, self->prop, keynum, &newptr)) + return pyrna_struct_CreatePyObject(&newptr); + + PyErr_SetString(PyExc_IndexError, "out of range"); + return NULL; +} +static PyObject *prop_subscript_array_int(BPy_PropertyRNA * self, int keynum) +{ + int len= RNA_property_array_length(self->prop); + + if(keynum < 0) keynum += len; + + if(keynum >= 0 && keynum < len) + return pyrna_prop_to_py_index(&self->ptr, self->prop, keynum); + + PyErr_SetString(PyExc_IndexError, "out of range"); + return NULL; +} + +static PyObject *prop_subscript_collection_str(BPy_PropertyRNA * self, char *keyname) +{ + PointerRNA newptr; + if(RNA_property_collection_lookup_string(&self->ptr, self->prop, keyname, &newptr)) + return pyrna_struct_CreatePyObject(&newptr); + + PyErr_SetString(PyExc_KeyError, "key not found"); + return NULL; +} +/* static PyObject *prop_subscript_array_str(BPy_PropertyRNA * self, char *keyname) */ + + + + +#if PY_VERSION_HEX >= 0x03000000 +static PyObject *prop_subscript_collection_slice(BPy_PropertyRNA * self, int start, int stop) +{ + PointerRNA newptr; + PyObject *list = PyList_New(stop - start); + int count; + + start = MIN2(start,stop); /* values are clamped from */ + + for(count = start; count < stop; count++) { + if(RNA_property_collection_lookup_int(&self->ptr, self->prop, count - start, &newptr)) { + PyList_SetItem(list, count - start, pyrna_struct_CreatePyObject(&newptr)); + } + else { + Py_DECREF(list); + + PyErr_SetString(PyExc_RuntimeError, "error getting an rna struct from a collection"); + return NULL; + } + } + + return list; +} +static PyObject *prop_subscript_array_slice(BPy_PropertyRNA * self, int start, int stop) +{ + PyObject *list = PyList_New(stop - start); + int count; + + start = MIN2(start,stop); /* values are clamped from PySlice_GetIndicesEx */ + + for(count = start; count < stop; count++) + PyList_SetItem(list, count - start, pyrna_prop_to_py_index(&self->ptr, self->prop, count)); + + return list; +} +#endif + +static PyObject *prop_subscript_collection(BPy_PropertyRNA * self, PyObject *key) +{ if (PyUnicode_Check(key)) { - keyname = _PyUnicode_AsString(key); - } else if (PyLong_Check(key)) { - keynum = PyLong_AsSsize_t(key); - } else { + return prop_subscript_collection_str(self, _PyUnicode_AsString(key)); + } + else if (PyLong_Check(key)) { + return prop_subscript_collection_int(self, PyLong_AsSsize_t(key)); + } +#if PY_VERSION_HEX >= 0x03000000 + else if (PySlice_Check(key)) { + int len= RNA_property_collection_length(&self->ptr, self->prop); + Py_ssize_t start, stop, step, slicelength; + + if (PySlice_GetIndicesEx((PySliceObject*)key, len, &start, &stop, &step, &slicelength) < 0) + return NULL; + + if (slicelength <= 0) { + return PyList_New(0); + } + else if (step == 1) { + return prop_subscript_collection_slice(self, start, stop); + } + else { + PyErr_SetString(PyExc_TypeError, "slice steps not supported with rna"); + return NULL; + } + } +#endif + else { PyErr_SetString(PyExc_AttributeError, "invalid key, key must be a string or an int"); return NULL; } - - if (RNA_property_type(self->prop) == PROP_COLLECTION) { - int ok; - if (keyname) ok = RNA_property_collection_lookup_string(&self->ptr, self->prop, keyname, &newptr); - else ok = RNA_property_collection_lookup_int(&self->ptr, self->prop, keynum, &newptr); - - if (ok) { - ret = pyrna_struct_CreatePyObject(&newptr); - } else { - PyErr_SetString(PyExc_AttributeError, "out of range"); - ret = NULL; +} + +static PyObject *prop_subscript_array(BPy_PropertyRNA * self, PyObject *key) +{ + /*if (PyUnicode_Check(key)) { + return prop_subscript_array_str(self, _PyUnicode_AsString(key)); + } else*/ + if (PyLong_Check(key)) { + return prop_subscript_array_int(self, PyLong_AsSsize_t(key)); + } +#if PY_VERSION_HEX >= 0x03000000 + else if (PySlice_Check(key)) { + int len= RNA_property_array_length(self->prop); + Py_ssize_t start, stop, step, slicelength; + + if (PySlice_GetIndicesEx((PySliceObject*)key, len, &start, &stop, &step, &slicelength) < 0) + return NULL; + + if (slicelength <= 0) { + return PyList_New(0); } - - } else if (keyname) { - PyErr_SetString(PyExc_AttributeError, "string keys are only supported for collections"); - ret = NULL; - } else { - int len = RNA_property_array_length(self->prop); - - if (len==0) { /* not an array*/ - PyErr_Format(PyExc_AttributeError, "not an array or collection %d", keynum); - ret = NULL; + else if (step == 1) { + return prop_subscript_array_slice(self, start, stop); } - - if (keynum >= len){ - PyErr_SetString(PyExc_AttributeError, "index out of range"); - ret = NULL; - } else { /* not an array*/ - ret = pyrna_prop_to_py_index(&self->ptr, self->prop, keynum); + else { + PyErr_SetString(PyExc_TypeError, "slice steps not supported with rna"); + return NULL; } } - - return ret; +#endif + else { + PyErr_SetString(PyExc_AttributeError, "invalid key, key must be an int"); + return NULL; + } } +static PyObject *pyrna_prop_subscript( BPy_PropertyRNA * self, PyObject *key ) +{ + if (RNA_property_type(self->prop) == PROP_COLLECTION) { + return prop_subscript_collection(self, key); + } else if (RNA_property_array_length(self->prop)) { /* arrays are currently fixed length, zero length means its not an array */ + return prop_subscript_array(self, key); + } else { + PyErr_SetString(PyExc_TypeError, "rna type is not an array or a collection"); + return NULL; + } -static int pyrna_prop_assign_subscript( BPy_PropertyRNA * self, PyObject *key, PyObject *value ) +} + +#if PY_VERSION_HEX >= 0x03000000 +static int prop_subscript_ass_array_slice(BPy_PropertyRNA * self, int begin, int end, PyObject *value) { - int ret = 0; - int keynum = 0; - char *keyname = NULL; + int count; + + /* values are clamped from */ + begin = MIN2(begin,end); + + for(count = begin; count < end; count++) { + if(pyrna_py_to_prop_index(&self->ptr, self->prop, count - begin, value) == -1) { + /* TODO - this is wrong since some values have been assigned... will need to fix that */ + return -1; /* pyrna_struct_CreatePyObject should set the error */ + } + } + + return 0; +} +#endif + +static int prop_subscript_ass_array_int(BPy_PropertyRNA * self, int keynum, PyObject *value) +{ + + int len= RNA_property_array_length(self->prop); + + if(keynum < 0) keynum += len; + + if(keynum >= 0 && keynum < len) + return pyrna_py_to_prop_index(&self->ptr, self->prop, keynum, value); + + PyErr_SetString(PyExc_IndexError, "out of range"); + return -1; +} + +static int pyrna_prop_ass_subscript( BPy_PropertyRNA * self, PyObject *key, PyObject *value ) +{ + /* char *keyname = NULL; */ /* not supported yet */ if (!RNA_property_editable(&self->ptr, self->prop)) { PyErr_Format( PyExc_AttributeError, "PropertyRNA - attribute \"%s\" from \"%s\" is read-only", RNA_property_identifier(self->prop), RNA_struct_identifier(self->ptr.type) ); return -1; } - if (PyUnicode_Check(key)) { - keyname = _PyUnicode_AsString(key); - } else if (PyLong_Check(key)) { - keynum = PyLong_AsSsize_t(key); - } else { - PyErr_SetString(PyExc_AttributeError, "PropertyRNA - invalid key, key must be a string or an int"); + /* maybe one day we can support this... */ + if (RNA_property_type(self->prop) == PROP_COLLECTION) { + PyErr_Format( PyExc_AttributeError, "PropertyRNA - attribute \"%s\" from \"%s\" is a collection, assignment not supported", RNA_property_identifier(self->prop), RNA_struct_identifier(self->ptr.type) ); return -1; } - - if (RNA_property_type(self->prop) == PROP_COLLECTION) { - PyErr_SetString(PyExc_AttributeError, "PropertyRNA - assignment is not supported for collections (yet)"); - ret = -1; - } else if (keyname) { - PyErr_SetString(PyExc_AttributeError, "PropertyRNA - string keys are only supported for collections"); - ret = -1; - } else { - int len = RNA_property_array_length(self->prop); - - if (len==0) { /* not an array*/ - PyErr_Format(PyExc_AttributeError, "PropertyRNA - not an array or collection %d", keynum); - ret = -1; + + if (PyLong_Check(key)) { + return prop_subscript_ass_array_int(self, PyLong_AsSsize_t(key), value); + } +#if PY_VERSION_HEX >= 0x03000000 + else if (PySlice_Check(key)) { + int len= RNA_property_array_length(self->prop); + Py_ssize_t start, stop, step, slicelength; + + if (PySlice_GetIndicesEx((PySliceObject*)key, len, &start, &stop, &step, &slicelength) < 0) + return -1; + + if (slicelength <= 0) { + return 0; } - - if (keynum >= len){ - PyErr_SetString(PyExc_AttributeError, "PropertyRNA - index out of range"); - ret = -1; - } else { - ret = pyrna_py_to_prop_index(&self->ptr, self->prop, keynum, value); + else if (step == 1) { + return prop_subscript_ass_array_slice(self, start, stop, value); + } + else { + PyErr_SetString(PyExc_TypeError, "slice steps not supported with rna"); + return -1; } } - - return ret; +#endif + else { + PyErr_SetString(PyExc_AttributeError, "invalid key, key must be an int"); + return -1; + } } - static PyMappingMethods pyrna_prop_as_mapping = { ( lenfunc ) pyrna_prop_len, /* mp_length */ ( binaryfunc ) pyrna_prop_subscript, /* mp_subscript */ - ( objobjargproc ) pyrna_prop_assign_subscript, /* mp_ass_subscript */ + ( objobjargproc ) pyrna_prop_ass_subscript, /* mp_ass_subscript */ }; static int pyrna_prop_contains(BPy_PropertyRNA * self, PyObject *value) @@ -1130,7 +1269,7 @@ static int pyrna_struct_setattro( BPy_StructRNA * self, PyObject *pyname, PyObje return pyrna_py_to_prop(&self->ptr, prop, NULL, value); } -PyObject *pyrna_prop_keys(BPy_PropertyRNA *self) +static PyObject *pyrna_prop_keys(BPy_PropertyRNA *self) { PyObject *ret; if (RNA_property_type(self->prop) != PROP_COLLECTION) { @@ -1162,7 +1301,7 @@ PyObject *pyrna_prop_keys(BPy_PropertyRNA *self) return ret; } -PyObject *pyrna_prop_items(BPy_PropertyRNA *self) +static PyObject *pyrna_prop_items(BPy_PropertyRNA *self) { PyObject *ret; if (RNA_property_type(self->prop) != PROP_COLLECTION) { @@ -1203,7 +1342,7 @@ PyObject *pyrna_prop_items(BPy_PropertyRNA *self) } -PyObject *pyrna_prop_values(BPy_PropertyRNA *self) +static PyObject *pyrna_prop_values(BPy_PropertyRNA *self) { PyObject *ret; @@ -1225,6 +1364,243 @@ PyObject *pyrna_prop_values(BPy_PropertyRNA *self) return ret; } +#if (PY_VERSION_HEX >= 0x03000000) /* foreach needs py3 */ +static void foreach_attr_type( BPy_PropertyRNA *self, char *attr, + /* values to assign */ + RawPropertyType *raw_type, int *attr_tot, int *attr_signed ) +{ + PropertyRNA *prop; + *raw_type= -1; + *attr_tot= 0; + *attr_signed= 0; + + RNA_PROP_BEGIN(&self->ptr, itemptr, self->prop) { + prop = RNA_struct_find_property(&itemptr, attr); + *raw_type= RNA_property_raw_type(prop); + *attr_tot = RNA_property_array_length(prop); + *attr_signed= (RNA_property_subtype(prop)==PROP_UNSIGNED) ? 0:1; + break; + } + RNA_PROP_END; +} + +/* pyrna_prop_foreach_get/set both use this */ +static int foreach_parse_args( + BPy_PropertyRNA *self, PyObject *args, + + /*values to assign */ + char **attr, PyObject **seq, int *tot, int *size, RawPropertyType *raw_type, int *attr_tot, int *attr_signed) +{ +#if 0 + int array_tot; + int target_tot; +#endif + + *size= *raw_type= *attr_tot= *attr_signed= 0; + + if(!PyArg_ParseTuple(args, "sO", attr, seq) || (!PySequence_Check(*seq) && PyObject_CheckBuffer(*seq))) { + PyErr_SetString( PyExc_TypeError, "foreach_get(attr, sequence) expects a string and a sequence" ); + return -1; + } + + *tot= PySequence_Length(*seq); // TODO - buffer may not be a sequence! array.array() is tho. + + if(*tot>0) { + foreach_attr_type(self, *attr, raw_type, attr_tot, attr_signed); + *size= RNA_raw_type_sizeof(*raw_type); + +#if 0 // works fine but not strictly needed, we could allow RNA_property_collection_raw_* to do the checks + if((*attr_tot) < 1) + *attr_tot= 1; + + if (RNA_property_type(self->prop) == PROP_COLLECTION) + array_tot = RNA_property_collection_length(&self->ptr, self->prop); + else + array_tot = RNA_property_array_length(self->prop); + + + target_tot= array_tot * (*attr_tot); + + /* rna_access.c - rna_raw_access(...) uses this same method */ + if(target_tot != (*tot)) { + PyErr_Format( PyExc_TypeError, "foreach_get(attr, sequence) sequence length mismatch given %d, needed %d", *tot, target_tot); + return -1; + } +#endif + } + + return 0; +} + +static int foreach_compat_buffer(RawPropertyType raw_type, int attr_signed, const char *format) +{ + char f = format ? *format:'B'; /* B is assumed when not set */ + + switch(raw_type) { + case PROP_RAW_CHAR: + if (attr_signed) return (f=='b') ? 1:0; + else return (f=='B') ? 1:0; + case PROP_RAW_SHORT: + if (attr_signed) return (f=='h') ? 1:0; + else return (f=='H') ? 1:0; + case PROP_RAW_INT: + if (attr_signed) return (f=='i') ? 1:0; + else return (f=='I') ? 1:0; + case PROP_RAW_FLOAT: + return (f=='f') ? 1:0; + case PROP_RAW_DOUBLE: + return (f=='d') ? 1:0; + } + + return 0; +} + +static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set) +{ + PyObject *item; + int i=0, ok, buffer_is_compat; + void *array= NULL; + + /* get/set both take the same args currently */ + char *attr; + PyObject *seq; + int tot, size, attr_tot, attr_signed; + RawPropertyType raw_type; + + if(foreach_parse_args(self, args, &attr, &seq, &tot, &size, &raw_type, &attr_tot, &attr_signed) < 0) + return NULL; + + if(tot==0) + Py_RETURN_NONE; + + + + if(set) { /* get the array from python */ + buffer_is_compat = 0; + if(PyObject_CheckBuffer(seq)) { + Py_buffer buf; + PyObject_GetBuffer(seq, &buf, PyBUF_SIMPLE | PyBUF_FORMAT); + + /* check if the buffer matches */ + + buffer_is_compat = foreach_compat_buffer(raw_type, attr_signed, buf.format); + + if(buffer_is_compat) { + ok = RNA_property_collection_raw_set(NULL, &self->ptr, self->prop, attr, buf.buf, raw_type, tot); + } + + PyBuffer_Release(&buf); + } + + /* could not use the buffer, fallback to sequence */ + if(!buffer_is_compat) { + array= PyMem_Malloc(size * tot); + + for( ; iptr, self->prop, attr, array, raw_type, tot); + } + } + else { + buffer_is_compat = 0; + if(PyObject_CheckBuffer(seq)) { + Py_buffer buf; + PyObject_GetBuffer(seq, &buf, PyBUF_SIMPLE | PyBUF_FORMAT); + + /* check if the buffer matches, TODO - signed/unsigned types */ + + buffer_is_compat = foreach_compat_buffer(raw_type, attr_signed, buf.format); + + if(buffer_is_compat) { + ok = RNA_property_collection_raw_get(NULL, &self->ptr, self->prop, attr, buf.buf, raw_type, tot); + } + + PyBuffer_Release(&buf); + } + + /* could not use the buffer, fallback to sequence */ + if(!buffer_is_compat) { + array= PyMem_Malloc(size * tot); + + ok = RNA_property_collection_raw_get(NULL, &self->ptr, self->prop, attr, array, raw_type, tot); + + if(!ok) i= tot; /* skip the loop */ + + for( ; i= 0x03000000) */ + /* A bit of a kludge, make a list out of a collection or array, * then return the lists iter function, not especially fast but convenient for now */ PyObject *pyrna_prop_iter(BPy_PropertyRNA *self) @@ -1259,14 +1635,20 @@ PyObject *pyrna_prop_iter(BPy_PropertyRNA *self) } static struct PyMethodDef pyrna_struct_methods[] = { - {"__dir__", (PyCFunction)pyrna_struct_dir, METH_NOARGS, ""}, + {"__dir__", (PyCFunction)pyrna_struct_dir, METH_NOARGS, NULL}, {NULL, NULL, 0, NULL} }; static struct PyMethodDef pyrna_prop_methods[] = { - {"keys", (PyCFunction)pyrna_prop_keys, METH_NOARGS, ""}, - {"items", (PyCFunction)pyrna_prop_items, METH_NOARGS, ""}, - {"values", (PyCFunction)pyrna_prop_values, METH_NOARGS, ""}, + {"keys", (PyCFunction)pyrna_prop_keys, METH_NOARGS, NULL}, + {"items", (PyCFunction)pyrna_prop_items, METH_NOARGS,NULL}, + {"values", (PyCFunction)pyrna_prop_values, METH_NOARGS, NULL}, + +#if (PY_VERSION_HEX >= 0x03000000) + /* array accessor function */ + {"foreach_get", (PyCFunction)pyrna_prop_foreach_get, METH_VARARGS, NULL}, + {"foreach_set", (PyCFunction)pyrna_prop_foreach_set, METH_VARARGS, NULL}, +#endif {NULL, NULL, 0, NULL} }; diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 92b71e9fff0..ffeb342df77 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -79,7 +79,7 @@ void WM_keymap_tweak (ListBase *lb, short type, short val, int modifier, short ListBase *WM_keymap_listbase (struct wmWindowManager *wm, const char *nameid, int spaceid, int regionid); -char *WM_key_event_string(short type); +const char *WM_key_event_string(short type); char *WM_key_event_operator_string(const struct bContext *C, const char *opname, int opcontext, struct IDProperty *properties, char *str, int len); /* handlers */ diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 9b987cdfa51..e3a7a906fef 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -128,6 +128,7 @@ typedef struct wmNotifier { #define NC_BRUSH (11<<24) #define NC_TEXT (12<<24) #define NC_WORLD (13<<24) +#define NC_FILE (14<<24) /* data type, 256 entries is enough, it can overlap */ #define NOTE_DATA 0x00FF0000 @@ -182,6 +183,10 @@ typedef struct wmNotifier { /* NC_TEXT Text */ #define ND_CURSOR (50<<16) #define ND_DISPLAY (51<<16) + + /* NC_FILE Filebrowser */ +#define ND_PARAMS (60<<16) +#define ND_FILELIST (61<<16) /* subtype, 256 entries too */ #define NOTE_SUBTYPE 0x0000FF00 diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 286d1216f66..e520067b9e5 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -733,17 +733,20 @@ static int wm_handler_ui_call(bContext *C, wmEventHandler *handler, wmEvent *eve ScrArea *area= CTX_wm_area(C); ARegion *region= CTX_wm_region(C); ARegion *menu= CTX_wm_menu(C); - int retval; + int retval, always_pass; /* we set context to where ui handler came from */ if(handler->ui_area) CTX_wm_area_set(C, handler->ui_area); if(handler->ui_region) CTX_wm_region_set(C, handler->ui_region); if(handler->ui_menu) CTX_wm_menu_set(C, handler->ui_menu); + /* in advance to avoid access to freed event on window close */ + always_pass= wm_event_always_pass(event); + retval= handler->ui_handle(C, event, handler->ui_userdata); /* putting back screen context */ - if((retval != WM_UI_HANDLER_BREAK) || wm_event_always_pass(event)) { + if((retval != WM_UI_HANDLER_BREAK) || always_pass) { CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); CTX_wm_menu_set(C, menu); @@ -776,7 +779,7 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa case EVT_FILESELECT_OPEN: case EVT_FILESELECT_FULL_OPEN: { - short flag =0; short display =FILE_SHORTDISPLAY; short filter =0; short sort =FILE_SORTALPHA; + short flag =0; short display =FILE_SHORTDISPLAY; short filter =0; short sort =FILE_SORT_ALPHA; char *path= RNA_string_get_alloc(handler->op->ptr, "filename", NULL, 0); if(event->val==EVT_FILESELECT_OPEN) @@ -872,6 +875,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) { wmEventHandler *handler, *nexthandler; int action= WM_HANDLER_CONTINUE; + int always_pass; if(handlers==NULL) return action; @@ -881,6 +885,8 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) /* optional boundbox */ if(handler_boundbox_test(handler, event)) { + /* in advance to avoid access to freed event on window close */ + always_pass= wm_event_always_pass(event); /* modal+blocking handler */ if(handler->flag & WM_HANDLER_BLOCKING) @@ -912,7 +918,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) action= wm_handler_operator_call(C, handlers, handler, event, NULL); } - if(!wm_event_always_pass(event) && action==WM_HANDLER_BREAK) + if(!always_pass && action==WM_HANDLER_BREAK) break; } diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 861080f30ba..29ec58befd9 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -575,7 +575,7 @@ void WM_write_file(bContext *C, char *target, ReportList *reports) // } if (G.fileflags & G_AUTOPACK) { - packAll(); + packAll(G.main, reports); } ED_object_exit_editmode(C, 0); diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 85028e3ea1a..b914e63788d 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -154,7 +154,7 @@ ListBase *WM_keymap_listbase(wmWindowManager *wm, const char *nameid, int spacei /* ***************** get string from key events **************** */ -char *WM_key_event_string(short type) +const char *WM_key_event_string(short type) { const char *name= NULL; if(RNA_enum_name(event_type_items, (int)type, &name)) diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 410cd11f1bf..7f9a2153dc3 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -418,7 +418,7 @@ static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *arg_op) uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_RET_1); but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 10, 180, 19, ""); - uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb); + uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb, NULL); /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxhHeight(), 180, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index ade5a2a64a8..cd0d551211f 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -151,7 +151,7 @@ IF(WIN32) COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\ui\\*.*\" \"${TARGETDIR}\\.blender\\ui\" COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\plugins\\*.*\" \"${TARGETDIR}\\plugins\" COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\text\\*.*\" \"${TARGETDIR}\" - COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\windows\\extra\\python25.zip\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\windows\\extra\\python26.zip\" \"${TARGETDIR}\\\" ) FILE(TO_NATIVE_PATH "${LIBDIR}" WIN_LIBDIR) @@ -164,7 +164,8 @@ IF(WIN32) COMMAND copy /Y \"${WIN_LIBDIR}\\sdl\\lib\\SDL.dll\" \"${TARGETDIR}\\\" COMMAND copy /Y \"${WIN_LIBDIR}\\zlib\\lib\\zlib.dll\" \"${TARGETDIR}\\\" COMMAND copy /Y \"${WIN_LIBDIR}\\tiff\\lib\\libtiff.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python25.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python26.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python26_d.dll\" \"${TARGETDIR}\\\" COMMAND copy /Y \"${WIN_LIBDIR}\\pthreads\\lib\\pthreadVC2.dll\" \"${TARGETDIR}\\\" ) diff --git a/source/gameengine/BlenderRoutines/Makefile b/source/gameengine/BlenderRoutines/Makefile index 549e466c4e0..ffa99a0c1b2 100644 --- a/source/gameengine/BlenderRoutines/Makefile +++ b/source/gameengine/BlenderRoutines/Makefile @@ -54,6 +54,7 @@ CPPFLAGS += -I../../blender/render/extern/include CPPFLAGS += -I../../blender/blenloader CPPFLAGS += -I../../blender/blenfont CPPFLAGS += -I../../blender/gpu +CPPFLAGS += -I../../blender/makesrna CPPFLAGS += -I../Converter CPPFLAGS += -I../Expressions CPPFLAGS += -I../GameLogic diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index ce4311f57bf..bed99a4f502 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -446,7 +446,7 @@ PyObject* BL_ActionActuator::PyGetAction(PyObject* args, ShowDeprecationWarning("getAction()", "the action property"); if (m_action){ - return PyString_FromString(m_action->id.name+2); + return PyUnicode_FromString(m_action->id.name+2); } Py_RETURN_NONE; } @@ -796,7 +796,7 @@ PyObject* BL_ActionActuator::PySetFrameProperty(PyObject* args, } PyObject* BL_ActionActuator::PyGetChannel(PyObject* value) { - char *string= PyString_AsString(value); + char *string= _PyUnicode_AsString(value); if (!string) { PyErr_SetString(PyExc_TypeError, "expected a single string"); @@ -888,7 +888,7 @@ PyObject* BL_ActionActuator::PySetType(PyObject* args, PyObject* BL_ActionActuator::PyGetContinue() { ShowDeprecationWarning("getContinue()", "the continue property"); - return PyInt_FromLong((long)(m_end_reset==0)); + return PyLong_FromSsize_t((long)(m_end_reset==0)); } PyObject* BL_ActionActuator::PySetContinue(PyObject* value) { @@ -1005,19 +1005,15 @@ PyTypeObject BL_ActionActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject BL_ActionActuator::Parents[] = { - &BL_ActionActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef BL_ActionActuator::Methods[] = { @@ -1065,37 +1061,24 @@ PyAttributeDef BL_ActionActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* BL_ActionActuator::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IActuator); -} - -PyObject* BL_ActionActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int BL_ActionActuator::py_setattro(PyObject *attr, PyObject* value) { - py_setattro_up(SCA_IActuator); -} - - PyObject* BL_ActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { BL_ActionActuator* self= static_cast(self_v); - return PyString_FromString(self->GetAction() ? self->GetAction()->id.name+2 : ""); + return PyUnicode_FromString(self->GetAction() ? self->GetAction()->id.name+2 : ""); } int BL_ActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { BL_ActionActuator* self= static_cast(self_v); - if (!PyString_Check(value)) + if (!PyUnicode_Check(value)) { PyErr_SetString(PyExc_ValueError, "actuator.action = val: Action Actuator, expected the string name of the action"); return PY_SET_ATTR_FAIL; } bAction *action= NULL; - STR_String val = PyString_AsString(value); + STR_String val = _PyUnicode_AsString(value); if (val != "") { diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h index 422b16bb3ec..e328ce126ca 100644 --- a/source/gameengine/Converter/BL_ActionActuator.h +++ b/source/gameengine/Converter/BL_ActionActuator.h @@ -49,9 +49,8 @@ public: short blendin, short priority, short end_reset, - float stride, - PyTypeObject* T=&Type) - : SCA_IActuator(gameobj,T), + float stride) + : SCA_IActuator(gameobj), m_lastpos(0, 0, 0), m_blendframe(0), @@ -113,10 +112,6 @@ public: KX_PYMETHOD_DOC(BL_ActionActuator,setChannel); - virtual PyObject* py_getattro(PyObject* attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject* attr, PyObject* value); - static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index 7aa8714de3a..970539777f4 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -427,21 +427,18 @@ PyTypeObject BL_ShapeActionActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject BL_ShapeActionActuator::Parents[] = { - &BL_ShapeActionActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; + PyMethodDef BL_ShapeActionActuator::Methods[] = { {"setAction", (PyCFunction) BL_ShapeActionActuator::sPySetAction, METH_VARARGS, (PY_METHODCHAR)SetAction_doc}, {"setStart", (PyCFunction) BL_ShapeActionActuator::sPySetStart, METH_VARARGS, (PY_METHODCHAR)SetStart_doc}, @@ -480,19 +477,6 @@ PyAttributeDef BL_ShapeActionActuator::Attributes[] = { { NULL } //Sentinel }; - -PyObject* BL_ShapeActionActuator::py_getattro(PyObject* attr) { - py_getattro_up(SCA_IActuator); -} - -PyObject* BL_ShapeActionActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int BL_ShapeActionActuator::py_setattro(PyObject *attr, PyObject* value) { - py_setattro_up(SCA_IActuator); -} - /* setStart */ const char BL_ShapeActionActuator::GetAction_doc[] = "getAction()\n" @@ -501,7 +485,7 @@ const char BL_ShapeActionActuator::GetAction_doc[] = PyObject* BL_ShapeActionActuator::PyGetAction() { ShowDeprecationWarning("getAction()", "the action property"); if (m_action){ - return PyString_FromString(m_action->id.name+2); + return PyUnicode_FromString(m_action->id.name+2); } Py_RETURN_NONE; } @@ -860,21 +844,21 @@ PyObject* BL_ShapeActionActuator::PySetType(PyObject* args) { PyObject* BL_ShapeActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { BL_ShapeActionActuator* self= static_cast(self_v); - return PyString_FromString(self->GetAction() ? self->GetAction()->id.name+2 : ""); + return PyUnicode_FromString(self->GetAction() ? self->GetAction()->id.name+2 : ""); } int BL_ShapeActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { BL_ShapeActionActuator* self= static_cast(self_v); /* exact copy of BL_ActionActuator's function from here down */ - if (!PyString_Check(value)) + if (!PyUnicode_Check(value)) { PyErr_SetString(PyExc_ValueError, "actuator.action = val: Shape Action Actuator, expected the string name of the action"); return PY_SET_ATTR_FAIL; } bAction *action= NULL; - STR_String val = PyString_AsString(value); + STR_String val = _PyUnicode_AsString(value); if (val != "") { diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.h b/source/gameengine/Converter/BL_ShapeActionActuator.h index d268eef6d23..890fe3f9de9 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.h +++ b/source/gameengine/Converter/BL_ShapeActionActuator.h @@ -50,9 +50,8 @@ public: short playtype, short blendin, short priority, - float stride, - PyTypeObject* T=&Type) - : SCA_IActuator(gameobj,T), + float stride) + : SCA_IActuator(gameobj), m_lastpos(0, 0, 0), m_blendframe(0), @@ -106,10 +105,6 @@ public: KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetType); KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetType); - virtual PyObject* py_getattro(PyObject* attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject* attr, PyObject* value); - static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Expressions/BoolValue.cpp b/source/gameengine/Expressions/BoolValue.cpp index d90da8b3a92..6779c2ea780 100644 --- a/source/gameengine/Expressions/BoolValue.cpp +++ b/source/gameengine/Expressions/BoolValue.cpp @@ -29,7 +29,6 @@ const STR_String CBoolValue::sTrueString = "TRUE"; const STR_String CBoolValue::sFalseString = "FALSE"; - CBoolValue::CBoolValue() /* pre: false @@ -210,5 +209,5 @@ CValue* CBoolValue::GetReplica() PyObject* CBoolValue::ConvertValueToPython() { - return PyInt_FromLong(m_bool != 0); + return PyBool_FromLong(m_bool != 0); } diff --git a/source/gameengine/Expressions/IntValue.cpp b/source/gameengine/Expressions/IntValue.cpp index 227518e9439..b782de4bef6 100644 --- a/source/gameengine/Expressions/IntValue.cpp +++ b/source/gameengine/Expressions/IntValue.cpp @@ -330,7 +330,7 @@ void CIntValue::SetValue(CValue* newval) PyObject* CIntValue::ConvertValueToPython() { if((m_int > INT_MIN) && (m_int < INT_MAX)) - return PyInt_FromLong(m_int); + return PyLong_FromSsize_t(m_int); else return PyLong_FromLongLong(m_int); } diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 59344ddb7b7..38b00dcc8fb 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -76,9 +76,9 @@ PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex) return NULL; } - if (PyString_Check(pyindex)) + if (PyUnicode_Check(pyindex)) { - CValue *item = ((CListValue*) list)->FindValue(PyString_AsString(pyindex)); + CValue *item = ((CListValue*) list)->FindValue(_PyUnicode_AsString(pyindex)); if (item) { PyObject* pyobj = item->ConvertValueToPython(); if(pyobj) @@ -87,14 +87,14 @@ PyObject* listvalue_mapping_subscript(PyObject* self, PyObject* pyindex) return item->GetProxy(); } } - else if (PyInt_Check(pyindex)) + else if (PyLong_Check(pyindex)) { - int index = PyInt_AsLong(pyindex); + int index = PyLong_AsSsize_t(pyindex); return listvalue_buffer_item(self, index); /* wont add a ref */ } PyObject *pyindex_str = PyObject_Repr(pyindex); /* new ref */ - PyErr_Format(PyExc_KeyError, "CList[key]: '%s' key not in list", PyString_AsString(pyindex_str)); + PyErr_Format(PyExc_KeyError, "CList[key]: '%s' key not in list", _PyUnicode_AsString(pyindex_str)); Py_DECREF(pyindex_str); return NULL; } @@ -220,12 +220,12 @@ static int listvalue_buffer_contains(PyObject *self_v, PyObject *value) return -1; } - if (PyString_Check(value)) { - if (self->FindValue((const char *)PyString_AsString(value))) { + if (PyUnicode_Check(value)) { + if (self->FindValue((const char *)_PyUnicode_AsString(value))) { return 1; } } - else if (BGE_PROXY_CHECK_TYPE(value)) { /* not dict like at all but this worked before __contains__ was used */ + else if (PyObject_TypeCheck(value, &CValue::Type)) { /* not dict like at all but this worked before __contains__ was used */ CValue *item= static_cast(BGE_PROXY_REF(value)); for (int i=0; i < self->GetCount(); i++) if (self->GetValue(i) == item) // Com @@ -289,25 +289,19 @@ PyTypeObject CListValue::Type = { 0, /*tp_hash*/ 0, /*tp_call */ 0, - py_base_getattro, - py_base_setattro, + NULL, + NULL, 0, - Py_TPFLAGS_DEFAULT, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject CListValue::Parents[] = { - &CListValue::Type, + Methods, + 0, + 0, &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; - - - PyMethodDef CListValue::Methods[] = { /* List style access */ {"append", (PyCFunction)CListValue::sPyappend,METH_O}, @@ -329,21 +323,12 @@ PyAttributeDef CListValue::Attributes[] = { { NULL } //Sentinel }; -PyObject* CListValue::py_getattro(PyObject* attr) { - py_getattro_up(CValue); -} - -PyObject* CListValue::py_getattro_dict() { - py_getattro_dict_up(CValue); -} - - ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// -CListValue::CListValue(PyTypeObject *T ) -: CPropValue(T) +CListValue::CListValue() +: CPropValue() { m_bReleaseContents=true; } @@ -559,7 +544,7 @@ PyObject* CListValue::Pyindex(PyObject *value) CValue* elem = GetValue(i); if (checkobj==elem || CheckEqual(checkobj,elem)) { - result = PyInt_FromLong(i); + result = PyLong_FromSsize_t(i); break; } } @@ -582,7 +567,7 @@ PyObject* CListValue::Pycount(PyObject* value) if (checkobj==NULL) { /* in this case just return that there are no items in the list */ PyErr_Clear(); - return PyInt_FromLong(0); + return PyLong_FromSsize_t(0); } int numelem = GetCount(); @@ -596,7 +581,7 @@ PyObject* CListValue::Pycount(PyObject* value) } checkobj->Release(); - return PyInt_FromLong(numfound); + return PyLong_FromSsize_t(numfound); } /* Matches python dict.get(key, [default]) */ @@ -623,7 +608,7 @@ PyObject* CListValue::Pyget(PyObject *args) /* Matches python dict.has_key() */ PyObject* CListValue::Pyhas_key(PyObject* value) { - if (PyString_Check(value) && FindValue((const char *)PyString_AsString(value))) + if (PyUnicode_Check(value) && FindValue((const char *)_PyUnicode_AsString(value))) Py_RETURN_TRUE; Py_RETURN_FALSE; diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h index 68e900e25e0..98e6f216f11 100644 --- a/source/gameengine/Expressions/ListValue.h +++ b/source/gameengine/Expressions/ListValue.h @@ -24,7 +24,7 @@ class CListValue : public CPropValue //PLUGIN_DECLARE_SERIAL (CListValue,CValue) public: - CListValue(PyTypeObject *T = &Type); + CListValue(); virtual ~CListValue(); void AddConfigurationData(CValue* menuvalue); @@ -60,8 +60,6 @@ public: bool CheckEqual(CValue* first,CValue* second); - virtual PyObject* py_getattro(PyObject* attr); - virtual PyObject* py_getattro_dict(); virtual PyObject* py_repr(void) { PyObject *py_proxy= this->GetProxy(); PyObject *py_list= PySequence_List(py_proxy); diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 2d4cc612aef..729fff31052 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -74,11 +74,13 @@ PyTypeObject PyObjectPlus::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + NULL // no subtype }; @@ -91,6 +93,88 @@ PyObjectPlus::~PyObjectPlus() // assert(ob_refcnt==0); } + +PyObject *PyObjectPlus::py_base_repr(PyObject *self) // This should be the entry in Type. +{ + PyObjectPlus *self_plus= BGE_PROXY_REF(self); + if(self_plus==NULL) { + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + return NULL; + } + + return self_plus->py_repr(); +} + + +PyObject * PyObjectPlus::py_base_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + PyTypeObject *base_type; + PyObjectPlus_Proxy *base = NULL; + + if (!PyArg_ParseTuple(args, "O:Base PyObjectPlus", &base)) + return NULL; + + /* the 'base' PyObject may be subclassed (multiple times even) + * we need to find the first C++ defined class to check 'type' + * is a subclass of the base arguments type. + * + * This way we can share one tp_new function for every PyObjectPlus + * + * eg. + * + * # CustomOb is called 'type' in this C code + * class CustomOb(GameTypes.KX_GameObject): + * pass + * + * # this calls py_base_new(...), the type of 'CustomOb' is checked to be a subclass of the 'cont.owner' type + * ob = CustomOb(cont.owner) + * + * */ + base_type= Py_TYPE(base); + while(base_type && !BGE_PROXY_CHECK_TYPE(base_type)) + base_type= base_type->tp_base; + + if(base_type==NULL || !BGE_PROXY_CHECK_TYPE(base_type)) { + PyErr_SetString(PyExc_TypeError, "can't subclass from a blender game type because the argument given is not a game class or subclass"); + return NULL; + } + + /* use base_type rather then Py_TYPE(base) because we could alredy be subtyped */ + if(!PyType_IsSubtype(type, base_type)) { + PyErr_Format(PyExc_TypeError, "can't subclass blender game type <%s> from <%s> because it is not a subclass", base_type->tp_name, type->tp_name); + return NULL; + } + + /* invalidate the existing base and return a new subclassed one, + * this is a bit dodgy in that it also attaches its self to the existing object + * which is not really 'correct' python OO but for our use its OK. */ + + PyObjectPlus_Proxy *ret = (PyObjectPlus_Proxy *) type->tp_alloc(type, 0); /* starts with 1 ref, used for the return ref' */ + ret->ref= base->ref; + base->ref= NULL; /* invalidate! disallow further access */ + + ret->py_owns= base->py_owns; + + ret->ref->m_proxy= NULL; + + /* 'base' may be free'd after this func finished but not necessarily + * there is no reference to the BGE data now so it will throw an error on access */ + Py_DECREF(base); + + ret->ref->m_proxy= (PyObject *)ret; /* no need to add a ref because one is added when creating. */ + Py_INCREF(ret); /* we return a new ref but m_proxy holds a ref so we need to add one */ + + + /* 'ret' will have 2 references. + * - One ref is needed because ret->ref->m_proxy holds a refcount to the current proxy. + * - Another is needed for returning the value. + * + * So we should be ok with 2 refs, but for some reason this crashes. so adding a new ref... + * */ + + return (PyObject *)ret; +} + void PyObjectPlus::py_base_dealloc(PyObject *self) // python wrapper { PyObjectPlus *self_plus= BGE_PROXY_REF(self); @@ -99,143 +183,56 @@ void PyObjectPlus::py_base_dealloc(PyObject *self) // python wrapper self_plus->m_proxy = NULL; /* Need this to stop ~PyObjectPlus from decrefing m_proxy otherwise its decref'd twice and py-debug crashes */ delete self_plus; } - + BGE_PROXY_REF(self)= NULL; // not really needed } + +#if 0 + /* is ok normally but not for subtyping, use tp_free instead. */ PyObject_DEL( self ); +#else + Py_TYPE(self)->tp_free(self); +#endif }; -PyObjectPlus::PyObjectPlus(PyTypeObject *T) : SG_QList() // constructor +PyObjectPlus::PyObjectPlus() : SG_QList() // constructor { - MT_assert(T != NULL); m_proxy= NULL; }; - + /*------------------------------ * PyObjectPlus Methods -- Every class, even the abstract one should have a Methods ------------------------------*/ PyMethodDef PyObjectPlus::Methods[] = { - {"isA", (PyCFunction) sPyisA, METH_O}, {NULL, NULL} /* Sentinel */ }; +#define attr_invalid (&(PyObjectPlus::Attributes[0])) PyAttributeDef PyObjectPlus::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("invalid", PyObjectPlus, pyattr_get_invalid), {NULL} //Sentinel }; -PyObject* PyObjectPlus::pyattr_get_invalid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) -{ - Py_RETURN_FALSE; -} - -/*------------------------------ - * PyObjectPlus Parents -- Every class, even the abstract one should have parents -------------------------------*/ -PyParentObject PyObjectPlus::Parents[] = {&PyObjectPlus::Type, NULL}; - -/*------------------------------ - * PyObjectPlus attributes -- attributes -------------------------------*/ -/* This should be the entry in Type since it takes the C++ class from PyObjectPlus_Proxy */ -PyObject *PyObjectPlus::py_base_getattro(PyObject * self, PyObject *attr) +PyObject* PyObjectPlus::pyattr_get_invalid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - PyObjectPlus *self_plus= BGE_PROXY_REF(self); - if(self_plus==NULL) { - if(!strcmp("invalid", PyString_AsString(attr))) { - Py_RETURN_TRUE; - } - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); - return NULL; - } - - PyObject *ret= self_plus->py_getattro(attr); - - /* Attribute not found, was this a __dict__ lookup?, otherwise set an error if none is set */ - if(ret==NULL) { - char *attr_str= PyString_AsString(attr); - - if (strcmp(attr_str, "__dict__")==0) - { - /* the error string will probably not - * be set but just incase clear it */ - PyErr_Clear(); - ret= self_plus->py_getattro_dict(); - } - else if (!PyErr_Occurred()) { - /* We looked for an attribute but it wasnt found - * since py_getattro didnt set the error, set it here */ - PyErr_Format(PyExc_AttributeError, "'%s' object has no attribute '%s'", self->ob_type->tp_name, attr_str); - } - } - return ret; + return PyBool_FromLong(self_v ? 1:0); } -/* This should be the entry in Type since it takes the C++ class from PyObjectPlus_Proxy */ -int PyObjectPlus::py_base_setattro(PyObject *self, PyObject *attr, PyObject *value) +/* note, this is called as a python 'getset, where the PyAttributeDef is the closure */ +PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef *attrdef) { - PyObjectPlus *self_plus= BGE_PROXY_REF(self); - if(self_plus==NULL) { - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); - return -1; - } - - if (value==NULL) - return self_plus->py_delattro(attr); - - return self_plus->py_setattro(attr, value); -} + void *self= (void *)(BGE_PROXY_REF(self_py)); + if(self==NULL) { + if(attrdef == attr_invalid) + Py_RETURN_TRUE; // dont bother running the function -PyObject *PyObjectPlus::py_base_repr(PyObject *self) // This should be the entry in Type. -{ - - PyObjectPlus *self_plus= BGE_PROXY_REF(self); - if(self_plus==NULL) { PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); return NULL; } - - return self_plus->py_repr(); -} -PyObject *PyObjectPlus::py_getattro(PyObject* attr) -{ - PyObject *descr = PyDict_GetItem(Type.tp_dict, attr); \ - if (descr == NULL) { - return NULL; /* py_base_getattro sets the error, this way we can avoid setting the error at many levels */ - } else { - /* Copied from py_getattro_up */ - if (PyCObject_Check(descr)) { - return py_get_attrdef((void *)this, (const PyAttributeDef*)PyCObject_AsVoidPtr(descr)); - } else if (descr->ob_type->tp_descr_get) { - return PyCFunction_New(((PyMethodDescrObject *)descr)->d_method, this->m_proxy); - } else { - return NULL; - } - /* end py_getattro_up copy */ - } -} -PyObject* PyObjectPlus::py_getattro_dict() { - return py_getattr_dict(NULL, Type.tp_dict); -} - -int PyObjectPlus::py_delattro(PyObject* attr) -{ - PyErr_SetString(PyExc_AttributeError, "attribute cant be deleted"); - return 1; -} - -int PyObjectPlus::py_setattro(PyObject *attr, PyObject* value) -{ - PyErr_SetString(PyExc_AttributeError, "attribute cant be set"); - return PY_SET_ATTR_MISSING; -} - -PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef) -{ if (attrdef->m_type == KX_PYATTRIBUTE_TYPE_DUMMY) { // fake attribute, ignore @@ -259,14 +256,14 @@ PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef { bool *val = reinterpret_cast(ptr); ptr += sizeof(bool); - PyList_SET_ITEM(resultlist,i,PyInt_FromLong(*val)); + PyList_SET_ITEM(resultlist,i,PyLong_FromSsize_t(*val)); break; } case KX_PYATTRIBUTE_TYPE_SHORT: { short int *val = reinterpret_cast(ptr); ptr += sizeof(short int); - PyList_SET_ITEM(resultlist,i,PyInt_FromLong(*val)); + PyList_SET_ITEM(resultlist,i,PyLong_FromSsize_t(*val)); break; } case KX_PYATTRIBUTE_TYPE_ENUM: @@ -281,7 +278,7 @@ PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef { int *val = reinterpret_cast(ptr); ptr += sizeof(int); - PyList_SET_ITEM(resultlist,i,PyInt_FromLong(*val)); + PyList_SET_ITEM(resultlist,i,PyLong_FromSsize_t(*val)); break; } case KX_PYATTRIBUTE_TYPE_FLOAT: @@ -305,12 +302,12 @@ PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef case KX_PYATTRIBUTE_TYPE_BOOL: { bool *val = reinterpret_cast(ptr); - return PyInt_FromLong(*val); + return PyLong_FromSsize_t(*val); } case KX_PYATTRIBUTE_TYPE_SHORT: { short int *val = reinterpret_cast(ptr); - return PyInt_FromLong(*val); + return PyLong_FromSsize_t(*val); } case KX_PYATTRIBUTE_TYPE_ENUM: // enum are like int, just make sure the field size is the same @@ -322,7 +319,7 @@ PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef case KX_PYATTRIBUTE_TYPE_INT: { int *val = reinterpret_cast(ptr); - return PyInt_FromLong(*val); + return PyLong_FromSsize_t(*val); } case KX_PYATTRIBUTE_TYPE_FLOAT: { @@ -334,7 +331,7 @@ PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef MT_Vector3 *val = reinterpret_cast(ptr); #ifdef USE_MATHUTILS float fval[3]= {(*val)[0], (*val)[1], (*val)[2]}; - return newVectorObject(fval, 3, Py_NEW); + return newVectorObject(fval, 3, Py_NEW, NULL); #else PyObject* resultlist = PyList_New(3); for (unsigned int i=0; i<3; i++) @@ -347,7 +344,7 @@ PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef case KX_PYATTRIBUTE_TYPE_STRING: { STR_String *val = reinterpret_cast(ptr); - return PyString_FromString(*val); + return PyUnicode_FromString(*val); } default: return NULL; @@ -355,8 +352,15 @@ PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef } } -int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyObject *value) +/* note, this is called as a python getset */ +int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAttributeDef *attrdef) { + void *self= (void *)(BGE_PROXY_REF(self_py)); + if(self==NULL) { + PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + return PY_SET_ATTR_FAIL; + } + void *undoBuffer = NULL; void *sourceBuffer = NULL; size_t bufferSize = 0; @@ -421,9 +425,9 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb { bool *var = reinterpret_cast(ptr); ptr += sizeof(bool); - if (PyInt_Check(item)) + if (PyLong_Check(item)) { - *var = (PyInt_AsLong(item) != 0); + *var = (PyLong_AsSsize_t(item) != 0); } else if (PyBool_Check(item)) { @@ -440,9 +444,9 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb { short int *var = reinterpret_cast(ptr); ptr += sizeof(short int); - if (PyInt_Check(item)) + if (PyLong_Check(item)) { - long val = PyInt_AsLong(item); + long val = PyLong_AsSsize_t(item); if (attrdef->m_clamp) { if (val < attrdef->m_imin) @@ -476,9 +480,9 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb { int *var = reinterpret_cast(ptr); ptr += sizeof(int); - if (PyInt_Check(item)) + if (PyLong_Check(item)) { - long val = PyInt_AsLong(item); + long val = PyLong_AsSsize_t(item); if (attrdef->m_clamp) { if (val < attrdef->m_imin) @@ -611,9 +615,9 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb case KX_PYATTRIBUTE_TYPE_BOOL: { bool *var = reinterpret_cast(ptr); - if (PyInt_Check(value)) + if (PyLong_Check(value)) { - *var = (PyInt_AsLong(value) != 0); + *var = (PyLong_AsSsize_t(value) != 0); } else if (PyBool_Check(value)) { @@ -629,9 +633,9 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb case KX_PYATTRIBUTE_TYPE_SHORT: { short int *var = reinterpret_cast(ptr); - if (PyInt_Check(value)) + if (PyLong_Check(value)) { - long val = PyInt_AsLong(value); + long val = PyLong_AsSsize_t(value); if (attrdef->m_clamp) { if (val < attrdef->m_imin) @@ -664,9 +668,9 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb case KX_PYATTRIBUTE_TYPE_INT: { int *var = reinterpret_cast(ptr); - if (PyInt_Check(value)) + if (PyLong_Check(value)) { - long val = PyInt_AsLong(value); + long val = PyLong_AsSsize_t(value); if (attrdef->m_clamp) { if (val < attrdef->m_imin) @@ -751,9 +755,9 @@ int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyOb case KX_PYATTRIBUTE_TYPE_STRING: { STR_String *var = reinterpret_cast(ptr); - if (PyString_Check(value)) + if (PyUnicode_Check(value)) { - char *val = PyString_AsString(value); + char *val = _PyUnicode_AsString(value); if (attrdef->m_clamp) { if (strlen(val) < attrdef->m_imin) @@ -834,48 +838,6 @@ PyObject *PyObjectPlus::py_repr(void) return NULL; } -/*------------------------------ - * PyObjectPlus isA -- the isA functions -------------------------------*/ -bool PyObjectPlus::isA(PyTypeObject *T) // if called with a Type, use "typename" -{ - int i; - PyParentObject P; - PyParentObject *Ps = GetParents(); - - for (P = Ps[i=0]; P != NULL; P = Ps[i++]) - if (P==T) - return true; - - return false; -} - - -bool PyObjectPlus::isA(const char *mytypename) // check typename of each parent -{ - int i; - PyParentObject P; - PyParentObject *Ps = GetParents(); - - for (P = Ps[i=0]; P != NULL; P = Ps[i++]) - if (strcmp(P->tp_name, mytypename)==0) - return true; - - return false; -} - -PyObject *PyObjectPlus::PyisA(PyObject *value) // Python wrapper for isA -{ - if (PyType_Check(value)) { - return PyBool_FromLong(isA((PyTypeObject *)value)); - } else if (PyString_Check(value)) { - return PyBool_FromLong(isA(PyString_AsString(value))); - } - PyErr_SetString(PyExc_TypeError, "object.isA(value): expected a type or a string"); - return NULL; -} - - void PyObjectPlus::ProcessReplica() { /* Clear the proxy, will be created again if needed with GetProxy() @@ -900,27 +862,6 @@ void PyObjectPlus::InvalidateProxy() // check typename of each parent } } -/* Utility function called by the macro py_getattro_up() - * for getting ob.__dict__() values from our PyObject - * this is used by python for doing dir() on an object, so its good - * if we return a list of attributes and methods. - * - * Other then making dir() useful the value returned from __dict__() is not useful - * since every value is a Py_None - * */ -PyObject *py_getattr_dict(PyObject *pydict, PyObject *tp_dict) -{ - if(pydict==NULL) { /* incase calling __dict__ on the parent of this object raised an error */ - PyErr_Clear(); - pydict = PyDict_New(); - } - - PyDict_Update(pydict, tp_dict); - return pydict; -} - - - PyObject *PyObjectPlus::GetProxy_Ext(PyObjectPlus *self, PyTypeObject *tp) { if (self->m_proxy==NULL) @@ -991,7 +932,7 @@ void PyObjectPlus::ShowDeprecationWarning_func(const char* old_way,const char* n co_filename= PyObject_GetAttrString(f_code, "co_filename"); if (co_filename) { - printf("\t%s:%d\n", PyString_AsString(co_filename), (int)PyInt_AsLong(f_lineno)); + printf("\t%s:%d\n", _PyUnicode_AsString(co_filename), (int)PyLong_AsSsize_t(f_lineno)); Py_DECREF(f_lineno); Py_DECREF(f_code); diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 3b5eebe9893..a18df9d36a9 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -51,19 +51,9 @@ extern "C" { } #endif -#if PY_VERSION_HEX > 0x03000000 -#define PyString_FromString PyUnicode_FromString -#define PyString_FromFormat PyUnicode_FromFormat -#define PyString_Check PyUnicode_Check -#define PyString_Size PyUnicode_GetSize - -#define PyInt_FromLong PyLong_FromSsize_t -#define PyInt_AsLong PyLong_AsSsize_t -#define PyString_AsString _PyUnicode_AsString -#define PyInt_Check PyLong_Check -#define PyInt_AS_LONG PyLong_AsLong // TODO - check this one -#endif - +extern "C" { +#include "../../blender/python/intern/bpy_compat.h" +} /* @@ -145,7 +135,7 @@ typedef struct { #define BGE_PROXY_PYOWNS(_self) (((PyObjectPlus_Proxy *)_self)->py_owns) /* Note, sometimes we dont care what BGE type this is as long as its a proxy */ -#define BGE_PROXY_CHECK_TYPE(_self) ((_self)->ob_type->tp_dealloc == PyObjectPlus::py_base_dealloc) +#define BGE_PROXY_CHECK_TYPE(_type) ((_type)->tp_dealloc == PyObjectPlus::py_base_dealloc) // This must be the first line of each @@ -155,41 +145,10 @@ typedef struct { static PyTypeObject Type; \ static PyMethodDef Methods[]; \ static PyAttributeDef Attributes[]; \ - static PyParentObject Parents[]; \ virtual PyTypeObject *GetType(void) {return &Type;}; \ - virtual PyParentObject *GetParents(void) {return Parents;} \ virtual PyObject *GetProxy() {return GetProxy_Ext(this, &Type);}; \ virtual PyObject *NewProxy(bool py_owns) {return NewProxy_Ext(this, &Type, py_owns);}; \ - - - - // This defines the py_getattro_up macro - // which allows attribute and method calls - // to be properly passed up the hierarchy. - // - // Note, PyDict_GetItem() WONT set an exception! - // let the py_base_getattro function do this. - -#define py_getattro_up(Parent) \ - \ - PyObject *descr = PyDict_GetItem(Type.tp_dict, attr); \ - \ - if(descr) { \ - if (PyCObject_Check(descr)) { \ - return py_get_attrdef((void *)this, (const PyAttributeDef*)PyCObject_AsVoidPtr(descr)); \ - } else if (descr->ob_type->tp_descr_get) { \ - return PyCFunction_New(((PyMethodDescrObject *)descr)->d_method, this->m_proxy); \ - } else { \ - return NULL; \ - } \ - } else { \ - return Parent::py_getattro(attr); \ - } - -#define py_getattro_dict_up(Parent) \ - return py_getattr_dict(Parent::py_getattro_dict(), Type.tp_dict); - /* * nonzero values are an error for setattr * however because of the nested lookups we need to know if the errors @@ -201,29 +160,6 @@ typedef struct { #define PY_SET_ATTR_MISSING -1 #define PY_SET_ATTR_SUCCESS 0 -#define py_setattro_up(Parent) \ - PyObject *descr = PyDict_GetItem(Type.tp_dict, attr); \ - \ - if(descr) { \ - if (PyCObject_Check(descr)) { \ - const PyAttributeDef* attrdef= reinterpret_cast(PyCObject_AsVoidPtr(descr)); \ - if (attrdef->m_access == KX_PYATTRIBUTE_RO) { \ - PyErr_Format(PyExc_AttributeError, "\"%s\" is read only", PyString_AsString(attr)); \ - return PY_SET_ATTR_FAIL; \ - } \ - else { \ - return py_set_attrdef((void *)this, attrdef, value); \ - } \ - } else { \ - PyErr_Format(PyExc_AttributeError, "\"%s\" cannot be set", PyString_AsString(attr)); \ - return PY_SET_ATTR_FAIL; \ - } \ - } else { \ - PyErr_Clear(); \ - return Parent::py_setattro(attr, value); \ - } - - /** * These macros are helpfull when embedding Python routines. The second * macro is one that also requires a documentation string @@ -493,7 +429,7 @@ class PyObjectPlus : public SG_QList Py_Header; // Always start with Py_Header public: - PyObjectPlus(PyTypeObject *T); + PyObjectPlus(); PyObject *m_proxy; /* actually a PyObjectPlus_Proxy */ @@ -501,30 +437,19 @@ public: /* These static functions are referenced by ALL PyObjectPlus_Proxy types * they take the C++ reference from the PyObjectPlus_Proxy and call - * its own virtual py_getattro, py_setattro etc. functions. + * its own virtual py_repr, py_base_dealloc ,etc. functions. */ + + static PyObject* py_base_new(PyTypeObject *type, PyObject *args, PyObject *kwds); /* allows subclassing */ static void py_base_dealloc(PyObject *self); - static PyObject* py_base_getattro(PyObject * self, PyObject *attr); - static int py_base_setattro(PyObject *self, PyObject *attr, PyObject *value); static PyObject* py_base_repr(PyObject *self); /* These are all virtual python methods that are defined in each class * Our own fake subclassing calls these on each class, then calls the parent */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_delattro(PyObject *attr); - virtual int py_setattro(PyObject *attr, PyObject *value); virtual PyObject* py_repr(void); - static PyObject* py_get_attrdef(void *self, const PyAttributeDef *attrdef); - static int py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyObject *value); - - /* isA() methods, shonky replacement for pythons issubclass() - * which we cant use because we have our own subclass system */ - bool isA(PyTypeObject *T); - bool isA(const char *mytypename); - - KX_PYMETHOD_O(PyObjectPlus,isA); + static PyObject* py_get_attrdef(PyObject *self_py, const PyAttributeDef *attrdef); + static int py_set_attrdef(PyObject *self_py, PyObject *value, const PyAttributeDef *attrdef); /* Kindof dumb, always returns True, the false case is checked for, before this function gets accessed */ static PyObject* pyattr_get_invalid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Expressions/StringValue.h b/source/gameengine/Expressions/StringValue.h index 52f8a580f4d..c580e8fd23a 100644 --- a/source/gameengine/Expressions/StringValue.h +++ b/source/gameengine/Expressions/StringValue.h @@ -40,7 +40,7 @@ public: virtual void SetValue(CValue* newval) { m_strString = newval->GetText(); SetModified(true); }; virtual CValue* GetReplica(); virtual PyObject* ConvertValueToPython() { - return PyString_FromString(m_strString.Ptr()); + return PyUnicode_FromString(m_strString.Ptr()); } private: diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 61dabff510b..d8c81f56f66 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -54,15 +54,17 @@ PyTypeObject CValue::Type = { py_base_repr, 0, 0,0,0,0,0, - py_base_getattro, - py_base_setattro, - 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject CValue::Parents[] = { - &CValue::Type, - NULL + NULL, + NULL, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &PyObjectPlus::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef CValue::Methods[] = { @@ -74,7 +76,7 @@ PyObject* CValue::PyGetName() { ShowDeprecationWarning("getName()", "the name property"); - return PyString_FromString(this->GetName()); + return PyUnicode_FromString(this->GetName()); } /*#define CVALUE_DEBUG*/ @@ -100,8 +102,8 @@ std::vector gRefList; //int gRefCountValue; #endif -CValue::CValue(PyTypeObject *T) - : PyObjectPlus(T), +CValue::CValue() + : PyObjectPlus(), #else CValue::CValue() : @@ -553,33 +555,9 @@ PyAttributeDef CValue::Attributes[] = { { NULL } //Sentinel }; - -PyObject* CValue::py_getattro(PyObject *attr) -{ - char *attr_str= PyString_AsString(attr); - CValue* resultattr = GetProperty(attr_str); - if (resultattr) - { - /* only show the wanting here because python inspects for __class__ and KX_MeshProxy uses CValues name attr */ - ShowDeprecationWarning("val = ob.attr", "val = ob['attr']"); - - PyObject* pyconvert = resultattr->ConvertValueToPython(); - - if (pyconvert) - return pyconvert; - else - return resultattr->GetProxy(); - } - py_getattro_up(PyObjectPlus); -} - -PyObject* CValue::py_getattro_dict() { - py_getattro_dict_up(PyObjectPlus); -} - PyObject * CValue::pyattr_get_name(void * self_v, const KX_PYATTRIBUTE_DEF * attrdef) { CValue * self = static_cast (self_v); - return PyString_FromString(self->GetName()); + return PyUnicode_FromString(self->GetName()); } CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) @@ -623,30 +601,23 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) { vallie = new CFloatValue( (float)PyFloat_AsDouble(pyobj) ); } else +#if PY_VERSION_HEX < 0x03000000 if (PyInt_Check(pyobj)) { vallie = new CIntValue( (cInt)PyInt_AS_LONG(pyobj) ); } else +#endif if (PyLong_Check(pyobj)) { vallie = new CIntValue( (cInt)PyLong_AsLongLong(pyobj) ); } else - if (PyString_Check(pyobj)) + if (PyUnicode_Check(pyobj)) { - vallie = new CStringValue(PyString_AsString(pyobj),""); + vallie = new CStringValue(_PyUnicode_AsString(pyobj),""); } else - if (BGE_PROXY_CHECK_TYPE(pyobj)) /* Note, dont let these get assigned to GameObject props, must check elsewhere */ + if (PyObject_TypeCheck(pyobj, &CValue::Type)) /* Note, dont let these get assigned to GameObject props, must check elsewhere */ { - if (BGE_PROXY_REF(pyobj) && (BGE_PROXY_REF(pyobj))->isA(&CValue::Type)) - { - vallie = (static_cast(BGE_PROXY_REF(pyobj)))->AddRef(); - } else { - - if(BGE_PROXY_REF(pyobj)) /* this is not a CValue */ - PyErr_Format(PyExc_TypeError, "%sgame engine python type cannot be used as a property", error_prefix); - else /* PyObjectPlus_Proxy has been removed, cant use */ - PyErr_Format(PyExc_SystemError, "%s"BGE_PROXY_ERROR_MSG, error_prefix); - } + vallie = (static_cast(BGE_PROXY_REF(pyobj)))->AddRef(); } else { /* return an error value from the caller */ @@ -656,57 +627,6 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix) } -int CValue::py_delattro(PyObject *attr) -{ - ShowDeprecationWarning("del ob.attr", "del ob['attr']"); - - char *attr_str= PyString_AsString(attr); - if (RemoveProperty(attr_str)) - return 0; - - PyErr_Format(PyExc_AttributeError, "attribute \"%s\" dosnt exist", attr_str); - return PY_SET_ATTR_MISSING; -} - -int CValue::py_setattro(PyObject *attr, PyObject* pyobj) -{ - ShowDeprecationWarning("ob.attr = val", "ob['attr'] = val"); - - char *attr_str= PyString_AsString(attr); - CValue* oldprop = GetProperty(attr_str); - CValue* vallie; - - /* Dissallow python to assign GameObjects, Scenes etc as values */ - if ((BGE_PROXY_CHECK_TYPE(pyobj)==0) && (vallie = ConvertPythonToValue(pyobj, "cvalue.attr = value: "))) - { - if (oldprop) - oldprop->SetValue(vallie); - else - SetProperty(attr_str, vallie); - - vallie->Release(); - } - else { - // ConvertPythonToValue sets the error message - // must return missing so KX_GameObect knows this - // attribute was not a function or bult in attribute, - // - // CValue attributes override internal attributes - // so if it exists as a CValue attribute already, - // assume your trying to set it to a differnt CValue attribute - // otherwise return PY_SET_ATTR_MISSING so children - // classes know they can set it without conflict - - if (GetProperty(attr_str)) - return PY_SET_ATTR_COERCE_FAIL; /* failed to set an existing attribute */ - else - return PY_SET_ATTR_MISSING; /* allow the KX_GameObject dict to set */ - } - - //PyObjectPlus::py_setattro(attr,value); - return PY_SET_ATTR_SUCCESS; -}; - PyObject* CValue::ConvertKeysToPython( void ) { PyObject *pylist = PyList_New( 0 ); @@ -717,7 +637,7 @@ PyObject* CValue::ConvertKeysToPython( void ) std::map::iterator it; for (it= m_pNamedPropertyArray->begin(); (it != m_pNamedPropertyArray->end()); it++) { - pystr = PyString_FromString( (*it).first ); + pystr = PyUnicode_FromString( (*it).first ); PyList_Append(pylist, pystr); Py_DECREF( pystr ); } diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 29ef19b46c9..8c9f99b335e 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -215,26 +215,18 @@ public: // Construction / Destruction #ifndef NO_EXP_PYTHON_EMBEDDING - CValue(PyTypeObject *T = &Type); + CValue(); //static PyObject* PyMake(PyObject*,PyObject*); virtual PyObject *py_repr(void) { - return PyString_FromString((const char*)GetText()); + return PyUnicode_FromString((const char*)GetText()); } - - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); virtual PyObject* ConvertValueToPython() { return NULL; } virtual CValue* ConvertPythonToValue(PyObject* pyobj, const char *error_prefix); - - - virtual int py_delattro(PyObject *attr); - virtual int py_setattro(PyObject *attr, PyObject* value); static PyObject * pyattr_get_name(void * self, const KX_PYATTRIBUTE_DEF * attrdef); @@ -417,8 +409,8 @@ class CPropValue : public CValue public: #ifndef NO_EXP_PYTHON_EMBEDDING - CPropValue(PyTypeObject* T=&Type) : - CValue(T), + CPropValue() : + CValue(), #else CPropValue() : #endif //NO_EXP_PYTHON_EMBEDDING diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index caed85b9938..04d46e259d3 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -42,9 +42,8 @@ SCA_2DFilterActuator::SCA_2DFilterActuator( float float_arg, int int_arg, RAS_IRasterizer* rasterizer, - RAS_IRenderTools* rendertools, - PyTypeObject* T) - : SCA_IActuator(gameobj, T), + RAS_IRenderTools* rendertools) + : SCA_IActuator(gameobj), m_type(type), m_disableMotionBlur(flag), m_float_arg(float_arg), @@ -124,23 +123,17 @@ PyTypeObject SCA_2DFilterActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - - -PyParentObject SCA_2DFilterActuator::Parents[] = { - &SCA_2DFilterActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; - PyMethodDef SCA_2DFilterActuator::Methods[] = { /* add python functions to deal with m_msg... */ {NULL,NULL} @@ -154,18 +147,3 @@ PyAttributeDef SCA_2DFilterActuator::Attributes[] = { KX_PYATTRIBUTE_FLOAT_RW("value", 0.0, 100.0, SCA_2DFilterActuator, m_float_arg), { NULL } //Sentinel }; - -PyObject* SCA_2DFilterActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* SCA_2DFilterActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int SCA_2DFilterActuator::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(SCA_IActuator); -} - diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.h b/source/gameengine/GameLogic/SCA_2DFilterActuator.h index 13b9997a010..c357c4f3e37 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.h +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.h @@ -56,23 +56,12 @@ public: float float_arg, int int_arg, RAS_IRasterizer* rasterizer, - RAS_IRenderTools* rendertools, - PyTypeObject* T=&Type - ); + RAS_IRenderTools* rendertools); void SetShaderText(const char *text); virtual ~SCA_2DFilterActuator(); virtual bool Update(); virtual CValue* GetReplica(); - - /* --------------------------------------------------------------------- */ - /* Python interface ---------------------------------------------------- */ - /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); - }; #endif diff --git a/source/gameengine/GameLogic/SCA_ANDController.cpp b/source/gameengine/GameLogic/SCA_ANDController.cpp index 87f7c612e7c..78e1350428e 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.cpp +++ b/source/gameengine/GameLogic/SCA_ANDController.cpp @@ -42,10 +42,9 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ -SCA_ANDController::SCA_ANDController(SCA_IObject* gameobj, - PyTypeObject* T) +SCA_ANDController::SCA_ANDController(SCA_IObject* gameobj) : - SCA_IController(gameobj,T) + SCA_IController(gameobj) { } @@ -116,19 +115,15 @@ PyTypeObject SCA_ANDController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_ANDController::Parents[] = { - &SCA_ANDController::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IController::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_ANDController::Methods[] = { @@ -139,12 +134,4 @@ PyAttributeDef SCA_ANDController::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_ANDController::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IController); -} - -PyObject* SCA_ANDController::py_getattro_dict() { - py_getattro_dict_up(SCA_IController); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_ANDController.h b/source/gameengine/GameLogic/SCA_ANDController.h index 9a359d57cb4..cb16d7fca01 100644 --- a/source/gameengine/GameLogic/SCA_ANDController.h +++ b/source/gameengine/GameLogic/SCA_ANDController.h @@ -39,18 +39,10 @@ class SCA_ANDController : public SCA_IController Py_Header; //virtual void Trigger(class SCA_LogicManager* logicmgr); public: - SCA_ANDController(SCA_IObject* gameobj,PyTypeObject* T=&Type); + SCA_ANDController(SCA_IObject* gameobj); virtual ~SCA_ANDController(); virtual CValue* GetReplica(); virtual void Trigger(SCA_LogicManager* logicmgr); - - /* --------------------------------------------------------------------- */ - /* Python interface ---------------------------------------------------- */ - /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - }; #endif //__KX_ANDCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index 4dad65c5a25..bdcc923e1d9 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -40,9 +40,8 @@ SCA_ActuatorSensor::SCA_ActuatorSensor(SCA_EventManager* eventmgr, SCA_IObject* gameobj, - const STR_String& actname, - PyTypeObject* T ) - : SCA_ISensor(gameobj,eventmgr,T), + const STR_String& actname) + : SCA_ISensor(gameobj,eventmgr), m_checkactname(actname) { m_actuator = GetParent()->FindActuator(m_checkactname); @@ -138,19 +137,15 @@ PyTypeObject SCA_ActuatorSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_ActuatorSensor::Parents[] = { - &SCA_ActuatorSensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_ActuatorSensor::Methods[] = { @@ -166,18 +161,6 @@ PyAttributeDef SCA_ActuatorSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_ActuatorSensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_ActuatorSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int SCA_ActuatorSensor::py_setattro(PyObject *attr, PyObject *value) { - py_setattro_up(SCA_ISensor); -} - int SCA_ActuatorSensor::CheckActuator(void *self, const PyAttributeDef*) { SCA_ActuatorSensor* sensor = reinterpret_cast(self); @@ -197,7 +180,7 @@ const char SCA_ActuatorSensor::GetActuator_doc[] = PyObject* SCA_ActuatorSensor::PyGetActuator() { ShowDeprecationWarning("getActuator()", "the actuator property"); - return PyString_FromString(m_checkactname); + return PyUnicode_FromString(m_checkactname); } /* 4. setActuator */ diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.h b/source/gameengine/GameLogic/SCA_ActuatorSensor.h index 6655e08dc70..cf8e735cad4 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.h +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.h @@ -46,8 +46,7 @@ class SCA_ActuatorSensor : public SCA_ISensor public: SCA_ActuatorSensor(class SCA_EventManager* eventmgr, SCA_IObject* gameobj, - const STR_String& actname, - PyTypeObject* T=&Type ); + const STR_String& actname); virtual ~SCA_ActuatorSensor(); virtual CValue* GetReplica(); @@ -61,10 +60,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - /* 3. setProperty */ KX_PYMETHOD_DOC_VARARGS(SCA_ActuatorSensor,SetActuator); /* 4. getProperty */ diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp index ff02680f191..ddb54c580b8 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.cpp @@ -48,9 +48,8 @@ /* ------------------------------------------------------------------------- */ SCA_AlwaysSensor::SCA_AlwaysSensor(class SCA_EventManager* eventmgr, - SCA_IObject* gameobj, - PyTypeObject* T) - : SCA_ISensor(gameobj,eventmgr, T) + SCA_IObject* gameobj) + : SCA_ISensor(gameobj,eventmgr) { //SetDrawColor(255,0,0); Init(); @@ -121,19 +120,15 @@ PyTypeObject SCA_AlwaysSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_AlwaysSensor::Parents[] = { - &SCA_AlwaysSensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_AlwaysSensor::Methods[] = { @@ -144,12 +139,4 @@ PyAttributeDef SCA_AlwaysSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_AlwaysSensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_AlwaysSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_AlwaysSensor.h b/source/gameengine/GameLogic/SCA_AlwaysSensor.h index 0f85a641ef1..d58e05564d1 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysSensor.h +++ b/source/gameengine/GameLogic/SCA_AlwaysSensor.h @@ -39,22 +39,12 @@ class SCA_AlwaysSensor : public SCA_ISensor bool m_alwaysresult; public: SCA_AlwaysSensor(class SCA_EventManager* eventmgr, - SCA_IObject* gameobj, - PyTypeObject* T =&Type); + SCA_IObject* gameobj); virtual ~SCA_AlwaysSensor(); virtual CValue* GetReplica(); virtual bool Evaluate(); virtual bool IsPositiveTrigger(); virtual void Init(); - - - /* --------------------------------------------------------------------- */ - /* Python interface ---------------------------------------------------- */ - /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - }; #endif //__KX_ALWAYSSENSOR diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp index dcdae0b4e75..11c6996a0a1 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.cpp +++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp @@ -51,9 +51,8 @@ SCA_DelaySensor::SCA_DelaySensor(class SCA_EventManager* eventmgr, SCA_IObject* gameobj, int delay, int duration, - bool repeat, - PyTypeObject* T) - : SCA_ISensor(gameobj,eventmgr, T), + bool repeat) + : SCA_ISensor(gameobj,eventmgr), m_repeat(repeat), m_delay(delay), m_duration(duration) @@ -147,19 +146,15 @@ PyTypeObject SCA_DelaySensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_DelaySensor::Parents[] = { - &SCA_DelaySensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_DelaySensor::Methods[] = { @@ -183,19 +178,6 @@ PyAttributeDef SCA_DelaySensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_DelaySensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_DelaySensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int SCA_DelaySensor::py_setattro(PyObject *attr, PyObject *value) { - py_setattro_up(SCA_ISensor); -} - - const char SCA_DelaySensor::SetDelay_doc[] = "setDelay(delay)\n" "\t- delay: length of the initial OFF period as number of frame\n" @@ -262,7 +244,7 @@ const char SCA_DelaySensor::GetDelay_doc[] = PyObject* SCA_DelaySensor::PyGetDelay() { ShowDeprecationWarning("getDelay()", "the delay property"); - return PyInt_FromLong(m_delay); + return PyLong_FromSsize_t(m_delay); } const char SCA_DelaySensor::GetDuration_doc[] = @@ -271,7 +253,7 @@ const char SCA_DelaySensor::GetDuration_doc[] = PyObject* SCA_DelaySensor::PyGetDuration() { ShowDeprecationWarning("getDuration()", "the duration property"); - return PyInt_FromLong(m_duration); + return PyLong_FromSsize_t(m_duration); } const char SCA_DelaySensor::GetRepeat_doc[] = diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.h b/source/gameengine/GameLogic/SCA_DelaySensor.h index 5ccb33f8a16..8270e8959b7 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.h +++ b/source/gameengine/GameLogic/SCA_DelaySensor.h @@ -47,8 +47,7 @@ public: SCA_IObject* gameobj, int delay, int duration, - bool repeat, - PyTypeObject* T =&Type); + bool repeat); virtual ~SCA_DelaySensor(); virtual CValue* GetReplica(); virtual bool Evaluate(); @@ -59,10 +58,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); /* setProperty */ KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetDelay); diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.cpp b/source/gameengine/GameLogic/SCA_ExpressionController.cpp index 8e044b89c71..60969300474 100644 --- a/source/gameengine/GameLogic/SCA_ExpressionController.cpp +++ b/source/gameengine/GameLogic/SCA_ExpressionController.cpp @@ -46,9 +46,8 @@ /* ------------------------------------------------------------------------- */ SCA_ExpressionController::SCA_ExpressionController(SCA_IObject* gameobj, - const STR_String& exprtext, - PyTypeObject* T) - :SCA_IController(gameobj,T), + const STR_String& exprtext) + :SCA_IController(gameobj), m_exprText(exprtext), m_exprCache(NULL) { diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.h b/source/gameengine/GameLogic/SCA_ExpressionController.h index 6a34d7b2dff..705f6dfc415 100644 --- a/source/gameengine/GameLogic/SCA_ExpressionController.h +++ b/source/gameengine/GameLogic/SCA_ExpressionController.h @@ -42,8 +42,7 @@ class SCA_ExpressionController : public SCA_IController public: SCA_ExpressionController(SCA_IObject* gameobj, - const STR_String& exprtext, - PyTypeObject* T=&Type ); + const STR_String& exprtext); virtual ~SCA_ExpressionController(); virtual CValue* GetReplica(); @@ -54,14 +53,6 @@ public: * so that self references are removed before the controller itself is released */ virtual void Delete(); - - /* --------------------------------------------------------------------- */ - /* Python interface ---------------------------------------------------- */ - /* --------------------------------------------------------------------- */ - -// virtual PyObject* py_getattro(PyObject *attr); -// virtual PyObject* py_getattro_dict(); - }; #endif //__KX_EXPRESSIONCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_IActuator.cpp b/source/gameengine/GameLogic/SCA_IActuator.cpp index be7c2651686..0fda75590c1 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.cpp +++ b/source/gameengine/GameLogic/SCA_IActuator.cpp @@ -34,9 +34,8 @@ using namespace std; -SCA_IActuator::SCA_IActuator(SCA_IObject* gameobj, - PyTypeObject* T) : - SCA_ILogicBrick(gameobj,T), +SCA_IActuator::SCA_IActuator(SCA_IObject* gameobj) : + SCA_ILogicBrick(gameobj), m_links(0), m_posevent(false), m_negevent(false) diff --git a/source/gameengine/GameLogic/SCA_IActuator.h b/source/gameengine/GameLogic/SCA_IActuator.h index 27afcbc386b..13c718ee837 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.h +++ b/source/gameengine/GameLogic/SCA_IActuator.h @@ -61,8 +61,7 @@ public: * This class also inherits the default copy constructors */ - SCA_IActuator(SCA_IObject* gameobj, - PyTypeObject* T =&Type); + SCA_IActuator(SCA_IObject* gameobj); /** * UnlinkObject(...) diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp index f2c3c83a2d9..7cbb728753a 100644 --- a/source/gameengine/GameLogic/SCA_IController.cpp +++ b/source/gameengine/GameLogic/SCA_IController.cpp @@ -37,10 +37,9 @@ #include #endif -SCA_IController::SCA_IController(SCA_IObject* gameobj, - PyTypeObject* T) +SCA_IController::SCA_IController(SCA_IObject* gameobj) : - SCA_ILogicBrick(gameobj,T), + SCA_ILogicBrick(gameobj), m_statemask(0), m_justActivated(false) { @@ -216,17 +215,15 @@ PyTypeObject SCA_IController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_IController::Parents[] = { - &SCA_IController::Type, - &CValue::Type, - NULL + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_ILogicBrick::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_IController::Methods[] = { @@ -248,22 +245,6 @@ PyAttributeDef SCA_IController::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_IController::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_ILogicBrick); -} - -PyObject* SCA_IController::py_getattro_dict() { - py_getattro_dict_up(SCA_ILogicBrick); -} - -int SCA_IController::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_ILogicBrick); -} - - - PyObject* SCA_IController::PyGetActuators() { ShowDeprecationWarning("getActuators()", "the actuators property"); @@ -281,7 +262,7 @@ PyObject* SCA_IController::PyGetSensor(PyObject* value) { ShowDeprecationWarning("getSensor(string)", "the sensors[string] property"); - char *scriptArg = PyString_AsString(value); + char *scriptArg = _PyUnicode_AsString(value); if (scriptArg==NULL) { PyErr_SetString(PyExc_TypeError, "controller.getSensor(string): Python Controller, expected a string (sensor name)"); return NULL; @@ -305,7 +286,7 @@ PyObject* SCA_IController::PyGetActuator(PyObject* value) { ShowDeprecationWarning("getActuator(string)", "the actuators[string] property"); - char *scriptArg = PyString_AsString(value); + char *scriptArg = _PyUnicode_AsString(value); if (scriptArg==NULL) { PyErr_SetString(PyExc_TypeError, "controller.getActuator(string): Python Controller, expected a string (actuator name)"); return NULL; @@ -340,13 +321,13 @@ PyObject* SCA_IController::PyGetSensors() PyObject* SCA_IController::PyGetState() { ShowDeprecationWarning("getState()", "the state property"); - return PyInt_FromLong(m_statemask); + return PyLong_FromSsize_t(m_statemask); } PyObject* SCA_IController::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_IController* self= static_cast(self_v); - return PyInt_FromLong(self->m_statemask); + return PyLong_FromSsize_t(self->m_statemask); } PyObject* SCA_IController::pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) diff --git a/source/gameengine/GameLogic/SCA_IController.h b/source/gameengine/GameLogic/SCA_IController.h index a52c57ab3ed..523878bee26 100644 --- a/source/gameengine/GameLogic/SCA_IController.h +++ b/source/gameengine/GameLogic/SCA_IController.h @@ -47,7 +47,7 @@ protected: bool m_justActivated; bool m_bookmark; public: - SCA_IController(SCA_IObject* gameobj,PyTypeObject* T); + SCA_IController(SCA_IObject* gameobj); virtual ~SCA_IController(); virtual void Trigger(class SCA_LogicManager* logicmgr)=0; void LinkToSensor(SCA_ISensor* sensor); @@ -98,10 +98,6 @@ public: } } - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - KX_PYMETHOD_NOARGS(SCA_IController,GetSensors); KX_PYMETHOD_NOARGS(SCA_IController,GetActuators); KX_PYMETHOD_O(SCA_IController,GetSensor); diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 2dc80f54568..ccb79a2d49f 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -35,10 +35,9 @@ SCA_LogicManager* SCA_ILogicBrick::m_sCurrentLogicManager = NULL; -SCA_ILogicBrick::SCA_ILogicBrick(SCA_IObject* gameobj, - PyTypeObject* T) +SCA_ILogicBrick::SCA_ILogicBrick(SCA_IObject* gameobj) : - CValue(T), + CValue(), m_gameobj(gameobj), m_Execute_Priority(0), m_Execute_Ueber_Priority(0), @@ -194,23 +193,17 @@ PyTypeObject SCA_ILogicBrick::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject SCA_ILogicBrick::Parents[] = { - &SCA_ILogicBrick::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; - - PyMethodDef SCA_ILogicBrick::Methods[] = { // --> Deprecated {"getOwner", (PyCFunction) SCA_ILogicBrick::sPyGetOwner, METH_NOARGS}, @@ -245,21 +238,6 @@ int SCA_ILogicBrick::CheckProperty(void *self, const PyAttributeDef *attrdef) return 0; } -PyObject* SCA_ILogicBrick::py_getattro(PyObject *attr) -{ - py_getattro_up(CValue); -} - -PyObject* SCA_ILogicBrick::py_getattro_dict() { - py_getattro_dict_up(CValue); -} - -int SCA_ILogicBrick::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(CValue); -} - - PyObject* SCA_ILogicBrick::PyGetOwner() { ShowDeprecationWarning("getOwner()", "the owner property"); @@ -296,7 +274,7 @@ PyObject* SCA_ILogicBrick::PySetExecutePriority(PyObject* args) PyObject* SCA_ILogicBrick::PyGetExecutePriority() { ShowDeprecationWarning("getExecutePriority()", "the executePriority property"); - return PyInt_FromLong(m_Execute_Priority); + return PyLong_FromSsize_t(m_Execute_Priority); } @@ -326,5 +304,5 @@ bool SCA_ILogicBrick::PyArgToBool(int boolArg) PyObject* SCA_ILogicBrick::BoolToPyArg(bool boolarg) { - return PyInt_FromLong(boolarg? KX_TRUE: KX_FALSE); + return PyLong_FromSsize_t(boolarg? KX_TRUE: KX_FALSE); } diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index 779e5397a6a..50679856802 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -53,7 +53,7 @@ protected: CValue* GetEvent(); public: - SCA_ILogicBrick(SCA_IObject* gameobj,PyTypeObject* T ); + SCA_ILogicBrick(SCA_IObject* gameobj); virtual ~SCA_ILogicBrick(); void SetExecutePriority(int execute_Priority); @@ -121,10 +121,6 @@ public: } virtual bool LessComparedTo(SCA_ILogicBrick* other); - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); static class SCA_LogicManager* m_sCurrentLogicManager; diff --git a/source/gameengine/GameLogic/SCA_IObject.cpp b/source/gameengine/GameLogic/SCA_IObject.cpp index 9876f2512c0..6cd11f9e553 100644 --- a/source/gameengine/GameLogic/SCA_IObject.cpp +++ b/source/gameengine/GameLogic/SCA_IObject.cpp @@ -41,8 +41,11 @@ MT_Point3 SCA_IObject::m_sDummy=MT_Point3(0,0,0); SG_QList SCA_IObject::m_activeBookmarkedControllers; -SCA_IObject::SCA_IObject(PyTypeObject* T): CValue(T), m_initState(0), m_state(0), m_firstState(NULL) - +SCA_IObject::SCA_IObject(): + CValue(), + m_initState(0), + m_state(0), + m_firstState(NULL) { m_suspended = false; } @@ -218,51 +221,6 @@ SCA_IActuator* SCA_IObject::FindActuator(const STR_String& actuatorname) } - -#if 0 -const MT_Point3& SCA_IObject::ConvertPythonPylist(PyObject* pylist) -{ - bool error = false; - m_sDummy = MT_Vector3(0,0,0); - if (pylist->ob_type == &CListValue::Type) - { - CListValue* listval = (CListValue*) pylist; - int numelem = listval->GetCount(); - if ( numelem <= 3) - { - int index; - for (index = 0;indexGetValue(index)->GetNumber(); - } - } else - { - error = true; - } - - } else - { - - // assert the list is long enough... - int numitems = PyList_Size(pylist); - if (numitems <= 3) - { - int index; - for (index=0;indexIsTriggered(this); - return PyInt_FromLong(retval); + return PyLong_FromSsize_t(retval); } /** @@ -355,7 +354,7 @@ const char SCA_ISensor::GetFrequency_doc[] = PyObject* SCA_ISensor::PyGetFrequency() { ShowDeprecationWarning("getFrequency()", "the frequency property"); - return PyInt_FromLong(m_pulse_frequency); + return PyLong_FromSsize_t(m_pulse_frequency); } /** @@ -489,19 +488,17 @@ PyTypeObject SCA_ISensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_ISensor::Parents[] = { - &SCA_ISensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; + PyMethodDef SCA_ISensor::Methods[] = { //Deprecated functions -----> {"isPositive", (PyCFunction) SCA_ISensor::sPyIsPositive, @@ -548,19 +545,6 @@ PyAttributeDef SCA_ISensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_ISensor::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_ILogicBrick); -} - -PyObject* SCA_ISensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ILogicBrick); -} - -int SCA_ISensor::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_ILogicBrick); -} PyObject* SCA_ISensor::pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { @@ -568,13 +552,13 @@ PyObject* SCA_ISensor::pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_D int retval = 0; if (SCA_PythonController::m_sCurrentController) retval = SCA_PythonController::m_sCurrentController->IsTriggered(self); - return PyInt_FromLong(retval); + return PyLong_FromSsize_t(retval); } PyObject* SCA_ISensor::pyattr_get_positive(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_ISensor* self= static_cast(self_v); - return PyInt_FromLong(self->GetState()); + return PyLong_FromSsize_t(self->GetState()); } int SCA_ISensor::pyattr_check_level(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index 9bbd6ed41e4..81864ab6a34 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -101,8 +101,7 @@ public: }; SCA_ISensor(SCA_IObject* gameobj, - class SCA_EventManager* eventmgr, - PyTypeObject* T );; + class SCA_EventManager* eventmgr);; ~SCA_ISensor(); virtual void ReParent(SCA_IObject* parent); @@ -173,10 +172,6 @@ public: { return !m_links; } /* Python functions: */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); //Deprecated functions -----> KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,IsPositive); diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index 336529667d7..f55921e648b 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -46,9 +46,8 @@ SCA_JoystickSensor::SCA_JoystickSensor(class SCA_JoystickManager* eventmgr, short int joymode, int axis, int axisf,int prec, int button, - int hat, int hatf, bool allevents, - PyTypeObject* T ) - :SCA_ISensor(gameobj,eventmgr,T), + int hat, int hatf, bool allevents) + :SCA_ISensor(gameobj,eventmgr), m_pJoystickMgr(eventmgr), m_axis(axis), m_axisf(axisf), @@ -269,23 +268,17 @@ PyTypeObject SCA_JoystickSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - - -PyParentObject SCA_JoystickSensor::Parents[] = { - &SCA_JoystickSensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; - PyMethodDef SCA_JoystickSensor::Methods[] = { //Deprecated functions ------> {"getIndex", (PyCFunction) SCA_JoystickSensor::sPyGetIndex, METH_NOARGS, (PY_METHODCHAR)GetIndex_doc}, @@ -328,20 +321,6 @@ PyAttributeDef SCA_JoystickSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_JoystickSensor::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_JoystickSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int SCA_JoystickSensor::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_ISensor); -} - /* get index ---------------------------------------------------------- */ const char SCA_JoystickSensor::GetIndex_doc[] = @@ -349,7 +328,7 @@ const char SCA_JoystickSensor::GetIndex_doc[] = "\tReturns the joystick index to use.\n"; PyObject* SCA_JoystickSensor::PyGetIndex( ) { ShowDeprecationWarning("getIndex()", "the index property"); - return PyInt_FromLong(m_joyindex); + return PyLong_FromSsize_t(m_joyindex); } @@ -359,7 +338,7 @@ const char SCA_JoystickSensor::SetIndex_doc[] = "\tSets the joystick index to use.\n"; PyObject* SCA_JoystickSensor::PySetIndex( PyObject* value ) { ShowDeprecationWarning("setIndex()", "the index property"); - int index = PyInt_AsLong( value ); /* -1 on error, will raise an error in this case */ + int index = PyLong_AsSsize_t( value ); /* -1 on error, will raise an error in this case */ if (index < 0 || index >= JOYINDEX_MAX) { PyErr_SetString(PyExc_ValueError, "joystick index out of range or not an int"); return NULL; @@ -410,7 +389,7 @@ PyObject* SCA_JoystickSensor::PyGetAxisValue( ) { PyObject *list= PyList_New(axis_index); while(axis_index--) { - PyList_SET_ITEM(list, axis_index, PyInt_FromLong(joy->GetAxisPosition(axis_index))); + PyList_SET_ITEM(list, axis_index, PyLong_FromSsize_t(joy->GetAxisPosition(axis_index))); } return list; @@ -423,7 +402,7 @@ const char SCA_JoystickSensor::GetThreshold_doc[] = "\tReturns the threshold of the axis.\n"; PyObject* SCA_JoystickSensor::PyGetThreshold( ) { ShowDeprecationWarning("getThreshold()", "the threshold property"); - return PyInt_FromLong(m_precision); + return PyLong_FromSsize_t(m_precision); } @@ -447,7 +426,7 @@ const char SCA_JoystickSensor::GetButton_doc[] = "\tReturns the current button this sensor is checking.\n"; PyObject* SCA_JoystickSensor::PyGetButton( ) { ShowDeprecationWarning("getButton()", "the button property"); - return PyInt_FromLong(m_button); + return PyLong_FromSsize_t(m_button); } /* set button -------------------------------------------------------- */ @@ -456,7 +435,7 @@ const char SCA_JoystickSensor::SetButton_doc[] = "\tSets the button the sensor reacts to.\n"; PyObject* SCA_JoystickSensor::PySetButton( PyObject* value ) { ShowDeprecationWarning("setButton()", "the button property"); - int button = PyInt_AsLong(value); + int button = PyLong_AsSsize_t(value); if(button==-1 && PyErr_Occurred()) { PyErr_SetString(PyExc_ValueError, "expected an int"); return NULL; @@ -487,7 +466,7 @@ PyObject* SCA_JoystickSensor::PyGetButtonActiveList( ) { if(joy) { for (i=0; i < joy->GetNumberOfButtons(); i++) { if (joy->aButtonPressIsPositive(i)) { - value = PyInt_FromLong(i); + value = PyLong_FromSsize_t(i); PyList_Append(ls, value); Py_DECREF(value); } @@ -549,7 +528,7 @@ PyObject* SCA_JoystickSensor::PyNumberOfAxes( ) { ShowDeprecationWarning("getNumAxes()", "the numAxis property"); SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); // when the joystick is null their is 0 exis still. dumb but scripters should use isConnected() - return PyInt_FromLong( joy ? joy->GetNumberOfAxes() : 0 ); + return PyLong_FromSsize_t( joy ? joy->GetNumberOfAxes() : 0 ); } @@ -559,7 +538,7 @@ const char SCA_JoystickSensor::NumberOfButtons_doc[] = PyObject* SCA_JoystickSensor::PyNumberOfButtons( ) { ShowDeprecationWarning("getNumButtons()", "the numButtons property"); SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); - return PyInt_FromLong( joy ? joy->GetNumberOfButtons() : 0 ); + return PyLong_FromSsize_t( joy ? joy->GetNumberOfButtons() : 0 ); } @@ -569,7 +548,7 @@ const char SCA_JoystickSensor::NumberOfHats_doc[] = PyObject* SCA_JoystickSensor::PyNumberOfHats( ) { ShowDeprecationWarning("getNumHats()", "the numHats property"); SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); - return PyInt_FromLong( joy ? joy->GetNumberOfHats() : 0 ); + return PyLong_FromSsize_t( joy ? joy->GetNumberOfHats() : 0 ); } const char SCA_JoystickSensor::Connected_doc[] = @@ -591,7 +570,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYAT PyObject *list= PyList_New(axis_index); while(axis_index--) { - PyList_SET_ITEM(list, axis_index, PyInt_FromLong(joy->GetAxisPosition(axis_index))); + PyList_SET_ITEM(list, axis_index, PyLong_FromSsize_t(joy->GetAxisPosition(axis_index))); } return list; @@ -607,7 +586,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYAT return NULL; } - return PyInt_FromLong(joy->GetAxisPosition(self->m_axis-1)); + return PyLong_FromSsize_t(joy->GetAxisPosition(self->m_axis-1)); } PyObject* SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -619,7 +598,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATT PyObject *list= PyList_New(hat_index); while(hat_index--) { - PyList_SET_ITEM(list, hat_index, PyInt_FromLong(joy->GetHat(hat_index))); + PyList_SET_ITEM(list, hat_index, PyLong_FromSsize_t(joy->GetHat(hat_index))); } return list; @@ -630,28 +609,28 @@ PyObject* SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATT SCA_JoystickSensor* self= static_cast(self_v); SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); - return PyInt_FromLong(joy->GetHat(self->m_hat-1)); + return PyLong_FromSsize_t(joy->GetHat(self->m_hat-1)); } PyObject* SCA_JoystickSensor::pyattr_get_num_axis(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); - return PyInt_FromLong( joy ? joy->GetNumberOfAxes() : 0 ); + return PyLong_FromSsize_t( joy ? joy->GetNumberOfAxes() : 0 ); } PyObject* SCA_JoystickSensor::pyattr_get_num_buttons(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); - return PyInt_FromLong( joy ? joy->GetNumberOfButtons() : 0 ); + return PyLong_FromSsize_t( joy ? joy->GetNumberOfButtons() : 0 ); } PyObject* SCA_JoystickSensor::pyattr_get_num_hats(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); - return PyInt_FromLong( joy ? joy->GetNumberOfHats() : 0 ); + return PyLong_FromSsize_t( joy ? joy->GetNumberOfHats() : 0 ); } PyObject* SCA_JoystickSensor::pyattr_get_connected(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.h b/source/gameengine/GameLogic/SCA_JoystickSensor.h index e6a1d2eef32..32f8ce567d2 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.h +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.h @@ -106,8 +106,7 @@ public: short int joymode, int axis, int axisf,int prec, int button, - int hat, int hatf, bool allevents, - PyTypeObject* T=&Type ); + int hat, int hatf, bool allevents); virtual ~SCA_JoystickSensor(); virtual CValue* GetReplica(); @@ -123,10 +122,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - /* Joystick Index */ KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetIndex); KX_PYMETHOD_DOC_O(SCA_JoystickSensor,SetIndex); diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index f8ee8ed8b41..999e34dfa36 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -48,9 +48,8 @@ SCA_KeyboardSensor::SCA_KeyboardSensor(SCA_KeyboardManager* keybdmgr, bool bAllKeys, const STR_String& targetProp, const STR_String& toggleProp, - SCA_IObject* gameobj, - PyTypeObject* T ) - :SCA_ISensor(gameobj,keybdmgr,T), + SCA_IObject* gameobj) + :SCA_ISensor(gameobj,keybdmgr), m_pKeyboardMgr(keybdmgr), m_hotkey(hotkey), m_qual(qual), @@ -418,7 +417,7 @@ const char SCA_KeyboardSensor::GetKey_doc[] = PyObject* SCA_KeyboardSensor::PyGetKey() { ShowDeprecationWarning("getKey()", "the key property"); - return PyInt_FromLong(m_hotkey); + return PyLong_FromSsize_t(m_hotkey); } /** 2. SetKey: change the key to look at */ @@ -450,7 +449,7 @@ const char SCA_KeyboardSensor::GetHold1_doc[] = PyObject* SCA_KeyboardSensor::PyGetHold1() { ShowDeprecationWarning("getHold1()", "the hold1 property"); - return PyInt_FromLong(m_qual); + return PyLong_FromSsize_t(m_qual); } /** 4. SetHold1: change the first bucky bit */ @@ -482,7 +481,7 @@ const char SCA_KeyboardSensor::GetHold2_doc[] = PyObject* SCA_KeyboardSensor::PyGetHold2() { ShowDeprecationWarning("getHold2()", "the hold2 property"); - return PyInt_FromLong(m_qual2); + return PyLong_FromSsize_t(m_qual2); } /** 6. SetHold2: change the second bucky bit */ @@ -532,8 +531,8 @@ PyObject* SCA_KeyboardSensor::PyGetPressedKeys() || (inevent.m_status == SCA_InputEvent::KX_JUSTRELEASED)) { PyObject* keypair = PyList_New(2); - PyList_SET_ITEM(keypair,0,PyInt_FromLong(i)); - PyList_SET_ITEM(keypair,1,PyInt_FromLong(inevent.m_status)); + PyList_SET_ITEM(keypair,0,PyLong_FromSsize_t(i)); + PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status)); PyList_SET_ITEM(resultlist,index,keypair); index++; @@ -572,8 +571,8 @@ PyObject* SCA_KeyboardSensor::PyGetCurrentlyPressedKeys() || (inevent.m_status == SCA_InputEvent::KX_JUSTACTIVATED)) { PyObject* keypair = PyList_New(2); - PyList_SET_ITEM(keypair,0,PyInt_FromLong(i)); - PyList_SET_ITEM(keypair,1,PyInt_FromLong(inevent.m_status)); + PyList_SET_ITEM(keypair,0,PyLong_FromSsize_t(i)); + PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status)); PyList_SET_ITEM(resultlist,index,keypair); index++; @@ -592,12 +591,12 @@ KX_PYMETHODDEF_DOC_O(SCA_KeyboardSensor, getKeyStatus, "getKeyStatus(keycode)\n" "\tGet the given key's status (KX_NO_INPUTSTATUS, KX_JUSTACTIVATED, KX_ACTIVE or KX_JUSTRELEASED).\n") { - if (!PyInt_Check(value)) { + if (!PyLong_Check(value)) { PyErr_SetString(PyExc_ValueError, "sensor.getKeyStatus(int): Keyboard Sensor, expected an int"); return NULL; } - int keycode = PyInt_AsLong(value); + int keycode = PyLong_AsSsize_t(value); if ((keycode < SCA_IInputDevice::KX_BEGINKEY) || (keycode > SCA_IInputDevice::KX_ENDKEY)){ @@ -607,7 +606,7 @@ KX_PYMETHODDEF_DOC_O(SCA_KeyboardSensor, getKeyStatus, SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice(); const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) keycode); - return PyInt_FromLong(inevent.m_status); + return PyLong_FromSsize_t(inevent.m_status); } /* ------------------------------------------------------------------------- */ @@ -631,19 +630,15 @@ PyTypeObject SCA_KeyboardSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_KeyboardSensor::Parents[] = { - &SCA_KeyboardSensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_KeyboardSensor::Methods[] = { @@ -672,20 +667,6 @@ PyAttributeDef SCA_KeyboardSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_KeyboardSensor::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_KeyboardSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int SCA_KeyboardSensor::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_ISensor); -} - PyObject* SCA_KeyboardSensor::pyattr_get_events(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { @@ -701,8 +682,8 @@ PyObject* SCA_KeyboardSensor::pyattr_get_events(void *self_v, const KX_PYATTRIBU if (inevent.m_status != SCA_InputEvent::KX_NO_INPUTSTATUS) { PyObject* keypair = PyList_New(2); - PyList_SET_ITEM(keypair,0,PyInt_FromLong(i)); - PyList_SET_ITEM(keypair,1,PyInt_FromLong(inevent.m_status)); + PyList_SET_ITEM(keypair,0,PyLong_FromSsize_t(i)); + PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status)); PyList_Append(resultlist,keypair); } } diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h index 033225cd9be..3185b386d41 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h @@ -94,8 +94,7 @@ public: bool bAllKeys, const STR_String& targetProp, const STR_String& toggleProp, - SCA_IObject* gameobj, - PyTypeObject* T=&Type ); + SCA_IObject* gameobj); virtual ~SCA_KeyboardSensor(); virtual CValue* GetReplica(); virtual void Init(); @@ -110,10 +109,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - //Deprecated functions -----> /** 1. GetKey : check which key this sensor looks at */ KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetKey); diff --git a/source/gameengine/GameLogic/SCA_LogicManager.cpp b/source/gameengine/GameLogic/SCA_LogicManager.cpp index 83271288154..b782c6dfb93 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.cpp +++ b/source/gameengine/GameLogic/SCA_LogicManager.cpp @@ -307,6 +307,7 @@ void SCA_LogicManager::AddTriggeredController(SCA_IController* controller, SCA_I controller->Activate(m_triggeredControllerSet); // so that the controller knows which sensor has activited it // only needed for python controller + // Note that this is safe even if the controller is subclassed. if (controller->GetType() == &SCA_PythonController::Type) { SCA_PythonController* pythonController = (SCA_PythonController*)controller; diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index c5e1c3c0441..49fa19dce38 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -49,9 +49,8 @@ SCA_MouseSensor::SCA_MouseSensor(SCA_MouseManager* eventmgr, int startx,int starty, short int mousemode, - SCA_IObject* gameobj, - PyTypeObject* T) - : SCA_ISensor(gameobj,eventmgr, T), + SCA_IObject* gameobj) + : SCA_ISensor(gameobj,eventmgr), m_pMouseMgr(eventmgr), m_x(startx), m_y(starty) @@ -254,7 +253,7 @@ const char SCA_MouseSensor::GetXPosition_doc[] = "\tpixels\n"; PyObject* SCA_MouseSensor::PyGetXPosition() { ShowDeprecationWarning("getXPosition()", "the position property"); - return PyInt_FromLong(m_x); + return PyLong_FromSsize_t(m_x); } /* get y position ---------------------------------------------------------- */ @@ -265,7 +264,7 @@ const char SCA_MouseSensor::GetYPosition_doc[] = "\tpixels\n"; PyObject* SCA_MouseSensor::PyGetYPosition() { ShowDeprecationWarning("getYPosition()", "the position property"); - return PyInt_FromLong(m_y); + return PyLong_FromSsize_t(m_y); } //<----- Deprecated @@ -273,9 +272,9 @@ KX_PYMETHODDEF_DOC_O(SCA_MouseSensor, getButtonStatus, "getButtonStatus(button)\n" "\tGet the given button's status (KX_INPUT_NONE, KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED).\n") { - if (PyInt_Check(value)) + if (PyLong_Check(value)) { - int button = PyInt_AsLong(value); + int button = PyLong_AsSsize_t(value); if ((button < SCA_IInputDevice::KX_LEFTMOUSE) || (button > SCA_IInputDevice::KX_RIGHTMOUSE)){ @@ -285,7 +284,7 @@ KX_PYMETHODDEF_DOC_O(SCA_MouseSensor, getButtonStatus, SCA_IInputDevice* mousedev = m_pMouseMgr->GetInputDevice(); const SCA_InputEvent& event = mousedev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) button); - return PyInt_FromLong(event.m_status); + return PyLong_FromSsize_t(event.m_status); } Py_RETURN_NONE; @@ -312,19 +311,15 @@ PyTypeObject SCA_MouseSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_MouseSensor::Parents[] = { - &SCA_MouseSensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_MouseSensor::Methods[] = { @@ -342,18 +337,4 @@ PyAttributeDef SCA_MouseSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_MouseSensor::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_MouseSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int SCA_MouseSensor::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_ISensor); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.h b/source/gameengine/GameLogic/SCA_MouseSensor.h index 6d6302b514a..47f0378bf69 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.h +++ b/source/gameengine/GameLogic/SCA_MouseSensor.h @@ -92,8 +92,7 @@ class SCA_MouseSensor : public SCA_ISensor SCA_MouseSensor(class SCA_MouseManager* keybdmgr, int startx,int starty, short int mousemode, - SCA_IObject* gameobj, - PyTypeObject* T=&Type ); + SCA_IObject* gameobj); virtual ~SCA_MouseSensor(); virtual CValue* GetReplica(); @@ -109,10 +108,6 @@ class SCA_MouseSensor : public SCA_ISensor /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - //Deprecated functions -----> /* read x-coordinate */ KX_PYMETHOD_DOC_NOARGS(SCA_MouseSensor,GetXPosition); diff --git a/source/gameengine/GameLogic/SCA_NANDController.cpp b/source/gameengine/GameLogic/SCA_NANDController.cpp index d27aea5e6f7..c00e5d6e617 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.cpp +++ b/source/gameengine/GameLogic/SCA_NANDController.cpp @@ -42,10 +42,9 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ -SCA_NANDController::SCA_NANDController(SCA_IObject* gameobj, - PyTypeObject* T) +SCA_NANDController::SCA_NANDController(SCA_IObject* gameobj) : - SCA_IController(gameobj,T) + SCA_IController(gameobj) { } @@ -116,19 +115,15 @@ PyTypeObject SCA_NANDController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_NANDController::Parents[] = { - &SCA_NANDController::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IController::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_NANDController::Methods[] = { @@ -139,12 +134,4 @@ PyAttributeDef SCA_NANDController::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_NANDController::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IController); -} - -PyObject* SCA_NANDController::py_getattro_dict() { - py_getattro_dict_up(SCA_IController); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_NANDController.h b/source/gameengine/GameLogic/SCA_NANDController.h index 0ae0ff19745..36a145e5f2b 100644 --- a/source/gameengine/GameLogic/SCA_NANDController.h +++ b/source/gameengine/GameLogic/SCA_NANDController.h @@ -39,7 +39,7 @@ class SCA_NANDController : public SCA_IController Py_Header; //virtual void Trigger(class SCA_LogicManager* logicmgr); public: - SCA_NANDController(SCA_IObject* gameobj,PyTypeObject* T=&Type); + SCA_NANDController(SCA_IObject* gameobj); virtual ~SCA_NANDController(); virtual CValue* GetReplica(); virtual void Trigger(SCA_LogicManager* logicmgr); @@ -47,10 +47,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - }; #endif //__KX_NANDCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_NORController.cpp b/source/gameengine/GameLogic/SCA_NORController.cpp index 6c9141636b2..9762d44fd5d 100644 --- a/source/gameengine/GameLogic/SCA_NORController.cpp +++ b/source/gameengine/GameLogic/SCA_NORController.cpp @@ -42,10 +42,9 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ -SCA_NORController::SCA_NORController(SCA_IObject* gameobj, - PyTypeObject* T) +SCA_NORController::SCA_NORController(SCA_IObject* gameobj) : - SCA_IController(gameobj,T) + SCA_IController(gameobj) { } @@ -116,19 +115,15 @@ PyTypeObject SCA_NORController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_NORController::Parents[] = { - &SCA_NORController::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IController::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_NORController::Methods[] = { @@ -139,12 +134,4 @@ PyAttributeDef SCA_NORController::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_NORController::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IController); -} - -PyObject* SCA_NORController::py_getattro_dict() { - py_getattro_dict_up(SCA_IController); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_NORController.h b/source/gameengine/GameLogic/SCA_NORController.h index 06cbb70a489..b96232375d6 100644 --- a/source/gameengine/GameLogic/SCA_NORController.h +++ b/source/gameengine/GameLogic/SCA_NORController.h @@ -39,18 +39,10 @@ class SCA_NORController : public SCA_IController Py_Header; //virtual void Trigger(class SCA_LogicManager* logicmgr); public: - SCA_NORController(SCA_IObject* gameobj,PyTypeObject* T=&Type); + SCA_NORController(SCA_IObject* gameobj); virtual ~SCA_NORController(); virtual CValue* GetReplica(); virtual void Trigger(SCA_LogicManager* logicmgr); - - /* --------------------------------------------------------------------- */ - /* Python interface ---------------------------------------------------- */ - /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - }; #endif //__KX_NORCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_ORController.cpp b/source/gameengine/GameLogic/SCA_ORController.cpp index 42c0a67d657..a526dd8353c 100644 --- a/source/gameengine/GameLogic/SCA_ORController.cpp +++ b/source/gameengine/GameLogic/SCA_ORController.cpp @@ -42,9 +42,8 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ -SCA_ORController::SCA_ORController(SCA_IObject* gameobj, - PyTypeObject* T) - :SCA_IController(gameobj, T) +SCA_ORController::SCA_ORController(SCA_IObject* gameobj) + :SCA_IController(gameobj) { } @@ -110,19 +109,15 @@ PyTypeObject SCA_ORController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_ORController::Parents[] = { - &SCA_ORController::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IController::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_ORController::Methods[] = { @@ -133,13 +128,4 @@ PyAttributeDef SCA_ORController::Attributes[] = { { NULL } //Sentinel }; - -PyObject* SCA_ORController::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IController); -} - -PyObject* SCA_ORController::py_getattro_dict() { - py_getattro_dict_up(SCA_IController); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_ORController.h b/source/gameengine/GameLogic/SCA_ORController.h index 66f772c739e..09d31a85190 100644 --- a/source/gameengine/GameLogic/SCA_ORController.h +++ b/source/gameengine/GameLogic/SCA_ORController.h @@ -39,18 +39,11 @@ class SCA_ORController : public SCA_IController Py_Header; //virtual void Trigger(class SCA_LogicManager* logicmgr); public: - SCA_ORController(SCA_IObject* gameobj, PyTypeObject* T=&Type); + SCA_ORController(SCA_IObject* gameobj); virtual ~SCA_ORController(); virtual CValue* GetReplica(); virtual void Trigger(SCA_LogicManager* logicmgr); - - /* --------------------------------------------------------------------- */ - /* Python interface ---------------------------------------------------- */ - /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); }; #endif //__KX_ORCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index 4faa4b55d4a..215e30eceaf 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -42,8 +42,8 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ -SCA_PropertyActuator::SCA_PropertyActuator(SCA_IObject* gameobj,SCA_IObject* sourceObj,const STR_String& propname,const STR_String& expr,int acttype,PyTypeObject* T ) - : SCA_IActuator(gameobj,T), +SCA_PropertyActuator::SCA_PropertyActuator(SCA_IObject* gameobj,SCA_IObject* sourceObj,const STR_String& propname,const STR_String& expr,int acttype) + : SCA_IActuator(gameobj), m_type(acttype), m_propname(propname), m_exprtxt(expr), @@ -244,19 +244,15 @@ PyTypeObject SCA_PropertyActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_PropertyActuator::Parents[] = { - &SCA_PropertyActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_PropertyActuator::Methods[] = { @@ -276,18 +272,6 @@ PyAttributeDef SCA_PropertyActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_PropertyActuator::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IActuator); -} - -PyObject* SCA_PropertyActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int SCA_PropertyActuator::py_setattro(PyObject *attr, PyObject *value) { - py_setattro_up(SCA_IActuator); -} - /* 1. setProperty */ const char SCA_PropertyActuator::SetProperty_doc[] = "setProperty(name)\n" @@ -322,7 +306,7 @@ const char SCA_PropertyActuator::GetProperty_doc[] = PyObject* SCA_PropertyActuator::PyGetProperty(PyObject* args, PyObject* kwds) { ShowDeprecationWarning("getProperty()", "the 'propName' property"); - return PyString_FromString(m_propname); + return PyUnicode_FromString(m_propname); } /* 3. setValue */ @@ -352,7 +336,7 @@ const char SCA_PropertyActuator::GetValue_doc[] = PyObject* SCA_PropertyActuator::PyGetValue(PyObject* args, PyObject* kwds) { ShowDeprecationWarning("getValue()", "the value property"); - return PyString_FromString(m_exprtxt); + return PyUnicode_FromString(m_exprtxt); } /* eof */ diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.h b/source/gameengine/GameLogic/SCA_PropertyActuator.h index a8df08dfc6e..8fb2e7a7bc5 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.h +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.h @@ -64,9 +64,7 @@ public: SCA_IObject* sourceObj, const STR_String& propname, const STR_String& expr, - int acttype, - PyTypeObject* T=&Type - ); + int acttype); ~SCA_PropertyActuator(); @@ -86,10 +84,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - // python wrapped methods KX_PYMETHOD_DOC(SCA_PropertyActuator,SetProperty); KX_PYMETHOD_DOC(SCA_PropertyActuator,GetProperty); diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index 3b343af3cba..6d2e1a0aca5 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -48,9 +48,8 @@ SCA_PropertySensor::SCA_PropertySensor(SCA_EventManager* eventmgr, const STR_String& propname, const STR_String& propval, const STR_String& propmaxval, - KX_PROPSENSOR_TYPE checktype, - PyTypeObject* T ) - : SCA_ISensor(gameobj,eventmgr,T), + KX_PROPSENSOR_TYPE checktype) + : SCA_ISensor(gameobj,eventmgr), m_checktype(checktype), m_checkpropval(propval), m_checkpropmaxval(propmaxval), @@ -319,19 +318,15 @@ PyTypeObject SCA_PropertySensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_PropertySensor::Parents[] = { - &SCA_PropertySensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_PropertySensor::Methods[] = { @@ -353,19 +348,6 @@ PyAttributeDef SCA_PropertySensor::Attributes[] = { { NULL } //Sentinel }; - -PyObject* SCA_PropertySensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_PropertySensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int SCA_PropertySensor::py_setattro(PyObject *attr, PyObject *value) { - py_setattro_up(SCA_ISensor); -} - /* 1. getType */ const char SCA_PropertySensor::GetType_doc[] = "getType()\n" @@ -373,7 +355,7 @@ const char SCA_PropertySensor::GetType_doc[] = PyObject* SCA_PropertySensor::PyGetType() { ShowDeprecationWarning("getType()", "the mode property"); - return PyInt_FromLong(m_checktype); + return PyLong_FromSsize_t(m_checktype); } /* 2. setType */ @@ -407,7 +389,7 @@ const char SCA_PropertySensor::GetProperty_doc[] = PyObject* SCA_PropertySensor::PyGetProperty() { ShowDeprecationWarning("getProperty()", "the 'propName' property"); - return PyString_FromString(m_checkpropname); + return PyUnicode_FromString(m_checkpropname); } /* 4. setProperty */ @@ -444,7 +426,7 @@ const char SCA_PropertySensor::GetValue_doc[] = PyObject* SCA_PropertySensor::PyGetValue() { ShowDeprecationWarning("getValue()", "the value property"); - return PyString_FromString(m_checkpropval); + return PyUnicode_FromString(m_checkpropval); } /* 6. setValue */ diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.h b/source/gameengine/GameLogic/SCA_PropertySensor.h index 538ecd65949..3513fcdf5ae 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.h +++ b/source/gameengine/GameLogic/SCA_PropertySensor.h @@ -67,8 +67,7 @@ public: const STR_String& propname, const STR_String& propval, const STR_String& propmaxval, - KX_PROPSENSOR_TYPE checktype, - PyTypeObject* T=&Type ); + KX_PROPSENSOR_TYPE checktype); /** * For property sensor, it is used to release the pre-calculated expression @@ -89,10 +88,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - /* 1. getType */ KX_PYMETHOD_DOC_NOARGS(SCA_PropertySensor,GetType); /* 2. setType */ diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 80e4f54c9c5..ffd95f00699 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -47,10 +47,8 @@ SCA_PythonController* SCA_PythonController::m_sCurrentController = NULL; -SCA_PythonController::SCA_PythonController(SCA_IObject* gameobj, - int mode, - PyTypeObject* T) - : SCA_IController(gameobj, T), +SCA_PythonController::SCA_PythonController(SCA_IObject* gameobj, int mode) + : SCA_IController(gameobj), m_bytecode(NULL), m_function(NULL), m_function_argc(0), @@ -150,7 +148,7 @@ void SCA_PythonController::SetDictionary(PyObject* pythondictionary) /* Without __file__ set the sys.argv[0] is used for the filename * which ends up with lines from the blender binary being printed in the console */ - PyDict_SetItemString(m_pythondictionary, "__file__", PyString_FromString(m_scriptName.Ptr())); + PyDict_SetItemString(m_pythondictionary, "__file__", PyUnicode_FromString(m_scriptName.Ptr())); } @@ -180,16 +178,16 @@ SCA_IActuator* SCA_PythonController::LinkedActuatorFromPy(PyObject *value) std::vector lacts = m_sCurrentController->GetLinkedActuators(); std::vector::iterator it; - if (PyString_Check(value)) { + if (PyUnicode_Check(value)) { /* get the actuator from the name */ - char *name= PyString_AsString(value); + char *name= _PyUnicode_AsString(value); for(it = lacts.begin(); it!= lacts.end(); ++it) { if( name == (*it)->GetName() ) { return *it; } } } - else if (BGE_PROXY_CHECK_TYPE(value)) { + else if (PyObject_TypeCheck(value, &SCA_IActuator::Type)) { PyObjectPlus *value_plus= BGE_PROXY_REF(value); for(it = lacts.begin(); it!= lacts.end(); ++it) { if( static_cast(value_plus) == (*it) ) { @@ -200,7 +198,7 @@ SCA_IActuator* SCA_PythonController::LinkedActuatorFromPy(PyObject *value) /* set the exception */ PyObject *value_str = PyObject_Repr(value); /* new ref */ - PyErr_Format(PyExc_ValueError, "'%s' not in this python controllers actuator list", PyString_AsString(value_str)); + PyErr_Format(PyExc_ValueError, "'%s' not in this python controllers actuator list", _PyUnicode_AsString(value_str)); Py_DECREF(value_str); return false; @@ -245,19 +243,17 @@ PyTypeObject SCA_PythonController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IController::Type, + 0,0,0,0,0,0, + py_base_new }; -PyParentObject SCA_PythonController::Parents[] = { - &SCA_PythonController::Type, - &SCA_IController::Type, - &CValue::Type, - NULL -}; PyMethodDef SCA_PythonController::Methods[] = { {"activate", (PyCFunction) SCA_PythonController::sPyActivate, METH_O}, {"deactivate", (PyCFunction) SCA_PythonController::sPyDeActivate, METH_O}, @@ -490,22 +486,6 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) m_sCurrentController = NULL; } - - -PyObject* SCA_PythonController::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IController); -} - -PyObject* SCA_PythonController::py_getattro_dict() { - py_getattro_dict_up(SCA_IController); -} - -int SCA_PythonController::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_IController); -} - PyObject* SCA_PythonController::PyActivate(PyObject *value) { if(m_sCurrentController != this) { @@ -540,13 +520,13 @@ PyObject* SCA_PythonController::PyDeActivate(PyObject *value) PyObject* SCA_PythonController::PyGetScript() { ShowDeprecationWarning("getScript()", "the script property"); - return PyString_FromString(m_scriptText); + return PyUnicode_FromString(m_scriptText); } /* 2. setScript */ PyObject* SCA_PythonController::PySetScript(PyObject* value) { - char *scriptArg = PyString_AsString(value); + char *scriptArg = _PyUnicode_AsString(value); ShowDeprecationWarning("setScript()", "the script property"); @@ -565,15 +545,20 @@ PyObject* SCA_PythonController::PySetScript(PyObject* value) PyObject* SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { + //SCA_PythonController* self= static_cast(static_cast(static_cast(static_cast(static_cast(self_v))))); + // static_cast(dynamic_cast(obj)) - static_cast(obj) + SCA_PythonController* self= static_cast(self_v); - return PyString_FromString(self->m_scriptText); + return PyUnicode_FromString(self->m_scriptText); } + + int SCA_PythonController::pyattr_set_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { SCA_PythonController* self= static_cast(self_v); - char *scriptArg = PyString_AsString(value); + char *scriptArg = _PyUnicode_AsString(value); if (scriptArg==NULL) { PyErr_SetString(PyExc_TypeError, "controller.script = string: Python Controller, expected a string script text"); diff --git a/source/gameengine/GameLogic/SCA_PythonController.h b/source/gameengine/GameLogic/SCA_PythonController.h index 0c2af79c3a3..9311b3f355e 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.h +++ b/source/gameengine/GameLogic/SCA_PythonController.h @@ -72,7 +72,7 @@ class SCA_PythonController : public SCA_IController //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, int mode, PyTypeObject* T = &Type); + SCA_PythonController(SCA_IObject* gameobj, int mode); virtual ~SCA_PythonController(); virtual CValue* GetReplica(); @@ -96,10 +96,6 @@ 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); diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index a722590dd10..e903d10f9a5 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -50,9 +50,8 @@ SCA_RandomActuator::SCA_RandomActuator(SCA_IObject *gameobj, SCA_RandomActuator::KX_RANDOMACT_MODE mode, float para1, float para2, - const STR_String &propName, - PyTypeObject* T) - : SCA_IActuator(gameobj, T), + const STR_String &propName) + : SCA_IActuator(gameobj), m_propname(propName), m_parameter1(para1), m_parameter2(para2), @@ -332,19 +331,15 @@ PyTypeObject SCA_RandomActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_RandomActuator::Parents[] = { - &SCA_RandomActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_RandomActuator::Methods[] = { @@ -384,14 +379,14 @@ PyAttributeDef SCA_RandomActuator::Attributes[] = { PyObject* SCA_RandomActuator::pyattr_get_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) { SCA_RandomActuator* act = static_cast(self); - return PyInt_FromLong(act->m_base->GetSeed()); + return PyLong_FromSsize_t(act->m_base->GetSeed()); } int SCA_RandomActuator::pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { SCA_RandomActuator* act = static_cast(self); - if (PyInt_Check(value)) { - int ival = PyInt_AsLong(value); + if (PyLong_Check(value)) { + int ival = PyLong_AsSsize_t(value); act->m_base->SetSeed(ival); return PY_SET_ATTR_SUCCESS; } else { @@ -400,19 +395,6 @@ int SCA_RandomActuator::pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_ } } -PyObject* SCA_RandomActuator::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IActuator); -} - -PyObject* SCA_RandomActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int SCA_RandomActuator::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_IActuator); -} - /* 1. setSeed */ const char SCA_RandomActuator::SetSeed_doc[] = "setSeed(seed)\n" @@ -439,7 +421,7 @@ const char SCA_RandomActuator::GetSeed_doc[] = PyObject* SCA_RandomActuator::PyGetSeed() { ShowDeprecationWarning("getSeed()", "the seed property"); - return PyInt_FromLong(m_base->GetSeed()); + return PyLong_FromSsize_t(m_base->GetSeed()); } /* 4. getPara1 */ @@ -473,7 +455,7 @@ const char SCA_RandomActuator::GetDistribution_doc[] = PyObject* SCA_RandomActuator::PyGetDistribution() { ShowDeprecationWarning("getDistribution()", "the distribution property"); - return PyInt_FromLong(m_distribution); + return PyLong_FromSsize_t(m_distribution); } /* 9. setProperty */ @@ -508,7 +490,7 @@ const char SCA_RandomActuator::GetProperty_doc[] = PyObject* SCA_RandomActuator::PyGetProperty() { ShowDeprecationWarning("getProperty()", "the 'propName' property"); - return PyString_FromString(m_propname); + return PyUnicode_FromString(m_propname); } /* 11. setBoolConst */ diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.h b/source/gameengine/GameLogic/SCA_RandomActuator.h index 59863589b60..c7d3fe21217 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.h +++ b/source/gameengine/GameLogic/SCA_RandomActuator.h @@ -85,8 +85,7 @@ class SCA_RandomActuator : public SCA_IActuator KX_RANDOMACT_MODE mode, float para1, float para2, - const STR_String &propName, - PyTypeObject* T=&Type); + const STR_String &propName); virtual ~SCA_RandomActuator(); virtual bool Update(); @@ -97,10 +96,6 @@ class SCA_RandomActuator : public SCA_IActuator /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - static PyObject* pyattr_get_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index d5cbeef01ae..e036a77707e 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -46,9 +46,8 @@ SCA_RandomSensor::SCA_RandomSensor(SCA_EventManager* eventmgr, SCA_IObject* gameobj, - int startseed, - PyTypeObject* T) - : SCA_ISensor(gameobj,eventmgr, T) + int startseed) + : SCA_ISensor(gameobj,eventmgr) { m_basegenerator = new SCA_RandomNumberGenerator(startseed); Init(); @@ -147,19 +146,15 @@ PyTypeObject SCA_RandomSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_RandomSensor::Parents[] = { - &SCA_RandomSensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_RandomSensor::Methods[] = { @@ -177,19 +172,6 @@ PyAttributeDef SCA_RandomSensor::Attributes[] = { {NULL} //Sentinel }; -PyObject* SCA_RandomSensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_ISensor); -} - -PyObject* SCA_RandomSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int SCA_RandomSensor::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_ISensor); -} - /* 1. setSeed */ const char SCA_RandomSensor::SetSeed_doc[] = "setSeed(seed)\n" @@ -216,7 +198,7 @@ const char SCA_RandomSensor::GetSeed_doc[] = "\tequal series.\n"; PyObject* SCA_RandomSensor::PyGetSeed() { ShowDeprecationWarning("getSeed()", "the seed property"); - return PyInt_FromLong(m_basegenerator->GetSeed()); + return PyLong_FromSsize_t(m_basegenerator->GetSeed()); } /* 3. getLastDraw */ @@ -225,24 +207,24 @@ const char SCA_RandomSensor::GetLastDraw_doc[] = "\tReturn the last value that was drawn.\n"; PyObject* SCA_RandomSensor::PyGetLastDraw() { ShowDeprecationWarning("getLastDraw()", "the lastDraw property"); - return PyInt_FromLong(m_lastdraw); + return PyLong_FromSsize_t(m_lastdraw); } PyObject* SCA_RandomSensor::pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_RandomSensor* self= static_cast(self_v); - return PyInt_FromLong(self->m_basegenerator->GetSeed()); + return PyLong_FromSsize_t(self->m_basegenerator->GetSeed()); } int SCA_RandomSensor::pyattr_set_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { SCA_RandomSensor* self= static_cast(self_v); - if (!PyInt_Check(value)) { + if (!PyLong_Check(value)) { PyErr_SetString(PyExc_TypeError, "sensor.seed = int: Random Sensor, expected an integer"); return PY_SET_ATTR_FAIL; } - self->m_basegenerator->SetSeed(PyInt_AsLong(value)); + self->m_basegenerator->SetSeed(PyLong_AsSsize_t(value)); return PY_SET_ATTR_SUCCESS; } diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.h b/source/gameengine/GameLogic/SCA_RandomSensor.h index b2bf2440966..5e66c36cccf 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.h +++ b/source/gameengine/GameLogic/SCA_RandomSensor.h @@ -48,8 +48,7 @@ class SCA_RandomSensor : public SCA_ISensor public: SCA_RandomSensor(class SCA_EventManager* rndmgr, SCA_IObject* gameobj, - int startseed, - PyTypeObject* T=&Type); + int startseed); virtual ~SCA_RandomSensor(); virtual CValue* GetReplica(); virtual void ProcessReplica(); @@ -61,10 +60,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - /* 1. setSeed */ KX_PYMETHOD_DOC_VARARGS(SCA_RandomSensor,SetSeed); /* 2. getSeed */ diff --git a/source/gameengine/GameLogic/SCA_XNORController.cpp b/source/gameengine/GameLogic/SCA_XNORController.cpp index aee8e26c21a..527adc70cc6 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.cpp +++ b/source/gameengine/GameLogic/SCA_XNORController.cpp @@ -42,10 +42,9 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ -SCA_XNORController::SCA_XNORController(SCA_IObject* gameobj, - PyTypeObject* T) +SCA_XNORController::SCA_XNORController(SCA_IObject* gameobj) : - SCA_IController(gameobj,T) + SCA_IController(gameobj) { } @@ -120,19 +119,15 @@ PyTypeObject SCA_XNORController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_XNORController::Parents[] = { - &SCA_XNORController::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IController::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_XNORController::Methods[] = { @@ -143,12 +138,4 @@ PyAttributeDef SCA_XNORController::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_XNORController::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IController); -} - -PyObject* SCA_XNORController::py_getattro_dict() { - py_getattro_dict_up(SCA_IController); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_XNORController.h b/source/gameengine/GameLogic/SCA_XNORController.h index 4aad5763cb0..18e77fae665 100644 --- a/source/gameengine/GameLogic/SCA_XNORController.h +++ b/source/gameengine/GameLogic/SCA_XNORController.h @@ -39,7 +39,7 @@ class SCA_XNORController : public SCA_IController Py_Header; //virtual void Trigger(class SCA_LogicManager* logicmgr); public: - SCA_XNORController(SCA_IObject* gameobj,PyTypeObject* T=&Type); + SCA_XNORController(SCA_IObject* gameobj); virtual ~SCA_XNORController(); virtual CValue* GetReplica(); virtual void Trigger(SCA_LogicManager* logicmgr); @@ -48,9 +48,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - }; #endif //__KX_XNORCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_XORController.cpp b/source/gameengine/GameLogic/SCA_XORController.cpp index 5afb3a750f5..c0916224fe6 100644 --- a/source/gameengine/GameLogic/SCA_XORController.cpp +++ b/source/gameengine/GameLogic/SCA_XORController.cpp @@ -42,10 +42,9 @@ /* Native functions */ /* ------------------------------------------------------------------------- */ -SCA_XORController::SCA_XORController(SCA_IObject* gameobj, - PyTypeObject* T) +SCA_XORController::SCA_XORController(SCA_IObject* gameobj) : - SCA_IController(gameobj,T) + SCA_IController(gameobj) { } @@ -120,19 +119,15 @@ PyTypeObject SCA_XORController::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject SCA_XORController::Parents[] = { - &SCA_XORController::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IController::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef SCA_XORController::Methods[] = { @@ -143,12 +138,4 @@ PyAttributeDef SCA_XORController::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_XORController::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IController); -} - -PyObject* SCA_XORController::py_getattro_dict() { - py_getattro_dict_up(SCA_IController); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_XORController.h b/source/gameengine/GameLogic/SCA_XORController.h index feb9f2ed07c..2607a533661 100644 --- a/source/gameengine/GameLogic/SCA_XORController.h +++ b/source/gameengine/GameLogic/SCA_XORController.h @@ -39,18 +39,10 @@ class SCA_XORController : public SCA_IController Py_Header; //virtual void Trigger(class SCA_LogicManager* logicmgr); public: - SCA_XORController(SCA_IObject* gameobj,PyTypeObject* T=&Type); + SCA_XORController(SCA_IObject* gameobj); virtual ~SCA_XORController(); virtual CValue* GetReplica(); virtual void Trigger(SCA_LogicManager* logicmgr); - - /* --------------------------------------------------------------------- */ - /* Python interface ---------------------------------------------------- */ - /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - }; #endif //__KX_XORCONTROLLER diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index c5c517c8a65..8bde5dd3a51 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -113,8 +113,8 @@ bool BL_Shader::Ok()const return (mShader !=0 && mOk && mUse); } -BL_Shader::BL_Shader(PyTypeObject *T) -: PyObjectPlus(T), +BL_Shader::BL_Shader() +: PyObjectPlus(), mShader(0), mPass(1), mOk(0), @@ -728,17 +728,6 @@ void BL_Shader::SetUniform(int uniform, const int* val, int len) } } - -PyObject* BL_Shader::py_getattro(PyObject *attr) -{ - py_getattro_up(PyObjectPlus); -} - -PyObject* BL_Shader::py_getattro_dict() { - py_getattro_dict_up(PyObjectPlus); -} - - PyMethodDef BL_Shader::Methods[] = { // creation @@ -792,21 +781,17 @@ PyTypeObject BL_Shader::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - - -PyParentObject BL_Shader::Parents[] = { - &BL_Shader::Type, - &PyObjectPlus::Type, - NULL + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &PyObjectPlus::Type, + 0,0,0,0,0,0, + py_base_new }; - KX_PYMETHODDEF_DOC( BL_Shader, setSource," setSource(vertexProgram, fragmentProgram)" ) { if(mShader !=0 && mOk ) @@ -848,17 +833,17 @@ KX_PYMETHODDEF_DOC( BL_Shader, delSource, "delSource( )" ) KX_PYMETHODDEF_DOC( BL_Shader, isValid, "isValid()" ) { - return PyInt_FromLong( ( mShader !=0 && mOk ) ); + return PyLong_FromSsize_t( ( mShader !=0 && mOk ) ); } KX_PYMETHODDEF_DOC( BL_Shader, getVertexProg ,"getVertexProg( )" ) { - return PyString_FromString(vertProg?vertProg:""); + return PyUnicode_FromString(vertProg?vertProg:""); } KX_PYMETHODDEF_DOC( BL_Shader, getFragmentProg ,"getFragmentProg( )" ) { - return PyString_FromString(fragProg?fragProg:""); + return PyUnicode_FromString(fragProg?fragProg:""); } KX_PYMETHODDEF_DOC( BL_Shader, validate, "validate()") @@ -1223,7 +1208,7 @@ KX_PYMETHODDEF_DOC( BL_Shader, setUniformiv, "setUniformiv( uniform_name, (list2 for(unsigned int i=0; (i // 1. SetToPropName PyObject* KX_NetworkMessageActuator::PySetToPropName( @@ -240,4 +223,4 @@ PyObject* KX_NetworkMessageActuator::PySetBody( Py_RETURN_NONE; } -// <----- Deprecated \ No newline at end of file +// <----- Deprecated diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h index cf92fd46fe0..b4f55f2a466 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h @@ -50,8 +50,7 @@ public: const STR_String &toPropName, const STR_String &subject, int bodyType, - const STR_String &body, - PyTypeObject* T=&Type); + const STR_String &body); virtual ~KX_NetworkMessageActuator(); virtual bool Update(); @@ -61,10 +60,6 @@ public: /* Python interface ------------------------------------------- */ /* ------------------------------------------------------------ */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - // Deprecated -----> KX_PYMETHOD(KX_NetworkMessageActuator, SetToPropName); KX_PYMETHOD(KX_NetworkMessageActuator, SetSubject); diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index 8ddcd87b66f..78dda1f6db7 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -50,10 +50,9 @@ KX_NetworkMessageSensor::KX_NetworkMessageSensor( class KX_NetworkEventManager* eventmgr, // our eventmanager class NG_NetworkScene *NetworkScene, // our scene SCA_IObject* gameobj, // the sensor controlling object - const STR_String &subject, - PyTypeObject* T + const STR_String &subject ) : - SCA_ISensor(gameobj,eventmgr,T), + SCA_ISensor(gameobj,eventmgr), m_Networkeventmgr(eventmgr), m_NetworkScene(NetworkScene), m_subject(subject), @@ -182,19 +181,15 @@ PyTypeObject KX_NetworkMessageSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_NetworkMessageSensor::Parents[] = { - &KX_NetworkMessageSensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_NetworkMessageSensor::Methods[] = { @@ -226,18 +221,6 @@ PyAttributeDef KX_NetworkMessageSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_NetworkMessageSensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_ISensor); -} - -PyObject* KX_NetworkMessageSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int KX_NetworkMessageSensor::py_setattro(PyObject *attr, PyObject *value) { - return SCA_ISensor::py_setattro(attr, value); -} - PyObject* KX_NetworkMessageSensor::pyattr_get_bodies(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_NetworkMessageSensor *self = static_cast(self_v); @@ -267,7 +250,7 @@ const char KX_NetworkMessageSensor::SetSubjectFilterText_doc[] = PyObject* KX_NetworkMessageSensor::PySetSubjectFilterText(PyObject* value) { ShowDeprecationWarning("setSubjectFilterText()", "subject"); - char* Subject = PyString_AsString(value); + char* Subject = _PyUnicode_AsString(value); if (Subject==NULL) { PyErr_SetString(PyExc_TypeError, "sensor.tsetSubjectFilterText(string): KX_NetworkMessageSensor, expected a string message"); return NULL; @@ -285,7 +268,7 @@ const char KX_NetworkMessageSensor::GetFrameMessageCount_doc[] = PyObject* KX_NetworkMessageSensor::PyGetFrameMessageCount() { ShowDeprecationWarning("getFrameMessageCount()", "frameMessageCount"); - return PyInt_FromLong(long(m_frame_message_count)); + return PyLong_FromSsize_t(long(m_frame_message_count)); } // 3. Get the message bodies @@ -311,7 +294,7 @@ const char KX_NetworkMessageSensor::GetSubject_doc[] = PyObject* KX_NetworkMessageSensor::PyGetSubject() { ShowDeprecationWarning("getSubject()", "subject"); - return PyString_FromString(m_subject ? m_subject : ""); + return PyUnicode_FromString(m_subject ? m_subject : ""); } // 5. Get the message subjects @@ -328,4 +311,4 @@ PyObject* KX_NetworkMessageSensor::PyGetSubjects() return (new CListValue())->NewProxy(true); } } -// <----- Deprecated \ No newline at end of file +// <----- Deprecated diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h index 53183f33826..ade87697303 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h @@ -57,8 +57,7 @@ public: KX_NetworkEventManager* eventmgr, // our eventmanager NG_NetworkScene *NetworkScene, // our scene SCA_IObject* gameobj, // the sensor controlling object - const STR_String &subject, - PyTypeObject* T=&Type + const STR_String &subject ); virtual ~KX_NetworkMessageSensor(); @@ -72,10 +71,6 @@ public: /* Python interface -------------------------------------------- */ /* ------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - // Deprecated -----> KX_PYMETHOD_DOC_O(KX_NetworkMessageSensor, SetSubjectFilterText); KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetFrameMessageCount); diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp index 30057fc039d..314becc702d 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp @@ -42,10 +42,8 @@ BL_BlenderShader *KX_BlenderMaterial::mLastBlenderShader = NULL; //static PyObject *gTextureDict = 0; -KX_BlenderMaterial::KX_BlenderMaterial( - PyTypeObject *T - ) -: PyObjectPlus(T), +KX_BlenderMaterial::KX_BlenderMaterial() +: PyObjectPlus(), RAS_IPolyMaterial(), mMaterial(NULL), mShader(0), @@ -813,36 +811,17 @@ PyTypeObject KX_BlenderMaterial::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - - -PyParentObject KX_BlenderMaterial::Parents[] = { - &KX_BlenderMaterial::Type, - &PyObjectPlus::Type, - NULL + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &PyObjectPlus::Type, + 0,0,0,0,0,0, + py_base_new }; - -PyObject* KX_BlenderMaterial::py_getattro(PyObject *attr) -{ - py_getattro_up(PyObjectPlus); -} - -PyObject* KX_BlenderMaterial::py_getattro_dict() { - py_getattro_dict_up(PyObjectPlus); -} - -int KX_BlenderMaterial::py_setattro(PyObject *attr, PyObject *pyvalue) -{ - return PyObjectPlus::py_setattro(attr, pyvalue); -} - - KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getShader , "getShader()") { if( !GLEW_ARB_fragment_shader) { @@ -912,7 +891,7 @@ void KX_BlenderMaterial::SetBlenderGLSLShader(int layer) KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getMaterialIndex, "getMaterialIndex()") { - return PyInt_FromLong( GetMaterialIndex() ); + return PyLong_FromSsize_t( GetMaterialIndex() ); } KX_PYMETHODDEF_DOC( KX_BlenderMaterial, getTexture, "getTexture( index )" ) diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index b29f2df98db..1f5edc1d7d1 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -23,9 +23,7 @@ class KX_BlenderMaterial : public PyObjectPlus, public RAS_IPolyMaterial Py_Header; public: // -------------------------------- - KX_BlenderMaterial( - PyTypeObject* T=&Type - ); + KX_BlenderMaterial(); void Initialize( class KX_Scene* scene, BL_Material* mat, @@ -83,10 +81,7 @@ public: ); // -------------------------------- - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *pyvalue); - virtual PyObject* py_repr(void) { return PyString_FromString(mMaterial->matname.ReadPtr()); } + virtual PyObject* py_repr(void) { return PyUnicode_FromString(mMaterial->matname.ReadPtr()); } KX_PYMETHOD_DOC( KX_BlenderMaterial, getShader ); KX_PYMETHOD_DOC( KX_BlenderMaterial, getMaterialIndex ); diff --git a/source/gameengine/Ketsji/KX_CDActuator.cpp b/source/gameengine/Ketsji/KX_CDActuator.cpp index 8511526fd5f..bfca81f45d9 100644 --- a/source/gameengine/Ketsji/KX_CDActuator.cpp +++ b/source/gameengine/Ketsji/KX_CDActuator.cpp @@ -48,9 +48,8 @@ KX_CDActuator::KX_CDActuator(SCA_IObject* gameobject, KX_CDACT_TYPE type, int track, short start, - short end, - PyTypeObject* T) - : SCA_IActuator(gameobject,T) + short end) + : SCA_IActuator(gameobject) { m_soundscene = soundscene; m_type = type; @@ -171,25 +170,17 @@ PyTypeObject KX_CDActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject KX_CDActuator::Parents[] = { - &KX_CDActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; - - PyMethodDef KX_CDActuator::Methods[] = { // Deprecated -----> {"setGain",(PyCFunction) KX_CDActuator::sPySetGain,METH_VARARGS,NULL}, @@ -217,22 +208,6 @@ int KX_CDActuator::pyattr_setGain(void *self, const struct KX_PYATTRIBUTE_DEF *a return PY_SET_ATTR_SUCCESS; } -PyObject* KX_CDActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_CDActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_CDActuator::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_IActuator); -} - - - KX_PYMETHODDEF_DOC_NOARGS(KX_CDActuator, startCD, "startCD()\n" "\tStarts the CD playing.\n") @@ -273,8 +248,8 @@ KX_PYMETHODDEF_DOC_O(KX_CDActuator, playTrack, "playTrack(trackNumber)\n" "\tPlays the track selected.\n") { - if (PyInt_Check(value)) { - int track = PyInt_AsLong(value); + if (PyLong_Check(value)) { + int track = PyLong_AsSsize_t(value); SND_CDObject::Instance()->SetPlaymode(SND_CD_TRACK); SND_CDObject::Instance()->SetTrack(track); SND_CDObject::Instance()->SetPlaystate(SND_MUST_PLAY); diff --git a/source/gameengine/Ketsji/KX_CDActuator.h b/source/gameengine/Ketsji/KX_CDActuator.h index 2fd05ab72e5..b01ad73777e 100644 --- a/source/gameengine/Ketsji/KX_CDActuator.h +++ b/source/gameengine/Ketsji/KX_CDActuator.h @@ -68,8 +68,7 @@ public: KX_CDACT_TYPE type, int track, short start, - short end, - PyTypeObject* T=&Type); + short end); ~KX_CDActuator(); @@ -81,10 +80,6 @@ public: /* Python interface --------------------------------------------------- */ /* -------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - // Deprecated -----> KX_PYMETHOD_VARARGS(KX_CDActuator,SetGain); KX_PYMETHOD_VARARGS(KX_CDActuator,GetGain); diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 40f6c99c03c..f762699f780 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -42,10 +42,9 @@ KX_Camera::KX_Camera(void* sgReplicationInfo, SG_Callbacks callbacks, const RAS_CameraData& camdata, bool frustum_culling, - bool delete_node, - PyTypeObject *T) + bool delete_node) : - KX_GameObject(sgReplicationInfo,callbacks,T), + KX_GameObject(sgReplicationInfo,callbacks), m_camdata(camdata), m_dirty(true), m_normalized(false), @@ -551,41 +550,19 @@ PyTypeObject KX_Camera::Type = { &KX_GameObject::Sequence, &KX_GameObject::Mapping, 0,0,0, - py_base_getattro, - py_base_setattro, + NULL, + NULL, 0, - Py_TPFLAGS_DEFAULT, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, - Methods -}; - - - - - - -PyParentObject KX_Camera::Parents[] = { - &KX_Camera::Type, - &KX_GameObject::Type, - &SCA_IObject::Type, - &CValue::Type, - NULL + Methods, + 0, + 0, + &KX_GameObject::Type, + 0,0,0,0,0,0, + py_base_new }; -PyObject* KX_Camera::py_getattro(PyObject *attr) -{ - py_getattro_up(KX_GameObject); -} - -PyObject* KX_Camera::py_getattro_dict() { - py_getattro_dict_up(KX_GameObject); -} - -int KX_Camera::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(KX_GameObject); -} - KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, sphereInsideFrustum, "sphereInsideFrustum(center, radius) -> Integer\n" "\treturns INSIDE, OUTSIDE or INTERSECT if the given sphere is\n" @@ -611,7 +588,7 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, sphereInsideFrustum, MT_Point3 center; if (PyVecTo(pycenter, center)) { - return PyInt_FromLong(SphereInsideFrustum(center, radius)); /* new ref */ + return PyLong_FromSsize_t(SphereInsideFrustum(center, radius)); /* new ref */ } } @@ -662,7 +639,7 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, boxInsideFrustum, return NULL; } - return PyInt_FromLong(BoxInsideFrustum(box)); /* new ref */ + return PyLong_FromSsize_t(BoxInsideFrustum(box)); /* new ref */ } KX_PYMETHODDEF_DOC_O(KX_Camera, pointInsideFrustum, @@ -684,7 +661,7 @@ KX_PYMETHODDEF_DOC_O(KX_Camera, pointInsideFrustum, MT_Point3 point; if (PyVecTo(value, point)) { - return PyInt_FromLong(PointInsideFrustum(point)); /* new ref */ + return PyLong_FromSsize_t(PointInsideFrustum(point)); /* new ref */ } PyErr_SetString(PyExc_TypeError, "camera.pointInsideFrustum(point): KX_Camera, expected point argument."); @@ -952,11 +929,11 @@ PyObject* KX_Camera::pyattr_get_world_to_camera(void *self_v, const KX_PYATTRIBU PyObject* KX_Camera::pyattr_get_INSIDE(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) -{ return PyInt_FromLong(INSIDE); } +{ return PyLong_FromSsize_t(INSIDE); } PyObject* KX_Camera::pyattr_get_OUTSIDE(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) -{ return PyInt_FromLong(OUTSIDE); } +{ return PyLong_FromSsize_t(OUTSIDE); } PyObject* KX_Camera::pyattr_get_INTERSECT(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) -{ return PyInt_FromLong(INTERSECT); } +{ return PyLong_FromSsize_t(INTERSECT); } bool ConvertPythonToCamera(PyObject * value, KX_Camera **object, bool py_none_ok, const char *error_prefix) @@ -978,14 +955,14 @@ bool ConvertPythonToCamera(PyObject * value, KX_Camera **object, bool py_none_ok } } - if (PyString_Check(value)) { - STR_String value_str = PyString_AsString(value); + if (PyUnicode_Check(value)) { + STR_String value_str = _PyUnicode_AsString(value); *object = KX_GetActiveScene()->FindCamera(value_str); if (*object) { return true; } else { - PyErr_Format(PyExc_ValueError, "%s, requested name \"%s\" did not match any KX_Camera in this scene", error_prefix, PyString_AsString(value)); + PyErr_Format(PyExc_ValueError, "%s, requested name \"%s\" did not match any KX_Camera in this scene", error_prefix, _PyUnicode_AsString(value)); return false; } } @@ -1142,7 +1119,7 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenRay, PyTuple_SET_ITEM(argValue, 0, PyObjectFrom(vect)); PyTuple_SET_ITEM(argValue, 1, PyFloat_FromDouble(dist)); if (propName) - PyTuple_SET_ITEM(argValue, 2, PyString_FromString(propName)); + PyTuple_SET_ITEM(argValue, 2, PyUnicode_FromString(propName)); PyObject* ret= this->PyrayCastTo(argValue,NULL); Py_DECREF(argValue); diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index aef21cd91e4..74c8e6d4e4f 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -143,7 +143,7 @@ public: enum { INSIDE, INTERSECT, OUTSIDE } ; - KX_Camera(void* sgReplicationInfo,SG_Callbacks callbacks,const RAS_CameraData& camdata, bool frustum_culling = true, bool delete_node = false, PyTypeObject *T = &Type); + KX_Camera(void* sgReplicationInfo,SG_Callbacks callbacks,const RAS_CameraData& camdata, bool frustum_culling = true, bool delete_node = false); virtual ~KX_Camera(); /** @@ -265,6 +265,7 @@ public: */ int GetViewportTop() const; + virtual int GetGameObjectType() { return OBJ_CAMERA; } KX_PYMETHOD_DOC_VARARGS(KX_Camera, sphereInsideFrustum); KX_PYMETHOD_DOC_O(KX_Camera, boxInsideFrustum); @@ -282,10 +283,6 @@ public: KX_PYMETHOD_DOC_O(KX_Camera, getScreenPosition); KX_PYMETHOD_DOC_VARARGS(KX_Camera, getScreenVect); KX_PYMETHOD_DOC_VARARGS(KX_Camera, getScreenRay); - - virtual PyObject* py_getattro(PyObject *attr); /* lens, near, far, projection_matrix */ - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *pyvalue); static PyObject* pyattr_get_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index f8557dac2c4..3d3b68ed85d 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -56,10 +56,9 @@ KX_CameraActuator::KX_CameraActuator( float hght, float minhght, float maxhght, - bool xytog, - PyTypeObject* T + bool xytog ): - SCA_IActuator(gameobj, T), + SCA_IActuator(gameobj), m_ob (obj), m_height (hght), m_minHeight (minhght), @@ -385,19 +384,15 @@ PyTypeObject KX_CameraActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_CameraActuator::Parents[] = { - &KX_CameraActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_CameraActuator::Methods[] = { @@ -424,18 +419,6 @@ PyAttributeDef KX_CameraActuator::Attributes[] = { {NULL} }; -PyObject* KX_CameraActuator::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_CameraActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_CameraActuator::py_setattro(PyObject *attr, PyObject* value) { - py_setattro_up(SCA_IActuator); -} - /* get obj ---------------------------------------------------------- */ const char KX_CameraActuator::GetObject_doc[] = "getObject(name_only = 1)\n" @@ -454,7 +437,7 @@ PyObject* KX_CameraActuator::PyGetObject(PyObject* args) Py_RETURN_NONE; if (ret_name_only) - return PyString_FromString(m_ob->GetName().ReadPtr()); + return PyUnicode_FromString(m_ob->GetName().ReadPtr()); else return m_ob->GetProxy(); } @@ -579,7 +562,7 @@ const char KX_CameraActuator::GetXY_doc[] = PyObject* KX_CameraActuator::PyGetXY() { ShowDeprecationWarning("getXY()", "the xy property"); - return PyInt_FromLong(m_x); + return PyLong_FromSsize_t(m_x); } PyObject* KX_CameraActuator::pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) diff --git a/source/gameengine/Ketsji/KX_CameraActuator.h b/source/gameengine/Ketsji/KX_CameraActuator.h index efa4e2f38d7..057c6fed770 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.h +++ b/source/gameengine/Ketsji/KX_CameraActuator.h @@ -91,9 +91,7 @@ private : float hght, float minhght, float maxhght, - bool xytog, - PyTypeObject* T=&Type - + bool xytog ); @@ -120,10 +118,6 @@ private : /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); - /* set object to look at */ KX_PYMETHOD_DOC_O(KX_CameraActuator,SetObject); /* get current object */ diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index bd03dea486b..d09eae647c8 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -54,9 +54,8 @@ KX_ConstraintActuator::KX_ConstraintActuator(SCA_IObject *gameobj, int locrotxyz, int time, int option, - char *property, - PyTypeObject* T) : - SCA_IActuator(gameobj, T), + char *property) : + SCA_IActuator(gameobj), m_refDirVector(refDir), m_currentTime(0) { @@ -581,19 +580,15 @@ PyTypeObject KX_ConstraintActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_ConstraintActuator::Parents[] = { - &KX_ConstraintActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_ConstraintActuator::Methods[] = { @@ -639,21 +634,6 @@ PyAttributeDef KX_ConstraintActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_ConstraintActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_ConstraintActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_ConstraintActuator::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(SCA_IActuator); -} - - int KX_ConstraintActuator::pyattr_check_direction(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) { KX_ConstraintActuator* act = static_cast(self); @@ -691,7 +671,7 @@ const char KX_ConstraintActuator::GetDamp_doc[] = "\tReturns the damping parameter.\n"; PyObject* KX_ConstraintActuator::PyGetDamp(){ ShowDeprecationWarning("getDamp()", "the damp property"); - return PyInt_FromLong(m_posDampTime); + return PyLong_FromSsize_t(m_posDampTime); } /* 2. setRotDamp */ @@ -718,7 +698,7 @@ const char KX_ConstraintActuator::GetRotDamp_doc[] = "\tReturns the damping time for application of the constraint.\n"; PyObject* KX_ConstraintActuator::PyGetRotDamp(){ ShowDeprecationWarning("getRotDamp()", "the rotDamp property"); - return PyInt_FromLong(m_rotDampTime); + return PyLong_FromSsize_t(m_rotDampTime); } /* 2. setDirection */ @@ -791,7 +771,7 @@ const char KX_ConstraintActuator::GetOption_doc[] = "\tReturns the option parameter.\n"; PyObject* KX_ConstraintActuator::PyGetOption(){ ShowDeprecationWarning("getOption()", "the option property"); - return PyInt_FromLong(m_option); + return PyLong_FromSsize_t(m_option); } /* 2. setTime */ @@ -820,7 +800,7 @@ const char KX_ConstraintActuator::GetTime_doc[] = "\tReturns the time parameter.\n"; PyObject* KX_ConstraintActuator::PyGetTime(){ ShowDeprecationWarning("getTime()", "the time property"); - return PyInt_FromLong(m_activeTime); + return PyLong_FromSsize_t(m_activeTime); } /* 2. setProperty */ @@ -849,7 +829,7 @@ const char KX_ConstraintActuator::GetProperty_doc[] = "\tReturns the property parameter.\n"; PyObject* KX_ConstraintActuator::PyGetProperty(){ ShowDeprecationWarning("getProperty()", "the 'property' property"); - return PyString_FromString(m_property.Ptr()); + return PyUnicode_FromString(m_property.Ptr()); } /* 4. setDistance */ @@ -978,7 +958,7 @@ const char KX_ConstraintActuator::GetLimit_doc[] = "\tReturns the type of constraint.\n"; PyObject* KX_ConstraintActuator::PyGetLimit() { ShowDeprecationWarning("setLimit()", "the limit property"); - return PyInt_FromLong(m_locrot); + return PyLong_FromSsize_t(m_locrot); } /* eof */ diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.h b/source/gameengine/Ketsji/KX_ConstraintActuator.h index 40607b44947..677904aedc9 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.h +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.h @@ -126,8 +126,7 @@ protected: int locrot, int time, int option, - char *property, - PyTypeObject* T=&Type); + char *property); virtual ~KX_ConstraintActuator(); virtual CValue* GetReplica() { KX_ConstraintActuator* replica = new KX_ConstraintActuator(*this); @@ -141,10 +140,6 @@ protected: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); - static int pyattr_check_direction(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_check_min(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp index c5cf67af67d..ec7bb470235 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp @@ -38,8 +38,8 @@ KX_ConstraintWrapper::KX_ConstraintWrapper( PHY_ConstraintType ctype, int constraintId, - PHY_IPhysicsEnvironment* physenv,PyTypeObject *T) : - PyObjectPlus(T), + PHY_IPhysicsEnvironment* physenv) : + PyObjectPlus(), m_constraintId(constraintId), m_constraintType(ctype), m_physenv(physenv) @@ -51,7 +51,7 @@ KX_ConstraintWrapper::~KX_ConstraintWrapper() PyObject* KX_ConstraintWrapper::PyGetConstraintId() { - return PyInt_FromLong(m_constraintId); + return PyLong_FromSsize_t(m_constraintId); } @@ -99,37 +99,17 @@ PyTypeObject KX_ConstraintWrapper::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_ConstraintWrapper::Parents[] = { - &KX_ConstraintWrapper::Type, - NULL -}; - -//here you can search for existing data members (like mass,friction etc.) -PyObject* KX_ConstraintWrapper::py_getattro(PyObject *attr) -{ - py_getattro_up(PyObjectPlus); -} - -PyObject* KX_ConstraintWrapper::py_getattro_dict() { - py_getattro_dict_up(PyObjectPlus); -} - -int KX_ConstraintWrapper::py_setattro(PyObject *attr,PyObject* value) -{ - py_setattro_up(PyObjectPlus); + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &PyObjectPlus::Type, + 0,0,0,0,0,0, + py_base_new }; - - - - PyMethodDef KX_ConstraintWrapper::Methods[] = { {"getConstraintId",(PyCFunction) KX_ConstraintWrapper::sPyGetConstraintId, METH_NOARGS}, {"setParam",(PyCFunction) KX_ConstraintWrapper::sPySetParam, METH_VARARGS}, diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.h b/source/gameengine/Ketsji/KX_ConstraintWrapper.h index 03813e0f167..74670944415 100644 --- a/source/gameengine/Ketsji/KX_ConstraintWrapper.h +++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.h @@ -35,11 +35,8 @@ class KX_ConstraintWrapper : public PyObjectPlus { Py_Header; - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); public: - KX_ConstraintWrapper(PHY_ConstraintType ctype,int constraintId,class PHY_IPhysicsEnvironment* physenv,PyTypeObject *T = &Type); + KX_ConstraintWrapper(PHY_ConstraintType ctype,int constraintId,class PHY_IPhysicsEnvironment* physenv); virtual ~KX_ConstraintWrapper (); int getConstraintId() { return m_constraintId;}; diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index 28bf12f5e87..560c7fa4bb4 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -49,9 +49,8 @@ KX_GameActuator::KX_GameActuator(SCA_IObject *gameobj, const STR_String& filename, const STR_String& loadinganimationname, KX_Scene* scene, - KX_KetsjiEngine* ketsjiengine, - PyTypeObject* T) - : SCA_IActuator(gameobj, T) + KX_KetsjiEngine* ketsjiengine) + : SCA_IActuator(gameobj) { m_mode = mode; m_filename = filename; @@ -224,26 +223,17 @@ PyTypeObject KX_GameActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject KX_GameActuator::Parents[] = -{ - &KX_GameActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; - - PyMethodDef KX_GameActuator::Methods[] = { // Deprecated -----> @@ -259,21 +249,6 @@ PyAttributeDef KX_GameActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_GameActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_GameActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_GameActuator::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_IActuator); -} - - // Deprecated -----> /* getFile */ const char KX_GameActuator::GetFile_doc[] = @@ -282,7 +257,7 @@ const char KX_GameActuator::GetFile_doc[] = PyObject* KX_GameActuator::PyGetFile(PyObject* args, PyObject* kwds) { ShowDeprecationWarning("getFile()", "the fileName property"); - return PyString_FromString(m_filename); + return PyUnicode_FromString(m_filename); } /* setFile */ diff --git a/source/gameengine/Ketsji/KX_GameActuator.h b/source/gameengine/Ketsji/KX_GameActuator.h index b2b1d6ec2b9..cabbf827b40 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.h +++ b/source/gameengine/Ketsji/KX_GameActuator.h @@ -65,8 +65,7 @@ protected: const STR_String& filename, const STR_String& loadinganimationname, KX_Scene* scene, - KX_KetsjiEngine* ketsjiEngine, - PyTypeObject* T=&Type); + KX_KetsjiEngine* ketsjiEngine); virtual ~KX_GameActuator(); virtual CValue* GetReplica(); @@ -77,10 +76,6 @@ protected: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - // Deprecated functions -----> KX_PYMETHOD_DOC(KX_GameActuator,GetFile); KX_PYMETHOD_DOC(KX_GameActuator,SetFile); diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 577f767b475..bf80eec36d9 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -86,10 +86,8 @@ static MT_Matrix3x3 dummy_orientation = MT_Matrix3x3( 1.0, 0.0, 0.0, KX_GameObject::KX_GameObject( void* sgReplicationInfo, - SG_Callbacks callbacks, - PyTypeObject* T -) : - SCA_IObject(T), + SG_Callbacks callbacks) + : SCA_IObject(), m_bDyna(false), m_layer(0), m_pBlenderObject(NULL), @@ -1498,7 +1496,7 @@ PyObject* KX_GameObject::PyGetPosition() static PyObject *Map_GetItem(PyObject *self_v, PyObject *item) { KX_GameObject* self= static_castBGE_PROXY_REF(self_v); - const char *attr_str= PyString_AsString(item); + const char *attr_str= _PyUnicode_AsString(item); CValue* resultattr; PyObject* pyconvert; @@ -1532,7 +1530,7 @@ static PyObject *Map_GetItem(PyObject *self_v, PyObject *item) static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) { KX_GameObject* self= static_castBGE_PROXY_REF(self_v); - const char *attr_str= PyString_AsString(key); + const char *attr_str= _PyUnicode_AsString(key); if(attr_str==NULL) PyErr_Clear(); @@ -1564,7 +1562,7 @@ static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) int set= 0; /* as CValue */ - if(attr_str && BGE_PROXY_CHECK_TYPE(val)==0) /* dont allow GameObjects for eg to be assigned to CValue props */ + if(attr_str && PyObject_TypeCheck(val, &PyObjectPlus::Type)==0) /* dont allow GameObjects for eg to be assigned to CValue props */ { CValue* vallie = self->ConvertPythonToValue(val, ""); /* error unused */ @@ -1626,7 +1624,7 @@ static int Seq_Contains(PyObject *self_v, PyObject *value) return -1; } - if(PyString_Check(value) && self->GetProperty(PyString_AsString(value))) + if(PyUnicode_Check(value) && self->GetProperty(_PyUnicode_AsString(value))) return 1; if (self->m_attr_dict && PyDict_GetItem(self->m_attr_dict, value)) @@ -1674,30 +1672,23 @@ PyTypeObject KX_GameObject::Type = { &Sequence, &Mapping, 0,0,0, - py_base_getattro, - py_base_setattro, + NULL, + NULL, 0, - Py_TPFLAGS_DEFAULT, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, - Methods -}; - - - - - - -PyParentObject KX_GameObject::Parents[] = { - &KX_GameObject::Type, + Methods, + 0, + 0, &SCA_IObject::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyObject* KX_GameObject::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_GameObject* self= static_cast(self_v); - return PyString_FromString(self->GetName().ReadPtr()); + return PyUnicode_FromString(self->GetName().ReadPtr()); } PyObject* KX_GameObject::pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -1922,7 +1913,7 @@ PyObject* KX_GameObject::pyattr_get_localScaling(void *self_v, const KX_PYATTRIB #ifdef USE_MATHUTILS return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_LOCAL); #else - return PyObjectFrom(self->NodeGetLocalScale()); + return PyObjectFrom(self->NodeGetLocalScaling()); #endif } @@ -1970,13 +1961,13 @@ PyObject* KX_GameObject::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF KX_GameObject* self= static_cast(self_v); int state = 0; state |= self->GetState(); - return PyInt_FromLong(state); + return PyLong_FromSsize_t(state); } int KX_GameObject::pyattr_set_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { KX_GameObject* self= static_cast(self_v); - int state_i = PyInt_AsLong(value); + int state_i = PyLong_AsSsize_t(value); unsigned int state = 0; if (state_i == -1 && PyErr_Occurred()) { @@ -2047,128 +2038,6 @@ PyObject* KX_GameObject::pyattr_get_attrDict(void *self_v, const KX_PYATTRIBUTE_ return self->m_attr_dict; } -/* We need these because the macros have a return in them */ -PyObject* KX_GameObject::py_getattro__internal(PyObject *attr) -{ - py_getattro_up(SCA_IObject); -} - -int KX_GameObject::py_setattro__internal(PyObject *attr, PyObject *value) // py_setattro method -{ - py_setattro_up(SCA_IObject); -} - - -PyObject* KX_GameObject::py_getattro(PyObject *attr) -{ - PyObject *object= py_getattro__internal(attr); - - if (object==NULL && m_attr_dict) - { - /* backup the exception incase the attr doesnt exist in the dict either */ - PyObject *err_type, *err_value, *err_tb; - PyErr_Fetch(&err_type, &err_value, &err_tb); - - object= PyDict_GetItem(m_attr_dict, attr); - if (object) { - Py_INCREF(object); - - PyErr_Clear(); - Py_XDECREF( err_type ); - Py_XDECREF( err_value ); - Py_XDECREF( err_tb ); - } - else { - PyErr_Restore(err_type, err_value, err_tb); /* use the error from the parent function */ - } - } - return object; -} - -PyObject* KX_GameObject::py_getattro_dict() { - //py_getattro_dict_up(SCA_IObject); - PyObject *dict= py_getattr_dict(SCA_IObject::py_getattro_dict(), Type.tp_dict); - if(dict==NULL) - return NULL; - - /* normally just return this but KX_GameObject has some more items */ - - - /* Not super fast getting as a list then making into dict keys but its only for dir() */ - PyObject *list= ConvertKeysToPython(); - if(list) - { - int i; - for(i=0; iGetUserData(); } - return PyInt_FromLong((long)physid); + return PyLong_FromSsize_t((long)physid); } PyObject* KX_GameObject::PyGetPropertyNames() @@ -3008,8 +2877,8 @@ PyObject* KX_GameObject::Pyget(PyObject *args) return NULL; - if(PyString_Check(key)) { - CValue *item = GetProperty(PyString_AsString(key)); + if(PyUnicode_Check(key)) { + CValue *item = GetProperty(_PyUnicode_AsString(key)); if (item) { ret = item->ConvertValueToPython(); if(ret) @@ -3078,13 +2947,13 @@ bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py } } - if (PyString_Check(value)) { - *object = (KX_GameObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String( PyString_AsString(value) )); + if (PyUnicode_Check(value)) { + *object = (KX_GameObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String( _PyUnicode_AsString(value) )); if (*object) { return true; } else { - PyErr_Format(PyExc_ValueError, "%s, requested name \"%s\" did not match any KX_GameObject in this scene", error_prefix, PyString_AsString(value)); + PyErr_Format(PyExc_ValueError, "%s, requested name \"%s\" did not match any KX_GameObject in this scene", error_prefix, _PyUnicode_AsString(value)); return false; } } diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 8fa2b3180ef..40f05dddada 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -185,8 +185,7 @@ public: KX_GameObject( void* sgReplicationInfo, - SG_Callbacks callbacks, - PyTypeObject* T=&Type + SG_Callbacks callbacks ); virtual @@ -804,22 +803,10 @@ public: /** * @section Python interface functions. */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); // py_setattro method - virtual int py_delattro(PyObject *attr); virtual PyObject* py_repr(void) { - return PyString_FromString(GetName().ReadPtr()); + return PyUnicode_FromString(GetName().ReadPtr()); } - - - /* quite annoying that we need these but the bloody - * py_getattro_up and py_setattro_up macro's have a returns in them! */ - PyObject* py_getattro__internal(PyObject *attr); - int py_setattro__internal(PyObject *attr, PyObject *value); // py_setattro method - KX_PYMETHOD_NOARGS(KX_GameObject,GetPosition); KX_PYMETHOD_O(KX_GameObject,SetPosition); diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index 3ec0598ac03..73a370a1681 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -70,9 +70,8 @@ KX_IpoActuator::KX_IpoActuator(SCA_IObject* gameobj, int acttype, bool ipo_as_force, bool ipo_add, - bool ipo_local, - PyTypeObject* T) - : SCA_IActuator(gameobj,T), + bool ipo_local) + : SCA_IActuator(gameobj), m_bNegativeEvent(false), m_startframe (starttime), m_endframe(endtime), @@ -429,19 +428,15 @@ PyTypeObject KX_IpoActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_IpoActuator::Parents[] = { - &KX_IpoActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_IpoActuator::Methods[] = { @@ -477,18 +472,6 @@ PyAttributeDef KX_IpoActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_IpoActuator::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_IpoActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_IpoActuator::py_setattro(PyObject *attr, PyObject *value) // py_setattro method -{ - py_setattro_up(SCA_IActuator); -} /* set --------------------------------------------------------------------- */ const char KX_IpoActuator::Set_doc[] = @@ -689,7 +672,7 @@ const char KX_IpoActuator::GetType_doc[] = "\tReturns the operation mode of the actuator.\n"; PyObject* KX_IpoActuator::PyGetType() { ShowDeprecationWarning("getType()", "the mode property"); - return PyInt_FromLong(m_type); + return PyLong_FromSsize_t(m_type); } /* 10. setForceIpoActsLocal: */ diff --git a/source/gameengine/Ketsji/KX_IpoActuator.h b/source/gameengine/Ketsji/KX_IpoActuator.h index 9ea597def1e..01051ca82dc 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.h +++ b/source/gameengine/Ketsji/KX_IpoActuator.h @@ -121,8 +121,7 @@ public: int acttype, bool ipo_as_force, bool ipo_add, - bool ipo_local, - PyTypeObject* T=&Type); + bool ipo_local); virtual ~KX_IpoActuator() {}; virtual CValue* GetReplica() { @@ -138,10 +137,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); //KX_PYMETHOD_DOC KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,Set); diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index ae9e097a96e..fb385f8a9a2 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -51,12 +51,9 @@ KX_LightObject::KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks, class RAS_IRenderTools* rendertools, const RAS_LightObject& lightobj, - bool glsl, - PyTypeObject* T - ) - : - KX_GameObject(sgReplicationInfo,callbacks,T), - m_rendertools(rendertools) + bool glsl) + : KX_GameObject(sgReplicationInfo,callbacks), + m_rendertools(rendertools) { m_lightobj = lightobj; m_lightobj.m_scene = sgReplicationInfo; @@ -271,11 +268,6 @@ void KX_LightObject::UnbindShadowBuffer(RAS_IRasterizer *ras) /* Python Integration Hooks */ /* ------------------------------------------------------------------------- */ -PyObject* KX_LightObject::py_getattro_dict() { - py_getattro_dict_up(KX_GameObject); -} - - PyTypeObject KX_LightObject::Type = { #if (PY_VERSION_HEX >= 0x02060000) PyVarObject_HEAD_INIT(NULL, 0) @@ -297,20 +289,17 @@ PyTypeObject KX_LightObject::Type = { &KX_GameObject::Sequence, &KX_GameObject::Mapping, 0,0,0, - py_base_getattro, - py_base_setattro, + NULL, + NULL, 0, - Py_TPFLAGS_DEFAULT, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_LightObject::Parents[] = { - &KX_LightObject::Type, - &KX_GameObject::Type, - &SCA_IObject::Type, - &CValue::Type, - NULL + Methods, + 0, + 0, + &KX_GameObject::Type, + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_LightObject::Methods[] = { @@ -362,11 +351,11 @@ PyObject* KX_LightObject::pyattr_get_typeconst(void *self_v, const KX_PYATTRIBUT const char* type = attrdef->m_name; if(strcmp(type, "SPOT")) { - retvalue = PyInt_FromLong(RAS_LightObject::LIGHT_SPOT); + retvalue = PyLong_FromSsize_t(RAS_LightObject::LIGHT_SPOT); } else if (strcmp(type, "SUN")) { - retvalue = PyInt_FromLong(RAS_LightObject::LIGHT_SUN); + retvalue = PyLong_FromSsize_t(RAS_LightObject::LIGHT_SUN); } else if (strcmp(type, "NORMAL")) { - retvalue = PyInt_FromLong(RAS_LightObject::LIGHT_NORMAL); + retvalue = PyLong_FromSsize_t(RAS_LightObject::LIGHT_NORMAL); } return retvalue; @@ -375,13 +364,13 @@ PyObject* KX_LightObject::pyattr_get_typeconst(void *self_v, const KX_PYATTRIBUT PyObject* KX_LightObject::pyattr_get_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_LightObject* self = static_cast(self_v); - return PyInt_FromLong(self->m_lightobj.m_type); + return PyLong_FromSsize_t(self->m_lightobj.m_type); } int KX_LightObject::pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value) { KX_LightObject* self = static_cast(self_v); - int val = PyInt_AsLong(value); + int val = PyLong_AsSsize_t(value); if((val==-1 && PyErr_Occurred()) || val<0 || val>2) { PyErr_SetString(PyExc_ValueError, "light.type= val: KX_LightObject, expected an int between 0 and 2"); return PY_SET_ATTR_FAIL; @@ -401,14 +390,3 @@ int KX_LightObject::pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attr return PY_SET_ATTR_SUCCESS; } - - -PyObject* KX_LightObject::py_getattro(PyObject *attr) -{ - py_getattro_up(KX_GameObject); -} - -int KX_LightObject::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(KX_GameObject); -} diff --git a/source/gameengine/Ketsji/KX_Light.h b/source/gameengine/Ketsji/KX_Light.h index 358c705080a..0b7ccbe81ab 100644 --- a/source/gameengine/Ketsji/KX_Light.h +++ b/source/gameengine/Ketsji/KX_Light.h @@ -49,7 +49,7 @@ protected: Scene* m_blenderscene; public: - KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,class RAS_IRenderTools* rendertools,const struct RAS_LightObject& lightobj, bool glsl, PyTypeObject *T = &Type); + KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,class RAS_IRenderTools* rendertools,const struct RAS_LightObject& lightobj, bool glsl); virtual ~KX_LightObject(); virtual CValue* GetReplica(); RAS_LightObject* GetLightData() { return &m_lightobj;} @@ -64,10 +64,6 @@ public: void BindShadowBuffer(class RAS_IRasterizer *ras, class KX_Camera *cam, class MT_Transform& camtrans); void UnbindShadowBuffer(class RAS_IRasterizer *ras); void Update(); - - virtual PyObject* py_getattro(PyObject *attr); /* lens, near, far, projection_matrix */ - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *pyvalue); /* attributes */ static PyObject* pyattr_get_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index 11effa1ca98..96e8f61e4c8 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -62,18 +62,15 @@ PyTypeObject KX_MeshProxy::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_MeshProxy::Parents[] = { - &KX_MeshProxy::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &CValue::Type, - &PyObjectPlus::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_MeshProxy::Methods[] = { @@ -106,24 +103,8 @@ void KX_MeshProxy::SetMeshModified(bool v) m_meshobj->SetMeshModified(v); } - -PyObject* KX_MeshProxy::py_getattro(PyObject *attr) -{ - py_getattro_up(CValue); -} - -PyObject* KX_MeshProxy::py_getattro_dict() { - py_getattro_dict_up(CValue); -} - -int KX_MeshProxy::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(CValue); -} - - KX_MeshProxy::KX_MeshProxy(RAS_MeshObject* mesh) - : CValue(&Type), m_meshobj(mesh) + : CValue(), m_meshobj(mesh) { } @@ -150,14 +131,14 @@ PyObject* KX_MeshProxy::PyGetNumMaterials(PyObject* args, PyObject* kwds) { int num = m_meshobj->NumMaterials(); ShowDeprecationWarning("getNumMaterials()", "the numMaterials property"); - return PyInt_FromLong(num); + return PyLong_FromSsize_t(num); } PyObject* KX_MeshProxy::PyGetNumPolygons() { int num = m_meshobj->NumPolygons(); ShowDeprecationWarning("getNumPolygons()", "the numPolygons property"); - return PyInt_FromLong(num); + return PyLong_FromSsize_t(num); } PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds) @@ -173,7 +154,7 @@ PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds) return NULL; } - return PyString_FromString(matname.Ptr()); + return PyUnicode_FromString(matname.Ptr()); } @@ -191,7 +172,7 @@ PyObject* KX_MeshProxy::PyGetTextureName(PyObject* args, PyObject* kwds) return NULL; } - return PyString_FromString(matname.Ptr()); + return PyUnicode_FromString(matname.Ptr()); } @@ -214,7 +195,7 @@ PyObject* KX_MeshProxy::PyGetVertexArrayLength(PyObject* args, PyObject* kwds) length = m_meshobj->NumVertices(mat); } - return PyInt_FromLong(length); + return PyLong_FromSsize_t(length); } @@ -304,12 +285,12 @@ PyObject* KX_MeshProxy::pyattr_get_materials(void *self_v, const KX_PYATTRIBUTE_ PyObject * KX_MeshProxy::pyattr_get_numMaterials(void * selfv, const KX_PYATTRIBUTE_DEF * attrdef) { KX_MeshProxy * self = static_cast (selfv); - return PyInt_FromLong(self->m_meshobj->NumMaterials()); + return PyLong_FromSsize_t(self->m_meshobj->NumMaterials()); } PyObject * KX_MeshProxy::pyattr_get_numPolygons(void * selfv, const KX_PYATTRIBUTE_DEF * attrdef) { KX_MeshProxy * self = static_cast (selfv); - return PyInt_FromLong(self->m_meshobj->NumPolygons()); + return PyLong_FromSsize_t(self->m_meshobj->NumPolygons()); } /* a close copy of ConvertPythonToGameObject but for meshes */ @@ -332,13 +313,13 @@ bool ConvertPythonToMesh(PyObject * value, RAS_MeshObject **object, bool py_none } } - if (PyString_Check(value)) { - *object = (RAS_MeshObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetMeshByName(STR_String( PyString_AsString(value) )); + if (PyUnicode_Check(value)) { + *object = (RAS_MeshObject*)SCA_ILogicBrick::m_sCurrentLogicManager->GetMeshByName(STR_String( _PyUnicode_AsString(value) )); if (*object) { return true; } else { - PyErr_Format(PyExc_ValueError, "%s, requested name \"%s\" did not match any KX_MeshProxy in this scene", error_prefix, PyString_AsString(value)); + PyErr_Format(PyExc_ValueError, "%s, requested name \"%s\" did not match any KX_MeshProxy in this scene", error_prefix, _PyUnicode_AsString(value)); return false; } } diff --git a/source/gameengine/Ketsji/KX_MeshProxy.h b/source/gameengine/Ketsji/KX_MeshProxy.h index bfdd4be4118..4b6543677ad 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.h +++ b/source/gameengine/Ketsji/KX_MeshProxy.h @@ -56,9 +56,6 @@ public: virtual CValue* GetReplica(); // stuff for python integration - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); KX_PYMETHOD(KX_MeshProxy,GetNumMaterials); // Deprecated KX_PYMETHOD(KX_MeshProxy,GetMaterialName); diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index fde10a493db..ba4b47cb03f 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -63,9 +63,8 @@ KX_MouseFocusSensor::KX_MouseFocusSensor(SCA_MouseManager* eventmgr, int focusmode, KX_Scene* kxscene, KX_KetsjiEngine *kxengine, - SCA_IObject* gameobj, - PyTypeObject* T) - : SCA_MouseSensor(eventmgr, startx, starty, mousemode, gameobj, T), + SCA_IObject* gameobj) + : SCA_MouseSensor(eventmgr, startx, starty, mousemode, gameobj), m_focusmode(focusmode), m_kxscene(kxscene), m_kxengine(kxengine) @@ -356,20 +355,15 @@ PyTypeObject KX_MouseFocusSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_MouseFocusSensor::Parents[] = { - &KX_MouseFocusSensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_MouseSensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_MouseFocusSensor::Methods[] = { @@ -393,15 +387,6 @@ PyAttributeDef KX_MouseFocusSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_MouseFocusSensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_MouseSensor); -} - -PyObject* KX_MouseFocusSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_MouseSensor); -} - - const char KX_MouseFocusSensor::GetHitObject_doc[] = "getHitObject()\n" "\tReturns the object that was hit by this ray.\n"; diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h index 29d674eb305..dfada7a59cc 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h @@ -56,8 +56,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor int focusmode, KX_Scene* kxscene, KX_KetsjiEngine* kxengine, - SCA_IObject* gameobj, - PyTypeObject* T=&Type ); + SCA_IObject* gameobj); virtual ~KX_MouseFocusSensor() { ; }; virtual CValue* GetReplica() { @@ -89,8 +88,6 @@ class KX_MouseFocusSensor : public SCA_MouseSensor /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRayTarget); KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRaySource); diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp index 44842b7f5b3..1a211a64b35 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.cpp +++ b/source/gameengine/Ketsji/KX_NearSensor.cpp @@ -48,15 +48,13 @@ KX_NearSensor::KX_NearSensor(SCA_EventManager* eventmgr, bool bFindMaterial, const STR_String& touchedpropname, class KX_Scene* scene, - PHY_IPhysicsController* ctrl, - PyTypeObject* T) + PHY_IPhysicsController* ctrl) :KX_TouchSensor(eventmgr, gameobj, bFindMaterial, false, - touchedpropname, - /* scene, */ - T), + touchedpropname + /*, scene */), m_Margin(margin), m_ResetMargin(resetmargin) @@ -272,26 +270,17 @@ PyTypeObject KX_NearSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject KX_NearSensor::Parents[] = { - &KX_NearSensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &KX_TouchSensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; - - PyMethodDef KX_NearSensor::Methods[] = { //No methods {NULL,NULL} //Sentinel @@ -302,18 +291,3 @@ PyAttributeDef KX_NearSensor::Attributes[] = { KX_PYATTRIBUTE_FLOAT_RW_CHECK("resetDistance", 0, 100, KX_NearSensor, m_ResetMargin, CheckResetDistance), {NULL} //Sentinel }; - - -PyObject* KX_NearSensor::py_getattro(PyObject *attr) -{ - py_getattro_up(KX_TouchSensor); -} - -PyObject* KX_NearSensor::py_getattro_dict() { - py_getattro_dict_up(KX_TouchSensor); -} - -int KX_NearSensor::py_setattro(PyObject*attr, PyObject* value) -{ - py_setattro_up(KX_TouchSensor); -} diff --git a/source/gameengine/Ketsji/KX_NearSensor.h b/source/gameengine/Ketsji/KX_NearSensor.h index 63099e181a0..f3c1d74805c 100644 --- a/source/gameengine/Ketsji/KX_NearSensor.h +++ b/source/gameengine/Ketsji/KX_NearSensor.h @@ -54,8 +54,7 @@ public: bool bFindMaterial, const STR_String& touchedpropname, class KX_Scene* scene, - PHY_IPhysicsController* ctrl, - PyTypeObject* T=&Type); + PHY_IPhysicsController* ctrl); /* public: KX_NearSensor(class SCA_EventManager* eventmgr, @@ -64,8 +63,7 @@ public: double resetmargin, bool bFindMaterial, const STR_String& touchedpropname, - class KX_Scene* scene, - PyTypeObject* T=&Type); + class KX_Scene* scene); */ virtual ~KX_NearSensor(); virtual void SynchronizeTransform(); @@ -83,9 +81,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); //No methods diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 62e61667c56..ae340d12be4 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -53,10 +53,9 @@ KX_ObjectActuator( const MT_Vector3& linV, const MT_Vector3& angV, const short damping, - const KX_LocalFlags& flag, - PyTypeObject* T + const KX_LocalFlags& flag ) : - SCA_IActuator(gameobj,T), + SCA_IActuator(gameobj), m_force(force), m_torque(torque), m_dloc(dloc), @@ -342,19 +341,15 @@ PyTypeObject KX_ObjectActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_ObjectActuator::Parents[] = { - &KX_ObjectActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_ObjectActuator::Methods[] = { @@ -414,20 +409,6 @@ PyAttributeDef KX_ObjectActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_ObjectActuator::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IActuator); -} - - -PyObject* KX_ObjectActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_ObjectActuator::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_IActuator); -} - /* Attribute get/set functions */ #ifdef USE_MATHUTILS @@ -574,7 +555,7 @@ int KX_ObjectActuator::pyattr_set_forceLimitX(void *self_v, const KX_PYATTRIBUTE { self->m_drot[0] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 0)); self->m_dloc[0] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 1)); - self->m_bitLocalFlag.Torque = (PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 2)) != 0); + self->m_bitLocalFlag.Torque = (PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 2)) != 0); if (!PyErr_Occurred()) { @@ -610,7 +591,7 @@ int KX_ObjectActuator::pyattr_set_forceLimitY(void *self_v, const KX_PYATTRIBUTE { self->m_drot[1] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 0)); self->m_dloc[1] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 1)); - self->m_bitLocalFlag.DLoc = (PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 2)) != 0); + self->m_bitLocalFlag.DLoc = (PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 2)) != 0); if (!PyErr_Occurred()) { @@ -646,7 +627,7 @@ int KX_ObjectActuator::pyattr_set_forceLimitZ(void *self_v, const KX_PYATTRIBUTE { self->m_drot[2] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 0)); self->m_dloc[2] = PyFloat_AsDouble(PySequence_Fast_GET_ITEM(value, 1)); - self->m_bitLocalFlag.DRot = (PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 2)) != 0); + self->m_bitLocalFlag.DRot = (PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 2)) != 0); if (!PyErr_Occurred()) { diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h index 6ca442b2ec2..20aec9e0e86 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.h +++ b/source/gameengine/Ketsji/KX_ObjectActuator.h @@ -135,8 +135,7 @@ public: const MT_Vector3& linV, const MT_Vector3& angV, const short damping, - const KX_LocalFlags& flag, - PyTypeObject* T=&Type + const KX_LocalFlags& flag ); ~KX_ObjectActuator(); CValue* GetReplica(); @@ -163,10 +162,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForce); KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForce); diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index cd2ed456c48..befa2aaff56 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -50,9 +50,8 @@ KX_ParentActuator::KX_ParentActuator(SCA_IObject *gameobj, int mode, bool addToCompound, bool ghost, - SCA_IObject *ob, - PyTypeObject* T) - : SCA_IActuator(gameobj, T), + SCA_IObject *ob) + : SCA_IActuator(gameobj), m_mode(mode), m_addToCompound(addToCompound), m_ghost(ghost), @@ -157,19 +156,15 @@ PyTypeObject KX_ParentActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_ParentActuator::Parents[] = { - &KX_ParentActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_ParentActuator::Methods[] = { @@ -217,18 +212,6 @@ int KX_ParentActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUTE } -PyObject* KX_ParentActuator::py_getattro(PyObject *attr) { - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_ParentActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_ParentActuator::py_setattro(PyObject *attr, PyObject* value) { - py_setattro_up(SCA_IActuator); -} - /* Deprecated -----> */ /* 1. setObject */ const char KX_ParentActuator::SetObject_doc[] = @@ -273,7 +256,7 @@ PyObject* KX_ParentActuator::PyGetObject(PyObject* args) Py_RETURN_NONE; if (ret_name_only) - return PyString_FromString(m_ob->GetName().ReadPtr()); + return PyUnicode_FromString(m_ob->GetName().ReadPtr()); else return m_ob->GetProxy(); } diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h index 148375e994c..aeb39eabf89 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.h +++ b/source/gameengine/Ketsji/KX_ParentActuator.h @@ -68,8 +68,7 @@ class KX_ParentActuator : public SCA_IActuator int mode, bool addToCompound, bool ghost, - SCA_IObject *ob, - PyTypeObject* T=&Type); + SCA_IObject *ob); virtual ~KX_ParentActuator(); virtual bool Update(); @@ -82,10 +81,6 @@ class KX_ParentActuator : public SCA_IActuator /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); - /* These are used to get and set m_ob */ static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp index c968e50957e..7bce311f1b6 100644 --- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp +++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp @@ -39,8 +39,8 @@ KX_PhysicsObjectWrapper::KX_PhysicsObjectWrapper( PHY_IPhysicsController* ctrl, - PHY_IPhysicsEnvironment* physenv,PyTypeObject *T) : - PyObjectPlus(T), + PHY_IPhysicsEnvironment* physenv) : + PyObjectPlus(), m_ctrl(ctrl), m_physenv(physenv) { @@ -129,46 +129,17 @@ PyTypeObject KX_PhysicsObjectWrapper::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_PhysicsObjectWrapper::Parents[] = { - &KX_PhysicsObjectWrapper::Type, - NULL -}; - -PyObject* KX_PhysicsObjectWrapper::py_getattro(PyObject *attr) -{ - py_getattro_up(PyObjectPlus); -} - -PyObject* KX_PhysicsObjectWrapper::py_getattro_dict() { - py_getattro_dict_up(PyObjectPlus); -} - -int KX_PhysicsObjectWrapper::py_setattro(PyObject *attr,PyObject *pyobj) -{ - int result = 1; - - if (PyInt_Check(pyobj)) - { - result = 0; - } - if (PyString_Check(pyobj)) - { - result = 0; - } - if (result) - result = PyObjectPlus::py_setattro(attr,pyobj); - - return result; + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &PyObjectPlus::Type, + 0,0,0,0,0,0, + py_base_new }; - PyMethodDef KX_PhysicsObjectWrapper::Methods[] = { {"setPosition",(PyCFunction) KX_PhysicsObjectWrapper::sPySetPosition, METH_VARARGS}, {"setLinearVelocity",(PyCFunction) KX_PhysicsObjectWrapper::sPySetLinearVelocity, METH_VARARGS}, diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h index 1b59686babc..fa6fd1d1f2a 100644 --- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h +++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h @@ -35,12 +35,8 @@ class KX_PhysicsObjectWrapper : public PyObjectPlus { Py_Header; - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); public: - KX_PhysicsObjectWrapper(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsEnvironment* physenv,PyTypeObject *T = &Type); + KX_PhysicsObjectWrapper(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsEnvironment* physenv); virtual ~KX_PhysicsObjectWrapper(); KX_PYMETHOD_VARARGS(KX_PhysicsObjectWrapper,SetPosition); diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index b56b5500c39..a1571b17756 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -55,18 +55,15 @@ PyTypeObject KX_PolyProxy::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_PolyProxy::Parents[] = { - &KX_PolyProxy::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &CValue::Type, - &PyObjectPlus::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_PolyProxy::Methods[] = { @@ -98,16 +95,17 @@ PyAttributeDef KX_PolyProxy::Attributes[] = { { NULL } //Sentinel }; +#if 0 PyObject* KX_PolyProxy::py_getattro(PyObject *attr) { - char *attr_str= PyString_AsString(attr); + char *attr_str= _PyUnicode_AsString(attr); if (!strcmp(attr_str, "matname")) { - return PyString_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName()); + return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName()); } if (!strcmp(attr_str, "texture")) { - return PyString_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName()); + return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName()); } if (!strcmp(attr_str, "material")) { @@ -136,38 +134,35 @@ PyObject* KX_PolyProxy::py_getattro(PyObject *attr) // found it break; } - return PyInt_FromLong(matid); + return PyLong_FromSsize_t(matid); } if (!strcmp(attr_str, "v1")) { - return PyInt_FromLong(m_polygon->GetVertexOffset(0)); + return PyLong_FromSsize_t(m_polygon->GetVertexOffset(0)); } if (!strcmp(attr_str, "v2")) { - return PyInt_FromLong(m_polygon->GetVertexOffset(1)); + return PyLong_FromSsize_t(m_polygon->GetVertexOffset(1)); } if (!strcmp(attr_str, "v3")) { - return PyInt_FromLong(m_polygon->GetVertexOffset(2)); + return PyLong_FromSsize_t(m_polygon->GetVertexOffset(2)); } if (!strcmp(attr_str, "v4")) { - return PyInt_FromLong(((m_polygon->VertexCount()>3)?m_polygon->GetVertexOffset(3):0)); + return PyLong_FromSsize_t(((m_polygon->VertexCount()>3)?m_polygon->GetVertexOffset(3):0)); } if (!strcmp(attr_str, "visible")) { - return PyInt_FromLong(m_polygon->IsVisible()); + return PyLong_FromSsize_t(m_polygon->IsVisible()); } if (!strcmp(attr_str, "collide")) { - return PyInt_FromLong(m_polygon->IsCollider()); + return PyLong_FromSsize_t(m_polygon->IsCollider()); } - py_getattro_up(CValue); -} - -PyObject* KX_PolyProxy::py_getattro_dict() { - py_getattro_dict_up(CValue); + // py_getattro_up(CValue); // XXX -- todo, make all these attributes } +#endif KX_PolyProxy::KX_PolyProxy(const RAS_MeshObject*mesh, RAS_Polygon* polygon) : m_polygon(polygon), @@ -204,37 +199,37 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterialIndex, // found it break; } - return PyInt_FromLong(matid); + return PyLong_FromSsize_t(matid); } KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getNumVertex, "getNumVertex() : returns the number of vertex of the polygon, 3 or 4\n") { - return PyInt_FromLong(m_polygon->VertexCount()); + return PyLong_FromSsize_t(m_polygon->VertexCount()); } KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, isVisible, "isVisible() : returns whether the polygon is visible or not\n") { - return PyInt_FromLong(m_polygon->IsVisible()); + return PyLong_FromSsize_t(m_polygon->IsVisible()); } KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, isCollider, "isCollider() : returns whether the polygon is receives collision or not\n") { - return PyInt_FromLong(m_polygon->IsCollider()); + return PyLong_FromSsize_t(m_polygon->IsCollider()); } KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterialName, "getMaterialName() : returns the polygon material name, \"NoMaterial\" if no material\n") { - return PyString_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName()); + return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName()); } KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getTextureName, "getTexturelName() : returns the polygon texture name, \"NULL\" if no texture\n") { - return PyString_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName()); + return PyUnicode_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName()); } KX_PYMETHODDEF_DOC(KX_PolyProxy, getVertexIndex, @@ -255,9 +250,9 @@ KX_PYMETHODDEF_DOC(KX_PolyProxy, getVertexIndex, } if (index < m_polygon->VertexCount()) { - return PyInt_FromLong(m_polygon->GetVertexOffset(index)); + return PyLong_FromSsize_t(m_polygon->GetVertexOffset(index)); } - return PyInt_FromLong(0); + return PyLong_FromSsize_t(0); } KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMesh, diff --git a/source/gameengine/Ketsji/KX_PolyProxy.h b/source/gameengine/Ketsji/KX_PolyProxy.h index d8fd36fec6c..e619617d312 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.h +++ b/source/gameengine/Ketsji/KX_PolyProxy.h @@ -52,8 +52,6 @@ public: // stuff for python integration - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getMaterialIndex) KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getNumVertex) diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp index 506c167a905..9bc84127572 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.cpp +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.cpp @@ -51,8 +51,8 @@ #include "KX_PyMath.h" -KX_PolygonMaterial::KX_PolygonMaterial(PyTypeObject *T) - : PyObjectPlus(T), +KX_PolygonMaterial::KX_PolygonMaterial() + : PyObjectPlus(), RAS_IPolyMaterial(), m_tface(NULL), @@ -115,7 +115,7 @@ bool KX_PolygonMaterial::Activate(RAS_IRasterizer* rasty, TCachingInfo& cachingI PyObject *ret = PyObject_CallMethod(m_pymaterial, "activate", "(NNO)", pyRasty, pyCachingInfo, (PyObject*) this->m_proxy); if (ret) { - bool value = PyInt_AsLong(ret); + bool value = PyLong_AsSsize_t(ret); Py_DECREF(ret); dopass = value; } @@ -255,33 +255,17 @@ PyTypeObject KX_PolygonMaterial::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_PolygonMaterial::Parents[] = { - &KX_PolygonMaterial::Type, - &PyObjectPlus::Type, - NULL + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &PyObjectPlus::Type, + 0,0,0,0,0,0, + py_base_new }; -PyObject* KX_PolygonMaterial::py_getattro(PyObject *attr) -{ - py_getattro_up(PyObjectPlus); -} - -PyObject* KX_PolygonMaterial::py_getattro_dict() { - py_getattro_dict_up(PyObjectPlus); -} - -int KX_PolygonMaterial::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(PyObjectPlus); -} - KX_PYMETHODDEF_DOC(KX_PolygonMaterial, setCustomMaterial, "setCustomMaterial(material)") { PyObject *material; @@ -347,13 +331,13 @@ KX_PYMETHODDEF_DOC(KX_PolygonMaterial, activate, "activate(rasty, cachingInfo)") PyObject* KX_PolygonMaterial::pyattr_get_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_PolygonMaterial* self= static_cast(self_v); - return PyString_FromString(self->m_texturename.ReadPtr()); + return PyUnicode_FromString(self->m_texturename.ReadPtr()); } PyObject* KX_PolygonMaterial::pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_PolygonMaterial* self= static_cast(self_v); - return PyString_FromString(self->m_materialname.ReadPtr()); + return PyUnicode_FromString(self->m_materialname.ReadPtr()); } /* this does not seem useful */ @@ -370,7 +354,7 @@ PyObject* KX_PolygonMaterial::pyattr_get_gl_texture(void *self_v, const KX_PYATT if (self->m_tface && self->m_tface->tpage) bindcode= self->m_tface->tpage->bindcode; - return PyInt_FromLong(bindcode); + return PyLong_FromSsize_t(bindcode); } diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index 89ecb026da9..266b4d7e789 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -57,7 +57,7 @@ private: mutable int m_pass; public: - KX_PolygonMaterial(PyTypeObject *T = &Type); + KX_PolygonMaterial(); void Initialize(const STR_String &texname, Material* ma, int materialindex, @@ -116,10 +116,7 @@ public: KX_PYMETHOD_DOC(KX_PolygonMaterial, setCustomMaterial); KX_PYMETHOD_DOC(KX_PolygonMaterial, loadProgram); - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *pyvalue); - virtual PyObject* py_repr(void) { return PyString_FromString(m_material ? ((ID *)m_material)->name+2 : ""); } + virtual PyObject* py_repr(void) { return PyUnicode_FromString(m_material ? ((ID *)m_material)->name+2 : ""); } static PyObject* pyattr_get_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index 4ec901a2f5e..94e8d1fd583 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -640,7 +640,7 @@ PyObject* initPythonConstraintBinding() // Add some symbolic constants to the module d = PyModule_GetDict(m); - ErrorObject = PyString_FromString("PhysicsConstraints.error"); + ErrorObject = PyUnicode_FromString("PhysicsConstraints.error"); PyDict_SetItemString(d, "error", ErrorObject); Py_DECREF(ErrorObject); diff --git a/source/gameengine/Ketsji/KX_PyMath.cpp b/source/gameengine/Ketsji/KX_PyMath.cpp index 76cfb0e572d..6d33c38190c 100644 --- a/source/gameengine/Ketsji/KX_PyMath.cpp +++ b/source/gameengine/Ketsji/KX_PyMath.cpp @@ -99,7 +99,7 @@ PyObject* PyObjectFrom(const MT_Matrix4x4 &mat) #ifdef USE_MATHUTILS float fmat[16]; mat.getValue(fmat); - return newMatrixObject(fmat, 4, 4, Py_NEW); + return newMatrixObject(fmat, 4, 4, Py_NEW, NULL); #else PyObject *list = PyList_New(4); PyObject *sublist; @@ -123,7 +123,7 @@ PyObject* PyObjectFrom(const MT_Matrix3x3 &mat) #ifdef USE_MATHUTILS float fmat[9]; mat.getValue3x3(fmat); - return newMatrixObject(fmat, 3, 3, Py_NEW); + return newMatrixObject(fmat, 3, 3, Py_NEW, NULL); #else PyObject *list = PyList_New(3); PyObject *sublist; @@ -146,7 +146,7 @@ PyObject* PyObjectFrom(const MT_Quaternion &qrot) { /* NOTE, were re-ordering here for Mathutils compat */ float fvec[4]= {qrot[3], qrot[0], qrot[1], qrot[2]}; - return newQuaternionObject(fvec, Py_WRAP); + return newQuaternionObject(fvec, Py_WRAP, NULL); } #endif @@ -154,7 +154,7 @@ PyObject* PyObjectFrom(const MT_Tuple4 &vec) { #ifdef USE_MATHUTILS float fvec[4]= {vec[0], vec[1], vec[2], vec[3]}; - return newVectorObject(fvec, 4, Py_WRAP); + return newVectorObject(fvec, 4, Py_WRAP, NULL); #else PyObject *list = PyList_New(4); PyList_SET_ITEM(list, 0, PyFloat_FromDouble(vec[0])); @@ -169,7 +169,7 @@ PyObject* PyObjectFrom(const MT_Tuple3 &vec) { #ifdef USE_MATHUTILS float fvec[3]= {vec[0], vec[1], vec[2]}; - return newVectorObject(fvec, 3, Py_WRAP); + return newVectorObject(fvec, 3, Py_WRAP, NULL); #else PyObject *list = PyList_New(3); PyList_SET_ITEM(list, 0, PyFloat_FromDouble(vec[0])); @@ -183,7 +183,7 @@ PyObject* PyObjectFrom(const MT_Tuple2 &vec) { #ifdef USE_MATHUTILS float fvec[2]= {vec[0], vec[1]}; - return newVectorObject(fvec, 2, Py_WRAP); + return newVectorObject(fvec, 2, Py_WRAP, NULL); #else PyObject *list = PyList_New(2); PyList_SET_ITEM(list, 0, PyFloat_FromDouble(vec[0])); diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h index f37925bb0ab..9ee11c9e745 100644 --- a/source/gameengine/Ketsji/KX_PyMath.h +++ b/source/gameengine/Ketsji/KX_PyMath.h @@ -31,12 +31,6 @@ #ifndef __KX_PYMATH_H__ #define __KX_PYMATH_H__ -#ifdef USE_MATHUTILS -extern "C" { -#include "../../blender/python/generic/Mathutils.h" /* so we can have mathutils callbacks */ -} -#endif - #include "MT_Point2.h" #include "MT_Point3.h" #include "MT_Vector2.h" @@ -48,6 +42,12 @@ extern "C" { #include "KX_Python.h" #include "PyObjectPlus.h" +#ifdef USE_MATHUTILS +extern "C" { +#include "../../blender/python/generic/Mathutils.h" /* so we can have mathutils callbacks */ +} +#endif + inline unsigned int Size(const MT_Matrix4x4&) { return 4; } inline unsigned int Size(const MT_Matrix3x3&) { return 3; } inline unsigned int Size(const MT_Tuple2&) { return 2; } @@ -154,7 +154,7 @@ bool PyVecTo(PyObject* pyval, T& vec) return true; } - else if (BGE_PROXY_CHECK_TYPE(pyval)) + else if (PyObject_TypeCheck(pyval, &PyObjectPlus::Type)) { /* note, include this check because PySequence_Check does too much introspection * on the PyObject (like getting its __class__, on a BGE type this means searching up * the parent list each time only to discover its not a sequence. diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 736460d33db..eead7a51885 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -130,10 +130,10 @@ void KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,cons } /* Macro for building the keyboard translation */ -//#define KX_MACRO_addToDict(dict, name) PyDict_SetItemString(dict, #name, PyInt_FromLong(SCA_IInputDevice::KX_##name)) -#define KX_MACRO_addToDict(dict, name) PyDict_SetItemString(dict, #name, item=PyInt_FromLong(name)); Py_DECREF(item) +//#define KX_MACRO_addToDict(dict, name) PyDict_SetItemString(dict, #name, PyLong_FromSsize_t(SCA_IInputDevice::KX_##name)) +#define KX_MACRO_addToDict(dict, name) PyDict_SetItemString(dict, #name, item=PyLong_FromSsize_t(name)); Py_DECREF(item) /* For the defines for types from logic bricks, we do stuff explicitly... */ -#define KX_MACRO_addTypesToDict(dict, name, name2) PyDict_SetItemString(dict, #name, item=PyInt_FromLong(name2)); Py_DECREF(item) +#define KX_MACRO_addTypesToDict(dict, name, name2) PyDict_SetItemString(dict, #name, item=PyLong_FromSsize_t(name2)); Py_DECREF(item) // temporarily python stuff, will be put in another place later ! @@ -181,7 +181,7 @@ static PyObject* gPyExpandPath(PyObject*, PyObject* args) BLI_strncpy(expanded, filename, FILE_MAXDIR + FILE_MAXFILE); BLI_convertstringcode(expanded, gp_GamePythonPath); - return PyString_FromString(expanded); + return PyUnicode_FromString(expanded); } static char gPySendMessage_doc[] = @@ -306,7 +306,7 @@ static PyObject* gPySetMaxLogicFrame(PyObject*, PyObject* args) static PyObject* gPyGetMaxLogicFrame(PyObject*) { - return PyInt_FromLong(KX_KetsjiEngine::GetMaxLogicFrame()); + return PyLong_FromSsize_t(KX_KetsjiEngine::GetMaxLogicFrame()); } static PyObject* gPySetMaxPhysicsFrame(PyObject*, PyObject* args) @@ -321,7 +321,7 @@ static PyObject* gPySetMaxPhysicsFrame(PyObject*, PyObject* args) static PyObject* gPyGetMaxPhysicsFrame(PyObject*) { - return PyInt_FromLong(KX_KetsjiEngine::GetMaxPhysicsFrame()); + return PyLong_FromSsize_t(KX_KetsjiEngine::GetMaxPhysicsFrame()); } static PyObject* gPySetPhysicsTicRate(PyObject*, PyObject* args) @@ -386,7 +386,7 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args) while ((dirp = readdir(dp)) != NULL) { if (BLI_testextensie(dirp->d_name, ".blend")) { - value = PyString_FromString(dirp->d_name); + value = PyUnicode_FromString(dirp->d_name); PyList_Append(list, value); Py_DECREF(value); } @@ -500,7 +500,7 @@ static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *) static PyObject *gEvalExpression(PyObject*, PyObject* value) { - char* txt= PyString_AsString(value); + char* txt= _PyUnicode_AsString(value); if (txt==NULL) { PyErr_SetString(PyExc_TypeError, "Expression.calc(text): expects a single string argument"); @@ -558,14 +558,14 @@ static struct PyMethodDef game_methods[] = { static PyObject* gPyGetWindowHeight(PyObject*, PyObject* args) { - return PyInt_FromLong((gp_Canvas ? gp_Canvas->GetHeight() : 0)); + return PyLong_FromSsize_t((gp_Canvas ? gp_Canvas->GetHeight() : 0)); } static PyObject* gPyGetWindowWidth(PyObject*, PyObject* args) { - return PyInt_FromLong((gp_Canvas ? gp_Canvas->GetWidth() : 0)); + return PyLong_FromSsize_t((gp_Canvas ? gp_Canvas->GetWidth() : 0)); } @@ -893,7 +893,7 @@ static PyObject* gPyGetGLSLMaterialSetting(PyObject*, } enabled = ((G.fileflags & flag) != 0); - return PyInt_FromLong(enabled); + return PyLong_FromSsize_t(enabled); } #define KX_TEXFACE_MATERIAL 0 @@ -937,7 +937,7 @@ static PyObject* gPyGetMaterialType(PyObject*) else flag = KX_TEXFACE_MATERIAL; - return PyInt_FromLong(flag); + return PyLong_FromSsize_t(flag); } static PyObject* gPyDrawLine(PyObject*, PyObject* args) @@ -1075,7 +1075,7 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack PyDict_SetItemString(d, "globalDict", item=PyDict_New()); Py_DECREF(item); - ErrorObject = PyString_FromString("GameLogic.error"); + ErrorObject = PyUnicode_FromString("GameLogic.error"); PyDict_SetItemString(d, "error", ErrorObject); Py_DECREF(ErrorObject); @@ -1362,7 +1362,7 @@ PyObject *KXpy_import(PyObject *self, PyObject *args) /* check for builtin modules */ m = PyImport_AddModule("sys"); l = PyObject_GetAttrString(m, "builtin_module_names"); - n = PyString_FromString(name); + n = PyUnicode_FromString(name); if (PySequence_Contains(l, n)) { return PyImport_ImportModuleEx(name, globals, locals, fromlist); @@ -1538,7 +1538,7 @@ static void initPySysObjects__append(PyObject *sys_path, char *filename) BLI_split_dirfile_basic(filename, expanded, NULL); /* get the dir part of filename only */ BLI_convertstringcode(expanded, gp_GamePythonPath); /* filename from lib->filename is (always?) absolute, so this may not be needed but it wont hurt */ BLI_cleanup_file(gp_GamePythonPath, expanded); /* Dont use BLI_cleanup_dir because it adds a slash - BREAKS WIN32 ONLY */ - item= PyString_FromString(expanded); + item= PyUnicode_FromString(expanded); // printf("SysPath - '%s', '%s', '%s'\n", expanded, filename, gp_GamePythonPath); @@ -1735,7 +1735,7 @@ PyObject* initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas) // Add some symbolic constants to the module d = PyModule_GetDict(m); - ErrorObject = PyString_FromString("Rasterizer.error"); + ErrorObject = PyUnicode_FromString("Rasterizer.error"); PyDict_SetItemString(d, "error", ErrorObject); Py_DECREF(ErrorObject); @@ -1813,10 +1813,10 @@ static PyObject* gPyEventToCharacter(PyObject*, PyObject* args) if(IsPrintable(event)) { char ch[2] = {'\0', '\0'}; ch[0] = ToCharacter(event, (bool)shift); - return PyString_FromString(ch); + return PyUnicode_FromString(ch); } else { - return PyString_FromString(""); + return PyUnicode_FromString(""); } } @@ -2044,7 +2044,7 @@ int saveGamePythonConfig( char **marshal_buffer) char *marshal_cstring; #if PY_VERSION_HEX < 0x03000000 - marshal_cstring = PyString_AsString(pyGlobalDictMarshal); + marshal_cstring = _PyUnicode_AsString(pyGlobalDictMarshal); marshal_length= PyString_Size(pyGlobalDictMarshal); #else // py3 uses byte arrays marshal_cstring = PyBytes_AsString(pyGlobalDictMarshal); diff --git a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp index d5d0fe3123c..8ff0bfd5379 100644 --- a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp +++ b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp @@ -87,69 +87,54 @@ #include "SCA_RandomActuator.h" #include "SCA_IController.h" - -void initPyObjectPlusType(PyTypeObject **parents) +static void PyType_Ready_ADD(PyObject *dict, PyTypeObject *tp, PyAttributeDef *attributes, int init_getset) { - int i; + PyAttributeDef *attr; - for (i=0; parents[i]; i++) { - if(PyType_Ready(parents[i]) < 0) { - /* This is very very unlikely */ - printf("Error, pytype could not initialize, Blender may crash \"%s\"\n", parents[i]->tp_name); - return; - } + if(init_getset) { + /* we need to do this for all types before calling PyType_Ready + * since they will call the parents PyType_Ready and those might not have initialized vars yet */ -#if 0 - PyObject_Print(reinterpret_castparents[i], stderr, 0); - fprintf(stderr, "\n"); - PyObject_Print(parents[i]->tp_dict, stderr, 0); - fprintf(stderr, "\n\n"); -#endif + //if(tp->tp_base==NULL) + // printf("Debug: No Parents - '%s'\n" , tp->tp_name); - } + if(tp->tp_getset==NULL && attributes->m_name) { + PyGetSetDef *attr_getset; + int attr_tot= 0; - PyObject *dict= NULL; + for(attr= attributes; attr->m_name; attr++, attr_tot++) {}; - while(i) { - i--; + tp->tp_getset = attr_getset = reinterpret_cast(PyMem_Malloc((attr_tot+1) * sizeof(PyGetSetDef))); // XXX - Todo, free - if (dict) { - PyDict_Update(parents[i]->tp_dict, dict); - } - dict= parents[i]->tp_dict; -#if 1 - PyObject_Print(reinterpret_cast(parents[i]), stderr, 0); - fprintf(stderr, "\n"); - PyObject_Print(parents[i]->tp_dict, stderr, 0); - fprintf(stderr, "\n\n"); -#endif - - } -} + for(attr= attributes; attr->m_name; attr++, attr_getset++) { + attr_getset->name= (char *)attr->m_name; + attr_getset->doc= NULL; + attr_getset->get= reinterpret_cast(PyObjectPlus::py_get_attrdef); + if(attr->m_access==KX_PYATTRIBUTE_RO) + attr_getset->set= NULL; + else + attr_getset->set= reinterpret_cast(PyObjectPlus::py_set_attrdef); + attr_getset->closure= reinterpret_cast(attr); + } -static void PyType_Ready_ADD(PyObject *dict, PyTypeObject *tp, PyAttributeDef *attributes) -{ - PyAttributeDef *attr; - PyObject *item; - - PyType_Ready(tp); - PyDict_SetItemString(dict, tp->tp_name, reinterpret_cast(tp)); + memset(attr_getset, 0, sizeof(PyGetSetDef)); + } + } else { - /* store attr defs in the tp_dict for to avoid string lookups */ - for(attr= attributes; attr->m_name; attr++) { - item= PyCObject_FromVoidPtr(attr, NULL); - PyDict_SetItemString(tp->tp_dict, attr->m_name, item); - Py_DECREF(item); + PyObject *item; + + PyType_Ready(tp); + PyDict_SetItemString(dict, tp->tp_name, reinterpret_cast(tp)); } } -#define PyType_Ready_Attr(d, n) PyType_Ready_ADD(d, &n::Type, n::Attributes) +#define PyType_Ready_Attr(d, n, i) PyType_Ready_ADD(d, &n::Type, n::Attributes, i) void initPyTypes(void) { @@ -165,70 +150,74 @@ void initPyTypes(void) PyDict_SetItemString(PySys_GetObject((char *)"modules"), (char *)"GameTypes", mod); Py_DECREF(mod); - PyType_Ready_Attr(dict, BL_ActionActuator); - PyType_Ready_Attr(dict, BL_Shader); - PyType_Ready_Attr(dict, BL_ShapeActionActuator); - PyType_Ready_Attr(dict, CListValue); - PyType_Ready_Attr(dict, CValue); - PyType_Ready_Attr(dict, KX_BlenderMaterial); - PyType_Ready_Attr(dict, KX_CDActuator); - PyType_Ready_Attr(dict, KX_Camera); - PyType_Ready_Attr(dict, KX_CameraActuator); - PyType_Ready_Attr(dict, KX_ConstraintActuator); - PyType_Ready_Attr(dict, KX_ConstraintWrapper); - PyType_Ready_Attr(dict, KX_GameActuator); - PyType_Ready_Attr(dict, KX_GameObject); - PyType_Ready_Attr(dict, KX_IpoActuator); - PyType_Ready_Attr(dict, KX_LightObject); - PyType_Ready_Attr(dict, KX_MeshProxy); - PyType_Ready_Attr(dict, KX_MouseFocusSensor); - PyType_Ready_Attr(dict, KX_NearSensor); - PyType_Ready_Attr(dict, KX_NetworkMessageActuator); - PyType_Ready_Attr(dict, KX_NetworkMessageSensor); - PyType_Ready_Attr(dict, KX_ObjectActuator); - PyType_Ready_Attr(dict, KX_ParentActuator); - PyType_Ready_Attr(dict, KX_PhysicsObjectWrapper); - PyType_Ready_Attr(dict, KX_PolyProxy); - PyType_Ready_Attr(dict, KX_PolygonMaterial); - PyType_Ready_Attr(dict, KX_RadarSensor); - PyType_Ready_Attr(dict, KX_RaySensor); - PyType_Ready_Attr(dict, KX_SCA_AddObjectActuator); - PyType_Ready_Attr(dict, KX_SCA_DynamicActuator); - PyType_Ready_Attr(dict, KX_SCA_EndObjectActuator); - PyType_Ready_Attr(dict, KX_SCA_ReplaceMeshActuator); - PyType_Ready_Attr(dict, KX_Scene); - PyType_Ready_Attr(dict, KX_SceneActuator); - PyType_Ready_Attr(dict, KX_SoundActuator); - PyType_Ready_Attr(dict, KX_StateActuator); - PyType_Ready_Attr(dict, KX_TouchSensor); - PyType_Ready_Attr(dict, KX_TrackToActuator); - PyType_Ready_Attr(dict, KX_VehicleWrapper); - PyType_Ready_Attr(dict, KX_VertexProxy); - PyType_Ready_Attr(dict, KX_VisibilityActuator); - PyType_Ready_Attr(dict, PyObjectPlus); - PyType_Ready_Attr(dict, SCA_2DFilterActuator); - PyType_Ready_Attr(dict, SCA_ANDController); - PyType_Ready_Attr(dict, SCA_ActuatorSensor); - PyType_Ready_Attr(dict, SCA_AlwaysSensor); - PyType_Ready_Attr(dict, SCA_DelaySensor); - PyType_Ready_Attr(dict, SCA_ILogicBrick); - PyType_Ready_Attr(dict, SCA_IObject); - PyType_Ready_Attr(dict, SCA_ISensor); - PyType_Ready_Attr(dict, SCA_JoystickSensor); - PyType_Ready_Attr(dict, SCA_KeyboardSensor); - PyType_Ready_Attr(dict, SCA_MouseSensor); - PyType_Ready_Attr(dict, SCA_NANDController); - PyType_Ready_Attr(dict, SCA_NORController); - PyType_Ready_Attr(dict, SCA_ORController); - PyType_Ready_Attr(dict, SCA_PropertyActuator); - PyType_Ready_Attr(dict, SCA_PropertySensor); - PyType_Ready_Attr(dict, SCA_PythonController); - PyType_Ready_Attr(dict, SCA_RandomActuator); - PyType_Ready_Attr(dict, SCA_RandomSensor); - PyType_Ready_Attr(dict, SCA_XNORController); - PyType_Ready_Attr(dict, SCA_XORController); - PyType_Ready_Attr(dict, SCA_IController); + for(int init_getset= 1; init_getset > -1; init_getset--) { /* run twice, once to init the getsets another to run PyType_Ready */ + PyType_Ready_Attr(dict, BL_ActionActuator, init_getset); + PyType_Ready_Attr(dict, BL_Shader, init_getset); + PyType_Ready_Attr(dict, BL_ShapeActionActuator, init_getset); + PyType_Ready_Attr(dict, CListValue, init_getset); + PyType_Ready_Attr(dict, CValue, init_getset); + PyType_Ready_Attr(dict, KX_BlenderMaterial, init_getset); + PyType_Ready_Attr(dict, KX_CDActuator, init_getset); + PyType_Ready_Attr(dict, KX_Camera, init_getset); + PyType_Ready_Attr(dict, KX_CameraActuator, init_getset); + PyType_Ready_Attr(dict, KX_ConstraintActuator, init_getset); + PyType_Ready_Attr(dict, KX_ConstraintWrapper, init_getset); + PyType_Ready_Attr(dict, KX_GameActuator, init_getset); + PyType_Ready_Attr(dict, KX_GameObject, init_getset); + PyType_Ready_Attr(dict, KX_IpoActuator, init_getset); + PyType_Ready_Attr(dict, KX_LightObject, init_getset); + PyType_Ready_Attr(dict, KX_MeshProxy, init_getset); + PyType_Ready_Attr(dict, KX_MouseFocusSensor, init_getset); + PyType_Ready_Attr(dict, KX_NearSensor, init_getset); + PyType_Ready_Attr(dict, KX_NetworkMessageActuator, init_getset); + PyType_Ready_Attr(dict, KX_NetworkMessageSensor, init_getset); + PyType_Ready_Attr(dict, KX_ObjectActuator, init_getset); + PyType_Ready_Attr(dict, KX_ParentActuator, init_getset); + PyType_Ready_Attr(dict, KX_PhysicsObjectWrapper, init_getset); + PyType_Ready_Attr(dict, KX_PolyProxy, init_getset); + PyType_Ready_Attr(dict, KX_PolygonMaterial, init_getset); + PyType_Ready_Attr(dict, KX_RadarSensor, init_getset); + PyType_Ready_Attr(dict, KX_RaySensor, init_getset); + PyType_Ready_Attr(dict, KX_SCA_AddObjectActuator, init_getset); + PyType_Ready_Attr(dict, KX_SCA_DynamicActuator, init_getset); + PyType_Ready_Attr(dict, KX_SCA_EndObjectActuator, init_getset); + PyType_Ready_Attr(dict, KX_SCA_ReplaceMeshActuator, init_getset); + PyType_Ready_Attr(dict, KX_Scene, init_getset); + PyType_Ready_Attr(dict, KX_SceneActuator, init_getset); + PyType_Ready_Attr(dict, KX_SoundActuator, init_getset); + PyType_Ready_Attr(dict, KX_StateActuator, init_getset); + PyType_Ready_Attr(dict, KX_TouchSensor, init_getset); + PyType_Ready_Attr(dict, KX_TrackToActuator, init_getset); + PyType_Ready_Attr(dict, KX_VehicleWrapper, init_getset); + PyType_Ready_Attr(dict, KX_VertexProxy, init_getset); + PyType_Ready_Attr(dict, KX_VisibilityActuator, init_getset); + PyType_Ready_Attr(dict, PyObjectPlus, init_getset); + PyType_Ready_Attr(dict, SCA_2DFilterActuator, init_getset); + PyType_Ready_Attr(dict, SCA_ANDController, init_getset); + PyType_Ready_Attr(dict, SCA_ActuatorSensor, init_getset); + PyType_Ready_Attr(dict, SCA_AlwaysSensor, init_getset); + PyType_Ready_Attr(dict, SCA_DelaySensor, init_getset); + PyType_Ready_Attr(dict, SCA_ILogicBrick, init_getset); + PyType_Ready_Attr(dict, SCA_IObject, init_getset); + PyType_Ready_Attr(dict, SCA_ISensor, init_getset); + PyType_Ready_Attr(dict, SCA_JoystickSensor, init_getset); + PyType_Ready_Attr(dict, SCA_KeyboardSensor, init_getset); + PyType_Ready_Attr(dict, SCA_MouseSensor, init_getset); + PyType_Ready_Attr(dict, SCA_NANDController, init_getset); + PyType_Ready_Attr(dict, SCA_NORController, init_getset); + PyType_Ready_Attr(dict, SCA_ORController, init_getset); + PyType_Ready_Attr(dict, SCA_PropertyActuator, init_getset); + PyType_Ready_Attr(dict, SCA_PropertySensor, init_getset); + PyType_Ready_Attr(dict, SCA_PythonController, init_getset); + PyType_Ready_Attr(dict, SCA_RandomActuator, init_getset); + PyType_Ready_Attr(dict, SCA_RandomSensor, init_getset); + PyType_Ready_Attr(dict, SCA_XNORController, init_getset); + PyType_Ready_Attr(dict, SCA_XORController, init_getset); + PyType_Ready_Attr(dict, SCA_IController, init_getset); + } + + /* Normal python type */ PyType_Ready(&KX_PythonSeq_Type); diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp index cc8021fc2e4..5b4d77156db 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.cpp +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -57,7 +57,7 @@ static Py_ssize_t KX_PythonSeq_len( PyObject * self ) PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); if(self_plus==NULL) { - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, "len(seq): "BGE_PROXY_ERROR_MSG); return -1; } @@ -84,7 +84,7 @@ static PyObject *KX_PythonSeq_getIndex(PyObject* self, int index) PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); if(self_plus==NULL) { - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, "val = seq[i]: "BGE_PROXY_ERROR_MSG); return NULL; } @@ -145,25 +145,9 @@ static PyObject *KX_PythonSeq_getIndex(PyObject* self, int index) return NULL; } - -static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) +static PyObjectPlus * KX_PythonSeq_subscript__internal(PyObject *self, char *key) { PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); - char *name = NULL; - - if(self_plus==NULL) { - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); - return NULL; - } - - if (PyInt_Check(key)) { - return KX_PythonSeq_getIndex(self, PyInt_AS_LONG( key )); - } else if ( PyString_Check(key) ) { - name = PyString_AsString( key ); - } else { - PyErr_SetString( PyExc_TypeError, "expected a string or an index" ); - return NULL; - } switch(((KX_PythonSeq *)self)->type) { case KX_PYGENSEQ_CONT_TYPE_SENSORS: @@ -172,8 +156,9 @@ static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) SCA_ISensor* sensor; for (unsigned int index=0;indexGetName() == name) - return sensor->GetProxy(); + if (sensor->GetName() == key) + return static_cast(sensor); + } break; } @@ -183,8 +168,8 @@ static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) SCA_IActuator* actuator; for (unsigned int index=0;indexGetName() == name) - return actuator->GetProxy(); + if (actuator->GetName() == key) + return static_cast(actuator); } break; } @@ -194,8 +179,8 @@ static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) SCA_ISensor *sensor; for (unsigned int index=0;indexGetName() == name) - return sensor->GetProxy(); + if (sensor->GetName() == key) + return static_cast(sensor); } break; } @@ -205,8 +190,8 @@ static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) SCA_IController *controller; for (unsigned int index=0;indexGetName() == name) - return controller->GetProxy(); + if (controller->GetName() == key) + return static_cast(controller); } break; } @@ -216,23 +201,105 @@ static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) SCA_IActuator *actuator; for (unsigned int index=0;indexGetName() == name) - return actuator->GetProxy(); + if (actuator->GetName() == key) + return static_cast(actuator); } break; } } - PyErr_Format( PyExc_KeyError, "requested item \"%s\" does not exist", name); return NULL; } + +static PyObject * KX_PythonSeq_subscript(PyObject * self, PyObject *key) +{ + PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); + + if(self_plus==NULL) { + PyErr_SetString(PyExc_SystemError, "val = seq[key], KX_PythonSeq: "BGE_PROXY_ERROR_MSG); + return NULL; + } + + if (PyLong_Check(key)) { + return KX_PythonSeq_getIndex(self, PyLong_AsSsize_t( key )); + } + else if ( PyUnicode_Check(key) ) { + char *name = _PyUnicode_AsString(key); + PyObjectPlus *ret = KX_PythonSeq_subscript__internal(self, name); + + if(ret) { + return ret->GetProxy(); + } else { + PyErr_Format( PyExc_KeyError, "requested item \"%s\" does not exist", name); + return NULL; + } + } + else { + PyErr_SetString( PyExc_TypeError, "expected a string or an index" ); + return NULL; + } +} + + +static int KX_PythonSeq_contains(PyObject *self, PyObject *key) +{ + PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); + + if(self_plus==NULL) { + PyErr_SetString(PyExc_SystemError, "key in seq, KX_PythonSeq: "BGE_PROXY_ERROR_MSG); + return -1; + } + if(!PyUnicode_Check(key)) { + PyErr_SetString(PyExc_SystemError, "key in seq, KX_PythonSeq: key must be a string"); + return -1; + } + + if(KX_PythonSeq_subscript__internal(self, _PyUnicode_AsString(key))) + return 1; + + return 0; +} + +/* Matches python dict.get(key, [default]) */ +PyObject* KX_PythonSeq_get(PyObject * self, PyObject *args) +{ + char *key; + PyObject* def = Py_None; + PyObjectPlus* ret_plus; + + if (!PyArg_ParseTuple(args, "s|O:get", &key, &def)) + return NULL; + + if((ret_plus = KX_PythonSeq_subscript__internal(self, key))) + return ret_plus->GetProxy(); + + Py_INCREF(def); + return def; +} + +PySequenceMethods KX_PythonSeq_as_sequence = { + NULL, /* Cant set the len otherwise it can evaluate as false */ + NULL, /* sq_concat */ + NULL, /* sq_repeat */ + NULL, /* sq_item */ + NULL, /* sq_slice */ + NULL, /* sq_ass_item */ + NULL, /* sq_ass_slice */ + (objobjproc)KX_PythonSeq_contains, /* sq_contains */ +}; + static PyMappingMethods KX_PythonSeq_as_mapping = { KX_PythonSeq_len, /* mp_length */ KX_PythonSeq_subscript, /* mp_subscript */ 0, /* mp_ass_subscript */ }; +PyMethodDef KX_PythonSeq_methods[] = { + // dict style access for props + {"get",(PyCFunction) KX_PythonSeq_get, METH_VARARGS}, + {NULL,NULL} //Sentinel +}; /* * Initialize the interator index @@ -241,7 +308,7 @@ static PyMappingMethods KX_PythonSeq_as_mapping = { static PyObject *KX_PythonSeq_getIter(KX_PythonSeq *self) { if(BGE_PROXY_REF(self->base)==NULL) { - PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG); + PyErr_SetString(PyExc_SystemError, "for i in seq: "BGE_PROXY_ERROR_MSG); return NULL; } @@ -313,13 +380,17 @@ PyTypeObject KX_PythonSeq_Type = { NULL, /* printfunc tp_print; */ NULL, /* getattrfunc tp_getattr; */ NULL, /* setattrfunc tp_setattr; */ +#if PY_VERSION_HEX >= 0x03000000 // TODO - richcmp + NULL, +#else ( cmpfunc ) KX_PythonSeq_compare, /* cmpfunc tp_compare; */ +#endif ( reprfunc ) KX_PythonSeq_repr, /* reprfunc tp_repr; */ /* Method suites for standard classes */ NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ + &KX_PythonSeq_as_sequence, /* PySequenceMethods *tp_as_sequence; */ &KX_PythonSeq_as_mapping, /* PyMappingMethods *tp_as_mapping; */ /* More standard operations (here for binary compatibility) */ @@ -357,7 +428,7 @@ PyTypeObject KX_PythonSeq_Type = { ( iternextfunc ) KX_PythonSeq_nextIter, /* iternextfunc tp_iternext; */ /*** Attribute descriptor and subclassing stuff ***/ - NULL, /* struct PyMethodDef *tp_methods; */ + KX_PythonSeq_methods, /* struct PyMethodDef *tp_methods; */ NULL, /* struct PyMemberDef *tp_members; */ NULL, /* struct PyGetSetDef *tp_getset; */ NULL, /* struct _typeobject *tp_base; */ diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index 064dc9126ac..e39d3756b71 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -49,8 +49,7 @@ KX_RadarSensor::KX_RadarSensor(SCA_EventManager* eventmgr, double resetmargin, bool bFindMaterial, const STR_String& touchedpropname, - class KX_Scene* kxscene, - PyTypeObject* T) + class KX_Scene* kxscene) : KX_NearSensor( eventmgr, @@ -61,8 +60,8 @@ KX_RadarSensor::KX_RadarSensor(SCA_EventManager* eventmgr, bFindMaterial, touchedpropname, kxscene, - physCtrl, - T), + physCtrl), + m_coneradius(coneradius), m_coneheight(coneheight), m_axis(axis) @@ -245,21 +244,15 @@ PyTypeObject KX_RadarSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_RadarSensor::Parents[] = { - &KX_RadarSensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &KX_NearSensor::Type, - &KX_TouchSensor::Type, - &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_RadarSensor::Methods[] = { @@ -283,16 +276,3 @@ PyAttributeDef KX_RadarSensor::Attributes[] = { {NULL} //Sentinel }; -PyObject* KX_RadarSensor::py_getattro(PyObject *attr) -{ - py_getattro_up(KX_NearSensor); -} - -PyObject* KX_RadarSensor::py_getattro_dict() { - py_getattro_dict_up(KX_NearSensor); -} - -int KX_RadarSensor::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(KX_NearSensor); -} diff --git a/source/gameengine/Ketsji/KX_RadarSensor.h b/source/gameengine/Ketsji/KX_RadarSensor.h index 2e5a0e68bed..344be0e399f 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.h +++ b/source/gameengine/Ketsji/KX_RadarSensor.h @@ -70,8 +70,7 @@ public: double resetmargin, bool bFindMaterial, const STR_String& touchedpropname, - class KX_Scene* kxscene, - PyTypeObject* T = &Type); + class KX_Scene* kxscene); KX_RadarSensor(); virtual ~KX_RadarSensor(); virtual void SynchronizeTransform(); @@ -89,9 +88,7 @@ public: KX_RADAR_AXIS_NEG_Z }; - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); + /* python */ virtual sensortype GetSensorType() { return ST_RADAR; } //Deprecated -----> diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index 78a61e9d95e..3f27496df71 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -55,9 +55,8 @@ KX_RaySensor::KX_RaySensor(class SCA_EventManager* eventmgr, bool bXRay, double distance, int axis, - KX_Scene* ketsjiScene, - PyTypeObject* T) - : SCA_ISensor(gameobj,eventmgr, T), + KX_Scene* ketsjiScene) + : SCA_ISensor(gameobj,eventmgr), m_propertyname(propname), m_bFindMaterial(bFindMaterial), m_bXRay(bXRay), @@ -336,20 +335,16 @@ PyTypeObject KX_RaySensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods - -}; - -PyParentObject KX_RaySensor::Parents[] = { - &KX_RaySensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new + }; PyMethodDef KX_RaySensor::Methods[] = { @@ -447,18 +442,4 @@ PyObject* KX_RaySensor::PyGetHitNormal() return retVal; } - - -PyObject* KX_RaySensor::py_getattro(PyObject *attr) { - py_getattro_up(SCA_ISensor); -} - -PyObject* KX_RaySensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int KX_RaySensor::py_setattro(PyObject *attr, PyObject *value) { - py_setattro_up(SCA_ISensor); -} - // <----- Deprecated diff --git a/source/gameengine/Ketsji/KX_RaySensor.h b/source/gameengine/Ketsji/KX_RaySensor.h index 9efb046742f..530c8ce54e5 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.h +++ b/source/gameengine/Ketsji/KX_RaySensor.h @@ -62,8 +62,7 @@ public: bool bXRay, double distance, int axis, - class KX_Scene* ketsjiScene, - PyTypeObject* T = &Type); + class KX_Scene* ketsjiScene); virtual ~KX_RaySensor(); virtual CValue* GetReplica(); @@ -84,11 +83,6 @@ public: KX_RAY_AXIS_NEG_Y, KX_RAY_AXIS_NEG_Z }; - - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); // Deprecated -----> KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetHitObject); diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index 75435b97797..239c4a0be67 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -55,10 +55,9 @@ KX_SCA_AddObjectActuator::KX_SCA_AddObjectActuator(SCA_IObject *gameobj, const float *linvel, bool linv_local, const float *angvel, - bool angv_local, - PyTypeObject* T) + bool angv_local) : - SCA_IActuator(gameobj, T), + SCA_IActuator(gameobj), m_OriginalObject(original), m_scene(scene), @@ -187,20 +186,17 @@ PyTypeObject KX_SCA_AddObjectActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_SCA_AddObjectActuator::Parents[] = { - &KX_SCA_AddObjectActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; + PyMethodDef KX_SCA_AddObjectActuator::Methods[] = { // ---> deprecated {"setTime", (PyCFunction) KX_SCA_AddObjectActuator::sPySetTime, METH_O, (PY_METHODCHAR)SetTime_doc}, @@ -263,21 +259,6 @@ PyObject* KX_SCA_AddObjectActuator::pyattr_get_objectLastCreated(void *self, con return actuator->m_lastCreatedObject->GetProxy(); } - -PyObject* KX_SCA_AddObjectActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_SCA_AddObjectActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_SCA_AddObjectActuator::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(SCA_IActuator); -} - /* 1. setObject */ const char KX_SCA_AddObjectActuator::SetObject_doc[] = "setObject(object)\n" @@ -316,7 +297,7 @@ const char KX_SCA_AddObjectActuator::SetTime_doc[] = PyObject* KX_SCA_AddObjectActuator::PySetTime(PyObject* value) { ShowDeprecationWarning("setTime()", "the time property"); - int deltatime = PyInt_AsLong(value); + int deltatime = PyLong_AsSsize_t(value); if (deltatime==-1 && PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "expected an int"); return NULL; @@ -339,7 +320,7 @@ const char KX_SCA_AddObjectActuator::GetTime_doc[] = PyObject* KX_SCA_AddObjectActuator::PyGetTime() { ShowDeprecationWarning("getTime()", "the time property"); - return PyInt_FromLong(m_timeProp); + return PyLong_FromSsize_t(m_timeProp); } @@ -361,7 +342,7 @@ PyObject* KX_SCA_AddObjectActuator::PyGetObject(PyObject* args) Py_RETURN_NONE; if (ret_name_only) - return PyString_FromString(m_OriginalObject->GetName().ReadPtr()); + return PyUnicode_FromString(m_OriginalObject->GetName().ReadPtr()); else return m_OriginalObject->GetProxy(); } diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h index 6746b7d1bc6..3151e7a89ca 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h @@ -88,8 +88,7 @@ public: const float *linvel, bool linv_local, const float *angvel, - bool angv_local, - PyTypeObject* T=&Type + bool angv_local ); ~KX_SCA_AddObjectActuator(void); @@ -110,10 +109,6 @@ public: virtual bool Update(); - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); - SCA_IObject* GetLastCreatedObject( ) const ; diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp index a50764a54e6..423fd0db7f2 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp @@ -47,9 +47,7 @@ /* Integration hooks ------------------------------------------------------- */ - PyTypeObject - -KX_SCA_DynamicActuator::Type = { +PyTypeObject KX_SCA_DynamicActuator::Type = { #if (PY_VERSION_HEX >= 0x02060000) PyVarObject_HEAD_INIT(NULL, 0) #else @@ -66,22 +64,17 @@ KX_SCA_DynamicActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_SCA_DynamicActuator::Parents[] = { - &KX_SCA_DynamicActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; - PyMethodDef KX_SCA_DynamicActuator::Methods[] = { // ---> deprecated KX_PYMETHODTABLE(KX_SCA_DynamicActuator, setOperation), @@ -96,21 +89,6 @@ PyAttributeDef KX_SCA_DynamicActuator::Attributes[] = { }; -PyObject* KX_SCA_DynamicActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_SCA_DynamicActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_SCA_DynamicActuator::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(SCA_IActuator); -} - - /* 1. setOperation */ KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, setOperation, "setOperation(operation?)\n" @@ -142,7 +120,7 @@ KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, getOperation, ) { ShowDeprecationWarning("getOperation()", "the mode property"); - return PyInt_FromLong((long)m_dyn_operation); + return PyLong_FromSsize_t((long)m_dyn_operation); } @@ -152,10 +130,9 @@ KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, getOperation, KX_SCA_DynamicActuator::KX_SCA_DynamicActuator(SCA_IObject *gameobj, short dyn_operation, - float setmass, - PyTypeObject* T) : + float setmass) : - SCA_IActuator(gameobj, T), + SCA_IActuator(gameobj), m_dyn_operation(dyn_operation), m_setmass(setmass) { diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h index 4add707f8cd..8b598c9ecfa 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h @@ -50,8 +50,7 @@ class KX_SCA_DynamicActuator : public SCA_IActuator KX_SCA_DynamicActuator( SCA_IObject* gameobj, short dyn_operation, - float setmass, - PyTypeObject* T=&Type + float setmass ); ~KX_SCA_DynamicActuator( @@ -73,11 +72,6 @@ class KX_SCA_DynamicActuator : public SCA_IActuator KX_DYN_SET_MASS, }; - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - /* 1. setOperation */ KX_PYMETHOD_DOC(KX_SCA_DynamicActuator,setOperation); KX_PYMETHOD_DOC(KX_SCA_DynamicActuator,getOperation); diff --git a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp index 728254e7f48..47c5c3aeeeb 100644 --- a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp @@ -43,9 +43,8 @@ #endif KX_SCA_EndObjectActuator::KX_SCA_EndObjectActuator(SCA_IObject *gameobj, - SCA_IScene* scene, - PyTypeObject* T): - SCA_IActuator(gameobj, T), + SCA_IScene* scene): + SCA_IActuator(gameobj), m_scene(scene) { // intentionally empty @@ -108,24 +107,17 @@ PyTypeObject KX_SCA_EndObjectActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - - -PyParentObject KX_SCA_EndObjectActuator::Parents[] = { - &KX_SCA_EndObjectActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; - - PyMethodDef KX_SCA_EndObjectActuator::Methods[] = { {NULL,NULL} //Sentinel }; @@ -134,13 +126,4 @@ PyAttributeDef KX_SCA_EndObjectActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_SCA_EndObjectActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_SCA_EndObjectActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - /* eof */ diff --git a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h index 70d72f1f8da..782a24b1ef1 100644 --- a/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h @@ -47,8 +47,7 @@ class KX_SCA_EndObjectActuator : public SCA_IActuator public: KX_SCA_EndObjectActuator( SCA_IObject* gameobj, - SCA_IScene* scene, - PyTypeObject* T=&Type + SCA_IScene* scene ); ~KX_SCA_EndObjectActuator(); @@ -63,9 +62,6 @@ class KX_SCA_EndObjectActuator : public SCA_IActuator /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); }; /* end of class KX_EditObjectActuator : public SCA_PropertyActuator */ diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp index 00842d7012a..2884bb76565 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp @@ -50,9 +50,7 @@ /* Integration hooks ------------------------------------------------------- */ - PyTypeObject - -KX_SCA_ReplaceMeshActuator::Type = { +PyTypeObject KX_SCA_ReplaceMeshActuator::Type = { #if (PY_VERSION_HEX >= 0x02060000) PyVarObject_HEAD_INIT(NULL, 0) #else @@ -69,23 +67,17 @@ KX_SCA_ReplaceMeshActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_SCA_ReplaceMeshActuator::Parents[] = { - &KX_SCA_ReplaceMeshActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; - - PyMethodDef KX_SCA_ReplaceMeshActuator::Methods[] = { KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, instantReplaceMesh), // Deprecated -----> @@ -99,20 +91,6 @@ PyAttributeDef KX_SCA_ReplaceMeshActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_SCA_ReplaceMeshActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_SCA_ReplaceMeshActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_SCA_ReplaceMeshActuator::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(SCA_IActuator); -} - PyObject* KX_SCA_ReplaceMeshActuator::pyattr_get_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) { KX_SCA_ReplaceMeshActuator* actuator = static_cast(self); @@ -161,7 +139,7 @@ KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, getMesh, if (!m_mesh) Py_RETURN_NONE; - return PyString_FromString(const_cast(m_mesh->GetName().ReadPtr())); + return PyUnicode_FromString(const_cast(m_mesh->GetName().ReadPtr())); } @@ -178,10 +156,9 @@ KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, instantReplaceMesh, KX_SCA_ReplaceMeshActuator::KX_SCA_ReplaceMeshActuator(SCA_IObject *gameobj, class RAS_MeshObject *mesh, - SCA_IScene* scene, - PyTypeObject* T) : + SCA_IScene* scene) : - SCA_IActuator(gameobj, T), + SCA_IActuator(gameobj), m_mesh(mesh), m_scene(scene) { diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h index 0e7f7852701..6a68bd88cc5 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h @@ -55,9 +55,7 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator KX_SCA_ReplaceMeshActuator( SCA_IObject* gameobj, RAS_MeshObject *mesh, - SCA_IScene* scene, - PyTypeObject* T=&Type - ); + SCA_IScene* scene); ~KX_SCA_ReplaceMeshActuator( ); @@ -71,10 +69,7 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator void InstantReplaceMesh(); - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); - + /* python api */ static PyObject* pyattr_get_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index c0d8a7090c4..51f5276e075 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -138,7 +138,7 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice, class SND_IAudioDevice* adi, const STR_String& sceneName, Scene *scene): - PyObjectPlus(&KX_Scene::Type), + PyObjectPlus(), m_keyboardmgr(NULL), m_mousemgr(NULL), m_sceneConverter(NULL), @@ -1629,17 +1629,15 @@ PyTypeObject KX_Scene::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_Scene::Parents[] = { - &KX_Scene::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_Scene::Methods[] = { @@ -1654,7 +1652,7 @@ PyMethodDef KX_Scene::Methods[] = { PyObject* KX_Scene::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_Scene* self= static_cast(self_v); - return PyString_FromString(self->GetName().ReadPtr()); + return PyUnicode_FromString(self->GetName().ReadPtr()); } PyObject* KX_Scene::pyattr_get_objects(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) @@ -1730,72 +1728,6 @@ PyAttributeDef KX_Scene::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_Scene::py_getattro__internal(PyObject *attr) -{ - py_getattro_up(PyObjectPlus); -} - -int KX_Scene::py_setattro__internal(PyObject *attr, PyObject *value) -{ - py_setattro_up(PyObjectPlus); -} - -PyObject* KX_Scene::py_getattro(PyObject *attr) -{ - PyObject *object = py_getattro__internal(attr); - - if (object==NULL) - { - PyErr_Clear(); - object = PyDict_GetItem(m_attr_dict, attr); - if(object) { - Py_INCREF(object); - } - else { - PyErr_Format(PyExc_AttributeError, "value = scene.myAttr: KX_Scene, attribute \"%s\" not found", PyString_AsString(attr)); - } - } - - return object; -} - -PyObject* KX_Scene::py_getattro_dict() { - //py_getattro_dict_up(PyObjectPlus); - - PyObject *dict= py_getattr_dict(PyObjectPlus::py_getattro_dict(), Type.tp_dict); - if(dict==NULL) - return NULL; - - /* normally just return this but KX_Scene has some more items */ - - PyDict_Update(dict, m_attr_dict); - return dict; -} - -int KX_Scene::py_setattro(PyObject *attr, PyObject *value) -{ - int ret= py_setattro__internal(attr, value); - - if (ret==PY_SET_ATTR_MISSING) { - if (PyDict_SetItem(m_attr_dict, attr, value)==0) { - PyErr_Clear(); - ret= PY_SET_ATTR_SUCCESS; - } - else { - PyErr_SetString(PyExc_AttributeError, "scene.UserAttr = value: KX_Scenes, failed assigning value to internal dictionary"); - ret= PY_SET_ATTR_FAIL; - } - } - - return ret; -} - -int KX_Scene::py_delattro(PyObject *attr) -{ - PyDict_DelItem(m_attr_dict, attr); - return 0; -} - KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getLightList, "getLightList() -> list [KX_Light]\n" "Returns a list of all lights in the scene.\n" @@ -1820,7 +1752,7 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getName, ) { ShowDeprecationWarning("getName()", "the name property"); - return PyString_FromString(GetName()); + return PyUnicode_FromString(GetName()); } KX_PYMETHODDEF_DOC(KX_Scene, addObject, diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 79d3f7fd828..2792f1f5fe4 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -563,15 +563,7 @@ public: static PyObject* pyattr_get_active_camera(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); - virtual PyObject* py_getattro(PyObject *attr); /* name, active_camera, gravity, suspended, viewport, framing, activity_culling, activity_culling_radius */ - virtual PyObject* py_getattro_dict(); - - virtual int py_setattro(PyObject *attr, PyObject *value); - virtual int py_delattro(PyObject *attr); - virtual PyObject* py_repr(void) { return PyString_FromString(GetName().ReadPtr()); } - - PyObject* py_getattro__internal(PyObject *attr); - int py_setattro__internal(PyObject *attr, PyObject *pyvalue); + virtual PyObject* py_repr(void) { return PyUnicode_FromString(GetName().ReadPtr()); } /** * Sets the time the scene was suspended diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index 1b790ec9824..5528e58ef77 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -49,9 +49,8 @@ KX_SceneActuator::KX_SceneActuator(SCA_IObject *gameobj, KX_Scene *scene, KX_KetsjiEngine* ketsjiEngine, const STR_String& nextSceneName, - KX_Camera* camera, - PyTypeObject* T) - : SCA_IActuator(gameobj, T) + KX_Camera* camera) + : SCA_IActuator(gameobj) { m_mode = mode; m_scene = scene; @@ -134,7 +133,7 @@ bool KX_SceneActuator::Update() { // if no camera is set and the parent object is a camera, use it as the camera SCA_IObject* parent = GetParent(); - if (parent->isA(&KX_Camera::Type)) + if (parent->GetGameObjectType()==SCA_IObject::OBJ_CAMERA) { m_scene->SetActiveCamera((KX_Camera*)parent); } @@ -239,26 +238,17 @@ PyTypeObject KX_SceneActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject KX_SceneActuator::Parents[] = -{ - &KX_SceneActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; - - PyMethodDef KX_SceneActuator::Methods[] = { //Deprecated functions ------> @@ -280,20 +270,6 @@ PyAttributeDef KX_SceneActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_SceneActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_SceneActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_SceneActuator::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_IActuator); -} - PyObject* KX_SceneActuator::pyattr_get_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) { KX_SceneActuator* actuator = static_cast(self); @@ -355,7 +331,7 @@ const char KX_SceneActuator::GetUseRestart_doc[] = PyObject* KX_SceneActuator::PyGetUseRestart() { ShowDeprecationWarning("getUseRestart()", "the useRestart property"); - return PyInt_FromLong(!(m_restart == 0)); + return PyLong_FromSsize_t(!(m_restart == 0)); } @@ -391,7 +367,7 @@ const char KX_SceneActuator::GetScene_doc[] = PyObject* KX_SceneActuator::PyGetScene() { ShowDeprecationWarning("getScene()", "the scene property"); - return PyString_FromString(m_nextSceneName); + return PyUnicode_FromString(m_nextSceneName); } @@ -432,7 +408,7 @@ PyObject* KX_SceneActuator::PyGetCamera() { ShowDeprecationWarning("getCamera()", "the camera property"); if (m_camera) { - return PyString_FromString(m_camera->GetName()); + return PyUnicode_FromString(m_camera->GetName()); } else { Py_RETURN_NONE; diff --git a/source/gameengine/Ketsji/KX_SceneActuator.h b/source/gameengine/Ketsji/KX_SceneActuator.h index 2412dd02590..86de3395d1e 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.h +++ b/source/gameengine/Ketsji/KX_SceneActuator.h @@ -77,8 +77,7 @@ class KX_SceneActuator : public SCA_IActuator KX_Scene* scene, KX_KetsjiEngine* ketsjiEngine, const STR_String& nextSceneName, - KX_Camera* camera, - PyTypeObject* T=&Type); + KX_Camera* camera); virtual ~KX_SceneActuator(); virtual CValue* GetReplica(); @@ -92,10 +91,6 @@ class KX_SceneActuator : public SCA_IActuator /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - /* 1. set */ /* Removed */ diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index c13271f66a5..673f42283dd 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -50,9 +50,8 @@ KX_SoundActuator::KX_SoundActuator(SCA_IObject* gameobj, SND_Scene* sndscene, KX_SOUNDACT_TYPE type, short start, - short end, - PyTypeObject* T) - : SCA_IActuator(gameobj,T) + short end) + : SCA_IActuator(gameobj) { m_soundObject = sndobj; m_soundScene = sndscene; @@ -250,25 +249,17 @@ PyTypeObject KX_SoundActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject KX_SoundActuator::Parents[] = { - &KX_SoundActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; - - PyMethodDef KX_SoundActuator::Methods[] = { // Deprecated -----> {"setFilename", (PyCFunction) KX_SoundActuator::sPySetFilename, METH_VARARGS,NULL}, @@ -340,25 +331,13 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_SoundActuator, stopSound, } /* Atribute setting and getting -------------------------------------------- */ -PyObject* KX_SoundActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_SoundActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_SoundActuator::py_setattro(PyObject *attr, PyObject* value) { - py_setattro_up(SCA_IActuator); -} PyObject* KX_SoundActuator::pyattr_get_filename(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) { KX_SoundActuator * actuator = static_cast (self); if (!actuator->m_soundObject) { - return PyString_FromString(""); + return PyUnicode_FromString(""); } STR_String objectname = actuator->m_soundObject->GetObjectName(); char* name = objectname.Ptr(); @@ -367,7 +346,7 @@ PyObject* KX_SoundActuator::pyattr_get_filename(void *self, const struct KX_PYAT PyErr_SetString(PyExc_RuntimeError, "value = actuator.fileName: KX_SoundActuator, unable to get sound fileName"); return NULL; } else - return PyString_FromString(name); + return PyUnicode_FromString(name); } PyObject* KX_SoundActuator::pyattr_get_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef) @@ -402,7 +381,7 @@ PyObject* KX_SoundActuator::pyattr_get_looping(void *self, const struct KX_PYATT { KX_SoundActuator * actuator = static_cast (self); int looping = (actuator->m_soundObject) ? actuator->m_soundObject->GetLoopMode() : (int)SND_LOOP_OFF; - PyObject* result = PyInt_FromLong(looping); + PyObject* result = PyLong_FromSsize_t(looping); return result; } @@ -580,7 +559,7 @@ PyObject* KX_SoundActuator::PyGetFilename() ShowDeprecationWarning("getFilename()", "the fileName property"); if (!m_soundObject) { - return PyString_FromString(""); + return PyUnicode_FromString(""); } STR_String objectname = m_soundObject->GetObjectName(); char* name = objectname.Ptr(); @@ -589,7 +568,7 @@ PyObject* KX_SoundActuator::PyGetFilename() PyErr_SetString(PyExc_RuntimeError, "Unable to get sound fileName"); return NULL; } else - return PyString_FromString(name); + return PyUnicode_FromString(name); } PyObject* KX_SoundActuator::PySetGain(PyObject* args) @@ -689,7 +668,7 @@ PyObject* KX_SoundActuator::PyGetLooping() { ShowDeprecationWarning("getLooping()", "the looping property"); int looping = (m_soundObject) ? m_soundObject->GetLoopMode() : (int)SND_LOOP_OFF; - PyObject* result = PyInt_FromLong(looping); + PyObject* result = PyLong_FromSsize_t(looping); return result; } @@ -777,7 +756,7 @@ PyObject* KX_SoundActuator::PySetType(PyObject* args) PyObject* KX_SoundActuator::PyGetType() { ShowDeprecationWarning("getType()", "the mode property"); - return PyInt_FromLong(m_type); + return PyLong_FromSsize_t(m_type); } // <----- diff --git a/source/gameengine/Ketsji/KX_SoundActuator.h b/source/gameengine/Ketsji/KX_SoundActuator.h index a7491355667..adafee0a30b 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.h +++ b/source/gameengine/Ketsji/KX_SoundActuator.h @@ -66,8 +66,7 @@ public: class SND_Scene* sndscene, KX_SOUNDACT_TYPE type, short start, - short end, - PyTypeObject* T=&Type); + short end); ~KX_SoundActuator(); @@ -81,10 +80,6 @@ public: /* Python interface --------------------------------------------------- */ /* -------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); - KX_PYMETHOD_DOC_NOARGS(KX_SoundActuator, startSound); KX_PYMETHOD_DOC_NOARGS(KX_SoundActuator, pauseSound); KX_PYMETHOD_DOC_NOARGS(KX_SoundActuator, stopSound); diff --git a/source/gameengine/Ketsji/KX_StateActuator.cpp b/source/gameengine/Ketsji/KX_StateActuator.cpp index f6979eee0f4..9815d6274aa 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.cpp +++ b/source/gameengine/Ketsji/KX_StateActuator.cpp @@ -38,10 +38,9 @@ KX_StateActuator::KX_StateActuator( SCA_IObject* gameobj, int operation, - unsigned int mask, - PyTypeObject* T + unsigned int mask ) - : SCA_IActuator(gameobj,T), + : SCA_IActuator(gameobj), m_operation(operation), m_mask(mask) { @@ -154,24 +153,18 @@ PyTypeObject KX_StateActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject -KX_StateActuator::Parents[] = { - &KX_StateActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; -PyMethodDef -KX_StateActuator::Methods[] = { +PyMethodDef KX_StateActuator::Methods[] = { // deprecated --> {"setOperation", (PyCFunction) KX_StateActuator::sPySetOperation, METH_VARARGS, (PY_METHODCHAR)SetOperation_doc}, @@ -187,20 +180,6 @@ PyAttributeDef KX_StateActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_StateActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_StateActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_StateActuator::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(SCA_IActuator); -} - /* set operation ---------------------------------------------------------- */ const char diff --git a/source/gameengine/Ketsji/KX_StateActuator.h b/source/gameengine/Ketsji/KX_StateActuator.h index a4191a4c5fd..ce86c4b44fe 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.h +++ b/source/gameengine/Ketsji/KX_StateActuator.h @@ -66,9 +66,8 @@ class KX_StateActuator : public SCA_IActuator KX_StateActuator( SCA_IObject* gameobj, int operation, - unsigned int mask, - PyTypeObject* T=&Type - ); + unsigned int mask + ); virtual ~KX_StateActuator( @@ -89,10 +88,6 @@ class KX_StateActuator : public SCA_IActuator /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); //KX_PYMETHOD_DOC KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetOperation); KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetMask); diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index c06acd4a873..b0cf172c27a 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -97,8 +97,8 @@ bool KX_TouchSensor::Evaluate() return result; } -KX_TouchSensor::KX_TouchSensor(SCA_EventManager* eventmgr,KX_GameObject* gameobj,bool bFindMaterial,bool bTouchPulse,const STR_String& touchedpropname,PyTypeObject* T) -:SCA_ISensor(gameobj,eventmgr,T), +KX_TouchSensor::KX_TouchSensor(SCA_EventManager* eventmgr,KX_GameObject* gameobj,bool bFindMaterial,bool bTouchPulse,const STR_String& touchedpropname) +:SCA_ISensor(gameobj,eventmgr), m_touchedpropname(touchedpropname), m_bFindMaterial(bFindMaterial), m_bTouchPulse(bTouchPulse), @@ -310,19 +310,15 @@ PyTypeObject KX_TouchSensor::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_TouchSensor::Parents[] = { - &KX_TouchSensor::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_ISensor::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_TouchSensor::Methods[] = { @@ -348,20 +344,6 @@ PyAttributeDef KX_TouchSensor::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_TouchSensor::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_ISensor); -} - -PyObject* KX_TouchSensor::py_getattro_dict() { - py_getattro_dict_up(SCA_ISensor); -} - -int KX_TouchSensor::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_ISensor); -} - /* Python API */ /* 1. setProperty */ @@ -374,7 +356,7 @@ const char KX_TouchSensor::SetProperty_doc[] = PyObject* KX_TouchSensor::PySetProperty(PyObject* value) { ShowDeprecationWarning("setProperty()", "the propName property"); - char *nameArg= PyString_AsString(value); + char *nameArg= _PyUnicode_AsString(value); if (nameArg==NULL) { PyErr_SetString(PyExc_ValueError, "expected a "); return NULL; @@ -392,7 +374,7 @@ const char KX_TouchSensor::GetProperty_doc[] = PyObject* KX_TouchSensor::PyGetProperty() { ShowDeprecationWarning("getProperty()", "the propName property"); - return PyString_FromString(m_touchedpropname); + return PyUnicode_FromString(m_touchedpropname); } const char KX_TouchSensor::GetHitObject_doc[] = @@ -433,7 +415,7 @@ const char KX_TouchSensor::GetTouchMaterial_doc[] = PyObject* KX_TouchSensor::PyGetTouchMaterial() { ShowDeprecationWarning("getTouchMaterial()", "the useMaterial property"); - return PyInt_FromLong(m_bFindMaterial); + return PyLong_FromSsize_t(m_bFindMaterial); } /* 6. setTouchMaterial */ @@ -446,7 +428,7 @@ const char KX_TouchSensor::SetTouchMaterial_doc[] = PyObject* KX_TouchSensor::PySetTouchMaterial(PyObject *value) { ShowDeprecationWarning("setTouchMaterial()", "the useMaterial property"); - int pulseArg = PyInt_AsLong(value); + int pulseArg = PyLong_AsSsize_t(value); if(pulseArg ==-1 && PyErr_Occurred()) { PyErr_SetString(PyExc_ValueError, "expected a bool"); diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index 476c63e89db..6cbf5b15e3b 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -79,8 +79,7 @@ public: class KX_GameObject* gameobj, bool bFindMaterial, bool bTouchPulse, - const STR_String& touchedpropname, - PyTypeObject* T=&Type) ; + const STR_String& touchedpropname) ; virtual ~KX_TouchSensor(); virtual CValue* GetReplica(); @@ -121,10 +120,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); //Deprecated -----> /* 1. setProperty */ diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index 5a50d0fb944..e8a06d8d619 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -59,10 +59,8 @@ KX_TrackToActuator::KX_TrackToActuator(SCA_IObject *gameobj, int time, bool allow3D, int trackflag, - int upflag, - PyTypeObject* T) - : - SCA_IActuator(gameobj, T) + int upflag) + : SCA_IActuator(gameobj) { m_time = time; m_allow3D = allow3D; @@ -74,7 +72,6 @@ KX_TrackToActuator::KX_TrackToActuator(SCA_IObject *gameobj, if (m_object) m_object->RegisterActuator(this); - if (gameobj->isA(&KX_GameObject::Type)) { // if the object is vertex parented, don't check parent orientation as the link is broken if (!((KX_GameObject*)gameobj)->IsVertexParent()){ @@ -450,25 +447,17 @@ PyTypeObject KX_TrackToActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - - - -PyParentObject KX_TrackToActuator::Parents[] = { - &KX_TrackToActuator::Type, - &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &SCA_IActuator::Type, + 0,0,0,0,0,0, + py_base_new }; - - PyMethodDef KX_TrackToActuator::Methods[] = { // ---> deprecated {"setTime", (PyCFunction) KX_TrackToActuator::sPySetTime, METH_VARARGS, (PY_METHODCHAR)SetTime_doc}, @@ -518,20 +507,6 @@ int KX_TrackToActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUT } -PyObject* KX_TrackToActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_TrackToActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_TrackToActuator::py_setattro(PyObject *attr, PyObject* value) -{ - py_setattro_up(SCA_IActuator); -} - /* 1. setObject */ const char KX_TrackToActuator::SetObject_doc[] = "setObject(object)\n" @@ -576,7 +551,7 @@ PyObject* KX_TrackToActuator::PyGetObject(PyObject* args) Py_RETURN_NONE; if (ret_name_only) - return PyString_FromString(m_object->GetName()); + return PyUnicode_FromString(m_object->GetName()); else return m_object->GetProxy(); } @@ -613,7 +588,7 @@ const char KX_TrackToActuator::GetTime_doc[] = PyObject* KX_TrackToActuator::PyGetTime() { ShowDeprecationWarning("getTime()", "the timer property"); - return PyInt_FromLong(m_time); + return PyLong_FromSsize_t(m_time); } @@ -625,7 +600,7 @@ const char KX_TrackToActuator::GetUse3D_doc[] = PyObject* KX_TrackToActuator::PyGetUse3D() { ShowDeprecationWarning("setTime()", "the use3D property"); - return PyInt_FromLong(!(m_allow3D == 0)); + return PyLong_FromSsize_t(!(m_allow3D == 0)); } diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.h b/source/gameengine/Ketsji/KX_TrackToActuator.h index c4cc2b1f062..801e695bb9b 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.h +++ b/source/gameengine/Ketsji/KX_TrackToActuator.h @@ -56,7 +56,7 @@ class KX_TrackToActuator : public SCA_IActuator public: KX_TrackToActuator(SCA_IObject* gameobj, SCA_IObject *ob, int time, - bool threedee,int trackflag,int upflag, PyTypeObject* T=&Type); + bool threedee,int trackflag,int upflag); virtual ~KX_TrackToActuator(); virtual CValue* GetReplica() { KX_TrackToActuator* replica = new KX_TrackToActuator(*this); @@ -70,9 +70,6 @@ class KX_TrackToActuator : public SCA_IActuator virtual bool Update(double curtime, bool frame); /* Python part */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject* value); /* These are used to get and set m_ob */ static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp index 8146d04a878..7001bfc8b7e 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp @@ -16,8 +16,8 @@ KX_VehicleWrapper::KX_VehicleWrapper( PHY_IVehicle* vehicle, - PHY_IPhysicsEnvironment* physenv,PyTypeObject *T) : - PyObjectPlus(T), + PHY_IPhysicsEnvironment* physenv) : + PyObjectPlus(), m_vehicle(vehicle), m_physenv(physenv) { @@ -127,13 +127,13 @@ PyObject* KX_VehicleWrapper::PyGetWheelOrientationQuaternion(PyObject* args) PyObject* KX_VehicleWrapper::PyGetNumWheels(PyObject* args) { - return PyInt_FromLong(m_vehicle->GetNumWheels()); + return PyLong_FromSsize_t(m_vehicle->GetNumWheels()); } PyObject* KX_VehicleWrapper::PyGetConstraintId(PyObject* args) { - return PyInt_FromLong(m_vehicle->GetUserConstraintId()); + return PyLong_FromSsize_t(m_vehicle->GetUserConstraintId()); } @@ -264,7 +264,7 @@ PyObject* KX_VehicleWrapper::PySetSteeringValue(PyObject* args) PyObject* KX_VehicleWrapper::PyGetConstraintType(PyObject* args) { - return PyInt_FromLong(m_vehicle->GetUserConstraintType()); + return PyLong_FromSsize_t(m_vehicle->GetUserConstraintType()); } @@ -289,35 +289,17 @@ PyTypeObject KX_VehicleWrapper::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_VehicleWrapper::Parents[] = { - &KX_VehicleWrapper::Type, - &PyObjectPlus::Type, - NULL -}; - -PyObject* KX_VehicleWrapper::py_getattro(PyObject *attr) -{ - //here you can search for existing data members (like mass,friction etc.) - py_getattro_up(PyObjectPlus); -} - -PyObject* KX_VehicleWrapper::py_getattro_dict() { - py_getattro_dict_up(PyObjectPlus); -} - -int KX_VehicleWrapper::py_setattro(PyObject *attr,PyObject* value) -{ - py_setattro_up(PyObjectPlus); + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, + &PyObjectPlus::Type, + 0,0,0,0,0,0, + py_base_new }; - PyMethodDef KX_VehicleWrapper::Methods[] = { {"addWheel",(PyCFunction) KX_VehicleWrapper::sPyAddWheel, METH_VARARGS}, {"getNumWheels",(PyCFunction) KX_VehicleWrapper::sPyGetNumWheels, METH_VARARGS}, diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.h b/source/gameengine/Ketsji/KX_VehicleWrapper.h index c2b5e3d9251..d7f2da5cd7c 100644 --- a/source/gameengine/Ketsji/KX_VehicleWrapper.h +++ b/source/gameengine/Ketsji/KX_VehicleWrapper.h @@ -12,14 +12,11 @@ class PHY_IMotionState; class KX_VehicleWrapper : public PyObjectPlus { Py_Header; - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); std::vector m_motionStates; public: - KX_VehicleWrapper(PHY_IVehicle* vehicle,class PHY_IPhysicsEnvironment* physenv,PyTypeObject *T = &Type); + KX_VehicleWrapper(PHY_IVehicle* vehicle,class PHY_IPhysicsEnvironment* physenv); virtual ~KX_VehicleWrapper (); int getConstraintId(); diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index 4b0ad083473..cb8c891969d 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -53,18 +53,15 @@ PyTypeObject KX_VertexProxy::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods -}; - -PyParentObject KX_VertexProxy::Parents[] = { - &KX_VertexProxy::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &CValue::Type, - &PyObjectPlus::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; PyMethodDef KX_VertexProxy::Methods[] = { @@ -85,37 +82,38 @@ PyMethodDef KX_VertexProxy::Methods[] = { PyAttributeDef KX_VertexProxy::Attributes[] = { //KX_PYATTRIBUTE_TODO("DummyProps"), - + KX_PYATTRIBUTE_DUMMY("x"), KX_PYATTRIBUTE_DUMMY("y"), KX_PYATTRIBUTE_DUMMY("z"), - + KX_PYATTRIBUTE_DUMMY("r"), KX_PYATTRIBUTE_DUMMY("g"), KX_PYATTRIBUTE_DUMMY("b"), KX_PYATTRIBUTE_DUMMY("a"), - + KX_PYATTRIBUTE_DUMMY("u"), KX_PYATTRIBUTE_DUMMY("v"), - + KX_PYATTRIBUTE_DUMMY("u2"), KX_PYATTRIBUTE_DUMMY("v2"), - + KX_PYATTRIBUTE_DUMMY("XYZ"), KX_PYATTRIBUTE_DUMMY("UV"), - + KX_PYATTRIBUTE_DUMMY("color"), KX_PYATTRIBUTE_DUMMY("colour"), - + KX_PYATTRIBUTE_DUMMY("normal"), - + { NULL } //Sentinel }; +#if 0 PyObject* KX_VertexProxy::py_getattro(PyObject *attr) { - char *attr_str= PyString_AsString(attr); + char *attr_str= _PyUnicode_AsString(attr); if (attr_str[1]=='\0') { // Group single letters // pos if (attr_str[0]=='x') @@ -141,8 +139,8 @@ KX_VertexProxy::py_getattro(PyObject *attr) if (attr_str[0]=='v') return PyFloat_FromDouble(m_vertex->getUV1()[1]); } - - + + if (!strcmp(attr_str, "XYZ")) return PyObjectFrom(MT_Vector3(m_vertex->getXYZ())); @@ -156,22 +154,21 @@ KX_VertexProxy::py_getattro(PyObject *attr) color /= 255.0; return PyObjectFrom(color); } - + if (!strcmp(attr_str, "normal")) { return PyObjectFrom(MT_Vector3(m_vertex->getNormal())); } - + py_getattro_up(CValue); } +#endif -PyObject* KX_VertexProxy::py_getattro_dict() { - py_getattro_dict_up(CValue); -} +#if 0 int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) { - char *attr_str= PyString_AsString(attr); + char *attr_str= _PyUnicode_AsString(attr); if (PySequence_Check(pyvalue)) { if (!strcmp(attr_str, "XYZ")) @@ -185,7 +182,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) } return PY_SET_ATTR_FAIL; } - + if (!strcmp(attr_str, "UV")) { MT_Point2 vec; @@ -197,7 +194,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) } return PY_SET_ATTR_FAIL; } - + if (!strcmp(attr_str, "color") || !strcmp(attr_str, "colour")) { MT_Vector4 vec; @@ -209,7 +206,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) } return PY_SET_ATTR_FAIL; } - + if (!strcmp(attr_str, "normal")) { MT_Vector3 vec; @@ -222,7 +219,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) return PY_SET_ATTR_FAIL; } } - + if (PyFloat_Check(pyvalue)) { float val = PyFloat_AsDouble(pyvalue); @@ -235,7 +232,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) m_mesh->SetMeshModified(true); return PY_SET_ATTR_SUCCESS; } - + if (!strcmp(attr_str, "y")) { pos.y() = val; @@ -243,7 +240,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) m_mesh->SetMeshModified(true); return PY_SET_ATTR_SUCCESS; } - + if (!strcmp(attr_str, "z")) { pos.z() = val; @@ -251,7 +248,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) m_mesh->SetMeshModified(true); return PY_SET_ATTR_SUCCESS; } - + // uv MT_Point2 uv = m_vertex->getUV1(); if (!strcmp(attr_str, "u")) @@ -287,7 +284,7 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) m_mesh->SetMeshModified(true); return PY_SET_ATTR_SUCCESS; } - + // col unsigned int icol = *((const unsigned int *)m_vertex->getRGBA()); unsigned char *cp = (unsigned char*) &icol; @@ -321,9 +318,10 @@ int KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue) return PY_SET_ATTR_SUCCESS; } } - + return CValue::py_setattro(attr, pyvalue); } +#endif KX_VertexProxy::KX_VertexProxy(KX_MeshProxy*mesh, RAS_TexVert* vertex) : m_vertex(vertex), @@ -339,7 +337,7 @@ KX_VertexProxy::~KX_VertexProxy() // stuff for cvalue related things CValue* KX_VertexProxy::Calc(VALUE_OPERATOR, CValue *) { return NULL;} -CValue* KX_VertexProxy::CalcFinal(VALUE_DATA_TYPE, VALUE_OPERATOR, CValue *) { return NULL;} +CValue* KX_VertexProxy::CalcFinal(VALUE_DATA_TYPE, VALUE_OPERATOR, CValue *) { return NULL;} STR_String sVertexName="vertex"; const STR_String & KX_VertexProxy::GetText() {return sVertexName;}; double KX_VertexProxy::GetNumber() { return -1;} @@ -348,7 +346,7 @@ void KX_VertexProxy::SetName(const char *) { }; CValue* KX_VertexProxy::GetReplica() { return NULL;} // stuff for python integration - + PyObject* KX_VertexProxy::PyGetXYZ() { return PyObjectFrom(MT_Point3(m_vertex->getXYZ())); @@ -359,7 +357,7 @@ PyObject* KX_VertexProxy::PySetXYZ(PyObject* value) MT_Point3 vec; if (!PyVecTo(value, vec)) return NULL; - + m_vertex->SetXYZ(vec); m_mesh->SetMeshModified(true); Py_RETURN_NONE; @@ -375,7 +373,7 @@ PyObject* KX_VertexProxy::PySetNormal(PyObject* value) MT_Vector3 vec; if (!PyVecTo(value, vec)) return NULL; - + m_vertex->SetNormal(vec); m_mesh->SetMeshModified(true); Py_RETURN_NONE; @@ -385,18 +383,18 @@ PyObject* KX_VertexProxy::PySetNormal(PyObject* value) PyObject* KX_VertexProxy::PyGetRGBA() { int *rgba = (int *) m_vertex->getRGBA(); - return PyInt_FromLong(*rgba); + return PyLong_FromSsize_t(*rgba); } PyObject* KX_VertexProxy::PySetRGBA(PyObject* value) { - if PyInt_Check(value) { - int rgba = PyInt_AsLong(value); + if PyLong_Check(value) { + int rgba = PyLong_AsSsize_t(value); m_vertex->SetRGBA(rgba); m_mesh->SetMeshModified(true); Py_RETURN_NONE; } - else { + else { MT_Vector4 vec; if (PyVecTo(value, vec)) { @@ -405,7 +403,7 @@ PyObject* KX_VertexProxy::PySetRGBA(PyObject* value) Py_RETURN_NONE; } } - + PyErr_SetString(PyExc_TypeError, "vert.setRGBA(value): KX_VertexProxy, expected a 4D vector or an int"); return NULL; } @@ -421,7 +419,7 @@ PyObject* KX_VertexProxy::PySetUV(PyObject* value) MT_Point2 vec; if (!PyVecTo(value, vec)) return NULL; - + m_vertex->SetUV(vec); m_mesh->SetMeshModified(true); Py_RETURN_NONE; @@ -436,14 +434,14 @@ PyObject* KX_VertexProxy::PySetUV2(PyObject* args) { MT_Point2 vec; unsigned int unit= RAS_TexVert::SECOND_UV; - + PyObject* list= NULL; if(!PyArg_ParseTuple(args, "O|i:setUV2", &list, &unit)) return NULL; - + if (!PyVecTo(list, vec)) return NULL; - + m_vertex->SetFlag((m_vertex->getFlag()|RAS_TexVert::SECOND_UV)); m_vertex->SetUnit(unit); m_vertex->SetUV2(vec); diff --git a/source/gameengine/Ketsji/KX_VertexProxy.h b/source/gameengine/Ketsji/KX_VertexProxy.h index 42db5fbc322..13c57e9f556 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.h +++ b/source/gameengine/Ketsji/KX_VertexProxy.h @@ -53,9 +53,6 @@ public: // stuff for python integration - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *pyvalue); KX_PYMETHOD_NOARGS(KX_VertexProxy,GetXYZ); KX_PYMETHOD_O(KX_VertexProxy,SetXYZ); diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp index d848065ad73..3561ccde9d9 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp @@ -39,10 +39,9 @@ KX_VisibilityActuator::KX_VisibilityActuator( SCA_IObject* gameobj, bool visible, bool occlusion, - bool recursive, - PyTypeObject* T + bool recursive ) - : SCA_IActuator(gameobj,T), + : SCA_IActuator(gameobj), m_visible(visible), m_occlusion(occlusion), m_recursive(recursive) @@ -108,25 +107,18 @@ PyTypeObject KX_VisibilityActuator::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0, - py_base_getattro, - py_base_setattro, 0,0,0,0,0,0,0,0,0, - Methods - -}; - -PyParentObject -KX_VisibilityActuator::Parents[] = { - &KX_VisibilityActuator::Type, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + 0,0,0,0,0,0,0, + Methods, + 0, + 0, &SCA_IActuator::Type, - &SCA_ILogicBrick::Type, - &CValue::Type, - NULL + 0,0,0,0,0,0, + py_base_new }; -PyMethodDef -KX_VisibilityActuator::Methods[] = { +PyMethodDef KX_VisibilityActuator::Methods[] = { // Deprecated -----> {"set", (PyCFunction) KX_VisibilityActuator::sPySetVisible, METH_VARARGS, (PY_METHODCHAR) SetVisible_doc}, @@ -141,21 +133,6 @@ PyAttributeDef KX_VisibilityActuator::Attributes[] = { { NULL } //Sentinel }; -PyObject* KX_VisibilityActuator::py_getattro(PyObject *attr) -{ - py_getattro_up(SCA_IActuator); -} - -PyObject* KX_VisibilityActuator::py_getattro_dict() { - py_getattro_dict_up(SCA_IActuator); -} - -int KX_VisibilityActuator::py_setattro(PyObject *attr, PyObject *value) -{ - py_setattro_up(SCA_IActuator); -} - - /* set visibility ---------------------------------------------------------- */ const char KX_VisibilityActuator::SetVisible_doc[] = diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.h b/source/gameengine/Ketsji/KX_VisibilityActuator.h index 45aba50f645..3ad50c6cea2 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.h +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.h @@ -48,9 +48,7 @@ class KX_VisibilityActuator : public SCA_IActuator SCA_IObject* gameobj, bool visible, bool occlusion, - bool recursive, - PyTypeObject* T=&Type - ); + bool recursive); virtual ~KX_VisibilityActuator( @@ -69,10 +67,6 @@ class KX_VisibilityActuator : public SCA_IActuator /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - virtual PyObject* py_getattro(PyObject *attr); - virtual PyObject* py_getattro_dict(); - virtual int py_setattro(PyObject *attr, PyObject *value); - // Deprecated -----> KX_PYMETHOD_DOC_VARARGS(KX_VisibilityActuator,SetVisible); // <----- diff --git a/source/gameengine/VideoTexture/FilterBlueScreen.cpp b/source/gameengine/VideoTexture/FilterBlueScreen.cpp index 6b23105a278..6d26e5b6d35 100644 --- a/source/gameengine/VideoTexture/FilterBlueScreen.cpp +++ b/source/gameengine/VideoTexture/FilterBlueScreen.cpp @@ -81,17 +81,17 @@ static int setColor (PyFilter * self, PyObject * value, void * closure) { // check validity of parameter if (value == NULL || !PySequence_Check(value) || PySequence_Length(value) != 3 - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 0)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 1)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 2))) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 0)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 1)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 2))) { PyErr_SetString(PyExc_TypeError, "The value must be a sequence of 3 ints"); return -1; } // set color - getFilter(self)->setColor((unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 0))), - (unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 1))), - (unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 2)))); + getFilter(self)->setColor((unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 0))), + (unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 1))), + (unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 2)))); // success return 0; } @@ -108,15 +108,15 @@ static int setLimits (PyFilter * self, PyObject * value, void * closure) { // check validity of parameter if (value == NULL || !PySequence_Check(value) || PySequence_Length(value) != 2 - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 0)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 1))) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 0)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 1))) { PyErr_SetString(PyExc_TypeError, "The value must be a sequence of 2 ints"); return -1; } // set limits - getFilter(self)->setLimits((unsigned short)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 0))), - (unsigned short)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 1)))); + getFilter(self)->setLimits((unsigned short)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 0))), + (unsigned short)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 1)))); // success return 0; } diff --git a/source/gameengine/VideoTexture/FilterColor.cpp b/source/gameengine/VideoTexture/FilterColor.cpp index 5ff1f7f11ce..eb86f520e02 100644 --- a/source/gameengine/VideoTexture/FilterColor.cpp +++ b/source/gameengine/VideoTexture/FilterColor.cpp @@ -147,10 +147,10 @@ static int setMatrix (PyFilter * self, PyObject * value, void * closure) for (int c = 0; valid && c < 5; ++c) { // item must be int - valid = PyInt_Check(PySequence_Fast_GET_ITEM(row, c)); + valid = PyLong_Check(PySequence_Fast_GET_ITEM(row, c)); // if it is valid, save it in matrix if (valid) - mat[r][c] = short(PyInt_AsLong(PySequence_Fast_GET_ITEM(row, c))); + mat[r][c] = short(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(row, c))); } } // if parameter is not valid, report error @@ -286,10 +286,10 @@ static int setLevels (PyFilter * self, PyObject * value, void * closure) for (int c = 0; valid && c < 2; ++c) { // item must be int - valid = PyInt_Check(PySequence_Fast_GET_ITEM(row, c)); + valid = PyLong_Check(PySequence_Fast_GET_ITEM(row, c)); // if it is valid, save it in matrix if (valid) - lev[r][c] = (unsigned short)(PyInt_AsLong(PySequence_Fast_GET_ITEM(row, c))); + lev[r][c] = (unsigned short)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(row, c))); } } // if parameter is not valid, report error diff --git a/source/gameengine/VideoTexture/FilterNormal.cpp b/source/gameengine/VideoTexture/FilterNormal.cpp index 9a2b1e90d5a..002be6c3189 100644 --- a/source/gameengine/VideoTexture/FilterNormal.cpp +++ b/source/gameengine/VideoTexture/FilterNormal.cpp @@ -72,13 +72,13 @@ static PyObject * getColor (PyFilter * self, void * closure) static int setColor (PyFilter * self, PyObject * value, void * closure) { // check validity of parameter - if (value == NULL || !PyInt_Check(value)) + if (value == NULL || !PyLong_Check(value)) { PyErr_SetString(PyExc_TypeError, "filt.colorIdx = int: VideoTexture.FilterNormal, expected the value must be a int"); return -1; } // set color index - getFilter(self)->setColor((unsigned short)(PyInt_AsLong(value))); + getFilter(self)->setColor((unsigned short)(PyLong_AsSsize_t(value))); // success return 0; } diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index c4fb1fefd9c..d8be08e0eb5 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -331,19 +331,19 @@ static int setBackground (PyImage * self, PyObject * value, void * closure) { // check validity of parameter if (value == NULL || !PySequence_Check(value) || PySequence_Length(value) != 4 - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 0)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 1)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 2)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 3))) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 0)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 1)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 2)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 3))) { PyErr_SetString(PyExc_TypeError, "The value must be a sequence of 4 integer between 0 and 255"); return -1; } // set background color - getImageRender(self)->setBackground((unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 0))), - (unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 1))), - (unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 2))), - (unsigned char)(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 3)))); + getImageRender(self)->setBackground((unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 0))), + (unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 1))), + (unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 2))), + (unsigned char)(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 3)))); // success return 0; } diff --git a/source/gameengine/VideoTexture/ImageViewport.cpp b/source/gameengine/VideoTexture/ImageViewport.cpp index d2c23e758f6..55b14396280 100644 --- a/source/gameengine/VideoTexture/ImageViewport.cpp +++ b/source/gameengine/VideoTexture/ImageViewport.cpp @@ -218,16 +218,16 @@ static int ImageViewport_setPosition (PyImage * self, PyObject * value, void * c { // check validity of parameter if (value == NULL || !PySequence_Check(value) || PySequence_Length(value) != 2 - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 0)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 1))) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 0)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 1))) { PyErr_SetString(PyExc_TypeError, "The value must be a sequence of 2 ints"); return -1; } // set position GLint pos [] = { - GLint(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 0))), - GLint(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 1))) + GLint(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 0))), + GLint(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 1))) }; getImageViewport(self)->setPosition(pos); // success @@ -246,16 +246,16 @@ int ImageViewport_setCaptureSize (PyImage * self, PyObject * value, void * closu { // check validity of parameter if (value == NULL || !PySequence_Check(value) || PySequence_Length(value) != 2 - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 0)) - || !PyInt_Check(PySequence_Fast_GET_ITEM(value, 1))) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 0)) + || !PyLong_Check(PySequence_Fast_GET_ITEM(value, 1))) { PyErr_SetString(PyExc_TypeError, "The value must be a sequence of 2 ints"); return -1; } // set capture size short size [] = { - short(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 0))), - short(PyInt_AsLong(PySequence_Fast_GET_ITEM(value, 1))) + short(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 0))), + short(PyLong_AsSsize_t(PySequence_Fast_GET_ITEM(value, 1))) }; getImageViewport(self)->setCaptureSize(size); // success diff --git a/source/gameengine/VideoTexture/VideoBase.cpp b/source/gameengine/VideoTexture/VideoBase.cpp index 5d449a158d8..5de7a9e80a9 100644 --- a/source/gameengine/VideoTexture/VideoBase.cpp +++ b/source/gameengine/VideoTexture/VideoBase.cpp @@ -167,13 +167,13 @@ PyObject * Video_getRepeat (PyImage * self, void * closure) int Video_setRepeat (PyImage * self, PyObject * value, void * closure) { // check validity of parameter - if (value == NULL || !PyInt_Check(value)) + if (value == NULL || !PyLong_Check(value)) { PyErr_SetString(PyExc_TypeError, "The value must be an int"); return -1; } // set repeat - getVideo(self)->setRepeat(int(PyInt_AsLong(value))); + getVideo(self)->setRepeat(int(PyLong_AsSsize_t(value))); // success return 0; } diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp index 1a5481488c0..cf4ea88c1b5 100644 --- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp +++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp @@ -1095,13 +1095,13 @@ PyObject * VideoFFmpeg_getPreseek (PyImage *self, void * closure) int VideoFFmpeg_setPreseek (PyImage * self, PyObject * value, void * closure) { // check validity of parameter - if (value == NULL || !PyInt_Check(value)) + if (value == NULL || !PyLong_Check(value)) { PyErr_SetString(PyExc_TypeError, "The value must be an integer"); return -1; } // set preseek - getFFmpeg(self)->setPreseek(PyInt_AsLong(value)); + getFFmpeg(self)->setPreseek(PyLong_AsSsize_t(value)); // success return 0; } diff --git a/source/gameengine/VideoTexture/blendVideoTex.cpp b/source/gameengine/VideoTexture/blendVideoTex.cpp index dad52a426b6..22171f69321 100644 --- a/source/gameengine/VideoTexture/blendVideoTex.cpp +++ b/source/gameengine/VideoTexture/blendVideoTex.cpp @@ -67,7 +67,7 @@ static PyObject * getMaterialID (PyObject *self, PyObject *args) // get last error description static PyObject * getLastError (PyObject *self, PyObject *args) { - return PyString_FromString(Exception::m_lastError.c_str()); + return PyUnicode_FromString(Exception::m_lastError.c_str()); } // set log file -- cgit v1.2.3 From 3373850e95dc07b4d7877df9180d1d82df87e31a Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 2 Jul 2009 03:50:20 +0000 Subject: NLA SoC: Bugfix for Auto-Keyframing version patching When auto-keying is enabled, the insertion mode is no-longer blank. The version patching code now takes this into account, but the conversion doesn't work for existing .b25.blend defaults files though. --- source/blender/blenloader/intern/readfile.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 0c1ba32c543..beebf58b6c0 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9220,7 +9220,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if(ts->normalsize == 0.0) { ts->normalsize= 0.1f; ts->selectmode= SCE_SELECT_VERTEX; + + /* autokeying - setting should be taken from the user-prefs + * but the userprefs version may not have correct flags set + * (i.e. will result in blank box when enabled) + */ ts->autokey_mode= U.autokey_mode; + if (ts->autokey_mode == 0) + ts->autokey_mode= 2; /* 'add/replace' but not on */ } } } -- cgit v1.2.3 From b47605d841d0c01b31199bce4499548ecf259bf1 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 2 Jul 2009 04:47:36 +0000 Subject: NLA SoC: Separating F-Modifier UI drawing into its own file * F-Modifier UI drawing/handling is now defined in a separate file so that it will be more suitable for inclusion into the NLA Editor's buttons. * Started removing F-Curve dependence from the modifier drawing code, which wasn't strictly necessary * Fixed F-Curve RNA wrapping to correctly use FPoints instead of the bulkier BPoints. Although nobody was likely to have encountered bugs here yet, this would almost certainly have contributed to some segfaults/data corruption along the track. --- source/blender/editors/animation/fmodifier_ui.c | 669 +++++++++++++++++++++ source/blender/editors/include/ED_anim_api.h | 9 + source/blender/editors/space_graph/graph_buttons.c | 573 +----------------- source/blender/makesrna/RNA_access.h | 1 + source/blender/makesrna/intern/rna_fcurve.c | 38 +- 5 files changed, 711 insertions(+), 579 deletions(-) create mode 100644 source/blender/editors/animation/fmodifier_ui.c (limited to 'source') diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c new file mode 100644 index 00000000000..5968817a9a6 --- /dev/null +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -0,0 +1,669 @@ +/** + * $Id: + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation, Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/* User-Interface Stuff for F-Modifiers: + * This file defines the (C-Coded) templates + editing callbacks needed + * by the interface stuff or F-Modifiers, as used by F-Curves in the Graph Editor, + * and NLA-Strips in the NLA Editor. + */ + +#include +#include +#include +#include + +#include "DNA_anim_types.h" +#include "DNA_action_types.h" +#include "DNA_object_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_userdef_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_arithb.h" +#include "BLI_blenlib.h" +#include "BLI_editVert.h" +#include "BLI_rand.h" + +#include "BKE_animsys.h" +#include "BKE_action.h" +#include "BKE_context.h" +#include "BKE_curve.h" +#include "BKE_customdata.h" +#include "BKE_depsgraph.h" +#include "BKE_fcurve.h" +#include "BKE_object.h" +#include "BKE_global.h" +#include "BKE_nla.h" +#include "BKE_scene.h" +#include "BKE_screen.h" +#include "BKE_utildefines.h" + +#include "BIF_gl.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "ED_anim_api.h" +#include "ED_keyframing.h" +#include "ED_screen.h" +#include "ED_types.h" +#include "ED_util.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +// XXX! -------------------------------- +/* temporary definition for limits of float number buttons (FLT_MAX tends to infinity with old system) */ +#define UI_FLT_MAX 10000.0f + +/* ********************************************** */ + +#define B_REDR 1 +#define B_FMODIFIER_REDRAW 20 + +/* macro for use here to draw background box and set height */ +// XXX for now, roundbox has it's callback func set to NULL to not intercept events +#define DRAW_BACKDROP(height) \ + { \ + uiDefBut(block, ROUNDBOX, B_REDR, "", -3, *yco-height, width+3, height-1, NULL, 5.0, 0.0, 12.0, (float)rb_col, ""); \ + } + +/* callback to verify modifier data */ +static void validate_fmodifier_cb (bContext *C, void *fcm_v, void *dummy) +{ + FModifier *fcm= (FModifier *)fcm_v; + FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); + + /* call the verify callback on the modifier if applicable */ + if (fmi && fmi->verify_data) + fmi->verify_data(fcm); +} + +/* callback to set the active modifier */ +static void activate_fmodifier_cb (bContext *C, void *fcu_v, void *fcm_v) +{ + FCurve *fcu= (FCurve *)fcu_v; + FModifier *fcm= (FModifier *)fcm_v; + + /* call API function to set the active modifier for active F-Curve */ + fcurve_set_active_modifier(fcu, fcm); +} + +/* callback to remove the given modifier */ +static void delete_fmodifier_cb (bContext *C, void *fcu_v, void *fcm_v) +{ + FCurve *fcu= (FCurve *)fcu_v; + FModifier *fcm= (FModifier *)fcm_v; + + /* remove the given F-Modifier from the F-Curve */ + fcurve_remove_modifier(fcu, fcm); +} + +/* --------------- */ + +/* draw settings for generator modifier */ +static void draw_modifier__generator(uiBlock *block, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) +{ + FMod_Generator *data= (FMod_Generator *)fcm->data; + char gen_mode[]="Generator Type%t|Expanded Polynomial%x0|Factorised Polynomial%x1"; + int cy= *yco - 30; + uiBut *but; + + /* set the height */ + (*height) = 90; + switch (data->mode) { + case FCM_GENERATOR_POLYNOMIAL: /* polynomial expression */ + (*height) += 20*(data->poly_order+1) + 20; + break; + case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* factorised polynomial */ + (*height) += 20 * data->poly_order + 15; + break; + } + + /* basic settings (backdrop + mode selector + some padding) */ + DRAW_BACKDROP((*height)); + uiBlockBeginAlign(block); + but= uiDefButI(block, MENU, B_FMODIFIER_REDRAW, gen_mode, 10,cy,width-30,19, &data->mode, 0, 0, 0, 0, "Selects type of generator algorithm."); + uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL); + cy -= 20; + + uiDefButBitI(block, TOG, FCM_GENERATOR_ADDITIVE, B_FMODIFIER_REDRAW, "Additive", 10,cy,width-30,19, &data->flag, 0, 0, 0, 0, "Values generated by this modifier are applied on top of the existing values instead of overwriting them"); + cy -= 35; + uiBlockEndAlign(block); + + /* now add settings for individual modes */ + switch (data->mode) { + case FCM_GENERATOR_POLYNOMIAL: /* polynomial expression */ + { + float *cp = NULL; + char xval[32]; + unsigned int i; + + /* draw polynomial order selector */ + but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 10,cy,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1"); + uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL); + cy -= 35; + + /* draw controls for each coefficient and a + sign at end of row */ + uiDefBut(block, LABEL, 1, "y = ", 0, cy, 50, 20, NULL, 0.0, 0.0, 0, 0, ""); + + cp= data->coefficients; + for (i=0; (i < data->arraysize) && (cp); i++, cp++) { + /* coefficient */ + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 50, cy, 150, 20, cp, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient for polynomial"); + + /* 'x' param (and '+' if necessary) */ + if (i == 0) + strcpy(xval, ""); + else if (i == 1) + strcpy(xval, "x"); + else + sprintf(xval, "x^%d", i); + uiDefBut(block, LABEL, 1, xval, 200, cy, 50, 20, NULL, 0.0, 0.0, 0, 0, "Power of x"); + + if ( (i != (data->arraysize - 1)) || ((i==0) && data->arraysize==2) ) + uiDefBut(block, LABEL, 1, "+", 250, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); + + cy -= 20; + } + } + break; + + case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* factorised polynomial expression */ + { + float *cp = NULL; + unsigned int i; + + /* draw polynomial order selector */ + but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 10,cy,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1"); + uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL); + cy -= 35; + + /* draw controls for each pair of coefficients */ + uiDefBut(block, LABEL, 1, "y = ", 0, cy, 50, 20, NULL, 0.0, 0.0, 0, 0, ""); + + cp= data->coefficients; + for (i=0; (i < data->poly_order) && (cp); i++, cp+=2) { + /* opening bracket */ + uiDefBut(block, LABEL, 1, "(", 40, cy, 50, 20, NULL, 0.0, 0.0, 0, 0, ""); + + /* coefficients */ + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 50, cy, 100, 20, cp, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient of x"); + + uiDefBut(block, LABEL, 1, "x + ", 150, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); + + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 180, cy, 100, 20, cp+1, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Second coefficient"); + + /* closing bracket and '+' sign */ + if ( (i != (data->poly_order - 1)) || ((i==0) && data->poly_order==2) ) + uiDefBut(block, LABEL, 1, ") ?", 280, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); + else + uiDefBut(block, LABEL, 1, ")", 280, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); + + cy -= 20; + } + } + break; + } +} + +/* --------------- */ + +/* draw settings for noise modifier */ +static void draw_modifier__fn_generator(uiBlock *block, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) +{ + FMod_FunctionGenerator *data= (FMod_FunctionGenerator *)fcm->data; + int cy= (*yco - 30), cy1= (*yco - 50), cy2= (*yco - 70); + char fn_type[]="Built-In Function%t|Sin%x0|Cos%x1|Tan%x2|Square Root%x3|Natural Log%x4|Normalised Sin%x5"; + + /* set the height */ + (*height) = 80; + + /* basic settings (backdrop + some padding) */ + DRAW_BACKDROP((*height)); + + uiDefButI(block, MENU, B_FMODIFIER_REDRAW, fn_type, + 3, cy, 300, 20, &data->type, 0, 0, 0, 0, "Type of function used to generate values"); + + + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Amplitude:", + 3, cy1, 150, 20, &data->amplitude, 0.000001, 10000.0, 0.01, 3, "Scale factor determining the maximum/minimum values."); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Value Offset:", + 3, cy2, 150, 20, &data->value_offset, 0.0, 10000.0, 0.01, 3, "Constant factor to offset values by."); + + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Phase Multiplier:", + 155, cy1, 150, 20, &data->phase_multiplier, 0.0, 100000.0, 0.1, 3, "Scale factor determining the 'speed' of the function."); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Phase Offset:", + 155, cy2, 150, 20, &data->phase_offset, 0.0, 100000.0, 0.1, 3, "Constant factor to offset time by for function."); + +} + +/* --------------- */ + +/* draw settings for cycles modifier */ +static void draw_modifier__cycles(uiBlock *block, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) +{ + FMod_Cycles *data= (FMod_Cycles *)fcm->data; + char cyc_mode[]="Cycling Mode%t|No Cycles%x0|Repeat Motion%x1|Repeat with Offset%x2|Repeat Mirrored%x3"; + int cy= (*yco - 30), cy1= (*yco - 50), cy2= (*yco - 70); + + /* set the height */ + (*height) = 80; + + /* basic settings (backdrop + some padding) */ + DRAW_BACKDROP((*height)); + + /* 'before' range */ + uiDefBut(block, LABEL, 1, "Before:", 4, cy, 80, 20, NULL, 0.0, 0.0, 0, 0, "Settings for cycling before first keyframe"); + uiBlockBeginAlign(block); + uiDefButS(block, MENU, B_FMODIFIER_REDRAW, cyc_mode, 3,cy1,150,20, &data->before_mode, 0, 0, 0, 0, "Cycling mode to use before first keyframe"); + uiDefButS(block, NUM, B_FMODIFIER_REDRAW, "Max Cycles:", 3, cy2, 150, 20, &data->before_cycles, 0, 10000, 10, 3, "Maximum number of cycles to allow (0 = infinite)"); + uiBlockEndAlign(block); + + /* 'after' range */ + uiDefBut(block, LABEL, 1, "After:", 155, cy, 80, 20, NULL, 0.0, 0.0, 0, 0, "Settings for cycling after last keyframe"); + uiBlockBeginAlign(block); + uiDefButS(block, MENU, B_FMODIFIER_REDRAW, cyc_mode, 157,cy1,150,20, &data->after_mode, 0, 0, 0, 0, "Cycling mode to use after first keyframe"); + uiDefButS(block, NUM, B_FMODIFIER_REDRAW, "Max Cycles:", 157, cy2, 150, 20, &data->after_cycles, 0, 10000, 10, 3, "Maximum number of cycles to allow (0 = infinite)"); + uiBlockEndAlign(block); +} + +/* --------------- */ + +/* draw settings for noise modifier */ +static void draw_modifier__noise(uiBlock *block, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) +{ + FMod_Noise *data= (FMod_Noise *)fcm->data; + int cy= (*yco - 30), cy1= (*yco - 50), cy2= (*yco - 70); + char blend_mode[]="Modification %t|Replace %x0|Add %x1|Subtract %x2|Multiply %x3"; + + /* set the height */ + (*height) = 80; + + /* basic settings (backdrop + some padding) */ + DRAW_BACKDROP((*height)); + + uiDefButS(block, MENU, B_FMODIFIER_REDRAW, blend_mode, + 3, cy, 150, 20, &data->modification, 0, 0, 0, 0, "Method of combining the results of this modifier and other modifiers."); + + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Size:", + 3, cy1, 150, 20, &data->size, 0.000001, 10000.0, 0.01, 3, ""); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Strength:", + 3, cy2, 150, 20, &data->strength, 0.0, 10000.0, 0.01, 3, ""); + + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Phase:", + 155, cy1, 150, 20, &data->phase, 0.0, 100000.0, 0.1, 3, ""); + uiDefButS(block, NUM, B_FMODIFIER_REDRAW, "Depth:", + 155, cy2, 150, 20, &data->depth, 0, 128, 1, 3, ""); + +} + +/* --------------- */ + +#define BINARYSEARCH_FRAMEEQ_THRESH 0.0001 + +/* Binary search algorithm for finding where to insert Envelope Data Point. + * Returns the index to insert at (data already at that index will be offset if replace is 0) + */ +static int binarysearch_fcm_envelopedata_index (FCM_EnvelopeData array[], float frame, int arraylen, short *exists) +{ + int start=0, end=arraylen; + int loopbreaker= 0, maxloop= arraylen * 2; + + /* initialise exists-flag first */ + *exists= 0; + + /* sneaky optimisations (don't go through searching process if...): + * - keyframe to be added is to be added out of current bounds + * - keyframe to be added would replace one of the existing ones on bounds + */ + if ((arraylen <= 0) || (array == NULL)) { + printf("Warning: binarysearch_fcm_envelopedata_index() encountered invalid array \n"); + return 0; + } + else { + /* check whether to add before/after/on */ + float framenum; + + /* 'First' Point (when only one point, this case is used) */ + framenum= array[0].time; + if (IS_EQT(frame, framenum, BINARYSEARCH_FRAMEEQ_THRESH)) { + *exists = 1; + return 0; + } + else if (frame < framenum) + return 0; + + /* 'Last' Point */ + framenum= array[(arraylen-1)].time; + if (IS_EQT(frame, framenum, BINARYSEARCH_FRAMEEQ_THRESH)) { + *exists= 1; + return (arraylen - 1); + } + else if (frame > framenum) + return arraylen; + } + + + /* most of the time, this loop is just to find where to put it + * - 'loopbreaker' is just here to prevent infinite loops + */ + for (loopbreaker=0; (start <= end) && (loopbreaker < maxloop); loopbreaker++) { + /* compute and get midpoint */ + int mid = start + ((end - start) / 2); /* we calculate the midpoint this way to avoid int overflows... */ + float midfra= array[mid].time; + + /* check if exactly equal to midpoint */ + if (IS_EQT(frame, midfra, BINARYSEARCH_FRAMEEQ_THRESH)) { + *exists = 1; + return mid; + } + + /* repeat in upper/lower half */ + if (frame > midfra) + start= mid + 1; + else if (frame < midfra) + end= mid - 1; + } + + /* print error if loop-limit exceeded */ + if (loopbreaker == (maxloop-1)) { + printf("Error: binarysearch_fcm_envelopedata_index() was taking too long \n"); + + // include debug info + printf("\tround = %d: start = %d, end = %d, arraylen = %d \n", loopbreaker, start, end, arraylen); + } + + /* not found, so return where to place it */ + return start; +} + +/* callback to add new envelope data point */ +// TODO: should we have a separate file for things like this? +static void fmod_envelope_addpoint_cb (bContext *C, void *fcm_dv, void *dummy) +{ + Scene *scene= CTX_data_scene(C); + FMod_Envelope *env= (FMod_Envelope *)fcm_dv; + FCM_EnvelopeData *fedn; + FCM_EnvelopeData fed; + + /* init template data */ + fed.min= -1.0f; + fed.max= 1.0f; + fed.time= (float)scene->r.cfra; // XXX make this int for ease of use? + fed.f1= fed.f2= 0; + + /* check that no data exists for the current frame... */ + if (env->data) { + short exists = -1; + int i= binarysearch_fcm_envelopedata_index(env->data, (float)(scene->r.cfra), env->totvert, &exists); + + /* binarysearch_...() will set exists by default to 0, so if it is non-zero, that means that the point exists already */ + if (exists) + return; + + /* add new */ + fedn= MEM_callocN((env->totvert+1)*sizeof(FCM_EnvelopeData), "FCM_EnvelopeData"); + + /* add the points that should occur before the point to be pasted */ + if (i > 0) + memcpy(fedn, env->data, i*sizeof(FCM_EnvelopeData)); + + /* add point to paste at index i */ + *(fedn + i)= fed; + + /* add the points that occur after the point to be pasted */ + if (i < env->totvert) + memcpy(fedn+i+1, env->data+i, (env->totvert-i)*sizeof(FCM_EnvelopeData)); + + /* replace (+ free) old with new */ + MEM_freeN(env->data); + env->data= fedn; + + env->totvert++; + } + else { + env->data= MEM_callocN(sizeof(FCM_EnvelopeData), "FCM_EnvelopeData"); + *(env->data)= fed; + + env->totvert= 1; + } +} + +/* callback to remove envelope data point */ +// TODO: should we have a separate file for things like this? +static void fmod_envelope_deletepoint_cb (bContext *C, void *fcm_dv, void *ind_v) +{ + FMod_Envelope *env= (FMod_Envelope *)fcm_dv; + FCM_EnvelopeData *fedn; + int index= GET_INT_FROM_POINTER(ind_v); + + /* check that no data exists for the current frame... */ + if (env->totvert > 1) { + /* allocate a new smaller array */ + fedn= MEM_callocN(sizeof(FCM_EnvelopeData)*(env->totvert-1), "FCM_EnvelopeData"); + + memcpy(fedn, &env->data, sizeof(FCM_EnvelopeData)*(index)); + memcpy(&fedn[index], &env->data[index+1], sizeof(FCM_EnvelopeData)*(env->totvert-index-1)); + + /* free old array, and set the new */ + MEM_freeN(env->data); + env->data= fedn; + env->totvert--; + } + else { + /* just free array, since the only vert was deleted */ + if (env->data) + MEM_freeN(env->data); + env->totvert= 0; + } +} + +/* draw settings for envelope modifier */ +static void draw_modifier__envelope(uiBlock *block, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) +{ + FMod_Envelope *env= (FMod_Envelope *)fcm->data; + FCM_EnvelopeData *fed; + uiBut *but; + int cy= (*yco - 28); + int i; + + /* set the height: + * - basic settings + variable height from envelope controls + */ + (*height) = 115 + (35 * env->totvert); + + /* basic settings (backdrop + general settings + some padding) */ + DRAW_BACKDROP((*height)); + + /* General Settings */ + uiDefBut(block, LABEL, 1, "Envelope:", 10, cy, 100, 20, NULL, 0.0, 0.0, 0, 0, "Settings for cycling before first keyframe"); + cy -= 20; + + uiBlockBeginAlign(block); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Reference Val:", 10, cy, 300, 20, &env->midval, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, ""); + cy -= 20; + + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Min:", 10, cy, 150, 20, &env->min, -UI_FLT_MAX, env->max, 10, 3, "Minimum value (relative to Reference Value) that is used as the 'normal' minimum value"); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Max:", 160, cy, 150, 20, &env->max, env->min, UI_FLT_MAX, 10, 3, "Maximum value (relative to Reference Value) that is used as the 'normal' maximum value"); + cy -= 35; + uiBlockEndAlign(block); + + + /* Points header */ + uiDefBut(block, LABEL, 1, "Control Points:", 10, cy, 150, 20, NULL, 0.0, 0.0, 0, 0, ""); + + but= uiDefBut(block, BUT, B_FMODIFIER_REDRAW, "Add Point", 160,cy,150,19, NULL, 0, 0, 0, 0, "Adds a new control-point to the envelope on the current frame"); + uiButSetFunc(but, fmod_envelope_addpoint_cb, env, NULL); + cy -= 35; + + /* Points List */ + for (i=0, fed=env->data; i < env->totvert; i++, fed++) { + uiBlockBeginAlign(block); + but=uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Fra:", 2, cy, 90, 20, &fed->time, -UI_FLT_MAX, UI_FLT_MAX, 10, 1, "Frame that envelope point occurs"); + uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL); + + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Min:", 92, cy, 100, 20, &fed->min, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, "Minimum bound of envelope at this point"); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Max:", 192, cy, 100, 20, &fed->max, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, "Maximum bound of envelope at this point"); + + but= uiDefIconBut(block, BUT, B_FMODIFIER_REDRAW, ICON_X, 292, cy, 18, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Delete envelope control point"); + uiButSetFunc(but, fmod_envelope_deletepoint_cb, env, SET_INT_IN_POINTER(i)); + uiBlockBeginAlign(block); + cy -= 25; + } +} + +/* --------------- */ + +/* draw settings for limits modifier */ +static void draw_modifier__limits(uiBlock *block, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) +{ + FMod_Limits *data= (FMod_Limits *)fcm->data; + const int togButWidth = 50; + const int textButWidth = ((width/2)-togButWidth); + + /* set the height */ + (*height) = 60; + + /* basic settings (backdrop + some padding) */ + DRAW_BACKDROP((*height)); + + /* Draw Pairs of LimitToggle+LimitValue */ + uiBlockBeginAlign(block); + uiDefButBitI(block, TOGBUT, FCM_LIMIT_XMIN, B_FMODIFIER_REDRAW, "xMin", 5, *yco-30, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum x value"); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 5+togButWidth, *yco-30, (textButWidth-5), 18, &data->rect.xmin, -UI_FLT_MAX, UI_FLT_MAX, 0.1,0.5,"Lowest x value to allow"); + uiBlockEndAlign(block); + + uiBlockBeginAlign(block); + uiDefButBitI(block, TOGBUT, FCM_LIMIT_XMAX, B_FMODIFIER_REDRAW, "XMax", 5+(width-(textButWidth-5)-togButWidth), *yco-30, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum x value"); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 5+(width-textButWidth-5), *yco-30, (textButWidth-5), 18, &data->rect.xmax, -UI_FLT_MAX, UI_FLT_MAX, 0.1,0.5,"Highest x value to allow"); + uiBlockEndAlign(block); + + uiBlockBeginAlign(block); + uiDefButBitI(block, TOGBUT, FCM_LIMIT_YMIN, B_FMODIFIER_REDRAW, "yMin", 5, *yco-52, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum y value"); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 5+togButWidth, *yco-52, (textButWidth-5), 18, &data->rect.ymin, -UI_FLT_MAX, UI_FLT_MAX, 0.1,0.5,"Lowest y value to allow"); + uiBlockEndAlign(block); + + uiBlockBeginAlign(block); + uiDefButBitI(block, TOGBUT, FCM_LIMIT_YMAX, B_FMODIFIER_REDRAW, "YMax", 5+(width-(textButWidth-5)-togButWidth), *yco-52, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum y value"); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 5+(width-textButWidth-5), *yco-52, (textButWidth-5), 18, &data->rect.ymax, -UI_FLT_MAX, UI_FLT_MAX, 0.1,0.5,"Highest y value to allow"); + uiBlockEndAlign(block); +} + +/* --------------- */ + +// FIXME: remove dependency for F-Curve +void ANIM_uiTemplate_fmodifier_draw (uiBlock *block, FCurve *fcu, FModifier *fcm, int *yco) +{ + FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); + uiBut *but; + short active= (fcm->flag & FMODIFIER_FLAG_ACTIVE); + short width= 314; + short height = 0; + int rb_col; + + /* draw header */ + { + uiBlockSetEmboss(block, UI_EMBOSSN); + + /* rounded header */ + rb_col= (active)?-20:20; + but= uiDefBut(block, ROUNDBOX, B_REDR, "", 0, *yco-2, width, 24, NULL, 5.0, 0.0, 15.0, (float)(rb_col-20), ""); + + /* expand */ + uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_EXPANDED, B_REDR, ICON_TRIA_RIGHT, 5, *yco-1, 20, 20, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is expanded."); + + /* checkbox for 'active' status (for now) */ + but= uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_ACTIVE, B_REDR, ICON_RADIOBUT_OFF, 25, *yco-1, 20, 20, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is active one."); + uiButSetFunc(but, activate_fmodifier_cb, fcu, fcm); + + /* name */ + if (fmi) + uiDefBut(block, LABEL, 1, fmi->name, 10+40, *yco, 150, 20, NULL, 0.0, 0.0, 0, 0, "F-Curve Modifier Type. Click to make modifier active one."); + else + uiDefBut(block, LABEL, 1, "", 10+40, *yco, 150, 20, NULL, 0.0, 0.0, 0, 0, "F-Curve Modifier Type. Click to make modifier active one."); + + /* 'mute' button */ + uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_MUTED, B_REDR, ICON_MUTE_IPO_OFF, 10+(width-60), *yco-1, 20, 20, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is temporarily muted (not evaluated)."); + + /* delete button */ + but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 10+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete F-Curve Modifier."); + uiButSetFunc(but, delete_fmodifier_cb, fcu, fcm); + + uiBlockSetEmboss(block, UI_EMBOSS); + } + + /* when modifier is expanded, draw settings */ + if (fcm->flag & FMODIFIER_FLAG_EXPANDED) { + /* draw settings for individual modifiers */ + switch (fcm->type) { + case FMODIFIER_TYPE_GENERATOR: /* Generator */ + draw_modifier__generator(block, fcm, yco, &height, width, active, rb_col); + break; + + case FMODIFIER_TYPE_FN_GENERATOR: /* Built-In Function Generator */ + draw_modifier__fn_generator(block, fcm, yco, &height, width, active, rb_col); + break; + + case FMODIFIER_TYPE_CYCLES: /* Cycles */ + draw_modifier__cycles(block, fcm, yco, &height, width, active, rb_col); + break; + + case FMODIFIER_TYPE_ENVELOPE: /* Envelope */ + draw_modifier__envelope(block, fcm, yco, &height, width, active, rb_col); + break; + + case FMODIFIER_TYPE_LIMITS: /* Limits */ + draw_modifier__limits(block, fcm, yco, &height, width, active, rb_col); + break; + + case FMODIFIER_TYPE_NOISE: /* Noise */ + draw_modifier__noise(block, fcm, yco, &height, width, active, rb_col); + break; + + default: /* unknown type */ + height= 96; + //DRAW_BACKDROP(height); // XXX buggy... + break; + } + } + + /* adjust height for new to start */ + (*yco) -= (height + 27); +} + +/* ********************************************** */ + + \ No newline at end of file diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 4bfcbde8f1e..4d75a73a327 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -293,6 +293,15 @@ void ANIM_draw_cfra(const struct bContext *C, struct View2D *v2d, short flag); /* main call to draw preview range curtains */ void ANIM_draw_previewrange(const struct bContext *C, struct View2D *v2d); +/* ************************************************* */ +/* F-MODIFIER TOOLS */ + +struct uiBlock; + +/* draw a given F-Modifier for some layout/UI-Block */ +// XXX not quite complete yet +void ANIM_uiTemplate_fmodifier_draw(struct uiBlock *block, struct FCurve *fcu, struct FModifier *fcm, int *yco); + /* ************************************************* */ /* ASSORTED TOOLS */ diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index e68ee53521d..9d4a1a8b3cb 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -347,6 +347,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) } /* ******************* f-modifiers ******************************** */ +/* all the drawing code is in editors/animation/fmodifier_ui.c */ #define B_FMODIFIER_REDRAW 20 @@ -360,576 +361,6 @@ static void do_graph_region_modifier_buttons(bContext *C, void *arg, int event) } } -/* macro for use here to draw background box and set height */ -// XXX for now, roundbox has it's callback func set to NULL to not intercept events -#define DRAW_BACKDROP(height) \ - { \ - uiDefBut(block, ROUNDBOX, B_REDR, "", -3, *yco-height, width+3, height-1, NULL, 5.0, 0.0, 12.0, (float)rb_col, ""); \ - } - -/* callback to verify modifier data */ -static void validate_fmodifier_cb (bContext *C, void *fcu_v, void *fcm_v) -{ - FModifier *fcm= (FModifier *)fcm_v; - FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); - - /* call the verify callback on the modifier if applicable */ - if (fmi && fmi->verify_data) - fmi->verify_data(fcm); -} - -/* callback to set the active modifier */ -static void activate_fmodifier_cb (bContext *C, void *fcu_v, void *fcm_v) -{ - FCurve *fcu= (FCurve *)fcu_v; - FModifier *fcm= (FModifier *)fcm_v; - - /* call API function to set the active modifier for active F-Curve */ - fcurve_set_active_modifier(fcu, fcm); -} - -/* callback to remove the given modifier */ -static void delete_fmodifier_cb (bContext *C, void *fcu_v, void *fcm_v) -{ - FCurve *fcu= (FCurve *)fcu_v; - FModifier *fcm= (FModifier *)fcm_v; - - /* remove the given F-Modifier from the F-Curve */ - fcurve_remove_modifier(fcu, fcm); -} - -/* --------------- */ - -/* draw settings for generator modifier */ -static void draw_modifier__generator(uiBlock *block, FCurve *fcu, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) -{ - FMod_Generator *data= (FMod_Generator *)fcm->data; - char gen_mode[]="Generator Type%t|Expanded Polynomial%x0|Factorised Polynomial%x1"; - int cy= *yco - 30; - uiBut *but; - - /* set the height */ - (*height) = 90; - switch (data->mode) { - case FCM_GENERATOR_POLYNOMIAL: /* polynomial expression */ - (*height) += 20*(data->poly_order+1) + 20; - break; - case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* factorised polynomial */ - (*height) += 20 * data->poly_order + 15; - break; - } - - /* basic settings (backdrop + mode selector + some padding) */ - DRAW_BACKDROP((*height)); - uiBlockBeginAlign(block); - but= uiDefButI(block, MENU, B_FMODIFIER_REDRAW, gen_mode, 10,cy,width-30,19, &data->mode, 0, 0, 0, 0, "Selects type of generator algorithm."); - uiButSetFunc(but, validate_fmodifier_cb, fcu, fcm); - cy -= 20; - - uiDefButBitI(block, TOG, FCM_GENERATOR_ADDITIVE, B_FMODIFIER_REDRAW, "Additive", 10,cy,width-30,19, &data->flag, 0, 0, 0, 0, "Values generated by this modifier are applied on top of the existing values instead of overwriting them"); - cy -= 35; - uiBlockEndAlign(block); - - /* now add settings for individual modes */ - switch (data->mode) { - case FCM_GENERATOR_POLYNOMIAL: /* polynomial expression */ - { - float *cp = NULL; - char xval[32]; - unsigned int i; - - /* draw polynomial order selector */ - but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 10,cy,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1"); - uiButSetFunc(but, validate_fmodifier_cb, fcu, fcm); - cy -= 35; - - /* draw controls for each coefficient and a + sign at end of row */ - uiDefBut(block, LABEL, 1, "y = ", 0, cy, 50, 20, NULL, 0.0, 0.0, 0, 0, ""); - - cp= data->coefficients; - for (i=0; (i < data->arraysize) && (cp); i++, cp++) { - /* coefficient */ - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 50, cy, 150, 20, cp, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient for polynomial"); - - /* 'x' param (and '+' if necessary) */ - if (i == 0) - strcpy(xval, ""); - else if (i == 1) - strcpy(xval, "x"); - else - sprintf(xval, "x^%d", i); - uiDefBut(block, LABEL, 1, xval, 200, cy, 50, 20, NULL, 0.0, 0.0, 0, 0, "Power of x"); - - if ( (i != (data->arraysize - 1)) || ((i==0) && data->arraysize==2) ) - uiDefBut(block, LABEL, 1, "+", 250, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); - - cy -= 20; - } - } - break; - - case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* factorised polynomial expression */ - { - float *cp = NULL; - unsigned int i; - - /* draw polynomial order selector */ - but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 10,cy,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1"); - uiButSetFunc(but, validate_fmodifier_cb, fcu, fcm); - cy -= 35; - - /* draw controls for each pair of coefficients */ - uiDefBut(block, LABEL, 1, "y = ", 0, cy, 50, 20, NULL, 0.0, 0.0, 0, 0, ""); - - cp= data->coefficients; - for (i=0; (i < data->poly_order) && (cp); i++, cp+=2) { - /* opening bracket */ - uiDefBut(block, LABEL, 1, "(", 40, cy, 50, 20, NULL, 0.0, 0.0, 0, 0, ""); - - /* coefficients */ - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 50, cy, 100, 20, cp, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient of x"); - - uiDefBut(block, LABEL, 1, "x + ", 150, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 180, cy, 100, 20, cp+1, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Second coefficient"); - - /* closing bracket and '+' sign */ - if ( (i != (data->poly_order - 1)) || ((i==0) && data->poly_order==2) ) - uiDefBut(block, LABEL, 1, ") â—Š", 280, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); - else - uiDefBut(block, LABEL, 1, ")", 280, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); - - cy -= 20; - } - } - break; - } -} - -/* --------------- */ - -/* draw settings for noise modifier */ -static void draw_modifier__fn_generator(uiBlock *block, FCurve *fcu, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) -{ - FMod_FunctionGenerator *data= (FMod_FunctionGenerator *)fcm->data; - int cy= (*yco - 30), cy1= (*yco - 50), cy2= (*yco - 70); - char fn_type[]="Built-In Function%t|Sin%x0|Cos%x1|Tan%x2|Square Root%x3|Natural Log%x4|Normalised Sin%x5"; - - /* set the height */ - (*height) = 80; - - /* basic settings (backdrop + some padding) */ - DRAW_BACKDROP((*height)); - - uiDefButI(block, MENU, B_FMODIFIER_REDRAW, fn_type, - 3, cy, 300, 20, &data->type, 0, 0, 0, 0, "Type of function used to generate values"); - - - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Amplitude:", - 3, cy1, 150, 20, &data->amplitude, 0.000001, 10000.0, 0.01, 3, "Scale factor determining the maximum/minimum values."); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Value Offset:", - 3, cy2, 150, 20, &data->value_offset, 0.0, 10000.0, 0.01, 3, "Constant factor to offset values by."); - - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Phase Multiplier:", - 155, cy1, 150, 20, &data->phase_multiplier, 0.0, 100000.0, 0.1, 3, "Scale factor determining the 'speed' of the function."); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Phase Offset:", - 155, cy2, 150, 20, &data->phase_offset, 0.0, 100000.0, 0.1, 3, "Constant factor to offset time by for function."); - -} - -/* --------------- */ - -/* draw settings for cycles modifier */ -static void draw_modifier__cycles(uiBlock *block, FCurve *fcu, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) -{ - FMod_Cycles *data= (FMod_Cycles *)fcm->data; - char cyc_mode[]="Cycling Mode%t|No Cycles%x0|Repeat Motion%x1|Repeat with Offset%x2|Repeat Mirrored%x3"; - int cy= (*yco - 30), cy1= (*yco - 50), cy2= (*yco - 70); - - /* set the height */ - (*height) = 80; - - /* basic settings (backdrop + some padding) */ - DRAW_BACKDROP((*height)); - - /* 'before' range */ - uiDefBut(block, LABEL, 1, "Before:", 4, cy, 80, 20, NULL, 0.0, 0.0, 0, 0, "Settings for cycling before first keyframe"); - uiBlockBeginAlign(block); - uiDefButS(block, MENU, B_FMODIFIER_REDRAW, cyc_mode, 3,cy1,150,20, &data->before_mode, 0, 0, 0, 0, "Cycling mode to use before first keyframe"); - uiDefButS(block, NUM, B_FMODIFIER_REDRAW, "Max Cycles:", 3, cy2, 150, 20, &data->before_cycles, 0, 10000, 10, 3, "Maximum number of cycles to allow (0 = infinite)"); - uiBlockEndAlign(block); - - /* 'after' range */ - uiDefBut(block, LABEL, 1, "After:", 155, cy, 80, 20, NULL, 0.0, 0.0, 0, 0, "Settings for cycling after last keyframe"); - uiBlockBeginAlign(block); - uiDefButS(block, MENU, B_FMODIFIER_REDRAW, cyc_mode, 157,cy1,150,20, &data->after_mode, 0, 0, 0, 0, "Cycling mode to use after first keyframe"); - uiDefButS(block, NUM, B_FMODIFIER_REDRAW, "Max Cycles:", 157, cy2, 150, 20, &data->after_cycles, 0, 10000, 10, 3, "Maximum number of cycles to allow (0 = infinite)"); - uiBlockEndAlign(block); -} - -/* --------------- */ - -/* draw settings for noise modifier */ -static void draw_modifier__noise(uiBlock *block, FCurve *fcu, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) -{ - FMod_Noise *data= (FMod_Noise *)fcm->data; - int cy= (*yco - 30), cy1= (*yco - 50), cy2= (*yco - 70); - char blend_mode[]="Modification %t|Replace %x0|Add %x1|Subtract %x2|Multiply %x3"; - - /* set the height */ - (*height) = 80; - - /* basic settings (backdrop + some padding) */ - DRAW_BACKDROP((*height)); - - uiDefButS(block, MENU, B_FMODIFIER_REDRAW, blend_mode, - 3, cy, 150, 20, &data->modification, 0, 0, 0, 0, "Method of combining the results of this modifier and other modifiers."); - - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Size:", - 3, cy1, 150, 20, &data->size, 0.000001, 10000.0, 0.01, 3, ""); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Strength:", - 3, cy2, 150, 20, &data->strength, 0.0, 10000.0, 0.01, 3, ""); - - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Phase:", - 155, cy1, 150, 20, &data->phase, 0.0, 100000.0, 0.1, 3, ""); - uiDefButS(block, NUM, B_FMODIFIER_REDRAW, "Depth:", - 155, cy2, 150, 20, &data->depth, 0, 128, 1, 3, ""); - -} - -/* --------------- */ - -#define BINARYSEARCH_FRAMEEQ_THRESH 0.0001 - -/* Binary search algorithm for finding where to insert Envelope Data Point. - * Returns the index to insert at (data already at that index will be offset if replace is 0) - */ -static int binarysearch_fcm_envelopedata_index (FCM_EnvelopeData array[], float frame, int arraylen, short *exists) -{ - int start=0, end=arraylen; - int loopbreaker= 0, maxloop= arraylen * 2; - - /* initialise exists-flag first */ - *exists= 0; - - /* sneaky optimisations (don't go through searching process if...): - * - keyframe to be added is to be added out of current bounds - * - keyframe to be added would replace one of the existing ones on bounds - */ - if ((arraylen <= 0) || (array == NULL)) { - printf("Warning: binarysearch_fcm_envelopedata_index() encountered invalid array \n"); - return 0; - } - else { - /* check whether to add before/after/on */ - float framenum; - - /* 'First' Point (when only one point, this case is used) */ - framenum= array[0].time; - if (IS_EQT(frame, framenum, BINARYSEARCH_FRAMEEQ_THRESH)) { - *exists = 1; - return 0; - } - else if (frame < framenum) - return 0; - - /* 'Last' Point */ - framenum= array[(arraylen-1)].time; - if (IS_EQT(frame, framenum, BINARYSEARCH_FRAMEEQ_THRESH)) { - *exists= 1; - return (arraylen - 1); - } - else if (frame > framenum) - return arraylen; - } - - - /* most of the time, this loop is just to find where to put it - * - 'loopbreaker' is just here to prevent infinite loops - */ - for (loopbreaker=0; (start <= end) && (loopbreaker < maxloop); loopbreaker++) { - /* compute and get midpoint */ - int mid = start + ((end - start) / 2); /* we calculate the midpoint this way to avoid int overflows... */ - float midfra= array[mid].time; - - /* check if exactly equal to midpoint */ - if (IS_EQT(frame, midfra, BINARYSEARCH_FRAMEEQ_THRESH)) { - *exists = 1; - return mid; - } - - /* repeat in upper/lower half */ - if (frame > midfra) - start= mid + 1; - else if (frame < midfra) - end= mid - 1; - } - - /* print error if loop-limit exceeded */ - if (loopbreaker == (maxloop-1)) { - printf("Error: binarysearch_fcm_envelopedata_index() was taking too long \n"); - - // include debug info - printf("\tround = %d: start = %d, end = %d, arraylen = %d \n", loopbreaker, start, end, arraylen); - } - - /* not found, so return where to place it */ - return start; -} - -/* callback to add new envelope data point */ -// TODO: should we have a separate file for things like this? -static void fmod_envelope_addpoint_cb (bContext *C, void *fcm_dv, void *dummy) -{ - Scene *scene= CTX_data_scene(C); - FMod_Envelope *env= (FMod_Envelope *)fcm_dv; - FCM_EnvelopeData *fedn; - FCM_EnvelopeData fed; - - /* init template data */ - fed.min= -1.0f; - fed.max= 1.0f; - fed.time= (float)scene->r.cfra; // XXX make this int for ease of use? - fed.f1= fed.f2= 0; - - /* check that no data exists for the current frame... */ - if (env->data) { - short exists = -1; - int i= binarysearch_fcm_envelopedata_index(env->data, (float)(scene->r.cfra), env->totvert, &exists); - - /* binarysearch_...() will set exists by default to 0, so if it is non-zero, that means that the point exists already */ - if (exists) - return; - - /* add new */ - fedn= MEM_callocN((env->totvert+1)*sizeof(FCM_EnvelopeData), "FCM_EnvelopeData"); - - /* add the points that should occur before the point to be pasted */ - if (i > 0) - memcpy(fedn, env->data, i*sizeof(FCM_EnvelopeData)); - - /* add point to paste at index i */ - *(fedn + i)= fed; - - /* add the points that occur after the point to be pasted */ - if (i < env->totvert) - memcpy(fedn+i+1, env->data+i, (env->totvert-i)*sizeof(FCM_EnvelopeData)); - - /* replace (+ free) old with new */ - MEM_freeN(env->data); - env->data= fedn; - - env->totvert++; - } - else { - env->data= MEM_callocN(sizeof(FCM_EnvelopeData), "FCM_EnvelopeData"); - *(env->data)= fed; - - env->totvert= 1; - } -} - -/* callback to remove envelope data point */ -// TODO: should we have a separate file for things like this? -static void fmod_envelope_deletepoint_cb (bContext *C, void *fcm_dv, void *ind_v) -{ - FMod_Envelope *env= (FMod_Envelope *)fcm_dv; - FCM_EnvelopeData *fedn; - int index= GET_INT_FROM_POINTER(ind_v); - - /* check that no data exists for the current frame... */ - if (env->totvert > 1) { - /* allocate a new smaller array */ - fedn= MEM_callocN(sizeof(FCM_EnvelopeData)*(env->totvert-1), "FCM_EnvelopeData"); - - memcpy(fedn, &env->data, sizeof(FCM_EnvelopeData)*(index)); - memcpy(&fedn[index], &env->data[index+1], sizeof(FCM_EnvelopeData)*(env->totvert-index-1)); - - /* free old array, and set the new */ - MEM_freeN(env->data); - env->data= fedn; - env->totvert--; - } - else { - /* just free array, since the only vert was deleted */ - if (env->data) - MEM_freeN(env->data); - env->totvert= 0; - } -} - -/* draw settings for envelope modifier */ -static void draw_modifier__envelope(uiBlock *block, FCurve *fcu, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) -{ - FMod_Envelope *env= (FMod_Envelope *)fcm->data; - FCM_EnvelopeData *fed; - uiBut *but; - int cy= (*yco - 28); - int i; - - /* set the height: - * - basic settings + variable height from envelope controls - */ - (*height) = 115 + (35 * env->totvert); - - /* basic settings (backdrop + general settings + some padding) */ - DRAW_BACKDROP((*height)); - - /* General Settings */ - uiDefBut(block, LABEL, 1, "Envelope:", 10, cy, 100, 20, NULL, 0.0, 0.0, 0, 0, "Settings for cycling before first keyframe"); - cy -= 20; - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Reference Val:", 10, cy, 300, 20, &env->midval, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, ""); - cy -= 20; - - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Min:", 10, cy, 150, 20, &env->min, -UI_FLT_MAX, env->max, 10, 3, "Minimum value (relative to Reference Value) that is used as the 'normal' minimum value"); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Max:", 160, cy, 150, 20, &env->max, env->min, UI_FLT_MAX, 10, 3, "Maximum value (relative to Reference Value) that is used as the 'normal' maximum value"); - cy -= 35; - uiBlockEndAlign(block); - - - /* Points header */ - uiDefBut(block, LABEL, 1, "Control Points:", 10, cy, 150, 20, NULL, 0.0, 0.0, 0, 0, ""); - - but= uiDefBut(block, BUT, B_FMODIFIER_REDRAW, "Add Point", 160,cy,150,19, NULL, 0, 0, 0, 0, "Adds a new control-point to the envelope on the current frame"); - uiButSetFunc(but, fmod_envelope_addpoint_cb, env, NULL); - cy -= 35; - - /* Points List */ - for (i=0, fed=env->data; i < env->totvert; i++, fed++) { - uiBlockBeginAlign(block); - but=uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Fra:", 2, cy, 90, 20, &fed->time, -UI_FLT_MAX, UI_FLT_MAX, 10, 1, "Frame that envelope point occurs"); - uiButSetFunc(but, validate_fmodifier_cb, fcu, fcm); - - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Min:", 92, cy, 100, 20, &fed->min, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, "Minimum bound of envelope at this point"); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Max:", 192, cy, 100, 20, &fed->max, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, "Maximum bound of envelope at this point"); - - but= uiDefIconBut(block, BUT, B_FMODIFIER_REDRAW, ICON_X, 292, cy, 18, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Delete envelope control point"); - uiButSetFunc(but, fmod_envelope_deletepoint_cb, env, SET_INT_IN_POINTER(i)); - uiBlockBeginAlign(block); - cy -= 25; - } -} - -/* --------------- */ - -/* draw settings for limits modifier */ -static void draw_modifier__limits(uiBlock *block, FCurve *fcu, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) -{ - FMod_Limits *data= (FMod_Limits *)fcm->data; - const int togButWidth = 50; - const int textButWidth = ((width/2)-togButWidth); - - /* set the height */ - (*height) = 60; - - /* basic settings (backdrop + some padding) */ - DRAW_BACKDROP((*height)); - - /* Draw Pairs of LimitToggle+LimitValue */ - uiBlockBeginAlign(block); - uiDefButBitI(block, TOGBUT, FCM_LIMIT_XMIN, B_FMODIFIER_REDRAW, "xMin", 5, *yco-30, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum x value"); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 5+togButWidth, *yco-30, (textButWidth-5), 18, &data->rect.xmin, -UI_FLT_MAX, UI_FLT_MAX, 0.1,0.5,"Lowest x value to allow"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOGBUT, FCM_LIMIT_XMAX, B_FMODIFIER_REDRAW, "XMax", 5+(width-(textButWidth-5)-togButWidth), *yco-30, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum x value"); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 5+(width-textButWidth-5), *yco-30, (textButWidth-5), 18, &data->rect.xmax, -UI_FLT_MAX, UI_FLT_MAX, 0.1,0.5,"Highest x value to allow"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOGBUT, FCM_LIMIT_YMIN, B_FMODIFIER_REDRAW, "yMin", 5, *yco-52, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum y value"); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 5+togButWidth, *yco-52, (textButWidth-5), 18, &data->rect.ymin, -UI_FLT_MAX, UI_FLT_MAX, 0.1,0.5,"Lowest y value to allow"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOGBUT, FCM_LIMIT_YMAX, B_FMODIFIER_REDRAW, "YMax", 5+(width-(textButWidth-5)-togButWidth), *yco-52, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum y value"); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 5+(width-textButWidth-5), *yco-52, (textButWidth-5), 18, &data->rect.ymax, -UI_FLT_MAX, UI_FLT_MAX, 0.1,0.5,"Highest y value to allow"); - uiBlockEndAlign(block); -} - -/* --------------- */ - -static void graph_panel_modifier_draw(uiBlock *block, FCurve *fcu, FModifier *fcm, int *yco) -{ - FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); - uiBut *but; - short active= (fcm->flag & FMODIFIER_FLAG_ACTIVE); - short width= 314; - short height = 0; - int rb_col; - - /* draw header */ - { - uiBlockSetEmboss(block, UI_EMBOSSN); - - /* rounded header */ - rb_col= (active)?-20:20; - but= uiDefBut(block, ROUNDBOX, B_REDR, "", 0, *yco-2, width, 24, NULL, 5.0, 0.0, 15.0, (float)(rb_col-20), ""); - - /* expand */ - uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_EXPANDED, B_REDR, ICON_TRIA_RIGHT, 5, *yco-1, 20, 20, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is expanded."); - - /* checkbox for 'active' status (for now) */ - but= uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_ACTIVE, B_REDR, ICON_RADIOBUT_OFF, 25, *yco-1, 20, 20, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is active one."); - uiButSetFunc(but, activate_fmodifier_cb, fcu, fcm); - - /* name */ - if (fmi) - uiDefBut(block, LABEL, 1, fmi->name, 10+40, *yco, 150, 20, NULL, 0.0, 0.0, 0, 0, "F-Curve Modifier Type. Click to make modifier active one."); - else - uiDefBut(block, LABEL, 1, "", 10+40, *yco, 150, 20, NULL, 0.0, 0.0, 0, 0, "F-Curve Modifier Type. Click to make modifier active one."); - - /* 'mute' button */ - uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_MUTED, B_REDR, ICON_MUTE_IPO_OFF, 10+(width-60), *yco-1, 20, 20, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is temporarily muted (not evaluated)."); - - /* delete button */ - but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 10+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete F-Curve Modifier."); - uiButSetFunc(but, delete_fmodifier_cb, fcu, fcm); - - uiBlockSetEmboss(block, UI_EMBOSS); - } - - /* when modifier is expanded, draw settings */ - if (fcm->flag & FMODIFIER_FLAG_EXPANDED) { - /* draw settings for individual modifiers */ - switch (fcm->type) { - case FMODIFIER_TYPE_GENERATOR: /* Generator */ - draw_modifier__generator(block, fcu, fcm, yco, &height, width, active, rb_col); - break; - - case FMODIFIER_TYPE_FN_GENERATOR: /* Built-In Function Generator */ - draw_modifier__fn_generator(block, fcu, fcm, yco, &height, width, active, rb_col); - break; - - case FMODIFIER_TYPE_CYCLES: /* Cycles */ - draw_modifier__cycles(block, fcu, fcm, yco, &height, width, active, rb_col); - break; - - case FMODIFIER_TYPE_ENVELOPE: /* Envelope */ - draw_modifier__envelope(block, fcu, fcm, yco, &height, width, active, rb_col); - break; - - case FMODIFIER_TYPE_LIMITS: /* Limits */ - draw_modifier__limits(block, fcu, fcm, yco, &height, width, active, rb_col); - break; - - case FMODIFIER_TYPE_NOISE: /* Noise */ - draw_modifier__noise(block, fcu, fcm, yco, &height, width, active, rb_col); - break; - - default: /* unknown type */ - height= 96; - //DRAW_BACKDROP(height); // XXX buggy... - break; - } - } - - /* adjust height for new to start */ - (*yco) -= (height + 27); -} - static void graph_panel_modifiers(const bContext *C, Panel *pa) { bAnimListElem *ale; @@ -950,7 +381,7 @@ static void graph_panel_modifiers(const bContext *C, Panel *pa) /* draw each modifier */ for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) - graph_panel_modifier_draw(block, fcu, fcm, &yco); + ANIM_uiTemplate_fmodifier_draw(block, fcu, fcm, &yco); MEM_freeN(ale); } diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index c0a1c979147..106185085d6 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -174,6 +174,7 @@ extern StructRNA RNA_ExplodeModifier; extern StructRNA RNA_ExpressionController; extern StructRNA RNA_Event; extern StructRNA RNA_FCurve; +extern StructRNA RNA_FCurveSample; extern StructRNA RNA_FileSelectParams; extern StructRNA RNA_FModifier; extern StructRNA RNA_FModifierCycles; diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 4a83b80a6cf..826d186516d 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -230,7 +230,7 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FModifierFunctionGenerator", "FModifier"); - RNA_def_struct_ui_text(srna, "Built-In Function F-Curve Modifier", "Generates values using a Built-In Function."); + RNA_def_struct_ui_text(srna, "Built-In Function F-Modifier", "Generates values using a Built-In Function."); RNA_def_struct_sdna_from(srna, "FMod_FunctionGenerator", "data"); /* coefficients */ @@ -264,7 +264,7 @@ static void rna_def_fmodifier_envelope(BlenderRNA *brna) //PropertyRNA *prop; srna= RNA_def_struct(brna, "FModifierEnvelope", "FModifier"); - RNA_def_struct_ui_text(srna, "Envelope F-Curve Modifier", "Scales the values of the modified F-Curve."); + RNA_def_struct_ui_text(srna, "Envelope F-Modifier", "Scales the values of the modified F-Curve."); RNA_def_struct_sdna_from(srna, "FMod_Envelope", "data"); } @@ -283,7 +283,7 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FModifierCycles", "FModifier"); - RNA_def_struct_ui_text(srna, "Cycles F-Curve Modifier", "Repeats the values of the modified F-Curve."); + RNA_def_struct_ui_text(srna, "Cycles F-Modifier", "Repeats the values of the modified F-Curve."); RNA_def_struct_sdna_from(srna, "FMod_Cycles", "data"); /* before */ @@ -312,7 +312,7 @@ static void rna_def_fmodifier_python(BlenderRNA *brna) //PropertyRNA *prop; srna= RNA_def_struct(brna, "FModifierPython", "FModifier"); - RNA_def_struct_ui_text(srna, "Python F-Curve Modifier", "Performs user-defined operation on the modified F-Curve."); + RNA_def_struct_ui_text(srna, "Python F-Modifier", "Performs user-defined operation on the modified F-Curve."); RNA_def_struct_sdna_from(srna, "FMod_Python", "data"); } @@ -324,7 +324,7 @@ static void rna_def_fmodifier_limits(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "FModifierLimits", "FModifier"); - RNA_def_struct_ui_text(srna, "Limits F-Curve Modifier", "Limits the time/value ranges of the modified F-Curve."); + RNA_def_struct_ui_text(srna, "Limits F-Modifier", "Limits the time/value ranges of the modified F-Curve."); RNA_def_struct_sdna_from(srna, "FMod_Limits", "data"); prop= RNA_def_property(srna, "use_minimum_x", PROP_BOOLEAN, PROP_NONE); @@ -375,7 +375,7 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FModifierNoise", "FModifier"); - RNA_def_struct_ui_text(srna, "Noise F-Curve Modifier", "Gives randomness to the modified F-Curve."); + RNA_def_struct_ui_text(srna, "Noise F-Modifier", "Gives randomness to the modified F-Curve."); RNA_def_struct_sdna_from(srna, "FMod_Noise", "data"); prop= RNA_def_property(srna, "modification", PROP_ENUM, PROP_NONE); @@ -411,7 +411,7 @@ void rna_def_fmodifier(BlenderRNA *brna) /* base struct definition */ srna= RNA_def_struct(brna, "FModifier", NULL); RNA_def_struct_refine_func(srna, "rna_FModifierType_refine"); - RNA_def_struct_ui_text(srna, "FCurve Modifier", "Modifier for values of F-Curve."); + RNA_def_struct_ui_text(srna, "F-Modifier", "Modifier for values of F-Curve."); #if 0 // XXX not used yet /* name */ @@ -509,6 +509,27 @@ void rna_def_channeldriver(BlenderRNA *brna) /* *********************** */ +static void rna_def_fpoint(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "FCurveSample", NULL); + RNA_def_struct_sdna(srna, "FPoint"); + RNA_def_struct_ui_text(srna, "F-Curve Sample", "Sample point for F-Curve."); + + /* Boolean values */ + prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", 1); + RNA_def_property_ui_text(prop, "Selected", "Selection status"); + + /* Vector value */ + prop= RNA_def_property(srna, "point", PROP_FLOAT, PROP_VECTOR); + RNA_def_property_array(prop, 2); + RNA_def_property_float_sdna(prop, NULL, "vec"); + RNA_def_property_ui_text(prop, "Point", "Point coordinates"); +} + void rna_def_fcurve(BlenderRNA *brna) { StructRNA *srna; @@ -559,7 +580,7 @@ void rna_def_fcurve(BlenderRNA *brna) /* Collections */ prop= RNA_def_property(srna, "sampled_points", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fpt", "totvert"); - RNA_def_property_struct_type(prop, "CurvePoint"); // XXX FPoints not BPoints here! FPoints are much smaller! + RNA_def_property_struct_type(prop, "FCurveSample"); RNA_def_property_ui_text(prop, "Sampled Points", "Sampled animation data"); prop= RNA_def_property(srna, "keyframe_points", PROP_COLLECTION, PROP_NONE); @@ -577,6 +598,7 @@ void rna_def_fcurve(BlenderRNA *brna) void RNA_def_fcurve(BlenderRNA *brna) { rna_def_fcurve(brna); + rna_def_fpoint(brna); rna_def_drivertarget(brna); rna_def_channeldriver(brna); -- cgit v1.2.3 From f3c47a66b0cb3bb70505ed46522e6c557769eaa5 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 2 Jul 2009 05:25:14 +0000 Subject: NLA SoC: Separating out F-Modifier API * F-Modifier API is now in its own file in blenkernel * Renamed and refactored these so that they're no dependent on F-Curves, since all they really used was the fcu->modifiers list * Added missing license blocks to a few files --- source/blender/blenkernel/BKE_fcurve.h | 14 +- source/blender/blenkernel/intern/fcurve.c | 1137 +------------------- source/blender/blenkernel/intern/fmodifier.c | 1197 ++++++++++++++++++++++ source/blender/blenkernel/intern/ipo.c | 2 +- source/blender/blenkernel/intern/nla.c | 13 +- source/blender/editors/animation/drivers.c | 31 +- source/blender/editors/animation/fmodifier_ui.c | 21 +- source/blender/editors/animation/keyframing.c | 29 +- source/blender/editors/animation/keyingsets.c | 29 +- source/blender/editors/space_graph/graph_draw.c | 2 +- source/blender/editors/space_graph/graph_edit.c | 4 +- source/blender/editors/space_graph/graph_utils.c | 4 +- 12 files changed, 1310 insertions(+), 1173 deletions(-) create mode 100644 source/blender/blenkernel/intern/fmodifier.c (limited to 'source') diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index 5c77e3c2ae4..cfc4e9077f6 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -104,15 +104,15 @@ FModifierTypeInfo *get_fmodifier_typeinfo(int type); /* ---------------------- */ -struct FModifier *fcurve_add_modifier(struct FCurve *fcu, int type); -void fcurve_copy_modifiers(ListBase *dst, ListBase *src); -void fcurve_remove_modifier(struct FCurve *fcu, struct FModifier *fcm); -void fcurve_free_modifiers(struct FCurve *fcu); +struct FModifier *add_fmodifier(ListBase *modifiers, int type); +void copy_fmodifiers(ListBase *dst, ListBase *src); +void remove_fmodifier(ListBase *modifiers, struct FModifier *fcm); +void free_fmodifiers(ListBase *modifiers); -struct FModifier *fcurve_find_active_modifier(struct FCurve *fcu); -void fcurve_set_active_modifier(struct FCurve *fcu, struct FModifier *fcm); +struct FModifier *find_active_fmodifier(ListBase *modifiers); +void set_active_fmodifier(ListBase *modifiers, struct FModifier *fcm); -short fcurve_has_suitable_modifier(struct FCurve *fcu, int mtype, short acttype); +short list_has_suitable_fmodifier(ListBase *modifiers, int mtype, short acttype); float evaluate_time_fmodifiers(ListBase *modifiers, struct FCurve *fcu, float cvalue, float evaltime); void evaluate_value_fmodifiers(ListBase *modifiers, struct FCurve *fcu, float *cvalue, float evaltime); diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index e52c63d1b21..4c2ba61fc71 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -56,7 +56,7 @@ #include "RNA_types.h" #ifndef DISABLE_PYTHON -#include "BPY_extern.h" /* for BPY_pydriver_eval() */ +#include "BPY_extern.h" #endif #define SMALL -1.0e-10 @@ -84,7 +84,7 @@ void free_fcurve (FCurve *fcu) /* free extra data - i.e. modifiers, and driver */ fcurve_free_driver(fcu); - fcurve_free_modifiers(fcu); + free_fmodifiers(&fcu->modifiers); /* free f-curve itself */ MEM_freeN(fcu); @@ -140,7 +140,7 @@ FCurve *copy_fcurve (FCurve *fcu) fcu_d->driver= fcurve_copy_driver(fcu_d->driver); /* copy modifiers */ - fcurve_copy_modifiers(&fcu_d->modifiers, &fcu->modifiers); + copy_fmodifiers(&fcu_d->modifiers, &fcu->modifiers); /* return new data */ return fcu_d; @@ -1270,1135 +1270,6 @@ static float fcurve_eval_samples (FCurve *fcu, FPoint *fpts, float evaltime) return cvalue; } -/* ******************************** F-Curve Modifiers ********************************* */ - -/* Template --------------------------- */ - -/* Each modifier defines a set of functions, which will be called at the appropriate - * times. In addition to this, each modifier should have a type-info struct, where - * its functions are attached for use. - */ - -/* Template for type-info data: - * - make a copy of this when creating new modifiers, and just change the functions - * pointed to as necessary - * - although the naming of functions doesn't matter, it would help for code - * readability, to follow the same naming convention as is presented here - * - any functions that a constraint doesn't need to define, don't define - * for such cases, just use NULL - * - these should be defined after all the functions have been defined, so that - * forward-definitions/prototypes don't need to be used! - * - keep this copy #if-def'd so that future constraints can get based off this - */ -#if 0 -static FModifierTypeInfo FMI_MODNAME = { - FMODIFIER_TYPE_MODNAME, /* type */ - sizeof(FMod_ModName), /* size */ - FMI_TYPE_SOME_ACTION, /* action type */ - FMI_REQUIRES_SOME_REQUIREMENT, /* requirements */ - "Modifier Name", /* name */ - "FMod_ModName", /* struct name */ - fcm_modname_free, /* free data */ - fcm_modname_relink, /* relink data */ - fcm_modname_copy, /* copy data */ - fcm_modname_new_data, /* new data */ - fcm_modname_verify, /* verify */ - fcm_modname_time, /* evaluate time */ - fcm_modname_evaluate /* evaluate */ -}; -#endif - -/* Generator F-Curve Modifier --------------------------- */ - -/* Generators available: - * 1) simple polynomial generator: - * - Exanded form - (y = C[0]*(x^(n)) + C[1]*(x^(n-1)) + ... + C[n]) - * - Factorised form - (y = (C[0][0]*x + C[0][1]) * (C[1][0]*x + C[1][1]) * ... * (C[n][0]*x + C[n][1])) - */ - -static void fcm_generator_free (FModifier *fcm) -{ - FMod_Generator *data= (FMod_Generator *)fcm->data; - - /* free polynomial coefficients array */ - if (data->coefficients) - MEM_freeN(data->coefficients); -} - -static void fcm_generator_copy (FModifier *fcm, FModifier *src) -{ - FMod_Generator *gen= (FMod_Generator *)fcm->data; - FMod_Generator *ogen= (FMod_Generator *)src->data; - - /* copy coefficients array? */ - if (ogen->coefficients) - gen->coefficients= MEM_dupallocN(ogen->coefficients); -} - -static void fcm_generator_new_data (void *mdata) -{ - FMod_Generator *data= (FMod_Generator *)mdata; - float *cp; - - /* set default generator to be linear 0-1 (gradient = 1, y-offset = 0) */ - data->poly_order= 1; - data->arraysize= 2; - cp= data->coefficients= MEM_callocN(sizeof(float)*2, "FMod_Generator_Coefs"); - cp[0] = 0; // y-offset - cp[1] = 1; // gradient -} - -static void fcm_generator_verify (FModifier *fcm) -{ - FMod_Generator *data= (FMod_Generator *)fcm->data; - - /* requirements depend on mode */ - switch (data->mode) { - case FCM_GENERATOR_POLYNOMIAL: /* expanded polynomial expression */ - { - /* arraysize needs to be order+1, so resize if not */ - if (data->arraysize != (data->poly_order+1)) { - float *nc; - - /* make new coefficients array, and copy over as much data as can fit */ - nc= MEM_callocN(sizeof(float)*(data->poly_order+1), "FMod_Generator_Coefs"); - - if (data->coefficients) { - if (data->arraysize > (data->poly_order+1)) - memcpy(nc, data->coefficients, sizeof(float)*(data->poly_order+1)); - else - memcpy(nc, data->coefficients, sizeof(float)*data->arraysize); - - /* free the old data */ - MEM_freeN(data->coefficients); - } - - /* set the new data */ - data->coefficients= nc; - data->arraysize= data->poly_order+1; - } - } - break; - - case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* expanded polynomial expression */ - { - /* arraysize needs to be 2*order, so resize if not */ - if (data->arraysize != (data->poly_order * 2)) { - float *nc; - - /* make new coefficients array, and copy over as much data as can fit */ - nc= MEM_callocN(sizeof(float)*(data->poly_order*2), "FMod_Generator_Coefs"); - - if (data->coefficients) { - if (data->arraysize > (data->poly_order * 2)) - memcpy(nc, data->coefficients, sizeof(float)*(data->poly_order * 2)); - else - memcpy(nc, data->coefficients, sizeof(float)*data->arraysize); - - /* free the old data */ - MEM_freeN(data->coefficients); - } - - /* set the new data */ - data->coefficients= nc; - data->arraysize= data->poly_order * 2; - } - } - break; - } -} - -static void fcm_generator_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) -{ - FMod_Generator *data= (FMod_Generator *)fcm->data; - - /* behaviour depends on mode - * NOTE: the data in its default state is fine too - */ - switch (data->mode) { - case FCM_GENERATOR_POLYNOMIAL: /* expanded polynomial expression */ - { - /* we overwrite cvalue with the sum of the polynomial */ - float *powers = MEM_callocN(sizeof(float)*data->arraysize, "Poly Powers"); - float value= 0.0f; - unsigned int i; - - /* for each x^n, precalculate value based on previous one first... this should be - * faster that calling pow() for each entry - */ - for (i=0; i < data->arraysize; i++) { - /* first entry is x^0 = 1, otherwise, calculate based on previous */ - if (i) - powers[i]= powers[i-1] * evaltime; - else - powers[0]= 1; - } - - /* for each coefficient, add to value, which we'll write to *cvalue in one go */ - for (i=0; i < data->arraysize; i++) - value += data->coefficients[i] * powers[i]; - - /* only if something changed, write *cvalue in one go */ - if (data->poly_order) { - if (data->flag & FCM_GENERATOR_ADDITIVE) - *cvalue += value; - else - *cvalue= value; - } - - /* cleanup */ - if (powers) - MEM_freeN(powers); - } - break; - - case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* factorised polynomial */ - { - float value= 1.0f, *cp=NULL; - unsigned int i; - - /* for each coefficient pair, solve for that bracket before accumulating in value by multiplying */ - for (cp=data->coefficients, i=0; (cp) && (i < data->poly_order); cp+=2, i++) - value *= (cp[0]*evaltime + cp[1]); - - /* only if something changed, write *cvalue in one go */ - if (data->poly_order) { - if (data->flag & FCM_GENERATOR_ADDITIVE) - *cvalue += value; - else - *cvalue= value; - } - } - break; - } -} - -static FModifierTypeInfo FMI_GENERATOR = { - FMODIFIER_TYPE_GENERATOR, /* type */ - sizeof(FMod_Generator), /* size */ - FMI_TYPE_GENERATE_CURVE, /* action type */ - FMI_REQUIRES_NOTHING, /* requirements */ - "Generator", /* name */ - "FMod_Generator", /* struct name */ - fcm_generator_free, /* free data */ - fcm_generator_copy, /* copy data */ - fcm_generator_new_data, /* new data */ - fcm_generator_verify, /* verify */ - NULL, /* evaluate time */ - fcm_generator_evaluate /* evaluate */ -}; - -/* Built-In Function Generator F-Curve Modifier --------------------------- */ - -/* This uses the general equation for equations: - * y = amplitude * fn(phase_multiplier*x + phase_offset) + y_offset - * - * where amplitude, phase_multiplier/offset, y_offset are user-defined coefficients, - * x is the evaluation 'time', and 'y' is the resultant value - * - * Functions available are - * sin, cos, tan, sinc (normalised sin), natural log, square root - */ - -static void fcm_fn_generator_new_data (void *mdata) -{ - FMod_FunctionGenerator *data= (FMod_FunctionGenerator *)mdata; - - /* set amplitude and phase multiplier to 1.0f so that something is generated */ - data->amplitude= 1.0f; - data->phase_multiplier= 1.0f; -} - -/* Unary 'normalised sine' function - * y = sin(PI + x) / (PI * x), - * except for x = 0 when y = 1. - */ -static double sinc (double x) -{ - if (fabs(x) < 0.0001) - return 1.0; - else - return sin(M_PI * x) / (M_PI * x); -} - -static void fcm_fn_generator_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) -{ - FMod_FunctionGenerator *data= (FMod_FunctionGenerator *)fcm->data; - double arg= data->phase_multiplier*evaltime + data->phase_offset; - double (*fn)(double v) = NULL; - - /* get function pointer to the func to use: - * WARNING: must perform special argument validation hereto guard against crashes - */ - switch (data->type) - { - /* simple ones */ - case FCM_GENERATOR_FN_SIN: /* sine wave */ - fn= sin; - break; - case FCM_GENERATOR_FN_COS: /* cosine wave */ - fn= cos; - break; - case FCM_GENERATOR_FN_SINC: /* normalised sine wave */ - fn= sinc; - break; - - /* validation required */ - case FCM_GENERATOR_FN_TAN: /* tangent wave */ - { - /* check that argument is not on one of the discontinuities (i.e. 90deg, 270 deg, etc) */ - if IS_EQ(fmod((arg - M_PI_2), M_PI), 0.0) { - if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0) - *cvalue = 0.0f; /* no value possible here */ - } - else - fn= tan; - } - break; - case FCM_GENERATOR_FN_LN: /* natural log */ - { - /* check that value is greater than 1? */ - if (arg > 1.0f) { - fn= log; - } - else { - if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0) - *cvalue = 0.0f; /* no value possible here */ - } - } - break; - case FCM_GENERATOR_FN_SQRT: /* square root */ - { - /* no negative numbers */ - if (arg > 0.0f) { - fn= sqrt; - } - else { - if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0) - *cvalue = 0.0f; /* no value possible here */ - } - } - break; - - default: - printf("Invalid Function-Generator for F-Modifier - %d \n", data->type); - } - - /* execute function callback to set value if appropriate */ - if (fn) { - float value= (float)(data->amplitude*fn(arg) + data->value_offset); - - if (data->flag & FCM_GENERATOR_ADDITIVE) - *cvalue += value; - else - *cvalue= value; - } -} - -static FModifierTypeInfo FMI_FN_GENERATOR = { - FMODIFIER_TYPE_FN_GENERATOR, /* type */ - sizeof(FMod_FunctionGenerator), /* size */ - FMI_TYPE_GENERATE_CURVE, /* action type */ - FMI_REQUIRES_NOTHING, /* requirements */ - "Built-In Function", /* name */ - "FMod_FunctionGenerator", /* struct name */ - NULL, /* free data */ - NULL, /* copy data */ - fcm_fn_generator_new_data, /* new data */ - NULL, /* verify */ - NULL, /* evaluate time */ - fcm_fn_generator_evaluate /* evaluate */ -}; - -/* Envelope F-Curve Modifier --------------------------- */ - -static void fcm_envelope_free (FModifier *fcm) -{ - FMod_Envelope *env= (FMod_Envelope *)fcm->data; - - /* free envelope data array */ - if (env->data) - MEM_freeN(env->data); -} - -static void fcm_envelope_copy (FModifier *fcm, FModifier *src) -{ - FMod_Envelope *env= (FMod_Envelope *)fcm->data; - FMod_Envelope *oenv= (FMod_Envelope *)src->data; - - /* copy envelope data array */ - if (oenv->data) - env->data= MEM_dupallocN(oenv->data); -} - -static void fcm_envelope_new_data (void *mdata) -{ - FMod_Envelope *env= (FMod_Envelope *)mdata; - - /* set default min/max ranges */ - env->min= -1.0f; - env->max= 1.0f; -} - -static void fcm_envelope_verify (FModifier *fcm) -{ - FMod_Envelope *env= (FMod_Envelope *)fcm->data; - - /* if the are points, perform bubble-sort on them, as user may have changed the order */ - if (env->data) { - // XXX todo... - } -} - -static void fcm_envelope_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) -{ - FMod_Envelope *env= (FMod_Envelope *)fcm->data; - FCM_EnvelopeData *fed, *prevfed, *lastfed; - float min=0.0f, max=0.0f, fac=0.0f; - int a; - - /* get pointers */ - if (env->data == NULL) return; - prevfed= env->data; - fed= prevfed + 1; - lastfed= prevfed + (env->totvert-1); - - /* get min/max values for envelope at evaluation time (relative to mid-value) */ - if (prevfed->time >= evaltime) { - /* before or on first sample, so just extend value */ - min= prevfed->min; - max= prevfed->max; - } - else if (lastfed->time <= evaltime) { - /* after or on last sample, so just extend value */ - min= lastfed->min; - max= lastfed->max; - } - else { - /* evaltime occurs somewhere between segments */ - // TODO: implement binary search for this to make it faster? - for (a=0; prevfed && fed && (a < env->totvert-1); a++, prevfed=fed, fed++) { - /* evaltime occurs within the interval defined by these two envelope points */ - if ((prevfed->time <= evaltime) && (fed->time >= evaltime)) { - float afac, bfac, diff; - - diff= fed->time - prevfed->time; - afac= (evaltime - prevfed->time) / diff; - bfac= (fed->time - evaltime) / diff; - - min= bfac*prevfed->min + afac*fed->min; - max= bfac*prevfed->max + afac*fed->max; - - break; - } - } - } - - /* adjust *cvalue - * - fac is the ratio of how the current y-value corresponds to the reference range - * - thus, the new value is found by mapping the old range to the new! - */ - fac= (*cvalue - (env->midval + env->min)) / (env->max - env->min); - *cvalue= min + fac*(max - min); -} - -static FModifierTypeInfo FMI_ENVELOPE = { - FMODIFIER_TYPE_ENVELOPE, /* type */ - sizeof(FMod_Envelope), /* size */ - FMI_TYPE_REPLACE_VALUES, /* action type */ - 0, /* requirements */ - "Envelope", /* name */ - "FMod_Envelope", /* struct name */ - fcm_envelope_free, /* free data */ - fcm_envelope_copy, /* copy data */ - fcm_envelope_new_data, /* new data */ - fcm_envelope_verify, /* verify */ - NULL, /* evaluate time */ - fcm_envelope_evaluate /* evaluate */ -}; - -/* Cycles F-Curve Modifier --------------------------- */ - -/* This modifier changes evaltime to something that exists within the curve's frame-range, - * then re-evaluates modifier stack up to this point using the new time. This re-entrant behaviour - * is very likely to be more time-consuming than the original approach... (which was tighly integrated into - * the calculation code...). - * - * NOTE: this needs to be at the start of the stack to be of use, as it needs to know the extents of the keyframes/sample-data - * Possible TODO - store length of cycle information that can be initialised from the extents of the keyframes/sample-data, and adjusted - * as appropriate - */ - -/* temp data used during evaluation */ -typedef struct tFCMED_Cycles { - float cycyofs; /* y-offset to apply */ -} tFCMED_Cycles; - -static void fcm_cycles_new_data (void *mdata) -{ - FMod_Cycles *data= (FMod_Cycles *)mdata; - - /* turn on cycles by default */ - data->before_mode= data->after_mode= FCM_EXTRAPOLATE_CYCLIC; -} - -static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float cvalue, float evaltime) -{ - FMod_Cycles *data= (FMod_Cycles *)fcm->data; - float prevkey[2], lastkey[2], cycyofs=0.0f; - short side=0, mode=0; - int cycles=0; - - /* check if modifier is first in stack, otherwise disable ourself... */ - // FIXME... - if (fcm->prev) { - fcm->flag |= FMODIFIER_FLAG_DISABLED; - return evaltime; - } - - /* calculate new evaltime due to cyclic interpolation */ - if (fcu && fcu->bezt) { - BezTriple *prevbezt= fcu->bezt; - BezTriple *lastbezt= prevbezt + fcu->totvert-1; - - prevkey[0]= prevbezt->vec[1][0]; - prevkey[1]= prevbezt->vec[1][1]; - - lastkey[0]= lastbezt->vec[1][0]; - lastkey[1]= lastbezt->vec[1][1]; - } - else if (fcu && fcu->fpt) { - FPoint *prevfpt= fcu->fpt; - FPoint *lastfpt= prevfpt + fcu->totvert-1; - - prevkey[0]= prevfpt->vec[0]; - prevkey[1]= prevfpt->vec[1]; - - lastkey[0]= lastfpt->vec[0]; - lastkey[1]= lastfpt->vec[1]; - } - else - return evaltime; - - /* check if modifier will do anything - * 1) if in data range, definitely don't do anything - * 2) if before first frame or after last frame, make sure some cycling is in use - */ - if (evaltime < prevkey[0]) { - if (data->before_mode) { - side= -1; - mode= data->before_mode; - cycles= data->before_cycles; - } - } - else if (evaltime > lastkey[0]) { - if (data->after_mode) { - side= 1; - mode= data->after_mode; - cycles= data->after_cycles; - } - } - if ELEM(0, side, mode) - return evaltime; - - /* find relative place within a cycle */ - { - float cycdx=0, cycdy=0, ofs=0; - float cycle= 0; - - /* ofs is start frame of cycle */ - ofs= prevkey[0]; - - /* calculate period and amplitude (total height) of a cycle */ - cycdx= lastkey[0] - prevkey[0]; - cycdy= lastkey[1] - prevkey[1]; - - /* check if cycle is infinitely small, to be point of being impossible to use */ - if (cycdx == 0) - return evaltime; - - /* calculate the 'number' of the cycle */ - cycle= ((float)side * (evaltime - ofs) / cycdx); - - /* check that cyclic is still enabled for the specified time */ - if (cycles == 0) { - /* catch this case so that we don't exit when we have cycles=0 - * as this indicates infinite cycles... - */ - } - else if (cycle > (cycles+1)) { - /* we are too far away from range to evaluate - * TODO: but we should still hold last value... - */ - return evaltime; - } - - /* check if 'cyclic extrapolation', and thus calculate y-offset for this cycle */ - if (mode == FCM_EXTRAPOLATE_CYCLIC_OFFSET) { - cycyofs = (float)floor((evaltime - ofs) / cycdx); - cycyofs *= cycdy; - } - - /* calculate where in the cycle we are (overwrite evaltime to reflect this) */ - if ((mode == FCM_EXTRAPOLATE_MIRROR) && ((int)(cycle) % 2)) { - /* when 'mirror' option is used and cycle number is odd, this cycle is played in reverse - * - for 'before' extrapolation, we need to flip in a different way, otherwise values past - * then end of the curve get referenced (result of fmod will be negative, and with different phase) - */ - if (side < 0) - evaltime= (float)(prevkey[0] - fmod(evaltime-ofs, cycdx)); - else - evaltime= (float)(lastkey[0] - fmod(evaltime-ofs, cycdx)); - } - else { - /* the cycle is played normally... */ - evaltime= (float)(fmod(evaltime-ofs, cycdx) + ofs); - } - if (evaltime < ofs) evaltime += cycdx; - } - - /* store temp data if needed */ - if (mode == FCM_EXTRAPOLATE_CYCLIC_OFFSET) { - tFCMED_Cycles *edata; - - /* for now, this is just a float, but we could get more stuff... */ - fcm->edata= edata= MEM_callocN(sizeof(tFCMED_Cycles), "tFCMED_Cycles"); - edata->cycyofs= cycyofs; - } - - /* return the new frame to evaluate */ - return evaltime; -} - -static void fcm_cycles_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) -{ - tFCMED_Cycles *edata= (tFCMED_Cycles *)fcm->edata; - - /* use temp data */ - if (edata) { - /* add cyclic offset - no need to check for now, otherwise the data wouldn't exist! */ - *cvalue += edata->cycyofs; - - /* free temp data */ - MEM_freeN(edata); - fcm->edata= NULL; - } -} - -static FModifierTypeInfo FMI_CYCLES = { - FMODIFIER_TYPE_CYCLES, /* type */ - sizeof(FMod_Cycles), /* size */ - FMI_TYPE_EXTRAPOLATION, /* action type */ - FMI_REQUIRES_ORIGINAL_DATA, /* requirements */ - "Cycles", /* name */ - "FMod_Cycles", /* struct name */ - NULL, /* free data */ - NULL, /* copy data */ - fcm_cycles_new_data, /* new data */ - NULL /*fcm_cycles_verify*/, /* verify */ - fcm_cycles_time, /* evaluate time */ - fcm_cycles_evaluate /* evaluate */ -}; - -/* Noise F-Curve Modifier --------------------------- */ - -static void fcm_noise_new_data (void *mdata) -{ - FMod_Noise *data= (FMod_Noise *)mdata; - - /* defaults */ - data->size= 1.0f; - data->strength= 1.0f; - data->phase= 1.0f; - data->depth = 0; - data->modification = FCM_NOISE_MODIF_REPLACE; -} - -static void fcm_noise_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) -{ - FMod_Noise *data= (FMod_Noise *)fcm->data; - float noise; - - noise = BLI_turbulence(data->size, evaltime, data->phase, 0.f, data->depth); - - switch (data->modification) { - case FCM_NOISE_MODIF_ADD: - *cvalue= *cvalue + noise * data->strength; - break; - case FCM_NOISE_MODIF_SUBTRACT: - *cvalue= *cvalue - noise * data->strength; - break; - case FCM_NOISE_MODIF_MULTIPLY: - *cvalue= *cvalue * noise * data->strength; - break; - case FCM_NOISE_MODIF_REPLACE: - default: - *cvalue= *cvalue + (noise - 0.5f) * data->strength; - break; - } -} - -static FModifierTypeInfo FMI_NOISE = { - FMODIFIER_TYPE_NOISE, /* type */ - sizeof(FMod_Noise), /* size */ - FMI_TYPE_REPLACE_VALUES, /* action type */ - 0, /* requirements */ - "Noise", /* name */ - "FMod_Noise", /* struct name */ - NULL, /* free data */ - NULL, /* copy data */ - fcm_noise_new_data, /* new data */ - NULL /*fcm_noise_verify*/, /* verify */ - NULL, /* evaluate time */ - fcm_noise_evaluate /* evaluate */ -}; - -/* Filter F-Curve Modifier --------------------------- */ - -#if 0 // XXX not yet implemented -static FModifierTypeInfo FMI_FILTER = { - FMODIFIER_TYPE_FILTER, /* type */ - sizeof(FMod_Filter), /* size */ - FMI_TYPE_REPLACE_VALUES, /* action type */ - 0, /* requirements */ - "Filter", /* name */ - "FMod_Filter", /* struct name */ - NULL, /* free data */ - NULL, /* copy data */ - NULL, /* new data */ - NULL /*fcm_filter_verify*/, /* verify */ - NULL, /* evlauate time */ - fcm_filter_evaluate /* evaluate */ -}; -#endif // XXX not yet implemented - - -/* Python F-Curve Modifier --------------------------- */ - -static void fcm_python_free (FModifier *fcm) -{ - FMod_Python *data= (FMod_Python *)fcm->data; - - /* id-properties */ - IDP_FreeProperty(data->prop); - MEM_freeN(data->prop); -} - -static void fcm_python_new_data (void *mdata) -{ - FMod_Python *data= (FMod_Python *)mdata; - - /* everything should be set correctly by calloc, except for the prop->type constant.*/ - data->prop = MEM_callocN(sizeof(IDProperty), "PyFModifierProps"); - data->prop->type = IDP_GROUP; -} - -static void fcm_python_copy (FModifier *fcm, FModifier *src) -{ - FMod_Python *pymod = (FMod_Python *)fcm->data; - FMod_Python *opymod = (FMod_Python *)src->data; - - pymod->prop = IDP_CopyProperty(opymod->prop); -} - -static void fcm_python_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) -{ -#ifndef DISABLE_PYTHON - //FMod_Python *data= (FMod_Python *)fcm->data; - - /* FIXME... need to implement this modifier... - * It will need it execute a script using the custom properties - */ -#endif /* DISABLE_PYTHON */ -} - -static FModifierTypeInfo FMI_PYTHON = { - FMODIFIER_TYPE_PYTHON, /* type */ - sizeof(FMod_Python), /* size */ - FMI_TYPE_GENERATE_CURVE, /* action type */ - FMI_REQUIRES_RUNTIME_CHECK, /* requirements */ - "Python", /* name */ - "FMod_Python", /* struct name */ - fcm_python_free, /* free data */ - fcm_python_copy, /* copy data */ - fcm_python_new_data, /* new data */ - NULL /*fcm_python_verify*/, /* verify */ - NULL /*fcm_python_time*/, /* evaluate time */ - fcm_python_evaluate /* evaluate */ -}; - - -/* Limits F-Curve Modifier --------------------------- */ - -static float fcm_limits_time (FCurve *fcu, FModifier *fcm, float cvalue, float evaltime) -{ - FMod_Limits *data= (FMod_Limits *)fcm->data; - - /* check for the time limits */ - if ((data->flag & FCM_LIMIT_XMIN) && (evaltime < data->rect.xmin)) - return data->rect.xmin; - if ((data->flag & FCM_LIMIT_XMAX) && (evaltime > data->rect.xmax)) - return data->rect.xmax; - - /* modifier doesn't change time */ - return evaltime; -} - -static void fcm_limits_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) -{ - FMod_Limits *data= (FMod_Limits *)fcm->data; - - /* value limits now */ - if ((data->flag & FCM_LIMIT_YMIN) && (*cvalue < data->rect.ymin)) - *cvalue= data->rect.ymin; - if ((data->flag & FCM_LIMIT_YMAX) && (*cvalue > data->rect.ymax)) - *cvalue= data->rect.ymax; -} - -static FModifierTypeInfo FMI_LIMITS = { - FMODIFIER_TYPE_LIMITS, /* type */ - sizeof(FMod_Limits), /* size */ - FMI_TYPE_GENERATE_CURVE, /* action type */ /* XXX... err... */ - FMI_REQUIRES_RUNTIME_CHECK, /* requirements */ - "Limits", /* name */ - "FMod_Limits", /* struct name */ - NULL, /* free data */ - NULL, /* copy data */ - NULL, /* new data */ - NULL, /* verify */ - fcm_limits_time, /* evaluate time */ - fcm_limits_evaluate /* evaluate */ -}; - -/* F-Curve Modifier API --------------------------- */ -/* All of the F-Curve Modifier api functions use FModifierTypeInfo structs to carry out - * and operations that involve F-Curve modifier specific code. - */ - -/* These globals only ever get directly accessed in this file */ -static FModifierTypeInfo *fmodifiersTypeInfo[FMODIFIER_NUM_TYPES]; -static short FMI_INIT= 1; /* when non-zero, the list needs to be updated */ - -/* This function only gets called when FMI_INIT is non-zero */ -static void fmods_init_typeinfo () -{ - fmodifiersTypeInfo[0]= NULL; /* 'Null' F-Curve Modifier */ - fmodifiersTypeInfo[1]= &FMI_GENERATOR; /* Generator F-Curve Modifier */ - fmodifiersTypeInfo[2]= &FMI_FN_GENERATOR; /* Built-In Function Generator F-Curve Modifier */ - fmodifiersTypeInfo[3]= &FMI_ENVELOPE; /* Envelope F-Curve Modifier */ - fmodifiersTypeInfo[4]= &FMI_CYCLES; /* Cycles F-Curve Modifier */ - fmodifiersTypeInfo[5]= &FMI_NOISE; /* Apply-Noise F-Curve Modifier */ - fmodifiersTypeInfo[6]= NULL/*&FMI_FILTER*/; /* Filter F-Curve Modifier */ // XXX unimplemented - fmodifiersTypeInfo[7]= &FMI_PYTHON; /* Custom Python F-Curve Modifier */ - fmodifiersTypeInfo[8]= &FMI_LIMITS; /* Limits F-Curve Modifier */ -} - -/* This function should be used for getting the appropriate type-info when only - * a F-Curve modifier type is known - */ -FModifierTypeInfo *get_fmodifier_typeinfo (int type) -{ - /* initialise the type-info list? */ - if (FMI_INIT) { - fmods_init_typeinfo(); - FMI_INIT = 0; - } - - /* only return for valid types */ - if ( (type >= FMODIFIER_TYPE_NULL) && - (type <= FMODIFIER_NUM_TYPES ) ) - { - /* there shouldn't be any segfaults here... */ - return fmodifiersTypeInfo[type]; - } - else { - printf("No valid F-Curve Modifier type-info data available. Type = %i \n", type); - } - - return NULL; -} - -/* This function should always be used to get the appropriate type-info, as it - * has checks which prevent segfaults in some weird cases. - */ -FModifierTypeInfo *fmodifier_get_typeinfo (FModifier *fcm) -{ - /* only return typeinfo for valid modifiers */ - if (fcm) - return get_fmodifier_typeinfo(fcm->type); - else - return NULL; -} - -/* API --------------------------- */ - -/* Add a new F-Curve Modifier to the given F-Curve of a certain type */ -FModifier *fcurve_add_modifier (FCurve *fcu, int type) -{ - FModifierTypeInfo *fmi= get_fmodifier_typeinfo(type); - FModifier *fcm; - - /* sanity checks */ - if ELEM(NULL, fcu, fmi) - return NULL; - - /* special checks for whether modifier can be added */ - if ((fcu->modifiers.first) && (type == FMODIFIER_TYPE_CYCLES)) { - /* cycles modifier must be first in stack, so for now, don't add if it can't be */ - // TODO: perhaps there is some better way, but for now, - printf("Error: Cannot add 'Cycles' modifier to F-Curve, as 'Cycles' modifier can only be first in stack. \n"); - return NULL; - } - - /* add modifier itself */ - fcm= MEM_callocN(sizeof(FModifier), "F-Curve Modifier"); - fcm->type = type; - fcm->flag = FMODIFIER_FLAG_EXPANDED; - BLI_addtail(&fcu->modifiers, fcm); - - /* add modifier's data */ - fcm->data= MEM_callocN(fmi->size, fmi->structName); - - /* init custom settings if necessary */ - if (fmi->new_data) - fmi->new_data(fcm->data); - - /* return modifier for further editing */ - return fcm; -} - -/* Duplicate all of the F-Curve Modifiers in the Modifier stacks */ -void fcurve_copy_modifiers (ListBase *dst, ListBase *src) -{ - FModifier *fcm, *srcfcm; - - if ELEM(NULL, dst, src) - return; - - dst->first= dst->last= NULL; - BLI_duplicatelist(dst, src); - - for (fcm=dst->first, srcfcm=src->first; fcm && srcfcm; srcfcm=srcfcm->next, fcm=fcm->next) { - FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); - - /* make a new copy of the F-Modifier's data */ - fcm->data = MEM_dupallocN(fcm->data); - - /* only do specific constraints if required */ - if (fmi && fmi->copy_data) - fmi->copy_data(fcm, srcfcm); - } -} - -/* Remove and free the given F-Curve Modifier from the given F-Curve's stack */ -void fcurve_remove_modifier (FCurve *fcu, FModifier *fcm) -{ - FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); - - /* sanity check */ - if (fcm == NULL) - return; - - /* free modifier's special data (stored inside fcm->data) */ - if (fcm->data) { - if (fmi && fmi->free_data) - fmi->free_data(fcm); - - /* free modifier's data (fcm->data) */ - MEM_freeN(fcm->data); - } - - /* remove modifier from stack */ - if (fcu) - BLI_freelinkN(&fcu->modifiers, fcm); - else { - // XXX this case can probably be removed some day, as it shouldn't happen... - printf("fcurve_remove_modifier() - no fcurve \n"); - MEM_freeN(fcm); - } -} - -/* Remove all of a given F-Curve's modifiers */ -void fcurve_free_modifiers (FCurve *fcu) -{ - FModifier *fcm, *fmn; - - /* sanity check */ - if (fcu == NULL) - return; - - /* free each modifier in order - modifier is unlinked from list and freed */ - for (fcm= fcu->modifiers.first; fcm; fcm= fmn) { - fmn= fcm->next; - fcurve_remove_modifier(fcu, fcm); - } -} - -/* Find the active F-Curve Modifier */ -FModifier *fcurve_find_active_modifier (FCurve *fcu) -{ - FModifier *fcm; - - /* sanity checks */ - if ELEM(NULL, fcu, fcu->modifiers.first) - return NULL; - - /* loop over modifiers until 'active' one is found */ - for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) { - if (fcm->flag & FMODIFIER_FLAG_ACTIVE) - return fcm; - } - - /* no modifier is active */ - return NULL; -} - -/* Set the active F-Curve Modifier */ -void fcurve_set_active_modifier (FCurve *fcu, FModifier *fcm) -{ - FModifier *fm; - - /* sanity checks */ - if ELEM(NULL, fcu, fcu->modifiers.first) - return; - - /* deactivate all, and set current one active */ - for (fm= fcu->modifiers.first; fm; fm= fm->next) - fm->flag &= ~FMODIFIER_FLAG_ACTIVE; - - /* make given modifier active */ - if (fcm) - fcm->flag |= FMODIFIER_FLAG_ACTIVE; -} - -/* Do we have any modifiers which match certain criteria - * - mtype - type of modifier (if 0, doesn't matter) - * - acttype - type of action to perform (if -1, doesn't matter) - */ -short fcurve_has_suitable_modifier (FCurve *fcu, int mtype, short acttype) -{ - FModifier *fcm; - - /* if there are no specific filtering criteria, just skip */ - if ((mtype == 0) && (acttype == 0)) - return (fcu && fcu->modifiers.first); - - /* sanity checks */ - if ELEM(NULL, fcu, fcu->modifiers.first) - return 0; - - /* find the first mdifier fitting these criteria */ - for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) { - FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); - short mOk=1, aOk=1; /* by default 1, so that when only one test, won't fail */ - - /* check if applicable ones are fullfilled */ - if (mtype) - mOk= (fcm->type == mtype); - if (acttype > -1) - aOk= (fmi->acttype == acttype); - - /* if both are ok, we've found a hit */ - if (mOk && aOk) - return 1; - } - - /* no matches */ - return 0; -} - -/* Evaluation API --------------------------- */ - -/* evaluate time modifications imposed by some F-Curve Modifiers - * - this step acts as an optimisation to prevent the F-Curve stack being evaluated - * several times by modifiers requesting the time be modified, as the final result - * would have required using the modified time - * - modifiers only ever recieve the unmodified time, as subsequent modifiers should be - * working on the 'global' result of the modified curve, not some localised segment, - * so nevaltime gets set to whatever the last time-modifying modifier likes... - * - we start from the end of the stack, as only the last one matters for now - */ -float evaluate_time_fmodifiers (ListBase *modifiers, FCurve *fcu, float cvalue, float evaltime) -{ - FModifier *fcm; - float m_evaltime= evaltime; - - /* sanity checks */ - if ELEM(NULL, modifiers, modifiers->first) - return evaltime; - - /* find the first modifier from end of stack that modifies time, and calculate the time the modifier - * would calculate time at - */ - for (fcm= fcu->modifiers.last; fcm; fcm= fcm->prev) { - FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); - - /* only evaluate if there's a callback for this */ - // TODO: implement the 'influence' control feature... - if (fmi && fmi->evaluate_modifier_time) { - if ((fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) == 0) - m_evaltime= fmi->evaluate_modifier_time(fcu, fcm, cvalue, evaltime); - break; - } - } - - /* return the modified evaltime */ - return m_evaltime; -} - -/* Evalautes the given set of F-Curve Modifiers using the given data - * Should only be called after evaluate_time_fmodifiers() has been called... - */ -void evaluate_value_fmodifiers (ListBase *modifiers, FCurve *fcu, float *cvalue, float evaltime) -{ - FModifier *fcm; - - /* sanity checks */ - if ELEM(NULL, modifiers, modifiers->first) - return; - - /* evaluate modifiers */ - for (fcm= modifiers->first; fcm; fcm= fcm->next) { - FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); - - /* only evaluate if there's a callback for this */ - // TODO: implement the 'influence' control feature... - if (fmi && fmi->evaluate_modifier) { - if ((fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) == 0) - fmi->evaluate_modifier(fcu, fcm, cvalue, evaltime); - } - } -} - - -/* Bake modifiers for given F-Curve to curve sample data, in the frame range defined - * by start and end (inclusive). - */ -void fcurve_bake_modifiers (FCurve *fcu, int start, int end) -{ - ChannelDriver *driver; - - /* sanity checks */ - // TODO: make these tests report errors using reports not printf's - if ELEM(NULL, fcu, fcu->modifiers.first) { - printf("Error: No F-Curve with F-Curve Modifiers to Bake\n"); - return; - } - - /* temporarily, disable driver while we sample, so that they don't influence the outcome */ - driver= fcu->driver; - fcu->driver= NULL; - - /* bake the modifiers, by sampling the curve at each frame */ - fcurve_store_samples(fcu, NULL, start, end, fcurve_samplingcb_evalcurve); - - /* free the modifiers now */ - fcurve_free_modifiers(fcu); - - /* restore driver */ - fcu->driver= driver; -} - /* ***************************** F-Curve - Evaluation ********************************* */ /* Evaluate and return the value of the given F-Curve at the specified frame ("evaltime") @@ -2450,7 +1321,7 @@ void calculate_fcurve (FCurve *fcu, float ctime) * any data which warrants this... */ if ( (fcu->totvert) || (fcu->driver && !(fcu->driver->flag & DRIVER_FLAG_INVALID)) || - fcurve_has_suitable_modifier(fcu, 0, FMI_TYPE_GENERATE_CURVE) ) + list_has_suitable_fmodifier(&fcu->modifiers, 0, FMI_TYPE_GENERATE_CURVE) ) { /* calculate and set curval (evaluates driver too if necessary) */ fcu->curval= evaluate_fcurve(fcu, ctime); diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c new file mode 100644 index 00000000000..aa5214979d9 --- /dev/null +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -0,0 +1,1197 @@ +/** + * $Id: fcurve.c 21299 2009-07-02 02:12:37Z aligorith $ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation, Joshua Leung + * All rights reserved. + * + * Contributor(s): Joshua Leung (full recode) + * + * ***** END GPL LICENSE BLOCK ***** + */ + + +#include +#include +#include +#include +#include + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "MEM_guardedalloc.h" + +#include "DNA_anim_types.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" +#include "BLI_noise.h" + +#include "BKE_fcurve.h" +#include "BKE_curve.h" +#include "BKE_global.h" +#include "BKE_idprop.h" +#include "BKE_utildefines.h" + +#include "RNA_access.h" +#include "RNA_types.h" + +#ifndef DISABLE_PYTHON +#include "BPY_extern.h" /* for BPY_pydriver_eval() */ +#endif + +#define SMALL -1.0e-10 +#define SELECT 1 + +/* ******************************** F-Modifiers ********************************* */ + +/* Info ------------------------------- */ + +/* F-Modifiers are modifiers which operate on F-Curves. However, they can also be defined + * on NLA-Strips to affect all of the F-Curves referenced by the NLA-Strip. + */ + +/* Template --------------------------- */ + +/* Each modifier defines a set of functions, which will be called at the appropriate + * times. In addition to this, each modifier should have a type-info struct, where + * its functions are attached for use. + */ + +/* Template for type-info data: + * - make a copy of this when creating new modifiers, and just change the functions + * pointed to as necessary + * - although the naming of functions doesn't matter, it would help for code + * readability, to follow the same naming convention as is presented here + * - any functions that a constraint doesn't need to define, don't define + * for such cases, just use NULL + * - these should be defined after all the functions have been defined, so that + * forward-definitions/prototypes don't need to be used! + * - keep this copy #if-def'd so that future constraints can get based off this + */ +#if 0 +static FModifierTypeInfo FMI_MODNAME = { + FMODIFIER_TYPE_MODNAME, /* type */ + sizeof(FMod_ModName), /* size */ + FMI_TYPE_SOME_ACTION, /* action type */ + FMI_REQUIRES_SOME_REQUIREMENT, /* requirements */ + "Modifier Name", /* name */ + "FMod_ModName", /* struct name */ + fcm_modname_free, /* free data */ + fcm_modname_relink, /* relink data */ + fcm_modname_copy, /* copy data */ + fcm_modname_new_data, /* new data */ + fcm_modname_verify, /* verify */ + fcm_modname_time, /* evaluate time */ + fcm_modname_evaluate /* evaluate */ +}; +#endif + +/* Generator F-Curve Modifier --------------------------- */ + +/* Generators available: + * 1) simple polynomial generator: + * - Exanded form - (y = C[0]*(x^(n)) + C[1]*(x^(n-1)) + ... + C[n]) + * - Factorised form - (y = (C[0][0]*x + C[0][1]) * (C[1][0]*x + C[1][1]) * ... * (C[n][0]*x + C[n][1])) + */ + +static void fcm_generator_free (FModifier *fcm) +{ + FMod_Generator *data= (FMod_Generator *)fcm->data; + + /* free polynomial coefficients array */ + if (data->coefficients) + MEM_freeN(data->coefficients); +} + +static void fcm_generator_copy (FModifier *fcm, FModifier *src) +{ + FMod_Generator *gen= (FMod_Generator *)fcm->data; + FMod_Generator *ogen= (FMod_Generator *)src->data; + + /* copy coefficients array? */ + if (ogen->coefficients) + gen->coefficients= MEM_dupallocN(ogen->coefficients); +} + +static void fcm_generator_new_data (void *mdata) +{ + FMod_Generator *data= (FMod_Generator *)mdata; + float *cp; + + /* set default generator to be linear 0-1 (gradient = 1, y-offset = 0) */ + data->poly_order= 1; + data->arraysize= 2; + cp= data->coefficients= MEM_callocN(sizeof(float)*2, "FMod_Generator_Coefs"); + cp[0] = 0; // y-offset + cp[1] = 1; // gradient +} + +static void fcm_generator_verify (FModifier *fcm) +{ + FMod_Generator *data= (FMod_Generator *)fcm->data; + + /* requirements depend on mode */ + switch (data->mode) { + case FCM_GENERATOR_POLYNOMIAL: /* expanded polynomial expression */ + { + /* arraysize needs to be order+1, so resize if not */ + if (data->arraysize != (data->poly_order+1)) { + float *nc; + + /* make new coefficients array, and copy over as much data as can fit */ + nc= MEM_callocN(sizeof(float)*(data->poly_order+1), "FMod_Generator_Coefs"); + + if (data->coefficients) { + if (data->arraysize > (data->poly_order+1)) + memcpy(nc, data->coefficients, sizeof(float)*(data->poly_order+1)); + else + memcpy(nc, data->coefficients, sizeof(float)*data->arraysize); + + /* free the old data */ + MEM_freeN(data->coefficients); + } + + /* set the new data */ + data->coefficients= nc; + data->arraysize= data->poly_order+1; + } + } + break; + + case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* expanded polynomial expression */ + { + /* arraysize needs to be 2*order, so resize if not */ + if (data->arraysize != (data->poly_order * 2)) { + float *nc; + + /* make new coefficients array, and copy over as much data as can fit */ + nc= MEM_callocN(sizeof(float)*(data->poly_order*2), "FMod_Generator_Coefs"); + + if (data->coefficients) { + if (data->arraysize > (data->poly_order * 2)) + memcpy(nc, data->coefficients, sizeof(float)*(data->poly_order * 2)); + else + memcpy(nc, data->coefficients, sizeof(float)*data->arraysize); + + /* free the old data */ + MEM_freeN(data->coefficients); + } + + /* set the new data */ + data->coefficients= nc; + data->arraysize= data->poly_order * 2; + } + } + break; + } +} + +static void fcm_generator_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) +{ + FMod_Generator *data= (FMod_Generator *)fcm->data; + + /* behaviour depends on mode + * NOTE: the data in its default state is fine too + */ + switch (data->mode) { + case FCM_GENERATOR_POLYNOMIAL: /* expanded polynomial expression */ + { + /* we overwrite cvalue with the sum of the polynomial */ + float *powers = MEM_callocN(sizeof(float)*data->arraysize, "Poly Powers"); + float value= 0.0f; + unsigned int i; + + /* for each x^n, precalculate value based on previous one first... this should be + * faster that calling pow() for each entry + */ + for (i=0; i < data->arraysize; i++) { + /* first entry is x^0 = 1, otherwise, calculate based on previous */ + if (i) + powers[i]= powers[i-1] * evaltime; + else + powers[0]= 1; + } + + /* for each coefficient, add to value, which we'll write to *cvalue in one go */ + for (i=0; i < data->arraysize; i++) + value += data->coefficients[i] * powers[i]; + + /* only if something changed, write *cvalue in one go */ + if (data->poly_order) { + if (data->flag & FCM_GENERATOR_ADDITIVE) + *cvalue += value; + else + *cvalue= value; + } + + /* cleanup */ + if (powers) + MEM_freeN(powers); + } + break; + + case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* factorised polynomial */ + { + float value= 1.0f, *cp=NULL; + unsigned int i; + + /* for each coefficient pair, solve for that bracket before accumulating in value by multiplying */ + for (cp=data->coefficients, i=0; (cp) && (i < data->poly_order); cp+=2, i++) + value *= (cp[0]*evaltime + cp[1]); + + /* only if something changed, write *cvalue in one go */ + if (data->poly_order) { + if (data->flag & FCM_GENERATOR_ADDITIVE) + *cvalue += value; + else + *cvalue= value; + } + } + break; + } +} + +static FModifierTypeInfo FMI_GENERATOR = { + FMODIFIER_TYPE_GENERATOR, /* type */ + sizeof(FMod_Generator), /* size */ + FMI_TYPE_GENERATE_CURVE, /* action type */ + FMI_REQUIRES_NOTHING, /* requirements */ + "Generator", /* name */ + "FMod_Generator", /* struct name */ + fcm_generator_free, /* free data */ + fcm_generator_copy, /* copy data */ + fcm_generator_new_data, /* new data */ + fcm_generator_verify, /* verify */ + NULL, /* evaluate time */ + fcm_generator_evaluate /* evaluate */ +}; + +/* Built-In Function Generator F-Curve Modifier --------------------------- */ + +/* This uses the general equation for equations: + * y = amplitude * fn(phase_multiplier*x + phase_offset) + y_offset + * + * where amplitude, phase_multiplier/offset, y_offset are user-defined coefficients, + * x is the evaluation 'time', and 'y' is the resultant value + * + * Functions available are + * sin, cos, tan, sinc (normalised sin), natural log, square root + */ + +static void fcm_fn_generator_new_data (void *mdata) +{ + FMod_FunctionGenerator *data= (FMod_FunctionGenerator *)mdata; + + /* set amplitude and phase multiplier to 1.0f so that something is generated */ + data->amplitude= 1.0f; + data->phase_multiplier= 1.0f; +} + +/* Unary 'normalised sine' function + * y = sin(PI + x) / (PI * x), + * except for x = 0 when y = 1. + */ +static double sinc (double x) +{ + if (fabs(x) < 0.0001) + return 1.0; + else + return sin(M_PI * x) / (M_PI * x); +} + +static void fcm_fn_generator_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) +{ + FMod_FunctionGenerator *data= (FMod_FunctionGenerator *)fcm->data; + double arg= data->phase_multiplier*evaltime + data->phase_offset; + double (*fn)(double v) = NULL; + + /* get function pointer to the func to use: + * WARNING: must perform special argument validation hereto guard against crashes + */ + switch (data->type) + { + /* simple ones */ + case FCM_GENERATOR_FN_SIN: /* sine wave */ + fn= sin; + break; + case FCM_GENERATOR_FN_COS: /* cosine wave */ + fn= cos; + break; + case FCM_GENERATOR_FN_SINC: /* normalised sine wave */ + fn= sinc; + break; + + /* validation required */ + case FCM_GENERATOR_FN_TAN: /* tangent wave */ + { + /* check that argument is not on one of the discontinuities (i.e. 90deg, 270 deg, etc) */ + if IS_EQ(fmod((arg - M_PI_2), M_PI), 0.0) { + if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0) + *cvalue = 0.0f; /* no value possible here */ + } + else + fn= tan; + } + break; + case FCM_GENERATOR_FN_LN: /* natural log */ + { + /* check that value is greater than 1? */ + if (arg > 1.0f) { + fn= log; + } + else { + if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0) + *cvalue = 0.0f; /* no value possible here */ + } + } + break; + case FCM_GENERATOR_FN_SQRT: /* square root */ + { + /* no negative numbers */ + if (arg > 0.0f) { + fn= sqrt; + } + else { + if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0) + *cvalue = 0.0f; /* no value possible here */ + } + } + break; + + default: + printf("Invalid Function-Generator for F-Modifier - %d \n", data->type); + } + + /* execute function callback to set value if appropriate */ + if (fn) { + float value= (float)(data->amplitude*fn(arg) + data->value_offset); + + if (data->flag & FCM_GENERATOR_ADDITIVE) + *cvalue += value; + else + *cvalue= value; + } +} + +static FModifierTypeInfo FMI_FN_GENERATOR = { + FMODIFIER_TYPE_FN_GENERATOR, /* type */ + sizeof(FMod_FunctionGenerator), /* size */ + FMI_TYPE_GENERATE_CURVE, /* action type */ + FMI_REQUIRES_NOTHING, /* requirements */ + "Built-In Function", /* name */ + "FMod_FunctionGenerator", /* struct name */ + NULL, /* free data */ + NULL, /* copy data */ + fcm_fn_generator_new_data, /* new data */ + NULL, /* verify */ + NULL, /* evaluate time */ + fcm_fn_generator_evaluate /* evaluate */ +}; + +/* Envelope F-Curve Modifier --------------------------- */ + +static void fcm_envelope_free (FModifier *fcm) +{ + FMod_Envelope *env= (FMod_Envelope *)fcm->data; + + /* free envelope data array */ + if (env->data) + MEM_freeN(env->data); +} + +static void fcm_envelope_copy (FModifier *fcm, FModifier *src) +{ + FMod_Envelope *env= (FMod_Envelope *)fcm->data; + FMod_Envelope *oenv= (FMod_Envelope *)src->data; + + /* copy envelope data array */ + if (oenv->data) + env->data= MEM_dupallocN(oenv->data); +} + +static void fcm_envelope_new_data (void *mdata) +{ + FMod_Envelope *env= (FMod_Envelope *)mdata; + + /* set default min/max ranges */ + env->min= -1.0f; + env->max= 1.0f; +} + +static void fcm_envelope_verify (FModifier *fcm) +{ + FMod_Envelope *env= (FMod_Envelope *)fcm->data; + + /* if the are points, perform bubble-sort on them, as user may have changed the order */ + if (env->data) { + // XXX todo... + } +} + +static void fcm_envelope_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) +{ + FMod_Envelope *env= (FMod_Envelope *)fcm->data; + FCM_EnvelopeData *fed, *prevfed, *lastfed; + float min=0.0f, max=0.0f, fac=0.0f; + int a; + + /* get pointers */ + if (env->data == NULL) return; + prevfed= env->data; + fed= prevfed + 1; + lastfed= prevfed + (env->totvert-1); + + /* get min/max values for envelope at evaluation time (relative to mid-value) */ + if (prevfed->time >= evaltime) { + /* before or on first sample, so just extend value */ + min= prevfed->min; + max= prevfed->max; + } + else if (lastfed->time <= evaltime) { + /* after or on last sample, so just extend value */ + min= lastfed->min; + max= lastfed->max; + } + else { + /* evaltime occurs somewhere between segments */ + // TODO: implement binary search for this to make it faster? + for (a=0; prevfed && fed && (a < env->totvert-1); a++, prevfed=fed, fed++) { + /* evaltime occurs within the interval defined by these two envelope points */ + if ((prevfed->time <= evaltime) && (fed->time >= evaltime)) { + float afac, bfac, diff; + + diff= fed->time - prevfed->time; + afac= (evaltime - prevfed->time) / diff; + bfac= (fed->time - evaltime) / diff; + + min= bfac*prevfed->min + afac*fed->min; + max= bfac*prevfed->max + afac*fed->max; + + break; + } + } + } + + /* adjust *cvalue + * - fac is the ratio of how the current y-value corresponds to the reference range + * - thus, the new value is found by mapping the old range to the new! + */ + fac= (*cvalue - (env->midval + env->min)) / (env->max - env->min); + *cvalue= min + fac*(max - min); +} + +static FModifierTypeInfo FMI_ENVELOPE = { + FMODIFIER_TYPE_ENVELOPE, /* type */ + sizeof(FMod_Envelope), /* size */ + FMI_TYPE_REPLACE_VALUES, /* action type */ + 0, /* requirements */ + "Envelope", /* name */ + "FMod_Envelope", /* struct name */ + fcm_envelope_free, /* free data */ + fcm_envelope_copy, /* copy data */ + fcm_envelope_new_data, /* new data */ + fcm_envelope_verify, /* verify */ + NULL, /* evaluate time */ + fcm_envelope_evaluate /* evaluate */ +}; + +/* Cycles F-Curve Modifier --------------------------- */ + +/* This modifier changes evaltime to something that exists within the curve's frame-range, + * then re-evaluates modifier stack up to this point using the new time. This re-entrant behaviour + * is very likely to be more time-consuming than the original approach... (which was tighly integrated into + * the calculation code...). + * + * NOTE: this needs to be at the start of the stack to be of use, as it needs to know the extents of the keyframes/sample-data + * Possible TODO - store length of cycle information that can be initialised from the extents of the keyframes/sample-data, and adjusted + * as appropriate + */ + +/* temp data used during evaluation */ +typedef struct tFCMED_Cycles { + float cycyofs; /* y-offset to apply */ +} tFCMED_Cycles; + +static void fcm_cycles_new_data (void *mdata) +{ + FMod_Cycles *data= (FMod_Cycles *)mdata; + + /* turn on cycles by default */ + data->before_mode= data->after_mode= FCM_EXTRAPOLATE_CYCLIC; +} + +static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float cvalue, float evaltime) +{ + FMod_Cycles *data= (FMod_Cycles *)fcm->data; + float prevkey[2], lastkey[2], cycyofs=0.0f; + short side=0, mode=0; + int cycles=0; + + /* check if modifier is first in stack, otherwise disable ourself... */ + // FIXME... + if (fcm->prev) { + fcm->flag |= FMODIFIER_FLAG_DISABLED; + return evaltime; + } + + /* calculate new evaltime due to cyclic interpolation */ + if (fcu && fcu->bezt) { + BezTriple *prevbezt= fcu->bezt; + BezTriple *lastbezt= prevbezt + fcu->totvert-1; + + prevkey[0]= prevbezt->vec[1][0]; + prevkey[1]= prevbezt->vec[1][1]; + + lastkey[0]= lastbezt->vec[1][0]; + lastkey[1]= lastbezt->vec[1][1]; + } + else if (fcu && fcu->fpt) { + FPoint *prevfpt= fcu->fpt; + FPoint *lastfpt= prevfpt + fcu->totvert-1; + + prevkey[0]= prevfpt->vec[0]; + prevkey[1]= prevfpt->vec[1]; + + lastkey[0]= lastfpt->vec[0]; + lastkey[1]= lastfpt->vec[1]; + } + else + return evaltime; + + /* check if modifier will do anything + * 1) if in data range, definitely don't do anything + * 2) if before first frame or after last frame, make sure some cycling is in use + */ + if (evaltime < prevkey[0]) { + if (data->before_mode) { + side= -1; + mode= data->before_mode; + cycles= data->before_cycles; + } + } + else if (evaltime > lastkey[0]) { + if (data->after_mode) { + side= 1; + mode= data->after_mode; + cycles= data->after_cycles; + } + } + if ELEM(0, side, mode) + return evaltime; + + /* find relative place within a cycle */ + { + float cycdx=0, cycdy=0, ofs=0; + float cycle= 0; + + /* ofs is start frame of cycle */ + ofs= prevkey[0]; + + /* calculate period and amplitude (total height) of a cycle */ + cycdx= lastkey[0] - prevkey[0]; + cycdy= lastkey[1] - prevkey[1]; + + /* check if cycle is infinitely small, to be point of being impossible to use */ + if (cycdx == 0) + return evaltime; + + /* calculate the 'number' of the cycle */ + cycle= ((float)side * (evaltime - ofs) / cycdx); + + /* check that cyclic is still enabled for the specified time */ + if (cycles == 0) { + /* catch this case so that we don't exit when we have cycles=0 + * as this indicates infinite cycles... + */ + } + else if (cycle > (cycles+1)) { + /* we are too far away from range to evaluate + * TODO: but we should still hold last value... + */ + return evaltime; + } + + /* check if 'cyclic extrapolation', and thus calculate y-offset for this cycle */ + if (mode == FCM_EXTRAPOLATE_CYCLIC_OFFSET) { + cycyofs = (float)floor((evaltime - ofs) / cycdx); + cycyofs *= cycdy; + } + + /* calculate where in the cycle we are (overwrite evaltime to reflect this) */ + if ((mode == FCM_EXTRAPOLATE_MIRROR) && ((int)(cycle) % 2)) { + /* when 'mirror' option is used and cycle number is odd, this cycle is played in reverse + * - for 'before' extrapolation, we need to flip in a different way, otherwise values past + * then end of the curve get referenced (result of fmod will be negative, and with different phase) + */ + if (side < 0) + evaltime= (float)(prevkey[0] - fmod(evaltime-ofs, cycdx)); + else + evaltime= (float)(lastkey[0] - fmod(evaltime-ofs, cycdx)); + } + else { + /* the cycle is played normally... */ + evaltime= (float)(fmod(evaltime-ofs, cycdx) + ofs); + } + if (evaltime < ofs) evaltime += cycdx; + } + + /* store temp data if needed */ + if (mode == FCM_EXTRAPOLATE_CYCLIC_OFFSET) { + tFCMED_Cycles *edata; + + /* for now, this is just a float, but we could get more stuff... */ + fcm->edata= edata= MEM_callocN(sizeof(tFCMED_Cycles), "tFCMED_Cycles"); + edata->cycyofs= cycyofs; + } + + /* return the new frame to evaluate */ + return evaltime; +} + +static void fcm_cycles_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) +{ + tFCMED_Cycles *edata= (tFCMED_Cycles *)fcm->edata; + + /* use temp data */ + if (edata) { + /* add cyclic offset - no need to check for now, otherwise the data wouldn't exist! */ + *cvalue += edata->cycyofs; + + /* free temp data */ + MEM_freeN(edata); + fcm->edata= NULL; + } +} + +static FModifierTypeInfo FMI_CYCLES = { + FMODIFIER_TYPE_CYCLES, /* type */ + sizeof(FMod_Cycles), /* size */ + FMI_TYPE_EXTRAPOLATION, /* action type */ + FMI_REQUIRES_ORIGINAL_DATA, /* requirements */ + "Cycles", /* name */ + "FMod_Cycles", /* struct name */ + NULL, /* free data */ + NULL, /* copy data */ + fcm_cycles_new_data, /* new data */ + NULL /*fcm_cycles_verify*/, /* verify */ + fcm_cycles_time, /* evaluate time */ + fcm_cycles_evaluate /* evaluate */ +}; + +/* Noise F-Curve Modifier --------------------------- */ + +static void fcm_noise_new_data (void *mdata) +{ + FMod_Noise *data= (FMod_Noise *)mdata; + + /* defaults */ + data->size= 1.0f; + data->strength= 1.0f; + data->phase= 1.0f; + data->depth = 0; + data->modification = FCM_NOISE_MODIF_REPLACE; +} + +static void fcm_noise_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) +{ + FMod_Noise *data= (FMod_Noise *)fcm->data; + float noise; + + noise = BLI_turbulence(data->size, evaltime, data->phase, 0.f, data->depth); + + switch (data->modification) { + case FCM_NOISE_MODIF_ADD: + *cvalue= *cvalue + noise * data->strength; + break; + case FCM_NOISE_MODIF_SUBTRACT: + *cvalue= *cvalue - noise * data->strength; + break; + case FCM_NOISE_MODIF_MULTIPLY: + *cvalue= *cvalue * noise * data->strength; + break; + case FCM_NOISE_MODIF_REPLACE: + default: + *cvalue= *cvalue + (noise - 0.5f) * data->strength; + break; + } +} + +static FModifierTypeInfo FMI_NOISE = { + FMODIFIER_TYPE_NOISE, /* type */ + sizeof(FMod_Noise), /* size */ + FMI_TYPE_REPLACE_VALUES, /* action type */ + 0, /* requirements */ + "Noise", /* name */ + "FMod_Noise", /* struct name */ + NULL, /* free data */ + NULL, /* copy data */ + fcm_noise_new_data, /* new data */ + NULL /*fcm_noise_verify*/, /* verify */ + NULL, /* evaluate time */ + fcm_noise_evaluate /* evaluate */ +}; + +/* Filter F-Curve Modifier --------------------------- */ + +#if 0 // XXX not yet implemented +static FModifierTypeInfo FMI_FILTER = { + FMODIFIER_TYPE_FILTER, /* type */ + sizeof(FMod_Filter), /* size */ + FMI_TYPE_REPLACE_VALUES, /* action type */ + 0, /* requirements */ + "Filter", /* name */ + "FMod_Filter", /* struct name */ + NULL, /* free data */ + NULL, /* copy data */ + NULL, /* new data */ + NULL /*fcm_filter_verify*/, /* verify */ + NULL, /* evlauate time */ + fcm_filter_evaluate /* evaluate */ +}; +#endif // XXX not yet implemented + + +/* Python F-Curve Modifier --------------------------- */ + +static void fcm_python_free (FModifier *fcm) +{ + FMod_Python *data= (FMod_Python *)fcm->data; + + /* id-properties */ + IDP_FreeProperty(data->prop); + MEM_freeN(data->prop); +} + +static void fcm_python_new_data (void *mdata) +{ + FMod_Python *data= (FMod_Python *)mdata; + + /* everything should be set correctly by calloc, except for the prop->type constant.*/ + data->prop = MEM_callocN(sizeof(IDProperty), "PyFModifierProps"); + data->prop->type = IDP_GROUP; +} + +static void fcm_python_copy (FModifier *fcm, FModifier *src) +{ + FMod_Python *pymod = (FMod_Python *)fcm->data; + FMod_Python *opymod = (FMod_Python *)src->data; + + pymod->prop = IDP_CopyProperty(opymod->prop); +} + +static void fcm_python_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) +{ +#ifndef DISABLE_PYTHON + //FMod_Python *data= (FMod_Python *)fcm->data; + + /* FIXME... need to implement this modifier... + * It will need it execute a script using the custom properties + */ +#endif /* DISABLE_PYTHON */ +} + +static FModifierTypeInfo FMI_PYTHON = { + FMODIFIER_TYPE_PYTHON, /* type */ + sizeof(FMod_Python), /* size */ + FMI_TYPE_GENERATE_CURVE, /* action type */ + FMI_REQUIRES_RUNTIME_CHECK, /* requirements */ + "Python", /* name */ + "FMod_Python", /* struct name */ + fcm_python_free, /* free data */ + fcm_python_copy, /* copy data */ + fcm_python_new_data, /* new data */ + NULL /*fcm_python_verify*/, /* verify */ + NULL /*fcm_python_time*/, /* evaluate time */ + fcm_python_evaluate /* evaluate */ +}; + + +/* Limits F-Curve Modifier --------------------------- */ + +static float fcm_limits_time (FCurve *fcu, FModifier *fcm, float cvalue, float evaltime) +{ + FMod_Limits *data= (FMod_Limits *)fcm->data; + + /* check for the time limits */ + if ((data->flag & FCM_LIMIT_XMIN) && (evaltime < data->rect.xmin)) + return data->rect.xmin; + if ((data->flag & FCM_LIMIT_XMAX) && (evaltime > data->rect.xmax)) + return data->rect.xmax; + + /* modifier doesn't change time */ + return evaltime; +} + +static void fcm_limits_evaluate (FCurve *fcu, FModifier *fcm, float *cvalue, float evaltime) +{ + FMod_Limits *data= (FMod_Limits *)fcm->data; + + /* value limits now */ + if ((data->flag & FCM_LIMIT_YMIN) && (*cvalue < data->rect.ymin)) + *cvalue= data->rect.ymin; + if ((data->flag & FCM_LIMIT_YMAX) && (*cvalue > data->rect.ymax)) + *cvalue= data->rect.ymax; +} + +static FModifierTypeInfo FMI_LIMITS = { + FMODIFIER_TYPE_LIMITS, /* type */ + sizeof(FMod_Limits), /* size */ + FMI_TYPE_GENERATE_CURVE, /* action type */ /* XXX... err... */ + FMI_REQUIRES_RUNTIME_CHECK, /* requirements */ + "Limits", /* name */ + "FMod_Limits", /* struct name */ + NULL, /* free data */ + NULL, /* copy data */ + NULL, /* new data */ + NULL, /* verify */ + fcm_limits_time, /* evaluate time */ + fcm_limits_evaluate /* evaluate */ +}; + +/* F-Curve Modifier API --------------------------- */ +/* All of the F-Curve Modifier api functions use FModifierTypeInfo structs to carry out + * and operations that involve F-Curve modifier specific code. + */ + +/* These globals only ever get directly accessed in this file */ +static FModifierTypeInfo *fmodifiersTypeInfo[FMODIFIER_NUM_TYPES]; +static short FMI_INIT= 1; /* when non-zero, the list needs to be updated */ + +/* This function only gets called when FMI_INIT is non-zero */ +static void fmods_init_typeinfo () +{ + fmodifiersTypeInfo[0]= NULL; /* 'Null' F-Curve Modifier */ + fmodifiersTypeInfo[1]= &FMI_GENERATOR; /* Generator F-Curve Modifier */ + fmodifiersTypeInfo[2]= &FMI_FN_GENERATOR; /* Built-In Function Generator F-Curve Modifier */ + fmodifiersTypeInfo[3]= &FMI_ENVELOPE; /* Envelope F-Curve Modifier */ + fmodifiersTypeInfo[4]= &FMI_CYCLES; /* Cycles F-Curve Modifier */ + fmodifiersTypeInfo[5]= &FMI_NOISE; /* Apply-Noise F-Curve Modifier */ + fmodifiersTypeInfo[6]= NULL/*&FMI_FILTER*/; /* Filter F-Curve Modifier */ // XXX unimplemented + fmodifiersTypeInfo[7]= &FMI_PYTHON; /* Custom Python F-Curve Modifier */ + fmodifiersTypeInfo[8]= &FMI_LIMITS; /* Limits F-Curve Modifier */ +} + +/* This function should be used for getting the appropriate type-info when only + * a F-Curve modifier type is known + */ +FModifierTypeInfo *get_fmodifier_typeinfo (int type) +{ + /* initialise the type-info list? */ + if (FMI_INIT) { + fmods_init_typeinfo(); + FMI_INIT = 0; + } + + /* only return for valid types */ + if ( (type >= FMODIFIER_TYPE_NULL) && + (type <= FMODIFIER_NUM_TYPES ) ) + { + /* there shouldn't be any segfaults here... */ + return fmodifiersTypeInfo[type]; + } + else { + printf("No valid F-Curve Modifier type-info data available. Type = %i \n", type); + } + + return NULL; +} + +/* This function should always be used to get the appropriate type-info, as it + * has checks which prevent segfaults in some weird cases. + */ +FModifierTypeInfo *fmodifier_get_typeinfo (FModifier *fcm) +{ + /* only return typeinfo for valid modifiers */ + if (fcm) + return get_fmodifier_typeinfo(fcm->type); + else + return NULL; +} + +/* API --------------------------- */ + +/* Add a new F-Curve Modifier to the given F-Curve of a certain type */ +FModifier *add_fmodifier (ListBase *modifiers, int type) +{ + FModifierTypeInfo *fmi= get_fmodifier_typeinfo(type); + FModifier *fcm; + + /* sanity checks */ + if ELEM(NULL, modifiers, fmi) + return NULL; + + /* special checks for whether modifier can be added */ + if ((modifiers->first) && (type == FMODIFIER_TYPE_CYCLES)) { + /* cycles modifier must be first in stack, so for now, don't add if it can't be */ + // TODO: perhaps there is some better way, but for now, + printf("Error: Cannot add 'Cycles' modifier to F-Curve, as 'Cycles' modifier can only be first in stack. \n"); + return NULL; + } + + /* add modifier itself */ + fcm= MEM_callocN(sizeof(FModifier), "F-Curve Modifier"); + fcm->type = type; + fcm->flag = FMODIFIER_FLAG_EXPANDED; + BLI_addtail(modifiers, fcm); + + /* add modifier's data */ + fcm->data= MEM_callocN(fmi->size, fmi->structName); + + /* init custom settings if necessary */ + if (fmi->new_data) + fmi->new_data(fcm->data); + + /* return modifier for further editing */ + return fcm; +} + +/* Duplicate all of the F-Modifiers in the Modifier stacks */ +void copy_fmodifiers (ListBase *dst, ListBase *src) +{ + FModifier *fcm, *srcfcm; + + if ELEM(NULL, dst, src) + return; + + dst->first= dst->last= NULL; + BLI_duplicatelist(dst, src); + + for (fcm=dst->first, srcfcm=src->first; fcm && srcfcm; srcfcm=srcfcm->next, fcm=fcm->next) { + FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); + + /* make a new copy of the F-Modifier's data */ + fcm->data = MEM_dupallocN(fcm->data); + + /* only do specific constraints if required */ + if (fmi && fmi->copy_data) + fmi->copy_data(fcm, srcfcm); + } +} + +/* Remove and free the given F-Modifier from the given stack */ +void remove_fmodifier (ListBase *modifiers, FModifier *fcm) +{ + FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); + + /* sanity check */ + if (fcm == NULL) + return; + + /* free modifier's special data (stored inside fcm->data) */ + if (fcm->data) { + if (fmi && fmi->free_data) + fmi->free_data(fcm); + + /* free modifier's data (fcm->data) */ + MEM_freeN(fcm->data); + } + + /* remove modifier from stack */ + if (modifiers) + BLI_freelinkN(modifiers, fcm); + else { + // XXX this case can probably be removed some day, as it shouldn't happen... + printf("remove_fmodifier() - no modifier stack given \n"); + MEM_freeN(fcm); + } +} + +/* Remove all of a given F-Curve's modifiers */ +void free_fmodifiers (ListBase *modifiers) +{ + FModifier *fcm, *fmn; + + /* sanity check */ + if (modifiers == NULL) + return; + + /* free each modifier in order - modifier is unlinked from list and freed */ + for (fcm= modifiers->first; fcm; fcm= fmn) { + fmn= fcm->next; + remove_fmodifier(modifiers, fcm); + } +} + +/* Find the active F-Modifier */ +FModifier *find_active_fmodifier (ListBase *modifiers) +{ + FModifier *fcm; + + /* sanity checks */ + if ELEM(NULL, modifiers, modifiers->first) + return NULL; + + /* loop over modifiers until 'active' one is found */ + for (fcm= modifiers->first; fcm; fcm= fcm->next) { + if (fcm->flag & FMODIFIER_FLAG_ACTIVE) + return fcm; + } + + /* no modifier is active */ + return NULL; +} + +/* Set the active F-Modifier */ +void set_active_fmodifier (ListBase *modifiers, FModifier *fcm) +{ + FModifier *fm; + + /* sanity checks */ + if ELEM(NULL, modifiers, modifiers->first) + return; + + /* deactivate all, and set current one active */ + for (fm= modifiers->first; fm; fm= fm->next) + fm->flag &= ~FMODIFIER_FLAG_ACTIVE; + + /* make given modifier active */ + if (fcm) + fcm->flag |= FMODIFIER_FLAG_ACTIVE; +} + +/* Do we have any modifiers which match certain criteria + * - mtype - type of modifier (if 0, doesn't matter) + * - acttype - type of action to perform (if -1, doesn't matter) + */ +short list_has_suitable_fmodifier (ListBase *modifiers, int mtype, short acttype) +{ + FModifier *fcm; + + /* if there are no specific filtering criteria, just skip */ + if ((mtype == 0) && (acttype == 0)) + return (modifiers && modifiers->first); + + /* sanity checks */ + if ELEM(NULL, modifiers, modifiers->first) + return 0; + + /* find the first mdifier fitting these criteria */ + for (fcm= modifiers->first; fcm; fcm= fcm->next) { + FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); + short mOk=1, aOk=1; /* by default 1, so that when only one test, won't fail */ + + /* check if applicable ones are fullfilled */ + if (mtype) + mOk= (fcm->type == mtype); + if (acttype > -1) + aOk= (fmi->acttype == acttype); + + /* if both are ok, we've found a hit */ + if (mOk && aOk) + return 1; + } + + /* no matches */ + return 0; +} + +/* Evaluation API --------------------------- */ + +/* evaluate time modifications imposed by some F-Curve Modifiers + * - this step acts as an optimisation to prevent the F-Curve stack being evaluated + * several times by modifiers requesting the time be modified, as the final result + * would have required using the modified time + * - modifiers only ever recieve the unmodified time, as subsequent modifiers should be + * working on the 'global' result of the modified curve, not some localised segment, + * so nevaltime gets set to whatever the last time-modifying modifier likes... + * - we start from the end of the stack, as only the last one matters for now + */ +float evaluate_time_fmodifiers (ListBase *modifiers, FCurve *fcu, float cvalue, float evaltime) +{ + FModifier *fcm; + float m_evaltime= evaltime; + + /* sanity checks */ + if ELEM(NULL, modifiers, modifiers->last) + return evaltime; + + /* find the first modifier from end of stack that modifies time, and calculate the time the modifier + * would calculate time at + */ + for (fcm= modifiers->last; fcm; fcm= fcm->prev) { + FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); + + /* only evaluate if there's a callback for this */ + // TODO: implement the 'influence' control feature... + if (fmi && fmi->evaluate_modifier_time) { + if ((fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) == 0) + m_evaltime= fmi->evaluate_modifier_time(fcu, fcm, cvalue, evaltime); + break; + } + } + + /* return the modified evaltime */ + return m_evaltime; +} + +/* Evalautes the given set of F-Curve Modifiers using the given data + * Should only be called after evaluate_time_fmodifiers() has been called... + */ +void evaluate_value_fmodifiers (ListBase *modifiers, FCurve *fcu, float *cvalue, float evaltime) +{ + FModifier *fcm; + + /* sanity checks */ + if ELEM(NULL, modifiers, modifiers->first) + return; + + /* evaluate modifiers */ + for (fcm= modifiers->first; fcm; fcm= fcm->next) { + FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); + + /* only evaluate if there's a callback for this */ + // TODO: implement the 'influence' control feature... + if (fmi && fmi->evaluate_modifier) { + if ((fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) == 0) + fmi->evaluate_modifier(fcu, fcm, cvalue, evaltime); + } + } +} + +/* ---------- */ + +/* Bake modifiers for given F-Curve to curve sample data, in the frame range defined + * by start and end (inclusive). + */ +void fcurve_bake_modifiers (FCurve *fcu, int start, int end) +{ + ChannelDriver *driver; + + /* sanity checks */ + // TODO: make these tests report errors using reports not printf's + if ELEM(NULL, fcu, fcu->modifiers.first) { + printf("Error: No F-Curve with F-Curve Modifiers to Bake\n"); + return; + } + + /* temporarily, disable driver while we sample, so that they don't influence the outcome */ + driver= fcu->driver; + fcu->driver= NULL; + + /* bake the modifiers, by sampling the curve at each frame */ + fcurve_store_samples(fcu, NULL, start, end, fcurve_samplingcb_evalcurve); + + /* free the modifiers now */ + free_fmodifiers(&fcu->modifiers); + + /* restore driver */ + fcu->driver= driver; +} diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 968a0e68fb9..c3c5483574e 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1153,7 +1153,7 @@ static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, cha /* Add a new FModifier (Cyclic) instead of setting extend value * as that's the new equivilant of that option. */ - FModifier *fcm= fcurve_add_modifier(fcu, FMODIFIER_TYPE_CYCLES); + FModifier *fcm= add_fmodifier(&fcu->modifiers, FMODIFIER_TYPE_CYCLES); FMod_Cycles *data= (FMod_Cycles *)fcm->data; /* if 'offset' one is in use, set appropriate settings */ diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 2b95584dc25..14e658b3903 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -69,8 +69,6 @@ // TODO: with things like transitions, should these get freed too? Maybe better as a UI tool void free_nlastrip (ListBase *strips, NlaStrip *strip) { - FModifier *fcm, *fmn; - /* sanity checks */ if (strip == NULL) return; @@ -86,13 +84,8 @@ void free_nlastrip (ListBase *strips, NlaStrip *strip) /* free own F-Curves */ free_fcurves(&strip->fcurves); - /* free F-Modifiers */ - for (fcm= strip->modifiers.first; fcm; fcm= fmn) { - fmn= fcm->next; - - BLI_remlink(&strip->modifiers, fcm); - fcurve_remove_modifier(NULL, fcm); - } + /* free own F-Modifiers */ + free_fmodifiers(&strip->modifiers); /* free the strip itself */ if (strips) @@ -167,7 +160,7 @@ NlaStrip *copy_nlastrip (NlaStrip *strip) /* copy F-Curves and modifiers */ copy_fcurves(&strip_d->fcurves, &strip->fcurves); - fcurve_copy_modifiers(&strip_d->modifiers, &strip->modifiers); + copy_fmodifiers(&strip_d->modifiers, &strip->modifiers); /* return the strip */ return strip_d; diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 9c401289011..fdce0965ce3 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -1,5 +1,30 @@ -/* Testing code for 2.5 animation system - * Copyright 2009, Joshua Leung +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation, Joshua Leung + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Joshua Leung (full recode) + * + * ***** END GPL LICENSE BLOCK ***** */ #include @@ -94,7 +119,7 @@ FCurve *verify_driver_fcurve (ID *id, const char rna_path[], const int array_ind fcu->driver= MEM_callocN(sizeof(ChannelDriver), "ChannelDriver"); /* add simple generator modifier for driver so that there is some visible representation */ - fcurve_add_modifier(fcu, FMODIFIER_TYPE_GENERATOR); + add_fmodifier(&fcu->modifiers, FMODIFIER_TYPE_GENERATOR); /* just add F-Curve to end of driver list */ BLI_addtail(&adt->drivers, fcu); diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 5968817a9a6..b5a99877247 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -112,23 +112,23 @@ static void validate_fmodifier_cb (bContext *C, void *fcm_v, void *dummy) } /* callback to set the active modifier */ -static void activate_fmodifier_cb (bContext *C, void *fcu_v, void *fcm_v) +static void activate_fmodifier_cb (bContext *C, void *fmods_v, void *fcm_v) { - FCurve *fcu= (FCurve *)fcu_v; + ListBase *modifiers = (ListBase *)fmods_v; FModifier *fcm= (FModifier *)fcm_v; - /* call API function to set the active modifier for active F-Curve */ - fcurve_set_active_modifier(fcu, fcm); + /* call API function to set the active modifier for active modifier-stack */ + set_active_fmodifier(modifiers, fcm); } /* callback to remove the given modifier */ -static void delete_fmodifier_cb (bContext *C, void *fcu_v, void *fcm_v) +static void delete_fmodifier_cb (bContext *C, void *fmods_v, void *fcm_v) { - FCurve *fcu= (FCurve *)fcu_v; + ListBase *modifiers = (ListBase *)fmods_v; FModifier *fcm= (FModifier *)fcm_v; - /* remove the given F-Modifier from the F-Curve */ - fcurve_remove_modifier(fcu, fcm); + /* remove the given F-Modifier from the active modifier-stack */ + remove_fmodifier(modifiers, fcm); } /* --------------- */ @@ -588,6 +588,7 @@ static void draw_modifier__limits(uiBlock *block, FModifier *fcm, int *yco, shor void ANIM_uiTemplate_fmodifier_draw (uiBlock *block, FCurve *fcu, FModifier *fcm, int *yco) { FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); + ListBase *modifiers= &fcu->modifiers; // XXX fixme... should be arg uiBut *but; short active= (fcm->flag & FMODIFIER_FLAG_ACTIVE); short width= 314; @@ -607,7 +608,7 @@ void ANIM_uiTemplate_fmodifier_draw (uiBlock *block, FCurve *fcu, FModifier *fcm /* checkbox for 'active' status (for now) */ but= uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_ACTIVE, B_REDR, ICON_RADIOBUT_OFF, 25, *yco-1, 20, 20, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is active one."); - uiButSetFunc(but, activate_fmodifier_cb, fcu, fcm); + uiButSetFunc(but, activate_fmodifier_cb, modifiers, fcm); /* name */ if (fmi) @@ -620,7 +621,7 @@ void ANIM_uiTemplate_fmodifier_draw (uiBlock *block, FCurve *fcu, FModifier *fcm /* delete button */ but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 10+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete F-Curve Modifier."); - uiButSetFunc(but, delete_fmodifier_cb, fcu, fcm); + uiButSetFunc(but, delete_fmodifier_cb, modifiers, fcm); uiBlockSetEmboss(block, UI_EMBOSS); } diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 90804052370..331e2d0894e 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1,5 +1,30 @@ -/* Testing code for 2.5 animation system - * Copyright 2009, Joshua Leung +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation, Joshua Leung + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Joshua Leung (full recode) + * + * ***** END GPL LICENSE BLOCK ***** */ #include diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 1813c76d0c4..240089d26a6 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -1,5 +1,30 @@ -/* Testing code for 2.5 animation system - * Copyright 2009, Joshua Leung +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation, Joshua Leung + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Joshua Leung (full recode) + * + * ***** END GPL LICENSE BLOCK ***** */ #include diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 66168f2ed87..0d7dafe2938 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -795,7 +795,7 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri */ for (ale=anim_data.first; ale; ale=ale->next) { FCurve *fcu= (FCurve *)ale->key_data; - FModifier *fcm= fcurve_find_active_modifier(fcu); + FModifier *fcm= find_active_fmodifier(&fcu->modifiers); AnimData *adt= ANIM_nla_mapping_get(ac, ale); /* map keyframes for drawing if scaled F-Curve */ diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index ca47e69cc75..a82699ac1e5 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1769,9 +1769,9 @@ static int graph_fmodifier_add_exec(bContext *C, wmOperator *op) type= RNA_enum_get(op->ptr, "type"); /* add F-Modifier of specified type to active F-Curve, and make it the active one */ - fcm= fcurve_add_modifier(fcu, type); + fcm= add_fmodifier(&fcu->modifiers, type); if (fcm) - fcurve_set_active_modifier(fcu, fcm); + set_active_fmodifier(&fcu->modifiers, fcm); else { BKE_report(op->reports, RPT_ERROR, "Modifier couldn't be added. See console for details."); return OPERATOR_CANCELLED; diff --git a/source/blender/editors/space_graph/graph_utils.c b/source/blender/editors/space_graph/graph_utils.c index b1ec795a089..f00e7845549 100644 --- a/source/blender/editors/space_graph/graph_utils.c +++ b/source/blender/editors/space_graph/graph_utils.c @@ -194,7 +194,7 @@ int graphop_visible_keyframes_poll (bContext *C) */ if (fcu->bezt == NULL) continue; - fcm= fcurve_find_active_modifier(fcu); + fcm= find_active_fmodifier(&fcu->modifiers); found= (fcurve_needs_draw_fmodifier_controls(fcu, fcm) == 0); if (found) break; @@ -244,7 +244,7 @@ int graphop_editable_keyframes_poll (bContext *C) */ if (fcu->bezt == NULL) continue; - fcm= fcurve_find_active_modifier(fcu); + fcm= find_active_fmodifier(&fcu->modifiers); found= (fcurve_needs_draw_fmodifier_controls(fcu, fcm) == 0); if (found) break; -- cgit v1.2.3 From 6b784a80f02deaca05e347dc2626dc92826f0944 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 2 Jul 2009 06:41:10 +0000 Subject: NLA SoC: F-Modifiers working on NLA Strips * Using the Ctrl-Shift-M hotkey, F-Modifiers can be added to all the selected strips. * F-Modifiers can also be added/tweaked from the NLA N-Key properties. The UI now uses the same code as for the graph editor ones. The UI drawing here is currently messed up from the NLA side, since it seems combining normal layout stuff and old-style uiBlocks doesn't seem to work too well (BUT! the buttons are at least functional). Next up, I'll need to recode the buttons panel for the Graph Editor so that all of the drawing can be migrated over to use the new layout engine. --- source/blender/editors/animation/fmodifier_ui.c | 3 +- source/blender/editors/include/ED_anim_api.h | 4 +- source/blender/editors/space_graph/graph_buttons.c | 2 +- source/blender/editors/space_graph/graph_edit.c | 2 +- source/blender/editors/space_graph/graph_ops.c | 3 +- source/blender/editors/space_nla/nla_buttons.c | 16 ++++- source/blender/editors/space_nla/nla_edit.c | 81 ++++++++++++++++++++++ source/blender/editors/space_nla/nla_intern.h | 2 + source/blender/editors/space_nla/nla_ops.c | 5 ++ 9 files changed, 107 insertions(+), 11 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index b5a99877247..dfac380f595 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -585,10 +585,9 @@ static void draw_modifier__limits(uiBlock *block, FModifier *fcm, int *yco, shor /* --------------- */ // FIXME: remove dependency for F-Curve -void ANIM_uiTemplate_fmodifier_draw (uiBlock *block, FCurve *fcu, FModifier *fcm, int *yco) +void ANIM_uiTemplate_fmodifier_draw (uiBlock *block, ListBase *modifiers, FModifier *fcm, int *yco) { FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); - ListBase *modifiers= &fcu->modifiers; // XXX fixme... should be arg uiBut *but; short active= (fcm->flag & FMODIFIER_FLAG_ACTIVE); short width= 314; diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 4d75a73a327..87f05c8a76a 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -41,7 +41,7 @@ struct gla2DDrawInfo; struct Object; struct bActionGroup; struct FCurve; -struct IpoCurve; // xxx +struct FModifier; /* ************************************************ */ /* ANIMATION CHANNEL FILTERING */ @@ -300,7 +300,7 @@ struct uiBlock; /* draw a given F-Modifier for some layout/UI-Block */ // XXX not quite complete yet -void ANIM_uiTemplate_fmodifier_draw(struct uiBlock *block, struct FCurve *fcu, struct FModifier *fcm, int *yco); +void ANIM_uiTemplate_fmodifier_draw(struct uiBlock *block, ListBase *modifiers, struct FModifier *fcm, int *yco); /* ************************************************* */ /* ASSORTED TOOLS */ diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 9d4a1a8b3cb..5616ffc8002 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -381,7 +381,7 @@ static void graph_panel_modifiers(const bContext *C, Panel *pa) /* draw each modifier */ for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) - ANIM_uiTemplate_fmodifier_draw(block, fcu, fcm, &yco); + ANIM_uiTemplate_fmodifier_draw(block, &fcu->modifiers, fcm, &yco); MEM_freeN(ale); } diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index a82699ac1e5..9a50c5cc203 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1741,7 +1741,7 @@ void GRAPH_OT_smooth (wmOperatorType *ot) /* ************************************************************************** */ /* F-CURVE MODIFIERS */ -/* ******************** Add F-Curve Modifier Operator *********************** */ +/* ******************** Add F-Modifier Operator *********************** */ static int graph_fmodifier_add_exec(bContext *C, wmOperator *op) { diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index d5e93dafaf0..38bde61a46c 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -221,8 +221,7 @@ static void graphedit_keymap_keyframes (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "GRAPH_OT_previewrange_set", PKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); WM_keymap_add_item(keymap, "GRAPH_OT_view_all", HOMEKEY, KM_PRESS, 0, 0); - /* F-Curve Modifiers */ - // XXX these are temporary? operators... + /* F-Modifiers */ WM_keymap_add_item(keymap, "GRAPH_OT_fmodifier_add", MKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 003eba64ed9..1ef72760bfc 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -309,18 +309,28 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa) static void nla_panel_modifiers(const bContext *C, Panel *pa) { PointerRNA strip_ptr; + NlaStrip *strip; + FModifier *fcm; uiLayout *layout= pa->layout; - //uiLayout *column, *row, *subcol; uiBlock *block; + int yco = 190; // xxx old /* check context and also validity of pointer */ if (!nla_panel_context(C, NULL, &strip_ptr)) return; + strip= strip_ptr.data; block= uiLayoutGetBlock(layout); uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); - - // TODO... + + /* 'add modifier' button at top of panel */ + // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator + // FIXME: we need to set the only-active property so that this will only add modifiers for the active strip (not all selected) + uiDefButO(block, BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, "Add Modifier", 10, 225, 150, 20, "Adds a new F-Modifier for the active NLA Strip"); + + /* draw each modifier */ + for (fcm= strip->modifiers.first; fcm; fcm= fcm->next) + ANIM_uiTemplate_fmodifier_draw(block, &strip->modifiers, fcm, &yco); } /* ******************* general ******************************** */ diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 6d82e3d4be2..9910e62b262 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -66,6 +66,7 @@ #include "RNA_access.h" #include "RNA_define.h" +#include "RNA_enum_types.h" #include "WM_api.h" #include "WM_types.h" @@ -1021,3 +1022,83 @@ void NLA_OT_clear_scale (wmOperatorType *ot) } /* *********************************************** */ +/* NLA Modifiers */ + +/* ******************** Add F-Modifier Operator *********************** */ + +static int nla_fmodifier_add_exec(bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + FModifier *fcm; + int type= RNA_enum_get(op->ptr, "type"); + short onlyActive = RNA_boolean_get(op->ptr, "only_active"); + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the editable tracks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* for each NLA-Track, add the specified modifier to all selected strips */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip; + int i = 1; + + for (strip= nlt->strips.first; strip; strip=strip->next, i++) { + /* only add F-Modifier if on active strip? */ + if ((onlyActive) && (strip->flag & NLASTRIP_FLAG_ACTIVE)==0) + continue; + + /* add F-Modifier of specified type to selected, and make it the active one */ + fcm= add_fmodifier(&strip->modifiers, type); + + if (fcm) + set_active_fmodifier(&strip->modifiers, fcm); + else { + char errormsg[128]; + sprintf(errormsg, "Modifier couldn't be added to (%s : %d). See console for details.", nlt->name, i); + + BKE_report(op->reports, RPT_ERROR, errormsg); + } + } + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done */ + return OPERATOR_FINISHED; +} + +void NLA_OT_fmodifier_add (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add F-Modifier"; + ot->idname= "NLA_OT_fmodifier_add"; + + /* api callbacks */ + ot->invoke= WM_menu_invoke; + ot->exec= nla_fmodifier_add_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* id-props */ + RNA_def_enum(ot->srna, "type", fmodifier_type_items, 0, "Type", ""); + RNA_def_boolean(ot->srna, "only_active", 0, "Only Active", "Only add F-Modifier of the specified type to the active strip."); +} + +/* *********************************************** */ diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index f8df41d6225..5921b8a75ce 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -105,6 +105,8 @@ void NLA_OT_move_down(wmOperatorType *ot); void NLA_OT_apply_scale(wmOperatorType *ot); void NLA_OT_clear_scale(wmOperatorType *ot); +void NLA_OT_fmodifier_add(wmOperatorType *ot); + /* **************************************** */ /* nla_channels.c */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index d7bd894ce4d..7caab02d6a0 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -155,6 +155,8 @@ void nla_operatortypes(void) WM_operatortype_append(NLA_OT_apply_scale); WM_operatortype_append(NLA_OT_clear_scale); + + WM_operatortype_append(NLA_OT_fmodifier_add); } /* ************************** registration - keymaps **********************************/ @@ -255,6 +257,9 @@ static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) /* clear scale */ WM_keymap_add_item(keymap, "NLA_OT_clear_scale", SKEY, KM_PRESS, KM_ALT, 0); + /* add f-modifier */ + WM_keymap_add_item(keymap, "NLA_OT_fmodifier_add", MKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); + /* transform system */ transform_keymap_for_space(wm, keymap, SPACE_NLA); } -- cgit v1.2.3 From c7bd0d12484d7abf18f74c2ed8405ad6f5888d99 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 2 Jul 2009 11:23:19 +0000 Subject: 2.5 More toolbar functionality for workflow review. - Split the region in two parts, bottom has the Tool Properties, the top part shows 2 panels, one for python defined tools, other for a "tool shelf" which (later) will get saved in files. - Added a full context driven framework for this toolbar, showing the tools depending on 3D window 'mode'. Both python defined tools as the shelf respect this. So - for example - you will see different tools in editmode mesh, as in vertex paint mode, etc. - First template for the python tools will be committed after this commit; it has placeholder tools to just show/test functioning. NOTE: if you had saved a layout that shows tools region, open/close it once to get the new region created for properties. TODO: - Moving paint properties to tool settings - Test a layout with horizontal toolbar (without properties) - Bring back floating panels, and put tool-properties here. (as option) --- source/blender/blenkernel/BKE_screen.h | 5 +- source/blender/blenkernel/intern/screen.c | 2 + .../blender/editors/interface/interface_widgets.c | 12 +-- source/blender/editors/screen/area.c | 1 + source/blender/editors/space_view3d/space_view3d.c | 70 +++++++++++----- .../blender/editors/space_view3d/view3d_intern.h | 4 +- .../blender/editors/space_view3d/view3d_toolbar.c | 98 ++++++++++++++-------- source/blender/makesdna/DNA_screen_types.h | 1 + source/blender/makesrna/intern/rna_screen.c | 1 + 9 files changed, 134 insertions(+), 60 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h index 750f4fba7e6..be625fb856a 100644 --- a/source/blender/blenkernel/BKE_screen.h +++ b/source/blender/blenkernel/BKE_screen.h @@ -91,6 +91,9 @@ typedef struct SpaceType { /* region type definitions */ ListBase regiontypes; + /* tool shelf definitions */ + ListBase toolshelf; + /* read and write... */ /* default keymaps to add */ @@ -139,7 +142,7 @@ typedef struct ARegionType { /* menu type definitions */ ListBase menutypes; - + /* hardcoded constraints, smaller than these values region is not visible */ int minsizex, minsizey; /* default keymaps to add */ diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c index e25e4be90c8..4b6eddf60d0 100644 --- a/source/blender/blenkernel/intern/screen.c +++ b/source/blender/blenkernel/intern/screen.c @@ -78,6 +78,8 @@ static void spacetype_free(SpaceType *st) } BLI_freelistN(&st->regiontypes); + BLI_freelistN(&st->toolshelf); + } void BKE_spacetypes_free(void) diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index ed2d00cb00d..7a4ceec9593 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -293,13 +293,15 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, fl float maxyi= maxy - 1.0f; float facxi= 1.0f/(maxxi-minxi); /* for uv */ float facyi= 1.0f/(maxyi-minyi); - int a, tot= 0; + int a, tot= 0, minsize; - if(2.0f*rad > rect->ymax-rect->ymin) - rad= 0.5f*(rect->ymax-rect->ymin); + minsize= MIN2(rect->xmax-rect->xmin, rect->ymax-rect->ymin); + + if(2.0f*rad > minsize) + rad= 0.5f*minsize; - if(2.0f*(radi+1.0f) > rect->ymax-rect->ymin) - radi= 0.5f*(rect->ymax-rect->ymin) - 1.0f; + if(2.0f*(radi+1.0f) > minsize) + radi= 0.5f*minsize - 1.0f; /* mult */ for(a=0; a<9; a++) { diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 535e99ccfef..dd8efd68604 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -261,6 +261,7 @@ static void region_scissor_winrct(ARegion *ar, rcti *winrct) if(BLI_isect_rcti(winrct, &ar->winrct, NULL)) { if(ar->flag & RGN_FLAG_HIDDEN); + else if(ar->alignment & RGN_SPLIT_PREV); else if(ar->alignment==RGN_OVERLAP_LEFT) { winrct->xmin= ar->winrct.xmax + 1; } diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 625b1838951..1ea69d595d3 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -97,29 +97,45 @@ ARegion *view3d_has_buttons_region(ScrArea *sa) ARegion *view3d_has_tools_region(ScrArea *sa) { - ARegion *ar, *arnew; + ARegion *ar, *artool=NULL, *arprops=NULL, *arhead; - for(ar= sa->regionbase.first; ar; ar= ar->next) + for(ar= sa->regionbase.first; ar; ar= ar->next) { if(ar->regiontype==RGN_TYPE_TOOLS) - return ar; - - /* add subdiv level; after header */ - for(ar= sa->regionbase.first; ar; ar= ar->next) - if(ar->regiontype==RGN_TYPE_HEADER) - break; - - /* is error! */ - if(ar==NULL) return NULL; - - arnew= MEM_callocN(sizeof(ARegion), "tools for view3d"); + artool= ar; + if(ar->regiontype==RGN_TYPE_TOOL_PROPS) + arprops= ar; + } - BLI_insertlinkafter(&sa->regionbase, ar, arnew); - arnew->regiontype= RGN_TYPE_TOOLS; - arnew->alignment= RGN_OVERLAP_LEFT; + /* tool region hide/unhide also hides props */ + if(arprops && artool) return artool; - arnew->flag = RGN_FLAG_HIDDEN; + if(artool==NULL) { + /* add subdiv level; after header */ + for(arhead= sa->regionbase.first; arhead; arhead= arhead->next) + if(arhead->regiontype==RGN_TYPE_HEADER) + break; + + /* is error! */ + if(arhead==NULL) return NULL; + + artool= MEM_callocN(sizeof(ARegion), "tools for view3d"); + + BLI_insertlinkafter(&sa->regionbase, arhead, artool); + artool->regiontype= RGN_TYPE_TOOLS; + artool->alignment= RGN_OVERLAP_LEFT; + artool->flag = RGN_FLAG_HIDDEN; + } + + if(arprops==NULL) { + /* add extra subdivided region for tool properties */ + arprops= MEM_callocN(sizeof(ARegion), "tool props for view3d"); + + BLI_insertlinkafter(&sa->regionbase, artool, arprops); + arprops->regiontype= RGN_TYPE_TOOL_PROPS; + arprops->alignment= RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV; + } - return arnew; + return artool; } /* ****************************************************** */ @@ -559,9 +575,11 @@ static void view3d_tools_area_init(wmWindowManager *wm, ARegion *ar) WM_event_add_keymap_handler(&ar->handlers, keymap); } + + static void view3d_tools_area_draw(const bContext *C, ARegion *ar) { - ED_region_panels(C, ar, 1, NULL); + ED_region_panels(C, ar, 1, view3d_context_string(C)); } /* @@ -860,6 +878,20 @@ void ED_spacetype_view3d(void) BLI_addhead(&st->regiontypes, art); view3d_toolbar_register(art); + + /* regions: tool properties */ + art= MEM_callocN(sizeof(ARegionType), "spacetype view3d region"); + art->regionid = RGN_TYPE_TOOL_PROPS; + art->minsizex= 0; + art->minsizey= 120; + art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES; + art->listener= view3d_buttons_area_listener; + art->init= view3d_tools_area_init; + art->draw= view3d_tools_area_draw; + BLI_addhead(&st->regiontypes, art); + + view3d_tool_props_register(art); + /* regions: header */ art= MEM_callocN(sizeof(ARegionType), "spacetype view3d region"); diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 6dbd99c67be..65040b4238f 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -136,9 +136,11 @@ void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d); void VIEW3D_OT_properties(struct wmOperatorType *ot); void view3d_buttons_register(struct ARegionType *art); -/* view3d_buttons.c */ +/* view3d_toolbar.c */ void VIEW3D_OT_toolbar(struct wmOperatorType *ot); void view3d_toolbar_register(struct ARegionType *art); +void view3d_tool_props_register(struct ARegionType *art); +char *view3d_context_string(const struct bContext *C); /* view3d_snap.c */ int minmax_verts(Object *obedit, float *min, float *max); diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index ea365d59ac7..8aba8e11d43 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -150,9 +150,46 @@ static void view3d_panel_operator_redo(const bContext *C, Panel *pa) /* ******************* */ +char *view3d_context_string(const bContext *C) +{ + Object *obedit= CTX_data_edit_object(C); + + if(obedit) { + switch(obedit->type) { + case OB_MESH: + return "editmode_mesh"; + case OB_CURVE: + return "editmode_curve"; + case OB_SURF: + return "editmode_surface"; + case OB_FONT: + return "editmode_text"; + case OB_ARMATURE: + return "editmode_armature"; + case OB_MBALL: + return "editmode_mball"; + case OB_LATTICE: + return "editmode_lattice"; + } + } + else { + Object *ob = CTX_data_active_object(C); + + if(ob && (ob->flag & OB_POSEMODE)) return "posemode"; + else if (G.f & G_SCULPTMODE) return "sculptmode"; + else if (G.f & G_WEIGHTPAINT) return "weightpaint"; + else if (G.f & G_VERTEXPAINT) return "vertexpaint"; + else if (G.f & G_TEXTUREPAINT) return "texturepaint"; + else if(G.f & G_PARTICLEEDIT) return "particlemode"; + } + + return "objectmode"; +} + typedef struct CustomTool { struct CustomTool *next, *prev; char opname[OP_MAX_TYPENAME]; + char context[OP_MAX_TYPENAME]; } CustomTool; static void operator_call_cb(struct bContext *C, void *arg_listbase, void *arg2) @@ -164,6 +201,7 @@ static void operator_call_cb(struct bContext *C, void *arg_listbase, void *arg2) BLI_addtail(arg_listbase, ct); BLI_strncpy(ct->opname, ot->idname, OP_MAX_TYPENAME); + BLI_strncpy(ct->context, view3d_context_string(C), OP_MAX_TYPENAME); } } @@ -221,43 +259,28 @@ static uiBlock *tool_search_menu(bContext *C, ARegion *ar, void *arg_listbase) } -static void view3d_panel_tools(const bContext *C, Panel *pa) +static void view3d_panel_tool_shelf(const bContext *C, Panel *pa) { - static ListBase tools= {NULL, NULL}; - Object *obedit= CTX_data_edit_object(C); -// Object *obact = CTX_data_active_object(C); + SpaceLink *sl= CTX_wm_space_data(C); + SpaceType *st= NULL; uiLayout *col; + const char *context= view3d_context_string(C); - if(obedit) { - if(obedit->type==OB_MESH) { - - col= uiLayoutColumn(pa->layout, 1); - uiItemFullO(col, NULL, 0, "MESH_OT_spin", NULL, WM_OP_INVOKE_REGION_WIN); - uiItemFullO(col, NULL, 0, "MESH_OT_screw", NULL, WM_OP_INVOKE_REGION_WIN); - - if(tools.first) { - CustomTool *ct; - - for(ct= tools.first; ct; ct= ct->next) { - col= uiLayoutColumn(pa->layout, 1); - uiItemFullO(col, NULL, 0, ct->opname, NULL, WM_OP_INVOKE_REGION_WIN); - } + if(sl) + st= BKE_spacetype_from_id(sl->spacetype); + + if(st && st->toolshelf.first) { + CustomTool *ct; + + for(ct= st->toolshelf.first; ct; ct= ct->next) { + if(0==strncmp(context, ct->context, OP_MAX_TYPENAME)) { + col= uiLayoutColumn(pa->layout, 1); + uiItemFullO(col, NULL, 0, ct->opname, NULL, WM_OP_INVOKE_REGION_WIN); } - col= uiLayoutColumn(pa->layout, 1); - uiDefBlockBut(uiLayoutGetBlock(pa->layout), tool_search_menu, &tools, "Add Operator", 0, 0, UI_UNIT_X, UI_UNIT_Y, "Add tool"); } } - else { - - col= uiLayoutColumn(pa->layout, 1); - uiItemFullO(col, NULL, 0, "OBJECT_OT_delete", NULL, WM_OP_INVOKE_REGION_WIN); - uiItemFullO(col, NULL, 0, "OBJECT_OT_primitive_add", NULL, WM_OP_INVOKE_REGION_WIN); - - col= uiLayoutColumn(pa->layout, 1); - uiItemFullO(col, NULL, 0, "OBJECT_OT_parent_set", NULL, WM_OP_INVOKE_REGION_WIN); - uiItemFullO(col, NULL, 0, "OBJECT_OT_parent_clear", NULL, WM_OP_INVOKE_REGION_WIN); - - } + col= uiLayoutColumn(pa->layout, 1); + uiDefBlockBut(uiLayoutGetBlock(pa->layout), tool_search_menu, &st->toolshelf, "Add Tool", 0, 0, UI_UNIT_X, UI_UNIT_Y, "Add Tool in shelf, gets saved in files"); } @@ -266,10 +289,15 @@ void view3d_toolbar_register(ARegionType *art) PanelType *pt; pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel tools"); - strcpy(pt->idname, "VIEW3D_PT_tools"); - strcpy(pt->label, "Tools"); - pt->draw= view3d_panel_tools; + strcpy(pt->idname, "VIEW3D_PT_tool_shelf"); + strcpy(pt->label, "Tool Shelf"); + pt->draw= view3d_panel_tool_shelf; BLI_addtail(&art->paneltypes, pt); +} + +void view3d_tool_props_register(ARegionType *art) +{ + PanelType *pt; pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel last operator"); strcpy(pt->idname, "VIEW3D_PT_last_operator"); @@ -278,6 +306,8 @@ void view3d_toolbar_register(ARegionType *art) BLI_addtail(&art->paneltypes, pt); } +/* ********** operator to open/close toolbar region */ + static int view3d_toolbar(bContext *C, wmOperator *op) { ScrArea *sa= CTX_wm_area(C); diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index d9d68490425..44133b61e6c 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -226,6 +226,7 @@ typedef struct ARegion { #define RGN_TYPE_TEMPORARY 3 #define RGN_TYPE_UI 4 #define RGN_TYPE_TOOLS 5 +#define RGN_TYPE_TOOL_PROPS 6 /* region alignment */ #define RGN_ALIGN_NONE 0 diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index a4ba6ec172b..fb836a98a52 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -36,6 +36,7 @@ EnumPropertyItem region_type_items[] = { {RGN_TYPE_WINDOW, "WINDOW", 0, "Window", ""}, {RGN_TYPE_HEADER, "HEADER", 0, "Header", ""}, {RGN_TYPE_CHANNELS, "CHANNELS", 0, "Channels", ""}, + {RGN_TYPE_TOOLS, "TOOLS", 0, "Tools", ""}, {RGN_TYPE_TEMPORARY, "TEMPORARY", 0, "Temporary", ""}, {RGN_TYPE_UI, "UI", 0, "UI", ""}, {0, NULL, 0, NULL, NULL}}; -- cgit v1.2.3 From aefa7b626a5e623b5f98979a5cc849b7c21563cc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 2 Jul 2009 12:11:20 +0000 Subject: out own Py_GetPath() function to replace pythons, so we can bundle python modules with blender, #if 0'd for now but having it is useful for testing. This works by copying /usr/lib/python3.1 to a dir called "python", next to blenders "ui" and "io" dirs. --- source/blender/python/intern/bpy_interface.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 8b5ad36f349..1d18fe36ad9 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -37,7 +37,7 @@ #include "BPY_extern.h" #include "../generic/bpy_internal_import.h" // our own imports -/* external util modukes */ +/* external util modules */ #include "../generic/Mathutils.h" #include "../generic/Geometry.h" @@ -132,6 +132,21 @@ static PyObject *CreateGlobalDictionary( bContext *C ) return dict; } +/* Use this so we can include our own python bundle */ +#if 0 +wchar_t* Py_GetPath(void) +{ + int i; + static wchar_t py_path[FILE_MAXDIR] = L""; + char *dirname= BLI_gethome_folder("python"); + if(dirname) { + i= mbstowcs(py_path, dirname, FILE_MAXDIR); + printf("py path %s, %d\n", dirname, i); + } + return py_path; +} +#endif + void BPY_start_python( int argc, char **argv ) { PyThreadState *py_tstate = NULL; -- cgit v1.2.3 From 441bcaae2e63d3f757ee336fb051a9cb851e3e33 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 2 Jul 2009 12:41:03 +0000 Subject: NLA SoC: FModifier drawing converted to use Layout Engine * Most of the F-Modifiers have been ported to use the layout engine + RNA for drawing their buttons now. This plays much nicer with various button-layouts. --> As a nice demo, try adding a Noise Modifier to a NLA-strip, and change the 'size' setting to about 2 to see some effects. * Generator and Envelope modifiers haven't been ported yet since they're quite complex (requiring more time + energy), and as such, have been made to have some temporary error prints instead. Will check on this tomorrow. * Finished/cleaned up the RNA-wrapping of most FModifiers. TODO's (help requested... Brecht?): Generator modifier's UI cannot be wrapped yet using the layout engine (though I might try using the old system only), as I'm having some trouble wrapping the coefficients array for this (see rna_fcurve.c - rna_def_fmodifier_generator()) --- source/blender/editors/animation/fmodifier_ui.c | 279 ++++++++++----------- source/blender/editors/include/ED_anim_api.h | 4 +- source/blender/editors/space_graph/graph_buttons.c | 22 +- source/blender/editors/space_nla/nla_buttons.c | 23 +- source/blender/makesrna/RNA_access.h | 1 + source/blender/makesrna/intern/rna_fcurve.c | 111 ++++---- 6 files changed, 233 insertions(+), 207 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index dfac380f595..19c7d049758 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -97,7 +97,7 @@ // XXX for now, roundbox has it's callback func set to NULL to not intercept events #define DRAW_BACKDROP(height) \ { \ - uiDefBut(block, ROUNDBOX, B_REDR, "", -3, *yco-height, width+3, height-1, NULL, 5.0, 0.0, 12.0, (float)rb_col, ""); \ + uiDefBut(block, ROUNDBOX, B_REDR, "", -3, yco-height, width+3, height-1, NULL, 5.0, 0.0, 12.0, (float)rb_col, ""); \ } /* callback to verify modifier data */ @@ -134,26 +134,19 @@ static void delete_fmodifier_cb (bContext *C, void *fmods_v, void *fcm_v) /* --------------- */ /* draw settings for generator modifier */ -static void draw_modifier__generator(uiBlock *block, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) +static void draw_modifier__generator(uiLayout *layout, FModifier *fcm, short width) { + // XXX TEMP WARNING + uiItemL(layout, "Generator FModifier UI not yet implemented again", ICON_ERROR); + +#if 0 // TODO: port to the new system FMod_Generator *data= (FMod_Generator *)fcm->data; + uiBlock *block= uiLayoutGetBlock(layout); char gen_mode[]="Generator Type%t|Expanded Polynomial%x0|Factorised Polynomial%x1"; - int cy= *yco - 30; + int cy= yco - 30; uiBut *but; - /* set the height */ - (*height) = 90; - switch (data->mode) { - case FCM_GENERATOR_POLYNOMIAL: /* polynomial expression */ - (*height) += 20*(data->poly_order+1) + 20; - break; - case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* factorised polynomial */ - (*height) += 20 * data->poly_order + 15; - break; - } - /* basic settings (backdrop + mode selector + some padding) */ - DRAW_BACKDROP((*height)); uiBlockBeginAlign(block); but= uiDefButI(block, MENU, B_FMODIFIER_REDRAW, gen_mode, 10,cy,width-30,19, &data->mode, 0, 0, 0, 0, "Selects type of generator algorithm."); uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL); @@ -237,97 +230,79 @@ static void draw_modifier__generator(uiBlock *block, FModifier *fcm, int *yco, s } break; } +#endif } /* --------------- */ /* draw settings for noise modifier */ -static void draw_modifier__fn_generator(uiBlock *block, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) +static void draw_modifier__fn_generator(uiLayout *layout, FModifier *fcm, short width) { - FMod_FunctionGenerator *data= (FMod_FunctionGenerator *)fcm->data; - int cy= (*yco - 30), cy1= (*yco - 50), cy2= (*yco - 70); - char fn_type[]="Built-In Function%t|Sin%x0|Cos%x1|Tan%x2|Square Root%x3|Natural Log%x4|Normalised Sin%x5"; - - /* set the height */ - (*height) = 80; - - /* basic settings (backdrop + some padding) */ - DRAW_BACKDROP((*height)); - - uiDefButI(block, MENU, B_FMODIFIER_REDRAW, fn_type, - 3, cy, 300, 20, &data->type, 0, 0, 0, 0, "Type of function used to generate values"); - + uiLayout *col= uiLayoutColumn(layout, 0); // no grouping for now + PointerRNA ptr; - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Amplitude:", - 3, cy1, 150, 20, &data->amplitude, 0.000001, 10000.0, 0.01, 3, "Scale factor determining the maximum/minimum values."); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Value Offset:", - 3, cy2, 150, 20, &data->value_offset, 0.0, 10000.0, 0.01, 3, "Constant factor to offset values by."); + /* init the RNA-pointer */ + RNA_pointer_create(NULL, &RNA_FModifierFunctionGenerator, fcm, &ptr); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Phase Multiplier:", - 155, cy1, 150, 20, &data->phase_multiplier, 0.0, 100000.0, 0.1, 3, "Scale factor determining the 'speed' of the function."); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Phase Offset:", - 155, cy2, 150, 20, &data->phase_offset, 0.0, 100000.0, 0.1, 3, "Constant factor to offset time by for function."); - + /* add the settings */ + uiItemR(col, NULL, 0, &ptr, "amplitude", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "phase_multiplier", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "phase_offset", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "value_offset", 0, 0, 0); } /* --------------- */ /* draw settings for cycles modifier */ -static void draw_modifier__cycles(uiBlock *block, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) +static void draw_modifier__cycles(uiLayout *layout, FModifier *fcm, short width) { - FMod_Cycles *data= (FMod_Cycles *)fcm->data; - char cyc_mode[]="Cycling Mode%t|No Cycles%x0|Repeat Motion%x1|Repeat with Offset%x2|Repeat Mirrored%x3"; - int cy= (*yco - 30), cy1= (*yco - 50), cy2= (*yco - 70); - - /* set the height */ - (*height) = 80; + uiLayout *split, *col; + PointerRNA ptr; - /* basic settings (backdrop + some padding) */ - DRAW_BACKDROP((*height)); + /* init the RNA-pointer */ + RNA_pointer_create(NULL, &RNA_FModifierCycles, fcm, &ptr); - /* 'before' range */ - uiDefBut(block, LABEL, 1, "Before:", 4, cy, 80, 20, NULL, 0.0, 0.0, 0, 0, "Settings for cycling before first keyframe"); - uiBlockBeginAlign(block); - uiDefButS(block, MENU, B_FMODIFIER_REDRAW, cyc_mode, 3,cy1,150,20, &data->before_mode, 0, 0, 0, 0, "Cycling mode to use before first keyframe"); - uiDefButS(block, NUM, B_FMODIFIER_REDRAW, "Max Cycles:", 3, cy2, 150, 20, &data->before_cycles, 0, 10000, 10, 3, "Maximum number of cycles to allow (0 = infinite)"); - uiBlockEndAlign(block); + /* split into 2 columns + * NOTE: the mode comboboxes shouldn't get labels, otherwise there isn't enough room + */ + split= uiLayoutSplit(layout, 0.5f); - /* 'after' range */ - uiDefBut(block, LABEL, 1, "After:", 155, cy, 80, 20, NULL, 0.0, 0.0, 0, 0, "Settings for cycling after last keyframe"); - uiBlockBeginAlign(block); - uiDefButS(block, MENU, B_FMODIFIER_REDRAW, cyc_mode, 157,cy1,150,20, &data->after_mode, 0, 0, 0, 0, "Cycling mode to use after first keyframe"); - uiDefButS(block, NUM, B_FMODIFIER_REDRAW, "Max Cycles:", 157, cy2, 150, 20, &data->after_cycles, 0, 10000, 10, 3, "Maximum number of cycles to allow (0 = infinite)"); - uiBlockEndAlign(block); + /* before range */ + col= uiLayoutColumn(split, 1); + uiItemL(col, "Before:", 0); + uiItemR(col, "", 0, &ptr, "before_mode", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "before_cycles", 0, 0, 0); + + /* after range */ + col= uiLayoutColumn(split, 1); + uiItemL(col, "After:", 0); + uiItemR(col, "", 0, &ptr, "after_mode", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "after_cycles", 0, 0, 0); } /* --------------- */ /* draw settings for noise modifier */ -static void draw_modifier__noise(uiBlock *block, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) +static void draw_modifier__noise(uiLayout *layout, FModifier *fcm, short width) { - FMod_Noise *data= (FMod_Noise *)fcm->data; - int cy= (*yco - 30), cy1= (*yco - 50), cy2= (*yco - 70); - char blend_mode[]="Modification %t|Replace %x0|Add %x1|Subtract %x2|Multiply %x3"; - - /* set the height */ - (*height) = 80; + uiLayout *split, *col; + PointerRNA ptr; - /* basic settings (backdrop + some padding) */ - DRAW_BACKDROP((*height)); + /* init the RNA-pointer */ + RNA_pointer_create(NULL, &RNA_FModifierNoise, fcm, &ptr); - uiDefButS(block, MENU, B_FMODIFIER_REDRAW, blend_mode, - 3, cy, 150, 20, &data->modification, 0, 0, 0, 0, "Method of combining the results of this modifier and other modifiers."); + /* split into 2 columns */ + split= uiLayoutSplit(layout, 0.5f); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Size:", - 3, cy1, 150, 20, &data->size, 0.000001, 10000.0, 0.01, 3, ""); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Strength:", - 3, cy2, 150, 20, &data->strength, 0.0, 10000.0, 0.01, 3, ""); + /* col 1 */ + col= uiLayoutColumn(split, 0); + uiItemR(col, NULL, 0, &ptr, "size", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "strength", 0, 0, 0); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Phase:", - 155, cy1, 150, 20, &data->phase, 0.0, 100000.0, 0.1, 3, ""); - uiDefButS(block, NUM, B_FMODIFIER_REDRAW, "Depth:", - 155, cy2, 150, 20, &data->depth, 0, 128, 1, 3, ""); - + /* col 2 */ + col= uiLayoutColumn(split, 0); + uiItemR(col, NULL, 0, &ptr, "phase", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "depth", 0, 0, 0); } /* --------------- */ @@ -492,22 +467,17 @@ static void fmod_envelope_deletepoint_cb (bContext *C, void *fcm_dv, void *ind_v } /* draw settings for envelope modifier */ -static void draw_modifier__envelope(uiBlock *block, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) +static void draw_modifier__envelope(uiLayout *layout, FModifier *fcm, short width) { + uiItemL(layout, "Envelope FModifier UI not yet recoded in layout engine", ICON_ERROR); +#if 0 // XXX FIXME: recode in new layout style FMod_Envelope *env= (FMod_Envelope *)fcm->data; FCM_EnvelopeData *fed; + uiBlock *block= uiLayoutGetBlock(layout); uiBut *but; - int cy= (*yco - 28); + int cy= (yco - 28); int i; - /* set the height: - * - basic settings + variable height from envelope controls - */ - (*height) = 115 + (35 * env->totvert); - - /* basic settings (backdrop + general settings + some padding) */ - DRAW_BACKDROP((*height)); - /* General Settings */ uiDefBut(block, LABEL, 1, "Envelope:", 10, cy, 100, 20, NULL, 0.0, 0.0, 0, 0, "Settings for cycling before first keyframe"); cy -= 20; @@ -543,83 +513,104 @@ static void draw_modifier__envelope(uiBlock *block, FModifier *fcm, int *yco, sh uiBlockBeginAlign(block); cy -= 25; } +#endif } /* --------------- */ /* draw settings for limits modifier */ -static void draw_modifier__limits(uiBlock *block, FModifier *fcm, int *yco, short *height, short width, short active, int rb_col) +static void draw_modifier__limits(uiLayout *layout, FModifier *fcm, short width) { - FMod_Limits *data= (FMod_Limits *)fcm->data; - const int togButWidth = 50; - const int textButWidth = ((width/2)-togButWidth); - - /* set the height */ - (*height) = 60; - - /* basic settings (backdrop + some padding) */ - DRAW_BACKDROP((*height)); - - /* Draw Pairs of LimitToggle+LimitValue */ - uiBlockBeginAlign(block); - uiDefButBitI(block, TOGBUT, FCM_LIMIT_XMIN, B_FMODIFIER_REDRAW, "xMin", 5, *yco-30, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum x value"); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 5+togButWidth, *yco-30, (textButWidth-5), 18, &data->rect.xmin, -UI_FLT_MAX, UI_FLT_MAX, 0.1,0.5,"Lowest x value to allow"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOGBUT, FCM_LIMIT_XMAX, B_FMODIFIER_REDRAW, "XMax", 5+(width-(textButWidth-5)-togButWidth), *yco-30, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum x value"); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 5+(width-textButWidth-5), *yco-30, (textButWidth-5), 18, &data->rect.xmax, -UI_FLT_MAX, UI_FLT_MAX, 0.1,0.5,"Highest x value to allow"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOGBUT, FCM_LIMIT_YMIN, B_FMODIFIER_REDRAW, "yMin", 5, *yco-52, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum y value"); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 5+togButWidth, *yco-52, (textButWidth-5), 18, &data->rect.ymin, -UI_FLT_MAX, UI_FLT_MAX, 0.1,0.5,"Lowest y value to allow"); - uiBlockEndAlign(block); + uiLayout *split, *col, *row; + PointerRNA ptr; - uiBlockBeginAlign(block); - uiDefButBitI(block, TOGBUT, FCM_LIMIT_YMAX, B_FMODIFIER_REDRAW, "YMax", 5+(width-(textButWidth-5)-togButWidth), *yco-52, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum y value"); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 5+(width-textButWidth-5), *yco-52, (textButWidth-5), 18, &data->rect.ymax, -UI_FLT_MAX, UI_FLT_MAX, 0.1,0.5,"Highest y value to allow"); - uiBlockEndAlign(block); + /* init the RNA-pointer */ + RNA_pointer_create(NULL, &RNA_FModifierLimits, fcm, &ptr); + + /* row 1: minimum */ + { + row= uiLayoutRow(layout, 0); + + /* split into 2 columns */ + split= uiLayoutSplit(layout, 0.5f); + + /* x-minimum */ + col= uiLayoutColumn(split, 1); + uiItemR(col, NULL, 0, &ptr, "use_minimum_x", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "minimum_x", 0, 0, 0); + + /* y-minimum*/ + col= uiLayoutColumn(split, 1); + uiItemR(col, NULL, 0, &ptr, "use_minimum_y", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "minimum_y", 0, 0, 0); + } + + /* row 2: minimum */ + { + row= uiLayoutRow(layout, 0); + + /* split into 2 columns */ + split= uiLayoutSplit(layout, 0.5f); + + /* x-minimum */ + col= uiLayoutColumn(split, 1); + uiItemR(col, NULL, 0, &ptr, "use_maximum_x", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "maximum_x", 0, 0, 0); + + /* y-minimum*/ + col= uiLayoutColumn(split, 1); + uiItemR(col, NULL, 0, &ptr, "use_maximum_y", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "maximum_y", 0, 0, 0); + } } /* --------------- */ -// FIXME: remove dependency for F-Curve -void ANIM_uiTemplate_fmodifier_draw (uiBlock *block, ListBase *modifiers, FModifier *fcm, int *yco) + +void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ListBase *modifiers, FModifier *fcm) { FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); + uiLayout *box, *row, *subrow; + uiBlock *block; uiBut *but; - short active= (fcm->flag & FMODIFIER_FLAG_ACTIVE); short width= 314; - short height = 0; - int rb_col; /* draw header */ { + /* get layout-row + UI-block for this */ + box= uiLayoutBox(layout); + + row= uiLayoutRow(box, 0); + block= uiLayoutGetBlock(row); // err... + uiBlockSetEmboss(block, UI_EMBOSSN); - /* rounded header */ - rb_col= (active)?-20:20; - but= uiDefBut(block, ROUNDBOX, B_REDR, "", 0, *yco-2, width, 24, NULL, 5.0, 0.0, 15.0, (float)(rb_col-20), ""); + /* left-align -------------------------------------------- */ + subrow= uiLayoutRow(row, 0); + uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_LEFT); /* expand */ - uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_EXPANDED, B_REDR, ICON_TRIA_RIGHT, 5, *yco-1, 20, 20, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is expanded."); + uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_EXPANDED, B_REDR, ICON_TRIA_RIGHT, 0, -1, UI_UNIT_X, UI_UNIT_Y, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is expanded."); /* checkbox for 'active' status (for now) */ - but= uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_ACTIVE, B_REDR, ICON_RADIOBUT_OFF, 25, *yco-1, 20, 20, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is active one."); + but= uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_ACTIVE, B_REDR, ICON_RADIOBUT_OFF, 0, -1, UI_UNIT_X, UI_UNIT_Y, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is active one."); uiButSetFunc(but, activate_fmodifier_cb, modifiers, fcm); /* name */ if (fmi) - uiDefBut(block, LABEL, 1, fmi->name, 10+40, *yco, 150, 20, NULL, 0.0, 0.0, 0, 0, "F-Curve Modifier Type. Click to make modifier active one."); + uiDefBut(block, LABEL, 1, fmi->name, 0, 0, 150, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "F-Curve Modifier Type. Click to make modifier active one."); else - uiDefBut(block, LABEL, 1, "", 10+40, *yco, 150, 20, NULL, 0.0, 0.0, 0, 0, "F-Curve Modifier Type. Click to make modifier active one."); + uiDefBut(block, LABEL, 1, "", 0, 0, 150, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "F-Curve Modifier Type. Click to make modifier active one."); + + /* right-align ------------------------------------------- */ + subrow= uiLayoutRow(row, 0); + uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT); /* 'mute' button */ - uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_MUTED, B_REDR, ICON_MUTE_IPO_OFF, 10+(width-60), *yco-1, 20, 20, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is temporarily muted (not evaluated)."); + uiDefIconButBitS(block, ICONTOG, FMODIFIER_FLAG_MUTED, B_REDR, ICON_MUTE_IPO_OFF, 0, 0, UI_UNIT_X, UI_UNIT_Y, &fcm->flag, 0.0, 0.0, 0, 0, "Modifier is temporarily muted (not evaluated)."); /* delete button */ - but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 10+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete F-Curve Modifier."); + but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete F-Curve Modifier."); uiButSetFunc(but, delete_fmodifier_cb, modifiers, fcm); uiBlockSetEmboss(block, UI_EMBOSS); @@ -627,43 +618,39 @@ void ANIM_uiTemplate_fmodifier_draw (uiBlock *block, ListBase *modifiers, FModif /* when modifier is expanded, draw settings */ if (fcm->flag & FMODIFIER_FLAG_EXPANDED) { + /* set up the flexible-box layout which acts as the backdrop for the modifier settings */ + box= uiLayoutBox(layout); + /* draw settings for individual modifiers */ switch (fcm->type) { case FMODIFIER_TYPE_GENERATOR: /* Generator */ - draw_modifier__generator(block, fcm, yco, &height, width, active, rb_col); + draw_modifier__generator(box, fcm, width); break; case FMODIFIER_TYPE_FN_GENERATOR: /* Built-In Function Generator */ - draw_modifier__fn_generator(block, fcm, yco, &height, width, active, rb_col); + draw_modifier__fn_generator(box, fcm, width); break; case FMODIFIER_TYPE_CYCLES: /* Cycles */ - draw_modifier__cycles(block, fcm, yco, &height, width, active, rb_col); + draw_modifier__cycles(box, fcm, width); break; case FMODIFIER_TYPE_ENVELOPE: /* Envelope */ - draw_modifier__envelope(block, fcm, yco, &height, width, active, rb_col); + draw_modifier__envelope(box, fcm, width); break; case FMODIFIER_TYPE_LIMITS: /* Limits */ - draw_modifier__limits(block, fcm, yco, &height, width, active, rb_col); + draw_modifier__limits(box, fcm, width); break; case FMODIFIER_TYPE_NOISE: /* Noise */ - draw_modifier__noise(block, fcm, yco, &height, width, active, rb_col); + draw_modifier__noise(box, fcm, width); break; default: /* unknown type */ - height= 96; - //DRAW_BACKDROP(height); // XXX buggy... break; } } - - /* adjust height for new to start */ - (*yco) -= (height + 27); } /* ********************************************** */ - - \ No newline at end of file diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 87f05c8a76a..df4e704cae8 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -296,11 +296,11 @@ void ANIM_draw_previewrange(const struct bContext *C, struct View2D *v2d); /* ************************************************* */ /* F-MODIFIER TOOLS */ -struct uiBlock; +struct uiLayout; /* draw a given F-Modifier for some layout/UI-Block */ // XXX not quite complete yet -void ANIM_uiTemplate_fmodifier_draw(struct uiBlock *block, ListBase *modifiers, struct FModifier *fcm, int *yco); +void ANIM_uiTemplate_fmodifier_draw(struct uiLayout *layout, ListBase *modifiers, struct FModifier *fcm); /* ************************************************* */ /* ASSORTED TOOLS */ diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 5616ffc8002..17bc78f9ee6 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -366,22 +366,30 @@ static void graph_panel_modifiers(const bContext *C, Panel *pa) bAnimListElem *ale; FCurve *fcu; FModifier *fcm; + uiLayout *col, *row; uiBlock *block; - int yco= 190; - if(!graph_panel_context(C, &ale, &fcu)) + if (!graph_panel_context(C, &ale, &fcu)) return; - block= uiLayoutFreeBlock(pa->layout); + block= uiLayoutGetBlock(pa->layout); uiBlockSetHandleFunc(block, do_graph_region_modifier_buttons, NULL); /* 'add modifier' button at top of panel */ - // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator - uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, "Add Modifier", 10, 225, 150, 20, "Adds a new F-Curve Modifier for the active F-Curve"); + { + row= uiLayoutRow(pa->layout, 0); + block= uiLayoutGetBlock(row); + + // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator + uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, "Add Modifier", 10, 0, 150, 20, "Adds a new F-Curve Modifier for the active F-Curve"); + } /* draw each modifier */ - for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) - ANIM_uiTemplate_fmodifier_draw(block, &fcu->modifiers, fcm, &yco); + for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) { + col= uiLayoutColumn(pa->layout, 1); + + ANIM_uiTemplate_fmodifier_draw(col, &fcu->modifiers, fcm); + } MEM_freeN(ale); } diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 1ef72760bfc..67c4365ff49 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -311,26 +311,33 @@ static void nla_panel_modifiers(const bContext *C, Panel *pa) PointerRNA strip_ptr; NlaStrip *strip; FModifier *fcm; - uiLayout *layout= pa->layout; + uiLayout *col, *row; uiBlock *block; - int yco = 190; // xxx old /* check context and also validity of pointer */ if (!nla_panel_context(C, NULL, &strip_ptr)) return; strip= strip_ptr.data; - block= uiLayoutGetBlock(layout); + block= uiLayoutGetBlock(pa->layout); uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); /* 'add modifier' button at top of panel */ - // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator - // FIXME: we need to set the only-active property so that this will only add modifiers for the active strip (not all selected) - uiDefButO(block, BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, "Add Modifier", 10, 225, 150, 20, "Adds a new F-Modifier for the active NLA Strip"); + { + row= uiLayoutRow(pa->layout, 0); + block= uiLayoutGetBlock(row); + + // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator + // FIXME: we need to set the only-active property so that this will only add modifiers for the active strip (not all selected) + uiDefButO(block, BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, "Add Modifier", 10, 0, 150, 20, "Adds a new F-Modifier for the active NLA Strip"); + } /* draw each modifier */ - for (fcm= strip->modifiers.first; fcm; fcm= fcm->next) - ANIM_uiTemplate_fmodifier_draw(block, &strip->modifiers, fcm, &yco); + for (fcm= strip->modifiers.first; fcm; fcm= fcm->next) { + col= uiLayoutColumn(pa->layout, 1); + + ANIM_uiTemplate_fmodifier_draw(col, &strip->modifiers, fcm); + } } /* ******************* general ******************************** */ diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 106185085d6..0673521505f 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -179,6 +179,7 @@ extern StructRNA RNA_FileSelectParams; extern StructRNA RNA_FModifier; extern StructRNA RNA_FModifierCycles; extern StructRNA RNA_FModifierEnvelope; +extern StructRNA RNA_FModifierEnvelopeControlPoint; extern StructRNA RNA_FModifierFunctionGenerator; extern StructRNA RNA_FModifierGenerator; extern StructRNA RNA_FModifierGenerator_PolyExpanded; diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 826d186516d..95a0482557f 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -56,17 +56,7 @@ StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr) switch (fcm->type) { case FMODIFIER_TYPE_GENERATOR: - { - FMod_Generator *gen= (FMod_Generator *)fcm->data; - - switch (gen->mode) { - case FCM_GENERATOR_POLYNOMIAL: - return &RNA_FModifierGenerator_PolyExpanded; - //case FCM_GENERATOR_POLYNOMIAL_FACTORISED: - default: - return &RNA_FModifierGenerator; - } - } + return &RNA_FModifierGenerator; case FMODIFIER_TYPE_FN_GENERATOR: return &RNA_FModifierFunctionGenerator; case FMODIFIER_TYPE_ENVELOPE: @@ -159,19 +149,22 @@ static void rna_FCurve_RnaPath_set(PointerRNA *ptr, const char *value) #else -static void rna_def_fmodifier_generator_common(StructRNA *srna) + +static void rna_def_fmodifier_generator(BlenderRNA *brna) { + StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_mode_items[] = { {FCM_GENERATOR_POLYNOMIAL, "POLYNOMIAL", 0, "Expanded Polynomial", ""}, {FCM_GENERATOR_POLYNOMIAL_FACTORISED, "POLYNOMIAL_FACTORISED", 0, "Factorised Polynomial", ""}, {0, NULL, 0, NULL, NULL}}; - - /* struct wrapping settings */ - RNA_def_struct_sdna_from(srna, "FMod_Generator", "data"); - /* settings */ + srna= RNA_def_struct(brna, "FModifierGenerator", "FModifier"); + RNA_def_struct_ui_text(srna, "Generator F-Curve Modifier", "Deterministically generates values for the modified F-Curve."); + RNA_def_struct_sdna_from(srna, "FMod_Generator", "data"); + + /* define common props */ prop= RNA_def_property(srna, "additive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE); RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them."); @@ -180,41 +173,22 @@ static void rna_def_fmodifier_generator_common(StructRNA *srna) prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Mode", "Type of generator to use."); -} - -/* this is a temporary dummy generator-modifier wrapping (to be discarded) */ -static void rna_def_fmodifier_generator(BlenderRNA *brna) -{ - StructRNA *srna; - srna= RNA_def_struct(brna, "FModifierGenerator", "FModifier"); - RNA_def_struct_ui_text(srna, "Generator F-Curve Modifier", "Deterministically generates values for the modified F-Curve."); - - /* define common props */ - rna_def_fmodifier_generator_common(srna); -} - -static void rna_def_fmodifier_generator_polyexpanded(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna= RNA_def_struct(brna, "FModifierGenerator_PolyExpanded", "FModifier"); - RNA_def_struct_ui_text(srna, "Expanded Polynomial Generator", "Generates values for the modified F-Curve using expanded polynomial expresion."); - - /* define common props */ - rna_def_fmodifier_generator_common(srna); /* order of the polynomial */ // XXX this has a special validation func prop= RNA_def_property(srna, "poly_order", PROP_INT, PROP_NONE); - RNA_def_property_ui_text(prop, "Polynomial Order", "The highest power of 'x' for this polynomial. (i.e. the number of coefficients - 1)"); + RNA_def_property_ui_text(prop, "Polynomial Order", "The highest power of 'x' for this polynomial. (number of coefficients - 1)"); /* coefficients array */ - //prop= RNA_def_property(srna, "coefficients", PROP_FLOAT, PROP_NONE); - //RNA_def_property_ui_text(prop, "Coefficients", "Coefficients for 'x' (starting from lowest power)."); + // FIXME: this is quite difficult to try to wrap + //prop= RNA_def_property(srna, "coefficients", PROP_COLLECTION, PROP_NONE); + //RNA_def_property_collection_funcs(prop, "rna_FModifierGenerator_coefficients_begin", "rna_FModifierGenerator_coefficients_next", "rna_FModifierGenerator_coefficients_end", "rna_iterator_array_get", "rna_FModifierGenerator_coefficients_length", 0, 0, 0, 0); + //RNA_def_property_ui_text(prop, "Coefficients", "Coefficients for 'x' (starting from lowest power of x^0)."); } +/* --------- */ + static void rna_def_fmodifier_function_generator(BlenderRNA *brna) { StructRNA *srna; @@ -258,14 +232,63 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna) /* --------- */ +static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "FModifierEnvelopeControlPoint", NULL); + RNA_def_struct_ui_text(srna, "Envelope Control Point", "Control point for envelope F-Modifier."); + RNA_def_struct_sdna(srna, "FCM_EnvelopeData"); + + /* min/max extents + * - for now, these are allowed to go past each other, so that we can have inverted action + * - technically, the range is limited by the settings in the envelope-modifier data, not here... + */ + prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "min"); + RNA_def_property_ui_text(prop, "Minimum Value", "Lower bound of envelope at this control-point."); + + prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "max"); + RNA_def_property_ui_text(prop, "Maximum Value", "Upper bound of envelope at this control-point."); + + /* Frame */ + prop= RNA_def_property(srna, "frame", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "time"); + RNA_def_property_ui_text(prop, "Frame", "Frame this control-point occurs on."); + + // TODO: + // - selection flags (not implemented in UI yet though) +} + static void rna_def_fmodifier_envelope(BlenderRNA *brna) { StructRNA *srna; - //PropertyRNA *prop; + PropertyRNA *prop; srna= RNA_def_struct(brna, "FModifierEnvelope", "FModifier"); RNA_def_struct_ui_text(srna, "Envelope F-Modifier", "Scales the values of the modified F-Curve."); RNA_def_struct_sdna_from(srna, "FMod_Envelope", "data"); + + /* Collections */ + prop= RNA_def_property(srna, "control_points", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "data", "totvert"); + RNA_def_property_struct_type(prop, "FModifierEnvelopeControlPoint"); + RNA_def_property_ui_text(prop, "Control Points", "Control points defining the shape of the envelope."); + + /* Range Settings */ + prop= RNA_def_property(srna, "reference_value", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "midval"); + RNA_def_property_ui_text(prop, "Reference Value", "Value that envelope's influence is centered around / based on."); + + prop= RNA_def_property(srna, "default_minimum", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "min"); + RNA_def_property_ui_text(prop, "Default Minimum", "Lower distance from Reference Value for 1:1 default influence."); + + prop= RNA_def_property(srna, "default_maximum", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "max"); + RNA_def_property_ui_text(prop, "Default Maximum", "Upper distance from Reference Value for 1:1 default influence."); } /* --------- */ @@ -606,9 +629,9 @@ void RNA_def_fcurve(BlenderRNA *brna) rna_def_fmodifier(brna); rna_def_fmodifier_generator(brna); - rna_def_fmodifier_generator_polyexpanded(brna); rna_def_fmodifier_function_generator(brna); rna_def_fmodifier_envelope(brna); + rna_def_fmodifier_envelope_ctrl(brna); rna_def_fmodifier_cycles(brna); rna_def_fmodifier_python(brna); rna_def_fmodifier_limits(brna); -- cgit v1.2.3 From 5a0896e1a3c7f17abd37e3d818585fde8e80ff6d Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 2 Jul 2009 18:12:46 +0000 Subject: 2.5 Cleanup of scroller drawing in 2D windows. Before: http://download.blender.org/institute/rt11.jpg After: http://download.blender.org/institute/rt12.jpg Will add 'zoom' widget circles later, as mockupped here: http://www.reynish.com/files/blender25/fcurve_scrollbar.png Also note the scale values are inside scroller; drawing it on top conflicts with current frame item and markers. Currently scroller disappear entirely when view is total. For Joshua: To make sliders behave nicely, the boundbox (v2d->tot) has to be refreshed on each change. I've added it in graph drawing now, but it could be notifier based I guess... not sure what the correct anim api call would be. Can discuss tomorrow! On todo: Layout config hints so people can make scroller positions swap. --- source/blender/blenfont/BLF_api.h | 5 + source/blender/blenfont/intern/blf.c | 13 + source/blender/editors/animation/anim_draw.c | 2 +- source/blender/editors/include/UI_view2d.h | 6 +- .../blender/editors/interface/interface_intern.h | 1 + source/blender/editors/interface/interface_panel.c | 2 +- .../blender/editors/interface/interface_widgets.c | 91 +++--- source/blender/editors/interface/view2d.c | 307 ++++++++------------- source/blender/editors/interface/view2d_ops.c | 15 +- source/blender/editors/space_graph/graph_edit.c | 5 +- source/blender/editors/space_graph/graph_intern.h | 2 + source/blender/editors/space_graph/space_graph.c | 4 + source/blender/makesdna/DNA_view2d_types.h | 4 + 13 files changed, 221 insertions(+), 236 deletions(-) (limited to 'source') diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index 2ee31a17fa6..c373fde5693 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -78,6 +78,11 @@ float BLF_height(char *str); float BLF_width_default(char *str); float BLF_height_default(char *str); +/* + * set rotation for default font + */ +void BLF_default_rotation(float angle); + /* * By default, rotation and clipping are disable and * have to be enable/disable using BLF_enable/disable. diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 9dad5a4bfa0..a7e599fabf9 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -321,6 +321,19 @@ void BLF_draw_default(float x, float y, float z, char *str) } } +void BLF_default_rotation(float angle) +{ + + if (global_font_default>=0) { + global_font[global_font_default]->angle= angle; + if(angle) + global_font[global_font_default]->flags |= BLF_ROTATION; + else + global_font[global_font_default]->flags &= ~BLF_ROTATION; + } +} + + void BLF_draw(char *str) { FontBLF *font; diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index c176f20c26b..128c6b078e7 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -165,7 +165,7 @@ void ANIM_draw_cfra (const bContext *C, View2D *v2d, short flag) glLineWidth(2.0); glBegin(GL_LINE_STRIP); - vec[1]= v2d->cur.ymin; + vec[1]= v2d->cur.ymin-500.0f; /* XXX arbitrary... want it go to bottom */ glVertex2fv(vec); vec[1]= v2d->cur.ymax; diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index 4813b695795..b5e675af64e 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -97,9 +97,9 @@ enum { /* ------ Defines for Scrollers ----- */ -/* scroller thickness */ -#define V2D_SCROLL_HEIGHT 16 -#define V2D_SCROLL_WIDTH 16 +/* scroller area */ +#define V2D_SCROLL_HEIGHT 17 +#define V2D_SCROLL_WIDTH 17 /* half the size (in pixels) of scroller 'handles' */ #define V2D_SCROLLER_HANDLE_SIZE 5 diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 1b16155c7e6..b2ba6fb38a8 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -420,6 +420,7 @@ void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y void ui_draw_menu_back(struct uiStyle *style, uiBlock *block, rcti *rect); void ui_draw_search_back(struct uiStyle *style, uiBlock *block, rcti *rect); void ui_draw_link_bezier(rcti *rect); +void widget_scroll_draw(struct uiWidgetColors *wcol, rcti *rect, rcti *slider, int state); extern void ui_draw_but(const struct bContext *C, ARegion *ar, struct uiStyle *style, uiBut *but, rcti *rect); /* theme color init */ diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index a20884a61a3..319e69a40e4 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -106,7 +106,7 @@ static int panel_aligned(ScrArea *sa, ARegion *ar) } else if(sa->spacetype==SPACE_FILE && ar->regiontype == RGN_TYPE_CHANNELS) return BUT_VERTICAL; - else if(ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS)) + else if(ELEM3(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS, RGN_TYPE_TOOL_PROPS)) return BUT_VERTICAL; return 0; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 7a4ceec9593..751a09ede49 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -527,7 +527,7 @@ static void shadecolors4(char *coltop, char *coldown, char *color, short shadeto coldown[0]= CLAMPIS(color[0]+shadedown, 0, 255); coldown[1]= CLAMPIS(color[1]+shadedown, 0, 255); coldown[2]= CLAMPIS(color[2]+shadedown, 0, 255); - coldown[3]= color[3]; + coldown[3]= color[3]; } static void round_box_shade_col4(char *col1, char *col2, float fac) @@ -1106,16 +1106,16 @@ static struct uiWidgetColors wcol_toggle= { }; static struct uiWidgetColors wcol_scroll= { - {25, 25, 25, 255}, + {50, 50, 50, 180}, + {80, 80, 80, 180}, + {100, 100, 100, 180}, {180, 180, 180, 255}, - {153, 153, 153, 255}, - {90, 90, 90, 255}, {0, 0, 0, 255}, {255, 255, 255, 255}, 1, - 0, -20 + 10, -20 }; /* free wcol struct to play with */ @@ -1206,6 +1206,10 @@ static void widget_state_label(uiWidgetType *wt, int state) } +static void widget_state_nothing(uiWidgetType *wt, int state) +{ + wt->wcol= *(wt->wcol_theme); +} /* special case, button that calls pulldown */ static void widget_state_pulldown(uiWidgetType *wt, int state) @@ -1634,44 +1638,64 @@ void ui_draw_link_bezier(rcti *rect) } } -static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +/* function in use for buttons and for view2d sliders */ +void widget_scroll_draw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int state) { uiWidgetBase wtb; - rcti rect1; - double value; - char inner[3]; - float fac, size, rad; + float rad; int horizontal; + widget_init(&wtb); + /* determine horizontal/vertical */ horizontal= (rect->xmax - rect->xmin > rect->ymax - rect->ymin); - + if(horizontal) rad= 0.5f*(rect->ymax - rect->ymin); else rad= 0.5f*(rect->xmax - rect->xmin); - - widget_init(&wtb); + wtb.shadedir= (horizontal)? 1: 0; - + /* draw back part, colors swapped and shading inverted */ - VECCOPY(inner, wcol->inner); - VECCOPY(wcol->inner, wcol->item); if(horizontal) SWAP(short, wcol->shadetop, wcol->shadedown); - if(state & UI_SELECT) - SWAP(short, wcol->shadetop, wcol->shadedown); - round_box_edges(&wtb, roundboxalign, rect, rad); /* XXX vertical gradient is wrong */ + round_box_edges(&wtb, 15, rect, rad); widgetbase_draw(&wtb, wcol); - - VECCOPY(wcol->inner, inner); - if(horizontal) - SWAP(short, wcol->shadetop, wcol->shadedown); - if(state & UI_SELECT) - SWAP(short, wcol->shadetop, wcol->shadedown); - /* front part */ + /* slider */ + if(slider->xmax-slider->xmin<2 || slider->ymax-slider->ymin<2); + else { + + SWAP(short, wcol->shadetop, wcol->shadedown); + + QUATCOPY(wcol->inner, wcol->item); + + if(wcol->shadetop>wcol->shadedown) + wcol->shadetop+= 20; /* XXX violates themes... */ + else wcol->shadedown+= 20; + + if(state & UI_SELECT) + SWAP(short, wcol->shadetop, wcol->shadedown); + + /* draw */ + wtb.emboss= 0; /* only emboss once */ + + round_box_edges(&wtb, 15, slider, rad); + widgetbase_draw(&wtb, wcol); + + } +} + +static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) +{ + rcti rect1; + double value; + float fac, size; + int horizontal; + + /* calculate slider part */ value= ui_get_but_val(but); size= (but->softmax + but->a1 - but->softmin); @@ -1680,6 +1704,9 @@ static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat /* position */ rect1= *rect; + /* determine horizontal/vertical */ + horizontal= (rect->xmax - rect->xmin > rect->ymax - rect->ymin); + if(horizontal) { fac= (rect->xmax - rect->xmin)/(size); rect1.xmin= rect1.xmin + ceil(fac*(value - but->softmin)); @@ -1691,17 +1718,8 @@ static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat rect1.ymin= rect1.ymax - ceil(fac*(but->a1 - but->softmin)); } - /* draw */ - wtb.emboss= 0; /* only emboss once */ - - if(!horizontal) - SWAP(short, wcol->shadetop, wcol->shadedown); - - round_box_edges(&wtb, roundboxalign, &rect1, rad); /* XXX vertical gradient is wrong */ - widgetbase_draw(&wtb, wcol); + widget_scroll_draw(wcol, rect, &rect1, state); - if(!horizontal) - SWAP(short, wcol->shadetop, wcol->shadedown); } static void widget_link(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) @@ -2103,6 +2121,7 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type) case UI_WTYPE_SCROLL: wt.wcol_theme= &btheme->tui.wcol_scroll; + wt.state= widget_state_nothing; wt.custom= widget_scroll; break; } diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index aa5aa65d300..38c854f432e 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -34,6 +34,7 @@ #include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "DNA_space_types.h" +#include "DNA_userdef_types.h" #include "DNA_view2d_types.h" #include "BLI_blenlib.h" @@ -901,7 +902,14 @@ void UI_view2d_view_orthoSpecial(const bContext *C, View2D *v2d, short xaxis) /* Restore view matrices after drawing */ void UI_view2d_view_restore(const bContext *C) { - ED_region_pixelspace(CTX_wm_region(C)); + ARegion *ar= CTX_wm_region(C); + int width= ar->winrct.xmax-ar->winrct.xmin+1; + int height= ar->winrct.ymax-ar->winrct.ymin+1; + + wmOrtho2(0.0f, (float)width, 0.0f, (float)height); + wmLoadIdentity(); + + // ED_region_pixelspace(CTX_wm_region(C)); } /* *********************************************************************** */ @@ -1198,7 +1206,10 @@ void UI_view2d_grid_free(View2DGrid *grid) * WARNING: the start of this struct must not change, as view2d_ops.c uses this too. * For now, we don't need to have a separate (internal) header for structs like this... */ -struct View2DScrollers { +struct View2DScrollers { + rcti hor, vert; /* exact size of slider backdrop */ + int horfull, vertfull; /* set if sliders are full, we don't draw them */ + /* focus bubbles */ int vert_min, vert_max; /* vertical scrollbar */ int hor_min, hor_max; /* horizontal scrollbar */ @@ -1214,14 +1225,33 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short { View2DScrollers *scrollers; rcti vert, hor; - float fac, totsize, scrollsize; + float fac1, fac2, totsize, scrollsize; int scroll= view2d_scroll_mapped(v2d->scroll); + /* scrollers is allocated here... */ + scrollers= MEM_callocN(sizeof(View2DScrollers), "View2DScrollers"); + vert= v2d->vert; hor= v2d->hor; - /* scrollers is allocated here... */ - scrollers= MEM_callocN(sizeof(View2DScrollers), "View2DScrollers"); + /* slider rects smaller than region */ + hor.xmin+=4; + hor.xmax-=4; + if (scroll & V2D_SCROLL_BOTTOM) + hor.ymin+=4; + else + hor.ymax-=4; + + if (scroll & V2D_SCROLL_LEFT) + vert.xmin+=4; + else + vert.xmax-=4; + vert.ymin+=4; + vert.ymax-=4; + + /* store in scrollers, used for drawing */ + scrollers->vert= vert; + scrollers->hor= hor; /* scroller 'buttons': * - These should always remain within the visible region of the scrollbar @@ -1234,14 +1264,23 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short totsize= v2d->tot.xmax - v2d->tot.xmin; scrollsize= (float)(hor.xmax - hor.xmin); - fac= (v2d->cur.xmin - v2d->tot.xmin) / totsize; - scrollers->hor_min= (int)(hor.xmin + (fac * scrollsize)); + fac1= (v2d->cur.xmin - v2d->tot.xmin) / totsize; + if(fac1<=0.0f) + scrollers->hor_min= hor.xmin; + else + scrollers->hor_min= (int)(hor.xmin + (fac1 * scrollsize)); - fac= (v2d->cur.xmax - v2d->tot.xmin) / totsize; - scrollers->hor_max= (int)(hor.xmin + (fac * scrollsize)); + fac2= (v2d->cur.xmax - v2d->tot.xmin) / totsize; + if(fac2>=1.0f) + scrollers->hor_max= hor.xmax; + else + scrollers->hor_max= (int)(hor.xmin + (fac2 * scrollsize)); if (scrollers->hor_min > scrollers->hor_max) scrollers->hor_min= scrollers->hor_max; + + if(fac1 <= 0.0f && fac2 >= 1.0f) + scrollers->horfull= 1; } /* vertical scrollers */ @@ -1250,14 +1289,23 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short totsize= v2d->tot.ymax - v2d->tot.ymin; scrollsize= (float)(vert.ymax - vert.ymin); - fac= (v2d->cur.ymin- v2d->tot.ymin) / totsize; - scrollers->vert_min= (int)(vert.ymin + (fac * scrollsize)); + fac1= (v2d->cur.ymin- v2d->tot.ymin) / totsize; + if(fac1<=0.0f) + scrollers->vert_min= vert.ymin; + else + scrollers->vert_min= (int)(vert.ymin + (fac1 * scrollsize)); - fac= (v2d->cur.ymax - v2d->tot.ymin) / totsize; - scrollers->vert_max= (int)(vert.ymin + (fac * scrollsize)); + fac2= (v2d->cur.ymax - v2d->tot.ymin) / totsize; + if(fac2>=1.0f) + scrollers->vert_max= vert.ymax; + else + scrollers->vert_max= (int)(vert.ymin + (fac2 * scrollsize)); if (scrollers->vert_min > scrollers->vert_max) scrollers->vert_min= scrollers->vert_max; + + if(fac1 <= 0.0f && fac2 >= 1.0f) + scrollers->vertfull= 1; } /* grid markings on scrollbars */ @@ -1287,7 +1335,7 @@ static void scroll_printstr(View2DScrollers *scrollers, Scene *scene, float x, f * rotation values (hence 'degrees') are divided by 10 to * be able to show the curves at the same time */ - if ELEM(unit, V2D_UNIT_DEGREES, V2D_UNIT_TIME) { + if (ELEM(unit, V2D_UNIT_DEGREES, V2D_UNIT_TIME)) { power += 1; val *= 10; } @@ -1393,81 +1441,27 @@ static void scroll_printstr(View2DScrollers *scrollers, Scene *scene, float x, f void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *vs) { Scene *scene= CTX_data_scene(C); - const short darker= -50, dark= -10, light= 20, lighter= 50; - rcti vert, hor, corner; + rcti vert, hor; int scroll= view2d_scroll_mapped(v2d->scroll); /* make copies of rects for less typing */ - vert= v2d->vert; - hor= v2d->hor; + vert= vs->vert; + hor= vs->hor; /* horizontal scrollbar */ if (scroll & V2D_SCROLL_HORIZONTAL) { - /* scroller backdrop */ - UI_ThemeColorShade(TH_SHADE1, light); - glRecti(hor.xmin, hor.ymin, hor.xmax, hor.ymax); - - /* scroller 'button' - * - if view is zoomable in x, draw handles too - * - handles are drawn darker - * - no slider when view is > total for non-zoomable views - * (otherwise, zoomable ones tend to flicker) - */ - if ( (v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL) || - ((v2d->tot.xmax - v2d->tot.xmin) > (v2d->cur.xmax - v2d->cur.xmin)) ) - { - if (v2d->keepzoom & V2D_LOCKZOOM_X) { - /* draw base bar as rounded shape */ - UI_ThemeColorShade(TH_SHADE1, dark); - uiSetRoundBox(15); - - /* check that box is large enough for round drawing */ - if ((vs->hor_max - vs->hor_min) < (V2D_SCROLLCAP_RAD * 2)) { - /* Rounded box still gets drawn at the minimum size limit - * This doesn't represent extreme scaling well, but looks nicer... - */ - float mid= 0.5f * (vs->hor_max + vs->hor_min); - - gl_round_box_shade(GL_POLYGON, - mid-V2D_SCROLLCAP_RAD, (float)hor.ymin+2, - mid+V2D_SCROLLCAP_RAD, (float)hor.ymax-2, - V2D_SCROLLCAP_RAD, V2D_SCROLLBAR_SHADE, -V2D_SCROLLBAR_SHADE); - } - else { - /* draw rounded box as per normal */ - gl_round_box_shade(GL_POLYGON, - (float)vs->hor_min, (float)hor.ymin+2, - (float)vs->hor_max, (float)hor.ymax-2, - V2D_SCROLLCAP_RAD, V2D_SCROLLBAR_SHADE, -V2D_SCROLLBAR_SHADE); - } - } - else { - /* base bar drawn as shaded rect */ - UI_ThemeColorShade(TH_SHADE1, dark); - uiSetRoundBox(0); - gl_round_box_shade(GL_POLYGON, - (float)vs->hor_min, (float)hor.ymin+2, - (float)vs->hor_max, (float)hor.ymax-2, - V2D_SCROLLCAP_RAD, V2D_SCROLLBAR_SHADE, -V2D_SCROLLBAR_SHADE); - - /* 'minimum' handle */ - uiSetRoundBox(9); - UI_ThemeColorShade(TH_SHADE1, darker); - - gl_round_box_shade(GL_POLYGON, - (float)vs->hor_min-V2D_SCROLLER_HANDLE_SIZE, (float)hor.ymin+2, - (float)vs->hor_min+V2D_SCROLLER_HANDLE_SIZE, (float)hor.ymax-2, - V2D_SCROLLCAP_RAD, V2D_SCROLLCAP_SHADE, -V2D_SCROLLCAP_SHADE); - - /* maximum handle */ - uiSetRoundBox(6); - UI_ThemeColorShade(TH_SHADE1, darker); - - gl_round_box_shade(GL_POLYGON, - (float)vs->hor_max-V2D_SCROLLER_HANDLE_SIZE, (float)hor.ymin+2, - (float)vs->hor_max+V2D_SCROLLER_HANDLE_SIZE, (float)hor.ymax-2, - V2D_SCROLLCAP_RAD, V2D_SCROLLCAP_SHADE, -V2D_SCROLLCAP_SHADE); - } + + if(vs->horfull==0) { + bTheme *btheme= U.themes.first; + uiWidgetColors wcol= btheme->tui.wcol_scroll; + rcti slider; + + slider.xmin= vs->hor_min; + slider.xmax= vs->hor_max; + slider.ymin= hor.ymin; + slider.ymax= hor.ymax; + + widget_scroll_draw(&wcol, &hor, &slider, (v2d->scroll_ui & V2D_SCROLL_H_ACTIVE)?UI_SELECT:0); } /* scale indicators */ @@ -1502,19 +1496,26 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v /* draw numbers in the appropriate range */ if (dfac > 0.0f) { - for (; fac < hor.xmax; fac+=dfac, val+=grid->dx) { + float h= 2.0f+(float)(hor.ymin); + + for (; fac < hor.xmax-10; fac+=dfac, val+=grid->dx) { + + /* make prints look nicer for scrollers */ + if(fac < hor.xmin+10) + continue; + switch (vs->xunits) { case V2D_UNIT_FRAMES: /* frames (as whole numbers)*/ - scroll_printstr(vs, scene, fac, 3.0f+(float)(hor.ymin), val, grid->powerx, V2D_UNIT_FRAMES, 'h'); + scroll_printstr(vs, scene, fac, h, val, grid->powerx, V2D_UNIT_FRAMES, 'h'); break; case V2D_UNIT_FRAMESCALE: /* frames (not always as whole numbers) */ - scroll_printstr(vs, scene, fac, 3.0f+(float)(hor.ymin), val, grid->powerx, V2D_UNIT_FRAMESCALE, 'h'); + scroll_printstr(vs, scene, fac, h, val, grid->powerx, V2D_UNIT_FRAMESCALE, 'h'); break; case V2D_UNIT_SECONDS: /* seconds */ fac2= val/(float)FPS; - scroll_printstr(vs, scene, fac, 3.0f+(float)(hor.ymin), fac2, grid->powerx, V2D_UNIT_SECONDS, 'h'); + scroll_printstr(vs, scene, fac, h, fac2, grid->powerx, V2D_UNIT_SECONDS, 'h'); break; case V2D_UNIT_SECONDSSEQ: /* seconds with special calculations (only used for sequencer only) */ @@ -1525,96 +1526,37 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v time= (float)floor(fac2); fac2= fac2-time; - scroll_printstr(vs, scene, fac, 3.0f+(float)(hor.ymin), time+(float)FPS*fac2/100.0f, grid->powerx, V2D_UNIT_SECONDSSEQ, 'h'); + scroll_printstr(vs, scene, fac, h, time+(float)FPS*fac2/100.0f, grid->powerx, V2D_UNIT_SECONDSSEQ, 'h'); } break; case V2D_UNIT_DEGREES: /* Graph Editor for rotation Drivers */ /* HACK: although we're drawing horizontal, we make this draw as 'vertical', just to get degree signs */ - scroll_printstr(vs, scene, fac, 3.0f+(float)(hor.ymin), val, grid->powerx, V2D_UNIT_DEGREES, 'v'); + scroll_printstr(vs, scene, fac, h, val, grid->powerx, V2D_UNIT_DEGREES, 'v'); break; } } } } - - /* decoration outer bevel line */ - UI_ThemeColorShade(TH_SHADE1, lighter); - if (scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O)) - sdrawline(hor.xmin, hor.ymax, hor.xmax, hor.ymax); - else if (scroll & V2D_SCROLL_TOP) - sdrawline(hor.xmin, hor.ymin, hor.xmax, hor.ymin); } /* vertical scrollbar */ if (scroll & V2D_SCROLL_VERTICAL) { - /* scroller backdrop */ - UI_ThemeColorShade(TH_SHADE1, light); - glRecti(vert.xmin, vert.ymin, vert.xmax, vert.ymax); - - /* scroller 'button' - * - if view is zoomable in y, draw handles too - * - handles are drawn darker - * - no slider when view is > total for non-zoomable views - * (otherwise, zoomable ones tend to flicker) - */ - if ( (v2d->scroll & V2D_SCROLL_SCALE_VERTICAL) || - ((v2d->tot.ymax - v2d->tot.ymin) > (v2d->cur.ymax - v2d->cur.ymin)) ) - { - if (v2d->keepzoom & V2D_LOCKZOOM_Y) { - /* draw base bar as rounded shape */ - UI_ThemeColorShade(TH_SHADE1, dark); - uiSetRoundBox(15); - - /* check that box is large enough for round drawing */ - if ((vs->vert_max - vs->vert_min) < (V2D_SCROLLCAP_RAD * 2)) { - /* Rounded box still gets drawn at the minimum size limit - * This doesn't represent extreme scaling well, but looks nicer... - */ - float mid= 0.5f * (vs->vert_max + vs->vert_min); - - gl_round_box_vertical_shade(GL_POLYGON, - (float)vert.xmin+2, mid-V2D_SCROLLCAP_RAD, - (float)vert.xmax-2, mid+V2D_SCROLLCAP_RAD, - V2D_SCROLLCAP_RAD, V2D_SCROLLBAR_SHADE, -V2D_SCROLLBAR_SHADE); - } - else { - /* draw rounded box as per normal */ - gl_round_box_vertical_shade(GL_POLYGON, - (float)vert.xmin+2, (float)vs->vert_min, - (float)vert.xmax-2, (float)vs->vert_max, - V2D_SCROLLCAP_RAD, V2D_SCROLLBAR_SHADE, -V2D_SCROLLBAR_SHADE); - } - } - else { - /* base bar drawn as shaded rect */ - UI_ThemeColorShade(TH_SHADE1, dark); - uiSetRoundBox(0); - gl_round_box_vertical_shade(GL_POLYGON, - (float)vert.xmin+2, (float)vs->vert_min, - (float)vert.xmax-2, (float)vs->vert_max, - V2D_SCROLLCAP_RAD, V2D_SCROLLBAR_SHADE, -V2D_SCROLLBAR_SHADE); - - /* 'minimum' handle */ - UI_ThemeColorShade(TH_SHADE1, darker); - uiSetRoundBox(12); - - gl_round_box_vertical_shade(GL_POLYGON, - (float)vert.xmin+2, (float)vs->vert_min-V2D_SCROLLER_HANDLE_SIZE, - (float)vert.xmax-2, (float)vs->vert_min+V2D_SCROLLER_HANDLE_SIZE, - V2D_SCROLLCAP_RAD, V2D_SCROLLCAP_SHADE, -V2D_SCROLLCAP_SHADE); - - /* maximum handle */ - UI_ThemeColorShade(TH_SHADE1, darker); - uiSetRoundBox(3); - - gl_round_box_vertical_shade(GL_POLYGON, - (float)vert.xmin+2, (float)vs->vert_max-V2D_SCROLLER_HANDLE_SIZE, - (float)vert.xmax-2, (float)vs->vert_max+V2D_SCROLLER_HANDLE_SIZE, - V2D_SCROLLCAP_RAD, V2D_SCROLLCAP_SHADE, -V2D_SCROLLCAP_SHADE); - } + + if(vs->vertfull==0) { + bTheme *btheme= U.themes.first; + uiWidgetColors wcol= btheme->tui.wcol_scroll; + rcti slider; + + slider.xmin= vert.xmin; + slider.xmax= vert.xmax; + slider.ymin= vs->vert_min; + slider.ymax= vs->vert_max; + + widget_scroll_draw(&wcol, &vert, &slider, (v2d->scroll_ui & V2D_SCROLL_V_ACTIVE)?UI_SELECT:0); } + /* scale indiators */ // XXX will need to update the font drawing when the new stuff comes in if ((scroll & V2D_SCROLL_SCALE_VERTICAL) && (vs->grid)) { @@ -1644,42 +1586,23 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v /* draw vertical steps */ if (dfac > 0.0f) { - for (; fac < vert.ymax; fac+= dfac, val += grid->dy) { - scroll_printstr(vs, scene, (float)(vert.xmax)-14.0f, fac, val, grid->powery, vs->yunits, 'v'); + + BLF_default_rotation(90.0f); + + for (; fac < vert.ymax-10; fac+= dfac, val += grid->dy) { + + /* make prints look nicer for scrollers */ + if(fac < vert.ymin+10) + continue; + + scroll_printstr(vs, scene, (float)(vert.xmax)-2.0f, fac, val, grid->powery, vs->yunits, 'v'); } + + BLF_default_rotation(0.0f); } } - - /* decoration outer bevel line */ - UI_ThemeColorShade(TH_SHADE1, lighter); - if (scroll & V2D_SCROLL_RIGHT) - sdrawline(vert.xmin, vert.ymin, vert.xmin, vert.ymax); - else if (scroll & V2D_SCROLL_LEFT) - sdrawline(vert.xmax, vert.ymin, vert.xmax, vert.ymax); } - /* draw a 'sunken square' to cover up any overlapping corners resulting from intersection of overflowing scroller data */ - if ((scroll & V2D_SCROLL_VERTICAL) && (scroll & V2D_SCROLL_HORIZONTAL)) { - /* set bounds (these should be right) */ - corner.xmin= vert.xmin; - corner.xmax= vert.xmax; - corner.ymin= hor.ymin; - corner.ymax= hor.ymax; - - /* firstly, draw using background color to cover up any overlapping junk */ - UI_ThemeColor(TH_SHADE1); - glRecti(corner.xmin, corner.ymin, corner.xmax, corner.ymax); - - /* now, draw suggestive highlighting... */ - /* first, dark lines on top to suggest scrollers overlap box */ - UI_ThemeColorShade(TH_SHADE1, darker); - sdrawline(corner.xmin, corner.ymin, corner.xmin, corner.ymax); - sdrawline(corner.xmin, corner.ymax, corner.xmax, corner.ymax); - /* now, light lines on bottom to show box is sunken in */ - UI_ThemeColorShade(TH_SHADE1, lighter); - sdrawline(corner.xmax, corner.ymin, corner.xmax, corner.ymax); - sdrawline(corner.xmin, corner.ymin, corner.xmax, corner.ymin); - } } /* free temporary memory used for drawing scrollers */ diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index bd1c734b870..ae89e215a03 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1095,15 +1095,23 @@ static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event, vsm->zone= mouse_in_scroller_handle(y, v2d->vert.ymin, v2d->vert.ymax, scrollers->vert_min, scrollers->vert_max); } } + UI_view2d_scrollers_free(scrollers); + ED_region_tag_redraw(ar); } /* cleanup temp customdata */ static void scroller_activate_exit(bContext *C, wmOperator *op) { if (op->customdata) { + v2dScrollerMove *vsm= op->customdata; + + vsm->v2d->scroll_ui &= ~(V2D_SCROLL_H_ACTIVE|V2D_SCROLL_V_ACTIVE); + MEM_freeN(op->customdata); - op->customdata= NULL; + op->customdata= NULL; + + ED_region_tag_redraw(CTX_wm_region(C)); } } @@ -1240,6 +1248,11 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event) } } + if(vsm->scroller=='h') + v2d->scroll_ui |= V2D_SCROLL_H_ACTIVE; + else + v2d->scroll_ui |= V2D_SCROLL_V_ACTIVE; + /* still ok, so can add */ WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op); return OPERATOR_RUNNING_MODAL; diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index b624d02a633..23e8a009274 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -94,14 +94,15 @@ /* *************************** Calculate Range ************************** */ /* Get the min/max keyframes*/ -static void get_graph_keyframe_extents (bAnimContext *ac, float *xmin, float *xmax, float *ymin, float *ymax) +/* note: it should return total boundbox, filter for selection only can be argument... */ +void get_graph_keyframe_extents (bAnimContext *ac, float *xmin, float *xmax, float *ymin, float *ymax) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; /* get data to filter, from Dopesheet */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* set large values to try to override */ diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h index 7ba636302a5..e31adf7a7c8 100644 --- a/source/blender/editors/space_graph/graph_intern.h +++ b/source/blender/editors/space_graph/graph_intern.h @@ -82,6 +82,8 @@ enum { /* ***************************************** */ /* graph_edit.c */ +void get_graph_keyframe_extents (struct bAnimContext *ac, float *xmin, float *xmax, float *ymin, float *ymax); + void GRAPHEDIT_OT_previewrange_set(struct wmOperatorType *ot); void GRAPHEDIT_OT_view_all(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 74002f64187..1c977724767 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -243,6 +243,10 @@ static void graph_main_area_draw(const bContext *C, ARegion *ar) /* draw curves twice - unselected, then selected, so that the are fewer occlusion problems */ graph_draw_curves(&ac, sipo, ar, grid, 0); graph_draw_curves(&ac, sipo, ar, grid, 1); + + /* XXX the slow way to set tot rect... but for nice sliders needed (ton) */ + get_graph_keyframe_extents(&ac, &v2d->tot.xmin, &v2d->tot.xmax, &v2d->tot.ymin, &v2d->tot.ymax); + } /* only free grid after drawing data, as we need to use it to determine sampling rate */ diff --git a/source/blender/makesdna/DNA_view2d_types.h b/source/blender/makesdna/DNA_view2d_types.h index ac628ca2266..dd73d691b62 100644 --- a/source/blender/makesdna/DNA_view2d_types.h +++ b/source/blender/makesdna/DNA_view2d_types.h @@ -118,6 +118,10 @@ typedef struct View2D { #define V2D_SCROLL_VERTICAL_HIDE (1<<7) #define V2D_SCROLL_HORIZONTAL_HIDE (1<<8) +/* scroll_ui, activate flag for drawing */ +#define V2D_SCROLL_H_ACTIVE (1<<0) +#define V2D_SCROLL_V_ACTIVE (1<<1) + /* alignment flags for totrect, flags use 'shading-out' convention (v2d->align) */ /* all quadrants free */ #define V2D_ALIGN_FREE 0 -- cgit v1.2.3 From 093ff8202ced6391a2ef657abe42615672146954 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 2 Jul 2009 19:41:31 +0000 Subject: 2.5: Physics Buttons All kinds of changes to get it ready for UI layouts. This means RNA and operators should be working correct, but most buttons are still not actually there yet. * Added near empty soft body, fluid, field and collision panels, tweaks to cloth panels. * Fluid bake works, but without escape or showing any progress. * Fluid/Softbody/Cloth/Collision can now be both added as modifiers or in the physics panels. * Missing: fields & soft body for particles. * Missing: proper updating softbodies, guess this code still needs updates after pointcache refactor? --- source/blender/blenkernel/BKE_effect.h | 2 + source/blender/blenkernel/BKE_fluidsim.h | 44 ++-- source/blender/blenkernel/BKE_modifier.h | 5 +- source/blender/blenkernel/intern/context.c | 2 +- source/blender/blenkernel/intern/effect.c | 16 ++ source/blender/blenkernel/intern/fluidsim.c | 19 +- source/blender/blenkernel/intern/modifier.c | 13 +- source/blender/editors/animation/anim_markers.c | 2 +- source/blender/editors/include/ED_fluidsim.h | 2 + source/blender/editors/include/ED_markers.h | 2 +- source/blender/editors/include/ED_object.h | 3 +- source/blender/editors/include/ED_physics.h | 40 +++ source/blender/editors/include/ED_pointcache.h | 38 --- source/blender/editors/include/UI_interface.h | 1 + .../blender/editors/interface/interface_layout.c | 49 +++- .../editors/interface/interface_templates.c | 238 ++++------------- source/blender/editors/object/object_intern.h | 6 + source/blender/editors/object/object_modifier.c | 292 +++++++++++++++++++-- source/blender/editors/object/object_ops.c | 6 + source/blender/editors/physics/ed_fluidsim.c | 113 +++++--- source/blender/editors/physics/ed_pointcache.c | 2 +- source/blender/editors/space_api/spacetypes.c | 9 +- .../editors/space_buttons/buttons_context.c | 15 +- source/blender/editors/space_buttons/buttons_ops.c | 4 +- source/blender/makesdna/DNA_object_fluidsim.h | 10 +- source/blender/makesdna/DNA_object_force.h | 2 +- source/blender/makesrna/RNA_access.h | 3 +- source/blender/makesrna/intern/rna_fluidsim.c | 103 +++++++- source/blender/makesrna/intern/rna_internal.h | 3 + source/blender/makesrna/intern/rna_modifier.c | 48 +++- source/blender/makesrna/intern/rna_object.c | 29 +- source/blender/makesrna/intern/rna_object_force.c | 222 +++++++++++++--- source/blender/makesrna/intern/rna_ui_api.c | 4 +- 33 files changed, 958 insertions(+), 389 deletions(-) create mode 100644 source/blender/editors/include/ED_physics.h delete mode 100644 source/blender/editors/include/ED_pointcache.h (limited to 'source') diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h index fd065978800..e21e83bf5cf 100644 --- a/source/blender/blenkernel/BKE_effect.h +++ b/source/blender/blenkernel/BKE_effect.h @@ -41,6 +41,8 @@ struct Particle; struct Group; struct RNG; +struct PartDeflect *object_add_collision_fields(void); + typedef struct pEffectorCache { struct pEffectorCache *next, *prev; Object *ob; diff --git a/source/blender/blenkernel/BKE_fluidsim.h b/source/blender/blenkernel/BKE_fluidsim.h index 93358fcf7e8..145ae48e732 100644 --- a/source/blender/blenkernel/BKE_fluidsim.h +++ b/source/blender/blenkernel/BKE_fluidsim.h @@ -1,6 +1,5 @@ /** - * BKE_fluidsim.h - * + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -28,29 +27,40 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include "DNA_modifier_types.h" -#include "DNA_object_fluidsim.h" // N_T -#include "DNA_object_types.h" +#ifndef BKE_FLUIDSIM_H +#define BKE_FLUIDSIM_H -#include "BKE_DerivedMesh.h" +struct Object; +struct Scene; +struct FluidsimModifierData; +struct DerivedMesh; +struct MVert; /* old interface */ -FluidsimSettings *fluidsimSettingsNew(Object *srcob); - -void initElbeemMesh(Scene *scene, Object *ob, int *numVertices, float **vertices, int *numTriangles, int **triangles, int useGlobalCoords, int modifierIndex); +struct FluidsimSettings *fluidsimSettingsNew(struct Object *srcob); +void initElbeemMesh(struct Scene *scene, struct Object *ob, + int *numVertices, float **vertices, + int *numTriangles, int **triangles, + int useGlobalCoords, int modifierIndex); /* new fluid-modifier interface */ -void fluidsim_init(FluidsimModifierData *fluidmd); -void fluidsim_free(FluidsimModifierData *fluidmd); +void fluidsim_init(struct FluidsimModifierData *fluidmd); +void fluidsim_free(struct FluidsimModifierData *fluidmd); -DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, FluidsimModifierData *fluidmd, int framenr, int useRenderParams); -void fluidsim_read_vel_cache(FluidsimModifierData *fluidmd, DerivedMesh *dm, char *filename); -DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc); +struct DerivedMesh *fluidsim_read_cache(struct Object *ob, struct DerivedMesh *orgdm, + struct FluidsimModifierData *fluidmd, int framenr, int useRenderParams); +void fluidsim_read_vel_cache(struct FluidsimModifierData *fluidmd, struct DerivedMesh *dm, + char *filename); +struct DerivedMesh *fluidsimModifier_do(struct FluidsimModifierData *fluidmd, + struct Scene *scene, struct Object *ob, struct DerivedMesh *dm, + int useRenderParams, int isFinalCalc); -// get bounding box of mesh -void fluid_get_bb(MVert *mvert, int totvert, float obmat[][4], - /*RET*/ float start[3], /*RET*/ float size[3] ); +/* bounding box & memory estimate */ +void fluid_get_bb(struct MVert *mvert, int totvert, float obmat[][4], + float start[3], float size[3]); +void fluid_estimate_memory(struct Object *ob, struct FluidsimSettings *fss, char *value); +#endif diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index 4065cbb7007..144ed3bc624 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -62,7 +62,7 @@ typedef enum { * used for particles modifier that doesn't actually modify the object * unless it's a mesh and can be exploded -> curve can also emit particles */ - eModifierTypeType_DeformOrConstruct + eModifierTypeType_DeformOrConstruct, } ModifierTypeType; typedef enum { @@ -87,6 +87,9 @@ typedef enum { /* For modifiers that support pointcache, so we can check to see if it has files we need to deal with */ eModifierTypeFlag_UsesPointCache = (1<<6), + + /* For physics modifiers, max one per type */ + eModifierTypeFlag_Single = (1<<7) } ModifierTypeFlag; typedef void (*ObjectWalkFunc)(void *userData, struct Object *ob, struct Object **obpoin); diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index fbad585d9b7..4a68d90a4ed 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -378,7 +378,7 @@ PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, Stru { PointerRNA ptr = CTX_data_pointer_get(C, member); - if(ptr.data && ptr.type == type) + if(ptr.data && RNA_struct_is_a(ptr.type, type)) return ptr; return PointerRNA_NULL; diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index eaa2d541638..553fdfe530e 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -56,6 +56,8 @@ #include "BLI_jitter.h" #include "BLI_rand.h" +#include "PIL_time.h" + #include "BKE_action.h" #include "BKE_anim.h" /* needed for where_on_path */ #include "BKE_armature.h" @@ -93,6 +95,20 @@ //XXX #include "BIF_screen.h" +PartDeflect *object_add_collision_fields(void) +{ + PartDeflect *pd; + + pd= MEM_callocN(sizeof(PartDeflect), "PartDeflect"); + + pd->pdef_sbdamp = 0.1f; + pd->pdef_sbift = 0.2f; + pd->pdef_sboft = 0.02f; + pd->seed = ((unsigned int)(ceil(PIL_check_seconds_timer()))+1) % 128; + + return pd; +} + /* temporal struct, used for reading return of mesh_get_mapped_verts_nors() */ typedef struct VeNoCo { diff --git a/source/blender/blenkernel/intern/fluidsim.c b/source/blender/blenkernel/intern/fluidsim.c index 54008185f72..6eba64cf33d 100644 --- a/source/blender/blenkernel/intern/fluidsim.c +++ b/source/blender/blenkernel/intern/fluidsim.c @@ -34,7 +34,9 @@ #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" +#include "DNA_object_fluidsim.h" #include "DNA_object_force.h" // for pointcache +#include "DNA_object_types.h" #include "DNA_particle_types.h" #include "DNA_scene_types.h" // N_T @@ -78,7 +80,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd) if(!fss) return; - fss->type = OB_FSBND_NOSLIP; + fss->type = OB_FLUIDSIM_ENABLE; fss->show_advancedoptions = 0; fss->resolutionxyz = 50; @@ -657,5 +659,20 @@ void initElbeemMesh(struct Scene *scene, struct Object *ob, dm->release(dm); } +void fluid_estimate_memory(Object *ob, FluidsimSettings *fss, char *value) +{ + Mesh *mesh; + + value[0]= '\0'; + + if(ob->type == OB_MESH) { + /* use mesh bounding box and object scaling */ + mesh= ob->data; + + fluid_get_bb(mesh->mvert, mesh->totvert, ob->obmat, fss->bbStart, fss->bbSize); + elbeemEstimateMemreq(fss->resolutionxyz, fss->bbSize[0],fss->bbSize[1],fss->bbSize[2], fss->maxRefine, value); + } +} + #endif // DISABLE_ELBEEM diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 80a9f173d6a..9ecf3a32c2b 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -63,6 +63,7 @@ #include "DNA_meshdata_types.h" #include "DNA_modifier_types.h" #include "DNA_object_types.h" +#include "DNA_object_fluidsim.h" #include "DNA_object_force.h" #include "DNA_particle_types.h" #include "DNA_scene_types.h" @@ -8387,7 +8388,8 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti = INIT_TYPE(Softbody); mti->type = eModifierTypeType_OnlyDeform; mti->flags = eModifierTypeFlag_AcceptsCVs - | eModifierTypeFlag_RequiresOriginalData; + | eModifierTypeFlag_RequiresOriginalData + | eModifierTypeFlag_Single; mti->deformVerts = softbodyModifier_deformVerts; mti->dependsOnTime = softbodyModifier_dependsOnTime; @@ -8395,7 +8397,8 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti->type = eModifierTypeType_Nonconstructive; mti->initData = clothModifier_initData; mti->flags = eModifierTypeFlag_AcceptsMesh - | eModifierTypeFlag_UsesPointCache; + | eModifierTypeFlag_UsesPointCache + | eModifierTypeFlag_Single; mti->dependsOnTime = clothModifier_dependsOnTime; mti->freeData = clothModifier_freeData; mti->requiredDataMask = clothModifier_requiredDataMask; @@ -8406,7 +8409,8 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti = INIT_TYPE(Collision); mti->type = eModifierTypeType_OnlyDeform; mti->initData = collisionModifier_initData; - mti->flags = eModifierTypeFlag_AcceptsMesh; + mti->flags = eModifierTypeFlag_AcceptsMesh + | eModifierTypeFlag_Single; mti->dependsOnTime = collisionModifier_dependsOnTime; mti->freeData = collisionModifier_freeData; mti->deformVerts = collisionModifier_deformVerts; @@ -8489,7 +8493,8 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti = INIT_TYPE(Fluidsim); mti->type = eModifierTypeType_Nonconstructive - | eModifierTypeFlag_RequiresOriginalData; + | eModifierTypeFlag_RequiresOriginalData + | eModifierTypeFlag_Single; mti->flags = eModifierTypeFlag_AcceptsMesh; mti->initData = fluidsimModifier_initData; mti->freeData = fluidsimModifier_freeData; diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 2abec6b831c..d6543b41f47 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -976,7 +976,7 @@ static void MARKER_OT_delete(wmOperatorType *ot) /* ************************** registration **********************************/ /* called in screen_ops.c:ED_operatortypes_screen() */ -void ED_marker_operatortypes(void) +void ED_operatortypes_marker(void) { WM_operatortype_append(MARKER_OT_add); WM_operatortype_append(MARKER_OT_move); diff --git a/source/blender/editors/include/ED_fluidsim.h b/source/blender/editors/include/ED_fluidsim.h index 586f16f42aa..2859ec897bf 100644 --- a/source/blender/editors/include/ED_fluidsim.h +++ b/source/blender/editors/include/ED_fluidsim.h @@ -46,6 +46,8 @@ void fluidsimSettingsFree(struct FluidsimSettings* sb); /* duplicate internal data */ struct FluidsimSettings* fluidsimSettingsCopy(struct FluidsimSettings* sb); +/* memory estimate */ +void fluidsimEstimateMemory(struct Object *ob, struct FluidsimSettings *fs, char *value); #endif /* ED_FLUIDSIM_H */ diff --git a/source/blender/editors/include/ED_markers.h b/source/blender/editors/include/ED_markers.h index 048bbbd7463..4b7a2954206 100644 --- a/source/blender/editors/include/ED_markers.h +++ b/source/blender/editors/include/ED_markers.h @@ -54,7 +54,7 @@ void ED_markers_make_cfra_list(ListBase *markers, ListBase *lb, short sel); /* Operators ------------------------------ */ /* called in screen_ops.c:ED_operatortypes_screen() */ -void ED_marker_operatortypes(void); +void ED_operatortypes_marker(void); /* called in screen_ops.c:ED_keymap_screen() */ void ED_marker_keymap(struct wmWindowManager *wm); diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index e4e4b1d0486..9dcdc30a691 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -103,7 +103,8 @@ void key_to_curve(struct KeyBlock *kb, struct Curve *cu, struct ListBase *nurb) void curve_to_key(struct Curve *cu, struct KeyBlock *kb, struct ListBase *nurb); /* object_modifier.c */ -int ED_object_modifier_delete(struct ReportList *reports, struct Object *ob, struct ModifierData *md); +int ED_object_modifier_add(struct ReportList *reports, struct Scene *scene, struct Object *ob, int type); +int ED_object_modifier_remove(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct ModifierData *md); int ED_object_modifier_move_down(struct ReportList *reports, struct Object *ob, struct ModifierData *md); int ED_object_modifier_move_up(struct ReportList *reports, struct Object *ob, struct ModifierData *md); int ED_object_modifier_convert(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct ModifierData *md); diff --git a/source/blender/editors/include/ED_physics.h b/source/blender/editors/include/ED_physics.h new file mode 100644 index 00000000000..b04bfb992dc --- /dev/null +++ b/source/blender/editors/include/ED_physics.h @@ -0,0 +1,40 @@ +/* + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2007 by Janne Karhu. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef ED_PHYSICS_H +#define ED_PHYSICS_H + +/* operators */ + +void ED_operatortypes_pointcache(void); +void ED_operatortypes_fluid(void); +//void ED_keymap_pointcache(struct wmWindowManager *wm); + +#endif /* ED_PHYSICS_H */ + diff --git a/source/blender/editors/include/ED_pointcache.h b/source/blender/editors/include/ED_pointcache.h deleted file mode 100644 index dc50e274fa9..00000000000 --- a/source/blender/editors/include/ED_pointcache.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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) 2007 by Janne Karhu. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifndef ED_PHYSICS_H -#define ED_PHYSICS_H - -/* operators */ -void ED_operatortypes_pointcache(void); -//void ED_keymap_pointcache(struct wmWindowManager *wm); - -#endif /* ED_PHYSICS_H */ - diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index cc8b936b04f..c0612c3524e 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -635,6 +635,7 @@ void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, struct ID void uiItemR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int expand, int slider, int toggle); void uiItemFullR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int expand, int slider, int toggle); void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int value); +void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, char *value); void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname); void uiItemPointerR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index f9816235b88..2e30c5f1cb7 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -615,14 +615,13 @@ void uiItemEnumO_string(uiLayout *layout, char *name, int icon, char *opname, ch /* for getting the enum */ PropertyRNA *prop; const EnumPropertyItem *item; - int totitem; int value; WM_operator_properties_create(&ptr, opname); /* enum lookup */ if((prop= RNA_struct_find_property(&ptr, propname))) { - RNA_property_enum_items(&ptr, prop, &item, &totitem); + RNA_property_enum_items(&ptr, prop, &item, NULL); if(RNA_enum_value_from_id(item, value_str, &value)==0) { printf("uiItemEnumO_string: %s.%s, enum %s not found.\n", RNA_struct_identifier(ptr.type), propname, value_str); return; @@ -695,14 +694,17 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PropertyRNA PropertySubType subtype; int len, w, h; - w= ui_text_icon_width(layout, name, icon); - h= UI_UNIT_Y; - /* arbitrary extended width by type */ type= RNA_property_type(prop); subtype= RNA_property_subtype(prop); len= RNA_property_array_length(prop); + if(type == PROP_STRING && strcmp(name, "") == 0) + name= "non-empty"; + + w= ui_text_icon_width(layout, name, icon); + h= UI_UNIT_Y; + /* increase height for arrays */ if(index == RNA_NO_INDEX && len > 0) { if(strcmp(name, "") == 0 && icon == 0) @@ -827,15 +829,48 @@ void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, prop= RNA_struct_find_property(ptr, propname); - if(!prop) { + if(!prop || RNA_property_type(prop) != PROP_ENUM) { ui_item_disabled(layout, propname); - printf("uiItemEnumR: property not found: %s\n", propname); + printf("uiItemEnumR: enum property not found: %s\n", propname); return; } uiItemFullR(layout, name, icon, ptr, prop, RNA_ENUM_VALUE, value, 0, 0, 0); } +void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, char *value) +{ + PropertyRNA *prop; + const EnumPropertyItem *item; + int ivalue, a; + + if(!ptr->data || !propname) + return; + + prop= RNA_struct_find_property(ptr, propname); + + if(!prop || RNA_property_type(prop) != PROP_ENUM) { + ui_item_disabled(layout, propname); + printf("uiItemEnumR: enum property not found: %s\n", propname); + return; + } + + RNA_property_enum_items(ptr, prop, &item, NULL); + + if(!RNA_enum_value_from_id(item, value, &ivalue)) { + ui_item_disabled(layout, propname); + printf("uiItemEnumR: enum property value not found: %s\n", value); + return; + } + + for(a=0; item[a].identifier; a++) { + if(item[a].value == ivalue) { + uiItemFullR(layout, (char*)item[a].name, item[a].icon, ptr, prop, RNA_ENUM_VALUE, ivalue, 0, 0, 0); + break; + } + } +} + void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname) { PropertyRNA *prop; diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 8f1d57b28ed..d9bc2d4d426 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -320,134 +320,6 @@ void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname #include "ED_object.h" -static void modifiers_del(bContext *C, void *ob_v, void *md_v) -{ - Scene *scene= CTX_data_scene(C); - Object *ob= ob_v; - ReportList reports; - - BKE_reports_init(&reports, RPT_STORE); - - if(ED_object_modifier_delete(&reports, ob_v, md_v)) { - WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - - ED_undo_push(C, "Delete modifier"); - } - else - uiPupMenuReports(C, &reports); - - BKE_reports_clear(&reports); -} - -static void modifiers_activate(bContext *C, void *ob_v, void *md_v) -{ - Scene *scene= CTX_data_scene(C); - Object *ob= ob_v; - - WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); -} - -static void modifiers_moveUp(bContext *C, void *ob_v, void *md_v) -{ - Scene *scene= CTX_data_scene(C); - Object *ob= ob_v; - ReportList reports; - - BKE_reports_init(&reports, RPT_STORE); - - if(ED_object_modifier_move_up(&reports, ob_v, md_v)) { - WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - - ED_undo_push(C, "Move modifier"); - } - else - uiPupMenuReports(C, &reports); - - BKE_reports_clear(&reports); -} - -static void modifiers_moveDown(bContext *C, void *ob_v, void *md_v) -{ - Scene *scene= CTX_data_scene(C); - Object *ob= ob_v; - ReportList reports; - - BKE_reports_init(&reports, RPT_STORE); - - if(ED_object_modifier_move_down(&reports, ob_v, md_v)) { - WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - - ED_undo_push(C, "Move modifier"); - } - else - uiPupMenuReports(C, &reports); - - BKE_reports_clear(&reports); -} - -static void modifiers_convertParticles(bContext *C, void *obv, void *mdv) -{ - Scene *scene= CTX_data_scene(C); - Object *ob= obv; - ReportList reports; - - BKE_reports_init(&reports, RPT_STORE); - - if(ED_object_modifier_convert(&reports, scene, obv, mdv)) { - WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - - ED_undo_push(C, "Convert particles to mesh object(s)."); - } - else - uiPupMenuReports(C, &reports); - - BKE_reports_clear(&reports); -} - -static void modifiers_applyModifier(bContext *C, void *obv, void *mdv) -{ - Scene *scene= CTX_data_scene(C); - Object *ob= obv; - ReportList reports; - - BKE_reports_init(&reports, RPT_STORE); - - if(ED_object_modifier_apply(&reports, scene, obv, mdv)) { - WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - - ED_undo_push(C, "Apply modifier"); - } - else - uiPupMenuReports(C, &reports); - - BKE_reports_clear(&reports); -} - -static void modifiers_copyModifier(bContext *C, void *ob_v, void *md_v) -{ - Scene *scene= CTX_data_scene(C); - Object *ob= ob_v; - ReportList reports; - - BKE_reports_init(&reports, RPT_STORE); - - if(ED_object_modifier_copy(&reports, ob_v, md_v)) { - WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - ED_undo_push(C, "Copy modifier"); - } - else - uiPupMenuReports(C, &reports); - - BKE_reports_clear(&reports); -} - static void modifiers_setOnCage(bContext *C, void *ob_v, void *md_v) { Scene *scene= CTX_data_scene(C); @@ -490,15 +362,7 @@ static void modifiers_convertToReal(bContext *C, void *ob_v, void *md_v) static int modifier_can_delete(ModifierData *md) { - // deletion over the deflection panel // fluid particle modifier can't be deleted here - - if(md->type==eModifierType_Fluidsim) - return 0; - if(md->type==eModifierType_Collision) - return 0; - if(md->type==eModifierType_Surface) - return 0; if(md->type == eModifierType_ParticleSystem) if(((ParticleSystemModifierData *)md)->psys->part->type == PART_FLUID) return 0; @@ -512,12 +376,12 @@ static uiLayout *draw_modifier(uiLayout *layout, Object *ob, ModifierData *md, i PointerRNA ptr; uiBut *but; uiBlock *block; - uiLayout *column, *row, *subrow, *result= NULL; - int isVirtual = md->mode&eModifierMode_Virtual; + uiLayout *column, *row, *result= NULL; + int isVirtual = md->mode & eModifierMode_Virtual; // XXX short color = md->error?TH_REDALERT:TH_BUT_NEUTRAL; - short width = 295, buttonWidth = width-120-10; char str[128]; + /* create RNA pointer */ RNA_pointer_create(&ob->id, &RNA_Modifier, md, &ptr); column= uiLayoutColumn(layout, 1); @@ -528,57 +392,57 @@ static uiLayout *draw_modifier(uiLayout *layout, Object *ob, ModifierData *md, i /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ row= uiLayoutRow(uiLayoutBox(column), 0); - block= uiLayoutGetBlock(row); + uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_EXPAND); - subrow= uiLayoutRow(row, 0); - uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_LEFT); + block= uiLayoutGetBlock(row); //uiDefBut(block, ROUNDBOX, 0, "", x-10, y-4, width, 25, NULL, 7.0, 0.0, - // (!isVirtual && (md->mode&eModifierMode_Expanded))?3:15, 20, ""); + // (!isVirtual && (md->mode & eModifierMode_Expanded))?3:15, 20, ""); /* XXX uiBlockSetCol(block, TH_AUTO); */ /* open/close icon */ - if (!isVirtual) { + if(!isVirtual) { uiBlockSetEmboss(block, UI_EMBOSSN); uiDefIconButBitI(block, ICONTOG, eModifierMode_Expanded, 0, ICON_TRIA_RIGHT, 0, 0, UI_UNIT_X, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, "Collapse/Expand Modifier"); } /* modifier-type icon */ - uiDefIconBut(block, BUT, 0, RNA_struct_ui_icon(ptr.type), 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Current Modifier Type"); + uiItemL(row, "", RNA_struct_ui_icon(ptr.type)); uiBlockSetEmboss(block, UI_EMBOSS); - if (isVirtual) { + if(isVirtual) { + /* virtual modifier */ sprintf(str, "%s parent deform", md->name); uiDefBut(block, LABEL, 0, str, 0, 0, 185, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Modifier name"); but = uiDefBut(block, BUT, 0, "Make Real", 0, 0, 80, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Convert virtual modifier to a real modifier"); uiButSetFunc(but, modifiers_convertToReal, ob, md); - } else { + } + else { + /* real modifier */ uiBlockBeginAlign(block); - uiDefBut(block, TEX, 0, "", 0, 0, buttonWidth-40, UI_UNIT_Y, md->name, 0.0, sizeof(md->name)-1, 0.0, 0.0, "Modifier name"); + uiItemR(row, "", 0, &ptr, "name", 0, 0, 0); /* Softbody not allowed in this situation, enforce! */ - if (((md->type!=eModifierType_Softbody && md->type!=eModifierType_Collision) || !(ob->pd && ob->pd->deflect)) && (md->type!=eModifierType_Surface)) { - uiDefIconButBitI(block, TOG, eModifierMode_Render, 0, ICON_SCENE, 0, 0, 19, UI_UNIT_Y,&md->mode, 0, 0, 1, 0, "Enable modifier during rendering"); - but= uiDefIconButBitI(block, TOG, eModifierMode_Realtime, 0, ICON_VIEW3D, 0, 0, 19, UI_UNIT_Y,&md->mode, 0, 0, 1, 0, "Enable modifier during interactive display"); - uiButSetFunc(but, modifiers_activate, ob, md); - if (mti->flags&eModifierTypeFlag_SupportsEditmode) { - but= uiDefIconButBitI(block, TOG, eModifierMode_Editmode, 0, ICON_EDITMODE_HLT, 0, 0, 19, UI_UNIT_Y,&md->mode, 0, 0, 1, 0, "Enable modifier during Editmode (only if enabled for display)"); - uiButSetFunc(but, modifiers_activate, ob, md); - } + if(((md->type!=eModifierType_Softbody && md->type!=eModifierType_Collision) || !(ob->pd && ob->pd->deflect)) && (md->type!=eModifierType_Surface)) { + uiItemR(row, "", ICON_SCENE, &ptr, "render", 0, 0, 0); + uiItemR(row, "", ICON_VIEW3D, &ptr, "realtime", 0, 0, 0); + + if(mti->flags & eModifierTypeFlag_SupportsEditmode) + uiItemR(row, "", ICON_VIEW3D, &ptr, "editmode", 0, 0, 0); } uiBlockEndAlign(block); /* XXX uiBlockSetEmboss(block, UI_EMBOSSR); */ - if (ob->type==OB_MESH && modifier_couldBeCage(md) && index<=lastCageIndex) { + if(ob->type==OB_MESH && modifier_couldBeCage(md) && index<=lastCageIndex) { int icon; //, color; - if (index==cageIndex) { + if(index==cageIndex) { // XXX color = TH_BUT_SETTING; icon = VICON_EDITMODE_HLT; - } else if (indexmode&eModifierMode_Expanded)) { + if(!isVirtual && (md->mode & eModifierMode_Expanded)) { + /* apply/convert/copy */ uiLayout *box; box= uiLayoutBox(column); row= uiLayoutRow(box, 1); - if (!isVirtual && (md->type!=eModifierType_Collision) && (md->type!=eModifierType_Surface)) { - uiBlockSetButLock(block, object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); /* only here obdata, the rest of modifiers is ob level */ + if(!isVirtual && (md->type!=eModifierType_Collision) && (md->type!=eModifierType_Surface)) { + /* only here obdata, the rest of modifiers is ob level */ + uiBlockSetButLock(block, object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - if (md->type==eModifierType_ParticleSystem) { + if(md->type==eModifierType_ParticleSystem) { ParticleSystem *psys= ((ParticleSystemModifierData *)md)->psys; - if(!(G.f & G_PARTICLEEDIT)) { - if(ELEM3(psys->part->draw_as, PART_DRAW_PATH, PART_DRAW_GR, PART_DRAW_OB) && psys->pathcache) { - but = uiDefBut(block, BUT, 0, "Convert", 0,0,60,19, 0, 0, 0, 0, 0, "Convert the current particles to a mesh object"); - uiButSetFunc(but, modifiers_convertParticles, ob, md); - } - } - } - else{ - but = uiDefBut(block, BUT, 0, "Apply", 0,0,60,19, 0, 0, 0, 0, 0, "Apply the current modifier and remove from the stack"); - uiButSetFunc(but, modifiers_applyModifier, ob, md); + if(!(G.f & G_PARTICLEEDIT)) + if(ELEM3(psys->part->draw_as, PART_DRAW_PATH, PART_DRAW_GR, PART_DRAW_OB) && psys->pathcache) + uiItemO(row, "Convert", 0, "OBJECT_OT_modifier_convert"); } + else + uiItemO(row, "Apply", 0, "OBJECT_OT_modifier_apply"); uiBlockClearButLock(block); uiBlockSetButLock(block, ob && ob->id.lib, ERROR_LIBDATA_MESSAGE); - if (md->type!=eModifierType_Fluidsim && md->type!=eModifierType_Softbody && md->type!=eModifierType_ParticleSystem && (md->type!=eModifierType_Cloth)) { - but = uiDefBut(block, BUT, 0, "Copy", 0,0,60,19, 0, 0, 0, 0, 0, "Duplicate the current modifier at the same position in the stack"); - uiButSetFunc(but, modifiers_copyModifier, ob, md); - } + if(!ELEM4(md->type, eModifierType_Fluidsim, eModifierType_Softbody, eModifierType_ParticleSystem, eModifierType_Cloth)) + uiItemO(row, "Copy", 0, "OBJECT_OT_modifier_copy"); } result= uiLayoutColumn(box, 0); block= uiLayoutFreeBlock(box); } - if (md->error) { + if(md->error) { row = uiLayoutRow(uiLayoutBox(column), 0); /* XXX uiBlockSetCol(block, color); */ @@ -694,7 +546,7 @@ uiLayout *uiTemplateModifier(uiLayout *layout, PointerRNA *ptr) for(i=0; vmd; i++, vmd=vmd->next) { if(md == vmd) return draw_modifier(layout, ob, md, i, cageIndex, lastCageIndex); - else if(vmd->mode&eModifierMode_Virtual) + else if(vmd->mode & eModifierMode_Virtual) i--; } diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index a52acdd4e1e..6ec5f029148 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -86,6 +86,12 @@ void GROUP_OT_objects_remove_active(struct wmOperatorType *ot); /* object_modifier.c */ void OBJECT_OT_modifier_add(struct wmOperatorType *ot); +void OBJECT_OT_modifier_remove(struct wmOperatorType *ot); +void OBJECT_OT_modifier_move_up(struct wmOperatorType *ot); +void OBJECT_OT_modifier_move_down(struct wmOperatorType *ot); +void OBJECT_OT_modifier_apply(struct wmOperatorType *ot); +void OBJECT_OT_modifier_convert(struct wmOperatorType *ot); +void OBJECT_OT_modifier_copy(struct wmOperatorType *ot); void OBJECT_OT_multires_subdivide(struct wmOperatorType *ot); void OBJECT_OT_modifier_mdef_bind(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 4bcfcc4d5ab..bda3e4e8f79 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -25,6 +25,7 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include #include #include @@ -35,6 +36,7 @@ #include "DNA_meshdata_types.h" #include "DNA_modifier_types.h" #include "DNA_object_types.h" +#include "DNA_object_force.h" #include "DNA_scene_types.h" #include "BLI_listbase.h" @@ -44,6 +46,7 @@ #include "BKE_depsgraph.h" #include "BKE_displist.h" #include "BKE_DerivedMesh.h" +#include "BKE_effect.h" #include "BKE_global.h" #include "BKE_lattice.h" #include "BKE_mesh.h" @@ -52,6 +55,7 @@ #include "BKE_report.h" #include "BKE_object.h" #include "BKE_particle.h" +#include "BKE_softbody.h" #include "BKE_utildefines.h" #include "RNA_access.h" @@ -67,31 +71,97 @@ /******************************** API ****************************/ -int ED_object_modifier_delete(ReportList *reports, Object *ob, ModifierData *md) +int ED_object_modifier_add(ReportList *reports, Scene *scene, Object *ob, int type) +{ + ModifierData *md; + ModifierTypeInfo *mti = modifierType_getInfo(type); + + if(mti->flags&eModifierTypeFlag_Single) { + if(modifiers_findByType(ob, type)) { + BKE_report(reports, RPT_WARNING, "Only one modifier of this type allowed."); + return 0; + } + } + + if(mti->flags&eModifierTypeFlag_RequiresOriginalData) { + md = ob->modifiers.first; + + while(md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform) + md = md->next; + + BLI_insertlinkbefore(&ob->modifiers, md, modifier_new(type)); + } + else + BLI_addtail(&ob->modifiers, modifier_new(type)); + + /* special cases */ + if(type == eModifierType_Softbody) { + if(!ob->soft) { + ob->soft= sbNew(scene); + ob->softflag |= OB_SB_GOAL|OB_SB_EDGES; + } + } + else if(type == eModifierType_Collision) { + if(!ob->pd) + ob->pd= object_add_collision_fields(); + + ob->pd->deflect= 1; + DAG_scene_sort(scene); + } + else if(type == eModifierType_Surface) + DAG_scene_sort(scene); + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + + return 1; +} + +int ED_object_modifier_remove(ReportList *reports, Scene *scene, Object *ob, ModifierData *md) { ModifierData *obmd; /* It seems on rapid delete it is possible to * get called twice on same modifier, so make * sure it is in list. */ - for (obmd=ob->modifiers.first; obmd; obmd=obmd->next) - if (obmd==md) + for(obmd=ob->modifiers.first; obmd; obmd=obmd->next) + if(obmd==md) break; - if (!obmd) + if(!obmd) return 0; + /* special cases */ if(md->type == eModifierType_ParticleSystem) { ParticleSystemModifierData *psmd=(ParticleSystemModifierData*)md; BLI_remlink(&ob->particlesystem, psmd->psys); psys_free(ob, psmd->psys); } + else if(md->type == eModifierType_Softbody) { + if(ob->soft) { + sbFree(ob->soft); + ob->soft= NULL; + ob->softflag= 0; + } + } + else if(md->type == eModifierType_Collision) { + if(ob->pd) + ob->pd->deflect= 0; - BLI_remlink(&ob->modifiers, md); + DAG_scene_sort(scene); + } + else if(md->type == eModifierType_Surface) { + if(ob->pd) + ob->pd->flag &= ~PFIELD_SURFACE; + DAG_scene_sort(scene); + } + + BLI_remlink(&ob->modifiers, md); modifier_free(md); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + return 1; } @@ -103,9 +173,10 @@ int ED_object_modifier_move_up(ReportList *reports, Object *ob, ModifierData *md if(mti->type!=eModifierTypeType_OnlyDeform) { ModifierTypeInfo *nmti = modifierType_getInfo(md->prev->type); - if(nmti->flags&eModifierTypeFlag_RequiresOriginalData) + if(nmti->flags&eModifierTypeFlag_RequiresOriginalData) { BKE_report(reports, RPT_WARNING, "Cannot move above a modifier requiring original data."); return 0; + } } BLI_remlink(&ob->modifiers, md); @@ -329,22 +400,11 @@ static int modifier_add_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob = CTX_data_active_object(C); - ModifierData *md; int type= RNA_enum_get(op->ptr, "type"); - ModifierTypeInfo *mti = modifierType_getInfo(type); - if(mti->flags&eModifierTypeFlag_RequiresOriginalData) { - md = ob->modifiers.first; + if(!ED_object_modifier_add(op->reports, scene, ob, type)) + return OPERATOR_CANCELLED; - while(md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform) - md = md->next; - - BLI_insertlinkbefore(&ob->modifiers, md, modifier_new(type)); - } - else - BLI_addtail(&ob->modifiers, modifier_new(type)); - - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -370,13 +430,198 @@ void OBJECT_OT_modifier_add(wmOperatorType *ot) RNA_def_enum(ot->srna, "type", modifier_type_items, 0, "Type", ""); } +/************************ remove modifier operator *********************/ + +static int modifier_remove_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier); + Object *ob= ptr.id.data; + ModifierData *md= ptr.data; + + if(!ob || !md || !ED_object_modifier_remove(op->reports, scene, ob, md)) + return OPERATOR_CANCELLED; + + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_modifier_remove(wmOperatorType *ot) +{ + ot->name= "Remove Modifier"; + ot->description= "Remove a modifier from the active object."; + ot->idname= "OBJECT_OT_modifier_remove"; + ot->poll= ED_operator_object_active; + + ot->exec= modifier_remove_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/************************ move up modifier operator *********************/ + +static int modifier_move_up_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier); + Object *ob= ptr.id.data; + ModifierData *md= ptr.data; + + if(!ob || !md || !ED_object_modifier_move_up(op->reports, ob, md)) + return OPERATOR_CANCELLED; + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_modifier_move_up(wmOperatorType *ot) +{ + ot->name= "Move Up Modifier"; + ot->description= "Move modifier up in the stack."; + ot->idname= "OBJECT_OT_modifier_move_up"; + ot->poll= ED_operator_object_active; + + ot->exec= modifier_move_up_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/************************ move down modifier operator *********************/ + +static int modifier_move_down_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier); + Object *ob= ptr.id.data; + ModifierData *md= ptr.data; + + if(!ob || !md || !ED_object_modifier_move_down(op->reports, ob, md)) + return OPERATOR_CANCELLED; + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_modifier_move_down(wmOperatorType *ot) +{ + ot->name= "Move Down Modifier"; + ot->description= "Move modifier down in the stack."; + ot->idname= "OBJECT_OT_modifier_move_down"; + ot->poll= ED_operator_object_active; + + ot->exec= modifier_move_down_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/************************ apply modifier operator *********************/ + +static int modifier_apply_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier); + Object *ob= ptr.id.data; + ModifierData *md= ptr.data; + + if(!ob || !md || !ED_object_modifier_apply(op->reports, scene, ob, md)) + return OPERATOR_CANCELLED; + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_modifier_apply(wmOperatorType *ot) +{ + ot->name= "Apply Modifier"; + ot->description= "Apply modifier and remove from the stack."; + ot->idname= "OBJECT_OT_modifier_apply"; + ot->poll= ED_operator_object_active; + + ot->exec= modifier_apply_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/************************ convert modifier operator *********************/ + +static int modifier_convert_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier); + Object *ob= ptr.id.data; + ModifierData *md= ptr.data; + + if(!ob || !md || !ED_object_modifier_convert(op->reports, scene, ob, md)) + return OPERATOR_CANCELLED; + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_modifier_convert(wmOperatorType *ot) +{ + ot->name= "Convert Modifier"; + ot->description= "Convert particles to a mesh object."; + ot->idname= "OBJECT_OT_modifier_convert"; + ot->poll= ED_operator_object_active; + + ot->exec= modifier_convert_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/************************ copy modifier operator *********************/ + +static int modifier_copy_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier); + Object *ob= ptr.id.data; + ModifierData *md= ptr.data; + + if(!ob || !md || !ED_object_modifier_copy(op->reports, ob, md)) + return OPERATOR_CANCELLED; + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_modifier_copy(wmOperatorType *ot) +{ + ot->name= "Copy Modifier"; + ot->description= "Duplicate modifier at the same position in the stack."; + ot->idname= "OBJECT_OT_modifier_copy"; + ot->poll= ED_operator_object_active; + + ot->exec= modifier_copy_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /****************** multires subdivide operator *********************/ static int multires_subdivide_exec(bContext *C, wmOperator *op) { - Object *ob = CTX_data_active_object(C); - PointerRNA ptr = CTX_data_pointer_get(C, "modifier"); - MultiresModifierData *mmd = (RNA_struct_is_a(ptr.type, &RNA_Modifier))? ptr.data: NULL; + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_MultiresModifier); + Object *ob= ptr.id.data; + MultiresModifierData *mmd= ptr.data; if(mmd) { multiresModifier_subdivide(mmd, ob, 1, 0, mmd->simple); @@ -403,8 +648,7 @@ void OBJECT_OT_multires_subdivide(wmOperatorType *ot) static int modifier_mdef_bind_poll(bContext *C) { - PointerRNA ptr= CTX_data_pointer_get(C, "modifier"); - return RNA_struct_is_a(ptr.type, &RNA_MeshDeformModifier); + return CTX_data_pointer_get_type(C, "modifier", &RNA_MeshDeformModifier).data != NULL; } static int modifier_mdef_bind_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 6fa78a53840..6248d826ad4 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -100,6 +100,12 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_primitive_add); WM_operatortype_append(OBJECT_OT_modifier_add); + WM_operatortype_append(OBJECT_OT_modifier_remove); + WM_operatortype_append(OBJECT_OT_modifier_move_up); + WM_operatortype_append(OBJECT_OT_modifier_move_down); + WM_operatortype_append(OBJECT_OT_modifier_apply); + WM_operatortype_append(OBJECT_OT_modifier_convert); + WM_operatortype_append(OBJECT_OT_modifier_copy); WM_operatortype_append(OBJECT_OT_multires_subdivide); WM_operatortype_append(OBJECT_OT_modifier_mdef_bind); diff --git a/source/blender/editors/physics/ed_fluidsim.c b/source/blender/editors/physics/ed_fluidsim.c index 215a72d6927..3990521bd1b 100644 --- a/source/blender/editors/physics/ed_fluidsim.c +++ b/source/blender/editors/physics/ed_fluidsim.c @@ -67,18 +67,19 @@ #include "BKE_blender.h" #include "BKE_context.h" #include "BKE_customdata.h" +#include "BKE_DerivedMesh.h" #include "BKE_displist.h" #include "BKE_effect.h" #include "BKE_fluidsim.h" #include "BKE_global.h" -#include "BKE_modifier.h" -#include "BKE_main.h" +#include "BKE_ipo.h" #include "BKE_key.h" -#include "BKE_scene.h" +#include "BKE_main.h" +#include "BKE_modifier.h" #include "BKE_object.h" +#include "BKE_report.h" +#include "BKE_scene.h" #include "BKE_softbody.h" -#include "BKE_DerivedMesh.h" -#include "BKE_ipo.h" #include "PIL_time.h" @@ -89,6 +90,9 @@ #include "ED_fluidsim.h" #include "ED_screen.h" +#include "WM_api.h" +#include "WM_types.h" + /* XXX */ /* from header info.c */ static int start_progress_bar(void) {return 0;}; @@ -124,7 +128,7 @@ char* fluidsimViscosityPresetString[6] = { /* ********************** fluid sim settings struct functions ********************** */ /* helper function */ -void fluidsimGetGeometryObjFilename(struct Object *ob, char *dst) { //, char *srcname) { +void fluidsimGetGeometryObjFilename(Object *ob, char *dst) { //, char *srcname) { //snprintf(dst,FILE_MAXFILE, "%s_cfgdata_%s.bobj.gz", srcname, ob->id.name); snprintf(dst,FILE_MAXFILE, "fluidcfgdata_%s.bobj.gz", ob->id.name); } @@ -337,14 +341,14 @@ int runSimulationCallback(void *data, int status, int frame) { /* ********************** write fluidsim config to file ************************* */ /* ******************************************************************************** */ -void fluidsimBake(bContext *C, struct Object *ob) +int fluidsimBake(bContext *C, ReportList *reports, Object *ob) { Scene *scene= CTX_data_scene(C); FILE *fileCfg; int i; - struct Object *fsDomain = NULL; + Object *fsDomain = NULL; FluidsimSettings *domainSettings; - struct Object *obit = NULL; /* object iterator */ + Object *obit = NULL; /* object iterator */ Base *base; int origFrame = scene->r.cfra; char debugStrBuffer[256]; @@ -412,8 +416,8 @@ void fluidsimBake(bContext *C, struct Object *ob) // old: noFrames = scene->r.efra - scene->r.sfra +1; noFrames = scene->r.efra - 0; if(noFrames<=0) { - pupmenu("Fluidsim Bake Error%t|No frames to export - check your animation range settings. Aborted%x0"); - return; + BKE_report(reports, RPT_ERROR, "No frames to export - check your animation range settings."); + return 0; } /* no object pointer, find in selected ones.. */ @@ -434,7 +438,7 @@ void fluidsimBake(bContext *C, struct Object *ob) } } // no domains found? - if(!ob) return; + if(!ob) return 0; } channelObjCount = 0; @@ -452,8 +456,8 @@ void fluidsimBake(bContext *C, struct Object *ob) } if (channelObjCount>=255) { - pupmenu("Fluidsim Bake Error%t|Cannot bake with more then 256 objects"); - return; + BKE_report(reports, RPT_ERROR, "Cannot bake with more then 256 objects."); + return 0; } /* check if there's another domain... */ @@ -467,8 +471,8 @@ void fluidsimBake(bContext *C, struct Object *ob) { if(obit != ob) { - pupmenu("Fluidsim Bake Error%t|There should be only one domain object! Aborted%x0"); - return; + BKE_report(reports, RPT_ERROR, "There should be only one domain object."); + return 0; } } } @@ -490,8 +494,8 @@ void fluidsimBake(bContext *C, struct Object *ob) } } if(!haveSomeFluid) { - pupmenu("Fluidsim Bake Error%t|No fluid objects in scene... Aborted%x0"); - return; + BKE_report(reports, RPT_ERROR, "No fluid objects in scene."); + return 0; } /* these both have to be valid, otherwise we wouldnt be here */ @@ -585,7 +589,7 @@ void fluidsimBake(bContext *C, struct Object *ob) // ask user if thats what he/she wants... selection = pupmenu(dispmsg); - if(selection<1) return; // 0 from menu, or -1 aborted + if(selection<1) return 0; // 0 from menu, or -1 aborted strcpy(targetDir, newSurfdataPath); strncpy(domainSettings->surfdataPath, newSurfdataPath, FILE_MAXDIR); BLI_convertstringcode(targetDir, G.sce); // fixed #frame-no @@ -710,6 +714,10 @@ void fluidsimBake(bContext *C, struct Object *ob) // check & init loc,rot,size for(j=0; j<3; j++) { for(k=0; k<3; k++) { + // XXX prevent invalid memory access until this works + icuex[j][k]= NULL; + icudex[j][k]= NULL; + // XXX icuex[j][k] = find_ipocurve(obit->ipo, icuIds[j][k] ); // XXX icudex[j][k] = find_ipocurve(obit->ipo, icudIds[j][k] ); // XXX lines below were already disabled! @@ -812,12 +820,12 @@ void fluidsimBake(bContext *C, struct Object *ob) if(!Mat4Invert(invDomMat, domainMat)) { snprintf(debugStrBuffer,256,"fluidsimBake::error - Invalid obj matrix?\n"); elbeemDebugOut(debugStrBuffer); + BKE_report(reports, RPT_ERROR, "Invalid object matrix."); // FIXME add fatal msg FS_FREE_CHANNELS; - return; + return 0; } - // -------------------------------------------------------------------------------------------- // start writing / exporting strcpy(targetFile, targetDir); @@ -1001,7 +1009,6 @@ void fluidsimBake(bContext *C, struct Object *ob) } // valid mesh } // objects //domainSettings->type = OB_FLUIDSIM_DOMAIN; // enable for bake display again - //fsDomain->fluidsimFlag = OB_FLUIDSIM_ENABLE; // disable during bake // set to neutral, -1 means user abort, -2 means init error globalBakeState = 0; @@ -1080,7 +1087,7 @@ void fluidsimBake(bContext *C, struct Object *ob) // -------------------------------------------------------------------------------------------- else { // write config file to be run with command line simulator - pupmenu("Fluidsim Bake Message%t|Config file export not supported.%x0"); + BKE_report(reports, RPT_WARNING, "Config file export not supported."); } // config file export done! // -------------------------------------------------------------------------------------------- @@ -1099,51 +1106,81 @@ void fluidsimBake(bContext *C, struct Object *ob) ED_update_for_newframe(C, 1); if(!simAborted) { - char fsmessage[512]; char elbeemerr[256]; - strcpy(fsmessage,"Fluidsim Bake Error: "); + // check if some error occurred if(globalBakeState==-2) { - strcat(fsmessage,"Failed to initialize [Msg: "); - elbeemGetErrorString(elbeemerr); - strcat(fsmessage,elbeemerr); - - strcat(fsmessage,"] |OK%x0"); - pupmenu(fsmessage); + BKE_reportf(reports, RPT_ERROR, "Failed to initialize [Msg: %s]", elbeemerr); + return 0; } // init error } // elbeemFree(); + return 1; } -void fluidsimFreeBake(struct Object *ob) +void fluidsimFreeBake(Object *ob) { /* not implemented yet */ } - #else /* DISABLE_ELBEEM */ /* compile dummy functions for disabled fluid sim */ -FluidsimSettings *fluidsimSettingsNew(struct Object *srcob) { +FluidsimSettings *fluidsimSettingsNew(Object *srcob) +{ return NULL; } -void fluidsimSettingsFree(FluidsimSettings *fss) { +void fluidsimSettingsFree(FluidsimSettings *fss) +{ } -FluidsimSettings* fluidsimSettingsCopy(FluidsimSettings *fss) { +FluidsimSettings* fluidsimSettingsCopy(FluidsimSettings *fss) +{ return NULL; } /* only compile dummy functions */ -void fluidsimBake(bContext *C, struct Object *ob) { +int fluidsimBake(bContext *C, ReportList *reports, Object *ob) +{ + return 0; } -void fluidsimFreeBake(struct Object *ob) { +void fluidsimFreeBake(Object *ob) +{ } #endif /* DISABLE_ELBEEM */ +/***************************** Operators ******************************/ + +static int fluid_bake_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_active_object(C); + + // XXX TODO redraw, escape, non-blocking, .. + if(!fluidsimBake(C, op->reports, ob)) + return OPERATOR_CANCELLED; + + return OPERATOR_FINISHED; +} + +void FLUID_OT_bake(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Fluid Simulation Bake"; + ot->idname= "FLUID_OT_bake"; + + /* api callbacks */ + ot->exec= fluid_bake_exec; + ot->poll= ED_operator_object_active; +} + +void ED_operatortypes_fluid(void) +{ + WM_operatortype_append(FLUID_OT_bake); +} + diff --git a/source/blender/editors/physics/ed_pointcache.c b/source/blender/editors/physics/ed_pointcache.c index 893c59a521d..edd668b46bb 100644 --- a/source/blender/editors/physics/ed_pointcache.c +++ b/source/blender/editors/physics/ed_pointcache.c @@ -45,7 +45,7 @@ #include "BLI_blenlib.h" #include "ED_screen.h" -#include "ED_pointcache.h" +#include "ED_physics.h" #include "UI_interface.h" #include "UI_resources.h" diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 510103895f4..c8df9bb9741 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -42,15 +42,15 @@ #include "ED_anim_api.h" #include "ED_armature.h" #include "ED_curve.h" -#include "ED_mesh.h" #include "ED_markers.h" +#include "ED_mesh.h" #include "ED_object.h" #include "ED_particle.h" -#include "ED_sculpt.h" +#include "ED_physics.h" #include "ED_screen.h" +#include "ED_sculpt.h" #include "ED_space_api.h" #include "ED_uvedit.h" -#include "ED_pointcache.h" /* only call once on startup, storage is global in BKE kernel listbase */ void ED_spacetypes_init(void) @@ -89,8 +89,9 @@ void ED_spacetypes_init(void) ED_operatortypes_particle(); ED_operatortypes_curve(); ED_operatortypes_armature(); - ED_marker_operatortypes(); + ED_operatortypes_marker(); ED_operatortypes_pointcache(); + ED_operatortypes_fluid(); ui_view2d_operatortypes(); diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 01794d1bba8..02179f347f5 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -497,7 +497,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r "world", "object", "meshe", "armature", "lattice", "curve", "meta_ball", "lamp", "camera", "material", "material_slot", "texture", "texture_slot", "bone", "edit_bone", "particle_system", - "cloth", "soft_body", "fluid", NULL}; + "cloth", "soft_body", "fluid", "collision", NULL}; CTX_data_dir_set(result, dir); return 1; @@ -615,7 +615,8 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r if(ptr && ptr->data) { Object *ob= ptr->data; - CTX_data_pointer_set(result, &ob->id, &RNA_SoftBodySettings, ob->soft); + ModifierData *md= modifiers_findByType(ob, eModifierType_Softbody); + CTX_data_pointer_set(result, &ob->id, &RNA_SoftBodyModifier, md); return 1; } } @@ -629,6 +630,16 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r return 1; } } + else if(CTX_data_equals(member, "collision")) { + PointerRNA *ptr= get_pointer_type(path, &RNA_Object); + + if(ptr && ptr->data) { + Object *ob= ptr->data; + ModifierData *md= modifiers_findByType(ob, eModifierType_Collision); + CTX_data_pointer_set(result, &ob->id, &RNA_CollisionModifier, md); + return 1; + } + } return 0; } diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index df3e8c62d37..2bc3bdaa613 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -41,6 +41,7 @@ #include "BKE_depsgraph.h" #include "BKE_font.h" #include "BKE_library.h" +#include "BKE_main.h" #include "BKE_material.h" #include "BKE_particle.h" #include "BKE_texture.h" @@ -471,6 +472,7 @@ void OBJECT_OT_particle_system_remove(wmOperatorType *ot) static int new_particle_settings_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); + Main *bmain= CTX_data_main(C); ParticleSettings *part= CTX_data_pointer_get_type(C, "particle_settings", &RNA_ParticleSettings).data; Object *ob; PointerRNA ptr; @@ -479,7 +481,7 @@ static int new_particle_settings_exec(bContext *C, wmOperator *op) if(part) part= psys_copy_settings(part); else - part= psys_new_settings("PSys", NULL); + part= psys_new_settings("PSys", bmain); /* attempt to assign to material slot */ ptr= CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); diff --git a/source/blender/makesdna/DNA_object_fluidsim.h b/source/blender/makesdna/DNA_object_fluidsim.h index 66c5baab84b..09288b24c20 100644 --- a/source/blender/makesdna/DNA_object_fluidsim.h +++ b/source/blender/makesdna/DNA_object_fluidsim.h @@ -135,12 +135,12 @@ typedef struct FluidsimSettings { /* ob->fluidsimSettings defines */ #define OB_FLUIDSIM_ENABLE 1 #define OB_FLUIDSIM_DOMAIN 2 -#define OB_FLUIDSIM_FLUID 4 +#define OB_FLUIDSIM_FLUID 4 #define OB_FLUIDSIM_OBSTACLE 8 -#define OB_FLUIDSIM_INFLOW 16 -#define OB_FLUIDSIM_OUTFLOW 32 -#define OB_FLUIDSIM_PARTICLE 64 -#define OB_FLUIDSIM_CONTROL 128 +#define OB_FLUIDSIM_INFLOW 16 +#define OB_FLUIDSIM_OUTFLOW 32 +#define OB_FLUIDSIM_PARTICLE 64 +#define OB_FLUIDSIM_CONTROL 128 #define OB_TYPEFLAG_START 7 #define OB_FSGEO_THIN (1<<(OB_TYPEFLAG_START+1)) diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 88d9894cf7a..32bfc58f56c 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -271,7 +271,7 @@ typedef struct SoftBody { #define PTCACHE_REDO_NEEDED 258 /* ob->softflag */ -#define OB_SB_ENABLE 1 +#define OB_SB_ENABLE 1 /* deprecated, use modifier */ #define OB_SB_GOAL 2 #define OB_SB_EDGES 4 #define OB_SB_QUADS 8 diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index d69439e25bc..e145722428c 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -360,7 +360,7 @@ extern StructRNA RNA_ShrinkwrapModifier; extern StructRNA RNA_SimpleDeformModifier; extern StructRNA RNA_SmoothModifier; extern StructRNA RNA_SoftBodySettings; -extern StructRNA RNA_SoftbodyModifier; +extern StructRNA RNA_SoftBodyModifier; extern StructRNA RNA_Sound; extern StructRNA RNA_SoundSequence; extern StructRNA RNA_Space; @@ -381,6 +381,7 @@ extern StructRNA RNA_StucciTexture; extern StructRNA RNA_SubsurfModifier; extern StructRNA RNA_SunLamp; extern StructRNA RNA_SurfaceCurve; +extern StructRNA RNA_SurfaceModifier; extern StructRNA RNA_TexMapping; extern StructRNA RNA_Text; extern StructRNA RNA_TextBox; diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index 4e047ff7772..4316666700f 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -31,8 +31,23 @@ #include "DNA_object_fluidsim.h" +#include "WM_api.h" +#include "WM_types.h" + #ifdef RNA_RUNTIME +#include "MEM_guardedalloc.h" + +#include "DNA_scene_types.h" +#include "DNA_particle_types.h" + +#include "BKE_depsgraph.h" +#include "BKE_fluidsim.h" +#include "BKE_main.h" +#include "BKE_modifier.h" +#include "BKE_particle.h" +#include "BKE_pointcache.h" + static StructRNA* rna_FluidSettings_refine(struct PointerRNA *ptr) { FluidsimSettings *fss= (FluidsimSettings*)ptr->data; @@ -57,6 +72,75 @@ static StructRNA* rna_FluidSettings_refine(struct PointerRNA *ptr) } } +static void rna_FluidSettings_update_type(bContext *C, PointerRNA *ptr) +{ + Main *bmain= CTX_data_main(C); + Scene *scene= CTX_data_scene(C); + Object *ob= (Object*)ptr->id.data; + FluidsimModifierData *fluidmd; + ParticleSystemModifierData *psmd; + ParticleSystem *psys; + ParticleSettings *part; + + fluidmd= (FluidsimModifierData*)modifiers_findByType(ob, eModifierType_Fluidsim); + fluidmd->fss->flag &= ~OB_FLUIDSIM_REVERSE; // clear flag + + /* remove fluidsim particle system */ + if(fluidmd->fss->type & OB_FLUIDSIM_PARTICLE) { + for(psys=ob->particlesystem.first; psys; psys=psys->next) + if(psys->part->type == PART_FLUID) + break; + + if(ob->type == OB_MESH && !psys) { + /* add particle system */ + part= psys_new_settings("PSys", bmain); + psys= MEM_callocN(sizeof(ParticleSystem), "particle_system"); + + part->type= PART_FLUID; + psys->part= part; + psys->pointcache= BKE_ptcache_add(); + psys->flag |= PSYS_ENABLED; + BLI_addtail(&ob->particlesystem,psys); + + /* add modifier */ + psmd= (ParticleSystemModifierData*)modifier_new(eModifierType_ParticleSystem); + sprintf(psmd->modifier.name, "FluidParticleSystem" ); + psmd->psys= psys; + BLI_addtail(&ob->modifiers, psmd); + } + } + else { + for(psys=ob->particlesystem.first; psys; psys=psys->next) { + if(psys->part->type == PART_FLUID) { + /* clear modifier */ + psmd= psys_get_modifier(ob, psys); + BLI_remlink(&ob->modifiers, psmd); + modifier_free((ModifierData *)psmd); + + /* clear particle system */ + BLI_remlink(&ob->particlesystem, psys); + psys_free(ob, psys); + } + } + } + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); +} + +static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *value) +{ + Object *ob= (Object*)ptr->id.data; + FluidsimSettings *fss= (FluidsimSettings*)ptr->data; + + fluid_estimate_memory(ob, fss, value); +} + +static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *ptr) +{ + return 32; +} + #else static void rna_def_fluidsim_slip(StructRNA *srna) @@ -128,6 +212,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "guiDisplayMode"); RNA_def_property_enum_items(prop, quality_items); RNA_def_property_ui_text(prop, "Viewport Display Mode", "How to display the mesh in the viewport."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "render_display_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "renderDisplayMode"); @@ -142,6 +227,12 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) RNA_def_property_string_maxlength(prop, 240); RNA_def_property_string_sdna(prop, NULL, "surfdataPath"); RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store baked fluid simulation files in."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + + prop= RNA_def_property(srna, "memory_estimate", PROP_STRING, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_string_funcs(prop, "rna_DomainFluidSettings_memory_estimate_get", "rna_DomainFluidSettings_memory_estimate_length", NULL); + RNA_def_property_ui_text(prop, "Memory Estimate", "Estimated amount of memory needed for baking the domain."); /* advanced settings */ @@ -336,6 +427,7 @@ static void rna_def_fluidsim_particle(BlenderRNA *brna) RNA_def_property_string_maxlength(prop, 240); RNA_def_property_string_sdna(prop, NULL, "surfdataPath"); RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store and load particles from."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); } static void rna_def_fluidsim_control(BlenderRNA *brna) @@ -393,7 +485,7 @@ void RNA_def_fluidsim(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_fluid_type_items[] = { - {0, "NONE", 0, "None", ""}, + {OB_FLUIDSIM_ENABLE, "NONE", 0, "None", ""}, {OB_FLUIDSIM_DOMAIN, "DOMAIN", 0, "Domain", "Bounding box of this object represents the computational domain of the fluid simulation."}, {OB_FLUIDSIM_FLUID, "FLUID", 0, "Fluid", "Object represents a volume of fluid in the simulation."}, {OB_FLUIDSIM_OBSTACLE, "OBSTACLE", 0, "Obstacle", "Object is a fixed obstacle."}, @@ -409,18 +501,11 @@ void RNA_def_fluidsim(BlenderRNA *brna) RNA_def_struct_refine_func(srna, "rna_FluidSettings_refine"); RNA_def_struct_ui_text(srna, "Fluid Simulation Settings", "Fluid simulation settings for an object taking part in the simulation."); - /* enable and type */ - - prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "type", OB_FLUIDSIM_ENABLE); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); // needs to create modifier - RNA_def_property_ui_text(prop, "Enabled", "Sets object to participate in fluid simulation."); - prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_fluid_type_items); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); // needs to update variables RNA_def_property_ui_text(prop, "Type", "Type of participation in the fluid simulation."); + RNA_def_property_update(prop, 0, "rna_FluidSettings_update_type"); //prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE); //RNA_def_property_ui_text(prop, "Ipo Curves", "Ipo curves used by fluid simulation settings."); diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 3d66682771d..084d05db51e 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -185,6 +185,9 @@ void rna_object_vgroup_name_set(struct PointerRNA *ptr, const char *value, char void rna_object_uvlayer_name_set(struct PointerRNA *ptr, const char *value, char *result, int maxlen); void rna_object_vcollayer_name_set(struct PointerRNA *ptr, const char *value, char *result, int maxlen); +void rna_Object_update(struct bContext *C, struct PointerRNA *ptr); +void rna_Object_update_data(struct bContext *C, struct PointerRNA *ptr); + /* API functions */ void RNA_api_main(struct StructRNA *srna); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 9b3ff6e74a0..48bfdf70171 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -66,8 +66,9 @@ EnumPropertyItem modifier_type_items[] ={ {eModifierType_Shrinkwrap, "SHRINKWRAP", ICON_MOD_SHRINKWRAP, "Shrinkwrap", ""}, {eModifierType_SimpleDeform, "SIMPLE_DEFORM", ICON_MOD_SIMPLEDEFORM, "Simple Deform", ""}, {eModifierType_Smooth, "SMOOTH", ICON_MOD_SMOOTH, "Smooth", ""}, - {eModifierType_Softbody, "SOFTBODY", ICON_MOD_SOFT, "Softbody", ""}, + {eModifierType_Softbody, "SOFTBODY", ICON_MOD_SOFT, "Soft Body", ""}, {eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subsurf", ""}, + {eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""}, {eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""}, {eModifierType_Wave, "WAVE", ICON_MOD_WAVE, "Wave", ""}, {0, NULL, 0, NULL, NULL}}; @@ -109,7 +110,7 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr) case eModifierType_Hook: return &RNA_HookModifier; case eModifierType_Softbody: - return &RNA_SoftbodyModifier; + return &RNA_SoftBodyModifier; case eModifierType_Boolean: return &RNA_BooleanModifier; case eModifierType_Array: @@ -148,6 +149,8 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr) return &RNA_SimpleDeformModifier; case eModifierType_Multires: return &RNA_MultiresModifier; + case eModifierType_Surface: + return &RNA_SurfaceModifier; default: return &RNA_Modifier; } @@ -348,6 +351,18 @@ static void rna_ArrayModifier_curve_set(PointerRNA *ptr, PointerRNA value) modifier_object_set(&((ArrayModifierData*)ptr->data)->curve_ob, OB_CURVE, value); } +static PointerRNA rna_SoftBodyModifier_settings_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + return rna_pointer_inherit_refine(ptr, &RNA_SoftBodySettings, ob->soft); +} + +static PointerRNA rna_CollisionModifier_settings_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd); +} + #else static void rna_def_property_subdivision_common(StructRNA *srna, const char type[]) @@ -831,11 +846,17 @@ static void rna_def_modifier_hook(BlenderRNA *brna) static void rna_def_modifier_softbody(BlenderRNA *brna) { StructRNA *srna; + PropertyRNA *prop; - srna= RNA_def_struct(brna, "SoftbodyModifier", "Modifier"); - RNA_def_struct_ui_text(srna, "Softbody Modifier", "Softbody simulation modifier."); + srna= RNA_def_struct(brna, "SoftBodyModifier", "Modifier"); + RNA_def_struct_ui_text(srna, "Soft Body Modifier", "Soft body simulation modifier."); RNA_def_struct_sdna(srna, "SoftbodyModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_SOFT); + + prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_struct_type(prop, "SoftBodySettings"); + RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_settings_get", NULL, NULL); + RNA_def_property_ui_text(prop, "Soft Body Settings", ""); } static void rna_def_modifier_boolean(BlenderRNA *brna) @@ -1398,6 +1419,11 @@ static void rna_def_modifier_collision(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Collision Modifier", "Collision modifier defining modifier stack position used for collision."); RNA_def_struct_sdna(srna, "CollisionModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_PHYSICS); + + prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_struct_type(prop, "CollisionSettings"); + RNA_def_property_pointer_funcs(prop, "rna_CollisionModifier_settings_get", NULL, NULL); + RNA_def_property_ui_text(prop, "Settings", ""); prop= RNA_def_property(srna, "absorption", PROP_INT, PROP_PERCENTAGE); RNA_def_property_int_sdna(prop, NULL, "absorption"); @@ -1672,6 +1698,16 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); } +static void rna_def_modifier_surface(BlenderRNA *brna) +{ + StructRNA *srna; + + srna= RNA_def_struct(brna, "SurfaceModifier", "Modifier"); + RNA_def_struct_ui_text(srna, "Surface Modifier", "Surface modifier defining modifier stack position used for surface fields."); + RNA_def_struct_sdna(srna, "SurfaceModifierData"); + RNA_def_struct_ui_icon(srna, ICON_MOD_PHYSICS); +} + void RNA_def_modifier(BlenderRNA *brna) { StructRNA *srna; @@ -1701,15 +1737,18 @@ void RNA_def_modifier(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Realtime); RNA_def_property_ui_text(prop, "Realtime", "Realtime display of a modifier."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_ui_icon(prop, ICON_VIEW3D, 0); prop= RNA_def_property(srna, "render", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Render); RNA_def_property_ui_text(prop, "Render", "Use modifier during rendering."); + RNA_def_property_ui_icon(prop, ICON_SCENE, 0); prop= RNA_def_property(srna, "editmode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Editmode); RNA_def_property_ui_text(prop, "Editmode", "Use modifier while in the edit mode."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0); prop= RNA_def_property(srna, "on_cage", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_OnCage); @@ -1751,6 +1790,7 @@ void RNA_def_modifier(BlenderRNA *brna) rna_def_modifier_mask(brna); rna_def_modifier_simpledeform(brna); rna_def_modifier_multires(brna); + rna_def_modifier_surface(brna); } #endif diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 947846f8d8d..bf2a2c0ba40 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -48,17 +48,18 @@ #include "BKE_context.h" #include "BKE_curve.h" #include "BKE_depsgraph.h" +#include "BKE_effect.h" #include "BKE_key.h" #include "BKE_material.h" #include "BKE_mesh.h" #include "BKE_particle.h" -static void rna_Object_update(bContext *C, PointerRNA *ptr) +void rna_Object_update(bContext *C, PointerRNA *ptr) { DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_OB); } -static void rna_Object_update_data(bContext *C, PointerRNA *ptr) +void rna_Object_update_data(bContext *C, PointerRNA *ptr) { DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_DATA); } @@ -456,6 +457,28 @@ static void rna_Object_shape_key_lock_set(PointerRNA *ptr, int value) ob->shapeflag &= ~OB_SHAPE_TEMPLOCK; } +static PointerRNA rna_Object_field_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + + /* weak */ + if(!ob->pd) + ob->pd= object_add_collision_fields(); + + return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, ob->pd); +} + +static PointerRNA rna_Object_collision_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + + /* weak */ + if(!ob->pd) + ob->pd= object_add_collision_fields(); + + return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd); +} + #else static void rna_def_vertex_group(BlenderRNA *brna) @@ -1006,11 +1029,13 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "field", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "pd"); RNA_def_property_struct_type(prop, "FieldSettings"); + RNA_def_property_pointer_funcs(prop, "rna_Object_field_get", NULL, NULL); RNA_def_property_ui_text(prop, "Field Settings", "Settings for using the objects as a field in physics simulation."); prop= RNA_def_property(srna, "collision", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "pd"); RNA_def_property_struct_type(prop, "CollisionSettings"); + RNA_def_property_pointer_funcs(prop, "rna_Object_collision_get", NULL, NULL); RNA_def_property_ui_text(prop, "Collision Settings", "Settings for using the objects as a collider in physics simulation."); prop= RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 4d8c728db12..45a9dc44875 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -33,18 +33,25 @@ #include "DNA_object_force.h" #include "DNA_scene_types.h" +#include "WM_api.h" #include "WM_types.h" #ifdef RNA_RUNTIME #include "MEM_guardedalloc.h" +#include "DNA_modifier_types.h" +#include "DNA_texture_types.h" + #include "BKE_context.h" +#include "BKE_modifier.h" #include "BKE_pointcache.h" #include "BKE_depsgraph.h" #include "BLI_blenlib.h" +#include "ED_object.h" + static void rna_Cache_change(bContext *C, PointerRNA *ptr) { Scene *scene = CTX_data_scene(C); @@ -209,21 +216,6 @@ static void rna_SoftBodySettings_new_aero_set(PointerRNA *ptr, int value) else data->softflag &= ~OB_SB_AERO_ANGLE; } -static int rna_SoftBodySettings_enabled_get(PointerRNA *ptr) -{ - Object *data= (Object*)(ptr->data); - return (((data->softflag) & OB_SB_ENABLE) != 0); -} - -#if 0 -static void rna_SoftBodySettings_enabled_set(PointerRNA *ptr, int value) -{ - Object *data= (Object*)(ptr->data); - if(value) data->softflag |= OB_SB_ENABLE; - else data->softflag &= ~OB_SB_ENABLE; -} -#endif - static int rna_SoftBodySettings_face_collision_get(PointerRNA *ptr) { Object *data= (Object*)(ptr->data); @@ -250,6 +242,108 @@ static void rna_SoftBodySettings_edge_collision_set(PointerRNA *ptr, int value) else data->softflag &= ~OB_SB_EDGECOLL; } +static void rna_SoftBodySettings_goal_vgroup_get(PointerRNA *ptr, char *value) +{ + SoftBody *sb= (SoftBody*)ptr->data; + rna_object_vgroup_name_index_get(ptr, value, sb->vertgroup); +} + +static int rna_SoftBodySettings_goal_vgroup_length(PointerRNA *ptr) +{ + SoftBody *sb= (SoftBody*)ptr->data; + return rna_object_vgroup_name_index_length(ptr, sb->vertgroup); +} + +static void rna_SoftBodySettings_goal_vgroup_set(PointerRNA *ptr, const char *value) +{ + SoftBody *sb= (SoftBody*)ptr->data; + rna_object_vgroup_name_index_set(ptr, value, &sb->vertgroup); +} + +static void rna_FieldSettings_update(bContext *C, PointerRNA *ptr) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= (Object*)ptr->id.data; + + if(ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex) { + ob->pd->tex->id.us--; + ob->pd->tex= 0; + } + + DAG_object_flush_update(scene, ob, OB_RECALC_OB); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); +} + +static void rna_FieldSettings_surface_update(bContext *C, PointerRNA *ptr) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= (Object*)ptr->id.data; + PartDeflect *pd= ob->pd; + ModifierData *md= modifiers_findByType(ob, eModifierType_Surface); + + /* add/remove modifier as needed */ + if(!md) { + if(pd && (pd->flag & PFIELD_SURFACE)) + if(ELEM5(pd->forcefield,PFIELD_HARMONIC,PFIELD_FORCE,PFIELD_HARMONIC,PFIELD_CHARGE,PFIELD_LENNARDJ)) + if(ELEM4(ob->type, OB_MESH, OB_SURF, OB_FONT, OB_CURVE)) + ED_object_modifier_add(NULL, scene, ob, eModifierType_Surface); + } + else { + if(!pd || !(pd->flag & PFIELD_SURFACE)) + ED_object_modifier_remove(NULL, scene, ob, md); + } + + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); +} + +static void rna_FieldSettings_dependency_update(bContext *C, PointerRNA *ptr) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= (Object*)ptr->id.data; + + /* do this before scene sort, that one checks for CU_PATH */ + /* XXX if(ob->type==OB_CURVE && ob->pd->forcefield==PFIELD_GUIDE) { + Curve *cu= ob->data; + cu->flag |= (CU_PATH|CU_3D); + do_curvebuts(B_CU3D); // all curves too + }*/ + + rna_FieldSettings_surface_update(C, ptr); + + DAG_scene_sort(scene); + + if(ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE) + DAG_object_flush_update(scene, ob, OB_RECALC); + else + DAG_object_flush_update(scene, ob, OB_RECALC_OB); + + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); +} + +static void rna_CollisionSettings_dependency_update(bContext *C, PointerRNA *ptr) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= (Object*)ptr->id.data; + ModifierData *md= modifiers_findByType(ob, eModifierType_Collision); + + /* add/remove modifier as needed */ + if(ob->pd->deflect && !md) + ED_object_modifier_add(NULL, scene, ob, eModifierType_Collision); + else if(!ob->pd->deflect && md) + ED_object_modifier_remove(NULL, scene, ob, md); + + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); +} + +static void rna_CollisionSettings_update(bContext *C, PointerRNA *ptr) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= (Object*)ptr->id.data; + + DAG_object_flush_update(scene, ob, OB_RECALC); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); +} + #else static void rna_def_pointcache(BlenderRNA *brna) @@ -279,9 +373,11 @@ static void rna_def_pointcache(BlenderRNA *brna) /* flags */ prop= RNA_def_property(srna, "baked", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_BAKED); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop= RNA_def_property(srna, "baking", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_BAKING); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop= RNA_def_property(srna, "disk_cache", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_DISK_CACHE); @@ -325,6 +421,7 @@ static void rna_def_collision(BlenderRNA *brna) prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deflect", 1); RNA_def_property_ui_text(prop, "Enabled", "Enable this objects as a collider for physics systems"); + RNA_def_property_update(prop, 0, "rna_CollisionSettings_dependency_update"); /* Particle Interaction */ @@ -332,30 +429,36 @@ static void rna_def_collision(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "pdef_damp"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Damping Factor", "Amount of damping during particle collision"); + RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); prop= RNA_def_property(srna, "random_damping", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pdef_rdamp"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Damping", "Random variation of damping"); + RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); prop= RNA_def_property(srna, "friction_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pdef_frict"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Friction Factor", "Amount of friction during particle collision"); + RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); prop= RNA_def_property(srna, "random_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pdef_rfrict"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Friction", "Random variation of friction"); + RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); prop= RNA_def_property(srna, "permeability", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pdef_perm"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Permeability", "Chance that the particle will pass through the mesh"); + RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); prop= RNA_def_property(srna, "kill_particles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PDEFLE_KILL_PART); RNA_def_property_ui_text(prop, "Kill Particles", "Kill collided particles"); + RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); /* Soft Body and Cloth Interaction */ @@ -363,21 +466,25 @@ static void rna_def_collision(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "pdef_sbift"); RNA_def_property_range(prop, 0.001f, 1.0f); RNA_def_property_ui_text(prop, "Inner Thickness", "Inner face thickness"); + RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); prop= RNA_def_property(srna, "outer_thickness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pdef_sboft"); RNA_def_property_range(prop, 0.001f, 1.0f); RNA_def_property_ui_text(prop, "Outer Thickness", "Outer face thickness"); + RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pdef_sbdamp"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Damping", "Amount of damping during collision"); + RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); /* Does this belong here? prop= RNA_def_property(srna, "collision_stack", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_COLLFINAL); RNA_def_property_ui_text(prop, "Collision from Stack", "Pick collision object from modifier stack (softbody only)"); + RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); */ } @@ -418,20 +525,23 @@ static void rna_def_field(BlenderRNA *brna) /* Enums */ - prop= RNA_def_property(srna, "field_type", PROP_ENUM, PROP_NONE); + prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "forcefield"); RNA_def_property_enum_items(prop, field_type_items); - RNA_def_property_ui_text(prop, "Field Type", "Choose Field Type"); + RNA_def_property_ui_text(prop, "Type", "Type of field."); + RNA_def_property_update(prop, 0, "rna_FieldSettings_dependency_update"); prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "falloff"); RNA_def_property_enum_items(prop, falloff_items); - RNA_def_property_ui_text(prop, "Fall-Off", "Fall-Off Shape"); + RNA_def_property_ui_text(prop, "Fall-Off", "Fall-off shape."); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "texture_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "tex_mode"); RNA_def_property_enum_items(prop, texture_items); RNA_def_property_ui_text(prop, "Texture Mode", "How the texture effect is calculated (RGB & Curl need a RGB texture else Gradient will be used instead)"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); /* Float */ @@ -439,103 +549,125 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "f_strength"); RNA_def_property_range(prop, -1000.0f, 1000.0f); RNA_def_property_ui_text(prop, "Strength", "Strength of force field"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "falloff_power", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f_power"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Falloff Power", "Falloff power (real gravitational falloff = 2)"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "harmonic_damping", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f_damp"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Harmonic Damping", "Damping of the harmonic force"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "minimum_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mindist"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance for the field's fall-off"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "maximum_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxdist"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance for the field to work"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "radial_minimum", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "minrad"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Minimum Radial Distance", "Minimum radial distance for the field's fall-off"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "radial_maximum", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxrad"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Maximum Radial Distance", "Maximum radial distance for the field to work"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "radial_falloff", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f_power_r"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Radial Falloff Power", "Radial falloff power (real gravitational falloff = 2)"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "texture_nabla", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "tex_nabla"); RNA_def_property_range(prop, 0.0001f, 1.0f); RNA_def_property_ui_text(prop, "Nabla", "Defines size of derivative offset used for calculating gradient and curl"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "noise", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f_noise"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Noise", "Noise of the wind force"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED); RNA_def_property_range(prop, 1, 128); RNA_def_property_ui_text(prop, "Seed", "Seed of the wind noise"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); /* Boolean */ prop= RNA_def_property(srna, "use_min_distance", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEMIN); RNA_def_property_ui_text(prop, "Use Min", "Use a minimum distance for the field's fall-off"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "use_max_distance", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEMAX); RNA_def_property_ui_text(prop, "Use Max", "Use a maximum distance for the field to work"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "use_radial_min", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEMINR); RNA_def_property_ui_text(prop, "Use Min", "Use a minimum radial distance for the field's fall-off"); // "Use a minimum angle for the field's fall-off" + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "use_radial_max", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEMAXR); RNA_def_property_ui_text(prop, "Use Max", "Use a maximum radial distance for the field to work"); // "Use a maximum angle for the field to work" + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "guide_path_add", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_GUIDE_PATH_ADD); RNA_def_property_ui_text(prop, "Additive", "Based on distance/falloff it adds a portion of the entire path"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "planar", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_PLANAR); RNA_def_property_ui_text(prop, "Planar", "Create planar field"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "surface", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_SURFACE); RNA_def_property_ui_text(prop, "Surface", "Use closest point on surface"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_surface_update"); prop= RNA_def_property(srna, "positive_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_POSZ); RNA_def_property_ui_text(prop, "Positive", "Effect only in direction of positive Z axis"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "use_coordinates", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_OBJECT); RNA_def_property_ui_text(prop, "Use Coordinates", "Use object/global coordinates for texture"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "force_2d", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_2D); RNA_def_property_ui_text(prop, "2D", "Apply force only in 2d"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); prop= RNA_def_property(srna, "root_coordinates", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_ROOTCO); RNA_def_property_ui_text(prop, "Root Texture Coordinates", "Texture coordinates from root particle locations"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); /* Pointer */ @@ -543,6 +675,7 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tex"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Texture", "Texture to use as force"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); } static void rna_def_game_softbody(BlenderRNA *brna) @@ -561,9 +694,9 @@ static void rna_def_softbody(BlenderRNA *brna) static EnumPropertyItem collision_type_items[] = { {SBC_MODE_MANUAL, "MANUAL", 0, "Manual", "Manual adjust"}, - {SBC_MODE_AVG, "AVERAGE", 0, "Average", "Average Spring lenght * Ball Size"}, - {SBC_MODE_MIN, "MINIMAL", 0, "Minimal", "Minimal Spring lenght * Ball Size"}, - {SBC_MODE_MAX, "MAXIMAL", 0, "Maximal", "Maximal Spring lenght * Ball Size"}, + {SBC_MODE_AVG, "AVERAGE", 0, "Average", "Average Spring length * Ball Size"}, + {SBC_MODE_MIN, "MINIMAL", 0, "Minimal", "Minimal Spring length * Ball Size"}, + {SBC_MODE_MAX, "MAXIMAL", 0, "Maximal", "Maximal Spring length * Ball Size"}, {SBC_MODE_AVGMINMAX, "MINMAX", 0, "AvMinMax", "(Min+Max)/2 * Ball Size"}, {0, NULL, 0, NULL, NULL}}; @@ -577,52 +710,62 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "mediafrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Friction", "General media friction for point movements"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "nodemass"); RNA_def_property_range(prop, 0.0f, 50000.0f); RNA_def_property_ui_text(prop, "Mass", ""); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "grav"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_ui_text(prop, "Gravitation", "Apply gravitation to point movement"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "physics_speed"); RNA_def_property_range(prop, 0.01f, 100.0f); RNA_def_property_ui_text(prop, "Speed", "Tweak timing for physics to control frequency and speed"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); /* Goal */ - /*prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); + prop= RNA_def_property(srna, "goal_vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "vertgroup"); - RNA_def_property_ui_text(prop, "Vertex Group", "Use control point weight values");*/ + RNA_def_property_string_funcs(prop, "rna_SoftBodySettings_goal_vgroup_get", "rna_SoftBodySettings_goal_vgroup_length", "rna_SoftBodySettings_goal_vgroup_set"); + RNA_def_property_ui_text(prop, "Goal Vertex Group", "Control point weight values."); prop= RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mingoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Minimum", "Goal minimum, vertex group weights are scaled to match this range."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxgoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Maximum", "Goal maximum, vertex group weights are scaled to match this range."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "defgoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Default", "Default Goal (vertex target position) value, when no Vertex Group used."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalspring"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Goal Stiffness", "Goal (vertex target position) spring stiffness."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalfrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Goal Damping", "Goal (vertex target position) friction."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); /* Edge Spring Settings */ @@ -630,36 +773,43 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "inspring"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Pull", "Edge spring stiffness when longer than rest length"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "push", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "inpush"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Push", "Edge spring stiffness when shorter than rest length"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "damp", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "infrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Damp", "Edge spring friction"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); - prop= RNA_def_property(srna, "spring_lenght", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "spring_length", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "springpreload"); RNA_def_property_range(prop, 0.0f, 200.0f); - RNA_def_property_ui_text(prop, "SL", "Alter spring lenght to shrink/blow up (unit %) 0 to disable"); + RNA_def_property_ui_text(prop, "SL", "Alter spring length to shrink/blow up (unit %) 0 to disable"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "aero", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aeroedge"); RNA_def_property_range(prop, 0.0f, 30000.0f); RNA_def_property_ui_text(prop, "Aero", "Make edges 'sail'"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "plastic", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "plastic"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Plastic", "Permanent deform"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "bending", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "secondspring"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Bending", "Bending Stiffness"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shearstiff"); @@ -672,21 +822,25 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "sbc_mode"); RNA_def_property_enum_items(prop, collision_type_items); RNA_def_property_ui_text(prop, "Collision Type", "Choose Collision Type"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "ball_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colball"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_ui_text(prop, "Ball Size", "Absolute ball size or factor if not manual adjusted"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "ball_stiff", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ballstiff"); RNA_def_property_range(prop, 0.001f, 100.0f); RNA_def_property_ui_text(prop, "Ball Size", "Ball inflating presure"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "ball_damp", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "balldamp"); RNA_def_property_range(prop, 0.001f, 1.0f); RNA_def_property_ui_text(prop, "Ball Size", "Blending to inelastic collision"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); /* Solver */ @@ -694,30 +848,36 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "rklimit"); RNA_def_property_range(prop, 0.001f, 10.0f); RNA_def_property_ui_text(prop, "Error Limit", "The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "minstep", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "minloops"); RNA_def_property_range(prop, 0, 30000); RNA_def_property_ui_text(prop, "Min Step", "Minimal # solver steps/frame"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "maxstep", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "maxloops"); RNA_def_property_range(prop, 0, 30000); RNA_def_property_ui_text(prop, "Max Step", "Maximal # solver steps/frame"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "choke", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "choke"); RNA_def_property_range(prop, 0, 100); RNA_def_property_ui_text(prop, "Choke", "'Viscosity' inside collision target"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "fuzzy", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "fuzzyness"); RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_text(prop, "Fuzzy", "Fuzzyness while on collision, high values make collsion handling faster but less stable"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "auto_step", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_OLDERR); RNA_def_property_ui_text(prop, "V", "Use velocities for automagic step sizes"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "diagnose", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_MONITOR); @@ -725,38 +885,40 @@ static void rna_def_softbody(BlenderRNA *brna) /* Flags */ - prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_enabled_get", "rna_SoftBodySettings_enabled_set"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Enable", "Sets object to become soft body."); - prop= RNA_def_property(srna, "use_goal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_use_goal_get", "rna_SoftBodySettings_use_goal_set"); RNA_def_property_ui_text(prop, "Use Goal", "Define forces for vertices to stick to animated position."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "use_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_use_edges_get", "rna_SoftBodySettings_use_edges_set"); RNA_def_property_ui_text(prop, "Use Edges", "Use Edges as springs"); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "stiff_quads", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_stiff_quads_get", "rna_SoftBodySettings_stiff_quads_set"); RNA_def_property_ui_text(prop, "Stiff Quads", "Adds diagonal springs on 4-gons."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "edge_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_edge_collision_get", "rna_SoftBodySettings_edge_collision_set"); RNA_def_property_ui_text(prop, "Edge Collision", "Edges collide too."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "face_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_face_collision_get", "rna_SoftBodySettings_face_collision_set"); RNA_def_property_ui_text(prop, "Face Collision", "Faces collide too, SLOOOOOW warning."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "new_aero", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_new_aero_get", "rna_SoftBodySettings_new_aero_set"); RNA_def_property_ui_text(prop, "N", "New aero(uses angle and length)."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); prop= RNA_def_property(srna, "self_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_self_collision_get", "rna_SoftBodySettings_self_collision_set"); RNA_def_property_ui_text(prop, "Self Collision", "Enable naive vertex ball self collision."); + RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); } void RNA_def_object_force(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 3df3fad3f15..363891e0f24 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -130,11 +130,11 @@ void RNA_api_ui_layout(StructRNA *srna) api_ui_item_common(func); api_ui_item_rna_common(func); - /*func= RNA_def_function(srna, "item_enumR", "uiItemEnumR"); + func= RNA_def_function(srna, "item_enumR", "uiItemEnumR_string"); api_ui_item_common(func); api_ui_item_rna_common(func); parm= RNA_def_string(func, "value", "", 0, "", "Enum property value."); - RNA_def_property_flag(parm, PROP_REQUIRED);*/ + RNA_def_property_flag(parm, PROP_REQUIRED); func= RNA_def_function(srna, "item_pointerR", "uiItemPointerR"); api_ui_item_common(func); -- cgit v1.2.3 From fb5f9273eba4b30e1aa0573388367592b18bdbba Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 2 Jul 2009 22:22:35 +0000 Subject: cmake support for building without fluidsim --- source/blender/editors/CMakeLists.txt | 4 ++++ source/blender/makesrna/intern/CMakeLists.txt | 4 ++++ source/blender/makesrna/intern/rna_fluidsim.c | 4 ++++ 3 files changed, 12 insertions(+) (limited to 'source') diff --git a/source/blender/editors/CMakeLists.txt b/source/blender/editors/CMakeLists.txt index 914fdaa4bc6..b7a868ad537 100644 --- a/source/blender/editors/CMakeLists.txt +++ b/source/blender/editors/CMakeLists.txt @@ -64,6 +64,10 @@ IF(WITH_FFMPEG) ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) +IF(NOT WITH_ELBEEM) + ADD_DEFINITIONS(-DDISABLE_ELBEEM) +ENDIF(NOT WITH_ELBEEM) + IF(WITH_PYTHON) SET(INC ${INC} ${PYTHON_INC}) ELSE(WITH_PYTHON) diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 963e4f9aeff..3400b69ee38 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -62,6 +62,10 @@ IF(WITH_FFMPEG) ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) +IF(NOT WITH_ELBEEM) + ADD_DEFINITIONS(-DDISABLE_ELBEEM) +ENDIF(NOT WITH_ELBEEM) + # Build makesrna executable ADD_EXECUTABLE(makesrna ${SRC} ${INC_FILES}) TARGET_LINK_LIBRARIES(makesrna bf_dna) diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index 4316666700f..44a50fbae25 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -130,10 +130,14 @@ static void rna_FluidSettings_update_type(bContext *C, PointerRNA *ptr) static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *value) { +#ifdef DISABLE_ELBEEM + value[0]= '\0'; +#else Object *ob= (Object*)ptr->id.data; FluidsimSettings *fss= (FluidsimSettings*)ptr->data; fluid_estimate_memory(ob, fss, value); +#endif } static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *ptr) -- cgit v1.2.3 From e9c85406e4f24eeab8818b3b58862c3798c0dc14 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 2 Jul 2009 23:27:11 +0000 Subject: NLA SoC: UI-Drawing for Generator and Envelope FModifiers Restored These now use a hybrid drawing approach - using the layout engine for just layouts, but still mostly using old-style buttons in many places where button callbacks and/or special data-access methods are needed (or where RNA wrapping isn't in place yet). --- source/blender/editors/animation/fmodifier_ui.c | 159 +++++++++++++----------- 1 file changed, 87 insertions(+), 72 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 19c7d049758..3be96031526 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -136,24 +136,23 @@ static void delete_fmodifier_cb (bContext *C, void *fmods_v, void *fcm_v) /* draw settings for generator modifier */ static void draw_modifier__generator(uiLayout *layout, FModifier *fcm, short width) { - // XXX TEMP WARNING - uiItemL(layout, "Generator FModifier UI not yet implemented again", ICON_ERROR); - -#if 0 // TODO: port to the new system FMod_Generator *data= (FMod_Generator *)fcm->data; - uiBlock *block= uiLayoutGetBlock(layout); - char gen_mode[]="Generator Type%t|Expanded Polynomial%x0|Factorised Polynomial%x1"; - int cy= yco - 30; + uiLayout *col, *row; + uiBlock *block; uiBut *but; + PointerRNA ptr; + + /* init the RNA-pointer */ + RNA_pointer_create(NULL, &RNA_FModifierFunctionGenerator, fcm, &ptr); /* basic settings (backdrop + mode selector + some padding) */ + col= uiLayoutColumn(layout, 1); + block= uiLayoutGetBlock(layout); uiBlockBeginAlign(block); - but= uiDefButI(block, MENU, B_FMODIFIER_REDRAW, gen_mode, 10,cy,width-30,19, &data->mode, 0, 0, 0, 0, "Selects type of generator algorithm."); + but= uiDefButR(block, MENU, B_FMODIFIER_REDRAW, NULL, 0, 0, width-30, UI_UNIT_Y, &ptr, "mode", -1, 0, 0, -1, -1, NULL); uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL); - cy -= 20; - uiDefButBitI(block, TOG, FCM_GENERATOR_ADDITIVE, B_FMODIFIER_REDRAW, "Additive", 10,cy,width-30,19, &data->flag, 0, 0, 0, 0, "Values generated by this modifier are applied on top of the existing values instead of overwriting them"); - cy -= 35; + uiDefButR(block, TOG, B_FMODIFIER_REDRAW, NULL, 0, 0, width-30, UI_UNIT_Y, &ptr, "additive", -1, 0, 0, -1, -1, NULL); uiBlockEndAlign(block); /* now add settings for individual modes */ @@ -165,31 +164,38 @@ static void draw_modifier__generator(uiLayout *layout, FModifier *fcm, short wid unsigned int i; /* draw polynomial order selector */ - but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 10,cy,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1"); - uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL); - cy -= 35; + row= uiLayoutRow(layout, 0); + block= uiLayoutGetBlock(row); + but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 10,0,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1"); + uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL); + /* draw controls for each coefficient and a + sign at end of row */ - uiDefBut(block, LABEL, 1, "y = ", 0, cy, 50, 20, NULL, 0.0, 0.0, 0, 0, ""); + row= uiLayoutRow(layout, 1); + block= uiLayoutGetBlock(row); + uiDefBut(block, LABEL, 1, "y = ", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, ""); cp= data->coefficients; for (i=0; (i < data->arraysize) && (cp); i++, cp++) { /* coefficient */ - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 50, cy, 150, 20, cp, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient for polynomial"); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 150, 20, cp, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient for polynomial"); /* 'x' param (and '+' if necessary) */ - if (i == 0) - strcpy(xval, ""); - else if (i == 1) - strcpy(xval, "x"); - else - sprintf(xval, "x^%d", i); - uiDefBut(block, LABEL, 1, xval, 200, cy, 50, 20, NULL, 0.0, 0.0, 0, 0, "Power of x"); - - if ( (i != (data->arraysize - 1)) || ((i==0) && data->arraysize==2) ) - uiDefBut(block, LABEL, 1, "+", 250, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); + if (i) { + if (i == 1) + strcpy(xval, "x"); + else + sprintf(xval, "x^%d", i); + uiDefBut(block, LABEL, 1, xval, 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "Power of x"); + } - cy -= 20; + if ( (i != (data->arraysize - 1)) || ((i==0) && data->arraysize==2) ) { + uiDefBut(block, LABEL, 1, "+", 0,0 , 30, 20, NULL, 0.0, 0.0, 0, 0, ""); + + /* next coefficient on a new row */ + row= uiLayoutRow(layout, 1); + block= uiLayoutGetBlock(row); + } } } break; @@ -200,37 +206,43 @@ static void draw_modifier__generator(uiLayout *layout, FModifier *fcm, short wid unsigned int i; /* draw polynomial order selector */ - but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 10,cy,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1"); - uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL); - cy -= 35; + row= uiLayoutRow(layout, 0); + block= uiLayoutGetBlock(row); + but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 0,0,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1"); + uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL); + /* draw controls for each pair of coefficients */ - uiDefBut(block, LABEL, 1, "y = ", 0, cy, 50, 20, NULL, 0.0, 0.0, 0, 0, ""); + row= uiLayoutRow(layout, 1); + block= uiLayoutGetBlock(row); + uiDefBut(block, LABEL, 1, "y = ", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, ""); cp= data->coefficients; for (i=0; (i < data->poly_order) && (cp); i++, cp+=2) { /* opening bracket */ - uiDefBut(block, LABEL, 1, "(", 40, cy, 50, 20, NULL, 0.0, 0.0, 0, 0, ""); + uiDefBut(block, LABEL, 1, "(", 0, 0, 20, 20, NULL, 0.0, 0.0, 0, 0, ""); /* coefficients */ - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 50, cy, 100, 20, cp, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient of x"); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient of x"); - uiDefBut(block, LABEL, 1, "x + ", 150, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); + uiDefBut(block, LABEL, 1, "x + ", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, ""); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 180, cy, 100, 20, cp+1, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Second coefficient"); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp+1, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Second coefficient"); /* closing bracket and '+' sign */ - if ( (i != (data->poly_order - 1)) || ((i==0) && data->poly_order==2) ) - uiDefBut(block, LABEL, 1, ") ?", 280, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); - else - uiDefBut(block, LABEL, 1, ")", 280, cy, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); - - cy -= 20; + if ( (i != (data->poly_order - 1)) || ((i==0) && data->poly_order==2) ) { + uiDefBut(block, LABEL, 1, ") +", 0, 0, 30, 20, NULL, 0.0, 0.0, 0, 0, ""); + + /* set up new row for the next pair of coefficients*/ + row= uiLayoutRow(layout, 1); + block= uiLayoutGetBlock(row); + } + else + uiDefBut(block, LABEL, 1, ")", 0, 0, 20, 20, NULL, 0.0, 0.0, 0, 0, ""); } } break; } -#endif } /* --------------- */ @@ -469,51 +481,54 @@ static void fmod_envelope_deletepoint_cb (bContext *C, void *fcm_dv, void *ind_v /* draw settings for envelope modifier */ static void draw_modifier__envelope(uiLayout *layout, FModifier *fcm, short width) { - uiItemL(layout, "Envelope FModifier UI not yet recoded in layout engine", ICON_ERROR); -#if 0 // XXX FIXME: recode in new layout style FMod_Envelope *env= (FMod_Envelope *)fcm->data; FCM_EnvelopeData *fed; - uiBlock *block= uiLayoutGetBlock(layout); + uiLayout *col, *row; + uiBlock *block; uiBut *but; - int cy= (yco - 28); + PointerRNA ptr; int i; - /* General Settings */ - uiDefBut(block, LABEL, 1, "Envelope:", 10, cy, 100, 20, NULL, 0.0, 0.0, 0, 0, "Settings for cycling before first keyframe"); - cy -= 20; + /* init the RNA-pointer */ + RNA_pointer_create(NULL, &RNA_FModifierEnvelope, fcm, &ptr); - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Reference Val:", 10, cy, 300, 20, &env->midval, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, ""); - cy -= 20; + /* general settings */ + col= uiLayoutColumn(layout, 1); + uiItemL(col, "Envelope:", 0); + uiItemR(col, NULL, 0, &ptr, "reference_value", 0, 0, 0); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Min:", 10, cy, 150, 20, &env->min, -UI_FLT_MAX, env->max, 10, 3, "Minimum value (relative to Reference Value) that is used as the 'normal' minimum value"); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Max:", 160, cy, 150, 20, &env->max, env->min, UI_FLT_MAX, 10, 3, "Maximum value (relative to Reference Value) that is used as the 'normal' maximum value"); - cy -= 35; - uiBlockEndAlign(block); - - - /* Points header */ - uiDefBut(block, LABEL, 1, "Control Points:", 10, cy, 150, 20, NULL, 0.0, 0.0, 0, 0, ""); - - but= uiDefBut(block, BUT, B_FMODIFIER_REDRAW, "Add Point", 160,cy,150,19, NULL, 0, 0, 0, 0, "Adds a new control-point to the envelope on the current frame"); - uiButSetFunc(but, fmod_envelope_addpoint_cb, env, NULL); - cy -= 35; - - /* Points List */ + row= uiLayoutRow(col, 1); + uiItemR(row, "Min", 0, &ptr, "default_minimum", 0, 0, 0); + uiItemR(row, "Max", 0, &ptr, "default_maximum", 0, 0, 0); + + /* control points header */ + // TODO: move this control-point control stuff to using the new special widgets for lists + // the current way is far too cramped + row= uiLayoutRow(layout, 0); + block= uiLayoutGetBlock(row); + + uiDefBut(block, LABEL, 1, "Control Points:", 0, 0, 150, 20, NULL, 0.0, 0.0, 0, 0, ""); + + but= uiDefBut(block, BUT, B_FMODIFIER_REDRAW, "Add Point", 0,0,150,19, NULL, 0, 0, 0, 0, "Adds a new control-point to the envelope on the current frame"); + uiButSetFunc(but, fmod_envelope_addpoint_cb, env, NULL); + + /* control points list */ for (i=0, fed=env->data; i < env->totvert; i++, fed++) { + /* get a new row to operate on */ + row= uiLayoutRow(layout, 1); + block= uiLayoutGetBlock(row); + uiBlockBeginAlign(block); - but=uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Fra:", 2, cy, 90, 20, &fed->time, -UI_FLT_MAX, UI_FLT_MAX, 10, 1, "Frame that envelope point occurs"); + but=uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Fra:", 0, 0, 90, 20, &fed->time, -UI_FLT_MAX, UI_FLT_MAX, 10, 1, "Frame that envelope point occurs"); uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Min:", 92, cy, 100, 20, &fed->min, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, "Minimum bound of envelope at this point"); - uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Max:", 192, cy, 100, 20, &fed->max, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, "Maximum bound of envelope at this point"); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Min:", 0, 0, 100, 20, &fed->min, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, "Minimum bound of envelope at this point"); + uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Max:", 0, 0, 100, 20, &fed->max, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, "Maximum bound of envelope at this point"); - but= uiDefIconBut(block, BUT, B_FMODIFIER_REDRAW, ICON_X, 292, cy, 18, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Delete envelope control point"); + but= uiDefIconBut(block, BUT, B_FMODIFIER_REDRAW, ICON_X, 0, 0, 18, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Delete envelope control point"); uiButSetFunc(but, fmod_envelope_deletepoint_cb, env, SET_INT_IN_POINTER(i)); uiBlockBeginAlign(block); - cy -= 25; } -#endif } /* --------------- */ -- cgit v1.2.3 From e55d90b340d15944d53414419d8f4671f435af75 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 2 Jul 2009 23:36:16 +0000 Subject: NLA SoC: Added buttons for animating NLA-Strip Influence/Speed These buttons are found in the Evaluation panel, but are currently disabled as I've yet to add the proper code to ensure that animating these will work correctly. They will hopefully be working before the end of the day. --- source/blender/editors/animation/fmodifier_ui.c | 4 ++-- source/blender/editors/space_nla/nla_buttons.c | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 3be96031526..cd0a00fa859 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -215,7 +215,7 @@ static void draw_modifier__generator(uiLayout *layout, FModifier *fcm, short wid /* draw controls for each pair of coefficients */ row= uiLayoutRow(layout, 1); block= uiLayoutGetBlock(row); - uiDefBut(block, LABEL, 1, "y = ", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, ""); + uiDefBut(block, LABEL, 1, "y=", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, ""); cp= data->coefficients; for (i=0; (i < data->poly_order) && (cp); i++, cp+=2) { @@ -225,7 +225,7 @@ static void draw_modifier__generator(uiLayout *layout, FModifier *fcm, short wid /* coefficients */ uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient of x"); - uiDefBut(block, LABEL, 1, "x + ", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, ""); + uiDefBut(block, LABEL, 1, "x+", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, ""); uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp+1, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Second coefficient"); diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 67c4365ff49..7eb10866b8c 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -289,7 +289,7 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa) { PointerRNA strip_ptr; uiLayout *layout= pa->layout; - //uiLayout *column, *row, *subcol; + uiLayout *column; uiBlock *block; /* check context and also validity of pointer */ @@ -299,10 +299,15 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa) block= uiLayoutGetBlock(layout); uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); - // influence - // strip_time - // animated_influence - // animated_time + column= uiLayoutColumn(layout, 1); + uiLayoutSetEnabled(column, 0); // XXX for now, don't allow user to edit + uiItemR(column, NULL, 0, &strip_ptr, "animated_influence", 0, 0, 0); + uiItemR(column, NULL, 0, &strip_ptr, "influence", 0, 0, 0); + + column= uiLayoutColumn(layout, 1); + uiLayoutSetEnabled(column, 0); // XXX for now, don't allow user to edit + uiItemR(column, NULL, 0, &strip_ptr, "animated_time", 0, 0, 0); + uiItemR(column, NULL, 0, &strip_ptr, "strip_time", 0, 0, 0); } /* F-Modifiers for active NLA-Strip */ -- cgit v1.2.3 From 28d371d1178642e17f5dfc300f1500a132ce7149 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 3 Jul 2009 01:10:46 +0000 Subject: NLA SoC: Assorted fixes * Made NLA Editing functions more aware of transitions. - A transition can only be added between a pair of action-clips. Previous, two transitions could be added next to each other, which has undefined behaviour - Deleting a strip with transition(s) on either side will remove the transitions too. Feedback welcome on this - The 'type' setting for NLA-Strips is no longer editable. This was dangerous as it could result in transitions with undefined behaviour (though nothing would happen). * Menus for adding F-Modifiers now only show relevant modifiers (i.e. 'Invalid' is not included in the list, and 'Cycles' doesn't need to be shown for NLA since we've got repeat) * Function Generator and Noise F-Modifiers now have complete GUI's. A few settings were missed during the porting process. * F-Modifier buttons now have their source-ID's included in the RNA Pointers used. This didn't get them animateable directly, but is a step closer. --- source/blender/blenkernel/BKE_fcurve.h | 33 ++++++++++--- source/blender/blenkernel/intern/nla.c | 8 ++-- source/blender/editors/animation/fmodifier_ui.c | 56 ++++++++++++---------- source/blender/editors/include/ED_anim_api.h | 2 +- source/blender/editors/space_graph/graph_buttons.c | 2 +- source/blender/editors/space_graph/graph_edit.c | 31 +++++++++++- source/blender/editors/space_nla/nla_buttons.c | 2 +- source/blender/editors/space_nla/nla_edit.c | 50 ++++++++++++++++++- source/blender/makesdna/DNA_anim_types.h | 2 +- source/blender/makesrna/intern/rna_nla.c | 6 ++- 10 files changed, 150 insertions(+), 42 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index cfc4e9077f6..4dcb08dc0df 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -1,12 +1,33 @@ -/* Testing code for new animation system in 2.5 - * Copyright 2009, Joshua Leung +/** + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2009 Blender Foundation, Joshua Leung + * All rights reserved. + * + * Contributor(s): Joshua Leung (full recode) + * + * ***** END GPL LICENSE BLOCK ***** */ #ifndef BKE_FCURVE_H #define BKE_FCURVE_H -//struct ListBase; - struct FCurve; struct FModifier; struct ChannelDriver; @@ -54,8 +75,8 @@ typedef struct FModifierTypeInfo { short size; /* size in bytes of the struct */ short acttype; /* eFMI_Action_Types */ short requires; /* eFMI_Requirement_Flags */ - char name[32]; /* name of modifier in interface */ - char structName[32]; /* name of struct for SDNA */ + char name[64]; /* name of modifier in interface */ + char structName[64]; /* name of struct for SDNA */ /* data management function pointers - special handling */ /* free any data that is allocated separately (optional) */ diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 14e658b3903..d554fbbabc1 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -66,7 +66,6 @@ /* Remove the given NLA strip from the NLA track it occupies, free the strip's data, * and the strip itself. */ -// TODO: with things like transitions, should these get freed too? Maybe better as a UI tool void free_nlastrip (ListBase *strips, NlaStrip *strip) { /* sanity checks */ @@ -793,6 +792,7 @@ void BKE_nla_action_pushdown (AnimData *adt) /* not first, so extend mode can only be NLASTRIP_EXTEND_HOLD_FORWARD not NLASTRIP_EXTEND_HOLD, * so that it doesn't override strips in previous tracks */ + // FIXME: this needs to be more automated, since user can rearrange strips strip->extendmode= NLASTRIP_EXTEND_HOLD_FORWARD; } } @@ -844,7 +844,7 @@ short BKE_nla_tweakmode_enter (AnimData *adt) if (strip->act == activeStrip->act) strip->flag |= NLASTRIP_FLAG_TWEAKUSER; else - strip->flag &= ~NLASTRIP_FLAG_TWEAKUSER; // XXX probably don't need to clear this... + strip->flag &= ~NLASTRIP_FLAG_TWEAKUSER; } } @@ -887,8 +887,8 @@ void BKE_nla_tweakmode_exit (AnimData *adt) // TODO: need to sync the user-strip with the new state of the action! - /* for all NLA-tracks, clear the 'disabled' flag - * for all NLA-strips, clear the 'tweak-user' flag + /* for all Tracks, clear the 'disabled' flag + * for all Strips, clear the 'tweak-user' flag */ for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { nlt->flag &= ~NLATRACK_DISABLED; diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index cd0a00fa859..7a618f4d222 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -134,7 +134,7 @@ static void delete_fmodifier_cb (bContext *C, void *fmods_v, void *fcm_v) /* --------------- */ /* draw settings for generator modifier */ -static void draw_modifier__generator(uiLayout *layout, FModifier *fcm, short width) +static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, short width) { FMod_Generator *data= (FMod_Generator *)fcm->data; uiLayout *col, *row; @@ -143,7 +143,7 @@ static void draw_modifier__generator(uiLayout *layout, FModifier *fcm, short wid PointerRNA ptr; /* init the RNA-pointer */ - RNA_pointer_create(NULL, &RNA_FModifierFunctionGenerator, fcm, &ptr); + RNA_pointer_create(id, &RNA_FModifierFunctionGenerator, fcm, &ptr); /* basic settings (backdrop + mode selector + some padding) */ col= uiLayoutColumn(layout, 1); @@ -248,31 +248,36 @@ static void draw_modifier__generator(uiLayout *layout, FModifier *fcm, short wid /* --------------- */ /* draw settings for noise modifier */ -static void draw_modifier__fn_generator(uiLayout *layout, FModifier *fcm, short width) +static void draw_modifier__fn_generator(uiLayout *layout, ID *id, FModifier *fcm, short width) { - uiLayout *col= uiLayoutColumn(layout, 0); // no grouping for now + uiLayout *col; PointerRNA ptr; /* init the RNA-pointer */ - RNA_pointer_create(NULL, &RNA_FModifierFunctionGenerator, fcm, &ptr); + RNA_pointer_create(id, &RNA_FModifierFunctionGenerator, fcm, &ptr); /* add the settings */ - uiItemR(col, NULL, 0, &ptr, "amplitude", 0, 0, 0); - uiItemR(col, NULL, 0, &ptr, "phase_multiplier", 0, 0, 0); - uiItemR(col, NULL, 0, &ptr, "phase_offset", 0, 0, 0); - uiItemR(col, NULL, 0, &ptr, "value_offset", 0, 0, 0); + col= uiLayoutColumn(layout, 1); + uiItemR(col, "", 0, &ptr, "type", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "additive", 0, 0, 1); + + col= uiLayoutColumn(layout, 0); // no grouping for now + uiItemR(col, NULL, 0, &ptr, "amplitude", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "phase_multiplier", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "phase_offset", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "value_offset", 0, 0, 0); } /* --------------- */ /* draw settings for cycles modifier */ -static void draw_modifier__cycles(uiLayout *layout, FModifier *fcm, short width) +static void draw_modifier__cycles(uiLayout *layout, ID *id, FModifier *fcm, short width) { uiLayout *split, *col; PointerRNA ptr; /* init the RNA-pointer */ - RNA_pointer_create(NULL, &RNA_FModifierCycles, fcm, &ptr); + RNA_pointer_create(id, &RNA_FModifierCycles, fcm, &ptr); /* split into 2 columns * NOTE: the mode comboboxes shouldn't get labels, otherwise there isn't enough room @@ -295,13 +300,16 @@ static void draw_modifier__cycles(uiLayout *layout, FModifier *fcm, short width) /* --------------- */ /* draw settings for noise modifier */ -static void draw_modifier__noise(uiLayout *layout, FModifier *fcm, short width) +static void draw_modifier__noise(uiLayout *layout, ID *id, FModifier *fcm, short width) { uiLayout *split, *col; PointerRNA ptr; /* init the RNA-pointer */ - RNA_pointer_create(NULL, &RNA_FModifierNoise, fcm, &ptr); + RNA_pointer_create(id, &RNA_FModifierNoise, fcm, &ptr); + + /* blending mode */ + uiItemR(layout, NULL, 0, &ptr, "modification", 0, 0, 0); /* split into 2 columns */ split= uiLayoutSplit(layout, 0.5f); @@ -479,7 +487,7 @@ static void fmod_envelope_deletepoint_cb (bContext *C, void *fcm_dv, void *ind_v } /* draw settings for envelope modifier */ -static void draw_modifier__envelope(uiLayout *layout, FModifier *fcm, short width) +static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, short width) { FMod_Envelope *env= (FMod_Envelope *)fcm->data; FCM_EnvelopeData *fed; @@ -490,7 +498,7 @@ static void draw_modifier__envelope(uiLayout *layout, FModifier *fcm, short widt int i; /* init the RNA-pointer */ - RNA_pointer_create(NULL, &RNA_FModifierEnvelope, fcm, &ptr); + RNA_pointer_create(id, &RNA_FModifierEnvelope, fcm, &ptr); /* general settings */ col= uiLayoutColumn(layout, 1); @@ -534,13 +542,13 @@ static void draw_modifier__envelope(uiLayout *layout, FModifier *fcm, short widt /* --------------- */ /* draw settings for limits modifier */ -static void draw_modifier__limits(uiLayout *layout, FModifier *fcm, short width) +static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, short width) { uiLayout *split, *col, *row; PointerRNA ptr; /* init the RNA-pointer */ - RNA_pointer_create(NULL, &RNA_FModifierLimits, fcm, &ptr); + RNA_pointer_create(id, &RNA_FModifierLimits, fcm, &ptr); /* row 1: minimum */ { @@ -582,7 +590,7 @@ static void draw_modifier__limits(uiLayout *layout, FModifier *fcm, short width) /* --------------- */ -void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ListBase *modifiers, FModifier *fcm) +void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifiers, FModifier *fcm) { FModifierTypeInfo *fmi= fmodifier_get_typeinfo(fcm); uiLayout *box, *row, *subrow; @@ -639,27 +647,27 @@ void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ListBase *modifiers, FMod /* draw settings for individual modifiers */ switch (fcm->type) { case FMODIFIER_TYPE_GENERATOR: /* Generator */ - draw_modifier__generator(box, fcm, width); + draw_modifier__generator(box, id, fcm, width); break; case FMODIFIER_TYPE_FN_GENERATOR: /* Built-In Function Generator */ - draw_modifier__fn_generator(box, fcm, width); + draw_modifier__fn_generator(box, id, fcm, width); break; case FMODIFIER_TYPE_CYCLES: /* Cycles */ - draw_modifier__cycles(box, fcm, width); + draw_modifier__cycles(box, id, fcm, width); break; case FMODIFIER_TYPE_ENVELOPE: /* Envelope */ - draw_modifier__envelope(box, fcm, width); + draw_modifier__envelope(box, id, fcm, width); break; case FMODIFIER_TYPE_LIMITS: /* Limits */ - draw_modifier__limits(box, fcm, width); + draw_modifier__limits(box, id, fcm, width); break; case FMODIFIER_TYPE_NOISE: /* Noise */ - draw_modifier__noise(box, fcm, width); + draw_modifier__noise(box, id, fcm, width); break; default: /* unknown type */ diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index df4e704cae8..87811fa34f9 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -300,7 +300,7 @@ struct uiLayout; /* draw a given F-Modifier for some layout/UI-Block */ // XXX not quite complete yet -void ANIM_uiTemplate_fmodifier_draw(struct uiLayout *layout, ListBase *modifiers, struct FModifier *fcm); +void ANIM_uiTemplate_fmodifier_draw(struct uiLayout *layout, struct ID *id, ListBase *modifiers, struct FModifier *fcm); /* ************************************************* */ /* ASSORTED TOOLS */ diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 17bc78f9ee6..0e48d56ac90 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -388,7 +388,7 @@ static void graph_panel_modifiers(const bContext *C, Panel *pa) for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) { col= uiLayoutColumn(pa->layout, 1); - ANIM_uiTemplate_fmodifier_draw(col, &fcu->modifiers, fcm); + ANIM_uiTemplate_fmodifier_draw(col, ale->id, &fcu->modifiers, fcm); } MEM_freeN(ale); diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 9a50c5cc203..2cade676817 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -73,6 +73,7 @@ #include "BKE_report.h" #include "BKE_utildefines.h" +#include "UI_interface.h" #include "UI_view2d.h" #include "BIF_transform.h" @@ -1743,6 +1744,34 @@ void GRAPH_OT_smooth (wmOperatorType *ot) /* ******************** Add F-Modifier Operator *********************** */ +/* present a special customised popup menu for this, with some filtering */ +static int graph_fmodifier_add_invoke (bContext *C, wmOperator *op, wmEvent *event) +{ + uiPopupMenu *pup; + uiLayout *layout; + int i; + + pup= uiPupMenuBegin(C, "Add F-Curve Modifier", 0); + layout= uiPupMenuLayout(pup); + + /* start from 1 to skip the 'Invalid' modifier type */ + for (i = 1; i < FMODIFIER_NUM_TYPES; i++) { + FModifierTypeInfo *fmi= get_fmodifier_typeinfo(i); + + /* check if modifier is valid for this context */ + if (fmi == NULL) + continue; + + /* add entry to add this type of modifier */ + uiItemEnumO(layout, fmi->name, 0, "GRAPH_OT_fmodifier_add", "type", i); + } + uiItemS(layout); + + uiPupMenuEnd(C, pup); + + return OPERATOR_CANCELLED; +} + static int graph_fmodifier_add_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1793,7 +1822,7 @@ void GRAPH_OT_fmodifier_add (wmOperatorType *ot) ot->idname= "GRAPH_OT_fmodifier_add"; /* api callbacks */ - ot->invoke= WM_menu_invoke; + ot->invoke= graph_fmodifier_add_invoke; ot->exec= graph_fmodifier_add_exec; ot->poll= graphop_active_fcurve_poll; diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 7eb10866b8c..38ac59cbc9e 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -341,7 +341,7 @@ static void nla_panel_modifiers(const bContext *C, Panel *pa) for (fcm= strip->modifiers.first; fcm; fcm= fcm->next) { col= uiLayoutColumn(pa->layout, 1); - ANIM_uiTemplate_fmodifier_draw(col, &strip->modifiers, fcm); + ANIM_uiTemplate_fmodifier_draw(col, strip_ptr.id.data, &strip->modifiers, fcm); } } diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 9910e62b262..10b25beddff 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -386,6 +386,12 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op) /* check if there's space between the two */ if (IS_EQ(s1->end, s2->start)) continue; + /* make neither one is a transition + * - although this is impossible to create with the standard tools, + * the user may have altered the settings + */ + if (ELEM(NLASTRIP_TYPE_TRANSITION, s1->type, s2->type)) + continue; /* allocate new strip */ strip= MEM_callocN(sizeof(NlaStrip), "NlaStrip"); @@ -577,8 +583,18 @@ static int nlaedit_delete_exec (bContext *C, wmOperator *op) nstrip= strip->next; /* if selected, delete */ - if (strip->flag & NLASTRIP_FLAG_SELECT) + if (strip->flag & NLASTRIP_FLAG_SELECT) { + /* if a strip either side of this was a transition, delete those too */ + if ((strip->prev) && (strip->prev->type == NLASTRIP_TYPE_TRANSITION)) + free_nlastrip(&nlt->strips, strip->prev); + if ((nstrip) && (nstrip->type == NLASTRIP_TYPE_TRANSITION)) { + nstrip= nstrip->next; + free_nlastrip(&nlt->strips, strip->next); + } + + /* finally, delete this strip */ free_nlastrip(&nlt->strips, strip); + } } } @@ -1026,6 +1042,36 @@ void NLA_OT_clear_scale (wmOperatorType *ot) /* ******************** Add F-Modifier Operator *********************** */ +/* present a special customised popup menu for this, with some filtering */ +static int nla_fmodifier_add_invoke (bContext *C, wmOperator *op, wmEvent *event) +{ + uiPopupMenu *pup; + uiLayout *layout; + int i; + + pup= uiPupMenuBegin(C, "Add F-Modifier", 0); + layout= uiPupMenuLayout(pup); + + /* start from 1 to skip the 'Invalid' modifier type */ + for (i = 1; i < FMODIFIER_NUM_TYPES; i++) { + FModifierTypeInfo *fmi= get_fmodifier_typeinfo(i); + + /* check if modifier is valid for this context */ + if (fmi == NULL) + continue; + if (i == FMODIFIER_TYPE_CYCLES) /* we already have repeat... */ + continue; + + /* add entry to add this type of modifier */ + uiItemEnumO(layout, fmi->name, 0, "NLA_OT_fmodifier_add", "type", i); + } + uiItemS(layout); + + uiPupMenuEnd(C, pup); + + return OPERATOR_CANCELLED; +} + static int nla_fmodifier_add_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1089,7 +1135,7 @@ void NLA_OT_fmodifier_add (wmOperatorType *ot) ot->idname= "NLA_OT_fmodifier_add"; /* api callbacks */ - ot->invoke= WM_menu_invoke; + ot->invoke= nla_fmodifier_add_invoke; ot->exec= nla_fmodifier_add_exec; ot->poll= nlaop_poll_tweakmode_off; diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index ad3edde6552..f9508efef31 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -69,7 +69,7 @@ enum { FMODIFIER_TYPE_FN_GENERATOR, FMODIFIER_TYPE_ENVELOPE, FMODIFIER_TYPE_CYCLES, - FMODIFIER_TYPE_NOISE, /* unimplemented - generate variations using some basic noise generator... */ + FMODIFIER_TYPE_NOISE, FMODIFIER_TYPE_FILTER, /* unimplemented - for applying: fft, high/low pass filters, etc. */ FMODIFIER_TYPE_PYTHON, FMODIFIER_TYPE_LIMITS, diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 965692212a5..dfa496fd8f3 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -228,6 +228,7 @@ void rna_def_nlastrip(BlenderRNA *brna) /* Enums */ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, not editable, since this is dangerous RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Type", "Type of NLA Strip."); @@ -296,7 +297,10 @@ void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_range(prop, 0.0001f, 1000.0f); /* these limits can be extended, but beyond this, we can get some crazy+annoying bugs due to numeric errors */ RNA_def_property_ui_text(prop, "Scale", "Scaling factor for action."); - // TODO: strip's F-Curves? + /* Strip's F-Curves */ + prop= RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "FCurve"); + RNA_def_property_ui_text(prop, "F-Curves", "F-Curves for controlling the strip's influence and timing."); /* Strip's F-Modifiers */ prop= RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE); -- cgit v1.2.3 From a07d1ea3ea1875f938327d37fbb219717e325ada Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 3 Jul 2009 04:24:19 +0000 Subject: NLA SoC: Quick hack to get layer buttons in 3D view updating visible layers correctly. Now it is possible to load old files and be able to switch layers to show/hide objects AND have that reflected in the Animation Editors which rely on the scene layers being set correctly. --- .../blender/editors/space_view3d/view3d_header.c | 28 ++++++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 5edcd203e16..605f6d6b02f 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -117,8 +117,7 @@ #define TEST_EDITMESH if(obedit==0) return; \ if( (v3d->lay & obedit->lay)==0 ) return; -/* XXX port over */ -static void handle_view3d_lock(void) {} +/* XXX port over */ static void countall(void) {} extern void borderselect(); static int retopo_mesh_paint_check() {return 0;} @@ -201,6 +200,25 @@ static RegionView3D *wm_region_view3d(const bContext *C) return NULL; } +// XXX quickly ported across +static void handle_view3d_lock(bContext *C) +{ + Scene *scene= CTX_data_scene(C); + ScrArea *sa= CTX_wm_area(C); + View3D *v3d= (View3D *)CTX_wm_space_data(C); + + if (v3d != NULL && sa != NULL) { + if(v3d->localview==0 && v3d->scenelock && sa->spacetype==SPACE_VIEW3D) { + + /* copy to scene */ + scene->lay= v3d->lay; + scene->camera= v3d->camera; + + //copy_view3d_lock(REDRAW); + } + } +} + /* XXX; all this context stuff... should become operator */ void do_layer_buttons(bContext *C, short event) { @@ -230,7 +248,7 @@ void do_layer_buttons(bContext *C, short event) v3d->lay= (1<<20)-1; } - if(v3d->scenelock) handle_view3d_lock(); + if(v3d->scenelock) handle_view3d_lock(C); /* new layers might need unflushed events events */ DAG_scene_update_flags(scene, v3d->lay); /* tags all that moves and flushes */ @@ -266,7 +284,7 @@ static int layers_exec(bContext *C, wmOperator *op) else v3d->lay = (1<scenelock) handle_view3d_lock(); + if(v3d->scenelock) handle_view3d_lock(C); /* new layers might need unflushed events events */ DAG_scene_update_flags(scene, v3d->lay); /* tags all that moves and flushes */ @@ -5106,7 +5124,7 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event) v3d->layact= v3d->lay; } - if(v3d->scenelock) handle_view3d_lock(); + if(v3d->scenelock) handle_view3d_lock(C); ED_area_tag_redraw(sa); countall(); -- cgit v1.2.3 From b0f19ea7ca5ff420a44a618a1917d7bf728115b7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 3 Jul 2009 04:38:55 +0000 Subject: set the PYTHONPATH to BLI_gethome_folder("python") if it exists. This lets us distribute blender with our own python module directory (next to ui and io), and avoids the need for a shell script to start blender. --- source/blender/python/intern/bpy_interface.c | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'source') diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 1d18fe36ad9..2b1b72d0307 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -147,10 +147,43 @@ wchar_t* Py_GetPath(void) } #endif + +/* must be called before Py_Initialize */ +void BPY_start_python_path(void) +{ + char *py_path_bundle= BLI_gethome_folder("python"); + + if(py_path_bundle==NULL) + return; + + /* set the environment path */ + printf("found bundled python: %s\n", py_path_bundle); + +#if (defined(WIN32) || defined(WIN64)) +#if defined(FREE_WINDOWS) + sprintf(py_path, "PYTHONPATH=%s", py_path_bundle) + putenv(py_path); +#else + _putenv_s("PYTHONPATH", py_path_bundle); +#endif +#else +#ifdef __sgi + sprintf(py_path, "PYTHONPATH=%s", py_path_bundle) + putenv(py_path); +#else + setenv("PYTHONPATH", py_path_bundle, 1); /* initializing the video driver can cause crashes on some systems - Campbell */ +#endif +#endif + +} + + void BPY_start_python( int argc, char **argv ) { PyThreadState *py_tstate = NULL; + BPY_start_python_path(); /* allow to use our own included python */ + Py_Initialize( ); //PySys_SetArgv( argc_copy, argv_copy ); -- cgit v1.2.3 From 66efea5e2d94ec7296efbe03ddeb7c6c4878c9ab Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 3 Jul 2009 04:48:44 +0000 Subject: NLA SoC: Toggle for 'Editing in Place' The 'pin' icon beside the name of the active Action when tweaking some strip's action can be used to toggle between editing the Action's keyframes in 'mapped' time or in 'un-mapped' time. --- source/blender/blenkernel/intern/nla.c | 3 ++- source/blender/editors/space_nla/nla_channels.c | 7 +++++-- source/blender/editors/space_nla/nla_draw.c | 13 ++++++++++++- source/blender/makesdna/DNA_anim_types.h | 2 ++ 4 files changed, 21 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index d554fbbabc1..1244b2900fd 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -458,8 +458,9 @@ float BKE_nla_tweakedit_remap (AnimData *adt, float cframe, short mode) /* sanity checks * - obviously we've got to have some starting data * - when not in tweakmode, the active Action does not have any scaling applied :) + * - when in tweakmode, if the no-mapping flag is set, do not map */ - if ((adt == NULL) || (adt->flag & ADT_NLA_EDIT_ON)==0) + if ((adt == NULL) || (adt->flag & ADT_NLA_EDIT_ON)==0 || (adt->flag & ADT_NLA_EDIT_NOMAP)) return cframe; /* if the active-strip info has been stored already, access this, otherwise look this up diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 0a2c32b5f52..5a891a541cb 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -264,14 +264,17 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh { AnimData *adt= BKE_animdata_from_id(ale->owner); /* this won't crash, right? */ - /* for now, only do something if user clicks on the 'push-down' button */ if (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) { - /* activate push-down function - only usable when not in TweakMode */ if (nlaedit_is_tweakmode_on(ac) == 0) { + /* 'push-down' action - only usable when not in TweakMode */ // TODO: make this use the operator instead of calling the function directly // however, calling the operator requires that we supply the args, and that works with proper buttons only BKE_nla_action_pushdown(adt); } + else { + /* when in tweakmode, this button becomes the toggle for mapped editing */ + adt->flag ^= ADT_NLA_EDIT_NOMAP; + } } } break; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 6d4f65fe249..ab33434077e 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -886,7 +886,18 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) /* now draw some indicator icons */ if ((adt) && (adt->flag & ADT_NLA_EDIT_ON)) { - /* 'tweaking action' - not a button */ + /* toggle for tweaking with mapping/no-mapping (i.e. 'in place editing' toggle) */ + // for now, use pin icon to symbolise this + if (adt->flag & ADT_NLA_EDIT_NOMAP) + UI_icon_draw((float)(NLACHANNEL_NAMEWIDTH-offset), ydatac, ICON_PINNED); + else + UI_icon_draw((float)(NLACHANNEL_NAMEWIDTH-offset), ydatac, ICON_UNPINNED); + + fdrawline((float)(NLACHANNEL_NAMEWIDTH-offset), yminc, + (float)(NLACHANNEL_NAMEWIDTH-offset), ymaxc); + offset += 16;; + + /* 'tweaking action' indicator - not a button */ UI_icon_draw((float)NLACHANNEL_NAMEWIDTH-offset, ydatac, ICON_EDIT); } else { diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index f9508efef31..110b33850f0 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -730,6 +730,8 @@ enum { ADT_NLA_EVAL_OFF = (1<<1), /* NLA is being 'tweaked' (i.e. in EditMode) */ ADT_NLA_EDIT_ON = (1<<2), + /* active Action for 'tweaking' does not have mapping applied for editing */ + ADT_NLA_EDIT_NOMAP = (1<<3), /* drivers expanded in UI */ ADT_DRIVERS_COLLAPSED = (1<<10), -- cgit v1.2.3 From b8042f535c43c371d6bdb2fe44d0560d5802083c Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 3 Jul 2009 10:28:10 +0000 Subject: NLA SoC: Muting and Graph-Editor Curve visibility for (Action) Groups Groups (the Action variety) can now be muted, and also be set to not be drawn in the Graph Editor. These settings get applied to all the F-Curves within the group, overriding any settings individual F-Curves might have, allowing users to quickly mute or hide groups of curves without having to go through clicking on all of them. Also, added a flag that can be used to set the curve visiblity on AnimData level too. This will be enabled in a future commit. --- source/blender/blenkernel/intern/anim_sys.c | 19 ++++++++--- source/blender/editors/animation/anim_channels.c | 14 ++++++++ source/blender/editors/animation/anim_filter.c | 39 +++++++++++++---------- source/blender/editors/space_action/action_draw.c | 5 +++ source/blender/editors/space_graph/graph_draw.c | 11 +++++++ source/blender/makesdna/DNA_action_types.h | 8 +++++ source/blender/makesdna/DNA_anim_types.h | 3 ++ 7 files changed, 77 insertions(+), 22 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 4c0c30fe5c1..9befe9dc9cb 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -492,11 +492,14 @@ static void animsys_evaluate_fcurves (PointerRNA *ptr, ListBase *list, AnimMappe /* calculate then execute each curve */ for (fcu= list->first; fcu; fcu= fcu->next) { - /* check if this curve should be skipped */ - if ((fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) == 0) - { - calculate_fcurve(fcu, ctime); - animsys_execute_fcurve(ptr, remap, fcu); + /* check if this F-Curve doesn't belong to a muted group */ + if ((fcu->grp == NULL) || (fcu->grp->flag & AGRP_MUTED)==0) { + /* check if this curve should be skipped */ + if ((fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) == 0) + { + calculate_fcurve(fcu, ctime); + animsys_execute_fcurve(ptr, remap, fcu); + } } } } @@ -551,6 +554,10 @@ void animsys_evaluate_action_group (PointerRNA *ptr, bAction *act, bActionGroup if ELEM(NULL, act, agrp) return; if ((remap) && (remap->target != act)) remap= NULL; + /* if group is muted, don't evaluated any of the F-Curve */ + if (agrp->flag & AGRP_MUTED) + return; + /* calculate then execute each curve */ for (fcu= agrp->channels.first; (fcu) && (fcu->grp == agrp); fcu= fcu->next) { @@ -884,6 +891,8 @@ static void nlastrip_evaluate_actionclip (PointerRNA *ptr, ListBase *channels, N /* check if this curve should be skipped */ if (fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) continue; + if ((fcu->grp) && (fcu->grp->flag & AGRP_MUTED)) + continue; /* evaluate the F-Curve's value for the time given in the strip * NOTE: we use the modified time here, since strip's F-Curve Modifiers are applied on top of this diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index 4ac1648361e..5e9abd42aeb 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -928,6 +928,12 @@ static void setflag_anim_channels (bAnimContext *ac, short setting, short mode, case ACHANNEL_SETTING_EXPAND: ACHANNEL_SET_FLAG(agrp, mode, AGRP_EXPANDED); break; + case ACHANNEL_SETTING_MUTE: + ACHANNEL_SET_FLAG(agrp, mode, AGRP_MUTED); + break; + case ACHANNEL_SETTING_VISIBLE: + ACHANNEL_SET_FLAG_NEG(agrp, mode, AGRP_NOTVISIBLE); + break; } } break; @@ -1491,10 +1497,18 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s /* toggle expand */ agrp->flag ^= AGRP_EXPANDED; } + else if ((x < (offset+32)) && (ac->spacetype==SPACE_IPO)) { + /* toggle visibility (of grouped F-Curves in Graph editor) */ + agrp->flag ^= AGRP_NOTVISIBLE; + } else if (x >= (ACHANNEL_NAMEWIDTH-ACHANNEL_BUTTON_WIDTH)) { /* toggle protection/locking */ agrp->flag ^= AGRP_PROTECTED; } + else if (x >= (ACHANNEL_NAMEWIDTH-2*ACHANNEL_BUTTON_WIDTH)) { + /* toggle mute */ + agrp->flag ^= AGRP_MUTED; + } else { /* select/deselect group */ if (selectmode == SELECT_INVERT) { diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index f9c1b1bb42f..42943475a57 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -682,25 +682,30 @@ static int animdata_filter_action (ListBase *anim_data, bAction *act, int filter * cases when we should include F-Curves inside group: * - we don't care about visibility * - group is expanded - * - we're interested in keyframes, but not if they appear in selected channels + * - we just need the F-Curves present */ - // XXX what was the selection check here for again? - if ( (!(filter_mode & ANIMFILTER_VISIBLE) || EXPANDED_AGRP(agrp)) || - ( /*ANIMCHANNEL_SELOK(SEL_AGRP(agrp)) &&*/ (filter_mode & ANIMFILTER_CURVESONLY) ) ) + if ( (!(filter_mode & ANIMFILTER_VISIBLE) || EXPANDED_AGRP(agrp)) || (filter_mode & ANIMFILTER_CURVESONLY) ) { - if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_AGRP(agrp)) { - // XXX the 'owner' info here needs review... - items += animdata_filter_fcurves(anim_data, agrp->channels.first, agrp, owner, ownertype, filter_mode, owner_id); - - /* remove group from filtered list if last element is group - * (i.e. only if group had channels, which were all hidden) - */ - // XXX this is really hacky... it should be fixed in a much more elegant way! - if ( (ale) && (anim_data->last == ale) && - (ale->data == agrp) && (agrp->channels.first) ) - { - BLI_freelinkN(anim_data, ale); - items--; + /* for the Graph Editor, curves may be set to not be visible in the view to lessen clutter, + * but to do this, we need to check that the group doesn't have it's not-visible flag set preventing + * all its sub-curves to be shown + */ + if ( !(filter_mode & ANIMFILTER_CURVEVISIBLE) || !(agrp->flag & AGRP_NOTVISIBLE) ) + { + if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_AGRP(agrp)) { + // XXX the 'owner' info here needs review... + items += animdata_filter_fcurves(anim_data, agrp->channels.first, agrp, owner, ownertype, filter_mode, owner_id); + + /* remove group from filtered list if last element is group + * (i.e. only if group had channels, which were all hidden) + */ + // XXX this is really hacky... it should be fixed in a much more elegant way! + if ( (ale) && (anim_data->last == ale) && + (ale->data == agrp) && (agrp->channels.first) ) + { + BLI_freelinkN(anim_data, ale); + items--; + } } } } diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index f3a0dda4ce7..910b9733bc8 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -645,6 +645,11 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar) expand = ICON_TRIA_RIGHT; } + if (agrp->flag & AGRP_MUTED) + mute = ICON_MUTE_IPO_ON; + else + mute = ICON_MUTE_IPO_OFF; + if (EDITABLE_AGRP(agrp)) protect = ICON_UNLOCKED; else diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 0d7dafe2938..f8f613223db 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -1166,6 +1166,17 @@ void graph_draw_channel_names(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar) expand = ICON_TRIA_RIGHT; } + /* for now, 'special' (i.e. in front of name) is used to show visibility status */ + if (agrp->flag & AGRP_NOTVISIBLE) + special= ICON_CHECKBOX_DEHLT; + else + special= ICON_CHECKBOX_HLT; + + if (agrp->flag & AGRP_MUTED) + mute = ICON_MUTE_IPO_ON; + else + mute = ICON_MUTE_IPO_OFF; + if (EDITABLE_AGRP(agrp)) protect = ICON_UNLOCKED; else diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index a566f733978..4eddebc5b67 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -225,10 +225,18 @@ typedef struct bActionGroup { /* Action Group flags */ typedef enum eActionGroup_Flag { + /* group is selected */ AGRP_SELECTED = (1<<0), + /* group is 'active' / last selected one */ AGRP_ACTIVE = (1<<1), + /* keyframes/channels belonging to it cannot be edited */ AGRP_PROTECTED = (1<<2), + /* for UI, sub-channels are shown */ AGRP_EXPANDED = (1<<3), + /* sub-channels are not evaluated */ + AGRP_MUTED = (1<<4), + /* sub-channels are not visible in Graph Editor */ + AGRP_NOTVISIBLE = (1<<5), AGRP_TEMP = (1<<30), AGRP_MOVED = (1<<31) diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index 110b33850f0..a90fad983c4 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -737,6 +737,9 @@ enum { ADT_DRIVERS_COLLAPSED = (1<<10), /* don't execute drivers */ ADT_DRIVERS_DISABLED = (1<<11), + + /* F-Curves from this AnimData block are not visible in the Graph Editor */ + ADT_CURVES_NOT_VISIBLE = (1<<16), } eAnimData_Flag; /* Animation Data recalculation settings (to be set by depsgraph) */ -- cgit v1.2.3 From d059fc6d206b004ed265e300ddc619dbffce15cd Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 3 Jul 2009 10:54:39 +0000 Subject: 2.5 Upgrading text editor to draw new scrollbar too. --- source/blender/editors/include/UI_interface.h | 3 ++ .../blender/editors/interface/interface_intern.h | 1 - .../blender/editors/interface/interface_widgets.c | 4 +- source/blender/editors/interface/view2d.c | 4 +- source/blender/editors/space_text/text_draw.c | 55 +++++++++++++++------- 5 files changed, 44 insertions(+), 23 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index c0612c3524e..cc98d0fb3f3 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -214,6 +214,9 @@ void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad); void uiDrawMenuBox(float minx, float miny, float maxx, float maxy, short flag, short direction); void uiDrawBoxShadow(unsigned char alpha, float minx, float miny, float maxx, float maxy); +void uiWidgetScrollDraw(struct uiWidgetColors *wcol, rcti *rect, rcti *slider, int state); + + /* Menu Callbacks */ typedef void (*uiMenuCreateFunc)(struct bContext *C, struct uiLayout *layout, void *arg1); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index b2ba6fb38a8..1b16155c7e6 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -420,7 +420,6 @@ void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y void ui_draw_menu_back(struct uiStyle *style, uiBlock *block, rcti *rect); void ui_draw_search_back(struct uiStyle *style, uiBlock *block, rcti *rect); void ui_draw_link_bezier(rcti *rect); -void widget_scroll_draw(struct uiWidgetColors *wcol, rcti *rect, rcti *slider, int state); extern void ui_draw_but(const struct bContext *C, ARegion *ar, struct uiStyle *style, uiBut *but, rcti *rect); /* theme color init */ diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 751a09ede49..b63c7f105c3 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1639,7 +1639,7 @@ void ui_draw_link_bezier(rcti *rect) } /* function in use for buttons and for view2d sliders */ -void widget_scroll_draw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int state) +void uiWidgetScrollDraw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int state) { uiWidgetBase wtb; float rad; @@ -1718,7 +1718,7 @@ static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat rect1.ymin= rect1.ymax - ceil(fac*(but->a1 - but->softmin)); } - widget_scroll_draw(wcol, rect, &rect1, state); + uiWidgetScrollDraw(wcol, rect, &rect1, state); } diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 38c854f432e..705963981c8 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1461,7 +1461,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v slider.ymin= hor.ymin; slider.ymax= hor.ymax; - widget_scroll_draw(&wcol, &hor, &slider, (v2d->scroll_ui & V2D_SCROLL_H_ACTIVE)?UI_SELECT:0); + uiWidgetScrollDraw(&wcol, &hor, &slider, (v2d->scroll_ui & V2D_SCROLL_H_ACTIVE)?UI_SELECT:0); } /* scale indicators */ @@ -1553,7 +1553,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v slider.ymin= vs->vert_min; slider.ymax= vs->vert_max; - widget_scroll_draw(&wcol, &vert, &slider, (v2d->scroll_ui & V2D_SCROLL_V_ACTIVE)?UI_SELECT:0); + uiWidgetScrollDraw(&wcol, &vert, &slider, (v2d->scroll_ui & V2D_SCROLL_V_ACTIVE)?UI_SELECT:0); } diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 0dfe7c9e660..03b6a8dd862 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -41,6 +41,7 @@ #include "DNA_text_types.h" #include "DNA_space_types.h" #include "DNA_screen_types.h" +#include "DNA_userdef_types.h" #include "BKE_global.h" #include "BKE_main.h" @@ -701,7 +702,7 @@ static int text_draw(SpaceText *st, char *str, int cshift, int maxwidth, int dra /************************ draw scrollbar *****************************/ -static void calc_text_rcts(SpaceText *st, ARegion *ar) +static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll) { int lhlstart, lhlend, ltexth; short barheight, barstart, hlstart, hlend, blank_lines; @@ -713,6 +714,12 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar) ltexth= txt_get_span(st->text->lines.first, st->text->lines.last); blank_lines = st->viewlines / 2; + /* nicer code: use scroll rect for entire bar */ + scroll->xmin= 5; + scroll->xmax= 17; + scroll->ymin= 4; + scroll->ymax= 4+pix_available; + /* when resizing a vieport with the bar at the bottom to a greater height more blank lines will be added */ if(ltexth + blank_lines < st->top + st->viewlines) { blank_lines = st->top + st->viewlines - ltexth; @@ -728,9 +735,8 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar) } barstart = (ltexth > 0)? ((pix_available - pix_bardiff) * st->top)/ltexth: 0; - st->txtbar.xmin = 5; - st->txtbar.xmax = 17; - st->txtbar.ymax = ar->winy - pix_top_margin - barstart; + st->txtbar= *scroll; + st->txtbar.ymax -= barstart; st->txtbar.ymin = st->txtbar.ymax - barheight; CLAMP(st->txtbar.ymin, pix_bottom_margin, ar->winy - pix_top_margin); @@ -796,8 +802,7 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar) hlend = hlstart + 2; } - st->txtscroll.xmin= 5; - st->txtscroll.xmax= 17; + st->txtscroll= *scroll; st->txtscroll.ymax= ar->winy - pix_top_margin - hlstart; st->txtscroll.ymin= ar->winy - pix_top_margin - hlend; @@ -805,19 +810,31 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar) CLAMP(st->txtscroll.ymax, pix_bottom_margin, ar->winy - pix_top_margin); } -static void draw_textscroll(SpaceText *st, ARegion *ar) +static void draw_textscroll(SpaceText *st, ARegion *ar, rcti *scroll) { - UI_ThemeColorShade(TH_SHADE1, -20); - glRecti(2, 2, 20, ar->winy-6); - uiEmboss(2, 2, 20, ar->winy-6, 1); - - UI_ThemeColor(TH_SHADE1); - glRecti(st->txtbar.xmin, st->txtbar.ymin, st->txtbar.xmax, st->txtbar.ymax); + bTheme *btheme= U.themes.first; + uiWidgetColors wcol= btheme->tui.wcol_scroll; + char col[3]; + float rad; + +// UI_ThemeColorShade(TH_SHADE1, -20); +// glRecti(2, 2, 20, ar->winy-6); +// uiEmboss(2, 2, 20, ar->winy-6, 1); - UI_ThemeColor(TH_SHADE2); - glRecti(st->txtscroll.xmin, st->txtscroll.ymin, st->txtscroll.xmax, st->txtscroll.ymax); +// UI_ThemeColor(TH_SHADE1); +// glRecti(st->txtbar.xmin, st->txtbar.ymin, st->txtbar.xmax, st->txtbar.ymax); - uiEmboss(st->txtbar.xmin, st->txtbar.ymin, st->txtbar.xmax, st->txtbar.ymax, st->flags & ST_SCROLL_SELECT); +// uiEmboss(st->txtbar.xmin, st->txtbar.ymin, st->txtbar.xmax, st->txtbar.ymax, st->flags & ST_SCROLL_SELECT); + + uiWidgetScrollDraw(&wcol, scroll, &st->txtbar, (st->flags & ST_SCROLL_SELECT)?1:0); + + uiSetRoundBox(15); + rad= 0.4f*MIN2(st->txtscroll.xmax - st->txtscroll.xmin, st->txtscroll.ymax - st->txtscroll.ymin); + UI_GetThemeColor3ubv(TH_HILITE, col); + glColor4ub(col[0], col[1], col[2], 48); + glEnable(GL_BLEND); + uiRoundBox(st->txtscroll.xmin+1, st->txtscroll.ymin, st->txtscroll.xmax-1, st->txtscroll.ymax, rad); + glDisable(GL_BLEND); } /************************** draw markers **************************/ @@ -1261,6 +1278,7 @@ void draw_text_main(SpaceText *st, ARegion *ar) { Text *text= st->text; TextLine *tmp; + rcti scroll; char linenr[12]; int i, x, y, linecount= 0; @@ -1276,7 +1294,7 @@ void draw_text_main(SpaceText *st, ARegion *ar) else st->viewlines= 0; /* update rects for scroll */ - calc_text_rcts(st, ar); + calc_text_rcts(st, ar, &scroll); /* scroll will hold the entire bar size */ /* update syntax formatting if needed */ tmp= text->lines.first; @@ -1343,7 +1361,8 @@ void draw_text_main(SpaceText *st, ARegion *ar) /* draw other stuff */ draw_brackets(st, ar); draw_markers(st, ar); - draw_textscroll(st, ar); + glTranslatef(0.375f, 0.375f, 0.0f); /* XXX scroll requires exact pixel space */ + draw_textscroll(st, ar, &scroll); draw_documentation(st, ar); draw_suggestion_list(st, ar); -- cgit v1.2.3 From 74fc3a8e22d6daea40f62ae0c1b62ebc332b984d Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 3 Jul 2009 11:22:32 +0000 Subject: 2.5 - Quick compiling fix for Ton's commit Patch (http://www.pasteall.org/6436/diff) by skejoe. Thanks. --- source/blender/editors/include/UI_interface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index cc98d0fb3f3..bdfaec17c22 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -214,7 +214,7 @@ void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad); void uiDrawMenuBox(float minx, float miny, float maxx, float maxy, short flag, short direction); void uiDrawBoxShadow(unsigned char alpha, float minx, float miny, float maxx, float maxy); -void uiWidgetScrollDraw(struct uiWidgetColors *wcol, rcti *rect, rcti *slider, int state); +void uiWidgetScrollDraw(struct uiWidgetColors *wcol, struct rcti *rect, struct rcti *slider, int state); /* Menu Callbacks */ -- cgit v1.2.3 From c12b2796d7a666c41d59d3df45bff5f4cb7ef6f2 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 3 Jul 2009 11:24:52 +0000 Subject: 2.5 - Additional warning fix --- source/blender/editors/include/UI_interface.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index bdfaec17c22..2894ffee773 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -55,6 +55,7 @@ struct ColorBand; struct CurveMapping; struct Image; struct ImageUser; +struct uiWidgetColors; typedef struct uiBut uiBut; typedef struct uiBlock uiBlock; -- cgit v1.2.3 From 3c6f957097cec1bc8f7e64af304cc8dec12b2158 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 3 Jul 2009 11:46:46 +0000 Subject: fix for own missing var in recent commit. --- source/blender/editors/include/UI_interface.h | 1 + source/blender/python/intern/bpy_interface.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 2894ffee773..b7c13505d2e 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -51,6 +51,7 @@ struct rcti; struct rctf; struct uiStyle; struct uiFontStyle; +struct uiWidgetColors; struct ColorBand; struct CurveMapping; struct Image; diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 2b1b72d0307..fbd8339741e 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -151,6 +151,7 @@ wchar_t* Py_GetPath(void) /* must be called before Py_Initialize */ void BPY_start_python_path(void) { + char py_path[FILE_MAXDIR + 11] = ""; char *py_path_bundle= BLI_gethome_folder("python"); if(py_path_bundle==NULL) @@ -171,7 +172,7 @@ void BPY_start_python_path(void) sprintf(py_path, "PYTHONPATH=%s", py_path_bundle) putenv(py_path); #else - setenv("PYTHONPATH", py_path_bundle, 1); /* initializing the video driver can cause crashes on some systems - Campbell */ + setenv("PYTHONPATH", py_path_bundle, 1); #endif #endif -- cgit v1.2.3 From ea287fc4ec7f52a690730eb890c1c548d1d60773 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 3 Jul 2009 13:21:09 +0000 Subject: 2.5 More scroller work: - Added subtle arrow widgets to denote a scroller can zoom the view. - Made zoom symmetric (old convention to only zoom "one side" just worked badly) --- source/blender/editors/include/UI_interface.h | 4 +- source/blender/editors/include/UI_view2d.h | 4 +- .../blender/editors/interface/interface_widgets.c | 54 +++++++++++++++++----- source/blender/editors/interface/view2d.c | 20 +++++--- source/blender/editors/interface/view2d_ops.c | 14 ++---- source/blender/editors/space_text/text_draw.c | 2 +- 6 files changed, 65 insertions(+), 33 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index b7c13505d2e..cf284e7b111 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -216,9 +216,11 @@ void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad); void uiDrawMenuBox(float minx, float miny, float maxx, float maxy, short flag, short direction); void uiDrawBoxShadow(unsigned char alpha, float minx, float miny, float maxx, float maxy); +/* state for scrolldrawing */ +#define UI_SCROLL_PRESSED 1 +#define UI_SCROLL_ARROWS 2 void uiWidgetScrollDraw(struct uiWidgetColors *wcol, struct rcti *rect, struct rcti *slider, int state); - /* Menu Callbacks */ typedef void (*uiMenuCreateFunc)(struct bContext *C, struct uiLayout *layout, void *arg1); diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index b5e675af64e..537c1b42b97 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -101,8 +101,8 @@ enum { #define V2D_SCROLL_HEIGHT 17 #define V2D_SCROLL_WIDTH 17 -/* half the size (in pixels) of scroller 'handles' */ -#define V2D_SCROLLER_HANDLE_SIZE 5 +/* scroller 'handles' hotspot radius for mouse */ +#define V2D_SCROLLER_HANDLE_SIZE 12 /* ------ Define for UI_view2d_sync ----- */ diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index b63c7f105c3..2cd7c1d61cd 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -435,22 +435,33 @@ static void round_box_edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, flo /* based on button rect, return scaled array of triangles */ static void widget_num_tria(uiWidgetTrias *tria, rcti *rect, float triasize, char where) { - float centx, centy, size; - int a; + float centx, centy, sizex, sizey, minsize; + int a, i1=0, i2=1; + + minsize= MIN2(rect->xmax-rect->xmin, rect->ymax-rect->ymin); /* center position and size */ - centx= (float)rect->xmin + 0.5f*(rect->ymax-rect->ymin); - centy= (float)rect->ymin + 0.5f*(rect->ymax-rect->ymin); - size= -0.5f*triasize*(rect->ymax-rect->ymin); + centx= (float)rect->xmin + 0.5f*minsize; + centy= (float)rect->ymin + 0.5f*minsize; + sizex= sizey= -0.5f*triasize*minsize; if(where=='r') { - centx= (float)rect->xmax - 0.5f*(rect->ymax-rect->ymin); - size= -size; + centx= (float)rect->xmax - 0.5f*minsize; + sizex= -sizex; + } + else if(where=='t') { + centy= (float)rect->ymax - 0.5f*minsize; + sizey= -sizey; + i2=0; i1= 1; + } + else if(where=='b') { + sizex= -sizex; + i2=0; i1= 1; } for(a=0; a<19; a++) { - tria->vec[a][0]= size*num_tria_vert[a][0] + centx; - tria->vec[a][1]= size*num_tria_vert[a][1] + centy; + tria->vec[a][0]= sizex*num_tria_vert[a][i1] + centx; + tria->vec[a][1]= sizey*num_tria_vert[a][i2] + centy; } tria->tot= 19; @@ -1576,7 +1587,7 @@ static void widget_numbut(uiWidgetColors *wcol, rcti *rect, int state, int round /* decoration */ if(!(state & UI_TEXTINPUT)) { - widget_num_tria(&wtb.tria1, rect, 0.6f, 0); + widget_num_tria(&wtb.tria1, rect, 0.6f, 'l'); widget_num_tria(&wtb.tria2, rect, 0.6f, 'r'); } widgetbase_draw(&wtb, wcol); @@ -1676,15 +1687,30 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int stat wcol->shadetop+= 20; /* XXX violates themes... */ else wcol->shadedown+= 20; - if(state & UI_SELECT) + if(state & UI_SCROLL_PRESSED) SWAP(short, wcol->shadetop, wcol->shadedown); /* draw */ wtb.emboss= 0; /* only emboss once */ round_box_edges(&wtb, 15, slider, rad); - widgetbase_draw(&wtb, wcol); + if(state & UI_SCROLL_ARROWS) { + if(wcol->item[0] > 48) wcol->item[0]-= 48; + if(wcol->item[1] > 48) wcol->item[1]-= 48; + if(wcol->item[2] > 48) wcol->item[2]-= 48; + wcol->item[3]= 255; + + if(horizontal) { + widget_num_tria(&wtb.tria1, slider, 0.6f, 'l'); + widget_num_tria(&wtb.tria2, slider, 0.6f, 'r'); + } + else { + widget_num_tria(&wtb.tria1, slider, 0.6f, 'b'); + widget_num_tria(&wtb.tria2, slider, 0.6f, 't'); + } + } + widgetbase_draw(&wtb, wcol); } } @@ -1718,6 +1744,10 @@ static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat rect1.ymin= rect1.ymax - ceil(fac*(but->a1 - but->softmin)); } + if(state & UI_SELECT) + state= UI_SCROLL_PRESSED; + else + state= 0; uiWidgetScrollDraw(wcol, rect, &rect1, state); } diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 705963981c8..11714df0491 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1207,14 +1207,14 @@ void UI_view2d_grid_free(View2DGrid *grid) * For now, we don't need to have a separate (internal) header for structs like this... */ struct View2DScrollers { - rcti hor, vert; /* exact size of slider backdrop */ - int horfull, vertfull; /* set if sliders are full, we don't draw them */ - /* focus bubbles */ int vert_min, vert_max; /* vertical scrollbar */ int hor_min, hor_max; /* horizontal scrollbar */ - /* scales */ + rcti hor, vert; /* exact size of slider backdrop */ + int horfull, vertfull; /* set if sliders are full, we don't draw them */ + + /* scales */ View2DGrid *grid; /* grid for coordinate drawing */ short xunits, xclamp; /* units and clamping options for x-axis */ short yunits, yclamp; /* units and clamping options for y-axis */ @@ -1455,13 +1455,17 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v bTheme *btheme= U.themes.first; uiWidgetColors wcol= btheme->tui.wcol_scroll; rcti slider; + int state; slider.xmin= vs->hor_min; slider.xmax= vs->hor_max; slider.ymin= hor.ymin; slider.ymax= hor.ymax; - uiWidgetScrollDraw(&wcol, &hor, &slider, (v2d->scroll_ui & V2D_SCROLL_H_ACTIVE)?UI_SELECT:0); + state= (v2d->scroll_ui & V2D_SCROLL_H_ACTIVE)?UI_SCROLL_PRESSED:0; + if (!(v2d->keepzoom & V2D_LOCKZOOM_X)) + state |= UI_SCROLL_ARROWS; + uiWidgetScrollDraw(&wcol, &hor, &slider, state); } /* scale indicators */ @@ -1547,13 +1551,17 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v bTheme *btheme= U.themes.first; uiWidgetColors wcol= btheme->tui.wcol_scroll; rcti slider; + int state; slider.xmin= vert.xmin; slider.xmax= vert.xmax; slider.ymin= vs->vert_min; slider.ymax= vs->vert_max; - uiWidgetScrollDraw(&wcol, &vert, &slider, (v2d->scroll_ui & V2D_SCROLL_V_ACTIVE)?UI_SELECT:0); + state= (v2d->scroll_ui & V2D_SCROLL_V_ACTIVE)?UI_SCROLL_PRESSED:0; + if (!(v2d->keepzoom & V2D_LOCKZOOM_Y)) + state |= UI_SCROLL_ARROWS; + uiWidgetScrollDraw(&wcol, &vert, &slider, state); } diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index ae89e215a03..101d89da618 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1010,15 +1010,7 @@ static short mouse_in_scroller_handle(int mouse, int sc_min, int sc_max, int sh_ if (in_view == 0) { - /* handles are only activated if the mouse is within the relative quater lengths of the scroller */ - int qLen = (sc_max + sc_min) / 4; - - if (mouse >= (sc_max - qLen)) - return SCROLLHANDLE_MAX; - else if (mouse <= qLen) - return SCROLLHANDLE_MIN; - else - return SCROLLHANDLE_BAR; + return SCROLLHANDLE_BAR; } /* check if mouse is in or past either handle */ @@ -1128,14 +1120,14 @@ static void scroller_activate_apply(bContext *C, wmOperator *op) /* type of movement */ switch (vsm->zone) { case SCROLLHANDLE_MIN: + case SCROLLHANDLE_MAX: + /* only expand view on axis if zoom is allowed */ if ((vsm->scroller == 'h') && !(v2d->keepzoom & V2D_LOCKZOOM_X)) v2d->cur.xmin -= temp; if ((vsm->scroller == 'v') && !(v2d->keepzoom & V2D_LOCKZOOM_Y)) v2d->cur.ymin -= temp; - break; - case SCROLLHANDLE_MAX: /* only expand view on axis if zoom is allowed */ if ((vsm->scroller == 'h') && !(v2d->keepzoom & V2D_LOCKZOOM_X)) v2d->cur.xmax += temp; diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 03b6a8dd862..48c14804b13 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -826,7 +826,7 @@ static void draw_textscroll(SpaceText *st, ARegion *ar, rcti *scroll) // uiEmboss(st->txtbar.xmin, st->txtbar.ymin, st->txtbar.xmax, st->txtbar.ymax, st->flags & ST_SCROLL_SELECT); - uiWidgetScrollDraw(&wcol, scroll, &st->txtbar, (st->flags & ST_SCROLL_SELECT)?1:0); + uiWidgetScrollDraw(&wcol, scroll, &st->txtbar, (st->flags & ST_SCROLL_SELECT)?UI_SCROLL_PRESSED:0); uiSetRoundBox(15); rad= 0.4f*MIN2(st->txtscroll.xmax - st->txtscroll.xmin, st->txtscroll.ymax - st->txtscroll.ymin); -- cgit v1.2.3 From a7d6b6eebf761f87ec3e5972c99ca0aedf312acd Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 3 Jul 2009 13:48:42 +0000 Subject: 2.5 Windows #ifdef code missed semicolon. --- source/blender/python/intern/bpy_interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index fbd8339741e..62e374953b0 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -162,14 +162,14 @@ void BPY_start_python_path(void) #if (defined(WIN32) || defined(WIN64)) #if defined(FREE_WINDOWS) - sprintf(py_path, "PYTHONPATH=%s", py_path_bundle) + sprintf(py_path, "PYTHONPATH=%s", py_path_bundle); putenv(py_path); #else _putenv_s("PYTHONPATH", py_path_bundle); #endif #else #ifdef __sgi - sprintf(py_path, "PYTHONPATH=%s", py_path_bundle) + sprintf(py_path, "PYTHONPATH=%s", py_path_bundle); putenv(py_path); #else setenv("PYTHONPATH", py_path_bundle, 1); -- cgit v1.2.3 From 9f33496088e6373600641b8471fe487aa1587e75 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 3 Jul 2009 15:23:33 +0000 Subject: 2.5 * Lattices: properties editable, editmode operators, menus working again. As a bonus you can now edit u/v/w in editmode. * Shape Keys: some code cleanup, and added more buttons. The value/min/max buttons don't work correct yet though. * Fix issue with uv textures, vertex colors not being visible outside editmode, and a few other issue. Mesh.edit_mesh is now NULL when not in editmode. --- source/blender/blenkernel/intern/lattice.c | 105 +++++++------ source/blender/editors/include/ED_screen.h | 1 + .../blender/editors/interface/interface_layout.c | 2 +- source/blender/editors/object/editkey.c | 116 ++++---------- source/blender/editors/object/editlattice.c | 174 +++++++++++++-------- source/blender/editors/object/object_edit.c | 6 +- source/blender/editors/object/object_intern.h | 3 + source/blender/editors/object/object_modifier.c | 4 +- source/blender/editors/object/object_ops.c | 7 + source/blender/editors/screen/screen_ops.c | 9 ++ source/blender/editors/space_view3d/space_view3d.c | 7 +- .../blender/editors/space_view3d/view3d_header.c | 136 ++++------------ source/blender/makesrna/intern/rna_key.c | 59 ++++++- source/blender/makesrna/intern/rna_lattice.c | 115 +++++++++++++- source/blender/makesrna/intern/rna_object.c | 22 +++ 15 files changed, 448 insertions(+), 318 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 5cf52d09314..67d63d527cb 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -232,8 +232,8 @@ void free_lattice(Lattice *lt) if(lt->def) MEM_freeN(lt->def); if(lt->dvert) free_dverts(lt->dvert, lt->pntsu*lt->pntsv*lt->pntsw); if(lt->editlatt) { - if(lt->def) MEM_freeN(lt->def); - if(lt->dvert) free_dverts(lt->dvert, lt->pntsu*lt->pntsv*lt->pntsw); + if(lt->editlatt->def) MEM_freeN(lt->editlatt->def); + if(lt->editlatt->dvert) free_dverts(lt->editlatt->dvert, lt->pntsu*lt->pntsv*lt->pntsw); MEM_freeN(lt->editlatt); } } @@ -817,59 +817,68 @@ void outside_lattice(Lattice *lt) int u, v, w; float fac1, du=0.0, dv=0.0, dw=0.0; - bp= lt->def; + if(lt->flag & LT_OUTSIDE) { + bp= lt->def; - if(lt->pntsu>1) du= 1.0f/((float)lt->pntsu-1); - if(lt->pntsv>1) dv= 1.0f/((float)lt->pntsv-1); - if(lt->pntsw>1) dw= 1.0f/((float)lt->pntsw-1); - - for(w=0; wpntsw; w++) { - - for(v=0; vpntsv; v++) { - - for(u=0; upntsu; u++, bp++) { - if(u==0 || v==0 || w==0 || u==lt->pntsu-1 || v==lt->pntsv-1 || w==lt->pntsw-1); - else { - - bp->hide= 1; - bp->f1 &= ~SELECT; - - /* u extrema */ - bp1= latt_bp(lt, 0, v, w); - bp2= latt_bp(lt, lt->pntsu-1, v, w); - - fac1= du*u; - bp->vec[0]= (1.0f-fac1)*bp1->vec[0] + fac1*bp2->vec[0]; - bp->vec[1]= (1.0f-fac1)*bp1->vec[1] + fac1*bp2->vec[1]; - bp->vec[2]= (1.0f-fac1)*bp1->vec[2] + fac1*bp2->vec[2]; - - /* v extrema */ - bp1= latt_bp(lt, u, 0, w); - bp2= latt_bp(lt, u, lt->pntsv-1, w); - - fac1= dv*v; - bp->vec[0]+= (1.0f-fac1)*bp1->vec[0] + fac1*bp2->vec[0]; - bp->vec[1]+= (1.0f-fac1)*bp1->vec[1] + fac1*bp2->vec[1]; - bp->vec[2]+= (1.0f-fac1)*bp1->vec[2] + fac1*bp2->vec[2]; - - /* w extrema */ - bp1= latt_bp(lt, u, v, 0); - bp2= latt_bp(lt, u, v, lt->pntsw-1); - - fac1= dw*w; - bp->vec[0]+= (1.0f-fac1)*bp1->vec[0] + fac1*bp2->vec[0]; - bp->vec[1]+= (1.0f-fac1)*bp1->vec[1] + fac1*bp2->vec[1]; - bp->vec[2]+= (1.0f-fac1)*bp1->vec[2] + fac1*bp2->vec[2]; - - VecMulf(bp->vec, 0.3333333f); + if(lt->pntsu>1) du= 1.0f/((float)lt->pntsu-1); + if(lt->pntsv>1) dv= 1.0f/((float)lt->pntsv-1); + if(lt->pntsw>1) dw= 1.0f/((float)lt->pntsw-1); + + for(w=0; wpntsw; w++) { + + for(v=0; vpntsv; v++) { + + for(u=0; upntsu; u++, bp++) { + if(u==0 || v==0 || w==0 || u==lt->pntsu-1 || v==lt->pntsv-1 || w==lt->pntsw-1); + else { + bp->hide= 1; + bp->f1 &= ~SELECT; + + /* u extrema */ + bp1= latt_bp(lt, 0, v, w); + bp2= latt_bp(lt, lt->pntsu-1, v, w); + + fac1= du*u; + bp->vec[0]= (1.0f-fac1)*bp1->vec[0] + fac1*bp2->vec[0]; + bp->vec[1]= (1.0f-fac1)*bp1->vec[1] + fac1*bp2->vec[1]; + bp->vec[2]= (1.0f-fac1)*bp1->vec[2] + fac1*bp2->vec[2]; + + /* v extrema */ + bp1= latt_bp(lt, u, 0, w); + bp2= latt_bp(lt, u, lt->pntsv-1, w); + + fac1= dv*v; + bp->vec[0]+= (1.0f-fac1)*bp1->vec[0] + fac1*bp2->vec[0]; + bp->vec[1]+= (1.0f-fac1)*bp1->vec[1] + fac1*bp2->vec[1]; + bp->vec[2]+= (1.0f-fac1)*bp1->vec[2] + fac1*bp2->vec[2]; + + /* w extrema */ + bp1= latt_bp(lt, u, v, 0); + bp2= latt_bp(lt, u, v, lt->pntsw-1); + + fac1= dw*w; + bp->vec[0]+= (1.0f-fac1)*bp1->vec[0] + fac1*bp2->vec[0]; + bp->vec[1]+= (1.0f-fac1)*bp1->vec[1] + fac1*bp2->vec[1]; + bp->vec[2]+= (1.0f-fac1)*bp1->vec[2] + fac1*bp2->vec[2]; + + VecMulf(bp->vec, 0.3333333f); + + } } + } } - } - + else { + bp= lt->def; + + for(w=0; wpntsw; w++) + for(v=0; vpntsv; v++) + for(u=0; upntsu; u++, bp++) + bp->hide= 0; + } } float (*lattice_getVertexCos(struct Object *ob, int *numVerts_r))[3] diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index ef682c871bc..4bb1dd65f85 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -127,6 +127,7 @@ int ED_operator_editcurve(struct bContext *C); int ED_operator_editsurf(struct bContext *C); int ED_operator_editsurfcurve(struct bContext *C); int ED_operator_editfont(struct bContext *C); +int ED_operator_editlattice(struct bContext *C); int ED_operator_uvedit(struct bContext *C); int ED_operator_uvmap(struct bContext *C); int ED_operator_posemode(struct bContext *C); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 2e30c5f1cb7..59726c6d5fd 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -699,7 +699,7 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PropertyRNA subtype= RNA_property_subtype(prop); len= RNA_property_array_length(prop); - if(type == PROP_STRING && strcmp(name, "") == 0) + if(ELEM(type, PROP_STRING, PROP_POINTER) && strcmp(name, "") == 0) name= "non-empty"; w= ui_text_icon_width(layout, name, icon); diff --git a/source/blender/editors/object/editkey.c b/source/blender/editors/object/editkey.c index 1c31c7c7653..f38c03fb284 100644 --- a/source/blender/editors/object/editkey.c +++ b/source/blender/editors/object/editkey.c @@ -78,10 +78,6 @@ #include "object_intern.h" -/* XXX */ -static void BIF_undo_push() {} -/* XXX */ - #if 0 // XXX old animation system static void default_key_ipo(Scene *scene, Key *key) { @@ -117,7 +113,7 @@ static void default_key_ipo(Scene *scene, Key *key) #endif // XXX old animation system -/* **************************************** */ +/************************* Mesh ************************/ void mesh_to_key(Mesh *me, KeyBlock *kb) { @@ -213,7 +209,7 @@ void insert_meshkey(Scene *scene, Mesh *me, short rel) mesh_to_key(me, kb); } -/* ******************** */ +/************************* Lattice ************************/ void latt_to_key(Lattice *lt, KeyBlock *kb) { @@ -271,7 +267,7 @@ void insert_lattkey(Scene *scene, Lattice *lt, short rel) latt_to_key(lt, kb); } -/* ******************************** */ +/************************* Curve ************************/ void curve_to_key(Curve *cu, KeyBlock *kb, ListBase *nurb) { @@ -383,7 +379,7 @@ void insert_curvekey(Scene *scene, Curve *cu, short rel) if(cu->key==NULL) { cu->key= add_key( (ID *)cu); - if (rel) + if(rel) cu->key->type = KEY_RELATIVE; // else // default_key_ipo(scene, cu->key); // XXX old animation system @@ -396,17 +392,34 @@ void insert_curvekey(Scene *scene, Curve *cu, short rel) else curve_to_key(cu, kb, &cu->nurb); } +/*********************** add shape key ***********************/ + +void ED_object_shape_key_add(bContext *C, Scene *scene, Object *ob) +{ + Key *key; + + if(ob->type==OB_MESH) insert_meshkey(scene, ob->data, 1); + else if ELEM(ob->type, OB_CURVE, OB_SURF) insert_curvekey(scene, ob->data, 1); + else if(ob->type==OB_LATTICE) insert_lattkey(scene, ob->data, 1); -/* ******************** */ + key= ob_get_key(ob); + ob->shapenr= BLI_countlist(&key->block); -void delete_key(Scene *scene, Object *ob) + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); +} + +/*********************** remove shape key ***********************/ + +int ED_object_shape_key_remove(bContext *C, Scene *scene, Object *ob) { + Main *bmain= CTX_data_main(C); KeyBlock *kb, *rkb; Key *key; //IpoCurve *icu; - + key= ob_get_key(ob); - if(key==NULL) return; + if(key==NULL) + return 0; kb= BLI_findlink(&key->block, ob->shapenr-1); @@ -417,15 +430,15 @@ void delete_key(Scene *scene, Object *ob) BLI_remlink(&key->block, kb); key->totkey--; - if(key->refkey== kb) key->refkey= key->block.first; + if(key->refkey== kb) + key->refkey= key->block.first; if(kb->data) MEM_freeN(kb->data); MEM_freeN(kb); - for(kb= key->block.first; kb; kb= kb->next) { + for(kb= key->block.first; kb; kb= kb->next) if(kb->adrcode>=ob->shapenr) kb->adrcode--; - } #if 0 // XXX old animation system if(key->ipo) { @@ -451,12 +464,13 @@ void delete_key(Scene *scene, Object *ob) else if(GS(key->from->name)==ID_CU) ((Curve *)key->from)->key= NULL; else if(GS(key->from->name)==ID_LT) ((Lattice *)key->from)->key= NULL; - free_libblock_us(&(G.main->key), key); + free_libblock_us(&(bmain->key), key); } DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA); - - BIF_undo_push("Delete Shapekey"); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + + return 1; } /********************** shape key operators *********************/ @@ -465,19 +479,11 @@ static int shape_key_add_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - Key *key; if(!ob) return OPERATOR_CANCELLED; - if(ob->type==OB_MESH) insert_meshkey(scene, ob->data, 1); - else if ELEM(ob->type, OB_CURVE, OB_SURF) insert_curvekey(scene, ob->data, 1); - else if(ob->type==OB_LATTICE) insert_lattkey(scene, ob->data, 1); - - key= ob_get_key(ob); - ob->shapenr= BLI_countlist(&key->block); - - WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + ED_object_shape_key_add(C, scene, ob); return OPERATOR_FINISHED; } @@ -499,67 +505,13 @@ static int shape_key_remove_exec(bContext *C, wmOperator *op) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Scene *scene= CTX_data_scene(C); - Main *bmain= CTX_data_main(C); - KeyBlock *kb, *rkb; - Key *key; - //IpoCurve *icu; if(!ob) return OPERATOR_CANCELLED; - key= ob_get_key(ob); - if(key==NULL) + if(!ED_object_shape_key_remove(C, scene, ob)) return OPERATOR_CANCELLED; - kb= BLI_findlink(&key->block, ob->shapenr-1); - - if(kb) { - for(rkb= key->block.first; rkb; rkb= rkb->next) - if(rkb->relative == ob->shapenr-1) - rkb->relative= 0; - - BLI_remlink(&key->block, kb); - key->totkey--; - if(key->refkey== kb) - key->refkey= key->block.first; - - if(kb->data) MEM_freeN(kb->data); - MEM_freeN(kb); - - for(kb= key->block.first; kb; kb= kb->next) - if(kb->adrcode>=ob->shapenr) - kb->adrcode--; - -#if 0 // XXX old animation system - if(key->ipo) { - - for(icu= key->ipo->curve.first; icu; icu= icu->next) { - if(icu->adrcode==ob->shapenr-1) { - BLI_remlink(&key->ipo->curve, icu); - free_ipo_curve(icu); - break; - } - } - for(icu= key->ipo->curve.first; icu; icu= icu->next) - if(icu->adrcode>=ob->shapenr) - icu->adrcode--; - } -#endif // XXX old animation system - - if(ob->shapenr>1) ob->shapenr--; - } - - if(key->totkey==0) { - if(GS(key->from->name)==ID_ME) ((Mesh *)key->from)->key= NULL; - else if(GS(key->from->name)==ID_CU) ((Curve *)key->from)->key= NULL; - else if(GS(key->from->name)==ID_LT) ((Lattice *)key->from)->key= NULL; - - free_libblock_us(&(bmain->key), key); - } - - DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); - return OPERATOR_FINISHED; } diff --git a/source/blender/editors/object/editlattice.c b/source/blender/editors/object/editlattice.c index 523f38dd432..3e30efd635a 100644 --- a/source/blender/editors/object/editlattice.c +++ b/source/blender/editors/object/editlattice.c @@ -52,6 +52,7 @@ #include "BKE_utildefines.h" #include "ED_object.h" +#include "ED_screen.h" #include "ED_view3d.h" #include "ED_util.h" @@ -60,16 +61,15 @@ #include "object_intern.h" -/* ***************************** */ - -static int okee() {return 0;} +/********************** Load/Make/Free ********************/ void free_editLatt(Object *ob) { Lattice *lt= ob->data; if(lt->editlatt) { - if(lt->editlatt->def) MEM_freeN(lt->editlatt->def); + if(lt->editlatt->def) + MEM_freeN(lt->editlatt->def); if(lt->editlatt->dvert) free_dverts(lt->editlatt->dvert, lt->editlatt->pntsu*lt->editlatt->pntsv*lt->editlatt->pntsw); @@ -78,27 +78,6 @@ void free_editLatt(Object *ob) } } - -static void setflagsLatt(Object *obedit, int flag) -{ - Lattice *lt= obedit->data; - BPoint *bp; - int a; - - bp= lt->editlatt->def; - - a= lt->editlatt->pntsu*lt->editlatt->pntsv*lt->editlatt->pntsw; - - while(a--) { - if(bp->hide==0) { - bp->f1= flag; - } - bp++; - } -} - - - void make_editLatt(Object *obedit) { Lattice *lt= obedit->data; @@ -108,10 +87,9 @@ void make_editLatt(Object *obedit) lt= obedit->data; - actkey = ob_get_keyblock(obedit); - if(actkey) { + actkey= ob_get_keyblock(obedit); + if(actkey) key_to_latt(actkey, lt); - } lt->editlatt= MEM_dupallocN(lt); lt->editlatt->def= MEM_dupallocN(lt->def); @@ -121,11 +99,8 @@ void make_editLatt(Object *obedit) lt->editlatt->dvert = MEM_mallocN (sizeof (MDeformVert)*tot, "Lattice MDeformVert"); copy_dverts(lt->editlatt->dvert, lt->dvert, tot); } - - //BIF_undo_push("Original"); } - void load_editLatt(Object *obedit) { Lattice *lt; @@ -136,7 +111,8 @@ void load_editLatt(Object *obedit) lt= obedit->data; - actkey = ob_get_keyblock(obedit); + actkey= ob_get_keyblock(obedit); + if(actkey) { /* active key: vertices */ tot= lt->editlatt->pntsu*lt->editlatt->pntsv*lt->editlatt->pntsw; @@ -154,7 +130,6 @@ void load_editLatt(Object *obedit) } } else { - MEM_freeN(lt->def); lt->def= MEM_dupallocN(lt->editlatt->def); @@ -181,55 +156,135 @@ void load_editLatt(Object *obedit) lt->dvert = MEM_mallocN (sizeof (MDeformVert)*tot, "Lattice MDeformVert"); copy_dverts(lt->dvert, lt->editlatt->dvert, tot); } - } -void remake_editLatt(Object *obedit) +/************************** Operators *************************/ + +static void setflagsLatt(Object *obedit, int flag) { - if(okee("Reload original data")==0) return; + Lattice *lt= obedit->data; + BPoint *bp; + int a; - make_editLatt(obedit); - - //BIF_undo_push("Reload original"); + bp= lt->editlatt->def; + + a= lt->editlatt->pntsu*lt->editlatt->pntsv*lt->editlatt->pntsw; + + while(a--) { + if(bp->hide==0) { + bp->f1= flag; + } + bp++; + } } - -void deselectall_Latt(Object *obedit) +int de_select_all_exec(bContext *C, wmOperator *op) { + Object *obedit= CTX_data_edit_object(C); Lattice *lt= obedit->data; BPoint *bp; - int a; + int a, deselect= 0; bp= lt->editlatt->def; - a= lt->editlatt->pntsu*lt->editlatt->pntsv*lt->editlatt->pntsw; while(a--) { if(bp->hide==0) { if(bp->f1) { - setflagsLatt(obedit, 0); - //BIF_undo_push("(De)select all"); - return; + deselect= 1; + break; } } bp++; } - setflagsLatt(obedit, 1); - //BIF_undo_push("(De)select all"); + + if(deselect) + setflagsLatt(obedit, 0); + else + setflagsLatt(obedit, 1); + + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + + return OPERATOR_FINISHED; } +void LATTICE_OT_select_all_toggle(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Select or Deselect All"; + ot->idname= "LATTICE_OT_select_all_toggle"; + + /* api callbacks */ + ot->exec= de_select_all_exec; + ot->poll= ED_operator_editlattice; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +int make_regular_poll(bContext *C) +{ + Object *ob; + + if(ED_operator_editlattice(C)) return 1; + + ob= CTX_data_active_object(C); + return (ob && ob->type==OB_LATTICE); +} + +int make_regular_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_edit_object(C); + Lattice *lt; + + if(ob) { + lt= ob->data; + resizelattice(lt->editlatt, lt->pntsu, lt->pntsv, lt->pntsw, NULL); + } + else { + ob= CTX_data_active_object(C); + lt= ob->data; + resizelattice(lt, lt->pntsu, lt->pntsv, lt->pntsw, NULL); + } + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + + return OPERATOR_FINISHED; +} + +void LATTICE_OT_make_regular(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Make Regular"; + ot->idname= "LATTICE_OT_make_regular"; + + /* api callbacks */ + ot->exec= make_regular_exec; + ot->poll= make_regular_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/****************************** Mouse Selection *************************/ + static void findnearestLattvert__doClosest(void *userData, BPoint *bp, int x, int y) { struct { BPoint *bp; short dist, select, mval[2]; } *data = userData; float temp = abs(data->mval[0]-x) + abs(data->mval[1]-y); - if ((bp->f1 & SELECT)==data->select) temp += 5; - if (tempdist) { + if((bp->f1 & SELECT)==data->select) + temp += 5; + + if(tempdist) { data->dist = temp; data->bp = bp; } } + static BPoint *findnearestLattvert(ViewContext *vc, short mval[2], int sel) { /* sel==1: selected gets a disadvantage */ @@ -247,34 +302,27 @@ static BPoint *findnearestLattvert(ViewContext *vc, short mval[2], int sel) return data.bp; } - void mouse_lattice(bContext *C, short mval[2], int extend) { ViewContext vc; - BPoint *bp=0; + BPoint *bp= NULL; view3d_set_viewcontext(C, &vc); - bp= findnearestLattvert(&vc, mval, 1); if(bp) { if(extend==0) { - setflagsLatt(vc.obedit, 0); bp->f1 |= SELECT; - } - else { + else bp->f1 ^= SELECT; /* swap */ - } WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, vc.obedit); - //BIF_undo_push("Select"); } } - -/* **************** undo for lattice object ************** */ +/******************************** Undo *************************/ typedef struct UndoLattice { BPoint *def; @@ -324,20 +372,18 @@ static int validate_undoLatt(void *data, void *edata) static void *get_editlatt(bContext *C) { Object *obedit= CTX_data_edit_object(C); + if(obedit && obedit->type==OB_LATTICE) { Lattice *lt= obedit->data; return lt->editlatt; } + return NULL; } - /* and this is all the undo system needs to know */ void undo_push_lattice(bContext *C, char *name) { undo_editmode_push(C, name, get_editlatt, free_undoLatt, undoLatt_to_editLatt, editLatt_to_undoLatt, validate_undoLatt); } - - -/***/ diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index c436ccdb328..c28200612ea 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -3208,7 +3208,11 @@ void ED_object_exit_editmode(bContext *C, int flag) } load_editMesh(scene, obedit); - if(freedata) free_editMesh(me->edit_mesh); + if(freedata) { + free_editMesh(me->edit_mesh); + MEM_freeN(me->edit_mesh); + me->edit_mesh= NULL; + } if(G.f & G_WEIGHTPAINT) mesh_octree_table(obedit, NULL, NULL, 'e'); diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 6ec5f029148..f7bdf5da924 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -78,6 +78,9 @@ void make_editLatt(Object *obedit); void load_editLatt(Object *obedit); void remake_editLatt(Object *obedit); +void LATTICE_OT_select_all_toggle(struct wmOperatorType *ot); +void LATTICE_OT_make_regular(struct wmOperatorType *ot); + /* editgroup.c */ void GROUP_OT_group_create(struct wmOperatorType *ot); void GROUP_OT_objects_remove(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index bda3e4e8f79..a2ea02c24a4 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -763,9 +763,7 @@ static uiBlock *modifiers_add_menu(void *ob_v) ModifierTypeInfo *mti = modifierType_getInfo(i); /* Only allow adding through appropriate other interfaces */ - if(ELEM3(i, eModifierType_Softbody, eModifierType_Hook, eModifierType_ParticleSystem)) continue; - - if(ELEM4(i, eModifierType_Cloth, eModifierType_Collision, eModifierType_Surface, eModifierType_Fluidsim)) continue; + if(ELEM(i, eModifierType_ParticleSystem, eModifierType_Surface)) continue; if((mti->flags&eModifierTypeFlag_AcceptsCVs) || (ob->type==OB_MESH && (mti->flags&eModifierTypeFlag_AcceptsMesh))) { diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 6248d826ad4..37e9a2e75ff 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -122,6 +122,9 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_shape_key_add); WM_operatortype_append(OBJECT_OT_shape_key_remove); + + WM_operatortype_append(LATTICE_OT_select_all_toggle); + WM_operatortype_append(LATTICE_OT_make_regular); } void ED_keymap_object(wmWindowManager *wm) @@ -168,5 +171,9 @@ void ED_keymap_object(wmWindowManager *wm) WM_keymap_verify_item(keymap, "GROUP_OT_objects_add_active", GKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); WM_keymap_verify_item(keymap, "GROUP_OT_objects_remove_active", GKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0); + /* Lattice */ + keymap= WM_keymap_listbase(wm, "Lattice", 0, 0); + + WM_keymap_add_item(keymap, "LATTICE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index dcfdfbf8285..631ab3cf8cb 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -34,6 +34,7 @@ #include "DNA_armature_types.h" #include "DNA_image_types.h" +#include "DNA_lattice_types.h" #include "DNA_object_types.h" #include "DNA_mesh_types.h" #include "DNA_curve_types.h" @@ -287,6 +288,14 @@ int ED_operator_editfont(bContext *C) return 0; } +int ED_operator_editlattice(bContext *C) +{ + Object *obedit= CTX_data_edit_object(C); + if(obedit && obedit->type==OB_LATTICE) + return NULL != ((Lattice *)obedit->data)->editlatt; + return 0; +} + /* *************************** action zone operator ************************** */ /* operator state vars used: diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 1ea69d595d3..c93926c908e 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -304,6 +304,12 @@ static void view3d_modal_keymaps(wmWindowManager *wm, ARegion *ar, int stype) else WM_event_remove_keymap_handler(&ar->handlers, keymap); + keymap= WM_keymap_listbase(wm, "Lattice", 0, 0); + if(stype==NS_EDITMODE_LATTICE) + WM_event_add_keymap_handler(&ar->handlers, keymap); + else + WM_event_remove_keymap_handler(&ar->handlers, keymap); + /* armature sketching needs to take over mouse */ keymap= WM_keymap_listbase(wm, "Armature_Sketch", 0, 0); if(stype==NS_EDITMODE_TEXT) @@ -323,7 +329,6 @@ static void view3d_modal_keymaps(wmWindowManager *wm, ARegion *ar, int stype) WM_event_add_keymap_handler_priority(&ar->handlers, keymap, 10); else WM_event_remove_keymap_handler(&ar->handlers, keymap); - } /* add handlers, stuff you only do once or on area/region changes */ diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 5edcd203e16..6a44b0d4476 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -1302,46 +1302,11 @@ static uiBlock *view3d_select_metaballmenu(bContext *C, ARegion *ar, void *arg_u return block; } -static void do_view3d_select_latticemenu(bContext *C, void *arg, int event) +static void view3d_select_latticemenu(bContext *C, uiLayout *layout, void *arg_unused) { -#if 0 -/* extern void borderselect(void);*/ - - switch(event) { - case 0: /* border select */ - borderselect(); - break; - case 2: /* Select/Deselect all */ - deselectall_Latt(); - break; - } -#endif -} - -static uiBlock *view3d_select_latticemenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "view3d_select_latticemenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_select_latticemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - if(ar->alignment==RGN_ALIGN_TOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; + uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border"); + uiItemS(layout); + uiItemO(layout, NULL, 0, "LATTICE_OT_select_all_toggle"); } static void do_view3d_select_armaturemenu(bContext *C, void *arg, int event) @@ -3327,10 +3292,11 @@ static void view3d_edit_curve_showhidemenu(bContext *C, uiLayout *layout, void * static void view3d_edit_curvemenu(bContext *C, uiLayout *layout, void *arg_unused) { - PointerRNA sceneptr; Scene *scene= CTX_data_scene(C); - - RNA_id_pointer_create(&scene->id, &sceneptr); + ToolSettings *ts= CTX_data_tool_settings(C); + PointerRNA tsptr; + + RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr); #if 0 uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); @@ -3361,8 +3327,8 @@ static void view3d_edit_curvemenu(bContext *C, uiLayout *layout, void *arg_unuse uiItemS(layout); - uiItemR(layout, NULL, 0, &sceneptr, "proportional_editing", 0, 0, 0); // |O - uiItemMenuEnumR(layout, NULL, 0, &sceneptr, "proportional_editing_falloff"); + uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O + uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); uiItemS(layout); @@ -3516,47 +3482,15 @@ static void view3d_edit_textmenu(bContext *C, uiLayout *layout, void *arg_unused uiItemMenuF(layout, "Special Characters", 0, view3d_edit_text_charsmenu); } -static void do_view3d_edit_latticemenu(bContext *C, void *arg, int event) +static void view3d_edit_latticemenu(bContext *C, uiLayout *layout, void *arg_unused) { -#if 0 Scene *scene= CTX_data_scene(C); - - switch(event) { - - case 0: /* Undo Editing */ - remake_editLatt(); - break; - case 2: /* insert keyframe */ - common_insertkey(); - break; - case 3: /* Shear */ - initTransform(TFM_SHEAR, CTX_NONE); - Transform(); - break; - case 4: /* Warp */ - initTransform(TFM_WARP, CTX_NONE); - Transform(); - break; - case 5: /* proportional edit (toggle) */ - if(ts->proportional) ts->proportional= 0; - else ts->proportional= 1; - break; - case 7: /* delete keyframe */ - common_deletekey(); - break; - } -#endif -} - -static uiBlock *view3d_edit_latticemenu(bContext *C, ARegion *ar, void *arg_unused) -{ ToolSettings *ts= CTX_data_tool_settings(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "view3d_edit_latticemenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_latticemenu, NULL); + PointerRNA tsptr; + RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr); + +#if 0 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); @@ -3564,35 +3498,19 @@ static uiBlock *view3d_edit_latticemenu(bContext *C, ARegion *ar, void *arg_unus uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); +#endif + + // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + // common_insertkey(); + // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); + // common_deletekey(); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "UV Unwrap|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(ts->proportional) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - } - uiDefIconTextBlockBut(block, view3d_edit_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, 120, 19, ""); + uiItemO(layout, NULL, 0, "LATTICE_OT_make_regular"); - if(ar->alignment==RGN_ALIGN_TOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } + uiItemS(layout); - uiTextBoundsBlock(block, 50); - return block; + uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O + uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O } void do_view3d_edit_armature_parentmenu(bContext *C, void *arg, int event) @@ -5155,7 +5073,7 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o } else if (ob && ob->type == OB_MBALL) { uiDefPulldownBut(block, view3d_select_metaballmenu, NULL, "Select", xco,yco, xmax-3, 24, ""); } else if (ob && ob->type == OB_LATTICE) { - uiDefPulldownBut(block, view3d_select_latticemenu, NULL, "Select", xco,yco, xmax-3, 20, ""); + uiDefMenuBut(block, view3d_select_latticemenu, NULL, "Select", xco, yco, xmax-3, 24, ""); } else if (ob && ob->type == OB_ARMATURE) { uiDefPulldownBut(block, view3d_select_armaturemenu, NULL, "Select", xco,yco, xmax-3, 20, ""); } @@ -5199,7 +5117,7 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o xco+= xmax; } else if (ob && ob->type == OB_LATTICE) { xmax= GetButStringLength("Lattice"); - uiDefPulldownBut(block, view3d_edit_latticemenu, NULL, "Lattice", xco,yco, xmax-3, 20, ""); + uiDefMenuBut(block, view3d_edit_latticemenu, NULL, "Lattice", xco, yco, xmax-3, 20, ""); xco+= xmax; } else if (ob && ob->type == OB_ARMATURE) { xmax= GetButStringLength("Armature"); diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 71e424bbd69..0a7e989a93a 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -37,6 +37,16 @@ #ifdef RNA_RUNTIME +#include "DNA_object_types.h" +#include "DNA_scene_types.h" + +#include "BKE_depsgraph.h" +#include "BKE_key.h" +#include "BKE_main.h" + +#include "WM_api.h" +#include "WM_types.h" + static Key *rna_ShapeKey_find_key(ID *id) { switch(GS(id->name)) { @@ -62,6 +72,18 @@ static PointerRNA rna_ShapeKey_relative_key_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, NULL, NULL); } +static void rna_ShapeKey_relative_key_set(PointerRNA *ptr, PointerRNA value) +{ + Key *key= rna_ShapeKey_find_key(ptr->id.data); + KeyBlock *kb= (KeyBlock*)ptr->data, *kbrel; + int a; + + if(key) + for(a=0, kbrel=key->block.first; kbrel; kbrel=kbrel->next, a++) + if(kbrel == value.data) + kb->relative= a; +} + static void rna_ShapeKeyPoint_co_get(PointerRNA *ptr, float *values) { float *vec= (float*)ptr->data; @@ -220,6 +242,21 @@ static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter) return rna_pointer_inherit_refine(&iter->parent, type, rna_iterator_array_get(iter)); } +static void rna_Key_update_data(bContext *C, PointerRNA *ptr) +{ + Main *bmain= CTX_data_main(C); + Scene *scene= CTX_data_scene(C); + Key *key= ptr->id.data; + Object *ob; + + for(ob=bmain->object.first; ob; ob= ob->id.next) { + if(ob_get_key(ob) == key) { + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + } + } +} + #else static void rna_def_keydata(BlenderRNA *brna) @@ -234,6 +271,7 @@ static void rna_def_keydata(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL); RNA_def_property_ui_text(prop, "Location", ""); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); srna= RNA_def_struct(brna, "ShapeKeyCurvePoint", NULL); RNA_def_struct_ui_text(srna, "Shape Key Curve Point", "Point in a shape key for curves."); @@ -242,10 +280,12 @@ static void rna_def_keydata(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL); RNA_def_property_ui_text(prop, "Location", ""); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_ShapeKeyCurvePoint_tilt_get", "rna_ShapeKeyCurvePoint_tilt_set", NULL); RNA_def_property_ui_text(prop, "Tilt", ""); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); srna= RNA_def_struct(brna, "ShapeKeyBezierPoint", NULL); RNA_def_struct_ui_text(srna, "Shape Key Bezier Point", "Point in a shape key for bezier curves."); @@ -254,21 +294,25 @@ static void rna_def_keydata(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_co_get", "rna_ShapeKeyBezierPoint_co_set", NULL); RNA_def_property_ui_text(prop, "Location", ""); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "handle_1_co", PROP_FLOAT, PROP_VECTOR); RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_1_co_get", "rna_ShapeKeyBezierPoint_handle_1_co_set", NULL); RNA_def_property_ui_text(prop, "Handle 1 Location", ""); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "handle_2_co", PROP_FLOAT, PROP_VECTOR); RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_2_co_get", "rna_ShapeKeyBezierPoint_handle_2_co_set", NULL); RNA_def_property_ui_text(prop, "Handle 2 Location", ""); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); /* appears to be unused currently prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_tilt_get", "rna_ShapeKeyBezierPoint_tilt_set", NULL); - RNA_def_property_ui_text(prop, "Tilt", "");*/ + RNA_def_property_ui_text(prop, "Tilt", ""); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); */ } static void rna_def_keyblock(BlenderRNA *brna) @@ -296,30 +340,37 @@ static void rna_def_keyblock(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_float_sdna(prop, NULL, "pos"); RNA_def_property_ui_text(prop, "Frame", "Frame for absolute keys."); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); /* for now, this is editable directly, as users can set this even if they're not animating them (to test results) */ prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "curval"); RNA_def_property_ui_text(prop, "Value", "Value of shape key at the current frame."); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_keyblock_type_items); RNA_def_property_ui_text(prop, "Interpolation", "Interpolation type."); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "vgroup"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex weight group, to blend with basis shape."); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "relative_key", PROP_POINTER, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "ShapeKey"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_pointer_funcs(prop, "rna_ShapeKey_relative_key_get", "rna_ShapeKey_relative_key_set", NULL); RNA_def_property_ui_text(prop, "Relative Key", "Shape used as a relative key."); - RNA_def_property_pointer_funcs(prop, "rna_ShapeKey_relative_key_get", NULL, NULL); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYBLOCK_MUTE); RNA_def_property_ui_text(prop, "Mute", "Mute this shape key."); + RNA_def_property_ui_icon(prop, ICON_MUTE_IPO_OFF, 1); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "slider_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "slidermin"); @@ -366,11 +417,13 @@ static void rna_def_key(BlenderRNA *brna) prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "type", KEY_RELATIVE); RNA_def_property_ui_text(prop, "Relative", "Makes shape keys relative."); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "slurph", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "slurph"); RNA_def_property_range(prop, -500, 500); RNA_def_property_ui_text(prop, "Slurph", "Creates a delay in amount of frames in applying keypositions, first vertex goes first."); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); } void RNA_def_key(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index f67267ce0d0..c685e5b6912 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -36,6 +36,16 @@ #ifdef RNA_RUNTIME +#include "DNA_object_types.h" +#include "DNA_scene_types.h" + +#include "BKE_depsgraph.h" +#include "BKE_lattice.h" +#include "BKE_main.h" + +#include "WM_api.h" +#include "WM_types.h" + static void rna_LatticePoint_co_get(PointerRNA *ptr, float *values) { Lattice *lt= (Lattice*)ptr->id.data; @@ -67,15 +77,96 @@ static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, Poin static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Lattice *lt= (Lattice*)ptr->data; + int tot= lt->pntsu*lt->pntsv*lt->pntsw; - if(lt->def) { - int tot= lt->pntsu*lt->pntsv*lt->pntsw; + if(lt->editlatt && lt->editlatt->def) + rna_iterator_array_begin(iter, (void*)lt->editlatt->def, sizeof(BPoint), tot, NULL); + else if(lt->def) rna_iterator_array_begin(iter, (void*)lt->def, sizeof(BPoint), tot, NULL); - } else rna_iterator_array_begin(iter, NULL, 0, 0, NULL); } +static void rna_Lattice_update_data(bContext *C, PointerRNA *ptr) +{ + Main *bmain= CTX_data_main(C); + Scene *scene= CTX_data_scene(C); + Lattice *lt= ptr->id.data; + Object *ob; + + for(ob=bmain->object.first; ob; ob= ob->id.next) { + if(ob->data == lt) { + /* XXX this will loop over all objects again (slow) */ + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + } + } +} + +static void rna_Lattice_update_size(bContext *C, PointerRNA *ptr) +{ + Main *bmain= CTX_data_main(C); + Lattice *lt= ptr->id.data; + Object *ob; + int newu, newv, neww; + + /* we don't modify the actual pnts, but go through opnts instead */ + newu= (lt->opntsu > 0)? lt->opntsu: lt->pntsu; + newv= (lt->opntsv > 0)? lt->opntsv: lt->pntsv; + neww= (lt->opntsw > 0)? lt->opntsw: lt->pntsw; + + /* resizelattice needs an object, any object will have the same result */ + for(ob=bmain->object.first; ob; ob= ob->id.next) { + if(ob->data == lt) { + resizelattice(lt, newu, newv, neww, ob); + if(lt->editlatt) + resizelattice(lt->editlatt, newu, newv, neww, ob); + break; + } + } + + /* otherwise without, means old points are not repositioned */ + if(!ob) { + resizelattice(lt, newu, newv, neww, NULL); + if(lt->editlatt) + resizelattice(lt->editlatt, newu, newv, neww, NULL); + } + + rna_Lattice_update_data(C, ptr); +} + +static void rna_Lattice_outside_set(PointerRNA *ptr, int value) +{ + Lattice *lt= ptr->data; + + if(value) lt->flag |= LT_OUTSIDE; + else lt->flag &= ~LT_OUTSIDE; + + outside_lattice(lt); + + if(lt->editlatt) { + if(value) lt->editlatt->flag |= LT_OUTSIDE; + else lt->editlatt->flag &= ~LT_OUTSIDE; + + outside_lattice(lt->editlatt); + } +} + +static void rna_Lattice_points_u_set(PointerRNA *ptr, int value) +{ + ((Lattice*)ptr->data)->opntsu= CLAMPIS(value, 1, 64); +} + +static void rna_Lattice_points_v_set(PointerRNA *ptr, int value) +{ + ((Lattice*)ptr->data)->opntsv= CLAMPIS(value, 1, 64); +} + +static void rna_Lattice_points_w_set(PointerRNA *ptr, int value) +{ + ((Lattice*)ptr->data)->opntsw= CLAMPIS(value, 1, 64); +} + #else static void rna_def_latticepoint(BlenderRNA *brna) @@ -97,6 +188,7 @@ static void rna_def_latticepoint(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "vec"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Deformed Location", ""); + RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_funcs(prop, "rna_LatticePoint_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0, 0, 0); @@ -121,37 +213,48 @@ static void rna_def_lattice(BlenderRNA *brna) prop= RNA_def_property(srna, "points_u", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "pntsu"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_u_set", NULL); + RNA_def_property_range(prop, 1, 64); RNA_def_property_ui_text(prop, "U", "Points in U direction."); + RNA_def_property_update(prop, 0, "rna_Lattice_update_size"); prop= RNA_def_property(srna, "points_v", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "pntsv"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_v_set", NULL); + RNA_def_property_range(prop, 1, 64); RNA_def_property_ui_text(prop, "V", "Points in V direction."); + RNA_def_property_update(prop, 0, "rna_Lattice_update_size"); prop= RNA_def_property(srna, "points_w", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "pntsw"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_w_set", NULL); + RNA_def_property_range(prop, 1, 64); RNA_def_property_ui_text(prop, "W", "Points in W direction."); + RNA_def_property_update(prop, 0, "rna_Lattice_update_size"); prop= RNA_def_property(srna, "interpolation_type_u", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "typeu"); RNA_def_property_enum_items(prop, prop_keyblock_type_items); RNA_def_property_ui_text(prop, "Interpolation Type U", ""); + RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); prop= RNA_def_property(srna, "interpolation_type_v", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "typev"); RNA_def_property_enum_items(prop, prop_keyblock_type_items); RNA_def_property_ui_text(prop, "Interpolation Type V", ""); + RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); prop= RNA_def_property(srna, "interpolation_type_w", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "typew"); RNA_def_property_enum_items(prop, prop_keyblock_type_items); RNA_def_property_ui_text(prop, "Interpolation Type W", ""); + RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); prop= RNA_def_property(srna, "outside", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LT_OUTSIDE); + RNA_def_property_boolean_funcs(prop, NULL, "rna_Lattice_outside_set"); RNA_def_property_ui_text(prop, "Outside", "Only draw, and take into account, the outer vertices."); + RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); prop= RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "key"); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index bf2a2c0ba40..f814980f367 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -25,6 +25,7 @@ #include #include +#include "RNA_access.h" #include "RNA_define.h" #include "RNA_types.h" @@ -447,6 +448,21 @@ static void rna_Object_active_shape_key_index_set(PointerRNA *ptr, int value) ob->shapeflag |= OB_SHAPE_TEMPLOCK; } +static PointerRNA rna_Object_active_shape_key_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + Key *key= ob_get_key(ob); + KeyBlock *kb; + PointerRNA keyptr; + + if(key==NULL) + return PointerRNA_NULL; + + kb= BLI_findlink(&key->block, ob->shapenr-1); + RNA_pointer_create(&key->id, &RNA_ShapeKey, kb, &keyptr); + return keyptr; +} + static void rna_Object_shape_key_lock_set(PointerRNA *ptr, int value) { Object *ob= (Object*)ptr->id.data; @@ -1277,8 +1293,14 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_LOCK); RNA_def_property_boolean_funcs(prop, NULL, "rna_Object_shape_key_lock_set"); RNA_def_property_ui_text(prop, "Shape Key Lock", "Always show the current Shape for this Object."); + RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1); RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + prop= RNA_def_property(srna, "active_shape_key", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "ShapeKey"); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_shape_key_get", NULL, NULL); + RNA_def_property_ui_text(prop, "Active Shape Key", "Current shape key."); + prop= RNA_def_property(srna, "active_shape_key_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "shapenr"); RNA_def_property_int_funcs(prop, "rna_Object_active_shape_key_index_get", "rna_Object_active_shape_key_index_set", "rna_Object_active_shape_key_index_range"); -- cgit v1.2.3 From 9e71b736ebcae9bcdc6fa239722858d1828a1ac2 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Fri, 3 Jul 2009 15:31:23 +0000 Subject: 2.5/Sculpt: Bugfix, mesh face normals not getting updated because a list was freed in the wrong place. --- source/blender/editors/sculpt_paint/sculpt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index a2b883eabfc..457deb8c113 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1457,8 +1457,6 @@ static void sculpt_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *e sculpt_restore_mesh(sd); do_symmetrical_brush_actions(sd, cache); - - sculpt_post_stroke_free(sd->session); } /* For brushes with stroke spacing enabled, moves mouse in steps @@ -1526,7 +1524,9 @@ static int sculpt_brush_stroke_modal(bContext *C, wmOperator *op, wmEvent *event } else sculpt_brush_stroke_add_step(C, op, event, mouse); + sculpt_flush_update(C); + sculpt_post_stroke_free(sd->session); } else ED_region_tag_redraw(ar); -- cgit v1.2.3 From 815fef5e7e4f0cd018193f6ee13292d6c4e1f2b0 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Fri, 3 Jul 2009 15:59:59 +0000 Subject: 2.5/Multires: Missed this somehow when merging the multires branch? Have to make sure that multires displacements are up-to-date before doing a modifier apply. --- source/blender/editors/object/object_modifier.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source') diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index a2ea02c24a4..8bdfaeb6519 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -331,6 +331,10 @@ int ED_object_modifier_apply(ReportList *reports, Scene *scene, Object *ob, Modi } mesh_pmv_off(ob, me); + + /* Multires: ensure that recent sculpting is applied */ + if(md->type == eModifierType_Multires) + multires_force_update(ob); dm = mesh_create_derived_for_modifier(scene, ob, md); if (!dm) { -- cgit v1.2.3 From 36df48eef63e4bc629ffae6f9b7c300ba2fdb35d Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 3 Jul 2009 19:56:19 +0000 Subject: 2.5: * Fix crash in python with enum properties, and don't throw error if no matching identifier is found. This shouldn't happen, but it should break a python script either, which is not at fault. * Fix a wrong variable initialization in fluidsim. --- source/blender/blenkernel/intern/fluidsim.c | 2 +- source/blender/makesrna/intern/makesrna.c | 8 +++----- source/blender/python/intern/bpy_rna.c | 28 ++++++++++++++++++++++++---- 3 files changed, 28 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/fluidsim.c b/source/blender/blenkernel/intern/fluidsim.c index 6eba64cf33d..2b4032af503 100644 --- a/source/blender/blenkernel/intern/fluidsim.c +++ b/source/blender/blenkernel/intern/fluidsim.c @@ -114,7 +114,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd) // no bounding box needed // todo - reuse default init from elbeem! - fss->typeFlags = 0; + fss->typeFlags = OB_FSBND_NOSLIP; fss->domainNovecgen = 0; fss->volumeInitType = 1; // volume fss->partSlipValue = 0.0; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index c42bc866f99..059afad4c70 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1568,22 +1568,20 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr int i, defaultfound= 0; if(eprop->item) { - fprintf(f, "static EnumPropertyItem rna_%s%s_%s_items[%d] = {", srna->identifier, strnest, prop->identifier, eprop->totitem); + fprintf(f, "static EnumPropertyItem rna_%s%s_%s_items[%d] = {", srna->identifier, strnest, prop->identifier, eprop->totitem+1); for(i=0; itotitem; i++) { fprintf(f, "{%d, ", eprop->item[i].value); rna_print_c_string(f, eprop->item[i].identifier); fprintf(f, ", "); fprintf(f, "%d, ", eprop->item[i].icon); rna_print_c_string(f, eprop->item[i].name); fprintf(f, ", "); - rna_print_c_string(f, eprop->item[i].description); fprintf(f, "}"); - if(i != eprop->totitem-1) - fprintf(f, ", "); + rna_print_c_string(f, eprop->item[i].description); fprintf(f, "}, "); if(eprop->defaultvalue == eprop->item[i].value) defaultfound= 1; } - fprintf(f, "};\n\n"); + fprintf(f, "{0, NULL, 0, NULL, NULL}};\n\n"); if(!defaultfound) { fprintf(stderr, "rna_generate_structs: %s%s.%s, enum default is not in items.\n", srna->identifier, errnest, prop->identifier); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 4729620bb8a..eff34b895da 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -307,8 +307,18 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop) if (RNA_property_enum_identifier(ptr, prop, val, &identifier)) { ret = PyUnicode_FromString( identifier ); } else { - PyErr_Format(PyExc_AttributeError, "RNA Error: Current value \"%d\" matches no enum", val); - ret = NULL; + const EnumPropertyItem *item; + + /* don't throw error here, can't trust blender 100% to give the + * right values, python code should not generate error for that */ + RNA_property_enum_items(ptr, prop, &item, NULL); + if(item[0].identifier) + ret = PyUnicode_FromString( item[0].identifier ); + else + ret = PyUnicode_FromString( "" ); + + /*PyErr_Format(PyExc_AttributeError, "RNA Error: Current value \"%d\" matches no enum", val); + ret = NULL;*/ } break; @@ -1745,8 +1755,18 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data) if (RNA_property_enum_identifier(ptr, prop, val, &identifier)) { ret = PyUnicode_FromString( identifier ); } else { - PyErr_Format(PyExc_AttributeError, "RNA Error: Current value \"%d\" matches no enum", val); - ret = NULL; + const EnumPropertyItem *item; + + /* don't throw error here, can't trust blender 100% to give the + * right values, python code should not generate error for that */ + RNA_property_enum_items(ptr, prop, &item, NULL); + if(item[0].identifier) + ret = PyUnicode_FromString( item[0].identifier ); + else + ret = PyUnicode_FromString( "" ); + + /*PyErr_Format(PyExc_AttributeError, "RNA Error: Current value \"%d\" matches no enum", val); + ret = NULL;*/ } break; -- cgit v1.2.3 From 66918b3add4dfc90a8074f4bdc1c797ae9bf1371 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sat, 4 Jul 2009 03:50:12 +0000 Subject: A bunch of fun stuff now possible because of new pointcache code: * Baked normal particles can now use the "Path" visualization. * Path "max length" & "abs length" are now history: - New option to set path start & end times + random variation to length. - Much more flexible (and calculated better) than previous options. - This works with parents, children, hair & normal particles unlike old length option. - Only known issue for now is that children from faces don't get calculated correctly when using path start time. * New option "trails" for "halo", "line" and "billboard" visualizations: - Draws user controllable number of particle instances along particles path backwards from current position. - Works with children too for cool/weird visualizations that weren't possible before. * Normal particle children's velocities are now approximated better when needed so that "line" visualization trails will look nice. * New particle instance modifier options: - "path"-option works better and has controllable (max)position along path (with random variation possible). - "keep shape"-option for hair, keyed, or baked particles allows to place the instances to a single point (with random variation possible) along particle path. - "axis" option to make rotation handling better (still not perfect, but will have to do for now). Some fixes & cleanup done along the way: * Random path length didn't work for non-child particles. * Cached & unborn particles weren't reset to emit locations. * Particle numbers weren't drawn in the correct place. * Setting proper render & draw visualizations was lost somewhere when initializing new particle settings. * Changing child mode wasn't working correctly. * Some cleanup & modularization of particle child effector code and particle drawing & rendering code. * Object & group visualizations didn't work. * Child simplification didn't work. --- source/blender/blenkernel/BKE_particle.h | 5 +- source/blender/blenkernel/intern/anim.c | 13 +- source/blender/blenkernel/intern/depsgraph.c | 4 +- source/blender/blenkernel/intern/modifier.c | 62 ++- source/blender/blenkernel/intern/particle.c | 541 +++++++++++--------- source/blender/blenkernel/intern/particle_system.c | 36 +- source/blender/blenkernel/intern/pointcache.c | 15 +- source/blender/blenloader/intern/readfile.c | 1 + .../editors/interface/interface_templates.c | 2 +- source/blender/editors/object/object_modifier.c | 4 +- source/blender/editors/space_view3d/drawobject.c | 549 ++++++++++++++------- source/blender/makesdna/DNA_modifier_types.h | 4 +- source/blender/makesdna/DNA_particle_types.h | 8 +- source/blender/makesrna/intern/rna_modifier.c | 30 ++ source/blender/makesrna/intern/rna_particle.c | 73 ++- .../blender/render/intern/source/convertblender.c | 163 +++--- 16 files changed, 952 insertions(+), 558 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index 73f0195d1d8..aa24706077d 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -91,7 +91,8 @@ typedef struct ParticleTexture{ float ivel; /* used in reset */ float time, life, exist, size; /* used in init */ float pvel[3]; /* used in physics */ - float length, clump, kink, rough; /* used in path caching */ + float length, clump, kink, effector;/* used in path caching */ + float rough1, rough2, roughe; /* used in path caching */ } ParticleTexture; typedef struct BoidVecFunc{ @@ -270,7 +271,7 @@ void psys_update_world_cos(struct Object *ob, struct ParticleSystem *psys); int do_guide(struct Scene *scene, struct ParticleKey *state, int pa_num, float time, struct ListBase *lb); float psys_get_size(struct Object *ob, struct Material *ma, struct ParticleSystemModifierData *psmd, struct IpoCurve *icu_size, struct ParticleSystem *psys, struct ParticleSettings *part, struct ParticleData *pa, float *vg_size); float psys_get_timestep(struct ParticleSettings *part); -float psys_get_child_time(struct ParticleSystem *psys, struct ChildParticle *cpa, float cfra); +float psys_get_child_time(struct ParticleSystem *psys, struct ChildParticle *cpa, float cfra, float *birthtime, float *dietime); float psys_get_child_size(struct ParticleSystem *psys, struct ChildParticle *cpa, float cfra, float *pa_time); void psys_get_particle_on_path(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, int pa_num, struct ParticleKey *state, int vel); int psys_get_particle_state(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, int p, struct ParticleKey *state, int always); diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 1aceca454d2..6c1b8eb9000 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -786,8 +786,9 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p BLI_srandom(31415926 + psys->seed); lay= scene->lay; - if((part->draw_as == PART_DRAW_OB && part->dup_ob) || - (part->draw_as == PART_DRAW_GR && part->dup_group && part->dup_group->gobject.first)) { + if((psys->renderdata || part->draw_as==PART_DRAW_REND) && + ((part->ren_as == PART_DRAW_OB && part->dup_ob) || + (part->ren_as == PART_DRAW_GR && part->dup_group && part->dup_group->gobject.first))) { /* if we have a hair particle system, use the path cache */ if(part->type == PART_HAIR) { @@ -804,7 +805,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p psys->lattice = psys_get_lattice(scene, par, psys); /* gather list of objects or single object */ - if(part->draw_as==PART_DRAW_GR) { + if(part->ren_as==PART_DRAW_GR) { group_handle_recalc_and_update(scene, par, part->dup_group); for(go=part->dup_group->gobject.first; go; go=go->next) @@ -850,7 +851,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p size = psys_get_child_size(psys, cpa, ctime, 0); } - if(part->draw_as==PART_DRAW_GR) { + if(part->ren_as==PART_DRAW_GR) { /* for groups, pick the object based on settings */ if(part->draw&PART_DRAW_RAND_GR) b= BLI_rand() % totgroup; @@ -894,7 +895,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p pamat[3][3]= 1.0f; } - if(part->draw_as==PART_DRAW_GR && psys->part->draw & PART_DRAW_WHOLE_GR) { + if(part->ren_as==PART_DRAW_GR && psys->part->draw & PART_DRAW_WHOLE_GR) { for(go= part->dup_group->gobject.first, b=0; go; go= go->next, b++) { Mat4MulMat4(tmat, oblist[b]->obmat, pamat); Mat4MulFloat3((float *)tmat, size*scale); @@ -930,7 +931,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p } /* restore objects since they were changed in where_is_object_time */ - if(part->draw_as==PART_DRAW_GR) { + if(part->ren_as==PART_DRAW_GR) { for(a=0; adraw_as == PART_DRAW_OB && part->dup_ob) { + if(part->ren_as == PART_DRAW_OB && part->dup_ob) { node2 = dag_get_node(dag, part->dup_ob); dag_add_relation(dag, node, node2, DAG_RL_OB_OB, "Particle Object Visualisation"); if(part->dup_ob->type == OB_MBALL) dag_add_relation(dag, node, node2, DAG_RL_DATA_DATA, "Particle Object Visualisation"); } - if(part->draw_as == PART_DRAW_GR && part->dup_group) { + if(part->ren_as == PART_DRAW_GR && part->dup_group) { for(go=part->dup_group->gobject.first; go; go=go->next) { node2 = dag_get_node(dag, go->ob); dag_add_relation(dag, node, node2, DAG_RL_OB_OB, "Particle Group Visualisation"); diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 9ecf3a32c2b..71428a9e947 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -6390,6 +6390,7 @@ static void particleSystemModifier_deformVerts( } if(psys){ + psmd->flag &= ~eParticleSystemFlag_psys_updated; particle_system_update(md->scene, ob, psys); psmd->flag |= eParticleSystemFlag_psys_updated; psmd->flag &= ~eParticleSystemFlag_DM_changed; @@ -6421,6 +6422,8 @@ static void particleInstanceModifier_initData(ModifierData *md) pimd->flag = eParticleInstanceFlag_Parents|eParticleInstanceFlag_Unborn| eParticleInstanceFlag_Alive|eParticleInstanceFlag_Dead; pimd->psys = 1; + pimd->position = 1.0f; + pimd->axis = 2; } static void particleInstanceModifier_copyData(ModifierData *md, ModifierData *target) @@ -6431,6 +6434,8 @@ static void particleInstanceModifier_copyData(ModifierData *md, ModifierData *ta tpimd->ob = pimd->ob; tpimd->psys = pimd->psys; tpimd->flag = pimd->flag; + tpimd->position = pimd->position; + tpimd->random_position = pimd->random_position; } static int particleInstanceModifier_dependsOnTime(ModifierData *md) @@ -6470,7 +6475,7 @@ static DerivedMesh * particleInstanceModifier_applyModifier( MFace *mface, *orig_mface; MVert *mvert, *orig_mvert; int i,totvert, totpart=0, totface, maxvert, maxface, first_particle=0; - short track=ob->trackflag%3, trackneg; + short track=ob->trackflag%3, trackneg, axis = pimd->axis; float max_co=0.0, min_co=0.0, temp_co[3], cross[3]; trackneg=((ob->trackflag>2)?1:0); @@ -6508,7 +6513,7 @@ static DerivedMesh * particleInstanceModifier_applyModifier( psys->lattice=psys_get_lattice(md->scene, ob, psys); - if(psys->flag & (PSYS_HAIR_DONE|PSYS_KEYED)){ + if(psys->flag & (PSYS_HAIR_DONE|PSYS_KEYED) || psys->pointcache->flag & PTCACHE_BAKED){ float min_r[3], max_r[3]; INIT_MINMAX(min_r, max_r); @@ -6533,33 +6538,50 @@ static DerivedMesh * particleInstanceModifier_applyModifier( /*change orientation based on object trackflag*/ VECCOPY(temp_co,mv->co); - mv->co[0]=temp_co[track]; - mv->co[1]=temp_co[(track+1)%3]; - mv->co[2]=temp_co[(track+2)%3]; - - if(psys->flag & (PSYS_HAIR_DONE|PSYS_KEYED) && pimd->flag & eParticleInstanceFlag_Path){ - state.time=(mv->co[0]-min_co)/(max_co-min_co); - if(trackneg) - state.time=1.0f-state.time; - psys_get_particle_on_path(md->scene, pimd->ob, psys,first_particle + i/totvert, &state,1); + mv->co[axis]=temp_co[track]; + mv->co[(axis+1)%3]=temp_co[(track+1)%3]; + mv->co[(axis+2)%3]=temp_co[(track+2)%3]; + + if((psys->flag & (PSYS_HAIR_DONE|PSYS_KEYED) || psys->pointcache->flag & PTCACHE_BAKED) && pimd->flag & eParticleInstanceFlag_Path){ + float ran = 0.0f; + if(pimd->random_position != 0.0f) { + /* just use some static collection of random numbers */ + /* TODO: use something else that's unique to each instanced object */ + pa = psys->particles + (i/totvert)%totpart; + ran = pimd->random_position * 0.5 * (1.0f + pa->r_ave[0]); + } - mv->co[0] = 0.0; + if(pimd->flag & eParticleInstanceFlag_KeepShape) { + state.time = pimd->position * (1.0f - ran); + } + else { + state.time=(mv->co[axis]-min_co)/(max_co-min_co) * pimd->position * (1.0f - ran); + + if(trackneg) + state.time=1.0f-state.time; + + mv->co[axis] = 0.0; + } + + psys_get_particle_on_path(md->scene, pimd->ob, psys,first_particle + i/totvert, &state,1); Normalize(state.vel); - if(state.vel[0] < -0.9999 || state.vel[0] > 0.9999) { - state.rot[0] = 1.0; + /* TODO: incremental rotations somehow */ + if(state.vel[axis] < -0.9999 || state.vel[axis] > 0.9999) { + state.rot[0] = 1; state.rot[1] = state.rot[2] = state.rot[3] = 0.0f; } else { - /* a cross product of state.vel and a unit vector in x-direction */ - cross[0] = 0.0f; - cross[1] = -state.vel[2]; - cross[2] = state.vel[1]; + float temp[3] = {0.0f,0.0f,0.0f}; + temp[axis] = 1.0f; - /* state.vel[0] is the only component surviving from a dot product with a vector in x-direction*/ - VecRotToQuat(cross,saacos(state.vel[0]),state.rot); + Crossf(cross, temp, state.vel); + + /* state.vel[axis] is the only component surviving from a dot product with the axis */ + VecRotToQuat(cross,saacos(state.vel[axis]),state.rot); } + } else{ state.time=-1.0; diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 5bf9335d211..6ab8d72aa6d 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -81,6 +81,10 @@ static void key_from_object(Object *ob, ParticleKey *key); static void get_cpa_texture(DerivedMesh *dm, Material *ma, int face_index, float *fuv, float *orco, ParticleTexture *ptex, int event); +static void get_child_modifier_parameters(ParticleSettings *part, ParticleThreadContext *ctx, + ChildParticle *cpa, short cpa_from, int cpa_num, float *cpa_fuv, float *orco, ParticleTexture *ptex); +static void do_child_modifiers(Scene *scene, Object *ob, ParticleSystem *psys, ParticleSettings *part, + ParticleTexture *ptex, ParticleKey *par, float *par_rot, ChildParticle *cpa, float *orco, ParticleKey *state, float t); /* few helpers for countall etc. */ int count_particles(ParticleSystem *psys){ @@ -452,7 +456,7 @@ void psys_free(Object *ob, ParticleSystem * psys) for(tpsys=ob->particlesystem.first; tpsys; tpsys=tpsys->next){ if(tpsys->part) { - if(ELEM(tpsys->part->draw_as,PART_DRAW_OB,PART_DRAW_GR)) + if(ELEM(tpsys->part->ren_as,PART_DRAW_OB,PART_DRAW_GR)) { nr++; break; @@ -491,6 +495,7 @@ typedef struct ParticleRenderData { ChildParticle *child; ParticleCacheKey **pathcache; ParticleCacheKey **childcache; + ListBase pathcachebufs, childcachebufs; int totchild, totcached, totchildcache; DerivedMesh *dm; int totdmvert, totdmedge, totdmface; @@ -577,8 +582,12 @@ void psys_render_set(Object *ob, ParticleSystem *psys, float viewmat[][4], float data->child= psys->child; data->totchild= psys->totchild; data->pathcache= psys->pathcache; + data->pathcachebufs.first = psys->pathcachebufs.first; + data->pathcachebufs.last = psys->pathcachebufs.last; data->totcached= psys->totcached; data->childcache= psys->childcache; + data->childcachebufs.first = psys->childcachebufs.first; + data->childcachebufs.last = psys->childcachebufs.last; data->totchildcache= psys->totchildcache; if(psmd->dm) @@ -591,6 +600,8 @@ void psys_render_set(Object *ob, ParticleSystem *psys, float viewmat[][4], float psys->pathcache= NULL; psys->childcache= NULL; psys->totchild= psys->totcached= psys->totchildcache= 0; + psys->pathcachebufs.first = psys->pathcachebufs.last = NULL; + psys->childcachebufs.first = psys->childcachebufs.last = NULL; Mat4CpyMat4(data->winmat, winmat); Mat4MulMat4(data->viewmat, ob->obmat, viewmat); @@ -631,8 +642,12 @@ void psys_render_restore(Object *ob, ParticleSystem *psys) psys->child= data->child; psys->totchild= data->totchild; psys->pathcache= data->pathcache; + psys->pathcachebufs.first = data->pathcachebufs.first; + psys->pathcachebufs.last = data->pathcachebufs.last; psys->totcached= data->totcached; psys->childcache= data->childcache; + psys->childcachebufs.first = data->childcachebufs.first; + psys->childcachebufs.last = data->childcachebufs.last; psys->totchildcache= data->totchildcache; psmd->dm= data->dm; @@ -663,7 +678,7 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot) int *origindex, *facetotvert; int a, b, totorigface, totface, newtot, skipped; - if(part->draw_as!=PART_DRAW_PATH || !(part->draw & PART_DRAW_REN_STRAND)) + if(part->ren_as!=PART_DRAW_PATH || !(part->draw & PART_DRAW_REN_STRAND)) return tot; if(!ctx->psys->renderdata) return tot; @@ -1992,11 +2007,9 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, ParticleData *pa=NULL; ParticleTexture ptex; float *cpa_fuv=0, *par_rot=0; - float co[3], orco[3], ornor[3], t, rough_t, cpa_1st[3], dvec[3]; + float co[3], orco[3], ornor[3], t, cpa_1st[3], dvec[3]; float branch_begin, branch_end, branch_prob, branchfac, rough_rand; - float pa_rough1, pa_rough2, pa_roughe; - float length, pa_length, pa_clump, pa_kink, pa_effector; - float max_length = 1.0f, cur_length = 0.0f; + float length, max_length = 1.0f, cur_length = 0.0f; float eff_length, eff_vec[3]; int k, cpa_num, guided = 0; short cpa_from; @@ -2059,9 +2072,11 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, psys_particle_on_emitter(ctx->psmd,cpa_from,cpa_num,DMCACHE_ISCHILD,cpa->fuv,foffset,co,ornor,0,0,orco,0); - /* we need to save the actual root position of the child for positioning it accurately to the surface of the emitter */ - VECCOPY(cpa_1st,co); - Mat4MulVecfl(ob->obmat,cpa_1st); + if(part->path_start==0.0f) { + /* we need to save the actual root position of the child for positioning it accurately to the surface of the emitter */ + VECCOPY(cpa_1st,co); + Mat4MulVecfl(ob->obmat,cpa_1st); + } pa=0; } @@ -2098,43 +2113,13 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, #endif // XXX old animation system /* get different child parameters from textures & vgroups */ - ptex.length=part->length*(1.0f - part->randlength*cpa->rand[0]); - ptex.clump=1.0; - ptex.kink=1.0; - ptex.rough= 1.0; - ptex.exist= 1.0; - - get_cpa_texture(ctx->dm,ctx->ma,cpa_num,cpa_fuv,orco,&ptex, - MAP_PA_DENS|MAP_PA_LENGTH|MAP_PA_CLUMP|MAP_PA_KINK|MAP_PA_ROUGH); - - pa_length=ptex.length; - pa_clump=ptex.clump; - pa_kink=ptex.kink; - pa_rough1=ptex.rough; - pa_rough2=ptex.rough; - pa_roughe=ptex.rough; - pa_effector= 1.0f; + get_child_modifier_parameters(part, ctx, cpa, cpa_from, cpa_num, cpa_fuv, orco, &ptex); if(ptex.exist < cpa->rand[1]) { keys->steps = -1; return; } - if(ctx->vg_length) - pa_length*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_length); - if(ctx->vg_clump) - pa_clump*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_clump); - if(ctx->vg_kink) - pa_kink*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_kink); - if(ctx->vg_rough1) - pa_rough1*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_rough1); - if(ctx->vg_rough2) - pa_rough2*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_rough2); - if(ctx->vg_roughe) - pa_roughe*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_roughe); - if(ctx->vg_effector) - pa_effector*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_effector); - /* create the child path */ for(k=0,state=keys; k<=ctx->steps; k++,state++){ if(ctx->between){ @@ -2158,12 +2143,14 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, key[w]++; w++; } - if(k==0){ - /* calculate the offset between actual child root position and first position interpolated from parents */ - VECSUB(cpa_1st,cpa_1st,state->co); + if(part->path_start==0.0f) { + if(k==0){ + /* calculate the offset between actual child root position and first position interpolated from parents */ + VECSUB(cpa_1st,cpa_1st,state->co); + } + /* apply offset for correct positioning */ + VECADD(state->co,state->co,cpa_1st); } - /* apply offset for correct positioning */ - VECADD(state->co,state->co,cpa_1st); } else{ /* offset the child from the parent position */ @@ -2177,7 +2164,7 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, if(part->flag & PART_CHILD_EFFECT) { for(k=0,state=keys; k<=ctx->steps; k++,state++) { if(k) { - do_path_effectors(ctx->scene, ob, psys, cpa->pa[0], state, k, ctx->steps, keys->co, pa_effector, 0.0f, ctx->cfra, &eff_length, eff_vec); + do_path_effectors(ctx->scene, ob, psys, cpa->pa[0], state, k, ctx->steps, keys->co, ptex.effector, 0.0f, ctx->cfra, &eff_length, eff_vec); } else { VecSubf(eff_vec,(state+1)->co,state->co); @@ -2203,67 +2190,50 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, } /* apply different deformations to the child path */ - if(part->flag & PART_CHILD_EFFECT) - /* state is safe to cast, since only co and vel are used */ - guided = do_guide(ctx->scene, (ParticleKey*)state, cpa->parent, t, &(psys->effectors)); - - if(guided==0){ - if(part->kink) - do_prekink((ParticleKey*)state, (ParticleKey*)par, par_rot, t, - part->kink_freq * pa_kink, part->kink_shape, part->kink_amp, part->kink, part->kink_axis, ob->obmat); - - do_clump((ParticleKey*)state, (ParticleKey*)par, t, part->clumpfac, part->clumppow, pa_clump); - } - - if(part->flag & PART_BRANCHING && ctx->between == 0 && part->flag & PART_ANIM_BRANCHING) - rough_t = t * rough_rand; - else - rough_t = t; + do_child_modifiers(ctx->scene, ob, psys, part, &ptex, (ParticleKey *)par, par_rot, cpa, orco, (ParticleKey *)state, t); - if(part->rough1 != 0.0 && pa_rough1 != 0.0) - do_rough(orco, rough_t, pa_rough1*part->rough1, part->rough1_size, 0.0, (ParticleKey*)state); - - if(part->rough2 != 0.0 && pa_rough2 != 0.0) - do_rough(cpa->rand, rough_t, pa_rough2*part->rough2, part->rough2_size, part->rough2_thres, (ParticleKey*)state); - - if(part->rough_end != 0.0 && pa_roughe != 0.0) - do_rough_end(cpa->rand, rough_t, pa_roughe*part->rough_end, part->rough_end_shape, (ParticleKey*)state, (ParticleKey*)par); - - if(part->flag & PART_BRANCHING && ctx->between==0){ - if(branch_prob > part->branch_thres){ - branchfac=0.0f; - } - else{ - if(part->flag & PART_SYMM_BRANCHING){ - if(t < branch_begin || t > branch_end) - branchfac=0.0f; - else{ - if((t-branch_begin)/(branch_end-branch_begin)<0.5) - branchfac=2.0f*(t-branch_begin)/(branch_end-branch_begin); - else - branchfac=2.0f*(branch_end-t)/(branch_end-branch_begin); + /* TODO: better branching */ + //if(part->flag & PART_BRANCHING && ctx->between == 0 && part->flag & PART_ANIM_BRANCHING) + // rough_t = t * rough_rand; + //else + // rough_t = t; - CLAMP(branchfac,0.0f,1.0f); - } - } - else{ - if(t < branch_begin){ - branchfac=0.0f; - } - else{ - branchfac=(t-branch_begin)/((1.0f-branch_begin)*0.5f); - CLAMP(branchfac,0.0f,1.0f); - } - } - } + /* TODO: better branching */ + //if(part->flag & PART_BRANCHING && ctx->between==0){ + // if(branch_prob > part->branch_thres){ + // branchfac=0.0f; + // } + // else{ + // if(part->flag & PART_SYMM_BRANCHING){ + // if(t < branch_begin || t > branch_end) + // branchfac=0.0f; + // else{ + // if((t-branch_begin)/(branch_end-branch_begin)<0.5) + // branchfac=2.0f*(t-branch_begin)/(branch_end-branch_begin); + // else + // branchfac=2.0f*(branch_end-t)/(branch_end-branch_begin); + + // CLAMP(branchfac,0.0f,1.0f); + // } + // } + // else{ + // if(t < branch_begin){ + // branchfac=0.0f; + // } + // else{ + // branchfac=(t-branch_begin)/((1.0f-branch_begin)*0.5f); + // CLAMP(branchfac,0.0f,1.0f); + // } + // } + // } - if(itotpart) - VecLerpf(state->co, (pcache[i] + k)->co, state->co, branchfac); - else - /* this is not threadsafe, but should only happen for - * branching particles particles, which are not threaded */ - VecLerpf(state->co, (cache[i - psys->totpart] + k)->co, state->co, branchfac); - } + // if(itotpart) + // VecLerpf(state->co, (pcache[i] + k)->co, state->co, branchfac); + // else + // /* this is not threadsafe, but should only happen for + // * branching particles particles, which are not threaded */ + // VecLerpf(state->co, (cache[i - psys->totpart] + k)->co, state->co, branchfac); + //} /* we have to correct velocity because of kink & clump */ if(k>1){ @@ -2287,9 +2257,9 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, else{ /* initialize length calculation */ if(part->flag&PART_ABS_LENGTH) - max_length= part->abslength*pa_length; + max_length= part->abslength*ptex.length; else - max_length= pa_length; + max_length= ptex.length; cur_length= 0.0f; } @@ -2383,7 +2353,36 @@ void psys_cache_child_paths(Scene *scene, Object *ob, ParticleSystem *psys, floa psys_threads_free(pthreads); } +static void get_pointcache_keys_for_time(ParticleSystem *psys, int index, float t, ParticleKey *key1, ParticleKey *key2) +{ + PointCache *cache = psys->pointcache; + static PTCacheMem *pm = NULL; + + if(cache->flag & PTCACHE_DISK_CACHE) { + /* TODO */ + } + else { + if(index < 0) { /* initialize */ + pm = cache->mem_cache.first; + if(pm) + pm = pm->next; + } + else { + if(pm) { + while(pm && pm->next && (float)pm->frame < t) + pm = pm->next; + copy_particle_key(key2, ((ParticleKey *)pm->data) + index, 1); + copy_particle_key(key1, ((ParticleKey *)(pm->prev)->data) + index, 1); + } + else if(cache->mem_cache.first) { + pm = cache->mem_cache.first; + copy_particle_key(key2, ((ParticleKey *)pm->data) + index, 1); + copy_particle_key(key1, ((ParticleKey *)pm->data) + index, 1); + } + } + } +} /* Calculates paths ready for drawing/rendering. */ /* -Usefull for making use of opengl vertex arrays for super fast strand drawing. */ /* -Makes child strands possible and creates them too into the cache. */ @@ -2409,7 +2408,7 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra float birthtime = 0.0, dietime = 0.0; float t, time = 0.0, keytime = 0.0, dfra = 1.0, frs_sec = scene->r.frs_sec; - float col[3] = {0.5f, 0.5f, 0.5f}; + float col[4] = {0.5f, 0.5f, 0.5f, 1.0f}; float prev_tangent[3], hairmat[4][4]; int k,i; int steps = (int)pow(2.0, (double)psys->part->draw_step); @@ -2419,12 +2418,17 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra float length, vec[3]; float *vg_effector= NULL, effector=0.0f; float *vg_length= NULL, pa_length=1.0f, max_length=1.0f, cur_length=0.0f; - float len, dvec[3]; + int keyed, baked; /* we don't have anything valid to create paths from so let's quit here */ - if((psys->flag & PSYS_HAIR_DONE)==0 && (psys->flag & PSYS_KEYED)==0) + if((psys->flag & PSYS_HAIR_DONE)==0 && (psys->flag & PSYS_KEYED)==0 && (psys->pointcache->flag & PTCACHE_BAKED)==0) return; + BLI_srandom(psys->seed); + + keyed = psys->flag & PSYS_KEYED; + baked = psys->pointcache->flag & PTCACHE_BAKED; + if(psys->renderdata) { steps = (int)pow(2.0, (double)psys->part->ren_step); } @@ -2488,7 +2492,8 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra else memset(cache[i], 0, sizeof(*cache[i])*(steps+1)); if(!edit && !psys->totchild) { - pa_length = part->length * (1.0f - part->randlength*pa->r_ave[0]); + //pa_length = part->length * (1.0f - part->randlength*pa->r_ave[0]); + pa_length = 1.0f - part->randlength * 0.5 * (1.0f + pa->r_ave[0]); if(vg_length) pa_length *= psys_particle_value_from_verts(psmd->dm,part->from,pa,vg_length); } @@ -2499,13 +2504,19 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra ekey = edit->keys[i]; /*--get the first data points--*/ - if(psys->flag & PSYS_KEYED) { + if(keyed) { kkey[0] = pa->keys; kkey[1] = kkey[0] + 1; birthtime = kkey[0]->time; dietime = kkey[0][pa->totkey-1].time; } + else if(baked) { + get_pointcache_keys_for_time(psys, -1, 0.0f, NULL, NULL); + + birthtime = pa->time; + dietime = pa->dietime; + } else { hkey[0] = pa->hair; hkey[1] = hkey[0] + 1; @@ -2516,6 +2527,25 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat); } + if(!edit) { + if(part->draw & PART_ABS_PATH_TIME) { + birthtime = MAX2(birthtime, part->path_start); + dietime = MIN2(dietime, part->path_end); + } + else { + float tb = birthtime; + birthtime = tb + part->path_start * (dietime - tb); + dietime = tb + part->path_end * (dietime - tb); + } + + if(birthtime >= dietime) { + cache[i]->steps = -1; + continue; + } + + dietime = birthtime + pa_length * (dietime - birthtime); + } + if(soft){ bp[0] = soft->bpoint + pa->bpi; bp[1] = bp[0] + 1; @@ -2527,13 +2557,16 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra t = birthtime + time * (dietime - birthtime); - if(psys->flag & PSYS_KEYED) { + if(keyed) { while(kkey[1]->time < t) { kkey[1]++; } kkey[0] = kkey[1] - 1; } + else if(baked) { + get_pointcache_keys_for_time(psys, i, t, keys+1, keys+2); + } else { while(hkey[1]->time < t) { hkey[1]++; @@ -2548,17 +2581,19 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra bp_to_particle(keys + 1, bp[0], hkey[0]); bp_to_particle(keys + 2, bp[1], hkey[1]); } - else if(psys->flag & PSYS_KEYED) { + else if(keyed) { memcpy(keys + 1, kkey[0], sizeof(ParticleKey)); memcpy(keys + 2, kkey[1], sizeof(ParticleKey)); } + else if(baked) + ; /* keys already set */ else { hair_to_particle(keys + 1, hkey[0]); hair_to_particle(keys + 2, hkey[1]); } - if((psys->flag & PSYS_KEYED)==0) { + if(!keyed && !baked) { if(soft) { if(hkey[0] != pa->hair) bp_to_particle(keys, bp[0] - 1, hkey[0] - 1); @@ -2591,18 +2626,18 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra keytime = (t - keys[1].time) / dfra; /* convert velocity to timestep size */ - if(psys->flag & PSYS_KEYED){ + if(keyed || baked){ VecMulf(keys[1].vel, dfra / frs_sec); VecMulf(keys[2].vel, dfra / frs_sec); } /* now we should have in chronologiacl order k1<=k2<=t<=k3<=k4 with keytime between [0,1]->[k2,k3] (k1 & k4 used for cardinal & bspline interpolation)*/ - psys_interpolate_particle((psys->flag & PSYS_KEYED) ? -1 /* signal for cubic interpolation */ + psys_interpolate_particle((keyed || baked) ? -1 /* signal for cubic interpolation */ : ((psys->part->flag & PART_HAIR_BSPLINE) ? KEY_BSPLINE : KEY_CARDINAL) ,keys, keytime, &result, 0); /* the velocity needs to be converted back from cubic interpolation */ - if(psys->flag & PSYS_KEYED){ + if(keyed || baked){ VecMulf(result.vel, frs_sec / dfra); } else if(soft==NULL) { /* softbody and keyed are allready in global space */ @@ -2717,28 +2752,6 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra } } - - if(!edit && !psys->totchild) { - /* check if path needs to be cut before actual end of data points */ - if(k){ - VECSUB(dvec,ca->co,(ca-1)->co); - if(part->flag&PART_ABS_LENGTH) - len=VecLength(dvec); - else - len=1.0f/(float)steps; - - k=check_path_length(k,cache[i],ca,max_length,&cur_length,len,dvec); - } - else{ - /* initialize length calculation */ - if(part->flag&PART_ABS_LENGTH) - max_length= part->abslength*pa_length; - else - max_length= pa_length; - - cur_length= 0.0f; - } - } } } @@ -2990,7 +3003,8 @@ static void default_particle_settings(ParticleSettings *part) part->type= PART_EMITTER; part->distr= PART_DISTR_JIT; - part->draw_as=PART_DRAW_DOT; + part->draw_as = PART_DRAW_REND; + part->ren_as = PART_DRAW_HALO; part->bb_uv_split=1; part->bb_align=PART_BB_VIEW; part->bb_split_offset=PART_BB_OFF_LINEAR; @@ -3046,6 +3060,8 @@ static void default_particle_settings(ParticleSettings *part) part->rough_end_shape=1.0; part->draw_line[0]=0.5; + part->path_start = 0.0f; + part->path_end = 1.0f; part->banking=1.0; part->max_bank=1.0; @@ -3282,7 +3298,7 @@ static void get_cpa_texture(DerivedMesh *dm, Material *ma, int face_index, float if((event & mtex->pmapto) & MAP_PA_KINK) ptex->kink= texture_value_blend(def,ptex->kink,value,var,blend,neg & MAP_PA_KINK); if((event & mtex->pmapto) & MAP_PA_ROUGH) - ptex->rough= texture_value_blend(def,ptex->rough,value,var,blend,neg & MAP_PA_ROUGH); + ptex->rough1= ptex->rough2= ptex->roughe= texture_value_blend(def,ptex->rough1,value,var,blend,neg & MAP_PA_ROUGH); if((event & mtex->pmapto) & MAP_PA_DENS) ptex->exist= texture_value_blend(def,ptex->exist,value,var,blend,neg & MAP_PA_DENS); } @@ -3291,7 +3307,11 @@ static void get_cpa_texture(DerivedMesh *dm, Material *ma, int face_index, float if(event & MAP_PA_LENGTH) { CLAMP(ptex->length,0.0,1.0); } if(event & MAP_PA_CLUMP) { CLAMP(ptex->clump,0.0,1.0); } if(event & MAP_PA_KINK) { CLAMP(ptex->kink,0.0,1.0); } - if(event & MAP_PA_ROUGH) { CLAMP(ptex->rough,0.0,1.0); } + if(event & MAP_PA_ROUGH) { + CLAMP(ptex->rough1,0.0,1.0); + CLAMP(ptex->rough2,0.0,1.0); + CLAMP(ptex->roughe,0.0,1.0); + } if(event & MAP_PA_DENS) { CLAMP(ptex->exist,0.0,1.0); } } void psys_get_texture(Object *ob, Material *ma, ParticleSystemModifierData *psmd, ParticleSystem *psys, ParticleData *pa, ParticleTexture *ptex, int event) @@ -3392,12 +3412,12 @@ float psys_get_size(Object *ob, Material *ma, ParticleSystemModifierData *psmd, return size*part->size; } -float psys_get_child_time(ParticleSystem *psys, ChildParticle *cpa, float cfra) +float psys_get_child_time(ParticleSystem *psys, ChildParticle *cpa, float cfra, float *birthtime, float *dietime) { ParticleSettings *part = psys->part; + float time, life; if(part->childtype==PART_CHILD_FACES){ - float time; int w=0; time=0.0; while(w<4 && cpa->pa[w]>=0){ @@ -3405,12 +3425,21 @@ float psys_get_child_time(ParticleSystem *psys, ChildParticle *cpa, float cfra) w++; } - return (cfra-time)/(part->lifetime*(1.0f-part->randlife*cpa->rand[1])); + life = part->lifetime*(1.0f-part->randlife*cpa->rand[1]); } else{ ParticleData *pa = psys->particles + cpa->parent; - return (cfra-pa->time)/pa->lifetime; + + time = pa->time; + life = pa->lifetime; } + + if(birthtime) + *birthtime = time; + if(dietime) + *dietime = time+life; + + return (cfra-time)/life; } float psys_get_child_size(ParticleSystem *psys, ChildParticle *cpa, float cfra, float *pa_time) { @@ -3427,7 +3456,7 @@ float psys_get_child_size(ParticleSystem *psys, ChildParticle *cpa, float cfra, if(pa_time) time=*pa_time; else - time=psys_get_child_time(psys,cpa,cfra); + time=psys_get_child_time(psys,cpa,cfra,NULL,NULL); /* correction for lifetime */ calc_ipo(part->ipo, 100*time); @@ -3449,6 +3478,64 @@ float psys_get_child_size(ParticleSystem *psys, ChildParticle *cpa, float cfra, return size; } +static void get_child_modifier_parameters(ParticleSettings *part, ParticleThreadContext *ctx, ChildParticle *cpa, short cpa_from, int cpa_num, float *cpa_fuv, float *orco, ParticleTexture *ptex) +{ + ptex->length=part->length*(1.0f - part->randlength*cpa->rand[0]); + ptex->clump=1.0; + ptex->kink=1.0; + ptex->rough1= 1.0; + ptex->rough2= 1.0; + ptex->roughe= 1.0; + ptex->exist= 1.0; + ptex->effector= 1.0; + + get_cpa_texture(ctx->dm,ctx->ma,cpa_num,cpa_fuv,orco,ptex, + MAP_PA_DENS|MAP_PA_LENGTH|MAP_PA_CLUMP|MAP_PA_KINK|MAP_PA_ROUGH); + + + if(ptex->exist < cpa->rand[1]) + return; + + if(ctx->vg_length) + ptex->length*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_length); + if(ctx->vg_clump) + ptex->clump*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_clump); + if(ctx->vg_kink) + ptex->kink*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_kink); + if(ctx->vg_rough1) + ptex->rough1*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_rough1); + if(ctx->vg_rough2) + ptex->rough2*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_rough2); + if(ctx->vg_roughe) + ptex->roughe*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_roughe); + if(ctx->vg_effector) + ptex->effector*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_effector); +} +static void do_child_modifiers(Scene *scene, Object *ob, ParticleSystem *psys, ParticleSettings *part, ParticleTexture *ptex, ParticleKey *par, float *par_rot, ChildParticle *cpa, float *orco, ParticleKey *state, float t) +{ + int guided = 0; + + if(part->flag & PART_CHILD_EFFECT) + /* state is safe to cast, since only co and vel are used */ + guided = do_guide(scene, (ParticleKey*)state, cpa->parent, t, &(psys->effectors)); + + if(guided==0){ + if(part->kink) + do_prekink(state, par, par_rot, t, part->kink_freq * ptex->kink, part->kink_shape, + part->kink_amp, part->kink, part->kink_axis, ob->obmat); + + do_clump(state, par, t, part->clumpfac, part->clumppow, ptex->clump); + } + + if(part->rough1 != 0.0 && ptex->rough1 != 0.0) + do_rough(orco, t, ptex->rough1*part->rough1, part->rough1_size, 0.0, state); + + if(part->rough2 != 0.0 && ptex->rough2 != 0.0) + do_rough(cpa->rand, t, ptex->rough2*part->rough2, part->rough2_size, part->rough2_thres, state); + + if(part->rough_end != 0.0 && ptex->roughe != 0.0) + do_rough_end(cpa->rand, t, ptex->roughe*part->rough_end, part->rough_end_shape, state, par); +} /* get's hair (or keyed) particles state at the "path time" specified in state->time */ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, int p, ParticleKey *state, int vel) { @@ -3460,7 +3547,8 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i ParticleTexture ptex; ParticleKey *kkey[2] = {NULL, NULL}; HairKey *hkey[2] = {NULL, NULL}; - ParticleKey *par=0, keys[4]; + ParticleKey *par=0, keys[4], tstate; + ParticleThreadContext ctx; /* fake thread context for child modifiers */ float t, real_t, dfra, keytime, frs_sec = scene->r.frs_sec; float co[3], orco[3]; @@ -3471,6 +3559,9 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i int totchild = psys->totchild; short between = 0, edit = 0; + int keyed = psys->flag & PSYS_KEYED; + int cached = !keyed && part->type != PART_HAIR; + float *cpa_fuv; int cpa_num; short cpa_from; //if(psys_in_edit_mode(scene, psys)){ @@ -3479,12 +3570,6 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i // edit=1; //} - /* user want's cubic interpolation but only without sb it possible */ - //if(interpolation==PART_INTER_CUBIC && baked && psys->softflag==OB_SB_ENABLE) - // interpolation=PART_INTER_BSPLINE; - //else if(baked==0) /* it doesn't make sense to use other types for keyed */ - // interpolation=PART_INTER_CUBIC; - t=state->time; CLAMP(t, 0.0, 1.0); @@ -3497,20 +3582,29 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i return; } - if(psys->flag & PSYS_KEYED) { + if(keyed) { kkey[0] = pa->keys; kkey[1] = kkey[0] + 1; - real_t = kkey[0]->time + t * (kkey[0][pa->totkey-1].time - kkey[0]->time); + if(state->time < 0.0f) + real_t = -state->time; + else + real_t = kkey[0]->time + t * (kkey[0][pa->totkey-1].time - kkey[0]->time); + } + else if(cached) { + get_pointcache_keys_for_time(psys, -1, 0.0f, NULL, NULL); } else { hkey[0] = pa->hair; hkey[1] = pa->hair + 1; - real_t = hkey[0]->time + (hkey[0][pa->totkey-1].time - hkey[0]->time) * t; + if(state->time < 0.0f) + real_t = -state->time; + else + real_t = hkey[0]->time + t * (hkey[0][pa->totkey-1].time - hkey[0]->time); } - if(psys->flag & PSYS_KEYED) { + if(keyed) { while(kkey[1]->time < real_t) { kkey[1]++; } @@ -3519,6 +3613,14 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i memcpy(keys + 1, kkey[0], sizeof(ParticleKey)); memcpy(keys + 2, kkey[1], sizeof(ParticleKey)); } + else if(cached) { + if(state->time < 0.0f) /* flag for time in frames */ + real_t = -state->time; + else + real_t = pa->time + t * (pa->dietime - pa->time); + + get_pointcache_keys_for_time(psys, p, real_t, keys+1, keys+2); + } else { while(hkey[1]->time < real_t) hkey[1]++; @@ -3529,63 +3631,35 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i hair_to_particle(keys + 2, hkey[1]); } - if((psys->flag & PSYS_KEYED)==0) { - //if(soft){ - // if(key[0] != sbel.keys) - // DB_copy_key(&k1,key[0]-1); - // else - // DB_copy_key(&k1,&k2); - //} - //else{ + if(!keyed && !cached) { if(hkey[0] != pa->hair) hair_to_particle(keys, hkey[0] - 1); else hair_to_particle(keys, hkey[0]); - //} - //if(soft){ - // if(key[1] != sbel.keys + sbel.totkey-1) - // DB_copy_key(&k4,key[1]+1); - // else - // DB_copy_key(&k4,&k3); - //} - //else { if(hkey[1] != pa->hair + pa->totkey - 1) hair_to_particle(keys + 3, hkey[1] + 1); else hair_to_particle(keys + 3, hkey[1]); } - //} - - //psys_get_particle_on_path(scene, bsys,p,t,bkey,ckey[0]); - - //if(part->rotfrom==PART_ROT_KEYS) - // QuatInterpol(state->rot,k2.rot,k3.rot,keytime); - //else{ - // /* TODO: different rotations */ - // float nvel[3]; - // VECCOPY(nvel,state->vel); - // VecMulf(nvel,-1.0f); - // vectoquat(nvel, OB_POSX, OB_POSZ, state->rot); - //} dfra = keys[2].time - keys[1].time; keytime = (real_t - keys[1].time) / dfra; /* convert velocity to timestep size */ - if(psys->flag & PSYS_KEYED){ + if(keyed || cached){ VecMulf(keys[1].vel, dfra / frs_sec); VecMulf(keys[2].vel, dfra / frs_sec); QuatInterpol(state->rot,keys[1].rot,keys[2].rot,keytime); } - psys_interpolate_particle((psys->flag & PSYS_KEYED) ? -1 /* signal for cubic interpolation */ + psys_interpolate_particle((keyed || cached) ? -1 /* signal for cubic interpolation */ : ((psys->part->flag & PART_HAIR_BSPLINE) ? KEY_BSPLINE : KEY_CARDINAL) ,keys, keytime, state, 1); /* the velocity needs to be converted back from cubic interpolation */ - if(psys->flag & PSYS_KEYED){ + if(keyed || cached){ VecMulf(state->vel, frs_sec / dfra); } else { @@ -3606,8 +3680,11 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i } else if(totchild){ //Mat4Invert(imat,ob->obmat); - + cpa=psys->child+p-totpart; + + if(state->time < 0.0f) + t = psys_get_child_time(psys, cpa, -state->time, NULL, NULL); if(totchild && part->from!=PART_FROM_PARTICLE && part->childtype==PART_CHILD_FACES){ totparent=(int)(totchild*part->parents*0.3); @@ -3624,7 +3701,7 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i /* get parent states */ while(w<4 && cpa->pa[w]>=0){ - keys[w].time = t; + keys[w].time = state->time; psys_get_particle_on_path(scene, ob, psys, cpa->pa[w], keys+w, 1); w++; } @@ -3650,7 +3727,7 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i else{ /* get the parent state */ - keys->time = t; + keys->time = state->time; psys_get_particle_on_path(scene, ob, psys, cpa->parent, keys,1); /* get the original coordinates (orco) for texture usage */ @@ -3672,15 +3749,11 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i #endif // XXX old animation system /* get different child parameters from textures & vgroups */ - ptex.clump=1.0; - ptex.kink=1.0; - - get_cpa_texture(psmd->dm,ma,cpa_num,cpa_fuv,orco,&ptex,MAP_PA_CLUMP|MAP_PA_KINK); - - pa_clump=ptex.clump; - pa_kink=ptex.kink; - - /* TODO: vertex groups */ + memset(&ctx, 0, sizeof(ParticleThreadContext)); + ctx.dm = psmd->dm; + ctx.ma = ma; + /* TODO: assign vertex groups */ + get_child_modifier_parameters(part, &ctx, cpa, cpa_from, cpa_num, cpa_fuv, orco, &ptex); if(between){ int w=0; @@ -3708,46 +3781,34 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i } par = keys; - //if(totparent){ - // if(p-totpart>=totparent){ - // key.time=t; - // psys_get_particle_on_path(ob,psys,totpart+cpa->parent,&key,1); - // bti->convert_dynamic_key(bsys,&key,par,cpar); - // } - // else - // par=0; - //} - //else - // DB_get_key_on_path(bsys,cpa->parent,t,par,cpar); - - /* apply different deformations to the child path */ - if(part->kink) - do_prekink(state, par, par->rot, t, part->kink_freq * pa_kink, part->kink_shape, - part->kink_amp, part->kink, part->kink_axis, ob->obmat); - - do_clump(state, par, t, part->clumpfac, part->clumppow, 1.0f); - - if(part->rough1 != 0.0) - do_rough(orco, t, part->rough1, part->rough1_size, 0.0, state); - if(part->rough2 != 0.0) - do_rough(cpa->rand, t, part->rough2, part->rough2_size, part->rough2_thres, state); + if(vel) + copy_particle_key(&tstate, state, 1); - if(part->rough_end != 0.0) - do_rough_end(cpa->rand, t, part->rough_end, part->rough_end_shape, state, par); + /* apply different deformations to the child path */ + do_child_modifiers(scene, ob, psys, part, &ptex, par, par->rot, cpa, orco, state, t); + + /* try to estimate correct velocity */ + if(vel){ + ParticleKey tstate; + float length = VecLength(state->vel); + + if(t>=0.001f){ + tstate.time=t-0.001f; + psys_get_particle_on_path(scene,ob,psys,p,&tstate,0); + VECSUB(state->vel,state->co,tstate.co); + Normalize(state->vel); + } + else{ + float length = VecLength(state->vel); + tstate.time=t+0.001f; + psys_get_particle_on_path(scene, ob,psys,p,&tstate,0); + VECSUB(state->vel,tstate.co,state->co); + Normalize(state->vel); + } - //if(vel){ - // if(t>=0.001f){ - // tstate.time=t-0.001f; - // psys_get_particle_on_path(scene,ob,psys,p,&tstate,0); - // VECSUB(state->vel,state->co,tstate.co); - // } - // else{ - // tstate.time=t+0.001f; - // psys_get_particle_on_path(scene, ob,psys,p,&tstate,0); - // VECSUB(state->vel,tstate.co,state->co); - // } - //} + VecMulf(state->vel, length); + } } } /* gets particle's state at a time, returns 1 if particle exists and can be seen and 0 if not */ @@ -3774,7 +3835,7 @@ int psys_get_particle_state(struct Scene *scene, Object *ob, ParticleSystem *psy pa=psys->particles+p; if(between){ - state->time = psys_get_child_time(psys,&psys->child[p-totpart],cfra); + state->time = psys_get_child_time(psys,&psys->child[p-totpart],cfra,NULL,NULL); if(always==0) if((state->time<0.0 && (part->flag & PART_UNBORN)==0) diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 591b6ca9be5..92b919f6b0e 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4254,7 +4254,7 @@ static void psys_update_path_cache(Scene *scene, Object *ob, ParticleSystemModif } } - if((part->type==PART_HAIR || psys->flag&PSYS_KEYED) && ( psys_in_edit_mode(scene, psys) || (part->type==PART_HAIR + if((part->type==PART_HAIR || psys->flag&PSYS_KEYED || psys->pointcache->flag & PTCACHE_BAKED) && ( psys_in_edit_mode(scene, psys) || (part->type==PART_HAIR || (part->ren_as == PART_DRAW_PATH && (part->draw_as == PART_DRAW_REND || psys->renderdata))))){ psys_cache_paths(scene, ob, psys, cfra, 0); @@ -4371,8 +4371,10 @@ static void cached_step(Scene *scene, Object *ob, ParticleSystemModifierData *ps dietime = birthtime + (1 + pa->loop) * (pa->dietime - pa->time); /* update alive status and push events */ - if(pa->time > cfra) + if(pa->time > cfra) { pa->alive = PARS_UNBORN; + reset_particle(scene, pa, psys, psmd, ob, 0.0f, cfra, NULL, NULL, NULL); + } else if(dietime <= cfra){ if(dietime > psys->cfra){ state.time = dietime; @@ -4406,6 +4408,8 @@ static void cached_step(Scene *scene, Object *ob, ParticleSystemModifierData *ps distribute_particles(scene, ob, psys, PART_FROM_CHILD); } + psys_update_path_cache(scene, ob,psmd,psys,cfra); + if(vg_size) MEM_freeN(vg_size); } @@ -4433,10 +4437,17 @@ void psys_changed_type(ParticleSystem *psys) if(ELEM3(part->draw_as, PART_DRAW_NOT, PART_DRAW_REND, PART_DRAW_PATH)==0) part->draw_as = PART_DRAW_REND; + + CLAMP(part->path_start, 0.0f, 100.0f); + CLAMP(part->path_end, 0.0f, 100.0f); } - else + else { free_hair(psys, 1); + CLAMP(part->path_start, part->sta, part->end + part->lifetime); + CLAMP(part->path_end, part->sta, part->end + part->lifetime); + } + psys->softflag= 0; psys_reset(psys, PSYS_RESET_ALL); @@ -4629,9 +4640,8 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle totpart = psys->part->totpart; totchild = get_psys_tot_child(scene, psys); - if(oldtotpart != totpart || (psys->part->childtype && oldtotchild != totchild)) { + if(oldtotpart != totpart || oldtotchild != totchild) { only_children_changed = (oldtotpart == totpart); - realloc_particles(ob, psys, totpart); alloc = 1; distr= 1; init= 1; @@ -4647,11 +4657,12 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle if(alloc) { realloc_particles(ob, psys, totpart); - if(usecache) + if(usecache && !only_children_changed) BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_ALL, 0); } - distribute_particles(scene, ob, psys, part->from); + if(!only_children_changed) + distribute_particles(scene, ob, psys, part->from); if((psys->part->type == PART_HAIR) && !(psys->flag & PSYS_HAIR_DONE)) /* don't generate children while growing hair - waste of time */ @@ -4660,7 +4671,7 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle distribute_particles(scene, ob, psys, PART_FROM_CHILD); } - if(only_children_changed==0) { + if(!only_children_changed) { free_keyed_keys(psys); initialize_all_particles(ob, psys, psmd); @@ -4680,19 +4691,10 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle int result = get_particles_from_cache(scene, ob, psys, (float)framenr, &old_framenr); if(result == PTCACHE_READ_EXACT || result == PTCACHE_READ_INTERPOLATED) { - //if(part->phystype==PART_PHYS_KEYED && psys->flag&PSYS_FIRST_KEYED) { - // psys_count_keyed_targets(ob,psys); - // set_keyed_keys(scene, ob, psys); - //} - cached_step(scene, ob, psmd, psys, cfra); psys->cfra=cfra; psys->recalc = 0; - //if(part->phystype==PART_PHYS_KEYED && psys->flag&PSYS_FIRST_KEYED) { - // psys_update_path_cache(scene, ob, psmd, psys, framenr); - //} - cache->simframe= framenr; cache->flag |= PTCACHE_SIMULATION_VALID; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 64473d07151..b8a0b111324 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1209,8 +1209,13 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) for(pid=pidlist.first; pid; pid=pid->next) { cache = pid->cache; if((cache->flag & PTCACHE_BAKED)==0) { - if(pid->type==PTCACHE_TYPE_PARTICLES) + if(pid->type==PTCACHE_TYPE_PARTICLES) { + /* skip hair particles */ + if(((ParticleSystem*)pid->data)->part->type == PART_HAIR) + continue; + psys_get_pointcache_start_end(scene, pid->data, &cache->startframe, &cache->endframe); + } if((cache->flag & PTCACHE_REDO_NEEDED || (cache->flag & PTCACHE_SIMULATION_VALID)==0) && ((cache->flag & PTCACHE_QUICK_CACHE)==0 || render || bake)) @@ -1265,6 +1270,10 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) BKE_ptcache_ids_from_object(&pidlist, base->object); for(pid=pidlist.first; pid; pid=pid->next) { + /* skip hair particles */ + if(pid->type==PTCACHE_TYPE_PARTICLES && ((ParticleSystem*)pid->data)->part->type == PART_HAIR) + continue; + cache = pid->cache; if(step > 1) @@ -1282,7 +1291,9 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) scene->r.framelen = frameleno; CFRA = cfrao; - scene_update_for_newframe(scene, scene->lay); + + if(bake) /* already on cfra unless baking */ + scene_update_for_newframe(scene, scene->lay); /* TODO: call redraw all windows somehow */ } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c89f515f319..93de096e7b4 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9059,6 +9059,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) part->draw_as = PART_DRAW_REND; } } + part->path_end = 1.0f; } /* set old pointcaches to have disk cache flag */ for(ob = main->object.first; ob; ob= ob->id.next) { diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index d9bc2d4d426..1ce352444e6 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -487,7 +487,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Object *ob, ModifierData *md, i ParticleSystem *psys= ((ParticleSystemModifierData *)md)->psys; if(!(G.f & G_PARTICLEEDIT)) - if(ELEM3(psys->part->draw_as, PART_DRAW_PATH, PART_DRAW_GR, PART_DRAW_OB) && psys->pathcache) + if(ELEM3(psys->part->ren_as, PART_DRAW_PATH, PART_DRAW_GR, PART_DRAW_OB) && psys->pathcache) uiItemO(row, "Convert", 0, "OBJECT_OT_modifier_convert"); } else diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 8bdfaeb6519..eb723dcca6c 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -226,11 +226,11 @@ int ED_object_modifier_convert(ReportList *reports, Scene *scene, Object *ob, Mo psys=((ParticleSystemModifierData *)md)->psys; part= psys->part; - if(part->draw_as == PART_DRAW_GR || part->draw_as == PART_DRAW_OB) { + if(part->ren_as == PART_DRAW_GR || part->ren_as == PART_DRAW_OB) { ; // XXX make_object_duplilist_real(NULL); } else { - if(part->draw_as != PART_DRAW_PATH || psys->pathcache == 0) + if(part->ren_as != PART_DRAW_PATH || psys->pathcache == 0) return 0; totpart= psys->totcached; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 05490e2fce1..b38575b5ceb 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2941,6 +2941,228 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas return retval; } +/* *********** text drawing for particles ************* */ +static ListBase pstrings= {NULL, NULL}; + +typedef struct ViewParticleString { + struct ViewParticleString *next, *prev; + float vec[3], col[4]; + char str[128]; + short mval[2]; + short xoffs; +} ViewParticleString; + + +void view3d_particle_text_draw_add(float x, float y, float z, char *str, short xoffs) +{ + ViewObjectString *vos= MEM_callocN(sizeof(ViewObjectString), "ViewObjectString"); + + BLI_addtail(&pstrings, vos); + BLI_strncpy(vos->str, str, 128); + vos->vec[0]= x; + vos->vec[1]= y; + vos->vec[2]= z; + glGetFloatv(GL_CURRENT_COLOR, vos->col); + vos->xoffs= xoffs; +} + +static void view3d_particle_text_draw(View3D *v3d, ARegion *ar) +{ + ViewObjectString *vos; + int tot= 0; + + /* project first and test */ + for(vos= pstrings.first; vos; vos= vos->next) { + project_short(ar, vos->vec, vos->mval); + if(vos->mval[0]!=IS_CLIPPED) + tot++; + } + + if(tot) { + RegionView3D *rv3d= ar->regiondata; + int a; + + if(rv3d->rflag & RV3D_CLIPPING) + for(a=0; a<6; a++) + glDisable(GL_CLIP_PLANE0+a); + + wmPushMatrix(); + ED_region_pixelspace(ar); + + if(v3d->zbuf) glDepthMask(0); + + for(vos= pstrings.first; vos; vos= vos->next) { + if(vos->mval[0]!=IS_CLIPPED) { + glColor3fv(vos->col); + BLF_draw_default((float)vos->mval[0]+vos->xoffs, (float)vos->mval[1], 2.0, vos->str); + } + } + + if(v3d->zbuf) glDepthMask(1); + + wmPopMatrix(); + + if(rv3d->rflag & RV3D_CLIPPING) + for(a=0; a<6; a++) + glEnable(GL_CLIP_PLANE0+a); + } + + if(pstrings.first) + BLI_freelistN(&pstrings); +} +typedef struct ParticleDrawData { + float *vdata, *vd; + float *ndata, *nd; + float *cdata, *cd; + float *vedata, *ved; + float *ma_r, *ma_g, *ma_b; +} ParticleDrawData; +static void draw_particle(ParticleKey *state, int draw_as, short draw, float pixsize, float imat[4][4], float *draw_line, ParticleBillboardData *bb, ParticleDrawData *pdd) +{ + float vec[3], vec2[3]; + float *vd = pdd->vd; + float *nd = pdd->nd; + float *cd = pdd->cd; + float ma_r; + float ma_g; + float ma_b; + + if(pdd->ma_r) { + ma_r = *pdd->ma_r; + ma_g = *pdd->ma_g; + ma_b = *pdd->ma_b; + } + + switch(draw_as){ + case PART_DRAW_DOT: + { + if(vd) { + VECCOPY(vd,state->co) pdd->vd+=3; + } + if(cd) { + cd[0]=ma_r; + cd[1]=ma_g; + cd[2]=ma_b; + pdd->cd+=3; + } + break; + } + case PART_DRAW_CROSS: + case PART_DRAW_AXIS: + { + vec[0]=2.0f*pixsize; + vec[1]=vec[2]=0.0; + QuatMulVecf(state->rot,vec); + if(draw_as==PART_DRAW_AXIS) { + cd[1]=cd[2]=cd[4]=cd[5]=0.0; + cd[0]=cd[3]=1.0; + cd[6]=cd[8]=cd[9]=cd[11]=0.0; + cd[7]=cd[10]=1.0; + cd[13]=cd[12]=cd[15]=cd[16]=0.0; + cd[14]=cd[17]=1.0; + cd+=18; + + VECCOPY(vec2,state->co); + } + else { + if(cd) { + cd[0]=cd[3]=cd[6]=cd[9]=cd[12]=cd[15]=ma_r; + cd[1]=cd[4]=cd[7]=cd[10]=cd[13]=cd[16]=ma_g; + cd[2]=cd[5]=cd[8]=cd[11]=cd[14]=cd[17]=ma_b; + pdd->cd+=18; + } + VECSUB(vec2,state->co,vec); + } + + VECADD(vec,state->co,vec); + VECCOPY(pdd->vd,vec); pdd->vd+=3; + VECCOPY(pdd->vd,vec2); pdd->vd+=3; + + vec[1]=2.0f*pixsize; + vec[0]=vec[2]=0.0; + QuatMulVecf(state->rot,vec); + if(draw_as==PART_DRAW_AXIS){ + VECCOPY(vec2,state->co); + } + else VECSUB(vec2,state->co,vec); + + VECADD(vec,state->co,vec); + VECCOPY(pdd->vd,vec); pdd->vd+=3; + VECCOPY(pdd->vd,vec2); pdd->vd+=3; + + vec[2]=2.0f*pixsize; + vec[0]=vec[1]=0.0; + QuatMulVecf(state->rot,vec); + if(draw_as==PART_DRAW_AXIS){ + VECCOPY(vec2,state->co); + } + else VECSUB(vec2,state->co,vec); + + VECADD(vec,state->co,vec); + + VECCOPY(pdd->vd,vec); pdd->vd+=3; + VECCOPY(pdd->vd,vec2); pdd->vd+=3; + break; + } + case PART_DRAW_LINE: + { + VECCOPY(vec,state->vel); + Normalize(vec); + if(draw & PART_DRAW_VEL_LENGTH) + VecMulf(vec,VecLength(state->vel)); + VECADDFAC(pdd->vd,state->co,vec,-draw_line[0]); pdd->vd+=3; + VECADDFAC(pdd->vd,state->co,vec,draw_line[1]); pdd->vd+=3; + if(cd) { + cd[0]=cd[3]=ma_r; + cd[1]=cd[4]=ma_g; + cd[2]=cd[5]=ma_b; + pdd->cd+=6; + } + break; + } + case PART_DRAW_CIRC: + { + if(pdd->ma_r) + glColor3f(ma_r,ma_g,ma_b); + drawcircball(GL_LINE_LOOP, state->co, pixsize, imat); + break; + } + case PART_DRAW_BB: + { + float xvec[3], yvec[3], zvec[3], bb_center[3]; + if(cd) { + cd[0]=cd[3]=cd[6]=cd[9]=ma_r; + cd[1]=cd[4]=cd[7]=cd[10]=ma_g; + cd[2]=cd[5]=cd[8]=cd[11]=ma_b; + pdd->cd+=12; + } + + + VECCOPY(bb->vec, state->co); + VECCOPY(bb->vel, state->vel); + + psys_make_billboard(bb, xvec, yvec, zvec, bb_center); + + VECADD(pdd->vd,bb_center,xvec); + VECADD(pdd->vd,pdd->vd,yvec); pdd->vd+=3; + + VECSUB(pdd->vd,bb_center,xvec); + VECADD(pdd->vd,pdd->vd,yvec); pdd->vd+=3; + + VECSUB(pdd->vd,bb_center,xvec); + VECSUB(pdd->vd,pdd->vd,yvec); pdd->vd+=3; + + VECADD(pdd->vd,bb_center,xvec); + VECSUB(pdd->vd,pdd->vd,yvec); pdd->vd+=3; + + VECCOPY(pdd->nd, zvec); pdd->nd+=3; + VECCOPY(pdd->nd, zvec); pdd->nd+=3; + VECCOPY(pdd->nd, zvec); pdd->nd+=3; + VECCOPY(pdd->nd, zvec); pdd->nd+=3; + break; + } + } +} /* unified drawing of all new particle systems draw types except dupli ob & group */ /* mostly tries to use vertex arrays for speed */ @@ -2951,7 +3173,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas /* 5. start filling the arrays */ /* 6. draw the arrays */ /* 7. clean up */ -static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, ParticleSystem *psys, int dt) +static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, ParticleSystem *psys, int ob_dt) { Object *ob=base->object; ParticleSystemModifierData *psmd; @@ -2959,14 +3181,15 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv ParticleData *pars, *pa; ParticleKey state, *states=0; ParticleBillboardData bb; + ParticleDrawData pdd; Material *ma; - float vel[3], vec[3], vec2[3], imat[4][4], bb_center[3]; - float timestep, pixsize=1.0, pa_size, pa_time, r_tilt; + float vel[3], imat[4][4]; + float timestep, pixsize=1.0, pa_size, r_tilt, r_length; + float pa_time, pa_birthtime, pa_dietime; float cfra= bsystem_time(scene, ob,(float)CFRA,0.0); - float *vdata=0, *vedata=0, *cdata=0, *ndata=0, *vd=0, *ved=0, *cd=0, *nd=0, xvec[3], yvec[3], zvec[3]; float ma_r=0.0f, ma_g=0.0f, ma_b=0.0f; - int a, totpart, totpoint=0, draw_as, totchild=0; - int select=ob->flag&SELECT, create_cdata=0; + int a, totpart, totpoint=0, totve=0, drawn, draw_as, totchild=0; + int select=ob->flag&SELECT, create_cdata=0, need_v=0; GLint polygonmode[2]; char val[32]; @@ -3015,13 +3238,9 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv else totchild=psys->totchild*part->disp/100; - ma= give_current_material(ob,part->omat); + memset(&pdd, 0, sizeof(ParticleDrawData)); - if(ma) { - ma_r = ma->r; - ma_g = ma->g; - ma_b = ma->b; - } + ma= give_current_material(ob,part->omat); if(v3d->zbuf) glDepthMask(1); @@ -3029,6 +3248,15 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv cpack(0xFFFFFF); else if((ma) && (part->draw&PART_DRAW_MAT_COL)) { glColor3f(ma->r,ma->g,ma->b); + + ma_r = ma->r; + ma_g = ma->g; + ma_b = ma->b; + + pdd.ma_r = &ma_r; + pdd.ma_g = &ma_g; + pdd.ma_b = &ma_b; + create_cdata = 1; } else @@ -3038,8 +3266,6 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv timestep= psys_get_timestep(part); - wmLoadMatrix(rv3d->viewmat); - if( (base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP) ) { float mat[4][4]; Mat4MulMat4(mat, psys->imat, ob->obmat); @@ -3119,6 +3345,9 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv break; case PART_DRAW_PATH: break; + case PART_DRAW_LINE: + need_v=1; + break; } if(part->draw & PART_DRAW_SIZE && part->draw_as!=PART_DRAW_CIRC){ Mat4CpyMat4(imat, rv3d->viewinv); @@ -3129,40 +3358,45 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv /* 4. */ if(draw_as && draw_as!=PART_DRAW_PATH) { int tot_vec_size = (totpart + totchild) * 3 * sizeof(float); + + if(part->draw_as == PART_DRAW_REND && part->trail_count > 1) + tot_vec_size *= part->trail_count; if(draw_as!=PART_DRAW_CIRC) { switch(draw_as) { case PART_DRAW_AXIS: case PART_DRAW_CROSS: if(draw_as != PART_DRAW_CROSS || create_cdata) - cdata = MEM_callocN(tot_vec_size * 6, "particle_cdata"); - vdata = MEM_callocN(tot_vec_size * 6, "particle_vdata"); + pdd.cdata = MEM_callocN(tot_vec_size * 6, "particle_cdata"); + pdd.vdata = MEM_callocN(tot_vec_size * 6, "particle_vdata"); break; case PART_DRAW_LINE: if(create_cdata) - cdata = MEM_callocN(tot_vec_size * 2, "particle_cdata"); - vdata = MEM_callocN(tot_vec_size * 2, "particle_vdata"); + pdd.cdata = MEM_callocN(tot_vec_size * 2, "particle_cdata"); + pdd.vdata = MEM_callocN(tot_vec_size * 2, "particle_vdata"); break; case PART_DRAW_BB: if(create_cdata) - cdata = MEM_callocN(tot_vec_size * 4, "particle_cdata"); - vdata = MEM_callocN(tot_vec_size * 4, "particle_vdata"); - ndata = MEM_callocN(tot_vec_size * 4, "particle_vdata"); + pdd.cdata = MEM_callocN(tot_vec_size * 4, "particle_cdata"); + pdd.vdata = MEM_callocN(tot_vec_size * 4, "particle_vdata"); + pdd.ndata = MEM_callocN(tot_vec_size * 4, "particle_vdata"); break; default: if(create_cdata) - cdata=MEM_callocN(tot_vec_size, "particle_cdata"); - vdata=MEM_callocN(tot_vec_size, "particle_vdata"); + pdd.cdata=MEM_callocN(tot_vec_size, "particle_cdata"); + pdd.vdata=MEM_callocN(tot_vec_size, "particle_vdata"); } } - if(part->draw & PART_DRAW_VEL && draw_as != PART_DRAW_LINE) - vedata = MEM_callocN(tot_vec_size * 2, "particle_vedata"); + if(part->draw & PART_DRAW_VEL && draw_as != PART_DRAW_LINE) { + pdd.vedata = MEM_callocN(tot_vec_size * 2, "particle_vedata"); + need_v = 1; + } - vd=vdata; - ved=vedata; - cd=cdata; - nd=ndata; + pdd.vd= pdd.vdata; + pdd.ved= pdd.vedata; + pdd.cd= pdd.cdata; + pdd.nd= pdd.ndata; psys->lattice= psys_get_lattice(scene, ob, psys); } @@ -3176,6 +3410,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(pa->flag & PARS_NO_DISP || pa->flag & PARS_UNEXIST) continue; pa_time=(cfra-pa->time)/pa->lifetime; + pa_birthtime=pa->time; + pa_dietime = pa->dietime; pa_size=pa->size; if((part->flag&PART_ABS_TIME)==0){ @@ -3209,12 +3445,13 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv #endif // XXX old animation system } - r_tilt=1.0f+pa->r_ave[0]; + r_tilt = 1.0f + pa->r_ave[0]; + r_length = 0.5f * (1.0f + pa->r_ave[1]); } else{ ChildParticle *cpa= &psys->child[a-totpart]; - pa_time=psys_get_child_time(psys,cpa,cfra); + pa_time=psys_get_child_time(psys,cpa,cfra,&pa_birthtime,&pa_dietime); if((part->flag&PART_ABS_TIME)==0) { if(ma && ma->ipo){ @@ -3238,148 +3475,80 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv pa_size=psys_get_child_size(psys,cpa,cfra,0); - r_tilt=2.0f*cpa->rand[2]; + r_tilt = 2.0f * cpa->rand[2]; + r_length = cpa->rand[1]; } if(draw_as!=PART_DRAW_PATH){ - state.time=cfra; - if(psys_get_particle_state(scene,ob,psys,a,&state,0)){ - if(psys->parent) - Mat4MulVecfl(psys->parent->obmat, state.co); - - /* create actiual particle data */ - switch(draw_as){ - case PART_DRAW_DOT: - if(vd){ - VECCOPY(vd,state.co) vd+=3; - } - if(cd) { - cd[0]=ma_r; - cd[1]=ma_g; - cd[2]=ma_b; - cd+=3; - } - break; - case PART_DRAW_CROSS: - case PART_DRAW_AXIS: - vec[0]=2.0f*pixsize; - vec[1]=vec[2]=0.0; - QuatMulVecf(state.rot,vec); - if(draw_as==PART_DRAW_AXIS){ - cd[1]=cd[2]=cd[4]=cd[5]=0.0; - cd[0]=cd[3]=1.0; - cd[6]=cd[8]=cd[9]=cd[11]=0.0; - cd[7]=cd[10]=1.0; - cd[13]=cd[12]=cd[15]=cd[16]=0.0; - cd[14]=cd[17]=1.0; - cd+=18; - - VECCOPY(vec2,state.co); - } - else { - if(cd) { - cd[0]=cd[3]=cd[6]=cd[9]=cd[12]=cd[15]=ma_r; - cd[1]=cd[4]=cd[7]=cd[10]=cd[13]=cd[16]=ma_g; - cd[2]=cd[5]=cd[8]=cd[11]=cd[14]=cd[17]=ma_b; - cd+=18; - } - VECSUB(vec2,state.co,vec); - } + drawn = 0; + if(part->draw_as == PART_DRAW_REND && part->trail_count > 1) { + float length = part->path_end * (1.0 - part->randlength * r_length); + int trail_count = part->trail_count * (1.0 - part->randlength * r_length); + float ct = ((part->draw & PART_ABS_PATH_TIME) ? cfra : pa_time) - length; + float dt = length / (trail_count ? (float)trail_count : 1.0f); + int i=0; + + ct+=dt; + for(i=0; i < trail_count; i++, ct += dt) { + if(part->draw & PART_ABS_PATH_TIME) { + if(ct < pa_birthtime || ct > pa_dietime) + continue; + } + else if(ct < 0.0f || ct > 1.0f) + continue; - VECADD(vec,state.co,vec); - VECCOPY(vd,vec); vd+=3; - VECCOPY(vd,vec2); vd+=3; - - vec[1]=2.0f*pixsize; - vec[0]=vec[2]=0.0; - QuatMulVecf(state.rot,vec); - if(draw_as==PART_DRAW_AXIS){ - VECCOPY(vec2,state.co); - } - else VECSUB(vec2,state.co,vec); - - VECADD(vec,state.co,vec); - VECCOPY(vd,vec); vd+=3; - VECCOPY(vd,vec2); vd+=3; - - vec[2]=2.0f*pixsize; - vec[0]=vec[1]=0.0; - QuatMulVecf(state.rot,vec); - if(draw_as==PART_DRAW_AXIS){ - VECCOPY(vec2,state.co); - } - else VECSUB(vec2,state.co,vec); - - VECADD(vec,state.co,vec); - - VECCOPY(vd,vec); vd+=3; - VECCOPY(vd,vec2); vd+=3; - break; - case PART_DRAW_LINE: - VECCOPY(vec,state.vel); - Normalize(vec); - if(part->draw & PART_DRAW_VEL_LENGTH) - VecMulf(vec,VecLength(state.vel)); - VECADDFAC(vd,state.co,vec,-part->draw_line[0]); vd+=3; - VECADDFAC(vd,state.co,vec,part->draw_line[1]); vd+=3; - if(cd) { - cd[0]=cd[3]=ma_r; - cd[1]=cd[4]=ma_g; - cd[2]=cd[5]=ma_b; - cd+=3; - } - break; - case PART_DRAW_CIRC: - if(create_cdata) - glColor3f(ma_r,ma_g,ma_b); - drawcircball(GL_LINE_LOOP, state.co, pixsize, imat); - break; - case PART_DRAW_BB: - if(cd) { - cd[0]=cd[3]=cd[6]=cd[9]=ma_r; - cd[1]=cd[4]=cd[7]=cd[10]=ma_g; - cd[2]=cd[5]=cd[8]=cd[11]=ma_b; - cd+=12; - } + state.time = (part->draw & PART_ABS_PATH_TIME) ? -ct : ct; + psys_get_particle_on_path(scene,ob,psys,a,&state,need_v); + + if(psys->parent) + Mat4MulVecfl(psys->parent->obmat, state.co); + /* create actiual particle data */ + if(draw_as == PART_DRAW_BB) { bb.size = pa_size; bb.tilt = part->bb_tilt * (1.0f - part->bb_rand_tilt * r_tilt); - bb.time = pa_time; - VECCOPY(bb.vec, state.co); - VECCOPY(bb.vel, state.vel); - - psys_make_billboard(&bb, xvec, yvec, zvec, bb_center); - - VECADD(vd,bb_center,xvec); - VECADD(vd,vd,yvec); vd+=3; + bb.time = ct; + } - VECSUB(vd,bb_center,xvec); - VECADD(vd,vd,yvec); vd+=3; + draw_particle(&state, draw_as, part->draw, pixsize, imat, part->draw_line, &bb, &pdd); - VECSUB(vd,bb_center,xvec); - VECSUB(vd,vd,yvec); vd+=3; + totpoint++; + drawn = 1; + } + } + else + { + state.time=cfra; + if(psys_get_particle_state(scene,ob,psys,a,&state,0)){ + if(psys->parent) + Mat4MulVecfl(psys->parent->obmat, state.co); + + /* create actiual particle data */ + if(draw_as == PART_DRAW_BB) { + bb.size = pa_size; + bb.tilt = part->bb_tilt * (1.0f - part->bb_rand_tilt * r_tilt); + bb.time = pa_time; + } - VECADD(vd,bb_center,xvec); - VECSUB(vd,vd,yvec); vd+=3; + draw_particle(&state, draw_as, part->draw, pixsize, imat, part->draw_line, &bb, &pdd); - VECCOPY(nd, zvec); nd+=3; - VECCOPY(nd, zvec); nd+=3; - VECCOPY(nd, zvec); nd+=3; - VECCOPY(nd, zvec); nd+=3; - break; + totpoint++; + drawn = 1; } + } - totpoint++; - + if(drawn) { /* additional things to draw for each particle */ /* (velocity, size and number) */ - if(vedata){ - VECCOPY(ved,state.co); - ved+=3; + if(pdd.vedata){ + VECCOPY(pdd.ved,state.co); + pdd.ved+=3; VECCOPY(vel,state.vel); VecMulf(vel,timestep); - VECADD(ved,state.co,vel); - ved+=3; + VECADD(pdd.ved,state.co,vel); + pdd.ved+=3; + + totve++; } if(part->draw & PART_DRAW_SIZE){ @@ -3391,7 +3560,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(part->draw&PART_DRAW_NUM && !(G.f & G_RENDER_SHADOW)){ /* in path drawing state.co is the end point */ sprintf(val," %i",a); - view3d_object_text_draw_add(state.co[0], state.co[1], state.co[2], val, 0); + view3d_particle_text_draw_add(state.co[0], state.co[1], state.co[2], val, 0); } } } @@ -3408,7 +3577,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv glEnableClientState(GL_VERTEX_ARRAY); /* setup gl flags */ - if(dt > OB_WIRE) { + if(ob_dt > OB_WIRE) { glEnableClientState(GL_NORMAL_ARRAY); if(part->draw&PART_DRAW_MAT_COL) @@ -3436,7 +3605,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(path->steps > 0) { glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->co); - if(dt > OB_WIRE) { + if(ob_dt > OB_WIRE) { glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel); if(part->draw&PART_DRAW_MAT_COL) glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col); @@ -3452,7 +3621,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv path=cache[a]; glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->co); - if(dt > OB_WIRE) { + if(ob_dt > OB_WIRE) { glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel); if(part->draw&PART_DRAW_MAT_COL) glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col); @@ -3463,7 +3632,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv /* restore & clean up */ - if(dt > OB_WIRE) { + if(ob_dt > OB_WIRE) { if(part->draw&PART_DRAW_MAT_COL) glDisable(GL_COLOR_ARRAY); glDisable(GL_COLOR_MATERIAL); @@ -3479,16 +3648,17 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv glDisableClientState(GL_COLOR_ARRAY); /* setup created data arrays */ - if(vdata){ + if(pdd.vdata){ glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3, GL_FLOAT, 0, vdata); + glVertexPointer(3, GL_FLOAT, 0, pdd.vdata); } else glDisableClientState(GL_VERTEX_ARRAY); - if(ndata && dt>OB_WIRE){ + /* billboards are drawn this way */ + if(pdd.ndata && ob_dt>OB_WIRE){ glEnableClientState(GL_NORMAL_ARRAY); - glNormalPointer(GL_FLOAT, 0, ndata); + glNormalPointer(GL_FLOAT, 0, pdd.ndata); glEnable(GL_LIGHTING); } else{ @@ -3496,9 +3666,9 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv glDisable(GL_LIGHTING); } - if(cdata){ + if(pdd.cdata){ glEnableClientState(GL_COLOR_ARRAY); - glColorPointer(3, GL_FLOAT, 0, cdata); + glColorPointer(3, GL_FLOAT, 0, pdd.cdata); } /* draw created data arrays */ @@ -3511,7 +3681,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv glDrawArrays(GL_LINES, 0, 2*totpoint); break; case PART_DRAW_BB: - if(dt<=OB_WIRE) + if(ob_dt<=OB_WIRE) glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); glDrawArrays(GL_QUADS, 0, 4*totpoint); @@ -3522,14 +3692,14 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv } } - if(vedata){ + if(pdd.vedata){ glDisableClientState(GL_COLOR_ARRAY); cpack(0xC0C0C0); glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3, GL_FLOAT, 0, vedata); + glVertexPointer(3, GL_FLOAT, 0, pdd.vedata); - glDrawArrays(GL_LINES, 0, 2*totpoint); + glDrawArrays(GL_LINES, 0, 2*totve); } glPolygonMode(GL_FRONT, polygonmode[0]); @@ -3544,14 +3714,14 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(states) MEM_freeN(states); - if(vdata) - MEM_freeN(vdata); - if(vedata) - MEM_freeN(vedata); - if(cdata) - MEM_freeN(cdata); - if(ndata) - MEM_freeN(ndata); + if(pdd.vdata) + MEM_freeN(pdd.vdata); + if(pdd.vedata) + MEM_freeN(pdd.vedata); + if(pdd.cdata) + MEM_freeN(pdd.cdata); + if(pdd.ndata) + MEM_freeN(pdd.ndata); psys->flag &= ~PSYS_DRAWING; @@ -3560,8 +3730,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv psys->lattice= NULL; } - wmLoadMatrix(rv3d->viewmat); - wmMultMatrix(ob->obmat); // bring back local matrix for dtx + if( (base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP) ) + wmLoadMatrix(rv3d->viewmat); } static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, ParticleSystem *psys, int dt) @@ -3596,8 +3766,6 @@ static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ob if((v3d->flag & V3D_ZBUF_SELECT)==0) glDisable(GL_DEPTH_TEST); - wmLoadMatrix(rv3d->viewmat); - /* get selection theme colors */ UI_GetThemeColor3ubv(TH_VERTEX_SELECT, sel); UI_GetThemeColor3ubv(TH_VERTEX, nosel); @@ -3706,7 +3874,7 @@ static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ob if(key->flag & PEK_HIDE) continue; sprintf(val," %.1f",*key->time); - view3d_object_text_draw_add(key->world_co[0], key->world_co[1], key->world_co[2], val, 0); + view3d_particle_text_draw_add(key->world_co[0], key->world_co[1], key->world_co[2], val, 0); } } } @@ -3729,7 +3897,7 @@ static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ob if((pset->flag & PE_SHOW_TIME) && !(G.f & G_RENDER_SHADOW)){ sprintf(val," %.1f",*key->time); - view3d_object_text_draw_add(key->world_co[0], key->world_co[1], key->world_co[2], val, 0); + view3d_particle_text_draw_add(key->world_co[0], key->world_co[1], key->world_co[2], val, 0); } } } @@ -3744,7 +3912,6 @@ static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ob glEnable(GL_DEPTH_TEST); glLineWidth(1.0f); - wmMultMatrix(ob->obmat); // bring back local matrix for dtx glPointSize(1.0); } @@ -5145,7 +5312,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) ) { ParticleSystem *psys; if(col || (ob->flag & SELECT)) cpack(0xFFFFFF); /* for visibility, also while wpaint */ - glDepthMask(GL_FALSE); + //glDepthMask(GL_FALSE); + + wmLoadMatrix(rv3d->viewmat); for(psys=ob->particlesystem.first; psys; psys=psys->next) draw_new_particle_system(scene, v3d, rv3d, base, psys, dt); @@ -5155,7 +5324,11 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) if(psys && !scene->obedit && psys_in_edit_mode(scene, psys)) draw_particle_edit(scene, v3d, rv3d, ob, psys, dt); } - glDepthMask(GL_TRUE); + view3d_particle_text_draw(v3d, ar); + + wmMultMatrix(ob->obmat); + + //glDepthMask(GL_TRUE); if(col) cpack(col); } diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 76f6b980aa2..1fa17760e8d 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -503,12 +503,14 @@ typedef enum { eParticleInstanceFlag_Unborn = (1<<3), eParticleInstanceFlag_Alive = (1<<4), eParticleInstanceFlag_Dead = (1<<5), + eParticleInstanceFlag_KeepShape = (1<<6), } ParticleInstanceModifierFlag; typedef struct ParticleInstanceModifierData { ModifierData modifier; struct Object *ob; - short psys, flag, rt[2]; + short psys, flag, axis, rt; + float position, random_position; } ParticleInstanceModifierData; typedef enum { diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 05f1cc1f351..c793362c223 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -131,7 +131,7 @@ typedef struct ParticleSettings { /* general values */ float sta, end, lifetime, randlife; - float timetweak, jitfac, keyed_time, eff_hair, rt; + float timetweak, jitfac, keyed_time, eff_hair; int totpart, userjit, grid_res; /* initial velocity factors */ @@ -159,6 +159,8 @@ typedef struct ParticleSettings { float branch_thres; /* drawing stuff */ float draw_line[2]; + float path_start, path_end; + int trail_count; /* boids */ float max_vel, max_lat_acc, max_tan_acc; @@ -311,8 +313,8 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in #define PART_DRAW_SIZE 4 #define PART_DRAW_EMITTER 8 /* render emitter also */ //#define PART_DRAW_HEALTH 16 -//#define PART_DRAW_TIMED_PATH 32 -//#define PART_DRAW_CACHED_PATH 64 +#define PART_ABS_PATH_TIME 32 +//#define PART_DRAW_TRAIL 64 #define PART_DRAW_BB_LOCK 128 #define PART_DRAW_PARENT 256 #define PART_DRAW_NUM 512 diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 48bfdf70171..f4c14a51b13 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1300,6 +1300,13 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; + static EnumPropertyItem particleinstance_axis[] = { + {0, "X", 0, "X", ""}, + {1, "Y", 0, "Y", ""}, + {2, "Z", 0, "Z", ""}, + {0, NULL, 0, NULL, NULL} + }; + srna= RNA_def_struct(brna, "ParticleInstanceModifier", "Modifier"); RNA_def_struct_ui_text(srna, "ParticleInstance Modifier", "Particle system instancing modifier."); RNA_def_struct_sdna(srna, "ParticleInstanceModifierData"); @@ -1316,6 +1323,12 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna) RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Particle System Number", ""); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "axis"); + RNA_def_property_enum_items(prop, particleinstance_axis); + RNA_def_property_ui_text(prop, "Axis", "Pole axis for rotation"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); prop= RNA_def_property(srna, "normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Parents); @@ -1346,6 +1359,23 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Dead); RNA_def_property_ui_text(prop, "Dead", "Show instances when particles are dead."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "keep_shape", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_KeepShape); + RNA_def_property_ui_text(prop, "Keep Shape", "Don't stretch the object."); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "position"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_text(prop, "Position", "Position along path."); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "random_position", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "random_position"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_text(prop, "Random Position", "Randomize position along path."); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); } static void rna_def_modifier_explode(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index d60a215b498..5c94c81da1f 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -151,6 +151,20 @@ static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value) if(psys->part) psys->part->id.us++; } +static void rna_Particle_abspathtime_update(bContext *C, PointerRNA *ptr) +{ + ParticleSettings *settings = (ParticleSettings*)ptr->data; + float delta = settings->end + settings->lifetime - settings->sta; + if(settings->draw & PART_ABS_PATH_TIME) { + settings->path_start = settings->sta + settings->path_start * delta; + settings->path_end = settings->sta + settings->path_end * delta; + } + else { + settings->path_start = (settings->path_start - settings->sta)/delta; + settings->path_end = (settings->path_end - settings->sta)/delta; + } + rna_Particle_redo(C, ptr); +} static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value) { ParticleSettings *settings = (ParticleSettings*)ptr->data; @@ -189,7 +203,19 @@ static float rna_PartSetting_linelentail_get(struct PointerRNA *ptr) ParticleSettings *settings = (ParticleSettings*)ptr->data; return settings->draw_line[0]; } +static void rna_PartSetting_pathstartend_range(PointerRNA *ptr, float *min, float *max) +{ + ParticleSettings *settings = (ParticleSettings*)ptr->data; + if(settings->type==PART_HAIR) { + *min = 0.0f; + *max = (settings->draw & PART_ABS_PATH_TIME) ? 100.0f : 1.0; + } + else { + *min = (settings->draw & PART_ABS_PATH_TIME) ? settings->sta : 0.0f; + *max= (settings->draw & PART_ABS_PATH_TIME) ? MAXFRAMEF : 1.0f; + } +} static void rna_PartSetting_linelenhead_set(struct PointerRNA *ptr, float value) { ParticleSettings *settings = (ParticleSettings*)ptr->data; @@ -702,15 +728,15 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Abs Length", "Use maximum length for children"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); - prop= RNA_def_property(srna, "absolute_time", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ABS_TIME); - RNA_def_property_ui_text(prop, "Absolute Time", "Set all ipos that work on particles to be calculated in absolute/relative time."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + //prop= RNA_def_property(srna, "absolute_time", PROP_BOOLEAN, PROP_NONE); + //RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ABS_TIME); + //RNA_def_property_ui_text(prop, "Absolute Time", "Set all ipos that work on particles to be calculated in absolute/relative time."); + //RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); - prop= RNA_def_property(srna, "global_time", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GLOB_TIME); - RNA_def_property_ui_text(prop, "Global Time", "Set all ipos that work on particles to be calculated in global/object time."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + //prop= RNA_def_property(srna, "global_time", PROP_BOOLEAN, PROP_NONE); + //RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GLOB_TIME); + //RNA_def_property_ui_text(prop, "Global Time", "Set all ipos that work on particles to be calculated in global/object time."); + //RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "boids_2d", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BOIDS_2D); @@ -836,15 +862,10 @@ static void rna_def_particle_settings(BlenderRNA *brna) //RNA_def_property_ui_text(prop, "Health", "Draw boid health"); //RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); - //prop= RNA_def_property(srna, "timed_path", PROP_BOOLEAN, PROP_NONE); - //RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_TIMED_PATH); - //RNA_def_property_ui_text(prop, "Clip with time", "Clip path based on time"); - //RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); - - //prop= RNA_def_property(srna, "draw_cached_path", PROP_BOOLEAN, PROP_NONE); - //RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_CACHED_PATH); - //RNA_def_property_ui_text(prop, "Path", "Draw particle path if the path is baked"); - //RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + prop= RNA_def_property(srna, "abs_path_time", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_ABS_PATH_TIME); + RNA_def_property_ui_text(prop, "Absolute Path Time", "Path timing is in absolute frames"); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_abspathtime_update"); prop= RNA_def_property(srna, "billboard_lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_BB_LOCK); @@ -1410,6 +1431,24 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Head", "Length of the line's head"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + prop= RNA_def_property(srna, "path_start", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "path_start"); + RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range"); + RNA_def_property_ui_text(prop, "Path Start", "Starting time of drawn path."); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + + prop= RNA_def_property(srna, "path_end", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "path_end"); + RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range"); + RNA_def_property_ui_text(prop, "Path End", "End time of drawn path."); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + + prop= RNA_def_property(srna, "trail_count", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "trail_count"); + RNA_def_property_range(prop, 1.0f, 100.0f); + RNA_def_property_ui_text(prop, "Trail Count", "Number of trail particles."); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + /* boids */ prop= RNA_def_property(srna, "max_velocity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max_vel"); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index a00cd2211fc..74686511b21 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -1246,6 +1246,19 @@ static void static_particle_wire(ObjectRen *obr, Material *ma, float *vec, float } +static void particle_curve(Render *re, ObjectRen *obr, DerivedMesh *dm, Material *ma, ParticleStrandData *sd, float *loc, float *loc1, int seed) +{ + HaloRen *har=0; + + if(ma->mode&MA_WIRE) + static_particle_wire(obr, ma, loc, loc1, sd->first, sd->line); + else if(ma->material_type == MA_TYPE_HALO) { + har= RE_inithalo_particle(re, obr, dm, ma, loc, loc1, sd->orco, sd->uvco, sd->size, 1.0, seed); + if(har) har->lay= obr->ob->lay; + } + else + static_particle_strand(re, obr, ma, sd, loc, loc1); +} static void particle_billboard(Render *re, ObjectRen *obr, Material *ma, ParticleBillboardData *bb) { VlakRen *vlr; @@ -1368,18 +1381,55 @@ static void particle_billboard(Render *re, ObjectRen *obr, Material *ma, Particl mtf->uv[3][1] = uvy; } } -static void render_new_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Material *ma, ParticleStrandData *sd, float *loc, float *loc1, int seed) +static void particle_normal_ren(short ren_as, ParticleSettings *part, Render *re, ObjectRen *obr, DerivedMesh *dm, Material *ma, ParticleStrandData *sd, ParticleBillboardData *bb, ParticleKey *state, int seed, float hasize) { - HaloRen *har=0; + float loc[3], loc0[3], loc1[3], vel[3]; + + VECCOPY(loc, state->co); - if(ma->mode&MA_WIRE) - static_particle_wire(obr, ma, loc, loc1, sd->first, sd->line); - else if(ma->material_type == MA_TYPE_HALO) { - har= RE_inithalo_particle(re, obr, dm, ma, loc, loc1, sd->orco, sd->uvco, sd->size, 1.0, seed); - if(har) har->lay= obr->ob->lay; + if(ren_as != PART_DRAW_BB) + MTC_Mat4MulVecfl(re->viewmat, loc); + + switch(ren_as) { + case PART_DRAW_LINE: + sd->line = 1; + sd->time = 0.0f; + sd->size = hasize; + + VECCOPY(vel, state->vel); + MTC_Mat4Mul3Vecfl(re->viewmat, vel); + Normalize(vel); + + if(part->draw & PART_DRAW_VEL_LENGTH) + VecMulf(vel, VecLength(state->vel)); + + VECADDFAC(loc0, loc, vel, -part->draw_line[0]); + VECADDFAC(loc1, loc, vel, part->draw_line[1]); + + particle_curve(re, obr, dm, ma, sd, loc0, loc1, seed); + + break; + + case PART_DRAW_BB: + + VECCOPY(bb->vec, loc); + VECCOPY(bb->vel, state->vel); + + particle_billboard(re, obr, ma, bb); + + break; + + default: + { + HaloRen *har=0; + + har = RE_inithalo_particle(re, obr, dm, ma, loc, NULL, sd->orco, sd->uvco, hasize, 0.0, seed); + + if(har) har->lay= obr->ob->lay; + + break; + } } - else - static_particle_strand(re, obr, ma, sd, loc, loc1); } static void get_particle_uvco_mcol(short from, DerivedMesh *dm, float *fuv, int num, ParticleStrandData *sd) { @@ -1436,9 +1486,10 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem StrandBound *sbound= 0; StrandRen *strand=0; RNG *rng= 0; - float loc[3],loc1[3],loc0[3],vel[3],mat[4][4],nmat[3][3],co[3],nor[3],time; + float loc[3],loc1[3],loc0[3],mat[4][4],nmat[3][3],co[3],nor[3],time; float strandlen=0.0f, curlen=0.0f; - float hasize, pa_size, pa_time, r_tilt, cfra=bsystem_time(re->scene, ob, (float)re->scene->r.cfra, 0.0); + float hasize, pa_size, r_tilt, r_length, cfra=bsystem_time(re->scene, ob, (float)re->scene->r.cfra, 0.0); + float pa_time, pa_birthtime, pa_dietime; float random, simplify[2]; int i, a, k, max_k=0, totpart, dosimplify = 0, dosurfacecache = 0; int totchild=0; @@ -1654,6 +1705,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem if(pa->flag & PARS_UNEXIST) continue; pa_time=(cfra-pa->time)/pa->lifetime; + pa_birthtime = pa->time; + pa_dietime = pa->dietime; if((part->flag&PART_ABS_TIME) == 0){ #if 0 // XXX old animation system if(ma->ipo) { @@ -1691,6 +1744,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem pa_size = pa->size; r_tilt = 1.0f + pa->r_ave[0]; + r_length = 0.5f * (1.0f + pa->r_ave[1]); if(path_nbr) { cache = psys->pathcache[a]; @@ -1711,7 +1765,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem max_k = (int)cache->steps; } - pa_time = psys_get_child_time(psys, cpa, cfra); + pa_time = psys_get_child_time(psys, cpa, cfra, &pa_birthtime, &pa_dietime); if((part->flag & PART_ABS_TIME) == 0) { #if 0 // XXX old animation system @@ -1731,6 +1785,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem pa_size = psys_get_child_size(psys, cpa, cfra, &pa_time); r_tilt = 2.0f * cpa->rand[2]; + r_length = cpa->rand[1]; num = cpa->num; @@ -1864,14 +1919,14 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem VECSUB(loc0,loc1,loc); VECADD(loc0,loc1,loc0); - render_new_particle(re, obr, psmd->dm, ma, &sd, loc1, loc0, seed); + particle_curve(re, obr, psmd->dm, ma, &sd, loc1, loc0, seed); } sd.first = 0; sd.time = time; if(k) - render_new_particle(re, obr, psmd->dm, ma, &sd, loc, loc1, seed); + particle_curve(re, obr, psmd->dm, ma, &sd, loc, loc1, seed); VECCOPY(loc1,loc); } @@ -1880,61 +1935,55 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem } else { /* render normal particles */ - time=0.0f; - state.time=cfra; - if(psys_get_particle_state(re->scene,ob,psys,a,&state,0)==0) - continue; - - if(psys->parent) - Mat4MulVecfl(psys->parent->obmat, state.co); - - VECCOPY(loc,state.co); - if(part->ren_as!=PART_DRAW_BB) - MTC_Mat4MulVecfl(re->viewmat,loc); - - switch(part->ren_as) { - case PART_DRAW_LINE: - sd.line = 1; - sd.time = 0.0f; - sd.size = hasize; + if(part->trail_count > 1) { + float length = part->path_end * (1.0 - part->randlength * r_length); + int trail_count = part->trail_count * (1.0 - part->randlength * r_length); + float ct = (part->draw & PART_ABS_PATH_TIME) ? cfra : pa_time; + float dt = length / (trail_count ? (float)trail_count : 1.0f); + + for(i=0; i < trail_count; i++, ct -= dt) { + if(part->draw & PART_ABS_PATH_TIME) { + if(ct < pa_birthtime || ct > pa_dietime) + continue; + } + else if(ct < 0.0f || ct > 1.0f) + continue; - VECCOPY(vel,state.vel); - MTC_Mat4Mul3Vecfl(re->viewmat,vel); - Normalize(vel); + state.time = (part->draw & PART_ABS_PATH_TIME) ? -ct : ct; + psys_get_particle_on_path(re->scene,ob,psys,a,&state,1); - if(part->draw & PART_DRAW_VEL_LENGTH) - VecMulf(vel,VecLength(state.vel)); + if(psys->parent) + Mat4MulVecfl(psys->parent->obmat, state.co); - VECADDFAC(loc0,loc,vel,-part->draw_line[0]); - VECADDFAC(loc1,loc,vel,part->draw_line[1]); + if(part->ren_as == PART_DRAW_BB) { + bb.random = random; + bb.size = pa_size; + bb.tilt = part->bb_tilt * (1.0f - part->bb_rand_tilt * r_tilt); + bb.time = ct; + bb.num = a; + } - render_new_particle(re,obr,psmd->dm,ma,&sd,loc0,loc1,seed); + particle_normal_ren(part->ren_as, part, re, obr, psmd->dm, ma, &sd, &bb, &state, seed, hasize); + } + } + else { + time=0.0f; + state.time=cfra; + if(psys_get_particle_state(re->scene,ob,psys,a,&state,0)==0) + continue; - break; + if(psys->parent) + Mat4MulVecfl(psys->parent->obmat, state.co); - case PART_DRAW_BB: + if(part->ren_as == PART_DRAW_BB) { bb.random = random; bb.size = pa_size; bb.tilt = part->bb_tilt * (1.0f - part->bb_rand_tilt * r_tilt); bb.time = pa_time; bb.num = a; - VECCOPY(bb.vec, loc); - VECCOPY(bb.vel, state.vel); - - particle_billboard(re, obr, ma, &bb); - - break; - - default: - { - HaloRen *har=0; - - har = RE_inithalo_particle(re, obr, psmd->dm, ma, loc, NULL, sd.orco, sd.uvco, hasize, 0.0, seed); - - if(har) har->lay= obr->ob->lay; - - break; } + + particle_normal_ren(part->ren_as, part, re, obr, psmd->dm, ma, &sd, &bb, &state, seed, hasize); } } -- cgit v1.2.3 From 7055702530f778ebf66e53bc4336e812fb0cd885 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sat, 4 Jul 2009 12:09:21 +0000 Subject: Rendering animations with particle trails cached. --- source/blender/blenkernel/BKE_pointcache.h | 1 + source/blender/blenkernel/intern/pointcache.c | 3 ++- source/blender/editors/physics/ed_pointcache.c | 3 +++ source/blender/render/intern/source/pipeline.c | 13 +++++++------ 4 files changed, 13 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index 3f1c45d28ec..c5d423c13ba 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -114,6 +114,7 @@ typedef struct PTCacheBaker { struct Scene *scene; int bake; int render; + int anim_init; int quick_step; struct PTCacheID *pid; int (*break_test)(void *data); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index b8a0b111324..2fbd0278e0e 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1154,6 +1154,7 @@ void BKE_ptcache_quick_cache_all(Scene *scene) baker.progressbar=NULL; baker.progresscontext=NULL; baker.render=0; + baker.anim_init = 0; baker.scene=scene; if(count_quick_cache(scene, &baker.quick_step)) @@ -1171,7 +1172,7 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) float frameleno = scene->r.framelen; int cfrao = CFRA; int startframe = MAXFRAME; - int endframe = CFRA; + int endframe = baker->anim_init ? scene->r.sfra : CFRA; int bake = baker->bake; int render = baker->render; int step = baker->quick_step; diff --git a/source/blender/editors/physics/ed_pointcache.c b/source/blender/editors/physics/ed_pointcache.c index edd668b46bb..ad60be3ba7d 100644 --- a/source/blender/editors/physics/ed_pointcache.c +++ b/source/blender/editors/physics/ed_pointcache.c @@ -82,6 +82,7 @@ static int ptcache_bake_all_exec(bContext *C, wmOperator *op) baker.pid = NULL; baker.bake = RNA_boolean_get(op->ptr, "bake"); baker.render = 0; + baker.anim_init = 0; baker.quick_step = 1; baker.break_test = cache_break_test; baker.break_data = NULL; @@ -172,6 +173,7 @@ static int ptcache_bake_cloth_exec(bContext *C, wmOperator *op) baker.pid = &pid; baker.bake = RNA_boolean_get(op->ptr, "bake"); baker.render = 0; + baker.anim_init = 0; baker.quick_step = 1; baker.break_test = cache_break_test; baker.break_data = NULL; @@ -277,6 +279,7 @@ static int ptcache_bake_particle_system_exec(bContext *C, wmOperator *op) baker.pid = &pid; baker.bake = RNA_boolean_get(op->ptr, "bake"); baker.render = 0; + baker.anim_init = 0; baker.quick_step = 1; baker.break_test = cache_break_test; baker.break_data = NULL; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index ccc793e4235..ec2660566f5 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -2413,7 +2413,7 @@ static int is_rendering_allowed(Render *re) return 1; } -static void update_physics_cache(Render *re, Scene *scene) +static void update_physics_cache(Render *re, Scene *scene, int anim_init) { PTCacheBaker baker; @@ -2421,6 +2421,7 @@ static void update_physics_cache(Render *re, Scene *scene) baker.pid = NULL; baker.bake = 0; baker.render = 1; + baker.anim_init = 1; baker.quick_step = 1; baker.break_test = re->test_break; baker.break_data = re->tbh; @@ -2429,7 +2430,7 @@ static void update_physics_cache(Render *re, Scene *scene) BKE_ptcache_make_cache(&baker); } /* evaluating scene options for general Blender render */ -static int render_initialize_from_scene(Render *re, Scene *scene, int anim) +static int render_initialize_from_scene(Render *re, Scene *scene, int anim, int anim_init) { int winx, winy; rcti disprect; @@ -2467,7 +2468,7 @@ static int render_initialize_from_scene(Render *re, Scene *scene, int anim) tag_scenes_for_render(re); /* make sure dynamics are up to date */ - update_physics_cache(re, scene); + update_physics_cache(re, scene, anim_init); if(scene->r.scemode & R_SINGLE_LAYER) push_render_result(re); @@ -2497,7 +2498,7 @@ void RE_BlenderFrame(Render *re, Scene *scene, int frame) scene->r.cfra= frame; - if(render_initialize_from_scene(re, scene, 0)) { + if(render_initialize_from_scene(re, scene, 0, 0)) { do_render_all_options(re); } @@ -2586,7 +2587,7 @@ void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra, int tfra) int nfra; /* do not fully call for each frame, it initializes & pops output window */ - if(!render_initialize_from_scene(re, scene, 0)) + if(!render_initialize_from_scene(re, scene, 0, 1)) return; /* ugly global still... is to prevent renderwin events and signal subsurfs etc to make full resol */ @@ -2617,7 +2618,7 @@ void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra, int tfra) char name[FILE_MAX]; /* only border now, todo: camera lens. (ton) */ - render_initialize_from_scene(re, scene, 1); + render_initialize_from_scene(re, scene, 1, 0); if(nfra!=scene->r.cfra) { /* -- cgit v1.2.3 From 46f6cdcdcc68917bf54926a72aae34a061c4ec7f Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sun, 5 Jul 2009 12:36:20 +0000 Subject: Added a particle instance modifier option to use particle size. --- source/blender/blenkernel/intern/modifier.c | 33 +++++++++++++++++++++++---- source/blender/makesdna/DNA_modifier_types.h | 1 + source/blender/makesrna/intern/rna_modifier.c | 5 ++++ 3 files changed, 35 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 71428a9e947..046dfcc9f87 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -6477,6 +6477,7 @@ static DerivedMesh * particleInstanceModifier_applyModifier( int i,totvert, totpart=0, totface, maxvert, maxface, first_particle=0; short track=ob->trackflag%3, trackneg, axis = pimd->axis; float max_co=0.0, min_co=0.0, temp_co[3], cross[3]; + float *size=NULL; trackneg=((ob->trackflag>2)?1:0); @@ -6503,6 +6504,25 @@ static DerivedMesh * particleInstanceModifier_applyModifier( if(totpart==0) return derivedData; + if(pimd->flag & eParticleInstanceFlag_UseSize) { + int p; + float *si; + si = size = MEM_callocN(totpart * sizeof(float), "particle size array"); + + if(pimd->flag & eParticleInstanceFlag_Parents) { + for(p=0, pa= psys->particles; ptotpart; p++, pa++, si++) + *si = pa->size; + } + + if(pimd->flag & eParticleInstanceFlag_Children) { + ChildParticle *cpa = psys->child; + + for(p=0; ptotchild; p++, cpa++, si++) { + *si = psys_get_child_size(psys, cpa, 0.0f, NULL); + } + } + } + pars=psys->particles; totvert=dm->getNumVerts(dm); @@ -6585,10 +6605,12 @@ static DerivedMesh * particleInstanceModifier_applyModifier( } else{ state.time=-1.0; - psys_get_particle_state(md->scene, pimd->ob, psys, i/totvert, &state,1); + psys_get_particle_state(md->scene, pimd->ob, psys, first_particle + i/totvert, &state,1); } QuatMulVecf(state.rot,mv->co); + if(pimd->flag & eParticleInstanceFlag_UseSize) + VecMulf(mv->co, size[i/totvert]); VECADD(mv->co,mv->co,state.co); } @@ -6641,6 +6663,9 @@ static DerivedMesh * particleInstanceModifier_applyModifier( psys->lattice= NULL; } + if(size) + MEM_freeN(size); + return result; } static DerivedMesh *particleInstanceModifier_applyModifierEM( @@ -7279,10 +7304,10 @@ static DerivedMesh * explodeModifier_explodeMesh(ExplodeModifierData *emd, timestep= psys_get_timestep(part); - if(part->flag & PART_GLOB_TIME) + //if(part->flag & PART_GLOB_TIME) cfra=bsystem_time(scene, 0,(float)scene->r.cfra,0.0); - else - cfra=bsystem_time(scene, ob,(float)scene->r.cfra,0.0); + //else + // cfra=bsystem_time(scene, ob,(float)scene->r.cfra,0.0); /* hash table for vertice <-> particle relations */ vertpahash= BLI_edgehash_new(); diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 1fa17760e8d..49a6fd4daf0 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -504,6 +504,7 @@ typedef enum { eParticleInstanceFlag_Alive = (1<<4), eParticleInstanceFlag_Dead = (1<<5), eParticleInstanceFlag_KeepShape = (1<<6), + eParticleInstanceFlag_UseSize = (1<<7), } ParticleInstanceModifierFlag; typedef struct ParticleInstanceModifierData { diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index f4c14a51b13..30e9346a961 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1365,6 +1365,11 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Keep Shape", "Don't stretch the object."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + prop= RNA_def_property(srna, "size", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_UseSize); + RNA_def_property_ui_text(prop, "Size", "Use particle size to scale the instances."); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "position"); RNA_def_property_range(prop, 0.0, 1.0); -- cgit v1.2.3 From f08124a3e2e853443d1a2745d66bb9eb0fd4565d Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Sun, 5 Jul 2009 22:26:43 +0000 Subject: 2.5 filebrowser * bringing back file numbering operator (PADPLUSKEY, PADMINUS) * Note: discovered conflicting key with View2D zooming that causes it to not work in panel area. --- source/blender/editors/space_file/file_intern.h | 1 + source/blender/editors/space_file/file_ops.c | 29 ++++++++++++ source/blender/editors/space_file/space_file.c | 63 ++++++++++++++++++++++--- 3 files changed, 86 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 668e14c95e6..5a440be6962 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -67,6 +67,7 @@ void FILE_OT_cancel(struct wmOperatorType *ot); void FILE_OT_parent(struct wmOperatorType *ot); void FILE_OT_refresh(struct wmOperatorType *ot); void FILE_OT_bookmark_toggle(struct wmOperatorType *ot); +void FILE_OT_filenum(struct wmOperatorType *ot); int file_exec(bContext *C, struct wmOperator *unused); int file_cancel_exec(bContext *C, struct wmOperator *unused); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index aaa1793efbb..fa377c06184 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -685,3 +685,32 @@ void FILE_OT_bookmark_toggle(struct wmOperatorType *ot) ot->exec= file_bookmark_toggle_exec; ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ } + + +int file_filenum_exec(bContext *C, wmOperator *op) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + + int inc = RNA_int_get(op->ptr, "increment"); + if(sfile->params && (inc != 0)) { + BLI_newname(sfile->params->file, inc); + WM_event_add_notifier(C, NC_WINDOW, NULL); + } + + return OPERATOR_FINISHED; + +} + +void FILE_OT_filenum(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Increment Number in Filename"; + ot->idname= "FILE_OT_filenum"; + + /* api callbacks */ + ot->exec= file_filenum_exec; + ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ + + /* props */ + RNA_def_int(ot->srna, "increment", 1, 0, 100, "Increment", "", 0,100); +} \ No newline at end of file diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 156c7d6f9be..99c0c44078b 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -211,8 +211,11 @@ static void file_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy); - /* own keymap */ - keymap= WM_keymap_listbase(wm, "File", SPACE_FILE, 0); /* XXX weak? */ + /* own keymaps */ + keymap= WM_keymap_listbase(wm, "File", SPACE_FILE, 0); + WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); + + keymap= WM_keymap_listbase(wm, "FileMain", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); @@ -295,30 +298,67 @@ void file_operatortypes(void) WM_operatortype_append(FILE_OT_add_bookmark); WM_operatortype_append(FILE_OT_delete_bookmark); WM_operatortype_append(FILE_OT_hidedot); + WM_operatortype_append(FILE_OT_filenum); } /* NOTE: do not add .blend file reading on this level */ void file_keymap(struct wmWindowManager *wm) { + wmKeymapItem *kmi; + /* keys for all areas */ ListBase *keymap= WM_keymap_listbase(wm, "File", SPACE_FILE, 0); WM_keymap_add_item(keymap, "FILE_OT_bookmark_toggle", NKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "FILE_OT_parent", PKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "FILE_OT_add_bookmark", BKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "FILE_OT_hidedot", HKEY, KM_PRESS, 0, 0); + + /* keys for main area */ + keymap= WM_keymap_listbase(wm, "FileMain", SPACE_FILE, 0); WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_select_border", BKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_highlight", MOUSEMOVE, KM_ANY, 0, 0); - WM_keymap_add_item(keymap, "FILE_OT_parent", PKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "FILE_OT_add_bookmark", BKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "FILE_OT_hidedot", HKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_loadimages", TIMER1, KM_ANY, KM_ANY, 0); + kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0); + RNA_int_set(kmi->ptr, "increment", 1); + kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, KM_SHIFT, 0); + RNA_int_set(kmi->ptr, "increment", 10); + kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); + RNA_int_set(kmi->ptr, "increment", 100); + kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, 0,0); + RNA_int_set(kmi->ptr, "increment", -1); + kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_SHIFT, 0); + RNA_int_set(kmi->ptr, "increment", -10); + kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_CTRL, 0); + RNA_int_set(kmi->ptr, "increment",-100); - keymap= WM_keymap_listbase(wm, "FileBookmark", SPACE_FILE, 0); - WM_keymap_add_item(keymap, "FILE_OT_select_bookmark", LEFTMOUSE, KM_PRESS, 0, 0); + /* keys for button area (top) */ + keymap= WM_keymap_listbase(wm, "FileButtons", SPACE_FILE, 0); + WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0); + RNA_int_set(kmi->ptr, "increment", 1); + kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, KM_SHIFT, 0); + RNA_int_set(kmi->ptr, "increment", 10); + kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); + RNA_int_set(kmi->ptr, "increment", 100); + kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, 0, 0); + RNA_int_set(kmi->ptr, "increment", -1); + kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_SHIFT,0); + RNA_int_set(kmi->ptr, "increment", -10); + kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_CTRL,0); + RNA_int_set(kmi->ptr, "increment",-100); } static void file_channel_area_init(wmWindowManager *wm, ARegion *ar) { + ListBase *keymap; + ED_region_panels_init(wm, ar); + + /* own keymaps */ + keymap= WM_keymap_listbase(wm, "File", SPACE_FILE, 0); + WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } static void file_channel_area_draw(const bContext *C, ARegion *ar) @@ -348,7 +388,16 @@ static void file_header_area_draw(const bContext *C, ARegion *ar) /* add handlers, stuff you only do once or on area/region changes */ static void file_ui_area_init(wmWindowManager *wm, ARegion *ar) { + ListBase *keymap; + UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); + + /* own keymap */ + keymap= WM_keymap_listbase(wm, "File", SPACE_FILE, 0); /* XXX weak? */ + WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); + + keymap= WM_keymap_listbase(wm, "FileButtons", SPACE_FILE, 0); /* XXX weak? */ + WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } static void file_ui_area_draw(const bContext *C, ARegion *ar) -- cgit v1.2.3 From f87fcde686c85820c510c5c7806f6b6b8466ba5c Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 6 Jul 2009 03:44:44 +0000 Subject: NLA SoC: Start of 'Meta' Strips Refactored the backend code/API's to support 'meta' strips (i.e. strips containing other strips). These have been implemented to be nested to 'unlimited' depths (in terms of common usages that is, though there is a very remote chance of stack-overflow in theoretrical evil cases only that shouldn't ever be encountered in production). This paves the way for implementing the necessary tweaks needed for the transform code (in addition to some cool user-level tricks) --- source/blender/blenkernel/BKE_nla.h | 8 + source/blender/blenkernel/intern/anim_sys.c | 47 ++++-- source/blender/blenkernel/intern/nla.c | 213 +++++++++++++++++--------- source/blender/blenloader/intern/readfile.c | 75 ++++++--- source/blender/blenloader/intern/writefile.c | 30 ++-- source/blender/editors/space_nla/nla_edit.c | 120 +++++++++++++-- source/blender/editors/space_nla/nla_intern.h | 11 ++ source/blender/makesdna/DNA_anim_types.h | 9 ++ 8 files changed, 385 insertions(+), 128 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index e2b1dd89deb..efa0591bd53 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -53,6 +53,13 @@ struct NlaStrip *add_nlastrip_to_stack(struct AnimData *adt, struct bAction *act /* ----------------------------- */ /* API */ +short BKE_nlastrips_has_space(ListBase *strips, float start, float end); +void BKE_nlastrips_sort_strips(ListBase *strips); + +short BKE_nlastrips_add_strip(ListBase *strips, struct NlaStrip *strip); + +/* ............ */ + struct NlaTrack *BKE_nlatrack_find_active(ListBase *tracks); void BKE_nlatrack_set_active(ListBase *tracks, struct NlaTrack *nlt); @@ -63,6 +70,7 @@ void BKE_nlatrack_sort_strips(struct NlaTrack *nlt); short BKE_nlatrack_add_strip(struct NlaTrack *nlt, struct NlaStrip *strip); +/* ............ */ struct NlaStrip *BKE_nlastrip_find_active(struct NlaTrack *nlt); short BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max); diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 9befe9dc9cb..1d10744ac80 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -628,15 +628,13 @@ static void nlastrip_evaluate_controls (NlaStrip *strip, float ctime) } -/* gets the strip active at the current time for a track for evaluation purposes */ -static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index, float ctime) +/* gets the strip active at the current time for a given list of strips */ +static NlaStrip *ctime_get_strip (ListBase *strips, short *side, float ctime) { NlaStrip *strip, *estrip=NULL; - NlaEvalStrip *nes; - short side= 0; /* loop over strips, checking if they fall within the range */ - for (strip= nlt->strips.first; strip; strip= strip->next) { + for (strip= strips->first; strip; strip= strip->next) { /* check if current time occurs within this strip */ if (IN_RANGE_INCL(ctime, strip->start, strip->end)) { /* this strip is active, so try to use it */ @@ -647,13 +645,13 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index /* if time occurred before current strip... */ if (ctime < strip->start) { - if (strip == nlt->strips.first) { + if (strip == strips->first) { /* before first strip - only try to use it if it extends backwards in time too */ if (strip->extendmode == NLASTRIP_EXTEND_HOLD) estrip= strip; /* side is 'before' regardless of whether there's a useful strip */ - side= NES_TIME_BEFORE; + *side= NES_TIME_BEFORE; } else { /* before next strip - previous strip has ended, but next hasn't begun, @@ -665,7 +663,7 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index if (strip->extendmode != NLASTRIP_EXTEND_NOTHING) estrip= strip; - side= NES_TIME_AFTER; + *side= NES_TIME_AFTER; } break; } @@ -673,11 +671,11 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index /* if time occurred after current strip... */ if (ctime > strip->end) { /* only if this is the last strip should we do anything, and only if that is being held */ - if (strip == nlt->strips.last) { + if (strip == strips->last) { if (strip->extendmode != NLASTRIP_EXTEND_NOTHING) estrip= strip; - side= NES_TIME_AFTER; + *side= NES_TIME_AFTER; break; } @@ -685,6 +683,35 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index } } + /* return the matching strip found */ + return estrip; +} + +/* gets the strip active at the current time for a track for evaluation purposes */ +static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index, float ctime) +{ + ListBase *strips= &nlt->strips; + NlaStrip *strip, *estrip=NULL; + NlaEvalStrip *nes; + short side= 0; + + /* keep looping over hierarchy of strips until one which fits for the current time is found */ + while (strips->first) { + /* try to get the strip at this frame for this strip */ + strip= ctime_get_strip(strips, &side, ctime); + + /* if a strip was found, make this the new estrip, otherwise, stop trying */ + if (strip) { + /* set new estrip */ + estrip= strip; + + /* check children (only available if this is a meta-strip) for better match */ + strips= &strip->strips; + } + else + break; + } + /* check if a valid strip was found * - must not be muted (i.e. will have contribution */ diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 1244b2900fd..d01fa2c1965 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -68,10 +68,18 @@ */ void free_nlastrip (ListBase *strips, NlaStrip *strip) { + NlaStrip *cs, *csn; + /* sanity checks */ if (strip == NULL) return; + /* free child-strips */ + for (cs= strip->strips.first; cs; cs= csn) { + csn= cs->next; + free_nlastrip(&strip->strips, cs); + } + /* remove reference to action */ if (strip->act) strip->act->id.us--; @@ -144,6 +152,7 @@ void free_nladata (ListBase *tracks) NlaStrip *copy_nlastrip (NlaStrip *strip) { NlaStrip *strip_d; + NlaStrip *cs, *cs_d; /* sanity check */ if (strip == NULL) @@ -161,6 +170,14 @@ NlaStrip *copy_nlastrip (NlaStrip *strip) copy_fcurves(&strip_d->fcurves, &strip->fcurves); copy_fmodifiers(&strip_d->modifiers, &strip->modifiers); + /* make a copy of all the child-strips, one at a time */ + strip_d->strips.first= strip_d->strips.last= NULL; + + for (cs= strip->strips.first; cs; cs= cs->next) { + cs_d= copy_nlastrip(cs); + BLI_addtail(&strip_d->strips, cs_d); + } + /* return the strip */ return strip_d; } @@ -435,6 +452,7 @@ static float nlastrip_get_frame_transition (NlaStrip *strip, float cframe, short float nlastrip_get_frame (NlaStrip *strip, float cframe, short mode) { switch (strip->type) { + case NLASTRIP_TYPE_META: /* meta (is just a container for other strips, so shouldn't use the action-clip method) */ case NLASTRIP_TYPE_TRANSITION: /* transition */ return nlastrip_get_frame_transition(strip, cframe, mode); @@ -487,6 +505,117 @@ float BKE_nla_tweakedit_remap (AnimData *adt, float cframe, short mode) /* *************************************************** */ /* Basic Utilities */ +/* List of Strips ------------------------------------ */ +/* (these functions are used for NLA-Tracks and also for nested/meta-strips) */ + +/* Check if there is any space in the given list to add the given strip */ +short BKE_nlastrips_has_space (ListBase *strips, float start, float end) +{ + NlaStrip *strip; + + /* sanity checks */ + if ((strips == NULL) || IS_EQ(start, end)) + return 0; + if (start > end) { + puts("BKE_nlastrips_has_space() error... start and end arguments swapped"); + SWAP(float, start, end); + } + + /* loop over NLA strips checking for any overlaps with this area... */ + for (strip= strips->first; strip; strip= strip->next) { + /* if start frame of strip is past the target end-frame, that means that + * we've gone past the window we need to check for, so things are fine + */ + if (strip->start > end) + return 1; + + /* if the end of the strip is greater than either of the boundaries, the range + * must fall within the extents of the strip + */ + if ((strip->end > start) || (strip->end > end)) + return 0; + } + + /* if we are still here, we haven't encountered any overlapping strips */ + return 1; +} + +/* Rearrange the strips in the track so that they are always in order + * (usually only needed after a strip has been moved) + */ +void BKE_nlastrips_sort_strips (ListBase *strips) +{ + ListBase tmp = {NULL, NULL}; + NlaStrip *strip, *sstrip; + + /* sanity checks */ + if ELEM(NULL, strips, strips->first) + return; + + /* we simply perform insertion sort on this list, since it is assumed that per track, + * there are only likely to be at most 5-10 strips + */ + for (strip= strips->first; strip; strip= strip->next) { + short not_added = 1; + + /* remove this strip from the list, and add it to the new list, searching from the end of + * the list, assuming that the lists are in order + */ + BLI_remlink(strips, strip); + + for (sstrip= tmp.last; not_added && sstrip; sstrip= sstrip->prev) { + /* check if add after */ + if (sstrip->end < strip->start) { + BLI_insertlinkafter(&tmp, sstrip, strip); + not_added= 0; + break; + } + } + + /* add before first? */ + if (not_added) + BLI_addhead(&tmp, strip); + } + + /* reassign the start and end points of the strips */ + strips->first= tmp.first; + strips->last= tmp.last; +} + +/* Add the given NLA-Strip to the given list of strips, assuming that it + * isn't currently a member of another list + */ +short BKE_nlastrips_add_strip (ListBase *strips, NlaStrip *strip) +{ + NlaStrip *ns; + short not_added = 1; + + /* sanity checks */ + if ELEM(NULL, strips, strip) + return 0; + + /* check if any space to add */ + if (BKE_nlastrips_has_space(strips, strip->start, strip->end)==0) + return 0; + + /* find the right place to add the strip to the nominated track */ + for (ns= strips->first; ns; ns= ns->next) { + /* if current strip occurs after the new strip, add it before */ + if (ns->start > strip->end) { + BLI_insertlinkbefore(strips, ns, strip); + not_added= 0; + break; + } + } + if (not_added) { + /* just add to the end of the list of the strips then... */ + BLI_addtail(strips, strip); + } + + /* added... */ + return 1; +} + /* NLA-Tracks ---------------------------------------- */ /* Find the active NLA-track for the given stack */ @@ -560,36 +689,20 @@ void BKE_nlatrack_set_active (ListBase *tracks, NlaTrack *nlt_a) nlt_a->flag |= NLATRACK_ACTIVE; } -/* Check if there is any space in the last track to add the given strip */ + +/* Check if there is any space in the given track to add a strip of the given length */ short BKE_nlatrack_has_space (NlaTrack *nlt, float start, float end) { - NlaStrip *strip; - /* sanity checks */ if ((nlt == NULL) || IS_EQ(start, end)) return 0; if (start > end) { - puts("BKE_nlatrack_has_space error... start and end arguments swapped"); + puts("BKE_nlatrack_has_space() error... start and end arguments swapped"); SWAP(float, start, end); } - /* loop over NLA strips checking for any overlaps with this area... */ - for (strip= nlt->strips.first; strip; strip= strip->next) { - /* if start frame of strip is past the target end-frame, that means that - * we've gone past the window we need to check for, so things are fine - */ - if (strip->start > end) - return 1; - - /* if the end of the strip is greater than either of the boundaries, the range - * must fall within the extents of the strip - */ - if ((strip->end > start) || (strip->end > end)) - return 0; - } - - /* if we are still here, we haven't encountered any overlapping strips */ - return 1; + /* check if there's any space left in the track for a strip of the given length */ + return BKE_nlastrips_has_space(&nlt->strips, start, end); } /* Rearrange the strips in the track so that they are always in order @@ -597,41 +710,12 @@ short BKE_nlatrack_has_space (NlaTrack *nlt, float start, float end) */ void BKE_nlatrack_sort_strips (NlaTrack *nlt) { - ListBase tmp = {NULL, NULL}; - NlaStrip *strip, *sstrip; - /* sanity checks */ if ELEM(NULL, nlt, nlt->strips.first) return; - - /* we simply perform insertion sort on this list, since it is assumed that per track, - * there are only likely to be at most 5-10 strips - */ - for (strip= nlt->strips.first; strip; strip= strip->next) { - short not_added = 1; - - /* remove this strip from the list, and add it to the new list, searching from the end of - * the list, assuming that the lists are in order - */ - BLI_remlink(&nlt->strips, strip); - - for (sstrip= tmp.last; not_added && sstrip; sstrip= sstrip->prev) { - /* check if add after */ - if (sstrip->end < strip->start) { - BLI_insertlinkafter(&tmp, sstrip, strip); - not_added= 0; - break; - } - } - - /* add before first? */ - if (not_added) - BLI_addhead(&tmp, strip); - } - /* reassign the start and end points of the strips */ - nlt->strips.first= tmp.first; - nlt->strips.last= tmp.last; + /* sort the strips with a more generic function */ + BKE_nlastrips_sort_strips(&nlt->strips); } /* Add the given NLA-Strip to the given NLA-Track, assuming that it @@ -639,33 +723,12 @@ void BKE_nlatrack_sort_strips (NlaTrack *nlt) */ short BKE_nlatrack_add_strip (NlaTrack *nlt, NlaStrip *strip) { - NlaStrip *ns; - short not_added = 1; - /* sanity checks */ if ELEM(NULL, nlt, strip) return 0; - /* check if any space to add */ - if (BKE_nlatrack_has_space(nlt, strip->start, strip->end)==0) - return 0; - - /* find the right place to add the strip to the nominated track */ - for (ns= nlt->strips.first; ns; ns= ns->next) { - /* if current strip occurs after the new strip, add it before */ - if (ns->start > strip->end) { - BLI_insertlinkbefore(&nlt->strips, ns, strip); - not_added= 0; - break; - } - } - if (not_added) { - /* just add to the end of the list of the strips then... */ - BLI_addtail(&nlt->strips, strip); - } - - /* added... */ - return 1; + /* try to add the strip to the track using a more generic function */ + return BKE_nlastrips_add_strip(&nlt->strips, strip); } /* NLA Strips -------------------------------------- */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index beebf58b6c0..956c8e0042e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1826,18 +1826,48 @@ static void direct_link_action(FileData *fd, bAction *act) } } +static void lib_link_nladata_strips(FileData *fd, ID *id, ListBase *list) +{ + NlaStrip *strip; + + for (strip= list->first; strip; strip= strip->next) { + /* check strip's children */ + lib_link_nladata_strips(fd, id, &strip->strips); + + /* reassign the counted-reference to action */ + strip->act = newlibadr_us(fd, id->lib, strip->act); + } +} -static void lib_link_nladata (FileData *fd, ID *id, ListBase *list) +static void lib_link_nladata(FileData *fd, ID *id, ListBase *list) { NlaTrack *nlt; - NlaStrip *strip; - /* we only acare about the NLA strips inside the tracks */ + /* we only care about the NLA strips inside the tracks */ for (nlt= list->first; nlt; nlt= nlt->next) { - for (strip= nlt->strips.first; strip; strip= strip->next) { - /* reassign the counted-reference to action */ - strip->act = newlibadr_us(fd, id->lib, strip->act); - } + lib_link_nladata_strips(fd, id, &nlt->strips); + } +} + +/* This handles Animato NLA-Strips linking + * NOTE: this assumes that link_list has already been called on the list + */ +static void direct_link_nladata_strips(FileData *fd, ListBase *list) +{ + NlaStrip *strip; + + for (strip= list->first; strip; strip= strip->next) { + /* strip's child strips */ + link_list(fd, &strip->strips); + direct_link_nladata_strips(fd, &strip->strips); + + /* strip's F-Curves */ + link_list(fd, &strip->fcurves); + direct_link_fcurves(fd, &strip->fcurves); + + /* strip's F-Modifiers */ + link_list(fd, &strip->modifiers); + direct_link_fcurves(fd, &strip->modifiers); } } @@ -1845,22 +1875,13 @@ static void lib_link_nladata (FileData *fd, ID *id, ListBase *list) static void direct_link_nladata(FileData *fd, ListBase *list) { NlaTrack *nlt; - NlaStrip *strip; for (nlt= list->first; nlt; nlt= nlt->next) { /* relink list of strips */ link_list(fd, &nlt->strips); /* relink strip data */ - for (strip= nlt->strips.first; strip; strip= strip->next) { - /* strip's F-Curves */ - link_list(fd, &strip->fcurves); - direct_link_fcurves(fd, &strip->fcurves); - - /* strip's F-Modifiers */ - link_list(fd, &strip->modifiers); - direct_link_fcurves(fd, &strip->modifiers); - } + direct_link_nladata_strips(fd, &nlt->strips); } } @@ -9560,11 +9581,23 @@ static void expand_keyingsets(FileData *fd, Main *mainvar, ListBase *list) } } +static void expand_animdata_nlastrips(FileData *fd, Main *mainvar, ListBase *list) +{ + NlaStrip *strip; + + for (strip= list->first; strip; strip= strip->next) { + /* check child strips */ + expand_animdata_nlastrips(fd, mainvar, &strip->strips); + + /* relink referenced action */ + expand_doit(fd, mainvar, strip->act); + } +} + static void expand_animdata(FileData *fd, Main *mainvar, AnimData *adt) { FCurve *fcd; NlaTrack *nlt; - NlaStrip *strip; /* own action */ expand_doit(fd, mainvar, adt->action); @@ -9580,10 +9613,8 @@ static void expand_animdata(FileData *fd, Main *mainvar, AnimData *adt) } /* nla-data - referenced actions */ - for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { - for (strip= nlt->strips.first; strip; strip= strip->next) - expand_doit(fd, mainvar, strip->act); - } + for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) + expand_animdata_nlastrips(fd, mainvar, &nlt->strips); } static void expand_particlesettings(FileData *fd, Main *mainvar, ParticleSettings *part) diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 80d1d78257b..bfdd89e38b1 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -916,26 +916,34 @@ static void write_keyingsets(WriteData *wd, ListBase *list) } } +static void write_nlastrips(WriteData *wd, ListBase *strips) +{ + NlaStrip *strip; + + for (strip= strips->first; strip; strip= strip->next) { + /* write the strip first */ + writestruct(wd, DATA, "NlaStrip", 1, strip); + + /* write the strip's F-Curves and modifiers */ + write_fcurves(wd, &strip->fcurves); + write_fmodifiers(wd, &strip->modifiers); + + /* write the strip's children */ + write_nlastrips(wd, &strip->strips); + } +} + static void write_nladata(WriteData *wd, ListBase *nlabase) { NlaTrack *nlt; - NlaStrip *strip; /* write all the tracks */ for (nlt= nlabase->first; nlt; nlt= nlt->next) { /* write the track first */ writestruct(wd, DATA, "NlaTrack", 1, nlt); - for (strip= nlt->strips.first; strip; strip= strip->next) { - /* write the strip first */ - writestruct(wd, DATA, "NlaStrip", 1, strip); - - /* write the strip's F-Curves and modifiers */ - write_fcurves(wd, &strip->fcurves); - write_fmodifiers(wd, &strip->modifiers); - - // TODO write the remaps - } + /* write the track's strips */ + write_nlastrips(wd, &nlt->strips); } } diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 10b25beddff..e95d0b1a50a 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -734,8 +734,6 @@ static int nlaedit_move_up_exec (bContext *C, wmOperator *op) bAnimListElem *ale; int filter; - BeztEditData bed; - /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; @@ -744,9 +742,6 @@ static int nlaedit_move_up_exec (bContext *C, wmOperator *op) filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - /* init the editing data */ - memset(&bed, 0, sizeof(BeztEditData)); - /* since we're potentially moving strips from lower tracks to higher tracks, we should * loop over the tracks in reverse order to avoid moving earlier strips up multiple tracks */ @@ -811,8 +806,6 @@ static int nlaedit_move_down_exec (bContext *C, wmOperator *op) bAnimListElem *ale; int filter; - BeztEditData bed; - /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; @@ -821,9 +814,6 @@ static int nlaedit_move_down_exec (bContext *C, wmOperator *op) filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - /* init the editing data */ - memset(&bed, 0, sizeof(BeztEditData)); - /* loop through the tracks in normal order, since we're pushing strips down, * strips won't get operated on twice */ @@ -1037,6 +1027,116 @@ void NLA_OT_clear_scale (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/* ******************** Snap Strips Operator ************************** */ +/* Moves the start-point of the selected strips to the specified places */ + +/* defines for snap keyframes tool */ +EnumPropertyItem prop_nlaedit_snap_types[] = { + {NLAEDIT_SNAP_CFRA, "CFRA", 0, "Current frame", ""}, + {NLAEDIT_SNAP_NEAREST_FRAME, "NEAREST_FRAME", 0, "Nearest Frame", ""}, // XXX as single entry? + {NLAEDIT_SNAP_NEAREST_SECOND, "NEAREST_SECOND", 0, "Nearest Second", ""}, // XXX as single entry? + {NLAEDIT_SNAP_NEAREST_MARKER, "NEAREST_MARKER", 0, "Nearest Marker", ""}, + {0, NULL, 0, NULL, NULL} +}; + +static int nlaedit_snap_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + Scene *scene= ac.scene; + int mode = RNA_enum_get(op->ptr, "type"); + const float secf = (float)FPS; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the editable tracks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* since we may add tracks, perform this in reverse order */ + for (ale= anim_data.last; ale; ale= ale->prev) { + ListBase tmp_strips = {NULL, NULL}; + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip, *stripn; + + /* first pass: move all selected strips to a separate buffer, and apply snapping to them */ + for (strip= nlt->strips.first; strip; strip= stripn) { + stripn= strip->next; + + if (strip->flag & NLASTRIP_FLAG_SELECT) { + float start, end; + + /* get the existing end-points */ + start= strip->start; + end= strip->end; + + /* calculate new start position based on snapping mode */ + switch (mode) { + case NLAEDIT_SNAP_CFRA: /* to current frame */ + strip->start= (float)CFRA; + break; + case NLAEDIT_SNAP_NEAREST_FRAME: /* to nearest frame */ + strip->start= (float)(floor(start+0.5)); + break; + case NLAEDIT_SNAP_NEAREST_SECOND: /* to nearest second */ + strip->start= ((float)floor(start/secf + 0.5f) * secf); + break; + case NLAEDIT_SNAP_NEAREST_MARKER: /* to nearest marker */ + strip->start= (float)ED_markers_find_nearest_marker_time(ac.markers, start); + break; + default: /* just in case... no snapping */ + strip->start= start; + break; + } + + /* get new endpoint based on start-point (and old length) */ + strip->end= strip->start + (end - start); + + /* remove strip from track, and add to the temp buffer */ + BLI_remlink(&nlt->strips, strip); + BLI_addtail(&tmp_strips, strip); + } + } + + // TODO: finish this... + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done */ + return OPERATOR_FINISHED; +} + +void NLA_OT_snap (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Snap Strips"; + ot->idname= "NLA_OT_snap"; + ot->description= "Move start of strips to specified time."; + + /* api callbacks */ + ot->invoke= WM_menu_invoke; + ot->exec= nlaedit_snap_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_enum(ot->srna, "type", prop_nlaedit_snap_types, 0, "Type", ""); +} + /* *********************************************** */ /* NLA Modifiers */ diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 5921b8a75ce..422686bb424 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -87,6 +87,17 @@ void NLA_OT_click_select(wmOperatorType *ot); /* **************************************** */ /* nla_edit.c */ +/* defines for snap strips + */ +enum { + NLAEDIT_SNAP_CFRA = 1, + NLAEDIT_SNAP_NEAREST_FRAME, + NLAEDIT_SNAP_NEAREST_SECOND, + NLAEDIT_SNAP_NEAREST_MARKER, +} eNlaEdit_Snap_Mode; + +/* --- */ + void NLA_OT_tweakmode_enter(wmOperatorType *ot); void NLA_OT_tweakmode_exit(wmOperatorType *ot); diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index a90fad983c4..a8220099a11 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -438,11 +438,13 @@ typedef struct AnimMapper { typedef struct NlaStrip { struct NlaStrip *next, *prev; + ListBase strips; /* 'Child' strips (used for 'meta' strips) */ bAction *act; /* Action that is referenced by this strip (strip is 'user' of the action) */ AnimMapper *remap; /* Remapping info this strip (for tweaking correspondance of action with context) */ ListBase fcurves; /* F-Curves for controlling this strip's influence and timing */ // TODO: move out? ListBase modifiers; /* F-Curve modifiers to be applied to the entire strip's referenced F-Curves */ + float influence; /* Influence of strip */ float strip_time; /* Current 'time' within action being used (automatically evaluated, but can be overridden) */ @@ -505,6 +507,11 @@ enum { NLASTRIP_FLAG_MUTED = (1<<12), /* NLA strip length is synced to the length of the referenced action */ NLASTRIP_FLAG_SYNC_LENGTH = (1<<13), + + /* temporary editing flags */ + /* NLA-Strip is really just a temporary meta used to facilitate easier transform code */ + NLASTRIP_FLAG_TEMP_META = (1<<30), + NLASTRIP_FLAG_EDIT_TOUCHED = (1<<31), } eNlaStrip_Flag; /* NLA Strip Type */ @@ -513,6 +520,8 @@ enum { NLASTRIP_TYPE_CLIP = 0, /* 'transition' - blends between the adjacent strips */ NLASTRIP_TYPE_TRANSITION, + /* 'meta' - a strip which acts as a container for a few others */ + NLASTRIP_TYPE_META, } eNlaStrip_Type; /* NLA Tracks ------------------------------------- */ -- cgit v1.2.3 From 158657026122d3b169f1bea12a69ff8eb16bbe04 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 6 Jul 2009 11:06:34 +0000 Subject: NLA SoC: More work on Meta-Strips * Added several API functions for Meta-Strips editing. One of these (flush transform) still needs a few tweaks before it does its job well enough for all cases. * Meta strips are now drawn with a purple-ish colour. The start/end points of the strips they encompass are shown with lines along the length of the strips, with lines starting from the top indicating start-points and lines starting from the bottom indicating end-points. * Meta strips can be made (i.e. strips can be assigned to meta-strips) by selecting some strips and pressing Shift-G. Meta strips can be removed by selecting some meta-strips and pressing Alt-G. * Strips can now be 'snapped' to start from: the current frame, the nearest frame, the nearest second, or the nearest marker; using the Shift-S hotkey. 'Islands' of adjacent selected strips occurring in the same track are moved together as a single strip so that the start-point of the first strip is on the sepcified time, but all the relative lengths of strips stay the same. Internally, temporary meta-strips are created to facilitate this. --- source/blender/blenkernel/BKE_nla.h | 6 + source/blender/blenkernel/intern/nla.c | 193 ++++++++++++++++++++++++++ source/blender/editors/space_nla/nla_draw.c | 39 +++++- source/blender/editors/space_nla/nla_edit.c | 148 +++++++++++++++++++- source/blender/editors/space_nla/nla_header.c | 16 +++ source/blender/editors/space_nla/nla_intern.h | 5 + source/blender/editors/space_nla/nla_ops.c | 12 ++ source/blender/makesdna/DNA_anim_types.h | 4 +- source/blender/makesrna/intern/rna_nla.c | 1 + 9 files changed, 415 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index efa0591bd53..3fcd799310e 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -58,6 +58,12 @@ void BKE_nlastrips_sort_strips(ListBase *strips); short BKE_nlastrips_add_strip(ListBase *strips, struct NlaStrip *strip); + +void BKE_nlastrips_make_metas(ListBase *strips, short temp); +void BKE_nlastrips_clear_metas(ListBase *strips, short onlySel, short onlyTemp); +short BKE_nlameta_add_strip(struct NlaStrip *mstrip, struct NlaStrip *strip); +void BKE_nlameta_flush_transforms(struct NlaStrip *mstrip); + /* ............ */ struct NlaTrack *BKE_nlatrack_find_active(ListBase *tracks); diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index d01fa2c1965..715f99c820f 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -616,6 +616,199 @@ short BKE_nlastrips_add_strip (ListBase *strips, NlaStrip *strip) return 1; } + +/* Meta-Strips ------------------------------------ */ + +/* Convert 'islands' (i.e. continuous string of) selected strips to be + * contained within 'Meta-Strips' which act as strips which contain strips. + * temp: are the meta-strips to be created 'temporary' ones used for transforms? + */ +void BKE_nlastrips_make_metas (ListBase *strips, short temp) +{ + NlaStrip *mstrip = NULL; + NlaStrip *strip, *stripn; + + /* sanity checks */ + if ELEM(NULL, strips, strips->first) + return; + + /* group all continuous chains of selected strips into meta-strips */ + for (strip= strips->first; strip; strip= stripn) { + stripn= strip->next; + + if (strip->flag & NLASTRIP_FLAG_SELECT) { + /* if there is an existing meta-strip, add this strip to it, otherwise, create a new one */ + if (mstrip == NULL) { + /* add a new meta-strip, and add it before the current strip that it will replace... */ + mstrip= MEM_callocN(sizeof(NlaStrip), "Meta-NlaStrip"); + mstrip->type = NLASTRIP_TYPE_META; + BLI_insertlinkbefore(strips, strip, mstrip); + + /* set flags */ + mstrip->flag = NLASTRIP_FLAG_SELECT; + + /* set temp flag if appropriate (i.e. for transform-type editing) */ + if (temp) + mstrip->flag |= NLASTRIP_FLAG_TEMP_META; + + /* make its start frame be set to the start frame of the current strip */ + mstrip->start= strip->start; + } + + /* remove the selected strips from the track, and add to the meta */ + BLI_remlink(strips, strip); + BLI_addtail(&mstrip->strips, strip); + + /* expand the meta's dimensions to include the newly added strip- i.e. its last frame */ + mstrip->end= strip->end; + } + else { + /* current strip wasn't selected, so the end of 'island' of selected strips has been reached, + * so stop adding strips to the current meta + */ + mstrip= NULL; + } + } +} + +/* Remove meta-strips (i.e. flatten the list of strips) from the top-level of the list of strips + * sel: only consider selected meta-strips, otherwise all meta-strips are removed + * onlyTemp: only remove the 'temporary' meta-strips used for transforms + */ +void BKE_nlastrips_clear_metas (ListBase *strips, short onlySel, short onlyTemp) +{ + NlaStrip *strip, *stripn; + + /* sanity checks */ + if ELEM(NULL, strips, strips->first) + return; + + /* remove meta-strips fitting the criteria of the arguments */ + for (strip= strips->first; strip; strip= stripn) { + stripn= strip->next; + + /* check if strip is a meta-strip */ + if (strip->type == NLASTRIP_TYPE_META) { + /* if check if selection and 'temporary-only' considerations are met */ + if ((onlySel==0) || (strip->flag & NLASTRIP_FLAG_SELECT)) { + if ((!onlyTemp) || (strip->flag & NLASTRIP_FLAG_TEMP_META)) { + NlaStrip *cs, *csn; + + /* move each one of the meta-strip's children before the meta-strip + * in the list of strips after unlinking them from the meta-strip + */ + for (cs= strip->strips.first; cs; cs= csn) { + csn= cs->next; + BLI_remlink(&strip->strips, cs); + BLI_insertlinkbefore(strips, strip, cs); + } + + /* free the meta-strip now */ + BLI_freelinkN(strips, strip); + } + } + } + } +} + +/* Add the given NLA-Strip to the given Meta-Strip, assuming that the + * strip isn't attached to anyy list of strips + */ +short BKE_nlameta_add_strip (NlaStrip *mstrip, NlaStrip *strip) +{ + /* sanity checks */ + if ELEM(NULL, mstrip, strip) + return 0; + + /* firstly, check if the meta-strip has space for this */ + if (BKE_nlastrips_has_space(&mstrip->strips, strip->start, strip->end) == 0) + return 0; + + /* check if this would need to be added to the ends of the meta, + * and subsequently, if the neighbouring strips allow us enough room + */ + if (strip->start < mstrip->start) { + /* check if strip to the left (if it exists) ends before the + * start of the strip we're trying to add + */ + if ((mstrip->prev == NULL) || (mstrip->prev->end <= strip->start)) { + /* add strip to start of meta's list, and expand dimensions */ + BLI_addhead(&mstrip->strips, strip); + mstrip->start= strip->start; + + return 1; + } + else /* failed... no room before */ + return 0; + } + else if (strip->end > mstrip->end) { + /* check if strip to the right (if it exists) starts before the + * end of the strip we're trying to add + */ + if ((mstrip->next == NULL) || (mstrip->next->start >= strip->end)) { + /* add strip to end of meta's list, and expand dimensions */ + BLI_addtail(&mstrip->strips, strip); + mstrip->end= strip->end; + + return 1; + } + else /* failed... no room after */ + return 0; + } + else { + /* just try to add to the meta-strip (no dimension changes needed) */ + return BKE_nlastrips_add_strip(&mstrip->strips, strip); + } +} + +/* Adjust the settings of NLA-Strips contained within a Meta-Strip (recursively), + * until the Meta-Strips children all fit within the Meta-Strip's new dimensions + */ +void BKE_nlameta_flush_transforms (NlaStrip *mstrip) +{ + NlaStrip *strip; + float oStart, oEnd, offset; + + /* sanity checks + * - strip must exist + * - strip must be a meta-strip with some contents + */ + if ELEM(NULL, mstrip, mstrip->strips.first) + return; + if (mstrip->type != NLASTRIP_TYPE_META) + return; + + /* get the original start/end points, and calculate the start-frame offset + * - these are simply the start/end frames of the child strips, + * since we assume they weren't transformed yet + */ + oStart= ((NlaStrip *)mstrip->strips.first)->start; + oEnd= ((NlaStrip *)mstrip->strips.last)->end; + offset= mstrip->start - oStart; + + /* optimisation: + * don't flush if nothing changed yet + * TODO: maybe we need a flag to say always flush? + */ + if (IS_EQ(oStart, mstrip->start) && IS_EQ(oEnd, mstrip->end)) + return; + + /* for each child-strip, calculate new start/end points based on this new info */ + for (strip= mstrip->strips.first; strip; strip= strip->next) { + //PointerRNA strip_ptr; + + /* firstly, just apply the changes in offset to both ends of the strip */ + strip->start += offset; + strip->end += offset; + + /* now, we need to fix the endpoint to take into account scaling */ + // TODO.. + + /* finally, make sure the strip's children (if it is a meta-itself), get updated */ + BKE_nlameta_flush_transforms(strip); + } +} + /* NLA-Tracks ---------------------------------------- */ /* Find the active NLA-track for the given stack */ diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index ab33434077e..e31aebf0155 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -176,6 +176,23 @@ static void nla_strip_get_color_inside (AnimData *adt, NlaStrip *strip, float co color[2]= 0.19f; } } + else if (strip->type == NLASTRIP_TYPE_META) { + /* Meta Clip */ + if (strip->flag & NLASTRIP_FLAG_SELECT) { + /* selected - use a bold purple color */ + // FIXME: hardcoded temp-hack colors + color[0]= 0.41f; + color[1]= 0.13f; + color[2]= 0.59f; + } + else { + /* normal, unselected strip - use (hardly noticable) dark purple tinge */ + // FIXME: hardcoded temp-hack colors + color[0]= 0.20f; + color[1]= 0.15f; + color[2]= 0.26f; + } + } else { /* Action Clip (default/normal type of strip) */ if ((strip->flag & NLASTRIP_FLAG_ACTIVE) && (adt && (adt->flag & ADT_NLA_EDIT_ON))) { @@ -293,7 +310,7 @@ static void nla_draw_strip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2 /* draw outline */ gl_round_box_shade(GL_LINE_LOOP, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1); - /* if action-clip strip, draw lines delimiting repeats too (in the same colour */ + /* if action-clip strip, draw lines delimiting repeats too (in the same color as outline) */ if ((strip->type == NLASTRIP_TYPE_CLIP) && IS_EQ(strip->repeat, 1.0f)==0) { float repeatLen = (strip->actend - strip->actstart) * strip->scale; int i; @@ -309,6 +326,26 @@ static void nla_draw_strip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2 fdrawline(repeatPos, yminc, repeatPos, ymaxc); } } + /* or if meta-strip, draw lines delimiting extents of sub-strips (in same color as outline, if more than 1 exists) */ + else if ((strip->type == NLASTRIP_TYPE_META) && (strip->strips.first != strip->strips.last)) { + NlaStrip *cs; + float y= (ymaxc-yminc)/2.0f + yminc; + + /* only draw first-level of child-strips, but don't draw any lines on the endpoints */ + for (cs= strip->strips.first; cs; cs= cs->next) { + /* draw start-line if not same as end of previous (and only if not the first strip) + * - on upper half of strip + */ + if ((cs->prev) && IS_EQ(cs->prev->end, cs->start)==0) + fdrawline(cs->start, y, cs->start, ymaxc); + + /* draw end-line if not the last strip + * - on lower half of strip + */ + if (cs->next) + fdrawline(cs->end, yminc, cs->end, y); + } + } /* reset linestyle */ setlinestyle(0); diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index e95d0b1a50a..f7d4db17e2c 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -346,7 +346,6 @@ void NLA_OT_add_actionclip (wmOperatorType *ot) /* ******************** Add Transition Operator ***************************** */ /* Add a new transition strip between selected strips */ -/* add the specified action as new strip */ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op) { bAnimContext ac; @@ -453,6 +452,113 @@ void NLA_OT_add_transition (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/* ******************** Add Meta-Strip Operator ***************************** */ +/* Add new meta-strips incorporating the selected strips */ + +/* add the specified action as new strip */ +static int nlaedit_add_meta_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the editable tracks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* for each track, find pairs of strips to add transitions to */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + + /* create meta-strips from the continuous chains of selected strips */ + BKE_nlastrips_make_metas(&nlt->strips, 0); + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done */ + return OPERATOR_FINISHED; +} + +void NLA_OT_add_meta (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Meta-Strips"; + ot->idname= "NLA_OT_add_meta"; + ot->description= "Add new meta-strips incorporating the selected strips."; + + /* api callbacks */ + ot->exec= nlaedit_add_meta_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/* ******************** Remove Meta-Strip Operator ***************************** */ +/* Separate out the strips held by the selected meta-strips */ + +static int nlaedit_remove_meta_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the editable tracks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* for each track, find pairs of strips to add transitions to */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + + /* clear all selected meta-strips, regardless of whether they are temporary or not */ + BKE_nlastrips_clear_metas(&nlt->strips, 1, 0); + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done */ + return OPERATOR_FINISHED; +} + +void NLA_OT_remove_meta (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Meta-Strips"; + ot->idname= "NLA_OT_remove_meta"; + ot->description= "Separate out the strips held by the selected meta-strips."; + + /* api callbacks */ + ot->exec= nlaedit_remove_meta_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /* ******************** Duplicate Strips Operator ************************** */ /* Duplicates the selected NLA-Strips, putting them on new tracks above the one * the originals were housed in. @@ -1047,9 +1153,9 @@ static int nlaedit_snap_exec (bContext *C, wmOperator *op) bAnimListElem *ale; int filter; - Scene *scene= ac.scene; + Scene *scene; int mode = RNA_enum_get(op->ptr, "type"); - const float secf = (float)FPS; + float secf; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) @@ -1059,17 +1165,28 @@ static int nlaedit_snap_exec (bContext *C, wmOperator *op) filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + /* get some necessary vars */ + scene= ac.scene; + secf= (float)FPS; + /* since we may add tracks, perform this in reverse order */ for (ale= anim_data.last; ale; ale= ale->prev) { ListBase tmp_strips = {NULL, NULL}; + AnimData *adt= BKE_animdata_from_id(ale->id); NlaTrack *nlt= (NlaTrack *)ale->data; NlaStrip *strip, *stripn; + NlaTrack *track; - /* first pass: move all selected strips to a separate buffer, and apply snapping to them */ + /* create meta-strips from the continuous chains of selected strips */ + BKE_nlastrips_make_metas(&nlt->strips, 1); + + /* apply the snapping to all the temp meta-strips, then put them in a separate list to be added + * back to the original only if they still fit + */ for (strip= nlt->strips.first; strip; strip= stripn) { stripn= strip->next; - if (strip->flag & NLASTRIP_FLAG_SELECT) { + if (strip->flag & NLASTRIP_FLAG_TEMP_META) { float start, end; /* get the existing end-points */ @@ -1098,13 +1215,32 @@ static int nlaedit_snap_exec (bContext *C, wmOperator *op) /* get new endpoint based on start-point (and old length) */ strip->end= strip->start + (end - start); + /* apply transforms to meta-strip to its children */ + BKE_nlameta_flush_transforms(strip); + /* remove strip from track, and add to the temp buffer */ BLI_remlink(&nlt->strips, strip); BLI_addtail(&tmp_strips, strip); } } - // TODO: finish this... + /* try adding each meta-strip back to the track one at a time, to make sure they'll fit */ + for (strip= tmp_strips.first; strip; strip= stripn) { + stripn= strip->next; + + /* remove from temp-strips list */ + BLI_remlink(&tmp_strips, strip); + + /* in case there's no space in the current track, try adding */ + if (BKE_nlatrack_add_strip(nlt, strip) == 0) { + /* need to add a new track above the current one */ + track= add_nlatrack(adt, nlt); + BKE_nlatrack_add_strip(track, strip); + } + } + + /* remove the meta-strips now that we're done */ + BKE_nlastrips_clear_metas(&nlt->strips, 0, 1); } /* free temp data */ diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index fc6db76ba65..9b9b21629cc 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -70,6 +70,8 @@ #include "ED_markers.h" +#include "nla_intern.h" + /* button events */ enum { B_REDR = 0, @@ -142,9 +144,18 @@ static void nla_edit_transformmenu(bContext *C, uiLayout *layout, void *arg_unus uiItemEnumO(layout, "Scale", 0, "TFM_OT_transform", "mode", TFM_TIME_SCALE); } +static void nla_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused) +{ + uiItemEnumO(layout, NULL, 0, "NLA_OT_snap", "type", NLAEDIT_SNAP_CFRA); + uiItemEnumO(layout, NULL, 0, "NLA_OT_snap", "type", NLAEDIT_SNAP_NEAREST_FRAME); + uiItemEnumO(layout, NULL, 0, "NLA_OT_snap", "type", NLAEDIT_SNAP_NEAREST_SECOND); + uiItemEnumO(layout, NULL, 0, "NLA_OT_snap", "type", NLAEDIT_SNAP_NEAREST_MARKER); +} + static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused) { uiItemMenuF(layout, "Transform", 0, nla_edit_transformmenu); + uiItemMenuF(layout, "Snap", 0, nla_edit_snapmenu); uiItemS(layout); @@ -173,6 +184,11 @@ static void nla_addmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); + uiItemO(layout, NULL, 0, "NLA_OT_add_meta"); + uiItemO(layout, NULL, 0, "NLA_OT_remove_meta"); + + uiItemS(layout); + uiItemO(layout, NULL, 0, "NLA_OT_add_tracks"); uiItemBooleanO(layout, "Add Tracks Above Selected", 0, "NLA_OT_add_tracks", "above_selected", 1); } diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 422686bb424..4391a019207 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -106,6 +106,9 @@ void NLA_OT_tweakmode_exit(wmOperatorType *ot); void NLA_OT_add_actionclip(wmOperatorType *ot); void NLA_OT_add_transition(wmOperatorType *ot); +void NLA_OT_add_meta(wmOperatorType *ot); +void NLA_OT_remove_meta(wmOperatorType *ot); + void NLA_OT_duplicate(wmOperatorType *ot); void NLA_OT_delete(wmOperatorType *ot); void NLA_OT_split(wmOperatorType *ot); @@ -116,6 +119,8 @@ void NLA_OT_move_down(wmOperatorType *ot); void NLA_OT_apply_scale(wmOperatorType *ot); void NLA_OT_clear_scale(wmOperatorType *ot); +void NLA_OT_snap(wmOperatorType *ot); + void NLA_OT_fmodifier_add(wmOperatorType *ot); diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 7caab02d6a0..25fd8db668c 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -146,6 +146,9 @@ void nla_operatortypes(void) WM_operatortype_append(NLA_OT_add_actionclip); WM_operatortype_append(NLA_OT_add_transition); + WM_operatortype_append(NLA_OT_add_meta); + WM_operatortype_append(NLA_OT_remove_meta); + WM_operatortype_append(NLA_OT_duplicate); WM_operatortype_append(NLA_OT_delete); WM_operatortype_append(NLA_OT_split); @@ -156,6 +159,8 @@ void nla_operatortypes(void) WM_operatortype_append(NLA_OT_apply_scale); WM_operatortype_append(NLA_OT_clear_scale); + WM_operatortype_append(NLA_OT_snap); + WM_operatortype_append(NLA_OT_fmodifier_add); } @@ -236,6 +241,10 @@ static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) /* add strips */ WM_keymap_add_item(keymap, "NLA_OT_add_actionclip", AKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "NLA_OT_add_transition", TKEY, KM_PRESS, KM_SHIFT, 0); + + /* meta-strips */ + WM_keymap_add_item(keymap, "NLA_OT_add_meta", GKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "NLA_OT_remove_meta", GKEY, KM_PRESS, KM_ALT, 0); /* duplicate */ WM_keymap_add_item(keymap, "NLA_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); @@ -257,6 +266,9 @@ static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) /* clear scale */ WM_keymap_add_item(keymap, "NLA_OT_clear_scale", SKEY, KM_PRESS, KM_ALT, 0); + /* snap */ + WM_keymap_add_item(keymap, "NLA_OT_snap", SKEY, KM_PRESS, KM_SHIFT, 0); + /* add f-modifier */ WM_keymap_add_item(keymap, "NLA_OT_fmodifier_add", MKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index a8220099a11..cb9dc8f0bc7 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -510,8 +510,8 @@ enum { /* temporary editing flags */ /* NLA-Strip is really just a temporary meta used to facilitate easier transform code */ - NLASTRIP_FLAG_TEMP_META = (1<<30), - NLASTRIP_FLAG_EDIT_TOUCHED = (1<<31), + NLASTRIP_FLAG_TEMP_META = (1<<14), + NLASTRIP_FLAG_EDIT_TOUCHED = (1<<15), } eNlaStrip_Flag; /* NLA Strip Type */ diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index dfa496fd8f3..28a422dd601 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -207,6 +207,7 @@ void rna_def_nlastrip(BlenderRNA *brna) static EnumPropertyItem prop_type_items[] = { {NLASTRIP_TYPE_CLIP, "CLIP", 0, "Action Clip", "NLA Strip references some Action."}, {NLASTRIP_TYPE_TRANSITION, "TRANSITION", 0, "Transition", "NLA Strip 'transitions' between adjacent strips."}, + {NLASTRIP_TYPE_META, "META", 0, "Strip Container", "NLA Strip acts as a container for adjacent strips."}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_mode_blend_items[] = { {NLASTRIP_MODE_BLEND, "BLEND", 0, "Blend", "Results of strip and accumulated results are combined in ratio governed by influence."}, -- cgit v1.2.3 From f98c3ed70b86d12945078c288c2bd3288a297841 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 6 Jul 2009 12:24:09 +0000 Subject: NLA SoC: Fixes for Meta-Strips and Editing * Split strip (YKEY) now plays nicely with Transitions and Metas. Meta strips get split up into their child strips, while transitions are ignored. * Wrapped Meta_Strip->strips in RNA * Bugfixes in Meta-strip API functions to silence some runtime-errors... --- source/blender/blenkernel/BKE_nla.h | 1 + source/blender/blenkernel/intern/nla.c | 39 ++++++++---- source/blender/editors/space_nla/nla_edit.c | 96 +++++++++++++++++++---------- source/blender/makesrna/intern/rna_nla.c | 7 ++- 4 files changed, 95 insertions(+), 48 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 3fcd799310e..5cb967c9c59 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -61,6 +61,7 @@ short BKE_nlastrips_add_strip(ListBase *strips, struct NlaStrip *strip); void BKE_nlastrips_make_metas(ListBase *strips, short temp); void BKE_nlastrips_clear_metas(ListBase *strips, short onlySel, short onlyTemp); +void BKE_nlastrips_clear_metastrip(ListBase *strips, struct NlaStrip *strip); short BKE_nlameta_add_strip(struct NlaStrip *mstrip, struct NlaStrip *strip); void BKE_nlameta_flush_transforms(struct NlaStrip *mstrip); diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 715f99c820f..a83fa0abe1e 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -650,6 +650,9 @@ void BKE_nlastrips_make_metas (ListBase *strips, short temp) /* set temp flag if appropriate (i.e. for transform-type editing) */ if (temp) mstrip->flag |= NLASTRIP_FLAG_TEMP_META; + + /* set default repeat/scale values to prevent warnings */ + mstrip->repeat= mstrip->scale= 1.0f; /* make its start frame be set to the start frame of the current strip */ mstrip->start= strip->start; @@ -671,6 +674,28 @@ void BKE_nlastrips_make_metas (ListBase *strips, short temp) } } +/* Split a meta-strip into a set of normal strips */ +void BKE_nlastrips_clear_metastrip (ListBase *strips, NlaStrip *strip) +{ + NlaStrip *cs, *csn; + + /* sanity check */ + if ELEM(NULL, strips, strip) + return; + + /* move each one of the meta-strip's children before the meta-strip + * in the list of strips after unlinking them from the meta-strip + */ + for (cs= strip->strips.first; cs; cs= csn) { + csn= cs->next; + BLI_remlink(&strip->strips, cs); + BLI_insertlinkbefore(strips, strip, cs); + } + + /* free the meta-strip now */ + BLI_freelinkN(strips, strip); +} + /* Remove meta-strips (i.e. flatten the list of strips) from the top-level of the list of strips * sel: only consider selected meta-strips, otherwise all meta-strips are removed * onlyTemp: only remove the 'temporary' meta-strips used for transforms @@ -692,19 +717,7 @@ void BKE_nlastrips_clear_metas (ListBase *strips, short onlySel, short onlyTemp) /* if check if selection and 'temporary-only' considerations are met */ if ((onlySel==0) || (strip->flag & NLASTRIP_FLAG_SELECT)) { if ((!onlyTemp) || (strip->flag & NLASTRIP_FLAG_TEMP_META)) { - NlaStrip *cs, *csn; - - /* move each one of the meta-strip's children before the meta-strip - * in the list of strips after unlinking them from the meta-strip - */ - for (cs= strip->strips.first; cs; cs= csn) { - csn= cs->next; - BLI_remlink(&strip->strips, cs); - BLI_insertlinkbefore(strips, strip, cs); - } - - /* free the meta-strip now */ - BLI_freelinkN(strips, strip); + BKE_nlastrips_clear_metastrip(strips, strip); } } } diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index f7d4db17e2c..676d0aac1b1 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -736,6 +736,55 @@ void NLA_OT_delete (wmOperatorType *ot) // - multiple splits // - variable-length splits? +/* split a given Action-Clip strip */ +static void nlaedit_split_strip_actclip (NlaTrack *nlt, NlaStrip *strip) +{ + NlaStrip *nstrip; + float midframe, midaframe, len; + + /* calculate the frames to do the splitting at */ + /* strip extents */ + len= strip->end - strip->start; + if (IS_EQ(len, 0.0f)) + return; + else + midframe= strip->start + (len / 2.0f); + + /* action range */ + len= strip->actend - strip->actstart; + if (IS_EQ(len, 0.0f)) + midaframe= strip->actend; + else + midaframe= strip->actstart + (len / 2.0f); + + /* make a copy (assume that this is possible) and append + * it immediately after the current strip + */ + nstrip= copy_nlastrip(strip); + BLI_insertlinkafter(&nlt->strips, strip, nstrip); + + /* set the endpoint of the first strip and the start of the new strip + * to the midframe values calculated above + */ + strip->end= midframe; + nstrip->start= midframe; + + strip->actend= midaframe; + nstrip->actstart= midaframe; + + /* clear the active flag from the copy */ + nstrip->flag &= ~NLASTRIP_FLAG_ACTIVE; +} + +/* split a given Meta strip */ +static void nlaedit_split_strip_meta (NlaTrack *nlt, NlaStrip *strip) +{ + /* simply ungroup it for now... */ + BKE_nlastrips_clear_metastrip(&nlt->strips, strip); +} + +/* ----- */ + static int nlaedit_split_exec (bContext *C, wmOperator *op) { bAnimContext ac; @@ -755,47 +804,26 @@ static int nlaedit_split_exec (bContext *C, wmOperator *op) /* for each NLA-Track, split all selected strips into two strips */ for (ale= anim_data.first; ale; ale= ale->next) { NlaTrack *nlt= (NlaTrack *)ale->data; - NlaStrip *strip, *nstrip, *next; + NlaStrip *strip, *next; for (strip= nlt->strips.first; strip; strip= next) { next= strip->next; /* if selected, split the strip at its midpoint */ if (strip->flag & NLASTRIP_FLAG_SELECT) { - float midframe, midaframe, len; - - /* calculate the frames to do the splitting at */ - /* strip extents */ - len= strip->end - strip->start; - if (IS_EQ(len, 0.0f)) - continue; - else - midframe= strip->start + (len / 2.0f); + /* splitting method depends on the type of strip */ + switch (strip->type) { + case NLASTRIP_TYPE_CLIP: /* action-clip */ + nlaedit_split_strip_actclip(nlt, strip); + break; + + case NLASTRIP_TYPE_META: /* meta-strips need special handling */ + nlaedit_split_strip_meta(nlt, strip); + break; - /* action range */ - len= strip->actend - strip->actstart; - if (IS_EQ(len, 0.0f)) - midaframe= strip->actend; - else - midaframe= strip->actstart + (len / 2.0f); - - /* make a copy (assume that this is possible) and append - * it immediately after the current strip - */ - nstrip= copy_nlastrip(strip); - BLI_insertlinkafter(&nlt->strips, strip, nstrip); - - /* set the endpoint of the first strip and the start of the new strip - * to the midframe values calculated above - */ - strip->end= midframe; - nstrip->start= midframe; - - strip->actend= midaframe; - nstrip->actstart= midaframe; - - /* clear the active flag from the copy */ - nstrip->flag &= ~NLASTRIP_FLAG_ACTIVE; + default: /* for things like Transitions, do not split! */ + break; + } } } } diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 28a422dd601..dae1a611757 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -207,7 +207,7 @@ void rna_def_nlastrip(BlenderRNA *brna) static EnumPropertyItem prop_type_items[] = { {NLASTRIP_TYPE_CLIP, "CLIP", 0, "Action Clip", "NLA Strip references some Action."}, {NLASTRIP_TYPE_TRANSITION, "TRANSITION", 0, "Transition", "NLA Strip 'transitions' between adjacent strips."}, - {NLASTRIP_TYPE_META, "META", 0, "Strip Container", "NLA Strip acts as a container for adjacent strips."}, + {NLASTRIP_TYPE_META, "META", 0, "Meta", "NLA Strip acts as a container for adjacent strips."}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_mode_blend_items[] = { {NLASTRIP_MODE_BLEND, "BLEND", 0, "Blend", "Results of strip and accumulated results are combined in ratio governed by influence."}, @@ -308,6 +308,11 @@ void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_struct_type(prop, "FModifier"); RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting all the F-Curves in the referenced Action."); + /* Strip's Sub-Strips (for Meta-Strips) */ + prop= RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "NlaStrip"); + RNA_def_property_ui_text(prop, "NLA Strips", "NLA Strips that this strip acts as a container for (if it is of type Meta)."); + /* Settings - Values necessary for evaluation */ prop= RNA_def_property(srna, "influence", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); -- cgit v1.2.3 From 79633056ac3848237d8bb8245523501905582f2e Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Mon, 6 Jul 2009 17:29:32 +0000 Subject: 2.5 * fix for RNA generation dependency in MSVC projectfiles * added missing include --- source/blender/editors/space_file/space_file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 99c0c44078b..9c30a0ed988 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -34,6 +34,8 @@ #include "DNA_scene_types.h" #include "DNA_screen_types.h" +#include "RNA_access.h" + #include "MEM_guardedalloc.h" #include "BIF_gl.h" @@ -477,7 +479,6 @@ void ED_spacetype_file(void) BLI_addhead(&st->regiontypes, art); file_panels_register(art); - BKE_spacetype_register(st); } -- cgit v1.2.3 From 905b1380054f42fe30b19fb37861057af4760e32 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 7 Jul 2009 02:12:50 +0000 Subject: NLA SoC: Start of integration of Meta-strips in Transform * Chains of selected strips are now converted to meta-strips before transforms begin, and converted back afterwards. This simplifies the transform code needed in later stages... * Transform-flushing code for Meta-Strips should now work. There seems to be a little bit of numeric inaccuracy problems somewhere, as two strips which met at the same frame can get separated when scaling. * Meta-strips now draw with proper text identification * Snapping strips now properly clears meta-strips if a moved strip needs to be moved into a new track to be accomodated. * Fixed a filter used by a selection-operator. --- source/blender/blenkernel/intern/nla.c | 45 ++++++++++++++++++---- source/blender/editors/space_nla/nla_draw.c | 12 +++++- source/blender/editors/space_nla/nla_edit.c | 3 ++ source/blender/editors/space_nla/nla_select.c | 2 +- .../editors/transform/transform_conversions.c | 23 +++++++++++ .../blender/editors/transform/transform_generics.c | 15 ++++++++ 6 files changed, 89 insertions(+), 11 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index a83fa0abe1e..851a0d7b549 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -781,6 +781,8 @@ void BKE_nlameta_flush_transforms (NlaStrip *mstrip) { NlaStrip *strip; float oStart, oEnd, offset; + float oLen, nLen; + short scaleChanged= 0; /* sanity checks * - strip must exist @@ -806,16 +808,43 @@ void BKE_nlameta_flush_transforms (NlaStrip *mstrip) if (IS_EQ(oStart, mstrip->start) && IS_EQ(oEnd, mstrip->end)) return; + /* check if scale changed */ + oLen = oEnd - oStart; + nLen = mstrip->end - mstrip->start; + if (IS_EQ(nLen, oLen) == 0) + scaleChanged= 1; + /* for each child-strip, calculate new start/end points based on this new info */ for (strip= mstrip->strips.first; strip; strip= strip->next) { - //PointerRNA strip_ptr; - - /* firstly, just apply the changes in offset to both ends of the strip */ - strip->start += offset; - strip->end += offset; - - /* now, we need to fix the endpoint to take into account scaling */ - // TODO.. + if (scaleChanged) { + PointerRNA ptr; + float p1, p2, nStart, nEnd; + + /* compute positions of endpoints relative to old extents of strip */ + p1= (strip->start - oStart) / oLen; + p2= (strip->end - oStart) / oLen; + + /* compute the new strip endpoints using the proportions */ + nStart= (p1 * nLen) + mstrip->start; + nEnd= (p2 * nLen) + mstrip->start; + + /* firstly, apply the new positions manually, then apply using RNA + * - first time is to make sure no truncation errors from one endpoint not being + * set yet occur + * - second time is to make sure scale is computed properly... + */ + strip->start= nStart; + strip->end= nEnd; + + RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &ptr); + RNA_float_set(&ptr, "start_frame", nStart); + RNA_float_set(&ptr, "end_frame", nEnd); + } + else { + /* just apply the changes in offset to both ends of the strip */ + strip->start += offset; + strip->end += offset; + } /* finally, make sure the strip's children (if it is a meta-itself), get updated */ BKE_nlameta_flush_transforms(strip); diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index e31aebf0155..7b9f2faf08a 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -366,13 +366,21 @@ static void nla_draw_strip_text (NlaTrack *nlt, NlaStrip *strip, int index, View /* for now, just init the string with fixed-formats */ switch (strip->type) { case NLASTRIP_TYPE_TRANSITION: /* Transition */ - sprintf(str, "%d | Transition | %.2f %s %.2f", index, strip->start, dir, strip->end); + sprintf(str, "%d | Transition | %.2f %s %.2f", + index, strip->start, dir, strip->end); + break; + + case NLASTRIP_TYPE_META: /* Meta */ + sprintf(str, "%d | %sMeta | %.2f %s %.2f", + index, ((strip->flag & NLASTRIP_FLAG_TEMP_META)?"Temp-":""), + strip->start, dir, strip->end); break; case NLASTRIP_TYPE_CLIP: /* Action-Clip (default) */ default: if (strip->act) - sprintf(str, "%d | Act: %s | %.2f %s %.2f", index, strip->act->id.name+2, strip->start, dir, strip->end); + sprintf(str, "%d | Act: %s | %.2f %s %.2f", + index, strip->act->id.name+2, strip->start, dir, strip->end); else sprintf(str, "%d | Act: ", index); // xxx... need a better format? break; diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 676d0aac1b1..d663b76d5fe 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -1264,6 +1264,9 @@ static int nlaedit_snap_exec (bContext *C, wmOperator *op) /* need to add a new track above the current one */ track= add_nlatrack(adt, nlt); BKE_nlatrack_add_strip(track, strip); + + /* clear temp meta-strips on this new track, as we may not be able to get back to it */ + BKE_nlastrips_clear_metas(&track->strips, 0, 1); } } diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index c238818dd1e..ca186dcf702 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -513,7 +513,7 @@ static void nlaedit_mselect_leftright (bContext *C, bAnimContext *ac, short left /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* select strips on the side where most data occurs */ diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index b2afaac23de..758be545fd0 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2617,6 +2617,9 @@ static void createTransNlaData(bContext *C, TransInfo *t) NlaTrack *nlt= (NlaTrack *)ale->data; NlaStrip *strip; + /* make some meta-strips for chains of selected strips */ + BKE_nlastrips_make_metas(&nlt->strips, 1); + /* only consider selected strips */ for (strip= nlt->strips.first; strip; strip= strip->next) { // TODO: we can make strips have handles later on... @@ -4754,6 +4757,26 @@ void special_aftertrans_update(TransInfo *t) if (ANIM_animdata_context_getdata(&ac) == 0) return; + if (ac.datatype) + { + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + short filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NLATRACKS); + + /* get channels to work on */ + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + + /* remove the temp metas */ + BKE_nlastrips_clear_metas(&nlt->strips, 0, 1); + } + + /* free temp memory */ + BLI_freelistN(&anim_data); + } + // XXX check on the calls below... we need some of these sanity checks //synchronize_action_strips(); //ANIM_editkeyframes_refresh(&ac); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 1474a30fbed..e228dc2b13a 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -82,6 +82,7 @@ #include "BKE_key.h" #include "BKE_mesh.h" #include "BKE_modifier.h" +#include "BKE_nla.h" #include "BKE_object.h" #include "BKE_utildefines.h" #include "BKE_context.h" @@ -388,6 +389,20 @@ void recalcData(TransInfo *t) } } } + + /* loop over the TransDataNla again, flushing the transforms (since we use Metas to make transforms easier) */ + td= t->data; + for (i = 0; i < t->total; i++, td++) + { + if (td->extra) + { + TransDataNla *tdn= td->extra; + NlaStrip *strip= tdn->strip; + + // TODO: this may flush some things twice, but that's fine as there's no impact from that + BKE_nlameta_flush_transforms(strip); + } + } } else if (t->obedit) { if ELEM(t->obedit->type, OB_CURVE, OB_SURF) { -- cgit v1.2.3 From 2edef129be18fa8cb7d9c33b8bd76dc60d9e1dcf Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 7 Jul 2009 05:41:59 +0000 Subject: NLA SoC: Transform Code for NLA-Strips recoded (still buggy) Recoded the Transform code for NLA-Strips so that they can now be moved between strips and will not get truncated when they get moved into other non-moving strips. Todos: * The current code for moving strips between tracks is buggy (only goes up, and has a tendency to move up without being told to) * Auto-snapping doesn't work yet... --- source/blender/editors/include/ED_anim_api.h | 16 ++ source/blender/editors/space_nla/nla_header.c | 2 +- source/blender/editors/space_nla/nla_intern.h | 15 -- source/blender/editors/transform/transform.c | 10 +- source/blender/editors/transform/transform.h | 14 +- .../editors/transform/transform_conversions.c | 103 ++++++++++-- .../blender/editors/transform/transform_generics.c | 176 +++++++++++++++------ source/blender/editors/transform/transform_ops.c | 4 +- 8 files changed, 253 insertions(+), 87 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 87811fa34f9..2745be978d2 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -228,6 +228,22 @@ typedef enum eAnimFilter_Flags { /* channel toggle-buttons */ #define ACHANNEL_BUTTON_WIDTH 16 + +/* -------------- NLA Channel Defines -------------- */ + +/* NLA channel heights */ +#define NLACHANNEL_FIRST -16 +#define NLACHANNEL_HEIGHT 24 +#define NLACHANNEL_HEIGHT_HALF 12 +#define NLACHANNEL_SKIP 2 +#define NLACHANNEL_STEP (NLACHANNEL_HEIGHT + NLACHANNEL_SKIP) + +/* channel widths */ +#define NLACHANNEL_NAMEWIDTH 200 + +/* channel toggle-buttons */ +#define NLACHANNEL_BUTTON_WIDTH 16 + /* ---------------- API -------------------- */ /* Obtain list of filtered Animation channels to operate on. diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index 9b9b21629cc..9a2806ed9c1 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -139,7 +139,7 @@ static void nla_selectmenu(bContext *C, uiLayout *layout, void *arg_unused) static void nla_edit_transformmenu(bContext *C, uiLayout *layout, void *arg_unused) { // XXX these operators may change for NLA... - uiItemEnumO(layout, "Grab/Move", 0, "TFM_OT_transform", "mode", TFM_TIME_TRANSLATE); + uiItemEnumO(layout, "Grab/Move", 0, "TFM_OT_transform", "mode", TFM_TRANSLATION); uiItemEnumO(layout, "Extend", 0, "TFM_OT_transform", "mode", TFM_TIME_EXTEND); uiItemEnumO(layout, "Scale", 0, "TFM_OT_transform", "mode", TFM_TIME_SCALE); } diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 4391a019207..3d8bfcd0546 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -33,21 +33,6 @@ /* **************************************** */ /* Macros, etc. only used by NLA */ -/* -------------- NLA Channel Defines -------------- */ - -/* NLA channel heights */ -#define NLACHANNEL_FIRST -16 -#define NLACHANNEL_HEIGHT 24 -#define NLACHANNEL_HEIGHT_HALF 12 -#define NLACHANNEL_SKIP 2 -#define NLACHANNEL_STEP (NLACHANNEL_HEIGHT + NLACHANNEL_SKIP) - -/* channel widths */ -#define NLACHANNEL_NAMEWIDTH 200 - -/* channel toggle-buttons */ -#define NLACHANNEL_BUTTON_WIDTH 16 - /* **************************************** */ /* space_nla.c / nla_buttons.c */ diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 9d8371afd61..9fbcfc71082 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -162,7 +162,7 @@ void convertViewVec(TransInfo *t, float *vec, short dx, short dy) vec[1]= aspy*(v2d->cur.ymax-v2d->cur.ymin)*(dy)/divy; vec[2]= 0.0f; } - else if(t->spacetype==SPACE_IPO) { + else if(ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)) { View2D *v2d = t->view; float divx, divy; @@ -212,7 +212,7 @@ void projectIntView(TransInfo *t, float *vec, int *adr) UI_view2d_to_region_no_clip(t->view, v[0], v[1], adr, adr+1); } - else if(t->spacetype==SPACE_IPO) { + else if(ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)) { int out[2] = {0, 0}; UI_view2d_view_to_region((View2D *)t->view, vec[0], vec[1], out, out+1); @@ -241,7 +241,7 @@ void projectFloatView(TransInfo *t, float *vec, float *adr) adr[0]= a[0]; adr[1]= a[1]; } - else if(t->spacetype==SPACE_IPO) { + else if(ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)) { int a[2]; projectIntView(t, vec, a); @@ -1324,10 +1324,10 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int case TFM_TIME_EXTEND: /* now that transdata has been made, do like for TFM_TIME_TRANSLATE (for most Animation * Editors because they have only 1D transforms for time values) or TFM_TRANSLATION - * (for Graph Editor only since it uses 'standard' transforms to get 2D movement) + * (for Graph/NLA Editors only since they uses 'standard' transforms to get 2D movement) * depending on which editor this was called from */ - if (t->spacetype == SPACE_IPO) + if ELEM(t->spacetype, SPACE_IPO, SPACE_NLA) initTranslation(t); else initTimeTranslate(t); diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 1b35701a753..65edae6fca8 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -163,9 +163,17 @@ typedef struct TransDataSeq { /* for NLA transform (stored in td->extra pointer) */ typedef struct TransDataNla { - struct NlaStrip *strip; /* NLA-strip that handle belongs to */ - float val; /* value for the handle that the transform tools write to */ - int handle; /* handle-index, 0 for start, 1 for end */ + struct NlaTrack *oldTrack; /* Original NLA-Track that the strip belongs to */ + struct NlaTrack *nlt; /* Current NLA-Track that the strip belongs to */ + + struct NlaStrip *strip; /* NLA-strip this data represents */ + + /* dummy values for transform to write in - must have 3 elements... */ + float h1[3]; /* start handle */ + float h2[3]; /* end handle */ + + int trackIndex; /* index of track that strip is currently in */ + int handle; /* handle-index: 0 for dummy entry, -1 for start, 1 for end, 2 for both ends */ } TransDataNla; typedef struct TransData { diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 758be545fd0..76720600327 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2661,34 +2661,104 @@ static void createTransNlaData(bContext *C, TransInfo *t) /* transition strips can't get directly transformed */ if (strip->type != NLASTRIP_TYPE_TRANSITION) { if (strip->flag & NLASTRIP_FLAG_SELECT) { + /* our transform data is constructed as follows: + * - only the handles on the right side of the current-frame get included + * - td structs are transform-elements operated on by the transform system + * and represent a single handle. The storage/pointer used (val or loc) depends on + * whether we're scaling or transforming. Ultimately though, the handles + * the td writes to will simply be a dummy in tdn + * - for each strip being transformed, a single tdn struct is used, so in some + * cases, there will need to be 1 of these tdn elements in the array skipped... + */ + float center[3], yval; + + /* firstly, init tdn settings */ + tdn->oldTrack= tdn->nlt= nlt; + tdn->strip= strip; + tdn->trackIndex= BLI_findindex(&nlt->strips, strip); + + yval= (float)(tdn->trackIndex * NLACHANNEL_SKIP); + + tdn->h1[0]= strip->start; + tdn->h1[1]= yval; + tdn->h2[0]= strip->end; + tdn->h2[1]= yval; + + center[0]= (float)CFRA; + center[1]= yval; + center[2]= 0.0f; + + /* set td's based on which handles are applicable */ if (FrameOnMouseSide(side, strip->start, (float)CFRA)) { - /* init the 'extra' data for NLA strip handles first */ - tdn->strip= strip; - tdn->val= strip->start; - tdn->handle= 0; + /* just set tdn to assume that it only has one handle for now */ + tdn->handle= -1; /* now, link the transform data up to this data */ - td->val= &tdn->val; - td->ival= tdn->val; + if (t->mode == TFM_TRANSLATION) { + td->loc= tdn->h1; + VECCOPY(td->iloc, tdn->h1); + + /* store all the other gunk that is required by transform */ + VECCOPY(td->center, center); + memset(td->axismtx, 0, sizeof(td->axismtx)); + td->axismtx[2][2] = 1.0f; + + td->ext= NULL; td->tdi= NULL; td->val= NULL; + + td->flag |= TD_SELECTED; + td->dist= 0.0f; + + Mat3One(td->mtx); + Mat3One(td->smtx); + } + else { + td->val= &tdn->h1[0]; + td->ival= tdn->h1[0]; + } + td->extra= tdn; td++; - tdn++; } if (FrameOnMouseSide(side, strip->end, (float)CFRA)) { - /* init the 'extra' data for NLA strip handles first */ - tdn->strip= strip; - tdn->val= strip->end; - tdn->handle= 1; + /* if tdn is already holding the start handle, then we're doing both, otherwise, only end */ + tdn->handle= (tdn->handle) ? 2 : 1; /* now, link the transform data up to this data */ - td->val= &tdn->val; - td->ival= tdn->val; + if (t->mode == TFM_TRANSLATION) { + td->loc= tdn->h2; + VECCOPY(td->iloc, tdn->h2); + + /* store all the other gunk that is required by transform */ + VECCOPY(td->center, center); + memset(td->axismtx, 0, sizeof(td->axismtx)); + td->axismtx[2][2] = 1.0f; + + td->ext= NULL; td->tdi= NULL; td->val= NULL; + + td->flag |= TD_SELECTED; + td->dist= 0.0f; + + Mat3One(td->mtx); + Mat3One(td->smtx); + } + else { + td->val= &tdn->h2[0]; + td->ival= tdn->h2[0]; + } + td->extra= tdn; td++; - tdn++; } + + /* if both handles were used, skip the next tdn (i.e. leave it blank) since the counting code is dumb... + * otherwise, just advance to the next one... + */ + if (tdn->handle == 2) + tdn += 2; + else + tdn++; } } } @@ -4739,7 +4809,6 @@ void special_aftertrans_update(TransInfo *t) ANIM_editkeyframes_refresh(&ac); } else if (t->spacetype == SPACE_NLA) { - SpaceNla *snla= (SpaceNla *)t->sa->spacedata.first; Scene *scene; bAnimContext ac; @@ -4769,6 +4838,10 @@ void special_aftertrans_update(TransInfo *t) for (ale= anim_data.first; ale; ale= ale->next) { NlaTrack *nlt= (NlaTrack *)ale->data; + /* make sure strips are in order again */ + // FIXME: this is buggy + //BKE_nlatrack_sort_strips(nlt); + /* remove the temp metas */ BKE_nlastrips_clear_metas(&nlt->strips, 0, 1); } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index e228dc2b13a..9928aea21d0 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -340,67 +340,151 @@ void recalcData(TransInfo *t) } } else if (t->spacetype == SPACE_NLA) { - TransData *td= t->data; + TransDataNla *tdn= (TransDataNla *)t->customData; int i; - /* for each point we've captured, look at its 'extra' data, which is basically a wrapper around the strip - * it is for + some extra storage for the values that get set, and use RNA to set this value (performing validation - * work so that we don't need to repeat it here) + /* for each strip we've got, perform some additional validation of the values that got set before + * using RNA to set the value (which does some special operations when setting these values to make + * sure that everything works ok) */ - for (i = 0; i < t->total; i++, td++) - { - if (td->extra) - { - TransDataNla *tdn= td->extra; - NlaStrip *strip= tdn->strip; + for (i = 0; i < t->total; i++, tdn++) { + NlaStrip *strip= tdn->strip; + PointerRNA strip_ptr; + short pExceeded, nExceeded, iter; + int delta_y1, delta_y2; + + /* if this tdn has no handles, that means it is just a dummy that should be skipped */ + if (tdn->handle == 0) + continue; - /* if we're just cancelling (i.e. the user aborted the transform), - * just restore the data by directly overwriting the values with the original - * ones (i.e. don't go through RNA), as we get some artifacts... + /* if cancelling transform, just write the values without validating, then move on */ + if (t->state == TRANS_CANCEL) { + /* clear the values by directly overwriting the originals, but also need to restore + * endpoints of neighboring transition-strips */ - if (t->state == TRANS_CANCEL) { - /* clear the values by directly overwriting the originals, but also need to restore - * endpoints of neighboring transition-strips + + /* start */ + strip->start= tdn->h1[0]; + + if ((strip->prev) && (strip->prev->type == NLASTRIP_TYPE_TRANSITION)) + strip->prev->end= tdn->h1[0]; + + /* end */ + strip->end= tdn->h2[0]; + + if ((strip->next) && (strip->next->type == NLASTRIP_TYPE_TRANSITION)) + strip->next->start= tdn->h2[0]; + + /* restore to original track (if needed) */ + if (tdn->oldTrack != tdn->nlt) { + /* just append to end of list for now, since strips get sorted in special_aftertrans_update() */ + BLI_remlink(&tdn->nlt->strips, strip); + BLI_addtail(&tdn->oldTrack->strips, strip); + } + + continue; + } + + /* firstly, check if the proposed transform locations would overlap with any neighbouring strips + * (barring transitions) which are absolute barriers since they are not being moved + * + * this is done as a iterative procedure (done 5 times max for now) + */ + for (iter=0; iter < 5; iter++) { + pExceeded= ((strip->prev) && (strip->prev->type != NLASTRIP_TYPE_TRANSITION) && (tdn->h1[0] < strip->prev->end)); + nExceeded= ((strip->next) && (strip->next->type != NLASTRIP_TYPE_TRANSITION) && (tdn->h2[0] > strip->next->start)); + + if ((pExceeded && nExceeded) || (iter == 4) ) { + /* both endpoints exceeded (or iteration ping-pong'd meaning that we need a compromise) + * - simply crop strip to fit within the bounds of the strips bounding it + * - if there were no neighbours, clear the transforms (make it default to the strip's current values) */ - if (tdn->handle) { - strip->end= tdn->val; - - if ((strip->next) && (strip->next->type == NLASTRIP_TYPE_TRANSITION)) - strip->next->start= tdn->val; + if (strip->prev && strip->next) { + tdn->h1[0]= strip->prev->end; + tdn->h2[0]= strip->next->start; } else { - strip->start= tdn->val; - - if ((strip->prev) && (strip->prev->type == NLASTRIP_TYPE_TRANSITION)) - strip->prev->end= tdn->val; + tdn->h1[0]= strip->start; + tdn->h2[0]= strip->end; } } - else { - PointerRNA strip_ptr; + else if (nExceeded) { + /* move backwards */ + float offset= tdn->h2[0] - strip->next->start; - /* make RNA-pointer */ - RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &strip_ptr); + tdn->h1[0] -= offset; + tdn->h2[0] -= offset; + } + else if (pExceeded) { + /* more forwards */ + float offset= strip->prev->end - tdn->h1[0]; - /* write the value set by the transform tools to the appropriate property using RNA */ - if (tdn->handle) - RNA_float_set(&strip_ptr, "end_frame", tdn->val); - else - RNA_float_set(&strip_ptr, "start_frame", tdn->val); + tdn->h1[0] += offset; + tdn->h2[0] += offset; } + else /* all is fine and well */ + break; } - } - - /* loop over the TransDataNla again, flushing the transforms (since we use Metas to make transforms easier) */ - td= t->data; - for (i = 0; i < t->total; i++, td++) - { - if (td->extra) - { - TransDataNla *tdn= td->extra; - NlaStrip *strip= tdn->strip; + + /* use RNA to write the values... */ + // TODO: do we need to write in 2 passes to make sure that no truncation goes on? + RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &strip_ptr); + + RNA_float_set(&strip_ptr, "start_frame", tdn->h1[0]); + RNA_float_set(&strip_ptr, "end_frame", tdn->h2[0]); + + /* flush transforms to child strips (since this should be a meta) */ + BKE_nlameta_flush_transforms(strip); + + + /* now, check if we need to try and move track + * - we need to calculate both, as only one may have been altered by transform if only 1 handle moved + */ + // FIXME: the conversion from vertical distance to track index needs work! + delta_y1= ((int)tdn->h1[0] / NLACHANNEL_SKIP - tdn->trackIndex); + delta_y2= ((int)tdn->h2[0] / NLACHANNEL_SKIP - tdn->trackIndex); + + if (delta_y1 || delta_y2) { + NlaTrack *track; + int delta = (delta_y2) ? delta_y2 : delta_y1; + int n; - // TODO: this may flush some things twice, but that's fine as there's no impact from that - BKE_nlameta_flush_transforms(strip); + /* move in the requested direction, checking at each layer if there's space for strip to pass through, + * stopping on the last track available or that we're able to fit in + */ + if (delta > 0) { + for (track=tdn->nlt->next, n=0; (track) && (n < delta); track=track->next, n++) { + /* check if space in this track for the strip */ + if (BKE_nlatrack_has_space(track, strip->start, strip->end)) { + /* move strip to this track */ + BLI_remlink(&tdn->nlt->strips, strip); + BKE_nlatrack_add_strip(track, strip); + + tdn->nlt= track; + tdn->trackIndex += (n + 1); /* + 1, since n==0 would mean that we didn't change track */ + } + else /* can't move any further */ + break; + } + } + else { + /* make delta 'positive' before using it, since we now know to go backwards */ + delta= -delta; + + for (track=tdn->nlt->prev, n=0; (track) && (n < delta); track=track->prev, n++) { + /* check if space in this track for the strip */ + if (BKE_nlatrack_has_space(track, strip->start, strip->end)) { + /* move strip to this track */ + BLI_remlink(&tdn->nlt->strips, strip); + BKE_nlatrack_add_strip(track, strip); + + tdn->nlt= track; + tdn->trackIndex -= (n - 1); /* - 1, since n==0 would mean that we didn't change track */ + } + else /* can't move any further */ + break; + } + } } } } diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 28606932c64..ecb58831118 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -609,10 +609,10 @@ void transform_keymap_for_space(struct wmWindowManager *wm, struct ListBase *key break; case SPACE_NLA: km= WM_keymap_add_item(keymap, "TFM_OT_transform", GKEY, KM_PRESS, 0, 0); - RNA_int_set(km->ptr, "mode", TFM_TIME_TRANSLATE); + RNA_int_set(km->ptr, "mode", TFM_TRANSLATION); km= WM_keymap_add_item(keymap, "TFM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0); - RNA_int_set(km->ptr, "mode", TFM_TIME_TRANSLATE); + RNA_int_set(km->ptr, "mode", TFM_TRANSLATION); km= WM_keymap_add_item(keymap, "TFM_OT_transform", EKEY, KM_PRESS, 0, 0); RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND); -- cgit v1.2.3 From 5fc61f03c12e291fa72fb3e60e5730300165aa3c Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 7 Jul 2009 06:16:06 +0000 Subject: NLA SoC: Fixes for bugs in transform code from previous commit * The code to move strips between tracks now works (though it can still be a bit too eager to change tracks half-way through some transforms). Strips are moved up/down one strip at a time, depending on whether there is any space in the next-track in the direction you direct it to move in. * Auto-snapping works again. Also enabled snap-to-marker option for Graph Editor here. --- .../editors/transform/transform_conversions.c | 4 ++-- .../blender/editors/transform/transform_generics.c | 25 +++++++++++++++++----- 2 files changed, 22 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 76720600327..fafdfcc7602 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2677,7 +2677,7 @@ static void createTransNlaData(bContext *C, TransInfo *t) tdn->strip= strip; tdn->trackIndex= BLI_findindex(&nlt->strips, strip); - yval= (float)(tdn->trackIndex * NLACHANNEL_SKIP); + yval= (float)(tdn->trackIndex * NLACHANNEL_STEP); tdn->h1[0]= strip->start; tdn->h1[1]= yval; @@ -3688,7 +3688,7 @@ void flushTransGraphData(TransInfo *t) break; case SACTSNAP_MARKER: /* snap to nearest marker */ - //td2d->loc[0]= (float)find_nearest_marker_time(td2d->loc[0]); + td2d->loc[0]= (float)ED_markers_find_nearest_marker_time(&t->scene->markers, td2d->loc[0]); break; } } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 9928aea21d0..2ff3cd807cd 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -59,9 +59,7 @@ //#include "BIF_screen.h" //#include "BIF_mywindow.h" #include "BIF_gl.h" -//#include "BIF_editaction.h" //#include "BIF_editmesh.h" -//#include "BIF_editnla.h" //#include "BIF_editsima.h" //#include "BIF_editparticle.h" //#include "BIF_meshtools.h" @@ -91,6 +89,7 @@ #include "ED_armature.h" #include "ED_image.h" #include "ED_keyframing.h" +#include "ED_markers.h" #include "ED_mesh.h" #include "ED_space_api.h" #include "ED_uvedit.h" @@ -341,6 +340,7 @@ void recalcData(TransInfo *t) } else if (t->spacetype == SPACE_NLA) { TransDataNla *tdn= (TransDataNla *)t->customData; + SpaceNla *snla= (SpaceNla *)t->sa->spacedata.first; int i; /* for each strip we've got, perform some additional validation of the values that got set before @@ -375,6 +375,9 @@ void recalcData(TransInfo *t) if ((strip->next) && (strip->next->type == NLASTRIP_TYPE_TRANSITION)) strip->next->start= tdn->h2[0]; + /* flush transforms to child strips (since this should be a meta) */ + BKE_nlameta_flush_transforms(strip); + /* restore to original track (if needed) */ if (tdn->oldTrack != tdn->nlt) { /* just append to end of list for now, since strips get sorted in special_aftertrans_update() */ @@ -426,6 +429,19 @@ void recalcData(TransInfo *t) break; } + /* handle auto-snapping */ + switch (snla->autosnap) { + case SACTSNAP_FRAME: /* snap to nearest frame */ + tdn->h1[0]= (float)( floor(tdn->h1[0]+0.5f) ); + tdn->h2[0]= (float)( floor(tdn->h2[0]+0.5f) ); + break; + + case SACTSNAP_MARKER: /* snap to nearest marker */ + tdn->h1[0]= (float)ED_markers_find_nearest_marker_time(&t->scene->markers, tdn->h1[0]); + tdn->h2[0]= (float)ED_markers_find_nearest_marker_time(&t->scene->markers, tdn->h2[0]); + break; + } + /* use RNA to write the values... */ // TODO: do we need to write in 2 passes to make sure that no truncation goes on? RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &strip_ptr); @@ -440,9 +456,8 @@ void recalcData(TransInfo *t) /* now, check if we need to try and move track * - we need to calculate both, as only one may have been altered by transform if only 1 handle moved */ - // FIXME: the conversion from vertical distance to track index needs work! - delta_y1= ((int)tdn->h1[0] / NLACHANNEL_SKIP - tdn->trackIndex); - delta_y2= ((int)tdn->h2[0] / NLACHANNEL_SKIP - tdn->trackIndex); + delta_y1= ((int)tdn->h1[1] / NLACHANNEL_STEP - tdn->trackIndex); + delta_y2= ((int)tdn->h2[1] / NLACHANNEL_STEP - tdn->trackIndex); if (delta_y1 || delta_y2) { NlaTrack *track; -- cgit v1.2.3 From 6a320f327700e5ef6774d29b0b7a4d4b1a45fa27 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 7 Jul 2009 06:21:38 +0000 Subject: NLA SoC: Auto-Snapping Fixes (Transform) Snap to nearest-second works again for NLA and Graph Editors --- .../blender/editors/transform/transform_conversions.c | 19 ++++++++----------- source/blender/editors/transform/transform_generics.c | 14 +++++++++++--- 2 files changed, 19 insertions(+), 14 deletions(-) (limited to 'source') diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index fafdfcc7602..53c8e08ee74 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -101,16 +101,13 @@ #include "BKE_context.h" #include "BKE_report.h" -//#include "BIF_editaction.h" //#include "BIF_editview.h" //#include "BIF_editlattice.h" //#include "BIF_editconstraint.h" //#include "BIF_editmesh.h" -//#include "BIF_editnla.h" //#include "BIF_editsima.h" //#include "BIF_editparticle.h" #include "BIF_gl.h" -//#include "BIF_keyframing.h" //#include "BIF_poseobject.h" //#include "BIF_meshtools.h" //#include "BIF_mywindow.h" @@ -127,6 +124,7 @@ #include "ED_keyframing.h" #include "ED_keyframes_edit.h" #include "ED_object.h" +#include "ED_markers.h" #include "ED_mesh.h" #include "ED_types.h" #include "ED_uvedit.h" @@ -134,13 +132,7 @@ #include "UI_view2d.h" -//#include "BSE_drawipo.h" //#include "BSE_edit.h" -//#include "BSE_editipo.h" -//#include "BSE_editipo_types.h" -//#include "BSE_editaction_types.h" - -//#include "BDR_drawaction.h" // list of keyframes in action //#include "BDR_editobject.h" // reset_slowparents() //#include "BDR_gpencil.h" @@ -3671,6 +3663,8 @@ void flushTransGraphData(TransInfo *t) SpaceIpo *sipo = (SpaceIpo *)t->sa->spacedata.first; TransData *td; TransData2D *td2d; + Scene *scene= t->scene; + double secf= FPS; int a; /* flush to 2d vector from internally used 3d vector */ @@ -3683,8 +3677,11 @@ void flushTransGraphData(TransInfo *t) */ if ((td->flag & TD_NOTIMESNAP)==0) { switch (sipo->autosnap) { - case SACTSNAP_FRAME: /* snap to nearest frame */ - td2d->loc[0]= (float)( floor(td2d->loc[0]+0.5f) ); + case SACTSNAP_FRAME: /* snap to nearest frame (or second if drawing seconds) */ + if (sipo->flag & SIPO_DRAWTIME) + td2d->loc[0]= (float)( floor((td2d->loc[0]/secf) + 0.5f) * secf ); + else + td2d->loc[0]= (float)( floor(td2d->loc[0]+0.5f) ); break; case SACTSNAP_MARKER: /* snap to nearest marker */ diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 2ff3cd807cd..9d111f39b6d 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -341,6 +341,8 @@ void recalcData(TransInfo *t) else if (t->spacetype == SPACE_NLA) { TransDataNla *tdn= (TransDataNla *)t->customData; SpaceNla *snla= (SpaceNla *)t->sa->spacedata.first; + Scene *scene= t->scene; + double secf= FPS; int i; /* for each strip we've got, perform some additional validation of the values that got set before @@ -431,9 +433,15 @@ void recalcData(TransInfo *t) /* handle auto-snapping */ switch (snla->autosnap) { - case SACTSNAP_FRAME: /* snap to nearest frame */ - tdn->h1[0]= (float)( floor(tdn->h1[0]+0.5f) ); - tdn->h2[0]= (float)( floor(tdn->h2[0]+0.5f) ); + case SACTSNAP_FRAME: /* snap to nearest frame/time */ + if (snla->flag & SNLA_DRAWTIME) { + tdn->h1[0]= (float)( floor((tdn->h1[0]/secf) + 0.5f) * secf ); + tdn->h2[0]= (float)( floor((tdn->h2[0]/secf) + 0.5f) * secf ); + } + else { + tdn->h1[0]= (float)( floor(tdn->h1[0]+0.5f) ); + tdn->h2[0]= (float)( floor(tdn->h2[0]+0.5f) ); + } break; case SACTSNAP_MARKER: /* snap to nearest marker */ -- cgit v1.2.3 From dd42ad590ed4a620b0c70eb844d0cf341014b290 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 7 Jul 2009 06:39:01 +0000 Subject: NLA SoC: Small cleanup in Graph Editor struct code (obsolete + commented out stuff) --- source/blender/makesdna/DNA_space_types.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 329a3aac148..fef82ee2b91 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -86,7 +86,6 @@ typedef struct SpaceInfo { } SpaceInfo; /* 'Graph' Editor (formerly known as the IPO Editor) */ -// XXX for now, we keep all old data... typedef struct SpaceIpo { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ @@ -96,10 +95,6 @@ typedef struct SpaceIpo { short blockhandler[8]; View2D v2d; /* depricated, copied to region */ - // 'IPO keys' - vertical lines for editing multiple keyframes at once - use Dopesheet instead for this? - //ListBase ipokey; // XXX it's not clear how these will come back yet - //short showkey; // XXX this doesn't need to be restored until ipokeys come back - struct bDopeSheet *ads; /* settings for filtering animation data (NOTE: we use a pointer due to code-linking issues) */ ListBase ghostCurves; /* sampled snapshots of F-Curves used as in-session guides */ @@ -107,7 +102,7 @@ typedef struct SpaceIpo { short mode; /* mode for the Graph editor (eGraphEdit_Mode) */ short flag; /* settings for Graph editor */ short autosnap; /* time-transform autosnapping settings for Graph editor (eAnimEdit_AutoSnap in DNA_action_types.h) */ - char pin, lock; + char pin, lock; // XXX old, unused vars that are probably going to be depreceated soon... } SpaceIpo; typedef struct SpaceButs { -- cgit v1.2.3 From 761241fcbbeb254cd78aca5f8bb62330ce9369ac Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 7 Jul 2009 06:56:29 +0000 Subject: NLA SoC: Current Frame can now be negative This commit is quite experimental, and might have to be reverted, but in quite a few places, the cleanups from this commit were already necessary. * I've left most of the image-handling functions alone, since I'm not sure how well they cope with negative indices. * Start/End frames cannot be negative for now... any specific reasons why they should be negative? --- source/blender/editors/animation/anim_ops.c | 8 +++++--- source/blender/editors/space_action/action_select.c | 2 +- source/blender/editors/space_buttons/buttons_header.c | 2 +- source/blender/editors/space_graph/graph_select.c | 2 +- source/blender/editors/space_nla/nla_select.c | 2 +- source/blender/editors/space_time/time_header.c | 5 ++++- source/blender/makesdna/DNA_scene_types.h | 4 ++++ source/blender/makesrna/intern/rna_constraint.c | 4 ++-- source/blender/makesrna/intern/rna_modifier.c | 8 ++++---- source/blender/makesrna/intern/rna_nla.c | 4 ++-- source/blender/makesrna/intern/rna_object.c | 2 +- source/blender/makesrna/intern/rna_particle.c | 10 +++++----- source/blender/makesrna/intern/rna_scene.c | 2 +- 13 files changed, 32 insertions(+), 23 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index e899cc1d520..10691c558bf 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -83,10 +83,12 @@ static void change_frame_apply(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); int cfra; - /* get frame, and clamp to MINFRAME */ + /* get frame, and clamp to MINAFRAME + * - not MINFRAME, since it's useful to be able to key a few-frames back + */ cfra= RNA_int_get(op->ptr, "frame"); - if (cfra < MINFRAME) cfra= MINFRAME; + if (cfra < MINAFRAME) cfra= MINAFRAME; CFRA= cfra; WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); @@ -209,7 +211,7 @@ void ANIM_OT_change_frame(wmOperatorType *ot) ot->modal= change_frame_modal; /* rna */ - RNA_def_int(ot->srna, "frame", 0, 1, MAXFRAME, "Frame", "", 1, MAXFRAME); + RNA_def_int(ot->srna, "frame", 0, MINAFRAME, MAXFRAME, "Frame", "", MINAFRAME, MAXFRAME); } /* ****************** set preview range operator ****************************/ diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index d45e32dd3bb..5b87c04b311 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -642,7 +642,7 @@ static void actkeys_mselect_leftright (bAnimContext *ac, short leftright, short memset(&bed, 0, sizeof(BeztEditFunc)); if (leftright == ACTKEYS_LRSEL_LEFT) { - bed.f1 = -MAXFRAMEF; + bed.f1 = MINAFRAMEF; bed.f2 = (float)(CFRA + FRAME_CLICK_THRESH); } else { diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c index 7c622f172a2..99cc85d9a52 100644 --- a/source/blender/editors/space_buttons/buttons_header.c +++ b/source/blender/editors/space_buttons/buttons_header.c @@ -193,7 +193,7 @@ void buttons_header_buttons(const bContext *C, ARegion *ar) uiBlockEndAlign(block); xco+=XIC; - uiDefButI(block, NUM, B_NEWFRAME, "", (xco+20),yco,60,YIC, &(CTX_data_scene(C)->r.cfra), 1.0, MAXFRAMEF, 0, 0, "Displays Current Frame of animation. Click to change."); + uiDefButI(block, NUM, B_NEWFRAME, "", (xco+20),yco,60,YIC, &(CTX_data_scene(C)->r.cfra), MINAFRAMEF, MAXFRAMEF, 0, 0, "Displays Current Frame of animation. Click to change."); xco+= 80; /* always as last */ diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 11af86ca83b..c855222df02 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -763,7 +763,7 @@ static void graphkeys_mselect_leftright (bAnimContext *ac, short leftright, shor memset(&bed, 0, sizeof(BeztEditFunc)); if (leftright == GRAPHKEYS_LRSEL_LEFT) { - bed.f1 = -MAXFRAMEF; + bed.f1 = MINAFRAMEF; bed.f2 = (float)(CFRA + 0.1f); } else { diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index ca186dcf702..895d0dbf88a 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -501,7 +501,7 @@ static void nlaedit_mselect_leftright (bContext *C, bAnimContext *ac, short left /* get range, and get the right flag-setting mode */ if (leftright == NLAEDIT_LRSEL_LEFT) { - xmin = -MAXFRAMEF; + xmin = MINAFRAMEF; xmax = (float)(CFRA + FRAME_CLICK_THRESH); } else { diff --git a/source/blender/editors/space_time/time_header.c b/source/blender/editors/space_time/time_header.c index 29f31671670..da99849e594 100644 --- a/source/blender/editors/space_time/time_header.c +++ b/source/blender/editors/space_time/time_header.c @@ -536,9 +536,12 @@ void time_header_buttons(const bContext *C, ARegion *ar) xco += (short)(4.5 * XIC + 16); + /* MINAFRAMEF not MINFRAMEF, since MINAFRAMEF allows to set current frame negative + * to facilitate easier keyframing in some situations + */ uiDefButI(block, NUM, B_NEWFRAME, "", xco,yco, (int)3.5*XIC,YIC, - &(scene->r.cfra), MINFRAMEF, MAXFRAMEF, 0, 0, + &(scene->r.cfra), MINAFRAMEF, MAXFRAMEF, 0, 0, "Displays Current Frame of animation"); xco += (short)(3.5 * XIC + 16); diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 3549cdbe75f..6355e02a5e0 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -772,6 +772,10 @@ typedef struct Scene { #define MINFRAME 1 #define MINFRAMEF 1.0f +/* (minimum frame number for current-frame) */ +#define MINAFRAME -300000 +#define MINAFRAMEF -300000.0f + /* depricate this! */ #define TESTBASE(v3d, base) ( ((base)->flag & SELECT) && ((base)->lay & v3d->lay) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0) ) #define TESTBASELIB(v3d, base) ( ((base)->flag & SELECT) && ((base)->lay & v3d->lay) && ((base)->object->id.lib==0) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0)) diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 5c4b6a95524..2a5df8f1488 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -729,13 +729,13 @@ static void rna_def_constraint_action(BlenderRNA *brna) prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "start"); - RNA_def_property_range(prop, MINFRAME, MAXFRAME); + RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Start Frame", "First frame of the Action to use."); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "end"); - RNA_def_property_range(prop, MINFRAME, MAXFRAME); + RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "End Frame", "Last frame of the Action to use."); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 48bfdf70171..69d5c203abf 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -506,7 +506,7 @@ static void rna_def_modifier_build(BlenderRNA *brna) RNA_def_struct_ui_icon(srna, ICON_MOD_BUILD); prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, 1, MAXFRAMEF); + RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Start", "Specify the start frame of the effect."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); @@ -660,18 +660,18 @@ static void rna_def_modifier_wave(BlenderRNA *brna) prop= RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "timeoffs"); - RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF); + RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Time Offset", "Either the starting frame (for positive speed) or ending frame (for negative speed.)"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF); + RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Lifetime", ""); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); prop= RNA_def_property(srna, "damping_time", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "damp"); - RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF); + RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Damping Time", ""); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index dae1a611757..b0149d29e69 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -66,7 +66,7 @@ static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) } } else { - CLAMP(value, -MAXFRAME, data->end); + CLAMP(value, MINAFRAME, data->end); } data->start= value; } @@ -185,7 +185,7 @@ static void rna_NlaStrip_blend_out_set(PointerRNA *ptr, float value) static void rna_NlaStrip_action_start_frame_set(PointerRNA *ptr, float value) { NlaStrip *data= (NlaStrip*)ptr->data; - CLAMP(value, -MAXFRAME, data->actend); + CLAMP(value, MINAFRAME, data->actend); data->actstart= value; } diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index ca2c9d072fb..b33c5e480b5 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1154,7 +1154,7 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sf"); - RNA_def_property_range(prop, -MAXFRAMEF, MAXFRAMEF); + RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Time Offset", "Animation offset in frames for IPO's and dupligroup instances."); RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_update"); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index d60a215b498..ba331efada1 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -161,8 +161,8 @@ static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value) if(settings->type==PART_REACTOR && value < 1.0) value = 1.0; - else if (value < -30000.0f) //TODO: replace 30000 with MAXFRAMEF when available in 2.5 - value = -30000.0f; + else if (value < MINAFRAMEF) + value = MINAFRAMEF; settings->sta = value; } @@ -1066,19 +1066,19 @@ static void rna_def_particle_settings(BlenderRNA *brna) /* general values */ prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sta");//optional if prop names are the same - RNA_def_property_range(prop, -30000.0f, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5 + RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_start_set", NULL); RNA_def_property_ui_text(prop, "Start", "Frame # to start emitting particles."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "end", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, -30000.0f, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5 + RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_end_set", NULL); RNA_def_property_ui_text(prop, "End", "Frame # to stop emitting particles."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, 1.0f, 30000.0f); + RNA_def_property_range(prop, 1.0f, MAXFRAMEF); RNA_def_property_ui_text(prop, "Lifetime", "Specify the life span of the particles"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 5f03b7167f4..2ad4a20f9a0 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -960,7 +960,7 @@ void RNA_def_scene(BlenderRNA *brna) prop= RNA_def_property(srna, "current_frame", PROP_INT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_int_sdna(prop, NULL, "r.cfra"); - RNA_def_property_range(prop, MINFRAME, MAXFRAME); + RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Current Frame", ""); RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update"); -- cgit v1.2.3 From cfd5046c9e4a6617a20cfc7e59519a84d3c18b9d Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Tue, 7 Jul 2009 07:25:44 +0000 Subject: 2.5 filebrowser: previous/next + bugfix + elubie's changes and cleanup * Previous/Next Folder browser * bugfix: "open most recently opened directory". * Previous and Next functionalities: - use BACKSPACE to navigate to previous folders - use SHIFT+BACKSPACE to navigate forward - once you change the folder by other ways the forward folder list is cleared * bug fix: the sfile->params->dir set through ED_fileselect_set_params wasn't correct. According to the code taking the settings from the existing (previous) filebrowser is a temp solution. In that case this is a fix for a temp solution :) (changes in: wm_event_system.c, filesel.c and ED_fileselect.h) ** Andrea(elubie): we can get away of the folderlist_clear_next test if we manually pass a boolean to file_change_dir (e.g. file_change_dir(sfile, true)). I tried not to mess up with your changes here. It's slightly slower (and maybe hacky) but its's more conservative IMHO. (my first commit to 2.5 ... that was a good reason to put my paper on hold :p) --- source/blender/blenloader/intern/readfile.c | 7 +- source/blender/editors/include/ED_fileselect.h | 2 +- source/blender/editors/space_file/file_intern.h | 5 ++ source/blender/editors/space_file/file_ops.c | 85 +++++++++++++++++---- source/blender/editors/space_file/filelist.c | 88 +++++++++++++++++++++- source/blender/editors/space_file/filelist.h | 6 ++ source/blender/editors/space_file/filesel.c | 38 +++++++--- source/blender/editors/space_file/space_file.c | 30 +++++++- source/blender/makesdna/DNA_space_types.h | 3 + .../blender/windowmanager/intern/wm_event_system.c | 7 +- 10 files changed, 234 insertions(+), 37 deletions(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 93de096e7b4..fd86c436558 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4472,13 +4472,10 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) SpaceFile *sfile= (SpaceFile *)sl; sfile->files= NULL; + sfile->folders_prev= NULL; + sfile->folders_next= NULL; sfile->params= NULL; sfile->op= NULL; - /* XXX needs checking - best solve in filesel itself - if(sfile->libfiledata) - BLO_blendhandle_close(sfile->libfiledata); - sfile->libfiledata= 0; - */ } else if(sl->spacetype==SPACE_IMASEL) { SpaceImaSel *simasel= (SpaceImaSel *)sl; diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index 01882ecd9bc..1b8524eea33 100644 --- a/source/blender/editors/include/ED_fileselect.h +++ b/source/blender/editors/include/ED_fileselect.h @@ -69,7 +69,7 @@ typedef struct FileLayout struct FileSelectParams* ED_fileselect_get_params(struct SpaceFile *sfile); -short ED_fileselect_set_params(struct SpaceFile *sfile, const char *title, const char *path, +short ED_fileselect_set_params(struct SpaceFile *sfile, const char *title, const char *dir, const char *path, short flag, short display, short filter, short sort); void ED_fileselect_reset_params(struct SpaceFile *sfile); diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 5a440be6962..2f3fae47abb 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -65,6 +65,8 @@ void FILE_OT_loadimages(struct wmOperatorType *ot); void FILE_OT_exec(struct wmOperatorType *ot); void FILE_OT_cancel(struct wmOperatorType *ot); void FILE_OT_parent(struct wmOperatorType *ot); +void FILE_OT_previous(struct wmOperatorType *ot); +void FILE_OT_next(struct wmOperatorType *ot); void FILE_OT_refresh(struct wmOperatorType *ot); void FILE_OT_bookmark_toggle(struct wmOperatorType *ot); void FILE_OT_filenum(struct wmOperatorType *ot); @@ -72,11 +74,14 @@ void FILE_OT_filenum(struct wmOperatorType *ot); int file_exec(bContext *C, struct wmOperator *unused); int file_cancel_exec(bContext *C, struct wmOperator *unused); int file_parent_exec(bContext *C, struct wmOperator *unused); +int file_previous_exec(bContext *C, struct wmOperator *unused); +int file_next_exec(bContext *C, struct wmOperator *unused); int file_hilight_set(struct SpaceFile *sfile, struct ARegion *ar, int mx, int my); /* filesel.c */ float file_string_width(const char* str); float file_font_pointsize(); +void file_change_dir(struct SpaceFile *sfile); /* file_panels.c */ void file_panels_register(struct ARegionType *art); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index fa377c06184..bb56ec94d7b 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -146,9 +146,7 @@ static void file_select(SpaceFile* sfile, ARegion* ar, const rcti* rect, short v strcat(params->dir,"/"); params->file[0] = '\0'; BLI_cleanup_dir(G.sce, params->dir); - filelist_setdir(sfile->files, params->dir); - filelist_free(sfile->files); - params->active_file = -1; + file_change_dir(sfile); } } else if (file) @@ -305,10 +303,8 @@ static int bookmark_select_invoke(bContext *C, wmOperator *op, wmEvent *event) RNA_string_get(op->ptr, "dir", entry); BLI_strncpy(params->dir, entry, sizeof(params->dir)); BLI_cleanup_dir(G.sce, params->dir); - filelist_free(sfile->files); - filelist_setdir(sfile->files, params->dir); - params->file[0] = '\0'; - params->active_file = -1; + file_change_dir(sfile); + params->file[0] = '\0'; WM_event_add_notifier(C, NC_FILE|ND_PARAMS, NULL); } @@ -467,7 +463,10 @@ void FILE_OT_highlight(struct wmOperatorType *ot) int file_cancel_exec(bContext *C, wmOperator *unused) { SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); - + + folderlist_free(sfile->folders_prev); + folderlist_free(sfile->folders_next); + WM_event_fileselect_event(C, sfile->op, EVT_FILESELECT_CANCEL); sfile->op = NULL; @@ -529,6 +528,9 @@ int file_exec(bContext *C, wmOperator *unused) } } + folderlist_free(sfile->folders_prev); + folderlist_free(sfile->folders_next); + fsmenu_insert_entry(fsmenu_get(), FS_CATEGORY_RECENT, sfile->params->dir,0, 1); BLI_make_file_string(G.sce, name, BLI_gethome(), ".Bfs"); fsmenu_write_file(fsmenu_get(), name); @@ -556,9 +558,7 @@ int file_parent_exec(bContext *C, wmOperator *unused) if(sfile->params) { BLI_parent_dir(sfile->params->dir); - filelist_setdir(sfile->files, sfile->params->dir); - filelist_free(sfile->files); - sfile->params->active_file = -1; + file_change_dir(sfile); } WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); @@ -583,17 +583,74 @@ int file_refresh_exec(bContext *C, wmOperator *unused) { SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + file_change_dir(sfile); + + WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + + return OPERATOR_FINISHED; + +} + +void FILE_OT_previous(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Previous Folder"; + ot->idname= "FILE_OT_previous"; + + /* api callbacks */ + ot->exec= file_previous_exec; + ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ +} + +int file_previous_exec(bContext *C, wmOperator *unused) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + if(sfile->params) { - filelist_setdir(sfile->files, sfile->params->dir); - filelist_free(sfile->files); - sfile->params->active_file = -1; + if (!sfile->folders_next) + sfile->folders_next = folderlist_new(); + + folderlist_pushdir(sfile->folders_next, sfile->params->dir); + folderlist_popdir(sfile->folders_prev, sfile->params->dir); + folderlist_pushdir(sfile->folders_next, sfile->params->dir); + + file_change_dir(sfile); } WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); return OPERATOR_FINISHED; +} +void FILE_OT_next(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Next Folder"; + ot->idname= "FILE_OT_next"; + + /* api callbacks */ + ot->exec= file_next_exec; + ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ } +int file_next_exec(bContext *C, wmOperator *unused) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + if(sfile->params) { + if (!sfile->folders_next) + sfile->folders_next = folderlist_new(); + + folderlist_pushdir(sfile->folders_prev, sfile->params->dir); + folderlist_popdir(sfile->folders_next, sfile->params->dir); + + // update folder_prev so we can check for it in folderlist_clear_next() + folderlist_pushdir(sfile->folders_prev, sfile->params->dir); + + file_change_dir(sfile); + } + WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + + return OPERATOR_FINISHED; +} void FILE_OT_refresh(struct wmOperatorType *ot) { diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 573aed72728..ab5dac1a727 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -123,6 +123,12 @@ typedef struct FileList ListBase threads; } FileList; +typedef struct FolderList +{ + struct FolderList *next, *prev; + char *foldername; +} FolderList; + #define SPECIAL_IMG_SIZE 48 #define SPECIAL_IMG_ROWS 4 #define SPECIAL_IMG_COLS 4 @@ -354,6 +360,86 @@ void filelist_free_icons() } } +//-----------------FOLDERLIST (previous/next) --------------// +struct ListBase* folderlist_new() +{ + ListBase* p = MEM_callocN( sizeof(ListBase), "folderlist" ); + return p; +} + +void folderlist_popdir(struct ListBase* folderlist, const char *dir) +{ + const char *prev_dir; + struct FolderList *folder; + folder = folderlist->last; + + if(folder){ + // remove the current directory + MEM_freeN(folder->foldername); + BLI_freelinkN(folderlist, folder); + + folder = folderlist->last; + if(folder){ + prev_dir = folder->foldername; + BLI_strncpy(dir, prev_dir, FILE_MAXDIR); + } + } + // delete the folder next or use setdir directly before PREVIOUS OP +} + +void folderlist_pushdir(ListBase* folderlist, const char *dir) +{ + struct FolderList *folder, *previous_folder; + previous_folder = folderlist->last; + + // check if already exists + if(previous_folder){ + if(! strcmp(previous_folder->foldername, dir)){ + return; + } + } + + // create next folder element + folder = (FolderList*)MEM_mallocN(sizeof(FolderList),"FolderList"); + folder->foldername = (char*)MEM_mallocN(sizeof(char)*(strlen(dir)+1), "foldername"); + folder->foldername[0] = '\0'; + + BLI_strncpy(folder->foldername, dir, FILE_MAXDIR); + + // add it to the end of the list + BLI_addtail(folderlist, folder); +} + +int folderlist_clear_next(struct SpaceFile *sfile) +{ + struct FolderList *folder; + + // if there is no folder_next there is nothing we can clear + if (!sfile->folders_next) + return 0; + + // if previous_folder, next_folder or refresh_folder operators are executed it doesn't clear folder_next + folder = sfile->folders_prev->last; + if ((!folder) ||(!strcmp(folder->foldername, sfile->params->dir))) + return 0; + + // eventually clear flist->folders_next + return 1; +} + +void folderlist_free(ListBase* folderlist) +{ + FolderList *folder; + if (folderlist){ + for(folder= folderlist->last; folder; folder= folderlist->last) { + MEM_freeN(folder->foldername); + BLI_freelinkN(folderlist, folder); + } + } + folderlist= NULL; +} + +//------------------FILELIST------------------------// struct FileList* filelist_new() { FileList* p = MEM_callocN( sizeof(FileList), "filelist" ); @@ -375,7 +461,7 @@ void filelist_free(struct FileList* filelist) int i; if (!filelist) { - printf("Attemtping to delete empty filelist.\n"); + printf("Attempting to delete empty filelist.\n"); return; } diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h index e929e028849..0f8db98b7ab 100644 --- a/source/blender/editors/space_file/filelist.h +++ b/source/blender/editors/space_file/filelist.h @@ -38,6 +38,7 @@ extern "C" { #endif struct FileList; +struct FolderList; struct direntry; struct BlendHandle; struct Scene; @@ -70,6 +71,11 @@ int filelist_empty(struct FileList* filelist); void filelist_parent(struct FileList* filelist); void filelist_setfiletypes(struct FileList* filelist, short has_quicktime); +struct ListBase * folderlist_new(); +void folderlist_free(struct ListBase* folderlist); +void folderlist_popdir(struct ListBase* folderlist, const char *dir); +void folderlist_pushdir(struct ListBase* folderlist, const char *dir); +int folderlist_clear_next(struct SpaceFile* sfile); #ifdef __cplusplus } diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index ea42ad80fe6..c42c83eda98 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -84,12 +84,12 @@ FileSelectParams* ED_fileselect_get_params(struct SpaceFile *sfile) { if (!sfile->params) { - ED_fileselect_set_params(sfile, "", "/", 0, FILE_SHORTDISPLAY, 0, FILE_SORT_ALPHA); + ED_fileselect_set_params(sfile, "", NULL, "/", 0, FILE_SHORTDISPLAY, 0, FILE_SORT_ALPHA); } return sfile->params; } -short ED_fileselect_set_params(SpaceFile *sfile, const char *title, const char *path, +short ED_fileselect_set_params(SpaceFile *sfile, const char *title, const char *last_dir, const char *path, short flag, short display, short filter, short sort) { char name[FILE_MAX], dir[FILE_MAX], file[FILE_MAX]; @@ -107,14 +107,19 @@ short ED_fileselect_set_params(SpaceFile *sfile, const char *title, const char * params->sort = sort; BLI_strncpy(params->title, title, sizeof(params->title)); - - BLI_strncpy(name, path, sizeof(name)); - BLI_convertstringcode(name, G.sce); - BLI_split_dirfile(name, dir, file); - BLI_strncpy(params->file, file, sizeof(params->file)); - BLI_strncpy(params->dir, dir, sizeof(params->dir)); - BLI_make_file_string(G.sce, params->dir, dir, ""); /* XXX needed ? - also solve G.sce */ + if(last_dir){ + BLI_strncpy(params->dir, last_dir, sizeof(params->dir)); + } + else { + BLI_strncpy(name, path, sizeof(name)); + BLI_convertstringcode(name, G.sce); + + BLI_split_dirfile(name, dir, file); + BLI_strncpy(params->file, file, sizeof(params->file)); + BLI_strncpy(params->dir, dir, sizeof(params->dir)); + BLI_make_file_string(G.sce, params->dir, dir, ""); /* XXX needed ? - also solve G.sce */ + } return 1; } @@ -279,3 +284,18 @@ FileLayout* ED_fileselect_get_layout(struct SpaceFile *sfile, struct ARegion *ar } return sfile->layout; } + +void file_change_dir(struct SpaceFile *sfile) +{ + if (sfile->params) { + filelist_setdir(sfile->files, sfile->params->dir); + + if(folderlist_clear_next(sfile)) + folderlist_free(sfile->folders_next); + + folderlist_pushdir(sfile->folders_prev, sfile->params->dir); + + filelist_free(sfile->files); + sfile->params->active_file = -1; + } +} diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 9c30a0ed988..3167d2809c9 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -124,6 +124,18 @@ static void file_free(SpaceLink *sl) sfile->files= NULL; } + if(sfile->folders_prev) { + folderlist_free(sfile->folders_prev); + MEM_freeN(sfile->folders_prev); + sfile->folders_prev= NULL; + } + + if(sfile->folders_next) { + folderlist_free(sfile->folders_next); + MEM_freeN(sfile->folders_next); + sfile->folders_next= NULL; + } + if (sfile->params) { if(sfile->params->pupmenu) MEM_freeN(sfile->params->pupmenu); @@ -153,11 +165,15 @@ static SpaceLink *file_duplicate(SpaceLink *sl) sfilen->op = NULL; /* file window doesn't own operators */ sfilen->files = filelist_new(); - + if(sfileo->folders_prev) + sfilen->folders_prev = MEM_dupallocN(sfileo->folders_prev); + + if(sfileo->folders_next) + sfilen->folders_next = MEM_dupallocN(sfileo->folders_next); + if(sfileo->params) { sfilen->params= MEM_dupallocN(sfileo->params); - - filelist_setdir(sfilen->files, sfilen->params->dir); + file_change_dir(sfilen); } if (sfileo->layout) { sfilen->layout= MEM_dupallocN(sfileo->layout); @@ -170,9 +186,11 @@ static void file_refresh(const bContext *C, ScrArea *sa) SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); FileSelectParams *params = ED_fileselect_get_params(sfile); + if (!sfile->folders_prev) + sfile->folders_prev = folderlist_new(); if (!sfile->files) { sfile->files = filelist_new(); - filelist_setdir(sfile->files, params->dir); + file_change_dir(sfile); params->active_file = -1; // added this so it opens nicer (ton) } filelist_hidedot(sfile->files, params->flag & FILE_HIDE_DOT); @@ -295,6 +313,8 @@ void file_operatortypes(void) WM_operatortype_append(FILE_OT_exec); WM_operatortype_append(FILE_OT_cancel); WM_operatortype_append(FILE_OT_parent); + WM_operatortype_append(FILE_OT_previous); + WM_operatortype_append(FILE_OT_next); WM_operatortype_append(FILE_OT_refresh); WM_operatortype_append(FILE_OT_bookmark_toggle); WM_operatortype_append(FILE_OT_add_bookmark); @@ -313,6 +333,8 @@ void file_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "FILE_OT_parent", PKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_add_bookmark", BKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "FILE_OT_hidedot", HKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "FILE_OT_previous", BACKSPACEKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "FILE_OT_next", BACKSPACEKEY, KM_PRESS, KM_SHIFT, 0); /* keys for main area */ keymap= WM_keymap_listbase(wm, "FileMain", SPACE_FILE, 0); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 53dc5ed26e8..796da7e7f5d 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -217,6 +217,9 @@ typedef struct SpaceFile { struct FileList *files; /* holds the list of files to show */ + ListBase* folders_prev; /* holds the list of previous directories to show */ + ListBase* folders_next; /* holds the list of next directories (pushed from previous) to show */ + /* operator that is invoking fileselect op->exec() will be called on the 'Load' button. if operator provides op->cancel(), then this will be invoked diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index e520067b9e5..b5d51ef650b 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -780,7 +780,7 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa case EVT_FILESELECT_FULL_OPEN: { short flag =0; short display =FILE_SHORTDISPLAY; short filter =0; short sort =FILE_SORT_ALPHA; - char *path= RNA_string_get_alloc(handler->op->ptr, "filename", NULL, 0); + char *dir= NULL; char *path= RNA_string_get_alloc(handler->op->ptr, "filename", NULL, 0); if(event->val==EVT_FILESELECT_OPEN) ED_area_newspace(C, handler->op_area, SPACE_FILE); @@ -798,9 +798,11 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa filter = sfile->params->filter; display = sfile->params->display; sort = sfile->params->sort; + dir = sfile->params->dir; } - ED_fileselect_set_params(sfile, handler->op->type->name, path, flag, display, filter, sort); + ED_fileselect_set_params(sfile, handler->op->type->name, dir, path, flag, display, filter, sort); + dir = NULL; MEM_freeN(path); action= WM_HANDLER_BREAK; @@ -1501,4 +1503,3 @@ void wm_event_add_ghostevent(wmWindow *win, int type, void *customdata) break; } } - -- cgit v1.2.3 From a86d20e5a26700beac595bd8aaccb646be0f802c Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 7 Jul 2009 07:29:21 +0000 Subject: NLA SoC: Quick hack - Reversed playback Animations can now be played back in reverse, by clicking on the reversed-playback button in the TimeLine header beside the play button (NEW ICON NEEDED HERE). I'm not sure how well this works with sound, but from what I gather, this can be quite useful for animators to use. --- source/blender/editors/include/ED_screen_types.h | 1 + source/blender/editors/screen/screen_edit.c | 5 ++- source/blender/editors/screen/screen_ops.c | 44 ++++++++++++++++++------ source/blender/editors/space_time/time_header.c | 32 +++++++++++++++-- 4 files changed, 67 insertions(+), 15 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/ED_screen_types.h b/source/blender/editors/include/ED_screen_types.h index 37f2f4f051d..3ea5dfba65c 100644 --- a/source/blender/editors/include/ED_screen_types.h +++ b/source/blender/editors/include/ED_screen_types.h @@ -33,6 +33,7 @@ typedef struct ScreenAnimData { ARegion *ar; /* do not read from this, only for comparing if region exists */ int redraws; + int reverse; } ScreenAnimData; diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 4e08310240c..6da00f12a25 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1460,7 +1460,9 @@ void ED_screen_full_prevspace(bContext *C) ed_screen_fullarea(C, sa); } -/* redraws: uses defines from stime->redraws */ +/* redraws: uses defines from stime->redraws + * enable: 1 - forward on, -1 - backwards on, 0 - off + */ void ED_screen_animation_timer(bContext *C, int redraws, int enable) { bScreen *screen= CTX_wm_screen(C); @@ -1477,6 +1479,7 @@ void ED_screen_animation_timer(bContext *C, int redraws, int enable) screen->animtimer= WM_event_add_window_timer(win, TIMER0, (1.0/FPS)); sad->ar= CTX_wm_region(C); sad->redraws= redraws; + sad->reverse= (enable < 0); screen->animtimer->customdata= sad; } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 5bf090e459b..80526dbdb6e 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2067,19 +2067,40 @@ static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event) if(scene->audio.flag & AUDIO_SYNC) { int step = floor(wt->duration * FPS); - scene->r.cfra += step; + if (sad->reverse) // XXX does this option work with audio? + scene->r.cfra -= step; + else + scene->r.cfra += step; wt->duration -= ((float)step)/FPS; } - else - scene->r.cfra++; + else { + if (sad->reverse) + scene->r.cfra--; + else + scene->r.cfra++; + } - if (scene->r.psfra) { - if(scene->r.cfra > scene->r.pefra) - scene->r.cfra= scene->r.psfra; + if (sad->reverse) { + /* jump back to end */ + if (scene->r.psfra) { + if(scene->r.cfra < scene->r.psfra) + scene->r.cfra= scene->r.pefra; + } + else { + if(scene->r.cfra < scene->r.sfra) + scene->r.cfra= scene->r.efra; + } } else { - if(scene->r.cfra > scene->r.efra) - scene->r.cfra= scene->r.sfra; + /* jump back to start */ + if (scene->r.psfra) { + if(scene->r.cfra > scene->r.pefra) + scene->r.cfra= scene->r.psfra; + } + else { + if(scene->r.cfra > scene->r.efra) + scene->r.cfra= scene->r.sfra; + } } /* since we follow drawflags, we can't send notifier but tag regions ourselves */ @@ -2127,8 +2148,9 @@ static int screen_animation_play(bContext *C, wmOperator *op, wmEvent *event) ED_screen_animation_timer(C, 0, 0); } else { - /* todo: RNA properties to define play types */ - ED_screen_animation_timer(C, TIME_REGION|TIME_ALL_3D_WIN, 1); + int mode= (RNA_boolean_get(op->ptr, "reverse")) ? -1 : 1; + + ED_screen_animation_timer(C, TIME_REGION|TIME_ALL_3D_WIN, mode); if(screen->animtimer) { wmTimer *wt= screen->animtimer; @@ -2152,7 +2174,7 @@ void SCREEN_OT_animation_play(wmOperatorType *ot) ot->poll= ED_operator_screenactive; - + RNA_def_boolean(ot->srna, "reverse", 0, "Play in Reverse", "Animation is played backwards"); } /* ************** border select operator (template) ***************************** */ diff --git a/source/blender/editors/space_time/time_header.c b/source/blender/editors/space_time/time_header.c index da99849e594..9ffce53e572 100644 --- a/source/blender/editors/space_time/time_header.c +++ b/source/blender/editors/space_time/time_header.c @@ -373,6 +373,7 @@ static uiBlock *time_framemenu(bContext *C, ARegion *ar, void *arg_unused) #define B_REDRAWALL 750 #define B_TL_REW 751 #define B_TL_PLAY 752 +#define B_TL_RPLAY 760 #define B_TL_FF 753 #define B_TL_PREVKEY 754 #define B_TL_NEXTKEY 755 @@ -415,6 +416,18 @@ void do_time_buttons(bContext *C, void *arg, int event) sad->ar= time_top_left_3dwindow(screen); } + break; + case B_TL_RPLAY: + ED_screen_animation_timer(C, stime->redraws, -1); + + /* update region if TIME_REGION was set, to leftmost 3d window */ + if(screen->animtimer && (stime->redraws & TIME_REGION)) { + wmTimer *wt= screen->animtimer; + ScreenAnimData *sad= wt->customdata; + + sad->ar= time_top_left_3dwindow(screen); + } + break; case B_TL_STOP: ED_screen_animation_timer(C, 0, 0); @@ -553,14 +566,27 @@ void time_header_buttons(const bContext *C, ARegion *ar) xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Skip to previous keyframe (Ctrl PageDown)"); xco+= XIC+4; - if(CTX_wm_screen(C)->animtimer) + if(CTX_wm_screen(C)->animtimer) { + /* pause button is drawn centered between the two other buttons for now (saves drawing 2 buttons, or having position changes) */ + xco+= XIC/2 + 2; + uiDefIconBut(block, BUT, B_TL_STOP, ICON_PAUSE, xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Stop Playing Timeline"); - else + + xco+= XIC/2 + 2; + } + else { + // FIXME: the icon for this is crap + uiDefIconBut(block, BUT, B_TL_RPLAY, ICON_REW/*ICON_PLAY*/, + xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Play Timeline in Reverse"); + + xco+= XIC+4; + uiDefIconBut(block, BUT, B_TL_PLAY, ICON_PLAY, xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Play Timeline "); - + } xco+= XIC+4; + uiDefIconBut(block, BUT, B_TL_NEXTKEY, ICON_NEXT_KEYFRAME, xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Skip to next keyframe (Ctrl PageUp)"); xco+= XIC+4; -- cgit v1.2.3 From e22fefc2c8ef2c844d32d9aed23a04013cc364fb Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 7 Jul 2009 10:25:55 +0000 Subject: NLA SoC: Fixed bug with NLA-Transform Strip-sorting code was buggy, as it was trying to access an invalid pointer, so the call to sort strips after transform was temporarily disabled in previous commits. --- source/blender/blenkernel/intern/nla.c | 12 +++++++----- source/blender/editors/transform/transform_conversions.c | 3 +-- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 851a0d7b549..4dce9aebe24 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -546,26 +546,28 @@ short BKE_nlastrips_has_space (ListBase *strips, float start, float end) void BKE_nlastrips_sort_strips (ListBase *strips) { ListBase tmp = {NULL, NULL}; - NlaStrip *strip, *sstrip; + NlaStrip *strip, *sstrip, *stripn; /* sanity checks */ if ELEM(NULL, strips, strips->first) return; - + /* we simply perform insertion sort on this list, since it is assumed that per track, * there are only likely to be at most 5-10 strips */ - for (strip= strips->first; strip; strip= strip->next) { + for (strip= strips->first; strip; strip= stripn) { short not_added = 1; + stripn= strip->next; + /* remove this strip from the list, and add it to the new list, searching from the end of * the list, assuming that the lists are in order */ BLI_remlink(strips, strip); - for (sstrip= tmp.last; not_added && sstrip; sstrip= sstrip->prev) { + for (sstrip= tmp.last; sstrip; sstrip= sstrip->prev) { /* check if add after */ - if (sstrip->end < strip->start) { + if (sstrip->end <= strip->start) { BLI_insertlinkafter(&tmp, sstrip, strip); not_added= 0; break; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 53c8e08ee74..0d19eeb913e 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4836,8 +4836,7 @@ void special_aftertrans_update(TransInfo *t) NlaTrack *nlt= (NlaTrack *)ale->data; /* make sure strips are in order again */ - // FIXME: this is buggy - //BKE_nlatrack_sort_strips(nlt); + BKE_nlatrack_sort_strips(nlt); /* remove the temp metas */ BKE_nlastrips_clear_metas(&nlt->strips, 0, 1); -- cgit v1.2.3 From d1677e36b663f077312050ac46cea0de1b1212c2 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 7 Jul 2009 11:37:33 +0000 Subject: NLA SoC: Recoded way that Meta-Strips are Evaluated Previously, the quick-hack I coded for Meta-strips evaluation didn't really take into account the possibilities to use Meta-Strips as strips in their own right - i.e. reversed, muted, time-mapping-curves, influence-blending - were all unavailable. This commit makes the aforementioned capabilities of other strips available for Meta-Strips too. The evaluation is now kind-of recursive (as with most of the other methods which take them into account) so that each 'level' of strips get evaluated correctly within their frame-of-reference. TODO: * F-Modifier support for Metas... --- source/blender/blenkernel/intern/anim_sys.c | 158 ++++++++++++++++------------ source/blender/blenkernel/intern/nla.c | 2 +- source/blender/blenkernel/nla_private.h | 6 ++ 3 files changed, 97 insertions(+), 69 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 1d10744ac80..0aadb1825ad 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -627,11 +627,12 @@ static void nlastrip_evaluate_controls (NlaStrip *strip, float ctime) } } - -/* gets the strip active at the current time for a given list of strips */ -static NlaStrip *ctime_get_strip (ListBase *strips, short *side, float ctime) +/* gets the strip active at the current time for a list of strips for evaluation purposes */ +NlaEvalStrip *nlastrips_ctime_get_strip (ListBase *list, ListBase *strips, short index, float ctime) { NlaStrip *strip, *estrip=NULL; + NlaEvalStrip *nes; + short side= 0; /* loop over strips, checking if they fall within the range */ for (strip= strips->first; strip; strip= strip->next) { @@ -651,7 +652,7 @@ static NlaStrip *ctime_get_strip (ListBase *strips, short *side, float ctime) estrip= strip; /* side is 'before' regardless of whether there's a useful strip */ - *side= NES_TIME_BEFORE; + side= NES_TIME_BEFORE; } else { /* before next strip - previous strip has ended, but next hasn't begun, @@ -663,7 +664,7 @@ static NlaStrip *ctime_get_strip (ListBase *strips, short *side, float ctime) if (strip->extendmode != NLASTRIP_EXTEND_NOTHING) estrip= strip; - *side= NES_TIME_AFTER; + side= NES_TIME_AFTER; } break; } @@ -675,7 +676,7 @@ static NlaStrip *ctime_get_strip (ListBase *strips, short *side, float ctime) if (strip->extendmode != NLASTRIP_EXTEND_NOTHING) estrip= strip; - *side= NES_TIME_AFTER; + side= NES_TIME_AFTER; break; } @@ -683,40 +684,11 @@ static NlaStrip *ctime_get_strip (ListBase *strips, short *side, float ctime) } } - /* return the matching strip found */ - return estrip; -} - -/* gets the strip active at the current time for a track for evaluation purposes */ -static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index, float ctime) -{ - ListBase *strips= &nlt->strips; - NlaStrip *strip, *estrip=NULL; - NlaEvalStrip *nes; - short side= 0; - - /* keep looping over hierarchy of strips until one which fits for the current time is found */ - while (strips->first) { - /* try to get the strip at this frame for this strip */ - strip= ctime_get_strip(strips, &side, ctime); - - /* if a strip was found, make this the new estrip, otherwise, stop trying */ - if (strip) { - /* set new estrip */ - estrip= strip; - - /* check children (only available if this is a meta-strip) for better match */ - strips= &strip->strips; - } - else - break; - } - /* check if a valid strip was found * - must not be muted (i.e. will have contribution */ if ((estrip == NULL) || (estrip->flag & NLASTRIP_FLAG_MUTED)) - return; + return NULL; /* if ctime was not within the boundaries of the strip, clamp! */ switch (side) { @@ -734,8 +706,8 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index */ // TODO: this sounds a bit hacky having a few isolated F-Curves stuck on some data it operates on... nlastrip_evaluate_controls(estrip, ctime); - if (estrip->influence <= 0.0f) // XXX is it useful to invert the strip? - return; + if (estrip->influence <= 0.0f) + return NULL; /* check if strip has valid data to evaluate, * and/or perform any additional type-specific actions @@ -744,12 +716,12 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index case NLASTRIP_TYPE_CLIP: /* clip must have some action to evaluate */ if (estrip->act == NULL) - return; + return NULL; break; case NLASTRIP_TYPE_TRANSITION: /* there must be strips to transition from and to (i.e. prev and next required) */ if (ELEM(NULL, estrip->prev, estrip->next)) - return; + return NULL; /* evaluate controls for the relevant extents of the bordering strips... */ nlastrip_evaluate_controls(estrip->prev, estrip->start); @@ -760,13 +732,15 @@ static void nlatrack_ctime_get_strip (ListBase *list, NlaTrack *nlt, short index /* add to list of strips we need to evaluate */ nes= MEM_callocN(sizeof(NlaEvalStrip), "NlaEvalStrip"); - nes->track= nlt; nes->strip= estrip; nes->strip_mode= side; nes->track_index= index; nes->strip_time= estrip->strip_time; - BLI_addtail(list, nes); + if (list) + BLI_addtail(list, nes); + + return nes; } /* ---------------------- */ @@ -897,6 +871,38 @@ static void nlaevalchan_accumulate (NlaEvalChannel *nec, NlaEvalStrip *nes, shor } } +/* accumulate the results of a temporary buffer with the results of the full-buffer */ +static void nlaevalchan_buffers_accumulate (ListBase *channels, ListBase *tmp_buffer, NlaEvalStrip *nes) +{ + NlaEvalChannel *nec, *necn, *necd; + + /* optimise - abort if no channels */ + if (tmp_buffer->first == NULL) + return; + + /* accumulate results in tmp_channels buffer to the accumulation buffer */ + for (nec= tmp_buffer->first; nec; nec= necn) { + /* get pointer to next channel in case we remove the current channel from the temp-buffer */ + necn= nec->next; + + /* try to find an existing matching channel for this setting in the accumulation buffer */ + necd= nlaevalchan_find_match(channels, &nec->ptr, nec->prop, nec->index); + + /* if there was a matching channel already in the buffer, accumulate to it, + * otherwise, add the current channel to the buffer for efficiency + */ + if (necd) + nlaevalchan_accumulate(necd, nes, 0, nec->value); + else { + BLI_remlink(tmp_buffer, nec); + BLI_addtail(channels, nec); + } + } + + /* free temp-channels that haven't been assimilated into the buffer */ + BLI_freelistN(tmp_buffer); +} + /* ---------------------- */ /* evaluate action-clip strip */ @@ -945,7 +951,6 @@ static void nlastrip_evaluate_actionclip (PointerRNA *ptr, ListBase *channels, N static void nlastrip_evaluate_transition (PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes) { ListBase tmp_channels = {NULL, NULL}; - NlaEvalChannel *nec, *necn, *necd; NlaEvalStrip tmp_nes; NlaStrip *s1, *s2; @@ -986,38 +991,51 @@ static void nlastrip_evaluate_transition (PointerRNA *ptr, ListBase *channels, N nlastrip_evaluate_actionclip(ptr, &tmp_channels, &tmp_nes); - /* optimise - abort if no channels */ - if (tmp_channels.first == NULL) - return; + /* assumulate temp-buffer and full-buffer, using the 'real' strip */ + nlaevalchan_buffers_accumulate(channels, &tmp_channels, nes); +} + +/* evaluate meta-strip */ +static void nlastrip_evaluate_meta (PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes) +{ + ListBase tmp_channels = {NULL, NULL}; + NlaStrip *strip= nes->strip; + NlaEvalStrip *tmp_nes; + float evaltime; + /* meta-strip was calculated normally to have some time to be evaluated at + * and here we 'look inside' the meta strip, treating it as a decorated window to + * it's child strips, which get evaluated as if they were some tracks on a strip + * (but with some extra modifiers to apply). + * + * NOTE: keep this in sync with animsys_evaluate_nla() + */ - /* accumulate results in tmp_channels buffer to the accumulation buffer */ - for (nec= tmp_channels.first; nec; nec= necn) { - /* get pointer to next channel in case we remove the current channel from the temp-buffer */ - necn= nec->next; - - /* try to find an existing matching channel for this setting in the accumulation buffer */ - necd= nlaevalchan_find_match(channels, &nec->ptr, nec->prop, nec->index); + /* find the child-strip to evaluate */ + evaltime= (nes->strip_time * (strip->end - strip->start)) + strip->start; + tmp_nes= nlastrips_ctime_get_strip(NULL, &strip->strips, -1, evaltime); + if (tmp_nes == NULL) + return; - /* if there was a matching channel already in the buffer, accumulate to it, - * otherwise, add the current channel to the buffer for efficiency - */ - if (necd) - nlaevalchan_accumulate(necd, nes, 0, nec->value); - else { - BLI_remlink(&tmp_channels, nec); - BLI_addtail(channels, nec); - } - } + /* evaluate child-strip into tmp_channels buffer before accumulating + * in the accumulation buffer + */ + // TODO: need to supply overriding modifiers which will get applied over the top of these + nlastrip_evaluate(ptr, &tmp_channels, tmp_nes); - /* free temp-channels that haven't been assimilated into the buffer */ - BLI_freelistN(&tmp_channels); + /* assumulate temp-buffer and full-buffer, using the 'real' strip */ + nlaevalchan_buffers_accumulate(channels, &tmp_channels, nes); + + /* free temp eval-strip */ + MEM_freeN(tmp_nes); } + /* evaluates the given evaluation strip */ -static void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes) +void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes) { /* actions to take depend on the type of strip */ + // TODO: add 'modifiers' tag to chain switch (nes->strip->type) { case NLASTRIP_TYPE_CLIP: /* action-clip */ nlastrip_evaluate_actionclip(ptr, channels, nes); @@ -1025,11 +1043,14 @@ static void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, NlaEvalStrip case NLASTRIP_TYPE_TRANSITION: /* transition */ nlastrip_evaluate_transition(ptr, channels, nes); break; + case NLASTRIP_TYPE_META: /* meta */ + nlastrip_evaluate_meta(ptr, channels, nes); + break; } } /* write the accumulated settings to */ -static void nladata_flush_channels (ListBase *channels) +void nladata_flush_channels (ListBase *channels) { NlaEvalChannel *nec; @@ -1104,7 +1125,8 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime) continue; /* otherwise, get strip to evaluate for this channel */ - nlatrack_ctime_get_strip(&estrips, nlt, track_index, ctime); + nes= nlastrips_ctime_get_strip(&estrips, &nlt->strips, track_index, ctime); + if (nes) nes->track= nlt; } /* only continue if there are strips to evaluate */ diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 4dce9aebe24..511623f46fc 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -452,7 +452,7 @@ static float nlastrip_get_frame_transition (NlaStrip *strip, float cframe, short float nlastrip_get_frame (NlaStrip *strip, float cframe, short mode) { switch (strip->type) { - case NLASTRIP_TYPE_META: /* meta (is just a container for other strips, so shouldn't use the action-clip method) */ + case NLASTRIP_TYPE_META: /* meta - for now, does the same as transition (is really just an empty container) */ case NLASTRIP_TYPE_TRANSITION: /* transition */ return nlastrip_get_frame_transition(strip, cframe, mode); diff --git a/source/blender/blenkernel/nla_private.h b/source/blender/blenkernel/nla_private.h index 1514a79f03b..016eaedfe4c 100644 --- a/source/blender/blenkernel/nla_private.h +++ b/source/blender/blenkernel/nla_private.h @@ -75,5 +75,11 @@ typedef struct NlaEvalChannel { /* convert from strip time <-> global time */ float nlastrip_get_frame(NlaStrip *strip, float cframe, short mode); +/* --------------- NLA Evaluation (very-private stuff) ----------------------- */ +/* these functions are only defined here to avoid problems with the order in which they get defined... */ + +NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list, ListBase *strips, short index, float ctime); +void nlastrip_evaluate(PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes); +void nladata_flush_channels(ListBase *channels); #endif // NLA_PRIVATE -- cgit v1.2.3 From f8c344bd17e09f21b5f022f65016fc13a7aa1d69 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 7 Jul 2009 12:17:06 +0000 Subject: NLA SoC: Meta Strips + F-Modifiers F-Modifiers now work on 'all' types of NLA Strip. To get them working on Meta-strips, F-Modifiers on the Meta strip must be applied on top of those for child strips. For now, this is done by joining the lists of modifiers, and evaluating the joined list. Currently, Transitions don't work that great with F-Modifiers yet (only the endpoints get evaluated with the F-Modifiers). Solving this is for another time... --- source/blender/blenkernel/intern/anim_sys.c | 106 +++++++++++++++++++++++----- source/blender/blenkernel/nla_private.h | 2 +- 2 files changed, 91 insertions(+), 17 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 0aadb1825ad..1037b2fd15d 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -903,17 +903,76 @@ static void nlaevalchan_buffers_accumulate (ListBase *channels, ListBase *tmp_bu BLI_freelistN(tmp_buffer); } +/* ---------------------- */ +/* F-Modifier stack joining/separation utilities - should we generalise these for BLI_listbase.h interface? */ + +/* Temporarily join two lists of modifiers together, storing the result in a third list */ +static void nlaeval_fmodifiers_join_stacks (ListBase *result, ListBase *list1, ListBase *list2) +{ + FModifier *fcm1, *fcm2; + + /* if list1 is invalid... */ + if ELEM(NULL, list1, list1->first) { + if (list2 && list2->first) { + result->first= list2->first; + result->last= list2->last; + } + } + /* if list 2 is invalid... */ + else if ELEM(NULL, list2, list2->first) { + result->first= list1->first; + result->last= list1->last; + } + else { + /* list1 should be added first, and list2 second, with the endpoints of these being the endpoints for result + * - the original lists must be left unchanged though, as we need that fact for restoring + */ + result->first= list1->first; + result->last= list2->last; + + fcm1= list1->last; + fcm2= list2->first; + + fcm1->next= fcm2; + fcm2->prev= fcm1; + } +} + +/* Split two temporary lists of modifiers */ +static void nlaeval_fmodifiers_split_stacks (ListBase *list1, ListBase *list2) +{ + FModifier *fcm1, *fcm2; + + /* if list1/2 is invalid... just skip */ + if ELEM(NULL, list1, list2) + return; + if ELEM(NULL, list1->first, list2->first) + return; + + /* get endpoints */ + fcm1= list1->last; + fcm2= list2->first; + + /* clear their links */ + fcm1->next= NULL; + fcm2->prev= NULL; +} + /* ---------------------- */ /* evaluate action-clip strip */ -static void nlastrip_evaluate_actionclip (PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes) +static void nlastrip_evaluate_actionclip (PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes) { + ListBase tmp_modifiers = {NULL, NULL}; NlaStrip *strip= nes->strip; FCurve *fcu; float evaltime; + /* join this strip's modifiers to the parent's modifiers (own modifiers first) */ + nlaeval_fmodifiers_join_stacks(&tmp_modifiers, &strip->modifiers, modifiers); + /* evaluate strip's modifiers which modify time to evaluate the base curves at */ - evaltime= evaluate_time_fmodifiers(&strip->modifiers, NULL, 0.0f, strip->strip_time); + evaltime= evaluate_time_fmodifiers(&tmp_modifiers, NULL, 0.0f, strip->strip_time); /* evaluate all the F-Curves in the action, saving the relevant pointers to data that will need to be used */ for (fcu= strip->act->curves.first; fcu; fcu= fcu->next) { @@ -935,7 +994,7 @@ static void nlastrip_evaluate_actionclip (PointerRNA *ptr, ListBase *channels, N /* apply strip's F-Curve Modifiers on this value * NOTE: we apply the strip's original evaluation time not the modified one (as per standard F-Curve eval) */ - evaluate_value_fmodifiers(&strip->modifiers, fcu, &value, strip->strip_time); + evaluate_value_fmodifiers(&tmp_modifiers, fcu, &value, strip->strip_time); /* get an NLA evaluation channel to work with, and accumulate the evaluated value with the value(s) @@ -945,15 +1004,22 @@ static void nlastrip_evaluate_actionclip (PointerRNA *ptr, ListBase *channels, N if (nec) nlaevalchan_accumulate(nec, nes, newChan, value); } + + /* unlink this strip's modifiers from the parent's modifiers again */ + nlaeval_fmodifiers_split_stacks(&strip->modifiers, modifiers); } /* evaluate transition strip */ -static void nlastrip_evaluate_transition (PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes) +static void nlastrip_evaluate_transition (PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes) { ListBase tmp_channels = {NULL, NULL}; + ListBase tmp_modifiers = {NULL, NULL}; NlaEvalStrip tmp_nes; NlaStrip *s1, *s2; + /* join this strip's modifiers to the parent's modifiers (own modifiers first) */ + nlaeval_fmodifiers_join_stacks(&tmp_modifiers, &nes->strip->modifiers, modifiers); + /* get the two strips to operate on * - we use the endpoints of the strips directly flanking our strip * using these as the endpoints of the transition (destination and source) @@ -980,25 +1046,30 @@ static void nlastrip_evaluate_transition (PointerRNA *ptr, ListBase *channels, N tmp_nes= *nes; /* evaluate these strips into a temp-buffer (tmp_channels) */ + // FIXME: modifier evalation here needs some work... /* first strip */ tmp_nes.strip_mode= NES_TIME_TRANSITION_START; tmp_nes.strip= s1; - nlastrip_evaluate_actionclip(ptr, &tmp_channels, &tmp_nes); + nlastrip_evaluate_actionclip(ptr, &tmp_channels, &tmp_modifiers, &tmp_nes); /* second strip */ tmp_nes.strip_mode= NES_TIME_TRANSITION_END; tmp_nes.strip= s2; - nlastrip_evaluate_actionclip(ptr, &tmp_channels, &tmp_nes); + nlastrip_evaluate_actionclip(ptr, &tmp_channels, &tmp_modifiers, &tmp_nes); /* assumulate temp-buffer and full-buffer, using the 'real' strip */ nlaevalchan_buffers_accumulate(channels, &tmp_channels, nes); + + /* unlink this strip's modifiers from the parent's modifiers again */ + nlaeval_fmodifiers_split_stacks(&nes->strip->modifiers, modifiers); } /* evaluate meta-strip */ -static void nlastrip_evaluate_meta (PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes) +static void nlastrip_evaluate_meta (PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes) { ListBase tmp_channels = {NULL, NULL}; + ListBase tmp_modifiers = {NULL, NULL}; NlaStrip *strip= nes->strip; NlaEvalStrip *tmp_nes; float evaltime; @@ -1010,6 +1081,9 @@ static void nlastrip_evaluate_meta (PointerRNA *ptr, ListBase *channels, NlaEval * * NOTE: keep this in sync with animsys_evaluate_nla() */ + + /* join this strip's modifiers to the parent's modifiers (own modifiers first) */ + nlaeval_fmodifiers_join_stacks(&tmp_modifiers, &strip->modifiers, modifiers); /* find the child-strip to evaluate */ evaltime= (nes->strip_time * (strip->end - strip->start)) + strip->start; @@ -1020,31 +1094,31 @@ static void nlastrip_evaluate_meta (PointerRNA *ptr, ListBase *channels, NlaEval /* evaluate child-strip into tmp_channels buffer before accumulating * in the accumulation buffer */ - // TODO: need to supply overriding modifiers which will get applied over the top of these - nlastrip_evaluate(ptr, &tmp_channels, tmp_nes); + nlastrip_evaluate(ptr, &tmp_channels, &tmp_modifiers, tmp_nes); /* assumulate temp-buffer and full-buffer, using the 'real' strip */ nlaevalchan_buffers_accumulate(channels, &tmp_channels, nes); /* free temp eval-strip */ MEM_freeN(tmp_nes); + + /* unlink this strip's modifiers from the parent's modifiers again */ + nlaeval_fmodifiers_split_stacks(&strip->modifiers, modifiers); } - /* evaluates the given evaluation strip */ -void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes) +void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes) { /* actions to take depend on the type of strip */ - // TODO: add 'modifiers' tag to chain switch (nes->strip->type) { case NLASTRIP_TYPE_CLIP: /* action-clip */ - nlastrip_evaluate_actionclip(ptr, channels, nes); + nlastrip_evaluate_actionclip(ptr, channels, modifiers, nes); break; case NLASTRIP_TYPE_TRANSITION: /* transition */ - nlastrip_evaluate_transition(ptr, channels, nes); + nlastrip_evaluate_transition(ptr, channels, modifiers, nes); break; case NLASTRIP_TYPE_META: /* meta */ - nlastrip_evaluate_meta(ptr, channels, nes); + nlastrip_evaluate_meta(ptr, channels, modifiers, nes); break; } } @@ -1136,7 +1210,7 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime) /* 2. for each strip, evaluate then accumulate on top of existing channels, but don't set values yet */ for (nes= estrips.first; nes; nes= nes->next) - nlastrip_evaluate(ptr, &echannels, nes); + nlastrip_evaluate(ptr, &echannels, NULL, nes); /* 3. flush effects of accumulating channels in NLA to the actual data they affect */ nladata_flush_channels(&echannels); diff --git a/source/blender/blenkernel/nla_private.h b/source/blender/blenkernel/nla_private.h index 016eaedfe4c..df7ffaa3064 100644 --- a/source/blender/blenkernel/nla_private.h +++ b/source/blender/blenkernel/nla_private.h @@ -79,7 +79,7 @@ float nlastrip_get_frame(NlaStrip *strip, float cframe, short mode); /* these functions are only defined here to avoid problems with the order in which they get defined... */ NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list, ListBase *strips, short index, float ctime); -void nlastrip_evaluate(PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes); +void nlastrip_evaluate(PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes); void nladata_flush_channels(ListBase *channels); #endif // NLA_PRIVATE -- cgit v1.2.3 From d896ed98fef159e2f67364dcceab7011791618e6 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 7 Jul 2009 17:30:39 +0000 Subject: 2.5 - Scrollers now only disappear for regions with a fixed total view, like lists, buttons, channels. More or less infinite views keep scrollers to indicate that you can still pan or zoom further. - Nodes: put back SHIFT+D "Add duplicate" (Also fixed duplicate objects menu name... it should be a bit more descriptive) --- source/blender/editors/interface/view2d.c | 12 ++++--- source/blender/editors/object/object_edit.c | 4 +-- source/blender/editors/space_node/node_edit.c | 43 +++++++++++++++++++++++-- source/blender/editors/space_node/node_intern.h | 1 + source/blender/editors/space_node/node_ops.c | 4 +++ 5 files changed, 55 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 11714df0491..fcac1987fdc 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1279,8 +1279,10 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short if (scrollers->hor_min > scrollers->hor_max) scrollers->hor_min= scrollers->hor_max; - if(fac1 <= 0.0f && fac2 >= 1.0f) - scrollers->horfull= 1; + /* check whether sliders can disappear */ + if(v2d->keeptot) + if(fac1 <= 0.0f && fac2 >= 1.0f) + scrollers->horfull= 1; } /* vertical scrollers */ @@ -1304,8 +1306,10 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short if (scrollers->vert_min > scrollers->vert_max) scrollers->vert_min= scrollers->vert_max; - if(fac1 <= 0.0f && fac2 >= 1.0f) - scrollers->vertfull= 1; + /* check whether sliders can disappear */ + if(v2d->keeptot) + if(fac1 <= 0.0f && fac2 >= 1.0f) + scrollers->vertfull= 1; } /* grid markings on scrollbars */ diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index c28200612ea..af6cb887e71 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -6139,8 +6139,8 @@ void OBJECT_OT_duplicate_add(wmOperatorType *ot) { /* identifiers */ - ot->name= "Add Duplicate"; - ot->description = "Duplicate the object."; + ot->name= "Duplicate Objects"; + ot->description = "Duplicate the objects."; ot->idname= "OBJECT_OT_duplicate_add"; /* api callbacks */ diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index f7f637670b5..0d6fc20c248 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -63,6 +63,7 @@ #include "ED_previewrender.h" #include "BIF_gl.h" +#include "BIF_transform.h" #include "BLI_arithb.h" #include "BLI_blenlib.h" @@ -1686,18 +1687,54 @@ void node_mute(SpaceNode *snode) } -void node_adduplicate(SpaceNode *snode) +#endif + +int node_duplicate_add_exec(bContext *C, wmOperator *op) { + SpaceNode *snode= (SpaceNode*)CTX_wm_space_data(C); ntreeCopyTree(snode->edittree, 1); /* 1 == internally selected nodes */ ntreeSolveOrder(snode->edittree); snode_verify_groups(snode); - // XXX snode_handle_recalc(snode); + snode_handle_recalc(C, snode); + + return OPERATOR_FINISHED; +} + +static int node_duplicate_add_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + node_duplicate_add_exec(C, op); + + RNA_int_set(op->ptr, "mode", TFM_TRANSLATION); + WM_operator_name_call(C, "TFM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr); + + return OPERATOR_FINISHED; +} -// XXX transform_nodes(snode->edittree, 'g', "Duplicate"); +void NODE_OT_duplicate_add(wmOperatorType *ot) +{ + + /* identifiers */ + ot->name= "Duplicate Nodes"; + ot->description = "Duplicate the nodes."; + ot->idname= "NODE_OT_duplicate_add"; + + /* api callbacks */ + ot->invoke= node_duplicate_add_invoke; + ot->exec= node_duplicate_add_exec; + + ot->poll= ED_operator_node_active; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* to give to transform */ + RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); } +#if 0 + static void node_insert_convertor(SpaceNode *snode, bNodeLink *link) { bNode *newnode= NULL; diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index b73f57f935f..b16971dab9e 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -82,6 +82,7 @@ void snode_composite_job(const struct bContext *C, ScrArea *sa); bNode *snode_get_editgroup(SpaceNode *snode); void snode_autoconnect(SpaceNode *snode, bNode *node_to, int flag); +void NODE_OT_duplicate_add(struct wmOperatorType *ot); void NODE_OT_link(struct wmOperatorType *ot); void NODE_OT_delete(struct wmOperatorType *ot); void NODE_OT_resize(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c index 7a1cc24fa58..732b45f1f30 100644 --- a/source/blender/editors/space_node/node_ops.c +++ b/source/blender/editors/space_node/node_ops.c @@ -59,6 +59,8 @@ void node_operatortypes(void) WM_operatortype_append(NODE_OT_link); WM_operatortype_append(NODE_OT_resize); WM_operatortype_append(NODE_OT_links_cut); + WM_operatortype_append(NODE_OT_duplicate_add); + } void node_keymap(struct wmWindowManager *wm) @@ -71,6 +73,8 @@ void node_keymap(struct wmWindowManager *wm) RNA_enum_set(WM_keymap_add_item(keymap, "NODE_OT_select_extend", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "select_type", NODE_SELECT_MOUSE); RNA_enum_set(WM_keymap_add_item(keymap, "NODE_OT_select_extend", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "select_type", NODE_SELECT_MOUSE); + WM_keymap_add_item(keymap, "NODE_OT_duplicate_add", DKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "NODE_OT_link", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "NODE_OT_resize", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "NODE_OT_visibility_toggle", LEFTMOUSE, KM_PRESS, 0, 0); -- cgit v1.2.3 From 823bf891a113cc0d1893706cf374aceec2715b8f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 7 Jul 2009 23:33:39 +0000 Subject: NLA SoC: Clarifying the error message for adding transitions NOTE: transition strips can only be added between two selected action-clips that have a gap (but no other strips) between them, and are in the same track. --- source/blender/editors/space_nla/nla_edit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index d663b76d5fe..0198a66949e 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -432,7 +432,7 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } else { - BKE_report(op->reports, RPT_ERROR, "Needs at least a pair of adjacent selected strips."); + BKE_report(op->reports, RPT_ERROR, "Needs at least a pair of adjacent selected strips with a gap between them."); return OPERATOR_CANCELLED; } } -- cgit v1.2.3 From be5293d3ad38ba5f9f32ac8585d012bc44a9e684 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 8 Jul 2009 05:00:10 +0000 Subject: NLA SoC: Influence/Time properties for strips can now be animated * These settings can now be edited + keyframed (using IKEY over the button only for now... other cases will fail) * Reshuffled some of the keyframing code to make this sort of thing easier to do. Also, restored corrections for NLA-mapping when inserting/removing keyframes. TODOS: * animation editors don't show these keyframes yet * the buttons don't change colour yet to reflect this state. How to do this efficiently? * allow keyframing of these in more places * more robust UI handling for this. --- source/blender/blenkernel/BKE_nla.h | 4 + source/blender/blenkernel/intern/nla.c | 52 ++++++ source/blender/editors/animation/keyframing.c | 237 +++++++++++++++---------- source/blender/editors/include/ED_keyframing.h | 13 ++ source/blender/editors/space_nla/nla_buttons.c | 17 +- source/blender/makesrna/intern/rna_nla.c | 36 +++- 6 files changed, 255 insertions(+), 104 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 5cb967c9c59..7fdff7e41f7 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -80,8 +80,12 @@ short BKE_nlatrack_add_strip(struct NlaTrack *nlt, struct NlaStrip *strip); /* ............ */ struct NlaStrip *BKE_nlastrip_find_active(struct NlaTrack *nlt); + short BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max); +void BKE_nlastrip_validate_fcurves(struct NlaStrip *strip); + +/* ............ */ void BKE_nla_action_pushdown(struct AnimData *adt); diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 511623f46fc..217444d16d2 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1049,6 +1049,58 @@ short nlastrip_is_first (AnimData *adt, NlaStrip *strip) /* should be first now */ return 1; } + +/* Validate the NLA-Strips 'control' F-Curves based on the flags set*/ +void BKE_nlastrip_validate_fcurves (NlaStrip *strip) +{ + FCurve *fcu; + + /* sanity checks */ + if (strip == NULL) + return; + + /* if controlling influence... */ + if (strip->flag & NLASTRIP_FLAG_USR_INFLUENCE) { + /* try to get F-Curve */ + fcu= list_find_fcurve(&strip->fcurves, "influence", 0); + + /* add one if not found */ + if (fcu == NULL) { + /* make new F-Curve */ + fcu= MEM_callocN(sizeof(FCurve), "NlaStrip FCurve"); + BLI_addtail(&strip->fcurves, fcu); + + /* set default flags */ + fcu->flag = (FCURVE_VISIBLE|FCURVE_AUTO_HANDLES|FCURVE_SELECTED); + + /* store path - make copy, and store that */ + fcu->rna_path= BLI_strdupn("influence", 9); + + // TODO: insert a few keyframes to ensure default behaviour? + } + } + + /* if controlling time... */ + if (strip->flag & NLASTRIP_FLAG_USR_TIME) { + /* try to get F-Curve */ + fcu= list_find_fcurve(&strip->fcurves, "strip_time", 0); + + /* add one if not found */ + if (fcu == NULL) { + /* make new F-Curve */ + fcu= MEM_callocN(sizeof(FCurve), "NlaStrip FCurve"); + BLI_addtail(&strip->fcurves, fcu); + + /* set default flags */ + fcu->flag = (FCURVE_VISIBLE|FCURVE_AUTO_HANDLES|FCURVE_SELECTED); + + /* store path - make copy, and store that */ + fcu->rna_path= BLI_strdupn("strip_time", 10); + + // TODO: insert a few keyframes to ensure default behaviour? + } + } +} /* Tools ------------------------------------------- */ diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 331e2d0894e..ac195f42f03 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -54,6 +54,7 @@ #include "BKE_action.h" #include "BKE_constraint.h" #include "BKE_fcurve.h" +#include "BKE_nla.h" #include "BKE_global.h" #include "BKE_utildefines.h" #include "BKE_context.h" @@ -722,9 +723,119 @@ static float visualkey_get_value (PointerRNA *ptr, PropertyRNA *prop, int array_ /* ------------------------- Insert Key API ------------------------- */ +/* Secondary Keyframing API call: + * Use this when validation of necessary animation data is not necessary, since an RNA-pointer to the necessary + * data being keyframed, and a pointer to the F-Curve to use have both been provided. + * + * The flag argument is used for special settings that alter the behaviour of + * the keyframe insertion. These include the 'visual' keyframing modes, quick refresh, + * and extra keyframe filtering. + */ +short insert_keyframe_direct (PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, float cfra, short flag) +{ + float curval= 0.0f; + + /* no F-Curve to add keyframe to? */ + if (fcu == NULL) { + printf("ERROR: no F-Curve to add keyframes to \n"); + return 0; + } + + /* if no property given yet, try to validate from F-Curve info */ + if ((ptr.id.data == NULL) && (ptr.data==NULL)) { + printf("ERROR: no RNA-pointer available to retrieve values for keyframing from\n"); + return 0; + } + if (prop == NULL) { + PointerRNA tmp_ptr; + + /* try to get property we should be affecting */ + if ((RNA_path_resolve(&ptr, fcu->rna_path, &tmp_ptr, &prop) == 0) || (prop == NULL)) { + /* property not found... */ + char *idname= (ptr.id.data) ? ((ID *)ptr.id.data)->name : ""; + + printf("Insert Key: Could not insert keyframe, as RNA Path is invalid for the given ID (ID = %s, Path = %s)\n", idname, fcu->rna_path); + return 0; + } + else { + /* property found, so overwrite 'ptr' to make later code easier */ + ptr= tmp_ptr; + } + } + + /* set additional flags for the F-Curve (i.e. only integer values) */ + fcu->flag &= ~(FCURVE_INT_VALUES|FCURVE_DISCRETE_VALUES); + switch (RNA_property_type(prop)) { + case PROP_FLOAT: + /* do nothing */ + break; + case PROP_INT: + /* do integer (only 'whole' numbers) interpolation between all points */ + fcu->flag |= FCURVE_INT_VALUES; + break; + default: + /* do 'discrete' (i.e. enum, boolean values which cannot take any intermediate + * values at all) interpolation between all points + * - however, we must also ensure that evaluated values are only integers still + */ + fcu->flag |= (FCURVE_DISCRETE_VALUES|FCURVE_INT_VALUES); + break; + } + + /* obtain value to give keyframe */ + if ( (flag & INSERTKEY_MATRIX) && + (visualkey_can_use(&ptr, prop)) ) + { + /* visual-keying is only available for object and pchan datablocks, as + * it works by keyframing using a value extracted from the final matrix + * instead of using the kt system to extract a value. + */ + curval= visualkey_get_value(&ptr, prop, fcu->array_index); + } + else { + /* read value from system */ + curval= setting_get_rna_value(&ptr, prop, fcu->array_index); + } + + /* only insert keyframes where they are needed */ + if (flag & INSERTKEY_NEEDED) { + short insert_mode; + + /* check whether this curve really needs a new keyframe */ + insert_mode= new_key_needed(fcu, cfra, curval); + + /* insert new keyframe at current frame */ + if (insert_mode) + insert_vert_fcurve(fcu, cfra, curval, (flag & INSERTKEY_FAST)); + + /* delete keyframe immediately before/after newly added */ + switch (insert_mode) { + case KEYNEEDED_DELPREV: + delete_fcurve_key(fcu, fcu->totvert-2, 1); + break; + case KEYNEEDED_DELNEXT: + delete_fcurve_key(fcu, 1, 1); + break; + } + + /* only return success if keyframe added */ + if (insert_mode) + return 1; + } + else { + /* just insert keyframe */ + insert_vert_fcurve(fcu, cfra, curval, (flag & INSERTKEY_FAST)); + + /* return success */ + return 1; + } + + /* failed */ + return 0; +} + /* Main Keyframing API call: - * Use this when validation of necessary animation data isn't necessary as it - * already exists. It will insert a keyframe using the current value being keyframed. + * Use this when validation of necessary animation data is necessary, since it may not exist yet. * * The flag argument is used for special settings that alter the behaviour of * the keyframe insertion. These include the 'visual' keyframing modes, quick refresh, @@ -744,102 +855,31 @@ short insert_keyframe (ID *id, bAction *act, const char group[], const char rna_ } /* get F-Curve - if no action is provided, keyframe to the default one attached to this ID-block */ - if (act == NULL) + if (act == NULL) { + AnimData *adt= BKE_animdata_from_id(id); + + /* get action to add F-Curve+keyframe to */ act= verify_adt_action(id, 1); + + /* apply NLA-mapping to frame to use (if applicable) */ + cfra= BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP); + } fcu= verify_fcurve(act, group, rna_path, array_index, 1); - /* only continue if we have an F-Curve to add keyframe to */ - if (fcu) { - float curval= 0.0f; + /* apply special time tweaking */ + // XXX check on this stuff... + if (GS(id->name) == ID_OB) { + //Object *ob= (Object *)id; - /* set additional flags for the F-Curve (i.e. only integer values) */ - fcu->flag &= ~(FCURVE_INT_VALUES|FCURVE_DISCRETE_VALUES); - switch (RNA_property_type(prop)) { - case PROP_FLOAT: - /* do nothing */ - break; - case PROP_INT: - /* do integer (only 'whole' numbers) interpolation between all points */ - fcu->flag |= FCURVE_INT_VALUES; - break; - default: - /* do 'discrete' (i.e. enum, boolean values which cannot take any intermediate - * values at all) interpolation between all points - * - however, we must also ensure that evaluated values are only integers still - */ - fcu->flag |= (FCURVE_DISCRETE_VALUES|FCURVE_INT_VALUES); - break; - } - - /* apply special time tweaking */ - // XXX check on this stuff... - if (GS(id->name) == ID_OB) { - //Object *ob= (Object *)id; - - /* apply NLA-scaling (if applicable) */ - //cfra= get_action_frame(ob, cfra); - - /* ancient time-offset cruft */ - //if ( (ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)) ) { - // /* actually frametofloat calc again! */ - // cfra-= give_timeoffset(ob)*scene->r.framelen; - //} - } - - /* obtain value to give keyframe */ - if ( (flag & INSERTKEY_MATRIX) && - (visualkey_can_use(&ptr, prop)) ) - { - /* visual-keying is only available for object and pchan datablocks, as - * it works by keyframing using a value extracted from the final matrix - * instead of using the kt system to extract a value. - */ - curval= visualkey_get_value(&ptr, prop, array_index); - } - else { - /* read value from system */ - curval= setting_get_rna_value(&ptr, prop, array_index); - } - - /* only insert keyframes where they are needed */ - if (flag & INSERTKEY_NEEDED) { - short insert_mode; - - /* check whether this curve really needs a new keyframe */ - insert_mode= new_key_needed(fcu, cfra, curval); - - /* insert new keyframe at current frame */ - if (insert_mode) - insert_vert_fcurve(fcu, cfra, curval, (flag & INSERTKEY_FAST)); - - /* delete keyframe immediately before/after newly added */ - switch (insert_mode) { - case KEYNEEDED_DELPREV: - delete_fcurve_key(fcu, fcu->totvert-2, 1); - break; - case KEYNEEDED_DELNEXT: - delete_fcurve_key(fcu, 1, 1); - break; - } - - /* only return success if keyframe added */ - if (insert_mode) - return 1; - } - else { - /* just insert keyframe */ - insert_vert_fcurve(fcu, cfra, curval, (flag & INSERTKEY_FAST)); - - /* return success */ - return 1; - } + /* ancient time-offset cruft */ + //if ( (ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)) ) { + // /* actually frametofloat calc again! */ + // cfra-= give_timeoffset(ob)*scene->r.framelen; + //} } - /* no F-Curve to add keyframes to */ - printf("ERROR: no F-Curve to add keyframes to \n"); - - /* return failure */ - return 0; + /* insert keyframe */ + return insert_keyframe_direct(ptr, prop, fcu, cfra, flag); } /* ************************************************** */ @@ -864,6 +904,9 @@ short delete_keyframe (ID *id, bAction *act, const char group[], const char rna_ /* if no action is provided, use the default one attached to this ID-block */ AnimData *adt= BKE_animdata_from_id(id); act= adt->action; + + /* apply NLA-mapping to frame to use (if applicable) */ + cfra= BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP); } /* we don't check the validity of the path here yet, but it should be ok... */ fcu= verify_fcurve(act, group, rna_path, array_index, 0); @@ -877,9 +920,6 @@ short delete_keyframe (ID *id, bAction *act, const char group[], const char rna_ if (GS(id->name) == ID_OB) { //Object *ob= (Object *)id; - /* apply NLA-scaling (if applicable) */ - // cfra= get_action_frame(ob, cfra); - /* ancient time-offset cruft */ //if ( (ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)) ) { // /* actually frametofloat calc again! */ @@ -1266,6 +1306,13 @@ static int insert_key_button_exec (bContext *C, wmOperator *op) MEM_freeN(path); } + else if (ptr.type == &RNA_NlaStrip) { + /* handle special vars for NLA-strips */ + NlaStrip *strip= (NlaStrip *)ptr.data; + FCurve *fcu= list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), 0); + + success+= insert_keyframe_direct(ptr, prop, fcu, cfra, 0); + } else { if (G.f & G_DEBUG) printf("Button Insert-Key: no path to property \n"); diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 9d063910aa9..ffebb42ce99 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -43,6 +43,9 @@ struct bConstraint; struct bContext; struct wmOperatorType; +struct PointerRNA; +struct PropertyRNA; + /* ************ Keyframing Management **************** */ /* Get (or add relevant data to be able to do so) the Active Action for the given @@ -69,6 +72,16 @@ int insert_bezt_fcurve(struct FCurve *fcu, struct BezTriple *bezt); */ void insert_vert_fcurve(struct FCurve *fcu, float x, float y, short flag); +/* -------- */ + +/* Secondary Keyframing API calls: + * Use this to insert a keyframe using the current value being keyframed, in the + * nominated F-Curve (no creation of animation data performed). Returns success. + */ +short insert_keyframe_direct(struct PointerRNA ptr, struct PropertyRNA *prop, struct FCurve *fcu, float cfra, short flag); + + + /* -------- */ /* Main Keyframing API calls: diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 38ac59cbc9e..d09cc6a1e53 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -271,7 +271,7 @@ static void nla_panel_actclip(const bContext *C, Panel *pa) uiItemR(row, NULL, ICON_ACTION, &strip_ptr, "action", 0, 0, 0); /* action extents */ - // XXX custom names were used here... probably not necessary in future? + // XXX custom names were used here (to avoid the prefixes)... probably not necessary in future? column= uiLayoutColumn(layout, 1); uiItemL(column, "Action Extents:", 0); uiItemR(column, "Start Frame", 0, &strip_ptr, "action_start_frame", 0, 0, 0); @@ -289,7 +289,7 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa) { PointerRNA strip_ptr; uiLayout *layout= pa->layout; - uiLayout *column; + uiLayout *column, *subcolumn; uiBlock *block; /* check context and also validity of pointer */ @@ -300,14 +300,19 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa) uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); column= uiLayoutColumn(layout, 1); - uiLayoutSetEnabled(column, 0); // XXX for now, don't allow user to edit uiItemR(column, NULL, 0, &strip_ptr, "animated_influence", 0, 0, 0); - uiItemR(column, NULL, 0, &strip_ptr, "influence", 0, 0, 0); + subcolumn= uiLayoutColumn(column, 1); + uiLayoutSetEnabled(subcolumn, RNA_boolean_get(&strip_ptr, "animated_influence")); + uiItemR(subcolumn, NULL, 0, &strip_ptr, "influence", 0, 0, 0); + + column= uiLayoutColumn(layout, 1); - uiLayoutSetEnabled(column, 0); // XXX for now, don't allow user to edit uiItemR(column, NULL, 0, &strip_ptr, "animated_time", 0, 0, 0); - uiItemR(column, NULL, 0, &strip_ptr, "strip_time", 0, 0, 0); + + subcolumn= uiLayoutColumn(column, 1); + uiLayoutSetEnabled(subcolumn, RNA_boolean_get(&strip_ptr, "animated_time")); + uiItemR(subcolumn, NULL, 0, &strip_ptr, "strip_time", 0, 0, 0); } /* F-Modifiers for active NLA-Strip */ diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index b0149d29e69..219feaad09b 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -40,6 +40,9 @@ #include #include +/* needed for some of the validation stuff... */ +#include "BKE_nla.h" + /* temp constant defined for these funcs only... */ #define NLASTRIP_MIN_LEN_THRESH 0.1f @@ -196,6 +199,32 @@ static void rna_NlaStrip_action_end_frame_set(PointerRNA *ptr, float value) data->actend= value; } +static void rna_NlaStrip_animated_influence_set(PointerRNA *ptr, int value) +{ + NlaStrip *data= (NlaStrip*)ptr->data; + + if (value) { + /* set the flag, then make sure a curve for this exists */ + data->flag |= NLASTRIP_FLAG_USR_INFLUENCE; + BKE_nlastrip_validate_fcurves(data); + } + else + data->flag &= ~NLASTRIP_FLAG_USR_INFLUENCE; +} + +static void rna_NlaStrip_animated_time_set(PointerRNA *ptr, int value) +{ + NlaStrip *data= (NlaStrip*)ptr->data; + + if (value) { + /* set the flag, then make sure a curve for this exists */ + data->flag |= NLASTRIP_FLAG_USR_TIME; + BKE_nlastrip_validate_fcurves(data); + } + else + data->flag &= ~NLASTRIP_FLAG_USR_TIME; +} + #else void rna_def_nlastrip(BlenderRNA *brna) @@ -321,14 +350,15 @@ void rna_def_nlastrip(BlenderRNA *brna) prop= RNA_def_property(srna, "strip_time", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Strip Time", "Frame of referenced Action to evaluate."); + // TODO: should the animated_influence/time settings be animatable themselves? prop= RNA_def_property(srna, "animated_influence", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, not editable RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_INFLUENCE); + RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_influence_set"); RNA_def_property_ui_text(prop, "Animated Influence", "Influence setting is controlled by an F-Curve rather than automatically determined."); prop= RNA_def_property(srna, "animated_time", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, not editable - RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_INFLUENCE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME); + RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_time_set"); RNA_def_property_ui_text(prop, "Animated Strip Time", "Strip time is controlled by an F-Curve rather than automatically determined."); /* settings */ -- cgit v1.2.3 From 665938191df7e831ba22f101b00ab9b99bdde654 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 8 Jul 2009 06:32:52 +0000 Subject: NLA SoC: Minor UI-Tweaks * When influence/time for NLA-strips are animated, settings in the other panels which used to control these are now greyed out to show that they won't have any impact over the result. * NKey panel for Graph Editor now opens on Right-Hand Side, just like for NLA Editor. The small sub-region above the Channels region was too troublesome to work with. --- source/blender/editors/space_graph/space_graph.c | 16 ++++++++-------- source/blender/editors/space_nla/nla_buttons.c | 12 ++++++++---- 2 files changed, 16 insertions(+), 12 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index b17861dc679..2f3700bc733 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -72,19 +72,19 @@ ARegion *graph_has_buttons_region(ScrArea *sa) if(ar->regiontype==RGN_TYPE_UI) return ar; - /* add subdiv level; after channel */ + /* add subdiv level; after main window */ for(ar= sa->regionbase.first; ar; ar= ar->next) - if(ar->regiontype==RGN_TYPE_CHANNELS) + if(ar->regiontype==RGN_TYPE_WINDOW) break; /* is error! */ if(ar==NULL) return NULL; - arnew= MEM_callocN(sizeof(ARegion), "buttons for view3d"); + arnew= MEM_callocN(sizeof(ARegion), "buttons for nla"); BLI_insertlinkafter(&sa->regionbase, ar, arnew); arnew->regiontype= RGN_TYPE_UI; - arnew->alignment= RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV; + arnew->alignment= RGN_ALIGN_RIGHT; arnew->flag = RGN_FLAG_HIDDEN; @@ -117,7 +117,7 @@ static SpaceLink *graph_new(const bContext *C) ar->alignment= RGN_ALIGN_BOTTOM; /* channels */ - ar= MEM_callocN(sizeof(ARegion), "main area for graphedit"); + ar= MEM_callocN(sizeof(ARegion), "channels area for graphedit"); BLI_addtail(&sipo->regionbase, ar); ar->regiontype= RGN_TYPE_CHANNELS; @@ -126,11 +126,11 @@ static SpaceLink *graph_new(const bContext *C) ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM); /* ui buttons */ - ar= MEM_callocN(sizeof(ARegion), "main area for graphedit"); + ar= MEM_callocN(sizeof(ARegion), "buttons area for graphedit"); BLI_addtail(&sipo->regionbase, ar); ar->regiontype= RGN_TYPE_UI; - ar->alignment= RGN_ALIGN_TOP|RGN_SPLIT_PREV; + ar->alignment= RGN_ALIGN_RIGHT; ar->flag = RGN_FLAG_HIDDEN; /* main area */ @@ -566,7 +566,7 @@ void ED_spacetype_ipo(void) /* regions: UI buttons */ art= MEM_callocN(sizeof(ARegionType), "spacetype graphedit region"); art->regionid = RGN_TYPE_UI; - art->minsizey= 200; + art->minsizex= 200; art->keymapflag= ED_KEYMAP_UI; art->listener= graph_region_listener; art->init= graph_buttons_area_init; diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index d09cc6a1e53..c0a2b9476e3 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -236,14 +236,17 @@ static void nla_panel_properties(const bContext *C, Panel *pa) * - blend in/out can only be set when autoblending is off */ column= uiLayoutColumn(layout, 1); + uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "animated_influence")==0); uiItemR(column, NULL, 0, &strip_ptr, "auto_blending", 0, 0, 0); // XXX as toggle? - subcol= uiLayoutColumn(column, 1); - uiLayoutSetActive(subcol, RNA_boolean_get(&strip_ptr, "auto_blending")==0); - uiItemR(subcol, NULL, 0, &strip_ptr, "blend_in", 0, 0, 0); - uiItemR(subcol, NULL, 0, &strip_ptr, "blend_out", 0, 0, 0); + + subcol= uiLayoutColumn(column, 1); + uiLayoutSetActive(subcol, RNA_boolean_get(&strip_ptr, "auto_blending")==0); + uiItemR(subcol, NULL, 0, &strip_ptr, "blend_in", 0, 0, 0); + uiItemR(subcol, NULL, 0, &strip_ptr, "blend_out", 0, 0, 0); /* settings */ column= uiLayoutColumn(layout, 1); + uiLayoutSetActive(column, !(RNA_boolean_get(&strip_ptr, "animated_influence") || RNA_boolean_get(&strip_ptr, "animated_time"))); uiItemL(column, "Playback Settings:", 0); uiItemR(column, NULL, 0, &strip_ptr, "muted", 0, 0, 0); uiItemR(column, NULL, 0, &strip_ptr, "reversed", 0, 0, 0); @@ -279,6 +282,7 @@ static void nla_panel_actclip(const bContext *C, Panel *pa) /* action usage */ column= uiLayoutColumn(layout, 1); + uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "animated_time")==0); uiItemL(column, "Playback Settings:", 0); uiItemR(column, NULL, 0, &strip_ptr, "scale", 0, 0, 0); uiItemR(column, NULL, 0, &strip_ptr, "repeat", 0, 0, 0); -- cgit v1.2.3 From a97b645a4455d332409a07a82e47182f72852360 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 8 Jul 2009 09:23:49 +0000 Subject: * workaround for PySys_SetArgv() in python3 needing wchar_t * PyRNA - id_struct.keyframe_insert("path", index, frame) --- source/blender/python/intern/bpy_interface.c | 16 +++++++- source/blender/python/intern/bpy_rna.c | 61 ++++++++++++++++++++++++---- source/gameengine/Ketsji/KX_PythonInit.cpp | 12 +++++- 3 files changed, 79 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 62e374953b0..bc422e5a20c 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -187,7 +187,21 @@ void BPY_start_python( int argc, char **argv ) Py_Initialize( ); - //PySys_SetArgv( argc_copy, argv_copy ); +#if (PY_VERSION_HEX < 0x03000000) + PySys_SetArgv( argc, argv); +#else + /* sigh, why do python guys not have a char** version anymore? :( */ + { + int i; + PyObject *py_argv= PyList_New(argc); + + for (i=0; iidentifier) { + ret = PyUnicode_FromString( item->identifier ); + } + else { + /* prefer not fail silently incase of api errors, maybe disable it later */ + char error_str[128]; + sprintf(error_str, "RNA Warning: Current value \"%d\" matches no enum", val); + PyErr_Warn(PyExc_RuntimeWarning, error_str); + ret = PyUnicode_FromString( "" ); + } /*PyErr_Format(PyExc_AttributeError, "RNA Error: Current value \"%d\" matches no enum", val); ret = NULL;*/ @@ -913,8 +924,12 @@ static PyObject *prop_subscript_collection(BPy_PropertyRNA * self, PyObject *key if (PyUnicode_Check(key)) { return prop_subscript_collection_str(self, _PyUnicode_AsString(key)); } - else if (PyLong_Check(key)) { - return prop_subscript_collection_int(self, PyLong_AsSsize_t(key)); + else if (PyIndex_Check(key)) { + Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return NULL; + + return prop_subscript_collection_int(self, i); } #if PY_VERSION_HEX >= 0x03000000 else if (PySlice_Check(key)) { @@ -947,7 +962,10 @@ static PyObject *prop_subscript_array(BPy_PropertyRNA * self, PyObject *key) /*if (PyUnicode_Check(key)) { return prop_subscript_array_str(self, _PyUnicode_AsString(key)); } else*/ - if (PyLong_Check(key)) { + if (PyIndex_Check(key)) { + Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return NULL; return prop_subscript_array_int(self, PyLong_AsSsize_t(key)); } #if PY_VERSION_HEX >= 0x03000000 @@ -1037,8 +1055,12 @@ static int pyrna_prop_ass_subscript( BPy_PropertyRNA * self, PyObject *key, PyOb return -1; } - if (PyLong_Check(key)) { - return prop_subscript_ass_array_int(self, PyLong_AsSsize_t(key), value); + if (PyIndex_Check(key)) { + Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return NULL; + + return prop_subscript_ass_array_int(self, i, value); } #if PY_VERSION_HEX >= 0x03000000 else if (PySlice_Check(key)) { @@ -1106,6 +1128,25 @@ static PySequenceMethods pyrna_prop_as_sequence = { (objobjproc)pyrna_prop_contains, /* sq_contains */ }; + +static PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA * self, PyObject *args) +{ + char *path; + int index= 0; + float cfra = CTX_data_scene(BPy_GetContext())->r.cfra; + + if(!RNA_struct_is_ID(self->ptr.type)) { + PyErr_SetString( PyExc_TypeError, "StructRNA - keyframe_insert only for ID type"); + return NULL; + } + + if (!PyArg_ParseTuple(args, "s|if:keyframe_insert", &path, &index, &cfra)) + return NULL; + + return PyBool_FromLong( insert_keyframe((ID *)self->ptr.data, NULL, NULL, path, index, cfra, 0)); +} + + static PyObject *pyrna_struct_dir(BPy_StructRNA * self) { PyObject *ret, *dict; @@ -1645,6 +1686,10 @@ PyObject *pyrna_prop_iter(BPy_PropertyRNA *self) } static struct PyMethodDef pyrna_struct_methods[] = { + + /* maybe this become and ID function */ + {"keyframe_insert", (PyCFunction)pyrna_struct_keyframe_insert, METH_VARARGS, NULL}, + {"__dir__", (PyCFunction)pyrna_struct_dir, METH_NOARGS, NULL}, {NULL, NULL, 0, NULL} }; diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index eead7a51885..ac49b49c130 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1622,10 +1622,20 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur Py_FrozenFlag=1; Py_Initialize(); + if(argv && first_time) { /* browser plugins dont currently set this */ #if (PY_VERSION_HEX < 0x03000000) - if(argv && first_time) /* browser plugins dont currently set this */ PySys_SetArgv(argc, argv); +#else + int i; + PyObject *py_argv= PyList_New(argc); + + for (i=0; i Date: Wed, 8 Jul 2009 11:18:47 +0000 Subject: This fixes some NULL checks. * base was referenced before NULL check * ob wasn't checked for NULL Still broken: Add Mesh doesn't seem to work in Object Mode. But now it doesn't crash anymore... --- source/blender/editors/object/object_edit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index af6cb887e71..90f6250cf8c 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -3261,7 +3261,7 @@ void ED_object_enter_editmode(bContext *C, int flag) { Scene *scene= CTX_data_scene(C); Base *base= CTX_data_active_base(C); - Object *ob= base->object; + Object *ob; ScrArea *sa= CTX_wm_area(C); View3D *v3d= NULL; int ok= 0; @@ -3273,7 +3273,10 @@ void ED_object_enter_editmode(bContext *C, int flag) v3d= sa->spacedata.first; if((v3d==NULL || (base->lay & v3d->lay))==0) return; - + + ob = base->object; + + if(ob==NULL) return; if(ob->data==NULL) return; if (object_data_is_libdata(ob)) { -- cgit v1.2.3 From 5f5ddb00146884d28414811bc92311af56d55904 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 8 Jul 2009 12:30:09 +0000 Subject: NLA SoC: Little optimisation + Drawing bugfix * Text labels on NLA-Strips should now draw properly for most short-strips now. Previously, the padding on the text was a bit too extreme, so for very short strips (less than 4 frames or so), the text was often pushed down into the bottom-right corner of view. * Optimised the keyframe-highlighting code for buttons a bit. Replaced the custom linear-search with the binary-search used when inserting keyframes (and for the 3d-view keyframe-indicator). There should be some theoretical improvements due to this at least... --- source/blender/blenkernel/BKE_fcurve.h | 3 -- source/blender/blenkernel/intern/fcurve.c | 14 -------- source/blender/editors/animation/keyframing.c | 41 +++++++++++++++-------- source/blender/editors/include/ED_keyframing.h | 5 +++ source/blender/editors/interface/interface_anim.c | 4 ++- source/blender/editors/space_nla/nla_draw.c | 15 +++++---- 6 files changed, 43 insertions(+), 39 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index 4dcb08dc0df..cda64c6b241 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -153,9 +153,6 @@ void copy_fcurves(ListBase *dst, ListBase *src); /* find matching F-Curve in the given list of F-Curves */ struct FCurve *list_find_fcurve(ListBase *list, const char rna_path[], const int array_index); -/* test if there is a keyframe at cfra */ -short on_keyframe_fcurve(struct FCurve *fcu, float cfra); - /* get the time extents for F-Curve */ void calc_fcurve_range(struct FCurve *fcu, float *min, float *max); diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 4c2ba61fc71..ebd94b94f8c 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -200,20 +200,6 @@ FCurve *list_find_fcurve (ListBase *list, const char rna_path[], const int array return NULL; } -short on_keyframe_fcurve(FCurve *fcu, float cfra) -{ - BezTriple *bezt; - unsigned i; - - bezt= fcu->bezt; - for (i=0; itotvert; i++, bezt++) { - if (IS_EQ(bezt->vec[1][0], cfra)) - return 1; - } - - return 0; -} - /* Calculate the extents of F-Curve's data */ void calc_fcurve_bounds (FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax) { diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index ac195f42f03..dd4c4c23f1e 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1430,6 +1430,31 @@ void ANIM_OT_delete_keyframe_button (wmOperatorType *ot) /* --------------- API/Per-Datablock Handling ------------------- */ +/* Checks if some F-Curve has a keyframe for a given frame */ +short fcurve_frame_has_keyframe (FCurve *fcu, float frame, short filter) +{ + /* quick sanity check */ + if (fcu == NULL) + return 0; + + /* we either include all regardless of muting, or only non-muted */ + if ((filter & ANIMFILTER_KEYS_MUTED) || (fcu->flag & FCURVE_MUTED)==0) { + short replace = -1; + int i = binarysearch_bezt_index(fcu->bezt, frame, fcu->totvert, &replace); + + /* binarysearch_bezt_index will set replace to be 0 or 1 + * - obviously, 1 represents a match + */ + if (replace) { + /* sanity check: 'i' may in rare cases exceed arraylen */ + if ((i >= 0) && (i < fcu->totvert)) + return 1; + } + } + + return 0; +} + /* Checks whether an Action has a keyframe for a given frame * Since we're only concerned whether a keyframe exists, we can simply loop until a match is found... */ @@ -1451,20 +1476,8 @@ short action_frame_has_keyframe (bAction *act, float frame, short filter) for (fcu= act->curves.first; fcu; fcu= fcu->next) { /* only check if there are keyframes (currently only of type BezTriple) */ if (fcu->bezt && fcu->totvert) { - /* we either include all regardless of muting, or only non-muted */ - if ((filter & ANIMFILTER_KEYS_MUTED) || (fcu->flag & FCURVE_MUTED)==0) { - short replace = -1; - int i = binarysearch_bezt_index(fcu->bezt, frame, fcu->totvert, &replace); - - /* binarysearch_bezt_index will set replace to be 0 or 1 - * - obviously, 1 represents a match - */ - if (replace) { - /* sanity check: 'i' may in rare cases exceed arraylen */ - if ((i >= 0) && (i < fcu->totvert)) - return 1; - } - } + if (fcurve_frame_has_keyframe(fcu, frame, filter)) + return 1; } } diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index ffebb42ce99..503d71b0d3e 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -199,6 +199,11 @@ void ANIM_OT_remove_driver_button(struct wmOperatorType *ot); /* ************ Keyframe Checking ******************** */ +/* Lesser Keyframe Checking API call: + * - Used for the buttons to check for keyframes... + */ +short fcurve_frame_has_keyframe(struct FCurve *fcu, float frame, short filter); + /* Main Keyframe Checking API call: * Checks whether a keyframe exists for the given ID-block one the given frame. * - It is recommended to call this method over the other keyframe-checkers directly, diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index 4a26db29160..be4087de525 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -18,6 +18,8 @@ #include "RNA_access.h" #include "RNA_types.h" +#include "ED_keyframing.h" + #include "UI_interface.h" #include "WM_api.h" @@ -47,7 +49,7 @@ void ui_but_anim_flag(uiBut *but, float cfra) if (fcu) { but->flag |= UI_BUT_ANIMATED; - if (on_keyframe_fcurve(fcu, cfra)) + if (fcurve_frame_has_keyframe(fcu, cfra, 0)) but->flag |= UI_BUT_ANIMATED_KEY; } } diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 7b9f2faf08a..bbb666d01cc 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -291,6 +291,9 @@ static void nla_draw_strip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2 gl_round_box_shade(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1); + /* draw influence 'curve' */ + // TODO: + /* draw strip outline * - color used here is to indicate active vs non-active */ @@ -378,11 +381,9 @@ static void nla_draw_strip_text (NlaTrack *nlt, NlaStrip *strip, int index, View case NLASTRIP_TYPE_CLIP: /* Action-Clip (default) */ default: - if (strip->act) - sprintf(str, "%d | Act: %s | %.2f %s %.2f", - index, strip->act->id.name+2, strip->start, dir, strip->end); - else - sprintf(str, "%d | Act: ", index); // xxx... need a better format? + sprintf(str, "%d | Act: %s | %.2f %s %.2f", + index, ((strip->act)?strip->act->id.name+2:""), + strip->start, dir, strip->end); break; } @@ -396,9 +397,9 @@ static void nla_draw_strip_text (NlaTrack *nlt, NlaStrip *strip, int index, View * - padding of 2 'units' on either side */ // TODO: make this centered? - rect.xmin= strip->start + 2; + rect.xmin= strip->start + 0.5f; rect.ymin= yminc; - rect.xmax= strip->end - 2; + rect.xmax= strip->end - 0.5f; rect.ymax= ymaxc; /* add this string to the cache of texts to draw*/ -- cgit v1.2.3 From 41be132eb7d3a55d5c2dbd147a23b247f8f7ed76 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 8 Jul 2009 14:26:43 +0000 Subject: 2.5 Copied some Python compat stuff to get py 2.3 running... just googled for it on python.org mailing list. --- source/blender/python/intern/bpy_compat.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source') diff --git a/source/blender/python/intern/bpy_compat.h b/source/blender/python/intern/bpy_compat.h index 1ad9376c13b..e999f57c733 100644 --- a/source/blender/python/intern/bpy_compat.h +++ b/source/blender/python/intern/bpy_compat.h @@ -85,6 +85,12 @@ typedef Py_ssize_t (*lenfunc)(PyObject *); #ifndef Py_RETURN_TRUE #define Py_RETURN_TRUE return PyBool_FromLong(1) #endif + +#define PyInt_FromSsize_t PyInt_FromLong +#define PyNumber_AsSsize_t(ob, exc) PyInt_AsLong(ob) +#define PyIndex_Check(ob) PyInt_Check(ob) + + #endif -- cgit v1.2.3 From 031ed0431c37703b672d4589f85a4caa69810f37 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 8 Jul 2009 14:32:03 +0000 Subject: fix for loading YoFrankie levels in blender 2.5. Multires pointer was corrupt on linked meshes. Note that the files didnt use multires so something odd is going on, but for now this stops the crash. --- source/blender/blenloader/intern/readfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index fd86c436558..d816708f8a4 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9086,7 +9086,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) void *olddata = ob->data; ob->data = me; - if(me && me->mr) { + if(me && me->id.lib==NULL && me->mr) { /* XXX - library meshes crash on loading most yoFrankie levels, the multires pointer gets invalid - Campbell */ MultiresLevel *lvl; ModifierData *md; MultiresModifierData *mmd; -- cgit v1.2.3 From f3fd7d88002dcfe42e51738cbb7d2d2be756dd19 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 8 Jul 2009 15:01:28 +0000 Subject: 2.5 Brought back the basics for transform manipulators. Martin will hook it all up to new transform system. Some notes: - Still uses G.moving - BIF_do_manipulator() is called as a View3D Operator I've tested selecting handles, added a print to confirm - BIF_GetTransInfo() returns a dummy struct now, just to get it running. - Marked some other issues with XXX --- source/blender/editors/include/BIF_transform.h | 4 +- source/blender/editors/space_view3d/drawobject.c | 52 -- source/blender/editors/space_view3d/view3d_draw.c | 3 +- source/blender/editors/space_view3d/view3d_edit.c | 38 ++ .../blender/editors/space_view3d/view3d_header.c | 12 +- .../blender/editors/space_view3d/view3d_intern.h | 1 + source/blender/editors/space_view3d/view3d_ops.c | 2 + source/blender/editors/transform/transform.c | 4 + source/blender/editors/transform/transform.h | 7 +- .../editors/transform/transform_conversions.c | 7 + .../blender/editors/transform/transform_generics.c | 7 +- .../editors/transform/transform_manipulator.c | 647 +++++++++++---------- .../editors/transform/transform_orientations.c | 4 +- source/blender/makesdna/DNA_view3d_types.h | 3 + source/blender/makesrna/intern/rna_space.c | 5 + 15 files changed, 417 insertions(+), 379 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/BIF_transform.h b/source/blender/editors/include/BIF_transform.h index e02202eb8e0..f65648eb654 100644 --- a/source/blender/editors/include/BIF_transform.h +++ b/source/blender/editors/include/BIF_transform.h @@ -128,8 +128,8 @@ void BIF_selectOrientation(void); void initManipulator(int mode); void ManipulatorTransform(); -//int BIF_do_manipulator(struct ScrArea *sa); -//void BIF_draw_manipulator(struct ScrArea *sa); +int BIF_do_manipulator(struct bContext *C, short mval[2]); +void BIF_draw_manipulator(const struct bContext *C); /* Snapping */ diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index b38575b5ceb..5f475b004b9 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -565,58 +565,6 @@ static void view3d_object_text_draw(View3D *v3d, ARegion *ar) BLI_freelistN(&strings); } -void drawsolidcube(float size) -{ - float n[3]; - - glPushMatrix(); - glScalef(size, size, size); - - n[0]=0; n[1]=0; n[2]=0; - glBegin(GL_QUADS); - n[0]= -1.0; - glNormal3fv(n); - glVertex3fv(cube[0]); glVertex3fv(cube[1]); glVertex3fv(cube[2]); glVertex3fv(cube[3]); - n[0]=0; - glEnd(); - - glBegin(GL_QUADS); - n[1]= -1.0; - glNormal3fv(n); - glVertex3fv(cube[0]); glVertex3fv(cube[4]); glVertex3fv(cube[5]); glVertex3fv(cube[1]); - n[1]=0; - glEnd(); - - glBegin(GL_QUADS); - n[0]= 1.0; - glNormal3fv(n); - glVertex3fv(cube[4]); glVertex3fv(cube[7]); glVertex3fv(cube[6]); glVertex3fv(cube[5]); - n[0]=0; - glEnd(); - - glBegin(GL_QUADS); - n[1]= 1.0; - glNormal3fv(n); - glVertex3fv(cube[7]); glVertex3fv(cube[3]); glVertex3fv(cube[2]); glVertex3fv(cube[6]); - n[1]=0; - glEnd(); - - glBegin(GL_QUADS); - n[2]= 1.0; - glNormal3fv(n); - glVertex3fv(cube[1]); glVertex3fv(cube[5]); glVertex3fv(cube[6]); glVertex3fv(cube[2]); - n[2]=0; - glEnd(); - - glBegin(GL_QUADS); - n[2]= -1.0; - glNormal3fv(n); - glVertex3fv(cube[7]); glVertex3fv(cube[4]); glVertex3fv(cube[0]); glVertex3fv(cube[3]); - glEnd(); - - glPopMatrix(); -} - static void drawcube(void) { diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 54696fc4508..ec292b6871b 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -70,6 +70,7 @@ #include "BIF_gl.h" #include "BIF_glutil.h" +#include "BIF_transform.h" #include "WM_api.h" #include "BLF_api.h" @@ -2019,7 +2020,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) if(rv3d->rflag & RV3D_CLIPPING) view3d_clr_clipping(); -// BIF_draw_manipulator(ar); + BIF_draw_manipulator(C); if(v3d->zbuf) { v3d->zbuf= FALSE; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 79173d3fec7..1b9f3285f3d 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -63,6 +63,7 @@ #include "BIF_gl.h" #include "BIF_retopo.h" +#include "BIF_transform.h" #include "WM_api.h" #include "WM_types.h" @@ -1858,6 +1859,43 @@ void VIEW3D_OT_cursor3d(wmOperatorType *ot) } +/* ***************** manipulator op ******************* */ + + +static int manipulator_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + View3D *v3d = CTX_wm_view3d(C); + + if(!(v3d->twflag & V3D_USE_MANIPULATOR)) return OPERATOR_PASS_THROUGH; + if(!(v3d->twflag & V3D_DRAW_MANIPULATOR)) return OPERATOR_PASS_THROUGH; + + /* note; otherwise opengl won't work */ + view3d_operator_needs_opengl(C); + + if(0==BIF_do_manipulator(C, event->mval)) + return OPERATOR_PASS_THROUGH; + + return OPERATOR_FINISHED; +} + +void VIEW3D_OT_manipulator(wmOperatorType *ot) +{ + + /* identifiers */ + ot->name= "3D Manipulator"; + ot->description = ""; + ot->idname= "VIEW3D_OT_manipulator"; + + /* api callbacks */ + ot->invoke= manipulator_invoke; + + ot->poll= ED_operator_view3d_active; + + /* rna later */ + +} + + /* ************************* below the line! *********************** */ diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 6a44b0d4476..a0d1b911370 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -4978,16 +4978,22 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event) break; case B_MAN_TRANS: - if( shift==0 || v3d->twtype==0) + if( shift==0 || v3d->twtype==0) { v3d->twtype= V3D_MANIP_TRANSLATE; + ED_area_tag_redraw(sa); + } break; case B_MAN_ROT: - if( shift==0 || v3d->twtype==0) + if( shift==0 || v3d->twtype==0) { v3d->twtype= V3D_MANIP_ROTATE; + ED_area_tag_redraw(sa); + } break; case B_MAN_SCALE: - if( shift==0 || v3d->twtype==0) + if( shift==0 || v3d->twtype==0) { v3d->twtype= V3D_MANIP_SCALE; + ED_area_tag_redraw(sa); + } break; case B_NDOF: break; diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 65040b4238f..170090cfeb8 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -76,6 +76,7 @@ void VIEW3D_OT_view_persportho(struct wmOperatorType *ot); void VIEW3D_OT_view_orbit(struct wmOperatorType *ot); void VIEW3D_OT_clipping(struct wmOperatorType *ot); void VIEW3D_OT_cursor3d(struct wmOperatorType *ot); +void VIEW3D_OT_manipulator(struct wmOperatorType *ot); void VIEW3D_OT_render_border(struct wmOperatorType *ot); void VIEW3D_OT_zoom_border(struct wmOperatorType *ot); void VIEW3D_OT_drawtype(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 6cb1051ce4a..32a66254ff4 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -79,6 +79,7 @@ void view3d_operatortypes(void) WM_operatortype_append(VIEW3D_OT_smoothview); WM_operatortype_append(VIEW3D_OT_render_border); WM_operatortype_append(VIEW3D_OT_zoom_border); + WM_operatortype_append(VIEW3D_OT_manipulator); WM_operatortype_append(VIEW3D_OT_cursor3d); WM_operatortype_append(VIEW3D_OT_select_lasso); WM_operatortype_append(VIEW3D_OT_setcameratoview); @@ -136,6 +137,7 @@ void view3d_keymap(wmWindowManager *wm) km = WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, KM_CTRL, 0); RNA_boolean_set(km->ptr, "snap", 1); + WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", ACTIONMOUSE, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "VIEW3D_OT_cursor3d", ACTIONMOUSE, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "VIEW3D_OT_viewrotate", MIDDLEMOUSE, KM_PRESS, 0, 0); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 3311fb7d0fe..10cfcbdfa26 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -454,6 +454,7 @@ static void view_editmove(unsigned short event) #endif } +#if 0 static char *transform_to_undostr(TransInfo *t) { switch (t->mode) { @@ -500,6 +501,7 @@ static char *transform_to_undostr(TransInfo *t) } return "Transform"; } +#endif /* ************************************************* */ @@ -1460,6 +1462,8 @@ int transformEnd(bContext *C, TransInfo *t) void initManipulator(int mode) { + printf("init manipulator mode %d\n", mode); + #if 0 // TRANSFORM_FIX_ME Trans.state = TRANS_RUNNING; diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 534f142734a..c270a5d20ea 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -481,8 +481,7 @@ void flushTransNodes(TransInfo *t); void flushTransSeq(TransInfo *t); /*********************** exported from transform_manipulator.c ********** */ -void draw_manipulator_ext(struct ScrArea *sa, int type, char axis, int col, float vec[3], float mat[][3]); -int calc_manipulator_stats(struct ScrArea *sa); +int calc_manipulator_stats(const struct bContext *C); float get_drawsize(struct ARegion *ar, float *co); /*********************** TransData Creation and General Handling *********** */ @@ -631,7 +630,7 @@ int createSpaceNormalTangent(float mat[3][3], float normal[3], float tangent[3]) int addMatrixSpace(struct bContext *C, float mat[3][3], char name[]); int addObjectSpace(struct bContext *C, struct Object *ob); -void applyTransformOrientation(struct bContext *C, TransInfo *t); +void applyTransformOrientation(const struct bContext *C, TransInfo *t); #define ORIENTATION_NONE 0 @@ -640,7 +639,7 @@ void applyTransformOrientation(struct bContext *C, TransInfo *t); #define ORIENTATION_EDGE 3 #define ORIENTATION_FACE 4 -int getTransformOrientation(struct bContext *C, float normal[3], float plane[3], int activeOnly); +int getTransformOrientation(const struct bContext *C, float normal[3], float plane[3], int activeOnly); int createSpaceNormal(float mat[3][3], float normal[3]); int createSpaceNormalTangent(float mat[3][3], float normal[3], float tangent[3]); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 490ce820b30..5926b95854c 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2566,6 +2566,7 @@ int clipUVTransform(TransInfo *t, float *vec, int resize) * It also makes sure gp-frames are still stored in chronological order after * transform. */ +#if 0 static void posttrans_gpd_clean (bGPdata *gpd) { bGPDlayer *gpl; @@ -2650,6 +2651,7 @@ static void posttrans_gpd_clean (bGPdata *gpd) } } } +#endif /* Called during special_aftertrans_update to make sure selected keyframes replace * any other keyframes which may reside on that frame (that is not selected). @@ -2709,6 +2711,7 @@ static void posttrans_fcurve_clean (FCurve *fcu) } + /* Called by special_aftertrans_update to make sure selected keyframes replace * any other keyframes which may reside on that frame (that is not selected). * remake_action_ipos should have already been called @@ -2783,6 +2786,7 @@ static int count_fcurve_keys(FCurve *fcu, char side, float cfra) } /* fully select selected beztriples, but only include if it's on the right side of cfra */ +#if 0 static int count_gplayer_frames(bGPDlayer *gpl, char side, float cfra) { bGPDframe *gpf; @@ -2801,6 +2805,7 @@ static int count_gplayer_frames(bGPDlayer *gpl, char side, float cfra) return count; } +#endif /* This function assigns the information to transdata */ static void TimeToTransData(TransData *td, float *time, Object *ob) @@ -2883,6 +2888,7 @@ void flushTransGPactionData (TransInfo *t) * The 'side' argument is needed for the extend mode. 'B' = both sides, 'R'/'L' mean only data * on the named side are used. */ +#if 0 static int GPLayerToTransData (TransData *td, tGPFtransdata *tfd, bGPDlayer *gpl, char side, float cfra) { bGPDframe *gpf; @@ -2909,6 +2915,7 @@ static int GPLayerToTransData (TransData *td, tGPFtransdata *tfd, bGPDlayer *gpl return count; } +#endif static void createTransActionData(bContext *C, TransInfo *t) { diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index e157d7f68f9..c9d5456f59b 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -114,8 +114,6 @@ extern ListBase editelems; -extern TransInfo Trans; /* From transform.c */ - /* ************************** Functions *************************** */ void getViewVector(TransInfo *t, float coord[3], float vec[3]) @@ -1275,9 +1273,12 @@ void calculatePropRatio(TransInfo *t) } } +/* XXX only to make manipulators run now */ TransInfo *BIF_GetTransInfo() { - return NULL; + static struct TransInfo trans; + memset(&trans, 0, sizeof(struct TransInfo)); + return &trans; } float get_drawsize(ARegion *ar, float *co) diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 99d7805b938..aecd01dd4f0 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -27,18 +27,10 @@ * ***** END GPL LICENSE BLOCK ***** */ -// TRANSFORM_FIX_ME -// Disable everything here, don't need it for now -#if 0 - #include #include #include -#ifdef HAVE_CONFIG_H -#include -#endif - #ifndef WIN32 #include #else @@ -62,8 +54,10 @@ #include "DNA_view3d_types.h" #include "BKE_armature.h" +#include "BKE_context.h" #include "BKE_global.h" #include "BKE_lattice.h" +#include "BKE_mesh.h" #include "BKE_object.h" #include "BKE_particle.h" #include "BKE_utildefines.h" @@ -71,21 +65,21 @@ #include "BLI_arithb.h" #include "BLI_editVert.h" -#include "BIF_editarmature.h" #include "BIF_gl.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" #include "BIF_transform.h" -#include "BIF_editmesh.h" -#include "BIF_editparticle.h" -#include "BSE_edit.h" -#include "BSE_view.h" -#include "BDR_drawobject.h" +#include "WM_api.h" +#include "WM_types.h" -#include "blendef.h" +#include "ED_armature.h" +#include "ED_mesh.h" +#include "ED_particle.h" +#include "ED_space_api.h" +#include "ED_view3d.h" + +#include "UI_resources.h" + +/* local module include */ #include "transform.h" /* return codes for select, and drawing flags */ @@ -113,9 +107,6 @@ #define MAN_GHOST 1 #define MAN_MOVECOL 2 -/* GLOBAL VARIABLE THAT SHOULD MOVED TO SCREEN MEMBER OR SOMETHING */ -extern TransInfo Trans; - static int is_mat4_flipped(float mat[][4]) { @@ -127,11 +118,11 @@ static int is_mat4_flipped(float mat[][4]) } /* transform widget center calc helper for below */ -static void calc_tw_center(float *co) +static void calc_tw_center(Scene *scene, float *co) { - float *twcent= G.scene->twcent; - float *min= G.scene->twmin; - float *max= G.scene->twmax; + float *twcent= scene->twcent; + float *min= scene->twmin; + float *max= scene->twmax; DO_MINMAX(co, min, max); VecAddf(twcent, twcent, co); @@ -162,13 +153,13 @@ static void protectflag_to_drawflags(short protectflag, short *drawflags) } /* for pose mode */ -static void stats_pose(View3D *v3d, bPoseChannel *pchan) +static void stats_pose(Scene *scene, View3D *v3d, bPoseChannel *pchan) { Bone *bone= pchan->bone; if(bone) { if (bone->flag & BONE_TRANSFORM) { - calc_tw_center(pchan->pose_head); + calc_tw_center(scene, pchan->pose_head); protectflag_to_drawflags(pchan->protectflag, &v3d->twdrawflag); } } @@ -209,63 +200,66 @@ static void count_bone_select(TransInfo *t, bArmature *arm, ListBase *lb, int do /* centroid, boundbox, of selection */ /* returns total items selected */ -int calc_manipulator_stats(ScrArea *sa) +int calc_manipulator_stats(const bContext *C) { - TransInfo *t; + TransInfo *t= BIF_GetTransInfo(); // XXX + ScrArea *sa= CTX_wm_area(C); + ARegion *ar= CTX_wm_region(C); + Scene *scene= CTX_data_scene(C); + Object *obedit= CTX_data_edit_object(C); View3D *v3d= sa->spacedata.first; + RegionView3D *rv3d= ar->regiondata; Base *base; Object *ob= OBACT; float normal[3]={0.0, 0.0, 0.0}; float plane[3]={0.0, 0.0, 0.0}; - int a, totsel=0; - -//XXX t = BIF_GetTransInfo(); + int a, totsel= 0; /* transform widget matrix */ - Mat4One(v3d->twmat); + Mat4One(rv3d->twmat); v3d->twdrawflag= 0xFFFF; /* transform widget centroid/center */ - G.scene->twcent[0]= G.scene->twcent[1]= G.scene->twcent[2]= 0.0f; - INIT_MINMAX(G.scene->twmin, G.scene->twmax); + scene->twcent[0]= scene->twcent[1]= scene->twcent[2]= 0.0f; + INIT_MINMAX(scene->twmin, scene->twmax); - if(t->obedit) { - ob= t->obedit; - if((ob->lay & G.vd->lay)==0) return 0; + if(obedit) { + ob= obedit; + if((ob->lay & v3d->lay)==0) return 0; - if(t->obedit->type==OB_MESH) { - EditMesh *em = NULL; // TRANSFORM_FIX_ME + if(obedit->type==OB_MESH) { + EditMesh *em = BKE_mesh_get_editmesh(obedit->data); EditVert *eve; EditSelection ese; float vec[3]= {0,0,0}; /* USE LAST SELECTE WITH ACTIVE */ - if (G.vd->around==V3D_ACTIVE && EM_get_actSelection(&ese)) { + if (v3d->around==V3D_ACTIVE && EM_get_actSelection(em, &ese)) { EM_editselection_center(vec, &ese); - calc_tw_center(vec); + calc_tw_center(scene, vec); totsel= 1; } else { /* do vertices for center, and if still no normal found, use vertex normals */ for(eve= em->verts.first; eve; eve= eve->next) { if(eve->f & SELECT) { totsel++; - calc_tw_center(eve->co); + calc_tw_center(scene, eve->co); } } } } /* end editmesh */ - else if (t->obedit->type==OB_ARMATURE){ - bArmature *arm= t->obedit->data; + else if (obedit->type==OB_ARMATURE){ + bArmature *arm= obedit->data; EditBone *ebo; - for (ebo=G.edbo.first;ebo;ebo=ebo->next){ + for (ebo= arm->edbo->first; ebo; ebo=ebo->next){ if(ebo->layer & arm->layer) { if (ebo->flag & BONE_TIPSEL) { - calc_tw_center(ebo->tail); + calc_tw_center(scene, ebo->tail); totsel++; } if (ebo->flag & BONE_ROOTSEL) { - calc_tw_center(ebo->head); + calc_tw_center(scene, ebo->head); totsel++; } if (ebo->flag & BONE_SELECTED) { @@ -274,8 +268,8 @@ int calc_manipulator_stats(ScrArea *sa) } } } - else if ELEM(t->obedit->type, OB_CURVE, OB_SURF) { - Curve *cu= t->obedit->data; + else if ELEM(obedit->type, OB_CURVE, OB_SURF) { + Curve *cu= obedit->data; Nurb *nu; BezTriple *bezt; BPoint *bp; @@ -292,25 +286,25 @@ int calc_manipulator_stats(ScrArea *sa) */ if (G.f & G_HIDDENHANDLES) { if (bezt->f2 & SELECT) { - calc_tw_center(bezt->vec[1]); + calc_tw_center(scene, bezt->vec[1]); totsel++; } } else if ( (bezt->f1 & SELECT) + (bezt->f2 & SELECT) + (bezt->f3 & SELECT) > SELECT ) { - calc_tw_center(bezt->vec[1]); + calc_tw_center(scene, bezt->vec[1]); totsel++; } else { if(bezt->f1) { - calc_tw_center(bezt->vec[0]); + calc_tw_center(scene, bezt->vec[0]); totsel++; } if(bezt->f2) { - calc_tw_center(bezt->vec[1]); + calc_tw_center(scene, bezt->vec[1]); totsel++; } if(bezt->f3) { - calc_tw_center(bezt->vec[2]); + calc_tw_center(scene, bezt->vec[2]); totsel++; } } @@ -322,7 +316,7 @@ int calc_manipulator_stats(ScrArea *sa) a= nu->pntsu*nu->pntsv; while(a--) { if(bp->f1 & SELECT) { - calc_tw_center(bp->vec); + calc_tw_center(scene, bp->vec); totsel++; } bp++; @@ -331,29 +325,31 @@ int calc_manipulator_stats(ScrArea *sa) nu= nu->next; } } - else if(t->obedit->type==OB_MBALL) { + else if(obedit->type==OB_MBALL) { /* editmball.c */ - extern ListBase editelems; /* go away ! */ + ListBase editelems= {NULL, NULL}; /* XXX */ MetaElem *ml, *ml_sel=NULL; ml= editelems.first; while(ml) { if(ml->flag & SELECT) { - calc_tw_center(&ml->x); + calc_tw_center(scene, &ml->x); ml_sel = ml; totsel++; } ml= ml->next; } } - else if(t->obedit->type==OB_LATTICE) { + else if(obedit->type==OB_LATTICE) { BPoint *bp; - bp= editLatt->def; + Lattice *lt= obedit->data; + + bp= lt->editlatt->def; - a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; + a= lt->editlatt->pntsu*lt->editlatt->pntsv*lt->editlatt->pntsw; while(a--) { if(bp->f1 & SELECT) { - calc_tw_center(bp->vec); + calc_tw_center(scene, bp->vec); totsel++; } bp++; @@ -362,10 +358,10 @@ int calc_manipulator_stats(ScrArea *sa) /* selection center */ if(totsel) { - VecMulf(G.scene->twcent, 1.0f/(float)totsel); // centroid! - Mat4MulVecfl(t->obedit->obmat, G.scene->twcent); - Mat4MulVecfl(t->obedit->obmat, G.scene->twmin); - Mat4MulVecfl(t->obedit->obmat, G.scene->twmax); + VecMulf(scene->twcent, 1.0f/(float)totsel); // centroid! + Mat4MulVecfl(obedit->obmat, scene->twcent); + Mat4MulVecfl(obedit->obmat, scene->twmin); + Mat4MulVecfl(obedit->obmat, scene->twmax); } } else if(ob && (ob->flag & OB_POSEMODE)) { @@ -373,34 +369,34 @@ int calc_manipulator_stats(ScrArea *sa) bPoseChannel *pchan; int mode; - if((ob->lay & G.vd->lay)==0) return 0; + if((ob->lay & v3d->lay)==0) return 0; - mode = Trans.mode; - Trans.mode = TFM_ROTATION; // mislead counting bones... bah + mode = t->mode; + t->mode = TFM_ROTATION; // mislead counting bones... bah /* count total, we use same method as transform will do */ - Trans.total= 0; - count_bone_select(&Trans, arm, &arm->bonebase, 1); - totsel = Trans.total; + t->total= 0; + count_bone_select(t, arm, &arm->bonebase, 1); + totsel = t->total; if(totsel) { /* use channels to get stats */ for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - stats_pose(v3d, pchan); + stats_pose(scene, v3d, pchan); } - VecMulf(G.scene->twcent, 1.0f/(float)totsel); // centroid! - Mat4MulVecfl(ob->obmat, G.scene->twcent); - Mat4MulVecfl(ob->obmat, G.scene->twmin); - Mat4MulVecfl(ob->obmat, G.scene->twmax); + VecMulf(scene->twcent, 1.0f/(float)totsel); // centroid! + Mat4MulVecfl(ob->obmat, scene->twcent); + Mat4MulVecfl(ob->obmat, scene->twmin); + Mat4MulVecfl(ob->obmat, scene->twmax); } /* restore, mode can be TFM_INIT */ - Trans.mode = mode; + t->mode = mode; } else if(G.f & (G_VERTEXPAINT + G_TEXTUREPAINT + G_WEIGHTPAINT + G_SCULPTMODE)) { ; } else if(G.f & G_PARTICLEEDIT) { - ParticleSystem *psys=PE_get_current(OBACT); + ParticleSystem *psys= PE_get_current(scene, ob); ParticleData *pa = psys->particles; ParticleEditKey *ek; int k; @@ -411,7 +407,7 @@ int calc_manipulator_stats(ScrArea *sa) for(k=0, ek=psys->edit->keys[a]; ktotkey; k++, ek++) { if(ek->flag & PEK_SELECT) { - calc_tw_center(ek->world_co); + calc_tw_center(scene, ek->world_co); totsel++; } } @@ -419,7 +415,7 @@ int calc_manipulator_stats(ScrArea *sa) /* selection center */ if(totsel) - VecMulf(G.scene->twcent, 1.0f/(float)totsel); // centroid! + VecMulf(scene->twcent, 1.0f/(float)totsel); // centroid! } } else { @@ -428,11 +424,11 @@ int calc_manipulator_stats(ScrArea *sa) ob= OBACT; if(ob && !(ob->flag & SELECT)) ob= NULL; - for(base= G.scene->base.first; base; base= base->next) { - if TESTBASELIB(base) { + for(base= scene->base.first; base; base= base->next) { + if TESTBASELIB(scene, base) { if(ob==NULL) ob= base->object; - calc_tw_center(base->object->obmat[3]); + calc_tw_center(scene, base->object->obmat[3]); protectflag_to_drawflags(base->object->protectflag, &v3d->twdrawflag); totsel++; } @@ -440,7 +436,7 @@ int calc_manipulator_stats(ScrArea *sa) /* selection center */ if(totsel) { - VecMulf(G.scene->twcent, 1.0f/(float)totsel); // centroid! + VecMulf(scene->twcent, 1.0f/(float)totsel); // centroid! } } @@ -453,13 +449,13 @@ int calc_manipulator_stats(ScrArea *sa) break; case V3D_MANIP_NORMAL: - if(t->obedit || ob->flag & OB_POSEMODE) { + if(obedit || ob->flag & OB_POSEMODE) { float mat[3][3]; int type; strcpy(t->spacename, "normal"); - type = getTransformOrientation(normal, plane, (G.vd->around == V3D_ACTIVE)); + type = getTransformOrientation(C, normal, plane, (v3d->around == V3D_ACTIVE)); switch (type) { @@ -491,32 +487,32 @@ int calc_manipulator_stats(ScrArea *sa) if (type == ORIENTATION_NONE) { - Mat4One(v3d->twmat); + Mat4One(rv3d->twmat); } else { - Mat4CpyMat3(v3d->twmat, mat); + Mat4CpyMat3(rv3d->twmat, mat); } break; } /* no break we define 'normal' as 'local' in Object mode */ case V3D_MANIP_LOCAL: strcpy(t->spacename, "local"); - Mat4CpyMat4(v3d->twmat, ob->obmat); - Mat4Ortho(v3d->twmat); + Mat4CpyMat4(rv3d->twmat, ob->obmat); + Mat4Ortho(rv3d->twmat); break; case V3D_MANIP_VIEW: { float mat[3][3]; strcpy(t->spacename, "view"); - Mat3CpyMat4(mat, v3d->viewinv); + Mat3CpyMat4(mat, rv3d->viewinv); Mat3Ortho(mat); - Mat4CpyMat3(v3d->twmat, mat); + Mat4CpyMat3(rv3d->twmat, mat); } break; default: /* V3D_MANIP_CUSTOM */ - applyTransformOrientation(); + applyTransformOrientation(C, t); break; } @@ -527,7 +523,7 @@ int calc_manipulator_stats(ScrArea *sa) /* ******************** DRAWING STUFFIES *********** */ -static float screen_aligned(float mat[][4]) +static float screen_aligned(RegionView3D *rv3d, float mat[][4]) { float vec[3], size; @@ -537,7 +533,7 @@ static float screen_aligned(float mat[][4]) glTranslatef(mat[3][0], mat[3][1], mat[3][2]); /* sets view screen aligned */ - glRotatef( -360.0f*saacos(G.vd->viewquat[0])/(float)M_PI, G.vd->viewquat[1], G.vd->viewquat[2], G.vd->viewquat[3]); + glRotatef( -360.0f*saacos(rv3d->viewquat[0])/(float)M_PI, rv3d->viewquat[1], rv3d->viewquat[2], rv3d->viewquat[3]); return size; } @@ -632,7 +628,7 @@ static void partial_donut(float radring, float radhole, int start, int end, int moving: in transform theme color else the red/green/blue */ -static void manipulator_setcolor(char axis, int colcode) +static void manipulator_setcolor(View3D *v3d, char axis, int colcode) { float vec[4]; char col[4]; @@ -643,19 +639,19 @@ static void manipulator_setcolor(char axis, int colcode) glColor4ub(0, 0, 0, 70); } else if(colcode==MAN_MOVECOL) { - BIF_GetThemeColor3ubv(TH_TRANSFORM, col); + UI_GetThemeColor3ubv(TH_TRANSFORM, col); glColor4ub(col[0], col[1], col[2], 128); } else { switch(axis) { case 'c': - BIF_GetThemeColor3ubv(TH_TRANSFORM, col); - if(G.vd->twmode == V3D_MANIP_LOCAL) { + UI_GetThemeColor3ubv(TH_TRANSFORM, col); + if(v3d->twmode == V3D_MANIP_LOCAL) { col[0]= col[0]>200?255:col[0]+55; col[1]= col[1]>200?255:col[1]+55; col[2]= col[2]>200?255:col[2]+55; } - else if(G.vd->twmode == V3D_MANIP_NORMAL) { + else if(v3d->twmode == V3D_MANIP_NORMAL) { col[0]= col[0]<55?0:col[0]-55; col[1]= col[1]<55?0:col[1]-55; col[2]= col[2]<55?0:col[2]-55; @@ -676,12 +672,12 @@ static void manipulator_setcolor(char axis, int colcode) } /* viewmatrix should have been set OK, also no shademode! */ -static void draw_manipulator_axes(int colcode, int flagx, int flagy, int flagz) +static void draw_manipulator_axes(View3D *v3d, int colcode, int flagx, int flagy, int flagz) { /* axes */ if(flagx) { - manipulator_setcolor('x', colcode); + manipulator_setcolor(v3d, 'x', colcode); if(flagx & MAN_SCALE_X) glLoadName(MAN_SCALE_X); else if(flagx & MAN_TRANS_X) glLoadName(MAN_TRANS_X); glBegin(GL_LINES); @@ -692,7 +688,7 @@ static void draw_manipulator_axes(int colcode, int flagx, int flagy, int flagz) if(flagy) { if(flagy & MAN_SCALE_Y) glLoadName(MAN_SCALE_Y); else if(flagy & MAN_TRANS_Y) glLoadName(MAN_TRANS_Y); - manipulator_setcolor('y', colcode); + manipulator_setcolor(v3d, 'y', colcode); glBegin(GL_LINES); glVertex3f(0.0f, 0.2f, 0.0f); glVertex3f(0.0f, 1.0f, 0.0f); @@ -701,7 +697,7 @@ static void draw_manipulator_axes(int colcode, int flagx, int flagy, int flagz) if(flagz) { if(flagz & MAN_SCALE_Z) glLoadName(MAN_SCALE_Z); else if(flagz & MAN_TRANS_Z) glLoadName(MAN_TRANS_Z); - manipulator_setcolor('z', colcode); + manipulator_setcolor(v3d, 'z', colcode); glBegin(GL_LINES); glVertex3f(0.0f, 0.0f, 0.2f); glVertex3f(0.0f, 0.0f, 1.0f); @@ -710,8 +706,9 @@ static void draw_manipulator_axes(int colcode, int flagx, int flagy, int flagz) } /* only called while G.moving */ -static void draw_manipulator_rotate_ghost(float mat[][4], int drawflags) +static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int drawflags) { + TransInfo *t= BIF_GetTransInfo(); // XXX GLUquadricObj *qobj; float size, phi, startphi, vec[3], svec[3], matt[4][4], cross[3], tmat[3][3]; int arcs= (G.rt!=2); @@ -725,26 +722,26 @@ static void draw_manipulator_rotate_ghost(float mat[][4], int drawflags) glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); - /* we need both [4][4] transforms, Trans.mat seems to be premul, not post for mat[][4] */ - Mat4CpyMat4(matt, mat); // to copy the parts outside of [3][3] - Mat4MulMat34(matt, Trans.mat, mat); + /* we need both [4][4] transforms, t->mat seems to be premul, not post for mat[][4] */ + Mat4CpyMat4(matt, rv3d->twmat); // to copy the parts outside of [3][3] + Mat4MulMat34(matt, t->mat, rv3d->twmat); /* Screen aligned view rot circle */ if(drawflags & MAN_ROT_V) { /* prepare for screen aligned draw */ glPushMatrix(); - size= screen_aligned(mat); + size= screen_aligned(rv3d, rv3d->twmat); - vec[0]= (float)(Trans.con.imval[0] - Trans.center2d[0]); - vec[1]= (float)(Trans.con.imval[1] - Trans.center2d[1]); + vec[0]= (float)(t->con.imval[0] - t->center2d[0]); + vec[1]= (float)(t->con.imval[1] - t->center2d[1]); vec[2]= 0.0f; Normalize(vec); startphi= saacos( vec[1] ); if(vec[0]<0.0) startphi= -startphi; - phi= (float)fmod(180.0*Trans.val/M_PI, 360.0); + phi= (float)fmod(180.0*t->val/M_PI, 360.0); if(phi > 180.0) phi-= 360.0; else if(phi<-180.0) phi+= 360.0; @@ -756,13 +753,13 @@ static void draw_manipulator_rotate_ghost(float mat[][4], int drawflags) float imat[3][3], ivmat[3][3]; /* try to get the start rotation */ - svec[0]= (float)(Trans.con.imval[0] - Trans.center2d[0]); - svec[1]= (float)(Trans.con.imval[1] - Trans.center2d[1]); + svec[0]= (float)(t->con.imval[0] - t->center2d[0]); + svec[1]= (float)(t->con.imval[1] - t->center2d[1]); svec[2]= 0.0f; /* screen aligned vec transform back to manipulator space */ - Mat3CpyMat4(ivmat, G.vd->viewinv); - Mat3CpyMat4(tmat, mat); + Mat3CpyMat4(ivmat, rv3d->viewinv); + Mat3CpyMat4(tmat, rv3d->twmat); Mat3Inv(imat, tmat); Mat3MulMat3(tmat, imat, ivmat); @@ -770,7 +767,7 @@ static void draw_manipulator_rotate_ghost(float mat[][4], int drawflags) Normalize(svec); } - mymultmatrix(mat); // aligns with original widget + wmMultMatrix(rv3d->twmat); // aligns with original widget /* Z disk */ if(drawflags & MAN_ROT_Z) { @@ -784,13 +781,13 @@ static void draw_manipulator_rotate_ghost(float mat[][4], int drawflags) } else startphi= 0.5f*(float)M_PI; - VECCOPY(vec, mat[0]); // use x axis to detect rotation + VECCOPY(vec, rv3d->twmat[0]); // use x axis to detect rotation Normalize(vec); Normalize(matt[0]); phi= saacos( Inpf(vec, matt[0]) ); if(phi!=0.0) { Crossf(cross, vec, matt[0]); // results in z vector - if(Inpf(cross, mat[2]) > 0.0) phi= -phi; + if(Inpf(cross, rv3d->twmat[2]) > 0.0) phi= -phi; gluPartialDisk(qobj, 0.0, 1.0, 32, 1, 180.0*startphi/M_PI, 180.0*(phi)/M_PI); } } @@ -806,13 +803,13 @@ static void draw_manipulator_rotate_ghost(float mat[][4], int drawflags) } else startphi= 0.0f; - VECCOPY(vec, mat[1]); // use y axis to detect rotation + VECCOPY(vec, rv3d->twmat[1]); // use y axis to detect rotation Normalize(vec); Normalize(matt[1]); phi= saacos( Inpf(vec, matt[1]) ); if(phi!=0.0) { Crossf(cross, vec, matt[1]); // results in x vector - if(Inpf(cross, mat[0]) > 0.0) phi= -phi; + if(Inpf(cross, rv3d->twmat[0]) > 0.0) phi= -phi; glRotatef(90.0, 0.0, 1.0, 0.0); gluPartialDisk(qobj, 0.0, 1.0, 32, 1, 180.0*startphi/M_PI, 180.0*phi/M_PI); glRotatef(-90.0, 0.0, 1.0, 0.0); @@ -830,13 +827,13 @@ static void draw_manipulator_rotate_ghost(float mat[][4], int drawflags) } else startphi= (float)M_PI; - VECCOPY(vec, mat[2]); // use z axis to detect rotation + VECCOPY(vec, rv3d->twmat[2]); // use z axis to detect rotation Normalize(vec); Normalize(matt[2]); phi= saacos( Inpf(vec, matt[2]) ); if(phi!=0.0) { Crossf(cross, vec, matt[2]); // results in y vector - if(Inpf(cross, mat[1]) > 0.0) phi= -phi; + if(Inpf(cross, rv3d->twmat[1]) > 0.0) phi= -phi; glRotatef(-90.0, 1.0, 0.0, 0.0); gluPartialDisk(qobj, 0.0, 1.0, 32, 1, 180.0*startphi/M_PI, 180.0*phi/M_PI); glRotatef(90.0, 1.0, 0.0, 0.0); @@ -844,11 +841,12 @@ static void draw_manipulator_rotate_ghost(float mat[][4], int drawflags) } glDisable(GL_BLEND); - myloadmatrix(G.vd->viewmat); + wmLoadMatrix(rv3d->viewmat); } -static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, int combo) +static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo) { + TransInfo *t= BIF_GetTransInfo(); // XXX GLUquadricObj *qobj; double plane[4]; float size, vec[3], unitmat[4][4]; @@ -871,37 +869,37 @@ static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, i gluQuadricDrawStyle(qobj, GLU_FILL); /* prepare for screen aligned draw */ - VECCOPY(vec, mat[0]); + VECCOPY(vec, rv3d->twmat[0]); size= Normalize(vec); glPushMatrix(); - glTranslatef(mat[3][0], mat[3][1], mat[3][2]); + glTranslatef(rv3d->twmat[3][0], rv3d->twmat[3][1], rv3d->twmat[3][2]); if(arcs) { /* clipplane makes nice handles, calc here because of multmatrix but with translate! */ - VECCOPY(plane, G.vd->viewinv[2]); + VECCOPY(plane, rv3d->viewinv[2]); plane[3]= -0.02*size; // clip just a bit more glClipPlane(GL_CLIP_PLANE0, plane); } /* sets view screen aligned */ - glRotatef( -360.0f*saacos(G.vd->viewquat[0])/(float)M_PI, G.vd->viewquat[1], G.vd->viewquat[2], G.vd->viewquat[3]); + glRotatef( -360.0f*saacos(rv3d->viewquat[0])/(float)M_PI, rv3d->viewquat[1], rv3d->viewquat[2], rv3d->viewquat[3]); /* Screen aligned help circle */ if(arcs) { if((G.f & G_PICKSEL)==0) { - BIF_ThemeColorShade(TH_BACK, -30); + UI_ThemeColorShade(TH_BACK, -30); drawcircball(GL_LINE_LOOP, unitmat[3], size, unitmat); } } /* Screen aligned view rot circle */ if(drawflags & MAN_ROT_V) { if(G.f & G_PICKSEL) glLoadName(MAN_ROT_V); - BIF_ThemeColor(TH_TRANSFORM); + UI_ThemeColor(TH_TRANSFORM); drawcircball(GL_LINE_LOOP, unitmat[3], 1.2f*size, unitmat); if(moving) { float vec[3]; - vec[0]= (float)(Trans.imval[0] - Trans.center2d[0]); - vec[1]= (float)(Trans.imval[1] - Trans.center2d[1]); + vec[0]= (float)(t->imval[0] - t->center2d[0]); + vec[1]= (float)(t->imval[1] - t->center2d[1]); vec[2]= 0.0f; Normalize(vec); VecMulf(vec, 1.2f*size); @@ -916,14 +914,14 @@ static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, i /* apply the transform delta */ if(moving) { float matt[4][4]; - Mat4CpyMat4(matt, mat); // to copy the parts outside of [3][3] - Mat4MulMat34(matt, Trans.mat, mat); - mymultmatrix(matt); + Mat4CpyMat4(matt, rv3d->twmat); // to copy the parts outside of [3][3] + Mat4MulMat34(matt, t->mat, rv3d->twmat); + wmMultMatrix(matt); glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW); } else { - glFrontFace( is_mat4_flipped(mat)?GL_CW:GL_CCW); - mymultmatrix(mat); + glFrontFace( is_mat4_flipped(rv3d->twmat)?GL_CW:GL_CCW); + wmMultMatrix(rv3d->twmat); } /* axes */ @@ -933,17 +931,17 @@ static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, i /* axis */ glBegin(GL_LINES); if( (drawflags & MAN_ROT_X) || (moving && (drawflags & MAN_ROT_Z)) ) { - manipulator_setcolor('x', colcode); + manipulator_setcolor(v3d, 'x', colcode); glVertex3f(0.2f, 0.0f, 0.0f); glVertex3f(1.0f, 0.0f, 0.0f); } if( (drawflags & MAN_ROT_Y) || (moving && (drawflags & MAN_ROT_X)) ) { - manipulator_setcolor('y', colcode); + manipulator_setcolor(v3d, 'y', colcode); glVertex3f(0.0f, 0.2f, 0.0f); glVertex3f(0.0f, 1.0f, 0.0f); } if( (drawflags & MAN_ROT_Z) || (moving && (drawflags & MAN_ROT_Y)) ) { - manipulator_setcolor('z', colcode); + manipulator_setcolor(v3d, 'z', colcode); glVertex3f(0.0f, 0.0f, 0.2f); glVertex3f(0.0f, 0.0f, 1.0f); } @@ -957,14 +955,14 @@ static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, i /* Z circle */ if(drawflags & MAN_ROT_Z) { if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z); - manipulator_setcolor('z', colcode); + manipulator_setcolor(v3d, 'z', colcode); drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat); } /* X circle */ if(drawflags & MAN_ROT_X) { if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X); glRotatef(90.0, 0.0, 1.0, 0.0); - manipulator_setcolor('x', colcode); + manipulator_setcolor(v3d, 'x', colcode); drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat); glRotatef(-90.0, 0.0, 1.0, 0.0); } @@ -972,7 +970,7 @@ static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, i if(drawflags & MAN_ROT_Y) { if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y); glRotatef(-90.0, 1.0, 0.0, 0.0); - manipulator_setcolor('y', colcode); + manipulator_setcolor(v3d, 'y', colcode); drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat); glRotatef(90.0, 1.0, 0.0, 0.0); } @@ -986,14 +984,14 @@ static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, i /* Z circle */ if(drawflags & MAN_ROT_Z) { if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z); - manipulator_setcolor('z', colcode); + manipulator_setcolor(v3d, 'z', colcode); partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48); } /* X circle */ if(drawflags & MAN_ROT_X) { if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X); glRotatef(90.0, 0.0, 1.0, 0.0); - manipulator_setcolor('x', colcode); + manipulator_setcolor(v3d, 'x', colcode); partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48); glRotatef(-90.0, 0.0, 1.0, 0.0); } @@ -1001,7 +999,7 @@ static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, i if(drawflags & MAN_ROT_Y) { if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y); glRotatef(-90.0, 1.0, 0.0, 0.0); - manipulator_setcolor('y', colcode); + manipulator_setcolor(v3d, 'y', colcode); partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48); glRotatef(90.0, 1.0, 0.0, 0.0); } @@ -1015,7 +1013,7 @@ static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, i if(drawflags & MAN_ROT_Z) { glPushMatrix(); if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z); - manipulator_setcolor('z', colcode); + manipulator_setcolor(v3d, 'z', colcode); partial_donut(0.7f*cusize, 1.0f, 31, 33, 8, 64); @@ -1026,7 +1024,7 @@ static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, i if(drawflags & MAN_ROT_Y) { glPushMatrix(); if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y); - manipulator_setcolor('y', colcode); + manipulator_setcolor(v3d, 'y', colcode); glRotatef(90.0, 1.0, 0.0, 0.0); glRotatef(90.0, 0.0, 0.0, 1.0); @@ -1039,7 +1037,7 @@ static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, i if(drawflags & MAN_ROT_X) { glPushMatrix(); if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X); - manipulator_setcolor('x', colcode); + manipulator_setcolor(v3d, 'x', colcode); glRotatef(-90.0, 0.0, 1.0, 0.0); glRotatef(90.0, 0.0, 0.0, 1.0); @@ -1051,14 +1049,77 @@ static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, i } /* restore */ - myloadmatrix(G.vd->viewmat); + wmLoadMatrix(rv3d->viewmat); gluDeleteQuadric(qobj); - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); + if(v3d->zbuf) glEnable(GL_DEPTH_TEST); + +} + +static void drawsolidcube(float size) +{ + static float cube[8][3] = { + {-1.0, -1.0, -1.0}, + {-1.0, -1.0, 1.0}, + {-1.0, 1.0, 1.0}, + {-1.0, 1.0, -1.0}, + { 1.0, -1.0, -1.0}, + { 1.0, -1.0, 1.0}, + { 1.0, 1.0, 1.0}, + { 1.0, 1.0, -1.0}, }; + float n[3]; + glPushMatrix(); + glScalef(size, size, size); + + n[0]=0; n[1]=0; n[2]=0; + glBegin(GL_QUADS); + n[0]= -1.0; + glNormal3fv(n); + glVertex3fv(cube[0]); glVertex3fv(cube[1]); glVertex3fv(cube[2]); glVertex3fv(cube[3]); + n[0]=0; + glEnd(); + + glBegin(GL_QUADS); + n[1]= -1.0; + glNormal3fv(n); + glVertex3fv(cube[0]); glVertex3fv(cube[4]); glVertex3fv(cube[5]); glVertex3fv(cube[1]); + n[1]=0; + glEnd(); + + glBegin(GL_QUADS); + n[0]= 1.0; + glNormal3fv(n); + glVertex3fv(cube[4]); glVertex3fv(cube[7]); glVertex3fv(cube[6]); glVertex3fv(cube[5]); + n[0]=0; + glEnd(); + + glBegin(GL_QUADS); + n[1]= 1.0; + glNormal3fv(n); + glVertex3fv(cube[7]); glVertex3fv(cube[3]); glVertex3fv(cube[2]); glVertex3fv(cube[6]); + n[1]=0; + glEnd(); + + glBegin(GL_QUADS); + n[2]= 1.0; + glNormal3fv(n); + glVertex3fv(cube[1]); glVertex3fv(cube[5]); glVertex3fv(cube[6]); glVertex3fv(cube[2]); + n[2]=0; + glEnd(); + + glBegin(GL_QUADS); + n[2]= -1.0; + glNormal3fv(n); + glVertex3fv(cube[7]); glVertex3fv(cube[4]); glVertex3fv(cube[0]); glVertex3fv(cube[3]); + glEnd(); + + glPopMatrix(); } -static void draw_manipulator_scale(float mat[][4], int moving, int drawflags, int combo, int colcode) + +static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo, int colcode) { + TransInfo *t= BIF_GetTransInfo(); // XXX float cywid= 0.25f*0.01f*(float)U.tw_handlesize; float cusize= cywid*0.75f, dz; @@ -1070,13 +1131,14 @@ static void draw_manipulator_scale(float mat[][4], int moving, int drawflags, in /* not in combo mode */ if( (combo & (V3D_MANIP_TRANSLATE|V3D_MANIP_ROTATE))==0) { float size, unitmat[4][4]; + int shift= 0; // XXX /* center circle, do not add to selection when shift is pressed (planar constraint) */ - if( (G.f & G_PICKSEL) && (G.qual & LR_SHIFTKEY)==0) glLoadName(MAN_SCALE_C); + if( (G.f & G_PICKSEL) && shift==0) glLoadName(MAN_SCALE_C); - manipulator_setcolor('c', colcode); + manipulator_setcolor(v3d, 'c', colcode); glPushMatrix(); - size= screen_aligned(mat); + size= screen_aligned(rv3d, rv3d->twmat); Mat4One(unitmat); drawcircball(GL_LINE_LOOP, unitmat[3], 0.2f*size, unitmat); glPopMatrix(); @@ -1088,46 +1150,48 @@ static void draw_manipulator_scale(float mat[][4], int moving, int drawflags, in if(moving) { float matt[4][4]; - Mat4CpyMat4(matt, mat); // to copy the parts outside of [3][3] - Mat4MulMat34(matt, Trans.mat, mat); - mymultmatrix(matt); + Mat4CpyMat4(matt, rv3d->twmat); // to copy the parts outside of [3][3] + Mat4MulMat34(matt, t->mat, rv3d->twmat); + wmMultMatrix(matt); glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW); } else { - mymultmatrix(mat); - glFrontFace( is_mat4_flipped(mat)?GL_CW:GL_CCW); + wmMultMatrix(rv3d->twmat); + glFrontFace( is_mat4_flipped(rv3d->twmat)?GL_CW:GL_CCW); } /* axis */ /* in combo mode, this is always drawn as first type */ - draw_manipulator_axes(colcode, drawflags & MAN_SCALE_X, drawflags & MAN_SCALE_Y, drawflags & MAN_SCALE_Z); + draw_manipulator_axes(v3d, colcode, drawflags & MAN_SCALE_X, drawflags & MAN_SCALE_Y, drawflags & MAN_SCALE_Z); /* Z cube */ glTranslatef(0.0, 0.0, dz); if(drawflags & MAN_SCALE_Z) { if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_Z); - manipulator_setcolor('z', colcode); + manipulator_setcolor(v3d, 'z', colcode); drawsolidcube(cusize); } /* X cube */ glTranslatef(dz, 0.0, -dz); if(drawflags & MAN_SCALE_X) { if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_X); - manipulator_setcolor('x', colcode); + manipulator_setcolor(v3d, 'x', colcode); drawsolidcube(cusize); } /* Y cube */ glTranslatef(-dz, dz, 0.0); if(drawflags & MAN_SCALE_Y) { if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_Y); - manipulator_setcolor('y', colcode); + manipulator_setcolor(v3d, 'y', colcode); drawsolidcube(cusize); } /* if shiftkey, center point as last, for selectbuffer order */ if(G.f & G_PICKSEL) { - if(G.qual & LR_SHIFTKEY) { + int shift= 0; // XXX + + if(shift) { glTranslatef(0.0, -dz, 0.0); glLoadName(MAN_SCALE_C); glBegin(GL_POINTS); @@ -1137,9 +1201,9 @@ static void draw_manipulator_scale(float mat[][4], int moving, int drawflags, in } /* restore */ - myloadmatrix(G.vd->viewmat); + wmLoadMatrix(rv3d->viewmat); - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); + if(v3d->zbuf) glEnable(GL_DEPTH_TEST); glFrontFace(GL_CCW); } @@ -1170,41 +1234,43 @@ static void draw_cylinder(GLUquadricObj *qobj, float len, float width) } -static void draw_manipulator_translate(float mat[][4], int moving, int drawflags, int combo, int colcode) +static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo, int colcode) { + TransInfo *t= BIF_GetTransInfo(); // XXX GLUquadricObj *qobj; float cylen= 0.01f*(float)U.tw_handlesize; float cywid= 0.25f*cylen, dz, size; float unitmat[4][4]; + int shift= 0; // XXX /* when called while moving in mixed mode, do not draw when... */ if((drawflags & MAN_TRANS_C)==0) return; - if(moving) glTranslatef(Trans.vec[0], Trans.vec[1], Trans.vec[2]); + if(moving) glTranslatef(t->vec[0], t->vec[1], t->vec[2]); glDisable(GL_DEPTH_TEST); qobj= gluNewQuadric(); gluQuadricDrawStyle(qobj, GLU_FILL); /* center circle, do not add to selection when shift is pressed (planar constraint) */ - if( (G.f & G_PICKSEL) && (G.qual & LR_SHIFTKEY)==0) glLoadName(MAN_TRANS_C); + if( (G.f & G_PICKSEL) && shift==0) glLoadName(MAN_TRANS_C); - manipulator_setcolor('c', colcode); + manipulator_setcolor(v3d, 'c', colcode); glPushMatrix(); - size= screen_aligned(mat); + size= screen_aligned(rv3d, rv3d->twmat); Mat4One(unitmat); drawcircball(GL_LINE_LOOP, unitmat[3], 0.2f*size, unitmat); glPopMatrix(); /* and now apply matrix, we move to local matrix drawing */ - mymultmatrix(mat); + wmMultMatrix(rv3d->twmat); /* axis */ glLoadName(-1); // translate drawn as last, only axis when no combo with scale, or for ghosting if((combo & V3D_MANIP_SCALE)==0 || colcode==MAN_GHOST) - draw_manipulator_axes(colcode, drawflags & MAN_TRANS_X, drawflags & MAN_TRANS_Y, drawflags & MAN_TRANS_Z); + draw_manipulator_axes(v3d, colcode, drawflags & MAN_TRANS_X, drawflags & MAN_TRANS_Y, drawflags & MAN_TRANS_Z); /* offset in combo mode, for rotate a bit more */ @@ -1216,7 +1282,7 @@ static void draw_manipulator_translate(float mat[][4], int moving, int drawflags glTranslatef(0.0, 0.0, dz); if(drawflags & MAN_TRANS_Z) { if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_Z); - manipulator_setcolor('z', colcode); + manipulator_setcolor(v3d, 'z', colcode); draw_cone(qobj, cylen, cywid); } /* X Cone */ @@ -1224,7 +1290,7 @@ static void draw_manipulator_translate(float mat[][4], int moving, int drawflags if(drawflags & MAN_TRANS_X) { if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_X); glRotatef(90.0, 0.0, 1.0, 0.0); - manipulator_setcolor('x', colcode); + manipulator_setcolor(v3d, 'x', colcode); draw_cone(qobj, cylen, cywid); glRotatef(-90.0, 0.0, 1.0, 0.0); } @@ -1233,19 +1299,20 @@ static void draw_manipulator_translate(float mat[][4], int moving, int drawflags if(drawflags & MAN_TRANS_Y) { if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_Y); glRotatef(-90.0, 1.0, 0.0, 0.0); - manipulator_setcolor('y', colcode); + manipulator_setcolor(v3d, 'y', colcode); draw_cone(qobj, cylen, cywid); } gluDeleteQuadric(qobj); - myloadmatrix(G.vd->viewmat); + wmLoadMatrix(rv3d->viewmat); - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); + if(v3d->zbuf) glEnable(GL_DEPTH_TEST); } -static void draw_manipulator_rotate_cyl(float mat[][4], int moving, int drawflags, int combo, int colcode) +static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo, int colcode) { + TransInfo *t= BIF_GetTransInfo(); // XXX GLUquadricObj *qobj; float size; float cylen= 0.01f*(float)U.tw_handlesize; @@ -1256,7 +1323,7 @@ static void draw_manipulator_rotate_cyl(float mat[][4], int moving, int drawflag /* prepare for screen aligned draw */ glPushMatrix(); - size= screen_aligned(mat); + size= screen_aligned(rv3d, rv3d->twmat); glDisable(GL_DEPTH_TEST); @@ -1268,13 +1335,13 @@ static void draw_manipulator_rotate_cyl(float mat[][4], int moving, int drawflag Mat4One(unitmat); if(G.f & G_PICKSEL) glLoadName(MAN_ROT_V); - BIF_ThemeColor(TH_TRANSFORM); + UI_ThemeColor(TH_TRANSFORM); drawcircball(GL_LINE_LOOP, unitmat[3], 1.2f*size, unitmat); if(moving) { float vec[3]; - vec[0]= (float)(Trans.imval[0] - Trans.center2d[0]); - vec[1]= (float)(Trans.imval[1] - Trans.center2d[1]); + vec[0]= (float)(t->imval[0] - t->center2d[0]); + vec[1]= (float)(t->imval[1] - t->center2d[1]); vec[2]= 0.0f; Normalize(vec); VecMulf(vec, 1.2f*size); @@ -1289,24 +1356,24 @@ static void draw_manipulator_rotate_cyl(float mat[][4], int moving, int drawflag /* apply the transform delta */ if(moving) { float matt[4][4]; - Mat4CpyMat4(matt, mat); // to copy the parts outside of [3][3] - if (Trans.flag & T_USES_MANIPULATOR) { - Mat4MulMat34(matt, Trans.mat, mat); + Mat4CpyMat4(matt, rv3d->twmat); // to copy the parts outside of [3][3] + if (t->flag & T_USES_MANIPULATOR) { + Mat4MulMat34(matt, t->mat, rv3d->twmat); } - mymultmatrix(matt); + wmMultMatrix(matt); } else { - mymultmatrix(mat); + wmMultMatrix(rv3d->twmat); } - glFrontFace( is_mat4_flipped(mat)?GL_CW:GL_CCW); + glFrontFace( is_mat4_flipped(rv3d->twmat)?GL_CW:GL_CCW); /* axis */ if( (G.f & G_PICKSEL)==0 ) { // only draw axis when combo didn't draw scale axes if((combo & V3D_MANIP_SCALE)==0) - draw_manipulator_axes(colcode, drawflags & MAN_ROT_X, drawflags & MAN_ROT_Y, drawflags & MAN_ROT_Z); + draw_manipulator_axes(v3d, colcode, drawflags & MAN_ROT_X, drawflags & MAN_ROT_Y, drawflags & MAN_ROT_Z); /* only has to be set when not in picking */ gluQuadricDrawStyle(qobj, GLU_FILL); @@ -1316,7 +1383,7 @@ static void draw_manipulator_rotate_cyl(float mat[][4], int moving, int drawflag glTranslatef(0.0, 0.0, 1.0); if(drawflags & MAN_ROT_Z) { if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z); - manipulator_setcolor('z', colcode); + manipulator_setcolor(v3d, 'z', colcode); draw_cylinder(qobj, cylen, cywid); } /* X cyl */ @@ -1324,7 +1391,7 @@ static void draw_manipulator_rotate_cyl(float mat[][4], int moving, int drawflag if(drawflags & MAN_ROT_X) { if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X); glRotatef(90.0, 0.0, 1.0, 0.0); - manipulator_setcolor('x', colcode); + manipulator_setcolor(v3d, 'x', colcode); draw_cylinder(qobj, cylen, cywid); glRotatef(-90.0, 0.0, 1.0, 0.0); } @@ -1333,16 +1400,16 @@ static void draw_manipulator_rotate_cyl(float mat[][4], int moving, int drawflag if(drawflags & MAN_ROT_Y) { if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y); glRotatef(-90.0, 1.0, 0.0, 0.0); - manipulator_setcolor('y', colcode); + manipulator_setcolor(v3d, 'y', colcode); draw_cylinder(qobj, cylen, cywid); } /* restore */ gluDeleteQuadric(qobj); - myloadmatrix(G.vd->viewmat); + wmLoadMatrix(rv3d->viewmat); - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); + if(v3d->zbuf) glEnable(GL_DEPTH_TEST); } @@ -1359,63 +1426,18 @@ static float get_manipulator_drawsize(ARegion *ar) return size; } -/* exported to transform_constraints.c */ -/* mat, vec = default orientation and location */ -/* type = transform type */ -/* axis = x, y, z, c */ -/* col: 0 = colored, 1 = moving, 2 = ghost */ -void draw_manipulator_ext(ScrArea *sa, int type, char axis, int col, float vec[3], float mat[][3]) -{ - int drawflags= 0; - float mat4[4][4]; - int colcode; - - Mat4CpyMat3(mat4, mat); - VECCOPY(mat4[3], vec); - - Mat4MulFloat3((float *)mat4, get_manipulator_drawsize(sa)); - - glEnable(GL_BLEND); // let's do it transparent by default - if(col==0) colcode= MAN_RGB; - else if(col==1) colcode= MAN_MOVECOL; - else colcode= MAN_GHOST; - - - if(type==TFM_ROTATION) { - if(axis=='x') drawflags= MAN_ROT_X; - else if(axis=='y') drawflags= MAN_ROT_Y; - else if(axis=='z') drawflags= MAN_ROT_Z; - else drawflags= MAN_ROT_C; - - draw_manipulator_rotate_cyl(mat4, col, drawflags, V3D_MANIP_ROTATE, colcode); - } - else if(type==TFM_RESIZE) { - if(axis=='x') drawflags= MAN_SCALE_X; - else if(axis=='y') drawflags= MAN_SCALE_Y; - else if(axis=='z') drawflags= MAN_SCALE_Z; - else drawflags= MAN_SCALE_C; - - draw_manipulator_scale(mat4, col, drawflags, V3D_MANIP_SCALE, colcode); - } - else { - if(axis=='x') drawflags= MAN_TRANS_X; - else if(axis=='y') drawflags= MAN_TRANS_Y; - else if(axis=='z') drawflags= MAN_TRANS_Z; - else drawflags= MAN_TRANS_C; - - draw_manipulator_translate(mat4, 0, drawflags, V3D_MANIP_TRANSLATE, colcode); - } - - - glDisable(GL_BLEND); -} /* main call, does calc centers & orientation too */ /* uses global G.moving */ static int drawflags= 0xFFFF; // only for the calls below, belongs in scene...? -void BIF_draw_manipulator(ScrArea *sa) + +void BIF_draw_manipulator(const bContext *C) { + ScrArea *sa= CTX_wm_area(C); + ARegion *ar= CTX_wm_region(C); + Scene *scene= CTX_data_scene(C); View3D *v3d= sa->spacedata.first; + RegionView3D *rv3d= ar->regiondata; int totsel; if(!(v3d->twflag & V3D_USE_MANIPULATOR)) return; @@ -1424,7 +1446,7 @@ void BIF_draw_manipulator(ScrArea *sa) if(G.moving==0) { v3d->twflag &= ~V3D_DRAW_MANIPULATOR; - totsel= calc_manipulator_stats(sa); + totsel= calc_manipulator_stats(C); if(totsel==0) return; drawflags= v3d->twdrawflag; /* set in calc_manipulator_stats */ @@ -1434,25 +1456,25 @@ void BIF_draw_manipulator(ScrArea *sa) switch(v3d->around) { case V3D_CENTER: case V3D_ACTIVE: - v3d->twmat[3][0]= (G.scene->twmin[0] + G.scene->twmax[0])/2.0f; - v3d->twmat[3][1]= (G.scene->twmin[1] + G.scene->twmax[1])/2.0f; - v3d->twmat[3][2]= (G.scene->twmin[2] + G.scene->twmax[2])/2.0f; - if(v3d->around==V3D_ACTIVE && t->obedit==NULL) { + rv3d->twmat[3][0]= (scene->twmin[0] + scene->twmax[0])/2.0f; + rv3d->twmat[3][1]= (scene->twmin[1] + scene->twmax[1])/2.0f; + rv3d->twmat[3][2]= (scene->twmin[2] + scene->twmax[2])/2.0f; + if(v3d->around==V3D_ACTIVE && scene->obedit==NULL) { Object *ob= OBACT; if(ob && !(ob->flag & OB_POSEMODE)) - VECCOPY(v3d->twmat[3], ob->obmat[3]); + VECCOPY(rv3d->twmat[3], ob->obmat[3]); } break; case V3D_LOCAL: case V3D_CENTROID: - VECCOPY(v3d->twmat[3], G.scene->twcent); + VECCOPY(rv3d->twmat[3], scene->twcent); break; case V3D_CURSOR: - VECCOPY(v3d->twmat[3], give_cursor()); + VECCOPY(rv3d->twmat[3], give_cursor(scene, v3d)); break; } - Mat4MulFloat3((float *)v3d->twmat, get_manipulator_drawsize(sa)); + Mat4MulFloat3((float *)rv3d->twmat, get_manipulator_drawsize(ar)); } if(v3d->twflag & V3D_DRAW_MANIPULATOR) { @@ -1460,60 +1482,58 @@ void BIF_draw_manipulator(ScrArea *sa) if(v3d->twtype & V3D_MANIP_ROTATE) { /* rotate has special ghosting draw, for pie chart */ - if(G.moving) draw_manipulator_rotate_ghost(v3d->twmat, drawflags); + if(G.moving) draw_manipulator_rotate_ghost(v3d, rv3d, drawflags); if(G.moving) glEnable(GL_BLEND); if(G.rt==3) { - if(G.moving) draw_manipulator_rotate_cyl(v3d->twmat, 1, drawflags, v3d->twtype, MAN_MOVECOL); - else draw_manipulator_rotate_cyl(v3d->twmat, 0, drawflags, v3d->twtype, MAN_RGB); + if(G.moving) draw_manipulator_rotate_cyl(v3d, rv3d, 1, drawflags, v3d->twtype, MAN_MOVECOL); + else draw_manipulator_rotate_cyl(v3d, rv3d, 0, drawflags, v3d->twtype, MAN_RGB); } else - draw_manipulator_rotate(v3d->twmat, G.moving, drawflags, v3d->twtype); + draw_manipulator_rotate(v3d, rv3d, G.moving, drawflags, v3d->twtype); glDisable(GL_BLEND); } if(v3d->twtype & V3D_MANIP_SCALE) { if(G.moving) { glEnable(GL_BLEND); - draw_manipulator_scale(v3d->twmat, 0, drawflags, v3d->twtype, MAN_GHOST); - draw_manipulator_scale(v3d->twmat, 1, drawflags, v3d->twtype, MAN_MOVECOL); + draw_manipulator_scale(v3d, rv3d, 0, drawflags, v3d->twtype, MAN_GHOST); + draw_manipulator_scale(v3d, rv3d, 1, drawflags, v3d->twtype, MAN_MOVECOL); glDisable(GL_BLEND); } - else draw_manipulator_scale(v3d->twmat, 0, drawflags, v3d->twtype, MAN_RGB); + else draw_manipulator_scale(v3d, rv3d, 0, drawflags, v3d->twtype, MAN_RGB); } if(v3d->twtype & V3D_MANIP_TRANSLATE) { if(G.moving) { glEnable(GL_BLEND); - draw_manipulator_translate(v3d->twmat, 0, drawflags, v3d->twtype, MAN_GHOST); - draw_manipulator_translate(v3d->twmat, 1, drawflags, v3d->twtype, MAN_MOVECOL); + draw_manipulator_translate(v3d, rv3d, 0, drawflags, v3d->twtype, MAN_GHOST); + draw_manipulator_translate(v3d, rv3d, 1, drawflags, v3d->twtype, MAN_MOVECOL); glDisable(GL_BLEND); } - else draw_manipulator_translate(v3d->twmat, 0, drawflags, v3d->twtype, MAN_RGB); + else draw_manipulator_translate(v3d, rv3d, 0, drawflags, v3d->twtype, MAN_RGB); } } } -static int manipulator_selectbuf(ScrArea *sa, float hotspot) +static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, short *mval, float hotspot) { View3D *v3d= sa->spacedata.first; + RegionView3D *rv3d= ar->regiondata; rctf rect; GLuint buffer[64]; // max 4 items per select, so large enuf - short hits, mval[2]; + short hits; + extern void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect); // XXX check a bit later on this... (ton) G.f |= G_PICKSEL; - getmouseco_areawin(mval); rect.xmin= mval[0]-hotspot; rect.xmax= mval[0]+hotspot; rect.ymin= mval[1]-hotspot; rect.ymax= mval[1]+hotspot; - /* get rid of overlay button matrix */ - persp(PERSP_VIEW); - - setwinmatrixview3d(sa->winx, sa->winy, &rect); - Mat4MulMat4(v3d->persmat, v3d->viewmat, sa->winmat); + setwinmatrixview3d(ar, v3d, &rect); + Mat4MulMat4(rv3d->persmat, rv3d->viewmat, rv3d->winmat); glSelectBuffer( 64, buffer); glRenderMode(GL_SELECT); @@ -1522,22 +1542,20 @@ static int manipulator_selectbuf(ScrArea *sa, float hotspot) /* do the drawing */ if(v3d->twtype & V3D_MANIP_ROTATE) { - if(G.rt==3) draw_manipulator_rotate_cyl(v3d->twmat, 0, MAN_ROT_C & v3d->twdrawflag, v3d->twtype, MAN_RGB); - else draw_manipulator_rotate(v3d->twmat, 0, MAN_ROT_C & v3d->twdrawflag, v3d->twtype); + if(G.rt==3) draw_manipulator_rotate_cyl(v3d, rv3d, 0, MAN_ROT_C & v3d->twdrawflag, v3d->twtype, MAN_RGB); + else draw_manipulator_rotate(v3d, rv3d, 0, MAN_ROT_C & v3d->twdrawflag, v3d->twtype); } if(v3d->twtype & V3D_MANIP_SCALE) - draw_manipulator_scale(v3d->twmat, 0, MAN_SCALE_C & v3d->twdrawflag, v3d->twtype, MAN_RGB); + draw_manipulator_scale(v3d, rv3d, 0, MAN_SCALE_C & v3d->twdrawflag, v3d->twtype, MAN_RGB); if(v3d->twtype & V3D_MANIP_TRANSLATE) - draw_manipulator_translate(v3d->twmat, 0, MAN_TRANS_C & v3d->twdrawflag, v3d->twtype, MAN_RGB); + draw_manipulator_translate(v3d, rv3d, 0, MAN_TRANS_C & v3d->twdrawflag, v3d->twtype, MAN_RGB); glPopName(); hits= glRenderMode(GL_RENDER); G.f &= ~G_PICKSEL; - setwinmatrixview3d(sa->winx, sa->winy, NULL); - Mat4MulMat4(v3d->persmat, v3d->viewmat, sa->winmat); - - persp(PERSP_WIN); + setwinmatrixview3d(ar, v3d, NULL); + Mat4MulMat4(rv3d->persmat, rv3d->viewmat, rv3d->winmat); if(hits==1) return buffer[3]; else if(hits>1) { @@ -1578,20 +1596,26 @@ static int manipulator_selectbuf(ScrArea *sa, float hotspot) } /* return 0; nothing happened */ -int BIF_do_manipulator(ScrArea *sa) +int BIF_do_manipulator(bContext *C, short mval[2]) { + ScrArea *sa= CTX_wm_area(C); View3D *v3d= sa->spacedata.first; + ARegion *ar= CTX_wm_region(C); + RegionView3D *rv3d= ar->regiondata; int val; + int shift= 0; // XXX if(!(v3d->twflag & V3D_USE_MANIPULATOR)) return 0; if(!(v3d->twflag & V3D_DRAW_MANIPULATOR)) return 0; // find the hotspots first test narrow hotspot - val= manipulator_selectbuf(sa, 0.5f*(float)U.tw_hotspot); + val= manipulator_selectbuf(sa, ar, mval, 0.5f*(float)U.tw_hotspot); if(val) { - checkFirstTime(); // TEMPORARY, check this before doing any transform call. + + // XXX checkFirstTime(); // TEMPORARY, check this before doing any transform call. + // drawflags still global, for drawing call above - drawflags= manipulator_selectbuf(sa, 0.2f*(float)U.tw_hotspot); + drawflags= manipulator_selectbuf(sa, ar, mval, 0.2f*(float)U.tw_hotspot); if(drawflags==0) drawflags= val; if (drawflags & MAN_TRANS_C) { @@ -1600,28 +1624,28 @@ int BIF_do_manipulator(ScrArea *sa) case MAN_TRANS_C: break; case MAN_TRANS_X: - if(G.qual & LR_SHIFTKEY) { + if(shift) { drawflags= MAN_TRANS_Y|MAN_TRANS_Z; - BIF_setDualAxisConstraint(v3d->twmat[1], v3d->twmat[2], " Y+Z"); + BIF_setDualAxisConstraint(rv3d->twmat[1], rv3d->twmat[2], " Y+Z"); } else - BIF_setSingleAxisConstraint(v3d->twmat[0], " X"); + BIF_setSingleAxisConstraint(rv3d->twmat[0], " X"); break; case MAN_TRANS_Y: - if(G.qual & LR_SHIFTKEY) { + if(shift) { drawflags= MAN_TRANS_X|MAN_TRANS_Z; - BIF_setDualAxisConstraint(v3d->twmat[0], v3d->twmat[2], " X+Z"); + BIF_setDualAxisConstraint(rv3d->twmat[0], rv3d->twmat[2], " X+Z"); } else - BIF_setSingleAxisConstraint(v3d->twmat[1], " Y"); + BIF_setSingleAxisConstraint(rv3d->twmat[1], " Y"); break; case MAN_TRANS_Z: - if(G.qual & LR_SHIFTKEY) { + if(shift) { drawflags= MAN_TRANS_X|MAN_TRANS_Y; - BIF_setDualAxisConstraint(v3d->twmat[0], v3d->twmat[1], " X+Y"); + BIF_setDualAxisConstraint(rv3d->twmat[0], rv3d->twmat[1], " X+Y"); } else - BIF_setSingleAxisConstraint(v3d->twmat[2], " Z"); + BIF_setSingleAxisConstraint(rv3d->twmat[2], " Z"); break; } ManipulatorTransform(); @@ -1630,28 +1654,28 @@ int BIF_do_manipulator(ScrArea *sa) initManipulator(TFM_RESIZE); switch(drawflags) { case MAN_SCALE_X: - if(G.qual & LR_SHIFTKEY) { + if(shift) { drawflags= MAN_SCALE_Y|MAN_SCALE_Z; - BIF_setDualAxisConstraint(v3d->twmat[1], v3d->twmat[2], " Y+Z"); + BIF_setDualAxisConstraint(rv3d->twmat[1], rv3d->twmat[2], " Y+Z"); } else - BIF_setSingleAxisConstraint(v3d->twmat[0], " X"); + BIF_setSingleAxisConstraint(rv3d->twmat[0], " X"); break; case MAN_SCALE_Y: - if(G.qual & LR_SHIFTKEY) { + if(shift) { drawflags= MAN_SCALE_X|MAN_SCALE_Z; - BIF_setDualAxisConstraint(v3d->twmat[0], v3d->twmat[2], " X+Z"); + BIF_setDualAxisConstraint(rv3d->twmat[0], rv3d->twmat[2], " X+Z"); } else - BIF_setSingleAxisConstraint(v3d->twmat[1], " Y"); + BIF_setSingleAxisConstraint(rv3d->twmat[1], " Y"); break; case MAN_SCALE_Z: - if(G.qual & LR_SHIFTKEY) { + if(shift) { drawflags= MAN_SCALE_X|MAN_SCALE_Y; - BIF_setDualAxisConstraint(v3d->twmat[0], v3d->twmat[1], " X+Y"); + BIF_setDualAxisConstraint(rv3d->twmat[0], rv3d->twmat[1], " X+Y"); } else - BIF_setSingleAxisConstraint(v3d->twmat[2], " Z"); + BIF_setSingleAxisConstraint(rv3d->twmat[2], " Z"); break; } ManipulatorTransform(); @@ -1664,13 +1688,13 @@ int BIF_do_manipulator(ScrArea *sa) initManipulator(TFM_ROTATION); switch(drawflags) { case MAN_ROT_X: - BIF_setSingleAxisConstraint(v3d->twmat[0], " X"); + BIF_setSingleAxisConstraint(rv3d->twmat[0], " X"); break; case MAN_ROT_Y: - BIF_setSingleAxisConstraint(v3d->twmat[1], " Y"); + BIF_setSingleAxisConstraint(rv3d->twmat[1], " Y"); break; case MAN_ROT_Z: - BIF_setSingleAxisConstraint(v3d->twmat[2], " Z"); + BIF_setSingleAxisConstraint(rv3d->twmat[2], " Z"); break; } ManipulatorTransform(); @@ -1682,4 +1706,3 @@ int BIF_do_manipulator(ScrArea *sa) return val; } -#endif diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index d3e4e2b1421..1e065de94e1 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -402,7 +402,7 @@ int BIF_countTransformOrientation(const bContext *C) { return count; } -void applyTransformOrientation(bContext *C, TransInfo *t) { +void applyTransformOrientation(const bContext *C, TransInfo *t) { TransformOrientation *ts; View3D *v3d = CTX_wm_view3d(C); int selected_index = (v3d->twmode - V3D_MANIP_CUSTOM); @@ -532,7 +532,7 @@ void initTransformOrientation(bContext *C, TransInfo *t) } } -int getTransformOrientation(bContext *C, float normal[3], float plane[3], int activeOnly) +int getTransformOrientation(const bContext *C, float normal[3], float plane[3], int activeOnly) { Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 5cd78670e71..e221524eac2 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -82,6 +82,9 @@ typedef struct RegionView3D { float viewmatob[4][4]; float persmatob[4][4]; + /* transform widget matrix */ + float twmat[4][4]; + float viewquat[4], dist, zfac; /* zfac is initgrabz() result */ float camdx, camdy; /* camera view offsets, 1.0 = viewplane moves entire width/height */ float pixsize; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index ae3b249e51f..ccec28d55e2 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -547,23 +547,28 @@ static void rna_def_space_3dview(BlenderRNA *brna) prop= RNA_def_property(srna, "manipulator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR); RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms."); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); prop= RNA_def_property(srna, "manipulator_translate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_TRANSLATE); RNA_def_property_ui_text(prop, "Manipulator Translate", "Use the manipulator for movement transformations."); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); prop= RNA_def_property(srna, "manipulator_rotate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_ROTATE); RNA_def_property_ui_text(prop, "Manipulator Rotate", "Use the manipulator for rotation transformations."); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); prop= RNA_def_property(srna, "manipulator_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_SCALE); RNA_def_property_ui_text(prop, "Manipulator Scale", "Use the manipulator for scale transformations."); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); prop= RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "twmode"); RNA_def_property_enum_items(prop, transform_orientation_items); RNA_def_property_ui_text(prop, "Transform Orientation", "The alignment of manipulator handles."); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); } -- cgit v1.2.3 From 5e749af4295ba3120cd882f6e35b49a80292915e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 8 Jul 2009 15:34:41 +0000 Subject: 2.5: Various Fixes * Context panel now draws without header, with arrows, no scene name. * Softbody vertex group search popup. * Improve names for autogenerated shortcut keys in menus. * Make most Select menus in the 3D view header work. * Fix armature border select selection syncing. * Add POSE_OT_select_constraint_target, MESH_OT_select_by_number_vertices, MESH_OT_select_vertex_path. * Merge mesh select similar into one operator. * Don't give MESH_OT_select_random Space hotkey. * Add DAG_object_flush_update to many mesh edit tools, not calling this will crash with modifiers. * RNA_def_enum_funcs for dynamic enums in operators, but not very useful without context yet. * Fix refresh issue with image window header + editmode. * Fix drawing of shadow mesh for image painting. * Remove deprecated uiDefMenuButO and uiDefMenuSep functions. * Remove keyval.c, code is in wm_keymap.c already. * Rename WM_operator_redo to WM_operator_props_popup. --- source/blender/editors/armature/armature_intern.h | 1 + source/blender/editors/armature/armature_ops.c | 5 +- source/blender/editors/armature/editarmature.c | 28 +- source/blender/editors/armature/poseobject.c | 71 ++- source/blender/editors/curve/editcurve.c | 8 +- source/blender/editors/include/ED_armature.h | 1 + source/blender/editors/include/UI_icons.h | 2 + source/blender/editors/include/UI_interface.h | 5 - source/blender/editors/interface/interface.c | 20 - source/blender/editors/interface/interface_icons.c | 23 + source/blender/editors/interface/interface_panel.c | 45 +- source/blender/editors/interface/keyval.c | 540 --------------------- source/blender/editors/mesh/editmesh.c | 27 +- source/blender/editors/mesh/editmesh_add.c | 20 + source/blender/editors/mesh/editmesh_loop.c | 5 + source/blender/editors/mesh/editmesh_mods.c | 260 +++++----- source/blender/editors/mesh/editmesh_tools.c | 204 +++++--- source/blender/editors/mesh/mesh_intern.h | 6 +- source/blender/editors/mesh/mesh_ops.c | 12 +- source/blender/editors/physics/editparticle.c | 2 +- source/blender/editors/screen/area.c | 8 +- .../editors/space_buttons/buttons_context.c | 17 +- source/blender/editors/space_image/image_ops.c | 2 +- source/blender/editors/space_image/space_image.c | 18 +- source/blender/editors/space_view3d/drawobject.c | 1 - .../blender/editors/space_view3d/view3d_header.c | 419 ++++------------ .../blender/editors/space_view3d/view3d_select.c | 1 + source/blender/editors/util/undo.c | 20 +- source/blender/editors/uvedit/uvedit_draw.c | 5 +- source/blender/makesdna/DNA_screen_types.h | 1 + source/blender/makesrna/RNA_define.h | 1 + source/blender/makesrna/RNA_types.h | 4 +- source/blender/makesrna/intern/rna_define.c | 6 + source/blender/makesrna/intern/rna_rna.c | 25 + source/blender/makesrna/intern/rna_ui.c | 4 + source/blender/makesrna/intern/rna_wm.c | 48 +- source/blender/makesrna/intern/rna_world.c | 2 +- source/blender/windowmanager/WM_api.h | 2 +- source/blender/windowmanager/intern/wm_operators.c | 2 +- 39 files changed, 689 insertions(+), 1182 deletions(-) delete mode 100644 source/blender/editors/interface/keyval.c (limited to 'source') diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h index 646c75f50bf..19204710116 100644 --- a/source/blender/editors/armature/armature_intern.h +++ b/source/blender/editors/armature/armature_intern.h @@ -60,6 +60,7 @@ void POSE_OT_select_invert(struct wmOperatorType *ot); void POSE_OT_select_parent(struct wmOperatorType *ot); void POSE_OT_select_hierarchy(struct wmOperatorType *ot); void POSE_OT_select_linked(struct wmOperatorType *ot); +void POSE_OT_select_constraint_target(struct wmOperatorType *ot); void SKETCH_OT_gesture(struct wmOperatorType *ot); void SKETCH_OT_delete(struct wmOperatorType *ot); diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index 5c31883834c..adbfb500eb0 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -153,6 +153,7 @@ void ED_operatortypes_armature(void) WM_operatortype_append(POSE_OT_select_parent); WM_operatortype_append(POSE_OT_select_hierarchy); WM_operatortype_append(POSE_OT_select_linked); + WM_operatortype_append(POSE_OT_select_constraint_target); /* POSELIB */ WM_operatortype_append(POSELIB_OT_browse_interactive); @@ -194,14 +195,12 @@ void ED_keymap_armature(wmWindowManager *wm) kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT); - RNA_boolean_set(kmi->ptr, "extend", 0); kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT); RNA_boolean_set(kmi->ptr, "extend", 1); kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD); - RNA_boolean_set(kmi->ptr, "extend", 0); kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD); RNA_boolean_set(kmi->ptr, "extend", 1); @@ -240,14 +239,12 @@ void ED_keymap_armature(wmWindowManager *wm) kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT); - RNA_boolean_set(kmi->ptr, "extend", 0); kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT); RNA_boolean_set(kmi->ptr, "extend", 1); kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD); - RNA_boolean_set(kmi->ptr, "extend", 0); kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD); RNA_boolean_set(kmi->ptr, "extend", 1); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 7155bdd6850..97bf3492f7c 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -110,7 +110,7 @@ static void adduplicate() {} /* **************** tools on Editmode Armature **************** */ /* Sync selection to parent for connected children */ -static void armature_sync_selection(ListBase *edbo) +void ED_armature_sync_selection(ListBase *edbo) { EditBone *ebo; @@ -1435,7 +1435,7 @@ static int armature_select_linked_invoke(bContext *C, wmOperator *op, wmEvent *e } - armature_sync_selection(arm->edbo); + ED_armature_sync_selection(arm->edbo); /* BIF_undo_push("Select connected"); */ @@ -1668,7 +1668,7 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *op) } - armature_sync_selection(arm->edbo); + ED_armature_sync_selection(arm->edbo); WM_event_add_notifier(C, NC_OBJECT, obedit); @@ -1742,7 +1742,7 @@ void deselectall_armature(Object *obedit, int toggle, int doundo) } } - armature_sync_selection(arm->edbo); + ED_armature_sync_selection(arm->edbo); if (doundo) { if (sel==1) BIF_undo_push("Select All"); else BIF_undo_push("Deselect All"); @@ -1814,7 +1814,7 @@ void mouse_armature(bContext *C, short mval[2], int extend) nearBone->flag |= selmask; } - armature_sync_selection(arm->edbo); + ED_armature_sync_selection(arm->edbo); if(nearBone) { /* then now check for active status */ @@ -2246,7 +2246,7 @@ static int armature_click_extrude_exec(bContext *C, wmOperator *op) } - armature_sync_selection(arm->edbo); + ED_armature_sync_selection(arm->edbo); WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, obedit); @@ -2508,7 +2508,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op) if (CTX_DATA_COUNT(C, selected_bones) == 0) return OPERATOR_CANCELLED; - armature_sync_selection(arm->edbo); // XXX why is this needed? + ED_armature_sync_selection(arm->edbo); // XXX why is this needed? preEditBoneDuplicate(arm->edbo); @@ -3058,7 +3058,7 @@ void merge_armature(Scene *scene) } /* undo + updates */ - armature_sync_selection(arm->edbo); + ED_armature_sync_selection(arm->edbo); BIF_undo_push("Merge Bones"); } @@ -3080,7 +3080,7 @@ void hide_selected_armature_bones(Scene *scene) } } } - armature_sync_selection(arm->edbo); + ED_armature_sync_selection(arm->edbo); BIF_undo_push("Hide Bones"); } @@ -3100,7 +3100,7 @@ void hide_unselected_armature_bones(Scene *scene) } } } - armature_sync_selection(arm->edbo); + ED_armature_sync_selection(arm->edbo); BIF_undo_push("Hide Unselected Bones"); } @@ -3118,7 +3118,7 @@ void show_all_armature_bones(Scene *scene) } } } - armature_sync_selection(arm->edbo); + ED_armature_sync_selection(arm->edbo); BIF_undo_push("Reveal Bones"); } @@ -3251,7 +3251,7 @@ static int armature_extrude_exec(bContext *C, wmOperator *op) if (totbone==0) return OPERATOR_CANCELLED; /* Transform the endpoints */ - armature_sync_selection(arm->edbo); + ED_armature_sync_selection(arm->edbo); return OPERATOR_FINISHED; } @@ -3812,7 +3812,7 @@ static int armature_parent_clear_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - armature_sync_selection(arm->edbo); + ED_armature_sync_selection(arm->edbo); /* note, notifier might evolve */ WM_event_add_notifier(C, NC_OBJECT, ob); @@ -3963,7 +3963,7 @@ static int armature_select_hierarchy_exec(bContext *C, wmOperator *op) } } - armature_sync_selection(arm->edbo); + ED_armature_sync_selection(arm->edbo); WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, ob); diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 281f314a546..4a7056274c6 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -443,6 +443,65 @@ void pose_select_constraint_target(Scene *scene) } +static int pose_select_constraint_target_exec(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_active_object(C); + bArmature *arm= ob->data; + bPoseChannel *pchan; + bConstraint *con; + int found= 0; + + for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { + if (arm->layer & pchan->bone->layer) { + if (pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) { + for (con= pchan->constraints.first; con; con= con->next) { + bConstraintTypeInfo *cti= constraint_get_typeinfo(con); + ListBase targets = {NULL, NULL}; + bConstraintTarget *ct; + + if (cti && cti->get_constraint_targets) { + cti->get_constraint_targets(con, &targets); + + for (ct= targets.first; ct; ct= ct->next) { + if ((ct->tar == ob) && (ct->subtarget[0])) { + bPoseChannel *pchanc= get_pose_channel(ob->pose, ct->subtarget); + if(pchanc) { + pchanc->bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; + found= 1; + } + } + } + + if (cti->flush_constraint_targets) + cti->flush_constraint_targets(con, &targets, 1); + } + } + } + } + } + + if(!found) + return OPERATOR_CANCELLED; + + WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, ob); + + return OPERATOR_FINISHED; +} + +void POSE_OT_select_constraint_target(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Select Constraint Target"; + ot->idname= "POSE_OT_select_constraint_target"; + + /* api callbacks */ + ot->exec= pose_select_constraint_target_exec; + ot->poll= ED_operator_posemode; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /* ******************* select hierarchy operator ************* */ static int pose_select_hierarchy_exec(bContext *C, wmOperator *op) @@ -453,6 +512,7 @@ static int pose_select_hierarchy_exec(bContext *C, wmOperator *op) Bone *curbone, *pabone, *chbone; int direction = RNA_enum_get(op->ptr, "direction"); int add_to_sel = RNA_boolean_get(op->ptr, "extend"); + int found= 0; for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { curbone= pchan->bone; @@ -469,8 +529,8 @@ static int pose_select_hierarchy_exec(bContext *C, wmOperator *op) if (!add_to_sel) curbone->flag &= ~BONE_SELECTED; curbone->flag &= ~BONE_ACTIVE; pabone->flag |= (BONE_ACTIVE|BONE_SELECTED); - - // XXX notifiers need to be sent to other editors to update + + found= 1; break; } } else { // BONE_SELECT_CHILD @@ -483,8 +543,8 @@ static int pose_select_hierarchy_exec(bContext *C, wmOperator *op) if (!add_to_sel) curbone->flag &= ~BONE_SELECTED; curbone->flag &= ~BONE_ACTIVE; chbone->flag |= (BONE_ACTIVE|BONE_SELECTED); - - // XXX notifiers need to be sent to other editors to update + + found= 1; break; } } @@ -492,6 +552,9 @@ static int pose_select_hierarchy_exec(bContext *C, wmOperator *op) } } + if(!found) + return OPERATOR_CANCELLED; + WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, ob); return OPERATOR_FINISHED; diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 5283aacf39e..64303c149a8 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -1067,7 +1067,7 @@ void CURVE_OT_spline_weight_set(wmOperatorType *ot) /* api callbacks */ ot->exec= set_weight_exec; - ot->invoke= WM_operator_redo; + ot->invoke= WM_operator_props_popup; ot->poll= ED_operator_editsurfcurve; /* flags */ @@ -1118,7 +1118,7 @@ void CURVE_OT_radius_set(wmOperatorType *ot) /* api callbacks */ ot->exec= set_radius_exec; - ot->invoke= WM_operator_redo; + ot->invoke= WM_operator_props_popup; ot->poll= ED_operator_editsurfcurve; /* flags */ @@ -4145,7 +4145,7 @@ void CURVE_OT_select_random(wmOperatorType *ot) /* api callbacks */ ot->exec= select_random_exec; - ot->invoke= WM_operator_redo; + ot->invoke= WM_operator_props_popup; ot->poll= ED_operator_editsurfcurve; /* flags */ @@ -4179,7 +4179,7 @@ void CURVE_OT_select_every_nth(wmOperatorType *ot) /* api callbacks */ ot->exec= select_every_nth_exec; - ot->invoke= WM_operator_redo; + ot->invoke= WM_operator_props_popup; ot->poll= ED_operator_editsurfcurve; /* flags */ diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 0f2ac6e3027..f28dbe2a619 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -103,6 +103,7 @@ void mouse_armature(struct bContext *C, short mval[2], int extend); struct Bone *get_indexed_bone (struct Object *ob, int index); float ED_rollBoneToVector(EditBone *bone, float new_up_axis[3]); EditBone *ED_armature_bone_get_mirrored(struct ListBase *edbo, EditBone *ebo); // XXX this is needed for populating the context iterators +void ED_armature_sync_selection(struct ListBase *edbo); void add_primitive_bone(struct Scene *scene, struct View3D *v3d, struct RegionView3D *rv3d); diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index 602e94838b7..f9e427ac006 100644 --- a/source/blender/editors/include/UI_icons.h +++ b/source/blender/editors/include/UI_icons.h @@ -880,3 +880,5 @@ DEF_ICON(VICON_DISCLOSURE_TRI_DOWN) DEF_ICON(VICON_MOVE_UP) DEF_ICON(VICON_MOVE_DOWN) DEF_ICON(VICON_X) +DEF_ICON(VICON_SMALL_TRI_RIGHT) + diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index cf284e7b111..67438120eef 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -544,11 +544,6 @@ void UI_init(void); void UI_init_userdef(void); void UI_exit(void); -/* XXX hide this */ - -uiBut *uiDefMenuButO(uiBlock *block, char *opname, char *name); -uiBut *uiDefMenuSep(uiBlock *block); - /* Layout * * More automated layout of buttons. Has three levels: diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 00ec875bd86..a76fdcbf39d 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2619,26 +2619,6 @@ uiBut *uiDefIconTextButO(uiBlock *block, int type, char *opname, int opcontext, return but; } -static int ui_menu_y(uiBlock *block) -{ - uiBut *but= block->buttons.last; - - if(but) return but->y1; - else return 0; -} - -uiBut *uiDefMenuButO(uiBlock *block, char *opname, char *name) -{ - int y= ui_menu_y(block) - MENU_ITEM_HEIGHT; - return uiDefIconTextButO(block, BUT, opname, WM_OP_INVOKE_REGION_WIN, ICON_BLANK1, name, 0, y, MENU_WIDTH, MENU_ITEM_HEIGHT-1, NULL); -} - -uiBut *uiDefMenuSep(uiBlock *block) -{ - int y= ui_menu_y(block) - MENU_SEP_HEIGHT; - return uiDefBut(block, SEPR, 0, "", 0, y, MENU_WIDTH, MENU_SEP_HEIGHT, NULL, 0.0, 0.0, 0, 0, ""); -} - /* END Button containing both string label and icon */ void uiSetButLink(uiBut *but, void **poin, void ***ppoin, short *tot, int from, int to) diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 315b8693905..549164c23a1 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -342,6 +342,28 @@ static void vicon_disclosure_tri_right_draw(int x, int y, int w, int h, float al viconutil_draw_lineloop_smooth(pts, 3); } +static void vicon_small_tri_right_draw(int x, int y, int w, int h, float alpha) +{ + GLint pts[3][2]; + int cx = x+w/2-4; + int cy = y+w/2; + int d = w/5, d2 = w/7; + + viconutil_set_point(pts[0], cx-d2, cy+d); + viconutil_set_point(pts[1], cx-d2, cy-d); + viconutil_set_point(pts[2], cx+d2, cy); + + glColor4f(0.2f, 0.2f, 0.2f, alpha); + + glShadeModel(GL_SMOOTH); + glBegin(GL_TRIANGLES); + glVertex2iv(pts[0]); + glVertex2iv(pts[1]); + glVertex2iv(pts[2]); + glEnd(); + glShadeModel(GL_FLAT); +} + static void vicon_disclosure_tri_down_draw(int x, int y, int w, int h, float alpha) { GLint pts[3][2]; @@ -450,6 +472,7 @@ static void init_internal_icons() def_internal_vicon(VICON_MOVE_UP, vicon_move_up_draw); def_internal_vicon(VICON_MOVE_DOWN, vicon_move_down_draw); def_internal_vicon(VICON_X, vicon_x_draw); + def_internal_vicon(VICON_SMALL_TRI_RIGHT, vicon_small_tri_right_draw); IMB_freeImBuf(bbuf); } diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 319e69a40e4..3e009b50045 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -539,6 +539,7 @@ void ui_draw_aligned_panel(ARegion *ar, uiStyle *style, uiBlock *block, rcti *re int ofsx; if(panel->paneltab) return; + if(panel->type && (panel->type->flag & PNL_NO_HEADER)) return; /* calculate header rect */ /* + 0.001f to prevent flicker due to float inaccuracy */ @@ -644,6 +645,14 @@ void ui_draw_aligned_panel(ARegion *ar, uiStyle *style, uiBlock *block, rcti *re /************************** panel alignment *************************/ +static int get_panel_header(Panel *pa) +{ + if(pa->type && (pa->type->flag & PNL_NO_HEADER)) + return 0; + + return PNL_HEADER; +} + /* this function is needed because uiBlock and Panel itself dont change sizey or location when closed */ static int get_panel_real_ofsy(Panel *pa) @@ -656,8 +665,8 @@ static int get_panel_real_ofsy(Panel *pa) static int get_panel_real_ofsx(Panel *pa) { - if(pa->flag & PNL_CLOSEDX) return pa->ofsx+PNL_HEADER; - else if(pa->paneltab && (pa->paneltab->flag & PNL_CLOSEDX)) return pa->ofsx+PNL_HEADER; + if(pa->flag & PNL_CLOSEDX) return pa->ofsx+get_panel_header(pa); + else if(pa->paneltab && (pa->paneltab->flag & PNL_CLOSEDX)) return pa->ofsx+get_panel_header(pa); else return pa->ofsx+pa->sizex; } @@ -762,18 +771,18 @@ int uiAlignPanelStep(ScrArea *sa, ARegion *ar, float fac, int drag) /* no smart other default start loc! this keeps switching f5/f6/etc compatible */ ps= panelsort; ps->pa->ofsx= 0; - ps->pa->ofsy= -ps->pa->sizey-PNL_HEADER-style->panelouter; + ps->pa->ofsy= -ps->pa->sizey-get_panel_header(ps->pa)-style->panelouter; for(a=0; apa->ofsx= ps->pa->ofsx; - psnext->pa->ofsy= get_panel_real_ofsy(ps->pa) - psnext->pa->sizey-PNL_HEADER-style->panelouter; + psnext->pa->ofsy= get_panel_real_ofsy(ps->pa) - psnext->pa->sizey-get_panel_header(psnext->pa)-style->panelouter; } else { psnext->pa->ofsx= get_panel_real_ofsx(ps->pa); - psnext->pa->ofsy= ps->pa->ofsy + ps->pa->sizey - psnext->pa->sizey; + psnext->pa->ofsy= ps->pa->ofsy + ps->pa->sizey + get_panel_header(ps->pa) - psnext->pa->sizey - get_panel_header(psnext->pa); } } @@ -1200,6 +1209,7 @@ int ui_handler_panel_region(bContext *C, wmEvent *event) { ARegion *ar= CTX_wm_region(C); uiBlock *block; + Panel *pa; int retval, mx, my, inside_header= 0, inside_scale= 0, inside; retval= WM_UI_HANDLER_CONTINUE; @@ -1215,22 +1225,27 @@ int ui_handler_panel_region(bContext *C, wmEvent *event) /* check if inside boundbox */ inside= 0; + pa= block->panel; + + if(!pa || pa->paneltab!=NULL) + continue; + if(pa->type && pa->type->flag & PNL_NO_HEADER) + continue; - if(block->panel && block->panel->paneltab==NULL) - if(block->minx <= mx && block->maxx >= mx) - if(block->miny <= my && block->maxy+PNL_HEADER >= my) - inside= 1; + if(block->minx <= mx && block->maxx >= mx) + if(block->miny <= my && block->maxy+PNL_HEADER >= my) + inside= 1; if(inside) { /* clicked at panel header? */ - if(block->panel->flag & PNL_CLOSEDX) { + if(pa->flag & PNL_CLOSEDX) { if(block->minx <= mx && block->minx+PNL_HEADER >= mx) inside_header= 1; } else if((block->maxy <= my) && (block->maxy+PNL_HEADER >= my)) { inside_header= 1; } - else if(block->panel->control & UI_PNL_SCALE) { + else if(pa->control & UI_PNL_SCALE) { if(block->maxx-PNL_HEADER <= mx) if(block->miny+PNL_HEADER >= my) inside_scale= 1; @@ -1242,8 +1257,8 @@ int ui_handler_panel_region(bContext *C, wmEvent *event) ui_handle_panel_header(C, block, mx, my); break; } - else if(inside_scale && !(block->panel->flag & PNL_CLOSED)) { - panel_activate_state(C, block->panel, PANEL_STATE_DRAG_SCALE); + else if(inside_scale && !(pa->flag & PNL_CLOSED)) { + panel_activate_state(C, pa, PANEL_STATE_DRAG_SCALE); break; } } @@ -1258,7 +1273,7 @@ int ui_handler_panel_region(bContext *C, wmEvent *event) int zoom=0; /* if panel is closed, only zoom if mouse is over the header */ - if (block->panel->flag & (PNL_CLOSEDX|PNL_CLOSEDY)) { + if (pa->flag & (PNL_CLOSEDX|PNL_CLOSEDY)) { if (inside_header) zoom=1; } @@ -1271,7 +1286,7 @@ int ui_handler_panel_region(bContext *C, wmEvent *event) SpaceLink *sl= sa->spacedata.first; if(sa->spacetype!=SPACE_BUTS) { - if(!(block->panel->control & UI_PNL_SCALE)) { + if(!(pa->control & UI_PNL_SCALE)) { if(event->type==PADPLUSKEY) sl->blockscale+= 0.1; else sl->blockscale-= 0.1; CLAMP(sl->blockscale, 0.6, 1.0); diff --git a/source/blender/editors/interface/keyval.c b/source/blender/editors/interface/keyval.c deleted file mode 100644 index f2172ac8cf0..00000000000 --- a/source/blender/editors/interface/keyval.c +++ /dev/null @@ -1,540 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include "stdio.h" -#include "ctype.h" -#include "string.h" - -#include "BKE_global.h" -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "WM_types.h" - -char *key_event_to_string(unsigned short event) -{ - - switch(event) { - case AKEY: - return "A"; - break; - case BKEY: - return "B"; - break; - case CKEY: - return "C"; - break; - case DKEY: - return "D"; - break; - case EKEY: - return "E"; - break; - case FKEY: - return "F"; - break; - case GKEY: - return "G"; - break; - case HKEY: - return "H"; - break; - case IKEY: - return "I"; - break; - case JKEY: - return "J"; - break; - case KKEY: - return "K"; - break; - case LKEY: - return "L"; - break; - case MKEY: - return "M"; - break; - case NKEY: - return "N"; - break; - case OKEY: - return "O"; - break; - case PKEY: - return "P"; - break; - case QKEY: - return "Q"; - break; - case RKEY: - return "R"; - break; - case SKEY: - return "S"; - break; - case TKEY: - return "T"; - break; - case UKEY: - return "U"; - break; - case VKEY: - return "V"; - break; - case WKEY: - return "W"; - break; - case XKEY: - return "X"; - break; - case YKEY: - return "Y"; - break; - case ZKEY: - return "Z"; - break; - - case ZEROKEY: - return "Zero"; - break; - case ONEKEY: - return "One"; - break; - case TWOKEY: - return "Two"; - break; - case THREEKEY: - return "Three"; - break; - case FOURKEY: - return "Four"; - break; - case FIVEKEY: - return "Five"; - break; - case SIXKEY: - return "Six"; - break; - case SEVENKEY: - return "Seven"; - break; - case EIGHTKEY: - return "Eight"; - break; - case NINEKEY: - return "Nine"; - break; - - case LEFTCTRLKEY: - return "Leftctrl"; - break; - case LEFTALTKEY: - return "Leftalt"; - break; - case RIGHTALTKEY: - return "Rightalt"; - break; - case RIGHTCTRLKEY: - return "Rightctrl"; - break; - case RIGHTSHIFTKEY: - return "Rightshift"; - break; - case LEFTSHIFTKEY: - return "Leftshift"; - break; - - case ESCKEY: - return "Esc"; - break; - case TABKEY: - return "Tab"; - break; - case RETKEY: - return "Ret"; - break; - case SPACEKEY: - return "Space"; - break; - case LINEFEEDKEY: - return "Linefeed"; - break; - case BACKSPACEKEY: - return "Backspace"; - break; - case DELKEY: - return "Del"; - break; - case SEMICOLONKEY: - return "Semicolon"; - break; - case PERIODKEY: - return "Period"; - break; - case COMMAKEY: - return "Comma"; - break; - case QUOTEKEY: - return "Quote"; - break; - case ACCENTGRAVEKEY: - return "Accentgrave"; - break; - case MINUSKEY: - return "Minus"; - break; - case SLASHKEY: - return "Slash"; - break; - case BACKSLASHKEY: - return "Backslash"; - break; - case EQUALKEY: - return "Equal"; - break; - case LEFTBRACKETKEY: - return "Leftbracket"; - break; - case RIGHTBRACKETKEY: - return "Rightbracket"; - break; - - case LEFTARROWKEY: - return "Leftarrow"; - break; - case DOWNARROWKEY: - return "Downarrow"; - break; - case RIGHTARROWKEY: - return "Rightarrow"; - break; - case UPARROWKEY: - return "Uparrow"; - break; - - case PAD2: - return "Pad2"; - break; - case PAD4: - return "Pad4"; - break; - case PAD6: - return "Pad6"; - break; - case PAD8: - return "Pad8"; - break; - case PAD1: - return "Pad1"; - break; - case PAD3: - return "Pad3"; - break; - case PAD5: - return "Pad5"; - break; - case PAD7: - return "Pad7"; - break; - case PAD9: - return "Pad9"; - break; - - case PADPERIOD: - return "Padperiod"; - break; - case PADSLASHKEY: - return "Padslash"; - break; - case PADASTERKEY: - return "Padaster"; - break; - - case PAD0: - return "Pad0"; - break; - case PADMINUS: - return "Padminus"; - break; - case PADENTER: - return "Padenter"; - break; - case PADPLUSKEY: - return "Padplus"; - break; - - case F1KEY: - return "F1"; - break; - case F2KEY: - return "F2"; - break; - case F3KEY: - return "F3"; - break; - case F4KEY: - return "F4"; - break; - case F5KEY: - return "F5"; - break; - case F6KEY: - return "F6"; - break; - case F7KEY: - return "F7"; - break; - case F8KEY: - return "F8"; - break; - case F9KEY: - return "F9"; - break; - case F10KEY: - return "F10"; - break; - case F11KEY: - return "F11"; - break; - case F12KEY: - return "F12"; - break; - - case PAUSEKEY: - return "Pause"; - break; - case INSERTKEY: - return "Insert"; - break; - case HOMEKEY: - return "Home"; - break; - case PAGEUPKEY: - return "Pageup"; - break; - case PAGEDOWNKEY: - return "Pagedown"; - break; - case ENDKEY: - return "End"; - break; - } - - return ""; -} - -/* - * Decodes key combination strings [qual1+[qual2+[...]]]keyname - * The '+'s may be replaced by '-' or ' ' characters to support different - * formats. No additional whitespace is allowed. The keyname may be an internal - * name, like "RETKEY", or a more common name, like "Return". Decoding is case- - * insensitive. - * - * Example strings: "Ctrl+L", "ALT-ESC", "Shift A" - * - * Returns 1 if successful. - */ -int decode_key_string(char *str, unsigned short *key, unsigned short *qual) -{ - int i, prev, len, invalid=0; - - len= strlen(str); - *key= *qual= 0; - - /* Convert to upper case */ - for (i=0; i='A' && str[prev]<='Z') { - *key= str[prev]-'A'+AKEY; - } else if (str[prev]>='0' && str[prev]<='9') { - *key= str[prev]-'0'+ZEROKEY; - } else { - invalid= 1; - } - - } else if (!strncmp(str+prev, "ZEROKEY", len-prev) || !strncmp(str+prev, "ZERO", len-prev)) { - *key= ZEROKEY; - } else if (!strncmp(str+prev, "ONEKEY", len-prev) || !strncmp(str+prev, "ONE", len-prev)) { - *key= ONEKEY; - } else if (!strncmp(str+prev, "TWOKEY", len-prev) || !strncmp(str+prev, "TWO", len-prev)) { - *key= TWOKEY; - } else if (!strncmp(str+prev, "THREEKEY", len-prev) || !strncmp(str+prev, "THREE", len-prev)) { - *key= THREEKEY; - } else if (!strncmp(str+prev, "FOURKEY", len-prev) || !strncmp(str+prev, "FOUR", len-prev)) { - *key= FOURKEY; - } else if (!strncmp(str+prev, "FIVEKEY", len-prev) || !strncmp(str+prev, "FIVE", len-prev)) { - *key= FIVEKEY; - } else if (!strncmp(str+prev, "SIZEKEY", len-prev) || !strncmp(str+prev, "SIX", len-prev)) { - *key= SIXKEY; - } else if (!strncmp(str+prev, "SEVENKEY", len-prev) || !strncmp(str+prev, "SEVEN", len-prev)) { - *key= SEVENKEY; - } else if (!strncmp(str+prev, "EIGHTKEY", len-prev) || !strncmp(str+prev, "EIGHT", len-prev)) { - *key= EIGHTKEY; - } else if (!strncmp(str+prev, "NINEKEY", len-prev) || !strncmp(str+prev, "NINE", len-prev)) { - *key= NINEKEY; - - } else if (!strncmp(str+prev, "ESCKEY", len-prev) || !strncmp(str+prev, "ESC", len-prev)) { - *key= ESCKEY; - } else if (!strncmp(str+prev, "TABKEY", len-prev) || !strncmp(str+prev, "TAB", len-prev)) { - *key= TABKEY; - } else if (!strncmp(str+prev, "RETKEY", len-prev) || !strncmp(str+prev, "RETURN", len-prev) || !strncmp(str+prev, "ENTER", len-prev)) { - *key= RETKEY; - } else if (!strncmp(str+prev, "SPACEKEY", len-prev) || !strncmp(str+prev, "SPACE", len-prev)) { - *key= SPACEKEY; - } else if (!strncmp(str+prev, "LINEFEEDKEY", len-prev) || !strncmp(str+prev, "LINEFEED", len-prev)) { - *key= LINEFEEDKEY; - } else if (!strncmp(str+prev, "BACKSPACEKEY", len-prev) || !strncmp(str+prev, "BACKSPACE", len-prev)) { - *key= BACKSPACEKEY; - } else if (!strncmp(str+prev, "DELKEY", len-prev) || !strncmp(str+prev, "DELETE", len-prev)) { - *key= DELKEY; - - } else if (!strncmp(str+prev, "SEMICOLONKEY", len-prev) || !strncmp(str+prev, "SEMICOLON", len-prev)) { - *key= SEMICOLONKEY; - } else if (!strncmp(str+prev, "PERIODKEY", len-prev) || !strncmp(str+prev, "PERIOD", len-prev)) { - *key= PERIODKEY; - } else if (!strncmp(str+prev, "COMMAKEY", len-prev) || !strncmp(str+prev, "COMMA", len-prev)) { - *key= COMMAKEY; - } else if (!strncmp(str+prev, "QUOTEKEY", len-prev) || !strncmp(str+prev, "QUOTE", len-prev)) { - *key= QUOTEKEY; - } else if (!strncmp(str+prev, "ACCENTGRAVEKEY", len-prev) || !strncmp(str+prev, "ACCENTGRAVE", len-prev)) { - *key= ACCENTGRAVEKEY; - } else if (!strncmp(str+prev, "MINUSKEY", len-prev) || !strncmp(str+prev, "MINUS", len-prev)) { - *key= MINUSKEY; - } else if (!strncmp(str+prev, "SLASHKEY", len-prev) || !strncmp(str+prev, "SLASH", len-prev)) { - *key= SLASHKEY; - } else if (!strncmp(str+prev, "BACKSLASHKEY", len-prev) || !strncmp(str+prev, "BACKSLASH", len-prev)) { - *key= BACKSLASHKEY; - } else if (!strncmp(str+prev, "EQUALKEY", len-prev) || !strncmp(str+prev, "EQUAL", len-prev)) { - *key= EQUALKEY; - } else if (!strncmp(str+prev, "LEFTBRACKETKEY", len-prev) || !strncmp(str+prev, "LEFTBRACKET", len-prev)) { - *key= LEFTBRACKETKEY; - } else if (!strncmp(str+prev, "RIGHTBRACKETKEY", len-prev) || !strncmp(str+prev, "RIGHTBRACKET", len-prev)) { - *key= RIGHTBRACKETKEY; - } else if (!strncmp(str+prev, "DELKEY", len-prev) || !strncmp(str+prev, "DELETE", len-prev)) { - *key= DELKEY; - - } else if (!strncmp(str+prev, "LEFTARROWKEY", len-prev) || !strncmp(str+prev, "LEFTARROW", len-prev)) { - *key= LEFTARROWKEY; - } else if (!strncmp(str+prev, "DOWNARROWKEY", len-prev) || !strncmp(str+prev, "DOWNARROW", len-prev)) { - *key= DOWNARROWKEY; - } else if (!strncmp(str+prev, "RIGHTARROWKEY", len-prev) || !strncmp(str+prev, "RIGHTARROW", len-prev)) { - *key= RIGHTARROWKEY; - } else if (!strncmp(str+prev, "UPARROWKEY", len-prev) || !strncmp(str+prev, "UPARROW", len-prev)) { - *key= UPARROWKEY; - - } else if (!strncmp(str+prev, "PAD", 3)) { - - if (len-prev<=4) { - - if (str[prev]>='0' && str[prev]<='9') { - *key= str[prev]-'0'+ZEROKEY; - } else { - invalid= 1; - } - - } else if (!strncmp(str+prev+3, "PERIODKEY", len-prev-3) || !strncmp(str+prev+3, "PERIOD", len-prev-3)) { - *key= PADPERIOD; - } else if (!strncmp(str+prev+3, "SLASHKEY", len-prev-3) || !strncmp(str+prev+3, "SLASH", len-prev-3)) { - *key= PADSLASHKEY; - } else if (!strncmp(str+prev+3, "ASTERKEY", len-prev-3) || !strncmp(str+prev+3, "ASTERISK", len-prev-3)) { - *key= PADASTERKEY; - } else if (!strncmp(str+prev+3, "MINUSKEY", len-prev-3) || !strncmp(str+prev+3, "MINUS", len-prev-3)) { - *key= PADMINUS; - } else if (!strncmp(str+prev+3, "ENTERKEY", len-prev-3) || !strncmp(str+prev+3, "ENTER", len-prev-3)) { - *key= PADENTER; - } else if (!strncmp(str+prev+3, "PLUSKEY", len-prev-3) || !strncmp(str+prev+3, "PLUS", len-prev-3)) { - *key= PADPLUSKEY; - } else { - invalid= 1; - } - - } else if (!strncmp(str+prev, "F1KEY", len-prev) || !strncmp(str+prev, "F1", len-prev)) { - *key= F1KEY; - } else if (!strncmp(str+prev, "F2KEY", len-prev) || !strncmp(str+prev, "F2", len-prev)) { - *key= F2KEY; - } else if (!strncmp(str+prev, "F3KEY", len-prev) || !strncmp(str+prev, "F3", len-prev)) { - *key= F3KEY; - } else if (!strncmp(str+prev, "F4KEY", len-prev) || !strncmp(str+prev, "F4", len-prev)) { - *key= F4KEY; - } else if (!strncmp(str+prev, "F5KEY", len-prev) || !strncmp(str+prev, "F5", len-prev)) { - *key= F5KEY; - } else if (!strncmp(str+prev, "F6KEY", len-prev) || !strncmp(str+prev, "F6", len-prev)) { - *key= F6KEY; - } else if (!strncmp(str+prev, "F7KEY", len-prev) || !strncmp(str+prev, "F7", len-prev)) { - *key= F7KEY; - } else if (!strncmp(str+prev, "F8KEY", len-prev) || !strncmp(str+prev, "F8", len-prev)) { - *key= F8KEY; - } else if (!strncmp(str+prev, "F9KEY", len-prev) || !strncmp(str+prev, "F9", len-prev)) { - *key= F9KEY; - } else if (!strncmp(str+prev, "F10KEY", len-prev) || !strncmp(str+prev, "F10", len-prev)) { - *key= F10KEY; - } else if (!strncmp(str+prev, "F11KEY", len-prev) || !strncmp(str+prev, "F11", len-prev)) { - *key= F11KEY; - } else if (!strncmp(str+prev, "F12KEY", len-prev) || !strncmp(str+prev, "F12", len-prev)) { - *key= F12KEY; - - } else if (!strncmp(str+prev, "PAUSEKEY", len-prev) || !strncmp(str+prev, "PAUSE", len-prev)) { - *key= PAUSEKEY; - } else if (!strncmp(str+prev, "INSERTKEY", len-prev) || !strncmp(str+prev, "INSERT", len-prev)) { - *key= INSERTKEY; - } else if (!strncmp(str+prev, "HOMEKEY", len-prev) || !strncmp(str+prev, "HOME", len-prev)) { - *key= HOMEKEY; - } else if (!strncmp(str+prev, "PAGEUPKEY", len-prev) || !strncmp(str+prev, "PAGEUP", len-prev)) { - *key= PAGEUPKEY; - } else if (!strncmp(str+prev, "PAGEDOWNKEY", len-prev) || !strncmp(str+prev, "PAGEDOWN", len-prev)) { - *key= PAGEDOWNKEY; - } else if (!strncmp(str+prev, "ENDKEY", len-prev) || !strncmp(str+prev, "END", len-prev)) { - *key= ENDKEY; - - } else { - invalid= 1; - } - - if (!invalid && *key) { - return 1; - } - - return 0; -} diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index 7f5201f4704..3ac6a1778db 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1947,26 +1947,35 @@ void EM_init_index_arrays(EditMesh *em, int forVert, int forEdge, int forFace) if (forVert) { em->totvert= BLI_countlist(&em->verts); - g_em_vert_array = MEM_mallocN(sizeof(*g_em_vert_array)*em->totvert, "em_v_arr"); - for (i=0,eve=em->verts.first; eve; i++,eve=eve->next) - g_em_vert_array[i] = eve; + if(em->totvert) { + g_em_vert_array = MEM_mallocN(sizeof(*g_em_vert_array)*em->totvert, "em_v_arr"); + + for (i=0,eve=em->verts.first; eve; i++,eve=eve->next) + g_em_vert_array[i] = eve; + } } if (forEdge) { em->totedge= BLI_countlist(&em->edges); - g_em_edge_array = MEM_mallocN(sizeof(*g_em_edge_array)*em->totedge, "em_e_arr"); - for (i=0,eed=em->edges.first; eed; i++,eed=eed->next) - g_em_edge_array[i] = eed; + if(em->totedge) { + g_em_edge_array = MEM_mallocN(sizeof(*g_em_edge_array)*em->totedge, "em_e_arr"); + + for (i=0,eed=em->edges.first; eed; i++,eed=eed->next) + g_em_edge_array[i] = eed; + } } if (forFace) { em->totface= BLI_countlist(&em->faces); - g_em_face_array = MEM_mallocN(sizeof(*g_em_face_array)*em->totface, "em_f_arr"); - for (i=0,efa=em->faces.first; efa; i++,efa=efa->next) - g_em_face_array[i] = efa; + if(em->totface) { + g_em_face_array = MEM_mallocN(sizeof(*g_em_face_array)*em->totface, "em_f_arr"); + + for (i=0,efa=em->faces.first; efa; i++,efa=efa->next) + g_em_face_array[i] = efa; + } } } diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 12138ee13d2..abbbb5aea3d 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -1307,6 +1307,7 @@ static float new_primitive_matrix(bContext *C, float primmat[][4]) static int add_primitive_plane_exec(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1316,6 +1317,7 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_PLANE, mat, 4, 0, 0, dia, 0.0f, 0, 1); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); return OPERATOR_FINISHED; @@ -1337,6 +1339,7 @@ void MESH_OT_primitive_plane_add(wmOperatorType *ot) static int add_primitive_cube_exec(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1346,6 +1349,7 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_CUBE, mat, 4, 0, 0, dia, 1.0f, 1, 1); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); return OPERATOR_FINISHED; @@ -1367,6 +1371,7 @@ void MESH_OT_primitive_cube_add(wmOperatorType *ot) static int add_primitive_circle_exec(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1376,6 +1381,7 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_CIRCLE, mat, RNA_int_get(op->ptr, "vertices"), 0, 0, dia, 0.0f, 0, RNA_boolean_get(op->ptr, "fill")); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); return OPERATOR_FINISHED; @@ -1402,6 +1408,7 @@ void MESH_OT_primitive_circle_add(wmOperatorType *ot) static int add_primitive_cylinder_exec(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1411,6 +1418,7 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_CYLINDER, mat, RNA_int_get(op->ptr, "vertices"), 0, 0, dia, RNA_float_get(op->ptr, "depth"), 1, 1); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); return OPERATOR_FINISHED; @@ -1437,6 +1445,7 @@ void MESH_OT_primitive_cylinder_add(wmOperatorType *ot) static int add_primitive_tube_exec(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1446,6 +1455,7 @@ static int add_primitive_tube_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_CYLINDER, mat, RNA_int_get(op->ptr, "vertices"), 0, 0, dia, RNA_float_get(op->ptr, "depth"), 1, 0); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); return OPERATOR_FINISHED; @@ -1472,6 +1482,7 @@ void MESH_OT_primitive_tube_add(wmOperatorType *ot) static int add_primitive_cone_exec(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1481,6 +1492,7 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_CONE, mat, RNA_int_get(op->ptr, "vertices"), 0, 0, dia, RNA_float_get(op->ptr, "depth"), 0, RNA_boolean_get(op->ptr, "cap_end")); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); return OPERATOR_FINISHED; @@ -1509,6 +1521,7 @@ void MESH_OT_primitive_cone_add(wmOperatorType *ot) static int add_primitive_grid_exec(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1518,6 +1531,7 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_GRID, mat, RNA_int_get(op->ptr, "x_subdivisions"), RNA_int_get(op->ptr, "y_subdivisions"), 0, dia, 0.0f, 0, 1); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); return OPERATOR_FINISHED; @@ -1544,6 +1558,7 @@ void MESH_OT_primitive_grid_add(wmOperatorType *ot) static int add_primitive_monkey_exec(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float mat[4][4]; @@ -1551,6 +1566,7 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_MONKEY, mat, 0, 0, 2, 0.0f, 0.0f, 0, 0); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); return OPERATOR_FINISHED; @@ -1572,6 +1588,7 @@ void MESH_OT_primitive_monkey_add(wmOperatorType *ot) static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1581,6 +1598,7 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_UVSPHERE, mat, RNA_int_get(op->ptr, "rings"), RNA_int_get(op->ptr, "segments"), 0, dia, 0.0f, 0, 0); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); return OPERATOR_FINISHED; @@ -1607,6 +1625,7 @@ void MESH_OT_primitive_uv_sphere_add(wmOperatorType *ot) static int add_primitive_icosphere_exec(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1616,6 +1635,7 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_ICOSPHERE, mat, 0, 0, RNA_int_get(op->ptr, "subdivisions"), dia, 0.0f, 0, 0); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); return OPERATOR_FINISHED; diff --git a/source/blender/editors/mesh/editmesh_loop.c b/source/blender/editors/mesh/editmesh_loop.c index afbf43c4d85..9f804ee8553 100644 --- a/source/blender/editors/mesh/editmesh_loop.c +++ b/source/blender/editors/mesh/editmesh_loop.c @@ -624,6 +624,7 @@ static float seg_intersect(EditEdge *e, CutCurve *c, int len, char mode, struct static int knife_cut_exec(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); ARegion *ar= CTX_wm_region(C); @@ -703,6 +704,10 @@ static int knife_cut_exec(bContext *C, wmOperator *op) BLI_ghash_free(gh, NULL, (GHashValFreeFP)MEM_freeN); BKE_mesh_end_editmesh(obedit->data, em); + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + return OPERATOR_FINISHED; } diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 70a0c6b82da..67886ee8df5 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -642,25 +642,24 @@ static int unified_findnearest(ViewContext *vc, EditVert **eve, EditEdge **eed, /* **************** SIMILAR "group" SELECTS. FACE, EDGE AND VERTEX ************** */ -/* selects new faces/edges/verts based on the - existing selection - -FACES GROUP - mode 1: same material - mode 2: same image - mode 3: same area - mode 4: same perimeter - mode 5: same normal - mode 6: same co-planer -*/ +/* selects new faces/edges/verts based on the existing selection */ + +/* FACES GROUP */ + +#define SIMFACE_MATERIAL 201 +#define SIMFACE_IMAGE 202 +#define SIMFACE_AREA 203 +#define SIMFACE_PERIMETER 204 +#define SIMFACE_NORMAL 205 +#define SIMFACE_COPLANAR 206 static EnumPropertyItem prop_simface_types[] = { - {1, "MATERIAL", 0, "Material", ""}, - {2, "IMAGE", 0, "Image", ""}, - {3, "AREA", 0, "Area", ""}, - {4, "PERIMETER", 0, "Perimeter", ""}, - {5, "NORMAL", 0, "Normal", ""}, - {6, "COPLANAR", 0, "Co-planar", ""}, + {SIMFACE_MATERIAL, "MATERIAL", 0, "Material", ""}, + {SIMFACE_IMAGE, "IMAGE", 0, "Image", ""}, + {SIMFACE_AREA, "AREA", 0, "Area", ""}, + {SIMFACE_PERIMETER, "PERIMETER", 0, "Perimeter", ""}, + {SIMFACE_NORMAL, "NORMAL", 0, "Normal", ""}, + {SIMFACE_COPLANAR, "COPLANAR", 0, "Co-planar", ""}, {0, NULL, 0, NULL, NULL} }; @@ -695,12 +694,11 @@ static int similar_face_select__internal(Scene *scene, EditMesh *em, int mode) if (!ok || !deselcount) /* no data selected OR no more data to select */ return 0; - /*if mode is 3 then record face areas, 4 record perimeter */ - if (mode==3) { + if (mode==SIMFACE_AREA) { for(efa= em->faces.first; efa; efa= efa->next) { efa->tmp.fp= EM_face_area(efa); } - } else if (mode==4) { + } else if (mode==SIMFACE_PERIMETER) { for(efa= em->faces.first; efa; efa= efa->next) { efa->tmp.fp= EM_face_perimeter(efa); } @@ -708,7 +706,7 @@ static int similar_face_select__internal(Scene *scene, EditMesh *em, int mode) for(base_efa= em->faces.first; base_efa; base_efa= base_efa->next) { if (base_efa->f1) { /* This was one of the faces originaly selected */ - if (mode==1) { /* same material */ + if (mode==SIMFACE_MATERIAL) { /* same material */ for(efa= em->faces.first; efa; efa= efa->next) { if ( !(efa->f & SELECT) && @@ -722,7 +720,7 @@ static int similar_face_select__internal(Scene *scene, EditMesh *em, int mode) return selcount; } } - } else if (mode==2) { /* same image */ + } else if (mode==SIMFACE_IMAGE) { /* same image */ MTFace *tf, *base_tf; base_tf = (MTFace*)CustomData_em_get(&em->fdata, base_efa->data, @@ -745,7 +743,7 @@ static int similar_face_select__internal(Scene *scene, EditMesh *em, int mode) } } } - } else if (mode==3 || mode==4) { /* same area OR same perimeter, both use the same temp var */ + } else if (mode==SIMFACE_AREA || mode==SIMFACE_PERIMETER) { /* same area OR same perimeter, both use the same temp var */ for(efa= em->faces.first; efa; efa= efa->next) { if ( (!(efa->f & SELECT) && !efa->h) && @@ -758,7 +756,7 @@ static int similar_face_select__internal(Scene *scene, EditMesh *em, int mode) return selcount; } } - } else if (mode==5) { /* same normal */ + } else if (mode==SIMFACE_NORMAL) { float angle; for(efa= em->faces.first; efa; efa= efa->next) { if (!(efa->f & SELECT) && !efa->h) { @@ -772,7 +770,7 @@ static int similar_face_select__internal(Scene *scene, EditMesh *em, int mode) } } } - } else if (mode==6) { /* same planer */ + } else if (mode==SIMFACE_COPLANAR) { /* same planer */ float angle, base_dot, dot; base_dot= Inpf(base_efa->cent, base_efa->n); for(efa= em->faces.first; efa; efa= efa->next) { @@ -817,45 +815,26 @@ static int similar_face_select_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -void MESH_OT_faces_select_similar(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Similar Face Select"; - ot->idname= "MESH_OT_faces_select_similar"; - - /* api callbacks */ - ot->invoke= WM_menu_invoke; - ot->exec= similar_face_select_exec; - ot->poll= ED_operator_editmesh; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /* properties */ - RNA_def_enum(ot->srna, "type", prop_simface_types, 0, "Type", ""); -} - /* ***************************************************** */ -/* -EDGE GROUP - mode 1: same length - mode 2: same direction - mode 3: same number of face users - mode 4: similar face angles. - mode 5: similar crease - mode 6: similar seam - mode 7: similar sharp -*/ +/* EDGE GROUP */ + +#define SIMEDGE_LENGTH 101 +#define SIMEDGE_DIR 102 +#define SIMEDGE_FACE 103 +#define SIMEDGE_FACE_ANGLE 104 +#define SIMEDGE_CREASE 105 +#define SIMEDGE_SEAM 106 +#define SIMEDGE_SHARP 107 static EnumPropertyItem prop_simedge_types[] = { - {1, "LENGTH", 0, "Length", ""}, - {2, "DIR", 0, "Direction", ""}, - {3, "FACE", 0, "Amount of Vertices in Face", ""}, - {4, "FACE_ANGLE", 0, "Face Angles", ""}, - {5, "CREASE", 0, "Crease", ""}, - {6, "SEAM", 0, "Seam", ""}, - {7, "SHARP", 0, "Sharpness", ""}, + {SIMEDGE_LENGTH, "LENGTH", 0, "Length", ""}, + {SIMEDGE_DIR, "DIR", 0, "Direction", ""}, + {SIMEDGE_FACE, "FACE", 0, "Amount of Vertices in Face", ""}, + {SIMEDGE_FACE_ANGLE, "FACE_ANGLE", 0, "Face Angles", ""}, + {SIMEDGE_CREASE, "CREASE", 0, "Crease", ""}, + {SIMEDGE_SEAM, "SEAM", 0, "Seam", ""}, + {SIMEDGE_SHARP, "SHARP", 0, "Sharpness", ""}, {0, NULL, 0, NULL, NULL} }; @@ -883,19 +862,19 @@ static int similar_edge_select__internal(Scene *scene, EditMesh *em, int mode) /* set all eed->tmp.l to 0 we use it later. for counting face users*/ eed->tmp.l=0; - eed->f2=0; /* only for mode 4, edge animations */ + eed->f2=0; /* only for mode SIMEDGE_FACE_ANGLE, edge animations */ } } if (!ok || !deselcount) /* no data selected OR no more data to select*/ return 0; - if (mode==1) { /*store length*/ + if (mode==SIMEDGE_LENGTH) { /*store length*/ for(eed= em->edges.first; eed; eed= eed->next) { if (!eed->h) /* dont calc data for hidden edges*/ eed->tmp.fp= VecLenf(eed->v1->co, eed->v2->co); } - } else if (mode==3) { /*store face users*/ + } else if (mode==SIMEDGE_FACE) { /*store face users*/ EditFace *efa; /* cound how many faces each edge uses use tmp->l */ for(efa= em->faces.first; efa; efa= efa->next) { @@ -904,7 +883,7 @@ static int similar_edge_select__internal(Scene *scene, EditMesh *em, int mode) efa->e3->tmp.l++; if (efa->e4) efa->e4->tmp.l++; } - } else if (mode==4) { /*store edge angles */ + } else if (mode==SIMEDGE_FACE_ANGLE) { /*store edge angles */ EditFace *efa; int j; /* cound how many faces each edge uses use tmp.l */ @@ -946,7 +925,7 @@ static int similar_edge_select__internal(Scene *scene, EditMesh *em, int mode) for(base_eed= em->edges.first; base_eed; base_eed= base_eed->next) { if (base_eed->f1) { - if (mode==1) { /* same length */ + if (mode==SIMEDGE_LENGTH) { /* same length */ for(eed= em->edges.first; eed; eed= eed->next) { if ( !(eed->f & SELECT) && @@ -960,7 +939,7 @@ static int similar_edge_select__internal(Scene *scene, EditMesh *em, int mode) return selcount; } } - } else if (mode==2) { /* same direction */ + } else if (mode==SIMEDGE_DIR) { /* same direction */ float base_dir[3], dir[3], angle; VecSubf(base_dir, base_eed->v1->co, base_eed->v2->co); for(eed= em->edges.first; eed; eed= eed->next) { @@ -980,7 +959,7 @@ static int similar_edge_select__internal(Scene *scene, EditMesh *em, int mode) } } } - } else if (mode==3) { /* face users */ + } else if (mode==SIMEDGE_FACE) { /* face users */ for(eed= em->edges.first; eed; eed= eed->next) { if ( !(eed->f & SELECT) && @@ -994,7 +973,7 @@ static int similar_edge_select__internal(Scene *scene, EditMesh *em, int mode) return selcount; } } - } else if (mode==4 && base_eed->f2==2) { /* edge angles, f2==2 means the edge has an angle. */ + } else if (mode==SIMEDGE_FACE_ANGLE && base_eed->f2==2) { /* edge angles, f2==2 means the edge has an angle. */ for(eed= em->edges.first; eed; eed= eed->next) { if ( !(eed->f & SELECT) && @@ -1009,7 +988,7 @@ static int similar_edge_select__internal(Scene *scene, EditMesh *em, int mode) return selcount; } } - } else if (mode==5) { /* edge crease */ + } else if (mode==SIMEDGE_CREASE) { /* edge crease */ for(eed= em->edges.first; eed; eed= eed->next) { if ( !(eed->f & SELECT) && @@ -1023,7 +1002,7 @@ static int similar_edge_select__internal(Scene *scene, EditMesh *em, int mode) return selcount; } } - } else if (mode==6) { /* edge seam */ + } else if (mode==SIMEDGE_SEAM) { /* edge seam */ for(eed= em->edges.first; eed; eed= eed->next) { if ( !(eed->f & SELECT) && @@ -1037,7 +1016,7 @@ static int similar_edge_select__internal(Scene *scene, EditMesh *em, int mode) return selcount; } } - } else if (mode==7) { /* edge sharp */ + } else if (mode==SIMEDGE_SHARP) { /* edge sharp */ for(eed= em->edges.first; eed; eed= eed->next) { if ( !(eed->f & SELECT) && @@ -1078,24 +1057,6 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -void MESH_OT_edges_select_similar(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Similar Edge Select"; - ot->idname= "MESH_OT_edges_select_similar"; - - /* api callbacks */ - ot->invoke= WM_menu_invoke; - ot->exec= similar_edge_select_exec; - ot->poll= ED_operator_editmesh; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /* properties */ - RNA_def_enum(ot->srna, "type", prop_simedge_types, 0, "Type", ""); -} - /* ********************************* */ /* @@ -1104,10 +1065,15 @@ VERT GROUP mode 2: same number of face users mode 3: same vertex groups */ + +#define SIMVERT_NORMAL 0 +#define SIMVERT_FACE 1 +#define SIMVERT_VGROUP 2 + static EnumPropertyItem prop_simvertex_types[] = { - {0, "NORMAL", 0, "Normal", ""}, - {1, "FACE", 0, "Amount of Vertices in Face", ""}, - {2, "VGROUP", 0, "Vertex Groups", ""}, + {SIMVERT_NORMAL, "NORMAL", 0, "Normal", ""}, + {SIMVERT_FACE, "FACE", 0, "Amount of Vertices in Face", ""}, + {SIMVERT_VGROUP, "VGROUP", 0, "Vertex Groups", ""}, {0, NULL, 0, NULL, NULL} }; @@ -1124,6 +1090,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op) /*count how many visible selected edges there are, so we can return when there are none left */ unsigned int deselcount=0; + int mode= RNA_enum_get(op->ptr, "type"); short ok=0; float thresh= scene->toolsettings->select_thresh; @@ -1148,7 +1115,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op) return 0; } - if(RNA_enum_is_equal(op->ptr, "type", "FACE")) { + if(mode == SIMVERT_FACE) { /* store face users */ EditFace *efa; @@ -1165,7 +1132,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op) for(base_eve= em->verts.first; base_eve; base_eve= base_eve->next) { if (base_eve->f1) { - if(RNA_enum_is_equal(op->ptr, "type", "NORMAL")) { + if(mode == SIMVERT_NORMAL) { float angle; for(eve= em->verts.first; eve; eve= eve->next) { if (!(eve->f & SELECT) && !eve->h) { @@ -1182,7 +1149,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op) } } } - else if(RNA_enum_is_equal(op->ptr, "type", "FACE")) { + else if(mode == SIMVERT_FACE) { for(eve= em->verts.first; eve; eve= eve->next) { if ( !(eve->f & SELECT) && @@ -1199,7 +1166,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op) } } } - else if(RNA_enum_is_equal(op->ptr, "type", "VGROUP")) { + else if(mode == SIMVERT_VGROUP) { MDeformVert *dvert, *base_dvert; short i, j; /* weight index */ @@ -1248,22 +1215,45 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -void MESH_OT_vertices_select_similar(wmOperatorType *ot) +static int select_similar_exec(bContext *C, wmOperator *op) { + int type= RNA_enum_get(op->ptr, "type"); + + if(type < 100) + return similar_vert_select_exec(C, op); + else if(type < 200) + return similar_edge_select_exec(C, op); + else + return similar_face_select_exec(C, op); +} + +static EnumPropertyItem *select_similar_type_itemf(PointerRNA *ptr) +{ + /* XXX need context! */ + return prop_simface_types; + return prop_simvertex_types; + return prop_simedge_types; +} + +void MESH_OT_select_similar(wmOperatorType *ot) +{ + PropertyRNA *prop; + /* identifiers */ - ot->name= "Similar Vertex Select"; - ot->idname= "MESH_OT_vertices_select_similar"; + ot->name= "Select Similar"; + ot->idname= "MESH_OT_select_similar"; /* api callbacks */ ot->invoke= WM_menu_invoke; - ot->exec= similar_vert_select_exec; + ot->exec= select_similar_exec; ot->poll= ED_operator_editmesh; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", prop_simvertex_types, 0, "Type", ""); + prop= RNA_def_enum(ot->srna, "type", prop_simvertex_types, 0, "Type", ""); + RNA_def_enum_funcs(prop, select_similar_type_itemf); } /* ******************************************* */ @@ -2740,20 +2730,24 @@ void MESH_OT_reveal(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -void select_faces_by_numverts(EditMesh *em, wmOperator *op, int numverts) +int select_by_number_vertices_exec(bContext *C, wmOperator *op) { + Object *obedit= CTX_data_edit_object(C); + EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); EditFace *efa; + int numverts= RNA_enum_get(op->ptr, "type"); /* Selects trias/qiads or isolated verts, and edges that do not have 2 neighboring * faces */ /* for loose vertices/edges, we first select all, loop below will deselect */ - if(numverts==5) + if(numverts==5) { EM_set_flag_all(em, SELECT); + } else if(em->selectmode!=SCE_SELECT_FACE) { BKE_report(op->reports, RPT_ERROR, "Only works in face selection mode"); - return; + return OPERATOR_CANCELLED; } for(efa= em->faces.first; efa; efa= efa->next) { @@ -2765,8 +2759,32 @@ void select_faces_by_numverts(EditMesh *em, wmOperator *op, int numverts) } } -// if (EM_texFaceCheck()) + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + + return OPERATOR_FINISHED; +} + +void MESH_OT_select_by_number_vertices(wmOperatorType *ot) +{ + static const EnumPropertyItem type_items[]= { + {3, "TRIANGLES", 0, "Triangles", NULL}, + {4, "QUADS", 0, "Triangles", NULL}, + {5, "OTHER", 0, "Other", NULL}, + {0, NULL, 0, NULL, NULL}}; + + /* identifiers */ + ot->name= "Select by Number of Vertices"; + ot->idname= "MESH_OT_select_by_number_vertices"; + + /* api callbacks */ + ot->exec= select_by_number_vertices_exec; + ot->poll= ED_operator_editmesh; + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* props */ + RNA_def_enum(ot->srna, "type", type_items, 3, "Type", "Type of elements to select."); } static int select_sharp_edges_exec(bContext *C, wmOperator *op) @@ -3475,6 +3493,7 @@ void MESH_OT_select_random(wmOperatorType *ot) /* api callbacks */ ot->exec= mesh_select_random_exec; + ot->invoke= WM_operator_props_popup; ot->poll= ED_operator_editmesh; /* flags */ @@ -3580,6 +3599,7 @@ void MESH_OT_selection_type(wmOperatorType *ot) static int editmesh_mark_seam(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); Mesh *me= ((Mesh *)obedit->data); @@ -3610,9 +3630,11 @@ static int editmesh_mark_seam(bContext *C, wmOperator *op) } } + BKE_mesh_end_editmesh(obedit->data, em); + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -3634,6 +3656,7 @@ void MESH_OT_mark_seam(wmOperatorType *ot) static int editmesh_mark_sharp(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); Mesh *me= ((Mesh *)obedit->data); @@ -3659,9 +3682,11 @@ static int editmesh_mark_sharp(bContext *C, wmOperator *op) } } + BKE_mesh_end_editmesh(obedit->data, em); + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -4055,6 +4080,7 @@ void righthandfaces(EditMesh *em, int select) /* makes faces righthand turning * static int righthandfaces_exec(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); @@ -4063,9 +4089,11 @@ static int righthandfaces_exec(bContext *C, wmOperator *op) // XXX need other args righthandfaces(em, RNA_boolean_get(op->ptr, "inside")); + BKE_mesh_end_editmesh(obedit->data, em); + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); //TODO is this needed ? - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -4398,11 +4426,11 @@ static int smooth_vertex(bContext *C, wmOperator *op) recalc_editnormals(em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + BKE_mesh_end_editmesh(obedit->data, em); -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -4531,9 +4559,11 @@ static int vertices_to_sphere_exec(bContext *C, wmOperator *op) vertices_to_sphere(scene, v3d, obedit, em, RNA_float_get(op->ptr,"percent")); + BKE_mesh_end_editmesh(obedit->data, em); + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -4576,6 +4606,7 @@ void flipface(EditMesh *em, EditFace *efa) static int flip_editnormals(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); EditFace *efa; @@ -4592,6 +4623,10 @@ static int flip_editnormals(bContext *C, wmOperator *op) recalc_editnormals(em); BKE_mesh_end_editmesh(obedit->data, em); + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + return OPERATOR_FINISHED; } @@ -4608,3 +4643,4 @@ void MESH_OT_flip_editnormals(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } + diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index dc9c8c6b6d2..2c3007d00ad 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -496,6 +496,7 @@ static int removedoublesflag_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_INFO, msg); } + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); BKE_mesh_end_editmesh(obedit->data, em); @@ -698,28 +699,33 @@ void extrude_mesh(Object *obedit, EditMesh *em, wmOperator *op) // XXX should be a menu item static int mesh_extrude_invoke(bContext *C, wmOperator *op, wmEvent *event) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); extrude_mesh(obedit,em, op); + + BKE_mesh_end_editmesh(obedit->data, em); + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); RNA_int_set(op->ptr, "mode", TFM_TRANSLATION); WM_operator_name_call(C, "TFM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr); - - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } /* extrude without transform */ static int mesh_extrude_exec(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(obedit->data); extrude_mesh(obedit,em, op); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); BKE_mesh_end_editmesh(obedit->data, em); @@ -747,6 +753,7 @@ void MESH_OT_extrude(wmOperatorType *ot) static int split_mesh(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -760,9 +767,9 @@ static int split_mesh(bContext *C, wmOperator *op) WM_cursor_wait(0); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -784,6 +791,7 @@ void MESH_OT_split(wmOperatorType *ot) static int extrude_repeat_mesh(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -819,9 +827,9 @@ static int extrude_repeat_mesh(bContext *C, wmOperator *op) EM_fgon_flags(em); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -931,16 +939,19 @@ static int spin_mesh(bContext *C, wmOperator *op, float *dvec, int steps, float static int spin_mesh_exec(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); int ok; - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - ok= spin_mesh(C, op, NULL, RNA_int_get(op->ptr,"steps"), RNA_float_get(op->ptr,"degrees"), RNA_boolean_get(op->ptr,"dupli")); if(ok==0) { BKE_report(op->reports, RPT_ERROR, "No valid vertices are selected"); return OPERATOR_CANCELLED; } + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + return OPERATOR_FINISHED; } @@ -983,6 +994,7 @@ void MESH_OT_spin(wmOperatorType *ot) static int screw_mesh_exec(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); EditVert *eve,*v1=0,*v2=0; @@ -1038,7 +1050,9 @@ static int screw_mesh_exec(bContext *C, wmOperator *op) } if(spin_mesh(C, op, dvec, turns*steps, 360.0f*turns, 0)) { + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -1047,8 +1061,6 @@ static int screw_mesh_exec(bContext *C, wmOperator *op) BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } - - BKE_mesh_end_editmesh(obedit->data, em); } /* get center and axis, in global coords */ @@ -1267,8 +1279,6 @@ void delete_mesh(Object *obedit, EditMesh *em, wmOperator *op, int event) } EM_fgon_flags(em); // redo flags and indices for fgons - -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); } /* Note, these values must match delete_mesh() event values */ @@ -1285,11 +1295,13 @@ static EnumPropertyItem prop_mesh_delete_types[] = { static int delete_mesh_exec(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - delete_mesh(obedit,em, op,RNA_enum_get(op->ptr, "type")); + delete_mesh(obedit, em, op, RNA_enum_get(op->ptr, "type")); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); BKE_mesh_end_editmesh(obedit->data, em); @@ -2898,7 +2910,6 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float rad, int beaut } recalc_editnormals(em); -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); } static int count_selected_edges(EditEdge *ed) @@ -3379,7 +3390,6 @@ void join_triangles(EditMesh *em) if(edsortblock) MEM_freeN(edsortblock); EM_selectmode_flush(em); -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); } /* ******************** END TRIANGLE TO QUAD ************************************* */ @@ -3475,9 +3485,6 @@ void edge_flip(EditMesh *em) free_tagged_edges_faces(em, em->edges.first, em->faces.first); MEM_freeN(efaar); - -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - } static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed,int dir) @@ -3658,6 +3665,7 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed,int dir) /* only accepts 1 selected edge, or 2 selected faces */ static int edge_rotate_selected(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -3722,10 +3730,9 @@ static int edge_rotate_selected(bContext *C, wmOperator *op) /* flush selected vertices (again) to edges/faces */ EM_select_flush(em); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -4733,9 +4740,6 @@ void mesh_set_smooth_faces(EditMesh *em, short event) } efa= efa->next; } - -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - } /* ********************** mesh rip ********************** */ @@ -4776,6 +4780,7 @@ static void mesh_rip_setface(EditMesh *em, EditFace *sefa) /* based on mouse cursor position, it defines how is being ripped */ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) { + Scene *scene= CTX_data_scene(C); ARegion *ar= CTX_wm_region(C); RegionView3D *rv3d= ar->regiondata; Object *obedit= CTX_data_edit_object(C); @@ -4977,13 +4982,17 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) } } + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + + BKE_mesh_end_editmesh(obedit->data, em); + RNA_int_set(op->ptr, "mode", TFM_TRANSLATION); WM_operator_name_call(C, "TFM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr); // scene->prop_mode = propmode; // XXX scene->proportional = prop; - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -5762,8 +5771,13 @@ typedef struct PathEdge{ float w; } PathEdge; -void pathselect(EditMesh *em, wmOperator *op) +#define PATH_SELECT_EDGE_LENGTH 0 +#define PATH_SELECT_TOPOLOGICAL 1 + +int select_vertex_path_exec(bContext *C, wmOperator *op) { + Object *obedit= CTX_data_edit_object(C); + EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); EditVert *eve, *s, *t; EditEdge *eed; EditSelection *ese; @@ -5812,9 +5826,7 @@ void pathselect(EditMesh *em, wmOperator *op) } } - - - if(s->f1 && t->f1){ /*t can be reached by s*/ + if(s->f1 && t->f1){ /* t can be reached by s */ Q = MEM_callocN(sizeof(PathNode)*totnodes, "Path Select Nodes"); totnodes = 0; for(eve=em->verts.first; eve; eve=eve->next){ @@ -5908,15 +5920,41 @@ void pathselect(EditMesh *em, wmOperator *op) MEM_freeN(previous); BLI_heap_free(heap, NULL); EM_select_flush(em); - // DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - -// if (EM_texFaceCheck()) } } - else{ + else { + BKE_mesh_end_editmesh(obedit->data, em); BKE_report(op->reports, RPT_ERROR, "Path Selection requires that exactly two vertices be selected"); - return; + return OPERATOR_CANCELLED; } + + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + BKE_mesh_end_editmesh(obedit->data, em); + + return OPERATOR_FINISHED; +} + +void MESH_OT_select_vertex_path(wmOperatorType *ot) +{ + static const EnumPropertyItem type_items[] = { + {PATH_SELECT_EDGE_LENGTH, "EDGE_LENGTH", 0, "Edge Length", NULL}, + {PATH_SELECT_TOPOLOGICAL, "TOPOLOGICAL", 0, "Topological", NULL}, + {0, NULL, 0, NULL, NULL}}; + + /* identifiers */ + ot->name= "Select Vertex Path"; + ot->idname= "MESH_OT_select_vertex_path"; + + /* api callbacks */ + ot->exec= select_vertex_path_exec; + ot->invoke= WM_menu_invoke; + ot->poll= ED_operator_editmesh; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_enum(ot->srna, "type", type_items, PATH_SELECT_EDGE_LENGTH, "Type", "Method to compute distance."); } static int region_to_loop(bContext *C, wmOperator *op) @@ -6156,6 +6194,7 @@ void MESH_OT_loop_to_region(wmOperatorType *ot) static int mesh_rotate_uvs(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -6219,17 +6258,20 @@ static int mesh_rotate_uvs(bContext *C, wmOperator *op) } } - if (change) { -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - } - BKE_mesh_end_editmesh(obedit->data, em); + + if(!change) + return OPERATOR_CANCELLED; + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + return OPERATOR_FINISHED; } static int mesh_mirror_uvs(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -6308,17 +6350,20 @@ static int mesh_mirror_uvs(bContext *C, wmOperator *op) } } - if (change) { -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - } - BKE_mesh_end_editmesh(obedit->data, em); + + if(!change) + return OPERATOR_CANCELLED; + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + return OPERATOR_FINISHED; } static int mesh_rotate_colors(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -6364,18 +6409,21 @@ static int mesh_rotate_colors(bContext *C, wmOperator *op) } } - if (change) { -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - } - BKE_mesh_end_editmesh(obedit->data, em); + + if(!change) + return OPERATOR_CANCELLED; + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + return OPERATOR_FINISHED; } static int mesh_mirror_colors(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -6420,12 +6468,14 @@ static int mesh_mirror_colors(bContext *C, wmOperator *op) } } - if (change) { -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - } - BKE_mesh_end_editmesh(obedit->data, em); + + if(!change) + return OPERATOR_CANCELLED; + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + return OPERATOR_FINISHED; } @@ -6487,15 +6537,17 @@ void MESH_OT_colors_mirror(wmOperatorType *ot) static int subdivide_exec(bContext *C, wmOperator *op) { - Object *obedit= CTX_data_edit_object(C); Scene *scene = CTX_data_scene(C); + Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); esubdivideflag(obedit, em, 1, 0.0, scene->toolsettings->editbutflag, 1, 0); + BKE_mesh_end_editmesh(obedit->data, em); + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -6515,15 +6567,17 @@ void MESH_OT_subdivide(wmOperatorType *ot) static int subdivide_multi_exec(bContext *C, wmOperator *op) { - Object *obedit= CTX_data_edit_object(C); Scene *scene = CTX_data_scene(C); + Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); esubdivideflag(obedit, em, 1, 0.0, scene->toolsettings->editbutflag, RNA_int_get(op->ptr,"number_cuts"), 0); + BKE_mesh_end_editmesh(obedit->data, em); + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -6546,15 +6600,17 @@ void MESH_OT_subdivide_multi(wmOperatorType *ot) static int subdivide_multi_fractal_exec(bContext *C, wmOperator *op) { - Object *obedit= CTX_data_edit_object(C); Scene *scene = CTX_data_scene(C); + Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); esubdivideflag(obedit, em, 1, -(RNA_float_get(op->ptr, "random_factor")/100), scene->toolsettings->editbutflag, RNA_int_get(op->ptr, "number_cuts"), 0); + BKE_mesh_end_editmesh(obedit->data, em); + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -6578,15 +6634,15 @@ void MESH_OT_subdivide_multi_fractal(wmOperatorType *ot) static int subdivide_smooth_exec(bContext *C, wmOperator *op) { - Object *obedit= CTX_data_edit_object(C); Scene *scene = CTX_data_scene(C); + Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); esubdivideflag(obedit, em, 1, 0.292f*RNA_float_get(op->ptr, "smoothness"), scene->toolsettings->editbutflag | B_SMOOTH, 1, 0); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -6922,15 +6978,17 @@ static void fill_mesh(EditMesh *em) static int fill_mesh_exec(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); fill_mesh(em); - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); - + + BKE_mesh_end_editmesh(obedit->data, em); + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -6951,14 +7009,17 @@ void MESH_OT_fill(wmOperatorType *ot) static int beauty_fill_exec(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); beauty_fill(em); + BKE_mesh_end_editmesh(obedit->data, em); + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -6978,11 +7039,13 @@ void MESH_OT_beauty_fill(wmOperatorType *ot) static int quads_convert_to_tris_exec(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); convert_to_triface(em,0); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); BKE_mesh_end_editmesh(obedit->data, em); @@ -7005,11 +7068,13 @@ void MESH_OT_quads_convert_to_tris(wmOperatorType *ot) static int tris_convert_to_quads_exec(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); join_triangles(em); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); BKE_mesh_end_editmesh(obedit->data, em); @@ -7032,11 +7097,13 @@ void MESH_OT_tris_convert_to_quads(wmOperatorType *ot) static int edge_flip_exec(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); edge_flip(em); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); BKE_mesh_end_editmesh(obedit->data, em); @@ -7059,14 +7126,17 @@ void MESH_OT_edge_flip(wmOperatorType *ot) static int mesh_faces_shade_smooth_exec(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); mesh_set_smooth_faces(em,1); + BKE_mesh_end_editmesh(obedit->data, em); + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -7086,14 +7156,15 @@ void MESH_OT_faces_shade_smooth(wmOperatorType *ot) static int mesh_faces_shade_solid_exec(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); mesh_set_smooth_faces(em,0); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -7110,3 +7181,4 @@ void MESH_OT_faces_shade_solid(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } + diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 22e3b4060a4..ff07d03313b 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -155,13 +155,12 @@ void MESH_OT_select_linked(struct wmOperatorType *ot); void MESH_OT_select_linked_pick(struct wmOperatorType *ot); void MESH_OT_hide(struct wmOperatorType *ot); void MESH_OT_reveal(struct wmOperatorType *ot); +void MESH_OT_select_by_number_vertices(struct wmOperatorType *ot); void MESH_OT_normals_make_consistent(struct wmOperatorType *ot); void MESH_OT_faces_select_linked_flat(struct wmOperatorType *ot); void MESH_OT_edges_select_sharp(struct wmOperatorType *ot); void MESH_OT_select_shortest_path(struct wmOperatorType *ot); -void MESH_OT_vertices_select_similar(struct wmOperatorType *ot); -void MESH_OT_edges_select_similar(struct wmOperatorType *ot); -void MESH_OT_faces_select_similar(struct wmOperatorType *ot); +void MESH_OT_select_similar(struct wmOperatorType *ot); void MESH_OT_select_random(struct wmOperatorType *ot); void MESH_OT_vertices_transform_to_sphere(struct wmOperatorType *ot); void MESH_OT_selection_type(struct wmOperatorType *ot); @@ -223,6 +222,7 @@ void MESH_OT_faces_shade_solid(struct wmOperatorType *ot); void MESH_OT_split(struct wmOperatorType *ot); void MESH_OT_extrude_repeat(struct wmOperatorType *ot); void MESH_OT_edge_rotate(struct wmOperatorType *ot); +void MESH_OT_select_vertex_path(struct wmOperatorType *ot); void MESH_OT_loop_to_region(struct wmOperatorType *ot); void MESH_OT_region_to_loop(struct wmOperatorType *ot); diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 2a9357ed0f0..7e59cd684ba 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -119,6 +119,7 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_selection_type); WM_operatortype_append(MESH_OT_hide); WM_operatortype_append(MESH_OT_reveal); + WM_operatortype_append(MESH_OT_select_by_number_vertices); WM_operatortype_append(MESH_OT_normals_make_consistent); WM_operatortype_append(MESH_OT_subdivide); WM_operatortype_append(MESH_OT_subdivide_multi); @@ -149,6 +150,7 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_split); WM_operatortype_append(MESH_OT_extrude_repeat); WM_operatortype_append(MESH_OT_edge_rotate); + WM_operatortype_append(MESH_OT_select_vertex_path); WM_operatortype_append(MESH_OT_loop_to_region); WM_operatortype_append(MESH_OT_region_to_loop); @@ -172,9 +174,7 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_loop_select); WM_operatortype_append(MESH_OT_edge_face_add); WM_operatortype_append(MESH_OT_select_shortest_path); - WM_operatortype_append(MESH_OT_vertices_select_similar); - WM_operatortype_append(MESH_OT_edges_select_similar); - WM_operatortype_append(MESH_OT_faces_select_similar); + WM_operatortype_append(MESH_OT_select_similar); WM_operatortype_append(MESH_OT_loop_multi_select); WM_operatortype_append(MESH_OT_mark_seam); WM_operatortype_append(MESH_OT_mark_sharp); @@ -223,7 +223,6 @@ void ED_keymap_mesh(wmWindowManager *wm) RNA_float_set(WM_keymap_add_item(keymap, "MESH_OT_faces_select_linked_flat", FKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0)->ptr,"sharpness",135.0); RNA_float_set(WM_keymap_add_item(keymap, "MESH_OT_edges_select_sharp", SKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0)->ptr,"sharpness",135.0); - WM_keymap_add_item(keymap, "MESH_OT_select_random", SPACEKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "MESH_OT_vertices_transform_to_sphere", SKEY, KM_PRESS, KM_CTRL|KM_SHIFT , 0); WM_keymap_add_item(keymap, "MESH_OT_mark_seam", ONEKEY, KM_PRESS, KM_CTRL , 0); @@ -232,10 +231,7 @@ void ED_keymap_mesh(wmWindowManager *wm) WM_keymap_add_item(keymap, "MESH_OT_mark_sharp", TWOKEY, KM_PRESS, KM_CTRL , 0); RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_mark_sharp", TWOKEY, KM_PRESS, KM_ALT , 0)->ptr,"set",1); - /* temp hotkeys! */ - WM_keymap_add_item(keymap, "MESH_OT_vertices_select_similar", GKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "MESH_OT_edges_select_similar", GKEY, KM_PRESS, KM_SHIFT2|KM_CTRL, 0); - WM_keymap_add_item(keymap, "MESH_OT_faces_select_similar", GKEY, KM_PRESS, KM_SHIFT|KM_CTRL2, 0); + WM_keymap_add_item(keymap, "MESH_OT_select_similar", GKEY, KM_PRESS, KM_SHIFT, 0); /* selection mode */ WM_keymap_add_item(keymap, "MESH_OT_selection_type", TABKEY, KM_PRESS, KM_CTRL, 0); diff --git a/source/blender/editors/physics/editparticle.c b/source/blender/editors/physics/editparticle.c index 1b6b5b43522..b656aa8fbf6 100644 --- a/source/blender/editors/physics/editparticle.c +++ b/source/blender/editors/physics/editparticle.c @@ -1826,7 +1826,7 @@ void PARTICLE_OT_rekey(wmOperatorType *ot) /* api callbacks */ ot->exec= rekey_exec; - ot->invoke= WM_operator_redo; + ot->invoke= WM_operator_props_popup; ot->poll= PE_poll; /* flags */ diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index dd8efd68604..1a061172ec1 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1128,8 +1128,6 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex em= (ar->type->minsizex)? 10: 20; } - header= 20; // XXX - triangle= 22; x= 0; y= -style->panelouter; @@ -1150,10 +1148,14 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex block= uiBeginBlock(C, ar, pt->idname, UI_EMBOSS); panel= uiBeginPanel(sa, ar, block, pt, &open); + /* bad fixed values */ + header= (pt->flag & PNL_NO_HEADER)? 0: 20; + triangle= 22; + if(vertical) y -= header; - if(pt->draw_header && (open || vertical)) { + if(pt->draw_header && header && (open || vertical)) { /* for enabled buttons */ panel->layout= uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER, triangle, header+style->panelspace, header, 1, style); diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 02179f347f5..97644097108 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -685,7 +685,7 @@ void buttons_context_draw(const bContext *C, uiLayout *layout) if(!path) return; - row= uiLayoutRow(layout, 0); + row= uiLayoutRow(layout, 1); uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_LEFT); block= uiLayoutGetBlock(row); @@ -696,18 +696,18 @@ void buttons_context_draw(const bContext *C, uiLayout *layout) for(a=0; alen; a++) { ptr= &path->ptr[a]; + if(a != 0) + uiDefIconBut(block, LABEL, 0, VICON_SMALL_TRI_RIGHT, 0, 0, 10, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); + if(ptr->data) { icon= RNA_struct_ui_icon(ptr->type); name= RNA_struct_name_get_alloc(ptr, namebuf, sizeof(namebuf)); -#if 0 - if(sbuts->mainb != BCONTEXT_SCENE && ptr->type == &RNA_Scene) { - uiItemL(row, "", icon); /* save some space */ - } - else -#endif if(name) { - uiItemL(row, name, icon); + if(sbuts->mainb != BCONTEXT_SCENE && ptr->type == &RNA_Scene) + uiItemL(row, "", icon); /* save some space */ + else + uiItemL(row, name, icon); if(name != namebuf) MEM_freeN(name); @@ -731,6 +731,7 @@ void buttons_context_register(ARegionType *art) strcpy(pt->idname, "BUTTONS_PT_context"); strcpy(pt->label, "Context"); pt->draw= buttons_panel_context; + pt->flag= PNL_NO_HEADER; BLI_addtail(&art->paneltypes, pt); } diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 24781cc115e..358da483744 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1060,7 +1060,7 @@ void IMAGE_OT_new(wmOperatorType *ot) /* api callbacks */ ot->exec= new_exec; - ot->invoke= WM_operator_redo; + ot->invoke= WM_operator_props_popup; ot->poll= ED_operator_image_active; /* flags */ diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 7d6faa00dfc..a1217f84380 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -294,6 +294,13 @@ static void image_listener(ScrArea *sa, wmNotifier *wmn) case NC_IMAGE: ED_area_tag_redraw(sa); break; + case NC_OBJECT: + switch(wmn->data) { + case ND_GEOM_SELECT: + case ND_GEOM_DATA: + ED_area_tag_redraw(sa); + break; + } } } @@ -395,6 +402,10 @@ static void image_main_area_init(wmWindowManager *wm, ARegion *ar) /* image paint polls for mode */ keymap= WM_keymap_listbase(wm, "ImagePaint", SPACE_IMAGE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); + + /* XXX need context here? + keymap= WM_keymap_listbase(wm, "UVEdit", 0, 0); + WM_event_add_keymap_handler(&ar->handlers, keymap);*/ /* own keymaps */ keymap= WM_keymap_listbase(wm, "Image Generic", SPACE_IMAGE, 0); @@ -459,13 +470,6 @@ static void image_main_area_listener(ARegion *ar, wmNotifier *wmn) break; } break; - case NC_OBJECT: - switch(wmn->data) { - case ND_GEOM_SELECT: - case ND_GEOM_DATA: - ED_region_tag_redraw(ar); - break; - } } } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 5f475b004b9..e8749537f5e 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2969,7 +2969,6 @@ static void draw_particle(ParticleKey *state, int draw_as, short draw, float pix { float vec[3], vec2[3]; float *vd = pdd->vd; - float *nd = pdd->nd; float *cd = pdd->cd; float ma_r; float ma_g; diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index a0d1b911370..5b378f39cd0 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -1007,203 +1007,67 @@ static uiBlock *view3d_select_object_groupedmenu(bContext *C, ARegion *ar, void #endif -static uiBlock *view3d_select_objectmenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_select_objectmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiBlock *block; -// short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "view3d_select_objectmenu", UI_EMBOSSP); - + uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border"); + + uiItemS(layout); + + uiItemO(layout, "Select/Deselect All", 0, "OBJECT_OT_select_all_toggle"); + uiItemO(layout, "Inverse", 0, "OBJECT_OT_select_invert"); + uiItemO(layout, "Random", 0, "OBJECT_OT_select_random"); + uiItemO(layout, "Select All by Layer", 0, "OBJECT_OT_select_by_layer"); + uiItemMenuEnumO(layout, "Select All by Type", 0, "OBJECT_OT_select_by_type", "type"); + #if 0 - uiBlockSetButmFunc(block, do_view3d_select_objectmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Random", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBlockBut(block, view3d_select_object_layermenu, NULL, ICON_RIGHTARROW_THIN, "Select All by Layer", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_select_object_typemenu, NULL, ICON_RIGHTARROW_THIN, "Select All by Type", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - + + uiItemS(layout); + uiDefIconTextBlockBut(block, view3d_select_object_linkedmenu, NULL, ICON_RIGHTARROW_THIN, "Linked", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_select_object_groupedmenu, NULL, ICON_RIGHTARROW_THIN, "Grouped", 0, yco-=20, 120, 19, ""); #endif - uiDefMenuButO(block, "VIEW3D_OT_select_border", "Border Select"); - - uiDefMenuSep(block); - - uiDefMenuButO(block, "OBJECT_OT_select_all_toggle", "Select/Deselect All"); - uiDefMenuButO(block, "OBJECT_OT_select_invert", "Inverse"); - uiDefMenuButO(block, "OBJECT_OT_select_random", "Random"); - uiDefMenuButO(block, "OBJECT_OT_select_by_layer", "Select All by Layer"); - uiDefMenuButO(block, "OBJECT_OT_select_by_type", "Select All by Type"); - - - if(ar->alignment==RGN_ALIGN_TOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; } -void do_view3d_select_meshmenu(bContext *C, void *arg, int event) +static void view3d_select_meshmenu(bContext *C, uiLayout *layout, void *arg_unused) { -#if 0 -/* extern void borderselect(void);*/ + uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border"); - switch(event) { - - case 0: /* border select */ - borderselect(); - break; - case 2: /* Select/Deselect all */ - deselectall_mesh(); - break; - case 3: /* Inverse */ - selectswap_mesh(); - break; - case 4: /* select linked vertices */ - selectconnected_mesh_all(); - break; - case 5: /* select random */ - selectrandom_mesh(); - break; - case 7: /* select more */ - select_more(); - break; - case 8: /* select less */ - select_less(); - break; - case 9: /* select non-manifold */ - select_non_manifold(); - break; - case 11: /* select triangles */ - select_faces_by_numverts(3); - break; - case 12: /* select quads */ - select_faces_by_numverts(4); - break; - case 13: /* select non-triangles/quads */ - select_faces_by_numverts(5); - break; - case 14: /* select sharp edges */ - select_sharp_edges(); - break; - case 15: /* select linked flat faces */ - select_linked_flat_faces(); - break; + uiItemS(layout); - case 16: /* path select */ - pathselect(); - ED_undo_push(C, "Path Select"); - break; - case 17: /* edge loop select */ - loop_multiselect(0); - break; - case 18: /* edge ring select */ - loop_multiselect(1); - break; - case 19: /* loop to region */ - loop_to_region(); - break; - case 20: /* region to loop */ - region_to_loop(); - break; - case 21: /* Select grouped */ - select_mesh_group_menu(); - break; - } -#endif -} + uiItemO(layout, "Select/Deselect All", 0, "MESH_OT_select_all_toggle"); + uiItemO(layout, "Inverse", 0, "MESH_OT_select_invert"); + uiItemS(layout); -static uiBlock *view3d_select_meshmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "view3d_select_meshmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_select_meshmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Random...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Non-Manifold|Ctrl Alt Shift M", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Sharp Edges|Ctrl Alt Shift S", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Linked Flat Faces|Ctrl Alt Shift F", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Triangles|Ctrl Alt Shift 3", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Quads|Ctrl Alt Shift 4", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Non-Triangles/Quads|Ctrl Alt Shift 5", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Similar to Selection...|Shift G", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 21, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "More|Ctrl NumPad +", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Less|Ctrl NumPad -", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked Vertices|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vertex Path|W Alt 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Edge Loop|Ctrl E 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Edge Ring|Ctrl E 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Loop to Region|Ctrl E 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Region to Loop|Ctrl E 9", 0, yco-=20, menuwidth, 20, NULL, 0.0, 0.0, 1, 20, ""); - - if(ar->alignment==RGN_ALIGN_TOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } + uiItemO(layout, "Random...", 0, "MESH_OT_select_random"); // Random... + uiItemO(layout, "Sharp Edges", 0, "MESH_OT_edges_select_sharp"); + uiItemO(layout, "Linked Flat Faces", 0, "MESH_OT_faces_select_linked_flat"); - uiTextBoundsBlock(block, 50); - return block; + uiItemS(layout); + + uiItemEnumO(layout, "Triangles", 0, "MESH_OT_select_by_number_vertices", "type", 3); // Ctrl Alt Shift 3 + uiItemEnumO(layout, "Quads", 0, "MESH_OT_select_by_number_vertices", "type", 4); // Ctrl Alt Shift 4 + uiItemEnumO(layout, "Loose Verts/Edges", 0, "MESH_OT_select_by_number_vertices", "type", 5); // Ctrl Alt Shift 5 + uiItemO(layout, "Similar...", 0, "MESH_OT_select_similar"); + + uiItemS(layout); + + uiItemO(layout, "Less", 0, "MESH_OT_select_more"); + uiItemO(layout, "More", 0, "MESH_OT_select_less"); + + uiItemS(layout); + + uiItemO(layout, "Linked", 0, "MESH_OT_select_linked"); + uiItemO(layout, "Vertex Path", 0, "MESH_OT_select_vertex_path"); // W, Alt 7 + // XXX uiItemO(layout, "Edge Loop", 0, "MESH_OT_select_edge_loop"); // loop_multiselect(0) + // XXX uiItemO(layout, "Edge Ring", 0, "MESH_OT_select_edge_ring"); // loop_multiselect(1) + + uiItemS(layout); + + uiItemO(layout, NULL, 0, "MESH_OT_loop_to_region"); // Ctrl E 8 + uiItemO(layout, NULL, 0, "MESH_OT_region_to_loop"); // Ctrl E 9 } static void view3d_select_curvemenu(bContext *C, uiLayout *layout, void *arg_unused) @@ -1309,144 +1173,63 @@ static void view3d_select_latticemenu(bContext *C, uiLayout *layout, void *arg_u uiItemO(layout, NULL, 0, "LATTICE_OT_select_all_toggle"); } -static void do_view3d_select_armaturemenu(bContext *C, void *arg, int event) +static void view3d_select_armaturemenu(bContext *C, uiLayout *layout, void *arg_unused) { -#if 0 -/* extern void borderselect(void);*/ + PointerRNA ptr; - switch(event) { - case 0: /* border select */ - borderselect(); - break; - case 2: /* Select/Deselect all */ - deselectall_armature(1, 1); - break; - case 3: /* Swap Select All */ - deselectall_armature(3, 1); - break; - case 4: /* Select parent */ - armature_select_hierarchy(BONE_SELECT_PARENT, 0); - break; - case 5: /* Select child */ - armature_select_hierarchy(BONE_SELECT_CHILD, 0); - break; - case 6: /* Extend Select parent */ - armature_select_hierarchy(BONE_SELECT_PARENT, 1); - break; - case 7: /* Extend Select child */ - armature_select_hierarchy(BONE_SELECT_CHILD, 1); - break; - } -#endif -} + uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border"); -static uiBlock *view3d_select_armaturemenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "view3d_select_armaturemenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_select_armaturemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent|[", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Child|]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Parent|Shift [", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Child|Shift ]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - - if(ar->alignment==RGN_ALIGN_TOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } + uiItemS(layout); - uiTextBoundsBlock(block, 50); - return block; -} + uiItemO(layout, "Select/Deselect All", 0, "ARMATURE_OT_select_all_toggle"); + uiItemO(layout, "Inverse", 0, "ARMATURE_OT_select_invert"); -static void do_view3d_select_pose_armaturemenu(bContext *C, void *arg, int event) -{ -#if 0 -/* extern void borderselect(void);*/ - - switch(event) { - case 0: /* border select */ - borderselect(); - break; - case 2: /* Select/Deselect all */ - deselectall_posearmature(OBACT, 1, 1); - break; - case 3: /* Select Target(s) of Constraint(s) */ - pose_select_constraint_target(); - break; - case 5: /* Swap Select All */ - deselectall_posearmature(OBACT, 3, 1); - break; - case 6: /* Select parent */ - pose_select_hierarchy(BONE_SELECT_PARENT, 0); - break; - case 7: /* Select child */ - pose_select_hierarchy(BONE_SELECT_CHILD, 0); - break; - case 8: /* Extend Select parent */ - pose_select_hierarchy(BONE_SELECT_PARENT, 1); - break; - case 9: /* Extend Select child */ - pose_select_hierarchy(BONE_SELECT_CHILD, 1); - break; - } -#endif + uiItemS(layout); + + uiItemEnumO(layout, "Parent", 0, "ARMATURE_OT_select_hierarchy", "direction", BONE_SELECT_PARENT); + uiItemEnumO(layout, "Child", 0, "ARMATURE_OT_select_hierarchy", "direction", BONE_SELECT_CHILD); + + uiItemS(layout); + + WM_operator_properties_create(&ptr, "ARMATURE_OT_select_hierarchy"); + RNA_boolean_set(&ptr, "extend", 1); + RNA_enum_set(&ptr, "direction", BONE_SELECT_PARENT); + uiItemFullO(layout, "Extend Parent", 0, "ARMATURE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN); + + WM_operator_properties_create(&ptr, "ARMATURE_OT_select_hierarchy"); + RNA_boolean_set(&ptr, "extend", 1); + RNA_enum_set(&ptr, "direction", BONE_SELECT_CHILD); + uiItemFullO(layout, "Extend Child", 0, "ARMATURE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN); } -static uiBlock *view3d_select_pose_armaturemenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_select_posemenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "view3d_select_pose_armaturemenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_select_pose_armaturemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Swap Select All|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Constraint Target|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent|[", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Child|]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Parent|Shift [", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Select Child|Shift ]", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - - if(ar->alignment==RGN_ALIGN_TOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } + PointerRNA ptr; - uiTextBoundsBlock(block, 50); - return block; + uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border"); + + uiItemS(layout); + + uiItemO(layout, "Select/Deselect All", 0, "POSE_OT_select_all_toggle"); + uiItemO(layout, "Inverse", 0, "POSE_OT_select_invert"); + uiItemO(layout, "Constraint Target", 0, "POSE_OT_select_constraint_target"); + + uiItemS(layout); + + uiItemEnumO(layout, "Parent", 0, "POSE_OT_select_hierarchy", "direction", BONE_SELECT_PARENT); + uiItemEnumO(layout, "Child", 0, "POSE_OT_select_hierarchy", "direction", BONE_SELECT_CHILD); + + uiItemS(layout); + + WM_operator_properties_create(&ptr, "POSE_OT_select_hierarchy"); + RNA_boolean_set(&ptr, "extend", 1); + RNA_enum_set(&ptr, "direction", BONE_SELECT_PARENT); + uiItemFullO(layout, "Extend Parent", 0, "POSE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN); + + WM_operator_properties_create(&ptr, "POSE_OT_select_hierarchy"); + RNA_boolean_set(&ptr, "extend", 1); + RNA_enum_set(&ptr, "direction", BONE_SELECT_CHILD); + uiItemFullO(layout, "Extend Child", 0, "POSE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN); } void do_view3d_select_faceselmenu(bContext *C, void *arg, int event) @@ -5071,17 +4854,17 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o xmax= GetButStringLength("Select"); if (obedit) { if (ob && ob->type == OB_MESH) { - uiDefPulldownBut(block, view3d_select_meshmenu, NULL, "Select", xco,yco, xmax-3, 24, ""); + uiDefMenuBut(block, view3d_select_meshmenu, NULL, "Select", xco,yco, xmax-3, 20, ""); } else if (ob && (ob->type == OB_CURVE || ob->type == OB_SURF)) { - uiDefMenuBut(block, view3d_select_curvemenu, NULL, "Select", xco, yco, xmax-3, 24, ""); + uiDefMenuBut(block, view3d_select_curvemenu, NULL, "Select", xco, yco, xmax-3, 20, ""); } else if (ob && ob->type == OB_FONT) { xmax= 0; } else if (ob && ob->type == OB_MBALL) { - uiDefPulldownBut(block, view3d_select_metaballmenu, NULL, "Select", xco,yco, xmax-3, 24, ""); + uiDefPulldownBut(block, view3d_select_metaballmenu, NULL, "Select", xco,yco, xmax-3, 20, ""); } else if (ob && ob->type == OB_LATTICE) { - uiDefMenuBut(block, view3d_select_latticemenu, NULL, "Select", xco, yco, xmax-3, 24, ""); + uiDefMenuBut(block, view3d_select_latticemenu, NULL, "Select", xco, yco, xmax-3, 20, ""); } else if (ob && ob->type == OB_ARMATURE) { - uiDefPulldownBut(block, view3d_select_armaturemenu, NULL, "Select", xco,yco, xmax-3, 20, ""); + uiDefMenuBut(block, view3d_select_armaturemenu, NULL, "Select", xco,yco, xmax-3, 20, ""); } } else if (FACESEL_PAINT_TEST) { if (ob && ob->type == OB_MESH) { @@ -5094,9 +4877,9 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o } else { if (ob && (ob->flag & OB_POSEMODE)) - uiDefPulldownBut(block, view3d_select_pose_armaturemenu, NULL, "Select", xco,yco, xmax-3, 20, ""); + uiDefMenuBut(block, view3d_select_posemenu, NULL, "Select", xco,yco, xmax-3, 20, ""); else - uiDefPulldownBut(block, view3d_select_objectmenu, NULL, "Select", xco,yco, xmax-3, 20, ""); + uiDefMenuBut(block, view3d_select_objectmenu, NULL, "Select", xco,yco, xmax-3, 20, ""); } xco+= xmax; diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index a153f795292..74063e0ad56 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1442,6 +1442,7 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) } } + ED_armature_sync_selection(arm->edbo); } else if(obedit->type==OB_LATTICE) { do_lattice_box_select(&vc, &rect, val==LEFTMOUSE); diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 1d79c542fa9..6f742d70440 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -125,7 +125,18 @@ static int ed_undo_step(bContext *C, int step) { Object *obedit= CTX_data_edit_object(C); ScrArea *sa= CTX_wm_area(C); - + + if(sa && sa->spacetype==SPACE_IMAGE) { + SpaceImage *sima= (SpaceImage *)sa->spacedata.first; + + if(G.f & G_TEXTUREPAINT || sima->flag & SI_DRAWTOOL) { + undo_imagepaint_step(step); + + WM_event_add_notifier(C, NC_WINDOW, NULL); + return OPERATOR_FINISHED; + } + } + if(sa && sa->spacetype==SPACE_TEXT) { ED_text_undo_step(C, step); } @@ -138,13 +149,6 @@ static int ed_undo_step(bContext *C, int step) if(G.f & G_TEXTUREPAINT) undo_imagepaint_step(step); - else if(sa && sa->spacetype==SPACE_IMAGE) { - SpaceImage *sima= (SpaceImage *)sa->spacedata.first; - if(sima->flag & SI_DRAWTOOL) - undo_imagepaint_step(step); - else - do_glob_undo= 1; - } else if(G.f & G_PARTICLEEDIT) { if(step==1) PE_undo(CTX_data_scene(C)); diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index b811906f5e5..a58ee9772e9 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -121,7 +121,7 @@ static void draw_uvs_shadow(SpaceImage *sima, Object *obedit) { EditMesh *em; EditFace *efa; - TFace *tf; + MTFace *tf; em= BKE_mesh_get_editmesh((Mesh*)obedit->data); @@ -591,7 +591,8 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) break; case SI_UVDT_BLACK: /* black/white */ case SI_UVDT_WHITE: - cpack((sima->dt_uv==SI_UVDT_WHITE) ? 0xFFFFFF : 0x0); + if(sima->dt_uv==SI_UVDT_WHITE) glColor3f(1.0f, 1.0f, 1.0f); + else glColor3f(0.0f, 0.0f, 0.0f); for(efa= em->faces.first; efa; efa= efa->next) { tf= (MTFace *)efa->tmp.p; /* visible faces cached */ diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index 44133b61e6c..73ecade9b8b 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -211,6 +211,7 @@ typedef struct ARegion { /* paneltype flag */ #define PNL_DEFAULT_CLOSED 1 +#define PNL_NO_HEADER 2 /* screen handlers */ #define SCREEN_MAXHANDLER 8 diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index 85a148be2e2..69f5b5adc37 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -81,6 +81,7 @@ PropertyRNA *RNA_def_string_file_path(StructOrFunctionRNA *cont, const char *ide PropertyRNA *RNA_def_string_dir_path(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description); +void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc); PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); PropertyRNA *RNA_def_float_vector(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 923191cba78..98646acd727 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -149,8 +149,6 @@ typedef struct RawArray { int stride; } RawArray; -/* Iterator Utility */ - typedef struct EnumPropertyItem { int value; const char *identifier; @@ -159,6 +157,8 @@ typedef struct EnumPropertyItem { const char *description; } EnumPropertyItem; +typedef EnumPropertyItem *(*EnumPropertyItemFunc)(PointerRNA *ptr); + typedef struct PropertyRNA PropertyRNA; /* Parameter List */ diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 715f03bb3f1..2916c1bcb6e 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1960,6 +1960,12 @@ PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, co return prop; } +void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc) +{ + EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop; + eprop->itemf= itemfunc; +} + PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax) { diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 14db8ea3377..557d472afef 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -547,6 +547,26 @@ static int rna_EnumPropertyItem_name_length(PointerRNA *ptr) return strlen(((EnumPropertyItem*)ptr->data)->name); } +static void rna_EnumPropertyItem_description_get(PointerRNA *ptr, char *value) +{ + EnumPropertyItem *eprop= (EnumPropertyItem*)ptr->data; + + if(eprop->description) + strcpy(value, eprop->description); + else + value[0]= '\0'; +} + +static int rna_EnumPropertyItem_description_length(PointerRNA *ptr) +{ + EnumPropertyItem *eprop= (EnumPropertyItem*)ptr->data; + + if(eprop->description) + return strlen(eprop->description); + else + return 0; +} + static int rna_EnumPropertyItem_value_get(PointerRNA *ptr) { return ((EnumPropertyItem*)ptr->data)->value; @@ -861,6 +881,11 @@ static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna) RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_name_get", "rna_EnumPropertyItem_name_length", NULL); RNA_def_property_ui_text(prop, "Name", "Human readable name."); + prop= RNA_def_property(srna, "description", PROP_STRING, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_description_get", "rna_EnumPropertyItem_description_length", NULL); + RNA_def_property_ui_text(prop, "Description", "Description of the item's purpose."); + prop= RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_identifier_get", "rna_EnumPropertyItem_identifier_length", NULL); diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index eef221e45a4..9da8c8b2df3 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -607,6 +607,10 @@ static void rna_def_panel(BlenderRNA *brna) prop= RNA_def_property(srna, "default_closed", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "type->flag", PNL_DEFAULT_CLOSED); RNA_def_property_flag(prop, PROP_REGISTER); + + prop= RNA_def_property(srna, "no_header", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "type->flag", PNL_NO_HEADER); + RNA_def_property_flag(prop, PROP_REGISTER); } static void rna_def_header(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index f8ab3a86744..9c9c256e819 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -69,23 +69,23 @@ EnumPropertyItem event_type_items[] = { {YKEY, "Y", 0, "Y", ""}, {ZKEY, "Z", 0, "Z", ""}, - {ZEROKEY, "ZERO", 0, "Zero Key", ""}, - {ONEKEY, "ONE", 0, "One Key", ""}, - {TWOKEY, "TWO", 0, "Two Key", ""}, - {THREEKEY, "THREE", 0, "Three Key", ""}, - {FOURKEY, "FOUR", 0, "Four Key", ""}, - {FIVEKEY, "FIVE", 0, "Five Key", ""}, - {SIXKEY, "SIX", 0, "Six Key", ""}, - {SEVENKEY, "SEVEN", 0, "Seven Key", ""}, - {EIGHTKEY, "EIGHT", 0, "Eight Key", ""}, - {NINEKEY, "NINE", 0, "Nine Key", ""}, + {ZEROKEY, "ZERO", 0, "0", ""}, + {ONEKEY, "ONE", 0, "1", ""}, + {TWOKEY, "TWO", 0, "2", ""}, + {THREEKEY, "THREE", 0, "3", ""}, + {FOURKEY, "FOUR", 0, "4", ""}, + {FIVEKEY, "FIVE", 0, "5", ""}, + {SIXKEY, "SIX", 0, "6", ""}, + {SEVENKEY, "SEVEN", 0, "7", ""}, + {EIGHTKEY, "EIGHT", 0, "8", ""}, + {NINEKEY, "NINE", 0, "9", ""}, {LEFTCTRLKEY, "LEFT_CTRL", 0, "Left Ctrl", ""}, {LEFTALTKEY, "LEFT_ALT", 0, "Left Alt", ""}, + {LEFTSHIFTKEY, "LEFT_SHIFT", 0, "Left Shift", ""}, {RIGHTALTKEY, "RIGHT_ALT", 0, "Right Alt", ""}, - {RIGHTCTRLKEY, "RIGHT_CTRL", 0, "Rightctrl", ""}, - {RIGHTSHIFTKEY, "RIGHT_SHIFT", 0, "Rightshift", ""}, - {LEFTSHIFTKEY, "LEFT_SHIFT", 0, "Leftshift", ""}, + {RIGHTCTRLKEY, "RIGHT_CTRL", 0, "Right Ctrl", ""}, + {RIGHTSHIFTKEY, "RIGHT_SHIFT", 0, "Right Shift", ""}, {ESCKEY, "ESC", 0, "Esc", ""}, {TABKEY, "TAB", 0, "Tab", ""}, @@ -94,17 +94,17 @@ EnumPropertyItem event_type_items[] = { {LINEFEEDKEY, "LINE_FEED", 0, "Line Feed", ""}, {BACKSPACEKEY, "BACK_SPACE", 0, "Back Space", ""}, {DELKEY, "DEL", 0, "Delete", ""}, - {SEMICOLONKEY, "SEMI_COLON", 0, "Semicolon", ""}, - {PERIODKEY, "PERIOD", 0, "Period", ""}, - {COMMAKEY, "COMMA", 0, "Comma", ""}, - {QUOTEKEY, "QUOTE", 0, "Quote", ""}, - {ACCENTGRAVEKEY, "ACCENT_GRAVE", 0, "Accentgrave", ""}, - {MINUSKEY, "MINUS", 0, "Minus", ""}, - {SLASHKEY, "SLASH", 0, "Slash", ""}, - {BACKSLASHKEY, "BACK_SLASH", 0, "Backslash", ""}, - {EQUALKEY, "EQUAL", 0, "Equal", ""}, - {LEFTBRACKETKEY, "LEFT_BRACKET", 0, "Leftbracket", ""}, - {RIGHTBRACKETKEY, "RIGHT_BRACKET", 0, "Rightbracket", ""}, + {SEMICOLONKEY, "SEMI_COLON", 0, ";", ""}, + {PERIODKEY, "PERIOD", 0, ".", ""}, + {COMMAKEY, "COMMA", 0, ",", ""}, + {QUOTEKEY, "QUOTE", 0, "\"", ""}, + {ACCENTGRAVEKEY, "ACCENT_GRAVE", 0, "`", ""}, + {MINUSKEY, "MINUS", 0, "-", ""}, + {SLASHKEY, "SLASH", 0, "/", ""}, + {BACKSLASHKEY, "BACK_SLASH", 0, "\\", ""}, + {EQUALKEY, "EQUAL", 0, "=", ""}, + {LEFTBRACKETKEY, "LEFT_BRACKET", 0, "]", ""}, + {RIGHTBRACKETKEY, "RIGHT_BRACKET", 0, "[", ""}, {LEFTARROWKEY, "LEFT_ARROW", 0, "Left Arrow", ""}, {DOWNARROWKEY, "DOWN_ARROW", 0, "Down Arrow", ""}, {RIGHTARROWKEY, "RIGHT_ARROW", 0, "Right Arrow", ""}, diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index f5eb81e3cea..67328455a77 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -377,7 +377,7 @@ void RNA_def_world(BlenderRNA *brna) prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "range"); RNA_def_property_range(prop, 0.2, 5.0); - RNA_def_property_ui_text(prop, "Range", "The color rage that will be mapped to 0-1"); + RNA_def_property_ui_text(prop, "Range", "The color range that will be mapped to 0-1."); /* sky type */ prop= RNA_def_property(srna, "blend_sky", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index ffeb342df77..50ba2aec867 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -124,7 +124,7 @@ int WM_operator_filesel (struct bContext *C, struct wmOperator *op, struct wm /* poll callback, context checks */ int WM_operator_winactive (struct bContext *C); /* invoke callback, exec + redo popup */ -int WM_operator_redo (struct bContext *C, struct wmOperator *op, struct wmEvent *event); +int WM_operator_props_popup (struct bContext *C, struct wmOperator *op, struct wmEvent *event); int WM_operator_redo_popup (struct bContext *C, struct wmOperator *op); /* operator api */ diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 7f9a2153dc3..d003f0786de 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -296,7 +296,7 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op) return block; } -int WM_operator_redo(bContext *C, wmOperator *op, wmEvent *event) +int WM_operator_props_popup(bContext *C, wmOperator *op, wmEvent *event) { int retval= OPERATOR_CANCELLED; -- cgit v1.2.3 From eacb31dbb2f9a181f01d2b1138754cdea386c80f Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 8 Jul 2009 16:17:47 +0000 Subject: 2.5: code consistency * Rename BIF_transform/retopo.h to ED_transform/retopo.h for consistency. * Move MESH_OT_duplicate_add to editmesh_add.c. * Remove some code from BIF_gl.h which is not needed there anymore. --- source/blender/blenkernel/intern/subsurf_ccg.c | 1 + source/blender/editors/armature/editarmature.c | 2 +- .../blender/editors/armature/editarmature_sketch.c | 2 +- source/blender/editors/armature/poseobject.c | 2 +- source/blender/editors/curve/curve_ops.c | 5 +- source/blender/editors/curve/editcurve.c | 3 +- source/blender/editors/include/BIF_gl.h | 27 +--- source/blender/editors/include/BIF_glutil.h | 4 +- source/blender/editors/include/BIF_retopo.h | 110 -------------- source/blender/editors/include/BIF_transform.h | 165 --------------------- source/blender/editors/include/ED_retopo.h | 111 ++++++++++++++ source/blender/editors/include/ED_transform.h | 144 +++++++++++++++++- source/blender/editors/mesh/editmesh.c | 4 +- source/blender/editors/mesh/editmesh_add.c | 53 ++++++- source/blender/editors/mesh/editmesh_tools.c | 6 +- source/blender/editors/mesh/mesh_intern.h | 4 +- source/blender/editors/mesh/mesh_ops.c | 45 +----- source/blender/editors/object/object_edit.c | 3 +- source/blender/editors/space_action/action_edit.c | 3 +- source/blender/editors/space_action/action_ops.c | 2 +- source/blender/editors/space_graph/graph_edit.c | 3 +- source/blender/editors/space_graph/graph_ops.c | 3 +- source/blender/editors/space_image/image_header.c | 2 +- source/blender/editors/space_image/space_image.c | 1 - source/blender/editors/space_node/node_edit.c | 2 +- source/blender/editors/space_node/node_ops.c | 3 +- .../editors/space_sequencer/sequencer_edit.c | 3 +- .../editors/space_sequencer/sequencer_ops.c | 3 +- .../blender/editors/space_view3d/view3d_buttons.c | 2 +- source/blender/editors/space_view3d/view3d_draw.c | 2 +- source/blender/editors/space_view3d/view3d_edit.c | 4 +- .../blender/editors/space_view3d/view3d_header.c | 2 +- source/blender/editors/space_view3d/view3d_ops.c | 3 +- .../blender/editors/space_view3d/view3d_select.c | 2 +- .../blender/editors/space_view3d/view3d_toolbar.c | 2 +- source/blender/editors/transform/transform.h | 2 +- .../editors/transform/transform_conversions.c | 2 +- .../blender/editors/transform/transform_generics.c | 2 +- .../editors/transform/transform_manipulator.c | 2 +- source/blender/editors/transform/transform_snap.c | 3 +- source/blender/editors/uvedit/uvedit_ops.c | 3 +- 41 files changed, 344 insertions(+), 403 deletions(-) delete mode 100644 source/blender/editors/include/BIF_retopo.h delete mode 100644 source/blender/editors/include/BIF_transform.h create mode 100644 source/blender/editors/include/ED_retopo.h (limited to 'source') diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 15969fc9ab9..6e95fe7ebc7 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -60,6 +60,7 @@ #include "BLI_edgehash.h" #include "BIF_gl.h" +#include "BIF_glutil.h" #include "GPU_draw.h" #include "GPU_extensions.h" diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 97bf3492f7c..d7e3f84f0d6 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -72,7 +72,6 @@ #include "PIL_time.h" #include "BIF_gl.h" -#include "BIF_transform.h" #include "BIF_generate.h" #include "RNA_access.h" @@ -85,6 +84,7 @@ #include "ED_mesh.h" #include "ED_object.h" #include "ED_screen.h" +#include "ED_transform.h" #include "ED_util.h" #include "ED_view3d.h" diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index fb030b91ce1..816df0f81c9 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -65,7 +65,7 @@ #include "BIF_generate.h" //#include "BIF_interface.h" -#include "BIF_transform.h" +#include "ED_transform.h" #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 4a7056274c6..2913d1d13d9 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -64,7 +64,6 @@ #include "BKE_object.h" #include "BKE_utildefines.h" -#include "BIF_transform.h" /* for autokey TFM_TRANSLATION, etc */ #include "BIF_gl.h" #include "RNA_access.h" @@ -79,6 +78,7 @@ #include "ED_object.h" #include "ED_mesh.h" #include "ED_screen.h" +#include "ED_transform.h" /* for autokey TFM_TRANSLATION, etc */ #include "ED_view3d.h" #include "armature_intern.h" diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index 66cde772f3e..ed53f8e0194 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -53,10 +53,9 @@ #include "WM_api.h" #include "WM_types.h" -#include "ED_screen.h" #include "ED_object.h" - -#include "BIF_transform.h" +#include "ED_screen.h" +#include "ED_transform.h" #include "UI_interface.h" diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 64303c149a8..6ae79109445 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -73,14 +73,13 @@ #include "ED_keyframes_edit.h" #include "ED_object.h" #include "ED_screen.h" +#include "ED_transform.h" #include "ED_types.h" #include "ED_util.h" #include "ED_view3d.h" #include "UI_interface.h" -#include "BIF_transform.h" - #include "RNA_access.h" #include "RNA_define.h" diff --git a/source/blender/editors/include/BIF_gl.h b/source/blender/editors/include/BIF_gl.h index c1b3b056d62..3318d869378 100644 --- a/source/blender/editors/include/BIF_gl.h +++ b/source/blender/editors/include/BIF_gl.h @@ -31,30 +31,11 @@ #ifndef BIF_GL_H #define BIF_GL_H - /* Although not really a great idea to copy these defines - * from Windows' winnt.h, this lets us use GL without including - * windows.h everywhere (or BLI_winstuff.h) which is a good thing. - */ -#ifdef WIN32 -#ifndef APIENTRY -#define APIENTRY __stdcall -#endif - -#ifndef CALLBACK -#define CALLBACK __stdcall -#endif - -#ifndef WINGDIAPI -#define WINGDIAPI __declspec(dllimport) -#endif -#endif - #include "GL/glew.h" /* * these should be phased out. cpack should be replaced in - * code with calls to glColor3ub, lrectwrite probably should - * change to a function. - zr + * code with calls to glColor3ub. - zr */ /* * @@ -67,11 +48,5 @@ #define glMultMatrixf(x) glMultMatrixf( (float *)(x)) #define glLoadMatrixf(x) glLoadMatrixf( (float *)(x)) -#define lrectwrite(a, b, c, d, rect) {glRasterPos2i(a, b);glDrawPixels((c)-(a)+1, (d)-(b)+1, GL_RGBA, GL_UNSIGNED_BYTE, rect);} - -/* glStippleDefines, defined in glutil.c */ -extern GLubyte stipple_halftone[128]; -extern GLubyte stipple_quarttone[128]; - #endif /* #ifdef BIF_GL_H */ diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h index 5c611365a7e..f5769610f50 100644 --- a/source/blender/editors/include/BIF_glutil.h +++ b/source/blender/editors/include/BIF_glutil.h @@ -45,6 +45,9 @@ void sdrawXORline4(int nr, int x0, int y0, int x1, int y1); void fdrawXORellipse(float xofs, float yofs, float hw, float hh); void fdrawXORcirc(float xofs, float yofs, float rad); +/* glStipple defines */ +extern unsigned char stipple_halftone[128]; +extern unsigned char stipple_quarttone[128]; /** * Draw a lined (non-looping) arc with the given @@ -202,7 +205,6 @@ int is_a_really_crappy_intel_card(void); void set_inverted_drawing(int enable); void setlinestyle(int nr); - /* own working polygon offset */ void bglPolygonOffset(float viewdist, float dist); diff --git a/source/blender/editors/include/BIF_retopo.h b/source/blender/editors/include/BIF_retopo.h deleted file mode 100644 index cc2fda56b07..00000000000 --- a/source/blender/editors/include/BIF_retopo.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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) 2006 by Nicholas Bishop - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifndef BIF_RETOPO_H -#define BIF_RETOPO_H - -#include "DNA_vec_types.h" - -/* For bglMats */ -#include "BIF_glutil.h" - -struct EditVert; -struct Mesh; -struct View3D; - -typedef struct RetopoViewData { - bglMats mats; - - char queue_matrix_update; -} RetopoViewData; - -typedef struct RetopoPaintPoint { - struct RetopoPaintPoint *next, *prev; - vec2s loc; - short index; - float co[3]; - struct EditVert *eve; -} RetopoPaintPoint; - -typedef struct RetopoPaintLine { - struct RetopoPaintLine *next, *prev; - ListBase points; - ListBase hitlist; /* RetopoPaintHit */ - RetopoPaintPoint *cyclic; -} RetopoPaintLine; - -typedef struct RetopoPaintSel { - struct RetopoPaintSel *next, *prev; - RetopoPaintLine *line; - char first; -} RetopoPaintSel; - -typedef struct RetopoPaintData { - char in_drag; - short sloc[2]; - - ListBase lines; - ListBase intersections; /* RetopoPaintPoint */ - - short seldist; - RetopoPaintSel nearest; - - struct View3D *paint_v3d; -} RetopoPaintData; - -RetopoPaintData *get_retopo_paint_data(void); - -char retopo_mesh_check(void); -char retopo_curve_check(void); - -void retopo_end_okee(void); - -void retopo_free_paint_data(RetopoPaintData *rpd); -void retopo_free_paint(void); - -char retopo_mesh_paint_check(void); -void retopo_paint_view_update(struct View3D *v3d); -void retopo_force_update(void); -void retopo_paint_toggle(void*,void*); -char retopo_paint(const unsigned short event); -void retopo_draw_paint_lines(void); -RetopoPaintData *retopo_paint_data_copy(RetopoPaintData *rpd); - -void retopo_toggle(void*,void*); -void retopo_do_vert(struct View3D *v3d, float *v); -void retopo_do_all(void); -void retopo_do_all_cb(void *, void *); -void retopo_queue_updates(struct View3D *v3d); - -void retopo_matrix_update(struct View3D *v3d); - -void retopo_free_view_data(struct View3D *v3d); - -#endif diff --git a/source/blender/editors/include/BIF_transform.h b/source/blender/editors/include/BIF_transform.h deleted file mode 100644 index f65648eb654..00000000000 --- a/source/blender/editors/include/BIF_transform.h +++ /dev/null @@ -1,165 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifndef BIF_TRANSFORM_H -#define BIF_TRANSFORM_H - -/* ******************* Registration Function ********************** */ - -struct wmWindowManager; -struct ListBase; -struct wmEvent; -struct bContext; -struct Object; -struct uiLayout; - -void transform_keymap_for_space(struct wmWindowManager *wm, struct ListBase *keymap, int spaceid); -void transform_operatortypes(void); - -/* ******************** Macros & Prototypes *********************** */ - -/* MODE AND NUMINPUT FLAGS */ -enum { - TFM_INIT = -1, - TFM_DUMMY, - TFM_TRANSLATION, - TFM_ROTATION, - TFM_RESIZE, - TFM_TOSPHERE, - TFM_SHEAR, - TFM_WARP, - TFM_SHRINKFATTEN, - TFM_TILT, - TFM_TRACKBALL, - TFM_PUSHPULL, - TFM_CREASE, - TFM_MIRROR, - TFM_BONESIZE, - TFM_BONE_ENVELOPE, - TFM_CURVE_SHRINKFATTEN, - TFM_BONE_ROLL, - TFM_TIME_TRANSLATE, - TFM_TIME_SLIDE, - TFM_TIME_SCALE, - TFM_TIME_EXTEND, - TFM_BAKE_TIME, - TFM_BEVEL, - TFM_BWEIGHT, - TFM_ALIGN -} TfmMode; - -/* TRANSFORM CONTEXTS */ -#define CTX_NONE 0 -#define CTX_TEXTURE 1 -#define CTX_EDGE 2 -#define CTX_NO_PET 4 -#define CTX_TWEAK 8 -#define CTX_NO_MIRROR 16 -#define CTX_AUTOCONFIRM 32 -#define CTX_BMESH 64 -#define CTX_NDOF 128 - -/* Standalone call to get the transformation center corresponding to the current situation - * returns 1 if successful, 0 otherwise (usually means there's no selection) - * (if 0 is returns, *vec is unmodified) - * */ -int calculateTransformCenter(struct bContext *C, struct wmEvent *event, int centerMode, float *vec); - -struct TransInfo; -struct ScrArea; -struct Base; -struct Scene; -struct Object; - -void BIF_setSingleAxisConstraint(float vec[3], char *text); -void BIF_setDualAxisConstraint(float vec1[3], float vec2[3], char *text); -void BIF_setLocalAxisConstraint(char axis, char *text); -void BIF_setLocalLockConstraint(char axis, char *text); - -int BIF_snappingSupported(struct Object *obedit); - -struct TransformOrientation; -struct bContext; - -void BIF_clearTransformOrientation(struct bContext *C); -void BIF_removeTransformOrientation(struct bContext *C, struct TransformOrientation *ts); -void BIF_manageTransformOrientation(struct bContext *C, int confirm, int set); -int BIF_menuselectTransformOrientation(void); -void BIF_selectTransformOrientation(struct bContext *C, struct TransformOrientation *ts); -void BIF_selectTransformOrientationValue(struct bContext *C, int orientation); - -void BIF_menuTransformOrientation(struct bContext *C, struct uiLayout *layout, void *arg); -char * BIF_menustringTransformOrientation(const struct bContext *C, char *title); /* the returned value was allocated and needs to be freed after use */ -int BIF_countTransformOrientation(const struct bContext *C); - -void BIF_getPropCenter(float *center); - -void BIF_TransformSetUndo(char *str); - -void BIF_selectOrientation(void); - -/* view3d manipulators */ -void initManipulator(int mode); -void ManipulatorTransform(); - -int BIF_do_manipulator(struct bContext *C, short mval[2]); -void BIF_draw_manipulator(const struct bContext *C); - -/* Snapping */ - - -typedef struct DepthPeel -{ - struct DepthPeel *next, *prev; - - float depth; - float p[3]; - float no[3]; - struct Object *ob; - int flag; -} DepthPeel; - -struct ListBase; - -typedef enum SnapMode -{ - SNAP_ALL = 0, - SNAP_NOT_SELECTED = 1, - SNAP_NOT_OBEDIT = 2 -} SnapMode; - -#define SNAP_MIN_DISTANCE 30 - -int peelObjectsTransForm(struct TransInfo *t, struct ListBase *depth_peels, short mval[2]); -int peelObjectsContext(struct bContext *C, struct ListBase *depth_peels, short mval[2]); -int snapObjectsTransform(struct TransInfo *t, short mval[2], int *dist, float *loc, float *no, SnapMode mode); -int snapObjectsContext(struct bContext *C, short mval[2], int *dist, float *loc, float *no, SnapMode mode); - -#endif - diff --git a/source/blender/editors/include/ED_retopo.h b/source/blender/editors/include/ED_retopo.h new file mode 100644 index 00000000000..3d0b5f57661 --- /dev/null +++ b/source/blender/editors/include/ED_retopo.h @@ -0,0 +1,111 @@ +/* + * $Id$ + * + * ***** BEGIN GPL 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. + * + * 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) 2006 by Nicholas Bishop + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef ED_RETOPO_H +#define ED_RETOPO_H + +#include "DNA_vec_types.h" + +/* For bglMats */ +#include "BIF_glutil.h" + +struct EditVert; +struct Mesh; +struct View3D; + +typedef struct RetopoViewData { + bglMats mats; + + char queue_matrix_update; +} RetopoViewData; + +typedef struct RetopoPaintPoint { + struct RetopoPaintPoint *next, *prev; + vec2s loc; + short index; + float co[3]; + struct EditVert *eve; +} RetopoPaintPoint; + +typedef struct RetopoPaintLine { + struct RetopoPaintLine *next, *prev; + ListBase points; + ListBase hitlist; /* RetopoPaintHit */ + RetopoPaintPoint *cyclic; +} RetopoPaintLine; + +typedef struct RetopoPaintSel { + struct RetopoPaintSel *next, *prev; + RetopoPaintLine *line; + char first; +} RetopoPaintSel; + +typedef struct RetopoPaintData { + char in_drag; + short sloc[2]; + + ListBase lines; + ListBase intersections; /* RetopoPaintPoint */ + + short seldist; + RetopoPaintSel nearest; + + struct View3D *paint_v3d; +} RetopoPaintData; + +RetopoPaintData *get_retopo_paint_data(void); + +char retopo_mesh_check(void); +char retopo_curve_check(void); + +void retopo_end_okee(void); + +void retopo_free_paint_data(RetopoPaintData *rpd); +void retopo_free_paint(void); + +char retopo_mesh_paint_check(void); +void retopo_paint_view_update(struct View3D *v3d); +void retopo_force_update(void); +void retopo_paint_toggle(void*,void*); +char retopo_paint(const unsigned short event); +void retopo_draw_paint_lines(void); +RetopoPaintData *retopo_paint_data_copy(RetopoPaintData *rpd); + +void retopo_toggle(void*,void*); +void retopo_do_vert(struct View3D *v3d, float *v); +void retopo_do_all(void); +void retopo_do_all_cb(void *, void *); +void retopo_queue_updates(struct View3D *v3d); + +void retopo_matrix_update(struct View3D *v3d); + +void retopo_free_view_data(struct View3D *v3d); + +#endif + diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index 1d47d8ad190..9327301336f 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -1,12 +1,12 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL 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. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -17,17 +17,149 @@ * 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) 2008 Blender Foundation. + * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. * - * - * Contributor(s): Blender Foundation + * The Original Code is: all of this file. + * + * Contributor(s): none yet. * * ***** END GPL LICENSE BLOCK ***** */ + #ifndef ED_TRANSFORM_H #define ED_TRANSFORM_H +/* ******************* Registration Function ********************** */ + +struct wmWindowManager; +struct ListBase; +struct wmEvent; +struct bContext; +struct Object; +struct uiLayout; + +void transform_keymap_for_space(struct wmWindowManager *wm, struct ListBase *keymap, int spaceid); +void transform_operatortypes(void); + +/* ******************** Macros & Prototypes *********************** */ + +/* MODE AND NUMINPUT FLAGS */ +enum { + TFM_INIT = -1, + TFM_DUMMY, + TFM_TRANSLATION, + TFM_ROTATION, + TFM_RESIZE, + TFM_TOSPHERE, + TFM_SHEAR, + TFM_WARP, + TFM_SHRINKFATTEN, + TFM_TILT, + TFM_TRACKBALL, + TFM_PUSHPULL, + TFM_CREASE, + TFM_MIRROR, + TFM_BONESIZE, + TFM_BONE_ENVELOPE, + TFM_CURVE_SHRINKFATTEN, + TFM_BONE_ROLL, + TFM_TIME_TRANSLATE, + TFM_TIME_SLIDE, + TFM_TIME_SCALE, + TFM_TIME_EXTEND, + TFM_BAKE_TIME, + TFM_BEVEL, + TFM_BWEIGHT, + TFM_ALIGN +} TfmMode; + +/* TRANSFORM CONTEXTS */ +#define CTX_NONE 0 +#define CTX_TEXTURE 1 +#define CTX_EDGE 2 +#define CTX_NO_PET 4 +#define CTX_TWEAK 8 +#define CTX_NO_MIRROR 16 +#define CTX_AUTOCONFIRM 32 +#define CTX_BMESH 64 +#define CTX_NDOF 128 + +/* Standalone call to get the transformation center corresponding to the current situation + * returns 1 if successful, 0 otherwise (usually means there's no selection) + * (if 0 is returns, *vec is unmodified) + * */ +int calculateTransformCenter(struct bContext *C, struct wmEvent *event, int centerMode, float *vec); + +struct TransInfo; +struct ScrArea; +struct Base; +struct Scene; +struct Object; + +void BIF_setSingleAxisConstraint(float vec[3], char *text); +void BIF_setDualAxisConstraint(float vec1[3], float vec2[3], char *text); +void BIF_setLocalAxisConstraint(char axis, char *text); +void BIF_setLocalLockConstraint(char axis, char *text); + +int BIF_snappingSupported(struct Object *obedit); + +struct TransformOrientation; +struct bContext; + +void BIF_clearTransformOrientation(struct bContext *C); +void BIF_removeTransformOrientation(struct bContext *C, struct TransformOrientation *ts); +void BIF_manageTransformOrientation(struct bContext *C, int confirm, int set); +int BIF_menuselectTransformOrientation(void); +void BIF_selectTransformOrientation(struct bContext *C, struct TransformOrientation *ts); +void BIF_selectTransformOrientationValue(struct bContext *C, int orientation); + +void BIF_menuTransformOrientation(struct bContext *C, struct uiLayout *layout, void *arg); +char * BIF_menustringTransformOrientation(const struct bContext *C, char *title); /* the returned value was allocated and needs to be freed after use */ +int BIF_countTransformOrientation(const struct bContext *C); + +void BIF_getPropCenter(float *center); + +void BIF_TransformSetUndo(char *str); + +void BIF_selectOrientation(void); + +/* view3d manipulators */ +void initManipulator(int mode); +void ManipulatorTransform(); + +int BIF_do_manipulator(struct bContext *C, short mval[2]); +void BIF_draw_manipulator(const struct bContext *C); + +/* Snapping */ + + +typedef struct DepthPeel +{ + struct DepthPeel *next, *prev; + + float depth; + float p[3]; + float no[3]; + struct Object *ob; + int flag; +} DepthPeel; + +struct ListBase; + +typedef enum SnapMode +{ + SNAP_ALL = 0, + SNAP_NOT_SELECTED = 1, + SNAP_NOT_OBEDIT = 2 +} SnapMode; + +#define SNAP_MIN_DISTANCE 30 + +int peelObjectsTransForm(struct TransInfo *t, struct ListBase *depth_peels, short mval[2]); +int peelObjectsContext(struct bContext *C, struct ListBase *depth_peels, short mval[2]); +int snapObjectsTransform(struct TransInfo *t, short mval[2], int *dist, float *loc, float *no, SnapMode mode); +int snapObjectsContext(struct bContext *C, short mval[2], int *dist, float *loc, float *no, SnapMode mode); -#endif /* ED_TRANSFORM_H */ +#endif diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index 3ac6a1778db..e2ccd0976d2 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -74,12 +74,12 @@ #include "LBM_fluidsim.h" -#include "BIF_retopo.h" #include "ED_mesh.h" #include "ED_object.h" -#include "ED_util.h" +#include "ED_retopo.h" #include "ED_screen.h" +#include "ED_util.h" #include "ED_view3d.h" #include "RNA_access.h" diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index abbbb5aea3d..942ad657992 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -61,15 +61,15 @@ #include "BKE_utildefines.h" #include "BKE_report.h" -#include "BIF_retopo.h" - #include "WM_api.h" #include "WM_types.h" #include "ED_mesh.h" +#include "ED_retopo.h" +#include "ED_screen.h" +#include "ED_transform.h" #include "ED_util.h" #include "ED_view3d.h" -#include "ED_screen.h" #include "mesh_intern.h" @@ -1659,3 +1659,50 @@ void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot) RNA_def_float(ot->srna, "size", 1.0f, 0.0f, FLT_MAX, "Size", "", 0.001f, 100.00); } +/****************** add duplicate operator ***************/ + +static int mesh_add_duplicate_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_edit_object(C); + EditMesh *em= BKE_mesh_get_editmesh(ob->data); + + adduplicateflag(em, SELECT); + + BKE_mesh_end_editmesh(ob->data, em); + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + + return OPERATOR_FINISHED; +} + +static int mesh_add_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + WM_cursor_wait(1); + mesh_add_duplicate_exec(C, op); + WM_cursor_wait(0); + + RNA_int_set(op->ptr, "mode", TFM_TRANSLATION); + WM_operator_name_call(C, "TFM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr); + + return OPERATOR_FINISHED; +} + +void MESH_OT_duplicate_add(wmOperatorType *ot) +{ + + /* identifiers */ + ot->name= "Add Duplicate"; + ot->idname= "MESH_OT_duplicate_add"; + + /* api callbacks */ + ot->invoke= mesh_add_duplicate_invoke; + ot->exec= mesh_add_duplicate_exec; + + ot->poll= ED_operator_editmesh; + + /* to give to transform */ + RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); +} + diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 2c3007d00ad..00cd187a23c 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -83,10 +83,10 @@ editmesh_tool.c: UI called tools for editmesh, geometry changes here, otherwise #include "WM_types.h" #include "ED_mesh.h" -#include "ED_view3d.h" -#include "ED_util.h" #include "ED_screen.h" -#include "BIF_transform.h" +#include "ED_transform.h" +#include "ED_util.h" +#include "ED_view3d.h" #include "UI_interface.h" diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index ff07d03313b..4d71ddbd647 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -82,8 +82,10 @@ void MESH_OT_primitive_grid_add(struct wmOperatorType *ot); void MESH_OT_primitive_monkey_add(struct wmOperatorType *ot); void MESH_OT_primitive_uv_sphere_add(struct wmOperatorType *ot); void MESH_OT_primitive_ico_sphere_add(struct wmOperatorType *ot); -void MESH_OT_dupli_extrude_cursor(struct wmOperatorType *ot); + void MESH_OT_edge_face_add(struct wmOperatorType *ot); +void MESH_OT_dupli_extrude_cursor(struct wmOperatorType *ot); +void MESH_OT_duplicate_add(struct wmOperatorType *ot); void MESH_OT_fgon_make(struct wmOperatorType *ot); void MESH_OT_fgon_clear(struct wmOperatorType *ot); diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 7e59cd684ba..64fcfb681ed 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -54,55 +54,14 @@ #include "WM_api.h" #include "WM_types.h" -#include "ED_screen.h" #include "ED_mesh.h" +#include "ED_screen.h" +#include "ED_transform.h" #include "ED_view3d.h" -#include "BIF_transform.h" - #include "mesh_intern.h" -static int mesh_add_duplicate_exec(bContext *C, wmOperator *op) -{ - Object *ob= CTX_data_edit_object(C); - EditMesh *em= BKE_mesh_get_editmesh(ob->data); - - adduplicateflag(em, SELECT); - - BKE_mesh_end_editmesh(ob->data, em); - return OPERATOR_FINISHED; -} - -static int mesh_add_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) -{ - WM_cursor_wait(1); - mesh_add_duplicate_exec(C, op); - WM_cursor_wait(0); - - RNA_int_set(op->ptr, "mode", TFM_TRANSLATION); - WM_operator_name_call(C, "TFM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr); - - return OPERATOR_FINISHED; -} - -static void MESH_OT_duplicate_add(wmOperatorType *ot) -{ - - /* identifiers */ - ot->name= "Add Duplicate"; - ot->idname= "MESH_OT_duplicate_add"; - - /* api callbacks */ - ot->invoke= mesh_add_duplicate_invoke; - ot->exec= mesh_add_duplicate_exec; - - ot->poll= ED_operator_editmesh; - - /* to give to transform */ - RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); -} - /* ************************** registration **********************************/ diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 90f6250cf8c..b2040d328f2 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -116,12 +116,11 @@ #include "ED_mesh.h" #include "ED_object.h" #include "ED_screen.h" +#include "ED_transform.h" #include "ED_types.h" #include "ED_util.h" #include "ED_view3d.h" -#include "BIF_transform.h" - #include "UI_interface.h" #include "RNA_access.h" diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 5d262cb03c5..148021a6fa3 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -74,14 +74,13 @@ #include "UI_view2d.h" -#include "BIF_transform.h" - #include "ED_anim_api.h" #include "ED_keyframing.h" #include "ED_keyframes_draw.h" #include "ED_keyframes_edit.h" #include "ED_screen.h" #include "ED_space_api.h" +#include "ED_transform.h" #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index 49a0befdbe2..8ca2bf40979 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -46,7 +46,7 @@ #include "UI_interface.h" #include "UI_view2d.h" -#include "BIF_transform.h" +#include "ED_transform.h" #include "action_intern.h" diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 23e8a009274..71f2eb2a8de 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -74,14 +74,13 @@ #include "UI_view2d.h" -#include "BIF_transform.h" - #include "ED_anim_api.h" #include "ED_keyframing.h" #include "ED_keyframes_draw.h" #include "ED_keyframes_edit.h" #include "ED_screen.h" #include "ED_space_api.h" +#include "ED_transform.h" #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index a23f0081c04..d1a678f91d4 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -47,8 +47,7 @@ #include "UI_view2d.h" #include "ED_screen.h" - -#include "BIF_transform.h" +#include "ED_transform.h" #include "graph_intern.h" diff --git a/source/blender/editors/space_image/image_header.c b/source/blender/editors/space_image/image_header.c index 9550c4c3a29..a902ec27a87 100644 --- a/source/blender/editors/space_image/image_header.c +++ b/source/blender/editors/space_image/image_header.c @@ -55,6 +55,7 @@ #include "ED_image.h" #include "ED_mesh.h" #include "ED_screen.h" +#include "ED_transform.h" #include "ED_types.h" #include "ED_util.h" @@ -63,7 +64,6 @@ #include "BIF_gl.h" #include "BIF_glutil.h" -#include "BIF_transform.h" #include "UI_interface.h" #include "UI_resources.h" diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index a1217f84380..ef472d462c2 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -369,7 +369,6 @@ static void image_main_area_set_view2d(SpaceImage *sima, ARegion *ar, Scene *sce ar->v2d.mask.ymax= winy; /* which part of the image space do we see? */ - /* same calculation as in lrectwrite: area left and down*/ x1= ar->winrct.xmin+(winx-sima->zoom*w)/2; y1= ar->winrct.ymin+(winy-sima->zoom*h)/2; diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 0d6fc20c248..1ba14bbd10e 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -63,7 +63,6 @@ #include "ED_previewrender.h" #include "BIF_gl.h" -#include "BIF_transform.h" #include "BLI_arithb.h" #include "BLI_blenlib.h" @@ -75,6 +74,7 @@ #include "ED_space_api.h" #include "ED_screen.h" +#include "ED_transform.h" #include "ED_types.h" #include "RNA_access.h" diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c index 732b45f1f30..6df5dbd71d0 100644 --- a/source/blender/editors/space_node/node_ops.c +++ b/source/blender/editors/space_node/node_ops.c @@ -37,8 +37,7 @@ #include "ED_space_api.h" #include "ED_screen.h" - -#include "BIF_transform.h" +#include "ED_transform.h" #include "RNA_access.h" #include "RNA_define.h" diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 7cd81faede1..933c50ad20c 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -66,8 +66,6 @@ #include "BKE_utildefines.h" #include "BKE_report.h" -#include "BIF_transform.h" - #include "WM_api.h" #include "WM_types.h" @@ -82,6 +80,7 @@ #include "ED_space_api.h" #include "ED_types.h" #include "ED_screen.h" +#include "ED_transform.h" #include "ED_util.h" #include "UI_interface.h" diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index c6e5fbe39a4..d1a2307ca3a 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -41,8 +41,6 @@ #include "BLI_arithb.h" #include "BLI_blenlib.h" -#include "BIF_transform.h" /* transform keymap */ - #include "BKE_context.h" #include "BKE_global.h" #include "BKE_utildefines.h" @@ -54,6 +52,7 @@ #include "WM_types.h" #include "ED_screen.h" +#include "ED_transform.h" /* transform keymap */ #include "sequencer_intern.h" diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 91565235591..cf197f1d405 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -71,7 +71,6 @@ #include "BKE_utildefines.h" #include "BIF_gl.h" -#include "BIF_transform.h" #include "WM_api.h" #include "WM_types.h" @@ -87,6 +86,7 @@ #include "ED_object.h" #include "ED_particle.h" #include "ED_screen.h" +#include "ED_transform.h" #include "ED_types.h" #include "ED_util.h" diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index ec292b6871b..dd4e67e612c 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -70,7 +70,6 @@ #include "BIF_gl.h" #include "BIF_glutil.h" -#include "BIF_transform.h" #include "WM_api.h" #include "BLF_api.h" @@ -81,6 +80,7 @@ #include "ED_screen.h" #include "ED_space_api.h" #include "ED_util.h" +#include "ED_transform.h" #include "ED_types.h" #include "UI_interface.h" diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 1b9f3285f3d..1206bf72b72 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -62,8 +62,6 @@ #include "RE_pipeline.h" // make_stars #include "BIF_gl.h" -#include "BIF_retopo.h" -#include "BIF_transform.h" #include "WM_api.h" #include "WM_types.h" @@ -72,8 +70,10 @@ #include "RNA_define.h" #include "ED_particle.h" +#include "ED_retopo.h" #include "ED_space_api.h" #include "ED_screen.h" +#include "ED_transform.h" #include "ED_types.h" #include "UI_interface.h" diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 5b378f39cd0..daa872defff 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -71,6 +71,7 @@ #include "ED_mesh.h" #include "ED_util.h" #include "ED_screen.h" +#include "ED_transform.h" #include "ED_types.h" #include "WM_api.h" @@ -81,7 +82,6 @@ #include "BIF_gl.h" #include "BIF_glutil.h" -#include "BIF_transform.h" #include "BLI_arithb.h" #include "BLI_blenlib.h" diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 32a66254ff4..25405909d0b 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -46,8 +46,6 @@ #include "BKE_global.h" #include "BKE_utildefines.h" -#include "BIF_transform.h" - #include "RNA_access.h" #include "RNA_define.h" @@ -55,6 +53,7 @@ #include "WM_types.h" #include "ED_screen.h" +#include "ED_transform.h" #include "view3d_intern.h" diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 74063e0ad56..fedf3a30181 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -66,7 +66,6 @@ #include "RE_pipeline.h" // make_stars #include "BIF_gl.h" -#include "BIF_retopo.h" #include "WM_api.h" #include "WM_types.h" @@ -79,6 +78,7 @@ #include "ED_particle.h" #include "ED_mesh.h" #include "ED_object.h" +#include "ED_retopo.h" #include "ED_screen.h" #include "ED_types.h" #include "ED_util.h" diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 8aba8e11d43..89a6d659d67 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -71,7 +71,6 @@ #include "BKE_utildefines.h" #include "BIF_gl.h" -#include "BIF_transform.h" #include "WM_api.h" #include "WM_types.h" @@ -87,6 +86,7 @@ #include "ED_object.h" #include "ED_particle.h" #include "ED_screen.h" +#include "ED_transform.h" #include "ED_types.h" #include "ED_util.h" diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index c270a5d20ea..98719e714ba 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -30,7 +30,7 @@ #ifndef TRANSFORM_H #define TRANSFORM_H -#include "BIF_transform.h" +#include "ED_transform.h" /* ************************** Types ***************************** */ diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 5926b95854c..6d2337bbc8c 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -114,7 +114,6 @@ //#include "BIF_meshtools.h" //#include "BIF_mywindow.h" //#include "BIF_resources.h" -#include "BIF_retopo.h" //#include "BIF_screen.h" //#include "BIF_space.h" //#include "BIF_toolbox.h" @@ -127,6 +126,7 @@ #include "ED_keyframes_edit.h" #include "ED_object.h" #include "ED_mesh.h" +#include "ED_retopo.h" #include "ED_types.h" #include "ED_uvedit.h" #include "ED_view3d.h" diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index c9d5456f59b..5bb1a2e1329 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -65,7 +65,6 @@ //#include "BIF_editsima.h" //#include "BIF_editparticle.h" //#include "BIF_meshtools.h" -#include "BIF_retopo.h" #include "BKE_action.h" #include "BKE_anim.h" @@ -91,6 +90,7 @@ #include "ED_image.h" #include "ED_keyframing.h" #include "ED_mesh.h" +#include "ED_retopo.h" #include "ED_space_api.h" #include "ED_uvedit.h" #include "ED_view3d.h" diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index aecd01dd4f0..3868ac9204b 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -66,7 +66,6 @@ #include "BLI_editVert.h" #include "BIF_gl.h" -#include "BIF_transform.h" #include "WM_api.h" #include "WM_types.h" @@ -75,6 +74,7 @@ #include "ED_mesh.h" #include "ED_particle.h" #include "ED_space_api.h" +#include "ED_transform.h" #include "ED_view3d.h" #include "UI_resources.h" diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 0b9a176dbdf..9438581409b 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -63,8 +63,6 @@ //#include "BIF_drawimage.h" //#include "BIF_editmesh.h" -#include "BIF_transform.h" - #include "BKE_global.h" #include "BKE_utildefines.h" #include "BKE_DerivedMesh.h" @@ -75,6 +73,7 @@ #include "ED_armature.h" #include "ED_image.h" #include "ED_mesh.h" +#include "ED_transform.h" #include "ED_uvedit.h" #include "ED_view3d.h" diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 7582145c63b..4c855315bb3 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -54,11 +54,10 @@ #include "BKE_report.h" #include "BKE_utildefines.h" -#include "BIF_transform.h" - #include "ED_image.h" #include "ED_mesh.h" #include "ED_screen.h" +#include "ED_transform.h" #include "RNA_access.h" #include "RNA_define.h" -- cgit v1.2.3 From 70fc83e958be8cf697798f46f2b3f18aaca61070 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Wed, 8 Jul 2009 17:41:45 +0000 Subject: == Sequencer == * Added a lot of update notifiers to RNA * Fixed strip deallocation (didn't free effect data for some reason...) --- source/blender/blenkernel/intern/sequence.c | 4 ++-- source/blender/makesrna/intern/rna_sequence.c | 30 ++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/sequence.c b/source/blender/blenkernel/intern/sequence.c index 7fc262b4796..c8d95929027 100644 --- a/source/blender/blenkernel/intern/sequence.c +++ b/source/blender/blenkernel/intern/sequence.c @@ -184,11 +184,11 @@ void seq_free_sequence(Editing *ed, Sequence *seq) if(seq->anim) IMB_free_anim(seq->anim); //XXX if(seq->hdaudio) sound_close_hdaudio(seq->hdaudio); - /* XXX if (seq->type & SEQ_EFFECT) { + if (seq->type & SEQ_EFFECT) { struct SeqEffectHandle sh = get_sequence_effect(seq); sh.free(seq); - }*/ + } if (ed->act_seq==seq) ed->act_seq= NULL; diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index 055e67fb135..8ca023dc57c 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -38,9 +38,9 @@ #include "MEM_guardedalloc.h" -#ifdef RNA_RUNTIME +#include "WM_types.h" -#include "MEM_guardedalloc.h" +#ifdef RNA_RUNTIME static int rna_SequenceEditor_name_length(PointerRNA *ptr) { @@ -429,10 +429,12 @@ static void rna_def_sequence(BlenderRNA *brna) prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MUTE); RNA_def_property_ui_text(prop, "Mute", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "frame_locked", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_IPO_FRAME_LOCKED); RNA_def_property_ui_text(prop, "Frame Locked", "Lock the animation curve to the global frame counter."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LOCK); @@ -450,45 +452,53 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "start"); RNA_def_property_ui_text(prop, "Start Frame", ""); RNA_def_property_int_funcs(prop, NULL, "rna_SequenceEditor_start_frame_set",NULL); // overlap tests and calc_seq_disp + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "start_offset", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "startofs"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests RNA_def_property_ui_text(prop, "Start Offset", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "end_offset", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "endofs"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests RNA_def_property_ui_text(prop, "End offset", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "start_still", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "startstill"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests RNA_def_property_range(prop, 0, MAXFRAME); RNA_def_property_ui_text(prop, "Start Still", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "end_still", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "endstill"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests RNA_def_property_range(prop, 0, MAXFRAME); RNA_def_property_ui_text(prop, "End Still", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "machine"); RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip."); RNA_def_property_int_funcs(prop, NULL, "rna_SequenceEditor_channel_set",NULL); // overlap test + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); /* blending */ prop= RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, blend_mode_items); RNA_def_property_ui_text(prop, "Blend Mode", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "blend_opacity", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Blend Opacity", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); - /* funcsions */ + /* functions */ func= RNA_def_function(srna, "getStripElem", "give_stripelem"); RNA_def_function_ui_description(func, "Return the strip element from a given frame or None."); prop= RNA_def_int(func, "frame", 0, INT_MIN, INT_MAX, "Frame", "The frame to get the strip element from", INT_MIN, INT_MAX); @@ -539,58 +549,71 @@ static void rna_def_filter_video(StructRNA *srna) prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_PREMUL); RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "flip_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPX); RNA_def_property_ui_text(prop, "Flip X", "Flip on the X axis."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "flip_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPY); RNA_def_property_ui_text(prop, "Flip Y", "Flip on the Y axis."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "convert_float", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_FLOAT); RNA_def_property_ui_text(prop, "Convert Float", "Convert input to float data."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "reverse_frames", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_REVERSE_FRAMES); RNA_def_property_ui_text(prop, "Flip Time", "Reverse frame order."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "multiply_colors", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "mul"); RNA_def_property_range(prop, 0.0f, 20.0f); RNA_def_property_ui_text(prop, "Multiply Colors", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 1.0f, 30.0f); RNA_def_property_ui_text(prop, "Strobe", "Only display every nth frame."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "use_color_balance", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_COLOR_BALANCE); RNA_def_property_ui_text(prop, "Use Color Balance", "(3-Way color correction) on input."); RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_color_balance_set"); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "strip->color_balance"); RNA_def_property_ui_text(prop, "Color Balance", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "use_translation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_TRANSFORM); RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing."); RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_translation_set"); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "strip->transform"); RNA_def_property_ui_text(prop, "Transform", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "use_crop", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_CROP); RNA_def_property_ui_text(prop, "Use Crop", "Crop image before processing."); RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_crop_set"); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "strip->crop"); RNA_def_property_ui_text(prop, "Crop", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); } static void rna_def_filter_sound(StructRNA *srna) @@ -960,6 +983,7 @@ static void rna_def_solid_color(BlenderRNA *brna) prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "col"); RNA_def_property_ui_text(prop, "Color", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); } static void rna_def_speed_control(BlenderRNA *brna) -- cgit v1.2.3 From b69f952accc1cfa35a9de783fd62b0412ff552cd Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 8 Jul 2009 17:49:14 +0000 Subject: 2.5 Makefile still had libradioisty.a --- source/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source') diff --git a/source/Makefile b/source/Makefile index 62eb25acbc1..de0b144ed71 100644 --- a/source/Makefile +++ b/source/Makefile @@ -83,7 +83,6 @@ GRPLIB += $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)libSoundSystem.a GRPLIB += $(NAN_GHOST)/lib/$(DEBUG_DIR)libghost.a GRPLIB += $(NAN_STRING)/lib/$(DEBUG_DIR)libstring.a GRPLIB += $(OCGDIR)/blender/render/$(DEBUG_DIR)librender.a -GRPLIB += $(OCGDIR)/blender/radiosity/$(DEBUG_DIR)libradiosity.a # nlin: the reason that some libraries appear more than once below is # to handle circular dependencies in linking among libraries... some @@ -221,8 +220,8 @@ PULIB += $(OCGDIR)/blender/ed_sequencer/$(DEBUG_DIR)libed_sequencer.a PULIB += $(OCGDIR)/blender/ed_file/$(DEBUG_DIR)libed_file.a PULIB += $(OCGDIR)/blender/ed_info/$(DEBUG_DIR)libed_info.a PULIB += $(OCGDIR)/blender/ed_buttons/$(DEBUG_DIR)libed_buttons.a -PULIB += $(OCGDIR)/blender/ed_node/$(DEBUG_DIR)libed_node.a PULIB += $(OCGDIR)/blender/ed_graph/$(DEBUG_DIR)libed_graph.a +PULIB += $(OCGDIR)/blender/ed_node/$(DEBUG_DIR)libed_node.a PULIB += $(OCGDIR)/blender/ed_outliner/$(DEBUG_DIR)libed_outliner.a PULIB += $(OCGDIR)/blender/ed_time/$(DEBUG_DIR)libed_time.a PULIB += $(OCGDIR)/blender/ed_preview/$(DEBUG_DIR)libed_preview.a -- cgit v1.2.3 From 288bfeea1ed8435cfa22938346afbabb7e91bdbb Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Wed, 8 Jul 2009 19:14:32 +0000 Subject: 2.5 Sequencer: * Replaced some notifiers with proper ones. * Added "Draw Safe Margin" and "Separate Colors" Features to the menu. --- source/blender/makesrna/intern/rna_space.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index ccec28d55e2..fea932ca29a 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -734,13 +734,13 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "mainb"); RNA_def_property_enum_items(prop, display_mode_items); RNA_def_property_ui_text(prop, "Display Mode", "The view mode to use for displaying sequencer output."); - RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier + RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); /* flag's */ prop= RNA_def_property(srna, "draw_frames", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES); RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather then seconds."); - RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier + RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); prop= RNA_def_property(srna, "transform_markers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS); @@ -748,18 +748,18 @@ static void rna_def_space_sequencer(BlenderRNA *brna) prop= RNA_def_property(srna, "seperate_color_preview", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPERATED); - RNA_def_property_ui_text(prop, "Transform Markers", "Seperate color channels in preview."); - RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier + RNA_def_property_ui_text(prop, "Seperate Colors", "Seperate color channels in preview."); + RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); prop= RNA_def_property(srna, "draw_safe_margin", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS); RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins in preview."); - RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier + RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_GPENCIL); RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay."); - RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier + RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); /* grease pencil */ prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); @@ -771,13 +771,13 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "chanshown"); RNA_def_property_ui_text(prop, "Display Channel", "The channel number shown in the image preview. 0 is the result of all strips combined."); RNA_def_property_range(prop, 0, 32); // MAXSEQ --- todo, move from BKE_sequence.h - RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier + RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); prop= RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "zebra"); RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes."); RNA_def_property_range(prop, 0, 110); - RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier + RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); /* not sure we need rna access to these but adding anyway */ -- cgit v1.2.3 From 51ae88aa3b84565d79ab8819807f90aa3844479a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 8 Jul 2009 21:31:28 +0000 Subject: 2.5: Mesh and Various Fixes * 3D view Mesh menu works again, but incomplete. * Add Properties and Toolbar to 3D View menu. * Added "specials" menus back, vertex/edge/face and general. * Various fixes in existing mesh operators, some were not working. * Add MESH_OT_merge. * Merge all subdivide ops into MESH_OT_subdivide, subdivide code changes to make smooth + multi give good results. * Rename all select inverse ops to *_OT_select_inverse. * Fix "search for unknown operator" prints at startup, and some warnings in py code. * Don't run .pyc files on startup. * Remove unused image window header C code. --- source/blender/editors/armature/armature_intern.h | 4 +- source/blender/editors/armature/armature_ops.c | 8 +- source/blender/editors/armature/editarmature.c | 20 +- source/blender/editors/curve/curve_intern.h | 2 +- source/blender/editors/curve/curve_ops.c | 2 +- source/blender/editors/curve/editcurve.c | 10 +- source/blender/editors/include/ED_mesh.h | 23 +- .../blender/editors/interface/interface_layout.c | 4 +- source/blender/editors/mesh/editmesh.c | 2 +- source/blender/editors/mesh/editmesh_add.c | 19 +- source/blender/editors/mesh/editmesh_loop.c | 10 +- source/blender/editors/mesh/editmesh_mods.c | 213 +------ source/blender/editors/mesh/editmesh_tools.c | 566 ++++++++--------- source/blender/editors/mesh/mesh_intern.h | 13 +- source/blender/editors/mesh/mesh_ops.c | 206 ++++++- source/blender/editors/object/object_edit.c | 148 +---- source/blender/editors/object/object_intern.h | 2 +- source/blender/editors/object/object_ops.c | 4 +- source/blender/editors/space_image/image_header.c | 529 +--------------- source/blender/editors/space_image/space_image.c | 1 - .../editors/space_sequencer/sequencer_intern.h | 2 +- .../editors/space_sequencer/sequencer_ops.c | 4 +- .../editors/space_sequencer/sequencer_select.c | 10 +- .../blender/editors/space_view3d/view3d_header.c | 676 +++++---------------- .../blender/editors/space_view3d/view3d_intern.h | 1 - source/blender/editors/space_view3d/view3d_ops.c | 1 - source/blender/editors/uvedit/uvedit_ops.c | 10 +- source/blender/editors/uvedit/uvedit_unwrap_ops.c | 2 +- source/blender/makesrna/intern/rna_scene.c | 4 + source/blender/python/intern/bpy_interface.c | 20 +- source/blender/python/intern/bpy_operator.c | 8 +- source/blender/python/intern/bpy_operator_wrap.c | 7 +- source/blender/windowmanager/WM_api.h | 1 + source/blender/windowmanager/intern/wm_operators.c | 11 + 34 files changed, 742 insertions(+), 1801 deletions(-) (limited to 'source') diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h index 19204710116..d5ad63ca21b 100644 --- a/source/blender/editors/armature/armature_intern.h +++ b/source/blender/editors/armature/armature_intern.h @@ -42,7 +42,7 @@ void ARMATURE_OT_subdivide_multi(struct wmOperatorType *ot); void ARMATURE_OT_parent_set(struct wmOperatorType *ot); void ARMATURE_OT_parent_clear(struct wmOperatorType *ot); void ARMATURE_OT_select_all_toggle(struct wmOperatorType *ot); -void ARMATURE_OT_select_invert(struct wmOperatorType *ot); +void ARMATURE_OT_select_inverse(struct wmOperatorType *ot); void ARMATURE_OT_select_hierarchy(struct wmOperatorType *ot); void ARMATURE_OT_select_linked(struct wmOperatorType *ot); void ARMATURE_OT_delete(struct wmOperatorType *ot); @@ -56,7 +56,7 @@ void POSE_OT_rot_clear(struct wmOperatorType *ot); void POSE_OT_loc_clear(struct wmOperatorType *ot); void POSE_OT_scale_clear(struct wmOperatorType *ot); void POSE_OT_select_all_toggle(struct wmOperatorType *ot); -void POSE_OT_select_invert(struct wmOperatorType *ot); +void POSE_OT_select_inverse(struct wmOperatorType *ot); void POSE_OT_select_parent(struct wmOperatorType *ot); void POSE_OT_select_hierarchy(struct wmOperatorType *ot); void POSE_OT_select_linked(struct wmOperatorType *ot); diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index adbfb500eb0..df32f452a38 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -121,7 +121,7 @@ void ED_operatortypes_armature(void) WM_operatortype_append(ARMATURE_OT_parent_clear); WM_operatortype_append(ARMATURE_OT_select_all_toggle); - WM_operatortype_append(ARMATURE_OT_select_invert); + WM_operatortype_append(ARMATURE_OT_select_inverse); WM_operatortype_append(ARMATURE_OT_select_hierarchy); WM_operatortype_append(ARMATURE_OT_select_linked); @@ -148,7 +148,7 @@ void ED_operatortypes_armature(void) WM_operatortype_append(POSE_OT_scale_clear); WM_operatortype_append(POSE_OT_select_all_toggle); - WM_operatortype_append(POSE_OT_select_invert); + WM_operatortype_append(POSE_OT_select_inverse); WM_operatortype_append(POSE_OT_select_parent); WM_operatortype_append(POSE_OT_select_hierarchy); @@ -189,7 +189,7 @@ void ED_keymap_armature(wmWindowManager *wm) WM_keymap_add_item(keymap, "ARMATURE_OT_parent_clear", PKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "ARMATURE_OT_select_invert", IKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "ARMATURE_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_test", TKEY, KM_PRESS, 0, 0); // XXX temp test for context iterators... to be removed @@ -233,7 +233,7 @@ void ED_keymap_armature(wmWindowManager *wm) WM_keymap_add_item(keymap, "POSE_OT_scale_clear", SKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "POSE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "POSE_OT_select_invert", IKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "POSE_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "POSE_OT_select_parent", PKEY, KM_PRESS, KM_SHIFT, 0); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index d7e3f84f0d6..4312838cba5 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -3839,7 +3839,7 @@ void ARMATURE_OT_parent_clear(wmOperatorType *ot) /* **************** Selections ******************/ -static int armature_select_invert_exec(bContext *C, wmOperator *op) +static int armature_select_inverse_exec(bContext *C, wmOperator *op) { /* Set the flags */ CTX_DATA_BEGIN(C, EditBone *, ebone, visible_bones) { @@ -3854,15 +3854,15 @@ static int armature_select_invert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void ARMATURE_OT_select_invert(wmOperatorType *ot) +void ARMATURE_OT_select_inverse(wmOperatorType *ot) { /* identifiers */ - ot->name= "Invert Selection"; - ot->idname= "ARMATURE_OT_select_invert"; + ot->name= "Select Inverse"; + ot->idname= "ARMATURE_OT_select_inverse"; /* api callbacks */ - ot->exec= armature_select_invert_exec; + ot->exec= armature_select_inverse_exec; ot->poll= ED_operator_editarmature; /* flags */ @@ -4823,7 +4823,7 @@ void POSE_OT_rot_clear(wmOperatorType *ot) /* ***************** selections ********************** */ -static int pose_select_invert_exec(bContext *C, wmOperator *op) +static int pose_select_inverse_exec(bContext *C, wmOperator *op) { /* Set the flags */ @@ -4838,15 +4838,15 @@ static int pose_select_invert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void POSE_OT_select_invert(wmOperatorType *ot) +void POSE_OT_select_inverse(wmOperatorType *ot) { /* identifiers */ - ot->name= "Invert Selection"; - ot->idname= "POSE_OT_select_invert"; + ot->name= "Select Inverse"; + ot->idname= "POSE_OT_select_inverse"; /* api callbacks */ - ot->exec= pose_select_invert_exec; + ot->exec= pose_select_inverse_exec; ot->poll= ED_operator_posemode; /* flags */ diff --git a/source/blender/editors/curve/curve_intern.h b/source/blender/editors/curve/curve_intern.h index 2146855a75e..34e81b60a16 100644 --- a/source/blender/editors/curve/curve_intern.h +++ b/source/blender/editors/curve/curve_intern.h @@ -84,7 +84,7 @@ void CURVE_OT_smooth_radius(struct wmOperatorType *ot); void CURVE_OT_de_select_first(struct wmOperatorType *ot); void CURVE_OT_de_select_last(struct wmOperatorType *ot); void CURVE_OT_select_all_toggle(struct wmOperatorType *ot); -void CURVE_OT_select_invert(struct wmOperatorType *ot); +void CURVE_OT_select_inverse(struct wmOperatorType *ot); void CURVE_OT_select_linked(struct wmOperatorType *ot); void CURVE_OT_select_row(struct wmOperatorType *ot); void CURVE_OT_select_next(struct wmOperatorType *ot); diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index ed53f8e0194..45dc76d5488 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -139,7 +139,7 @@ void ED_operatortypes_curve(void) WM_operatortype_append(CURVE_OT_de_select_first); WM_operatortype_append(CURVE_OT_de_select_last); WM_operatortype_append(CURVE_OT_select_all_toggle); - WM_operatortype_append(CURVE_OT_select_invert); + WM_operatortype_append(CURVE_OT_select_inverse); WM_operatortype_append(CURVE_OT_select_linked); WM_operatortype_append(CURVE_OT_select_row); WM_operatortype_append(CURVE_OT_select_next); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 6ae79109445..c437f35c484 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -1736,7 +1736,7 @@ void CURVE_OT_reveal(wmOperatorType *ot) /********************** select invert operator *********************/ -static int select_invert_exec(bContext *C, wmOperator *op) +static int select_inverse_exec(bContext *C, wmOperator *op) { Object *obedit= CTX_data_edit_object(C); ListBase *editnurb= curve_get_editcurve(obedit); @@ -1775,14 +1775,14 @@ static int select_invert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void CURVE_OT_select_invert(wmOperatorType *ot) +void CURVE_OT_select_inverse(wmOperatorType *ot) { /* identifiers */ - ot->name= "Select Invert"; - ot->idname= "CURVE_OT_select_invert"; + ot->name= "Select Inverse"; + ot->idname= "CURVE_OT_select_inverse"; /* api callbacks */ - ot->exec= select_invert_exec; + ot->exec= select_inverse_exec; ot->poll= ED_operator_editsurfcurve; /* flags */ diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 8952305d6ab..c4fde48c631 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -49,26 +49,25 @@ struct UvVertMap; struct UvMapVert; struct CustomData; -// edge and face flag both -#define EM_FGON 2 -// face flag -#define EM_FGON_DRAW 1 +#define EM_FGON_DRAW 1 // face flag +#define EM_FGON 2 // edge and face flag both /* editbutflag */ -#define B_CLOCKWISE 1 -#define B_KEEPORIG 2 -#define B_BEAUTY 4 -#define B_SMOOTH 8 -#define B_BEAUTY_SHORT 16 -#define B_AUTOFGON 32 -#define B_KNIFE 0x80 +#define B_CLOCKWISE 1 +#define B_KEEPORIG 2 +#define B_BEAUTY 4 +#define B_SMOOTH 8 +#define B_BEAUTY_SHORT 0x10 +#define B_AUTOFGON 0x20 +#define B_KNIFE 0x80 #define B_PERCENTSUBD 0x40 #define B_MESH_X_MIRROR 0x100 #define B_JOINTRIA_UV 0x200 #define B_JOINTRIA_VCOL 0X400 #define B_JOINTRIA_SHARP 0X800 #define B_JOINTRIA_MAT 0X1000 - +#define B_FRACTAL 0x2000 +#define B_SPHERE 0x4000 /* meshtools.c */ diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 59726c6d5fd..8bafc5ce1e8 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1093,9 +1093,11 @@ void uiItemM(uiLayout *layout, bContext *C, char *name, int icon, char *menuname if(layout->root->type == UI_LAYOUT_MENU && !icon) icon= ICON_BLANK1; ui_item_menu(layout, name, icon, ui_item_menutype_func, mt, NULL); - break; + return; } } + + printf("uiItemM: not found %s\n", menuname); } /* label item */ diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index e2ccd0976d2..a680fb5d07a 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1625,7 +1625,7 @@ static int mesh_separate_exec(bContext *C, wmOperator *op) void MESH_OT_separate(wmOperatorType *ot) { /* identifiers */ - ot->name= "Mesh Separate"; + ot->name= "Separate"; ot->idname= "MESH_OT_separate"; /* api callbacks */ diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 942ad657992..c24670aa856 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -1104,7 +1104,7 @@ static void make_prim(Object *obedit, int type, float mat[4][4], int tot, int se } dia*=200; - for(a=1; averts.first; while(eve) { @@ -1661,7 +1661,7 @@ void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot) /****************** add duplicate operator ***************/ -static int mesh_add_duplicate_exec(bContext *C, wmOperator *op) +static int mesh_duplicate_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_edit_object(C); @@ -1677,10 +1677,10 @@ static int mesh_add_duplicate_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int mesh_add_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int mesh_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) { WM_cursor_wait(1); - mesh_add_duplicate_exec(C, op); + mesh_duplicate_exec(C, op); WM_cursor_wait(0); RNA_int_set(op->ptr, "mode", TFM_TRANSLATION); @@ -1689,16 +1689,15 @@ static int mesh_add_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event return OPERATOR_FINISHED; } -void MESH_OT_duplicate_add(wmOperatorType *ot) +void MESH_OT_duplicate(wmOperatorType *ot) { - /* identifiers */ - ot->name= "Add Duplicate"; - ot->idname= "MESH_OT_duplicate_add"; + ot->name= "Duplicate"; + ot->idname= "MESH_OT_duplicate"; /* api callbacks */ - ot->invoke= mesh_add_duplicate_invoke; - ot->exec= mesh_add_duplicate_exec; + ot->invoke= mesh_duplicate_invoke; + ot->exec= mesh_duplicate_exec; ot->poll= ED_operator_editmesh; diff --git a/source/blender/editors/mesh/editmesh_loop.c b/source/blender/editors/mesh/editmesh_loop.c index 9f804ee8553..7fc3753eefb 100644 --- a/source/blender/editors/mesh/editmesh_loop.c +++ b/source/blender/editors/mesh/editmesh_loop.c @@ -369,9 +369,9 @@ void CutEdgeloop(Object *obedit, wmOperator *op, EditMesh *em, int numcuts) fac= 1.0f; // XXX if(fbutton(&fac, 0.0f, 5.0f, 10, 10, "Smooth:")==0) return; fac= 0.292f*fac; - esubdivideflag(obedit, em, SELECT,fac,B_SMOOTH,numcuts,SUBDIV_SELECT_LOOPCUT); + esubdivideflag(obedit, em, SELECT,fac,0,B_SMOOTH,numcuts,SUBDIV_SELECT_LOOPCUT); } else { - esubdivideflag(obedit, em, SELECT,0,0,numcuts,SUBDIV_SELECT_LOOPCUT); + esubdivideflag(obedit, em, SELECT,0,0,0,numcuts,SUBDIV_SELECT_LOOPCUT); } /* if this was a single cut, enter edgeslide mode */ if(numcuts == 1 && hasHidden == 0){ @@ -690,9 +690,9 @@ static int knife_cut_exec(bContext *C, wmOperator *op) eed= eed->next; } - if (mode==KNIFE_MIDPOINT) esubdivideflag(obedit, em, SELECT, 0, B_KNIFE, 1, SUBDIV_SELECT_ORIG); - else if (mode==KNIFE_MULTICUT) esubdivideflag(obedit, em, SELECT, 0, B_KNIFE, numcuts, SUBDIV_SELECT_ORIG); - else esubdivideflag(obedit, em, SELECT, 0, B_KNIFE|B_PERCENTSUBD, 1, SUBDIV_SELECT_ORIG); + if (mode==KNIFE_MIDPOINT) esubdivideflag(obedit, em, SELECT, 0, 0, B_KNIFE, 1, SUBDIV_SELECT_ORIG); + else if (mode==KNIFE_MULTICUT) esubdivideflag(obedit, em, SELECT, 0, 0, B_KNIFE, numcuts, SUBDIV_SELECT_ORIG); + else esubdivideflag(obedit, em, SELECT, 0, 0, B_KNIFE|B_PERCENTSUBD, 1, SUBDIV_SELECT_ORIG); eed=em->edges.first; while(eed){ diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 67886ee8df5..ca0f73ece68 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -1412,7 +1412,7 @@ void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type) break; case 2: /* copy image */ if (!tf_act) { - BKE_report(op->reports, RPT_ERROR, "mesh has no uv/image layers"); + BKE_report(op->reports, RPT_ERROR, "Mesh has no uv/image layers."); return; } for(efa=em->faces.first; efa; efa=efa->next) { @@ -1433,7 +1433,7 @@ void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type) case 3: /* copy UV's */ if (!tf_act) { - BKE_report(op->reports, RPT_ERROR, "mesh has no uv/image layers"); + BKE_report(op->reports, RPT_ERROR, "Mesh has no uv/image layers."); return; } for(efa=em->faces.first; efa; efa=efa->next) { @@ -1446,7 +1446,7 @@ void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type) break; case 4: /* mode's */ if (!tf_act) { - BKE_report(op->reports, RPT_ERROR, "mesh has no uv/image layers"); + BKE_report(op->reports, RPT_ERROR, "Mesh has no uv/image layers."); return; } for(efa=em->faces.first; efa; efa=efa->next) { @@ -1459,7 +1459,7 @@ void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type) break; case 5: /* copy transp's */ if (!tf_act) { - BKE_report(op->reports, RPT_ERROR, "mesh has no uv/image layers"); + BKE_report(op->reports, RPT_ERROR, "Mesh has no uv/image layers."); return; } for(efa=em->faces.first; efa; efa=efa->next) { @@ -1473,7 +1473,7 @@ void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type) case 6: /* copy vcols's */ if (!mcol_act) { - BKE_report(op->reports, RPT_ERROR, "mesh has no color layers"); + BKE_report(op->reports, RPT_ERROR, "Mesh has no color layers."); return; } else { /* guess the 4th color if needs be */ @@ -3207,7 +3207,7 @@ void EM_select_swap(EditMesh *em) /* exported for UV */ } -static int select_invert_mesh_exec(bContext *C, wmOperator *op) +static int select_inverse_mesh_exec(bContext *C, wmOperator *op) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); @@ -3220,14 +3220,14 @@ static int select_invert_mesh_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void MESH_OT_select_invert(wmOperatorType *ot) +void MESH_OT_select_inverse(wmOperatorType *ot) { /* identifiers */ - ot->name= "Select Invert"; - ot->idname= "MESH_OT_select_invert"; + ot->name= "Select Inverse"; + ot->idname= "MESH_OT_select_inverse"; /* api callbacks */ - ot->exec= select_invert_mesh_exec; + ot->exec= select_inverse_mesh_exec; ot->poll= ED_operator_editmesh; /* flags */ @@ -3641,7 +3641,7 @@ static int editmesh_mark_seam(bContext *C, wmOperator *op) void MESH_OT_mark_seam(wmOperatorType *ot) { /* identifiers */ - ot->name= "Mark seam"; + ot->name= "Mark Seam"; ot->idname= "MESH_OT_mark_seam"; /* api callbacks */ @@ -3660,15 +3660,15 @@ static int editmesh_mark_sharp(bContext *C, wmOperator *op) Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); Mesh *me= ((Mesh *)obedit->data); - int set = RNA_boolean_get(op->ptr, "set"); + int clear = RNA_boolean_get(op->ptr, "clear"); EditEdge *eed; /* auto-enable sharp edge drawing */ - if(set) { + if(clear == 0) { me->drawflag |= ME_DRAWSHARP; } - if(set) { + if(!clear) { eed= em->edges.first; while(eed) { if(!eed->h && (eed->f & SELECT)) eed->sharp = 1; @@ -3693,7 +3693,7 @@ static int editmesh_mark_sharp(bContext *C, wmOperator *op) void MESH_OT_mark_sharp(wmOperatorType *ot) { /* identifiers */ - ot->name= "Mark sharp"; + ot->name= "Mark Sharp"; ot->idname= "MESH_OT_mark_sharp"; /* api callbacks */ @@ -3703,167 +3703,9 @@ void MESH_OT_mark_sharp(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "set", 0, "Set", ""); -} - -void BME_Menu() { - short ret; - ret= pupmenu("BME modeller%t|Select Edges of Vert%x1"); - - switch(ret) - { - case 1: - //BME_edges_of_vert(); - break; - } -} - - - -void Vertex_Menu(EditMesh *em) -{ - short ret; - ret= pupmenu("Vertex Specials%t|Remove Doubles%x1|Merge%x2|Smooth %x3|Select Vertex Path%x4|Blend From Shape%x5|Propagate To All Shapes%x6"); - - switch(ret) - { - case 1: -// XXX notice("Removed %d Vertices", removedoublesflag(1, 0, scene->toolsettings->doublimit)); - break; - case 2: -// XXX mergemenu(em); - break; - case 3: -// XXX vertexsmooth(em); - break; - case 4: -// XXX pathselect(em); - break; - case 5: -// XXX shape_copy_select_from(em); - break; - case 6: -// XXX shape_propagate(em); - break; - } - /* some items crashed because this is in the original W menu but not here. should really manage this better */ -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); -} - - -void Edge_Menu(EditMesh *em) -{ - short ret; - - ret= pupmenu("Edge Specials%t|Mark Seam %x1|Clear Seam %x2|Rotate Edge CW%x3|Rotate Edge CCW%x4|Loopcut%x6|Edge Slide%x5|Edge Loop Select%x7|Edge Ring Select%x8|Loop to Region%x9|Region to Loop%x10|Mark Sharp%x11|Clear Sharp%x12"); - - switch(ret) - { - case 1: - //editmesh_mark_seam(em, 0); - break; - case 2: - //editmesh_mark_seam(em, 1); - break; - case 3: -// edge_rotate_selected(em, 2); - break; - case 4: -// edge_rotate_selected(em, 1); - break; - case 5: -// EdgeSlide(em, 0,0.0); - break; - case 6: -// CutEdgeloop(em, 1); - break; - case 7: -// loop_multiselect(em, 0); - break; - case 8: -// loop_multiselect(em, 1); - break; - case 9: -// loop_to_region(em); - break; - case 10: -// region_to_loop(em); - break; - case 11: -// editmesh_mark_sharp(em, 1); -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - break; - case 12: -// editmesh_mark_sharp(em, 0); -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - break; - } - /* some items crashed because this is in the original W menu but not here. should really manage this better */ -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); -} - -void Face_Menu(EditMesh *em) -{ - short ret; - ret= pupmenu( - "Face Specials%t|Flip Normals%x1|Bevel%x2|Shade Smooth%x3|Shade Flat%x4|" - "Triangulate (Ctrl T)%x5|Quads from Triangles (Alt J)%x6|Flip Triangle Edges (Ctrl Shift F)%x7|%l|" - "Face Mode Set%x8|Face Mode Clear%x9|%l|" - "UV Rotate (Shift - CCW)%x10|UV Mirror (Shift - Switch Axis)%x11|" - "Color Rotate (Shift - CCW)%x12|Color Mirror (Shift - Switch Axis)%x13"); - - switch(ret) - { - case 1: -// flip_editnormals(em); -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - break; - case 2: -// bevel_menu(em); - break; - case 3: -// mesh_set_smooth_faces(em, 1); - break; - case 4: -// mesh_set_smooth_faces(em, 0); - break; - - case 5: /* Quads to Tris */ -// convert_to_triface(em, 0); -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - break; - case 6: /* Tris to Quads */ -// join_triangles(em); - break; - case 7: /* Flip triangle edges */ -// edge_flip(em); - break; - case 8: -// mesh_set_face_flags(em, 1); - break; - case 9: -// mesh_set_face_flags(em, 0); - break; - - /* uv texface options */ - case 10: -// mesh_rotate_uvs(em); - break; - case 11: -// mesh_mirror_uvs(em); - break; - case 12: -// mesh_rotate_colors(em); - break; - case 13: -// mesh_mirror_colors(em); - break; - } - /* some items crashed because this is in the original W menu but not here. should really manage this better */ -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + RNA_def_boolean(ot->srna, "clear", 0, "Clear", ""); } - /* **************** NORMALS ************** */ /* XXX value of select is messed up, it means two things */ @@ -4293,20 +4135,13 @@ static int smooth_vertex(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); - Mesh *me= obedit->data; - EditMesh *em= (EditMesh *)me; - + EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); EditVert *eve, *eve_mir = NULL; EditEdge *eed; float *adror, *adr, fac; float fvec[3]; int teller=0; - ModifierData *md= obedit->modifiers.first; - - if(em==NULL) { - BKE_mesh_end_editmesh(obedit->data, em); - return OPERATOR_CANCELLED; - } + ModifierData *md; /* count */ eve= em->verts.first; @@ -4334,8 +4169,8 @@ static int smooth_vertex(bContext *C, wmOperator *op) /* if there is a mirror modifier with clipping, flag the verts that * are within tolerance of the plane(s) of reflection */ - for (; md; md=md->next) { - if (md->type==eModifierType_Mirror) { + for(md=obedit->modifiers.first; md; md=md->next) { + if(md->type==eModifierType_Mirror) { MirrorModifierData *mmd = (MirrorModifierData*) md; if(mmd->flag & MOD_MIR_CLIPPING) { @@ -4604,7 +4439,7 @@ void flipface(EditMesh *em, EditFace *efa) } -static int flip_editnormals(bContext *C, wmOperator *op) +static int flip_normals(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); @@ -4630,14 +4465,14 @@ static int flip_editnormals(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void MESH_OT_flip_editnormals(wmOperatorType *ot) +void MESH_OT_flip_normals(wmOperatorType *ot) { /* identifiers */ ot->name= "Flip Normals"; - ot->idname= "MESH_OT_flip_editnormals"; + ot->idname= "MESH_OT_flip_normals"; /* api callbacks */ - ot->exec= flip_editnormals; + ot->exec= flip_normals; ot->poll= ED_operator_editmesh; /* flags */ diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 00cd187a23c..4377f459081 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -736,7 +736,7 @@ static int mesh_extrude_exec(bContext *C, wmOperator *op) void MESH_OT_extrude(wmOperatorType *ot) { /* identifiers */ - ot->name= "Extrude Mesh"; + ot->name= "Extrude"; ot->idname= "MESH_OT_extrude"; /* api callbacks */ @@ -777,7 +777,7 @@ static int split_mesh(bContext *C, wmOperator *op) void MESH_OT_split(wmOperatorType *ot) { /* identifiers */ - ot->name= "Split Mesh"; + ot->name= "Split"; ot->idname= "MESH_OT_split"; /* api callbacks */ @@ -1341,7 +1341,7 @@ void MESH_OT_delete(wmOperatorType *ot) #define DOUBLEOPFILL 16 /* calculates offset for co, based on fractal, sphere or smooth settings */ -static void alter_co(float *co, EditEdge *edge, float rad, int beauty, float perc) +static void alter_co(float *co, EditEdge *edge, float smooth, float fractal, int beauty, float perc) { float vec1[3], fac; @@ -1368,37 +1368,38 @@ static void alter_co(float *co, EditEdge *edge, float rad, int beauty, float per vec1[0]+= fac*nor2[0]; vec1[1]+= fac*nor2[1]; vec1[2]+= fac*nor2[2]; + + /* falloff for multi subdivide */ + smooth *= sqrt(fabs(1.0f - 2.0f*fabs(0.5f-perc))); - vec1[0]*= rad*len; - vec1[1]*= rad*len; - vec1[2]*= rad*len; + vec1[0]*= smooth*len; + vec1[1]*= smooth*len; + vec1[2]*= smooth*len; co[0] += vec1[0]; co[1] += vec1[1]; co[2] += vec1[2]; } - else { - if(rad > 0.0) { /* subdivide sphere */ - Normalize(co); - co[0]*= rad; - co[1]*= rad; - co[2]*= rad; - } - else if(rad< 0.0) { /* fractal subdivide */ - fac= rad* VecLenf(edge->v1->co, edge->v2->co); - vec1[0]= fac*(float)(0.5-BLI_drand()); - vec1[1]= fac*(float)(0.5-BLI_drand()); - vec1[2]= fac*(float)(0.5-BLI_drand()); - VecAddf(co, co, vec1); - } + else if(beauty & B_SPHERE) { /* subdivide sphere */ + Normalize(co); + co[0]*= smooth; + co[1]*= smooth; + co[2]*= smooth; + } + if(beauty & B_FRACTAL) { + fac= fractal*VecLenf(edge->v1->co, edge->v2->co); + vec1[0]= fac*(float)(0.5-BLI_drand()); + vec1[1]= fac*(float)(0.5-BLI_drand()); + vec1[2]= fac*(float)(0.5-BLI_drand()); + VecAddf(co, co, vec1); } } /* assumes in the edge is the correct interpolated vertices already */ -/* percent defines the interpolation, rad and beauty are for special options */ +/* percent defines the interpolation, smooth, fractal and beauty are for special options */ /* results in new vertex with correct coordinate, vertex normal and weight group info */ -static EditVert *subdivide_edge_addvert(EditMesh *em, EditEdge *edge, float rad, int beauty, float percent) +static EditVert *subdivide_edge_addvert(EditMesh *em, EditEdge *edge, float smooth, float fractal, int beauty, float percent) { EditVert *ev; float co[3]; @@ -1408,7 +1409,7 @@ static EditVert *subdivide_edge_addvert(EditMesh *em, EditEdge *edge, float rad, co[2] = (edge->v2->co[2]-edge->v1->co[2])*percent + edge->v1->co[2]; /* offset for smooth or sphere or fractal */ - alter_co(co, edge, rad, beauty, percent); + alter_co(co, edge, smooth, fractal, beauty, percent); /* clip if needed by mirror modifier */ if (edge->v1->f2) { @@ -2176,7 +2177,7 @@ static void fill_quad_triple(EditMesh *em, EditFace *efa, struct GHash *gh, int //EM_fgon_flags(em); } -static void fill_quad_quadruple(EditMesh *em, EditFace *efa, struct GHash *gh, int numcuts, float rad, int beauty) +static void fill_quad_quadruple(EditMesh *em, EditFace *efa, struct GHash *gh, int numcuts, float smooth, float fractal, int beauty) { EditVert **verts[4], ***innerverts; EditFace *hold; @@ -2246,7 +2247,7 @@ static void fill_quad_quadruple(EditMesh *em, EditFace *efa, struct GHash *gh, i for(j=1;j<=numcuts;j++) { float percent= (float)j/(float)(numcuts+1); - innerverts[i][(numcuts+1)-j]= subdivide_edge_addvert(em, &temp, rad, beauty, percent); + innerverts[i][(numcuts+1)-j]= subdivide_edge_addvert(em, &temp, smooth, fractal, beauty, percent); } } // Fill with faces @@ -2273,7 +2274,7 @@ static void fill_quad_quadruple(EditMesh *em, EditFace *efa, struct GHash *gh, i MEM_freeN(innerverts); } -static void fill_tri_triple(EditMesh *em, EditFace *efa, struct GHash *gh, int numcuts, float rad, int beauty) +static void fill_tri_triple(EditMesh *em, EditFace *efa, struct GHash *gh, int numcuts, float smooth, float fractal, int beauty) { EditVert **verts[3], ***innerverts; short vertsize, i, j; @@ -2344,7 +2345,7 @@ static void fill_tri_triple(EditMesh *em, EditFace *efa, struct GHash *gh, int n for(j=1;j<(numcuts+1)-i;j++) { float percent= (float)j/(float)((numcuts+1)-i); - innerverts[i][((numcuts+1)-i)-j]= subdivide_edge_addvert(em, &temp, rad, beauty, 1-percent); + innerverts[i][((numcuts+1)-i)-j]= subdivide_edge_addvert(em, &temp, smooth, fractal, beauty, 1-percent); } } @@ -2522,7 +2523,7 @@ static void fill_quad_singlevert(EditMesh *em, EditFace *efa, struct GHash *gh) // This function takes an example edge, the current point to create and // the total # of points to create, then creates the point and return the // editvert pointer to it. -static EditVert *subdivideedgenum(EditMesh *em, EditEdge *edge, int curpoint, int totpoint, float rad, int beauty) +static EditVert *subdivideedgenum(EditMesh *em, EditEdge *edge, int curpoint, int totpoint, float smooth, float fractal, int beauty) { EditVert *ev; float percent; @@ -2533,13 +2534,13 @@ static EditVert *subdivideedgenum(EditMesh *em, EditEdge *edge, int curpoint, in else percent= (float)curpoint/(float)(totpoint+1); - ev= subdivide_edge_addvert(em, edge, rad, beauty, percent); + ev= subdivide_edge_addvert(em, edge, smooth, fractal, beauty, percent); ev->f = edge->v1->f; return ev; } -void esubdivideflag(Object *obedit, EditMesh *em, int flag, float rad, int beauty, int numcuts, int seltype) +void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float fractal, int beauty, int numcuts, int seltype) { EditFace *ef; EditEdge *eed, *cedge, *sort[4]; @@ -2692,7 +2693,7 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float rad, int beaut for(i=0;if1 = SELECT; - fill_quad_quadruple(em, ef, gh, numcuts, rad, beauty); + fill_quad_quadruple(em, ef, gh, numcuts, smooth, fractal, beauty); break; } } else { @@ -2808,7 +2809,7 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float rad, int beaut fill_tri_double(em, ef, gh, numcuts); break; case 3: ef->f1 = SELECT; - fill_tri_triple(em, ef, gh, numcuts, rad, beauty); + fill_tri_triple(em, ef, gh, numcuts, smooth, fractal, beauty); break; } } @@ -3487,7 +3488,23 @@ void edge_flip(EditMesh *em) MEM_freeN(efaar); } -static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed,int dir) +#define DIRECTION_CW 1 +#define DIRECTION_CCW 2 + +static const EnumPropertyItem direction_items[]= { + {DIRECTION_CW, "CW", 0, "Clockwise", ""}, + {DIRECTION_CCW, "CCW", 0, "Counter Clockwise", ""}, + {0, NULL, 0, NULL, NULL}}; + +#define AXIS_X 1 +#define AXIS_Y 2 + +static const EnumPropertyItem axis_items[]= { + {AXIS_X, "X", 0, "X", ""}, + {AXIS_Y, "Y", 0, "Y", ""}, + {0, NULL, 0, NULL, NULL}}; + +static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir) { EditVert **verts[2]; EditFace *face[2], *efa, *newFace[2]; @@ -3585,10 +3602,10 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed,int dir) newFace[1]= EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], 4+p[0][1], -1); } else if(fac1 == 4 && fac2 == 3) { - if(dir == 1) { + if(dir == DIRECTION_CW) { newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][1], p[0][2], p[0][3], 4+p[1][1]); newFace[1]= EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], 4+p[0][1], -1); - } else if (dir == 2) { + } else if (dir == DIRECTION_CCW) { newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][2], 4+p[1][1], p[0][0], p[0][1]); newFace[1]= EM_face_from_faces(em, face[1], face[0], 4+p[0][2], p[1][0], p[1][1], -1); @@ -3597,10 +3614,10 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed,int dir) } } else if(fac1 == 3 && fac2 == 4) { - if(dir == 1) { + if(dir == DIRECTION_CW) { newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][1], p[0][2], 4+p[1][1], -1); newFace[1]= EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], p[1][3], 4+p[0][1]); - } else if (dir == 2) { + } else if (dir == DIRECTION_CCW) { newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][0], p[0][1], 4+p[1][2], -1); newFace[1]= EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], 4+p[0][1], 4+p[0][2]); @@ -3610,10 +3627,10 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed,int dir) } else if(fac1 == 4 && fac2 == 4) { - if(dir == 1) { + if(dir == DIRECTION_CW) { newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][1], p[0][2], p[0][3], 4+p[1][1]); newFace[1]= EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], p[1][3], 4+p[0][1]); - } else if (dir == 2) { + } else if (dir == DIRECTION_CCW) { newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][2], p[0][3], 4+p[1][1], 4+p[1][2]); newFace[1]= EM_face_from_faces(em, face[1], face[0], p[1][2], p[1][3], 4+p[0][1], 4+p[0][2]); @@ -3624,7 +3641,7 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed,int dir) else return; /* This should never happen */ - if(dir == 1 || (fac1 == 3 && fac2 == 3)) { + if(dir == DIRECTION_CW || (fac1 == 3 && fac2 == 3)) { verts[0][p[0][1]]->f |= SELECT; verts[1][p[1][1]]->f |= SELECT; } @@ -3668,10 +3685,9 @@ static int edge_rotate_selected(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - - int dir = RNA_int_get(op->ptr,"dir"); // dir == 2 when clockwise and ==1 for counter CW. EditEdge *eed; EditFace *efa; + int dir = RNA_int_get(op->ptr, "direction"); // dir == 2 when clockwise and ==1 for counter CW. short edgeCount = 0; /*clear new flag for new edges, count selected edges */ @@ -3719,23 +3735,21 @@ static int edge_rotate_selected(bContext *C, wmOperator *op) } } } - else - { + else { BKE_report(op->reports, RPT_ERROR, "Select one edge or two adjacent faces"); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } - /* flush selected vertices (again) to edges/faces */ EM_select_flush(em); + BKE_mesh_end_editmesh(obedit->data, em); + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; - } void MESH_OT_edge_rotate(wmOperatorType *ot) @@ -3752,7 +3766,7 @@ void MESH_OT_edge_rotate(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* props */ - RNA_def_int(ot->srna, "dir", 1, 1, 2, "Direction", "Clockwise and Counter Clockwise", 1, 2); + RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "direction", "direction to rotate edge around."); } @@ -4726,23 +4740,7 @@ void mesh_set_face_flags(EditMesh *em, short mode) } #endif -void mesh_set_smooth_faces(EditMesh *em, short event) -{ - EditFace *efa; - - if(em==NULL) return; - - efa= em->faces.first; - while(efa) { - if(efa->f & SELECT) { - if(event==1) efa->flag |= ME_SMOOTH; - else if(event==0) efa->flag &= ~ME_SMOOTH; - } - efa= efa->next; - } -} - -/* ********************** mesh rip ********************** */ +/********************** Rip Operator *************************/ /* helper to find edge for edge_rip */ static float mesh_rip_edgedist(ARegion *ar, float mat[][4], float *co1, float *co2, short *mval) @@ -5014,7 +5012,7 @@ void MESH_OT_rip(wmOperatorType *ot) } -/* ************************************** */ +/************************ Shape Operators *************************/ void shape_propagate(Scene *scene, Object *obedit, EditMesh *em, wmOperator *op) { @@ -5205,6 +5203,8 @@ void shape_copy_select_from(Object *obedit, EditMesh *em, wmOperator *op) return; } +/************************ Merge Operator *************************/ + /* Collection Routines|Currently used by the improved merge code*/ /* buildEdge_collection() creates a list of lists*/ /* these lists are filled with edges that are topologically connected.*/ @@ -5695,10 +5695,6 @@ int collapseEdges(EditMesh *em) } freecollections(&allcollections); removedoublesflag(em, 1, 0, MERGELIMIT); - /*get rid of this!*/ -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - -// if (EM_texFaceCheck()) return mergecount; } @@ -5741,6 +5737,7 @@ int merge_target(EditMesh *em, int target, int uvmerge) { EditVert *eve; + // XXX not working if(target) snap_sel_to_curs(); else snap_to_center(); @@ -5751,21 +5748,113 @@ int merge_target(EditMesh *em, int target, int uvmerge) } collapseuvs(em, NULL); } - -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); return removedoublesflag(em, 1, 0, MERGELIMIT); - } #undef MERGELIMIT -typedef struct PathNode{ +static int merge_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *obedit= CTX_data_edit_object(C); + EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); + int count= 0, uvs= RNA_boolean_get(op->ptr, "uvs"); + + switch(RNA_enum_get(op->ptr, "type")) { + case 3: + count = merge_target(em, 0, uvs); + break; + case 4: + count = merge_target(em, 1, uvs); + break; + case 1: + count = merge_firstlast(em, 0, uvs); + break; + case 6: + count = merge_firstlast(em, 1, uvs); + break; + case 2: + count = collapseEdges(em); + break; + } + + if(!count) + return OPERATOR_CANCELLED; + + BKE_reportf(op->reports, RPT_INFO, "Removed %d vertices.", count); + + BKE_mesh_end_editmesh(obedit->data, em); + + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + + return OPERATOR_FINISHED; +} + +static EnumPropertyItem merge_type_items[]= { + {6, "FIRST", 0, "At First", ""}, + {1, "LAST", 0, "At Last", ""}, + {3, "CENTER", 0, "At Center", ""}, + {4, "CURSOR", 0, "At Cursor", ""}, + {5, "COLLAPSE", 0, "Collapse", ""}, + {0, NULL, 0, NULL, NULL}}; + +static EnumPropertyItem *merge_type_itemf(PointerRNA *ptr) +{ + /* XXX need context here */ +#if 0 + Scene *scene= CTX_data_scene(C); + Object *obedit= CTX_data_edit_object(C); + EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); + + if(em->selectmode & SCE_SELECT_VERTEX) + if(em->selected.first && em->selected.last && + ((EditSelection*)em->selected.first)->type == EDITVERT && ((EditSelection*)em->selected.last)->type == EDITVERT) + event = pupmenu("Merge %t|At First %x6|At Last%x1|At Center%x3|At Cursor%x4|Collapse%x2"); + else if (em->selected.first && ((EditSelection*)em->selected.first)->type == EDITVERT) + event = pupmenu("Merge %t|At First %x6|At Center%x3|At Cursor%x4|Collapse%x2"); + else if (em->selected.last && ((EditSelection*)em->selected.last)->type == EDITVERT) + event = pupmenu("Merge %t|At Last %x1|At Center%x3|At Cursor%x4|Collapse%x2"); + else event = pupmenu("Merge %t|At Center%x3|At Cursor%x4|Collapse%x2"); + else event = pupmenu("Merge %t|At Center%x3|At Cursor%x4|Collapse%x2"); + + BKE_mesh_end_editmesh(obedit->data, em); +#endif + + return merge_type_items; +} + +void MESH_OT_merge(wmOperatorType *ot) +{ + PropertyRNA *prop; + + /* identifiers */ + ot->name= "Merge"; + ot->idname= "MESH_OT_merge"; + + /* api callbacks */ + ot->exec= merge_exec; + ot->invoke= WM_menu_invoke; + ot->poll= ED_operator_editmesh; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + prop= RNA_def_enum(ot->srna, "type", merge_type_items, 6, "Type", "Merge method to use."); + RNA_def_enum_funcs(prop, merge_type_itemf); + RNA_def_boolean(ot->srna, "uvs", 0, "UVs", "Move UVs according to merge."); +} + +/************************ Vertex Path Operator *************************/ + +typedef struct PathNode { int u; int visited; ListBase edges; } PathNode; -typedef struct PathEdge{ +typedef struct PathEdge { struct PathEdge *next, *prev; int v; float w; @@ -5957,43 +6046,46 @@ void MESH_OT_select_vertex_path(wmOperatorType *ot) RNA_def_enum(ot->srna, "type", type_items, PATH_SELECT_EDGE_LENGTH, "Type", "Method to compute distance."); } +/********************** Region/Loop Operators *************************/ + static int region_to_loop(bContext *C, wmOperator *op) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); EditEdge *eed; EditFace *efa; + int selected= 0; - if(em->totfacesel){ - for(eed=em->edges.first; eed; eed=eed->next) eed->f1 = 0; - - for(efa=em->faces.first; efa; efa=efa->next){ - if(efa->f&SELECT){ - efa->e1->f1++; - efa->e2->f1++; - efa->e3->f1++; - if(efa->e4) - efa->e4->f1++; - } - } - - EM_clear_flag_all(em, SELECT); - - for(eed=em->edges.first; eed; eed=eed->next){ - if(eed->f1 == 1) EM_select_edge(eed, 1); - } - - em->selectmode = SCE_SELECT_EDGE; - EM_selectmode_set(em); - // DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + for(eed=em->edges.first; eed; eed=eed->next) eed->f1 = 0; + + for(efa=em->faces.first; efa; efa=efa->next){ + if(efa->f&SELECT){ + efa->e1->f1++; + efa->e2->f1++; + efa->e3->f1++; + if(efa->e4) + efa->e4->f1++; -// if (EM_texFaceCheck()) + selected= 1; + } + } + if(!selected) + return OPERATOR_CANCELLED; + + EM_clear_flag_all(em, SELECT); + + for(eed=em->edges.first; eed; eed=eed->next){ + if(eed->f1 == 1) EM_select_edge(eed, 1); } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + em->selectmode = SCE_SELECT_EDGE; + EM_selectmode_set(em); BKE_mesh_end_editmesh(obedit->data, em); + + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + return OPERATOR_FINISHED; } @@ -6165,12 +6257,10 @@ static int loop_to_region(bContext *C, wmOperator *op) } freecollections(&allcollections); -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - -// if (EM_texFaceCheck()) + BKE_mesh_end_editmesh(obedit->data, em); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); + return OPERATOR_FINISHED; } @@ -6188,6 +6278,7 @@ void MESH_OT_loop_to_region(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/********************** UV/Color Operators *************************/ // XXX please check if these functions do what you want them to /* texface and vertex color editmode tools for the face menu */ @@ -6199,26 +6290,24 @@ static int mesh_rotate_uvs(bContext *C, wmOperator *op) EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); EditFace *efa; - short change = 0, ccw; + short change = 0; MTFace *tf; float u1, v1; - int shift = 0; // XXX + int dir= RNA_enum_get(op->ptr, "direction"); if (!EM_texFaceCheck(em)) { - BKE_report(op->reports, RPT_ERROR, "mesh has no uv/image layers"); + BKE_report(op->reports, RPT_ERROR, "Mesh has no uv/image layers."); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } - ccw = (shift); - for(efa=em->faces.first; efa; efa=efa->next) { if (efa->f & SELECT) { tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); u1= tf->uv[0][0]; v1= tf->uv[0][1]; - if (ccw) { + if (dir == DIRECTION_CCW) { if(efa->v4) { tf->uv[0][0]= tf->uv[3][0]; tf->uv[0][1]= tf->uv[3][1]; @@ -6276,23 +6365,21 @@ static int mesh_mirror_uvs(bContext *C, wmOperator *op) EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); EditFace *efa; - short change = 0, altaxis; + short change = 0; MTFace *tf; float u1, v1; - int shift= 0; // XXX + int axis= RNA_enum_get(op->ptr, "axis"); if (!EM_texFaceCheck(em)) { - BKE_report(op->reports, RPT_ERROR, "mesh has no uv/image layers"); + BKE_report(op->reports, RPT_ERROR, "Mesh has no uv/image layers."); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } - altaxis = (shift); - for(efa=em->faces.first; efa; efa=efa->next) { if (efa->f & SELECT) { tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (altaxis) { + if (axis == AXIS_Y) { u1= tf->uv[1][0]; v1= tf->uv[1][1]; if(efa->v4) { @@ -6368,24 +6455,22 @@ static int mesh_rotate_colors(bContext *C, wmOperator *op) EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); EditFace *efa; - short change = 0, ccw; + short change = 0; MCol tmpcol, *mcol; - int shift= 0; // XXX + int dir= RNA_enum_get(op->ptr, "direction"); if (!EM_vertColorCheck(em)) { - BKE_report(op->reports, RPT_ERROR, "mesh has no color layers"); + BKE_report(op->reports, RPT_ERROR, "Mesh has no color layers."); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } - ccw = (shift); - for(efa=em->faces.first; efa; efa=efa->next) { if (efa->f & SELECT) { mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); tmpcol= mcol[0]; - if (ccw) { + if (dir == DIRECTION_CCW) { if(efa->v4) { mcol[0]= mcol[3]; mcol[3]= mcol[2]; @@ -6428,9 +6513,9 @@ static int mesh_mirror_colors(bContext *C, wmOperator *op) EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); EditFace *efa; - short change = 0, altaxis; + short change = 0; MCol tmpcol, *mcol; - int shift= 0; // XXX + int axis= RNA_enum_get(op->ptr, "axis"); if (!EM_vertColorCheck(em)) { BKE_report(op->reports, RPT_ERROR, "Mesh has no color layers"); @@ -6438,12 +6523,10 @@ static int mesh_mirror_colors(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - altaxis = (shift); - for(efa=em->faces.first; efa; efa=efa->next) { if (efa->f & SELECT) { mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); - if (altaxis) { + if (axis == AXIS_Y) { tmpcol= mcol[1]; mcol[1]= mcol[2]; mcol[2]= tmpcol; @@ -6491,6 +6574,9 @@ void MESH_OT_uvs_rotate(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* props */ + RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate UVs around."); } void MESH_OT_uvs_mirror(wmOperatorType *ot) @@ -6505,6 +6591,9 @@ void MESH_OT_uvs_mirror(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* props */ + RNA_def_enum(ot->srna, "axis", axis_items, DIRECTION_CW, "Axis", "Axis to mirror UVs around."); } void MESH_OT_colors_rotate(wmOperatorType *ot) @@ -6519,6 +6608,9 @@ void MESH_OT_colors_rotate(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* props */ + RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate edge around."); } void MESH_OT_colors_mirror(wmOperatorType *ot) @@ -6533,22 +6625,34 @@ void MESH_OT_colors_mirror(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* props */ + RNA_def_enum(ot->srna, "axis", axis_items, DIRECTION_CW, "Axis", "Axis to mirror colors around."); } +/********************** Subdivide Operator *************************/ + static int subdivide_exec(bContext *C, wmOperator *op) -{ +{ Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - - esubdivideflag(obedit, em, 1, 0.0, scene->toolsettings->editbutflag, 1, 0); - - BKE_mesh_end_editmesh(obedit->data, em); + int cuts= RNA_int_get(op->ptr,"number_cuts"); + float smooth= 0.292f*RNA_float_get(op->ptr, "smoothness"); + float fractal= RNA_float_get(op->ptr, "fractal")/100; + int flag= 0; + + if(smooth != 0.0f) + flag |= B_SMOOTH; + if(fractal != 0.0f) + flag |= B_FRACTAL; + + esubdivideflag(obedit, em, 1, smooth, fractal, scene->toolsettings->editbutflag|flag, cuts, 0); DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - return OPERATOR_FINISHED; + return OPERATOR_FINISHED; } void MESH_OT_subdivide(wmOperatorType *ot) @@ -6563,173 +6667,14 @@ void MESH_OT_subdivide(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; -} - -static int subdivide_multi_exec(bContext *C, wmOperator *op) -{ - Scene *scene = CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - - esubdivideflag(obedit, em, 1, 0.0, scene->toolsettings->editbutflag, RNA_int_get(op->ptr,"number_cuts"), 0); - - BKE_mesh_end_editmesh(obedit->data, em); - - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - - return OPERATOR_FINISHED; -} - -void MESH_OT_subdivide_multi(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Subdivide Multi"; - ot->idname= "MESH_OT_subdivide_multi"; - - /* api callbacks */ - ot->exec= subdivide_multi_exec; - ot->poll= ED_operator_editmesh; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /* props */ - RNA_def_int(ot->srna, "number_cuts", 4, 1, 100, "Number of Cuts", "", 1, INT_MAX); -} - -static int subdivide_multi_fractal_exec(bContext *C, wmOperator *op) -{ - Scene *scene = CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - - esubdivideflag(obedit, em, 1, -(RNA_float_get(op->ptr, "random_factor")/100), scene->toolsettings->editbutflag, RNA_int_get(op->ptr, "number_cuts"), 0); - - BKE_mesh_end_editmesh(obedit->data, em); - - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - - return OPERATOR_FINISHED; -} - -void MESH_OT_subdivide_multi_fractal(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Subdivide Multi Fractal"; - ot->idname= "MESH_OT_subdivide_multi_fractal"; - - /* api callbacks */ - ot->exec= subdivide_multi_fractal_exec; - ot->poll= ED_operator_editmesh; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_int(ot->srna, "number_cuts", 4, 1, 100, "Number of Cuts", "", 1, INT_MAX); - RNA_def_float(ot->srna, "random_factor", 5.0, 0.0f, FLT_MAX, "Random Factor", "", 0.0f, 1000.0f); + RNA_def_int(ot->srna, "number_cuts", 1, 1, 10, "Number of Cuts", "", 1, INT_MAX); + RNA_def_float(ot->srna, "fractal", 0.0, 0.0f, FLT_MAX, "Fractal", "Fractal randomness factor.", 0.0f, 1000.0f); + RNA_def_float(ot->srna, "smoothness", 0.0f, 0.0f, 1000.0f, "Smoothness", "Smoothness factor.", 0.0f, FLT_MAX); } -static int subdivide_smooth_exec(bContext *C, wmOperator *op) -{ - Scene *scene = CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - - esubdivideflag(obedit, em, 1, 0.292f*RNA_float_get(op->ptr, "smoothness"), scene->toolsettings->editbutflag | B_SMOOTH, 1, 0); - - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - - return OPERATOR_FINISHED; -} - -void MESH_OT_subdivide_smooth(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Subdivide Smooth"; - ot->idname= "MESH_OT_subdivide_smooth"; - - /* api callbacks */ - ot->exec= subdivide_smooth_exec; - ot->poll= ED_operator_editmesh; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /* props */ - RNA_def_float(ot->srna, "smoothness", 1.0f, 0.0f, 1000.0f, "Smoothness", "", 0.0f, FLT_MAX); -} - -static int subdivs_invoke(bContext *C, wmOperator *op, wmEvent *event) -{ - uiPopupMenu *pup; - uiLayout *layout; - - pup= uiPupMenuBegin(C, "Subdivision Type", 0); - layout= uiPupMenuLayout(pup); - uiItemsEnumO(layout, "MESH_OT_subdivs", "type"); - uiPupMenuEnd(C, pup); - - return OPERATOR_CANCELLED; -} - -static int subdivs_exec(bContext *C, wmOperator *op) -{ - switch(RNA_int_get(op->ptr, "type")) - { - case 0: // simple - subdivide_exec(C,op); - break; - case 1: // multi - subdivide_multi_exec(C,op); - break; - case 2: // fractal; - subdivide_multi_fractal_exec(C,op); - break; - case 3: //smooth - subdivide_smooth_exec(C,op); - break; - } - - return OPERATOR_FINISHED; -} - -void MESH_OT_subdivs(wmOperatorType *ot) -{ - static EnumPropertyItem type_items[]= { - {0, "SIMPLE", 0, "Simple", ""}, - {1, "MULTI", 0, "Multi", ""}, - {2, "FRACTAL", 0, "Fractal", ""}, - {3, "SMOOTH", 0, "Smooth", ""}, - {0, NULL, 0, NULL, NULL}}; - - /* identifiers */ - ot->name= "subdivs"; - ot->idname= "MESH_OT_subdivs"; - - /* api callbacks */ - ot->invoke= subdivs_invoke; - ot->exec= subdivs_exec; - - ot->poll= ED_operator_editmesh; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /*props */ - RNA_def_enum(ot->srna, "type", type_items, 0, "Type", ""); - - /* this is temp, the ops are different, but they are called from subdivs, so all the possible props should be here as well*/ - RNA_def_int(ot->srna, "number_cuts", 4, 1, 10, "Number of Cuts", "", 1, INT_MAX); - RNA_def_float(ot->srna, "random_factor", 5.0, 0.0f, FLT_MAX, "Random Factor", "", 0.0f, 1000.0f); - RNA_def_float(ot->srna, "smoothness", 1.0f, 0.0f, 1000.0f, "Smoothness", "", 0.0f, FLT_MAX); - -} - -/* ************************************* */ +/********************** Fill Operators *************************/ /* note; the EM_selectmode_set() calls here illustrate how badly constructed it all is... from before the edge/face flags, with very mixed results.... */ @@ -6975,7 +6920,6 @@ static void fill_mesh(EditMesh *em) } - static int fill_mesh_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); @@ -6996,7 +6940,7 @@ static int fill_mesh_exec(bContext *C, wmOperator *op) void MESH_OT_fill(wmOperatorType *ot) { /* identifiers */ - ot->name= "Fill Mesh"; + ot->name= "Fill"; ot->idname= "MESH_OT_fill"; /* api callbacks */ @@ -7037,6 +6981,8 @@ void MESH_OT_beauty_fill(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/********************** Quad/Tri Operators *************************/ + static int quads_convert_to_tris_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); @@ -7124,13 +7070,29 @@ void MESH_OT_edge_flip(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/********************** Smooth/Solid Operators *************************/ + +void mesh_set_smooth_faces(EditMesh *em, short smooth) +{ + EditFace *efa; + + if(em==NULL) return; + + for(efa= em->faces.first; efa; efa=efa->next) { + if(efa->f & SELECT) { + if(smooth) efa->flag |= ME_SMOOTH; + else efa->flag &= ~ME_SMOOTH; + } + } +} + static int mesh_faces_shade_smooth_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - mesh_set_smooth_faces(em,1); + mesh_set_smooth_faces(em, 1); BKE_mesh_end_editmesh(obedit->data, em); @@ -7143,7 +7105,7 @@ static int mesh_faces_shade_smooth_exec(bContext *C, wmOperator *op) void MESH_OT_faces_shade_smooth(wmOperatorType *ot) { /* identifiers */ - ot->name= "Smooth Face Shading"; + ot->name= "Shade Smooth"; ot->idname= "MESH_OT_faces_shade_smooth"; /* api callbacks */ @@ -7160,7 +7122,7 @@ static int mesh_faces_shade_solid_exec(bContext *C, wmOperator *op) Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - mesh_set_smooth_faces(em,0); + mesh_set_smooth_faces(em, 0); DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); @@ -7171,7 +7133,7 @@ static int mesh_faces_shade_solid_exec(bContext *C, wmOperator *op) void MESH_OT_faces_shade_solid(wmOperatorType *ot) { /* identifiers */ - ot->name= "Flat Face Shading"; + ot->name= "Shade Flat"; ot->idname= "MESH_OT_faces_shade_solid"; /* api callbacks */ diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 4d71ddbd647..6e098e04a14 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -85,7 +85,7 @@ void MESH_OT_primitive_ico_sphere_add(struct wmOperatorType *ot); void MESH_OT_edge_face_add(struct wmOperatorType *ot); void MESH_OT_dupli_extrude_cursor(struct wmOperatorType *ot); -void MESH_OT_duplicate_add(struct wmOperatorType *ot); +void MESH_OT_duplicate(struct wmOperatorType *ot); void MESH_OT_fgon_make(struct wmOperatorType *ot); void MESH_OT_fgon_clear(struct wmOperatorType *ot); @@ -151,7 +151,7 @@ void MESH_OT_loop_select(struct wmOperatorType *ot); void MESH_OT_select_all_toggle(struct wmOperatorType *ot); void MESH_OT_select_more(struct wmOperatorType *ot); void MESH_OT_select_less(struct wmOperatorType *ot); -void MESH_OT_select_invert(struct wmOperatorType *ot); +void MESH_OT_select_inverse(struct wmOperatorType *ot); void MESH_OT_select_non_manifold(struct wmOperatorType *ot); void MESH_OT_select_linked(struct wmOperatorType *ot); void MESH_OT_select_linked_pick(struct wmOperatorType *ot); @@ -170,7 +170,7 @@ void MESH_OT_loop_multi_select(struct wmOperatorType *ot); void MESH_OT_mark_seam(struct wmOperatorType *ot); void MESH_OT_mark_sharp(struct wmOperatorType *ot); void MESH_OT_vertices_smooth(struct wmOperatorType *ot); -void MESH_OT_flip_editnormals(struct wmOperatorType *ot); +void MESH_OT_flip_normals(struct wmOperatorType *ot); extern EditEdge *findnearestedge(ViewContext *vc, int *dist); extern void EM_automerge(int update); @@ -201,14 +201,11 @@ extern EditVert *findnearestvert(ViewContext *vc, int *dist, short sel, short st void join_triangles(EditMesh *em); int removedoublesflag(EditMesh *em, short flag, short automerge, float limit); /* return amount */ -void esubdivideflag(Object *obedit, EditMesh *em, int flag, float rad, int beauty, int numcuts, int seltype); +void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float fractal, int beauty, int numcuts, int seltype); int EdgeSlide(EditMesh *em, wmOperator *op, short immediate, float imperc); +void MESH_OT_merge(struct wmOperatorType *ot); void MESH_OT_subdivide(struct wmOperatorType *ot); -void MESH_OT_subdivs(struct wmOperatorType *ot); -void MESH_OT_subdivide_multi(struct wmOperatorType *ot); -void MESH_OT_subdivide_multi_fractal(struct wmOperatorType *ot); -void MESH_OT_subdivide_smooth(struct wmOperatorType *ot); void MESH_OT_remove_doubles(struct wmOperatorType *ot); void MESH_OT_extrude(struct wmOperatorType *ot); void MESH_OT_spin(struct wmOperatorType *ot); diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 64fcfb681ed..6bc2f240859 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -59,18 +59,181 @@ #include "ED_transform.h" #include "ED_view3d.h" +#include "UI_interface.h" + #include "mesh_intern.h" +/******************************** menus *************************************/ + +static int vertex_specials_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + uiPopupMenu *pup; + uiLayout *layout; + + pup= uiPupMenuBegin(C, "Vertex Specials", 0); + layout= uiPupMenuLayout(pup); + uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN); + + uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles"); + uiItemO(layout, "Merge...", 0, "MESH_OT_merge"); // mergmenu(em) + uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth"); + uiItemO(layout, "Select Vertex Path", 0, "MESH_OT_select_vertex_path"); + //uiItemO(layout, "Blend From Shape", 0, "MESH_OT_blend_from_shape"); + //uiItemO(layout, "Propagate to All Shapes", 0, "MESH_OT_shape_propagate_to_all"); + + uiPupMenuEnd(C, pup); + + return OPERATOR_CANCELLED; +} + +static void MESH_OT_vertex_specials(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Vertex Specials"; + ot->idname= "MESH_OT_vertex_specials"; + + /* api callbacks */ + ot->invoke= vertex_specials_invoke; + ot->poll= ED_operator_editmesh; +} + +static int edge_specials_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + uiPopupMenu *pup; + uiLayout *layout; + + pup= uiPupMenuBegin(C, "Edge Specials", 0); + layout= uiPupMenuLayout(pup); + uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN); + + uiItemO(layout, "Mark Seam", 0, "MESH_OT_mark_seam"); + uiItemBooleanO(layout, "Clear Seam", 0, "MESH_OT_mark_seam", "clear", 1); + uiItemEnumO(layout, "Rotate Edge CW", 0, "MESH_OT_edge_rotate", "direction", 1); + uiItemEnumO(layout, "Rotate Edge CCW", 0, "MESH_OT_edge_rotate", "direction", 2); + //uiItemO(layout, "Loopcut", 0, "MESH_OT_loop_cut"); // CutEdgeloop(em, 1); + //uiItemO(layout, "Edge Slide", 0, "MESH_OT_edge_slide"); // EdgeSlide(em, 0,0.0); + uiItemO(layout, "Edge Loop", 0, "MESH_OT_loop_multi_select"); + uiItemBooleanO(layout, "Edge Ring", 0, "MESH_OT_loop_multi_select", "ring", 1); + uiItemO(layout, NULL, 0, "MESH_OT_loop_to_region"); + uiItemO(layout, NULL, 0, "MESH_OT_region_to_loop"); + uiItemO(layout, "Mark Sharp", 0, "MESH_OT_mark_sharp"); + uiItemBooleanO(layout, "Clear Sharp", 0, "MESH_OT_mark_sharp", "clear", 1); + + uiPupMenuEnd(C, pup); + + return OPERATOR_CANCELLED; +} + +static void MESH_OT_edge_specials(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Edge Specials"; + ot->idname= "MESH_OT_edge_specials"; + + /* api callbacks */ + ot->invoke= edge_specials_invoke; + ot->poll= ED_operator_editmesh; +} + +static int face_specials_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + uiPopupMenu *pup; + uiLayout *layout; + + pup= uiPupMenuBegin(C, "Face Specials", 0); + layout= uiPupMenuLayout(pup); + uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN); + + uiItemO(layout, NULL, 0, "MESH_OT_flip_normals"); + // uiItemO(layout, "Bevel", 0, "MESH_OT_bevel"); // bevelmenu(em) + uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_smooth"); + uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_solid"); + uiItemO(layout, NULL, 0, "MESH_OT_quads_convert_to_tris"); + uiItemO(layout, NULL, 0, "MESH_OT_tris_convert_to_quads"); + uiItemO(layout, NULL, 0, "MESH_OT_edge_flip"); + uiItemS(layout); -/* ************************** registration **********************************/ + uiItemO(layout, NULL, 0, "MESH_OT_fill"); + uiItemO(layout, NULL, 0, "MESH_OT_beauty_fill"); + + uiItemS(layout); + + // uiItemO(layout, NULL, 0, "MESH_OT_face_mode"); // mesh_set_face_flags(em, 1); + // uiItemBooleanO(layout, NULL, 0, "MESH_OT_face_mode", "clear", 1); // mesh_set_face_flags(em, 0); + // + // uiItemS(layout); + + uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_uvs_rotate", "direction"); + uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_uvs_mirror", "axis"); + uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_colors_rotate", "direction"); + uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_colors_mirror", "axis"); + + uiPupMenuEnd(C, pup); + + return OPERATOR_CANCELLED; +} + +static void MESH_OT_face_specials(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Face Specials"; + ot->idname= "MESH_OT_face_specials"; + + /* api callbacks */ + ot->invoke= face_specials_invoke; + ot->poll= ED_operator_editmesh; +} + +static int specials_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + uiPopupMenu *pup; + uiLayout *layout; + + pup= uiPupMenuBegin(C, "Specials", 0); + layout= uiPupMenuLayout(pup); + uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN); + + uiItemO(layout, "Subdivide", 0, "MESH_OT_subdivide"); + uiItemFloatO(layout, "Subdivide Smooth", 0, "MESH_OT_subdivide", "smoothness", 1.0f); + uiItemO(layout, "Merge...", 0, "MESH_OT_merge"); + uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles"); + uiItemO(layout, "Hide", 0, "MESH_OT_hide"); + uiItemO(layout, "Reveal", 0, "MESH_OT_reveal"); + uiItemO(layout, "Select Inverse", 0, "MESH_OT_select_inverse"); + uiItemO(layout, NULL, 0, "MESH_OT_flip_normals"); + uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth"); + // uiItemO(layout, "Bevel", 0, "MESH_OT_bevel"); // bevelmenu(em) + uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_smooth"); + uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_solid"); + //uiItemO(layout, "Blend From Shape", 0, "MESH_OT_blend_from_shape"); + //uiItemO(layout, "Propagate to All Shapes", 0, "MESH_OT_shape_propagate_to_all"); + uiItemO(layout, "Select Vertex Path", 0, "MESH_OT_select_vertex_path"); + + uiPupMenuEnd(C, pup); + + return OPERATOR_CANCELLED; +} + +static void MESH_OT_specials(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Specials"; + ot->idname= "MESH_OT_specials"; + + /* api callbacks */ + ot->invoke= specials_invoke; + ot->poll= ED_operator_editmesh; +} + +/**************************** registration **********************************/ void ED_operatortypes_mesh(void) { WM_operatortype_append(MESH_OT_select_all_toggle); WM_operatortype_append(MESH_OT_select_more); WM_operatortype_append(MESH_OT_select_less); - WM_operatortype_append(MESH_OT_select_invert); + WM_operatortype_append(MESH_OT_select_inverse); WM_operatortype_append(MESH_OT_select_non_manifold); WM_operatortype_append(MESH_OT_select_linked); WM_operatortype_append(MESH_OT_select_linked_pick); @@ -80,11 +243,8 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_reveal); WM_operatortype_append(MESH_OT_select_by_number_vertices); WM_operatortype_append(MESH_OT_normals_make_consistent); + WM_operatortype_append(MESH_OT_merge); WM_operatortype_append(MESH_OT_subdivide); - WM_operatortype_append(MESH_OT_subdivide_multi); - WM_operatortype_append(MESH_OT_subdivide_multi_fractal); - WM_operatortype_append(MESH_OT_subdivide_smooth); - WM_operatortype_append(MESH_OT_subdivs); WM_operatortype_append(MESH_OT_faces_select_linked_flat); WM_operatortype_append(MESH_OT_edges_select_sharp); WM_operatortype_append(MESH_OT_primitive_plane_add); @@ -99,7 +259,7 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_primitive_ico_sphere_add); WM_operatortype_append(MESH_OT_fgon_clear); WM_operatortype_append(MESH_OT_fgon_make); - WM_operatortype_append(MESH_OT_duplicate_add); + WM_operatortype_append(MESH_OT_duplicate); WM_operatortype_append(MESH_OT_remove_doubles); WM_operatortype_append(MESH_OT_extrude); WM_operatortype_append(MESH_OT_spin); @@ -138,7 +298,7 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_mark_seam); WM_operatortype_append(MESH_OT_mark_sharp); WM_operatortype_append(MESH_OT_vertices_smooth); - WM_operatortype_append(MESH_OT_flip_editnormals); + WM_operatortype_append(MESH_OT_flip_normals); WM_operatortype_append(MESH_OT_knife_cut); WM_operatortype_append(MESH_OT_rip); @@ -148,6 +308,11 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_vertex_color_remove); WM_operatortype_append(MESH_OT_sticky_add); WM_operatortype_append(MESH_OT_sticky_remove); + + WM_operatortype_append(MESH_OT_vertex_specials); + WM_operatortype_append(MESH_OT_edge_specials); + WM_operatortype_append(MESH_OT_face_specials); + WM_operatortype_append(MESH_OT_specials); } /* note mesh keymap also for other space? */ @@ -172,7 +337,7 @@ void ED_keymap_mesh(wmWindowManager *wm) WM_keymap_add_item(keymap, "MESH_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "MESH_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "MESH_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "MESH_OT_select_invert", IKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "MESH_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "MESH_OT_select_non_manifold", MKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0); WM_keymap_add_item(keymap, "MESH_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0); @@ -184,12 +349,6 @@ void ED_keymap_mesh(wmWindowManager *wm) WM_keymap_add_item(keymap, "MESH_OT_vertices_transform_to_sphere", SKEY, KM_PRESS, KM_CTRL|KM_SHIFT , 0); - WM_keymap_add_item(keymap, "MESH_OT_mark_seam", ONEKEY, KM_PRESS, KM_CTRL , 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_mark_seam", ONEKEY, KM_PRESS, KM_ALT , 0)->ptr,"clear",1); - - WM_keymap_add_item(keymap, "MESH_OT_mark_sharp", TWOKEY, KM_PRESS, KM_CTRL , 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_mark_sharp", TWOKEY, KM_PRESS, KM_ALT , 0)->ptr,"set",1); - WM_keymap_add_item(keymap, "MESH_OT_select_similar", GKEY, KM_PRESS, KM_SHIFT, 0); /* selection mode */ @@ -203,24 +362,17 @@ void ED_keymap_mesh(wmWindowManager *wm) /* tools */ WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_CTRL, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "inside", 1); - WM_keymap_add_item(keymap, "MESH_OT_vertices_smooth", THREEKEY, KM_PRESS, KM_CTRL , 0); - WM_keymap_add_item(keymap, "MESH_OT_flip_editnormals", THREEKEY, KM_PRESS, KM_ALT , 0); - WM_keymap_add_item(keymap, "MESH_OT_subdivs", WKEY, KM_PRESS, 0, 0); // this is the menu - /*WM_keymap_add_item(keymap, "MESH_OT_subdivide_multi", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); - WM_keymap_add_item(keymap, "MESH_OT_subdivide_multi_fractal", WKEY, KM_PRESS, KM_ALT, 0); - WM_keymap_add_item(keymap, "MESH_OT_subdivide_smooth", WKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);*/ - WM_keymap_add_item(keymap, "MESH_OT_remove_doubles", VKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "MESH_OT_extrude", EKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "MESH_OT_spin", RKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "MESH_OT_screw", NINEKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "VIEW3D_OT_editmesh_face_toolbox", FKEY, KM_PRESS, KM_CTRL, 0); /* operators below are in this toolbox */ WM_keymap_add_item(keymap, "MESH_OT_fill", FKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "MESH_OT_beauty_fill", FKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "MESH_OT_tris_convert_to_quads", JKEY, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "MESH_OT_edge_flip", FKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); WM_keymap_add_item(keymap, "MESH_OT_split", FOURKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "MESH_OT_extrude_repeat", FOURKEY, KM_PRESS, KM_ALT, 0); @@ -238,7 +390,7 @@ void ED_keymap_mesh(wmWindowManager *wm) /* add/remove */ WM_keymap_add_item(keymap, "MESH_OT_edge_face_add", FKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "MESH_OT_duplicate_add", DKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "MESH_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "OBJECT_OT_mesh_add", AKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "MESH_OT_separate", PKEY, KM_PRESS, KM_SHIFT, 0); /* use KM_RELEASE because same key is used for tweaks */ @@ -250,6 +402,12 @@ void ED_keymap_mesh(wmWindowManager *wm) WM_keymap_add_item(keymap, "MESH_OT_fgon_clear", FKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0); WM_keymap_add_item(keymap, "MESH_OT_knife_cut", LEFTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0); + + /* menus */ + WM_keymap_add_item(keymap, "MESH_OT_vertex_specials", VKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "MESH_OT_edge_specials", EKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "MESH_OT_face_specials", FKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "MESH_OT_specials", WKEY, KM_PRESS, 0, 0); /* UV's */ WM_keymap_add_item(keymap, "UV_OT_mapping_menu", UKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index b2040d328f2..f8e03e74f24 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1732,7 +1732,7 @@ void OBJECT_OT_select_by_layer(wmOperatorType *ot) } /* ****** invert selection *******/ -static int object_select_invert_exec(bContext *C, wmOperator *op) +static int object_select_inverse_exec(bContext *C, wmOperator *op) { CTX_DATA_BEGIN(C, Base*, base, visible_bases) { if (base->flag & SELECT) @@ -1748,16 +1748,16 @@ static int object_select_invert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void OBJECT_OT_select_invert(wmOperatorType *ot) +void OBJECT_OT_select_inverse(wmOperatorType *ot) { /* identifiers */ - ot->name= "Invert selection"; - ot->description = "Invert th select of all visible objects."; - ot->idname= "OBJECT_OT_select_invert"; + ot->name= "Select Inverse"; + ot->description = "Invert selection of all visible objects."; + ot->idname= "OBJECT_OT_select_inverse"; /* api callbacks */ - ot->exec= object_select_invert_exec; + ot->exec= object_select_inverse_exec; ot->poll= ED_operator_scene_editable; /* flags */ @@ -3772,144 +3772,8 @@ void special_editmenu(Scene *scene, View3D *v3d) } } else if(obedit->type==OB_MESH) { - /* This is all that is needed, since all other functionality is in Ctrl+ V/E/F but some users didnt like, so for now have the old/big menu */ - /* - nr= pupmenu("Subdivide Mesh%t|Subdivide%x1|Subdivide Multi%x2|Subdivide Multi Fractal%x3|Subdivide Smooth%x4"); - switch(nr) { - case 1: - waitcursor(1); - esubdivideflag(1, 0.0, scene->toolsettings->editbutflag, 1, 0); - - break; - case 2: - if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; - waitcursor(1); - esubdivideflag(1, 0.0, scene->toolsettings->editbutflag, numcuts, 0); - break; - case 3: - if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; - randfac= 10; - if(button(&randfac, 1, 100, "Rand fac:")==0) return; - waitcursor(1); - fac= -( (float)randfac )/100; - esubdivideflag(1, fac, scene->toolsettings->editbutflag, numcuts, 0); - break; - - case 4: - fac= 1.0f; - if(fbutton(&fac, 0.0f, 5.0f, 10, 10, "Smooth:")==0) return; - fac= 0.292f*fac; - - waitcursor(1); - esubdivideflag(1, fac, scene->toolsettings->editbutflag | B_SMOOTH, 1, 0); - break; - } - */ - - nr= pupmenu("Specials%t|Subdivide%x1|Subdivide Multi%x2|Subdivide Multi Fractal%x3|Subdivide Smooth%x12|Merge%x4|Remove Doubles%x5|Hide%x6|Reveal%x7|Select Swap%x8|Flip Normals %x9|Smooth %x10|Bevel %x11|Set Smooth %x14|Set Solid %x15|Blend From Shape%x16|Propagate To All Shapes%x17|Select Vertex Path%x18"); - - switch(nr) { - case 1: - waitcursor(1); -// XXX esubdivideflag(1, 0.0, scene->toolsettings->editbutflag, 1, 0); - - break; - case 2: -// XXX if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; - waitcursor(1); -// XXX esubdivideflag(1, 0.0, scene->toolsettings->editbutflag, numcuts, 0); - break; - case 3: -// XXX if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; - randfac= 10; -// XXX if(button(&randfac, 1, 100, "Rand fac:")==0) return; - waitcursor(1); - fac= -( (float)randfac )/100; -// XXX esubdivideflag(1, fac, scene->toolsettings->editbutflag, numcuts, 0); - break; - - case 12: /* smooth */ - /* if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; */ - fac= 1.0f; -// XXX if(fbutton(&fac, 0.0f, 5.0f, 10, 10, "Smooth:")==0) return; -// XXX fac= 0.292f*fac; - - waitcursor(1); -// XXX esubdivideflag(1, fac, scene->toolsettings->editbutflag | B_SMOOTH, 1, 0); - break; - - case 4: -// XXX mergemenu(); - break; - case 5: -// XXX notice("Removed %d Vertices", removedoublesflag(1, 0, scene->toolsettings->doublimit)); - break; - case 6: -// XXX hide_mesh(0); - break; - case 7: -// XXX reveal_mesh(); - break; - case 8: -// XXX selectswap_mesh(); - break; - case 9: -// XXX flip_editnormals(); - break; - case 10: -// XXX vertexsmooth(); - break; - case 11: -// XXX bevel_menu(); - break; - case 14: -// XXX mesh_set_smooth_faces(1); - break; - case 15: -// XXX mesh_set_smooth_faces(0); - break; - case 16: -// XXX shape_copy_select_from(); - break; - case 17: -// XXX shape_propagate(); - break; - case 18: -// XXX pathselect(); - break; - } - - - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - - if(nr>0) waitcursor(0); - } else if(ELEM(obedit->type, OB_CURVE, OB_SURF)) { - - nr= pupmenu("Specials%t|Subdivide%x1|Switch Direction%x2|Set Goal Weight%x3|Set Radius%x4|Smooth%x5|Smooth Radius%x6"); - - switch(nr) { - case 1: -// XXX subdivideNurb(); - break; - case 2: -// XXX switchdirectionNurb2(); - break; - case 3: -// XXX setweightNurb(); - break; - case 4: -// XXX setradiusNurb(); - break; - case 5: -// XXX smoothNurb(); - break; - case 6: -// XXX smoothradiusNurb(); - break; - } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); } else if(obedit->type==OB_ARMATURE) { nr= pupmenu("Specials%t|Subdivide %x1|Subdivide Multi%x2|Switch Direction%x7|Flip Left-Right Names%x3|%l|AutoName Left-Right%x4|AutoName Front-Back%x5|AutoName Top-Bottom%x6"); diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index f7bdf5da924..0948bfa405b 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -45,7 +45,7 @@ void OBJECT_OT_parent_clear(struct wmOperatorType *ot); void OBJECT_OT_track_set(struct wmOperatorType *ot); void OBJECT_OT_track_clear(struct wmOperatorType *ot); void OBJECT_OT_select_all_toggle(struct wmOperatorType *ot); -void OBJECT_OT_select_invert(struct wmOperatorType *ot); +void OBJECT_OT_select_inverse(struct wmOperatorType *ot); void OBJECT_OT_select_random(struct wmOperatorType *ot); void OBJECT_OT_select_by_type(struct wmOperatorType *ot); void OBJECT_OT_select_by_layer(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 37e9a2e75ff..3710271bd20 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -68,7 +68,7 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_parent_clear); WM_operatortype_append(OBJECT_OT_track_set); WM_operatortype_append(OBJECT_OT_track_clear); - WM_operatortype_append(OBJECT_OT_select_invert); + WM_operatortype_append(OBJECT_OT_select_inverse); WM_operatortype_append(OBJECT_OT_select_random); WM_operatortype_append(OBJECT_OT_select_all_toggle); WM_operatortype_append(OBJECT_OT_select_by_type); @@ -139,7 +139,7 @@ void ED_keymap_object(wmWindowManager *wm) keymap= WM_keymap_listbase(wm, "Object Mode", 0, 0); WM_keymap_add_item(keymap, "OBJECT_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "OBJECT_OT_select_invert", IKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "OBJECT_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "OBJECT_OT_select_random", PADASTERKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "OBJECT_OT_select_by_type", PADASTERKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "OBJECT_OT_select_by_layer", PADASTERKEY, KM_PRESS, KM_ALT, 0); diff --git a/source/blender/editors/space_image/image_header.c b/source/blender/editors/space_image/image_header.c index a902ec27a87..35088f0e4d1 100644 --- a/source/blender/editors/space_image/image_header.c +++ b/source/blender/editors/space_image/image_header.c @@ -86,95 +86,6 @@ #define B_SIMA_RECORD 8 #define B_SIMA_PLAY 9 -static void image_view_viewnavmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - int a; - - uiItemO(layout, NULL, 0, "IMAGE_OT_view_zoom_in"); - uiItemO(layout, NULL, 0, "IMAGE_OT_view_zoom_out"); - - uiItemS(layout); - - for(a=0; a<7; a++) { - const int ratios[7][2] = {{1, 8}, {1, 4}, {1, 2}, {1, 1}, {2, 1}, {4, 1}, {8, 1}}; - char namestr[128]; - - sprintf(namestr, "Zoom %d:%d", ratios[a][0], ratios[a][1]); - uiItemFloatO(layout, namestr, 0, "IMAGE_OT_view_zoom_ratio", "ratio", (float)ratios[a][0]/(float)ratios[a][1]); - } -} - -#if 0 -static void do_viewmenu(bContext *C, void *arg, int event) -{ - add_blockhandler(curarea, IMAGE_HANDLER_VIEW_PROPERTIES, UI_PNL_UNSTOW); - add_blockhandler(curarea, IMAGE_HANDLER_PROPERTIES, UI_PNL_UNSTOW); - add_blockhandler(curarea, IMAGE_HANDLER_PAINT, UI_PNL_UNSTOW); - add_blockhandler(curarea, IMAGE_HANDLER_CURVES, UI_PNL_UNSTOW); - - toggle_blockhandler(curarea, IMAGE_HANDLER_PREVIEW, 0); - scrarea_queue_winredraw(curarea); - - add_blockhandler(curarea, IMAGE_HANDLER_GAME_PROPERTIES, UI_PNL_UNSTOW); - add_blockhandler(curarea, IMAGE_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW); - - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWVIEW3D, 0); -} -#endif - -static void image_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - bScreen *sc= CTX_wm_screen(C); - ScrArea *sa= CTX_wm_area(C); - SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); - PointerRNA spaceptr, uvptr; - int show_paint, show_render, show_uvedit; - - /* retrieve state */ - RNA_pointer_create(&sc->id, &RNA_SpaceImageEditor, sima, &spaceptr); - RNA_pointer_create(&sc->id, &RNA_SpaceUVEditor, sima, &uvptr); - - show_render= ED_space_image_show_render(sima); - show_paint= ED_space_image_show_paint(sima); - show_uvedit= ED_space_image_show_uvedit(sima, CTX_data_edit_object(C)); - - /* create menu */ - uiItemO(layout, NULL, ICON_MENU_PANEL, "IMAGE_OT_properties"); - //if(show_render) uiItemO(layout, NULL, ICON_MENU_PANEL, "IMAGE_OT_toggle_compositing_preview_panel"); // Compositing Preview...|Shift P - - uiItemS(layout); - - uiItemR(layout, NULL, 0, &spaceptr, "update_automatically", 0, 0, 0); - // XXX if(show_uvedit) uiItemR(layout, NULL, 0, &uvptr, "local_view", 0, 0, 0); // "UV Local View", Numpad / - - uiItemS(layout); - - uiItemMenuF(layout, "View Navigation", 0, image_view_viewnavmenu); - if(show_uvedit) uiItemO(layout, NULL, 0, "IMAGE_OT_view_selected"); - uiItemO(layout, NULL, 0, "IMAGE_OT_view_all"); - - if(sa->full) uiItemO(layout, NULL, 0, "SCREEN_OT_screen_full_area"); // "Tile Window", Ctrl UpArrow - else uiItemO(layout, NULL, 0, "SCREEN_OT_screen_full_area"); // "Maximize Window", Ctr DownArrow -} - -static void image_selectmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "UV_OT_select_border"); - uiItemBooleanO(layout, "Border Select Pinned", 0, "UV_OT_select_border", "pinned", 1); // Border Select Pinned|Shift B - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "UV_OT_select_all_toggle"); - uiItemO(layout, NULL, 0, "UV_OT_select_invert"); - uiItemO(layout, NULL, 0, "UV_OT_unlink_selection"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "UV_OT_select_pinned"); - uiItemO(layout, NULL, 0, "UV_OT_select_linked"); -} - #if 0 static void do_image_imagemenu(void *arg, int event) { @@ -183,61 +94,7 @@ static void do_image_imagemenu(void *arg, int event) if (event >= 20) BPY_menu_do_python(PYMENU_IMAGE, event - 20); #endif } -#endif - -static void image_imagemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - bScreen *sc= CTX_wm_screen(C); - SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); - PointerRNA spaceptr, imaptr; - Image *ima; - ImBuf *ibuf; - int show_render; - - /* retrieve state */ - ima= ED_space_image(sima); - ibuf= ED_space_image_buffer(sima); - - show_render= ED_space_image_show_render(sima); - - RNA_pointer_create(&sc->id, &RNA_SpaceImageEditor, sima, &spaceptr); - - /* create menu */ - uiItemO(layout, NULL, 0, "IMAGE_OT_new"); // New... - uiItemO(layout, NULL, 0, "IMAGE_OT_open"); // Open... - - if(ima) { - if(!show_render) { - uiItemO(layout, NULL, 0, "IMAGE_OT_replace"); // Replace... - uiItemO(layout, NULL, 0, "IMAGE_OT_reload"); // Reload... - } - uiItemO(layout, NULL, 0, "IMAGE_OT_save"); // Save - uiItemO(layout, NULL, 0, "IMAGE_OT_save_as"); // Save As... - if(ima->source == IMA_SRC_SEQUENCE) - uiItemO(layout, NULL, 0, "IMAGE_OT_save_sequence"); // Save Changed Sequence Images - if(!show_render) { - uiItemS(layout); - - if(ima->packedfile) uiItemO(layout, NULL, 0, "IMAGE_OT_unpack"); // Unpack Image... - else uiItemO(layout, NULL, 0, "IMAGE_OT_pack"); // Pack Image - - /* only for dirty && specific image types : XXX poll? */ - if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) - if(ELEM(ima->source, IMA_SRC_FILE, IMA_SRC_GENERATED) && ima->type != IMA_TYPE_MULTILAYER) - uiItemBooleanO(layout, "Pack As PNG", 0, "IMAGE_OT_pack", "as_png", 1); // Pack Image As PNG - - uiItemS(layout); - - uiItemR(layout, NULL, 0, &spaceptr, "image_painting", 0, 0, 0); - - /* move to realtime properties panel */ - RNA_id_pointer_create(&ima->id, &imaptr); - uiItemMenuEnumR(layout, NULL, 0, &imaptr, "mapping"); - } - } - -#if 0 #ifndef DISABLE_PYTHON { BPyMenu *pym; @@ -253,33 +110,6 @@ static void image_imagemenu(bContext *C, uiLayout *layout, void *arg_unused) } #endif #endif -} - -static void image_uvs_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "UV_OT_reveal"); - uiItemO(layout, NULL, 0, "UV_OT_hide"); - uiItemBooleanO(layout, "Hide Unselected", 0, "UV_OT_hide", "unselected", 1); -} - -static void image_uvs_transformmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemEnumO(layout, NULL, 0, "TFM_OT_transform", "mode", TFM_TRANSLATION); - uiItemEnumO(layout, NULL, 0, "TFM_OT_transform", "mode", TFM_ROTATION); - uiItemEnumO(layout, NULL, 0, "TFM_OT_transform", "mode", TFM_RESIZE); -} - -static void image_uvs_mirrormenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemEnumO(layout, NULL, 0, "UV_OT_mirror", "axis", 'x'); // "X Axis", M, 1 - uiItemEnumO(layout, NULL, 0, "UV_OT_mirror", "axis", 'y'); // "Y Axis", M, 2 -} - -static void image_uvs_weldalignmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "UV_OT_weld"); // W, 1 - uiItemsEnumO(layout, "UV_OT_align", "axis"); // W, 2/3/4 -} #if 0 #ifndef DISABLE_PYTHON @@ -316,87 +146,7 @@ static void image_uvs_scriptsmenu (void *args_unused) #endif /* DISABLE_PYTHON */ #endif -static void image_uvsmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - bScreen *sc= CTX_wm_screen(C); - Scene *scene= CTX_data_scene(C); - SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); - PointerRNA uvptr, sceneptr; - Image *ima; - ImBuf *ibuf; - - /* retrieve state */ - ima= ED_space_image(sima); - ibuf= ED_space_image_buffer(sima); - - RNA_pointer_create(&sc->id, &RNA_SpaceUVEditor, sima, &uvptr); - RNA_id_pointer_create(&scene->id, &sceneptr); - - /* create menu */ - uiItemR(layout, NULL, 0, &uvptr, "snap_to_pixels", 0, 0, 0); - uiItemR(layout, NULL, 0, &uvptr, "constrain_to_image_bounds", 0, 0, 0); - - uiItemS(layout); - - uiItemR(layout, NULL, 0, &uvptr, "live_unwrap", 0, 0, 0); - uiItemO(layout, NULL, 0, "UV_OT_unwrap"); - uiItemBooleanO(layout, "Unpin", 0, "UV_OT_pin", "clear", 1); - uiItemO(layout, NULL, 0, "UV_OT_pin"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "UV_OT_pack_islands"); - uiItemO(layout, NULL, 0, "UV_OT_average_islands_scale"); - uiItemO(layout, NULL, 0, "UV_OT_minimize_stretch"); - uiItemO(layout, NULL, 0, "UV_OT_stitch"); - - uiItemS(layout); - - uiItemMenuF(layout, "Transform", 0, image_uvs_transformmenu); - uiItemMenuF(layout, "Mirror", 0, image_uvs_mirrormenu); - uiItemMenuF(layout, "Weld/Align", 0, image_uvs_weldalignmenu); - - uiItemS(layout); - - uiItemR(layout, NULL, 0, &sceneptr, "proportional_editing", 0, 0, 0); - uiItemMenuEnumR(layout, NULL, 0, &sceneptr, "proportional_editing_falloff"); - - uiItemS(layout); - - uiItemMenuF(layout, "Show/Hide Faces", 0, image_uvs_showhidemenu); - #if 0 -#ifndef DISABLE_PYTHON - uiItemS(layout); - - uiItemMenuF(layout, "Scripts", image_uvs_scriptsmenu); -#endif -#endif -} - -static void image_menu_uvlayers(Object *obedit, char *menustr, int *active) -{ - Mesh *me= (Mesh*)obedit->data; - EditMesh *em= BKE_mesh_get_editmesh(me); - CustomDataLayer *layer; - int i, count = 0; - - menustr[0]= '\0'; - - for(i=0; ifdata.totlayer; i++) { - layer = &em->fdata.layers[i]; - - if(layer->type == CD_MTFACE) { - menustr += sprintf(menustr, "%s%%x%d|", layer->name, count); - count++; - } - } - - *active= CustomData_get_active_layer(&em->fdata, CD_MTFACE); - - BKE_mesh_end_editmesh(me, em); -} - static void do_image_buttons(bContext *C, void *arg, int event) { switch(event) { @@ -405,7 +155,6 @@ static void do_image_buttons(bContext *C, void *arg, int event) break; } -#if 0 ToolSettings *settings= G.scene->toolsettings; ID *id, *idtest; int nr; @@ -660,279 +409,9 @@ static void do_image_buttons(bContext *C, void *arg, int event) imagespace_composite_flipbook(curarea); break; } -#endif -} - -#if 0 -static void do_image_buttons_set_uvlayer_callback(void *act, void *data) -{ - CustomData_set_layer_active(&G.editMesh->fdata, CD_MTFACE, *((int *)act)); - - BIF_undo_push("Set Active UV Texture"); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); } #endif -static void sima_idpoin_handle(bContext *C, ID *id, int event) -{ - SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); - Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); - - switch(event) { - case UI_ID_BROWSE: - case UI_ID_DELETE: - ED_space_image_set(C, sima, scene, obedit, (Image*)id); - ED_undo_push(C, "Assign Image UV"); - break; - case UI_ID_RENAME: - break; - case UI_ID_ADD_NEW: - WM_operator_name_call(C, "IMAGE_OT_new", WM_OP_INVOKE_REGION_WIN, NULL); - break; - case UI_ID_OPEN: - WM_operator_name_call(C, "IMAGE_OT_open", WM_OP_INVOKE_REGION_WIN, NULL); - break; - case UI_ID_PIN: - ED_area_tag_refresh(CTX_wm_area(C)); - break; - } -} - -void image_header_buttons(const bContext *C, ARegion *ar) -{ - bScreen *sc= CTX_wm_screen(C); - ScrArea *sa= CTX_wm_area(C); - Scene *scene= CTX_data_scene(C); - SpaceImage *sima= (SpaceImage*)CTX_wm_space_data(C); - Image *ima; - ImBuf *ibuf; - uiBlock *block; - uiBut *but; - PointerRNA spaceptr, uvptr, sceneptr; - int xco, yco= 3, show_uvedit, show_render, show_paint, pinflag; - - /* retrieve state */ - ima= ED_space_image(sima); - ibuf= ED_space_image_buffer(sima); - - show_render= ED_space_image_show_render(sima); - show_paint= ED_space_image_show_paint(sima); - show_uvedit= ED_space_image_show_uvedit(sima, CTX_data_edit_object(C)); - - RNA_pointer_create(&sc->id, &RNA_SpaceImageEditor, sima, &spaceptr); - RNA_pointer_create(&sc->id, &RNA_SpaceUVEditor, sima, &uvptr); - RNA_id_pointer_create(&scene->id, &sceneptr); - - /* create block */ - block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS); - uiBlockSetHandleFunc(block, do_image_buttons, NULL); - - xco= ED_area_header_standardbuttons(C, block, yco); - - /* create pulldown menus */ - if((sa->flag & HEADER_NO_PULLDOWN)==0) { - char *menuname; - int xmax; - - xmax= GetButStringLength("View"); - uiDefMenuBut(block, image_viewmenu, NULL, "View", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - if(show_uvedit) { - xmax= GetButStringLength("Select"); - uiDefMenuBut(block, image_selectmenu, NULL, "Select", xco, yco, xmax-3, 20, ""); - xco+= xmax; - } - - menuname= (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))? "Image*": "Image"; - xmax= GetButStringLength(menuname); - uiDefMenuBut(block, image_imagemenu, NULL, menuname, xco, yco, xmax-3, 20, ""); - xco+= xmax; - - if(show_uvedit) { - xmax= GetButStringLength("UVs"); - uiDefMenuBut(block, image_uvsmenu, NULL, "UVs", xco, yco, xmax-3, 20, ""); - xco+= xmax; - } - } - - uiBlockSetEmboss(block, UI_EMBOSS); - - /* image select */ - - pinflag= (show_render)? 0: UI_ID_PIN; - xco= uiDefIDPoinButs(block, CTX_data_main(C), NULL, (ID*)sima->image, ID_IM, &sima->pin, xco, yco, - sima_idpoin_handle, UI_ID_BROWSE|UI_ID_BROWSE_RENDER|UI_ID_RENAME|UI_ID_ADD_NEW|UI_ID_OPEN|UI_ID_DELETE|pinflag); - xco += 8; - - if(ima && !ELEM3(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE, IMA_SRC_VIEWER) && ima->ok) { - /* XXX this should not be a static var */ - static int headerbuttons_packdummy; - - headerbuttons_packdummy = 0; - - if (ima->packedfile) { - headerbuttons_packdummy = 1; - } - if (ima->packedfile && ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) - uiDefIconButBitI(block, TOG, 1, 0 /* XXX B_SIMA_REPACK */, ICON_UGLYPACKAGE, xco,yco,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Re-Pack this image as PNG"); - else - uiDefIconButBitI(block, TOG, 1, 0 /* XXX B_SIMAPACKIMA */, ICON_PACKAGE, xco,yco,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Pack/Unpack this image"); - - xco+= XIC+8; - } - - /* uv editing */ - if(show_uvedit) { - /* pivot */ - uiDefIconTextButS(block, ICONTEXTROW, B_NOP, ICON_ROTATE, - "Pivot: %t|Bounding Box Center %x0|Median Point %x3|2D Cursor %x1", - xco,yco,XIC+10,YIC, &ar->v2d.around, 0, 3.0, 0, 0, - "Rotation/Scaling Pivot (Hotkeys: Comma, Shift Comma, Period)"); - xco+= XIC + 18; - - /* selection modes */ - uiDefIconButBitS(block, TOG, UV_SYNC_SELECTION, B_REDR, ICON_EDIT, xco,yco,XIC,YIC, &scene->toolsettings->uv_flag, 0, 0, 0, 0, "Sync UV and Mesh Selection"); - xco+= XIC+8; - - if(scene->toolsettings->uv_flag & UV_SYNC_SELECTION) { - uiBlockBeginAlign(block); - - uiDefIconButBitS(block, TOG, SCE_SELECT_VERTEX, B_REDR, ICON_VERTEXSEL, - xco,yco,XIC,YIC, &scene->toolsettings->selectmode, 1.0, 0.0, 0, 0, "Vertex select mode"); - uiDefIconButBitS(block, TOG, SCE_SELECT_EDGE, B_REDR, ICON_EDGESEL, - xco+=XIC,yco,XIC,YIC, &scene->toolsettings->selectmode, 1.0, 0.0, 0, 0, "Edge select mode"); - uiDefIconButBitS(block, TOG, SCE_SELECT_FACE, B_REDR, ICON_FACESEL, - xco+=XIC,yco,XIC,YIC, &scene->toolsettings->selectmode, 1.0, 0.0, 0, 0, "Face select mode"); - - uiBlockEndAlign(block); - } - else { - uiBlockBeginAlign(block); - - uiDefIconButS(block, ROW, B_REDR, ICON_VERTEXSEL, - xco,yco,XIC,YIC, &scene->toolsettings->uv_selectmode, 1.0, UV_SELECT_VERTEX, 0, 0, "Vertex select mode"); - uiDefIconButS(block, ROW, B_REDR, ICON_EDGESEL, - xco+=XIC,yco,XIC,YIC, &scene->toolsettings->uv_selectmode, 1.0, UV_SELECT_EDGE, 0, 0, "Edge select mode"); - uiDefIconButS(block, ROW, B_REDR, ICON_FACESEL, - xco+=XIC,yco,XIC,YIC, &scene->toolsettings->uv_selectmode, 1.0, UV_SELECT_FACE, 0, 0, "Face select mode"); - uiDefIconButS(block, ROW, B_REDR, ICON_LINKEDSEL, - xco+=XIC,yco,XIC,YIC, &scene->toolsettings->uv_selectmode, 1.0, UV_SELECT_ISLAND, 0, 0, "Island select mode"); - - uiBlockEndAlign(block); - - /* would use these if const's could go in strings - * SI_STICKY_LOC SI_STICKY_DISABLE SI_STICKY_VERTEX */ - but = uiDefIconTextButC(block, ICONTEXTROW, B_REDR, ICON_STICKY_UVS_LOC, - "Sticky UV Selection: %t|Disable%x1|Shared Location%x0|Shared Vertex%x2", - xco+=XIC+10,yco,XIC+10,YIC, &(sima->sticky), 0, 3.0, 0, 0, - "Sticky UV Selection (Hotkeys: Shift C, Alt C, Ctrl C)"); - } - - xco+= XIC + 16; - - /* snap options, identical to options in 3d view header */ - uiBlockBeginAlign(block); - - if (scene->toolsettings->snap_flag & SCE_SNAP) { - uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEO,xco,yco,XIC,YIC, &scene->toolsettings->snap_flag, 0, 0, 0, 0, "Use Snap or Grid (Shift Tab)."); - xco+= XIC; - uiDefButS(block, MENU, B_NOP, "Mode%t|Closest%x0|Center%x1|Median%x2",xco,yco,70,YIC, &scene->toolsettings->snap_target, 0, 0, 0, 0, "Snap Target Mode."); - xco+= 70; - } - else { - uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,yco,XIC,YIC, &scene->toolsettings->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)."); - xco+= XIC; - } - - uiBlockEndAlign(block); - xco+= 8; - - /* uv layers */ - { - Object *obedit= CTX_data_edit_object(C); - char menustr[34*MAX_MTFACE]; - static int act; - - image_menu_uvlayers(obedit, menustr, &act); - - but = uiDefButI(block, MENU, B_NOP, menustr ,xco,yco,85,YIC, &act, 0, 0, 0, 0, "Active UV Layer for editing."); - // uiButSetFunc(but, do_image_buttons_set_uvlayer_callback, &act, NULL); - - xco+= 85; - } - - xco+= 8; - } - - if(ima) { - RenderResult *rr; - - /* render layers and passes */ - rr= BKE_image_get_renderresult(scene, ima); - if(rr) { - uiBlockBeginAlign(block); -#if 0 - uiblock_layer_pass_buttons(block, rr, &sima->iuser, B_REDR, xco, 0, 160); -#endif - uiBlockEndAlign(block); - xco+= 166; - } - - /* painting */ - uiDefIconButR(block, TOG, B_REDR, ICON_TPAINT_HLT, xco,yco,XIC,YIC, &spaceptr, "image_painting", 0, 0, 0, 0, 0, NULL); - xco+= XIC+8; - - /* image draw options */ - uiBlockBeginAlign(block); - uiDefIconButR(block, ROW, B_REDR, ICON_IMAGE_RGB, xco,yco,XIC,YIC, &spaceptr, "draw_channels", 0, 0, 0, 0, 0, NULL); - xco+= XIC; - if(ibuf==NULL || ibuf->channels==4) { - uiDefIconButR(block, ROW, B_REDR, ICON_IMAGE_RGB_ALPHA, xco,yco,XIC,YIC, &spaceptr, "draw_channels", 0, 0, SI_USE_ALPHA, 0, 0, NULL); - xco+= XIC; - uiDefIconButR(block, ROW, B_REDR, ICON_IMAGE_ALPHA, xco,yco,XIC,YIC, &spaceptr, "draw_channels", 0, 0, SI_SHOW_ALPHA, 0, 0, NULL); - xco+= XIC; - } - if(ibuf) { - if(ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1)) { - uiDefIconButR(block, ROW, B_REDR, ICON_IMAGE_ZDEPTH, xco,yco,XIC,YIC, &spaceptr, "draw_channels", 0, 0, SI_SHOW_ZBUF, 0, 0, NULL); - xco+= XIC; - } - } -#ifdef WITH_LCMS - uiDefIconButR(block, ROW, B_REDR, ICON_IMAGE_ALPHA, xco,yco,XIC,YIC, &spaceptr, "draw_channels", 0, 0, SI_COLOR_CORRECTION, 0, 0, NULL); - xco+= XIC; -#endif - xco+= 8; - - /* record & play */ - uiBlockBeginAlign(block); - if(ima->type==IMA_TYPE_COMPOSITE) { - uiDefIconButO(block, BUT, "IMAGE_OT_record_composite", WM_OP_INVOKE_REGION_WIN, ICON_REC, xco, yco, XIC, YIC, NULL); // Record Composite - xco+= XIC; - } - if((ima->type==IMA_TYPE_COMPOSITE) || ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) { -//XXX uiDefIconButO(block, BUT, "IMAGE_OT_play_composite", WM_OP_INVOKE_REGION_WIN, ICON_PLAY, xco, yco, XIC, YIC, NULL); // PLAY - xco+= XIC; - } - uiBlockEndAlign(block); - xco+= 8; - - } - - /* draw lock */ - uiDefIconButR(block, ICONTOG, 0, ICON_UNLOCKED, xco,yco,XIC,YIC, &spaceptr, "update_automatically", 0, 0, 0, 0, 0, NULL); - - /* always as last */ - UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); - - uiEndBlock(C, block); - uiDrawBlock(C, block); -} - /********************** toolbox operator *********************/ static int toolbox_invoke(bContext *C, wmOperator *op, wmEvent *event) @@ -948,10 +427,10 @@ static int toolbox_invoke(bContext *C, wmOperator *op, wmEvent *event) pup= uiPupMenuBegin(C, "Toolbox", 0); layout= uiPupMenuLayout(pup); - uiItemMenuF(layout, "View", 0, image_viewmenu); - if(show_uvedit) uiItemMenuF(layout, "Select", 0, image_selectmenu); - uiItemMenuF(layout, "Image", 0, image_imagemenu); - if(show_uvedit) uiItemMenuF(layout, "UVs", 0, image_uvsmenu); + uiItemM(layout, C, NULL, 0, "IMAGE_MT_view"); + if(show_uvedit) uiItemM(layout, C, NULL, 0, "IMAGE_MT_select"); + uiItemM(layout, C, NULL, 0, "IMAGE_MT_image"); + if(show_uvedit) uiItemM(layout, C, NULL, 0, "IMAGE_MT_uvs"); uiPupMenuEnd(C, pup); diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index ef472d462c2..709fbb6299b 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -588,7 +588,6 @@ void ED_spacetype_image(void) BLI_addhead(&st->regiontypes, art); - BKE_spacetype_register(st); } diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index 6d61f743917..0786ad17f1e 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -104,7 +104,7 @@ void SEQUENCER_OT_select_linked_pick(struct wmOperatorType *ot); void SEQUENCER_OT_select_handles(struct wmOperatorType *ot); void SEQUENCER_OT_select_active_side(struct wmOperatorType *ot); void SEQUENCER_OT_select_border(struct wmOperatorType *ot); -void SEQUENCER_OT_select_invert(struct wmOperatorType *ot); +void SEQUENCER_OT_select_inverse(struct wmOperatorType *ot); /* sequencer_select.c */ diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index d1a2307ca3a..fd1d2237c10 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -83,7 +83,7 @@ void sequencer_operatortypes(void) /* sequencer_select.c */ WM_operatortype_append(SEQUENCER_OT_select_all_toggle); - WM_operatortype_append(SEQUENCER_OT_select_invert); + WM_operatortype_append(SEQUENCER_OT_select_inverse); WM_operatortype_append(SEQUENCER_OT_select); WM_operatortype_append(SEQUENCER_OT_select_more); WM_operatortype_append(SEQUENCER_OT_select_less); @@ -111,7 +111,7 @@ void sequencer_keymap(wmWindowManager *wm) WM_keymap_add_item(keymap, "SEQUENCER_OT_properties", NKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "SEQUENCER_OT_select_invert", IKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "SEQUENCER_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_cut", KKEY, KM_PRESS, 0, 0)->ptr, "type", SEQ_CUT_SOFT); RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_cut", KKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", SEQ_CUT_HARD); diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index bfd89ccdffb..335652235c6 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -244,7 +244,7 @@ void SEQUENCER_OT_select_all_toggle(struct wmOperatorType *ot) /* (de)select operator */ -static int sequencer_select_invert_exec(bContext *C, wmOperator *op) +static int sequencer_select_inverse_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, FALSE); @@ -267,14 +267,14 @@ static int sequencer_select_invert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void SEQUENCER_OT_select_invert(struct wmOperatorType *ot) +void SEQUENCER_OT_select_inverse(struct wmOperatorType *ot) { /* identifiers */ - ot->name= "Select Invert"; - ot->idname= "SEQUENCER_OT_select_invert"; + ot->name= "Select Inverse"; + ot->idname= "SEQUENCER_OT_select_inverse"; /* api callbacks */ - ot->exec= sequencer_select_invert_exec; + ot->exec= sequencer_select_inverse_exec; ot->poll= ED_operator_sequencer_active; diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index daa872defff..d5ec5e10b94 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -644,6 +644,9 @@ static void view3d_view_alignviewmenu(bContext *C, uiLayout *layout, void *arg_u static void view3d_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) { ScrArea *sa= CTX_wm_area(C); + + uiItemO(layout, NULL, ICON_MENU_PANEL, "VIEW3D_OT_properties"); + uiItemO(layout, NULL, ICON_MENU_PANEL, "VIEW3D_OT_toolbar"); // uiItemO(layout, ICON_MENU_PANEL, "VIEW3D_OT_toggle_transform_orientations_panel"); // Transform Orientations... // uiItemO(layout, ICON_MENU_PANEL, "VIEW3D_OT_toggle_render_preview_panel"); // render preview... @@ -651,7 +654,7 @@ static void view3d_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) // uiItemO(layout, ICON_MENU_PANEL, "VIEW3D_OT_toggle_background_image_panel"); // Background Image.... // uiItemO(layout, ICON_MENU_PANEL, "VIEW3D_OT_toggle_grease_pencil_panel"); // Grease Pencil.... -// uiItemS(layout); + uiItemS(layout); uiItemEnumO(layout, NULL, 0, "VIEW3D_OT_viewnumpad", "type", V3D_VIEW_CAMERA); uiItemEnumO(layout, NULL, 0, "VIEW3D_OT_viewnumpad", "type", V3D_VIEW_TOP); @@ -1014,7 +1017,7 @@ static void view3d_select_objectmenu(bContext *C, uiLayout *layout, void *arg_un uiItemS(layout); uiItemO(layout, "Select/Deselect All", 0, "OBJECT_OT_select_all_toggle"); - uiItemO(layout, "Inverse", 0, "OBJECT_OT_select_invert"); + uiItemO(layout, "Inverse", 0, "OBJECT_OT_select_inverse"); uiItemO(layout, "Random", 0, "OBJECT_OT_select_random"); uiItemO(layout, "Select All by Layer", 0, "OBJECT_OT_select_by_layer"); uiItemMenuEnumO(layout, "Select All by Type", 0, "OBJECT_OT_select_by_type", "type"); @@ -1037,7 +1040,7 @@ static void view3d_select_meshmenu(bContext *C, uiLayout *layout, void *arg_unus uiItemS(layout); uiItemO(layout, "Select/Deselect All", 0, "MESH_OT_select_all_toggle"); - uiItemO(layout, "Inverse", 0, "MESH_OT_select_invert"); + uiItemO(layout, "Inverse", 0, "MESH_OT_select_inverse"); uiItemS(layout); @@ -1061,8 +1064,8 @@ static void view3d_select_meshmenu(bContext *C, uiLayout *layout, void *arg_unus uiItemO(layout, "Linked", 0, "MESH_OT_select_linked"); uiItemO(layout, "Vertex Path", 0, "MESH_OT_select_vertex_path"); // W, Alt 7 - // XXX uiItemO(layout, "Edge Loop", 0, "MESH_OT_select_edge_loop"); // loop_multiselect(0) - // XXX uiItemO(layout, "Edge Ring", 0, "MESH_OT_select_edge_ring"); // loop_multiselect(1) + uiItemO(layout, "Edge Loop", 0, "MESH_OT_loop_multi_select"); + uiItemBooleanO(layout, "Edge Ring", 0, "MESH_OT_loop_multi_select", "ring", 1); uiItemS(layout); @@ -1080,7 +1083,7 @@ static void view3d_select_curvemenu(bContext *C, uiLayout *layout, void *arg_unu uiItemS(layout); uiItemO(layout, NULL, 0, "CURVE_OT_select_all_toggle"); - uiItemO(layout, NULL, 0, "CURVE_OT_select_invert"); + uiItemO(layout, NULL, 0, "CURVE_OT_select_inverse"); uiItemO(layout, NULL, 0, "CURVE_OT_select_random"); // Random... uiItemO(layout, NULL, 0, "CURVE_OT_select_every_nth"); // Every Nth.. @@ -1182,7 +1185,7 @@ static void view3d_select_armaturemenu(bContext *C, uiLayout *layout, void *arg_ uiItemS(layout); uiItemO(layout, "Select/Deselect All", 0, "ARMATURE_OT_select_all_toggle"); - uiItemO(layout, "Inverse", 0, "ARMATURE_OT_select_invert"); + uiItemO(layout, "Inverse", 0, "ARMATURE_OT_select_inverse"); uiItemS(layout); @@ -1211,7 +1214,7 @@ static void view3d_select_posemenu(bContext *C, uiLayout *layout, void *arg_unus uiItemS(layout); uiItemO(layout, "Select/Deselect All", 0, "POSE_OT_select_all_toggle"); - uiItemO(layout, "Inverse", 0, "POSE_OT_select_invert"); + uiItemO(layout, "Inverse", 0, "POSE_OT_select_inverse"); uiItemO(layout, "Constraint Target", 0, "POSE_OT_select_constraint_target"); uiItemS(layout); @@ -1302,57 +1305,17 @@ static uiBlock *view3d_select_faceselmenu(bContext *C, ARegion *ar, void *arg_un return block; } -void do_view3d_edit_snapmenu(bContext *C, void *arg, int event) +static void view3d_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused) { -#if 0 - switch (event) { - case 1: /*Selection to grid*/ - snap_sel_to_grid(); - ED_undo_push(C, "Snap selection to grid"); - break; - case 2: /*Selection to cursor*/ - snap_sel_to_curs(); - ED_undo_push(C, "Snap selection to cursor"); - break; - case 3: /*Selection to center of selection*/ - snap_to_center(); - ED_undo_push(C, "Snap selection to center"); - break; - case 4: /*Cursor to selection*/ - snap_curs_to_sel(); - break; - case 5: /*Cursor to grid*/ - snap_curs_to_grid(); - break; - case 6: /*Cursor to Active*/ - snap_curs_to_active(); - ED_undo_push(C, "Snap selection to center"); - break; - } -#endif -} + uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_selected_to_grid"); + uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_selected_to_cursor"); + uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_selected_to_center"); -static uiBlock *view3d_edit_snapmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; + uiItemS(layout); - block= uiBeginBlock(C, ar, "view3d_edit_snapmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_snapmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Grid|Shift S, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Cursor|Shift S, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Center|Shift S, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cursor -> Selection|Shift S, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cursor -> Grid|Shift S, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cursor -> Active|Shift S, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; + uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_cursor_to_selected"); + uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_cursor_to_grid"); + uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_cursor_to_active"); } void do_view3d_transform_moveaxismenu(bContext *C, void *arg, int event) @@ -2338,7 +2301,7 @@ static uiBlock *view3d_edit_objectmenu(bContext *C, ARegion *ar, void *arg_unuse uiDefIconTextBlockBut(block, view3d_object_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_object_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Clear/Apply", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); + // XXX uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); @@ -2397,116 +2360,26 @@ static uiBlock *view3d_edit_objectmenu(bContext *C, ARegion *ar, void *arg_unuse } -static void do_view3d_edit_propfalloffmenu(bContext *C, void *arg, int event) +static void view3d_edit_mesh_verticesmenu(bContext *C, uiLayout *layout, void *arg_unused) { - ToolSettings *ts= CTX_data_tool_settings(C); - - ts->prop_mode= event; - -} + uiItemO(layout, "Merge...", 0, "MESH_OT_merge"); + uiItemO(layout, "Rip", 0, "MESH_OT_rip"); + uiItemO(layout, "Split", 0, "MESH_OT_split"); + uiItemO(layout, "Separate", 0, "MESH_OT_separate"); -static uiBlock *view3d_edit_propfalloffmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - ToolSettings *ts= CTX_data_tool_settings(C); - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_propfalloffmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_propfalloffmenu, NULL); - - if (ts->prop_mode==PROP_SMOOTH) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Smooth|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SMOOTH, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Smooth|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SMOOTH, ""); - if (ts->prop_mode==PROP_SPHERE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sphere|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SPHERE, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Sphere|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SPHERE, ""); - if (ts->prop_mode==PROP_ROOT) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Root|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_ROOT, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Root|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_ROOT, ""); - if (ts->prop_mode==PROP_SHARP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SHARP, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SHARP, ""); - if (ts->prop_mode==PROP_LIN) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Linear|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_LIN, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Linear|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_LIN, ""); - if (ts->prop_mode==PROP_RANDOM) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Random|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_RANDOM, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Random|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_RANDOM, ""); - if (ts->prop_mode==PROP_CONST) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Constant|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_CONST, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Constant|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_CONST, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} + uiItemS(layout); + uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth"); + uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles"); -void do_view3d_edit_mesh_verticesmenu(bContext *C, void *arg, int event) -{ #if 0 - Scene *scene= CTX_data_scene(C); - - switch(event) { - int count; - - case 0: /* make vertex parent */ - make_parent(); - break; - case 1: /* remove doubles */ - count= removedoublesflag(1, 0, ts->doublimit); - notice("Removed: %d", count); - if (count) { /* only undo and redraw if an action is taken */ - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - ED_undo_push(C, "Rem Doubles"); - } - break; - case 2: /* smooth */ - vertexsmooth(); - break; - case 3: /* separate */ - separate_mesh(); - break; - case 4: /*split */ - split_mesh(); - break; - case 5: /*merge */ - mergemenu(); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - break; - case 6: /* add hook */ - add_hook_menu(); - break; - case 7: /* rip */ - mesh_rip(); - break; - } -#endif -} - -static uiBlock *view3d_edit_mesh_verticesmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_mesh_verticesmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_mesh_verticesmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Merge...|Alt M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rip|V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Split|Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Separate|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Smooth|W, Alt 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove Doubles|W, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Vertex Parent|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Hook|Ctrl H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + uiItemS(layout); - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Vertex Parent|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); // add_hook_menu(); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Hook|Ctrl H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); // make_parent(); +#endif } -extern void editmesh_mark_sharp(int set); /* declared in editmesh_mods.c */ - void do_view3d_edit_mesh_edgesmenu(bContext *C, void *arg, int event) { #if 0 @@ -2515,52 +2388,12 @@ void do_view3d_edit_mesh_edgesmenu(bContext *C, void *arg, int event) short randfac; switch(event) { - - case 0: /* subdivide smooth */ - esubdivideflag(1, 0.0, ts->editbutflag | B_SMOOTH,1,0); - ED_undo_push(C, "Subdivide Smooth"); - break; - case 1: /*subdivide fractal */ - randfac= 10; - if(button(&randfac, 1, 100, "Rand fac:")==0) return; - fac= -( (float)randfac )/100; - esubdivideflag(1, fac, ts->editbutflag,1,0); - ED_undo_push(C, "Subdivide Fractal"); - break; - case 2: /* subdivide */ - esubdivideflag(1, 0.0, ts->editbutflag,1,0); - ED_undo_push(C, "Subdivide"); - break; - case 3: /* knife subdivide */ - KnifeSubdivide(KNIFE_PROMPT); - break; - case 4: /* Loop subdivide */ - CutEdgeloop(1); - break; - case 5: /* Make Edge/Face */ - addedgeface_mesh(); - break; - case 6: - bevel_menu(); - break; - case 7: /* Mark Seam */ - editmesh_mark_seam(0); - break; - case 8: /* Clear Seam */ - editmesh_mark_seam(1); - break; case 9: /* Crease SubSurf */ if(!multires_level1_test()) { initTransform(TFM_CREASE, CTX_EDGE); Transform(); } break; - case 10: /* Rotate Edge */ - edge_rotate_selected(2); - break; - case 11: /* Rotate Edge */ - edge_rotate_selected(1); - break; case 12: /* Edgeslide */ EdgeSlide(0,0.0); break; @@ -2575,16 +2408,6 @@ void do_view3d_edit_mesh_edgesmenu(bContext *C, void *arg, int event) collapseEdges(); ED_undo_push(C, "Collapse"); break; - case 15: - editmesh_mark_sharp(1); - ED_undo_push(C, "Mark Sharp"); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - break; - case 16: - editmesh_mark_sharp(0); - ED_undo_push(C, "Clear Sharp"); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - break; case 17: /* Adjust Bevel Weight */ if(!multires_level1_test()) { initTransform(TFM_BWEIGHT, CTX_EDGE); @@ -2595,158 +2418,79 @@ void do_view3d_edit_mesh_edgesmenu(bContext *C, void *arg, int event) #endif } -static uiBlock *view3d_edit_mesh_edgesmenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_edit_mesh_edgesmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiBlock *block; - short yco = 20, menuwidth = 120; + uiItemO(layout, NULL, 0, "MESH_OT_edge_face_add"); - block= uiBeginBlock(C, ar, "view3d_edit_mesh_edgesmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_mesh_edgesmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Edge/Face|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bevel|W, Alt 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Loop Subdivide...|Ctrl R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Knife Subdivide...|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide|W, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide Fractal|W, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide Smooth|W, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); +#if 0 + uiItemO(layout, "Bevel", 0, "MESH_OT_bevel"); // bevelmenu(em) + uiItemO(layout, "Loop Subdivide...", 0, "MESH_OT_loop_subdivide"); // Ctr R, CutEdgeloop(1); + uiItemO(layout, "Knife Subdivide...", 0, "MESH_OT_loop_subdivide"); // Shift K, KnifeSubdivide(KNIFE_PROMPT); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiItemS(layout); +#endif - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mark Seam|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Seam|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mark Sharp|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Sharp|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - + uiItemO(layout, "Subdivide", 0, "MESH_OT_subdivide"); + uiItemFloatO(layout, "Subdivide Smooth", 0, "MESH_OT_subdivide", "smoothness", 1.0f); + + uiItemS(layout); + + uiItemO(layout, "Mark Seam", 0, "MESH_OT_mark_seam"); + uiItemBooleanO(layout, "Clear Seam", 0, "MESH_OT_mark_seam", "clear", 1); + + uiItemS(layout); + + uiItemO(layout, "Mark Sharp", 0, "MESH_OT_mark_sharp"); + uiItemBooleanO(layout, "Clear Sharp", 0, "MESH_OT_mark_sharp", "clear", 1); + +#if 0 + uiItemS(layout); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Adjust Bevel Weight|Ctrl Shift E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Crease SubSurf|Shift E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); +#endif - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiItemS(layout); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate Edge CW|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate Edge CCW|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); + uiItemEnumO(layout, "Rotate Edge CW", 0, "MESH_OT_edge_rotate", "direction", 1); + uiItemEnumO(layout, "Rotate Edge CCW", 0, "MESH_OT_edge_rotate", "direction", 2); +#if 0 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Slide Edge |Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Edge Loop|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Collapse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void do_view3d_edit_mesh_facesmenu(bContext *C, void *arg, int event) -{ -#if 0 - Scene *scene= CTX_data_scene(C); - - switch(event) { - case 0: /* Fill Faces */ - fill_mesh(); - break; - case 1: /* Beauty Fill Faces */ - beauty_fill(); - break; - case 2: /* Quads to Tris */ - convert_to_triface(0); - countall(); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - break; - case 3: /* Tris to Quads */ - join_triangles(); - break; - case 4: /* Flip triangle edges */ - edge_flip(); - break; - case 5: /* Make Edge/Face */ - addedgeface_mesh(); - break; - case 6: /* Set Smooth */ - mesh_set_smooth_faces(1); - break; - case 7: /* Set Solid */ - mesh_set_smooth_faces(0); - break; - } #endif } -static uiBlock *view3d_edit_mesh_facesmenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_edit_mesh_facesmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiBlock *block; - short yco = 20, menuwidth = 120; + uiItemO(layout, NULL, 0, "MESH_OT_edge_face_add"); + uiItemO(layout, NULL, 0, "MESH_OT_fill"); + uiItemO(layout, NULL, 0, "MESH_OT_beauty_fill"); - block= uiBeginBlock(C, ar, "view3d_edit_mesh_facesmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_mesh_facesmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Edge/Face|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Fill|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Beautify Fill|Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Quads to Triangles|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Triangles to Quads|Alt J", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip Triangle Edges|Ctrl Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Smooth|W, Alt 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Solid|W, Alt 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} + uiItemS(layout); -void do_view3d_edit_mesh_normalsmenu(bContext *C, void *arg, int event) -{ -#if 0 - switch(event) { - case 0: /* flip */ - flip_editnormals(); - break; - case 1: /* recalculate inside */ - righthandfaces(2); - break; - case 2: /* recalculate outside */ - righthandfaces(1); - break; - } -#endif + uiItemO(layout, NULL, 0, "MESH_OT_quads_convert_to_tris"); + uiItemO(layout, NULL, 0, "MESH_OT_tris_convert_to_quads"); + uiItemO(layout, NULL, 0, "MESH_OT_edge_flip"); + + uiItemS(layout); + + uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_smooth"); + uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_solid"); } -static uiBlock *view3d_edit_mesh_normalsmenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_edit_mesh_normalsmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiBlock *block; - short yco = 20, menuwidth = 120; + uiItemO(layout, "Recalculate Outside", 0, "MESH_OT_normals_make_consistent"); + uiItemBooleanO(layout, "Recalculate Inside", 0, "MESH_OT_normals_make_consistent", "inside", 1); - block= uiBeginBlock(C, ar, "view3d_edit_mesh_normalsmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_mesh_normalsmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recalculate Outside|Ctrl N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recalculate Inside|Ctrl Shift N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip|W, 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; + uiItemS(layout); + + uiItemO(layout, NULL, 0, "MESH_OT_flip_normals"); } void do_view3d_edit_mirrormenu(bContext *C, void *arg, int event) @@ -2822,49 +2566,18 @@ static uiBlock *view3d_edit_mirrormenu(bContext *C, ARegion *ar, void *arg_unuse return block; } -static void do_view3d_edit_mesh_showhidemenu(bContext *C, void *arg, int event) +static void view3d_edit_mesh_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused) { -#if 0 - - switch(event) { - - case 0: /* show hidden vertices */ - reveal_mesh(); - break; - case 1: /* hide selected vertices */ - hide_mesh(0); - break; - case 2: /* hide deselected vertices */ - hide_mesh(1); - break; - } -#endif -} - -static uiBlock *view3d_edit_mesh_showhidemenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_mesh_showhidemenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_mesh_showhidemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Unselected|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; + uiItemO(layout, NULL, 0, "MESH_OT_reveal"); + uiItemO(layout, NULL, 0, "MESH_OT_hide"); + uiItemBooleanO(layout, "Hide Unselected", 0, "MESH_OT_hide", "unselected", 1); } #ifndef DISABLE_PYTHON +#if 0 static void do_view3d_edit_mesh_scriptsmenu(bContext *C, void *arg, int event) { -#if 0 BPY_menu_do_python(PYMENU_MESH, event); - -#endif } static uiBlock *view3d_edit_mesh_scriptsmenu(bContext *C, ARegion *ar, void *arg_unused) @@ -2886,154 +2599,94 @@ static uiBlock *view3d_edit_mesh_scriptsmenu(bContext *C, ARegion *ar, void *arg return block; } +#endif #endif /* DISABLE_PYTHON */ +#if 0 static void do_view3d_edit_meshmenu(bContext *C, void *arg, int event) { -#if 0 - ToolSettings *ts= CTX_data_tool_settings(C); - Scene *scene= CTX_data_scene(C); ScrArea *sa= CTX_wm_area(C); - View3D *v3d= sa->spacedata.first; switch(event) { - case 0: /* Undo Editing */ - BIF_undo(); - break; - case 1: /* Redo Editing */ - BIF_redo(); - break; case 2: /* transform properties */ add_blockhandler(sa, VIEW3D_HANDLER_OBJECT, 0); break; case 4: /* insert keyframe */ common_insertkey(); break; - case 5: /* Extrude */ - extrude_mesh(); - break; - case 6: /* duplicate */ - duplicate_context_selected(); - break; - case 7: /* make edge face */ - addedgeface_mesh(); - break; - case 8: /* delete */ - delete_context_selected(); - break; - case 9: /* Shrink/Fatten Along Normals */ - initTransform(TFM_SHRINKFATTEN, CTX_NONE); - Transform(); - break; - case 10: /* Shear */ - initTransform(TFM_SHEAR, CTX_NONE); - Transform(); - break; - case 11: /* Warp */ - initTransform(TFM_WARP, CTX_NONE); - Transform(); - break; - case 12: /* proportional edit (toggle) */ - if(ts->proportional) ts->proportional= 0; - else ts->proportional= 1; - break; - case 13: /* automerge edit (toggle) */ - if(ts->automerge) ts->automerge= 0; - else ts->automerge= 1; - break; - case 15: - uv_autocalc_tface(); - break; case 16: /* delete keyframe */ common_deletekey(); break; } -#endif } +#endif -static uiBlock *view3d_edit_meshmenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_edit_meshmenu(bContext *C, uiLayout *layout, void *arg_unused) { + Scene *scene= CTX_data_scene(C); ToolSettings *ts= CTX_data_tool_settings(C); - Object *obedit = CTX_data_edit_object(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "view3d_edit_meshmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_meshmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|Ctrl Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Redo Editing|Ctrl Shift Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); -// XXX uiDefIconTextBlockBut(block, editmode_undohistorymenu, NULL, ICON_RIGHTARROW_THIN, "Undo History", 0, yco-=20, 120, 19, ""); + PointerRNA tsptr; - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr); + + uiItemO(layout, "Undo Editing", 0, "ED_OT_undo"); + uiItemO(layout, "Redo Editing", 0, "ED_OT_redo"); + +#if 0 + uiDefIconTextBlockBut(block, editmode_undohistorymenu, NULL, ICON_RIGHTARROW_THIN, "Undo History", 0, yco-=20, 120, 19, ""); +#endif + + uiItemS(layout); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); +#if 0 uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - +#endif + + uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu); + + uiItemS(layout); + +#if 0 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "UV Unwrap|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Edge/Face|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_edit_mesh_verticesmenu, NULL, ICON_RIGHTARROW_THIN, "Vertices", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mesh_edgesmenu, NULL, ICON_RIGHTARROW_THIN, "Edges", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mesh_facesmenu, NULL, ICON_RIGHTARROW_THIN, "Faces", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mesh_normalsmenu, NULL, ICON_RIGHTARROW_THIN, "Normals", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - - if(ts->proportional) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - } - uiDefIconTextBlockBut(block, view3d_edit_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - /* PITA but we should let users know that automerge cant work with multires :/ */ - uiDefIconTextBut(block, BUTM, 1, - ts->automerge ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT, - ((Mesh*)obedit->data)->mr ? "AutoMerge Editing (disabled by multires)" : "AutoMerge Editing", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_edit_mesh_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Vertices", 0, yco-=20, 120, 19, ""); + uiItemS(layout); +#endif + + uiItemO(layout, NULL, 0, "UV_OT_mapping_menu"); + + uiItemS(layout); + + uiItemO(layout, NULL, 0, "MESH_OT_extrude"); + uiItemO(layout, NULL, 0, "MESH_OT_duplicate"); + uiItemO(layout, "Delete...", 0, "MESH_OT_delete"); + + uiItemS(layout); + + uiItemMenuF(layout, "Vertices", 0, view3d_edit_mesh_verticesmenu); + uiItemMenuF(layout, "Edges", 0, view3d_edit_mesh_edgesmenu); + uiItemMenuF(layout, "Faces", 0, view3d_edit_mesh_facesmenu); + uiItemMenuF(layout, "Normals", 0, view3d_edit_mesh_normalsmenu); + + uiItemS(layout); + + uiItemR(layout, NULL, 0, &tsptr, "automerge_editing", 0, 0, 0); + uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O + uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O + + uiItemS(layout); + uiItemMenuF(layout, "Show/Hide", 0, view3d_edit_mesh_showhidemenu); + +#if 0 #ifndef DISABLE_PYTHON - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiItemS(layout); uiDefIconTextBlockBut(block, view3d_edit_mesh_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, ""); #endif - - if(ar->alignment==RGN_ALIGN_TOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; +#endif } static void view3d_edit_curve_controlpointsmenu(bContext *C, uiLayout *layout, void *arg_unused) @@ -3085,10 +2738,11 @@ static void view3d_edit_curvemenu(bContext *C, uiLayout *layout, void *arg_unuse uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); - - uiItemS(layout); #endif + + uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu); + + uiItemS(layout); // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); // common_insertkey(); @@ -3111,7 +2765,7 @@ static void view3d_edit_curvemenu(bContext *C, uiLayout *layout, void *arg_unuse uiItemS(layout); uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O - uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); + uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O uiItemS(layout); @@ -3203,7 +2857,7 @@ static uiBlock *view3d_edit_metaballmenu(bContext *C, ARegion *ar, void *arg_unu uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N",0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); + // XXX uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); @@ -3280,9 +2934,12 @@ static void view3d_edit_latticemenu(bContext *C, uiLayout *layout, void *arg_unu uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); #endif + uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu); + + uiItemS(layout); + // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); // common_insertkey(); // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); @@ -3504,7 +3161,7 @@ static uiBlock *view3d_edit_armaturemenu(bContext *C, ARegion *ar, void *arg_unu uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Bone Sketching|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 23, ""); uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); + // XXX uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_armature_rollmenu, NULL, ICON_RIGHTARROW_THIN, "Bone Roll", 0, yco-=20, 120, 19, ""); if (arm->drawtype==ARM_ENVELOPE) @@ -4886,7 +4543,7 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o if (obedit) { if (ob && ob->type == OB_MESH) { xmax= GetButStringLength("Mesh"); - uiDefPulldownBut(block, view3d_edit_meshmenu, NULL, "Mesh", xco,yco, xmax-3, 20, ""); + uiDefMenuBut(block, view3d_edit_meshmenu, NULL, "Mesh", xco,yco, xmax-3, 20, ""); xco+= xmax; } else if (ob && ob->type == OB_CURVE) { xmax= GetButStringLength("Curve"); @@ -5270,36 +4927,3 @@ void view3d_header_buttons(const bContext *C, ARegion *ar) uiDrawBlock(C, block); } - - -/* edit face toolbox */ -static int editmesh_face_toolbox_invoke(bContext *C, wmOperator *op, wmEvent *event) -{ - uiPopupMenu *pup; - uiLayout *layout; - - pup= uiPupMenuBegin(C, "Edit Faces", 0); - layout= uiPupMenuLayout(pup); - - uiItemO(layout, NULL, 0, "MESH_OT_fill"); - uiItemO(layout, NULL, 0, "MESH_OT_beauty_fill"); - uiItemO(layout, NULL, 0, "MESH_OT_quads_convert_to_tris"); - uiItemO(layout, NULL, 0, "MESH_OT_tris_convert_to_quads"); - uiItemO(layout, NULL, 0, "MESH_OT_edge_flip"); - uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_smooth"); - uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_solid"); - uiPupMenuEnd(C, pup); - - return OPERATOR_CANCELLED; -} - -void VIEW3D_OT_editmesh_face_toolbox(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Edit Faces"; - ot->idname= "VIEW3D_OT_editmesh_face_toolbox"; - - /* api callbacks */ - ot->invoke= editmesh_face_toolbox_invoke; - ot->poll= ED_operator_editmesh; -} diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 170090cfeb8..236f9b0904a 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -80,7 +80,6 @@ void VIEW3D_OT_manipulator(struct wmOperatorType *ot); void VIEW3D_OT_render_border(struct wmOperatorType *ot); void VIEW3D_OT_zoom_border(struct wmOperatorType *ot); void VIEW3D_OT_drawtype(struct wmOperatorType *ot); -void VIEW3D_OT_editmesh_face_toolbox(struct wmOperatorType *ot); void view3d_boxview_copy(ScrArea *sa, ARegion *ar); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 25405909d0b..eb0fbabeeed 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -83,7 +83,6 @@ void view3d_operatortypes(void) WM_operatortype_append(VIEW3D_OT_select_lasso); WM_operatortype_append(VIEW3D_OT_setcameratoview); WM_operatortype_append(VIEW3D_OT_drawtype); - WM_operatortype_append(VIEW3D_OT_editmesh_face_toolbox); WM_operatortype_append(VIEW3D_OT_localview); WM_operatortype_append(VIEW3D_OT_game_start); WM_operatortype_append(VIEW3D_OT_layers); diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 4c855315bb3..801da08e611 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -1342,11 +1342,11 @@ static int select_inverse_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void UV_OT_select_invert(wmOperatorType *ot) +void UV_OT_select_inverse(wmOperatorType *ot) { /* identifiers */ - ot->name= "Select Invert"; - ot->idname= "UV_OT_select_invert"; + ot->name= "Select Inverse"; + ot->idname= "UV_OT_select_inverse"; ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* api callbacks */ @@ -3079,7 +3079,7 @@ void UV_OT_tile_set(wmOperatorType *ot) void ED_operatortypes_uvedit(void) { WM_operatortype_append(UV_OT_select_all_toggle); - WM_operatortype_append(UV_OT_select_invert); + WM_operatortype_append(UV_OT_select_inverse); WM_operatortype_append(UV_OT_select); WM_operatortype_append(UV_OT_select_loop); WM_operatortype_append(UV_OT_select_linked); @@ -3134,7 +3134,7 @@ void ED_keymap_uvedit(wmWindowManager *wm) WM_keymap_add_item(keymap, "UV_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "UV_OT_unlink_selection", LKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "UV_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "UV_OT_select_invert", IKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "UV_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "UV_OT_select_pinned", PKEY, KM_PRESS, KM_SHIFT, 0); /* uv operations */ diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 95467d13e8d..c4f4704e47e 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -1337,7 +1337,7 @@ static int mapping_menu_invoke(bContext *C, wmOperator *op, wmEvent *event) void UV_OT_mapping_menu(wmOperatorType *ot) { /* identifiers */ - ot->name= "Mapping Menu"; + ot->name= "UV Mapping"; ot->idname= "UV_OT_mapping_menu"; /* api callbacks */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 5f03b7167f4..b363e55ca75 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -199,6 +199,10 @@ void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode."); + prop= RNA_def_property(srna, "automerge_editing", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0); + RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location."); + prop= RNA_def_property(srna, "snap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP); RNA_def_property_ui_text(prop, "Snap", "Snap while Ctrl is held during transform."); diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index bc422e5a20c..64f2d896954 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -151,7 +151,6 @@ wchar_t* Py_GetPath(void) /* must be called before Py_Initialize */ void BPY_start_python_path(void) { - char py_path[FILE_MAXDIR + 11] = ""; char *py_path_bundle= BLI_gethome_folder("python"); if(py_path_bundle==NULL) @@ -162,15 +161,21 @@ void BPY_start_python_path(void) #if (defined(WIN32) || defined(WIN64)) #if defined(FREE_WINDOWS) - sprintf(py_path, "PYTHONPATH=%s", py_path_bundle); - putenv(py_path); + { + char py_path[FILE_MAXDIR + 11] = ""; + sprintf(py_path, "PYTHONPATH=%s", py_path_bundle); + putenv(py_path); + } #else _putenv_s("PYTHONPATH", py_path_bundle); #endif #else #ifdef __sgi - sprintf(py_path, "PYTHONPATH=%s", py_path_bundle); - putenv(py_path); + { + char py_path[FILE_MAXDIR + 11] = ""; + sprintf(py_path, "PYTHONPATH=%s", py_path_bundle); + putenv(py_path); + } #else setenv("PYTHONPATH", py_path_bundle, 1); #endif @@ -484,7 +489,10 @@ void BPY_run_ui_scripts(bContext *C, int reload) while((de = readdir(dir)) != NULL) { /* We could stat the file but easier just to let python * import it and complain if theres a problem */ - + + if(strstr(de->d_name, ".pyc")) + continue; + file_extension = strstr(de->d_name, ".py"); if(file_extension && *(file_extension + 3) == '\0') { diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 004cf2fb7c7..b183120dd2d 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -130,12 +130,12 @@ static PyObject *pyop_base_getattro( BPy_OperatorBase * self, PyObject *pyname ) PyObject *ret; wmOperatorType *ot; - if ((ot= WM_operatortype_find(name))) { - ret = PyCFunction_New( pyop_base_call_meth, pyname); /* set the name string as self, PyCFunction_New incref's self */ - } - else if ((ret = PyObject_GenericGetAttr((PyObject *)self, pyname))) { + if ((ret = PyObject_GenericGetAttr((PyObject *)self, pyname))) { /* do nothing, this accounts for methoddef's add and remove */ } + else if ((ot= WM_operatortype_find(name))) { + ret = PyCFunction_New( pyop_base_call_meth, pyname); /* set the name string as self, PyCFunction_New incref's self */ + } else { PyErr_Format( PyExc_AttributeError, "Operator \"%s\" not found", name); ret= NULL; diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index 60a9afda0c4..f8567414717 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -352,9 +352,10 @@ PyObject *PYOP_wrap_add(PyObject *self, PyObject *py_class) idname = _PyUnicode_AsString(item); /* remove if it already exists */ - if ((ot=WM_operatortype_find(idname))) { - if(ot->pyop_data) + if ((ot=WM_operatortype_exists(idname))) { + if(ot->pyop_data) { Py_XDECREF((PyObject*)ot->pyop_data); + } WM_operatortype_remove(idname); } @@ -402,7 +403,7 @@ PyObject *PYOP_wrap_remove(PyObject *self, PyObject *value) return NULL; } - if (!(ot= WM_operatortype_find(idname))) { + if (!(ot= WM_operatortype_exists(idname))) { PyErr_Format( PyExc_AttributeError, "Operator \"%s\" does not exists, cant remove", idname); return NULL; } diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 50ba2aec867..ff3a2feb521 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -132,6 +132,7 @@ void WM_operator_free (struct wmOperator *op); void WM_operator_stack_clear(struct bContext *C); wmOperatorType *WM_operatortype_find(const char *idname); +wmOperatorType *WM_operatortype_exists(const char *idname); wmOperatorType *WM_operatortype_first(void); void WM_operatortype_append (void (*opfunc)(wmOperatorType*)); void WM_operatortype_append_ptr (void (*opfunc)(wmOperatorType*, void *), void *userdata); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index d003f0786de..9cec463193e 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -94,6 +94,17 @@ wmOperatorType *WM_operatortype_find(const char *idname) return NULL; } +wmOperatorType *WM_operatortype_exists(const char *idname) +{ + wmOperatorType *ot; + + for(ot= global_ops.first; ot; ot= ot->next) { + if(strncmp(ot->idname, idname, OP_MAX_TYPENAME)==0) + return ot; + } + return NULL; +} + wmOperatorType *WM_operatortype_first(void) { return global_ops.first; -- cgit v1.2.3 From 3082d126306c2b593178d1bccfb42cef6c4b4ab1 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 8 Jul 2009 21:41:35 +0000 Subject: 2.5: * Rename OT_duplicate_add, to OT_duplicate. Also fixes warning print since I forgot to do this in the toolbar for MESH. --- source/blender/editors/object/object_edit.c | 14 +++++++------- source/blender/editors/object/object_intern.h | 2 +- source/blender/editors/object/object_ops.c | 4 ++-- source/blender/editors/space_node/node_edit.c | 14 +++++++------- source/blender/editors/space_node/node_intern.h | 2 +- source/blender/editors/space_node/node_ops.c | 4 ++-- source/blender/editors/space_sequencer/sequencer_edit.c | 6 +++--- source/blender/editors/space_sequencer/sequencer_intern.h | 2 +- source/blender/editors/space_sequencer/sequencer_ops.c | 4 ++-- 9 files changed, 26 insertions(+), 26 deletions(-) (limited to 'source') diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index f8e03e74f24..6a5b743056a 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -5959,7 +5959,7 @@ Base *ED_object_add_duplicate(Scene *scene, Base *base, int usedupflag) } /* contextual operator dupli */ -static int duplicate_add_exec(bContext *C, wmOperator *op) +static int duplicate_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); View3D *v3d= CTX_wm_view3d(C); @@ -5991,9 +5991,9 @@ static int duplicate_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int duplicate_add_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) { - duplicate_add_exec(C, op); + duplicate_exec(C, op); RNA_int_set(op->ptr, "mode", TFM_TRANSLATION); WM_operator_name_call(C, "TFM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr); @@ -6001,17 +6001,17 @@ static int duplicate_add_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_FINISHED; } -void OBJECT_OT_duplicate_add(wmOperatorType *ot) +void OBJECT_OT_duplicate(wmOperatorType *ot) { /* identifiers */ ot->name= "Duplicate Objects"; ot->description = "Duplicate the objects."; - ot->idname= "OBJECT_OT_duplicate_add"; + ot->idname= "OBJECT_OT_duplicate"; /* api callbacks */ - ot->invoke= duplicate_add_invoke; - ot->exec= duplicate_add_exec; + ot->invoke= duplicate_invoke; + ot->exec= duplicate_exec; ot->poll= ED_operator_scene_editable; diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 0948bfa405b..12776c08d4f 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -61,7 +61,7 @@ void OBJECT_OT_slowparent_clear(struct wmOperatorType *ot); void OBJECT_OT_center_set(struct wmOperatorType *ot); void OBJECT_OT_dupli_set_real(struct wmOperatorType *ot); void OBJECT_OT_object_add(struct wmOperatorType *ot); -void OBJECT_OT_duplicate_add(struct wmOperatorType *ot); +void OBJECT_OT_duplicate(struct wmOperatorType *ot); void OBJECT_OT_delete(struct wmOperatorType *ot); void OBJECT_OT_mesh_add(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 3710271bd20..3a9973b7ec5 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -84,7 +84,7 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_slowparent_clear); WM_operatortype_append(OBJECT_OT_center_set); WM_operatortype_append(OBJECT_OT_dupli_set_real); - WM_operatortype_append(OBJECT_OT_duplicate_add); + WM_operatortype_append(OBJECT_OT_duplicate); WM_operatortype_append(GROUP_OT_group_create); WM_operatortype_append(GROUP_OT_objects_remove); WM_operatortype_append(GROUP_OT_objects_add_active); @@ -160,7 +160,7 @@ void ED_keymap_object(wmWindowManager *wm) WM_keymap_verify_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "OBJECT_OT_primitive_add", AKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_verify_item(keymap, "OBJECT_OT_duplicate_add", DKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_verify_item(keymap, "OBJECT_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); // XXX this should probably be in screen instead... here for testing purposes in the meantime... - Aligorith WM_keymap_verify_item(keymap, "ANIM_OT_insert_keyframe_menu", IKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 1ba14bbd10e..89d81f846d2 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1689,7 +1689,7 @@ void node_mute(SpaceNode *snode) #endif -int node_duplicate_add_exec(bContext *C, wmOperator *op) +int node_duplicate_exec(bContext *C, wmOperator *op) { SpaceNode *snode= (SpaceNode*)CTX_wm_space_data(C); @@ -1702,9 +1702,9 @@ int node_duplicate_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int node_duplicate_add_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int node_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) { - node_duplicate_add_exec(C, op); + node_duplicate_exec(C, op); RNA_int_set(op->ptr, "mode", TFM_TRANSLATION); WM_operator_name_call(C, "TFM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr); @@ -1712,17 +1712,17 @@ static int node_duplicate_add_invoke(bContext *C, wmOperator *op, wmEvent *event return OPERATOR_FINISHED; } -void NODE_OT_duplicate_add(wmOperatorType *ot) +void NODE_OT_duplicate(wmOperatorType *ot) { /* identifiers */ ot->name= "Duplicate Nodes"; ot->description = "Duplicate the nodes."; - ot->idname= "NODE_OT_duplicate_add"; + ot->idname= "NODE_OT_duplicate"; /* api callbacks */ - ot->invoke= node_duplicate_add_invoke; - ot->exec= node_duplicate_add_exec; + ot->invoke= node_duplicate_invoke; + ot->exec= node_duplicate_exec; ot->poll= ED_operator_node_active; diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index b16971dab9e..d6680457376 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -82,7 +82,7 @@ void snode_composite_job(const struct bContext *C, ScrArea *sa); bNode *snode_get_editgroup(SpaceNode *snode); void snode_autoconnect(SpaceNode *snode, bNode *node_to, int flag); -void NODE_OT_duplicate_add(struct wmOperatorType *ot); +void NODE_OT_duplicate(struct wmOperatorType *ot); void NODE_OT_link(struct wmOperatorType *ot); void NODE_OT_delete(struct wmOperatorType *ot); void NODE_OT_resize(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c index 6df5dbd71d0..f78abb28313 100644 --- a/source/blender/editors/space_node/node_ops.c +++ b/source/blender/editors/space_node/node_ops.c @@ -58,7 +58,7 @@ void node_operatortypes(void) WM_operatortype_append(NODE_OT_link); WM_operatortype_append(NODE_OT_resize); WM_operatortype_append(NODE_OT_links_cut); - WM_operatortype_append(NODE_OT_duplicate_add); + WM_operatortype_append(NODE_OT_duplicate); } @@ -72,7 +72,7 @@ void node_keymap(struct wmWindowManager *wm) RNA_enum_set(WM_keymap_add_item(keymap, "NODE_OT_select_extend", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "select_type", NODE_SELECT_MOUSE); RNA_enum_set(WM_keymap_add_item(keymap, "NODE_OT_select_extend", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "select_type", NODE_SELECT_MOUSE); - WM_keymap_add_item(keymap, "NODE_OT_duplicate_add", DKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "NODE_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "NODE_OT_link", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "NODE_OT_resize", LEFTMOUSE, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 933c50ad20c..a030603996c 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1854,12 +1854,12 @@ static int sequencer_add_duplicate_invoke(bContext *C, wmOperator *op, wmEvent * return OPERATOR_FINISHED; } -void SEQUENCER_OT_duplicate_add(wmOperatorType *ot) +void SEQUENCER_OT_duplicate(wmOperatorType *ot) { /* identifiers */ - ot->name= "Add Duplicate"; - ot->idname= "SEQUENCER_OT_duplicate_add"; + ot->name= "Duplicate"; + ot->idname= "SEQUENCER_OT_duplicate"; /* api callbacks */ ot->invoke= sequencer_add_duplicate_invoke; diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index 0786ad17f1e..ac396440a00 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -83,7 +83,7 @@ void SEQUENCER_OT_lock(struct wmOperatorType *ot); void SEQUENCER_OT_unlock(struct wmOperatorType *ot); void SEQUENCER_OT_reload(struct wmOperatorType *ot); void SEQUENCER_OT_refresh_all(struct wmOperatorType *ot); -void SEQUENCER_OT_duplicate_add(struct wmOperatorType *ot); +void SEQUENCER_OT_duplicate(struct wmOperatorType *ot); void SEQUENCER_OT_delete(struct wmOperatorType *ot); void SEQUENCER_OT_images_separate(struct wmOperatorType *ot); void SEQUENCER_OT_meta_toggle(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index fd1d2237c10..82047272049 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -70,7 +70,7 @@ void sequencer_operatortypes(void) WM_operatortype_append(SEQUENCER_OT_unlock); WM_operatortype_append(SEQUENCER_OT_reload); WM_operatortype_append(SEQUENCER_OT_refresh_all); - WM_operatortype_append(SEQUENCER_OT_duplicate_add); + WM_operatortype_append(SEQUENCER_OT_duplicate); WM_operatortype_append(SEQUENCER_OT_delete); WM_operatortype_append(SEQUENCER_OT_images_separate); WM_operatortype_append(SEQUENCER_OT_meta_toggle); @@ -127,7 +127,7 @@ void sequencer_keymap(wmWindowManager *wm) WM_keymap_add_item(keymap, "SEQUENCER_OT_reload", RKEY, KM_PRESS, KM_ALT, 0); - WM_keymap_add_item(keymap, "SEQUENCER_OT_duplicate_add", DKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "SEQUENCER_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_delete", XKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_delete", DELKEY, KM_PRESS, 0, 0); -- cgit v1.2.3 From 518911e78c2ae4511cbb9261c5cca410c0a77d73 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 9 Jul 2009 01:04:42 +0000 Subject: NLA SoC: Assorted cleanups * Some cleanups aimed at giving some (neglible) speedups * Preparation for NLA-Strip keyframes to be editable --- source/blender/blenkernel/BKE_nla.h | 2 ++ source/blender/blenkernel/intern/anim_sys.c | 8 +++-- source/blender/blenkernel/intern/nla.c | 41 ++++++++++++++++++++++- source/blender/editors/interface/interface_anim.c | 10 +++--- source/blender/makesdna/DNA_anim_types.h | 2 ++ 5 files changed, 55 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 7fdff7e41f7..04d4b0f8da2 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -83,6 +83,8 @@ struct NlaStrip *BKE_nlastrip_find_active(struct NlaTrack *nlt); short BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max); +short BKE_nlatrack_has_animated_strips(struct NlaTrack *nlt); +short BKE_nlatracks_have_animated_strips(ListBase *tracks); void BKE_nlastrip_validate_fcurves(struct NlaStrip *strip); /* ............ */ diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 1037b2fd15d..ebe3d28cb21 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -392,10 +392,10 @@ void BKE_keyingsets_free (ListBase *list) short animsys_remap_path (AnimMapper *remap, char *path, char **dst) { /* is there a valid remapping table to use? */ - if (remap) { + //if (remap) { /* find a matching entry... to use to remap */ // ...TODO... - } + //} /* nothing suitable found, so just set dst to look at path (i.e. no alloc/free needed) */ *dst= path; @@ -521,7 +521,6 @@ static void animsys_evaluate_drivers (PointerRNA *ptr, AnimData *adt, float ctim short ok= 0; /* check if this driver's curve should be skipped */ - // FIXME: maybe we shouldn't check for muted, though that would make things more confusing, as there's already too many ways to disable? if ((fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) == 0) { /* check if driver itself is tagged for recalculation */ @@ -1185,6 +1184,9 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime) ListBase echannels= {NULL, NULL}; NlaEvalStrip *nes; + // TODO: need to zero out all channels used, otherwise we have problems with threadsafety + // and also when the user jumps between different times instead of moving sequentially... + /* 1. get the stack of strips to evaluate at current time (influence calculated here) */ for (nlt=adt->nla_tracks.first; nlt; nlt=nlt->next, track_index++) { /* if tweaking is on and this strip is the tweaking track, stop on this one */ diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 217444d16d2..c697f639021 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -926,7 +926,6 @@ void BKE_nlatrack_set_active (ListBase *tracks, NlaTrack *nlt_a) nlt_a->flag |= NLATRACK_ACTIVE; } - /* Check if there is any space in the given track to add a strip of the given length */ short BKE_nlatrack_has_space (NlaTrack *nlt, float start, float end) { @@ -1050,6 +1049,46 @@ short nlastrip_is_first (AnimData *adt, NlaStrip *strip) return 1; } +/* Animated Strips ------------------------------------------- */ + +/* Check if the given NLA-Track has any strips with own F-Curves */ +short BKE_nlatrack_has_animated_strips (NlaTrack *nlt) +{ + NlaStrip *strip; + + /* sanity checks */ + if ELEM(NULL, nlt, nlt->strips.first) + return 0; + + /* check each strip for F-Curves only (don't care about whether the flags are set) */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + if (strip->fcurves.first) + return 1; + } + + /* none found */ + return 0; +} + +/* Check if given NLA-Tracks have any strips with own F-Curves */ +short BKE_nlatracks_have_animated_strips (ListBase *tracks) +{ + NlaTrack *nlt; + + /* sanity checks */ + if ELEM(NULL, tracks, tracks->first) + return 0; + + /* check each track, stopping on the first hit */ + for (nlt= tracks->first; nlt; nlt= nlt->next) { + if (BKE_nlatrack_has_animated_strips(nlt)) + return 1; + } + + /* none found */ + return 0; +} + /* Validate the NLA-Strips 'control' F-Curves based on the flags set*/ void BKE_nlastrip_validate_fcurves (NlaStrip *strip) { diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index be4087de525..7c439f408ba 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -30,12 +30,15 @@ void ui_but_anim_flag(uiBut *but, float cfra) { but->flag &= ~(UI_BUT_ANIMATED|UI_BUT_ANIMATED_KEY|UI_BUT_DRIVEN); - - if(but->rnaprop && but->rnapoin.id.data) { + + /* there must be some RNA-pointer + property combo for this button */ + if (but->rnaprop && but->rnapoin.id.data && + RNA_property_animateable(&but->rnapoin, but->rnaprop)) + { AnimData *adt= BKE_animdata_from_id(but->rnapoin.id.data); FCurve *fcu; char *path; - + if (adt) { if ((adt->action && adt->action->curves.first) || (adt->drivers.first)) { /* XXX this function call can become a performance bottleneck */ @@ -113,7 +116,6 @@ void ui_but_anim_remove_driver(bContext *C) WM_operator_name_call(C, "ANIM_OT_remove_driver_button", WM_OP_INVOKE_DEFAULT, NULL); } -// TODO: refine the logic for adding/removing drivers... void ui_but_anim_menu(bContext *C, uiBut *but) { uiPopupMenu *pup; diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index cb9dc8f0bc7..ac8d44a86e6 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -741,6 +741,8 @@ enum { ADT_NLA_EDIT_ON = (1<<2), /* active Action for 'tweaking' does not have mapping applied for editing */ ADT_NLA_EDIT_NOMAP = (1<<3), + /* NLA-Strip F-Curves are expanded in UI */ + ADT_NLA_SKEYS_COLLAPSED = (1<<4), /* drivers expanded in UI */ ADT_DRIVERS_COLLAPSED = (1<<10), -- cgit v1.2.3 From 27d80365fa3abf5db3ebf509d712d947564d8447 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 9 Jul 2009 01:32:13 +0000 Subject: NLA SoC: Toggle muting operator - HKEY This operator provides a quick way of toggling the muted-status of several strips at the same time. --- source/blender/editors/space_nla/nla_edit.c | 60 +++++++++++++++++++++++++++ source/blender/editors/space_nla/nla_header.c | 4 ++ source/blender/editors/space_nla/nla_intern.h | 2 + source/blender/editors/space_nla/nla_ops.c | 5 +++ 4 files changed, 71 insertions(+) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 0198a66949e..262255524db 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -857,6 +857,66 @@ void NLA_OT_split (wmOperatorType *ot) /* *********************************************** */ /* NLA Editing Operations (Modifying) */ +/* ******************** Toggle Muting Operator ************************** */ +/* Toggles whether strips are muted or not */ + +static int nlaedit_toggle_mute_exec (bContext *C, wmOperator *op) +{ + bAnimContext ac; + + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* get a list of the editable tracks being shown in the NLA */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* go over all selected strips */ + for (ale= anim_data.first; ale; ale= ale->next) { + NlaTrack *nlt= (NlaTrack *)ale->data; + NlaStrip *strip; + + /* for every selected strip, toggle muting */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + if (strip->flag & NLASTRIP_FLAG_SELECT) { + /* just flip the mute flag for now */ + // TODO: have a pre-pass to check if mute all or unmute all? + strip->flag ^= NLASTRIP_FLAG_MUTED; + } + } + } + + /* free temp data */ + BLI_freelistN(&anim_data); + + /* set notifier that things have changed */ + ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_SCENE, NULL); + + /* done */ + return OPERATOR_FINISHED; +} + +void NLA_OT_mute_toggle (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Toggle Muting"; + ot->idname= "NLA_OT_mute_toggle"; + ot->description= "Mute or un-muted selected strips."; + + /* api callbacks */ + ot->exec= nlaedit_toggle_mute_exec; + ot->poll= nlaop_poll_tweakmode_off; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /* ******************** Move Strips Up Operator ************************** */ /* Tries to move the selected strips into the track above if possible. */ diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index 9a2806ed9c1..a82056d6efb 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -168,6 +168,10 @@ static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); + uiItemO(layout, NULL, 0, "NLA_OT_mute_toggle"); + + uiItemS(layout); + uiItemO(layout, NULL, 0, "NLA_OT_apply_scale"); uiItemO(layout, NULL, 0, "NLA_OT_clear_scale"); diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 3d8bfcd0546..7cc09707ba7 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -98,6 +98,8 @@ void NLA_OT_duplicate(wmOperatorType *ot); void NLA_OT_delete(wmOperatorType *ot); void NLA_OT_split(wmOperatorType *ot); +void NLA_OT_mute_toggle(wmOperatorType *ot); + void NLA_OT_move_up(wmOperatorType *ot); void NLA_OT_move_down(wmOperatorType *ot); diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 25fd8db668c..431768c4e02 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -153,6 +153,8 @@ void nla_operatortypes(void) WM_operatortype_append(NLA_OT_delete); WM_operatortype_append(NLA_OT_split); + WM_operatortype_append(NLA_OT_mute_toggle); + WM_operatortype_append(NLA_OT_move_up); WM_operatortype_append(NLA_OT_move_down); @@ -256,6 +258,9 @@ static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap) /* split */ WM_keymap_add_item(keymap, "NLA_OT_split", YKEY, KM_PRESS, 0, 0); + /* toggles */ + WM_keymap_add_item(keymap, "NLA_OT_mute_toggle", HKEY, KM_PRESS, 0, 0); + /* move up */ WM_keymap_add_item(keymap, "NLA_OT_move_up", PAGEUPKEY, KM_PRESS, 0, 0); /* move down */ -- cgit v1.2.3 From 304cbc09ab5027893bbc0b96b17f84b6f03fdb85 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Thu, 9 Jul 2009 01:48:08 +0000 Subject: Cosmetic changes in etch-a-ton drawing code, mostly. --- source/blender/blenlib/BLI_graph.h | 1 + .../editors/armature/editarmature_generate.c | 25 +- .../blender/editors/armature/editarmature_sketch.c | 1118 +++++++++++--------- source/blender/editors/armature/reeb.c | 3 + source/blender/editors/armature/reeb.h | 1 + 5 files changed, 636 insertions(+), 512 deletions(-) (limited to 'source') diff --git a/source/blender/blenlib/BLI_graph.h b/source/blender/blenlib/BLI_graph.h index f4fccfcbb2c..1dd439468f7 100644 --- a/source/blender/blenlib/BLI_graph.h +++ b/source/blender/blenlib/BLI_graph.h @@ -88,6 +88,7 @@ typedef struct BArcIterator { StoppedFct stopped; float *p, *no; + float size; int length; int index; diff --git a/source/blender/editors/armature/editarmature_generate.c b/source/blender/editors/armature/editarmature_generate.c index 6d271375c64..6c0eab16af0 100644 --- a/source/blender/editors/armature/editarmature_generate.c +++ b/source/blender/editors/armature/editarmature_generate.c @@ -285,6 +285,8 @@ EditBone * subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase * EditBone *lastBone = NULL; EditBone *child = NULL; EditBone *parent = NULL; + float *normal = NULL; + float size_buffer = 1.2; int bone_start = 0; int end = iter->length; int index; @@ -294,6 +296,13 @@ EditBone * subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase * parent = addEditBone(arm, "Bone"); VECCOPY(parent->head, iter->p); + if (iter->size > 0) + { + parent->rad_head = iter->size * size_buffer; + } + + normal = iter->no; + index = next_subdividion(toolsettings, iter, bone_start, end, parent->head, parent->tail); while (index != -1) { @@ -304,21 +313,33 @@ EditBone * subdivideArcBy(ToolSettings *toolsettings, bArmature *arm, ListBase * child->parent = parent; child->flag |= BONE_CONNECTED; + if (iter->size > 0) + { + child->rad_head = iter->size * size_buffer; + parent->rad_tail = iter->size * size_buffer; + } + /* going to next bone, fix parent */ Mat4MulVecfl(invmat, parent->tail); Mat4MulVecfl(invmat, parent->head); - setBoneRollFromNormal(parent, iter->no, invmat, tmat); + setBoneRollFromNormal(parent, normal, invmat, tmat); parent = child; // new child is next parent bone_start = index; // start next bone from current index + normal = iter->no; /* use normal at head, not tail */ + index = next_subdividion(toolsettings, iter, bone_start, end, parent->head, parent->tail); } iter->tail(iter); VECCOPY(parent->tail, iter->p); - + if (iter->size > 0) + { + parent->rad_tail = iter->size * size_buffer; + } + /* fix last bone */ Mat4MulVecfl(invmat, parent->tail); Mat4MulVecfl(invmat, parent->head); diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 816df0f81c9..6e6e61dafc2 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -90,6 +90,7 @@ typedef struct SK_Point { float p[3]; float no[3]; + float size; SK_PType type; SK_PMode mode; } SK_Point; @@ -136,6 +137,7 @@ typedef struct SK_Intersection typedef struct SK_Sketch { ListBase strokes; + ListBase depth_peels; SK_Stroke *active_stroke; SK_Stroke *gesture; SK_Point next_point; @@ -150,9 +152,10 @@ typedef struct SK_StrokeIterator { NextNFct nextN; PreviousFct previous; StoppedFct stopped; - + float *p, *no; - + float size; + int length; int index; /*********************************/ @@ -251,19 +254,19 @@ void BIF_makeListTemplates(bContext *C) { BLI_ghash_free(TEMPLATES_HASH, NULL, NULL); } - + TEMPLATES_HASH = BLI_ghash_new(BLI_ghashutil_inthash, BLI_ghashutil_intcmp); TEMPLATES_CURRENT = 0; for ( base = FIRSTBASE; base; base = base->next ) { Object *ob = base->object; - + if (ob != obedit && ob->type == OB_ARMATURE) { index++; BLI_ghash_insert(TEMPLATES_HASH, SET_INT_IN_POINTER(index), ob); - + if (ob == ts->skgen_template) { TEMPLATES_CURRENT = index; @@ -277,30 +280,30 @@ char *BIF_listTemplates(bContext *C) GHashIterator ghi; char menu_header[] = "Template%t|None%x0|"; char *p; - + if (TEMPLATES_MENU != NULL) { MEM_freeN(TEMPLATES_MENU); } - + TEMPLATES_MENU = MEM_callocN(sizeof(char) * (BLI_ghash_size(TEMPLATES_HASH) * 32 + 30), "skeleton template menu"); - + p = TEMPLATES_MENU; - + p += sprintf(TEMPLATES_MENU, "%s", menu_header); - + BLI_ghashIterator_init(&ghi, TEMPLATES_HASH); - + while (!BLI_ghashIterator_isDone(&ghi)) { Object *ob = BLI_ghashIterator_getValue(&ghi); int key = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&ghi)); - + p += sprintf(p, "|%s%%x%i", ob->id.name+2, key); - + BLI_ghashIterator_step(&ghi); } - + return TEMPLATES_MENU; } @@ -312,22 +315,22 @@ int BIF_currentTemplate(bContext *C) { GHashIterator ghi; BLI_ghashIterator_init(&ghi, TEMPLATES_HASH); - + while (!BLI_ghashIterator_isDone(&ghi)) { Object *ob = BLI_ghashIterator_getValue(&ghi); int key = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&ghi)); - + if (ob == ts->skgen_template) { TEMPLATES_CURRENT = key; break; } - + BLI_ghashIterator_step(&ghi); } } - + return TEMPLATES_CURRENT; } @@ -338,7 +341,7 @@ RigGraph* sk_makeTemplateGraph(bContext *C, Object *ob) { return NULL; } - + if (ob != NULL) { if (TEMPLATE_RIGG && TEMPLATE_RIGG->ob != ob) @@ -346,17 +349,17 @@ RigGraph* sk_makeTemplateGraph(bContext *C, Object *ob) RIG_freeRigGraph((BGraph*)TEMPLATE_RIGG); TEMPLATE_RIGG = NULL; } - + if (TEMPLATE_RIGG == NULL) { bArmature *arm; arm = ob->data; - + TEMPLATE_RIGG = RIG_graphFromArmature(C, ob, arm); } } - + return TEMPLATE_RIGG; } @@ -364,14 +367,14 @@ int BIF_nbJointsTemplate(bContext *C) { ToolSettings *ts = CTX_data_tool_settings(C); RigGraph *rg = sk_makeTemplateGraph(C, ts->skgen_template); - + if (rg) { return RIG_nbJoints(rg); } else { - return -1; + return -1; } } @@ -386,9 +389,9 @@ char * BIF_nameBoneTemplate(bContext *C) { index = stk->active_stroke->nb_points; } - + rg = sk_makeTemplateGraph(C, ts->skgen_template); - + if (rg == NULL) { return ""; @@ -404,13 +407,13 @@ void BIF_freeTemplates(bContext *C) MEM_freeN(TEMPLATES_MENU); TEMPLATES_MENU = NULL; } - + if (TEMPLATES_HASH != NULL) { BLI_ghash_free(TEMPLATES_HASH, NULL, NULL); TEMPLATES_HASH = NULL; } - + if (TEMPLATE_RIGG != NULL) { RIG_freeRigGraph((BGraph*)TEMPLATE_RIGG); @@ -428,14 +431,14 @@ void BIF_setTemplate(bContext *C, int index) else { ts->skgen_template = NULL; - + if (TEMPLATE_RIGG != NULL) { RIG_freeRigGraph((BGraph*)TEMPLATE_RIGG); } TEMPLATE_RIGG = NULL; } -} +} /*********************** CONVERSION ***************************/ @@ -456,7 +459,7 @@ void sk_autoname(bContext *C, ReebArc *arc) char *side = ts->skgen_side_string; int valid = 0; int caps = 0; - + if (BLI_streq(side, "")) { valid = 1; @@ -471,7 +474,7 @@ void sk_autoname(bContext *C, ReebArc *arc) valid = 1; caps = 0; } - + if (valid) { if (arc->head->p[0] < 0) @@ -490,14 +493,14 @@ void sk_autoname(bContext *C, ReebArc *arc) ReebNode *sk_pointToNode(SK_Point *pt, float imat[][4], float tmat[][3]) { ReebNode *node; - + node = MEM_callocN(sizeof(ReebNode), "reeb node"); VECCOPY(node->p, pt->p); Mat4MulVecfl(imat, node->p); - + VECCOPY(node->no, pt->no); Mat3MulVecfl(tmat, node->no); - + return node; } @@ -505,14 +508,14 @@ ReebArc *sk_strokeToArc(SK_Stroke *stk, float imat[][4], float tmat[][3]) { ReebArc *arc; int i; - + arc = MEM_callocN(sizeof(ReebArc), "reeb arc"); arc->head = sk_pointToNode(stk->points, imat, tmat); arc->tail = sk_pointToNode(sk_lastStrokePoint(stk), imat, tmat); - + arc->bcount = stk->nb_points - 2; /* first and last are nodes, don't count */ arc->buckets = MEM_callocN(sizeof(EmbedBucket) * arc->bcount, "Buckets"); - + for (i = 0; i < arc->bcount; i++) { VECCOPY(arc->buckets[i].p, stk->points[i + 1].p); @@ -521,7 +524,7 @@ ReebArc *sk_strokeToArc(SK_Stroke *stk, float imat[][4], float tmat[][3]) VECCOPY(arc->buckets[i].no, stk->points[i + 1].no); Mat3MulVecfl(tmat, arc->buckets[i].no); } - + return arc; } @@ -533,22 +536,22 @@ void sk_retargetStroke(bContext *C, SK_Stroke *stk) float tmat[3][3]; ReebArc *arc; RigGraph *rg; - + Mat4Invert(imat, obedit->obmat); - + Mat3CpyMat4(tmat, obedit->obmat); Mat3Transp(tmat); arc = sk_strokeToArc(stk, imat, tmat); - + sk_autoname(C, arc); - + rg = sk_makeTemplateGraph(C, ts->skgen_template); BIF_retargetArc(C, arc, rg); - + sk_autoname(C, NULL); - + MEM_freeN(arc->head); MEM_freeN(arc->tail); REEB_freeArc((BArc*)arc); @@ -559,29 +562,31 @@ void sk_retargetStroke(bContext *C, SK_Stroke *stk) void sk_freeSketch(SK_Sketch *sketch) { SK_Stroke *stk, *next; - + for (stk = sketch->strokes.first; stk; stk = next) { next = stk->next; - + sk_freeStroke(stk); } - + + BLI_freelistN(&sketch->depth_peels); + MEM_freeN(sketch); } SK_Sketch* sk_createSketch() { SK_Sketch *sketch; - + sketch = MEM_callocN(sizeof(SK_Sketch), "SK_Sketch"); - + sketch->active_stroke = NULL; sketch->gesture = NULL; sketch->strokes.first = NULL; sketch->strokes.last = NULL; - + return sketch; } @@ -614,15 +619,15 @@ void sk_freeStroke(SK_Stroke *stk) SK_Stroke* sk_createStroke() { SK_Stroke *stk; - + stk = MEM_callocN(sizeof(SK_Stroke), "SK_Stroke"); - + stk->selected = 0; stk->nb_points = 0; stk->buf_size = SK_Stroke_BUFFER_INIT_SIZE; - + sk_allocStrokeBuffer(stk); - + return stk; } @@ -631,13 +636,13 @@ void sk_shrinkStrokeBuffer(SK_Stroke *stk) if (stk->nb_points < stk->buf_size) { SK_Point *old_points = stk->points; - + stk->buf_size = stk->nb_points; - sk_allocStrokeBuffer(stk); - + sk_allocStrokeBuffer(stk); + memcpy(stk->points, old_points, sizeof(SK_Point) * stk->nb_points); - + MEM_freeN(old_points); } } @@ -647,13 +652,13 @@ void sk_growStrokeBuffer(SK_Stroke *stk) if (stk->nb_points == stk->buf_size) { SK_Point *old_points = stk->points; - + stk->buf_size *= 2; - + sk_allocStrokeBuffer(stk); - + memcpy(stk->points, old_points, sizeof(SK_Point) * stk->nb_points); - + MEM_freeN(old_points); } } @@ -663,16 +668,16 @@ void sk_growStrokeBufferN(SK_Stroke *stk, int n) if (stk->nb_points + n > stk->buf_size) { SK_Point *old_points = stk->points; - + while (stk->nb_points + n > stk->buf_size) { stk->buf_size *= 2; } - + sk_allocStrokeBuffer(stk); - + memcpy(stk->points, old_points, sizeof(SK_Point) * stk->nb_points); - + MEM_freeN(old_points); } } @@ -686,52 +691,52 @@ void sk_replaceStrokePoint(SK_Stroke *stk, SK_Point *pt, int n) void sk_insertStrokePoint(SK_Stroke *stk, SK_Point *pt, int n) { int size = stk->nb_points - n; - + sk_growStrokeBuffer(stk); - + memmove(stk->points + n + 1, stk->points + n, size * sizeof(SK_Point)); - + memcpy(stk->points + n, pt, sizeof(SK_Point)); - + stk->nb_points++; } void sk_appendStrokePoint(SK_Stroke *stk, SK_Point *pt) { sk_growStrokeBuffer(stk); - + memcpy(stk->points + stk->nb_points, pt, sizeof(SK_Point)); - + stk->nb_points++; } void sk_insertStrokePoints(SK_Stroke *stk, SK_Point *pts, int len, int start, int end) { int size = end - start + 1; - + sk_growStrokeBufferN(stk, len - size); - + if (len != size) { int tail_size = stk->nb_points - end + 1; - + memmove(stk->points + start + len, stk->points + end + 1, tail_size * sizeof(SK_Point)); } - + memcpy(stk->points + start, pts, len * sizeof(SK_Point)); - + stk->nb_points += len - size; } void sk_trimStroke(SK_Stroke *stk, int start, int end) { int size = end - start + 1; - + if (start > 0) { memmove(stk->points, stk->points + start, size * sizeof(SK_Point)); } - + stk->nb_points = size; } @@ -741,27 +746,27 @@ void sk_straightenStroke(SK_Stroke *stk, int start, int end, float p_start[3], f SK_Point *prev, *next; float delta_p[3]; int i, total; - + total = end - start; VecSubf(delta_p, p_end, p_start); - + prev = stk->points + start; next = stk->points + end; - + VECCOPY(pt1.p, p_start); VECCOPY(pt1.no, prev->no); pt1.mode = prev->mode; pt1.type = prev->type; - + VECCOPY(pt2.p, p_end); VECCOPY(pt2.no, next->no); pt2.mode = next->mode; pt2.type = next->type; - + sk_insertStrokePoint(stk, &pt1, start + 1); /* insert after start */ sk_insertStrokePoint(stk, &pt2, end + 1); /* insert before end (since end was pushed back already) */ - + for (i = 1; i < total; i++) { float delta = (float)i / (float)total; @@ -770,14 +775,14 @@ void sk_straightenStroke(SK_Stroke *stk, int start, int end, float p_start[3], f VECCOPY(p, delta_p); VecMulf(p, delta); VecAddf(p, p, p_start); - } + } } void sk_polygonizeStroke(SK_Stroke *stk, int start, int end) { int offset; int i; - + /* find first exact points outside of range */ for (;start > 0; start--) { @@ -786,7 +791,7 @@ void sk_polygonizeStroke(SK_Stroke *stk, int start, int end) break; } } - + for (;end < stk->nb_points - 1; end++) { if (stk->points[end].type == PT_EXACT) @@ -794,9 +799,9 @@ void sk_polygonizeStroke(SK_Stroke *stk, int start, int end) break; } } - + offset = start + 1; - + for (i = start + 1; i < end; i++) { if (stk->points[i].type == PT_EXACT) @@ -809,7 +814,7 @@ void sk_polygonizeStroke(SK_Stroke *stk, int start, int end) offset++; } } - + /* some points were removes, move end of array */ if (offset < end) { @@ -824,15 +829,15 @@ void sk_flattenStroke(SK_Stroke *stk, int start, int end) float normal[3], distance[3]; float limit; int i, total; - + total = end - start + 1; - + VECCOPY(normal, stk->points[start].no); - + VecSubf(distance, stk->points[end].p, stk->points[start].p); Projf(normal, distance, normal); limit = Normalize(normal); - + for (i = 1; i < total - 1; i++) { float d = limit * i / total; @@ -841,13 +846,13 @@ void sk_flattenStroke(SK_Stroke *stk, int start, int end) VecSubf(distance, p, stk->points[start].p); Projf(distance, distance, normal); - + VECCOPY(offset, normal); VecMulf(offset, d); - + VecSubf(p, p, distance); VecAddf(p, p, offset); - } + } } void sk_removeStroke(SK_Sketch *sketch, SK_Stroke *stk) @@ -856,7 +861,7 @@ void sk_removeStroke(SK_Sketch *sketch, SK_Stroke *stk) { sketch->active_stroke = NULL; } - + BLI_remlink(&sketch->strokes, stk); sk_freeStroke(stk); } @@ -865,14 +870,14 @@ void sk_reverseStroke(SK_Stroke *stk) { SK_Point *old_points = stk->points; int i = 0; - + sk_allocStrokeBuffer(stk); - + for (i = 0; i < stk->nb_points; i++) { sk_copyPoint(stk->points + i, old_points + stk->nb_points - 1 - i); } - + MEM_freeN(old_points); } @@ -893,9 +898,9 @@ void sk_filterStroke(SK_Stroke *stk, int start, int end) SK_Point *old_points = stk->points; int nb_points = stk->nb_points; int i, j; - + return; - + if (start == -1) { start = 0; @@ -904,30 +909,30 @@ void sk_filterStroke(SK_Stroke *stk, int start, int end) sk_allocStrokeBuffer(stk); stk->nb_points = 0; - + /* adding points before range */ for (i = 0; i < start; i++) { sk_appendStrokePoint(stk, old_points + i); } - + for (i = start, j = start; i <= end; i++) { if (i - j == 3) { SK_Point pt; float vec[3]; - + sk_copyPoint(&pt, &old_points[j+1]); pt.p[0] = 0; pt.p[1] = 0; pt.p[2] = 0; - + VECCOPY(vec, old_points[j].p); VecMulf(vec, -0.25); VecAddf(pt.p, pt.p, vec); - + VECCOPY(vec, old_points[j+1].p); VecMulf(vec, 0.75); VecAddf(pt.p, pt.p, vec); @@ -939,20 +944,22 @@ void sk_filterStroke(SK_Stroke *stk, int start, int end) VECCOPY(vec, old_points[j+3].p); VecMulf(vec, -0.25); VecAddf(pt.p, pt.p, vec); - + + pt.size = -0.25 * old_points[j].size + 0.75 * old_points[j+1].size + 0.75 * old_points[j+2].size - 0.25 * old_points[j+3].size; + sk_appendStrokePoint(stk, &pt); j += 2; } - + /* this might be uneeded when filtering last continuous stroke */ if (old_points[i].type == PT_EXACT) { sk_appendStrokePoint(stk, old_points + i); j = i; } - } - + } + /* adding points after range */ for (i = end + 1; i < nb_points; i++) { @@ -967,14 +974,14 @@ void sk_filterStroke(SK_Stroke *stk, int start, int end) void sk_filterLastContinuousStroke(SK_Stroke *stk) { int start, end; - + end = stk->nb_points -1; - + for (start = end - 1; start > 0 && stk->points[start].type == PT_CONTINUOUS; start--) { /* nothing to do here*/ } - + if (end - start > 1) { sk_filterStroke(stk, start, end); @@ -984,46 +991,118 @@ void sk_filterLastContinuousStroke(SK_Stroke *stk) SK_Point *sk_lastStrokePoint(SK_Stroke *stk) { SK_Point *pt = NULL; - + if (stk->nb_points > 0) { pt = stk->points + (stk->nb_points - 1); } - + return pt; } +float sk_clampPointSize(SK_Point *pt, float size) +{ + return MAX2(size * pt->size, size / 2); +} + +void sk_drawPoint(GLUquadric *quad, SK_Point *pt, float size) +{ + glTranslatef(pt->p[0], pt->p[1], pt->p[2]); + gluSphere(quad, sk_clampPointSize(pt, size), 8, 8); +} + +void sk_drawEdge(GLUquadric *quad, SK_Point *pt0, SK_Point *pt1, float size) +{ + float vec1[3], vec2[3] = {0, 0, 1}, axis[3]; + float angle, length; + + VecSubf(vec1, pt1->p, pt0->p); + length = Normalize(vec1); + Crossf(axis, vec2, vec1); + + if (VecIsNull(axis)) + { + axis[1] = 1; + } + + angle = NormalizedVecAngle2(vec2, vec1); + + glRotatef(angle * 180 / M_PI + 180, axis[0], axis[1], axis[2]); + + gluCylinder(quad, sk_clampPointSize(pt1, size), sk_clampPointSize(pt0, size), length, 8, 8); +} + +void sk_drawNormal(GLUquadric *quad, SK_Point *pt, float size, float height) +{ + float vec2[3] = {0, 0, 1}, axis[3]; + float angle; + + glPushMatrix(); + + Crossf(axis, vec2, pt->no); + + if (VecIsNull(axis)) + { + axis[1] = 1; + } + + angle = NormalizedVecAngle2(vec2, pt->no); + + glRotatef(angle * 180 / M_PI, axis[0], axis[1], axis[2]); + + glColor3f(0, 1, 1); + gluCylinder(quad, sk_clampPointSize(pt, size), 0, sk_clampPointSize(pt, height), 10, 2); + + glPopMatrix(); +} + void sk_drawStroke(SK_Stroke *stk, int id, float color[3], int start, int end) { float rgb[3]; int i; - + GLUquadric *quad = gluNewQuadric(); + gluQuadricNormals(quad, GLU_SMOOTH); + if (id != -1) { glLoadName(id); - - glBegin(GL_LINE_STRIP); - + for (i = 0; i < stk->nb_points; i++) { - glVertex3fv(stk->points[i].p); + glPushMatrix(); + + sk_drawPoint(quad, stk->points + i, 0.1); + + if (i > 0) + { + sk_drawEdge(quad, stk->points + i - 1, stk->points + i, 0.1); + } + + glPopMatrix(); } - - glEnd(); - + } else { float d_rgb[3] = {1, 1, 1}; - + VECCOPY(rgb, color); VecSubf(d_rgb, d_rgb, rgb); VecMulf(d_rgb, 1.0f / (float)stk->nb_points); - - glBegin(GL_LINE_STRIP); for (i = 0; i < stk->nb_points; i++) { + SK_Point *pt = stk->points + i; + + glPushMatrix(); + + if (pt->type == PT_EXACT) + { + glColor3f(0, 0, 0); + sk_drawPoint(quad, pt, 0.15); + sk_drawNormal(quad, pt, 0.05, 0.9); + } + if (i >= start && i <= end) { glColor3f(0.3, 0.3, 0.3); @@ -1032,99 +1111,78 @@ void sk_drawStroke(SK_Stroke *stk, int id, float color[3], int start, int end) { glColor3fv(rgb); } - glVertex3fv(stk->points[i].p); - VecAddf(rgb, rgb, d_rgb); - } - - glEnd(); -#if 0 - glColor3f(0, 0, 1); - glBegin(GL_LINES); + if (pt->type != PT_EXACT) + { - for (i = 0; i < stk->nb_points; i++) - { - float *p = stk->points[i].p; - float *no = stk->points[i].no; - glVertex3fv(p); - glVertex3f(p[0] + no[0], p[1] + no[1], p[2] + no[2]); - } - - glEnd(); -#endif + sk_drawPoint(quad, pt, 0.1); + } - glColor3f(0, 0, 0); - glBegin(GL_POINTS); - - for (i = 0; i < stk->nb_points; i++) - { - if (stk->points[i].type == PT_EXACT) + if (i > 0) { - glVertex3fv(stk->points[i].p); + sk_drawEdge(quad, pt - 1, pt, 0.1); } + + glPopMatrix(); + + VecAddf(rgb, rgb, d_rgb); } - - glEnd(); } -// glColor3f(1, 1, 1); -// glBegin(GL_POINTS); -// -// for (i = 0; i < stk->nb_points; i++) -// { -// if (stk->points[i].type == PT_CONTINUOUS) -// { -// glVertex3fv(stk->points[i].p); -// } -// } -// -// glEnd(); + gluDeleteQuadric(quad); } void drawSubdividedStrokeBy(ToolSettings *toolsettings, BArcIterator *iter, NextSubdivisionFunc next_subdividion) { + SK_Stroke *stk = ((SK_StrokeIterator*)iter)->stroke; float head[3], tail[3]; int bone_start = 0; int end = iter->length; int index; + GLUquadric *quad = gluNewQuadric(); + gluQuadricNormals(quad, GLU_SMOOTH); iter->head(iter); VECCOPY(head, iter->p); - - glColor3f(0, 1, 0); - glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE) * 2); - glBegin(GL_POINTS); - + index = next_subdividion(toolsettings, iter, bone_start, end, head, tail); while (index != -1) { - glVertex3fv(tail); - + SK_Point *pt = stk->points + index; + + glPushMatrix(); + + glColor3f(0, 1, 0); + sk_drawPoint(quad, pt, 0.15); + + sk_drawNormal(quad, pt, 0.05, 0.9); + + glPopMatrix(); + VECCOPY(head, tail); bone_start = index; // start next bone from current index index = next_subdividion(toolsettings, iter, bone_start, end, head, tail); } - - glEnd(); - glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); + + gluDeleteQuadric(quad); } void sk_drawStrokeSubdivision(ToolSettings *toolsettings, SK_Stroke *stk) { int head_index = -1; int i; - + if (toolsettings->bone_sketching_convert == SK_CONVERT_RETARGET) { return; } - + for (i = 0; i < stk->nb_points; i++) { SK_Point *pt = stk->points + i; - + if (pt->type == PT_EXACT || i == stk->nb_points - 1) /* stop on exact or on last point */ { if (head_index == -1) @@ -1137,7 +1195,7 @@ void sk_drawStrokeSubdivision(ToolSettings *toolsettings, SK_Stroke *stk) { SK_StrokeIterator sk_iter; BArcIterator *iter = (BArcIterator*)&sk_iter; - + initStrokeIterator(iter, stk, head_index, i); if (toolsettings->bone_sketching_convert == SK_CONVERT_CUT_ADAPTATIVE) @@ -1152,13 +1210,13 @@ void sk_drawStrokeSubdivision(ToolSettings *toolsettings, SK_Stroke *stk) { drawSubdividedStrokeBy(toolsettings, iter, nextFixedSubdivision); } - + } head_index = i; } } - } + } } SK_Point *sk_snapPointStroke(bContext *C, SK_Stroke *stk, short mval[2], int *dist, int *index, int all_pts) @@ -1166,23 +1224,23 @@ SK_Point *sk_snapPointStroke(bContext *C, SK_Stroke *stk, short mval[2], int *di ARegion *ar = CTX_wm_region(C); SK_Point *pt = NULL; int i; - + for (i = 0; i < stk->nb_points; i++) { if (all_pts || stk->points[i].type == PT_EXACT) { short pval[2]; int pdist; - + project_short_noclip(ar, stk->points[i].p, pval); - + pdist = ABS(pval[0] - mval[0]) + ABS(pval[1] - mval[1]); - + if (pdist < *dist) { *dist = pdist; pt = stk->points + i; - + if (index != NULL) { *index = i; @@ -1190,7 +1248,7 @@ SK_Point *sk_snapPointStroke(bContext *C, SK_Stroke *stk, short mval[2], int *di } } } - + return pt; } @@ -1199,21 +1257,21 @@ SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones, short ARegion *ar = CTX_wm_region(C); SK_Point *pt = NULL; EditBone *bone; - + for (bone = ebones->first; bone; bone = bone->next) { float vec[3]; short pval[2]; int pdist; - + if ((bone->flag & BONE_CONNECTED) == 0) { VECCOPY(vec, bone->head); Mat4MulVecfl(ob->obmat, vec); project_short_noclip(ar, vec, pval); - + pdist = ABS(pval[0] - mval[0]) + ABS(pval[1] - mval[1]); - + if (pdist < *dist) { *dist = pdist; @@ -1222,14 +1280,14 @@ SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones, short pt->type = PT_EXACT; } } - - + + VECCOPY(vec, bone->tail); Mat4MulVecfl(ob->obmat, vec); project_short_noclip(ar, vec, pval); - + pdist = ABS(pval[0] - mval[0]) + ABS(pval[1] - mval[1]); - + if (pdist < *dist) { *dist = pdist; @@ -1238,7 +1296,7 @@ SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones, short pt->type = PT_EXACT; } } - + return pt; } @@ -1265,21 +1323,21 @@ void sk_updateOverdraw(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawDa SK_Stroke *target; int closest_index = -1; int dist = SNAP_MIN_DISTANCE * 2; - + // /* If snapping, don't start overdraw */ Can't do that, snap is embed too now // if (sk_lastStrokePoint(stk)->mode == PT_SNAP) // { // return; // } - + for (target = sketch->strokes.first; target; target = target->next) { if (target != stk) { int index; - + SK_Point *spt = sk_snapPointStroke(C, target, dd->mval, &dist, &index, 1); - + if (spt != NULL) { sketch->over.target = target; @@ -1287,7 +1345,7 @@ void sk_updateOverdraw(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawDa } } } - + if (sketch->over.target != NULL) { if (closest_index > -1) @@ -1319,7 +1377,7 @@ void sk_updateOverdraw(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawDa int index; closest_pt = sk_snapPointStroke(C, sketch->over.target, dd->mval, &dist, &index, 1); - + if (closest_pt != NULL) { if (sk_lastStrokePoint(stk)->type == PT_EXACT) @@ -1330,7 +1388,7 @@ void sk_updateOverdraw(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawDa { sketch->over.count++; } - + sketch->over.end = index; } else @@ -1347,17 +1405,17 @@ int sk_adjustIndexes(SK_Sketch *sketch, int *start, int *end) *start = sketch->over.start; *end = sketch->over.end; - + if (*start == -1) { *start = 0; } - + if (*end == -1) { *end = sketch->over.target->nb_points - 1; } - + if (*end < *start) { int tmp = *start; @@ -1365,34 +1423,34 @@ int sk_adjustIndexes(SK_Sketch *sketch, int *start, int *end) *end = tmp; retval = 1; } - + return retval; } void sk_endOverdraw(SK_Sketch *sketch) { SK_Stroke *stk = sketch->active_stroke; - + if (sk_hasOverdraw(sketch, NULL)) { int start; int end; - + if (sk_adjustIndexes(sketch, &start, &end)) { sk_reverseStroke(stk); } - + if (stk->nb_points > 1) { stk->points->type = sketch->over.target->points[start].type; sk_lastStrokePoint(stk)->type = sketch->over.target->points[end].type; } - + sk_insertStrokePoints(sketch->over.target, stk->points, stk->nb_points, start, end); - + sk_removeStroke(sketch, stk); - + sk_resetOverdraw(sketch); } } @@ -1401,11 +1459,11 @@ void sk_endOverdraw(SK_Sketch *sketch) void sk_startStroke(SK_Sketch *sketch) { SK_Stroke *stk = sk_createStroke(); - + BLI_addtail(&sketch->strokes, stk); sketch->active_stroke = stk; - sk_resetOverdraw(sketch); + sk_resetOverdraw(sketch); } void sk_endStroke(bContext *C, SK_Sketch *sketch) @@ -1424,7 +1482,7 @@ void sk_endStroke(bContext *C, SK_Sketch *sketch) void sk_updateDrawData(SK_DrawData *dd) { dd->type = PT_CONTINUOUS; - + dd->previous_mval[0] = dd->mval[0]; dd->previous_mval[1] = dd->mval[1]; } @@ -1435,19 +1493,19 @@ float sk_distanceDepth(bContext *C, float p1[3], float p2[3]) RegionView3D *rv3d = ar->regiondata; float vec[3]; float distance; - + VecSubf(vec, p1, p2); - + Projf(vec, vec, rv3d->viewinv[2]); - + distance = VecLength(vec); - + if (Inpf(rv3d->viewinv[2], vec) > 0) { distance *= -1; } - - return distance; + + return distance; } void sk_interpolateDepth(bContext *C, SK_Stroke *stk, int start, int end, float length, float distance) @@ -1458,18 +1516,18 @@ void sk_interpolateDepth(bContext *C, SK_Stroke *stk, int start, int end, float float progress = 0; int i; - + progress = VecLenf(stk->points[start].p, stk->points[start - 1].p); - + for (i = start; i <= end; i++) { float ray_start[3], ray_normal[3]; float delta = VecLenf(stk->points[i].p, stk->points[i + 1].p); short pval[2]; - + project_short_noclip(ar, stk->points[i].p, pval); viewray(ar, v3d, pval, ray_start, ray_normal); - + VecMulf(ray_normal, distance * progress / length); VecAddf(stk->points[i].p, stk->points[i].p, ray_normal); @@ -1480,19 +1538,19 @@ void sk_interpolateDepth(bContext *C, SK_Stroke *stk, int start, int end, float void sk_projectDrawPoint(bContext *C, float vec[3], SK_Stroke *stk, SK_DrawData *dd) { ARegion *ar = CTX_wm_region(C); - /* copied from grease pencil, need fixing */ + /* copied from grease pencil, need fixing */ SK_Point *last = sk_lastStrokePoint(stk); short cval[2]; float fp[3] = {0, 0, 0}; float dvec[3]; - + if (last != NULL) { VECCOPY(fp, last->p); } - + initgrabz(ar->regiondata, fp[0], fp[1], fp[2]); - + /* method taken from editview.c - mouse_cursor() */ project_short_noclip(ar, fp, cval); window_to_3d_delta(ar, dvec, cval[0] - dd->mval[0], cval[1] - dd->mval[1]); @@ -1504,20 +1562,20 @@ int sk_getStrokeDrawPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Strok pt->type = dd->type; pt->mode = PT_PROJECT; sk_projectDrawPoint(C, pt->p, stk, dd); - + return 1; } int sk_addStrokeDrawPoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd) { SK_Point pt; - + sk_initPoint(C, &pt); - + sk_getStrokeDrawPoint(C, &pt, sketch, stk, dd); sk_appendStrokePoint(stk, &pt); - + return 1; } @@ -1528,16 +1586,16 @@ int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Strok if (ts->snap_mode == SCE_SNAP_MODE_VOLUME) { - ListBase depth_peels; DepthPeel *p1, *p2; float *last_p = NULL; float dist = FLT_MAX; float p[3]; - - depth_peels.first = depth_peels.last = NULL; - - peelObjectsContext(C, &depth_peels, dd->mval); - + float size = 0; + + sketch->depth_peels.first = sketch->depth_peels.last = NULL; + + peelObjectsContext(C, &sketch->depth_peels, dd->mval); + if (stk->nb_points > 0 && stk->points[stk->nb_points - 1].type == PT_CONTINUOUS) { last_p = stk->points[stk->nb_points - 1].p; @@ -1546,19 +1604,20 @@ int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Strok { last_p = LAST_SNAP_POINT; } - - - for (p1 = depth_peels.first; p1; p1 = p1->next) + + + for (p1 = sketch->depth_peels.first; p1; p1 = p1->next) { if (p1->flag == 0) { float vec[3]; float new_dist; - + float new_size = 0; + p2 = NULL; p1->flag = 1; - - /* if peeling objects, take the first and last from each object */ + + /* if peeling objects, take the first and last from each object */ if (ts->snap_flag & SCE_SNAP_PEEL_OBJECT) { DepthPeel *peel; @@ -1579,46 +1638,50 @@ int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Strok /* nothing to do here */ } } - + if (p2) { p2->flag = 1; - + VecAddf(vec, p1->p, p2->p); VecMulf(vec, 0.5f); + new_size = VecLenf(p1->p, p2->p); } else { VECCOPY(vec, p1->p); } - + if (last_p == NULL) { VECCOPY(p, vec); + size = new_size; dist = 0; break; } - + new_dist = VecLenf(last_p, vec); - + if (new_dist < dist) { VECCOPY(p, vec); dist = new_dist; + size = new_size; } } } - + if (dist != FLT_MAX) { pt->type = dd->type; pt->mode = PT_SNAP; + pt->size = size / 2; VECCOPY(pt->p, p); - + point_added = 1; } - - BLI_freelistN(&depth_peels); + + //BLI_freelistN(&depth_peels); } else { @@ -1641,7 +1704,7 @@ int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Strok { spt = sk_snapPointStroke(C, snap_stk, dd->mval, &dist, NULL, 1); } - + if (spt != NULL) { VECCOPY(pt->p, spt->p); @@ -1656,11 +1719,11 @@ int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Strok pt->type = dd->type; pt->mode = PT_SNAP; VECCOPY(pt->p, vec); - + point_added = 1; } } - + return point_added; } @@ -1668,23 +1731,23 @@ int sk_addStrokeSnapPoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_Dra { int point_added; SK_Point pt; - + sk_initPoint(C, &pt); point_added = sk_getStrokeSnapPoint(C, &pt, sketch, stk, dd); - + if (point_added) { float final_p[3]; float length, distance; int total; int i; - + VECCOPY(final_p, pt.p); - + sk_projectDrawPoint(C, pt.p, stk, dd); sk_appendStrokePoint(stk, &pt); - + /* update all previous point to give smooth Z progresion */ total = 0; length = 0; @@ -1697,19 +1760,19 @@ int sk_addStrokeSnapPoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_Dra break; } } - + if (total > 1) { distance = sk_distanceDepth(C, final_p, stk->points[i].p); - + sk_interpolateDepth(C, stk, i + 1, stk->nb_points - 2, length, distance); } - + VECCOPY(stk->points[stk->nb_points - 1].p, final_p); - + point_added = 1; } - + return point_added; } @@ -1717,17 +1780,17 @@ void sk_addStrokePoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawDa { ToolSettings *ts = CTX_data_tool_settings(C); int point_added = 0; - + if (snap) { point_added = sk_addStrokeSnapPoint(C, sketch, stk, dd); } - + if (point_added == 0) { point_added = sk_addStrokeDrawPoint(C, sketch, stk, dd); } - + if (stk == sketch->active_stroke && ts->bone_sketching & BONE_SKETCHING_ADJUST) { sk_updateOverdraw(C, sketch, stk, dd); @@ -1737,7 +1800,7 @@ void sk_addStrokePoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawDa void sk_getStrokePoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd, short snap) { int point_added = 0; - + if (snap) { point_added = sk_getStrokeSnapPoint(C, pt, sketch, stk, dd); @@ -1748,11 +1811,11 @@ void sk_getStrokePoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Stroke * { LAST_SNAP_POINT_VALID = 0; } - + if (point_added == 0) { point_added = sk_getStrokeDrawPoint(C, pt, sketch, stk, dd); - } + } } void sk_endContinuousStroke(SK_Stroke *stk) @@ -1775,7 +1838,7 @@ int sk_stroke_filtermval(SK_DrawData *dd) { retval = 1; } - + return retval; } @@ -1805,25 +1868,27 @@ static void initIteratorFct(SK_StrokeIterator *iter) iter->next = nextPoint; iter->nextN = nextNPoint; iter->previous = previousPoint; - iter->stopped = iteratorStopped; + iter->stopped = iteratorStopped; } static SK_Point* setIteratorValues(SK_StrokeIterator *iter, int index) { SK_Point *pt = NULL; - + if (index >= 0 && index < iter->length) { pt = &(iter->stroke->points[iter->start + (iter->stride * index)]); iter->p = pt->p; iter->no = pt->no; + iter->size = pt->size; } else { iter->p = NULL; iter->no = NULL; + iter->size = 0; } - + return pt; } @@ -1833,7 +1898,7 @@ void initStrokeIterator(BArcIterator *arg, SK_Stroke *stk, int start, int end) initIteratorFct(iter); iter->stroke = stk; - + if (start < end) { iter->start = start + 1; @@ -1846,9 +1911,9 @@ void initStrokeIterator(BArcIterator *arg, SK_Stroke *stk, int start, int end) iter->end = end + 1; iter->stride = -1; } - + iter->length = iter->stride * (iter->end - iter->start + 1); - + iter->index = -1; } @@ -1857,11 +1922,12 @@ static void* headPoint(void *arg) { SK_StrokeIterator *iter = (SK_StrokeIterator*)arg; SK_Point *result = NULL; - + result = &(iter->stroke->points[iter->start - iter->stride]); iter->p = result->p; iter->no = result->no; - + iter->size = result->size; + return result; } @@ -1869,11 +1935,12 @@ static void* tailPoint(void *arg) { SK_StrokeIterator *iter = (SK_StrokeIterator*)arg; SK_Point *result = NULL; - + result = &(iter->stroke->points[iter->end + iter->stride]); iter->p = result->p; iter->no = result->no; - + iter->size = result->size; + return result; } @@ -1881,7 +1948,7 @@ static void* nextPoint(void *arg) { SK_StrokeIterator *iter = (SK_StrokeIterator*)arg; SK_Point *result = NULL; - + iter->index++; if (iter->index < iter->length) { @@ -1895,7 +1962,7 @@ static void* nextNPoint(void *arg, int n) { SK_StrokeIterator *iter = (SK_StrokeIterator*)arg; SK_Point *result = NULL; - + iter->index += n; /* check if passed end */ @@ -1926,7 +1993,7 @@ static void* previousPoint(void *arg) { SK_StrokeIterator *iter = (SK_StrokeIterator*)arg; SK_Point *result = NULL; - + if (iter->index > 0) { iter->index--; @@ -1961,18 +2028,18 @@ void sk_convertStroke(bContext *C, SK_Stroke *stk) float tmat[3][3]; int head_index = 0; int i; - + head = NULL; - + Mat4Invert(invmat, obedit->obmat); - + Mat3CpyMat4(tmat, obedit->obmat); Mat3Transp(tmat); - + for (i = 0; i < stk->nb_points; i++) { SK_Point *pt = stk->points + i; - + if (pt->type == PT_EXACT) { if (head == NULL) @@ -1984,14 +2051,14 @@ void sk_convertStroke(bContext *C, SK_Stroke *stk) { EditBone *bone = NULL; EditBone *new_parent; - + if (i - head_index > 1) { SK_StrokeIterator sk_iter; BArcIterator *iter = (BArcIterator*)&sk_iter; initStrokeIterator(iter, stk, head_index, i); - + if (ts->bone_sketching_convert == SK_CONVERT_CUT_ADAPTATIVE) { bone = subdivideArcBy(ts, arm, arm->edbo, iter, invmat, tmat, nextAdaptativeSubdivision); @@ -2005,11 +2072,11 @@ void sk_convertStroke(bContext *C, SK_Stroke *stk) bone = subdivideArcBy(ts, arm, arm->edbo, iter, invmat, tmat, nextFixedSubdivision); } } - + if (bone == NULL) { bone = addEditBone(arm, "Bone"); - + VECCOPY(bone->head, head->p); VECCOPY(bone->tail, pt->p); @@ -2017,10 +2084,10 @@ void sk_convertStroke(bContext *C, SK_Stroke *stk) Mat4MulVecfl(invmat, bone->tail); setBoneRollFromNormal(bone, head->no, invmat, tmat); } - + new_parent = bone; bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; - + /* move to end of chain */ while (bone->parent != NULL) { @@ -2031,9 +2098,9 @@ void sk_convertStroke(bContext *C, SK_Stroke *stk) if (parent != NULL) { bone->parent = parent; - bone->flag |= BONE_CONNECTED; + bone->flag |= BONE_CONNECTED; } - + parent = new_parent; head_index = i; head = pt; @@ -2046,7 +2113,7 @@ void sk_convert(bContext *C, SK_Sketch *sketch) { ToolSettings *ts = CTX_data_tool_settings(C); SK_Stroke *stk; - + for (stk = sketch->strokes.first; stk; stk = stk->next) { if (stk->selected == 1) @@ -2079,7 +2146,7 @@ int sk_getSelfIntersections(bContext *C, ListBase *list, SK_Stroke *gesture) float s_p1[3] = {0, 0, 0}; float s_p2[3] = {0, 0, 0}; int g_i; - + project_float(ar, gesture->points[s_i].p, s_p1); project_float(ar, gesture->points[s_i + 1].p, s_p2); @@ -2090,37 +2157,37 @@ int sk_getSelfIntersections(bContext *C, ListBase *list, SK_Stroke *gesture) float g_p2[3] = {0, 0, 0}; float vi[3]; float lambda; - + project_float(ar, gesture->points[g_i].p, g_p1); project_float(ar, gesture->points[g_i + 1].p, g_p2); - + if (LineIntersectLineStrict(s_p1, s_p2, g_p1, g_p2, vi, &lambda)) { SK_Intersection *isect = MEM_callocN(sizeof(SK_Intersection), "Intersection"); - + isect->gesture_index = g_i; isect->before = s_i; isect->after = s_i + 1; isect->stroke = gesture; - + VecSubf(isect->p, gesture->points[s_i + 1].p, gesture->points[s_i].p); VecMulf(isect->p, lambda); VecAddf(isect->p, isect->p, gesture->points[s_i].p); - + BLI_addtail(list, isect); added++; } } } - + return added; } int cmpIntersections(void *i1, void *i2) { SK_Intersection *isect1 = i1, *isect2 = i2; - + if (isect1->stroke == isect2->stroke) { if (isect1->before < isect2->before) @@ -2143,7 +2210,7 @@ int cmpIntersections(void *i1, void *i2) } } } - + return 0; } @@ -2161,13 +2228,13 @@ int sk_getIntersections(bContext *C, ListBase *list, SK_Sketch *sketch, SK_Strok { int s_added = 0; int s_i; - + for (s_i = 0; s_i < stk->nb_points - 1; s_i++) { float s_p1[3] = {0, 0, 0}; float s_p2[3] = {0, 0, 0}; int g_i; - + project_float(ar, stk->points[s_i].p, s_p1); project_float(ar, stk->points[s_i + 1].p, s_p2); @@ -2177,45 +2244,45 @@ int sk_getIntersections(bContext *C, ListBase *list, SK_Sketch *sketch, SK_Strok float g_p2[3] = {0, 0, 0}; float vi[3]; float lambda; - + project_float(ar, gesture->points[g_i].p, g_p1); project_float(ar, gesture->points[g_i + 1].p, g_p2); - + if (LineIntersectLineStrict(s_p1, s_p2, g_p1, g_p2, vi, &lambda)) { SK_Intersection *isect = MEM_callocN(sizeof(SK_Intersection), "Intersection"); float ray_start[3], ray_end[3]; short mval[2]; - + isect->gesture_index = g_i; isect->before = s_i; isect->after = s_i + 1; isect->stroke = stk; isect->lambda = lambda; - + mval[0] = (short)(vi[0]); mval[1] = (short)(vi[1]); viewline(ar, v3d, mval, ray_start, ray_end); - + LineIntersectLine( stk->points[s_i].p, stk->points[s_i + 1].p, ray_start, ray_end, isect->p, vi); - + BLI_addtail(list, isect); s_added++; } } } - + added = MAX2(s_added, added); } - + BLI_sortlist(list, cmpIntersections); - + return added; } @@ -2223,23 +2290,23 @@ int sk_getSegments(SK_Stroke *segments, SK_Stroke *gesture) { SK_StrokeIterator sk_iter; BArcIterator *iter = (BArcIterator*)&sk_iter; - + float CORRELATION_THRESHOLD = 0.99f; float *vec; int i, j; - + sk_appendStrokePoint(segments, &gesture->points[0]); vec = segments->points[segments->nb_points - 1].p; initStrokeIterator(iter, gesture, 0, gesture->nb_points - 1); for (i = 1, j = 0; i < gesture->nb_points; i++) - { + { float n[3]; - + /* Calculate normal */ VecSubf(n, gesture->points[i].p, vec); - + if (calcArcCorrelation(iter, j, i, vec, n) < CORRELATION_THRESHOLD) { j = i - 1; @@ -2250,7 +2317,7 @@ int sk_getSegments(SK_Stroke *segments, SK_Stroke *gesture) } sk_appendStrokePoint(segments, &gesture->points[gesture->nb_points - 1]); - + return segments->nb_points - 1; } @@ -2267,16 +2334,16 @@ int sk_detectCutGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) void sk_applyCutGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) { SK_Intersection *isect; - + for (isect = gest->intersections.first; isect; isect = isect->next) { SK_Point pt; - + pt.type = PT_EXACT; pt.mode = PT_PROJECT; /* take mode from neighbouring points */ VECCOPY(pt.p, isect->p); VECCOPY(pt.no, isect->stroke->points[isect->before].no); - + sk_insertStrokePoint(isect->stroke, &pt, isect->after); } } @@ -2287,12 +2354,12 @@ int sk_detectTrimGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) { float s1[3], s2[3]; float angle; - + VecSubf(s1, gest->segments->points[1].p, gest->segments->points[0].p); VecSubf(s2, gest->segments->points[2].p, gest->segments->points[1].p); - + angle = VecAngle2(s1, s2); - + if (angle > 60 && angle < 120) { return 1; @@ -2306,21 +2373,21 @@ void sk_applyTrimGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) { SK_Intersection *isect; float trim_dir[3]; - + VecSubf(trim_dir, gest->segments->points[2].p, gest->segments->points[1].p); - + for (isect = gest->intersections.first; isect; isect = isect->next) { SK_Point pt; float stroke_dir[3]; - + pt.type = PT_EXACT; pt.mode = PT_PROJECT; /* take mode from neighbouring points */ VECCOPY(pt.p, isect->p); VECCOPY(pt.no, isect->stroke->points[isect->before].no); - + VecSubf(stroke_dir, isect->stroke->points[isect->after].p, isect->stroke->points[isect->before].p); - + /* same direction, trim end */ if (Inpf(stroke_dir, trim_dir) > 0) { @@ -2333,7 +2400,7 @@ void sk_applyTrimGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) sk_replaceStrokePoint(isect->stroke, &pt, isect->before); sk_trimStroke(isect->stroke, isect->before, isect->stroke->nb_points - 1); } - + } } @@ -2342,7 +2409,7 @@ int sk_detectCommandGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) if (gest->nb_segments > 2 && gest->nb_intersections == 2 && gest->nb_self_intersections == 1) { SK_Intersection *isect, *self_isect; - + /* get the the last intersection of the first pair */ for( isect = gest->intersections.first; isect; isect = isect->next ) { @@ -2352,15 +2419,15 @@ int sk_detectCommandGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) break; } } - + self_isect = gest->self_intersections.first; - + if (isect && isect->gesture_index < self_isect->gesture_index) { return 1; } } - + return 0; } @@ -2368,7 +2435,7 @@ void sk_applyCommandGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) { SK_Intersection *isect; int command = 1; - + // XXX // command = pupmenu("Action %t|Flatten %x1|Straighten %x2|Polygonize %x3"); if(command < 1) return; @@ -2376,9 +2443,9 @@ void sk_applyCommandGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) for (isect = gest->intersections.first; isect; isect = isect->next) { SK_Intersection *i2; - + i2 = isect->next; - + if (i2 && i2->stroke == isect->stroke) { switch (command) @@ -2405,32 +2472,32 @@ int sk_detectDeleteGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) { float s1[3], s2[3]; float angle; - + VecSubf(s1, gest->segments->points[1].p, gest->segments->points[0].p); VecSubf(s2, gest->segments->points[2].p, gest->segments->points[1].p); - + angle = VecAngle2(s1, s2); - + if (angle > 120) { return 1; } } - + return 0; } void sk_applyDeleteGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) { SK_Intersection *isect; - + for (isect = gest->intersections.first; isect; isect = isect->next) { /* only delete strokes that are crossed twice */ if (isect->next && isect->next->stroke == isect->stroke) { isect = isect->next; - + sk_removeStroke(sketch, isect->stroke); } } @@ -2443,17 +2510,17 @@ int sk_detectMergeGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) { short start_val[2], end_val[2]; short dist; - + project_short_noclip(ar, gest->stk->points[0].p, start_val); project_short_noclip(ar, sk_lastStrokePoint(gest->stk)->p, end_val); - + dist = MAX2(ABS(start_val[0] - end_val[0]), ABS(start_val[1] - end_val[1])); - + /* if gesture is a circle */ if ( dist <= 20 ) { SK_Intersection *isect; - + /* check if it circled around an exact point */ for (isect = gest->intersections.first; isect; isect = isect->next) { @@ -2462,10 +2529,10 @@ int sk_detectMergeGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) { int start_index, end_index; int i; - + start_index = MIN2(isect->after, isect->next->after); end_index = MAX2(isect->before, isect->next->before); - + for (i = start_index; i <= end_index; i++) { if (isect->stroke->points[i].type == PT_EXACT) @@ -2473,21 +2540,21 @@ int sk_detectMergeGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) return 1; /* at least one exact point found, stop detect here */ } } - - /* skip next */ + + /* skip next */ isect = isect->next; } } } } - + return 0; } void sk_applyMergeGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) { SK_Intersection *isect; - + /* check if it circled around an exact point */ for (isect = gest->intersections.first; isect; isect = isect->next) { @@ -2496,7 +2563,7 @@ void sk_applyMergeGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) { int start_index, end_index; int i; - + start_index = MIN2(isect->after, isect->next->after); end_index = MAX2(isect->before, isect->next->before); @@ -2509,7 +2576,7 @@ void sk_applyMergeGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) } } - /* skip next */ + /* skip next */ isect = isect->next; } } @@ -2520,7 +2587,7 @@ int sk_detectReverseGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) if (gest->nb_segments > 2 && gest->nb_intersections == 2 && gest->nb_self_intersections == 0) { SK_Intersection *isect; - + /* check if it circled around an exact point */ for (isect = gest->intersections.first; isect; isect = isect->next) { @@ -2529,7 +2596,7 @@ int sk_detectReverseGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) { float start_v[3], end_v[3]; float angle; - + if (isect->gesture_index < isect->next->gesture_index) { VecSubf(start_v, isect->p, gest->stk->points[0].p); @@ -2540,27 +2607,27 @@ int sk_detectReverseGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) VecSubf(start_v, isect->next->p, gest->stk->points[0].p); VecSubf(end_v, sk_lastStrokePoint(gest->stk)->p, isect->p); } - + angle = VecAngle2(start_v, end_v); - + if (angle > 120) { return 1; } - - /* skip next */ + + /* skip next */ isect = isect->next; } } } - + return 0; } void sk_applyReverseGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) { SK_Intersection *isect; - + for (isect = gest->intersections.first; isect; isect = isect->next) { /* only reverse strokes that are crossed twice */ @@ -2568,7 +2635,7 @@ void sk_applyReverseGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) { sk_reverseStroke(isect->stroke); - /* skip next */ + /* skip next */ isect = isect->next; } } @@ -2592,7 +2659,7 @@ static void sk_initGesture(bContext *C, SK_Gesture *gest, SK_Sketch *sketch) { gest->intersections.first = gest->intersections.last = NULL; gest->self_intersections.first = gest->self_intersections.last = NULL; - + gest->segments = sk_createStroke(); gest->stk = sketch->gesture; @@ -2612,9 +2679,9 @@ void sk_applyGesture(bContext *C, SK_Sketch *sketch) { SK_Gesture gest; SK_GestureAction *act; - + sk_initGesture(C, &gest, sketch); - + /* detect and apply */ for (act = GESTURE_ACTIONS; act->apply != NULL; act++) { @@ -2624,7 +2691,7 @@ void sk_applyGesture(bContext *C, SK_Sketch *sketch) break; } } - + sk_freeGesture(&gest); } @@ -2633,11 +2700,11 @@ void sk_applyGesture(bContext *C, SK_Sketch *sketch) void sk_deleteSelectedStrokes(SK_Sketch *sketch) { SK_Stroke *stk, *next; - + for (stk = sketch->strokes.first; stk; stk = next) { next = stk->next; - + if (stk->selected == 1) { sk_removeStroke(sketch, stk); @@ -2648,7 +2715,7 @@ void sk_deleteSelectedStrokes(SK_Sketch *sketch) void sk_selectAllSketch(SK_Sketch *sketch, int mode) { SK_Stroke *stk = NULL; - + if (mode == -1) { for (stk = sketch->strokes.first; stk; stk = stk->next) @@ -2666,12 +2733,12 @@ void sk_selectAllSketch(SK_Sketch *sketch, int mode) else if (mode == 1) { int selected = 1; - + for (stk = sketch->strokes.first; stk; stk = stk->next) { selected &= stk->selected; } - + selected ^= 1; for (stk = sketch->strokes.first; stk; stk = stk->next) @@ -2687,20 +2754,20 @@ void sk_selectStroke(bContext *C, SK_Sketch *sketch, short mval[2], int extend) rcti rect; unsigned int buffer[MAXPICKBUF]; short hits; - + view3d_set_viewcontext(C, &vc); - + rect.xmin= mval[0]-5; rect.xmax= mval[0]+5; rect.ymin= mval[1]-5; rect.ymax= mval[1]+5; - + hits = view3d_opengl_select(&vc, buffer, MAXPICKBUF, &rect); if (hits>0) { int besthitresult = -1; - + if(hits == 1) { besthitresult = buffer[3]; } @@ -2708,23 +2775,23 @@ void sk_selectStroke(bContext *C, SK_Sketch *sketch, short mval[2], int extend) besthitresult = buffer[3]; /* loop and get best hit */ } - + if (besthitresult > 0) { SK_Stroke *selected_stk = BLI_findlink(&sketch->strokes, besthitresult - 1); - + if (extend == 0) { sk_selectAllSketch(sketch, -1); - + selected_stk->selected = 1; } else { selected_stk->selected ^= 1; } - - + + } } } @@ -2734,7 +2801,7 @@ void sk_queueRedrawSketch(SK_Sketch *sketch) if (sketch->active_stroke != NULL) { SK_Point *last = sk_lastStrokePoint(sketch->active_stroke); - + if (last != NULL) { // XXX @@ -2743,16 +2810,14 @@ void sk_queueRedrawSketch(SK_Sketch *sketch) } } -void sk_drawSketch(Scene *scene, SK_Sketch *sketch, int with_names) +void sk_drawSketch(Scene *scene, View3D *v3d, SK_Sketch *sketch, int with_names) { ToolSettings *ts= scene->toolsettings; SK_Stroke *stk; - - glDisable(GL_DEPTH_TEST); - glLineWidth(UI_GetThemeValuef(TH_VERTEX_SIZE)); - glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); - + glClear(GL_DEPTH_BUFFER_BIT); + glEnable(GL_DEPTH_TEST); + if (with_names) { int id; @@ -2760,61 +2825,51 @@ void sk_drawSketch(Scene *scene, SK_Sketch *sketch, int with_names) { sk_drawStroke(stk, id, NULL, -1, -1); } - + glLoadName(-1); } else { float selected_rgb[3] = {1, 0, 0}; float unselected_rgb[3] = {1, 0.5, 0}; - + for (stk = sketch->strokes.first; stk; stk = stk->next) { int start = -1; int end = -1; - + if (sk_hasOverdraw(sketch, stk)) { sk_adjustIndexes(sketch, &start, &end); } - + sk_drawStroke(stk, -1, (stk->selected==1?selected_rgb:unselected_rgb), start, end); - + if (stk->selected == 1) { sk_drawStrokeSubdivision(ts, stk); } } - - /* only draw gesture in active area */ - if (sketch->gesture != NULL /*&& area_is_active_area(G.vd->area)*/) - { - float gesture_rgb[3] = {0, 0.5, 1}; - sk_drawStroke(sketch->gesture, -1, gesture_rgb, -1, -1); - } - + if (sketch->active_stroke != NULL) { SK_Point *last = sk_lastStrokePoint(sketch->active_stroke); - + if (ts->bone_sketching & BONE_SKETCHING_QUICK) { sk_drawStrokeSubdivision(ts, sketch->active_stroke); } - + if (last != NULL) { - glEnable(GL_LINE_STIPPLE); - glColor3fv(selected_rgb); - glBegin(GL_LINE_STRIP); - - glVertex3fv(last->p); - glVertex3fv(sketch->next_point.p); - - glEnd(); - - glDisable(GL_LINE_STIPPLE); - + GLUquadric *quad = gluNewQuadric(); + gluQuadricNormals(quad, GLU_SMOOTH); + + glPushMatrix(); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + switch (sketch->next_point.mode) { case PT_SNAP: @@ -2824,20 +2879,63 @@ void sk_drawSketch(Scene *scene, SK_Sketch *sketch, int with_names) glColor3f(0, 0, 0); break; } - - glBegin(GL_POINTS); - - glVertex3fv(sketch->next_point.p); - - glEnd(); + + sk_drawPoint(quad, &sketch->next_point, 0.1); + + glColor4f(selected_rgb[0], selected_rgb[1], selected_rgb[2], 0.3); + + sk_drawEdge(quad, last, &sketch->next_point, 0.1); + + glDisable(GL_BLEND); + + glPopMatrix(); + + gluDeleteQuadric(quad); } } } - - glLineWidth(1.0); - glPointSize(1.0); - glEnable(GL_DEPTH_TEST); +#if 0 + if (sketch->depth_peels.first != NULL) + { + float colors[8][3] = { + {1, 0, 0}, + {0, 1, 0}, + {0, 0, 1}, + {1, 1, 0}, + {1, 0, 1}, + {0, 1, 1}, + {1, 1, 1}, + {0, 0, 0} + }; + DepthPeel *p; + GLUquadric *quad = gluNewQuadric(); + gluQuadricNormals(quad, GLU_SMOOTH); + + for (p = sketch->depth_peels.first; p; p = p->next) + { + int index = (int)(p->ob); + index = (index >> 5) & 7; + + glColor3fv(colors[index]); + glPushMatrix(); + glTranslatef(p->p[0], p->p[1], p->p[2]); + gluSphere(quad, 0.02, 8, 8); + glPopMatrix(); + } + + gluDeleteQuadric(quad); + } +#endif + + glDisable(GL_DEPTH_TEST); + + /* only draw gesture in active area */ + if (sketch->gesture != NULL /*&& area_is_active_area(G.vd->area)*/) + { + float gesture_rgb[3] = {0, 0.5, 1}; + sk_drawStroke(sketch->gesture, -1, gesture_rgb, -1, -1); + } } int sk_finish_stroke(bContext *C, SK_Sketch *sketch) @@ -2847,9 +2945,9 @@ int sk_finish_stroke(bContext *C, SK_Sketch *sketch) if (sketch->active_stroke != NULL) { SK_Stroke *stk = sketch->active_stroke; - + sk_endStroke(C, sketch); - + if (ts->bone_sketching & BONE_SKETCHING_QUICK) { if (ts->bone_sketching_convert == SK_CONVERT_RETARGET) @@ -2867,11 +2965,11 @@ int sk_finish_stroke(bContext *C, SK_Sketch *sketch) // allqueue(REDRAWBUTSEDIT, 0); } -// XXX +// XXX // allqueue(REDRAWVIEW3D, 0); return 1; } - + return 0; } @@ -2881,7 +2979,7 @@ void sk_start_draw_stroke(SK_Sketch *sketch) { sk_startStroke(sketch); sk_selectAllSketch(sketch, -1); - + sketch->active_stroke->selected = 1; } } @@ -2900,7 +2998,7 @@ int sk_draw_stroke(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData * sk_updateNextPoint(sketch, stk); return 1; } - + return 0; } @@ -2908,9 +3006,9 @@ static int ValidSketchViewContext(ViewContext *vc) { Object *obedit = vc->obedit; Scene *scene= vc->scene; - - if (obedit && - obedit->type == OB_ARMATURE && + + if (obedit && + obedit->type == OB_ARMATURE && scene->toolsettings->bone_sketching & BONE_SKETCHING) { return 1; @@ -2927,11 +3025,11 @@ int BDR_drawSketchNames(ViewContext *vc) { if (GLOBAL_sketch != NULL) { - sk_drawSketch(vc->scene, GLOBAL_sketch, 1); + sk_drawSketch(vc->scene, vc->v3d, GLOBAL_sketch, 1); return 1; } } - + return 0; } @@ -2941,7 +3039,7 @@ void BDR_drawSketch(bContext *C) { if (GLOBAL_sketch != NULL) { - sk_drawSketch(CTX_data_scene(C), GLOBAL_sketch, 0); + sk_drawSketch(CTX_data_scene(C), CTX_wm_view3d(C), GLOBAL_sketch, 0); } } } @@ -3045,14 +3143,14 @@ static int sketch_select(bContext *C, wmOperator *op, wmEvent *event) sk_selectStroke(C, GLOBAL_sketch, event->mval, extend); ED_area_tag_redraw(CTX_wm_area(C)); } - + return OPERATOR_FINISHED; } static int sketch_draw_stroke_cancel(bContext *C, wmOperator *op) { sk_cancelStroke(GLOBAL_sketch); - MEM_freeN(op->customdata); + MEM_freeN(op->customdata); return OPERATOR_CANCELLED; } @@ -3060,19 +3158,19 @@ static int sketch_draw_stroke(bContext *C, wmOperator *op, wmEvent *event) { short snap = RNA_boolean_get(op->ptr, "snap"); SK_DrawData *dd; - + if (GLOBAL_sketch == NULL) { GLOBAL_sketch = sk_createSketch(); } - + op->customdata = dd = MEM_callocN(sizeof("SK_DrawData"), "SketchDrawData"); sk_initDrawData(dd, event->mval); - + sk_start_draw_stroke(GLOBAL_sketch); - + sk_draw_stroke(C, GLOBAL_sketch, GLOBAL_sketch->active_stroke, dd, snap); - + WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op); return OPERATOR_RUNNING_MODAL; @@ -3081,7 +3179,7 @@ static int sketch_draw_stroke(bContext *C, wmOperator *op, wmEvent *event) static int sketch_draw_gesture_cancel(bContext *C, wmOperator *op) { sk_cancelStroke(GLOBAL_sketch); - MEM_freeN(op->customdata); + MEM_freeN(op->customdata); return OPERATOR_CANCELLED; } @@ -3089,18 +3187,18 @@ static int sketch_draw_gesture(bContext *C, wmOperator *op, wmEvent *event) { short snap = RNA_boolean_get(op->ptr, "snap"); SK_DrawData *dd; - + if (GLOBAL_sketch == NULL) { GLOBAL_sketch = sk_createSketch(); } - + op->customdata = dd = MEM_callocN(sizeof("SK_DrawData"), "SketchDrawData"); sk_initDrawData(dd, event->mval); - + sk_start_draw_gesture(GLOBAL_sketch); sk_draw_stroke(C, GLOBAL_sketch, GLOBAL_sketch->gesture, dd, snap); - + WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op); return OPERATOR_RUNNING_MODAL; @@ -3111,7 +3209,7 @@ static int sketch_draw_modal(bContext *C, wmOperator *op, wmEvent *event, short short snap = RNA_boolean_get(op->ptr, "snap"); SK_DrawData *dd = op->customdata; int retval = OPERATOR_RUNNING_MODAL; - + switch (event->type) { case LEFTCTRLKEY: @@ -3139,31 +3237,31 @@ static int sketch_draw_modal(bContext *C, wmOperator *op, wmEvent *event, short sk_filterLastContinuousStroke(stk); sk_updateNextPoint(GLOBAL_sketch, stk); ED_area_tag_redraw(CTX_wm_area(C)); - MEM_freeN(op->customdata); + MEM_freeN(op->customdata); retval = OPERATOR_FINISHED; } else { sk_endContinuousStroke(stk); sk_filterLastContinuousStroke(stk); - - if (stk->nb_points > 1) + + if (stk->nb_points > 1) { /* apply gesture here */ sk_applyGesture(C, GLOBAL_sketch); } - + sk_freeStroke(stk); GLOBAL_sketch->gesture = NULL; - + ED_area_tag_redraw(CTX_wm_area(C)); - MEM_freeN(op->customdata); + MEM_freeN(op->customdata); retval = OPERATOR_FINISHED; } } break; } - + return retval; } @@ -3180,17 +3278,17 @@ static int sketch_draw_gesture_modal(bContext *C, wmOperator *op, wmEvent *event static int sketch_draw_preview(bContext *C, wmOperator *op, wmEvent *event) { short snap = RNA_boolean_get(op->ptr, "snap"); - + if (GLOBAL_sketch != NULL) { SK_Sketch *sketch = GLOBAL_sketch; SK_DrawData dd; - + sk_initDrawData(&dd, event->mval); sk_getStrokePoint(C, &sketch->next_point, sketch, sketch->active_stroke, &dd, snap); ED_area_tag_redraw(CTX_wm_area(C)); } - + return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; } @@ -3200,9 +3298,9 @@ int ED_operator_sketch_mode_active_stroke(bContext *C) { Object *obedit = CTX_data_edit_object(C); ToolSettings *ts = CTX_data_tool_settings(C); - - if (obedit && - obedit->type == OB_ARMATURE && + + if (obedit && + obedit->type == OB_ARMATURE && ts->bone_sketching & BONE_SKETCHING && GLOBAL_sketch != NULL && GLOBAL_sketch->active_stroke != NULL) @@ -3219,9 +3317,9 @@ int ED_operator_sketch_mode_gesture(bContext *C) { Object *obedit = CTX_data_edit_object(C); ToolSettings *ts = CTX_data_tool_settings(C); - - if (obedit && - obedit->type == OB_ARMATURE && + + if (obedit && + obedit->type == OB_ARMATURE && ts->bone_sketching & BONE_SKETCHING && (ts->bone_sketching & BONE_SKETCHING_QUICK) == 0 && GLOBAL_sketch != NULL && @@ -3239,10 +3337,10 @@ int ED_operator_sketch_full_mode(bContext *C) { Object *obedit = CTX_data_edit_object(C); ToolSettings *ts = CTX_data_tool_settings(C); - - if (obedit && - obedit->type == OB_ARMATURE && - ts->bone_sketching & BONE_SKETCHING && + + if (obedit && + obedit->type == OB_ARMATURE && + ts->bone_sketching & BONE_SKETCHING && (ts->bone_sketching & BONE_SKETCHING_QUICK) == 0) { return 1; @@ -3257,9 +3355,9 @@ int ED_operator_sketch_mode(bContext *C) { Object *obedit = CTX_data_edit_object(C); ToolSettings *ts = CTX_data_tool_settings(C); - - if (obedit && - obedit->type == OB_ARMATURE && + + if (obedit && + obedit->type == OB_ARMATURE && ts->bone_sketching & BONE_SKETCHING) { return 1; @@ -3277,12 +3375,12 @@ void SKETCH_OT_delete(wmOperatorType *ot) /* identifiers */ ot->name= "delete"; ot->idname= "SKETCH_OT_delete"; - + /* api callbacks */ ot->invoke= sketch_delete; - + ot->poll= ED_operator_sketch_full_mode; - + /* flags */ // ot->flag= OPTYPE_UNDO; } @@ -3292,12 +3390,12 @@ void SKETCH_OT_select(wmOperatorType *ot) /* identifiers */ ot->name= "select"; ot->idname= "SKETCH_OT_select"; - + /* api callbacks */ ot->invoke= sketch_select; - + ot->poll= ED_operator_sketch_full_mode; - + /* flags */ // ot->flag= OPTYPE_UNDO; } @@ -3307,12 +3405,12 @@ void SKETCH_OT_cancel_stroke(wmOperatorType *ot) /* identifiers */ ot->name= "cancel stroke"; ot->idname= "SKETCH_OT_cancel_stroke"; - + /* api callbacks */ ot->invoke= sketch_cancel; - + ot->poll= ED_operator_sketch_mode_active_stroke; - + /* flags */ // ot->flag= OPTYPE_UNDO; } @@ -3322,12 +3420,12 @@ void SKETCH_OT_finish_stroke(wmOperatorType *ot) /* identifiers */ ot->name= "end stroke"; ot->idname= "SKETCH_OT_finish_stroke"; - + /* api callbacks */ ot->invoke= sketch_finish; - + ot->poll= ED_operator_sketch_mode_active_stroke; - + /* flags */ // ot->flag= OPTYPE_UNDO; } @@ -3337,12 +3435,12 @@ void SKETCH_OT_draw_preview(wmOperatorType *ot) /* identifiers */ ot->name= "draw preview"; ot->idname= "SKETCH_OT_draw_preview"; - + /* api callbacks */ ot->invoke= sketch_draw_preview; - + ot->poll= ED_operator_sketch_mode_active_stroke; - + RNA_def_boolean(ot->srna, "snap", 0, "Snap", ""); /* flags */ @@ -3354,16 +3452,16 @@ void SKETCH_OT_draw_stroke(wmOperatorType *ot) /* identifiers */ ot->name= "draw stroke"; ot->idname= "SKETCH_OT_draw_stroke"; - + /* api callbacks */ ot->invoke = sketch_draw_stroke; ot->modal = sketch_draw_stroke_modal; ot->cancel = sketch_draw_stroke_cancel; - + ot->poll= ED_operator_sketch_mode; - + RNA_def_boolean(ot->srna, "snap", 0, "Snap", ""); - + /* flags */ // ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -3373,16 +3471,16 @@ void SKETCH_OT_gesture(wmOperatorType *ot) /* identifiers */ ot->name= "gesture"; ot->idname= "SKETCH_OT_gesture"; - + /* api callbacks */ ot->invoke = sketch_draw_gesture; ot->modal = sketch_draw_gesture_modal; ot->cancel = sketch_draw_gesture_cancel; - + ot->poll= ED_operator_sketch_mode_gesture; - + RNA_def_boolean(ot->srna, "snap", 0, "Snap", ""); - + /* flags */ // ot->flag= OPTYPE_UNDO; } diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index ea794b2c7c1..132d9edf8d0 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -3179,6 +3179,7 @@ static void setIteratorValues(ReebArcIterator *iter, EmbedBucket *bucket) iter->p = NULL; iter->no = NULL; } + iter->size = 0; } void initArcIterator(BArcIterator *arg, ReebArc *arc, ReebNode *head) @@ -3276,6 +3277,7 @@ static void* headNode(void *arg) iter->p = node->p; iter->no = node->no; + iter->size = 0; return node; } @@ -3296,6 +3298,7 @@ static void* tailNode(void *arg) iter->p = node->p; iter->no = node->no; + iter->size = 0; return node; } diff --git a/source/blender/editors/armature/reeb.h b/source/blender/editors/armature/reeb.h index 3bdd55509ad..6a3a261cb10 100644 --- a/source/blender/editors/armature/reeb.h +++ b/source/blender/editors/armature/reeb.h @@ -126,6 +126,7 @@ typedef struct ReebArcIterator { StoppedFct stopped; float *p, *no; + float size; int length; int index; -- cgit v1.2.3 From b0038be275b24253989dbfd19c2543c770849653 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Thu, 9 Jul 2009 01:52:54 +0000 Subject: Reduce multiplication factor for trackball input in transform (slows down trackball rotation) --- source/blender/editors/transform/transform_input.c | 58 +++++++++++----------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'source') diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 631eb1eb134..678d581b2b4 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -35,7 +35,7 @@ #include "transform.h" - + /* ************************** INPUT FROM MOUSE *************************** */ void InputVector(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) @@ -53,7 +53,7 @@ void InputVector(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) { convertViewVec(t, output, (short)(mval[0] - t->imval[0]), (short)(mval[1] - t->imval[1])); } - + } void InputSpring(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) @@ -65,11 +65,11 @@ void InputSpring(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) dx = (float)(mi->center[0] - mi->precision_mval[0]); dy = (float)(mi->center[1] - mi->precision_mval[1]); ratio = (float)sqrt( dx*dx + dy*dy); - + dx= (float)(mi->center[0] - mval[0]); dy= (float)(mi->center[1] - mval[1]); precise_ratio = (float)sqrt( dx*dx + dy*dy); - + ratio = (ratio + (precise_ratio - ratio) / 10.0f) / mi->factor; } else @@ -78,16 +78,16 @@ void InputSpring(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) dy = (float)(mi->center[1] - mval[1]); ratio = (float)sqrt( dx*dx + dy*dy) / mi->factor; } - + output[0] = ratio; } void InputSpringFlip(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) { InputSpring(t, mi, mval, output); - + /* flip scale */ - if ((mi->center[0] - mval[0]) * (mi->center[0] - mi->imval[0]) + + if ((mi->center[0] - mval[0]) * (mi->center[0] - mi->imval[0]) + (mi->center[1] - mval[1]) * (mi->center[1] - mi->imval[1]) < 0) { output[0] *= -1.0f; @@ -96,7 +96,7 @@ void InputSpringFlip(TransInfo *t, MouseInput *mi, short mval[2], float output[3 void InputTrackBall(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) { - + if(mi->precision) { output[0] = ( mi->imval[1] - mi->precision_mval[1] ) + ( mi->precision_mval[1] - mval[1] ) * 0.1f; @@ -107,7 +107,7 @@ void InputTrackBall(TransInfo *t, MouseInput *mi, short mval[2], float output[3] output[0] = (float)( mi->imval[1] - mval[1] ); output[1] = (float)( mval[0] - mi->imval[0] ); } - + output[0] *= mi->factor; output[1] *= mi->factor; } @@ -125,7 +125,7 @@ void InputHorizontalRatio(TransInfo *t, MouseInput *mi, short mval[2], float out else { x = mval[0]; } - + output[0] = (x - pad) / (t->ar->winx - 2 * pad); } @@ -134,7 +134,7 @@ void InputHorizontalAbsolute(TransInfo *t, MouseInput *mi, short mval[2], float InputVector(t, mi, mval, vec); Projf(vec, vec, t->viewinv[0]); - + output[0] = Inpf(t->viewinv[0], vec) * 2.0f; } @@ -150,7 +150,7 @@ void InputVerticalRatio(TransInfo *t, MouseInput *mi, short mval[2], float outpu else { y = mval[0]; } - + output[0] = (y - pad) / (t->ar->winy - 2 * pad); } @@ -159,7 +159,7 @@ void InputVerticalAbsolute(TransInfo *t, MouseInput *mi, short mval[2], float ou InputVector(t, mi, mval, vec); Projf(vec, vec, t->viewinv[1]); - + output[0] = Inpf(t->viewinv[1], vec) * 2.0f; } @@ -182,7 +182,7 @@ void InputAngle(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) /* (A*B?A*B:1.0f) this takes care of potential divide by zero errors */ float dphi; - + dphi = saacos((float)deler); if( (dx1*dy2-dx2*dy1)>0.0 ) dphi= -dphi; @@ -190,33 +190,33 @@ void InputAngle(TransInfo *t, MouseInput *mi, short mval[2], float output[3]) * approximate the angle with the oposite side of the normalized triangle * This is a good approximation here since the smallest acos value seems to be around * 0.02 degree and lower values don't even have a 0.01% error compared to the approximation - * */ + * */ if (dphi == 0) { double dx, dy; - + dx2 /= A; dy2 /= A; - + dx1 /= B; dy1 /= B; - + dx = dx1 - dx2; dy = dy1 - dy2; - + dphi = sqrt(dx*dx + dy*dy); if( (dx1*dy2-dx2*dy1)>0.0 ) dphi= -dphi; } - + if(mi->precision) dphi = dphi/30.0f; - + /* if no delta angle, don't update initial position */ if (dphi != 0) { mi->imval[0] = mval[0]; mi->imval[1] = mval[1]; } - + output[0] += dphi; } @@ -227,7 +227,7 @@ void initMouseInput(TransInfo *t, MouseInput *mi, int center[2], short mval[2]) mi->center[0] = center[0]; mi->center[1] = center[1]; - + mi->imval[0] = mval[0]; mi->imval[1] = mval[1]; } @@ -247,7 +247,7 @@ static void calcSpringFactor(MouseInput *mi) void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode) { - + switch(mode) { case INPUT_VECTOR: @@ -270,7 +270,7 @@ void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode) break; case INPUT_TRACKBALL: /* factor has to become setting or so */ - mi->factor = 0.1f; + mi->factor = 0.02f; mi->apply = InputTrackBall; t->helpline = HLP_TRACKBALL; break; @@ -296,8 +296,8 @@ void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode) mi->apply = NULL; break; } - - /* bootstrap mouse input with initial values */ + + /* bootstrap mouse input with initial values */ applyMouseInput(t, mi, mi->imval, t->values); } @@ -312,7 +312,7 @@ void applyMouseInput(TransInfo *t, MouseInput *mi, short mval[2], float output[3 int handleMouseInput(TransInfo *t, MouseInput *mi, wmEvent *event) { int redraw = 0; - + switch (event->type) { case LEFTSHIFTKEY: @@ -334,6 +334,6 @@ int handleMouseInput(TransInfo *t, MouseInput *mi, wmEvent *event) redraw = 1; break; } - + return redraw; } -- cgit v1.2.3 From d7a333f83fcaa33a73304c8bbff7c0809ada9aa0 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Thu, 9 Jul 2009 02:45:48 +0000 Subject: Hooking transform operators with manipulator. It's just a straight application of the normal operator for now, none of the normal manipulator goodies yet (no draw code and you have to click to confirm). --- source/blender/editors/include/ED_transform.h | 6 +- source/blender/editors/space_view3d/drawarmature.c | 4 +- source/blender/editors/space_view3d/view3d_edit.c | 232 +++++----- .../editors/transform/transform_manipulator.c | 500 ++++++++++----------- source/blender/editors/transform/transform_ops.c | 105 +++-- 5 files changed, 436 insertions(+), 411 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index 9327301336f..adcf2cfc024 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -87,7 +87,7 @@ enum { /* Standalone call to get the transformation center corresponding to the current situation * returns 1 if successful, 0 otherwise (usually means there's no selection) - * (if 0 is returns, *vec is unmodified) + * (if 0 is returns, *vec is unmodified) * */ int calculateTransformCenter(struct bContext *C, struct wmEvent *event, int centerMode, float *vec); @@ -128,7 +128,7 @@ void BIF_selectOrientation(void); void initManipulator(int mode); void ManipulatorTransform(); -int BIF_do_manipulator(struct bContext *C, short mval[2]); +int BIF_do_manipulator(struct bContext *C, struct wmEvent *event, struct wmOperator *op); void BIF_draw_manipulator(const struct bContext *C); /* Snapping */ @@ -137,7 +137,7 @@ void BIF_draw_manipulator(const struct bContext *C); typedef struct DepthPeel { struct DepthPeel *next, *prev; - + float depth; float p[3]; float no[3]; diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 68a9bf3f555..e0ec878ea4a 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1812,7 +1812,7 @@ static void draw_pose_channels(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ba if ( (arm->flag & ARM_DRAWAXES) && (arm->flag & ARM_POSEMODE) ) { glPushMatrix(); glMultMatrixf(pchan->pose_mat); - glTranslatef(0.0f, pchan->bone->length, 0.0f); + //glTranslatef(0.0f, pchan->bone->length, 0.0f); drawaxes(0.25f*pchan->bone->length, 0, OB_ARROWS); glPopMatrix(); } @@ -1996,7 +1996,7 @@ static void draw_ebones(View3D *v3d, RegionView3D *rv3d, Object *ob, int dt) if (arm->flag & ARM_DRAWAXES) { glPushMatrix(); set_matrix_editbone(eBone); - glTranslatef(0.0f, eBone->length, 0.0f); + //glTranslatef(0.0f, eBone->length, 0.0f); drawaxes(eBone->length*0.25f, 0, OB_ARROWS); glPopMatrix(); } diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 1206bf72b72..7880e588767 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -95,50 +95,50 @@ static void view3d_boxview_clip(ScrArea *sa) float clip[6][4]; float x1= 0.0f, y1= 0.0f, z1= 0.0f, ofs[3]; int val; - + /* create bounding box */ for(ar= sa->regionbase.first; ar; ar= ar->next) { if(ar->regiontype==RGN_TYPE_WINDOW) { RegionView3D *rv3d= ar->regiondata; - + if(rv3d->viewlock & RV3D_BOXCLIP) { if(ELEM(rv3d->view, V3D_VIEW_TOP, V3D_VIEW_BOTTOM)) { if(ar->winx>ar->winy) x1= rv3d->dist; else x1= ar->winx*rv3d->dist/ar->winy; - + if(ar->winx>ar->winy) y1= ar->winy*rv3d->dist/ar->winx; else y1= rv3d->dist; - + ofs[0]= rv3d->ofs[0]; ofs[1]= rv3d->ofs[1]; } else if(ELEM(rv3d->view, V3D_VIEW_FRONT, V3D_VIEW_BACK)) { ofs[2]= rv3d->ofs[2]; - + if(ar->winx>ar->winy) z1= ar->winy*rv3d->dist/ar->winx; else z1= rv3d->dist; } } } } - + for(val=0; val<8; val++) { if(ELEM4(val, 0, 3, 4, 7)) bb->vec[val][0]= -x1 - ofs[0]; else bb->vec[val][0]= x1 - ofs[0]; - + if(ELEM4(val, 0, 1, 4, 5)) bb->vec[val][1]= -y1 - ofs[1]; else bb->vec[val][1]= y1 - ofs[1]; - + if(val > 3) bb->vec[val][2]= -z1 - ofs[2]; else bb->vec[val][2]= z1 - ofs[2]; - } - + } + /* normals for plane equations */ CalcNormFloat(bb->vec[0], bb->vec[1], bb->vec[4], clip[0]); CalcNormFloat(bb->vec[1], bb->vec[2], bb->vec[5], clip[1]); @@ -146,18 +146,18 @@ static void view3d_boxview_clip(ScrArea *sa) CalcNormFloat(bb->vec[3], bb->vec[0], bb->vec[7], clip[3]); CalcNormFloat(bb->vec[4], bb->vec[5], bb->vec[6], clip[4]); CalcNormFloat(bb->vec[0], bb->vec[2], bb->vec[1], clip[5]); - + /* then plane equations */ for(val=0; val<5; val++) { clip[val][3]= - clip[val][0]*bb->vec[val][0] - clip[val][1]*bb->vec[val][1] - clip[val][2]*bb->vec[val][2]; } clip[5][3]= - clip[5][0]*bb->vec[0][0] - clip[5][1]*bb->vec[0][1] - clip[5][2]*bb->vec[0][2]; - + /* create bounding box */ for(ar= sa->regionbase.first; ar; ar= ar->next) { if(ar->regiontype==RGN_TYPE_WINDOW) { RegionView3D *rv3d= ar->regiondata; - + if(rv3d->viewlock & RV3D_BOXCLIP) { rv3d->rflag |= RV3D_CLIPPING; memcpy(rv3d->clip, clip, sizeof(clip)); @@ -172,11 +172,11 @@ static void view3d_boxview_sync(ScrArea *sa, ARegion *ar) { ARegion *artest; RegionView3D *rv3d= ar->regiondata; - + for(artest= sa->regionbase.first; artest; artest= artest->next) { if(artest!=ar && artest->regiontype==RGN_TYPE_WINDOW) { RegionView3D *rv3dtest= artest->regiondata; - + if(rv3dtest->viewlock) { rv3dtest->dist= rv3d->dist; @@ -198,7 +198,7 @@ static void view3d_boxview_sync(ScrArea *sa, ARegion *ar) if( ELEM(rv3dtest->view, V3D_VIEW_FRONT, V3D_VIEW_BACK)) rv3dtest->ofs[2]= rv3d->ofs[2]; } - + ED_region_tag_redraw(artest); } } @@ -211,11 +211,11 @@ void view3d_boxview_copy(ScrArea *sa, ARegion *ar) { ARegion *artest; RegionView3D *rv3d= ar->regiondata; - + for(artest= sa->regionbase.first; artest; artest= artest->next) { if(artest!=ar && artest->regiontype==RGN_TYPE_WINDOW) { RegionView3D *rv3dtest= artest->regiondata; - + if(rv3dtest->viewlock) { rv3dtest->dist= rv3d->dist; VECCOPY(rv3dtest->ofs, rv3d->ofs); @@ -238,7 +238,7 @@ typedef struct ViewOpsData { float ofs[3], obofs[3]; float reverse, dist0; float grid, far; - + int origx, origy, oldx, oldy; int origkey; @@ -289,11 +289,11 @@ static void viewops_data(bContext *C, wmOperator *op, wmEvent *event) vod->origx= vod->oldx= event->x; vod->origy= vod->oldy= event->y; vod->origkey= event->type; - + /* lookup, we dont pass on v3d to prevent confusement */ vod->grid= v3d->grid; vod->far= v3d->far; - + calctrackballvec(&vod->ar->winrct, event->x, event->y, vod->trackvec); initgrabz(rv3d, -rv3d->ofs[0], -rv3d->ofs[1], -rv3d->ofs[2]); @@ -523,7 +523,7 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event) if(rv3d->viewlock) return OPERATOR_CANCELLED; - + /* makes op->customdata */ viewops_data(C, op, event); vod= op->customdata; @@ -557,7 +557,7 @@ void VIEW3D_OT_viewrotate(wmOperatorType *ot) ot->invoke= viewrotate_invoke; ot->modal= viewrotate_modal; ot->poll= ED_operator_view3d_active; - + /* flags */ ot->flag= OPTYPE_REGISTER; } @@ -580,7 +580,7 @@ static void viewmove_apply(ViewOpsData *vod, int x, int y) window_to_3d_delta(vod->ar, dvec, x-vod->oldx, y-vod->oldy); VecAddf(vod->rv3d->ofs, vod->rv3d->ofs, dvec); - + if(vod->rv3d->viewlock & RV3D_BOXVIEW) view3d_boxview_sync(vod->sa, vod->ar); } @@ -640,7 +640,7 @@ void VIEW3D_OT_viewmove(wmOperatorType *ot) ot->invoke= viewmove_invoke; ot->modal= viewmove_modal; ot->poll= ED_operator_view3d_active; - + /* flags */ ot->flag= OPTYPE_REGISTER; } @@ -650,7 +650,7 @@ void VIEW3D_OT_viewmove(wmOperatorType *ot) static void view_zoom_mouseloc(ARegion *ar, float dfac, int mx, int my) { RegionView3D *rv3d= ar->regiondata; - + if(U.uiflag & USER_ZOOM_TO_MOUSEPOS) { float dvec[3]; float tvec[3]; @@ -800,7 +800,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op) if(rv3d->viewlock & RV3D_BOXVIEW) view3d_boxview_sync(CTX_wm_area(C), CTX_wm_region(C)); - + request_depth_update(CTX_wm_region_view3d(C)); ED_region_tag_redraw(CTX_wm_region(C)); @@ -839,10 +839,10 @@ void VIEW3D_OT_zoom(wmOperatorType *ot) ot->exec= viewzoom_exec; ot->modal= viewzoom_modal; ot->poll= ED_operator_view3d_active; - + /* flags */ ot->flag= OPTYPE_REGISTER; - + RNA_def_int(ot->srna, "delta", 0, INT_MIN, INT_MAX, "Delta", "", INT_MIN, INT_MAX); } @@ -899,11 +899,11 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2. if (rv3d->persp==V3D_CAMOB) { rv3d->persp= V3D_PERSP; - smooth_view(C, NULL, v3d->camera, new_ofs, NULL, &new_dist, NULL); + smooth_view(C, NULL, v3d->camera, new_ofs, NULL, &new_dist, NULL); } } // XXX BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); - + if(rv3d->viewlock & RV3D_BOXVIEW) view3d_boxview_copy(CTX_wm_area(C), ar); @@ -920,10 +920,10 @@ void VIEW3D_OT_viewhome(wmOperatorType *ot) /* api callbacks */ ot->exec= viewhome_exec; ot->poll= ED_operator_view3d_active; - + /* flags */ ot->flag= OPTYPE_REGISTER; - + RNA_def_boolean(ot->srna, "center", 0, "Center", ""); } @@ -1013,7 +1013,7 @@ static int viewcenter_exec(bContext *C, wmOperator *op) /* like a localview with /* perspective should be a bit farther away to look nice */ if(rv3d->persp==V3D_ORTHO) size*= 0.7; - + if(size <= v3d->near*1.5f) size= v3d->near*1.5f; new_ofs[0]= -(min[0]+max[0])/2.0f; @@ -1036,7 +1036,7 @@ static int viewcenter_exec(bContext *C, wmOperator *op) /* like a localview with if (rv3d->persp==V3D_CAMOB) { rv3d->persp= V3D_PERSP; smooth_view(C, v3d->camera, NULL, new_ofs, NULL, &new_dist, NULL); - } + } else { smooth_view(C, NULL, NULL, new_ofs, NULL, &new_dist, NULL); } @@ -1059,7 +1059,7 @@ void VIEW3D_OT_viewcenter(wmOperatorType *ot) /* api callbacks */ ot->exec= viewcenter_exec; ot->poll= ED_operator_view3d_active; - + /* flags */ ot->flag= OPTYPE_REGISTER; } @@ -1071,16 +1071,16 @@ static int render_border_exec(bContext *C, wmOperator *op) View3D *v3d = CTX_wm_view3d(C); ARegion *ar= CTX_wm_region(C); Scene *scene= CTX_data_scene(C); - + rcti rect; rctf vb; - + /* get border select values using rna */ rect.xmin= RNA_int_get(op->ptr, "xmin"); rect.ymin= RNA_int_get(op->ptr, "ymin"); rect.xmax= RNA_int_get(op->ptr, "xmax"); rect.ymax= RNA_int_get(op->ptr, "ymax"); - + /* calculate range */ calc_viewborder(scene, ar, v3d, &vb); @@ -1088,13 +1088,13 @@ static int render_border_exec(bContext *C, wmOperator *op) scene->r.border.ymin= ((float)rect.ymin-vb.ymin)/(vb.ymax-vb.ymin); scene->r.border.xmax= ((float)rect.xmax-vb.xmin)/(vb.xmax-vb.xmin); scene->r.border.ymax= ((float)rect.ymax-vb.ymin)/(vb.ymax-vb.ymin); - - /* actually set border */ + + /* actually set border */ CLAMP(scene->r.border.xmin, 0.0, 1.0); CLAMP(scene->r.border.ymin, 0.0, 1.0); CLAMP(scene->r.border.xmax, 0.0, 1.0); CLAMP(scene->r.border.ymax, 0.0, 1.0); - + /* drawing a border surrounding the entire camera view switches off border rendering * or the border covers no pixels */ if ((scene->r.border.xmin <= 0.0 && scene->r.border.xmax >= 1.0 && @@ -1106,7 +1106,7 @@ static int render_border_exec(bContext *C, wmOperator *op) } else { scene->r.mode |= R_BORDER; } - + return OPERATOR_FINISHED; } @@ -1114,9 +1114,9 @@ static int render_border_exec(bContext *C, wmOperator *op) static int view3d_render_border_invoke(bContext *C, wmOperator *op, wmEvent *event) { RegionView3D *rv3d= CTX_wm_region_view3d(C); - + /* if not in camera view do not exec the operator*/ - if (rv3d->persp == V3D_CAMOB) return WM_border_select_invoke(C, op, event); + if (rv3d->persp == V3D_CAMOB) return WM_border_select_invoke(C, op, event); else return OPERATOR_PASS_THROUGH; } @@ -1131,12 +1131,12 @@ void VIEW3D_OT_render_border(wmOperatorType *ot) ot->invoke= view3d_render_border_invoke; ot->exec= render_border_exec; ot->modal= WM_border_select_modal; - + ot->poll= ED_operator_view3d_active; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - + /* rna */ RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); @@ -1152,7 +1152,7 @@ static int view3d_border_zoom_exec(bContext *C, wmOperator *op) View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d= CTX_wm_region_view3d(C); Scene *scene= CTX_data_scene(C); - + /* Zooms in on a border drawn by the user */ rcti rect; float dvec[3], vb[2], xscale, yscale, scale; @@ -1167,16 +1167,16 @@ static int view3d_border_zoom_exec(bContext *C, wmOperator *op) int had_depth = 0; double cent[2], p[3]; int xs, ys; - + /* note; otherwise opengl won't work */ view3d_operator_needs_opengl(C); - + /* get border select values using rna */ rect.xmin= RNA_int_get(op->ptr, "xmin"); rect.ymin= RNA_int_get(op->ptr, "ymin"); rect.xmax= RNA_int_get(op->ptr, "xmax"); rect.ymax= RNA_int_get(op->ptr, "ymax"); - + /* Get Z Depths, needed for perspective, nice for ortho */ bgl_get_mats(&mats); draw_depth(scene, ar, v3d, NULL); @@ -1275,27 +1275,27 @@ static int view3d_border_zoom_exec(bContext *C, wmOperator *op) } smooth_view(C, NULL, NULL, new_ofs, NULL, &new_dist, NULL); - + if(rv3d->viewlock & RV3D_BOXVIEW) view3d_boxview_sync(CTX_wm_area(C), ar); - + return OPERATOR_FINISHED; } static int view3d_border_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event) { RegionView3D *rv3d= CTX_wm_region_view3d(C); - + /* if in camera view do not exec the operator so we do not conflict with set render border*/ - if (rv3d->persp != V3D_CAMOB) - return WM_border_select_invoke(C, op, event); - else + if (rv3d->persp != V3D_CAMOB) + return WM_border_select_invoke(C, op, event); + else return OPERATOR_PASS_THROUGH; } void VIEW3D_OT_zoom_border(wmOperatorType *ot) { - + /* identifiers */ ot->name= "Border Zoom"; ot->description = "Zoom in the view to the nearest object contained in the border."; @@ -1305,12 +1305,12 @@ void VIEW3D_OT_zoom_border(wmOperatorType *ot) ot->invoke= view3d_border_zoom_invoke; ot->exec= view3d_border_zoom_exec; ot->modal= WM_border_select_modal; - + ot->poll= ED_operator_view3d_active; - + /* flags */ ot->flag= OPTYPE_REGISTER; - + /* rna */ RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); @@ -1335,7 +1335,7 @@ static void axis_set_view(bContext *C, float q1, float q2, float q3, float q4, s View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d= CTX_wm_region_view3d(C); float new_quat[4]; - + if(rv3d->viewlock) { /* only pass on if */ if(rv3d->view==V3D_VIEW_FRONT && view==V3D_VIEW_BACK); @@ -1346,10 +1346,10 @@ static void axis_set_view(bContext *C, float q1, float q2, float q3, float q4, s else if(rv3d->view==V3D_VIEW_TOP && view==V3D_VIEW_BOTTOM); else return; } - + new_quat[0]= q1; new_quat[1]= q2; new_quat[2]= q3; new_quat[3]= q4; - + rv3d->view= view; if(rv3d->viewlock) { @@ -1362,8 +1362,8 @@ static void axis_set_view(bContext *C, float q1, float q2, float q3, float q4, s if (U.uiflag & USER_AUTOPERSP) rv3d->persp= V3D_ORTHO; else if(rv3d->persp==V3D_CAMOB) rv3d->persp= perspo; - smooth_view(C, v3d->camera, NULL, rv3d->ofs, new_quat, NULL, NULL); - } + smooth_view(C, v3d->camera, NULL, rv3d->ofs, new_quat, NULL, NULL); + } else { if (U.uiflag & USER_AUTOPERSP) rv3d->persp= V3D_ORTHO; @@ -1420,7 +1420,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op) QUATCOPY(rv3d->lviewquat, rv3d->viewquat); rv3d->lview= rv3d->view; rv3d->lpersp= rv3d->persp; - + #if 0 if(G.qual==LR_ALTKEY) { if(oldcamera && is_an_active_object(oldcamera)) { @@ -1429,7 +1429,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op) handle_view3d_lock(); } #endif - + if(BASACT) { /* check both G.vd as G.scene cameras */ if((v3d->camera==NULL || scene->camera==NULL) && OBACT->type==OB_CAMERA) { @@ -1437,14 +1437,14 @@ static int viewnumpad_exec(bContext *C, wmOperator *op) /*handle_view3d_lock();*/ } } - + if(v3d->camera==NULL) { v3d->camera= scene_find_camera(scene); /*handle_view3d_lock();*/ } rv3d->persp= V3D_CAMOB; smooth_view(C, NULL, v3d->camera, rv3d->ofs, rv3d->viewquat, &rv3d->dist, &v3d->lens); - + } else{ /* return to settings of last view */ @@ -1472,10 +1472,10 @@ void VIEW3D_OT_viewnumpad(wmOperatorType *ot) /* api callbacks */ ot->exec= viewnumpad_exec; ot->poll= ED_operator_view3d_active; - + /* flags */ ot->flag= OPTYPE_REGISTER; - + RNA_def_enum(ot->srna, "type", prop_view_items, 0, "View", "The Type of view"); } @@ -1490,11 +1490,11 @@ static int vieworbit_exec(bContext *C, wmOperator *op) { ARegion *ar= CTX_wm_region(C); RegionView3D *rv3d= CTX_wm_region_view3d(C); - float phi, si, q1[4]; + float phi, si, q1[4]; int orbitdir; orbitdir = RNA_enum_get(op->ptr, "type"); - + if(rv3d->viewlock==0) { if(rv3d->persp != V3D_CAMOB) { @@ -1528,7 +1528,7 @@ static int vieworbit_exec(bContext *C, wmOperator *op) } } - return OPERATOR_FINISHED; + return OPERATOR_FINISHED; } void VIEW3D_OT_view_orbit(wmOperatorType *ot) @@ -1541,7 +1541,7 @@ void VIEW3D_OT_view_orbit(wmOperatorType *ot) /* api callbacks */ ot->exec= vieworbit_exec; ot->poll= ED_operator_view3d_active; - + /* flags */ ot->flag= OPTYPE_REGISTER; RNA_def_enum(ot->srna, "type", prop_view_orbit_items, 0, "Orbit", "Direction of View Orbit"); @@ -1557,12 +1557,12 @@ static EnumPropertyItem prop_view_pan_items[] = { static int viewpan_exec(bContext *C, wmOperator *op) { ARegion *ar= CTX_wm_region(C); - RegionView3D *rv3d= CTX_wm_region_view3d(C); - float vec[3]; + RegionView3D *rv3d= CTX_wm_region_view3d(C); + float vec[3]; int pandir; pandir = RNA_enum_get(op->ptr, "type"); - + initgrabz(rv3d, 0.0, 0.0, 0.0); if(pandir == V3D_VIEW_PANRIGHT) window_to_3d_delta(ar, vec, -32, 0); @@ -1578,7 +1578,7 @@ static int viewpan_exec(bContext *C, wmOperator *op) ED_region_tag_redraw(ar); - return OPERATOR_FINISHED; + return OPERATOR_FINISHED; } void VIEW3D_OT_view_pan(wmOperatorType *ot) @@ -1591,7 +1591,7 @@ void VIEW3D_OT_view_pan(wmOperatorType *ot) /* api callbacks */ ot->exec= viewpan_exec; ot->poll= ED_operator_view3d_active; - + /* flags */ ot->flag= OPTYPE_REGISTER; RNA_def_enum(ot->srna, "type", prop_view_pan_items, 0, "Pan", "Direction of View Pan"); @@ -1600,17 +1600,17 @@ void VIEW3D_OT_view_pan(wmOperatorType *ot) static int viewpersportho_exec(bContext *C, wmOperator *op) { ARegion *ar= CTX_wm_region(C); - RegionView3D *rv3d= CTX_wm_region_view3d(C); - + RegionView3D *rv3d= CTX_wm_region_view3d(C); + if(rv3d->viewlock==0) { - if(rv3d->persp!=V3D_ORTHO) + if(rv3d->persp!=V3D_ORTHO) rv3d->persp=V3D_ORTHO; else rv3d->persp=V3D_PERSP; ED_region_tag_redraw(ar); } return OPERATOR_FINISHED; - + } void VIEW3D_OT_view_persportho(wmOperatorType *ot) @@ -1623,7 +1623,7 @@ void VIEW3D_OT_view_persportho(wmOperatorType *ot) /* api callbacks */ ot->exec= viewpersportho_exec; ot->poll= ED_operator_view3d_active; - + /* flags */ ot->flag= OPTYPE_REGISTER; } @@ -1725,10 +1725,10 @@ void VIEW3D_OT_clipping(wmOperatorType *ot) ot->modal= WM_border_select_modal; ot->poll= ED_operator_view3d_active; - + /* flags */ ot->flag= OPTYPE_REGISTER; - + /* rna */ RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); @@ -1745,7 +1745,7 @@ static int view3d_drawtype_exec(bContext *C, wmOperator *op) dt = RNA_int_get(op->ptr, "draw_type"); dt_alt = RNA_int_get(op->ptr, "draw_type_alternate"); - + if (dt_alt != -1) { if (v3d->drawtype == dt) v3d->drawtype = dt_alt; @@ -1756,7 +1756,7 @@ static int view3d_drawtype_exec(bContext *C, wmOperator *op) v3d->drawtype = dt; ED_area_tag_redraw(CTX_wm_area(C)); - + return OPERATOR_FINISHED; } @@ -1778,10 +1778,10 @@ void VIEW3D_OT_drawtype(wmOperatorType *ot) ot->exec= view3d_drawtype_exec; ot->poll= ED_operator_view3d_active; - + /* flags */ ot->flag= OPTYPE_REGISTER; - + /* rna XXX should become enum */ RNA_def_int(ot->srna, "draw_type", 0, INT_MIN, INT_MAX, "Draw Type", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "draw_type_alternate", -1, INT_MIN, INT_MAX, "Draw Type Alternate", "", INT_MIN, INT_MAX); @@ -1799,36 +1799,36 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *op, wmEvent *event) float dx, dy, fz, *fp = NULL, dvec[3], oldcurs[3]; short mx, my, mval[2]; // short ctrl= 0; // XXX - + fp= give_cursor(scene, v3d); - + // if(obedit && ctrl) lr_click= 1; VECCOPY(oldcurs, fp); - + mx= event->x - ar->winrct.xmin; my= event->y - ar->winrct.ymin; project_short_noclip(ar, fp, mval); - + initgrabz(rv3d, fp[0], fp[1], fp[2]); - + if(mval[0]!=IS_CLIPPED) { - + window_to_3d_delta(ar, dvec, mval[0]-mx, mval[1]-my); VecSubf(fp, fp, dvec); } else { - + dx= ((float)(mx-(ar->winx/2)))*rv3d->zfac/(ar->winx/2); dy= ((float)(my-(ar->winy/2)))*rv3d->zfac/(ar->winy/2); - + fz= rv3d->persmat[0][3]*fp[0]+ rv3d->persmat[1][3]*fp[1]+ rv3d->persmat[2][3]*fp[2]+ rv3d->persmat[3][3]; fz= fz/rv3d->zfac; - + fp[0]= (rv3d->persinv[0][0]*dx + rv3d->persinv[1][0]*dy+ rv3d->persinv[2][0]*fz)-rv3d->ofs[0]; fp[1]= (rv3d->persinv[0][1]*dx + rv3d->persinv[1][1]*dy+ rv3d->persinv[2][1]*fz)-rv3d->ofs[1]; fp[2]= (rv3d->persinv[0][2]*dx + rv3d->persinv[1][2]*dy+ rv3d->persinv[2][2]*fz)-rv3d->ofs[2]; } - + // if(lr_click) { // XXX if(obedit->type==OB_MESH) add_click_mesh(); // else if ELEM(obedit->type, OB_CURVE, OB_SURF) addvert_Nurb(0); @@ -1837,24 +1837,24 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *op, wmEvent *event) // } // XXX notifier for scene */ ED_area_tag_redraw(CTX_wm_area(C)); - + /* prevent other mouse ops to fail */ return OPERATOR_PASS_THROUGH; } void VIEW3D_OT_cursor3d(wmOperatorType *ot) { - + /* identifiers */ ot->name= "Set 3D Cursor"; ot->description = "Set the location of the 3D cursor."; ot->idname= "VIEW3D_OT_cursor3d"; - + /* api callbacks */ ot->invoke= set_3dcursor_invoke; - + ot->poll= ED_operator_view3d_active; - + /* rna later */ } @@ -1871,28 +1871,28 @@ static int manipulator_invoke(bContext *C, wmOperator *op, wmEvent *event) /* note; otherwise opengl won't work */ view3d_operator_needs_opengl(C); - - if(0==BIF_do_manipulator(C, event->mval)) + + if(0==BIF_do_manipulator(C, event, op)) return OPERATOR_PASS_THROUGH; - + return OPERATOR_FINISHED; } void VIEW3D_OT_manipulator(wmOperatorType *ot) { - + /* identifiers */ ot->name= "3D Manipulator"; ot->description = ""; ot->idname= "VIEW3D_OT_manipulator"; - + /* api callbacks */ ot->invoke= manipulator_invoke; - + ot->poll= ED_operator_view3d_active; - + /* rna later */ - + RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, NULL, "Constraint Axis", ""); } diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 3868ac9204b..c4cca6eba07 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -53,6 +53,8 @@ #include "DNA_userdef_types.h" #include "DNA_view3d_types.h" +#include "RNA_access.h" + #include "BKE_armature.h" #include "BKE_context.h" #include "BKE_global.h" @@ -111,11 +113,11 @@ static int is_mat4_flipped(float mat[][4]) { float vec[3]; - + Crossf(vec, mat[0], mat[1]); if( Inpf(vec, mat[2]) < 0.0 ) return 1; return 0; -} +} /* transform widget center calc helper for below */ static void calc_tw_center(Scene *scene, float *co) @@ -123,7 +125,7 @@ static void calc_tw_center(Scene *scene, float *co) float *twcent= scene->twcent; float *min= scene->twmin; float *max= scene->twmax; - + DO_MINMAX(co, min, max); VecAddf(twcent, twcent, co); } @@ -136,7 +138,7 @@ static void protectflag_to_drawflags(short protectflag, short *drawflags) *drawflags &= ~MAN_TRANS_Y; if(protectflag & OB_LOCK_LOCZ) *drawflags &= ~MAN_TRANS_Z; - + if(protectflag & OB_LOCK_ROTX) *drawflags &= ~MAN_ROT_X; if(protectflag & OB_LOCK_ROTY) @@ -156,7 +158,7 @@ static void protectflag_to_drawflags(short protectflag, short *drawflags) static void stats_pose(Scene *scene, View3D *v3d, bPoseChannel *pchan) { Bone *bone= pchan->bone; - + if(bone) { if (bone->flag & BONE_TRANSFORM) { calc_tw_center(scene, pchan->pose_head); @@ -174,11 +176,11 @@ static void stats_editbone(View3D *v3d, EditBone *ebo) /* only counts the parent selection, and tags transform flag */ /* bad call... should re-use method from transform_conversion once */ -static void count_bone_select(TransInfo *t, bArmature *arm, ListBase *lb, int do_it) +static void count_bone_select(TransInfo *t, bArmature *arm, ListBase *lb, int do_it) { Bone *bone; int do_next; - + for(bone= lb->first; bone; bone= bone->next) { bone->flag &= ~BONE_TRANSFORM; do_next= do_it; @@ -214,16 +216,16 @@ int calc_manipulator_stats(const bContext *C) float normal[3]={0.0, 0.0, 0.0}; float plane[3]={0.0, 0.0, 0.0}; int a, totsel= 0; - + /* transform widget matrix */ Mat4One(rv3d->twmat); - + v3d->twdrawflag= 0xFFFF; - + /* transform widget centroid/center */ scene->twcent[0]= scene->twcent[1]= scene->twcent[2]= 0.0f; INIT_MINMAX(scene->twmin, scene->twmax); - + if(obedit) { ob= obedit; if((ob->lay & v3d->lay)==0) return 0; @@ -233,7 +235,7 @@ int calc_manipulator_stats(const bContext *C) EditVert *eve; EditSelection ese; float vec[3]= {0,0,0}; - + /* USE LAST SELECTE WITH ACTIVE */ if (v3d->around==V3D_ACTIVE && EM_get_actSelection(em, &ese)) { EM_editselection_center(vec, &ese); @@ -273,7 +275,7 @@ int calc_manipulator_stats(const bContext *C) Nurb *nu; BezTriple *bezt; BPoint *bp; - + nu= cu->editnurb->first; while(nu) { if((nu->type & 7)==CU_BEZIER) { @@ -329,7 +331,7 @@ int calc_manipulator_stats(const bContext *C) /* editmball.c */ ListBase editelems= {NULL, NULL}; /* XXX */ MetaElem *ml, *ml_sel=NULL; - + ml= editelems.first; while(ml) { if(ml->flag & SELECT) { @@ -343,9 +345,9 @@ int calc_manipulator_stats(const bContext *C) else if(obedit->type==OB_LATTICE) { BPoint *bp; Lattice *lt= obedit->data; - + bp= lt->editlatt->def; - + a= lt->editlatt->pntsu*lt->editlatt->pntsv*lt->editlatt->pntsw; while(a--) { if(bp->f1 & SELECT) { @@ -355,7 +357,7 @@ int calc_manipulator_stats(const bContext *C) bp++; } } - + /* selection center */ if(totsel) { VecMulf(scene->twcent, 1.0f/(float)totsel); // centroid! @@ -368,12 +370,12 @@ int calc_manipulator_stats(const bContext *C) bArmature *arm = ob->data; bPoseChannel *pchan; int mode; - + if((ob->lay & v3d->lay)==0) return 0; - + mode = t->mode; t->mode = TFM_ROTATION; // mislead counting bones... bah - + /* count total, we use same method as transform will do */ t->total= 0; count_bone_select(t, arm, &arm->bonebase, 1); @@ -383,7 +385,7 @@ int calc_manipulator_stats(const bContext *C) for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { stats_pose(scene, v3d, pchan); } - + VecMulf(scene->twcent, 1.0f/(float)totsel); // centroid! Mat4MulVecfl(ob->obmat, scene->twcent); Mat4MulVecfl(ob->obmat, scene->twmin); @@ -419,44 +421,44 @@ int calc_manipulator_stats(const bContext *C) } } else { - + /* we need the one selected object, if its not active */ ob= OBACT; if(ob && !(ob->flag & SELECT)) ob= NULL; - + for(base= scene->base.first; base; base= base->next) { if TESTBASELIB(scene, base) { - if(ob==NULL) + if(ob==NULL) ob= base->object; calc_tw_center(scene, base->object->obmat[3]); protectflag_to_drawflags(base->object->protectflag, &v3d->twdrawflag); totsel++; } } - + /* selection center */ if(totsel) { VecMulf(scene->twcent, 1.0f/(float)totsel); // centroid! } } - + /* global, local or normal orientation? */ if(ob && totsel) { - + switch(v3d->twmode) { case V3D_MANIP_GLOBAL: strcpy(t->spacename, "global"); break; - + case V3D_MANIP_NORMAL: if(obedit || ob->flag & OB_POSEMODE) { float mat[3][3]; int type; - + strcpy(t->spacename, "normal"); - + type = getTransformOrientation(C, normal, plane, (v3d->around == V3D_ACTIVE)); - + switch (type) { case ORIENTATION_NORMAL: @@ -484,7 +486,7 @@ int calc_manipulator_stats(const bContext *C) } break; } - + if (type == ORIENTATION_NONE) { Mat4One(rv3d->twmat); @@ -501,7 +503,7 @@ int calc_manipulator_stats(const bContext *C) Mat4CpyMat4(rv3d->twmat, ob->obmat); Mat4Ortho(rv3d->twmat); break; - + case V3D_MANIP_VIEW: { float mat[3][3]; @@ -515,9 +517,9 @@ int calc_manipulator_stats(const bContext *C) applyTransformOrientation(C, t); break; } - + } - + return totsel; } @@ -526,15 +528,15 @@ int calc_manipulator_stats(const bContext *C) static float screen_aligned(RegionView3D *rv3d, float mat[][4]) { float vec[3], size; - + VECCOPY(vec, mat[0]); size= Normalize(vec); - + glTranslatef(mat[3][0], mat[3][1], mat[3][2]); - + /* sets view screen aligned */ glRotatef( -360.0f*saacos(rv3d->viewquat[0])/(float)M_PI, rv3d->viewquat[1], rv3d->viewquat[2], rv3d->viewquat[3]); - + return size; } @@ -553,32 +555,32 @@ static void partial_donut(float radring, float radhole, int start, int end, int float cos_theta1, sin_theta1; float ring_delta, side_delta; int i, j, docaps= 1; - + if(start==0 && end==nrings) docaps= 0; - + ring_delta= 2.0f*(float)M_PI/(float)nrings; side_delta= 2.0f*(float)M_PI/(float)nsides; - + theta= (float)M_PI+0.5f*ring_delta; cos_theta= (float)cos(theta); sin_theta= (float)sin(theta); - + for(i= nrings - 1; i >= 0; i--) { theta1= theta + ring_delta; cos_theta1= (float)cos(theta1); sin_theta1= (float)sin(theta1); - + if(docaps && i==start) { // cap glBegin(GL_POLYGON); phi= 0.0; for(j= nsides; j >= 0; j--) { float cos_phi, sin_phi, dist; - + phi += side_delta; cos_phi= (float)cos(phi); sin_phi= (float)sin(phi); dist= radhole + radring * cos_phi; - + glVertex3f(cos_theta1 * dist, -sin_theta1 * dist, radring * sin_phi); } glEnd(); @@ -588,35 +590,35 @@ static void partial_donut(float radring, float radhole, int start, int end, int phi= 0.0; for(j= nsides; j >= 0; j--) { float cos_phi, sin_phi, dist; - + phi += side_delta; cos_phi= (float)cos(phi); sin_phi= (float)sin(phi); dist= radhole + radring * cos_phi; - + glVertex3f(cos_theta1 * dist, -sin_theta1 * dist, radring * sin_phi); glVertex3f(cos_theta * dist, -sin_theta * dist, radring * sin_phi); } glEnd(); } - + if(docaps && i==end) { // cap glBegin(GL_POLYGON); phi= 0.0; for(j= nsides; j >= 0; j--) { float cos_phi, sin_phi, dist; - + phi -= side_delta; cos_phi= (float)cos(phi); sin_phi= (float)sin(phi); dist= radhole + radring * cos_phi; - + glVertex3f(cos_theta * dist, -sin_theta * dist, radring * sin_phi); } glEnd(); } - - + + theta= theta1; cos_theta= cos_theta1; sin_theta= sin_theta1; @@ -632,9 +634,9 @@ static void manipulator_setcolor(View3D *v3d, char axis, int colcode) { float vec[4]; char col[4]; - + vec[3]= 0.7f; // alpha set on 0.5, can be glEnabled or not - + if(colcode==MAN_GHOST) { glColor4ub(0, 0, 0, 70); } @@ -674,7 +676,7 @@ static void manipulator_setcolor(View3D *v3d, char axis, int colcode) /* viewmatrix should have been set OK, also no shademode! */ static void draw_manipulator_axes(View3D *v3d, int colcode, int flagx, int flagy, int flagz) { - + /* axes */ if(flagx) { manipulator_setcolor(v3d, 'x', colcode); @@ -684,7 +686,7 @@ static void draw_manipulator_axes(View3D *v3d, int colcode, int flagx, int flagy glVertex3f(0.2f, 0.0f, 0.0f); glVertex3f(1.0f, 0.0f, 0.0f); glEnd(); - } + } if(flagy) { if(flagy & MAN_SCALE_Y) glLoadName(MAN_SCALE_Y); else if(flagy & MAN_TRANS_Y) glLoadName(MAN_TRANS_Y); @@ -693,7 +695,7 @@ static void draw_manipulator_axes(View3D *v3d, int colcode, int flagx, int flagy glVertex3f(0.0f, 0.2f, 0.0f); glVertex3f(0.0f, 1.0f, 0.0f); glEnd(); - } + } if(flagz) { if(flagz & MAN_SCALE_Z) glLoadName(MAN_SCALE_Z); else if(flagz & MAN_TRANS_Z) glLoadName(MAN_TRANS_Z); @@ -712,63 +714,63 @@ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int d GLUquadricObj *qobj; float size, phi, startphi, vec[3], svec[3], matt[4][4], cross[3], tmat[3][3]; int arcs= (G.rt!=2); - + glDisable(GL_DEPTH_TEST); - qobj= gluNewQuadric(); - gluQuadricDrawStyle(qobj, GLU_FILL); - + qobj= gluNewQuadric(); + gluQuadricDrawStyle(qobj, GLU_FILL); + glColor4ub(0,0,0,64); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); - + /* we need both [4][4] transforms, t->mat seems to be premul, not post for mat[][4] */ Mat4CpyMat4(matt, rv3d->twmat); // to copy the parts outside of [3][3] Mat4MulMat34(matt, t->mat, rv3d->twmat); /* Screen aligned view rot circle */ if(drawflags & MAN_ROT_V) { - + /* prepare for screen aligned draw */ glPushMatrix(); size= screen_aligned(rv3d, rv3d->twmat); - + vec[0]= (float)(t->con.imval[0] - t->center2d[0]); vec[1]= (float)(t->con.imval[1] - t->center2d[1]); vec[2]= 0.0f; Normalize(vec); - + startphi= saacos( vec[1] ); if(vec[0]<0.0) startphi= -startphi; - + phi= (float)fmod(180.0*t->val/M_PI, 360.0); if(phi > 180.0) phi-= 360.0; else if(phi<-180.0) phi+= 360.0; - + gluPartialDisk(qobj, 0.0, size, 32, 1, 180.0*startphi/M_PI, phi); - + glPopMatrix(); } else if(arcs) { float imat[3][3], ivmat[3][3]; /* try to get the start rotation */ - + svec[0]= (float)(t->con.imval[0] - t->center2d[0]); svec[1]= (float)(t->con.imval[1] - t->center2d[1]); svec[2]= 0.0f; - + /* screen aligned vec transform back to manipulator space */ Mat3CpyMat4(ivmat, rv3d->viewinv); Mat3CpyMat4(tmat, rv3d->twmat); Mat3Inv(imat, tmat); Mat3MulMat3(tmat, imat, ivmat); - + Mat3MulVecfl(tmat, svec); // tmat is used further on Normalize(svec); - } - + } + wmMultMatrix(rv3d->twmat); // aligns with original widget - + /* Z disk */ if(drawflags & MAN_ROT_Z) { if(arcs) { @@ -776,11 +778,11 @@ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int d svec[0]+= tmat[2][0]; svec[1]+= tmat[2][1]; Normalize(svec); - + startphi= (float)atan2(svec[0], svec[1]); } else startphi= 0.5f*(float)M_PI; - + VECCOPY(vec, rv3d->twmat[0]); // use x axis to detect rotation Normalize(vec); Normalize(matt[0]); @@ -798,11 +800,11 @@ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int d svec[1]+= tmat[2][1]; svec[2]+= tmat[2][2]; Normalize(svec); - + startphi= (float)(M_PI + atan2(svec[2], -svec[1])); } else startphi= 0.0f; - + VECCOPY(vec, rv3d->twmat[1]); // use y axis to detect rotation Normalize(vec); Normalize(matt[1]); @@ -814,7 +816,7 @@ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int d gluPartialDisk(qobj, 0.0, 1.0, 32, 1, 180.0*startphi/M_PI, 180.0*phi/M_PI); glRotatef(-90.0, 0.0, 1.0, 0.0); } - } + } /* Y circle */ if(drawflags & MAN_ROT_Y) { if(arcs) { @@ -822,11 +824,11 @@ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int d svec[0]+= tmat[2][0]; svec[2]+= tmat[2][2]; Normalize(svec); - + startphi= (float)(M_PI + atan2(-svec[0], svec[2])); } else startphi= (float)M_PI; - + VECCOPY(vec, rv3d->twmat[2]); // use z axis to detect rotation Normalize(vec); Normalize(matt[2]); @@ -839,7 +841,7 @@ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int d glRotatef(90.0, 1.0, 0.0, 0.0); } } - + glDisable(GL_BLEND); wmLoadMatrix(rv3d->viewmat); } @@ -847,33 +849,33 @@ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int d static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo) { TransInfo *t= BIF_GetTransInfo(); // XXX - GLUquadricObj *qobj; + GLUquadricObj *qobj; double plane[4]; float size, vec[3], unitmat[4][4]; - float cywid= 0.33f*0.01f*(float)U.tw_handlesize; + float cywid= 0.33f*0.01f*(float)U.tw_handlesize; float cusize= cywid*0.65f; int arcs= (G.rt!=2); int colcode; - + if(moving) colcode= MAN_MOVECOL; else colcode= MAN_RGB; - + /* when called while moving in mixed mode, do not draw when... */ if((drawflags & MAN_ROT_C)==0) return; - + /* Init stuff */ glDisable(GL_DEPTH_TEST); Mat4One(unitmat); qobj= gluNewQuadric(); - gluQuadricDrawStyle(qobj, GLU_FILL); - + gluQuadricDrawStyle(qobj, GLU_FILL); + /* prepare for screen aligned draw */ VECCOPY(vec, rv3d->twmat[0]); size= Normalize(vec); glPushMatrix(); glTranslatef(rv3d->twmat[3][0], rv3d->twmat[3][1], rv3d->twmat[3][2]); - + if(arcs) { /* clipplane makes nice handles, calc here because of multmatrix but with translate! */ VECCOPY(plane, rv3d->viewinv[2]); @@ -882,7 +884,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, } /* sets view screen aligned */ glRotatef( -360.0f*saacos(rv3d->viewquat[0])/(float)M_PI, rv3d->viewquat[1], rv3d->viewquat[2], rv3d->viewquat[3]); - + /* Screen aligned help circle */ if(arcs) { if((G.f & G_PICKSEL)==0) { @@ -895,8 +897,8 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, if(G.f & G_PICKSEL) glLoadName(MAN_ROT_V); UI_ThemeColor(TH_TRANSFORM); drawcircball(GL_LINE_LOOP, unitmat[3], 1.2f*size, unitmat); - - if(moving) { + + if(moving) { float vec[3]; vec[0]= (float)(t->imval[0] - t->center2d[0]); vec[1]= (float)(t->imval[1] - t->center2d[1]); @@ -910,7 +912,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, } } glPopMatrix(); - + /* apply the transform delta */ if(moving) { float matt[4][4]; @@ -923,7 +925,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, glFrontFace( is_mat4_flipped(rv3d->twmat)?GL_CW:GL_CCW); wmMultMatrix(rv3d->twmat); } - + /* axes */ if(arcs==0) { if(!(G.f & G_PICKSEL)) { @@ -934,12 +936,12 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, manipulator_setcolor(v3d, 'x', colcode); glVertex3f(0.2f, 0.0f, 0.0f); glVertex3f(1.0f, 0.0f, 0.0f); - } + } if( (drawflags & MAN_ROT_Y) || (moving && (drawflags & MAN_ROT_X)) ) { manipulator_setcolor(v3d, 'y', colcode); glVertex3f(0.0f, 0.2f, 0.0f); glVertex3f(0.0f, 1.0f, 0.0f); - } + } if( (drawflags & MAN_ROT_Z) || (moving && (drawflags & MAN_ROT_Y)) ) { manipulator_setcolor(v3d, 'z', colcode); glVertex3f(0.0f, 0.0f, 0.2f); @@ -949,9 +951,9 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, } } } - + if(arcs==0 && moving) { - + /* Z circle */ if(drawflags & MAN_ROT_Z) { if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z); @@ -965,7 +967,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, manipulator_setcolor(v3d, 'x', colcode); drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat); glRotatef(-90.0, 0.0, 1.0, 0.0); - } + } /* Y circle */ if(drawflags & MAN_ROT_Y) { if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y); @@ -974,13 +976,13 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat); glRotatef(90.0, 1.0, 0.0, 0.0); } - + if(arcs) glDisable(GL_CLIP_PLANE0); } // donut arcs if(arcs) { glEnable(GL_CLIP_PLANE0); - + /* Z circle */ if(drawflags & MAN_ROT_Z) { if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z); @@ -994,7 +996,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, manipulator_setcolor(v3d, 'x', colcode); partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48); glRotatef(-90.0, 0.0, 1.0, 0.0); - } + } /* Y circle */ if(drawflags & MAN_ROT_Y) { if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y); @@ -1003,12 +1005,12 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48); glRotatef(90.0, 1.0, 0.0, 0.0); } - + glDisable(GL_CLIP_PLANE0); } - + if(arcs==0) { - + /* Z handle on X axis */ if(drawflags & MAN_ROT_Z) { glPushMatrix(); @@ -1018,41 +1020,41 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, partial_donut(0.7f*cusize, 1.0f, 31, 33, 8, 64); glPopMatrix(); - } + } /* Y handle on X axis */ if(drawflags & MAN_ROT_Y) { glPushMatrix(); if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y); manipulator_setcolor(v3d, 'y', colcode); - + glRotatef(90.0, 1.0, 0.0, 0.0); glRotatef(90.0, 0.0, 0.0, 1.0); partial_donut(0.7f*cusize, 1.0f, 31, 33, 8, 64); - + glPopMatrix(); } - + /* X handle on Z axis */ if(drawflags & MAN_ROT_X) { glPushMatrix(); if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X); manipulator_setcolor(v3d, 'x', colcode); - + glRotatef(-90.0, 0.0, 1.0, 0.0); glRotatef(90.0, 0.0, 0.0, 1.0); partial_donut(0.7f*cusize, 1.0f, 31, 33, 8, 64); glPopMatrix(); } - + } - + /* restore */ wmLoadMatrix(rv3d->viewmat); gluDeleteQuadric(qobj); if(v3d->zbuf) glEnable(GL_DEPTH_TEST); - + } static void drawsolidcube(float size) @@ -1067,52 +1069,52 @@ static void drawsolidcube(float size) { 1.0, 1.0, 1.0}, { 1.0, 1.0, -1.0}, }; float n[3]; - + glPushMatrix(); glScalef(size, size, size); - + n[0]=0; n[1]=0; n[2]=0; glBegin(GL_QUADS); n[0]= -1.0; - glNormal3fv(n); + glNormal3fv(n); glVertex3fv(cube[0]); glVertex3fv(cube[1]); glVertex3fv(cube[2]); glVertex3fv(cube[3]); n[0]=0; glEnd(); - + glBegin(GL_QUADS); n[1]= -1.0; - glNormal3fv(n); + glNormal3fv(n); glVertex3fv(cube[0]); glVertex3fv(cube[4]); glVertex3fv(cube[5]); glVertex3fv(cube[1]); n[1]=0; glEnd(); - + glBegin(GL_QUADS); n[0]= 1.0; - glNormal3fv(n); + glNormal3fv(n); glVertex3fv(cube[4]); glVertex3fv(cube[7]); glVertex3fv(cube[6]); glVertex3fv(cube[5]); n[0]=0; glEnd(); - + glBegin(GL_QUADS); n[1]= 1.0; - glNormal3fv(n); + glNormal3fv(n); glVertex3fv(cube[7]); glVertex3fv(cube[3]); glVertex3fv(cube[2]); glVertex3fv(cube[6]); n[1]=0; glEnd(); - + glBegin(GL_QUADS); n[2]= 1.0; - glNormal3fv(n); + glNormal3fv(n); glVertex3fv(cube[1]); glVertex3fv(cube[5]); glVertex3fv(cube[6]); glVertex3fv(cube[2]); n[2]=0; glEnd(); - + glBegin(GL_QUADS); n[2]= -1.0; - glNormal3fv(n); + glNormal3fv(n); glVertex3fv(cube[7]); glVertex3fv(cube[4]); glVertex3fv(cube[0]); glVertex3fv(cube[3]); glEnd(); - + glPopMatrix(); } @@ -1120,36 +1122,36 @@ static void drawsolidcube(float size) static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo, int colcode) { TransInfo *t= BIF_GetTransInfo(); // XXX - float cywid= 0.25f*0.01f*(float)U.tw_handlesize; + float cywid= 0.25f*0.01f*(float)U.tw_handlesize; float cusize= cywid*0.75f, dz; - + /* when called while moving in mixed mode, do not draw when... */ if((drawflags & MAN_SCALE_C)==0) return; - + glDisable(GL_DEPTH_TEST); - + /* not in combo mode */ if( (combo & (V3D_MANIP_TRANSLATE|V3D_MANIP_ROTATE))==0) { float size, unitmat[4][4]; int shift= 0; // XXX - + /* center circle, do not add to selection when shift is pressed (planar constraint) */ if( (G.f & G_PICKSEL) && shift==0) glLoadName(MAN_SCALE_C); - + manipulator_setcolor(v3d, 'c', colcode); glPushMatrix(); size= screen_aligned(rv3d, rv3d->twmat); Mat4One(unitmat); drawcircball(GL_LINE_LOOP, unitmat[3], 0.2f*size, unitmat); glPopMatrix(); - + dz= 1.0; } else dz= 1.0f-4.0f*cusize; - + if(moving) { float matt[4][4]; - + Mat4CpyMat4(matt, rv3d->twmat); // to copy the parts outside of [3][3] Mat4MulMat34(matt, t->mat, rv3d->twmat); wmMultMatrix(matt); @@ -1159,26 +1161,26 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving, wmMultMatrix(rv3d->twmat); glFrontFace( is_mat4_flipped(rv3d->twmat)?GL_CW:GL_CCW); } - + /* axis */ - + /* in combo mode, this is always drawn as first type */ draw_manipulator_axes(v3d, colcode, drawflags & MAN_SCALE_X, drawflags & MAN_SCALE_Y, drawflags & MAN_SCALE_Z); - + /* Z cube */ glTranslatef(0.0, 0.0, dz); if(drawflags & MAN_SCALE_Z) { if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_Z); manipulator_setcolor(v3d, 'z', colcode); drawsolidcube(cusize); - } + } /* X cube */ glTranslatef(dz, 0.0, -dz); if(drawflags & MAN_SCALE_X) { if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_X); manipulator_setcolor(v3d, 'x', colcode); drawsolidcube(cusize); - } + } /* Y cube */ glTranslatef(-dz, dz, 0.0); if(drawflags & MAN_SCALE_Y) { @@ -1186,11 +1188,11 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving, manipulator_setcolor(v3d, 'y', colcode); drawsolidcube(cusize); } - + /* if shiftkey, center point as last, for selectbuffer order */ if(G.f & G_PICKSEL) { int shift= 0; // XXX - + if(shift) { glTranslatef(0.0, -dz, 0.0); glLoadName(MAN_SCALE_C); @@ -1199,11 +1201,11 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving, glEnd(); } } - + /* restore */ wmLoadMatrix(rv3d->viewmat); - - if(v3d->zbuf) glEnable(GL_DEPTH_TEST); + + if(v3d->zbuf) glEnable(GL_DEPTH_TEST); glFrontFace(GL_CCW); } @@ -1213,23 +1215,23 @@ static void draw_cone(GLUquadricObj *qobj, float len, float width) glTranslatef(0.0, 0.0, -0.5f*len); gluCylinder(qobj, width, 0.0, len, 8, 1); gluQuadricOrientation(qobj, GLU_INSIDE); - gluDisk(qobj, 0.0, width, 8, 1); + gluDisk(qobj, 0.0, width, 8, 1); gluQuadricOrientation(qobj, GLU_OUTSIDE); glTranslatef(0.0, 0.0, 0.5f*len); } static void draw_cylinder(GLUquadricObj *qobj, float len, float width) { - + width*= 0.8f; // just for beauty - + glTranslatef(0.0, 0.0, -0.5f*len); gluCylinder(qobj, width, width, len, 8, 1); gluQuadricOrientation(qobj, GLU_INSIDE); - gluDisk(qobj, 0.0, width, 8, 1); + gluDisk(qobj, 0.0, width, 8, 1); gluQuadricOrientation(qobj, GLU_OUTSIDE); glTranslatef(0.0, 0.0, len); - gluDisk(qobj, 0.0, width, 8, 1); + gluDisk(qobj, 0.0, width, 8, 1); glTranslatef(0.0, 0.0, -0.5f*len); } @@ -1237,54 +1239,54 @@ static void draw_cylinder(GLUquadricObj *qobj, float len, float width) static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo, int colcode) { TransInfo *t= BIF_GetTransInfo(); // XXX - GLUquadricObj *qobj; + GLUquadricObj *qobj; float cylen= 0.01f*(float)U.tw_handlesize; float cywid= 0.25f*cylen, dz, size; float unitmat[4][4]; int shift= 0; // XXX - + /* when called while moving in mixed mode, do not draw when... */ if((drawflags & MAN_TRANS_C)==0) return; - + if(moving) glTranslatef(t->vec[0], t->vec[1], t->vec[2]); glDisable(GL_DEPTH_TEST); qobj= gluNewQuadric(); - gluQuadricDrawStyle(qobj, GLU_FILL); - + gluQuadricDrawStyle(qobj, GLU_FILL); + /* center circle, do not add to selection when shift is pressed (planar constraint) */ if( (G.f & G_PICKSEL) && shift==0) glLoadName(MAN_TRANS_C); - + manipulator_setcolor(v3d, 'c', colcode); glPushMatrix(); size= screen_aligned(rv3d, rv3d->twmat); Mat4One(unitmat); drawcircball(GL_LINE_LOOP, unitmat[3], 0.2f*size, unitmat); glPopMatrix(); - + /* and now apply matrix, we move to local matrix drawing */ wmMultMatrix(rv3d->twmat); - + /* axis */ glLoadName(-1); - + // translate drawn as last, only axis when no combo with scale, or for ghosting if((combo & V3D_MANIP_SCALE)==0 || colcode==MAN_GHOST) draw_manipulator_axes(v3d, colcode, drawflags & MAN_TRANS_X, drawflags & MAN_TRANS_Y, drawflags & MAN_TRANS_Z); - + /* offset in combo mode, for rotate a bit more */ if(combo & (V3D_MANIP_ROTATE)) dz= 1.0f+2.0f*cylen; else if(combo & (V3D_MANIP_SCALE)) dz= 1.0f+0.5f*cylen; else dz= 1.0f; - + /* Z Cone */ glTranslatef(0.0, 0.0, dz); if(drawflags & MAN_TRANS_Z) { if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_Z); manipulator_setcolor(v3d, 'z', colcode); draw_cone(qobj, cylen, cywid); - } + } /* X Cone */ glTranslatef(dz, 0.0, -dz); if(drawflags & MAN_TRANS_X) { @@ -1293,7 +1295,7 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int movi manipulator_setcolor(v3d, 'x', colcode); draw_cone(qobj, cylen, cywid); glRotatef(-90.0, 0.0, 1.0, 0.0); - } + } /* Y Cone */ glTranslatef(-dz, dz, 0.0); if(drawflags & MAN_TRANS_Y) { @@ -1305,9 +1307,9 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int movi gluDeleteQuadric(qobj); wmLoadMatrix(rv3d->viewmat); - + if(v3d->zbuf) glEnable(GL_DEPTH_TEST); - + } static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo, int colcode) @@ -1317,27 +1319,27 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov float size; float cylen= 0.01f*(float)U.tw_handlesize; float cywid= 0.25f*cylen; - + /* when called while moving in mixed mode, do not draw when... */ if((drawflags & MAN_ROT_C)==0) return; /* prepare for screen aligned draw */ glPushMatrix(); size= screen_aligned(rv3d, rv3d->twmat); - + glDisable(GL_DEPTH_TEST); - qobj= gluNewQuadric(); - + qobj= gluNewQuadric(); + /* Screen aligned view rot circle */ if(drawflags & MAN_ROT_V) { float unitmat[4][4]; Mat4One(unitmat); - + if(G.f & G_PICKSEL) glLoadName(MAN_ROT_V); UI_ThemeColor(TH_TRANSFORM); drawcircball(GL_LINE_LOOP, unitmat[3], 1.2f*size, unitmat); - + if(moving) { float vec[3]; vec[0]= (float)(t->imval[0] - t->center2d[0]); @@ -1352,7 +1354,7 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov } } glPopMatrix(); - + /* apply the transform delta */ if(moving) { float matt[4][4]; @@ -1365,27 +1367,27 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov else { wmMultMatrix(rv3d->twmat); } - + glFrontFace( is_mat4_flipped(rv3d->twmat)?GL_CW:GL_CCW); - + /* axis */ if( (G.f & G_PICKSEL)==0 ) { - + // only draw axis when combo didn't draw scale axes if((combo & V3D_MANIP_SCALE)==0) draw_manipulator_axes(v3d, colcode, drawflags & MAN_ROT_X, drawflags & MAN_ROT_Y, drawflags & MAN_ROT_Z); - + /* only has to be set when not in picking */ - gluQuadricDrawStyle(qobj, GLU_FILL); + gluQuadricDrawStyle(qobj, GLU_FILL); } - + /* Z cyl */ glTranslatef(0.0, 0.0, 1.0); if(drawflags & MAN_ROT_Z) { if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z); manipulator_setcolor(v3d, 'z', colcode); draw_cylinder(qobj, cylen, cywid); - } + } /* X cyl */ glTranslatef(1.0, 0.0, -1.0); if(drawflags & MAN_ROT_X) { @@ -1394,7 +1396,7 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov manipulator_setcolor(v3d, 'x', colcode); draw_cylinder(qobj, cylen, cywid); glRotatef(-90.0, 0.0, 1.0, 0.0); - } + } /* Y cylinder */ glTranslatef(-1.0, 1.0, 0.0); if(drawflags & MAN_ROT_Y) { @@ -1403,14 +1405,14 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov manipulator_setcolor(v3d, 'y', colcode); draw_cylinder(qobj, cylen, cywid); } - + /* restore */ - + gluDeleteQuadric(qobj); wmLoadMatrix(rv3d->viewmat); - + if(v3d->zbuf) glEnable(GL_DEPTH_TEST); - + } @@ -1420,7 +1422,7 @@ static float get_manipulator_drawsize(ARegion *ar) { RegionView3D *rv3d= ar->regiondata; float size = get_drawsize(ar, rv3d->twmat[3]); - + size*= (float)U.tw_size; return size; @@ -1439,13 +1441,13 @@ void BIF_draw_manipulator(const bContext *C) View3D *v3d= sa->spacedata.first; RegionView3D *rv3d= ar->regiondata; int totsel; - + if(!(v3d->twflag & V3D_USE_MANIPULATOR)) return; if(G.moving && (G.moving & G_TRANSFORM_MANIP)==0) return; - + if(G.moving==0) { v3d->twflag &= ~V3D_DRAW_MANIPULATOR; - + totsel= calc_manipulator_stats(C); if(totsel==0) return; drawflags= v3d->twdrawflag; /* set in calc_manipulator_stats */ @@ -1461,7 +1463,7 @@ void BIF_draw_manipulator(const bContext *C) rv3d->twmat[3][2]= (scene->twmin[2] + scene->twmax[2])/2.0f; if(v3d->around==V3D_ACTIVE && scene->obedit==NULL) { Object *ob= OBACT; - if(ob && !(ob->flag & OB_POSEMODE)) + if(ob && !(ob->flag & OB_POSEMODE)) VECCOPY(rv3d->twmat[3], ob->obmat[3]); } break; @@ -1473,26 +1475,26 @@ void BIF_draw_manipulator(const bContext *C) VECCOPY(rv3d->twmat[3], give_cursor(scene, v3d)); break; } - + Mat4MulFloat3((float *)rv3d->twmat, get_manipulator_drawsize(ar)); } - + if(v3d->twflag & V3D_DRAW_MANIPULATOR) { - + if(v3d->twtype & V3D_MANIP_ROTATE) { - + /* rotate has special ghosting draw, for pie chart */ if(G.moving) draw_manipulator_rotate_ghost(v3d, rv3d, drawflags); - + if(G.moving) glEnable(GL_BLEND); - + if(G.rt==3) { if(G.moving) draw_manipulator_rotate_cyl(v3d, rv3d, 1, drawflags, v3d->twtype, MAN_MOVECOL); else draw_manipulator_rotate_cyl(v3d, rv3d, 0, drawflags, v3d->twtype, MAN_RGB); } else draw_manipulator_rotate(v3d, rv3d, G.moving, drawflags, v3d->twtype); - + glDisable(GL_BLEND); } if(v3d->twtype & V3D_MANIP_SCALE) { @@ -1524,22 +1526,22 @@ static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, short *mval, float ho GLuint buffer[64]; // max 4 items per select, so large enuf short hits; extern void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect); // XXX check a bit later on this... (ton) - + G.f |= G_PICKSEL; - + rect.xmin= mval[0]-hotspot; rect.xmax= mval[0]+hotspot; rect.ymin= mval[1]-hotspot; rect.ymax= mval[1]+hotspot; - + setwinmatrixview3d(ar, v3d, &rect); Mat4MulMat4(rv3d->persmat, rv3d->viewmat, rv3d->winmat); - + glSelectBuffer( 64, buffer); glRenderMode(GL_SELECT); glInitNames(); /* these two calls whatfor? It doesnt work otherwise */ glPushName(-2); - + /* do the drawing */ if(v3d->twtype & V3D_MANIP_ROTATE) { if(G.rt==3) draw_manipulator_rotate_cyl(v3d, rv3d, 0, MAN_ROT_C & v3d->twdrawflag, v3d->twtype, MAN_RGB); @@ -1549,26 +1551,26 @@ static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, short *mval, float ho draw_manipulator_scale(v3d, rv3d, 0, MAN_SCALE_C & v3d->twdrawflag, v3d->twtype, MAN_RGB); if(v3d->twtype & V3D_MANIP_TRANSLATE) draw_manipulator_translate(v3d, rv3d, 0, MAN_TRANS_C & v3d->twdrawflag, v3d->twtype, MAN_RGB); - + glPopName(); hits= glRenderMode(GL_RENDER); - + G.f &= ~G_PICKSEL; setwinmatrixview3d(ar, v3d, NULL); Mat4MulMat4(rv3d->persmat, rv3d->viewmat, rv3d->winmat); - + if(hits==1) return buffer[3]; else if(hits>1) { GLuint val, dep, mindep=0, mindeprot=0, minval=0, minvalrot=0; int a; - + /* we compare the hits in buffer, but value centers highest */ /* we also store the rotation hits separate (because of arcs) and return hits on other widgets if there are */ for(a=0; aspacedata.first; ARegion *ar= CTX_wm_region(C); RegionView3D *rv3d= ar->regiondata; + int constraint_axis[3] = {0, 0, 0}; int val; - int shift= 0; // XXX - + int shift = event->shift; + if(!(v3d->twflag & V3D_USE_MANIPULATOR)) return 0; if(!(v3d->twflag & V3D_DRAW_MANIPULATOR)) return 0; - + // find the hotspots first test narrow hotspot - val= manipulator_selectbuf(sa, ar, mval, 0.5f*(float)U.tw_hotspot); + val= manipulator_selectbuf(sa, ar, event->mval, 0.5f*(float)U.tw_hotspot); if(val) { - - // XXX checkFirstTime(); // TEMPORARY, check this before doing any transform call. - + // drawflags still global, for drawing call above - drawflags= manipulator_selectbuf(sa, ar, mval, 0.2f*(float)U.tw_hotspot); + drawflags= manipulator_selectbuf(sa, ar, event->mval, 0.2f*(float)U.tw_hotspot); if(drawflags==0) drawflags= val; if (drawflags & MAN_TRANS_C) { - initManipulator(TFM_TRANSLATION); switch(drawflags) { case MAN_TRANS_C: break; case MAN_TRANS_X: if(shift) { - drawflags= MAN_TRANS_Y|MAN_TRANS_Z; - BIF_setDualAxisConstraint(rv3d->twmat[1], rv3d->twmat[2], " Y+Z"); + constraint_axis[1] = 1; + constraint_axis[2] = 1; } else - BIF_setSingleAxisConstraint(rv3d->twmat[0], " X"); + constraint_axis[0] = 1; break; case MAN_TRANS_Y: if(shift) { - drawflags= MAN_TRANS_X|MAN_TRANS_Z; - BIF_setDualAxisConstraint(rv3d->twmat[0], rv3d->twmat[2], " X+Z"); + constraint_axis[0] = 1; + constraint_axis[2] = 1; } else - BIF_setSingleAxisConstraint(rv3d->twmat[1], " Y"); + constraint_axis[1] = 1; break; case MAN_TRANS_Z: if(shift) { - drawflags= MAN_TRANS_X|MAN_TRANS_Y; - BIF_setDualAxisConstraint(rv3d->twmat[0], rv3d->twmat[1], " X+Y"); + constraint_axis[0] = 1; + constraint_axis[1] = 1; } else - BIF_setSingleAxisConstraint(rv3d->twmat[2], " Z"); + constraint_axis[2] = 1; break; } - ManipulatorTransform(); + RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis); + WM_operator_name_call(C, "TFM_OT_translation", WM_OP_INVOKE_REGION_WIN, op->ptr); } else if (drawflags & MAN_SCALE_C) { - initManipulator(TFM_RESIZE); switch(drawflags) { case MAN_SCALE_X: if(shift) { - drawflags= MAN_SCALE_Y|MAN_SCALE_Z; - BIF_setDualAxisConstraint(rv3d->twmat[1], rv3d->twmat[2], " Y+Z"); + constraint_axis[1] = 1; + constraint_axis[2] = 1; } else - BIF_setSingleAxisConstraint(rv3d->twmat[0], " X"); + constraint_axis[0] = 1; break; case MAN_SCALE_Y: if(shift) { - drawflags= MAN_SCALE_X|MAN_SCALE_Z; - BIF_setDualAxisConstraint(rv3d->twmat[0], rv3d->twmat[2], " X+Z"); + constraint_axis[0] = 1; + constraint_axis[2] = 1; } else - BIF_setSingleAxisConstraint(rv3d->twmat[1], " Y"); + constraint_axis[1] = 1; break; case MAN_SCALE_Z: if(shift) { - drawflags= MAN_SCALE_X|MAN_SCALE_Y; - BIF_setDualAxisConstraint(rv3d->twmat[0], rv3d->twmat[1], " X+Y"); + constraint_axis[0] = 1; + constraint_axis[1] = 1; } else - BIF_setSingleAxisConstraint(rv3d->twmat[2], " Z"); + constraint_axis[2] = 1; break; } - ManipulatorTransform(); + RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis); + WM_operator_name_call(C, "TFM_OT_resize", WM_OP_INVOKE_REGION_WIN, op->ptr); } - else if (drawflags == MAN_ROT_T) { /* trackbal need special case, init is different */ - initManipulator(TFM_TRACKBALL); - ManipulatorTransform(); + else if (drawflags == MAN_ROT_T) { /* trackball need special case, init is different */ + WM_operator_name_call(C, "TFM_OT_trackball", WM_OP_INVOKE_REGION_WIN, op->ptr); } else if (drawflags & MAN_ROT_C) { - initManipulator(TFM_ROTATION); switch(drawflags) { case MAN_ROT_X: - BIF_setSingleAxisConstraint(rv3d->twmat[0], " X"); + constraint_axis[0] = 1; break; case MAN_ROT_Y: - BIF_setSingleAxisConstraint(rv3d->twmat[1], " Y"); + constraint_axis[1] = 1; break; case MAN_ROT_Z: - BIF_setSingleAxisConstraint(rv3d->twmat[2], " Z"); + constraint_axis[2] = 1; break; } - ManipulatorTransform(); + RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis); + WM_operator_name_call(C, "TFM_OT_rotation", WM_OP_INVOKE_REGION_WIN, op->ptr); } } /* after transform, restore drawflags */ drawflags= 0xFFFF; - + return val; } diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 9e4115f38f0..97fb3531718 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -89,6 +89,7 @@ char OP_SHEAR[] = "TFM_OT_shear"; char OP_WARP[] = "TFM_OT_warp"; char OP_SHRINK_FATTEN[] = "TFM_OT_shrink_fatten"; char OP_TILT[] = "TFM_OT_tilt"; +char OP_TRACKBALL[] = "TFM_OT_trackball"; TransformModeItem transform_modes[] = @@ -101,6 +102,7 @@ TransformModeItem transform_modes[] = {OP_WARP, TFM_WARP}, {OP_SHRINK_FATTEN, TFM_SHRINKFATTEN}, {OP_TILT, TFM_TILT}, + {OP_TRACKBALL, TFM_TRACKBALL}, {NULL, 0} }; @@ -111,7 +113,7 @@ static int select_orientation_exec(bContext *C, wmOperator *op) if(orientation == V3D_MANIP_CUSTOM) orientation += custom_index; - + BIF_selectTransformOrientationValue(C, orientation); return OPERATOR_FINISHED; @@ -121,15 +123,15 @@ static int select_orientation_invoke(bContext *C, wmOperator *op, wmEvent *event { uiPopupMenu *pup; uiLayout *layout; - + pup= uiPupMenuBegin(C, "Orientation", 0); layout= uiPupMenuLayout(pup); BIF_menuTransformOrientation(C, layout, NULL); uiPupMenuEnd(C, pup); - + return OPERATOR_CANCELLED; } - + void TFM_OT_select_orientation(struct wmOperatorType *ot) { static EnumPropertyItem orientation_items[]= { @@ -183,27 +185,27 @@ static int transformops_data(bContext *C, wmOperator *op, wmEvent *event) } retval = initTransform(C, t, op, event, mode); - + /* store data */ op->customdata = t; } - + return retval; /* return 0 on error */ } static int transform_modal(bContext *C, wmOperator *op, wmEvent *event) { int exit_code; - + TransInfo *t = op->customdata; - + transformEvent(t, event); - + transformApply(C, t); - - + + exit_code = transformEnd(C, t); - + if (exit_code != OPERATOR_RUNNING_MODAL) { transformops_exit(C, op); @@ -215,11 +217,11 @@ static int transform_modal(bContext *C, wmOperator *op, wmEvent *event) static int transform_cancel(bContext *C, wmOperator *op) { TransInfo *t = op->customdata; - + t->state = TRANS_CANCEL; transformEnd(C, t); transformops_exit(C, op); - + return OPERATOR_CANCELLED; } @@ -237,11 +239,11 @@ static int transform_exec(bContext *C, wmOperator *op) t->options |= CTX_AUTOCONFIRM; transformApply(C, t); - + transformEnd(C, t); transformops_exit(C, op); - + return OPERATOR_FINISHED; } @@ -279,7 +281,7 @@ void Properties_Snapping(struct wmOperatorType *ot, short align) RNA_def_boolean(ot->srna, "snap", 0, "Snap to Point", ""); RNA_def_enum(ot->srna, "snap_mode", snap_mode_types, 0, "Mode", ""); RNA_def_float_vector(ot->srna, "snap_point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", "", -FLT_MAX, FLT_MAX); - + if (align) { RNA_def_boolean(ot->srna, "snap_align", 0, "Align with Point Normal", ""); @@ -314,7 +316,7 @@ void TFM_OT_translation(struct wmOperatorType *ot) RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", ""); Properties_Constraints(ot); - + Properties_Snapping(ot, 1); } @@ -339,10 +341,32 @@ void TFM_OT_resize(struct wmOperatorType *ot) RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", ""); Properties_Constraints(ot); - + Properties_Snapping(ot, 0); } + +void TFM_OT_trackball(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Trackball"; + ot->idname = OP_TRACKBALL; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + + /* api callbacks */ + ot->invoke = transform_invoke; + ot->exec = transform_exec; + ot->modal = transform_modal; + ot->cancel = transform_cancel; + ot->poll = ED_operator_areaactive; + + RNA_def_float_vector(ot->srna, "value", 2, VecOne, -FLT_MAX, FLT_MAX, "angle", "", -FLT_MAX, FLT_MAX); + + Properties_Proportional(ot); + + RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", ""); +} + void TFM_OT_rotation(struct wmOperatorType *ot) { /* identifiers */ @@ -364,7 +388,7 @@ void TFM_OT_rotation(struct wmOperatorType *ot) RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", ""); Properties_Constraints(ot); - + Properties_Snapping(ot, 0); } @@ -547,10 +571,11 @@ void transform_operatortypes(void) WM_operatortype_append(TFM_OT_warp); WM_operatortype_append(TFM_OT_shrink_fatten); WM_operatortype_append(TFM_OT_tilt); + WM_operatortype_append(TFM_OT_trackball); WM_operatortype_append(TFM_OT_select_orientation); } - + void transform_keymap_for_space(struct wmWindowManager *wm, struct ListBase *keymap, int spaceid) { wmKeymapItem *km; @@ -558,9 +583,9 @@ void transform_keymap_for_space(struct wmWindowManager *wm, struct ListBase *key { case SPACE_VIEW3D: km = WM_keymap_add_item(keymap, "TFM_OT_translation", GKEY, KM_PRESS, 0, 0); - + km= WM_keymap_add_item(keymap, "TFM_OT_translation", EVT_TWEAK_S, KM_ANY, 0, 0); - + km = WM_keymap_add_item(keymap, "TFM_OT_rotation", RKEY, KM_PRESS, 0, 0); km = WM_keymap_add_item(keymap, "TFM_OT_resize", SKEY, KM_PRESS, 0, 0); @@ -568,9 +593,9 @@ void transform_keymap_for_space(struct wmWindowManager *wm, struct ListBase *key km = WM_keymap_add_item(keymap, "TFM_OT_warp", WKEY, KM_PRESS, KM_SHIFT, 0); km = WM_keymap_add_item(keymap, "TFM_OT_tosphere", SKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); - + km = WM_keymap_add_item(keymap, "TFM_OT_shear", SKEY, KM_PRESS, KM_ALT|KM_CTRL|KM_SHIFT, 0); - + km = WM_keymap_add_item(keymap, "TFM_OT_shrink_fatten", SKEY, KM_PRESS, KM_ALT, 0); km = WM_keymap_add_item(keymap, "TFM_OT_tilt", TKEY, KM_PRESS, 0, 0); @@ -581,55 +606,55 @@ void transform_keymap_for_space(struct wmWindowManager *wm, struct ListBase *key case SPACE_ACTION: km= WM_keymap_add_item(keymap, "TFM_OT_transform", GKEY, KM_PRESS, 0, 0); RNA_int_set(km->ptr, "mode", TFM_TIME_TRANSLATE); - + km= WM_keymap_add_item(keymap, "TFM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0); RNA_int_set(km->ptr, "mode", TFM_TIME_TRANSLATE); - + km= WM_keymap_add_item(keymap, "TFM_OT_transform", EKEY, KM_PRESS, 0, 0); RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND); - + km= WM_keymap_add_item(keymap, "TFM_OT_transform", SKEY, KM_PRESS, 0, 0); RNA_int_set(km->ptr, "mode", TFM_TIME_SCALE); - + km= WM_keymap_add_item(keymap, "TFM_OT_transform", TKEY, KM_PRESS, 0, 0); RNA_int_set(km->ptr, "mode", TFM_TIME_SLIDE); break; case SPACE_IPO: km= WM_keymap_add_item(keymap, "TFM_OT_translation", GKEY, KM_PRESS, 0, 0); - + km= WM_keymap_add_item(keymap, "TFM_OT_translation", EVT_TWEAK_S, KM_ANY, 0, 0); - + // XXX the 'mode' identifier here is not quite right km= WM_keymap_add_item(keymap, "TFM_OT_transform", EKEY, KM_PRESS, 0, 0); RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND); - + km = WM_keymap_add_item(keymap, "TFM_OT_rotation", RKEY, KM_PRESS, 0, 0); - + km = WM_keymap_add_item(keymap, "TFM_OT_resize", SKEY, KM_PRESS, 0, 0); break; case SPACE_NODE: km= WM_keymap_add_item(keymap, "TFM_OT_translation", GKEY, KM_PRESS, 0, 0); - + km= WM_keymap_add_item(keymap, "TFM_OT_translation", EVT_TWEAK_A, KM_ANY, 0, 0); km= WM_keymap_add_item(keymap, "TFM_OT_translation", EVT_TWEAK_S, KM_ANY, 0, 0); - + km = WM_keymap_add_item(keymap, "TFM_OT_rotation", RKEY, KM_PRESS, 0, 0); - + km = WM_keymap_add_item(keymap, "TFM_OT_resize", SKEY, KM_PRESS, 0, 0); break; case SPACE_SEQ: km= WM_keymap_add_item(keymap, "TFM_OT_translation", GKEY, KM_PRESS, 0, 0); - + km= WM_keymap_add_item(keymap, "TFM_OT_translation", EVT_TWEAK_S, KM_ANY, 0, 0); - + km= WM_keymap_add_item(keymap, "TFM_OT_transform", EKEY, KM_PRESS, 0, 0); RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND); break; case SPACE_IMAGE: km = WM_keymap_add_item(keymap, "TFM_OT_translation", GKEY, KM_PRESS, 0, 0); - + km= WM_keymap_add_item(keymap, "TFM_OT_translation", EVT_TWEAK_S, KM_ANY, 0, 0); - + km = WM_keymap_add_item(keymap, "TFM_OT_rotation", RKEY, KM_PRESS, 0, 0); km = WM_keymap_add_item(keymap, "TFM_OT_resize", SKEY, KM_PRESS, 0, 0); -- cgit v1.2.3 From f9749ea2e778165cf6e92cc263f5be3a802247fa Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 9 Jul 2009 07:28:45 +0000 Subject: NLA SoC: Influence of strip now gets drawn as a greyish curve on the strip I'm not quite happy with how this works yet. It looks quite crude, and might be contributing to the clutter here. Ideas on this welcome. --- source/blender/editors/space_nla/nla_draw.c | 69 ++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index bbb666d01cc..7b2b19c19f6 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -58,6 +58,7 @@ #include "BLI_rand.h" #include "BKE_animsys.h" +#include "BKE_fcurve.h" #include "BKE_nla.h" #include "BKE_context.h" #include "BKE_screen.h" @@ -224,6 +225,70 @@ static void nla_strip_get_color_inside (AnimData *adt, NlaStrip *strip, float co } } +/* helper call for drawing influence/time control curves for a given NLA-strip */ +static void nla_draw_strip_curves (NlaStrip *strip, View2D *v2d, float yminc, float ymaxc) +{ + const float yheight = ymaxc - yminc; + + /* drawing color is simply a light-grey */ + // TODO: is this color suitable? + // XXX nasty hacked color for now... which looks quite bad too... + glColor3f(0.7f, 0.7f, 0.7f); + + /* draw with AA'd line, 2 units thick (it's either 1 or 2 px) */ + glEnable(GL_LINE_SMOOTH); + glEnable(GL_BLEND); + glLineWidth(2.0f); + + /* influence -------------------------- */ + if (strip->flag & NLASTRIP_FLAG_USR_INFLUENCE) { + FCurve *fcu= list_find_fcurve(&strip->fcurves, "influence", 0); + float cfra; + + /* plot the curve (over the strip's main region) */ + glBegin(GL_LINE_STRIP); + /* sample at 1 frame intervals, and draw + * - min y-val is yminc, max is y-maxc, so clamp in those regions + */ + for (cfra= strip->start; cfra <= strip->end; cfra += 1.0f) { + float y= evaluate_fcurve(fcu, cfra); // assume this to be in 0-1 range + glVertex2f(cfra, ((y*yheight)+yminc)); + } + glEnd(); // GL_LINE_STRIP + } + else { + /* use blend in/out values only if both aren't zero */ + if ((IS_EQ(strip->blendin, 0.0f) && IS_EQ(strip->blendout, 0.0f))==0) { + glBegin(GL_LINE_STRIP); + /* start of strip - if no blendin, start straight at 1, otherwise from 0 to 1 over blendin frames */ + if (IS_EQ(strip->blendin, 0.0f) == 0) { + glVertex2f(strip->start, yminc); + glVertex2f(strip->start + strip->blendin, ymaxc); + } + else + glVertex2f(strip->start, ymaxc); + + /* end of strip */ + if (IS_EQ(strip->blendout, 0.0f) == 0) { + glVertex2f(strip->end - strip->blendout, ymaxc); + glVertex2f(strip->end, yminc); + } + else + glVertex2f(strip->end, ymaxc); + glEnd(); // GL_LINE_STRIP + } + } + + /* time -------------------------- */ + // XXX do we want to draw this curve? in a different colour too? + + /* turn off AA'd lines */ + glDisable(GL_LINE_SMOOTH); + glDisable(GL_BLEND); + glLineWidth(1.0f); +} + +/* main call for drawing a single NLA-strip */ static void nla_draw_strip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2D *v2d, float yminc, float ymaxc) { float color[3]; @@ -291,8 +356,8 @@ static void nla_draw_strip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2 gl_round_box_shade(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1); - /* draw influence 'curve' */ - // TODO: + /* draw strip's control 'curves' */ + nla_draw_strip_curves(strip, v2d, yminc, ymaxc); /* draw strip outline * - color used here is to indicate active vs non-active -- cgit v1.2.3 From 1fd38701e99e2b3087c949bd00de71085cde02aa Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 9 Jul 2009 07:35:35 +0000 Subject: removed check for pyc when scanning the directory of python files. Brecht, double checked and pyc or pyo files arent used because of the (file_extension[3] == '\0') test. --- source/blender/python/intern/bpy_interface.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 64f2d896954..76c27dbbc22 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -453,7 +453,7 @@ void BPY_run_ui_scripts(bContext *C, int reload) char *dirname; char path[FILE_MAX]; char *dirs[] = {"io", "ui", NULL}; - int a, filelen; /* filename length */ + int a; PyGILState_STATE gilstate; PyObject *mod; @@ -490,15 +490,10 @@ void BPY_run_ui_scripts(bContext *C, int reload) /* We could stat the file but easier just to let python * import it and complain if theres a problem */ - if(strstr(de->d_name, ".pyc")) - continue; - file_extension = strstr(de->d_name, ".py"); - if(file_extension && *(file_extension + 3) == '\0') { - filelen = strlen(de->d_name); - BLI_strncpy(path, de->d_name, filelen-2); /* cut off the .py on copy */ - + if(file_extension && file_extension[3] == '\0') { + BLI_strncpy(path, de->d_name, (file_extension - de->d_name) + 1); /* cut off the .py on copy */ mod= PyImport_ImportModuleLevel(path, NULL, NULL, NULL, 0); if (mod) { if (reload) { @@ -511,7 +506,7 @@ void BPY_run_ui_scripts(bContext *C, int reload) if(mod) { Py_DECREF(mod); /* could be NULL from reloading */ } else { - BPy_errors_to_report(NULL); // TODO - reports + BPy_errors_to_report(NULL); fprintf(stderr, "unable to import \"%s\" %s/%s\n", path, dirname, de->d_name); } -- cgit v1.2.3 From 0d93ad3606587b5bef3114300d22ff77fac40999 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 9 Jul 2009 08:06:26 +0000 Subject: Dictionary style get() to property rna. eg.. mesh = bpy.data.meshes.get("SomeMesh", fallback) Set length limits for python string formatting. --- source/blender/python/intern/bpy_rna.c | 86 +++++++++++++++++++++------------- 1 file changed, 53 insertions(+), 33 deletions(-) (limited to 'source') diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 5c8499b5280..bf2f41389cc 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -172,12 +172,12 @@ static PyObject *pyrna_struct_repr( BPy_StructRNA * self ) /* print name if available */ name= RNA_struct_name_get_alloc(&self->ptr, NULL, 0); if(name) { - pyob= PyUnicode_FromFormat( "[BPy_StructRNA \"%s\" -> \"%s\"]", RNA_struct_identifier(self->ptr.type), name); + pyob= PyUnicode_FromFormat( "[BPy_StructRNA \"%.200s\" -> \"%.200s\"]", RNA_struct_identifier(self->ptr.type), name); MEM_freeN(name); return pyob; } - return PyUnicode_FromFormat( "[BPy_StructRNA \"%s\"]", RNA_struct_identifier(self->ptr.type)); + return PyUnicode_FromFormat( "[BPy_StructRNA \"%.200s\"]", RNA_struct_identifier(self->ptr.type)); } static PyObject *pyrna_prop_repr( BPy_PropertyRNA * self ) @@ -192,13 +192,13 @@ static PyObject *pyrna_prop_repr( BPy_PropertyRNA * self ) name= RNA_struct_name_get_alloc(&ptr, NULL, 0); if(name) { - pyob= PyUnicode_FromFormat( "[BPy_PropertyRNA \"%s\" -> \"%s\" -> \"%s\" ]", RNA_struct_identifier(self->ptr.type), RNA_property_identifier(self->prop), name); + pyob= PyUnicode_FromFormat( "[BPy_PropertyRNA \"%.200s\" -> \"%.200s\" -> \"%.200s\" ]", RNA_struct_identifier(self->ptr.type), RNA_property_identifier(self->prop), name); MEM_freeN(name); return pyob; } } - return PyUnicode_FromFormat( "[BPy_PropertyRNA \"%s\" -> \"%s\"]", RNA_struct_identifier(self->ptr.type), RNA_property_identifier(self->prop)); + return PyUnicode_FromFormat( "[BPy_PropertyRNA \"%.200s\" -> \"%.200s\"]", RNA_struct_identifier(self->ptr.type), RNA_property_identifier(self->prop)); } static long pyrna_struct_hash( BPy_StructRNA * self ) @@ -375,7 +375,7 @@ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, const char *error_prefi if (strcmp(arg_name, "rna_type")==0) continue; if (kw==NULL) { - PyErr_Format( PyExc_AttributeError, "%s: no keywords, expected \"%s\"", error_prefix, arg_name ? arg_name : ""); + PyErr_Format( PyExc_AttributeError, "%.200s: no keywords, expected \"%.200s\"", error_prefix, arg_name ? arg_name : ""); error_val= -1; break; } @@ -383,7 +383,7 @@ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, const char *error_prefi item= PyDict_GetItemString(kw, arg_name); if (item == NULL) { - PyErr_Format( PyExc_AttributeError, "%s: keyword \"%s\" missing", error_prefix, arg_name ? arg_name : ""); + PyErr_Format( PyExc_AttributeError, "%.200s: keyword \"%.200s\" missing", error_prefix, arg_name ? arg_name : ""); error_val = -1; /* pyrna_py_to_prop sets the error */ break; } @@ -407,7 +407,7 @@ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, const char *error_prefi arg_name= NULL; } - PyErr_Format( PyExc_AttributeError, "%s: keyword \"%s\" unrecognized", error_prefix, arg_name ? arg_name : ""); + PyErr_Format( PyExc_AttributeError, "%.200s: keyword \"%.200s\" unrecognized", error_prefix, arg_name ? arg_name : ""); error_val = -1; } @@ -459,7 +459,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v py_len= (int)PySequence_Length(value); } else { - PyErr_Format(PyExc_TypeError, "RNA array assignment expected a sequence instead of %s instance.", Py_TYPE(value)->tp_name); + PyErr_Format(PyExc_TypeError, "RNA array assignment expected a sequence instead of %.200s instance.", Py_TYPE(value)->tp_name); return -1; } /* done getting the length */ @@ -620,7 +620,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v if (param==NULL) { char *enum_str= pyrna_enum_as_string(ptr, prop); - PyErr_Format(PyExc_TypeError, "expected a string enum type in (%s)", enum_str); + PyErr_Format(PyExc_TypeError, "expected a string enum type in (%.200s)", enum_str); MEM_freeN(enum_str); return -1; } else { @@ -630,7 +630,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v else RNA_property_enum_set(ptr, prop, val); } else { char *enum_str= pyrna_enum_as_string(ptr, prop); - PyErr_Format(PyExc_AttributeError, "enum \"%s\" not found in (%s)", param, enum_str); + PyErr_Format(PyExc_AttributeError, "enum \"%.200s\" not found in (%.200s)", param, enum_str); MEM_freeN(enum_str); return -1; } @@ -645,7 +645,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v if(!BPy_StructRNA_Check(value) && value != Py_None) { PointerRNA tmp; RNA_pointer_create(NULL, ptype, NULL, &tmp); - PyErr_Format(PyExc_TypeError, "expected a %s type", RNA_struct_identifier(tmp.type)); + PyErr_Format(PyExc_TypeError, "expected a %.200s type", RNA_struct_identifier(tmp.type)); return -1; } else { BPy_StructRNA *param= (BPy_StructRNA*)value; @@ -682,7 +682,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v else { PointerRNA tmp; RNA_pointer_create(NULL, ptype, NULL, &tmp); - PyErr_Format(PyExc_TypeError, "expected a %s type", RNA_struct_identifier(tmp.type)); + PyErr_Format(PyExc_TypeError, "expected a %.200s type", RNA_struct_identifier(tmp.type)); return -1; } } @@ -690,7 +690,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v if(raise_error) { PointerRNA tmp; RNA_pointer_create(NULL, ptype, NULL, &tmp); - PyErr_Format(PyExc_TypeError, "expected a %s type", RNA_struct_identifier(tmp.type)); + PyErr_Format(PyExc_TypeError, "expected a %.200s type", RNA_struct_identifier(tmp.type)); return -1; } } @@ -852,7 +852,7 @@ static PyObject *prop_subscript_collection_int(BPy_PropertyRNA * self, int keynu if(RNA_property_collection_lookup_int(&self->ptr, self->prop, keynum, &newptr)) return pyrna_struct_CreatePyObject(&newptr); - PyErr_SetString(PyExc_IndexError, "out of range"); + PyErr_Format(PyExc_IndexError, "index %d out of range", keynum); return NULL; } static PyObject *prop_subscript_array_int(BPy_PropertyRNA * self, int keynum) @@ -864,7 +864,7 @@ static PyObject *prop_subscript_array_int(BPy_PropertyRNA * self, int keynum) if(keynum >= 0 && keynum < len) return pyrna_prop_to_py_index(&self->ptr, self->prop, keynum); - PyErr_SetString(PyExc_IndexError, "out of range"); + PyErr_Format(PyExc_IndexError, "index %d out of range", keynum); return NULL; } @@ -874,7 +874,7 @@ static PyObject *prop_subscript_collection_str(BPy_PropertyRNA * self, char *key if(RNA_property_collection_lookup_string(&self->ptr, self->prop, keyname, &newptr)) return pyrna_struct_CreatePyObject(&newptr); - PyErr_SetString(PyExc_KeyError, "key not found"); + PyErr_Format(PyExc_KeyError, "key \"%.200s\" not found", keyname); return NULL; } /* static PyObject *prop_subscript_array_str(BPy_PropertyRNA * self, char *keyname) */ @@ -952,7 +952,7 @@ static PyObject *prop_subscript_collection(BPy_PropertyRNA * self, PyObject *key } #endif else { - PyErr_SetString(PyExc_AttributeError, "invalid key, key must be a string or an int"); + PyErr_Format(PyExc_TypeError, "invalid rna key, key must be a string or an int instead of %.200s instance.", Py_TYPE(key)->tp_name); return NULL; } } @@ -1045,20 +1045,20 @@ static int pyrna_prop_ass_subscript( BPy_PropertyRNA * self, PyObject *key, PyOb /* char *keyname = NULL; */ /* not supported yet */ if (!RNA_property_editable(&self->ptr, self->prop)) { - PyErr_Format( PyExc_AttributeError, "PropertyRNA - attribute \"%s\" from \"%s\" is read-only", RNA_property_identifier(self->prop), RNA_struct_identifier(self->ptr.type) ); + PyErr_Format( PyExc_AttributeError, "PropertyRNA - attribute \"%.200s\" from \"%.200s\" is read-only", RNA_property_identifier(self->prop), RNA_struct_identifier(self->ptr.type) ); return -1; } /* maybe one day we can support this... */ if (RNA_property_type(self->prop) == PROP_COLLECTION) { - PyErr_Format( PyExc_AttributeError, "PropertyRNA - attribute \"%s\" from \"%s\" is a collection, assignment not supported", RNA_property_identifier(self->prop), RNA_struct_identifier(self->ptr.type) ); + PyErr_Format( PyExc_AttributeError, "PropertyRNA - attribute \"%.200s\" from \"%.200s\" is a collection, assignment not supported", RNA_property_identifier(self->prop), RNA_struct_identifier(self->ptr.type) ); return -1; } if (PyIndex_Check(key)) { Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) - return NULL; + return -1; return prop_subscript_ass_array_int(self, i, value); } @@ -1288,7 +1288,7 @@ static PyObject *pyrna_struct_getattro( BPy_StructRNA * self, PyObject *pyname ) BLI_freelistN(&newlb); } else { - PyErr_Format( PyExc_AttributeError, "StructRNA - Attribute \"%s\" not found", name); + PyErr_Format( PyExc_AttributeError, "StructRNA - Attribute \"%.200s\" not found", name); ret = NULL; } @@ -1306,13 +1306,13 @@ static int pyrna_struct_setattro( BPy_StructRNA * self, PyObject *pyname, PyObje return 0; } else { - PyErr_Format( PyExc_AttributeError, "StructRNA - Attribute \"%s\" not found", name); + PyErr_Format( PyExc_AttributeError, "StructRNA - Attribute \"%.200s\" not found", name); return -1; } } if (!RNA_property_editable(&self->ptr, prop)) { - PyErr_Format( PyExc_AttributeError, "StructRNA - Attribute \"%s\" from \"%s\" is read-only", RNA_property_identifier(prop), RNA_struct_identifier(self->ptr.type) ); + PyErr_Format( PyExc_AttributeError, "StructRNA - Attribute \"%.200s\" from \"%.200s\" is read-only", RNA_property_identifier(prop), RNA_struct_identifier(self->ptr.type) ); return -1; } @@ -1415,6 +1415,24 @@ static PyObject *pyrna_prop_values(BPy_PropertyRNA *self) return ret; } +static PyObject *pyrna_prop_get(BPy_PropertyRNA *self, PyObject *args) +{ + PointerRNA newptr; + + char *key; + PyObject* def = Py_None; + + if (!PyArg_ParseTuple(args, "s|O:get", &key, &def)) + return NULL; + + if(RNA_property_collection_lookup_string(&self->ptr, self->prop, key, &newptr)) + return pyrna_struct_CreatePyObject(&newptr); + + Py_INCREF(def); + return def; +} + + #if (PY_VERSION_HEX >= 0x03000000) /* foreach needs py3 */ static void foreach_attr_type( BPy_PropertyRNA *self, char *attr, /* values to assign */ @@ -1698,6 +1716,8 @@ static struct PyMethodDef pyrna_prop_methods[] = { {"keys", (PyCFunction)pyrna_prop_keys, METH_NOARGS, NULL}, {"items", (PyCFunction)pyrna_prop_items, METH_NOARGS,NULL}, {"values", (PyCFunction)pyrna_prop_values, METH_NOARGS, NULL}, + + {"get", (PyCFunction)pyrna_prop_get, METH_VARARGS, NULL}, #if (PY_VERSION_HEX >= 0x03000000) /* array accessor function */ @@ -1913,7 +1933,7 @@ static PyObject * pyrna_func_call(PyObject * self, PyObject *args, PyObject *kw) tid= RNA_struct_identifier(self_ptr->type); fid= RNA_function_identifier(self_func); - PyErr_Format(PyExc_AttributeError, "%s.%s(): required parameter \"%s\" not specified", tid, fid, pid); + PyErr_Format(PyExc_AttributeError, "%.200s.%.200s(): required parameter \"%.200s\" not specified", tid, fid, pid); err= -1; break; } @@ -2325,12 +2345,12 @@ static PyObject *pyrna_basetype_getattro( BPy_BaseTypeRNA * self, PyObject *pyna if (RNA_property_collection_lookup_string(&self->ptr, self->prop, _PyUnicode_AsString(pyname), &newptr)) { ret= pyrna_struct_Subtype(&newptr); if (ret==NULL) { - PyErr_Format(PyExc_SystemError, "bpy.types.%s subtype could not be generated, this is a bug!", _PyUnicode_AsString(pyname)); + PyErr_Format(PyExc_SystemError, "bpy.types.%.200s subtype could not be generated, this is a bug!", _PyUnicode_AsString(pyname)); } return ret; } else { /* Override the error */ - PyErr_Format(PyExc_AttributeError, "bpy.types.%s not a valid RNA_Struct", _PyUnicode_AsString(pyname)); + PyErr_Format(PyExc_AttributeError, "bpy.types.%.200s not a valid RNA_Struct", _PyUnicode_AsString(pyname)); return NULL; } } @@ -2572,7 +2592,7 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun if (base_class) { if (!PyObject_IsSubclass(py_class, base_class)) { PyObject *name= PyObject_GetAttrString(base_class, "__name__"); - PyErr_Format( PyExc_AttributeError, "expected %s subclass of class \"%s\"", class_type, name ? _PyUnicode_AsString(name):""); + PyErr_Format( PyExc_AttributeError, "expected %.200s subclass of class \"%.200s\"", class_type, name ? _PyUnicode_AsString(name):""); Py_XDECREF(name); return -1; } @@ -2595,7 +2615,7 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun if (item==NULL) { if ((flag & FUNC_REGISTER_OPTIONAL)==0) { - PyErr_Format( PyExc_AttributeError, "expected %s class to have an \"%s\" attribute", class_type, RNA_function_identifier(func)); + PyErr_Format( PyExc_AttributeError, "expected %.200s class to have an \"%.200s\" attribute", class_type, RNA_function_identifier(func)); return -1; } @@ -2610,7 +2630,7 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun fitem= item; /* py 3.x */ if (PyFunction_Check(fitem)==0) { - PyErr_Format( PyExc_AttributeError, "expected %s class \"%s\" attribute to be a function", class_type, RNA_function_identifier(func)); + PyErr_Format( PyExc_AttributeError, "expected %.200s class \"%.200s\" attribute to be a function", class_type, RNA_function_identifier(func)); return -1; } @@ -2622,7 +2642,7 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun Py_DECREF(py_arg_count); if (arg_count != func_arg_count) { - PyErr_Format( PyExc_AttributeError, "expected %s class \"%s\" function to have %d args", class_type, RNA_function_identifier(func), func_arg_count); + PyErr_Format( PyExc_AttributeError, "expected %.200s class \"%.200s\" function to have %d args", class_type, RNA_function_identifier(func), func_arg_count); return -1; } } @@ -2654,7 +2674,7 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun } if (item==NULL && (flag & PROP_REGISTER_OPTIONAL)==0) { - PyErr_Format( PyExc_AttributeError, "expected %s class to have an \"%s\" attribute", class_type, identifier); + PyErr_Format( PyExc_AttributeError, "expected %.200s class to have an \"%.200s\" attribute", class_type, identifier); return -1; } @@ -2738,12 +2758,12 @@ static int bpy_class_call(PointerRNA *ptr, FunctionRNA *func, ParameterList *par } else { Py_DECREF(py_class_instance); - PyErr_Format(PyExc_AttributeError, "could not find function %s in %s to execute callback.", RNA_function_identifier(func), RNA_struct_identifier(ptr->type)); + PyErr_Format(PyExc_AttributeError, "could not find function %.200s in %.200s to execute callback.", RNA_function_identifier(func), RNA_struct_identifier(ptr->type)); err= -1; } } else { - PyErr_Format(PyExc_AttributeError, "could not create instance of %s to call callback function %s.", RNA_struct_identifier(ptr->type), RNA_function_identifier(func)); + PyErr_Format(PyExc_AttributeError, "could not create instance of %.200s to call callback function %.200s.", RNA_struct_identifier(ptr->type), RNA_function_identifier(func)); err= -1; } -- cgit v1.2.3 From eab7905a9e03c9d8cb5a250f893be4f78cc04dde Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 9 Jul 2009 08:39:58 +0000 Subject: operator rename VIEW3D_OT_viewhome -> VIEW3D_OT_view_all VIEW3D_OT_viewcenter -> VIEW3D_OT_view_center VIEW3D_OT_clipping -> VIEW3D_OT_clip_border --- source/blender/editors/space_view3d/view3d_edit.c | 12 ++++++------ source/blender/editors/space_view3d/view3d_header.c | 16 ++++++++-------- source/blender/editors/space_view3d/view3d_intern.h | 6 +++--- source/blender/editors/space_view3d/view3d_ops.c | 14 +++++++------- 4 files changed, 24 insertions(+), 24 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 7880e588767..bd89bd519f3 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -910,12 +910,12 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2. return OPERATOR_FINISHED; } -void VIEW3D_OT_viewhome(wmOperatorType *ot) +void VIEW3D_OT_view_all(wmOperatorType *ot) { /* identifiers */ ot->name= "View home"; ot->description = "View all objects in scene."; - ot->idname= "VIEW3D_OT_viewhome"; + ot->idname= "VIEW3D_OT_view_all"; /* api callbacks */ ot->exec= viewhome_exec; @@ -1048,13 +1048,13 @@ static int viewcenter_exec(bContext *C, wmOperator *op) /* like a localview with return OPERATOR_FINISHED; } -void VIEW3D_OT_viewcenter(wmOperatorType *ot) +void VIEW3D_OT_view_center(wmOperatorType *ot) { /* identifiers */ ot->name= "View center"; ot->description = "Move the view to the selection center."; - ot->idname= "VIEW3D_OT_viewcenter"; + ot->idname= "VIEW3D_OT_view_center"; /* api callbacks */ ot->exec= viewcenter_exec; @@ -1711,13 +1711,13 @@ static int view3d_clipping_invoke(bContext *C, wmOperator *op, wmEvent *event) } /* toggles */ -void VIEW3D_OT_clipping(wmOperatorType *ot) +void VIEW3D_OT_clip_border(wmOperatorType *ot) { /* identifiers */ ot->name= "Clipping Border"; ot->description = "Set the view clipping border."; - ot->idname= "VIEW3D_OT_clipping"; + ot->idname= "VIEW3D_OT_clip_border"; /* api callbacks */ ot->invoke= view3d_clipping_invoke; diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index d5ec5e10b94..d23b47092bf 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -517,7 +517,7 @@ static void do_view3d_view_alignviewmenu(bContext *C, void *arg, int event) // XXX mainqenter(PADASTERKEY, 1); break; case 6: /* Center View and Cursor to Origin */ - WM_operator_name_call(C, "VIEW3D_OT_viewcenter", WM_OP_EXEC_REGION_WIN, NULL); + WM_operator_name_call(C, "VIEW3D_OT_view_center", WM_OP_EXEC_REGION_WIN, NULL); curs= give_cursor(scene, v3d); curs[0]=curs[1]=curs[2]= 0.0; break; @@ -583,10 +583,10 @@ static void do_view3d_viewmenu(bContext *C, void *arg, int event) case 8: /* Global View */ break; case 9: /* View All (Home) */ - WM_operator_name_call(C, "VIEW3D_OT_viewhome", WM_OP_EXEC_REGION_WIN, NULL); + WM_operator_name_call(C, "VIEW3D_OT_view_all", WM_OP_EXEC_REGION_WIN, NULL); break; case 11: /* View Selected */ - WM_operator_name_call(C, "VIEW3D_OT_viewcenter", WM_OP_EXEC_REGION_WIN, NULL); + WM_operator_name_call(C, "VIEW3D_OT_view_center", WM_OP_EXEC_REGION_WIN, NULL); break; case 13: /* Play Back Animation */ break; @@ -597,7 +597,7 @@ static void do_view3d_viewmenu(bContext *C, void *arg, int event) // add_blockhandler(sa, VIEW3D_HANDLER_PROPERTIES, UI_PNL_UNSTOW); break; case 17: /* Set Clipping Border */ - WM_operator_name_call(C, "VIEW3D_OT_clipping", WM_OP_INVOKE_REGION_WIN, NULL); + WM_operator_name_call(C, "VIEW3D_OT_clip_border", WM_OP_INVOKE_REGION_WIN, NULL); break; case 18: /* render preview */ // toggle_blockhandler(sa, VIEW3D_HANDLER_PREVIEW, 0); @@ -685,13 +685,13 @@ static void view3d_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN); - uiItemO(layout, NULL, 0, "VIEW3D_OT_clipping"); + uiItemO(layout, NULL, 0, "VIEW3D_OT_clip_border"); uiItemO(layout, NULL, 0, "VIEW3D_OT_zoom_border"); uiItemS(layout); - uiItemO(layout, NULL, 0, "VIEW3D_OT_viewcenter"); - uiItemO(layout, NULL, 0, "VIEW3D_OT_viewhome"); + uiItemO(layout, NULL, 0, "VIEW3D_OT_view_center"); + uiItemO(layout, NULL, 0, "VIEW3D_OT_view_all"); uiItemS(layout); @@ -4250,7 +4250,7 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event) switch(event) { case B_HOME: - WM_operator_name_call(C, "VIEW3D_OT_viewhome", WM_OP_EXEC_REGION_WIN, NULL); + WM_operator_name_call(C, "VIEW3D_OT_view_all", WM_OP_EXEC_REGION_WIN, NULL); break; case B_REDR: ED_area_tag_redraw(sa); diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 236f9b0904a..3e9382509f4 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -68,13 +68,13 @@ void view3d_keymap(struct wmWindowManager *wm); void VIEW3D_OT_zoom(struct wmOperatorType *ot); void VIEW3D_OT_viewmove(struct wmOperatorType *ot); void VIEW3D_OT_viewrotate(struct wmOperatorType *ot); -void VIEW3D_OT_viewhome(struct wmOperatorType *ot); +void VIEW3D_OT_view_all(struct wmOperatorType *ot); void VIEW3D_OT_viewnumpad(struct wmOperatorType *ot); -void VIEW3D_OT_viewcenter(struct wmOperatorType *ot); +void VIEW3D_OT_view_center(struct wmOperatorType *ot); void VIEW3D_OT_view_pan(struct wmOperatorType *ot); void VIEW3D_OT_view_persportho(struct wmOperatorType *ot); void VIEW3D_OT_view_orbit(struct wmOperatorType *ot); -void VIEW3D_OT_clipping(struct wmOperatorType *ot); +void VIEW3D_OT_clip_border(struct wmOperatorType *ot); void VIEW3D_OT_cursor3d(struct wmOperatorType *ot); void VIEW3D_OT_manipulator(struct wmOperatorType *ot); void VIEW3D_OT_render_border(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index eb0fbabeeed..70dde481018 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -65,15 +65,15 @@ void view3d_operatortypes(void) WM_operatortype_append(VIEW3D_OT_viewrotate); WM_operatortype_append(VIEW3D_OT_viewmove); WM_operatortype_append(VIEW3D_OT_zoom); - WM_operatortype_append(VIEW3D_OT_viewhome); + WM_operatortype_append(VIEW3D_OT_view_all); WM_operatortype_append(VIEW3D_OT_viewnumpad); WM_operatortype_append(VIEW3D_OT_view_orbit); WM_operatortype_append(VIEW3D_OT_view_pan); WM_operatortype_append(VIEW3D_OT_view_persportho); - WM_operatortype_append(VIEW3D_OT_viewcenter); + WM_operatortype_append(VIEW3D_OT_view_center); WM_operatortype_append(VIEW3D_OT_select); WM_operatortype_append(VIEW3D_OT_select_border); - WM_operatortype_append(VIEW3D_OT_clipping); + WM_operatortype_append(VIEW3D_OT_clip_border); WM_operatortype_append(VIEW3D_OT_select_circle); WM_operatortype_append(VIEW3D_OT_smoothview); WM_operatortype_append(VIEW3D_OT_render_border); @@ -141,7 +141,7 @@ void view3d_keymap(wmWindowManager *wm) WM_keymap_verify_item(keymap, "VIEW3D_OT_viewrotate", MIDDLEMOUSE, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "VIEW3D_OT_viewmove", MIDDLEMOUSE, KM_PRESS, KM_SHIFT, 0); WM_keymap_verify_item(keymap, "VIEW3D_OT_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0); - WM_keymap_verify_item(keymap, "VIEW3D_OT_viewcenter", PADPERIOD, KM_PRESS, 0, 0); + WM_keymap_verify_item(keymap, "VIEW3D_OT_view_center", PADPERIOD, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "VIEW3D_OT_smoothview", TIMER1, KM_ANY, KM_ANY, 0); @@ -150,8 +150,8 @@ void view3d_keymap(wmWindowManager *wm) RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_zoom", WHEELINMOUSE, KM_PRESS, 0, 0)->ptr, "delta", 1); RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_zoom", WHEELOUTMOUSE, KM_PRESS, 0, 0)->ptr, "delta", -1); - RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewhome", HOMEKEY, KM_PRESS, 0, 0)->ptr, "center", 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewhome", CKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "center", 1); + RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_all", HOMEKEY, KM_PRESS, 0, 0)->ptr, "center", 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_all", CKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "center", 1); /* numpad view hotkeys*/ RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD0, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_CAMERA); @@ -209,7 +209,7 @@ void view3d_keymap(wmWindowManager *wm) RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT|KM_CTRL, 0)->ptr, "type", 1); WM_keymap_add_item(keymap, "VIEW3D_OT_select_circle", CKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "VIEW3D_OT_clipping", BKEY, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "VIEW3D_OT_clip_border", BKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_zoom_border", BKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_render_border", BKEY, KM_PRESS, KM_SHIFT, 0); -- cgit v1.2.3 From c1f3b86f861028c9f1b6e8eedc5d4c07b77205a7 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 9 Jul 2009 13:14:51 +0000 Subject: NLA SoC: Cleanup of Keyframe Drawing code for DopeSheet * Removed the glaMapping stuff in favour of remapping the keyframes manually. The old code was causing some mess, and not really working well for the DopeSheet with various mappings being used. * Fixed NLA-mapped selection in DopeSheet. Clicking on individual keyframes should now work ok. More testing required though. * Keyframes in DopeSheet are now drawn fully using OpenGL (instead of icons). They look less tactile now, but this may be compensated with in terms of speed? Previously I disabled this type of drawing due to issues with some cards. Enabled again for now, but mainly because I couldn't get the icons to line up nicely in screenspace... * Borderselect in DopeSheet. I've had a look at issues with it selecting the wrong channel's keyframes. The issues don't seem to be solved yet though... will look again tomorrow. --- source/blender/editors/animation/keyframes_draw.c | 288 +++++++++------------ source/blender/editors/armature/poselib.c | 2 +- source/blender/editors/include/ED_keyframes_draw.h | 38 +-- source/blender/editors/space_action/action_draw.c | 96 ++----- .../blender/editors/space_action/action_select.c | 66 ++--- source/blender/editors/space_nla/nla_draw.c | 2 +- source/blender/editors/space_view3d/drawarmature.c | 9 +- 7 files changed, 197 insertions(+), 304 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 56b1c63db74..f122e045776 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -51,7 +51,6 @@ #include "DNA_armature_types.h" #include "DNA_camera_types.h" #include "DNA_curve_types.h" -#include "DNA_ipo_types.h" #include "DNA_object_types.h" #include "DNA_screen_types.h" #include "DNA_scene_types.h" @@ -64,6 +63,7 @@ #include "DNA_gpencil_types.h" #include "DNA_windowmanager_types.h" #include "DNA_world_types.h" +#include "DNA_view2d_types.h" #include "BKE_action.h" #include "BKE_depsgraph.h" @@ -234,45 +234,82 @@ static ActKeyColumn *cfra_find_actkeycolumn (ListBase *keys, float cframe) return NULL; } -#if 0 // disabled, as some intel cards have problems with this -/* Draw a simple diamond shape with a filled in center (in screen space) */ -static void draw_key_but(int x, int y, short w, short h, int sel) +/* coordinates for diamond shape */ +static const float _unit_diamond_shape[4][2] = { + {0.0f, 1.0f}, /* top vert */ + {1.0f, 0.0f}, /* mid-right */ + {0.0f, -1.0f}, /* bottom vert */ + {-1.0f, 0.0f} /* mid-left */ +}; + +/* draw a simple diamond shape with OpenGL */ +static void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel) { - int xmin= x, ymin= y; - int xmax= x+w-1, ymax= y+h-1; - int xc= (xmin+xmax)/2, yc= (ymin+ymax)/2; + static GLuint displist1=0; + static GLuint displist2=0; - /* interior - hardcoded colors (for selected and unselected only) */ - if (sel) glColor3ub(0xF1, 0xCA, 0x13); - else glColor3ub(0xE9, 0xE9, 0xE9); + /* initialise 2 display lists for diamond shape - one empty, one filled */ + if (displist1 == 0) { + displist1= glGenLists(1); + glNewList(displist1, GL_COMPILE); + + glBegin(GL_LINE_LOOP); + glVertex2fv(_unit_diamond_shape[0]); + glVertex2fv(_unit_diamond_shape[1]); + glVertex2fv(_unit_diamond_shape[2]); + glVertex2fv(_unit_diamond_shape[3]); + glEnd(); + glEndList(); + } + if (displist2 == 0) { + displist2= glGenLists(1); + glNewList(displist2, GL_COMPILE); + + glBegin(GL_QUADS); + glVertex2fv(_unit_diamond_shape[0]); + glVertex2fv(_unit_diamond_shape[1]); + glVertex2fv(_unit_diamond_shape[2]); + glVertex2fv(_unit_diamond_shape[3]); + glEnd(); + glEndList(); + } + + /* adjust view transform before starting */ + glTranslatef(x, y, 0.0f); + glScalef(1.0f/xscale*hsize, hsize, 1.0f); + + /* anti-aliased lines for more consistent appearance */ + glEnable(GL_LINE_SMOOTH); - glBegin(GL_QUADS); - glVertex2i(xc, ymin); - glVertex2i(xmax, yc); - glVertex2i(xc, ymax); - glVertex2i(xmin, yc); - glEnd(); + /* draw! ---------------------------- */ + /* interior - hardcoded colors (for selected and unselected only) */ + if (sel) UI_ThemeColorShade(TH_STRIP_SELECT, 50);//glColor3ub(0xF1, 0xCA, 0x13); + else glColor3ub(0xE9, 0xE9, 0xE9); + glCallList(displist2); - /* outline */ + /* exterior - black frame */ glColor3ub(0, 0, 0); + glCallList(displist1); + + glDisable(GL_LINE_SMOOTH); - glBegin(GL_LINE_LOOP); - glVertex2i(xc, ymin); - glVertex2i(xmax, yc); - glVertex2i(xc, ymax); - glVertex2i(xmin, yc); - glEnd(); + /* restore view transform */ + glScalef(xscale/hsize, 1.0f/hsize, 1.0); + glTranslatef(-x, -y, 0.0f); } -#endif -static void draw_keylist(gla2DDrawInfo *di, ListBase *keys, ListBase *blocks, float ypos) +static void draw_keylist(View2D *v2d, ListBase *keys, ListBase *blocks, float ypos) { ActKeyColumn *ak; ActKeyBlock *ab; + float xscale; glEnable(GL_BLEND); + /* get View2D scaling factor */ + UI_view2d_getscale(v2d, &xscale, NULL); + /* draw keyblocks */ if (blocks) { for (ab= blocks->first; ab; ab= ab->next) { @@ -292,18 +329,13 @@ static void draw_keylist(gla2DDrawInfo *di, ListBase *keys, ListBase *blocks, fl totCurves = (startCurves>endCurves)? endCurves: startCurves; if (ab->totcurve >= totCurves) { - int sc_xa, sc_xb, sc_ya, sc_yb; - - /* get co-ordinates of block */ - gla2DDrawTranslatePt(di, ab->start, ypos, &sc_xa, &sc_ya); - gla2DDrawTranslatePt(di, ab->end, ypos, &sc_xb, &sc_yb); - /* draw block */ if (ab->sel) UI_ThemeColor4(TH_STRIP_SELECT); else UI_ThemeColor4(TH_STRIP); - glRectf((float)sc_xa, (float)sc_ya-3, (float)sc_xb, (float)sc_yb+5); + + glRectf(ab->start, ypos-5, ab->end, ypos+5); } } } @@ -311,18 +343,28 @@ static void draw_keylist(gla2DDrawInfo *di, ListBase *keys, ListBase *blocks, fl /* draw keys */ if (keys) { for (ak= keys->first; ak; ak= ak->next) { - int sc_x, sc_y; + /* draw using OpenGL - uglier but faster */ + // NOTE: a previous version of this didn't work nice for some intel cards + draw_keyframe_shape(ak->cfra, ypos, xscale, 5.0f, (ak->sel & SELECT)); + +#if 0 // OLD CODE + //int sc_x, sc_y; /* get co-ordinate to draw at */ - gla2DDrawTranslatePt(di, ak->cfra, ypos, &sc_x, &sc_y); + //gla2DDrawTranslatePt(di, ak->cfra, ypos, &sc_x, &sc_y); /* draw using icons - old way which is slower but more proven */ - if (ak->sel & SELECT) UI_icon_draw_aspect((float)sc_x-7, (float)sc_y-6, ICON_SPACE2, 1.0f); - else UI_icon_draw_aspect((float)sc_x-7, (float)sc_y-6, ICON_SPACE3, 1.0f); + //if (ak->sel & SELECT) UI_icon_draw_aspect((float)sc_x-7, (float)sc_y-6, ICON_SPACE2, 1.0f); + //else UI_icon_draw_aspect((float)sc_x-7, (float)sc_y-6, ICON_SPACE3, 1.0f); +#endif // OLD CODE +#if 0 // NEW NON-WORKING CODE + /* draw icon */ + // FIXME: this draws slightly wrong, as we need to apply some offset for icon, but that depends on scaling + // so for now disabled + //int icon = (ak->sel & SELECT) ? ICON_SPACE2 : ICON_SPACE3; + //UI_icon_draw_aspect(ak->cfra, ypos-6, icon, 1.0f); +#endif // NEW NON-WORKING CODE - /* draw using OpenGL - slightly uglier but faster */ - // NOTE: disabled for now, as some intel cards seem to have problems with this - //draw_key_but(sc_x-5, sc_y-4, 11, 11, (ak->sel & SELECT)); } } @@ -331,81 +373,80 @@ static void draw_keylist(gla2DDrawInfo *di, ListBase *keys, ListBase *blocks, fl /* *************************** Channel Drawing Funcs *************************** */ -void draw_scene_channel(gla2DDrawInfo *di, ActKeysInc *aki, Scene *sce, float ypos) +void draw_scene_channel(View2D *v2d, bDopeSheet *ads, Scene *sce, float ypos) { ListBase keys = {0, 0}; ListBase blocks = {0, 0}; - scene_to_keylist(sce, &keys, &blocks, aki); - draw_keylist(di, &keys, &blocks, ypos); + scene_to_keylist(ads, sce, &keys, &blocks); + draw_keylist(v2d, &keys, &blocks, ypos); BLI_freelistN(&keys); BLI_freelistN(&blocks); } -void draw_object_channel(gla2DDrawInfo *di, ActKeysInc *aki, Object *ob, float ypos) +void draw_object_channel(View2D *v2d, bDopeSheet *ads, Object *ob, float ypos) { ListBase keys = {0, 0}; ListBase blocks = {0, 0}; - ob_to_keylist(ob, &keys, &blocks, aki); - draw_keylist(di, &keys, &blocks, ypos); + ob_to_keylist(ads, ob, &keys, &blocks); + draw_keylist(v2d, &keys, &blocks, ypos); BLI_freelistN(&keys); BLI_freelistN(&blocks); } -void draw_fcurve_channel(gla2DDrawInfo *di, ActKeysInc *aki, FCurve *fcu, float ypos) +void draw_fcurve_channel(View2D *v2d, AnimData *adt, FCurve *fcu, float ypos) { ListBase keys = {0, 0}; ListBase blocks = {0, 0}; - fcurve_to_keylist(fcu, &keys, &blocks, aki); - draw_keylist(di, &keys, &blocks, ypos); + fcurve_to_keylist(adt, fcu, &keys, &blocks); + draw_keylist(v2d, &keys, &blocks, ypos); BLI_freelistN(&keys); BLI_freelistN(&blocks); } -void draw_agroup_channel(gla2DDrawInfo *di, ActKeysInc *aki, bActionGroup *agrp, float ypos) +void draw_agroup_channel(View2D *v2d, AnimData *adt, bActionGroup *agrp, float ypos) { ListBase keys = {0, 0}; ListBase blocks = {0, 0}; - agroup_to_keylist(agrp, &keys, &blocks, aki); - draw_keylist(di, &keys, &blocks, ypos); + agroup_to_keylist(adt, agrp, &keys, &blocks); + draw_keylist(v2d, &keys, &blocks, ypos); BLI_freelistN(&keys); BLI_freelistN(&blocks); } -void draw_action_channel(gla2DDrawInfo *di, ActKeysInc *aki, bAction *act, float ypos) +void draw_action_channel(View2D *v2d, AnimData *adt, bAction *act, float ypos) { ListBase keys = {0, 0}; ListBase blocks = {0, 0}; - action_to_keylist(act, &keys, &blocks, aki); - draw_keylist(di, &keys, &blocks, ypos); + action_to_keylist(adt, act, &keys, &blocks); + draw_keylist(v2d, &keys, &blocks, ypos); BLI_freelistN(&keys); BLI_freelistN(&blocks); } -void draw_gpl_channel(gla2DDrawInfo *di, ActKeysInc *aki, bGPDlayer *gpl, float ypos) +void draw_gpl_channel(View2D *v2d, bDopeSheet *ads, bGPDlayer *gpl, float ypos) { ListBase keys = {0, 0}; - gpl_to_keylist(gpl, &keys, NULL, aki); - draw_keylist(di, &keys, NULL, ypos); + gpl_to_keylist(ads, gpl, &keys, NULL); + draw_keylist(v2d, &keys, NULL, ypos); BLI_freelistN(&keys); } /* *************************** Keyframe List Conversions *************************** */ -void scene_to_keylist(Scene *sce, ListBase *keys, ListBase *blocks, ActKeysInc *aki) +void scene_to_keylist(bDopeSheet *ads, Scene *sce, ListBase *keys, ListBase *blocks) { if (sce) { - bDopeSheet *ads= (aki)? (aki->ads) : NULL; AnimData *adt; int filterflag; @@ -421,7 +462,7 @@ void scene_to_keylist(Scene *sce, ListBase *keys, ListBase *blocks, ActKeysInc * // TODO: when we adapt NLA system, this needs to be the NLA-scaled version if (adt->action) - action_to_keylist(adt->action, keys, blocks, aki); + action_to_keylist(adt, adt->action, keys, blocks); } /* world animdata */ @@ -430,17 +471,16 @@ void scene_to_keylist(Scene *sce, ListBase *keys, ListBase *blocks, ActKeysInc * // TODO: when we adapt NLA system, this needs to be the NLA-scaled version if (adt->action) - action_to_keylist(adt->action, keys, blocks, aki); + action_to_keylist(adt, adt->action, keys, blocks); } } } -void ob_to_keylist(Object *ob, ListBase *keys, ListBase *blocks, ActKeysInc *aki) +void ob_to_keylist(bDopeSheet *ads, Object *ob, ListBase *keys, ListBase *blocks) { Key *key= ob_get_key(ob); if (ob) { - bDopeSheet *ads= (aki)? (aki->ads) : NULL; int filterflag; /* get filterflag */ @@ -451,79 +491,18 @@ void ob_to_keylist(Object *ob, ListBase *keys, ListBase *blocks, ActKeysInc *aki /* Add action keyframes */ if (ob->adt && ob->adt->action) - action_nlascaled_to_keylist(ob->adt, ob->adt->action, keys, blocks, aki); + action_to_keylist(ob->adt, ob->adt->action, keys, blocks); /* Add shapekey keyframes (only if dopesheet allows, if it is available) */ - // TODO: when we adapt NLA system, this needs to be the NLA-scaled version if ((key && key->adt && key->adt->action) && !(filterflag & ADS_FILTER_NOSHAPEKEYS)) - action_to_keylist(key->adt->action, keys, blocks, aki); + action_to_keylist(key->adt, key->adt->action, keys, blocks); -#if 0 // XXX old animation system - /* Add material keyframes (only if dopesheet allows, if it is available) */ - if ((ob->totcol) && !(filterflag & ADS_FILTER_NOMAT)) { - short a; - - for (a=0; atotcol; a++) { - Material *ma= give_current_material(ob, a); - - if (ELEM(NULL, ma, ma->ipo) == 0) - ipo_to_keylist(ma->ipo, keys, blocks, aki); - } - } - - /* Add object data keyframes */ - switch (ob->type) { - case OB_CAMERA: /* ------- Camera ------------ */ - { - Camera *ca= (Camera *)ob->data; - if ((ca->ipo) && !(filterflag & ADS_FILTER_NOCAM)) - ipo_to_keylist(ca->ipo, keys, blocks, aki); - } - break; - case OB_LAMP: /* ---------- Lamp ----------- */ - { - Lamp *la= (Lamp *)ob->data; - if ((la->ipo) && !(filterflag & ADS_FILTER_NOLAM)) - ipo_to_keylist(la->ipo, keys, blocks, aki); - } - break; - case OB_CURVE: /* ------- Curve ---------- */ - { - Curve *cu= (Curve *)ob->data; - if ((cu->ipo) && !(filterflag & ADS_FILTER_NOCUR)) - ipo_to_keylist(cu->ipo, keys, blocks, aki); - } - break; - } -#endif // XXX old animation system + // TODO: restore materials, and object data, etc. } } -static short bezt_in_aki_range (ActKeysInc *aki, BezTriple *bezt) -{ - /* when aki == NULL, we don't care about range */ - if (aki == NULL) - return 1; - - /* if start and end are both 0, then don't care about range */ - if (IS_EQ(aki->start, 0) && IS_EQ(aki->end, 0)) - return 1; - - /* if nla-scaling is in effect, apply appropriate scaling adjustments */ -#if 0 // XXX this was from some buggy code... do not port for now - if (aki->ob) { - float frame= get_action_frame_inv(aki->ob, bezt->vec[1][0]); - return IN_RANGE(frame, aki->start, aki->end); - } - else { - /* check if in range */ - return IN_RANGE(bezt->vec[1][0], aki->start, aki->end); - } -#endif // XXX this was from some buggy code... do not port for now - return 1; -} -void fcurve_to_keylist(FCurve *fcu, ListBase *keys, ListBase *blocks, ActKeysInc *aki) +void fcurve_to_keylist(AnimData *adt, FCurve *fcu, ListBase *keys, ListBase *blocks) { BezTriple *bezt; ActKeyColumn *ak, *ak2; @@ -531,15 +510,17 @@ void fcurve_to_keylist(FCurve *fcu, ListBase *keys, ListBase *blocks, ActKeysInc int v; if (fcu && fcu->totvert && fcu->bezt) { + /* apply NLA-mapping (if applicable) */ + if (adt) + ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1); + /* loop through beztriples, making ActKeys and ActKeyBlocks */ bezt= fcu->bezt; for (v=0; v < fcu->totvert; v++, bezt++) { /* only if keyframe is in range (optimisation) */ - if (bezt_in_aki_range(aki, bezt)) { - add_bezt_to_keycolumnslist(keys, bezt); - if (blocks) add_bezt_to_keyblockslist(blocks, fcu, v); - } + add_bezt_to_keycolumnslist(keys, bezt); + if (blocks) add_bezt_to_keyblockslist(blocks, fcu, v); } /* update the number of curves that elements have appeared in */ @@ -575,65 +556,38 @@ void fcurve_to_keylist(FCurve *fcu, ListBase *keys, ListBase *blocks, ActKeysInc } } } + + /* unapply NLA-mapping if applicable */ + ANIM_nla_mapping_apply_fcurve(adt, fcu, 1, 1); } } -void agroup_to_keylist(bActionGroup *agrp, ListBase *keys, ListBase *blocks, ActKeysInc *aki) +void agroup_to_keylist(AnimData *adt, bActionGroup *agrp, ListBase *keys, ListBase *blocks) { FCurve *fcu; if (agrp) { /* loop through F-Curves */ for (fcu= agrp->channels.first; fcu && fcu->grp==agrp; fcu= fcu->next) { - fcurve_to_keylist(fcu, keys, blocks, aki); + fcurve_to_keylist(adt, fcu, keys, blocks); } } } -void action_to_keylist(bAction *act, ListBase *keys, ListBase *blocks, ActKeysInc *aki) +void action_to_keylist(AnimData *adt, bAction *act, ListBase *keys, ListBase *blocks) { FCurve *fcu; if (act) { /* loop through F-Curves */ for (fcu= act->curves.first; fcu; fcu= fcu->next) { - fcurve_to_keylist(fcu, keys, blocks, aki); + fcurve_to_keylist(adt, fcu, keys, blocks); } } } -void action_nlascaled_to_keylist(AnimData *adt, bAction *act, ListBase *keys, ListBase *blocks, ActKeysInc *aki) -{ - FCurve *fcu; - AnimData *oldadt= NULL; - - /* although apply and clearing NLA-mapping pre-post creating keylist does impact on performance, - * the effects should be fairly minimal, as we're already going through the keyframes multiple times - * already for blocks too... - */ - if (act) { - /* if 'aki' is provided, store it's current ob to restore later as it might not be the same */ - if (aki) { - oldadt= aki->adt; - aki->adt= adt; - } - - /* loop through F-Curves - * - scaling correction only does times for center-points, so should be faster - */ - for (fcu= act->curves.first; fcu; fcu= fcu->next) { - ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1); - fcurve_to_keylist(fcu, keys, blocks, aki); - ANIM_nla_mapping_apply_fcurve(adt, fcu, 1, 1); - } - - /* if 'aki' is provided, restore ob */ - if (aki) - aki->adt= oldadt; - } -} -void gpl_to_keylist(bGPDlayer *gpl, ListBase *keys, ListBase *blocks, ActKeysInc *aki) +void gpl_to_keylist(bDopeSheet *ads, bGPDlayer *gpl, ListBase *keys, ListBase *blocks) { bGPDframe *gpf; ActKeyColumn *ak; diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index 8cbfebebff6..fcc1e8f9644 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -227,7 +227,7 @@ void poselib_validate_act (bAction *act) } /* determine which frames have keys */ - action_to_keylist(act, &keys, NULL, NULL); + action_to_keylist(NULL, act, &keys, NULL); /* for each key, make sure there is a correspnding pose */ for (ak= keys.first; ak; ak= ak->next) { diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h index d2269300d24..22ee7a42121 100644 --- a/source/blender/editors/include/ED_keyframes_draw.h +++ b/source/blender/editors/include/ED_keyframes_draw.h @@ -33,13 +33,14 @@ struct AnimData; struct BezTriple; struct FCurve; -struct gla2DDrawInfo; +struct bDopeSheet; struct bAction; struct bActionGroup; struct Object; struct ListBase; struct bGPDlayer; struct Scene; +struct View2D; /* ****************************** Base Structs ****************************** */ @@ -66,34 +67,23 @@ typedef struct ActKeyBlock { short totcurve; } ActKeyBlock; - -/* Inclusion-Range Limiting Struct (optional) */ -typedef struct ActKeysInc { - struct bDopeSheet *ads; /* dopesheet data (for dopesheet mode) */ - struct AnimData *adt; /* owner for NLA-mapping info */ - short actmode; /* mode of the Action Editor (-1 is for NLA) */ - - float start, end; /* frames (global-time) to only consider keys between */ // XXX not used anymore! -} ActKeysInc; - /* ******************************* Methods ****************************** */ /* Channel Drawing */ -void draw_fcurve_channel(struct gla2DDrawInfo *di, ActKeysInc *aki, struct FCurve *fcu, float ypos); -void draw_agroup_channel(struct gla2DDrawInfo *di, ActKeysInc *aki, struct bActionGroup *agrp, float ypos); -void draw_action_channel(struct gla2DDrawInfo *di, ActKeysInc *aki, struct bAction *act, float ypos); -void draw_object_channel(struct gla2DDrawInfo *di, ActKeysInc *aki, struct Object *ob, float ypos); -void draw_scene_channel(struct gla2DDrawInfo *di, ActKeysInc *aki, struct Scene *sce, float ypos); -void draw_gpl_channel(struct gla2DDrawInfo *di, ActKeysInc *aki, struct bGPDlayer *gpl, float ypos); +void draw_fcurve_channel(struct View2D *v2d, struct AnimData *adt, struct FCurve *fcu, float ypos); +void draw_agroup_channel(struct View2D *v2d, struct AnimData *adt, struct bActionGroup *agrp, float ypos); +void draw_action_channel(struct View2D *v2d, struct AnimData *adt, struct bAction *act, float ypos); +void draw_object_channel(struct View2D *v2d, struct bDopeSheet *ads, struct Object *ob, float ypos); +void draw_scene_channel(struct View2D *v2d, struct bDopeSheet *ads, struct Scene *sce, float ypos); +void draw_gpl_channel(struct View2D *v2d, struct bDopeSheet *ads, struct bGPDlayer *gpl, float ypos); /* Keydata Generation */ -void fcurve_to_keylist(struct FCurve *fcu, ListBase *keys, ListBase *blocks, ActKeysInc *aki); -void agroup_to_keylist(struct bActionGroup *agrp, ListBase *keys, ListBase *blocks, ActKeysInc *aki); -void action_to_keylist(struct bAction *act, ListBase *keys, ListBase *blocks, ActKeysInc *aki); -void action_nlascaled_to_keylist(struct AnimData *adt, struct bAction *act, ListBase *keys, ListBase *blocks, ActKeysInc *aki); -void ob_to_keylist(struct Object *ob, ListBase *keys, ListBase *blocks, ActKeysInc *aki); -void scene_to_keylist(struct Scene *sce, ListBase *keys, ListBase *blocks, ActKeysInc *aki); -void gpl_to_keylist(struct bGPDlayer *gpl, ListBase *keys, ListBase *blocks, ActKeysInc *aki); +void fcurve_to_keylist(struct AnimData *adt, struct FCurve *fcu, ListBase *keys, ListBase *blocks); +void agroup_to_keylist(struct AnimData *adt, struct bActionGroup *agrp, ListBase *keys, ListBase *blocks); +void action_to_keylist(struct AnimData *adt, struct bAction *act, ListBase *keys, ListBase *blocks); +void ob_to_keylist(struct bDopeSheet *ads, struct Object *ob, ListBase *keys, ListBase *blocks); +void scene_to_keylist(struct bDopeSheet *ads, struct Scene *sce, ListBase *keys, ListBase *blocks); +void gpl_to_keylist(struct bDopeSheet *ads, struct bGPDlayer *gpl, ListBase *keys, ListBase *blocks); #endif /* ED_KEYFRAMES_DRAW_H */ diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 910b9733bc8..743cc1f128e 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -960,27 +960,8 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar) /* ************************************************************************* */ /* Keyframes */ -ActKeysInc *init_aki_data(bAnimContext *ac, bAnimListElem *ale) -{ - static ActKeysInc aki; - - /* no need to set settings if wrong context */ - if ((ac->data == NULL) || ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET)==0) - return NULL; - - /* if strip is mapped, store settings */ - aki.adt= ANIM_nla_mapping_get(ac, ale); - - if (ac->datatype == ANIMCONT_DOPESHEET) - aki.ads= (bDopeSheet *)ac->data; - else - aki.ads= NULL; - aki.actmode= ac->datatype; - - /* always return pointer... */ - return &aki; -} - +/* extra padding for lengths (to go under scrollers) */ +#define EXTRA_SCROLL_PAD 100.0f /* draw keyframes in each channel */ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) @@ -990,13 +971,11 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) int filter; View2D *v2d= &ar->v2d; + bDopeSheet *ads= &saction->ads; AnimData *adt= NULL; - gla2DDrawInfo *di; - rcti scr_rct; - int act_start, act_end, dummy; + float act_start, act_end, y; int height, items; - float y, sta, end; char col1[3], col2[3]; char col1a[3], col2a[3]; @@ -1006,6 +985,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) /* get theme colors */ UI_GetThemeColor3ubv(TH_BACK, col2); UI_GetThemeColor3ubv(TH_HILITE, col1); + UI_GetThemeColor3ubv(TH_GROUP, col2a); UI_GetThemeColor3ubv(TH_GROUP_ACTIVE, col1a); @@ -1013,26 +993,14 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) UI_GetThemeColor3ubv(TH_DOPESHEET_CHANNELSUBOB, col2b); /* set view-mapping rect (only used for x-axis), for NLA-scaling mapping with less calculation */ - scr_rct.xmin= ar->winrct.xmin + ar->v2d.mask.xmin; - scr_rct.ymin= ar->winrct.ymin + ar->v2d.mask.ymin; - scr_rct.xmax= ar->winrct.xmin + ar->v2d.hor.xmax; - scr_rct.ymax= ar->winrct.ymin + ar->v2d.mask.ymax; - di= glaBegin2DDraw(&scr_rct, &v2d->cur); /* if in NLA there's a strip active, map the view */ if (ac->datatype == ANIMCONT_ACTION) { adt= ANIM_nla_mapping_get(ac, NULL); - if (adt) - ANIM_nla_mapping_draw(di, adt, 0); - /* start and end of action itself */ - calc_action_range(ac->data, &sta, &end, 0); - gla2DDrawTranslatePt(di, sta, 0.0f, &act_start, &dummy); - gla2DDrawTranslatePt(di, end, 0.0f, &act_end, &dummy); - - if (adt) - ANIM_nla_mapping_draw(di, adt, 1); + // TODO: this has not had scaling applied + calc_action_range(ac->data, &act_start, &act_end, 0); } /* build list of channels to draw */ @@ -1063,7 +1031,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) || IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) ) { - int frame1_x, channel_y, sel=0; + int sel=0; /* determine if any need to draw channel */ if (ale->datatype != ALE_NONE) { @@ -1102,8 +1070,6 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) } if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET)) { - gla2DDrawTranslatePt(di, v2d->cur.xmin, y, &frame1_x, &channel_y); - switch (ale->type) { case ANIMTYPE_SCENE: case ANIMTYPE_OBJECT: @@ -1139,36 +1105,32 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) } /* draw region twice: firstly backdrop, then the current range */ - glRectf((float)frame1_x, (float)channel_y-ACHANNEL_HEIGHT_HALF, (float)v2d->hor.xmax, (float)channel_y+ACHANNEL_HEIGHT_HALF); + glRectf(v2d->cur.xmin, (float)y-ACHANNEL_HEIGHT_HALF, v2d->cur.xmax+EXTRA_SCROLL_PAD, (float)y+ACHANNEL_HEIGHT_HALF); if (ac->datatype == ANIMCONT_ACTION) - glRectf((float)act_start, (float)channel_y-ACHANNEL_HEIGHT_HALF, (float)act_end, (float)channel_y+ACHANNEL_HEIGHT_HALF); + glRectf(act_start, (float)y-ACHANNEL_HEIGHT_HALF, act_end, (float)y+ACHANNEL_HEIGHT_HALF); } else if (ac->datatype == ANIMCONT_SHAPEKEY) { - gla2DDrawTranslatePt(di, 1, y, &frame1_x, &channel_y); - /* all frames that have a frame number less than one * get a desaturated orange background */ glColor4ub(col2[0], col2[1], col2[2], 0x22); - glRectf(0.0f, (float)channel_y-ACHANNEL_HEIGHT_HALF, (float)frame1_x, (float)channel_y+ACHANNEL_HEIGHT_HALF); + glRectf(0.0f, (float)y-ACHANNEL_HEIGHT_HALF, 1.0f, (float)y+ACHANNEL_HEIGHT_HALF); /* frames one and higher get a saturated orange background */ glColor4ub(col2[0], col2[1], col2[2], 0x44); - glRectf((float)frame1_x, (float)channel_y-ACHANNEL_HEIGHT_HALF, (float)v2d->hor.xmax, (float)channel_y+ACHANNEL_HEIGHT_HALF); + glRectf(1.0f, (float)y-ACHANNEL_HEIGHT_HALF, v2d->cur.xmax+EXTRA_SCROLL_PAD, (float)y+ACHANNEL_HEIGHT_HALF); } else if (ac->datatype == ANIMCONT_GPENCIL) { - gla2DDrawTranslatePt(di, v2d->cur.xmin, y, &frame1_x, &channel_y); - /* frames less than one get less saturated background */ if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22); else glColor4ub(col2[0], col2[1], col2[2], 0x22); - glRectf(0.0f, (float)channel_y-ACHANNEL_HEIGHT_HALF, (float)frame1_x, (float)channel_y+ACHANNEL_HEIGHT_HALF); + glRectf(0.0f, (float)y-ACHANNEL_HEIGHT_HALF, v2d->cur.xmin, (float)y+ACHANNEL_HEIGHT_HALF); /* frames one and higher get a saturated background */ if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x44); else glColor4ub(col2[0], col2[1], col2[2], 0x44); - glRectf((float)frame1_x, (float)channel_y-ACHANNEL_HEIGHT_HALF, (float)v2d->hor.xmax, (float)channel_y+ACHANNEL_HEIGHT_HALF); + glRectf(v2d->cur.xmin, (float)y-ACHANNEL_HEIGHT_HALF, v2d->cur.xmax+EXTRA_SCROLL_PAD, (float)y+ACHANNEL_HEIGHT_HALF); } } } @@ -1195,36 +1157,29 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) { /* check if anything to show for this channel */ if (ale->datatype != ALE_NONE) { - ActKeysInc *aki= init_aki_data(ac, ale); adt= ANIM_nla_mapping_get(ac, ale); - if (adt) - ANIM_nla_mapping_draw(di, adt, 0); - /* draw 'keyframes' for each specific datatype */ switch (ale->datatype) { case ALE_SCE: - draw_scene_channel(di, aki, ale->key_data, y); + draw_scene_channel(v2d, ads, ale->key_data, y); break; case ALE_OB: - draw_object_channel(di, aki, ale->key_data, y); + draw_object_channel(v2d, ads, ale->key_data, y); break; case ALE_ACT: - draw_action_channel(di, aki, ale->key_data, y); + draw_action_channel(v2d, adt, ale->key_data, y); break; case ALE_GROUP: - draw_agroup_channel(di, aki, ale->data, y); + draw_agroup_channel(v2d, adt, ale->data, y); break; case ALE_FCURVE: - draw_fcurve_channel(di, aki, ale->key_data, y); + draw_fcurve_channel(v2d, adt, ale->key_data, y); break; case ALE_GPFRAME: - draw_gpl_channel(di, aki, ale->data, y); + draw_gpl_channel(v2d, ads, ale->data, y); break; } - - if (adt) - ANIM_nla_mapping_draw(di, adt, 1); } } @@ -1236,16 +1191,11 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) /* black line marking 'current frame' for Time-Slide transform mode */ if (saction->flag & SACTION_MOVING) { - int frame1_x; - - gla2DDrawTranslatePt(di, saction->timeslide, 0, &frame1_x, &dummy); - cpack(0x0); + glColor3f(0.0f, 0.0f, 0.0f); glBegin(GL_LINES); - glVertex2f((float)frame1_x, (float)v2d->mask.ymin - 100); - glVertex2f((float)frame1_x, (float)v2d->mask.ymax); + glVertex2f(saction->timeslide, v2d->cur.ymin-EXTRA_SCROLL_PAD) + glVertex2f(saction->timeslide, v2d->cur.ymax); glEnd(); } - - glaEnd2DDraw(di); } diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 5b87c04b311..8f95f5ea52d 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -223,7 +223,8 @@ static void borderselect_action (bAnimContext *ac, rcti rect, short mode, short BeztEditFunc ok_cb, select_cb; View2D *v2d= &ac->ar->v2d; rctf rectf; - float ymin=0, ymax=(float)(-ACHANNEL_HEIGHT); + //float ymin=0, ymax=(float)(-ACHANNEL_HEIGHT); + float ymin=0, ymax=(float)(-ACHANNEL_HEIGHT_HALF); /* convert mouse coordinates to frame ranges and channel coordinates corrected for view pan/zoom */ UI_view2d_region_to_view(v2d, rect.xmin, rect.ymin+2, &rectf.xmin, &rectf.ymin); @@ -743,12 +744,16 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short select_mode, int filter; View2D *v2d= &ac->ar->v2d; + bDopeSheet *ads = NULL; int channel_index; short found = 0; float selx = 0.0f; float x, y; rctf rectf; + /* get dopesheet info */ + if (ac->datatype == ANIMCONT_DOPESHEET) + ads= ac->data; /* use View2D to determine the index of the channel (i.e a row in the list) where keyframe was */ UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y); @@ -773,46 +778,35 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short select_mode, else { /* found match - must return here... */ AnimData *adt= ANIM_nla_mapping_get(ac, ale); - ActKeysInc *aki= init_aki_data(ac, ale); ActKeyColumn *ak; - float xmin, xmax; - - /* apply NLA-scaling correction? */ - if (adt) { - xmin= BKE_nla_tweakedit_remap(adt, rectf.xmin, NLATIME_CONVERT_UNMAP); - xmax= BKE_nla_tweakedit_remap(adt, rectf.xmax, NLATIME_CONVERT_UNMAP); - } - else { - xmin= rectf.xmin; - xmax= rectf.xmax; - } /* make list of keyframes */ + // TODO: it would be great if we didn't have to apply this to all the keyframes to do this... if (ale->key_data) { switch (ale->datatype) { case ALE_OB: { Object *ob= (Object *)ale->key_data; - ob_to_keylist(ob, &anim_keys, NULL, aki); + ob_to_keylist(ads, ob, &anim_keys, NULL); } break; case ALE_ACT: { bAction *act= (bAction *)ale->key_data; - action_to_keylist(act, &anim_keys, NULL, aki); + action_to_keylist(adt, act, &anim_keys, NULL); } break; case ALE_FCURVE: { FCurve *fcu= (FCurve *)ale->key_data; - fcurve_to_keylist(fcu, &anim_keys, NULL, aki); + fcurve_to_keylist(adt, fcu, &anim_keys, NULL); } break; } } else if (ale->type == ANIMTYPE_GROUP) { bActionGroup *agrp= (bActionGroup *)ale->data; - agroup_to_keylist(agrp, &anim_keys, NULL, aki); + agroup_to_keylist(adt, agrp, &anim_keys, NULL); } else if (ale->type == ANIMTYPE_GPDATABLOCK) { /* cleanup */ @@ -822,13 +816,17 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short select_mode, } else if (ale->type == ANIMTYPE_GPLAYER) { bGPDlayer *gpl= (bGPDlayer *)ale->data; - gpl_to_keylist(gpl, &anim_keys, NULL, aki); + gpl_to_keylist(ads, gpl, &anim_keys, NULL); } /* loop through keyframes, finding one that was clicked on */ for (ak= anim_keys.first; ak; ak= ak->next) { - if (IN_RANGE(ak->cfra, xmin, xmax)) { - selx= ak->cfra; + if (IN_RANGE(ak->cfra, rectf.xmin, rectf.xmax)) { + /* set the frame to use, and apply inverse-correction for NLA-mapping + * so that the frame will get selected by the selection functiosn without + * requiring to map each frame once again... + */ + selx= BKE_nla_tweakedit_remap(adt, ak->cfra, NLATIME_CONVERT_UNMAP); found= 1; break; } @@ -884,19 +882,21 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short select_mode, } /* only select keyframes if we clicked on a valid channel and hit something */ - if (ale && found) { - /* apply selection to keyframes */ - if (/*gpl*/0) { - /* grease pencil */ - //select_gpencil_frame(gpl, (int)selx, selectmode); - } - else if (column) { - /* select all keyframes in the same frame as the one we hit on the active channel */ - actkeys_mselect_column(ac, select_mode, selx); - } - else { - /* select the nominated keyframe on the given frame */ - actkeys_mselect_single(ac, ale, select_mode, selx); + if (ale) { + if (found) { + /* apply selection to keyframes */ + if (/*gpl*/0) { + /* grease pencil */ + //select_gpencil_frame(gpl, (int)selx, selectmode); + } + else if (column) { + /* select all keyframes in the same frame as the one we hit on the active channel */ + actkeys_mselect_column(ac, select_mode, selx); + } + else { + /* select the nominated keyframe on the given frame */ + actkeys_mselect_single(ac, ale, select_mode, selx); + } } /* free this channel */ diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 7b2b19c19f6..3385906979a 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -143,7 +143,7 @@ static void nla_action_draw_keyframes (AnimData *adt, View2D *v2d, float y) glColor3f(0.0f, 0.0f, 0.0f); /* get a list of the keyframes with NLA-scaling applied */ - action_nlascaled_to_keylist(adt, adt->action, &keys, NULL, NULL); + action_to_keylist(adt, adt->action, &keys, NULL); /* get View2D scaling factor */ UI_view2d_getscale(v2d, &xscale, NULL); diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 0827bcaa9ae..c0f71ae6124 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -2173,7 +2173,7 @@ static void draw_pose_paths(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec if (adt) { bActionGroup *agrp= action_groups_find_named(adt->action, pchan->name); if (agrp) - agroup_to_keylist(agrp, &keys, NULL, NULL); + agroup_to_keylist(adt, agrp, &keys, NULL); } /* Draw slightly-larger yellow dots at each keyframe */ @@ -2320,18 +2320,17 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, RegionView3D *rv3d, bArmature *arm= ob->data; bPose *posen, *poseo; ListBase keys= {NULL, NULL}; - ActKeysInc aki = {0, 0, 0}; ActKeyColumn *ak, *akn; float start, end, range, colfac, i; int cfrao, flago; - aki.start= start = (float)arm->ghostsf; - aki.end= end = (float)arm->ghostef; + start = (float)arm->ghostsf; + end = (float)arm->ghostef; if (end <= start) return; /* get keyframes - then clip to only within range */ - action_to_keylist(act, &keys, NULL, &aki); + action_to_keylist(adt, act, &keys, NULL); range= 0; for (ak= keys.first; ak; ak= akn) { akn= ak->next; -- cgit v1.2.3 From 77c61f545fb3248ae4e06afafa816764222405c4 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 9 Jul 2009 14:35:40 +0000 Subject: 2.5 Bad bad DNA errors! People should really check on warning prints for compiling dna dir... - SpaceFile: ListBase* prev; <- dna doesnt recognize this - wmEvent: const variables were not supported yet. The first I fixed, 2nd I added support for in makesdna. Note that files saved between tuesday july 7 and now can be corrupted! --- source/blender/makesdna/DNA_space_types.h | 37 ++++++++++++----------- source/blender/makesdna/DNA_windowmanager_types.h | 19 +++++++----- source/blender/makesdna/intern/dna_genfile.c | 5 +-- source/blender/makesdna/intern/makesdna.c | 5 +-- 4 files changed, 37 insertions(+), 29 deletions(-) (limited to 'source') diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 796da7e7f5d..182e5481999 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -86,7 +86,7 @@ typedef struct SpaceInfo { } SpaceInfo; /* 'Graph' Editor (formerly known as the IPO Editor) */ -// XXX for now, we keep all old data... +/* XXX for now, we keep all old data... */ typedef struct SpaceIpo { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ @@ -191,21 +191,6 @@ typedef struct FileSelectParams { /* XXX --- end unused -- */ } FileSelectParams; -/* FileSelectParams.display */ -enum FileDisplayTypeE { - FILE_SHORTDISPLAY = 1, - FILE_LONGDISPLAY, - FILE_IMGDISPLAY -}; - -/* FileSelectParams.sort */ -enum FileSortTypeE { - FILE_SORT_NONE = 0, - FILE_SORT_ALPHA = 1, - FILE_SORT_EXTENSION, - FILE_SORT_TIME, - FILE_SORT_SIZE -}; typedef struct SpaceFile { SpaceLink *next, *prev; @@ -217,8 +202,8 @@ typedef struct SpaceFile { struct FileList *files; /* holds the list of files to show */ - ListBase* folders_prev; /* holds the list of previous directories to show */ - ListBase* folders_next; /* holds the list of next directories (pushed from previous) to show */ + ListBase *folders_prev; /* holds the list of previous directories to show */ + ListBase *folders_next; /* holds the list of next directories (pushed from previous) to show */ /* operator that is invoking fileselect op->exec() will be called on the 'Load' button. @@ -572,6 +557,22 @@ typedef struct SpaceImaSel { #define BUTS_SENS_STATE 512 #define BUTS_ACT_STATE 1024 +/* FileSelectParams.display */ +enum FileDisplayTypeE { + FILE_SHORTDISPLAY = 1, + FILE_LONGDISPLAY, + FILE_IMGDISPLAY +}; + +/* FileSelectParams.sort */ +enum FileSortTypeE { + FILE_SORT_NONE = 0, + FILE_SORT_ALPHA = 1, + FILE_SORT_EXTENSION, + FILE_SORT_TIME, + FILE_SORT_SIZE +}; + /* these values need to be hardcoded in structs, dna does not recognize defines */ /* also defined in BKE */ #define FILE_MAXDIR 160 diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index b63fb35c193..fcf3d0aec23 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -217,11 +217,6 @@ typedef struct wmOperator { /* add this flag if the event should pass through */ #define OPERATOR_PASS_THROUGH 8 -typedef enum wmRadialControlMode { - WM_RADIALCONTROL_SIZE, - WM_RADIALCONTROL_STRENGTH, - WM_RADIALCONTROL_ANGLE -} wmRadialControlMode; /* ************** wmEvent ************************ */ /* for read-only rna access, dont save this */ @@ -244,15 +239,25 @@ typedef struct wmEvent { short shift, ctrl, alt, oskey; /* oskey is apple or windowskey, value denotes order of pressed */ short keymodifier; /* rawkey modifier */ + short pad1; + /* keymap item, set by handler (weak?) */ const char *keymap_idname; /* custom data */ - short custom; /* custom data type, stylus, 6dof, see wm_event_types.h */ - void *customdata; /* ascii, unicode, mouse coords, angles, vectors, dragdrop info */ + short custom; /* custom data type, stylus, 6dof, see wm_event_types.h */ short customdatafree; + int pad2; + void *customdata; /* ascii, unicode, mouse coords, angles, vectors, dragdrop info */ } wmEvent; +typedef enum wmRadialControlMode { + WM_RADIALCONTROL_SIZE, + WM_RADIALCONTROL_STRENGTH, + WM_RADIALCONTROL_ANGLE +} wmRadialControlMode; + + #endif /* DNA_WINDOWMANAGER_TYPES_H */ diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index b4b029a19e5..628983ae879 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -616,8 +616,8 @@ static void cast_elem(char *ctype, char *otype, char *name, char *curdata, char arrlen= DNA_elem_array_size(name, strlen(name)); /* define otypenr */ - if(strcmp(otype, "char")==0) otypenr= 0; - else if((strcmp(otype, "uchar")==0)||(strcmp(otype, "unsigned char")==0)) otypenr= 1; + if(strcmp(otype, "char")==0 || (strcmp(otype, "const char")==0)) otypenr= 0; + else if((strcmp(otype, "uchar")==0) || (strcmp(otype, "unsigned char")==0)) otypenr= 1; else if(strcmp(otype, "short")==0) otypenr= 2; else if((strcmp(otype, "ushort")==0)||(strcmp(otype, "unsigned short")==0)) otypenr= 3; else if(strcmp(otype, "int")==0) otypenr= 4; @@ -629,6 +629,7 @@ static void cast_elem(char *ctype, char *otype, char *name, char *curdata, char /* define ctypenr */ if(strcmp(ctype, "char")==0) ctypenr= 0; + else if(strcmp(ctype, "const char")==0) ctypenr= 0; else if((strcmp(ctype, "uchar")==0)||(strcmp(ctype, "unsigned char")==0)) ctypenr= 1; else if(strcmp(ctype, "short")==0) ctypenr= 2; else if((strcmp(ctype, "ushort")==0)||(strcmp(ctype, "unsigned short")==0)) ctypenr= 3; diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 91e9e617ea9..08af6372d31 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -559,10 +559,11 @@ int convert_include(char *filename) while( *md1 != '}' ) { if(md1>mainend) break; - /* skip when it says 'struct' or 'unsigned' */ + /* skip when it says 'struct' or 'unsigned' or 'const' */ if(*md1) { if( strncmp(md1, "struct", 6)==0 ) md1+= 7; - if( strncmp(md1, "unsigned", 6)==0 ) md1+= 9; + if( strncmp(md1, "unsigned", 8)==0 ) md1+= 9; + if( strncmp(md1, "const", 5)==0 ) md1+= 6; /* we've got a type! */ type= add_type(md1, 0); -- cgit v1.2.3 From 5e659c0b0895e07351bd2b2425deea342141e515 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 9 Jul 2009 15:40:04 +0000 Subject: 2.5 Monthly cleaning round to make it compile warning free. Mostly it was const stuff (strings, Context), but also a couple useful fixes, like wrong use of temp pointers. Only Mathutils callback struct I left alone... design issue. --- source/blender/blenkernel/intern/cloth.c | 9 ++++-- source/blender/blenkernel/intern/packedFile.c | 2 -- source/blender/blenkernel/intern/particle.c | 8 ++--- source/blender/blenkernel/intern/particle_system.c | 6 ++-- source/blender/blenkernel/intern/pointcache.c | 12 +++---- source/blender/blenlib/intern/storage.c | 2 +- source/blender/blenlib/intern/util.c | 6 ++-- source/blender/editors/armature/BIF_retarget.h | 2 +- .../editors/armature/editarmature_retarget.c | 2 +- .../blender/editors/armature/editarmature_sketch.c | 18 +++++------ source/blender/editors/include/ED_armature.h | 14 ++++---- source/blender/editors/object/object_edit.c | 2 -- source/blender/editors/physics/ed_pointcache.c | 2 +- source/blender/editors/space_file/file_ops.c | 2 +- source/blender/editors/space_file/file_panels.c | 4 +-- source/blender/editors/space_file/filelist.c | 2 +- source/blender/editors/space_file/filelist.h | 2 +- .../editors/transform/transform_manipulator.c | 1 - .../editors/transform/transform_ndofinput.c | 10 +++--- source/blender/python/BPY_extern.h | 2 +- source/blender/python/generic/euler.c | 37 ++++++++++++++-------- source/blender/python/generic/quat.c | 24 +++++++++----- source/blender/python/generic/vector.c | 2 +- source/blender/python/intern/bpy_interface.c | 4 +-- source/blender/render/intern/source/zbuf.c | 30 ------------------ 25 files changed, 95 insertions(+), 110 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 08caea565aa..089dafeb8c7 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -341,24 +341,27 @@ void bvhselftree_update_from_cloth(ClothModifierData *clmd, int moving) } int modifiers_indexInObject(Object *ob, ModifierData *md_seek); -static void cloth_write_state(int index, Cloth *cloth, float *data) +static void cloth_write_state(int index, void *cloth_v, float *data) { + Cloth *cloth= cloth_v; ClothVertex *vert = cloth->verts + index; memcpy(data, vert->x, 3 * sizeof(float)); memcpy(data + 3, vert->xconst, 3 * sizeof(float)); memcpy(data + 6, vert->v, 3 * sizeof(float)); } -static void cloth_read_state(int index, Cloth *cloth, float *data) +static void cloth_read_state(int index, void *cloth_v, float *data) { + Cloth *cloth= cloth_v; ClothVertex *vert = cloth->verts + index; memcpy(vert->x, data, 3 * sizeof(float)); memcpy(vert->xconst, data + 3, 3 * sizeof(float)); memcpy(vert->v, data + 6, 3 * sizeof(float)); } -static void cloth_cache_interpolate(int index, Cloth *cloth, float frs_sec, float cfra, float cfra1, float cfra2, float *data1, float *data2) +static void cloth_cache_interpolate(int index, void *cloth_v, float frs_sec, float cfra, float cfra1, float cfra2, float *data1, float *data2) { + Cloth *cloth= cloth_v; ClothVertex *vert = cloth->verts + index; ParticleKey keys[4]; float dfra; diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 4d88556d8bf..02b0f6a45a0 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -377,8 +377,6 @@ there was an error or when the user desides to cancel the operation. char *unpackFile(ReportList *reports, char *abs_name, char *local_name, PackedFile *pf, int how) { - char menu[6 *(FILE_MAXDIR + FILE_MAXFILE + 100)]; - char line[FILE_MAXDIR + FILE_MAXFILE + 100]; char *newname = NULL, *temp = NULL; // char newabs[FILE_MAXDIR + FILE_MAXFILE]; diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 6ab8d72aa6d..4488f8cdffd 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -2008,10 +2008,10 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, ParticleTexture ptex; float *cpa_fuv=0, *par_rot=0; float co[3], orco[3], ornor[3], t, cpa_1st[3], dvec[3]; - float branch_begin, branch_end, branch_prob, branchfac, rough_rand; + float branch_begin, branch_end, branch_prob, rough_rand; float length, max_length = 1.0f, cur_length = 0.0f; float eff_length, eff_vec[3]; - int k, cpa_num, guided = 0; + int k, cpa_num; short cpa_from; if(part->flag & PART_BRANCHING) { @@ -2417,7 +2417,7 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra float nosel_col[3]; float length, vec[3]; float *vg_effector= NULL, effector=0.0f; - float *vg_length= NULL, pa_length=1.0f, max_length=1.0f, cur_length=0.0f; + float *vg_length= NULL, pa_length=1.0f; int keyed, baked; /* we don't have anything valid to create paths from so let's quit here */ @@ -3553,7 +3553,6 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i float t, real_t, dfra, keytime, frs_sec = scene->r.frs_sec; float co[3], orco[3]; float hairmat[4][4]; - float pa_clump = 0.0, pa_kink = 0.0; int totparent = 0; int totpart = psys->totpart; int totchild = psys->totchild; @@ -3800,7 +3799,6 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i Normalize(state->vel); } else{ - float length = VecLength(state->vel); tstate.time=t+0.001f; psys_get_particle_on_path(scene, ob,psys,p,&tstate,0); VECSUB(state->vel,tstate.co,state->co); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 92b919f6b0e..07e0e82a86d 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -2205,8 +2205,10 @@ void psys_get_pointcache_start_end(Scene *scene, ParticleSystem *psys, int *sfra *sfra = MAX2(1, (int)part->sta); *efra = MIN2((int)(part->end + part->lifetime + 1.0), scene->r.efra); } -static void particle_write_state(int index, ParticleSystem *psys, float *data) +static void particle_write_state(int index, void *psys_ptr, float *data) { + ParticleSystem *psys= psys_ptr; + memcpy(data, (float *)(&(psys->particles+index)->state), sizeof(ParticleKey)); } static void particle_read_state(int index, void *psys_ptr, float *data) @@ -2225,7 +2227,7 @@ static void particle_cache_interpolate(int index, void *psys_ptr, float frs_sec, ParticleSystem *psys= psys_ptr; ParticleData *pa = psys->particles + index; ParticleKey keys[4]; - float dfra, cfra1f = (float)cfra1, cfra2f(float); + float dfra; cfra = MIN2(cfra, pa->dietime); cfra1 = MIN2(cfra1, pa->dietime); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 2fbd0278e0e..2fe46be7a89 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -643,8 +643,8 @@ int BKE_ptcache_write_cache(PTCacheWriter *writer) return 0; for(i=0; itotelem; i++) { - writer->set_elem(i, writer->calldata, &temp); - BKE_ptcache_file_write_floats(pf, &temp, incr); + writer->set_elem(i, writer->calldata, temp); + BKE_ptcache_file_write_floats(pf, temp, incr); } } } @@ -677,8 +677,8 @@ int BKE_ptcache_write_cache(PTCacheWriter *writer) pmdata = pm->data; for(i=0; itotelem; i++, pmdata+=incr) { - writer->set_elem(i, writer->calldata, &temp); - memcpy(pmdata, &temp, elemsize); + writer->set_elem(i, writer->calldata, temp); + memcpy(pmdata, temp, elemsize); } pm->frame = writer->cfra; @@ -689,8 +689,8 @@ int BKE_ptcache_write_cache(PTCacheWriter *writer) pmdata = pm->data; for(i=0; itotelem; i++, pmdata+=incr) { - writer->set_elem(i, writer->calldata, &temp); - memcpy(pmdata, &temp, elemsize); + writer->set_elem(i, writer->calldata, temp); + memcpy(pmdata, temp, elemsize); } pm->frame = writer->cfra; diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 3204d5f74e1..7af383e2356 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -218,7 +218,7 @@ void BLI_builddir(char *dirname, char *relname) { struct dirent *fname; struct dirlink *dlink; - int rellen, newnum = 0, ignore; + int rellen, newnum = 0; char buf[256]; DIR *dir; diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index b9d4daaf5b2..838648ebfd7 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -738,9 +738,9 @@ void BLI_splitdirstring(char *di, char *fi) void BLI_getlastdir(const char* dir, char *last, int maxlen) { - char *s = dir; - char *lslash = NULL; - char *prevslash = NULL; + const char *s = dir; + const char *lslash = NULL; + const char *prevslash = NULL; while (*s) { if ((*s == '\\') || (*s == '/')) { prevslash = lslash; diff --git a/source/blender/editors/armature/BIF_retarget.h b/source/blender/editors/armature/BIF_retarget.h index c39f410424a..d950f073cf0 100644 --- a/source/blender/editors/armature/BIF_retarget.h +++ b/source/blender/editors/armature/BIF_retarget.h @@ -152,7 +152,7 @@ typedef struct RigControl { } RigControl; void BIF_retargetArc(struct bContext *C, ReebArc *earc, RigGraph *template_rigg); -RigGraph *RIG_graphFromArmature(struct bContext *C, struct Object *ob, struct bArmature *arm); +RigGraph *RIG_graphFromArmature(const struct bContext *C, struct Object *ob, struct bArmature *arm); int RIG_nbJoints(RigGraph *rg); char *RIG_nameBone(RigGraph *rg, int arc_index, int bone_index); void RIG_freeRigGraph(BGraph *rg); diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index 68e8b45e7d2..6f5692dbf4c 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -1538,7 +1538,7 @@ void RIG_printGraph(RigGraph *rg) /*******************************************************************************************************/ -RigGraph *RIG_graphFromArmature(bContext *C, Object *ob, bArmature *arm) +RigGraph *RIG_graphFromArmature(const bContext *C, Object *ob, bArmature *arm) { Object *obedit = CTX_data_edit_object(C); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 6e6e61dafc2..33351c99828 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -242,7 +242,7 @@ int TEMPLATES_CURRENT = 0; GHash *TEMPLATES_HASH = NULL; RigGraph *TEMPLATE_RIGG = NULL; -void BIF_makeListTemplates(bContext *C) +void BIF_makeListTemplates(const bContext *C) { Object *obedit = CTX_data_edit_object(C); Scene *scene = CTX_data_scene(C); @@ -275,7 +275,7 @@ void BIF_makeListTemplates(bContext *C) } } -char *BIF_listTemplates(bContext *C) +char *BIF_listTemplates(const bContext *C) { GHashIterator ghi; char menu_header[] = "Template%t|None%x0|"; @@ -307,7 +307,7 @@ char *BIF_listTemplates(bContext *C) return TEMPLATES_MENU; } -int BIF_currentTemplate(bContext *C) +int BIF_currentTemplate(const bContext *C) { ToolSettings *ts = CTX_data_tool_settings(C); @@ -334,7 +334,7 @@ int BIF_currentTemplate(bContext *C) return TEMPLATES_CURRENT; } -RigGraph* sk_makeTemplateGraph(bContext *C, Object *ob) +RigGraph* sk_makeTemplateGraph(const bContext *C, Object *ob) { Object *obedit = CTX_data_edit_object(C); if (ob == obedit) @@ -363,7 +363,7 @@ RigGraph* sk_makeTemplateGraph(bContext *C, Object *ob) return TEMPLATE_RIGG; } -int BIF_nbJointsTemplate(bContext *C) +int BIF_nbJointsTemplate(const bContext *C) { ToolSettings *ts = CTX_data_tool_settings(C); RigGraph *rg = sk_makeTemplateGraph(C, ts->skgen_template); @@ -378,7 +378,7 @@ int BIF_nbJointsTemplate(bContext *C) } } -char * BIF_nameBoneTemplate(bContext *C) +char * BIF_nameBoneTemplate(const bContext *C) { ToolSettings *ts = CTX_data_tool_settings(C); SK_Sketch *stk = GLOBAL_sketch; @@ -3033,7 +3033,7 @@ int BDR_drawSketchNames(ViewContext *vc) return 0; } -void BDR_drawSketch(bContext *C) +void BDR_drawSketch(const bContext *C) { if (ED_operator_sketch_mode(C)) { @@ -3351,7 +3351,7 @@ int ED_operator_sketch_full_mode(bContext *C) } } -int ED_operator_sketch_mode(bContext *C) +int ED_operator_sketch_mode(const bContext *C) { Object *obedit = CTX_data_edit_object(C); ToolSettings *ts = CTX_data_tool_settings(C); @@ -3458,7 +3458,7 @@ void SKETCH_OT_draw_stroke(wmOperatorType *ot) ot->modal = sketch_draw_stroke_modal; ot->cancel = sketch_draw_stroke_cancel; - ot->poll= ED_operator_sketch_mode; + ot->poll= (int (*)(bContext *))ED_operator_sketch_mode; RNA_def_boolean(ot->srna, "snap", 0, "Snap", ""); diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index f28dbe2a619..1df9182fc9b 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -128,22 +128,22 @@ void ED_pose_deselectall(struct Object *ob, int test, int doundo); int ED_operator_sketch_mode_active_stroke(struct bContext *C); int ED_operator_sketch_full_mode(struct bContext *C); -int ED_operator_sketch_mode(struct bContext *C); +int ED_operator_sketch_mode(const struct bContext *C); void BIF_freeSketch(struct bContext *C); void BIF_convertSketch(struct bContext *C); void BIF_deleteSketch(struct bContext *C); void BIF_selectAllSketch(struct bContext *C, int mode); /* -1: deselect, 0: select, 1: toggle */ -void BIF_makeListTemplates(struct bContext *C); -char *BIF_listTemplates(struct bContext *C); -int BIF_currentTemplate(struct bContext *C); +void BIF_makeListTemplates(const struct bContext *C); +char *BIF_listTemplates(const struct bContext *C); +int BIF_currentTemplate(const struct bContext *C); void BIF_freeTemplates(struct bContext *C); void BIF_setTemplate(struct bContext *C, int index); -int BIF_nbJointsTemplate(struct bContext *C); -char * BIF_nameBoneTemplate(struct bContext *C); +int BIF_nbJointsTemplate(const struct bContext *C); +char * BIF_nameBoneTemplate(const struct bContext *C); -void BDR_drawSketch(struct bContext *vc); +void BDR_drawSketch(const struct bContext *vc); int BDR_drawSketchNames(struct ViewContext *vc); #endif /* ED_ARMATURE_H */ diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 6a5b743056a..11f6b443912 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -3581,9 +3581,7 @@ void special_editmenu(Scene *scene, View3D *v3d) // XXX static short numcuts= 2; Object *ob= OBACT; Object *obedit= NULL; // XXX - float fac; int nr,ret=0; - short randfac; if(ob==NULL) return; diff --git a/source/blender/editors/physics/ed_pointcache.c b/source/blender/editors/physics/ed_pointcache.c index ad60be3ba7d..4bf6612df67 100644 --- a/source/blender/editors/physics/ed_pointcache.c +++ b/source/blender/editors/physics/ed_pointcache.c @@ -177,7 +177,7 @@ static int ptcache_bake_cloth_exec(bContext *C, wmOperator *op) baker.quick_step = 1; baker.break_test = cache_break_test; baker.break_data = NULL; - baker.progressbar = WM_timecursor; + baker.progressbar = (void (*)(void *, int))WM_timecursor; baker.progresscontext = CTX_wm_window(C); BKE_ptcache_make_cache(&baker); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index bb56ec94d7b..9f703a9802b 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -358,9 +358,9 @@ void FILE_OT_add_bookmark(wmOperatorType *ot) static int bookmark_delete_invoke(bContext *C, wmOperator *op, wmEvent *event) { ScrArea *sa= CTX_wm_area(C); - SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); struct FSMenu* fsmenu = fsmenu_get(); int nentries = fsmenu_get_nentries(fsmenu, FS_CATEGORY_BOOKMARKS); + if(RNA_struct_find_property(op->ptr, "index")) { int index = RNA_int_get(op->ptr, "index"); if ( (index >-1) && (index < nentries)) { diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 29c759d43c0..72a4133fe75 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -57,11 +57,9 @@ static void do_file_panel_events(bContext *C, void *arg, int event) static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory category, int icon, int allow_delete) { uiBlock *block; - uiStyle *style= U.uistyles.first; - int i; - int fontsize = file_font_pointsize(); struct FSMenu* fsmenu = fsmenu_get(); int nentries = fsmenu_get_nentries(fsmenu, category); + int i; uiLayoutSetAlignment(pa->layout, UI_LAYOUT_ALIGN_LEFT); block= uiLayoutFreeBlock(pa->layout); diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index ab5dac1a727..6e442c654ca 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -367,7 +367,7 @@ struct ListBase* folderlist_new() return p; } -void folderlist_popdir(struct ListBase* folderlist, const char *dir) +void folderlist_popdir(struct ListBase* folderlist, char *dir) { const char *prev_dir; struct FolderList *folder; diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h index 0f8db98b7ab..dd3c2c766c1 100644 --- a/source/blender/editors/space_file/filelist.h +++ b/source/blender/editors/space_file/filelist.h @@ -73,7 +73,7 @@ void filelist_setfiletypes(struct FileList* filelist, short has_quicktime); struct ListBase * folderlist_new(); void folderlist_free(struct ListBase* folderlist); -void folderlist_popdir(struct ListBase* folderlist, const char *dir); +void folderlist_popdir(struct ListBase* folderlist, char *dir); void folderlist_pushdir(struct ListBase* folderlist, const char *dir); int folderlist_clear_next(struct SpaceFile* sfile); diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index c4cca6eba07..7c71e89f948 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1603,7 +1603,6 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op) ScrArea *sa= CTX_wm_area(C); View3D *v3d= sa->spacedata.first; ARegion *ar= CTX_wm_region(C); - RegionView3D *rv3d= ar->regiondata; int constraint_axis[3] = {0, 0, 0}; int val; int shift = event->shift; diff --git a/source/blender/editors/transform/transform_ndofinput.c b/source/blender/editors/transform/transform_ndofinput.c index 9c2a1a7db6d..f8567023e5f 100644 --- a/source/blender/editors/transform/transform_ndofinput.c +++ b/source/blender/editors/transform/transform_ndofinput.c @@ -37,7 +37,9 @@ #include "transform.h" +#if 0 static int updateNDofMotion(NDofInput *n); // return 0 when motion is null +#endif static void resetNDofInput(NDofInput *n); void initNDofInput(NDofInput *n) @@ -121,6 +123,8 @@ void applyNDofInput(NDofInput *n, float *vec) } } +// TRANSFORM_FIX_ME +#if 0 static int updateNDofMotion(NDofInput *n) { @@ -128,14 +132,11 @@ static int updateNDofMotion(NDofInput *n) int i; int retval = 0; -// TRANSFORM_FIX_ME -#if 0 getndof(fval); if (G.vd->ndoffilter) filterNDOFvalues(fval); -#endif - + for(i = 0; i < 6; i++) { if (!retval && fval[i] != 0.0f) @@ -150,6 +151,7 @@ static int updateNDofMotion(NDofInput *n) return retval; } +#endif diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h index d141a585378..c6972793372 100644 --- a/source/blender/python/BPY_extern.h +++ b/source/blender/python/BPY_extern.h @@ -100,7 +100,7 @@ extern "C" { /* 2.5 UI Scripts */ int BPY_run_python_script( struct bContext *C, const char *filename, struct Text *text, struct ReportList *reports ); // 2.5 working - int BPY_run_script_space_draw(struct bContext *C, struct SpaceScript * sc); // 2.5 working + int BPY_run_script_space_draw(const struct bContext *C, struct SpaceScript * sc); // 2.5 working void BPY_run_ui_scripts(struct bContext *C, int reload); // int BPY_run_script_space_listener(struct bContext *C, struct SpaceScript * sc, struct ARegion *ar, struct wmNotifier *wmn); // 2.5 working void BPY_update_modules( void ); // XXX - annoying, need this for pointers that get out of date diff --git a/source/blender/python/generic/euler.c b/source/blender/python/generic/euler.c index 1e0632f4040..69373b1aa36 100644 --- a/source/blender/python/generic/euler.c +++ b/source/blender/python/generic/euler.c @@ -134,18 +134,21 @@ static PyObject *Euler_ToQuat(EulerObject * self) //return a matrix representation of the euler static PyObject *Euler_ToMatrix(EulerObject * self) { - float eul[3]; float mat[9] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}; - int x; if(!BaseMath_ReadCallback(self)) return NULL; #ifdef USE_MATHUTILS_DEG - for(x = 0; x < 3; x++) { - eul[x] = self->eul[x] * ((float)Py_PI / 180); + { + float eul[3]; + int x; + + for(x = 0; x < 3; x++) { + eul[x] = self->eul[x] * ((float)Py_PI / 180); + } + EulToMat3(eul, (float (*)[3]) mat); } - EulToMat3(eul, (float (*)[3]) mat); #else EulToMat3(self->eul, (float (*)[3]) mat); #endif @@ -234,7 +237,6 @@ static PyObject *Euler_Rotate(EulerObject * self, PyObject *args) { float angle = 0.0f; char *axis; - int x; if(!PyArg_ParseTuple(args, "fs", &angle, &axis)){ PyErr_SetString(PyExc_TypeError, "euler.rotate():expected angle (float) and axis (x,y,z)"); @@ -249,18 +251,25 @@ static PyObject *Euler_Rotate(EulerObject * self, PyObject *args) return NULL; #ifdef USE_MATHUTILS_DEG - //covert to radians - angle *= ((float)Py_PI / 180); - for(x = 0; x < 3; x++) { - self->eul[x] *= ((float)Py_PI / 180); + { + int x; + + //covert to radians + angle *= ((float)Py_PI / 180); + for(x = 0; x < 3; x++) { + self->eul[x] *= ((float)Py_PI / 180); + } } #endif euler_rot(self->eul, angle, *axis); #ifdef USE_MATHUTILS_DEG - //convert back from radians - for(x = 0; x < 3; x++) { - self->eul[x] *= (180 / (float)Py_PI); + { + int x; + //convert back from radians + for(x = 0; x < 3; x++) { + self->eul[x] *= (180 / (float)Py_PI); + } } #endif @@ -602,7 +611,7 @@ PyObject *newEulerObject(float *eul, int type, PyTypeObject *base_type) EulerObject *self; int x; - if(base_type) self = base_type->tp_alloc(base_type, 0); + if(base_type) self = (EulerObject *)base_type->tp_alloc(base_type, 0); else self = PyObject_NEW(EulerObject, &euler_Type); /* init callbacks as NULL */ diff --git a/source/blender/python/generic/quat.c b/source/blender/python/generic/quat.c index 81d69834469..a353f73c854 100644 --- a/source/blender/python/generic/quat.c +++ b/source/blender/python/generic/quat.c @@ -167,7 +167,6 @@ static PyObject *Quaternion_ToEuler(QuaternionObject * self, PyObject *args) { float eul[3]; EulerObject *eul_compat = NULL; - int x; if(!PyArg_ParseTuple(args, "|O!:toEuler", &euler_Type, &eul_compat)) return NULL; @@ -176,7 +175,7 @@ static PyObject *Quaternion_ToEuler(QuaternionObject * self, PyObject *args) return NULL; if(eul_compat) { - float mat[3][3], eul_compatf[3]; + float mat[3][3]; if(!BaseMath_ReadCallback(eul_compat)) return NULL; @@ -184,10 +183,15 @@ static PyObject *Quaternion_ToEuler(QuaternionObject * self, PyObject *args) QuatToMat3(self->quat, mat); #ifdef USE_MATHUTILS_DEG - for(x = 0; x < 3; x++) { - eul_compatf[x] = eul_compat->eul[x] * ((float)Py_PI / 180); + { + float eul_compatf[3]; + int x; + + for(x = 0; x < 3; x++) { + eul_compatf[x] = eul_compat->eul[x] * ((float)Py_PI / 180); + } + Mat3ToCompatibleEul(mat, eul, eul_compatf); } - Mat3ToCompatibleEul(mat, eul, eul_compatf); #else Mat3ToCompatibleEul(mat, eul, eul_compat->eul); #endif @@ -197,8 +201,12 @@ static PyObject *Quaternion_ToEuler(QuaternionObject * self, PyObject *args) } #ifdef USE_MATHUTILS_DEG - for(x = 0; x < 3; x++) { - eul[x] *= (180 / (float)Py_PI); + { + int x; + + for(x = 0; x < 3; x++) { + eul[x] *= (180 / (float)Py_PI); + } } #endif return newEulerObject(eul, Py_NEW, NULL); @@ -833,7 +841,7 @@ PyObject *newQuaternionObject(float *quat, int type, PyTypeObject *base_type) { QuaternionObject *self; - if(base_type) self = base_type->tp_alloc(base_type, 0); + if(base_type) self = (QuaternionObject *)base_type->tp_alloc(base_type, 0); else self = PyObject_NEW(QuaternionObject, &quaternion_Type); /* init callbacks as NULL */ diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index b4c74787e05..cf2396b30d4 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -1973,7 +1973,7 @@ PyObject *newVectorObject(float *vec, int size, int type, PyTypeObject *base_typ int i; VectorObject *self; - if(base_type) self = base_type->tp_alloc(base_type, 0); + if(base_type) self = (VectorObject *)base_type->tp_alloc(base_type, 0); else self = PyObject_NEW(VectorObject, &vector_Type); if(size > 4 || size < 2) diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 76c27dbbc22..42eb9c4c57a 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -351,9 +351,9 @@ static int bpy_run_script_init(bContext *C, SpaceScript * sc) return 1; } -int BPY_run_script_space_draw(struct bContext *C, SpaceScript * sc) +int BPY_run_script_space_draw(const struct bContext *C, SpaceScript * sc) { - if (bpy_run_script_init(C, sc)) { + if (bpy_run_script_init( (bContext *)C, sc)) { PyGILState_STATE gilstate = PyGILState_Ensure(); PyObject *result = PyObject_CallObject( sc->script->py_draw, NULL ); diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 21c3977fc0b..0d8f1be8c85 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -2269,36 +2269,6 @@ void zbuffer_solid(RenderPart *pa, RenderLayer *rl, void(*fillfunc)(RenderPart*, } } -typedef struct { - float *vert; - float hoco[4]; - int clip; -} VertBucket; - -/* warning, not threaded! */ -static int hashlist_projectvert(float *v1, float winmat[][4], float *hoco) -{ - static VertBucket bucket[256], *buck; - - /* init static bucket */ - if(v1==NULL) { - memset(bucket, 0, 256*sizeof(VertBucket)); - return 0; - } - - buck= &bucket[ (((intptr_t)v1)/16) & 255 ]; - if(buck->vert==v1) { - QUATCOPY(hoco, buck->hoco); - return buck->clip; - } - - projectvert(v1, winmat, hoco); - buck->clip = testclip(hoco); - buck->vert= v1; - QUATCOPY(buck->hoco, hoco); - return buck->clip; -} - void zbuffer_shadow(Render *re, float winmat[][4], LampRen *lar, int *rectz, int size, float jitx, float jity) { ZbufProjectCache cache[ZBUF_PROJECT_CACHE_SIZE]; -- cgit v1.2.3 From b00409e72d04fe9e710c25fb4f076d1e960328dc Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 9 Jul 2009 16:05:01 +0000 Subject: 2.5: X11 * Pass on mouse location on window leave/enter too, fixing some issues with button highlights and tooltips. * When a modal operator runs, grab the mouse cursor so that for example transform still works when you move your mouse outside of the window, previously it would just stop then. This is automatic now for all modal ops, perhaps not always needed? * Fix for a trailing button highlight issue. --- source/blender/editors/interface/interface_handlers.c | 3 +-- source/blender/windowmanager/WM_api.h | 1 + source/blender/windowmanager/intern/wm_cursors.c | 5 +++++ source/blender/windowmanager/intern/wm_event_system.c | 10 ++++++++-- 4 files changed, 15 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 7ad422ef3b5..ee86b612332 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3775,8 +3775,7 @@ static void ui_handle_button_return_submenu(bContext *C, wmEvent *event, uiBut * button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); } else { - but= ui_but_find_activated(data->region); - if(but) { + if(event->type != MOUSEMOVE) { but->active->used_mouse= 0; button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); } diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index ff3a2feb521..7fe98488ec0 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -65,6 +65,7 @@ void WM_cursor_set (struct wmWindow *win, int curs); void WM_cursor_modal (struct wmWindow *win, int curs); void WM_cursor_restore (struct wmWindow *win); void WM_cursor_wait (int val); +void WM_cursor_grab (struct wmWindow *win, int val); void WM_timecursor (struct wmWindow *win, int nr); void *WM_paint_cursor_activate(struct wmWindowManager *wm, int (*poll)(struct bContext *C), void (*draw)(struct bContext *C, int, int, void *customdata), void *customdata); diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index 9b64ad6d38c..5ddd8f5a1a9 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -156,6 +156,11 @@ void WM_cursor_wait(int val) } } +void WM_cursor_grab(wmWindow *win, int val) +{ + GHOST_SetCursorGrab(win->ghostwin, val); +} + /* afer this you can call restore too */ void WM_timecursor(wmWindow *win, int nr) { diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index b5d51ef650b..5bcbf526460 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -378,9 +378,12 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P else WM_operator_free(op); } - else if(!(retval & OPERATOR_RUNNING_MODAL)) { - WM_operator_free(op); + else if(retval & OPERATOR_RUNNING_MODAL) { + /* automatically grab cursor during modal ops (X11) */ + WM_cursor_grab(CTX_wm_window(C), 1); } + else + WM_operator_free(op); } return retval; @@ -548,6 +551,7 @@ void WM_event_remove_handlers(bContext *C, ListBase *handlers) } WM_operator_free(handler->op); + WM_cursor_grab(CTX_wm_window(C), 0); } else if(handler->ui_remove) { ScrArea *area= CTX_wm_area(C); @@ -704,6 +708,8 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand /* remove modal handler, operator itself should have been cancelled and freed */ if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) { + WM_cursor_grab(CTX_wm_window(C), 0); + BLI_remlink(handlers, handler); wm_event_free_handler(handler); -- cgit v1.2.3 From d091856486cffc4351d6ded86de3c33afb3155b4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 9 Jul 2009 19:45:27 +0000 Subject: 2.5: Buttons Window * Fix poll() callback changes in recent commit, note that these have to work with pinned context too. * Hide header for context panels in py layout. * Don't jump back when collapsing a panel, allow the view to be over some empty space until you scroll back. * Fix follow context icon, order had to be reversed in icon file. * ID template now has icon as part of browse button instead of outside the buttons. --- source/blender/editors/datafiles/blenderbuttons.c | 11029 +++++++++---------- .../blender/editors/interface/interface_layout.c | 2 +- source/blender/editors/interface/interface_panel.c | 14 +- .../editors/interface/interface_templates.c | 12 +- source/blender/editors/screen/area.c | 14 +- .../editors/space_buttons/buttons_context.c | 2 +- source/blender/editors/space_buttons/buttons_ops.c | 1 + 7 files changed, 5530 insertions(+), 5544 deletions(-) (limited to 'source') diff --git a/source/blender/editors/datafiles/blenderbuttons.c b/source/blender/editors/datafiles/blenderbuttons.c index fa000034caf..d2668d21e52 100644 --- a/source/blender/editors/datafiles/blenderbuttons.c +++ b/source/blender/editors/datafiles/blenderbuttons.c @@ -1,5538 +1,5501 @@ /* DataToC output of file */ -int datatoc_blenderbuttons_size= 177005; +int datatoc_blenderbuttons_size= 175808; char datatoc_blenderbuttons[]= { -137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, - 72, 68, 82, 0, 0, 2, 88, 0, 0, 2,128, 8, 6, 0, 0, 0, 64, 11, 6,158, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 13,215, - 0, 0, 13,215, 1, 66, 40,155,120, 0, 0, 10, 79,105, 67, 67, 80, 80,104,111,116,111,115,104,111,112, 32, 73, 67, 67, 32,112, -114,111,102,105,108,101, 0, 0,120,218,157, 83,103, 84, 83,233, 22, 61,247,222,244, 66, 75,136,128,148, 75,111, 82, 21, 8, 32, - 82, 66,139,128, 20,145, 38, 42, 33, 9, 16, 74,136, 33,161,217, 21, 81,193, 17, 69, 69, 4, 27,200,160,136, 3,142,142,128,140, - 21, 81, 44, 12,138, 10,216, 7,228, 33,162,142,131,163,136,138,202,251,225,123,163,107,214,188,247,230,205,254,181,215, 62,231, -172,243,157,179,207, 7,192, 8, 12,150, 72, 51, 81, 53,128, 12,169, 66, 30, 17,224,131,199,196,198,225,228, 46, 64,129, 10, 36, -112, 0, 16, 8,179,100, 33,115,253, 35, 1, 0,248,126, 60, 60, 43, 34,192, 7,190, 0, 1,120,211, 11, 8, 0,192, 77,155,192, - 48, 28,135,255, 15,234, 66,153, 92, 1,128,132, 1,192,116,145, 56, 75, 8,128, 20, 0, 64,122,142, 66,166, 0, 64, 70, 1,128, -157,152, 38, 83, 0,160, 4, 0, 96,203, 99, 98,227, 0, 80, 45, 0, 96, 39,127,230,211, 0,128,157,248,153,123, 1, 0, 91,148, - 33, 21, 1,160,145, 0, 32, 19,101,136, 68, 0,104, 59, 0,172,207, 86,138, 69, 0, 88, 48, 0, 20,102, 75,196, 57, 0,216, 45, - 0, 48, 73, 87,102, 72, 0,176,183, 0,192,206, 16, 11,178, 0, 8, 12, 0, 48, 81,136,133, 41, 0, 4,123, 0, 96,200, 35, 35, -120, 0,132,153, 0, 20, 70,242, 87, 60,241, 43,174, 16,231, 42, 0, 0,120,153,178, 60,185, 36, 57, 69,129, 91, 8, 45,113, 7, - 87, 87, 46, 30, 40,206, 73, 23, 43, 20, 54, 97, 2, 97,154, 64, 46,194,121,153, 25, 50,129, 52, 15,224,243,204, 0, 0,160,145, - 21, 17,224,131,243,253,120,206, 14,174,206,206, 54,142,182, 14, 95, 45,234,191, 6,255, 34, 98, 98,227,254,229,207,171,112, 64, - 0, 0,225,116,126,209,254, 44, 47,179, 26,128, 59, 6,128,109,254,162, 37,238, 4,104, 94, 11,160,117,247,139,102,178, 15, 64, -181, 0,160,233,218, 87,243,112,248,126, 60, 60, 69,161,144,185,217,217,229,228,228,216, 74,196, 66, 91, 97,202, 87,125,254,103, -194, 95,192, 87,253,108,249,126, 60,252,247,245,224,190,226, 36,129, 50, 93,129, 71, 4,248,224,194,204,244, 76,165, 28,207,146, - 9,132, 98,220,230,143, 71,252,183, 11,255,252, 29,211, 34,196, 73, 98,185, 88, 42, 20,227, 81, 18,113,142, 68,154,140,243, 50, -165, 34,137, 66,146, 41,197, 37,210,255,100,226,223, 44,251, 3, 62,223, 53, 0,176,106, 62, 1,123,145, 45,168, 93, 99, 3,246, - 75, 39, 16, 88,116,192,226,247, 0, 0,242,187,111,193,212, 40, 8, 3,128,104,131,225,207,119,255,239, 63,253, 71,160, 37, 0, -128,102, 73,146,113, 0, 0, 94, 68, 36, 46, 84,202,179, 63,199, 8, 0, 0, 68,160,129, 42,176, 65, 27,244,193, 24, 44,192, 6, - 28,193, 5,220,193, 11,252, 96, 54,132, 66, 36,196,194, 66, 16, 66, 10,100,128, 28,114, 96, 41,172,130, 66, 40,134,205,176, 29, - 42, 96, 47,212, 64, 29, 52,192, 81,104,134,147,112, 14, 46,194, 85,184, 14, 61,112, 15,250, 97, 8,158,193, 40,188,129, 9, 4, - 65,200, 8, 19, 97, 33,218,136, 1, 98,138, 88, 35,142, 8, 23,153,133,248, 33,193, 72, 4, 18,139, 36, 32,201,136, 20, 81, 34, - 75,145, 53, 72, 49, 82,138, 84, 32, 85, 72, 29,242, 61,114, 2, 57,135, 92, 70,186,145, 59,200, 0, 50,130,252,134,188, 71, 49, -148,129,178, 81, 61,212, 12,181, 67,185,168, 55, 26,132, 70,162, 11,208,100,116, 49,154,143, 22,160,155,208,114,180, 26, 61,140, - 54,161,231,208,171,104, 15,218,143, 62, 67,199, 48,192,232, 24, 7, 51,196,108, 48, 46,198,195, 66,177, 56, 44, 9,147, 99,203, -177, 34,172, 12,171,198, 26,176, 86,172, 3,187,137,245, 99,207,177,119, 4, 18,129, 69,192, 9, 54, 4,119, 66, 32, 97, 30, 65, - 72, 88, 76, 88, 78,216, 72,168, 32, 28, 36, 52, 17,218, 9, 55, 9, 3,132, 81,194, 39, 34,147,168, 75,180, 38,186, 17,249,196, - 24, 98, 50, 49,135, 88, 72, 44, 35,214, 18,143, 19, 47, 16,123,136, 67,196, 55, 36, 18,137, 67, 50, 39,185,144, 2, 73,177,164, - 84,210, 18,210, 70,210,110, 82, 35,233, 44,169,155, 52, 72, 26, 35,147,201,218,100,107,178, 7, 57,148, 44, 32, 43,200,133,228, -157,228,195,228, 51,228, 27,228, 33,242, 91, 10,157, 98, 64,113,164,248, 83,226, 40, 82,202,106, 74, 25,229, 16,229, 52,229, 6, -101,152, 50, 65, 85,163,154, 82,221,168,161, 84, 17, 53,143, 90, 66,173,161,182, 82,175, 81,135,168, 19, 52,117,154, 57,205,131, - 22, 73, 75,165,173,162,149,211, 26,104, 23,104,247,105,175,232,116,186, 17,221,149, 30, 78,151,208, 87,210,203,233, 71,232,151, -232, 3,244,119, 12, 13,134, 21,131,199,136,103, 40, 25,155, 24, 7, 24,103, 25,119, 24,175,152, 76,166, 25,211,139, 25,199, 84, - 48, 55, 49,235,152,231,153, 15,153,111, 85, 88, 42,182, 42,124, 21,145,202, 10,149, 74,149, 38,149, 27, 42, 47, 84,169,170,166, -170,222,170, 11, 85,243, 85,203, 84,143,169, 94, 83,125,174, 70, 85, 51, 83,227,169, 9,212,150,171, 85,170,157, 80,235, 83, 27, - 83,103,169, 59,168,135,170,103,168,111, 84, 63,164,126, 89,253,137, 6, 89,195, 76,195, 79, 67,164, 81,160,177, 95,227,188,198, - 32, 11, 99, 25,179,120, 44, 33,107, 13,171,134,117,129, 53,196, 38,177,205,217,124,118, 42,187,152,253, 29,187,139, 61,170,169, -161, 57, 67, 51, 74, 51, 87,179, 82,243,148,102, 63, 7,227,152,113,248,156,116, 78, 9,231, 40,167,151,243,126,138,222, 20,239, - 41,226, 41, 27,166, 52, 76,185, 49,101, 92,107,170,150,151,150, 88,171, 72,171, 81,171, 71,235,189, 54,174,237,167,157,166,189, - 69,187, 89,251,129, 14, 65,199, 74, 39, 92, 39, 71,103,143,206, 5,157,231, 83,217, 83,221,167, 10,167, 22, 77, 61, 58,245,174, - 46,170,107,165, 27,161,187, 68,119,191,110,167,238,152,158,190, 94,128,158, 76,111,167,222,121,189,231,250, 28,125, 47,253, 84, -253,109,250,167,245, 71, 12, 88, 6,179, 12, 36, 6,219, 12,206, 24, 60,197, 53,113,111, 60, 29, 47,199,219,241, 81, 67, 93,195, - 64, 67,165, 97,149, 97,151,225,132,145,185,209, 60,163,213, 70,141, 70, 15,140,105,198, 92,227, 36,227,109,198,109,198,163, 38, - 6, 38, 33, 38, 75, 77,234, 77,238,154, 82, 77,185,166, 41,166, 59, 76, 59, 76,199,205,204,205,162,205,214,153, 53,155, 61, 49, -215, 50,231,155,231,155,215,155,223,183, 96, 90,120, 90, 44,182,168,182,184,101, 73,178,228, 90,166, 89,238,182,188,110,133, 90, - 57, 89,165, 88, 85, 90, 93,179, 70,173,157,173, 37,214,187,173,187,167, 17,167,185, 78,147, 78,171,158,214,103,195,176,241,182, -201,182,169,183, 25,176,229,216, 6,219,174,182,109,182,125, 97,103, 98, 23,103,183,197,174,195,238,147,189,147,125,186,125,141, -253, 61, 7, 13,135,217, 14,171, 29, 90, 29,126,115,180,114, 20, 58, 86, 58,222,154,206,156,238, 63,125,197,244,150,233, 47,103, - 88,207, 16,207,216, 51,227,182, 19,203, 41,196,105,157, 83,155,211, 71,103, 23,103,185,115,131,243,136,139,137, 75,130,203, 46, -151, 62, 46,155, 27,198,221,200,189,228, 74,116,245,113, 93,225,122,210,245,157,155,179,155,194,237,168,219,175,238, 54,238,105, -238,135,220,159,204, 52,159, 41,158, 89, 51,115,208,195,200, 67,224, 81,229,209, 63, 11,159,149, 48,107,223,172,126, 79, 67, 79, -129,103,181,231, 35, 47, 99, 47,145, 87,173,215,176,183,165,119,170,247, 97,239, 23, 62,246, 62,114,159,227, 62,227, 60, 55,222, - 50,222, 89, 95,204, 55,192,183,200,183,203, 79,195,111,158, 95,133,223, 67,127, 35,255,100,255,122,255,209, 0,167,128, 37, 1, -103, 3,137,129, 65,129, 91, 2,251,248,122,124, 33,191,142, 63, 58,219,101,246,178,217,237, 65,140,160,185, 65, 21, 65,143,130, -173,130,229,193,173, 33,104,200,236,144,173, 33,247,231,152,206,145,206,105, 14,133, 80,126,232,214,208, 7, 97,230, 97,139,195, -126, 12, 39,133,135,133, 87,134, 63,142,112,136, 88, 26,209, 49,151, 53,119,209,220, 67,115,223, 68,250, 68,150, 68,222,155,103, - 49, 79, 57,175, 45, 74, 53, 42, 62,170, 46,106, 60,218, 55,186, 52,186, 63,198, 46,102, 89,204,213, 88,157, 88, 73,108, 75, 28, - 57, 46, 42,174, 54,110,108,190,223,252,237,243,135,226,157,226, 11,227,123, 23,152, 47,200, 93,112,121,161,206,194,244,133,167, - 22,169, 46, 18, 44, 58,150, 64, 76,136, 78, 56,148,240, 65, 16, 42,168, 22,140, 37,242, 19,119, 37,142, 10,121,194, 29,194,103, - 34, 47,209, 54,209,136,216, 67, 92, 42, 30, 78,242, 72, 42, 77,122,146,236,145,188, 53,121, 36,197, 51,165, 44,229,185,132, 39, -169,144,188, 76, 13, 76,221,155, 58,158, 22,154,118, 32,109, 50, 61, 58,189, 49,131,146,145,144,113, 66,170, 33, 77,147,182,103, -234,103,230,102,118,203,172,101,133,178,254,197,110,139,183, 47, 30,149, 7,201,107,179,144,172, 5, 89, 45, 10,182, 66,166,232, - 84, 90, 40,215, 42, 7,178,103,101, 87,102,191,205,137,202, 57,150,171,158, 43,205,237,204,179,202,219,144, 55,156,239,159,255, -237, 18,194, 18,225,146,182,165,134, 75, 87, 45, 29, 88,230,189,172,106, 57,178, 60,113,121,219, 10,227, 21, 5, 43,134, 86, 6, -172, 60,184,138,182, 42,109,213, 79,171,237, 87,151,174,126,189, 38,122, 77,107,129, 94,193,202,130,193,181, 1,107,235, 11, 85, - 10,229,133,125,235,220,215,237, 93, 79, 88, 47, 89,223,181, 97,250,134,157, 27, 62, 21,137,138,174, 20,219, 23,151, 21,127,216, - 40,220,120,229, 27,135,111,202,191,153,220,148,180,169,171,196,185,100,207,102,210,102,233,230,222, 45,158, 91, 14,150,170,151, -230,151, 14,110, 13,217,218,180, 13,223, 86,180,237,245,246, 69,219, 47,151,205, 40,219,187,131,182, 67,185,163,191, 60,184,188, -101,167,201,206,205, 59, 63, 84,164, 84,244, 84,250, 84, 54,238,210,221,181, 97,215,248,110,209,238, 27,123,188,246, 52,236,213, -219, 91,188,247,253, 62,201,190,219, 85, 1, 85, 77,213,102,213,101,251, 73,251,179,247, 63,174,137,170,233,248,150,251,109, 93, -173, 78,109,113,237,199, 3,210, 3,253, 7, 35, 14,182,215,185,212,213, 29,210, 61, 84, 82,143,214, 43,235, 71, 14,199, 31,190, -254,157,239,119, 45, 13, 54, 13, 85,141,156,198,226, 35,112, 68,121,228,233,247, 9,223,247, 30, 13, 58,218,118,140,123,172,225, - 7,211, 31,118, 29,103, 29, 47,106, 66,154,242,154, 70,155, 83,154,251, 91, 98, 91,186, 79,204, 62,209,214,234,222,122,252, 71, -219, 31, 15,156, 52, 60, 89,121, 74,243, 84,201,105,218,233,130,211,147,103,242,207,140,157,149,157,125,126, 46,249,220, 96,219, -162,182,123,231, 99,206,223,106, 15,111,239,186, 16,116,225,210, 69,255,139,231, 59,188, 59,206, 92,242,184,116,242,178,219,229, - 19, 87,184, 87,154,175, 58, 95,109,234,116,234, 60,254,147,211, 79,199,187,156,187,154,174,185, 92,107,185,238,122,189,181,123, -102,247,233, 27,158, 55,206,221,244,189,121,241, 22,255,214,213,158, 57, 61,221,189,243,122,111,247,197,247,245,223, 22,221,126, -114, 39,253,206,203,187,217,119, 39,238,173,188, 79,188, 95,244, 64,237, 65,217, 67,221,135,213, 63, 91,254,220,216,239,220,127, -106,192,119,160,243,209,220, 71,247, 6,133,131,207,254,145,245,143, 15, 67, 5,143,153,143,203,134, 13,134,235,158, 56, 62, 57, - 57,226, 63,114,253,233,252,167, 67,207,100,207, 38,158, 23,254,162,254,203,174, 23, 22, 47,126,248,213,235,215,206,209,152,209, -161,151,242,151,147,191,109,124,165,253,234,192,235, 25,175,219,198,194,198, 30,190,201,120, 51, 49, 94,244, 86,251,237,193,119, -220,119, 29,239,163,223, 15, 79,228,124, 32,127, 40,255,104,249,177,245, 83,208,167,251,147, 25,147,147,255, 4, 3,152,243,252, - 99, 51, 45,219, 0, 0, 0, 4,103, 65, 77, 65, 0, 0,177,142,124,251, 81,147, 0, 0, 0, 32, 99, 72, 82, 77, 0, 0,122, 37, - 0, 0,128,131, 0, 0,249,255, 0, 0,128,233, 0, 0,117, 48, 0, 0,234, 96, 0, 0, 58,152, 0, 0, 23,111,146, 95,197, 70, - 0, 2,168,136, 73, 68, 65, 84,120,218,236,157,119,120, 20,197, 31,198,223,217,221,235,119,233, 36, 33,133, 22, 58,132,150, 4, -148, 94,165, 73, 17, 4, 5, 4, 21, 27,168,232, 15, 21, 1, 11, 2, 42, 96, 65,138, 10, 40, 22, 20, 4, 20,149,166, 72,147,222, - 9, 82, 66,111,129, 52, 66, 18,210,175,223,238,252,254,200,221,121, 57, 46,185, 11,132,234,124,158,231,158, 43,187,251,222,236, -238,204,236,187,223, 41, 75, 40,165, 96, 48, 24, 12, 6,131,193, 96, 84, 30, 28, 59, 4, 12, 6,131,193, 96, 48, 24,247,144,193, - 34,132, 52, 97,154, 76,147,105, 50, 77,166,201, 52,153, 38,211,100, 6,203,251, 65,165,183,224, 68, 81,251,171,227,221,174,121, - 11,247,157, 86,162,102, 71,187,230,228,123, 36,157, 29,239, 86, 77,199,254, 86,166,174,235, 49,172,172,227,233,146, 78, 90,217, -233,188, 85,154,149, 93, 46, 43, 51,143,122, 56,239,147,239,145,116,118,188,219, 52,221,243, 79,101,232,122,202,147, 55,123, 60, - 61,164,147, 86,118, 58,111,149,102,101, 95, 47, 43, 43,143,150,115,238, 43,237,218,116, 55, 35,220,105,131, 1, 0,148, 82,226, -162, 79,238, 86, 77,215,227,224,208,175,204,180, 86, 34, 91, 43, 91,211,237,120, 86, 22,147, 41,165,132, 16,178, 13, 64,199,202, -220,247,202, 56,239,110,251, 90, 41,186,183,210, 92, 85,102,190,191,213,154,149, 85,150,220, 53, 43, 35,223,123, 58,239,183,240, - 28, 85, 86, 58, 43,165, 44,221,138, 60,239, 33,255,220,180,174,187,102,101,148, 37,119,205,202,200,247,183, 67,179, 50,202,146, - 39,205,202,200,247,101,157,123, 22,193,186, 61, 70,192,189, 96,119,186,155,141,208, 45,142, 98,117,188, 23, 52, 43,249, 28, 77, -182,107, 86,230,221, 76,167,202, 58, 71,238,121,167, 50,238,186, 92, 53, 43, 43,111,122, 72,231, 77,159, 39, 79,154, 55,155,222, - 50,210, 89,233,251,126,179,249,254,118,105, 86,242, 57,170,148,178,228,166,217,169,146,111, 2, 58, 85,102, 89,114,213,172,172, -178,228, 33,157, 55,125,158, 60,105,222,108,122,203, 72,103,165,239,123, 37, 70, 68, 43, 93,247,190,139, 96,221, 74,115,117, 43, -204,155,227, 46,169,178, 47,100,149,105,178,110, 85,164,173,178,162, 56, 30,116,183, 85,162,220,214,202, 78,167, 61,125,228, 86, - 24, 97, 74,233,100, 66,200,123,119,115,129,102,101,137,149,165,187,173, 44,121,202, 55, 55, 91,150,110,213,205,179,171,102,101, - 25, 33, 15,251,126, 83,101,201,125,219,202, 40, 75, 94, 52,201,173,216,255,202, 46, 79,119, 35,119,205, 40,194, 91,208,191,135, -222,138,168,216, 45,220,239,202, 76,103,167,123, 97,223,111, 69, 58, 9, 33,147,111,209,190,223, 43,199,148,149, 37, 86,150,238, -186,178,228,150, 39, 59, 85, 86,100,168,178,111,164,220, 53, 43,179, 31, 82,101,230,209, 91,189,239,149, 89,150,110,197,185,191, - 87,168,112, 4,235, 86,221, 29,223, 11,154,183, 66,251, 22,237,251,182, 91,113,119,112, 11,250,117, 85,122, 58, 41,165,147, 81, -137, 77,142,142,125,174,204,180,222,202,102,194, 91,145, 55,111,101,126,175,204,126, 30,183,104,223,239,149,243, 94,233,233,172, -172,178,228,225,156,223,116, 90, 61, 29,191,202,110,194,174,204,188,121, 43, 53, 43, 67,251, 86,164,243, 86,157,251,123, 9,194, - 38, 26,101, 48, 24, 12, 6,131,193,168, 92,202,140, 96,197,197,197,173, 85,169, 84,117,202, 90,174,215,235, 51, 14, 31, 62,220, -153, 29, 66, 6,131,225,245, 78,142, 16, 14,255,118, 73,144, 74,110,102,217,221, 29,131,193,248, 15, 26, 44,185, 92, 30,179,125, -251,246,122,146, 36,193,102,179, 65, 20, 69,136,162, 8,155,205, 6,179,217,140, 71, 31,125,180,194,205,139,205,155, 55,223,206, -113, 92,205,138,108, 35,138,226,229, 35, 71,142,180, 43,107,121,120,120,248,110, 0, 49,132, 16,215,202, 28,142,239,174,191,115, -156,179,203, 89,122, 74, 74, 74, 92,121,154,132,144, 24, 87, 61,119, 45, 15,186,229,106, 54,104,208,224,160, 32, 8,209,158,182, - 47, 75, 91,146,164, 11,199,142, 29,107,195,178,233,237,161,121,243,230,219,121,158,175,112,254, 60,124,248,112,153,249,179, 73, -147, 38,255,112, 28, 23,233,233, 28,151,145,159,120, 81, 20, 79, 31, 57,114,164, 93, 89, 6, 36, 34, 34, 98, 55,165, 52,198,199, -124,233, 32, 53, 37, 37, 37,193, 91, 57, 42, 47,157, 30,180,203,213,116, 53, 87, 81, 81, 81, 51, 66, 67, 67, 71,235,245,122, 35, - 0,202,113, 28,109,212,168, 81, 41,125, 81, 20,179, 78,158, 60,201, 38, 47,100, 48, 24,247,183,193,146, 36,137, 51,153, 76, 56, -115,230, 12, 60,213,243, 28,199,137, 21,253, 51, 74,105,189,205, 75, 23,135,169, 67,195, 33, 90,204, 80, 86, 9,115,106,231,157, - 56, 6,209, 98,129,100,181,160, 74,194,131,142, 52,160, 83,167, 78,188, 23,217,232,177, 99,199,134,249,249,249,193,104, 52,194, -104, 52,194,100, 50,193,100, 50,193,108, 54,195,108, 54,195, 98,177,192, 98,177,192,106,181,194,100, 50,225,216,177, 99,162,151, - 11, 66,244, 43,175,188,226,212, 52,153, 76, 48, 26,141, 78, 45,147,201,228,212, 52,155,205, 48,153, 76, 56,126,252,120,185,154, -130, 32, 68, 31, 58,116, 40, 76, 46,151,131, 82, 10, 73,146, 64, 41, 45,245,114, 59, 86,104,219,182,173,133,101,209,219, 74,189, -149, 31,125, 24,166, 12,169, 2,201,106, 69, 72,243,120,231,185, 72,219,252, 23, 36,171, 21,146,213,138, 26,125, 7, 58,127,239, -216,177,163,183,252, 89,227,215, 73, 19, 3,229,126,126,176, 25,141,168,213,103,128,115, 65,210,252, 89,160, 86, 43,168,205,130, -166,175,189, 3, 0,200,206,206, 54, 52,108,216, 48, 29, 37,253, 20,202,138,240, 68, 95,188,120, 49,204,145, 6,119,163,206,113, - 92,169,215,206,157, 59, 49,124,248,112,111,251, 30,253,246,219,111,135, 57,202,136,107, 94,183, 90,173,206,242, 99,179,217, 96, -181, 90, 97, 54,155,241,207, 63,255,248, 20,185,138,136,136,248,168,125,251,246, 35,151, 44, 89,162,253,253,247,223,181,181,106, -213,130, 92, 46, 7,207,243,224,121, 30, 28,199,129,231,121,244,239,223,159,176, 44,200, 96, 48,238,123,131,101,177, 88, 46,118, -239,222,157, 2,128,217,108,142, 82, 40, 20,114, 55, 3, 22,217,182,109,219,211,238,219,121,107, 58, 84,135,134,227,187, 90,193, - 0,128,193,231,115,156, 23,133, 21, 29, 90, 56,215, 25,122, 41,191,100, 93,181, 26, 28,199, 17, 47, 21, 56,116, 58, 29,186,119, -239, 14,133, 66,129,248,248,120,200,229,114,200,100,178, 50, 95,190,160,213,106, 49,101,202, 20,135, 57,130, 86,165,196,139,237, - 31,132,138, 80,124,119,228, 20, 76,162, 4, 65, 16, 32, 8, 2,100, 50,217,117, 17, 41, 79,200,229,114, 28, 59,118, 12, 60,207, - 67, 16,132, 82,239, 60,207, 99,205,154, 53, 24, 52,104, 16,120,158,135, 70,163, 1,254, 67,157, 1,239, 22,148, 33, 85,240,107, -199,146, 64,228, 19, 41,133,206,223,255, 26,210,215,249,121, 68, 90, 49, 8, 33,144,203,229,190,157,119, 63, 63,252, 57,168, 23, - 0, 96,224,153,171,206, 60,115,116,214,135,144, 41, 20, 16,100,114, 52, 25,251, 54,178,179,179, 13, 3, 7, 14,220,169, 82,169, -214,251,112,179,130,203,151, 47, 59,181,100, 50,217,117,249,158,227, 56,124,255,253,247,184,116,233,146, 79,251,110, 48, 24, 48, -109,218, 52,231,190,121,210,117,253,236,109,223, 9, 33, 92,213,170, 85, 63,104,223,190,253,240, 37, 75,150, 4, 17, 66, 48,111, -222, 60, 8,130,128,135, 31,126, 24, 33, 33, 33,216,176, 97, 3,228,114, 57,198,141, 27,199, 50, 31,131,193,248,111, 24,172,195, -135, 15,247,114,124,126,240,193, 7, 79,238,220,185,179,129, 75, 40, 31, 54,155, 77,110,179,217,234, 57,154, 13,109, 54, 27, 76, - 38, 19,134, 14, 29, 90,238, 29,189,104, 49, 95,103,144,202, 50, 78,190, 98, 54,155, 49,120,240, 96,167,137, 41,207, 92,249,120, - 97,128,201,100,130, 32, 8,168, 93, 61, 20,239, 12, 78, 64, 91,158,194,144, 3, 32,187, 24, 79, 69, 8, 56, 28, 93, 15,159, 95, -206,193,165,130, 34, 8,130,111,173,165,146, 36,149, 50, 84,238,159, 23, 44, 88,128, 33, 67,134,128,231,249,235,154,144, 24,183, - 7,201,106,245,154, 15, 43,122,110,108, 70, 35, 0,128,119, 49,228, 50,153, 12, 10,149, 10,188, 76, 6, 65, 33, 71,118,118,182, -225,161,135, 30,218,171, 86,171,127,168, 90,181,106, 90,106,106,106,185,249,147, 82, 10,153, 76, 6, 65, 16,202,204,243,223,127, -255, 61, 22, 47, 94,140, 86,173, 90,249,148,231,205,102, 51,228,114, 57, 62,252,240,195,235,150,207,159, 63,255, 58,131,229, 69, -143, 0,224,194,195,195, 95, 92,186,116,169,191,227,255, 67, 66, 66, 32,147,201, 16, 27, 27, 11, 63, 63, 63,236,220,185, 19,162, - 40,250,108, 86, 25, 12,198,127, 22, 25,128,230, 0, 66, 1,136, 0, 10, 1, 4,186, 44,207,178,191,135,186,124, 63,224, 65,167, -165,125, 29,199,114,199,119, 51, 0,133,135,223,115, 0,168,237, 47, 19,128,221, 0, 98, 93,254,199,177, 29,220,255, 87,176, 87, -134, 29, 1,108, 5,208,201,211,228,119,142,230,194, 83,167, 78,193, 91,191, 84,111,195, 59,149, 85,194,156,145,171, 95,106,135, - 56,127, 31,146,156,231,172, 96,255,108, 85, 23, 74,157, 22, 9,147, 63,241,122,196, 29, 23,134,171, 87,175, 94,119,231,125,163, - 6, 11, 0,172, 86, 43,212,106, 37,182,124,213, 1, 25, 23,108,248,112,109, 10, 86,237,191, 8, 65, 16,208,167, 65, 93, 60,106, - 3,102, 4,171,240,130, 77,132, 69,162, 62, 93,192, 40,165,215,153, 43, 87,147, 69, 8,113,254,198, 46, 54,119,134,144,230,241, -206,200,213,146,106,126,215, 69,173, 0, 96, 85,139,154, 80,249,233, 16,251,234, 4,159,242,103,173, 62, 3,156,145,171, 63,226, - 99, 32,200,229,144, 41, 21,120,244, 72, 10,128,146,102,193, 46, 77, 27,109,203,227, 21,139,158,124,242,201, 11,155, 55,111,214, -248,146, 86,185, 92, 94,202,176,121, 50, 87,130, 32,192,234,102, 26,203,187,169, 40,203, 56, 57,202, 85, 69, 34, 88, 0,160,215, -235,205,171, 86,173,194,231,159,127,142,144,144, 16,116,239,222, 29, 85,171, 86,197,138, 21, 43, 64, 41,197,203, 47,191, 12,181, - 90, 13,181, 90,205,242, 60,131,241, 31,199,139, 23,233, 48,113,226,196,132, 25, 51,102, 76,107,221,186,245,178,221,187,119, 47, - 37,132,172,117,241, 30,125,236, 26,107, 93,190,183,116, 51, 89, 50, 0,161,132,144,181,142,245, 93,191,187,252,222, 13,128,194, -241,125,226,196,137,177, 51,102,204,152, 54, 97,194,132,183,166, 79,159, 46,159, 56,113, 98,211, 25, 51,102, 76,115,252,143,167, -116,184, 70,176,202,157, 5,216, 98,177, 92,236,214,173,155, 79, 35,126, 12, 6,195, 21, 47, 6,204, 99,100,192, 53, 42,160,244, -211, 65,237,231, 7,194,249, 86,225, 90,173, 86, 8,130, 0,142,227,176,113,227, 70,168,213,106,244,238,221,251,134,155, 8, 29, -166, 77,161,144, 67, 8,228,240,228,103, 7,145,149,171,119, 54, 9,110, 74, 78,193,126,181, 26,239, 52,106, 10, 93, 81, 50, 10, - 76,230,155,138, 96, 13, 25, 50, 4, 70,163, 17, 28,199, 57,127,227, 56, 14,255,165,103, 54,221,133, 5,221,227,119, 66, 8, 84, -254,126, 80,233,116,224, 5,222, 39, 45, 74,233,191, 70, 72,161,128, 76,169,128, 32,151, 59,205,213, 67, 15, 61,180, 55,143, 87, - 44, 74, 75, 75,219, 11, 64,229,171,193,114, 68,176,202, 51, 87,130, 32,192, 98,177,248,100, 94, 76, 38, 19,228,242,127,123, 2, - 92,190,124,185, 92,131,229,101,159, 41, 33, 68, 34,132, 72, 49, 49, 49,206,109,194,195,195, 17, 24, 24, 8, 73,146, 32, 73, 18, - 84, 42, 21,212,106,117,169,255,101, 48, 24,255, 89,202,243, 34,202, 25, 51,102, 76,115, 53, 48,238,134,198,213, 56,185,153, 40, - 87,147, 22,235,165,238, 95,235,110,154, 28,255, 75, 8, 89, 59,125,250,244, 62, 94,210,145,229,110,176,202,157,102,223,181,185, -176,178, 46, 94,229, 93,192,212, 1,254, 80,104,181,176,119,191,162,222,180, 44, 22,139,179,207,201,232,209,163,203,188,171,119, -237,155,226, 13,179,217, 12,158,227, 1,101, 45, 72,216,231,188, 88, 57, 95,114, 57,146,171, 55, 3,185,146, 6, 65,240,173,191, -191, 35,130,229, 48, 81, 47,191,252, 50, 22, 46, 92,232,236,152, 12, 0, 60,207,163,126,253,250, 56,127,254, 60, 43,106,119, 0, - 74,169,215,102,107,149,191, 31,148, 58, 29,120, 31, 34,141,142,229,206, 62, 76, 42, 37,120,185, 28,130,188,164, 89,176, 95,191, -126,219,242,242,242, 22, 53,110,220,248, 44, 74,166, 49, 32,190,150, 31, 79,249,124,209,162, 69,165,204, 85, 69, 34, 88,142,114, -228,138,167,230,194,129, 3, 7,250, 26,193,162,132, 16, 42,147,201,208,173, 91, 55, 52,109,218, 20,171, 86,173,130, 36, 73,120, -233,165,151,160, 86,171, 49,123,246,108,216,108, 54,204,152, 49,131, 69,176, 24, 12, 70,121, 94,196, 48, 97,194,132,183, 8, 33, -107,237,145,164,164,114,140,148, 39, 90,186,153,180,172, 50,174, 1,125, 60,153, 44,215,207, 14, 38, 78,156, 24,235, 33, 29, 7, -174, 51, 88, 46,174,241,150,146,119,226,152,179, 67,187,163, 89,144, 16,130,191,218, 52,128, 66,167,133, 74,167, 67,187,149, 59, -156,119,205,248, 96,166, 79, 17, 44,135,113,202,201,201,241,218, 68,232,107, 84,140,151,203,176, 87, 39, 3,149,241,165, 46, 88, - 50,153, 12,156, 32, 67,114,104, 61, 16, 97, 3, 4,209,230,211,197,193, 17,201,112, 29, 61,245,228,147, 79,130,227, 56,167,201, -106,209,162, 69,169,188,198,138,219,237, 37,253,239,245, 88,247,120, 73, 89,117,109, 22, 92,219,170, 14,148,126, 58, 40,181, 90, -116, 92,179,219,217,156,139,217, 95,123,213, 60,245,237,151, 72,154, 51, 29,130, 76,134, 1,135,146,157,145,171,182, 13,234,238, - 53,107,253, 23, 93,190,124,121, 47, 0,238,241,199, 31, 15,140,139,139,227,125,172,132, 74,117, 60, 23, 4,193,163,185, 18, 4, - 1, 54,155,205,167,125,183, 88, 44, 62, 69,146, 28, 81, 44, 31,242, 59,109,216,176, 33,120,158, 71, 64, 64, 0,252,252,252,156, - 35,104, 29,145, 43, 71,255, 77, 95,203, 37,131,193,184,239,111,114,203,242, 34,166,233,211,167, 39, 77,159, 62,221, 25, 73,114, -143, 96,149,193,195,118, 51, 21,234, 48,103, 40,233, 75,117,160,156, 52,244, 41,203,120,185,254, 54, 99,198,140,105, 30,210,225, -108,150,244,216, 59,187,121,243,230,235, 52, 26, 77, 45, 95, 15, 72, 69, 38, 29, 21, 45,150,235,238,196, 9, 33, 80,233,116, 80, -248,233,160,212,233,202,140,114,149,117,161,113, 52, 17,242, 60,239,188,232,252,240,195, 15,208,233,116,120,250,233,167,111,168, -147,123,137,193,226,177, 90,126, 6,144, 11,215, 93,180,120,153, 12,151, 3,170,129,147,201, 32,136,190, 69, 8,242,243,243,193, -243, 60,222,123,239, 61,204,152, 49,195, 57,140,222,117,104,189,107,212,131,113,251,113,237,228, 94, 42,170,234,231,231,204,159, -174,191,123,235,147, 72, 8, 1, 68, 91,201,104, 65,165,194,105,174,250,245,235,183,205,172,245, 95,212,160, 65, 3, 71,228,138, -211,104, 52, 94, 71,205,186,150, 13,135,209,113, 55, 87,142, 40,169,227,179,213,106,245, 41,207, 59, 12,214,194,133, 11,203,189, - 25,113,252,175,175,249,148,227, 56,108,223,190, 29,135, 14, 29,194,232,209,163,161, 86,171, 49,119,238, 92,216,108, 54, 76,157, - 58, 21,106,181, 26, 10,133,130,101, 62, 6,131, 81, 30, 65, 14,131, 99, 55, 73,165, 34, 75,148,210, 62,174, 38,168,172,166, 66, -123,196,105,187,151,255,250,195,110,204, 60,226,136,164,185,213,161,107,221,205,153,224,112,140,174,239, 10,133,162,214,174, 93, -187,234, 73,146, 4, 81, 20, 81,222,187,217,108,198, 99,143, 61,230,243,164,163,146,181,196, 96,113,110, 35,229,148,254,126, 80, -232,254,189,128,185, 92,196,188,214,226,142, 8,150,171,193,122,239,189,247, 32, 8, 2, 22, 46, 92, 8, 0,120,227,141, 55, 42, - 28,193,162, 18,176, 91,220,138,200,121,205, 64, 23,169,144,185,253, 36,100, 50, 25,170,182,122, 8, 82,194,163,200, 81,248, 67, -107,239, 87,229, 75,179, 99, 78, 78, 14, 46, 93,186, 4, 66, 8, 94,123,237,181,114,205,213,198,141, 27, 89, 31,172, 59,104,176, - 56,158, 47,117, 62, 92,243,167,155,249,242,222, 78,102,179, 65,166, 84,150, 26, 45,152,151,151,183,232,242,229,203,251, 0,144, -225,195,135, 7,106, 52, 26,124,251,237,183,122, 0,242,149, 43, 87,170,189,105,186,246,227,115,143, 92,185, 27, 44, 81,244,222, -132,237,184,169,240, 37,218, 91, 17,131,229,200,223,132, 16,136,162,232,140, 92, 89,173, 86,231,119,165, 82,201, 50, 30,131,193, -240,246, 92,209, 44,183,126, 78,196, 45,210,148,229,201, 88,185, 54, 7,186,124,182,122,208, 53,187, 53, 29,186,255,238,120,207, -153, 62,125,250, 22, 71,228,202,229,247, 82,233, 40, 51,130,197,113, 28, 76, 38, 19, 78,156, 56,225,235, 29,170,207,147,142,134, -196, 63,128,161,151,242, 65, 8,193,134,246,141,161,210,233, 32,215,105,209,230,215,173,206, 10, 59,121,198, 56,200,181, 58,132, -180,123,200,167, 10, 92, 20,197,235, 12, 86, 94, 94, 30,100, 50, 25, 62,248,224, 3,112, 28,135,143, 62,250, 8, 81, 81, 81,200, -200,200, 64,199,142, 29,125,186,216,112, 18, 7,213, 83,193, 80,189,224, 7,110,116, 29,196,246,125, 1,249,133, 53,113,212,172, - 69,195,226, 51, 8,250,123, 50, 44,146,205,167,105, 26, 8, 33,176,217,108,216,178,101, 11,100, 50, 25,108, 54,155,243,226, 67, - 41,117,206,146,239,152,212,241,163,143, 62, 98,165,237, 14, 80,237,225, 71,240,100,186, 30, 0,176,174, 77, 3, 40,181, 90, 40, -252,116,104,247,251,118,103,254,188, 48,237,117,200,181, 58, 4,182,108,239,147,102,163,151,222, 64,195, 23, 95, 71,118,118,182, -161, 91,139,216,237,249,188,242,251, 38, 77,154, 56,251, 92,105, 52, 26,168, 84, 42,226,136,100,249,106, 90, 56,142,243,106,174, - 28,159,125,189,169,112, 31,133, 91,158,193,242, 21,142,227,240,244,211, 79, 35, 34, 34, 2,159,127,254,121,169,200,213, 91,111, -189, 5,171,213,138,217,179,103,179,204,199, 96, 48,202,227, 64, 5,214,109,233, 98,150, 14,220,160,238,129,155, 77,176,199,154, -215,100, 50, 37,119,237,218, 21,101, 44,139, 82, 42,149,165,106, 87,199,164,163,238, 77,133,132,144, 38,148,210, 99,110, 14,245, -223,102, 65,123,103, 97,133, 91,179,139, 66,231, 7,153, 86, 7,206, 67, 37,238, 73,211, 83, 4,203,209,116,146,159,159, 15,153, - 76,134,207, 63,255, 28,254,254,254, 48,153, 76,158, 58,216,123,212,228,121, 30,250, 75,122, 92,124,247, 40,148,218,115,168,255, -144, 31,252,100,231, 81,119,199, 74,216,108,102,192,165,201,208, 23,205,250,245,235,227,189,247,222,187,110,122,134,178,136,143, -143,247,170,121,179, 48, 77,207,154,132, 16, 40,253,116, 80,249,249,149,153, 63, 5, 15,115, 55,185,107, 58,150, 59, 34, 87, 69, -114,205,247,151, 47, 94,220, 7,128, 27, 62,124,120,128, 70,163,193,130, 5, 11,244, 0,184,247,223,127, 95, 83,163, 70, 13,222, -151,116,114, 28,135, 31,126,248,225,186, 62, 87,101, 25, 44, 95,210,105,179,217,174, 51, 88,131, 7, 15,190,110,162,209,178, 34, - 88,158,210,233,232,171, 86,165, 74, 21,104, 52, 26,231, 99,183, 84, 42, 21, 84, 42,149,115,118,248,178,154, 90, 89,254,100,154, - 76,243,191,163,121,135,204,216, 45,195,163,193,250,231,159,127,122,150,181, 65,219,182,109,207,236,218,181,171,174,235,179, 9, -109, 54,155,220,100, 50,213,235,223,191,191,215, 91,101, 73,146,160, 84, 42, 65, 41, 69,243,119,102,148,220,194,115,255, 54, 9, - 82, 74, 17,216,182, 27, 8,207, 67, 20, 37, 88,173, 86,175,163, 8,141, 70, 99,169, 14,232,158,134,175, 23, 21, 21,149, 59,207, -143,187,166,193, 96, 40,213,175,139,136, 20, 23, 54,173,184,126, 52,161,253,127,124, 69,165, 82,149,106, 54,241,150, 20,118,211, -114,123,113, 76,224, 73, 41, 69,236, 43, 19, 74, 34, 69, 60, 87,106,121, 64,203,246, 32,130, 12, 82, 73,191, 37,111, 3, 67, 72, - 86, 86,150,161, 95,191,126,219, 40,165,223,245,239,223,255, 52, 74, 58, 88, 82,157, 78,167,148,201,100, 18,128,107, 0,104,110, -110,110, 64, 90, 90,154,100, 52, 26,171,123, 75,231,246,237,219,113,238,220, 57,196,197,197, 57, 35,159,142,151,163,249,254, 70, - 34, 88,158,102,132, 47,107, 38,247,138, 68,176, 2, 2, 2,160, 80, 40,240,193, 7, 31, 64, 46,151, 67,173, 46,105, 5,157, 61, -123,182,243,152, 51, 24, 12,198,253, 68,133, 31,216, 44, 73, 18, 95, 86,243,161,183,166, 66, 81, 20, 83, 31,120,224,129,138,254, - 95,166,151, 11, 98,234,142, 29, 59,228,238, 15,164,245,244, 0, 92,151,223,188,106, 30, 56,112, 64, 94,206,246,158, 62,103, 86, -100,223,125,233,191, 98,179,217,210, 88, 22,189,125,216,108,182,212, 86,173, 90,121, 94,248,222, 71,101,157,215, 76, 47,166,229, -108,189,122,245,210,117, 58,221, 31,225,225,225, 57,187,118,237, 10,105,217,178,101,136,235, 58, 45, 91,182,140,112,219,204,140, -114,166, 39, 33,132,164, 62,249,228,147,114, 47,249,209,253,115,170,151,155,138,212,164,164, 36,185,167,252, 94,214, 59,165, 52, -213,135,195,122,169, 87,175, 94,156,167, 50,228,225, 88,102,177, 92,200, 96, 48,254,179, 6,203,104, 52,166,116,237,218,213,227, -184,111,189, 94,127,185,188,109,147,146,146, 18, 42,123, 7, 82, 83, 83,219,220, 11,154,183, 98,223, 25,119,255, 57, 74, 74, 74, -106, 85,217,154,151, 47, 95,110,115, 47,104, 2,192,241,227,199, 91,179,156,197, 96, 48,152,193,242, 1, 95,167, 99, 96, 48, 24, - 12, 6,131,193,248,175,194,177, 67,192, 96, 48, 24, 12, 6,131, 81,185, 16, 0, 77, 60, 45,168,200,232, 0, 66, 72,147,138,254, -177, 55,125,166,201, 52,153, 38,211,100,154, 76,147,105,222,127,154,222,180,239,226,209,137, 21, 51, 88,222,102,162,190, 41,113, - 54,132,149,105, 50, 77,166,201, 52,153, 38,211,100,154,255, 65, 88, 19, 33,131,193, 96, 48, 24, 12, 70, 37, 35,176, 67,112,103, - 32,132,240,148, 82,177, 18, 37, 3, 1,148,245, 64, 55, 51,128,188, 27,212, 85, 0,144,217, 95, 64,201, 35, 6,172,118, 77, 6, -131,113, 31,145,144,144, 48,146, 82,250, 97, 73, 21, 69, 62, 56,120,240,224, 23,236,168, 48, 24,149,108,176,234,212,169,115,144, -227,184,104, 79, 15, 32, 46,107, 94, 28, 81, 20, 83, 79,158, 60,233,211, 80,119, 66,136, 16, 17, 17, 49, 88,171,213,118,230,121, -190,173,125,251, 93,197,197,197, 91, 50, 50, 50,126,161,148,218,110,100,135, 98, 98, 98,252,141, 70,227, 99,132,144, 97, 0, 64, - 41,253, 73,165, 82,253,124,225,194,133,130, 27, 52, 66,117,170, 86,173,250,147, 76, 38,227, 83, 82, 82, 58, 3, 64,181,106,213, -182,152,205,102,241,234,213,171,195, 40,165,231, 42,168,199,201,229,242, 25,237,219,183,111, 71, 8,249,145, 82, 58,191,146,206, -165,146,227,184, 75,158, 22, 72,146, 84,227, 6,244,228, 0, 2,102,207,158, 29,188,120,241,226, 22, 25, 25, 25, 77, 1, 32, 34, - 34,226,232,240,225,195,255,249,223,255,254,119, 13, 64, 62, 0, 11, 43, 70,247, 54,245,234,213, 59,200,113, 92,116, 69,230,146, -179, 63,162, 42,245,248,241,227, 9,101,105,242, 60, 31,237,101, 62,186,235, 62, 75,146,116, 33, 41, 41,201,227,148, 17,245,235, -215,223,195,243,124, 45,111,105,243,148,206,178,166,224,168, 95,191,254, 65,158,231,163, 43,170, 41, 73,210,133, 99,199,142,181, -169, 76,205,219,157, 78, 0,232,212,169,147,178,184,184,248, 39,157, 78,215,172,184,184,120, 36,165,116,210,214,173, 91,195, 57, -142, 67,183,110,221, 38, 37, 36, 36, 92, 84, 42,149,243,140, 70,227, 63, 58,157,110,232,214,173, 91, 77,172,196, 48, 24, 55,105, -176, 56,142,139, 62,116,232, 80,152, 86,171,133,221,168,192, 49,123,187, 36, 73,206, 23,165, 20,148, 82,216,108, 54,116,234,212, -201,167, 63,141,142,142,110, 82,191,126,253, 21, 47,191,252,114,245,190,125,251, 42,194,195,195, 65, 8,193,149, 43, 87,234,173, - 93,187,246,137,207, 63,255,252,189,232,232,232, 65,169,169,169,190,118,148,227, 34, 34, 34,186, 2,120,170, 73,147, 38, 3,223, -120,227, 13,121,219,182,109, 33,138, 34,254,254,251,239,246,179,102,205,250, 60, 50, 50,242, 55, 0,139, 50, 50, 50, 54, 83, 74, - 37, 31,117, 91,212,170, 85,235,231,237,219,183,215, 74, 78, 78, 22, 7, 12, 24,240, 35, 0,236,218,181,171, 25,165,148,180,109, -219,118, 29, 33,228, 49, 74,233, 63, 21, 56,230,253,199,140, 25, 51,232,165,151, 94, 10, 29, 57,114,228,112, 0,243,237,255,229, -120,200,101, 69, 59,197, 57, 35, 87,148, 82,121, 57,235,133, 87, 32,146,165,189,112,225, 66, 96,219,182,109, 95,186,122,245,234, - 88, 87,221,204,204, 76, 28, 62,124,216,242,209, 71, 31,205,218,181,107,215,151, 49, 49, 49,121, 0,138, 89, 81,186,119,225,121, - 62,234,224,193,131, 97, 26,141,198,249, 32,119,215,114,238, 40,227,174, 89,147, 82,138, 14, 29, 58,148,167, 25,157,152,152, 24, -166, 86,171,157,117, 71,121,122, 46,154,150,114,234,164, 26, 7, 14, 28, 8,211,104, 52,160,148,122,213, 35,132,128, 82, 90,238, -179, 71, 29,233, 84,169, 84, 62,105, 58,104,219,182,173, 88, 89,154,142,116,182,110,221,154,150,167,121,232,208,161, 48,199, 83, - 48, 42,144,206,114,111,128,138,139,139,127,250,229,151, 95, 6,132,135,135,163,127,255,254, 27, 26, 55,110,172,208,104, 52, 88, -183,110, 29,162,163,163,171,248,251,251,255, 57,125,250,116,204,156, 57,179,250,198,141, 27,151, 2, 24,192, 74, 12,131,113,243, - 6, 11, 90,173, 22,203,150, 45,243,248,248, 25,247,207, 53,106,248, 22, 36,169, 90,181,106, 66,205,154, 53,183,173, 92,185, 82, - 29, 22, 22,230,252,221, 98,177,192,223,223, 31, 79, 63,253,180,162, 91,183,110,117,159,120,226,137,189, 85,171, 86,237,120,229, -202,149,131,229,233, 69, 68, 68, 12,140,141,141,253, 98,236,216,177,225,253,250,245, 67, 80, 80, 80,169,229,125,250,244, 65,239, -222,189,229, 23, 46, 92, 24,242,203, 47,191, 12,249,241,199, 31,175, 68, 68, 68,140,201,200,200,248,173, 92,135,161,213,118,107, -222,188,249,183,155, 55,111,142, 14, 12, 12, 68,100,100, 36,247,238,187,239, 54,169, 93,187,182, 58, 34, 34,130, 75, 79, 79,199, -111,191,253, 86,123,248,240,225,171, 84, 42,213, 72,163,209,184,217, 7,195,166, 8, 14, 14, 30,247,194, 11, 47,132, 20, 22, 22, -218, 14, 29, 58,116,206,241,187, 82,169,156,244,224,131, 15,198, 17, 66,150, 83, 74, 23,221, 72,228,138, 82, 90,128,127,155,242, - 28, 88, 29,203,125,140,100, 41, 14, 29, 58, 20,212,182,109,219,223, 77, 38, 83,220,179,207, 62,155,246,201, 39,159, 40,252,253, -253,253, 1,144,188,188,188,220, 41, 83,166,136,115,231,206, 29,223,184,113,227,174,187,118,237, 26, 16, 23, 23,199,154, 12,239, -113, 52, 26, 13,214,172, 89,227,241, 49, 83,158,202,124, 96, 96,160,215,167, 17,168,213,106,108,220,184,209,185,157,235,163,165, - 60,125, 14, 12, 12, 4,165,180, 92, 81,149, 74,133,157, 59,119, 58, 31, 3, 84, 86,189,228,120,215,104, 52, 32,132,112,222, 52, -183,109,219,230, 85,203,241,174,211,233, 0,128,247, 37,157,222,246,217,241, 89,171,213,122, 61,158, 74,165,210,169,233,170, 81, -214,119,251,205, 49,241,114,142,154,133,135,135, 99,223,190,125,152, 60,121,178, 34, 54, 54, 22,103,206,156, 1,199,113, 24, 57, -114, 36, 26, 55,110,140, 43, 87,174,160,113,227,198,216,185,115,103, 11, 86, 82, 24,140, 74, 48, 88, 14,202,170, 96,221, 63, 59, -238,196,220,238, 72, 75, 69,160,106,214,172,169,212,233,116,191,174, 89,179, 70, 29, 18,242,239,211, 66,204,102, 51, 10, 11, 11, - 81, 84, 84,132,194,194, 66,104,181, 90,204,155, 55, 79, 61,108,216,176, 95,107,214,172, 89, 47, 57, 57,217, 84,150, 38, 33,100, -214,225,195,135,195,109, 54, 27, 20, 10, 69,153,102,177, 78,157, 58, 24, 51,102, 12,218,181,107, 87,117,200,144, 33,179, 0,252, - 86,150,166,221,184,125,185,107,215,174,104,133, 66,129, 51,103,206, 32, 53, 53, 21,163, 70,141,170, 33, 73, 18, 82, 82, 82,112, -230,204, 25,164,167,167,227,235,175,191,142, 30, 54,108,216, 60, 0,117,203,219,119, 59,207,189,246,218,107,117,131,130,130,184, - 79, 62,249, 36,191,168,168,232,107,251,239, 19,103,207,158, 61,180, 99,199,142,161,207, 62,251, 44, 37,132, 44,163,148, 94,103, - 88,220, 52, 61, 69,174, 68, 74,233, 73,183,205, 26,186, 69,182,194, 81,242, 44,188,124, 15,154, 4,128,127,207,158, 61, 95, 55, -153, 76,113, 59,118,236, 56,215,174, 93,187, 26, 0, 50, 40,165, 89, 0, 16, 20, 20,164,157, 51,103, 78,120,159, 62,125, 78,119, -235,214, 45,174,103,207,158,175,103,101,101,125, 8, 32, 27,246,199,187,220,138,145, 37, 76,243,214,105,218,155,146, 32, 8, 2, -122,245,234, 5, 66,136,199,231,109,238,217,179, 7, 93,187,118,133, 76, 38,195, 51,207, 60,227,179,102,143, 30, 61, 96,179,217, -174,211,115, 55, 32,142,103,116,150,183,239,148,210, 82,207, 8,245,100, 46, 92, 95,238,122,158, 52, 37, 73,242,168, 85,150,201, -114, 60,172,222,151,125,247,213, 92,122, 75,167,171,166, 76, 38, 67,155, 54,109,112,232,208,161,114,205,150,183,116,218, 35, 88, - 79,245,239,223,127,195,168, 81,163, 84, 0,144,157,157, 93,234, 65,244,167, 78,157,130,201,100,194,146, 37, 75, 96, 50,153, 70, -179,114,196, 52,111,165,166, 55, 59, 2,160, 57,128, 80, 0, 34,128, 66,251,117,208,108,191, 22,230, 0, 80,219, 95, 38, 0, 69, - 0,170,216,183,205,182, 95,223, 92, 31, 83,150,133,210, 15,133,110,105,215,118, 60,178, 43,212,101,153,227, 63,220,191,187,191, -151,210,230,236,133,151,218, 95, 29,221,195,214,190,152, 43, 71,229,232,195, 9,121,121,226,196,137,225,174,230,202,100, 50,161, -160,160, 0,133,133,133,206,247, 51,103,206, 64,161, 80, 96,240,224,193,225,148,210,151,189,200,202,121,158,199,161, 67,135,176, -114,229, 74, 92,188,120,241,186, 21,206,159, 63,143, 57,115,230, 96,230,204,153, 40, 40, 40, 0, 74,250, 23,121,164,121,243,230, -147,135, 13, 27,182,183, 83,167, 78, 74, 65, 16,112,248,240, 97,212,171, 87, 15,187,119,239,198,229,203,151,145,155,155,139, 83, -167, 78,161, 73,147, 38, 56,119,238, 28, 10, 10, 10, 16, 27, 27,171,140,143,143,223, 81,179,102,205,201,229, 68,175,228, 81, 81, - 81,111,189,240,194, 11,202,140,140, 12,233,135, 31,126,216, 69, 41,221, 77, 8, 25,245,246,219,111,143,232,209,163, 71,232,201, -147, 39, 11, 14, 28, 56,112,208,147,185, 42, 35,114,117,153,227,184, 75,148,210, 2, 74,169, 1, 37,157,207, 75, 93,140,108, 54, -155,201, 96, 48,228,231,228,228,100,115, 28,119,137,227,184, 51, 0,148,101,105, 14, 31, 62,188,118,118,118,246, 75,255,251,223, -255, 46,182,107,215,174, 6,165,244, 20,165, 52,199,158, 97, 77, 54,155, 45, 39, 47, 47,239,116,219,182,109, 35,134, 14, 29,122, - 46, 59, 59,251,165,225,195,135,215, 46, 71,147,113,247, 67, 69, 81,132, 76, 38,195,214,173, 91,177,115,231, 78,236,220,185, 19, -187,118,237,194,238,221,187,177,103,207, 30,236,217,179, 7,130, 32, 96,247,238,221,216,189,123, 55,198,140, 25,227,181,204,139, -162, 8, 65, 16,176,109,219, 54,236,223,191,223,249, 58,112,224, 0,246,239,223, 15,181, 90,237,213, 12,185,149, 33,167,166,167, -215,151, 95,126,233, 52,135,142,186,137,227,184,114,163, 98,238,198,197,221,176,212,168, 89,243,186,101,222,210,233, 48,109,130, - 32,224,155,111,190, 65, 90, 90, 26, 62,255,252,115,156, 63,127, 30, 31,127,252, 49,146,146,146, 48,117,234, 84, 28, 56,112, 0, - 19, 39, 78,196,142, 29, 59, 28, 15,127,167,222, 52, 29,230,202, 98,177, 56,211,115,234,212, 41, 76,155, 54, 13,135, 15, 31,198, -164, 73,147,176,103,207, 30,140, 27, 55, 14, 60, 95,110,144, 13, 9, 9, 9, 35, 9, 33,191,212,175, 95, 95,217,165, 75, 23, 8, -130,128,105,211,166, 73,147, 38, 77,186,250,246,219,111, 95, 93,187,118, 45,173, 93,187, 54,204,102, 51,252,252,252, 64, 41, 93, -148,144,144,240, 50, 43, 46,140, 91,133, 39, 47,226, 66,135,137, 19, 39,118, 33,132,172,109,211,166,205,112, 0,129,132,144,181, - 0, 20,246,247,144,137, 19, 39,182, 34,132,172,157, 56,113, 98, 2,128, 42,132,144,181,246,239,157, 1,132, 56,190,219,215, 15, -117, 51,111,161, 46,191,135,186,173,171,240,244,221,253,221, 93, 91,112,185, 24, 19,123, 1, 39,174, 21,100, 69, 12,150,183, 10, - 87,167,211,245,238,217,179,167,220,213, 92,185, 70,174, 28,239,133,133,133, 56,125,250, 52,154, 52,105, 34,215,233,116,189, 1, -124,234, 53, 20, 39, 8,136,140,140, 68,118,118, 54,142, 29, 59,134, 26, 53,106,192,106,181, 98,253,250,245,200,203,203,131, 92, - 46,135, 92, 46,135,217, 92,190,119,105,216,176, 97,175,197,139, 23, 39,252,248,227,143,185,130, 32,224,212,169, 83,248,233,167, -159, 64, 41, 69,149, 42, 85,160,215,235,113,245,234, 85,204,154, 53, 11, 22,139, 5, 58,157, 14, 81, 81, 81,170,151, 95,126,185, -221,148, 41, 83,100, 0,202, 50, 89, 15, 12, 28, 56,208,223,207,207, 15,175,190,250,170,100,177, 88,102, 18, 66, 30, 28, 56,112, -224, 91, 99,198,140, 9, 78, 78, 78, 54, 63,247,220,115, 7, 45, 22,203, 44,123, 70,147, 81, 74,173, 94, 12,107,153,145, 43,155, -205,230, 56,166, 23, 11, 11, 11, 17, 22, 22, 86,157, 82, 42,247,114,142,228,187,119,239,110, 3,128,127,255,253,247, 85,148,210, - 76, 87,211,102,177, 88, 28,154,182,252,252,252,171,227,198,141,179, 45, 93,186,148,183,111,115, 2,128,145, 85, 17,247,100,165, -230, 44,235,189,122,245, 42,101, 40,182,111,223,142,158, 61,123, 58,203,187, 92, 46,119,174,231, 77,211, 53, 42,230,136, 60, 57, -116,183,108,217,114, 93,228,197,199,155, 52,103,132,197,147,241,113, 55, 93,142, 27, 69, 95,204,144, 39,147,229,168, 91,220, 35, - 67,190,164, 83, 38,147, 97,204,152, 49, 16, 4, 1,227,198,141,131, 76, 38, 67,243,230,205, 33, 8, 2, 90,183,110, 13, 65, 16, -208,185,115,103,159,111, 80, 29,233,220,179,103, 15,226,227,227,157,233,105,222,188, 57, 90,182,108, 9, 65, 16,208,190,125,123, - 8,130,128,238,221,187,123,213,116,116,104,215,233,116, 56,125,250, 52,120,158, 7, 33, 36, 39, 49, 49, 49, 28, 0, 38, 79,158, -156,109, 52, 26, 67,140, 70, 35,186,118,237,138, 54,109,218,132, 46, 93,186,244, 93, 0,108,100, 33,227,214,221,237,121,240, 34, -142, 0,192,140, 25, 51,166, 81, 74,251,148,181,173, 99, 57, 33,100,237,244,233,211,251,216,245,174,251,238, 18,101,114, 53,111, -177,174, 17, 40,199,118,174,255, 87,222,127,187,173,159, 85,202, 96,217,119,168,147,167, 74,215, 83,168,220,253,179, 47, 21,132, -209,104,108,238,136, 94, 25,141,198, 82,134,170,168,168,168,148,209, 50,155,205,136,137,137,129,209,104,108, 94,209,139, 69, 68, - 68, 4, 44, 22, 11, 22, 46, 92,232, 52, 86,174, 38,161, 60,142, 31, 63,126,113,239,222,189,113,241,241,241, 65,191,255,254,123, - 86,183,110,221, 66,123,244,232, 1,149, 74, 5,163,209, 8,155,205,134, 7, 30,120, 0, 13, 27, 54,196,213,171, 87,177,110,221, -186,236,122,245,234, 85,217,183,111,159,116,229,202,149, 75,229, 72,119,237,218,181, 43, 8, 33, 88,183,110,221, 53, 74,105,162, - 90,173,254,109,218,180,105,129, 38,147, 73, 26, 49, 98, 68,202,181,107,215,198, 1,176, 42,149,202, 79, 31,122,232,161, 7,120, -158, 95, 46,138, 98,133, 43, 51,147,201, 84,234,216, 22, 22, 22, 66,163,209,248, 50, 37,132, 44, 47, 47,175, 41, 0,104, 52,154, - 96, 0,206, 17,146, 6,131,193,121,142,236,231,199, 24, 28, 28,172, 5, 0,251, 54, 50, 86, 53,220,187, 56, 46,222, 91,183,110, - 45, 85,190, 29, 17, 40,247, 50,175, 80, 40,176,102,205, 26,159, 52, 93,205,148, 15,205,121,229, 70,155, 28, 6, 75, 16, 4,124, -253,117, 73, 11,251,171,175,190,234,220,222,253, 63,124,169, 47, 28,102, 72, 16, 4, 52,124, 79, 2, 96, 65,234,103, 42,200,100, - 37, 89,218, 61,205,142,139,128, 47,230,242,243,207, 63, 71,159, 62,125,176,118,237,218,114,223,123,247,238,237, 83, 58, 5, 65, -128, 82,169, 44,101,252, 14, 31, 62,236, 81,119,193,130, 5, 94,251,180, 73,146,132, 63,254,248, 3, 28,199,149,138,120,189,251, -238,187, 47,248,251,251,235,182,109,219,134,204,204, 76, 20, 23, 23,163,168,168, 8, 65, 65, 65,129,221,186,117, 59,124,229,202, -149,228,227,199,143,179, 14,239,140, 91, 18,197,114,245, 34, 46, 24, 38, 76,152,240, 22, 33,100,237,132, 9, 19,222,154, 62,125, -122,146,125,253,181,110,219,175,245,162,239, 48, 65,142,230,193,150,110,230,205,209,116,248,112, 57,219,154,221, 12,149,123, 19, -225, 1,175, 17, 44,247,190, 9,229,125,182,135,184,189, 85,184, 2, 33,228, 58, 3,224, 41,130,101,181, 90,145,147,147, 3, 73, -146, 42,117,174, 46,111, 6,235,216,177, 99, 79,143, 28, 57, 50, 61, 32, 32,160, 89, 78, 78, 78,134, 82,169,108,191,125,251,246, -106, 86,171, 21,254,254,254,240,247,247,199,159,127,254,137,128,128, 0,252,239,127,255,187,108, 48, 24,118,107,181,218,112,131, -193,112,228,202,149, 43,239,148,233, 92,100,178,174,237,219,183, 71, 98, 98, 34,242,242,242,254, 38,132, 52,123,246,217,103,187, - 87,171, 86,141,124,248,225,135,198,115,231,206,125, 1, 32, 75,171,213,126,179,120,241,226,142,113,113,113,186, 17, 35, 70,128, - 16,242, 45,165,212,231,200,144, 94,175, 47,101,172, 28,199,212,207,207,207,167, 57,183,236,199,155, 18, 66,156, 3, 26, 93,141, -149,139, 1,166, 60,207, 75, 0,104,101,159, 35,198,237,143, 96, 57,202,122,223,190,125,175,235,220, 46,151,203,177, 97,195, 6, - 60,242,200, 35,206, 27,150,248,248,120,159,163, 77,253,250,245,115, 26,130, 13, 27, 54,148,105,176,188, 53,105,185, 71,155, 94, -121,229, 21,200,100, 50,124,241,197, 23, 24, 59,118, 44,120,158,199,103,159,125, 6,142,227,240,238,187,239, 86,216, 92,202,100, - 50, 92,252,168,228, 61,250,181, 2,228,204, 15, 7, 0,248,249,251,151,236,143, 36,249,172,233,216,119,111,145, 43, 87, 99,229, -173,137,208, 53, 10,120,230,204, 25,231,231,214,173, 91,151,138, 92, 9,130,224,213,176,217,255,111,106,151, 46, 93, 62,140,142, -142, 14, 27, 53,106, 20, 17, 4, 1, 9, 9, 9, 85, 38, 77,154,148, 47,147,201, 84,111,188,241,134,167,174, 20, 50, 0,205, 26, - 53,106,164,101, 37,135,113,155, 35, 88,166,233,211,167, 39, 77,159, 62,221, 99,132,202, 61,146, 84, 94,164,201,197, 88, 29,128, -189, 57,112,194,132, 9,111,161,164, 43,204, 1, 31,182, 85, 56,204,149,123,148,203, 21,247, 8,214, 20,247,138,199, 23,131,229, - 75,255, 9,123, 84,228,104,118,118,118,107,165, 82,137,130,130,130,235, 46,218,174,166,128,231,121, 92,189,122, 21, 26,141,230, -104,101,158, 60,111, 77,132,118, 51,243,186,203,113,105, 57,120,240,224,165,203,151, 47,143,217,180,105, 19,246,237,219,135, 42, - 85,170, 96,218,180,105, 23,146,147,147,135, 82, 74, 15,248,242,191,181,107,215,110,172,211,233,176,107,215, 46, 0,216, 1,224, -169, 23, 95,124,145, 88, 44, 22,204,155, 55, 79, 15, 96, 83, 64, 64,192,111, 43, 86,172,104,214,172, 89, 51,229,166, 77,155, 10, -247,237,219,183,213, 71,115, 37, 82, 74, 61, 26,171,194,194, 66, 20, 23, 23, 67,167,211,249, 98,176,108,254,254,254,199, 10, 11, - 11, 31, 51, 24, 12, 5, 74,165,210,175,160,160,192,228, 26, 97, 44, 42, 42, 66,113,113, 49, 4, 65,144,157, 57,115, 38, 29, 64, -109,127,127,255, 99, 0,108,172,106,184, 55,225, 56,142, 58, 76,198,166, 77,155, 60,150,117,153, 76,134,245,235,215,151, 42,239, -235,214,173,243,106,218, 4, 65,112,142, 36,244, 22,193,114,108,234, 53,204, 42,147,129,231,121,204,159, 63, 31,148, 82,103,228, -138,227, 56, 76,152, 48, 1, 74,165, 18, 31,124,240, 1, 38, 76,152,224, 83, 20,203, 53, 42, 86,107,188,225,223,202,209,190,173, -197,108, 46,137,210,115,156,171,201,242, 41,210,230,173,131,123, 69, 76,176,107,164, 77,169, 84,150,217,185,221,125,211,178, 52, - 15, 30, 60,248, 93, 92, 92,220,185,208,208,208,141,109,218,180, 81, 30, 60,120, 16, 99,198,140, 33, 38,147,201,127,211,166, 77, -206,255,245,116,188,138,139,139, 85,172,228, 48,110, 97, 4,107,138,135, 69, 65, 14,227,100, 55, 67,190,234,173,117, 93,223,161, -225,110,138,236, 17,177,237,222,180, 60,109, 91, 22, 66, 89,225,110,247, 74,194,155,209,242,229,238,211, 96, 48,108,222,186,117, -107,203, 71, 30,121, 68, 40,175,121,176,168,168, 8,225,225,225, 56,127,254,188,205, 96, 48,120,157,254, 64, 20,125,159, 16,221, - 91, 4,203, 67,101,114, 32, 54, 54,214,102,177, 88, 80,183,110, 93, 68, 69, 69,193, 96, 48, 96,206,156, 57, 54, 95,205, 21, 33, - 68,158,144,144,192, 3, 64,126,126, 62, 80, 50,218,161, 94,189,122,245,144,152,152,136,220,220,220, 85, 0,186, 78,153, 50,165, -197,131, 15, 62, 40, 95,190,124,185,126,244,232,209,171,172, 86,235,135, 62,222,129,155,109, 54, 91, 45,142,227, 44,121,121,121, -105,174,198, 42, 60, 60, 60, 72,167,211,113, 87,175, 94,181,250,114,120,154, 54,109,186, 63, 53, 53, 21,239,191,255,126,214,180, -105,211,234, 21, 22, 22,230,230,231,231,219, 28,198,170,160,160, 0, 6,131,129, 11, 13, 13, 85, 46, 88,176, 64, 3, 0, 77,155, - 54,221, 15, 54,225,232,189,126,215,120, 93,211,160,167,105, 26,124,189,153,114, 53, 46,253,251,247,191, 46, 34,230,120,173, 88, -177,162, 84,191, 38,111, 77,111, 14,205, 47,191,252, 18,175,190,250, 42,148, 74, 37,102,207,158, 93,170, 15,150,167, 77,203,211, -116,152,182, 90,227, 13,184, 50, 55, 24, 50,153, 12, 33,163, 51, 75, 53, 17,122,186,203,246,197, 8, 78,155, 54,173, 82,154, 8, - 93, 77,159, 99, 74,156,133, 11, 23, 98,240,224,193,216,177, 99,199, 13, 55, 17,214,170, 85,107,241,156, 57,115,148, 39, 78,156, - 64, 65, 65, 1,178,178,178, 96, 52, 26,145,146,146,226, 60,135,101, 68,202,213,172,212, 48,110, 69,244,170,156,197, 89,110,253, -167,136,107,115, 93, 57,239,238,235,195,229, 55, 87,221, 44,148, 30, 40,230,250,187,187,169,114,255, 15,215,117,178,174,139, 96, -149,113,225,246,121,154, 6,123, 7, 73,111, 70, 96,214,123,239,189,247, 82,187,118,237,130,253,253,253,145,158,158,238, 49,130, -229,239,239, 15,139,197,130,173, 91,183, 22, 72,146, 52,203,203, 57,177, 90,173, 86,132,133,133, 33, 59, 59, 27, 82, 25, 97,124, -142,227,160, 86,171, 81, 84, 84, 4,183,131,232,211,133,194,106,181,194, 98,177,192, 98,177,192,106,181, 86, 52,223,168, 29, 19, -182, 22, 23, 23, 3, 64,113,100,100,100,109,149, 74,229, 24,245,120, 6, 64,151, 30, 61,122,200,114,114,114,232,115,207, 61,183, -135, 82, 58,198,203,108,246,230,173, 91,183,214, 4, 0,181, 90,125, 6, 0, 82, 82, 82,172,121,121,121, 40, 42, 42,114, 70, 8, -213,106, 53, 6, 12, 24, 80,149, 82,138,173, 91,183,214,148,203,229,180, 28, 51,100, 90,187,118,237,241,128,128,128,165, 51,102, -204, 24,250,240,195, 15, 39, 53,109,218,180, 86, 81, 81,209, 85,189, 94,111, 48, 24, 12, 84, 16, 4,121, 72, 72,136,114,227,198, -141,231,246,236,217,243,144,191,191,255,210,181,107,215, 30,183,135, 86, 25,247,230, 29, 99,169, 40,142, 39, 83, 85,145, 17,116, -174,198, 69, 16, 4,172, 95,191,190,220, 40,142,175,154,174, 38,227,245,215, 95,199,220,185,115,175,139, 96,125,248, 97,201, 61, -201,219,111,191, 93,161, 8,145, 32, 8,184, 50, 55, 24, 85, 95,185,118, 93, 4,139,216,211, 87,145, 38, 66,199,246, 83,167, 78, -133, 76, 38,115, 54,225, 61,244,208, 67,165,154, 6,125, 53, 86,174,154, 87,175, 94,133, 32, 8, 8, 14, 14,198,208,161, 67,209, -189,123,247,235,244,124,213, 77, 73, 73,249,103,230,204,153,213,163,162,162,176,124,249,114,179, 86,171, 85,116,233,210,133,230, -231,231,147,242, 34, 88, 6,131,129, 69,176, 24,183,155, 3,183, 89,247,166,255, 79,240, 86,233,222,204, 52, 13,238, 79,219, 78, - 78, 78,206,143,136,136, 24, 54,100,200,144,223,231,207,159,175,174, 93,187, 54, 78,157, 58,133,220,220, 92, 88, 44, 22,200,229, -114, 68, 70, 70,162,168,168, 8,191,254,250,171, 94,175,215, 15,203,200,200,200, 47, 79,147, 16,242,118,175, 94,189, 22,188,243, -206, 59,170,198,141, 27, 35, 55, 55, 23, 69, 69, 69,206, 59, 47, 66, 8,252,253,253,161,209,104,112,236,216, 49,236,217,179,199, - 64, 8,121,187, 60, 77, 79, 70,211, 97,172, 28, 70,203,219,200, 36, 55, 77,173, 70,163,113,220,249, 1,128,173,122,245,234,225, - 0, 28, 6,235, 82, 76, 76,204, 59,117,234,212, 33,139, 23, 47,166,148,210, 77,158,204,149,155,102,110,199,142, 29,243, 0,132, -155,205,102, 57, 0, 20, 20, 20, 88, 66, 66, 66,194,148, 74,165,164, 84, 42, 37,149, 74, 37,101,100,100,216,108, 54,155, 28, 0, - 58,118,236,104, 6,144, 9,251,124, 85, 30, 52, 37, 0,133,243,230,205,155,252,212, 83, 79,181,110,219,182,109,236,115,207, 61, -119, 98,244,232,209,136,138,138, 10, 42, 42, 42, 50,158, 57,115, 38,111,254,252,249,198,253,251,247, 63, 36,147,201, 46,205,155, - 55,111, 50, 74,230, 35,145,124, 61,158, 55,104, 2,152,230, 45,210,116,244,253,241,100,172, 92,191,251, 48,141, 66,169,116, 58, - 76,219, 99,143, 61,230, 28,125,232, 30,185,170,168, 38, 0,231, 8,194, 55,223,124,179, 84,250,222,121,167,204, 46,144,164,156, -125,119, 70,155, 4, 65, 64,254,194,168, 82,230,207, 87, 83,229, 73, 83, 16, 4, 76,154, 52,201,231, 8,150,123, 31,172,242,210, -217,177, 99, 71, 20, 23, 23, 67, 38,147, 97,195,134, 13,101, 70,176,188, 29, 79,181, 90, 61,116,213,170, 85, 63, 41,149,202,166, -102,179,249,153,236,236,236, 31,244,122,125,245,188,188,188,114, 35, 88, 70,163, 81,201,202, 17,211,188, 3,115, 97,221, 83,148, -123,139,103,179,217, 80,173, 90,181, 82,207,182,114,116,102,231,121,222, 57,242,196,151, 17,132, 14, 50, 50, 50, 54, 68, 68, 68, - 12, 28, 48, 96,192,146,167,158,122,202,175, 97,195,134,178, 26, 53,106,192, 96, 48, 32, 57, 57, 25,201,201,201,182,191,255,254, -187, 64,175,215, 63,145,145,145,177,193,155, 94, 90, 90,218,143,225,225,225,235,135, 15, 31, 62,169, 69,139, 22,163,198,142, 29, -203,199,196,196, 32, 63, 63, 31, 65, 65, 65, 8, 13, 13, 69,114,114, 50,126,253,245, 87, 49, 47, 47,111,129, 40,138, 83, 51, 51, - 51,179, 42,114,144,108, 54, 27,111,181, 90, 49,100,200, 16, 72,146,132,217,179,103,195,102,179,241, 21,144,176, 88, 44, 22, 10, -128,100,103,103, 3,128,222, 97,184,206,158, 61, 11, 0,151,107,214,172,169, 3,128,205,155, 55, 19, 0,187,125, 13,174,185, 70, -178, 26, 54,108,152,236, 94, 41, 58, 34, 87,142,168,151,171,185, 42, 3,227,208,161, 67,179, 76, 38, 83,143,215, 94,123,109,210, -194,133, 11,135, 46, 92,184,240,186,149,252,253,253,151,126,246,217,103, 83,135, 14, 29,154, 5, 54, 61,195,253, 81, 25,184, 69, -171, 42,218, 5,160, 44,205,213,171, 87,251, 60,185,166,183,168, 24, 33,196,227,136,196,242,234, 32, 95,158, 62, 85,214,132,162, - 55, 19, 21, 20, 4, 1,159,124,242,137, 51,114,229,218,249,252, 70, 34, 88, 14,205,224,224,224,146,187, 54,173, 22,146, 36,161, -119,239,222, 55,172,107,127,182,224, 64,199,247,132,132,132,169,203,150, 45,251,144, 82, 26, 2, 64,112, 61, 6, 21,127,138, 23, -131,193, 12,150, 71, 68, 81, 76,117, 60, 91,208,151,135,192,218,141, 72,170,143, 38,107,125, 76, 76, 76,204,194,133, 11, 95,213, -106,181,221,140, 70, 99, 83, 0, 80,169, 84, 71,139,139,139, 55,113, 28, 55, 39, 35, 35,195,231,135, 51,219, 13,211,203,209,209, -209,179,135, 15, 31,254, 97,155, 54,109, 6, 61,247,220,115, 68, 16, 4,252,242,203, 47, 52, 45, 45,109, 5,199,113,111,167,167, -167,159,191,145,131,164,209,104, 78,175, 88,177,162,246,234,213,171, 97,181, 90,177, 96,193, 2, 40,149,202,211,190,110, 79, 41, -205, 18, 4, 97, 73,219,182,109,135,238,217,179,103, 41,165,244,152, 82,169,252,169, 67,135, 14,195,118,239,222,253, 51,165,244, -132, 32, 8, 63,181,105,211,102,216,254,253,251,127,163,148, 30,169, 64,242,156,145, 44,155,205,115,139,162,167,200,149, 23, 10, - 70,142, 28,105, 25, 57,114,228,107,131, 6, 13, 90,152,152,152,248,128, 99,250,134,192,192,192,163,241,241,241,251, 86,172, 88, -113,202, 30,185, 98,230,234, 30,199,209, 33, 61, 40, 40, 8, 28,199, 57, 95,142,217,188, 43,106,132, 28,154,148, 82, 4, 5, 5, -121,188, 49, 43, 71,147,120, 41, 75,208,233,116, 78, 77, 31, 71, 47,123, 13, 67,233,116,186, 82,105,244,241,230,166,220,125,119, - 79,167, 47,199,204,155,166, 86,171,133,197, 98,241, 89, 19, 62, 12, 26,112,229,224,193,131,223, 1,248,174,110,221,186,103, 1, -212, 97,166,138,193,184, 5, 6,235,228,201,147, 9,183,242,143, 47, 92,184, 80, 0, 96,170,253, 85, 41,164,166,166,158, 7,240, - 88,213,170, 85, 63,221,189,123,247,187,246,202,245,125,111,207, 51,244,198,145, 35, 71, 30,145,201,100,243, 22, 45, 90,212,134, - 82,138,128,128,128,221,231,206,157,123,177,130, 81,176, 81,132,144,177,142, 81,129, 38,147,105, 20, 33,228, 13, 74,105,177,203, -114,231,247, 10, 66, 81,210,217, 46,162,140,229,190, 68,174,174,139,100, 1, 48,175, 88,177,162, 8,192, 97,252, 59,207,149,213, -254, 50,193,165, 89,144,113,239, 98,179,217,210, 58,117,234, 36,120,187,129,242,176, 93,106,121, 55,104,237,219,183,199, 13,104, -166,149,147,212, 75,109,218,180,225,124,213,114, 96,181, 90,175,150, 99,190, 82, 91,183,110,237, 49,157, 94,142, 89,185,251,222, -186,117,235, 10,165,209,158,150,180,202,214,244,114, 60,203,196, 96, 48,228,134,134,134, 22, 25,141, 70,153,201,100,146,185, 71, -236,213,106,117, 22, 43, 57, 12,198, 13, 26,172,123, 25,187,161,234, 91, 89,122,246,254, 80,207, 87,130,142,209,237,123,113,121, -223, 43, 72,238, 45, 56,148, 18, 0, 3, 43, 38,247, 55,199,142, 29,123,160,178, 53,143, 31, 63,158,112, 11,210,217,186,178, 53, -147,146,146, 18,254,171,154,229,145,150,150,246, 0, 43, 25, 12,198,205,193,177, 67,192, 96, 48, 24, 12, 6,131, 81,185, 16, 0, - 77, 60, 45,168,200,232, 0, 66, 72,147,138,254,177, 55,125,166,201, 52,153, 38,211,100,154, 76,147,105,222,127,154,222,180,239, -151,209,137,228, 86,118, 98,100, 67, 88,153, 38,211,100,154, 76,147,105, 50, 77,166,249, 95,132, 53, 17, 50, 24, 12, 6,131,193, - 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6, 51, 88, 12, 6,131,193, 96, 48, 24, 55, 10, 33, -132, 68, 71, 71,119,140,140,140,108,253, 95, 61, 6, 2,203, 6, 12, 6,131,193, 96, 48, 42,131,234,213,171, 7,138,162,248, 84, -100,100,228,139,181,107,215,174, 13, 0, 81, 81, 81,199, 40,165,115,212,106,245, 79,231,206,157, 51,255,103, 76, 38,123, 20, 2, -131,193, 96, 48, 24,140,155, 33, 50, 50,178, 5,128, 23,213,106,245, 19, 15, 60,240,128,162, 75,151, 46, 8, 10, 10,130,205,102, - 67, 70, 70, 6,254,254,251,111, 28, 62,124,248,154,213,106,157,103,181, 90,231,101,101,101,101,254,103, 12, 22, 33,100, 27, 0, - 80, 74, 59,178,172,194, 96, 48, 24, 12, 6,195, 23, 34, 34, 34,102,246,236,217,243,181,160,160, 32,212,173, 91, 23, 85,171, 86, -133,201,100,130,193, 96, 0,165, 20,130, 32,128, 82,138,194,194, 66, 28, 60,120, 16,251,246,237,179, 21, 20, 20, 44, 37,132,204, - 73, 79, 79,255,167,148, 41,185,143,188, 8,161,148,130, 16, 66, 1,116,178,239,212, 54,150, 93, 24, 12, 6,131,193, 96,248, 66, -100,100,100,230,230,205,155,195, 68, 81, 68,118,118, 54, 76, 38, 19,244,122,189,211, 96,241, 60, 15, 74, 41,108, 54, 27, 0, 64, -146, 36,156, 56,113, 2,123,246,236, 65, 74, 74,202,103, 25, 25, 25,175,219,205,213,125,229, 69,156,157,220, 41,165,219,152,185, - 98, 48, 24, 12, 6,131, 81, 81, 76, 38, 19, 22, 47, 94,140,236,236,108, 84,171, 86, 13, 81, 81, 81, 8, 8, 8,128, 74,165, 2, - 0,167,185, 2, 0,142,227, 16, 27, 27,139, 97,195,134,129, 16, 50,204, 85,231,126,242, 34,172,147, 59,131,193, 96, 48, 24,140, -155,193,106,177, 88,144,144,144,128,139, 23, 47, 34, 49, 49, 17,113,113,113,104,212,168, 17,178,179,179,145,158,158, 94,106,229, -253,251,247,227,208,161, 67,232,208,161,195,125,125, 80, 28, 77,132,147, 1,116,180,187,199,142, 44,175, 48, 24, 12, 6,131,193, -240,133,168,168,168, 17,161,161,161,243,135, 15, 31,174,110,222,188, 57, 82, 83, 83,145,150,150,134,220,220, 92,180,104,209, 2, -177,177,177, 56,127,254, 60,214,175, 95,143, 67,135, 14, 65,169, 84, 34, 58, 58, 26,186,165,203,240, 71,100, 68, 90,122,122,122, - 52,128,251,206,139,184,118,114,119,236,212, 54,150, 93, 24, 12, 6,131,193, 96,248, 74,100,100,100, 8, 33,228,237,200,200,200, -151,158,120,226, 9, 89,157, 58,117,144,154,154,138,236,236,108,228,230,230, 98,239,222,189, 14, 51,134,168,168, 40, 36, 39, 39, -227,216,177, 99, 6,147,201, 52, 58, 45, 45,237, 71,167, 41,185,143,188, 8,155,166,129,193, 96, 48, 24, 12, 70,101, 25,173,106, - 0,166,212,169, 83,103,196,224,193,131,185,200,200, 72,164,165,165,225,239,191,255, 70,237,218,181,113,245,234, 85, 28, 60,120, - 80, 44, 40, 40, 88, 32,138,226,212,204,204,204,172,251,245, 88,220,210,153,220, 9, 33, 77,152, 38,211,100,154, 76,147,105, 50, - 77,166,249,223,208, 76, 79, 79, 79, 73, 79, 79,127,250,204,153, 51,177, 31,126,248,225,170,249,243,231,131,231,121, 68, 70, 70, - 98,203,150, 45,116,243,230,205, 43,138,138,138,234,167,167,167,191,124, 63,155, 43,128,117,114,103, 48, 24, 12, 6,131, 81,201, - 92,185,114,229, 36,128, 71,162,162,162, 30, 72, 74, 74,122, 11, 0, 36, 73,122,255,202,149, 43, 7,255, 43,199,128, 25, 44, 6, -131,193, 96, 48, 24,183,132,180,180,180,125, 0,250,254, 23,247,157, 61,236,153,193, 96, 48, 24, 12, 6,131, 25, 44, 6,131,193, - 96, 48, 24, 12,102,176, 24, 12, 6,131,193, 96, 48,254, 83, 16, 0, 30, 71, 2, 80, 74,143,249, 44,114, 3, 35, 20,188,233, 51, - 77,166,201, 52,153, 38,211,100,154, 76,243,254,211,244,166, 93, 17,255,113, 87, 27, 44, 95,230,193, 34,132, 16,122, 3, 19,102, - 17, 66,154, 84,246,129, 98,154, 76,147,105, 50, 77,166,121,107, 52,111,164,174,247,164, 73, 8, 33, 46, 55,241, 0, 64,237, 23, - 78,122, 55,165,243, 94,217,247,255,138,230,253,134,224,229, 0,114, 40,105, 70, 36,132, 16, 9,128, 84, 25, 7,202,126, 18,184, -202,210, 99,220, 2,231, 93,114,142,200,191, 55, 20,236, 60, 49, 24,247,113,121,175,180,186,222,165,238,224, 29,154, 0, 68, 0, - 34, 33,228,166, 46,182,183,226,154,116,183,239,251,127, 89,243,190, 52, 88,142, 3, 21, 26, 26,186, 33, 44, 44,172,115,118,118, -182,100,255, 29, 81, 81, 81,224, 56, 14,130, 32, 24, 46, 94,188,232, 95,209, 63, 12, 15, 15,255, 54, 54, 54,246,169,156,156, 28, -137,227, 56, 84,171, 86, 13,132, 16,240, 60, 15,158,231, 13,231,206,157,243,191,211, 7, 37, 62, 62, 62,215,108, 54,235,220,127, - 87, 40, 20,198,196,196, 68,191,255, 64,101, 43,212,171, 87,239,113,141, 70,163,118,252, 22, 23, 23,231,186, 10, 61,116,232,208, - 66, 95,245,106,213,170,181, 95,173, 86, 7, 10,130, 0,158,231, 33, 8, 2,138,139,139,243, 78,156, 56,209,202,190,124,151, 90, -173, 14,225,121,222,145,183, 96, 52, 26,115,142, 31, 63,222,150, 93,250,174,167, 83,167, 78, 2, 42, 62,197,138,109,235,214,173, -182,219,152, 76,206,156,232, 87,135,216, 12,205, 8, 71, 3,168, 68,242,169,160, 62,162,136, 47, 60,231,227,246,210, 29, 46, 3, -213, 1,216, 40,165,233, 55,178,177,135,138,182,167, 8, 12,177,127, 53,114, 64, 14, 1,206,132, 0,191,102, 2,134, 82, 43,223, -198, 11,145,163,174,143,142,142,158, 19, 30, 30,254,116, 97, 97,161,158,231,121, 16, 66,104,108,108,236,117,187, 67, 8,129, 36, - 73,169, 73, 73, 73, 9, 94, 46,178,178,234,213,171,127, 22, 26, 26,250,164, 94,175,215, 19, 66, 64, 8,161,132, 16, 52,109,218, -212,169,233,120, 23, 69, 49,245,216,177, 99, 9,183, 43,157,119,106,223,155, 52,105,226,212,114,104, 75,146, 84,230,190,187,106, - 70, 71, 71,127, 22, 30, 30,254,100, 81, 81,145,158,227, 56,167,102,108,108,236, 13,167,243,110,214,188,159, 35, 88, 92, 88, 88, -216,170, 86,173, 90,117, 90,189,122, 53,119,242,228, 73,174, 97,195,134, 16, 69, 17,146, 36,129, 82,138,248,248,120, 77, 69,255, -172,106,213,170, 63,180,108,217,114,200,154, 53,107,184, 85,171, 86,113, 45, 91,182, 4, 33, 4,162, 40, 66, 20, 69,116,237,218, - 85,125,147,149,133, 78, 16,132,177, 10,133,162,163,205,102,107, 4, 0, 50,153,236,132,201,100,218,102,179,217,102, 81, 74,139, -124,209,177, 90,173,154,164,164,164,235,142, 77,171, 86,173, 20, 55,154,182,122,245,234,237,230, 56, 46,198,181,208,122,123,167, -148, 94, 72, 74, 74,106, 83,150,102,131, 6, 13,188,106,186,255, 38, 73,210,133, 99,199,142,181, 41,207, 92,213,173, 91,119, 72, -227,198,141, 85,191,252,242, 11, 82, 82, 82,160,213,106, 33, 73, 18, 68, 81,132,213,106,197, 35,143, 60, 66, 42,178,239,106,181, -218,255,239,191,255,174, 19, 22, 22,134,171, 87,175, 34, 59, 59, 27,163, 70,141, 58,227,178, 60,100,203,150, 45,245,130,131,131, -161,215,235,145,159,159,143, 97,195,134,221,243,133,171,123,135,218, 31, 16, 32,216,241, 93,148,112,109,211,206,243,239,220,172, -174,201,100,202, 16, 69, 49,200,203, 53,189, 20, 60,207,231, 2, 8,245, 82,126,106, 2,232,203,243,124, 93,153, 76,214,128, 82, - 90,211,102,179,133, 3,128, 92, 46,207,228,121, 62,217,106,181,158, 50,155,205,103, 1,172,161,148, 38,151,165,101, 78,244,171, - 35,154,244,131,138, 77, 82,111,137,162, 42, 71,112, 69,171,212,255,105, 78,244, 91, 81, 1,147,117,167,204, 85,173,200,200,200, - 79,236,159,199, 81, 74, 47,222,172,166, 8, 12,161,148, 6, 0, 64,126,126,126, 64, 74, 74, 74,213, 53,107,214,196, 78,155, 54, -173,139,194,104,252,216, 12,156, 40,111,251,135, 58,214, 57, 40, 16, 18,237,116,203, 84, 74,221,184,237,124,101, 92,152,184,168, -168,168, 57,189,122,245, 26,190, 96,193, 2,205,190,125,251, 52, 77,155, 54, 69,201,133, 17,206,250,158, 82,234,204, 99, 15, 62, -216,186,220,195, 7, 64,136,140,140,156,221,171, 87,175,161,243,230,205,211,156, 58,117, 74, 83,171, 86, 45,167,166,107,158,181, - 95,128,209,188,121,139,219,157,206, 91,186,239, 61,122,244, 24,186, 96,193, 2,205,209,163, 71, 53,245,234,213,115,106,186,123, -103,142,227,144,144,208,210, 39,205,158, 61,123, 14,253,234,171,175, 52,137,137,137,154, 70,141, 26,217, 77, 26,156,105,188,145, -116,222,229,154,247,159,193, 34,132,112,161,161,161,139, 19, 18, 18,122,172, 94,189,154, 7,128,196,196, 68,228,228,228, 32, 42, - 42, 10, 58,157, 14, 42,149, 10, 70,163,177, 66,119, 89,225,225,225,223,182,106,213,106,200,234,213,171,101, 0,240,219, 19,143, -224,130, 12, 24,115,213, 12,185, 92,142,115,231,206,129,231,249,155, 9, 29,119,240,243,243,251,113,229,202,149, 65,113,113,113, - 92,118,118, 54,106,213,170,133,107,215,174,181,218,190,125,123,252, 51,207, 60,243, 12, 33,100, 4,165,116,187,175,154,127,252, -241, 7,180, 90,173,243,101,177, 88,200,141,166,143,231,249,232,125,251,246,133,233,116, 58,136,162, 8, 74,105,169, 2,236, 94, -240, 36, 73, 66,251,246,237, 45,229,158, 60, 65,136,222,183,111, 95,152, 90,173,190, 78, 75, 20, 69, 40, 20, 10,112, 28,231,184, - 67,132,205,102, 67,155, 54,109, 44,229,221,209,213,171, 87,239,113,135,185,226, 56, 14,203,151, 47, 71,213,170, 85, 17, 22, 22, - 6,173, 86, 11,181,186,226, 30, 88, 16, 4,132,132,132,224,165,151, 94,194,227,143, 63,142, 37, 75,150, 64, 38,147,149, 90, 30, - 28, 28,140,191,254,250, 11,254,254,254,168, 81,163, 70,169,229,247,108, 36, 16, 8, 94,191,253,188, 51, 34, 59,168, 79,115,161, - 91,251,152,121,206,202,181,100, 37, 42,149,172, 75, 37, 81,204,221,188,235,210, 36, 31,110, 0,170,236,218,181, 11, 74,165,210, -183,139,187, 40,162, 85,171, 86, 85,188,148,159,222, 77,154, 52,249,237,165,151, 94,146,215,169, 83,135,200,100, 50, 8,130, 0, - 65, 16, 28,249,177, 6,165,180,134, 36, 73,157, 50, 51, 51,233,231,159,127,254, 49, 33,100, 0,165,244, 79,143,122, 54, 67,179, - 98,147,212,155, 82, 84, 13,239, 70,171, 95,221, 68, 80,108,146,122, 7, 8,134,115, 0,238, 90,131, 69, 8,241, 87,171,213,239, -254,242,203, 47,114, 0,232,214,173,219,187,132,144,255, 81, 74, 11, 42,235, 63, 2, 2, 2, 16, 16, 16,128, 38, 77,154, 96,224, -192,129,129, 45, 90,180,120,163,166,201, 52, 42, 25, 48,151, 89,134, 56, 46,122,221,150, 51, 97,142,239, 67, 31,137,147,247,232, - 84, 39,179,164,131,139,251,218, 20,146, 72, 83, 55,237,188,144,224,101, 95,185,170, 85,171,126,218,179,103,207,199, 22, 44, 88, -224, 7, 0,223,126,251, 45,122,247,238,141,170, 85,171, 66,173, 86, 67, 46,151, 67, 46,151, 67, 38,147, 57,223,189, 68,132,248, -170, 85,171,126,252,240,195, 15, 15,154, 55,111,158, 31, 0,252,240,195, 15,232,211,167, 15, 66, 66, 66,224,239,239, 15,165, 82, - 9,133, 66, 97,215, 34,240, 22,175,243,148,206,231,186,119, 65,140, 90,137,190, 31,126,130,192,192, 64,252,253,250,139,144,113, - 28, 94,252,107, 27,252,253,253,189,214, 31,158, 52, 19, 19, 19,145,153,153,233,113,223,121,158, 47,183,188,185,238,123,239,222, -189, 7, 57, 52,127,248,225, 7,244,232,209, 3, 33, 33, 33,208,233,116,206,125,255, 87,155,243, 73,179, 71,143, 30,131,190,250, -234, 43,167,102,215,174, 93, 17, 28, 28, 12, 63, 63, 63,200,229,114,231,241,172,200, 57,186,155, 53,239, 75,131,229,232, 27, 21, - 22, 22,246,216,218,181,107,157,103, 94, 38,147, 65,169, 84, 58, 51,135,235,133,219,215, 48,116,108,108,236, 83,171, 87,175,118, -110,100,118, 43, 84, 42,149,170, 66,154,110,250,221, 58,119,238,188,108,237,218,181, 42,185, 92, 14,131,193,128,164,164, 36, 4, - 4, 4, 64,161, 80,160,127,255,254,124,155, 54,109, 66, 58,119,238,252, 43, 33,100, 40,165,116,147, 55, 77, 74, 41,116, 58, 93, - 41,131,117, 51,145,123, 66, 8,212,106, 53, 86,173, 90, 5, 65, 16, 74,101, 50, 79,149, 88,120,120,184,215,168, 4, 0, 40,149, - 74,236,222,189, 27, 28,199, 65, 38,147, 57, 95,127,252,241, 7, 94,127,253,117,100,102,102, 58,151,249,249,121,109,221, 36, 26, -141, 70,237, 48, 87,142,115,175, 86,171, 33,147,201,136, 32, 8,132,231,121, 0,160, 21,233, 16, 42, 8, 2,146,147,147,241,196, - 19, 79, 96,209,162, 69,120,255,253,247, 49,116,232,208, 82,203, 11, 10, 10, 16, 20, 20,132,192,192, 64, 40,149,202, 27,206, 11, -119, 19,146,219,209,153,250,254,199,154,146, 14, 30, 18, 32, 1, 20,212,249, 57, 35,227, 28,102,126, 58,151,247, 85, 91,169, 84, - 98,215,174, 93,112,109,118,229, 56, 14,114,185,188,212,111,130, 32, 32, 34, 34,194, 23,189, 41, 43, 87,174, 84, 44, 95,190, 28, -191,255,254, 59, 68, 81,132, 76, 38,131, 74,165,130,191,191, 63,130,131,131,157,175, 26, 53,106,144,239,190,251, 78,222,172, 89, -179, 41, 0, 60, 27, 44,142, 6, 72,118,115, 5, 0, 97,221,104,245,243,171,249,160, 64,191,146, 40,206, 93,106,174, 4, 0, 19, -191,248,226,139,144,248,248,120, 0,192, 23, 95,124, 17, 50,114,228,200,137,132,144,119, 40,165, 55,220,196,202, 3,203, 8, 33, - 67,236, 17, 91,213, 67, 15, 61,164,248,242,203, 47,209,160, 65, 3,188,242,202, 43,193, 51, 63,254,184, 47,128, 21,101,231,165, -210,153,105,250, 39,115, 3, 93,111,168,254,125, 1,215,178,146,241,238,187, 31,120,173,147, 1,112,145,145,145,207,124,253,245, -215,206,238, 16,193,193,193,206, 58,200,189,142,114,188,151, 83, 47, 17,123, 84,104,228,130, 5, 11,156,154,161,161,161,165, 52, -100, 50, 25,146, 79,252,131,117,223,206,128, 54, 36, 2,195, 94,159, 94,225,116, 70, 41, 21,136, 86, 43,208,172, 89, 51,168,213, -106, 36,202, 74, 46,101, 14,115, 85, 94, 58,203,210,228,121,222,153, 70, 74, 41,140, 70, 35, 10, 11, 11, 33,138, 34,204,102, 51, -226,227,227,125,218,247,175,190,250,202,169, 89,165, 74, 21,103,253,238, 90,207, 59, 94,142, 27,152,242, 52, 35, 35, 35, 71,126, -243,205, 55, 78,205,144,144, 16,167,150, 32, 8,144,203,229,248,225,135, 31,224, 99, 68,219,103,205,138,158,119,119,205,139, 23, - 47, 98,218,180,105,144,203,229,142, 46, 64,206,136,101, 84, 84, 20, 62,255,252,115,159,174,113,247, 85, 4, 11, 0,201,206,206, -150, 78,158, 60,201, 29, 60,120, 16,114,185, 28,161,161,161,104,213,170, 21, 0,192, 98,177, 64, 16, 4,168,213,106, 82,175, 94, -189, 76,199, 65,115,188,187,182,165,187,140, 48,224,174, 93,187, 38,109,216,176,129, 91, 50,176, 7,204, 20,104,241,238,116,244, -232,211, 7,235,163, 20,224, 1,180, 58,153, 13,133, 66, 33, 68, 68, 68, 88, 29, 39,193,161,235,218, 55,203,195,168, 5, 63,173, - 86,251,221,154, 53,107, 84, 28,199,161,176,176, 16,146, 36,161,109,219,182, 32,132,224,232,209,163,120,231,157,119,240,219,111, -191, 97,229,202,149,234,184,184,184,239, 8, 33,141, 40,165,133, 46,102,234,152,167,204,233,239,239, 15,181, 90,237, 52, 88,106, -181,154, 52,104,208, 32,211,209,126,238,214, 28,151,150,148,148, 20, 95,150,166, 35,146, 48, 96,192, 0,103,159, 51,199, 5,208, -181,176, 57, 62, 39, 37, 37,121, 50,125,215,105, 74,146,132,118,237,218, 1, 0,180, 90, 45,116, 58, 29,182,108,217,226, 92, 30, - 23, 23, 7,179,217,140, 42, 85,170,224,196,137, 19, 62,105, 94,185,114, 5,139, 23, 47,134, 76, 38, 67, 72, 72, 8,100, 50,153, -124,211,166, 77,239,107,181,218, 0,158,231, 17, 24, 24,136, 62,125,250, 44,232,219,183,175, 35, 13,226, 31,127,252, 33,148,165, -201,243, 60, 84, 42, 21,126,248,225, 7, 76,155, 54, 13,111,189,245,150,123,116, 15, 70,163, 17, 33, 33, 33, 8, 10, 10, 66, 80, - 80,144, 79,233,188, 89,110,181, 38, 5, 69,210,161,245, 56,126,120, 19, 68, 42, 66, 18, 37, 80,137, 66,148, 36, 28,218,184,191, - 94,198,133,244, 40, 10,234,236,109, 36, 22, 21,219, 58, 85, 81, 54, 0,176,106,107,182,105,182,183,116,242, 60, 15,139,197,130, -245,235,215,227,220,185,115,216,176, 97, 3, 12, 6, 3,170, 84,169,130,192,192, 64,180,105,211, 6, 35, 71,142,244,104,176,220, - 53, 69, 81,252, 33, 45, 45,173, 69,155, 54,109, 72,126,126, 62,178,179,179, 81, 88, 88, 8,139,197, 2,139,197,226, 60,135, 90, -173, 22, 85,171, 86,133,193, 96,160, 38,147,233,135, 50,247, 93, 34,249, 28,193,149,243,171,132, 42,181,251,219,212,153, 91, 66, - 76, 6,179,220, 54,127,149,102,228, 31,227,107,119,231, 40, 71,129,146, 93, 39, 4, 84, 18,197,236, 77, 59, 46,188,116,135,207, -251,168,177, 99,199, 54,114,109,158, 30, 54,108, 24,146,146,146, 26,205,154, 53,107, 20,128, 47, 42,170,169, 6,162, 0,192, 6, -252,133,146, 23,166, 24, 12,228,253, 85,171, 6, 0,120,114,229,202,149, 24, 58,116, 40, 62,253,248,227, 38,238, 6,171,212,241, -164, 20,201,103,182,227,226,153, 93,144, 36,201,254,162,101,126,166,190,165,147, 20, 21, 21, 25,247,237,219,167,251,254,251,239, - 17, 28, 28,140,154, 53,107,194,207,207, 15, 74,165,242, 58, 51,224,120,121,219,119,189, 94,111, 60,121,242,164,110,217,178,101, - 8, 9, 9, 65,141, 26, 53,160,213,106,161, 82,169,156, 55,232,251, 54,172,196,168, 17,253,145,115,249, 20,230,254,239,113,159, -211,249,220, 67, 93, 16,173, 86,160,255,212,233,104,212,168, 17, 86, 60,222, 15, 28, 1, 70,255,189, 23, 50,153, 12,223,247,238, - 0,165, 82,129,209,127, 31,240, 89,243,192,129, 3,160,148,162, 70,141, 26, 48, 24, 12,206, 40,155, 92, 46,199,166, 77,155,208, -175, 95, 63, 44, 89,178, 4, 15, 62,248,160,215,125, 47, 42, 42, 50, 30, 61,122, 84,247,211, 79, 63, 33, 56, 56, 24,213,170, 85, -131, 70,163,113,234,185,154,152,152,152, 24,228,229,229,161,118,237,218,229,106, 22, 23, 23, 27, 19, 19, 19,117, 75,150, 44, 65, -112,112, 48,162,163,163,161,209,104, 74, 69,194,166, 76,153, 82, 74,163, 89,179,102, 55,173, 89,209,243,238,174, 57,112,224, 64, -212,174, 93, 27,254,254,254,206, 99,224,110,180, 43, 72, 75,148,238,230, 96, 6,160,112,121,207, 2,112,192,195,122,142,223,101, - 0,154,219,151,137, 0, 10, 1, 4,122,208, 43, 75, 39,219, 30, 47, 14,117, 91,223,253,127, 74, 27, 44, 66,136,163, 60,118, 2, -176, 19, 0, 26, 54,108,136,156,156, 28, 40,149, 74,180,106,213, 10, 89, 89, 89,206, 48,159, 36, 73, 24, 60,120, 48, 63,126,252, -248, 48,142,227, 96,181, 90, 65, 41, 5,207,243,112,220,249,185,251, 0,142,227,208,166, 77, 27, 28,183, 31,211, 30,125,250, 32, - 58, 58, 26,201, 46,119,228, 67,135, 14, 37,175,191,254,186,224,136, 94, 80, 74, 97, 48, 24,208,172, 89, 51,117, 57,209,145,255, -253,250,235,175, 1, 10,133,194,105,174, 28,105, 57,121,242, 36,102,206,156,137, 39,159,124, 18,151, 47, 95, 70, 68, 68, 4,222, -120,227, 13,221,140, 25, 51,254, 7, 96,170,183,179,169,211,233, 74, 25,172, 17, 35, 70, 8,109,218,180, 9,211,104, 52,206,232, -150,221, 84,162, 77,155, 54,196, 91, 4, 75,146, 36,252,245,215, 95, 30,239, 14,221,239, 24,236,163, 46,124,210,220,183,111,159, -211,156, 57,162, 23,142,229, 73, 73, 73,206, 8,150,221, 8,150,167, 73, 29, 70,205, 17, 38,151,201,100,242,125,251,246,125, 24, - 17, 17,161, 27, 49, 98, 4, 10, 11, 11, 17, 25, 25,137,238,221,187, 67,146, 36, 88, 44, 22,140, 25, 51,166,220,200,139, 76, 38, -195,254,253,251, 49, 99,198, 12,140, 31, 63, 30, 11, 22, 44, 64,183,110,221, 74, 69,176, 28,119,186,254,254,119,124,140, 67, 37, -134,176, 0,139,205, 10,189,222, 0, 74, 69,136, 18,133, 36, 74, 56,186,245, 80,189, 11,135,207,197,174, 93,186, 88, 6, 0,198, -109, 43, 93,183,138, 24, 56,239,231,250,157,130,229,251,182, 94,179,236,243,210,236,140, 23, 95,124, 17,147, 38, 77,194, 99,143, - 61,134,141, 27, 55,226,237,183,223,198, 51,207, 60,227, 52,239,142,188,224, 67,179,227,215,195,134, 13,123, 97,197,138, 21, 13, - 94,123,237, 53,206, 81, 38, 53, 26, 13, 8, 33, 48, 26,141,206,215,201,147, 39,165,231,159,127,254,180,217,108,254,186,204,140, - 36,168,143,104,149,250, 63, 51,114,184,186, 87,254, 14,230,136,224,111, 9,173,209, 41,255,225,122,221,104,183,199,107, 6, 81, -169, 36,194, 71, 65, 97, 50, 22,227,173,241,227,248, 59,121,170, 8, 33,189, 31,122,232,161,238, 31,126,248,225,117,203, 62,252, -240, 67,156, 56,113,162, 59, 33, 36,185,172, 38,209, 50,204, 85,116, 64,213,170,179, 0, 64,125,229,202, 88, 3,144, 10, 0,239, - 3, 61, 68,160,223,198,141, 27, 1, 0,213,171, 87,135, 4, 52, 38,192,143, 60,176,204, 6,172,243, 20, 81,183, 88,109, 48, 24, -140,144,104, 73, 62,146,168, 4, 73, 44,137,130,186,155, 44,111,237,110,148, 82, 74, 8,145,120,158, 71,147, 38, 77,208,163, 71, - 15, 40, 20, 10,232,116, 58,103, 61,239, 94, 39,249,112, 81,164, 0, 36, 66, 8, 98, 98, 98,208,189,123,119,200,229,114,104,181, - 90,248,251,251, 59, 13, 22,207,243,104,210,166, 11,150, 45,249, 4,195,123,196, 98, 68,135,112,252,122, 52,219,167,116,214,208, - 40, 80, 67,173, 68,195,134, 13,225,231,231, 7, 66, 0,158,231,156,233,212,106, 84,144, 59,155, 31,125,219,247, 43, 87,174, 32, - 57, 57, 25,201,201,201,224, 56, 14,109,219,182,133, 66,161,128, 32, 8, 56,115,230, 12,166, 78,157, 10,179,217,236,211,190,115, - 28,135,186,117,235,162, 75,151, 46, 80, 40, 20,112, 92, 43, 92,155, 6,101, 50, 25, 10, 11, 11, 81,167, 78, 29,172, 90,181, 10, -237,219,183,247,170,217,168, 81, 35,116,234,212, 9,114,185, 28,106,181,218,217, 85, 71,225,178,175, 69, 69, 69,206,227,208,162, - 69,139, 10,105,110,216,127, 25, 11, 55,108,129,201, 44,161, 64,111, 45,181, 65, 68, 21,127,236,252,105,188, 79,251,238,208,252, -250,235,175,145,151,151,231,172,135, 56,142,115,190, 8, 33,136,142,142,198, 87, 95,125,229,169, 28, 58,189, 8,165,116,155,219, -226, 80, 66,200, 90,151,243,216,135, 16,178,214,245,189,172,245,236, 31, 59, 76,156, 56, 49, 97,198,140, 25,211, 90,183,110,189, -108,247,238,221, 75,203,210, 43, 75,103,226,196,137,177, 51,102,204,152,230,186,190,135,255,185, 62,130, 85,146,231, 8, 5,192, - 57, 34, 51, 81, 81, 81,206,118,103,157, 78, 7,185, 92,238,220,208,102,179,225,187,239,190, 67, 88, 88, 24,194,195,195,157,239, -101,101,232,234,213,171,131, 82,138, 87,178, 74,186, 0,253, 21, 41, 71, 50,128,135,179,168, 83, 79, 20, 69,172, 88,177, 2,126, -126,126,206,130,174,211,233,202,109, 46, 82, 40, 20,157, 90,182,108,201,153, 76, 38,103,152,156,227, 56,156, 60,121, 18, 51,102, -204,192,208,161, 67, 81,191,126,125,136,162,136,226,226, 98,116,238,220, 89, 54,119,238,220, 78,190, 26, 44,141, 70,227,236,119, -100, 50,153,176,121,243,102, 4, 6, 6, 34, 40, 40, 8, 33, 33, 33, 8, 14, 14,134, 82,169,116,205, 24,229, 54, 59, 14, 24, 48, -160, 84,228,202, 53,106,229, 90,161, 57,154,253,124,209,124,240,193, 7,157,209, 43,157, 78,135,117,235,254,173,159, 91,181,106, - 5, 74, 41, 66, 67, 67,177,103,207, 30,175,149,110, 92, 92, 28, 36, 73, 66, 88, 88, 24,100, 50, 25,217,180,105,211,251,118,115, - 69,100, 50, 25,254,249,231, 31, 36, 37, 37, 33, 52, 52,212,121, 87,234,141,226,226,226,140,185,115,231,138, 95,126,249, 37, 0, -160,107,215,174,200,207,207,191,234,178, 60,103,248,240,225,165,246, 55, 55, 55, 55,231, 62,240, 87,176, 89,108,208, 27,140, 40, - 42, 44,134, 85, 18, 97,181,137,184,154,150, 21, 56,254,245,177,178, 79,199,140, 4, 0,188, 62,251, 11, 20,126,245,111, 5,246, -251,235, 67,194, 6,204, 92, 62, 1, 64,255,242,244,245,122, 61,140, 70, 35,170, 87,175,142, 3, 7, 14,160,176,176, 16,221,186, -117, 43, 21,253,245,210, 4,225,122,238,205,132,144,182,125,250,244, 57,240,217,103,159,213,110,220,184, 49, 41, 46, 46, 70,113, -113, 49,244,122, 61, 28,159,143, 29, 59, 70,151, 46, 93,122, 65,175,215,183,161,148,150,217,103, 72, 17, 95,120,206,156,232,183, - 98,199, 17,121,159, 71, 7,246, 11, 72, 77, 75,177,229, 24, 84, 69,249,134,211, 38,145,158, 0, 21, 41, 68, 74, 65, 69, 9, 34, -149,112, 39,199,111, 19, 66,162,235,213,171,247,252,146, 37, 75, 60, 26, 82,158,231,177,100,201, 18,180,107,215,238,121, 66,200, -201,242, 58,247, 59,168, 9, 40,108, 50,217,248,159,127,254, 89, 14, 0, 93,186,116, 25, 95,211,106,125, 61, 25, 48, 55,110,218, -116,208,238,221,187, 3, 52,154,146,113, 66, 1, 1, 1,160,148,242,122,189, 62,160, 77,155, 54,131,224,201, 96, 73, 20, 86,171, - 13, 6,163, 9,121,249, 69,176,154,173,176, 73, 54,136, 54, 9, 54,169, 36, 58,106, 19, 69, 72, 54, 17, 54, 73, 4, 47,240,126, -157, 30,172, 94, 84, 18,203, 34,121,219,246, 94,174,230, 41,139,150,140,240, 2,170, 86,173,234,108, 18,118,237, 43,227, 45,138, -225, 1,177,164, 46,164,206,186,241,200,214,181,184,122, 98, 39,228,132, 66, 18,173,144,108, 22,136, 86, 11,120, 72, 56,113, 62, - 13,141, 35,189,214, 33,206,116,246,124,247, 3,180,106,213, 10,191, 14,233, 15, 66,128,209,155,247, 64, 46,151, 99,233, 35,221, -160, 80, 41,240,236,134,189,190,166,179,212,190, 39, 38, 38,226,149, 87, 94,193, 71, 31,125, 4,181, 90,237,188, 57, 57,117,234, - 20,150, 47, 95,142,135, 30,122,200,231,125, 39,164,164,169,213,113, 12, 39, 78,156,136,244,244,116,204,154, 53, 11, 9, 9, 9, -144,201,100,200,203,203, 67,155, 54,109,144,153,153,233,147, 38,165, 18,130,131,131,157,221,117,220,251,136, 57,110,100, 43,114, -142, 92, 53,159,126, 36, 2,171,119, 45, 5, 1,193,222,159,198,150,186, 30,205, 95,190,163,194,154,147, 38, 77, 42,149,206,138, - 68,175, 92,188, 8, 41, 99,121, 31, 31,235, 52,199,122,142,131,172,156, 49, 99,198, 52,247,237,189,233,185, 46,119,219,222,236, -102,202, 50,189, 54, 17, 82, 74,105, 84, 84, 20, 36, 73,130, 78,167,131, 66, 81, 18, 1,115,191,144,106,181,218, 82,142,220, 91, -123, 50,207,243,160,148, 58, 15, 44,239, 97,249,158, 61,123,174, 51, 1,223,124,243, 77,185,237,180, 54,155,173,145,159,159, 31, - 10, 11, 11,157,125,164, 20, 10, 5, 38, 76,152,128,225,195,135, 59,205,149, 66,161,192,162, 69,139, 16, 31, 31, 15,179,217,220, -168,188, 3, 42,151,203,245, 77,155, 54,229, 28, 81, 32,181, 90, 77,134, 14, 29,202, 91, 44, 22,168, 84,170, 82, 81, 39, 71,223, - 52,111,102,200, 17,109, 90,191,126,189, 79, 17, 44, 95,251, 32, 81, 74,113,232,208,161, 82, 70,205, 62,212, 24, 0,112,248,240, - 97,231,133,214,215,246,110, 81, 20,161, 86,171,137, 92, 46, 39, 90,173, 54, 96,196,136, 17, 78, 93,199, 57,119,236,183, 47, 29, -173,143, 28, 57,210,185,188,229, 71,143, 30,189, 47,167, 99,144, 36, 9, 22,171, 21, 6,131, 17,133,197,122, 76,153,110,111, 81, -155,130,125, 0,246,181, 29,245, 10, 94,236,241, 80, 23,120, 25,221, 87, 22,193,193,193,248,237,183,223, 32,147,201,176,106,213, - 42,248,251,251,163, 95,191,126,240,247,247,199,248,241,227,241,248,227,143,251,108,176,236,121, 41,159, 16,210,118,236,216,177, - 7, 62,254,248,227,234,213,171, 87,135,197, 98,129,217,108,134,197, 98,193,249,243,231,177,116,233,210, 20,189, 94,223,150, 82, -154,239, 77, 79, 17, 95,120,110,237,107,181, 51,218, 13,124,196,120,226,202, 6,100, 94,201,130, 77, 76,133, 77, 20, 97,179,218, - 74, 12,129, 36,193,102,177,129,231, 57,255,206,173,107,108, 42,233,240, 79,204, 91,247, 36,247,186,141,167,138,158, 57,115, 38, - 39, 52, 52,212,113, 7,233,111, 54,155,137,189, 46,161, 0, 28, 29,220,139, 1, 88,124, 17, 76, 1, 70,125,250,209, 71,213, 28, -205,247, 31,125,244, 81,181, 55, 94,123,109, 20,128, 57, 39,142, 30, 93,252,244,211, 79,143,253,229,151, 95, 74,109,243,244,211, - 79,227,196,209,163,139,203, 10, 17, 88,173, 86, 24, 12, 38,100,103, 95,195,115,163,223,253, 55,228, 12,234,236,232,110,159,213, - 17, 0, 84, 0,144,157,121, 22, 99, 94,121, 67, 89,214, 13, 85,227,198,141, 29,229, 29, 50,153,236,186, 78,200,174,245,187,183, -250,195, 30, 25, 42,213,197, 66, 46,151,227,220,238,181, 24, 59,106, 16, 32,218, 0, 75, 49, 96,209,131, 90,244,160,230, 98, 16, -133, 26,212,106,244,170,235, 72,167,163,219,134,192,115, 80, 42,254,173, 55, 53, 26, 53, 20, 42,133, 79,233,244,180,239,151, 46, - 93,194, 75, 47,189, 4,179,217,140,129, 3, 7,194,104, 52,194,100, 50,193,104, 52, 34, 38, 38, 6, 6,131,193,231,125,151, 36, -201, 25, 5, 28, 59,118, 44, 18, 18, 18, 48,117,234, 84,188,249,230,155,136,137,137,193,168, 81,163,176,108,217, 50,196,198,198, - 66,175,215,123,213,116,212, 37, 58,157, 14,130, 32, 56,235, 96,215,115,229, 48, 88,190,158, 35, 79,154, 37,211,129,225,186,243, -254,234,136,174, 21,214,156, 54,109, 26,178,179,179,175,139, 92,185, 70,176,230,205,155,119,163, 55, 68,107,125, 49, 89, 46,235, - 37,218,127, 50, 76,152, 48,225, 45, 66,200,218, 9, 19, 38,188, 53,125,250,244, 36, 95,244,202, 88,254,135,253,253, 97,151,223, - 18,189, 26, 44,160,100,232, 40,165,212, 25,214,116, 28, 56,199, 50, 0,208,104, 52, 88,187,118, 45, 86,172, 88, 81,234,130, 82, - 22, 28,199, 65,146, 36,252, 25, 90,114, 34,122,219, 35, 87,142,239,189,174, 74,232,211,167, 15, 98, 98, 98, 74, 69,175,212,106, -117,185,102, 67,146, 36, 92,186,116, 9,199,142, 29, 67,235,214,173,145,159,159, 15, 1,192,235, 71,143,162,241,136, 17, 48,217, -141,159, 66,161,192,243,207, 63,239,211, 9, 60,112,224, 64,169, 78, 64,141, 27, 55, 78,109,211,166, 77,212,158, 61,123,156, 17, - 45,165, 82, 9,149, 74,229, 52, 25, 62, 22,106, 12, 26, 52,168,148, 25,114, 55, 88,142,194,243,215, 95,127,249,212, 68, 72, 41, - 69,199,142, 29,157,209, 43, 63, 63, 63,252,254,251,239,206,117, 58,116,232, 0, 66, 8,194,194,194,176,110,221, 58,175,154,142, - 99,234, 56,247, 60,207,163,184,184, 24,137,137,137, 80, 40, 20,206,254, 25,106,181,218,185,255,140,178, 78,184, 4,179,213, 10, -189,193,136,194,194,146,138,244,220,177, 95, 75,173, 98, 49,221,248,224, 52, 71, 36,180,160,160, 0,155, 55,111,198,111,191,253, -134,132,132,132, 82,205,131,190, 54, 17,186,228,209, 44, 66, 72,187, 55,223,124,115,239,251,239,191, 31, 25, 18, 18, 2,139,197, -130, 75,151, 46,225,187,239,190, 75,215,235,245,237, 40,165, 89, 21, 16,132,205,106,131, 81,111, 64,126, 97, 49, 38,127,184,168, -204, 42, 2, 0, 44,230, 66,244,233,213, 81,113, 91, 79, 19,165,105, 0,158,113, 41, 87,139, 1, 4,216,191, 22, 80, 74,135, 87, - 68, 79, 6,116, 26, 56,104, 80,151,177, 99,199, 58,127, 27, 59,118, 44,246,238,221,219, 69,182, 98,197, 49, 43,176,149, 95,177, -162,201,172, 89,179,156,235,204,154, 53, 11,191,173, 88,241,183, 8,108, 45,235, 56, 90,237, 77,132, 69,197, 6,248, 7, 70, 32, -237,226, 54,175,105,145,243, 38,208,114,234,101, 71, 29, 82, 86,191, 27, 95,205,149,235,197,182,105,211,166,112, 52, 49,203,229, -114, 52,233, 50, 8,159,205,249, 6, 74,142, 98, 64,151,198, 8, 85, 75, 32,154, 96,200, 59, 78, 0, 9,172, 81,178,225,228,230, -240,165,174,219,246,246,235, 56,175, 85,225,249,141,187, 32,147,201,240,219,144,222,144, 43,228,120,242,143,237, 37,131,123, 70, - 14,128, 92,169, 64,247,249,203,125,185, 80, 59,247,253,220,185,115,216,181,107, 23, 26, 54,108,136,179,103,207, 58,251,216, 58, -174, 91, 62,182, 38, 80,199, 60, 87,142,122,252,202,149, 43,232,211,167, 15,228,114, 57, 22, 45, 90,132,109,219,182,225,205, 55, -223,196,211, 79, 63,141,206,157, 59,123,236, 23,235,174, 25, 27, 27, 91,234, 28,149,213, 63,170, 34,231,200,147,166, 51,255,222, -224,121,119,213,116,116,110,247,100,214,111,182, 99,187, 75,180,200, 83,147,217,195, 30, 34, 79, 45, 81,210, 55,202, 52,125,250, -244,164,233,211,167,247, 33,132,172,157, 62,125,122,159,114, 34, 88, 15,123,137,112, 61,140,146, 62, 87,229,215,209,110,109,159, -157, 92, 77,148,162,156,182,108,173, 86,139,103,158,121, 6,227,199,143,119,118,100, 44, 15,135,115, 45,143,181,107,215, 94,247, -219,170, 85,171,188, 53, 17,158, 12, 8, 8, 72,232,210,165, 11,242,243,243,113,249,242,101,232,116, 58, 52,158, 57, 19, 71, 95, -124, 17,205, 23, 44, 0,215,165,139,179,192, 31, 61,122, 20, 74,165,242,100, 69, 79,170, 78,167, 67, 80, 80, 16, 84, 42, 21,252, -252,252,224,231,231, 7,173, 86,235, 52, 90,222,154, 8, 29,133,249,143, 63,254, 40, 55,114,229, 26,242,245,197, 12, 81, 74,177, -103,207,158,235, 34, 88,142,255,116, 44,115, 68, 50,124,209,180, 71, 44,169, 82,169, 4,207,243,208,104, 52,206,112,191, 74,165, -114,190,124,141, 96,121,155, 72,180,102,205,154,165, 38, 34,149,201,100,165, 38, 34,189,247,155, 8, 77, 40, 46, 42,174,116,125, -179,217, 12, 65, 16,240,219,111,191,225,129, 7, 30,112,154, 43,135,177,114, 61,239, 21,172,192, 82, 9, 33,157,230,206,157,187, -239,179,207, 62, 11, 42, 42, 42,194,162, 69,139,242,139,138,138, 58, 81, 74, 83, 43,164, 5,192,106,177, 65,111, 50,161,168,176, -228, 24,156, 79,250,213,171, 41,187,151,105,212,180,233,240,239,191,255,254,186,223,191,255,254,123,156, 61,123,118, 56,142, 30, -221, 90, 13, 88, 48,126,252,248, 58,241,241,241,213, 0, 96,252,248,241, 41,213,128, 5,229,149,115, 71, 19, 97,145,221,172, 27, -139,179, 43, 45,210,234,126,195,119,179, 23, 68, 66,136,211,100, 60,244,216, 51, 72,191,112, 10, 13, 53,217, 8, 11,212, 66, 42, - 76,135,188,235,100, 28,189,166,193,236, 5,235, 43,148, 78,141, 66, 14,149,250,223,230, 38,149, 90, 5,165,189, 85,129, 16, 2, -149, 70, 13,153, 66, 81,225,125, 63,117,234, 20, 52, 26, 13, 68, 81,188,238,122, 83,209, 17,205,148, 82,231,181,243,179,207, 62, -195,184,113,227,176,104,209, 34, 28, 61,122, 20,205,155, 55, 71,183,110,221,112,245,234, 85, 28, 57,114, 4, 38,147,201,231,116, -186, 94, 47, 78,156, 56,129, 77,155, 54,225,244,233,211, 72, 73, 73,185,225,243,238,222,204,104,111,193, 41, 49,175,155,254,193, -163, 15,197,221,144,230,228,201,147,113,245,234,213,235, 34, 87,174,221,143,202,138, 96,185,122,145,114, 72,116,139, 30,193,209, - 31,202, 97,136,220,191, 3, 8,114,252, 54, 97,194,132,183,124,221,206,245,187, 35, 2,230,107, 83,165,224,233,162,235,104, 98, -114, 28,116,215,200,148,227,179, 70,163,113, 70,153,106,212,168, 81,110,244,202, 81,224,120,158, 71,251, 11,133, 80, 40, 20,206, -230,188, 94, 87,165, 82, 33,242,152,152,152, 82,125,176, 92, 79,138, 39, 76, 38,211,214,173, 91,183,182,232,215,175, 31,127,226, -196, 9, 8,130, 0, 73,146, 96,122,240, 65, 52, 95,176, 0,199,198,142, 69,135,139, 23, 97,178, 90,161, 82,169,240,215, 95,127, - 89,244,122,253,214,138,100, 26,142,227,136,195, 96, 41,149, 74,248,249,249,193,223,223,223, 25,205,169, 72, 37, 84,214, 29,162, -235,171, 34, 5,218,209,161,223,245,194,234, 56,127, 6,131,161,148,225,242, 21,215, 38, 3,135, 41, 10, 8, 8, 40,213, 44,234, -136,226,249, 98,176,188, 77, 36,170, 84, 42,253,183,111,223, 94,199,223,223, 31,148, 82,100,103,103, 99,200,144, 33,103,238,249, - 0, 22,104, 73, 39,119,131, 17, 69, 6, 99,165,235,255,244,211, 79, 56,119,238, 28, 44, 22, 11,166, 79,159,126,157,177,186,145, - 8,150, 75,190, 58, 23, 23, 23, 39,245,236,217, 19,123,246,236,129, 82,169,180, 82, 74, 43, 60,127, 21,149, 36, 88,172, 54, 24, - 13, 38, 20, 21, 23,227,191,192,241,163, 71, 87,104,181,218, 33, 0,116,121,121,121,124, 64, 64, 0, 52, 26, 13, 12, 6, 67, 62, -111, 31, 41,152, 12,152,213, 86,235, 71,143, 61,246,216, 44, 0, 16,172,214,143,202,155, 7,203,105,176, 42,249, 56, 58,234,173, -178,162, 87, 55,106,174, 8, 33, 37,195,243, 57, 14,139,166,143, 67, 67, 77, 22,226,106,105, 97,188,122, 14, 74,255, 42, 32,129, - 53, 49,123,193,122,156, 72,190, 86,161,116, 14, 93,252, 43,170, 85,171,134,181, 79,246,135, 82,169,196,144, 95, 55,149,116,210, - 30,245, 56,228, 42, 37,186,126,241,211, 13,237,187, 94,175, 47, 51, 82,229,107, 4,203, 85,211, 97, 0,227,226,226, 80,183,110, - 93,108,221,186, 21,113,113,113, 56,123,246, 44,206,158, 61,139,228,228,100, 28, 61,122, 20,185,185,185, 21, 62, 71,203,151, 47, - 71, 86, 86, 22,228,114, 57, 10, 10, 10,112,241,226,197, 50,251, 63, 87,228,188, 59,104,240,240,100, 0, 64,100,104, 64,133, 12, -150,171,230, 39,159,124, 82,145,105, 30, 92,243,121,121, 43,101,187,245,117,114,124, 55,187,153, 29,247,239,238,235, 3,192, 85, - 0,188,151,237,220,191,103, 79,159, 62,125,171, 35,242,101,215,229,203,234,127, 85, 42,130,229,102, 2, 12, 13, 26, 52, 80,187, -182,159,114, 28, 7, 63, 63, 63,242,198, 27,111,240,132, 16,232,116, 58, 4, 4, 4,160, 94,189,122,176, 88,188,119, 75,144,203, -229,134, 86,173, 90,169, 93, 67,175,132, 16,104,181, 90,254,205, 55,223, 36,223,124,243,141,199,237, 86,175, 94, 93,110,230,182, -217,108,179, 70,140, 24,241,108,106,106,106, 80,120,120, 56, 50, 50, 50, 32,151,203, 75,102,139,237,220, 25,237, 47, 92,128,197, -110, 24, 78,157, 58,133,133, 11, 23, 22, 91, 44,150, 89, 55, 18,193, 10, 9, 9,129, 82,169, 44, 53, 42,198, 37,180,234, 83, 4, -171, 50,205,149, 67,211,245,194,234,248, 60,106,212, 40,231,247,138, 84,146,114,185,156, 62,252,240,195,206,103, 16, 6, 6, 6, -162, 74,149, 42,200,204,204,252,119,164,142, 61,114,231,171,193,242, 54,145,168, 76, 38,131,197, 98,113, 54,103,126,241,197, 23, - 55,108, 12,238, 42,131,101,147,136, 78, 23,138,200,200,250, 8, 13, 51, 66,146,196, 74,211,182,217,108, 24, 61,122,116,169, 57, -175, 28, 23, 98,199, 36,182,142, 17,190,174,225,255,138,222,137,223,116,116,132, 2, 86,155, 61,138,167, 55,223,115,231,176, 70, -141, 26,254,246, 38, 67,119,150, 81, 74,215,121, 60, 55,246, 41, 25,120,224,131,203,151, 47, 55, 9, 8, 8, 64,247,238,221,177, -102,229,202,213,239, 2,206,144,141, 1, 72, 85, 95,185,242, 63,251,231, 52,111, 65, 61, 71, 19, 97,177,190,178,205, 58,185, 46, -122,117,179, 77, 57, 28, 87,114, 99,246,251, 87, 31,161,161, 58, 19,205,171, 43,177,107,239, 17, 60, 80,141,130,154,228, 55,156, - 78,157, 78, 87,210, 25, 95,163,129, 82,249,111,159, 43,165, 70, 13,185, 66,121,195,251,238, 26,169,186,217, 8, 22, 33, 92,169, -227,248,236,179,207, 98,252,248,241,232,222,189, 59,206,158, 61,139,237,219,183,227,204,153, 51,120,229,149, 87, 16, 27, 27,139, - 30, 61,122, 84,232, 28,253,254,251,239,200,207,207, 7,165, 20, 89, 89, 89, 48, 26,141,152, 52,105,210, 77,159,119, 7, 23, 54, - 78, 3, 0,252,186,241,208, 13,107, 78,156, 56,209, 57, 7,163,227,154, 95, 94,212,202, 71,246,123,249, 94,209,237,111, 57, 30, - 13,214,233,211,167, 61,142,149,111,212,168, 81,102,215,174, 93,195, 78,159, 62, 13,157, 78,135,122,245,234,193,100, 50,149,217, - 12,225,250,180,237,164,164, 36,143,154,181,107,215,182, 60,244,208, 67,178,170, 85,171,150,138, 92, 57, 70,216,184, 58, 99,119, - 77,251, 69,160,144, 16,242,124,219,182,109,127, 92,183,110,157,186, 94,189,122,200,207,207, 7, 0, 44, 90,180, 8, 47,191,252, - 50,212,106, 53, 78,159, 62,141,254,253,251,235,245,122,253,243,174,115, 96,121,210,244,100,100,228,114,185,179,153,204,209, 84, -166, 40, 39, 20, 93,198,147,198, 49,119,238, 92,143,115, 65,185,179, 96,193,130,146,220,234, 67, 58, 63,253,244,211, 74,211,220, -187,119,111,169,103, 12,246,237,219,247,171, 30, 61,122, 32, 37, 37,165, 84,179, 96,121, 6,203, 93,211,219, 68,162, 60,207, 35, - 60, 60, 28,239,191,255, 62,170, 84,169,130,170, 85,171, 94,103,176,188,157,163, 27,188,123,191,165,154,148,163,137,115, 62,155, -220,238,171,111,127,149, 41, 21, 28,246,108,255, 21, 5,185, 87, 74, 71, 96, 45,255, 14,137, 86,196,117,133,249,208,102,159,210, -105, 50,153,240,241,199, 31, 99,242,228,201,152, 60,121,114,185,105, 42, 99, 56,180,215,125,119, 53, 88,190,152, 45, 79,154,146, - 36, 18,149, 38, 8, 26,109, 36, 98, 99,131, 32,249, 48, 87,167,116,231,207,187, 62, 37, 37, 37,160, 90,181,106, 56,115,230, 12, -193,191,253,177,254, 61, 87, 10,197, 16,184,140,246,243, 88,222,129,163, 75,151, 46,109,210,180,105, 83,124,241,197, 23, 0,240, -228,199, 27, 54, 60, 62,217, 80, 18,206,180, 79,201,240,151, 47,233, 20,169, 72, 84,154, 64,168,117,246,227, 40,249, 62,231, 41, - 45,103,223, 29, 23,191,155,188,209,187, 78,211,177,253,249, 61,127,224,225, 94,209,216,189,239, 40, 54,167,106, 81, 77,153,142, - 8,125, 22,164,172,147,248,223,160, 56,204, 94, 81,114, 17, 63,122,208,187, 38, 33, 4, 59,223,120, 30, 58,149, 18,143, 46,253, - 19, 50,153, 12, 91,199, 62, 5,185, 92,142,142,159,149, 52,201, 30,251,120, 34, 4,165, 2, 13, 95,153,236, 83, 58,221, 91,106, - 28,125,174, 92,205, 85,121, 17,172,242,246,189,168,168, 8,185,185,185,248,241,199, 31, 49,114,228, 72, 92,189,122, 21, 23, 47, - 94,196,233,211,167,177,108,217,178, 82,215, 56, 84,224, 28, 77,152, 48, 1,175,191,254, 58, 56,142, 67,147, 38, 77, 48,121,242, -100,180,110,221,186,194,231,200,253,188,187,227, 45,122, 85,158,230,156, 57,115, 42, 60, 96,235,126,164, 66, 29, 52, 28,145,172, - 42, 85,170, 64,171,213, 2, 64,169, 11,172,183,102,194,178, 52,109, 54, 27,212,106, 53,212,106,117,169,105, 17,250,245,235,231, - 53,130,101,175,252,255, 34,132, 12,107,220,184,241,119,147, 39, 79,214,118,234,212, 73, 22, 25, 25,137,248,248,120,156, 62,125, - 26,127,252,241,135,101,222,188,121,122,189, 94, 63,146, 82,186,241, 70,234,100, 71,199,111,215, 25,237, 43,130, 40,138, 41, 23, - 47, 94,140,248,244,211, 79,121, 66, 8,102,205,154, 85,106,130, 86,247,125,220,187,119,175,205, 91,147,140,205,102, 75,185,120, -241, 98,196,204,153, 51, 75,105, 58, 94,238, 38,197, 23,205,178,112,236,179,251, 49,240,165,240,120,155, 72, 84, 16, 4,156, 58, -117, 10,239,189,247, 30, 8, 33,165, 6, 78,220,203,236,218,159,254, 77,155,132,200,160, 33,131,186, 52, 37,224, 96,246, 16,233, -229,115,242,156,230,106,192,204,229,248,253,245,199,125, 57, 23, 23,183,109,219, 86,125,218,180,105, 60,207,243,248,228,147, 79, - 74,229, 37,247,243,254,247,223,127,139,106,181,250,242,141,238,135,197, 98,241, 58,138,170,156, 2,190,107,238, 39,239,117,255, -234,251, 53, 50, 66,204,216,179,237, 87,228,231,121, 30,154,174,144, 9, 88,188,116,181, 77,224,185,148, 59,124,234,190,234,214, -173,219,164, 77,155, 54, 9,213,170, 85,187, 97,145,104, 96,205,220,185,115,123,141, 24, 49, 34,184, 81,163, 70,142,193, 39, 10, -251, 11,246,153,221,255,242,209, 36,173,154,253,233,123, 79,126,253,253, 26, 5, 71, 44,216,179,253, 87,228,187,153,245,235,163, -209, 50, 44, 89,186,202, 34, 8,252, 41,111,117,240,141,140, 96,246,133, 22, 15,143,196,151,127, 46, 68, 88,211, 94, 24,220,183, - 29,118,126,241, 36, 30,107,100,128,229,231,161,104, 50,120, 49, 22, 77, 44,137,222, 52,255,101,162, 79,215, 10,127,221,191, 19, - 86,114, 28, 7,165, 74, 13,153,226,223,232,139, 66,163, 1, 95,129,136,173, 99,223,203,139, 84, 85,244,120,240, 60,143,152,152, - 24,212,174, 93, 27,109,219,182, 69,139, 22, 45,208,185,115,103, 28, 57,114, 4, 71,142, 28,193, 43,175,188, 82,166,185,242,229, - 28,117,239,222, 29, 61,123,246,188,233,115,227,126,222, 43, 3, 95,242,210,139, 47,190, 8, 0, 55, 27,205,186,127, 13, 86,104, -104, 40, 20, 10,197, 13, 25, 42, 79,154,102,179,217,105,172,212,106,181, 51, 98,181,122,245,106,159, 51, 56,165,116, 35, 33, 36, -246,157,119,222,121, 85,173, 86,119, 54, 24, 12, 13, 1, 64,163,209,156,212,235,245, 91, 44, 22,203, 28, 74,105,222,205,164,213, -213, 96,120,112,243,229,222,226,103,101,101,245, 24, 62,124,248, 70,142,227,106,149,247, 96,102, 23,179,154,156,153,153,217,203, -155,230, 19, 79, 60,225, 81,211,147,174, 47,154,101,152,195, 82,166,202,117,132,161, 79,153,204,203, 68,162, 50,153, 12, 58,157, - 14, 43, 87,174, 68, 72, 72,200,125, 85,192,118, 31, 76,255,184,188,229,157,170, 40,183, 1, 8, 29, 48,115,249,229,173,217,230, - 26,157,170, 40, 46,253,254,250,227,213,189, 24,158, 54, 51,102,204,216,105,181, 90,107,248,152,111, 47,153, 76,166,118, 21, 77, - 59,165, 20,167, 78,157,146,158,125,246,217,236,172,172,172,193, 55,178,255,219,247, 92,250,172, 93,171,200, 42,131,250,183,107, - 9, 66, 96, 54,155,202,106, 89,160,148, 82, 42,240, 92,202,182,189, 41,207,222,201,115, 70, 41, 61, 76, 8,153, 90,167, 78,157, - 23, 0,148,117, 37, 92,230, 77, 39, 25, 48, 43, 76,166, 79, 19, 18, 18,222,124,235,173,183, 2,251,246,237,139,106,213,170, 33, - 32, 32,160,194,105,218,185, 47,245,133,214, 9, 17,209,143,246,107,215,131, 35,132,154,204, 38, 47,209, 5,251,241, 20,248, 83, -219,246,166, 52, 43, 47, 58,239, 48,229,183, 34,218,208,117,208,211,232, 58,232,105,103,126,218,188,162, 19, 18,211, 54, 32,158, - 75,131,233,235,118, 32,254,142,172,238,125,154, 27,142,227,208,247,251,149,144,203,229,206,116,182,153, 81,122, 92, 64,189,151, -124,127,150,186,235,190,187, 70,176, 60,212,197, 21,234,131,197,243, 60,178,179,179,113,250,244,105,100,102,102, 66,175,215,227, -196,137, 19, 48,155,205,200,205,205,133, 99,164,225,141,164,179,178,206,209,157,212,252, 47, 24,171, 27, 50, 88,148,210,212, 7, - 30,120,192,219,197,184, 66,163,140, 4, 65, 48,182,107,215,142,120, 26,109,224,248,172, 86,171, 13, 62,166, 47, 15,192,100, 0, -147,237,207,155,130,217,108,190,233,142, 36,162, 40,166,183,106,213,138, 47,175, 79,130, 36, 73,153, 94,204, 80, 49,128, 74,125, -116,248,173,208,244, 80,104,196, 23, 94,120,161, 92, 39,165,213,106,203,237, 92,228,109, 34, 81,189, 94,159, 49,124,248,112,209, -181,169,217,117, 34,210,251, 26, 66, 47,245, 30,242, 76,141,173,217,230, 26, 0,224, 48, 89,160,244, 82, 89,155, 28, 56,112, 32, - 19, 64,157, 91,157,180, 11, 23, 46,152, 31,120,224,129, 37,133,133,133, 47, 82, 74,245, 55,170,179,115,127,250,196,123,237,180, - 80, 74, 15, 3, 24,117,179, 58,102,224, 68,184,209, 56,122,242,187,239, 62,250,222,187,239,214,147,128, 16,216,231,168,226,125, - 48,105,174,236, 57,152, 81,233,115,131,137,162,152,218,166, 77,155, 10,111,227,109,121, 57, 51,137,227, 39, 84, 3, 14, 86, 92, -243, 86,164,211,161,217,180,105, 83, 52,111,222,220,249,238,192,245,247, 22, 45, 90,248,164, 25, 23, 23,135, 70,141, 26,149, 57, - 67,187,123,159,171, 59,189,239, 14, 28,183,190, 45, 90,172,175, 52,205,155, 77,231,189, 95,189,223,194, 33,209,247, 98,191, 25, -166,201, 52,153,166,115, 29,158, 82, 42,178,227,201, 52,153, 38,211,188, 29,154,247, 27, 28, 59, 4, 12, 6,163,140, 40,142,200, -142, 2,131,193, 96,220,160, 9, 5,208,164,140,202,213,103,103, 74, 8,105, 82,209, 63,246,225,238,153,105, 50, 77,166,201, 52, -153, 38,211,100,154,247,153,166, 55,237,251, 37, 50,198,154, 8,153, 38,211,100,154, 76,147,105, 50, 77,166,121,199, 53,239, 55, - 88, 19, 33,131,193, 96, 48, 24, 12, 70, 37, 35,176, 67,192, 96,252,183,153, 66,200, 77,221,104,189, 71,169,196,210,201, 96, 48, - 24,165, 97, 17, 44, 6,131,193, 96, 48, 24, 12,102,176, 24, 12, 6,131,193, 96, 48,152,193, 98, 48, 24, 12, 6,131,193,248, 79, -113, 75, 71, 17, 50, 24,140,187, 31,214, 7,139,193, 96, 48, 42, 31, 22,193, 98, 48, 24, 12, 6,131,193,168,100, 4,160,244,131, -138, 41,165,132, 29, 22, 6,131,193, 96, 48, 24,183,147,251,205,139, 8,204, 88, 49, 24, 12, 6,131,193,184, 27,184,159,188, 8, -231,201, 57, 50, 24, 12, 6,131,193, 96,220,110,238, 39, 47,194,221,143,174,145,193, 96, 48, 24, 12,198,189,199,125, 27,193, 98, - 81, 44, 6,131,193, 96, 48, 24,119,138,251,201,139, 8,247,155, 99,100, 48, 24, 12, 6,131,113,239,113,191,121,145, 91, 58, 77, - 3, 33,164, 9,211,100,154, 76,147,105, 50, 77,166,201, 52,153,230,127, 13, 54, 15, 22,131,193, 96, 48, 24, 12, 6, 51, 88, 12, - 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6,131,193, 96,252,167, 16,216, 33, 96, 48,254,219,220, 43,207,232, 99,207, 18,100, - 48, 24,247, 18, 44,130,197, 96, 48, 24, 12, 6,131, 81,201, 16, 0, 30, 71, 2, 80, 74,143,249, 44,114, 3,163, 9,188,233, 51, - 77,166,201, 52,153, 38,211,100,154, 76,243,254,211,244,166, 93, 17,255,113, 87, 27, 44, 74,111,221,124, 94,132,144, 38,149,125, -160,152, 38,211,100,154, 76,147,105, 50, 77,166,121,255,105,222,111,176, 38, 66,134,123,161, 17, 8, 33,194,141, 46,191, 93,154, - 12, 6,131,193, 96,220,205,176,139, 26,195,213,232,180, 6,208,199,254,121, 45,165,116, 79, 69,150,223, 46,205, 59, 69,124,124, -188, 90,165, 82,117,255,251,239,191,229,167, 78,157,194,222,189,123,233, 79, 63,253,100, 53, 26,141, 27, 18, 19, 19, 13, 44, 7, -221, 31,196,197,197,245, 32,132,140, 7, 0, 74,233, 71,135, 14, 29, 90,127, 19,101,138,212,169, 83,231, 21,133, 66,209, 91, 38, -147, 69,138,162, 72, 76, 38, 83,186,193, 96,216,152,150,150, 54,147,222, 64,199,125, 66, 72,203, 42, 85,170,140,138,141,141,173, -119,225,194,133,148,203,151, 47, 47, 6,176, 30, 64,143,234,213,171, 15,143,137,137,169,150,148,148,116, 38, 59, 59,123, 1,165, -244,192,157, 74, 39,131,193, 12,150,111,133,143, 11, 10, 10,122, 72,173, 86,191, 90, 84, 84, 20,231,239,239,159,100,179,217,230, -102,100,100,172,101, 5,239,190, 49, 87, 2,128, 62,148, 82, 25, 0,240, 60,223,191,117,235,214, 53, 8, 33, 18, 33,132, 82, 74, - 9,199,113, 45, 68, 81,228,236,235,247, 33,132, 28,160,148,218,110, 84,211,102,179, 85, 88,243, 86, 17, 27, 27, 59,141, 82, 26, - 89,222, 58, 90,173, 54, 97,243,230,205, 13, 86,173, 90,101, 91,188,120,113,222,227,143, 63,174,123,234,169,167,132, 69,139, 22, -125, 9,224,127,238,235, 55,110,220,248, 51,142,227,170,248,242,255,146, 36,101, 31, 63,126,252, 53,150, 19,239,138,178, 48,254, -153, 25, 91, 59, 72, 20,248,110, 66, 71,206,110, 94,110,136, 22, 45, 90,252,240,200, 35,143, 12,169, 95,191,190, 32, 73, 18,172, - 86, 43, 76, 38, 83,131, 67,135, 14,117, 90,191,126,125, 2,128,193, 21, 76, 91,159, 9, 19, 38, 44,156, 58,117,106,168, 76, 38, - 35, 86,171,245,193,159,127,254,185,231,168, 81,163, 14, 47, 88,176,160,249, 99,143, 61,230,231,248,253,189,247,222,235, 69, 8, - 25, 75, 41, 93,118,187,211,201, 96, 48,188, 24, 44, 63, 63,191,186,161,161,161,175,135,132,132,244, 74, 72, 72,200,127,254,249, -231,207, 31, 57,114,228, 68,108,108,108,209,247,223,127,255,161,213,106,157, 87,191,126,253, 13, 5, 5, 5, 51,175, 92,185,114, -162,130, 21, 69, 93, 0,207, 3,232, 5, 32, 26, 64, 58,128,117, 0, 22, 82, 74, 79,221,200,206, 68, 69, 69, 53,213,106,181,111, - 18, 66, 30, 44, 46, 46,142,214,106,181,233,148,210,125,133,133,133,159,100,100,100, 28,186, 17,205,232,232,232,218, 0,198, 8, -130,208, 94, 20,197, 90, 60,207, 95, 18, 69,113,135, 40,138, 95,164,167,167,159,185, 17,205,182,213,252,250, 74, 58,255,153, 86, - 94, 93,173,200,104,147,235,148,130, 85, 38, 25, 83,164,226,188, 9,251, 46, 23,253,122, 55,100, 12,133, 66,193, 45, 94,188,184, -185, 66,161, 0, 0,152,205,102,196,198,198,222,212,115,162,100, 50, 25,247,201, 39,159, 52,151,203,229, 0, 0,139,197,130, 46, - 93,186,220, 21,207,158, 34,132, 68, 39, 38, 38, 6, 56,210,230,142, 40,138,232,223,191,127, 77,133, 66,129, 5, 11, 22,216,178, -179,179,227,190,251,238,187,196, 47,191,252,178,202, 15, 63,252, 48,200,147,193,226, 56,174, 74, 89,154,162, 40,194, 98,177,192, -102,179,193,108, 54,163,115,231,206,172, 54,186, 75,160,148,214,160, 0,214, 29, 49, 2, 64,200,205,104,169,213,234,134, 3, 6, - 12, 16,178,178,178, 32,147,201, 96,177, 88,112,229,202, 21,212,174, 93,155, 55,155,205,245, 43,170,215,160, 65,131, 81,211,167, - 79, 15,251,243,207, 63, 45, 75,150, 44, 49,117,235,214, 77, 62,114,228, 72,255, 14, 29, 58,180,143,142,142,230,190,251,238, 59, -211,166, 77,155, 44, 79, 60,241,132,114,218,180,105, 97,235,214,173, 27, 2, 96,217,237, 78, 39,131,193, 40,199, 96,249,249,249, -109,211,233,116,117,158,123,238,185, 83, 47,190,248,226, 6,157, 78, 39, 2,192,149, 43, 87,148,253,251,247,207, 26, 56,112,224, - 85,189, 94,207,207,155, 55,175,250,231,159,127,190,209,207,207, 47,173,176,176,176,149, 15, 23, 50, 2,224, 85,142,227,198,116, -239,222,125,155,213,106,205, 90,185,114,229, 47,131, 6, 13,106, 39, 73,146,246,239,191,255,254,131, 16,242, 21,128, 79,125,141, -142, 17, 66,248,152,152,152,201,209,209,209,111,204,159, 63, 95, 89,171, 86, 45,104, 52, 26, 20, 22, 22, 86, 63,115,230, 76,181, - 87, 95,125,181, 95,237,218,181,231, 6, 4, 4,188,147,152,152,104,245, 81,147, 68, 70, 70,254,207,223,223,255,131, 15, 63,252, - 80,213,184,113, 99,162,209,104,144,156,156,220,100,207,158, 61,177,223,126,251,237,200,232,232,232, 41,105,105,105, 62,167,179, - 19, 33,130,169, 78,232,250,192, 6,173, 58, 47, 88,248, 45,169,162,213, 64, 32, 4, 86,139, 69,150,169, 55,196,188, 60,250,133, - 95, 90,215,171,186,171, 80,150,217,245,248,113,106,185,205, 23, 21, 27, 33,100, 45,207,243,253, 21, 10, 5,215,191,127,127,108, -218,180,137, 24,141, 70, 1, 0, 84, 42,149,173,127,255,254, 80,171,213, 48,155,205, 18,128,181,246,109,148,246,237, 77,229,105, -202,100, 50,174,115,231,206,250,131, 7, 15,230,232,245,122,153, 67,179,115,231,206,193, 74,165, 82, 99,181, 90,125,210,188,197, -166, 18,231,206,157,187,206, 8, 93,189,122, 21, 57, 57, 57, 48,153, 76, 36, 55, 55, 23,162, 40,194,100, 50,101,137,162, 8,142, - 43, 9,190,149,165, 41,151,203,113,250,244,233,235,126,183, 88, 44, 48, 24, 12,176, 90,173, 40, 40, 40, 80,171, 84,170, 58,237, -219,183, 79, 5,176,170,168,168,104,230,225,195,135, 47,177,234,233,142,113,249,143,127,140,213, 1, 88, 0, 92,184, 73,227, 46, - 1,192,142, 29, 59,144,153,153,137,172,172, 44,100,101,101,161, 90,181,106,184,145,232,255,169, 83,167,230,180,104,209,130, 28, - 62,124,120, 13,128,133,203,151, 47, 31,112,237,218,181,249,227,198,141, 11,254,228,147, 79,174,189,249,230,155,163, 1,252,190, -124,249,242,167,155, 54,109,218,247,232,209,163,179,239, 68, 58, 25, 12, 70, 57,157,220, 41,165,145,117,235,214,189, 54,107,214, -172, 6, 19, 38, 76, 8, 41, 42, 42,226, 1, 32, 50, 50,210, 8, 0,122,189,158, 31, 63,126,124,232,140, 25, 51, 26, 40,149,202, - 92,155,205, 22,234, 65,195,211, 8,131, 49,254,254,254,253,206,159, 63,191,188, 65,131, 6,193,211,167, 79,255, 71,171,213,210, -217,179,103, 31,170, 93,187,118,196,165, 75,151,126,244,247,247,239, 2,224,141, 50,210,117,157,102,205,154, 53,223, 27, 52,104, -208, 27,187,118,237, 82, 54,107,214, 12,126,126,126,224,121, 30,129,129,129,120,224,129, 7,200,246,237,219,149,189,123,247,126, - 37, 63, 63,255, 19, 95, 53,163,162,162,222,232,217,179,231,135, 7, 15, 30, 84,119,237,218,149, 40, 20, 10,228,229,229, 65,161, - 80,160,117,235,214,100,254,151, 95,168,155, 52,110,244, 94,116,116,244, 84, 95, 53, 77,117,171,108,124,252,197,241, 93,214,174, - 91, 79,194,195,195,113,254,211,169,216,209, 33, 22,103,223,159,128,136,136, 8,172,249,243, 47,210,103,196,139,237,252,173,225, -127,251,170, 89, 9,198,234,152,203,231, 61,177,177,177,137, 39, 78,156, 64,251,246,237,241,203, 47,191, 52, 27, 55,110,220,139, -227,198,141,123,241,151, 95,126,105,214,190,125,123,156, 56,113, 2,177,177,177,137,148,210, 61,132,144, 23, 1, 92, 3,112,205, -254,185, 76,205,109,219,182,161, 75,151, 46,185,203,151, 47,175, 61,105,210,164,105,147, 38, 77,154,246,203, 47,191,196,116,233, -210, 37,119,219,182,109, 21,210,188, 21,251,238,106,168,220, 95,148, 82, 72,146,132,176,176,176,171,127,254,249, 39,237,211,167, - 15, 95,181,106,213,244,254,253,251, 43,247,237,219, 71, 9, 33,107, 43,146, 78, 74, 41, 12, 6, 3, 12, 6, 3, 46, 92,184,160, -158, 59,119,110,187, 55,222,120,163,238,207, 63,255, 28,245,202, 43,175,140,246,247,247, 63,212,188,121,243, 26,183,123,223,153, -166, 51,242,120,197,110,174,138, 57,142,187,124,163,154,143, 62,250,104,147, 26, 53,106,132,255,156, 20,132, 92,121, 3,136,178, - 0, 72,242, 64,136, 33, 45,113, 86,222, 19,145,145,145,225, 53,106,212,104, 93, 17, 77, 74,233,198,127,254,249,167, 23,165,116, - 1,165, 84,164,148,174,120,243,205, 55,159, 37,132,252,250,230,155,111,190, 64, 41, 93, 97,255,253,155, 35, 71,142,244,165,148, -110,185, 19,233,100,121,137,105,222, 2, 90, 2,120,216,254,106, 5,224, 1,183,239, 10,183,245,186,149,241,254,176,219,247,150, -110,219,181,172, 84,131, 69, 8,161,142,151,203, 29,141,245,227,143, 63,222,251,237,183,223,110,202,200,200,136,136,137,137,121, -120,192,128, 1, 53, 10, 10, 10,184,129, 3, 7,214,140,136,136,232,179,101,203,150,170, 3, 7, 14,252,123,208,160, 65,123, 8, - 33, 94,251,205, 16, 66,106,243, 60, 63,246,240,225,195, 59,107,214,172,105, 73, 79, 79,247,107,209,162, 69, 33, 0,212,171, 87, - 79,159,147,147,163,246,243,243,195,159,127,254,185,159, 16,242, 60, 33,164,129, 55,205,200,200,200, 22, 85,170, 84,121,227,131, - 15, 62, 80,242, 60,239,113, 29,165, 82,137, 15, 62,248, 64,233,239,239,255, 92, 84, 84,212,131,222, 52,171, 86,173,218,208,207, -207,111,242,220,185,115, 85,102,179, 25, 22,139, 5,225,225,225,208,233,116,200,200,200, 64,218,197,139,184,154,156,140, 87,158, -121, 70,173, 85,171,199, 70, 70, 70, 54,247,166,217,190,166, 95,127, 93, 84,163, 78, 47,143,121, 21,199, 95,125, 6,155,162, 20, -168, 58,102, 60,154,109, 61,134,232, 41, 51,177, 37,198, 31,137,131, 31,194,216,177,175, 67, 30, 22,211,166, 77, 53,221,227,119, - 36,164, 41, 8, 84,169, 84,194,104, 52, 10, 59,118,236,104,111,179,217,100, 54,155, 77,182,125,251,246, 78, 27, 54,108,232, 53, -125,250,244, 30,106,181,122,116,235,214,173,127, 32,132,204,161,148,170, 41,165,106, 0,159, 56, 34, 79,158, 52,101, 50, 25, 12, - 6,131,236,224,193,131, 47,136,162,168, 16, 69, 81,113,240,224,193,151,182,108,217, 50,124,193,130, 5, 21,214,188, 93,240, 60, - 15, 65, 16, 32,147,201,208,188,121,243,243, 75,151, 46,181, 70, 70, 70, 10, 95,127,253,117, 80, 88, 88,152,246,135, 31,126,200, -203,205,205,253,184, 34,154,102,179, 25, 38,147, 9, 6,131, 1, 59,118,236,168,245,220,115,207, 9,102,179, 89, 28, 49, 98,196, - 53,171,213,106,122,233,165,151,252,117, 58,221,235,236,254,239,206, 64, 41, 21, 1, 20, 3, 40,114, 68, 81,107,214,172,169,140, -138,138,106, 90,179,102, 77,159,243, 99, 81, 81,209, 87,159,125,246, 89, 52,167, 12,196, 78,115,111, 44,167, 83,177, 49,240, 75, -100,213, 28,135,240,106,117,209,179,103,207, 48, 66,200, 23,149,144,222, 85,148,210, 65,148,210,223,110,100,251, 91,157,206,150, - 45, 91,182, 79, 72, 72, 56, 24, 31, 31,159,145,144,144,112,176,101,203,150,237,111,118,159,167,142, 34,221, 62, 26,195,167,190, - 63,154,208,143,198,240,169, 83, 71,145,110, 44,231,222,251,120,242, 34, 46,132, 18, 66,214, 18, 66,214, 78,156, 56,177, 51,128, - 16,183,239,109, 92,215, 3,160,240,244,238,120,185,252, 30,106, 55, 86,161, 46,223, 43,231,122,234, 82, 72, 61, 54,115,132,134, -134,154,223,122,235,173,195, 70,163,241,216, 15, 63,252, 80,231,197, 23, 95,108, 81,163, 70,141,211, 3, 7, 14,252, 67,163,209, -216, 28,125,116,124,228,153,222,189,123,255, 25, 28, 28, 76,178,179,179,229,102,179, 89,184,114,229,138, 92, 20, 69,194,243, 60, -213,235,245,194,217,179,103,101, 22,139, 69,122,240,193, 7, 87,239,217,179,231,121, 0, 99,203, 19,212,104, 52, 47,125,253,245, -215,170,178,204,149, 40,138, 40, 42, 42,130,205,102,195,148, 41, 83, 84,111,188,241,198,171, 0,246,150,167, 41,147,201, 94,153, - 53,107,150,202,209, 4, 36, 73, 18, 14, 29, 58,132,236,171, 87, 97, 42, 44,128,185,176, 0,230,252, 92,112, 69,249, 24,222,171, -135,106,193,111, 43, 95, 3, 48,188,220,139,170, 82, 55,227,135,133,223, 66, 20, 69,164,175,244,220, 37,226,218,174,173, 16,109, - 86, 76,251,232, 19, 50,246,153,199,166, 3, 88,126,183,100,124,133, 66,193,125,250,233,167, 13, 20, 10, 5, 8, 33,212,108, 54, -163,113,227,198,228, 38, 53,249, 57,115,230,180,144,203,229,196,161,217,164, 73, 19,114,183, 21,122,185, 92, 14,181, 90,141,154, - 53,107, 26,250,246,237,187,103,206,156, 57,213,121,158,215, 8,130,240, 87,126,126,254,244,164,164,164, 10, 53, 35,153, 76, 38, - 24,141, 70, 24,141, 70, 92,190,124,185,106,157, 58,117,200,255,254,247, 63,177,184,184, 56,230,155,111,190, 57,183,124,249,114, -205, 23, 95,124, 49, 16,192, 24, 86,229,222, 94,234,212,169,163,240,247,247, 15,168, 30, 34, 20,203,120, 20,103,216,108,225,209, -209,209,227, 1, 36,212,171, 87, 47,232,236,217,179,185, 81, 81, 81,123, 57,142, 91,150,146,146,146,225,197,248, 16,155,205,134, - 23, 90,229, 97,244,131, 28,108, 54, 27,242,242,242,112,249,242,101, 36, 37, 37, 97,223,190,164, 27, 74, 99,173, 90,181,158, 81, -169, 84,221, 21, 10, 69, 77, 81, 20, 57,189, 94,127,201,100, 50,109, 74, 79, 79,255,138,222,192,196,134,183, 42,157, 46,250, 51, - 7, 12, 24, 16, 25, 16, 16,128,127,254,249, 39,242,200,145, 35, 51, 1, 36,220, 84,221, 33,227,190, 27,241,236, 23, 81,193,129, -129, 72, 62,177, 38,106,213,186,159,191, 67, 73, 95, 94,198,189,127,131, 83,214, 53, 32,139, 82,234, 28,113, 62,125,250,244, 62, -246,245,251,184,126,247, 65,191,143, 7, 99,183,214,211,239,149,102,176, 28, 35,197,202, 90, 81,165, 82,137,163, 70,141, 58,189, -122,245,234,154, 9, 9, 9, 39,203,234, 12,236,133,182, 13, 26, 52,184,180,127,255,126, 26, 26, 26,106,150, 36,137,104, 52, 26, - 81,173, 86, 75,249,249,249,176, 90,173,244,210,165, 75,194,229,203,151,229, 85,170, 84,145,251, 18,170,147,201,100,173,107,213, -170, 85,102,164,160,168,168, 8,133,133,133, 48,153, 76, 8, 15, 15, 39, 28,199, 61,224, 53,172,199,113,237, 26, 52,104, 64,114, -115,115, 17, 25, 25,137,157, 59,119,162, 40, 63, 15,166,194, 66,152,242,243, 96, 41,200,135, 88,144,135,188,171, 25,168, 25, 17, - 77,236, 83, 13,148,139,141, 87,215, 8,211,105,113,118,234,120,180, 60,116, 9, 68, 38,199,254, 38, 17,160,214,146,174, 86,173, -142,166,131,200, 21, 56,249,202, 83,168, 58,236, 57, 88, 57,101,212,157,200,220, 54,155,141,152, 76, 38,168, 84, 42, 91,251,246, -237,119,240, 60,223, 73,161, 80,112,163, 71,143,198,149, 43, 87,156,217, 5, 0, 70,143, 30, 13,181, 90, 13,147,201,100, 3, 48, -174,172, 62, 83, 54,155,141, 88,173, 86,168,213,106,107, 66, 66,194, 87, 60,207,191,164, 80, 40,248,250,245,235,103,206,152, 49, - 35, 93,171,213,106, 47, 95,190,124, 77,161, 80,164,214,172, 89,179,149, 90,173,174,225, 77,243,118,162, 84, 42, 33, 8, 2, 56, -142, 67, 72, 72, 72,113, 78, 78,206,190,243,231,207, 15,189, 17, 45, 81, 20, 97, 54,155, 97,181, 90, 97, 52, 26, 33, 73, 18,142, - 28, 57, 2,165, 82, 41, 19, 69, 49, 73, 20, 69,141, 76, 38, 3,207,243,108,142,186,219, 76,124,124,124,167,102, 85,253,103,142, -142, 48, 5,213,238,163, 45,210, 40,249,226, 33, 43,173, 45,187,117, 27,220, 99,220,184,241,186, 42, 85,170, 40, 46, 94,188,104, -156, 61,123,118,173,223,127,255,157, 0,248,180, 60,189,244,244,244, 95,103,204,152, 17,220,169, 83,167, 24,153, 76, 70,242,242, -242,144,149,149,133,171, 87,175,226,242,229,203, 52, 57, 57,249,188,205,102,251,165, 34,105,108,214,172,217, 55,195,134, 13, 27, -209,184,113, 99, 25,165, 20, 86,171, 21,122,189,190,197,190,125,251,250,237,220,185,179, 61,128, 10,231,203,140,140,140, 95, 62, -250,232, 35,109,199,142, 29, 27,200,100, 50,174, 50,210,233,118, 65,139,212,233,116,216,180,105, 19,252,253,253,225,109,180,174, - 47, 88,108, 82, 84,112, 96, 8,140,103, 62, 67,164,127, 13, 88,108, 82, 20,203,193,247, 79, 20,171, 12, 47,114, 0,192,195, 55, -107,134,110,149,153,186,161, 8,150,131, 43, 87,174, 40,139,138,138, 4, 73,146, 56,147,201, 36,147, 36, 9, 50,153,204, 90,193, -255,107, 60, 96,192,128,189, 45, 91,182,212,219, 35, 24,182,128,128, 0, 91,126,126, 62,236, 6, 75, 18, 4,193,168,211,233,140, - 49, 49, 49, 0,224,181,137,208, 96, 48, 84, 87,171,213,215,253,174,215,235, 81, 84, 84,228, 52, 88,122,189, 30,254,254,254, 40, - 46, 46,246, 90,184, 69, 81,172,169,209,104,144,158,158, 14, 0, 40,202,203,133,177,160, 0,150,194,124, 88,242,114, 97,205,207, -131, 53, 63, 23,156,193,128,192,232,106,176,217,108,213,188,105, 22,155, 68, 5, 15,138,171,107,127, 69,248, 75,227,202, 92,239, -218,142, 45,208,213,169, 15,131,193, 34,220,129,140,221,154,227,184,248, 70,141, 26,161,127,255,254, 24, 60,120,240, 17,181, 90, - 29,246,197, 23, 95, 52, 78, 75, 75,187,110,253, 71, 30,121, 4, 99,198,140,193,128, 1, 3,126,252,231,159,127,230,149,167,217, -177, 99, 71,116,238,220, 57,120,240,224,193,201, 58,157, 46,113,225,194,133,173,166, 76,153,146,169,215,235,211, 18, 19, 19,155, -166,166,166,106,234,213,171,183, 53, 54, 54,150,251,243,207, 63,107,148,167,121, 7, 76, 39,172, 86, 43, 44, 22, 11, 76, 38,147, -215,178,226,118,113, 41,245,221,106,181, 58, 71, 16, 26,141, 70, 88,173, 86,178,106,213, 74,172, 89,179,134, 59,113,226,120,244, -132, 9, 19,145,151,151, 7, 81, 20, 89, 77,123,155, 72, 72, 72,232, 37, 80,233,235, 39,170,218, 84, 79,132,219,138, 4,142, 22, -157,249,246,157,226, 35,129,130,201, 84, 76,252,222,126,231,157,160,115,231,206, 89, 62,250,232,163,140,254,253,251,171,158,125, -246,217, 70,127,254,249,103,251,234,213,171,127,123,249,242,229,188, 50,242,189,252,153,103,158,217, 27, 20, 20, 84,123,201,146, - 37,153,233,233,233,193, 86,171, 85, 99, 54,155, 45,102,179,249,156,197, 98,217,105, 54,155, 55,101,100,100, 36, 86, 36,173, 58, -157,174,217,227,143, 63, 46,203,205,205,133, 32, 8,176, 88, 44,200,202,202, 66, 92, 92, 28,191,121,243,230,198, 55,178,255,199, -143, 31,255, 44, 50, 50,114,235,154, 53,107,186,107,181,218,120,133, 66, 81, 85, 20, 69,209,104, 52,102, 26,141,198,195, 55,146, - 78,183, 99,145,126,232,208,161, 72, 63, 63, 63,164,165,165,129, 16,146,126,179,231, 76, 46,227, 82,146, 79,174,174, 22,233, 95, - 11,167, 78,237,133, 92,198,165,176,156,124,223, 71,176, 90,186, 70,172,202, 49, 73,134, 9, 19, 38,188, 69, 8, 89, 59, 97,194, -132,183,202,137, 96,137,174,235,185,172, 95,105, 55,245,229, 94,196, 11, 11, 11,133, 3, 7, 14,132, 92,190,124, 89, 87,181,106, - 85,125,108,108,108, 30, 33,132,138,162,200, 93,187,118, 77,155,154,154,170, 10, 10, 10, 50, 85,171, 86, 45,223,199,255, 59,243, -242,203, 47,119,156, 52,105, 82,226, 67, 15, 61,148, 13, 0,185,185,185,200,202,202,114,140,210, 66,122,122, 58,119,240,224,193, -224,191,254,250,171, 5,124, 24,193,163, 86,171, 47, 23, 22, 22,214, 15, 12, 12,116, 94,208, 28,166,202,245,221, 98,177,160,176, -176, 16, 90,173,214,107,225,230, 56, 46, 45, 45, 45,173,142,193,160,199,165,179,103, 97, 42,204,135,165, 32, 31,214,130, 60, 88, -243,242, 32,230, 93, 3, 87, 84, 8,157, 90,141,194,107, 57,224,121,254,138, 55, 77,173,146, 55, 91,109,162, 34,180,103, 63,128, -148,125,125, 14,124,160, 29,104,195,102, 80,171,127,179,222,206, 76,237,152,179,202, 49, 39,149, 90,173,198,135, 31,126,136,196, -196, 68,169,188,102, 96,133, 66, 1,142,227, 68, 95, 52,149, 74,165,122,210,164, 73,234,195,135, 15,171, 20, 10, 5,116, 58,157, -230,240,225,195, 77,119,239,222,205,233,245,122,190, 78,157, 58, 3,162,162,162,138,202,211,188,213, 70,202,211,111, 69, 69, 69, -206,126, 83,215,174, 93, 19, 84, 42, 85,189, 14, 29, 58,236, 49,155,205,191,216,108,182,239, 19, 19, 19, 11,202,188,211,182, 92, - 63, 24, 84,146, 36,216,108, 54,216,108, 54, 8,130, 32,173, 90,181, 26,159,207,155,131, 21,203,127,163, 29, 59,118, 36,127,254, -249, 39, 36, 73, 74,101, 85,237,237, 65,146,164,153, 91,198, 63,170,130, 40, 22,153,182, 46, 45, 94,159, 35, 20,127,123,108,203, -193, 28,171, 73, 89,183,110, 76, 67,127,191, 0,238,135,197,223, 94,203,200, 60,127,230,243,207, 83,171, 77,155, 54, 45, 48, 38, - 38, 38,224,244,233,211, 81, 0,242,202, 48, 66, 53,159,122,234,169,145,215,174, 93,147, 45, 92,184,112, 81, 90, 90,218,118, 74, -233,121,183,242, 17, 71, 8,249, 4,128, 12, 64, 56, 0, 27,128,141,148,210, 31,203, 41,167, 18, 33, 4, 91,183,110,189,110,180, -159, 36, 73, 55, 60,218, 47, 35, 35, 35,247,129, 7, 30,104,118,230,204,153, 85,185,185,185, 75,220,151,107, 52,154,126,177,177, -177, 67,246,239,223,255, 46,165,244, 92, 5, 47,152, 99, 79,156, 56,241,177, 36, 73, 53, 56,142,187, 68, 41,125,243,102,207,153, -217, 34, 61,187,122,221,242,133,102,171, 88, 93, 33,227, 47,155, 45,210,115, 44, 39,223,247, 56,250, 72,193,213, 56,121, 48, 70, -187,167, 79,159,174,158, 49, 99, 6,166, 79,159,158,228, 41,130,229, 48, 90,211,167, 79, 79,114,172,231,178,254,246, 74, 53, 88, -158, 28,163,205,102,211, 77,156, 56,177,109,139, 22, 45,210, 59,117,234,148, 81,171, 86, 45,189, 75, 97, 51, 7, 6, 6,154, 77, - 38,147, 50, 61, 61, 61,244,228,201,147,181, 36, 73, 82,251,240,127,127, 7, 6, 6, 6, 31, 60,120, 48,100,217,178,101,117, 15, - 29, 58, 84, 99,216,176, 97, 29, 77, 38, 19,204,102, 51, 46, 92,184, 80,227,235,175,191,150,228,114,121, 30, 33,228, 0, 0,175, - 23, 89,171,213,186,231,204,153, 51,245, 30,120,224, 1, 98,181, 90, 75,153, 42,215,207, 10,133, 2,105,105,105, 84,146,164,125, - 62,164,115,239,193,253,251,235, 52,105,212, 8,166,252, 92,152, 11,242, 96,201,207,131, 45, 63, 15, 82, 65, 30,184,162, 66,132, - 4,203,160, 86,107,113, 38, 61, 3,246,180,150,139,204,102, 72, 78,203, 47,168, 95,103,242,167,216, 18,227, 15,106,181, 56,155, - 5, 1, 56,155, 11,219,156,204,194,142,221,123, 32,136,166,180, 59,153,147,205,102,179, 52,112,224,192,253, 28,199, 53,169, 44, - 77,171,213, 42,189,248,226,139, 78,205,148,148,148,107, 41, 41, 41, 42,131,193,192,233,116,186,162, 59, 93,122,173, 86,171, 71, -131,100, 54,155, 97, 48, 24,144,145,145,161,216,184,113, 99,251, 61,123,246,200,143, 31, 63,142, 61,123,246, 52, 95,181,106,213, -196,134, 13, 27, 54, 59,121,242,228, 21, 95, 76,155, 36, 73,112, 92, 7, 41,165,160,148,242, 0,176,250,247,181,232,217,179, 39, - 41, 44, 44,196,154, 53,107, 42,165, 25,133,225, 51,197,176,137,106,243,182,165,197,175,159, 85, 20, 36,233,133, 15, 18, 19, 19, -215,247,238,221,123, 71,100,120,140, 63, 0, 40,229,186, 80,158,250,233, 66, 67, 67,149, 0, 16, 25, 25, 25,111,181, 90,231, 1, -104,231, 73,240,145, 71, 30,105, 19, 22, 22,214, 98,221,186,117,135,211,210,210,118,184,155, 43, 0,168, 95,191,254,148, 99,199, -142,245,146,201,100,196,165,242,167, 0, 60, 26,172, 71, 31,125,180,126,116,116,116,200,159,103, 2, 80, 32,175, 3,137,203, 3, -229,149, 16, 3,155,225,146,188, 49,194,195, 79,134,212,169, 83,167,249,185,115,231, 14, 87,240,230,170,250, 99,143, 61,246,199, - 55,223,124,211,176,103,207,158, 10, 0,215, 25,172,134, 13, 27, 14,220,188,121,243,160,209,163, 71, 55, 35,132,244,165,148,158, -245, 85, 63, 49, 49,113, 23,128,214,149,121,194, 38, 45,160,155, 0,212, 96, 89,247, 63, 19,189, 2, 92,250, 96, 1,200, 66,201, -179,148, 93,191, 59,242,189,217,101,221, 44,151,168,149,217, 45,234,229,105, 89, 22,128, 74, 11,110, 8,229,220,121,111,188,112, -225, 66,203,199, 30,123, 44,203,213, 92,185, 30, 0,157, 78,103,242,247,247, 47,218,191,127,127,164, 40,138, 91,125,248,191,133, -155, 55,111,222, 50,119,238,220,165,193,193,193,214,225,195,135,115,227,199,143,223,145,147,147, 67,115,114,114,240,197, 23, 95, -116,104,223,190,253,142, 75,151, 46,137,137,137,137, 79, 3,232,233, 77, 80,175,215,127,249,210, 75, 47, 13,217,177, 99,135,202, -108, 54, 35, 47, 47,239,186,232,149,213,106, 5,207,243,152, 55,111,158,169,184,184,120,142, 15,145,140,175,190,252,242,203, 65, - 95,127, 62, 87, 37, 88, 45,208,231,229, 66,180,191,120, 99, 49,116, 42, 14,117, 90,132, 34, 47, 93,137,197,235,118, 25,108, 54, -219,151, 94, 13,150,177,104,220,232, 23,158, 95,187,241,239, 45, 8,105,215, 5,217, 91,254,186, 62, 26, 20, 26, 14,179,197,130, - 15,166, 78,166,196,144, 55,254, 54,103,108,155,125,116,133, 35, 3,174,253,231,159,127,246,180,104,209,162,151,217,108, 46,207, -136, 65,146, 36,254, 70, 52,149, 74,101,106,253,250,245,255,174, 93,187,246, 0, 0,104,212,168,209,239, 28,199,117, 41, 79,243, - 86, 27,172, 73,147, 38, 97,198,140, 25,152, 48, 97,130,211, 32, 57,110, 0, 76, 38, 83,173,191,254,250, 75,177,107,215, 46,186, -120,241,226,236, 71, 31,125, 52,112,216,176, 97,129, 75,150, 44,249, 31,128,241,101,105,190,249,230,155, 88,176, 96, 1, 70,141, - 26,117,221,114,158,231,165,180,180, 84,152,204, 38,186,122,245,234,116, 65, 16,130,102,207,158,173,126,227,141, 55, 8,171,110, -111, 15,162, 40,190,221,238,179, 85,175, 2,106,171,205,102,155,115,228,200,193,173, 0, 48,120,240,224,176,207, 62,251, 76, 1, - 0,159,126,242,169,140, 82, 42,115, 76, 12,251,254,251,239,171, 94,120,225,133,176,178, 52,127,253,245,215,220,247,223,127, 63, -228,217,103,159,237,185,101,203, 22, 21, 33,228, 47,148,244, 33,201,182,223, 56, 86, 1,176, 43, 52, 52, 52, 98,249,242,229,117, -186,119,239,174,245,234, 2,139,139,191,157, 63,127,126,205,153,219,253,240,103,241, 0,164,208,193,160,193, 20,193,242, 66, 52, -210, 93, 70,199,136,148,200, 37, 75,150, 44, 4, 16, 95, 1,115,213,248,209, 71, 31, 93,249,205, 55,223,212,122,254,249,231, 83, -119,237,218,149, 66, 8,153,226, 97,213,156,167,158,122,234,210,162, 69,139,234, 72,146,180,158, 16,210,147, 82,122,134,229, 30, -198,109,228,192, 45, 90,247,150, 33,148, 99, 50,158, 33,132,196, 78,152, 48,225,227,200,200,200,234,147, 39, 79,190,216,168, 81, -163, 98,103,105,203,201,209,109,219,182, 45,166,160,160,160,208,102,179,141,160,148, 30,241, 80,120,155,184,205,137,116,137, 16, -242,113,243,230,205,135,252,252,243,207,219,252,252,252, 10,246,238,221,235,239,239,239,159,127,252,248,113, 45,207,243,250,243, -231,207, 99,211,166, 77, 29, 0,124,238,233, 46,201, 93, 51, 61, 61,253,159, 90,181,106,125,250,198, 27,111,188,241,238,187,239, -170, 36, 73,130,193, 96, 64, 97, 97, 33,140, 70,163,179,115,242,178,101,203, 76, 38,147,233,235,180,180,180,189, 62,104,238,169, - 86,173,218,130, 57,179,231,188,248,220,144,199, 20, 52, 47, 7,249, 25, 6, 16, 99, 49,116, 42, 5, 26,119,137, 66,113, 14,193, - 55,219, 14,154,175,153, 45,203,211,210,210,182,122,211,220,121,185,240,143, 7,235,134,109,122,127,234,228,110, 19,191,255, 13, -146, 36,225,228, 75,195,145,187,125, 19, 52,141,154,162,205,201, 44,152,205,102, 76,120,243, 13,240,250,204, 29,123, 47, 23,173, -240,166, 89, 25,184,106,218,231,161, 58,224, 98,142, 94, 36,132,140,104,216,176, 33, 70,143, 30,141, 71, 30,121,164,212,182, 43, - 87,174,196,252,249,243, 97, 50,153, 70, 16, 66, 14, 81, 74,231, 85, 68,179, 86,173, 90,173, 26, 55,110,204, 71, 70, 70,234,237, -102,163, 75, 82, 82, 82,203,134, 13, 27,150,171,121,139,246, 61,247,236,217,179,254,159,124,242, 9,177, 88, 44,152, 50,101, 10, - 28,198,210, 17,113,122,251,237,183, 35,253,252,252, 48,115,230, 76,115,118,118,118,215,156,156,156,205,115,231,206,173,178,108, -217,178,161, 14,131,229,166,121,245,196,137, 19,126, 11, 22, 44,224,108, 54, 27, 62,251,236,179,235, 34, 90, 99,199,142,133,197, - 98,133, 76,144,153, 77, 70, 83, 99,181, 90,125, 46, 40, 40, 72, 45, 73, 18,189, 93,231,253,191,174,121,228,200,145,141, 0, 54, -150,115,243, 1, 0, 48, 24, 12,200,206,206, 70,118,118, 54, 2, 2, 2, 0,151, 9,102,221, 53, 13, 6,195,225, 55,223,124, 51, -241,171,175,190,234,185,123,247,238,199,182,111,223,222,123,211,166, 77,198, 75,151, 46,217,172, 86, 43,141,136,136, 16,218,181, -107,167,234,221,187,183, 86,169, 84,114,111,191,253,118,246,135, 31,126, 88, 5, 64, 78, 57,245, 39, 47, 73, 18, 94,107, 95,128, - 55, 59, 11, 48,153, 74,110, 40,211,211,211,144,148,148,132, 61,123, 78,129, 16,194, 85,240,120,206, 89,178,100, 73,140, 66,161, - 32, 75,151, 46,173,190,116,233,210, 87,188, 29,191, 31,127,252,177,230,210,165, 75,231, 17, 66,186, 81, 74, 37,150,151,152, 38, -163,130, 6,203, 94,160,147, 0,244, 36,132,180,123,254,249,231, 63,106,216,176,161,201,102,179,201,214,175, 95,223, 32, 59, 59, - 91, 97,179,217,222,164,148, 86,168,189,146, 82,186,128, 16,130,254,253,251,191, 89,187,118,237,205,135, 14, 29,106,246,240,195, - 15,175, 95,185,114,101, 59,155,205,118,254,216,177, 99, 35, 0,204, 1,240,185,175,154,201,201,201, 83, 54,109,218, 68,246,238, -221,251,250,132, 9, 19,148,161,161,161, 36, 48, 48, 16, 6,131, 1, 41, 41, 41,116,209,162, 69, 38,147,201,244,121, 64, 64,192, - 59,190,106,134,134,134,142,223,126,240,160,226,244,185,179, 79, 63,221,235, 33, 85,245,122,245,161, 35, 64,209,181, 28,108,219, -150,129,239,247, 29, 54,102,155, 45, 63,241, 60,239,243, 80,250,232,115, 89, 61, 55, 46,255,102,221,214,191,255,238, 54,109,198, -199, 36,242,137,231,160,173, 81, 11, 82,205,186,216,182,117, 43, 62,124,127, 10,229,139, 50,183, 91,207,101, 62,116, 7, 67,180, - 54,123,225, 81, 2,248, 68,146, 36, 1, 40,233,147, 53,102,204, 24,184, 62, 58,103,254,252,249, 48, 24, 12, 0, 32, 16, 66, 62, - 33,132,124, 87,214,140,238,101,104, 86,251,227,143, 63,170,185,106, 54,108,216,208, 39,205,202, 38, 51, 51,243,157,103,158,121, -102,134, 76, 38, 11,144, 36, 9,158, 70,187,107,181, 90, 20, 20, 20, 64, 20, 69, 91,112,112,240, 41,171,213, 10, 65, 16,202, 44, - 71,197,197,197,239,140, 26, 53,234, 3, 66, 72,153,145, 14,181, 90,125,105,231,206,157,117,135, 13, 27,198, 45, 95,190,252,194, -208,161, 67,149,187,119,239, 22, 1,252,198,170,167,187, 19, 74, 41,138,139,139, 1,128,150,179,206,101, 66,200,155,137,137,137, -170, 81,163, 70,197, 63,241,196, 19,254,157, 59,119,214,185,174, 99, 48, 24,164, 53,107,214, 20, 47, 88,176, 32,103,251,246,237, - 7, 70,142, 28, 57, 0, 37,205, 27, 30, 73, 79, 79,255,227,139, 47,190, 8,232,216,177, 99, 61, 81, 20,145,157,157,237,236,131, -149,154,154,138, 75,151, 46, 93,146, 36,105,117, 5,119,231,165, 97,195,134,253,185,104,209,162, 26,207, 63,255,124,234,178,101, -203, 86, 3,200,247,176,158,110,224,192,129,253, 22, 45, 90, 84,227,133, 23, 94,184, 12,224, 21, 54,195, 59,131,113, 19, 6,203, -165,178,216, 9,160, 53, 33,164, 63,207,243,227,138,138,138, 62,163,148,174,186,137, 10,106, 1, 33,100,253,217,179,103,159, 5, -144, 48,103,206,156,137, 0, 82,236, 97,189,238,158,250, 43,120,209, 19, 1,188, 27, 21, 21,245,235,228,201,147, 43,229, 89,132, -246, 71,234,188, 20, 25, 25,185,236,163,101,191,190, 67, 41,141,227,168, 20, 34, 17, 46,151,227,184,127, 68, 81,252, 48, 53, 53, -117, 91, 69, 52,127, 41, 73,103,247, 7,171,251,245,121,243,133, 97, 31,219,100,234,154, 69, 70,155, 66,171, 20,204,114,209,116, -137, 51,228,190,189,247, 82,209, 93,121, 97, 53,153, 76,182, 1, 3, 6,124,203,113,156, 4, 0,162, 40, 10, 38,147,233,105, 95, -243,208,237,210,188, 81,178,179,179,139, 0,188, 84,222, 58,237,219,183,255,113,221,186,117,195,186,119,239, 46,174, 93,187, 54, -179, 79,159, 62, 66, 98, 98, 34, 5,176,169, 12,227,111, 66, 25, 79, 36,112,208,188,121,243, 26,223,125,247,221,161,103,159,125, -214,127,222,188,121,193,251,247,239, 23,191,249,230,155,130,162,162,162,153,172,122,186, 59, 32,246, 65, 41, 50,153, 12, 26,141, - 6,254,254,254,200,202,202,242, 58,210,147, 82,122,142, 16,242,240,184,113,227,218,143, 27, 55,238,225,232,232,232,198,213,171, - 87,175,206,113, 28,151,145,145,145,149,146,146,146,108,177, 88, 54, 3,248, 3,128,188,118,237,218,255, 0, 88, 92,150,222,241, -227,199, 63,136,140,140,220,242,251,239,191, 63,172, 84, 42, 27, 41, 20,138, 96,171,213,202, 21, 23, 23, 95,179, 88, 44, 39, 76, - 38,211,218,244,244,244,221, 21,172, 59, 79, 19, 66, 58, 11,130,240,199, 55,223,124,211, 48, 35, 35,163,230,182,109,219,250,186, -175, 23, 31, 31,191,104,209,162, 69, 53, 70,143, 30,125,110,233,210,165, 21,234,131,197, 96, 48,131,229, 91, 97, 92, 5, 96, 85, -101,252, 49,165,244, 18,128,119,236,175, 74, 33, 45, 45,237, 40,128, 97,149,121,128,210,211,211,119, 1,232, 1,148,204,230,156, - 82,114,209,188, 41,246, 94, 46, 92, 11, 96,237, 93,126,151,110, 34,132,140,179,143,114, 2,128,113,238,211, 38, 16, 66,142,184, - 46,247, 22,105,186, 21,154,183,147,220,220,220,255,125,255,253,247,251, 95,126,249,101,229,224,193,131,113,226,196, 9,204,155, - 55,207,148,155,155,187,236, 70, 53, 15, 31, 62,124,169,121,243,230,113, 11, 23, 46,124,253,235,175,191,238, 79, 8, 97,207, 34, -188, 75, 48,155,205,231, 31,127,252,113,199,243, 83,169,227,209, 73,142,105, 59,108, 54,219,121, 31,202,145, 13,192, 22,251,203, - 27,159,248, 80, 31,237, 1,176,167,146,203,250,101, 66,200,195,201,201,201,211, 78,159, 62,253,151,167,117,146,146,146, 86,118, -239,222, 93,179,103,207,158,183, 42, 58,138,144,193,248,207,222,156,221,192,196,191, 21,185,243, 99,237,211,247,184,166,183, 7, - 47,123, 90,126, 39, 52,217,121,103,154, 76,147,105, 50,205,123, 91,243,126, 67, 96,135,128,225,229,238,214,116, 51,203,111,151, - 38,131,193, 96, 48, 24,119, 19, 4, 64,147, 50, 46,114, 62, 59, 83, 66, 72,133,231, 74,242,166,207, 52,153, 38,211,100,154, 76, -147,105, 50,205,251, 79,211,131,246,163,110,139,210,220,244,190,190, 39, 13, 22,107, 34,100,154, 76,147,105, 50, 77,166,201, 52, -153,230,157,214, 44,227,127,158,191, 87, 13, 22,123,160, 44,131,193, 96, 48, 24, 12, 6, 51, 88, 12, 6,131,193, 96, 48, 24,119, - 55, 62,117,114, 87, 40, 20,177,148,210,145,132,144,170,132,144, 43,148,210,239,204,102,115,210,127,237, 96, 41, 20,138, 88, 66, -200, 72, 74,105, 85, 74,233, 21, 66,200,157, 61, 14,132,144, 41,147, 75,102,147,126,111, 50, 40,110,101,123, 47,131,193, 96, 48, - 24,140,155, 55, 88, 53,171, 85,123,140,227,201, 92,139, 85, 12, 10, 12, 12,228,190,248,226, 11,174,111,223,190, 88,179,102, 13, - 94, 25, 51,230,149,168,168, 72, 73, 46, 8,185, 84,178,189,146,156,146,254,179, 47,127, 54,112,224,192, 76,171,213, 90,230,172, -214, 60,207, 95, 93,185,114,101,248,205,238, 84, 84,252, 99,153, 86,139,165,204,255, 17, 4,217,213,244,127,126,241,233,127,170, - 85,139,124,140, 39,220, 92,171, 40, 5, 5, 5, 5,113,159,127,254,185,243, 56,188,252,242,203,175, 68, 71, 69, 73,114, 25,159, - 43,137,244,149,228,148,148,159,111,219,153,115, 49, 87, 0, 48,101, 50,200,123,132,128,153, 44, 6,131,193, 96, 48,238, 98,131, - 69, 56,204, 91,250,213, 39, 65, 57,215,114,177,108,229,122, 52,108,216, 16,199,143, 31, 71,195,134, 13,209,174, 85, 51,174, 71, -235,230, 28,207, 33,116,210,231,139,231, 1,240,201, 88, 88,173,214,176,223,127,255, 29,132, 16,231,132,125,142, 73,251, 10, 11, - 11,241,234,171,175,134, 85,198, 78, 89, 45,150,176,243, 7,126,131,140, 39,176,138, 20, 86, 27,133,213, 38,193, 34, 82, 20,232, -109,232,242,240, 48,159,255,135, 3, 55,239,187,185,159, 4,229,229,231,227,183, 63, 55,150, 58, 14, 93,218,182,228, 6,247,238, -196,105,212,242,208,231,199,127,228,243,113,168, 12, 92,205, 85, 41,147, 85,206,227, 59, 24, 12, 6,131,193, 96,220, 97,131,101, -182,138, 65,225,193, 1,248,254,187,239,240,230,132,247,209,160, 65, 3, 80, 74, 65, 8,193, 91,239, 78,197,172,247, 39,224,241, - 94, 29, 96,181, 73, 65,101,105,120, 26, 97, 64, 8,193,197,139, 23, 97, 48, 24, 74,189, 98, 99, 99,125, 74,176,175,163, 22,100, - 60,193, 31,135, 10, 97,177, 74,176,216,236, 47,171,132,206, 77,252, 42,164,105, 21,165,160, 64,127, 29, 22,126, 53, 31,111, 78, -253,164,212,113, 24,255,214,187,248,114,198, 59, 24, 59,250, 73,152,173, 98,208,141,164,179, 34, 48, 77,166,201, 52,153, 38,211, -100,154,247,171,230,125,105,176, 8, 33, 29, 1,108,181, 31, 52,103,100,196,106, 54,162,113,181, 16,204,159,249, 1, 40, 56, 72, -148, 2, 20,160,146, 21,181,170,104, 96,208,235, 43,252,135,146, 36,193, 98,177,192,106,181,226,235,175,191, 70, 81, 81, 17, 36, - 73, 66,195,134, 13, 1, 0,241,241,241,174, 17,152,203,137,137,137, 53,188,105,134, 53,125,228, 18, 40,170,187,254,246,222, 39, -223, 98,215,161,243,160, 20, 80,170, 53, 24,244,196, 11, 16, 37, 10,139,181,226,207, 39, 53,234,245,136,208,201, 48,235,195,119, -193,201,228,224, 64,192,113, 4, 28,145,208, 32, 58, 8,166,146,135, 19,223, 86,222,155, 12,234, 30,197,122,111, 50, 40,222, 99, -153,154,193, 96, 48, 24,247, 30,101,121,145,123,218, 96, 1,216,234,105,103,204, 70, 3,162,131,228,168,170, 11,128,205, 38, 34, -201, 18,129, 66,189, 17, 22,139, 21,151, 44, 22,156,251, 39, 3,109,218,180,193, 35,143, 60, 34, 90, 44, 22,200,229,242,252,149, - 43, 87, 6,123, 51, 88, 86,171, 21, 22,139, 5,197,197,197, 88,178,100, 9, 4, 65,128, 36, 73, 14, 87,236,124,111,219,182,109, -117,223,172, 52,170,159,219,255, 43,252, 84, 60,108, 18,133,205, 70, 97, 21, 1, 81,162,208,155, 37, 12,124,230, 29,216, 36, 9, - 54, 73,130,217, 7,131, 85,202,176, 5,183, 68,255,137,203, 0,232,156,203,253,149, 20,111,182,229, 32, 87, 40,161,144,243, 48, - 25,244,183,255,204, 81, 74,223, 35, 4,172,147, 59,131,193, 96, 48,238, 19,182,222, 15,198,202,221, 96, 57,221, 35,165,116,219, -191, 6, 75, 15,155, 85,132,213, 38,194,102,181, 33,191,200,128,143, 63,254, 24, 74,165, 18,132, 16,167, 89,146, 36,137,179, 90, -173,232,221,187,119,144,183, 63, 20, 69, 17, 22,139, 5, 22,139, 5,148, 82,240, 60,143, 7, 30,120,224,186,245,246,238,221, 91, -161, 29,241, 83,241,168,213,109,226,117,191,239,251,245, 3, 80, 74, 33,138, 37, 47, 95, 12,150, 55,195,214,162,227, 96,152,204, - 86, 80, 10,128,150, 68,184,238, 8,148, 82,103,159, 43, 22,185, 98, 48, 24, 12,198,125,128,187, 23,185, 47, 12, 22, 74, 66,115, - 78,247,104, 50, 24, 96,181,218, 96,179,137,176, 90, 75,140,145, 90,173, 70,135, 14, 29, 28,215,119,231,251,250,245,235, 97,177, - 88,188,254,161,163, 83,187,221,152,129, 82,138,101,203,150, 65, 38,147, 57, 95,114,185,188,194, 59, 98, 19, 41, 38,142,127, 13, -114,129,131, 76,224,156,239, 34,165,160,180,196, 28,137, 18,133,201,234, 91,144,167, 60,195, 6, 0,102,147, 5,160, 20, 20, 20, -134,226, 98, 86, 34, 24, 12, 6,131,193,168, 28, 74,121,145,123,221, 96,117, 34,132, 92,231, 60,204,134, 98,123,244, 74,132,213, -102,115, 26,168,153, 51,103, 66, 16, 4, 40, 20, 10, 8,130,224, 52, 68,190, 24, 44,163,209,136,152,152, 24,152,205,102, 52,108, -216, 16,148, 82, 12, 25, 50,228,186,245,246,239,223, 95,161, 29,177,138, 20,211, 63,250,236,186,223,119,254,242, 62,154, 54,170, -133, 86,117,181, 48, 90, 36, 20,232,109, 55,109,216, 0,148, 68,176, 0, 80, 10, 24,138,245,172, 56, 48, 24, 12, 6,131,113,115, -120,244, 34,247,180,193,178,135,226,174,115,139, 70,189, 30, 54,171,205,105,178,204,102, 51, 36, 73,194,152, 49, 99,174, 19,218, -188,121, 51,204,102,115,249,127, 38, 8, 87,159,123,238,185, 82, 83, 36, 80, 74,241,235,175,191, 66,169, 84,150,138, 98, 17, 82, - 49,243,106, 21, 41, 38,191,253, 6, 20, 50,190,148, 33,146, 36, 96,205, 31, 27,176,230,143, 13,206,117,121, 94,118,245,102, 12, - 27, 0,152,205,246, 8, 22,165, 40, 46, 42,100,197,130,193, 96, 48, 24,140,155,160, 44, 47,114, 79, 27,172,178, 48, 26,138, 97, -117,233,131,101,177, 88, 96,179,217,240,245,215, 95,151,106,206,147,201,100,224, 56,206,107, 4,235,247,223,127, 47, 53,185,103, -124,124, 60,165,148, 98,208,160, 65,206,230,198,167,159,126, 26,207, 63,255,124,133, 13,150, 77,164,152, 50,109,166, 83,167,119, -183,246,232,223,171, 35, 36,187, 23,190,122,108,101,133, 4,203, 51,108, 0, 96, 54,149,244,193,162, 0,244,133,172,137,144,193, - 96, 48, 24, 12,134, 15, 6, 75, 38,112,249,231, 46, 93, 9,168,162, 85,193, 38,153, 96,147, 74, 70,254,137,162,136,231,159,127, -222,185,222,208,161, 67, 49, 98,196, 8,143, 6,203,151,167,109, 75,146,132,157, 59,119,130, 16, 2,142,227,156,175,178, 40, 75, -179,216, 36, 97,215,207, 83, 33, 81, 10,137, 2,146,125, 32,130,217,230, 61,218,232, 73,211,155, 97, 83,234, 2,193,115, 20,132, - 0,231, 82, 51, 33,240, 92,126, 69,247,189,162, 48, 77,166,201, 52,153, 38,211,100,154,247,171,230,127,198, 96, 81,145,190,178, - 96,237,222,185, 86, 81, 10,112,252,214,184,113, 99, 88, 44, 22,252,245,215, 95, 78,227,193,243,188,179, 73,207,151, 62, 88,110, - 92,238,208,161, 67,121, 83, 49, 92,246,237, 76,227,114, 66,231,199,170,151,183,188,162, 9,243,102,216,190,217,254,239, 35, 8, - 5,142,203, 7,165,175,176,236,196, 96, 48, 24, 12, 6,163, 92,131,117, 57, 45,109, 49,128,197,174,191, 61,252,240,195, 69,253, -250,245, 83,219,108, 54,152,205,102, 88, 44, 22,152,205,102,231, 75,169, 84, 86,104,198, 77, 95, 38, 17,245,133,171, 71, 87,214, -168,212,163,226,131, 97, 75, 79, 79,175,193,178, 15,131,193, 96, 48, 24,140, 10, 25, 44, 79,232,245,250, 64, 66,136,144,158,158, -126,221,178, 43, 87,174, 0,128,237,126, 56, 40,149,110,216, 24, 12, 6,131,193, 96, 48,131, 85, 22, 91,183,110,181,221, 47, 38, -138,193, 96, 48, 24, 12, 6,227, 86,193,177, 67,192, 96, 48, 24, 12, 6,131, 81,185, 16, 0, 77, 60, 45,168,200,232, 0, 66, 72, -147,138,254,177, 55,125,166,201, 52,153, 38,211,100,154, 76,147,105,222,127,154,222,180, 93,183, 39,132, 60, 79, 41,253,250,158, - 52, 88,183,242,249,192,108, 8, 43,211,100,154, 76,147,105, 50, 77,166,201, 52,111,226,127,238, 89,131,197,154, 8, 43,114,162, -227, 95,144,177,163,192, 96, 48, 24, 12, 6,195, 27,194,237,250,163, 41, 83,166,220,148,153,123,239,189,247,164, 59,102,172,162, - 31,173,195, 11,248, 56,174, 69,211, 94, 92,141,129,127, 82,145,140,167,169,191,158, 99,217,231,198,104,161, 35, 85,172, 68,214, - 39, 72,167,234, 95,221, 79,120,240,108,182,126,183,222, 34,173,161,196,186,234,120, 1,205,101, 71,136,193, 96,120, 34, 58, 58, - 58,104,215,174, 93,213,219,182,109,123, 57, 53, 53, 53,215,215,101,101, 81,181,118,194, 8, 63,157,230, 37,163,201, 84, 43,192, -223,255,234,181,156,156, 5,233,231, 15,125,225, 88, 30, 19, 19,227,191,116,233,210,200,161, 67,135,166, 95,184,112,161,128,157, - 1,198,109, 53, 88, 45, 91,182,172, 37, 73,210,147, 0,158,160,148, 30, 62,116,232,208,163, 55,162,179,121,243,230, 40,171,213, -218,210,102,179,197, 1,136, 83,107,116,205, 77, 38,227, 85, 2,250, 84,175, 94,189,254,169,168, 94,124,124,252, 31, 0,122,123, - 52, 76,132, 76, 57,120,240,224,100, 95,181,120, 1, 31,111, 88,245, 77,255, 12,189, 26,219, 18, 47, 61,242,221,167, 19, 0, 96, -192,221,120, 66, 35, 35, 35,213, 0,158,226, 56,174,171, 82,169,172,103, 52, 26,147, 1, 28, 37,132,204, 75, 77, 77, 77,191, 33, -131, 73, 8, 23,171,147, 61,163, 81,107,122, 70,248, 41,226,210,114, 11,210,140, 22,105,135, 68, 44,159, 84,212, 16,213, 33, 68, - 81,187,122,224,182,215, 7,182,107,216,172,113, 93, 72,151, 14,195,152,151,213, 47, 49, 77,223,239,171,125, 87, 95,171, 67, 72, -220, 57, 74,205,190,104, 85,171, 86, 45, 66, 20, 69, 33, 61, 61, 61,197, 81, 25,154, 76,166, 4, 0, 13, 1,156, 84, 42,149, 7, -111,182, 82,188, 87, 52,163,163,163, 35, 37, 73,122, 54, 60, 60,252,225,204,204,204, 63, 56,142,251,230, 70,207, 55,227,191, 67, -205, 7, 71,124, 70, 56, 82,165, 34,219, 80,137,102, 39,239,253,241,181,219,125,159, 11, 0,148,210,167,171, 87,175, 94,151, 82, -122, 26,192,236, 82,233,242,188,172,204, 62, 48, 53, 99,219,172, 28, 51,234,169, 46,175,142,126, 90,167,209,168,161, 55, 24, 67, -230, 45,252,225,211,154,141,219,246, 78, 62,190,171, 23, 0,152, 76,166, 1,213,170, 85,171,105, 54,155, 47, 2,248,193,155, 38, -131,113,211, 6,171,113,227,198, 90,133, 66, 49,136,227,184,167,154,197,183,110,215,111,240, 83,196, 74, 52,248,240,141,161, 21, -158,194,225,208,161, 67,202,140,140,140,247,107, 53,136,255, 95,167,238,253,185, 70, 13, 27,160, 74, 72, 16, 36, 78,129, 69,127, -157, 9,217,250,213,211, 95, 0,104,125, 3,201,236,253,243,159,251,144,145, 39,130, 16,128, 16,128, 35, 64,145, 81,194, 91, 35, -219,189, 7,192, 39,131, 69,226, 95,144,197, 54,110,216,235,204, 53, 21,254, 58,102, 5, 16, 9, 77, 80,120, 47, 18,255,130,140, - 38,126,101,189,155, 78,102, 68, 68, 68, 92, 72, 72,200,151, 79, 63,253,116, 80,189,122,245, 34, 20, 10,133,198,104, 52,214,189, -116,233, 82,173, 89,179,102, 61, 20, 17, 17, 49, 35, 35, 35,227,183,138,104, 54, 12, 84, 85,239,213,160,198,207,227, 71, 63,217, -170, 94, 76, 53, 8,230, 98, 80, 83, 81,181, 75, 23,207,183,158,246,205,111,207,197, 6,200,134, 36,229, 91, 55,249,170,167,242, -147,191,253,214,243, 67, 26,214,241,163, 48, 31,223, 9,129,167, 80,249, 5,161, 85,117, 30, 4,180,209,228,191,211,223, 2,240, -158, 15, 70,114, 42,128,183, 0,144,136,136,136,159,101, 50,217,254, 7, 31,124,176,193,227,143, 63, 78,154, 54,109,138,127,254, -249,167,209,154, 53,107, 30,173, 94,189,250, 41,179,217,188, 47, 36, 36,228,240,241,227,199, 45, 62,230,111,121, 78, 78, 78,115, -133, 66,241,192,221,172, 25, 25, 25,169, 54,155,205, 79, 70, 71, 71, 63,223,175, 95,191,166,125,251,246, 37,245,235,215,199,169, - 83,167,226,215,173, 91,247, 94,243,230,205,143,166,166,166,126,173, 80, 40,126, 72, 79, 79,247,105, 18,224,193,221,200,169, 95, - 54,209, 6, 55,186,220,205,152, 7, 2, 80, 81, 74, 51,124, 88, 55, 28,128,134, 82,122,225,118,107,222,162, 72,203, 9, 66, 72, -176, 61, 29,142,244,148,250,236,250, 46,138, 98,241,165, 75,151,106,151,167, 89,189,122,245, 70,146, 36,241,174,191,201,100,101, -247, 90,176,217,108, 82, 74, 74,202,241,114,143, 17, 71,170,124,253,229,103, 1, 2, 7,136,212,254,178, 82,136,148, 66,146, 0, - 81, 2, 68, 73,130, 77,164,144,168, 4,171,141, 98,202,123,111,221,201,106,238, 97, 0, 29, 0,108, 7, 48,167,156,101,179,203, - 19, 9,171,211, 98,248,232,167, 71,116,126,235,141,151,116,148, 82, 80, 74,161, 86, 41, 49,238,213, 81, 10,163,209,220, 54,162, -110,194,243, 25,103, 15, 46, 36,132,116, 6,144, 0,224,160,139,193, 98, 48, 42,215, 96, 17, 66, 72,124,124,124, 7, 74,233, 83, - 53, 99,234, 12, 26, 56,236, 5,117,205,186, 77, 80, 36,249,227, 98,182,132, 67, 91,150, 2,192,242,138,252,249,250,245,235, 19, - 40,197,247,163, 39,124,214,160, 89,139,150, 56,150,102,195,174, 20, 17,197,231, 68, 8,188, 1,146, 4, 80, 74, 77, 55,186,115, -169,185, 54,236, 56,101, 6,207, 1, 28, 7,240, 28, 1, 95,193,231,116,211,196,175,172, 92,141,129,127,110,216,159,246, 8, 84, -225,208,231,166, 65,159,155,185,142,166,252,126, 87,153,171,168,168,168, 46, 49, 49, 49,179, 95,125,245,213,170, 25, 25, 25,193, -251,246,237,131, 82,169, 68, 80, 80,144, 80,165, 74,149, 6, 19, 38, 76,200,159, 54,109,218,184,240,240,240,127, 50, 51, 51,147, -125, 50, 5, 58, 69,195,142,113,141,119, 79,154, 58, 57,192,148,184, 14,121, 43, 86,128,231, 36,200,181, 58, 68,168, 53,152,243, -112,205,224, 9,235, 83,126,107,170, 86, 55, 60,106, 48,164,249, 20,117, 10, 11,238, 94,167, 94,125,228,173,157,135,179,121, 38, -236,201, 52,161, 95,199, 4,212, 9, 82,163,133, 77, 68,136, 74,232,226,205, 96, 69, 71, 71, 7, 1, 24,159,156,156,204,201,229, -114, 82,171, 86,173, 33, 95,127,253, 53,109,212,168,145,243,169,219,173, 91,183, 70,235,214,173, 73, 81, 81, 81,195, 93,187,118, - 53, 92,185,114,165, 53, 42, 42, 42, 49, 45, 45,109, 81,217,145,165,218,151, 77, 38, 99, 53,165, 74,109,156, 53,107,214, 79, 15, - 62,248,160,164, 80, 40,112, 51,154,118,227,187, 36, 58, 58, 90, 51,105,210,164,236,150, 45, 91,210,202,208,172, 85,171,214,134, -246,237,219,119,238,222,189,187,208,182,109, 91, 68, 70, 70, 58,151, 85,169, 82, 5,237,219,183, 39, 41, 41, 41,205,118,236,216, - 49,111,195,134, 13,115,107,213,170,181,229,226,197,139,221,125, 56, 69,245,111,114,121,169,224, 47,128,233,132,144,133,148,210, - 93,229,212, 45,113, 0,134, 2,248,248, 14,105,150,139, 90,173,206, 52, 26,141, 97, 0,160, 82,169,174, 26, 12,134,112, 31,234, - 75,221,172, 89,179,194,228,114, 57, 56,142,131, 40,138, 16, 69, 17,146, 36,129, 82,234,124,119, 12, 50,154, 58,117,170,232, 77, - 83,146, 36,238,179,207, 62,147,169,213,106, 0,128,213,106, 45,245,238,192,241,125,234,212,169, 62,213, 81,106, 5,143,119,223, -120,190, 21, 39,154, 85,229,254, 63,175, 48, 62, 51,110,246,254, 59, 96, 86,131, 40,165, 79, 2,232, 11,192, 81,198,155, 70, 69, - 69,253,237,182,106, 83,251,123,113, 84, 84,212, 22, 0,127, 16, 66,190,247,212, 92, 24,160,245, 27,245,250,152,103,253, 40,165, -152,178, 34, 27, 83,126,205,198,187, 3,130, 49,174,183, 6, 35,159,120, 84,251,253,226, 95, 94, 0,176,208,101,147,211,246, 40, - 26,139, 94, 49, 42,223, 96,181,104,209,226,207, 94, 3, 70,244,124,176, 67,119,216,228, 97, 56,117,149, 32,229, 34,133,192,219, -192, 65,194,133, 3,171, 40,199,113, 63,184,133,108,203, 28, 97,240,231,159,127,190, 86,189, 78,243, 25,111, 77,158,206, 31,203, - 84,224,251, 29, 6,136,166,124, 24,178,207,161,248,234, 25, 20, 94, 57,129,188,180, 99, 71, 57,142,155,236,171,230,117,230,136, - 2, 18,165, 32,148, 0,146, 61,178,203, 17, 15,235,149,175, 73, 69, 50, 62,113,195,247,143,180,232, 63, 17,103,118, 44, 6, 40, - 55,222,251,127, 87,254,232,138,178, 52, 35, 35, 35, 31,170, 89,179,230, 39, 47,188,240, 66,244,145, 35, 71,252,245,122,125,241, -254,253,251,183,101,100,100,132, 87,169, 82, 37,229,241,199, 31,111, 19, 22, 22, 22,214,161, 67, 7,205,250,245,235,223, 6,240, -172, 55,205, 38, 90, 69,108,251, 86, 77,246,124,240,201, 76,109,246,111,115, 97,190,120, 4,123, 50,141, 56,146,101,160, 81,254, -249,228,177, 38, 65,208, 42, 4, 60,255, 64,152,238,127,107,146, 63, 2, 48,204,151,125,175, 21, 21, 94,219,106, 48,192,104,176, -224,207, 51,249,134, 61,185,249, 97,156, 95,106,214,184, 71, 18, 84,124,118, 58,170,250,201,234, 86,244,120, 18, 66,160,209,104, - 60, 46, 11, 8, 8, 64,235,214,173, 81,187,118,109,217,208,161, 67, 31, 4,176,168, 44, 77,139,197, 18,145,150,150,142,122,245, -235, 41,187,118,237, 74,120,158,135,217,108,190, 41, 77, 0,208,106,181,125,227,226,226,132, 31,127,252, 49, 47, 57, 57, 57,105, -224,192,129,105, 26,141,166,212, 5, 85,163,209,160,122,245,234,120,241,197, 23,101,207, 61,247,156, 87,205,240,240,240,135, 22, - 47, 94, 12, 66,136,243,226,237, 78,141, 26, 53, 80,181,106, 85,244,238,221, 91,120,244,209, 71, 31, 42,239,120, 14,238, 70, 78, - 57,204,211,224,110,132,122,137,114, 81, 0,167,221, 35, 89,238,154,148,210, 28, 66,200, 2, 0,191, 19, 66, 6,121, 50, 68,132, -144,182, 0, 86, 0,232, 69, 41,189,234,237,188,187,106, 42, 20, 10,185,197, 98, 9,114, 55, 62, 21,213,116, 73, 11, 77, 76, 76, - 68,124,124, 60, 92,223,141, 70,163,211, 8, 17, 66,194,124,205,159, 60,207, 99,254,252,249,224, 56, 14,114,185, 28, 50,153, 12, -114,185,252,186, 87,139, 22, 45,124, 46,239, 50,153, 12,243,231,207,135, 40,138, 92,114,114,242, 83,162, 40,246, 55, 26,141, 97, -106,181, 58, 75, 46,151,175,237,216,177,227,119, 74,165,210, 86, 17, 77,142, 7, 56,209,172,218,180,126,181,182,172,115,110, 50, -153,208,167,255, 99,224, 8,119,219,235,186, 93,187,118, 85,175, 94,189,122,125,123,116, 10, 0,182,167,165,165,117,112,249,238, -202,246,180,180, 52, 71,215,144,179,151, 47, 95,174, 14, 32,215, 93,211,108,182,212,210,233,180,160,148, 98,202,175,217, 48,254, - 24, 3,213,136, 11, 24,249,128, 9,126,126,126,176,217,108, 13,162,162,162,126, 0, 80,207, 30,189,234, 23, 21, 21, 85,159, 82, -186, 69,169, 84,254,238,104,210,191,157,245,252,127, 65,211, 11, 45, 1,132,186,124, 55, 3,112,220,173,102,219, 13,112,136,219, -239,174,235, 57,222,179,236,191,135,218,183,163, 46,186, 89, 0, 14, 84,170,193, 34,132, 80, 74, 41,113,188,151,177,174,127,170, - 33, 16, 69, 23,171, 64,224, 36, 8, 60,129,192, 3, 0, 65, 78,234, 9,152,139,115,118, 30, 60,120,240,162, 47,127,250,215, 95, -127,181,174,217,168,213, 71,147, 63,248,148,251,110,187, 1,249,122, 35,178,143,175, 70,198,254,111, 51, 36,155,101, 53,199,113, - 7, 57,142, 59, 20,215,172,233,169,136,136, 8,241, 70,119, 78,162, 37, 33,110,167,177,146, 0,114, 3, 55, 32, 52,245,215,115, -145, 29,223, 41,245,253,110,113,200,209,209,209,189,234,212,169, 51,253,133, 23, 94,168,113,232,208, 33,191,194,194,194,172, 77, -155, 54,157,178, 88, 44,255,112, 28, 55, 39, 61, 61,189,227,226,197,139, 53,111,190,249,102,247,250,245,235,215,223,176, 97,131, -222,107,228, 74, 43,111, 54, 98,248,227,123,250, 63,255,138, 42,233,215, 47,160, 60,117, 8, 95, 31,207, 21, 15,102, 26,222, 54, - 22,217,102,171, 53, 66,219, 60,163,109,227,235,237, 35,184, 8, 63, 25,170, 5,200, 59,249,154, 94,133, 76, 41, 80, 65, 5,179, -201,134, 98,179,100, 62,158, 69,139, 95,235,212,196, 66,181, 85, 84, 0, 32,240,156, 87,211,159,154,154,154, 27, 25, 25,249, 81, -205,154, 53,223, 33,132,208, 14, 29, 58, 28,143,143,143, 47,150, 36, 9, 6,131, 1, 22,139, 5, 50,153, 12, 6,131, 1,151, 46, - 93,194,190,125,251, 16, 16, 16, 80,161,227,154,151,151,135,154, 53,107, 66,163,209,220,180,166, 36, 73,100,222,188,121,170,164, -164, 36,213,239,191,255, 30,252,218,107,175,229,183,104,209,226,196, 35,143, 60,146, 18, 28, 28,108, 57,124,248, 48,246,236,217, -131,220,220, 92,180,106,213,202, 39, 77,139,197, 2, 65, 16, 96, 48, 24,160, 84, 42, 33, 8, 2,108, 54, 27, 36, 73,114,154,174, -162,162, 34, 92,187,118, 13, 50,153,204,235,131,216, 29,102,105,112, 55, 66,127, 89,177,251,106, 73,219, 80,129, 21,150,124, 43, -108,249, 86, 88,243,173,176,230, 89, 7,191, 58,179,217, 47,155, 40,169, 64, 37,188,151, 16, 50, 8,192, 10,119,147,229, 98,132, - 6, 81, 74, 15, 87, 84,211, 98,177,236,116, 24, 31,149, 74, 21, 70, 72,137, 49, 84, 42,149, 86,147,201,212,185, 34,154, 0,144, -152,152,136,184,184, 56,222,174, 73, 29,239, 55, 18,181, 32,132,128,231,121,200,100, 50,240, 60,143,184,184, 56,244,237,219, 23, -245,235,215, 71,106,106, 42,182,110,221,138, 51,103,206, 64, 46,151,151,106, 58,244,134, 76, 38, 3,199,113,220,233,211,167,191, -235,218,181,107,157, 87, 94,121, 69, 81,189,122,117,156, 58,117,170,234,188,121,243, 70,108,222,188,185,227,128, 1, 3, 70, 0, -176,149,215,124, 88,202, 8,218, 77,147,201,100,194,137, 19, 39,202, 95,183,162, 77, 0,149, 64,219,182,109, 47, 83, 74,207,162, -164,233,175,105, 90, 90, 90,135,168,168,168, 63, 1,184, 27,194,226,180,180,180,222, 81, 81, 81,249, 0,142, 2, 56, 77, 8,185, -156,154,154,122,157,102, 96,128,127, 86, 81, 81,113,184, 86,171,193,219,253, 3,161, 26,113, 1, 99, 58,243,176, 90,173, 56,127, -254, 34,106,213,140, 38,203,191, 95,229,104, 26, 76, 56,120,240, 32, 80,210, 84,152,156,146,146, 18, 9,128,117,120,191, 5,120, -241, 34,161,132,144,181, 46,245, 64, 31,199,247, 9, 19, 38,188, 53,125,250,244, 36, 66,200, 90,215,223, 93,215,115,125,183,255, -215, 90, 74,105,159,137, 19, 39,198,206,152, 49, 99,154, 99,221, 59, 18,193,226,121,126,224,177,191,102,239,173,107,161, 53,194, - 99, 31,182,215, 57, 37, 17,211, 75,135,255,130, 36, 73,139,124,209,217,179,103,143,202, 38,225,187, 55,223,154,202,125,181,197, -128,204, 43,233, 72,223,246, 49, 12, 87, 79,124,175, 86,171, 95,239,218,179,207, 77,103,220,248,248,248,216,192,144,170, 48, 89, -168,221, 96,149, 54, 89,247, 11,145,145,145,125,235,212,169, 51,117,245,234,213, 53, 12, 6,131,223,174, 93,187,242, 54,110,220, -120,214, 98,177,124,147,145,145,177,196,158,137, 86, 11,130,240, 62,165, 20, 58,157, 78,224,121, 94,237,200,189, 30, 35, 87, 1, -242,184,167,159,122, 98,231,107,115, 22,170,206, 30, 59,140,185,203,255,132,146, 90,196,227, 57,230, 71,142, 21, 90, 29,153,246, -239,222, 81,154, 52, 74, 81, 77,198, 17, 4,107,100, 85, 91, 19,162,218, 67,169,209, 91,154,171, 84,171,193,217,162, 98,176, 67, -111,130,206, 95,174, 0,128,168,122,141,249,195, 5, 54,236,218,127, 18, 42, 85,144,220,151,125, 79, 79, 79,159, 20, 21, 21, 85, -115,227,198,141,156, 94,175, 47, 62,114,228, 8, 66, 66, 66, 16, 22, 22, 6,127,127,127,156, 58,117, 10,155, 54,109,194,233,211, -167, 65, 41, 45, 51, 74, 80, 22,153,153,153, 40, 40, 40,168, 20, 77,155,205, 70, 0, 32, 54, 54, 22,177,177,177,138,180,180,180, -176,181,107,215, 6, 77,155, 54,237, 74, 68, 68,196,122,131,225,223,238, 81,238,205, 61,229, 69, 20, 0,192,104, 52,194,100, 50, - 65, 46,151, 67,165, 82, 65, 46,151,163,160,160, 0,153,153,153, 40, 44, 44, 44,185,152, 4, 6, 58,215,247, 9, 81, 2,246,182, - 59,120,221,239, 81, 79,133,221,224,157,238, 46,187,201,250,155, 16,226, 56,191,153,246,247, 65,229, 53,245,121,209, 44,117, 60, - 92,162, 76,178, 27,209,140,143,143,119,104,148,170, 37, 84, 42,213, 85, 71,228, 74,165, 82, 93,245, 69,203,209, 44,168, 80, 40, - 16, 27, 27,139,215, 95,127, 29,167, 78,157,194,206,157, 59, 17, 22, 22,134, 30, 61,122, 64, 16, 4,164,164,164,128,227, 56,159, - 12,150, 92, 46,135,213,106,197,217,179,103,159,234,210,165, 75,204,220,185,115, 21,201,201,201, 56,117,234, 20,252,253,253,241, -254,251,239, 43,199,143, 31, 31,189,126,253,250,231,154, 55,111, 62,223,231,186,157,148, 52,255,245,233,255,152, 7, 35,162,149, -253,184,232, 91,133,195,120,113,119, 96, 98, 31,123, 19,223,103, 0,102,217,155, 5, 59, 0,208,166,165,165,117,182, 95,132, 0, -128,218,155, 5, 1,224,104, 90, 90, 90,151,242,204,113,198,213,140, 5, 31,207,249,106,214,148,183,198, 42,198,245,214, 96,228, - 3, 38,136,162, 8,158,231, 49,119,193,247,214, 51, 39,142, 29, 73, 72, 72, 88, 11,160,223,193,131, 7,145,144,144, 80, 8,224, - 12,128,139, 10,133, 34,253,194,133, 11, 96,220, 25,220, 77,144,195, 56, 77,159, 62,189,143, 39, 83,229,193,196,149,250,125,198, -140, 25,211, 92,190, 87,234, 40,118,193,213, 57,122,185, 11,143, 8, 12,141, 10,126, 97, 88, 15,172, 60,226,120, 32, 33,133,197, -164,199,149, 83, 91,244,102,179,121,133, 47,127,152,147,147,243,254,200,215,103,214, 57,120, 89, 64, 70,174, 30,233,155,167, 82, - 75, 94,242,160,190,125,251,174,172,140, 29,138,143,143,143, 13,170, 18,185,245,157,143, 22,226,239,179,102, 72, 20, 32,212,165, -202,188, 79,102,254,138,138,138,170, 27, 20, 20,244,233,170, 85,171,194, 20, 10,133,223,209,163, 71,197,109,219,182,165, 91,173, -214,121, 25, 25, 25,203, 92, 76,216, 19, 77,154, 52,177,106,181, 90,100,100,100, 24,173, 86,107, 81, 89,230, 42, 86,173,142,142, - 79,104,178,253,181, 57, 11, 85, 70,179, 25,249, 6, 19, 66, 35, 34,196,157, 71, 79, 60,114,188,208,230,188, 35,104,236, 39,107, -243,104, 66,173, 40, 78,237, 7,232, 11,144, 86, 96, 78,247,197, 92, 1,128,214, 47,144,139, 78,232,132,132, 87, 63,199,241,201, -111, 83, 0, 8, 12,143,228, 58,191,248, 33,116,241,125, 49,255,149,167, 42, 98,129, 13,245,234,213,195, 63,255,252,227,200, 91, -200,201,201, 65, 76, 76, 12,230,206,157, 91,106, 69,163,209,120, 67,199,185, 50, 52, 37, 73, 34,110,231, 14,163, 71,143,150,173, - 91,183, 78,235,106,174, 42,162,105, 54,155,157,134,130, 82, 10,179,217, 12,179,217, 12,173, 86,139,179,103,207,150,246, 75,162, -232,177,169,179,236, 4,231,123, 14,119, 89,115,172, 55, 81, 41,238, 34,132,200, 93, 76, 80, 56,128,118, 55, 98,132, 60, 25,159, -202, 32, 49, 49, 17,158, 46,200,142,166,199, 67,135, 14,209,184,184,184,240, 10,236, 51, 20, 10, 5,250,245,235,135,147, 39, 79, - 34, 61, 61, 29,126,126,126, 48,153, 76, 48,153, 76,136,139,139, 67,102,102,166,207,209, 43, 23,221, 94, 99,198,140, 81, 93,188, -120, 17,215,174, 93,131, 74,165,130,205,102,131, 40,138,120,238,185,231, 84, 47,190,248, 98, 79, 0,190, 27, 44,158,160,219, 83, - 31,121,236, 91,245,247,183,255,235,168, 84, 42,157,205, 45, 60,119, 87, 85,160,174,125,162, 42,116, 16,175, 94, 56, 58,191, 70, -163, 54, 15,217, 44,150,206,207, 60,249,152,159, 78,171,193,249, 11,201,152,255,205,143,214,191,119,252,159,189,243,142,138,226, -250,219,248,115,103,123, 97,233,189, 8, 40, 29, 81, 17, 80,177,162,177,119, 77,140, 26, 77, 44,177, 38, 26,163,198,154,216, 91, -140,177,166,153,216,141, 26, 75,212,216,123,141, 29, 43, 22, 16,145,222, 59,203, 46, 91,231,190,127, 0, 6, 13,101, 65,243, 75, -121,231,115,206, 28,216,153,217,103,239,157,185,115,231,153,239, 45,115,227,108, 70,242,211,110, 0,136,139,139,139,111, 89,228, - 42, 38, 37, 37,229,131,186, 70, 52, 57,106, 23,197,170,100,221,232,242,129, 45, 85, 25,167,218, 24,180,138, 17,174,114,102,206, -156,217,112,233,210,165,111,180,143, 33, 83,225, 71, 73, 53,166, 37,216,210,214,229,220,204, 37, 63,153,237,191,199, 67,110, 90, - 52,146,110, 31,132,129, 5,210,162,127, 7, 53,234,127,125,248,240, 97,113, 77, 63,118,226,196, 9, 31, 55,223,208, 79,154,132, - 52,199,137, 7, 26,228,222,223, 5,109,222,243,239,123,244,232,241,230,204,149,141,211,249, 89,203,126,178, 62, 20, 37, 64,226, -243,104,156, 95,219, 27, 39,151,191,133,227, 95,190,133, 35, 75, 59,224,183,197, 29, 0,224,104,109,116, 35, 8,225,123, 90,233, -208, 41,128,192,217, 86, 5, 18, 65,248,127,119, 33, 76, 73, 73,121, 10, 96,235, 79, 63,253, 84,116,249,242,101,227,216,177, 99, - 99, 10, 10, 10, 22,165,166,166,238,170,112, 35,239, 80,191,126,253,169, 11, 22, 44,240, 53, 26,141,184,120,241,226, 83, 30,143, - 87,101,251,114,148, 90,157,124,231,254,195,239, 46,239,216,128, 59,183,110, 98,251,156,201,134, 43, 15, 30,245,122,201, 92,153, -137,252,195, 27,122, 31,254,104,226, 71, 12, 17,203,241, 36, 91,131, 52,165,254,140,201,233, 46, 82,233, 5, 98, 41,204, 28, 61, -144,160,102,133, 46, 46, 46,215,147,243,213, 66,134,199, 7,195, 23, 34, 46, 79, 83,171,155, 56,203,254,217,143,189,106, 90, 0, -212,216, 68, 86,163,147,123, 13,205,242, 8,214,159,252,138, 94, 79,234,170, 89,209, 96,189,106,166, 42, 59, 70,181, 50, 88,186, -194,202,207,129, 54,231, 77, 12,236,208,150, 45,120, 29,115, 85,110,124,202, 35, 74, 98,177,248, 69, 83,155,169, 81,166,202, 34, - 88,175,179,253,149, 27, 2, 88,150,133, 64, 32,128,183,183, 55, 10, 10, 10, 96,110,110, 14,133, 66, 1, 51, 51, 51,136,197, 98, - 56, 56, 56, 64, 36, 18,129, 97, 24, 48, 38, 26, 23,189, 94, 15,173, 86,235,232,234,234, 10,165, 82, 9,137, 68,242, 98, 17,137, - 68,240,245,245,133, 82,169,172,149,233,172,141,105,226,253,135,166,166, 78,120,116,165,223,150,221, 7, 39,118,236, 53,228,102, -227,240,110,154, 47, 22,175,214,156, 57,125,250,118,250,179,219,221, 56,155,243,183, 70,168, 72, 37,235,126,172, 42,130,245, 38, -162, 96,229,145, 44, 0,210,191, 36,130, 85,147,185,154,190,248, 71,243, 61,183, 25,228,167, 61, 65,194,241, 89, 69, 70,157, 42, -143,101,245,238,121,207, 46, 3, 21, 58,228,214,112, 51, 12,107,217,161, 15,115,254,177, 22,186,162, 84, 20, 70,253, 18, 47, 22, -139,103,188, 73,115, 53, 99,233, 79,214,251,239,241,145,155, 26,141,103, 71,103, 22, 24,117,170, 14,145,145,145,181,158, 71,107, - 12, 33,130,245,148,234,251,216,219,247,117,115,115, 88, 62,162,191, 2,109, 59, 74, 97, 46, 52,199,130,175,152,199, 14,173,200, -212,140,223,233, 33, 18, 66, 4, 52,146,254, 45, 35, 10,163,162,162, 22,123,123,123, 51, 6,131, 97,132, 78,167,155,151,154,154, -186,183, 66,228,170,147,187,187,251,242,133, 11, 23,186,198,199,199,139,174, 93,187,150,123,231,206, 29,214,104, 52, 46,171, 78, -243,126,129,102, 90,144, 66,200,243,114,115,158, 16,155,156,220,251, 65,161,225,120,249,182, 32,185,168, 97,235, 96,255,223, 23, -206,159,169,208, 93,219,135,226,244,100,124,115, 45,189,144, 53,234,103,154, 24,117,179,246, 16, 2, 51, 71, 13, 99,139,138,138, - 32, 19, 9,217,228, 39,207,120,239,119,108,107,252,114,250, 20, 38, 61, 61, 29,170,226, 98,158,139,139,139,117, 74, 74, 74,174, - 41,154,149, 25,138,202,162, 64,181, 50, 24,149,240, 58,154,175, 70,176,170, 51, 88,166,106, 86,108, 18,171,233,120, 24,141,198, -218, 53, 17, 26,170, 48, 88,186, 44,221,107, 22,217, 68, 66, 72,189,242,255,223,196, 53, 80, 82, 82, 98, 95, 33, 42, 86,237,131, -162,137, 17,172, 58,111,175, 42,130, 21, 27, 27, 11, 59, 59, 59, 24, 12, 6,200,229,114, 72,165, 82, 72,165, 82,168,213,106,136, - 68, 34,240,120,188, 90,233,138,197,226,244, 39, 79,158,184, 91, 89, 89,193,104, 52,190,100,178,158, 63,127, 14, 11, 11,139, 76, - 83,251, 95,149, 70,176,128,211, 91,166, 87, 58,138,208,210, 66,254,146, 16,143, 16,252,131,160, 21, 34, 87,117,138, 42,165,199, -220,216, 14, 96,187,139,139,203,214, 29, 27,142,132,134,134,134, 30,121, 93, 77,142,191, 60,194,117,184,162, 73, 34,132, 28,158, - 49, 99, 70,157,231, 14,153, 49, 99,198,172,202, 34, 90,111,204, 96,149, 87, 74,175, 86, 78, 33, 33, 33,193,150, 54,206,231,166, - 46, 92,111,190,227, 22,131,130,180,199, 72, 61,253,121, 1,171, 83,117, 96, 24, 38, 45,233,202,143,123, 1,168,110,223,190,125, -193,196,155, 97, 83, 63, 31, 31,236,137, 50,160, 36,253, 30, 24, 66,183,116,236,216, 81,245,186,153, 40, 55, 87,211,150,252,104, -189,231, 14, 31,121,165, 38,176,128,173,131,185,122, 79, 44,246, 18, 48,204,114,175,240,166, 61, 6, 57,216, 42,187,123,201, 44, -187,123,137,193,187,118, 0,135,156, 51,145,107,123, 22,227, 86,185,120, 93, 57, 88,248, 91,189,183,248,185,189,219, 54, 49,119, -110,199, 63,162,167,198,105, 89, 23,233,255,188,243,251,211,167, 79, 23, 58, 58, 58,238, 79, 79, 79,127,209, 59,213,213,213,181, -155,135,135,199,146, 5, 11, 22,120, 36, 37, 37, 41,238,222,189, 91,184,119,239,222,231, 12,195, 44, 72, 75, 75,171,241,233,254, - 65,145,110, 74, 67, 51,209,134, 40,165,225,201,139,200,149, 92,216,120,216,251,131,174,118, 28, 52, 92, 18,119,126, 43,172,147, - 31, 98,245,141, 76, 99,114, 65,201,224,199, 42,154,110,138,185, 18,137, 68,123,214,238,219,247, 52, 40, 40,136,168, 84, 42,232, -245,122,100,101,101,225,171,159,247, 68,177, 44, 11, 43, 43, 43,156, 57,115,134,253,228,147, 79,246,184,184,184, 12, 48,197,100, -177, 44,251,226,102, 85, 85, 20, 72, 42,149,214,206, 96,148,125,167,162,129,121, 29,205,170, 12,214,171,145,173, 90,106,150, 94, -192,101,157,219,171,138,232,241,120, 60,176, 44, 91,105,164,175,234, 48, 73,126, 21, 6, 43,243,181, 30, 36, 40,165,238, 53, 12, -164,249,219, 40,155,138, 1, 0,216,170,166, 98,168,208, 71,203,164, 8, 22, 0,136, 68, 34, 92,185,114, 5, 93,187,118, 5,203, -178, 16,139,197,144, 74,165,144, 72, 36,184,113,227, 6,132, 66, 33,120, 60, 94,173,154, 9, 5, 2,193,177,111,190,249,102,216, -178,101,203,164, 44,203, 66, 36, 18, 65, 42,149, 66, 44, 22, 99,229,202,149,106,145, 72,116,188, 86, 6, 11, 53,143, 34,172,104, -198,254,215,188, 50, 77,195,171, 83, 49, 84,228,213, 41, 28,170,156,166,193,197,197,197,154, 16,242, 33,165, 52,176,108,213, 75, -163, 5, 43, 6, 74,203,183,187,184,184,108,125,117, 20, 33,199, 95, 19,189,170,162,142,200,122, 37,242,164,173,240, 57, 11,165, -239, 86,238, 89,246, 63, 42,249, 95, 91,201,186,156,165, 75,151,158,171,208,127, 43,235,127, 18,193, 10, 14, 14,246,183,182,115, - 61, 55,121,225,122,243,173,215,121, 40, 72,123,132,236,115, 95, 20, 80,131,186,162,105,105, 93,203,223, 11,182,183,183, 65,246, -149, 18,232,243,158,130, 16,114,251,117, 51,208,172, 89, 51,111, 75,107,199,243, 83, 23,253,104,189, 51,146,143,252,212, 63, 76, - 96, 93, 34, 87,124,134,249,234,235, 19,191,244, 22,167, 63,134,250,222,121, 75, 65,110, 50,162, 50,117,216,115, 37,189,232,252, -239, 63, 93,102, 2,104,155, 14,131, 45,205, 58, 12,182,198,234,113,199,173, 51, 74, 30,226,122,204,225, 62, 75,102, 30,166,248, -155,102,119,175,104,174,156,157,157,123,185,186,186,206, 63,114,228,136,187,193, 96, 80, 92,188,120,177,104,239,222,189,207, 12, - 6,195,218,180,180,180, 35, 38, 71,199,148,218, 23,230, 42,200, 66,216,244,195,145, 31, 92,254,100,213, 15,146,135,145, 55,177, -124,235, 17, 40, 4,122, 99,100,106,201,128, 40,165,225,152, 73,199,149,207, 95,176,115,231, 78,121, 64, 64, 0,201,201,201,121, -113,195,215,233,116, 40, 44, 44, 68, 65, 65, 1,180, 90, 45,130,130,130,152,185,115,231,202,231,204,153,179, 0,192, 71, 53, 92, -140,153,243,231,207,183, 31, 61,122, 52,204,205,205,145,147,147, 3,189, 94,255, 34,218, 36, 22,139, 97,105,105,137,252,252,124, -156, 62,125, 26,149, 13,217,175,136, 80, 40, 76,115,113,113,118,147,202,228, 90,153, 76, 70,205,204,204, 94, 91,179,236,102,155, -222,189,123,119,199,249,243,231,139, 42, 54, 51,233,116, 58, 82, 87, 77, 74,169,170,115,231,206,178,181,107,215,194,221,221, 29, - 90,173, 22, 44,203,190,136, 96,149, 79, 13,144,152,152,136,197,139, 23,131, 82,106,250,131,140, 62, 79, 15,215, 15,236,160,203, -209, 67,151,163,135, 54, 91, 15, 93,166, 30, 6,213, 63,110,136, 72, 93, 58,160,155, 16, 9,179,127,221, 8, 86, 89, 52, 13, 66, -161, 16, 73, 73, 73, 56,115,230, 12,154, 53,107, 6,133, 66,129,226,226, 98, 92,189,122, 21,233,233,233,117,138, 96,117,232,208, - 97,203,201,147, 39,219,124,252,241,199,158, 99,199,142,149,250,251,251, 35, 62, 62, 30,171, 86,173, 42,121,244,232, 81,202,196, -137, 19,127,170,141, 30, 83, 54,117,141, 73,163, 8,153,255,189, 55,174, 98,154,134,238, 85,236, 94,113, 10,135,151,166,105,168, -200,129, 3, 7, 60, 93, 92, 92,252, 81,218,191, 10,248,243,104,193,138,220,186,117,235, 86, 40,184, 81,132,127, 55, 55,255,109, - 9,230, 87,125,209, 49,159, 54,127,123,182,249,150,107,124,228,165, 68,161,224,210,220, 87,205,149, 41,149,204, 75,111,219, 22, - 72, 20, 65, 6, 42, 4, 80, 2, 67,254, 51,136, 68,162, 90, 27,160, 87, 53, 89,150,157,210,226,237,217,214,219,110,242, 81,144, -250, 8, 89,231,231,212,218, 92,149,107,142, 33, 68,224,221, 50,180,135, 56, 35, 26, 37,231,119,129, 0,216,112,167, 24, 87,147, -181, 43,117, 90,237,162,135, 5,154,124,215,112, 98,181,107, 73,230,156,110,253, 26,125,226, 59,240, 52,174,103,125, 15,200, 0, - 43, 59,126,183,138,205,133,127,199,219,203, 93, 92, 92,188, 21, 10,197, 87,199,142, 29,179, 19,137, 68,230, 15, 31, 62, 52,238, -219,183, 47,201,104, 52,126, 93,177,227,123,109, 52, 27, 74,165,174,129,126,158, 23, 38,126,253,157,164, 72, 89,140, 98,173, 14, -206,245, 92,140, 23, 34, 31,191, 29,165,212, 30, 52, 69,211,193,193,161,253,123,239,189,215, 56, 36, 36,132,169,202, 92, 21, 22, - 22, 66,169, 84, 34, 57, 57, 25,109,218,180, 97,252,253,253,131, 28, 28, 28,218,103,100,100,156,171, 42,157,105,105,105,243,118, -237,218,213,106,247,238,221, 61, 71,141, 26,165,232,223,191, 63,164, 82, 41,138,139,139,225,230,230, 6,150,101,113,233,210, 37, -196,196,196, 20, 1, 56,156,150,150,246,123,117,233,140,139,123, 86,143, 16,194,184,186,186,182,234,218,181,235, 27,209, 4,128, -172,172, 44,175, 11, 23, 46, 76,239,211,167,207,164, 46, 93,186, 40,102,205,154, 37,244,244,244,132,209,104, 36,117,213,204,203, -203,179,184,125,251,246,138,214,173, 91,127,212,181,107, 87,254,146, 37, 75, 96, 97, 97, 1,163,209, 8,169, 84,138,194,194, 66, - 44, 88,176, 0,151, 47, 95, 54, 80, 74,191, 45, 40, 40,152, 90,157,230, 75,243, 96, 77, 92,217,164,186,114, 88,213, 60, 88,127, - 71,153, 87,171,213, 14,181,141,138,153,146,206,219,183,111,211, 87,231,195,170, 46,130,245,170,102,121,127, 48,145, 72, 4, 62, -159,143,172,172, 44,156, 60,121,242,165,249,175, 68, 34,209,139,105, 28, 42,139, 96, 85,149, 78,133, 66,193,190,243,206, 59, 35, -142, 29, 59, 54,108,202,148, 41,125,138,138,138,236,205,205,205,179,228,114,249,225,137, 19, 39,110,178,180,180,172,114,138,134, -202, 52,121, 12,169,114, 20,225, 75, 81, 83,158,168,164,178,238, 90,127,245,121,127,101,154,134, 87,167, 98,168,200,171, 83, 56, -188, 52, 77, 67, 69,205,190,125,251, 62, 71,233,228,161, 76,217,223, 87, 71, 11,150,227,115,235,214,173,208,208,208,208,139, 40, -237,159,243,210, 40,194,191,163,204,255,151, 53,255,107, 84,215, 7, 75,242,123,100, 12, 24,113, 38,138,174,127, 85,107,115, 85, - 25, 6, 77,113,236,194, 95,226,130,141, 90, 53, 12,133, 9,209, 93,123,116,207,124,221, 12, 80, 74,229,151,111,199,130, 47,201, - 65,254,181, 47,243,137, 81,211, 33, 50, 50,242,110, 93,180,214, 83,170, 31, 34,151,159,127,118,249,204, 91,206, 0, 18,114,181, -184,251, 36,247,228,126,149,106, 74,249, 62,201, 87,105, 30,128, 73, 78,109, 25, 63,107,159,130, 78, 22,206, 64,102,162, 30,121, - 89,134, 99,127, 87, 95,172,114, 82, 82, 82,158, 54,108,216,112,235,198,141, 27,199, 53,109,218,212,108,194,132, 9,229, 29,223, -119,215, 85, 51, 74,173, 78,110,168, 16,125,127,126,195,170,207, 36,254,205,176,111,201, 76,227,197,200, 39,125, 31, 20,105, 77, -110,179, 22,139,197, 17,227,198,141, 19,170, 84,170, 42,205, 85, 97, 97, 33,138,138,138, 80, 88, 88,136,187,119,239,162,127,255, -254,226,199,143, 31, 71, 0, 56, 87,205,185,103, 1, 92,242,242,242,186,241,253,247,223,119,220,182,109, 91,167,145, 35, 71,138, - 34, 34, 34,240,240,225, 67,220,184,113, 67,171,211,233, 78, 73, 36,146,211,177,177,177, 90, 19,203,211, 95,161,105, 0,176,216, -214,214,118,237,222,189,123, 23,157, 61,123,118,232,176, 97,195,228, 6,131,129,188,166,230, 36, 59, 59,187,207,143, 30, 61,186, -229,228,201,147,125,135, 14, 29,202, 76,156, 56, 17,235,214,173,195,190,125,251, 88,163,209,120, 80, 32, 16,124,144,149,149, 85, -227, 0,148,151,230,193,170,102,158,171,154,182,255, 77, 79,161,175,173,249,106, 36,172,105,211,166, 14, 21, 71,105, 86,252, 91, - 27, 26, 55,110,252,210, 60, 87,229, 29,218,203, 23, 30,143, 7, 62,159, 95,171, 38,194,134, 13, 27, 66, 32, 16,176,193,193,193, -155, 0,108, 2, 94,126,101,142, 64, 32,120, 49,169,169, 41,104, 12, 44, 54,108,220,122,195,192, 82, 24, 89, 10,202, 2,122, 10, -176, 70, 22, 70,150,194,200,178,165,211,162, 81, 64, 93, 98,252,159,215,107, 21,166,105, 88, 89,201, 84, 12, 21, 31, 48, 95,157, -194, 1,168,162, 31, 85, 89,247,131,242,254,168,149,141, 22, 44,215,220, 90,182, 94,154,146,146,242,126,117,154, 28, 28,181, 49, - 88,179,148,145,107,244, 0,108, 8, 33, 51, 35, 35, 35, 31,190,238,143,241,120,204,204,204, 67,195,215, 82, 32,143, 71, 48,243, - 77,100,192,104, 52,206, 46,190,189,150,165,148, 90, 18, 66,102,220,186,117,235,181,210, 73, 13,134,241, 95,253,116,105,165,157, -133,168, 83,118,190,230, 40, 8,169,116,214,118, 3,232,199,219,191, 76,252,210,202,142,223, 45, 47,203,112,140,101, 48,253,159, -112, 66,163,162,162,150,120,123,123,243,126,248,225,135, 17, 90,173,246,165,142,239,117,214, 44,210, 78, 11, 82, 8,121,126,158, -174, 19,158,196, 39,246,121, 80,100, 90,179, 96, 5, 68, 46, 46, 46, 81, 42,149, 10,132, 16,104, 52,154,151, 12, 85, 69,131,165, -211,233,144,153,153, 9, 79, 79, 79, 84,152, 51,169, 90,202, 76,201, 17, 91, 91,219,139,107,214,172,233,177,110,221,186,150, 44, -203, 94,209,233,116, 71,178,179,179,149,117,201,243, 95,161, 89,246,189, 79,100, 50,217,178,117,235,214,173,144, 72, 36,161,153, -153,153, 23, 94, 71,179,204, 60,189,109, 99, 99,227,188,117,235,214, 61, 27, 55,110,108,193,231,243,175, 17, 66, 6,228,231,231, -215,229,101,207,209,175,185,189, 38,246,253, 5,197,254,181, 53, 77,121,253, 77,173, 30, 38, 13, 6,229,204,153, 51, 51, 95,125, -231, 96,197, 57,175, 42,254,213,106,181, 37, 38,104,178, 95,124,241, 69,181, 15,113, 21,141, 86, 73, 73, 73,141, 77,186,148,165, -217,221,223, 29, 95,187, 58,146,165,217,127, 99, 21,119, 8,192,211,178,133, 86,179,173, 86, 89, 2,112, 22, 64, 60,165, 52,254, - 21,221,138,235, 57, 56,222,140,193,138,140,140, 76, 2, 48,252, 77,254, 88,215,174, 93,207, 0,240,127,147,154,119,239,222, 77, - 0, 48,244, 77,233,237,208,104, 98, 1,244, 28, 67,136, 96, 59,173, 58, 34, 85,214,161,189,223,223, 57,138,176, 42, 42,235,248, -254,186, 84,214,241,189, 22, 55,155, 19, 98,177,152, 20, 22, 22, 66,167,211,161,168,168,232,133,185,170,104,178, 12, 6, 3, 8, - 33, 40, 42, 42,130,153,153, 25,244,122,125,173,158, 20,203, 76,202,174,136,136,136,189,231,207,159, 55,188,137,124,255, 21,154, - 42,149, 42, 29,192,123, 17, 17, 17,252, 55,165,153,147,147,147, 10,160,165,151,151,151,200,212, 40, 88,117,145,172,186,110, 55, -129, 31,254,130, 34,255,243, 63,173, 98,141,143,143, 15,120,211,154,137,137,137,143,222,120, 58,175,109,155,252, 47,185, 87,209, - 50, 51,186, 53, 49, 49,177, 30, 33, 36,241, 85,131, 85,221,182,234, 52, 1, 64, 36, 18, 29, 72, 74, 74,114, 22,139,197,169,166, -172,231,224, 48, 5, 82,151,176,183,201,226, 92,251, 52,167,201,105,114,154,156, 38,167,201,105,114,154,117,255,157,209, 21,231, -193,250, 55,241, 31,154, 54,142,131,131,131,131,131,131,131,227,159, 1, 1, 16, 84,217,134,218, 56, 83, 66, 72, 80,109,127,184, - 38,125, 78,147,211,228, 52, 57, 77, 78,147,211,228, 52,255,123,154, 53,105,191, 50, 34,247, 95, 27,193,226,154, 8, 57, 77, 78, -147,211,228, 52, 57, 77, 78,147,211,252,219, 53,171,248, 29,174,137,144,131,131,131,131,131,131,131,131,163, 20, 62,119, 8, 56, - 76,193,213,213,117,105,243,230,205,199,223,188,121,243,235,196,196,196, 5,117,212,112,182,177,177, 89, 12,160, 37,165, 84,204, -227,241, 30,101,103,103, 47, 73, 74, 74,186, 84,215,116, 57, 59, 59,187,217,217,217, 45, 6,208,130,101, 89,161, 64, 32,136,202, -200,200, 88,148,146,146,114,173,174,154,118,118,118,114, 39, 39,167, 80, 74,169, 61,165,148, 17, 8, 4,121, 41, 41, 41,119, 51, - 51, 51, 51,185,146,192,193,193,193,193,241,218, 6,107,254, 4,226, 4, 29,248,115,215,211, 36, 0, 32,132,152,163,116,210, 53, -127, 0,143, 1,220,162,148,190,214, 43, 3,254, 45,154,255,116, 8, 33,140,165,165,101,103,153, 76,246,137, 82,169, 12, 54, 55, - 55,143, 42,123, 61,206,225,178,201, 51,235,140,189,189,189,253,187,239,190, 59, 99,205,154, 53, 24, 49, 98,196,231,182,182,182, -171,106, 59,111, 83, 64, 64, 64,111, 23, 23,151,245, 11, 23, 46,178,107,214,172, 25,145, 72, 36,136,141,141,117,153, 61,123, 86, -211,166, 77,155,238,185,125,251,246, 71,181, 77, 87,195,134, 13, 7,184,187,187,175, 93,178,100,137, 93,104,104, 40,225,243,249, -184,127,255,190,235,252,249,243,155, 5, 7, 7,111,189,115,231,206,148,218,106, 6, 5, 5,121,122,121,121,181, 92,180,104,145, -164, 89,179,102, 16,139,197,120,244,232,145,124,214,172, 89,118, 77,155, 54,125,122,251,246,237,235,181,209, 11, 25,115, 91, 32, -148,233,248, 0,160, 83, 9, 13,145,235,155,234, 77, 93,199, 85, 79, 28, 28, 28, 28,255, 65,131,181, 96, 28, 89,192, 0,179,192, -128, 76, 26, 76,118,175,219,205,220,232,216,177,163,223,200,145, 35, 73,217,171, 35, 2,118,237,218,245, 54,143,199,123,194,178, -236,117, 0,119, 41,165, 58, 19,205,128, 16, 64, 19,134, 97,154,255,147, 53,255, 13, 40, 20, 10,111, 59, 59,187, 41, 54, 54, 54, -221, 66, 67, 67, 11,199,142, 29, 27,127,237,218,181,184,176,176,176,146,141, 27, 55, 46,209,235,245,223,249,248,248,156, 42, 42, - 42, 90, 81,215,121,177, 4, 2,129, 63, 33, 4, 41, 41, 41, 16, 8, 4, 2,145, 72, 20, 0,192,100,163,225,230,230,230,228,236, -236,252,195,238, 3, 39,236, 11, 53, 12,158,102,177, 0, 84, 48, 50,182, 88,184,124,157,205,138,197,159, 15,246,241,241,185, 28, - 19, 19,243,139,169,154,206,206,206,110,238,238,238,107,207,158, 61,107, 47, 22,139,193,178, 44,138,138,138, 96,111,111,143,165, - 75,151, 90, 47, 92,184,112,164,167,167,231,197,231,207,159, 31, 50, 85,211,206,206, 78,238,229,229,213,242,220,185,115, 18,145, - 72, 68,244,122, 61,209,104, 52,112,116,116,164, 43, 87,174, 20,207,158, 61,219,215,211,211, 51,253,249,243,231,137, 38,153,171, - 31,111, 11, 10,179,207,133,211, 36,245,231, 0, 64, 36,210, 69, 17,243,173,111, 20,102,159,107, 86,211,186,144, 31,113, 53,114, - 52,103,178, 56,254,183, 56, 59, 59,183,242,244,244, 60,144,152,152,120,133,199,227, 13,140,143,143,215,188,174, 38, 33,196, 21, -128, 39, 0, 43,148, 14,172,202, 69,233,228,157, 73,117,213,180,245,106,223, 11, 98,217,112, 80,218,132, 1, 0,134,185,203,234, -138, 55,103, 71,159, 59,244, 90,154, 18,249, 8,176,108, 19, 6,148, 5,195,187, 71, 13,197, 63,101, 61, 62,119,140, 43, 25, 28, -111,204, 96,205,255,144, 88, 49, 2, 76,159, 57,118, 52,195,231,241,200,146,245, 63, 14,186,121,229, 16,117,170,215,228,197, 43, - 55,218,180,105,131, 54,109,218,144,229,203,151,251,159, 61,123,214,127,199,142, 29,122, 66, 72, 36,165,116, 75, 85, 63,182,116, -162, 44,209,160, 87,187, 45, 24, 47, 45,241,104,241,221,142,150, 45,219,176, 98,177, 24,175,163, 9, 0, 31, 13, 16,156, 26, 49, -192,147, 68,244,156,147,240,166, 52,255, 37,230,234,130, 66,161,240, 26, 51,102,204,211,113,227,198, 93,148,203,229, 20, 0, 50, - 51, 51,229, 61,122,244,200,235,219,183,111,142, 74,165,194,247,223,127,239,182,118,237,218, 83,230,230,230, 41,133,133,133,205, -106, 81, 49,242,157,156,156,150,117,234,212,105,242,123,239,189, 7,133, 66,129, 97,195,134, 65,163,209, 92,113,118,118, 94,158, -150,150,246, 57,165,180,198,119,103, 88, 89, 89,205,157, 63,127,190,189, 82,203,195,231,219, 98,145,171, 44,245, 13, 50, 17,131, -143,222, 18,227,253,247, 63,176,184,115,231,206,114, 0, 38, 27, 44, 59, 59,187,197, 75,150, 44,177, 43, 63,215, 74,165, 18, 74, -165, 18, 69, 69, 69, 80, 42,149,120,239,189,247,204,159, 62,125,186, 26,165,179, 59,155,132,147,147, 83,232,162, 69,139, 36, 34, -145, 8,135, 14, 29,106, 92, 82, 82,194,215,235,245,160,148, 26,252,252,252,238,126,240,193, 7,194,152,152,152,112, 0, 38, 25, - 44,167,116, 8, 10,212,234,111,191,249,242, 51, 59, 0,248,120,250, 87,223, 2,234,230,212,132,117, 78,233, 8, 3,192, 25,172, -234,203, 39, 15, 64, 63,129, 64,208,223,203,203, 43,244,233,211,167,119, 12, 6,195,175, 0,126,165,244,245, 38,255, 37,132,188, -229,236,236,188, 56, 53, 53,245, 27, 74,233,246,255, 47,199,180, 65,131, 6,251,119,236,216, 97,115,244,232,209,222, 11, 23, 46, -124, 23,192,214,215, 56,134, 2, 0,225,101,166,234,113,153,177, 66,153,209,242, 35,132, 52, 0,240,123,109, 30,120,109,125, 91, -153,129,111,190, 43,188, 67,215,214, 3,222,238,171,176,179,182, 64,177,198,136,152,248,244,122, 39,143,238,111,231, 24,212,227, -138, 65, 87, 48, 40, 59,250,119,101,109, 53,219,119,235,221,186,195, 91, 29, 21, 22, 22,150,200, 41,210,227, 89,124,178,251,133, - 83, 7,219, 56, 4,245,184, 8,162, 31,154,113,255,164,138,187,234, 56,106, 3, 99,226,133, 2,185,153,188,210,109, 22, 22, 22, -136,136,136,192,146, 37, 75, 4, 0, 90, 84,220,246,234, 8, 3,163, 81,235,244,249, 71, 19, 32,226, 83,113,143,110, 93,136,185, -185,249,107,107, 2,128,131,181,161, 99,115, 95,117,187,140,187, 19,135,220,189,176, 56, 72, 91,146,255,167, 55,157,202,100, 50, -120,123,123, 99,246,236,217, 38,105,190, 46,255, 11, 77, 74,169,115, 64, 64, 64,209,170, 85,171,124,231,204,153, 99, 85, 82, 82, - 34, 7,224, 26, 16,220,202,153, 97, 24, 55,173, 86,171,152, 55,111,158,237,151, 95,126,233,107,103,103,151, 79, 41,181,171, 77, - 58,157,156,156, 86, 45, 89,178,100,202,230,205,155, 73, 88, 88, 24, 20, 10, 5,194,195,195,177,109,219, 54,102,238,220,185, 51, -156,156,156,150,153,152,247, 54,205,154, 53, 35, 44,128, 60,165, 1,231,150,134,224,247,175,194,160,210,178, 40, 40, 82, 66,173, - 86, 67, 34,145, 72,109,109,109,205,106,113, 60, 91,132,134,134, 18, 0, 47, 76, 85, 81, 81,233,162, 84, 22, 67,171,213,129, 97, - 24,115, 15, 15, 15,113, 45,142,167,125,179,102,165,254,179,164,164,132,223,187,119,111,244,236,217, 19, 69, 69, 69,252,194,194, - 66,104,181, 90, 48, 12, 35, 44,187,177,215,168,169,149, 9, 8, 75, 89, 7,185, 76,106, 43,151, 73,109, 89,202, 58, 0,128, 41, -235,180, 50, 1,249, 59,203, 39, 33,196,142,199,227,109,242,242,242,122,196,227,241,182, 18, 66, 28, 95, 71,147, 16, 18, 70, 8, - 89, 34,147,201, 78, 7, 4, 4, 36,201,229,242,179,132,144,101,132,144,240,186,104, 18, 66, 68, 50,153,236,236,146, 37, 75,246, -220,185,115,231,221, 51,103,206,120,222,191,127,255,237,229,203,151,239, 50, 51, 51,187, 72, 8,145,190,206,181,233,233,233,185, -241,250,245,235, 97, 45, 91,182,220, 64, 8, 17,191,137,235,157, 16,194, 35,132, 4, 19, 19, 95, 60,248,191, 62,239,174,174,174, - 94,193,193,193,182, 60, 30, 15,109,218,180, 1,165,180,205,107,106,182, 4,144, 78, 41,189, 64, 41,205,162,148, 26,203,150,108, - 74,233,165,178, 7,149, 54,181,210,228,155,239,250,228,211,105, 93,167, 78,248, 80,113, 59,193,136,159, 78,166, 97,247,229, 44, -164, 20,137,209,169,207, 8,139,118,221,223,235,194, 23, 90,236,170,173,230,140, 25,179,186,126, 56,108,136,226, 65, 42,131, 61, -191,103,227,242,227, 66,168,136, 21, 34,250,140,182, 10,104,214,173, 7,129,112,203, 63,225, 28,253,215, 53,255, 95, 68,176,230, -110,160,121, 11,198,145, 47,151,124,255,227,231, 12, 33,212,213,167,203, 67, 79,239, 22,197, 44,203, 66,173, 86, 67,167,211, 65, - 32, 16, 64,173, 86, 35, 33, 33, 1,215,175, 95,135,133,133, 69,173,126, 56,191,160, 0, 46,174,158,144,201,100,111, 68,115,212, - 59,125,249,137,105,105,252, 43,183,207,133,252,178,102, 71,136, 91,131, 78,143,155, 68, 76,123, 96,102, 81, 79,125,247,238, 93, - 92,189,122, 21,121,121,121, 40,191,129,254, 71,158,224,245, 43, 86,172,184,157,154,154,138, 75,151, 46, 5,207, 95,253,179,199, -131,194, 6,252, 44, 37, 21,216,153,101,184,251, 75,163,141,121,185,185,113, 83,166, 76, 57,235,228,228,164,157, 48, 97, 66, 59, - 83,116, 93, 93, 93, 37,132,144,144,238,221,187,127,244,193, 7, 31, 32, 62, 62, 30, 83,167, 78,213,222,189,123, 55, 63, 36, 36, -196,106,197,138, 21,194,209,163, 71,227,202,149, 43, 83, 92, 93, 93,247, 2,136, 74, 78, 78,174,238, 93,106, 34,137, 68, 2, 20, -148, 62,168,234, 12, 20, 0,251, 34,242,196,208,124, 8,133, 66,134, 97, 24, 59, 0, 38, 61,121,178, 44, 43, 20,137, 68, 40, 46, - 46,134, 82,169, 68, 74,150, 18, 9, 25,197, 40, 42,214, 64,173,214, 67, 83, 66, 33, 86, 56, 48,250,172, 44, 27, 0, 41, 38, 86, - 24, 76,121,115,163, 86,171,133, 90,173,134, 86,171,133, 86,171,125,241, 58, 31, 30,143,167,112,113,113, 49, 7,144, 87,147, 30, - 79, 36, 53,240, 24,225,146, 89,139,190,157, 7, 0, 60, 70,184,196, 12, 37,172, 41,235,120, 34,169,225,111, 44, 87, 98, 59, 59, -187,115,123,246,236, 9,240,246,246,198,243,231,207,253, 7, 12, 24,208,156, 16, 18, 76, 41, 85,213, 82, 75,198, 48,204,151,195, -135, 15, 31, 63,120,240, 96,226,227,227, 3, 62,159, 15,131,193,224, 26, 27, 27,219,126,247,238,221,211,249,124,254, 79, 70,163, -113, 10,165, 84,105,162, 38, 35, 18,137,126, 89,191,126,125,219,230,205,155, 99,235,214,173,184,113,227, 6, 27, 22, 22,198,188, -255,254,251,112,119,119,111,241,254,251,239,239, 35,132,244, 52, 37,194, 90,137,190,251,144, 33, 67,220,120, 60, 30, 90,182,108, - 41,188,114,229, 74, 83, 0, 87, 94,243,152,154,185,186,186, 94,136,136,136, 8, 62,125,250,244,109, 66, 72,132,169,249, 5, 0, -103,103,231, 62, 14, 14, 14,203, 21, 10,133,149,169,223, 81, 42,149,170,140,140,140,169, 41, 41, 41,123, 77, 44,255, 45, 27, 53, -106, 4,131,193, 0, 11, 11, 11, 56, 58, 58,182,118,113,113,153, 98, 97, 97,209,175,176,176,112,114,114,114,242,141, 90,228,215, - 5, 0, 67, 41,125, 90,246,217, 3, 64,249,107,150,162, 41,165,207, 41,165,113,132, 16,103, 66,136,155, 41,205,133,182, 94,237, -123,181,236,216,189,117,155,230, 65,204,210,189,241, 48,178, 44,248, 48,130,207, 99,145,109, 20,128, 16, 2,119,223, 48,158,195, -131, 91, 45,108,125, 59,245,202,142, 62,117,200, 20,205,174,189,251,182,241,243,245, 97,190, 62,144,136,252,148, 7,198,140,199, -103,179, 9,195,160,126,147, 78,182,238,190,193, 60,175,224,183, 4, 25,241, 15,218, 91,123,183,235,152,251,244,194,105,206, 54, -112,212,218, 96, 17, 66, 40,165,244,197,147,213,156,239,233, 28, 91, 43,226,241,240,193, 61, 38, 41, 93, 91,124,239,222, 61,216, -216,216,192,222,222, 30,230,230,230,120,242,228, 9, 78,159, 62,141,232,232,104, 80, 74, 17, 28, 28, 92,171, 31,206, 72, 79, 71, - 78,110,209, 27,213,172,231,228,132,122, 78, 78,252,236,188,124, 92,189,119, 63,224,208, 79, 29,253, 50,152, 49,155,213,106,245, -139,125,244,250,255, 94,171,139,189,189,189,241,227,143, 39,228,140,250, 54,174,193,160, 14, 46,188, 62,225,142, 56,112, 37,141, -183,235, 60,143,126, 62,178,113,118,108,108,140,201,153,118,119,119, 95,220,190,125,251,207,248,124,190, 96,244,232,209, 0,128, -137, 19, 39,106,238,223,191, 31,152,148,148, 20,231,228,228,228, 55,121,242,228,251,251,246,237, 19,124,248,225,135,164,164,164, -228,134, 64, 32,160,206,206,206, 11, 82, 83, 83,231, 85,106, 52,120,188, 59, 15, 31, 62,244, 48, 72,156, 97,171, 96,208,229,243, -219, 0, 0, 51, 49, 69,118, 70, 10,162, 98,111,194,206,206,206,194,214,214,246,113,171, 86,173, 52, 25, 25, 25,159, 60,123,246, -108, 75,117,233, 20, 8, 4, 81,247,239,223,119,117,112,112,128, 82,169, 68, 82,102, 49, 54, 93, 37, 80,105,164, 0,164,224, 65, - 1,133,173,155,162, 62, 85,221, 13, 10, 10,210,105,181,218, 25, 49, 49, 49,219,107,208,204,123,244,232,145,220,197,197, 5, 60, - 30, 79,183,123,247,110,161, 86,171, 5,165,212,112,244,232,209,129,249,249,249, 45, 27, 52,104,192,184,187,187,175,104,213,170, -149, 58, 45, 45,109,212,243,231,207,171,124,209,240,241,137, 94,186,118,243,206,127,151,255, 60,105, 55, 0,184, 52, 15,200, 61, - 60,175,169,182,221, 60,101,141,235,142, 79,244,210, 97,194,223,246,234,179,225,179,102,205, 10,176,182,182,198,216,177, 99, 49, -127,254,124,204,153, 51,199,123,236,216,177,163, 1,172,170,197, 77, 86,234,232,232,120,115,205,154, 53,254,173, 90,181,194,209, -163, 71,177,115,231, 78,196,197,197, 25, 60, 61, 61,249,205,155, 55,199,220,185,115,209,165, 75,151, 81, 19, 38, 76,104, 71, 8, -105,106,162,233, 24, 49,119,238,220, 62,173, 91,183,198,176, 97,195, 52,231,207,159,127, 23,192,201, 83,167, 78,117,184,112,225, -194,222,159,127,254, 89,186,100,201,146,174,147, 39, 79, 30, 7,224,155, 58,228,191,111,219,182,109, 1, 0,173, 91,183,198,242, -229,203,187,188,142,193, 34,132,136,108,108,108,142,108,221,186, 53,216,215,215, 23, 67,135, 14,109,250,238,187,239, 30, 33,132, -116,162,148,154,244,222, 72, 39, 39,167, 47,215,175, 95,239, 37,149, 74, 77,254, 93,173, 86,107, 61,102,204,152,101, 0, 76, 54, - 88, 65, 65, 65, 56,127,254, 60, 58,118,236,136,134, 13, 27,122,141, 25, 51,102, 69,151, 46, 93,240,233,167,159, 94,118,116,116, -116, 78, 79, 79, 55,245, 69,207,238, 0,158,148,229,191, 30, 0,111, 0,191,151,109,107, 78, 8, 1,165,244, 57, 74, 95, 30,238, - 7,160,230,254, 88, 18,249,240,222, 61,123, 42,126,189,146, 9, 35,203,194,223, 69,130,128,122,230,136,207, 44, 65,124, 74, 14, - 4, 68, 7,133, 84,140, 70, 45,123, 88,229,102,196, 15,135, 41,221, 3,196,178,225,125,123,247, 52,219,127, 53, 19,249, 41, 81, - 52,225,230,238,179,250,146,226, 81, 0,240,240,226,246, 31, 28,172, 36,157,124,154,132,240, 84,109,250, 88, 93, 56,240,253,112, - 0,156,193,250,235, 31,240, 94,242, 34,255,185, 8, 86, 57, 57,249, 80,219, 56, 6, 32, 41,253, 78,233,231,156, 28,228,228,228, -160,126,253,250, 88,187,118,237, 75,251,150,148,148,212, 41, 1,127,133,166,173,149, 37,122,183,111,199,123,240,228,123,158,154, - 85,191, 17,205,127, 42,148, 82, 74, 8, 33, 9,217,122,203,236, 66,189,112, 96,123, 55, 42,224, 49, 24,212,190, 30,249,230, 80, -130, 48, 91, 45,179,228,241,120,140, 41, 79,242, 33, 33, 33,130,246,237,219,127,182,113,227, 70, 65, 90, 90, 26, 44, 45, 45,161, -215,235,113,231,206,157,212,212,212,212, 56, 0, 72, 75, 75,123,226,234,234,154, 97, 52, 26, 93,253,253,253, 49,102,204, 24,248, -249,249,145, 41, 83,166, 76, 39,132, 44,168,108,196, 98, 70, 70,198,146,217,179,103,183, 93,188,124,173,205,144,230, 4,197, 42, - 45,148, 74, 37,226, 99,162, 64,149, 90,124,253,245, 74, 72,165, 82, 2, 64,152,149,149, 37,156, 55,111,238,134,208,208,208,158, -183,110,221,234, 95,165, 65,207,200, 88, 52,119,238,220,102, 95,127,253,181,181, 82,169,132,186,164, 4, 69,106, 17,174,175, 44, -141, 80, 54,159,124, 3,223,124,181,130, 9,114,151,219, 40,149, 74,124,246,217,103,107,130,131,131, 91,220,185,115,103,124, 85, -154, 41, 41, 41,119,103,205,154,101,183,110,221, 58,177,159,159,223,253,194,194, 66,228,229,229, 49,251,246,237, 91,232,238,238, -110,189,102,205, 90, 34,147,201, 0, 0, 73, 73, 73,194,207, 63,159,253, 75,163, 70,141,126,190,127,255,254,176,170,206, 13, 0, - 13, 33, 72,115,118,174,239,165,186,202,204,115,118, 46,185,124,126,110,202, 54, 66,144, 86,186, 15,168,211,122,167, 33,137, 91, -197,173, 53, 26,118,117,122,122, 66, 52,165,160,152,251,247,189, 87,214,214,214,118, 66,159, 62,125,176,108,217, 50, 28, 58,116, -104,178,181,181,245,202,249,243,231,195,217,217,249, 99, 66,200,106,106,250,236,196, 95,173, 90,181,202,223,223,223, 31, 31,124, -240,129,246,244,233,211,179, 0, 28, 0,144,112,233,210,165,122, 91,182,108,233,245,203, 47,191, 44, 91,179,102,141,100,221,186, -117, 94,111,191,253,246,106, 0, 35,107, 18,117,112,112,248,116,240,224,193, 88,177, 98, 5,206,159, 63,255, 54,165,244,104,217, -166, 99,132,144, 94, 75,150, 44, 57,243,249,231,159, 99,213,170, 85,147,106,107,176, 8, 33,102, 1, 1, 1, 95,116,237,218, 21, -151, 46, 93, 66,155, 54,109, 16, 30, 30, 62,153, 16,178,150, 82,154, 93,135,155, 5, 99,102,102,246,203,230,205,155,219,120,120, -120, 96,209,162, 69,248,236,179,207,176,113,227,198, 54, 67,135, 14,253,133, 16,210,223,148, 81,190,102,102,102,102, 82,169, 20, -203,150, 45,163,137,137,137, 53, 70, 79,157,156,156,172,190,248,226, 11, 98, 97, 66, 51, 0, 33,132,231,236,236,108,225,232,232, -216,214,209,209, 17,107,214,172,129,189,189, 61, 38, 79,158, 12, 27, 27, 27, 20, 23, 23,163,127,255,254,130,107,215,174, 13, 2, -176,214,196,172,219, 0, 40,143,120, 5,160,180,175, 85, 81,217,239, 93, 3,208, 26,192,115,148,246,203,178, 54, 69,144,161, 52, -200,202,210, 28,169,247, 51,192,135, 1,254,245, 20,184, 21, 91, 12,157,145, 66, 38, 55, 67,113, 81, 62,154,120,217,161, 80,229, - 10,128, 53,105,246,113, 33,143, 9, 17,137,165,200, 44, 44, 64,250,163, 51, 57, 58,163,102, 76,126,220,229, 36, 0,176,110,208, -118, 76,212,245,227,183,250,119,107, 99,159,149, 87, 15,148,178,205,192,193, 81, 11,106,236,131,197,178,127,190,246, 43, 70,132, -202,209,233, 94,111, 96,222, 95,161, 89, 25,127,133,230, 63,193,103,185, 88,241, 11,228, 18,198,112,234, 86,166, 81,111, 48,226, -196,173,116,163, 76, 76, 12, 86, 98,109, 33,203,178, 38,221, 16, 35, 35, 35,245,151, 46, 93,218, 58,115,230, 76,172, 90,181, 10, -207,158, 61,131, 64, 32,128,175,175,175,131,155,155,155, 19, 80, 58,122,175, 97,195,134,182, 60, 30, 15,177,177,177,216,185,115, - 39,230,205,155, 71, 35, 35, 35, 55, 86,117,163, 72, 77, 77,189,147,145,145,177,126,233,130, 89,249, 2, 77, 42,100,198, 44, 24, -243,159, 65, 96, 44,192,132,201, 51,241, 60,219,136, 59,207,139,112,231,121, 17,210,213, 18,124,177,232,107,158,183,183,119, 47, - 87, 87,215, 46,213,152,161,107,105,105,105,219,230,204,153, 83,144,157,157,253,162,252,232, 12, 44,116, 6,246,213,155, 19,150, - 46, 93,106,233,228,228, 52,208,197,197, 37,162, 42,205,204,204,204,204,212,212,212,216,153, 51,103,234,178,178,178, 80, 88, 88, -136,227,199,143,191, 93,191,126,125,235, 41, 51, 23,144,231,217,244, 69, 58, 11, 88, 75,172, 88,251, 19,175, 65,131, 6,239, 57, - 59, 59, 87,219,143,200,217,217,197, 43, 32,160,193,158,107,215,174, 13,243,242,242, 26, 95,110,172, 40, 5, 5, 0, 79, 79,207, -177,145,145,145, 35,130,131, 3,247, 56, 56, 56,250,253,205, 79,143,237, 7, 14, 28,232,199,178, 44,246,236,217,115,159, 82,186, -106,255,254,253, 55, 53, 26, 13, 6, 13, 26,228, 9,160,171,137, 58, 97,239,189,247,222,248, 54,109,218, 96,210,164, 73,186,211, -167, 79,135, 80, 74, 87, 82, 74,227,105, 41, 9,148,210,181, 23, 46, 92,104, 50, 97,194, 4, 77,179,102,205, 48,108,216,176, 17, -132,144, 54, 53,232,182, 28, 60,120,176, 63,203,178,216,181,107,215,189, 10,230,170,220,212,158,221,187,119,239, 53,173, 86,139, - 33, 67,134,212, 39,132,116,168, 69,222,133, 98,177,120,207,194,133, 11, 45, 83, 82, 82,240,254,251,239,107,158, 60,121,130,121, -243,230, 73, 45, 44, 44,142, 18, 66,204,106,123, 60,197, 98,241,143,223,127,255,125,159, 70,141, 26, 97,220,184,113,218,239,190, -251,110,226,248,241,227,181, 33, 33, 33,248,246,219,111,251,136, 68,162, 90,205, 80,157,145,145,145,127,254,252,121,155,154,150, -244,244,244, 12,147,162,254,245,234, 89, 54,108,216,240,126, 88, 88, 88,118,227,198,141, 27, 0, 64, 84, 84, 84,214,158, 61,123, -168,141,141, 13,142, 31, 63,142, 31,127,252, 17,173, 90,181,130, 66,161, 24, 84,155, 58,169,108, 65,133,191,175,110,127,117,191, -154, 78, 16, 45, 80, 25,192,103, 24, 8,120, 20, 9, 25, 37,208, 25, 41,132, 2, 6, 2, 30,192,103, 40,108, 20, 2, 8, 4, 60, - 0,196, 36, 77,134, 16,228, 21,235,193,231, 17, 8, 68, 66,194, 24,140, 47, 66,132, 12,223, 40, 21, 75,196,196,222, 66, 8, 33, -159,128, 16,112,112,188,185, 8, 22, 0, 24,141,127, 14,124, 84, 22, 5,210,106,181,175,149,144,191, 66,179,138,176,249,127,234, - 4, 22, 22, 22,242, 47, 92,184, 96, 33, 16, 8,228, 61, 27,181,202,249,114,119,140,237,252, 29,209, 16,241, 64,122, 53,102,210, -206,159, 59, 77,242,242,242,172,188,189,189,243, 76,209,123,246,236,217, 40, 39, 39,167, 69, 12,195, 52, 51, 26,141,187, 87,173, - 90,133,111,190,249, 70, 54,118,236,216, 39,206,206,206, 41, 62, 62, 62,110,171, 87,175, 22, 3,192,182,109,219,112,226,196,137, -190, 2,129,224, 70, 66, 66, 66,122,117,186,119,239,222,253,220,221,221,253, 74, 92, 92,220, 90, 66,136,165, 66,161,176,218,191, -127, 63, 73,203,215,226,243,109,207, 94,140, 44,148,139,121,152,217,207, 14,239,188, 51,128,255,244,233,211,175, 0,156,168, 74, -243,246,237,219,147, 61, 61, 61, 47,196,196,196,172, 18,218,248,218, 72,130, 70, 43, 58,204, 44,109,126,116,178, 22,131, 41,171, - 16, 11, 10, 10,144,157,157,141, 17, 35, 70, 88, 46, 94,188,120, 58,128,243, 85,105,222,185,115,231,154,167,167,103, 90, 76, 76, - 76, 11, 74,169,200,194,194,162,213,170, 85,171, 72, 66,174, 22, 51,182,196,162,168,164, 52,157, 10,137, 0, 11, 6,187, 98,216, -176, 97,252,231,207,159,127, 89,246, 68,254, 39, 92, 92, 92,188, 3, 2, 2,246,236,216,177, 35, 96,245,234,213,185, 79,159, 62, - 45,118,118,118,158,255,202,110,154,165, 75,151,230,108,219,182,205,247,253,247,223,223,227,232,232,248,110, 93,167,212,120, 93, -204,205,205,151,141, 25, 51, 6,191,252,242, 11,242,242,242, 86,151,149,177, 85, 59,118,236,216, 53,106,212, 40,108,219,182,109, - 25, 33,228,184, 9, 81,172,110,131, 6, 13,194,177, 99,199,112,230,204,153, 47, 40,165, 15,171,136,242,197, 16, 66,166, 31, 60, -120,112,205,224,193,131,177,105,211,166,174, 0,170,155,120,182, 83,151, 46, 93,112,244,232, 81,228,228,228,124, 91,217, 14,249, -249,249,223,253,246,219,111, 45,186,116,233,130,165, 75,151,118, 2,112,214, 4,115,229,111, 97, 97,177,121,205,154, 53, 97,141, - 26, 53,194,123,239,189, 87,162,211,233,186,126,246,217,103,135,118,238,220,169,216,186,117,107,232,232,209,163,175, 19, 66, 62, -164,148,154, 52,137, 45,143,199, 91,178,110,221,186,145, 17, 17, 17,152, 60,121,178,225,196,137, 19,189, 41,165, 39, 9, 33,177, -211,166, 77, 59,242,245,215, 95,243, 86,172, 88, 49,146,199,227,101, 25,141,198, 89,127,147,161, 94,241,245,215, 95, 7, 4, 6, - 6,162,164,164, 4,207,158, 61, 67, 70, 70,198,142,227,199,143,159,124,240,224,193,242,244,244,244,125, 14, 14, 14,163, 38, 79, -158,236, 26, 22, 22, 22,230,234,234,106,149,156,156,108, 74, 93, 82, 30,153,202, 4,240, 8, 64,139,178,200, 21, 0, 52, 71,105, -211, 32, 80, 58,162, 48,207,196,196,222,143,121,158, 82,223,202,204, 28,121,172, 8,207, 83,178, 33,149,203,193, 80, 6, 6,117, - 30,188,221,237,193, 82,160, 48, 59, 5, 12, 67,238,155, 34,169, 55,178,145,241, 73, 25, 46,150,114, 9,188, 67,186,219,220, 59, -187,105,187, 69,131,214,163,249, 60,194, 19,138,205,215,191, 55,248, 3, 91,189,145, 66,153,151, 6,194, 99,110,128,131,227, 77, - 26, 44,150,101, 33,149, 74, 95,138, 48,189, 26, 5,146, 74,165,208,104,106, 55, 93,138, 84, 42,133,206,128, 55,170,105,202,111, -190,105,205,191, 19,189, 94,175, 24, 63,126,124,235, 22, 45, 90, 36,117,235,214, 45,214,223,223, 46,190, 71, 75,137,237,186,141, - 7,131,187,181,107,120,167, 48, 55, 35, 43, 65, 44, 46,201,203,203,179,217,182,109, 91, 83,189, 94, 47, 51, 69, 55, 45, 45, 45, - 17, 64,162,139,139, 75,143,246,237,219, 15,237,217,179, 39, 46, 94,188,168, 40, 46, 46,246,151,203, 75, 71,147,238,219,183, 15, -191,253,246,219, 79,169,169,169, 7, 77, 77,111, 66, 66,194,113, 0, 94,245,234,213,179,172, 87,175, 94,134,165,165,165, 48,165, -168,248,197,200, 66, 33,159, 65,171,207,110, 34,191,176, 8,150,150,150,144,201,100,158, 53,105,150,205,115,117,168,217,192,133, -141,120,113, 59, 46,172, 91,179,218,162,252,201,212,193, 82,136,252,252,124,100,103,103, 35, 43, 43, 11,148, 82, 24,141,198, 0, - 19, 52, 19, 1, 36,218,218,218, 58,121,123,123, 19, 51, 51, 51,208,220, 98,228, 41,117, 47, 53, 65, 22, 41,139,225,226,226, 2, -133, 66, 81,105,115,132,181,181,181, 66, 44, 22,111,217,176, 97,131,191, 66,161,224,141, 26, 53,202,114,212,168, 81,173,171, 50, - 99, 50,153,140,183,105,211, 38,159,224,224,224,205, 30, 30, 30,157,226,227,227, 11,254,135, 55, 90, 30,128,177, 83,167, 78, 13, -149, 72, 36,248,230,155,111,226, 0,252, 92,182,121,207,119,223,125, 55,103,240,224,193,126, 19, 39, 78,108,248,249,231,159, 79, - 46,107, 42,172,178,217, 89, 40, 20,134, 4, 4, 4, 96,255,254,253, 0,176,191,134,159,223,123,229,202,149, 53, 61,123,246,132, - 68, 34, 9,171, 97, 95, 79, 55, 55, 55, 28, 60,120, 16, 0,238, 84,229,147,159, 60,121,130,254,253,251,131, 16,226,105, 66,222, -251,116,238,220,121,239,210,165, 75,249, 10,133, 2, 35, 71,142,212, 94,191,126,189, 59,165,244, 34, 33,164,253,144, 33, 67, 46, -252,252,243,207,242, 11, 23, 46,248, 47, 94,188,248, 10,143,199, 91, 98, 52, 26, 63,175, 65,115,196,162, 69,139,102,246,237,219, - 23,243,231,207,167,187,119,239,126,143, 82,122,178,204, 84,158, 32,132,188,111,101,101,245,243,236,217,179, 73, 65, 65,193, 76, - 66, 72, 50,165,244,251,170,244, 84, 42, 85,129,209,104,116, 84,169, 84, 38, 61, 33,154,186,127,253,250,245,187, 5, 6, 6,226, -224,193,131,232,213,171, 23, 78,157, 58, 5,134, 97,142,164,164,164,156, 3,112, 18, 0,156,156,156, 44, 98, 99, 99, 39,183,105, -211,134, 57,125,250,116,127, 0, 63,153,144,132,231, 0, 26, 1, 56, 69, 41, 77, 42, 27, 56,217, 18,165, 83, 54, 60,162,148,150, - 79,117, 18, 4, 32,214,148, 60,177, 90,229,214, 51, 71,247,182,239,244,246,120, 11, 30,143, 1, 31, 66,168,138, 10, 1,163, 17, - 94,238, 14,104, 22,224,128,123,241,106, 92, 57,189, 39, 95,165, 84,153, 52,189,132, 81, 87,188,249,204,241,131,237,194, 58,127, - 96, 33,246, 10,132,155,195,164,224,168, 27, 39, 79,137, 69, 66,242,246,219, 3, 44,219, 55,243,198,153,251,133,184,118,230, 64, -158,170,168,112, 51,103, 25, 56,234,100,176,170,232, 84,150, 57,121,242,100,251, 41, 83,166,192,220,220, 28, 57, 57, 57,208,235, -245, 47,162, 77, 98,177, 24,150,150,150,200,201,201,193,174, 93,187, 80,246,180, 82,205, 19,157, 40,109,209,183,235,220, 8, 79, -174, 21, 75,101,212, 90,246,250,154, 0,160,213,243, 51,191,223,181,207,186, 91,219,112,126, 61, 39,167, 63,109,175,139,230,191, -196, 96,157, 74, 79, 79, 15,245,243,243, 75,119,119,119, 87,151,148,148,128,170,213, 69, 71,119,173,110,224,102, 49,238, 25,195, - 48, 84, 42,149,178,150,150,150,197,207,158, 61, 35, 6,131,225, 92,109,244, 41,165, 99,199,142, 29,203, 92,186,116,233,189,161, - 67,135,194,195,195, 3,119,238,220,193,182,109,219,176,119,239,222, 45, 66,161,112, 98, 93,210,157,148,148,164, 12, 8, 8,120, - 41, 2,242,234,200, 66,189, 38, 11, 44,203,154,220, 57, 63,239,246,182,104,158,173,173,190, 97,189, 63,166, 19,201,203,203, 67, - 86,153,185,170, 96,178, 76, 14, 97, 18, 66,138,180, 90,237, 43,233,252,163,249,177,184,184, 24, 58, 77, 38,140, 70, 99,165,154, -185,185,185, 69,206,206,206,235,214,174, 93,251,245,194,133, 11,237, 87,173, 90,149,251,248,241,227, 66,134, 97, 74, 94,121,136, -145,120,121,121, 41, 86,172, 88,225,176,118,237,218, 92,150,101,215,253,143,205, 85,223, 70,141, 26,109,233,214,173,155, 98,252, -248,241, 88,187,118, 45,210,210,210,102, 80, 74, 13,101,229,128, 37,132, 76,251,246,219,111, 15, 79,159, 62, 29, 58,157,110,197, -209,163, 71,231, 19, 66,198, 82, 74,127,174, 76,211,206,206,206,149,207,231,227,246,237,219,133,148,210,103, 53,148,179,116, 95, - 95,223, 12, 66,136,131,147,147, 83,131,234,246,181,182,182,246, 82, 40, 20, 72, 73, 73, 41,191,137, 87, 70,124,106,106, 42, 21, -137, 68,196,217,217,217,187,166,252, 91, 89, 89, 77,219,176, 97, 3,255,220,185,115,152, 59,119,110,114, 66, 66,194,144,178,105, - 4, 64, 41,189, 77, 8,105,211,190,125,251,157,211,167, 79,247,253,242,203, 47,201,147, 39, 79,198, 1,168,214, 96,185,187,187, -143, 29, 49, 98, 4,214,173, 91,135,245,235,215,143,163,148,238,121, 37,207, 59, 9, 33, 86, 54, 54, 54,235,198,140, 25,131,205, -155, 55, 15, 1, 80,165,193, 74, 73, 73,153, 62,112,224,192, 57,185,185,185, 75, 76, 57,167,166,236,239,236,236,220,123,232,208, -161, 14,148, 82,172, 93,187, 54,125,221,186,117,170,194,194,194,159, 83, 83, 83, 95,170, 39, 24,134,217,119,252,248,241,201,227, -199,143,199,185,115,231,190,113,118,118,166,169,169,169, 27,106, 56,167,105,132,144, 6,132,144, 0, 74,233,163,178, 81,130, 73, -175,148, 59,223,178,125,147, 77,201, 83,118,244,185, 67, 14, 13,187,255,126,247,198,249,206,158, 13,219, 8,236,173, 20,112,241, -182,133,181,153, 16, 20,192,131, 4, 53,174, 93, 60,169,207, 76, 75,188, 98,202, 8,194,114, 77,199,160, 30, 87,100,182,238,157, -235, 7,182,230,123,122,251,160, 83,171,198, 86, 54,230, 2,104,245, 20,167,238, 22,224,234,133, 99,250,204,140,164,115,220, 8, -194,255, 13,255,149, 14,238,166, 68,176,230,173, 95,191,190,213,198,141, 27,123, 78,158, 60, 89,241,193, 7, 31, 64, 42,149,162, -184,184, 24,110,110,110, 48, 24, 12, 56,122,244, 40,110,223,190, 93,196,178,236, 97,252, 49, 74,164,252, 2,122,233,109,219, 51, -215,170,234, 17, 66, 24,160,184,213,252,245,141,223,136, 38, 0, 92,137, 51,184, 56,167,101,207,203,201, 59,250,169,187,139,147, -176, 75,235, 22,124, 91,171,210,209,204,117,213,124, 3, 55,173,191, 92,211, 96, 48,140, 32,132, 52,156, 54,109,218,114, 23, 23, - 23,231,249,243,231, 39, 6, 6, 6,170, 11, 11, 11,169, 86,171,101,179,178,178,100,123,247,238,245,204,201,201, 41,210,235,245, -239, 83, 74,239,213, 38,157,169,169,169,106, 0, 67, 28, 29, 29, 15,102,102,102,238, 29, 52,104, 16, 54,111,222,140,171, 87,175, -246, 72, 77, 77, 61, 90,215,188, 83, 74, 13,225,225,225,249, 81, 81, 81, 14, 60, 11, 79, 56, 88, 10,208,245,139,210, 96,132, 66, - 12,168,139,139, 16, 23,243, 8,133,133,133,183, 76,213,140,141,141,213, 6, 7, 7,231,103,101,101,217,218,217,217,149,154,171, - 10,198, 42, 55, 55, 23, 5, 5, 5,148, 97,152,223, 77,213,204,202,202, 42,110,217,178,165, 42, 54, 54, 86,196, 19, 57,193,201, - 74,140,210, 38, 72, 10, 59, 5, 31,106, 85, 49,238,223,185,133,194,194,194,243, 85,105,166,166,166,238,114,118,118, 6,128,175, -231,204,153, 99,219,181,107,215,167, 55,110,220,104, 87,241,119, 66, 66, 66, 14,204,159, 63,191,199,226,197,139,179,183,108,217, - 50, 61, 45, 45,109,251,255,178, 44,217,216,216, 76, 57,114,228,136, 66,167,211, 97,237,218,181, 88,185,114,229, 70, 74,233,190, - 87,206,217, 17, 30,143,247, 45,195, 48, 31,125,252,241,199, 24, 51,102,140, 44, 52, 52,116,114,133, 40,215, 75,154, 41, 41, 41, -159,135,132,132,204,201,204,204, 52,201, 16,196,196,196,140, 14, 9, 9,249, 60, 51, 51,115,121,117,121,151,203,229,114,163,209, -136,231,207,159,231, 81, 74, 11,170, 40, 95, 37, 62, 62, 62, 41, 70,163,209, 85, 38,147, 89,215, 84, 62,243,242,242,150,132,134, -134,206,203,200,200, 56, 9, 96, 17,165,180,228, 21,189,187,132,144,134,159,124,242,201,132,101,203,150,245, 79, 79, 79,223, 85, -147,102, 66, 66,194,146,246,237,219,127, 17, 29, 29,189,133, 82,186,190,138,116,126, 67, 8,209,109,223,190,125,220,243,231,207, -151, 86,167,153,154,154,122, 24,192, 97, 83,207,111, 85,251, 87,212,180,182,182,158, 62, 97,194, 4, 28, 59,118, 12, 69, 69, 69, -107, 82, 83, 83,191,172,194,172, 93,243,244,244,252, 45, 60, 60,188,247,138, 21, 43,132, 61,122,244, 24, 7, 96,131, 9,229,243, - 42,128, 86,101,253,224, 30, 3,200, 41,247,201, 40, 29, 57, 72, 94,173,139,107,210, 52,234, 11, 7,223,185,180,127,103, 82,236, -253,240,144,118,125,173, 10, 84,174, 16,242, 25, 40,243,210,112,245,244,175,121,169,201,207,174,106, 75,242, 7,215, 70,211,160, - 43, 24,116,255,242,129, 93,233,241,143, 90,168, 90,117,183,202, 47,114,135, 80, 64,144,159,149,140,235,231, 15,230,166, 37, 62, -191,164,103, 53,195,254,174,122,254,255,147,230,127, 13, 98,202,128, 32, 66,136, 8, 64, 71,133, 66,209,233,211, 79, 63, 21,117, -237,218, 21,139, 23, 47,198,169, 83,167,180, 90,173,246, 20,128,211,149, 69, 6,170, 59, 1,127,133,102,183,230, 68,225,232,192, -172,246,112, 98,134, 4,122,123,145,168,152, 39,252, 91,169, 61,127,124, 29,205,127, 75,129, 38,132,180, 22, 8, 4, 95,250,251, -251,107,226,227,227, 3,173,173,173,163, 83, 82, 82, 68,122,189,126, 26,165,244,226,235,164,211,209,209,209,182,123,247,238,153, -179,103,207, 38,243,231,207,199,197,139, 23, 45,171,139,176,152,162, 89,175, 94,189, 14,161,161,161, 39, 86,125,179,129,159,144, -161, 68, 97, 81, 17,138,138,138, 80,172, 84,162,164, 48, 29,199, 14,236,212, 62,120,240,192, 55, 61, 61, 61,193, 84, 77,119,119, -247,174,141, 27, 55,222,185, 97,195, 6,139,156,156,156, 23, 6, 43, 55, 55, 23, 44,203, 98,253,250,245,185, 57, 57, 57,141,146, -147,147, 83, 77,213,244,240,240,232,211,170, 85,171,189,203, 87,255,192, 79,202, 80,162,168,184, 24, 42,149, 10, 37,106, 53,116, -202, 12,108,249,113,173,230,209,163, 71, 30, 89, 89, 89, 25,213,105, 58, 59, 59, 15,108,221,186,245,130,251,247,239,159,123,242, -228,201,216,138,219,124,124,124,190,109,210,164, 73,247,223,127,255,125, 78, 74, 74,202,182,255,117, 89, 34,132,116,117,113,113, - 89,153,149,149, 21,167,211,233,246, 80, 74,183, 85,243,189, 65,124, 62,127,144,173,173,173, 67,122,122,250, 50, 74,233,254,255, -101,153, 39,132,244,180,183,183,159,149,153,153,185,140, 82,250, 91, 53,223, 43,223,111, 57,165,244, 0,119, 3,251,179,166,179, -179,115, 79,123,123,251, 5, 25, 25, 25,231,210,211,211,167, 85,215,228,235,234,234, 42, 97, 89,118,129,131,131, 67,203,244,244, -244,175,211,210,210,126, 53, 53,157,101,175,202,241, 64,105,127, 43,160,180,207, 85, 66,117,115, 95,213,164,105,235,219,169,151, - 88, 38, 29, 78, 89, 99, 19,128,128,225,241,238,150, 20,171, 54, 87, 23,185, 50, 69, 83, 34,151,141, 96, 89, 99, 19, 6,132,101, - 24,230,158, 90,173,250, 41,235,241,169, 99,156, 25,250,251, 12, 22, 33,100, 52,165,244, 71,252, 11, 33,166,143,184, 46, 29,194, - 12,160, 7,195, 48, 45, 89,150,189, 2,224, 72,117,243,214,152,114, 2,254, 10,205,110, 17,196,197,195,150,183, 94, 33, 99, 66, -151,109,209,127,242, 38, 52,255, 45, 5,154, 16,210,135,207,231,127,102, 48, 24,190,162,148, 30,124, 83,233,244,241,241,217, 16, - 17, 17, 49,252,196,137, 19,223, 37, 36, 36, 76,120, 19,154,129,129,129, 95,215,175, 95,127, 66,143, 30, 61, 4,246,246,246,200, -206,206, 70, 76, 76, 12, 34, 35, 35,181,233,233,233, 99,159, 60,121,178,165,182,154,141, 27, 55, 94,104, 99, 99, 51,246,195, 15, - 63,180, 33,132, 32, 39, 39, 7, 69, 69, 69,116,223,190,125,217,106,181,250,195, 39, 79,158, 28,174,173,102,163, 70,141,126,244, -244,244, 28,214,183,111, 95,129,139,139, 11,178,179,179,241,240,225, 67,252,254,251,239,154,244,244,244,161,209,209,209,251, 76, -209,244,242,242, 18,197,198,198, 86,218,156, 24, 18, 18, 34,136,140,140,212,115, 21, 46,167,201,105,114,154,156,193,250,111, 24, - 44,126,109,118, 46, 51, 41,187, 8, 33,123,203,251,103,188, 46,127,133,230,177,243, 52, 5, 64,119, 66, 8,255, 77,105,254, 91, - 40, 51, 85, 7,223,180,110, 76, 76,204,135,206,206,206, 19,203,154, 13,223, 8, 15, 31, 62,156,226,226,226,178, 61, 62, 62,126, -133, 76, 38, 11,102, 89, 86,175,209,104, 46,231,228,228, 76, 78, 77, 77,173,211,139, 96,239,221,187,247,133,179,179,243,129, 21, - 43, 86,204,160,148, 54, 38,132,104, 13, 6,195,149,188,188,188, 5, 73, 73, 73,105,117,209,188,127,255,254,104, 23, 23,151, 77, -241,241,241, 75,197, 98,113, 99, 74,169, 86,173, 86,159,207,204,204,252,180, 60,114,101, 10, 85,153, 43,160,116,138, 12,112,112, -112,112,112,252,103,224,215,229, 75,127,133,105,249,183,104,254,127,230, 77,154,171,114, 82, 82, 82,238, 1,120,235, 13,167,243, - 14,128, 1,111, 56,157,215, 1, 68,112,165,128,131,131,131,131,195, 20, 24,238, 16,112,112,112,112,112,112,112,112,188, 89, 8, - 74,231, 33,249, 19,181,105, 91, 37,132, 4,213,246,135, 77,232, 75,196,105,114,154,156, 38,167,201,105,114,154,156,230,127, 76, -179, 18,237,183, 95,217,148,242,138,222,127,191,147,123,173,197,185, 14,128,156, 38,167,201,105,114,154,156, 38,167,201,105,254, - 63,132,107, 34,228,224,224,224,224,224,224,224,224, 12, 22, 7, 7, 7, 7, 7, 7, 7, 7,103,176, 56, 56, 56, 56, 56, 56, 56, - 56, 56,131,197,193,193,193,193,193,193,193,193,193, 25, 44, 14, 14, 14, 14, 14, 14, 14,142,127, 12,127,233, 40, 66, 14, 14, 14, - 14, 14, 14, 14,142,255,143,188, 20,193, 34,132,112,110,139,131,131,131,131,131,131,227,111,227,191,226, 69,184, 38, 66, 14, 14, - 14, 14, 14, 14, 14, 14,206, 96,113,112,112,112,112,112,112,112,252, 11, 12, 22,215, 52,200,193,193,193,193,193,193,241,119,242, - 95,243, 34,229, 17,172,136,178,140, 69,112,167,152,131,131,131,131,131,131,227,111,224, 63,229, 69,184, 81,132, 28, 28, 28, 28, - 28, 28, 28, 28,111, 24,174, 15, 22, 7, 7, 7, 7, 7, 7, 7,199,191,201, 96, 17, 66,130, 56, 77, 78,147,211,228, 52, 57, 77, - 78,147,211,228, 52, 57,131,197,193,193,193,193,193,193,193,193,193, 25, 44, 14, 14, 14, 14, 14, 14, 14, 14,206, 96,113,112,112, -112,112,112,112,112,112, 6,139,131,131,131,131,131,131,131,131,131, 51, 88, 28, 28, 28, 28, 28, 28, 28, 28,127, 19, 4, 64,165, - 35, 1, 40,165, 15, 76, 22,169,195,104,130,154,244, 57, 77, 78,147,211,228, 52, 57, 77, 78,147,211,252,239,105,214,164, 93, 27, -255,241,143, 54, 88,127,229, 68,163,132,144,160, 55,125,160, 56, 77, 78,147,211,228, 52, 57, 77, 78,147,211,252,239,105,254,215, -224,115,135,128,131,227, 95,206, 94,194,131,189,159, 39, 88,234, 12,190, 40, 13,103,239, 63,195, 92,202,190,182,166,115,160, 59, -180,122, 7, 72, 37, 89, 56,113, 47,238,181, 53, 57, 56, 56, 56, 56,131,197,193,193,241,175,193,201,223, 23, 70, 44, 5, 15, 78, -160,186, 88,180, 10, 92, 10,224,245,158, 44,109,252,125,161,103, 23,129,207,184, 66,171,139, 70, 91,191,101, 0, 30,114, 7,155, -131,131,131,195, 52,254,150, 78,238, 97, 97, 97,145, 97, 97, 97, 11, 35, 34, 34,196,220, 41,224,224,120, 13, 30, 52,146,193, 96, -236,166,213,179, 46,199,175,228,219,171, 74,140,190, 16, 26,186,227,138,175,217,107,105, 10, 72,231, 18, 61, 91,111,251, 41,149, - 67,113,137, 33, 0, 12, 94, 79,179,140,160,160, 32,203,102,205,154, 29, 15, 14, 14,182,229, 78, 30, 7, 7, 7,103,176,222, 48, - 44,203, 54,181,183,183,159,172, 86,171, 19, 66, 67, 67,123,255,127, 58,224, 45, 90,180,184, 18, 30, 30,158,209,178,101,203,140, -150, 45, 91,222,174,105,253,127, 17,103,103,103,223, 70,141, 26, 37, 52,108,216, 48,186,226,122,251, 38,253, 91, 6,180,253, 96, -174,109,195,190,237,184, 75,211, 68,138, 89, 7, 48,188,246, 15,227, 85,178,244,124,189, 67,228, 19,149, 2,148, 23, 1, 29,156, - 94, 75,147,165, 29,238,198,170,229, 87,159,217, 57, 92,122,160, 49, 7,101,218,131, 18,199,215, 77,174, 72, 36, 26, 71, 41,237, - 36, 16, 8, 38,113, 39,239,255, 55,132,144, 32, 66, 72,111, 66, 72,216, 27,212,252,210,223,223, 63,133, 16,242, 9,119,132, 57, -254, 53, 6,107, 64,125,210,234,189, 6,228,194,192,250,164,104, 80, 3,162, 28,218,128, 92,126,199,139,212,249, 70,184,111,223, - 62,233,182,109,219,236, 3, 3, 3,119, 53,111,222,252,114,104,104,168, 79, 93,116,194,194,194,142,135,133,133, 13,120,117, 93, -104,104,232,192,138,235,154, 53,107, 22,213,172, 89,179,130,176,176,176,103,166,232,134,132,132, 60, 13, 9, 9, 41, 14, 11, 11, -123, 90,113,125,104,104,232,192,102,205,154, 29,127,229,247, 6,188,186,174,202, 3,206, 48,174,135, 14, 29,178, 63,114,228,136, - 61,159,207,119,120,117,253,225,195,135, 95, 90, 95,135,227, 49, 42, 44, 44,236,202, 43,121,249,240,213,117,213, 17, 26, 26,122, - 37, 36, 36,228,195, 87,116,175,132,133,133,141,122, 19,230,170,109,219,182,151,239,220,185, 83, 79,161, 80, 88, 86,220,230,104, - 99,217,229,202,225,111, 39, 15, 27,208,121,156,125, 96,191, 70,220,229, 89, 3,143, 3,133, 48,176,109, 89,150,218, 61,124, 86, - 98,215,189,199, 59,252,187, 79,213,118,122,131,209, 26,132, 23,129, 11, 30,226, 58,105,234,245,109, 88, 74, 29,206,220, 21,218, - 69,244,250,152,119,238, 62,223, 78,111, 52,218, 64,143,118,117,210,252,163, 28, 10,120, 60,222,228, 49, 99,198, 48,132,144,143, -189,188,188, 68,255,159, 78, 87,243, 70,196,229,173, 80,254,141,144, 64,210,234, 13, 26,138,134,114,185,252, 22, 33,196,247, 95, -102,174,154, 2,144, 81, 74,127, 3,224, 64, 8,225,191, 1,205, 85, 11, 22, 44,152,246,224,193, 3,231,250,245,235,207, 39,132, -240,184, 74,130,227, 31,111,176, 6,213, 39,243, 28, 28, 93, 78,206, 94,181,163,237,134, 11,113,102,223, 29,186, 45,159, 60,125, - 73, 43, 71, 43,187,163, 67,189,200,178,170,190, 87,221, 8, 3,145, 72,132,103,207,158, 97,237,218,181,146,121,243,230,181,180, -176,176,184,215,188,121,243,213,129,129,129,242,234,210,242,170, 38,165,180,149, 64, 32,216,208,188,121,243,205,229, 21, 54, 33, -164,149, 88, 44,254,177,121,243,230,219,203,155, 33, 67, 66, 66,234,223,184,113,195,156, 16,226, 96, 74, 58,155, 53,107,230, 20, - 25, 25, 41, 3, 74, 35, 1, 17, 17, 17,226,102,205,154,109,115,113,113, 89, 15,160, 21, 0,120,121,121,137,154, 55,111,190,217, -205,205,237, 39, 66, 94,174, 52,171,202, 59,195, 48,176,180,180,196,142, 29, 59,192,227,241, 42, 86, 14,176,180,180,196,207, 63, -255, 12, 66, 72,173,143,103, 96, 96,160, 60, 44, 44,108,159,147,147,211,106,150,101,195, 1,160, 81,163, 70,178,102,205,154,237, -117,113,113, 89, 83,190,206, 20, 77, 74,105,184, 80, 40, 92,221,172, 89,179,189,141, 26, 53,146, 1, 0,203,178,225,124, 62,127, - 85, 88, 88,216,190,218,156,163,166, 77,155,142,105,220,184,113,106,227,198,141, 83,253,252,252, 22, 59, 56, 56,156, 95,183,110, -157, 77,197,188,151, 71,174, 50, 50,115,242,174,220,140,122, 50,121,204, 59, 17,245,220, 28,134, 88, 54,233,107, 97, 74,222,235, -202,191, 94, 51,135,216,131,208,142, 79, 18,212, 18, 15,239, 80,185,189,255, 59,176,179,228,139,175, 62, 42, 86,128,135,183, 32, -144,217,213, 77,147,255, 86, 84,156, 90,106, 85,191,155, 44,172, 69, 91, 16,185,143,248,252,157, 98,115,240,153,186,105,254,193, - 59,225,225,225,162,142, 29, 59,194,217,217,153,103, 97, 97, 49,228, 63,127,142, 42,152, 43,133, 68,116,253,235, 5,159,134, 58, -219,200, 14,154, 98,178, 76, 24, 62,223,208,222,222,254,220,183,223,126, 27,162, 80, 40, 46,154, 98,178,254, 9,199,179,204, 92, - 9, 41,165,215,202, 86, 61, 4,208,230, 53, 53, 87,205,155, 55,111,210,204,153, 51, 81, 84, 84,132, 97,195,134,153, 3,248,218, - 84, 77,133, 66,225,221,184,113,227,237, 13, 27, 54, 76, 12, 14, 14,214, 6, 4, 4,148,248,249,249,197, 7, 5, 5,109,145, 72, - 36,158,255,245,242,249, 79,209,172, 1, 17,128,246, 0,122, 0,120, 11, 64,179,178,255,195,202,150, 30, 0, 58,190,242,183, 60, - 58, 90,190,189,121, 21, 26, 61, 42,249, 94, 88,133,245, 21, 63,191,250,127,245, 6,139, 16, 66, 43,254,173,200,187, 13, 72, 75, - 27, 71,151,105, 95, 30,184, 41,101, 99,238, 34,114,100, 7, 60,249,164, 47,164, 79,239, 98,198,132, 25, 82,133,194,106,194,128, - 6,164,125, 93,142, 86,116,116, 52,118,237,218, 5, 91, 91, 91,178,113,227, 70,241,128, 1, 3,198,153,155,155, 39,133,133,133, - 13, 49, 85,131,199,227, 25, 55,111,222,108,214,167, 79,159, 65,214,214,214, 81, 33, 33, 33,245, 25,134, 49,110,221,186,213,108, -224,192,129, 3,180, 90,237,163,208,208, 80,159,219,183,111, 27,111,222,188, 9,134, 49, 45,104, 23, 25, 25,105, 56,118,236, 88, -121, 68,199,135, 82,250,104,217,178,101,131,246,239,223,175,176,176,176, 96, 67, 66, 66,234,187,185,185, 69,125,249,229,151, 67, -246,238,221,171, 48, 55, 55,103, 77,172, 8, 80, 82, 82, 2,137, 68,242,146,145, 34,132, 64,173, 86, 67, 44, 22,155,156,198, 10, -145,129,134, 54, 54, 54,143,151, 46, 93,218,231,192,129, 3, 82,133, 66,129,176,176,176, 0, 75, 75,203, 39,203,151, 47,239,123, -240,224, 65,169, 66,161, 48, 89, 79, 40, 20,226,231,159,127,150,189,247,222,123,189,197, 98,241,227,176,176,176, 0,161, 80,136, -157, 59,119,202,134, 12, 25,210, 83, 38,147, 61, 10, 9, 9,105,104,138,150, 94,175,159,115,243,230, 77,167,243,231,207, 59,185, -187,187, 79,252,238,187,239, 28, 4, 2, 1, 0,192,104, 52,190, 20,185, 26,210,191, 83,243, 73,115,190, 61,167, 46,209,104, 23, -205, 24, 17, 33, 48,162, 5,247, 12, 84, 5,123, 9, 15,172,177, 41, 0,175,219,209,106,219, 38,109,135,240,145,249, 27,154, 5, -152,241, 47,220, 86,218, 83, 74,221, 97,160,205,112, 33,130, 95, 43, 77, 30,109, 2,194,250,156,188, 67,108, 91,118, 28,194, 79, - 72, 72,128,103, 64, 4,239,240, 77, 56, 80, 74, 61,193, 34,180, 86,154, 21, 16, 8, 4,115,223,125,247, 93,121,124,124, 60, 90, -182,108, 41, 19,137, 68,115,222, 72, 20,239,186,159, 59, 46,250, 70,224,138,175, 83, 93,211,246, 87, 71,174,204, 37,162,107, 59, -183,255,226,220,168,205, 40,178,254, 83,119,107, 59,133,224,224,235, 68,178,202,204,213,217,235,215,175,219,116,238,220, 25,243, -230,205,179, 51, 55, 55,191,248, 79,143,100, 85, 52, 87,132, 16,105, 89,243, 96, 10, 0,215,215,208, 92, 51,111,222,188, 73,179, -102,205,194,181,107,215,176,124,249,114,116,235,214, 13, 86, 86, 86, 53,214, 31,239,191,255,190,172, 85,171, 86,145,189,123,247, -190, 59,105,210,164, 33,135, 15, 31,118,219,188,121,179,112,248,240,225,226,119,223,125,215,253,211, 79, 63,253,160,123,247,238, - 15,154, 55,111,126,125,192,128, 1,146,186, 38,177,108,225,168,249, 92, 86,233, 69, 0, 52,158, 57,115,102, 51, 66,200,225,153, - 51,103,134, 2,176, 37,132, 28, 6, 96, 7,192,174,236,127,209, 43,127,237,202, 76, 83,249,118,155,202, 52,202,151, 87,190,103, - 87, 97,125,197,223,120,245,255,154, 35, 88,132,144,118, 0, 46,190,186, 3,159, 98,193,152,201, 11, 37,207,183,172, 68,218,246, - 85, 96,178, 83,192,203, 79,135,230,226,111,208, 95, 58,132,247,195,195,165, 82, 66, 22,213,229, 96, 42, 20, 10, 8,133, 66,196, -196,196,224,209,163, 71,232,222,189,187,112,237,218,181,150, 13, 27, 54,252,177, 85,171, 86,119,195,194,194, 26,155, 98, 88,188, -189,189, 49,104,208, 32,209, 39,159,124,210, 64, 34,145,220,166,148, 10, 60, 61, 61, 49,112,224, 64,225,244,233,211, 61, 36, 18, -201, 77,150,101,133, 50,153,172,202,232, 80,101,186, 82,169, 20, 0, 4, 62, 62, 62,183,118,237,218,229,217,170, 85, 43,254,201, -147, 39, 81, 88, 88,200,247,245,245,189,187,115,231, 78,175,150, 45, 91,242, 47, 95,190,140,226,226, 98,106,170,110,113,113, 49, -164, 82,233,159, 12, 86,113,113,241,159,140, 87, 77,132,133,133,141,242,242,242,186,185,107,215, 46,215, 54,109,218,240,206,157, - 59,135,162,162, 34,184,187,187,223,218,181,107,151,107,171, 86,173,120, 87,174, 92, 65, 81, 81,145,233,143, 9, 34, 17, 60, 61, - 61,241,238,187,239, 10,166, 78,157,234, 42, 16, 8,110,138, 68, 34,184,187,187,227,221,119,223, 21, 78,153, 50,197, 85, 36, 18, - 93, 55,177,201,144, 7, 0, 6,131, 1, 3, 6, 12,144, 75,165, 82, 36, 37, 37,129,101, 89,176,108,169, 39, 77,203,202,185,255, -251,205, 7,143, 39,143, 29,208,174, 88,163,209,156, 56,127,235, 81,160,143,187, 43, 33,212,131,171,114,170,192, 42,208, 6, 60, -116, 74, 72,213,138, 69,114, 87,133,153,173, 31,144,123, 17,245,157,197, 0, 37,146,155,143, 85,114, 48,180, 19,144,109, 83, 43, - 77, 35,219, 41, 46, 69, 43,214, 73,131,204,156, 93,234, 33, 39, 39, 7,110,158,254,208,192, 78,116,229, 65,177, 25,104, 45, 53, -203, 8, 14, 14,110,227,230,230,230,232,225,225,129,236,236,108,120,123,123,195,204,204,204, 42, 36, 36,164, 83,157,143,193, 5, - 15, 49, 10,208, 10, 58,242, 53, 8, 51, 31,148,191, 20,252,172,166,184, 29, 34,248,199,153,171,159,127,113,177,113,242, 7, 30, -140,132,131,181, 8, 27,103, 54,177,182, 83,136,235,100,178, 8, 33, 13, 29, 28, 28,206, 94,191,126,221, 86, 34,145, 32, 50, 50, - 18,129,129,129, 88,185,114,165,157,149,149,213, 63,214,100,189, 98,174,172, 41,165,106, 0, 44,128,193,168,195,168, 87, 82,202, - 55, 11, 23, 46,156, 56,107,214, 44, 92,189,122, 21, 46, 46, 46,200,204,204, 68,155, 54,109, 18,242,242,242,170,189, 47, 53,108, -216,208, 53, 38, 38, 38,229,211, 79, 63,109,186,109,219, 54,169, 92, 46, 71,126,126, 62,126,250,233, 39,204,156, 57, 19,132, 16, - 80, 74,177,105,211, 38,217,136, 17, 35,154,197,198,198,166,120,120,120,152,218,125,131,148, 69, 92,100, 0,228,101,127, 37, 19, - 39, 78, 20, 17, 66,196,101,230, 82, 66, 8, 17,112,149,217,159,206,107,165, 94, 4,128,237,178,101,203,150, 80, 74,123, 46, 91, -182,108, 73,133,253, 15, 87,163, 85,209, 52, 1, 0, 94,213,160,148,246,172,248,183,226,119, 41,165, 61, 41,165, 61, 43,126,191, -186,223,171,210, 96, 1, 56, 79, 41,109,247,167, 48, 32,208,216,177,190, 31,242, 79,237,129,148, 71, 94, 90,152,184,251,112,147, -240,161,167,180, 97, 93, 14,164,153,153,217,139,133, 97, 24,164,165,165,129,199,227, 97,206,156, 57,146, 9, 19, 38, 52, 18, 10, -133, 87,219,182,109,187,180, 38,195, 2, 0, 55,110,220,128,183,183, 55,153, 53,107,150,121,187,118,237,248, 0,112,239,222, 61, -120,121,121,145,197,139, 23, 43,122,245,234, 69,100, 50,153,201,209, 33,134, 97, 32,149, 74, 17, 17, 17, 65, 54,111,222,108, 38, - 22,139,113,228,200, 17,100,103,103,163,115,231,206,252,205,155, 55,155, 73, 36, 18, 92,184,112, 1, 5, 5, 5, 38,235, 18, 66, -160,209,104, 42, 53, 88,149, 69,182,170,163,101,203,150, 27, 29, 29, 29, 87,111,219,182, 77, 44,149, 74,113,238,220, 57, 20, 20, - 20, 96,208,160, 65,134,159,127,254, 89, 98,110,110,142, 43, 87,174,160,160,160,160, 78, 5,253,198,141, 27,240,242,242, 34,179, -103,207,150,134,135,135,235, 1,224,206,157, 59,240,241,241, 33,179,103,207,150,154,155,155,175,106,221,186,245,198,234, 52, 88, -150, 69, 90, 90, 26, 30, 60,120,128,184,184, 56,100,103,103, 35, 43, 43, 11, 69, 69, 69, 48, 24, 12, 0, 0, 89, 81,225,145,111, - 54, 31,186, 43,151, 74,101,205, 27,249,212,187,126,251, 97,166, 92, 42,149,249,120,214,243, 37,100, 62,247, 58,167,202, 10,145, - 64,235, 3, 74,154, 94,123,168,180,110,211,101,176, 16, 89,199, 0,170, 7, 8, 31,237,155,187,242, 15, 94, 46,118, 0,139,198, - 16,194, 31, 48,161, 64, 17, 66,192,215,121, 3, 36,244,100,164,193,166,117,151,113,194,228,228,100, 8,133, 66,136,197, 98, 4, -183,122,155,191,243,156,222, 17, 64, 19, 8,224,103,146,102, 5,196, 98,241, 23, 35, 70,140,144,167,164,164,188,208,236,214,173, -155, 92, 38,147,205,173,179,185, 98,100,225, 48,208, 73, 81,113,106,247,197, 91,210,252,159, 37,169,253, 65, 49, 5,122,125,240, -235,154, 44,119,119,247, 8, 95, 95,223, 56, 79, 79,207,214,175,105,174,174,238,250,249, 23, 23,107,199, 82,115, 5,163, 10,224, - 73,225,104,111,133,141,115, 35,172,237,204,165,181, 50, 89,101,230,234,204,181,107,215,108, 37, 18, 9,110,221,186, 5,145, 72, - 4,137, 68,130, 70,141, 26, 97,253,250,245,118,214,214,214,255, 8,147, 69, 8,177, 34,132,116, 33,132,188, 67, 8,121,187,130, -185,242, 4,208,129, 16,210, 9,128, 35,128, 11,148,210,187, 38,106,182,230,243,249, 71,154, 52,105,146,202,231,243, 31, 46, 89, -178,228,163,233,211,167, 99,205,154, 53,136,136,136,120, 54, 99,198, 12, 60,121,242,196,160, 82,169,122, 83, 74,171,189, 17, 42, -149,202,223,102,207,158,109,209,175, 95,191,242,207,184,124,249, 50,182,110,221, 10,185,252,143, 94, 16,148, 82,244,234,213, 11, -163, 70,141,178,210,106,181,251,170,211,116,112,112,120,235,252,249,243, 62,101,230, 74, 82,193, 96,201, 79,159, 62,109, 41,145, - 72,172,155, 53,107,102, 94,182, 94,214,175, 95, 63, 27,129, 64,208,154,171,212, 94,162, 82, 47, 82,149,193,121,213, 0, 85,182, -173, 50,243, 84,215,196, 85,247,123,213, 25,172, 8, 66,200,133,202,118,210,229,102, 64, 12, 35,100, 60, 2, 41,159,148,254,229, - 17, 72, 9, 11,126, 94, 70, 45,171,218,151, 13,150, 66,161,248,147,209, 82,171,213, 80, 42,149, 38, 25,141,242,190, 60, 86, 86, - 86, 47,110,218,102,102,165,163,201,173,173,173,161,209,104, 64, 8,129, 92, 46,135, 92, 46,175, 85, 4, 75, 34, 41,141, 8, 95, -185,114, 5,191,255,254, 59,248,124, 62,172,173,173, 1, 0,183,110,221,194,253,251,247, 33, 18,137, 96, 99, 99, 83, 43, 93,157, - 78, 87,105, 19,161, 86,171,173, 85, 19, 33,195, 48, 40, 41, 41,161,183,110,221,194,131, 7, 15, 32, 22,139, 97,103,103, 7,145, - 72,132,164,164, 36, 60,126,252, 24, 34,145, 8,118,118,118,117, 58, 63,230,230,230,200,207,207, 7,203,178,229,209, 60,152,155, -155, 67,169, 84,130, 97, 24,147,210,201,178, 44, 82, 82, 82,144,157,157,141,196,196, 68,100,101,101,189, 48, 89,229, 77,132, 28, -181,228,114, 67, 11, 16, 65,231,172,124,189, 56, 75, 41,178,112,240,234, 8,100, 31, 3, 8, 15, 16, 88,161, 69,211,250, 72, 72, - 55,202,159, 36,106, 37,208,163, 11,206,250, 90,153,164,201, 19,116,202, 44,208,139,227,243,237,204, 3,130, 66,144,153,153, 9, -177, 88, 12,177, 88,140,208, 22,111, 33, 46,149,149, 61,124,174,150,129,162,179, 73,154,101, 52,109,218,180,129, 84, 42, 13,111, -218,180, 41,201,200,200,128, 88, 44,134, 68, 34, 65,120,120, 56, 24,134,105, 20, 28, 28,236, 95,171,252, 63,243, 18, 65, 32,107, - 1,208, 73,143,159,171,156, 15, 94, 81,251,246,234,251,182,245,170,221,153,254,143,159,151,120, 66,107,152,138, 98, 93, 72, 93, - 77,150,135,135, 71, 59, 51, 51,179,195, 95,124,241,133,167, 88, 44, 62,230,233,233,217,166, 78,245,155,152,247,195, 23,147, 6, -187, 88,149,155, 43, 67, 49,192,147, 2, 60, 89,169,201,114,176,197,162, 79, 58, 90,203,132,130, 95, 77,213,148, 74,165, 59,191, -249,230, 27,187,114,115, 37, 20, 10, 33,145, 72, 94, 44, 77,155, 54,197,156, 57,115,236,172,173,173,119,252,205,230,202, 26,165, -253,170,238, 1,216, 7,224, 76, 5,115,229, 13,224,215,178,168,213,109, 74,105,130,137,154, 45,187,118,237,122,238,217,179,103, -221,239,222,189,235,148,158,158,238, 63,101,202, 20,172, 94,189, 26,211,167, 79,223, 65, 41,245,221,179,103, 79,240,141, 27, 55, - 26,153,210, 63, 40, 61, 61,253,189, 25, 51,102,100,103,103,103, 3, 0,130,130,130,144,159,159,143,169, 83,167, 98,210,164, 73, -229,145, 87, 0, 64,102,102, 38, 86,172, 88,145,145,158,158, 62,172, 58, 77,163,209,152,180,127,255,254,112,173, 86, 91, 15,128, - 16,128, 24,128, 44, 33, 33,193,162,184,184,216,156,199,227, 41,228,114,185,185, 88, 44,150,143, 24, 49, 66,248,240,225,195, 0, -131,193,144,194, 85,106, 47, 81,165, 23,169, 44,210, 84,213,186,186,238,111,170,201,170,149,193,162,148, 94, 0,208,246, 79, 6, -134,224, 94,226,205, 11,176, 14,108,250,114, 4,139, 79, 32, 83,152, 35, 46, 37, 9, 66,144,168, 58, 36,240,133,169,170,104,178, -210,210,210, 48, 99,198, 12,213,246,237,219,239,107,181,218,240,139, 23, 47,206, 52, 37,130,101,111,111,143,196,196, 68,250,213, - 87, 95, 21, 30, 59,118,204, 80,190, 46, 41, 41,137,126,254,249,231, 69,191,252,242, 11,173, 77, 19, 97,121, 4,235,194,133, 11, -116,238,220,185, 5,169,169,169,212,218,218, 26, 54, 54, 54, 56,125,250,180, 97,230,204,153, 5,177,177,177,212,218,218, 26,214, -214,214,181, 50, 88, 6,131, 1, 82,169,244, 37,131, 66, 8,129, 94,175,255, 83,100,171,218,123,226,229,203, 35, 11, 10, 10, 62, -157, 58,117,170,250,209,163, 71,212,206,206, 14,118,118,118,216,178,101, 11,255,131, 15, 62, 80,223,187,119,239,197,186,186, 96, -107,107,139,232,232,104,186,100,201, 18,245,153, 51,103, 4, 0, 96,103,103,135, 39, 79,158,208, 5, 11, 22,168,243,243,243, 63, -189,124,249,242,200, 26, 42, 28,196,197,197,161,176,176, 16, 70,163, 17, 26,141, 6, 89, 89, 89, 72, 78, 78,126, 97,176,212,114, -243,174, 31, 15,239,213,164, 88,173, 86, 93,191, 31,147,216,188,105,160,125,177, 90,173,138,121,158, 24, 77,233, 92,110,246,240, - 63, 93, 60,172, 35, 40,109,125,249,190,210,178, 83,143,129, 34, 82,120, 3,208, 43, 1,129, 21, 32,176, 4, 95, 98,131,110,111, - 5,243, 54,159, 40,116, 4, 97, 91, 66, 34,174,185,127, 11, 75, 29,192,178,109, 78,223, 42,177,106,221,125,130, 40, 55, 55, 23, - 12,195,188, 48, 88, 50,185, 28,111,245, 28,202,108, 58,161,113, 4, 75, 91,129,199, 51,185,207,140, 80, 40,156, 54,124,248,112, - 97, 94, 94,222, 75,154, 82,169, 20,125,251,246, 21, 43, 20,138,207, 77,206,251,227, 64, 33, 50,196, 45,192,210, 73, 79,226,213, -206,251,127, 87,251, 78,153,179, 73,218,176,113,115,140,237, 99, 47, 93,188, 45, 51,240,110,172,202, 19,140,113, 50, 84,218, 80, -252, 88, 59,147,229,233,233,217, 70, 46,151, 31, 57,112,224,128,172,125,251,246,152, 50,101,138, 92, 44, 22, 31,243,240,240,104, - 91,219,211, 84, 92,100,252,120,193,170,109, 25,247,118,119, 1, 12, 69,101,230,234,143, 37,179,128,197,156,111,206, 21,232,141, -116,176,169,154,106,181,250,131, 15, 63,252, 48,103,223,190,125,127, 50, 87, 18,137, 4,207,159, 63,199,226,197,139,115,115,115, -115,135,253,205,165, 52, 24,192, 29, 0, 37, 0,218, 1,144,149,141, 20, 12, 7,112,154, 82,106,164,148,102, 80, 74,211, 76, 21, -228,241,120,211,191,251,238, 59,190, 90,173,198,168, 81,163,144,148,148,132,212,212, 84,204,158, 61,251, 57,203,178, 31,148,105, -222,165,148, 62, 54, 69, 79,171,213, 62,201,203,203,235,217,181,107,215,252,188,188, 60, 52,110,220, 24, 61,123,246,132,163,163, - 35,156,157,157,209,187,119,111,248,248,248, 32, 39, 39, 7,131, 7, 15,206,205,202,202,234, 66, 41,173,118, 20,122, 78, 78, 78, -236,238,221,187, 99, 63,250,232,163,176,164,164,164, 32, 0, 78,122,189,222, 90,173, 86, 43, 12, 6,131,153,185,185,185, 77, 72, - 72,136,221,216,177, 99, 45,111,222,188, 25,152,156,156,172, 4,144,192, 85,106, 47,121,131, 74,189,200,107,112,228,117, 34, 85, -149, 69,192, 76,133, 41, 19, 34, 21,255,190, 20,189, 2,230,108,221,187,181, 68,228,238, 3, 11,255, 38,144, 73, 36,144,138, 69, -144, 90, 90,163,132,101,177,225,121,186,170,152,210,207,235,144,248,151, 34, 87, 44,203, 98,253,250,245, 37,139, 22, 45,202, 79, - 79, 79, 31,123,241,226,197, 38, 55,111,222,188,103,138, 17, 42, 44, 44,196,158, 61,123,212,155, 55,111,126,166, 86,171,155, 10, -133, 66,189, 86,171,197,142, 29, 59, 74, 86,175, 94, 29,175, 82,169,194, 4, 2,129,174, 54,205,111,229,125,176, 4, 2,129,190, -164,164,164,233,174, 93,187, 98,143, 28, 57,162, 54, 55, 55,135, 64, 32,208,171, 84,170, 70,219,182,109,123,178,107,215, 46,181, -185,185,121,173,140, 27,203,178,149, 70,176,140, 70, 35,196, 98,113,173,250, 96,221,188,121,243, 39,157, 78,215,124,199,142, 29, -201,155, 54,109, 42, 49, 55, 55, 7, 0,232,245,250,176,173, 91,183, 38,255,240,195, 15,154,218,116,112, 47,171,120, 96, 52, 26, -177,109,219, 54,205,206,157, 59,147, 13, 6, 67, 88,249,186, 77,155, 54,149,108,219,182, 45, 89,167,211, 53,191,121,243,230, 79, - 53,105, 25,141, 70, 99,126,126, 62,248,124, 62,158, 61,123,166, 17,139,197,224,241,120,136,137,137,121, 97,176,236,109,173, 3, - 91,133, 5,249,175,252, 97,207, 5,185, 88, 44,238, 18, 17, 26,240, 48, 38, 33,153, 82, 18,207, 85, 55,149,133,148, 33, 3,129, - 52, 38, 73,163,144, 8,244, 4,233,191, 2, 66,171, 50,131, 85,186, 56,187,184,226,230, 99,149, 2, 4, 34,104,245,246, 53,106, -234,169, 28, 4,178, 7, 9, 80,240,133, 82,146,158,158,254, 34,210, 84,110,136, 60,189, 2,112, 59, 70,105, 6, 66,197, 0, 28, -106, 83, 81,153,153,153,241,211,210,210, 94,104,189,208,244,244,228,233,245,250, 46, 38,231, 61,203,232, 4,150,253, 56, 58,177, -196,249,192,239,106,159,201,115, 54, 73,165,188, 60, 32,126, 13, 26,250, 56, 98,202,176, 38,162,217, 27,178, 26,222,124,168,106, - 0, 66,199,162,161,210,228,167, 11, 79, 79,207,214, 50,153,236,216,129, 3, 7,100,114,185, 28,207,158, 61, 67,227,198,141,177, -112,225, 66,153, 76, 38, 59,234,238,238, 30, 81,155,211,116,237, 9, 77, 80, 22, 25,195,167,173, 79, 74,191,247,220, 88,106,172, -152, 82,115,149, 85, 64,241,225, 23,135,242,243, 10, 75,222,190,122, 95,127,182, 22,199,242, 78, 65, 65, 65,231, 47,190,248, 34, - 39, 59, 59,251, 37,115,149,144,144, 80,110, 4, 34, 40,165, 81,127,115, 41,149,163,180,243,186, 31, 0, 47, 0, 77, 40,165, 6, - 0, 69,148,210, 58,133,174, 3, 3, 3,155,186,187,187,227,251,239,191,199,134, 13, 27,242, 86,174, 92, 9, 74, 41,124,124,124, -204,235,170,153,145,145,113,227,201,147, 39, 93,154, 52,105,242,104,221,186,117,201, 78, 78, 78,236,168, 81,163, 48,114,228, 72, -216,217,217, 25,215,172, 89,147,216,166, 77,155, 7,177,177,177, 29,139,139,139,239,155,112,126,104,118,118,246,149,141, 27, 55, -222,120,235,173,183, 20,195,135, 15,119,216,176, 97,131,227,227,199,143,235,169, 84, 42,151,204,204, 76,249,197,139, 23,197, 91, -183,110,117,124,248,240,225,115,181, 90,125,131,254,149, 47, 4,254,247,153,171, 42,189, 8,128,172, 50,163,163,125,229,111, 86, - 13,219, 76,253,110,165,255,155,176, 95,149,212, 56,226,102,247, 51,122,101,168, 23, 89,190,112,211,250,207,134, 54,242,151,122, -120, 6,192,168,204,199,253,244,116,108, 77, 43, 80,233, 41,253,102,207, 51,122,174,174, 6,139,199,227,225,196,137, 19,198, 29, - 59,118,232, 40,165, 63, 22, 22, 22,126,254,240,225,195, 98, 83,117, 88,150,229,141, 24, 49, 66,153,151,151,247,107, 90, 90,218, -216,216,216, 88,109,155, 54,109,120,239,189,247,158, 50, 55, 55,247, 55, 66,200,168, 91,183,110,105, 90,183,110,141,218,148, 99, - 66, 8,132, 66, 33, 8, 33,184,121,243,230,243,192,192,192,134,215,174, 93,251, 54, 58, 58,250, 93, 74, 41, 47, 50, 50, 50, 41, - 36, 36,164,241,149, 43, 87,214, 61,126,252,120, 48,203,178, 60, 83,117,203,163, 99, 21,141, 20,195, 48, 47, 76, 29,169,101,155, -107,100,100,100, 84, 96, 96, 96,192,141, 27, 55,182,140, 30, 61,186, 11, 0,217,205,155, 55, 31, 53,106,212,200,255,218,181,107, - 91, 62,248,224,131,174, 40,109,243, 55,237,254,173,211,161,111,223,190,170,130,130,130,227, 69, 69, 69,195,238,223,191,175, 10, - 9, 9, 41, 95,119, 34, 63, 63,127, 88, 45,206,209,130,181,107,215,206, 41, 59, 87, 91, 86,173, 90,245,225,212,169, 83,237, 82, - 82, 82, 94, 24,172,204,236,220,179, 45,123, 76, 48,230,228, 23,104, 55,173,154,246,142, 84, 34, 22,125,190,108,211,121, 61, 15, -215,184, 42,167, 18, 68,198, 66, 80, 38,245,157, 14, 86,226, 53,223,108, 20, 14,239,221, 64, 18,228,239, 94,106,174,132, 86,184, -249, 48, 31,115,190,218,195,126, 57,206, 46, 14, 44,146, 96,196,147, 26, 53,205,248,133, 40,209,103,126,216, 69, 40, 94,250,227, -164,250,173,122,126, 38, 14, 8,106,246,194, 8, 61,142,186,133, 85,139, 39,176, 95,142,181,142, 3, 75, 82, 97,192, 99, 83,147, -107, 48, 24,222, 89,182,108,217,241,225,195,135,203, 27, 54,108,248, 66,243,249,243,231,248,242,203, 47,213, 26,141,230,109, 83, -175, 74, 48,129,193, 70,163,209,254,231,147, 57,222,159, 78, 28, 43,147, 50,185, 64,220,138, 82,243, 34,176, 64,112,144, 45,230, - 76,116, 20, 76, 89,122, 40,240,242,183,245,149,208, 11, 3, 0,164,154,162,206,231,243,143, 44, 89,178, 68, 38,149, 74, 17, 19, - 19, 3,169, 84, 10,137, 68,130,144,144, 16,172, 94,189, 90,246,209, 71, 31, 29,139,136,136, 48, 59,127,254,188,161, 54, 38,171, -133, 31, 9,159,246, 93,236,213,229,159, 88, 58, 54,246,179, 69,118, 17,240,225,220,195,121,185,133,234, 1,181, 49, 87, 21, 77, - 22, 33,164,243,164, 73,147, 78,110,222,188,217, 38, 32, 32, 0, 73, 73, 73, 24, 52,104, 80, 78, 86, 86, 86,251,127,128,185, 2, -128, 98, 0, 46, 0,162, 81,218, 23,233, 41, 33, 68,132,215,120, 61,219,195,135, 15,111, 39, 36, 36, 56,141, 28, 57, 18,133,133, -133, 86, 3, 7, 14,196,179,103,207, 16, 29, 29,125,231,117, 18,170, 86,171,111, 18, 66, 26,125,250,233,167, 67,167, 77,155,214, - 74,161, 80,120, 82, 74,105, 97, 97, 97,156,209,104,188, 12, 96, 7,165,166,191,135,179,204, 48, 61, 37,132,196,197,198,198, 58, -108,217,178,197,178,236, 24, 0,128, 26, 64, 1,128,140,186,154,194,255,199,220,252,155,190,251, 90,142,209,164,229, 29, 79,180, - 26,222,128, 92,120,175, 62,138, 6,215,135,114,184, 23,185,252,118, 3,180,171,238, 59, 0,130, 42, 91,223,180,105, 83,106, 48, - 24,232,201,147, 39,105,183,110,221,138, 91,183,110,125, 57, 36, 36,196,199,148,116,188,170, 25, 17, 17,113, 60, 52, 52,116,192, -171,235,154, 53,107, 54,176,226,186,118,237,218, 69,181,107,215,174,160,109,219,182,207, 76, 73,103,219,182,109, 31,183,106,213, -170,184,109,219,182,143, 43,174, 15, 11, 11,235,211,161, 67,135, 35, 21,215, 53,107,214,172,247,171,235,170,202,123,199,142, 29, -147,162,163,163,105, 98, 98, 34,237,222,189,123,106,249,250,183,222,122, 43,233,238,221,187, 52, 58, 58,154,118,237,218, 53,181, - 54,199,179,226, 18, 26, 26, 58,170, 77,155, 54, 87, 94, 73,243,135,175,174,171, 78,179, 77,155, 54, 87,194,194,194, 62,124,117, - 93,104,104,232,168,186,156,163,138,139,147,147,147,111,112,112,112,230,170, 85,171,104,253,250,245, 51, 43,110,107, 24, 49,226, -139,252, 66,101,225,212, 5,223,239,182, 11,232,219,168,182,121,175,237,242,175,213,124, 20, 32,164,191, 7,180,162, 23, 3,142, - 60,222,230,254,104, 88,103,185, 38,114, 71, 87, 74, 31,127, 70,175,237, 25, 73,195, 3, 68,198,223,191,117,139,166, 23,253,143, -209, 75,190,109,233,177, 6, 34,147, 52, 47,122,181,161, 23,253,143, 61,220,226,254,168,111, 91, 59,237,142,109,235,233,211,167, - 79,233,111,251,119,208, 22, 1,178, 50,205,128,147,244, 98, 64,123,147, 52, 95,190,230, 91,133,135,135, 43,119,239,222, 77, 99, - 98, 98,232,169, 83,167,104,203,150, 45, 85,193,193,193,237, 77,207, 59, 8,189, 16,216,215,112,206,239,242,204, 65,102,249, 31, -118,145,104, 6,181, 23,105,251,132, 11,117,157,155, 10, 13,173, 2,248,198,198,245, 25, 54,192, 13,180,115,136, 84, 67, 47,250, - 93,162,151, 3,186,152,154, 78, 31, 31,159, 68, 15, 15, 15, 90,213,226,235,235,155,213,174, 93, 59,126, 93,206,123,115, 95,184, -119, 12, 19,167,157,249,177, 61,237,213, 86,145,211, 34,136,223,225,117,203, 18,128, 96, 91, 91,219,236,205,155, 55, 83, 7, 7, -135, 44, 0, 13,255, 41,101, 30,128, 53,128, 62, 0,236,202, 62,155,161,116,254,161,250,175,161,217,178,115,231,206,250,219,183, -111,211,103,207,158,209,227,199,143,211, 86,173, 90, 25, 0, 68,252,167,175,247,255, 71,154,255,181,133,252,149,209, 73, 66, 72, - 80,101,157, 13, 67, 66, 66,104,151, 46, 93,212, 23, 46, 92, 80,106,181,218, 49,183,110,221,250,237,117, 53,255,138,116,254, 21, -154, 29, 58,116,184,194, 48, 76,253,178, 33,192,169,167, 79,159,110, 10, 0,237,219,183,191,194,227,241,234,151,153,222,212, 51, -103,206, 52,253,175,229,189, 28,103,103,103, 95,134, 97, 78, 0,208, 36, 39, 39,191, 24,237,100,223,176, 79,184,181,149, 69,251, -252,252,130, 59,233, 15, 14, 30,251, 47,230,253,141,105, 30,247, 18, 65, 33, 10,133, 17, 51, 30, 60, 83,121,126,190, 49,187, 65, -207,206, 45, 5, 91,246, 92,100,151,143,183,143,109, 25, 40,127, 14,194,126, 9,163,230, 6,218,197,107, 76,214,148,145,102,128, - 96,198,221, 88,149,251,212,239,242,188, 59,246,250,144,119,104,239,122,246,171,241, 54,177, 45, 3,205, 18, 1,124, 9, 86,117, -213,100,205,151,175,251, 86, 98,177,248,216,224,193,131,205,118,238,220,169, 46, 41, 41,233,121,251,246,237,115,181,202,251, 85, -255,122, 48,144,197, 0,117, 51,161, 65,254, 41, 12,236, 66,180,127,156,248, 79, 56,239, 45,252,136,187, 92, 33, 62,172,210, 24, - 38,153, 18,185, 50, 69,147, 16, 18,108,101,101,181, 61, 47, 47,111,160, 41,145,171,255,101,222, 9, 33,118, 40,157,136,145,143, -210,105, 11,162,106,234,195,100,130,102,107, 30,143, 55,189, 65,131, 6,141,159, 61,123,246,192,104, 52,126, 69, 41, 61,255,255, -225,222,241,255, 65,243,191,198,223, 98,176,218,180,105, 19,105, 52, 26,143, 11,133,194,197,231,207,159,215,112,133,143,211,228, - 52,235,160, 89,193,100, 69, 70, 23,215, 95,250,115,174,251,228,129, 86,137, 53,153,171, 26, 53,203, 76,214,141, 39, 42,143, 47, -119, 20,185, 79, 25,104,150, 88,147,185, 50, 53,239, 33, 33, 33,173, 36, 18,201, 86,181, 90, 61,170, 38,115, 85,169,230,227, 64, - 33,242,244, 46, 48,240,130,192,160,234, 87,237,176, 84, 5, 1,239, 1,210,144,129,119, 30,234,184,178,196,105,114,154,156,193, -250, 95,243,183,204,122,124,233,210,165, 16,238,208,115,112,188, 38, 93, 99,181, 56,238,117, 11, 10,209,178, 16, 95,233,132, 95, - 23, 75, 85, 96, 73, 50, 8,187,186, 58,115,101,130,230, 13,200,244,203,154,249, 74, 39,237, 95, 44, 85, 1, 72, 7,197,170,234, -204,149,169, 68, 70, 70,254, 14,160,126,157, 5,252, 31,234, 0, 60, 7, 72, 60,230, 87, 51, 59,246, 92, 80,128,235, 60,204,193, -193,241,255,204, 96,113,112,112,188, 65,147,245, 56,240, 38,114,120, 83, 97, 68,125,136, 13, 9,200, 55,164,163,107,188,246, 53, - 53,175, 35,135,124, 2, 22,190, 16, 25, 98,145,175,125, 61,205, 55, 14,165,165, 38,138,131,131,131,131, 51, 88, 28, 28, 28,127, - 5,165, 81,157,228,178,229,159,171,201,193,193,193,241,255, 8, 2, 32,168,242,231, 67,211,219, 86, 9, 33, 65,181,127,254,172, -177,243, 38,167,201,105,114,154,156, 38,167,201,105,114,154,255, 49,205,154,180,255, 43,125,187,254,150, 78,238,156, 38,167,201, -105,114,154,156, 38,167,201,105,114,154,255,101,184, 23,233,114,112,112,112,112,112,112,112,188, 97,254,214, 62, 88, 50, 91, 95, - 39,240,153,198,132,165,254, 0, 64, 25,242, 24, 6,246,158, 42, 59, 58,237,117,181,137, 67, 35,153,153,128,183, 67,169, 55,190, - 71, 51,238,171,222,144, 99,111, 13,192, 29, 64, 2,165,244, 50, 87,124, 56, 56, 56, 56, 56, 56, 56,106,101,176,124, 91,246,187, - 36,151,202,189, 1,128,165, 20, 70, 22, 40,204,203,188,154,112,239, 84, 63, 0,112,110,248,214,126,145,220, 54,156,101, 41, 88, - 74, 97, 96, 41, 12, 26,245,211,172,135, 71, 76,122,243,188,153,189, 95,191,142,157, 59,246,239,217,179,135, 95,163,160, 70, 94, - 0,112,255,193,253,216,195,135,143, 60, 49,179,247,251, 85,153,249,100,255,235,100,204, 76, 32,248, 34,172, 89,243, 46, 55,111, - 94,159, 13, 96,214, 27, 58, 94, 66,122,185,251, 54,210,250,232, 91, 92,209,225,224,224,224,224,224,224,168,181,193,146, 75,229, -222,103, 15,110,180,223,127, 41, 9, 0,208, 49,196, 17,243,191,222,220,151, 16,242, 4, 0,222,254,232,107,223,207, 63, 29,134, - 43, 81, 89,160,148, 34,216,219, 26,125,135,124,100,210,143, 74, 29, 3,195, 6,190,251,238,123, 83,167, 78,233,253,244,233,211, -248,157, 59,119, 94, 2,128, 54,109,219,122, 47, 89,178,228,221, 21, 86,214, 98,169, 99, 96,138, 58,253, 97,157,222, 31,100,230, -232,101, 27,208, 48,244,195, 29, 63,125,197,239,208,125,208, 72, 51, 71,175, 85,202,244,216,236,186,104,137,221, 26,214,183, 16, - 8,231, 19,134,225, 91,216,123,216, 3,128,149, 91,240, 97,231,134,221,140, 18,137,244,126,177, 90,189, 53,243,209,241, 13,220, - 11, 59, 57, 56, 56, 56, 56, 56, 56,106, 52, 88, 0, 96, 38,225,227,201,243,210,214, 58, 75, 25, 48,250,131,183,145,145,145,238, -171, 51,176, 24, 58,176, 31,110, 63, 73, 67,244,243, 44, 80, 10,248,186,154,252, 46, 97,240,192,134,142, 24, 57,162,221,137,147, - 39,111,124,241,249, 23,219, 8,193, 85, 0, 88,255,227, 79,225,115,230,206, 25, 53,244,131,161,157,246,238,221, 27,133, 58,190, -160,145, 17, 90,174,250,114,241,124,179,148,236,146,146,137, 83, 62,227, 77,253,244,147, 21, 0, 62,168,139,185, 10,112,115, 93, -124,233,228, 94,153, 76, 38,195,134, 13, 27,196,192, 65,204,155, 58, 66,210,163,103, 79, 24,193,107,249,213,183, 59, 27,159, 20, -137, 70,218,250,118,234,151, 29,125, 42,141, 43, 82, 28, 28, 28, 28, 28, 28, 28,213,118,114, 55,178, 20,143,227,210,241, 56, 46, - 29,215, 31,103, 65,107,228, 99,197,162,233, 88, 54,111, 26,114, 84,192,129,223,147,240,228,121, 58,158, 60, 79, 71, 78,190, 18, -175, 78,251,247,234, 8,131,175, 63,145, 53, 93, 61,205,226,171,174,161,242, 8,107, 43, 43,171,152, 27,219,138,231, 12,201, 8, -152,255,110,146, 80, 32,113, 72,182,114,168,215,114,207,222,189,129, 14,118,246,114,115,115,139,105,214,254,157, 55, 90,122, 68, - 88, 84,167,249, 39, 83,232,216,176, 93,175, 30,221,123, 56, 58, 58, 24,199,172,190,245, 56,200,223,215,224,227,235, 31, 97,230, -232,215,174,170,239, 84,166, 41,118,107, 88,223,203,201, 97,241,133,227,123,101, 37, 37, 37,120,240,224, 1,114,114,114, 74, 55, - 18, 2,134,225,161,158,139, 19,214, 45,157, 34,155, 55,125, 92,136, 88, 34, 59, 72, 8, 33,166,166,179, 46,112,154,156, 38,167, -201,105,114,154,156,230,127, 85,243, 63,105,176, 8, 33,149, 54,111,197, 38,229,224, 73, 92, 26,154,250,187,192,203,195, 17, 55, - 98,242,176,227,108, 18, 54,157,140,199,217,123, 89, 96, 5, 10,164, 23, 17, 60, 77,200, 64,116,124,118,141,211, 42,243, 68,130, -129,147,150, 23, 76, 13,172, 95,216,226,252,238, 9,112, 54,139, 9,156,254,117,254, 4,158, 72, 48,208,222,209,114,231,212, 79, -198, 14, 81,200,164, 34,173, 70, 11, 79, 15, 55,201,184, 81, 35,134, 11,205,228, 59, 77,205,140,157, 93,160, 92, 36,149,111, 91, - 60,103,138,100,229,254,152,196, 98, 45, 45,222,123, 37,245,217,212, 25,115, 10,121, 2,233,143,118,118,129,114, 83,116,196,110, - 13,235,187,219,216, 44,190,124, 98,175, 76,167,211, 32, 53, 53, 21, 90,173, 22, 6,131,225,143,194, 5,160, 72,109, 64, 92,154, - 26,237,218,182,226, 53, 13,110,232,111,231,223,109, 12, 87,164, 56, 56, 56, 56, 56, 56,106, 79, 85, 94,228, 95,109,176, 42,163, - 88, 93,252,244,253, 49, 83, 51,189, 21,105,218,126,237, 3, 0, 10,100,165,197,227,225,141, 19,136,137, 60,137,162,172, 68, 80, - 10,120,120,212,131, 80, 29,167, 93,255,195,119,153,172,161,228,105, 85,122,125, 58, 59,187, 62, 77,145, 51,203,167,214,187, 26, - 19,157,102, 59,126,234,102,196, 68,167,217, 46,159, 90,239,234,211, 20, 57, 35, 19, 26, 91,126, 48,168, 15,233,211,179, 43,166, - 79,159,138, 62, 61,187, 98,234,216,119,137, 68, 36,104, 97,106,102, 74, 68,146,101, 51,190, 88,160, 72,207,215,105,175, 71, 23, -106,204,100, 50,241,239,143,139, 85, 26, 42,213,245, 30, 56, 58, 75, 35,228, 47, 48,197, 92, 57,153,155, 47,190,114,122,159,140, - 82,138,228,228,100,232,116, 58,232,245,122,232,245,250, 23,251,229, 43,245, 72,204, 82, 35, 33, 83,133, 7,241,133,232,214,181, -171,140, 47, 16, 13,225, 46, 17, 14, 14, 14, 14, 14, 14,142, 42, 13, 86,244,149,253,109, 34, 79,111,115,200,206,200, 40,144,139, -249,224, 51, 12, 50,147,159, 97,235,215,159, 96,239, 55, 83,144,159,246, 20,148, 2, 82, 33, 15, 26,101, 78, 65,218,157, 61, 14, -217,213,140, 32, 36,208,119,250,118,251,115,207,248, 52,106,177,227,184, 82, 0, 0, 59,142, 43, 5,241,105,212,226,219,237,207, - 61, 69, 52, 11,172,209,136,158,125,222,198,182, 45, 27, 16,222,161, 15,246, 94, 76,132, 74,173, 51,233,253,103, 18, 7, 95, 15, -123, 71,199,183, 39, 13,125, 75,209,204,215,202,204,199,205,146,199, 19, 8, 13, 34,129,152, 61,116,171, 32,165, 75,207,126,140, - 76,110,222, 85,226,224,235, 81,157,142,133, 64, 56,255,247,147,251,100, 60, 30, 15,137,137,137,208,233,116,208,106,181,208,104, - 52, 47, 34, 88,133, 42, 61, 82,114,212, 72,202, 82, 33, 49, 75,133, 71,137,133, 16,201,173,160,215,235,131,184, 34,197,193,193, -193,193,193,193, 97,210, 68,163,169,153,185,176, 86,240, 96,231,236,137,247, 62, 89, 1, 0, 48,178, 6, 80,148, 78,207, 96, 74, - 76,143, 66,112,234,227,161,158,113, 30, 78,164, 96, 72, 55,153, 26, 0,134,116,147,169, 61,156, 72,193,199, 67, 61,227, 84, 70, - 43,157,209,104,196,229,168, 76, 44,255,229, 17,190,216,124, 15, 39,110,153,222,103,156, 47,144, 78,250,114,233, 18, 25,159, 71, - 72, 84, 66,145, 50, 45,215,160, 20, 10, 5, 58,129,136,175, 87,106,137, 58, 62,203,152,211,117,192,248,231, 60,158, 96,124,141, -105,165, 44, 40,165,208,104, 52,208,106,181, 47,150,242, 8, 86,174, 82,135,212,156, 18, 36,102,169,145, 84,182,100,228,169,193, - 13, 36,228,224,224,224,224,224,224,120,201, 96, 17, 66,104,101,237,159, 44,128,152,248, 44,136,249, 44, 92,235,121,253,209,145, -157, 2,148, 2,122, 3,107,210, 15, 29, 60,153,154, 92,223,165,152, 78, 91,145, 24, 30,228,111,115,111,220, 96,183,199, 65,254, - 54,247,166,173, 72, 12,175,239, 82, 76,245,172,200, 72, 41, 5,101, 41, 40,165,160, 20, 96, 89,211, 13, 11, 33,188, 22,193,254, -238,252,249, 59,159, 38,140,255, 46,250, 49,225,243,245, 34,145,200,224, 96, 33, 37,174,182, 82,126,145, 6, 37,126, 65, 77,245, - 4,104, 90,157, 78,129, 94, 55,183, 85,151, 1, 42,157,206, 0, 55, 55, 55,104,181,218, 23, 77,132,229, 17,172,124,165, 14, 41, -185, 37, 72,202, 82, 35, 49, 75, 13,117,137, 17,247, 31,199,131, 48, 60,174,211, 31, 7, 7, 7, 7, 7, 71, 29,169,202,139,252, -107, 13, 22,165,148,148, 47,149,237,228,238,230,128,235, 15, 18, 80,207, 65, 12,115, 11, 5, 30,199, 38,131,225,241,193, 99, 8, - 12, 70,211,143, 3,213,234,127, 89, 57,205, 98, 69, 98,154,241,218,119,219,159, 61, 77, 76, 51, 94, 91, 57,205, 98, 5,213,234, -127, 41, 77, 71,233,164,166,108,133,191, 38,107, 83,214,222,214, 66,204,191, 25,171,204, 37, 60,190, 70, 40,224,107,156,108,196, -196,201, 86,202,119,179,145,138,228, 18, 1,227,228,224,192,130, 82,135,234,116, 52, 73, 81,113,233,133,133,179,219,116,126, 91, - 37, 16, 8, 80,191,126,253, 23, 17,172,114,131, 85, 26,193, 82, 35, 49, 75,133,244,220, 18, 72,197, 12,238, 94, 61,163, 50, 26, -245, 91,185,203,131,131,131,131,131,131,163,246,212,228, 69,254,109,240, 77,200, 49,228, 50, 41, 88, 70,130,203,183, 98,225, 31, -208, 24,155,127,187, 1,175,160,230, 72, 43, 50,128,214,226,117,134, 83,214,168,110, 3,184,221,167,179,179,107,191,110, 46,157, - 40, 4,167,190,221, 89,144, 12, 0, 27,195,251,149, 25,171,210,200, 21, 75, 75,167,137, 48,217,245, 2,169,137,153,197,102,158, -142,114, 60, 74,210,106, 20, 50,137,193, 82, 38,228,219, 89,136,120,230, 82, 62,159, 47,100,152,252,252,172, 34,128,164,214,164, -165, 73,138,138, 19,187, 53,156,221,182,219,160,197,151,142,239,150, 53,104,208, 0,119,239,222,125,209, 68,168, 42, 49,128, 20, -233, 32,144, 82,248,184,152,225,241,237, 75,198,156,204,148,135,121,209,199, 55,112,151, 8, 7, 7, 7, 7, 7, 7,135, 73,238, -136,101, 41,236,108,173, 32, 54,179, 64, 92,150, 22, 74,216,161, 64, 77,192, 26, 1,163,161,106, 19, 68, 8,169,180,211,247,193, -147,169,201, 7, 78,102,109, 60,120, 50, 53,249, 21,247,250,162,121,144, 82, 90,105, 19, 97, 85,154,148, 26,143, 29, 62,117, 57, -183,111, 11,123, 75, 70, 32, 80,139,196, 60,157, 84, 34,208,203,196,124,216, 91, 8, 69,174, 86, 66,241,249, 35,187, 24,194,210, -179,166,104,106,146,162,226,158,103,102,206,238,208,115,176,202,193,209, 17, 67,135, 14, 69,189,122,245, 0, 0,214,114, 6,238, - 86, 12,248,154,116, 92,248,109, 99,241,227,200,115,145, 48,106,250, 85,156,205,189,170,116,190, 14,156, 38,167,201,105,114,154, -156, 38,167,249, 95,213,252,175, 97,210,203,158, 27, 56,201,225,237, 34, 71,137,214, 1,106,173, 17,197, 26, 3,138, 84,122, 20, -168,244,136, 79, 87, 33,250,252,235, 39,132,150, 25, 44, 80, 2,150, 82,128,148, 54, 19,154, 26, 40, 44, 22, 20,174,248,114,201, -252, 65,187,247,236,167, 19,187, 59,185, 94,127,170, 78, 18,243, 4, 90,153,152,225,155, 75, 25,227,243,184,231,169, 39, 15,239, -106,168,146,168,134,153,154,166,242, 72,150, 95,211, 14,243, 65,193,215,170, 11,228, 51, 90, 5,226,196,241, 35,106,209,229, 72, - 61,225,139, 30,176, 70,221,246,188,104,238, 85, 57, 28, 28, 28, 28, 28, 28, 28,181, 48, 88, 42,181,234,105,167,254, 31,150,189, -240,153,194,104, 44,141, 44, 25,203,155,242, 88, 10,163, 78,253,244,117, 19, 98,100,217, 27,223,111,254,165,123,147,224,230,188, - 64,119, 5, 10,243,179,113,235,250, 85, 3,101,217,171, 38, 25,180,248,120,141,153,131,255,187, 3,222,238,187,107,228,216,137, -202, 54,237,218,203,108,108,204, 13,217,153, 57,133, 91, 55,236,206,219,191,251,231,134,132,101,223,167,241,241,154,218,164, 75, -147, 20, 21, 7, 96, 72,153, 99,239, 0, 4,182, 43, 78,189,215, 75, 73,255, 28, 9,227,224,224,224,224,224,224,224, 48,201, 96, -197, 92,221,223,230,127,145,144,220,220,140,161,219,119,253,186,232,231,221,191,181,210,232,116, 46, 44,120, 73, 70,189,254,130, -184, 40,103,142,169, 26,202,140,199, 15,137,135, 71,232, 79,223,172,248,244,199,111, 87,190, 5,214,232, 5, 66,158, 19,150,158, - 85, 74, 84, 35,105, 74,237,204, 85, 37,100,147,214, 71, 59, 3,200,230,138, 14, 7, 7, 7, 7, 7, 7, 71,157, 13,214,255,138, -220,216,235, 69, 0, 38,190,174, 78, 89,132,106,105,217,242, 70, 41,123,247, 18, 55, 21, 3, 7, 7, 7, 7, 7, 7, 71,181, 48, -220, 33,224,224,224,224,224,224,224,224,120,179, 16, 0, 85,140,202, 51,253, 77,217,117, 25, 77, 80,147, 62,167,201,105,114,154, -156, 38,167,201,105,114,154,255, 61,205,154,180,107,227, 63,254,209, 6,235,175, 28,252, 70, 8, 9,122,211, 7,138,211,228, 52, - 57, 77, 78,147,211,228, 52, 57,205,255,158,230,127, 13,174,137,144,131,131,131,131,227,255, 29,182,190,189,205,108,125,123,155, -153,186,191, 93,224, 0, 7,187,192, 1, 14,220,145,227, 48, 21, 62,119, 8,222,136,147, 23, 3, 96, 41,165,186,191, 43, 13, 86, - 86,245,205, 13, 10,219,253, 12,171,249,178, 32,233,222,169, 55,157,191,192,192,192, 96, 0,120,248,240,225, 29, 74,233,235,142, -198,132,220,193,111,176,149,185,229, 24, 29,171, 53,170,138, 85,223, 43,211,163,247,190,201, 52,219,217, 5,202,181, 98,233,114, - 16,218, 13, 20, 12,101,200, 25, 94,161,126,114,126,254,221,130,234,190, 87,175,207, 82,255,145,239,244,248,124,227,222, 35,139, - 18, 15,206,124,252,234,118,235,110,235, 20, 19,135,190, 53,237,155, 95, 14,127,153,253,219, 52, 37, 87,250,107, 79,189,214,239, - 89, 26,248,142,188,212,243, 43,114,106,243, 61, 87,191,240, 40,129, 64, 96,167,211,233, 50, 83,162,175,153,212,108,225,230,223, -242, 54,143,199, 56, 27, 13,108,114,210,147, 43,161,220,209,175, 25,153,179,127, 48, 49, 26,167, 83,214, 40, 96,193, 91, 85,146, - 21,115,249,117,244,156,157,157,165, 22, 22, 22,109,205,205,205,221,100, 50,153, 36, 47, 47, 79,157,151,151,151,152,144,144,112, -150, 82,106,248, 59,242,104,215,176,239, 76,190,136,153, 91,246,255,252,172,168, 3, 75,171,223,191,207, 34,194,144,153,101,255, - 47,205,138, 58,248,249, 63,225, 92, 57, 52,234,223, 28,148,253,148, 97,120, 45,141,212,176, 36,243,254,193,239,106,243,253,240, -240,240,190,122,189, 94, 92,254, 89, 32, 16,104,174, 94,189,122,128,187, 10,254, 38,131,229, 26, 56,192, 74,207,167,243,248, 60, -230,109,150, 82, 69,218,157, 61,242,127,114, 6,221,155,191,127,139, 97, 24,215,138,235, 88,150, 77, 78,184,190,237,141, 84,182, -132, 16,215,175, 39,133, 76,207,200, 81, 23, 18, 66, 22, 86,101, 62, 28,130, 7, 95, 33, 12,169, 79, 8, 1, 67, 0, 30, 67, 0, - 32, 53,241,250,246,166,149,104, 58,153,203,249,190,133,197,134, 7,148,210, 26,111, 66, 82, 27, 31,103,185,141,203,133,136,126, - 19, 60,111,157,216, 28, 96,230,224,255,150, 50,227,241,195, 55,144, 55, 59, 47, 47,175, 48, 95, 95, 95,155, 9, 19, 38, 8, 1, - 96,213,170, 85,222,222,222,222, 57,177,177,177, 55, 41,165, 89,117, 50, 87,246,254, 67,215,172, 88,176,173, 91,183,110, 72,205, - 42,198,242, 85,223, 69,152, 57,250, 14,120, 83, 38,139, 56,135, 72, 45,229,178, 7, 31,125, 58,199,181,123,251, 48,126,190, 82, -143,163,103,175, 13,221,187,105,121, 7, 75,203, 38,141,170, 51, 89,172, 42,255,115, 7, 5,237,202,170,242, 1, 96,240,171,219, - 93,204,244, 29,173,101,232,230, 36,230,223, 5,240,107,141, 55,151,176, 15, 78, 8,132, 66,119, 66,152,210,243,206, 35, 96,202, -202,128, 65,175, 77,120,122,105, 83,151,127, 68, 69, 29, 50, 52,157,128,216, 48,101,233, 35, 4, 96, 24, 6,124, 2,128,210,194, -103, 87, 54,219,188,129,242,100, 17,228,109,217,176, 71,171,214, 27, 47,196,229,154,213,107,247,233, 17, 66,153,239, 18, 46,126, -125,215,148,239, 75, 36, 18,171, 67,135, 14,217,117,237,218,213,194, 33,168,239, 5, 83,190, 99, 38,146, 4, 30, 62,252,155,176, -107,215, 46,181, 40,159,126,157,192, 48,219, 9, 32, 96, 89,186,138,199,210,221,202,156,232,216,218, 78, 38,108, 31,212,119, 1, - 8, 2, 76,254, 2,197,163,204, 7, 7,230,212,241,216,242,164,246,126,195,164, 18,201, 84,111, 95,127,223,248,231,207,162, 11, - 11, 11, 86,170, 51,163, 55, 82, 74,217, 90,105, 25,140,147, 78,158,189,242, 14, 95, 32, 32, 93,218,135,201, 9, 33, 93,106,171, -241, 82,217,114,112,232,187,110,221,186, 6,225,225,225, 0, 0,131,193, 96,190,103,207, 30,199,133, 11, 23,202, 77,185,134, 42, -195,197,197,197,197,194,194,162,158, 84, 42,117, 1, 0,181, 90,157, 82, 80, 80,144,152,146,146,146, 82,211,119, 29,131, 7,216, - 50, 12, 22, 28,255,245, 71, 62, 0,116,233, 63,102,145,103,196,103, 86,132, 39, 80, 87,182,191,209,160,149, 51,132,124,122,230, -208,102, 2, 0,111,245, 30, 62,195, 46,112,192, 55, 89, 15,247,100,252, 45, 15,244, 3, 6,240,108, 99,116,125, 9, 37,147, 67, - 66,195, 90,244,239,211, 13,129, 94,206,232, 59,104,220, 84, 0,181, 50, 88,122,189, 94,188,119,239, 94, 87,134, 97,120, 58,157, -174,100,208,160, 65,153,175,147, 54,159,214, 31, 92, 1, 33,110, 58,131,225,167,132,107, 94,139, 40,157,203,190,154,118,167,231, -252,217, 32,204, 40,202,178, 73,105,183,119,182,228, 12, 86, 25,182,190,189,205,120, 98,225,131,136, 54, 45,108,102,142,235, 39, -250, 97,247, 37, 56, 7,191,155,146,122,103,183,203, 63, 53,131, 12,195,184, 30,220,177,206, 94, 42,230, 1, 0,148,106, 35,250, - 15,157, 80,243, 5, 28, 54,228, 60, 8,252,202,219, 80,141, 70,131,132,207, 23,148, 16, 0, 32,165,163, 3,164, 82,209,181,141, -179,195, 11,134,247,170,255,254,244,111,110,111, 1, 96, 9, 32,189,210,139,130, 97, 92,119,109, 90,101,239, 98, 35, 1,159, 71, -160, 84, 27,208,239,253,201,198,202, 12,219,198,217,225, 11,134,118,243, 24,104,223,117, 95,127, 0,199,170,189,129, 56, 6,250, - 43,108,157, 79,245, 31,189,192, 89, 13,115,124,190,104,165,253,149,147,123, 47,117,236,251,161, 46, 49, 57, 89,101,208,233,159, -228,228,166, 77, 41, 74,141,142, 49,181,162, 54, 51, 51,107, 96,102,102,214,164, 91,183,110,146,169, 83,167, 10, 34, 34, 34, 94, -108, 31, 61,122,180,240,252,249,243, 78, 43, 86,172,232,238,236,236, 92,162, 84, 42,239, 42,149,202,103,148, 82,163,169,231,196, -209,209,238,227,183,251,246, 66,135,183, 63,130,145, 37, 24, 53,126, 18, 78, 28,251,117, 44,128, 55, 98,176,204,120,204,252, 81, - 19,102,185,182, 11, 15,225, 47,219,243, 20, 22, 50, 33,186, 52, 15,229,139,121,211,156,118,109, 90,177, 18,192,136,202, 34, 87, -172, 42,255,243, 32, 91,221,160,222, 45,235,227,183, 93,186, 65,174, 29,167,129,145, 89,190,136,100,121,117,155,168,176,146, 74, -214,185, 88,242,236,197,198,204,117, 94,221, 38,158,142, 61,182,182,168,186,180, 8,132, 66,247,141,223, 44,246,177, 54, 19,130, -199, 35,224, 51, 12,120, 60, 2,141,214,136,161,227,102,190,169, 8, 35, 79,106,239,211,157, 1,134, 3, 0, 11,108, 86,103,198, - 28,173,205, 57, 33, 12,207,102,207,166, 21,124,123, 11, 17,120, 60, 2, 30, 83,186, 60, 79, 87, 99,226,103,243, 44, 94,215,168, -119,107,101, 31,118,254,155,118, 93, 90, 4, 89, 55,254,229, 42,177,108,209,109,160, 77,118,137,116,216,174,131,231, 7,213,107, - 59,249, 58,165,236, 87, 73,151, 86,159,172, 78, 71,163,209,100,116,233,218,205,156,240,229,178,211,251,183,180, 45,127,217,188, -222,200,254,241,114,120, 10,148, 63,196,176, 20, 24,253,225, 72,116,233,218, 77,197, 26,216,228, 90, 84, 26,219,143,159,190,108, - 87,162,167,248,122,221,134, 5,197, 5,217, 11,226, 30,219,196,203, 28,124, 63, 85,101, 68,255,102,122,198, 17, 16,125,101, 79, -191, 29,135,175, 34, 40, 48, 0, 70,182,244,253,170,190,174,114,236, 60,114, 13,254,126,254,165,147, 55,179, 20,126,110,102,104, -215,227,253, 58, 30,223, 8,190,220,193,127,103,223,129,195,223,233,247,246, 32, 88,154,155, 65,171,211,248,158, 61,121,236,199, -239,215, 45,111, 69, 8, 25, 86, 27,115,200,178, 70,209, 31,255,235, 37, 0, 4, 0,180,175, 17,193,178, 11, 11, 11,123,241,217, - 96, 48,192,211,211, 19, 41, 41, 41,126,117, 48,107, 50,103,103,231, 30,203,151, 47,183,111,223,190,189,192,206,206, 14, 0,144, -149,149,229,114,238,220,185,166, 77,155, 54,205, 76, 77, 77, 61,146,145,145,161,170,210, 84,176, 37, 66, 30,229,243,196, 98,105, -153,175, 5, 51,117,194,123,141,237,236,236, 42,125, 56,206,201,201, 21,205,157, 59,135,240,249,130,210,253, 41,101, 40,107,172, -242, 29, 35, 45, 91,182,236,173,211,233, 36,149,109,203, 54,216,117, 47, 97, 69, 3, 75,239, 34, 0,159,199,203, 75,189,179,215, -206,100,211,222,184, 79,103, 39, 70,240,125,175, 62,125, 60,250,118,143,128,147,157, 5,206, 94,123,130, 79,102,127, 13,189,193, -184,186, 46,231,135,199,227,241, 51, 51, 51,227,173,172,172, 28,223,192,253,182,254,193, 29,107,237,207, 93,186, 53,227, 27,241, -174,113, 13, 90, 15,215,151,191,254,206,200, 82,248, 73,204, 5,109,251,116, 82,216,184,248, 74, 55,124,179, 76,192, 69,176, 42, -158, 8, 17,111, 97,235,150, 97, 54, 51, 39,141, 20, 45,220,112, 1, 87, 79, 30, 81,167,222,217,243, 70,204,149,194,222, 47,156, -240,248, 99, 8,143, 39, 39, 12, 17,177, 70, 54,201,160,213, 46, 82,101, 71,167,189,174,182,145, 5,246,253, 94, 75, 99, 78,169, -247,143,223,126,109,239, 96, 41,134, 90,107,192,136,143,191,192,250,213, 11, 20,118, 22, 34,104,116, 70,108, 62,120, 51,187,113, -241, 74, 58,188,123,253,247, 23,111,140,250,245,171,237,143,127, 45,189, 86,171, 40,120,132,129,189,133, 24,139,118, 62,129,185, - 76, 0,107, 51, 17, 24,166,114,115, 53,188, 87,169,102,126,145,214, 64, 8, 17, 81, 74, 43,173,220,204,156,130,218, 40,236, 92, -247,246,251,112,129, 93, 76, 22, 1,165, 90, 60,179, 16,163,255,208,113,150, 94,142, 82,200, 37, 60,196, 39,165,121,126, 54,109, - 90,168,196,201, 63,172, 36,237,113, 98, 77,217,246,240,240,232,223,179,103, 79,217,148, 41, 83, 4,110,110,110,216,190,231,132, -123,167,119, 38,246, 74, 73,207,113, 99, 41,224, 96,111,157, 52,114, 96,247, 67, 71,143, 30, 77, 72, 74, 74, 18, 44, 95,190,188, -249,254,253,251, 3,107,243, 36,106,164, 20,106,173, 17, 70, 35, 11, 35, 75,144,149,175,169,195, 77,133, 48, 85, 63, 85,211, 62, -157, 35,154,241, 87, 29,120,134, 34,149, 30, 82, 33, 15, 79,211,138, 17, 30, 30,198,223,189,153,180,175,236, 27, 35,223,233,241, -185,131,130,118,237,221,178, 62,236,173,100,216,244,205, 98,252,118, 37,174,107, 70, 17,129,109,239,229, 99,156,196,252, 78,118, - 50,225,186,136, 80,111,199,183, 66,220,113, 43,212,219,241, 98,228,227,232, 70,239,174,156,144,162, 20,156,206, 61, 54,161,168, -170,243,110,109, 38,196,134, 19,241,144,139, 5,144, 75,248,165,139,152, 15,134,121,189, 23,198, 75,157, 3,221,120,172,113,164, -185,115,224,200, 65,239, 14,112, 30, 60,232, 29, 74, 24, 30,246,252,122,168,207,207, 63,111, 79, 51,115,244,219, 96,100,120, 27, -213,169, 15,147,106, 62,158,128,189,133, 8,159,253,244, 0, 10,153, 0,230, 50, 1, 20, 82, 1,222,106, 98, 87,231,116, 18, 66, -172,198,246,105,208,253,222,182,142,237,253,234,153,249,220,141, 45,120, 56,114,209,173,213,231,243,219, 79, 90,183, 42,208, 70, -148,167,225,127, 49,245, 67,126, 74,106, 90,251, 61,135, 46,116,112,110, 54,242,137, 65, 87, 60, 43,243,238,238,131,149,233, 37, - 61,190,210,212, 53,124,128, 68,167,212,223,191, 27,157,236,149, 91, 34,194,195,132,194,178, 99, 42,128, 89,249,177, 45, 59,190, -105,201,241,200, 85,241, 46,167,216, 48,237,233,249, 43,181,106,138, 82,235, 88,220,141, 83,194,195,183, 41, 28,157,156,161,237, -254,158,199,141,179,251, 14,202,157, 2,150, 22,167, 61,154,101,170,206,142,195, 87,177,112,233,234, 24, 16, 60, 42,187,155, 7, - 76,153, 60,193,231,235,149,235, 94, 90, 55,238,163,241, 62,117, 53,215, 50, 7,191,159, 59,246, 30,246, 78,227,230,157, 16, 19, -251, 12, 49, 81,183,240, 86,199, 46,232,214,179, 31,180,154,146,247, 55,254,184,238, 38,128,111,255, 84,231, 58, 5,180,110, 20, - 20,240,179,179,147,179, 27,165,101,175, 38,163, 20,237,219,183,199,180, 79, 71, 65,165, 44,130,159, 95, 80, 43,203, 54,157, 53, - 93, 7,126, 12,150,165,200,201,201, 46,126,242,248, 97, 71,117,198,227,235,166,166, 81,165, 82,233,179,178,178,112,231,206, 29, - 68, 71, 71, 35, 42, 42, 10, 57, 57, 57,176,176,176,168, 85, 19,187,149,149,149,121,104,104,232,123,187,119,239,150, 88, 88,252, -225,249,181, 90, 45,100, 50, 25,250,246,237, 43,104,221,186,181,203,240,225,195, 63,176,178,178,218,145,151,151, 87, 88,169, 97, -186,119, 56,213,177, 81,223, 31,186,191, 51,122, 28, 0, 8,197,102,113,107,126,250, 53,170,186,223, 22, 74,204,221, 59,246, 29, -225, 5, 74, 65, 8, 89,147,253,248,215,244,170,246,213,233,116,210, 95,126,249,197,133, 16,242,210,253,117,193,218, 95, 90,222, -143, 73,235,248,253,188,233,124,133, 92,140,236, 2, 45,198,140,155, 96,107,178,185,106,212,103,124, 88,211,166,223,126, 49,117, - 20,228, 50, 41, 78, 94,123,134, 79,103, 46, 53,228,102,103,110, 3, 33,171,178,162,246,191,110,171,197, 27, 25,241,230,227, 98, - 6, 69,151,112,201,168,119, 35, 36, 90,189, 17,121, 74, 61, 52, 58, 35, 88, 74, 81, 80,172,199,195,132, 34,216, 90, 8,177, 1, -255,125,106,101,176,248, 2, 81,207,137,195,186,139, 86,236,184,142,171, 39,119,168, 83,111,239,145,149,111,115, 11, 29, 20,151, -116,107, 87,253,151, 61, 74,205, 35, 12,164,206,129,110,124,194, 91,217,178, 77,203,206,163,199,140,163,141,253,220,133, 0,131, - 71, 49,207,245,155, 54,110, 24,102,225,214,104,117, 97,242,131,207,203,111,166,181, 29,181,192,178,108,242,171, 17, 43,150,101, -147,107, 74, 39, 33,128,165, 92,128, 31,142,196,149, 62, 25,131,194, 66, 38,192,206,115,201, 40,204, 77,201,110,172, 94,249,251, -200,238,246,189, 23,109,124,120,240,187, 67, 25,145, 0,162, 40,165, 25, 85,105, 18, 6,224,243, 8, 44,228, 66, 88,200, 4,176, - 48, 19,128, 33,164, 74,115,245,197,143,247,182, 0,120, 82,209, 92, 85,212,148, 59,248, 53, 52,183,243, 56,240,246,216, 37, 86, -247, 19,117, 96, 24,160,190,163, 28, 86,102, 34,104,245, 64,124,150,174, 44,175,230, 24, 63,101,158,221,140,201, 99,143, 18, 18, -209,152,210,243,134,234,242,174, 82,169, 68, 67,135, 14, 21,232,245,122,221,240, 79, 22,117, 78,203,200,238,179,122,201,103, 98, - 91, 91, 27, 20,151, 24,112,231, 81,124,192,210,175,190,169,127,236,252,141,253, 51,198,246,249,173,107,215,174, 22,191,252,242, - 11, 91,155,243,158,149,145,253,205,230,237,123,183,173, 90,177, 20,143,227,115,177,233,199,239, 64,141,134, 31,170,247,187, 47, -107,174, 95,191,222, 62, 60, 60,156,185,118,237, 90,206,171, 6,148, 16,200,115, 11, 52,176,148, 11, 33, 19,243,225,104, 41,134, -141, 66, 8,177,144, 1,195,252, 81,137, 84,212,220,184,247,200, 34, 86,149,143,223,118,233, 6,109,250,102, 49, 70,124, 60, 27, - 15,178,133,199, 25,153,229,162,143, 7,246,153,110, 45, 67, 55, 23, 75,198,254,173, 16, 15,200, 37, 66,204,156, 56, 20, 97,145, -241,246,201,249,236,236, 92, 21,154, 0,248,188,178,116, 50, 60, 2, 62,143,129, 66, 42,192,249, 35, 59, 51, 85, 69, 5, 5,132, - 87, 26, 97,209,107,117, 9,166,121,253, 63, 31, 79,185,131,223,140,144,224,198,139,199,141, 30,201,180, 10,111, 70, 25,134,143, -236, 66, 29,161,160,152,244,241, 88,140, 31, 59,202, 49, 57, 37, 99,206,183,223,173,255,220,204, 62, 96,161, 50,243,209,188,234, - 52,121,132, 1,195, 16,200,165, 2,152, 73,254, 88, 74,180, 44, 8, 1,207, 53,100, 80, 1, 8, 64, 8, 73, 77,186,185, 51,192, -148,116, 58, 55,234,118,230, 66,166,208, 95,117,180,228,234,211,152,219,139,110,220, 75,188, 65, 41,205,173,215,110,242, 7,122, - 61,133,178,196,128,231, 25, 42, 24,180,148,140,232,234, 14,207,119,136,223,146, 77,183,183, 17, 66,204,203, 35, 46,175,106, 38, - 95,221, 83, 98,219,168,255,192, 85,107,215,223, 92,177,120, 54, 47,167, 80, 11, 35, 5,164, 34, 30, 36,101,139, 84,200, 67, 73, -113, 1,190,253,225,167,116, 3, 72,127,122,190,250, 50,255,231, 74,131, 14,233,223,189,237, 46, 2,136, 8, 35, 76,118,118,247, -112,239,208,115,152,228,173, 94,239,195,104,208,205,144, 59,248,159, 43,206,120,124,198, 20,205,160,192, 0,128,224, 81,230,253, - 3,253, 75,111,146,125,127,245,247,243,247,121,117,157,183,183,175,143, 41,231,189,252,225, 66,106,231, 51,218,219,191,209,180, -113, 95,172,247, 72,205,209,192,202,197, 27,119,110, 71,226,196,158,111,111,171,139,242, 86,156, 56,188,127,218,194,101,171,155, -244,236,251, 46, 14, 30,216, 61,133, 16,242, 29, 45,229,133, 38,101,217, 33, 91, 54,172,119, 19, 8,197,208, 27, 41,244, 6, 22, -122, 35, 11,189,129, 34, 45, 45, 21, 69, 74, 37, 36, 82, 5,228,230,214,208, 27, 74, 35,133, 26,141, 94, 62,246,253,158,227, 1, - 92,175, 44,157,158,205,135,222, 2, 67, 92, 75,215,151,153, 19,198, 74,229,228,228,180, 13, 0,196, 98, 49,196, 98, 49, 12, 6, - 3,238,167, 98,146,115,216,144,153,160,101,119,118,150, 77, 78,187,189, 51,180,170,188,187,185,185,245,170,204, 92, 41,149, 74, -252,126,243,158,197,230, 95, 78,118,141, 79, 74,111,192, 26,237, 53, 82,199, 38, 93, 0,244,170,234,120,166,223, 63, 48,190, 94, -196, 36,102,202,184,161,222,107,126,218,123, 35,230,248,194,106,195,201,245, 59,206,208, 78, 27, 63, 56,244,203, 53,155, 98,146, - 47,172,254,180,166,115, 36, 20, 10, 5, 89, 89, 89, 47,174,239, 5,235,246,117, 75,204, 40,236,248,213,226,217,194, 59,207,148, -184,247, 60, 13,195, 58,185,155,124,189, 59, 53,236,231,231,238,225,182,122,245,194, 79, 16,157,170,198,186,125, 55,112,225,200, -182, 72, 93, 73, 81,143,204,168,223, 50,235, 82,135,188,174,193,170, 76,179,252, 70,112,238, 94, 54,138,212,165,198, 74,111,100, - 81,164, 54, 32, 51, 95,131,130, 98, 61,148, 37,122, 12,235,232, 94, 23,191, 18, 6,192, 14, 64, 22,128,155,175,124, 70,217,255, -168,228,115,118, 89,196,208,166, 44, 18, 43,170,160, 89,254,185,170,245,229,223,127, 8, 32,160, 76,211, 8,224, 6,128,188, 26, - 61, 19, 33,132, 82,250,199, 43,149, 95,253,252, 82,228,193,160,119,117,118,114, 2, 75,147,203, 35,156,165, 81,143,230,131, 84, -159,142, 30, 32,117, 14,126,167, 56,245,206, 94,147,251,100, 41,236,125, 91, 74,165,178, 35, 75,151, 45,167, 3,123,181, 19,165, - 23,232,213, 15, 83, 74,178,148, 26,106,112,180,243, 18, 47,251,242, 75,179, 37,203, 86,124,180,255, 87, 54, 31,192, 87,149,134, -159,195, 6,223, 34,132,113,101,254, 8,203,131,178, 52, 57,249,230,142, 80, 0,120,157,190, 86,197, 37, 6,240,120, 4,130,178, - 62, 41, 42,173, 17,170,252,244,156,198,170,213,191,143,236, 90,106,174,174,167, 56, 62,227,241,178,116,148,210,106,155, 32, 24, - 66, 80,168,210,195, 92, 42,128,133, 92, 8, 75,153,240, 69, 4,171, 10,115, 21, 85,157,166, 80,167, 75, 50,234, 53, 37,212,104, - 68,247, 48, 59,216, 91,136,224,100, 37,134, 68,196,135,222, 8,168,181, 44,212, 90, 35, 18, 50, 85, 40, 82,137,209,168,221, 32, -111, 91,167,235, 42, 91,143,176, 45,217,241, 55,199, 84, 27, 97, 50, 26,241,243,222, 19,222, 41,105,153,125, 14,110, 95, 41,206, - 44,208,227, 94,188, 18,153,121, 90, 80, 98,129,153,159,127, 46,254,226,139,185,253,118, 31, 56,243,188,101,168,111,114,173,143, -107,230,227,237,141, 91,245,248,166, 71,175,190,138,135, 55,142, 33,230,206,153, 47,148, 25,181,235,127,229,238,238,110,252,246, -219,111, 45,127,248,225, 7,111,123,123,251,164,204,204,204,184,242,230, 40,207,192,240,212, 83,103, 47,218,180,107,213,150,159, -148, 93, 2, 91,133, 16,238, 14, 50, 68, 94, 57,167,101, 8, 57, 94,153, 94, 89, 51,224, 96,215,142,211,240,219,149,184,174, 81, - 57,226,243, 31,142, 26, 17,127,234,200,141,156,181,219,207, 44,119, 49,211,223,149,176,153,235, 34, 67,189, 29,103, 76, 24,138, -165,107,183,227, 66,228,227,204, 98,198,121,113,154,198,112,106,238,160,202, 91, 59,120, 12, 32,224, 19, 40,164, 2,168,138, 11, - 10, 30,156,254,206,247, 13, 61, 28,125,112,226,192,118, 38,183, 72,143,228,108, 53, 73,205, 41,130,129,101, 97, 41, 23,193,192, - 2,249,185,217,228,231,159,183,227,230,205,171, 12,120,204,135, 0,230,213, 20,193,226, 49, 4,102, 18, 62,204,164,165, 81, 32, - 51, 41, 31, 58, 3, 11,159,250,110, 88,189, 96,162,185,157,189, 3, 58,247, 31, 99,122,132, 77,110,213,100,235,247, 11,113,254, -234,221,136,115, 79,119,134,217, 7, 53, 89,235, 26, 56, 96, 5, 99,237,172,214,232,141, 40, 44,200, 67,137, 38, 9,205, 92,178, - 97, 45, 55, 34,190,208, 9, 15,210, 99,204,106,106,206,202,190,255,235, 29,187,160,126,159,239, 57,116,118,105,151, 78, 17,136, -122, 94, 88,106,174,132,165,230,138, 79, 88,172,252, 97,189, 62,175,160,168,103,246,131, 3,217,117, 40,159,167,203, 42,227,210, - 72,177, 67, 3,187,159,215,125,190,117,212,180,229, 93,186,244,251,128, 60,184,121,110, 22,128, 51,166, 70,207,255,188,142,154, -180,174, 42,115,101,239, 21,186, 99,243,150,157, 3, 3,125,220,144,145,175, 71,106,158, 14,151, 34,159, 98,255,250, 89,249,249, - 25,207,134, 64,167, 84,178,196, 80,112,242,196,161,227, 31, 77,156,134,134, 13,155,120, 20, 38, 23,154, 3, 40,120,233,102,200, - 35,235,223, 31, 57,118,160,131,189,131,130, 45,139, 96,177,148,194,207, 47, 16,221,123,245,199,249,139, 87,240, 48,234, 94,233, -122, 22,160,148, 34, 63, 47, 39,221,160,215,110,169, 50,125, 60,226,186,249,135,149,246, 12, 1,116, 6, 22, 90, 61,139, 25, 51, -191,208,126, 50,103, 93,235, 46,173, 26, 71,241,192, 22, 38,166,229, 91,222,124,146,214,136, 8,204,157,222, 27, 61, 93,168,214, - 25, 81,168,210,227,204,158, 53, 85, 55, 51, 54,104, 18,238, 25,208,122,228,232,217, 63,136,197, 60, 70,215,208,215, 45,174, 93, -139,134, 73,245,156,109,139,150,172,249,185,217,149,200, 39,221,251,191,221, 79, 50,176, 65, 32,113,182,145, 40,198,142,159,208, -216,209,167,245,251,233, 49,151,183, 85,121,243,227,139,243,221, 92,221, 94, 52, 37,218, 7,245,189, 7,224,213, 59,127, 66,230, -131, 3,141, 1,192,222,193,177,132, 8,196, 69,181, 48, 32, 20, 0,230,175,221,219, 61, 57, 75,249,206, 87,139,103, 11,239,196, - 21,227,206,179, 2,136,132, 60,104,116,166,119,107, 51, 18, 58,105,250,132, 17,130,220, 98, 3,206,221,203,194,131, 91,103,169, - 65, 87, 56,140, 18,254,112,187,160,190,239, 19,192,147, 2,207, 25,130, 31,181, 12,182,228,223, 61, 80, 80,215, 8,150,125, 96, -255,150,132,135,238, 60,190, 48, 12, 96,253, 13,122,189, 61,195,227,101,167,223,221,235, 80,139,188, 67,149, 25,131,229, 75,230, - 96,245,134,253,184, 17,157, 11, 11, 67, 18, 14,110, 90,140, 41, 75,127,134, 74,107,172,170,124, 87,231, 71,236, 8, 33,135, 41, -165, 61, 1,116, 4, 32,170,240, 25,132,144,195,101,191,253,210,231, 25, 51,102,204, 90,186,116,105, 84,249,190,229,235,203,247, -173,110,125,133,239,219,204,156, 57, 51,104,217,178,101, 75,194,195,195,119, 93,185,114, 37,206, 36,131, 85, 49, 19,132,144, 42, -175,114,135, 70,125,154, 1, 12,207,209,198, 12,222,245,221, 32, 31, 48, 92,234, 26, 50,176,152,199, 99,152, 45,171,103, 73,114, -212,124,240,121,188, 98,147, 43, 95, 7,255,230, 10,133,226,232, 47,187,247, 81, 31, 15, 71,209,190,107,249,137,145,113,170, 23, - 33,221,194,172, 4,145,183,181,134, 55,240,221,254,242,227, 39, 79, 77,170,202, 96, 17,194,184,174, 93,249,165,189, 66, 42, 0, - 67,128, 66,181, 1,147, 38, 79,127,237,187, 23, 5,229,141,159, 60, 23, 12, 41,189,249, 40, 11,114,177,120,213,102,101,127,215, -179,151, 71,118,181,237,189,104,227,195,131, 39, 31, 73,159,246,235,215,161, 32, 62, 62,190,198, 3, 77,168, 49,249,157, 15, 62, - 17, 50, 76,105,179, 17, 33, 4,128, 49,163, 46,230, 10, 0,242,242,226, 10,165,142,141,251,109, 95, 57, 97, 67, 61, 87, 23,107, -133, 76, 2, 51,185,152,248,251,121, 73, 90, 52, 15,151,186,123, 53, 20, 94,124,164, 68, 98,150, 26,207, 82, 10, 33,182, 11, 18, - 12,140,232,132,237,107,166,119, 55, 37,255,103,175, 62,232,245,221,138,217,226,140, 60, 29, 30, 37, 21, 33, 61, 87,131,244,188, - 18,164,231,105, 96, 38,225,163,197, 91,253,197,191,157,217,219,183,101,168,239,218,186, 28,223,103,177,113,251, 19, 82,210,134, - 53, 14,110,134,159,183,110,110, 65, 92, 93, 37, 52, 57,185,196,212,239,111,216,176, 33,183,105,211,166,182, 95,125,245, 85,177, -159,159, 95, 19, 63, 63,191,250,209,209,209,231, 27, 52,104,208,235,251, 53, 11,207,127, 50,123,133, 59, 31, 6,139, 22,173, 90, -241,100, 34,130,107, 23, 79,106,182,108,248, 33, 85,151,175,156, 86,173, 17,150, 89, 46,202, 40, 34,176,115,118,123, 32, 23,232, - 59, 11,100,186,232,220,109, 19,182, 3,248,213,171,219,196,211,231,110, 61,137, 14,137,140,183, 63, 27, 25,157,153,171,210,251, -198, 30,155, 92,109,133,203, 35,101, 17, 44,217, 31, 17, 75,135, 38, 3,158, 82, 66,236,202,141, 13, 65,105, 68,139,148, 62, 31, -164, 38, 71,254, 98, 66,199,104, 66, 89, 22,136, 78, 86,162, 72,109, 64,137,222, 0, 55, 91, 57,178, 50,146,241,253,218, 45,184, -125,235, 38, 58,119,235,141,111,127,250, 25,163,222, 31, 80,227,113,101, 24, 2,134, 33,101,145,171, 82,115,101, 38,225, 3, 4, -200, 47,214,227,215,203, 73,240,170,207,128,212,162,181, 80, 97, 38, 69, 65, 81, 9, 24,129, 25, 30, 95,218, 38, 59,118,246,198, -204,121, 43, 54,126, 86,168,204, 72,140,125,120, 21,126, 86, 57,168,239,172, 69, 84,134, 5,110,229,122,192,207,171, 1, 24,225, - 77,147,180,179,163, 26, 45,255,141,217,215, 51, 44, 56, 48,188,158,189, 5,212, 90, 99, 89, 20,139,143, 45,155, 55, 35,254,121, -242,200,236,168, 3,183,223,132,147, 85,102, 60,203,146, 56,248,124,116,255,218,153,184,190, 67,198,195,209,165, 94, 19,211,187, - 39,152,102,166, 88, 19, 12, 22, 33,132,177,246, 8,222,186,117,251,158,129,245,235, 57,226,212,141,231,184, 29,155, 7,115,133, - 37,120,114, 39,248,182, 27,110,121,255,248,154,183,213,217,202,173, 2,161,236,195,102, 45, 90,129, 82,138, 39,143,163,114, 11, - 10, 44,254, 84, 55,171, 82, 31,223, 1, 96, 94,113,157,204, 46,160,137,194,194,250, 78,137,206,136,148,148,100,252,126,229,124, -211,178,253, 76, 70, 44,100,112, 50, 50, 19, 58, 3, 11,157,158, 69,211, 70,254, 37, 2,161,180,205,151, 27,142,180, 72,207,200, -100,100,102, 22,172,133,109, 3,161,165, 62, 93,115, 55,174, 64,168, 51,176,104,224, 84,253,115,185,204,186,193,146, 79, 39,127, - 18,192, 23, 73, 81, 88,172,209,166, 37,167, 56,254,184,243,156,242,209,147,135, 46,158, 30,245,204, 23, 46,156, 39, 44, 44,161, -200,204,215, 32,187, 72, 71,222, 29, 60,210,121,219,166,111,135, 0,216, 86,139,164, 55,218,181,237, 7,189,181,153,144, 20,169, -244, 52,171,176,196, 56,254,163, 73,141, 94,167,236,188,100,174,158, 21,227, 78, 92, 62,196, 66, 30,196, 66, 30,244, 6,211,186, - 72,218, 5, 14,144,219,217, 89, 14,105, 30,236,141, 19,145, 89,224,243, 8,212,197,133, 90,137,216,236,129,191,191, 15, 19,220, - 36, 8, 17,173, 91, 34, 54, 46,222,239,196,169,179,171,110,220,188,189,216, 46,168,223,180,172, 7,251,191,173, 77, 90, 19, 82, -178,228, 25, 6,183, 65,246,142,182, 65,189,123,247, 18,215,115,113, 32,182, 54,150, 48, 66,136,113,227, 63,182, 55,185,213,136, - 82, 80, 0,203, 22,204,132, 70,171,133,189,165, 8,148, 2,155,214,205,135, 86,171,133,179,141, 4, 5,197,250,234,202,121,181, -126,164, 50, 67,244,170,209, 42,255,191,124,191,165, 75,151,246,124,197, 0,246,172,194, 24,254,105,191,242,239, 47, 91,182,108, - 73,133,237, 42,147,155, 8,203, 51, 83, 85,166,236, 26,247,107, 37, 21,203, 79,126,187,116, 18,147, 95,172,131, 88,200,160, 65, -125, 79, 76,152,248,137,236,173, 96,123,168, 97,142,125, 59,183, 20, 26,140,250,195,166,252,168,204,209, 39,212, 76,166, 56,190, -105,235, 78,214,209,222,150,252,120, 58, 43, 46,171,208,240, 98,138,131,232,235,191,177,183, 78,252,232, 68, 65,142,203, 36, 82, -111,141, 86, 99, 85,229,141,161,236,132,110, 58, 25, 15, 30,195,128,247,134,102,246, 98, 24,198,248,211,218,133,176, 53, 47,237, -115, 53,127,245,246,162, 94,118,199,207, 86, 52, 87,193,193,193, 5, 77,154, 52,201,103,152,154,127, 52,241,198,207, 45, 43, 41, - 40,117, 50, 87, 47,250,137,164,223,187,137, 87,102,226, 39, 36, 68, 96,235,185,103,202,160,247,134,204,116,104,216, 75,241, 60, -173, 0, 34, 70,143,176, 0, 39,156, 63,241, 43,155, 20,247,104,172, 41,218,153, 57, 5,110,182, 54, 54,184,253, 76,137,212,156, - 18,164,229,150,154,171,244,220, 18, 20,170, 13, 8,246,180, 71,126,129,210,173,206, 6,150,208, 3, 39,142,159, 24,214,173,207, - 64, 76,248,108, 94,183, 13,223,125,125, 79,234, 16,240,190, 58,227,209, 13, 83,190,191,103,207, 30,163,135,135, 71, 92,118,118, -118,216,180,105,211,138, 60, 61, 61, 29, 23, 46, 92, 56,186, 65,131, 6,206,111,181,111, 95,112,243, 92,139,173,159,124, 54,175, -253,172, 79, 54,212,103, 24, 38,131,178,244,183,212, 98,253, 92,154,245, 80, 93,237,121, 58, 56,243, 49, 9,156, 63,236,173, 54, - 54,191,217, 72,153, 64, 1,209, 12, 38,129,243,119,211,135,115,117,177,199,214, 22, 53,122,119,229,132,148,124,118,118, 9,227, -184,184, 38,115, 85, 26,193, 34,208,234, 88,152, 75, 5,229, 35, 71, 1, 10,167,239,214,125, 45,179,179, 16,131,207, 35, 16,240, - 24, 20,168,244,200, 41,212,226,179,105,211, 76, 61,130,172,145,101,161,210, 24,161,214, 26, 64, 64, 80, 84,152,141,153,159,125, -138,110,189,250, 99,228,216,201,200, 87, 3,183,226,138,160,211,235,107,180, 69, 60, 2,168, 52, 6,140,236,226,142,156, 34, 29, -138, 75, 12,208,234, 88,200, 36,124,240,249, 12,228, 98, 62, 20, 82, 1, 8,161, 66, 39, 39,167,209, 0, 32, 16, 8, 74, 18, 19, - 19,183, 87,221, 60, 79,225,225,230, 0,181,142, 65,179,129, 43,208, 49,220, 23,119, 78,109,228, 95,188,126,191,254,103,243, 86, - 97,252,224,112,236,125,226, 5,107,123, 15,152,201, 36,208, 83, 6,128,105, 83,128, 80, 58,151,117,242,239, 63,248,135,159, 54, - 61, 89,240,197,116, 73, 94, 49,129, 88,200,199,217,179,167,113,245,250,173, 53, 89, 81, 7,182,191,201,190, 20, 2,202, 56,152, - 91,152, 67, 34,226, 65,167,211,152,220,225,219,200, 82,128, 34,192,190, 81,223, 95,203,206,125, 0, 91,201,186,154, 34, 88,132, - 16, 98,225, 28,180,249,135, 13, 63, 15,113,114,180,199,254, 51,247,176,117,195, 55,112, 9,234,134,167,145, 63,192, 45,164, 47, -204,234,119,128, 72,177,103, 52,195,227, 55, 26,255,201,204,254, 33,161,225,184,114,233, 28, 50,211,211,126,160,244,177, 73,125, -208,120, 2, 50,177,125,199,158,208,232,140,104,211,161, 39,142, 31,218, 63, 1,101,131, 39,234, 10,143,199,176, 31,143, 26, 36, -200,204,215, 10, 50, 11, 52, 72,201, 86, 35, 46,189, 24, 7,127,217,104,114,147, 20,225, 49, 97,237,154,184, 10, 70, 47, 63,155, -228,230,234,164, 17,104,212,210,232,216, 88,255, 15,135, 13, 17,120,122,251, 49, 89,249, 26,100, 21,104,145, 85,160, 69,113,137, - 30, 94,206,245, 24,141,129, 31, 94,219,180,218, 91, 72, 4,223, 30,142,131,185,140,143,150, 1, 54,117,238,132,205,178,236, 31, -230,106, 81,105,228,234,110, 92, 1, 36, 66, 30, 68, 2, 30,196, 66, 6,122, 35, 53,241, 94,100, 24, 52,102,216,187, 82,173,158, - 34,187, 80, 11, 30, 67,224,104,107, 35,118,115,242,197,166, 21, 31, 3, 0, 70, 77,255, 14, 31,142, 24, 10, 63, 95,111, 20, 20, - 20, 73, 63, 28,247,201, 74, 84,210,239,174,170, 72,219,207, 7, 47, 6,222,122,144, 48,229,131, 97,239, 11, 6,246,110,203,220, -126, 86,136,180, 92, 13,158, 61, 85, 65,171,175,221,108, 52, 6, 99,105,155,239,230,221,135, 33, 19,242,144, 85, 80,122,185, 44, - 90,183, 27,102, 82, 62,210,243,180, 96, 89,182,186,244, 84,235, 71,170,138, 58,213,134,138, 38,172,186,245,132,144,195, 51,102, -204,152, 5,128,206,152, 49, 99, 86,249,231,165, 75,151,170, 1,164,154,100,176,202, 51, 85,169,123,110,220,175,149, 84, 36, 57, -185,109,221, 44,233,153,104,138, 53, 39, 35,209,189,133, 19,132,124, 2,137,153, 35,238,196,229,227,204,153,131, 69,151,174, 94, - 47, 33,140,190,198, 97, 81, 50, 39,191,166, 50,137,226,244, 55,235,183, 26, 28, 28, 29,177,243,114, 94,106,142,210,160,255,163, -121, 74, 79,110,157,248,177,190,129,213,119, 85,167,199,212,248, 56,203, 82, 42, 92,250,253,111,160,148, 2,172, 17, 44, 88,240, -132, 98,185,123,243,161, 25, 32,128,209,200, 74,248, 60,166,228, 69, 59, 72,233,173, 41, 57,225,250,142,106,155, 14, 9, 0,115, -153, 0,191, 92, 72, 70, 65,110,106,118, 47,187,227,191,151,155,171,227, 81,226,167, 33, 33,193, 5,205,155, 55,207, 23,139,197, -224,241,120,117, 57,193,175,101,174,170, 46,156,145,122, 0,203,156,253,219,246,238, 38, 15,106, 46, 34, 2,132,248, 59,225,252, -201,253,236,213, 99, 27,251,169, 50,162,143,152, 26,226, 85,150, 24,144,154,171, 70, 74,182, 26,105,121,101, 17,172, 92, 13, 8, - 1, 74,180,175, 55,125,141, 42, 35,250,144,153, 75,195, 31, 52,122,140,109,211,185, 47,166,204,251,198,123,251, 15,203, 47,201, -237,125,194,138, 51, 99,238,155,162, 17, 31, 31,175,113,112,112,184, 93, 84, 84,212,105,229,202,149,202,128,128, 0,145, 84, 42, -205, 1, 32,137,121,242, 68,120,246,232,158,231, 89,169,169, 99,116, 58,221, 77, 83,211,229, 17, 49, 92,236,111,158, 59,218, 93, -214,178, 75, 3, 71, 25,220,101,197, 93,252,205,238,126,101,255,214,164, 37,153,103, 86,103,166,105, 12,167,114, 85,104,146,162, - 20,156, 54,169,178,209,105, 19,222, 27, 51, 3, 60,134, 64,167,209,190,232,147, 97,103, 33,198,188,237,143,160,144, 10, 96, 38, - 21, 64, 33,229,163, 85,128, 13,106, 17, 32,162,122, 3,133, 90,107,128, 90, 99,132, 90, 99,128,109, 61, 75,252,180,109, 47, 18, -179,212,248,237,102, 54, 30,199, 23,194,215, 77, 14, 74,107,142, 59,177,212, 88,252,238,232,217, 10, 30,195,128, 71,192,248,123, -123, 32, 87,169,133,144,207, 64, 36, 18, 65, 38,225,195, 92, 38,128,128, 47,192,141,123,247,160,209,104,208,188,121,115, 73, 77, - 13, 14, 10, 51, 41,124,234, 59, 67,167, 55,224,232,197,135, 88, 52,169, 31, 58,181, 13,197,103, 60, 17, 30,107,130,161,176, 86, -128, 37, 60,232, 12, 44, 52,122, 35, 0,162,174,230,154,105, 89,214, 47,162,132, 82,122, 45,237,241,175,137,246, 13,251,142, 62, -118,242,236,246, 94,221, 59,227,246,221, 40,236,219,255,219,165,108,155,130,169, 21,190,211, 8,101,163,224, 40,165, 81,117,172, -140,137,220,193,127, 82,120,171, 8, 40,243, 50,145,145,244,220,228, 74, 61,176,158, 2,159, 78,154,224,227,231,231,231, 99,100, - 41, 88,150, 34,208, 93,129, 49,227,198,249,120,121,251,250,176,101,163, 8,253,221, 20,213,234,200, 29,252,198, 47, 94,249,253, -251,110,110,110, 56,126,249, 17,150,206, 30,123, 91, 38, 51,243, 12,181, 86, 88,178,126, 77, 16,247,224, 20,172, 61,242, 97,238, -224,227,218,187,211, 48,215,110, 61,250,226,254,221, 72,172,254,106,225,213, 98,158,116,137, 41,105, 53,115,104, 96, 23, 28,214, -246, 61,115,107, 7,228, 21, 40, 97,102,101,143,128,198,161,239,153, 57, 52,152,174,204,120,150, 85,215,107,157,165, 20, 26, 29, -139, 92,165, 14,201, 89,106, 60,207, 80,225,121,186, 10, 44,251, 71, 83,112, 77, 37,148,128, 16,185,152,207,183,214, 63,173,119, -239,244, 89,234,238,230, 64,150, 47,156,198,211, 81, 49, 50, 11,180,200, 42,212, 34,171, 64,131,172,194, 82,131,101,101,198, 7, - 75,217, 90,143,206,200, 85,234,160,144,242, 97, 33, 23,194,104,172,123,159,239,121,171,118,182, 76,206, 82,190,245,213,162,217, -194, 59,207,139,113, 47,174, 0, 98, 33, 83, 26,189, 42, 51, 88,166, 54, 11,243,248,204,132, 30, 29,155, 35, 41,171, 4,124, 30, - 3, 62,143,129,119,195,166,176,149,177,120,107,224, 12, 0, 64,175,238,165,211,144,196,165, 21,227,208,181, 52, 0, 16,154,154, -214,204,236, 66,201,254, 83,183, 63,217,249,211,114, 81,137, 81,128,239,143,196,163, 68,107,132, 88, 88,214,236, 46,170,221,253, -205, 96, 44,141, 96, 37,101,233, 80,172, 49,162, 80,165, 3,165,192,141,167, 69, 80,105,140, 40, 80,233,208,194,207,186,166,251, - 15,169, 97,123,207,215,187, 79,210,158, 40,237,171,101,103,106, 4,107,233,210,165, 81, 75,151, 46,173, 52, 34, 86,163,193,170, -210, 92, 9, 37, 39,183,174,157, 37, 61,253,132,226,252,189, 28,188,211,198, 21, 57,153,201,216,240,221, 26,150, 82, 64, 44, 17, -165, 27, 13,236,177, 18,214, 48, 45,255,238,161,106,219,125,229,118,129,141,165, 50,217,217,165,171,127,208, 57, 58,185,178,191, - 94,203,207, 44, 80, 25, 95,138, 21, 26, 53, 26,134,178, 84,104,138,185, 42,107,218,208,205,155,208, 15, 44,165,152,187,102, 55, -150, 78, 25, 4, 51, 9, 95, 70, 8,145, 21,151, 24, 48,105,225, 70,172,252,124,132, 66, 38,230,151, 25, 3, 35,198, 78,248,204, -164,147,160,214, 24, 81,156,151,158,211, 72,185,234, 21,115, 21, 82, 16, 22, 22,150,111,101,101, 5,185, 92, 94,107,131, 85,153, -185,114,116,116,116,150,201,100,214, 62, 62, 62,101, 79,125, 60, 24,141,198,226,152,152,152, 58, 77,250, 86,152,159,125, 32,245, -249,131,230,173, 34,122,224,194,201, 3,236,213,163, 27,250,213,102,136,185,165,133,121, 82,228,195,132, 0,192, 12, 41, 57, 37, - 72,207, 43, 65, 90,174, 6, 58, 3, 11,119, 7, 25,146,147, 18, 97,105, 97,150,100,170,158,204,209,167, 43, 67,121, 99, 88,130, -159, 84,233,143,143, 2,128, 50, 37,106,156,204,222,247,126, 84,212,221,213, 61, 7, 77, 16,117,122,123,156,112,253,178,143,102, - 0, 24,100,170,110, 70, 70,134,202,222,222,254,170,179,179,115,207,185,115,231,106, 0,136, 52, 26,141,108,196,136, 17,178,132, -132,132, 79, 41,165, 38,165,177,205,136,205,182, 68, 66,187, 54,240, 11, 25,236, 46, 43,238,220,161,109, 56, 90, 6,185, 33,185, -109, 56, 0, 76, 76, 80,153,249,182, 30,187,225,151,250,118, 86,199,190,223,114,116,233,168,129, 29, 62,117,238, 53,127,101,234, -161,185,213, 70,196,158, 92,220,216,165, 50,247, 46, 40,235,248, 94,209, 96, 25,140,180, 54, 77,112, 84,111,100,161,210, 24,160, -210, 24,160, 44,209,227,204,157, 76,100,228,107,145, 87,172, 67,137,198, 8, 10, 64,167,167,229,179,138, 84,111, 86,175,108,177, - 44,255,223, 53,100, 80,193,154, 5, 19,204,247, 93, 78,134, 92, 92,218, 31,203, 66, 46,130,185, 76, 0,128,226,252,249,243, 40, - 31, 30, 95,211, 83,252,190,227, 55,176,114,203, 89, 28,223, 56, 13, 18, 17, 15, 77,250, 46,192,176,190,205,193,178, 20,177, 79, - 30,100,248, 4, 4, 59, 48,102, 50, 48, 12,202,251,164, 84,119, 60,109, 40,165,191, 17, 66,122, 18, 66,122,148, 90, 56,228, 29, - 48,230, 20,159, 61,178, 83, 94,172,214, 24,242, 18, 30,125,131,226,236,118,165, 77,240, 96,203, 30,208,207, 19, 66,218,214,209, - 92, 49, 82,123,223, 53, 31,142,155,244,142,151, 87, 3,236,222,177, 9,148,146,125,166,126,127,251,161,171, 88,181,250,229, 17, -131, 99,198,141,243, 89,255,253,247, 47,173,123,127,196,104,159,234, 12,158,107, 80,135,105,126,254,129,184, 22,149,140,229, 95, -140,191, 93,146, 25, 55, 88,107,102, 51, 70, 87,156, 54, 57, 48, 40, 24,142, 14, 54, 72, 79,203, 64,251, 62,157,208,173, 75, 23, -220,191, 27,137, 69,115, 62,187, 10,149,182,115, 77, 81,219, 63,140,144, 96,108, 68,151,190, 2,149, 70,135,117,203,231, 96,204, -212,197,104,209,190,151,224,193,157,235, 99, 1, 44, 48, 53,207, 90, 61,139,246,141,237,160,213, 27,161,211,179,248, 45,142,199, -255,115,158, 0, 62,143, 97,130, 27,148, 54,239, 22,170,245,213,215,243,124,146,158, 87, 88,228,241,205,226, 79,120,197, 26, 35, -178, 10, 52,200,204,215, 34,171, 80,131,236, 2, 77,169,185, 42,208, 34,187, 64, 3, 62,143, 32, 38, 46, 5, 60, 30,169,117,255, -187,252, 98, 29,154,249, 90, 1, 32, 96,234,216, 28,146,109,176,235,118, 55, 58,249,173,229, 11,103, 11,239,196, 41,113,239,121, - 97,153,177, 98, 32,170, 96,176, 88, 19,186, 96,217, 7,246,110,249,254,160, 62, 13,205,229, 18,164, 60, 41, 2,159, 33,224,243, - 8,204,237,220, 96, 33, 41,193,132,241, 99, 96, 99,109,129,196,236, 18,172,217, 31,141,123, 15,159,130, 85,215, 46,219,223,253, -124,188,223,251, 67, 6,138, 25,129, 4,219, 79,198, 65, 36,228,129, 15, 45, 30, 94,191,168,201, 72,126,174, 43, 42,204,151,243, -249, 2,147, 68, 9, 64, 13, 70, 22,148, 82, 44,153, 63, 19,187,182,124,135,227,183, 50, 64, 81, 58, 85,195,239,191,126,141, 73, - 51, 22, 33,171, 80, 11,128,188,206,168,197, 35, 0,122,188,106,132, 94, 53, 73, 21, 34, 80,149,113,179,162, 70,249,254, 85, 25, -184,138,125,178, 0,152, 20,105,231,191,234, 20,203, 63,219, 53,238,215, 74, 34, 18,157,220,178,102,166,244, 76, 52, 94,152, 43, -181, 50, 27,219, 54,174, 87, 82,176, 29, 51, 30, 28,188, 97,234,209,144,219,251, 6,137,229,242, 11,179, 23,173,209, 56,187,214, - 55, 28,189, 83,152, 83, 84, 98,252, 83, 24, 68, 40,147, 27,229, 22,118, 37,150,238, 77, 87, 10,212,218, 57, 89, 89, 15,139,107, - 58,165, 44,165, 56,116, 61, 29, 96, 75, 79,226,238,139, 41,165,243,248,240, 8,140,108,105, 59,247,169,219,153, 47,214,153, 86, -177, 2,191,156,188,157, 93,149,185,178,180,180,132,165,165, 37,204,204,204,106, 91, 97, 87, 26,185,146,201,100,214, 39, 78,156, -144,152,155,155,131,199,227, 65,163,209,160, 83,167, 78,117, 42,121,114, 7,191, 65, 45,222,234,191,180,117,251, 30, 56,119,226, - 87,246,234,209,205,253, 85,153,181,152,191, 7, 64,183,182,141, 15, 45,255,122, 93,253,169, 51,102,139,229, 18, 62,242,148, 58, -240, 24, 2,119,123, 41,108,204,120,184,122,246,112,201,224,174,193, 38,155, 63, 55, 87,143,109, 95,175,249,193,102,229,151,243, - 59, 91, 89,213,119,200,203,139, 43, 4, 0, 85,102,244, 15,102,142,126, 79, 92,235,157,188,208,164,109, 63,216,187,120,119,175, -109,126, 51, 51, 51, 51,131,130,130, 30, 5, 6, 6,134,246,239,223,159, 46, 89,178,196, 42, 57, 57,121,143,169,230, 10, 0, 58, -116,105, 57, 73, 46,208,135,219, 72,153,192, 6,142, 50,180, 12, 42,109,253, 28,216,163, 53, 92,221,234,225, 89,186, 42, 56, 71, -205, 10,139,245,130, 6,223,255,176,233,166,187, 53,127,148, 65,169,126, 8,224, 96,173,111,218, 40,171, 36,101,101,230, 74,194, -135,153, 84, 0,150,150,110, 51, 61,130,197, 66,171, 99,161,210, 26,160,210, 24, 75,205,150,214, 8,150, 45,237,172, 76, 8,129, - 78,111, 44, 15,200,214, 38,129, 48,183,178, 69,125,143,210, 52,190, 88,164, 2, 16, 2,216,217,217,193,198,166,230,121, 71, 89, -150,133, 86,103, 40,187,233, 26, 95, 12,234,208,234, 12,160,148, 34, 58, 58,102, 90,124, 92,124, 31,111, 31,175,182,129,141,131, -173,165, 34, 6, 0, 74,106, 8, 38, 13, 6,160,167,148,190, 24, 20,225,209,176,117,201,254, 95,247,201,123,246,234,149,167, 85, -102,237,173,176, 51, 15, 64,215, 50, 51,166,174,229,117, 74,228,118,190,125,221,252, 91, 46, 30, 58,124,140,111,251,142, 93,112, -254,204, 41,252,246,235,206,173,197,153, 79, 78,154,170,227,231,231,247,167, 81,132, 94,222,190,127, 26, 69,232, 81,223,167, 74, -131,101, 97,209,216,188,113, 88,132, 91, 66,182, 14,199,142, 29, 69,113, 65,250, 23, 90,173, 82, 5, 1,221,112,250,215, 31, 71, - 14, 30, 59,215,188, 69, 88, 40, 44, 21, 50,216, 90,153, 33,242,214, 85,124,185, 96,246, 85,168,180,157,107,174, 63,203,242, 27, - 24, 40,244,174,231,241,137,123,131,134,136,188,126, 25,177,209, 15,162,238,220,188,218,208, 59,168, 57,236,156,221, 63, 33,129, -129,203,232,195,135, 53,190,169,130, 26,105,242, 7,163, 39,151,221, 75, 74,215,181,104, 82, 95,244,231, 66, 72, 96,208,235,140, -219,215,127,153, 89,113, 20, 97, 85,186, 37, 69,249,123, 47, 93,191,255, 89,239, 46,109, 72,121, 83, 96,185,169,122,245,179,183, -139, 28,177,247, 31,179,250,226,130,125,181,187, 50,105,198,184,241, 19,165,165,105,103, 65, 75, 39, 86, 83,215,246,250, 46, 49, - 10,223,251,126,254, 44,114, 55,190, 24,247,159, 23,150, 54, 11,150, 25, 44,177,144, 7, 81,217, 95,147,166, 38, 99,152,229,239, - 15,232,130,236, 2, 45, 88, 74,203,230,210, 35,224,243, 5, 72, 40, 4,146, 10,149,200,202,207, 64,220,243,120, 20,164,199,129, - 97,120,176,113,241,134, 42,209,180,180, 22, 25,205,124,245, 44,188, 6,244,108,195, 59,112, 37, 13, 82, 49, 31, 69,217, 73,184, -124, 98,183,154, 26,141, 63,104,245,218, 93,246, 84,244,224,225,253, 61, 58, 19,171,142,172,194, 98,173,131, 88,200,195,238,205, -223,224,221, 97,227, 94, 68,179, 1,224,179,217, 11, 65, 8, 65, 94,129, 18, 0,201,170, 41,114,245,202,231,172, 10,145,167, 63, -125,174, 96,138, 42,251, 76,202, 62,107,171,208,208,190, 98,170,180,175,172,215,190,162,103,210,228,200, 85, 70,176, 4, 12,239, -212,230,213,179, 36, 81,153, 98,220,120,156,142,119,218,184, 66, 85,152,141,245,223,174, 82,150,232,117,221,178,238,155,110,174, -202, 10, 74,151,119, 71, 76,137,106,224, 29,160, 61,243,160, 40, 46,191, 88, 95,101, 63,134,230,239,204,138,186,125,228,155,238, - 5,250,184,241,102,206, 13,141,172,193,176, 92,149,249,100,126,229,149, 56, 21,205, 93,179,187,212, 92,177, 44,166,127,185, 13, -148, 53,150, 77,224,103, 4, 53,178,248,248,139,239, 96, 40,251,223,200, 26, 65,244, 70, 89,141,225,114,137,240,100, 35,229, 42, -139, 87,205, 85,211,166, 77,243, 45, 45, 45, 97, 99, 99, 3, 43, 43, 43,148, 27,162,215,109, 22,244,241,241,129,153,153, 25,206, -159, 63, 15, 51, 51, 51,200,229,117,155, 32,223,204,193,255,221,230, 29,250,253,220,190,215, 8,230,244,254,245,198,235,231, 15, -191,163,206,124,108,178, 9, 48, 26,141, 68,175,215,163, 75, 68, 72,194,157, 39,137,199, 23,206,159,223, 53,172,195,219,226,150, -126,246, 80,107, 13, 72, 78, 74,194,213,115,191,149,120,215,179, 61,222, 50,212, 55, 89,175,215,195,104, 52,214,120, 3,215,104, -180, 57,140, 64, 98, 51,112,208,123,226,155, 55,110,252, 44,119,240,219,201,240,216,187,212,200,107, 12,208,119, 27, 55, 10,128, -206,192, 66,173, 42,204,173, 75,190,163,162,162,110,126,253,245,215,126, 2,129,192,117,239,222,189,217,121,121,121,181,122, 93, -208,169, 35, 55,214,240,205,244, 49, 66, 90, 50,216, 93, 86,220, 57,169, 77, 56, 6,245,108,141, 93, 71, 46,227,220,197,171, 72, - 80,153,221, 41,214,242, 14, 36, 39,167,106, 2,173, 10,126,237,219,202,147,183,111, 91,225, 62,251,246,211, 7, 80, 42, 61,149, -117,126,110,177,233, 55,111,160, 80,173,175, 16,193, 42,237,223,196, 48,196,228, 8, 22, 1,226, 46, 94,137, 12, 10,241, 13,192, -157,103,133,200,202,211, 64,165, 45, 45,247, 20, 20, 54,230, 66,136,133, 60, 36, 60,143, 3, 75,117,207,107,119,159, 65, 86,183, -119,198,240,203, 30, 95,248, 2, 1, 31,180,236, 6, 41,149,136,148,246,246,246, 38, 25, 44,189,209,136,254, 93,154,163, 69, 88, - 99,244, 25,251, 53, 0,224,204,214,233,176, 50, 19, 98,239,222,189, 72,188,188,106,123,131,150,227, 78, 62,184,255,240,237,168, -219, 87,222,235, 22, 34, 13,118,228,167, 9,171, 9,235, 31, 36,132,136, 0,180, 39,132,116, 2,112,158, 82,170, 55, 26,216,196, -174, 93,187,176, 70, 35,155, 90,225, 90,179, 2, 16, 14, 32, 23, 64, 36,165, 84, 95,253, 3,160,127, 71, 48,216, 9, 66, 36,102, - 82, 89, 66,120,199, 65,206, 97, 45,154, 91,244,237, 63, 0, 34,161, 8,167, 79,157,192,218, 85,203,118, 43,211, 30,141,168, 85, -243,152,137, 29,218,171,107, 46, 42, 40,176, 40,142,126,120, 39, 47, 46, 67,107,197,183,244,129, 64,172, 24, 67, 44,156,215,240, -196,102,115, 93, 90, 12, 51, 63,115,249, 6,162,238, 92,129,179,173, 20,113,177, 79, 85, 15,238,222,254, 78, 69, 4,243,105,214, - 67,149,169,233,148,229, 24,223,110, 49,180,171, 85,137,206,136, 75,103,143,148,176, 6,182,235,181, 11, 71, 99,221,124,195, 36, - 65, 97,111, 89,101, 31,220,208, 31,192,174,154,116,158, 95,223,254,167,174, 23, 13,154,191,155,122,244,212, 69, 51,231,122,222, - 60, 16, 6, 26,117, 49,178, 18, 30, 24, 74, 10, 51, 84, 25,247, 15, 56,155,146,190, 4, 67,202, 23,115,150,253, 48, 62,164, 73, - 67, 57,165,162,151, 34, 86,229,255,231, 20,105, 75,251,204, 22,231,227,217,253,203, 37, 89, 79, 11,102, 86, 95,215,233,101, 57, - 57,185, 47,134,230, 75,149,150, 30, 5, 22, 5,226,242, 11, 12, 60,192,162,192,242, 69,164, 34, 39, 39, 87,100, 52,234,101,166, - 92,158,150, 10, 9,238, 63, 79,125,209,161, 93, 44,100,202,250, 94,253, 17,201, 50,241, 58, 15,225,139,228, 72,201, 41, 1, 67, - 41, 88,214, 0,131, 94, 11,101, 97, 33, 82, 83,210,145,145,145, 9,101, 81, 1,164,102,150, 8, 10, 14,133, 66,161,192,163, 91, -231, 0,144, 67, 38,153, 65, 86,232, 19, 22, 26, 42,136,138, 47,130, 78,207, 66, 0, 29, 46, 29,255,165,196,160,215,246,202,184, -127,224,108,109,235, 97, 3, 75, 79, 63,120,146,208,208,205,214,137,220,126,150,143,109, 63,174, 43, 29, 77,106, 40,141,102, 70, - 37, 22, 35, 53,167, 24, 41, 73, 9, 20,172,241,116, 45,229,111,214,240,185, 46,188, 9,141,218, 27, 44,131,193, 32,169,231,238, -129, 65, 99,134,226,187,239,190, 71,244,179, 4,252,248,237,234, 82,115,117,111,255,239, 38, 26,138, 23,111,219, 46, 78,127,188, -124,196,119,207,147, 15,221,205, 99,212,218,234,223, 63, 37,179,243, 68,155, 17, 43, 79,168,139,114, 69, 70,141,138,127,104,251, -136,157,149,105, 2, 0,143, 33,218,178,102, 65, 16, 66, 80,222, 44,248,221,130, 81,144,137,121, 32,132, 64,165, 49,224,253, 79, - 87, 98,235,202,210, 39,171, 15,199, 79, 81, 85,149,206, 10, 70,136, 12,239, 90,191,247,162,141, 15, 15, 94,142,183,121,214,163, - 71,187,130,224,224,224,124,169, 84, 10,185, 92, 14,115,115,115,152,155,155,195,210,210,178,198,188,151,125,118,168,169,207, 21, -195, 48, 48, 55, 55,135, 84, 42,173,212,184,213,244,246,114, 51, 71,223, 1,205,218,247,219,217,161,247, 72,230,244,254, 31,217, - 91,231, 15, 13, 80,103, 62, 57, 96,234, 57, 42,139, 58,220,237,223,191,127,163, 49, 99,198, 8,103,141,239,127,226,196,249,200, -232, 95, 79,237,235,149,155, 95,228, 70, 41,133,165,133, 89,210, 59,157, 26, 29,106, 19,230,151,112,230,204,153,255, 99,239,188, -195,163,168,218, 54,126,159,217,158,222,123, 35,141,144, 70,239,189, 74,175,130,160, 32, 96,161, 40,168, 96, 1, 84,164, 42, 40, - 32, 96, 67,145, 46,189, 11,210, 91,232,189, 37,129, 64,122,239, 61,217, 62, 51,231,251,131,132, 47,242,166,108, 0, 95, 95,241, -252,174,107,175,236,110,102,238, 61,231,204,153,153,123,158,211,196,173, 91,183,234, 8, 33,119,235, 74,103, 94, 94,206,250,147, - 39, 79,125,221,185, 75, 87,172,222,176,181,127,116,244,189,254,113,177, 15,225,229,227, 15, 95,255,134, 80, 19, 91,156,140, 56, -135,210,130,236,245,166,164,179, 42,141, 27, 55,246,104,218,180,169,103, 81, 81,145,118,246,236,217,141, 4, 65,248, 61, 60, 60, -188,101, 88, 88, 88,102, 84, 84, 84,154, 41,121,191,184,105, 76, 46,128, 77, 13,186,142,223,153, 97, 40,122, 31,192, 98, 47,111, -111,156, 62,123, 9,151, 47, 92, 89,149,103,238, 61,111,252,107, 99,223,110,224, 32,123,123,112,251, 6, 18,103, 59,115,108, 89, -189, 76,178,255, 98,210,242,164,124,227,175, 0, 22,154,114,140, 42, 41, 40, 53,160, 67,168, 3,120,158, 66,160, 20, 28, 33,176, - 50,147, 86,107,176,170,211,148,234,149,111, 76,158, 52, 49, 46,188, 73,179, 15, 94, 27, 55, 81,222, 44,192, 27, 87, 31, 22, 2, - 32,112,176, 54, 71, 70, 70, 38,206,253,254, 43, 95,152,126,127,149, 68, 34,206,175, 79,121,166,221,216, 22, 88,249,222,205,205, -109,194,173,200, 72,156, 57,115, 6, 14, 14, 14,168, 52, 87,213, 53, 17, 62,169, 89, 88, 88,122, 97,193,178, 95, 59,188, 61,122, - 48, 6,116, 13, 67,196,181, 56,232,141, 34, 12,188,248,184,147,107,194,165,159, 21,239,143,244,215,191, 51, 44,168, 68,109, 84, - 36,205, 73, 42,137,168, 58,137,236,147,154,148, 82, 61, 33,228, 40,128, 54, 0, 6, 19, 66,142, 81, 74, 91, 86,141, 60, 1,104, - 12, 32, 12,192, 37, 74,105,130, 73,121,231,176,229,198,181,235, 14, 6, 94,196,185, 43,183, 67,186,119,104, 6, 42, 82, 92,187, -118, 29,107,214,173,209,222,189,115,107,105,121,182,235,252,154, 38,183,173,169, 60, 77, 29, 69, 88,221,119,149,154,148,158,225, - 45, 93,130, 87, 93, 60, 31,241,153,210,189, 37,130,251,125, 58, 40,253,246,239,131, 92, 67,123,195, 49,160, 3, 50,110,239,195, -205, 11, 91, 14, 93,231,249,153, 42,145, 75, 46,207,189, 95,110,234,249, 94,137, 82,101, 62, 53,172,121, 23,164,166, 36, 33,241, - 97,228, 70, 77,254,195, 12, 75,215,224,141,233,105,201,147,124, 67, 59,224,252,209,109,239,213,100,176,234,170,243,142,138,226, - 85,103,206, 95, 28,149,190,243,119,151,210, 50,141,153, 84,202,169,149, 18,100,203,213,113,219, 77, 77, 39,141,142, 54, 56, 7, -180, 31,246,218,196,207,255, 88,254,245,108,153,179,173, 18, 89,133, 90,148,168,141, 40,209, 24, 33, 33, 64,160,187, 37, 52,229, - 37,184,124,104,147,145, 26, 10,134, 85,244, 71,173, 86,211, 41,108,240, 66, 66, 48,229,243,207,103, 65,162,176,118,247,235,241, -169,129,243,115,133, 29,158,152,204,220, 30,240,235,241, 41,116,165,217, 3, 63,255,124, 86, 35, 74,105, 15,167,176,193,165,149, -107, 17,214,148,247,252, 82, 3, 70,119,243,130,222,248,104,254, 48, 65,120,212,215, 78,172,152,213, 28,181,196,149,171,106, 82, - 64,190,227,143, 75, 72,207, 46,132, 70,103,132,222,192, 67,207, 11,224, 56, 9,236,236,236, 16,232,215, 28,182, 54,214,200,201, -203,199,181, 75,231,113,249,193,173, 4, 10, 44,204,179, 47,222,108,202, 49, 34, 82,139, 64, 23,103, 71,146, 93,170,135, 74, 41, -193,229, 51, 17, 70, 0,235, 77, 49, 87,213,105, 22,171,139,190,157,185, 96,229,171, 63, 45,155,227,218,196,215, 26,169,121, 90, -164,229,106, 80,170,229, 1, 80,240, 2,133, 94, 91,140,152,107, 71,178,120,168,191,197, 11, 78,205, 17, 44,153, 76,119,237,206, - 3,229,204,185, 75,112, 47, 54, 1,107, 86,125, 95,174,171,135,185,170,142,117,239,248,110,171,223, 30, 21,243,150,206, 79,170, -253,129,187,154,102, 65,145, 82, 28,184,156,245,120,217,143,202,166,194, 27,177, 69,117, 85, 26,217,146,169,205, 62,169, 52, 66, -223,237, 77,191,172, 84,230,137, 41, 41, 41,133,155, 55,111,126,108,122, 36, 18, 9, 42, 71, 15,234,245,250, 58, 71, 21,217, 89, - 43,194,198,244,109, 48,178, 38,115, 37,145, 72, 32,138,226,227,232, 85,125,155, 30, 45,156, 27,245,106,221,125,232,182,238,131, -223,226, 78,238,251, 85,188,126,230,247,225,101, 57, 49,123,235,123,140, 10, 11, 11,163, 8, 33, 15,151, 46, 93,218,108,205,154, - 53,126, 31,125,244, 81,252,175,139, 38,125,247,232, 9,238,209,178,136, 55,111,222,164,147, 39, 79,214,105,181,218,132,194,194, -194, 27,166, 44,114,173,206,142, 89,186,254,167,111, 26,165,166,103,142, 11, 8,107, 3, 71,223,214,112, 13,104,131,130, 50, 3, -174,196,166, 35, 62,250, 36,238, 93,220,181, 93,147,235,242, 85,125,210,219,172, 89, 51,111,153, 76, 54,144, 82, 26,100, 97, 97, -225, 75, 41, 85, 72,165,210, 17,132,144,135, 60,207, 71,135,134,134,158,140,142,142, 54,121,205,176,164, 51,235,117, 13,186,142, - 95,153,172,182,232, 26,159,165,110,158,172,182,184,169, 86,218, 76,207, 57,185, 66,231,242,210,210,229, 48,230, 71,237,218, 88, -188,103,203,234,101,146,209, 19, 62, 20, 34, 11,172,223,151, 90,154, 29, 95, 60,222,228,145,251,224, 8,201,252,232,163,143,255, -127,154, 6,242,168, 97,176, 98,202,134, 12, 83, 52, 42,214, 83,156, 97,230, 30,246, 67,228, 7,147, 22, 52,110,213, 97, 76,151, - 62, 35, 57, 75,185, 5,142,239,253,153, 38,220, 57,189, 83, 74,133,207,212, 57,113, 9,207,122,145,208,235,245,127, 50, 86,166, - 68,175, 0, 32,215,161,184,235, 31,199,206,140, 59,120, 36, 98, 81,223, 94, 29, 29,126,156,253, 10,190,249,101, 63, 44,205,149, -160,162,128,145,221,189,135,223,219,218,123,160,151,139,202, 99,247,233,180,179, 83,150, 71,206, 80,171, 13, 15,234, 90,247,174, - 98,126,161,203,132,144, 64, 0, 3, 9, 33, 34, 0, 11, 0,229, 0,202, 42, 26, 36,246, 81, 74,203,235,147, 79, 3, 47, 34, 49, - 91,139,253,123,118,225,246,149,147,184,119, 47,166,244, 94,244,189,239,137,148, 46, 47,203,122,240, 84,145, 85,161,218, 17,131, -168,126,100, 97, 45,148, 75,204,190,186,121,112, 73,215,134,221,223,107,231, 16,208, 1,118, 62,143, 60,101,113, 90, 36, 82,175, -237,218, 95,154, 33, 31, 65,105,164,241,105,143,177,187,151, 95, 67, 81,162,192,197, 51,135, 64, 69,113, 21, 0, 80, 81, 92,117, -235,252,161, 73,109,250,190, 9,123,103,159,166,149, 67,187,234,171,109, 38,229,139,255,216,240,213,206,196,196, 68,220,191,127, - 31,177,177,177, 40, 40, 40,192,150, 45,231,138,235,213, 21, 32,238,226,113,151,160,206,189, 95, 29,255,193,129,161, 47, 15, 85, -121,251, 6,112,141, 60,173,225, 96, 37, 69, 76, 92, 58,226, 34, 31,138,177,119,206,106,169, 38,103, 72, 78,236,133, 26,163, 35, - 78,161, 35, 92, 56, 9,153,121,242,247, 71,107, 11,246, 28,252, 70,163, 79,166,124,212,214,222,193,174,218,235,120, 65,126,161, - 98,238,220, 47, 26, 85,110, 95,215, 90,132,156, 68, 82, 58, 97,210, 84, 11,142,112,143,155, 1,105,101, 27, 25,125, 92,135, 1, - 2,200,101,210, 58,235,232,184,161, 29,193,139, 34,202, 52, 6,148,169, 13, 40, 42,211, 34, 43,175, 8, 81,209,113,184,122,238, - 48, 18,227, 98, 75,121,158, 63, 13,138, 61,185, 14,197,219,159,156, 88,183,214, 8, 43, 36,222,246,118, 86, 72, 44,212,194, 76, - 46, 69, 70, 74, 44,111,224,181, 79, 61,201,122,222,173,223, 51, 93,194, 7,191, 52,254,157, 79,143,116,238,220,201,186, 73,243, -150, 22,142,214, 86,144, 75, 9,226, 82,178,113,247,230,181,242,228, 7,183, 74, 4,163,166, 79, 94,228,239,207,188, 74,203, 63, -214, 96, 25, 4,190,231,135,159, 46, 62, 38, 8,130,153, 84, 34,209, 24,169,216,231, 89,204,213, 95, 5,165, 98,218, 59,239,127, -252,167, 7, 2,163, 32,154,189,245,206, 71,154,170, 15, 8,196, 40,152, 87, 70,174,234, 24,169, 39,201, 45,210,149,206,250,233, -246,198,175, 55, 70,239, 2, 16,253,172, 35,251, 0,160,176, 68,127,219,161,215,142,193,165,106,158, 0,184, 87,141,102,121,247, -238,221, 31,155,173,138,230, 58,147,111, 16, 10,149,249,164,110, 3,223,224, 78,238, 95, 35, 94, 59,189,127,196,211,152,171, 42, - 55, 48, 3,128, 43,132,144,200,207, 62,251,172,149,139,139,139,203, 23, 95,124,161, 42, 41, 41,145,253,248,227,143,218,188,188, -188,172,146,146,146, 75,148,154,222, 63,161,226,166, 57,222,204, 37,228,103,178,107,237, 75,118,206, 30,189,109, 29,189,130, 10, -115,211,226, 74,242,211,142, 16, 17,199, 75,115, 98, 46,213, 55,173,183,110,221, 74,105,220,184,241, 62,137, 68,226, 41, 8,130, - 35, 33,196,146, 82, 90,200,243,124,161, 40,138,153,245, 49, 87, 85, 77, 86,231,119,215,109,205,215,136, 10, 3, 81,109, 77, 58, -179, 94, 7, 0,217,199, 62, 82, 3,248,221,165,219,140,161,251, 47, 38,126, 31, 85,104, 61, 53,231,204,215, 7,234,171,159,126, -115,123,224,243,170,255,154,140,168, 52, 0,227, 44, 92, 26, 45,139,188,121,105, 14,161,144, 9,224, 23,170,179, 31, 94,127, 30, -250, 50,153, 76,219,178,101,203,106, 71, 11, 42,149,202, 90,231,215,170,184,208,175, 33, 93,187,110, 56,114,242,220,184,195,199, -207, 47,106,219,174,163,131, 74,233, 14, 31, 59, 3, 54,124,220,226,189,147, 55,115,175, 14,250,248,236, 79,241, 25,218, 59,148, - 82,109, 61,235,105, 44, 33,164, 24,192, 96, 74,233,106, 66,200, 4, 0,247, 0, 68,214,219, 8,136,120,173, 93,187,214, 91, 8, - 33, 82,202,139,223, 92,146, 73,182,106, 51,239,165, 61,141,161,168, 74, 19, 95,107, 76,152, 52,169,161,127,192,255,143, 34, 12, -107, 96,133,209,227,222,110,232,227,215,240,241,119,141,188,106,127,160,162, 25, 55, 52,196,165,113,175,152, 99, 75,103, 59,196, - 93,120,199,204,222,211,178, 60, 47,169,160, 48,233,250, 82,117,142,203,210, 39, 87,104,168, 47,137,177, 81,203,215, 46,155,241, - 81,102,122,220,154,242,156, 7,143, 90, 29,114, 30, 68,154,187, 4,205,206,203, 74,251, 40, 63, 39,126,233,211,150, 69,121,121, -121,198,230,205,155,109, 59,116,232,192,185,184,184, 32, 55, 55, 23,167, 79,159, 22, 69, 81, 76,175,175, 86,246,131,179,167, 73, - 64,128,253,214, 13,197,223, 72,205,172,250,241, 2,220, 41,165,144,114, 36,211,160, 43, 62,146,107,171,249,152,222,185, 84,123, -189, 20, 5, 66, 57,202, 85,174, 45, 40,138, 34, 89,242,195,166, 36,137, 76, 81,109,147,170, 96,212,155,139,162,104,242, 90,132, -217,146,100,135,112, 99,112,221,163,248, 40, 16, 73,238,215,241,112, 74,143,182,239,251,122,111,158, 23,140,120,212, 63,177,242, -149, 67, 41, 57, 5, 34, 28,203,179, 47,189, 84, 31, 83,245,167,251,188,193, 96, 11, 78, 14, 43,115, 35, 56, 16,148, 20, 23, 43, -157, 4,197,189,103,169, 75,217,145,251,163, 72,215,174, 62,250, 19,167,198, 70,156,187, 48,130,138,162,175, 64, 1, 80,146,168, - 55,104,119,230, 88,231,109,124,218,244,254,211, 32,207,120,253,168,119, 8,241,159,160, 73, 8,145, 3,112, 4, 32, 84, 93,254, -230,121,164,179,182,181, 5,159, 37,239, 86,110, 33, 29,149, 42,243,143,213,234,210, 53,234,236, 7, 7,158,103,121, 18, 66,108, -148, 74,101,115, 75, 75, 75, 89, 94, 94,222, 21, 74,105,241,139,120,220,171,210,233,141,245,142,221,123,183,255,224,248, 31, 87, - 87, 86, 52, 31, 62,198,115,196,114,213,232,126,157,167,111,218,115,112,249,147,163, 8, 95,132,188,255, 85,154,164,107, 87,169, -115,161,245, 56, 65, 16, 23,118,111, 88,170,206, 74,136,153,124,238,110,238, 21, 74,105,233, 51,214,207, 87, 43, 35, 88,148,210, -173,255, 43,121,119, 14, 31, 50, 31, 4, 33, 38,139, 80,220,203,137,220,247, 69,157,215,144,208, 80,185,121, 46,236,212,121,142, -249,245, 53, 86,127,203,113, 39, 68,210,184,113,227, 78,114,185,220, 91, 16, 4,115,189, 94,175,214,104, 52,137, 73, 73, 73, 23, -107, 90,144,252,175, 78,167, 75,227, 33,203,101, 50,217,251, 0, 96, 52, 26, 87,102,223,221, 55,173,182,125,107,218,254,191,114, - 63, 26, 49, 66, 66,119,238, 20,254,138, 99,228,209,124,120,145,209,200,219, 84,126,150,203,164,197,105, 55,119,217,254, 93,117, -137, 25,172,127,225,141,129,105, 50, 77,166,249,124, 53,107, 95,172,155,149, 39,211,252,235, 53,221, 67, 7,122, 1, 64, 70,244, - 1,147, 70, 27, 87,183, 61, 43, 79,102,176,106, 67,202,138,128,193, 96,252,183, 49,197, 92, 49, 24,127, 37,166, 26,171,167,221, -158,193, 32,120, 98,169,149, 42, 23, 64,147,157, 41, 33, 36,252, 41, 46,176,145, 76,147,105, 50, 77,166,201, 52,153, 38,211,252, -119,105,214,165,253,162, 68,198, 88, 19, 33,211,100,154, 76,147,105, 50, 77,166,201, 52,255,118,205, 23, 13,142, 21, 1,131,193, - 96, 48, 24, 12, 6, 51, 88, 12, 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131, -193, 96, 6,139,193, 96, 48, 24, 12, 6,227,127,133,191,116, 20, 33,131,193, 96, 48, 24, 12,198,191, 17, 22,193, 98, 48, 24, 12, - 6,131,193, 96, 6,139,193, 96, 48, 24, 12, 6,131, 25, 44, 6,131,193, 96, 48, 24, 12,102,176, 24, 12, 6,131,193, 96, 48, 24, -204, 96, 49, 24, 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6,227,239, 55, 88, -132,144,112,166,201, 52,153, 38,211,100,154, 76,147,105, 50, 77,102,176, 24, 12, 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6, -131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6,131, 25, 44, 6,131,193, 96, 48, 24,140, -191, 9, 2,160,218,145, 0,148,210, 72,147, 69,158, 98, 52, 65, 93,250, 76,147,105, 50, 77,166,201, 52,153, 38,211,124,241, 52, -235,210,174,143,255,248,159, 54, 88,148,210,191, 78,156,144,240,231, 93, 80, 76,147,105, 50, 77,166,201, 52,153, 38,211,124,241, - 52, 95, 52, 88, 19, 33,131,193, 96, 48, 24, 12, 6, 51, 88, 12, 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6,131,193, 96, 48, -131,197, 96, 48, 24, 12, 6,131,193, 96, 6,139,193, 96, 48, 24, 12, 6,227,127,134,191,116, 20, 33,131,193, 96, 48, 24, 12,198, -191, 17, 22,193, 98, 48, 24, 12, 6,131,193, 96, 6,139,193, 96, 48, 24, 12, 6,131, 25, 44, 6,131,193, 96, 48, 24, 12,102,176, - 24, 12, 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, - 48, 24, 12, 6,227,239, 55, 88,132,144,112,166,201, 52,153, 38,211,100,154, 76,147,105, 50, 77,102,176, 24, 12, 6,131,193, 96, - 48, 24,204, 96, 49, 24, 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6,131, 25, - 44, 6,131,193, 96, 48, 24,140,191, 9, 2,160,218,145, 0,148,210, 72,147, 69,158, 98, 52, 65, 93,250, 76,147,105, 50, 77,166, -201, 52,153, 38,211,124,241, 52,235,210,174,143,255,248,159, 54, 88,148,210,191, 78,156,144,240,231, 93, 80, 76,147,105, 50, 77, -166,201, 52,153, 38,211,124,241, 52, 95, 52, 88, 19, 33,131,193, 96, 48, 24, 12, 6, 51, 88, 12, 6,131,193, 96, 48, 24,204, 96, - 49, 24, 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 96, 6,139,193, 96, 48, 24, 12, 6,227,127,134,191,116, 20, - 33,131,193, 96, 48, 24, 12,198,191, 17, 22,193, 98, 48, 24, 12, 6,131,193, 96, 6,139,193, 96, 48, 24, 12, 6,131, 25, 44, 6, -131,193, 96, 48, 24, 12,102,176, 24, 12, 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, - 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6,227,239, 55, 88,132,144,112,166,201, 52,153, 38,211,100,154, 76,147,105, 50, 77, -102,176, 24, 12, 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131, -193, 96, 48, 24, 12, 6,131, 25, 44, 6,131,193, 96, 48, 24,140,191, 9, 2,160,218,145, 0,148,210, 72,147, 69,158, 98, 52, 65, - 93,250, 76,147,105, 50, 77,166,201, 52,153, 38,211,124,241, 52,235,210,174,143,255,248,159, 54, 88,148,210,191, 78,156,144,240, -231, 93, 80, 76,147,105, 50, 77,166,201, 52,153, 38,211,124,241, 52, 95, 52, 88, 19, 33,131,193, 96, 48, 24, 12, 6, 51, 88, 12, - 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6,131,193, 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 96, 6,139,193, 96, 48, 24, - 12, 6,227,127,134,191,116, 20, 33,131,193, 96, 48, 24, 12,198,191, 17, 22,193, 98, 48, 24, 12, 6,131,193, 96, 6,139,193, 96, - 48, 24, 12, 6,131, 25, 44, 6,131,193, 96, 48, 24, 12,102,176, 24, 12, 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6,131,193, - 96, 48,131,197, 96, 48, 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6,227,239, 55, 88,132,144,112,166,201, 52,153, 38, -211,100,154, 76,147,105, 50, 77,102,176, 24, 12, 6,131,193, 96, 48, 24,204, 96, 49, 24, 12, 6,131,193, 96, 48,131,197, 96, 48, - 24, 12, 6,131,193, 12, 22,131,193, 96, 48, 24, 12, 6,131, 25, 44, 6,131,193, 96, 48, 24,140,191, 9, 2,160,218,145, 0,148, -210, 72,147, 69,158, 98, 52, 65, 93,250, 76,147,105, 50, 77,166,201, 52,153, 38,211,124,241, 52,235,210,174,143,255,248,159, 54, - 88,148,210,191, 78,156,144,240,231, 93, 80, 76,147,105, 50, 77,166,201, 52,153, 38,211,124,241, 52, 95, 52, 88, 19, 33,131,193, - 96, 48, 24, 12,198,115, 70, 90,221,151,178, 54, 95,102,243, 60,239, 12, 0, 82,169, 52,199,120,245,115,215,218, 68,188,220,220, -122, 10,192,175, 0, 32, 1,222, 78,205,200, 56, 94,141,230,113,158,231,237, 42, 52, 11,141, 87, 63,127,169, 54, 77, 89,235,133, -199,254,180,253,149,207,122, 85, 99,161, 57, 89,235,133,153, 79,164,213,205,228,220, 83, 42,254, 55,210,249, 79,209,252, 55, 35, -111,251,101,182,209,248,168, 30,201,100,210, 28,195,149,218,235,145,188,205,194,204, 63,109,127,249, 51,151, 39,183, 81,182, 95, -148, 98, 52,242,110, 0,160, 84, 40,114, 3,125, 92, 86,212,166, 25,159,154,243,129, 70,171,115,170,208,204,212, 93,156,229,253, -143, 61, 55, 77,196,213,213,181, 37,199,113,159, 19, 66,172,171,124,125, 39, 61, 61,253, 3, 86, 43, 25, 12,198, 11,103,176,120, -158,119,190,177,119, 14,202,117, 64,143,215, 23, 58,251, 13, 89,189,229,201,109,140,218, 66,133,250,225,254, 80,137,177,200,206, -214,140,218, 61,124,248,144, 3, 0,119,119,247, 95, 1,120, 87,163,105,119, 99,239, 28,168,245, 64,231, 81,243,236,154,250,248, - 88,151, 16,242,161,153,153, 89,119,173, 86, 27, 6, 0, 42,149, 42, 74,163,209,156,178,166,116,217,147,219,215,148,129,170,105, -237, 62,102,161,115,208,208, 95,223, 19, 4, 65,161,139,223,209, 69, 44, 77,150, 74, 4,253, 15,125, 50, 51, 15,255, 2, 8,166, - 20, 72,213,223,237, 50,242, 83, 7, 47, 55,183,158,102,230,230, 45,205, 45, 45, 59, 9,130, 16, 34,138, 34, 68, 81,188,167, 41, - 47, 63,199, 27,141,215, 5,163,218,225,198,190,175,196,218,210,249,100, 94, 90, 0,210, 28, 87,215, 17,102,150,150, 93, 37, 18, - 73, 7, 0, 16, 4,225,130,166,172,236,140,115, 86,214, 78, 83,242,110,106,249, 60,237,246,255, 54,140, 70,222, 57,225,232, 28, -232,140, 64,243,151, 23, 57, 55,121,109,227, 86, 0,208,231,220,118, 41,123,248,123, 27, 0,176, 8, 24,112, 69,233,218, 60, 27, - 0,164,201,153,206, 15, 14,126, 6,157, 17, 8, 25, 48,207,185, 58, 77,189,222,224, 21,123,104, 54,116, 70,224,173,185,187,220, - 62,158, 52,220, 28, 0, 78,239,251, 37,224,216,174,149,253, 1,224,165,225,239,255,209,109,200,196, 56, 0, 88,242,243, 46,183, -205, 95, 14,135,206, 8,132, 15, 94,224,245,180,231, 38,175, 43,150, 23, 61, 56, 24,104, 44,201,176,243,178,144,186,214,247,220, -180, 1,108,202,128, 41, 68, 34,233, 24, 24, 24,216, 2, 0,226,226,226,110,136, 60,127,222, 18,248,225,121,214, 37,137, 68,242, - 94,122,122,250,192,170,223,121,120,120,176, 10,201, 96, 48, 94, 76,131, 5, 0,229, 58, 32, 34, 22,232,210,182, 9, 38,140,238, -111, 89,245,127,251,214, 47,246, 74,143, 58, 22,178,100,219, 10, 73, 80, 80, 16, 30, 62,124,104,210,143,169,245,192,153,135,128, - 82,155,104,165,150,201,226,231,126,254,185,117,199,142, 29,165,238,238,238, 0,128,156,156,156,182,231,206,157,107, 57,111,222, -188,201, 74,109, 98,161, 90,143,210, 51, 38, 72, 87,166, 53, 44,168, 1, 62,155, 58,202, 6, 0, 86,124,184,179,229,161,139,183, -237, 19, 19, 19,123,124,245,213, 87,249, 30,151, 46,173,178, 20,197,117, 49,217,217,169,166,164,115,251,225,155,102,129,134,227, -126,195,223,120, 99,143,183,183,183,185,167,167, 39, 81,169, 84,144, 72, 36, 40, 43, 43,115,143,137,137,233,121,235,214, 45,205, -217, 75,251,101,183,111, 14, 75,200,144, 53,215,152,146,119, 57,159,167, 42,111,216, 48,122,120,223,190,158, 3, 6, 12, 80,249, -250,250, 2, 0, 18, 19, 19, 27,254,241,199, 31,175, 30, 58,116,232, 11, 57,159,199,171,245,208,214,149,247, 74, 77, 0,144, 1, -237,237,157,157, 71,203,100,178,112,158,231, 61, 42,162, 11,233, 70,163, 49,178, 32, 39,103,243,147,219, 51,254, 19,157, 17,184, -151, 9,244,236,212, 28, 99,134,245,180, 0,128, 25, 35,191,108,155,156, 24, 43,215,235,245, 8,106, 20,210, 97,193,162,111,143, -130,227,240,219,158, 19,143,183,175,213,216, 82, 14, 15,115,128, 59,247, 19, 48,231,203,239,104,214,157, 93,173,248,194,232, 94, -249,121,121, 82, 0,112,112,116, 28,177,125,235,230,227,174, 77,134, 95,139,203, 46,127,188,189, 41,245,189,186,115,243,208,182, -239,220,211, 35, 79,133,254,116,116,141,204,219,219, 27,145,145,145,245, 58, 55, 81, 28, 99,101,238,230,118,111,238,199, 31,187, -118,238,220, 25, 22, 22, 22,144,201,100, 48, 26,141, 61, 47, 92,184,208,115,206,156, 57,147, 75,138, 99,202, 77, 61, 55,235, 70, -182,204, 37,168, 75,183,161,131,250,185,117,239,210, 22,195,250,116, 96, 21,145,193, 96,188,184, 6, 75, 42,149,230,244, 26,251, -149,115,167, 54,225,184,118,251, 65,113, 98, 74, 86, 89,229,255,138,238,239,109, 56,105,104,211,240,213,135, 14,194, 96, 48,224, -226,197,139,184,126,253, 58, 46, 94,188, 72,151, 45, 91,166,145, 0,111,215,160, 89,216,121,212, 60, 59,165, 46,213,178,133, 67, -170,239,246,173,103, 36, 26,141, 6, 17, 17, 17, 40, 44, 44,132, 82,169,132,135,135, 7, 58,117,234, 36, 61,125,250,180,253,200, - 87, 71,219,188, 52,228,205, 4,157,210,171, 76, 42,149, 22,214,152, 1,169, 52,167,199,235, 11,157, 67, 27, 54, 64, 92, 82, 70, -241,103,139,214,148,137, 2,149,106,147,211, 12,103,207,158, 69,179,102,205,176,125,251,118,135,194,194,194,217, 27, 54,108,248, -220,229,251,245, 43,179,211, 98, 62,172, 69,175,176,243,168,121,118, 65,194, 73,239,157, 91,214,201,111,223,190, 45, 95,181,106, - 21, 10, 10, 10,160, 80, 40, 96, 99, 99, 3, 87, 87, 87, 4, 5, 5,145,201,147, 39,155,119,235,246, 16,159,125,248,134,119,150, -221,208,152,154,210, 89,169, 41,215,103,154, 55,148, 92, 15,248,117,227, 70,174,117,235,214,164,234, 54,222,222,222,232,218,181, -171,106,232,208,161, 1,147,223,157, 42,246, 28, 58, 49,206,160,112, 83,215,165,137,242, 84, 51, 7,245, 37,247,158,163, 70, 29, -152, 59,119,174,173,155,155, 27,204,205,205, 1, 0,197,197,197,158, 73, 73, 73,109,231,204,153, 51,252,202,157,237,210,206, 3, - 82, 51, 96,225,165,169,173, 60,255,173,200,100,210,156,202, 72,148,149,133, 89, 97,106, 90,118,249,163, 40,148, 30,122,189, 30, - 58,157, 14,239, 76,158, 40,121,251,229,214,129, 62,157,222,187,149,152,158, 93, 16,114,226,178,125,229,190, 53,104,230,133, 14, - 90, 96, 7, 0, 92, 73, 66,121, 97,210,177,183,102, 78,155,230,225,234, 58, 9,114,185, 28, 0,176,126,221, 58,105,126,126,126, -223, 5, 11, 22,132, 83,139, 30, 37,161,131, 22, 88, 84,236, 91, 88,223,115,179,240,193, 65,191, 47,167,244,110,250,235,162,131, - 16, 4, 1,151, 47, 95,198,217,179,103,241,237,183,223,210,195,135, 15, 23, 91, 91, 88,212,122,110,162, 56,198,170,163, 91,150, -255,215, 95,239, 38, 10,133, 2,251,247,239,199,253,251,247,193,113, 28,154, 52,105,130, 49, 99,198,160,103,207,158,174, 19, 38, - 76,164,157,251,140,140,135, 77,163,210,103,169, 75,132,204,227,156,195,154,190, 55,101,194,107,110, 47, 15,238,141,239,190,255, -137, 25, 44, 6,131,241,226, 64, 41,253,207, 23, 64,124,135,172,222,186,243, 6, 61,232, 59,100,245, 86, 10, 16, 10, 16, 37,224, -221,189,123,119,125, 89, 89, 25,189,125,251, 54, 29, 49, 98, 68,225,140,143, 63, 94,187,113,253,250,185, 58,181,250,157, 22, 77, -155,142,161, 21, 35, 19,171,213,180,181,181,246,247,247,207, 77, 77, 77,165,135, 15, 31,166,243,230,205,163, 91,182,108,161, 71, -142, 28,161, 39, 79,158,164, 71,142, 28,161, 59,118,236,160,183,111,223,166,177,177,177, 52, 32, 32, 32,215,215,214,214,186, 22, - 77,142, 2, 92,224,208, 95, 62,220,117, 93,152,219,112,232,175, 31, 80,128, 11,112,117,109,212,171, 87, 47, 97,247,238,221,116, -243,230,205,116,227,198,141,244,206,157, 59, 52, 47, 47,143,122,248,248,231, 86,238, 87, 83, 58, 41, 64,154, 55,111,158, 91, 84, - 84, 68,189,189,189,169, 92, 46,167,206,206,206, 52, 40, 40,136,182,109,219,150,246,233,211,135,190,250,234,171,116,246,236,217, -180,168,168,136,250,248,248,100, 87,238, 87,147,102, 91, 15, 15, 85, 64, 64, 64,202,221,187,119,105, 77,104,181, 90,154,151,151, - 71, 79,157, 58, 69, 3, 2, 2, 82,218,122,120,168,106,211,148, 1,205,195,195,195,115,243,242,242,168, 40,138, 84,173, 86,211, -252,252,124,154,159,159, 79, 11, 11, 11,169, 94,175,167,162, 40, 82, 81, 20,105, 76, 76, 12,245,247,247,207,145, 1,205,107,212, -252, 55,191, 42,235,196, 19, 47, 15, 23,151, 62,174,174,174,154,221,187,119,211,244,244,116,186, 97,195, 6,202, 1, 95,254,199, -182,213,104, 14, 15, 25, 46,111,222,124,130,153, 68, 98,214,191,125,251,246,194,197,139, 23,233,141, 27, 55,232,204,153, 51,233, -192,129, 3,233,160, 65,131,232,220,185,115,105, 74, 74, 10, 77, 77, 77,165, 47,189,244,146, 32,145,152,245,111,222,124,130,217, -240,144,225,242,250,156,155, 42,192,107,192,128, 1, 26,131,193, 64,227,227,227,105, 88, 88, 88,154, 4, 24, 45, 7, 66,252, 1, - 69, 93,245,211, 26,176,117,115,115,203,188,116,233, 18,221,189,123, 55,245,241,241,201,149, 0,227,149,128,175, 18,240,149, 0, -227,253,252,252,114, 47, 93,186, 68,243,242,242,168,183,183,119,166, 53, 96,251,180,117, 9,152,203, 57,135, 13, 89,183,224,251, -221, 52, 38,173,156, 46,248,126, 55,117, 9,234,154, 66, 41,165,110,110,110,199, 89,157,100, 47,246, 98,175,127,250, 75, 90, 31, - 51,198,153,153,205, 89,180,104,145, 92,163,209, 96,254,252,249,185,239, 76,154,180,208,209,217,217, 32,147,201, 32, 83, 42,235, - 22,176,182,254, 96,214,172, 89,182,122,189, 30, 55,111,222, 68,139, 22, 45,160, 82,169, 32,147,201, 32,151,203, 33,149, 74,225, -234,234,138,188,188, 60,184,184,184, 96,242,228,201, 54, 63,124,247,221, 7, 40, 42,154, 95,155,172, 40, 80, 41, 0, 8,130,160, -240,114,119,159, 16,214,184,241,178,201,147, 39,115, 22, 22, 22,208,233,116,208,233,116,136,137,137,129,131,131, 3,204,205,204, - 76,202, 51,199,113,156,165,165, 37, 34, 34, 34,176,110,221, 58, 36, 36, 36, 32, 35, 35, 3,214,214,214,104,214,172, 25, 66, 66, - 66,208,161, 67, 7,196,198,198,130, 16, 66,234,210,203,150, 72,166,140, 25, 53,202, 57, 60,188,250, 41, 69,116, 58, 29,138,138, -138, 80, 84, 84, 4, 23, 23, 23,244,237,219,215,249,192,254,253, 83, 0, 44,173,110,123,115,192,213,183, 97,195, 3, 87,175, 94, -117,228, 56, 14, 17, 17, 17, 80,171,213,208,106,181,224,121, 30,132, 16,168, 84, 42,180,107,215, 14, 14, 14, 14,104,216,176, 33, -246,238,221,235,212,171, 87,175, 63,204,179,179,155,171,129, 76,246,120, 81, 55,105,217,217,199, 90, 0, 14,175,189,246,218,225, - 59,119,238,116, 30, 61,122, 52,178,179,179, 63,149,204,156, 89, 40, 0,203,107,219,119,231,189, 93,188, 39, 96, 97,239,228,244, -203,226,197,139,185,172,172, 44, 76,159, 62, 61, 63, 35, 53,117,150, 10,184, 4, 0,127,252,254,123,187, 77,155, 54, 45,218,188, -121,179,195,198,141, 27,185, 22, 45, 90,172,206,185,185, 58,244, 6, 80, 92,159,116,106,129,247, 86,172, 88,161,210,106,181,232, -213,171, 87,188, 58, 49,177, 9, 15,104, 76,221,191, 12,152, 50,247,227,143, 93,149, 74, 37, 62,250,232,163,188,188,228,228, 48, - 30,200,173,178, 73,146, 69, 66,194,225,215, 95,127, 61,234,206,157, 59,142,203,151, 47,119,125,121,232,208, 41, 0, 22,154,250, - 27,255,223,161,157,179,118, 9,242,111, 56,164, 79, 95,151, 70,126,206,216,189,255, 40,126, 88,189,101, 61,138,226,126,241,240, -240,152,194,113,220, 18, 86,243, 24, 12,198, 11,217, 68, 88, 19,118,118,118, 45, 3, 2, 2,112,242,228, 73, 4, 7, 7,239,117, -174, 52, 87, 50, 25, 4,161,238, 62,228,102, 22, 22, 61, 58,119,238, 44,189,120,241, 34,124,125,125, 97,102,102,246,216, 88, 85, -154, 44,153, 76, 6, 87, 87, 87, 20, 23, 23,163, 99,199,142,178,117,235,214,245, 0, 48,191, 46,237,204,164, 24, 75,196,175,123, -109,222,130, 5,254, 45, 91,182,132,193, 96,120,100, 68,204,205,161,211,233, 32,147,201, 96, 48, 24,160,213,211, 18, 83,242, 42, - 8,130, 32,145, 72,224,237,237,141, 47,190,248, 2, 90,173,246,113,179, 78, 73, 73, 9,138,138,138,112,243,230, 77, 36, 38, 38, - 66, 20,197, 58, 39, 19, 51,183,180,236, 59,104,208, 32, 69,117,255,211,235,245,143,205, 85,113,113, 49,180, 90, 45,154, 54,109, -170, 56,117,234, 84,223,154, 12, 22, 81,169,134,111,220,184,209, 89,161, 80, 64,171,213,226,225,195,135,136,139,139, 67, 76, 76, -140,174,160,160,128,183,180,180, 36,110,110,110,146,226,226, 98,197,235,175,191, 78, 74, 75, 75, 1, 0, 67,135, 14,117, 88,191, -118,237, 43,168,195, 28, 48,254,159, 27,128, 46, 64,175, 31,216,186,117,235, 83,215,174, 93,107,241,254,251,239,227,206,157, 59, -223,152,111,223,126, 86, 13,220,170,181, 94, 2,147,151,204,152,225,102, 97, 97,129, 49, 99,198, 20,168, 83, 83,155,240, 64, 86, -149, 77, 30, 56, 36, 38, 30, 25, 59,118,108,228,157, 59,119,236,150, 47, 95,238,250,202,240,225,147, 1, 44,170, 79, 26,109,108, -108, 90,187,186,186,226,200,145, 35, 72, 73, 76,156, 81, 31,115, 5, 0, 68, 34,233,216,165, 75, 23,236,219,183, 15,105,201,201, - 51,158, 48, 87, 0,128,114, 32, 87, 26, 31, 63, 99,253,250,245,235,222,120,227, 13,112, 82,105, 71,240,188,201,191, 81, 93,135, -246,119,102, 44,193,222, 35,151,215,231, 68, 53,126,139,210,189, 34,128,171,172,198, 49, 24,140, 23,129,122,205,131,229,231,231, -231,167, 84, 42,145,148,148,132, 54,109,218, 36,202, 20, 10, 40, 21, 10, 40,205,204, 76,123,202,214,106, 27,187,186,186,162,164, -164, 4,142,142,142,144,203,229,144,203,229, 80, 40, 20, 80, 40, 20,143, 63, 91, 89, 89,129,227, 56,120,120,120, 64,171,213, 54, -174, 75,151, 47,126,232,124,116,195,140,119, 15,237,221,228, 63,116,232, 80,184,187,187,193,195,195, 29, 22, 22, 22,144, 74,165, -240,246,246, 70, 64, 64, 0,214,174, 93, 11, 98,221,240,138, 41,105,173,106,154, 36, 18, 9, 4, 65, 64,118,118, 54, 98, 98, 98, -112,231,206, 29, 92,186,116, 9, 55,111,222, 68, 89, 89,153, 73,121, 87,171,213,205,170, 11,116, 61,105,174,138,138,138,144,155, -155,139,184,184, 56,148,150,150, 54,175,209,236, 58, 56, 12, 11, 15, 15,151, 0,128, 74,165,130,159,159, 31,126,254,249,103,254, -248,145, 35,175,152, 93,187,102, 43,156, 58,101,179,245,183,223, 94,121,243,205, 55,133, 43, 87,174,160,164,164, 4, 15, 30, 60, -128,147,147,147, 84,105,102,246, 10,171,250,245, 35, 14, 40,183, 40, 45,237,211,190,125,251,132,226,226, 98, 44, 89,178,132,147, - 90, 89,253, 50, 17,144,212,122,130, 73, 36,157,186,117,235,134,253,251,247, 35, 45, 57,121,102,254,159,205, 21, 0, 32, 31,200, - 74,140,139,155,177,126,253,122,244,237,219, 23, 82,169,180, 83,125,211,215,182,109,219,112, 74, 41,238,222,189, 11, 5,112,185, -190,251, 7, 6, 6,182,176,180,180,196,253,251,247, 33, 3,206,214,180,157, 12, 56,123,243,230, 77,152,153,153, 33, 52, 52,180, -101,253,126, 69,182,204, 37,168, 75,230, 59, 51,150, 96,207,145, 11, 0,128,125, 7, 14,103, 63, 50, 87,115, 68, 86,203, 24, 12, -198,191,214, 96, 1,143,250,108, 73, 36, 18,200,165, 82,152, 41,149, 80, 40,149, 80,200,100,166, 63, 41, 19, 2,165, 82,249, 31, -166,170,210,104, 85,254,181,176,176, 48, 89,211,152,121,190,243,184,177,175, 43, 44, 45, 45, 33, 8, 60,164, 82, 41,204,205,205, -225,234,234,130, 70,141, 26,161,160,160, 0, 3, 7, 13,209, 38, 23, 72, 15,200, 60,123,220,121,154,130,226,121, 30,229,229,229, - 40, 44, 44, 68, 65, 65, 1, 74, 74, 74,160,213,106, 97, 66,235,224, 99,159,150,146,146,130,109,219,182, 33, 63, 63,191, 70,115, - 21, 31, 31,143, 77,155, 54, 33, 49, 49, 17, 18,137,196,228,227,211,163, 71, 15, 28, 60,120, 80,210,181, 71,143, 53,201, 62, 62, -153,201, 62, 62,153, 93,123,244, 88,243,251,239,191, 75, 60, 60, 60,144,146,146,130,155, 55,111,162,160,160, 0,162, 40, 18, 86, -245,235, 79, 6, 80,168, 46, 40,120,227,211, 79, 63,165,150,150,150, 88,186,116,105,179,181,192,171,181,237,227, 31, 16,208,194, -210,210, 18,247,238,221,131,121, 45,198,197, 28, 56,123,227,198, 13,152,153,153,161, 81, 72, 72,203,167, 57, 47, 69, 81,132, 32, - 8, 32, 64,189,205, 10, 33, 4, 50,153, 12, 28,247,215,204, 61, 76,200, 60,142,183,107,250,222,148, 41, 83,221,222,155,250, 14, - 78, 69, 60,242,128,146,178,248,135,204, 92, 49, 24,140, 23,145,122, 53, 17,198,197,197, 37,106,181,218, 16, 95, 95, 95, 68, 69, - 69,249,134, 53,110,124, 71, 38,147, 65, 41,147,213,254, 24, 95,129, 74,165,186,155,157,157,221,193,211,211, 19, 70,163,241,113, -147, 96,101, 51, 97,229,103, 0, 80, 42,149,184,119,239, 30, 84, 42,213,221, 58, 51, 33,148,249,248,249,249, 33, 43, 43, 27, 74, -165, 18,118,118,182, 48, 51, 51,131, 82,169,194,162, 69,139,196, 53,171, 87,255,168, 12,155, 82, 52,237,205, 25,244,234,194, 95, -255,150,130, 54, 55, 55,191,235,235,235,219,206,194,194, 2,123,247,238, 69, 98, 98, 34,138,138,138, 30,247,155,210,104, 52,208, -233,116, 80,169, 84, 8, 13, 13,133,189,189, 61,162,162,162,106,204,123, 97,126,254,158,200,200,200,118,173, 90,181,122, 92,244, - 93,187,118, 37, 93,187,118,117,172, 18, 53, 67,126,126, 62,110,223,190,141,136,136, 8,240, 60,143,232,232,104, 65,167,209,108, -103, 85,255,233,208, 2, 23, 36,235,215,175,155, 52,105,210,155, 29, 58,116, 0, 5,250, 1,248,173,198, 39, 24,142, 35, 82,169, - 20,132,144, 90,141, 15, 1,196,202,101,171, 72, 61, 92,123, 37,151, 46, 93,138, 20, 4,161, 67, 80, 80, 16,116, 64,107, 0, 7, -235,179,127,108,108,236, 13,163,209,216,179,105,211,166,216,179,115,103,103, 0, 73,213, 62,204, 0,157,155, 55,111, 14,141, 70, -131,232,232,232,235,166,154, 43,231,176,187,107,166, 76,120,109,252,203,131,123, 99,247,254,163,216,119,224, 72,234, 79, 95,127, -236, 69,169,104, 96,181,138,193, 96,252,235, 35, 88,197,197,197,215,238,223,191,143,182,109,219, 34, 54, 62,126,168, 78,163,145, - 87, 70,177, 56, 73,221, 22, 75, 83, 94,126,242,252,249,243,124,179,102,205, 80, 86, 86,246,216, 84, 85,141, 94, 85, 26, 46, 11, - 11, 11, 28, 62,124,216,160, 41, 47, 63, 89,151,174,192, 11, 34,199,113, 32,132, 64,167,211, 33, 51, 51, 11, 90,173, 14,191,254, -250, 43,214,174, 94,253,106, 90,102,230, 7, 80,218,105,254,138, 2, 52,245, 94,168,209,104, 78,158, 60,121,210,232,235,235,139, -113,227,198, 97,218,180,105,152, 54,109, 26, 38, 78,156,136,241,227,199, 99,244,232,209, 24, 54,108, 24,218,180,105, 3, 39, 39, - 39, 36, 36, 36, 24, 53, 26, 77,141,121,167, 90,237,174,177, 99,199,230,104,181, 90, 8,130, 0,157, 78, 7,141, 70,243, 56,202, -118,243,230, 77,236,217,179, 7,171, 87,175,198, 31,127,252,129,242,242,114,148,148,148,224,198,141, 27, 69, 18,163,113, 7,171, -250,207,116,210,236, 62,127,254, 60,236,236,236,224,238,233,217,165,214,135,146,216,216, 91,130, 32,160, 73,147, 38, 40, 7,106, -220,182, 28,232,210,172, 89, 51,104,181, 90,220,139,142,190, 89,223, 52,149,150,150, 94, 77, 72, 72, 64,215,174, 93,225,230,233, -185,204, 5, 48,171,207,254, 34,207,159,191,112,225, 2, 94,127,253,117,248,248,249,125,109, 1, 56, 61,185,141, 5,224,228, 27, - 16,240,245,248,241,227,113,236,216, 49,136, 60,127,190, 38, 61, 87, 87,215,150,238,238,238,191,123,120,120, 68,184, 4, 28, 79, - 26,218,167,237,248,170, 29,218,105, 81,220, 8, 15, 15,143,205, 28,199,125,196,106, 20,131,193,248,215, 27, 44, 81,163,153, 55, -107,214, 44,189, 68, 34,193,187,239,190,235,244,195, 79, 63,205,219,177, 99, 71,171,219,119,239,186,234,117,186,186, 29, 86, 73, -201,138, 5, 11, 22, 20, 25, 12, 6, 4, 7, 7,163,160,160, 0,130, 32, 64, 34,145, 64, 42,149, 66, 34,145,128,227, 56,152,155, -155, 35, 50, 50, 18,219,183,111, 47, 65, 73,201,138, 58,211, 37,138,119,247,238,221, 11,169, 84, 74, 85, 42,213, 99,211,243,221, -119,223,229,188,153,153,185, 7, 0, 36, 18,137, 30, 0, 56, 9, 49,169, 87, 46,199,113,117,118, 92, 87, 40, 20,149,157,251,235, -238,228,206,243, 43,126,254,249,231,210,135, 15, 31, 66,173, 86, 63,110, 26, 44, 43, 43, 67,105,105,233,227,207,149, 38,241,236, -217,179,165,230, 60, 95, 99,222,213, 64, 86,226,195,135, 3, 91,181,106,149,159,148,148,132,178,178, 50,196,198,198,226,210,165, - 75, 56,120,240, 32, 78,159, 62,141,184,184, 56,232,245,122,216,218,218,162,164,164, 4,191,255,254,123,137,174,172,172,183,186, -154,126, 64,140,255,199,203,205,173,135,139,179,115,170,147,163, 99,186,151,155, 91,143,106,140,198,131, 7, 15, 30, 64, 16, 4, -248,251,251,219,215,214, 15, 75,224,249,243,151, 46, 93,194,232,209,163,225,234,225,177,200,169, 26,227,226, 4, 56,185,121,122, - 46, 26, 55,110, 28, 78,158, 60, 9,161, 22,227, 82, 19, 42,224,187,143, 63,254, 88, 35,151,203,177,125,251,118,127,235,192,192, - 24, 41,240,154, 2, 8, 14, 0,228,117,237,111, 9,252, 48,123,246,236, 44, 0,216,188,121,179,163, 91, 64, 64,148, 20, 24,167, - 2, 26,168,128, 6, 82, 96,156, 91, 64, 64,212,246,237,219, 29,121,158,199,180,105,211,178, 44,129, 31,106,210,147, 72, 36,239, -101,100,100, 12, 76, 79, 79,239,156, 21,123,209,235,167,175, 63,198,169,136,203,248, 97,245,150,245, 57, 81,141,223,202,206, 78, -187,154,158,158, 62, 38, 45, 45,141, 45, 22,203, 96, 48, 94, 72, 72,101,179, 68, 85,100,109,190,204, 6,168,115,151,182, 77,112, -237,118, 76,177,131,157,205,145,202,255, 21,221,223,219,240,149,174, 62,205,230,205,155, 7, 66, 8,238,223,191,143, 59,119,238, - 0, 0,150, 44, 89,162,230, 40, 29, 90,185,222, 89,213,213,182, 43,215, 59, 83,234, 82, 45,155,219, 37,248,253,182,113,189,196, -202,202, 10,101,101,101,144, 72, 36, 80,169, 84,176,176,176,128, 82,169,196,157, 59,119,240,250,184, 55,132, 56,190,233,227,137, - 70, 43,215, 59,251,211, 10,222,132,112, 0,208,193,193,193, 60, 69, 46,255,208,201,197,229,227,169, 83,167,154,117,238,220, 25, - 10,133, 2, 45,219,116,202, 50,107,246,241, 74, 78, 66,248,140,188,226,207, 3, 26,184,219, 68, 63, 76, 2, 64, 30,173, 89, 88, -177, 22, 97,117,233,108,172,186,227,255,219, 79,243,173,195,194,194, 64, 41, 69,113,113, 49,178,179,179,145,147,147,131,162,162, - 34,104, 52, 26,136,162,136, 19, 39, 78,224,196,149,248,146,108,171,151,226,107, 74,231,255,231, 61,201, 42,196,236,129,239,202, -229,203, 36,118,118,118,200,206,206, 70, 94, 94,222,227,166, 66, 65, 16, 80, 90, 90,138,253, 7,254, 16,226,133,198,137, 58,101, -131,210,186, 52, 81,158,106,102, 95,118,193,163,101,184, 47,157, 56,113,162,149,181,181, 53, 68, 81, 68, 65, 65, 1, 18, 19, 19, -241,224,193, 3,156, 59,119, 78,157, 83, 98,164, 26,199, 94,105,149, 19,141, 86, 91,158,207, 47,170,247,207,211,172,168, 75, 0, -224,238,230,150,153,156,156,236, 44, 8, 2, 60, 60, 60,248,162,130,130,197, 10,224,152, 28,200, 32, 0, 45, 5,102, 47, 95,185, -242,141,193,131, 7,163,117,235,214,169, 89,217,217, 13,170,171, 75, 32,132,115, 7,236,228, 62, 62,247, 46, 95,190,236,244,224, -193, 3,140, 29, 59, 54, 55, 35, 53,245, 67,107, 32, 2, 0, 74,128, 46,238, 94, 94,203,182,110,221,234, 20, 30, 30,142, 38, 77, -154,228,234, 18, 19, 67, 50,128,194, 26,234,103,141,231,102,225,131,131,126,239, 14, 13,111,245,206, 59,239,128,231,121, 68, 68, - 68,224,202,149, 43, 72, 73, 73,193,133, 11, 23,138,172, 45, 44, 70,214,118,110,162, 56,198,170,111,195,114,255,205,155,127, 35, -114,185, 28,235,215,175,199,205,155,143,130,105,205,155, 55,199,248,241,227,193,243, 60, 70,143, 30, 67,255,136, 49,123, 60,209, -104,117,117,201,211,211, 51, 92, 20,197,165,132, 16,185,160,112,110,149,149,112, 83,229, 22,212, 49, 35,235, 97, 15,175,250,244, -185, 98,245,147,105, 50,205,127,143,230,139, 70,157,107, 17, 46, 92, 5,155, 63, 47,199,241,118,230,254,245,139,165,253,250, 15, - 12,249,252,179, 89,146,198,141, 27, 67, 20, 69,180,110,221, 26, 99,199,142, 53, 15, 9, 9,169,107,189,179,178,151,134,188,153, -240,210, 75, 47,217,190,251,238,187, 54, 93,186,116,145, 85, 46,149,115,247,238, 93, 28, 58,116,200,176,109,219,182,146,116, 69, -167,162, 11,135,215,150,153,178,222,217,133,252,124, 53,128,249, 65, 6,195,234,217,159,125, 54, 55,172,113,227, 55, 63,248,224, - 3,206,210,194, 92,182,240,243,183, 85, 0,240,229,247,219,108, 6, 15,127, 13, 43, 2,129, 46,175, 86,191,118, 92,213,116,166, -101,230, 36,191,246,198,136,192, 55, 71, 15, 21,135, 12, 25, 98,110, 99, 99, 3, 47, 47, 47,216,218,218, 34, 33, 33, 1,119,239, -222,165,199,142, 29, 43,187,125, 63, 69,182,105,199,177,100,133,165,179, 41,235, 6,150,190, 52,120,108,226,184,113,227,236,134, - 14, 29,106, 21, 22, 22, 38,147,201,100, 80, 42,149,200,203,203, 67, 90, 90,154,225,244,233,211,101,233,242,118,133, 23,142,108, - 40, 53,113, 45, 66, 77,231, 81,243, 98, 79, 30,157,251,193,237,219,183,199, 0,104,106, 48, 24, 60, 5, 65, 32, 28,199,101, 10, -130,112, 71, 91, 86,182,142,111, 62,119, 5, 91,139,208, 52, 4, 65,144, 11,130,128,162,162, 34, 28, 63,126, 92, 26, 23, 23,247, -249,237,219,183, 63,207,200,200,128,193, 96,192,240,225,195,209,188,121,115,156, 57,115, 6,185,217,217, 7,106,211,202, 0, 10, -165,201,201,111, 76,158, 60,249,224,134, 13, 27,200,221,187,119,157,214,173, 91,247,219,141, 27, 55, 0, 0, 45, 90,180,192, 27, -111,188, 1,169, 84,138,177, 99,199,210,148,196,196, 55,120,160,176,150,250, 89,219,185,153,123,104,219,119,183,135, 12, 27, 30, - 58,103,246,103,178, 14, 29, 58,192,201,201, 9,157, 58,117,130,193, 96,176, 53,225,220, 44,237,220,103,100,124,211,166, 77, 45, -150, 47, 95,238,250,198, 27,111, 96,202,148, 41, 0, 0,141, 70,131, 99,199,142, 97,218,180,105, 89, 41,210, 54,229, 55, 78,111, -175,181,126, 86, 68,166,122, 1,128,135,135, 71, 4,128,206, 92,121, 82, 60,235,208,206, 96, 48,254,213, 6, 11,248,255,245,206, -206, 93,137, 68,213,229, 56, 30, 97,127,207,104, 63, 52,254,141,105,139, 67, 37,198, 34, 59, 51,169,222,238,206,237,219, 92, 66, - 66, 66,173, 63, 86,185,222,153, 78,233, 85, 38,100,230,183,250,110,197,138, 15,214,172, 89,211,163,114, 42, 6,149, 74,117, 87, - 83, 94,126, 18, 37, 37, 43,116,190, 94,167,234,187,118,222,131,252,252,108, 0,147, 2, 68,113,229,184, 55, 39, 46, 33,150, 94, -210, 89, 11,127,213, 74, 36, 18,125,124,122, 54, 86, 4, 2, 22, 38,204,135,170,214, 3,119,243,157,249, 40,218, 37,102,233,226, -197,211, 87,253,240, 67, 27, 51, 75,203,206, 6,131, 33, 68, 20, 69, 0,184,167, 85,171,207,242, 6,195,149,116,247, 9,223, 42, - 44,157,169,169,235, 6,234, 84,190,165, 22,154,115,173,118,239,220,249,254,225,195,135,255, 35,239, 86,192, 74,157,181,239, 73, - 83,242, 94,117, 27, 35,112, 17, 57, 57, 23,107,124,218, 0, 91,139,208, 84, 56, 74,223,182,179,179,251,173, 71,143, 30,170,158, - 61,123,162, 95,191,126,104,223,190, 61, 68, 81, 4,165, 20,165,165,165,216,177, 99, 7,190,249,230,155,135, 46,192,188,186,244, -120,224,136,116,255,254, 65, 45, 90,180, 88,183,124,249,114,135, 73,147, 38,193,172, 98,106, 19,141, 70,131,211,167, 79, 99,218, -180,105,249, 73,241,241,111,240,192,145,186,244,106, 63, 55, 85, 15,120,219,193,137, 35,167, 44, 14, 52,150,100,216, 57,152,243, -174, 81,145,119, 77, 62, 55, 97,211,168,180,248,230,142,214, 47, 15, 29, 58,133,147, 74, 59, 86, 78,197, 16, 29, 29,125,189,114, -177,103, 52, 31,127,162, 62,117,137,210, 71,115,207, 81, 74, 89,135,118, 6,131,241,239, 54, 88, 82,169, 52,167, 50,202, 35,149, - 74,115, 18,246, 77,120,173, 54, 17, 47, 55,183,158, 21, 79,199,168,107, 45,194,202,247, 9, 69, 69,165, 21, 51,180, 87, 59,137, -168,236,137,237,235,147,169,184,236,236, 24, 0,253,129,100, 32,230,220, 35,189,214, 11,103, 86,205, 83,141, 5,242,167,223,149, - 23,164,101,103,159, 3,112, 14,192, 55,213,166,211, 91, 94, 80, 87, 58,159,204,251,237,228,228,146,138,124, 87,159,119,231,186, -243, 46,173,103,249, 72,159,161, 60,255,109,100,230,230,238, 3, 96,225,120,240,160,203,161,131, 7, 95,153, 62,125,250,203,238, -238,238,129,142,142,142,118, 86, 86, 86,220,229,203,151, 19,244, 90,237,202, 0, 96,195, 3, 64,109,138, 38, 15, 28,114,141,143, - 15, 30, 52, 96,192, 7,156, 84,218, 49, 36, 36,164, 57, 0,220,187,119,239,166,200,243,231,157,128, 21, 60, 80, 96,194,113,172, -223,185,169,172,255,185, 89,252,104, 22,249,133,224,121,160,162,249,255, 89,206, 77, 81, 20, 23,122,120,120,148,178, 25,218, 25, - 12,198,191,137,106,251, 96, 61, 55,113,214, 62,205, 52, 95, 32, 77, 66,136, 4,128, 69,101, 68,134,149, 39,211,100,154, 76,147, -105, 50,106,124, 32,102, 69,192, 96,152, 6,165, 84, 0, 80,194, 74,130,193, 96, 48, 24,117,154, 80, 0,225, 53,220, 76,234,243, -100, 31,254, 20, 55,171, 72,166,201, 52,153, 38,211,100,154, 76,147,105,254,187, 52,235,210,126, 81, 34, 99,172,137,144,105, 50, - 77,166,201, 52,153, 38,211,100,154,127,187,230,139, 6,199,138,128,193, 96, 48, 30, 49,111, 30,225, 0, 66,128,121, 28,176, 75, - 2,140,144, 60,250,252,244,140, 24, 65,170,157,136,246,189,209,196,138,149, 56,131,241,226,194,250, 96,253,141,184,185,185,121, -187,184,184,252, 66, 41, 37, 57, 57, 57, 19, 50, 51, 51, 83, 88,169,252,239,225,224,224,208, 3, 0,242,243,243, 79,190,168,121, - 12,243, 35, 67, 41, 65,240,159,158, 80, 69,164, 68, 37,210, 63,173,179, 24,230, 75,198, 80,238,207,115,105, 17,138,251, 81, 9, -116,111, 61,158,124,185, 33, 61,156,150, 2,192,190,147,185, 31,209,138, 9, 85,159, 39,238,238,238, 65, 14, 14, 14, 71, 37, 18, -137, 84, 16,132,201,119,239,222, 61, 88, 91,122, 0,224,157, 97,152,101,231,224, 56,107,246, 36, 34,211,235,150, 20,233,180,218, - 98,142,227, 18,229,114,249, 57,157, 40, 63,242,253,102, 99, 84,117,251,215,150,254,112, 63,210, 55, 56, 36,116, 96,139, 16,179, -248,165, 35, 90,175,232,242,166,163, 44,225,250, 45,203, 85,123, 83,126,113,178,243, 24,248,254, 40,233, 65,165,153, 48,230,235, -181,180,140,157,105,166,177,136, 16,123, 3,208, 88,174, 84,122, 10, 60,239, 2, 0, 18,169, 52,219,168,211,165,202,129, 59, 51, - 41, 45,250, 31,209,116, 52, 74,165,225,114,133,194, 83, 48, 26, 93, 8, 64, 33,147,229,136,122,125,170,192,243,145,115, 40,205, -127,218,116,202,148, 74, 47,129,231, 93, 8, 64,159, 87,222,159,167, 38,163, 14,131, 21, 16, 16,112,157,227, 56, 79,142,227, 42, - 47, 66, 85, 47, 72,213,254, 21, 4, 33,237,254,253,251, 45, 77,253,113, 63, 63, 63,107,173, 86,251, 10, 33,228,181,138, 11,213, - 22,149, 74,181, 35, 33, 33,225,169, 58, 18,251,249,249, 89, 83, 74, 63, 50, 51, 51,235,174,213,106,195, 0, 64,165, 82, 69,105, - 52,154, 83,132,144,165, 79,163, 75, 8,145,186,185,185,141,176,176,176,232,198,243,124, 55, 74, 41,145, 74,165,167,213,106,245, -169,204,204,204,157,148, 82,190,190,154,238,238,238,102, 14, 14, 14, 95, 6, 6, 6,190,250,238,187,239,230,219,219,219, 55,154, - 55,111,222,181,240,240,240,173, 5, 5, 5,159,101,100,100,104,254, 23, 42, 7, 33, 36,192,213,213,117,139, 76, 38,147,164,166, -166,118, 3, 0, 47, 47,175,211,122,189, 94,200,201,201,121,141, 82, 26, 87, 31, 61, 39, 39, 39, 11,153, 76,214,214,194,194,162, -165,133,133, 69,103, 65, 16, 66, 68, 81,132, 40,138,247,202,203,203,207, 26,141,198,235, 70,163,241,114,110,110,110,249,255,202, - 9, 66, 8,177,114,117,117,253,141,231,121, 16, 66, 26, 82, 74, 75, 95,196, 11, 1, 37, 8,142,142,186,215,168,234,119,161, 97, - 33,255,185, 29, 7,239, 26,182, 51,217, 96,245,235,104,219,103, 96,223,166, 28, 0, 24,244,215,250, 0, 56,244,188,205, 85,191, -126,253, 46,174, 92,185,210, 78,167,211,225,227,143, 63,222,210,176, 97,195, 31, 31, 62,124, 56,171,182,253,172,173,109,166,207, -255,234, 7,243,138,235,153,179, 40,138,206,153, 25,169, 13, 99,238,223,237, 19,115, 63,114,209,212,225,247, 47,105,120, 97,226, -218,125,184,111, 74, 58, 66,125,201,128,193, 47, 15,237, 63,255,139,185,120,245,213, 87, 27, 68, 21,104,205, 60,162,110, 43,202, -169,101,128,163,179,231,160, 25,159,125, 77, 46, 95, 60, 51,104,231,182, 53,167,102,188, 73,186, 51,147, 85,231,185, 72, 22, 74, -165,109,237,130,131, 59,143,220,183, 15,150, 94, 94, 82,169, 82,201, 1, 0,175,211,121,149,165,166,186,109, 31, 52,168,205, 60, - 66,206,204,161,244,202,223,169, 57, 95, 42,237,224, 16, 28,220,225,213, 67,135, 96,233,230, 38,229,228,114, 14, 0, 68,131,193, -179, 36, 35,195,109,123,255,254,173,231,201,100,103,231,242,252,101,106, 66, 63,157,127, 74,222, 25, 38, 26, 44,142,227, 60,111, -222,188,233,108, 97, 97, 81,249,148, 6, 65, 16, 32, 8, 2, 42,110,138,143, 39, 94,164,148,130,231,121,116,237,218,213,164,167, - 87, 55, 55,183,238, 0,198,133,135,135,191,252,209, 71, 31,201, 59,116,232, 0, 65, 16,112,234,212,169, 78,203,151, 47,255,222, -221,221,125, 15,128, 13,153,153,153, 39, 77,125,186,117,115,115,235,109, 97, 97,177,249,243,207, 63,183,238,216,177,163,180,114, -118,248,156,156,156,182,231,206,157,107, 57,111,222,188,201,110,110,110,163, 51, 51, 51,143,154, 90, 56,158,158,158,225, 13, 27, - 54,220,213,183,111, 95,207,150, 45, 91,170,130,130,130, 64, 41,197,173, 91,183,222,136,137,137, 25,117,232,208,161, 57,158,158, -158,195, 77, 93, 79,141, 16, 66, 2, 2, 2,198,186,186,186,126, 57,125,250,116,251, 33, 67,134, 40, 34, 35, 35, 11,253,253,253, -201,158, 61,123,156, 14, 28, 56, 48,249,199, 31,127, 28, 17, 24, 24,248, 89, 92, 92,220, 70, 83, 78,188,134, 13, 27, 94,231, 56, -206,211, 20, 3, 92, 31, 19, 76, 8,105,230,235,235,187,227,236,217,179,190, 73, 73, 73,194,208,161, 67, 55, 1,192,133, 11, 23, -154, 80, 74, 73,135, 14, 29, 14, 19, 66, 94,161,148,222, 50, 37,239, 30, 30, 30, 77,156,156,156,246, 15, 25, 50,196,222,219,219, -219,220,211,211,147,168, 84, 42, 72, 36, 18,148,149,149,185,199,196,196,244,188,117,235,150,230,194,133, 11, 5, 30, 30, 30,131, -210,211,211,239,212,227,194,219,222,217,217,121,140, 76, 38, 11,231,121,222, 3, 0,164, 82,105,186,209,104,140,204,201,201,249, -141, 82,122,241,105, 79, 16, 23, 23,151,239,151, 47, 95,238,152,157,157, 77,231,206,157,251, 61,128,177, 47,242, 5, 33,242,214, -101,156,187,112, 22, 63,175,254,173,152, 82, 36,255,135,193, 18, 17, 27, 22, 22,226, 52,241,237, 49,246,157, 58,116, 70,120,179, -182,117,106, 14,233,225, 56, 95, 33,151, 58,168,117,186, 43,121,105,220,126,239, 0,197,208,209,195, 90,198, 3,192,145, 19,119, -135,182, 9,176, 63,239,232, 41, 14, 54, 87, 42,219,232, 13,124,254,190,147,121, 95,212,199, 76,185,186,186, 30,181,180,180, 52, - 47, 42, 42,202,202,207,207, 95,213,175, 95,191,133,203,151, 47,183,139,143,143, 71,106,106, 42,198,141, 27,103,153,158,158,254, -174,183,183,247,165,148,148,148, 26, 35, 89, 37,165,197, 43,190,156, 59,125,142,149,141,157,196,220,204, 2,150, 86,214,240,245, -107,136, 86,109, 58,161,231, 75,131, 16, 31, 23,211,110,199,230, 53,183, 38, 15, 75, 91, 20, 83,128, 5, 17, 17,168,241,218, 20, -214,128,116, 25, 60,252,145,185,250, 98,254, 92, 60,136,185, 95,154,148,194, 77,253,227, 6,103,222,183,123,168, 82,175, 43, 75, -186,124,241,140,111,219,246, 93, 1,160,229,206,109,107, 78,205, 27, 77,122,204,217,252, 98, 26,248,231, 97,174,230,203,100, 99, -123, 47, 95,238,220,124,242,100,121, 89, 98,162, 33,254,231,159,213,217,103,207, 10, 82,165,146,122,245,233, 67,156,186,117, 83, - 77,190,119, 79,126, 97,241,226,206, 95, 41, 20,254,159,234,245,155,255, 46,205,126,223,125,231,212,108,194, 4,121, 73,124,188, -225,193,247,223,107,178, 78,156,224,229, 42,149,232,217,175,159,196,165, 87, 47,229,228,168, 40,249,165, 37, 75, 58, 72,103,207, -246, 3,240,219,139,144,119, 70,253, 12, 22, 44, 44, 44,176,109,219, 54,200,100, 50,200,100, 50, 72,165,210, 26,223,251,248,248, -152, 98,130,134,133,133,133,253, 48,125,250,116,151,129, 3, 7,194,206,238,207,171,108, 12, 24, 48, 0,253,250,245,147, 39, 36, - 36,140,218,185,115,231,168, 77,155, 54,101,185,185,185, 77,205,172, 88,176,185,150,155,119, 55,127,127,255, 61,219,182,109, 51, -211,104, 52,136,136,136, 64, 97, 97, 33,148, 74, 37, 60, 60, 60,208,169, 83, 39,233,233,211,167,237, 71,141, 26,181,199,195,195, - 99, 64,122,122,250,233,186,210,234,234,234,218,210,201,201, 41, 98,245,234,213,170,224,224, 96, 18, 27, 27,139,166, 77,155, 2, - 0,242,243,243, 49, 96,192, 0,213,144, 33, 67, 2,222,125,247,221, 75,174,174,174, 93,179,178,178,174,215,145,247, 22, 77,155, - 54,221,216,167, 79, 31,247,153, 51,103, 90, 91, 90, 90, 34, 41, 41, 41,211,213,213,181, 97,165, 9, 26, 60,120,176,162, 87,175, - 94,110,171, 86,173, 90,121,232,208,161,143,221,220,220,198,102,102,102,222,168, 77,151,227, 56,207, 27, 55,110, 56,155,155,155, - 35, 59, 59, 27,155, 55,111,198,187,239,190, 11,169, 84,138,156,156, 28,236,216,177, 3, 83,167, 78, 5,199,113, 40, 41, 41, 49, -201, 4, 91, 88, 88,244,108,218,180,233,218,147, 39, 79,122,218,218,218,194,221,221,157,155, 61,123,118,184,191,191,191,153,155, -155, 27,151,145,145,129, 61,123,246,248,143, 25, 51,102,191, 74,165,122, 67,171,213,214,217,116,230,224,224,176,110,211,166, 77, -222,183,111,223,198,170, 85,171, 80, 80, 80, 0,133, 66, 1, 27, 27, 27,184,186,186, 34, 40, 40,136, 76,158, 60,217,188, 91,183, -110,230,115,231,206, 93, 7,160,153, 9, 23,221,166,206,206,206,191,140, 26, 53,202,127,238,220,185,182,110,110,110, 48, 55, 55, - 7, 0, 20, 23, 23,123, 38, 37, 37,181,157, 51,103,206,112, 23, 23,151,132,156,156,156,137,148,210,219,245,188,168, 55,235,209, -163,199,128, 33, 67,134, 72,178,178,178,176,102,205,154, 1,132,144,102,166,154,202,127, 34,231, 46,156, 69,183, 62,163,160,225, -205,100, 7,246,110,166,101,177,171, 29, 44,109,109,165, 0, 80, 86, 84,196,219,219, 91,136, 3, 6,141, 54,116,239, 51, 88,125, -234,200, 22,115, 83, 12,150, 66, 46,117,216,190,118, 82,234,217,203, 15, 67,142,158, 74,234, 57,100, 80, 79, 78,106,209, 40, 0, - 0, 62,252,224,109,197,190,223, 79,252,216,187,123,131,204,206,109, 27,166,142,124,243,103,175,250,152, 43,127,127,255, 51, 71, -143, 30,117, 81, 40, 20, 40, 44, 44,116, 88,191,126,253,183,109,219,182,229,226,226,226,112,255,254,125, 36, 38, 38,162,168,168, - 8,173, 91,183,182,140,142,142, 94, 5,160, 70,131,245,211,110,124,185,120,134,203,119, 78,110, 78,190, 70,189,206,137,215,101, -135,157, 60,122,187,201,238, 29,234, 22,206,174,158, 13, 71,141,158,128, 25,179,191,150,237,221,181,241, 11,156, 62,134,136,218, -102,241, 39,104,255,233,204, 89, 40, 81,235, 48,250,181,183, 49,102,244,219, 14, 84,212,187, 81, 81,107,161,215, 22,218,218,200, - 99, 14,110, 92,191, 99, 40, 0,207, 42, 38,235, 36, 51, 89,213, 51, 95, 42,109,243,210,178,101,206, 77, 39, 79, 86,222,158, 55, -175, 60,239,236, 89,141, 95,191,126,133,205, 39, 77,210, 1, 64,105, 98,162,252,193,156, 57,230, 78,157, 59,155,117,248,228, 19, - 91,163, 90,237,186,128,144,214,179, 41,189, 90, 95, 77,223, 87, 95, 21,150,238,217,211,234,242,226,197, 93,177, 96,129,164, 91, -243,230,183,102,255,252,115,154, 41,154, 11,165,210,182,125,127,252,209,185,241,248,241,202,235,179,102,149, 23, 93,189,170, 9, - 24, 58,180,160,213,180,105,122, 72, 36, 80,167,165,201,226,230,205,179,176,105,211,198,172,221,135, 31,218, 10,122,189,203, 60, - 66,218,212, 22, 33,154, 47,149,182,233,179, 98,133, 83,211, 73,147,148,183, 23, 46, 44,207, 56,117, 74, 87, 18, 18,130,102, 47, -191,156,239,225,224,160,123,218,188, 87,213,204, 59,125,250,153,203,147, 81,205,101,160,166, 32, 73,163, 70,141,178, 99, 98, 98, -156,119,239,222,109,146,193,114,119,119, 71,167, 78,157,114,238,222,189,235, 82,203, 5, 49, 53, 53, 53,213,147,231,121, 40, 20, -138, 90, 19, 86, 90, 90,138, 59,119,238, 96,212,168, 81,105, 25, 25, 25, 53, 94,116,237,237,237,173,236,236,236,226, 79,159, 62, -237, 24, 29, 29,141,235,215,175,195,223,223, 31,118,118,118,144,201,100, 48, 26,141, 40, 45, 45, 69, 96, 96, 32,204,205,205,209, -175, 95,191,188,130,130, 2,255,130,130,130, 26, 47, 98, 13, 26, 52, 80,202,100,178,135,187,119,239,246, 10, 15, 15,199,213,171, - 87,225,229,229, 5, 87, 87, 87, 0, 64, 98, 98, 34, 46, 92,184,128,190,125,251, 34, 50, 50, 18,147, 38, 77, 74, 53, 26,141, 13, -147,146,146,116, 53, 54, 23,132,134,102,238,220,185, 51, 45, 56, 56, 88, 91, 94, 94,206,101,103,103,203,206,158, 61,203,151,149, -149, 89, 22, 21, 21,201,138,139,139,165,197,197,197,178,242,242,114, 25,199,113,114,157, 78, 39,187,124,249,178, 36, 63, 63,223, -186,182,114, 10, 14, 14,206,190,127,255,190,243,239,191,255,142,198,141, 27, 99,247,238,221,248,232,163,143,112,225,194, 5,120, -122,122, 98,215,174, 93,248,232,163,143,112,255,254,125, 56, 57, 57,161,123,247,238,181, 30, 35, 0, 8, 12, 12,140,189,115,231, - 78,128, 66,161, 64, 92, 92, 28,210,210,210,208,185,115,103,136,162,136,172,172, 44, 60,124,248, 16, 25, 25, 25, 8, 8, 8,192, -107,175,189, 22,151,150,150, 22, 88, 87, 69,107,209,162, 69,238,201,147, 39, 29,155, 52,105,130,172,172, 44,216,218,218, 62,126, -217,216,216,192,214,214, 22,126,126,126,152, 62,125, 58,154, 54,109,154,147,148,148,228, 82,151,249, 9, 15, 15, 63,122,234,212, - 41, 71,123,123,123,104,181, 90,104,181,218,199, 15, 7,230,230,230,144,201,100, 0,128,135, 15, 31, 98,192,128, 1,185,241,241, -241,125, 76, 53, 71,132, 16,206,197,197,229,254,237,219,183, 27, 90, 89, 89, 33, 53, 53, 21,145,145,145,120,243,205, 55, 31,150, -151,151, 7,255, 21,253,134,254, 78, 66,253,201,231,209, 81,247, 26,133,134,134, 20,191,254,198, 68,217,224,129,131,203,111, 94, - 57,102,148,233,206,148,189,212,201, 38, 3, 0, 78, 94, 46,117,214,201, 58,201, 91,182,238, 77,246,239,223,175,218,184,225, 23, -105, 84,212, 61,215,208,176,144,152,232,120,186,176, 38,237, 1,221,108, 95,255,104, 74,159,144,206, 29, 58, 75, 75,202,169,235, -218,117,191,182, 78, 78,138,119, 1, 0,159, 6,254,217,111,190,241,246, 85,107, 11,146,117,246,194, 89,126,233, 15, 71,238, 29, - 60, 93,180,201,132,232,178,191,151,151,215,165,245,235,215, 59, 58, 58, 58,194,198,198, 6,106,181, 26, 6,131, 1,209,209,209, -218,237,219,183, 27,173,173,173,173,178,178,178, 80, 88, 88, 8,169, 84,138,203,151, 47,167,100,101,101,249, 84,119,172, 43,223, -239,220, 57, 87,218,165,165,183,157,156,163,102, 10, 33,198, 93, 42,161, 10, 2, 91,151,147, 17,151,155,158,137, 56, 59,186,223, -192,145, 78,237, 58,116,195,215, 11,103, 24, 19, 83, 83,155,173,221,135,251,213,213,133, 16, 63,210,125,200,176,161, 35,230,127, - 49, 23,115,231,207,195,193, 3,251,138, 45,205, 56,157,181,149,204,166,115,199, 14,218,233, 83, 95, 73, 85,151, 22,121,125,187, -124,233,171,189,250, 12,245,108,219,190, 43, 46, 95, 60,131,157,219,214, 92,151, 43,141,172,185,176, 10,243, 8,177,179,245,247, -159, 56,229,225, 67,249,221,185,115,203,248,140,140,194,150,211,166,229, 85,183,109,218,241,227, 22, 10,119,119,107,135, 65,131, -236,150,251,248,192,152,147,243, 75,117,125,136,170,211,188,234,230,102,187,247,244,233, 30,162, 84,218,229,221, 41, 83,204,122, -246,236,137,146,146, 18, 28, 60,120, 16, 91,183,108,209,185,186,186,222,177,189,122,245,150,127,102,230,231,213,105, 46, 34,196, -222, 42, 40,104,194,187,247,238,201,111,126,254,121, 25, 10, 10, 10,154, 79,157,154, 47, 8, 2,153,176,112, 97,191,248,204,204, - 46,217,121,121, 62, 0,224,108,107,155, 26,236,230,118,243,187, 77,155,162,127,104,212,136,150,101,100,252, 50,135,210,194,186, -210,185,253,194, 5,151,195,185,185,111,217,217,217,153,229,229,231, 75,228, 50, 89, 65,139,134, 13,183,127, 61,117,106,132,230, -250,117,197,211,230,189,229,180,105,121,197,106,181,244,179,239,190,235,144,145,159,223,160, 92,175, 15, 44, 46, 43,115,229, 13, - 6,206,202,204, 44,191, 65, 64, 64,118,201,169, 83, 89, 62,101,101,239,175, 40, 47,207, 97,181,242, 25, 35, 88,132, 16, 80, 74, - 77, 50, 87, 50,153,236, 79,205, 80,181, 32,151, 72, 36,184,122,245, 42,114,114,114,208,184,113, 99,248,250,250,254,105,131,248, -248,120, 28, 58,116, 8,133,133,133,104,209,162, 5, 0,200,107, 19,180,178,178,250, 96,214,172, 89,182,122,189, 30, 55,111,222, - 68,139, 22, 45,160, 82,169, 32,147,201, 32,151,203, 33,149, 74,225,234,234,138,188,188, 60,184,184,184, 96,242,228,201, 54,223, -125,247,221, 7,168, 97,153,154,138,230,208, 41,163, 70,141,114, 14, 15,127, 52, 69, 71,106,106,106,101, 90, 0, 0,206,206,206, -184,117,235, 22, 90,180,104, 1, 23, 23, 23,244,237,219,215,121,255,254,253, 83, 0, 44,173, 49,227,114, 57, 23, 28, 28,220,170, - 34, 66, 4,142,227, 30, 88, 91, 91, 59,185,184,184, 88, 88, 91, 91,255, 71, 30,215,175, 95, 95,164, 80, 40,140,166, 20,106, 86, - 86, 22,194,195,195, 81, 84,244,232, 92, 42, 47, 47, 71, 96, 96, 32,138,139,139, 1, 0, 58,157, 14,238,238,238,143, 13, 72, 77, - 52,109,218,116,110,112,112,240, 75, 93,187,118, 85, 74,165, 82,220,190,125, 27,205,155, 55,199,246,237,219,225,227,227, 3,115, -115,115,196,196,196,160, 73,147, 38,136,136,136,128,147,147, 19,194,194,194,148, 45, 90,180, 56, 87, 80, 80,112, 58, 41, 41,105, -110, 45,145, 54,206,210,210, 18, 17, 17, 17, 88,183,110, 29, 18, 18, 18,144,145,145, 1,107,107,107, 52,107,214, 12, 33, 33, 33, -232,208,161, 3, 98, 99, 99, 65,234,168, 76,132, 16,215,134, 13, 27, 30,188,122,245,170, 35,199,113,136,136,136,128, 90,173,134, - 86,171, 69, 69, 95, 41,168, 84, 42,180,107,215, 14, 14, 14, 14,104,216,176, 33,246,238,221,235,212,171, 87,175, 67, 21, 17,168, -172,186,202,212,206,206,238,253, 47,190,248,194,203,197,197, 5,165,165,165, 80,171,213,112,119,119, 71,175, 94,189, 60, 14, 29, - 58,244, 62,128,229, 47,212,147,150,136,148,208,176, 16, 80,138,228, 3,123, 55, 83, 79, 39, 85,120,215, 22,162,243,131,104,105, -187,203,151, 35,195, 0,192,206,194,247,118,195, 16,195,131,136,107,199,211, 14,254,190,245,182, 32,128, 11, 9, 13,105,196, 81, -164,215,166,157,151,198,237, 63,122, 42,169,103,147, 38,157, 36,223,125, 59,103,240,132, 55,122, 43,237,237, 58,145,146,180, 29, -184,112,227,174,207,236,217, 51,157, 23, 44, 88,124,224,232,169, 36, 33, 47,141,251,210,148,244, 6, 52,176,255,126,247, 50,153, - 99,105,233, 22,220,142,181, 4, 49,107, 2, 95,191, 0,148,148,148, 64,169, 84,170, 94,125,245, 85, 97,214,172, 89,106, 43, 43, - 43,243,138,186,156,195,113, 92,239, 58,133,239,223, 3,223, 56,144,151, 89,233, 69,145, 90,106,160, 45,150,223,141,141, 71,167, -110,125,179, 91,183,104,182,112,241,210,229,159,251, 7, 54,114,122,245,245,137,178,101, 95,127,254, 51, 64, 59, 85, 39,115, 47, -129,158, 10,245, 37,102, 0,250,207,255, 98, 46,226,227, 31,218, 77, 24, 86, 52, 79, 42, 49,115, 15,110,220,197,234,231,245,199, -251, 4, 6, 53,106, 48, 97,242,251,127,172, 94,181,178,127,213, 72,214,182, 45,171,247, 19, 66,122,208,191,114, 14,157,127, 22, - 77,198, 28, 60, 8,117, 74,138,177,224,220, 57,109,143, 31,126,200,107,241,250,235,203, 13, 70,163, 35, 33,228, 79, 93, 33, 8, - 33,128, 40, 18,233,210,165, 28,117,119,135,209,214,118,220, 76, 32,168, 46,205,197, 70,227,176, 33,205,154,245, 95,187,121, 51, -124,124,124, 30,107,218,216,216, 96,202,148, 41,152, 60,121,178,242,206,157, 59,109, 14, 29, 58,212,102,211,143, 63,186,204, 4, -134, 61, 41,104, 0, 26,191,250,251,239, 40, 75, 76, 52, 20, 92,189,170,237,190,114,101,254,153,107,215,236,103,254,248,227,236, -198,205,155,123,252, 52,119,174,210,219,251,209,248,144,148,148,148,192,149, 43, 86,120,119,235,213,171,195,140, 15, 63, 92,127, -107,250,244, 80, 60, 90,146,173,198,116,102,157, 61,171, 63, 92, 80,240,214,206, 93,187,108, 27, 53,106, 4, 74, 41, 98, 99, 99, -157,215,173, 91, 55,177,203,228,201, 99, 62, 28, 53,106,118,175,132,132, 66, 33, 63, 95, 49,224,251,239,101,219, 70,140, 8,171, - 75,179,178, 60, 1,224,229,143, 62,250,160,117,251,246,161,125, 95,125,213,222,221,221,157,152,153,153,193, 96, 48, 32, 43, 43, -203, 46, 38, 38, 38,224,100,113,113,201,177, 91,183,126, 67,197, 34,238,140,103, 48, 88, 0, 32, 8, 66,189, 12,150,137, 38,235, -113,196, 43, 47, 47, 15,145,145,145,240,241,241,129,209,104,196,209,163, 71, 81, 84, 84, 4,185, 92, 14,185, 92, 14,189, 94,111, - 82,115, 86,231,206,157,165, 23, 47, 94,132,175,175, 47,204,204,204, 30, 27,171, 74,147, 37,147,201,224,234,234,138,226,226, 98, -116,236,216, 81,182,110,221,186,158,181, 25, 44, 75, 75,203,126,131, 6, 13,122, 28, 98, 43, 47, 47,135, 68,242,104,164,181, 94, -175, 71,105,105, 41,242,243,243, 81, 92, 92, 12,173, 86,139,166, 77,155, 42, 78,157, 58,213,175, 54,131, 85, 21,181, 90, 93,150, -147,147, 99,219,169, 83, 39,187, 13, 27, 54,196,180,107,215,238, 79,157,134,207,156, 57,163,213,233,116, 82,133, 66, 97, 82,103, -247,205,155, 55, 63, 46,251,140,140, 12,252,242,203, 47, 16, 69, 17,132, 16, 60,124,248, 16,223,125,247,221,227,190,114,181, 29, -163,224,224,224,190,191,253,246, 91,203, 77,155, 54, 21, 74,165, 82,196,196,196, 96,203,150, 45,160,148,194,209,209, 17,106,181, - 26, 57, 57, 57, 88,190,124, 57, 12, 6, 3, 44, 45, 45,225,225,225,161,154, 50,101, 74,199,121,243,230,201, 0,204,173,165, 46, - 9, 18,137, 4,222,222,222,248,226,139, 47,160,213,106, 33,151, 63,242,149, 37, 37, 37, 40, 42, 42,194,205,155, 55,145,152,152, - 8, 81, 20,107,189,177,168, 84,170,225, 27, 55,110,116, 86, 40, 20,208,106,181,120,248,240, 33,226,226,226, 16, 19, 19,163, 43, - 40, 40,224, 45, 45, 45,137,155,155,155,164,184,184, 88,241,250,235,175,147,210,210, 82, 80, 74, 49,116,232, 80,135,181,107,215, -190, 2, 96, 69, 29, 6,206, 41, 36, 36,228,211, 9, 19, 38,168, 42,203, 77, 20, 69,228,230,230, 98,196,136, 17,230,167, 79,159, -158, 69, 8,217, 66, 41,205,125, 81, 46, 4, 85, 71, 11,150,197,174,118, 56,118,236,167, 6, 15,162,165,237, 36,200,111,211,188, -203,251, 82, 0,184,127,125,125,135,216,123, 87, 5, 75,145,196,255,177,101,233, 37,203,192, 9,249, 0,246,215, 22, 5,236,215, -209,182,143,119,128, 98,232,144, 65, 61,185,181,235,126,109, 61,225,141,222, 74,231,166,191, 18, 0,176, 83,122,162,189,241, 67, - 78,171, 47, 87,173, 93,247,107,235, 33,131,250, 93, 73, 76, 74, 94,222,191,147,221,222, 67,231,139,142,212, 22, 37,116,115,148, -122,216,153,229,193,206,171, 39,124, 66,236,112,243,230, 77,236,223,115, 17,129,141, 90, 65,175,215,195,104, 52, 90, 12, 24, 48, - 64,189,107,215, 46,109,126,126,126,169,193, 96,232,146,145,145,241,160, 78,127,133, 60,177, 41, 39, 26, 20,130,140,215,148, 43, -202,167,206,222,243, 74,235,246,125, 91,216,123,123,200, 28, 84,252,129,174, 93, 58,111,222,186,233,151,233, 31,206, 88,128,166, -205,219,181,159, 42,191, 22, 6,224,110,117, 90,209,137,244, 96,184, 63,225,227, 31,196,246, 79, 78, 77, 74, 11,242,114,213,199, -165, 80,227,251,179,126,238,213,169,231,240, 38, 1,141,218, 42,162,238, 95, 36,211,167, 77,223,250,237,183, 75, 94,173, 52, 89, -103, 35,142,118,153, 59, 46, 73, 1, 64,199,110, 81,128, 92,169,244,180,244,241,145, 38,110,216,160,241, 31, 56,176, 16, 0,140, - 60,239,120,249,202, 21, 27,115,115,115, 80, 74, 97, 52, 26,255,212, 71,184,178, 95,112,207,174, 93, 93, 76,209, 76,253,233,167, - 38,239,190,251, 46,178,178,178,192,243,252,227,232,119,149,107, 54, 74, 74, 74, 48,108,216, 48,172, 95,181,170,218,118,113,153, - 82,233,101,233,229, 37, 77,220,176, 65, 19,208,191,127, 1, 4,129,204,248,241,199, 47, 62,252,248, 99,223, 17,175,188,242,167, -231,198,144,144, 16,252,180,106,149, 98,203,150, 45, 30,139, 87,173,122,163,175, 82, 25, 95, 87, 58, 75,195,194, 96, 23, 25,105, -214,168, 81,163,199,134,178, 97,195,134,248,250,235,175,149,163, 71,143, 86,140, 29, 51,102, 89, 84,163, 70, 43,231, 38, 38,198, - 58, 4, 5, 89, 75,149, 74, 79, 83,203, 19, 0,202,244,250,240,185, 11, 22,216, 93,185,114, 5, 25, 25, 25,168,244,247,132, 16, - 52,105,210,132,188,242,202, 43, 54,109, 91,182,108,205,106,228,115,138, 96, 85,103,176,106, 50, 90,228, 41,166,138, 33,132,192, -205,205, 13, 6,131, 1,191,254,250,235, 99, 99,245,248,137,192, 96,168, 83, 67,171,213, 54,118,117,117, 69, 73, 73, 9,130,130, -130, 30,107, 84,166,171,242,165, 82,169,160,213,106,225,225,225, 1,173, 86,219,184, 14, 3,212,204,198,198,166, 50,154, 5,157, - 78,247,216, 92, 21, 21, 21,161,168,168, 8,122,189, 30,133,133,133, 40, 43, 43, 67, 81, 81, 17, 74, 75, 75,155,155,146,103, 81, - 20, 17, 25, 25, 25,215,168, 81,163,102, 18,137, 4,150,150,150, 22,229,229,229,168, 28, 76, 80, 80, 80,128,141, 27, 55,150,191, -254,250,235,142,151, 47, 95,214,152, 82,134, 83,167, 78,133, 82,169,132, 90,173,198,170, 85,171, 48,117,234, 84,200,229,114,148, -150,150, 98,213,170, 85,152, 62,125, 58,164, 82, 41,116, 58, 29,182,111,223, 94,163, 86,116,116,116,226,229,203,151,155,183,104, -209,194,110,239,222,189,185, 61,123,246,116,234,221,187,247,227,178,227,121, 30,109,218,180, 65,112,112, 48,114,114,114,112,248, -240,225,188,134, 13, 27, 58, 94,185,114, 69,204,202,202, 74,174, 35,223,143, 77,147, 68, 34,129, 32, 8,200,206,206, 70, 81, 81, - 17,114,115,115,145,145,145,129,180,180, 52, 72,165,117,207, 28,226,224,224,240,114,120,120,184,164,194,108,193,207,207, 15, 31, -126,248, 33,175,209,104, 70, 0, 56, 92,177, 89,223,173, 91,183,238, 13, 12, 12,148,186,187,187,227,225,195,135,112,114,114,146, -154,153,153,141,172,203, 96,185,186,186,174, 63,112,224,128,125,229, 8,218, 74, 52, 26, 13,120,158,199,168, 81,163,236,215,174, - 93,187, 30, 64,191, 23,241,162, 96,105,107, 43,125,169,147, 77,198,229,203,145, 97,205,187,188, 47,181, 15,154,243,200,128, 3, -210,155,103, 87, 54,239,212, 38,124, 75,101,191,172,218, 24,210,195,105,233,192,190, 77,185,209,195, 90,198, 75, 45, 26, 5,108, -222,184,210,197,222,174,211,255, 95, 40,164,246,176, 80, 1,193, 62, 2,119,233, 96,188,203,244,233,141,244, 91,126,126, 43,126, -243,158,235, 61,229,138,219,221, 1, 76,175,209, 16,198, 27,127, 47,214,218,135,216, 20,239, 33,112,120, 27,205,155, 55,135,147, -147, 59,126, 90,253, 27, 60, 26,180,128, 94,175,135,181,181,181,249,163,203,136, 97,179, 41,230, 10, 0,230,206,141, 16, 59,119, -238, 98,144, 58, 57,242, 83,166,124, 59,172,119,223, 97, 33, 93,186,246,160,199,143, 31, 49,180, 15, 49,100,244,232,210, 54,235, - 76, 68,196,195,172,172,244,134,193, 33, 77, 16, 19,117,189, 55, 64, 34,129,234,163, 77,145,241,244, 72, 64, 0, 57,189,253,227, - 9,162, 70,127,211,108,225,143,119,251,246, 31, 60, 54,188,115,199, 78,226,241, 19,199,244, 10, 20,221,179,236,216, 62,125,236, -152,145,123,183,239,216,253,210,233, 19, 7, 3,139,139,178, 15, 46,217, 68,153,185,170,124, 56,227,121, 23,169, 82,201,101,159, - 62,205, 55,125,243,205,199,229, 98,110,110,142,253,251,247, 67,161, 80, 64, 46,151, 67,161, 80, 60,126,201,229,114,184,186,186, -130, 80,202,213, 71, 51, 51, 51, 19, 89, 89, 89,176,177,177,129,147,147, 19,178,178,178,112,225,194, 5, 60,124,248, 16, 82,169, - 20,125,251,246, 5, 87,195,125,243, 9, 77,253, 91,243,231,247, 9,107,210,196,253, 73,115, 85,121,111, 43, 40, 40, 64,151, 46, - 93,200,241,227,199,157,206,198,199, 15,254,172,154,206,238, 85, 53, 27, 15, 26,148,159,115,242,100,181,191, 29, 26, 26, 74,246, -238,223,175,124,117,212,168,105, 95,175, 94,189, 98,246,178,101, 89,224,121,215,250,228,157, 16,194, 17, 66,224,229,229,133,130, -130, 2,148,149,149, 85, 6, 28, 96,103,103, 7,163,209, 8, 81, 20,101,172, 70,154, 14, 87,151, 25,120,210, 72,213,244,226, 56, -238,169, 76, 86,109,152, 98,176, 42, 77,134, 82,169,252,211,201, 85,249,170,122,242, 85,154, 24, 19,144,148,148,148, 96,207,158, - 61, 40, 40, 40, 64,105,105,233,159,204, 85,101,228, 42, 33, 33, 1, 91,183,110, 69,122,122, 58, 36, 18,137, 73,147,182, 38, 36, - 36, 92,247,245,245,109, 86, 25, 17,235,214,173,155,231,185,115,231, 50, 42,205,220,231,159,127,158,215,182,109, 91,199, 39,111, -238,181, 38, 86, 34,193,133, 11, 23,160, 86,171, 65, 41,133, 92, 46, 71, 76, 76, 12,120,158, 7,165, 20, 82,169, 20,185,185,185, -117, 70,176, 34, 35, 35,199,191,241,198, 27, 43,222,124,243,205,211, 51,102,204, 56,222,189,123,247, 84, 66, 8,140, 70, 35,172, -173,173,225,234,234,138, 7, 15, 30, 64,163,209,224,131, 15, 62, 72,217,180,105,211,137, 85,171, 86,157, 94,179,102,205,138,180, -180,180, 55,234,115,108,121,158, 71,121,121, 57, 10, 11, 11, 81, 80, 80,128,146,146, 18,104,181,218,167,170, 67, 61,122,244,192, -193,131, 7, 37, 61,122,244, 88,235,227,227,147,229,227,227,147,213,163, 71,143,181,191,255,254,187,196,195,195, 3,169,169,169, -184,121,243, 38, 10, 10, 10, 32,138, 98,173, 63, 32,147,201,186,141, 25, 51,166,163,183,183, 55, 49, 24, 12,208,233,116,208,235, -245, 48, 24, 12, 16, 4, 1, 41, 41, 41, 8, 13, 13,229,188,189,189,219, 17, 66,186,177, 75, 72,253, 40, 73,219, 1,154,243, 3, -104,193, 54,136, 57, 63,162, 92,251,116, 58,133,133,133, 95,190,243, 85,113,142, 80,124, 26,209, 55,246,160, 84, 35,133,103, 96, - 55, 76,124,115, 20,174, 93, 57,141,252,252,124,220,187,119, 15,157, 59,119,150, 19, 66,234, 85, 55,183,109, 59, 40,188, 58,234, -147, 87,122,244, 30,214,178, 71,207,126,194,241,227, 39,117, 87, 47, 29,185, 30,232,107,157, 67,249,162,108, 27,107,243, 27,177, - 15,238,161, 97,163, 80, 24,121,177, 51, 48,183,214, 58, 21, 23, 71,245,127,100,185, 9,175, 76,141, 28,211,123,224,184,166, 61, -122,246, 54, 30, 61,114, 64, 56,119,108,215,205,222,221, 26, 68, 44, 90,178,197,171,192, 24, 20,166,178,118, 61,212,174,153,121, -167, 73, 67,188, 39,176,154, 82, 77,228, 69,165, 18, 81,113,221, 36,132, 64, 20,197, 63,153,170, 39, 95,166,220,147,170,106, 86, - 66, 41, 69, 81, 81, 17, 30, 62,124,136, 37, 75,150,224,214,173, 91, 16, 4,225,113, 36,171,198,251, 16, 64, 31,107, 2,136,207, -204,236,242,238,187,239, 42,171, 51, 87,249,249,249,200,203,203, 67,122,122, 58,250,246,237, 43, 47,177,183,111, 86, 87, 58, 61, -156,157,117,230, 42, 85,246,131, 7, 15,254, 35,189,165,165,165, 80, 42,149,248,225,199, 31,229, 7, 35, 35,167,158,187,112,193, -182, 62,229, 89,169, 67, 8,129,179,179, 51, 2, 2, 2,208,188,121,115, 52,110,220, 24, 42,149, 10, 81, 81, 81,248,229,151, 95, - 32, 33,132,103, 53,241, 57, 68,176,106, 50, 88,213,189,151, 74,165,168,143, 33, 48, 21, 83,154, 8, 85, 42,213,221,236,236,236, - 14,158,158,158, 48, 26,141,143,163, 87,149,205,132,149,159, 1, 64,169, 84,226,222,189,123, 80,169, 84,119,107,211, 52, 55, 55, -191, 43,145, 72,218,181,106,213, 10,123,247,238,197,233,211,167,145,144,144, 0,141, 70, 3,173, 86, 11,141, 70,131,168,168, 40, -136,162,136,240,240,112,216,216,216,192,220,220,252,110, 93,105, 45, 47, 47,207,148, 74,165,141,204,204,204,254,191,169,195,205, - 13,121,121,121,162,209,104,196,198,141, 27, 75, 92, 93, 93, 45,204,204,204, 76, 46, 79, 66, 8,114,114,114,224,229,229,133,146, -146, 71,211,124,149,150,150,194,217,217, 25, 6,131, 1,162, 40, 66,167,211,193,210,210, 18,117,117,233,160,148,106, 1,124, 88, - 69,187,213,136, 17, 35,182,110,223,190,221,239,196,137, 19,184,114,229, 10, 28, 29, 29,241,213, 87, 95, 37, 36, 37, 37,189, 74, - 41,189,246,119, 84,218,252,252,252,221,145,145,145,237, 90,181,106,245,248,234,208,181,107, 87,210,181,107, 87,199,170, 33,253, -252,252,124,220,190,125, 27, 17, 17, 17, 48, 26,141,184,119,239,158,160,209,104,182,213, 82,150,114, 31, 31,159, 13,179,103,207, -182,228,121, 30, 18,137, 4, 50,153, 12, 60,207, 67,169, 84, 62,142,212,166,164,164, 96,232,208,161, 54, 43, 87,174, 92, 79, 8, - 9,160,148, 26, 94,164,139, 66, 89, 81, 17,127,242,114,169,179,157,133,239,237,251,215,215,119, 8,174,184, 78,220,191,190,142, - 87, 89,120, 93,185,114, 91, 99,213, 70, 85,196, 91, 58,214,174,179,239,100,238, 71, 6,253,181, 62, 71, 78,220, 29,250,225, 7, -111, 43,124, 26,248,103, 95,184,113,215,167,189,241, 67,206, 66, 5,148,107,129,130, 98,224,126,178, 68,244,105,224,159,125,237, - 70,140, 98,217,138, 53,254,234,114,253,222, 67,231,139,142,212,166,157,150,150,166,245,240,240, 24,242,225,183,230, 17,163, 70, - 75, 20, 10,149, 61, 74, 11, 98,225,227,227,129, 87,134,116,192, 15,191, 30,131,141,173, 29, 92, 92, 92, 64, 8,177,168, 71,246, -201,165,147, 55,223,124,253,141,137,109,123,189,212, 79, 56,122,236, 16, 78, 30,221,115,101,195,138, 89,123, 12,210, 82, 11, 78, - 40, 51,243,242,116,189,147,152,240,224,181,206, 93, 95,130,202,204, 60, 0, 8,174,246, 46, 30,234, 75, 94, 7, 7,111,136, 72, -225, 56,168, 94,127, 99, 66,251,222,125, 7,241, 71, 15,239,195,209, 3,155, 46,207,153,218,224, 80,194,237, 45,242, 75, 87,211, - 84, 67,134, 79, 46, 60,120,242,158,254,229,249,190, 15,220, 27, 54,211,176, 91, 83,149, 7, 72,169, 52,155,215,233,188, 60,123, -247,150,168,147,147,101,150, 46, 46,124,229, 67, 90,213,135,234, 39, 35, 88, 28,199, 1, 28, 39,154,162,105,106, 90, 52, 26, 13, - 68,160, 90,147, 65, 42, 53,251,246,149,168,211,210,100, 57,249,249, 13, 26, 52,104,240,167,109,140, 70, 35,242,243,243, 31,191, -138,138,138,160, 82,169, 80, 96, 52,186,152,146,206,206, 77,154,108,252,118,217,178,143, 86,255,250,235,227,166,158,210,210, 82, -148,148,148,160,184,184, 24, 28,199,225,147, 25, 51,148, 51,230,207,127,119,128, 84, 58,173, 62,229, 89,249,176,206,113, 28,164, - 82, 41,146,147,147, 31,191, 82, 82, 82,160, 82,169, 64, 9, 17, 89,141,124, 14, 6,171,178,147,123, 93,230,170,242,189, 68, 34, - 49, 45,220, 91,241, 36,240,188, 34, 88,229,229,229, 39,206,159, 63,223,166,119,239,222,210, 75,151, 46,193,205,205,237, 63,154, - 9,165, 82, 41, 8, 33, 48, 55, 55,199,225,195,135, 13,229,229,229, 39,234, 56,137, 78,158, 60,121,178,229,244,233,211,101,227, -198,141, 67, 84, 84, 20, 38, 77,154,132,194,194, 66,148,148,148, 32, 63, 63, 31, 26,141, 6,109,218,180,129, 74,165, 66,108,108, -172, 81,163,209,212, 53, 85, 1,205,201,201, 41,115,114,114,114,123,242, 31,195,135, 15,119,249,233,167,159,212,247,239,223, 55, -118,232,208,193, 26, 64,189, 12,235,214,173, 91, 31, 31,179,152,152, 24,172, 90,181,234,113, 63,132, 27, 55,110, 96,233,210,165, - 16, 4, 1,245,237, 51, 75, 41,189, 22, 22, 22,198, 27, 12, 6, 4, 6, 6,194,195,195, 3, 26,141, 6, 43, 87,174,228,255, 42, -115,101, 74, 4, 75,171,213,238, 26, 59,118,236,140, 91,183,110,185,201,229,242,202,208, 53, 68, 81,132,193, 96, 64, 82, 82, 18, -238,221,187,135,216,216, 88,228,229,229,129, 82, 10,189, 94,143, 27, 55,110, 20, 25,141,198, 29, 53,233, 58, 57, 57,125,190,118, -237, 90, 87, 51, 51,179,255,152, 88,183,242,162, 83,217,244,234,236,236,140,174, 93,187, 58,159, 58,117,234,115, 0, 95,252,211, - 47, 4,149, 51,180, 83, 17,177,246,246, 22,226,228, 73,111,202, 27,134, 24, 30,196,222,187, 42,220, 60,187,178, 57, 0,168, 44, -188,174, 52,108,212, 34,250, 92,164,165,216,255,245, 79,154,229,231, 79,148, 16,138, 70,132, 34,239,201, 25,223, 43,234,143, 8, -224, 80,155, 0,251,243,251,126, 63,241,227,204, 15,223,190, 58,123,246, 76,103,173,190, 92, 21,236, 35,112,192, 35,115,117, 41, -202, 66,187, 96,193,219, 87, 23, 47,219, 40,166,196, 25,166, 93,137, 43,172,113,132,111, 85,211, 98,167,132,202,213,127, 90,134, -111,195,238, 13,238, 92,254,133, 56, 90, 75, 96, 21, 50, 0,125,251,188,132,227, 39,207, 35, 57, 83,131,156,156, 28, 0,168,117, -218,131, 16, 31,140,169,212, 36, 28, 84, 99,198, 79,232,220,183,239, 32,122,232,143,223,249,125, 59, 55,157,223,186,109,233, 14, - 78, 46,151, 26, 68,107, 61,145,104,139, 4,137,109, 84,121,113,193,163,136,167, 84,110, 93, 75,251,128,119,116,212,253, 70,161, -161,193,174, 99,198, 79,180,233,215,119, 48, 61,116,104,159,184, 99,243,198,211, 59,190,107,188, 89, 52,150,200, 51,147,212,202, -226, 82, 99, 49,149, 40,108,203, 74, 69,117,182, 54, 64,235,126,121,184, 1,195,217,205,233,241,125, 64,167, 75, 43, 75, 77,117, -179,239,210, 69, 25, 59,119,174,185, 75,155, 54, 90, 66, 72,157, 6, 75, 34,145,128,162,250,185,202,158,212,172,143,193,162,132, - 84, 59,248, 72,208,233, 82,203,146,147,221, 28,187,116, 81,197,125,241,133,121,117, 81,251,252,252,124, 20, 20, 20,252,201, 96, - 85, 92,107, 76, 74,231,146, 15, 62,184,220,106,220,184,130, 75,151, 46,185,180,107,215,142,148,148,148, 60, 54, 87,149,239,157, -156,156,136,119,131, 6, 86, 39,210,211,253,231,153, 88,158,166,228,157,227,184, 26,203,147,241, 12, 17, 44, 83, 13,150, 9, 55, - 71,163,209,104,132,179,179, 51,242,242,242, 32,138, 98,141, 7,210,204,204,172,178, 13,184,214,145,116,165,165,165, 43, 22, 44, - 88, 48,165, 91,183,110,142,193,193,193,200,205,205,133,179,179, 51, 36, 18,201,227,116, 85,234, 69, 70, 70, 98,251,246,237, 37, -165,165,165, 43,234,200,247,242,159,127,254,249,221,126,253,250,217, 59, 57, 57,193,206,206, 14,119,238,220,129,173,173, 45, 74, - 75, 75, 17, 19, 19, 3, 43, 43, 43, 16, 66,160,211,233,112,246,236,217, 82, 81, 20,151,215,113, 98,210, 11, 23, 46, 24,204,205, -205,239,228,231,231, 75,242,242,242, 36, 21,211, 51,200,138,139,139,101, 71,142, 28,113,180,177,177, 81,159, 58,117, 42,215,219, -219, 91,146,152,152, 40,209,235,245,117,186, 44, 66, 8, 62,248,224, 3,200,229,114,232,116, 58,172, 88,177, 2, 31,126,248, 33, -164, 82, 41,244,122, 61,190,249,230, 27,124,246,217,103,143, 13,243,129, 3, 7,234,107,178, 96, 52, 26, 97, 48, 24, 96, 48, 24, - 96, 52, 26,255,210, 10,105,138,193,162,148,102, 17, 66, 6,180,106,213,234,216,190,125,251, 28,172,173,173,145,145,145,129,220, -220, 92,100,103,103, 35, 39, 39, 7,165,165,165,208,233,116,176,181,181, 69,114,114, 50,142, 29, 59, 86, 82, 86, 86,246, 82,109, - 35, 8, 37, 18,201,216,206,157, 59, 75,159, 76, 3,199,113,143,235,147, 76, 38,131, 66,161, 64,122,122, 58, 58,119,238,172,136, -136,136, 24,251, 34, 24,172,202, 25,218,195,194, 66,156, 6, 12, 26,109,104,217,186,119, 89,196,181,227,105,150, 34,137,239,212, - 38,124, 11, 0, 92,185,173,177, 58, 23,105, 41, 54,109,209,147,244, 31,160,105,182, 97,221,106, 69,116, 84,180,111,104,120,104, -173, 51,250, 59,122,138,131,123,119,111,144,105,109, 65,164, 11, 22, 44, 62,176,118,221,175,173, 47, 29,252,255,105, 26, 22, 44, -120, 52, 77, 67,239,238, 13,248,232,152, 7,131, 1,108, 50,213,180, 12, 24,208,251,230,218,245,219,145, 30,123,192,125,249, 71, -102, 10,228,231, 0,230, 45,208,185,165, 3,174,175,185,135,219,183,111,103,137,162, 88,123, 83, 46, 7,239,200,200,232, 70, 97, -225,161,174,175,143,159, 96,211,175,223, 96, 28, 58,180, 31,191,173, 95, 29,209,206,182,249,218,228,107,121, 18,143, 70,118,114, -115, 91,133, 92, 42, 87, 73,229, 82,121,158,193,248, 40,186, 46,149,203,172,129, 17, 98, 69,235, 80,181, 76,154, 56,218,166,123, -175,193,248,163, 66,115,118,179,225,107,124,165, 33,164,205, 71, 75, 38,251,250,248,250,148,171,179, 75, 56, 78, 97,208,234, 68, -171, 37,107,146,190,141,143, 27, 27,127,115,196,136,101,108, 20,225, 99,238,252,214,175, 95,235,247,226,226,228, 78, 29, 59,154, -101,156, 62,109,254,100, 19, 97,117, 6, 75, 42,149, 2, 28,199,155,162, 73,142, 31,231, 0, 64, 46,151,215,248, 96, 47,151,203, -161, 86,171,193, 19, 82,237, 6,114,224,206,111, 3, 6,180,121, 47, 46, 78,102,223,173,155,185,211,173, 91, 41,137,137,137, 65, -205,155, 55,135, 32, 8,127,138, 92, 85,190,180, 90, 45,244,122, 61, 84, 74,101,164, 41,233,204, 62,123, 86,251,217,248,241, 95, -188,251,206, 59,223,109,223,177, 67,101,109,109,141,146,146, 18,148,150,150, 62,126,233,116, 58,180,108,213, 74,182, 41, 38,102, - 12,128, 57,166,148,167, 75,183,110,234,186,174,201, 21,134,149, 53, 17,214, 3,174,174, 8,214,179, 76,211, 64, 8, 9,127,226, -243,103,125,251,246,213, 38, 36, 36,192,203,203,235,177, 73,169,250,155,214,214,214,176,181,181, 69,116,116, 52,214,174, 93,171, - 33,132,124, 86,155,102, 65, 65, 65,169, 86,171, 29, 57,106,212, 40,141, 76, 38, 67,163, 70,141, 30, 55,235, 80, 74, 31,247,189, -138,140,140,196,216,177, 99,213, 90,173,118,228,147,115, 96, 61,169,153,148,148, 84, 92, 94, 94,254,218,232,209,163,213,247,239, -223, 71,167, 78,157,112,235,214, 45,148,151,151,163,172,172, 12,137,137,137, 8, 13, 13,133,193, 96,192,174, 93,187,212,229,229, -229,175, 37, 37, 37, 21,215,166, 89, 90, 90, 58,240,235,175,191,150, 28, 58,116,200,215,221,221, 61,172, 85,171, 86,193,221,187, -119, 15, 24, 58,116,168, 79,191,126,253,220, 26, 54,108,168,237,221,187,183, 83,223,190,125,157, 36, 18,137, 44, 46, 46, 46,147, - 82,218,183, 54,205,170, 6,224,193,131, 7, 48, 24, 12,255,209,231,170,114, 52,161, 32, 8, 38, 29,163,234, 76,118,165,177,170, - 52, 90,117, 93,247,171,211,228, 56,174,206,155,133, 66,161,168,140,112,210,186, 52, 41,165,183,238,221,187,215,171,125,251,246, - 55,199,142, 29, 91,154,146,146, 2,185, 92, 14, 15, 15, 15,248,248,248,192,194,194, 2, 5, 5, 5,216,181,107,151,250,240,225, -195,145, 37, 37, 37, 93,159,156, 3,235, 73, 77,142,227, 18,171,187,184, 74, 36,146,255, 48, 88,149, 43, 5,112, 28,151, 88,159, -242,124, 74,211,249, 95,211,156,248,246, 24,251,254, 3, 7, 91,237,223,191, 95,181,106,213,154,232, 78,157, 38,108,180,116,123, -247,136,165,219,187, 71,218,180,123,107,203,247, 63,175,127,184,247,247,223,205,250,247, 31,106, 51,121,194, 24,119, 16, 34,173, - 75,211, 92,169,108,211,185,109,195,162,179, 23,206,242,139,151,109, 20, 58,116,234,119,229,187,239,127,222,241,221,247, 63,239, -232,208,169,223,149,197,203, 54, 10,103, 47,156,229, 59,183,109, 88,100,174, 84,182, 49, 37,157,147, 38,142,182,233,223,111, 48, - 14, 30,220,203,111,221,184,226,155,253,103,244, 93,134,207,208,102, 39, 63, 60, 73,145,245, 37,156, 21,231,145,146,146, 82,204, -243,124,183, 39, 59,184,215,164, 57,121,194,232,170,230,234,108,116, 34,126, 93,125,243,166,240,211,248,185,198, 45, 71,247,106, - 14, 70,220, 44,137,184,158, 82,152,251,176, 56,190,188,180, 68, 47,138, 34,168, 40, 72,230,205, 3,169,237, 24,117,232,208, 21, -167,142,111,193,198,117,191, 20,139, 34,180,195,119,238, 20, 70,252, 52,151,250,248, 52,240,217,188,121, 11, 25, 48,112,136, 13, -165, 16, 7, 14, 25,108,187,117,243, 86,226,231,231,215,192,223, 31,242,127,122, 93,122, 94,154,115, 40, 45, 44, 73, 78,142,184, -182,114,165,222,101,228, 72,123,133,139,139, 53, 68,145,212,213, 7,235,201, 8, 86,109,154, 46,246,246,233, 71,143, 30, 69,163, - 70,141,224,225,225,241,167, 22, 25,153, 76, 6,111,111,111, 56, 57, 57,225,216,177, 99,160,192,245,234, 52,103, 82, 90, 84, 20, - 31,127,230,202,146, 37, 58,151,225,195,237,154,249,249, 93,255,110,229, 74,189, 32, 8,143,163, 86, 85,255, 22, 22, 22, 66, 16, - 4,156, 62,117, 74, 95,166,209,172,173, 45,157, 55,126,248, 65, 87,153,247, 54, 90,109,249,144,150, 45, 23,141, 25, 51,198,144, -152,152, 8, 65, 16, 80, 53,146,149,147,147, 3, 43, 43, 43,104,180, 90, 79, 23, 23, 23,115, 83, 52,115, 14, 29,178, 68, 29,215, -117,137, 68,242,167, 38,194,191,226,184,255,171, 34, 88, 60,207,195,203,203,235, 79,243,140, 84,118, 28,172,140, 12,153, 24,185, - 2, 0,164,167,167,111,114,113,113, 57, 58,102,204,152, 47,154, 53,107, 54,105,218,180,105, 18, 63, 63, 63, 20, 23, 23,195,206, -206, 14, 78, 78, 78, 72, 74, 74,194,238,221,187,133,162,162,162,159, 5, 65,152,159,157,157,157,107,130,238,105, 15, 15,143, 1, - 47,189,244,210,246,119,223,125,215,166, 75,151, 46,178,202, 27,224,221,187,119,113,232,208, 33,195,182,109,219, 74,180, 90,237, - 72, 83,102,113, 7,128,204,204,204, 99,110,110,110, 47,143, 27, 55,110,243,208,161, 67,173,180, 90,173, 44, 33, 33, 1,122,189, - 30, 60,207,163,160,160,192,112,230,204,153, 50,181, 90, 61, 58, 51, 51,243,152, 9,122, 55, 8, 33,161, 6,131, 97,236,205,155, - 55,191,124,249,229,151, 29,218,183,111, 47,231,121, 30,231,207,159,207,109,222,188,185,115, 73, 73,137,225,194,133, 11,249, 90, -173,246,179,140,140,140,141, 38,174, 81,133,146,146, 18, 56, 58, 58, 66,171,213, 66, 20, 69,232,245,122, 88, 89, 89, 61, 94,222, -136, 82,250,232,228,120,138, 7, 98,158,231, 37, 70,163, 17,163, 70,141,130, 40,138, 88,177, 98, 5,120,158,151,212, 87,199,210, -210,242,122, 84, 84,212,128,176,176,176,199,233,225, 56, 14, 28,199, 65,169, 84,194,209,209, 17, 14, 14, 14, 56,113,226, 4, 56, -142,187,110, 98,116,237, 54,128, 22,132,144,246,183,111,223,126, 29, 64, 83,131,193,224, 41, 8, 2,225, 56, 46, 83, 16,132, 59, -101,101,101,107, 77, 93, 42, 39, 39, 39,231,203,177, 99,199, 54,223,186,117,171,165, 84, 42,125, 92, 94, 28,199, 65, 46,151,195, -209,209, 17, 42,149, 10, 1, 1, 1,208,104, 52,248,252,243,207, 75,212,106,245,151, 47,210, 5,161, 83,135,206, 56,117,100,139, -249,198, 13,191,149, 10, 2,184,138,169, 24, 30, 29, 67, 71, 32, 63,127,162,100,195,186,213, 10,149, 84,107,215,169, 67,103,147, -154, 86,244, 6, 62,127,228,155, 63,123, 85, 44,149,243,101, 98, 82,242,242, 45, 63,191, 21, 15, 0,203, 86,172,241, 79,137, 51, - 76,139,142,121, 48,120,213,154, 51,109,244, 6,222,164, 5,112,255,223,180,108, 46, 6,133, 54, 61, 61,253,138,167,167,167,111, -167, 55, 12,159, 53,106, 64, 6,101,231,139,233,132,144,169,233,233,233,241,166,230,189,125,251, 46, 56,115,124, 43, 54,174,223, - 92, 76, 68,104, 43,141,254, 46,128,238,154, 27, 65,129,136,202, 77,203, 39,191,140,121,159,125, 50,233,195,146,210,226,111,127, -250,145,138,115,107,233,231,222,164,105, 91, 52,105,218, 22, 83,166,126,106, 19, 26, 22,236, 13, 0, 59,119, 82, 33,220,143, 28, -248, 98,254,220, 65,243,191,152,139, 18,181, 14,149,203,234,196,220,143,254, 35, 46,158,234,159,247,160,161,127, 50, 95,240,252, - 21,124,252,113, 67,109,113,177, 83,199, 25, 51, 28,165, 75,150,112,149, 15,208, 79, 70,176, 30, 71,175,234,161,121,228,228,201, - 63, 62,254,232,163,244,165, 75,150,244, 94,252,245,215,102, 33, 33, 33,200,202,202, 66,112,112, 48, 60, 60, 60,112,254,252,121, - 28, 59,124,184,188, 76,163,249,204,213,213,117, 85, 77,154,115, 40,189,242,165, 92, 30,160, 47, 47,119, 89,186,110,221,195,238, - 61,123,102,175, 93,187,214,179, 79,159, 62,156, 90,173, 70,113,113, 49,138,139,139,161,211,233, 32,151,203,145,145,158, 46,166, -165,167,223, 73, 73, 73, 89, 91,107, 58,167, 79,111,168, 46, 40,112,234, 56, 99,134,163, 49, 63, 95,245, 97, 82, 82, 26,183, 97, -195,215,147, 38, 78,252,104,218,244,233, 74, 79, 79, 79,162,211,233, 30, 27, 45,163,209, 8, 51, 51, 51, 35,207,243, 14, 0,212, -166,104,170,254,248,131,207,207,207,135,189,189,253,227,105,151, 56,142,131, 74,165,130,157,157, 29,202,202,202, 64, 41,155, 0, -183, 94, 15, 10, 53,221,116,131,131,131,175, 75,165, 82,207,170, 33,194,234,214,182,171,250,158,231,249,180,200,200,200,150, 85, - 29, 46,165,180,218,208,167,167,167,167,191, 40,138, 95,181,111,223,254,229,183,223,126,155, 68, 68, 68,224,228,201,147, 52, 61, - 61,125, 23,199,113,159,165,165,165,197,215,244,100, 83,147,166,189,189,189,149,149,149,213, 7, 22, 22, 22, 61, 43,167, 98, 80, -169, 84,119,203,203,203, 79,148,150,150,174,168,105,246,246,218, 52,253,252,252,172, 69, 81,124,223,194,194,162, 87, 94, 94, 94, - 51, 0,112,116,116,188, 85, 94, 94,126,156,227,184,149, 53, 45, 32, 93,155,166,187,187,187,153,165,165,229,151,246,246,246,175, -189,253,246,219, 14, 17, 17, 17,153,183,110,221,146,151,148,148,108,225,121,190,198,197,158,171,211, 12, 13, 13,253,211, 90,132, -207,243, 24, 1, 64,211,166, 77, 15, 14, 28, 56,176,255,107,175,189, 6,163,209,136,159,127,254, 25,199,142, 29,251, 35, 54, 54, -118, 64,109, 79,159, 79,106,186,186,186, 58,122,120,120,156, 25, 61,122,180,207,144, 33, 67,204,109,108,108, 32,145, 72, 80, 94, - 94,142,248,248,120,220,189,123,151, 30, 59,118,172, 44, 58, 58, 58, 77,163,209,116,205,202,202,202, 51,181, 60,159,229, 41,249, - 73, 77,153, 76,214,197,203,203,107,219,156, 57,115,172,122,245,234,101,230,224,224, 0,169, 84, 10,158,231,145,157,157,141,200, -200, 72, 28, 58,116,168,124,231,206,157,229,249,249,249,163, 40,165, 17,127, 71, 58,159,183,102,229, 76,238, 85,183, 9, 9, 13, -137,190,151, 64, 23,253,169,190,249,145,233,209, 81,209,141,171, 70,174, 42,103,114, 55, 53,157,253, 59,217,245,123,121, 72,171, -158, 0,176,123,223,181, 19,127,156, 43, 60, 84,143,116,206,142,142,186,255,196, 98,211,193, 49,209,241,116,193, 83,231,221,143, -124, 17, 25, 25,253, 39,205,240,240,208,152,123,137, 88,104,162,209, 23,171, 61, 55, 43,251,139,253, 41, 36,140,148,232, 68,186, -169,202, 54, 3, 6,191, 60,180,255,167, 51,103,225,171,197,139,176,127,247,222, 63,162, 19,233,193,127,114, 93,250,171, 52, 43, - 23, 39, 54,119,115,235,188,213,209,113,214,209,227,199, 45, 43,251,215, 86,246,145,124,114,192, 85,243,230,205,115,110,221,186, -229, 98,138,230,128,239,191, 55,104,173,172,148,139,127,254,185,139, 90,175,239,242,225,135, 31, 74,175, 95,191,142,109, 91,182, -240,154,212,212,205, 89,130,240,126,117,173, 31,213,229,253, 75,185,188,141,202,193,161,107,195, 89,179,148,139,183,111, 31,231, -225,233,233, 50, 96,224, 64,185, 84, 42, 69,121,121, 57, 50, 50, 50,112,225,252,121,109,114, 74, 74,164, 86,171, 29,154,154,154, -154,105,106,222, 7,124,255,189,193,214,223, 31,150, 46, 46,226,185, 11, 23,108,103,204,153, 51,201,197,205,205,166, 99,167, 78, - 50,115,115,115, 20, 22, 22, 34, 37, 37, 5,231,206,157,203,137,143,143,119,167,148, 10,166,104,254,126,247,110,147, 83, 87,174, - 12,255,248,227,143, 21,193,193,193,176,178,178, 66, 73, 73, 9,238,221,187,135, 11, 23, 46,232,182,111,223, 94, 92, 94, 94, 62, - 41, 53, 53,245,247,191,234,184,255,107, 12,214,127,235,196,115,117,117,109,201,113,220,236,138,230,168, 5,117,173,233,247, 34, - 93,116,220,220,220,188,237,236,236, 86,107, 52, 26,170,211,233, 38,102,102,102,166,252,175,165,147, 16, 34,109,217,178,229, 79, - 57, 57, 57,237, 41,165,176,177,177,185, 24, 21, 21,245, 14,165,148,175,175, 38, 33, 68,226,234,234,218,222,194,194,162,141,133, -133, 69, 23,131,193, 16, 82,209, 15,239,158, 90,173,142, 48, 26,141, 87,178,178,178, 46, 82, 74,133,191, 51,239,132, 16, 9,128, - 94,238,238,238,111,137,162, 24,200,113,156,109, 69, 83,105, 17,165, 52,182,176,176,112, 13,128,227,127,119, 58,159,167,102,152, - 31, 25, 74, 9,130,255,180,141,136,148, 39, 59,175, 87,118,134,255,243, 69, 4,247,163, 18,232, 94, 83,211, 73, 8,225,134,244, -112, 90, 10, 60, 26,105, 88,219,132,162,255, 97,134, 76, 48, 45,245, 54, 88, 13,200,216,234, 52,239, 37,215,190, 8,111, 93, 6, -203, 84,194, 26,144, 46, 32,104, 47, 18, 92,185,151, 64, 79,189,136,215,186,231,169,185,136, 16,251,157, 65, 65, 23, 57,169,212, -181,114,153, 35,194,113,162, 8, 8,224, 56,190,106,179, 96,213, 7,202,186, 52, 13, 64, 99,185, 82,233, 41,240,188, 75,190, 92, -110,117,193,194,162,133, 14, 40,115, 21,132,217, 39,242,243, 99,234,155,206,121,132,216, 1, 8,149, 42,149,222, 23,204,205, 7, - 22,216,217,181, 40,228,121, 23, 0,162, 82,169,140, 42, 83,171,215,166,166,166,174,121,178,165,194,148,116,202,148, 74, 47,129, -231, 93, 8, 64, 57,169, 52,231,168, 82,233,149,235,228,244,186, 90,163,241, 81, 42,149, 70, 0, 37, 6,131, 97,116, 74, 74,202, -201,250,104,166, 72, 36,161,119,172,172, 58, 9,214,214, 14, 6,192,194, 32,138, 6,131,209,152,170,211,233,238, 74, 36,146,111, -211,210,210,226,254,202,227,206, 12,214,191,236,100,102,154, 76,147,105, 50, 77,166,201, 52,255, 9,154, 46, 46, 46,230, 28,199, - 57,100,101,101,165, 87,125, 0,252,167,228,253, 69, 67,202,138,128,193, 96, 48, 24,140,127, 62,217,217,217,106, 84,211,231,138, -241,247, 64, 0, 84, 59, 18,160, 62,206,244,105, 70, 19,212,165,207, 52,153, 38,211,100,154, 76,147,105, 50,205, 23, 79,179, 46, -237, 23, 37, 50,198,154, 8,153, 38,211,100,154, 76,147,105, 50, 77,166,249,183,107,190,104,112,172, 8,106,172, 60, 46,132, 16, -151,231,189, 45,227,197,174, 11,213,236,235, 65, 8,241,168,231,246,110,172,212, 25, 12, 6,227,159,205,127,189, 15, 86,229,141, -138, 82,154,253, 60,182,123,222,251, 86,236,191,136, 16,124, 82,241,254, 27, 74,233,172,103,220,214, 36, 35, 27, 22, 22,230, 72, - 8,233, 97, 99, 99,211,184,180,180, 52,146, 82,122,252,238,221,187,249, 48,113,121, 2,111,111,111, 95,149, 74, 53,142, 16, 18, - 82,145,255,123, 90,173,118, 67, 74, 74, 74,226,115, 56,110, 4,192, 4,165, 82,249,138,173,173,109, 96, 97, 97, 97,172, 94,175, -223, 9,224,151,167,153,113,218,221,221, 61, 8,192, 88, 81, 20,165, 28,199,109,205,200,200,184,109,234,190, 46,225, 67,118, 80, -160, 33, 0, 78, 36,226,112,142,114,187, 0,136, 4,120,152, 29,185,239,149,231, 92, 95, 77,174, 11, 79, 34,145, 72, 22, 19,130, -143, 43,222, 47, 17, 4,225,211, 58,182, 95, 70,128,247, 65, 64, 43,182,159,201, 46, 81, 12, 6,131,241, 47, 48, 88,158,158,158, -125, 69, 81,124, 21, 0, 56,142,219,154,150,150,118,248,175,184, 89, 61,203, 77,237,137,125,151, 83, 74, 63,170,127,180, 2,159, -136, 34,229, 30,229,147,204,112,113,113,177,151, 74,165,255, 49, 55, 21,207,243,102,132,224, 45, 81,164,164, 98,219, 79, 8, 33, - 43,159,198,216,181,104,209,194,174, 85,171, 86,159,206,159, 63, 95,233,228,228, 68,178,178,178, 58,126,252,241,199, 45,131,131, -131, 23,223,191,127, 63,171,174,253,253,253,253,135, 52,107,222,234,189,105, 31,207,112,113,118,112,180,226, 5,222,144,158,158, -233,190, 98,249,215,109,253,253,253,127,138,143,143,223, 87, 31, 35, 37,149, 74, 95, 81,169, 84, 1, 90,173, 54,142,231,249, 93, - 18,137,164,247,194,133, 11,195,251,247,239,175, 42, 46, 46, 86,240, 60, 31,184,121,243,230,233,235,214,173,235, 75, 8, 25, 92, -199, 80,123,143, 10,195,151, 94,229,235, 87,175, 92,185,210, 67, 42,149,146,214,173, 91,155, 17, 66,166, 86,106,212,176,253, 99, - 40,208, 48,234,252,206,198, 0, 16,214,113,196,131,168,243, 59, 81,241,254,185, 63, 12, 60, 89, 23, 44, 45, 45, 55,149,149,149, -197,212,101,228, 43,246,253,184,202,190,159, 56, 56, 56,124,159,159,159,159, 21, 24, 24,216, 82,171,213,142, 1, 0,149, 74,245, - 91,108,108,236,117, 7, 7, 7, 87,133, 92,254,190, 70,171, 37, 0, 8,199,145,143, 9, 33, 43,158,246, 33,129,193, 96, 48, 24, -255, 32,131, 69, 41,125, 61, 54, 54,214, 92, 20, 69, 52,106,212,104, 12, 0,147, 13, 86,117, 55,171, 30, 61,122, 52, 55, 51, 51, -211, 87,221, 78,163,209, 40, 8, 65,143,167, 49, 45,149,191,161,215,235, 56,153, 76, 1,137,132,251,176,105,211,166, 45,243,242, -242, 78, 10,130,240,243,147,147, 87,154,152,110,172, 93,187, 54,196,197,197,229, 63,214, 80,201,206,206,150, 15, 28, 56,160, 94, -122,175, 55,110,172,210,198,199,119,226,100, 50,111,131,209,232, 8, 0, 50,153, 44, 95,101,105,233,245,249,103,159,153, 91, 88, - 88,136,249,249,249, 40, 41, 41, 33, 83,166, 76, 81, 77,153, 50,165, 23,128,141,181,105,122,121,121,249,181,104,213,230,189, 13, -235,215,183, 41, 46, 40,208,174,249,118,213, 77,157, 84,169,246, 9, 9,146,207,158,179,208,102,254, 23,179, 38,122,121,121, 69, -166,166,166, 38,212,145, 87, 14,192,222, 15, 62,248, 32,108,192,128, 1,138,210,210, 82,149, 90,173,110,176,121,243,230,207, 91, -181,106,101,217,188,121,115,197,182,109,219, 72, 81, 81, 17, 40,165,230,193,193,193,116,196,136, 17,218, 29, 59,118, 76, 1,240, - 93,125,204,178, 32, 8,178,202,192, 23,207,243,138,138,186,104, 48,197, 92, 19,224, 97, 88,199, 17, 0, 65, 96,212,249,157,170, -176, 78, 35,180,160,136, 37,192,195,138, 7,129,183, 69, 81,244,173, 46, 61, 28,199, 37,166,165,165,253,250, 52, 39, 75,255,254, - 3, 0, 96,181,155,155,219,217,220,220, 92, 79, 66, 48,218,212,135, 0, 66, 8,145, 74,165, 99, 1, 44,214,104, 52,111,158, 60, -121,178, 25, 0,244,232,209, 67, 14,224, 58,165,180,253,163,172, 49, 24, 12, 6,227,223,104,176,228, 0,112,246,236, 89, 80, 74, - 21, 79, 19, 20,168,106, 92,222,127,255,125,184,185,253,185,187, 73,102,102, 38,206,156, 57,253, 44,121,250,211, 77,234,203, 47, -191,180,201,207,207, 31,180,118,237,218,222,174,174,174,159,103,101,101,157,169, 35,143,217,132,144,111, 56,142,204, 32,132, 64, -161, 80, 38, 78,156, 56,241,122,197,255,252, 15, 28, 56, 96, 62,112,224, 64, 53, 33, 36, 30, 0, 20, 10,165,179, 68,194,249, 82, - 74, 65, 41,190,169,205, 8,190,108,105,217,136, 82, 58,112,210,178,101, 66,139,126,253,164,214,206,206, 18,112, 28,114, 83, 82, - 28, 86,255,248, 99,251,152, 99,199,148,174,193,193, 41,122,133,162,232,193,131, 7,112,115,115,131, 92, 46,175,115, 4,135,185, -185,249,155, 31, 76,251,200,169,184,160, 80, 99, 44, 45, 53, 88,138, 2,111,173,146,145,146,220,252,162,196, 84,107,245,155,147, -223,147,126, 49,115,250,155, 0, 62,173, 67,106,202,180,105,211, 66, 90,183,110,237,177,125,251,118, 82, 92, 92, 12,169, 84,106, -217,172, 89, 51,180,108,217, 82, 56,121,242, 36,241,243,243, 67,120,120, 56,206,159, 63,143, 11, 23, 46,144,230,205,155,155,239, -221,187,119, 76,117, 6,235, 73, 83, 45,145,112, 51, 71,142, 28,217,215,220,220,220,216,181,107, 87,188,253,246,219, 40, 47, 47, - 71, 72, 72, 72,147,174, 93,187, 94, 26, 54,108,152,140,227, 72,184, 32,136,168,205, 92, 87, 54, 3, 58,135, 15,185, 3,160, 49, - 40, 98,115, 34,247, 53,169,252,191, 40,138,190, 49, 49, 49,161, 69, 69, 69, 16, 69,241,241,154,140, 0,208,185,115,231,250,212, -247,108, 66,200, 55, 3, 7, 14,152, 1, 16,116,239,222, 61,255,189,247,222, 19,238,221,187,215,117,216,176,161,109, 31, 62,140, -173,241, 33,128, 82,154, 45,145, 72,150, 84,252,143,140, 27, 55, 62,219,210,210,114,168,151,151, 87, 12, 33, 68, 42,151,203, 43, -203, 72, 18, 18, 18,226, 20, 30, 30, 62,217,206,206, 46, 71,194,113,206, 20,148, 18,194, 45, 17, 69,129, 69,175, 24, 12, 6,227, -223, 96,176, 8, 33,121,183,110,221,114,211,106,181, 32,132,212, 25, 13,170, 58,194,160,226,134,243, 19,199,145,119, 8, 33, 8, - 15,111,156,176, 98,197, 10,125, 53,187,233,195,195, 27, 39, 72, 36,156, 31,165, 20,132,112,171,170,222,104,106, 27,181, 80,121, - 67, 84, 40,148,159, 0,128,155,155,123,246,193,131, 7,141,195,135, 15,199,146, 37, 75, 20, 51,103,206, 92,232,238,238, 62, 50, - 35, 35, 35,173,166,116, 86,124,158,229,226,226, 98,191,118,237,218,144,137, 19, 39, 94, 79, 79, 79,255, 0, 0, 60, 60, 60, 86, - 0,104, 76, 8,137,175,242, 29,126,249,229,151,150,111,190,249,230,189,236,236,236, 89, 53,105,190,108,101, 21,232,224,238, 62, -100,233,249,243, 84,202,243,164,248,250,245,162,180,172, 44,131, 94, 16,184,195, 9, 9,109, 70,142, 31, 47,119,113,115,163,251, -127,249,197, 71, 45,147, 81, 65,165, 42,142,138,138,162, 6,131,225,110, 93,121, 39,132, 4,219,217,218, 89,172, 89,182,234,186, -147, 82, 66, 28,189,220,137,220,218, 86,202, 89, 90, 41,169, 68,162,241,241,114,183, 34,132, 4,215,117,140,228,114,249,152,222, -189,123,155,111,219,182,141,132,135,135,195,214,214, 22,103,207,158,197,173, 91,183, 80, 88, 88,200,241, 60,143, 86,173, 90,225, -155,111,190,129,151,151, 23,138,139,139,145,148,148,228, 40,151,203,157,106, 41,207, 63, 25,222, 79, 62,249, 4,206,206,206, 16, - 4, 1,153,153,153, 40, 43, 43,131,133,133, 5,108,108,108,144,145,145,129,253,251,247,213, 89,151, 76,165, 93,187,118,106, 0, - 73, 79, 70,176,234,163,233,225,225,113, 44, 39, 39,183, 83,183,110,221, 80, 84, 84,100,152, 51,103, 14,154, 53,107,134,134, 13, -131,234, 76,167, 32, 8,159, 58, 58, 58,174,115,112,112, 88,246,222,123,239,185, 58, 56, 56, 64,167,211,125,150,159,159,143, 79, - 62,249, 4, 0,208,178,101,203,198,148,210, 63,222,124,243, 77,248,250,250,166, 23, 20, 20,164,196,196,196, 76,204,201,201,137, -124,150,188,215,231,220,100,154, 76,147,105, 50,205,255, 5,205, 23,210, 96, 17, 66, 40,165,143,154,228,170,190,175,166, 64, 11, - 61, 60, 60,220,204,204,204, 64, 41, 45,172,239,143, 9,130, 48,197,209,209, 49,103,214,172, 89, 29,131,130,130,244, 83,166, 76, -137, 76, 76, 76,252,172,234, 54,190,190,190, 95,254,240,195, 15,120,240,224, 65,210,162, 69,139,206,231,229,229, 45,168,231, 65, -159, 73, 8, 89, 1, 0, 25, 25, 25,121, 7, 14, 28,104, 29, 17, 17, 49,115,197,138, 21,110, 83,166, 76, 81,188,247,222,123,147, - 77,136,228, 64, 42,149,106,170,107, 22,172, 14, 23, 23, 23, 67,117,125,180, 42,153,216,162,133,146,138,226,144,175,207,158, 21, -197,180, 52,237,161,245,235,177,228,194,133, 73, 54,142,142,222, 78, 78, 78,212,215,211, 51,215,140,231,179, 75,114,115,185,230, -189,123,203,142,110,220,232,163,244,245,141,222,181,107, 87,153, 40,138,199, 76, 72, 66,153,222,104,212, 89,120,185, 27, 7, 14, -238,221,248,238,213, 91, 15,204,236,237,185,198,173,154,133,222,143, 77,186, 65, 0, 61, 30,189,106,197,198,198, 38, 40, 47, 47, - 15, 37, 37, 37,112,114,114,194,202,149, 43,225,226,226, 2,181, 90,141,168,168, 40,234,233,233, 73,206,157, 59, 7,119,119,119, -228,230,230, 66,175,215, 67,173, 86,231,232,245,122, 77, 77,134, 87, 42,149,174,225, 56,242, 54, 33, 4,129,129, 13,179,191,251, -238, 59, 35,165, 20,193,193,193, 24, 58,116, 40,206,158, 61,139,168,168,168,202, 40,147,209,215,215, 47,155,227,136,243,163,221, -107,143, 8,214, 70, 69,196, 42, 41, 35, 35, 99,214,211,236,239,233,233,169, 18, 4, 97, 82,163, 70,141, 6,188,250,234,171, 6, -185, 92, 14,181, 90, 93, 89, 22,134, 62,125,250,228, 15, 28, 56,192,225,143, 63,254,168, 53,157,121,121,121,241, 33, 33, 33,111, -127,244,209, 71,191,173, 90,181,202,246,211, 79, 63,125,188, 8,183, 32, 8, 16, 69,241,113,148,109,239,222,189, 72, 76, 76,252, -170,170,185, 98, 48, 24,140,127, 11,166,122,145,127, 92, 4,235,191,149, 25,137, 68,242,203,177, 99,199,154,117,238,220, 89,218, -163, 71,143,112, 79, 79,207,240,180,180,180,200,138,155, 90,120,159, 62,125,194,157,157,157,177,114,229, 74,181, 68, 34,249,229, - 41,157,117,213,155,221, 37, 15, 15,143,217,123,246,236, 89, 59,113,226, 68,184,184,184, 52,251,111, 23,114,225,131, 7, 29,198, -205,159, 47,170, 0,201, 31,191,253, 70, 23,158, 63,255,245,142,157, 59,229,254,254,254,160,148, 34, 41, 41,201,250,231,181,107, -237, 71,246,234, 21,149, 85, 94, 78,226,178,178,132,232,131, 7,185,124,142,251, 62, 62, 62,190,206, 72,161,193, 96,184,150,146, -156, 28,212,161, 83, 7,183,179,215,163,111, 14, 27, 50,160, 27, 39,229,184,196,228,204,107, 78, 14,246, 22, 23, 46,158, 47, 49, - 24, 12,215,234,210, 41, 47, 47, 79,228,121,222,158, 82,234,116,230,204, 25, 56, 58, 58,162,176,176, 16, 70,163, 17, 6,131, 65, -175, 86,171, 85,247,239,223,135, 78,167,131, 78,167,131,181,181, 53,238,222,189,155,205,243,252,169,154, 52,121,158,159, 64, 8, -153, 79, 41, 69, 76, 76, 76, 58, 0,184,187,187, 55,180,181,181,221,194,243, 60, 50, 50, 50,112,230,204,153,209, 25, 25, 25, 15, -170,212,197, 90, 59,185,155, 88, 7,158,250,120, 57, 59, 59,135, 91, 88, 88,204,154, 58,117,170, 75, 88, 88, 24,180, 90, 45, 0, -192,210,210, 18,106,181, 26,214,214,214,104,223,190,253,189, 5, 11, 22, 24, 40,197, 56, 74,105,173,131, 16,238,221,187,151, 27, - 20, 20, 52,117,226,196,137,243,130,130,130,252, 40,165, 8, 12, 12, 68,239,222,189,113,232,208, 33, 60,124,248, 16,229,229,229, -194,213,171, 87,183,165,166,166, 30,100,151, 89, 6,131,193, 76,214, 11, 18,193,170,184, 33, 17, 66, 8,253,171,127, 48, 59, 59, - 59,215,211,211,243,200,141, 27, 55, 6,188,242,202, 43, 56,115,230,204, 56, 0,211, 1, 64,169, 84,142,123,229,149, 87,112,227, -198, 13,220,191,127,255, 72,118,118,118,238,115, 58, 96,106,189,254, 81, 0, 71,165, 82,153,213,243, 70,237, 95,209, 52, 8, 74, -169,127, 77,223,213, 17, 13,243,110, 55,116, 40, 87,118,235, 86,209,252,163, 71, 63,216,186,103,143,220,203,203, 11,165,165,165, -144, 72, 36,176,182,182, 38,189,251,245,179, 91,179,117,171,171,151,149,213,133,201,227,199,199,124,117,252,184,250, 66,113,177, - 73,211, 43,104,181,218,181, 95, 46,152,221,237,183,205, 59,130, 27, 5, 7,218, 29, 58,118,250,166,131,131,181,153,175,175,191, -178,184,168, 72,247,195,138, 37,210,242,242,242,117,117,233,104, 52,154,189, 39, 79,158, 28,226,229,229,229, 20, 25, 25, 9,189, - 94, 15, 65, 16,208,179,103, 79, 80, 74,149, 0, 68,169, 84,138,123,247,238,193, 96, 48,228, 60,124,248, 48, 61, 46, 46, 78, 9, - 96,113, 29,101,248, 39,163,196,113,220,200, 1, 3, 6,128,231,121,244,238,221, 27,251,246,237,123, 5,192,188,154,182,127,134, - 8, 86, 3,119,119,247, 69, 21,191,105, 82,231,118, 55, 55,183,142, 65, 65, 65,243,150, 46,253,134,184,184,184, 65, 16,120, 24, -141, 6,228,230,230,163,180,180, 20,161,161,161,240,246,246,198,226,197,139, 1, 96, 95, 93,230,170,146, 7, 15, 30,196, 2, 24, - 53,126,252,120,249,217,179,103, 91,106,181,218,229,189,122,245,194,205,155, 55,113,251,246,237,215,156,157,157,115,188,188,188, -120, 15, 15,143,183, 9, 33,214, 42,149,106,107,108,108,108, 58,187,220, 50, 24,140,127, 19,255, 45, 47,242, 95, 53, 88,117,101, -204,197,197,197,188,164, 40,255,125, 95, 95, 95, 21, 0, 40,229,146,238,142,142,142, 95,229,229,229,149,213,247, 71,213,106,245, -142,205,155, 55,191,244,237,183,223,202,251,245,235, 23,224,233,233,217, 26, 0,134, 13, 27, 22, 96,101,101,133,205,155, 55, 27, -212,106,245,142,231,149, 73, 81, 20,123,183,106,213, 10, 5, 5, 5, 72, 74, 74,186, 94,159,125, 15, 28, 56, 96, 14,160,113, 93, -223,213,134,222,104,116,178,118,115,147,102,159, 61,107,208,240,188,119, 80, 80, 16, 74, 75, 75,161, 80, 40,160,211,233,144,152, -152, 8,185, 92, 78, 30, 38, 36, 56,206,156, 62,253,156, 89, 80,144,101,229, 8, 67, 83,200,200,200,208,184,187,187,191,183,240, -203,133, 91,150, 46, 89,226, 92,144, 95,248, 64,174, 48,211,154,155, 41,237,103,124,180,128,102,103,103,127, 88,177, 70, 85, 93, - 44,222,178,101, 75,159,151, 94,122,233,142,151,151,151,115, 94, 94,158,107, 73, 73, 9, 45, 40, 40, 32,120,212,151,138, 0,192, -157, 59,119,144,156,156,204, 11,130,112, 14,192,124, 74,169,222,212,180,122,122,122,218,181,110,221,186,143,131,131,195,227,166, -200,230,205,155,247,241,244,244,252, 62, 45, 45,173,240,121, 86,238, 99,199,142,153,139,162, 24, 10, 0,125,250,244, 49,213,140, -191, 62,114,228, 72, 98,102,102, 1,158,231,161, 84,202,161, 84, 42, 97,105,105, 13,123,123,123, 36, 39, 39,163,123,247,238, 98, - 66, 66,194,126,115,115,243,245,245, 77,211,233,211,167, 7,181,110,221,122,250,228,201,147, 97, 52, 26, 49,100,200, 16,164,167, -167, 47, 77, 76, 76,220,238,234,234, 58,250,179,207, 62,115,116,112,112,192, 39,159,124, 98, 6, 96, 46,187,220, 50, 24, 12,102, -178, 94, 0,131, 85,203, 77,177,149,179,179,243,148,156,156, 28, 85,101,211, 11, 33, 68,213, 52, 32,224, 23,119,119,247,159, 50, - 50, 50, 46,212,231, 71, 11, 11, 11, 75,220,220,220,246, 95,186,116,105,196,176, 97,195,112,252,248,241,177, 21, 6, 11,151, 46, - 93, 66, 66, 66,194,254,194,194,194,146,231,145, 65, 15, 15,143,151,187,117,235, 54,182,117,235,214, 56,112,224, 0, 4, 65, 56, - 85,159,253,171,142, 24,172,110, 20, 97,229,119,166,104, 41,148, 74,177,178,255,141, 68, 34,129, 86,171, 69,102,102, 38, 98, 98, - 98, 96,109,109,141,194,130, 2, 98,109,111,111,208,233,116, 66,125,243,153,145,145,145, 22, 20, 20, 20,167,209,106,101,118, 14, -246,106, 43, 11, 5, 45, 41, 45,229,238,220,185,153,153,157,157,157,100, 98,165,214, 19, 66,186, 28, 61,122,244, 11,137, 68,242, -138,135,135, 7, 70,140, 24, 65,122,244,232, 1,133, 66, 1,141, 70,131,162,162, 34, 28, 56,112, 0, 60,207,251, 1,128,147,147, -147, 75,131, 6, 13,118,115, 28,151,157,144,144,240,102, 93,191, 33, 8,194,176,193,131, 7, 75,141, 70, 35, 22, 44, 88,128,185, -115,231,162,111,223,190,210,107,215,174, 13, 3,240,235,115, 60, 65,241,210, 75, 47, 61,238,228, 94,181,115,123, 77,116,237,218, - 85, 42,145, 72,252, 61, 60, 60,144,148,148, 4,115,115,115,184,184,184,192,214,214, 22,142,142,142,248,246,219,111,177,124,249, -242,219, 18,137,100, 85, 70, 70, 70, 92,125,211,228,237,237,253,246,152, 49, 99,222, 30, 49, 98, 4, 74, 75, 75,113,233,210, 37, -116,232,208, 1,139, 22, 45,114, 61,127,254,252,180, 86,173, 90, 65, 42,149, 34, 34, 34, 2,130, 32,164,178,203, 44,131,193, 96, -252,195, 13, 86,213,246,206,170,239,237,236,236,172, 85, 42,213,196, 1, 3, 6,116, 28, 50,100, 8,122,247,238,253,167,157, 87, -174, 92,105,121,230,204,153, 25, 30, 30, 30, 93, 0,172, 74, 79, 79, 47,168, 71, 84,105,239,150, 45, 91,250,181,107,215,206,188, - 91,183,110,254, 0,160, 84, 42,245, 91,182,108, 81,139,162,184,183,190, 25,121,114,210, 71, 79, 79,207, 86, 18,137,100,220,192, -129, 3, 91,189,241,198, 27,136,138,138,194,230,205,155,239, 5, 5, 5, 29,175,167,110,124, 29,163, 8, 87,212, 21,205, 82,200, -100,185, 37,153,153, 14, 82, 55, 55,133,133, 66,145,122,237,218, 53,255,128,128, 0,146,144,144,128, 7, 15, 30,192, 96, 48,224, -214,173, 91,148, 3,210, 36,214,214, 92,242,157, 59, 68, 46,147,213,123,206, 46, 51,185,216,226,243, 79, 38, 4,106,181,154,208, -226,226, 98, 94, 42,149, 74,149, 50, 33,161,158,198, 68,231,237,237, 61, 88, 16, 4, 71,189, 94,111,116,113,113,145,157, 56,113, - 2, 10,133, 2,143, 70,127,134, 67,161, 80,232, 61, 61, 61, 75, 1,192,193,193,129, 91,180,104,145,108,218,180,105, 81,117,105, -183,104,209, 66,214,160, 65,131,145, 65, 65, 65,184,120,241, 34,162,163,163,227, 47, 94,188,232,223,162, 69, 11,120,121,121,141, -108,209,162,197,134, 27, 55,110, 24,159,151,193, 66, 61, 59,185, 71, 68, 68,136,238,238,238, 32,132, 64, 34,145, 64,173, 86, 35, - 33, 33, 1,237,219,183,199,186,117,235,176, 98,197,138, 77,153,153,153,235,159, 38, 61,227,199,143,151, 55,105,210,228,245, 17, - 35, 70, 32, 62, 62, 30,139, 23, 47,206,207,202,202, 58,125,244,232,209, 97,147, 39, 79,150,116,232,208, 1,121,121,121,216,176, - 97, 3,127,243,230,205,245,253,250,245,251,141, 93,158, 24, 12,198,191, 45,114, 85,221,251, 23, 46,130,229,225,225,209,223,222, -222,254,173,145, 35, 71, 74, 26, 53,106,132,236,236,108, 88, 89, 40,245,132, 16, 5, 0, 88, 89,168,244, 70,163, 17,147, 39, 79, - 70,179,102,205, 90,207,152, 49,163,149,171,171,235,166,172,172,172,221,166,252,112,118,118,182,218,205,205,109,215, 59,239,188, -179,248,214,173,155,126, 0,112,245,234,213,132,140,140,140,153, 38, 54,103, 85, 53, 65,149,147, 83, 18,115,115,243, 59,129,129, -129,249,125,250,244,177, 27, 58,116, 40, 28, 29, 29,113,243,230, 77, 44, 90,180, 40, 74,171,213, 78, 57,115,230, 12,255,223, 46, -100,158,231, 83,174, 28, 60,104,247,210,232,209,118, 11, 70,142,252,225,141,241,227,191,249,106,209, 34,185,135,135, 7,177,182, -182,198,237,219,183,233,154, 95,127, 53,108, 95,178,228, 7,137,153,153,252,236,190,125, 10,193,104,140,173,207,111,120,122,122, -118,233,215,167, 75,248,210,111,191,131, 70, 93,134,171,151, 14,162,176, 32, 15,191,252,186,167,177,167,167,103,151,180,180,180, -136,122,164,215,127,215,174, 93,143,204,161, 66,129,249,243,231,195,221,221, 29,214,214,214, 40, 43, 43,195,132, 9, 19, 20,239, -191,255, 62, 0, 32, 58, 58, 26,150,150,150, 38,233,102,102,102,118,155, 56,113,162,181,209,104,196,225,195,135,117,130, 32,188, -119,252,248,241,189, 77,155, 54, 85,118,238,220,217,250,183,223,126,235, 14,224,232,223,120,114,139,238,238,238, 41,199,142, 29, -243, 30, 49, 98, 4,228,114, 57, 10, 11, 11, 97,101,101,133,165, 75,151, 82,131,193,176,251,105,181,211,211,211, 21,142,142,142, - 10, 65, 16,176,107,215, 46,148,148,148,188,153,150,150,150, 21, 16, 16,176,119,198,140, 25, 31, 6, 6, 6,250,198,198,198, 38, - 11,130,176, 36, 61, 61, 61,145, 93,106, 25, 12, 6,227, 5, 53, 88, 0, 94, 59,114,228,136, 68, 20, 69,172, 94,189, 26, 55,110, -220,160,150,214,246, 31, 88,217,144,141,214,214,214, 66, 81, 81,209,107,223,124,243,205,144, 47,190,248,130,116,234,212, 9,151, - 46, 93, 34,126,126,126,195, 0,236,174, 98,124,106, 93,109,187,184,184,248, 90,118,118,150, 95,149, 89,219,253,148, 74,213,181, - 58,204,212,159, 52,171,153,204,178,233,151, 95,126, 25,233,236,236,108,140,140,140,196,170, 85,171,196, 27, 55,110,252, 1, 96, -105,118,118,182,198, 20,205,231, 65, 85, 77,187,160,160, 11,235,102,205,106,222,110,208, 32,218,253,149, 87,196,101, 10,197, 71, -179,231,204,121,175,160,164,196, 75, 20, 69, 56,216,216,164,108,250,242,203,111, 59,116,234,164,185,123,249,178,197,249,223,127, - 55,115,105,208,224, 92,125,210,153,150,150, 22,209, 48,192, 27, 27,126,253, 22, 6,131, 14,153,233,201, 0,128,188,252, 98,212, -102,174,170,211,228, 56,174,104,220,184,113,230,122,189,158,140, 28, 57, 82,150,147,147,131,128,128, 0, 0, 64, 73, 73, 9,254, -248,227, 15, 4, 7, 63,154, 86,235,238,221,187,143,223,215,149, 78,115,115,243, 87, 58,118,236,136,164,164, 36, 68, 69, 69, 29, -202,206,206,206,117,115,115, 59,148,156,156, 60,172,101,203,150,216,187,119,239,136,154, 12, 86,125,143, 81,229,196,162,245,169, - 75, 21,230,114,198,222,189,123, 39, 94,186,116,169,203,244,233,211, 73,143, 30, 61, 0, 0,229,229,229,130, 41,253, 13,107, 75, -103,101,243,176, 40,138,240,242,242, 42, 7,128,184,184,184, 68, 0,239, 62,173,230,243,168,159, 76,147,105, 50, 77,166,249,191, -160,249,111, 50, 88,188, 40,138, 56,115,230, 12,246,236,217, 35,232,245,250, 89,153,153,153, 49, 85,254,191,222,203,203,235,220, -176, 97,195,150, 61,120,240, 64, 18, 29, 29, 13, 74,105,189,250, 14,105,181, 90, 35, 33,255,249,221,179,102,106,221,186,117,200, -202,202,210, 39, 39, 39,255,110, 48, 24, 54,231,229,229,101, 62, 67, 84,227,153, 71, 17,254,114,227,134,238,101, 43,171,125, 51, -187,117, 27,182,224,200, 17, 85,223,241,227,245, 93,251,244,249, 10,122,189, 94, 38,147,137, 48, 51,147, 72,204,204,228,209,151, - 47, 91, 44,157, 52,201,129,112,220,254, 31,163,163, 53, 79, 17,193,194,184,183,166, 65,163, 41,195,229,139, 7, 81, 84,144,135, - 75,215, 30,160,190, 17, 44,169, 84,234,109, 52, 26,149, 60,207,167, 83, 74,241,250,235,175, 67, 16, 4,104,181, 90,148,150,150, -162,160,160, 64, 59,117,234, 84,174,194, 52,225,165,151, 94, 50,105, 86,127,127,127,127,111,169, 84,138,163, 71,143, 66, 34,145, -236,126,100,136, 37,187, 79,158, 60, 57,108,228,200,145,240,240,240, 8, 34, 21, 99,116,107,211,121,188,216, 51, 65,224,163, 51, - 29,129,206,225, 67,238, 84, 46,246,204,113, 92, 98,179,102,205, 76,234,119,245, 36, 57, 57, 57, 57, 0,230,187,187,187,239,252, -228,147, 79, 38,183,110,221, 58,124,222,188,121, 0, 32,121,214,122, 41,138, 34,120,158,127,166, 41, 36, 24, 12, 6,131,241, 15, - 55, 88,132,144,109,221,186,117, 27, 69, 41,149,112, 28,183,249, 9,115, 5, 0, 72, 77, 77, 77,240,244,244, 92,237,235,235,251, -120, 1,232,122,154,151,108, 66,200,215, 28, 71, 62,121,244,185,254, 19, 75, 86, 89,218,230, 19, 0, 68, 42,149,109,190,114,229, -202,167, 25, 25, 25, 89,245, 53,124,213,241, 60, 70, 17, 2,192,238,210,210,216,151, 45, 45,247, 79,110,218,116,224,144,247,222, -163, 45,123,245,178,113,109,208,128,231,141, 70, 33,254,206, 29,114,126,239, 94,249,249,223,127, 55,147, 16,114, 96,119,121,121, - 76,125,211,153,150,150, 22, 17,224,239,121,108,248,176,126, 47,249,251,186, 3, 0,226, 19, 51,144, 87, 80,124,172, 62,230, 10, - 0,146,146,146,116, 0,116,110,110,110,195,118,236,216,177,171,194,244, 84,141, 10,233,164, 82,105, 67, 0, 40, 45, 45,245,217, -187,119,239, 22,169, 84,154, 86,151,110,116,116,244,182, 57,115,230,140, 78, 72, 72,248, 61, 45, 45, 45,174, 34,221,113,238,238, -238,171, 50, 50, 50, 70, 39, 39, 39,255, 70, 77,112, 31, 79, 44,246,140,168,243, 59, 85, 0, 26, 87, 46,246,252,180,107, 13, 86, -165, 98, 94,174,247,221,221,221,219,245,238,221,123, 28,165, 52,231, 89,244, 84, 42,149, 81,167,211,241,130, 32, 72, 13, 6, 3, - 85,169, 84, 70,118,249, 97, 48, 24,140, 23, 23,242, 87, 62, 77,155, 26, 66,124,178,131,250,211,104,214, 71,195, 20, 77,119,119, -247, 41,132, 16,127, 83, 53, 40,165,241, 25, 25, 25, 63,212,160,201, 85,126, 95,211, 98,207,212,104, 76, 86,249,251,159,219,116, -247,174,182,186,224, 71,125,202,179, 97,195,134, 52, 54, 54,214,164, 78,130,117,105,122,122,122,170,164, 82,233,147, 17, 42, 93, -133, 9,171,212, 32, 0, 36,148, 82,190, 62,233,124,218, 99,244, 56,130, 5,112, 34, 17,135,115,148,219, 5, 64,172,140, 96, 61, -239,250,249, 12,117,137,171,250, 63,127,127,255,119,130,131,131, 71,223,185,115,103, 71,106,106,234, 74, 19,228,196,255, 82, 58, -153, 38,211,100,154, 76,243,111,215, 52,129, 86, 0, 42,151,102,171,156, 39,211,233,137,247,122, 0, 85,239, 89,149,159,115, 1, - 92,171,162, 81,245,251,186,246, 5,128, 60, 0,119, 96,194,170, 40,117, 70,176,254,155, 60,237,114, 40,207, 91,227,137, 8,198, - 15,207, 81,238,113,232,103,211,221,187,106, 0, 71,254,202,242,124,248,240,225,115, 27,125,145,150,150,166, 5,160,173,163,236, - 41,128,255,218,224,129,106, 76, 84, 56,254, 55,249, 83, 71,176,248,248,248, 31,186,118,237,250,115,106,106, 42, 15, 6,131,193, - 96,212,219, 92, 17, 66, 14, 86,220,119, 6, 84, 24,189,131, 79,190,175,220,166,114,187,170,219, 84,106, 60,249,125,109,251, 2, -192,204,153, 51, 63, 93,180,104,145, 57,128,211,166, 38,152, 99,199,140,193,248,239,241,119,140, 98,101, 48, 24,140, 23,128,199, -198,232, 73, 35, 84,205, 67,255,128,170,127,107,163, 58,157,202,223,168,250,121,241,226,197, 95, 1,168,215, 74, 48, 82, 66, 72, -120, 13, 9, 52, 57,244, 87,147, 70,109,255,171, 75,159,105, 50, 77,166,201, 52,153, 38,211,100,154, 47,158,230,243,218,255,121, - 80,157, 89,123, 34,226, 5, 66,200,193,153, 51,103,126,138,122, 52, 15, 86,138,255,101, 47, 0,225, 76,147,105, 50, 77,166,201, - 52,153, 38,211,100,154,207,248,234,255,200,178,208,254, 85,223, 87,247, 93,109,239,235,218,215,132,109, 77, 78,243,255, 68, 31, - 44, 6,131,193, 96, 48, 24,140, 90,200,173, 26,109,170,136, 48, 9, 51,103,206,252,180,106, 63, 41, 0, 58, 0,202,106,162,101, -127,234,187, 85, 71,100,205,228,109,107,131, 25,172, 26,104, 22, 40, 89,224,237,237,220,242,113,148,175, 98,138, 2, 17,180, 50, -242, 87,241, 70, 4, 21, 41, 50, 50,139,110,220,137,167,179,107,144,171,179,175, 91,167, 78,174,246, 18, 77,217,114, 65, 20, 58, - 0, 0, 1,119, 86, 38,179,157,126,242,106,122, 17,158,232, 44, 93, 19, 33, 1, 36, 68, 37,197,199,162,136, 38,132, 0,132,224, -142,150,199,146,123,113,244,222,179,150, 7, 33,132,132,249, 97,130, 66,105, 62,210,198,214, 46,176, 48, 63,239,161,193,160,219, - 25,157,136, 95,232, 83, 12, 69, 13, 14, 32,205, 32, 96,134, 32, 66, 38,229,176,252, 94, 34, 61,207,106, 29,131,193,248, 47,241, -172,253,143,171,187, 38, 63,235,224, 34, 54, 65, 94,237, 92, 3,208,170,138,233,201, 5,112,119,209,162, 69,133,139, 22, 45,170, -250,221,109, 0, 77, 43,182,203,173,198, 40,233, 43, 62,235,171,217, 70,111,202,182,127,137,193, 10,243, 34,147, 65, 49, 23, 4, - 20,192,188,168, 84,186,170, 94,251, 7,146,158, 42,169,100, 13, 40, 36, 90,163,240, 33, 21,112,182,218,155,185, 4,157, 85, 50, -201, 50, 16,136, 90, 94,120, 51, 42,150,158, 48,245, 55,194, 27,146, 62, 82,194,253, 38,138, 84, 38,136,116, 35, 68, 28,180, 52, -226,194,165, 52,170,173, 79, 90,189,189,157, 91,238, 59,145,249,210,233,109,239,161, 77,179, 64, 80,209, 8, 80, 30,230,193, 31, -227,228,166,215,209,166,177,247,163,239, 68, 35, 44,155, 47, 67,223,142, 54, 79,125,114,116,234,228,106,111, 38,138,119, 86,173, -253,205,213, 59,176, 29,161,162, 14,177,183, 14,191,246,254, 39,159,117,235,209,218,163,201,201,171,117,175,241,216,180, 33,121, - 43,160, 65,163,143,167,125,246, 45,231,238,238,105, 41,242,122, 62, 51, 53,186,197,247,223,206,217,221,180, 33, 89,118,251, 33, - 93, 99,170,145, 10,245,197, 68,169, 76, 49,194,204,220, 34, 80,173, 46,141, 21,140,198,157,225, 1,210, 62, 75,190, 89,209,172, - 75,183,190,150,162, 46,139, 51,242, 36,116,251,142,173, 62, 63,252,180,170, 31, 33,100, 16,165, 84,172, 87,166, 5,124,112,119, -255,132,225, 50,169,132, 4,247,255,213,130, 16,210,187,222, 26, 0,194,253, 72, 24,173, 99, 38,244,138, 43,223,143,145, 9, 52, -234,105,142, 79,136, 31, 89, 75,128, 32, 0,187, 8,197,182,168,196,103,155, 19,139,193, 96,252,239,225,225,225,113, 58, 61, 61, -189,219,115,214,108,147,158,158,126,133,149,238,115, 53, 89, 79,114,213,196,237,254,235,212, 55,130,181, 48, 42, 54,213, 14,162, - 1, 97, 65,254, 11, 0,212,203, 96,169,164,146,141,215,238,100,187,130, 26,240,235,183,239,108,215, 27, 1,158, 55, 64,224,141, - 16,120,227,163,247,130, 17, 34,175,197,156,229,103, 0,190, 20, 45,155, 53,220, 8,192,205,212,223,144,129,251,237,198,133, 99, -246,132, 47,198,246, 13,139,166, 38,103,148, 77, 61,113, 53, 35, 47,204,151,204,138, 78,194,250,250,220,196, 79,111,123, 31,155, -119, 31, 74, 91,249,235,142,251, 34, 40,236, 44,149,141,198, 12,139,242,218,180,251,116,234,138,117,218,251, 84,164,176,181, 82, - 54, 26, 59, 40,214,251, 89, 14,130, 68, 83,182,252,167, 95,215,187,122,251,248, 16, 99,226, 66,192,168,131,151,119, 63,201,103, -211,222,114,155,247,205,143,223, 2, 24, 91,107, 52,200,159,132, 6, 53, 12,249,112,227,246,139,222,229,101, 57,250, 83,127,124, - 26, 71, 40, 53, 58, 58, 6,203,231, 47, 92,106,246,249,172,105,211,131,253,201,149,251,241, 52,186, 14,115,197,133,248, 98,255, - 87, 95, 45,105,210,163,215, 64, 75, 65,159, 43,209,150,149, 6,173, 89,191,118,110,112, 88,107,243,142,205, 61,229,185, 23, 38, - 17,117,105, 1, 12,212, 76,217,189,101, 15,107,245,152, 87,140,107, 55,109,157, 2,224,187,122,249, 43,254,255,231, 26, 49,240, - 80, 1,144,161,190, 29, 8, 31, 61,242,189,123,235,210,233,137,124,225, 53, 64, 52, 84,152, 94, 3, 32, 26, 65,171,252,109,251, -234,122, 0,152,244, 84,143,186, 4, 47,157, 56,113,205, 45, 59, 59,179,213,242,229, 95,205, 10,245, 35,135, 65,240,219,189, 4, - 68, 60,141, 41,100, 48, 24,255,155,184,187,187, 11, 25, 25, 25,146,231,169,233,225,225,209, 47, 61, 61,253,208, 51,166,235, 99, - 0,111, 85,124, 92,147,145,145,177,228, 89,211,213,170, 85, 43, 79, 74,169,107,197,181, 63,235,218,181,107,105,172, 6,252,189, - 6, 75, 5, 42, 2, 23,134, 0,164,126,195, 21, 43,110,134, 42, 16, 9, 96, 44,195,224, 1, 61,225,232,224, 6, 8,229,128,160, - 1,120, 53, 32, 60,122,229,229, 38, 3,124, 57,144,123, 24, 60,165,202,122,231,202, 88, 12,228,236,196, 75,237,188, 97,107,165, -194,251,163, 66, 29, 87,239,123,176,102,205,190,152,158, 0, 70,154,148, 86, 74,209,166,121, 32, 86,254, 90,126,255,247,211, 57, -189, 1,160,127, 87,199, 35,109, 26,251,120,173, 88,167,189,255, 71, 68, 65, 31, 0,232,219,209,230,112,235,112, 87,111,241, 25, - 38,108, 21, 68,161,163,119, 64,115,194,167,124, 3,142, 43, 68, 89, 89, 30, 82,227, 55,192,209,165, 55,199,139, 98,231,186,246, - 55,147, 98,230,251, 31, 47,150,150,151,101,235, 41,159, 35,186, 88,230,201,101, 32, 18,177,252,156, 94,147, 85, 84,246,193,187, - 99,248, 15,103,126, 53, 19,192,232,218,116, 66,253, 48,101,217, 55, 43, 26,119,104,221,200, 57,235,252,251,164,172, 56, 27, 70, -106,166, 28,212,165, 3,236,124, 66,197,236, 91,203,136,210,173, 39,236,124,253,145,118,119, 51,146,239,236, 33,157, 90, 15, 83, -110,220, 34, 31, 83,147,193,106,232, 70, 58,246,126,169,245,118,127, 31,119, 55, 74, 69,136,162, 8, 74, 69,140, 29,217, 7,179, -126,136, 67,185,134,199,128,158,109, 59, 56,216, 72,116,139, 62,236, 10, 74, 69,164,102,228,171, 79, 93,188,223, 35, 46,157,214, -249,228, 71,128, 31,155,182,235,214,241,206,213, 75,193,134,140,131,104, 53,116,209,125, 2,156,175, 82,231, 58,222, 60,185, 62, - 24, 88,255, 84,199,134, 16, 66, 66,124, 33,164, 92, 94, 12,207,230, 19, 36,191,172, 63,226, 84,156,159, 62,118,207,142,159,134, -255,180,250,151,205, 79,107,218, 24, 12,198,255, 30, 25, 25, 25,207,221,100, 93,188,120, 49,227, 89, 76, 86,171, 86,173, 58, 3, -248, 38, 35, 35,163,210,108,125,211,166, 77,155, 47, 42,239, 83, 79, 80, 76, 41, 29,125,237,218,181,179,181,105, 78,159, 62,221, - 29,128,239,245,235,215, 43,127,195,183, 85,171, 86,190,213,109,107,110,110, 46, 52,109,218, 52,233,219,111,191,205, 96, 53,228, -175, 53, 88,247,179,206,125,208, 92, 95,160, 6,128,251, 38,152,148, 63, 13,181,212, 26,133,197, 27, 86,140, 93, 28, 22,100,135, -146, 82, 61,142,159, 75,170,136, 96,241, 16, 4,227,227,191,189,219, 57,162, 61, 63, 9,223,109,139, 1, 47,136,139,106,211,124, - 18,131, 40,190,218,172,243, 43, 59, 68, 74, 21,230,230, 92,113,128,151,131,243,135, 99,154,114,239,143, 10,131, 70,203,191, 18, -234, 75, 78, 69, 39,210, 95, 77,210, 20,249,106,242, 84,205,119,162, 80,103,222,107,162,105, 35,179, 54, 67,251,118,178,134,177, - 0, 66,121, 34,244,130,136,204,204,114, 36,100,200, 97, 35,102,155,164, 41,138,104,226,234,234,102,126,241,216,140, 68,103,171, - 66,185,131,153, 32,151, 19,145,114, 70, 42,209,235,239,107,237,220,123,202, 68, 17, 77,234, 58, 70,102,102, 86,175,119,234,214, -223, 38,229,228, 91,196,204,171, 47,156,253, 60,145,120, 99, 3,114, 34, 15, 34, 63, 39,153,216,208, 66,152, 55,244, 71,223, 97, -163,240,205,148,150, 40, 41, 41, 3,201,141,183, 81, 40,148,182, 53,105, 82, 14,163,151,125,253,165,155, 84,202, 61, 42, 79,202, - 3,212, 8, 80, 35, 74,203,116,208,235,245, 80,201, 41, 44, 84, 20,168,104,134, 21, 4,189,121,147, 30, 51,223, 1,112,165,174, -188, 71, 38,208,168, 48, 63,114, 30,148, 15,166,130, 6, 4, 56, 31,149, 64, 31,155,158,112, 63, 18,214,162,199,248,119, 9,240, -227,211, 28,163,240, 6, 24,208, 50,216,210,194,140,191,143,180, 51, 83, 17, 39,168,168, 75,227,183, 48,106,244, 20,243, 95,214, -172, 30, 72, 8,153, 92,181, 15,218, 95, 49,188,152,105, 50,205,127,170,166,141,141,141, 95,131, 6, 13,190, 48, 26,141,157,229, -114,185,139,193, 96,128, 40,138, 89, 10,133,226, 92, 82, 82,210,252,226,226,226,132,255,181,188, 31, 62,124,216,100,147,101,138, -166, 76, 38,195,161, 67,135, 98, 77, 53, 89, 79,106,114, 28,247,219,174, 93,187,176, 99,199, 14, 0,192,233,211,167,209,176, 97, - 67,139,234,246, 77, 77, 77,181,120,249,229,151,127, 3,224, 85,155,230,195,135, 15,253,190,252,242, 75,236,218,181, 11, 0,176, -105,211, 38, 4, 5, 5, 85,155,158,219,183,111, 75, 62,255,252,115, 63, 0, 25,127,245, 49,122, 97, 13, 86,197, 26,187,117,117, -210,139,119,181,146, 53,135,209, 8, 0,241,245,253,177,232, 56,250,117,211, 32, 89,159,147,123,126,236,172, 82,112,152,187,252, -195,212,220,220,210,182, 82,201,163, 14,131,188, 0,206,206, 86,113,105,209,212,166,222,133,197, 90,252, 30,145,126, 54, 42,158, -214, 43, 20, 26, 21, 71,143, 3,176,253,255, 27, 36, 9, 26,251,217,241,109,219,190,238,211,100,218,232, 38,216,127, 38,105, 26, -128, 58,215,170,163,162, 8, 74,249,199,157,218, 43,190,172,104,114,250,255,239, 68, 74, 1,106, 4,173,103,255,196,121,243, 70, - 72,247,111,219,219,199, 66, 41,253,126,210,219, 19,173,141,249,209, 40, 46, 18,144,149, 87,142,228, 92, 91, 8,102, 1,120, 16, -117, 69,144,112, 92,157,253,207, 8,135, 18,106, 44,183,178, 51, 51,227, 66, 91,191,227, 86, 28,249,105,137, 82, 98,148,216, 54, -251,210, 42,251,238,178, 20, 94,151, 83, 70, 56, 24,234,210,177,182,177,105,168, 43, 77,146, 20, 23,229,195,182,113, 40,250, 14, - 26,136,185,111,134,160,180,180, 28,185,249, 23,105,160,143, 13,209,222,220,130,207, 94, 15, 70,126, 94, 38,244, 70,128, 43,209, - 22,104,245,218,178,154, 47, 22,248,229,131, 15, 63,121,213,199,211,201,162,114,176, 0, 21, 5, 52, 13,247, 71,175,110,109,112, -252,210, 69, 92,187,249, 0, 34, 21, 43, 6, 19, 8, 72,203, 41,202,214, 26,132, 13,245,186,120,138,252,163, 72,104, 53, 6,236, -105,162, 76,141, 27, 19,115,161, 28,179,219,134, 90,189, 57,227,117, 31, 43, 43, 5,129,214, 76,128, 86,107, 68,233,253, 31,224, -224,217, 24,230, 42, 21,105,222, 92, 35, 5,192,214, 21,100, 48,170, 48, 98,196, 8, 85,118,118,246,153,254,253,251,135,246,236, -217,211,188,115,231,206, 40, 47, 47,199,209,163, 71,161, 86,171,125,188,188,188,124,142, 29, 59, 54,172, 77,155, 54,209, 94, 94, - 94, 93,119,238,220,169,125,138,159,169,188, 95, 61,215,206,225, 10,133, 2,151, 46, 93,122,174,145, 44,133, 66,129,171, 87,175, -198, 62, 77, 36,171,188,188, 92,238,234,234, 10, 7, 7, 7, 8,130,128,242,242,114,236,219,183, 15, 37, 37, 37, 16, 69, 17,102, -102,102, 88,118,184, 24,218,152, 93, 88,243,253,151, 40, 46, 46,150,215,165,153,151,151, 71, 26, 53,106, 4,157, 78, 7,158,231, -161,213,106,113,226,196,137,199,159,165, 82, 41, 22,236,202,134,238,193, 54,108,252,101, 25,242,242,242,200,127,171,238,152,232, - 69,254, 57, 6,171, 50, 67,255,141,140, 9, 2, 63,107,245,134,109,151,102, 77, 29,137, 41,175,247,240,154,255,221,222,158,209, -241,116, 35, 0,132,250,147,177, 99,250, 5,122,219, 90,200, 48,239,231,235, 0,232,172,103,253,189,200, 36,250, 32, 44,128, 76, -219,123, 38,249,204,167,111, 54,135,191,151,117,195,128, 0,162,136,139,163,117,247,247, 17,141,176,179, 84, 54,234,223,213,241, - 8,168, 8, 91, 75,101, 48,168, 0, 91, 43,101,163,190, 29,109, 14,139,148,194,214, 66, 30, 76, 69,211, 39,231,110, 29,174,124, -219, 76,198,189,109, 97,101,235,253,193,164, 49,102,253,251,191,108,102,161,160,200,143, 62,132, 18, 26, 6,189,133, 5,168,186, - 8, 9, 15, 35,133,195, 17,215,211,149, 14,110, 31,213,153, 76, 1,103, 51, 82,239, 13,109, 16,216,211, 54,247,250,103, 57,126, - 61,182,248,114, 16,184,242, 75,195,114, 44,172, 66,229,231,111, 71,242,162,128,139,117,233,148,150,148, 36, 25, 13,112,211, 26, -101, 86,113, 87,215, 99,230,152, 48, 20, 21,230, 66,171,227, 81, 84,206, 27,220, 28, 13, 74,109,225, 93,232,244, 60,116, 6, 10, -153,185, 59,142, 93,138,204, 19,121,227,225,154, 52,227, 50,232, 45, 0,150, 85,191, 11,112, 39, 77,103,216,153,221,130,160, 65, -114, 74, 6, 54,238,190,212,188, 98,187,103,120, 60,229, 65,249,255,191, 70, 87,118,126,127,154,206,237, 33, 13, 72,107, 51, 51, -217,247,243,102,246, 15,237, 26, 38, 40,137, 54, 19, 4,128,185, 74, 10,157, 74,128,141,202, 31,212, 80, 74,213, 90,109, 81, 84, - 36,216,204,236, 12, 70, 21,130,131,131, 93,109,108,108,162, 62,252,240, 67,251,161, 67,135, 62, 54, 3, 27, 54,108,192,138, 21, - 43, 48,119,238, 92, 24,141, 70,172, 94,189,218,124,247,238,221,173,127,252,241,199, 52, 31, 31,159,176,228,228,228, 44, 19, 77, -149,188,226,222,197, 85,152, 43, 97,222,188,121,116,238,220,185,168,250, 29,165,212,240, 52,233, 87, 40, 20, 80, 40, 20,184,127, -255,254,115, 49, 89, 50,153, 12,114,185, 28, 10,133, 2, 49, 49, 49,245, 54, 89, 60,207, 75,210,210,210, 80, 82, 82,130, 94, 3, - 7, 98,197,226,197,232,220,185, 51,122,246,236, 9, 74, 41, 78,158, 60,137,246,118, 15, 96, 63,176, 11,238,221,187, 7,163,209, -104, 82,203, 84, 90, 90, 26,242,243,243,209,103,224, 64,252,250,211, 79,104,209,162, 5, 26, 53,106, 4, 0, 56,115,230, 12,122, -120, 36,193,178, 81, 79, 60,120,240,224,191, 86,119,254,155, 94,228,191, 26,193,250,111, 17, 25, 71, 47,135,250,145,131,163,250, -183, 26, 48,176,123, 40,126,221,118,234,203,208, 80,178, 13, 0, 28,108,148, 11, 95,239,239,143,232,248, 66,156,188,154,113, 48, - 58,129, 94,126, 30,191, 41, 10,112,116,176, 53, 7, 56, 5,212,122,129,183,182,174,123,218, 3, 17, 20,230, 33, 51, 49,102,232, - 61,175, 54,141,189,188, 40,229, 43, 70, 12,126,139,177,131, 98,189, 91,133,185,120, 63,106,242, 50,194,186,253, 22, 64,180,168, - 51, 29,157,154,169,142,125,244,222,212,118,253, 7,142, 50,147,155, 59, 64,212,164,194, 88,112, 7,249, 9,167,161, 51,107,134, -220,180, 68,108,219,255,123,241,253,132,236, 18,137,132, 59, 46,181,113,249,228,196,137,132,178,186,116,181, 18, 44,154,251,197, -172,254,219, 54,111,181, 49,115,239,132,135,251,251, 21, 41, 36, 70,165,179, 71, 16, 52,188,149,176,116,221, 65,219,114, 96,113, - 93, 58,234,242,146, 61, 39, 78, 30, 25, 25,232,214,209, 42, 49,242, 32,212,106, 61,116, 70, 32,188, 69, 55, 8, 34, 85, 16,142, -136,214, 18, 9,201,206, 46, 0, 49,138,217,231,110, 38,102,158,191, 22, 47,209,113,117,107,255,169,210,201, 37,239, 13,236,217, - 20, 16, 52, 24,212, 43, 28,203,215,157,156, 10, 96,252,179, 25, 44, 35,168,160, 1, 5, 58,134,249,145,159, 41,208,241,198,225, -229,193, 45,251, 78, 67,125, 34, 88,225,126,164,111,227, 96,247,245,203,191,156,101,111,239,236, 37,129,160, 1,225, 75,168, 88, -112, 25,210,242,135,176,246,236, 15,193,166, 3,126,249,105,105,153, 40,210,109,244,175, 92, 45,157,193,248, 7,162,213,106,247, - 44, 94,188,216,126,192,128, 71,163,221,203,202,202,112,241,226, 69,172, 89,179, 6, 22, 22,255,127,157,164,148,162, 95,191,126, -160,148,218,207,153, 51,103, 15,128,118, 53,105,118,232,208, 97,224,183,223,126,155,210,170, 85,171,135,120, 52,199,145, 28,128, - 4, 0, 61,113,226, 4, 7, 0,173, 91,183, 22,174, 94,189, 42, 2,160,163, 71,143,150, 89, 90, 90, 54, 44, 43, 43,139,120, 90, -131,165, 80, 40,144,158,158,254,204, 38, 75, 38,147, 61,214,147,203,229, 72, 79, 79,175,151,201,226,121, 94,250,199, 31,127,224, -230,205,155,152,215,188, 57,222,119,115,131,131,131, 3, 34, 34, 34, 64, 41,133,133,133, 5, 10, 10, 10,176,109,219, 54,116,235, -214, 13, 60,207,203, 77,209,221,183,111, 31,110,220,184,129, 5, 45, 91, 98,170,133, 5,108,109,109,113,230,204, 25, 0,128, 82, -169, 68,122,122, 58, 78,156, 56,129,174, 93,187,178, 74,253, 87, 27,172,174,132, 72,137, 23, 92,141, 6, 13, 40, 79, 1, 2,247, -208, 80, 34,143,142,174,255, 83, 2, 7,124,182,114,221,193,254,203,103, 13, 34, 19,134, 55,119,159,255,227,233,201, 0,240,230, - 43, 65, 30,230, 74, 41, 86,110,139,166, 28,240,217,243,200, 96,104, 40,145,115, 28, 38,247,234,208, 8, 25,121,122,196,167, 20, -159,138, 78,160, 38, 53,233,156,220, 56, 6,155,246,156, 73, 93,177,254,207, 35, 6,215,239,187,145,178,108,163,246, 62, 5,133, -173,153, 44,120,252,160,246,117,142, 34,108, 29,174,124,123,198,180,105,237, 6,191,246,137,153, 49,109, 47,116, 73,127, 0,130, - 26,234,114,130, 18, 62, 16,153, 41,105,152,183,124,107,170,206,200,189,122, 61, 90, 91, 47, 99,249,224, 1, 45, 11,245, 39, 67, - 23,127,253,197,241,175,230,205,177, 84,166,159, 44,145, 73, 81,206, 57,116,150, 45,252, 98,149,180,180, 88,255,114, 92, 50, 45, -173, 75, 71,199, 97,241,215,203,190,235,255,214,152,161,247,131,188,186, 58, 8, 89,241, 14,234,226,226,156, 45,135,111,184, 86, - 60, 57, 18, 0,136, 75,204, 71,110, 65, 57, 47,240,198, 8, 43, 3,230, 71,165, 81,147, 71,255,249,187, 16,167,161,253,155,188, -230,100,171,128,166,188, 16,206,118,114,244,238, 24,240,154,191, 11,153, 17,159, 77,115,159,246, 56, 87, 54, 17, 94, 90,211, 61, - 24,162, 33,152,138, 70,232,147,127,171,191, 14, 48,109,218, 72, 31, 27,123, 11, 61, 71,132,114, 64,102, 7, 40,156, 8,103,230, - 11,137,153, 55,146, 98,175,243,211,222, 25,153,159,148,148,181,214,145, 98, 9,187,132, 48, 24,127, 38, 57, 57,249,245, 79, 63, -253,244,124,155, 54,109, 92, 28, 29, 29, 17, 30, 30,142, 3, 7, 14,224,163,143,254, 63, 24,223,172, 89, 51, 0, 64,126,126, 62, -190,254,250,235,172,140,140,140,215,107,211,140,138,138,186,255,219,111,191,117,108,210,164,137, 94, 46,151, 23, 86,154,172,228, -228,100,105,121,121, 57,209,235,245,212,194,194, 66, 84, 42,149,198, 17, 35, 70, 24,174, 94,189,218,176,188,188, 60,249, 89, 34, - 88, 45, 91,182,188, 91, 84, 84, 84, 76, 8,121,230, 41, 28, 42,205, 85,112,112,176,147, 94,175, 23, 0, 20, 60,205, 20, 14, 60, -207,163,101,203,150, 56,113,246, 58, 14,159,189,139,178,220,120,140,126,185, 55,130,131,131,113,244,232,209,167, 62,102, 45, 91, -182,196,137, 19,231,113,230,122, 12,178,147,163, 49,102,212, 16, 52,106,212, 8, 39, 78,156, 96, 21,250, 89, 13, 86, 93, 33,185, - 16, 31,210,212, 37, 92,177,233,179, 65, 1,161,210,240,185, 32, 82, 51,236, 93,127,160,195,172,175,126,190,223,216,131,140,190, -107,194,104,175, 63, 69,177, 30,117, 76,222,122, 59, 58,248,181, 65,157,189,240,235, 78,243,217, 0,240, 74, 47, 63, 92,141,206, -197,149,200,156,173, 81, 79, 57,103, 81, 85, 26,187, 16,115, 88, 96,235,215,159, 12,238,234,227,233,138, 53, 59,206,131, 80,236, - 49,233, 70, 75, 41,109,211,196, 27, 43,214, 63, 57, 98,208,205,123,217, 70,237,253,163, 23, 74,250, 2,192, 75,237, 44, 14,183, - 10,177,247,174, 43,146,161,146,113, 19,250, 14,122,221,140,207, 62, 10,177, 96, 39,100, 10, 57, 52,229, 2, 50,115,116,208,152, -155,225,212,185, 8, 77,153,154,159,118, 39,150,127,170,168, 93,116, 60,141,111, 22, 68, 82,202, 53, 26, 55, 75,251,128,114,142, -128,150,233,101,244, 70,116,122,121, 84, 50,141, 49, 69, 35, 46,142,234,219,121,146, 78,191,108,220,249,133, 76,166,120, 69, 34, - 1,113,182,181,112,250,121,229, 2, 88, 89, 89,130,242,165,160,186, 60, 12,125,243,171,220,187, 15, 13,126, 0, 16, 20, 68, 44, - 59, 55,149,111,148,114, 36,237,212, 77,253,231,117,134,128, 37,152, 52,122, 80, 83,153,104, 44,199,123,115,182,227,151,133,131, - 48,102, 96,136,236,143, 83, 15, 38, 1,152,255,244, 97,202, 71, 77,132,237, 38,156,189, 79,128,243, 20,232,120,253,224,194, 96, -192,244,150,199, 22, 45,136, 76, 42, 37, 33, 33, 30,122,153,144,182, 13, 68,229, 65, 37,142, 93, 1,139,134,132, 90,134,227,135, -149, 95,148,253,186,102,205, 49,145, 96,222,253,196,218,167,188, 96, 48,254,173, 80, 74,227,109,109,109,251,244,235,215,239,228, -209,163, 71,237,195,195, 31, 45, 55,119,227,198,141,138,243,236, 81, 83, 84,118,118, 54, 94,125,245,213,188,204,204,204, 62,148, -210, 90,251,244,150,150,150, 38,236,221,187,215, 69,163,209,180,250,252,243,207,179, 27, 52,104, 80,106, 52, 26,105,105,105, 41, -120,158,167, 78, 78, 78,178, 22, 45, 90,144,176,176, 48,205,201,147, 39, 29, 82, 83, 83, 75, 1, 36, 61, 77,250,223,122,235, 45, -236,222,189, 27, 0,240, 60,230,197,146,203,229,232,215,175,159,199,197,139, 23,211, 43, 52,175, 60, 67,217,226,206,157, 59, 56, - 23, 43, 64, 97, 97,135,164,251, 37, 56,241,251,126,140,158, 48, 17, 60,255,244,189, 21,110,223,190,141,109, 39,110,195,197, 35, - 0,197,186, 59,216,183,111, 31, 38, 79,158,252, 76,154, 79,153, 63,242,194,245,193,170,204,216,147,255, 12, 8, 32, 10,165, 30, -115,122,183,245,248,100, 68,143, 0, 9,175,206,128, 40,138,144, 0,112,180,226,176,238,215, 95,252,118,238, 61,116,169,177,183, -228, 59,232,197,207,238,102, 83,117, 61,194, 88,115,190,221,112,225,149,223, 22,116,145, 78, 30, 30,108, 15, 0,114, 25,135,149, - 91,163,120,112,152,243, 44,153,106,231, 73, 84,101,114, 76,112,245,181,153, 61,235,157,254,246, 93,219, 4, 33,226, 82, 36,190, -219,124,233,172,194, 14,155,234, 19, 21,169,218,161,253,209,119,213, 4,191,104,221,149, 80, 16,169,171,194,220, 17,218,164, 67, -144, 42,148,224,121, 3,114,179,213, 72,204, 18,161,114,151,225,234,157,100,205,144,215,134,254,241,180,121, 38,132,144,142,205, - 84,238,115, 22, 46,245,212,104, 74,249,146,162, 60, 94, 42,191, 36, 53, 55, 83,102,213, 71,231, 82, 26,213,118,105, 38,111, 1, - 42, 74,148, 18,170,158, 53,109,156, 69,250,131,163, 8,116,202, 0, 1,133,153,123,127, 88, 89, 72,228,157,154,202, 83, 0,192, -215,193, 70,241,245,252,143,108, 62,152, 49,239,156, 41,209,196,198, 65,174, 31,132, 7,218, 35,226,202, 61,156,189,150, 28,117, -246,242,131,176,110,173,221, 17,228,103,251,126,104, 40, 89,252, 52, 17,209, 71,199,224, 81, 19, 97,229, 40,194,112, 63, 18,214, -106,192,231,213,142, 30,172, 9,223,155, 16, 31,248, 81, 16, 34, 1, 5, 1,180,233,224, 83,127,131,196,111, 42,221,179,127,161, -102,205,175,107, 22, 68, 39, 82, 22,181, 98, 48,234,160,168,168,232,142,185,185,121,239,166, 77,155,110,120,239,189,247,172, 94, -123,237, 53,247,183,222,122,139, 3,128,236,236,108,113,197,138, 21, 25,223,127,255,125,113, 94, 94,222,120,131,193,112,215,148, - 7, 94, 66,200,197,117,235,214,229,158, 63,127, 62,172,109,219,182,230,173, 90,181, 18,157,157,157,229,106,181, 90, 72, 77, 77, -213, 92,186,116, 73,136,141,141,181, 41, 42, 42,138, 5, 16,247, 52,205,247,238,238,238,224, 56,110,190,151,151,215, 23,233,233, -233,141,159, 71, 31,172,192,192, 64,119, 0,177, 30, 30, 30,129,245,109, 30,252,143, 27,182, 84,138,194,194, 66,148,166,197, 65, -157,159,135, 70, 18, 53,154,217, 59,194,202,202,234,153,204, 80,113,113, 49,164,186,108,196,223, 73, 70, 81, 86, 18, 66,125, 90, -194,194,194, 2, 58,157,238,239, 48,232,228, 69, 57, 15,106,108, 34, 12,243, 34,147,237, 20, 88, 49,110,132,159,220,207,199, 19, -250,220, 27,184, 21, 87,134,207,215,182,142,150,200,173,116, 83,198,246,106,209,173,167, 19,186,116,109, 77, 26,248,216,190,191, -120,241,170,119,195,188,201, 71, 81, 41,116,165, 41, 63, 28, 21, 71, 19, 66,252,200,154,211,215,210, 39,121, 58,105, 64, 65,113, -250,122, 38,238,198, 21,174,185,151, 64, 19,234,147,137,176, 64,210, 83, 74,184,237, 84,160, 42, 27, 43,139,210,102,157,131, 29, -123,118,108,194,245,233,214, 10,114, 41,112,254,202,109, 76, 91,184,231,178,168,160,253,111,220, 48,173,121, 16, 84,252, 15,227, -244,104,196, 32,255,167, 17,131,148, 82, 10,145, 71, 93,243, 77, 74, 56,146, 85,158,125,221, 85, 97, 21, 10, 67,254, 41,100,103, -151, 33, 42,222,128,255, 99,239,186,227,163, 40, 30,239,155,221,171, 73, 46,189,222, 37, 33, 64,168, 9, 37,141, 14,210,171, 20, - 81, 16, 16, 65, 80, 80, 64, 80, 65,165,137,244,162, 8, 34, 69,154, 10, 88, 64, 58,130,244, 18, 58,132, 4, 66, 73, 32,148, 64, -218,165,247,114,125,119,126,127, 36,151,111, 8, 41,151,128,141,223,190,207,231, 62,119, 91,238,237,204,206,236,206,155, 55,173, - 0,222,200, 78, 76, 4,165, 92,252,220,185,187,106,253,132,184,184,184,184,213,111,212,184,193,154,205,187, 97,208,229,226, 81, -212, 22, 20,228,165, 96,209,210, 63, 26,120,121,121,117, 78, 76, 76, 60,107,177, 88, 3,105,124,234,244,118, 55, 80,128, 21,201, -240,231,166,157,200, 16, 89,193,197, 94, 2, 94,155,134,241,227, 70,218,247,123,117,164, 61, 0,196, 63,140, 68, 29, 39,203,116, -181, 33, 7,175,191, 57,166,137, 3,184, 34,252,188, 63, 82,203, 16,244,249,249,143, 59, 15,187, 6, 59,200,223,236,233,227,184, - 96, 99,206, 27, 0,182,215,234,161,228,185,167, 70, 17,214,102,244,224, 46, 74, 57,191,250,228,225,246,147,233,138,161,253,130, -172, 36, 34, 66,168, 54, 9, 60,145,144,239,214,253,148, 47, 37,216, 36, 20,157, 2, 4, 88,134,162,162,162, 8, 66, 72,139,207, - 62,251,108,196,172, 89,179, 94,177,177,177,169, 15, 0,133,133,133,177, 70,163,241, 28,128,237,148, 82,174, 6, 5, 47, 5,240, -128, 16, 18,251,240,225, 67,247,159,127,254,217, 1,128,188,228,176, 22, 64, 14,128,212,154,112,150,135, 89, 76,169, 84,170, 47, - 95,212,125, 48,139, 41, 79, 79,207,134,181,249, 63,203,178, 28,195, 20,175,236, 35,147,201,112,254,252,121,244,237,216, 9,145, - 39,227,208,212,221, 27, 93, 71,190,131,253,103,206,128,101, 89,243,249, 53, 42, 71, 68, 34, 17, 46, 92,184,128, 33,253,187, 96, -255,254,253,240, 13, 9,192,228,201,147,113,244,232, 81,136, 68,194,106,122,127,137,192, 2,197,130, 19,191, 47,145,128, 55, 98, -247,111, 95,227,196,181, 34,253,189, 36,204,110,146,136, 85,187,145,207,167,101,236,249,224,207,208, 71,203,199,142,233,111,221, -173,115, 79,116,123,165,171,168, 89, 64,231, 57, 0,190, 43,227,170, 52,175,106,174, 12,206,136,133,155,246,220,125,255,247,195, - 49, 4,166,124, 12, 27,216,138,114, 70, 44,172,198,169,121,134,211,222, 90,241,251,133,243,151, 29,193, 21, 32,229,241, 25,185, -135,123,125,128, 26,113,255,126, 12,214,254,180,159, 15,189,124,239, 23, 61,139, 41, 15,163,104,161,165,156,197,138,202, 4,123, -133,244,153, 17,131, 14, 86,226,166,189,218,217, 28,161,148, 82, 91,107,113,211,138,230,198, 42,207,169, 53,242,155,126,217,182, -249,155,119,223,125,207, 38, 83,151,132,152,132, 59,208,178,158, 96,173, 27,224, 78,248, 49,141,198,200, 87, 59,117, 68, 85,247, - 51, 35, 35, 35, 45, 34, 60, 11,191,111, 93, 10,163, 81,135,180,228, 98,141,154,156,154, 7, 59, 59,207,203, 53,225, 52,152,248, -220,215, 7,143,151, 88,201, 97, 53,242,205, 87,165, 15,213, 58, 4, 53,177, 45,206, 22,134, 12,220, 13, 61,143,174,110,197,157, - 33, 31,222,101, 81,167,173,202,162,112,218,218, 74,166,244,237,228,137,216,184, 20,156,143, 72,218,246, 40,137,170,125, 61,201, -182,135,241, 57, 31, 12,234, 90, 7,223,254, 18, 53,185, 50,129, 85, 25,103,201,104,193,142,160, 70, 80,147, 22, 20,232,216,188, - 62,105,102,201,200,193,138, 56, 69, 12,222, 90,249,251,147, 47,118,135,166, 15,250,252,189, 78,118, 29,218,245,149,130, 55,210, -252, 34,157, 49, 42,150,230, 61, 79, 26, 61,135, 59, 41,112, 10,156,255, 73,206, 18,177,243, 75,201,231, 69,114,170, 81,110, 94, -166,231,141,123,217,230, 64,181, 90,205,170, 84, 42,174,186, 78,238, 22,112, 94, 45, 43,180, 74,220,171, 42, 93,172, 10, 56,213, -109,218,180,113, 26, 48, 96, 0, 76, 38, 19, 30, 60,120,128,184,184, 56, 12, 24, 59, 6,142,142,142,184, 26, 21,133, 7, 15, 30, -224,203, 47,191,132,201,100, 66, 88, 88, 88, 98,117,156, 98,177,216, 16, 16, 16, 32,121,237,181,215, 96, 50,153,240,232,209, 35, - 60,121,242, 4,147, 39, 79,134,189,189, 61,162,162,162,240,232,209, 35,124,249,229,151,208,233,116,136,141,141, 53,252, 29,121, -233,255,143,192, 34,224,192, 27,145,123,109, 46, 54, 28,130,193, 96, 66,211, 59, 9,244,113,153, 51,214,183,244, 34, 7,111,222, -185, 27, 27,113,181,155, 20,121,183, 0,160, 70, 53,135,152, 4,154,220,170,137, 40, 31,166,124, 59,164, 31,193,227,164,252,130, -152, 4,154, 92, 11,247,130,128, 43, 2,114,195,177,255, 80, 40,100,242, 27,184,118,253, 46,119, 41, 34,230,119,134, 98, 97,212, - 99,122,191,230,156, 20,138,224, 85,120,103,224,195,226, 17,131,212, 8,202,155, 96,223, 97, 59,198, 12,108, 95,167, 85, 83,135, - 58,224,141,160,212, 8,199,238,103,128, 47,228, 85,242,133,221,214,109,238, 20, 40,127, 35, 63, 47,163, 77,207,174, 93,108, 92, - 27,191,137,220,251, 81,184,115,253,132, 38,252, 86,204,229,176,219,186,205,207,147,144,158,158,158,175,116,239,222, 4,195,222, -153, 9,131, 46, 7,143,238,252,132,252,188, 20,156,191,168,192,221,248,188,118, 0, 44,118,176, 46,221, 54, 54, 3,128,142, 45, - 36,241,118, 82,189,199,168, 33,253, 33, 19,105,193, 27,243, 65, 12, 25,120,152,101,200,125, 99,110, 34, 7, 0,214,114, 34,178, - 17,229,218, 89,194,235,239,235,220,200, 90, 98,196,207, 7,238,128, 39,197,203, 44,241, 4,235,127, 62,248,240,131,133, 31, 6, -193,223,215, 49,192,220, 0,111,113, 58, 1,147,194,255,152,223, 84,123,103, 14, 40,111,196,133,229,142, 77, 59,125,150, 61, 9, -181,156, 97,253,214, 67,154, 4,224, 3, 63, 31,178,241,163,197, 71,231,132, 52,143,234, 56,237,131, 65,118, 32,194,194,232, 2, - 4, 8,248, 71,156,192,247,167, 79,159,190,145,101, 89, 87, 0,132, 82, 10,157, 78, 39,250,225,135, 31,196, 38,147,137, 97, 89, -150,147,203,229,166,136,136, 8, 35,207,243,233, 6,131,225,253,234, 56,245,122,253,195,181,107,215, 54, 48, 26,141,165, 35, 14, -117, 58, 29,126,249,229, 23,232,116, 58,200,100, 50, 40, 20, 10, 60,122,244, 8,132, 16, 3,199,113, 15,133,148,120,145, 2, 11, -152,223,225,245,185,115, 65, 65, 64, 48,175,156,184, 2, 0,220, 76,164,234,102,222,228,147,102,129,157,231,150,136,178,249, 53, - 13,128,150,227,134,180, 10,110,188, 3, 0,116, 60,247,118,109, 34,145,167,213,188, 25,216,186,221,239, 60,165, 34, 19, 71,127, - 96, 24,236,209, 2,209, 15, 99,171, 31, 57, 87, 25,212,201, 57, 17,125, 59,218, 83,243, 18, 56,165,205,130, 37,211, 49, 80, 74, -255,183, 12,221, 23,114,100,100,234,170,237, 77,125,254,134,182, 87,235,230,178,113,199,206, 94, 31,207,241,212,131,101, 72,138, -214,200,111,122, 94,113, 5, 0,137,137,137,103,253,125,201,241,155, 29,221,123,185,148, 76,179,154,145, 3,100,228,226,120, 98, - 98,254,217,218,112,102,107,140,131,102, 45, 63,240,135, 84,196,138, 0, 10,158, 47,142,175,214,192,101,153, 69, 88,203, 70, 68, -245,217, 15,166, 29, 44, 75,226,170,227,187,122, 43,249,219, 97,159,157,252,244,206,131,236, 31, 30, 39, 22,215,124, 30, 39,210, -219, 13, 61,201,156,135, 9,249,159,222,126,144,253, 77, 77,251, 77, 16, 96, 93,171,129,115,159,217,247,188,247, 51, 58,142, 70, - 2, 24,220,172, 30,233, 57,108,194,154,105,132, 64, 88, 38, 66,128,128,255, 71, 48,187, 88, 12,195, 44,120, 81,156,102, 23, 11, -192,131, 26,252,231, 42,128, 22, 47, 50,110, 17, 17, 17,153, 0, 50,133, 84,254,107, 65,254,202,105,124, 4,219,188,148,147,121, - 78, 58,190, 38,225,108,212,168, 17,125,240,224,129, 69,157, 5,133, 52, 18, 56, 5, 78,129, 83,120, 39,191,144,119,242,243,118, -206,166,255,223,211,232,101,131,208,236,241,247,128,255, 59, 47,118,255,254,125, 34,220,114, 1, 2, 4, 8,248, 91,223,201,194, -164,195, 2,158, 2, 35,220, 2, 1, 2, 4, 8, 16, 32, 64,128,128, 23, 11, 2,160,121,133, 82,188, 6,214, 31, 33,164,121,141, -165,126, 53,252, 2,167,192, 41,112, 10,156, 2,167,192, 41,112,190,124,156,213,113,191, 44, 77,143, 66, 31, 44,129, 83,224, 20, - 56, 5, 78,129, 83,224, 20, 56,255,113,206,151, 13, 66, 19,161, 0, 1, 2, 4, 8, 16, 32, 64,128, 32,176, 4, 8, 16, 32, 64, -128, 0, 1, 2, 4,129, 37, 64,128, 0, 1, 2, 4, 8, 16, 32, 8, 44, 1, 2, 4, 8, 16, 32, 64,128, 0, 1,130,192, 18, 32, - 64,128, 0, 1, 2, 4, 8,248,215,224, 47, 29, 69, 40, 64,128, 0, 1, 2, 4, 8, 16,240,255, 17, 12, 0, 16, 66,104,201,167, -179,112, 75, 4, 8, 16, 32, 64,128, 0, 1,127, 55, 94, 54, 45, 82,186, 84, 14,165,148, 16, 66, 40,158,127, 61, 37, 1, 2, 4, - 8, 16, 32, 64,128,128, 26,227,101,210, 34, 76, 89,229, 8,160,139,144,188, 2, 4, 8, 16, 32, 64,128,128,127, 2, 47,147, 22, -121,202,193, 18,146, 86,128, 0, 1, 2, 4, 8, 16,240, 79,225,101,210, 34,194, 40, 66, 1, 2, 4, 8, 16, 32, 64,128,128, 23, - 12, 97, 20,161, 0, 1, 2, 4, 8, 16, 32, 64,192, 11,134,224, 96, 9, 16, 32, 64,128, 0, 1, 2, 4,252,151, 4, 22, 33,164, -185,192, 41,112, 10,156, 2,167,192, 41,112, 10,156, 2,167, 32,176, 4, 8, 16, 32, 64,128, 0, 1, 2, 4, 8, 2, 75,128, 0, - 1, 2, 4, 8, 16, 32, 64, 16, 88, 2, 4, 8, 16, 32, 64,128, 0, 1,130,192, 18, 32, 64,128, 0, 1, 2, 4, 8, 16, 32, 8, - 44, 1, 2, 4, 8, 16, 32, 64,128,128,127, 8, 4, 64,133, 35, 1, 40,165,183, 45, 38,169,197,104,130,234,248, 5, 78,129, 83, -224, 20, 56, 5, 78,129, 83,224,124,249, 56,171,227,174,137,254,248, 87, 11,172,191,114,162, 81, 66, 72,243, 23,125,163, 4, 78, -129, 83,224, 20, 56, 5, 78,129, 83,224,124,249, 56, 95, 54, 8, 77,132, 2, 4, 8, 16, 32, 64,128, 0, 1, 47, 24,162,127,234, -194,132, 16,166,140,192,227, 1, 80,250,156,118,218, 95,193, 41, 64,128,128, 23,131, 87, 2,201,116,169, 68, 60, 86,107, 48,126, -117,225, 6,253,169, 75, 48,113, 54,241, 88, 38,151,136, 58,233,244,166,175,207, 71,210, 31,106,248,188, 63,181, 40,172,240,172, - 63, 63,122,245,234, 53, 30,192, 92, 74, 41,229,121,126,246,169, 83,167,182,189,136,119,189,135,135,199,112, 0,214, 0,192, 48, - 76,110, 82, 82,210, 46, 75,254,219,165, 75, 23, 81, 65, 65,193, 19, 0,158, 37,187,238, 71, 68, 68, 52,174,238,152,128,154, 35, - 60, 60,156,250,248,248,160, 69,139, 22,247, 82, 82, 82,214, 80, 74,215, 11,119,229, 95, 36,176,154,184, 89,181,173,235,237,250, -234,145,240,184,217,213, 61,112,158,158,158,203, 92, 93, 93, 39, 20, 21, 21,105, 1, 80,134, 97,168,159,159, 31, 8, 33, 48,191, - 55, 57,142, 75,191,123,247,110,115, 75, 31,226, 23,197,217,184,113,227,112,134, 97,188,202,190,191,171,251,205,243,124, 98, 84, - 84, 84, 72,117,225, 84, 42,149,189, 25,134,153, 81,221,121, 60,207, 47, 75, 78, 78, 62, 86,213, 57, 45, 90,180,184,110, 99, 99, -227,206, 48, 76,165,171,143,151, 45,115, 76, 38, 19, 45, 42, 42, 74,189,115,231, 78, 80, 77,211,214,211,211,115, 54,165, 52, 8, -192,214,228,228,228,195,148, 82,238,121,242,138,167,167,231, 27,148,210, 47, 74,238,225,162,164,164,164, 61, 53,249,127,163, 70, -141,194, 37, 18,137, 23,203,178,164,124,154, 84,180,205,243, 60,213,235,245,137,247,238,221, 11, 17, 30,251,191, 31,237, 3, 73, -219, 38,245,148, 95,126,248, 86, 87,124,186,236,247, 15, 59,182, 32, 25, 86, 54,146,245,111,116,108,224,224,239,235,128, 5, 27, - 47, 79, 1, 96,177,192, 34,132, 16,111,111,239, 64,119,119,247,122, 26,141,134, 3,128,102,205,154, 81,150,101,159, 58,207, 96, - 48, 24,238,222,189,123, 88, 72, 1, 11, 11, 4,145,232,203,131, 7, 15, 42,121,158, 71,191,126,253,230, 1,216,246, 2,104,137, - 76, 38,179,122,252,248, 49,140, 70, 35,227,227,227,163,168, 97, 25,229, 18, 17, 17, 1,131,193,160,111,215,174,157, 79,217, 99, - 82,169,212,229,210,165, 75, 0,160, 15, 14, 14,246,169,109, 0,253,253,253,109,108,172,172,166,178,132,244,224, 40,109, 10, 0, - 44, 33,119, 57, 74, 79, 22,106, 52, 43,163,162,162, 10, 95,246,180, 63,113,226, 4,198,143, 31,143, 91,183,110, 53, 57,124,248, -240,247, 42,149,106, 82,114,114,114, 87, 74,105,186,240,100,252,195, 2,171,161, 82,209,196,195,197,249,208, 87,139,231, 3,192, -236,170,132,144, 82,169,252,170, 83,167, 78, 99,127,253,245, 87,155,125,251,246,217,212,171, 87, 15, 18,137, 4, 44,203,130,101, - 89, 48, 12, 3,150,101, 49,104,208, 32, 98,169,184, 42,203,121,234,212, 41,155,198,141, 27,151, 22,178,148,210, 82,145,213,175, - 95,191,106, 57, 25,134,241,186,126,253,186,155, 92, 46, 47,253, 63,207,243, 79,125, 40,165,165, 31,142,227,208,169, 83, 39,139, -238, 19,195, 48, 51,162,163,163, 95, 41, 44, 44,124,138,195,124, 13,243,239, 87, 94,121, 5, 0,142, 85,195,165,186,120,254,148, - 27, 49,196, 2,166, 44, 80,214, 9,144,214, 7, 24, 89,133,231,103,101,101,161,107,215,174,108,109,210,215,213,213,117, 84,104, -104,104,195,199,143, 31,191,182,100,201,146, 76,149, 74,245, 61,128, 31,213,106,117, 66,109,248, 40,165,139, 98, 99, 99, 27, 81, - 74,225,235,235,187, 16, 64,141, 4, 22,203,178, 94, 39, 78,156,112,147, 74,165,165,233, 92,217, 55,199,113, 48, 24, 12,232,211, -167,143, 73,120,228,255,161, 23, 13,193,194, 97, 3,123, 66, 99,100, 96, 52,154, 92,149,174,182,191, 76, 25,213, 89, 12,170,199, -182, 63,174,195,104,226,127,170,169,184,234,219,183,175,207,250,245,235, 69,209,209,209, 34, 63, 63, 63,112, 28, 87,250,225,121, -190, 70,207,165,128, 82,129, 69, 24,134, 65, 82, 82, 18, 20, 10,133,125,215,174, 93,213, 28,199,205, 58,119,238,220,182, 23,125, -173,242,206, 22, 33,164, 80,173, 86,111,255,187,227, 28, 24, 24,216,201,206,218,250,247,249,115, 63,113,107,218,172, 57,227,236, -234,140,135, 15, 19, 33, 21,209, 14, 15,239,221,111,179,112,233,119, 31, 4, 6, 6, 14,187,113,227,198,249,151, 45,189,125, 94, -255,225,123,222,100,152, 80,188,229, 0, 96, 19,242,243,243,241,222,123,239,225,192,129, 3,126,109,219,182, 93, 6, 96,172,240, -100,252,131, 2,171,129,167,149,167,173,204,230,248,198, 13,107,136, 49, 63,213,177,154, 7,106, 81,167, 78,157,222,254,245,215, - 95, 29, 9, 33, 56, 53,249, 93, 56, 24,180, 80,125,249, 53, 28, 93, 92,161,159, 49, 30,182,156, 9, 45, 78, 71,214,228, 33,125, -138,243,222,189,123,200,202,202,130,171,171, 43,172,173,173, 33,147,201, 32,145, 72, 32,149, 74, 45,229,132, 92, 46,199,137, 19, - 39, 32, 18,137, 74, 63, 44,203, 86,184,237,238,238,110,241,189,226,121,126, 89,211,166, 77, 91,198,196,196,216,101,103,103,163, - 93,187,118,121,132,144,155,101,132, 71,203,155, 55,111,218, 89,252,146, 50,196,162, 32,126, 3,104,246, 30,192,225,117,112,118, -195,160, 69,253,167, 10, 25,179, 40,228,184,218,155, 78,233,233,233,134,115,231,206, 33, 48, 48, 16,191,255,254,187,115,118,118, -246,151, 91,183,110,253, 66,165, 82,205, 86,171,213,203,106, 65,233, 4, 0,247,238,221, 3, 0,199,218,132, 73, 42,149,226,202, -149, 43,160,148,150,138,114,134, 97,192, 48, 12, 14, 62,112, 65,161,158, 65, 81,234,109, 76, 25,224,131,122,245,234, 61,227,106, - 9,248,123,208, 41,128,244, 11, 9,108,222,214,199,187, 14, 66, 47,133, 65, 34, 21, 59, 76, 28,221, 31,182, 10, 17,150,255,248, - 39, 31,159,152,245,225,249, 72,186,205,194,103,147, 40,149,202,150,189,122,245,242, 94,191,126,189, 4, 0,110,223,190,141,228, -228,100,184,185,185, 65, 46,151, 67, 44, 22,131,101, 89, 72, 36, 18,225,230,215, 0,193,193,193,205,122,247,238,109,195,113, 28, -138,138,138,176, 97,195, 6,123,185, 92,110,223,191,127,127,139,157,172,138,154,237, 0, 52,213,233,116, 26,165, 82,105, 13,128, -103, 24,166,160,188,179, 5, 0, 74,165,210,166, 2, 74, 19,128,140,224,224, 96, 79, 0,210, 18,190,210, 99,122,189,190,178, 99, -150,198,185, 67, 72,160,223,225,133,139,230,218,164,164,222,135,189, 93, 10,120, 99, 26,190,255,254,123, 88, 89,217, 97,222,188, - 89,162,253, 33,193, 30, 31,127, 50,243, 80,171, 86,173,250, 92,187,118,237,242,203,148,230,188,201, 48, 33, 32,164,125,233,246, -182, 19,171,161,179, 15, 66,210,188,121, 88,181,106, 21, 26, 53,106,212, 90,120, 50,254, 65,129,213,188,142,189,131,140,136,143, -255,176,126,165, 20,134, 66,199,123,215, 46,162, 89,223,247,205, 98,225,118,217, 23, 35, 0,198,221,221,125,226,246,237,219,237, -204,133, 93, 99,194,193, 1, 6,212,245,247,135,181,189, 3, 82, 77, 6, 80,163, 1, 82,137,164,194, 2,209, 18, 78,134, 97, 32, - 22,139,159,250, 72,165, 82,148,117, 59, 42,227, 44, 87,155, 3,203,178, 56,113,226, 4,140, 70, 35,134, 12, 25, 82,161,216,170, -196,161,169,144, 51, 57, 57,249,152,167,167,231, 77, 74,233, 43, 60,207,131, 16,114, 51, 41, 41,169,179,249,184, 82,169,236, 29, - 16, 16, 48,131,231,249,101,213,113, 82, 74, 1, 83, 38,104,214,118,216,182,203, 64,222,101, 23, 16,155, 30,224,224,131,219, 15, - 82,112, 42,252, 9, 50,178, 10, 16,220,216, 13,189,218,249,130,231,121,139,195, 89, 22, 42,149,170,145,191,191,127, 83,163,209, -136,115,231,206,129,227, 56,180,104,209, 2, 99,198,140, 97, 86,175, 94, 61, 6,192,178,154,114, 2,136,140,136,136,232,145,146, -146, 2, 0,183, 44,112,188,110, 87, 36,132,127,254,249,103,104,181,218,103,206,119,236,188, 4,159,190,238,131, 49,147,183,225, -235,152, 93, 88,183,110, 29,202,119,209,249, 43, 70,192, 8,156, 21,169, 34,140, 25, 58,248, 53,176, 18, 27,220,123,152,136,206, -109,131,224,230,230,134,155,209, 15, 17,159,148,149, 74, 8,222,233,211, 65,182, 76,163,209,127,113,238, 6,253,177, 58, 78,165, - 82, 89,127,211,166, 77,226,178,251, 36, 18, 73,169, 11, 94,214, 13, 47,223,100, 40,164, 81,197,156,193,193,193,205,122,246,236, -121,126,238,220,185,182,241,241,241,184,120,241, 34,124,124,124,160,209,104, 80, 93,215,182,114,156,207, 52,219, 81, 74,121, 0, -191,213, 38,156,161,161,161, 38, 0, 94, 21,157, 83,213, 49, 75,226,222,162, 69, 11,107,107,185,124,231,130,133,115,108, 34, 34, - 14,163,125,135, 62,176,178,109, 8,147, 33, 17,153, 89, 5,200,126,160,198,210,165, 43,241,197, 23, 51,177,100,241, 66,219,225, - 35,199,252,222,174, 93,187, 70,151, 47, 95,214,190, 44,233,206,136, 36,235, 35,195, 47, 77, 0,128,188,232,189,248,104, 68,123, -228,231, 63,192, 7, 31,204, 65, 82, 82, 18,238,223,191, 31,241,119,134,243,165, 21, 88,132, 16, 74, 41,173, 81, 21,223,203,139, -200,109, 57,171, 67,223,127,187,204,222, 86, 97,237, 26,126,124, 63,226,226, 82,170,252, 79, 81, 81,145,254,192,129, 3, 56, 62, -105, 44, 26, 17, 19, 28,191, 92, 14, 55,149, 10,185, 99, 7,161,192,104, 64,131, 35, 97,144, 41, 20,144,218, 40, 44,118, 28,138, -138,138,244,103,206,156,193,157, 59,119, 32, 18,137,160, 80, 40, 96, 99, 99, 3,153, 76, 86, 42,172,204, 47, 96, 75, 57, 41,165, - 16,137, 68,184,125,251, 54,226,226,226,224,224,224,128,139, 23, 47,162, 71,143, 30, 79,137, 43,150,101,159,234,227, 85,131, 12, - 95,161,163, 84,210,239,234,152,197, 68, 98, 23,192,233,109,228, 95, 81, 1,142, 35, 97,164,246,224, 41,143, 27, 15, 50,241,254, -200, 87, 1, 0, 19,191,216,128, 30,109,234,149, 54, 65,214, 4,158,158,158,239,183,108,217,114,229,132, 9, 19, 24, 27, 27, 27, -232,116, 58,232,116, 58,220,187,119, 15,206,206,206,176,182,182,150,212,242,129,127,172, 82,169, 32,151,203, 65, 41,125, 92, 27, - 14, 66, 8,118,238,220, 89,225,177,119, 86, 70, 65, 84,220, 61, 11,235,215,175,135,201,100, 66, 77,243,183,128, 23,245,118,135, -167,187,135, 23, 24,106,132, 58, 53, 3,131,250,245,130, 72,162,192,147,196, 12, 4,248,251, 42,223, 26,208, 65,201, 18, 19, 62, -255,106,251, 68, 0, 63, 90,240,188,115,209,209,209,226,200,200, 72,176, 44, 11, 59, 59, 59, 88, 91, 91, 67, 34,145, 64, 38,147, -149, 10, 43,193,193,170, 26,189,123,247,254,144,231,249, 89, 60,207,103,247,236,217, 83, 53,127,254,124,251,196,196, 68,220,190, -125, 27,219,183,111,207,160,148,154, 74, 58,187,207,123,222,107, 89,224,108,129, 16, 82,227,126, 78,254,254,254, 18,147, 33,231, - 35,123, 43,110,160,136,177,243, 49,229, 21, 60,206, 51, 50, 7, 98, 18,213,171, 41,165, 85,118, 9,144,137,197, 31,174, 90, 62, -203,221,197,217,128,222,189, 7,226,209,227,108,204,156, 57, 4,121,121, 90,252,250,243, 10, 0, 82, 24, 76, 44,130, 90,247,129, - 82,233,141,142,237, 59, 42,207, 93, 56, 55, 17,192,138,151, 37, 15,196,237,125,111, 34, 33,100, 97,157, 58,117,206,110, 88,186, -180, 97,247,238,221, 1, 0,167, 78,157,194, 79, 35, 70, 96, 30, 48,106, 53, 33,201, 83, 40,157,249,119,133,169, 54, 90,228, 95, - 45,176,204, 17,170, 73,196, 8, 33,164,129,187,237,174,249,179, 62,172, 87,167,190,175,199,213, 63,119, 34, 54, 54, 9,169,169, -217,149, 21,168,148, 16,194, 19, 66,248,250,245,235,195,206,168,133, 61,213,195, 77,169,130,173,147, 51,178,141, 37,206,149,141, - 13,164, 54, 10,139, 94,142,101, 57,253,253,253,145,154,154, 10,137, 68, 2,133, 66, 1, 91, 91,219, 82,129,101, 22, 87,150,190, -112, 9, 33,224,121, 30, 34,145, 8, 55,111,222, 68,199,142, 29,225,237,237,141,223,127,255, 29,189,123,247,126,198,197,170, 77, -211,147,185,207, 85, 89,231,138, 97,152, 25,150,116,110,127, 10,210, 6, 48,217,190, 9,198,186, 59, 12,212, 14, 58,170, 44,105, - 18,164,248, 51, 44, 21, 49,113, 25, 79, 53, 23, 90, 46,158,189, 84,114,185,124,219,194,133, 11,187,133,132,132,192, 96, 48, 0, - 0,172,173,173,161,211,233, 32, 22,139, 97, 48, 24,160,209,104,146,254,137,140,107,190,231,199,143, 31, 7, 33,164, 84,232,154, -155, 10, 11,147, 19, 48,102,202,175,144,138,128,155, 55,111,162,105,211,166, 66,137,250, 15,193, 74, 46,119,150,202,237,193,155, -180, 16,137,197,168,227, 93, 23, 60,167, 67,118, 94, 17,222,121,115, 0,174,223,138,194,225, 51, 87, 77, 70, 35,191,218, 82,206, -198,141, 27, 35, 45, 45, 13, 44,203,194,214,214, 22, 54, 54, 54,104,210,164, 9, 18, 18, 18,158,114,177, 4, 84, 14,134, 97,102, - 31, 62,124,216,157,101, 89, 15,147,201,132,132,132, 4,220,188,121, 19,107,214,172, 73, 45, 44, 44,236, 18, 17, 17, 17, 83, 11, -218,202,154,237,158,233,172, 94, 27,103,171, 92,229,175, 97, 29,119,249,201,229, 95, 77,242,106, 17,208,138,200, 89, 69,110,209, -195,180,142, 97, 87, 47,119,248,226,199,221, 31,186,187,187,119, 79, 77, 77,173,180,242,198, 50, 76,143, 38,205,154, 51, 60,159, - 8, 86,210, 20,223,174,252, 20, 89,217,133, 40,200,215, 0,144, 66,111, 20, 65,167, 35,232,218,173, 59,126,223,121, 0,173, 66, - 90,177, 44,195,244,122,153, 4, 22, 0,176, 44,187,108,255,254,253, 13,229,114, 57, 22, 47, 94, 12, 91, 91, 91, 92, 89,184, 16, - 63, 73, 36,176, 2,176,222, 96,152, 1,224,111, 17, 88,181,209, 34,255, 9, 7,171,166,240,242,242, 90,209,182, 67,155, 87,234, -251,183,146, 95, 61,186, 23, 15,238,199, 33, 35, 35, 23, 20,208, 84,165, 43, 8, 33, 84, 44, 22,195,237,243, 5,168,211,162, 5, -138,198,191,129,108,163, 1,190,127, 94,129, 76,161,192,221,158, 65,160,122, 61, 58, 69,167, 90, 42, 92, 40, 33,132, 2,128,139, -139, 11, 36, 18, 9,228,114, 57,228,114,121,105,223,171,178, 31, 75,197, 16,207,243,200,203,203,195,227,199,143, 49,126,252,120, - 88, 91, 91,131, 16,130,212,212, 84,248,248,248,128,101, 89, 36, 37, 37,225,244,233,211,168, 95,191, 62,164, 82,105,141, 50, 67, -153, 78,237, 45, 61, 61, 61,207, 18, 66, 90,134,135,135,219,133,132,132,160, 70, 14, 22,145, 64, 7, 31,112,240, 2, 79,255,215, -215,202,104,122,186,242,102, 22, 89,150,192,195,195,195,175,121,243,230,151,215,172, 89,109,235,230,230, 14,158,231, 96, 52, 26, -145,155,155,135,162,162, 34,212,169, 83, 7, 54, 54, 54,116,249,242,229,132,227,184,127,108, 40,175, 89, 80,153, 29, 68,115,255, - 43,134, 97, 48,101, 96, 29,100,103,219,130,101,139,183, 45,141,187,128, 23, 15, 27, 27, 91, 39,145,196, 6, 60, 35,130,189,189, - 35, 68, 82, 27,240, 38, 17, 56, 30,176,181,119,193,165,235,247,112,249, 86,254,251,105,153,216,101,193,115, 67,155, 55,111, 78, - 89,150,133,155,155, 91,169,152, 18,139,139, 91, 12,221,221,221,145,151,151, 7,150,101, 75,247, 9,168,186, 34,249,228,201, 19, - 20, 22, 22,226,202,149, 43,216,185,115,103,122,121,113,213,171, 87,175, 9,214,214,214, 95,104,181,218,197, 71,143, 30,253,190, - 42,206,154, 54,219,213,198,249,138,136,136,104, 28, 28, 28, 44,246,114,147, 28, 62,178,119,165,151, 29,119,157,224,201, 56, 32, - 38, 47, 90, 17,230,214,190,123,235,254,196,127,193,199, 62,131,230,172, 60, 66, 8,241,171,108,196, 51, 5,154,203,173,228, 0, - 37,184,120,225,104,113,179, 96, 86, 62, 10, 10,181,208, 25, 88,232,244, 4, 90, 3, 65,247, 30,125,176,233,199, 29, 72, 78,203, - 6, 5, 90,188,108,249,160, 81,163, 70,193,158,158,158,248,248,227,143,161,221,190, 29, 5, 0,250, 3,216, 95, 82,169,182, 5, -166, 9, 79,203,223, 40,176,188,188,188, 62, 12, 8, 8,120,111,243,214, 95, 21, 95,205,249, 60, 47, 59,250, 22,171,215, 24,108, -116, 70,163,254, 97,114,230,234,170, 94,142, 77,155, 54, 45,174,117, 58, 56,194,218,206, 30,186,114,206, 21,213,235,193, 27,244, -144, 88,248,114, 52,115, 82, 74, 97,101,101, 5,169, 84, 90,161,115, 85, 19, 7, 11, 0,114,114,114,176,115,231, 78,180,110,221, - 26,214,214,214, 96, 89, 22, 45, 91,182, 68,116,116, 52,124,125,125, 1, 0,251,247,239,199,235,175,191,142, 7, 15, 30,192,207, -207,175, 38, 67,143, 75,155, 8,143, 31, 63,110, 71, 41,125,133, 82,138,244,244,218,141,134,229, 56, 14,133,133,133, 56,126,252, - 56,212,106, 53, 60, 60, 60,144,155,107, 11, 59, 21, 95, 42, 22,205, 31, 11, 95,188,159,191,251,238,187,182, 10,133, 2, 28,103, -130, 88, 44, 46, 21,174, 98,177, 4,247,238,221,195,136, 17, 35,114,159, 60,121,242, 89,109, 70,253, 16, 66,136,151,151,210, 61, - 55, 55, 27,249,121, 57, 96, 89,120, 19, 66,216,218, 76,253,192, 48, 76,233,183,249, 67, 8,129, 68,204,194,195,221,181,180,227, -123,137,123, 39, 52, 17,254,125,133,183, 13,128, 97, 0,222,238,210,218, 94,148,149,175, 1, 76,122, 60,126,242, 24, 57,133, 6, - 80,147, 17,241,137,201, 40,212,241,200,204,202, 71, 64,112,239, 53,103,206,156,153, 77, 8,153, 69, 41, 61,100, 73,158,191,118, -237, 26,206,157, 59,135, 11, 23, 46,192,220, 81, 26, 0,236,236,236,112,226,196, 9,116,237,218, 85, 72,136, 42, 96, 48, 24, 22, -247,234,213,107,150,135,135,135,124,197,138, 21,246,117,234,212, 1, 33, 36,175,188,115, 21, 18, 18, 50,123,198,140, 25,202, 33, - 67,134, 76, 1,240,125, 45, 47, 87, 85,103,245, 42,203,168,138,166, 98, 72, 75, 75,153,176,113,219, 24, 87, 27,241, 99, 53,158, -124, 91, 34,190, 88,160, 40, 15, 56,243, 43, 36,175, 44,120, 50,178,219, 68, 55,117,254,234,119, 1,108,170, 36,147,242,247, 98, -226,176,110,221, 42,124,241,197, 68,108,255,117, 21,120, 42, 65,126,161, 17,238,170, 64,232,141, 60, 8, 35, 70,187,246,157,112, -225,210, 85,128, 51, 96,202,248,203, 47,221, 92,107,247,239,223, 15,139,139,139,107, 58,103,206, 28,108,241,244,132,173,173, 45, -166,206,157,123,217,100, 50,181, 23,158,146, 23, 32,176,106, 98,201,121,121,121, 13, 86, 42,149, 95,253,250,235,175, 86,106,181, - 26,170, 70,205,236, 14,238,222,169,115, 83, 72, 52,201, 89,217,163,111, 36, 21, 84, 59,220,158, 97, 24,152, 22, 78, 69,166, 73, -143,122, 7, 47, 65,166, 80, 32,166,119, 8,168, 94,143,246, 17, 79, 32, 83, 40, 32,146, 91,213, 56, 50, 21, 57, 86,101, 63,230, -194,184, 58,232,245,122,135, 30, 61,122,160,123,247,238,120,227,141, 55, 74,155, 2, 3, 3, 3,177, 99,199, 14, 12, 30, 60, 24, -145,145,145, 80,169, 84,104,210,164, 9,154, 52,105,130, 51,103,206,212, 40,172,102, 7,171,119,239,222,121,132,144,155,148,210, -150, 97, 97, 97,118, 53,229, 48, 11,168,227,199,143,227,213, 87, 95,133,175,175, 47,174, 95,191,142, 19, 11,150, 67,164,112, 1, - 24, 55, 80,158,150, 58, 91,150,244,193,146, 72, 36, 29,235,215,175,143,148,148, 84,200,100, 50, 56, 58, 58,192,202,202, 10, 50, -153, 28, 75,151, 46,229, 55,109,218,180,150, 16,178, 64,173, 86,103,213, 66,156, 55, 8, 8, 8,248,121,244,168,145,109,156,157, - 93,224,238,174,196,140,233, 51,251,108,223,241,251, 29, 79, 79,207,225, 73, 73, 73,183, 44,229, 34,132, 64,175,215,131,101, 89, -236,143,113, 69,161,158, 32, 47, 49, 2, 31, 13,244, 41, 21, 91,230,166, 94,243,244, 23, 2,254, 30,176, 44,187,101,234,212,169, - 93,134, 14, 29, 74, 36,140, 81,127,226,216, 54, 17,199,153,200,167,179,126,224, 66,207,159,101, 56,206, 68,222, 24, 49,141, 63, -124,250, 22,243,254,148,229, 92, 96,219, 87,113,251,246,109,143,254,253,251, 47, 2, 96,145,192, 50,167,113, 37,215, 23,154, 8, -171,193,201,147, 39,215, 2, 88,219,171, 87,175, 20,107,107,107, 20, 20, 20, 60,211, 79,209,223,223,223,166, 89,179,102, 18,169, - 84,138,224,224, 96,215, 94,189,122,197, 16, 66, 86, 28, 59,118,108,115, 77,174, 85,145,179,245, 60,211, 52,216, 58,113, 3, 90, -180,106, 98,123,207,102,142,173,149, 88,123,163,110,140,220,142, 0,200,213,120, 60,186,152, 56,188,128, 73, 99, 3, 90,116,243, -135,173,216,122, 96,101, 2,139, 0, 55, 11,243,243,123, 21,105, 76, 56, 27, 26,137, 33, 67,234, 64,107, 96,160,209, 50, 48, 24, - 41, 24, 86, 2,194, 74, 48,122,236,123,208,155,120,228, 36, 39,131, 0,145, 47, 91, 62,224, 56,110,198,160, 65,131, 90, 45, 94, -188,216,111,234,212,169, 0, 0,149, 74,213, 78,165, 82, 69,253,221,243, 96,189, 76,205,131, 79, 57, 88,213, 69,172, 75,151, 46, -155,141, 70,227,107, 54, 54, 54,142,239,189,247,158, 33, 35, 35, 3,251,246,237,195, 79, 63,253, 84, 84,104,100,195,115, 50, 77, -163, 30,169, 11, 18, 45, 41, 20, 25,134,129,196,104, 4, 53,253,207,185,226,117,186, 82, 39, 75,108,101, 93,211,218, 50, 40,165, - 21,138, 42,179,147, 85,147,151,173, 76, 38,203,185,112,225,130, 91, 98, 98,226, 83, 29,218,235,213,171, 7, 0, 8, 11, 11,195, -149, 43, 87, 48,124,248,112,136, 68, 34, 72, 36, 18,220,188,121, 51,191, 38, 97, 54, 11, 30,243, 40, 66,165, 82,217,187, 77,155, - 54, 21,142, 30,180,132, 43, 62, 62, 30,190,190,190,208,233,116,112,112,112, 64,102,242, 99,196, 63,142, 69,145, 46, 6,245, 61, -228, 72, 75, 75,131, 76, 38,179,244,129,227,204, 5,151, 78,167, 67,114,114, 10, 84, 42, 21,126,249,229, 87,108,222,188,121,184, - 90,173,222, 85,211, 48, 18, 66, 68, 74,165,114, 90,255,254,253, 23,189,246,218,107,162,162,194, 2, 80,190, 88,240, 72,164, 18, -124,247,221,119, 77, 78,159, 62,125,195,211,211,115,137, 92, 46, 95,244,240,225, 67,125,117,105, 14, 0, 91,182,108, 1, 0, 88, -183,157,139, 25, 67,235,226,237,137,219,176, 98,197,222,167,226,202,178, 44,230,207,159, 47,148,168,127, 35,218,182,109, 27, 56, -107,214, 44,177,185, 79,156,170,206, 98,147,193, 96,224, 1,160,105,203, 87,254,231, 84,246, 6, 30, 60,120,128, 21, 43, 86,160, -176,176, 16, 34,145,200, 98,155,185, 71,143, 30,232,221,187,119,105, 51,161,139,139, 11, 12, 6, 3, 76, 38,147, 32,174,106,232, -100,189,250,234,171,179,120,158,167, 60,207,207, 49,239, 15, 14, 14,182,170, 83,167,206,197, 85,171, 86, 57,155, 76, 38, 76,155, - 54,205, 33, 35, 35,195, 97,210,164, 73, 51, 1,108,174,164,156,168,201,236,234, 22, 77,211, 80, 81,159, 46, 66, 72,125, 27, 27, -123,164, 35, 5, 57, 46,198,192, 28,103, 83,214,241,228,247,111,122, 39, 4, 52,181,226,140,190, 76,158, 30,246, 86,118, 0, 79, - 27, 85,250,158,227,249,227,209,119,162,186,123,121,250,178, 7, 14,134,226,213, 1,131,161,213, 19,104, 13, 12, 8, 43, 6, 97, - 37,104,213,166, 61,234,249, 54, 6,207, 3, 81,145, 17, 6, 35,207, 31,121,153,210,222,231,245, 31,190,247, 26,176,110, 2, 0, - 76,251,238, 20,102, 47,252, 22, 35,223,232,141, 49, 99,198,252, 99,243, 96,189,180,125,176,170, 16, 87,239, 56, 58, 58,142, 24, - 59,118,172, 85, 88, 88, 24, 22, 46, 92, 40, 58,113,226,132,225,218,181,107, 38,142,227,166, 37, 37, 37,109,172,201, 69, 25,134, - 65,253, 95,255,132,202,195, 3,247,251,180,122,202,185, 58,219,210, 11,188, 78,135,158,177,185, 53,142,140,185, 41,203, 44,172, -204,226,170,178,169, 20,170,169,129, 87, 56,239,213, 7, 31,124,128,205,155, 55,163,125,251,246,104,216,176, 33, 68, 34, 81,105, -179, 84,109, 28, 44, 51,106, 60,122,176, 92,109,190, 78,157, 58,184,117,235, 22,236,237,237,241,243,207, 63,195,219,203, 19,163, -122,213,131, 94,175,135,209,104, 68, 97, 97,161,217,193,170, 54,160, 60,207,223,217,183,111,159,239,208,161, 67,169, 72, 36, 34, - 58,157, 14, 0,176,122,245,234, 52,181, 90,189,167,166,225,243,244,244,124,163,126,253,250, 63, 14, 31, 62,220,182, 73,147, 38, - 72, 77, 77,197,213,171,151, 49,115,230,140,171, 98,177, 72,219,167,111,191, 46,126,126,205, 48,113,226, 68, 38, 48, 48,240,139, -153, 51,103, 78,243,246,246, 30,147,144,144,176,179, 58,145,181, 99,199, 14, 0,192,187,223,221,133, 94,111, 4, 80, 60,106,208, -195,195,227,169,115, 31, 62,124, 40,140, 34,252, 27, 97, 50,153, 40,195, 48, 36, 33, 33,193, 96,109,109, 77,156,156,156, 68, 50, -153, 12, 58,157,174, 84,104, 61,120,240, 0,135, 14, 29, 66, 98, 98, 34,156,156,156, 24,123,123,123,152, 76,166,108, 75,243,124, -217,209,130,102, 65, 37,136,171,154, 35, 52, 52,116, 45,128,181,101,132,235,120, 66,200,116,133, 66, 97,183,121,243,102, 7, 59, - 59, 59,114,232,208, 33,253,134, 13, 27, 10, 88,150,205, 6,176,188,170, 50,229, 69,205,174, 94,153,243, 5, 0,156, 9,247,179, - 11, 98,125,196, 10, 37, 31,169, 37,151, 62, 78,152,209, 52,155,105,228, 78,154, 53, 51, 13, 73,187,115,113,148,241, 81,251,244, -212, 52,194, 81,122,183, 50,238,236,220,220,239,127,220,250,251, 71,251,246,108,171, 35,183,179,198,200,183, 63,196,241,147,231, - 33,149, 89,227,106,248, 13,232, 13, 28,158,196, 39, 97,248, 91, 35,161,116,115, 6, 91,164, 78,214,233,245, 27, 95,166,180,127, -106, 30,172,144,246,184,184,119, 57,118,196,212, 65,210,194,133,255,232, 60, 88, 47,157,131, 85, 25,218,180,105, 99,171,211,233, -190,251,228,147, 79,172, 10, 11, 11,145,145,145,129,204,204, 76, 92,189,122,245,132,209,104,252,168,170, 81, 26, 21,173,182,109, - 30,241,229,228,234, 6,153,194, 22, 84,175, 47,117,174, 36,214, 54,224,117, 58,240, 6, 61, 80, 73,115, 78,101,156,132,144,103, - 92, 43, 75,197, 85,121, 78,179, 35, 86,209,164,162,222,222,222, 88,178,100,201, 51,211, 52, 88, 18,206,146, 90, 90,111, 66, 72, - 75,179,243, 68, 41,109,169, 84, 42,123, 91, 50,114,176, 50, 78,158,231,209,185,115,103,156, 56,113, 2,183,110,221, 2,195, 48, -232,219,183, 47, 8, 33,176,183,183,135, 72, 36, 42, 21,115,230, 1, 1, 85,113,114, 28,247,246, 79, 63,253,244,233,145, 35, 71, - 62,159, 60,121,178,213, 43,175,188, 98,238,231,149, 94, 50,242,167, 70,225,228,121,126,222,205,155, 55,109, 77, 38, 19, 22, 47, - 94,140,240,240,240,194,135, 15, 31,126,146,156,156,252, 35,165,148, 42,149,202,145,143, 30, 61, 94,247,229,151, 95,218,118,235, -214, 13, 97, 97, 97,114,111,111,239, 47, 1,236,172, 46,238, 87,175, 94, 5,203,178, 48,101,197, 97,226,140,223,161,176, 22,227, -222,189,123,200,204,204, 44,205,107,149, 53, 37,253,127, 94,181,254,175,230,188,118,237,218,238,181,107,215,126, 48,122,244,104, - 9,165,148,139,139,139, 51, 2, 32, 30, 30, 30,236,181,107,215,248, 63,254,248, 3, 26,141, 6, 94, 94, 94,140,167,167, 39, 57, -113,226, 4, 31, 29, 29,125,149, 82, 58,203,210,112,150, 21, 87, 98,177, 24, 26,141,198, 34,113, 37,164, 81,181,156,115,247,238, -221,171,212,106,181,144, 74,165,216,181,107,151, 97,219,182,109, 81,121,121,121,157, 34, 34, 34, 52,181,225,172,233, 52, 13,213, -113,230,103, 51,135, 78, 28,143,106,105,236,250, 3,153,156,146,217,177,180, 96, 38,196,101,151,123,115, 23,121,235,128, 36,197, -185,111,152, 2, 90,244, 71,101,156, 15, 31, 62,212, 7, 5, 5,189, 62,245,211, 57,103, 22,206,155,107,187,236,235,175,112,251, -213, 33,200,201, 45,130, 78,207,193, 96,226, 49,111,222, 2,184, 57, 57,192, 81, 98, 40,200,209,144,215,163,162,162, 12, 47, 83, -186, 63,207, 60, 88,127, 69, 56, 95, 54, 84,171, 62,138,138,138, 22, 54,110,220, 88, 26, 29, 29,141,135, 15, 31, 34, 38, 38, 6, - 28,199, 61, 72, 76, 76,236, 95,219,139, 50, 12, 3,123,123,123, 72,165, 82,180,187,149, 4,169, 68, 2,169, 77,113, 31,241,158, -177,185, 0,165, 96,164,178, 26,115,150,159,243,234,121, 70, 17,113, 28, 87, 58, 67,187, 89,192, 85, 52, 90,173,166,206, 21,195, - 48, 51, 46, 95,190,108, 23, 23, 23, 7, 74, 41,246,238,221,107,247,198, 27,111,204,168,141,123, 69, 41, 69,102,102, 38,120,158, -135, 88, 44, 70,183,110,221, 16, 20, 20,132,130,130, 2,112, 28, 87,218,124, 41,145, 72,106, 52,138, 48, 53, 53,181, 8,192,124, - 87, 87,215,141, 95,124,241,197,252,230,205,155,191,247,241,199, 31, 51,168,229,160, 8, 66,136,201,100, 50, 97,215,174, 93,216, -179,103, 79, 62,165,180,177, 90,173, 78, 41,227,222,253,234,238,238,126, 98,240,224,193, 15, 30, 61,122,100,151,155,155, 11, 20, -119,138,173, 46,111,162, 97,195,134,224, 56, 14, 95, 77,244, 66,126,126, 11,112, 28, 7,147,201, 4,107,107,235,167,150, 32, 18, -102,113,255,123,193,113,220, 76, 66,200,209, 37, 75,150,204,152, 50,101, 74,155,209,163, 71,139, 37, 18, 9,159,148,148,100,218, -190,125, 59,105,212,168, 17, 35, 22,139,201,241,227,199,249,176,176,176, 43, 38,147,233, 43, 74,105,141,150, 34, 41, 43,174,132, - 62, 87, 47, 20, 59,135, 14, 29, 58,122,200,144, 33, 86,129,129,129,178,159,126,250, 41,167,176,176,176, 66,113, 85,145,121, 89, -217, 52, 13, 47, 98, 2,210, 50,239,140,141, 11,230,158,155, 56,178,225,136, 70,239, 57,215,197,201,194, 52,100,139, 89,198,206, -129, 65,160, 15,139,162,156, 71,110, 39,195,246,198, 36, 39, 39,111,169,138,231,250,245,235,215, 67, 66, 66, 58,191,253,206,187, -251,198,142, 30,171,250,252,227,143,196,135, 78,156, 1,103,212,225,252,169, 83,112, 81, 48,156,161, 48, 85,157,107,100, 6, 69, - 68, 68,188,116,253,175,226,246,190, 55, 17,192, 68, 66,200,240,185,115,231,110,159, 56,113, 34,120,158, 71,104,104, 40,214, 77, -159,142,121, 28, 55,106, 53, 33, 69, 83, 40,157, 40, 60, 22, 47, 80, 96,181,110,221,186,110, 97, 97,225,207, 70,163, 49,144,231, -121,233,217,179,103,161,213,106, 17, 29, 29,173,225,121,126,247,243,164,105,223,190,125,153,242,235,197, 85,242,146,182,180,115, - 93, 92,143, 30, 61, 94, 24, 39,207,243,137,101,215, 48,171,140,183,236,182,201,100, 74,180, 36,160, 60,207, 47,107,215,174,221, - 51,251,106,101,239,242,124,108,247,238,221, 13,229, 69, 87, 69,191,203,196, 63,209, 82,254,244,244,244, 84, 0,239, 43,149,202, - 85, 99,198,140,153, 11,224, 65, 45, 5,214, 34, 63, 63,191, 47,138,127,146,133, 73, 73, 73, 41, 21,136,186,116, 79, 79,207,247, -188,189,189, 75, 23,128,174, 46,238, 61,123,246, 52, 84,183,200,115, 89,231,138,231,249, 68,225,145,255,251, 80, 34,152,206, 19, - 66, 58,173, 91,183,110,230, 7, 31,124,208,122,216,176, 97,162,206,157, 59,227,240,225,195, 92,104,104,232, 85,141, 70,179,172, -166,194,138, 16, 82, 80,254, 25,170, 34, 12, 90, 33, 37,106,134,147, 39, 79, 78,237,208,161,195,220,157, 59,119, 62,241,241,241, -145, 17, 66, 76, 22,138,171, 23, 62, 77, 67, 21,233,106,242,246,246, 30,240,235,136, 15, 14, 5, 78,126,215,167,119,251, 96,185, - 87, 3,165,199,189,184, 76, 36,220, 60,161,121,116,118,221, 99,170,205, 28, 96,137,227, 30, 30, 30, 30,217,160, 65,131,198, 27, -127,218,252,174,132,101,123,242,148, 6,125, 54,105, 20, 24, 66,174, 27, 56,238, 68, 94,126,254,143,213,245, 9,253,175, 67, 38, -145,140,154, 52,105, 18,126,249,229, 23,236, 91,181, 10,189, 19, 19,177, 67, 34,129,149, 68,130,245, 6,195, 4, 0,130,192,170, - 77,217, 87,217,200,170, 38, 77,154,236,200,202,202, 26,146,151,151,103, 50,153, 76, 28, 33,196, 68, 8,209,240, 60,191,128,231, -249, 13,212,130, 33, 89,130, 21, 47,112, 10,156, 2,103,153,227,157,236,236,236, 62,230,121, 30, 5, 5, 5,171, 44, 17, 86,194, -253,252,231, 56,187,117,235,182,146, 97,152, 54, 28,199,109, 61,115,230,204,166,231,225,172, 97,231,119,139,195, 73, 8, 17,121, -120,120,140,165,142,138,254, 48,138, 26, 82, 3,123,143, 53,100, 29, 74, 78, 78,222, 82, 94, 92, 9,233, 94, 57,103, 76, 76, 12, -117,114,114, 66, 86, 86, 22,246, 52,105,242,212, 49, 91, 96,125, 69, 14,214, 63,208, 68,216, 10,128,107,201,239, 12, 0,247, 0, - 4, 3,176, 2,160, 3, 80, 0,192,165,204,249,153, 37,199,204,199,207, 1, 48,254,221,181,204,191,236, 3,160,185,192, 41,112, - 10,156, 2,167,192, 41,112, 10,156, 2,231,115,126, 94, 5, 64, 1,208, 25, 51,102,204,164,148,246,153, 49, 99,198,204, 50,219, -165,199,139,165, 13,125,181,220,241, 86,127,115,120,193, 64,128, 0, 1, 2, 4, 8, 16, 32,224, 63, 0, 74,105,255,101,203,150, - 45, 1,192, 46, 91,182,108, 73,153,109, 80, 74,251,151,253, 46,119,220,245,239, 14, 43, 1,208,188,146, 72, 88,108,253, 17, 66, -154,215,226, 38,221, 22, 56, 5, 78,129, 83,224, 20, 56, 5, 78,129,243,255, 23,103,117,220,149,252,255, 85, 66,200, 33, 74,105, -255,178,223,101,133, 87, 9,231,161,178,191,203, 29,255,243,239, 86,131, 66, 19,161,192, 41,112, 10,156, 2,167,192, 41,112, 10, -156,255,250, 38,194,170,190, 43,251, 93,102,223,223,218, 68, 88,249,176,251,221,187,217, 36, 63,216, 73,173,172, 37, 0,160,215, - 20, 25, 60,163,145,135, 33, 67, 56, 8, 16, 32, 64,128, 0, 1, 2, 4,252,205, 32,132, 28,154, 49, 99,198,172,255, 66, 88, 69, -149,137,171,140, 16,107, 23,145, 46,187, 49,103, 50, 52, 5, 0, 17, 67,239,102,132, 56,198,184,236,222,157,241,162, 69, 86,223, -190,125,103, 81, 74,221,197, 98,241,159, 30, 30, 30,161, 27, 55,110, 52, 10,217,232, 31, 65,181,125,242,130,131,131, 29,117, 58, -221,114,158,231,187,149,172,243, 23, 42,145, 72, 62,189,113,227, 70, 22,128, 74,135, 68,251,248,248,108,247,245,245,109, 76,139, - 1, 0, 79,205,203,101,222,103, 62, 30, 31, 31,127, 63, 33, 33,225, 45, 75, 3, 94,167, 78,157,122,114,185,252, 29, 66,136, 95, - 9, 79,180, 86,171,221, 26, 31, 31,255,248,255, 91, 34,170, 84, 42, 43, 74,233,107, 98,177,120,180,147,147, 83,235,244,244,244, -121, 73, 73, 73,223,214,242,101, 38, 2, 48,205,193,193, 97,184,131,131, 67,253,172,172,172, 71,121,121,121, 59, 1,172,160,148, - 86,251,156, 46,252,208,179,237, 43,253, 58,207, 57,119,248,236,194, 57,107,147,174,148, 63, 62,255, 83,149,115,183,238, 29,230, - 28,249,243,210,130, 37,107,147,178,106, 24, 54,166, 76,158,229,205,217,231, 95,156, 46,129, 0,166,115, 28, 39,102, 24,230,219, -228,228,228, 11,255,246,188,212,180,105,211,207,165, 82,233, 4,134, 97, 30,165,166,166,142, 85,171,213, 47,100,170, 19, 66, 8, -227,227,227, 99, 27, 23, 23,151,111,201, 84, 10, 2,138,209,174, 93,187, 84,131,193,224, 86,213, 57, 18,137, 36,237,242,229,203, -238, 47, 97,244, 51,204, 77,127, 0,210, 0,176, 37,219,250,146,239,212, 50,251, 82, 43, 57,254,207, 11,172, 36, 63,216,137,116, -217,141, 51, 83,163,134,165, 39,223,120, 19, 0, 92,149,129, 59,157,221,253,127, 79,242,147, 26, 90, 53,125, 93, 33,182, 22,125, -207,178,226, 64,173, 94,231, 34, 22,137, 51, 12, 38,227, 13, 70, 79, 39, 38,223,221, 27,111,201,133, 7, 12, 24,208, 24,128,125, - 80, 80,208, 53,189, 94,223,250,219,111,191, 85,238,217,179,167,101, 68, 68,196,136,129, 3, 7, 30,164,148, 30, 59,120,240,160, -166, 70, 15,109,151, 46, 34,183, 28,167, 81,172, 72, 52, 0, 64, 75, 74, 1, 16,246, 38,111, 52,252,153,230,152,185,149, 22,207, -209, 82,187,140, 29,236,220,152,240,134,207,196, 44,237,100,228,200,121,202, 72,150, 95,142,200,140,177, 92, 0,168,122, 72, 69, -228, 7, 0,208,155,232,123,241,241,234,147,207,115, 94, 37, 47,240,158, 0,126, 37,132,136, 1,172,231, 56,110,127,106,106,106, - 36,165,212,244, 34, 50,139,191,191,191, 43, 33,228,230,202,149, 43,157,219,180,105,195,242, 60,143,211,167, 79,191,245,197, 23, - 95,244,110,214,172, 89,243, 59,119,238,164, 85,246, 95, 95, 95,223,198,167, 78,157, 10, 56,122,244, 40,218,183,111, 15,158,231, -193,243, 60, 28, 28, 28,240,199, 31,127,160, 77,155, 54,165,251,220,221,221,209,185,115,103,139,195,229,235,235,251, 90, 96, 80, -171, 41,159,124, 54,221,221,205,217,197,214,196,153, 12, 73, 73,201,170, 85,223,126,213,214,215,215,247,251, 71,143, 30,237,175, - 69, 1, 64,188,188,188,134,137,197,226,254, 0,252, 74,118, 71, 27,141,198, 67,137,137,137,191, 91, 90,144, 7, 4, 4,156, 99, - 24,166,110, 77,174,205,113, 92,252,205,155, 55, 59,214, 38,141, 60, 61, 61,135,122,122,122,254,212,182,109, 91,235,192,192, 64, - 72, 36, 18,124,253,245,215,211, 0,124,107,137,144,178,182,182, 30,102, 99, 99,227, 91, 80, 80,240, 80,163,209,236,145, 74,165, - 61,190,251,238, 59,239, 14, 29, 58,216,166,166,166, 18,150,101,221, 15, 30, 60, 56,106,205,154, 53,189, 9, 33,221,171,203, 91, -217,143,248, 57, 50,113,211, 78,217, 15,207,204, 1,208,183,252,113,147, 86, 62,154, 21,123,247,103,233,245, 4, 0, 43,106, 82, - 64,123,121,121,125,231,238,238, 62, 70,163,209,104, 9, 33,148, 16, 66, 91,180,104, 97, 62, 14, 0,208,235,245,217,247,238,221, -107, 82, 21, 87,189,118, 78,225, 44,195, 86, 58,119, 19,199,115,137,143, 47,103,133, 60,239,243, 67, 41,253, 56, 50, 50,114,136, - 72, 36, 34, 1, 1, 1, 54,132,144,222,150,138, 11,149, 74,213,152, 16, 50,155, 82,122, 45, 57, 57,249,123, 74, 41,231,233,233, -217,149, 82,250,121, 73,124,191, 78, 74, 74, 58, 83,146, 7,190,111,216,176,225,192, 7, 15, 30,172, 79, 74, 74, 90, 84,219,240, - 54,106,212,104,226, 71, 31,125, 52,119,194,132, 9, 86,153,153,153, 62,189,122,245,250, 13, 64,167,231,185, 7,193,193,193,226, -148,148,148,105, 45, 91,182,156,220,170, 85, 43,101, 84, 84, 84,138, 74,165, 90,237,225,225,177, 34, 34, 34,162, 90,193,222,178, -101, 75,149, 72, 36, 26, 3, 96, 84, 73, 1,186, 3,192,214,235,215,175, 63,250,255, 32,176, 12, 6,131,219,201, 69,115, 64, 88, - 22,242, 78, 61,192,243, 60, 50,150,207,133, 41, 43, 3, 46,139, 86,195,100, 50,161, 71,143, 30,110, 47,105,244,195,254,107, 1, -174, 80, 96, 73,173,172, 37,156,201,208, 52, 61,249,198,155,173,251,172,182, 7,128,176,163, 83,222,116,246,108,118, 91, 42,178, -142,145,217,201,247,190, 62,160, 71,224,144,254,157,137,151,210, 13,137,201,105,238, 63,238, 56,214,231,208,177, 51,123, 81, 60, - 47, 69,181,200,203,203, 91,236,227,227,227,122,234,212,169, 39, 82,169,212, 74, 46,151,147,161, 67,135, 90,141, 24, 49,194,255, -244,233,211,190, 71,143, 30, 29, 50,104,208,160,163, 18,137,228,207, 93,187,118, 85,187, 62,153,123,139,193,254, 30, 34,143,221, -131, 94,235, 91,247,213,158,110, 82, 31, 15, 87,240,188, 28,247, 98, 13,117, 78,156,191,222,231,240,209,227,159,185,249, 15, 30, -154, 22,181,239,150,165, 55,167,121,115,123, 7, 43,134, 78,181,146,210,225,125, 58,249,215, 27,208,183, 61,169,223,160, 62, 98, -162, 99,124,207,156,189, 54,166,107,107,219,199, 26, 61,217,161,225,201,202,219,183,115,115,170,226,146,138,200,150,155,119, 30, -168, 56,142,195,215, 95, 45, 57, 49,123,246,236,210,217,213,205, 31,142,227,240,234,171,131,240,205, 55,223, 64,167,211,161, 85, - 96,179, 45,248,223,188, 49,150,224,183,168,168, 40,231,162,162, 34, 28, 61,122,116,102,114,114,242,204, 99,199,142, 37,171, 84, -170,207,146,147,147,119,188,128,218,253,218,245,235,215, 59,183,110,221,154, 53, 24,138,231, 55,237,208,161, 3, 59,107,214, 44, -167,165, 75,151,174, 2, 48,188,138,194,133, 30, 61,122, 20, 63,255,252,115,198, 87, 95,125,149, 8, 0, 46, 46, 46,158,111,189, -245,150,235,175,191,254,154,190,114,229,202, 68, 74, 41,156,157,157,189,134, 13, 27,230,106,105, 80,189,189,189,235, 7,183,106, - 51,101,235,150, 45,109,114,179,178,180, 63,172, 92,127, 93, 39,146, 21,249,248, 53,150,204,153,187,200,126,193,151, 51,223,247, -246,246,190,157,144,144, 16,107,105, 36,149, 74,101,157,186,117,235,238,157, 53,107, 86,243,142, 29, 59,138,221,220,220,144,154, -154,138,123,247,238, 53,191,120,241,226,107,251,247,239,159,166, 84, 42, 95, 79, 78, 78,174,182, 50, 65, 41,109,116,224,235, 37, -110, 50,103, 23,240, 70, 35, 28, 91, 4,150, 30, 83,159, 62, 6,222,104, 4,111, 52,194,251,213,215, 74,157,188,174, 93,187,214, -106, 74,114, 47, 47, 47, 85,227,198,141,127,153, 49, 99,134, 68,167,211,225,198,141, 27,184,124,249, 50,159,150,150,182,172, 58, -113, 69, 8, 57, 62,119,238, 92,175,142, 29, 59,218,102,100,100,128,227, 56,151,253,251,247, 79, 12, 10, 10,178,243,242,242,146, -110,219,182,205,188, 66,128,147,175,175,175,211,136, 17, 35,244, 63,255,252,243, 52, 0, 95, 85,230, 92,229, 60,228,231,164,136, -124,251, 52, 9,121, 7, 41,162, 99,125,166,246, 86, 30,113,240,101, 74,157,172,190, 13, 26,216,214,111,106, 61, 93, 97,215,220, - 41, 55,233,196,244,190, 13, 26,108, 62,242,240, 97,181,139,166, 19, 66, 24, 79, 79,207,239,250,245,235,247,214,250,245,235,173, -163,163,163,173,253,252,252,192,243, 60, 76, 38, 19, 56,142, 51,175,187,137,178, 19, 6, 87, 6,150, 97,189, 46,238,189,227,102, -101,101, 85,250, 28,154,191, 11, 11, 11,209,123,116,219, 23,242,178,229,121, 94,106,206,215, 38,147, 73, 14, 64, 12,192,210, 9, - 44,231, 95,186,116,105,232,145, 35, 71, 70, 46, 90,180,168, 17,128, 15,121,158,159, 19, 29, 29,221, 25, 0,252,252,252,164, 0, -206,168, 84,170,177, 19, 38, 76,152, 48,105,210, 36,140, 30, 61,122, 14, 33,100,113,109,159,123,169, 84,250,229, 7, 31,124, 96, -101, 52, 26, 97,101,101, 5,131,193,208,224, 57, 43,104,146,162,162,162, 61,243,231,207,239, 63,104,208, 32,243, 18, 94, 30,231, -206,157, 91,250,233,167,159,182, 15, 14, 14, 30, 92,153,200, 10, 14, 14, 14, 4,176,160, 97,195,134,189, 71,143, 30,205,118,232, -208, 1, 5, 5, 5, 56,126,252,248,236,189,123,247,206, 14, 14, 14,190, 4, 96, 78, 68, 68, 68,232,203, 46,178, 88,133, 45,238, -189,222, 21,190,209,153, 0,128,148,239,139,151,134,180,251,242, 27,193,226,251, 47, 8,172,234, 80, 84, 84, 20, 52,115,202, 40, - 48, 76,113, 45,177, 97,253, 58, 88, 58,107, 60, 57,112,232, 88, 80, 53,246,230, 74,142,227, 26, 57, 57, 57,125,166,213,106,229, -171, 86,173,146, 39, 37, 37, 53,221,179,103, 15,141,140,140,132, 68, 34,129,189,189, 61,186,117,235, 38,235,211,167, 79,131, 75, -151, 46,213,217,187,119,239,160, 87, 95,125,117,235,159,127,254,121,176, 50, 94,151, 22, 3, 27,185,187,122,156,253,102,209, 56, -167,230,245,125,161, 55, 26,145,152,150, 4, 10, 41, 60,220,108, 48,242,181, 0, 73,135, 16, 73,195, 21,235, 78,133,186, 55, 31, -244, 74,234,237, 3,119,170,139, 99,167, 96,155,176,193,157, 27, 4, 15,236,221,158,105,232,231, 15,137,204,186,244, 88,139,160, - 32,180, 8, 10, 34,227,199,231,215,143,188, 30,249,197,209, 83, 87,103,117, 10,182,137, 56, 31, 81, 88,249,194,152, 20, 50,243, -218,105,175,191,241, 38, 26, 55,110,252,212,203,220,252,251,201,147, 39, 32,132, 32, 35, 35, 3, 60,133,180, 22,105,131, 43, 87, -174, 32, 32, 32, 0,189,122,245,194,240,225,195,149,251,247,239,255,109,237,218,181,157, 1,140,127,158,204,194,113, 92,135,160, -160, 32,214, 96, 48,128,101, 89,100,102,102, 34, 54, 54, 22,190,190,190, 44,199,113, 93,170, 17, 26,104,223,190, 61,190,250,234, -171,196,179,103,207, 6, 1,192, 43,175,188,114,189, 77,155, 54,174, 43, 87,174, 76, 60,127,254,124,112,137, 96,139, 8, 9, 9, -177,120, 56,173,181,181,245,187, 31,127,242,169,107,110, 86,182,198,152,159,111, 80,240,156,201, 78, 46, 38,121,233,153, 57,143, - 19,236,138,222,157, 48, 69,244,229,140,169,239, 2,176,168,205, 94,169, 84,214,105,218,180,105,216,230,205,155,221,156,157,157, -145,147,147,131,204,204, 76,132,133,133,129,231,121,244,233,211, 71, 22,212,178,101,208,138,149, 43, 47, 43,149,202,118,150,136, - 44,153,179, 11,246,116, 46,126, 52,134, 62,202, 44,117, 88,142, 14, 31, 80,122,206,136,184, 92, 0,128, 92, 46,175,245,178, 62, -148,210,118, 29, 58,116,144, 0,192,180,105,211,242, 10, 11, 11,151, 18, 66,126, 83,171,213, 73,213,252,117,218, 23, 95,124,225, - 89,191,126,125,159,223,126,251, 13, 5, 5, 5, 0,224, 86,191,126,125, 52,106,212,136, 59,123,246, 44, 26, 55,110, 12, 91, 91, - 91,156, 61,123, 22, 87,174, 92, 65, 96, 96,160,173, 68, 34,121,179, 50,129,245, 74,191,206,115,100,226,166,157,154,132,188, 3, -133,157, 18,155,183,255,142,123,225, 91, 59,233,140,119,231,204,250,208,243,109,150,202,222,241,108,164,152, 81, 47,164,139,115, -195,102,131, 80, 55,248,134,139,142, 59, 23, 59,103,146,239, 50,145, 92,187,109,238, 55,234,204,202,196,149,135,135,199,242,190, -125,251, 14, 93,191,126,189, 3, 0,220,186,117, 11, 41, 41, 41,112,117,117,133, 92, 46,135, 88, 44,134, 72, 36,170,209, 82, 89, - 86, 86, 86, 72, 78, 78,134,185,226,192,113, 28,242,243,243, 75, 23, 13,159, 63,159, 48,115,231, 90,230, 54, 41,149,202,142, 65, - 65, 65,191,122,121,121,121,151,221,223,183,111, 95,140, 31, 63, 30,133,133,133, 8, 12, 12,236,224,238,238,174, 27, 55,110, 28, -120,158, 71,106,106,106,193,173, 91,183,122, 38, 37, 37, 93,173, 36,222,154,148,148, 20, 76,152, 48, 1,241,241,241,147, 84, 42, - 85, 28,195, 48,114,169, 84,106, 62, 46, 85,169, 84,141, 27, 55,110,252,221,184,113,227,240,228,201, 19,196,196,196,132, 61, 79, -165, 74, 38,147, 21,114, 28,231,102, 50,153,160,209,104,208,167, 79, 31,121,211,166, 77, 83,197, 98,241,221,156,156,156,145, 9, - 9, 9,201, 22,186,141, 34,165, 82,233, 33, 22,139,215, 79,153, 50,165, 95,231,206,157,113,247,238, 93, 28, 61,122, 20, 3, 7, - 14, 68,151, 46, 93, 48,123,246,236, 87,231,204,153, 51, 13, 64,101,149,129,221,123,246,236,169,231,229,229, 85,186, 36,146,157, -157, 29,222,125,247, 93,140, 26, 53, 10,135, 15, 31,110,191,100,201,146, 61, 93,186,116,113, 11,125,142,150,138,255, 2,100, 33, -237,225, 27,157,137, 71,126,206,197, 14,126,137,208, 50,111,195, 51, 72, 80, 54,255,102,129,165,215, 20, 25, 68, 12,189,235,170, - 12,220, 25,118,116, 74,105, 19, 33, 76,244,174,222, 80,100, 40,182,205, 41,242,138, 76,176,146, 49,120,146,156,143,219,143, 50, - 42,122,225,223, 46, 87,248,127,178,122,245,106,124,253,245,215,125, 53, 26, 77, 65,108,108,108,114, 65, 65, 65,225,200,145, 35, -137, 88, 44,198,197,139, 23,241,248,241, 99,180,104,209, 2, 14, 14, 14,232,216,177,163,164, 87,175, 94,222, 99,199,142,125, 27, -192,193,138, 56,201,208,161,172, 82, 42,251, 99,249,162, 97, 78,132,141, 65, 76,124, 14, 26,120,181,134,179,189, 55,146,210, 11, - 16, 17,117, 24, 49, 15,255, 68, 3,175, 58, 24,255, 86, 3,135,111, 55,164, 31, 34,193,239, 55,160, 17,255,235,231, 85,209,144, - 80,185,132,107, 53,111,117, 36,184,194,135,160,198,120, 80, 67,202,179,133,187,131, 55,154, 6,184,195, 90,234,202,220,138,254, -182, 85, 85,113,215,153,232,231,139, 23,206,255,177,101, 96, 48,114,115,115,177,102,205,154, 82, 97, 69, 41, 45,173,113,183,109, -219, 22, 70,163, 17, 63,254,248, 35,140,124,177,253, 95, 85, 56,203, 97, 68,155, 54,109,126,167,148, 74,173,172,172, 82, 2, 2, - 2,124, 62,252,240, 67,209,176, 97,195,160,209,104,198, 41,149,202, 99,201,201,201,251,106,200, 9, 0,168, 91,183,110,199, 46, - 93,186, 88,177, 44, 11,131,193,128,220,220, 92, 36, 38, 38, 34, 54, 54, 22, 46, 46, 46, 64,153,254, 91,149,113,150, 95, 11,145, - 82, 74,205,241, 47, 43,196,204,247,197,146,112, 18, 66,154, 58, 58, 56,218,252,176, 98,125,184,171,140, 37, 46,222, 42, 34,177, -115, 16, 49, 10, 91, 25,101, 89,141,143,183,202,150, 16,210,180, 18, 65, 82,126,209,112, 82,183,110,221,189, 91,182,108,113, 19, -139,197,224, 56, 14,174,174,174,136,141,141, 69, 78, 78, 14,242,243,243, 17,123, 55, 26,245,188,188,240,209,248,247,148,243,191, - 89,185,151, 16, 18, 82,182, 16,171,112, 49,110,163,177,124,152, 43, 43,136, 96, 73, 56,171,112, 72, 30,171,213,106, 88, 91, 91, -195,207,207, 79,113,237,218,181,243, 73, 73, 73, 73,213,113,202,229,242, 55, 59,116,232, 96,187,125,251,118, 4, 7, 7,195,222, -222, 30,103,206,156,193,173, 91,183, 96, 48, 24,152,252,252,124, 40, 20, 10, 44, 91,182, 12,117,234,212, 65,110,110, 46,226,226, -226,156,197, 98,177, 75,101,156,231, 14,159, 93,152,253,232,204,156, 20,246, 88,159,205,219,127,199,184, 17,195,224, 97,122,116, -222,177, 1,179,176,239,171,237,191,100,197,222,253,109,108,155, 59, 54,106, 62, 8, 18,169, 2, 31,126,190, 0, 49,183,255,112, - 44,202,191, 53,137, 51, 38,120, 3,248,168, 60, 39, 41,190, 65,140, 74,165,122,111,227,198,141,182,230,253, 12,195, 64, 44, 22, - 63, 37,172,204,139,177, 87,116, 79, 43,186,159, 28,199,193, 96, 48,192, 96, 48,128,231,121,164,167,167, 35, 63, 63, 31,142,142, -142,197, 39,204, 5, 8, 8,161,149,172, 66, 95,150,147, 97,152,145,191,255,254,187,183,181,181,245, 51,231, 37, 36, 36, 32, 55, - 55, 23, 54, 54, 54,112,112,112,128,209,104,132,201,100,130, 78,167, 83,116,233,210,101, 34,128,171, 21,113,178, 44, 59,117,194, -132, 9, 29, 14, 29, 58,228,187,104,209, 34, 24, 12,134,229,233,233,233, 48, 11,180,142, 29, 59,182,165,148,222,155, 50,101, 74, -137, 32,156,111, 44, 40, 40,248,160,182,121,201,221,221,221,127,192,128, 1,142, 39, 79,158, 68,199,142, 29,161,211,233, 48,113, -226, 68,187,247,222,123,207,238,210,165, 75,174,171, 86,173,218, 6,160, 71, 85,156,193,193,193,226,212,212,212,233, 35, 71,142, -156,214,163, 71, 15,251,140,140, 12,200,100, 50,236,220,185, 19, 63,252,240,195, 17,131,193,240,197,158, 61,123, 22,111,218,180, -169,207,160, 65,131,176,105,211,166, 41,132,144,175, 41,165,124, 5,156, 42,111,111,111,220,188,121, 19,142,142,142,112,113,113, - 65,110,110, 46,174, 92,185,130,176,176, 48, 52,109,218, 20,132, 16,199,146, 50,205,244, 60,207, 81, 13, 43, 53,127, 59,103,233, - 26,171,101,242, 46, 0,112, 40,158, 97,179,182,225, 36,132,136, 84, 42,213, 32, 7, 7,135, 73,148, 82, 81,118,118,246, 70,107, -107,235,221,149, 45, 19, 36, 44,244,108,161,192, 34,132,152,211,165, 11,165,244,172,103, 52,242, 50, 66, 28, 99,156,221,253,127, -119,246,108, 86,124, 19, 77,244, 46, 43,115,140,113, 15, 47,202, 3, 0,131,145,226,210,221,108,220,124,144,138,155,247, 83,160, -144, 87, 95,235,118,118,118, 70,251,246,237,113,224,192, 1, 36, 36, 36, 40,150, 45, 91,214,200, 96, 48, 24, 6, 12, 24,160,174, - 91,183,110,118,199,142, 29, 33, 22,139,113,245,234, 85,228,229,229,129,101, 89, 72,165, 82,240, 60, 95,169,211,230,118,159,123, -103,244,248, 32, 95, 23, 7, 6, 7, 47, 30, 67,219,166,131, 97, 45, 19, 35, 61, 91, 3,134, 16, 60,124,124, 18, 28,103,131,200, -187,241,104,215,220, 6,157,218,216,123, 21,156,202, 26, 15, 96,157, 37, 55,200,144, 20, 10,105,221,215, 1,121, 51, 80,253, 67, -240,250, 36, 80,177, 27, 10,139,228,200,120, 18,135,187, 87,118,131,154,138,170,229, 73, 72, 80,255,164, 82,169, 58,134,142,122, -231, 29,158,231,241,213, 87, 95,133,222,191,127,191,107,217,115, 26, 52,104,112,102,246,236,217, 93,178,179,179,113,236,216,177, -173,106,181,122, 75, 77, 18, 83,173, 86,159, 4,224, 84,214,141,185,126,253,250,246, 95,126,249,165,221,219,111,191,141, 93,187, -118,125, 6, 96, 95, 77, 56,167, 76,153, 34, 62,112,224, 64,111, 43, 43,171, 53,115,230,204, 81,232,245,122, 36, 39, 39, 35, 37, - 37,165,212,109,187,115,231, 14, 39, 18,137, 46, 85, 83,248, 87,184,216,116,121,129, 85,102,159,165, 53,239, 2,189,209,168,179, -241, 86, 25, 7, 12,234,221,226, 86,216,141, 24, 43, 39, 39,166, 69,171, 64,255,187, 15,158, 68,144,226, 38, 24,139,154, 97,188, -188,188,134,205,157, 59,183,133,157,157, 29,120,158,135,189,189, 61,210,211,211, 75, 5,165, 62, 63, 15,134,188, 92,220,140,139, - 69,199, 46,221,208,171, 93, 91,191, 63,141,198, 97, 0,118, 84,197,235,212, 50,168,212,185,218,229,235, 92,186,127,248,147,156, - 82, 1,112,184,117, 67,200, 20, 54,104,254,241,204, 90, 63,204,201,201,201,215,125,124,124, 14,247,233,211,167,223,248,241,227, -153,148,148,148,163,238,238,238, 29, 82, 83, 83,163,170,250,159, 66,161,104,144,145,145,129,252,252,124,216,219,219, 99,213,170, - 85,112,115,115, 67, 81, 81, 17,174, 93,187, 70,189,188,188,200,153, 51,103,224,233,233,137,204,204, 76, 24, 12, 6, 20, 21, 21, -165,232,245,250, 74,251, 72,150, 52, 3,246,157,218, 75,121,228, 94,248,214, 78,158,136,189, 54,228,179, 78,247, 35,195, 98, 18, - 78,159,186,184,208,164,149, 39,228, 36,158,152, 94,191, 85,164,203,164,207,230, 99,237,242,185,184,119,245,108,150,123,157,252, -117, 28,209,109,237,208,187, 74,151, 86, 27, 29, 29,109, 27, 25, 25, 9,134, 97, 96,103,103, 7, 27, 27,155,210,133,205,205,226, - 74, 36,178,220,160, 55, 87,112,204,226, 42, 61, 61, 29, 15,227, 98,176,231,244, 54, 24, 77, 70,151, 45,109,236, 82,124, 37,146, -155, 46,185,100, 86,198,109,122,189,154, 2,112,227,240,225,195,135,121,122,122,218,150,221, 31, 16, 16,128,183,222,122, 11, 71, -143, 30, 69,120,120,248, 83, 21,172,244,244,244,100,142,227,182, 86,198, 25, 31, 31,159,227,229,229,213,231,189,247,222,139,216, -183,111,159,221, 55,223,124, 83,186,176,185,185, 89,212,252,189,125,251,118, 68, 68, 68,204, 73, 73, 73,185, 91,155,124,228,225, -225,209,116,192,128, 1,231,214,173, 91,231,144,154,154,138,140,140, 12, 20, 22, 22, 66, 44, 22,195,100, 50,161, 97,195,134,132, -227,184,122,213, 53, 7, 50, 12,243,199,233,211,167,123, 55,106,212, 8, 0, 96, 52, 26,113,241,226, 69,140, 31, 63, 62,211,218, -218,250,205, 39, 79,158, 20,170, 84,170,217,135, 14, 29,234, 19, 16, 16,128, 22, 45, 90,120,164,165,165,217, 2,200,173,236, 29, -194,113, 92,105,250,252,248,227,143,165,199,180,218,226, 37, 39,245,122, 61,105,213,170, 85,189,107,215,174,189,180,131, 91,226, -126,217,140, 39,179, 38,195,231,252, 61, 0, 64,132,127,113,151, 43,159,179,209,197, 39,140, 26, 85, 35, 62,149, 74,229, 76, 41, - 29,215,163, 71,143,143,251,244,233,227,170, 84, 42,225,236,236,140, 91,183,110,117, 56,118,236,216, 26, 47, 47,175, 13, 28,199, -109,176,196,173,127, 94,148,215, 34, 47,141,131, 69, 41, 37, 37,145, 35, 24, 50,132,115,217,189, 59, 35,201, 79,106,144,138,172, - 99, 0, 64,111, 40, 50,184,135, 23, 21, 79,211,176,112, 59, 40, 40, 56,190,196,109,160, 20,156,133,227, 64,180,119,223, 0,159, -243, 7,220, 28, 7, 97,211,166,125, 72, 75, 75,147,172, 90,181,170,238,190,125,251,188, 70,142, 28, 25,223,176, 97,195,220,110, -221,186, 97,219,182,109,240,240,240,128, 94,175, 7,207,243,149,170, 55, 91, 39,110, 72,155, 22, 13,217,152,184, 91, 8,105,244, - 6,234, 41, 59,226, 97, 82, 46,178,243,117,200,204,213,160,113,227,207,144,154, 85,132,188, 66, 45,110,221,251, 13, 94,202,250, - 12, 43,126,216,199, 82,129,165,123,248, 43,116,177,191, 67,162,236, 10,105,253, 97, 16,187,180, 67,194,189, 80,220, 56,185, 18, -137,247, 47,128,242, 28,220,189,155, 90, 90, 51,153,183,122,245,234,145, 75,151, 46, 21, 77,158, 60,185,139,167,167,103,151,164, -164,164, 80, 0,240,244,244,236, 50, 97,194,132, 46,182,182,182, 88,188,120,177,145, 82, 58,239,121, 19, 55, 57, 57, 57,222,211, -211,115,210,201,147, 39, 35,199,142, 29,139,166, 77,155, 6, 17, 66, 24, 75, 58,214, 54,108,216,112,188, 84, 42, 29, 99, 50,153, - 26,141, 24, 49,130, 25, 55,110,156,194,205,205, 13, 79,158, 60,129, 78,167, 3,195, 48,144, 72, 36,184,115,231, 14,255,199, 31, -127,228, 74, 36,146, 41, 22, 56, 44,112,113,113,241,236,212,169, 83, 4, 0, 56, 57, 57,121,241, 60, 15,103,103,103,175,246,237, -219, 71, 0,128,163,163,163,103, 69, 66,172, 82, 1,108, 48, 92,139,143,139,107,220,161, 83, 7,229,185,240,168,235,175,191,214, -191, 43, 35, 98,152,199,113,201,215, 92,157,157,108, 46, 94,186,144,103, 48, 24,174, 89,194, 37, 22,139,251,119,236,216, 81,148, -157,157, 13,149, 74,133,244,244,116, 36, 37, 37,193,104, 52, 66,155,155, 13, 67, 94, 30, 12,185, 57,160, 69, 5,120,116,237, 42, -252,188, 61,101,199,139, 59,193,239,168,174,198, 89,145, 67, 69, 8, 41,221, 39,179, 85,192,202,214,182,180,249,163, 6, 47,199, - 65,118,118,118,211,243,243,243, 15, 39, 37, 37, 45,210,235,245, 31, 46, 93,186,180,213,130, 5, 11, 92,166, 79,159,110, 55,125, -250,244, 93,117,235,214, 13,124,242,228,137,174, 82,133, 90, 80,240,208,104, 52, 58, 3,112, 63,117,234, 20, 92, 93, 93,145,151, -151, 7,163,209, 8,141, 70,163,119,116,116,148,103,102,102, 66,171,213, 66,175,215,195,206,206, 14, 17, 17, 17, 89, 38,147,233, - 96,117,225,115,104,192, 44,212, 25,239,206,113,242,183, 73,226,168,115,231,124, 13,159, 61,247, 27,245, 66, 0, 43,250, 54,104, -176, 89,207,159,141,141,185,125,192, 49,246,218,153, 44,245,253, 34,223,205,127, 62,202,175,226, 62, 82, 66, 8, 79, 8,161, 77, -154, 52, 65,122,122, 58, 88,150,133,141,141, 13, 20, 10, 5,154, 54,109,138,132,132,132, 90, 11,172,178,226,234,228,229, 67,200, - 40, 72,198,230,229,219,225,233,225,205, 0,112, 77, 74, 73,232, 57,118,218,208, 54,245, 59, 58, 46,141,189,144,189,172,138,138, -206, 13, 0,118,101,247,121,122,122,118,117,116,116, 60,109, 48, 24,240,228,201, 19, 28, 63,126,188, 75, 98, 98, 98,141, 10,144, -196,196,196, 71,158,158,158,125, 94,123,237,181,109, 45, 90,180,104, 64, 41, 69,211,166, 77, 49,104,208, 32,236,217,179, 7, 81, - 81, 81,200,203,203,227,207,159, 63,191, 37, 57, 57,185, 86, 29,114,148, 74,101,147, 87, 95,125,245,194,218,181,107, 29, 51, 50, - 50,160,213,106, 81, 80, 80,128,221,187,119,163, 67,135, 14,144,203,229, 88,189,122,117,158,201,100, 90, 91,149,184,162,148, 30, -216,183,111, 95,111, 95, 95, 95,220,189,123, 23,231,207,159,135,171,171, 43,172,172,172, 48, 96,192, 0,231,223,127,255,253, 67, -127,127,255,149, 98,177,120, 97,191,126,253,192,113, 28,194,195,195,147,227,226,226,242,171, 74,163, 74,203, 21,173, 22,148, 82, - 24,141,198, 85, 12,195,188, 25, 28, 28,220, 43, 34, 34, 34, 12, 47, 9,188,188,188,154,137,197,226,143, 28, 29, 29,145,158,158, -142, 28, 30, 80,100, 21, 15,186,205, 45,121, 93,102,101,101,149,190,107, 26, 53,106,244,167, 70,163,153,149,152,152, 88,169,203, -228,233,233,217,210,218,218,250,227, 1, 3, 6,140,124,245,213, 87, 89,131,193,128, 67,135, 14, 97,237,218,181,232,211,167, 15, - 26, 54,108,136,207, 62,251,204, 94,167,211,205, 56,122,244,232,116, 63, 63,191,163,249,249,249, 51,171,226,124, 65, 14,222,255, -180,200,203, 34,176, 74, 34,244,191,126, 52, 67,134,112,158, 64,118, 73,141,198,197,201,201,105, 45,199,113, 93,241,229,151,176, - 21,217,227,201,195,251,200,207,230, 97,212,235,192,243, 20,148,183,236, 94,240, 57,127,192,238, 21,138,188,115, 4, 6,131, 1, -110,110,110, 88,182,108, 25,114,115,115, 69, 99,199,142,173, 55,127,254,252, 27, 90,173, 22,133,133,133,208,104, 52,208,104, 52, - 85, 10, 44,137, 92,215,194,199,189, 17,242, 53,173, 97, 45,149, 34, 51, 79,135,236,124, 29, 50,114,180,216,123, 96, 4,116,154, - 34,152,244,122,112, 6, 19, 20,238,131,209,208,169, 43,128, 7,205, 45, 76,232,146, 64,155, 96, 72, 58, 1, 67,210, 9, 88, 7, -204,198,129,213,111, 63,117,158,201,100, 89,147,127,114,114,114,188, 74,165,250,126,204,152, 49, 83, 94,123,237, 53,108,216,176, -225,107, 0, 33, 37, 46,194,215,131, 7, 15,198,157, 59,119,112,238,220,185,245, 47,170,182, 64, 41,117,118,114,114, 2,195, 48, - 40, 42, 42,210, 85, 39,174,118,239,222, 77,230,207,159,127,116,192,128, 1,237, 62,252,240, 67,107, 15, 15, 15, 80, 74,161,215, -235,145,152,152, 8,134, 97,144,147,147,131, 31,127,252,177, 48, 60, 60,156, 74,165,210, 75, 98,177,248,253, 59,119,238,168,171, - 11,139,163,163, 35, 70,140, 24,225,218,186,117,107,215,178, 35, 6,223,124,243, 77,215,144,144,144,210,125, 94, 94, 94, 22,199, - 79,171,213,254,184,120,225,156,174,191,252,186,179,105,147,166, 13, 29, 15, 31, 63,115,221,217,217,206,170, 94, 61, 95, 89,110, - 78,142,110,237,170,229,162,194,194,194,159, 44,164,243,115,113,113, 65, 74, 74, 10, 30, 60,120, 0,157, 78, 87,220,132, 83, 84, - 0,125, 78, 14, 12,185,217,128, 86, 3, 41,199, 65,151,145,138,122,190,245,128,255,141, 48,172,174,102, 86,161,192, 50,127, 91, -217,219, 65,106, 99, 3, 86, 44,178,184, 15,150, 82,169, 12, 14, 10, 10,218,185,105,211, 38,201,212,169, 83,219,212,173, 91,119, -109, 74, 74, 74,156,151,151, 87,247,229,203,151,135, 45, 90,180, 72, 54,114,228,200, 38, 27, 55,110, 28, 13, 96, 99, 21,247,112, -231,225,195,135,223,170, 83,167,142,251,237,219,183,161,213,106,193,243, 60,250,246,237, 11, 0,114,243,121,247,238,221,211,104, - 52,154,212, 59,119,238,228,199,197,197, 25, 96,193,168,191, 57,107,147,174, 76, 29,234,245,186, 82,169,186, 44,149,249,212,103, -138, 34, 6, 79, 29,234,245,205,202, 93,137,218, 35, 15, 31,230,207,153,228,187,172, 40,255,246, 36, 71,175,194,117,235, 14, 62, -202,183, 36, 75,151,140, 24,132,139,139, 75,105,147,160, 68, 34, 49, 55,109, 33, 55, 55,183,202, 38,194,202, 10,239,220,220, 92, -228,230,230,226,254,227,187, 72,207, 79,198,137, 29,151,193,113, 92,169, 59,162,114,247,194,201, 29, 97,182, 93,134,180,154,229, -220,146,156,201,188, 73,175, 89,154, 79, 25,134,249,248,141, 55,222,128,193, 96,192,160, 65,131,176,125,251,246,143, 1,212,184, -134,158,148,148,116,133, 16,210,232,193,131, 7,118, 70,163,113,224,128, 1, 3,182,246,235,215, 15,151, 47, 95,198,169, 83,167, -186,232,245,250, 24,142,227, 52, 74,165,114,169, 82,169,116, 35,132, 44, 85,171,213, 85,142,118,110,220,184,241, 72, 91, 91,219, -197, 86, 86, 86,249,253,250,245, 83,153,157,171,194,194, 66,152, 76, 38, 36, 38, 38,226,200,145, 35,201,135, 15, 31, 78,166,148, - 90, 23, 20, 20,204,141,143,143,223, 93, 89,179,160,209,104,220,255,199, 31,127,244,241,245,245,197,217,179,103,241,213, 87, 95, -161, 65,131, 6,216,178,101, 11,218,183,111,143,122,245,234,193,201,201,233,163,188,188,188,118, 95,125,245, 85,191,160,160, 32, -236,219,183, 15,105,105,105,107,170,122, 63, 85,245,158,213,104, 52,160,148,162, 91,183,110,227,167, 78,157,138, 1, 3, 6, 28, - 15, 9, 9,105, 29, 30, 30,126,255,191, 94, 72,171, 84,170,101, 61,122,244,152,222,178,101, 75,252,250,235,175,208,133,116,132, -205,150,131,184,221,191, 3, 40, 0,213,150, 3, 0,128,219, 3,139, 7,116,212,235, 62, 4,211,167, 79,239, 55,120,240,224, 58, - 0,154, 85,194,249,205,219,111,191, 61,237,237,183,223,198,245,235,215,177,113,227, 70,220,184,113,163,180,204, 51, 26,141,136, -142,142, 70,116,116, 52,148, 74, 37,250,247,239, 79,222,127,255,253,190,125,251,246,117, 53,151, 89,127,177,139,213,229,165,105, - 34,172, 74, 53,122,120,120,184, 56, 58, 58,222, 89,187,118,173,115,155, 54,109, 88,147,201,132, 83,167, 79,227,211,201, 99,209, -167,255, 36,104,117, 82,152,180, 4,156, 68, 97,217, 21,237,250, 35,239, 28, 1,175,232, 7,189, 94,143,241,219, 37,112, 32,169, - 88,245,142, 59, 0, 16,141, 70, 3,157, 78, 7,141, 70,131,194,194, 66, 20, 22, 22,130,227,184, 74,223,146,249, 57, 54, 6,131, -145, 71, 82, 90, 28, 18,147,111,195, 94, 81, 7,148,241, 70,106, 86, 17, 8,220, 96,212,222, 3, 95,242, 96,234, 52,137, 40,212, - 61,159, 40,230,242, 99, 43,112,102, 44,239, 83,201,113,220,226,229,203,151,143, 95,187,118,173,108,210,164, 73,193, 42,149,106, - 32, 0, 76,155, 54, 45, 88, 46,151, 99,221,186,117, 58,142,227, 22,191,160,140,202,122,122,122,126,252,202, 43,175, 32, 47, 47, - 15,119,238,220, 57, 84,221,127,102,207,158, 61,241,141, 55,222,104, 55,127,254,124,107,173, 86,139,162,162,226,230,207,220,220, - 92, 20, 22, 22, 34, 53, 53, 21,211,166, 77,203, 54, 24, 12, 19, 30, 63,126,188,167, 6, 66, 15,127,252,241, 7,126,249,229,151, -167, 70, 12,190,249,230,155,174,219,183,111, 79, 91,189,122,117, 18,165,148, 58, 57, 57,121, 13, 25, 50,196,205,210, 22, 66,181, - 90,173, 81,169, 84, 83, 22, 45, 94,244,219, 55,203,151,187,101,101,102,199, 72,164, 86, 90,107, 43,153,211,244, 79, 23,210,212, -212,212,105,169,169,169, 69,150,134, 51, 59, 59, 27,177,177,177,176,178,178,130, 68, 34, 1, 87, 84, 0,190,176, 16,186,236, 76, - 48,122, 29,100, 28, 7, 39,107, 25,188,221,221, 81,199,205,178,190,248,201,103,142,227,200,176,254, 79, 53, 11, 18, 66,112,180, -125, 19, 72, 21, 54,144, 43, 20,232,184,255,124,113,133, 65, 34, 1, 86,109,178,164, 25,199, 69,165, 82,253,177,102,205, 26, 73, - 70, 70, 6,238,220,185, 19,249,228,201,147, 92, 39, 39, 39, 91,177, 88,204,223,191,127,255,228,189,123,247,250,215,171, 87, 15, -148,210,234, 70,127,173,216,187,119,111,207, 14, 29, 58,152,234,213,171,103,147,158,158, 94, 39, 59, 59,155, 36, 39, 63,221,135, -249,218,181,107,242,248,248,248, 34,158,231,247,161,120, 30,172,106, 51,254,212,161, 94,242, 75,215, 49,165,179, 75,189,150,246, -174, 45,145, 97,188,209,242, 74,100,202,148,169, 67,189, 86,175,220,149,168,229,136,110, 43,103, 76,240, 22,201,181,219, 44,204, - 71,212,223,223, 31,148, 82, 92,187,118, 13,231,207,159,199,249,243,231,241,228,201,147,210,115,236,237,237,113,226,196, 9,116, -237,218,213,226,103,165,168,168, 8, 74,165, 18, 14, 14, 14,216, 23,250, 51,126,248,102,123,105, 71,119, 51, 50, 50, 50, 96,109, -109,141,197,159,174, 84,140,253,124,200, 66, 0,189, 44,225,246,246,246,174,223,161, 67,135, 87,221,221,221,145,157,157, 13, 87, - 87, 87,180,106,213,106,128,187,187,123,189,212,212,212, 90, 53,101,233,245,250,137, 93,187,118, 93, 52,109,218, 52, 24,141, 70, - 12, 27, 54, 12,177,177,177, 59, 31, 61,122,180,202,199,199,103,202,164, 73,147,220, 93, 92, 92, 48,113,226, 68, 27, 0,175, 87, -198,211,180,105,211, 79,102,204,152,177,100,212,168, 81, 50,163,209,136, 83,167, 78,149,186,212, 38,147, 9,113,113,113,152, 59, -119,110,114, 94, 94, 94,231,196,196,196,135,213,133, 43, 37, 37,101,218,254,253,251,251, 54,110,220, 24, 71,143, 30,197,132, 9, - 19,254, 84, 40, 20,205, 94,125,245,213, 58, 54, 54, 54,136,140,140,132,193, 96,128, 82,169,116,159, 49, 99, 70,255,222,189,123, -227,228,201,147, 88,184,112,225, 33, 15, 15,143, 21,213,137, 96,145, 72, 4, 99,185, 62,141, 44,203,226,198,141, 27,232,214,173, - 27,166, 79,159, 14, 0, 56,121,242,164, 93,175, 94,189,110,119,233,210,197, 46, 52, 52, 84,247, 95, 46,164,109,108,108,198,108, -217,178, 5, 15, 30, 60,192,133, 11, 23,144,153,153, 9,189, 94,143, 92,190,184,207,149,172,196,185,162,158, 62,104, 63,109, 22, -134,247,127, 29,201,201,201, 96, 24,198,165,138,178, 97,228,172, 89,179,112,228,200, 17, 44, 91,182, 12,121,121,121, 21,158,103, -101,101,133, 86,173, 90, 33, 48, 48, 16,177,177,177, 0,224,242, 87,199,247,165,116,176,170,112, 29, 86,125,255,253,247,206, 29, - 58,116, 96, 11, 11, 11,193,243, 60,218,181,109,139,209,239,140,198,177,125,187,161,172,223, 21,172,214, 10, 38, 91,107,203, 4, -134,247, 86,100,101,101, 65, 38,147, 65, 94,210,161,244,102, 98,169,189, 11,173, 86, 91, 42,174,204,223, 85,193,164,151, 70, 68, - 63,226,188,243, 10,110,224,106,196, 47, 48,234,245,168,215,104, 38,116, 38, 23,216,184,189, 11,141,225, 15, 24,114,138, 71,238, - 74,237,186, 32, 53, 53, 3, 0,185,109, 97, 66, 63, 43,166, 52,207,118,118,231, 57,203, 5, 86,106,106,106,186, 82,169, 92,113, -227,198,141,217,125,251,246,197, 15, 63,252,176,140, 82,138,126,253,250,225,218,181,107,136,140,140, 92,145,154,154,154,254, 2, -196,149,200,195,195,227,199,117,235,214,245,115,119,119,199,222,189,123, 65, 41,173, 86, 16, 73,165,210,113, 83,166, 76,177, 54, -187, 24, 82,169, 20, 26,141, 6, 41, 41, 41, 48, 24, 12,216,183,111,159, 78,175,215, 79,125,242,228,201,158, 26, 62, 52,180,117, -235,214, 88,185,114,101,226,133, 11, 23,130, 1,160,125,251,246, 17, 33, 33, 33,174,171, 87,175, 78,186,114,229, 74, 48, 0,180, -105,211, 38, 60, 48, 48,176, 70,243,184,168,213,234,196,198,141, 27, 63,212,104,181, 98, 71,103,167, 34, 91, 27, 41,205,203,207, -103,110,222,188,158,156,154,154,250,164, 6, 84,209,119,238,220,105,158,148,148,132,184,184, 56,112, 69, 5, 96,116, 58, 16,157, - 6,221,219,181,133, 21, 40,100,224, 33,225,141, 16,179, 34,228,231, 23, 0, 64,116,181,174,109,153, 2,193, 44,174, 8, 33,144, - 43, 20,144,218, 42, 32, 83, 40,158,114,180, 44, 17,151, 86, 86, 86,191,109,220,184, 81,169, 84, 42,241,237,183,223, 66,169, 84, - 54,237,209,163, 71, 81,231,206,157,173, 92, 92, 92,208,184,113, 99,132,132,132,224,204,153, 51, 32,132, 60,172, 38,109, 76,132, -144, 94, 23, 46, 92,152,118,233,210,165,161, 42,149,138,140, 26, 53, 10,125,250,244,129, 76, 38,131, 70,163, 65,118,118, 54,254, -252,243, 79,194,113, 92, 80,137,192,243,169, 91,183,238,118, 66, 72,226,227,199,143,223, 44,207,185, 97,113, 75, 85,190,134, 31, -171,244, 80,189,222,185,119,189, 22,221,122,247, 64,253, 70,221,209,173,119, 2, 0, 44,115, 17, 63, 30,246,245,236,230,251,234, -121, 59,109,185,180,255,228,151, 29,251,118,253, 98,254, 20,167,133,115, 87,103, 89, 50, 77, 67,105, 97,203, 48, 76,133, 46, 21, -203,178, 96, 24,203,214,178,231,120, 46,177,207, 59,237, 74,183,141, 38,131,139,167,135, 55, 99,118,174, 0, 32, 47, 47, 15,241, -241,241, 48, 26,141,112,118,118,134,209,104,104, 89,131, 74,213,148, 97,195,134, 17,173, 86,139,105,211,166, 97,249,242,229, 24, - 52,104, 16,185,122,245,234, 20, 0, 31,215,194,209, 88, 62,113,226,196,105, 99,198,140, 65, 78, 78, 14, 78,159, 62,141,174, 93, -187,226,251,239,191,119, 61,125,250,244,146,246,237,219,131,101, 89,156, 56,113, 2, 6,131,225, 94, 53,207,251,228, 81,163, 70, -201, 18, 18, 18, 32,145, 72, 16, 18, 18,130,196,196, 68, 20, 22, 22, 34, 45, 45, 13, 11, 22, 44, 72,201,205,205,237,146,148,148, -244,208,130,116, 97, 58,117,234,244, 81,195,134, 13,113,234,212, 41, 76,156, 56,241,136,141,141,205,235,217,217,217,239,235,116, -186,213,253,251,247, 71,251,246,237,113,239,222, 61, 12, 24, 48, 0,173, 90,181,194,233,211,167, 49,125,250,244, 63,173,173,173, -223,168,102, 30,172,251,161,161,161,205, 67, 66, 66, 80, 88, 88,136,252,252,124,136,197, 98, 56, 56, 56, 32, 58, 58, 26,141, 26, - 53,194,244,233,211,177,114,229, 74, 76,157, 58,149,239,213,171,151,201, 96, 48, 72,204,163, 44,255,203, 40, 44, 44,164,201,201, -201,176,179,179,195,174, 93,187,112,235,228, 49, 28,158,252, 46,228, 95, 44, 7,165, 20,137,139,102,160,219,231, 95,160,109,228, - 35, 36, 39, 39, 99,219,182,109, 96, 24,166,116, 68,108,101,101, 91,110,110, 46, 2, 3, 3,113,237,218, 53,108,219,182, 13,223, -126,251,109,169, 91, 43, 22,139,209,165, 75, 23,244,236,217, 19,247,239,223,199,198,141, 27, 97,103,103, 7, 1,181, 16, 88,148, - 82, 82,246,251,105,119,134,239,214,170, 85, 43,182,160,160, 0, 90,173, 22,169,169,169,120,252,248, 49,172,172,172,144,148, 22, -143,214, 13, 10,144, 66,244,184,115, 35,134, 35,172,248, 70,117, 53, 16,131,193, 0,189, 94,143,155, 55,111, 22, 15,125,111,180, -180,180,243,115, 73,159, 15,104,181, 90,132,134,134, 82, 43, 43, 43,216,216,216,144,170,218,222,121,147,238,200,153,139,145,253, -222, 30,220, 77,122, 34,244, 7, 24,117, 38, 20,232, 28, 80,168,213, 35, 95, 35,134, 94,214, 27,132,156, 7,195,202,208, 62,176, - 1, 78, 95,184,175,229,140,134,163,150,169, 2, 14,172, 83, 75,112, 89, 55,203, 8,172,167,107,245, 18,153, 2,156,169,102,163, -130,229,114,249,242, 21, 43, 86, 76,254,241,199, 31,109,223,127,255,253,198,230,194, 98,221,186,117,249,114,185,124,249,243, 10, - 43,165, 82,249,118,135, 14, 29, 22,204,157, 59,215, 51, 48, 48, 16, 17, 17, 17, 88,186,116,233,159, 41, 41, 41, 7, 44,168, 25, -123, 57, 59, 59,163,160,160, 0, 82,169, 20, 28,199, 33, 45, 45, 13,241,241,241,144,201,100, 8, 11, 11,211,251,248,248,236,173, - 77,216, 44,233,208, 94,118, 68,101, 77, 96, 37,225,131,191,248,124,124, 67,173, 86,227,159,159,159,111, 18,137, 68, 34,153,152, -139,173, 9,135,209,104, 60,116,254,252,249,215, 58,118,236, 40,139,185,121, 3,134,220, 92, 24,243,114, 32,225, 76,112, 10, 14, - 4,163,215,130,232,141,240,244,163,208,228,216,224,226,245, 71, 70,163,209, 88,173, 43,104, 22, 88, 12,203, 62,221,239,202,206, - 22, 82, 69,177,192, 42,187,159, 84,211,174,229,238,238,110,221,183,111,223,238, 65, 65, 65,160,148, 98,249,242,229,208,235,245, - 82,163,209, 8,163,209, 8,131,193,128,252,252,124,236,217,179, 7, 63,255,252,243, 69,123,123,251,106, 7, 75, 80, 74, 77, 94, - 94, 94, 31,242, 60,239,102, 50,153, 12,174,174,174,146,157, 59,119, 66, 46,151,131, 97, 24, 4, 6, 6, 66, 46,151,235, 84, 42, -149,161, 36, 12,198, 21, 43, 86,136,222,123,239, 61, 73, 69,124, 1,173, 27,127,202, 81,231,206, 82,153, 79, 61,123,215,150,168, -223,168, 59, 0,160,103,255,177,168,223,208, 27,185,233, 55,235,235,117,113,131, 89,146,233,248,203,229,164,232, 78,214,205,199, -100, 38,134,198, 0,248,209,210,188,212,189,123,119,244,234,213,171,180, 57,208,205,205, 13,122,189, 30, 38,147,201, 98,113, 5, - 0,230, 73, 68,231,207, 39, 12,230, 2, 91,218,216,166, 0, 40,181, 39,115,115,115,145,144,144,128,184,184,184,210,247, 20, 79, - 45,171, 93,171, 84, 42,171,250,245,235,191,211,172, 89, 51,156, 62,125, 26, 55,111,222, 76, 58,123,246,172,103,235,214,173,225, -229,229, 53, 70,165, 82,205, 82,171,213, 22, 79,168,236,234,234,106,211,169, 83,167,201, 99,198,140,193,189,123,247, 48,125,250, -244,204,148,148,148,125,135, 14, 29,122,239,147, 79, 62, 97, 58,119,238,140,180,180, 52,108,216,176,129, 11, 11, 11,251,198,209, -209,113, 65, 53,247, 49, 86,173, 86,215,213,106,181,200,204,204,132,121, 74,134,163, 71,143,226,216,177, 99,169, 57, 57, 57, 93, -212,106,245, 3, 75,194,230,227,227, 99, 27, 28, 28,236, 30, 19, 19,131, 29, 59,118,192, 96, 48,124,241,228,201, 19,131,189,189, -253,175,235,214,173,155,235,235,235,235,244,202, 43,175,160,125,251,246,160,148,226,224,193,131,152, 55,111,222,159, 86, 86, 86, -175, 71, 69, 69, 25,170,161, 31,188,112,225,194,133, 46, 46, 46,111,190,245,214, 91, 76,112,112, 48,194,195,195,193,113, 28,186, -119,239, 94, 42,174,142, 30, 61,250,219,209,163, 71,135, 0,144, 40, 20, 10,249,127,221,189, 50, 67,171,213, 34, 38, 38, 6,238, -238,238,104,216,186, 29,166,223,126,140,243,151, 46,131, 82,138,142,119, 30,163,160,160, 16, 91,182,108, 65, 68, 68, 4, 88,150, -133,175,175,111,181,156, 6,131, 1, 15, 30, 60, 64,122,122, 58, 6, 13, 26,132,145, 35, 71,226,235,175,191,134,193, 96,192,236, -217,179,145,149,149,133, 77,155, 54,225,193,131, 7, 16,137, 68, 80, 40, 20,127,121, 60,171,210, 34, 47,165,131, 5, 20,183,125, -243, 60, 15,181, 90,141,107,215,174,225,241,227,199,176,177,177,129,198,196,243,107,174, 68,242, 12, 17, 39,113, 20, 23,168, 9, -159, 87,167,196,141, 70, 35, 17,137, 68,184,116,233, 18, 30, 62,124, 8,187,134,180,212,189, 50, 26,141,208,233,116, 40, 42, 42, -130, 88, 44, 46,184,124,249,242,147,240,240,240,250, 34,145,168,210, 81, 96,105,141,216,173, 39, 78,158,250, 52, 56,208,191,113, -143,206,243,112,232,208,151,200,201,203, 67,161, 78,132, 2,141, 1,133, 90, 10,149,109, 3,180,105, 25,132,244, 76, 61,238,223, -137, 72,204,144, 56, 85,219, 6, 99,228,152,220,223,214,190,111, 63,112,200, 68,200, 61, 94,129,254,241, 78,240,154,212, 82,129, - 37,145,219,194,206,165, 14,242, 10, 52,184, 24, 29, 11, 35,199,228, 90,122,211, 99, 99, 99,243, 84, 42,213,226,139, 23, 47,126, -101, 30,249,115,238,220, 57, 60,122,244,104,177, 90,173,206,171, 97,109,182, 7,128,237, 0,228,110,110,110,169,239,191,255,190, -178, 87,175, 94,242,206,157, 59,131,101, 89, 92,191,126, 29,239,191,255,254,113,133, 66,241,186, 37, 35,243,164, 82,105,106,110, -110,174,189, 76, 38,131,209,104, 68, 74, 74, 10,238,221,187, 7,141, 70,131,212,212, 84, 16, 66,212,161,161,161,154, 90, 60, 56, -207,140, 34, 52,143, 10,170, 68,136, 89,172,176,188,188,188, 58,247,235,211,185,249, 55, 43, 87, 67, 83, 84,128,176,203,135,144, -157,149,129,141,155,247,182,240,242,242,234,108,105,103,226,196,196,196,223,247,238,221, 59, 45,160, 89,179, 32, 95,111,111,220, -138,123, 12, 9,207, 65,202,113, 96,245, 90, 48,156, 14, 94,205, 41, 24, 70,129,212,148,124,172, 63,126,250,118, 98, 98,226,239, -213,241,122,246, 29,136, 17,113,185, 32,132,224,120, 39,127,200, 21, 10, 72, 20, 54,104,191, 39,180, 84, 84, 61, 89,246, 25, 36, - 54, 10, 56,182,170,126, 98,204,212,212,212,162,134, 13, 27,134,223,189,123,183, 85,147, 38, 77, 48,127,254,124, 36, 36, 36,128, - 82,138,180,180, 52,109,122,122,122, 82,102,102,230, 19, 66,200, 62,181, 90,189,217,210,217,194,121,158,119, 59,120,240, 32, 0, - 72, 0,224,212,169, 83, 80,169, 84,176,183,183, 71, 94, 94, 30, 70,141, 26, 37,155, 51,103, 14, 0,224,250,245,235, 98,185, 92, - 94, 41,215,157, 27,247, 86,100,231,209,108,166, 48,226,245, 12,211,141, 22,221,122, 39,162,103,255, 49, 56,113,104, 11, 78, 31, - 59, 9, 23,241,227, 88,206,170,224, 72,122,108, 70,126,114, 97,163, 13,254, 33,239,177,234,130, 99, 27, 39, 13,114, 20,121, 41, -249, 93, 51,190,175,122,226, 94, 74, 41, 88,150,125,166, 67,123, 77,197, 85, 89,204,157, 75,121, 2, 66,234,139, 69, 55,146, 82, - 18,122,171,220,189, 74, 43, 23,241,241,241, 72, 72, 72, 64,195,134, 13,241, 56,238, 17,164, 82,201, 13, 11,243,253, 91,253,251, -247,183,213,235,245,216,191,127,191,137, 16,210,255,224,193,131,225, 1, 1, 1,162,174, 93,187,218,110,217,178,229, 45, 0,155, -107,210, 98,164, 80, 40, 36, 70,163, 17, 91,183,110, 69, 82, 82, 82,231,148,148,148,104,149, 74,181,225,131, 15, 62,248,222,207, -207,175, 97,116,116,244,125,141, 70, 51, 81,173, 86,223,172,142, 44, 39, 39,103,116,159, 62,125,118,241, 60,239,211,161, 67, 7, -155, 17, 35, 70,216, 81, 74,225,231,231,135,195,135, 15,171,213,106,181,197,125,152,226,226,226,242,207,159, 63,159,234,239,239, -239,174, 84, 42, 33,145, 72,150, 41,149,202, 69, 10,133,226,155, 1, 3, 6, 56,237,220,185, 19,187,119,239,134,141,141, 13, 98, - 99, 99,213,119,239,222, 93,229,225,225,241,157, 37, 51,184, 71, 68, 68,196, 2, 24,209,186,117,235,121,223,126,251,237, 23, 12, -195,188,125,252,248,241,210,185,206,204,226,170, 94,189,122,163,119,237,218, 53,242, 37, 51, 66,140,122,189, 30,206,206,206, 72, - 79, 79, 71, 90, 90, 26,234,212,169,131,118,237,218,193,104, 52,226,192,161, 63,113,254,252,121, 80, 74,225,226,226, 2, 59, 59, - 59, 68, 70, 70, 2, 64, 85,163,135,141, 6,131, 1, 78, 78, 78,200,201,201, 65,100,100, 36,220,220,220, 48,117,234, 84,232,245, -122,236,220,185, 19, 55,110,220, 0,195, 48,112,117,117,133,173,173, 45,110,220,184, 81, 29,167,128,154, 10, 44,150,101,207,156, - 57,115,102, 72,203,150, 45, 69,247,239,223,199,253,251,197,207,155, 70,163, 49,137, 88,236, 78,189,185,127, 68, 21,110, 74,243, -178,115,101, 72,165,210,245, 67,134, 12,153, 56,118,236, 88, 76,154, 52, 9, 12,195,224,199,235, 58,196,199,243, 48, 24, 12, 72, - 77, 77,197,173, 91,183,104,171, 86,173, 8,207,243,134, 46, 93,186,140,139,136,136,104,205,178,108, 94,101,156,116,215, 46,206, -165,197,192, 65,235,214,111,190,244,206, 59,239, 56, 13, 28,180, 14,215,163,238, 32,167,176,184,149, 73,229, 98,131, 54, 77, 62, - 67, 90,166, 14,199,142, 28,202,230, 77,218, 55,232,237, 29,198,170,194, 9, 0,233, 69, 26,183, 13,219,246, 46,223,177,103,223, -184,241,163, 71,200,187,116, 25, 13,113,254, 45,112,153, 17, 80, 53,234, 0,194, 90,227,106,228,117,220,124,144,160, 45,210,178, -155,243, 12,154,207,170,227, 44, 11,134, 97,214,108, 90,191,122,201,209, 19,161,172,193, 96, 64,191, 62,221, 57,134, 97,214, 84, -227, 78, 61,195,105,109,109,189, 35, 50, 50,210, 73,167,211, 33, 49, 49,177,126,227,198,141, 65, 41, 69, 92, 92, 28, 86,173, 90, -101, 58,124,248,240, 58,185, 92, 62,189,178, 26, 98,121, 78,163,209,184,125,235,214,173, 51, 63,252,240, 67,121, 90, 90, 26,238, -222,189,139,194,194, 66, 24, 12, 6, 68, 68, 68,104,141, 70,227, 14, 11, 92,180,103,194,105, 22, 88, 78, 78, 78,158,109,219,182, - 53,143, 34,244,228,121, 30,142,142,142, 94,173, 91,183, 14, 7, 0,123,123,251, 10, 71, 17, 86,117, 63, 19, 19, 19,207, 54,106, - 80, 7, 91, 55,175,132,193,160, 67,114, 82,177,211,144,145,153,139,170,196,213, 51,121,137, 82,170, 84, 42, 95,255,118,213,170, - 43, 19, 70,191,237,209,169, 91,119, 36,220,140,132, 62, 43, 29, 12,103,130,152,138, 80,148,102,133,212,212, 2, 44, 57,124, 50, - 77,163,213, 62, 35, 90, 43, 11,103,105,179,160,157, 45,100, 10, 5,164, 37,174,149,249,152, 84, 97, 11,177,141, 2,172, 68, 82, - 81,103,248,230, 21,204, 41,247,198,248,241,227,111, 30, 62,124,216,113,196,136, 17, 24, 56,112,224,245,156,156,156,174, 89, 89, - 89,150,116, 20,175,144,147, 97,152,180,126,253,250,185,233,245,122,211,176, 97,195, 68, 25, 25, 25, 48, 15,177,207,207,207,199, -145, 35, 71,208,164, 73,241,170, 51,119,238,220,129,191,191,127,165,156,239,125,126, 43, 9,192,194,169, 67,189,190,185, 18,153, - 50, 5,192,178,250, 13,189,112,250,216, 73,156, 63,125,105, 70,219,230,252,234, 87,223,106,189, 64,222,237,205,207,252,131,223, - 99, 21,118, 74,108,219,187,135,141,138,248, 97,177,182,240,182, 47,128,207, 42, 11, 39, 33,164,120,165,250, 50,226, 74, 36, 18, -161,168,168,200, 34,113, 85, 85, 94,162,160,212, 37,143,124,241,206,212,161,237, 78,237,184,106,107, 99, 99, 83,218,231,167, 65, -131, 6, 16,137, 69,248,113,223,154,194,156,156,140, 57,150,112,218,216,216,124,216,181,107, 87, 60,122,244, 8, 55,111,222,220, -163, 86,171,111,170, 84,170, 61,177,177,177,195, 90,183,110,141,223,127,255,253,195,202, 4, 86,101,156,230, 25,235, 75,220,222, -172,146,102,242, 72, 0,109,107, 26,247,146,201, 66, 59, 0,128,159,159, 95,194,224,193,131,237, 76, 38, 19, 74,196,179,115, 77, -242, 18,165,148, 87,169, 84,223,133,133,133, 45, 13, 12, 12,196,240,225,195,123,134,135,135,247, 12, 8, 8,128,175,175, 47,178, -179,179, 17, 26, 26,250, 11,207,243, 31, 36, 39, 39,107,171,170, 68, 85, 22,247,176,176,176, 7, 0, 70, 5, 7, 7,191, 41, 18, -137, 96,103,103,199, 38, 37, 37,177,199,143, 31, 7,128,241,187,118,237,226,106,147,238,207,209, 98,240,151,115, 18, 66,102,143, - 30, 61,122,195,251,239,191, 47,111,221,186, 53,114,115,115, 75, 69,255,225,195,135, 81, 50, 18, 27,206,206,206,120,240,224, 1, -246,237,219,167,207,205,205, 93, 37,145, 72,150, 85,197, 57,106,212,168,167, 56,205,226,237,208,161, 67, 48, 15, 34,113,118,118, -198,253,251,247,177,119,239, 94,109,110,110,238, 74,189, 94,255,245, 95, 25,247,255,119, 2, 43, 43, 43,235,163,153, 51,103,118, -125,247,221,119,157, 53, 26, 13,235,226,226, 2,181, 90,109, 58,118,236, 88, 86,126,126,254, 71, 53,185,216,165, 75,151, 38,245, -239,223,127,213, 79, 63,253,180,105,211,166, 77,157,135, 15, 31,142, 81,253,250, 97, 98, 59, 27,232,116, 58, 16, 66,112,236,216, -177,123,103,206,156,169, 47,145, 72,116,115,231,206,229, 1, 92,169,142, 55,227,214, 31,247,221, 91, 12,238,188,122,205,247,187, -131, 66,218,250,212,173, 87, 87,214,193,219, 30, 6, 35,135,212,180, 76,156,189, 20,165,187, 31, 21,153,192, 27,244, 67,211,162, -170,159,197, 29, 0,162,162,168, 1,192, 71,254,254,118,243,191, 94,255,219,250,159,119,237, 25, 60,110,248,235,162,224, 22, 93, -241, 56,229, 0,206,133,159, 49,101,231,211,125,249,122,118, 66, 84, 84, 94,118, 77,111,124, 98, 98,162,182, 97, 61,207, 92,173, - 86,235,244,248,241, 99,164, 38,171,243, 18, 19,147,180,181,105,118,211,233,116,120,244,232, 17, 78,158, 60,137,235,215,175,227, -226,197,139,134,227,199,143,255,196, 48,204,226,202, 38,154,172, 12,205,155, 55,255,234,135, 31,126, 24,194,113,156,111,151, 46, - 93,228, 78, 78, 78,200,200,200, 64, 88, 88,152,254,198,141, 27,143,154, 55,111,254,117,109, 51,155,135,135, 7,134, 14, 29,234, - 22, 28, 28,236,102, 30, 49,232,237,237,141, 55,222,120,195, 45, 32, 32,160,116, 95,157, 58,117, 80,147,169, 26, 74, 28, 44,188, -243,222, 39,208,104, 10,112,229,210, 33,228,100,101,224,242,181, 24,212,196,193, 2,138, 71,122, 42,149,202,182,139, 86,173,222, -219,167, 77, 43,191,198, 42, 15,153,115,189,186,176,113,245, 64, 86,102, 38,174, 68, 62, 52,174, 61,113,246,182, 70,171,125,221, -210,145,158, 60,207,151,142,114,243,159, 50, 3, 12,195,148,174,130, 96, 62,110, 23,210, 17,140, 72, 12,142, 2, 6,131,161, 90, -247, 78,173, 86, 39,122,122,122,190, 49,121,242,228, 83, 91,183,110,101,186,116,233, 18,248,199, 31,127, 60,215,162,185,137,137, -137, 94, 37,174,104,158,157,157,157,104,204,152, 49, 48, 26,141, 40, 42, 42, 66, 94, 94, 30, 50, 51, 51,117, 31,127,252,177, 12, - 0, 36, 18,137,177, 79,159, 62,213,190, 63, 86,238, 74,212, 78, 29,234,181,218, 69,252,120, 88,110,250,205,250, 46,226,199,177, -109,155,243,171, 87,238, 74,212,126,245,190,227,162,164,244,208, 24,117,193,177,141,219,246,238, 97, 71, 15,126,131, 83, 42,238, -207,112,241,198,174,174, 3, 45,120,121,149, 19, 88,181,117,174,158,121,159,220,166,215,235,183,179, 95,218,117,104,235, 89,139, -166,173, 80,184,184,186,192,100, 50, 33, 54,254, 17,126,218,187,182, 48, 95,151,189, 56, 51,138,134, 91,194, 85,191,126,253,122, - 44,203,226,192,129, 3, 0, 96,158,218, 96,237,145, 35, 71,134,189,245,214, 91,168, 83,167,142,127,221,186,117,101, 85, 77,163, - 81,145,123,103, 52, 26,241,162,215,181, 38,132, 60,138,140,140,244,244,244,244, 36, 59,118,236, 40, 48, 24, 12,243,106,241,140, -175,248,243,207, 63, 59, 81, 74,251, 4, 5, 5,193,199,199,167,228,125, 26,133,243,231,207,111, 79, 74, 74,122,231, 5, 45,238, - 76, 9, 33,200,203,203, 51,207,107, 98, 80, 40, 20, 47,229,162,209, 73, 73, 73, 63,187,187,187, 31,155, 55,111,222,151, 13, 26, - 52,248, 96,252,248,241,108,227,198,141,145,155,155, 11, 59, 59, 59, 40,149, 74, 36, 37, 37,225,231,159,127,230,210,210,210,126, - 98, 24,102,190, 90,173, 86,215,150,211,209,209, 17, 74,165, 18,137,137,137,102,206, 77, 70,163,113, 65,122,122,122, 42, 4,212, -236,153,178,228, 33, 45,153,166,225, 59,142,227,186,154, 93,173,172,172,172,143, 82, 82, 82, 50,106,171,238,251,247,239,223, 32, - 35, 35, 99,147,193, 96,232, 60,112,224, 64, 12, 31, 62, 28, 3, 6, 12,192,240,225,195, 89,179,107,117,224,192,129,187, 53,225, - 52, 47,246,204,176,146,254,148,210,150, 0, 8, 97,152,106, 23,123,182, 68,137, 7,249,219,249, 90,201,248,205, 86, 82,190,163, - 70,207, 92,208,232,152,113,215,163,242, 30, 61, 79,205,166,100, 97,231, 95, 1, 64,103,164,111, 39, 36,168, 79,212,244,126,150, - 52, 17,238, 32,132,176,148,210, 53,148,210, 29, 74,165,242,145, 37,182,123, 5,156, 12, 80, 60,185,232,201,147, 39,191, 36,132, -188,173,211,233, 92,101, 50, 89, 58,165,244,151, 30, 61,122, 44, 88,189,122,117, 85,188,124,101,225,244,246,246,254, 77,165, 82, - 53, 50, 59, 69,101, 11, 11,243,183,121,127,201,124, 68, 15, 19, 19, 19,223,178,244,126, 54,240,245, 58,230, 91,207,179,151,111, - 61, 21, 0,224,209, 99, 53, 30, 61, 78, 58,254,240, 81, 98,239,218,164, 81,217,197,158, 73,201, 84, 12,212,130,197,158,203,115, - 54,107,214, 44,156,101, 89,175,154, 60,148, 60,207,171,111,223,190, 29,100, 73, 56, 85, 42,213, 8,111,111,239,101,106,181,122, -111, 66, 66,194, 39, 47,162,230,173, 82,169,218, 51, 12,115,152,231,121,171,242, 14,151, 89,132,121,120,120,248,200,100,178,167, - 58,185, 87,197,249,245,236,230,115, 58,116,238, 52,248,226,217,243,251, 62, 95,124,123, 97,217, 99, 31, 14,118, 26,251,214,164, -143,190,254,109,221,119,159,175,221,151,245, 83,117,225,108,217,178,101, 40,128, 70,102, 55,171, 42,112, 28,167,190,125,251,118, - 72,109, 92, 7,231,150,164,149,131,141,203, 66,189,193, 16,192, 16, 80,177, 68, 18,153,147,147, 49,167, 34,113, 85, 25,167,151, -151,215,178,134, 13, 27,126,244,240,225,195,237, 9, 9, 9,239,150,185,199,223,212,173, 91,119, 82, 66, 66,194,218,132,132,132, -207, 44, 77,163,250,245,235,219, 5, 4, 4,100,207,159, 63,159,153, 59,119, 46,194,194,194,156, 18, 19, 19,179, 95, 68,186,251, -248,248,120,200,229,242,109, 60,207,251,114, 28,183,238,209,163, 71, 43,106,195,233,239,239, 47,201,201,201,249,200,219,219,123, -170,187,187,187,123,106,106,106, 92,124,124,252,210,148,148,148, 31, 44, 21, 87,150,164, 81,112,112,176, 14, 40, 94, 78,204,146, -254, 86,255, 85, 7,171, 92,126,242,229,121,126,113, 64, 64,192,144,177, 99,199,146,232,232,104,156, 56,113, 2, 79,158, 60,217, - 71, 41,157, 85, 89,147,110, 77, 57,143, 29, 59, 70,227,226,226,118, 49, 12,243, 69, 98, 98,226,163,191, 43,238, 47, 29,204,211, -238,255, 21, 31, 0,205,171, 59,231,213, 87, 95,109,208,186,117,235,208, 22, 45, 90,240, 45, 90,180,200,127, 17,156,127, 69, 56, -205,159,206,157, 93,108, 94, 52,231, 95, 17,206, 90,114, 50,207,249,249,199,227,222,176, 97, 67,106,214,112, 47,105, 26,253, 39, - 57,215, 47,106,161,186,122,242,205,111, 55,127,213,220,179,252,177,121,147, 29,109, 79, 29,120,253,235,121,147, 29,109, 95,198, -184, 3, 96, 42,217, 79,106,195,233,237,237,189,225,181,215, 94,227,188,189,189, 55,253,155,227, 14,128,248,248,248,200,132,231, -232,197,115,186,187,187,135, 40,149,202,131, 74,165,242,160,167,167,103,235, 23,204,185,223,195,195, 35,232,159,136,251,203,246, - 17,253,211, 2,239,208,161, 67, 15, 1,116, 25, 56,112,160, 27,203,178,255,250, 69, 58, 67, 67,211, 11, 95, 98,189,253,159,183, -216,239,223,191, 79,132,106,211,191, 15, 31,204,190,169, 6,240, 73,235,238,207, 30, 43,153,154,225,243,110, 3, 95,206,184, 87, -230,218,212,118, 33,230,248,248,248, 15, 84, 42,213,212,154,140, 62,252,135,226, 77, 1,232,132,220,255,226,145,146,146, 18, 14, - 96,192,191,157,243,255, 59, 68,255,150,128,252,241,199, 31,105, 66,114, 8, 16, 32, 64, 64,245,248,183,139, 43, 1, 2, 4, 20, -207,148,218,188,146,218,135,197,109,171,132,144,230, 53,189,112,117,252, 2,167,192, 41,112, 10,156, 2,167,192, 41,112,190,124, -156,213,113,191, 44,125,187,200,139, 30,137, 82,254,230,253,215, 59, 21, 10,156, 2,167,192, 41,112, 10,156, 2,167,192,249,215, -115,190,108, 96,132, 91, 32,224,175,198,154,113,196,115,205, 56,226,249, 87,157, 47, 64,128, 0, 1, 2, 4,252,219, 32,122,217, - 34, 20, 18, 18,226, 79, 41,125,139, 16, 50, 4, 0, 40,165,187, 9, 33,191,133,135,135, 91, 52, 3,173,149,149, 85,138, 86,171, -117, 3, 0,185, 92,158,166,213,106,149,101, 69,123,153, 15, 80,188,214,166,121,212, 90,165, 86, 96,253,250,245, 83,116, 58,157, - 37,235,235,221, 32,132, 92,231,121, 62, 66,161, 80, 92,184,127,255,126,140,165,241,238,217,179,231, 7, 54, 54, 54,115, 52, 26, -205,215,199,142, 29,251,238,175,190,207,132,144, 54,222, 42,143, 45, 70,147,129, 79, 73,203,154, 77, 41, 61, 80,209,121,223,191, - 75,150,138, 72,241,164,145,223,191, 75,150, 79,252,145,206,172,138,183,166,231, 87, 17,190, 16,177, 88,252,161,187,187,123,223, -196,196,196,112, 0,159, 83, 74,133, 89,136, 5, 8, 16, 32, 64,192,191, 79, 96,181, 11,118,110, 76,120,195,103, 98,150,118, 50, -114,228, 60,101, 36,203, 47, 71,100,198, 60, 79, 0, 84, 42,149, 55, 33,164, 11,165,212,143, 97,152, 91, 60,207, 31, 87,171,213, -153, 53,225, 8, 14, 14,246, 6, 48, 28,192,136,182,109,219, 54,159, 48, 97, 2, 26, 54,108, 8,173, 86,139,176,176,176, 25,191, -254,250,235,140,224,224,224,219, 40, 94, 82,102, 71, 68, 68, 68, 66,101, 92, 90,173,214,205,172,149, 8, 33,110, 67,134, 12, 9, - 43,179, 8, 47, 49, 47, 46, 75, 41,189, 2,224, 50, 33,228,210,142, 29, 59, 18,155,184, 89,181,173,235,237,250,234,145,240,184, -217,229, 57,117, 58,157,219,141,131,251, 64, 77, 28, 10,146,226,209,224,245,225,165,199, 78,188,222, 29,180, 48, 15, 98,153,228, - 70,215, 63, 46, 93, 7, 16, 17, 31, 31,127,189, 78,157, 58, 49, 85,113,150, 71, 96, 96,224,130,121,243,230,185, 12, 28, 56,240, - 67, 0,149, 10,172,154,112, 86, 33, 94,100,109, 67, 90,158, 57,184,103,135, 28,132,193,107,131,135,108, 39,132,140, 42,191,152, -244,247, 99,136, 59, 97,241,217,132,143, 39,176, 0,240,253,170,245,159,175,122,155,172,254,248, 23,154,226,233,233,217,149, 82, -250,121, 9,223,215, 73, 73, 73,103,190, 31, 67,220,193, 96,250,132,143, 39, 16, 0, 88,191,106,253,103,223,143, 33,223, 77,220, - 66, 83,107, 24,190,137,239,188,243,206,234,197,139, 23,179, 37,147,240,245,241,247,247,111, 76, 8,241,167,148, 10,157,131, 5, - 8, 16, 32, 64,192, 63, 47,176,154, 55,183,119,176, 98,232, 84, 43, 41, 29,222,167,147,127,189, 1,125,219,147,250, 13,234, 35, - 38, 58,198,247,204,217,107, 99,186,182,182,125,172,209,147, 29, 26,158,172,188,125,187,234,245,195,230,140, 35, 70,147,169,248, -154, 34, 17,184,109,199,189,246,245,232,209,163,222,216,177, 99, 17, 20, 20,132,240,240,240,174,187,118,237,250,200,219,219,251, -154,209,104, 60, 44,147,201, 66,171,155,225, 56, 56, 56,120,153,167,167,231,231,211,166, 77, 35, 33, 33, 33,144,201,100,165,199, - 20, 10, 5,186,119,239,142,238,221,187, 35, 37, 37,165,121,104,104,104,243,223,126,251,109,105,112,112,240,215, 17, 17, 17, 51, - 44,185, 65,115,230,204, 9,174, 96,247, 49, 66,200, 67,134, 97, 34,154, 54,109,154,216, 80,169,104,226,238,234,124,232,171,197, -243, 1,160, 82,225,178,191,119,123, 0,120, 74, 96, 25, 50, 82, 33,183, 85,220,144, 88, 89, 93, 7, 16, 1,224,122,157, 58,117, -110, 88,202, 9, 0, 93,186,116,145,217,218,218, 18, 74, 41, 90,183,110,237,212,187,119,239, 24,134, 97,190, 59,114,228,200,250, -178,231,213,132,179, 26,180,153,247,217, 36, 73,198,163, 27,184,123,233, 56, 6, 5,123,202,175,223,185,183, 8,192,158,170,133, - 15,195,108, 13,119,153,241, 49,240, 17,207,243,115,162,163,163, 59, 3,128,159,159,159, 20,192,153,109, 97,142,253,222,105,159, - 91,235,105, 22, 8, 33, 18,150,101,215,109,219,182,237,189, 81,163, 70, 33, 46, 46, 14, 23, 46, 92,128, 66,161,192,130, 5, 11, -234, 78,155, 54,109, 41,128,143,132,199, 94,128, 0, 1, 2, 4,252,163, 2,171, 83,176, 77,216,224,206, 13,130, 7,246,110,207, - 52,244,243,135, 68,102, 93,122,172, 69, 80, 16, 90, 4, 5,145,241,227,243,235, 71, 94,143,252,226,232,169,171,179, 58, 5,219, - 68,156,143, 40,108, 93, 25,159,201, 4,209,210,197,191, 1, 0,182,109,126,139,141,137,137,169,103,101,245,191,201,162, 59,119, -238,140,206,157, 59, 51, 75,151, 46,109,115,230,204,153, 54, 59,118,236, 48,120,122,122,174, 74, 74, 74,218, 85, 69, 48, 63,223, -181,107, 23, 97, 89, 22, 44,203, 86,122,146,135,135, 7,122,246,236, 9, 15, 15, 15,242,217,103,159,125, 14,160, 66,129, 37,151, -203,211, 8, 33,110, 0,224,232,232,200,205,155, 55, 47,146,150, 0, 0,120,158,191,194,178,236,101, 66,200,149,189,123,247, 38, - 53,240,180,242,180,149, 89, 31,223,180, 97, 13,140,121,169, 78,149, 93,191, 72,157,104, 86, 1, 79,237,151,218, 88,223,144,218, -216, 92,151, 42, 20, 17, 0,174, 3,184, 97, 41,167, 89, 92, 89, 89, 89,157,219,176, 97,131, 35, 0, 76,158, 60,217,161,168,168, -200, 97,220,184,113, 51, 0,148, 10,172,154,112, 86, 33, 96, 28, 58,181, 11,121,178,122,217,151,118, 65,109, 58,226,202,238,239, -145,147, 83,136,194,252, 34,240, 60,255,204,202,191, 19,183,208,212,239,223, 37,203,191,255,118,253,116,194, 48, 36,160,247,231, -232,237, 68,167,168, 84,170, 59,132, 16,177, 84, 42, 53,243,138,188,188,188, 84,141, 27, 7, 46,111,216,177, 9,214,127,183, 14, -148,231, 41,128,229,150,186, 87,132, 16, 55, 91, 91,219, 3,199,143, 31,111,211,170, 85, 43, 92,185,114, 5,143, 30, 61,194,164, - 73,147,244,147, 38, 77,146,140, 30, 61,154, 76,157, 58,117, 50, 33,100, 55,165,244,162,240,232, 11, 16, 32, 64,128,128,127, 76, - 96,201, 37, 92,171,121,171, 35,193, 21, 62, 4, 53,198,131, 26, 82,158, 57,199,218,193, 27, 77, 3,220, 97, 45,117,101,110, 69, -127,219,170,236,177,234, 70, 24,152,197,213,238, 21,170,102,154,194,100, 9, 0, 88,217, 40, 13,111, 76, 77,186,211,170, 85, 43, -184,186,186, 74, 46, 93,186, 52, 21,192,174, 42, 56,137,254,102, 56,238, 14,232,128, 6,119,179, 96,109,109, 13,115,193,109, 70, - 76, 76, 12,206,157, 59,135,184,184, 56,248,250,250, 2,255,235, 67,245, 12,167, 70,163,241,232,211,167, 79,232,215, 95,127,253, -202,178,101,203,110,109,223,190,189, 11,165,180,168, 66,119,175,142,189,131,148,138,143,111, 94,255,173, 24,250, 66,167,123,215, - 46,162, 89,223,247, 43, 12,103,189, 1,111, 96, 66, 78,113,211,227, 78,127, 21,228,118, 10,200, 20,182, 55,122, 30,187, 86,234, - 92, 1,184, 97, 41,103,183,110,221,198,136, 68,162,217, 0,236, 55,110,220,232,224,224,224,192, 28, 56,112,192,176, 97,195,134, -124,137, 68,162, 39,132, 44,169, 77, 56,171,130,152,101, 23,126, 51,239, 51, 59,107,198,132,235,135,127, 65, 98, 92, 60,110, 62, - 72, 50,254,126, 62,138,211, 27,185,177, 21,221,207,137, 63,210,153,211, 6,203,182,132, 39,251, 30,236, 63,119, 82,163, 69, 3, -221, 97, 48, 24, 54,167,167,167, 99,220,184,113,224,121, 30, 29, 59,118,236, 64, 41, 77,154, 50,101, 10,124,125,125,177,249,143, -251, 69,162,188,171, 93,126, 61,149, 23,110, 73, 94, 34,132, 52,247,241,241, 57,126,230,204, 25,119, 79, 79, 79,132,134,134, 34, - 37, 37, 5, 74,165, 18,147, 38, 77,146, 46, 91,182,108, 91, 94, 94,222,208,197,139, 23,203,111,223,190,189,131, 16,226, 93,162, -153, 95,248, 8, 24,129, 83,224, 20, 56, 5, 78,129,243, 47, 65, 43, 0,174, 0,210, 1, 92, 43,183,141,146,223,168, 96, 59,163, -164,204, 47,187,120,121, 6,138,251, 79,187, 2,224, 0,132, 1,200,126,209, 1, 22,149, 20, 80,157, 1,132, 2,152, 79, 41,157, - 87,254, 36, 67, 82, 40,164,117, 95, 7,228,205, 64,245, 15,193,235,147, 64,197,110, 40, 44,146, 35,227, 73, 28,238, 94,217, 13, -106, 42,170,254, 98, 34,152,214,172,122, 75,100,107, 13, 72,100,174,134,252,252,124,216,216,216, 64, 83,152, 44, 25, 61,174,212, -217,146,156, 57,115, 6, 17, 17, 17, 80,169, 84,213,138, 64, 0,160,250,226, 86, 68,189, 94, 15,189, 94,143,148,126,173, 97,211, -246, 21,100,191, 61, 9, 39, 79,158, 68,122,122, 58, 36, 18, 9, 36, 18, 9, 76,166,234, 39,139,103, 74, 86,226, 53,155, 86, 21, -157,227,229, 69,228,182,156,213,161, 53, 43,151,216,217, 41,172,221,195,143,239, 71, 92, 92,138, 69, 55, 93,106, 99, 13,169,149, -245, 13,169,141,213, 83,226,170, 38,156, 44,203, 46,216,179,103,143,167, 78,167,131, 68, 34,193,238,221,187, 13, 91,183,110,189, - 83, 88, 88,216, 41, 34, 34, 66,243, 34,194, 89, 30,206,174,174,127,190, 62,242,253, 73,139,222,237, 9, 77,161, 22,251,206, 71, -225,212,173,199, 3, 1, 92,160,148, 86, 58,195,253,138,125,186, 7,158,158,158,221,199,141, 27,119, 99,239,222,189, 46,223,124, -243, 13, 56,142,131,201,100,130,201,100, 42,253,205,113, 28,182,111,223,142, 11, 87,163,166,168,213,121, 22, 45,166, 75, 8, 81, -213,171, 87,239,228,213,171, 87, 93,173,173,173,113,226,196, 9,228,228,228, 96,226,196,137,165,206, 85, 78, 78,206,240,245,235, -215,191,241,228,201,147,111,206,159, 63,159, 9,128, 5,240,175, 95, 53, 64,128, 0, 1, 2,254, 63,161, 26, 45,226, 74, 8, 57, - 68, 41,237, 15,160, 7, 0,105,153,109, 16, 66, 14,149,148,219, 79,109,207,152, 49, 99,214,210,165, 75,239,152,183,205,231,204, -156, 57,179,217,178,101,203,150,180,107,215,110,199,165, 75,151, 98,255, 50,129, 5, 32,148, 82, 90,105,223, 23,221,195, 95,161, -139,253, 29, 18,101, 87, 72,235, 15,131,216,165, 29, 18,238,133,226,198,201,149, 72,188,127, 1,148,231,224,238,221,180,218,139, - 45,220, 76,197, 42,149, 42, 66,173, 86,227,250,245,235,120,248,240, 33,228,242,103, 90,150,112,234,212, 41, 0,128,187,187,187, -101,130,165, 85, 7,120, 71, 38, 35, 33,160,120,192,159,119,100, 50, 0, 96,201,204,153,144, 74,165,144, 72, 36,165,231,114, 28, -103, 73, 34,155, 5,150,121,148,224, 51,199, 27,184,219,238,154, 59,227, 67,159,122,190, 13, 85, 87,255,220,137,216,216, 36,164, -166, 90,150, 62, 50,133,205, 13,153,173,205,117,169,213,255,154, 5,107,193,185,115,232,208,161, 99, 6, 15, 30,108,213,182,109, - 91,217,143, 63,254,152, 83, 94, 92, 61,111, 56,203, 66,169, 84,246,126,245,213, 87,255, 28, 63,126, 60, 6,245,233,129,183, 58, -250,209,196,180, 92, 13,128, 19,148,210,106,111,106, 82, 82, 82,146,167,167,103,207,215, 95,127,253,215,102,205,154,249, 81, 74, -209,180,105, 83, 12, 26, 52, 8,123,246,236, 65, 84, 84, 20,242,243,243, 13,231,207,159, 95,165, 86,171,127,178,240, 97,180,118, -116,116, 60,122,250,244,105, 87,107,107,107, 28, 63,126, 28, 69, 69, 69,207, 56, 87, 75,150, 44,145, 63,126,252,120,237,177, 99, -199,234,162,120, 93, 56, 65, 92, 9, 16, 32, 64,192,191, 15, 85,106, 17,179,112,162,148,246, 47, 43,152,202, 11, 45,243,111,243, -121, 75,151, 46,237, 95, 86,124, 1,192,178,101,203,150,148,217, 46,250, 43, 34, 99, 22, 88, 93, 8, 33, 20, 64, 23, 74,233,217, -114, 54, 96,241, 15,222, 4, 67,210, 9, 24,146, 78,192, 58, 96, 54, 14,172,126,251, 41, 34, 75,156,161,138,160,213,106, 33,150, - 58, 27,182,109,126, 75, 2, 0, 28,181, 49, 60,115,237,234, 28,172, 26, 76,150,106, 73, 56, 9, 33, 76, 25, 94,238, 89,247,202, -107, 69,187, 14,109, 58, 54,108,209,218,250,234,209,189,120,112, 63, 14, 25, 25,185, 0,133,182, 50,206, 19,195,250,162,240, 81, - 12,172,236,236,110,244, 62, 29,249,148,115, 85, 27,206, 19, 39, 78,124,218,174, 93,187, 57,187,119,239, 86,251,250,250,202, 68, - 34,145,161,172,184,170,109, 56,203, 66,165, 82,117, 16,137, 68,199, 25,134,177,234,211,167, 15,166, 76,153,130,239,190,251,206, -196,139,229,253,215, 31, 13, 31, 90,160, 51,204,182, 68, 92,149, 17, 89, 55, 1,248,215,173, 91, 87,102, 50,153,186, 14, 24, 48, -224,112,191,126,253,112,249,242,101,156, 60,121,178,145,193, 96, 72, 46,185,238, 2, 0,238, 12,195,124, 93,197, 74,238,140, 68, - 34,217,113,242,228,201,102, 42,149, 10, 39, 78,156, 64, 81, 81, 81,169,115,245,206, 59,239, 60,229, 92, 93,186,116, 41, 83, 16, - 87, 2, 4, 8, 16,240,175, 70,165, 90,164,172,251, 84,145,200,178,176, 82,110, 22, 95,154, 25, 51,102,204, 34,132, 28, 42,113, -184, 52, 0,212,127,137,192, 42,137, 8, 41,137, 88,181,163,184,184,252,216,103,246,241,124,237,203,173, 70, 61,142,221,177,178, -178,194,250,245,235, 97,109,109, 93, 99,225, 84,120,120, 47, 18, 38,141, 44,117,174,204, 78, 22,122,143,174,173,192, 50, 59, 88, - 87, 80,174,137,208,203,203,235,195,150, 45, 91,190,187,105,235,175,182,203,230,124,158,155,119,247,142, 72, 91,164,179,209, 25, - 77,134,135,169, 25,149, 78,143, 96,202,203,129,204,198,230,134,216,218,170, 34,113, 85, 43,206,203,151, 47,107,187,119,239,190, -101,201,146, 37,109,121,158,223,250, 34,194, 89, 86, 92, 57, 59, 59, 31, 91,187,118,173,149,149,149, 21,116, 58, 29,190,254,250, -107,156, 58,117,170,127,114,114,242, 49, 0,199,106,155,222, 6,131,225,189, 30, 61,122,124,251,233,167,159,194,104, 52, 98,216, -176, 97,120,242,228,201,241, 7, 15, 30,124,231,229,229,245,233,196,137, 19, 85, 46, 46, 46,152, 48, 97,130, 4,192, 59,149,208, -124,245,219,111,191,245, 15, 8, 8,192,217,179,103,145,155,155, 11,165, 82,137, 15, 63,252, 80,186,116,233,210,109,249,249,249, - 67,151, 46, 93, 42, 56, 87, 2, 4, 8, 16,240, 31,129,165, 90,164,172, 19, 85, 67,126,243,255,196, 75,151, 46,189,179,116,233, -210,167, 28,174,191, 68, 96,149, 68, 6, 0,186, 88,226, 14,241,154,103,251,240,240,156,169, 38,145,180,232, 60, 75,154,243,128, -255,245,193,170, 64, 40, 61,179, 93,131, 62, 88,199, 40,165,151,202, 10, 44, 47, 47,175,215, 60, 60, 60,190,250,237,183,223,172, -212,106, 53,188, 26, 55,183,255,115,207,239, 58,119, 27,153, 54, 49, 43,107,116,100, 82,193,238,202, 56,121,109,225, 13,185,141, -226,186,220, 90, 81, 94, 92,213,154, 19, 0, 78,157, 58, 53,173, 2,135,237,185, 56, 85, 42, 85, 7, 23, 23,151, 99,107,215,174, -181, 86,171,213,144, 72, 36, 80, 40, 20, 56,125,250, 52, 74,196, 85,173,225,229,229, 53,111,242,228,201,115,223,121,231, 29,100, -103,103,227,228,201,147,232,218,181, 43,214,174, 93,235,115,250,244,233,111,219,183,111, 15,150,101,113,226,196, 9, 24,141,198, -251,149,164,235,224,241,227,199,127,250,198, 27,111, 32, 44, 44, 12,201,201,201,152, 48, 97,130,254,195, 15, 63, 44,237,115,245, -253,247,223,191,241,248,241, 99,193,185, 18, 32, 64,128,128,255, 8,170,210, 34,229,240, 39,128, 87,203,187, 90,229,197,151,217, -161, 42,187, 93,254,252,146,227,218,191, 34, 62,102, 7,171,114,215,138,114, 96,157, 90,130,203,186, 89, 70, 96, 37, 63,117,138, - 68,166, 0,103,129,112,153, 51,142, 24,103,188, 5,209,207, 11, 24,136,165,206,134, 70, 61,142,221,169,236, 92,133, 66, 1,158, -231, 45,210, 97,146,126,111,176, 13,122,191,134, 71, 45, 60, 64,141,134, 82, 39, 11,179,102, 61, 37,174, 36, 18, 9,244,122, 61, - 80, 65,179, 95, 57,132, 17, 66,158,176, 44,123,153, 82, 74,187,116,233,178,217,104, 52,190,166, 80, 40, 28,199,141, 27,103,200, -200,200,192,190,125,251,176,101,203, 22, 77,129, 65, 20,158,157,105,124,251,145,186, 32,177, 10,190, 27,175,158,189,243,148,115, -245, 2, 56,159,193,139,224, 84,169, 84, 29,220,220,220, 74,197,149, 76, 38,131, 66,161, 64, 82, 82, 18, 68, 34,209,115, 77,210, - 89,183,110, 93, 89,155, 54,109,166,143, 30, 61, 26,119,239,222,197,140, 25, 51,146,213,106,245,222, 3, 7, 14, 76,152, 58,117, -170,168,115,231,206, 72, 75, 75,195,134, 13, 27,140, 97, 97, 97, 75, 82, 82, 82,150, 87,152,105, 69,162,247, 22, 46, 92, 72,213, -106, 53,121,244,232,209, 83,206, 85, 94, 94,222,208,165, 75,151,202, 99, 99, 99, 5,231, 74,128, 0, 1, 2,254, 91, 14, 86, 85, - 45,104, 25, 37,226, 41,181,130,109,182,140,176, 42,191,157, 86,110, 27, 0,244,229,142, 71,254,101, 2,171, 50, 24, 57, 38,247, -183,181,239,219, 15, 28, 50, 17,114,143, 87,160,127,188, 19,188, 38,181, 84, 96, 73,228,182,176,115,169,131,188, 2, 13, 46, 70, -199,194,200, 49,185, 85,241,153, 76, 16, 77,254,248,127,163, 5, 29, 28, 28,144,155,155,251,148,163,101,109,109, 13,149, 74,133, -188,188, 60,236,222,189, 27,213,205, 89, 68, 41, 93, 56,122,244,232, 47, 39, 78,156,200, 52, 24, 49, 22, 5, 87,206, 63,227, 90, -201,229,114, 88, 89, 89, 33, 41, 41, 9,247,238,221,227, 41,165, 11,171, 81,209, 87, 25,134,185,177, 99,199,142,196, 46, 93,186, -188,227,232,232, 56, 98,236,216,177, 86, 97, 97, 97, 88,184,112,161,232,196,137, 19,134,107,215,174,153, 56,142,155,150,148,148, -180,193, 2, 85, 94, 94, 92, 61, 55,103, 5,226,234,185, 57, 85, 42, 85,123,149, 74,117,236,187,239,190,179, 78, 73, 73,129, 76, - 38,131,173,173, 45,226,227,227,177,112,225,194, 66,147,201,212,231, 57,243,155,204,198,198, 70,102, 52, 26,177,117,235, 86, 36, - 37, 37,181, 75, 78, 78,142,247,240,240,216,240,193, 7, 31,172,246,243,243,107,122,239,222,189,251, 5, 5, 5,147, 82, 82, 82, -238, 86, 70,226,224,224,208,206,213,213,149, 92,190,124, 25, 19, 38, 76,208, 79,158, 60,185,180,207,149,224, 92, 9, 16, 32, 64, -192, 75,137,176,106,182,255,117,168, 82, 96,165, 23,105,220, 54,108,219,187,124,199,158,125,227,198,143, 30, 33,239,210,101, 52, -196,249,183,192,101, 70, 64,213,168, 3, 8,107,141,171, 55,174,227,230,195, 4,109,145,150,221,156,103,208,124, 86, 78, 88, 84, -185,218,118,110,110, 46,234,214,173,139,227,155,155, 52,211,107,211, 36, 65, 78, 0,129,189,225,196,233,126,119,206,157, 59, 87, - 0, 96,115,163, 70,141,118, 85,197,121,253,250,245,249,129,129,129, 7,102,206,156,185,180, 81,163, 70,125,198, 47, 88, 7,201, -199,163,161,137,186, 9,235, 46, 67,225,224,224,128,172,172, 44,132,135,135, 35, 63, 63,255, 40,165,116,230,141, 27, 55,110, 85, -197, 73, 41,189,210,180,105,211,196, 54,109,218,216,234,245,250,239, 62,249,228, 19,171,194,194, 66,100,100,100, 32, 51, 51, 19, - 87,175, 94, 61, 97, 52, 26, 63, 74, 77, 77,125, 92,133,168, 42,229,228,121,190, 84, 92,189, 40,206,178,120, 81,156, 54, 54, 54, -159,237,219,183,239, 41,231, 42, 46, 46, 14, 11, 22, 44, 40,212,106,181,125,212,106,181, 69, 19,116, 86,149,238, 60,207,195,100, - 50,129, 82, 10,169, 84,154, 7, 0, 37, 98,170,187,165,156, 25, 25, 25,161, 79,158, 60, 25,100, 99, 99,131,201,147, 39, 75,151, - 44, 89,178, 45, 55, 55,183,198,206,213,255,231, 85,235, 5, 78,129, 83,224, 20, 56,255,109,156, 47, 27,170, 20, 88, 81, 81,212, - 0,224, 35,127,127,187,249, 95,175,255,109,253,207,187,246, 12, 30, 55,252,117, 81,112,139,174,120,156,114, 0,231,194,207,152, -178,243,233,190,124, 61, 59, 33, 42, 42,175,218,177,255, 34, 17, 76, 51,103,191, 37, 2, 0,177, 24,166, 89,253,251,135, 54,107, -214,172,227,192,128, 52,201,132,201,197,206,214,250, 53,111, 73, 66, 67, 67,119,201,100,178,141,177,177,177,121,150, 68,162, 68, - 48,245,109,213,170,213, 43,159,126,250,233, 87,253,234,121,181, 30,220,174, 11,196, 98, 49,174, 93,187,134,172,172,172, 48,134, - 97,166, 95,191,126,253,156, 37,124, 7, 14, 28, 72, 4,128,162,162,162,133,141, 26, 53,146, 70, 71, 71,227,225,195,135,136,137, -137, 1,199,113, 15, 18, 19, 19,107,212, 33, 78, 46,151, 95, 5,112,231, 69,114,150,197,139,226,212,104, 52, 75, 22, 45, 90,212, -107,254,252,249, 50, 91, 91, 91,220,184,113, 3,243,231,207,175,145,184,170, 14,148, 82, 24,141,198, 26,141,252,172, 0,211, 3, - 2, 2,154, 44, 90,180,168, 81, 73, 95, 46,193,185, 18, 32, 64,128, 0, 1,255, 29,129,245, 63,161,149,151, 13,224,205, 32,127, - 59,223, 37,235,126,221,108, 37,229, 59,106,244,204, 5,141,142, 25,119, 61, 42,239,145,165, 23, 91,184,153,138,203,110, 47, 0, -224,239,239,111,147,224,129, 2,243,190,132, 84, 64,173, 86,127, 93,155,200, 92,187,118,237, 28,128, 54, 65, 65, 65,131, 15, 19, - 50, 11,136, 5,165,116,201,245,235,215,247,213,132,167,117,235,214,117, 11, 11, 11,127, 54, 24, 12,129, 60,207, 75,207,158, 61, - 11,173, 86,139,232,232,104, 13,207,243,187,107, 26,174,216,216,216, 59, 47,154,243,175, 8,103, 98, 98,226, 53,149, 74,213,131, - 16,114,114,250,244,233,178,154, 58, 87,213,193,201,201,169, 40, 37, 37, 37, 83,171,213, 58,167,166,166,234,157,156,156,106, 53, -247, 8,165,244, 1, 33,164,197, 39,159,124,178,224,211, 79, 63,253,236,171,175,190,146, 8,125,174, 4, 8, 16, 32, 64,192,127, - 78, 96,153, 81, 34,166,186,116,233,226,106,115,225, 82,122,225,139, 8, 64, 84, 84, 84,225,156,113,164,212,217, 18,137,158,127, -134,237, 18, 65,181,175,182,255,207,207,207, 95,146,149,149,213, 54, 47, 47,207,244,248,241, 99, 13, 33,196, 68, 8,209,240, 60, -191,128,231,249, 13, 47, 51,167, 90,173,190,232,225,225,209,233,226,197,139, 83, 11, 11, 11,215,170,213,234, 75, 47, 42,179, 69, - 68, 68, 24,149, 74,229,200, 1, 3, 6,140,229,121,126, 67, 82, 82,146,177,182, 92,148, 82, 61,128,233,132,144,189,183,110,221, -218,121,233,210,165,100, 65, 92, 9, 16, 32, 64,128,128,255,164,192, 50, 35, 52,244,197,136, 43, 51,202, 59, 91,255, 52,238,221, -187, 55, 28,192,240,255,143,156, 0,144,146,146, 18,254, 87,240, 2, 64,114,114,242,113, 0,199, 95, 20, 31,165,244, 26, 33,164, - 30,138, 71,137, 8,226, 74,128, 0, 1, 2, 4,252,119, 5,150, 0, 1,255, 38,148, 44,105, 36,136, 43, 1, 2, 4, 8, 16,240, -175, 1, 1,208,188,146, 66,203,226,209, 1,132,144,230,181, 40, 20,111, 11,156, 2,167,192, 41,112, 10,156, 2,167,192,249,255, -139,179, 58,238,151,101,116, 34,121,206,209, 92,213,222, 60, 97, 8,171,192, 41,112, 10,156, 2,167,192, 41,112, 10,156,255,223, -192, 8,183, 64,128, 0, 1, 2, 4, 8, 16, 32,224,197,162,198,125,176, 90,183,110,221, 16, 0,194,194,194, 30,252, 85,129, 34, -132,124,168, 84, 42,199,181,108,217,210, 79, 34,145, 48,185,185,185,243, 67, 67, 67,231, 87,116,110, 64, 64, 64,120,175, 94,189, -124,207,156, 57,163, 47,249, 47,202,126,115, 28,151, 24, 30, 30, 30, 34, 36,245, 63, 3,165, 82,121, 76, 46,151,251, 20, 79, 48, - 74, 97,226, 57,112, 60, 5,199,241, 48,114, 20, 6,189, 54, 78, 87,152,219,187, 86,220,129,175,215,225, 56,126, 41, 5, 93, 79, - 40,153, 64, 9, 93, 79, 40,249,128, 50,100, 61,225,233,251, 16,153,190,129, 73,244,169,136, 23,207, 86, 71,237, 74,120, 25,238, -231,252,249,243,159,171, 82, 52,119,238,220, 10,215,159, 10, 10, 10, 58, 36,151,203, 27, 84,246,191,162,162,162,228,200,200,200, -174, 47,115, 94,245,240,240,120,133, 97,152, 53, 0,154,149, 59,116, 23,192, 71,106,181,250,212,191, 45,204,110,110,110,231, 88, -150,109, 84, 88, 84, 84,152,159,151,231,107,107,107,251,200,202,218,198,134, 51,113,247, 51, 50,210, 94, 17,222, 64, 2, 4,252, -139, 5, 86,112,112,112, 99, 0,157, 9, 33,157, 41,165,175, 52,109,218,212,189,168,168, 8,193,193,193,169,132,144,115, 37,171, - 95,159,141,136,136,136,121, 17, 1, 98, 89,118,249,119,223,125, 55,109,242,228,201,165, 34,233,246,237,219, 85,157,239,181,108, -217, 50,251,248,248,120, 72, 36, 18, 72,165,210,210, 15,203,178,104,219,182,109,141,174,239,228,228,100,235,230,230, 54,159, 16, - 50,148, 97, 24,182,186,243,121,158,231, 40,165,187,210,210,210,230,102,101,101,229,215,228, 90,173, 66, 90, 26, 1, 82,201, 53, - 40,119, 45,252,102,149,163, 43,155, 52,105, 18, 46, 18,137,188,202, 10,202, 50, 34,181,194,223, 28,199, 37,222,185,115, 39,196, -210,123, 33,183,182,254,140, 48,162, 30,160,124,211, 98, 50,230, 46,229, 77, 39,181, 69, 69,203, 45,137,175, 76, 38,243,137,184, -126,189, 81,212,189, 88,248,214,175, 3,189,193, 4,157,222,136, 3, 39,175, 33,192,175, 30, 6,246,235, 89,235,188, 98,226,201, -188,217, 31,190,221,109,201,154,237,173,102, 77, 30,161, 88,178,102,123,200,172,201, 35,108,151,172,221, 30, 50,123,202, 91,182, -139,214,252, 22, 50,123,202, 91,246,139,215,252,166, 7,240, 94,109,174,241,110, 11,159, 66,134, 51,201, 42, 76,123, 86,164,251, -241, 86,156,205, 63,241,224, 46, 89,178,164,177,193, 96,136,126,103, 88,200,194,166, 13,221,210, 42, 58, 39, 55, 55,205,237,225, -221,240, 57, 16, 75,252,252, 90,207,170,242,249,148, 72, 36,245,207,157, 59,215,200, 60,211, 62,199,113,224, 56, 14, 38,147, 9, -122,189, 30,111,188,241,198, 11, 25, 16, 19, 18, 18, 50,150, 82,186,184, 56, 91,146, 69,225,225,225,107,159,163, 34,166, 16,137, - 68,159, 72,165,210,206, 38,147,201, 15, 0,196, 98,113,180, 78,167, 59,107, 50,153,190,165,148, 22,212,132,143, 97,152, 85, 97, - 97, 97,254,182,182,182, 48, 24, 12,165, 11,195,179, 44,219,180, 77,155, 54,235, 0, 52,178,148,203,203,203, 43,156, 16,226, 85, -147,235, 83, 74, 19, 19, 19, 19, 67,106,248,190,108,244, 36, 94,237, 86,183,142, 10, 0, 96,109,109, 99,115,237,246, 99,183,224, -102,117,133,210, 77,128,128,127,171,192, 10, 14, 14, 62, 12,160,115,211,166, 77,173,122,246,236,137,160,160, 32,248,248,248, 64, - 46,151, 3, 0,178,178,178,220,163,162,162,222,188,113,227,198,155,151, 47, 95, 70,112,112,176, 6,192,133,136,136,136, 10,221, -136, 30, 3, 58, 77,150, 43,100,223, 1, 64,122, 82,102,114,226,163,180, 53,201,201,201,203, 41,165,124,153, 23,166,239, 59,239, -188, 51,117,202,148, 41, 56,116,232, 16,182,111,223, 14,157, 78,135,220,220, 92,132,134,134, 86, 24, 78,142,227, 18, 71,141, 26, - 37,138,137,137, 49, 85,230, 96,213,176, 70, 56,127,216,176, 97, 31,251,251,251,151, 46,235, 98, 52, 26, 75,191,179,179,179, 49, -117,234, 84,243, 11, 17, 60,207,227,244,233,211,147, 63,255,252,115, 0,248,164, 34,206,158,157, 27,132,139, 8,241,226,255, 39, -202, 18, 79,156,123, 20, 2, 16,246, 90,120, 36, 41,247,146, 5, 0,180,110, 21, 88,173,184, 19,137, 68, 94,215,175, 95,119,147, - 72, 36, 22,197,141,231,121, 4, 5, 5, 89,116,174,167,167,103, 87, 27,133,221,246,193,195,223,117, 12, 12, 10, 18,123,169,148, - 48,154, 76,136,125, 28,223, 58,242, 70, 68,224,241,131,191,143,243,244,244, 28,145,148,148,116,166, 42, 30, 35,199, 35,242,206, - 3,156,184,112, 29, 3, 36,114, 20,105,245,200, 47,210,227,231, 63, 46, 34, 49, 45,183,214, 25,183, 77,155, 54,158, 54, 34,151, - 54, 83,222,123,205,230,155,239,183,217, 76,121,239, 53,172, 88,255,115,233,247,228,119, 7, 97,249,247,219, 20, 83,222, 29,132, - 53, 27,182,180,107,211,166,141,231,213,171, 87,147, 42,227,171, 44,141, 24,206, 36,219, 28,149,196, 2, 64,250,134, 13, 48,164, -166, 66, 53,119, 46, 0, 96,124, 51, 47, 89, 77,194,220,188,121,243, 82, 65, 92,165,112, 52,153, 18,111,223,190, 29, 82,157,184, - 50,153, 76, 84, 36, 18,205, 57,127,100,254,238,246,173, 27, 63,117, 51, 99,238,199,216,207,251,114,238,144,157, 71,243,233,155, -125,108,163,163,195,150, 84, 41,178,120,158,103,116, 58, 29,238,223,191, 95,225, 44,251, 12,195,112,181, 73,167, 46, 93,186,200, - 10, 11, 11,127, 83, 40, 20, 45, 11, 11, 11,199, 82, 74,191, 12, 13, 13,117,103, 24, 6, 61,122,244,248, 50, 36, 36,228,177, 76, - 38,251, 94,171,213,222, 80, 40, 20, 35, 66, 67, 67,117, 22,138,171, 87,108,109,109,127,222,191,127,191, 99, 80, 80, 16,147,145, -145,129,122,245,234, 33, 43, 43,171,245,185,115,231,130,223,125,247,221,119, 9, 33,163, 40,165,231,106, 16,220, 38, 54, 54, 54, -116,244,232,209,132,227,254, 23,221, 31,127,252, 17,193, 13, 82, 27, 76, 24, 98, 85,164, 53,208,220,243, 55,229, 31, 80,134, 94, -120,242, 36, 39,183,138,240,121,205,223,252,145,155, 84, 42,133,209,104, 44,253, 80, 30, 0, 5, 40, 15, 80,158,130, 82, 0,148, -128,231,120,172,152,185,185,214,207,131,181,141,141,181,135,135, 50,213,202,218,218,154, 10,229,154, 0, 1,255,122, 7,171,111, -104,104, 40, 76, 38, 19,108,109,109,193,178,108,121,119, 3,175,188,242, 10,218,180,105,131, 30, 61,122,224,222,189,123, 86, 95, -125,245, 85,165,118,196, 91,211,250,195,187,145,187, 89, 68, 40,207, 31,186,190,244,135,249,123, 92, 0,124, 90,230,180,177,227, -199,143, 39,153,153,153, 24, 58,116,232, 57,157, 78, 55,136, 82, 90,229,114, 57,145,145,145, 47,180,249,143, 16, 50, 84,169, 84, - 98,199,142, 29,208,235,245,207, 28,183,179,179,195,157, 59,119,202,214, 32, 17, 24, 24,200, 18, 66,134, 86, 38,176, 24, 66,188, -142,132, 62,112, 51,111, 15, 27, 24, 40,233,213,185, 65,170,136,145, 82, 0,100,246,236,217,165,226,138, 82,138, 5, 11, 22, 88, - 28, 94,137, 68,130,187,119,239,130,101, 89, 60,234,216,184,184, 32,191,158, 0,150,101, 17,217,178,184, 86,219,238,126, 54, 68, - 34, 17, 20, 10,133,165,226,170,139,187,210,107,255,204,185, 75,109,181, 70,138, 63, 79,135, 33, 94,125, 2,148, 82, 40,221,156, -208, 62, 56, 72,236,215,162,165,219, 79,235,150,239,247,244,244, 28,148,148,148, 20, 90,185, 88,224,224,215,184, 62,182,238, 63, -135,197,223,239, 70,102,158, 22,249, 69,197,247,181, 71, 59,127,252,184,162,246, 78,103,211,250,245,189,183,238, 60,134,246,109, - 91, 99,235,206,163,104,215,182, 53,182,238, 42,222,222,182,235, 24, 58,181,107,131,109,187,142,161,185, 95,163, 58,153, 79,114, -151,163,138,185,189,158, 73,163, 65,197,105, 84,143,149, 16,115,218, 60,153, 48, 1, 0, 74, 5, 86,141, 31,182, 18, 65, 92,221, -121, 85,137,224, 50,226, 10,105,105,105, 36, 39, 39,135, 58, 56, 56, 12, 41, 43,178,204,226,234,247, 35,121,208,196,172, 33,191, -254,122,150, 31, 57,178,115,116,116,216, 18, 63, 96,110,133,139,104, 27, 12,134,199,189,122,245,162, 0,160,215,235, 61,165, 82, -169,164,156, 0, 83,117,232,208,225, 25,129, 86, 93,211, 97, 97, 97,225,111,187,118,237, 26,236,238,238,142, 65,131, 6, 29,247, -247,247,151, 90, 91, 91,227,200,145, 35,240,242,242,114,177,179,179, 59,188,116,233, 82,172, 92,185,178,206,241,227,199,183, 3, - 24,108,193, 51,218,163,107,215,174, 59, 14, 29, 58, 36,151, 72, 36,208,104, 52,184,115,231, 14,236,237,237, 33,149, 74, 49,104, -208, 32,182,125,251,246,206, 93,187,118,221, 67, 8, 25, 65, 41, 61,105,105, 26,105, 52, 26, 58,115,230, 76, 88, 91, 91,195,198, -198,166,244, 99, 37,229,200,250,121,245,173, 62, 94,150, 98, 53,251,243,145,203, 54,253,116,240, 76,157, 58,246, 95,198,199,231, -230, 84,234, 98,177, 45, 48,227,211, 25,102,129, 10,169, 84,250,148,203,110,254, 45,145, 72, 16, 24, 24, 88,109,216,252,252,252, - 54,176, 44,235, 90, 78,248,178,115,190,152,101,186,117,231,158,141,209, 4, 27,173,222,136, 69, 11,190, 52,177, 12,203, 54,111, -222,124, 31,165, 52,253,206,157, 59, 31, 8, 69,157, 0, 1,255, 46,129, 5,133, 66,129,107,215,174,129, 16, 2, 91, 91, 91,216, -217,217,193,222,222, 30,121,121,121,136,138,138,194,221,187,119,241,248,241, 99, 48, 12, 3, 95, 95, 95,160,120,218,135,178,110, - 76,105,219,222,111, 43, 14, 65,174,144,129, 16,160, 85,207,150, 8,233, 22,128,219, 87, 31,125,164, 82,169, 54,171,213,234,251, -132, 16, 81,243,230,205,223,109,219,182, 45, 86,174, 92, 9,157, 78,247,109, 69,226,170,162, 81, 11, 31, 12, 22,159,151,136, 24, -111,131,137, 79,216,176,207,216, 41, 48, 48, 48, 60, 40, 40,168,222,173, 91,183,140,102, 55,171,124, 51, 89,217,126, 89,229, 57, - 51, 50, 50,192,243,188,197,174, 80, 78,206,179,239,216,114,139, 71, 63,117,108,209,210,149, 14,249,185,105, 88,248,245, 47, 48, - 26,141,152, 54,109, 26,120,158, 7,207,243,224, 56, 14,217,217,217, 64, 5,213,208,242,225, 52,199,137,101,217,167, 4,112,117, -219, 85,113,186,186,186,218,200,228,214,219, 63,157,189,208,246,102, 76, 34, 14,157, 14, 3,165, 20, 7, 54,125, 9, 0, 24, 52, -126, 1,146,146,211,209, 62,184, 41,222,121,255, 19,219, 85, 75,103,111,119,117,117,109,144,158,254,191,201,103,203,114, 26, 77, - 60,118, 31,189,140,228,204, 2,140, 26,220, 13, 58,189, 17,105,169,201,216,242,253, 55,152, 56,102, 47, 28, 21, 86, 30,190,190, -190, 49,101,239,145,173,173, 45,171,213,106,207,197,196,196,188, 87, 89, 56,141, 70, 99,223,153, 31,143,195,170,205,187,209,204, -215, 29,135, 78, 92, 65,171,230, 62, 56,124, 58, 12,237, 90,212,195,209,179,225,104, 31,224,139, 51,151,111,227,163, 15, 70,226, -179,143,206,245,173, 81, 26, 45, 89,233,144,159,151,134, 63,151,108, 67,218,218,181,136,155, 60, 25,173, 74,242,196, 53,134,129, -196,211, 19,176,171,254,126, 86,132,187,119,239, 66,167,123,214,168,145,201,100,104,218,180,105,149,156,102,231, 42, 53, 53,149, -164,166,166,194,198,198,134, 68,223,185,205,249, 53,107, 62,132,203,218,185, 25, 0,138,157,171, 60, 20,221, 91, 13,205,253, 53, -144,228,220, 98, 54, 45,120, 95, 63,254,203,141,209,230,103,180,124, 56, 35, 35, 35, 75,239, 79,219,182,109,239, 94,184,112,161, - 73, 25, 23, 24, 38,147, 73, 98, 50,153, 26,153,155, 13, 77, 38, 19,116, 58, 29, 70,140, 24,193, 86, 21,119, 43, 43,171,150,238, -238,238,184,122,245, 42,230,205,155, 39,109,214,172, 25,238,223,191, 15,134, 97, 48,118,236, 88,248,251,251, 35, 61, 61, 29,173, - 90,181,194,249,243,231, 3, 45,200,243,182, 54, 54, 54, 63, 29, 60,120, 80,206, 48, 12,242,243,243,193,243, 60, 58,116,232, 0, - 66, 8,110,221,186,133, 47,190,248, 2,123,247,238,197,254,253,251,173,130,131,131,127, 34,132,248, 81, 74,243, 45, 72, 35,170, -211,233,168, 92, 46,135, 92, 46,135, 76, 38,131, 76, 38,131, 68, 34,129, 70,207,226,253,185,143,117, 98,153,130,111,217,194,183, -193,196,241,131,153,133,203,182,156, 6,112,160, 50, 78, 53,189, 3,167,102, 4,199,183,132, 99,208,132, 87, 32, 17, 75, 33, 17, - 75, 32,149, 72, 33, 46,249, 45, 17, 75, 32, 21,203,192,186,104,171,205, 75, 98,177,216,229,250,245,235, 14,101,159,101,147,201, - 20, 61,121,242,100,223,193, 3,251,187,239,220,123,136,125,123,216, 32,206,195,221, 45, 35, 33, 33,238, 1, 0,135,224,224, 96, - 90,211,252, 89, 83, 8,156, 2,231,223,132, 86, 0,202, 86, 48,244, 0,164,230, 98,187,228,221,230, 92,110, 63, 0,164,155,139, -183, 74,182, 51, 0, 68, 1,240, 43,217,199, 1, 8, 3,144,253,188, 1, 22,149,188,180,104,153,155, 70, 42,184,145,200,203,203, - 67, 94, 94, 30, 18, 18, 18,176,126,253,122,136,197, 98,136, 68, 34,136, 68, 34, 48, 12, 83,218, 95,161, 50,156, 60,120,126, 13, -128, 53,193,193,193,226, 31, 46,239, 62, 60,123,235, 71,221,219,244, 12,102,195, 79,220, 26, 2, 96, 17,128,190,163, 71,143,118, - 1,128,109,219,182,101, 0, 56, 98,177,139, 35, 98,188, 87,127,247, 75,157, 41, 31,189,109, 22, 20, 94,155, 55,111,118, 76, 76, - 76,124,170,150, 40,145, 72,170,237,151, 69, 41,221,245,224,193,131,143,149, 74,101,105, 65, 82,182,153,208,100, 50, 65, 46,151, -151,138, 33,157, 78,135,223,126,251,205, 68, 41,221, 85, 5, 39, 98,238,156,194,253, 59,103,192,113,252, 83, 98, 74,171,213, 98, -222,188,121,165,238, 21, 0, 76, 40,113, 74, 44, 69, 85,206, 21,203,178,184,224, 91,172, 4,250,165,211,103,250,106,149,135, 88, - 42,159,214,239,245,145, 78, 38,202,150,138,171,226, 56, 20,139, 11,169, 88, 4, 43,153, 24,247, 31, 37,160,158,103, 48,186,247, -121,205,241,228,225, 61,211, 0, 84, 56, 8,193,200,241,232,215, 37, 24,223,239, 56,131,188, 2, 45,242,114,178,144,145,112, 23, -209, 55,195, 32,149, 74,113,229,202, 21, 91,123,123, 7,219,250,245,235,129,227,120, 92,184, 18, 14,107,107, 43,236,216,254,107, - 61,159,122,245, 17,247, 56,246,189, 74,132,173,168,125,136, 31,242, 50,226, 33, 18,137,208, 62,168, 1, 68, 34, 17, 58, 4, 55, - 2,203,178,232,216,170, 9, 88,150, 69,231, 54,254,104,208,160, 1,120,158, 23, 85,243,178, 64,204,237, 83,136,137, 58, 3,202, -243,224,248,226,230, 95, 10,192,144,156,252,108,188, 82, 82, 64,237,220,106,243, 82,194,244,233,211,115,212,106,181,161,252, 49, -149, 74, 37,217,187,119,175, 67, 85, 83,167, 72, 36, 18, 63,145, 72, 20,157,149,149,197, 91, 91, 91, 51, 28,103,226,253,154, 53, -103,207, 31,153, 95,186,246,228,188, 5,243,119,191,217,199,110,200, 47, 91, 14, 82,137,107, 7, 66, 88,153,105,220,151, 27,165, - 16, 75,252, 44,172, 52, 48, 58,157, 14,247,238,221,171,118, 81,238,138,222, 23,229, 28,172,119, 6, 13, 26,116,252,131, 15, 62, -144,155, 43, 47, 34,145,168, 84,244, 63,124,248, 16, 12,195, 96,211,166, 77,208,233,116,213,102,124,145, 72,244,241,158, 61,123, -236,165, 82,105,169,184,162,148,130,101, 89,220,189,123, 23, 43, 86,172,192,232,209,163, 17, 31, 31, 15,165, 82,137,105,211,166, - 41,150, 45, 91,246, 49,138,151, 62,173, 14, 55,245,122,125,136,149,149, 21,100, 50, 25,204, 66, 11, 0, 34, 30,186,223,142,141, -141,109,225,227,227,226, 81,207,255,214, 31, 93, 58,182, 12,112,118,118,104,103, 22, 88, 21, 86, 80, 11,234, 32, 63, 70,132,206, -157, 59,227,236,217,115,232,223,191, 63, 56,137, 4,188, 84, 10, 94, 42, 5,149, 72, 0,169, 20, 68, 42, 5,181,182,182, 40,251, -176, 44,139,148,148,148,167,246,141, 31, 63, 62,110,228,200,145,110, 0,133, 90,157, 68, 63,249,120, 74, 82, 70, 70, 6,117,119, -119, 23, 44, 4, 1,255, 41, 84,163, 69, 92, 9, 33,135,202, 28,239,111,222,158, 49, 99,198,172,165, 75,151,222, 33,132, 28, 42, -187,223,124, 94, 9,247,161,138,182, 75,254,235, 60,115,230,204,230,203,150, 45, 91,210,174, 93,187, 29,151, 46, 93,138,125, 97, - 2,139, 82, 74, 8, 33,180,186,151,101,121,231,228,233,166, 32,203, 38,210,142,136,136, 48,122,122,122,254,112, 55, 60,182,123, -147,144, 70,176,178,145,245, 36,132,172,145,201,100,159,140, 26, 53, 10, 87,174, 92,193,237,219,183,127,172,201,178, 39, 6, 19, -159, 48,229,163,183, 97, 48,241, 9,102,135,106,218,180,105,146, 11, 23, 46, 24, 42,115,176, 42,227, 74, 75, 75,155, 27, 22, 22, -134,170, 58,185,191,249,230,155,101, 11,163,210, 78,238,149,190, 21,121, 10,131,193,136,194, 66, 77,177,176, 42, 41,188, 57,142, - 67, 97, 97, 33,134, 13, 27, 86, 42,186,120,158, 71, 90, 90, 90,173, 18,147, 97, 24,139,157,171, 74, 57, 88,182,119,203,128, 32, -241,233, 75, 55,159, 42, 92, 95,123,127, 17,164,146, 98,113,101, 37,151,192, 74, 38, 70,130, 58, 21, 77,253,154, 73,206,158, 56, -212,187, 82,129,101,226,176,230,215, 19, 0, 33,216,125,232, 52, 66,234, 89, 99,254, 23,211, 49,116,232, 80, 72,165,114,236,217, -179, 11,203,215,109,197, 4, 31, 31, 80, 0,109, 66, 2,241,245,134, 29, 88,184, 96, 1,179,107,231,238,142,213,133, 87, 44, 22, -131,101,217,210, 66,187,252, 55,203,178,176,100,174, 55,202, 83, 24,140, 70, 20, 21,106,192,241, 60,120,158,130,242, 60, 64, 41, - 60, 23, 47,134,231,226,197,184,198, 20, 15,224,243, 47, 44,132, 70,163, 1,186,180,172,177,184,210,235,245, 80,171,213,134,200, -200,200,103, 74,191,128,128,128, 84,189, 94, 95,101,120,103,205,154, 21,179,100,201, 18, 63, 39, 39,167,232,155, 55, 35,141, 45, - 91, 6,136,203,247,193,106,220,168,113,238,188, 5,243,119,191, 61,102,192,144, 13, 95, 12, 55,125, 48,247,103,145, 37, 29,221, -203,184,100,143,123,244,232, 97, 81, 87, 30,141, 70,147, 82,217,177,144,144,144,177,132,144,197,141, 27, 55,150,117,235,214, 13, -231,206,157,195,226,197,139,121,147,201,148, 1, 0,237,219,183,119, 93,184,112, 33,137,138,138,130,131,131, 3,210,210,210,182, -134,132,132, 44,172,170,227,187, 84, 42,237,210,170, 85, 43, 70,167,211,149, 86, 74, 24,134,193,221,187,119,177,108,217, 50,140, - 24, 49, 2,141, 27, 55, 46,125,182,186,118,237, 42, 94,189,122,117, 23, 75, 4, 22,195, 48, 31,117,239,222,253, 27, 20,143, 34, - 44,251,146,139, 6,240, 25, 0,196,197,101,164,140,120,163,253,157,238,157,131, 66, 26,212,243, 84, 86,197,151, 41,126, 8,101, -144, 21, 36, 98, 9, 70,127, 62, 16,135, 14, 29,194,164,121, 35, 75,156,172, 98, 7, 75, 44,150, 64, 34,150, 66,234, 90,187,133, - 8, 74,222, 35,196,206,206, 30, 0, 96,111,111,111,126,199, 17, 0,148, 97, 24,161, 75,150,128,255, 12, 44,209, 34,102,129, 84, - 94,104, 45, 93,186,180,127,249,125,101,197, 84, 69,191,203,254,119,217,178,101, 75,202,112, 23,189,136,248,188,176,165,114,140, -198,170,215,237,237,214,173,219,100, 91, 91,219,239, 74, 94,188,120,114, 49, 9, 79, 46, 38,193,175, 73,179, 14, 65, 1, 33, 57, - 35, 70,140,128,179,179, 51, 62,251,236, 51, 10,224,167,154, 92,123,195, 62, 99,167,178,219, 55,110,220,168,117,191,172,146,145, -113,159,160,146,254, 84,181,204, 52, 48, 26,140, 40, 44,210,194, 96, 48,192,104,228, 96, 50,113, 8,246,183,197,207, 27,167, 67, -175, 55,192,200, 21,239, 43,118,202, 56,200, 36, 58,116,110,235,109, 4, 97, 52,103, 47,199,217, 85,197,223, 44, 34, 30, 44,203, -226,102,128,103,133,206, 85, 79,181,193, 98,161, 69,121,174,137,187,187, 27,226,143, 94, 45,174,133, 91,203,113,108,219, 66,216, - 88, 23,215,228,251,142,158, 85, 44,178,100, 18, 24, 12,122,184,185,215,133,137, 51, 54,169,140,207,100, 52,232, 91, 54,242,132, -131,173, 21, 34,175, 93,198, 39, 31,190,135,177, 99,223,133, 68,110,139,179,103,207, 32, 94,157,134,135,137,217,248,112,238,247, - 48, 26, 57, 24, 76, 28,140, 38, 30,171,182, 28,130,129,171, 94, 25, 73, 36, 18, 76,155, 54,205,170,178,227, 59,118,236,208, 88, - 36,176,104,137, 8, 46,210, 64,167,213, 65,111, 40, 78, 11,174,190, 24,139,190, 24, 9,163,209, 8,205,240,118, 48, 24,141,224, - 62, 26, 12,131,193,128, 4,107, 17,211, 49, 68,101, 4, 97, 52, 23,174, 37,218, 89, 42,176, 42, 11, 15,165,180,194,166,195,202, - 68, 86,203,150, 1,209,163,135,133, 44,189,120,233, 90,250,197, 75,215,158, 57,175,126,227,144, 71, 31, 44,218, 49,179, 38,226, - 10,120,186,185,240, 57,243,253,151,161,161,161,238, 10,133, 2, 49, 49, 49, 96, 89, 22,132,144,204,136,136, 8,119, 0,152, 55, -111, 94,134, 88, 44,118,102, 89, 22, 31,127,252, 49, 88,150,117,157, 52,105,210, 28, 0,149, 10, 44,147,201,228,103,107,107,139, -252,252,252,210,251, 40,149, 74, 49, 99,198, 12,188,253,246,219,165,226, 74, 42,149, 98,235,214,173, 8, 14, 14,134, 94,175,183, -200,185, 75, 76, 76,188, 6,160,147, 5,162,166,184,153,149,231,171,204, 88,138, 66,111,104, 31, 75,193, 73, 36,216,113,224, 0, -222,126,251,109, 72,165,178, 82,231, 10, 18, 9,136, 84, 10, 70, 34, 1,199,202,106,124,127,121,158, 71, 94, 94, 30,187,117,235, -214,250,205,154, 53, 35, 20, 64,211,166,254,228,208,159,127,214, 81, 40, 20,177, 78, 78, 78, 6,161,200, 22,240, 18,186, 92,135, -202,139,172,231,225,154, 49, 99,198, 44, 0,116,198,140, 25,179,204,219, 75,151, 46,213, 0, 80,255,107, 4, 86,117, 14,214,202, -149, 43,209,162, 69,139, 42, 11,159,213,171, 87,227,231,159,127, 94, 73, 41,125, 84,147,107,191,255,154,248,170,181,149, 68, 89, -164, 49, 36,111,220,111,108, 19, 16, 16, 16,222,174, 93,187,250,225,225,225,149, 58, 88,149,205,141,245, 87, 76,211, 64, 41,133, -222, 96, 68, 81,145, 6, 90,189, 30, 83,167,175,179, 40,237, 13,250,124,209,171,125, 94,177,170,206, 73,180,164, 15, 86,117, 77, -131, 79,139,101, 19,204, 26,160,160, 72,139,174, 35,102,224,218, 31,223, 1, 64,169,184,178,146,137, 33,151,138,193, 16,128,160, -114,110,163, 38,111,224,231,147,223, 59,191,254,199,159,189, 94,123,101, 28,166, 76,153, 2,145,212, 26,142,206,174, 48,113, 20, -117, 84,110,120,152,152,141, 61,107,167,151,116, 59,163,120,229,173,121, 88,249,197, 56, 44,159, 87,125,173,158,101, 89,172, 93, -187, 86, 83,222,181, 42,235,100, 89, 42,130,205, 46,163, 70,167,199,167, 51,191,183, 60,141,122,119,178,178,244,222, 86, 52,112, -194, 82, 1, 86, 94,100, 1, 96, 1,160,178, 82, 84,230, 12,248,117,232,247,197, 63,249, 50,228,121, 30,127,254,249,231, 51,238, -106,249, 52,180,212,109,229,121, 30,113,113,113,184,125,251, 54,218,181,107,135,220,220, 92,136, 0, 76,187,117, 11,254,163, 70, - 65, 87,210,117, 65, 42,149, 98,252,248,241,127,209, 27,190,164, 31, 27,169, 58,161, 10,173, 19,225,222, 92,134,159,150,237,195, -228, 5,163,225,218, 84,142, 21, 51, 55,149, 30, 95,254,195,188,146,126, 88, 82,200, 21, 53, 15, 70, 94, 94,158,232,155, 21, 43, - 90,182,105,221,214,234,237,209, 99, 25,189,137,199,162,175,190, 99,119,110,223,230,188,109,219, 47, 86,114,185, 60, 90, 40,142, - 5,188,132, 46, 87,255, 23,201,101,118,176,150, 46, 93,122,103,233,210,165,207,184, 97,127,169,192, 98, 89, 22,101,135, 44, 87, - 84,200, 91,210, 7,107,234,212,169,176,181,181,173,240,152,193, 96,160, 55,111,222,140, 74, 78, 78,222, 76, 41,173,241,188, 56, - 82, 49,227,190,242,155, 45, 94, 83, 62,122,155, 7,138, 71,107,173, 91,183,206,193,220, 7,171,108, 63,172,234,250, 96,185,185, -185,205,255,250,235,175,167,244,237,219,151, 97, 24,230,169,194,207, 60, 45, 67,217,143,209,104,196,193,131, 7,167, 44, 93,186, - 20,149,185, 94,148, 22, 55, 63, 21, 22,105,160,213, 21, 23,176, 15,111,239,182, 52, 7, 84,123,138,217,185,106, 27,147, 85,161, -115,117,212,189,184,224,234,151, 94, 61, 23, 97,216,152,199,113, 9,173, 61, 92, 28,144,157, 91, 0, 89, 73,179,160, 25,102,113, -101, 37,147,192,209, 94,129,172,204, 52,136,197,226,152, 42, 50,112, 28, 33,164,211,176,193,253,142, 51,172, 72, 94,246,152,216, -202,206,250,196,197, 91,142,169,217, 69,224,203,196,147,167, 20,147, 23, 90,102, 98,138,197, 98, 76,154, 52,169, 82,129,115,224, -192, 1, 77,205, 5,150,174,102,105, 84, 3, 39,179, 58, 7,203, 82,129, 85, 30,230,209,133, 18,137,196,175, 68,124, 89,140,128, -128,128, 35,214,214,214,245, 44, 61,223,210, 73, 71, 9, 33, 11,186,117,235,182,216,203,203,203,237,131, 15, 62, 32, 34,145, 8, - 33, 33, 33, 46, 95,126,249,101, 46, 0,248,249,249,217,154,223, 49,171, 86,173, 66,116,116,116, 58, 33,100, 97,149,207,186, 84, -122,215,222,222, 62,164, 91,183,110,200,205,205, 69,124,124, 60, 20, 10, 5,252, 87,172,192,173,137, 19, 17,176, 97, 3,152,110, -221,138, 5,166, 76,134, 91,183,110, 65, 38,147,221,173,140,207,211,211,179, 13,165,244,107, 0, 29,240,191,102, 65, 10,224, 34, - 33,228,243,164,164,164,171,207,252,137, 33, 76,113, 69,173,234,132,146,230,186, 67,151, 32,195, 59,239,188, 3,137, 68, 10, 72, -165,248,244,211, 79,203,188,143,164, 96, 75,250, 99,241,156,212,146,218, 54, 45, 39,214,137, 76, 42,149,141, 30,243, 46,243,249, -167,159,240, 70,147,137, 23,137,196,204,180,217, 75,152,251,247,110,203, 10, 11, 11, 25, 82,147,154,149, 0, 1,255, 17, 7,171, -172,208, 42,227, 66, 85,134,244,178,253,178, 42, 19,104,101,251,100, 1,208,189,136,176,138,202,188,220,203, 63,136,247, 35, 35, - 35, 27, 53,107,214, 12,241,241,241, 21,142,148, 3, 80, 60,132,217,202, 10, 15, 30, 60, 0,128,251,149, 93,232,244,233,211,107, - 0,172, 49,111,171, 84,170,118, 93,134,118,185, 24,208, 45, 8,187,191,221,153,155,156,156, 28, 96,158, 19,139, 16, 66, 84, 42, -213,219, 98,169,232,205, 6,205,235,116,230,120,254,235,211,127, 92,152, 95, 25,119,249, 62, 88, 38,147,169,214,125,176, 8, 33, - 67,251,246,237,203, 68, 69, 69, 97,216,176, 97,248,229,151, 95, 42,189,121,111,191,253, 54,118,236,216,129,222,189,123, 51,203, -150, 45, 27, 90,185,192, 2,140, 6, 19, 10,139,180,208,106,117,127, 89,198,123, 94,231, 10, 0, 40,111, 58,121,235, 70, 68, 96, -139,224,118,226,199, 9, 41,144, 75,197, 79, 9, 44,107,153, 4,114, 89,241, 62, 15, 87, 71,132, 93, 58,107, 48,153,140, 39,171, - 17, 22,113,168, 96,146, 70,153,173, 75, 76,207, 14, 45, 28, 43,116, 60,103,142, 70,139,223, 87, 90, 36,176,126,252,241, 71, 77, -101,238,149,165,247,128, 82,148, 54, 17, 22,105, 94,108, 26,185,187,187,187,186,185,185,173,119,112,112,144,155,251, 14, 85,118, -188, 42,135,171, 58,113, 85, 50, 47, 86,244,146, 37, 75,106, 36,178,164, 82,105,189,139, 23, 47, 54, 50,247, 11,172,234, 91,175, -215,227,205, 55,223,180,200, 22, 12, 15, 15,255, 41, 40, 40,232,161,171,171,235,137,246,237,219,203,162,162,162,176,104,209, 34, - 34, 22,139,237,204,207,101,126,126, 62, 68, 34, 17,178,179,179, 65, 8,121, 39, 60, 60,252,104, 85,156, 58,157, 46, 52, 52, 52, - 52,112,224,192,129,108,116,116, 52, 68, 34, 17,120,158,135,174,109, 91, 4,108,216,128,219,159,124,130, 87, 30, 63,134,206,104, -132, 92, 46,199,209,163, 71, 13, 69, 69, 69,161, 85,196,125,211,229,203,151,155,201,229,114, 24, 12, 6,240, 60, 15,134, 97, 8, -203,178, 29,155, 53,107,182, 26,197, 35,151, 74, 81,175,158,155,219,164,247,250, 53,225,120,158, 75, 82,167,167, 87,233, 86,218, -166,195,213, 79, 86,218,223, 74, 34,150, 64, 34, 42, 22, 86,102,231, 74, 34,150, 64, 34,145, 66, 38,181,168, 9,159,150,207, 59, -230,190, 87, 54, 54,214,124,195,134, 13,163,238, 63,120,232, 15,128,177,183,119,176,184, 95,172, 0, 1,255, 50,135,138, 84, 37, -148,202, 62, 98,101,182,211, 81,188,182,114,255,146,223, 40,243,251, 26,128, 86,229,206, 53, 31,215,151,251, 54, 31,143,252,171, - 29,172,126,239,189,247,222,134, 94,189,122,117,159, 54,109, 26, 20, 10, 5,146,147,147, 75, 31, 90,169, 84, 10,111,111,111,104, - 52, 26,156, 59,119, 14, 57, 57, 57,167, 1,188,111,233,133,147,147,147,175, 60,184,113, 63,179,227,192, 54,206,126,109,154, 56, - 36,198, 36,182, 5,112,137, 16, 66, 60, 61, 61,127, 24,254, 73,223, 49, 93, 95,111, 13,137, 84,140,132, 7, 41, 85,114,149,239, -131,245, 60,115, 99, 49, 12,195, 18, 66, 48,108,216, 48,139,206, 31, 62,124, 56,206,158, 61,139,170,154, 19,139,155, 8, 13, 40, - 42,212,160,232, 5, 10, 44, 66, 8, 56,142, 43,117,174,204,159,158,106, 3, 24,134, 41, 21, 22,125,211,120,139, 57,181, 69, 69, -203,207,159, 60, 48,190,137,127, 75,215,118, 65,141,113, 63, 54, 1,203,103,253,175,169,229,211, 9,195,177,117,199, 65,168, 60, -156,161,211, 20,224,216,225,131,185,121,121,121,203,107, 27,135,173,251,206, 2, 0, 58,189,245,244, 24,129, 97, 31,175,178, 44, - 3,139, 68, 24, 59,118,108,165, 14,214,137, 19, 39, 52,101,157,200,234,210,168,176, 80,139, 34,141,230,133,165,145, 74,165, 10, -104,219,182,237,137,141, 27, 55, 58,187,184,184, 64,173, 86, 63, 37,176, 84, 42, 85, 64,155, 54,109, 78,108,220,184,209,217,213, -213, 21,241,241,241, 22, 79, 17, 82, 78, 92, 33, 61, 61,157,100,103,103,243,142,142,142, 53, 18, 89, 12,195, 64,167,211, 33, 58, - 58,218,210,103,196,226, 73, 71,235,213,171,247,203,119,223,125, 39,123,242,228, 9,140, 70, 35,162,162,162,158, 25,132,192,178, - 44,102,204,152,129,217,179,103,175, 7,224, 83, 21,159,201,100,250,118,212,168, 81,239, 37, 37, 37, 57,186,255, 31,123,215, 29, - 22,197,245, 69,207,155,237,133,222,119, 65, 64, 65,164,136, 5,176, 99, 55, 86,140, 41,118,141, 37,177,198, 22, 19, 91,162,177, - 70,108, 81, 99,172, 81, 99,139, 13,163,198,216, 53,246, 46, 96, 69, 5, 69, 81, 96,233,189,108,159,153,223, 31, 2, 65,126,148, - 5, 77, 52,201,156,239,219,111,203,204,158,121,243,230,205,155,243,238,187,239, 94, 71, 71, 36, 37, 37, 65, 40, 20,130,101, 89, -144,246,237,209,250,233, 83,232,105, 26, 82,169, 20,143, 30, 61,194,198,141, 27, 11,244,122,253,138,242,184, 60, 61, 61, 69, 20, - 69,121, 9,133, 66, 12, 26, 52,232,149,109,219,182,109, 67, 11,223,172,160, 81, 31,137,242,105, 86,168,205,135,239, 49,138,162, -200,184, 17,221,235, 5,183,104,224,127, 63,234,217, 19, 85,106,230,229, 74,197,127,142, 45,244, 42, 49, 32, 20,254,233,111, 85, -228,115,197, 19,137, 74, 86, 20,178, 34, 17, 24,145,105,193,130, 75,139, 38, 66, 8,108,109,109,181, 43, 87, 44, 21,203,229,114, - 26, 0,204,205,228,244,222,109,107, 96,107, 99,163,101,107, 98, 10,229,192,225,221,197,205,183,244,223, 55, 47,176, 34, 34, 34, -158, 2,232, 20, 16, 16, 48,240,194,133, 11,203, 39, 79,158,108, 31, 28, 28,140,204,204, 76,184,185,185, 65,161, 80, 32, 60, 60, - 28,183,111,223, 78,103, 89,246,203,240,240,240, 29,229, 8,128, 10,179,109,179, 44,203, 42,149,202, 48,125, 97,225,216, 70,193, -222, 56,191,239, 98,168, 66,161, 24,229,226,226, 50,113,200,140,247,135,181,251,160, 9,162, 35,159,225,218,201,187, 72,122,145, -142,161,173,167, 86,200,105,138, 15, 86,233,247,178, 62, 88,165, 57, 25,134,161,117, 58, 29,246,236,217, 99,146,200,218,181,107, - 23, 52, 26, 13, 24,134,161, 43, 58,119,154,161,137,185,133, 61,156, 93,125,161,215, 21,128, 97, 76, 31, 89,178, 85,212,167,209, -104,196,220,185,115, 49,101,202, 20,204,159, 63,191, 82, 33,178,102,205, 26, 84,117,141, 50, 51, 51,243,148, 74,229,224,221,155, -127,216, 55,112,196, 4,115,151,150,141,240,243,222,163, 48,232, 13,144,136,249,176,182, 48, 67,221,218,206,208,105, 10,177,246, -199,229,185, 26,141,122,112, 89,223,179,234,100, 89, 31,250, 97, 91, 44,222,120, 8, 23,119,254,105,160,108, 61,112, 54,126, 89, - 54, 30, 1, 1, 91, 42,229,164,105, 26, 2,129, 0, 59,119,238, 84, 87,180,154,144,199,227,161, 34,129, 85,246, 26, 89, 88,216, -195,197,221, 15, 58, 77,254, 27,187, 70,182,182,182, 83, 54,109,218,100,171, 86,171,241,240,225, 67, 60,124,248, 16,132,144, 7, -101,183, 23, 20, 20,224,222,189,123,197, 34,231,129,169,245, 89,108,185, 74, 75, 75, 35, 73, 73, 73,144,201,100,212,157, 59,119, - 52, 13, 27, 54,124,128, 34, 31,173,170,206, 93,171,213,198,117,236,216,177, 34,139,145,179, 88, 44,126, 37,101, 83,113,208,209, -178, 83,133,229,149, 51, 62, 62,254,214, 15, 63,252,224, 90,175, 94, 61,252,244,211, 79, 90,115,115,115,209,228,201,147,193,227, -241,200,202,149, 43,217,204,204, 76,253,244,233,211, 69,151, 46, 93, 66, 65, 65,193,173,170,218, 39,203,178,121,132,144,145, 45, - 91,182,220,126,236,216, 49,169,151,151, 23,114,114,114, 94,138,245,173, 91, 49,110,220, 56, 72,165, 82, 68, 71, 71,163, 87,175, - 94,133,133,133,133, 35, 75,199,192, 42,205,105, 52, 26,137, 64, 32, 96, 25,134,193,204,153, 51, 95, 9, 44, 42,147,201, 32, 21, -209,216, 48,207, 67,254,197,226,100,249,132,177,159,124,242,178,157, 48,244,253,168,103, 79, 54,252,124,232, 44,128, 11,149,157, - 59, 99,153, 3, 59,175,151, 22, 44, 65,113,204, 43,161,248,149,213,131, 47,227, 96,189,140,139, 85,213,185,151,117,197,176,177, -177, 49, 6, 6, 6, 68,169,213,106, 94,177,150,178,179,179,187, 87,180, 47, 91,171, 86, 45, 93,153,230, 89,173,123,179, 26, 3, - 61,142,147,227,228, 80, 77, 11, 22, 0, 32, 50, 50,114,167,191,191,255,177, 69,139, 22, 45, 58,112,224,192,136, 9, 19, 38, 16, - 11, 11, 11,132,133,133,177,153,153,153, 91, 68, 34,209,148,171, 87,175,214, 40, 94, 4,203,178, 91, 47,253,126,109,204,128, 47, -122,146, 9,203,134,182,186,117,238,222,131,134,173,188,208,160,165, 23,194,207, 68, 97,205,215,187,119, 24, 13,198,111,147,146, -146, 94, 84,198, 99,138, 15, 86,241,139,207,231, 87, 25, 7,235,192,129, 3, 19,186,119,239, 78,221,184,113,227,255,124,174, 74, -251, 97,157, 58,117, 10,122,189, 30, 97, 97, 97, 76,101,113,176, 24,224,183, 21,203,190, 29,178,121,219, 17, 17, 69,244,184,122, -225, 87,228,100, 85,110,149, 19, 10, 5,248,101,215,111,122, 62,159,247,168,146,178, 62,143,136,136,176, 93,188,120, 49,143,162, - 40,172, 89,179,230, 21,203, 85, 89,220,189,123,151, 49, 24, 12, 85, 94, 43,149, 74,117,202,201,201,169,255,250, 21,243,182,182, -239,242,190,149,143, 79,125,190,131,131, 43,248, 20,133,236,204, 52,220,188,118,201,120,252,200,193,108,157, 78, 55, 84,165, 82, -157,122,157, 6, 24,186,225, 96,185,191,127, 60, 97,121, 85, 86, 20,163,193, 96,224,203,229,114, 24,141,198,114,197, 85,199,142, - 29,165,151, 47, 95, 86,235,245,122,240,120,188, 74, 21,211,203,107, 52,123,200,230,237,111,246, 26,209, 52,237,155,149,149,133, -130,130, 2,132,135,135,179,107,214,172, 73,203,206,206,254,186,244,246,204,204, 76,228,229,229,225,230,205,155,236, 79, 63,253, -148,150,155,155,251,181,169,245, 87, 28, 23, 43, 43, 43,139,145,201,100,148,193, 96, 48, 52,108,216, 80, 34, 20,154, 22,243, 10, - 0,110,221,186,213,181,162,109,173, 90,181,138,185,124,249,114,221,210,185, 9,141, 70,163, 80,171,213,122,245,234,213,171,202, -254, 67, 42,149, 14,248,245,215, 95,119, 74, 36,146, 6, 26,141,230,179,212,212,212,173, 0, 92,121, 60, 30, 30, 63,126,156,110, - 52, 26,251,204,156, 57,115,115, 65, 65,193, 93, 51, 51,179,129, 38,246, 27,199, 9, 33, 3,253,252,252,126,158, 51,103,142,188, - 93,187,118, 2,165, 82,137,192,192, 64, 68, 71, 71,227,200,145, 35,250,181,107,215, 22, 22, 22, 22, 14,103, 89,246, 84, 37,131, - 14, 22, 0, 49, 26,141,175,228, 48, 21,137, 68, 16, 8, 4, 40,212, 82, 24, 49, 51, 86,205, 64,160, 94,184,116,199, 17,150, 5, - 81, 37,165,167, 39,167,100, 95,231, 27, 12, 23,226, 84,121, 57,149,149,147, 78,151,193,221,194,191,100,112, 71, 8, 1,197, 80, - 32,122, 2, 30,205, 3,207,192, 3,225,243, 95, 90,183, 76, 75,119,197, 26,141, 70,132,132,132,224,240,225,195,248,224,131, 15, - 88, 84,226, 43,114,248,240, 97,152, 98,189,229,192,129,195, 91, 18, 88, 0,112,239,222,189,108, 0,163,154, 52,105,178,109,252, -248,241,135, 25,134, 17, 48, 12,211,227,214,173, 91, 23, 95,231,224, 73, 73, 73, 17, 74,165,242,107,123,103,171,208,174, 3, 91, -161,126, 19, 55,208, 70, 26,151,143,222,194,150,133, 7,119, 39,196, 39, 12, 43,157,171,176, 34,152,226,131, 85,214,130, 85, 17, - 87,106,106,234,236, 5, 11, 22,224,187,239,190,171,246, 42,194,138,246,185,114, 51,113, 84,139, 32,133,203,199,239,183,234, 66, - 17,194,106, 43,241,179, 33, 4,108,177,167, 5,159,207,123,116,254, 90,124,195,138,246, 77, 78, 78,238, 56,118,236,216, 63, 40, -138,114, 43, 53,170, 64, 37, 15,251,164,140,140,140,206,166, 92,155,228,228,228, 99, 46, 46, 46,245,206, 31, 63, 52,227,210,233, - 99,237,104, 90,239, 73, 64, 32, 20, 10,159, 24,104,227, 57,131, 78, 23,154,144,144,240,218,129,216,102,140,250, 0,207, 85,233, -224,243,121, 47, 99, 79, 21, 93,238, 95, 87, 77, 70, 64,192, 47, 21,254, 79, 44, 22, 31,251,249,231,159, 67, 62,249,228, 19,194, -231,243, 75,166,221,138,207,159,162, 40, 92,187,118, 77,173,211,233,176,101,203, 22, 86, 42,149, 86, 26,184,246,175,186, 70,249, -249,249,195,123,245,234,181, 21,128, 24,192,227,156,156,156,209, 42,149, 42,161,244,246, 15, 62,248, 96, 43, 0, 49, 33,228,255, -182, 87,133,226,144, 13,214,214,214, 15,138, 44, 87,146,154, 56,186, 87,210,190,121, 21, 77, 31,154, 50, 85, 88,148, 91,240,163, -226,239, 65, 65, 65,243,198,140, 25, 83, 58,217,243, 5, 0, 30, 53, 24,156,157, 34,132,212,159, 57,115,230, 68,169, 84,218, 94, -173, 86,251, 0,128, 76, 38,123, 88, 88, 88,120, 86,175,215,255,192,178,108,118,101, 28, 79,158, 60,209,213,169, 83, 39,218,104, - 52,250, 59, 56, 56,148,172, 62, 20,137, 94, 90,147,174, 61,180, 9, 79, 76, 76,108, 82,195,193, 99, 66,101, 22,229,138,254, 83, -217,118,157, 78,151,118,229,202, 21,155,211,167, 79,243,104,154,198,241,227,199, 75, 6,125,229,205, 6,198,198,198, 66,167,211, -105,184,199, 28, 7, 14,111, 7,228,175,156,166, 55,213,132,168, 84, 42,251, 73,228,226,177,110,245, 20, 13, 85, 79, 83,163,242, -178, 11,127, 73, 74, 74,218,192,178, 44,205,153, 79,255,189,156, 34,153,197, 9,194, 19,186, 85,248,192,161,245,207,117,133,185, - 93,202,227,108,214,172,153,179, 80, 40, 92,170,213,106,187, 85, 22,165,157,199,227, 25,165, 82,233, 49,141, 70, 51,165,108,178, -231,127, 98,125,206,157, 59,183, 92,147,132,169,171, 8,103,207,158,205, 84,167,156,141, 26, 53, 58, 43,147,201,202, 13,168, 89, - 88, 88,248,226,246,237,219,157,223,133,250, 44, 94, 45,103,138,223, 81,105,206, 26,173, 34,124, 75,247,145,139,139,139,196,194, -194, 98, 41, 69, 81, 10, 19,197,177, 46, 53, 53,117,114,122,122,122, 50,215, 47,113,156,220, 20,225, 59,106,193,250,171,161, 82, -169,246, 0,216,195, 93,142,255, 22,138,197, 83, 77, 80, 36,150,250,255,215,234,172, 88, 32,149,243,251, 67, 0,111,124, 73,190, - 41,225, 24,222, 5,212,212,161,187, 72, 64,181,254, 39,156, 99, 66, 66,130, 6,192, 56,174,231,224,192,225,159, 1,110,130,158, - 3, 7, 14, 28, 56,112,224,192,225, 13,131, 0,240,175, 96, 68,104,178,233,143, 16,226, 95,131, 17,231, 61,142,147,227,228, 56, - 57, 78,142,147,227,228, 56,255, 91,156, 85,113,255, 91,166, 30,223, 9, 31, 44,142,147,227,228, 56, 57, 78,142,147,227,228, 56, - 57, 31,172,127, 19,184, 41, 66, 14, 28, 56,112,224,192,129, 3,135,183, 37,176,204,156,124,125,237,221, 27,109,181,169,213,240, -142, 77,173,134,119,236,221, 27,109, 53,115,242,245,253, 47, 86,154, 82,169,148, 42, 20,138,129,174,174,174,167, 26, 55,110,156, -235,236,236,252, 5,215,148,170,143,118,132,240,251, 19,242,249, 16, 66, 94, 12, 33,228, 69,127, 66, 62,111, 71, 8,255,223,118, -158,243,199, 57, 55,191,120,124,208,177,249,227,156,203, 13,192, 54,247, 43,165,237,229, 19,125,127,248,122,156,179,205, 27, 26, - 89,154, 59, 58, 58,254,228,228,228, 20,231,232,232,248,220,209,209,241,103, 66,136, 37,215,226, 56,112,224,192,225,239,131, 73, - 15, 51, 27,183, 6,159,249,250,120, 79,153, 55,123, 6,113,118,178,151, 25,140,180,254, 89, 92,130,223,236, 5,139,246,217,184, - 53, 88,158,249,252,238,166, 26, 60, 4,136,139,139, 75, 63,129, 64, 16, 2,160, 88,168, 61, 48, 24, 12,135, 19, 18, 18,246,152, -186, 42,168, 97,195,134,151,120, 60,158,107,117,142,205, 48, 76,220,237,219,183,219,212,164,194,156,157,157,251, 56, 59, 59,255, -220,188,121,115, 89,227,198,141, 33, 20, 10,177,100,201,146, 47, 1,172, 48,249,220,219,181,227, 59,100,219,124,194,227,243,123, - 2,104,200,178, 0, 8,239, 14, 99,208, 31, 73,181,206,216,202,158, 59,103, 82, 24,113,133, 66,241, 53, 33,100, 40, 94, 46, 43, -223,164, 82,169,150,254, 21,141, 68,169, 84,214, 34,132,180,103, 89,214,135,162,168,187, 12,195,156, 84,169, 84, 25,175,203,235, - 8,140,106, 25, 28,252,195,144, 47,191,228,169, 47, 92,192, 15, 63,255,188, 18,185,185, 0,176,166,186,109,169, 89,179,198,189, -205,205, 17, 66,128, 0, 16, 16, 10,236,173,204,108,234,232,205,155,145,123, 76,137,165, 86, 17, 2, 3, 3,143, 0,232, 94,244, -245,104, 68, 68, 68,143,234,114,100,197, 50,179,196, 2,159,214, 89, 79,206,206, 2,208,173,236,118,163, 70, 50,132, 39,168, 21, -194, 99, 35,227, 1,124,255,154,226, 74,102,111,111,127,231,224,193,131, 46,205,154, 53,227, 3, 64,120,120,248, 39, 33, 33, 33, - 29,138, 76,250,185,111,163,163,105,209,162,133,181,209,104,220,198, 35,164, 57,195, 48, 86, 0, 64, 81, 84, 54,205,178,215,248, -124,254,144,154, 6, 43,230,192,129, 3,135,127,172,192, 50,115,244,241,171, 95,223,247,203,227, 7,182,213,202,206,204,214,172, - 89,186, 53, 82,205, 23, 21,214,246,243, 18,174, 90,190,216,106,220,164,175, 38,153, 57,250, 92,207, 79,121, 24,101,234, 65, 21, - 10,133,171,187,187,251,254,175,191,254,218, 63, 56, 56, 88,224,224,224,128,148,148, 20, 60,122,244,200,255,242,229,203, 31, 28, - 60,120,240, 75,133, 66,241, 81, 85, 17,220, 1, 64, 46, 18,214,217,179,120,161,147,200,202, 26, 44,109,132, 85,253, 70, 0, 0, -150, 97,144,116,238, 20, 24,131, 1, 44, 67,195,165,235,251, 47,127,103, 89, 52,109,218, 84, 88,147,202,114,113,113, 81,214,171, - 87,111,199,244,233,211,133, 90,173, 22,183,110,221,194,213,171, 87,153,212,212,212, 69, 38,139,138, 6, 31,250, 57,241,157,246, -245,250,160,155,123,143,247, 28, 68,110, 78,246, 96, 24, 9, 30, 61,213,187,158,186, 24,217,245,232,241,147, 83, 28,252, 62,236, -147, 26,117,224,110,101, 60,254,254,254,205, 41,138,250, 46, 49, 49,177, 88, 4, 45,105,214,172,217,183,165,247, 41,171, 81, 25, -134, 1,159,207, 79, 41, 44, 44,236,119,239,222,189,200,242,120,103,141, 32, 6,163,241,101,187,224,243, 65,111, 59,233,114,160, - 83,167, 78,181,135, 15, 31,142,128,128, 0,132,135,135,183, 15, 11, 11,155, 88,171, 86,173,155, 6,131,225,168, 88, 44, 62, 23, - 23, 23, 87,163, 4,139, 66, 96,234,144, 47,191,228,153,197,197,193,236,214, 45, 12,202,205,229, 47, 6,166, 86, 71, 96, 5, 6, - 6,214,233,220, 41, 96,223, 7, 31,181,245,117,114,242, 19, 10, 4,118, 96, 89, 22, 6, 67,102,189,180,180, 7,189, 45, 45, 49, -189,105,211,166, 31,223,184,113,227,177, 41,124, 77,154, 52,113,100, 24,102, 61,203,178, 66, 66,200,120, 0,221,143, 31, 63, 14, -154,166,209,163, 71,143,238,129,129,129,117, 88,150,253,209,204,204,140, 85,171,213,159,222,188,121, 51,165, 50,203, 85,246, 19, -102, 86, 50,223,163,171,119,208, 80, 36,243, 79,116,157,220, 69,113,204,202,131,154, 63,107,117,226, 53, 0,232,230,233,105, 94, -199, 71, 54,205,204,194,223, 38, 39,241,212,180,110,158,158, 27,143, 61,121,146,247, 26, 98,120,233,182,109,219,106, 53,111,222, -188, 36, 72,110,227,198,141,121, 75,150, 44,113,158, 60,121,242, 74, 0,195, 76,228,169,103,107,107,123,130, 97, 24,237,253,251, -247,235, 21,255,238,208,232,163,150,182,230,242,142,105, 89,121, 23,210,239, 31, 60,111, 10, 87, 80, 80,208,112, 33, 69,253,180, -124,230, 56,158,111,195,134,144,217, 57, 64,175, 82,161,192,104,176,185,118,251,126,143,197, 43,126, 74, 11, 10, 10, 26, 25, 30, - 30,254, 51,215, 37,115,224,192,225, 63, 35,176,196, 98,209,244,217,223, 76, 35, 89, 25,217,106,125, 94,174, 94,198,234,140, 22, - 50, 9,201, 77, 77,203,126,102, 33, 43,156, 60,105,130,100,218,244,111,166, 3, 24,100,170,184,242,241,241,185,177,113,227, 70, - 7, 27, 27, 27,228,228,228, 32, 35, 35, 3, 55,110,220, 0,203,178,232,214,173,155,184, 81,131, 6, 1,203, 87,172,184,170, 80, - 40, 90, 84, 37,178,248, 2, 62, 17,200,229,248,181,109, 0, 40,161, 16, 31, 63, 76,122, 41, 46, 12,122, 28,239,223, 19, 0,192, - 19,137,208, 55, 38, 21, 0, 32,145, 72,106, 92, 89, 44,203,182,104,213,170,149, 16, 0,190,252,242,203,220,130,130,130, 80, 66, -200, 78,149, 74,149,104,202,255,237, 26,188,239,229,104,239,116,126,217,130, 17, 54,254,117, 60,160, 51, 24,144,144,154, 8, 22, - 34, 56, 57,200, 49,232,131, 70,194, 86, 65,194,186,223,175,249,227,156,163,127,175, 54, 41,247,126,187, 95,161,176,148,203,183, -173, 92,185, 18,123,247,238, 5, 0,156, 61,123, 22, 94, 94, 94,242,170,202,240,232,209, 35,143,161, 67,135,238, 6, 80,183,188, -237, 70, 35,248,161,223,237, 4, 0,108,219, 56,144, 23, 29, 29, 93, 91, 42,253, 51,151,114,219,182,109,209,182,109, 91, 42, 52, - 52,180,217,217,179,103,155,237,222,189, 91,239,236,236,188, 50, 49, 49, 49,172, 38,117,170,190,112, 1,102,183,110, 1, 23, 46, - 84,251,191,141, 27, 55,118,173, 95,223,254,234,247,203,190,181,255,253,240,125, 44, 91,246, 51,158, 60,121, 2, 0,240,240,240, -192,192, 1,125, 4, 59,127, 89, 95,127,250,244, 57, 87, 2, 3, 3,131, 35, 34, 34,170,140,110,206, 48,204,250,208,208,208,247, -205,204,204, 48,125,250,244,232, 58,117,234,192,194,194, 2, 27, 54,108,128,181,181, 53, 12, 6, 67,244,146, 37, 75,248, 42,149, - 10,171, 86,173,218, 92,202,186,245,127,104,211,189,237, 44,177,192,167,181,119,208, 80,152, 89, 40,176,113,215, 30, 60, 10,223, -218, 90,107,120, 56,235,235,113,206,131,121,172,120,168,179,151,217,244,218, 65,237,108,235,214,239, 5,247,192, 91,118, 90,250, -194,211, 89,159,123, 44,226, 75, 52,219,102, 47,251,127, 43, 33,233,179,143,231,159,123,211,230,222, 41,121, 6,203,150, 4, 13, - 37, 40,138,129,229,164, 80,246,108,219,182, 45,175, 88, 96,199,197,197, 65,167,211,193,207,207,143,210,233,116, 38,197,180, 82, - 42,149,245,218,180,105,115,105,199,142, 29,182,173, 91,183, 78, 43,189,205,201,214,170,203,249,253, 43, 39,124,247,195, 47, 62, - 14,126, 31,102, 87, 53, 16, 8, 10, 10, 26,222,160,158,199,166,149, 75,102, 19, 94, 65, 2,248, 86, 25, 0,147,129,164,221,155, - 1,153, 13,122,140,158,140, 38,205,154,241, 38, 76,250,122, 83,147, 38, 77,216,155, 55,111,110,225,186,101, 14, 28, 56,252, 39, - 4, 22,195, 50, 13,237,237,109, 36,171,150,110, 13, 87, 72, 40,226,228,162, 36, 34, 11, 43, 62,204,228, 98,138, 39, 80,123,120, -184, 8, 25,150,105, 88,129, 32,121,101,133, 1, 33,132,184,187,187,239,223,178,101,139,131, 64, 32, 0,195, 48,176,183,183,199, -211,167, 79,145,149,149,133,252,252,124, 60,121,240, 0,238,181, 92, 48, 97,228, 8,197,252,101,223,239, 39,132, 4,149,158, 46, - 44,203,201, 50, 44, 24,227,171, 51,106,132, 16,148, 55,191, 88, 81, 26, 25, 83, 87, 66, 48, 12,243, 76,165, 82, 65, 38,147,193, -215,215,215,236,230,205,155, 23, 19,139, 77, 72, 85,157,123,159, 62, 60,133, 72,124,104,233,130,126, 54,132, 23,141,232, 23,217, -240,116,105, 10, 91,203, 90, 72, 76,203, 71, 68,212, 81, 68, 63, 57, 2, 79, 23, 87,140, 28,232,105,181, 98,125,218, 97, 18, 56, -202,147,141,216, 96, 40,143, 51, 47, 47,207,204,213,213, 21,206,206,206, 96, 24, 6, 52, 77,227,254,253,251, 37,159,139,243, 37, - 22,127, 94,185,243, 50,172,121,233,232,247, 97,119,100,102,102,154,153,122,238,197,226,106,223,247,202,250,234,130, 36, 33, 0, - 72,229, 10,253,199,147, 19,239, 55,105,210, 4,246,246,246,194, 43, 87,174, 76, 6, 16, 86,221,250,212, 3, 75,126,216,178,101, -213,160,156, 28, 10, 0, 54, 17,194,232, 95, 70,213, 54,169, 45,117,126,175,241,129, 21, 43,102,217, 19, 54, 10, 54,150,139,113, -227,198,115,232,245, 47,175,124, 70, 70, 42,198,127,158, 11, 62,223, 28,223,127, 63,219,182,111,191, 49,191, 22, 77,145, 49,149, -149,147,101, 89,225,195,135, 15, 81,191,126,125,236,222,189,155,207,227,241,112,253,250,117, 72,165, 82, 12, 29, 58, 20,254,254, -254,124,169, 84,138,139, 23, 47, 34, 55, 55,151, 84, 86,206, 11, 71,207,207,207,138, 61, 59, 43,153,119,162,235,198, 93,123, 48, - 98, 64, 63, 56, 25, 99, 47, 90,123, 82,243,187,245,104,249, 45, 79, 80, 43, 68,110,238,111,237,229,223, 11, 66,145, 25,198, 77, -157,135,232,123,135,172, 11,243,238,126, 78, 27,226,107, 1,152, 88,150,147, 13,235, 77, 47,223,234, 16,120,218, 53,210, 77, 25, - 56,234,122, 82,228, 79,119,254, 60,186, 47, 31,148,218,170, 88, 92, 61,126,252, 24, 79,158, 60, 1,143,199,131, 90,173,126, 37, - 81,112,105,206,128,128,128, 81, 52, 77,127, 11, 0, 58,157,110,171,163,163,227,240, 31,127,252,209,150,199,251, 51, 83, 84,177, -229, 42, 51, 59, 55,235,202,205,251,143, 38,143,234,221,238,194,181,123,241, 86,141, 62,120,145,125,251, 96, 78,121,245,217,162, - 69, 11,107, 17,143,247,211, 15,203,230, 18, 58,246, 15,136,125,219,129,111,230, 5,218,144, 8, 77, 86, 62,212, 79,147,161,223, -176, 26, 30,163, 39, 97,233,146,239,200,128,193,159,254,228,233,233,185,255, 73, 41, 11,222, 95,177, 74,137,227,228, 56, 57,206, -119,147,243, 63, 39,176, 8,161,114,245,122,131,192,162,150,179,225,227,143,218, 52,136,188,126, 47,218,204,198,146,106,212,180, -129,223,189,232,132, 8, 24,105, 61, 33,148, 73,126, 29, 46, 46, 46,253,102,207,158,221,192,194,194, 2, 12,195,192,210,210, 18, -105,105,105,208,235,245,200,205,205,133, 54, 63, 15,250,188, 92,220,126, 17,135,224,118,237,240, 94,139, 22,190, 71, 13,134,126, - 0,118, 87,196, 73, 83, 60,214, 54,160, 41,250,196,102,128,209,235, 16,230, 97, 91, 98,181,234, 31,151, 13, 66, 8,104,157, 22, - 71,155,214,133,216, 76,142,134, 83,102,215,184,178,146,146,146, 34,221,220,220,142,117,237,218,181,219,200,145, 35,169,228,228, -228,227,142,142,142,173, 82, 82, 82,170,156, 30,117,136,161,135, 14, 25, 25,224, 97,103, 69,225,247,203, 39,208,220,231, 67,200, -196, 2,164,101,169, 65, 17,130, 39,207, 78,131,166,229,184,253,240, 5, 90,248,203,209,186,153,165, 75,254, 31,153, 35, 81,241, -116, 25,201,202,202, 66,106,106, 42, 12, 6, 3,140, 70, 35,122,247,233,131,109, 91,183,162,160,160, 0, 26,141, 6, 58,157, 14, - 12,243, 82, 79, 36,167,229,227,198,237,227, 8,106, 80, 15,168, 36,226, 55,159, 15,227,143, 43, 7,242,205,101,128, 80,108,175, -207,203,203,131, 92, 46,135,186, 32, 73, 56,100, 68,137,101, 75,120,246,236, 89, 68, 68, 68, 64,169, 84,154,212,142,202,195, 19, -224,167,103, 52, 61,179,219,129, 3, 14,151, 15, 28, 96,174,253,254,123,130, 56, 47,111,131, 41,255,109,214,172,113,239,113,227, -122,248, 74, 37, 82, 36,188, 88, 9, 31, 31, 33,190,252,194, 22,161,139,211, 1, 0, 19,198,185, 32, 40,200, 22,185,217,251, 96, -231,240, 53,190,156,252,129,103,126, 62,251, 9,128,173,149,183,119, 50,254,151, 95,126,137,238,220,185, 51, 63, 50, 50, 18, 98, -177, 24, 82,169, 20, 18,137, 4, 82,169, 20,201,201,201,208,233,116, 8, 11, 11, 51, 22, 77, 33, 86,136,162,105,192,110,147, 59, - 43,142, 61, 10,223,218,218,153,122,122,251,131,201, 45,159, 69, 94,191,157,127,230,143,203,243,141, 26, 73,124,118,194,169,105, -117,154,220,182,251,124,202, 92,172, 94, 58, 27,143,174,159,207,116,116,205, 91, 67, 19,237,214, 86,229,196,185,111,215,110, 46, -127,236,204, 1,134,177,195, 63,182, 60,172,184, 50,226, 48, 31,233, 41,153,119,151, 33,246,134, 90,236, 85,127,112,189, 58, 68, -119,230,204, 25,105,155, 54,109,160, 86,171, 95,222, 11, 60, 30,126,249,229, 23,198,104, 52,158, 45,175,156, 6,131,225,219,136, -136, 8, 69, 97, 97, 33, 6, 12, 24, 48, 97,206,156, 57,114,129, 64,240,242,254,162,233, 87, 44, 87, 11, 86,108, 63, 49,233,219, - 53,103, 79,236, 94,172, 92, 48,125,120,187, 65,227,190, 59, 11,224,120,249,214, 80,227,182, 21,139,103,240,196, 86,122,144, 38, -157,161, 79, 85,227,249,166,145,208,229,168, 81,111,254, 60, 0, 66,232,244, 60, 28,254,160, 15,120, 54, 74,124,214,166, 21,127, -195,249, 75,219, 0,124,192,117,205, 28, 56,112, 40,131, 38, 0,236,139, 62,167, 23, 61,199,108, 1, 20, 91,217,237, 1,232, 0, -136, 74,253,167,236,247,210,251,150,253, 94,250,115, 58, 94,250, 54,219, 3,160, 1,220, 0, 80,109, 63, 81,170,232,161,194,150, -122,192,176,101,172, 54, 23,158,196,198,169,219,181, 13, 82,156,189, 17, 19,217,245,195,247,154,182,233,208,172,121, 74, 70,110, -172,147,189,133,252,202,245,107, 98,134, 97, 76,154,223, 17, 8, 4, 33,193,193,193,252,172,172, 44,200,100, 50,164,165,165, 33, - 49, 49, 17,122,189, 30,234,156,108,104,179,179,160,206,202,132, 33, 47, 27, 79,110, 94,135,183,171,179,184,200, 9,222, 36,148, -181, 80, 21,103,176, 39, 20, 5,137,133, 57,164, 22, 22,224,241,170, 23,153, 66,169, 84,246,242,241,241,185,230,236,236, 60,179, -104,132,255,121,104,104,104, 58,203,178,152, 54,109,154,133,133,133, 69,152,187,187,187,184, 42, 30,115, 27,186,119,179, 6,117, -121,209,207,239, 34,200,235, 99,212, 86,180,193,147,196, 28,164,229,104,144,156, 89,128,122,245,166,192, 94, 57, 2,150, 78,163, -113,247, 81, 60, 20, 78,181, 41,158, 64,216,181, 50,206,228,228,228, 87,190,239,218,185, 19,133,133,133,168, 91,183, 46,250,247, -239,143,169, 83,167,162, 95,191,126, 80, 42,149,104, 93,151,143,225,131,123, 35, 53, 53,181,210,114,206,223,200, 10, 22,237, 84, - 68, 14,153,205, 70,214,237,120,236,254,147, 39, 79, 16, 29,253,255, 51,107,127,252,241, 7,114,114,114, 74, 30,192,166,192,209, -209,113,134, 66,161,184,163, 80, 40,238, 43, 20,138,163, 41, 74,229, 67,131,135,135, 99,171, 15, 62, 32,126,125,251,242,226,229, -114,242,172, 86, 45, 51, 83,184, 44, 44,208, 35, 40, 40, 88,148,157,245, 51,128,151, 34,114,248, 48,123, 92, 58, 95, 31,151, 47, - 6, 98,252, 56, 15, 80, 68, 2, 66, 9, 81, 88,240, 7,252,234,251, 11,205,205,217, 74,219, 82,145, 67,123,108,253,250,245,249, - 99,198,140,129, 88, 44,198,182,109,219,176,110,221, 58, 44, 95,190, 28,209,209,209,112,115,115,131, 66,161,128,163,163, 35, 31, - 64,108,209,127, 42,133,149, 39, 53, 95,107,120,120,209,218, 75, 30, 75, 40,135,150, 90,163,228,227,217,203, 84, 25,243,215,196, -126,255,236,145,218,227,225,245,243, 25,209,247,126, 99,158,222, 60,155,174,138,201,247,152,191, 38,246,251,133,171, 19, 51,203, -227, 58,127,126, 54,125,240,232,121,125, 65,126, 33,191, 87,183,142,234,209,195,250,215,179,145,121,255, 2,231,206,141,221,107, - 41, 6,207, 94,184, 74,247,217,152, 73,250, 77,155,127,102,243,242,242,144,155,155,139, 31,126,248,193,248,251,239,191, 39,210, - 52, 61,169,130, 34,242,138, 4, 17,250,244,233, 35,151, 74,165,136,143,143, 47,177,130, 2, 64, 82, 90,198,221,203, 55,239, 61, -156, 60,186, 79,219, 2,173, 86,123,226, 92,248, 3, 63, 47, 55, 23, 66, 88,247,138,206,155, 71, 72,243,250, 13, 27,130,101,179, - 65,241, 93,145,176,125, 25,212,201,153, 40, 76,203, 4, 37,144,195, 0, 9,244,172, 8,146,134, 77,241, 60,226, 22, 28,205, 44, -192, 39,164, 21,247, 28,225,192,225,191,137,202,180, 8, 0,123, 66,200, 97, 66,200,225, 25, 51,102,180, 7, 96, 75, 8, 57, 92, - 36,130,236,139, 62,139,138,247,169,224,187,125,105,158, 50,255, 45,253,217,110,198,140, 25, 29, 8, 33,135, 91,182,108, 57,184, - 72,200, 85, 27, 85,170, 13,158, 70, 23, 58, 99,230,108,202,194, 76,100,238,231, 91,219,250,247,147, 23, 34, 47, 95,187,245,192, - 92, 38, 17,231, 23, 20,136,150,255,184,206,149, 20,170, 77,117,242,246,181,179,179,131, 94,175,199,227,199,143,145,144,144, 0, -189, 94, 15, 99, 97, 1,180,217,217,208,100,101,129, 41,204,135,144,102,160, 78, 79,131,181, 68, 4,252,185,194,176, 50, 83,101, -137,152, 42, 79,112, 17, 66, 32,177, 48,135,200,220, 12, 20,159,103,114,229, 40, 20,138,192,198,141, 27,239, 61,115,230, 76,179, -224,224,224,249,238,238,238,150,201,201,201,207, 83, 82, 82, 58, 46, 93,186, 84,107,111,111,143, 65,131, 6,121, 27, 12,134, 33, - 85,113, 9, 37,218, 6,110,142, 94,112,117,236, 5,165,109,115,100,228,106,145,150,173, 70,114, 70, 33,246,252,218, 31,167,142, -245,199,173,139,131,241,248,250,112,100, 20, 88, 64, 98,211, 30, 0, 91,105, 4,221,107,215,174, 97,253,250,245, 37,175,213,171, - 87, 35, 51, 51, 19,245,235,215, 71,124,124, 60,142, 31, 63,142,228,228,100,216,219,219,227,214,173, 91,216,176, 97, 3,174, 95, -191, 94,237, 70,162,209,104, 32, 16,217,234,183,109, 28,136,109, 27, 7,130,102,229,250,210,117,111,114, 99,163,168,161, 73, 31, -124,208, 32,201,202,202,175, 97,195,134,221,250,246,237,235,209,172, 89,179,146,237,158,158,158,174,124, 62, 63, 89,169, 84,110, - 82, 42,149,141, 43, 37, 99,216, 0,107, 27, 95,232,180, 15,139,174, 49, 31,132,136,209,225,189, 7,104,213, 58, 2,122,131, 8, -132, 18,131, 34, 18, 24,141, 25,176, 48,119, 4,203, 86, 25,145,184,251,241,227,199,177,126,253,122, 60,125,250,180,100,122, 52, - 36, 36,100,252,128, 1, 3,246,211, 52,141,195,135, 15,227,224,193,131,168, 83,167, 14, 26, 55,110, 12,189, 94,223,189,170,243, -158,181, 58,241,218,206,229,199,250, 11,140, 86,141, 69, 98,183, 58, 84,158,172,215,231,237,236,229, 0,112,236,201,147, 60, 71, -215,188, 69,133,121,247, 94, 88,187, 20, 44,174,202,193,157,101,193,134, 71,223,191,190,251,215,147, 57, 41,233, 25,130,128, 70, -254,234,239,230, 78, 17,186,215,174,187,100,246,180,177,142,137,185,146,156,247, 38, 28,123,184,255,248,141,252, 79,134,143, 52, -126, 58,114,156,230,196,201, 63, 14, 48, 12,211,176,162, 21,132, 12,195, 32, 41, 41, 9,247,238,221,195,211,167, 79,145,158,158, -142,180,180, 52,228,229,229,149, 76, 43,202,242,114,143,172,222,242,251,109,185, 84, 42,107,214,192,203,245,122,100, 84,170, 92, - 42,149,121,213,118,173, 71, 72,249, 9,168, 25,134,177,122, 89,135, 4,121,247, 46, 64,147,153, 7,117,118, 62,212,153,249,208, -234,121,208,104, 41,104,244, 20,236, 90,119, 70,126,129, 26,154,204,108, 48, 44,107,205, 61,102, 56,112,224, 80,201,243, 62,100, -209,162, 69, 11, 43,219, 94,234, 93, 87,230, 59, 8, 33,135, 89,150, 13, 97, 89, 54,164, 72, 76, 21,235,132,195,165,121, 22, 45, - 90,180,144,101,217,144, 43, 87,174,236, 2, 80, 88,147,178, 86, 57,181,147,158, 30,157,111, 97,239,247,209,164,105,223, 30,253, -101,227, 42,135,204,204,172,104,161, 68,170,145, 72, 68, 54, 83,167,205,181, 42, 40,204,249, 40, 63,211,244, 85, 79, 89, 89, 89, - 37, 15, 47,161, 80, 8,186,176, 0,180,186, 16,154,172, 12, 16,189, 22, 66,154,134,141, 76, 6, 87,165, 35,220, 29,157,170,228, -227, 49, 52, 81,157, 58,138, 19,131, 63,124,101, 90,144,209,235,112,188,165, 55, 68,102,114, 72,173,172, 17,124,240,226, 75,161, - 35, 20, 2,179, 23, 87,201,235,228,228,100,167, 84, 42, 15,253,248,227,143,194,244,244,116,220,191,127,255,118, 92, 92, 92,142, -141,141,141,185, 64, 32, 96, 98, 98, 98, 78, 63,122,244, 40,164,118,237,218, 96, 89,214,179, 42,190,188,108,185, 94,111, 96,144, -152,250, 28, 9, 73,247, 96,105,230, 10,150,170,133,148,204, 66, 16, 56,192,160,121, 84,226, 75,166, 85, 39,160, 64,107, 90,222, - 94,189, 94, 15,131,193, 0,131,193, 0,157, 78,135, 79, 62,249, 4, 87,174, 94,197,206,131,231, 16, 31, 31,143, 58, 78, 50,244, -239,215, 7,141, 26, 53, 66,120,120,120,141, 27,181, 87,167, 19,247,165, 82, 41,214,173, 91, 7,153, 76,134,234, 10, 44,133, 66, -241,189,143,143, 79,221, 71, 5, 5,136,122,248, 16, 77,251,244, 1, 0, 92,186,116,169,100, 31,181, 90,141,129, 3, 7,138,158, - 62,125,250,233,195,135, 15, 63, 85, 40, 20,203,147,146,146,190,172,136,243,200,145,171, 24, 61, 58, 10,105,105, 47, 45,187,123, -118,249,149,108,123,246, 84,143,174, 61, 94,206, 92, 89, 89, 89,225,251,239, 77,203,246, 64,211, 52, 54,108,216, 0,169, 84, 90, - 34,176,132, 66, 97,171,201,147, 39,127, 84,222,254,126,126,126, 85,114, 78,238,227, 34,185,245, 92,250,185,101,221,218,254,150, -246, 13,145,110,188,213, 32, 50, 49,121,252,228, 62, 46, 43,151,135, 37,104,104,162,221, 74, 27,226,107,241, 37,154,109,166,148, -241,201,177, 85, 58,235, 58,163,182, 37,167,230,124, 51,110,228, 32, 91, 43,107,199,252, 77, 63,134, 90, 81, 20,133,223, 35,116, - 89,245, 61,108,173,123, 53,255, 33,127,244, 23,179, 34,117,198,231,227, 17,127,248, 81,145,185, 27, 21, 9,172,196,196, 68,164, -167,167,227,197,139, 23, 72, 75, 75, 3, 33, 4,105,105,105,213,178, 80,150,103, 81,214, 37, 36, 34,249,192,102, 56, 13, 28,132, -122,243,230,129, 97, 4, 80, 23, 26,177,175,117, 71,228,230,168,161, 99, 8,172, 2, 91,226,189,195, 23, 65, 49, 70,224,234, 21, -238, 9,194,129, 3,135,202,250,149,195,211,167, 79,255,218,196,221, 79, 3, 48, 41,180, 78, 89,193, 53,125,250,244,175,139,143, - 21, 26, 26,170, 6,160,122,227, 2, 11, 0,114,211,162, 98,109,221, 26, 38,229, 23,170, 37,214, 54,214,133,230,102, 34, 54, 39, - 59,135,247,240,113,180, 38, 63,233,241,163,106, 28,239,193,253,251,247,253, 19, 19, 19,241,226,249,115, 24, 10, 11, 64,116, 90, - 64,163, 70,167,214,173, 32, 1, 32, 33,128,144,209,131,199, 19, 33, 63, 63, 23, 0, 30, 84, 69,202, 24, 12,175,116,234, 37,211, -130,230,230, 16,153,201, 33,182, 48,127,197,162,101, 10,164, 82,233,206, 13, 27, 54, 40, 20, 10, 5, 86,172, 88, 1,133, 66,225, -211,169, 83,167,194,182,109,219, 74,237,236,236, 80,175, 94, 61, 4, 5, 5,225,236,217,179, 32,132, 60,169,138,207,168, 19, 69, - 60,136,165,107,229,230,223,194,245,136, 29, 48,232,116,168,237, 53, 3, 90,163, 29,228, 14,159, 66,173, 63, 4,125,246, 57, 0, -128,200,162, 29, 82, 82,210, 1,144,123, 85, 89,238,202,126,191,115,231, 14,182, 30,184, 4, 87,223,118, 72,206, 60,142,123,247, -194,225,104,125, 18, 94,126,245, 97, 40, 85, 79,166, 88, 5, 77, 21, 36, 38,222, 20, 3,103,204,152,129, 28,169, 20,232,209, 3, -194,216, 88,232,245,122, 52,111,222, 28, 77,154, 52, 1, 0, 52,111,222, 28, 60, 30, 15,117,235,214,133,141,141, 13,246,239,223, - 63, 16, 64,185, 2,139, 37,228, 22, 67,103,248,120,120,120,148, 8,172,109,219,211, 16, 25,222, 9, 4, 34,172, 90,253,231, 37, -113,117,117, 69,114,242, 83, 16, 82,165, 83,230,209, 30, 61,122,116,183,182,182,198,176, 97,195, 32,149, 74,241,225,135, 31, 66, -173, 86,247, 45, 26,209, 96,198,140, 25, 0,128,217,179,103, 99,206,156, 57, 40, 44, 44,172, 48, 68,197,250,239, 26, 42,243,212, -204,112,133, 66,249, 97,123,187,218, 13, 59,116,233,132, 58, 94, 29,209,161, 75, 60, 0, 44,180, 19, 60,235,179,228, 27,255, 3, -181,107,217,108,185,114,240,244,183,193,221,218,207,156, 59,193,102,254,236, 85,153, 85, 14, 88,178,159,253,148,247, 80,208,115, -229,170,245,198, 21,179,191,158, 44,126,158,174,207, 84,101, 49,249,114, 49,223,220,211, 17,102,227,167,206,127,170, 82, 61,254, - 10,241, 39,163, 77,185,134, 79,159, 62,133, 86,171, 5, 77,211,208,106,181,200,207,207, 71, 66, 66, 66,201,245, 85,203, 45,186, -142, 27,214,179, 81,129, 90, 93,120,253,110,204,139,153, 19, 6,181, 40, 80,171, 11, 99,158,189,136,102,217, 31,152, 10,174,121, -118, 97, 94,190,141, 46,207,128,236,219,209,176,235,224, 6,157,145, 64,107,228, 33, 51, 61, 15,122, 26, 48, 80, 2,184,244,254, - 4, 70,194, 71,110, 90, 50, 40, 66,184,120, 88, 28, 56,112,168, 82, 8,133,134,134,134,252, 85,220, 0, 16, 26, 26,122, 63, 52, - 52,244,181,142, 85, 44,176,218,149,154,239,108, 87, 78, 71, 73, 26, 55,116,117, 94,248,245, 71, 74,131, 65,231,147,159,159, 79, -243,249, 34,126, 45, 75,117,114,117, 14,102, 48, 24, 14, 95,188,120,241,131,214,173, 91,139, 99,238,222,134, 54, 39, 7,218,156, -108, 8, 25, 35,108, 36, 65,160, 12, 58, 16,157, 22,206,222, 12,212,185, 18, 92,189,249,200, 96, 48, 24, 14, 87, 90, 33, 96, 89, -198,248, 82, 56, 80, 20,239,149,169, 66,177,185, 25, 68,102,102, 16,155,153,151, 59,133, 88, 17, 28, 29, 29,101,221,186,117,235, - 24, 16, 16, 0,150,101,177,116,233, 82,232,116, 58, 81,177,165, 72,175,215, 35, 47, 47, 15,191,254,250, 43,182,111,223,126,217, -210,210,178,202,165,229,140, 81,123,236,236,229,219,221, 7,127,216, 65,116,234,220, 38, 24,180, 70,228,107,173, 80,160,209, 33, - 79, 45,128, 78,220, 5,132, 92, 4,197, 19,163,101, 99, 79,156,185, 20,163,161, 13,250,227,213, 17, 67,132, 16,104,181, 90,164, -166,166, 33, 51,239, 44,144,151, 8, 59,125, 30,242,159, 61, 65,227, 79,134, 64,167,211, 85,201, 53,107, 4, 49, 76, 31, 8,254, -246,121, 20, 4, 34, 91,189, 87,167, 19, 21,134,138, 48, 51, 51, 43,241,209, 49, 73,168,231,230, 98,199,142, 29,104,222,188, 57, -218,182,109,139,196,196, 68,196,198,198,162,123,247, 63,103,217,110,223,190,141,200,200, 72,120,122,122, 86,193,197, 30,205,204, -124,220,167, 87,175, 94,194,107,215,174,129,101, 89,120,121, 89,194,194,220, 12,132, 18,195,215,215, 30,192, 35, 16, 66,208,174, - 93, 59,232,245, 42, 99, 65, 1,142, 86,198, 25, 17, 17,209, 35, 48, 48,176,142,193, 96,136,246,247,247,231, 39, 39, 39,163,119, -239,222,216,179,103, 79,241,136, 6,211,167, 79,127,229, 63,249,249,249,154,138,248, 26, 53,173,247, 21,205,218,182, 21,137,221, -234, 88,218, 55, 68, 29,175,142, 0,128,247, 66,134,163, 78,221, 90,200, 73,187, 83, 71,167,125,254, 33,143,100, 88,255,114, 45, - 49,170,181,204,127, 88,122,252,185, 24, 0,155, 76,184,230, 44, 33, 36,229,133,192, 98,239,190,223, 14,143,234,217,243,125,190, -129,102,140,254,174,124,203, 61,251,143,164, 38, 62,127,241, 3, 94,156,188, 95,122,255, 74, 4, 22,157,157,157, 13, 51, 51, 51, -196,198,198,106,123,246,236, 41, 86,171,213,136,137,137, 41, 17, 88, 14,118, 54,126,173,154,248,251, 44, 88,177,253,132, 92, 44, - 22,119,105, 23,228, 27, 21,243, 60,129,101, 73, 92,133,188, 44,123, 45,230,193,131, 30,246,118,174, 72, 58,119, 5,242,224,110, -208,106, 9, 52,122, 6, 58, 26, 48,242,132,176,108,212, 20, 82, 15, 95, 48, 44,240,224,238,109, 24, 89,246, 50,247, 8,225,192, -225, 63,139, 74,181, 72,177, 5,171, 69,139, 22,187, 75, 91,153,138, 63, 3,208, 2,168,204, 39, 58,173,180,136, 42,158, 54,172, -232, 56,101,120,107, 38,176, 88,150, 61,143, 74, 86,150,217,217,217, 57,248,122,215,247,216,184,121, 19,244,218, 28,196, 70,109, - 65, 65, 94, 10,102, 45,188,234,233,226,226,210, 54, 33, 33,225,188, 41, 7, 75, 72, 72,216,179,127,255,254, 47, 27,213,175, 31, -224,238,226,130, 59,113,207, 32,100,105, 8,105, 26,148, 94, 11, 62,173,131,139, 31, 3,138,146, 35, 57, 57, 15, 27,142,255,113, - 47, 33, 33, 97, 79,165,163,111,194, 67,173,158, 31, 99,192,123, 61,192, 26,244, 56,217,218, 15, 18, 51, 51,136,173,172,208,242, -215,115, 47, 67, 54, 24, 13,136, 91, 52, 5, 66,185, 25,108,154,183,171,178,156, 41, 41, 41,133,117,235,214, 13,127,248,240, 97, - 19,111,111,111,204,157, 59, 23,241,241,241, 96, 89, 22,169,169,169,154,180,180,180,196,140,140,140, 56, 66,200, 1,149, 74,181, -209,148, 72,225,169, 94,188,173,167, 78,255,241, 85, 96, 99,191,122,157,218,206,193,225,195,223, 34, 59, 55, 23, 5, 90, 62,242, -213,122, 20,104, 88, 40,205, 61,209,172, 97, 0,210, 50,116,136,185, 31,145,144, 46,180,249,169,154,166, 83,220,190,125, 27,110, - 54, 4, 81,209,145,176,211,100,194,219,202, 12, 1,193,173,241,244,233, 83,147, 44, 83, 70, 35,248,227, 39,253,185, 90,208,202, -202, 10, 57, 57, 57,175,252, 79, 38,147, 65,169, 84, 34, 55, 55, 23,251,246,237, 3,107,218, 67,209,160,211,233,224,227,227,131, -155, 55,111,226,244,233,211,232,208,161, 3,218,180,105,131,115,231,206, 33, 60, 60, 28,145,145,145, 32,132,192,214,214,182,216, -218, 86,161,201,237,198,141,219, 97,102,102,100,198,176, 97, 99,252, 7, 13, 26,132, 95,127,221,141,225,195,188, 65, 40, 49, 8, - 17,227,253,158, 62,152, 55, 63, 28,205,154,181,131,157,157, 16,167, 79,223,127,202,231, 91,110, 55, 65,184,252,184,100,201, 18, -190, 68, 34,129, 78,167, 67,126,126, 62, 50, 50, 94,134,163, 42,207,130,165, 86,171, 43, 12,172,118,255,214,163,239,179,114,217, - 44,170, 48,226,195,116,195,173,134, 29,186, 36,224,189,144, 97, 56,117,120, 11,206,156, 56, 13, 59,193,179,167,180, 52,255, 88, -218,211,244, 60, 85,190,215, 6,191,160,207,120, 73, 5, 39,214,127,222,203,154,231,162, 96,194,166,175,205,201,174,170,188,153, - 81, 59, 14, 29, 98,241,126,112,243,166,158, 13, 92,149,162,204,140, 84,236,255,237,216,125,253,179, 95, 15,227,229,180,160, 41, -166,200,121,171, 86,173,250, 22, 0, 24,134,217,186, 98,197,138,207,190,250,234, 43,251,196,196,196, 18,129,149,154,158,121,166, -101,143,241,116, 70,118,142,238,231, 21, 83,123, 75, 37, 98,209,204, 69, 63,159, 51,240,112,173,194,206,133,207, 31,242,245,218, - 95,210,246,133,109,225,217, 75,132,184, 52,109, 54, 98,255, 56, 11, 61, 17,162,203,201,235,208,233,105,228,166,102,224,204,176, -177,176, 86,216,224,104, 70, 12,157,147,151, 59,132,123,198,112,224,240,159,181, 78, 85,166, 69,210, 74, 9,162, 76, 0,113,161, -161,161,233,165,172, 75,105, 0,110, 3,104, 84,180, 95, 90,153,255,165, 1,184, 9,160, 73, 41,158,180, 82, 66,171,244,103, 93, -153,125,110,191,142, 5,171, 82,164,167,167,167,222, 8,191,135,203,167,214,193,104,208, 34, 39,243,101,236, 79, 85,138, 6, 22, - 22, 22, 87, 43,121,224,191,146,109,155,101, 89, 86,161, 80,124,180, 98,229,202,107,163,134, 12,118,106,211,177, 35,158,223,189, - 3,109,102, 58,120, 52, 13, 30, 17, 32, 63, 93,130,148,228, 92,132, 30, 58,150,170,214,104, 62, 42, 59,242, 46, 47,131,119,177, -147, 59, 75, 8, 36,150, 22, 16,203,229, 16, 91, 90,252,105,177, 34, 4, 34, 51,115, 8,228,102,224, 9, 69, 85,150, 19, 0, 10, - 11, 11, 63, 30, 57,114,228,157,163, 71,143, 90, 15, 24, 48, 0,239,191,255,126,100,118,118,118,251,204,204, 76,147,252,205,254, -239,220,195,194,104,187, 6,239,247, 90,179,110,227,149,161, 67,135,218,188,223,107, 13, 34,163,238, 35,187,192, 1, 0,160,180, -147,163,153,247, 20,164,102,104,113,226,216,225, 44,198,168,249,152,189,183,219, 80, 17, 39,203,178,172,157,157,221, 43, 86, 57, - 30,143,135,115,231,206, 97,226,196,137,176, 51, 63,135,188,184, 88, 52,104,221, 22,239, 13, 26,130,225,195,135,131,199,227,193, -214,214, 22,165, 31,186, 85,101, 68,207,201,201,129,187,187, 59, 78,110,244,174,175,211,164, 10, 3,108, 0, 2, 75,253,169, 51, -221,239, 95,184,112, 33, 31,192, 70, 47, 47,175,176,170,234,147, 16,242,205,194,133, 11,215,181,106,213, 74,106,102,102, 6, 47, - 47, 47, 92,190,124, 25,151, 47, 95,198,197,139, 47,253,227,108,109,109, 97, 99, 99,131,236,236,108,196,199,199,171, 9, 33,223, - 84,210,150,152, 38, 77,154,124,112,234,212,129,235, 61,123,126,100,215,181,107, 11, 56, 57,229,193,104, 76, 7,161,132, 16, 75, - 28,176,113,227, 34,164,166,100,226,202,213,171,153,249,249,252,143,195,195, 95, 77, 65, 84, 65, 57,245,199,143, 31,135, 68, 34, -193,175,191,254,106,116,116,116,228, 91, 89, 89, 85,104,193,210,104, 52,226,138, 56, 63,155,122, 55, 17,192,252,201,125, 92,150, - 93,185,159,242, 1,128,157,117,234,186,224,204,137,211,184,120,230,202,244,230,254,204,170, 30, 3,155,206,147,116,232, 59,197, - 47,240, 51,158,153,133, 2,219,246,255,202,139,138,216,244,157,166,224,158, 7,128, 41, 85, 92, 35, 22, 0,242, 83, 83,102,132, - 46, 95,189, 53,116,238,183,210,165, 63,172, 85,169,211,147,191,198,203,165,149,108,233,253, 42, 42,103,108,108,236, 6, 0, 37, -225, 49,148, 74,229,142, 69,139, 22, 93, 24, 60,120,176,125,177,133, 50,245,254,111, 87, 1, 92,245,111,255,233,172,150, 77,234, -123,127,247,195, 47, 39, 94,196,167,252,146, 29,245, 50, 6, 86,121,229,188,122,245,106, 86, 80, 80,208,200, 41,211,230,108,154, - 59,111, 54,241,153, 52, 29,209,151,111, 66,171,214, 67,207,242, 96, 0, 65,196,130,229, 48,183,183,192, 37, 54,147,213,242,168, - 17, 79,202, 56,249, 87,213, 62,107, 2,142,147,227,228, 56,223, 77,206, 42,112,179, 60,123,136, 9,251,221, 52,129,231, 47,129, - 73, 2,203,217,217,185,205,123, 29,155,163,213,123, 99,160,215,102, 35,246,254,207,200,207, 75,129,179,147, 24,177, 47,114, 91, - 0, 56,111,234, 1,147,146,146, 94, 40, 20,138,230,223,173, 92,181,191, 75,211, 38,190, 94,206, 10,177,149,187, 27,228, 14,142, - 72, 79, 75,195,245,136,104,195,218, 19,103,238,169, 53, 26,147, 82,229, 48, 12,195,178, 44, 11,161, 80, 8,150,199,131,223,248, -105,160, 40,170,204,106, 65, 2,139,160, 96, 80,124, 1, 12, 38,250, 12,169, 84,170, 4,103,103,231,143,199,143, 31,255,199,214, -173, 91,169,118,237,218, 53, 62,116,232, 16,243, 58,149,157,126,247, 80,140, 99,131, 15,219,174,250,113,237,190,128,160,230,110, -238,181,221,197,173,106, 89, 66,111,160,145,146,154,129,243, 87,162,180, 49, 81,183,227, 25,189,174, 79,106, 84,197, 81,220, 1, -192, 96, 48,188, 80, 42,149,142,115,230,204,129,209,104, 4, 77,211, 48, 26,141, 72, 79, 79, 71,100,100, 36, 2,155,183,128,207, -167,159, 33, 51, 51, 19,155, 55,111,134,139,139, 11,186,119,239,142,188,188, 60, 92,184,112,225, 69,197, 86, 7, 24,103,124, 51, -144, 15, 0, 2, 1,140, 95,135,132,156,171, 95,191,126,240,251,141, 82,133, 99,198,191,180,108, 45, 94, 52, 80,120,238,220,185, - 48,177, 88,188,225,233,211,167,149,198, 64,243,244,244, 20,105, 52,154,198, 44,203,242,115,115,115, 87,106,181,218,161,147, 39, - 79, 86, 44, 89,178, 4, 13, 27, 54, 68,122,122, 58,108,108,108,160, 80, 40,144,159,159,143,167, 79,159,210,122,189,126, 61, 77, -211,243, 82, 82, 82,210, 42,189,219,110,222,124, 22, 16, 16,208, 34, 37,121,221,254, 49,163, 59,123, 25, 12, 65, 34, 11,203,214, - 96, 89, 35,178,179,226, 65,216, 59,250, 3, 7,255,120,146,157,205,251, 40, 60, 60, 60,198,148,107, 68, 81,212,232,223,127,255, - 29,197,169,114, 84, 42, 85, 44, 69, 81, 21, 90,176, 76,193,242,176, 4, 13,128, 93,203,190,104, 49, 41, 39,237, 78, 61, 59,193, -179,167,205,253,153, 85,203,195, 18, 52,139, 71, 89, 47, 72, 76, 59, 23,173,202, 63,177, 97,219,254, 95,121, 67, 62,252,152, 86, -152,197, 76,183,171,133,176,246,239, 87, 57,218, 99, 27, 53,106,228, 74, 81,153,181, 83, 51, 30,133, 15, 31, 49,170,175,165, 80, -125,180,161,115,122, 93,163,163,159, 36, 42, 42, 42,174,104, 55,182, 58,237, 84,165, 82, 69, 43,149,202, 54,223,127,255,253,137, -178,166,241,212,244,204, 51, 45, 66,198,177,217,217, 57,183, 82,163,126,187, 91, 21, 87,120,120,248,207, 65, 65, 65,248,100,240, -240,159, 70,124, 58,146,231, 63, 97, 42, 18,206,254, 1, 24, 13, 72,186,120, 30, 50,115, 26,135,211,227,232, 66, 30, 53, 50, 60, - 60,156,139,226,206,129, 3,135,127, 13,136,169,125,175,167,135,203, 9,143,218,206,157, 61,106, 43, 1, 0,177,207, 84,136,125, -150,120,242, 73,108, 66,151,154, 40,220,210,201,158, 73, 81, 40, 6,214,132,100,207,101, 57,253,253,253, 35, 41,138, 82, 86,231, -164,105,154, 78,184,127,255,126,144, 41,229, 84, 42,149, 3,106,213,170,181, 72,165, 82,237,143,143,143,255,226, 77,168,251,226, -100,207, 20, 79, 24,194,178,108, 67, 0,132, 80, 84,149,201,158, 75,115, 58, 59, 59, 55,144, 74,165, 27,248,124,190,107,177, 73, -181,184,202,244,122, 61, 47, 39, 39, 71,162,211,233,120, 0,136, 80, 40, 52,154,153,153,105, 4, 2,129,145,166,233, 23, 6,131, - 97, 84, 98, 98,226, 93, 83, 71, 33,126,126,126,242,144,160, 7,249,197, 41,116,102,124, 51, 16,161, 91, 88, 98,202,185, 63,126, -252,184,158,181,181,117, 63, 66, 72,111,150,101,189,243,242,242,180,223,126,251,237,173,243,231,207,231,186,186,186,118,109,221, -186, 53,185,115,231, 14,226,226,226,216,252,252,252,125, 20, 69,125,147,144,144, 16, 91,205,182, 68,181,108,217,184,191,185, 25, -122, 48, 44, 26, 1, 44, 33,132,220,205,207, 39, 71, 21,138,218,191,132,133,133,209, 53, 29,129, 5, 6, 6, 30,201,207,207,239, - 30, 19, 19, 83,209,185,130,101,255,172,139,202, 56,151,125,211,224,155, 22,109,131, 63,190,124,254,226,129,169,223,221,155, 95, -122,219,184, 15,109,134, 15,252,124,226,146,157,107,126,152,186,250, 64,230,207,166,148, 51, 48, 48,176, 14,128,254, 44,203,214, - 39,132,120, 49, 12, 36,132,176,153,132,144, 40,134, 97,110, 51, 12,243,251,157, 59,119, 84,239,194,136,182,116,178,103, 66,211, - 86, 52, 33, 38, 37,123,230, 44, 4, 28, 39,199,201, 89,176,254,169, 48, 57, 2,119,177,144,242,242,242, 98, 31, 63,126,252,202, - 67,165, 38, 40, 18, 80,187, 81, 73,148,118, 83,112,239,222,189,128,191,178,130, 84, 42,213, 46, 0,187,222, 36,103,145,128,250, -185,232, 85, 35, 20, 9,164,102,127, 71, 35,137,138,138, 42,152, 53,130,148, 88,182,248,124, 24, 77,253,111,231,206,157,159,235, -245,250,211, 0, 18, 0, 88, 1,200, 52, 24, 12,199,211,210,210, 82,156,156,156,130,158, 63,127, 62,171,200, 18, 57, 63, 57, 57, - 57,188,134,109,137, 1,176,179,232,245, 70, 17, 17, 17,209, 67,169, 84, 70,218,218,218,122,106, 52, 26,145, 70,163, 17,148,110, -251, 82,169, 52,205, 84, 46, 75, 11,108,227,145, 12, 91,107, 11,242,127,150, 26, 59,103,252,170, 46,184, 87,207,206, 25,191, 86, -163,108, 79, 27, 55,110,188,131,162,168,218, 12,195, 56, 2,176, 96, 89,164,179, 44,155, 78,211,116,194,221,187,119, 85,239, 74, - 71, 83, 36,160, 66,192,129, 3, 7, 14,156,192, 42, 31, 49, 49, 49,132,171,182,255, 30,230,111,100, 5, 53,249, 95, 92, 92,156, - 22,192,149,162,215, 43, 40, 18, 84, 61,223,245,115, 87,169, 84,111, 68,196, 23,249,100,125,209,180,227,255,111, 43, 10,205, 48, -181,195,251,213,227,188,117,235,214, 11, 0, 47,184, 22,202,129, 3, 7, 14,239, 22, 40,174, 10, 56,112,224,192,129, 3, 7, 14, - 28,222, 44, 8,128,114, 67, 92, 87,103,110,149, 16,226, 95,221, 3, 87,197,207,113,114,156, 28, 39,199,201,113,114,156, 28,231, -191,143,179, 42,238,127,139,111, 23,169,230, 2,163,234,145,115, 14,128, 28, 39,199,201,113,114,156, 28, 39,199,201,113,254, 7, -193, 77, 17,114,224,192,129, 3, 7, 14, 28, 56,188, 97, 84,232,228,238,225, 81,203,143,162,153, 86, 44, 75,241, 88,138, 53,144, - 92,245,158, 39,101,130,108,186,186,186, 90, 9, 40,244, 36, 44, 43, 39,132,161, 25, 30,117, 57, 54, 54, 62,202,148, 3,251,249, -249, 9, 1, 12, 21, 8, 4,193,122,189, 94, 33, 16, 8,146, 52, 26,205, 37,129, 64,176, 53, 42, 42, 74,255, 46, 85, 82,112,112, -112,255,125,251,246, 89,133,132,132,104,245,122,189, 81, 40, 20,242,119,239,222, 45, 30, 54,108, 88,246,165, 75,151,106,180, 10, - 50, 32, 32,160,253,226,197,139,235,116,236,216, 17,193,193,193, 5,221,186,117, 19, 6, 5, 5, 9,167, 77,155,246, 52, 50, 50, -242,108,117,184, 28, 29, 29,253,248,124,254,118, 66, 8,143,101,217, 79,138, 67, 48,252, 21, 32,132, 12, 0,208, 7,128, 2, 64, - 50,128,189, 44,203,238,170, 33, 87, 87,188,116,114,111, 88,244,211, 29, 0,191,179, 44,123,252, 53,202,215, 21, 64, 79, 66, 72, - 35, 0, 96, 89,246,246, 27,228,108, 88,196,249,198,202,249,186,231, 30, 24, 24,248,173, 72, 36, 26, 1, 0, 58,157,238,103, 51, - 51,179,208,242,246, 59,127,254,188,174,162,208, 39,126,117, 8, 27,245,187,207,203,207, 61, 31, 2, 0,170,252,254,180,134,171, -136, 31,248,178,229,241,194,247, 65,141, 23,207, 40,149,202,177,221,187,119,159,118,252,248,241,239, 18, 18, 18,126, 2, 7, 14, - 28, 56,188,171, 2,203,195,163,150, 95,239, 15, 62, 90, 56,122,212, 24,194,227, 81,120,240,240, 33,255,243, 9, 95,116,246,245, -245,117,150,107, 52,190, 44,192,168,165,210,123, 60, 30,149,184,110,205,143,230,222,245,234,209, 52,205, 96,253,134,117,221, 60, - 60,106,125, 93,149,200,114,112,112,168,163, 80, 40, 86, 78,152, 48,193,161,115,231,206,148,163,163, 35, 18, 18, 18, 44, 14, 28, - 56, 80,119,243,230,205, 33, 14, 14, 14,147, 82, 83, 83,159,214,228,132, 20, 10, 69,107,133, 53,186, 74,197,108,123,228, 18,168, -141,228,108,146,142, 61,158,148,148,116,177,166,149,164,211,233,198, 23, 22, 22, 54,247,243,243, 99,214,173, 91, 71, 70,142, 28, -201, 18, 66, 40,181, 90,189, 5, 53, 12, 51, 33,149, 74,215,116,236,216,209, 43, 56, 56, 56,246,242,229,203, 61, 0, 28,233,211, -167,143,135, 84, 42,141, 1,224, 93, 29, 46, 30,143,183, 37, 42, 42,170,145, 90,173, 70, 80, 80,208,102, 0,129,127,145,184,218, -108,109,109,109, 88,187,118,237,134,198,141, 27,123,102,101,101, 21,140, 26, 53,170, 19, 33,164, 3,203,178,159, 86,131, 71, 14, - 96,149, 76, 38,227, 77,154, 52,233,216,135, 31,126,120, 91, 46,151,155, 61,122,244, 72, 48,113,226,196, 79, 8, 33,189, 1, 76, - 96, 89,182,160,186,156,182,182,182,210, 5, 11, 22, 68,180,108,217, 50, 85, 34,145, 72,159, 62,125, 74, 38, 77,154, 52,242, 53, - 57,133,243,230,205,187,220,174, 93,187, 88,177, 88, 44,123,241,226, 5,239,171,175,190, 26,254, 58,156, 86, 86, 86,162,111,191, -253,246,106,219,182,109,227, 36, 18,137, 60, 54, 54,150,154, 60,121,242,103,213,225,108,219,182,109,127,138,162,230, 94,184,112, - 1, 0,208,162, 69,139,111,117, 58,221,204,178,251,177, 44,139,224,224, 96, 77,219,182,109, 71,156, 63,127,190,220,246,186, 53, -124, 74,127, 0,248,106, 86,241,247,151,239,229,125, 31, 26,180,180,218,109,222,175,206,203,252, 98,159,127,181,118,240,203,247, -151,191,175, 43,186, 43,215,244, 36,108,117, 68,155,179,179,243,168,166, 77,155,206,184,126,253,250,182,160,160,160,137, 63,253, -244,147, 32, 36, 36,100,129, 82,169,244,236,218,181,107,239,171, 87,175, 46,125,248,240,225, 26,174,139,231,192,129,195, 59, 37, -176, 40,154,105, 53,122,212, 24,210,111, 64,255,228,164,148, 84,198,204,220,114,192,222,176, 48, 89,189,122,245, 40,205,170, 85, - 48,166,167,131,254,242,203,150,231,207,159, 55,140,155,244,165, 90,171, 41,220,162,112,116,144,237,217,181,219,105,255,175,251, - 90, 1,136,170,204,114,165, 80, 40, 86,254,250,235,175, 78,117,234,212,129, 78,167, 67, 90, 90, 26,244,122, 61, 62,252,240, 67, - 94,243,230,205,157,134, 15, 31,190,210,207,207,239,163,234, 88,178,236,237,237, 29,189, 93, 5, 71,231,124,209,181, 94,251, 54, - 65, 82, 39,231,218, 64, 2,131,196,216,152, 38,127, 92,139,152,208,166,174,115,244,163, 28,125,247,180,180,180,148,234, 86, 82, - 70, 70,198,180, 81,163, 70,237,107,216,176,161,189, 88, 44,134,163,163, 35,249,236,179,207, 82,146,146,146,230,213,180,226,139, -163,131, 83, 20, 69,151,121,175, 9,157,139,165,165, 37, 44, 44, 44, 0,192,249,117, 26, 68,159, 62,125,120, 47, 94,188, 24,193, - 48,140,111,233,223,147,146,146, 60,236,237,237,211,159, 61,139,107,164,209,233,155,141,253,106,238,130,126, 61,219, 91, 92,189, -122,149,234,209,163,135,128, 16, 50,160, 26,150,172, 85,222,222,222,119,151, 44, 89,162,123, 16,243,212,255,228,185,171,148,131, -141,156,169,227,238,110,118,255,254,125, 97,104,104,104, 90,104,104,232, 42, 0,195,171, 81,244, 85,239,189,247, 94,252,140, 25, - 51,120, 15,162,159,120, 92,188,122, 11, 22,102, 34,218,213, 69, 41,185,122,245, 42,127,221,186,117,248,250,235,175,171,205,217, -190,125,251,152,249,243,231,179,201,169,153,117,159, 62, 75,130,185,153,200,104,107,107, 43, 61,119,238, 28,217,186,117,171,110, -226,196,137,213,230,108,217,178,229,147,217,179,103,147,135,143,159,214,189,116,245, 22,204,228, 66,163,187,171,139,228,198,141, - 27,228,199, 31,127, 52,124,251,237,183, 38,113,178, 44,187,126,233,210,165,248,237,183,223, 0, 0,187,118,237,130,135,135,199, - 43, 13, 72,173,209,128, 16,130,184,103,207,100,163, 71,143, 94, 95,222,128, 32,234,119, 31,108, 13, 7,134, 14, 29,106, 90,242, -246, 7, 75,171,109,181, 42, 22, 86, 99,198,140, 73,168, 96,175,193,126,117, 76, 23, 89,173, 90,181,154,182,103,207, 30,187,176, -176,176,175, 14, 28, 56, 0, 0,144,201,100,178,213,171, 87,143,237,213,171, 23, 62,253,244,211,105, 0, 56,129,197,129, 3,135, -119, 75, 96,177, 44,197,227,241, 40,164,166,164, 27,222,235,212,121,248,234,181,107,197, 34,145, 8, 58,157, 14, 5,103,206,128, -213,106, 97, 41,149,162,123,247,238, 2,127,127,127,139,145,195,135,127,150,154,146,188,129,199,163,156, 88,150,226, 85,113,204, -161, 19, 38, 76,112,168, 83,167,206, 43, 9,132,105,154, 70, 74, 74, 10,204,205,205,209,183,111, 95,187, 29, 59,118, 12, 5, 96, -146,185,223,209,209,209,221,219,195,225, 74,216,166,175,156, 28,172, 8,144,246, 43,240, 60, 6,216, 41,129,151,131, 27,188, 58, -180,145,246,108,230,223,168,255,146,173,183, 28, 29, 29, 91,166,164,164,196, 85,167,146,158, 61,123,118, 73,169, 84,142,208,104, - 52, 7, 1, 80,151, 47, 95,102, 95,188,120, 49, 58, 57, 57,249,121, 77, 43,158,166,105,100,103,103,131, 97, 24, 30,128,146,119, -218,196, 84, 62,127, 5,250,244,233,195,139,143,143, 31,229,235,235, 91,119,227,198,141, 72, 77, 77,133, 68, 34, 1,195, 48,104, -209,162,133,107,167, 78,157,158,164,101,230, 88, 27,141,180, 62,225,249,179,160, 69, 75,111,165, 53,242,243,190, 20, 22, 22,214, -216,206,206,174, 47, 76, 8,200, 74, 8,233,106,110,110,206,255,238,187,239,212, 78, 46, 30,253, 20,174, 94,130, 43, 55,239, 70, - 11,101, 34, 54, 35, 39, 47,239,214,173, 91,209,115,231,206,109,115,244,232,209, 84, 66, 72, 87, 83,166,204, 8, 33, 93,109,109, -109,165,211,167, 79, 39,150,182,202,247,130,219,184, 10, 34,238, 68, 61, 17,201, 68, 76,112,112,112,207, 43, 87,174,108,158, 60, -121,114,227, 35, 71,142,228, 86,135,211,198,198, 70, 48,111,222, 60,218, 81,233,214,203,181,118, 93,129,179,147,157, 31, 0, 60, -138,126,188, 41, 37, 37,229,201,232,209,163,155, 29, 59,118, 44,175, 58,156,150,150,150,194,111,191,253,150,245,245,111, 60,188, -126,195, 64,234,247,147, 23,174, 74,229, 34, 58,183, 64,157, 31, 21, 21,245,100,234,212,169, 77,143, 28, 57, 98, 18,103, 97, 97, -161,185,139,139, 11,156,156,156,192,168,213,200,205,205,197,254,253,251,145,151,151, 7,154,166, 33,149, 74,241,195,241, 76,104, - 30,255,142, 13, 43,231, 65,173, 86,155,191,137,118,226,215,243, 33,162, 76,181, 47, 63,240,101,215, 93, 28, 55,184, 18, 97,133, - 82,194,107, 48, 30,248,178,149, 77, 23,150,178, 92, 37,132,133,133, 57,120,122,122,162, 93,187,151, 9,220,135, 15, 31,142, 78, -157, 58,225,183,223,126,195,201,147, 39, 95,124,248,225,135, 79, 35, 34, 34,150,198,199,199,175,231,186,122, 14, 28, 56,252,221, - 40,215, 92,194, 18, 82,112,255,193, 3,129,153,149,213,224,213,107,215,138, 5, 2, 1,226,226,226, 16, 21, 21,133,194, 51,103, -160,190,114, 5,169,169,169,200,203,203,131,189,189, 61, 66,151, 46,149, 11,165,242,225, 49,143, 31,243, 88,138, 53,148, 26, 97, -255,223, 10, 3,145, 72, 20,220,189,123,119,170,162,213,139,201,201,201,232,220,185, 51,159,207,231, 7, 87, 48,106, 47,155,156, -151, 40,237,201,239,123,127,154,228,228,192,191, 11, 60,158, 8,100, 95, 4,140,217,128, 58, 31,120,118, 23, 56,240, 61, 92, 50, - 31,147,157, 19,250, 56, 58, 75,133,191,147,210, 25,146, 81,245,146, 80, 23, 23, 23, 15, 79, 79,207,141, 31,127,252, 49, 5, 0, -193,193,193,196,211,211,115,131,139,139,139, 71, 37,214,133, 74, 57, 53, 26,205,181,172,172, 44,210,163, 71, 15,219,150, 45, 91, -158,234,209,163,135, 45, 0,162,209,104,174,213,148,179, 8,182, 29, 58,116,200,240,240,240,216,229,238,238, 46, 54,193, 10, 82, -194,249,226,197,139, 17, 62, 62, 62,117, 55,110,220,200,227,241,120,248,233,167,159,176,119,239, 94, 92,184,112, 1,105,105,105, -178,201,147, 39, 91, 29, 58, 19,121,250,212,197,219,135, 39,141, 25,197,188, 23,216, 88, 33, 78, 79,206,176,181,181,237, 6,192, -201,196,114,246, 28, 63,126,252,209,200,168,103, 78,132, 39, 22, 11,133, 66,137,147,163,157,131,194,193,209, 93,225,224, 88,207, - 92, 38,179, 46, 40, 40,120,113,240,224, 65, 22,165,130,144, 86,197, 57,119,238,220, 27, 81, 49, 47, 28, 88, 74, 40, 18, 10, 5, - 66, 59,107, 43,155,222,239,119,238, 9, 0, 50,177, 88, 86, 80, 80,144,180, 99,199,142,106,113,206,158, 61,251, 98, 98, 74,182, - 19, 95, 32, 20, 75,196,226,146, 44,225, 54,214,150,206,102,114,185, 76,167,211,197,111,220,184,209, 88, 29,206,153, 51,103, 94, -126,240,248,133, 35, 69,241,120, 20, 69,248,246,182,214,118,182,182,182, 10, 91,107, 27,103,169, 72, 36,207,207,207, 79,216,181, -107, 23,109, 42,103, 74, 74, 10, 30, 62,124,136, 90, 77,154,224,244,233,211,168, 85,171, 22,250,244,233,131,126,253,250, 65, 42, -149,162,169,213, 19,124,216,181, 37,158, 60,121, 82,225,117, 47,246,135,170, 12, 74,165,242,124,117,218, 18,240,114, 90,176, 50, -113, 85,150,179,188,253,202,114,182,106,213,106,218,254,253,251,237, 86,172, 88,209,248,139, 47,190,136,221,191,127, 63, 26, 54, -108,136, 7, 15, 30,192,217,217, 25,187,119,239,198,184,113,227, 98,231,204,153,211,120,239,222,189,142,254,254,254,211,107,120, - 31, 85, 11, 28, 39,199,201,113,114, 48,201,130,101, 96,240,251,248,137,147,123,254,186,127,191, 76, 36, 18,225,217,179,103, 72, - 73, 73,193,209,195,135,233,163, 13, 26, 20,242,120, 60,246,163, 95,127, 53,239,211,175, 31, 17, 10,133,168, 91,183, 46,186,119, -239, 46,253,108,228,152, 84,126,129,122, 79, 21, 23,197,193,222,222, 30,211,167, 79, 71,104,232,171,254,184, 67,135, 14,197,202, -149, 43, 97,110,110, 14, 66,136,131, 41, 39,160, 80, 40,250, 12,255,170,125, 45, 11, 55,139, 20, 54,114,139,128,128,178, 1, 95, - 6, 80, 34, 64,102, 6, 48, 52, 96,208, 65, 27,126, 37,147,109,183, 58,183, 75, 64,129,115,178,110, 87, 31, 0,123, 77,173, 36, - 59, 59,187,153, 97, 97, 97,246, 83,167, 78,101,243,242,242, 72,106,106, 42, 59,117,234, 84,251,153, 51,103,206, 4, 48,180, 38, - 21,175, 82,169, 22, 12, 31, 62,188,203,207, 63,255,236,244,241,199, 31, 91, 21,141,192,147, 85, 42,213,130,215,185,160, 2,129, -128,119,230,204, 25,155,245,235,215,247, 95,176, 96, 65,253,142, 29, 59, 58,101,103,103,199, 37, 37, 37,245,174,202,226,198, 48, -140,239,198,141, 27,193,227,189, 52, 66,242,120, 60,136, 68, 34, 72, 36, 18, 88, 90, 90,102, 63,125,250,212,232,110, 43,228,191, -120,145, 92,232,166,116, 49,183,108,228,231,232,224,226,250, 81, 65, 65, 65, 4, 76,207, 10,208,176,107,215,174,151, 15,157,189, -131,177,159,118,170,199, 39, 58,190, 68, 34,172, 39, 19, 10,136,128, 98, 89,198,200,210,155,247, 92,254,205,205,205,205,151, 16, - 98,210,116, 39, 33,164, 81,235,214,173, 19, 79, 95,139,162,174,223,138,137,117,180,145, 91,125,216, 45,184,121,201, 1, 3, 2, -250,149,218,215,212,212, 54, 13,219,181,107,247,240,113, 66, 6,229,170,180,123,197, 39,206,222,222,190, 11, 0, 20,230,231,110, - 85, 40, 20,222, 98,177,216,212, 92,152, 13, 59,116,232, 16,115,250,218,125,202,201,222,170,184,125,191, 50,144, 72, 79, 73,218, -225,230,230, 86,143, 16,226,100, 10,225,193,131, 7,113,235,214, 45,204,243,243,195, 84, 55, 55,216,219,219,227,204,153, 51, 96, - 89, 22,114,185, 28,217,217,217, 8, 11, 11, 43,177,242,188, 14,148, 74,229,121,149, 74,213,182,196, 49,253, 13,160,152,211, 84, -235,216,165, 75,151,246,135,133,133,141,245,244,244,196,176, 97,195, 60,182,108,217, 18,235,237,237,237, 17, 28, 28,140, 75,151, - 46, 97,234,212,169,177,115,230,204,241, 24, 58,116, 40,182,110,221,138,219,183,111,111,227,186,121, 14, 28, 56,188, 53,129, 69, - 8, 97, 89,150, 37,197,239, 47, 94,188,200,246,245,245,117,246,244,244,164,116, 58, 29,114,114,114,112,226,216, 49,122,247,222, -189, 71,116, 58,221, 4,138,162,132, 91,183,111, 95,239,224,232,216,190,119,159, 62,196, 96, 48,160, 99,199,142,162, 51,103,206, -216,222,121,241, 34,175,178, 3,242,120,188, 18,235,209,216,177, 99,177,114,229, 74, 0,192,144, 33, 67,254, 20,120, 6, 3,202, - 24,153, 42,132,204,146, 14,105,219,169,190,121,188,252, 71,115, 77,203,220,188, 58,209,206, 87,204,242,228, 77,193,151,240, 33, - 51, 3, 99,132, 49, 38,191,121, 68,236,243,218,190,146,163,169,181, 91,121, 55,197,222,171, 7, 66,170, 35,176,164, 82,105, 83, -185, 92,142, 7, 15, 30,100, 6, 5, 5,101, 91, 88, 88, 88,122,121,121,217, 73,165,210,166, 53,173,248,148,148,148,103,206,206, -206,109, 63,250,232,163,207, 41,138,234,196, 48,204,233,140,140,140, 53, 41, 41, 41,207, 76,249,191,179,179,243, 24,150,101,103, - 3,216, 87,252,155, 94,175, 7, 69, 81, 96, 89, 22, 61,123,246,196,162, 69,139,252, 78,159, 62,141, 11, 23, 46,216, 12, 28, 56, -240,154, 82,169,204, 38,132,124,154,152,152, 88,161,149, 44, 35, 35, 3,235,214,173, 3,143,199,131,149,149, 21,204,205,205, 33, -145, 72,208,174, 93,187,148, 37, 75,150,120,133,133,133, 25, 50,234,166,178,162,252,156, 2, 91,169,151,146,178,179,175,243,249, -200, 81,215, 1,132,153,122,238,102,102,102,230,230, 60,117, 62,143,213,240, 86,172,218,192,151,241, 41,200, 5, 66, 72,168,124, - 50,227,219,249,172,132,240,100,168,102, 26, 39,161, 80, 40,179, 20, 65, 39,148, 9,104, 51,153,232,141,164,115,146, 74,165,114, - 51, 33,116, 21,109, 23, 81,124, 17, 0, 9, 33,164,208, 84, 78,137, 68, 98,102, 33, 98,181, 21,109, 55, 23, 8,133,132, 16, 9, -128,114,157,220,251,116, 34,108,216,202, 98,129, 35, 41,249,157,166,105, 52,105,210, 4,123,127, 59,141, 19, 23,239, 35, 51, 33, - 10,131,251,116,131,187,187, 59, 24,134,169,180, 76,197, 62, 88, 38, 12, 10, 94, 10,162, 83,150, 85,239, 92,228,119, 85,213,212, - 96,105,206,151,226,170, 98, 31, 44, 23, 23,151,145,141, 27, 55, 30,114,224,192, 1,180,111,223, 30, 33, 33, 33,240,246,246,246, - 24, 56,112, 32, 0,160, 77,155, 54, 8, 13, 13,245,232,223,191, 63, 14, 30, 60,136,163, 71,143, 34, 40, 40,104,162, 82,169, 76, - 85,169, 84,107,185,238,158, 3,135,119, 27,101,181,200,191,210,130, 5, 0, 98,189,222, 91,179,110, 29, 10, 79,159,134,232,212, - 41, 28,105,212, 40,223,104, 52,126,169, 82,169,226, 1,192,209,209,113, 82,216,190,125,151, 59,159, 61,107,161,123,240, 0,181, -238,221, 3,191, 94,189,198,166, 30,184,216,122,165,215,191,244, 99,223,182,109, 27,114,115,115,145,147,147, 3,163,209,228, 92, -194, 16, 8, 72, 43, 7, 59, 87, 36, 33, 6, 12,159,111,254,204, 79,215, 82,174,182, 72,172,245,204, 46, 63, 71,208,136, 68,167, - 54, 50,215,228, 25,154, 81, 66, 29,116,217, 26, 40,109,157,193,167,248,173,170, 83, 73,197, 22, 29,169, 84,154, 25, 17, 17,241, -126,235,214,173, 15, 1,176, 43,254,189,166, 72, 76, 76,124, 12, 96, 98, 77,254, 75, 81,212,236,115,231,206, 57,132,133,133,141, - 91,189,122, 53, 11, 0, 58,157,174,196, 73, 94,167,211,129,207,231,131, 97, 24,200,229,114,240,249,124,199, 3, 7, 14, 56,246, -234,213,107, 13,128, 10,175,147, 76, 38,131,163,163, 35, 4, 2, 1, 44, 45, 45, 81,144,155, 37, 95,183,112,102, 59,153,181,163, -205,196,137, 95, 82, 67,135, 14,189,191,122,245,106, 23,165,103,221,250, 15, 31, 62,124, 49, 96,216,240,203,187,119,239,206,175, -134,131,251,157,216,216, 88, 81,125,223,186,146, 35,251,242, 25, 25,159,133, 44,253, 59,200,164, 10,136, 68, 46,144,137,197, 16, -138, 68,118, 73,201,201, 41, 44,203, 62, 49,133,144,101,217,219, 79,159, 62,229,213,118,117, 18,229, 21, 26,243,100, 60,218,252, -113,228,157,232,186, 1, 13,235, 1,128,230,193,157,115,226,218,158,162,164,172, 28,177, 82,169,140,170, 70, 57,133,142,142,142, -162,251, 15, 30,111,180,179,177,112,117,116,116,120, 15, 0, 12,234,194,251, 68,167, 81,241,248,124, 69,102, 86, 86,154, 70,163, -121,108, 42,103,116,116, 52,223,211,221, 69,188,255,240,169,159, 29, 44,204,106,217, 73,197,142, 22,114,161,153,136,166, 11, 68, - 12,173, 18,138,197, 78,170,228,228,116,150,101,163, 43, 34, 89,119,113,220,224,151,159, 54,239, 40, 58,255, 98,235, 14,174,196, -178,176,182, 87, 34, 35,254, 17,206,252,126, 16, 67,198,142, 51,233,126, 90, 54,127,216,238,101,243,135, 85, 24,158,161,140, 32, -130,234,117,211, 72, 63,240, 61,255,255,156,149,119,168, 93,187,118,253,230,167,159,126,146,149, 80, 60,120,128,224,224,151, 6, -192,185,115,231,162, 75,151, 46,240,242,242, 66, 84, 84, 20,220,220,220,176,127,255,126,240,120, 60,193,200,145, 35,167, 1,224, - 4, 22, 7, 14, 28,254, 86, 84,184,100,141, 97, 89,134,206,202, 2,171,211, 21, 91, 8, 88,150,101,101,127, 10, 27,129,204,202, -202,138, 8,156,157, 65, 36,146, 98,249,249,218, 30,218,124, 62,191, 90, 2,139,166,193, 3, 49,128, 5, 11,128, 2, 1,133, 66, -169, 8,115, 28, 67,200, 12,197, 52, 94,154,204,154, 16, 30, 5, 66, 17,128, 0,172,129, 1,205,210,213, 85, 70,108,126,126, 62, -180, 90,173,181,167,167,231, 17,141, 70, 99, 93,244, 96, 99,223,214,133,163,105, 58,150,162, 40,124,242,201, 39,192,203,148, 71, -208,233,116,136,142,142,134, 70,163,129, 78,167, 67, 84, 84, 20,114,115,115,161,211,233, 16, 30, 30, 14, 55, 55, 55,240,249,124, - 69,101,188, 70,163, 17,246,246,246, 80, 40, 20,208, 22,228,202,127,253,105,101,143, 37,115,103,216, 13,240,100,169,205,171,190, -103,234,213,171,151, 93,191,126,125, 59,169, 84,154,213,176, 97,195,140,221,187,119, 31,168, 78,136, 6, 0,191,207,152, 49,163, - 89,187,118,237,188,172,204,165, 6,185, 4,144,241, 10, 32, 98,213, 16, 24, 83,224, 85,167, 46, 67,100, 50,239,254,253,251,107, - 1,252,110, 42,231,228,201,147, 61,253,253,253, 21,214, 22,226, 2,169,144, 36, 75,120,116, 82,118,212,157,107, 0, 32,182,178, - 81, 67, 44,245, 31, 50,100,136,186, 58,156, 83,167, 78,245,173, 93,187,182,147,144,207, 22, 18,218,248,167,164,208,106, 82,120, - 2, 97, 33,132,194,128,137, 19, 39,234,171,195,249,213, 87, 95,249, 52,106,212,200,209,222, 82, 82, 32, 21, 64, 37,229,209, 42, -129, 78, 27, 47, 52,234, 82, 36,214,214,133,144,202, 26, 15, 30, 60, 88, 87, 17,103,177,245,170,172,101,136,207,231, 67,165, 82, - 33,243,217, 21,100, 62,187,139,122, 84, 30,154, 57,218,195,204,204,172,234,251,201,247, 1,137,122,202,146,168,167, 44,129,239, - 3, 82,222,247,114, 68, 86,165,109,191, 82,191,174, 7,190,231,107,194,121,244,232,209,197,189,122,245, 50,244,235,215, 15,167, - 78,157, 2, 33, 4,151, 46, 93, 66, 98, 98, 34,186,116,233, 2,150,101,113,235,214, 45,232,245,122, 60,120,240, 0,189,123,247, - 70, 72, 72, 72,225,241,227,199,191,227,186,122, 14, 28, 56,188, 45,129,213,142, 16,194, 2, 40,113,212, 48,136,197,247,153,241, -227, 97,249,219,111, 16,196,196,160,247, 71, 31, 89,136,197,226, 85, 10,133, 34, 80,169, 84,182,146, 74,165,107, 38, 79,158,108, -110, 27, 26, 10,229,133, 11, 72, 58,117, 10, 6,129,224,102,117, 14,174, 86,171,139,173, 49,208, 21, 9, 57, 43, 43, 43, 48, 12, - 3, 83,181, 11, 75,227,106, 82, 90, 12, 68,112, 7, 11,228, 29,203,235,112,117, 64,236, 60,199,211,121,245,234,197,228, 10, 60, -151, 56, 52,179,219, 88,187,229, 77, 53, 17,228, 11, 45, 68, 80,169, 84, 96,193, 92,173, 78, 57, 53, 26, 77, 78, 65, 65, 1,241, -244,244,180,139,136,136,240,172, 91,183,174, 45, 0,162,213,106,111,188, 78,229, 43,149,202, 22, 1, 1, 1,123, 3, 3, 3,159, - 6, 4, 4,236, 85, 42,149, 45,170,241,247,205,145,145,145,224,241,120, 24, 57,114, 36,242,242,242,160,211,233, 16, 31, 31,143, - 23, 47, 94, 64,167,211,225,254,253,251,120,248,240, 33,116, 58, 29,110,221,186, 5,173, 86,107,138,112,131,185,185, 57,178, 51, - 82,229,123,214,125,223,227,187,185,179,164, 57,143, 35,144,160, 74, 1, 67,171, 85,179,102,205,138,245,244,244,188,164,213,106, -125,140, 70, 99,119,150,101,247, 84,195,252, 75, 1,184,229,237,237,221,110,217,178,101,173,230, 45,222, 46,178, 52,203,133,216, -202, 6, 34,107, 25, 68,110, 65, 24, 50,101, 57,127,195,134,181,119, 46, 93,186,148,102,226,202, 60, 10,192,173, 38, 77,154,180, - 74, 78, 78,110, 27, 16, 16, 16,228, 92,187,182, 92,238,164,200, 18, 59, 41,211, 25,173,230, 26,156,156,219,108,219,182,237,198, -217,179,103,147,170,195,233,230,230,214,102,237,218,181,205,220,221,221,155,201, 44, 44,204, 52,121,121, 59,140,133,133, 97, 60, - 51, 51, 17,164,242,206,199,143, 31,191,180,123,247,238,228,234,112,250,250,250,182, 14, 13, 13,109, 18, 24, 24,216,204,197,195, -195, 76,234,224,148, 33, 87,186,164, 74,189,252,132,112,114,233,180,109,219,182, 43,231,206,157, 75, 50, 53,224, 40, 69, 81,224, -243,249, 48, 51, 51,195,249,243,231, 17,210,218, 27, 10, 42, 19, 13,221, 21,232, 54,236, 83,156, 60,121, 18, 2,129, 0,175,107, -109, 45, 11, 83, 4, 81,117,197, 87, 85,156, 42,149,106,109,120,120,248, 15,125,251,246, 69,167, 78,157,112,251,246,109, 76,157, - 58, 53,246,220,185,115, 0,128,219,183,111, 99,193,130, 5,177, 87,175, 94,197,176, 97,195, 16, 28, 28,140, 91,183,110,109,227, -130,143,114,224,240,143,193,255,105,145,127,188,192, 98, 89,246,124,233,119, 79, 27, 27,115,141,166, 48,225,252,249,243,122,138, -162, 32,149, 74,209,167, 95, 63,106,225,119,223,181,254,160, 81,163, 51,131, 90,182, 60,182,103,207,158,128,128,128,128,146, 78, -254,208,161, 67,234,156,156,236, 12, 87, 87, 87, 43, 83, 15,158,158,158, 14,224,229, 20, 92, 65, 65, 1, 88,150, 45, 25,113,155, -234,131, 85,144, 75,157,186,116,254,126, 54, 75,143,125,209, 57,102,181, 97, 81,210,199, 45,242, 24,150,159,207, 24,144, 83,200, - 34, 79,203,242,175,179, 86, 77, 70,121,133, 24, 98,219, 53,125,116,245, 89, 68,166,154,213,157,170, 78, 37,101,101,101,205, 28, - 59,118,108,186,163,163, 35, 49, 55, 55,135,163,163, 35, 53, 98,196,136,180,248,248,248,249, 53,173,120, 63, 63,191,254, 45, 91, -182, 60, 20, 25, 25,217,123,239,222,189,238, 97, 97, 97,125, 90,182,108,121,200,207,207,175,191,137, 20,123,151, 45, 91, 86, 32, - 18,137,208,188,121,243, 18,129, 85,217,171,120, 58,182, 50, 48, 12, 3,137, 68,130,176, 77, 43, 59,127, 55,119,150, 52,227,193, - 85,220,185,116, 10,199,159,105, 11,103, 47,250,225,154, 68, 34,169,217,249, 58,200, 27, 52,247,114,122,248,205,248,225,177,179, -102,205,146,223,185,115, 71, 54,113,194,120, 54, 41, 57, 7,226,122, 63,128,170, 61, 27, 15,147,237,208,173,123, 27,118,198,148, -207,155, 0,152, 80, 29,206, 9, 19, 38,200, 22, 47, 94, 92, 24, 28, 28,156,147,155,155, 43,145, 91,219,250, 11, 45,173, 27, 38, -103,102,137,218,180,105,115,123,248,240,225,153, 12,195,140,175,110, 57, 47, 95,190, 44,238,222,189,123, 65, 94, 94,158, 76, 32, -149, 6, 80, 18, 73, 96, 78,126,161,168,255,128, 1,145, 61,122,244,200, 99, 24,102, 66,117, 57, 31, 61,122, 36, 14, 14, 14,206, -207,205,205,149,153,219,217, 55,230, 91,217, 4,168, 50, 50, 69,193,173, 91,223, 26, 62,124,120,110,101,231,222,103,210,159,226, - 68, 42,149,102,248,250,250, 98,230,204,153,152, 61,123, 54,250,244,233,131,196,196, 68,116, 29, 56, 8,141,134,140,192,217,123, - 81, 72, 74, 74,194,215, 95,127, 13, 47, 47, 47, 80, 20,149,244,119,137,172,138, 28,225,253,234,144,243,149,249, 89, 85, 37,178, - 58,119,238, 60,172, 87,175, 94,248,237,183,223, 74, 28,218,251,245,235, 7,161, 80,136,198,141, 27,227,203, 47,191,244, 88,182, -108, 89,236,242,229,203,209,162, 69, 11,184,184,184,188,207, 61,179, 56,112,248,103,160,172, 22,249,167,131, 95,234,196, 74, 58, - 61,214, 66,218,239,167,181,107, 44,199, 77,250,178,192,207,207,207,218,209,209, 17, 20, 69,161,107,183,110,164,197,137, 19,230, - 2,133, 2,182, 13, 26,128,101, 89, 48, 12,131,139, 23, 46,224,204,153, 51, 5, 59,126,222,236, 60,252,179,207,122, 2,216, 86, - 73, 5,178, 69, 35,122,164,165,165,193,201,201, 9, 60, 30, 15, 18,137, 4, 42,149, 10, 78, 78, 78, 16, 10,133,224,241,120,252, -162,212, 47,149, 78, 59, 58, 57, 57,109, 15, 93, 16, 53, 61,190,225, 87,117,130,101, 20, 57, 86,144, 12, 10, 4, 70,150, 1,165, -102,193, 48, 44,180, 6,160,190, 51,207,250,180, 22, 86, 55,238,159,122,234,228,228,180,189, 58,149, 20, 27, 27,123, 86,161, 80, -140, 46, 40, 40,216, 7,128,186,118,237, 26,243,236,217,179,207, 77,117, 72, 47, 15, 82,169,116, 74, 88, 88,152,205,252,249,243, -179,206,156, 57,147,211,161, 67, 7,203,208,208, 80,219,254,253,251, 79,129, 9,209,225, 85, 42,149, 90,169, 84,110, 75, 73, 73, -249,188, 73,147, 38,200,204,204,132, 78,167, 67,100,100, 36,234,214,173,139,240,240,112,120,123,123,227,198,141, 27,240,241,241, - 1, 77,211,208,104, 52,160, 77, 8,180,165,138,127,110, 38,211,102, 89,168,174, 31,197,163, 59,225, 56, 26,171, 45, 92,250,243, -158,163, 13, 26, 7, 21,152, 42,124, 75,195,219, 81, 94, 95,105,111,123, 98,249,178, 69,230,137,215,143, 97,239,134,229,236, 31, -135, 15, 7,138, 45,240, 73,139,247,198,245, 49,232, 81,139, 97, 33, 12, 14,110,137,158,129,247,137, 64,139,172, 63,194, 43,143, -100, 94, 30,231,190,237,187, 2, 52, 64,253, 58,117,234,244,228,241,120,246, 0,244, 52, 77, 71,193,196, 20, 52, 21,149, 83, 3, -212, 87, 40, 20, 61, 37, 18,137, 51, 33, 68,173, 86,171, 99,222, 4,167,135,135, 71, 79, 30,143,167, 4, 80, 72,211,116, 52,170, -153, 42,167, 83,167, 78, 75, 55,111,222, 60, 89,171,213,218,150,178,182,146, 99,199,142, 65,167,211, 65, 36, 18,177,114,185, 28, -241,241,241, 44,128, 36,150,101, 71,191,169,142,227,227,143, 63,198,181,107,215,230, 2,152, 93,217,126,153,153,153,124, 27, 27, - 27, 99, 85,194,203, 84,206,235,215,175, 47, 30, 49, 98,196,148,227,199,143, 39,204,153, 51,167,241,208,161, 67,113,240,224, 65, -184,186,186,226,209,163, 71,152, 60,121, 50, 8, 33, 30,203,150, 45,187,181,123,247,110, 69,114,114,242,247,220, 99,139, 3,135, -127,148,200, 34,255,150,115, 41,215,201,157, 48, 68,224, 85,183, 46,173, 43,204,223,242,217,176, 97,163, 67,151, 44,145,249,249, -249,193,104, 52, 66,115,227, 6,116, 18, 9, 44,191,253, 22, 20, 69,225,250,181,107,152, 48,126,124,190,166, 48,127, 83,237,218, -238,254,132,101,229, 37, 60,229,100,219,214, 21,207, 5,226,229, 20,161, 90,173,134, 80, 40,132,153,153, 25,210,210,210, 32, 18, -137, 32,149, 74,209,168, 81, 35, 42, 55, 55, 55, 4,192,111,175,148,173, 12,103, 68, 68,132,193,217,217,185,247,111, 67, 38, 30, -237,188,109,133,211, 72,171,218,228,146, 58, 3,105,180, 22, 44, 0,123,115, 10, 94, 78, 20, 12, 5,169,236,221, 45, 3,146,136, - 49,167,119, 68, 68,162,161, 50,206,178, 80, 42,149,245,234,215,175,191,166, 75,151, 46, 20, 0,180,110,221,154,146,203,229, 63, - 42,149,202, 40,149, 74, 85,174, 51,114, 85,156, 18,137, 68, 12, 0,167, 78,157,202,188,124,249,114, 8, 77,211,135, 7, 12, 24, - 96, 93,252,187, 41,156, 20, 69,253,180, 97,195,134,207,151, 46, 93,138,212,212, 84,232,116, 58,104,181,218,114,173, 87, 78, 78, - 78, 56,125,250, 52, 24,134, 57, 82, 85, 57,125,253, 27,230,111,227, 91,165,108, 61,244,135, 99, 38, 35,201, 95,250,243,158,227, -213, 17, 87,165, 57,235, 43,204,188,157,237,109, 79,124,191,116,145,121,198,131,171,120,124, 55, 28, 71,175, 39,222, 82,179,108, - 34,128,133, 69, 47,180, 15, 36,113, 39,246, 77,183, 71,108, 8,142, 95, 1,251, 26,156,137, 0,142,191,225,114,190, 51,156, 97, - 43,125, 74,210,203,204,154, 53,235,198,172, 89,179,250, 86,248,199, 7,190,231,225,123,151,212,164,125, 86,114, 47, 64, 85,228, -225,174, 82,169,230, 0,152, 83, 46,167,239, 3,178,166, 39, 97, 1, 84,185,146,208,100, 78, 0, 69,233,111,214,244,232,209,227, -121,113, 40,134,125,251,246, 97,254,252,249,216,181,107, 23,178,178,178,208,178,101, 75,184,184,184, 56, 92,191,126,189,206,155, - 60,119, 83,175, 17,199,201,113,114,156, 28,128, 10,156,220, 9, 97,104,154,102,224,224,232, 96,158,150,154,186,122,236,216, 49, - 25,243,230,205,211,156, 63,127, 30,186,135, 15,161,137,140,196,233,211,167, 49,113,226,196,194, 81,163, 71, 39,105, 10,243, 87, - 58, 57, 58,216,209, 52, 3, 66,152, 74, 45, 36, 20, 69,197,198,196,196, 0, 0,180, 90, 45,126,252,241, 71,131, 94,175,135,133, -133, 5, 88,150,197,198,141, 27, 25, 0,232,216,177,163, 92, 32, 16,152,148,130, 36, 49, 49,241, 78,110,188,170,243,175,253,199, -196, 62,216,253,123,110,131, 12, 29,250, 74, 20,248,160, 1,139, 58,146,231,120,113,245,231,156,171,235, 63,138, 45,204,138,239, -146,152,152,120,167,186,149,228,228,228,244,237,206,157, 59, 29, 34, 34, 34, 88,173, 86,139,196,196, 68,118,202,148, 41, 14, 78, - 78, 78,223,190, 78,251,204,206,206, 6, 69, 81, 76, 81,189, 20,175,165, 55, 89,189, 39, 36, 36,220,219,183,111,223,111,103,207, -158,133,139,139, 11,104,154, 46, 17, 88,165,223,249,124, 62, 8, 33, 88,191,126,125, 54, 33,100, 70, 85,188, 34,145, 8, 27,246, - 30, 61,246,213,186,253,123,247,158,190,177,191,166,150, 43, 0,144,153, 91,204,255,126,233, 34,203,226,169,198,157, 17,170, 92, - 66,179,229, 79,213,233, 19, 95,182, 17, 2,246,141,113,254, 21,229,124,139,156,111, 19, 69, 66,136, 40,149, 74,252,250,235,175, -213,246,193,242,171, 67,254,207,185,189,166,156,247,238,221, 91,212,183,111,223,148, 57,115,230,172,213,104, 52, 5, 69,131, 55, -253,247,223,127,191,108,220,184,113, 41,137,137,137,156,229,138, 3, 7, 14,239,158, 5,139,225, 81,151,215,111, 88,215,109,207, -174,221, 78, 60, 30,229,244,244,233,179,155,159,124,250,105,226,133, 11, 23,108, 4,117,235, 54,165, 40,138,209, 77,159,126, 53, - 63, 55, 39,115,251,150,159,221,106,215,118,111, 84,148,236,153,101,120,212,229,202, 14,152,153,153,185,117,210,164, 73, 77,183, -109,219, 38, 92,186,116,105, 65, 98, 98,226,201,235,215,175,119, 91,187,118,173,100,227,198,141,133, 57, 57, 57,135,142, 30, 61, -218,171,125,251,246, 70,157, 78,103,114,124,161,148,148,148, 40, 66,136, 15,181,124,227,192,232, 13, 59, 58,179, 60,170, 37, 52, - 66, 16,150,190, 66, 25,243, 79,166,170, 84, 59, 89,150, 53,214,164,146, 36, 18, 73, 35,169, 84,138,199,143, 31,103, 53,109,218, - 84, 39, 18,137, 4,238,238,238,182, 18,137,164,209,107,152, 65,217,172,172, 44,176, 44,203, 7, 64,104,154,230, 3, 0, 83, 85, -208,162, 50, 16, 10,133,253,135, 15, 31,254,219,218,181,107, 59,119,236,216, 17, 30, 30, 30, 48, 24, 12,240,246,246,134, 78,167, -131,151,151, 23, 52, 26, 13,126,248,225, 7,228,231,231, 79, 78, 76, 76,204,170,140,143, 97, 24,136,197, 98,136, 68, 34,120,251, -250, 23, 74, 36, 18,212, 84, 92, 1,128, 92,132, 58,241,215,142,224,241,221, 8,236,137, 76,202, 46,208, 51, 93, 31,165, 22,220, - 47,187, 95,161, 14, 5,237,187,142,121, 41,188, 13,200,127, 19,156,127, 69, 57,223, 54,103,159, 73, 15,209,238, 67,211,247, 13, - 59,253,102, 58, 10,149, 74, 85,237, 70, 16,245,148, 37,120,224,203,226,193,234,114, 99, 92,213,132,179, 24, 69,233,111,214, 3, -128,139,139,203,147, 9, 19, 38, 76, 73, 76, 76, 92, 81, 20,239,106, 54,215,181,115,224,192,225,157, 20, 88,177,177,241, 81, 30, - 30,181,190,222,255,235,190, 86, 44, 75,241, 88, 66, 10, 0,234,247,251,247,239,103,151,222,207,211,198,198,124,248,136,225,253, - 8, 67, 4,132, 48, 52,195,163, 46,199,198,198, 71, 85, 97,109,186, 59,100,200,144,213,237,219,183,255,148,166,233, 37, 49, 49, - 49, 39,189,189,189,111,117,237,218,245, 43,163,209,184,236,201,147, 39, 39,125,124,124, 78,237,217,179,103, 42, 77,211,213,178, - 16, 21, 9,168,109,168,196, 7,172,134,152, 7,192, 82, 44, 22,231,132,135,135,239, 14, 14, 14,238, 79, 8,177, 4,144, 83, 83, - 66,173, 86, 59, 33, 47, 47,207,174, 95,191,126, 6, 0,222, 31,126,248,225,140,152,152, 24, 65, 65, 65, 65,108,117,120,226,226, -226,180,238,238,238,189,198,142, 29,187, 73, 40, 20,118, 44,178,128,177,165,234, 4, 44,203,130,166,233, 67, 42,149,170,210,122, - 17, 8, 4,249, 61,122,244, 48, 51,193,194,149,111,106,249,146,211,243, 38, 44,216,122, 52, 84,107, 96, 24, 35,195,142,126,148, - 82, 80,238, 18,178, 27,247,217,250,111,154,179, 58,248,167,112, 2,192,152,214,171,119,224,193,234, 18,135,247,226,208, 13,101, -191,255, 85, 40,178, 56,177, 0,230, 86,185,115,145,197,170,170,220,133,213,226, 44,131,162, 85,130,220, 74, 65, 14, 28, 56,188, - 83, 32,127,101, 40, 39,110,126,154,227,228, 56, 57, 78,142,147,227,228, 56, 57,206,255, 34, 40,174, 10, 56,112,224,192,129, 3, - 7, 14, 28,222, 44, 8, 0,255,242, 54, 84, 71,153, 18, 66,252,171,123,224,170,248, 57, 78,142,147,227,228, 56, 57, 78,142,147, -227,252,247,113, 86,197,253,111,177,140,113, 83,132, 28, 39,199,201,113,114,156, 28, 39,199,201,113,190,117,206,127, 27,184, 41, - 66, 14, 28, 56,112,224,192,129, 3, 7, 78, 96,189,125, 16, 66, 62, 33,132, 28, 39,132,220, 35,132,156, 32,132,124,242, 26, 92, - 82, 66,200,244, 82,124,199, 8, 33, 83, 9, 33, 98,174,166,223,233, 54,192,227,106,129,195,187, 4,165, 82, 89,207,207,207, 47, - 66,169, 84,214,227,106,131, 3,135,183, 15,126, 69, 27, 60, 61, 61,175, 80, 20, 85,135,162,168,226, 7, 74,233,135, 75,185,239, - 44,203, 62,141,138,138,106, 89, 17,103,157, 58,117, 74, 56, 41,138, 2, 33, 4, 20, 69,193, 96, 48,152,243,120,188,188,242, 56, -105,154, 78,120,244,232, 81,208, 59,244, 96,221, 97,109,109,109, 88,187,118,237,154,128,128,128,186,153,153,153, 5, 35, 71,142, -236, 66, 8,233,196,178,236,224,106,114,249, 19, 66,182, 55,105,210,100,255,184,113,227,194,252,252,252,204, 11, 10, 10,196,123, -246,236,113, 90,191,126,253, 69, 66,200,112,150,101,163,184,102,250,238, 64,161, 80, 4, 16, 66, 86,123,121,121, 5, 41,149,202, -155, 0, 62, 87,169, 84,183,185,154,249, 91,239,193,207, 68, 34, 81, 87, 47, 47,175,166, 90,173, 54,235,233,211,167, 55,104,154, -254,150,101,217,228, 55,196,111, 9,224, 91,177, 88,220,204,211,211,179, 86, 76, 76, 76,188, 94,175,191, 14, 96, 30,203,178, 57, -239,170,184,106,214,172,217,165,133, 11, 23,218,206,152, 49,227,146, 82,169, 12,174, 40,203, 4, 7, 14,165,225,234,234,106, 85, - 80, 80,176,137,162,168, 0,137, 68,226,100,110,110, 14, 51, 51,179,100,177, 88,124, 75, 38,147,125,122,228,200,145,108,174,150, -222,176,192,226,241,120, 46, 55,110,220,112, 48, 55, 55, 7, 77,211, 96, 24, 6, 12,195,148,228, 31, 44,237,187, 85, 20,103, 9, -237,219,183,175, 52,155, 48,159,207,175, 21, 17, 17,225, 96,102,246,103,168, 37,189, 94,143,134, 13, 27, 50,145,145,145, 14,101, - 19, 9,235,116, 58, 4, 6, 6,178,239, 74,101, 17, 66, 6,217,218,218,234,158, 63,127,209, 66,163,213,183, 28, 59,101,254,183, -253,222,111,107,121,245,234, 85,170,103,207,158, 2, 66,200, 39, 44,203,110, 55,145, 75, 74, 8,217, 60,115,230,204, 69,124,161, -204, 97,223,209, 43,252, 31, 55,236,140,247,247,173, 77, 38,141, 31, 43,155, 48, 97,194, 13, 31, 31,159,159, 9, 33,173, 89,150, -213,114, 77,245,157,184,254,252, 90,181,106,253, 22, 26, 26,234,156,156,148,132,229, 43, 86, 52, 7,176, 22, 64,115,174,118,254, -182,107, 48,125,238,220,185,161, 3, 7, 14,132,209,104,132, 90,173, 86, 62,121,242,164,254,204,153, 51, 63, 36,132, 52,101, 89, - 54,246, 53,249,237,189,188,188, 30, 78,154, 52,201,166,105,211,166,160, 40, 10,217,217,217,202, 75,151, 46, 53,223,188,121,243, - 39,132, 16, 31,150,101,211, 94,131,159,178,181,181,157, 0,160, 61,195, 48, 98, 0,215,179,178,178, 22,176, 44,171,127,157,114, - 91, 91, 91,255,178,108,217, 50, 91,177, 88,140, 45, 91,182,216,246,237,219,247,162, 82,169,108,205,137, 44, 14,149,193,206,206, -238,179,188,188,188, 53, 50,153, 76,104,101,101, 5,169, 84, 10,161, 80, 8,145, 72,228,106,109,109,237,106,102,102,214,125,192, -128, 1,159,239,218,181,107, 19, 87, 91,111, 80, 96, 81, 20, 5,169, 84,138, 61,123,246,128,199,227, 65, 40, 20, 66, 32, 16, 64, - 32, 16,188,242,185,248,123,173, 90,181, 76,233, 92, 0, 0,135, 14, 29,130,165,165, 37, 44, 44, 44,224,235,235, 11, 66, 8,196, - 98, 49, 78,159, 62,253, 10,111, 80, 80,208,107, 69, 17,175, 9,250,116, 34, 44, 80,126,240,198, 30,109,204,208,115,224,194,143, - 11,181,134, 54, 44, 75,212,201, 89,134,204,121, 75,215, 68, 53,174,239, 75,246,238,221, 27,104,103,103, 55, 0,128,169,137,164, - 39, 54,109,218,244,144, 17, 34,199,225, 67,135, 13, 29, 70, 17,227, 71,195,190,156,123, 41,242, 73,214, 38,191,128,157,105,105, - 9,163,127,252,241,199,232,177, 99,199, 78, 0,176,196,212,242, 55,105,210,228, 5,195, 48,181,138, 68,114,186, 84, 42, 85,156, - 59,119,206,248,182, 27, 26, 33, 68, 9, 96, 41, 0, 3,128,197, 44,203, 62, 44,181,173,158, 80, 40, 92,162,215,235, 51, 1,204, -102, 89, 54,254, 93,188, 89,156,157,157,125, 6, 15, 30,108,151,145,150,134,229, 43, 86, 20,255, 28,100, 74, 82,242, 55,141,192, -192,192, 58, 18,137,100, 41,128, 0,173, 86,235, 12, 0, 82,169, 52,145,101,217, 3,106,181,250,155,136,136, 8,117, 13,175, 83, - 45, 0,245, 81,113,202, 38,118,201,146, 37,209, 83,166, 76,121,250,119,115, 18, 66,220, 29, 29, 29, 23,246,233,211, 7, 71,142, - 28,193,209,163, 71, 13, 18,137,132, 63,116,232, 80,242,249,231,159, 91, 79,154, 52,169, 59,128, 31, 94,179,106,187,207,157, 59, -215,198,215,215, 23,251,246,237,195,237,219,183,213,245,234,213,147,182,109,219, 22, 60, 30,207,230,155,111,190,233, 6, 96,107, - 53,235, 84, 12, 96, 2,128,246, 60, 30,175,245,208,161, 67,141,227,199,143, 23, 80, 20,101, 88,185,114,165,253,166, 77,155,250, -217,217,217, 5,164,167,167,231,215,180,208, 89, 89, 89, 11,230,207,159,191,109,245,234,213,230,177,177,177,152, 59,119,174,221, -184,113,227,206, 43,149,202,182,156,200,170, 24, 60, 30, 79,207, 48,140, 0,128,132,101, 89,109, 85,223,255, 77,231,110,107,107, - 59, 38, 43, 43,107,173, 82,169,132,189,189,125,201,179,150, 97, 24, 20, 20, 20, 64,173, 86,163, 78,157, 58, 66, 95, 95,223,141, -227,198,141, 19,172, 94,189,122, 29,215, 98,170, 41,176, 8, 33,109, 89,150, 61, 95,170, 51,104,203,178,236,121, 66, 8, 24,134, -129, 64, 32, 0,143,199, 3,159,207, 47, 17, 62,165, 63, 23,191,202, 19, 66,101, 87, 24, 80, 20, 69,242,242,242, 74,196,149,165, -165,101,137, 37,204, 96, 48,252, 31, 39, 77,211,160, 40,138,173,140,243, 77,160, 52,103,216, 74, 31,108, 13,159,210,127,107,248, -203,239,221, 6,190,124,223, 26, 14,156,190, 62,122,233,146,117,173,106, 77, 92,176, 37, 52, 35, 35, 59,213,207,197,222, 56, 96, - 96, 91, 55, 81,122, 74,186,109,237,218, 33, 0, 82,171, 81,206,224,209,163, 71,239,219,119,246,177, 92, 44, 22,137,120, 20,120, -245, 60,234, 8,156, 45,234,218,216,119,105, 42,138,139,141,189,248,201, 39,159,140, 30, 59,118,172,109,177,192, 50,229,220, 89, -150, 85,156, 60,121, 18,124, 62, 31,157, 58,117,178, 46, 18,209, 70, 83,206,253,175,168,207, 82,152,153,146,146,210, 95,163,209, - 32, 40, 40,232,125, 66, 72,123,150,101,111, 17, 66, 26,244,234,213,235, 98, 88, 88,152,121,100,100, 36,154, 55,111, 46, 5,208, -247, 45,150,243,255,160, 84, 42, 79, 2,120,143,199,227, 65,167,209,232,150,126,255, 74,154,187,240,210,226,234,239, 40,103,227, -198,141,125,100, 50,217,149,239,191,255,222,194,207,207,143, 8, 4, 2, 24,141, 70,196,196,196,212,218,177, 99,199,168,155, 55, -111,118, 11, 12, 12,244,139,136,136, 48,212,224,220,235, 95,188,120,177,192,195,195,163, 92,193, 88, 88, 88,200,243,240,240,104, - 7,224,233, 91,224, 76, 72, 73, 73,249,224,189,247,222, 27,157,156,156,252,208,104, 52, 78, 3,224,111,103,103, 23,249,241,199, - 31, 67, 42,149,182, 55, 69, 96, 85,118,141, 28, 28, 28,122,181,108,217, 18,171, 87,175,198,226,197,139, 59,177, 44,251, 7, 33, -164, 99,110,110,238,233,247,223,127, 31, 86, 86, 86, 31,148, 39,176, 42,226, 36,132,248,137,197,226,173,187,118,237, 50,243,240, -240,240, 16, 10,133,148,135,135, 7, 50, 51, 51,161,209,104,196, 11, 22, 44,104, 32,145, 72,110,255,240,195, 15, 91, 1,124, 84, -195,246, 89,175,105,211,166, 27, 39, 79,158,108,126,248,240, 97,120,121,121, 33, 55, 55, 23,195,135, 15,119, 88,181,106,213, 57, -165, 82,217,174, 88,100,253,221,247, 17, 33, 36, 7,128, 5, 0,171,234, 76,175, 86, 82,159, 57, 0, 74,252, 83, 5, 2, 1,196, - 98, 49, 36, 18, 9, 36, 18, 9,158, 62,125,250, 43,143,199, 27, 86, 52,144,171,146,147,252,249,224,106, 68, 8,185,193,227,241, - 42,253,206,178, 44,243,182,251, 37, 66,136, 11, 33,100, 37,128,246,120,233, 71,125,222,193,193, 97, 98,114,114,242,115, 83, 57, -149, 74,165,109,126,126,254, 15, 74,165, 18, 14, 14, 14,197, 98, 19, 65, 65, 65,208,104, 52,184,127,255, 62, 24,134,193,147, 39, - 79, 96, 97, 97,129, 6, 13, 26,252, 48,119,238,220,125,179,103,207,206,248,171,206,189, 34, 45,242, 79,183, 96,157, 43,106,103, -197, 39,115,174,120,164, 73,211,116,137,192, 42, 43,126,202, 10, 46, 66, 8, 88,150, 37, 85, 84, 32,165,211,233, 74,196,149,133, -133, 69,137, 56, 51, 26,141,229, 10,172,154,194,218,218,250, 68,118,118,246, 10,150,101, 79,214,228,255, 67,135, 14,253, 63,127, -142,233,211,167,199,167,165,165,209,189,130,235,137,183,111, 63,146,241, 73, 72, 59, 39, 63, 79, 23,111,185,173, 67,163,194,194, -194,155, 0, 4,213, 49,136,248,249,249,153,175,219,117, 62,117,224,132,165,243, 92, 28,205,232, 38, 94,142, 22,158, 54,114,145, -173,132,111,180, 98,141,217, 50,153,172, 62,128,140,234,150,221,210,210, 18,135, 14, 29,122,215,218,154,181, 90,173, 70, 86, 86, - 22,214,175, 95,111, 49,122,244,232,179,132,144,137,189,122,245, 90,189,111,223, 62,121,118,118, 54,244,122, 61, 0,168,223,193, -251,100,190,181,181,117,155,246,237,219,139,118,239,221, 43, 98, 89,182, 0, 47,211, 17,229,179, 44, 59,238,239, 46,140, 68, 34, -249,106,193,130, 5, 22,126,126,126, 36, 61, 61, 29, 44,203,130,162, 40,216,217,217, 97,202,148, 41,146,111,190,249,198, 57, 58, - 58,250,107,212, 32,237, 12, 0, 82,145, 16, 2, 0,153, 76, 70,163,250,139, 99,202,229, 52, 26,141,164, 85,171, 86, 83,210,211, -211, 27,168,213,234,239, 76,120,240, 24, 1, 28, 42,122, 21,247, 41,183, 31, 62,124,168,230,243,249,210,218,181,107, 55,123,221, -186,173, 87,175, 94, 11,129, 64,128,235,215,175,107, 1, 20,119,238,231,239,220,185,163,253,232,163,143,196,181,106,213,106, 81, - 29,203,149, 88, 44,222,250,248,241, 99,111,133, 66, 33,189,118,237, 26, 26, 54,108,136,244,244,116, 36, 39, 39, 35, 63, 63, 31, -201,201,201,248,244,211, 79, 29,150, 47, 95,174, 48, 85, 76,121,122,122,158,178,179,179,147, 22,167,193,234,209,163,135, 96,201, -146, 37,230, 9, 9, 9, 48, 26,141,152, 49, 99, 6, 66, 66, 66, 96,109,109,141, 97,195,134, 57,110,220,184,241, 23, 0,129,111, -249, 30,202, 22, 8, 4,144,203,229, 86,217,217,217, 57,175,193, 35, 6, 32, 2, 0, 62,159, 95, 34,174,196, 98, 49,196,226,127, -255,186, 32, 66,136, 51, 33, 36, 74, 32, 16,136,229,114,185,144,162, 40,200,229,242, 46, 46, 46, 46,247, 63,249,228, 19,255,237, -219,183,199,153,194,163,209,104,182, 75,165, 82,129,189,189, 61, 0,160,115,231,206, 24, 58,116, 40,210,210,210, 24,149, 74, 5, -111,111,111,234,252,249,243, 72, 73, 73,193,237,219,183,209,164, 73, 19,129,141,141,205,118, 0,221,254,194,211,171, 80,139,252, -147, 5,214, 43, 39, 87,122, 35,195, 48,175,136,171,242, 44, 87,165, 45, 88, 85, 77,231, 17, 66, 64,211, 52,156,156,156, 32,147, -201, 32,147,201, 74,182, 21,139,185,210, 47,150,101,107, 60, 69, 88,183,110,221, 14, 50,153,172, 53, 33,228,125,150,101, 77, 78, -121,219,103,210,195, 18,171, 85, 89, 52,106,212,232,202,140, 25, 51,186,158, 57,115, 38,171, 69,195, 58,140, 88, 21,159, 33,179, -182,107, 72,236, 29, 58,141, 29, 49,242, 42,128, 93,213, 40,162, 74,163,209,136,221,157, 40,181, 42, 39, 87, 87,199,194,210,170, -142,165,153,204,221,206,210,214, 90, 34,162,228,142, 14, 74,131,193,144, 13, 64, 85, 21, 81,233,105, 65,137, 68,162, 35,132,240, -173,172,172, 96,105,105,169,207,202,202,210, 4, 6, 6, 66, 36, 18,165, 11,133, 66,147,167, 11,155, 54,109,154, 66,211,180, 67, -101,251, 8,133,194,212,171, 87,175, 58,154,120,190,223, 52,106,212,168,237,218,181,107,237,189,188,188,176,126,253,122,139,125, -251,246,109,253,229,151, 95,144,157,157,141,103,207,158, 97,248,240,225,185,120, 57,141,248, 78,193,198,198,230, 82,239,222,189, -177,105,211, 38,182,104, 16, 33, 39,132, 52,180,180,180,124, 20, 21, 21,165,255,187,203, 67, 81, 84, 23,111,111,111,146,147,147, - 3,150,101,193,227,241, 94,121, 77,153, 50, 69,250,233,167,159,206,108,209,162,197, 20,129, 64,144,107, 52, 26,119,231,231,231, -127,119,239,222,189,119,202, 89,181,117,235,214, 95,196,199,199,135,184,185,185,253,254, 26,163,125,182, 73,147, 38, 58,150,101, -165, 60, 30, 79,240,186,101, 42, 94, 29, 74,211,180,166, 56, 57, 60,203,178,198,192,192, 64, 77,209,195,189, 58,171, 71, 39,132, -133,133,153, 43, 20, 10,169, 90,173, 70,108,108, 44, 2, 3, 3,145,151,151,135,130,130, 2, 20, 22, 22, 66,175,215, 35, 39, 39, -199,138,166,105,157,137,109,241,151, 29, 59,118,184,184,184,184,192, 96, 48,192, 96, 48,160,160,160, 0,231,207,159,135, 86,171, - 45, 73,244,190,104,209, 34,205,231,159,127, 46,217,187,119,111,170, 90,173, 30,244,182,175, 53,143,199,131, 88, 44,134, 64, 32, -200,118,117,117, 5, 69, 81,146,184,184,184,154, 76,185, 89, 0,200,229,243,249,162,210,194, 74, 34,145,224,222,189,123,123, 42, -178, 94, 85,214,126,170,243,253, 29, 16, 88, 43, 5, 2,129,216,214,214, 86, 88,252,155, 94,175, 23, 90, 91, 91,195,205,205,109, - 53,128,238, 38,242, 52,182,181,181, 5, 33, 4, 66,161, 16, 35, 70,140,192,141, 27, 55, 14, 36, 36, 36,124,146,154,154,138,252, -252,252,237, 22, 22, 22, 31,166,166,166,130,166,105,196,197,197,161, 81,163, 70,141,255,166,211,252,199, 11,171, 87, 4, 22, 33, -164,109,233,247, 98, 49,196,178,108,149,150,171,202,166, 8,203, 66,175,215,155,133,132,132, 48,197, 98,172,120, 21, 33, 0, 66, -211, 52,132, 66,225, 43,156, 69, 2,171, 70, 13, 92, 44, 22,163,123,247,238, 18,153, 76,118,176, 72,100,157,169,105, 37, 29,218, -183,211,113,201,236, 25,179,109,148,181, 61,191,254,250,107,126,183,110,221, 78,239,222,189,187,137, 93,112,135,174, 23,254,216, -227,184,126,218,161,223,247,236,217,147,103,170,131,123, 17, 46, 31, 56,112, 64,241,213,248,177,194,182,109,219,254, 58,164,193, -100,190, 66,196,152,219,136,133, 60, 25,143, 79,137,107,185,119,253,227,252,133, 36, 0, 23, 76,232, 36, 20,167, 79,159,134,149, -149, 21, 0,136,116, 58, 29,172,172,172,176,126,253,122,137,133,133, 5, 44, 44, 44,208,178,101, 75,107,161, 80, 88,233,116, 97, -105,208, 52,237,112,238,220, 57,152,153,153,161,160,160, 0, 90,173, 22, 70,163, 17, 44,203,150,140, 28,219,181,107,231, 80,141, -142, 44,150, 16,210,102,236,216,177, 23,214,174, 93,107,239,233,233,137,121,243,230, 33, 35, 35, 3, 47, 94,188,192,160, 65,131, -114,159, 62,125,218,190,180,111,214,187,128, 6, 13, 26,176,151, 47, 95,198,177, 99,199,208,179,103, 79,114,232,208, 33, 61, 77, -211,194,196,196,196,187,111,171, 76, 70,163,209, 92, 36, 18,193, 96, 48,128,207,231,151, 76,225, 23, 11, 44,103,103,103,156, 58, -117,138, 95, 88, 88,200,207,200,200,144,109,222,188,121,124,120,120,184, 2,192,128,183, 89,151,235,214,173,115, 27, 49, 98,196, - 11, 62,159,207,118,237,218,117,240,243,231,207, 63, 80, 40, 20,127,156, 61,123,246,123, 0,213, 14, 45,224,239,239, 31,206,227, -241, 92, 0, 8, 15, 30, 60,104,160,105, 90,216,160, 65,131,148, 98,203, 78,241,179,209,104, 52, 38, 68, 71, 71, 7,153,194, 39, -145, 72,132, 63,253,244,147, 65,163,209, 8, 27, 54,108,152, 82,138, 71,248,219,111,191, 25, 12, 6,131,208,219,219, 59,220,196, -149,205,237,154, 53,107,230,150,157,157, 13, 75, 75, 75,228,231,231, 35, 60, 60, 28,126,126,126, 80,169, 84,160, 40, 10, 86, 86, - 86, 88,183,110, 93, 33, 33, 36,211,148,115,206,204,204, 28, 52,105,210,164,139,123,246,236,177,227,241,120,120,254,252, 57, 50, - 51, 51, 97,101,101,133, 29, 59,118,192,221,221, 29,167, 79,159,206,164,105,250,179, 77,155, 54,205, 84,171,213,131,222,182, 15, - 22, 69, 81, 37, 66,168,148, 32,210, 52,111,222, 28,151, 47, 95,222, 89, 29, 81,196,178,172,174,120, 90,176,244,212,160, 88, 44, - 6,143,199,171,246,148, 7, 77,211, 66, 66, 72, 99,252, 57,107, 83,233,247,119, 0,109,229,114,185,176,236,143, 89, 89, 89, 66, -111,111,239,214,213,120, 62,218, 74,165,210,151,132,109,219, 34, 53, 53,149,246,240,240,232,215,183,111, 95, 3, 0,140, 26, 53, -170, 95, 90, 90,154,198, 96, 48,240,248,124, 62,210,210,210, 80,167, 78, 29,219,191, 65, 64,254,159, 22,249, 71, 11, 44,150,101, - 9, 33,132, 45,253, 94,218,130, 85,149,229,170,120, 91,177, 80,170,226, 70,203,142,136,136,144,203,229,242,146,223, 12, 6, 3, - 26, 55,110,204, 48, 12, 67,202, 30,235,117, 44, 88, 98,177, 24, 86, 86, 86, 24, 48, 96,128, 44, 49, 49,113, 43, 0, 23, 83,254, -247,210, 7,235, 85,113,181, 97,241,188,213, 63, 46, 89, 96,251,228,216, 22,108, 90,181,140,150,203,205, 34, 27, 53,106,212, 38, - 39, 39, 71,107, 37,215, 34, 57, 3,251, 88,150,253,165, 26,141,136, 2,176,231,234,213,171,183, 58,119,238,124,245,217,179,103, -214,207, 31, 63,190,100,161,203,207, 55,171, 85,219, 40,116,112,236,165,214, 27,248,189,123,247,118, 4,176,202, 4, 62, 48, 12, -131, 35, 71,142,192,220,220, 28, 22, 22, 22,176,178,178, 66,177,184,170, 41,158, 62,125,138,132,132, 4,200,229,114,200,229,114, -152,153,153,193,204,204, 12, 34,145,232, 21,235, 99, 53, 68, 86, 52, 33,100,226,254,253,251,119,135,134,134, 34, 43, 43, 11, 5, - 5, 5,152, 61,123, 54, 98, 99, 99, 39,177, 44,123,235, 93,186, 57, 26, 54,108,200, 94,189,122, 21,151, 46, 93, 66, 65, 65, 1, - 86,175, 94, 13,133, 66,209, 1,192,172,183, 89, 46,134, 97,132,197,161, 78, 40,138,250, 63, 11, 86,177,216,146, 74,165,176,179, -179,195,140, 25, 51,132,189,122,245, 10,121,155,101, 94,178,100, 73,221,149, 43, 87,110,222,182,109,219,177, 65,131, 6,237,189, -119,239,222, 48, 75, 75,203,187,103,206,156, 89, 32, 22,139,153, 26,117, 94,124,190,203,173, 91,183, 74,139,124, 1, 77,211, 50, -154,166, 97, 52, 26, 97, 48, 24, 80, 88, 88,136, 78,157, 58,153,204,119,227,198, 13, 25, 0,204,154, 53, 75, 0, 64,198, 48, 12, - 74,243,169,213,106, 65,199,142, 29, 93, 76, 44,162,210,218,218, 90,240,226,197, 11, 24,141, 70, 4, 4, 4, 96,221,186,117,232, -219,183, 47,234,215,175,143,188,188, 60, 68, 69, 69, 97,235,214,173,214, 66,161,240, 99,147,204,222, 42, 85,180, 82,169,108,221, -175, 95,191, 43,187,119,239,182,118,115,115, 67, 66, 66, 2, 84, 42, 21, 60, 61, 61,177,106,213,170, 2,150,101, 91, 21,137,170, -223,222,246, 61, 68, 81, 84,137, 8, 42,239, 85,195, 1,134,133, 68, 34,201,149, 72, 36,162, 98,161,117,243,230,205,106, 91,175, - 74,245, 75,183,170,243,253,109,162,184, 15, 54, 24, 94, 61, 77,185, 92, 14, 47, 47, 47,147,121,228,114, 57, 41,126,198, 26, 12, - 6, 36, 37, 37,209,247,238,221,163, 3, 2, 2, 0, 0, 10,133,130,190,118,237, 26,173,213,106,121,230,230,230, 0, 0, 43, 43, -171,191, 84,100, 86,166, 69,254,209, 22,172, 82, 86,146, 11,101, 45, 88,197,130,167, 50, 39,119, 62,159,111,170,192, 2,143,199, -195,241,227,199, 97,102,102, 6,115,115,115,248,248,248, 20, 87,110,185, 86,177,154, 10, 44,145, 72, 4, 75, 75, 75,156, 60,121, - 82,115,251,246,237, 17, 53,181, 92,109, 88, 60,111,245,162,239,230,218,102, 60,184,138, 4, 85, 18, 50, 82,244,225,151,239,197, -157, 0,112, 2, 0,240,192,247, 60,124, 31,152, 44,174,124,237,101,141,154,123, 57,253,214,254,189,174,206, 31, 12, 25, 75,125, -254,249,231, 45,134, 14, 29,154, 57,120,240,224, 9, 82,169,180,190,209,104,204, 58,125,254,124, 92,159, 62,125,108,115,114,114, -134,178, 44, 91,165, 79, 18,143,199, 75,234,220,185,115, 45, 0, 48, 55, 55,215,253,252,243,207, 34, 43, 43, 43, 12, 28, 56, 80, -147,156,156, 44, 41,170,143, 44, 83,173, 87, 69, 15,155,212,207, 62,251,204,161,138, 58, 78,173,230,232,164,113, 72, 72,200,198, - 61,123,246, 32, 35, 35, 3, 5, 5, 5, 16, 10,133, 88,186,116, 41, 94,188,120,241, 3, 33,228,222,187,210,153, 53,106,212,136, -189,126,253, 58,238,222,189, 11,173, 86,139, 17, 35, 70,148,246, 49,236,252,182,103, 10, 18, 19, 19,177, 99,199, 14,208, 52,141, - 65,131, 6,193,221,221,189, 68, 96, 37, 39, 39,227,231,159,127, 6, 77,211,248,236,179,207,224,234,234, 10,131,193, 32,105,215, -174, 29,255,109,173, 40,157, 60,121,242,147, 3, 7, 14, 28,139,143,143,239,182,120,241,226,182,132, 16,102,202,148, 41,139, 44, - 44, 44, 94,107,245,101, 86, 78, 30, 30, 61,126, 14,163,209, 88,238,203,222,206,166,218,124, 49,177, 47, 96, 52,210, 37, 28, 52, -253, 39,159,173, 77,181,248, 18, 51, 51, 51,189,120, 60,158,240,241,227,199,112,115,115, 67,211,166, 77,177,112,225, 66,164,165, -165,193,104, 52,194,193,193,129, 49, 24, 12,145, 58,157,238,130,169,164, 73, 73, 73,133, 25, 25, 25, 5,159,125,246,153,213,198, -141, 27,137,151,151, 23,158, 61,123, 6,129, 64, 0,115,115,243,194,135, 15, 31,190, 51,171, 6,203, 90,174,138, 95, 69,150, 43, - 10,192,239, 0,170, 37,176, 89,150,213,213,170, 85,235, 21,255,171,154, 88,175,254, 42,252,149, 43, 19,189,188,188,206, 91, 88, - 88,132, 60,124,248,240, 21, 43,214,128, 1, 3,244,158,158,158, 23, 77,229,177,176,176,200, 18,137, 68,182, 26,141, 6, 87,175, - 94,133,143,143,143, 48, 39, 39, 39,148, 16, 50,189,104,112, 25,154,146,146, 34,116,118,118, 6, 0,120,123,123, 35, 39, 39, 39, -203,148,104, 1,175,137,255,211, 34,255,120,129,197,178,108,219,210,239,165, 26,178, 73,211,131,165, 44, 88, 85, 90, 90,212,106, -117,137, 69, 68, 46,151,131, 97,152, 87,166, 35,203, 10,172,178,171, 8,171,115, 99,159, 61,123, 86,179, 97,195,134,222, 44,203, -158, 48,245,127,165,125,176,126, 90,190, 96, 73,177,184,186,115,233, 20,126,123,152,147, 62,101,225,242,149, 53,173,108, 63,123, -121, 67, 39, 71,187,115,203,151, 46,178, 72,188,126, 12,123, 55, 44,103,239,220,184,209,100,204,141, 27, 31,143, 25, 51,198, 6, - 47,253,173, 18, 1, 92, 2,240,131, 41,226, 10, 0,174, 93,187,230, 90,252,185,105,211,166, 6, 11, 11, 11,152,153,153, 33, 45, - 45, 77,104,102,102, 38, 57,119,238, 92,181,125, 29,174, 95,191,238,248, 38, 27, 26, 33,164, 94,207,158, 61, 47,252,250,235,175, -242,236,236,108,196,197,197, 97,234,212,169, 88,179,102, 13, 44, 44, 44,112,228,200, 17,243,144,144,144,115,132,144,150,111, 59, -184,106,227,198,141,217,155, 55,111, 34, 46, 46, 14, 70,163, 17, 31,124,240, 1,222,165,209, 20,195, 48,236,164, 73,147,176,113, -227, 70, 80, 20,133, 33, 67,134, 32, 55, 55,183,100,187,141,141, 77,121,219,120,168, 98, 69,233, 95,218,209,240,249,236,249,243, -231, 23,183,109,219, 22,241,241,241,221, 2, 3, 3,127, 28, 54,108, 88,226,235,242, 90, 91,154,163,145,159, 7,180, 90, 45,180, - 90, 45,148, 74, 37,242,242,242,240,228,201, 19,104,181, 90, 56, 58, 88, 85,155,175,113,253,186,208,233,116,208,106,181,112,112, -112, 64, 65, 65, 1,158, 61,123, 6,173, 86, 11,123,123,235,234,208,157,191,116,233,146, 91,167, 78,157,188,163,162,162,112,225, -194, 5,232,116, 58, 52,110,220, 24, 49, 49, 49,104,209,162, 5,114,115,115,175,223,188,121,243, 80, 53,238,163, 90, 93,186,116, - 57,187,115,231, 78,219, 95,126,249, 69,247,209, 71, 31,137,230,205,155, 71, 44, 44, 44,144,146,146,130,119,204,101,232,255,132, - 85,120,120,248, 30,161, 80,200, 2,168,145,181,169, 24,241,241,241,226, 6, 13, 26,104,197, 98,177,232,202,149, 43, 59,107,106, -189,250, 75, 70, 63,175,185, 50,177, 50,212,173, 91,119,146,139,139, 75,167,128,128, 0, 68, 69, 69, 9,197, 98, 49, 6, 15, 30, -172,239,222,189,187,158,207,231,155,188,224, 70, 34,145, 60, 48, 55, 55,111,163,213,106,161,211,233,112,250,244,105,216,216,216, - 76, 13, 9, 9,153,152,148,148, 4,149, 74, 37, 18,139,197, 37, 86,242,246,237,219, 35, 51, 51,243,193, 95, 93,119, 21,105,145, -127,186, 5,171, 92, 49, 84,218,130, 85,217,244,160,169, 2,139,162, 40,232,116, 58,200,100,178, 18,129, 85, 58, 82,124, 77, 56, - 43,194,173, 91,183,174,196,198,198,126,207,178,236,209,154,252, 63,236,151,109, 10, 75,166,176,150,234,250, 81, 60,186, 19,142, - 3, 81,217,233, 83, 22, 46, 31,255,126,239,129, 41,101, 5, 89,152, 9, 46,244,245, 28,228,254,206,142,182,231,150, 47, 93,100, -145,241,224, 42, 30,223, 13,199,209,235, 9, 17, 90,150,141, 1,240,221,155,188,168,197,115,235,239, 88, 71, 59,169,120,181, 96, -108,108, 44, 6, 13, 26,148, 29, 23, 23, 55,246,131, 15, 62, 88,115,226,196, 9,107,107,107,107,156, 60,121,210,188, 86,173, 90, -161, 0, 66,222, 98,231,200,210, 52,141,140,140,151,139, 55, 91,181,106,133,119,205, 84, 29, 30, 30, 46,236,217,179,231, 31, 0, - 58, 60,120,240, 0, 12,195, 92,137,136,136,104, 85,188,189,178,109,166,232,183,188,188, 60,129,185,185,121,185, 15, 43,161, 80, - 40,172,174,197,161, 52,231,229,203,151, 23,125,255,253,247, 7,190,252,242,203,199,175,201, 89,174, 5, 43, 36, 36, 4, 26,173, - 1, 9, 41, 57, 48, 26,141, 40,212,165,188,150, 5, 43, 36, 36, 4,106,141, 14, 47,146, 50, 97, 52, 26,145,175,169,150,161,100, -213,128, 1, 3,122, 95,190,124, 57,211,219,219,219,230,230,205,155, 72, 77, 77,133,193, 96, 64,135, 14, 29, 32, 22,139,159,135, -134,134, 10, 97,130, 27, 64, 81,219,148,189,247,222,123, 39,118,239,222,237,116,229,202, 21,232,116, 58, 38, 60, 60,252,217,200, -145, 35, 45, 62,253,244, 83,219,151,213,248,206,221,247, 16,139,197,120,240,224, 65,177,176, 26,242,166,132, 80,177, 5,235,191, -132, 95,126,249, 37,113,203,150, 45,126, 10,133, 98,229,224,193,131,219, 43,149, 74, 74, 36, 18,157,231,243,249, 19, 1, 60,175, - 70,221, 13,179,182,182,126,194,227,241,120,137,137,137,120,252,248, 49,120, 60, 30, 88,150, 21,169,213,106, 56, 58, 58,130,199, -227, 21, 91,199,224,226,226, 66,199,196,196, 12, 3,135, 55, 35,176,138, 49,127,254,124,108,216,176, 1,163, 70,141,170,116,191, -162,176, 0,164, 76,135,240, 74,182,237,226, 85,132,115,230,204,121,229,127,197, 83,129, 99,199,142,125,133,243,224,193,131,255, - 55, 69,104,106, 6,239, 39, 79,158,152,172,128, 75,115, 22,251, 96,245, 25, 52, 36,105,245,162,217,119,183, 30,250,163, 65,146, -154, 77,154,178,112,249,228,178,226,202, 84, 78, 95, 39, 51, 95, 23, 7,219,243,223, 47, 93,100, 89,108, 13,219, 29,153,156, 3, - 35, 59,170,154, 15,255, 42,207, 93, 32, 16, 36,181,108,217,178, 22, 96,218,180,224,223,149,101, 93,171,213,226,218,181,107, 0, -128,225,195,135,103,199,197,197,181, 97, 89,246, 62, 33,228, 65,215,174, 93,207, 31, 63,126,220,186,104,244,157,241, 54,203, 9, -188, 92,209,202,231,243,225,229,229, 85,109,113,245,119,149, 51, 41, 41,105,212,232,209,163, 55,104,181, 90,126, 65, 65,193, 40, - 83,183, 85, 85,206,176,176,176,199, 94, 94, 94,109, 81,113, 40, 6, 6,192,213,215,225, 92,185,114, 37, 0,120,191, 14,103, 69, - 22,172, 61,123,246,128,166,105,184, 56, 90, 66,171,213,162,180,191,167, 41,156,101, 45, 88,123,247,238, 5,195, 48,112, 85,216, - 64,171,213, 86,232,123, 88, 30, 39,203,178, 90, 66,200,176,150, 45, 91,110, 95,176, 96,193, 83, 31, 31,159, 90, 45, 91,182,180, -206,204,204, 76,189,117,235, 86,220,134, 13, 27,204,140, 70,227,176,138,166,137,202,114,218,218,218, 46,223,182,109,155,203,131, - 7, 15,144,152,152,136, 21, 43, 86, 60, 79, 75, 75,235,206,231,243,197, 63,254,248,227,185, 30, 61,122, 56, 26,141, 70,237,187, -208, 62,139,161, 82,169, 14,225,101,248,154,106, 9, 43, 83,202,121,227,198,141,189, 69,220, 71, 77,225,254,187,206,253,117, 87, - 38, 86, 85,206, 97,195,134, 37,160, 76,204,180,234,150,243,228,201,147,113,253,251,247,159,239,239,239, 63,199,204,204, 12,209, -209,209, 37, 97,145,138, 7,232,132, 16,244,233,211, 7, 99,198,140,193,201,147, 39,231,247,238,221, 59,238,175,174,207,255,140, -192,162,105, 58, 62, 46, 46, 78,177,109,219, 54, 30, 33, 4, 59,118,236, 64, 89,199,218,226,119, 0,184,118,237,154,145,101,217, - 39,149, 29,140,166,233,248,240,240,112,199, 45, 91,182, 8,164, 82, 41,196, 98, 49, 84, 42, 21, 24,134, 97, 82, 82, 82,168,157, - 59,119,190,226,172,123,245,234, 85,163, 94,175,127,241,182, 42,231, 98,212,243,137,199,143, 28,176,107,209,188, 77,182,133,141, - 77,185, 66,165, 56,226,123,101,144,155, 91, 44,250,126,233, 34,171, 98,113,181, 39, 50, 57, 91,163,165,219, 63, 72, 43,188,243, -166,203,124,249,242,101,215,119,180,173,205,110,219,182, 45, 3,192, 14,192, 76,246,165,229, 14, 69, 34,171,185,151,151,215,151, - 0,164, 0,102,191, 77,235, 21,195, 48, 37,150,211,119,217,201, 50, 34, 34,226, 41,128,142,213,221, 86, 21,122,247,238, 29, 11, - 32,246, 77,150,245,175,224, 44, 70,102,118, 46,158, 60, 75, 44, 74,229, 69,131,126,158, 92,202,127,202,128,204,220,234,133,145, -203,202,201,195,147,103, 9, 96, 24,246, 37, 31,157, 88,226,228,110, 52, 26,145,158, 93,189, 48,109, 44,203, 70, 17, 66, 90, 76, -155, 54,109, 2,128, 96, 0,174, 0, 94,224,165, 27,192, 42, 83,125,112, 4, 2, 65,240,202,149, 43,187, 83, 20, 69, 93,187,118, - 77,187,116,233,210,248,180,180,180, 94, 44,203,190, 0, 0,165, 82,217,238,224,193,131,191,188, 11, 33, 25,202, 96,200, 63,148, -187,198,248,167,172, 76,220,189,123,247,220,177, 99,199,242,155, 53,107,246,117,147, 38, 77,168,103,207,158, 33, 53, 53,181,100, -112,217,165, 75, 23,184,185,185, 49, 71,143, 30, 93,248,225,135, 31,206, 5,135, 55, 39,176,210,211,211,187, 12, 25, 50,228, 20, - 69, 81,181, 43, 74,238, 92,218,186,196, 48, 76, 92, 74, 74, 74,165, 65,200,210,211,211,187,204,158, 61,251, 20,159,207,175, 93, - 42,153,179, 54, 35, 35, 99,108,159, 62,125,214, 10, 4, 2,113,105,107, 23,195, 48,207,147,146,146,254, 86,135,226,178,113,176, -186,246,248, 48,253,117, 57,229, 34,120,196, 95, 59,130,199,119, 35,176, 39, 50, 57, 43, 79, 71,183,139, 78, 43,248, 79, 41,127, -150,101, 83, 1,140,173, 96,219, 99, 0,163,222,129, 50,254,107, 86,175,252, 23, 96, 52, 26, 19, 58,117,104,135,178, 97, 25,202, -126,167,105, 58,193, 84,190,142,237,219, 86,200, 83,252,217, 84,190,210,150, 44,188,204,198,176,164,166,231,202,227,241,190,108, -214,172, 25,239,203, 47,191, 76, 57,118,236,216, 31, 89, 89, 89,147, 89,150, 45, 44,101, 41,138,198,219, 15, 38,202,225,207,107, -254,143, 88,153,184,118,237,218, 89, 83,167, 78,221,170, 84, 42,119, 4, 7, 7,123,123,122,122, 90,152,155,155, 35, 55, 55, 55, - 47, 51, 51,243,209,145, 35, 71, 6, 13, 25, 50,228, 41,119, 69,223,176,192, 74, 75, 75, 43, 0,208,226, 77, 30,172, 10, 78,183, -119,165, 82,134, 6, 45,221,141, 7, 75, 95,201, 67, 88, 44,190,202,253, 94,133, 15, 86, 82,122,238,152, 5, 91,143, 44,211, 26, - 89, 70,111,100,134, 71,167, 22, 68,113, 77,239,157,237, 24, 57,113,245, 15,193,189,123,247,130,222,101,190, 55, 9,157, 78, 55, -177,101,203,150, 63,208, 52,253,189,193, 96,184,196, 93,125, 14,111, 10, 75,150, 44,121, 90,252, 92,238,211,167, 15, 15, 0,194, -194,194,232,119,176,168, 77, 0,216, 3, 40, 78,182,110, 15, 64,135,151,145,253,211, 0,220,252,199, 8,172,255, 42,194, 78,255, -249,128, 45, 43,156,170,250, 94, 17, 30, 37,231,159,231, 70,151, 28, 56,112,120, 13,225,255, 2, 64, 47,174, 38, 56,252,165,207, -191,119, 83, 88, 21,195,158, 16,114,152,101,217, 16, 0, 40,254, 92,250,183,119, 13, 20,215,164, 56,112,224,192,129, 3, 7, 14, - 28,222, 44, 8, 0,255, 10, 70, 76, 38,251, 8, 17, 66,252,107, 48, 34,187,199,113,114,156, 28, 39,199,201,113,114,156, 28,231, -127,139,179, 42,238, 10,254,223,163, 10, 11,214,145,119, 78, 96,253,149,129,233,254,238, 37,193, 28, 39,199,201,113,114,156, 28, - 39,199,201,113,254, 51, 57,171,192, 63, 78, 96,113, 62, 88, 28, 56,112,224,192,129, 3,135,119, 29,234,233,211,167,127, 77, 8, - 57, 12, 0,211,167, 79,255,250, 93, 47, 48, 39,176, 56,112,224,192,161, 20,148, 74,101, 79, 0,115,241,210,133, 34, 84,165, 82, -237,229,106,133,195,191, 9,246,246,246,114, 91, 91,219, 63, 40,138,114, 3, 94, 13,185, 84, 94,254, 95,134, 97,146, 50, 51, 51, - 59, 39, 39, 39,167,255,157,156,101,112, 37, 52, 52,180, 48, 52, 52,180,216,161, 61, 13, 47,103,225, 66,240,231,202,194,127,182, -192,154,222,185,118,107,165,179,243,206,236,140,140, 72,109, 97,222,167, 11,255, 72,204,172,201,129, 9, 33,182, 34,145,168,159, - 92, 46,239,196,178,172, 7,143,199,123,152,147,147,115,218, 96, 48,236,102, 89, 54,159,187, 5, 56,188,109, 52,110,220,184,129, - 72, 36,154, 74, 8,105,110, 52, 26, 93, 4, 2,129, 10,192,117,173, 86,187, 52, 50, 50, 50,146,171,161,127, 7, 8, 33,148, 66, -161,248,193,202,202,170, 89,118,118,246, 32, 0, 95, 71, 71, 71, 55,164, 40, 10,126,126,126, 95, 43,149,202, 39,230,230,230,155, -242,242,242,174, 36, 37, 37, 77,172, 78,238, 56, 14,239, 46, 60, 61, 61,195, 41,138,114, 41,157,174,173,172, 32, 40,251,206,178, -236,211,168,168,168,150, 21,113,186,184,184,120, 88, 88, 88,172, 5,208,164, 60, 81, 81, 26, 69,238, 57, 55,115,115,115,199, 38, - 36, 36,148, 27,136,215,198,198,198,220,193,193, 97, 46, 33,164, 15, 69, 81,188,170,206,137, 97, 24,154,101,217,176,212,212,212, -217,153,153,153,121, 21,237,103,107,107,123,250,194,133, 11, 77,236,236,236,170, 12, 75, 99, 52, 26,145,144,144, 96, 31, 18, 18, -114, 1,128,207,223,201, 89, 6, 58, 0, 55,254, 73,109,172,218, 2,139,208, 24,252,233,136, 33,206,217,241,209,206,219,118, 31, -175,247, 77, 23,183,118,223,157,120,158, 92, 29, 14,169, 84,218,207,223,223,127,213,170, 85,171,108,107,215,174, 77,164, 82, 41, -146,146,146,124,110,223,190,253,225,156, 57,115,102, 11, 4,130, 97, 6,131,225,212,107,118,154, 86, 54,102,252,169, 25,121,134, - 25, 92, 87,194,161, 58,232,211,167, 15, 47, 62, 62,126,142,157,157,221, 87,211,166, 77, 19,215,169, 83, 7,102,102,102, 72, 77, - 77,117,141,137,137,169,181,118,237,218,158, 45, 91,182,252, 81, 40, 20,126,115,238,220, 57, 35, 87, 99,255,108, 40, 20,138, 31, - 46, 92,184, 48, 78,169, 84,162, 85,171, 86, 87, 26, 55,110,108, 33,147,201,112,236,216, 49,120,120,120,212,183,180,180,188,190, -126,253,122,193,220,185,115, 27,237,223,191, 31, 0,198,115,181,246,207, 7, 69, 81, 46,145,145,145, 14, 50,153, 12, 52, 77, 23, -101, 3, 96,192,178,108,201,123,105, 49, 68,211, 52,218,183,111,175,175,140, 83, 34,145,172,185,123,247,110,167,226, 12, 39,165, -132, 84,185, 80,169, 84,157,218,183,111,191, 6, 64,185, 1,181, 29, 28, 28,230,246,237,219,119, 82,253,250,245, 75, 82,205, 49, - 12, 83,242,158,158,158,142,207, 63,255,188,228, 24, 12,195,224,194,133, 11, 19,190,248,226, 11, 0,248,162,146,115,119,179,179, -179, 35, 85,165,192,155, 51,103, 14,230,204,153,131, 85,171, 86, 17, 62,159,111, 85, 69,125,190,113,206,127, 58,170, 47,176,192, - 30, 61,186,111,239,167, 33,109,189,201,208, 94, 1, 94,191, 28, 10,191, 58,189, 83,157, 54,139, 78, 63,141, 55, 81, 92, 77, 24, - 61,122,244,162,121,243,230, 73, 30, 61,122,132,168,168, 40, 24,141, 70,152,153,153,161, 65,131, 6,212,209,163, 71, 21, 19, 38, - 76,216, 39, 18,137,134,235,116,186,253, 53, 61, 49, 39,107,222, 82,185,148, 55, 80,196,231, 95,215, 25,141,135,222,197,202,111, -214,172,217, 73,131,193,176, 56, 50, 50,242,236, 63,165,193, 4, 6, 6,182, 18, 10,133,179, 69, 34, 81,215,127,171,184,120,254, -252,249,236,214,173, 91,127, 53,103,206, 28,241,179,103,207, 16, 29, 29,141,164,164, 36,212,174, 93, 27,181,107,215, 38,171, 86, -173,146,252,248,227,143,227,111,223,190, 77, 1,152, 82, 29, 75,137,147,147,211,103, 29, 59,118,252,216,206,206,206, 50, 49, 49, - 49,231,242,229,203,191, 37, 37, 37,253,196,178,108,141,234,146, 16, 66,217,217,217, 13, 13, 9, 9,249,216,198,198,198, 38, 41, - 41, 41,243,143, 63,254,248, 45, 53, 53,117,211,235, 88, 90, 8, 33, 10, 0, 13, 1,216, 22,253,148,228,238,238,126,255,217,179, -103,169,111,144, 83,229,238,238, 30, 85, 19, 78,123,123,123, 57,159,207,223, 75, 8, 81, 86, 98, 33, 80, 25,141,198,190, 69, 1, -142, 43,132,133,133, 69,115,133, 66,129,235,215,175, 99,230,204,153, 54,237,219,183, 71, 76, 76, 12, 40,138,194, 87, 95,125, 69, -252,252,252, 4,201,201,201, 8, 10, 10,194,233,211,167, 91,114,210,164, 90,215, 60, 12,128, 21,128, 1, 44,203,166,151,250,221, - 14,192, 65, 0,169, 44,203,126,244,182,202, 39,149, 74,177,107,215, 46, 8, 4, 2, 8,133, 66,100,101,101,193,217,217, 25, 66, -161, 16, 2,129,160,228, 37, 20, 10, 81,171, 86,173, 42,249, 24,134,105,202,227,241,144,159,159, 15,154,166, 75,210, 44,229,228, -228,128,101, 89,136, 68,162,146,223,139,183, 49, 12,211,180,146,250,235,163, 84, 42,177,123,247,110,232,116,186,242,218, 46,238, -221,251,211,207,156,199,227,161, 81,163, 70, 20, 33,164, 79,101, 2,139, 16,194, 2,192,136, 17, 35, 94, 73, 79, 87,246, 85,156, - 59,152,101,217,146, 20, 98,127, 39,231,191, 90, 96,205,232, 88,103,108,253,128, 70, 75, 69, 34,129,148,161, 13, 96,140, 6,212, -247,247, 2,195, 24,241,244,121, 18, 60, 28, 68, 24,222,205,211,109,251,201,152,123, 95,119,246,106,182,240,100, 76,116,153, 14, -238, 94,153, 11,224,222,164, 73,147,185, 11, 22, 44,144,252,241,199, 31,120,244,232, 17, 22, 46, 92, 8, 0,144,203,229, 56,118, -236, 24,104,154,198,242,229,203,205,187,118,237,186,150, 16,114,158,101,217,204,202, 56, 43,184,208,110,109,130, 92,122,237, 95, -214, 70, 92,255,195,125, 43, 9, 33, 71, 88,150,165, 43,233,136,223,248, 74, 8, 83, 56,141, 70,227,123, 2,129,160,101, 64, 64, - 64, 79, 83, 68,214,219, 42,103,105,113, 37, 16, 8,142,235,245,122,153, 72, 36,226,163,130, 68,210,111,187,156,175,195,217,184, -113,227, 6, 54, 54, 54, 95,205,158, 61, 91,124,237,218, 53,100,101,101, 33, 53, 53, 21, 19, 39, 78,196,186,117,235, 80,191,126, -125,200,229,114,140, 31, 63, 94,242,249,231,159,143,109,210,164, 73,216,205,155, 55,195,171, 42, 39, 33,132,106,219,182,237,174, - 29, 59,118,212, 54, 26,141, 20, 0, 24, 12, 6,235,231,207,159, 15,153, 49, 99, 70, 91, 66,200,128,138, 68, 86,101,156, 45, 91, -182,220,241,203, 47,191,120,138, 68, 34,170,168,179,182,255,228,147, 79, 62,253,230,155,111,218, 19, 66, 6, 86,212,238, 43,171, - 79, 66, 72, 99,153, 76,230, 59,118,236,216,244, 94,189,122, 37, 2, 64, 68, 68, 4,185,117,235, 86,171,185,115,231,198,205,158, - 61,251, 86, 13, 56, 3,101, 50,153,247,184,113,227,210,186,119,239,174, 18, 10,133,204,181,107,215,120,247,238,221, 11, 94,184, -112, 97,236,215, 95,127,125,167, 58,156, 2,129, 96,207,254,253,251,219, 58, 59, 59,211, 0,216,226, 14,158, 16,194, 82, 20,197, - 82, 20,133,216,216, 88,247,222,189,123,239, 4,240,126,101,156,217,217,217, 67,130,131,131, 47,204,156, 57,211, 6, 0, 46, 92, -184, 0, 62,159, 95,242, 64,120,244,232, 17,180, 90, 45, 86,173, 90,165,207,203,203,251,236,223,214,230,255, 98,206, 90, 0,154, - 2, 56, 67, 8,233,192,178,108,122,145,184, 58, 11,192, 15,192,229,183, 85, 78,138,162, 64,211,116,137,136, 58,117,234, 20,214, -173, 91,135,221,187,119,195,217,217,249, 21,129, 37, 16, 8,202,245, 35, 42,231, 25, 87,220,183,131,166,105,220,184,113, 3,155, - 54,109,130,131,131, 3,236,108,109, 97,103,111,143,102,205,154,161,216,106, 70,211,244,255,241,150,229, 76, 79, 79, 7,195, 48, -166,158, 35,114,115,115, 77,174,207,202,132, 80,233, 87,117,174,209,235,112,254,167, 4,150,194,201,238,155,222, 31,191, 39, 5, -109, 4,244, 5,128,190, 16,172,190, 16,172,174, 0, 68, 36, 5,107,208, 64,206,203,192,168,142,142, 22,251,174,166, 60,152,222, -193,173,199,162, 51,207,143, 87, 50, 82,156,181, 97,195, 6,203,187,119,239, 34, 58, 58, 26, 43, 86,172,192,188,121,243, 74, 70, - 14,239,191,255, 62,174, 92,185, 2,157, 78,135,153, 51,103,218, 76,155, 54,109, 28, 94, 58,155, 86,207,122,101,203, 95,183,119, -251, 42, 27, 27,105, 58,134,247,186,105,187,102,111,220, 88, 0, 63,190,139, 23, 96,218,180,105,178, 37, 75,150,252,110,170,200, -122,155,150, 43,177, 88,124,124,214,172, 89,242, 89,179,102,209,111,136,179, 62,159,207,223, 99, 48, 24,190,140,140,140, 60, 81, -131,209,177,107,147, 38, 77, 22, 70, 71, 71, 31,207,205,205,253,165,236,118,145, 72,244,126, 96, 96,224,160,171, 87,175,126, 93, - 85, 34,242, 98,136,197,226, 9, 95,125,245,149, 36, 33, 33, 1,217,217,217, 16,139,197,175,116,110, 98,177, 24, 20, 69, 65, 36, - 18,225,147, 79, 62,145,108,222,188,121, 50,128,254, 85,182, 73, 39,167,207,182,111,223, 94, 91,175,215, 83, 5, 5, 5, 16, 10, -133, 16, 10,133,104,208,160, 1,111,202,148, 41,181, 38, 77,154, 52, 26,192,234,234,156,191,181,181,245,144, 29, 59,118,120,138, - 68, 34, 42, 41, 41, 9,173, 90,181,194,245,235,215,209,172, 89, 51,222,148, 41, 83, 92,199,143, 31, 63, 18,192,186,234, 90,153, -100, 50, 89,253, 11, 23, 46,196, 43,149,127, 26,135,106,215,174,205,118,235,214, 45, 51, 58, 58,218, 59, 50, 50, 50, 35, 32, 32, - 32,190, 26,156,206, 50,153,204,231,196,137, 19, 73,243,230,205,235,184,110,221,186, 94, 0,208,180,105,211, 67, 11, 23, 46,252, - 35, 35, 35,195,239,198,141, 27, 25, 77,155, 54, 77,172, 70, 81,109,157,156,156,140, 99,199,142, 53, 47,187, 97,246,236,217,152, - 59,119, 46,182,110,221,154, 1,192,161, 50, 18,165, 82,217,147,162,168,185,245,235,215,183,232,208,161, 3, 46, 92,184,128,241, -227,199,107, 13, 6, 67, 12, 0,116,234,212,169,222,156, 57,115, 68,145,145,145,176,182,182, 22, 36, 37, 37,253,172, 84, 42, 57, -199,119,211,209, 11,192, 57, 0,245,139, 68, 86, 95, 0,251, 0,248, 2,136, 6,208,251,109, 22,174, 88, 96, 37, 38, 38, 98,243, -230,205, 88,184,112, 33,188,188,188,160,215,235,193,231,243, 75,196, 21,159,207, 7, 33,196,228, 84, 90, 52, 77,227,230,205,155, -216,190,125, 59,102,126,243, 13,204,205, 95, 54, 83,189, 94,143,204,172, 44, 72, 36,146, 18, 17, 86,133, 96, 10,123,252,248,241, - 36,103,103,231,146,105,202,210, 83,132, 0, 96,102,102, 6,134, 97, 96, 52, 26,161,213,106,177,113,227, 70, 35,203,178, 97, 85, -220,147, 37, 98,232,139, 47,190,128, 86,251,103,206,241,134, 13, 27, 2, 0,220,221,221,209,168, 81,163,146,239,197, 22, 42, 83, - 56, 55,181,106, 0,117,169,189,189,231, 44, 3, 0,184,184,184,192,219,219, 27, 10,133,194, 36,206,127,133,192, 42, 78,112, 91, - 54,209,109,114,114,234,226,173,235,127, 94, 38, 18, 80,130, 78, 45,189, 97, 45, 54,130,200,108, 32,108, 59, 29,196,202,237,101, - 3,200,140,133,238,196,116,244,109,148, 78,109,215,242, 14,206,237,230,105, 63,251,216,147,114,157,235, 40,138,106,238,234,234, -138, 11, 23, 46,160,118,237,218,152, 53,107, 22,124,124,124, 32,147,201,144,146,146,130,130,130, 2,200,229,114,208, 52,141,128, -128, 0,158,185,185,121,251,234, 10, 44, 66, 72,192,103,125,155, 53,229, 91,248,160, 85,215, 22, 56,185,182,173,124,235, 97,213, - 12, 66,200,207,165,147,163,190, 43,248,224,131, 15,144,146,146, 34,219,177, 99, 71,141, 69, 86,179,102,205, 78, 26,141,198,247, - 76, 48,135,159,189,120,241, 98,135,154,138,171,205,155, 55,203,173,172,172, 80,149,243,102, 53,196,213,165, 33, 67,134, 88,236, -216,177,227, 64, 64, 64,192,135,213, 17, 89,132, 16,215,190,125,251, 30,217,180,105,147, 79,143, 30, 61,204, 0,252,159,192,170, - 95,191,254, 7, 39, 79,158,252,112,204,152, 49,245, 9, 33, 61,139,146, 74, 87,197,219,178, 78,157, 58,120,241,226, 5, 82, 82, - 82,160,213,106,145,146,146, 2, 0, 72, 72, 72,128,139,139, 11,172,173,173,225,226,226,130,122,245,234, 17,138,162,154,153, 82, -222,246,237,219,247, 2, 64,197,198,198, 34, 45, 45, 13,150,150,150,144,203,229,112,118,118, 70,135, 14, 29,248,158,158,158,221, -171, 43,176,186,117,235,246,177, 76, 38,163,158, 63,127,142,184,184, 56,104,181, 90,196,196,196,192,210,210, 18,157, 58,117, 18, -120,122,122,134, 84, 87, 96, 1,240, 31, 57,114,100,106,105,113, 85, 12,185, 92, 78,188,189,189, 51,173,172,172,130, 0,196, 87, -135,115,252,248,241, 41,161,161,161,109, 78,159, 62, 61,173,248,199,211,167, 79, 79, 5,128,213,171, 87, 95,176,177,177, 9, 2, - 80, 29,129, 5,150,101,153, 79, 63,253,244,177, 72, 36, 66,241,171, 88,184, 46, 91,182, 12, 20, 69, 89,154, 64,243,117,116,116, -116, 67, 51, 51, 51, 68, 71, 71,131,199,227,129, 16,242, 88,165, 82, 53, 44, 26, 0, 61,209,104, 52, 30, 26,141, 6,189,123,247, - 38, 61,122,244,104,176, 98,197,138,111, 0,188, 19, 2,139, 16,210, 4,192,114,188,116, 0,254,134,101,217,235,239, 82,255,198, -178,108, 10, 33,164, 93, 41,145,117, 11,128,184, 72, 92,181, 99, 89, 54,229, 45,214, 29, 24,134, 1,159,207,199,178,101,203,160, -215,235,241,203, 47,191, 96,223,190,125,160, 40, 10,132, 16, 16, 66, 96, 97, 97,129, 31,126,248,161,228,187, 41, 48, 26,141,216, -178,101, 11,166, 79,155, 86, 34,174, 0, 64, 40, 20,194,201,209, 17,182,118,118,136,141,141,173, 82, 96,165,166,166,206,190,113, -227, 6, 42,115,114,255,232,163, 63,103, 88, 75, 59,185,155, 82, 78, 30,143, 7,173, 86,139,247,222,251,243,241, 49,110,220,184, -146,207, 89, 89, 89,197,247, 4,136,137, 39,207,227,241,160,102,129, 15, 36,127,254,214,253,203, 47, 95,177,200, 85,196, 89,145, - 22,249, 87, 90,176, 68,193,207, 87, 63,187, 66, 53,234, 19,210, 98,168,141,133, 20, 76,158, 10,194,142,115,112, 55, 83,134,149, -235, 95, 62, 11, 39,245, 14,128,255,123, 11,160,253,185, 51, 58,184,235, 68, 63, 71, 74,167, 0,152, 85, 30,159,157,157,157,157, -209,104, 4, 69, 81,144,203,229,176,177,177,129, 84, 42, 69,122,122, 58, 38, 76,152,128,227,199,143, 67,167,211, 65, 40, 20,162, - 78,157, 58,208,235,245, 30,213,182, 94, 89,243, 55,173, 88,182,208, 42, 35,118, 39, 34, 30,101, 67,102,233,130,111, 70, 6, 89, -207, 89, 27, 62, 27,192,212,119,241, 34,248,249,249, 97,226,196,137,178, 31,127,252,177, 70, 34,203,104, 52,206,231,243,249,173, -190,252,242, 75,105,239,222,255, 63, 32,140,138,138,194,232,209,163,213,133,133,133,223,213, 68, 92,137, 68,162,227,155, 54,109, -146, 91, 90, 90,226,197,139, 23,111, 76, 92,173, 90,181,202,194,195,195, 3, 2,129, 64,178,101,203, 22,147, 69, 22, 33,164,222, - 71, 31,125,116,116,211,166, 77,110, 35, 71,142, 76,184,112,225, 66, 28, 33,164, 60, 33,158, 53,116,232,208,231, 91,183,110,245, -100, 24,230, 4, 33, 36,132,101,217, 7, 85,212,165,171, 76, 38, 67,122,122, 58, 38, 77,154,244,138,131,106,241,116, 54, 0, 68, - 71, 71,195,197,197, 5, 26,141,198,217,148,115,182,177,177,177,102, 89, 22, 35, 70,140, 64,124,252,159,218,196,217,217, 25,241, -241,241, 48, 26,141, 54,213,173, 71,107,107,107, 27,131,193,128,182,109,219, 66,163,209, 0, 0,250,246,237, 11,129, 64,128,212, -212, 84,232,245,122,219, 26, 92, 30,187, 30, 61,122,168, 42,218, 40,151,203, 13,214,214,214,238,213,228,180, 13, 9, 9, 73,220, -176, 97,195,251,101, 55,220,184,113,227,125, 75, 75,203,211, 54, 54, 54,222, 53, 40, 43, 35, 22,139, 33, 22,139, 33, 16, 8, 32, - 18,137, 32, 22,139, 33, 18,137, 32, 16, 8,192,227,241, 76,154, 87, 97, 24, 6, 71,142, 28, 1, 69, 81,175, 76, 93,204,154, 53, -107,148,149,149,149,227,249,243,231, 75, 6,128,249,249,249,168, 91,183,110,157, 78,157, 58,221, 78, 78, 78,142,139,138,138,250, -240, 45,119, 31, 75, 1, 20,251,133,173, 3,208,232, 93,235,223,138, 68, 86, 31, 0,225, 69,226, 74, 7,224,227,183, 41,174, 74, - 95,123, 62,159, 95,114,159, 75, 36, 18, 4, 4, 4,148,136, 41, 66, 8, 10, 11, 11, 75,166, 8, 77,125,232,231,228,228, 64,161, - 80,192,220,220, 28,117,189,188,240, 56, 38, 6, 0, 74, 62,139, 68,162, 18, 33, 86, 25,138, 86, 2,126,129, 74,252,169,106, 40, - 46, 89, 0,224,243, 43,119,195, 86, 40, 20, 96, 24,166, 88, 88,178,111,130,211,206,206, 14,249,249,249, 38,113,254, 43, 4, 86, -121,138,113,238, 92, 66,105,175,212,222,220,167,123,211,161,190, 46,114,104,211, 99, 33, 50,179, 5,177,114,199,202,245, 39,240, - 32,238,165,107,212,202,125,145,216, 58,163, 11,136,204, 6, 10,245, 35,152, 75,196, 31, 86, 36,176, 50, 50, 50,242,245,122,189, -141, 84, 42, 5,159,207,135, 80, 40, 68,122,122, 58,190,253,246, 91,236,221,187, 23,238,238,238, 48, 26,141, 16,137, 68, 72, 75, - 75,131, 80, 40,172,214,234, 68, 62,159,244,152, 51,177, 91,109,185,173, 23, 50, 34,231,189,252,209, 34, 0, 35,251,242, 68,223, -111,191, 63,132, 16,242, 61,203,178,169,239,218, 69, 48, 51, 51, 67,163, 70,141, 48,112,224, 64,217, 47,191,252,178, 13,128, 75, -117,254, 31, 17, 17,113, 57, 48, 48,176,243,242,229,203, 79, 38, 37, 37, 73, 27, 55,110, 12, 51, 51, 51,152,153,153, 33, 54, 54, - 22,243,230,205,211,104,181,218,144,154, 88,199,248,124,254,150, 79, 63,253, 84,110, 97, 97,129,216,216, 88,216,216,216,188,214, -185, 6, 6, 6,214, 23, 8, 4,151, 86,173, 90,101,225,233,233,137,135, 15, 31, 34, 48, 48, 16, 78, 78, 78,146,208,208, 80, 83, - 69,214,154,157, 59,119,186,139, 68, 34,178,107,215, 46,215, 93,187,118, 77,168,234,184,219,183,111,119,223,181,107,215, 42, 66, - 72,167,202,156,191,133, 66, 97, 66, 90, 90,154,103,173, 90,181,176,121,243,102, 80, 20, 5,149, 74,133,111,190,249, 6,161,161, -161,104,214,172, 25,204,205,205, 81,171, 86, 45, 60,126,252, 24, 18,137, 36,201,148,243, 78, 76, 76,204, 4,224,112,252,248,113, -164,165,253, 25,178,197,205,205, 13,153,153,153,208,106,181, 25,213,173,203,196,196,196, 12, 0,142,183,111,223, 70, 92, 92, 28, -186,118,237,138,131, 7, 15, 34, 40, 40, 8, 52, 77,195, 96, 48,100,212,224, 18,209, 60, 30,143,173,164, 19, 37, 0,172,171,201, -105,172,140, 19, 47,227, 77, 85,151, 19, 44,203,178, 21,137, 43,145, 72,132, 42,142, 89,162,155,125,124,124,230,214,169, 83,199, -247,155,111,190, 17,240,249,124, 4, 7, 7,215,155, 50,101,202,115,169, 84,106, 59,125,250,116, 89,121,198, 96, 0, 13,125,125, -125,229,239, 64,247, 81,218, 74,247, 78, 46, 58, 33,132, 56, 20, 89,252, 68, 0,244, 69,239,187,139,125,178,222,182, 5, 75, 40, - 20, 98,206,156, 57, 24, 51,102, 12, 28, 29, 29, 49,109,218, 52,240,249,252,146, 87,177, 85,166,216,170,101, 98,219,132,163,131, - 67,229, 55, 90,145,147,123, 21, 3,179,191, 36, 76, 67,177, 24, 50,197, 23,170,148,181,201, 36,209,246, 58,156,255, 38,235, 85, -137,192, 42,107,150, 43, 17, 87, 93, 3,135,250,184, 72,113, 43,242, 30,252,157, 12, 96, 5,130, 74, 90,139, 1, 68, 40,135,149, -148,239, 82,201, 5,136,140,139,139,115,179,178,178,130, 94,175,135, 72, 36,130,191,191, 63,174, 94,189, 10,173, 86, 11,157, 78, - 7,177, 88, 12,161, 80,136,251,247,239, 67,175,215, 95,168,198,205,194,115,180,230,173,154,250,245, 60,115, 36,110,134,149,185, - 8,237,155,123, 2,114, 95,240, 10, 30, 97,249,204, 16,155, 81,223, 28, 92, 9, 19,252,101,222,134,192,122,254,252, 57,118,237, -218, 85,168,213,106,135,212,132,163, 88,100,237,221,187,247,164,149,149,149,180, 89,179,102,136,137,137,193,119,223,125,167,209, -106,181, 61,106,234,223,101, 52, 26,135,109,220,184,241,184,209,104,148, 23,139,139,215,181, 92, 77,152, 48,193,188,110,221,186, -120,242,228, 9, 44, 45, 45, 97,110,110,142,218,181,107, 67,161, 80, 72, 38, 76,152, 96,138,200,250,124,224,192,129, 71,183,110, -221,234, 54,114,228,200,132,221,187,119, 31, 2,144, 83, 94,213,126,244,209, 71,239,111,221,186,213,109,212,168, 81, 47, 0, 76, -168,106,101, 29,195, 48, 87,158, 60,121,226,225,227,227, 67,234,213,171, 7,145, 72, 4,103,231,151, 70,170,134, 13, 27,194,199, -199, 7, 66,161, 16, 0,240,228,201, 19,192,196,184, 44, 23, 47, 94,252, 45, 58, 58,250,179,160,160, 32,158,147,147,211, 43,171, -147, 66, 67, 67,245,207,159, 63,175,118,154,135, 51,103,206, 28,188,119,239,222,136,224,224, 96,190,181,181, 53,196, 98, 49,252, -253,253,161, 80, 40,240,221,119,223,233,159, 61,123, 86,147,212, 17, 47,110,223,190, 45,241,242,242,162, 43,104,171,230, 0,170, -107,121, 72,136,136,136, 16, 54,111,222,252,208,177, 99,199,234,151,222,208,180,105,211, 67,102,102,102,150, 0,146,106, 80, 86, -166,244,212, 96,233,169, 66,145, 72, 4, 62,159, 95,165, 5, 75,165, 82,253,238,228,228,244,212,209,209,241,114,203,150, 45, 45, -195,195,195, 49,107,214, 44,161, 86,171,117, 61,125,250,116,201,131,184,188, 7,104, 65, 65,129,228, 29,232, 62, 38, 1, 88, 1, - 64, 6, 96,218, 59, 40,174, 28,241,210,161,221, 27, 47,167, 5,251, 22,137,173, 98,159,172,183, 42,178, 24,134,129, 64, 32,128, -183,183, 55,190,248,226, 11, 44, 94,188, 24, 99,199,142, 69,221,186,117, 75,174,125,177, 15, 86,209,138, 55,147, 30,252, 66,161, - 16,142, 78, 78, 48, 24, 12, 37,214, 43, 0,120, 28, 19, 3, 62,159, 15,134, 97,160,213,106,171,156, 34,116,112,112,152,187,100, -201,146, 9,221,186,117,163, 74,175,184, 99, 89,182, 36,156, 68,233,151,193, 96,192,239,191,255, 62, 33, 52, 52, 20,166, 88,189, -120, 60, 30, 26, 54,108,248,202,180,224,234,213,127,122, 42, 4, 4, 4,160, 83,167, 78,213, 90,237,199,227,241,224, 61,103,217, - 43,211,130, 71,237,255,172,182, 90,159,140, 68,221,239, 86,149,203,249,159,152, 34,212, 95,117, 91,208,187, 75,163,161, 62,206, - 98,220,142,188,143,195,225,105,143,156, 90,242,189,237, 10,210,192,164, 61,196,164,222, 1, 88,185,239,101,156,197, 73,189, 3, -192,164,222, 7,155, 21, 11, 88,212, 66,106, 1,163,170,196,220,185,116,254,252,249,237,214,175, 95,111,157,155,155, 11,129, 64, -128,132,132, 4,180,111,223, 30, 15, 30,188,156,185, 17,137, 68,160, 40, 10,179,102,205, 74, 75, 75, 75, 91,111,234,137,200,165, -212,200,197,223,244,119, 20,138,205,129,204, 11,176,176,176,194,230,245,203, 0,173, 10,160, 68,232,217,169, 17,111,238,143,231, - 59, 16, 66,234,177, 44, 27,253, 46, 93,132, 23, 47, 94, 96,206,156, 57,133,106,181,250,181, 28,221,139, 69,214,250,245,235, 79, -166,167,167, 75, 15, 28, 56,240, 90,226,170, 20,103,215,109,219,182, 29,119,114,114,146,187,187,187,215,248, 60,133, 66,225,116, -189, 94,111,177, 98,197, 10,122,229,202,149, 21,117,120, 98,153, 76,182, 4,192,137, 74, 70,135,209,132,144,246,124, 62,255,200, -166, 77,155,124,146,146,146,220,207,159, 63,223,179, 28, 65,183,117,235,214,173,110, 99,198,140,121,178,107,215, 46,147,124,176, -180, 90,237,234,117,235,214,245, 89,179,102,141,212,204,204, 12,132, 16,216,219,219,151, 8,225,226, 7,185, 94,175,199,218,181, -107,213,106,181,122,165, 41,231,158,145,145,177,121,202,148, 41,237,103,204,152,225,214,172, 89, 51,129,173,173, 45, 84, 42, 21, -118,237,218,165,255,233,167,159, 18,179,179,179,127,170,110,125,230,230,230,110,153, 58,117,106,199,111,190,249,198,173, 83,167, - 78,130,172,172, 44,104,181, 90,124,247,221,119,250,159,126,250, 41, 49, 47, 47,175,218,156, 45, 90,180,120,146,152,152,216, 74, -171,213,102,137,197,226, 87, 58, 56,129, 64, 64, 36, 18, 73, 83, 0,219,171,195, 25, 20, 20,244, 36, 46, 46,174,197,130, 5, 11, -206, 27, 12, 6,193,141, 27, 55,122, 21,139,171,181,107,215,158,149, 72, 36,157, 0, 84,187,172, 20, 69, 49,101, 69, 85,105,177, - 37, 16, 8, 76,154, 34,244,241,241,217,185,125,251,118,203, 7, 15, 30, 32, 55, 55, 23,105,105,105,208,104, 52, 37, 83,185, 21, -197, 49, 42, 44, 44,148,190,237,190,131,101,217,115,120, 25,250,226, 93,197,190, 82,226,170, 93, 57, 62, 89,191,225,207, 41,206, -191,221,130,197,178,108,201, 96,167,127,255,254,232,216,177, 35,220,220,220, 74, 68, 85,233, 85,132,213, 17, 25, 52, 77,195,223, -223, 31,218, 34,151,151,226, 54,196,231,243, 97,111,111,143,199, 79,158,152,228,228, 78, 8,233,211,173, 91, 55, 42, 42, 42, 10, -253,250,245,195,142, 29, 59, 42,220,119,240,224,193,216,189,123, 55,186,116,233, 66, 45, 90,180,168, 79, 21, 2,171, 90,214, 38, - 19,173,119,127, 5,231, 63, 95, 96, 21, 43,197,226,119, 71,107,249, 48, 95, 5, 31,183,111, 63,192,161,136,204,173,132, 80,251, - 35,159,105, 15,119,169,147, 7,253,222, 1,240,239,179, 3, 91,103,116,121,249, 64, 76,189, 15,125,216, 96, 16,153, 29, 30,231, -202,161,214,101, 31,169,164, 51,184, 97,109,109,189,103,251,246,237,159, 14, 29, 58, 84,196, 48, 12,164, 82, 41, 38, 79,158, 92, - 18, 35,132,199,227, 97,236,216,177,249,169,169,169, 43, 76, 93,249, 69, 8,145, 58,219,139,102, 14, 26, 49, 75,130,248, 13, 0, - 37, 68, 58, 26,163, 97,155, 79,145, 26,119, 21, 40,120, 0, 16, 33,214, 47,250,204,238,253, 97,223,255, 4,160,245,187,114, 1, - 30, 62,124,136,217,179,103,191,182,184, 42, 43,178, 14, 29, 58,180, 77,171,213,142,120,131,156, 93, 23, 47, 94,124,220,193,193, -161,198,211, 34,206,206,206,159,164,167,167,127,106,138,225,204,132, 7,203, 11, 66, 72,143,184,184,184,133,209,209,209,229,174, - 92,189,127,255,254,193,206,157, 59,203,170,179,138, 48, 50, 50, 50,178,121,243,230,235, 86,172, 88, 49,118,226,196,137, 18,169, - 84, 10, 11, 11, 11, 68, 71, 71,195,213,213, 21, 0,160, 86,171, 49, 99,198, 12,181,193, 96,216,122,243,230,205,171, 38, 62, 8, - 25, 66,200,160,209,163, 71,127, 86,175, 94,189,247, 25,134,177,213,233,116, 25,207,159, 63, 63,146,151,151, 87,163, 56, 88, 69, -156, 3,199,140, 25, 51,212,203,203,235, 99,189, 94,111,107, 52, 26, 51,226,227,227, 15,229,230,230,110,174, 9,231,149, 43, 87, -210, 54,109,218, 20,155,156,156,236,167, 80, 40,114, 44, 45, 45,117, 58,157,142,103,102,102,102, 46, 18,137, 2, 1, 92, 5,240, -160, 58,156, 55,111,222, 76, 89,191,126,125,156, 86,171,173,183,113,227,198, 11,114,185,252, 15, 66, 8, 17, 10,133,214,114,185, -188, 61,128,243, 0, 30, 87,183,172, 20, 69, 49,197,211,130,101,173, 88, 66,161, 16,132, 16,147, 4,214,147, 39, 79, 46,207,159, - 63,191, 65,157, 58,117,176,126,253,250, 76, 51, 51, 51,243,143, 63,254,152,159,147,147, 67, 42,179, 96,169,213,106, 9, 56, 84, - 57,182, 40,178,242,246, 42,246,185, 42, 37,178,246, 1,200,126,203, 2,245, 21, 33,229,234,234,250,138,168, 42,189,173, 58, 2, -203,104, 52, 66, 40, 20,130,207,231,195, 73,161, 40, 17,115, 44,203, 34,230,241, 99,100,101,101,149,132,105,168,162,141,243, 8, - 33,232,215,175,159, 73,199,237,223,191, 63,206,159, 63,143,170,166, 19, 75,175,248,171,106,208, 92, 44,152, 40,138, 50,121, 21, -161,139,139, 75,141, 56,203,106,145,127,165, 5, 75,149, 89,184, 96,211,129, 91, 51, 84,185,198,253,226,150,207,191,152, 51, 7, -236,140,142,238, 39, 93,228,162,206,190, 84, 34,180, 63, 5,131, 88,188,124,216,176,249, 42, 16,185, 19,178, 4,174,248, 61, 50, - 57,153, 18,240,150, 84,118,192,236,236,236, 73, 63,252,240, 3,239,248,241,227,125, 22, 46, 92,104,229,237,237,141, 65,131, 6, - 65,167,211,225,238,221,187, 24, 61,122,116,102, 90, 90,218,134,236,236,236,197,166,158,132,157, 5,255,219,149, 95,119,182,165, -152,124, 32, 55, 2,224, 91,194,206,198, 28,119,194, 47, 0, 57,225, 0, 37, 4, 40, 17,130, 26,251,160, 97,125, 79, 31, 66, 72, - 48,203,178,151,222,133, 11, 48,106,212,168, 55, 38,174, 74, 11, 34, 0,117,222,100, 57,139, 69,214,151, 95,126,121,156, 97, 24, - 89, 77, 56,194,194,194,104, 0,244, 27,236, 28, 95, 0, 24, 88,209,118,157, 78,119, 8, 64,181,131,204, 26, 12,134, 25, 81, 81, - 81, 24, 55,110,220,152,193,131, 7, 75,189,189,189,225,230,230,134,152,152, 24, 68, 71, 71, 99,221,186,117, 26,134, 97, 54,103, -103,103,127, 85,205,242,210, 0, 54, 20,189,222, 84, 29, 48, 0,126, 46,122,189, 17,124,246,217,103,247, 30, 63,126,156,233,236, -236,220,140,199,227, 53,192,203, 64,145, 73, 69,199,120, 92, 19,206,209,163, 71,223,142,141,141, 77,119,114,114,106, 38, 20, 10, - 61,139, 56, 19, 1,108,174, 33,103,198,157, 59,119, 60,155, 54,109,202,240,120, 60, 86, 32, 16,176, 69, 15, 67,150,207,231,179, -132, 16,246,196,137, 19, 18, 0, 85,250, 92, 38, 36, 36, 76,216,186,117, 43,107,102,102,214, 44, 63, 63,127, 16,128,109,106,181, -186,105,118,118,118,165, 22, 44,141, 70, 35,230,244, 83,149,237,243,131, 10,126, 79, 1, 16,252, 46,148,113,254,252,249,216,176, - 97, 3,170,138, 64,126,232,208, 33,160,138, 41,194,226,182, 82,236, 95,165,211,233, 16, 21, 21, 5, 66, 72,201,247,210, 65, 70, -105,154,174, 52,210, 59,195, 48,180, 78,167,195,158, 61,123, 76, 18, 89,187,118,237,130, 70,163, 1,195, 48, 38,245,179, 69,129, - 73,145,149,149, 85, 18, 58, 33, 32, 32,160,100,187, 94,175,175,118,125,242,120, 60,120,123,123, 35, 61, 61, 29,118,118,118, 0, - 94, 78, 11,150,136,207,130,130,255, 76,251, 39,149, 93,220,210,152,219,206,221, 82,195,167, 14, 52,114,102,218, 5,185,137, 97, -103, 37, 1, 79, 32, 70,174,134, 32, 74,165,193,165, 7,185,241,180,145, 13,249,238,143,103, 38, 5,136, 35,132, 52, 87, 40, 20, - 95,211, 52, 93,159,162, 40, 25,203,178,249, 60, 30,239,150, 74,165,154,203,178,236,253,234,156,132,149, 57,239,177,181,156,103, - 41, 16,137, 88,218,200, 0,160, 0,138, 2, 8, 5,128, 87,244,254,242,187, 90,173, 23,210, 12,217,159,146,150,254,217,219,174, -252, 54,109,218,156, 44, 40, 40,248,199, 69,114,151, 74,165,179,121, 60, 94,215,127,123,154,152, 38, 77,154, 4, 73,165,210,175, - 25,134,105,162,209,104,156,164, 82,105, 10, 33, 36, 60, 47, 47,111,209,173, 91,183,174,113,143,207,183,135, 55, 25,201,189, 44, -138,147, 61,219,217,217,121,221,185,115, 71, 82,218,130, 85,186,191,172,206,170, 50, 14,239, 30,124,125,125,175,239,220,185, 51, -200,213,213,149, 42,118,184,166, 40,170,228, 85, 60,141, 85,108,109,185,118,237,154,241,243,207, 63,191,122,251,246,237, 54, 21, -113,214,173, 91,247,228,233,211,167,223, 43,109,161, 42, 22, 82,101, 63,211, 52,141,194,194, 66,204,158, 61,251,212,227,199,143, -203, 77,149,227,227,227,179, 98,230,204,153, 19,186,119,239, 78, 81, 20,245,127, 62, 87,101,253,176,244,122, 61,246,239,223,207, -108,217,178,101,213,195,135, 15, 43,156, 34,108,220,184,113,252,173, 91,183, 92,138, 67, 38,148,125,149, 93, 81, 11, 0,205,155, - 55, 79,186,126,253,186,242,239,228,252,207, 8,172,162, 14,133, 76,235,224,214,151,128,234, 67, 17,198, 31,132,136, 24, 22,209, - 4, 56, 41,146,232,214,206,254, 93,165, 46,179,191,255,155,142,200,203,113,114,156,111,131,147, 16, 66,153,146,122,134,171,207, -127, 15,103,221,186,117, 31, 63,126,252,216,179, 18,158, 18,129,197,213,231, 63,143,211,222,222, 94,110,111,111,255, 7, 69, 81, -110, 21, 37,119, 46, 45,174, 25,134,137, 75, 73, 73,233,152,146,146, 82, 88, 17,167,139,139,139,135, 68, 34, 89,195, 48, 76, 83, - 83,146, 61, 83, 20,117, 67,163,209,124, 94, 58,217,115,105,206, 55,181,138,176,108, 57,235,215,175,255,228,198,141, 27, 30, 82, -169,180,100,234,178,116,187, 46,139,103,207,158,225,227,143, 63,126,126,251,246,109,247,191,146,243,223,134,106,229, 34,100, 95, -214,216,158,162, 23, 7, 14,255, 25,188, 78, 94, 63, 14,255, 76,168,213,234, 44,123,123,251,124,141, 70, 35,208,106,181, 2,163, -209,248,202, 3, 78, 42,149,166,113,181,244,207, 69,145,101,179,217,155,228, 44, 18, 74,157,223, 20,223, 95, 21, 7, 43, 43, 43, - 43,164, 73,147, 38, 39,248,124,190,184,172,248, 41, 79, 12,209, 52,173,201,200,200,232,250,119,115,254,167, 4, 22, 7, 14, 28, - 56,252, 87,144,152,152,216,140,171, 5, 14,255, 70,168, 84,170,104, 0,110,239, 58,231, 63, 29, 20, 87, 5, 28, 56,112,224,192, -129, 3, 7, 14,156,192,226,192,129, 3, 7, 14, 28, 56,112,224, 4, 22, 7, 14, 28, 56,112,224,192,129, 3, 39,176, 56,112,224, -192,129, 3, 7, 14, 28, 56,212, 24,255, 27, 0, 30,206, 65, 61,139,248,242,231, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130, + +137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 2, 88, 0, 0, 2,128, 8, 6, 0, 0, 0, 64, 11, 6, +158, 0, 0, 10, 79,105, 67, 67, 80, 80,104,111,116,111,115,104,111,112, 32, 73, 67, 67, 32,112,114,111,102,105,108,101, 0, 0, +120,218,157, 83,103, 84, 83,233, 22, 61,247,222,244, 66, 75,136,128,148, 75,111, 82, 21, 8, 32, 82, 66,139,128, 20,145, 38, 42, + 33, 9, 16, 74,136, 33,161,217, 21, 81,193, 17, 69, 69, 4, 27,200,160,136, 3,142,142,128,140, 21, 81, 44, 12,138, 10,216, 7, +228, 33,162,142,131,163,136,138,202,251,225,123,163,107,214,188,247,230,205,254,181,215, 62,231,172,243,157,179,207, 7,192, 8, + 12,150, 72, 51, 81, 53,128, 12,169, 66, 30, 17,224,131,199,196,198,225,228, 46, 64,129, 10, 36,112, 0, 16, 8,179,100, 33,115, +253, 35, 1, 0,248,126, 60, 60, 43, 34,192, 7,190, 0, 1,120,211, 11, 8, 0,192, 77,155,192, 48, 28,135,255, 15,234, 66,153, + 92, 1,128,132, 1,192,116,145, 56, 75, 8,128, 20, 0, 64,122,142, 66,166, 0, 64, 70, 1,128,157,152, 38, 83, 0,160, 4, 0, + 96,203, 99, 98,227, 0, 80, 45, 0, 96, 39,127,230,211, 0,128,157,248,153,123, 1, 0, 91,148, 33, 21, 1,160,145, 0, 32, 19, +101,136, 68, 0,104, 59, 0,172,207, 86,138, 69, 0, 88, 48, 0, 20,102, 75,196, 57, 0,216, 45, 0, 48, 73, 87,102, 72, 0,176, +183, 0,192,206, 16, 11,178, 0, 8, 12, 0, 48, 81,136,133, 41, 0, 4,123, 0, 96,200, 35, 35,120, 0,132,153, 0, 20, 70,242, + 87, 60,241, 43,174, 16,231, 42, 0, 0,120,153,178, 60,185, 36, 57, 69,129, 91, 8, 45,113, 7, 87, 87, 46, 30, 40,206, 73, 23, + 43, 20, 54, 97, 2, 97,154, 64, 46,194,121,153, 25, 50,129, 52, 15,224,243,204, 0, 0,160,145, 21, 17,224,131,243,253,120,206, + 14,174,206,206, 54,142,182, 14, 95, 45,234,191, 6,255, 34, 98, 98,227,254,229,207,171,112, 64, 0, 0,225,116,126,209,254, 44, + 47,179, 26,128, 59, 6,128,109,254,162, 37,238, 4,104, 94, 11,160,117,247,139,102,178, 15, 64,181, 0,160,233,218, 87,243,112, +248,126, 60, 60, 69,161,144,185,217,217,229,228,228,216, 74,196, 66, 91, 97,202, 87,125,254,103,194, 95,192, 87,253,108,249,126, + 60,252,247,245,224,190,226, 36,129, 50, 93,129, 71, 4,248,224,194,204,244, 76,165, 28,207,146, 9,132, 98,220,230,143, 71,252, +183, 11,255,252, 29,211, 34,196, 73, 98,185, 88, 42, 20,227, 81, 18,113,142, 68,154,140,243, 50,165, 34,137, 66,146, 41,197, 37, +210,255,100,226,223, 44,251, 3, 62,223, 53, 0,176,106, 62, 1,123,145, 45,168, 93, 99, 3,246, 75, 39, 16, 88,116,192,226,247, + 0, 0,242,187,111,193,212, 40, 8, 3,128,104,131,225,207,119,255,239, 63,253, 71,160, 37, 0,128,102, 73,146,113, 0, 0, 94, + 68, 36, 46, 84,202,179, 63,199, 8, 0, 0, 68,160,129, 42,176, 65, 27,244,193, 24, 44,192, 6, 28,193, 5,220,193, 11,252, 96, + 54,132, 66, 36,196,194, 66, 16, 66, 10,100,128, 28,114, 96, 41,172,130, 66, 40,134,205,176, 29, 42, 96, 47,212, 64, 29, 52,192, + 81,104,134,147,112, 14, 46,194, 85,184, 14, 61,112, 15,250, 97, 8,158,193, 40,188,129, 9, 4, 65,200, 8, 19, 97, 33,218,136, + 1, 98,138, 88, 35,142, 8, 23,153,133,248, 33,193, 72, 4, 18,139, 36, 32,201,136, 20, 81, 34, 75,145, 53, 72, 49, 82,138, 84, + 32, 85, 72, 29,242, 61,114, 2, 57,135, 92, 70,186,145, 59,200, 0, 50,130,252,134,188, 71, 49,148,129,178, 81, 61,212, 12,181, + 67,185,168, 55, 26,132, 70,162, 11,208,100,116, 49,154,143, 22,160,155,208,114,180, 26, 61,140, 54,161,231,208,171,104, 15,218, +143, 62, 67,199, 48,192,232, 24, 7, 51,196,108, 48, 46,198,195, 66,177, 56, 44, 9,147, 99,203,177, 34,172, 12,171,198, 26,176, + 86,172, 3,187,137,245, 99,207,177,119, 4, 18,129, 69,192, 9, 54, 4,119, 66, 32, 97, 30, 65, 72, 88, 76, 88, 78,216, 72,168, + 32, 28, 36, 52, 17,218, 9, 55, 9, 3,132, 81,194, 39, 34,147,168, 75,180, 38,186, 17,249,196, 24, 98, 50, 49,135, 88, 72, 44, + 35,214, 18,143, 19, 47, 16,123,136, 67,196, 55, 36, 18,137, 67, 50, 39,185,144, 2, 73,177,164, 84,210, 18,210, 70,210,110, 82, + 35,233, 44,169,155, 52, 72, 26, 35,147,201,218,100,107,178, 7, 57,148, 44, 32, 43,200,133,228,157,228,195,228, 51,228, 27,228, + 33,242, 91, 10,157, 98, 64,113,164,248, 83,226, 40, 82,202,106, 74, 25,229, 16,229, 52,229, 6,101,152, 50, 65, 85,163,154, 82, +221,168,161, 84, 17, 53,143, 90, 66,173,161,182, 82,175, 81,135,168, 19, 52,117,154, 57,205,131, 22, 73, 75,165,173,162,149,211, + 26,104, 23,104,247,105,175,232,116,186, 17,221,149, 30, 78,151,208, 87,210,203,233, 71,232,151,232, 3,244,119, 12, 13,134, 21, +131,199,136,103, 40, 25,155, 24, 7, 24,103, 25,119, 24,175,152, 76,166, 25,211,139, 25,199, 84, 48, 55, 49,235,152,231,153, 15, +153,111, 85, 88, 42,182, 42,124, 21,145,202, 10,149, 74,149, 38,149, 27, 42, 47, 84,169,170,166,170,222,170, 11, 85,243, 85,203, + 84,143,169, 94, 83,125,174, 70, 85, 51, 83,227,169, 9,212,150,171, 85,170,157, 80,235, 83, 27, 83,103,169, 59,168,135,170,103, +168,111, 84, 63,164,126, 89,253,137, 6, 89,195, 76,195, 79, 67,164, 81,160,177, 95,227,188,198, 32, 11, 99, 25,179,120, 44, 33, +107, 13,171,134,117,129, 53,196, 38,177,205,217,124,118, 42,187,152,253, 29,187,139, 61,170,169,161, 57, 67, 51, 74, 51, 87,179, + 82,243,148,102, 63, 7,227,152,113,248,156,116, 78, 9,231, 40,167,151,243,126,138,222, 20,239, 41,226, 41, 27,166, 52, 76,185, + 49,101, 92,107,170,150,151,150, 88,171, 72,171, 81,171, 71,235,189, 54,174,237,167,157,166,189, 69,187, 89,251,129, 14, 65,199, + 74, 39, 92, 39, 71,103,143,206, 5,157,231, 83,217, 83,221,167, 10,167, 22, 77, 61, 58,245,174, 46,170,107,165, 27,161,187, 68, +119,191,110,167,238,152,158,190, 94,128,158, 76,111,167,222,121,189,231,250, 28,125, 47,253, 84,253,109,250,167,245, 71, 12, 88, + 6,179, 12, 36, 6,219, 12,206, 24, 60,197, 53,113,111, 60, 29, 47,199,219,241, 81, 67, 93,195, 64, 67,165, 97,149, 97,151,225, +132,145,185,209, 60,163,213, 70,141, 70, 15,140,105,198, 92,227, 36,227,109,198,109,198,163, 38, 6, 38, 33, 38, 75, 77,234, 77, +238,154, 82, 77,185,166, 41,166, 59, 76, 59, 76,199,205,204,205,162,205,214,153, 53,155, 61, 49,215, 50,231,155,231,155,215,155, +223,183, 96, 90,120, 90, 44,182,168,182,184,101, 73,178,228, 90,166, 89,238,182,188,110,133, 90, 57, 89,165, 88, 85, 90, 93,179, + 70,173,157,173, 37,214,187,173,187,167, 17,167,185, 78,147, 78,171,158,214,103,195,176,241,182,201,182,169,183, 25,176,229,216, + 6,219,174,182,109,182,125, 97,103, 98, 23,103,183,197,174,195,238,147,189,147,125,186,125,141,253, 61, 7, 13,135,217, 14,171, + 29, 90, 29,126,115,180,114, 20, 58, 86, 58,222,154,206,156,238, 63,125,197,244,150,233, 47,103, 88,207, 16,207,216, 51,227,182, + 19,203, 41,196,105,157, 83,155,211, 71,103, 23,103,185,115,131,243,136,139,137, 75,130,203, 46,151, 62, 46,155, 27,198,221,200, +189,228, 74,116,245,113, 93,225,122,210,245,157,155,179,155,194,237,168,219,175,238, 54,238,105,238,135,220,159,204, 52,159, 41, +158, 89, 51,115,208,195,200, 67,224, 81,229,209, 63, 11,159,149, 48,107,223,172,126, 79, 67, 79,129,103,181,231, 35, 47, 99, 47, +145, 87,173,215,176,183,165,119,170,247, 97,239, 23, 62,246, 62,114,159,227, 62,227, 60, 55,222, 50,222, 89, 95,204, 55,192,183, +200,183,203, 79,195,111,158, 95,133,223, 67,127, 35,255,100,255,122,255,209, 0,167,128, 37, 1,103, 3,137,129, 65,129, 91, 2, +251,248,122,124, 33,191,142, 63, 58,219,101,246,178,217,237, 65,140,160,185, 65, 21, 65,143,130,173,130,229,193,173, 33,104,200, +236,144,173, 33,247,231,152,206,145,206,105, 14,133, 80,126,232,214,208, 7, 97,230, 97,139,195,126, 12, 39,133,135,133, 87,134, + 63,142,112,136, 88, 26,209, 49,151, 53,119,209,220, 67,115,223, 68,250, 68,150, 68,222,155,103, 49, 79, 57,175, 45, 74, 53, 42, + 62,170, 46,106, 60,218, 55,186, 52,186, 63,198, 46,102, 89,204,213, 88,157, 88, 73,108, 75, 28, 57, 46, 42,174, 54,110,108,190, +223,252,237,243,135,226,157,226, 11,227,123, 23,152, 47,200, 93,112,121,161,206,194,244,133,167, 22,169, 46, 18, 44, 58,150, 64, + 76,136, 78, 56,148,240, 65, 16, 42,168, 22,140, 37,242, 19,119, 37,142, 10,121,194, 29,194,103, 34, 47,209, 54,209,136,216, 67, + 92, 42, 30, 78,242, 72, 42, 77,122,146,236,145,188, 53,121, 36,197, 51,165, 44,229,185,132, 39,169,144,188, 76, 13, 76,221,155, + 58,158, 22,154,118, 32,109, 50, 61, 58,189, 49,131,146,145,144,113, 66,170, 33, 77,147,182,103,234,103,230,102,118,203,172,101, +133,178,254,197,110,139,183, 47, 30,149, 7,201,107,179,144,172, 5, 89, 45, 10,182, 66,166,232, 84, 90, 40,215, 42, 7,178,103, +101, 87,102,191,205,137,202, 57,150,171,158, 43,205,237,204,179,202,219,144, 55,156,239,159,255,237, 18,194, 18,225,146,182,165, +134, 75, 87, 45, 29, 88,230,189,172,106, 57,178, 60,113,121,219, 10,227, 21, 5, 43,134, 86, 6,172, 60,184,138,182, 42,109,213, + 79,171,237, 87,151,174,126,189, 38,122, 77,107,129, 94,193,202,130,193,181, 1,107,235, 11, 85, 10,229,133,125,235,220,215,237, + 93, 79, 88, 47, 89,223,181, 97,250,134,157, 27, 62, 21,137,138,174, 20,219, 23,151, 21,127,216, 40,220,120,229, 27,135,111,202, +191,153,220,148,180,169,171,196,185,100,207,102,210,102,233,230,222, 45,158, 91, 14,150,170,151,230,151, 14,110, 13,217,218,180, + 13,223, 86,180,237,245,246, 69,219, 47,151,205, 40,219,187,131,182, 67,185,163,191, 60,184,188,101,167,201,206,205, 59, 63, 84, +164, 84,244, 84,250, 84, 54,238,210,221,181, 97,215,248,110,209,238, 27,123,188,246, 52,236,213,219, 91,188,247,253, 62,201,190, +219, 85, 1, 85, 77,213,102,213,101,251, 73,251,179,247, 63,174,137,170,233,248,150,251,109, 93,173, 78,109,113,237,199, 3,210, + 3,253, 7, 35, 14,182,215,185,212,213, 29,210, 61, 84, 82,143,214, 43,235, 71, 14,199, 31,190,254,157,239,119, 45, 13, 54, 13, + 85,141,156,198,226, 35,112, 68,121,228,233,247, 9,223,247, 30, 13, 58,218,118,140,123,172,225, 7,211, 31,118, 29,103, 29, 47, +106, 66,154,242,154, 70,155, 83,154,251, 91, 98, 91,186, 79,204, 62,209,214,234,222,122,252, 71,219, 31, 15,156, 52, 60, 89,121, + 74,243, 84,201,105,218,233,130,211,147,103,242,207,140,157,149,157,125,126, 46,249,220, 96,219,162,182,123,231, 99,206,223,106, + 15,111,239,186, 16,116,225,210, 69,255,139,231, 59,188, 59,206, 92,242,184,116,242,178,219,229, 19, 87,184, 87,154,175, 58, 95, +109,234,116,234, 60,254,147,211, 79,199,187,156,187,154,174,185, 92,107,185,238,122,189,181,123,102,247,233, 27,158, 55,206,221, +244,189,121,241, 22,255,214,213,158, 57, 61,221,189,243,122,111,247,197,247,245,223, 22,221,126,114, 39,253,206,203,187,217,119, + 39,238,173,188, 79,188, 95,244, 64,237, 65,217, 67,221,135,213, 63, 91,254,220,216,239,220,127,106,192,119,160,243,209,220, 71, +247, 6,133,131,207,254,145,245,143, 15, 67, 5,143,153,143,203,134, 13,134,235,158, 56, 62, 57, 57,226, 63,114,253,233,252,167, + 67,207,100,207, 38,158, 23,254,162,254,203,174, 23, 22, 47,126,248,213,235,215,206,209,152,209,161,151,242,151,147,191,109,124, +165,253,234,192,235, 25,175,219,198,194,198, 30,190,201,120, 51, 49, 94,244, 86,251,237,193,119,220,119, 29,239,163,223, 15, 79, +228,124, 32,127, 40,255,104,249,177,245, 83,208,167,251,147, 25,147,147,255, 4, 3,152,243,252, 99, 51, 45,219, 0, 0, 0, 6, + 98, 75, 71, 68, 0,255, 0,255, 0,255,160,189,167,147, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 13,215, 0, 0, 13,215, 1, 66, + 40,155,120, 0, 0, 0, 7,116, 73, 77, 69, 7,217, 6, 17, 13, 13, 30,217,121,242, 96, 0, 0, 32, 0, 73, 68, 65, 84,120,218, +236, 93,119,120, 20,213,226, 61,119,202,246, 77, 39,141, 4, 66, 71,186, 16, 64, 9, 96,144, 14,242, 80,121,162,128,160,226,243, + 61,236, 15,177,128, 29, 20,136,250, 20,108,136,242, 84,120, 32,250, 19, 21, 36, 54,154,116, 8, 16, 68, 8,197, 8, 18, 8, 37, +132, 68, 82,183,239,206,253,253,145,157,113,179,217, 50,193, 4, 81,238,249,190,249,182,204,204,153,219,231,220,115,239,157, 1, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,174,100,116, 97,156,140,147,113, 50, 78,198,201, 56, 25, + 39,227,188,210,192, 93,196, 57,180, 17,194, 65,189, 91,230,159,128,179,177,226,222,144,220,153, 94,190,231,255, 36,225,204,188, +140, 57,105, 35,240,210, 70, 40, 83,180, 17,202,125, 99,115,162,145,226, 78, 27, 33,223,159,255,147,132, 51,243, 50,228,244, 47, + 63, 13,193, 27,168, 76,210, 6, 14, 39,109,132,112, 54, 22, 39, 26, 41,238,180,145,242,190, 33,239, 77,151, 45,132,203, 64, 96, + 0, 0,241,225, 39,151, 49, 39, 26,137,179,161,195,183,177, 17, 56, 73, 35,148,129,231,189,188,155, 26, 80, 16,201,113,111,136, + 60,162,141,192,219,152,226,170, 33,203,125, 99,115,162,145, 56, 73, 3,167,231,198, 70,224,108,168,186, 68, 27,161, 46, 53, 70, +153,247, 47, 63, 13,193,235,207,217, 16,117,201,159,179, 33,202,253,165,224, 68, 35,113,146, 70, 72,211,198,184, 55, 93,182,224, + 46, 50,177, 26, 3, 20,192,128,203, 92, 8, 53,150,200,108,104, 23,167, 49, 57, 27, 50,143,158,111,132,222,204,128, 6,204, 35, + 18, 32,188, 13,201, 73, 26, 41,156, 13,145, 79,164, 17,234, 18,105,132,186, 68, 26,161,220, 95, 42,206,134,204,163,134,170, 75, +164,145,234,146,127,124,159,111, 96, 78,210, 72,225,108,136,124, 10,196, 73, 26,129,179, 49,226,158,121, 25,243, 94,246, 16, 46, +147,112, 52,134, 16, 66, 3, 58, 25,141,233,226, 52,150,211, 70, 26, 41, 93, 55, 53, 32,215,198, 70, 8,231,166, 6,236,209, 6, + 18,132,207, 93,230,117,154,213, 37, 86,151, 46,183,186, 68,131,116, 86,158,187,204,202,121, 67, 58, 66,161, 56,126,111, 62,209, + 32, 29, 53,218,128,225,108, 72,215,154, 92,162,250,116,217,129,187,140,194,210,208,243,123, 40, 26,199, 21,107,172,120, 55,100, + 56, 7,252, 73,226,222, 24,225,124,190,145,226,254,103, 73, 83, 86,151, 88, 93,186, 28,235,146,111,153,108,168,176, 54,116, 57, + 15,196,217,144,243,144, 26,178,140, 54,118,220,233,101,158,247,127, 10, 92,140,131,213, 88,189,227, 63, 3,103, 99,112, 55, 70, + 56, 55,253, 73,210,180, 49,194,249, 60, 26,118,200,145, 52, 66, 88, 27,115,152,176, 49,202,102, 99,150,119,114,153,135,243,207, +146,239,141, 17,206,134,170, 75,164, 17,234, 61,105,132,246,169, 49,203,102, 99,114, 54, 4,119, 99,132,179,177,242,158,129,129, +129,129,129,129,129,129,225, 74, 69, 80, 37,217,189,123,247,108,189, 94,223, 38,216,126,139,197,114,246,199, 31,127,188,158, 37, + 33, 3, 3,131, 10,112,248,109, 74,130,132,198, 25,226, 96, 96, 96, 96,184,108, 16,116,136, 80,163,209,180,218,188,121,115, 59, + 73,146,224,118,187,225,241,120,224,241,120,224,118,187,225,112, 56,240,247,191,255,189,222,195,139,221,186,117,219,204,113, 92, +139,250,156,227,241,120, 78,238,223,191,191, 95,176,253, 9, 9, 9,219, 1,180, 34,228, 55,173, 72, 8,129,252,219,247,127,142, + 83,166,156,157, 57,117,234, 84,143, 80,156,132,144, 86,190,124,254, 92, 1,120, 67,114,182,111,223,126,143, 32, 8,169,129,206, + 15,198, 45, 73,210, 47,121,121,121, 25,172,152, 94, 26,116,235,214,109, 51,207,243,245, 46,159, 63,254,248, 99,208,242,217,185, +115,231, 31, 56,142,107, 26, 40,143,131,148, 39,222,227,241,252,228,229, 12, 40, 64,146,146,146,182, 83, 74, 91,169, 44,151, 50, + 78,157, 58,117,170,103,184,122, 20, 42,156, 1,184, 67,114,250,138,171,148,148,148,172,248,248,248,123, 45, 22,139, 13, 0,229, + 56,142,202,220, 50,175,199,227, 57,127,228,200, 17,246,240, 66, 6, 6,134,191,182,192,146, 36,137,179,219,237,200,207,207, 7, +165,117,219,121,142,227, 60,245,189, 24,165,180,221,250,229, 75, 19, 12,241,137,240, 56, 29,208, 53, 73, 80,184,203, 14, 29,128, +199,233,132,228,114,162, 73,207,107,229, 48, 96,192,128, 1,124, 24,218,212,169, 83,167, 38, 68, 68, 68,192,102,179,193,102,179, +193,110,183,195,110,183,195,225,112,192,225,112,192,233,116,194,233,116,194,229,114,193,110,183,227,192,129, 3, 33,195, 78, 8, + 73,125,232,161,135, 20, 78,187,221, 14,155,205,166,112,217,237,118,133,211,225,112,192,110,183,227,224,193,131, 33, 57, 5, 65, + 72,221,187,119,111,130, 70,163, 1,165, 20,146, 36,129, 82, 90,107,243, 75, 43,244,237,219,215,201,138,232, 37, 69,187,149, 47, +205, 78,208,197, 53,129,228,114, 33,238,234,116, 37, 47, 78,175,255, 22,146,203, 5,201,229, 66,218,223,198, 40,255,103,102,102, +134, 43,159,105,159, 61, 59, 35, 90, 19, 17, 1,183,205,134,150,163,110, 86,118,228,189, 51, 15,212,229, 2,117, 59,209,245,145, +167, 1, 0, 37, 37, 37,214, 14, 29, 58,156, 65,232,213, 91,169,199,143, 31, 79,144,195,224, 47,212, 57,142,171,181,109,221,186, + 21, 19, 39, 78, 12, 23,247,212,167,158,122, 42, 65,174, 35,190,101,221,229,114, 41,245,199,237,118,195,229,114,193,225,112,224, +135, 31,126, 80,229, 92, 37, 39, 39,191,212,191,127,255,201,203,150, 45, 51,125,241,197, 23,166,150, 45, 91, 66,163,209,128,231, +121,240, 60, 15,142,227,192,243, 60,110,188,241, 70, 54, 55,131,129,129,225,175, 47,176,156, 78,231,241,161, 67,135, 82, 0,112, + 56, 28, 41, 90,173, 86,227, 39,192,154,102,100,100,252,228,127, 94,184,161, 67, 67,124, 34, 62,104, 25, 11, 0, 24,123,172, 84, +185, 41,172,184,174,187,114,204,248, 19,229, 53,199, 26, 12,224, 56,142,132, 17, 67, 48,155,205, 24, 58,116, 40,180, 90, 45,210, +211,211,161,209,104, 32,138, 98,208, 77, 13, 76, 38, 19,102,206,156, 41,139, 35,152,244, 58,220,215,255, 90,232, 9,197, 7, 63, + 30,129,221, 35, 65, 16, 4, 8,130, 0, 81, 20,235, 56, 82,129,160,209,104,112,224,192, 1,240, 60, 15, 65, 16,106,125,242, 60, +143,213,171, 87,227,150, 91,110, 1,207,243, 48, 26,141, 0,155, 12,120,201,161,139,107,130,207, 50,107,140,200,219, 11, 43,149, +255,191, 29,247, 55,229,251,164,211,213, 32,132, 64,163,209,168,203,247,136, 8,124,125,203, 8, 0,192,152,252, 98,165,204,236, +159, 55, 27,162, 86, 11, 65,212,160,203,212,167, 80, 82, 82, 98, 29, 51,102,204, 86,189, 94,255,157,138,206, 10, 78,158, 60,169, +112,137,162, 88,167,220,115, 28,135, 15, 63,252, 16, 39, 78,156, 80, 21,119,171,213,138, 57,115,230, 40,113, 11,196,235,251, 93, + 69,220,185,164,164,164, 23,251,247,239, 63,113,217,178,101, 49,132, 16, 44, 88,176, 0,130, 32,224,134, 27,110, 64, 92, 92, 28, +214,172, 89, 3,141, 70,131,199, 30,123,140, 21, 62, 6, 6,134, 43, 67, 96,253,248,227,143, 35,228,239,215, 92,115,205,225,173, + 91,183, 94,229, 99,229,195,237,118,107,220,110,119, 59,121,216,208,237,118,195,110,183, 99,252,248,241, 33,123,244, 30,167,163, +142, 64, 10, 38,156,212,194,225,112, 96,236,216,177,138,136, 9, 37,174,212,220, 24, 8, 33,176,219,237, 16, 4, 1,173,155,199, +227,233,177, 61,209,151,167,176,150, 2, 40,169,198,157,201, 2,246,165,182,195,155, 39, 75,113,162,162, 10,130,160,110,180, 84, +146,164, 90,130,202,255,251,194,133, 11, 49,110,220, 56,240, 60, 95,103, 8,137,225,210, 64,114,185,194,150,195,250,230,141,219, +102, 3, 0,240, 62,130, 92, 20, 69,104,245,122,240,162, 8, 65,171, 65, 73, 73,137,117,200,144, 33, 59, 13, 6,195,146,164,164, +164,211,167, 78,157, 10, 89, 62, 41,165, 16, 69, 17,130, 32, 4, 45,243, 31,126,248, 33,150, 46, 93,138,222,189,123,171, 42,243, + 14,135, 3, 26,141, 6,179,103,207,174,179,255,157,119,222,169, 35,176,194,128, 0,224, 18, 19, 19,239, 91,190,124,121,164,124, +253,184,184, 56,136,162,136,206,157, 59, 35, 34, 34, 2, 91,183,110,133,199,227, 81, 45, 86, 25, 24, 24,174, 76, 80, 74, 69, 0, + 87, 3,136, 7,224, 1, 80, 9, 32,218,231,144,243,222,207,120,249, 55, 33,100,119, 0,158, 94,222, 99,206, 19, 66,118,251,252, +118, 0,208, 6,248,191, 20,128,193,187,217, 1,108, 7,208,217,231, 58,242,121,240,191,174,172, 12, 50, 81,243,160,186, 1, 8, +240,240, 59,121,184,240,200,145, 35, 1,135, 11,253, 2, 31,178,149,212, 53, 73, 80,156,171, 79, 91,199, 41,255,143, 43, 40, 83, + 26,216,175,123,183,133,206,108, 66,207,231, 95, 9,155,232,242,141,161,184,184,184, 78,207,251, 98, 5, 22, 0,184, 92, 46, 24, + 12, 58,124,255,238,117, 56,251,139, 27,179,179, 11,177,106,215,113, 8,130,128, 81, 87,181,197,223,221, 64, 86,172, 30,255,114, +123,224,148,168,170, 27, 24,165,180,142,184,242, 21, 89,132, 16,229, 63,118,179,249, 99, 16,119,117,186,226, 92, 45,107, 22, 81, +199,181, 2,128, 85,221, 91, 64, 31, 97, 70,231,135,167,171, 42,159, 45, 71,221,172, 56, 87, 95,165,183,130,160,209, 64,212,105, +241,247, 31, 11, 1,212, 12, 11, 14,236,218,113, 83, 25,175, 93,124,199, 29,119,252,178,126,253,122,163,154,176,106, 52,154, 90, +130, 45,144,184, 18, 4, 1, 46, 63,209, 24,170, 83, 17, 76, 56,201,245,170,158, 14, 22, 44, 22,139, 99,213,170, 85,120,243,205, + 55, 17, 23, 23,135,161, 67,135, 34, 41, 41, 9, 43, 86,172, 0,165, 20, 15, 60,240, 0, 12, 6, 3, 12, 6, 3, 43,243, 12, 12, + 12,161,180,200,117, 51,102,204,232,153,149,149, 53,167, 79,159, 62, 31,111,223,190,125, 57, 33, 36,219, 71,123,140,242,182,101, +217,242,111, 74,105, 47, 95,145,229, 21,105,241,132,144,108,249,120,223,223,242, 39,165,116, 48, 0,173,252,123,198,140, 25,157, +179,178,178,230, 76,159, 62,253,201,185,115,231,106,102,204,152,209, 53, 43, 43,107,142,124,157, 64,225,240, 21, 88, 33,159, 2, +236,116, 58,143, 15, 30, 60, 88,213,138, 31,171,213, 90, 20, 70,128, 5,116, 6,124, 93, 1, 93,132, 25,134,136, 8, 16, 78, 93, +131,235,114,185, 32, 8, 2, 56,142,195,218,181,107, 97, 48, 24, 48,114,228,200,139, 30, 34,148, 69,155, 86,171,129, 16,205,225, +142,215,246,224,252, 5,139, 50, 36,184,174,160, 16,187, 12, 6, 60,221,177, 43,204, 85, 5,168,176, 59,126,151,131, 53,110,220, + 56,216,108, 54,112, 28,167,252,199,113, 92, 88,177,202,208,120, 8,182, 8,129, 16, 2,125,100, 4,244,102, 51,120,129, 87,197, + 69, 41,253, 77, 8,105,181, 16,117, 90, 8, 26,141, 34,174,134, 12, 25,178,179,140,215, 46, 62,125,250,244, 78, 0,122,181, 2, + 75,118,176, 66,137, 43, 65, 16,224,116, 58, 85,137, 23,187,221, 14,141,230,183,153, 0, 39, 79,158, 12, 41,176,194, 69, 27,128, + 68, 8,145, 90,181,106,165,156,147,152,152,136,232,232,104, 72,146, 4, 73,146,160,215,235, 97, 48, 24,106, 93,151,129,129,225, +138, 69, 40, 45,162,203,202,202,154,227, 43, 96,252, 5,141,175,112,242, 19, 81,190, 34,173,115,152,182, 63,219, 95, 52,201,215, + 37,132,100,207,157, 59,119, 84,152,112,156,247, 23, 88,114,131, 24, 16,190,195,133, 13,117,243, 10,117, 3, 51, 68, 69, 66,107, + 50,193, 59,253,138,134,227,114, 58,157,202,156,147,123,239,189, 55,104,175,222,119,110, 74, 56, 56, 28, 14,240, 28, 15,232, 90, + 66, 66,142,114,179, 82, 54,141, 6, 5,205,187,129, 20,157,134, 32,168,155,239, 47, 59, 88,178,136,122,224,129, 7,176,104,209, + 34,101, 98, 50, 0,240, 60,143,246,237,219,227,216,177, 99,172,170,253, 1,160,148,134, 29,182,214, 71, 70, 64,103, 54,131, 87, +225, 52,202,251,149, 57, 76,122, 29,120,141, 6,130,166,102, 88,112,244,232,209,155,202,202,202, 22,119,234,212,233,103,212, 60, +198,128,168,173, 63,129,202,249,226,197,139,107,137,171,250, 56, 88,114, 61,242, 69,160,225,194, 49, 99,198,168,117,176, 40, 33, +132,138,162,136,193,131, 7,163,107,215,174, 88,181,106, 21, 36, 73,194,253,247,223, 15,131,193,128,249,243,231,195,237,118, 35, + 43, 43,139, 57, 88, 12, 12, 12,161,238,249,214,233,211,167, 63, 73, 8,201,246, 58, 73,121, 33,132, 84,160,182,189,151,159, 72, + 59, 31,228,184, 81,129, 68,150,239,119, 25, 51,102,204,232,236, 31, 14, 95,199,204, 87, 96, 53,214,251,219,106,161,236,208, 1, +101, 66,187, 60, 44, 72, 8,193,183, 25, 87, 65,107, 54, 65,111, 54,163,223,202, 45, 74,175, 25, 47,190,170,202,193,146,133, 83, +105,105,105,216, 33, 66,181,174, 24,175, 17,177,211, 44,130,138,124,173, 27,150, 40,138,224, 4, 17, 5,241,237, 64,132, 53, 16, + 60,110, 85, 55, 7,217,201,240, 93, 61,117,199, 29,119,128,227, 56, 69,100,117,239,222, 29,126,121,194,112, 9,113,102,195,119, +248,230,182,154,186,234, 59, 44,152,221,187, 13,116, 17,102,232, 76, 38,100,174,222,174, 12,231, 98,254,123, 97, 57,143,188,255, + 54,242, 94,159, 11, 65, 20,113,243,222, 2,197,185,234,123, 85,219,157, 14, 83,228,226,147, 39, 79,238, 4,192,221,118,219,109, +209, 61,122,244, 80,101,139, 17, 66,106, 77, 60, 23, 4, 33,160,184, 18, 4, 1,110,183, 91, 85,220,157, 78,167, 42, 39, 73,118, +177,212, 52,148,114, 58, 69, 69, 69, 33, 34, 34, 66, 89, 65, 43, 59, 87,242,252, 77,181,245,146,129,129,225, 47,143, 96, 90,196, + 62,119,238,220,188,185,115,231, 42, 78,146,191,131, 21,228,190,123,131, 87, 76,197,203,226, 12,128, 61,208,252,172, 64,174,152, +191,240,242,253, 47, 43, 43,107,142,127, 56,124,135, 37, 3,206,206,238,214,173,219, 55, 70,163,177,165,218,212,168,207, 67, 71, + 61, 78,103,157,158, 56, 33, 4,122,179, 25,218, 8, 51,116,102,115, 80,151, 43,216,141, 70, 30, 34,228,121, 94,185,233, 44, 89, +178, 4,102,179, 25,119,221,117,215, 69, 77,114,175, 17, 88, 60,190,212,228, 3, 26,161,206, 77,139, 23, 69,156,140,106, 6, 78, + 20, 33,120,212, 57, 4,229,229,229,224,121, 30,207, 61,247, 28,178,178,178,148,101,244,190, 75,235,125, 93, 15,134, 75, 15,223, + 73,238,181, 92,213,136, 8,165,124,250,254, 31,110, 78, 34, 33, 4,240,184,107, 86, 11,234,180,138,184, 26, 61,122,244, 38,135, + 41,114,241, 85, 87, 93, 37, 59, 87,156,209,104, 12,187,106,214,183,110,200, 66,199, 95, 92,201, 46,169,252,221,229,114,169, 42, +243,178,192, 90,180,104, 81,200,206,136,124, 93,181,229,148,227, 56,108,222,188, 25,123,247,238,197,189,247,222, 11,131,193,128, + 55,222,120, 3,110,183, 27,179,102,205,130,193, 96,128, 86,171,101,133,143,129,129, 33, 20, 98,100,129,227, 21, 73,181,156, 37, +239,220,169, 81,190,191, 3, 57, 92, 94,199,105,115,152,246,240, 43,175, 48, 11, 8,217, 73,243, 59, 39,219, 95,156, 9,126, 78, + 9, 1, 0,173, 86,219,114,219,182,109,237, 36, 73,130,199,227, 65,168, 79,135,195,129, 91,111,189, 85,245, 67, 71, 37, 87,141, +192,226,252, 86,202,233, 34, 35,160, 53,255,118, 3,243,185,137,133,109,197,101, 7,203, 87, 96, 61,247,220,115, 16, 4, 1,139, + 22, 45, 2, 0, 60,250,232,163,245,118,176,168, 4,108,247,108, 68,211, 5,221, 64, 23,235,113,110,243, 97,136,162,136,164,222, + 67, 32,245,252, 59, 74,181,145, 48,121,231, 85,169, 25,118, 44, 45, 45,197,137, 19, 39, 64, 8,193, 35,143, 60, 18, 82, 92,173, + 93,187,150,205,193,250, 3, 5, 22,199,243,181,242,195,183,124,250,137,175,240,227,100,110, 55, 68,157,174,214,106,193,178,178, +178,197, 39, 79,158,204, 1, 64, 38, 78,156, 24,109, 52, 26,241,254,251,239, 91, 0,104, 86,174, 92,105, 8,199,233, 59,143,207, +223,185,242, 23, 88, 30, 79,248, 33,108,185, 83,161,198,237,173,143,192,146,203, 55, 33, 4, 30,143, 71,113,174, 92, 46,151,242, + 91,167,211,177,130,199,192,192, 80, 71,139,248,225,188,223, 60, 39,226,231, 52,157, 15, 36,172,124,135, 3,229,239,132, 16, 87, + 0, 94,135,223,208,161,255,255,242,103,233,220,185,115,191,151,157, 43,159,255,107,133, 35,168,131,197,113, 28,236,118, 59, 14, + 29, 58,164,182,135,170,250,161,163,113,233,215, 96,252,137,114, 16, 66,176,166,127, 39,232,205,102,104,204, 38,100,124,182, 81, +105,176, 11,178, 30,131,198,100, 70, 92,191, 33,170, 26,112,143,199, 83, 71, 96,149,149,149, 65, 20, 69,188,248,226,139,224, 56, + 14, 47,189,244, 18, 82, 82, 82,112,246,236, 89,100,102,102,170,186,217,112, 18, 7,253,157,177,208,255, 43, 2,220,189,109,208, +249,111,255, 66,121,101, 11,236,119,152,208,161, 58, 31, 49, 27,158,135, 83,114,171,122, 76, 3, 33, 4,110,183, 27,223,127,255, + 61, 68, 81,132,219,237, 86,110, 62,148, 82,229, 41,249,242, 67, 29, 95,122,233, 37, 86,213,254, 0, 52,187,225, 38,220,113,198, + 2, 0,248, 38,227, 42,232, 76, 38,104, 35,204,232,247,197,102,165,124,254, 50,103, 26, 52, 38, 51,162,123,245, 87,197,217,241, +254, 71,209,225,190,105, 40, 41, 41,177, 14,238,222,121,115, 57,175,251,176, 75,151, 46,202,156, 43,163,209, 8,189, 94, 79, 80, +251,117, 50, 97, 69, 11,199,113, 97,197,149,252, 93,109,167,194,127, 21,110, 40,129,165, 22, 28,199,225,174,187,238, 66,114,114, + 50,222,124,243,205, 90,206,213,147, 79, 62, 9,151,203,133,249,243,231,179,194,199,192,192, 16,170,221,219,173,246, 88, 74,105, + 47, 31, 49,181,251, 98,120,235,115,189, 96, 8,216,242,218,237,246,130, 65,131, 6, 33,200,190, 20,157, 78, 87,171,117,149, 31, + 58, 26, 96,168,176, 11,128, 3,126, 17,255,109, 88,208, 59, 89, 88,235, 55,236,162, 53, 71, 64, 52,153,193, 5,110,196,235,112, + 6,114,176,228,161,147,242,242,114,136,162,136, 55,223,124, 19,145,145,145,176,219,237,129,122,222, 1, 57,121,158,135,229,132, + 5,199,159,217, 15,157,233, 40,218, 15,137, 64,132,120, 12,109,183,172,132,219,237, 0,124,134, 12,213,112,182,111,223, 30,207, + 61,247, 92,157,199, 51, 4, 67,122,122,122, 88,206, 6, 0,227, 12, 34, 98,116, 17,102,232, 35, 34,130,150, 79, 33,240,179,155, +106,113,202,251,101,231,170, 74, 99,252,240,228,241,227, 57, 0,184,137, 19, 39, 70, 25,141, 70, 44, 92,184,208, 2,128,123,225, +133, 23,140,105,105,105,188,154,112,114, 28,135, 37, 75,150,212,153,115, 21, 76, 96,169, 9,167,219,237,174, 35,176,198,142, 29, + 91,231, 65,163, 33, 28,172, 58,225,148,231, 96, 53,105,210, 4, 70,163, 81,121,237,150, 94,175,135, 94,175, 87,158, 14, 31, 98, +168,149,149, 79,198,201, 56,175, 28,206, 75, 46,198, 26, 19, 1, 5,214,190,125,251,134, 7, 59, 33, 35, 35, 35,127,219,182,109, +109,125,223, 77,232,118,187, 53,118,187,189,221,141, 55,222, 24,182,171, 44, 73, 18,116, 58, 29, 40,165,184,250,233,172,154, 46, + 60,247,219,144, 32,165, 20,209,125, 7,131,240, 60, 60, 30, 9, 46,151, 43,236, 42, 66,155,205, 86,107, 2,122,160,229,235, 85, + 85, 85, 33,159,243,227,207,105,181, 90,107,205,235, 34, 30,138, 95,214,173,168,187,154,208,123, 29,181,208,235,245,181,134, 77, + 84,218,165, 12,151, 8,242, 3, 60, 41,165,232,252,208,244, 26,167,136,231,106,237,143,234,213, 31, 68, 16, 33,213,204, 91, 10, +183, 48,132,156, 63,127,222, 58,122,244,232, 77,148,210, 15,110,188,241,198,159, 80,243,176, 58,106, 54,155,117,162, 40, 74, 0, +126, 5, 64, 47, 92,184, 16,117,250,244,105,201,102,179, 53, 15, 23,206,205,155, 55,227,232,209,163,232,209,163,135,226,124,202, +155, 60,124,127, 49, 14, 86,160, 39,194, 7,123,146,123,125, 28,172,168,168, 40,104,181, 90,188,248,226,139,208,104, 52, 48, 24, +106, 70, 65,231,207,159,175,164, 57, 3, 3, 3,195, 95, 9,245,126, 97,179, 36, 73,124,176,225,195,112, 67,133, 30,143,231,212, + 53,215, 92, 83,223,235,157, 11,115, 67, 60,181,101,203, 22,141,255, 11,105, 3,189, 0,215,231,191,176,156,187,119,239,214,132, + 56, 63,208,247,115,245,137,187,154,249, 43,110,183,251, 52, 43,162,151, 14,110,183,251, 84,239,222,189, 3,239,124,238,165, 96, +249,122, 46,140,104,249,185, 93,187,118,103,204,102,243, 87,137,137,137,165,219,182,109,139,235,213,171, 87,156,239, 49,189,122, +245, 74,246, 59,205,129, 16, 43,122, 9, 33,167,238,184,227, 14, 77,152,242,232,255,253, 84,152, 78,197,169,188,188, 60, 77,160, +242, 30,236,147, 82,122, 74, 69,178,158, 24, 49, 98, 4, 23,168, 14, 5, 72,203,243,172, 20, 50, 48, 48, 92,177, 2,203,102,179, + 21, 14, 26, 52, 40,224,186,111,139,197,114, 50,212,185, 7, 15, 30,236,217,208, 17, 56,125,250,116,198,159,129,179, 49,226,206, +112,249,231,209,193,131, 7,123, 3, 64,121,121, 57, 66,189,254,166, 62, 40, 44, 44,108,240,242,217, 24,156, 0,112,232,208,161, + 62,172,100, 49, 48, 48, 48,129,165, 2,106, 31,199,192,192,192,192,192,192,192,192,112,165,130, 99, 73,192,192,192,192,192,192, +192,192,208,176, 32,168, 89, 9, 16, 8,245, 89, 29,208,229, 34,174,125,128,113, 50, 78,198,201, 56, 25, 39,227,100,156, 87, 28, +103, 56,238,203,114,117,226,229,134, 46,140,147,113, 50, 78,198,201, 56, 25, 39,227,100,156, 87, 26,216, 16, 33, 3, 3, 3, 3, + 3, 3, 3, 67, 3, 67, 96, 73,240,135,129, 7,224,105, 40, 50, 74,105, 52,128, 96, 47,116,115, 16, 66,202, 46,146, 87, 11, 64, +244,110, 0,224, 2,224, 34,132, 56, 88, 22, 50, 48,252,181,144,158,158, 62,153, 82, 58, 27, 53,111,129,122, 49, 55, 55,247, 45, +150, 42, 12, 12, 13, 44,176, 90,183,110,189,135,227,184,212, 64, 47, 32, 14,246, 92, 28,143,199,115,234,200,145, 35,106,151,186, + 11,201,201,201, 99, 77, 38,211,245, 60,207,247,245,158,191,173,186,186,250,251,179,103,207,126, 10,192,125, 49, 17,106,217,178, +101,164,205,102,187,149, 16, 50,193, 43, 16, 62,210,235,245,255,119,252,248,241,138,139, 76,163, 54, 73, 73, 73, 31,137,162,200, + 23, 22, 22, 94, 15, 0,205,154, 53,251,222,225,112,120,138,139,139, 39, 0, 56, 90, 79, 62, 78,163,209,100, 93,115,205, 53,253, +182,108,217,242, 63, 0,239, 52, 80, 94,234, 56,142, 59, 17,104,135, 36, 73,105, 23, 33,172, 52, 0,162,230,207,159, 31,187,116, +233,210,238,103,207,158,237, 10, 0,201,201,201,251, 39, 78,156,248, 3,165,244, 87, 0,229,132, 16, 39,171, 70,127,110,180,109, +219,118, 15,199,113,169,245,121,150,156,247, 21, 85,167, 14, 29, 58,212, 51, 24, 39,207,243,169, 97,158, 71, 87,231,187, 36, 73, +191, 28, 60,120, 48,224, 35, 35,218,181,107,183,131,231,249,150,225,194, 22, 40,156,193, 30,193,209,174, 93,187, 61, 60,207,167, +214,151, 83,146,164, 95,242,242,242, 50, 26,146,243, 82,135, 19, 0, 50, 51, 51,117,213,213,213, 31,153,205,230,110,213,213,213, +147, 37, 73,122,118,227,198,141,137, 28,199, 97,240,224,193,207,166,167,167, 31,215,233,116, 11,108, 54,219, 15,102,179,121,252, +166, 77,155,236,172,198, 48, 48,252,254, 70,247, 92, 85, 85, 21,149, 33, 73, 18,117,185, 92,212,110,183, 83,171,213, 74,171,171, +171,105,101,101, 37,173,168,168,160,229,229,229,180,180,180,148,118,238,220,217,255,161,139, 1,199,104, 83, 82, 82,186,180,111, +223, 62,255,173,183,222,178, 23, 22, 22, 82,167,211, 73, 93, 46, 23, 45, 44, 44,164,111,191,253,182,189,125,251,246,249, 41, 41, + 41,193,198,119, 3,253,207, 37, 39, 39, 15, 73, 78, 78, 94, 62,108,216, 48,199,250,245,235,169,221,110,167, 22,139,133,174, 94, +189,154, 14, 24, 48,192,145,156,156,188, 60, 57, 57,121, 8, 2, 15,139, 6,187, 86,247,150, 45, 91, 30, 61,117,234,148,103,203, +150, 45,206,184,184,184, 47,227,226,226,190, 44, 44, 44,244,156, 60,121, 82, 74, 77, 77, 61, 10,160,123, 61,194, 9, 0, 55, 79, +155, 54,173,224,248,241,227,150,204,204,204, 29, 62,255, 19,132,127,114,123,151, 64,206, 21,165, 52,145, 82,154,132,154,135, 83, +214,217, 40,165, 73,222, 99,162, 85,114,154,142, 29, 59,150,154,152,152,152,229,117,170,106,241, 17, 66, 28,137,137,137, 89,199, +142, 29, 75,165,148,154,234, 17,247,223, 3,198,217, 72,156, 87, 93,117, 85, 81,117,117, 53,165,148, 82,143,199, 67,157, 78, 39, +181,217,108,212, 98,177,208,170,170,170, 90,245, 92,222,202,202,202,104,151, 46, 93,206,133,224, 60,103,177, 88,106,181, 29, 14, +135,131,218,108, 54,106,181, 90,169,197, 98,161,213,213,213,181,182,170,170, 42,218,189,123,247,194, 16,156,103,229,112, 74,146, + 68,221,110, 55,117, 58,157,212,225,112, 80,187,221, 78,109, 54, 91,173, 77,254,175,119,239,222, 65,195,217,161, 67,135,115, 86, +171, 85, 53,167,188,245,232,209,227, 76, 67,113,202,255, 93,125,245,213, 69,161, 56,109, 54,219,197,132,179, 48, 84, 89, 74, 79, + 79,255,252,248,241,227,212,106,181,210, 33, 67,134,216, 31,121,228, 17,234,241,120,104,118,118, 54, 29, 59,118, 44,189,231,158, +123,104,105,105, 41,157, 49, 99, 6,237,209,163,199, 23,172, 30, 49,206, 70,230,188, 50, 28, 44,142,227, 96, 50,153,240,241,199, + 31, 7,124,253,140,255,247,180, 52,117, 38, 73, 98, 98, 98,207,212,212,212, 77, 43, 87,174, 52, 36, 36, 36, 40,255, 59,157, 78, + 68, 70, 70,226,174,187,238,210, 14, 30, 60,184,237,237,183,223,190,211,237,118,103,158, 59,119,110, 79, 40,190,164,164,164, 49, +113,113,113,111, 77,157, 58, 53,113,244,232,209,136,137,137,169,181,127,212,168, 81, 24, 57,114,164,230,151, 95,126, 25,247,233, +167,159,142,251,223,255,254, 87, 84, 85, 85,245, 96, 81, 81,209,231,161,120,141, 70,227,224,182,109,219,190,191,126,253,250,212, +232,232,104, 52,109,218,148,123,230,153,103,186,180,110,221,218,144,156,156,204,157, 57,115, 6,159,127,254,121,235,137, 19, 39, +174, 58,121,242,228,100,187,221,190, 94, 69,244,181,177,177,177,143,253,235, 95,255,138,171,172,172,116,239,221,187, 87,118,191, +180, 58,157,238,217,107,175,189,182,199,198,141, 27, 63, 1,176,248, 98,156, 43, 74,105, 5,126, 27,202,147,225,146,247,171,113, +178, 40,165,218,189,123,247,198,244,237,219,247, 11,187,221,222,227, 31,255,248,199,233, 87, 94,121, 69, 27, 25, 25, 25, 9,128, +148,149,149, 93,152, 57,115,166,231,141, 55,222,120,162, 83,167, 78,131,182,109,219,118, 51,165,148, 13, 25,254,201, 97, 52, 26, +177,122,245,234,128,175,153, 10, 84,231,163,163,163,195,190,141,192, 96, 48, 96,237,218,181,202,121,190,175,150, 10,244, 61, 58, + 58, 26,148,210,144,164,122,189, 30, 91,183,110, 85, 94, 3, 20,172, 93,146, 63,141, 70, 35, 8, 33, 92, 56,206, 77,155, 54,133, +229,146, 63,205,102, 51, 80, 51,196, 31, 54,156,225,226, 44,127, 55,153, 76, 97,211, 83,167,211, 41,156,190, 28,193,126,155, 76, + 38,132,235,180, 25, 12,134,110,137,137,137,200,201,201,193,243,207, 63,175,237,220,185, 51,242,243,243,193,113, 28, 38, 79,158, +140, 78,157, 58,161,168,168, 8,157, 58,117,194,214,173, 91,187,179,154,194,192,208, 0, 2, 75, 70,176, 6,214,255, 59, 16,240, + 53, 24,181,150, 90,166,165,165,233, 68, 81,252,108,245,234,213,134,184,184,223,222, 22,226,112, 56, 80, 89, 89,137,170,170, 42, + 84, 86, 86,194,100, 50, 97,193,130, 5,134, 9, 19, 38,124,166,211,233,218,157, 56,113,194, 30,140,147, 16, 50,111,223,190,125, +137,110,183, 27, 90,173, 54,168, 88,108,211,166, 13, 30,124,240, 65,244,235,215, 47,105,220,184,113,243, 0,124, 30,140, 19, 0, +146,147,147,223,222,182,109, 91,170, 86,171, 69,126,126, 62, 78,157, 58,133, 41, 83,166,164, 73,146,132,194,194, 66,228,231,231, +227,204,153, 51,120,239,189,247, 82, 39, 76,152,176,224,244,233,211,109, 67,197,221,139,123, 30,121,228,145,182, 49, 49, 49,220, + 43,175,188, 82, 94, 85, 85,245,158,247,255, 25,243,231,207, 31,159,153,153, 25,255,143,127,252,131,110,219,182,237, 99,212,188, + 46, 37,104,122,250,206,185,242, 14,231, 1,128,135, 82,122,216,239,156, 14, 62,251, 65, 41, 77, 4, 96, 39,132,148, 7,224, 36, + 0, 34,135, 15, 31, 62,205,110,183,247,216,178,101,203,209,126,253,250,165, 1, 56, 75, 41, 61, 15, 0, 49, 49, 49,166,215, 95, +127, 61,113,212,168, 81, 63, 13, 30, 60,184,199,240,225,195,167,157, 63,127,126, 54,165,180,132, 16, 66, 67,196,253,247,130,113, + 54, 18,167,119, 40, 9,130, 32, 96,196,136, 17, 32,132, 4,124,223,230,142, 29, 59, 48,104,208, 32,136,162,136,187,239,190, 91, + 53,231,176, 97,195,224,118,187,235,240,249, 11, 16,249, 29,157,161,226, 78, 41,173,245,142,208, 64,226,194,119, 11,192, 87,135, + 83,146,164,128, 92,193, 68,150,252,178,122, 53,113, 87, 43, 46,195,133,211,151, 83, 20, 69,100,100,100, 96,239,222,189, 33,197, + 86,184,112, 2, 64,117,117,245,157, 55,222,120,227,154, 41, 83,166,232, 1,160,164,164,164,214,139,232,143, 28, 57, 2,187,221, +142,101,203,150,193,110,183,223,203,234, 17,227,108,100,206, 80,157,127, 17,192,213, 0,226, 81, 51,127,185, 18, 64,180,247, 94, +169, 5, 80, 10,192,224,221,236, 0,170, 0, 52,241,158, 94,226,237,108,248,190,166,236,188,239, 75,161, 41,165,189,188,220,242, + 43,187,226,125,142,149,175,225,255,219,255,179, 22,183, 92,171,229,225,159, 76,223, 10, 45,191,132, 53,156,184,146, 27, 71, 21, + 9,244,192,140, 25, 51, 18,125,197,149,221,110, 71, 69, 69, 5, 42, 43, 43,149,207,252,252,124,104,181, 90,140, 29, 59, 54,145, + 82,250, 64, 24, 90, 13,207,243,216,187,119, 47, 86,174, 92,137,227,199,143,215, 57,224,216,177, 99,120,253,245,215,241,234,171, +175,162,162,162, 2, 0, 52,193,200,186,117,235,246,252,248,241,227,119, 14, 24, 48, 64, 39, 8, 2,246,237,219,135,118,237,218, + 97,251,246,237, 56,121,242, 36, 46, 92,184,128, 35, 71,142,160, 75,151, 46, 56,122,244, 40, 42, 42, 42,208,185,115,103, 93,143, + 30, 61,182,164,165,165, 61, 31, 42,156, 41, 41, 41, 79,254,235, 95,255,210,157, 61,123, 86, 90,178,100,201, 54, 0,219, 1, 76, +121,234,169,167, 38, 13, 27, 54, 44,254,240,225,195, 21,187,119,239,222, 19, 68, 92, 5,114,174, 78,114, 28,119,130, 82, 90, 65, + 41,181,162,102, 2,122,173,155,145,219,237,182, 91,173,214,242,210,210,210, 18,142,227, 78,112, 28,151, 15, 64, 23,140,115,226, +196,137,173, 75, 74, 74,238,255,247,191,255,125,188, 95,191,126,105,148,210, 35,148,210, 82,111,129,181,187,221,238,210,178,178, +178,159,250,246,237,155, 60,126,252,248,163, 37, 37, 37,247, 79,156, 56,177,117, 8, 78,134,203, 31,212,227,241, 64, 20, 69,108, +220,184, 17, 91,183,110,197,214,173, 91,177,109,219, 54,108,223,190, 29, 59,118,236,192,142, 29, 59, 32, 8, 2,182,111,223,142, +237,219,183,227,193, 7, 31, 12, 91,231, 61, 30, 15, 4, 65,192,166, 77,155,176,107,215, 46,101,219,189,123, 55,118,237,218, 5, +131,193,160, 70, 12,249,118,166, 20,206, 64,219,219,111,191,173,136, 67,185,109,226, 56, 46,164, 43,230, 47, 92,252, 5, 75, 90, +139, 22,117,246,133, 11,167, 44,218, 4, 65,192,127,255,251, 95,156, 62,125, 26,111,190,249, 38,142, 29, 59,134,151, 95,126, 25, +121,121,121,152, 53,107, 22,118,239,222,141, 25, 51,102, 96,203,150, 45,242,203,223,105, 56, 78, 89, 92, 57,157, 78, 37, 60, 71, +142, 28,193,156, 57,115,176,111,223, 62, 60,251,236,179,216,177, 99, 7, 30,123,236, 49,240,124, 72,147, 13,233,233,233,147, 9, + 33,159,182,111,223, 94, 55,112,224, 64, 8,130,128, 57,115,230, 72,207, 62,251,108,241, 83, 79, 61, 85,156,157,157, 77, 91,183, +110, 13,135,195,129,136,136, 8, 80, 74, 23,167,167,167, 63,192,170, 11, 67, 99,182, 69,254, 90,196, 7,215,205,152, 49, 99, 32, + 33, 36, 59, 35, 35, 99, 34,128,104, 66, 72, 54, 0,173,247, 51,110,198,140, 25,189, 9, 33,217, 51,102,204,232, 9,160, 9, 33, + 36,219,251,251,122, 0,113,242,111,239,241,241,126,226, 45,222,231,255,120,191, 99,181,129,126,251,127,250,115,251, 58, 88,196, + 27, 49,226,219, 64,214, 71, 96,133,107,112,205,102,243,200,225,195,135,107,124,197,149,175,115, 37,127, 86, 86, 86,226,167,159, +126, 66,151, 46, 93, 52,102,179,121, 36,128,255,132,181,226, 4, 1, 77,155, 54, 69, 73, 73, 9, 14, 28, 56,128,180,180, 52,184, + 92, 46,124,247,221,119, 40, 43, 43,131, 70,163,129, 70,163,129,195, 17, 90,187,116,232,208, 97,196,210,165, 75,123,254,239,127, +255,187, 32, 8, 2,142, 28, 57,130,143, 62,250, 8,148, 82, 52,105,210, 4, 22,139, 5,197,197,197,152, 55,111, 30,156, 78, 39, +204,102, 51, 82, 82, 82,244, 15, 60,240, 64,191,153, 51,103,138, 39, 78,156, 8, 38,178,174, 25, 51,102, 76,100, 68, 68, 4, 30, +126,248, 97,201,233,116,190, 10,224,218, 49, 99,198, 60,249,224,131, 15,198, 22, 20, 20, 56,238,185,231,158, 61, 78,167,115,158, +108, 30,250, 11,166, 0,130, 53,168,115,229,118,187,229, 52, 61, 94, 89, 89,137,132,132,132,230,148, 82, 77,152, 60,210,108,223, +190, 61, 3, 0,255,194, 11, 47,232, 41,165,231,124,195,224,116, 58,101, 78,119,121,121,121,241, 99,143, 61,230, 94,190,124, 57, +239, 61,231, 16, 0, 27,107, 31,254,124,144,133,139, 40,138, 24, 49, 98, 68, 45, 65,177,121,243,102, 12, 31, 62, 92,169,239, 26, +141, 70, 57, 46, 28,167,175, 43, 38, 59, 79, 50,239,247,223,127, 95,199,121, 81,217, 73, 83, 28,150, 64,194,199, 95,116,201, 29, + 69, 53, 98, 40,144,200,146,219, 22,127,103, 72, 77, 56, 69, 81,196,131, 15, 62, 8, 65, 16,240,216, 99,143, 65, 20, 69, 92,125, +245,213, 16, 4, 1,125,250,244,129, 32, 8,184,254,250,235, 85,119, 80,229,112,238,216,177, 3,233,233,233, 74,120,174,190,250, +106,244,234,213, 11,130, 32,160,127,255,254, 16, 4, 1, 67,135, 14, 13,203, 73, 41,125,118,227,198,141,137,102,179, 25, 63,253, +244, 19,120,158, 7, 33,164,116,239,222,189,137, 0,112,195, 13, 55,148,216,108,182, 56,155,205,134, 65,131, 6, 33, 35, 35, 35, +126,249,242,229,207, 0, 96, 43, 11, 25, 26,181, 73,242,215, 34,178, 1,144,149,149, 53,135, 82, 58, 42,216,137,242,126, 66, 72, +246,220,185,115, 71,121,203,121,157,223,178,203,228, 39,222, 58,251, 58, 80,242,121,190,215, 11,117,109,191,227,207,251, 11, 44, + 10, 96, 64,160, 70, 55,144, 85,238,255, 93, 77, 3, 97,179,217,174,150,221, 43,155,205, 86, 75, 80, 85, 85, 85,213, 18, 90, 14, +135, 3,173, 90,181,130,205,102,187,186,190, 55,139,228,228,100, 56,157, 78, 44, 90,180, 72, 17, 86,190, 34, 33, 20, 14, 30, 60, +120,124,231,206,157, 61,210,211,211, 99,190,248,226,139,243,131, 7, 15,142, 31, 54,108, 24,244,122, 61,108, 54, 27,220,110, 55, +174,185,230, 26,116,232,208, 1,197,197,197,248,230,155,111, 74,218,181,107,215, 36, 39, 39, 71, 42, 42, 42, 58, 17,130,122,208, +160, 65,131, 64, 8,193, 55,223,124,243, 43,128, 92,189, 94,255,249,156, 57,115,162,237,118,187, 52,105,210,164,194, 95,127,253, +245, 49, 0, 46,173, 86,251,159,235,174,187,238,154,245,235,215,127, 34, 73, 82,189, 27, 51,187,221, 94, 43,109, 43, 43, 43, 97, + 52, 26,213, 60, 18, 66, 44, 43, 43,235, 10, 0, 70,163, 49, 22, 62, 43, 36,173, 86,171,146, 71,222,252,177,197,198,198,154, 0, +192,123,142,200,218,133, 63, 47,228,155,247,198,141, 27,107,213,111,217,129,242,175,243, 90,173, 22,171, 87,175, 86,197,233, 43, +166, 84, 12,231,133,116,155,100,129, 37, 8, 2,222,123,175,102,132,253,225,135, 31, 86,206,247,191,134,154,246, 66, 22, 67,130, + 32,160,195,115, 18, 0, 39, 78,189,166,135, 40,214, 20,105,255, 48,123, 27, 83, 85,174,216,155,111,190,137, 81,163, 70, 33, 59, + 59, 59,228,231,200,145, 35, 85,133, 83, 16, 4,232,116,186, 90,194,111,223,190,125, 1,121, 23, 46, 92, 24,118, 78,155, 36, 73, +248,234,171,175,192,113, 92, 45,199,235,233,167,159,254,151,201,100, 50,111,218,180, 9,231,206,157, 67,117,117, 53,170,170,170, + 16, 19, 19, 19, 61,104,208,160,125, 69, 69, 69, 5,135, 14, 29,186,153,213, 28,134, 70,114,177, 6, 4,248,223, 58,125,250,244, + 39, 9, 33,217,211,167, 79,127,114,238,220,185,121,222,186,145,237, 87, 87,178,195,212,165,108,175, 24,218,237,173,203,218,130, + 51, 63, 0, 0, 32, 0, 73, 68, 65, 84,189,252,196,219,121, 66,200,110, 74,233, 13,193,206, 5,224,240, 19, 84,181,134, 8,101, +238,144, 14,150,255,220,132, 80,223,189, 22,119,184, 6, 87, 32,132,212, 17, 0,129, 28, 44,151,203,133,210,210, 82, 72,146,212, +160,207,234, 10, 39,176, 14, 28, 56,112,215,228,201,147,207, 68, 69, 69,117, 43, 45, 45, 61,171,211,233,250,111,222,188,185,153, +203,229, 66,100,100, 36, 34, 35, 35,241,245,215, 95, 35, 42, 42, 10,255,254,247,191, 79, 90,173,214,237, 38,147, 41,209,106,181, +254, 88, 84, 84,244,116, 80,229, 34,138,131,250,247,239,143,220,220, 92,148,149,149,109, 0,208,109,194,132, 9, 67,155, 53,107, + 70,102,207,158,109, 59,122,244,232, 91, 0,206,155, 76,166,255, 46, 93,186, 52,179, 71,143, 30,230, 73,147, 38, 97,211,166, 77, +239,215,199, 25,178, 88, 44,181,132,149,156,166, 17, 17, 17,170,158,185,229, 77,111, 74, 8,161,114,207,223, 87, 88,249, 8, 96, +202,243,188, 4,128, 54,116, 30, 49, 92,122, 7, 75,174,235,127,251,219,223,234, 76,110,215,104, 52, 88,179,102, 13,110,186,233, + 38,165,195,146,158,158,174,218,109, 26, 61,122,180, 34, 8,214,172, 89, 19, 84, 96,133, 27,210,242,119,155, 30,122,232, 33,136, +162,136,183,222,122, 11, 83,167, 78, 5,207,243,120,237,181,215,192,113, 28,158,121,230,153,122,139, 75, 81, 20,113,252,165,154, +207,212, 71, 42, 80,250, 78, 34, 0, 32, 34, 50,178, 38, 62,146,164,254, 14,225,141,123, 56,231,202, 87, 88,133, 27, 34,244,117, + 1,243,243,243,149,239,125,250,244,169,229, 92, 9,130, 16, 86,176,121,175, 55,107,224,192,129,179, 83, 83, 83, 19,166, 76,153, + 66, 4, 65, 64,207,158, 61,155, 12, 30, 60,184, 92, 16, 4,253,163,143, 62, 26,104, 42,133, 8,160, 91,199,142, 29, 77,172,230, + 48, 92, 98, 7,203, 62,119,238,220,188,185,115,231, 6,116,168,252,157,164, 80, 78,147, 44,172,188, 66, 40, 94, 22,109,168,153, +159,188, 59,220,185,240, 14, 9, 6,114,185,124,225,239, 96,205,244,111,120,212, 8, 44, 53,243, 39,188,174,200,254,146,146,146, + 62, 58,157, 14, 21, 21, 21,117,110,218,190,162,128,231,121, 20, 23, 23,195,104, 52,238,111,200,156, 11, 55, 68, 8,192,246,243, +207, 63, 79,243,249,221,107,236,216,177,203, 63,249,228,147, 86,235,214,173, 67, 78, 78, 14,154, 52,105,130, 57,115,230,252, 82, + 80, 80, 48, 30,192,238,226,226,226,176,215,109,221,186,117, 39,179,217,140,109,219,182, 1,192, 22, 0,119,222,119,223,125,196, +233,116, 98,193,130, 5, 22, 0,235,162,162,162, 62, 95,177, 98, 69,183,110,221,186,233,214,173, 91, 87,153,147,147,179, 81,165, +184,242, 80, 74, 3, 10,171,202,202, 74, 84, 87, 87,195,108, 54,171, 17, 88,238,200,200,200, 3,149,149,149,183, 90,173,214, 10, +157, 78, 23, 81, 81, 81, 97,247,117, 24,171,170,170, 80, 93, 93, 13, 65, 16,196,252,252,252, 51, 0, 90, 71, 70, 70, 30,192, 69, + 62,183,140,225,143, 7,199,113, 84, 22, 25,235,214,173, 11, 88,215, 69, 81,196,119,223,125, 87,171,190,127,243,205, 55, 97, 69, +155, 32, 8,202, 74,194,112, 14,150, 79,227, 26,218,102, 21, 69,240, 60,143,119,222,121, 7,148, 82,197,185,226, 56, 14,211,167, + 79,135, 78,167,195,139, 47,190,136,233,211,167,171,114,177,124, 93,177,150, 79, 88,127,107, 28,189,231, 58, 29,142, 26,151,158, +227,124, 69,150, 42,167, 45,220, 4,247,250,136, 96, 95,167, 77,167,211, 5,157,220, 30,224,102, 21, 16,185,185,185, 31,116,239, +222,253,104,124,124,252,218,140,140, 12,221,158, 61,123,240,224,131, 15, 18,187,221, 30,185,110,221, 58,229,186,129,210,171,186, +186, 90,207,106, 14, 67, 35, 58, 88, 51, 3,252, 31, 35, 11, 39,175, 24, 82, 91,119,178,125,143,151, 57,252, 69,145,215, 17,219, + 28,142, 43,208,185,193, 32, 4,171,132,254,141, 68, 56,161,165,166,247,105,181, 90,215,111,220,184,177,215, 77, 55,221, 36,132, + 26, 30,172,170,170, 66, 98, 98, 34,142, 29, 59,230,182, 90,173, 97, 31,127,224,241,168,127, 32,122, 56, 7, 43, 0,118,151,148, +148,184,157, 78, 39,218,182,109,139,148,148, 20, 88,173, 86,188,254,250,235,110, 0,187, 85,114,104, 76, 38, 19, 15, 0,229,229, +229, 64,205,106,135,118,237,218,181, 67,110,110, 46, 46, 92,184,176, 10,192,160,153, 51,103,118,191,246,218,107, 53,159,124,242, +137,229,222,123,239, 93,229,114,185,102,171,236,129, 59,220,110,119, 75,142,227,156,101,101,101,167,125,133, 85, 98, 98, 98,140, +217,108,230,138,139,139, 93,106,146,167,107,215,174,187, 78,157, 58,133, 23, 94,120,225,252,156, 57,115,218, 85, 86, 86, 94, 40, + 47, 47,119,203,194,170,162,162, 2, 86,171,149,139,143,143,215, 45, 92,184,208, 8, 0, 93,187,118,221, 5,128, 61,112,244,207, +220,162,249, 45,104, 9,244,168, 6,181,147,209,253,133,203,141, 55,222, 88,199, 17,147,183, 21, 43, 86,212,154,215, 20,110,232, + 77,230,124,251,237,183,241,240,195, 15, 67,167,211, 97,254,252,249,181,230, 96, 5,233, 17, 7,229,148, 69, 91,203, 39,172, 40, +122, 35, 22,162, 40, 34,238,222,115,181,134, 8, 3,196, 77,149, 16,156, 51,103, 78,131, 12, 17,250,138, 62,249,145, 56,139, 22, + 45,194,216,177, 99,177,101,203,150,139, 30, 34,108,217,178,229,210,215, 95,127, 93,119,232,208, 33, 84, 84, 84,224,252,249,243, +176,217,108, 40, 44, 44, 84,242, 48,136, 83,110, 96,181,134,161,145,220,171, 96, 56,239, 55,127,138,248, 14,215,133,248,244, 63, + 30, 62,255,249,242,158, 39,132,184, 2, 92,239,124, 0, 81,229,127, 13,223, 99,206, 7,114,176, 2,221,184, 85, 63,166,193, 59, + 65, 50,156, 16,152,247,220,115,207,221,223,175, 95,191,216,200,200, 72,156, 57,115, 38,160,131, 21, 25, 25, 9,167,211,137,141, + 27, 55, 86, 72,146, 52, 47, 76,134,184, 92, 46, 23, 18, 18, 18, 80, 82, 82, 2, 41,136,141,207,113, 28, 12, 6, 3,170,170,170, +128, 48,147,199, 3,221, 40, 92, 46, 23,156, 78, 39,156, 78, 39, 92, 46, 87,125, 11,141,193,251, 76, 26, 84, 87, 87, 3, 64,117, +211,166, 77, 91,235,245,122,121,213, 99, 62,128,129,195,134, 13, 19, 75, 75, 75,233, 61,247,220,179,131, 82,250, 96, 24, 87,200, +177,113,227,198, 22, 0, 96, 48, 24,242, 1,160,176,176,208, 85, 86, 86,134,170,170, 42,197, 33, 52, 24, 12,184,249,230,155,147, + 40,165,216,184,113, 99, 11,141, 70, 67, 67,136, 33,123,118,118,246,193,168,168,168,229, 89, 89, 89,227,111,184,225,134,188,174, + 93,187,182,172,170,170, 42,182, 88, 44, 86,171,213, 74, 5, 65,208,196,197,197,233,214,174, 93,123,116,199,142, 29, 67, 34, 35, + 35,151,103,103,103, 31, 68,205, 42, 67,134, 63, 99,139,230, 55,183, 41,144,168,170,207, 10, 58, 95,225, 34, 8, 2,190,251,238, +187,144, 46,142, 90, 78, 95,145, 49,109,218, 52,188,241,198, 27,117, 28,172,217,179,107,250, 36, 79, 61,245, 84,189, 28, 34, 65, + 16, 80,244, 70, 44,146, 30,250,181,142,131, 69,188,225,171,207, 16,161,124,254,172, 89,179, 32,138,162, 50,132, 55,100,200,144, + 90, 67,131,106,133,149, 47,103,113,113, 49, 4, 65, 64,108,108, 44,198,143, 31,143,161, 67,135,214,225, 83,203, 91, 88, 88,248, +195,171,175,190,218, 60, 37, 37, 5,159,124,242,137,195,100, 50,105, 7, 14, 28, 72,203,203,203, 73, 40, 7,203,106,181, 50, 7, +139,225, 82,183, 83,187, 47, 37,111, 67, 92, 79, 8,215,232,254,206,199, 52,116,129,207,179, 50, 78,156, 56, 81,158,148,148, 52, + 97,220,184,113, 95,188,243,206, 59,134,214,173, 91,227,200,145, 35,184,112,225, 2,156, 78, 39, 52, 26, 13,154, 54,109,138,170, +170, 42,124,246,217,103, 22,139,197, 50,161,168,168,168, 60, 20, 39, 33,228,169, 17, 35, 70, 44,124,250,233,167,245,157, 58,117, +194,133, 11, 23, 80, 85, 85,165,244,188, 8, 33,136,140,140,132,209,104,196,129, 3, 7,176, 99,199, 14, 43, 33,228,169, 80,156, +129,132,166, 44,172,100,161, 21,110,101,146, 31,167,201,104, 52,202, 61, 63, 0,112, 55,111,222, 60, 17,128, 44,176, 78,180,106, +213,234,233, 54,109,218,144,165, 75,151, 82, 74,233,186, 32,226, 74,225, 36,132, 92,160,148,150, 1, 72,116, 56, 28, 26, 0,168, +168,168,112,198,197,197, 37,232,116, 58, 73,167,211, 73,122,189, 94, 58,123,246,172,219,237,118,107, 0, 32, 51, 51,211, 1,224, +156,223, 92, 15, 95, 78,137, 82, 90,185, 96,193,130,231,239,188,243,206, 62,125,251,246,237,124,207, 61,247, 28,186,247,222,123, +145,146,146, 18, 83, 85, 85,101,203,207,207, 47,123,231,157,119,108,187,118,237, 26, 34,138,226,137, 5, 11, 22, 60, 15,160,146, + 16, 34,169, 77,207,139, 4,227,108, 36, 78,185, 60, 4, 18, 86,190,191, 85, 8,161, 90,225,148, 69,219,173,183,222,170,172, 62, +244,119,174,234,203, 9, 64, 89, 65,248,248,227,143,215, 10,223,211, 79, 63,173,182, 87,236, 27,119,197,109, 18, 4, 1,229,139, + 82,106,137,191,122,136,170, 58,156,130, 32,224,217,103,159, 85,237, 96, 5,152,131, 21, 52,156,153,153,153,168,174,174,134, 40, +138, 88,179,102, 77, 80, 7, 43, 92,122, 26, 12,134,241,171, 86,173,250, 72,167,211,117,117, 56, 28,119,151,148,148, 44,177, 88, + 44,205,203,202,202, 66, 58, 88, 54,155, 77,199,234, 17,227,196, 37,126, 22,214,159, 13, 33,187,120,110,183, 27,205,154, 53,171, +245,110, 43,121, 50, 59,207,243,202,202, 19, 53, 43, 8,101, 20, 21, 21,173, 1, 48,230,230,155,111, 94,118,231,157,119, 70,116, +232,208, 65, 76, 75, 75,131,213,106, 69, 65, 65, 1, 10, 10, 10,220, 27, 54,108,168,176, 88, 44,183,123,143, 13,137, 51,103,206, +252,207,237,118,127, 55,113,226,196,103,187,119,239, 62,101,234,212,169,124,171, 86,173, 80, 94, 94,142,152,152, 24,196,199,199, +163,160,160, 0,159,125,246,153,167,172,172,108,161,199,227,153, 85, 92, 92,124,190, 62,137,228,118,187,121,151,203,133,113,227, +198, 65,146, 36,204,159, 63, 31,110,183,155,175, 7,133,211,233,116, 82, 0,164,164,164, 4, 0, 44,178,224,250,249,231,159, 1, +224,100,139, 22, 45,204, 0,176,126,253,122,130,154,231, 99,169, 81,222,148, 82,170, 56, 89, 29, 58,116, 40,240,111, 20,101,231, + 74,118,189,194, 77,164, 37,132,216, 40,165,231,237,118,251,176, 71, 30,121,228,217, 69,139, 22,141, 95,180,104, 81,157,227, 34, + 35, 35,151,191,246,218,107,179,198,143, 31,127,158, 16,194, 30,207,240, 87,104, 12,252,220,170,250, 78, 1, 8,198,249,229,151, + 95,214,231,225,154, 33, 93, 49, 66, 72,192, 21,137,161,218, 32, 21,157,161,160, 15, 20,253, 61,174,160, 32, 8,120,229,149, 87, + 20,231,202,119,242,249,197, 56, 88, 50,103,108,108,108, 77,175,205,100,130, 36, 73, 24, 57,114,228, 69,243,122,223, 45, 56, 70, +254,157,158,158, 62,235,227,143, 63,158, 77, 41,141, 3, 32,248,166,129,154,116,100, 96, 96, 80, 33,176, 60, 30,207,169, 1, 3, + 6,192,183,247, 20,238,101,173,110,183,251,148, 74,145,245, 93,203,150, 45, 91, 45, 90,180,232, 97,147,201, 52,216,102,179,117, + 5, 0,189, 94,191,191,186,186,122, 29,199,113,175, 23, 21, 21,169,126, 57,179, 87, 48, 61,192,113,220,252,137, 19, 39,206,206, +200,200,184,229,158,123,238, 33,130, 32,224,211, 79, 63,165,167, 79,159, 94,193,113,220, 83,103,207,158, 61,118, 49,137,100, 52, + 26,127, 90,177, 98, 69,235, 47,191,252, 18, 46,151, 11, 11, 23, 46,132, 78,167,251,169, 30, 20,231, 55,108,216,176,172,111,223, +190,227,119,236,216,177, 28,192,129, 45, 91,182,124,116,221,117,215, 77,216,190,125,251,255, 1, 56,180,113,227,198,143, 50, 50, + 50, 38,236,218,181,235,115, 0, 63,214,163,209, 85,156, 44,183, 59,240,136, 98, 16,231, 42, 20,103, 5,165,212, 57,121,242,228, + 71,110,185,229,150, 69,185,185,185,215,200,143,111,136,142,142,222,159,158,158,158,179, 98,197,138, 35, 94,231,138,137,171, 63, + 57,228, 9,233, 49, 49, 49,224, 56, 78,217,228,167,121,215, 87, 8,201,156,148, 82,196,196,196, 4,236,152,133,224, 12,169,106, + 40,165, 48,155,205, 10,167,202,213,203, 97,109, 40,179,217, 92, 43,140, 42, 64,195,197,221, 63,156,106,210, 44, 28,167,201,100, +130,211,233, 84,205, 9, 21,139, 6,124,145,155,155,251, 1,128, 15,218,180,105,243, 51,128, 54, 76, 84, 49, 48, 52,130,192, 58, +114,228, 72,207,198,188,240,241,227,199, 43, 0,204,242,110, 13,130,211,167, 79, 31, 3,112,235,214,173, 91,255,179,125,251,246, +103,188,141,235, 11,225,222,103, 24, 14, 63,254,248,227, 77,162, 40, 46, 88,188,120,113, 6,165, 20, 81, 81, 81,219,143, 30, 61, +122, 95,125, 56, 60, 30,207,148, 29, 59,118, 76,133,119, 85,160,195,225,152,178,117,235,214, 71, 1, 84,203,251,119,238,220,169, +252,174,231,205,140, 82, 74, 29,148,210,228, 32,135, 56,212,138, 43, 63, 39,203,177, 98,197,138, 42, 0,251,240,219,115,174, 92, +222,205,238, 55, 44,200,240, 39,133,219,237, 62, 61, 96,192, 0, 33, 92, 7, 42,192,121,167, 66,117,208,250,247,239,143,139,224, + 60, 29, 34,168, 39, 50, 50, 50, 56,181, 92, 50, 92, 46, 87,113, 8,241,117,170, 79,159, 62, 1,195, 25, 38,205, 66,198,189, 79, +159, 62,245, 10,163, 55, 44,167, 27,154, 51, 76,122, 6,133,213,106,189, 16, 31, 31, 95,101,179,217, 68,187,221, 46,250, 59,246, + 6,131,225,188,213,106,101,149,135,129,225, 15, 4,123,211, 56,227,100,156,140,147,113, 50, 78,198,201, 56,175, 56,112, 44, 9, + 24, 24, 24, 24, 24, 24, 24, 24, 26, 22, 36,132, 10,173,207,234,128,139, 81,178, 7, 24, 39,227,100,156,140,147,113, 50, 78,198, +121,197,113,134,227,102,171, 19, 27, 73,120, 49, 78,198,201, 56, 25, 39,227,100,156,140,243,202,227,252, 75,129, 13, 17, 50, 48, + 48, 48, 48, 48, 48, 48, 48,129,197,192,192,192,192,192,192,192,192, 4, 22, 3, 3, 3, 3, 3, 3, 3, 3, 19, 88, 12, 12, 12, + 12, 12, 12, 12, 12,191, 3, 36, 37, 37, 37, 51, 57, 57,185,207,149,154, 0, 2, 43, 3, 12, 12, 12, 12, 12, 12, 12, 13,129,102, +205,154, 69,123, 60,158, 59, 1,220,215,186,117,235,214, 0, 64, 8, 57, 64, 41,125,221, 96, 48,124,116,236,216, 49,199, 21,163, + 48, 89,113, 96, 96, 96, 96, 96, 96, 96,248, 61, 72, 78, 78,238, 14,224, 62,131,193,112,251, 53,215, 92,163, 29, 56,112, 32, 98, + 98, 98,224,118,187,113,246,236, 89,108,216,176, 1,251,246,237,251,213,229,114, 45,112,185, 92, 11, 74, 74, 74,206, 93, 73, 2, +107,147,247, 51,147, 21, 21, 6, 6, 6, 6, 6, 6, 6, 53, 72, 74, 74,122,117,248,240,225,143,196,196,196,160,109,219,182, 72, + 74, 74,130,221,110,135,213,106, 5,165, 20,130, 32,128, 82,138,202,202, 74,236,217,179, 7, 57, 57, 57,238,138,138,138,229,132, +144,215,207,158, 61,251,131, 31,221, 95, 70,139,200, 2,139, 2, 24,224, 23, 57, 6, 6, 6, 6, 6, 6, 6,134,144, 72, 78, 78, + 62,183,126,253,250, 4,143,199,131,146,146, 18,216,237,118, 88, 44, 22, 69, 96,241, 60, 15, 74, 41,220,110, 55, 0, 64,146, 36, + 28, 58,116, 8, 59,118,236, 64, 97, 97,225,107, 69, 69, 69,211,254,138, 90,132,243, 83,141, 76, 92, 49, 48, 48, 48, 48, 48, 48, +212, 11,118,187, 29, 75,151, 46, 69, 73, 73, 9,154, 53,107,134,148,148, 20, 68, 69, 69, 65,175,215, 3,128, 34,174, 0,128,227, + 56,116,238,220, 25, 19, 38, 76, 0, 33,100,130, 31,213, 95, 70,139,176, 73,238, 12, 12, 12, 12, 12, 12, 12,191, 7, 46,167,211, +137,158, 61,123,226,248,241,227,200,205,205, 69,143, 30, 61,208,177, 99, 71,148,148,148,224,204,153, 51,181, 14,222,181,107, 23, +246,238,221,139,235,174,187,238, 47,157, 40,188,247,147, 0,120, 30,192,157, 0, 22,179,178,194,192,192,192,192,192,192,160, 6, + 17, 17, 17,191,110,218,180,105,104, 90, 90,154,152,158,158, 14,157, 78,135,147, 39, 79, 34, 39, 39, 7,102,179, 25, 93,187,118, +133,205,102,195,230,205,155,177,122,245,106,148,149,149,161, 69,139, 22,192,187,239,225,231,215,204,229, 85, 85, 85,243,254,138, + 90,196,119,146,123,166,247,115, 19, 43, 46, 12, 12, 12, 12, 12, 12, 12,106,145,156,156, 28, 71, 8,121,170,105,211,166,247,223, +126,251,237, 98,155, 54,109,112,234,212, 41,148,148,148,224,194,133, 11,216,185,115, 39, 0, 32, 37, 37, 5, 41, 41, 41, 40, 40, + 40,192,129, 3, 7,172,118,187,253,222, 51,103,206,252,239,175,168, 69,216, 99, 26, 24, 24, 24, 24, 24, 24, 24, 26, 74,104, 53, + 3, 48,179, 77,155, 54,147,198,142, 29,203, 53,109,218, 20,167, 79,159,198,134, 13, 27,208,186,117,107, 20, 23, 23, 99,207,158, + 61,158,138,138,138,133, 30,143,103, 86,113,113,241,121,150,106, 23, 7,246,166,113,198,201, 56, 25, 39,227,100,156,140,243, 10, +227, 76, 76, 76,236,144,156,156,188,114,232,208,161,244,157,119,222,161, 15, 60,240, 0,237,209,163,135,148,156,156,252,105, 74, + 74, 74,235, 43, 65, 0,177, 73,238, 12, 12, 12, 12, 12, 12, 12, 13,138,115,231,206, 29, 6,112, 19, 33,228,154,188,188,188, 39, + 1, 64,146,164, 23,206,157, 59,183,231, 74, 73, 3, 38,176, 24, 24, 24, 24, 24, 24, 24, 26, 5,103,206,156,201, 1,240,183, 43, + 49,238,236,101,207, 12, 12, 12, 12, 12, 12, 12, 12, 76, 96, 49, 48, 48, 48, 48, 48, 48, 48, 48,129,197,192,192,192,192,192,192, +192,112, 69,129, 32,248, 74,128, 3,245,224,185,152, 21, 10, 7, 24, 39,227,100,156,140,147,113, 50, 78,198,121,197,113,134,227, + 62,128, 43, 8, 23,251,188, 44,182,132,149,113, 50, 78,198,201, 56,255, 60,156,164,129, 56,137,119,227,188, 27,169, 39,247,165, + 10,231,159, 37,238, 87, 10,231, 95, 10,225, 86, 17,250, 38,146,228,221,104, 3, 9, 54,174, 1,249, 24, 26, 71, 84,203, 21,131, +178,124, 98, 96,248, 75,163, 33,219,122,185,237,224,125, 56, 61,222, 13,191,179, 45,105,140,123,210,229, 30,247, 43,153,243, 47, + 41,176, 8, 0, 18, 31, 31,191, 38, 33, 33,225,250,146,146, 18, 9, 0, 8, 33,224, 56, 14, 28,199, 65, 16, 4,107, 65, 65, 65, +100,125, 47,152,144,144,240,126,124,124,252,157,165,165,165,146,204, 69, 8, 1,207,243,224,121,222,122,236,216,177,200, 63, 58, + 81,122,244,232,113,193,225,112,152,253,255,215,106,181,182,189,123,247, 70, 92, 9,229,162, 93,187,118,183, 25,141, 70, 67,144, +253,244,135, 31,126, 88,164,150,172, 69,139, 22,187, 12, 6, 67,180, 32, 8,224,121, 30,130, 32,160,186,186,186,236,240,225,195, +189,189,251,183, 25, 12,134, 56,158,231,229,178, 5,155,205, 86,122,232,208,161,190,236,190, 87, 23,153,153,153, 2,234,255,136, + 21,247,166, 77,155,220,151, 42,140,148, 82,206,145, 27,209,134,184,173,221, 8, 71,163,168, 68,202,169, 96,248, 81,155, 94,121, + 84, 85, 75, 77,136,244, 7, 39,115,115, 0,110, 0,103,234, 29,247, 0, 61,118, 1, 24,238, 1,198,121,127,218, 56,160,148, 0, +249,113,192,103,231, 0,171, 95,227,123, 41,111, 68, 4, 0, 73, 77, 77,125, 61, 49, 49,241,174,202,202, 74, 11,207,243, 32,132, + 80, 66,136,156, 23,190,249, 2, 73,146, 78, 29, 60,120,176,103,152,155,172,216,188,121,243,215,226,227,227,239,176, 88, 44, 22, + 66,136,194, 41,111,190,220, 30,143,231, 84, 94, 94, 94,207, 75, 24,206, 63, 36,238,190, 92,242,111, 73,146, 66,197, 93,225, 76, + 77, 77,125, 45, 49, 49,241,142,170,170, 42,139,247,190,249,187,195,121,153,115,254,101, 5, 22,151,144,144,176,170,119,239,222, + 3,190,252,242, 75,238,240,225,195, 92,135, 14, 29,224,241,120, 32, 73, 18, 40,165, 72, 79, 79, 55,214,247, 98,137,137,137, 75, +122,246,236, 57,110,245,234,213,220,170, 85,171,184, 94,189,122,129, 16, 2,143,199, 3,143,199,131, 65,131, 6, 25,126,103,124, +204,130, 32, 76,213,106,181,153,110,183,187, 35, 0,136,162,120,200,110,183,111,114,187,221,243, 0, 84,169, 33,113,185, 92,198, +188,188,188, 58,105,211,187,119,111,237,197, 6,172,109,219,182,219, 57,142,107,229, 91,200,194,125, 82, 74,127, 57,120,240, 96, + 70, 48,206,246,237,219,135,229,244,255, 79,146,164, 95,242,242,242, 50, 66,149,137,182,109,219,142,235,212,169,147,254,211, 79, + 63, 69, 97, 97, 33, 76, 38, 19, 36, 73,130,199,227,129,203,229,194, 77, 55,221, 84, 47,203,215, 96, 48, 68,110,216,176,161, 77, + 66, 66, 2,138,139,139, 81, 82, 82,130, 41, 83,166,228,251,236,143,251,254,251,239,219,197,198,198,194, 98,177,160,188,188, 28, + 19, 38, 76,248,211, 87,174, 33,253, 91,189, 72,128, 88,249,183, 71,194,175,235,183,253,242,244,239,229,181,219,237,103, 61, 30, + 79,140,159, 32, 9,121, 14,207,243, 23, 0,196,135,211,194, 0,254,198,243,124, 91, 81, 20,175,162,148,182,112,187,221,137, 0, +160,209,104,206,241, 60, 95,224,114,185,142, 56, 28,142,159, 1,172, 6, 80, 16,140,200,145, 27,209,198, 99,183,220, 82,109,151, + 70, 74, 20, 73, 28, 65,145, 73,103,249,218,145, 27,177, 66,173,200,250, 3,209,178,105,211,166,175, 0,192,153, 51,103, 30, 3, +112,252,247, 18,122,128,113,148,210, 40, 0, 40, 47, 47,143, 42, 44, 44, 76, 90,189,122,117,231, 57,115,230, 12,212,218,108, 47, + 59,128, 67,161,206, 31,124, 93,235, 61, 2, 33,169,138, 90,166,210,169,117,155,127,105,136, 27, 19,151,146,146,242,250,136, 17, + 35, 38, 46, 92,184,208,152,147,147, 99,236,218,181,171,183,227, 11,165,189,167,148, 42,101,236,218,107,251,132, 19,108, 66,211, +166, 77,231,143, 24, 49, 98,252,130, 5, 11,140, 71,142, 28, 49,182,108,217, 82,225,244, 45,179,114, 7,251,234,171,187, 95,234, +112, 54,106,220,135, 13, 27, 54,126,225,194,133,198,253,251,247, 27,219,181,107,167,112, 82, 90, 91, 59,115, 28,135,158, 61,123, +169,226, 28, 62,124,248,248,119,223,125,215,152,155,155,107,236,216,177,163, 87,164, 65, 9,227,197,132,243, 50,231,252, 75, 10, + 44, 46, 62, 62,126,105,207,158, 61,135,125,249,229,151, 60, 0,228,230,230,162,180,180, 20, 41, 41, 41, 48,155,205,208,235,245, +176,217,108,245,234,101, 37, 36, 36,188,223,171, 87,175,113, 95,126,249,165, 8, 0,159,223,126, 19,126, 17,129, 7,139, 29,208, +104, 52, 56,122,244, 40,120,158,255, 61, 61,183,235, 34, 34, 34,254,183,114,229,202,152, 30, 61,122,112, 37, 37, 37,104,217,178, + 37,126,253,245,215,222,155, 55,111, 78,191,251,238,187,239,174,172,172,156, 4, 96,179, 90,194,175,190,250, 10, 38,147, 73,217, +156, 78,231, 69,143, 37,243, 60,159,154,147,147,147, 96, 54,155,225,241,120, 64, 41,173, 85,129,253, 43,158, 36, 73,232,223,191, +191, 51,100,230, 9, 66,106, 78, 78, 78,130,193, 96,168,195,229,241,120,160,213,106,193,113,156,220, 67,132,219,237, 70, 70, 70, + 70, 40, 78,210,174, 93,187,219,100,113,197,113, 28, 62,249,228, 19, 36, 37, 37, 33, 33, 33, 1, 38,147, 9, 6, 67,253, 53,176, + 32, 8,136,139,139,195,253,247,223,143,219,110,187, 13,203,150, 45,131, 40,138,181,246,199,198,198,226,219,111,191, 69,100,100, + 36,210,210,210,106,237,255,179,130, 0,177,223,109,254,205,145,189,101,212,213,194,160,126, 45, 23, 40, 21,173,230, 32, 42,121, + 93, 11,201,227,185,176, 97,251,201,103, 85,116, 0,154,108,219,182, 13, 58,157, 78,221,205,221,227, 65,239,222,189,155,132, 57, +108,100,151, 46, 93, 62,191,255,254,251, 53,109,218,180, 33,162, 40, 66, 16, 4, 8,130, 32,151,199, 52, 74,105,154, 36, 73, 3, +206,157, 59, 71,223,124,243,205,151, 55,110,220,120, 51,128,175, 3,198,221,109,237, 86,109,151, 70, 82,138,164,196,193,180,121, +241, 58,130,106,187, 52, 50, 74,176, 30, 5,112, 57, 11,172, 72,131,193,240,204,167,159,126,170, 1,128,193,131, 7, 63, 99,181, + 90,255, 13,160,162,161, 46, 16, 21, 21,133,168,168, 40,116,233,210, 5, 99,198,140,137,238,222,189,251,163, 45,236,246, 41, 5, +128, 35,104, 29,226,184,212,111,190,207, 79,144,127,143,191,169,135,102,104,102,235,115,212,107,153,249,123,104,146,135,158, 90, +191,237,120, 56, 1,198, 37, 37, 37,253,103,248,240,225,183, 46, 92,184, 48, 2, 0,222,127,255,125,140, 28, 57, 18, 73, 73, 73, + 48, 24, 12,208,104, 52,208,104, 52, 16, 69, 81,249, 12,115,147,229,147,146,146, 94,190,225,134, 27,110, 89,176, 96, 65, 4, 0, + 44, 89,178, 4,163, 70,141, 66, 92, 92, 28, 34, 35, 35,161,211,233,160,213,106,189, 92, 4, 52,124,171, 95, 39,156,247, 12, 29, +136, 86, 6, 29,254, 54,251, 21, 68, 71, 71, 99,195,180,251, 32,114, 28,238,251,118, 19, 34, 35, 35,213,180, 31,117, 56,115,115, +115,113,238,220,185,128,113,231,121, 62, 92,125, 83,226, 62,114,228,200, 91,100,206, 37, 75,150, 96,216,176, 97,136,139,139,131, +217,108, 86,226,254, 27, 55,167,138,115,216,176, 97,183,188,251,238,187, 10,231,160, 65,131, 16, 27, 27,139,136,136, 8,104, 52, + 26, 37, 61,235,147, 71,151, 57,231, 95, 82, 96, 17,175,123,117,107,118,118,182,146,243,162, 40, 66,167,211, 41,133,195,247,198, +173,246, 94, 19, 31, 31,127,231,151, 95,126,169,156,228,240,171, 84,122,189,190,190,156,181, 58,120,215, 95,127,253,199,217,217, +217,122,141, 70, 3,171,213,138,188,188, 60, 68, 69, 69, 65,171,213,226,198, 27,111,228, 51, 50, 50,226,174,191,254,250,207,126, +250,233,167,241, 0,214,169, 24,226,128,217,108,174, 37,176, 40,189,120,253, 71, 8,129,193, 96,192,170, 85,171, 32, 8, 66,173, + 66, 22,168, 17, 75, 76, 76, 12,235, 74, 0,128, 78,167,195,246,237,219,193,113, 28, 68, 81, 84,182,175,190,250, 10,211,166, 77, +195,185,115,231,148,125, 17, 17, 97, 71, 55,137,209,104, 52,200,226, 74,206,123,131,193, 0, 81, 20,137, 32, 8,132,231,121,185, + 73, 39, 80, 57,148, 33, 8, 2, 10, 10, 10,112,251,237,183, 99,241,226,197,120,225,133, 23, 48,126,252,248, 90,251, 43, 42, 42, + 16, 19, 19,131,232,232,104,232,116,186,223, 83, 22, 46, 27, 72,126,169, 51,235,133,151,141, 18, 0,137, 74,128, 4, 80, 80,229, +251,217,179, 71,241,234,127,222,224,213,114,235,116, 58,108,219,182, 13,190,195,174, 28,199, 65,163,209,212,250, 79, 16, 4, 36, + 39, 39,171,225,155,185,114,229, 74,237, 39,159,124,130, 47,190,248, 2, 30,143, 7,162, 40, 66,175,215, 35, 50, 50, 18,177,177, +177,202,150,150,150, 70, 62,248,224, 3, 77,183,110,221,102, 86, 84, 84, 4, 22, 88, 28,141,146,188,226, 10, 0, 18, 6,211,230, +199,190,228, 99,162, 35,106, 92,156,203,184, 61,156,241,214, 91,111,197,165,167,167, 3, 0,222,122,235,173,184,201,147, 39,207, + 0,240, 52,106,134, 12, 47,174,131, 5,124, 76, 8, 25,231,117,108,245, 67,134, 12,209,190,253,246,219,184,234,170,171,240,208, + 67, 15,197,190,250,242,203,127, 3,176, 34,120, 89,170, 93,152,230,190,242, 70,180,111,135,234,183, 13,248,245,124, 1,158,121, +230, 69, 21,250, 31, 92,211,166, 77,239,126,239,189,247,148,233, 16,177,177,177, 74, 27,228,223, 70,201,159, 33,218, 37,226,117, +133, 38, 47, 92,184, 80,225,140,143,143,175,197, 33,138, 34, 10, 14,253,128,111,222,207,130, 41, 46, 25, 19,166,205,173,119, 56, + 83,116, 90,164, 26,180,232,214,173, 27, 12, 6, 3,114,197,154, 91,153, 44,174,212,132,211,159,147,231,121, 37,140,148, 82,216, +108, 54, 84, 86, 86,194,227,241,192,225,112, 32, 61, 61, 93, 85,220,223,125,247, 93,133,179, 73,147, 38, 74,251,238,219,206,203, +155,220,129, 9, 19,206,201,255,253,239,127, 21,206,184,184, 56,133, 75, 16, 4,104, 52, 26, 44, 89,178, 4, 42, 29,109,213,156, +245,205,119,127,206,227,199,143, 99,206,156, 57,208,104, 52,242, 20, 32,197,177, 76, 73, 73,193,155,111,190,169,234, 30,247, 87, +115,176, 72, 73, 73,137,116,248,240, 97,110,207,158, 61,208,104, 52,136,143,143, 71,239,222,189, 1, 0, 78,167, 19,130, 32,192, + 96, 48,144,182,109,219,158,147, 19, 77,254,244, 27, 75,151,151, 90,114,191,254,250,171,180,102,205, 26,110,217,152, 97,112, 80, +160,251, 51,115, 49,108,212, 40,124,151,162, 5, 15,160,247,225, 18,104,181, 90, 33, 41, 41,201, 37,103,130,204,235, 55, 55,203, +127,249,102,132,201,100,250, 96,245,234,213,122,142,227, 80, 89, 89, 9, 73,146,208,183,111, 95, 16, 66,176,127,255,126, 60,253, +244,211,248,252,243,207,177,114,229, 74, 67,143, 30, 61, 62,176, 90,173, 29, 1, 84,250,112, 28, 8, 84, 56, 35, 35, 35, 97, 48, + 24, 20,129,101, 48, 24, 72,251,246,237,207, 5,153, 71,112,250,224,193,131,233,193, 56,101, 39,225,230,155,111, 86,230,156,201, + 55, 64,223,202, 38,127,207,203,203, 11,148, 95,117, 56, 37, 73, 66,191,126,253, 0, 0, 38,147, 9,102,179, 25,223,127,255,189, +178,191, 71,143, 30,112, 56, 28,104,210,164, 9, 14, 29, 58,164,138,179,168,168, 8, 75,151, 46,133, 40,138,136,139,139,131, 40, +138,154,117,235,214,189, 96, 50,153,162,120,158, 71,116,116, 52, 70,141, 26,181,208, 39, 12,158,175,191,254, 90, 8,198,201,243, + 60,244,122, 61,150, 44, 89,130, 57,115,230,224,201, 39,159,244,119,247, 96,179,217, 16, 23, 23,135,152,152, 24,196,196,196,168, + 10,103, 3,160, 81, 57, 41, 40,242,246,126,135,131,251,214,193, 67, 61,144, 60, 18,168, 68,225,145, 36,236, 93,187,171,221,217, + 95,206,164, 80,208,154, 41,181, 0, 60, 85,213,238,204, 56,237, 85, 0, 86,109, 42,117,204, 15, 23, 78,158,231,225,116, 58,241, +221,119,223,225,232,209,163, 88,179,102, 13,172, 86, 43,154, 52,105,130,232,232,104,100,100,100, 96,242,228,201,193, 4,214, 1, +191,178,185,228,244,233,211,221, 51, 50, 50, 72,121,121, 57, 74, 74, 74, 80, 89, 89, 9,167,211, 9,167,211,169,228,161,201,100, + 66, 82, 82, 18,172, 86, 43,181,219,237, 75,130,198, 93, 34,229, 28, 65,209,177, 85, 66,147,214, 55,186, 13,231,190,143,179, 91, + 29, 26,247, 59,171,140,147,191,122,162,245, 80,142,114, 20,168,137, 58, 33,160,146,199, 83,178,110,203, 47,247,255,193,249, 62, +101,234,212,169, 29,125,135,167, 39, 76,152,128,188,188,188,142,243,230,205,155, 2,224,173,250,114, 26,128, 20,212, 40,179,111, + 81,179, 97,166,213, 74, 94, 88,181,234,102, 0,119,172, 92,185, 18,227,199,143,199,127, 94,126,185, 75, 0,129,117,192,183,195, + 87,144,191, 25,199,243,183, 65,146, 36,239, 70,131,126,167,234,194, 73,170,170,170,108, 57, 57, 57,230, 15, 63,252, 16,177,177, +177,104,209,162, 5, 34, 34, 34,160,211,233,234,136, 1,121, 11, 23,119,139,197, 98, 59,124,248,176,249,227,143, 63, 70, 92, 92, + 28,210,210,210, 96, 50,153,160,215,235,149, 14,122,206,154,149,152, 50,233, 70,148,158, 60,130, 55,254,125,155,234,112,222, 51, +100, 32, 82, 13, 90,220, 56,107, 46, 58,118,236,136, 21,183,141, 6, 71,128,123, 55,236,132, 40,138,248,112,228,117,208,233,180, +184,119,195,110,213,156,187,119,239, 6,165, 20,105,105,105,176, 90,173,138,203,166,209,104,176,110,221, 58,140, 30, 61, 26,203, +150, 45,195,181,215, 94, 27, 54,238, 85, 85, 85,182,253,251,247,155, 63,250,232, 35,196,198,198,162, 89,179,102, 48, 26,141, 10, +159,175,136,105,213,170, 21,202,202,202,208,186,117,235,144,156,213,213,213,182,220,220, 92,243,178,101,203, 16, 27, 27,139,212, +212, 84, 24,141,198, 90, 78,216,204,153, 51,107, 17,116,235,214,237,119,115,214, 55,223,253, 57,199,140, 25,131,214,173, 91, 35, + 50, 50, 82, 73, 3,127,161, 93, 31, 80, 74,123,161,246, 52, 7, 7, 0,173,207,231,121, 66,200,238, 0,199,201,255,139, 0,174, +246,238,243,120, 53, 64,116, 0,190, 96, 60, 37, 94, 83, 33,222,239,248, 90,215, 9, 36,176,228,250, 56, 0,192, 86, 0,232,208, +161, 3, 74, 75, 75,161,211,233,208,187,119,111,156, 63,127, 94,177,249, 36, 73,194,216,177, 99,249, 39,158,120, 34,129,227, 56, +184, 92, 46, 80, 74,193,243, 60,228,158,159,191, 14,224, 56, 14, 25, 25, 25, 56,232, 77,211, 97,163, 70, 33, 53, 53, 85,153,196, +161,211,233, 48,126,252,120, 50,109,218, 52, 65,118, 47, 40,165,176, 90,173,232,214,173,155, 33,132, 59,242,239,207, 62,251, 44, + 74,171,213, 42,226, 74, 14,203,225,195,135,241,234,171,175,226,142, 59,238,192,201,147, 39,145,156,156,140, 71, 31,125,212,156, +149,149,245,111,167,211, 57, 43, 92,134,154,205,230, 90, 2,107,210,164, 73, 66, 70, 70, 70,130,209,104, 84,220, 45,175,168, 68, + 70, 70, 6, 9,231, 96, 73,146,132,111,191,253, 54, 96,239,208,191,199, 64, 8, 1,165, 84, 21,103, 78, 78,142, 34,206,100,247, + 66,222,159,151,151,167, 56, 88, 94, 33, 24,138,147,202, 66, 77,182,201, 69, 81,212,228,228,228,204, 78, 78, 78, 54, 79,154, 52, + 9,149,149,149,104,218,180, 41,134, 14, 29, 10, 73,146,224,116, 58,241,224,131, 15,134,116, 94, 68, 81,196,174, 93,187,144,149, +149,133, 39,158,120, 2, 11, 23, 46,196,224,193,131,107, 57, 88,114, 79, 55, 50,242, 15, 95,227,208,128, 22, 22,224,116,187, 96, +177, 88, 65,169, 7, 30,137, 66,242, 72,216,191,113,111,187, 95,246, 29,237,156,189,124,169, 8, 0,182, 77, 43,125,207, 74, 30, +179,224,255,218,103,198,136, 57,155, 46,184,114,194, 12, 59,227,190,251,238,195,179,207, 62,139, 91,111,189, 21,107,215,174,197, + 83, 79, 61,133,187,239,190, 91, 17,239,114, 89, 80, 49,236,248,222,132, 9, 19,254,181, 98,197,138,171, 30,121,228, 17, 78,174, +147, 70,163, 17,132, 16,216,108, 54,101, 59,124,248,176,244,207,127,254,243, 39,135,195,241, 94,208,130, 36, 24,126, 52,233, 44, + 95,159, 45,229,218, 22,109,136,229,136, 16,233,140, 79, 27, 80,126, 67,187,193,116,240,109, 45, 98,168, 84,227,240, 81, 80,216, +109,213,120,242,137,199,248, 63, 56,183, 70, 14, 25, 50,100,232,236,217,179,235,236,152, 61,123, 54, 14, 29, 58, 52,116,237,218, +181, 5,193,134, 68,131,136,171,212,168,164,164,121, 0, 96, 40, 42,154,106, 5, 78, 1,192, 11,192, 48, 15, 48,122,237,218,181, + 0,128,230,205,155, 67, 2, 58, 17,224,127, 60,240, 49,128,111, 2, 57,234, 78,151, 27, 86,171, 13, 18,173, 41, 71, 18,149, 32, +121,106, 92, 80,127,145,165, 98,220,141, 2,144,120,158, 71,151, 46, 93, 48,108,216, 48,104,181, 90,152,205,102,165,157,247,111, +147, 84,220, 20, 41, 0,137, 16,130, 86,173, 90, 97,232,208,161,208,104, 52, 48,153, 76,136,140,140, 84, 4, 22,207,243,232,146, + 49, 16, 31, 47,123, 5, 19,135,117,198,164,235, 18,241,217,254, 18, 85,225, 76, 51,106,145,102,208,161, 67,135, 14,136,136,136, + 0, 33, 0,207,115, 74, 56, 77, 70, 61, 52,202,240,163,186,184, 23, 21, 21,161,160,160, 0, 5, 5, 5,224, 56, 14,125,251,246, +133, 86,171,133, 32, 8,200,207,207,199,172, 89,179,224,112, 56, 84,113,114, 28,135,182,109,219, 98,224,192,129,208,106,181,144, +239, 21,190, 67,131,162, 40,162,178,178, 18,109,218,180,193,170, 85,171,208,191,127,255,176,156, 29, 59,118,196,128, 1, 3,160, +209,104, 96, 48, 24,148,169, 58, 90,159,184, 86, 85, 85, 41,233,208,189,123,247,122,113,174,217,117, 18,139,214,124, 15,187, 67, + 66,133,197, 85,235,132,228, 38,145,216,250,209, 19,170,226, 46,115,190,247,222,123, 40, 43, 43, 83,218, 33,121, 65,155,108,158, +164,166,166,226,221,119,223, 13,122, 15,242,106,145, 77,126,251,226, 9, 33,217, 62,117, 98, 20, 33, 36,219,247, 51,216,113,222, +175,215,205,152, 49,163,103, 86, 86,214,156, 62,125,250,124,188,125,251,246,229,193,248,130,241,204,152, 49,163,115, 86, 86,214, + 28,223,227, 3, 92, 39,160,131, 37, 15,249,112,178, 51,147,146,146,162,140, 59,155,205,102,104, 52, 26,229, 96,183,219,141, 15, + 62,248, 0, 9, 9, 9, 72, 76, 76, 84, 62,131,101, 0,199,113,160,148,226,161,243, 53, 83,128,190,109,170, 65, 1,128, 27,206, + 83,133,207,227,241, 96,197,138, 21,136,136,136, 80, 42,186,217,108, 14, 57, 92,164,213,106, 7,244,234,213,139,179,219,237,138, + 77,206,113, 28, 14, 31, 62,140,172,172, 44,140, 31, 63, 30,237,219,183,135,199,227, 65,117,117, 53,174,191,254,122,241,141, 55, +222, 24,160, 86, 96, 25,141, 70,101,222,145,221,110,199,250,245,235, 17, 29, 29,141,152,152, 24,196,197,197, 33, 54, 54, 22, 58, +157, 14,132,144,240, 45, 26,165,184,249,230,155,107, 57, 87,190,174,149,111,131, 38, 15,251,169,225,188,246,218,107, 21,247,202, +108, 54,227,155,111,126,107,159,123,247,101,240, 54,107, 0, 0, 32, 0, 73, 68, 65, 84,238, 13, 74, 41,226,227,227,177, 99,199, + 14, 53,141, 46, 36, 73, 66, 66, 66, 2, 68, 81, 36,235,214,173,123,193, 43,174,136, 40,138,248,225,135, 31,144,151,151,135,248, +248,120,165, 87, 26, 14,213,213,213,103,223,120,227, 13,207,219,111,191, 13, 0, 24, 52,104, 16,202,203,203,139,125,246,151, 78, +156, 56,177, 86,124, 47, 92,184, 80,250, 23,208, 87,112, 59,221,176, 88,109,168,170,172,134, 75,242,192,229,246,160,248,244,249, +232, 39,166, 77, 21,255,243,224,100, 0,192,180,249,111,161,242,221,223, 26,176, 47,166,141, 75,184,249,213, 79,166, 3,184, 49, + 20,191,197, 98,129,205,102, 67,243,230,205,177,123,247,110, 84, 86, 86, 98,240,224,193,181,220,223, 48, 67, 16,190,112,156, 62, +125,186,239,168, 81,163,118,191,246,218,107,173, 59,117,234, 68,170,171,171, 81, 93, 93, 13,139,197, 2,249,251,129, 3, 7,232, +242,229,203,127,177, 88, 44, 25, 8, 49,103, 72,155, 94,121,212,145, 27,177, 98,203,143,154, 81,127, 31, 51, 58,234,212,233, 66, +119,169, 85, 95, 85,110,253,201,238,161,135, 64, 61, 20, 30, 74, 65, 61, 18, 60, 84,250,163,215,111,167,182,107,215,238,159,203, +150, 45, 11, 40, 72,121,158,199,178,101,203,208,175, 95,191,127,230,231,231, 31, 70,136,201,253, 50, 90, 0, 90,183, 40, 62,241, +127,255,247,127, 26, 0, 24, 56,112,224, 19, 45, 92,174,105, 5,128,163, 83,215,174,183,108,223,190, 61,202,104,172, 89, 39, 20, + 21, 21, 5, 74, 41,111,177, 88,162, 50, 50, 50,110,217,191,127,127, 93,129, 37, 81,184, 92,110, 88,109,118,148,149, 87,193,229, +112,193, 45,185,225,113, 75,112, 75, 53,238,168,219,227,129,228,246,192, 45,121,192, 11,124, 68,230, 53,205,170,106,188, 44, 82, +182, 57,167,176, 89,160, 34, 90,179,194, 11, 72, 74, 74, 82,134,132,125,231,202,168,112, 49,234, 24,245, 53,109, 33, 85,218,198, + 31, 55,102,163,248,208, 86,104, 8,133,228,113, 65,114, 59,225,113, 57,193, 67,194,161, 99,167,209,169,105,216, 54, 68, 9,231, +240,103, 94, 68,239,222,189,241,217,184, 27, 65, 8,112,239,250, 29,208,104, 52, 88,126,211, 96,104,245, 90,252, 99,205, 78,181, +225,172, 21,247,220,220, 92, 60,244,208, 67,120,233,165,151, 96, 48, 24,148,206,201,145, 35, 71,240,201, 39,159, 96,200,144, 33, +170,227, 78, 72,205, 80,171,156,134, 51,102,204,192,153, 51,103, 48,111,222, 60,244,236,217, 19,162, 40,162,172,172, 12, 25, 25, + 25, 56,119,238,156, 42, 78, 74, 37,196,198,198, 42,211,117,252,231,136,201, 29,217,250,228,145, 47,231, 93, 55, 37,227,203,109, +203, 65, 64,176,243,163,169,181,238, 71,239,124,178,165,222,156,207, 62,251,108,173,112,214,211,189,146,181, 8, 9,114,207, 27, +165,210,241,146,143,147, 19, 89,151,149,149, 53,199,255,252,112,124,190,251,253,206,119,248,137,178,115,106,134, 8, 41,199,113, +144, 36, 9,102,179, 25, 90,109,141, 3,230,127, 35, 53,153, 76,181, 20,121,184,241,100,158,231, 65, 41, 85, 18,150, 15,176,127, +199,142, 29,117, 68,192,127,255,251,223,144,227,180,110,183,187, 99, 68, 68, 4, 42, 43, 43,149, 57, 82, 90,173, 22,211,167, 79, +199,196,137, 19, 21,113,165,213,106,177,120,241, 98,164,167,167,195,225,112,116, 12,149,160, 26,141,198,210,181,107, 87, 78,118, +129, 12, 6, 3, 25, 63,126, 60,239,116, 58,161,215,235,107,185, 78,242,220,180,112, 98, 72,118,155,190,251,238, 59, 85, 14,150, +218, 57, 72,148, 82,236,221,187,183,150, 80,243, 46, 53, 6, 0,236,219,183, 79,185,209,170, 29,239,246,120, 60, 48, 24, 12, 68, +163,209, 16,147,201, 20, 53,105,210, 36,133, 87,206,115, 57,222,106, 38, 90,239,223,191,255,250,144,227, 53, 7, 14,252, 37, 31, +199, 32, 73, 18,156, 46, 23,172, 86, 27, 42,171, 45,152, 57,215, 59,162, 54, 19, 57, 0,114,250, 78,121, 8,247, 13, 27, 50, 16, +225, 87,247, 5, 68,108,108, 44, 62,255,252,115,136,162,136, 85,171, 86, 33, 50, 50, 18,163, 71,143, 70,100,100, 36,158,120,226, + 9,220,118,219,109,245, 17, 88, 0, 80, 94, 90, 90,218,119,234,212,169,187, 95,126,249,229,230,205,155, 55,135,211,233,132,195, +225,128,211,233,196,177, 99,199,176,124,249,242, 66,139,197,210, 23, 64,121, 56, 50,109,122,229,209,236, 71, 90,159,237, 55,230, + 38,219,161,162, 53, 56, 87,116, 30,110,207, 41,184, 61, 30,184, 93,238, 26, 65, 32, 73,112, 59,221,224,121, 46,242,250, 62,105, +235,106, 38,252, 19, 7,128, 17,151, 48,171,104,126,126,126,105,124,124,188,220,131,140,116, 56, 28,196,219,150, 80,252, 54,193, +189, 26,128, 83, 13, 97, 33, 48,229, 63, 47,189,212, 76, 30,190,127,233,165,151,154, 61,250,200, 35, 83, 0,188,126,104,255,254, +165,119,221,117,215,212, 79, 63,253,180,214, 57,119,221,117, 23, 14,237,223,191, 52, 88,207,199,229,114,193,106,181,163,164,228, + 87,220,115,239, 51, 62,221,125,170,244,251,107, 38,189, 83, 0,208, 3, 64,201,185,159,241,224, 67,143,234, 66,117,168,188,245, + 29,162, 40,214,153,132,236,219,190,171,104, 63,168,255, 20, 11,141, 70,131,163,219,179, 49,117,202, 45,128,199, 13, 56,171, 1, +167, 5,212,105, 1,117, 84,131,104, 13,160, 46,155, 42, 94,143,199,163, 76,219, 16,120, 14, 58,237,111,237,166,209,104,128, 86, +175, 85, 27,206, 58,113, 63,113,226, 4,238,191,255,126, 56, 28, 14,140, 25, 51, 6, 54,155, 13,118,187, 29, 54,155, 13,173, 90, +181,130,213,106, 85, 29,119, 73,146, 20, 23,112,234,212,169,232,217,179, 39,102,205,154,133,199, 31,127, 28,173, 90,181,194,148, + 41, 83,240,241,199, 31,163,115,231,206,176, 88, 44, 97, 57,229,182,196,108, 54, 67, 16, 4,165, 13,246,205, 43, 89, 96,169,205, +163, 64,156,132,252, 54,239,214, 55,223, 31,158, 52,168,222,156,115,230,204, 65, 73, 73, 73, 29,231,202,215,193, 90,176, 96,193, + 69, 85, 86, 63,151, 41,236,113,132,144, 92,239, 95,214,233,211,167, 63, 73, 8,201,158, 62,125,250,147,115,231,206,205, 83,195, + 23,104, 63, 33,228, 43,239,253,247, 6,159,255,114,213, 8, 44,200,110,147,108,107,202, 9, 39,239, 3, 0,163,209,136,236,236, +108,172, 88,177,162,214, 13, 37, 24,100,209,246,117,124, 77, 1, 24,233,117,174,228,223, 35,138, 37,140, 26, 53, 10,173, 90,181, +170,229, 94, 25, 12,134,144, 98, 67,146, 36,156, 56,113, 2, 7, 14, 28, 64,159, 62,125, 80, 94, 94, 14, 1,192,180,253,251,209, +105,210, 36,216,189,194, 79,171,213,226,159,255,252,167,170, 12,220,179,103, 79,173, 73, 64, 29, 59,118, 60,149,145,145,145,178, + 99,199, 14,197,209,210,233,116,208,235,245,138,200, 80, 83,169, 41,165,184,229,150, 91,106,137, 33,127,129, 37, 87,158,111,191, +253, 86,213, 16, 33,165, 20,153,153,153,138,123, 21, 17, 17,129, 47,190,248, 66, 57,230,186,235,174, 3, 33, 4, 9, 9, 9,248, +230,155,111,194,114,202,105, 42,231, 61,207,243,168,174,174, 70,110,110, 46,180, 90,173, 50, 63,195, 96, 48, 40,241,103, 8,150, +225, 18, 28, 46, 23, 44, 86, 27, 42, 43,107, 26,210,163, 7, 62,171,117,136,211,126,241,139,211,100, 39,180,162,162, 2,235,215, +175,199,231,159,127,142,158, 61,123,214, 26, 30, 84, 59, 68,232, 59,143,224,215, 95,127,237,247,248,227,143,239,124,225,133, 23, +154,198,197,197,193,233,116,226,196,137, 19,248,224,131, 15,206, 88, 44,150,126, 0,206,171, 79, 3, 10,183,203, 13,155,197,138, +242,202,106, 60, 63,123,113,208, 38, 2, 0,156,142, 74,140, 26,145,169,189,196, 57,117, 26,192,221, 62,191,151, 2,144, 39,227, + 87, 0,152, 88, 31, 50, 17, 24, 48,230,150, 91, 6, 78,157, 58, 85,249,111,234,212,169,216,185,115,231, 64,113,197,138, 3, 46, + 96, 35,191, 98, 69,151,121,243,230, 41,199,204,155, 55, 15,159,175, 88,177,193, 3,108, 12,210,109,175,113,176,172, 54, 84, 85, + 91, 17, 25,157,140,211,199, 55,133, 13,139,134,183,131,134,104,151,229, 54, 36,216,188,155,122,136, 43, 37,164,242,177,242,188, +163, 46, 3,111,193,107,175,255, 23, 58,142,226,230,129,157, 16,111,144, 64,140,177,208,100, 78, 7,137, 78,171, 57,235,249,171, +161,166,173,219,244,212, 52, 28, 51,233,241,207,181,219, 32,138, 34, 62, 31, 55, 18, 26,173, 6,119,124,181,185,102,113,207,228, +155,161,209,105, 49,244,157, 79,212,220,168,149,184, 31, 61,122, 20,219,182,109, 67,135, 14, 29,240,243,207, 63, 43,115,108,229, +251,150,202, 14,175, 18,119,185, 29, 47, 42, 42,194,168, 81,163,160,209,104,176,120,241, 98,108,218,180, 9,143, 63,254, 56,238, +186,235, 46, 92,127,253,245,193,230,197,214,225,244,205,163, 96,243,163,234,155, 71,254,156, 74,249,253, 29,249, 46,115,202,147, +219, 3,137,245,223, 59,177,221,199, 45, 74, 12,176,239, 6,127,231,137, 82,218,203, 59, 55,202, 62,119,238,220,188,185,115,231, +142, 34,132,100,207,157, 59,119, 84, 48, 7, 43, 16, 79,128,253, 97,219, 65,193, 79,133, 14,240, 21, 81,218, 16, 99,217, 38,147, + 9,119,223,125, 55,158,120,226, 9,101, 34, 99, 40,200,202, 53, 20,178,179,179,235,252,183,106,213,170,112, 67,132,135,163,162, +162,122, 14, 28, 56, 16,229,229,229, 56,121,242, 36,204,102, 51, 58,189,250, 42,246,223,119, 31,174, 94,184, 16,220,192,129, 74, +133,223,191,127, 63,116, 58,221, 97,155,205, 86,175, 76, 53,155,205,136,137,137,129, 94,175, 71, 68, 68, 4, 34, 34, 34, 96, 50, +153, 20,161, 21,110,136, 80, 46,124, 95,125,245, 85, 72,231,202,215,242, 85, 35,134, 40,165,216,177, 99, 71, 29, 7, 75,190,166, +188, 79,118, 50,212,112,122, 29, 75,170,211,233,192,243, 60,140, 70,163, 98,247,235,245,122,101, 83,235, 96,133,123,144,104, 90, + 90, 90,173, 7,145,254, 63,123,231, 29, 30, 69,181,134,241,119,102,182,111, 54, 13, 82, 72, 15, 1, 2,129,208, 66,151, 38,160, + 8, 72, 17, 68,176, 97,167,169,112,189, 82, 45, 24, 80, 1, 69, 64, 16, 1, 1, 5, 1, 1, 43, 77,138,244, 38,229,146,208, 99, + 66, 40,233, 33, 36, 33,109,179,117,202,185,127, 36, 27, 55, 33,101, 55, 4, 80, 56,191,231,217,103,119,167,188,115,206,204,153, +153,119,190, 83, 70, 46,151,151, 27,136,244,223, 95, 69,104, 70,177,190,184,206,245, 45, 22, 11,100, 50, 25,126,253,245, 87,116, +234,212,169,204, 92,217,140,149,253,113,119,146,180, 91,183,110, 61,186,120,241,226,147, 11, 22, 44,240,212,235,245, 88,179,102, + 77,129, 94,175,127, 20,165,237,136, 28,190, 24, 2,224,173, 2, 12,102, 51,244, 69, 37,251,224,234,197, 95,106, 52,101,255,102, +154,183,106,245,226,234,213,171,111,155,190,122,245,106, 36, 38, 38,190,136,243,231, 15, 6, 1,203,167, 78,157,218,184, 93,187, +118, 65, 0, 48,117,234,212,212, 32, 96,121,117,231,185,173,138, 80, 95,106,214, 77,197, 57,117, 22,105,173,248,192,119,167, 55, + 68,134, 97,202, 76,198,227, 35, 94, 67,198,181,120, 68,104,115,224,227,225, 2,169, 40, 3,138, 62,209, 56,127, 75,139, 47,151, +239,118, 42,157, 90,165, 2,106,205,223,213, 77,106,141, 26,170,210, 90, 5,134, 97,160,214,106, 32, 87, 42,157,206,123,124,124, + 60,180, 90, 45, 68, 81,188,237,126,227,108,143,102, 66, 72,217,189,115,193,130, 5,152, 60,121, 50,214,172, 89,131,243,231,207, +163, 77,155, 54,120,236,177,199,112,243,230, 77,156, 59,119, 14,102,179,217,225,116,218,223, 47,226,226,226,176,119,239, 94, 36, + 36, 36, 32, 53, 53,181,214,199,189, 98, 53, 99,105, 13, 78,137,121,221,123, 6, 79, 63, 30, 85, 43,205,232,232,104,220,188,121, +243,182,200,149,125,243,163,106, 34, 88,101, 94,164,154,242, 21, 99,111,130,108,145, 38,123, 67, 84,241, 63, 0, 79,219,180,105, +211,166,189,231,232,122,246,255,109, 17, 48, 71,170, 22,237, 13, 22, 83,177,186,142, 97,152,178,157,110, 31,153,178,253,214,106, +181,101, 81,166,144,144,144,106,163, 87,182, 19,142,227, 56,116,191, 86, 4,165, 82, 89, 86,157,215,255,166, 84, 46, 68, 30, 22, + 22, 86,174, 13,150,253, 65,169, 12,179,217,124,240,224,193,131,109, 7, 15, 30,204,197,197,197, 65, 38,147, 65,146, 36,152, 59, +119, 70,155,229,203,113,225,157,119,208,227,250,117,152,121, 30,106,181, 26,187,118,237,178, 26, 12,134,131,206, 20, 26,150,101, + 25,155,193, 82,169, 84,112,117,117,133,155,155, 91, 89, 52,199,153,139, 80, 85, 79,136,246, 31,103, 78,104, 91,131,126,251, 27, +171,237,248, 25,141,198,114,134,203, 81,236,171, 12,108,166,200,221,221,189, 92,181,168, 45,138,231,136,193,170,105, 32, 81,149, + 74,229,118,248,240,225,198,110,110,110, 32,132, 32, 39, 39, 7,207, 62,251,236,229,127,125, 0, 11,164,164,145,187,209, 4,189, +209, 84,231,250, 63,252,240, 3,174, 92,185, 2,171,213,138, 57,115,230,220,102,172,106, 25,193,178,113, 69,163,209, 72,253,250, +245,195,241,227,199,161, 82,169,120,212, 98,252, 42, 34, 73,176,242, 2, 76, 70, 51,244,197,197,120, 24,184,116,254,252,207, 46, + 46, 46,207, 2,208,229,231,231,115,238,238,238,208,106,181, 48, 26,141, 5, 92,105, 79,193, 36,192,162,225,249,207, 70,140, 24, +177, 16, 0,100, 60,255, 89,117,227, 96,149, 25,172, 58,222,143,182,235, 86, 85,209,171,218,154, 43,134, 97, 74,186,231,179, 44, +214,204,153,140, 8,109, 54,162, 26,186,192,116,243, 10, 84,110, 94, 96, 60, 66,241,229,242,221,136, 75,186,229, 84, 58,159, 91, +247, 11,130,130,130,176,253,165, 33, 80,169, 84,120,246,151,189, 37,141,180,199,142,132, 66,173, 66,159, 37, 63,212, 42,239, 6, +131,161,202, 72,149, 19, 17,172, 50, 77,155, 1,140,138,138, 66,147, 38, 77,112,240,224, 65, 68, 69, 69, 33, 49, 49, 17,137,137, +137, 72, 74, 74,194,249,243,231,145,151,151,231,244, 49,218,180,105, 19,178,179,179,161, 80, 40, 80, 88, 88,136,235,215,175, 87, +215,254,217,225,227,110,163,217,147,209, 0, 0,127,111,119,167, 12,150,189,230,188,121,243,156, 25,230,161,156, 76, 53,243,114, + 42,180,117,178,253,183, 84, 48, 59, 21,255, 87, 92, 30, 0,110, 2,224,106, 88,175,226,255,156, 57,115,230, 28,180, 69,190, 74, +117,185,170,218, 95, 85,140, 96,217,155, 0, 99,179,102,205, 52,246,245,167, 44,203,194,213,213,149,153, 52,105, 18,199, 48, 12, +116, 58, 29,220,221,221, 17, 30, 30, 14,171,181,230,102, 9, 10,133,194,216,177, 99, 71,141,125,232,149, 97, 24,184,184,184,112, + 83,166, 76, 97, 86,173, 90, 85,233,122, 91,183,110,173,182,112, 11,130,176,112,212,168, 81,175,167,165,165,121,250,250,250, 34, + 51, 51, 19, 10,133,162,100,180,216, 94,189,208,253,218, 53, 88, 75, 13, 67,124,124, 60, 86,174, 92, 89,108,181, 90, 23, 58,123, +209,208,233,116,168, 95,191, 62, 84, 42, 85,185, 94, 49,118,161, 85,135, 34, 88,117,105,174,108,154,246, 55, 86,219,239,177, 99, +199,150,253,119,230, 34,169, 80, 40,200,147, 79, 62, 89,246, 14, 66, 15, 15, 15,120,121,121, 33, 43, 43,235,239,158, 58,165,145, + 59, 71, 13, 86, 77, 3,137,202,229,114, 88,173,214,178,234,204, 37, 75,150,220,137, 49,248,231, 24, 44, 65, 98,116, 58,111,248, +251, 55,133,183,143, 9,146, 36,214,153,182, 32, 8, 24, 55,110, 92,185, 49,175,108, 55, 98,219, 32,182,182, 30,190,246,225,127, +103,159,196,239, 56, 58, 66, 0, 94, 40,141,226, 25, 44,255,186, 99, 24, 18, 18,226,150,156,156, 92, 89,187,168, 74,123,251, 1, +127, 15,201,192, 1,159,164,164,164,180,116,119,119, 71,223,190,125,177,109,243,230,173, 31, 2,101, 33, 27, 35,144,166,185,113, +227, 63,165,191,211,107, 10,234,217,170, 8,139, 13,117,109,214,153,219,162, 87,119, 90,149,195,178, 37, 15,102,191,125,243, 25, + 34, 52, 89,104, 19,172,194,177, 19,231,208, 41,136,128,152, 21,181, 78,167, 78,167, 43,105,140,175,213, 66,165,250,187,205,149, + 74,171,129, 66,169,170,117,222,237, 35, 85,119, 26,193, 98, 24,182,220,126,124,253,245,215, 49,117,234, 84,244,237,219, 23,137, +137,137, 56,124,248, 48, 46, 95,190,140, 9, 19, 38, 32, 50, 50, 18, 79, 60,241,132, 83,199,232,183,223,126, 67, 65, 65, 1, 8, + 33,200,206,206,134,201,100,194,140, 25, 51,238,248,184,219,184,182,103, 54, 0,224,151, 61,177,181,214,156, 62,125,122,217, 24, +140,182,123,126, 13, 81, 43, 71,238,119,167,170,251,239,236,250,247,130, 74, 13,214,229,203,151, 43,237, 43, 31, 17, 17,145,213, +167, 79, 31,159,132,132, 4,232,116, 58,132,135,135,195,108, 54, 87, 87, 13,209, 18,165, 99,101, 92,186,116,169, 82,205,176,176, + 48,235,227,143, 63, 46,111,208,160, 65,185,200,149,173,135,141,189, 51,174,168, 89, 74,145,201,100, 26,221,181,107,215,181, 59, +119,238,212,132,135,135,163,160,160,164,253,237,154, 53,107,240,214, 91,111, 65,163,209, 32, 33, 33, 1, 67,134, 12, 49, 24, 12, +134,209, 40, 63, 6, 86,101,154,183, 25, 25,133, 66, 81, 86, 77,102,171, 42, 83, 86, 31,138,190, 77,147, 97, 24, 44, 94,188,184, +210,177,160, 42,178,124,249,242,202,220,124,165,233,252,226,139, 47,234, 76,243,228,201,147,229,222, 49, 56,112,224,192,111,158, +120,226, 9,164,166,166,150,171, 22,172,193, 96,149,211,172,105, 32, 81,142,227,224,235,235,139,143, 63,254, 24, 94, 94, 94,104, +208,160, 65,101, 6,171,218, 99, 84, 75,238,170, 38, 97, 73,204,162, 5,209,221,190,249,246, 23,185, 74,201,226,248,225, 95, 80, +152,119,163,124, 4,214,250,119,151,104,101, 84, 31, 88, 98,247, 57,148, 78,179,217,140,207, 63,255, 28,209,209,209,136,142,142, +174, 54, 65, 85,116,135,174, 49,239,246, 6,203, 65,179,117,155,166, 36,137,140, 90,235, 9,173,139, 63, 34, 35, 61, 33,145,154, +199,234,148,238,255,113, 55,164,166,166,186, 7, 5, 5,225,242,229,203, 12,254,110,143,245,247,177, 82, 42,159,173, 96,176,110, + 63,223,129,243, 27, 54,108,104,217,170, 85, 43, 44, 89,178, 4, 0, 94,250,252,143, 63, 70, 70, 27, 75,194,153, 28,176,177,212, +140,213,152, 78,145,136,140, 90,235, 1,141,174,116, 63, 74,142,143,121, 74,170,201,187,237,230,119, 39, 15,122,149,105,218,214, +191,122,252,119, 60,217, 63, 16,127,158, 60,143,125,105, 46, 8, 82,101,192,207,144, 13, 41,251, 47,252,103,120, 20,190,252,185, +228, 38,126,254,116,205,154, 12,195,224,232,164,209,208,169, 85,120,122,195, 14,200,229,114, 28,124,231,101, 40, 20, 10,244, 92, + 80, 82, 37,123,225,243,233,144,169,148,136,152, 16,237, 80, 58, 43,214,212,216,218, 92,217,155,171, 26, 34, 88, 85,230, 93,175, +215, 35, 47, 47, 15,107,215,174,197,171,175,190,138,155, 55,111,226,250,245,235, 72, 72, 72,192,198,141, 27,203,221,227,224,196, + 49,154, 54,109, 26,222,125,247, 93,176, 44,139,150, 45, 91, 34, 58, 58, 26, 93,186,116,113,250, 24, 85, 60,238, 21,113, 32,122, + 85,165,230,162, 69,139,156,238,176,245, 32,226, 84, 3, 13, 91, 36,203,203,203, 11, 46, 46, 46, 0, 80,238, 6, 91, 83, 53, 97, + 85,154,130, 32, 64,163,209, 64,163,209,148, 27, 22, 97,240,224,193, 53, 70,176, 74,217,149,144,144,240,124,139, 22, 45,190,139, +142,142,118,121,244,209, 71,229,254,254,254,104,215,174, 29, 18, 18, 18,240,251,239,191, 91,151, 46, 93,106, 48, 24, 12,175, 2, +216, 83, 27,243,108,107,248,109, 63,162,189, 51,136,162,152,122,253,250,117,191, 47,190,248,130, 99, 24, 6, 11, 23, 46, 44, 55, + 64,107,197, 60,158, 56,113, 66, 32,132, 92,169, 33,138,145,122,253,250,117,191,249,243,231,151,211,180,125, 42,154, 20, 71, 52, +171,194,150,231,138,251,192,145,147,167,166,129, 68,101, 50, 25,226,227,227,241,209, 71, 31,129, 97,152,114, 29, 39,254,205,252, +249,191,204, 85, 93,218,193,243,217,225,189, 91, 49, 96, 97,169, 36,210,203,229,230,151,153,171,161,243, 55,225,183,119, 71, 58, +114, 44,174, 31, 58,116, 40,120,246,236,217, 28,199,113,152, 55,111, 94,185,178, 84,241,184,239,223,191, 95,212,104, 52, 41,181, +205,135,213,106,117,164, 23, 85, 85, 39,248,177,197,243, 62,234,251,205,234,109,114,134,177,224,248,161, 95, 80,144, 95,121,215, +116,165, 92,134,117, 27,182, 10, 50,142, 77,189,207,135,238,155,199, 30,123,108,198,222,189,123,101, 65, 65, 65,181, 22, 9, 4, +182, 45, 94,188,184,255,168, 81,163,234, 53,111,222,220,214,249, 68, 89,250, 65,233,200,238,187, 28, 52, 73, 91,190,252,226,163, +151, 86,172,222,166,100, 25, 43,142, 31,254, 5, 5, 21,204,250,237,209,104, 57,214,111,216, 98,149,201,184,248,154,174,193,181, +233,193,236, 8,109,159,124, 21, 95,239, 88, 9,159, 86,253,241,204,160,110, 56,186,228, 37,140,104,110,132,245,199,231,208,242, +153,117, 88, 51,189, 36,122,211,230,167,233, 14,221, 43,220,116,127, 15, 88,201,178, 44, 84,106, 13,228,202,191,163, 47, 74,173, + 22,156, 19, 17, 91, 91,222,171,139, 84, 57,187, 63, 56,142, 67, 88, 88, 24, 26, 53,106,132,174, 93,187,162,109,219,182,232,213, +171, 23,206,157, 59,135,115,231,206, 97,194,132, 9,213,153,171, 26,143, 81,223,190,125,209,175, 95,191, 59, 62, 54, 21,143,123, + 93,224, 72, 89, 26, 63,126, 60, 0,220, 81, 52,235,129, 54, 88,222,222,222, 80, 42,149,181, 50, 84,149,105, 90, 44,150, 50, 99, +165,209,104,202, 34, 86, 91,183,110,117,166,128,239, 49, 26,141,145, 31,124,240,193, 68,141, 70,211,203,104, 52, 70, 0,128, 86, +171,253,203, 96, 48, 28,176, 90,173,139, 0,228,223, 73, 90,237, 13, 70, 37, 81,174,106, 31,241,179,179,179,159,120,241,197, 23, +247,176, 44,219,176,186, 23, 51,219,153,213,164,172,172,172,254, 53,105,190,240,194, 11,149,106, 86,166,235,136,102, 21,230,176, +156,169,178,239, 97,232, 80, 33,171, 97, 32, 81,185, 92, 14,157, 78,135,205,155, 55,163,126,253,250, 15,212, 9,118, 60, 38,243, +243,234,230,247,172,175, 60, 4,192,123,232,252, 77, 41,135,114,173, 33, 67,231,111, 74,254,237,221,145,193, 53, 24,158, 71,230, +206,157,123,148,231,249, 16, 7,203,109,178,217,108,238,230,108,218, 9, 33,136,143,143,151, 94,127,253,245,156,236,236,236,103, +106,147,255,195,199,147, 23,116,235,232,239, 53,124, 72,183, 14, 96, 24, 88, 44, 85, 52,234,101, 64, 8, 33, 68,198,177,169,135, + 78,164,190,126,159, 95,161,113, 54, 57, 57,121, 86,227,198,141,199, 0,168,234, 78,184,177, 38,145, 36,192,162, 52,155,191,104, +223,190,253,148,247,222,123,207, 99,208,160, 65, 8, 10, 10,130,187,187,243,111, 11, 58,118, 42,125, 76,231,118, 98,224,211,131, +187, 61,193, 50, 12, 49, 91,170,111, 28,205,216,246,167,140,139, 63,124, 50,173,117,117,209,121,155, 41,191, 27,209,134, 62,195, + 95, 65,159,225,175,148,149,167,125, 63, 63,138,152,244, 63,208,142, 77,135,121, 69, 55, 48,110,182,162, 94,243, 48, 55, 44,203, + 98,208,234,205, 80, 40, 20,101,233,124,100,110,249,126, 1,225,111, 58,254, 46,117,251,188,219, 71,176, 42,185, 22, 59,213, 6, +139,227, 56,228,228,228, 32, 33, 33, 1, 89, 89, 89, 48, 24, 12,136,139,139,131,197, 98, 65, 94, 94, 30, 90,182,108,233,220,211, +253, 93, 56, 70,247, 83,243, 97, 48, 86,181, 50, 88,132,144,180, 78,157, 58,213,116, 51,118,170,151,145, 76, 38, 51,117,235,214, +141,169,172,183,129,237,183, 70,163,113,244,241, 57,223,106,181, 70, 91,173,214,104,148, 86,133, 89,173,214, 59,110, 72, 34,138, + 98, 70,199,142, 29,185,234, 46,250,146, 36, 85, 59, 98, 92, 78, 78, 78,113, 78, 78, 78,157,190, 58,252,110,104, 86,114,210,136, + 99,198,140,169,214, 73,185,184,184, 84,219,184,168,166,129, 68, 13, 6, 67,230,139, 47,190, 40,218, 87, 53,219, 15, 68,250, 64, +195,144,228, 1,207,190, 22,114, 40,215, 26, 2, 0, 54,147, 5, 66,146,171, 90,229,244,233,211, 89, 0, 26,223,237,164, 93,187, +118,205,210,169, 83,167,245, 69, 69, 69,227, 1, 24,106,171,115,244, 84,198,244,127,225,145, 57, 11, 96,236,157,138, 88,128, 56, + 95,147,105, 92,244,135, 31, 62,253,209,135, 31,134, 75, 64,125,148,142, 81,197, 57, 96,210,236, 57, 17,115,163,206,199, 6, 19, + 69, 49,237,145, 71, 30,113,122,157,154,230, 87, 51,146, 56,126, 64, 16,112,218,121,205,187,145, 78,155,102,171, 86,173,208,166, + 77,155,178,111, 27,246,211,219,182,109,235,144,102, 84, 84, 20,154, 55,111, 94,229, 8,237, 21,219, 92,221,239,188,219,176, 61, +250,182,109,187,187,206, 52,239, 52,157,148,234,105, 73, 53,169, 38,213,252,215,106,114,116,127, 82, 77,170, 73, 53,239,161,230, + 3, 5, 75,119, 1,133, 66,169,234, 1,147,238, 2, 10,133, 66,169, 29, 76, 53, 46,212,153,158, 59,181,113,178, 23,168, 38,213, +164,154, 84,147,106, 82, 77,170,249,208,105,214,164, 93,215, 61,135, 31, 72,104,248,148,106, 82, 77,170, 73, 53,169, 38,213,164, +154, 15, 29,180,138,144, 66,161, 80, 40, 20, 10,165,142,145,209, 93, 64,161, 60,220, 68,223,225,131, 86,244,109, 99,131, 62,220, +233,164, 80, 40, 20,128, 70,176, 40, 20, 10,133, 66,161, 80,168,193,162, 80, 40, 20, 10,133, 66,161, 6,139, 66,161, 80, 40, 20, + 10,229, 33,131,161,187,128, 66,121,184,137,166,109,176, 40, 20, 10,165,206,161, 17, 44, 10,133, 66,161, 80, 40,148, 58,198,214, +139,208,254,125,125, 52,170, 69,161, 80, 40, 20, 10,229, 94,243, 64,121, 17, 25, 53, 86, 20, 10,133, 66,161, 80,254, 33, 60, 48, + 94,132,173,194, 57, 82, 40, 20, 10,133, 66,161,220,107, 30, 24, 47,194, 62,136,174,145, 66,161, 80, 40, 20,202,191,146, 7, 54, +130, 69,163, 88, 20, 10,133, 66,161, 80,238, 23, 15,140, 23,145, 61,104,142,145, 66,161, 80, 40, 20,202,191,146, 7,202,139,220, +237, 97, 26,232,155,198,169, 38,213,164,154, 84,147,106, 82, 77,170,249,208, 65,199,193,162, 80, 40, 20, 10,133, 66,161, 6,139, + 66,161, 80, 40, 20, 10,133, 26, 44, 10,133, 66,161, 80, 40,148,135, 10, 25,221, 5, 20,202,195, 77,244,191,228, 29,125,209,244, + 93,130, 20, 10,229, 95, 4,141, 96, 81, 40, 20, 10,133, 66,161,212, 49, 12,170,238, 9,112,193, 9,157,218,244, 38,184, 64, 53, +169, 38,213,164,154, 84,147,106, 82,205,135, 78,179, 38,237, 11,160,220, 21,227, 69, 53,169, 38,213,164,154, 84,147,106, 82,205, +135, 79,243,129,130, 86, 17, 82, 42, 34, 67,245,109,243,106,154,127,175, 52, 41, 20, 10,133, 66,249, 71,223, 76, 41, 20, 27, 93, + 0, 12, 44,253,189, 29,192,113, 39,231,223, 43,205,251, 66, 84, 84,148, 70,173, 86,247,221,191,127,191, 34, 62, 62, 30, 39, 78, +156, 32, 63,252,240, 3,111, 50,153,254,136,141,141, 53,210,226,243, 96,208,182,109,219, 39, 24,134,153, 10, 0,132,144,207,206, +156, 57,179,251, 14,228,152,198,141, 27, 79, 80, 42,149, 3,228,114,185,191, 40,138,140,217,108,206, 48, 26,141,123,210,211,211, +231,163,118, 13,247, 59,120,121,121,141,141,140,140, 12,191,118,237, 90,106, 74, 74,202, 58, 0,187, 1, 60, 17, 28, 28,252, 98, + 88, 88, 88,208,197,139, 23, 47,231,228,228, 44, 7,240,191,251,152, 78, 10,133, 26, 44, 7, 96, 61, 61, 61, 31,215,104, 52, 19, +245,122,125,148,155,155,219, 69, 65, 16, 22,103,102,102,110,167, 39,222, 3, 85, 22, 6, 18, 66,228, 0,192,113,220,144,142, 29, + 59,134, 48, 12, 35, 49, 12, 67, 8, 33,204,201,147, 39,219,138,162,200, 2, 0,195, 48, 3, 75, 47,222, 66,109, 53, 5, 65, 96, + 78,159, 62,237,172,230, 93,161, 69,139, 22,179, 9, 33,254,213,238, 32,153,172,253,190,125,251,154,109,217,178, 69, 88,183,110, + 93,254,200,145, 35,117, 47,191,252,178,108,205,154, 53, 95, 3,248, 79,197,229,155, 55,111,190,128,101, 89, 47, 71,182, 47, 73, + 82, 78, 92, 92,220,127,105, 49,188,255, 48, 12, 51,245,181,185, 7,123, 72, 4,248,110, 90, 79,182,212,188,212,214,172,125,255, +212, 83, 79, 61,219,180,105, 83,153, 36, 73,224,121, 30,102,179,185, 89,108,108,236,163,187,119,239,110,159,148,148,244,140,147, +146, 3,167, 77,155,182,114,214,172, 89,222,114,185,156,225,121,190,243,143, 63,254,216,111,236,216,177,103,151, 47, 95,222,102, +196,136, 17,174,182,233, 31,125,244, 81,255, 57,115,230,188, 3, 96,227,125, 72, 39,133, 66,111,170,213,205,212,233,116, 77,188, +189,189,223, 45, 44, 44,236,223,190,125,251,130,209,163, 71, 95, 61,119,238, 92, 92,100,100,164,126,245,234,213,159,242, 60,191, +212,211,211,243,143,194,194,194,249, 89, 89, 89,113, 78,110,187, 9,128,209, 0,250, 3, 8, 4,144, 1, 96, 39,128,149, 0,226, +107,147, 25,127,127,255, 86, 46, 46, 46, 83, 24,134,233, 92, 92, 92, 28,232,226,226,146, 65, 8, 57, 89, 84, 84, 52,239,198,141, + 27,177,181,209, 12, 8, 8,104, 4,224,109,153, 76,214, 93, 20,197,134, 28,199, 37,139,162,120, 68, 20,197, 37,153,153,153,151, +107,163,249, 72,160,110,144,164,115,155,207,115,154, 32,189, 73, 80,232, 84, 50, 94, 46,153, 82,165,226,252,105,167, 82,139,127, +249, 39, 20, 12,165, 82,201,174, 91,183,174,141, 82,169, 4, 0, 88, 44, 22, 68, 70, 70,222,209,123,162,228,114, 57, 59,111,222, +188, 54, 10,133, 2, 0, 96,181, 90,209,187,119,239,127,196,187,167, 24,134, 9,140,137,137,113,183,165,173, 34,162, 40, 98,200, +144, 33,161, 74,165, 18,203,151, 47, 23,114,114,114,162,190,251,238,187,152,175,191,254,218,235,251,239,191, 31, 94,153,193, 98, + 89,214,171, 42, 77, 81, 20, 97,181, 90, 33, 8, 2, 44, 22, 11,122,245,234, 69,175, 70,255, 16, 8, 33, 33, 4,192,206,115, 38, + 0,168,127, 39, 90, 26,141, 38, 98,232,208,161,178,236,236,108,200,229,114, 88,173, 86,220,184,113, 3,141, 26, 53,226, 44, 22, + 75, 83,103,245,154, 53,107, 54,118,206,156, 57, 62, 59,118,236,176,174, 95,191,222,252,216, 99,143, 41, 94,125,245, 85,183, 30, + 61,122,116, 15, 12, 12,100,191,251,238, 59,243,222,189,123,173, 47,188,240,130,106,246,236,217, 62, 59,119,238,124,246,252,249, +243, 27,239,117, 58, 41, 20, 74, 53, 6, 75,167,211, 29,210,233,116,141,223,120,227,141,248,241,227,199,255,161,211,233, 68, 0, +184,113,227,134,106,200,144, 33,217,195,134, 13,187,105, 48, 24,184,165, 75,151, 6,127,245,213, 87,123,116, 58, 93,186, 94,175, +239,232,200,189, 12,192, 68,150,101,223,238,219,183,239, 33,158,231,179, 55,111,222,252,211,240,225,195,187, 73,146,228,178,127, +255,254,223, 69, 81,252, 6,192, 23, 78, 68,199,184,176,176,176,104, 47, 47,175, 73,203,150, 45, 83, 53,108,216, 16, 90,173, 22, + 69, 69, 69,193,151, 47, 95, 14,154, 56,113,226, 96,141, 70,179,216,221,221,253,131,216,216, 88,222,209,123,174,191,191,255,127, + 92, 93, 93, 63,249,244,211, 79,213, 45, 90,180, 96,180, 90, 45,146,146,146, 90, 30, 63,126, 60,242,219,111,191,125,149,101,217, +153,233,233,233, 14,167,179, 39, 32, 51, 55,246,222,237, 26,218,178,215,242,149,223, 50, 94, 46, 90,200, 24, 6,188,213, 42,207, + 50, 24,195,222, 26, 55,230,167,206,170, 75,199,138,228, 89,125,226,226, 96,189,199,101, 65, 0,176,157,227,184, 33, 74,165,146, + 29, 50,100, 8,246,238,221,203,152, 76, 38, 25, 0,168,213,106, 97,200,144, 33,208,104, 52,176, 88, 44, 18, 74,170,243, 4, 0, +170,210,245,205,213,105,202,229,114,182, 87,175, 94,134,211,167, 79,231, 26, 12, 6,185, 77,179, 87,175, 94,245, 84, 42,149,150, +231,121, 71, 53,239,166,169,196,149, 43, 87,110, 51, 66, 55,111,222, 68,110,110, 46,204,102, 51,147,151,151, 7, 81, 20, 97, 54, +155,179, 69, 81, 4,203,178,182, 50, 93, 41, 10,133, 2, 9, 9, 9,183, 77,183, 90,173, 48, 26,141,224,121, 30,133,133,133, 26, +181, 90,221,184, 91,183,110,105, 0,182,232,245,250,249,231,206,157, 75,166,151,167,251, 70,202,239,103, 76,193, 0,172, 0,174, +221,161,113,151, 0,224,200,145, 35,200,202,202, 66,118,118, 54,178,179,179, 17, 20, 20, 4, 66,136,211,209,255,248,248,248, 69, +109,219,182,101,206,158, 61,187, 13,192,202, 77,155, 54, 13,189,117,235,214,178,201,147, 39,215,155, 55,111,222,173, 41, 83,166, +140, 3,240,219,166, 77,155, 94,105,213,170,213,160,243,231,207,127,121, 63,210, 73,161, 80,170,105,228, 78, 8,241,111,210,164, +201,173,133, 11, 23, 54,155, 54,109, 90,125,189, 94,207,149, 70,137, 76, 0, 96, 48, 24,184,169, 83,167,122,207,157, 59,183,153, + 74,165,202, 19, 4,193,187, 18,153,202,186, 90,190,237,230,230, 54,248,234,213,171,155,154, 53,107, 86,111,206,156, 57,103, 92, + 92, 92,200,151, 95,126, 25,219,168, 81, 35,191,228,228,228,181,110,110,110,189, 1, 76,170, 34,105,183,105,134,134,134,126, 52, +124,248,240, 73,199,142, 29, 83,181,110,221, 26,174,174,174,224, 56, 14, 30, 30, 30,232,212,169, 19,115,248,240, 97,213,128, 1, + 3, 38, 20, 20, 20,204,115, 84, 51, 32, 32, 96, 82,191,126,253, 62, 61,125,250,180,166, 79,159, 62,140, 82,169, 68,126,126, 62, +148, 74, 37,186,116,233,194, 44,251,122,137,166,101,139,230, 31, 5, 6, 6,206,114, 84,211,220,196,107,207,200,241, 83,123,111, +223,185,155,241,245,245,197,213, 47,102,225, 72,143, 72, 36,126, 60, 13,126,126,126,216,182, 99, 23, 51,112,212,248,110,110,188, +239,126, 71, 53,235, 0,123,205,227,145,145,145, 49,113,113,113,232,222,189, 59,126,250,233,167,214,147, 39, 79, 30, 63,121,242, +228,241, 63,253,244, 83,235,238,221,187, 35, 46, 46, 14,145,145,145, 49, 40,105, 43, 53, 30,192,173,210,207,248,234, 52, 15, 29, + 58,132,222,189,123,231,109,218,180,169,209,140, 25, 51,102,207,152, 49, 99,246, 79, 63,253, 20,214,187,119,239,188, 67,135, 14, + 57,171,121, 55,242, 94,102,168, 42,126, 8, 33,144, 36, 9, 62, 62, 62, 55,119,236,216, 65, 6, 14, 28,200, 53,104,208, 32, 99, +200,144, 33,170,147, 39, 79, 18,134, 97,182, 59,147, 78, 66, 8,140, 70, 35,140, 70, 35,174, 93,187,166, 89,188,120,113,183, 73, +147, 38, 53,249,241,199, 31, 3, 38, 76,152, 48,206,205,205, 45,182,117,235,214, 33,247, 58,239, 84,179, 44,242,120,163,212, 92, + 21,179, 44,155, 82, 91,205, 97,195,134,181, 12, 9, 9,241,253,241,162, 39,242, 20,205, 32,202,221, 33, 41, 60, 32,214,239,128, + 68, 69, 63,248,251,251,251, 6, 7, 7,119,113, 50,157,123,206,158, 61,219, 31,192,114, 0, 34,128,159,167, 76,153,242, 58,195, + 48,191, 76,153, 50,101, 12,128,159, 75,167,175, 58,127,254,252, 32, 0, 7,238, 83, 58,105, 89,162,154,117, 10, 33,164, 3, 33, +228,201,210, 79, 71, 66, 72,167, 10,255,149, 21,150,123,172,138,239, 39, 43,252,239, 80, 97,189, 14,117,109,176,136,221,199,246, + 68,195,127,254,249,231, 39,190,253,246,219,189,153,153,153,126, 97, 97, 97, 79, 14, 29, 58, 52,164,176,176,144, 29, 54,108, 88, +168,159,159,223,192, 3, 7, 14, 52, 24, 54,108,216,254,225,195,135, 31,103, 24,198,145,118, 51,141, 56,142,123,231,236,217,179, + 71, 67, 67, 67,173, 25, 25, 25,174,109,219,182, 45, 2,128,240,240,112, 67,110,110,174,198,213,213, 21, 59,118,236, 56,197, 48, +204,104, 0,205,106, 18,244,243,243,107,235,229,229, 53,233,147, 79, 62, 81,113, 28, 87,233, 50, 42,149, 10,159,124,242,137,202, +205,205,237, 13,127,127,255,206, 53,105,250,250,250, 70,184,186,186, 70, 47, 94,188, 88,109,177, 88, 96,181, 90,225,235,235, 11, +157, 78,135,204,204, 76,164, 95,191,142,155, 73, 73,152,240,218,107, 26, 23,141,230, 29, 63, 63,191, 54, 53,105,118, 11,209, 13, +209, 5, 52,127,244,173,183, 39,226,210,196,215,176, 55, 64,137, 6,111, 79, 69,235,131, 23, 16, 56,115, 62, 14,132,185, 33,230, +153,199,241,206, 59,239, 66,225, 19,246, 72,151, 64,151,145,247, 37,164, 41,147, 17,149, 74, 5,147,201, 36, 59,114,228, 72,119, + 65, 16,228,130, 32,200, 15, 31, 62,252,232, 31,127,252,209,127,206,156, 57, 79,104, 52,154,113,157, 59,119,254,158, 97,152, 69, +132, 16, 13, 33, 68, 3, 96,158, 93,228,233, 54, 77,185, 92, 14,163,209, 40, 63,125,250,244, 24, 81, 20,149,162, 40, 42, 79,159, + 62,253,230,129, 3, 7, 94, 92,190,124,185,211,154,247, 10,142,227, 32,147,201, 32,151,203,209,166, 77,155,171, 27, 54,108,224, +253,253,253,101, 43, 86,172,240,244,241,241,113,249,254,251,239,243,243,242,242, 62,119, 70,211, 98,177,192,108, 54,195,104, 52, +226,200,145, 35, 13,223,120,227, 13,153,197, 98, 17, 71,141, 26,117,139,231,121,243,155,137,186,117,110, 0, 0, 32, 0, 73, 68, + 65, 84,111,190,233,166,211,233,222,165,207,127,247, 7, 66,136, 8,160, 24,128,158, 16, 98, 6,128,144,144, 16,149,191,191,127, +171,144,144, 16,135,203,163, 94,175,255,102,193,130, 5,129,172,202, 3, 71, 45, 3,176,137,204,194, 30,143,175,145, 29, 58, 25, +190, 65, 77,208,175, 95, 63, 31,134, 97,150,212, 65,146,183, 0, 24, 14,224,215,218,172,124,183,211,217,190,125,251,238,237,218, +181, 59, 29, 21, 21,149,217,174, 93,187,211,237,219,183,239,126,167, 25,158, 57, 6,143,205,125,139, 77,155, 53, 22,100,238, 91, +108,218,204, 49,120,140,150,220, 7,227,244,171,232, 69,236,240,102, 24,102, 59,195, 48,219,167, 79,159,222, 11, 64,253, 10,255, + 31,177, 95, 14,128,178,178,111,219,199,110,186, 55, 33,228, 73,187,245,188,235,236,126,106,247,187,210,106, 14,111,111,111,203, +123,239,189,119,214,100, 50, 93,248,254,251,239, 27,143, 31, 63,190,109, 72, 72, 72,194,176, 97,195,126,215,106,181,130,173,141, +142,131,188, 54, 96,192,128, 29,245,234,213, 99,114,114,114, 20, 22,139, 69,118,227,198, 13,133, 40,138, 12,199,113,196, 96, 48, +200, 18, 19, 19,229, 86,171, 85,234,220,185,243,214,227,199,143,143, 6,240, 78,117,130, 90,173,246,205, 21, 43, 86,168,171, 50, + 87,162, 40, 66,175,215, 67, 16, 4,204,156, 57, 83, 61,105,210,164,137, 0, 78, 84,167, 41,151,203, 39, 44, 92,184, 80,109,171, + 2,146, 36, 9,177,177,177,200,185,121, 19,230,162, 66, 88,138, 10, 97, 41,200, 3,171, 47,192,139,253,159, 80, 47,255,117,243, +127, 1,188, 88,237, 77, 85,165,155,251,253,202,111, 33,138, 34, 50, 54, 87,222, 36,226,214,177,131, 16, 5, 30,179, 63,155,199, +188,243,218,136, 57, 64,241,166,127, 74,169, 87, 42,149,236, 23, 95,124,209, 76,169, 84,130, 97, 24, 98,177, 88,208,162, 69, 11, +230, 14, 53,185, 69,139, 22,181, 85, 40, 20,140, 77,179,101,203,150,204, 63,237,140, 87, 40, 20,208,104, 52, 8, 13, 13, 53, 14, + 26, 52,232,248,162, 69,139,130, 57,142,211,202,100,178, 93, 5, 5, 5,115, 46, 93,186,228, 84, 53,146,217,108,134,201,100,130, +201,100, 66, 74, 74, 74,131,198,141, 27, 51,255,249,207,127,196,226,226,226,176, 85,171, 86, 93,217,180,105,147,118,201,146, 37, +195, 0,188, 77,175,183,247,150, 70,141, 26, 41, 1,184, 7,215,151, 21,203, 57, 20,103, 10,130,111, 64, 64,192, 84, 65, 16,218, +135,135,135,123, 38, 38, 38,230,249,251,251,159, 96, 89,118, 99, 90, 90, 90,102, 13, 70,141, 17, 4, 1, 99, 58,230, 99, 92,103, + 22,130, 32, 32, 63, 63, 31, 41, 41, 41,184,120,241, 34, 78,158,188, 88,171, 52,134,134,134,190,166, 86,171,251, 42,149,202, 80, + 81, 20, 89,131,193,144,108, 54,155,247,102,100,100,124, 83,197,141, 9,247, 35,157,118,250,243,135, 14, 29,234,239,238,238,142, + 51,103,206,248,159, 59,119,110, 62,128,246,119,116,237,144,179,223,141,122,125, 73, 64, 61, 15, 15, 36,197,109, 11,216,178,243, +199,239, 0, 41,144,150,224, 7,130,170,238, 1,217,132,144,129,165, 1,160,237,115,230,204, 25, 88, 90,190, 6,218,255,119,160, + 60,222,182, 28,195, 48,219, 43,155, 94,151, 6,139, 84,147, 49,168,213,106,113,236,216,177, 9, 91,183,110, 13,109,223,190,253, + 95, 85, 53, 6,174,129,174,205,154, 53, 75, 62,117,234, 20,241,246,246,182, 72,146,196,104,181, 90, 81,163,209, 72, 5, 5, 5, +224,121,158, 36, 39, 39,203, 82, 82, 82, 20, 94, 94, 94, 10, 0, 53,134,234,228,114,121,151,134, 13, 27, 86, 25, 41,208,235,245, + 40, 42, 42,130,217,108,134,175,175, 47,195,178,108,167, 26,195,122, 44,219,173, 89,179,102, 76, 94, 94, 30,252,253,253,113,244, +232, 81,232, 11,242, 97, 46, 42,130,185, 32, 31,214,194, 2,136,133,249,200,191,153,137, 80,191, 64,134, 97,152, 46, 53,105, 10, +156, 38,196, 71,231,130,196, 89, 83,209, 33, 54, 25,140, 92,129, 83, 45,253, 64,248,146,166, 86, 29,207,103,128, 81, 40,241,215, +132,151,209,224,249, 55,192,179,170,128,251, 81,178, 5, 65, 96,204,102, 51,212,106,181,208,189,123,247, 35, 28,199, 61,170, 84, + 42,217,113,227,198,225,198,141, 27,229, 78,128,113,227,198, 65,163,209,192,108, 54, 11, 0, 38,163,138, 54, 83,130, 32, 48, 60, +207, 67,163,209,240,237,219,183,255,134,227,184, 55,149, 74, 37,215,180,105,211,172,185,115,231,102,184,184,184,184,164,164,164, +220, 82, 42,149,105,161,161,161, 29, 53, 26, 77, 72, 77,154,247, 18,149, 74, 5,153, 76, 6,150,101, 81,191,126,253,226,220,220, +220,147,215,174, 93,123,174, 54, 90,162, 40,194, 98,177,128,231,121,152, 76, 38, 72,146,132,115,231,206, 65,165, 82,201, 69, 81, +188, 40,138,162, 86, 46,151,131,227, 56, 58, 70,221, 61, 38, 42, 42,234,209, 80, 13,230,143,243, 51,123, 54, 26,232,162,215,170, +184,226,103, 55,243, 29, 30,123,236,153, 39, 38, 79,158,170,243,242,242, 82, 94,191,126,221,244,229,151, 95, 54,252,237,183,223, + 24,148,180, 19,173,146,140,140,140, 95,230,206,157, 91,239,209, 71, 31, 13,147,203,229, 76,126,126, 62,178,179,179,113,243,230, + 77,164,164,164,144,164,164,164,171,130, 32,252,228, 76, 26, 91,181,106,181,106,224,192,129,163, 90,180,104, 33, 39,132,128,231, +121, 24, 12,134,182, 39, 79,158, 28,124,244,232,209,238,215,175, 95,119,186, 92,102,102,102,254,244,217,103,159,185,244,236,217, +179,153, 92, 46,103,235, 34,157, 21,110,104,254, 58,157, 14,123,247,238,133,155,155, 27,106,234,173,235, 8, 86, 65, 10,168,231, + 81, 31,166,203, 11,224,239, 22, 2,171, 32, 5,208, 18,252, 64, 69,177,152, 74, 76,208,255, 8, 33, 79,222,169, 25,186, 91,102, +170, 86, 17, 44, 27, 55,110,220, 80,233,245,122,153, 36, 73,172,217,108,150, 75,146, 4,185, 92,206, 59,185,189, 22, 67,135, 14, + 61,209,161, 67, 7, 67,105, 4, 67,112,119,119, 23, 10, 10, 10, 80,106,176, 36,153, 76,102,210,233,116,166,176,176, 48,192,129, + 42, 66,163,209, 24,172,209,104,110,155,110, 48, 24,160,215,235,203, 12,150,193, 96,128,155,155, 27,138,139,139,107, 60,185, 69, + 81, 12,213,106,181,200,200,200, 0, 0,232,243,243, 96, 42, 44,132,181,168, 0,214,252, 60,240, 5,249,224, 11,242,192, 26,141, +240, 8, 12,130, 32, 8, 65, 53,105, 22,155, 69, 37, 7,130,155,219,127,129,239,155,147,171, 92,238,214,145, 3,208, 53,110, 10, +163,209,122, 63,198, 40,235,114,241,226,197,118,205,155, 55,199,144, 33, 67,240,204, 51,207,156,211,104, 52, 62, 75,150, 44,105, +145,158,158,126,219,194, 79, 61,245, 20,222,126,251,109, 12, 29, 58,116,237,217,179,103,151, 86,167,217,179,103, 79,244,234,213, +171,222, 51,207, 60,147,164,211,233, 98, 86,174, 92,217,113,230,204,153, 89, 6,131, 33, 61, 38, 38,166, 85, 90, 90,154, 54, 60, + 60,252, 96,100,100, 36,187, 99,199,142,144, 26, 52,239,181,233, 4,207,243,176, 90,173, 48,155,205, 32,132, 56, 28,101, 35,164, +124, 64,129,231,249,178, 30,132, 38,147, 9, 60,207, 51, 91,182,108,198,182,109,219,216,184,184, 75,129,211,166, 77, 71,126,126, + 62, 68, 81,164,151,217,123, 68,187,118,237,250,203,136,180, 98, 68, 3, 94,253,130,175,160,151,177, 68,127,249,219, 15,138,207, +121,200,204,230, 98,198,245,253, 15, 62,240,188,114,229,138,245,179,207, 62,203, 28, 50,100,136,250,245,215, 95,111,190, 99,199, +142,238, 65, 65, 65,223,166,166,166,230, 87, 21,248,236,220,185,243, 9, 79, 79,207, 70,235,215,175,207,202,200,200,168,199,243, +188,214, 98,177, 88, 45, 22,203, 21,171,213,122,212, 98,177,236,189,113,227, 70,140, 51,105,213,233,116,173, 71,142, 28, 41,207, +203,203,131, 76, 38,131,213,106, 69,118,118, 54,162,162,162,184,125,251,246,181,168, 77,254,227,226,226, 22,228,231,231, 31,220, +182,109, 91, 95, 23, 23,151,118, 74,165,178,129, 40,138,162,201,100,202, 50,153, 76,103,107,147,206, 10, 55,180,140,216,216, 88, +127, 87, 87, 87,164,167,167,131, 97,152,140, 59, 61,102, 10, 57,155,154,244,215,214, 32,127,183,134,136,143, 63, 1,133,156, 77, +165, 35, 6, 61,216, 17, 44,187,182, 82, 3,107, 48, 73,198,105,211,166,189,199, 48,204,246,105,211,166,189, 87, 77, 4, 75,180, + 95,206,110,249, 58,123,168,175,246, 38, 94, 84, 84, 36,251,223,255,254, 87, 63, 37, 37, 69,215,160, 65, 3, 67,100,100,100, 62, +195, 48, 68, 20, 69,246,214,173, 91, 46,105,105,105,106, 79, 79, 79,115, 80, 80, 80,129,131,219,187,252,214, 91,111,245,156, 49, + 99, 70,204,227,143, 63,158, 3, 0,121,121,121,200,206,206,182,245,210, 66, 70, 70, 6,123,250,244,233,122,187,118,237,106, 11, + 7,122,240,104, 52,154,148,162,162,162,166, 30, 30, 30,101, 55, 52,155,169,178,255,182, 90,173, 40, 42, 42,130,139,139, 75,141, + 39, 55,203,178,233,233,233,233,141,141, 70, 3,146, 19, 19, 97, 46, 42,128,181,176, 0,124, 97, 62,248,252,124,136,249,183,192, +234,139,160,211,104, 80,116, 43, 23, 28,199,221,168, 73,211, 69,197, 89,120, 65, 84,122,247, 27, 12, 48, 85,223,159, 61, 58,117, + 3,137,104, 13,141,230, 87,254, 30, 23,106, 25,128,129,182, 49,169, 52, 26, 13, 62,253,244, 83,196,196,196, 72,213, 85, 3, 43, +149, 74,176, 44, 43, 58,162,169, 82,169, 52, 51,102,204,208,156, 61,123, 86,173, 84, 42,161,211,233,180,103,207,158,109,245,231, +159,127,178, 6,131,129,107,220,184,241,208,128,128, 0,125, 13,154,119,213, 72, 85, 54, 77,175,215,151,181,155,186,117,235,150, + 76,173, 86,135,119,239,222,253,184,197, 98,249, 73, 16,132,213,177,177,177,133, 85, 62,105, 91,111,239, 12, 42, 73, 18, 4, 65, +128, 32, 8,144,201,100,210,150, 45, 91,241,213,210, 69,248,121,211,175,164,103,207,158,204,142, 29, 59, 32, 73, 82, 26,189,206, +222, 27, 36, 73,154,127, 96,234,211,106,136,162,222,124,112, 67,241,238, 92, 89,241,183, 23, 14,156,206,229,205,170, 38, 77,194, + 34,220, 92,221,217,239,215,125,123, 43, 51,235,234,229,175,190, 74, 11,154, 61,123,182, 71, 88, 88,152,123, 66, 66, 66, 0,128, +252, 42,140, 80,232,203, 47,191,252,234,173, 91,183,228, 43, 87,174, 92,147,158,158,126, 24,192,213,138, 65, 51,148,180, 51,148, + 3,240, 69, 73, 15,218, 61, 0,214, 86, 99, 86, 36,134, 97,112,240,224,193,219,122,251, 73,146, 84,107,135,145,153,153,153,215, +169, 83,167,214,151, 47, 95,222,146,159,159,191,190,146,235,236,224,200,200,200,103, 79,157, 58,245, 33,128, 43, 78, 70,176,222, +137,139,139,251, 92,146,164, 16,150,101,147, 9, 33, 83,238,244,152, 89,172,210,235, 91,119,110, 90,105,225,197, 96,165,156, 75, +177, 88,165, 55,104, 73,126,224,177,181,145,130,189,113,170,196, 24,253, 57,103,206, 28,205,220,185,115, 49,103,206,156,139,149, + 69,176,108, 70,107,206,156, 57, 23,109,203,217, 45,127,184,174, 13, 22, 83,201,141, 69, 55,125,250,244,174,109,219,182,205,120, +244,209, 71, 51, 27, 54,108,104,176,205,211,106,181, 22, 15, 15, 15,139,217,108, 86,101,100,100,120,255,245,215, 95, 13, 37, 73, +210, 56,176,189,253, 30, 30, 30,245, 78,159, 62, 93,127,227,198,141, 77, 98, 99, 99, 67,158,127,254,249,158,102,179, 25, 22,139, + 5,215,174, 93, 11, 89,177, 98,133,164, 80, 40,242, 25,134,249, 31, 74,122,195, 84, 11,207,243,199, 47, 95,190, 28,222,169, 83, + 39,134,231,249,114,166,202,254,183, 82,169, 68,122,122, 58,145, 36,233,164, 3,233, 60,113,250,212,169,198, 45,155, 55,135,185, + 32, 15,150,194,124, 88, 11,242, 33, 20,228, 67, 42,204, 7,171, 47, 66,253,122,114,104, 52, 46,184,156,145,137,210,180, 86,139, + 92, 48, 38,165, 23, 20, 54,109, 28,253, 5, 14,132,185,129,240,214,178,106, 65, 0,101,213,133,143,252,149,141, 35,127, 30,135, + 76, 52,167,223,207,146,108,177, 88,164, 97,195,134,157, 98, 89,182,206,222, 55,197,243,188, 52,126,252,248, 50,205,212,212,212, + 91,169,169,169,106,163,209,200,234,116, 58,253,253, 62,123,121,158,175,212, 32, 89, 44, 22, 24,141, 70,100,102,102, 42,247,236, +217,211,253,248,241,227,138, 75,151, 46,225,248,241,227,109,182,108,217, 50,189, 89,179,102,173,227,227,227,111, 56, 98,218, 36, + 73,130,237, 62, 72, 8, 1, 33,132, 3,128,173,191,109, 71,191,126,253,152,162,162, 34,108,219,182,173, 78,170, 81, 40, 14, 83, + 12, 65,212, 88, 14,109, 40,126, 55, 81, 89,120,209, 32,251, 36, 38, 38,102,247,128, 1, 3,142,248,251,134,185, 1,128, 74,161, +243,230,136,171,206,219,219, 91, 5, 0,254,254,254,237,120,158, 95,154,158,158,222,173, 50,193,167,158,122,234, 17, 31, 31,159, +182, 59,119,238, 60,155,158,158,126,164, 18,115,133,166, 77,155,206,188,112,225, 66,127,185, 92,206,216, 93,252, 73, 85, 6,107, +216,176, 97, 77,149, 74,101,253, 29,151,221, 81,168,104, 12,137,205, 7,225, 84, 16, 61, 90, 35, 89,209, 2,190,190,127,213,215, +106,181,109,174, 94,189,122,214,201,252, 7,143, 24, 49,226,247, 85,171, 86, 69,244,235,215, 79,121,236,216,177,219, 12, 86, 68, + 68,196,176,125,251,246, 13, 31, 55,110, 92,235,245,235,215, 15, 2,144,232,168,120,108,108,236, 49,148,188,177,161,206,248,232, + 27,236, 5,196,144,210, 64, 4, 45,193, 15,120,244,170,148,108,187,232, 83, 54, 0,166,194,255,179,165,231,144,133, 16, 98, 91, + 54,219, 46,106,101,169, 16,245,170,108, 94, 54,195, 48,117, 22,220,144, 85,243,228,189,231,218,181,107, 29, 70,140, 24,145,109, +111,174,236,171, 71,116, 58,157,217,205,205, 77,127,234,212, 41,127, 81, 20, 15, 58,176,189,149,251,246,237, 59,176,120,241,226, + 13,245,234,213,227, 95,124,241, 69,118,234,212,169, 71,114,115,115, 73,110,110, 46,150, 44, 89,210,163,123,247,238, 71,146,147, +147,197,152,152,152, 87, 0,244,171, 73,208, 96, 48,124,253,230,155,111, 62,123,228,200, 17,181,197, 98, 65,126,126,254,109,209, + 43,158,231,193,113, 28,150, 46, 93,106, 46, 46, 46, 94,228, 64, 36,227,155,175,191,254,122,248,138,175, 22,171,101,188, 21,134, +252, 60,136,165, 31,206, 84, 12,157,154, 69,227,182,222,200,207, 80, 97,221,206, 99, 70, 65, 16,190,174,209, 96,153,244,147,199, +141, 25,189,125,207,254, 3,168,223,173, 55,114, 14,236,186, 61, 26,228,237, 11,139,213,138, 79,102, 69, 19,198,152, 63,245, 94, + 7,112, 0,108, 47, 29, 77, 29, 0,182,159, 61,123,246,120,155, 54,109,250, 91, 44,150,234,140, 24, 36, 73,226,106,163,169, 82, +169,210,154, 54,109,186,191, 81,163, 70, 67, 1,160,121,243,230,191,177, 44,219,187, 6,205,187,106,176,102,204,152,129,185,115, +231, 98,218,180,105,101, 6,201,246, 0, 96, 54,155, 27,238,218,181, 75,121,236,216, 49,178,110,221,186,156,167,159,126,218,227, +249,231,159,247, 88,191,126,253,127, 0, 76,173, 74,115,202,148, 41, 88,190,124, 57,198,142, 29,123,219,124,142,227,164,244,244, + 52,152, 45,102,178,117,235,214, 12,153, 76,230,249,229,151, 95,106, 38, 77,154,196,208,107,237,189, 65, 20,197,247,187, 45,216, + 50, 17,208,240,130, 32, 44, 58,127, 62,230, 96,105,212,198,103,193,130, 5, 74, 0,248, 98,222, 23,114, 66,136,220, 54, 48,236, +199, 31,127,172, 30, 51,102,140, 79, 85,154,191,252,242, 75,222,199, 31,127, 92,255,245,215, 95,239,119,224,192, 1,245,169, 83, +167,118,161,228, 45, 5, 57,165,142,192, 43, 33, 33,225,152,183,183,183,223,166, 77,155, 26,247,237,219,215,165, 70, 23, 88, 92, +252,237,178,101,203, 66,231, 31,118,197,142,226,161, 72, 37,207,128,212, 35,168,167, 40, 66,115, 93, 10,122,250,165,250,175, 95, +191,126, 37,128,118, 78,100,191,197,211, 79, 63,189,121,213,170, 85, 13, 71,143, 30,157,118,236,216,177, 84, 0, 51, 43, 46, 20, + 19, 19,147,251,242,203, 47, 39,175, 89,179,166,177, 36, 73,187, 55,108,216,208, 15,192,101, 90,122, 40,247,204,121, 57, 16,200, +168,205,178,119, 19, 89, 53, 23,157,215,242,242,242, 34,167, 77,155,246,185,191,191,127,112,116,116,244,245,230,205,155, 23,219, +230,231,230,230,234, 14, 29, 58, 20, 86, 88, 88, 88, 36, 8,194, 40, 0,231, 42,145,105,137,242, 99,101, 36, 75,146,244,121,155, + 54,109,158,253,241,199, 31, 15,185,186,186, 22,158, 56,113,194,205,205,205,173,224,210,165, 75, 46, 28,199, 25,174, 94,189,138, +189,123,247,246, 0,240, 85, 21, 79, 73,229, 52, 51, 51, 51,207, 40,149,202, 47, 38, 77,154, 52,233,195, 15, 63, 84, 75,146, 4, +163,209,136,162,162, 34,152, 76,166,178,198,201, 27, 55,110, 52,155,205,230, 21, 25, 25, 25, 39, 28,208, 60,206,113,220,242, 69, + 95, 46, 26,255,198,179, 35,148, 36, 63, 23, 5,153, 70, 48,166, 98,232,212, 74,180,232, 29,128,226, 92, 6,171, 14,157,182,220, +178, 88, 55,101,100,100, 28,172, 73,243, 88,170,254,247, 78,202,196,189, 31,207,138,126,108,250,234, 95, 33, 73, 18,254,122,243, + 69,228, 29,222, 11,109,243, 86,120,228,175,108, 88, 44, 22, 76,155, 50, 9,156, 33,235,200,201,212,226,159, 29,216,159,117,129, +189,230,113,252,253,238, 50, 1,192,248,115,231,206,141,138,136,136,192,184,113,227,240,212, 83, 79,149, 91,113,243,230,205, 88, +182,108, 25,204,102,243, 40, 0,177, 0,150, 58,163,217,176, 97,195,142, 45, 90,180,224,252,253,253, 13,165,102,163,247,197,139, + 23, 59, 68, 68, 68,212,164, 89,231,121, 39,132,228, 37, 38, 38,186,205,155, 55,143,177, 90,173,152, 57,115, 38,108,198,210, 22, +113,122,255,253,247,253, 93, 93, 93, 49,127,254,124, 75, 78, 78, 78,159,220,220,220,125,139, 23, 47,246,218,184,113,227,115,118, + 6,203, 94,243,102, 92, 92,156,235,242,229,203, 89, 65, 16,176, 96,193,130,219, 34, 90,239,188,243, 14,172, 86, 30,114,153,220, + 98, 54,153, 91,104, 52,154, 43,158,158,158, 26, 73,146,200, 61, 60,238, 15,181,230,249,243,231,247,160,164,106,174, 82,108,237, +232,140, 70, 35,114,114,114,144,147,147, 3,119,119,247,138, 79,219,229, 52,141, 70,227,217, 41, 83,166,196,124,243,205, 55,253, +254,252,243,207, 17,135, 15, 31, 30,176,119,239, 94, 83,114,114,178,192,243, 60,241,243,243,147,117,235,214, 77, 61, 96,192, 0, + 23,149, 74,197,190,255,254,251, 57,159,126,250,169, 23,128,220,170, 52, 9, 33,156, 36, 73,248,111,247, 66, 76,233, 37,131,217, + 92,242, 64,153,145,145,142,139, 23, 47,226,248,241,120, 48, 12,195, 58,185, 63, 23,173, 95,191, 62, 76,169, 84, 50, 27, 54,108, + 8,222,176, 97,195,132,154,118,222,218,181,107, 67, 55,108,216,176, 20,192, 99, 40,105,248, 68,203, 18,213,164, 56, 99,176, 74, +185, 40, 8, 66,191,148,148,148,110,163, 71,143,254, 44, 34, 34,194, 44, 8,130,124,247,238,221,205,114,114,114,148,130, 32, 76, +129,243,245,149,203, 77, 38, 19,134, 12, 25, 50,165, 81,163, 70,251, 98, 99, 99, 91, 63,249,228,147,187, 55,111,222,220, 77, 16, +132,171, 23, 46, 92, 24, 5, 96, 81,169,193,114,136,164,164,164,153,123,247,238,101, 78,156, 56,241,238,180,105,211, 84,222,222, +222,140,135,135, 7,140, 70, 35, 82, 83, 83,201,154, 53,107,204,102,179,249, 43,119,119,247, 15, 28,213,244,246,246,158,122,248, +244,105,101,194,149,196, 87, 94,233,255,184, 58, 56,188, 41,116, 12,160,191,149,139, 67,135, 50,177,250,228, 89, 83,142,197,250, + 3,199,113, 14,119,165, 15,188,146,221,111,207,166, 85, 59, 15,238,223,255,216,236,185,159, 51,254, 47,188, 1,151,144,134,144, + 66,155,224,208,193,131,248,244,227,153,132,211,103, 29,230,175,100, 61,126, 31,203,132,205, 1,168, 0,204,147, 36, 73, 86,250, + 52,143,183,223,126, 27,246,175,206, 89,182,108, 25,140, 70, 35, 0,200, 24,134,153, 7,224, 59, 84, 61,162,123,101,154, 65,191, +255,254,123,144,189,102, 68, 68,132,163,154,117, 74, 86, 86,214, 7,175,189,246,218, 92,185, 92,238, 46, 73,210,109,141,211, 1, +192,197,197, 5,133,133,133, 16, 69, 81,168, 87,175, 94, 60,207,243,144,201,100, 85,158, 71,197,197,197, 31,140, 29, 59,246, 19, +134, 97,170,140,116,104, 52,154,228,163, 71,143, 54,121,254,249,231,217, 77,155, 54, 93,123,238,185,231, 84,127,254,249,167,136, + 90,142,105, 68,185,251, 16, 66, 80, 92, 92, 12, 84, 63, 36, 66,202,143, 63,254, 56, 37, 38, 38, 70, 61,118,236,216,118, 47,188, +240,130, 91,175, 94,189,116,246, 11, 24,141, 70,105,219,182,109,197,203,151, 47,207, 61,124,248,240,255, 94,125,245,213,161, 0, +170, 12, 23,103,100,100,252,190,100,201, 18,247,158, 61,123,134,139,162,136,156,156,156,178, 54, 88,105,105,105, 72, 78, 78, 78, +150, 36,105,171,147,217,121,243,249,231,159,223,177,102,205,154,144,209,163, 71,167,109,220,184,113, 43,128,202,218,212,234,134, + 13, 27, 54,120,205,154, 53, 33, 99,198,140, 73, 1, 48, 1,180, 85, 57,133, 82,167, 12,225, 56,238, 79, 0, 67,156,112,184, 85, + 17, 2,224, 19,148,212,155, 22,148, 58,225,217, 0, 26,213, 86,211,223,223,191, 85,120,120,248, 15, 77,155, 54,189, 30, 16, 16, +192, 55,109,218, 52, 57, 60, 60,124, 83,131, 6, 13,162,106,171,233,231,231,215, 53, 40, 40,104,119, 96, 96, 96, 78,112,128, 63, + 9, 12, 12,188, 21, 28, 28,188, 55, 32, 32,160,103,109, 53, 59, 5,233, 6,118,106, 26, 16,223, 46,178,137, 57,188, 81, 67, 18, +213,162,137,185,115,179,160,132,142,193, 46,195,238, 96,127,222,201, 83, 72,101,168, 0, 24, 72, 41, 12,195,240,109,218,180, 89, + 30, 21, 21,181, 52, 42, 42,106,105,235,214,173, 87, 48, 12,195,219,230, 3, 48,224,239, 65, 65,239,165,230,221,200,123,165,116, +235,214,109,237,134, 13, 27,196,217,179,103, 23,116,238,220, 57,119,246,236,217, 5, 27, 54,108, 16,187,117,235,182,182,182,154, +173, 91,183, 14,233,222,189,251,173,181,107,215, 10,151, 47, 95, 38,107,215,174, 21,186,119,239,126,171,194, 72,238,247, 61,239, + 15,163,230,240,225,195, 19,137, 29, 22,139,133,100,103,103,147,132,132, 4,114,228,200, 17,242,248,227,143, 39, 58,160, 41, 3, +208, 11,192,130,192,192,192, 61, 93,187,118,189,220,189,123,247, 43,141, 26, 53,250, 83,161, 80,172, 7,240, 50, 74,222,119,232, +135,146, 97, 73,124,171,211,244,243,243,235, 18, 17, 17, 49,187,109,219,182, 91, 59,119,238,124,172, 93,187,118,199,155, 54,109, +186,189, 97,195,134,115,253,252,252, 30,169,101,222,131, 71,140, 24,113, 81,175,215,139, 61,122,244,216, 86,217, 74, 81, 81, 81, +107,244,122,189,248,194, 11, 47, 36,160,228, 61,178,180, 44, 81,205,187,161, 73,121, 88, 11,138, 51,163, 56, 63, 32,121, 31, 95, +106,114, 12, 40,255,218,154,154,230,223,107,205,123,178, 63,155, 55,111,238,249,216, 99,143,189,185,117,235,214,119,175, 94,189, +250,238,214,173, 91,223,237,219,183,239,155,205,155, 55,247,188,147,116,182,110,221, 58,164, 91,183,110, 95,117,237,218, 53,173, + 91,183,110, 95, 85, 48, 87,244, 34,126,159, 52, 7, 13, 26,180,115,196,136, 17,137, 35, 71,142,188, 50,114,228,200,196,225,195, +135, 39, 14, 29, 58, 52,113,208,160, 65,137,253,250,245, 75,236,213,171,215,206, 7, 40,239,193, 29, 58,116,248,193,213,213,245, +133,202,102, 42, 20,138,193, 93,186,116,249, 25, 64, 99, 90,150,168, 38, 53, 88,212, 96, 81,205,186,209, 84,161,250,215,213, 84, + 54,255,126,104,210,227, 78, 53,169, 38,213,164,154,212, 96,253, 99,144,209, 93, 64,169, 1,243, 29,206,191, 87,154, 20, 10,133, + 66,161,252, 99, 96,170,113,161,206,244, 14,168,141,147,189, 64, 53,169, 38,213,164,154, 84,147,106, 82,205,135, 78,179,162,246, +211, 21,166, 87, 28, 7,114, 5,181,107,117,115, 96,168, 38,213,164,154, 84,147,106, 82, 77,170,249,240,105, 86,198,232,127,171, + 1,162, 47,148,165, 80, 40, 20, 10,133, 66,161, 6,139, 66,161, 80, 40, 20, 10,229,159,141, 67,141,220, 21, 10, 69, 36, 33,228, + 85,134, 97, 26, 48, 12,115,131, 16,242,157,213,106,189,248,176,237, 44,133, 66, 17,201, 48,204,171,132,144, 6,132,144, 27, 12, +195,220,215,253, 64, 0,102,102,116,201,104,210, 31, 69,131, 48,213, 15,124, 72,161, 80, 40, 20, 10,229,126, 27,172,144,192,192, + 17, 44,199, 44,182,242,162, 39, 47, 8,236,146, 37, 75,216, 65,131, 6, 97,219,182,109,152,240,246,219, 19, 88,142,149, 20, 50, + 89, 30,145,132, 9,201,105,153, 63, 58,178,177,161, 67,135,102,241, 60, 95,229,168,214, 28,199,221,220,178,101,139,239,157,102, +202, 63,234,153, 44,222,106,173,114, 59, 50,153,252,102,230,217,159, 29,218, 78, 96,160,223, 8,142, 97, 23,243,162,228, 41,138, + 18,251,213, 87, 95,149,237,135,183,222,122,107,130, 92, 38,147, 20,114, 46, 79, 18,201,132,228,180,180, 31,239,213,129,179, 55, + 87, 0, 48, 51, 26, 12,137, 6,168,201,162, 80, 40, 20, 10,229, 31,108,176, 24, 22, 75, 55,124, 51,207, 51,247, 86, 30, 54,110, +222,141,136,136, 8, 92,186,116, 9, 17, 17, 17,232,214,177, 53,251, 68,151, 54, 44,199,194,123,198, 87,235,150, 2,112,200, 88, +240, 60,239,243,219,111,191,129, 97, 24,136,162, 8, 65, 16, 32, 8, 2,120,158, 71, 81, 81, 17, 38, 78,156,232, 83, 23,153,226, +173, 86,159,171,255,251, 21,114,142, 1, 47, 18,240, 2, 1, 47, 72,176,138, 4,133, 6, 1,189,159,124,222,225,237,176, 96,151, +126,183,120,158,103,126, 65, 1,126,221,177,167,220,126,232,221,181, 3,251,204,128, 71, 89,173, 70,225, 61,122,234,103, 14,239, +135,186,192,222, 92,149,155, 22, 77, 13, 22,133, 66,161, 80, 40,255, 88,131,101,225, 69, 79,223,122,238, 88,253,221,119,152, 50, +237, 99, 52,107,214, 12,132, 16, 48, 12,131,247, 62,156,133,133, 31, 79,195,200,254, 61,192, 11,146,103, 53,250,183,117,213,100, + 24, 6,215,175, 95,135,209,104, 44,247,137,140,140,116, 52,205, 14,117,255,148,115, 12,126,143, 45,130,149,151, 96, 21, 74, 63, +188,132, 94, 45, 93,157,210,228, 69,201,211,195, 77,135,149,223, 44,195,148, 89,243,202,237,135,169,239,125,136,175,231,126,128, +119,198,189, 4, 11, 47,122,214, 38,157, 78, 66, 53,169, 38,213,164,154, 84,147,106, 62,168,154, 15,164,193,234, 9,224,160,205, + 3,149,153, 11,139, 9, 45,130,234, 99,217,252, 79, 64,192, 66, 34, 4, 32, 0,145,120, 52,244,210,194,104, 48, 56,189, 65, 73, +146, 96,181, 90,193,243, 60, 86,172, 88, 1,189, 94, 15, 73,146, 16, 17, 17, 1, 0,136,138,138,178,143,192,164,196,198,198,134, +212,164,233,221,114, 72, 50, 8,130,237,167,125, 52,239, 91, 28,139,189, 10, 66, 0,149, 70,139,225, 47,140,129, 40, 17, 88,121, +231,223, 79,106, 50, 24,224,167,147, 99,225,167, 31,130,149, 43,192,130, 1,203, 50, 96, 25, 9,205, 2, 61, 97, 46,121, 57,241, + 61,229,163,104,144,138, 81,172,143,162, 65,162,105,153,166, 80, 40, 20,202,191,147, 74,189,200,191,221, 96, 29,172, 44, 51, 22, +147, 17,129,158, 10, 52,208,185, 67, 16, 68, 92,180,250,161,200, 96,130,213,202, 35,217,106,197,149, 51,153,120,228,145, 71,192, +243,188,104,181, 90,161, 80, 40, 10,182,108,217, 82,175, 38,131,197,243, 60,172, 86, 43,138,139,139,177,126,253,122,200,100, 50, + 72, 82,137,241, 41,121,199,111,201,119,215,174, 93,131, 29,202, 5, 65,240,149, 83,191,192, 85,205, 65,144, 8, 4,129,128, 23, + 1, 81, 34, 48, 88, 36, 12,123,237, 3, 8,146, 4, 65,146, 96,113,192, 96,217, 27, 54, 1,192,144,233, 27, 1,232,202,230,187, +169, 8,166,116,101,161, 80,170,160, 84,112, 48, 27, 13,247,252,192, 49, 0, 33,209,127, 87, 21,210, 70,238, 20, 10,133, 66,249, +151,115,240, 65, 48, 86, 21, 13,150,189,123, 60,244,183,193, 50, 64,224, 69,240,130, 8,129, 23, 80,160, 55,226,243,207, 63,135, + 74,165, 2,195, 48,101,102, 73,146, 36,150,231,121, 12, 24, 48,192,179,166, 13,138,162, 8,171,213, 10,171,213, 10, 66, 8, 56, +142, 67,167, 78,157,110, 91,238,196,137, 19, 78,101,196, 85,205,161,225, 99,211,111,155,126,242,151, 79, 64, 8,129, 40,150,124, + 28, 49, 88, 53, 25,182,182, 61,159,129,217,194,131, 16, 0,164, 36,194,117, 63, 96, 0, 98,107,115, 21, 77, 79, 76, 10,133, 66, +161, 60, 24,148,243, 34, 15,138,193, 42,231, 30,205, 70, 35,120, 94,128, 32,136,224,249, 18, 99,164,209,104,208,163, 71,143, 18, + 31, 98, 23,109,218,189,123, 55,172, 86,107,141, 27,180, 53,106, 47, 53,102, 32,132, 96,227,198,141,144,203,229,101, 31,133, 66, +225,116, 70, 4,145, 96,250,212,255, 66, 33, 99, 33,151,177,101,223, 34, 33, 32,164,196, 28,137, 18,129,153,119, 44,200, 83,157, + 97, 3, 0,139,217, 10, 16, 2, 2, 2, 99,113, 49, 61, 29, 40, 20, 10,133, 66,169, 27, 30,136, 72,150,205, 96, 61,138, 74,170, +151, 44,198,226,210,232,149, 8, 94, 16,202, 12,212,252,249,243, 33,147,201,160, 84, 42, 33,147,201,202, 12,145, 35, 6,203,100, + 50, 33, 44, 44, 12, 22,139, 5, 17, 17, 17, 32,132,224,217,103,159,189,109,185, 83,167, 78, 57,149, 17, 94, 36,152,243,217,130, +219,166, 31,253,233, 99,180,106,222, 16, 29,155,184,192,100,149, 80,104, 16,238,216,176, 1, 40,137, 96, 1, 32, 4, 48, 22, 27, +232,233, 64,161, 80, 40, 20,202,157, 81,169, 23,249,183, 27,172, 67,149,185, 69,147,193, 0,129, 23,202, 76,150,197, 98,129, 36, + 73,120,251,237,183,111, 19,218,183,111, 31, 44, 22, 75,245, 27,147,201,110,190,241,198, 27,229,134, 72, 32,132,224,151, 95,126, +129, 74,165, 42, 23,197, 98, 24,231,204, 43, 47, 18, 68,191, 63, 9, 74, 57, 87,206, 16, 73, 18,176,237,247, 63,176,237,247, 63, +202,150,229, 56,249,205, 59, 49,108, 0, 96,177,148, 70,176, 8, 65,177,190,136,158, 22, 20, 10,133, 66,161,220, 25,149,122,145, +127,187,193,170, 20,147,177, 24,188, 93, 27, 44,171,213, 10, 65, 16,176, 98,197,138,114,213,121,114,185, 28, 44,203,214, 24,193, +218,188,121,115,185,193, 61,163,162,162, 8, 33, 4,195,135, 15, 47,171,110,124,229,149, 87, 48,122,244,104,167, 13,150, 32, 18, +204,156, 61,191, 76,103,192, 99,221, 49,164,127, 79, 72,165, 94, 56,251,226, 22,167, 4,171, 51,108, 0, 96, 49,151,180,193, 34, + 0, 12, 69,180,138,144, 66,161, 80, 40, 20,138, 3, 6, 75, 46, 99, 11,174, 36,223,112,247,114, 81, 67,144,204, 16,164,146,158, +127,162, 40, 98,244,232,191, 95,110,253,220,115,207, 97,212,168, 81, 85, 25,172,150,168, 97,172, 12, 73,146,112,244,232, 81, 48, + 12, 3,150,101,203, 62,213, 80,169,102,177, 89,194,177, 31,103, 65, 34, 4, 18, 1, 36, 82,226,167, 44,130, 67,209,198,219, 52, +107, 50,108, 42,157, 7, 56,150,128, 97,128, 43,105, 89,144,113,108,129,179,121,175, 5, 84,147,106, 82, 77,170, 73, 53,169,230, +131,170,249,112, 24, 44, 34,146, 9,203,183,159, 88,204,139,146,187,109, 90,139, 22, 45, 96,181, 90,177,107,215,174, 50,227,193, +113, 92, 89,149,158, 35,109,176, 42,144,210,163, 71,143,234,134, 98, 72,113, 72,133, 65, 74,251, 94, 35,130,171,155,239,108,194, +106, 50,108,171, 14,255,253, 10, 66, 25,203, 22,128,144, 9,180, 56, 81, 40, 20, 10,133, 66,169,214, 96,165,102,100,172, 3,176, +206,126, 90,155, 54,109,244,131, 7, 15,214, 8,130, 0,139,197, 2,171,213, 10,139,197, 82,246, 81,169, 84, 78,141,184,233,200, + 32,162,142,144,125, 97, 75, 72,157,238, 21, 7, 12, 91,102,102,102, 8, 45, 62, 20, 10,133, 66,161, 80,156, 50, 88,149, 97, 48, + 24, 60, 24,134,145,101,100,100,220, 54,239,198,141, 27, 64,201,184,156,255,122,234,220,176, 81, 40, 20, 10,133, 66,161, 6,171, + 42, 14, 29, 58, 36, 60, 40, 38,138, 66,161, 80, 40, 20, 10,229,110,193,210, 93, 64,161, 80, 40, 20, 10,133, 82,183, 48, 40,233, + 9, 80, 25,206,244, 14,104, 89,139,109, 95,160,154, 84,147,106, 82, 77,170, 73, 53,169,230, 67,167, 89,147,182,253,250,163, 1, +172,160,118,173,110, 14, 12,213,164,154, 84,147,106, 82, 77,170, 73, 53, 31, 62,205,202, 24,253,111, 53, 64,180,138,208, 25,162, + 70,203,233, 78,160, 80, 40, 20, 10,133, 82, 19,178,123,181,161,232,232,104,246, 14,215,151,238,219, 94, 10, 24,214,152,147,225, +243,214,193, 1,253,207,228, 14,221, 65, 68,102, 42,210,127,189, 66,139, 79,237,104,227, 2, 47,158,145, 15,244,212,169,135, 4, +187,202, 58, 39,230, 24,254, 52, 88,165,109,132,225,183,196, 21, 33,143,238, 33, 10,133, 82,233,165, 56, 32,192,243,216,177, 99, +193, 93,187,118, 77, 73, 79, 79,207,115,116, 94, 85,248,134,181, 27,229,170,211,190,105, 50,155, 27,186,187,185,221,188,149,155, +187, 60,243,218,153, 37,182,249, 13, 27, 54,116,219,176, 97,131,255,115,207, 61,151,113,253,250,245, 66,122, 4, 40,247,212, 96, +181,111,223,190,161, 36, 73, 47, 1,120,129, 16,114,246,204,153, 51, 79,215, 70,103,223,190,125, 1, 60,207,119, 16, 4, 33, 10, + 64,148, 70,171,107, 99, 54,155,110, 50, 32, 47,247,239,223,255,140,179,122, 81, 81, 81,191, 3, 24, 80,217, 60,134, 97,102,198, +196,196, 68, 59,170,197,201,240,249, 31, 91, 86, 13,201, 52,104,112, 40, 38,249,169,239,190,152, 6, 0, 67,255,137, 7,212,207, +207, 79, 3,224,101,150,101,251,168, 84,170,112,147,201,148, 4,224, 60,195, 48, 75,211,211,211, 51,106, 41,203, 70,234,228,175, +105, 53,218,126,126,174,202,168,244,188,194,116,147, 85, 58, 34, 49,214,121,206, 26,162, 70,128,210,167,158,199,161,119,135,117, +139,104,221,162, 9,164,228,179, 48,229,103, 15,142, 73, 55, 12,254,230,228,205,255, 90,138, 12, 81, 87, 1,139, 35, 90,129,129, +129,126,162, 40,202, 50, 51, 51, 83,109, 23, 67,179,217,220, 30, 64, 4,128,191, 84, 42,213,233, 59,189, 40,254, 91, 52, 3, 2, + 2,252, 37, 73,122,221,215,215,247,201,172,172,172,223, 89,150, 93,117, 7,199,155,242,144, 16,210,233,197, 5, 12,203,120, 57, +179, 14,145, 72, 78,242,201,117,255,189,151,233, 36,164,100,164,231,128,128,128, 87,130,131,131,155, 16, 66, 18, 8, 33, 95, 86, + 56, 7,110,155,199, 48, 76,149,175,242, 8,105,209,101,243, 27, 47, 61,215,123,226,184, 87,116, 90,173, 6, 6,163,169,254,210, +149,223,127,177,116,229,250, 1, 73,151,142,245, 7, 0,127,127,255,161, 65, 65, 65,161, 22,139,229, 58, 33,228,251,154, 52, 41, +148, 59, 54, 88,205,155, 55,119, 81, 42,149,195, 89,150,125,185, 85, 84,231,110,131,159,121,153,225, 25, 45, 62,157,244,156,211, + 67, 56,196,198,198,170, 50, 51, 51, 63,110,216,172,221,127, 30,237, 59,132,109, 30,209, 12, 94,245, 61, 33,177, 74,172,217,117, +185,254,193,111, 94, 89, 2,160, 75, 45,146, 57,224,199, 29, 39,145,153, 47,130, 97, 0,134, 1, 88, 6,208,155, 36,188,247,106, +183,143, 0, 56,102,176,162, 70,203, 35, 26,248,244,191,124, 75,141, 93, 23,120, 0,254,208,122,250,246, 55,120,143,150, 35,118, + 5,255, 79, 58,152, 13, 26, 52,136,170, 87,175,222,215,175,188,242,138,103,120,120,184,159, 82,169,212,154, 76,166, 38,201,201, +201, 13, 23, 46, 92,248,120,131, 6, 13,230,222,184,113,227, 87,103, 52,155,185,171,130, 67, 27,248,254, 56,117,220, 75, 29,195, +195,130, 32,179, 20,131,152,245, 65,201,215,175,118,153,189,234,215, 55, 24,198,244,236,165, 66, 97,175,163,122,106, 87,197,251, +239,141,126, 54,162,177, 43,129,229,210, 81,200, 56, 2,181,171, 39, 58, 6,115, 96, 64,154, 71,239,207,120, 15, 69,214,143, 28, + 48,146,179, 68, 81,124, 15, 0,211,160, 65,131, 31,229,114,249,169,246,237,219, 55, 27, 57,114, 36,211,170, 85, 43,156, 57,115, +166,249,182,109,219,158, 22, 4, 33,222, 98,177,156,172, 95,191,254,217,184,184, 56,171,131,229, 91,145,155,155,219, 70,169, 84, +118,250, 39,107,250,249,249,105, 44, 22,203, 75,129,129,129,163, 31,121,228,145, 86,131, 6, 13, 98,154, 54,109,138,248,248,248, +118, 59,119,238,252,232,200,145, 35,231,211,210,210, 86, 40,149,202,239, 51, 51, 51, 29, 26, 4,120,120, 31,196,255,188, 15,205, +106, 59,191, 2, 30, 0,212, 0, 50, 29, 9, 38, 0,208, 2,184,118, 31, 52,239, 70,164, 37,142, 97,152,122,165, 55,100,219,131, + 93,185,223,246,223,162, 40, 22,167,164,164, 52,170, 78, 51, 40, 40,168,185, 36, 73,156,253, 52,185,188,234, 86, 11,130, 32, 72, +105,105,105,151,170,211,100, 88,198,107,197,215, 11,220,101, 44, 32,146,210, 15, 79, 32, 18, 2, 73, 2, 68, 9, 16, 37, 9,130, + 72, 32, 4,150,212,198, 0, 0, 32, 0, 73, 68, 65, 84, 17, 9,188, 64, 48,243,163,247,238,231,101,238, 73, 0, 61, 0, 28, 6, +176,168,154,121, 95, 86, 39,226,221,168,205,139, 47, 61, 59,188,215,123,147,222,212, 17, 66, 64, 8,129, 70,173,194,228,137, 99, +149, 38,147,165,171, 95,147,246,163, 51, 19, 79,175,100, 24,166, 23,128,246, 0, 78, 3,248,158, 90, 6,202,221, 50, 88, 76,187, +118,237,122, 16, 66, 94,110,224, 31, 56,124,216,243, 99, 52,161, 77, 90, 66, 47,185,225,122,142,132,216, 3, 27, 0, 96,147, 51, + 27,223,189,123,119,123, 66,176,122,220,180, 5,205, 90,183,237,128, 11,233, 2,142,165,138, 40,190, 34, 66,198, 25, 33, 73, 0, + 33,196, 92,219,204,165,229, 9, 56, 18,111, 1,199, 2, 44, 11,112, 44, 3,206,217,247,116,199,174,224, 47, 5, 15,221,241,199, +169,244,167,160,246,133, 33, 47, 29,134,188,172,157, 72,219,252,143, 50, 87,254,254,254,189, 67, 67, 67,191,156, 56,113, 98,131, +204,204,204,122, 39, 79,158,132, 74,165,130,167,167,167,204,203,203,171,217,180,105,211, 10,102,207,158, 61,217,199,199,231,204, +205,155, 55,147, 28, 50, 5, 46,138,136,238,173, 34,254,156, 49, 43,218,221, 28,179, 19,249, 63,255, 12,142,149,160,112,209,193, + 79,163,197,162, 39, 67,235, 77,219,157,250, 43,107,181, 68, 92, 48,153,210, 29,209, 12,242,169,215,183,113,120, 83,228,111, 95, +138,196,124, 51,142,103,153, 49,184,103,123, 52,246,212,160,173, 32,162,190, 90,214,187, 38,131, 21, 16, 16,224, 41, 73,210,212, +164,164, 36, 86,161, 80, 48, 13, 27, 54,124,118,197,138, 21,164,121,243,230,101,111,221,238,210,165, 11,186,116,233,194,232,245, +250,136, 99,199,142, 69,108,222,188,153, 47, 40, 40,136,201,200,200, 88, 83,117,100, 41, 44,197,108, 54, 5,153,204, 22,211,194, +133, 11,127,232,220,185,179,164, 84, 42,113, 39,154,165,198,119,189, 86,171,213,206,152, 49, 35,167, 67,135, 14,164, 46, 52, 67, + 67, 67,255,232,216,177, 99,175,190,125,251,202,186,118,237, 10,127,127,255,178,121, 94, 94, 94,232,222,189, 59,147,154,154,218, +250,200,145, 35, 75,255,248,227,143,197,103,206,156, 57,144,148,148,212,215,129, 67,212,244, 14,231,151, 11,254, 2,152, 3, 96, + 37,128, 99,213, 61,198, 0,120, 14,192,231,247, 73,179,250,135, 2,181, 58,203,100, 50,249,148,254,190,105, 50,153,124,107,188, + 88, 50,140,110,225,194,133, 62, 10,133, 2, 44,203, 66, 20, 69,136,162, 8, 73,146, 64, 8, 41,251,182,189,114,108,214,172, 89, + 98, 77,154,146, 36,177, 11, 22, 44,144,107, 52, 26, 0, 0,207,243,229,190,109,216,254,207,154, 53,203,161,107,148, 70,201,225, +195, 73,163, 59,178,162, 69, 93,237,246, 57,165,233,181,201, 95,158,186, 15,102,213, 51, 32, 32,224, 37, 0,131, 0,216,206,241, + 86, 1, 1, 1,251, 43, 44,218,170,244,187, 56, 32, 32,224, 0,128,223, 3, 2, 2, 86, 87, 86, 93,232,238,226, 58,246,221,183, + 95,119, 37,132, 96,230,207, 57,152,249, 75, 14, 62, 28, 90, 15,147, 7,104,241,234, 11, 79,187,172, 94,247,211,152,210, 50,102, + 35, 1, 37,189,238,105,244,138, 82,247, 6,171,109,219,182, 59,250, 15, 29,213,175,115,143,190, 16, 20, 62,136,191,201, 32,245, + 58,129,140, 19,192, 66,194,181,255,109, 33, 44,203, 86,116,248, 85,118,213,220,177, 99,199,127,131, 27,183,153,251, 94,244, 28, +238, 66,150, 18,171,143, 24, 33,154, 11, 96,204,185,130,226,155,151, 81,116, 35, 14,249,233, 23,206,179, 44, 27,237,168,230,237, + 97,101, 64, 34, 4, 12, 97, 0, 9, 37,231, 6, 91,169,195,170, 86,147,136,204,212,152, 63, 86, 63,213,118,200,116, 92, 62,178, + 14, 32,236, 84, 7, 54,127, 55, 94,130,121,161,138, 72,198,227, 33, 33, 33,243,198,140, 25, 19,120,238,220, 57, 55,131,193, 80, +124,234,212,169, 67,153,153,153,190, 94, 94, 94,169, 35, 71,142,124,196,199,199,199,167, 71,143, 30,218,221,187,119,191, 15,224, +245,154, 52, 35,181,138,200,174, 29, 90, 30,255,100,222,124,151,156, 95, 23,195,114,253, 28,142,103,153,112, 46,219, 72, 2,220, + 10,152, 17, 45, 61,225,162,148, 97,116, 39, 31,221,127,182, 37,125, 6, 19,158,119, 36,239, 13, 3,124, 27,241, 70, 35, 76, 70, + 43,118, 92, 46, 48, 30,207, 43,240, 97, 93,211,178, 39, 63,213, 94,205,229,100,160,129,171,188, 9,110, 58,183, 63, 25,134,129, + 86,171,173,116,158,187,187, 59,186,116,233,130, 70,141, 26,201,159,123,238,185,206, 0,214, 84,165,105,181, 90,253,210,211, 51, + 16,222, 52, 92,213,167, 79, 31,134,227, 56, 88, 44,150, 59,210, 4, 0, 23, 23,151, 65, 81, 81, 81,178,181,107,215,230, 39, 37, + 37, 93, 28, 54,108, 88,186, 86,171, 45,119, 67,213,106,181, 8, 14, 14,198,248,241,227,229,111,188,241, 70,141,154,190,190,190, +143,175, 91,183, 14, 12,195,148,221,188, 43, 18, 18, 18,130, 6, 13, 26, 96,192,128, 1,178,167,159,126,250,241,164,164,164, 42, +247,231,240, 62,136,183,153,167,225,125,170,191,137,148,206, 79,168, 36,146, 85, 49,157,185, 0,150, 3,248, 13,192,240, 42, 12, + 81, 87, 0, 63, 3,232, 15, 84,122,228,171,212, 84, 40, 20, 10,171,213,234, 89,137,241,113, 86,179,236, 84,143,137,137, 65,187, +118,237, 80,241,219,102,132, 24,134,241,113,244,220,228, 56, 14,203,150, 45, 3,203,178, 80, 40, 20,144,203,229, 80, 40, 20,183, +125,218,182,109,235,240,249, 46,151,203,177,108,217, 50,136,162,200, 38, 37, 37,189, 44,138,226, 16,147,201,228,163,209,104,178, + 21, 10,197,246,158, 61,123,126,167, 82,169, 4,103, 52, 89, 14, 96, 69,139,122,239,238,173, 46, 85,173,100, 54,155, 49,112,200, + 8,176, 12,123,207,175,117,199,142, 29, 11, 14, 14, 14,110, 90, 26,157, 2,128,195,233,233,233, 61,236,254,219,115, 56, 61, 61, +221,214, 52, 36, 49, 37, 37, 37, 56, 36, 36, 36,175,162,166,197, 98,109,168,211,185,128, 16,130,153,191,228,192,180, 54, 12,234, + 81,215,240,106, 39, 51, 92, 93, 93, 33, 8, 66,179,128,128,128,239, 1,132,151, 70,175, 6, 7, 4, 4, 52, 37,132, 28,104,216, +176,225,111,118, 85,250,247,236, 58,255,144,104, 86,115, 63, 39, 29, 0,120,219, 77,178, 0,176, 61,173,230,148, 26,224,250, 21, +166,219, 47,103,251,206,182, 5, 50, 75,215, 35,118,186,217, 12,195,252,175,174, 13, 22,177,115,231, 85,197,120,220,210,140, 30, +208, 95,247,130,140,149, 32,227, 24,200, 56, 0, 96,144,155, 22, 7, 75,113,238,209,152,152,152,235,142,108,116,215,174, 93, 93, + 66,155,119,252, 44,250,147, 47,216,239, 14, 27, 81, 96, 48, 33,231,210, 86,100,158,250, 54, 83, 18,172, 91, 89,150, 61,205,178, +108,108, 84,235, 86,241,126,126,126, 98,109, 51, 39,145,146, 16,119,153,177,146, 0,166, 54, 15, 32,233,191, 94, 65,216,251,229, +255,255, 67, 8, 8, 8,232, 31, 22, 22, 54,103,204,152, 49, 33,177,177,177,174, 69, 69, 69,217,123,247,238,141,183, 90,173,103, + 88,150, 93,148,145,145,209,115,221,186,117,218, 41, 83,166,244,109,218,180,105,211, 63,254,248,195, 80, 99,228, 74, 43,111,253, +194,139, 35,142, 15, 25, 61, 65,125,241,151, 37, 80,197,199, 98,197,165, 60,241,116,150,241,125,147, 94,248, 82,163,149,117,205, + 55, 9,123,222,237,238,199,250,185,202, 17,228,174,120,244, 92,145, 99, 47,250, 86,202, 85, 50, 34, 83,195, 98, 22, 80,108,145, + 44,113, 57, 40,126, 92, 16,173,196,197, 75, 13, 0, 50,142,173,209,244,167,167,167,231,249,249,249,125, 22, 26, 26,250, 1,195, + 48,164, 71,143, 30,151,218,181,107, 87, 44, 73, 18,140, 70, 35,172, 86, 43,228,114, 57,140, 70, 35,146,147,147,113,242,228, 73, +184,187,187, 59,181, 95,243,243,243, 17, 26, 26, 10,173, 86,123,199,154,146, 36, 49, 75,151, 46, 85, 95,188,120, 81,253,219,111, +191,213,251,239,127,255, 91,208,182,109,219,184,167,158,122, 42,181, 94,189,122,214,179,103,207,226,248,241,227,200,203,203, 67, +199,142, 29, 29,210,180, 90,173,144,201,100, 48, 26,141, 80,169, 84,144,201,100, 16, 4, 1,146, 36,149,153, 46,189, 94,143, 91, +183,110, 65, 46,151,215,248, 34,118,155, 89, 26,222, 7,228,167,159,255,188, 89, 82, 55, 84,200,195, 90,192, 67, 40,224,193, 23, +240,224,243,249,103, 38,206,111,253,243, 62, 56, 19, 7, 62, 81,106,174,126,174,196,100,117,181,155,126,214, 89, 77,171,213,122, +212,102,124,212,106,181,143, 45,186,160, 82,169,120,179,217,220,203, 73, 77,196,196,196, 32, 42, 42,138, 43,213, 36,132, 16, 91, +123, 27,167, 47, 26, 12,195,128,227, 56,200,229,114,112, 28,135,168,168, 40, 12, 26, 52, 8, 77,155, 54, 69, 90, 90, 26, 14, 30, + 60,136,203,151, 47, 67,161, 80,148,171, 58,172, 9,185, 92, 14,150,101,217,132,132,132,239,250,244,233,211,120,194,132, 9,202, +224,224, 96,196,199,199, 55, 88,186,116,233,168,125,251,246,245, 28, 58,116,232, 40, 0, 66,117,213,135,229,140, 96,169,105, 50, +155,205,136,139,139,171,126, 89,167,171, 0,238,156,174, 93,187,166, 16, 66, 18, 81, 82,245,215, 42, 61, 61,189, 71, 64, 64,192, + 14, 0, 21, 13, 97,113,122,122,250,128,128,128,128, 2, 0,231, 1, 36, 48, 12,147, 82,153,166,135,187, 91,182, 94, 95,236,235, +226,162,197,251, 67, 60,160, 30,117, 13,111,247,226,192,243, 60,174, 94,189,142,134,161,129,204,166,213, 91,108, 85,131,237, 79, +159, 62, 13,148, 84, 21, 38,165,166,166,250,119,234,212,137, 54,120,191, 75, 62,170, 26, 47,226,205, 48,204,118, 59,195, 53,208, +246,127,218,180,105,239,205,153, 51,231, 34,195, 48,219,237,167,219, 47,103,255, 93,122,142,110, 39,132, 12,156, 62,125,122,228, +220,185,115,103,219,150,189, 47, 17, 44,142,227,134, 93,216,245,229,137, 38, 86, 18,226, 27,249,100,185,253,144,124,118, 23, 36, + 73, 90,227,136,206,241,227,199,213,130,132,239,166,188, 55,139,253,230,128, 17, 89, 55, 50,144,113,232,115, 24,111,198,173,214, +104, 52,239,246,233, 55,240,142, 11,110, 84, 84, 84,164, 71,253, 6, 48, 91, 73,169,193, 42,111,178, 30, 20,252,252,252, 6,133, +133,133,205,218,186,117,107,136,209,104,116, 61,118,236, 88,254,158, 61,123, 18,173, 86,235,170, 27, 55,110,172, 47, 93,108,171, + 76, 38,251,152, 16, 2,157, 78, 39,227, 56, 78, 83, 93,168, 59,210, 77, 30,245,210, 11, 47, 28,253,239,162,149,234,196, 11,103, +177,120,211, 14,168,136, 85,188,148,107,121,234,162, 94, 40, 41,180, 6, 97,127, 64,142, 49,157, 16, 4,201, 89, 6,245,180,242, + 6,157, 1,245, 9,192, 84, 83,154,189,130, 66, 88, 33, 32, 12, 71, 12,102,232,220, 20, 74, 0, 8, 8,111,193,157, 45, 20,112, +236,212, 95, 80,171, 61, 21,142,228, 61, 51, 51,115,134,191,191,127,232,158, 61,123, 88,131,193, 80,124,238,220, 57,212,175, 95, + 31, 62, 62, 62,112,115,115, 67,124,124, 60,246,238,221,139,132,132, 4, 16, 66,170,139, 18, 84, 74, 86, 86, 22, 10, 11, 11,235, + 68, 83, 16, 4, 6, 0, 34, 35, 35, 17, 25, 25,169, 76, 79, 79,247,217,190,125,187,231,236,217,179,111,248,249,249,237, 54, 26, +255,110, 30, 85,177,186,167,186,136, 2, 0,152, 76, 38,152,205,102, 40, 20, 10,168,213,106, 40, 20, 10, 20, 22, 22, 34, 43, 43, + 11, 69, 69, 69, 37, 55, 19, 15,143,178,229, 29, 66,148,128, 19,221, 78,223,238,230, 95,246,169,101, 81, 61, 86,106,162,246, 3, +176, 29,223, 44, 91, 64, 12,213, 87,245, 85,167, 89,110,127,216, 69,153,228,181,209,180, 69,170, 24,134, 41,119,149, 80,171,213, + 55,109,145,171,210, 72, 89,141, 90,182,106, 65,165, 82,137,200,200, 72,188,251,238,187,136,143,143,199,209,163, 71,225,227,227, +131, 39,158,120, 2, 50,153, 12,169,169,169, 96, 89,214, 33,131,165, 80, 40,192,243, 60, 18, 19, 19, 95,238,221,187,119,216,226, +197,139,149, 73, 73, 73,136,143,143,135,155,155, 27, 62,254,248, 99,213,212,169, 83, 3,119,239,222,253, 70,155, 54,109,150, 57, +124,109,103, 74,170,255, 6, 14, 25, 81,137, 17,113,145,175, 93,243,173,210,102,188,216,251, 48,176, 79,122,122,122, 30, 33,100, + 1,128,133,165,213,130, 61, 0,184,164,167,167,247,178,187, 9,147,210,106, 65, 0, 56,159,158,158,222, 27, 0,169,170, 65,122, +230,205,204,229,159, 47,250,102,225,204,247,222, 81, 78, 30,160,197,171,157,204, 16, 69, 17, 28,199, 97,241,242,213,252,229,184, + 11,231,218,183,111,191, 29,192,224,211,167, 79,163,125,251,246, 69, 0, 46, 3,184,174, 84, 42,105,231,145,251,233,192, 42,152, + 32,155,113,154, 51,103,206,192,202, 76, 85, 37, 15, 63,229,166,207,157, 59,119,182,221,255, 58,237,197, 46,171,224, 28,171,123, + 10,247,243,240, 14,168, 55,230,249, 39,176,249,156,237,133,132, 4, 86,179, 1, 55,226, 15, 24, 44, 22,203,207,142,108, 48, 55, + 55,247,227, 87,223,157,223,248,116,138, 12,153,121, 6,100,236,155, 69,172,249, 73,195, 7, 13, 26,180,185, 46, 50, 20, 21, 21, + 21,233,233,229,127,240,131,207, 86, 98,127,162, 5, 18, 1, 24,130,191,141,213, 3, 50,242,151,191,191,127, 19, 15, 15,143, 47, +182,108,217,226,163, 84, 42, 93,207,159, 63, 47, 30, 58,116, 40,131,231,249,165, 55,110,220,216,104,183,220, 11, 45, 91,182,228, + 93, 92, 92,144,153,153,105,226,121, 94, 95,213,177,110,161, 86, 7, 70,181,138, 56,252,223, 69, 43,213, 38,139, 5, 5, 70, 51, +188,253,252,196,163,231,227,158,138,211,139,101, 79, 4,205,117,178, 71,218,135, 7, 4,176, 26, 87,192, 80,136,244, 66, 75,134, + 35,230, 10, 0, 92, 92, 61,216,192,246,143,162,253,196,175,112, 41,250,125, 2,228,194,195,215,159,237, 53,254, 83,232,218, 13, +194,178, 9, 47, 75,127, 71,112,107,196, 24, 30, 30,142, 51,103,206,216,202, 22,114,115,115, 17, 22, 22,134,197,139, 23,151, 91, +208,145,155, 98, 21,229,245,142, 53, 37, 73, 98, 42, 68, 29, 49,110,220, 56,249,206,157, 59, 93,236,205,149, 51,154, 22,139,165, +204, 80, 16, 66, 96,177, 88, 96,177, 88,224,226,226,130,196,196,196,242,126, 73, 20, 43,173,234,172, 58,193, 5,149,135,187,248, +220, 59,105,119,120, 12,128,194,206, 4,249, 2,232, 86, 75,115,117,155,241,169, 11, 98, 98, 98, 42,189, 14,218,170, 30, 99, 98, + 98, 72,187,118,237,124, 29,213, 35,132, 64,169, 84, 98,240,224,193,248,235,175,191,144,145,145, 1, 87, 87, 87,152,205,102,152, +205,102, 68, 69, 69, 33, 43, 43,203,225,232,149,157,110,255,183,223,126, 91,125,253,250,117,220,186,117, 11,106,181, 26,130, 32, + 64, 20, 69,188,241,198, 27,234,241,227,199,247, 3,224,184,193,226, 24, 60,246,242,103,149,182,173,218,255,237,127,122,170, 84, +170,178,234, 22,142,253, 71, 93, 64,237, 31, 20,157,218,137,217,215, 47, 44, 91,183,241,183,199, 5,171,181,215,107, 47,141,112, +213,185,104,113,245, 90, 18,150,173, 90,203,239, 63,114,106,127, 86, 90, 98,127, 0, 76, 64, 64, 64,211,210,200,213,229,244,244, +244,151,170, 51,109,148, 58,141, 98, 85,100, 52, 74, 59,182, 84,101,156,156, 49,104,246, 17, 46, 27,211,167, 79,143,156, 51,103, + 78,157,182, 49,148, 85, 81, 88, 43,154,150,182, 30, 94, 1, 7,166,207, 94,169,251,237, 28,135,188,204, 4,152,110, 38, 32, 40, +106, 8,178, 18,142,129,136,252,175,113,113,113,197, 53,109,108,247,238,221,225, 65, 77,219, 79,108,211,174, 19, 62,255, 93, 15, +253,165,141,176,228, 93, 95, 54,112,224,192,186, 51, 87,245,253, 14,190, 55,119,101,189,109, 23,229,200,205, 72, 64,252,150,169, + 16,173,183,213,138,237,112, 70,183, 39, 32, 19, 60,173,120,188, 57,131,155,127, 26,144,217, 19, 50, 28,186,191, 47,189,206,200, +200, 72,244,240,240,248,126,229,202,149, 99, 91,183,110,173,157, 56,113,226,229,194,194,194, 79, 50, 51, 51,127,180, 51, 87,189, +195,194,194, 38,205,154, 53,171,113,114,114, 50, 14, 31, 62,156,200,113, 92,149,245,203,151, 76,166, 52,246,252,165,165, 71,127, + 88, 53,153, 13, 14,199,166, 89, 83,132, 63, 47,196, 13,142,211,139, 59,203,204,149,139, 34,162, 75,100,163,237,111, 78, 24,195, +138,103,119, 33, 62,249, 38, 50,245,252, 62,135,159, 70,139, 12,188, 92,165,129,174, 65, 40,146,141,146,194,223,223,255,100, 90, +190,241,255,236,157,119, 84, 20,215,223,198,159,153,237,187,176, 75, 93, 96,169,162, 2, 82, 5, 4,172,216,162,177,196, 22,147, + 88,163,198,196,104,138,198,168,137, 53,118,209, 24,141, 53,197,216, 73, 20,219, 27, 19,107,140,138, 88,176, 3,118, 68, 68,250, +210, 59, 44,108,155,251,254, 1,248, 67, 66, 89, 74, 98,202,124,206,217,179,187, 51,179,207,222,153,185,115,239, 51,223, 91,134, + 79,115,184,160,185,124, 36,228, 87, 52,169, 18,103,152, 63,134, 36,107,155, 22, 0,141, 54,145, 53,234,228, 90,160, 89, 29,193, +250,131, 95,209,106,169,230,106,214, 52, 88,181,205, 84, 93,199,168, 73, 6, 75, 83, 84,247, 57, 80,231,182,198,192,142,234,132, + 8, 90, 98,174,170,141, 79,117, 7,116,161, 80,248,220,168, 24, 26,101,170, 47,130,213,208,122,131,107,126,138, 2,195, 48,224, +241,120,112,113,113,193,213,171, 87, 33,147,201, 96,108,108, 12,137, 68, 2,161, 80, 8,153, 76, 6,129, 64, 0,154,166, 65, 27, +104, 92,180, 90, 45,212,106,181,141,189,189, 61,158, 60,121, 2,145, 72,244,252, 37, 16, 8,224,230,230,134,146,146,146, 38,153, +206,166,152, 38,206,191,104,106,234,164,135,145,175,219,184, 6, 77, 56,240,127,199, 63,172,168, 80,123,119,112,107,143, 71,247, +162,238,100,166,198, 15, 98, 61,206,223,198, 56, 87,243, 3, 42, 71,137,182, 74, 51, 94, 93, 38,107,205,154, 53, 33, 53,163, 96, +173,109,176,208,144,185,154,187,234, 7,217,161, 40, 26, 5,202, 88, 36,157, 94, 80,172,215,148,229, 51,140,214, 41,255,233,101, +224,197, 14,185, 13, 85,134,129,221,250, 14,167, 47, 60, 82, 67, 83,156,142,162,251, 7, 18,133, 66,225,188,214, 52, 87,243, 86, +111, 55,255,249, 14, 23,121,233,143,241,244,228,252, 66,189,166,172,111, 84, 84, 84,147,231,209,122, 31,224,253, 0,104,135,201, +229, 35,100, 66,122,237,228,145, 82,244,236, 39,134,140, 47,195,242,175,232, 71,165,221,152, 57, 89,145, 56, 6,127,240, 16,133, +151, 50,162,240,193,131, 7,171,182,111,223, 78,235,116,186,201, 26,141,102,169, 82,169,124, 30, 69, 84, 40, 20,253, 29, 29, 29, +215,174, 88,177,194, 62, 49, 49, 81,112,237,218,181,188,232,232,104, 70,175,215,175,105, 72,243, 94,145,250,243,143, 63,158,206, +105,239, 96, 59, 61, 62, 53,117,216,253, 98,253,233,234,117, 94, 18,190, 87, 55, 95,247, 43, 43,150,205,151,106,174, 29, 65,105, + 70, 42,182, 94,203, 40, 98,244,218,249, 6, 70,221,204, 47,159, 63,135,249, 83, 38, 49,197,197,197,144, 8,248, 76,106,236, 83, +206,132,126, 61,245, 95,206,157, 77,103,100,100,160,172,180,148, 99,107,107,107,158,158,158,158,103,136,102, 93,134,162,174,202, +181, 73, 6,163,238,202,188,217,154,181, 35, 88, 13, 25, 44, 67, 53,107, 54,137, 53,118, 60,244,122,125,211,154, 8,117,245, 24, + 44, 77,182,166,133, 89, 54,153,162, 40,199,234,207,173,113, 13,148,151,151, 91,213,136,138, 1, 0,213,220,104,101, 85, 4,171, +193,245, 77, 49, 89,213, 17,172,248,248,120,200,229,114,232,116, 58, 24, 25, 25, 65, 44, 22, 67, 44, 22, 67,165, 82, 65, 32, 16, +128,195,225, 52, 41,157, 66,161, 48, 35, 54, 54,214,201,204,204, 12,122,189,254, 5,147,245,236,217, 51,152,152,152,100, 25,218, +255,170, 50,130, 5,156,221, 51,183,206, 81,132,166, 38, 70, 47, 8,113, 40, 10,127, 35,106,246,211,105, 86, 84, 41, 35,238,198, +143, 0,126,180,179,179,219,187,111,199,137,128,128,128,128, 19, 45,213,100,249,147,221, 87,149, 49,170,217,151,106,222,188,121, +205,158, 59,100,222,188,121, 11,234,138,104,181,166,193,162,106,189,255,207, 92, 89,216,134,207, 89,177, 77,182,239, 22,141, 66, +229, 35,164,159, 93, 84,200,104,202,250,210, 52,173, 76,137,252,225, 48,128,178,168,168,168, 8, 3, 43, 67,255, 14,174,174, 56, +116, 95,135,242,140, 59,160, 41,178,167, 95,191,126,101, 45,221,137,106,115,245,121,200, 15,230,135,162,185,200,175, 52,129,133, + 76, 51,204,213, 88,129,160, 61,143,166,215, 58,248,186,191, 54, 58, 33,185,164, 79, 59,145,233,224,246, 66,112,174, 29,197, 49, +219, 44,228, 89,158,199, 7, 27,236,218, 71,254, 82,244,107,148,176, 52,207,215,199, 91,118,203,232,222, 9, 45,209,127,158,115, + 9,127,121,231,247,248,248,248, 21,214,214,214, 63,103,102,102, 62,239,157,106,103,103, 55,200,209,209, 49,100,249,242,229,109, + 82, 82, 82,164, 49, 49, 49, 69,135, 15, 31,126, 70,211,244,242,140,140,140,172,198, 52,239,151,104,103,147,100,229,142, 7,165, +250,216,231,145, 43, 9,175,227,132, 9,163,175,246, 27,243,142, 40,225,194, 94,152,167, 62,192,198, 27, 89,250,212,194,242,177, +177, 42,100, 24, 98,174, 4, 2,193,161,205, 71,142, 60,241,246,246,166,202,202,202,160,213,106,145,157,157,141,175,126, 58,116, +159, 97, 24,152,153,153,225,220,185,115,204, 39,159,124,114,200,214,214,246, 45, 67, 76, 22,195, 48,207, 43,171,250,162, 64, 98, +177,184,105, 6,163,234, 55, 53, 13, 76, 75, 52,235, 51, 88,181, 35, 91, 77,212,172,188,128,171, 58,183,215, 23,209,227,112, 56, + 96, 24,166,206, 72, 95,253, 97,146,130,122, 12, 86, 86, 75,111, 36,156,208,240, 64,154,151,134, 72, 36,202,172, 50, 79, 76,125, + 83, 49, 52, 53,130, 5, 0, 2,129, 0,145,145,145, 24, 56,112, 32, 24,134,129, 80, 40,132, 88, 44,134, 72, 36,194,141, 27, 55, +192,231,243,193,225,112,154,212, 76,200,227,241, 78,109,221,186,117,210,154, 53,107,196, 12,195, 64, 32, 16, 64, 44, 22, 67, 40, + 20,226,235,175,191, 86, 9, 4,130,211, 77, 50, 88,104,124, 20, 97, 77, 51,246, 87, 83,107,154,134,218, 83, 49,212,164,246, 20, + 14,245, 78,211, 96,107,107,107,110,111,111,255, 30, 33,196,179,106,209, 11,163, 5,107,108, 90, 93,176,184,218,217,217,237,173, + 99, 20, 33, 75,235, 71,175, 80, 79, 25,145, 93, 43,122,165,174,241, 61, 27, 0, 85,245, 61,187,134, 1,171,249, 89, 93,199,178, +220,213,171, 87,135,215,136, 92,101,183,230,206,212, 27,193,242,245,245,117, 55,181,176, 13,159,181, 98,155,108,239,117, 14, 10, +149, 15,145, 19,254, 69, 33,209,169,106,154,150, 30, 77,252, 63, 63, 43, 43, 11,228, 68,150, 67,155,255, 4, 20, 69, 69,181,116, + 7, 2, 3, 3, 93,164, 38,242, 11,115, 86,254, 96,190,255, 54, 23, 5,233,255, 51,129,205,137, 92,113,105,250,171,245,191, 29, + 24, 38,204,120, 4,213,157, 11,166,188,188, 84,220,207,210,224, 80,100, 70,241,133, 43,219, 47,211, 30, 36,184,239, 88, 83,227, +190, 99,205,177,241,131,211,230,153,229, 15,112, 61,238,248,240,144,249,199, 9, 94,210,236,238, 53,205,149, 66,161, 24,106,107, +107,187,236,196,137, 19, 78, 58,157, 78,122,241,226,197,226,195,135, 15, 63,213,233,116,155, 51, 50, 50, 78, 24, 28, 29, 43,213, + 60, 55, 87, 94, 50,158,255,228,137, 19, 47,127,178,225,123,209,131,219, 55,177,118,239, 9, 72,121, 90,253,237,244,242,183, 30, +148,254,175,249,176,193,227,202,229, 46,223,191,127,191,145,135,135, 7,149,155,155,251,188,194,215,104, 52, 40, 42, 42, 66, 97, + 97, 33,212,106, 53,188,189,189,233, 37, 75,150, 24, 45, 94,188,120, 57,128,143, 26,137, 16,100, 45, 91,182,204,234,253,247,223, +135, 76, 38, 67,110,110, 46,180, 90,237,243,104,147, 80, 40,132,169,169, 41, 10, 10, 10,112,246,236, 89, 16, 66, 26, 52,151,124, + 62, 95,105,103,103,235, 32,150, 24,169, 37, 18, 9, 49, 54, 54,110,177,102, 85,101,155, 49,120,240, 96,155,101,203,150, 9,106, + 86,210, 26,141,134,106,174, 38, 33,164,236,213, 87, 95,149,108,222,188, 25, 78, 78, 78, 80,171,213, 96, 24,230,121, 4,171,122, +106,128,228,228,100,172, 90,181, 10,132, 16,195,111,100,180,249, 90,216, 79,148, 67,147,171,133, 38, 87, 11,117,142, 22,154, 44, + 45,116,101,127,187, 33, 34,205,233,128,110, 64, 36,204,170,165, 17, 44,138,162, 64, 8, 1,159,207, 71, 74, 74, 10,206,157, 59, +135,160,160, 32, 72,165, 82,148,150,150,226,234,213,171,200,200,200,104, 86, 4,171,111,223,190,123,206,156, 57, 19,252,241,199, + 31, 59, 79,155, 54, 77,236,238,238,142,196,196, 68,108,216,176,161,252,225,195,135,105, 51,102,204,216,222, 20, 61,186,106,234, + 26,131, 70, 17,210,127,189, 55,174,103,154,134,193,245,108, 94,115, 10,135,218,211, 52, 60,231,232,209,163,206,118,118,118,238, +168,236, 95, 5,252,113,180, 96, 77,110,221,186,117, 43, 0,236, 40,194,151, 29,185,186,249, 79, 75, 51,183,254,139,142,254,180, +243, 27, 11,101,123,174,113,145,159,118, 31,133,151,150,212, 54, 87,134,224,141, 26,115,101,240, 68, 82,111, 29,225, 3, 40,135, +174,224, 41, 4, 2, 65,116, 51,210,252,130, 38,195, 48,179,187,188,177,208, 60,244, 38, 23,133,233, 15,145,125, 97,113,115,204, +149, 55,128,123,239, 3, 60, 7, 63,207,215,132,153,143, 81,126, 33, 12, 20,128, 29,209,165,184,154,170,254, 90,163, 86,175,124, + 88,164, 46,176, 19,195, 44, 44, 36,107,241,160,215,125, 62,113, 27,125, 22,215,179,191, 3, 36,128,153,156, 59, 40,203, 95, 87, +179,185,240,133,116,182, 18, 13,106,218,218,218,186, 24, 27, 27,127,117,234,212, 41,185, 64, 32,144, 61,120,240, 64,127,228,200, +145, 20,189, 94,191,190,102,199,247,166,104,122,138, 68,246, 30,109, 29, 34,102,172,255, 86, 84, 92, 82,138, 82,181, 6,182,142, +118,250,136,219,143,222,120, 80,170,249,197, 16, 77, 43, 43,171, 62, 35, 71,142,236,216,169, 83, 39,186, 62,115, 85, 84, 84,132, +146,146, 18,164,166,166, 34, 56, 56,152,118,119,119,247,174,168,168,232,147,149,149, 21, 94, 95, 58,149, 74,229,210,176,176,176, +238, 7, 15, 30, 28, 50,101,202, 20,233,200,145, 35, 33, 22,139, 81, 90, 90, 10, 7, 7, 7, 48, 12,131, 75,151, 46, 33, 46, 46, +174, 24,192,113,165, 82,121,165,161,116, 62,123,150,224, 8,128,182,183,183,239, 62,112,224,192, 86,209, 4,128,236,236,236,246, + 17, 17, 17,115,135, 15, 31, 62,115,192,128, 1,210, 5, 11, 22,240,157,157,157,161,215,235,169,230,106,230,231,231,155, 68, 69, + 69,173,235,209,163,199, 71, 3, 7, 14,228,134,132,132,192,196,196, 4,122,189, 30, 98,177, 24, 69, 69, 69, 88,190,124, 57, 46, + 95,190,172, 35,132,124, 83, 88, 88, 56,167, 33,205,154,243, 96,189, 53,227,107,223,134, 50, 97, 3,243, 96,253,229,121,190, 42, +210, 68,208,180,166,193, 70,211, 89,213,161,253, 15,243, 97, 25,170, 89, 61,245,130, 64, 32, 0,151,203, 69,118,118, 54,206,156, + 57,243,194,252, 87, 2,129,224,249, 52, 14,245, 68,176,234, 76,167, 84, 42,101,222,124,243,205,201,167, 78,157,154, 52,123,246, +236,225,197,197,197, 86, 50,153, 44,219,200,200,232,248,140, 25, 51,118,153,154,154, 54, 52, 69,195, 31, 52, 57, 52, 85,239, 40, +194, 23,162,166, 28, 65,121, 61,221,181,254,212,243, 94,107,154,134,218, 83, 49,212,164,246, 20, 14,181,167,105,120,174, 57, 98, +196,136,103,168,156, 60,148,174,122,175, 61, 90,176, 26,215, 91,183,110, 5, 4, 4, 4, 92, 4, 32,198, 31, 71, 17,254,229,121, +254, 95,174,249,175,162,161, 62, 88,162, 43,183,227, 64, 11,179, 80,124,253,171,230,152,171, 63,160,171, 40,141, 95,113, 32,193, + 79,175, 86, 65, 87,148,244,120,224,107,131,179, 90,186, 3,132, 16,163,203, 81,241,224,138,114, 81,112,237,203, 2, 74, 95,209, + 55, 42, 42, 42,166, 57, 90, 63, 0,218,113,119, 30, 93,120,122,249,220, 43,182, 0,146,242,212,136,137,205, 59,115, 84,165,154, + 93,189, 77,218, 53,228, 3,152,249, 27,247, 94, 7,115,215,194,254, 38,182, 64, 86,178, 22,249,217,186, 83, 47,171, 47, 86, 53, +233,233,233, 79, 60, 61, 61,247,238,220,185,243, 3,127,127,127,227,233,211,167,199, 21, 22, 22,190,208,241,189,169, 60, 40, 47, + 79, 69,124,226,119, 23,118,108,248, 76,228, 30,132, 35, 33,243,245, 23,111,199,142,184, 95,162, 49,184,205, 90, 40, 20,246,254, +224,131, 15,248,101,101,101,245,154,171,162,162, 34, 20, 23, 23,163,168,168, 8, 49, 49, 49, 24, 57,114,164,240,209,163, 71,189, + 1,132, 55, 84,230,167,166,166, 94,106,215,174,221,141,239,190,251,174, 95,104,104,104,255,119,223,125, 87,208,187,119,111, 60, +120,240, 0, 55,110,220, 80,107, 52,154,223, 69, 34,209,217,167, 79,159, 26,218, 9,235,207,208,212,169, 84,170, 85, 98,177,120, +243,225,195,135, 87,158, 63,127,254,237, 73,147, 38, 25,233,116, 58,170, 37,154,133,133,133, 51, 45, 45, 45, 23,157, 60,121,114, +207,153, 51,103, 70,188,253,246,219,244,140, 25, 51,176,101,203, 22, 28, 57,114,132,209,235,245,191,240,120,188,137, 57, 57, 57, +141, 14, 64,169, 57, 15, 86, 67,243, 92, 53,182,222, 0,254,140,187,208, 22,107,214,142,132, 85,143, 22,172, 54, 85, 77,105, 30, +172, 73,199,142, 29, 95,152,231,170,186, 67,123,245,139,195,225,128,203,229, 54,169,137,208,203,203, 11, 60, 30,143,241,243,243, +219, 5, 96, 23,240,226, 35,115,120, 60,222,243, 73, 77, 13,161, 66,199, 96,199,206,189, 55,116, 12,129,158, 33, 32, 12,160, 37, + 0,163,103,160,103, 8,244, 12, 83, 57, 45, 26, 1, 84,229,250,191,188, 92,171, 49, 77,195,215,117, 76,197,240,156, 58,166,112, +168,247,185,129,233,233,233,121,132,144,234,254,168,117,141, 22,172,214,220, 91,181, 92,156,150,150, 54,161, 33, 77, 22,150,166, + 24,172, 5, 37,183, 55,105, 1, 88, 80, 20, 53, 63, 42, 42,234, 65, 75,255,140,195,161,231,103, 29,123,103, 51, 1,242, 57, 20, +230,183,198, 14,232,245,250,133,165, 81,155, 25, 66,136, 41, 69, 81,243,110,223,190,221,162,116, 18,157,238,195,175,182, 95,250, + 90,110, 34,232,159, 83, 80,113, 18, 20, 85,231,172,237, 58,144,143,127,252, 50,249, 75, 51, 57,119, 80,126,182,238, 20, 67, 99, +238,223,225,132, 62,120,240, 32,100,251,246,237,156,239,191,255,126,178, 90,173,126,161,227,123,179, 53, 75, 52,159,127,250,249, + 34, 78, 7,103,251,233,177,137,201,195,239,151, 24,214, 44, 88, 3,129,157,157,221,253,178,178, 50, 80, 20,133,138,138,138, 23, + 12, 85, 77,131,165,209,104,144,149,149, 5,103,103,103, 80, 20,101, 80, 13, 81,101, 74, 78, 88, 88, 88, 92,220,180,105,211,107, + 91,182,108,233,198, 48, 76,164, 70,163, 57,145,155,155, 91,210,156,125,254, 51, 52,171,126,247,137, 78,167, 91,179,101,203,150, +117, 34,145, 40, 32, 43, 43, 43,162, 37,154, 85,230,233, 13,115,115,115,219,189,123,247, 30,218,185,115,103, 23, 46,151,123,141, +162,168,183, 10, 11, 11,155, 51, 95,207,227, 22,174,111,140, 35,127, 66,182,111,177,102,205, 62, 87,205,109,102,124,161,124,208, +233, 74,230,207,159,159, 85,251,153,131, 53,231,188,170,249,174, 86,171,203, 13,208,100,190,248,226,139, 6,111,226,106, 26,173, +242,242,242, 70,155,116, 9, 67,114, 6,143,250,176,105,101, 36, 67,114, 94, 98, 17,119, 12,192,147,170, 23,105, 96, 93,147,118, + 9,149,115,180, 37, 18, 66, 18,107,233,214, 92,206,194,210, 58, 6, 43, 42, 42, 42, 5,192, 59,173,249,103, 3, 7, 14, 60, 7, +192,189, 53, 53,239,220,185,147, 4,224,237,214,210,219,175, 86,199, 3, 24,242,126,150,154,247, 19,234,143, 72, 85,117,104,127, +189, 86,179,224,223,130,186, 58,190,183,148,251, 37,218,217, 36, 33,237,133,142,239, 77,168,108,126, 19, 10,133, 84, 81, 81, 17, + 52, 26, 13,138,139,139,159,155,171,154, 38, 75,167,211,129,162, 40, 20, 23, 23,195,216,216, 24, 90,173,182, 73,119,138, 85, 38, + 37,172, 87,175, 94,135, 35, 34, 34, 90,101, 26,141, 63, 67, 83,165, 82,101,168, 84,170,113,189,122,245,226,182,150,102, 94, 94, + 94, 58,128,110,237,218,181, 19, 52, 33, 10, 86,111, 36,171,185,235, 13,224,251, 63, 33,203,255,244,119, 43, 88,147,146,146, 60, + 90, 91, 51, 37, 37,229, 97,171,167,243,250,143,179,254, 9, 21, 85,117,212,200,206,206,110,111,114,114,178, 35, 69, 81,201,181, + 35, 73, 13,173,107, 72, 19, 0,156,157,157,143,166,164,164,216, 10,133,194,116, 67,150,179,176,252, 29,240,102, 53, 89, 77, 86, +147,213,100, 53, 89, 77, 86,147,213,108, 38,239,255, 83, 13,208,191,104,218, 56, 22, 22, 22, 22, 22, 22, 22,150,191, 7, 84, 3, + 46,180, 41,163, 3,154,227,100,239,177,154,172, 38,171,201,106,178,154,172, 38,171,249,159,211,108, 76,187,230,239,223, 71,229, + 76,238, 44,173,112, 98, 88, 77, 86,147,213,100, 53, 89, 77, 86,147,213,252,239,105,214, 5,219, 68,200,194,194,194,194,194,194, +194,194, 82, 9,151, 61, 4, 44,134, 96,103,103,183,186,115,231,206, 31,222,188,121,115,125, 74, 74,202,242,102,106,216, 90, 88, + 88,172, 2,208,141, 16, 34,228,112, 56, 15,115,114,114, 66, 82, 83, 83, 47, 53, 55, 93, 10,133,194, 65, 46,151,175, 2,208,133, + 97, 24, 62,143,199,187,159,153,153,185, 50, 61, 61,253, 90,115, 53, 45, 45, 45,141, 20, 10, 69, 0, 33,196,138, 16, 66,243,120, +188,252,180,180,180,152,236,236,236, 44, 54, 39,176,176,176,176,176,180,216, 96, 45,253, 24, 10,104,192, 93,250, 3, 82,170, 22, +201, 80, 57,233,154, 59,128, 71,168,124,188, 64, 75, 31, 25,240, 79,209,252,187, 67,155,154,154,190, 42,145, 72, 62, 41, 41, 41, +241,147,201,100,247,117, 58,221,102,165, 82,121, 28, 64,139, 30,113, 34,151,203,173, 70,140, 24, 49,111,211,166, 77,152, 60,121, +242,162, 19, 39, 78,108,104,234,188, 77,238,238,238,195,164, 82,233,182, 21, 43, 86,202,131,130,130, 40,145, 72,132,248,248,120, +187,133, 11, 23,248, 91, 90, 90, 30,138,142,142,254,168,169,233,242,244,244,124, 75, 42,149,110, 14, 9, 9,145, 7, 4, 4, 80, + 92, 46, 23,119,239,222,181, 95,182,108, 89,144, 92, 46,223, 27, 19, 19, 51,187,169,154, 94, 94, 94,206,198,198,198,221, 86,174, + 92, 41, 10, 10, 10,130, 80, 40,196,195,135, 15,141, 22, 44, 88, 32, 87, 42,149, 79,162,163,163,175, 55, 69,207,255,253,219, 60, +190, 68,195, 5, 0, 77, 25, 95, 23,245, 67, 39,173,161,203,216,226,137,133,133,133,229, 95,104,176,150, 77,195,114, 74,135, 5, +160, 65,125, 50, 6, 7,183, 28,164,111,244,237,219,183,195,187,239,190, 75, 85, 61, 58,194, 35, 44, 44,236,141,227,199,143,199, + 50, 12,115, 29, 64, 12, 0,141,129,255,203, 7,224, 75,211,116,231,191,185,230,223, 30, 99, 99, 99, 23,185, 92, 62,187,168,168, +104, 80, 64, 64, 64,209,180,105,211, 18,175, 93,187,150, 16, 24, 24, 88,190,115,231,206, 16,173, 86,251,173,169,169,233,239,197, +197,197,235,154, 59, 47, 22,143,199,115,167, 40, 10,105,105,105,224,241,120, 60,129, 64,224, 1,192, 96,163, 97,111,111,175,144, + 74,165,223, 31, 60,250,155, 85, 81, 5,141, 39,217, 12,128, 50,232,105, 75,172, 88,187,197, 98,221,170, 69, 99, 75, 75, 75, 47, + 63,121,242,228,128,161,154, 10,133,194, 65, 42,149,110, 62,127,254,188,149, 80, 40, 4,195, 48, 40, 46, 46,134,149,149, 21, 86, +175, 94,109,190, 98,197,138,119, 11, 11, 11, 47, 38, 38, 38, 30, 51, 84,211,210,210,210,200,216,216,184, 91,120,120,184, 72, 32, + 16, 80, 90,173,150,170,168,168,128,141,141, 13,249,250,235,175,133, 11, 23, 46,116, 43, 40, 40,200, 72, 76, 76, 76, 54,200, 92, +109,187,205, 43,250, 45,188, 43, 73, 81, 45, 2, 0, 74, 36, 94,217,107,105,226,141,180,187,135,131, 26, 91,230,191,237,246,213, +168,169,172,201, 98,249,107, 81, 40, 20,221,157,157,157,143, 38, 39, 39, 71,114, 56,156,209, 73, 73, 73, 21,173, 32,107, 15,192, + 25,128, 25, 42, 7, 86,229, 1, 72, 4,158,223,184, 55, 25,139,118,189,135, 66, 40,121, 7,132,248,210, 0, 64,211, 49,140,166, +116,119,110,220,133, 99, 45,210, 20, 25, 77, 6,195,248,210, 32, 12,104,206, 29,162, 43,221,158, 19,123,225, 20,155, 51, 88, 90, +205, 96, 45,125, 23,102, 20, 48,119,254,180,247,105, 46,135, 67,133,108,251, 97,204,205,200, 99, 68,225,232,251,252,145, 27,193, +193,193, 8, 14, 14,166,214,174, 93,235,126,254,252,121,247,125,251,246,105, 35, 35, 35,111, 3,216, 83,223,159,133, 76, 23, 39, +235,180, 42, 7,208,226,242, 54, 93,190,221,215,173, 91, 48, 35, 20, 10,209, 18, 77, 0,248,240, 77,238,239, 21,148, 3,213,123, +200,226,164,214,210,252,135,152,171, 8,169, 84,218,126, 55,110,175,251, 0, 0, 32, 0, 73, 68, 65, 84,234,212,169, 79, 62,248, +224,131,139, 70, 70, 70, 4, 0,178,178,178,140, 94,123,237,181,252, 17, 35, 70,228,150,149,149,225,187,239,190,115,216,188,121, +243,239, 82,169, 52,173,184,184, 56,168, 41,249, 67,161, 80,172,233,215,175,223,172,113,227,198, 65, 42,149, 98,210,164, 73,168, +168,168,136, 60,127,254,252, 90,165, 82,185, 8, 64,163,207,206, 48, 51, 51, 91,178,108,217, 50,171, 18, 53, 7,139, 66,227,145, + 87, 82,233, 27, 36, 2, 26, 31,189, 34,196,132, 9, 19, 77,162,163,163,215, 2, 48,216, 96,201,229,242, 85, 33, 33, 33,242,234, +115, 93, 82, 82,130,146,146, 18, 20, 23, 23,163,164,164, 4,227,198,141,147, 61,121,242,100, 35, 42,103,119, 54,180,114, 9, 88, +185,114,165, 72, 32, 16,224,216,177, 99, 29,203,203,203,185, 90,173, 22,132, 16, 93,135, 14, 29, 98, 38, 78,156,200,143,139,139, +235, 10,192, 32,131,165,200, 0,175, 80,165,250,102,235,151,159,201, 1,224,227,185, 95,125, 3,168, 58, 19, 3,150, 41, 50, 16, + 24, 5,176, 6,171, 97, 56, 0, 94,231,241,120, 35,219,183,111, 31,240,228,201,147,104,157, 78,247,127, 0,254, 15, 45, 63,118, +175,216,218,218,174, 74, 79, 79,223, 10,224,199,255,202, 1,109,215,174,221,207,251,246,237,179, 56,121,242,228,176, 21, 43, 86, +140, 2,176,183, 5,114, 60, 0, 93,171, 76,213,163, 42, 99,133, 42,163,213, 1, 64, 59, 0, 87,154,114,195,107,225,218,205, 24, + 92, 89, 88,215,238,189,122,188,245,198, 8,169,220,220, 4,165, 21,122,196, 37,102, 56,158, 57,249,115,175,199,124,113,164, 78, + 83, 56, 38, 55, 46,178,164,169,154,125,250,246,239,209,247,149,126, 82, 19, 19, 83,228, 22,107,241, 52, 49,213, 41,226,247, 95, +130,105,174,248, 34, 40,237,219, 89,247,126, 47, 99, 47, 57,150,166, 96, 80, 39,119,138,162, 96,100,108, 84,231, 58, 19, 19, 19, +244,238,221, 27, 33, 33, 33, 60, 0, 93,106,173,126, 97,168,166, 94,175, 86, 44,250,104, 58, 4, 92, 34,124,109,208, 0, 74, 38, +147,181, 88, 19, 0,172,205,117,253, 58,187,169,122,101,198,204, 24, 31, 19,177,202, 91, 93, 94,240,135, 39,157, 74, 36, 18,184, +184,184, 96,225,194,133, 6,105,182, 2,127,186, 38, 33,196,214,195,195,163,120,195,134, 13,110,139, 23, 47, 54, 43, 47, 47, 55, + 2, 96,239,225,215,221,150,166,105, 7,181, 90, 45, 93,186,116,169,229,151, 95,126,233, 38,151,203, 11, 8, 33,242,166,164, 83, +161, 80,108, 8, 9, 9,153,189,123,247,110, 42, 48, 48, 16, 82,169, 20, 93,187,118, 69,104,104, 40,189,100,201,146,121, 10,133, + 98,141,129,251, 30, 28, 20, 20, 68, 49, 0,242, 75,116, 8, 95,221, 9, 87,190, 10, 68,153,154, 65, 97,113, 9, 84, 42, 21, 68, + 34,145,216,194,194,194,184, 9,199,179, 75, 64, 64, 0, 5,224,185,169, 42, 46,174,124,149,148,148, 66,173,214,128,166,105,153, +147,147,147,176, 9,199,211, 42, 40,168,210,127,150,151,151,115,135, 13, 27,134, 33, 67,134,160,184,184,152, 91, 84, 84, 4,181, + 90, 13,154,166,249, 85, 21,123,163,154,106, 9,143, 98, 8, 99,109, 36, 17, 91, 26, 73,196,150, 12, 97,172, 1,192,144,101,106, + 9,143,122,201,249, 83, 78,211,244,174,118,237,218, 61,164,105,122, 47, 0,155, 22,106, 6, 2, 8, 17,139,197,103,221,221,221, + 83, 36, 18,201,121, 0,107,170, 42,224,230,104, 10, 36, 18,201,249,144,144,144, 67,209,209,209,163,206,157, 59,231,124,247,238, +221, 55,214,174, 93, 27,102,108,108, 92,253, 96,222,102, 95,155,206,206,206, 59,175, 95,191, 30,216,173, 91,183, 29, 0,132,173, +116,189,115, 0,248, 85, 25,142,191, 69, 25, 82, 19, 59, 59,187,246,126,126,126,150, 28, 14, 7,193,193,193, 32,132, 4,183, 80, +179, 27,128, 12, 0, 17, 0,178,171,110,198,244, 0,114, 0, 92,170,186, 81, 9,110,146, 38, 87, 22,246,201,167,159, 15,156, 51, +253, 61,105, 84,146, 30,219,207, 40,113,240,114, 54,210,138,133,232, 63,124,178, 73,175,193,227, 6,112,249, 38, 97, 77,213,156, + 55,111,193,192,247, 38,141,151,222, 75,167,113,232, 74, 14, 46, 63, 42, 66, 25,101,134,222,195,223, 55,243, 8, 26,244, 26, 5, +254,158,191,195, 57,250, 15,104,254, 7, 34, 88, 59,145,191,108, 26,190, 12,249,238,135, 69, 52, 69, 17,123,215, 1, 15,156, 93, +186,148, 50, 12, 3,149, 74, 5,141, 70, 3, 30,143, 7,149, 74,133,164,164, 36, 92,191,126, 29, 38, 38, 38, 77,250,227,130,194, + 66,216,217, 59, 67, 34,145,180,138,230,148, 55, 71,112,147,149, 74,110,100, 84,120,167, 3,155,246,117,114,104,215,255,145,111, +239,207,239, 25,155, 56,170, 98, 98, 98,112,245,234, 85,228,231,231,163,186, 2,253, 55, 64, 81,148,118,221,186,117, 81,233,233, +233,184,116,233,146,223,178,141, 63,181,185, 87,212,142,155, 93, 66,120,114,227, 76, 39,119,241, 99,125,126, 94, 94,194,236,217, +179,207, 43, 20, 10,245,244,233,211,123, 25,162,107,103,103, 39,162, 40,170,211,128, 1, 3, 62,154, 56,113, 34, 18, 19, 19, 49, +103,206, 28,117, 76, 76, 76, 65,167, 78,157,204,214,173, 91,199,127,255,253,247, 17, 25, 25, 57, 59, 60, 60,252, 48,128,251,105, +105,105, 13, 61, 75, 77, 32, 18,137,128,194,202, 27, 85,141,142,160,186, 91, 88, 73, 73, 9,104, 82, 0, 62,159, 79,211, 52, 45, + 7, 96,208,157, 39,195, 48,124,129, 64,128,210,210, 82,148,148,148, 32, 45,187, 4, 73,153,165, 40, 46,173,128, 74,165, 69, 69, + 57,129, 80,106, 77,107,179,179, 45, 0,164, 25,162, 73, 8,161,171,155, 27,213,106, 53, 84, 42, 21,212,106, 53,212,106,245,243, +199,249,112, 56, 28,169,157,157,157, 44, 45, 45, 45,191,209,218, 84, 32,214,113,104,126,200,130,149,223, 44, 5, 0, 14,205, 15, + 49, 70, 57, 99,200, 50,142, 64,172,123,137, 89, 75, 40,151,203,195, 15, 29, 58,228,225,226,226,130,103,207,158,185,191,245,214, + 91,157,149, 74,165, 31,128,166,222,197, 75,104,154,254,114,226,196,137, 31,142, 29, 59,150,114,117,117, 5,151,203,133, 78,167, +179,143,143,143,239,115,240,224,193,185, 59,119,238,220,174,215,235,103, 27,122,238, 1,208, 2,129,224,192,182,109,219,122,118, +238,220, 25,123,247,238,197,141, 27, 55,152,192,192, 64,122,194,132, 9,112,114,114,234, 50, 97,194,132, 35, 21, 21, 21, 67, 12, +137,176,214,129, 83,215,174, 93, 29, 56, 28, 14,186,117,235,198,143,140,140,244, 7, 16,217,210,128,179,189,189,125, 68,239,222, +189,253,206,158, 61, 27,149,145,145,209,187, 9,251, 11,133, 66, 49,220,218,218,122,173, 84, 42, 53, 51,244, 55, 37, 37, 37,101, +153,153,153,115,210,211,211, 15, 27,152,255,187,249,248,248, 64,167,211,193,196,196, 4, 54, 54, 54, 61, 40,138,154,109, 98, 98, +242,122, 81, 81,209,172,180,180,180, 27, 77,216, 95,187,170, 27,248,234,231, 2,182,169,138, 90, 1,149,207,179,124, 6, 32, 1, +128, 45, 0, 7, 24,208, 92,104,209,174,247,208,110,193,125,122, 4,119,246,166, 87, 31, 78,132,158, 97,192,133, 30, 92, 14,131, + 28, 61, 15, 20, 69,193,201, 45,144, 99,125,239, 86, 23,157, 70, 51, 52, 55,238,236, 49, 67, 52, 7, 14, 24, 16,220,193,205,149, + 94,127, 52, 25, 5,105,247,244,153,143,206,231, 80, 52,141,182,190,253, 45,157,220,252, 56,237,253, 94,225,101, 38,222,235,163, +105,223,179, 95,126,252,197,179,172,109, 96,105,142,193, 34, 53,239,172,150,124,143,197, 22,166,104,243,224,222, 29, 58, 37, 67, + 93,122,231,206, 29, 88, 88, 88,192,202,202, 10, 50,153, 12,177,177,177, 56,123,246, 44, 30, 63,126, 12, 66, 8,252,252,252,154, +244,199,153, 25, 25,200,205, 43,110, 85, 77, 71,133, 2,142, 10, 5, 55, 39,191, 0, 87,239,220,245, 56,182,189, 95,135, 76,122, +234,110,149, 74,245,124, 27,173,246,223,215,234, 98,101,101,165,255,248,227,233,185, 83,190, 73,104, 55,166,175, 29,103,120, 87, + 27, 28,141, 84,114,194, 46,112,200,162,119, 59,230,196,199,199, 25,188,211,142,142,142,171,122,246,236,249, 25,151,203,229,189, +255,126,229,244, 35, 51,102,204,168,184,123,247,174,103,106,106,106, 66, 69, 69, 69,135, 89,179,102,221, 61,114,228, 8,239,189, +247,222,163,202,203,203,111,240,120, 60, 18, 17, 17,177, 92,169, 84, 46,173,211,104,112, 56,209, 15, 30, 60,104,163, 19,217,194, + 82, 74, 99,192,162,168,202, 26, 71, 72,144,147,153,134,251,241, 55, 33,151,203, 77, 44, 45, 45, 31,101,101,101, 85,100,102,102, +126,146,144,144,176,167,161,116,242,120,188,251,119,239,222,181,183,182,182, 70, 73, 73, 9, 82,178, 74,177,235, 42,133,178, 10, + 49, 0, 49, 56,144, 66,106,233, 32,109, 75,202, 98,204,204,204, 52,106,181,122,222,147, 39, 79,126,108, 68, 51,255,225,195,135, + 70,118,118,118,224,112, 56,154,131, 7, 15,242,213,106, 53, 8, 33,186,147, 39, 79,142, 46, 40, 40,232,214,174, 93, 59,218,201, +201,105,157,163,163,163, 74,169, 84, 78, 73, 76, 76,172,247, 65,195,167,103,180,215,244, 90,122,225,219,130,103, 41, 7, 1,192, +174,179, 71,222,241,165,254,234, 94, 75, 75, 26, 93,118,122, 70,251,151,217, 79,240,157, 5, 11, 22,120,152,155,155, 99,218,180, +105, 88,182,108, 25, 22, 47, 94,236, 50,109,218,180,247, 1,108,104,130,142,216,198,198,230,230,166, 77,155,220,187,119,239,142, +147, 39, 79, 98,255,254,253, 72, 72, 72,208, 57, 59, 59,115, 59,119,238,140, 37, 75,150, 96,192,128, 1, 83,166, 79,159,222, 43, + 61, 61,221,223, 64,211, 49,121,201,146, 37,195,123,244,232,129, 73,147, 38, 85, 92,184,112, 97, 20,128, 51,191,255,254,123,223, +136,136,136,195, 63,253,244,147, 56, 36, 36,100,224,172, 89,179, 62, 0,176,181, 25,251, 63,162,103,207,158, 0,128, 30, 61,122, + 96,237,218,181, 3, 90,104,176, 4, 22, 22, 22, 39,246,238,221,235,231,230,230,134,183,223,126,219,127,212,168, 81, 39,242,243, +243,251, 3, 48,232,185,145, 10,133,226,203,109,219,182,181, 23,139,197, 6,255,169, 90,173, 54,159, 58,117,234,154,166, 24, 44, +111,111,111, 92,184,112, 1,253,250,245,131,151,151, 87,251,169, 83,167,174, 27, 48, 96, 0, 62,253,244,211,203, 58,157,206, 54, + 51, 51,211,208, 7, 61, 59, 1,168,126,110,169, 35, 0, 23, 84, 54, 7, 2, 64,231,170,247,103, 85,102,171,131, 33, 6, 11, 34, +163,119,134, 13, 25, 34,253,191,200, 44,232, 25, 6,238,118, 34,120, 56,202,144,152, 85,142,196,180, 92,240, 40, 13,164, 98, 33, +124,186,189,102,150,151,153,248, 14, 12,233, 30, 32,148,188, 51, 98,216, 16,227,159,175,102,161, 32,237, 62, 73,186,121,240,188, +182,188,116, 10, 0, 60,184,248,227,247,214,102,162,254,174,190,157, 56,101,193,195,205, 34,142,126,247, 78, 62,192, 26,172, 63, + 31,210,132, 40,239, 63, 47,130, 85, 77,110, 1, 84, 22, 54, 30, 72,201,136,174,252,158,155,139,220,220, 92,180,109,219, 22,155, + 55,111,126, 97,219,230, 62,129,254,207,208,180, 52, 51,197,176, 62,189, 56,247, 98,191,227,168, 24, 85,171,104,254,109,115, 34, + 33,132,162, 40, 42, 41, 71,107,154, 83,164,229,143,238,227, 64,120, 28, 26, 99,250, 56, 82, 91,143, 37,241,115, 84, 18, 83, 14, +135, 67, 19, 66, 26,189,147,247,247,247,231,121,123,123,127,182,115,231, 78,158, 82,169,132,169,169, 41,180, 90, 45,162,163,163, +211,149, 74,101, 2, 0,100,100,100,196,222,184,113, 35, 83,175,215,219,187,187,187, 99,234,212,169,232,208,161, 3, 53,123,246, +236,185, 7, 14, 28, 88,142, 58, 70, 44,102,102,102,134, 44, 92,184,176,231,170,181,155, 45,198,119,166, 80, 90,166, 70, 73, 73, + 9, 18,227,238,131,148,168,177,126,253,215, 16,139,197, 20, 0,126,118,118, 54,127,233,210, 37, 59, 76, 77, 77,135,220,190,125, +123,100,189, 6, 61, 51,115,229,146, 37, 75,130,214,175, 95,111, 94, 82, 82, 2, 85,121, 57,138, 85, 2, 92,255,186, 50, 66,217, +121,214, 13,108,253,106, 29,237,237,100,100, 81, 82, 82,130,207, 62,251,108,147, 68, 34,233, 18, 19, 19,243, 97,125,154,105,105, +105, 49, 11, 22, 44,144,111,217,178, 69,216,161, 67,135,187, 69, 69, 69,200,207,207,167,143, 28, 57,178,194,201,201,201,124,211, +166,205,148, 68, 34, 1, 0,164,164,164,240, 23, 45, 90,120,192,216,216,248,167,123,247,238, 77,170,239,244, 68, 44,237, 93, 1, + 16,165,173,109,219,246,101, 87,233,165,182,182,229,151, 35,150,166,135, 2, 68, 89, 21,135, 36, 54, 54, 54,227,147,247, 10,123, + 84, 84, 48, 27, 51, 50,146, 30, 3, 47,247,161,178,150,150,150,211,135, 15, 31,142, 53,107,214,224,216,177, 99,179,204,205,205, +191, 94,182,108, 25,108,109,109, 63, 78, 79, 79,223, 88, 85, 0, 26,194, 87, 27, 54,108,112,119,119,119,199,196,137, 19,213,103, +207,158, 93, 0,224, 40,128,164, 75,151, 46, 57,238,217,179,103,232,129, 3, 7,214,108,218,180, 73,180,101,203,150,246,111,188, +241,198, 70,134, 97,222,109, 76,212,218,218,250,211,177, 99,199, 98,221,186,117,184,112,225,194, 27, 0, 78, 86,173, 58,117,229, +202,149,161, 33, 33, 33,231, 22, 45, 90,132, 13, 27, 54,204, 76, 77, 77,109,170,193, 50,246,240,240,248, 98,224,192,129,184,116, +233, 18,130,131,131,209,181,107,215, 89, 87,175, 94,221,140,202,166,173,166, 66, 27, 27, 27, 31,216,189,123,119,112,155, 54,109, +176,114,229, 74,124,246,217,103,216,185,115,103,240,219,111,191,125,160,180,180,116, 36, 12, 24,229,107,108,108,108, 44, 22,139, +177,102,205, 26,146,156,156,220,104,244, 84,161, 80,152,125,241,197, 23,148,137, 97,205, 0, 28, 91, 91, 91, 19,107,107,235,158, + 54, 54, 54,216,180,105, 19,172,172,172, 48,107,214, 44, 88, 88, 88,160,180,180, 20, 35, 71,142,228, 93,187,118,109, 12,128,205, + 6,238,183, 5,128,234,136,151, 71,149,185, 42,174,250,126, 13, 64,143, 42,131,149, 7,192,220,160, 3, 73,136,183,153,169, 12, +233,119, 51,193,133, 14,238,142, 82,220,138, 47,133, 70, 79, 32, 49, 50, 70,105,113, 1,124,219,203, 81, 84,102, 15,128, 49,104, + 18, 76, 62,135,238, 36, 16,138,145, 85, 84,136,140,135,231,114, 53,250,138,169,133,207,174,164, 0,128, 89,219,224,169,247,175, +159,190, 53,114, 80,176, 85,118,190, 35, 8, 97,130,192,194,210,148,139,191,177, 13, 24,230,143,215,126,205,136, 80, 53, 26, 77, +203,110,184,255, 12,205,186,248, 51, 52,255, 14, 62,203,206,140, 91,104, 36,162,117,191,223,202,210,107,117,122,252,118, 43, 67, + 47, 17, 82, 58, 51,161,186,136, 97, 24,131, 42,196,168,168, 40,237,165, 75,151,246,206,159, 63, 31, 27, 54,108,192,211,167, 79, +193,227,241,224,230,230,102,109,111,111,175,168, 42,184, 29,188,188,188, 44, 57, 28, 14,226,227,227,177,127,255,126, 44, 93,186, +148,220,190,125,123,103,125, 21,133, 82,169,140,206,204,204,220,182,122,249,130, 2, 94, 69, 58, 36,250,108,232, 11,158,130,167, + 47,196,244, 89,243,241, 44, 71,143,232,103,197,136,126, 86,140, 12,149, 8, 95,172, 92,207,113,113,113, 25,106,103,103, 55,160, +190,180,166,167,167, 95, 83, 42,149,161,139, 23, 47, 46,204,201,201,121,158,127, 52, 58, 6, 26, 29, 83,187,114,194,234,213,171, + 77, 21, 10,197,104, 91, 91,219,222,245,105,102,103,103,103,165,167,167,199,207,159, 63, 95,147,157,157,141,162,162, 34,156, 62, +125,250,141,182,109,219,154,207,158,191,156,122,150, 67,158,167,179,144, 49,197,186,205,219, 57,237,218,181, 27,167, 80, 40, 26, +236, 71,100,107,107,215,222,195,163,221,161,107,215,174, 77,106,223,190,253,135,213,198,170,218, 72, 57, 59, 59, 79,187,125,251, +246,100, 63, 63,207, 67,214,214, 54, 29, 94,114, 94,234, 51,122,244,232, 14, 12,195,224,208,161, 67,119, 1,108,248,249,231,159, +111, 86, 84, 84, 96,204,152, 49,206, 0, 6, 26,168, 19, 56,110,220,184, 15,131,131,131, 49,115,230, 76,205,217,179,103, 59, 1, +248, 26,149,163,199, 8,128, 36, 0,155, 35, 34, 34,124,167, 79,159, 94, 17, 20, 20,132, 73,147, 38, 77, 70,253,125,114,170,233, + 54,118,236, 88,119,134, 97, 16, 22, 22,118,167,134,185,170,230,252,225,195,135,175,169,213,106,140, 31, 63,190, 45,128,190, 77, +216,119,190, 80, 40, 60,180, 98,197, 10,211,180,180, 52, 76,152, 48,161, 34, 54, 54, 22, 75,151, 46, 21,155,152,152,156, 4, 96, +220,212,131, 41, 20, 10,127,248,238,187,239,134,251,248,248,224,131, 15, 62, 80,127,251,237,183, 51, 62,252,240, 67,117,167, 78, +157,240,205, 55,223, 12, 23, 8, 4, 77,122, 4, 72,102,102,102, 65, 68, 68,132, 69, 99,175,140,140,140, 76, 67,244, 28, 28, 28, + 76,189,188,188,238, 6, 6, 6,230,116,236,216,177, 29, 0,220,191,127, 63,251,208,161, 67,196,194,194, 2,167, 79,159,198, 15, + 63,252,128,238,221,187, 67, 42,149,142,105, 98, 20,130,212,248, 92,215,250,218,219, 53, 12, 69,145,194, 50, 29,184, 52, 13, 30, +135, 32, 41,179, 28, 26, 61, 1,159, 71,131,199, 1,184, 52,129,133,148, 7, 30,143, 3, 67,111, 82,104,138, 66,126,169, 22, 92, + 14, 5,158,128, 79,209, 58,253,243, 16, 33,205,213,139,133, 34, 33,101,101,194, 7,159, 75,129,162,192,194,210,122, 17, 44, 0, +208,235,255, 24,248,168, 43, 10,164, 86,171, 91,148,144, 63, 67,179, 46,254, 12,205,151, 73, 81, 81, 17, 55, 34, 34,194,132,199, +227, 25, 13,241,233,158,251,229,193, 56,203,101,251, 30, 67,192, 1, 53,180, 35,173,188, 16,126,150,202,207,207, 55,115,113,113, +201, 55, 68, 47, 33, 33, 97, 74,104,104,232, 74,154,166,131,244,122,253,193, 13, 27, 54, 96,235,214,173,146,105,211,166,197,234, +245,250, 52, 87, 87, 87,135,141, 27, 55, 10, 1, 32, 52, 52, 20,191,253,246,219, 8, 30,143,119, 35, 57, 57, 57,163, 33,221, 59, +119,238, 44, 42, 40, 40,136, 76, 72, 72,216, 76, 81,148,169, 84, 42, 53,251,249,231,159, 41,101,129, 26,139, 66,159, 62, 31, 89, +104, 36,228, 96,254,235,114,188,249,230, 91,220, 39, 79,158,124,149,150,150,246, 91,125,154,209,209,209,179, 10, 10, 10, 34,226, +226,226, 54,240, 45,220, 44, 68,222,239, 75,251,206,175,108,126, 84,152, 11, 65, 87, 21,136,133,133,133,200,201,201,193,228,201, +147, 77, 87,173, 90, 53, 55, 61, 61,253, 66,125,154, 49, 49, 49,215, 10, 11, 11,149,113,113,113, 93, 8, 33, 2, 19, 19,147,238, + 27, 54,108,160,146,242,212,152,183, 39, 30,197,229,149,233,148,138,120, 88, 62,214, 30,147, 38, 77,226, 62,123,246,236, 75,165, + 82,217,163,110,115,101,235,226,225,225,113,104,223,190,125, 30, 27, 55,110,204,123,242,228, 73,169, 66,161, 88, 86,115,155,196, +196,196,138,213,171, 87,231,134,134,134,186, 77,152, 48,225, 80, 84, 84,212,168,230, 78,169,209, 82,100, 50,217,154,169, 83,167, +226,192,129, 3,200,207,207,223, 88,149,199, 54,236,219,183, 47,108,202,148, 41, 8, 13, 13, 93,147,157,157,125,218,128, 74,113, +208,152, 49, 99,112,234,212, 41,156, 59,119,238, 11, 0, 15,234,217, 46,238,210,165, 75,115,127,249,229,151, 77, 99,199,142,197, +174, 93,187, 6,162,178, 3,116,125,244, 31, 48, 96, 0, 78,158, 60,137,220,220,220,111,234,218,160,160,160,224,219, 95,127,253, +181,203,128, 1, 3,176,122,245,234,254, 0,206, 27,176,235,238, 38, 38, 38,187, 55,109,218, 20,232,227,227,131,113,227,198,149, +107, 52,154,129,159,125,246,217,177,253,251,247, 75,247,238,221, 27,240,254,251,239, 95,207,202,202,122,175, 42, 2,211,120,229, + 77,211, 33,235,215,175,127,183,119,239,222,152, 53,107,150,238,183,223,126, 27, 6,224,204,233,211,167,227, 63,255,252,243, 19, +235,215,175,231,172, 91,183,238,221, 79, 62,249, 36,155, 97,152, 5, 47,227,124, 83, 20,181,110,253,250,245, 30,158,158,158, 40, + 47, 47,199,211,167, 79,145,153,153,185,239,244,233,211,103,238,221,187,183, 54, 35, 35,227,136,181,181,245,148, 89,179,102,217, + 7, 6, 6, 6,150,150,150,154, 25,210,255,176, 70,100, 42, 11,192, 67, 84, 14, 44,170, 62,110,157, 81,217, 52, 8, 84,142, 40, +204, 55, 48,177,119,227,158,165,181, 53, 51,150, 33,159, 17,224, 89, 90, 14,196, 70, 70,160, 9, 13,157, 42, 31, 46, 78, 86, 96, + 8, 80,148,147, 6,154,166,238, 26, 34,169,213, 51,183, 19, 83, 50,237, 76,141, 68,112,233, 52,216,226,206,249, 93, 63,202,218, +118,127,159,203,161, 56, 60,129,241,182,113, 99, 39, 90,106,245, 4, 37,249, 74, 80, 28,250, 6, 88, 88, 90, 59,130, 85,187,221, +191,118, 20, 72, 44, 22,163,162,162,105,211,165,252, 25,154,134,252,103,107,107,190, 76,180, 90,173,244,195, 15, 63,236,145,154, +154, 42,115,115,115,139, 31, 28, 40,191,186,115, 70,219,171,157,101, 15,202, 22,190, 70, 93,117, 16,101,222, 20, 10,133,201,249, +249,249,130,208,208, 80,127,173, 86, 43, 49, 68, 55, 35, 35, 35, 57, 61, 61,253,208,225,195,135,127, 60,126,252, 56, 58,116,232, +128,139, 23, 47, 74,227,226,226,220,195,195,195,141, 92, 92, 92,112,228,200, 17,252,250,235,175,219,149, 74,229, 47,141,153,171, +106,146,147,147, 79,199,196,196,180,207,205,205,109,111,106,106,170, 53, 53, 53, 69,237,145,133,165, 21,122, 20, 20, 21,195,212, +212, 20, 18,137,196,185, 49,205,196,196,196, 99,119,238,220,105, 11,115,247, 96, 78,194,190,194,111, 63,238,128,111, 63,238,128, + 21,111,183,131,141,153, 0, 5, 5, 5,200,206,206, 70,118,118, 54, 8, 33,208,235,245, 30, 6,104, 38,199,196,196, 28, 72, 75, + 75, 59, 43,151,203, 41, 99, 99, 99, 16, 0,249, 37, 26, 92, 89, 27,136, 43,107, 3,145, 95,162, 65,113, 73, 41,236,236,236, 32, +149, 74,235,108,142, 48, 51, 51,147, 18, 66,246,236,216,177,195, 93, 42,149,114,166, 76,153, 98,122,245,234,213, 30, 87,175, 94, +157, 87,235,213,227,227,143, 63, 54,147, 72, 36,156, 93,187,118,185,114, 56,156,221, 78, 78, 78, 38,127,113,118,226, 0,248,104, +202,148, 41, 1, 34,145, 8, 91,183,110, 77, 0,240, 83,213,186, 67,223,126,251,109, 44, 0,204,152, 49,195, 11,192, 44, 52, 60, +146, 18,124, 62,191,147,135,135, 7,174, 94,189, 10, 0, 63, 55,242,223,135, 35, 35, 35,225,226,226, 2,145, 72, 20,216,200,182, +206, 14, 14, 14,136,141,141, 5,128,232,250,188,119,108,108, 44, 28, 28, 28, 64, 81,148,179, 1,251, 62,252,213, 87, 95,189, 27, + 30, 30, 30,216,173, 91, 55,188,251,238,187,234,235,215,175, 15, 6,112, 49, 58, 58,186,207,248,241,227, 75, 93, 93, 93, 17, 17, + 17,225, 62,126,252,248, 72,154,166, 87, 26,160, 57,121,249,242,229,243, 71,140, 24,129,229,203,151,147,131, 7, 15,142, 3,112, +166,106,221,111, 97, 97, 97, 19, 86,173, 90, 69, 70,142, 28,137,101,203,150,205, 7,240, 65, 67, 98,101,101,101,133,122,189, 30, +101,101,101, 6,221, 33, 26,186,125,219,182,109, 7,121,122,122,226,151, 95,126,129, 64, 32,192,239,191,255, 14,154,166, 79,100, +100,100,156,185,125,251,182, 79,122,122,250, 10,165, 82,121, 56, 62, 62, 30,193,193,193,180, 94,175, 31,105, 96,126,122, 6,192, +167,234,115, 10, 42,251, 99,117, 3,208, 29, 64, 92, 85, 36, 19,168,124,158,221, 51, 67, 4, 25,117,201,222,115, 39, 15, 23,154, + 25,243, 97,105,102, 4,107, 75, 25, 56,218, 82, 64, 93,128,246, 78,214, 8,242,176,193,179, 44, 53, 34,207, 30, 42, 40, 43, 41, + 51,104,122, 9,189,166,116,247,185,211,191, 20,154, 27,243,209,166,189, 39,134,142,155,233,231,238,211,249,119,111,255, 30,191, + 45, 90, 18,210,241,213, 30, 30,212,131,148,114, 92, 59,119, 52,191,172,184,104, 55,107, 25, 88,154, 27,193,170, 43, 0,154, 53, +107,214, 44,171,217,179,103, 67, 38,147, 33, 55, 55, 23, 90,173,246,121,180, 73, 40, 20,194,212,212, 20,185,185,185, 8, 11, 11, + 67,213,221, 74,253, 37, 56, 71,160, 92,249,205, 22, 7,138, 99,164, 22,138, 37,196, 92,210,114, 77, 0, 80,107,185, 89,223,133, + 29, 49, 31,212,179, 43,215, 81,161,248,195,250,230,104,254, 67, 12,214,239, 25, 25, 25, 1, 29, 58,116,200,112,114,114, 82,149, +151,151,131,168, 84,197, 39,195, 54,182,115, 48,249,224, 41, 77,211, 68, 44, 22, 51,166,166,166,165, 79,159, 62,165,116, 58, 93, +120, 83,244, 9, 33,211,166, 77,155, 70, 95,186,116,105,220,219,111,191,141, 54,109,218, 32, 58, 58, 26,161,161,161, 56,124,248, +240, 30, 62,159, 63,163, 57,233, 78, 73, 73, 41,241,240,240,120, 33, 2, 82,123,100,161,182, 34, 27, 12,195, 24,220, 57, 63, 63, + 42,244, 49,199,210, 82,235,229,248,191,233, 68,242,243,243,145,157,147,131,236,236,108,228, 84,189, 19, 66, 12, 14, 97, 82, 20, + 85,172, 86,171,107,165,243,127,205,143,165,165,165,208, 84,100, 65,175,215,215,169,153,159,159, 95,172, 80, 40,182,108,222,188, +121,253,138, 21, 43,172, 54,108,216,144,247,232,209,163, 34,154,166,203,107,221,196,136,218,183,111, 47, 93,183,110,157,245,230, +205,155,243, 24,134,217,146,148,148, 84,248, 23,102,165, 17, 62, 62, 62,123, 6, 13, 26, 36,253,240,195, 15,177,121,243,102, 40, +149,202,121, 0,170, 71, 50, 50, 57, 57, 57,159,127,243,205, 55,199,231,206,157, 11,141, 70,179,238,228,201,147,203,162,162,162, +166,213, 48, 97, 47, 32,151,203,237,185, 92, 46,162,162,162,138, 0, 60,109,204,211, 71, 69, 69,101, 82, 20,101,173, 80, 40,218, + 37, 36, 36,212,187,161,185,185,121,123,169, 84,138,180,180, 52, 52, 80, 49, 39,166,167,167, 19,129, 64, 64,217,218,218,186, 84, +109, 91, 47,102,102,102,159,239,216,177,131, 27, 30, 30,142, 37, 75,150,164, 38, 37, 37,141,175, 17, 69,139,186,125,251,118,112, +159, 62,125,246,207,157, 59,215,237,203, 47,191,164, 98, 99, 99, 63,136,138,138, 90,212,144,166,147,147,211,180,201,147, 39, 99, +203,150, 45,216,182,109,219, 7, 0, 14,213,218,100,255, 55,223,124, 99,102, 97, 97,177,101,234,212,169,216,189,123,247,248,103, +207,158,125, 87,159, 94, 90, 90,218,220,209,163, 71, 47,206,203,203, 11, 49,228,132, 26,178,189, 66,161, 24, 22, 16, 16, 96, 77, + 8,193,230,205,155, 51,182,108,217, 82, 86, 84, 84,244,147, 82,169, 12,175, 21,137, 59,114,250,244,233, 89, 31,126,248, 33,194, +195,195,183, 70, 68, 68, 16,165, 82,185,163,145, 36, 40, 81, 57,207,149, 71, 85, 4, 43, 5,127,236,200,238, 86,245,158,106,200, + 62,229,198, 93, 56,198,225,137,174,196,220,184,240,170,179, 87, 48,207,202, 76, 10, 59, 23, 75,152, 27,243, 65, 0,220, 75, 82, +225,218,197, 51,218, 44,101,114,164, 33, 35, 8,171, 53,159,240,197,145, 18, 75,167, 87,219,122,246,224, 58,187,184,162,127,247, +142,102, 22, 50, 30,212, 90,130,223, 99, 10,113, 53,226,148, 54, 43, 51, 37,156, 29, 65,248,215, 5, 86,255, 75, 17,174, 96, 46, +151,251,213,231,159,127,190,237,225,195,135,219,226,226,226,182, 69, 69, 69,109, 91,185,114,229,182,165, 75,151,110, 11, 8, 8, +216, 70,211,244, 87,168,236, 59, 81, 59, 34,230,253, 87,104,246,234, 5,238,184,129, 88,185,124, 26,183, 44,116,165,131, 54,251, +226, 40, 66,238,127, 64,150, 79, 3,105, 65, 58, 91,202, 95,165,233,197,229,114, 79, 59, 57, 57, 93,219,187,119,239,129,168,168, +168, 93,230,230,230,233, 43, 87,174,220, 49, 99,198,140, 48, 27, 27,155, 27, 60, 30,239, 44,128,142,205, 77,167,181,181,245, 27, +111,191,253, 54, 57,117,234, 20,121,243,205, 55,137,173,173,237,224,150,238,123,151, 46, 93, 50,238,221,187, 71, 30,166,148,146, + 55, 86,197,144,238,115,110,146,238,115,110,146,129,139,110,144,239,247,159, 33, 75,150, 44, 37,222,222,222,103,155,162,233,235, +235, 27,151,149,149, 69, 8, 33, 36, 47, 47,143,196,198,198,146, 75,151, 46,145, 35, 71,142,144,109,219,182,145,144,144, 16,166, + 99,199,142,123,154,162,217,181,107,215,188, 39, 79,158,144, 7,201,165,100,196,138, 59, 85,233,188, 65,134, 44,185, 77,194, 78, + 92, 35,203,151, 47, 39,158,158,158, 7, 27,210, 84, 40, 20, 99,230,204,153,163,204,203,203,211, 6, 6, 6, 70,212, 94,239,239, +239,127, 52, 39, 39, 71,187,112,225,194, 76, 91, 91,219,137,127,117, 94,178,176,176,184,146,154,154, 74, 18, 18, 18,200,103,159, +125, 70, 56, 28, 78,157,149, 39, 77,211, 91,103,206,156, 73,158, 62,125, 74,210,211,211,137, 66,161,136,110, 32,157, 67,172,172, +172,110, 1, 24, 97, 96,122,134, 88, 89, 89,221, 0, 48,178,161,125,119,116,116,124,144,154,154, 74, 60, 61, 61,243, 26, 18,115, +113,113, 73, 73, 77, 77, 37,174,174,174,105, 6, 28,207,215,172,173,173,111, 3, 88, 5, 64,212,192,205,232,167, 54, 54, 54, 87, + 0,124,100,128,230,112, 55, 55,183, 40, 0,211, 27,217,239,247,157,157,157, 99, 0,188,246, 87,159,119, 47, 47,175,171,105,105, +105,100,251,246,237, 68,161, 80,204,109,232, 71,109,218,180,249,229,216,177, 99, 68,169, 84, 18, 63, 63,191, 40, 3,211,201, 5, +208, 11,149,253,224,108, 80, 57,241, 40, 15,128, 53,128,222, 0,250,160,242, 9, 28, 6,151, 33, 22,174,221,140,173,189, 7, 29, +247,124,117,122,222,164,213,225,100,238,158,120,242,197, 79, 9,100,230,230,203, 36,112,200,204, 60,219,142,175, 29,183,112,237, +102,220, 84, 77,133,207,224, 19, 29, 7,127,154,247,206,234,115,100,193,222,167,100,233,254, 4,242,201,198, 8, 18, 52,108,102, +174,125,199,161, 63, 91,121,247,151,188,228,114,254,191,162, 89,231, 53,242,111, 55, 90, 2, 0,175, 73,165,210,205, 75,150, 44, +217,118,253,250,245,109, 67,134, 12,217, 38, 16, 8, 54, 87, 21, 12,130,102,156,128, 86,215, 28, 24, 4,233,228, 97,244,174, 21, + 31,112, 53, 71, 55,116,208, 46,159, 6,210, 10,233,252,167,100,232, 30, 60, 30,239,170,143,143, 79,184, 84, 42,205,110,211,166, +205, 37, 30,143,119, 3, 64,207,150,166,211,218,218,218,242,221,119,223,101,158, 61,123, 70, 38, 78,156, 72, 12,104,190,106, 84, +211,193,193,161,239,200,145, 35,181, 41, 25, 5,228, 82, 76, 10, 57,126,241, 1,217,119,252, 42,217,182,255, 12,217,248,221, 30, +210,191,127,255, 10,107,107,107,167,166,104, 58, 58, 58, 14, 28, 54,108, 88, 65, 78, 78, 14,137,141,141, 37, 23, 47, 94,124,110, +174,190,251,238, 59,210,177, 99,199, 92, 59, 59, 59,219,166,104, 58, 57, 57, 13, 31, 63,126,188, 86,153, 91, 74,174, 63,200, 32, +191, 95,143, 39, 71,207,223, 33,251,143, 95, 37,123,246,255, 76,122,245,234, 85,110,105,105,105,221,152,166, 66,161, 24, 61,106, +212,168, 39,110,110,110,223,215, 97, 6,190, 25, 53,106, 84,146,173,173,237,132,151,148,151, 6,218,217,217,197,242,249,252, 19, + 0, 38, 52,242,187, 49, 92, 46,247,152,141,141,205, 77, 0,175,191,132, 60, 63,196,202,202,234, 26,128, 97, 6, 24,182,107,245, + 24, 60,182, 82,172,204,147, 67,124,125,125, 99,108,108,108,214,163,145, 38, 95, 59, 59, 59,145, 66,161,248,202,207,207,239,170, +141,141,205,200, 38,166,211,190,234,198,118,120,213, 43, 24,149,115, 95, 53,123,223, 45, 92,251, 13,181,243, 27,118,212,182,227, +107, 73,182, 29,135, 36,217,251, 15, 63,106,225,218,111,104, 75, 53,237,253,135,255, 98,235, 59, 36,217,222,119,104,162,163,255, +240,163,150, 29,250, 13, 98,205, 16,107,176,254, 42,140, 1,140,161,105,122, 43,128, 49,104,124, 84,141,247,203,208, 28,216, 11, +118, 31,190,201, 57, 57,111, 18, 47,187, 21,211,249, 79,201,208,195,185, 92,110,100, 85, 65,214,106,233,116,113,113,217, 49,117, +234, 84,189,163,163,227,150,214,210,244,240,240, 88, 63,116,232, 80,205, 15, 63,252, 64,126,253,245, 87,178, 99,199, 14,242,217, +103,159,145,222,189,123, 87,184,185,185, 77,106,142,166,143,143,207,138,190,125,251,230,132,133,133,145, 3, 7, 14,144,173, 91, +183,146,144,144, 16,198,207,207, 47,203,205,205,109, 72,115, 52,189,189,189,127, 24, 62,124,184,102,239,222,189,228,252,249,243, +228,192,129, 3,100,209,162, 69,164, 87,175, 94,229,174,174,174,111, 24,170,217,174, 93,187,250, 12, 62,252,253,253,121,108,129, +203,106,178,154,172, 38,107,176,254,187, 6,171, 26,238,159,112, 2,254, 41,154,255,217,139, 68,161, 80,136, 91, 91,211,214,214, +182,163,151,151,215,185,206,157, 59,231, 7, 6, 6,102,121,123,123, 31, 81, 40, 20, 14, 45, 76,167,159,191,191,255, 33, 63, 63, +191, 39,254,254,254,247,125,124,124,190,175,158,102,162, 5,233,236,236,227,227,115, 33, 40, 40,168, 32, 48, 48, 48,211,211,211, + 51,172, 86,228,138,205, 75,172, 38,171,201,106,178,154,172,193,106,178, 1,169,205,159,241, 24,143,127,138,230,127, 22,165, 82, +169,106,109,205,244,244,244, 59,233,233,233,175,180,114, 58,163,149, 74,229, 91,173,156,206,235,233,233,233,189,217, 92,192,194, +194,194,194, 98, 8, 52,123, 8, 88, 88, 88, 88, 88, 88, 88, 88, 90, 23, 10,245,135,249,154,242,164,236,230,132, 10,239,177,154, +172, 38,171,201,106,178,154,172, 38,171,249,159,211,172,173, 93,187, 47,107,237,209,191, 63,128,165, 85, 78, 12,171,201,106,178, +154,172, 38,171,201,106,178,154,255, 61,205,127, 21,108, 19, 33, 11, 11, 11, 11, 11, 11, 11, 11,107,176, 88, 88, 88, 88, 88, 88, + 88, 88, 88,131,197,194,194,194,194,194,194,194,194, 26, 44, 22, 22, 22, 22, 22, 22, 22, 22, 22,214, 96,177,176,176,176,176,176, +176,176,176,176,176,176,176,176,176,176,176,252, 87, 32,236, 33, 96, 97, 97, 97, 97, 97, 97, 97,189, 72,203, 96,155, 8, 89, 88, + 88, 88, 88, 88, 88, 88, 88,131,197,194,194,194,194,194,194,194,242,207, 48, 88,108,211, 32, 11, 11, 11, 11, 11, 11,203,203,228, + 95,233, 69,122, 85,237, 88, 47,246,252,178,176,176,176,176,176,176,176, 94,132,133,133,133,133,133,133,133,133,133,133,133,133, +133,133,133,133,133,133,165,249,176, 79, 26,103, 53, 89, 77, 86,147,213,100, 53, 89, 77, 86,243, 63, 7, 59,138,144,133,133,133, +133,133,133,133,133, 53, 88, 44, 44, 44, 44, 44, 44, 44, 44,172,193, 98, 97, 97, 97, 97, 97, 97, 97, 97, 13, 22, 11, 11, 11, 11, + 11, 11, 11, 11, 11,107,176, 88, 88, 88, 88, 88, 88, 88, 88,254, 54, 80,168,127, 36,192,189, 38,232, 52,103, 52,193, 61, 86,147, +213,100, 53, 89, 77, 86,147,213,100, 53,255,115,154,141,105,223, 3,203,159, 98,188, 88, 77, 86,147,213,100, 53, 89, 77, 86,147, +213,252,239,105,254,171,224,178,135,128,133,229,159, 13, 57, 4, 14,172, 58, 56,131, 33,182,224, 10,148, 56,127,247, 41,181, 20, + 76,139, 53,109, 61,157,160,214, 90, 67, 44,202,198,111,119, 18, 90,170,201,194,194,194,194, 26, 44, 22, 22,150,127, 14, 10,119, + 55,232,177, 26, 28, 40, 64, 52,241,232,238,185, 26,120,208,178, 16,187,133,187, 27,180,204, 74,112,105,123,168, 53,143,209,179, +195, 26, 32,246, 1,123,176, 89, 88, 88, 88, 12,227,165,116,114, 15, 8, 8,184, 29, 16, 16,176,162, 87,175, 94, 66,246, 20,176, +176, 52, 31,114,215, 91, 2,157,126,144, 90,203,216,157,142, 44,176, 42, 43,215,187,129,175, 27, 76,174,184, 26,183, 72,147, 71, +189, 90,174,101, 28,127,252,189,204,186,180, 92,231, 1, 26, 45,210,172,198,203,203,203, 52, 48, 48,240,180,175,175,175, 37,123, +246, 88, 88, 88, 88,131,213,202, 48, 12,227,111,101,101, 53, 75,165, 82, 37,117,234,212,105,216,127,233,128,119,238,220, 57,178, + 75,151, 46,153, 93,187,118,205,236,218,181,107, 84, 99,203,255,141, 40, 20, 10, 55,111,111,239, 36, 79, 79,207,199, 53,151,203, + 59,190,222,205, 61,120,194, 18, 11,207,225,189,216, 75,211, 64, 74, 25,107,208,156, 62, 15, 18,203, 36, 25, 5, 90,235,219,177, +101, 82, 16, 78,111,104,160,104,145, 38, 67,250,198,196,171,140,174, 62,149, 91, 95,186, 87, 33, 3,161,251,128, 80, 54, 45, 77, +174, 64, 32,248,128, 16,210,159,199,227,205,100, 79,222,127, 30,111, 0,195, 0, 4,182,162,230,151, 29, 58,116, 72, 3,240, 9, +123,120, 89,254, 49, 6,235, 77,103,116, 31,219, 22, 17,163,156, 81, 60,186, 45, 74,198,183,197,229, 55,218,161,217, 21,225,145, + 35, 71,196,161,161,161, 86,158,158,158, 97, 65, 65, 65,151, 59,117,234,228,218, 28,157,128,128,128,211, 1, 1, 1,111,213, 94, +214,169, 83,167,209, 53,151, 5, 6, 6,222, 15, 12, 12, 44, 12, 8, 8,120,106,136,174,191,191,255, 19,127,127,255,210,128,128, +128, 39, 53,151,119,234,212,105,116, 96, 96,224,233, 90,255,247, 86,237,101,245, 30,112,154,182, 63,118,236,152,213,137, 19, 39, +172,184, 92,174,117,237,229,199,143, 31,127, 97,121, 51,142,199,148,128,128,128,200, 90,251,242, 94,237,234,112, 30, 91, 0, 0, + 32, 0, 73, 68, 65, 84,101, 13,209,169, 83,167, 72,127,127,255,247,106,233, 70, 6, 4, 4, 76,105, 13,115,213,179,103,207,203, +209,209,209,142, 82,169,212,180,230, 58, 27, 11,211, 1,145,199,191,153, 53,233,173, 87, 63,144,123,140,240, 97, 47,207,134, 33, + 15, 61,248,208, 49, 61, 25,134,200, 31, 60, 45,151, 15,126,237, 77,110,204, 19,149, 92,171,211,155,131,226,244, 38, 23,156,132, +205,210,212,106,131, 25, 66,172,207,197,240,229,189,135,126,204, 9,191,203,149,107,245,122, 11,104,209,171, 57,154, 53,242, 33, +143,195,225,204,154, 58,117, 42, 77, 81,212,199,237,218,181, 19,252,151,206, 87,144, 55,236,250,118,226,220,240,247, 64,247, 86, +148,245,146, 72, 36,183, 0,184,253,195, 14,135, 63, 0, 9,128, 95, 1, 88,163,117,186,171,108, 88,190,124,249,231,247,238,221, +179,109,219,182,237, 50, 0, 28,182,148, 96,249,219, 27,172,209,206, 88,106,109, 99,119,102,225,134,125, 61,119, 68, 36, 24,127, +123, 44,202,104,214,220,144,238, 54,102,242,147,227,219, 97, 77, 3, 63,189,215,192,157, 44,158, 62,125,138,205,155, 55,139,150, + 46, 93,218,205,196,196,228, 78, 80, 80,208, 70, 15, 15, 15,163, 70,146,243,130, 38, 33,164, 59,143,199,219, 17, 20, 20,180,187, +186,192,166, 40,170,187, 80, 40,252, 33, 40, 40,232,199,234,102,200, 78,157, 58,181,189,113,227,134,140,162, 40,107, 67,210, 25, + 20, 20,164,184,125,251,182, 4,168,140, 4,244,234,213, 75, 24, 24, 24, 24,106,103,103,183, 13,168, 44, 32,219,181,107, 39, 8, + 10, 10,218,237,224,224,176,157,162,168,238,134,236, 59, 77,211, 48, 53, 53,197,190,125,251,192,225,252,239,250,167, 40, 10,166, +166,166,248,233,167,159, 64, 81, 84,147,143,167,135,135,135, 81, 64, 64,192, 17,133, 66,177,145, 97,152,174, 0,224,237,237, 45, + 9, 12, 12, 60,108,103,103,183,169,122,153, 33,154,132,144,174,124, 62,127, 99, 96, 96,224, 97,111,111,111, 9, 0, 48, 12,211, +149,203,229,110, 8, 8, 8, 56,210,148,115,228,231,231, 55,213,199,199, 39,221,199,199, 39,221,205,205,109,149,181,181,245,133, + 45, 91,182, 88,212,220,247,234,200, 85,102, 86,110,126,228,205,251,177,179,166,190,217,219,209,193,122,188, 73,199,225, 38,134, +236,123, 11,248,103,107,230, 82, 86,160, 72,191,216, 36,149,168,141, 75,128,145,149,251,155,144,155,114,133, 87, 31,150, 74,193, +193, 43,224, 73,228,205,211,228,190,114, 63, 65, 37, 54,107, 59, 72, 18,216,165, 39, 40, 35, 87,225,133,232, 82, 25,184,116,243, + 52,107,220,167,117,237,218, 85,208,175, 95, 63,216,218,218,114, 76, 76, 76,198,255,235,207, 81, 13,115, 37, 21, 9,174,175, 95, +254,105,128,173,133,228, 23, 3, 77, 86, 99,233,244,178,178,178, 10,255,230,155,111, 58, 73,165,210,139, 6,154,172,191,195,241, +244, 7,192, 7,112,173,234,251, 3, 0,193, 45,212,220,176,116,233,210,153,243,231,207, 71,113,113, 49, 38, 77,154, 36, 3,176, +222, 80, 77, 99, 99, 99, 23, 31, 31,159, 31, 61, 61, 61,147,125,125,125,213,238,238,238,229,110,110,110,137, 94, 94, 94,123,132, + 66,161,243,191, 61,127,254,141, 52,235,191,249, 35, 68, 64, 8,233, 67, 8,121,141, 16,242, 10, 33, 36,168,234,115, 96,213,235, + 53, 66, 72,191, 90,239,129, 85,191,173, 94,223,185, 30,141,215,106,255,174,198,111,106,127,127,225,179, 33, 6,139,212,122,127, +206, 91,109,209,205,194,198,238,243, 47,143,222, 20, 51,113, 49,184,253,110, 95,196,126, 50, 2,226, 39, 49,152, 55,125,158, 88, + 42, 53,155,254,102, 91,244,105,206, 1,123,252,248, 49,194,194,194, 96,105,105, 73,237,220,185, 83,248,214, 91,111,125, 32,147, +201, 82, 2, 2, 2,198, 27,170,193,225,112,244,187,119,239, 54, 30, 62,124,248, 24,115,115,243,251,254,254,254,109,105,154,214, +239,221,187,215,120,244,232,209,111,169,213,234,135,157, 58,117,114,141,138,138,210,223,188,121, 19, 52,109, 88,208,238,246,237, +219,186, 83,167, 78, 85, 71,116, 92, 9, 33, 15,215,172, 89, 51,230,231,159,127,150,154,152,152, 48,254,254,254,109, 29, 28, 28, +238,127,249,229,151,227, 15, 31, 62, 44,149,201,100, 6,141,176,162, 40, 10,229,229,229, 16,137, 68, 47, 24, 41,138,162,160, 82, +169, 32, 20, 10, 13, 78, 99,141,200,128,151,133,133,197,163,213,171, 87, 15, 63,122,244,168, 88, 42,149, 34, 32, 32,192,195,212, +212, 52,118,237,218,181, 35,126,249,229, 23,177, 84, 42, 53, 88,143,207,231,227,167,159,126,146,140, 27, 55,110,152, 80, 40,124, + 20, 16, 16,224,193,231,243,177,127,255,126,201,248,241,227,135, 72, 36,146,135,254,254,254, 94,134,104,105,181,218,197, 55,111, +222, 84, 92,184,112, 65,225,228,228, 52,227,219,111,191,181,230,241,120, 0, 0,189, 94,255, 66,228,106,252,200,254,157,103, 46, +254, 38, 92, 85, 94,161, 94, 57,111,114,111,158, 30, 93,216,123,160,122, 10,155, 67,224,128,209,251, 3,104, 31,245, 88,101,233, +219,115, 60, 23, 89,191, 34,200,195,152, 27, 17, 85, 98, 69, 8,113,130,142, 4,145, 11,189,184, 77,210,228, 16, 95, 80,140,235, +153,104,202,178, 91,191,241,220,164,164, 36, 56,123,244,230, 28,191, 9,107, 66,136, 51, 24, 4, 52, 69,179, 38, 60, 30,111,201, +168, 81,163,140, 18, 19, 19,209,173, 91, 55,137, 64, 32, 88,220, 26, 81, 60,114,205,205,137, 68,184,246, 38, 87, 92, 21,205, 77, +219,159, 29,185,146,137, 4,215,246,255,120,192,214, 39,120, 10,181,237, 83, 39,115,185,148,247, 75, 11, 35, 89, 94, 86, 86, 86, +231,175, 95,191,110,241,234,171,175, 98,233,210,165,114,153, 76,102,168,201,122,217,145,171,106,115, 37, 70,101,243, 96, 26, 0, +251, 22,104,110, 90,186,116,233,204, 5, 11, 22,224,218,181,107, 88,187,118, 45, 6, 13, 26, 4, 51, 51,179, 70,203,143,183,223, +126, 91,210,173, 91,183,219,195,134, 13,139,153, 57,115,230,248,227,199,143, 59,236,222,189,155,255,206, 59,239, 8, 71,141, 26, +229,244,233,167,159, 78, 28, 60,120,240,189,160,160,160,235,111,190,249,166,168,153,198,128, 34,132, 80,108,169,101,216,225,170, +207,139, 0,232, 56,127,254,252, 32,138,162,142,207,159, 63, 63, 0,128, 37, 69, 81,199, 1,200, 1,200,171, 62, 11,106,189,203, + 9, 33,253,106,172,183,168, 75,163,250, 85,243,119,213,191,169,227, 63,106,127, 54, 40,130,213, 11,192,197,218, 27,112, 9,150, + 79,157,181, 66,244,108,207,215, 80,254,184, 1,116, 78, 26, 56, 5, 25,168,184,248, 43,180,151,142, 97, 66,215,174, 98, 49, 69, +173,108,206,145,148, 74,165,224,243,249,136,139,139,195,195,135, 15, 49,120,240, 96,254,230,205,155, 77,189,188,188,126,232,214, +173, 91, 76, 64, 64, 64, 71, 67, 12,139,139,139, 11,198,140, 25, 35,248,228,147, 79,218,137, 68,162, 40, 66, 8,207,217,217, 25, +163, 71,143,230,207,157, 59,183,141, 72, 36,186,201, 48, 12, 95, 34,145, 52, 20, 29,250,131,174, 88, 44, 6, 0,158,171,171,235, +173,176,176, 48,231,238,221,187,115,207,156, 57,131,162,162, 34,174,155,155, 91,204,254,253,251,219,119,235,214,141,123,249,242, +101,148,150,150, 18, 67,117, 75, 75, 75, 33, 22,139,255, 96,176, 74, 75, 75,255, 96,188, 26, 35, 32, 32, 96, 74,251,246,237,111, +134,133,133,217, 7, 7, 7,115,194,195,195, 81, 92, 92, 12, 39, 39,167, 91, 97, 97, 97,246,221,187,119,231, 68, 70, 70,162,184, +184,216, 96, 77,129, 64, 0,103,103,103,140, 26, 53,138, 55,103,206, 28,123, 30,143,119, 83, 32, 16,192,201,201, 9,163, 70,141, +226,207,158, 61,219, 94, 32, 16, 92, 55,176,201,144, 3, 0, 58,157, 14,111,189,245,150,145, 88, 44, 70, 74, 74, 10, 24,134, 1, +195, 84,122, 82,101,118,238,221, 43, 55,239, 61,154, 53,237,173, 94,165, 21, 21, 21,191, 93,184,245,208,211,213,201,158,162, 72, + 27,182,188,169, 7, 51, 79, 11,112,208, 63, 41, 93, 45, 20, 24,217, 75,141, 45, 59, 0,121, 23,209,214, 86, 8, 16, 74,116,243, + 81,153, 17,104,210, 31,200,177,104,146,166,158,233,159,144,166, 22,106,196,222,198,182,118,142,200,205,205,133,131,179, 59, 42, + 32, 23, 68,222, 43, 53, 6,105,162,102, 21,190,190,190,193, 14, 14, 14, 54,109,218,180, 65, 78, 78, 14, 92, 92, 92, 96,108,108, +108,230,239,239,223,191,217, 37,241, 5, 39, 33, 10,209, 29, 26,106, 61, 40,122, 25, 8,119, 53,184,217,254,228,182, 63,239,111, +103,174,126, 58, 96,103,161,112, 7,238,189, 11,107,115, 1,118,206,247, 53,151, 75,133,205, 53, 89, 94,214,214,214,231,175, 95, +191,110, 41, 18,137,112,251,246,109,120,122,122,226,235,175,191,150,155,153,153,253,157, 77, 86, 77,115,101, 14, 64, 5,128, 1, + 48,182,153,209, 16, 10,192,214, 21, 43, 86,204, 88,176, 96, 1,174, 94,189, 10, 59, 59, 59,100,101,101, 33, 56, 56, 56, 41, 63, + 63,191,193,122,201,211,211,211, 62, 46, 46, 46,237,211, 79, 63,245, 15, 13, 13, 21, 27, 25, 25,161,160,160, 0,219,183,111,199, +252,249,243, 65, 81, 20, 8, 33,216,181,107,151,100,242,228,201, 65,241,241,241,105, 78, 78, 78, 6,117,223,168, 50, 85, 2, 66, +136, 4,128, 17, 0, 9, 33, 68, 52,125,250,116, 1, 0, 97,149,185, 20, 1,224,177,133,217, 31,168,211,139, 0,176, 92,179,102, + 77, 8, 33,100,200,154, 53,107, 66,106,212,157,199, 27,168,111,107,154, 38, 0, 64,109, 13, 66,200,144,154,239, 53,127, 75, 8, + 25, 66, 8, 25, 82,243,247, 13,253, 95, 67, 6,235, 66,213,142,213,182,147, 29,109,218,118, 64,193,239,135, 32,230, 80, 47,188, +232,132,187,112, 16,113,161, 37,196,171, 57, 71,209,216,216,248,249,139,166,105, 40,149, 74,112, 56, 28, 44, 94,188, 88, 52,125, +250,116, 31, 62,159,127, 53, 56, 56,120,117, 99,134, 5, 0,110,220,184, 1, 23, 23, 23,106,193,130, 5,178, 94,189, 42,239, 98, +239,220,185,131,246,237,219, 83,171, 86,173,146, 14, 29, 58,148,146, 72, 36, 6, 71,135,104,154,134, 88, 44, 70,239,222,189,169, +221,187,119, 27, 11,133, 66,156, 56,113, 2, 57, 57, 57,120,245,213, 87,185,187,119,239, 54, 22,137, 68,136,136,136, 64, 97, 97, +161,193,186, 20, 69,161,162,162,162, 78,131, 85, 87,100,171, 33,186,118,237,186,211,198,198,102, 99,104,104,168, 80, 44, 22, 35, + 60, 60, 28,133,133,133, 24, 51,102,140,238,167,159,126, 18,201,100, 50, 68, 70, 70,162,176,176,176, 89,185,252,198,141, 27,104, +223,190, 61,181,112,225, 66,113,215,174, 93,181, 0, 16, 29, 29, 13, 87, 87, 87,106,225,194,133, 98,153, 76,182,161,123,247,238, + 59, 27,210, 96, 24, 6, 74,165, 18,247,238,221, 67, 66, 66, 2,114,114,114,144,157,157,141,226,226, 98,232,116, 58, 0,128,164, +184,232,196,214,221,199, 98,140,196, 98, 73,103, 31, 87,199,235, 81, 15,178,140,196, 98,137,171,179,163, 27,176,148,125,156,211, + 31,175, 73, 10, 60,181, 43, 8,229,127,237, 65,137,121,240,128,177,124,100,159, 2,136, 22,160,184,232,211,217,158,251,203,229, + 82,107, 48,232, 8, 62,220, 9, 1,101,144, 38, 87,227, 2, 80, 1,103,110,235, 44,122, 12,248,128,159,154,154, 10, 62,159, 15, +161, 80, 8,191,238,111,112,247,135,107,109, 0,248,130,135, 14,134,104,214, 68, 40, 20,126, 49,121,242,100,163,180,180,180,231, +154,131, 6, 13, 50,146, 72, 36, 75,154,109,174,104, 73, 87,232,200,204,251, 9, 42,167, 85,123,148,238, 79, 83, 84,238, 32,152, + 13,173,214,175,165, 38,203,209,209,177,183,171,171,107, 66,155, 54,109,122,180,208, 92, 93, 13,251,233,128,157,185, 77,165,185, +130,190, 12,224,136, 97, 99,101,134,157, 75,122,155,203,101,226,166,154, 44, 47,107,107,235,115,215,174, 93,179, 20,137, 68,184, +117,235, 22, 4, 2, 1, 68, 34, 17,124,124,124,176,109,219, 54,185,185,185,249,223,197,100,153, 1, 24, 0,224, 77, 0,111,212, + 48, 87,206, 0,250, 2,232, 15,192, 6, 64, 4,128, 24, 3, 53,123,112, 56,156, 19, 29, 59,118, 76,231,114,185, 15, 66, 66, 66, + 62,154, 59,119, 46, 54,109,218,132,222,189,123, 63,157, 55,111, 30, 98, 99, 99,117,101,101,101,195, 0, 52, 88, 17,150,148,148, +252,186,112,225, 66,147,215, 95,127,189,250, 59, 46, 95,190,140,189,123,247,194,200,200,168,166, 89,194,208,161, 67, 49,101,202, + 20, 51,181, 90,125,164, 33, 77, 43, 43,171, 87,194,195,195, 93, 1, 8,170, 12, 84,181,193, 50, 58,123,246,172,169, 72, 36, 50, + 15, 10, 10,146, 85, 45,151,188,254,250,235, 22, 92, 46,183, 7, 91,170,189, 64,157, 94,164, 62,131, 83,219, 0,213,181,174, 46, +243,212,236,242,183,129,255,107,200, 96,245,174,202,232,127, 64,147,151, 9, 33,244,144,112, 40,136,185, 84,229, 59,135,130,152, + 98,192,205,207, 4,213,204,224,167,177,177, 49,164, 82,233, 31,140,150, 74,165, 66, 73, 73,137, 65, 70,163,186, 47,143,153,153, +217,243, 74,219,216,184,114, 52,185,185,185, 57, 42, 42, 42, 64, 81, 20,140,140,140, 96,100,100,212,164, 8,150, 72, 84, 25, 17, +142,140,140,196,149, 43, 87,192,229,114, 97,110,110, 14, 0,184,117,235, 22,238,222,189, 11,129, 64, 0, 11, 11,139, 38,233,106, + 52,154, 58,155, 8,213,106,117,147,154, 8,105,154, 70,121,121, 57,185,117,235, 22,238,221,187, 7,161, 80, 8,185, 92, 14,129, + 64,128,148,148, 20, 60,122,244, 8, 2,129, 0,114,185,188, 89,231, 71, 38,147,161,160,160, 0, 12,195, 84, 71,243, 32,147,201, + 80, 82, 82, 2,154,166, 13, 74, 39,195, 48, 72, 75, 75, 67, 78, 78, 14,146,147,147,145,157,157,253,220,100, 85, 55, 17,178, 52, +145,203, 94, 38,160,120,175,102, 23,104,133,217, 37, 2, 19,235,246,253,128,156, 83, 0,197, 1,120,102,232,226,223, 22, 73, 25, +122,163,216,100,181, 8, 90, 12,192,121, 55, 51,131, 52, 57,188,254, 89,133, 90, 97, 98,129, 92,230,225,221, 9, 89, 89, 89, 16, + 10,133, 16, 10,133, 8,232,242, 10, 18,210, 25,201,131,103, 42, 9, 8, 94, 53, 72,179, 10, 63, 63,191,118, 98,177,184,171,191, +191, 63,149,153,153, 9,161, 80, 8,145, 72,132,174, 93,187,130,166,105, 31, 95, 95, 95,247, 38, 21,112,241,237, 4,224, 73,186, + 0,100,230,163,103,101,182,191, 68,170,220,134,142,120,195,124,195,193, 44,247, 71,207,202,157,161,214,205, 65,169,166, 83,115, + 77,150,147,147, 83, 47, 99, 99,227,227, 95,124,241,133,179, 80, 40, 60,213,166, 77,155,224,102,149,111, 66,206,247, 95,204, 28, +107,103, 86,109,174,116,165, 0, 71, 12,112, 36,149, 38,203,218, 18, 43, 63,233,103, 46,225,243,254,207, 80, 77,177, 88,188,127, +235,214,173,242,106,115,197,231,243, 33, 18,137,158,191,252,253,253,177,120,241, 98,185,185,185,249,190,151,156, 75,205, 81,217, +175,234, 14,128, 35, 0,206,213, 48, 87, 46, 0,254,175, 42,106, 21, 5, 32,201, 64,205,110, 3, 7, 14, 12,127,250,244,233,224, +152,152, 24, 69, 70, 70,134,251,236,217,179,177,113,227, 70,204,157, 59,119, 31, 33,196,237,208,161, 67,126, 55,110,220,240, 49, + 36, 34,150,145,145, 49,110,222,188,121, 57, 57, 57, 57, 0, 0,111,111,111, 20, 20, 20, 96,206,156, 57,152, 57,115,102,117,222, + 5, 0,100,101,101, 97,221,186,117,153, 25, 25, 25,147, 26,210,212,235,245, 41, 63,255,252,115, 87,181, 90,237, 88,101, 40,133, + 0, 36, 73, 73, 73, 38,165,165,165, 50, 14,135, 35, 53, 50, 50,146, 9,133, 66,163,201,147, 39,243, 31, 60,120,224,161,211,233, +210,216, 66,237, 5,234,245, 34,117, 69,154,234, 91,214,220,237, 13, 53, 89, 77, 53, 88, 17, 0,122,254,193,192, 80,184,147,124, + 51, 2,230,158,254, 47, 70,176,184, 20, 36, 82, 25, 18,210, 82,192, 7,117,191, 25, 9,124,110,170,106,154, 44,165, 82,137,121, +243,230,149,253,248,227,143,119,213,106,117,215, 75,151, 46,205, 55, 36,130,101,101,101,133,228,228,100,242,213, 87, 95, 21,157, + 58,117, 74, 87,189, 44, 37, 37,133, 44, 90,180,168,248,192,129, 3,164, 41, 77,132,213, 17,172,136,136, 8,178,100,201,146,194, +244,244,116, 98,110,110, 14, 11, 11, 11,156, 61,123, 86, 55,127,254,252,194,248,248,120, 98,110,110, 14,115,115,243, 38, 25, 44, +157, 78, 7,177, 88,252,130, 65,161, 40, 10, 90,173,246, 15,145,173,134,184,114,229,202,187,133,133,133,159,206,153, 51, 71,245, +240,225, 67, 34,151,203, 33,151,203,177,103,207, 30,238,196,137, 19, 85,119,238,220,121,190,172, 57, 88, 90, 90,226,241,227,199, + 36, 36, 36, 68,117,238,220, 57, 30, 0,200,229,114,196,198,198,146,229,203,151,171, 10, 10, 10, 62,189,114,229,202,187,141, 20, + 56, 72, 72, 72, 64, 81, 81, 17,244,122, 61, 42, 42, 42,144,157,157,141,212,212,212,231, 6, 75,101, 36, 27,248,241, 59, 67,125, + 75, 85,170,178,235,119,227,146, 59,251,123, 90,149,170, 84,101,113,207,146, 31, 3, 75,217,217,195,255,112,241, 48, 54, 32,164, +199,229,187, 37,166,253, 95, 27, 45,160,138,110, 0,218, 18,128,103, 6,240, 76,193, 21, 89, 96,208, 43,126,156,221,191, 21,217, +128, 98,186, 65, 36,108,188,127, 11, 67,172,193, 48,193,103,111,149,155,245, 24, 60, 93,144,151,151, 7,154,166,159, 27, 44,137, +145, 17, 94, 25,242, 54,189,235,183, 10, 27, 48,164, 59, 56, 28,131,251,204,240,249,252,207,223,121,231, 29,126,126,126,254, 11, +154, 98,177, 24, 35, 70,140, 16, 74,165,210, 69, 6,239,250, 67, 15, 62, 50,133, 93,192,144,153,177,137, 42,219,159,175,168,220, +102, 47,222, 37,246,234,216, 25,211,134, 91,137, 87,133,102,121,198,196,151, 57,131,214,207, 66,153, 58,128,108,107,154,201,106, +211,166, 77,176,145,145,209,137,163, 71,143, 74,250,244,233,131,217,179,103, 27, 9,133,194, 83, 78, 78, 78, 61,155,122,154, 74, +139,245, 31, 47,223, 16,154,121,231,224, 0, 64, 87, 92,101,174,254,247,202, 42,100,176,120,107,120,161, 86, 79,198, 26,170,169, + 82,169, 38,190,247,222,123,185, 71,142, 28,249,131,185, 18,137, 68,120,246,236, 25, 86,173, 90,149,151,151,151, 55,233, 37,231, + 82, 63, 0,209, 0,202,171,162, 17, 18, 84,142, 20,236, 10,224, 44, 0, 61,128, 76, 0, 74, 67, 5, 57, 28,206,220,111,191,253, +150,171, 82,169, 48,101,202, 20,164,164,164, 32, 61, 61, 29, 11, 23, 46,124,198, 48,204,196, 42,205, 24, 0,143, 12,209,211,104, + 52,177,249,249,249, 67, 6, 14, 28, 88,144,159,159,143,142, 29, 59, 98,200,144, 33,176,177,177,129,173,173, 45,134, 13, 27, 6, + 87, 87, 87,228,230,230, 98,236,216,177,121,217,217,217, 3, 0, 52, 56, 10, 61, 55, 55, 55,254,224,193,131,241, 31,125,244, 81, + 96, 74, 74,138, 55, 0,133, 86,171, 53, 87,169, 84, 82,157, 78,103, 44,147,201, 44, 58,117,234, 36,159, 54,109,154,233,205,155, + 55, 61, 83, 83, 83, 75,154, 96, 48,255, 43,212,233, 69,154, 11, 69, 81, 39, 90, 18,169,170, 43, 2,102, 40,213, 53, 60, 85,235, +253,127,153, 16, 88,188,247,240,222,114,129,147, 43, 76,220,125, 33, 17,137, 32, 22, 10, 32, 54, 53, 71, 57,195, 96,199,179,140, +178, 82, 66, 22, 53, 35,241, 47, 68,174, 24,134,193,182,109,219,202, 87,174, 92, 89,144,145,145, 49,237,210,165, 75,190,183,110, +221,186, 99,136, 17, 42, 42, 42,194,161, 67,135, 84,187,119,239,126,170, 82,169,252,249,124,190, 86,173, 86, 99,223,190,125,229, + 27, 55,110, 76, 44, 43, 43, 11,228,241,120,154,166, 52,191, 85,247,193,226,241,120,218,242,242,114,255,176,176,176,248, 19, 39, + 78,168,100, 50, 25,120, 60,158,182,172,172,204, 39, 52, 52, 52, 54, 44, 44, 76, 37,147,201,154,100,220, 24,134,169, 51,130,165, +215,235, 33, 20, 10,155,212, 7,235,214,173, 91,219, 53, 26, 77,231,125,251,246,165,238,218,181,171, 92, 38,147, 1, 0,180, 90, +109,224,222,189,123, 83,191,255,254,251,138,166,116,112, 7, 0,181, 90, 13,189, 94,143,208,208,208,138,253,251,247,167,234,116, +186,192,234,101,187,118,237, 42, 15, 13, 13, 77,213,104, 52,157,111,221,186,181,189, 49, 45,189, 94,175, 47, 40, 40, 0,151,203, +197,211,167, 79, 43,132, 66, 33, 56, 28, 14,226,226,226,158, 27, 44, 43, 75,115,207,238,129,222,238, 95,127,127, 40,194, 72, 40, + 20, 14,232, 29,224,241, 32, 46, 41,149, 16, 42,145, 45,107,234,170, 25, 32, 1, 5,113, 92, 74,133, 84,196,211, 82,200,248, 63, +128,111, 86,101,176, 42, 95,182,118,246,184,249,168, 76, 10, 10, 2,168,181, 86,141,106,106,137, 17, 40, 72,238, 37, 65,202,229, +139,169,140,140,140,231,145,166,106, 67,228,220,222, 3, 81,113, 37,198,160,136, 16,149, 67,235, 13, 46,168,140,141,141,185, 74, +165,242,185,214,115, 77,103,103,142, 86,171, 29, 96,240,190,103,235, 21, 96,152,143, 31, 39,151,219, 30,189,162,114,157,181,120, +151, 88,204,201, 7, 18, 55,193,203,213, 6,179, 39,249, 10, 22,238,200,246,186,249,160,172, 29, 40, 50, 13, 94, 37, 6,223, 93, +180,105,211,166,135, 68, 34, 57,117,244,232, 81,137,145,145, 17,158, 62,125,138,142, 29, 59, 98,197,138, 21, 18,137, 68,114,210, +209,209,177,119, 83, 78,211,245,199, 72, 42, 41,214,119,253,124, 91, 74,198,157,103,250, 74, 99, 69, 87,154,171,236, 66,130,247, +190, 56, 86,144, 95, 84,254,198,181,123,186,243, 77,144,141, 46, 44, 44,124,245,139, 47,190,200,205,201,201,121,193, 92, 37, 37, + 37, 85, 27,129,222, 0,238,191,228, 92,106,132,202,206,235, 29, 0,180, 7,224, 11, 64, 7,160,184,202, 8, 53, 25, 79, 79, 79, +127, 39, 39, 39,124,247,221,119,216,177, 99, 71,254,215, 95,127, 13, 66, 8, 92, 93, 93,101,205,213,204,202,202,186, 17, 27, 27, + 59,192,215,215,247,225,150, 45, 91, 82, 21,255,207,222,119,135, 71, 81,237,239,191, 51,179,189,164,145, 30, 8,129, 64, 72, 72, + 8, 37,244,222,164, 74, 23, 5, 20,165, 72, 85, 4, 47,136, 32,160, 72, 7,169,162, 20,165, 55,129, 0, 82,165, 72, 71, 66, 13, + 37, 9,164, 64,122,223,180,221,108, 47, 51,231,247, 71, 18,164,164,108,128,251,189,247,231,157,247,121,246,201,206,236,204,155, +211,230,156,119, 62,159,207, 57,199,219,155, 27, 55,110, 28,198,142, 29, 11,119,119,119,118,221,186,117,169, 29, 59,118,140,122, +242,228,201, 59,122,189,254,161, 61,205, 61, 47, 47,239,250,214,173, 91,111,117,239,222,221, 97,244,232,209,158, 91,182,108,241, +122,252,248,113,109,189, 94, 95, 51, 55, 55, 87,113,229,202, 21,201,206,157, 59,189, 98, 98, 98,146,140, 70,227, 45,148, 31,208, +253,191,138, 10,181, 8, 0, 85,169,208, 49,191,244, 87, 85,197,111,246,222, 91,238,119, 59,174,171, 16, 85,206,184, 57,152,136, +235, 31,213, 43, 90,177,112,219,230,175, 70, 54,110, 40,171, 83, 55, 24,172,182, 8, 15,179,179,177, 51, 75,173,183, 18,242, 83, +120, 34, 46,190,174,192, 98, 24, 6,103,206,156, 97,247,238,221,107, 33,132,252,162,209,104,230, 62,122,244, 72,103, 47, 15,199, +113,204,152, 49, 99,180,133,133,133,135,179,178,178, 38, 62,125,250,212,220,161, 67, 7,230,195, 15, 63,212, 22, 20, 20, 28,163, + 40,106,220,221,187,119, 77,237,219,183, 7, 33,246,183, 99,138,162, 32, 18,137, 64, 81, 20,238,220,185,147, 20, 28, 28,220,232, +198,141, 27, 63,199,197,197,125, 64, 8, 97, 34, 35, 35,211,194,194,194,154, 92,191,126,125,253,227,199,143, 71,112, 28,199,216, +203, 91,102, 29,123, 94, 72,209, 52,253, 76,212, 81,213,244,185, 70, 70, 70, 70, 7, 7, 7, 7,223,186,117,107,199,248,241,227, +123, 1,144,223,185,115,231, 81,104,104,104,195, 27, 55,110,236,248,228,147, 79,122,151,190, 65,218, 55,126, 91, 44, 24, 52,104, +144, 94,173, 86,159, 46, 46, 46, 30, 21, 21, 21,165, 15, 11, 11, 43, 59,119,166,168,168,104, 84, 53,234,104,193,143, 63,254,248, +109,105, 93,237, 88,179,102,205,167, 51,102,204,112,207,200,200,120, 38,176,114,243, 10, 46,180,123,119, 10,155, 95,164, 54,111, + 91, 51,115,168, 76, 42, 17,207, 93,182,237,146,149,121, 54,141,155,199,243, 16,179, 26, 16, 58,115,104, 55, 23,201,186,159,182, +138, 70, 15,168, 39, 13,109,232, 87, 34,174, 68, 46,184, 29, 83,132,111,127, 56,200, 45,159,228,158, 8, 14,105, 96, 17, 91, 37, +167, 82,160,129,209,154,251,105, 47,145,100,233, 47,211,252,219,247,251, 74, 18, 28,218,234,153, 16,122, 28,125, 7,107, 22, 79, +225,150, 79,172,145, 8,142,202,132,205, 62, 43, 1, 0,216,108,182,161,203,150, 45, 59, 61,122,244,104, 69,163, 70,141,158,113, + 38, 37, 37, 97,249,242,229, 6,147,201,244,158,125,125, 6, 40, 92, 21, 52, 99, 89,214, 99,207,217,252,128, 47,191,152, 40,151, +209, 5, 64,226,202, 18,241, 34,116, 66,179, 80, 55,124,251,133,151,112,250,210,227, 33,215,126,246,215,194, 42, 10, 6,144,105, + 15,191, 64, 32, 56,185,100,201, 18,185, 76, 38, 67,124,124, 60,100, 50, 25,164, 82, 41,154, 55,111,142,181,107,215,202, 63,251, +236,179, 63, 58,119,238,172,188,124,249,178,173, 58, 34,171,117, 32,219,118,230,134, 39, 17, 43,166, 58,123, 53, 9,114, 67, 94, + 49,240,233,119, 39, 10, 11, 52,134,247,171, 41,174,158,137,172,162,162,162,158,211,166, 77, 59,187,125,251,118,215,224,224, 96, +164,165,165, 97,248,240,225,249, 42,149,170,235,127,129,184, 2, 0, 29,128,154, 0,226, 80, 18,139,148,128,146,184,164,215,158, +229, 25, 19, 19, 19,153,146,146,226, 61,118,236, 88,104, 52, 26,151, 97,195,134,225,233,211,167,136,139,139,187,247, 38, 9, 53, + 26,141,183,211,211,211, 27,127,249,229,151, 35,103,206,156,217,222,193,193,161, 46, 33,132,104, 52,154, 68,150,101,175, 1,216, + 11, 84,107, 31, 78, 2, 32,225,201,147, 39,137, 79,158, 60,241,220,177, 99,135,115,105, 25, 0, 37,129,253,234, 82,235, 29, 31, + 35, 81, 61, 75,212,237,255,196,189,255, 39, 24, 90, 23,237, 71,215,163, 46,127,232,143,226, 17,254,208,142,174, 79,217,179,208, +104,185,187,109,135,133,133, 17,155,205, 70,206,158, 61, 75,250,244,233,163,235,208,161, 67,117, 22, 26,125,129,179, 75,151, 46, +175, 44, 52,218,165, 75,151,211,173, 90,181,122, 97,161,209,206,157, 59, 71,119,238,220, 89,221,169, 83,167,167,246,164,179, 83, +167, 78,143,219,183,111,175,235,212,169,211, 11, 3, 73,203,150, 45, 7,118,235,214,237, 5,147, 99,171, 86,173, 6,188,124,174, +162,188,191,243,206, 59,105,113,113,113, 36, 53, 53,149,244,237,219,247, 89,199,223,189,123,247,180,251,247,239,147,184,184, 56, +210,187,119,239,204,234,148,231,243,104,209,162,197,184,142, 29, 59, 94,127, 41,205,159,190,124,174, 50,206,142, 29, 59, 94,111, +217,178,229,167, 47,159,171,198, 66,163, 21,166,211,219,219, 59,176, 89,179,102,185,107,214,172, 33,254,254,254,185,207,255,214, +168,203,152,121, 69, 26,173,102,198,130,141, 7,202, 89,104,148,223,181,190,172,247,126, 20, 44, 34,127, 5,183, 39, 87,130, 79, + 62,222,229,247,104, 84, 79,133,233,238,222,222,132, 60,254,138,220, 56, 56,150,180, 13, 22,179,127,253,236, 27, 71,174, 52,252, +131, 92, 13,236, 68,254, 40,119, 65,207, 87, 57,175,212,239, 72,174, 52,252, 35,102,135,223,163, 65,157,220,205,123,119,109, 38, + 9, 9, 9,228,216,145,189,164, 77,176,188,148, 51,248, 44,185, 18,220,213, 30,206,151,158,249,246,109,219,182,213, 30, 56,112, +128,196,199,199,147,115,231,206,145,118,237,218,233,155, 53,107,214,213,222,188, 19, 2,138, 92, 14, 25,100,187, 24,116,109,246, +112,101,209,167,189,164,166,225, 93,197,230,129,109, 69,150,158, 97, 34, 91,251, 96, 1,219,196,159,230,130,125, 65,122, 54,151, +153,200,149,160,171,228, 90,112, 47,123,211,217,160, 65,131,212, 58,117,234,144,138, 62,129,129,129,170,178, 9, 52,213,173,247, +214,129,240,123,167,165, 36,235,252, 47, 93, 73,255, 78, 14,249,109, 66, 5,221,222, 66, 91,106,230,230,230,150,183,125,251,118, +226,233,233,169, 2,208,232,191,168,205,215, 0, 48, 16,127, 79, 99, 87, 2,232, 10,192,255, 13, 56,219,245,236,217,211, 26, 25, + 25, 73,158, 62,125, 74, 78,159, 62, 77,218,183,111,111, 67, 73,204,206, 63,246,121,255, 31,227,252, 71,154,227,254, 93, 8, 69, + 57,193,134, 97, 97, 97,164, 87,175, 94,134,203,151, 47,107,205,102,243,132,187,119,239, 30,123, 83,206,127, 71, 58,255, 29,156, + 93,187,118,189, 78,211,180,127,233, 20,224,204,243,231,207,135,149,138,194,235, 12,195,248,151, 90,247, 50, 47, 92,184, 16,246, + 79,203,251,243, 34,139,166,233, 51, 0, 76, 25, 25, 25,207,102, 59,185,135, 12,104, 91,195,197,169,107, 81,145,250, 94, 78,244, +177, 63,254,137,121,127, 91,156,228,143,122, 98, 56,136, 91,128,197,172,168,167,250,186,115,183,230,213,235,215,179,157,112,199, +193, 43,220,138,201, 30, 79,218,133, 40,146, 64,113,203,193,154,110, 81, 93, 82, 76,118,115,202,169, 86,128,112,214,253, 39,122, +191, 25, 27, 10, 3,222,233,255, 41,115, 60,124, 51,247,195,100,215, 39,237, 66,148,169, 0,150,131,211, 71,216,203,249,178,200, +146, 72, 36,127,140, 24, 49, 66,185,111,223, 62,131,209,104,236,119,239,222,189,139,213,201, 59,185, 30, 84, 27, 54,106, 49, 64, +124,171, 46, 54, 58, 1, 54,110, 33,213, 45, 54,245,191,161,222, 91, 7,194, 79,225, 32, 57,161, 55,217,166,217,105,185,178, 39, +157,205, 92, 92, 92,118, 23, 22, 22, 14,179,211,114,245,127,153,119,119,148,172,115, 37, 40, 29,107,162, 81, 69, 12,147, 29,156, + 29, 24,134,249,186, 94,189,122, 77,158, 62,125, 26,197,178,236, 15, 40,153,117,246,143, 31, 59,254, 71, 56,121,129,245,166, 21, +208,161, 67,135,187, 44,203,158, 22,137, 68,139, 47, 95,190,108,226, 27, 31,207,201,115, 86,159,243,121,145,117, 55, 78,231,191, +116, 79,129,223,191,134,185,164,218, 33,174, 42,231, 44, 21, 89,183, 98,245,117,150,239, 45,246,155, 62, 76,153,106,135,184,178, + 43,239, 97, 97, 97,237,165, 82,233, 78,131,193, 48,206, 14,113,245,170,192,122, 20, 44, 66,161,181, 38,108, 76, 40,104, 84,188, +213, 14, 71,244, 16, 50, 81,200, 66, 14,245,254, 35, 11,223,150,120, 78,158,147, 23, 88,255,215,248,143,172,122,124,237,218,181, +230,124,209,243,224,241,134,111, 71,125,158,154,201, 31,245,238,192, 65,188,172,121,160,108,202,225,197, 50, 61, 56, 42, 29, 20, +183,182, 10,113, 85, 21,231, 45,200,173,203, 90, 5,202,166, 29, 89, 44,211, 3,200, 6,193,154, 42,196,149, 93,136,140,140,252, + 11,246,187,137, 94, 77, 95,240, 35, 11,128, 36, 66,144,140,239, 43,121, 65,252, 14,132,162,248,224, 97, 30, 60,120,252,143, 9, + 44, 30, 60,120,188, 69,145,245, 40,248, 54,242,153, 25, 96,225, 15,137, 45, 5, 69,182,108,170, 79,138,249, 13, 57,111, 34,159, +154, 10, 14,129, 16,219,158,160,200,252, 70,156,111, 61,223, 37,226,169, 98, 1, 53,159,111, 27, 60,120,240,224, 5, 22, 15, 30, + 60,222, 68,108,148, 88,117,210, 75, 63,255,181,156, 60,120,240,224,241, 63,213, 55,163,226,153, 0,213,241,173,190,206,108,130, + 40,158,147,231,228, 57,121, 78,158,147,231,228, 57,255,231, 56,171,226,230, 99,187,254, 77,194,139,231,228, 57,121, 78,158,147, +231,228, 57,121,206,255, 61,206,127, 20,248,141,116,121,240,224,193,131, 7, 15, 30, 60,222, 50,254,163, 49, 88, 50,215, 6,222, + 16,208, 77, 40,142, 52, 4, 0, 66, 83,143, 97,227, 30, 24,242,227,179,222,152,220, 35, 84,174, 20, 50,123,181, 86,246, 67,228, + 70,233,223, 82,146, 59, 0,240, 67,201,222, 81,215,248,230,195,131, 7, 15, 30, 60,120,240,168,150,192,106,208,118,208, 85,133, + 76, 17, 0, 0, 28, 33, 96, 57, 64, 83,152, 27,145,250,240,207,193, 0,224, 29,210,237,136, 88,225,214,150,227, 8, 56, 66, 96, +227, 8,108, 38, 67, 66,222,163, 83,118,237, 60,175,112, 15, 28,220,237,157,238, 67,250,245,123, 55,168,113,104,227,250, 0,240, + 48,234,225,147, 19, 39, 78,198, 94,248,147, 58,172, 83,197, 29,121,147,140, 41,133,194,121, 45, 91,181,238,117,251,246,205, 57, + 90,224,155,183, 84, 94, 34,114,173,239, 46,170,195,169,238,124,211,225,193,131, 7, 15, 30, 60,120, 84, 91, 96, 41,100,138,128, + 11, 71,183,122, 28,185,154, 6, 0,120,167,185, 23,190, 95,181,125,208,150,135,127,198, 2, 64,219, 78,125, 2,231,126, 57, 10, +215,163, 85, 32,132,160, 89, 64, 13, 12,250,232, 51,187,254,169,212, 51,184,229,208,161,239,125, 56, 99,198,244, 1, 9, 9, 9, +201,251,246,237,187, 10, 0, 29, 59,117, 10, 88,178,100,201, 7, 43, 93,106, 72,246,135, 31,202, 48,230, 60,122,173,253,131, 20, +158,245,220, 26, 6, 5,124,186,247,215, 31, 4,221,250, 14, 31,155,106,213,172,209,229, 60,205,123, 29, 46,113,173, 16,127, 39, +161,232,123,138,166, 5, 38,109,129, 7, 0,184,248, 54, 59, 33,113,240, 96,165, 82,217, 67,157,193,176, 51,247,209,233, 45,224, + 55,236,228,193,131, 7, 15, 30, 60,120, 84, 37,176, 0, 64, 41, 21, 32, 54,169,196, 91,231, 44, 7,198,127,242, 30,114,114,178, + 3, 45, 54, 14, 35,135, 13, 70,100,108, 22,226,146, 84, 32, 4, 8,172,101,247, 94,194, 96,192,181, 24, 51,118, 76,231, 51,103, +207,222,154, 55,119,222, 46,138, 66, 4, 0,108,254,229,215,182,223,126,247,237,184,145,159,140,236, 17, 30, 30, 30, 13,224,181, + 4, 22, 45,114, 94,179,124,241,247,202,140, 60,163,241,139,233, 95, 49, 51,190,156,186, 18,192, 39,175, 35,174,130,125,107, 45, +190,122, 54, 92, 46,151,203,177,101,203, 22, 9,112, 20,243,103,140,145,190,219,175, 31, 88, 48,237,126,248,121, 95,147,179, 98, +241, 88,189, 94, 63, 56, 63,254,207, 44,190, 73,241,224,193,131, 7, 15, 30, 60, 42, 21, 88, 44, 71,240, 56, 49,187, 68,180, 48, + 2,188,219,222, 9, 43, 23,125, 13,131,137,197,253, 68, 53,126,255, 43, 13, 38, 93, 17, 8, 1,218,135,122,148,103,195,121, 97, +170,229,202, 47,100, 97,140, 88, 56, 44, 34, 78, 81,167,134,139,139, 75,252,173, 93,186,111, 63,202, 9, 22,216, 44,119, 23, 29, +111,153,168,112, 16,183, 59, 24, 30, 30,210,191, 95, 63,177,163,163,211, 76,145,115,143, 90,156,209, 50, 93,157,114, 89, 93, 17, +231,203, 80,120,134,116,238,255,110,223,119,189,188, 60,217, 17, 75, 34, 30,255, 52,165,121,237, 6,129, 13,187,196, 89,245,157, +117, 57,113,151, 43,184, 45,170, 60,113, 85,223,219,115,241,229,211,225,114,163,209,136,196,196, 68,228,231,231,151,252, 72, 81, +160,105, 6, 53,189,189,177,126,233,116,249,190, 35,141,155,207, 91,186,241, 40,128, 86,248,187, 20,254, 29,211, 76,121, 78,158, +147,231,228, 57,121, 78,158,243,159,202,249,143, 66,217, 44,194,114,221, 91, 79,210,242, 17,155,152,133,176,134, 53, 81,191,142, + 23,110,197, 23, 98,239,133, 52,108, 59,155,140, 11, 15, 84,224,132, 14,200, 46,166,144,144,146,131,184,228,188, 42,125,100,140, + 88, 56,108,218, 10,245,140, 16,127, 77,155, 75, 7,166,192, 71, 25, 31,242,245,170,162, 41,140, 88, 56,204,195,203,121,223,140, +169, 19, 63,114,144,203,196,102,147, 25,117,235,248, 74, 39,141, 27, 51, 90,164, 84,236,179, 55, 51,110,110,193, 10,177, 76,177, +107,241,183,211,165,171,143,196,167,234,204, 68, 23,126, 61,243,233,140, 89,223,106, 24,161,236, 23, 55,183, 96,133, 61, 60,226, + 90, 33,254,126,174,174,139,175,157, 9,151, 91, 44, 38,100,102,102,194,108, 54,195,102,179, 61,187,134, 0, 40, 54,216,144,152, +101, 64,231, 78,237,153,176,102,141, 26,186, 55,236, 51,129,111, 82, 60,120,240,224,193,131,199,107,225, 31, 21,106, 83,225, 50, + 13, 58,131, 46,225,227, 9, 51,114, 3, 28,178,204,131,187, 6, 3, 4, 80,101, 37, 35,230,214, 25,196,223, 61,139, 98, 85, 42, + 8, 1,234,212,169, 13,145, 33,209,188,121,211,134, 92,206,102, 76,168,136,111, 64, 15,239, 90, 9, 25, 10,122,197,140,218, 17, +241,113, 89,110,147,103,108, 71,124, 92,150,219,138, 25,181, 35, 18, 50, 20,180, 92,196,182,251,100,248, 64,106, 96,191,222,248, +250,235, 25, 24,216,175, 55,102, 76,252,128,146,138,133,109,236,205,140, 81, 44, 93, 54,107,222, 2,135,236, 34,139,249,102,156, +198,164,148,203, 37,127, 61,214,233, 77, 68,102, 25, 48,108,188,202, 36, 18, 44,176, 71, 92,121, 59, 58, 46,190,254,231, 33, 57, + 33, 4,233,233,233,176, 88, 44,176, 90,173,176, 90,173,207,174, 43,210, 90,145,170, 50, 32, 37, 87,143,168,100, 13,250,244,238, + 45, 23, 8,197, 31,241,207, 7, 15, 30, 60,120,240,224,193,163, 66,129, 21, 31,241,123,199,200,243,187, 61,243,114,114,212, 10, +137, 0, 2,154, 70,110,124,167, 94,155, 0, 0, 32, 0, 73, 68, 65, 84,250, 83,236, 92, 53, 21,225, 63, 77, 71, 81, 86, 2, 8, + 1,100, 34, 6, 38,109,190, 58,251,126,184,103,126, 37, 51, 8, 41, 88,123,252,188, 59,169,110,114, 22,113,218,123, 90, 43, 4, +128,189,167,181,194,228, 44,226,244,243,238,164,186, 98,162, 2,199,178,232, 55,240, 61,236,218,177, 5,109,187, 13, 68,248,149, + 84,232, 13, 22,187,246, 63,147,120, 52,168,227,225,229,245,222,180,145,221, 29, 90, 5,186, 40, 27,248, 58, 51,140, 80,100, 19, + 11, 37,220,241, 59,234,140, 94,253, 6,211,114,133, 99,111,137, 71,131, 58,149,241, 56, 9, 69,223,255,117,246,144,156, 97, 24, +164,166,166,194, 98,177,192,108, 54,195,100, 50, 61,179, 96,105,244, 86,100,228, 27,144,166,210, 35, 85,165,199,163, 84, 13,196, + 10, 23, 88,173, 86,126,225, 53, 30, 60,120,240,224,193,131,135,125, 11,141,102,230, 22,160,134, 3, 3,119,159,186,248,112,234, + 74, 0, 0,203,217, 64, 80,178, 60,131, 61, 54, 61, 2,225,185,207, 71,214, 77,172,227, 77,169, 63,234, 35, 55, 0,192, 71,125, +228,134, 58,222,148,250,243,145,117, 19,245,172,139,133,101, 89, 92,139,206,197,138,253,143, 48,111,251, 3,156,185, 99,127,204, +184, 64, 40,155,182,124,233, 18,185,128,161,168,232,148, 98,109, 86,129, 77, 43, 18, 9, 45, 66,177,192,170, 53, 83,134,100, 21, +155,223,251,253,201, 73, 12, 35,156, 92,101, 90, 9, 7, 66, 8, 76, 38, 19,204,102,243,179, 79,153, 5,171, 64,107, 65,102,190, + 17,169, 42, 3,210, 74, 63, 57,133, 6, 16,194, 79, 36,228,193,131, 7, 15, 30, 60,120,188, 40,176,202,221,157,158, 3, 16,159, +172,130, 68,192,161, 86,237,250,127, 95, 65, 0, 66, 0,171,141,179,235, 31, 29, 59,151,149,238, 95, 83, 71,102,174, 76,109, 27, +218,208,245,193,164, 17,190,143, 67, 27,186, 62,152,185, 50,181,173,127, 77, 29,177,114, 98,150, 16, 2,194, 17, 16, 66, 64, 8, +192,113,246, 11, 22,138, 98,218, 52,107,232, 39,248,126, 95, 66,202,228, 13,113,143, 41,129,192, 42, 22,139,109,158, 78, 50,170, +150,155, 76, 80,108,130, 49, 40, 52,204, 74, 1, 97,149,241,168,173,150,239,218,247,122, 95,111,177,216,224,235,235, 11,179,217, +252,204, 69, 88,102,193, 42,210, 90,144, 81, 96, 68,154,202,128, 84,149, 1, 6, 35,139,135,143,147, 65,209, 12, 31,244,199,131, + 7, 15, 30, 60,120,188, 62,202,213, 34,255, 63, 11, 44,234,185,207, 43,240,243,245,196,205,168, 20,212,246,148,192,209,201, 1, +143,159,164,131,102, 4, 96,104, 10, 54,214,254,114, 32,102,235,254,213, 51,157, 86,166,102,177, 55, 54,236,126,154,144,154,197, +222, 88, 61,211,105, 37, 49, 91,247, 3, 37,130,141, 35, 4,220,115,127,237,230, 38,156,135,155,147, 68,112,251,137,182,128, 98, + 4, 38,145, 80, 96,242,118,149, 80,222,110, 50,129,175,171, 76,172,144, 10,105,111, 79, 79, 14,132,120, 86,198, 99, 78,143, 73, +204,214,104,230,116,236,249,158, 94, 40, 20,194,223,223,255,153, 5,171, 76, 96,149, 88,176, 12, 72, 85,233,145, 93, 96,132, 76, + 66,227,126,196,121, 61,203, 90,119,242,207, 6, 15, 30, 60,120,240,224,241, 90,168, 84,139,252,255,134,170,183,202, 33, 4, 10, +185, 12, 28, 45,197,181, 59, 79,208, 48,184, 9,182, 31,187,133,250,161,173,145, 85,108, 3,169,198,118,134, 51,126, 52, 68, 2, +136, 28,208, 67, 94,107,112,159,154, 61, 8,132,231, 54,252,166, 73, 7,128,160, 54, 40, 21, 86, 37,150, 43,142,148, 44, 19, 81, +141, 90,201, 76,205,213, 41,235,122, 41,240, 40,205,108,114,144, 75,109,206,114,145,192,221, 73,204, 56,202, 4, 2,129,136,166, +139,138, 84,197, 0,149, 89, 21,151, 57, 61, 38, 49, 21, 33,115, 58,245, 25,190,248,234,233, 3,242,122,245,234,225,254,253,251, +207, 92,132,122,163, 13, 84,177, 5, 66, 25, 65,131,154, 74, 60,142,188,202,230,231,102,196, 20,198,157,222,194, 63, 31, 60,120, +240,224,193,131, 7, 15,187,212, 17,199, 17,184,187,185, 64,162,116, 66,162,202, 12, 45,220,161, 54, 80,224, 88,128,181, 85, 42, +130,202, 13,250, 62,118, 46, 43,253,232,185,188,173,199,206,101,165,191,168,229,254,118, 15, 18, 66, 42,114, 17,134,150,175, 3, +217, 63, 78,156,187, 86, 48,168,141,135, 51, 45, 20, 26,196, 18,198, 34,147, 10,173,114,137, 0, 30, 78, 34,113, 45, 23,145,228, +210,201,223,104,138, 35, 23,236,225, 52,167,199, 36, 38,229,230,206,233,214,111,132,222,211,203, 11, 35, 71,142, 68,237,218,181, + 1, 0, 53, 20, 52,252, 92,104, 8, 76,217,184,124,108,171,238,241,221,139,119,193,154, 6,227, 69,179, 38,191,203, 58,207,201, +115,242,156, 60, 39,207,201,115,254,143,194,174,205,158,235,121, 43, 16, 80, 83, 1,163,217, 19, 6, 51, 11,157,201,134, 98,189, + 21,106,189, 21,201,217,122,196, 93,122,243,132,144, 82,129, 5, 66,129, 35, 4,160, 74,220,132,196, 78, 67,161, 78,168, 89,185, +124,201,247,195, 15, 28, 60, 66,190,232,235, 93,235,102,130, 33, 77,194, 8,205,114, 9, 45,112,148,209,108, 82, 98, 82,230,217, + 19,191, 53,210, 75,245,163,236, 77,147, 57, 61, 38, 49, 30,152, 19, 20,214,237,123, 16, 8,204, 6,181, 98, 86,251, 16,156, 57, +125,210, 32,190,118,215, 74, 9,196, 81, 28,107,217, 93,106,185,226, 35,220,121,240,224,193,131, 7, 15, 30,246, 9, 44,189, 65, +159,208, 99,200,167,165, 27, 62, 19,176,108,137,101,137, 45,115,229,113, 4,172,197,144,240,166, 9, 97, 57,238,214,198,237,251, +251, 54,109,214,154, 9,241,115,128,166, 40, 15,119,110, 70,216, 8,199, 69,216, 69,144,146, 98,178,121, 72, 63,120,255,189, 65, +191,141,157,248,133,182, 99,231,174,114, 87, 87, 71, 91, 94,110,190,102,231,150, 3,133, 71, 14,236,105, 68,113,220,199, 72, 73, + 49, 85, 39, 93,230,244,152, 68, 51, 80,182,190, 85, 55, 32,164,179, 46,243, 65,127, 29,112,129,111, 62, 60,120,240,224,193,131, + 7,143,215, 18, 88, 9, 55,126,239,248,127,145,144,130,130,156,145,187,127, 59,188,104,207,129, 99,237, 77, 22, 75, 77, 14, 76, + 26,107,181, 94,150, 20,231,127,107, 47,135, 46, 55, 54, 6,126,126, 45,126,253,105,229,151,191,252,188,186, 59, 56,182, 62, 40, + 42,137,226,200, 5,173, 84, 63, 22,153,213, 19, 87,229, 32,143,234,112,170, 39,128, 60,190,233,240,224,193,131, 7, 15, 30, 60, + 94, 91, 96,253, 95,161,240,233,173,226, 66,224,139, 55, 38, 74, 73, 49,105,129,165, 40,249,188,109, 68,129,223,127,137, 7, 15, + 30, 60,120,240,224, 81, 5,104,190, 8,120,240,224,193,131, 7, 15, 30, 60,222, 46, 40, 84, 60, 19,160, 58,150,154,215,153, 77, + 16,197,115,242,156, 60, 39,207,201,115,242,156, 60,231,255, 28,103, 85,220,188,167,232,223, 36,188,120, 78,158,147,231,228, 57, +121, 78,158,147,231,252,223,227,252, 71,129,119, 17,242,224,193,131, 7,143,255, 57,184, 54,232,175,116,109,208, 95,105,239,245, +110,193, 67, 61,221,130,135,122,242, 37,199,195, 94, 8,248, 34,120, 43,144,160,100,219, 70,203,127, 42, 1,206,206,117, 29,109, + 14,110, 71,104,206,180, 92,147,254,240,220,219,206, 95, 72, 72, 72, 51, 0,136,137,137,185, 7,224, 77,103, 99, 66,238, 17, 56, +194,197,209,121,130,133, 51,179,122,157,126,163, 46, 39, 62,252,109, 38,216,205, 45, 88, 97,150,200, 86,128, 34,125, 64, 64, 19, +154, 58,207,104,172,255, 82,171, 31,168, 43,187,207,119,192,146,134, 99,135,190, 59,119,107,248,201, 69,105,199,190,121,252,242, +239, 46,189,127,116,248, 98,100,247,153, 63,237, 63,177, 60,255,248,215, 90,190,233, 87, 31,190,237, 71, 56,219, 4, 94, 76,214, +229, 85,249,213,185,175,102, 96,155,104,161, 80,232,110,177, 88,114, 51,227,111,218,245,246, 92, 43,168,109, 36,195,208, 62,172, +141, 75, 79,143,139,104,193,151,126,213,144,121, 7, 53,163, 88,246,107,194,177, 66, 14,204, 26, 83, 94,194,181, 55,225,243,246, +246,150, 57, 57, 57,117,114,116,116,244,149,203,229,210,194,194, 66, 67, 97, 97, 97,106, 74, 74,202, 5, 0,182,255, 68, 30,221, + 66, 6,206,102,104,124, 87,250,253,251,188,152,163, 75, 43,191,126,192, 34,138,178,206, 46,253,190, 52, 47,230,216,220,255,134, +186,242, 8, 29,220, 26,132,251,146,166,153,118, 44,177, 45, 81, 69, 29,219, 80,157,251,219,180,105, 51,200,106,181, 74,202,142, +133, 66,161,233,198,141, 27,191,243, 79,193,127, 72, 96,213, 12, 30,234, 98, 21,144,249, 2,134,126,143, 35,196, 33,251,126,184, +226,191, 57,131,181, 91,141,188, 67,211,116,173,231,207,113, 28,151,158,122,107,247,219,234,108,107,173,154,214,252,235,156,124, +131,230,135, 61,143, 23, 86, 36, 62, 60,154, 14,191, 78,209,148, 63, 69, 81,160, 41,128,161, 41, 0,200, 76,187,181,167,188,205, +167,189, 29, 21,130, 64,141,206, 22, 5,160,202, 65, 72, 90, 35,192, 71,224,226,121,185,203,224, 41,117,239,156,217, 30,204, 90, + 44,221,117,185,177, 49,111, 33,111,238,245,235,215,111,201, 48,140,235,148, 41, 83, 68, 0,176,102,205,154, 0,150,101,243,159, + 60,121,114, 27,128,234,181,196,149,123,208,200,117, 63,124,191,171, 79,159, 62,200, 84,233,176, 98,205,134, 46,167, 79, 28,120, +255,173,137, 44,239, 48,153, 77,204, 68,125,246,229,183,181,250,118,109, 41, 40,210, 90,113,234,194,141,145,225,219, 86,116,115, + 66,147,198,149,137, 44, 78, 95, 52,215,211,129,244,230,244, 69, 0, 48,226,149,246,175,180,190, 83, 67,142, 62,222, 18,193,253, +124,224,112,149, 73,105,241,241, 25,161, 72,228, 71, 81,116, 73,189, 51, 20,232,210, 54, 96,179,154, 83,158, 92,219,222,235,191, +162,163, 14,251, 40,155, 2,229, 74,151,166,143,162, 0,154,166, 33,160, 0, 16,162, 73,140,216,225,250, 22,254,141, 83,104,128, +115,163,246, 1,186,173,151, 19, 11,148,130, 78,211, 78, 82,132,222,144,122,117,245,125,123,110,150, 74,165, 46,199,143, 31,119, +239,221,187,183,147, 71,163,129,151,237,185, 71,204,104, 67, 78,156, 56, 38,234,221,187, 87, 53,218,103, 96, 15,208,244,110, 10, + 16,114, 28, 89,195,112,228,128, 54, 63,238, 9,170,185,152,176,123,163,129, 11, 64, 33,216,238, 27, 8, 30,169,162,143,126,251, +154,101,203,200, 60,130, 70,201,164,210, 25, 1,129, 13, 3,147,147,158,198,105, 52,234,213,134,220,184,173,165, 47,127,118,131, +178,177,211,206, 94,184, 62, 84, 32, 20, 82,189,186,182, 84,152,128, 94,213,229,120, 30,158,158,158,131,214,175, 95, 95,175,109, +219,182, 0, 0,155,205,230,120,240,224, 65,175,133, 11, 23, 42,226,226,226, 14,191, 14,167,143,143, 79, 77, 39, 39,167,218, 50, +153,172, 38, 0, 24, 12,134, 12,181, 90,157,154,153,153,153, 81,101,122,154, 14,117, 35,172,117,193,233,195,191, 8, 0,160,215, +144, 9,139,234,116,158,225, 66, 49, 66, 67,121,215,179, 54,179,194, 84,152,244,229,249,227,219, 41, 0,232, 62, 96,244, 44,183, +224,161, 63,229, 61, 10,207,249,143, 60,172, 67,135, 50,110,241,150, 65, 20,161,254, 21,214,188,121,155, 33, 3,251, 32,164,190, + 15, 6, 13,159, 52, 3, 64,181, 4,150,213,106,149,132,135,135,215,162,105,154,177, 88, 44,198,225,195,135,231,190, 73,210, 2, +218,127,124, 29, 20,229,107,177,217,126, 77,185, 81,127, 17, 48,159,123, 57,237,222, 73,130, 57,160,232,113,132,227,210,178,239, +253,214,142, 23, 88,165,112,109,208, 95,105, 21,144,168, 46, 29,219,184,206,158, 52, 88,188,233,192, 85, 28, 3,149,145,117,255, + 96,205,255,214, 12,210, 52, 93,235,232,222,245, 30, 50, 9, 3, 0,208, 26, 88, 12, 25, 57,165,234, 7,184,197,135,151, 64, 33, +168,204,135,202,178, 54,169, 64, 32, 52, 82, 0, 64,149,204, 14,144,201,196, 55,166,183,137, 85,143,238,239,255,241,215, 63, 69, +238, 0,224, 12, 32,187,220, 78,139,166,107,253,182,109,141, 71, 77, 87, 41, 4, 12, 5,173,193,134,193, 31,255,139, 45, 79,176, +109,157,211,118,193,200, 62,117,134,121,244, 62, 52,164,168,216,252, 71,101,233, 84,120, 6, 55,148, 59,185,159, 27, 50,126,129, +143, 1,142,152,187,104,181,199,245,179,225, 87,179, 50, 82, 44,169,233,233,122,155,197, 26,155, 95,144, 53, 93,155, 21, 31,111, +111, 71,173, 84, 42,235, 41,149,202,166, 77,154, 52,145,206,152, 49, 67,216,165, 75,151,103, 63,142, 31, 63, 94,116,233,210, 37, +239,149, 43, 87,246,125,240,224,129, 81,171,213,222,215,106,181, 79, 1,176,246,214,137,151,151,251,231,239, 13,234,143,110,239, +125, 6,150,163, 48,110,242, 52,156,249,227,240, 68, 0,111, 69, 96, 41, 25,250,251,113, 83,190,169,213,185,109,115,193,178,131, + 9,112,146,139,208,171,117, 11,129,132,153,233,253,219,182,149,171,161,198,152,242, 44, 87,156,190,104,110,168,155,101,248,128, +118,254, 56,246,155,101, 56,186,127, 5, 90,238,252,204,146, 85,175,247, 20, 7, 9,155,187,190,166, 51,227, 33, 97,115,215,215, +235, 61,229,207,167,167,215, 23, 87,150, 22,161, 72,228,183,245,167,197, 13,106, 40, 69, 96, 24, 10, 2,154, 6,195, 80, 48,153, + 89,140,156, 52,251,109, 53,115, 70,230,209,160, 47, 13,140, 70,201, 72,184,221,144, 27,127,170, 58,117, 66,209,140,235,193,109, + 43, 5, 30, 78, 98, 48, 12, 5,134, 46,249, 36,101, 27,240,197, 87,243,157,222, 84,168,247,105,239,209,242,171, 97, 65,189,218, +132,214,104,178, 63,130,114,110,211,103,152,107,158, 81, 54,234,183,163,151,134,147,142, 95,222, 36,132,251, 33,253,218,186,179, +149,145,152, 76,166,156, 94,189,251, 56, 82, 2,133,252,207, 35, 59, 58,149,109, 54,111,101,185,191, 55,135, 39, 64,217, 75, 12, + 71,128,241,159,142, 69,175,222,125,244,156,141, 75,175, 70,167,177,251,244,159,215,220,141, 86,130, 85,235,183, 44,208,169,243, + 22, 36, 62,118, 77,214,170,243,190, 52,228,198, 31,179, 95,169, 32, 56,238,250,193,193,123, 79, 68, 32, 52, 36, 24, 44, 87,178, +191,106, 96, 45, 5,246,157,188,129,134, 65, 13, 75, 22,111,230, 8,130,124,149,232,252,238,199,175, 89,188,157, 5, 10, 79,213, +190, 65,195, 70, 15, 29,252,222,112, 56, 59, 42, 97,182,152, 2, 47,156,253,227,151,141,235, 87,180,215,102,199,142,170,142, 56, +228, 56, 86,252,247,119,171, 20,128, 16,128,249,117, 43,223,199,199,199,189,101,203,150,207,142,109, 54, 27,234,214,173,139,140, +140,140,160,106,191, 8,120,120,200,125,124,124,222,157, 62,125,186, 71,215,174, 93,133,238,238,238, 0, 0,149, 74, 85,243,226, +197,139, 97,171, 86,173,202,205,204,204, 60,153,155,155,171,175, 80, 84,112, 70, 17, 67, 4,140, 68, 34, 43,213,181,160,103, 76, +249,176,137,187,187,123,185, 47,199,249,249, 5,226,239,190,251,150, 18, 8,132, 37,215, 19, 66, 19,142,173,112,143,145,182,109, +219, 14,176, 88, 44,210,242,126,203,179,185,247, 53,114,226, 97, 40,221,204, 88,192, 48,133, 89,247, 15,185,219,253, 32, 53, 30, +208, 83,240,148,108,236, 63,112, 96,157, 65,125,187,192,219,221, 9, 23,110,196, 98,234,156, 85,176,218,216,181,175,213,121, 48, +140, 32, 55, 55, 55,217,197,197,197,235, 45,140,183,254, 71,247,254,232,113,241,234,157, 89, 63, 73,126,155,100,182,142,178,150, +109,127,199,114, 4,242,124,145,176,211,192, 30, 14,174, 53, 3,101, 91,126, 90, 38,228, 45, 88,207, 87,132,152, 89,216,161, 93, + 75,215,217,211,198,138, 23,110,185,140,136,179, 39, 13, 89,247,195,223,138,184, 82,186, 7,182,165, 24,193, 4,138, 97, 20, 20, + 77,137, 57,150, 75,179,153,205,139, 12,249,241, 89,111,202,205,114,192,161,191,170, 41,204, 9, 9,248,229,231, 85, 30,158,206, + 18, 24,204, 54,140,249,124, 30, 54,175, 93,224,224,238, 36,134,201,194, 98,251,209,219,121, 77,116,171,201,232,190,254, 31, 47, +222, 26,125,248,135,221,143, 15, 87,214,137,209, 20, 13, 15, 39, 9, 22,237,139,133,163, 92,136, 26, 74, 49,104,186,124,113, 53, +186,127, 9,103, 81,177,217, 6, 64, 92, 81,231,166,240,106,212,209,193,205, 39,124,240,167, 11,220,227, 85, 20, 8, 49,227,169, +147, 4, 67, 70, 78,114,174,239, 37,131, 66,202, 32, 57, 45,171,238, 87, 51,103,182,136, 34,116, 75, 83,118,108,106, 85,217,174, + 83,167,206,144,126,253,250,201,167, 79,159, 46,244,245,245,197,238,131,103,252,122, 12,253,162,127, 70,118,190, 47, 71, 0, 79, +143, 26,105, 99,135,245, 61,126,234,212,169,148,180,180, 52,225,138, 21, 43, 90, 31, 57,114, 36, 36, 59, 59,219,238, 55, 81,150, + 16, 24,204, 44, 88,150, 3,203, 81, 80, 21,189,150,199,145,174,248,173,154, 12,236,217,165,149, 96,205,239, 79, 81,172,183, 66, + 38, 98,144,144,165, 67,219,182, 45, 5, 7,182, 83, 93,203,187, 99,236,208,119,231,122, 58,144,222, 3,218,249,195,195, 69,142, +109, 63, 45,198,177,235,137,189,115,138, 41,172, 39,204, 4,111,137,160,135,130,203, 90,223,165, 69,128, 87,247,230,126,184,211, + 34,192,235,202,221,199,113,178,247, 87, 77,201,208, 10,255, 44, 60,253, 69,113, 69,245, 94, 67, 41,194,150, 51,201, 80, 72,132, + 80, 72, 5, 37, 31,137, 0, 52,253,102, 27,198, 75,189,131,125, 25,142, 29,203, 48,130,177,195, 63,120,223,103,196,240,161,132, +162, 25, 28, 60,124,124,224,158, 61,187,179,172, 22,243, 22,150,102,182, 26,179, 30,165, 85,169, 5, 40,192,195, 73,140,175,126, +141,130,131, 92, 8, 71,185, 16, 14, 50, 33,186, 55,117,127,147,116,186, 76, 28, 88,175,239,196,193,117,186, 6,213, 86, 54,184, +255, 68, 29, 51,118,209,157,181,151,138,186, 78, 91,191, 38,196, 85, 92,104, 18,204,155,241,169, 32, 35, 51,171,235,193,227,151, +187,177,230, 49,177, 54,139,238, 27,213,131,131, 71,203, 35, 75,143,141, 8,171,217,102,168,212,162,181, 62,188, 31,151, 94,191, +192, 40, 70, 76,138,166,180, 76,133, 80,150,149,109,105,249,102,165, 39,163, 64,207, 92,203,112,165,187,226,114, 68,181, 92, 81, + 6, 11,135,251,137, 90,212, 9, 12,131,151,183, 15,204,125, 63,172,115,235,194,161,163,183, 46, 31, 93,170,207,126,252,141,189, + 60,123, 79, 68, 96,225,210,181,241,160,240,168,116, 52, 15,158,254,175, 41, 13, 86,173, 94,255,194,185, 73,159, 77,110,240,186, +226, 90,238,153,187,231,157, 1,163,134, 54,105,221, 3,241, 79,158, 34, 62,250, 14,186,191,211, 11,125,250, 13,134,217,100,252, +120,235, 47,235,111,235,114, 98,127,126,165,207,245,106,216,161,113,104,240, 30, 31,111, 31, 95, 66, 74,183, 38, 35, 4, 38,147, + 17, 51,191, 28, 7,189,182, 24, 65, 65,161,237,157, 59,246, 52,129, 98,192,113, 4,249,249,121,186,216,199, 49,239, 24,115, 99, +111,218,155, 64,189, 94,111, 85,169, 84,184,119,239, 30,226,226,226, 16, 29, 29,141,252,252,124, 56, 57, 57,105,117, 58,157,221, + 25,117,118,118,118,108,220,184,241,135, 7, 14, 28,144, 58, 57,253,173,249,205,102, 51,228,114, 57, 6, 13, 26, 36,236,208,161, + 67,205,209,163, 71,127, 98,177, 88,246, 22, 21, 21,105,202,227, 41,120,120, 50,211, 51,116,224,166,190, 67,199, 79, 2, 0,145, + 68,153,184,238,215,195,209,149,253,111,145,212,209,239,157, 65, 99,234,131, 16, 80, 20,181, 46, 63,246, 72,118, 69,215, 90, 44, + 22,217,254,253,251,107, 82, 20,245,194,248,186,224,199,253,237, 30,198,103,189,179,113,254,215, 2, 7,133, 4,121,106, 51, 38, + 76,154,226,102,183,184, 10, 29, 48,185,101,179,176,159,231,205, 24, 7,133, 92,134,179, 55,158,226,203,217, 75,109, 5,121,185, +187, 64, 81,107,242, 98,126,127, 83,175,197, 91,217,238,173, 65, 77, 37, 28,122,181,149,142,251,160,139,212,108,101, 81,168,181, +194,100, 97,193, 17, 2,181,206,138,152,148, 98,184, 57,137,176, 5,255,124, 84, 75, 96, 9,132,226,126, 95,140,234, 43, 94,185, +247, 38, 34,206,238, 53,100,221, 11,151, 63, 83, 6,205,135, 37,166,223,221,239,255,210, 45, 81,246, 12, 18, 2,138, 89,221,174, + 77,139,158,227, 39, 76, 34, 77,130,252, 68, 0,141, 71,241, 73,214,109, 91,183,140,186,120, 77,188, 86,147, 30, 53,247,185,193, +180, 90,211, 55, 57,142, 75,127,217, 98,197,113,175,188,205, 70,149, 55,224, 56, 43,132,216,116, 50,177,228,205, 24, 4, 78,114, + 33,246, 93, 76,135,166, 32, 35,175,137, 97,245, 95, 99,251,122, 12, 88,180, 53,230,232,134,227, 57,119, 1, 68, 3,200,169,136, +147,162, 1, 1, 67,193, 73, 33,130,147, 92, 8, 39,165, 16, 52, 69, 85, 40,174,230,253,242, 96, 7,128,216,151,196,213, 51, 78, +185, 71, 96, 35, 7,215,154,191,191, 55,113,137,203,195, 84, 11,104, 26,240,247, 82,192, 69, 41,134,217, 10, 36,171, 44,165,121, +117,196,228,233,243,221,103,253,107,226,169,156,236,206, 77,128,203,182,202,242,174,215,235,197, 35, 71,142, 20, 90,173, 86,203, +232,169,139,122,102,229,228, 13, 92,187,228, 43,137,155,155, 43,116, 70, 27,238, 61, 74, 14, 94,250,195, 79,254,127, 92,186,117, +100,214,196,129,199,122,247,238,237,180,127,255,126,174, 58,245,174,202,201,251,105,251,238,240, 93,107, 86, 46,197,227,228, 2, +108,251,101, 3, 8,107,219, 84, 69, 85,190,192,185,121,243,102,143, 29, 59,118,208, 55,110,220,200,127, 89,128, 82, 20, 20, 5, +106, 19,156, 21, 34,200, 37, 2,120, 57, 75,224,234, 32,130, 68, 68,131,166, 95,232, 68,158,113,110, 13, 63,185,136,211, 23,225, +216,111,150,225,219,126, 90,140, 49,159,207, 65, 84,158,232, 52, 45,119, 94,244,249,176,129, 95,215,144,163, 79, 77,103,218,163, +123,243, 58, 80, 72, 69,152,253,197, 72,180,188,155,236,145, 94,196,205, 41,208,163,233,252,211,152, 91, 94, 58,105,134,130,128, +161,225, 32, 19,226,210,201,125,185,250, 98,181,154, 98, 74, 44, 44, 86,179, 37,197,206,102,252, 74,121,202, 61, 2,103, 53,107, +220,104,241,164,241, 99,233,246,109, 91, 17,154, 22, 32, 79, 99,161, 8, 8,166,125, 62, 17,147, 39,142,243, 74,207,200,249,246, +231, 13,155,231, 94, 56, 71, 22,234, 84,143,231, 87,198,201, 80, 52,104,154,130, 66, 38,132, 82,250,247,199,104,230, 64, 81, 96, +106,134, 13, 83,131, 2, 40,138,202, 76,191,243, 91,176, 61,233,244,105,220,231,252,229, 92, 81, 67,253, 41, 99, 68, 66,124,228, +162, 91, 15, 82,111, 1, 40,240,237,228,252,137,213, 74,160, 53,218,144,148,163,135,205, 76,168, 49,189,253, 80,119, 40, 21,180, +100, 91,228,174, 63, 30,192,241,185,206,254, 5,206,140, 27,225, 70,215,208,193,195,214,252,184,249,246,202,197,115,152,124,141, + 25, 44, 1,100, 98, 6,210,210,143, 76,196,192,168, 83,227,231, 77,191,102,219, 64, 13,193,229,202,219,252,171,157, 6,249,104, + 72,223, 78,191, 81,128,152,162, 69,233, 62,126,117,252,186,245, 27, 37,237,222,255, 99,176, 54,203,172,187, 87,201, 69,125,110, +236,121,123, 56, 67, 67,130, 1, 10,143, 84, 81, 71,135,148, 12,146, 3, 15, 55, 12,106,216,224,229,115, 1, 1,129, 13,236,169, +247,178,102, 37,115,111, 48, 62,160, 97,227,153,109, 58,116,171,147,153,111,130, 75,205, 0,220,139,188,139, 51, 7,127,142, 52, + 20, 23,174, 60,115,226,200,204,133,203,214, 54,237, 55,232, 3, 28,253,253,192,116, 93, 78,236,134,210, 50,125,198, 73, 56,238, +163, 29, 91, 54,251, 10, 69, 18, 88, 89, 2,171,141,131,149,229, 96,181, 17,100,101,101,162, 88,171,133, 84,230, 0,133, 99, 13, + 88,109, 37,150, 66,147,201,170,152,248,113,191,201, 70,224,102,121,233,172,211,234,163, 59,160,169, 90, 37,239,168,165,117,102, + 50,234,189,189,189,119, 1,128, 68, 34,129, 68, 34,129,205,102,195,195, 76, 76,243,246,234, 52, 27,164,180,178, 57, 46, 61,251, +222,111, 45, 42,202,187,175,175,111,255,242,196,149, 86,171,197, 95,183, 31, 56,109,223,127,182,119,114, 90,118, 61,142,245, 48, +201,188,154,246, 42, 42,186,216,191,162,242,204,137, 58, 58,217,183,243, 84,122,250,164,145, 1,235,126, 13,191,149,112,102, 81, +165,230,228,186,221,191, 54,207,156, 60,162,197,242,117,219,226, 51,174,172,251,178,170, 58, 18,137, 68, 66,149, 74,245,236,249, + 94,176,254, 80,159,212, 28,205, 59, 63, 44,158, 35,186,247, 84,139, 7, 73, 89, 24,213,195,207,238,231,221, 43,100, 80, 80,173, +218, 53,215,174, 93, 56, 21,113,153, 6,172, 63,116, 11,151, 79,238,186,107, 49, 22,191,171,138, 57,158,251, 58,125,200, 91, 16, + 88,175,112,150, 13, 4, 23, 31,228,161,216, 80, 34,172,172, 44,135, 98,131, 13,185, 69, 38,168,117, 86,104,141, 86,140,122,199, +175,250,234,143,144,150, 0,220, 1,168, 40,138,186,253,252,113,153, 6, 45, 27, 98, 94, 58,206, 43,181, 24,186,150,142, 21,226, +231,104,205,207, 25, 49,202, 59, 95,118,127, 12,128,224, 82, 78, 22,192, 45,138,162, 10,237, 17, 88,164,204, 92,249, 92, 33,151, +251,202,202,218,172,181,124,188,189,193,145,244, 23, 46,241,107, 53, 76,255,197,216,247,101, 43, 89,155, 46,235,254, 33,187, 99, +178,148,238, 13,218,137, 68,226,147, 75,151,173, 32,195,250,119, 22,103,171,173,134,152, 12,163, 74,107, 34, 54, 47,247,250,146, +101,203,151, 43,151, 44, 91,249,217,145,195, 92,145, 54, 39,230,135,242, 56,188, 91, 12,191, 67, 81,116, 45,250,111,179, 60, 8, + 71,210, 51,238,236,107, 1, 0,111, 18,107,165, 51,218,192, 48, 20,132,165, 49, 41,122, 51, 11,125, 81,118,126, 19,253,218,191, +198,246, 46, 17, 87, 55, 51,188,158, 50,140,202, 2,160, 82, 23, 4, 77, 81,208,232,173,112,148, 9,225,164, 16,193, 89, 46,122, +222,130, 85,158,184,138,174,140, 83,100,177,164,177, 86,147,145,176, 44,250,182,116,135,135,147, 24,222, 46, 18, 72,197, 2, 88, + 89,192, 96,230, 96, 48,179, 72,201,213,163, 88, 47, 65,227,206,195, 3,220,188,111,234,179,147, 90,236,200, 79,185, 51,161, 82, + 11, 19,203, 98, 79,248,153,128,140,172,220,129, 71,119,175,150,228,170,173,120,144,172, 69,110,161, 25,132,114,194,236,185,115, + 37,243,230,125, 55,248,192,239,231,147,218,181, 8, 76,175,110,185,234, 85,177,187, 15, 30, 10,255,233,221,254,131, 28, 98,110, +253,129,248,123,231,231,233,114,171, 23,127,229,231,231,199,254,252,243,207,206,155, 54,109, 10, 56,122,244,104,154, 74,165, 74, + 44,123,168, 92, 29, 68,153,231, 46, 92,113,237,220,190,147, 32, 45,207, 8, 55, 7, 17,252, 60,229,184,123,253,162,153,166,168, +211,229,241,149,186, 1, 71,160,251, 87, 56,118, 61,177,119,116,190,228,210,167,227,198, 36,159, 59,121, 43,255,199,221,231, 87, +212, 84, 90,239, 75,185,220,245,119, 91, 4,120,205,154, 50, 18, 75,127,220,141,203,119, 31,231,234,104,159,197, 89, 38, 91,133, +147, 10, 24, 26, 16, 10, 40, 56,200,132,208,235,212,234,232,243, 27, 3,223,210,203,209, 39,103,126,223, 77, 23, 20, 91,145,158, +103,160, 50,243,139, 97,227, 56, 56, 43,196,176,113, 64, 81, 65, 30,181,103,207,110,220,190, 29, 65,131,161, 63, 5, 48,191, 42, + 11, 22, 67, 83, 80, 74, 5, 80,202, 74,172, 64, 74,153, 0, 22, 27,135, 6,254,190, 88,187,224, 11, 71,119, 15, 79,244, 28, 50, +193,238, 4,202, 20, 46, 77,119,110, 92,136, 75, 17,247,187, 92, 76,216,215,210, 35,180,233,143, 66, 86,184, 18,132, 24, 76, 86, + 22, 26,117, 33,140,166, 52,180,170,153,135, 26, 10, 22,201, 26,111, 68,101,199, 43,171,234,232,243,163,142,220,163,200,160,185, + 7,143, 95, 88,218,171, 71, 23, 68, 39,105, 74,196,149,168, 68, 92, 9, 40, 14,171, 55,109,182, 22,170,139,251,229, 71, 31,205, +123,141,246,249,103,105,103, 92, 34, 16, 88,173,251,158,245,115,119,142,155,185,162, 87,175,193,159, 80, 81,183, 47,126,163, 7, +206,219,107, 61,127,245, 28,177,235, 92, 69, 93,137, 71,253, 22,123,183,239,216, 55, 44,164,129, 47,114,138,172,200, 44,180,224, +234,221, 4, 28,217,252, 77, 81, 81,206,211,143, 96,209,106, 57,202,166, 62,123,230,248,233,207,190,152,137, 70,141,154,214,209, +164,107, 28, 95,142, 61,228, 24,106,243,199, 99, 39, 14,243,244,240,116,224, 74, 45, 88, 28, 33, 8, 10, 10, 65,223,254, 67,112, +233,202,117,196, 68, 63, 40, 57,207, 1,132, 16, 20, 21,230,103,219,172,230, 29, 21,182, 35,134,170,181,125,211,106, 15,154, 2, + 44, 54, 14,102, 43,135, 89,179,231,153,167,126,187,190, 67,175,246, 77,162, 25,112,154,212,172, 34,231,219,177, 89,141, 41,161, +163,247,135,227,191, 22, 25, 44, 44, 52,122, 43,206, 31, 92, 87, 97,166,189,253,155,180, 85,214,110, 63,118,252,156, 77, 18, 9, + 67, 91, 26, 5,250, 38,118,110,211, 40,173,182,143, 91,241,146,117,123, 90, 93,191, 27,219,119,200,123,131,165,195,234,133, 80, + 62,174, 82,135,137,147,167, 52, 97, 3,218,127,156,147,240,215,174, 10, 7, 63,129,164,200,183,150,239, 51, 87,162,123,163,129, + 15, 0,188, 60,242,167,168,162,143, 54, 1, 0, 15, 79, 47, 35, 37,148, 20, 87, 67, 16, 16, 0,248,254,199,240,190,233, 42,237, +208, 31, 22,207, 17,221, 75,212,225,222, 83, 53,196, 34, 6, 38,139,253, 97,109, 44, 69,166,125, 61,101,140,176, 64,103,195,197, + 7, 42, 68,221,185, 64,108, 22,205, 40, 66, 9, 70,187, 53, 26,248, 49, 5,212, 37, 64, 18, 77,225, 23, 51,141, 29,234, 7, 71, +213,175,107,193,114, 15, 30,220,142, 98,208,151, 17,136, 90, 2, 92, 67,155,213,234, 65, 51, 76, 94,206,131, 67,158,213,200, 59, +244,185,241, 88,177,228, 91,172,221,114, 4,183,226, 10,224,100, 75,195,209,109,139, 49,125,233, 30,232,205,108,101,105,168, 72, +143,184, 83, 20,117,130, 16,210,143, 16,242, 14, 0,113,217,113, 73, 31, 70,157, 40,253,223, 47, 28,207,154, 53,235,155,165, 75, +151, 70,151, 93, 91,118,190,236,218,202,206, 63,119,191,235,236,217,179, 67,151, 45, 91,182,164,109,219,182,191, 93,191,126, 61, + 17,128, 93, 2,235,249, 76, 84,248,148,123,132, 14,104, 69, 8,199,120,185, 42, 17,224,239, 11,197,251,163,101,167, 40, 74,199, + 48, 52,189,125,205,108,105,190, 65, 0, 1,195,216,109,239,149,122, 4,181,150, 41, 21,167,246, 31, 56, 68, 26,212,241, 18, 31, +186, 81,148,122, 55, 81,255,204,164,171, 81,165,136, 3,106,152,152, 97, 31, 12, 81,156, 62,123,110,154, 22,248,161,252,129,129, +174,245,227,234,229, 30, 14, 50, 33,104, 10,208, 24,108,152,246,175,175,223,120,244, 34, 32,204,228,127,125, 7,154, 42, 25,124, +180,234, 2, 44, 94,179, 93, 59,164,214,133,107, 99,123,187, 13, 88,180, 53,230,232,217, 71,178,132,193,131,187,169,147,147,147, + 11, 51, 51, 51, 43,119,193, 16, 54,125,232, 39, 83, 69, 52, 93,226, 54,162, 40, 10, 0,155,243, 58,226, 10, 0,138,138,146, 52, + 82,177,114,240,238,213, 83,182,212,174, 85,179,134,131, 92, 10,165, 66, 66, 53, 12,170, 47,109,211,186,173,204,175,126, 35,209, +149, 71, 90,164,170, 12,120,154,161,129,196, 61, 84, 56,172, 75, 15,236, 94,247,117,223,252,148, 59, 85,230,255, 66, 68, 84,255, + 13, 43,231, 72,114, 10, 45,120,148, 86,140,236, 2, 19,178, 11,141,200, 46, 52, 65, 41, 21,160, 77,247, 33,146, 99,231,195, 7, +181,107, 17,248,227,235,148,239,211, 39,137, 71, 82, 50,178, 70, 53,105,214, 10,123,118,110,111,131,154, 53,165,200,200, 48,218, +123,255,150, 45, 91, 10,194,194,194,220,126,248,225, 7, 93, 80, 80, 80,211,205,155, 55,251,199,197,197, 93,170, 87,175, 94,255, +141,235, 22, 94,154, 58,103,165,159, 0, 54,167, 54,237,219, 51,114, 49,133, 27, 87,206,154,118,108,217,148,105, 41,210,206,172, +116,244,146, 59, 47,202, 41,166,224,238,227, 27,165, 16, 90,123, 10,229,150,184,194,221, 95,236, 46, 4, 14,215,235, 61,229,207, +139,119, 98,227,154,223, 77,246,184,112, 55, 46,183, 64,111, 13,124,122,122,122,165, 29, 46, 67,149, 90,176,228,127, 91, 44, 61, +154, 12, 77, 32, 20,229, 94, 38,108, 40,148, 88,180,168,146,135, 48, 51, 35,242,128, 29,129,209, 20,225, 56, 32, 46, 93,139, 98, +131, 13, 70,171, 13,190,110, 10,168,114,210,177,241,199, 29,136,188,115, 27, 61,251, 12,192,207,191,238,193,184,143,223, 55, 86, +245, 96,210, 52, 5,154,166, 74, 45, 87, 37,226, 74, 41, 21, 0, 20, 80,164,179,226,240,181, 52,212,247,167, 65, 85,195, 91,232, +160,148, 65, 93,108, 4, 45, 84,226,241,213, 93,242, 63, 46,220,154, 61,127,229,214,175, 52,218,156,212, 39, 49, 17, 8,114,201, +135,191,143, 25,209, 57, 78,184, 83, 80, 7, 65,245,235,129, 22,221,182,139, 59, 47,186,241,138, 99,244,161,126, 45,155,133,180, +173,237,225, 4,131,153, 45,181, 98, 9,176, 99,251,118, 36, 39,165,143,205,143, 57, 26,249, 54,148,172, 46, 55, 81, 37,241, 8, +248,236,225,141,243,137,131, 62,154, 12,175,154,181,155, 22,165,222,179, 51, 60,193, 62, 49,197,217, 39,176,232, 26,117,154,237, +220,185,251,224, 48,255,218, 94, 56,119, 43, 9,145, 79, 10,225,232,224, 12, 70,225,141,192,206,163,157, 31,158, 94,247,158, 33, + 79,187, 83, 40,146,127,218,170, 77,123, 16, 66, 16,251, 56,186, 64,173,118,122,165, 9, 24,178, 98,239, 69,100,197, 58,190, 32, +138,221, 26, 54,117,112,170,113,207,104, 97,145,145,145,142,191,174, 95, 10, 51,100,197,222,171, 78,121, 73, 68, 52,206,222,205, +133,197,198,193, 98,229, 16,214,184,161, 81, 40,146,117, 92,190,229,100,155,236,156, 92, 90,174,116,226,156,220,234,137,156,173, +217,166,251,137,106,145,197,198,161,158,119,229,239,229,242, 26,245,150,124,249,175,169,193, 2,177, 12, 26,157,201,156,149,158, +225,245,203,190,139,218, 71,177, 49, 53,235,214,169,237,184,112,225,124,145,198, 72,144, 91,100, 66, 94,177,133,250, 96,196, 88, +159, 93,219,126,254, 8,192,174,106, 36,189,241,111,187, 54, 89,107, 40, 69, 84,177,222, 74, 84, 26, 35, 59,249,179,105,141,223, +164,237,188, 32,174,158,234,112, 47,177, 8, 18, 17, 3,137,136,129,213,102, 95,136,164, 91,240, 80,133,155,171,226,163,214,205, + 2,112,230,174, 10, 2,134,130, 65,167, 49, 75, 37,202,168,134, 13, 27,208,205,154,134,162, 75,135,118,120,146,152, 28,116,230, +220,133, 53,183,110, 71, 46, 22, 54, 26, 52, 51, 47,250,247,159,171,147,214,148, 12,149, 34,199,230, 59,220,195,203, 45,116,192, +128,254,146,218, 53, 61, 41, 55, 87,103,176, 16, 97,210,228,207, 61,236,246, 26, 17, 2, 2, 96,217,130,217, 48,153,205,240,112, + 22,131, 16, 96,219,250,239, 97, 54,155,225,227, 42,133, 90,103,173, 74,232, 85,168, 71,202, 19, 68, 47, 11,173,178,239,101,215, + 45, 93,186,180,223, 75, 2,176, 95, 5,194,240,149,235,202,238, 95,182,108,217,146,231,126,215, 87,199, 69, 72, 85,150, 41,183, +198,131,218, 75,196,178,179, 63, 47,157, 70, 23,233, 44,144,136,104,212,243,175,139, 41, 95, 76,149,119,111,230, 1, 3, 28,113, +104,223, 14,141,141,181,158,176,235,205,214, 51,160,133, 66, 38, 63,189,109,231, 62,206,203,195,141,250,229, 79, 85,162, 74, 99, +123,182,196, 65,220,205, 99,220,157, 51,191,120, 19, 80,167,229, 82, 89,128,201,108,114,169,176,199, 41,173,208,109,103,147,193, +208, 52,152,183,180,178, 23, 77,211,236,175, 63, 46,132,155, 99, 73,204,213,247,107,119, 23,247,119, 63,125,225,121,113,213,172, + 89, 51,117,211,166, 77,139,104,186,234,127,154,118,123,111,121,179, 37, 94, 75, 92,149,193,152,243,240,182, 17, 8, 85, 39,255, +125,238, 15,132, 9,221,234, 30,156, 62,252,195,143,102,123, 54,234,239,144,148,165,134,152,182,162,101,176, 55, 46,157, 57,204, +165, 37, 62,154,104, 15,119,110,190,218,215,205,213, 21,145, 79,181,200,204, 55, 34,171,160, 68, 92,101, 23, 24,161, 49,216,208, +172,174, 7,138,212, 90,223,215, 22,176, 20,249,253,204,233, 51,163,250, 12, 28,134, 41, 95,205,239,179,101,195,170, 7, 90, 15, +135,143,141,185,143,111,217,115,127,120,120, 56,123,231,206,157,196,188,188,188,150, 51,103,206, 44,174, 91,183,174,215,194,133, + 11,199,215,171, 87,207,167,123,215,174,234,219, 23,219,236,156,250,213,252,174,223, 76,221,226, 79,211,116, 14,225,200,177, 76, +157,245, 59,228, 61, 50, 84, 90, 79,199,190,121,252,221, 83,203,168,238, 29, 93,143,185,202,232, 16, 33,101, 26,129,224,249, 7, +240,104,190,229,233,233,245,197,178,247, 87, 77,201, 40,226,230, 24,105,175,197, 85,137,171, 18, 11, 22, 5,179,133,131,163, 76, + 88, 54,115, 20, 32,240,222,176,126,149,220,221, 73, 2, 1, 67, 65,200,208, 80,235,173,200,215,152,241,213,204,153,246,150, 32, +199,114, 28,244, 38, 22, 6,179, 13, 20, 40, 20,107,242, 48,251,171, 47, 75, 32,211, 47, 0, 0, 32, 0, 73, 68, 65, 84,209,167, +255, 16,140,157,248, 47, 20, 25,128, 59,137,197,176, 88,173, 85,202, 34,134, 2,244, 38, 27,198,246,242, 67,126,177, 5, 58,163, + 13,102, 11, 7,185, 84, 0,129,128,134, 66, 34,128,131, 76, 8,138, 34, 34, 47, 47,175,241, 0, 32, 20, 10,141,105,105,105,187, + 43,118,207, 19,212,241,245,132,193, 66,163,213,176,149,120,167,109, 32,238,157,219, 42,184,114,243,161,255, 87,243,215, 96,242, +136,182, 8,143,173,143, 26, 30,117,160,148, 75, 97, 37, 52, 0, 98,103, 64,222,124,142,182, 12, 30,177,233,215,109,177, 11,230, +125, 45, 45,212, 81,144,136, 4,184,112,225, 79, 68,220,188,179, 46, 47,230,232,238,183, 25, 75, 33, 36,180,167,163,147, 35,164, + 98, 6, 22,139,201,238,128,111,150, 35, 0, 65,176,123,232,192,195,165,117, 31,204,149,115,206, 14, 11, 22,229,228, 19,186,125, +211,150, 61, 31,121,123,121,224,200,249, 7,216,185,229, 39,212, 12,237,131,132,187,155,224,219,124, 16,148,254,221, 32,118, 56, + 56,158,102, 4,141, 39, 79,157, 61,164,121,139,182,184,126,245, 34,114,179,179, 54, 1,177,118,197,160, 49, 66,234,139,174,239, +244,131,201,194,162, 99,183,126, 56,125,252,200, 20,148, 78,158,120, 93, 48, 12,205,125, 62,110,184, 48,183,200, 44,204, 85,155, +144,145,103, 64, 98,182, 14, 71,247,111,181,219,108, 71, 49,116,203,206, 77,107, 9,199,175,184,144,230, 91,203,219, 36, 52, 25, +100,113, 79,158, 52,252,116,212, 71,194,186, 1, 65,180,170,200, 4,149,218, 12,149,218, 12,157,209,138,250, 62,181,105,147, 77, +208,182,186,105,245,112,146, 10,127, 62,145, 8, 71,185, 0,237,130, 93, 95, 59, 8,155,227,184,191,197,213,162, 18,203,213,253, + 68, 53,164, 34, 6, 98, 33, 3,137,136,134,149, 37,118,142, 69,182,225, 19, 70,125, 32, 51, 91, 9,242, 52,102, 48, 52, 5, 47, + 55, 87,137,175,119, 32,182,173,252, 28, 0, 48,238,235, 13,248,116,204, 72, 4, 5, 6, 64,173, 46,150,125, 58,105,234,106, 0, +118, 9, 44, 66, 8,217,115,244, 74,200,157,168,148,233,159,140,250, 88, 56,108, 64, 39, 58,242,169, 6, 89, 5, 38, 60, 77,208, +195,108,173,222,106, 52, 54,182,196,231,187,253,192, 9,200, 69, 12, 84,234,146,199,101,209,250, 3, 80,202, 4,200, 46, 52,131, +227, 42,181,222, 85,170, 71, 42,178, 58, 85, 7,207,139,176,202,206, 83, 20,117, 98,214,172, 89,223, 0, 32,179,102,205,250,166, +236,120,233,210,165, 6, 0,153,246, 10, 44, 84,228, 22,116,107, 60,168,189, 76, 44, 61,187,107,253, 55,178,243,113, 4,235,206, +222, 69,223, 54,222, 16, 9, 40, 72,149, 94,184,151, 88,132,243,231,143, 22, 95,141,184,105,164,104,107,149,211,162,100, 94,129, + 97,114,137,226,207,159, 54,239,180,121,122,121, 97,223,181,194,204,124,173,205,250,183,123,202, 74,221, 57,243,139,191,141,179, +246, 54,230, 36,220,174,234,205,155, 35, 68,180,116,227, 49, 16, 66, 0,142, 5, 7, 14,140, 72,162,168,221,234,163, 28, 80, 0, +203,114, 82, 1, 67, 27,159,249, 65, 74,134,166,244,212, 91,251, 90, 84, 85,195,142,114, 33,246, 95, 78,135,186, 32, 51,175,191, +251,233,191,202,196,213,233,104, 73, 66,243,230,205,212,173, 91,183, 46,146, 72, 36, 96, 24,230,117,234,248,141,196, 85,197,136, +180,230, 37, 97,217,161, 67,210, 1,125, 20,161,173,197,148, 16,205, 27,122,227,210,217, 35, 92,196, 31, 91, 7, 27,114,227, 79, +218,107,226,213, 26,109,200, 44, 48, 32, 35,207,128,172,194, 82, 11, 86,129, 9, 20, 5, 24,205,111,182,124,141, 33, 55,254,248, +238,221, 91, 55,153,172,152,216,177,231, 32, 76,159,255, 83,192,238, 77, 43,174, 38, 19, 91, 75,189, 42,225,161, 93,111, 92, 41, + 41,166, 61,123,246, 68, 22, 23, 23,247, 88,189,122,181, 54, 56, 56, 88, 44,147,201,242, 1, 72,227, 99, 99, 69, 23, 78, 29, 76, + 82,101,102, 78,176, 90,173,183,237, 77,151, 95,231, 81, 18,153, 37,114,188,159,188, 93,175,122, 94,114,248,201,117,189, 26, 42, +239,255,144,223,109,234, 18,213,133,117,185, 89, 38,219,185, 2, 61,154,102,104,133,127,218,213,217, 88,204, 41, 31, 78,152, 5, +134,166, 96, 49,153, 83,158,185, 35,156, 36,152,191,251, 17, 28,100, 66, 40,101, 66, 56,200, 4,104, 31,236,138,106, 24,136,136, +213, 70, 96, 48,219, 96, 48,177, 48,152,108,112,171,237,140, 95,119,133, 35, 85,101,192,177,219,121,120,156,172, 65,160,175, 2, +132, 84,109,119,226, 8,171,251, 96,252, 28, 7,134,166,193, 80,160, 27, 6,212, 65,129,214, 12,145,128,134, 88, 44,134, 92, 42, +128,163, 92, 8,161, 64,136, 91, 15, 30,192,100, 50,161,117,235,214,210,170, 28, 14, 14, 74, 25, 26,248,251,192, 98,181,225,212, +149, 24, 44,154, 54, 24, 61, 58,181,192, 87,140, 24,143, 77,205,224, 80,195, 1, 28,197,192, 98,227, 96,178,178, 0,168,202, 4, +112,187,210,184, 8, 35,128, 27,217,177, 71, 82, 89,102,224,248, 63,206, 94,216,221,191,111, 79, 68,222,143,198,161, 35,199,174, +230,185,170,103, 60,111,149,192,223,179,224,162, 95,179,185, 82,132,166,167,181,109,223, 5,218,194, 92,228,164, 37,217,221,169, +135,212,118,192,151,211,166, 52, 8, 10, 10,106,192,114, 4, 28, 71, 16,226,231,128, 9,147, 38, 53,168, 31, 16,216,128, 43,157, + 69,216,208,215,161, 82, 30,133,103,208,228,197,171, 55,126,236,235,235,139,211,215, 30, 97,233,156,137,145,114,185,178,110,139, + 26, 14,206, 92, 80, 83, 36, 70,157, 67,141, 58, 69,112,244,108, 80,107, 64,143, 81,181,250,188, 59, 8, 15,239,223,197,218, 31, + 22, 70,232, 24,217, 18,123,210,170,240,240,119,111, 26,214,234, 67,199, 26,158, 40, 84,107,161,116,241, 64,112,147, 22, 31,198, +220, 55,125,173,203, 77, 84,189,238,179,206, 17, 2,147,133, 67,129,214,130,116,149, 1, 73, 57,122, 36,101,235,193,113,132, 60, +239,162,174,188, 63,166, 40,133, 68, 32,168, 97, 77,168,253,224,207, 11,196,207,215,147, 90,177,112, 38, 99, 33, 18,228,170,205, + 80,105,204, 80,169, 77, 80,105, 74, 4,150,139, 82, 0,142,112,213,158,157, 81,160,181,192, 65, 38,128,147, 66, 4,150,125,253, +152,239,249,107,246,181, 75, 87,105,187,255,176,104,142,232, 94,146, 14, 15, 18,213,144,136,232, 18,235, 85,169,192,178,215, 45, +204, 8,232, 41,239,190,211, 26,105, 42, 35, 4, 12, 13, 1, 67, 35,160, 81, 24,220,228, 28,186, 15,155, 5, 0,232,223,183,100, + 25,146,196, 44, 29,142,223,200, 2, 0,145,189,105,205,205,211, 72,143,156,139,156,186,239,215, 21, 98, 35, 43,196,198,147,201, + 48,154, 89, 72, 68,165,110,119,113,245,198, 55, 27, 91, 98,193, 74, 83, 89,160, 51,177,208,232, 45, 32, 4,184,149, 80, 12,189, +137,133, 90,111, 65,155,160, 26, 85, 62,115, 85,140, 79,253,222,200, 67, 85,114,191, 10,127,199,105, 85,105,193, 90,186,116,105, +244,210,165, 75,203,181,136,217, 35,176,202, 23, 87, 34,233,217,157, 63,126, 35,251, 51,150,224,210,131,124, 12,237, 88, 11,249, +185,233,216,178, 97, 29, 71, 8, 32,145,138,179, 89, 27,247,135,145,179,205, 84, 63, 56, 81,169,223, 87,238, 22,220, 68, 42,150, + 92, 88,186,118,147,197,203,187, 22,119,248, 70, 81,174, 90,207,190, 96, 43,100, 77, 38,154,112, 68,100,204, 73,176,107, 80,164, +105,202, 50,127,202, 96,112,132,224,187,117, 7,176,116,250,112, 40,165, 2, 57, 69, 81,114,157,209,134,105, 11,183, 98,245,220, + 49, 14,114,137,160, 84, 24,176,152, 56,229, 43,251, 68,128,137,133,174, 48, 59,191,177,118,205, 75,226,170,185,186,101,203,150, + 69, 46, 46, 46, 80, 40, 20,175, 35,176, 94, 17, 87, 94, 94, 94, 62,114,185,188, 70,153, 53,140, 97, 24,176, 44,171, 75, 72, 72, +120,173, 69,223, 52, 69,121,191,103, 38, 69,181,110,223,229, 93, 92, 62,251, 59, 23,113,106,203,224,234, 76, 49,119,118,114, 76, +187, 27,147, 18, 12, 40,145,145,111, 68,118,161, 17, 89, 5, 38, 88,108, 28,252, 60,229, 72, 79, 75,133,179,147, 50,205, 94, 62, +153,103, 64,111,154, 48, 19, 56, 10,191, 26,114, 98, 79, 1,128, 46, 51,102,210,129,221,155, 30, 70, 71,223, 95,219,111,248, 20, +113,143,247, 38,137, 54, 47,251,108, 22,128,225,118,119, 14,185,185,250, 99,199,142, 69,248,248,248,244,251,238,187,239, 76, 0, +196, 38,147, 73, 62,102,204, 24,121, 74, 74,202,151, 0,236, 74, 99,135,209,219,220, 40, 41,233, 45, 34,198, 17,126,114, 93,207, +110,157,218,162, 93,168, 47,210, 59,181, 5,128, 47, 82,244,202, 64, 83,189, 95,247, 91, 89,252,177,113,199,169,165,227,134,117, +251,114,183, 96,254,234,172, 19,243, 43,181,136,197, 93,221,214,171,188,174, 67, 88, 26,248,254,188,192,178,177,164, 58, 46, 56, + 98,101, 57,232, 77, 54,232, 77, 54,104,141, 86,156,191,151,139,156, 34, 51, 10,117, 22, 24, 77, 44, 8, 0,139,149,148,173, 42, + 82,185, 88,141,216,233, 92,246,189,102,216, 48,245,186, 5, 83, 28, 15, 93, 75,135, 66, 82, 18,143,229,164, 16,195, 81, 46, 4, + 64,112,233,210, 37,148, 77,143,175,234, 45,254,208,233, 91, 88,189,227, 2, 78,111,157, 9,169,152, 65,211, 65, 11, 48,106, 80, +107,112, 28,193,147,216,168,156, 6,193,205, 60,105,165, 28, 52,141,178,152,148,202,202,211, 21,192, 49, 0,253, 0,188, 11,128, +168, 98,142, 22,254,206,230,235, 46,156,220,167,208, 25, 76,182,194,148, 71, 63, 65,151,215,185, 44, 9,165,111,192,151, 0,116, +122, 93, 99,182,204, 35,112,221,167,147,166, 13,173, 95,191, 30, 14,236,221, 6, 66,168, 67,246,222,188,251,120, 4,214,172,125, +113,198,224,132, 73,147, 26,108,222,184,241,133,115, 31,143, 25, 95,217, 44, 66,202,217,221,123,102, 80,195, 16,220,136, 78,199, +138,121,147, 35,141,185,137, 35,204, 74,215, 9, 22, 93,214,191, 66, 66,155,193,203,211, 21,217, 89, 57,232, 58,176, 7,250,244, +234,133,135,247,239, 98,209,183, 95, 69, 64,111,238, 89,149,213,246,111, 33, 36,156,216,165,215, 32,161,222,100,193,250, 21,223, + 98,194,140,197,104,211,181,191, 48,234,222,205,137, 0, 22,216,155,103,179,149, 67,215, 38,238, 48, 91, 89, 88,172, 28,142, 37, + 50,130, 87, 45, 5,128,128,161,233,102,245, 74,220,187, 26,131,181,242, 74, 16, 80,217,133,154,226, 58, 63, 45,158,202,232, 76, + 44, 84,106, 19,114,139,204, 80,105, 76,200, 83,155, 74,196,149,218,140, 60,181, 9, 2,134, 66,124, 98, 6, 24,134,170,118,252, + 93,145,206,130, 86,129, 46, 0, 40,208,175,233, 14,201,179,185,247,185, 31,151,222,125,197,194, 57,162,123,137, 90, 60, 72,210, +148, 10, 43, 26,226,231, 4, 22,103, 71, 8,150,123,112,255,118, 35,134,244,109,228,168,144, 34, 35,182, 24, 2,154,130,128,161, +224,232,238, 11, 39,169, 17, 83, 38, 79,128,107, 13, 39,164,230, 25,177,238, 72, 28, 30,196, 36,128, 51, 84, 47,219, 27,246,156, + 30,252,241, 71,195, 36,180, 80,138,221,103, 19, 33, 22, 49, 16,192,140,152,155, 87, 76, 57,233, 73,150, 98, 77,145, 66, 32, 16, +218, 69, 74, 1,196,198,114, 32,132, 96,201,247,179,241,219,142, 13, 56,125, 39, 7, 4, 37, 75, 53,252,117,120, 21,166,205, 90, + 4,149,198, 12,128,122,109, 5, 75, 81,212, 73, 66,200,187, 47, 11,161,151, 69,210,115, 22,168,242, 56,110, 63,207, 81,118,125, + 69, 2,238,249,152, 44,216,185,216,182,160, 28,165, 72,149,137, 43,169, 88,124,118,199,186,217,178,243,113,120, 38,174, 12,218, + 60,236,218,186, 89, 75,192,189,147, 27,125,236,150,189, 5, 34,119,111, 16, 42,145, 75, 46,207, 89,180,206,228, 83,203,223,118, +234,158, 38,191,216,200,190, 98, 6, 17,201, 21,172,194,201,221, 40, 16, 75, 86, 11, 13,230,111,243,242, 30,233,170,170, 82,142, + 16, 28,191,153, 13,112, 37,149,120,224, 74, 70,201, 58, 62, 12, 5,150, 43,241,115,159,139,204,125,118,206,190, 10, 4,246,159, +141,204,171, 72, 92, 57, 59, 59,195,217,217, 25, 74,165,178,186,109,163, 92,203,149, 92, 46,175,113,230,204, 25,169,163,163, 35, + 24,134,129,201,100, 66,143, 30, 61, 94,171,241,201, 61, 2,135,183,233, 54,120,105,135,174,239,226,226,153,195, 92,196,169,237, + 67, 12,170,106,172,223, 3,160, 79,167, 38,199, 87,172, 90,239, 63, 99,214, 28,137, 66, 42, 64,161,214, 2,134,166,224,231, 33, +131,171,146, 65,196,133, 19,198, 17,189,155,217, 45,254,124,107,213,217,181,106,221, 38,215,213,203,191,239,121,239,170,217,179, +168, 40, 73, 3, 0, 6, 85,252,166,184, 40, 42,182, 86,237,179,151,155,118, 26, 12,143,154, 1,125,147,114, 98,171,149, 95,149, + 74,149,123,248,240,225, 71, 33, 33, 33, 45,134, 12, 25, 66,150, 44, 89,226,146,158,158,126,208, 94,113, 5, 0,221,122,181,155, +166, 16, 90,219,186,202,232,144,122, 94,114,180, 11, 45,241,126, 14,123,183, 3,106,249,214,198,211,108,125,179,124, 3, 39,210, + 89,133,245, 54,110,218,118,219,175,134, 96,156, 77,107,136, 1,112,180,218,157, 3, 74, 59, 73,121,169,184,146, 10,160,148, 9, +193,145,146,223,236,183, 96,113, 48, 91, 56,232,205, 54,232, 77,108,137,216, 50,179,224,184,146, 96,101,138,162, 96,177,178, 85, +190, 13,150,215, 75, 58,186,184,193,191, 78, 73, 26,159,125,100, 66, 80, 20,224,238,238, 14, 87,215,170,215, 29,229, 56, 14,102, +139,173,116,208,101,159, 77,234, 48, 91,108, 32,132, 32, 46, 46,126,102,114, 98,242,192,128, 6,245, 59,133, 52,105, 86, 67, 38, +166, 81,106,157,170,236,173,118, 4, 0, 43,158, 91, 51, 77,200,192,120,228,240, 33, 69,191,254,253, 11, 45,186,188,231, 39, 75, + 48, 0,122,151,138, 49, 67,117,171, 73,225, 30, 56,200,197,181,198,226,145,163, 39, 4,118,125,167, 23, 46,157, 63,135, 99,135, +247,237,212,171,226,206,218, 75, 18, 20, 20,244,202, 44,194,250, 1,129,175,204, 34,172,227,223,160, 66,129,229,228,212,196,177, + 73,203, 46,190, 41,121, 22,252,241,199, 41,232,212,217,243,204,102,173, 30, 66,178,229,207,195,191,140, 29, 49,241, 59,199, 54, + 45, 91,192,217, 65, 14, 55, 23, 37,238,222,137,192,242, 5,115, 34,160, 55,247,172,186,255, 44, 69,112,176,168,166,204,119,170, + 95,189, 70,184,123,243, 26,158,196, 69, 69,223,187, 29,209, 40, 32,180, 53,220,125,252,166,166,184, 49,203,240,232, 81,149, 59, + 85, 16,150,164,127, 50,254, 95,165,131, 94,201,185, 54, 77,253,197,175, 54, 66, 10, 54,171,133,221,189,121,121,238,243,179, 8, + 43,226, 53, 22, 23,133, 95,189,249,240,171, 1,189, 58, 82,101,174,192, 50, 81,245,242,113, 64, 77, 5,158, 60,124,204, 89,117, +234, 67,213,171,114,146, 51,105,242, 23,178,146,180,115, 32, 37, 11,171, 85,183,221,192,200,138, 62,220,248,253, 55,212,253,100, + 29, 30, 38,105, 74,220,130,165, 2, 75, 34, 98, 32, 46,253, 75,136, 29,250,130,166, 87,124,252,126, 47,228,169,205,224, 8, 41, + 93, 75,143,130, 64, 32, 68,138, 6, 72,211,104,161, 42,202, 65, 98, 82, 50,212,217,137,160,105, 6,174, 53, 3,160, 79,181, 47, +173,197,172, 50,208,202,161,254,251,253, 58, 50,191, 95,207,130, 76, 34, 64,113, 94, 26,174,157, 57, 96, 32, 44,187,201,108, 53, +255,230, 65,196, 81,143,162,194, 45,118,118, 29, 42,141,206,236, 41, 17, 49, 56,176,253, 39,124, 48,106,210, 51,107, 54, 0,124, + 53,103, 33, 40,138, 66,161, 90, 11,128, 82,217, 97,185,122,254, 88,245,156,229,233,149,227,231, 68, 81,121,199, 84,233,177,185, + 2, 14,243, 75,162,202,252,210,121,243, 75,124,118, 45,142, 92,161, 5, 75, 72, 51,231,182,175,253, 70, 26,157, 43,193,173,199, +217, 24,218,177, 22,244,154, 60,108,254,121,141,214,104,181,244,201,139,178, 95, 92,149, 54,148, 94, 31,140,153, 30, 93, 47, 32, +216,124, 62,170, 56,177, 72,103,173, 48,142,161,245,208,111,162, 35, 79,254,212, 87,109, 77,156,172,240, 14, 97, 57,155,109,133, + 65, 21,247,125,249,157, 56, 17,127,183,238, 64,137,184,226, 56,124,189,124, 23, 8,199,150, 46,224,199,130,176, 28, 62,159,183, + 1,182,210,239, 44,199,130,178,178,242,170,146,171,148,138,206, 54,214,174,113,122, 89, 92,133,133,133, 21, 57, 59, 59,195,213, +213, 21, 46, 46, 46, 40, 19, 68,111,234, 22,164,105, 26, 74,165, 18,151, 46, 93,130, 82,169,132, 66,241,122, 11,228, 43, 60,130, + 62,104,213,109,208,158,174,253,199,208,127, 30,217,204,222,188,116, 98,168, 81, 21,107,183, 8, 96, 89,150,178, 90,173,232,213, +165,121,202,189,216,212,211, 11,191,255,190,119,203,110,239, 73,218, 5,121,192, 96,182, 33, 61, 45, 13, 17, 23,143, 25, 3,106, +187,157,110,215, 34, 48,221,106,181,130,101,217, 42, 7,112,147,201,156, 79, 11,165,174,195,134,127, 40,185,125,235,214, 30,185, + 71,224, 62,154,225,238, 19,150,105, 2,194,125,208,164,113, 48, 44, 54, 14, 6,189,166,224,117,242, 29, 29, 29,125,123,213,170, + 85, 65, 66,161,176, 86,120,120,120, 94, 97, 97, 97,181,182, 11, 58,119,242,214, 58,129,210, 26, 95,102,193, 74,235,216, 22,195, +251,117,192,111, 39,175,225,226,149, 8,164,232,149,247,116,102,230,247,244,244, 76, 83,136,139,250,240,160,246,117,153, 67,187, + 52,135,162,187,204,124,159, 16,217,185,188,203,243,237,158,224, 65, 81,128,198, 96,125,206,130, 85, 18,223, 68,211,148,221, 22, + 44, 10, 72,188,114,253,110,104,243,192, 96,220,123,170,129,170,208, 4,189,185,164,221, 19, 16,184, 58,138, 32, 17, 49, 72, 73, + 74, 4, 71, 44, 73,213, 27,103,160,234, 51,116,130,160,244,245, 69, 32, 20, 10,158, 5, 68,200,164, 98,173,135,135,135, 93, 2, +203,202,178, 24,210,171, 53,218,180,108,130,129, 19, 87, 1, 0,206,239,252, 26, 46, 74, 17,194,195,195,145,246,215,218,221,254, +109, 39,158,141,122, 24,243, 94,116,228,245, 15,251, 52,151, 53,243, 18,100,137, 42, 81,197, 71, 75, 93,132, 93, 1,244, 40,181, + 76, 89, 89, 27,151,218,187,119, 47,142,101,185,231, 99, 34, 92, 0,180, 5, 80, 0,224,110,169, 40,171,228, 5, 48,232, 29,208, +216, 7,138,146, 42,101,242,148,186,117,235,249,180,108,211,218,105,208,144,247, 33, 22,137,241,231,185, 51,248,113,205,178, 3, +218,172, 71, 99,170,229, 30,179, 51,160,189, 50,119,145, 90,237,164,139,139,185, 87,152,152, 99,118, 17, 56, 55,128, 80,226, 48, +129,114,242, 89,199, 72,148,223,213,108, 51,202,241,252,181, 91,136,190,119, 29, 62,110, 50, 36, 62, 73,208, 71,221,143,220,160, +167,132,223, 35,239,145,222,222,116,202,243,217,247,218,140,236,237, 98,180,176,184,122,225,164,145,179,113,189,111, 92, 62,245, +196, 55,176,165, 52,180,101,119,151,188,163, 91,134,232,129,223,170,226, 73,190,181,231,149,208, 11,134,188,159,121,234,220, 21, +165, 79,237, 0, 6, 20, 13,147, 65, 7, 85, 74,148,205,168,201,209,231, 70, 29,245,177, 43, 28,192,150, 49,239,219,101,155, 38, + 55,111,218, 72, 65,136,248, 5,139, 85,217,247,252, 98,115, 73,204,172,174, 8, 79, 31, 94, 51,170, 18,212,179, 43,239,235,172, +242,252,252,130,103, 83,243,101, 90,231, 58,106, 39,181,228,217,176,206, 0, 78,106,231,103,150,138,252,252, 2, 49,203, 90,229, +246, 60,158,206, 14, 82, 60, 76,202,124, 22,208, 46, 17,209,165,177, 87,127, 91,178,236,124,206,155, 11,196, 10,100,228, 27, 65, + 19, 2,142,179,193,102, 53, 67,171,209, 32, 51, 35, 27, 57, 57,185,208, 22,171, 33, 83, 58, 35,180, 89, 11, 56, 56, 56,224,209, +157,139, 0,168,227,118,137, 65, 78,212,160,101,139, 22,194,232,228, 98, 88,172, 28,132,176,224,234,233,253, 70,155,213,220, 63, + 55,234,232, 5,192,142,173, 68,158,119, 15,114,228,207,168,216,148, 70,190,110,222, 84,228,211, 34,236,250,101,125,201,108, 82, + 91,137, 53, 51, 58, 85,135,204,124, 29, 50,210, 82, 8, 56,246,207,234, 60, 75, 20, 69,221,174,236,248, 53, 45, 97,111,204,241, + 90, 2,203,102,179, 73,107,251,213,193,240, 9, 35,177, 97,195, 70,196, 61, 77,193, 47, 63,175, 45, 17, 87, 15,127,255,203, 78, +254, 80,148,174,149,161,207,137, 93, 97,116,105,149,126,252,126, 33,109, 48, 19, 91,229,157, 93, 93,116, 28,179,250,140,161,184, + 64,204,154,244,130,227,187,199,236, 43,143, 19, 0, 24,154, 50,151,186, 5, 65, 81, 20,202,220,130, 27, 22,140,131, 92,194,128, +162, 40,232, 77, 54,124,252,229,106,236, 92, 93,242,102,245,233,228,233,250,138,210, 89, 38,132,190,108, 27, 79,141,238,237, 63, + 96,209,214,152,163,215,146, 93,159,190,251,110,103,117,179,102,205,138,100, 50, 25, 20, 10, 5, 28, 29, 29,225,232,232, 8,103, +103,231, 42,243, 94, 10,207,170, 98,174,104,154,134,163,163, 35,100, 50, 89, 69,194,237,101,206, 23,197,149,103,131,247, 91,117, + 25,184,175,219,128,177,244,159, 71,126,225,238, 92, 58,254,190, 81, 21,247,187,189,117, 84,106,117,184, 63,100,200,144,198, 19, + 38, 76, 16,125, 51,121,200,153, 51,151,238,198, 29, 62,119,168,127, 65, 81,177, 47, 33, 4,206, 78,202,180,161, 61, 26, 31,239, +216, 50, 40,229,252,249,243,220,190,125,251, 76, 20, 69, 61,172, 42,157,121,121,185,219,207,159,191,176,188, 83,231, 46,248,101, +199,190,119, 99, 98, 30,189,251, 36, 33, 30,190,126,245, 80,183, 94, 3,232, 41,103,156,191,124, 21,197, 5, 57,219,237, 44,207, +191,127, 8, 13,173,201, 48, 76,173,162,162, 34,227,188,121,243,130, 88,150, 61, 22, 26, 26,218,130,227,184,172,152,152,152,116, +123,242, 30,177,251, 99, 21,128, 93,126,157, 71, 29,204,180, 20, 77, 5,176,204,183,118,109, 92,188, 18,129, 27,127,221,220,152, + 39,175,253,253,232, 15, 63, 25, 87,199, 85, 56,110, 96,187, 58,140,135,139, 28,123,127, 89,197, 28,189,158,188, 38, 57,223,250, +235,242,203,243, 23,217, 83, 71,101, 40, 40,182,160,125,136, 43,108, 54, 2,150, 16,208, 20, 5, 7,153,160, 34,129,245, 10,167, +192, 44, 25, 51,105,226,132, 39,161, 77,154, 77,251,112,212, 4, 81,179,250,181,113, 43,190, 16, 0, 5, 87, 71, 57, 50, 51,179, +112,245,216,175,182,194,140,199, 27, 25,134, 91, 80,157,242,204,136,220, 31, 80,246,221,203,203,107,252,189,168, 40, 92,186,116, + 9,174,174,174, 40, 19, 87, 21,184, 8, 95,224, 44, 44, 44,254,107,225,170, 95,219,143,251,104, 32,250,117,105,132,203,183,159, +192,108,229, 96,177,113,207,130, 92, 19, 35, 54,137,167, 14,171,103,158, 60, 36, 80,163,183,138,147,191, 75,214, 92,198,139,139, +200,190,156, 78, 51,128, 51, 0, 90, 3, 24, 8,224,236, 75,123, 12, 82, 40,137,187,106, 4, 32, 2, 64,162, 93,121,167,177,247, +238,237, 59,174, 22, 27,135,171, 55,239, 7,119,107,223, 12,132, 35,184,125,251, 14,182,108,219, 98,124,248,224,222, 74, 93,142, +215, 2, 84,188,101, 76,185,229,105,239, 44,194, 10, 4, 86, 41,231,101, 91,118,114,208,198,235,215, 46,207,145,248,180, 64,195, +190,223, 12,200,184,127,108,128, 87, 72, 47,184,213,111,143,204,251,191, 35,242,175,189,167,238,216,108,179,164, 28,157,162,207, +139,213,217,251,188,151, 65, 34,149, 79,105, 20,214, 25,105,169,201, 72,138,143,218,105, 44, 72,200, 76,121,194,236,204, 72, 79, +153, 88, 55,164, 61,174,157,249,237,139, 74, 4, 86,165,109,222, 77,172,222,120,233,218,245,225, 25, 7,143,121, 22,107, 13, 50, +129,128,214, 75, 24,228,136,244, 79,246,219,157,206, 71,143, 44, 69,245, 28,135,124, 56, 97,238,201, 53,203,231, 9, 61,156, 37, +200, 46, 52, 66,163,183, 66, 99,176,130,161,128, 0, 31, 37, 12, 58, 13,110,156,218,101, 37,150,130, 33, 64,164,181, 34, 78,183, +144, 1,139,140,249,137,159,207,157, 59, 27,140,216,209,167,110,183,217,150, 18, 85,254,210, 98,230, 53,128,186,254,179, 97,210, +100,245,159, 59,119,118, 16, 33,164,187, 91,200,128,226,231,246, 34, 44, 55,239,249,197, 22,124,212,213, 23,102,107,201,250, 97, + 44, 91, 18,107,199,149,174,106,142,202,237,202,207, 56, 9, 32, 58,112, 50, 2, 25, 57,133, 48,152,172, 48, 91,108, 48,219, 88, +208, 52, 3, 23, 23, 23, 4,248,135,193,217,201, 17,185,121,249,184, 29,113, 13, 55,226,238, 37, 18, 96, 81, 94, 13,245, 30,123, +234,136, 18, 40, 2, 60, 61,220,168,156, 98, 51,164, 18, 6, 55, 46, 93,182, 2,216, 94, 38,174,170, 51,118, 0,128, 90, 95,180, +122,214,194,117, 35, 54,172,250,206,171, 73, 93, 71,164,229, 25,145,174, 50,160,216,104, 3, 64, 96, 99, 9,204, 70, 53, 98,111, +159,206,182, 65,191, 26,255,112, 84,108,193, 18, 10, 77,183, 31,196, 73,102,205,255, 1,143, 18, 18,177,101,227,122,157,169,122, +226,234, 21,108,255,204,255,183,127, 71, 38,202,115, 11,114,132,224,248,141,236,103,219,126,148,185, 10,239, 38, 20, 85, 69, 39, +252, 97, 74,179,153,101, 66,232,199, 35, 25, 55,254, 31,123,247, 29, 30, 69,185,254, 13,252,187,187,179,125,211,235,166, 27, 82, +128, 64, 40,161,183,208,133, 32, 45, 8, 10,210,132, 35,130,192, 81,218, 15, 57, 82,130, 98, 59,162, 20, 11,138,116,233, 77,138, + 84, 67, 12, 72, 21, 66, 66, 32,164, 39,164,215,205,166,109,159,221,121,255,128,228, 32, 39,101,131,250,158,115,224,254, 92, 87, + 46, 72, 50,251,205,204,236, 51,179,247, 60, 83, 30,137,164,204,146,147,147, 83,177,123,247,238,250,162, 71, 32, 16,160,238,122, + 41,131,193,208,236, 93, 69,142,118,226,246, 83, 34, 94,120,181,177,226, 74, 32, 16,192, 98,177,212,247, 94,181,244,212,163,220, +181,245,208,110, 3,198,238, 27, 52,230,111,252,232, 31,191,183,220,252,229,248,248,218,210,148,163, 45, 93,151,106,181,250, 46, +128,212,181,107,215,118,222,178,101, 75,171,197,139, 23,103,124,255,241,236,141, 15,143,224, 30, 30,203,196,197,197,113,115,230, +204,209,235,116,186,204,138,138,138, 91,176, 98,144,107, 77,113,242,218,237,223,252,179, 77,110,126,225,244,192,246, 61,224,226, +223, 29,202,192, 30, 80,213, 24,113, 61, 45, 31, 25,247,162,145,116,229,208,126,109,169,251, 71, 64,138,213,243,219,169, 83, 39, + 95, 62,159, 63,138,227,184,214, 10,133,194,159,227, 56, 49,195, 48, 19,120, 60, 94, 42,203,178,247, 66, 66, 66,162,147,146,146, +172, 30, 51,236, 65,236, 14,189, 95,255,233, 27, 30,104, 20, 3, 50,138, 52, 97, 15, 52,138, 56,141,196,126, 97,233,133, 13,250, + 29, 2,175,117, 48,149,223, 61,180,179,242,200,158,205,159, 11, 38,207, 90,100, 78, 84,217,189,205,216,200, 90,212, 91,198,231, +241, 10, 23, 47, 94,242,175,199, 52,240, 30,158, 24,124,244,200,134, 2,107, 50, 30, 61,211,104,105,194, 61,225, 87,137,239,204, +254,160, 67,183, 62, 83,250, 15,127,149,111, 35, 82,224,252,209,111,185,204,132,152,131, 12,103,126, 79, 91,154,145,249, 71,183, + 47,131,193,240,187,194,202,154,222, 43, 0, 40,117,174, 28,240,211,185, 95,166,159, 60, 19,251,113,196,208,190,206, 95,175,120, + 5,255,252,238, 24,108,228, 18,112, 22, 51, 94, 25,232, 51,126,229,223,218,142,242,113,151,122, 29,142,201,187, 56,111, 93,226, + 82,141,198,152,130,230,199,189,227, 0, 92, 3, 16, 4, 96,212,163,233, 21, 0,106, 1,212, 60,250,253,143,143,190,183,154,145, +181, 32,171, 88,135, 99, 71, 14, 33,254,122, 52,146,146,146,171,147,238, 37,125,201, 99,184,117,181,197,169, 42, 32,181,197,235, +206,220,224, 29,131,104,248,206,194, 38,212, 10,100, 31,197,157,252,108, 64,240,160,191,247,114, 14,236, 3, 71,191,135, 53,101, +101, 94, 34,114,127, 59,116,172,186, 64, 52, 1,184,107,170,125,202,247,216,211,167, 85,176, 69, 32,198,149, 95, 78,129,179, 88, + 54, 1, 0,103,177,108,186,253,235,169,217, 61, 34,102,194,201,205,175,147, 58, 39,174,201, 71,249, 52, 70,198,176,149, 63,237, +248,232, 96, 86, 86, 22,238,223,191,143,180,180, 52,168, 84, 42,236,217,115,169, 69,207,106, 42,205,184,122,158, 39, 96,134, 77, +122,253,157, 19,145, 47, 71, 74,125,253, 3,249,109,188,237,224,108,203, 32, 57, 61, 31,233,137,169,150,180,132,139, 58, 78, 91, + 50,182, 52,253, 74,163,189, 35, 46, 33,227,221,249,124,211,187,209,199, 31,142, 45, 56,100,204,140, 54,255, 55,111,113, 79, 39, +103,199, 6,247,227,170,242, 10,113, 84,212,202, 54,117,211, 55, 55, 22, 33, 95, 32,168,158, 53,123,190,130,207,227,215,159, 6, +228,234, 86, 91,221, 63, 28, 7,240, 0,145,144,105,246, 45,155, 30,217, 23,172,197,130, 26,173, 17, 53, 26, 35,212, 53, 58, 20, +149,169,113,247, 94, 58,110, 92, 58,141,172,244,180,106,150,101, 99,192,225, 72,169,115,229,254, 6, 30,172,219,120, 15, 43, 4, +190, 78,142,182,200,170,208, 65, 38, 98, 80,144,147,198, 26, 89,221, 83, 63,100,189, 60,254, 68,161,160,253,232, 23, 95,127,235, + 31,103,194,195,251,217,117, 12,235,170,112,177,179,133,136,225, 33, 61,167, 24,119,226,126,171,125,144,114,187,202,108,210, 14, + 47,191,123,226, 15,143,210,242, 63, 91, 96, 25,205,236,144, 69,255,248,228,156,217,108,150, 49, 2,129,214,196, 89,134,255,145, +226,234,175,194,113,150,188,183,222, 94,242,187, 3, 2,147,217, 34,251,219, 91,139,181,143, 31, 32,240, 76,102,121, 93,207, 21, +199,113, 77,245,106, 8, 74,213,250,234,101,223,196,239,252,116,231,189, 67,120,248, 4,215,188, 63, 58,159, 21, 85,134,120,231, +161, 7,198, 84,107, 88, 30,128,164, 6, 50,107, 7, 13, 26, 84, 95,108, 61, 58, 93,103,245,254, 82, 44,149,207, 30, 56,106, 6, + 63,250,216, 22,203,111, 49,199, 38, 60, 77,113,245,248,219,175,211,233,174,235,116,186,196,247,222,123,175,155,187,187,187,251, +202,149, 43,165, 85, 85, 85,194,175,191,254, 90, 87, 86, 86, 86, 84, 85, 85,117, 21, 45,187,174,197, 82,145,119,231,245,159, 14, +155,190,229, 29,218,250,162,163,155,215, 48, 7, 23,159,214, 21,165,121,233, 85,229,121,103,120, 22,156,175, 41, 77,185,218,210, + 25,141,143,143,207, 9, 13, 13,253, 81, 32, 16,120,155,205,102, 23, 30,143,103,195,113, 92, 5,203,178, 21, 22,139,165,176, 37, +197,213,227, 69,150, 79,219,190,123,203,181, 22,177,145, 39,221,251, 32,118,135, 30, 0, 74,206, 47,209, 0, 56,142, 1,255, 23, +121,236, 74,214,151,119, 43,236,230,151,198,254,243, 68, 75,243, 11,110, 31, 8,250,179,218,191,174,240, 94, 30,128,233,119,110, +226,243,196,184,171,171,120, 28,132,102,176,107,180, 37,105, 55,255,140,124,161, 80,168,235,218,181,107,131,119, 11, 74, 36,146, +166,159, 91, 22, 27,203,150, 0, 91,208,191,255,142, 51,209,151,166,159, 62,255,235,199, 61,123,245,117,150, 74, 60,225,231,104, +196,142, 37, 93,254, 30, 29, 87,122, 99,244,146,139,223,100, 20,232, 18,208,244,245, 87, 13, 73, 3, 80,249,168, 39,107, 51,128, + 89,143,182,173,196, 22, 23, 2, 22,188,214,171, 87,247, 61, 60, 30,143,225, 88,203, 63,175, 10, 5,123,117,133, 73,121,248,131, +195,135,116,244,183,195,172,217,179,131, 3, 2,255,117, 23, 97,251, 23,108, 49,121,250, 27,193,126,173,130,235,127,214,198,167, +153, 3,170,194, 56,109,141, 91,232,208,228,115,107, 87, 56,167, 95,126, 75,230,228,109, 83, 91,150,173,170,200,190,185, 86, 83, +226,190,182,129, 17, 26, 90, 36, 43,237,238,186,173,159, 47, 93, 92,152,159,190, 69, 83,154,250,240,172, 67,105,106, 98,210, 45, +172, 40, 43,202, 91, 92, 94,146,177,246,105,215, 69,109,109,109,193,238,221,187, 29,250,244,233,195,119,119,119, 71,105,105, 41, + 98, 98, 98, 44, 22,139, 37,191,165, 89, 37,169,151, 98, 16, 16,224,180,119, 71,229, 63, 25,153,237, 8,214, 12, 79,142,227,192, +240,121,133, 70,125,229,153, 82, 7,237, 18,220,185,214,100, 59,226, 44,102, 30,199,231,248,117, 99, 11, 90, 44, 22,222,103, 95, +237,202, 22, 8,197, 13,158, 82, 53,155, 12,114,139,197, 98,245, 88,132,197,130, 7,206,161,166,182,205,223,197,199, 1,137,188, +251,205, 28,156,114,103,123, 71, 76, 29,198,178,102,211,163,237,163,238,171,132,227,120, 23,192, 51,159, 43,115,170,190,218,146, +162,234,119, 59,122,163,209, 1,124, 17,108,229, 38,240,193, 67, 85,101,165,196,213, 44, 78, 42,251, 3,109,169,228,238,241,187, + 37,253,251,251, 25,126,190, 48, 45,246,210,229, 9,156,197,226,111,230, 0,112,188, 44,131, 81,119,176,196,174,108,231,211,206, +239,255, 26,222, 95,156,111,213,233,146,255,194, 76, 17, 0, 23, 60,124, 36,126,241,159, 60,159,141,142, 45,248, 71,150,221, 70, +217,182,175, 68, 42, 95,162,209, 84,111,209,150,164,158,248,147,215,167,189, 68, 34, 9,179,177,177, 17,150,149,149, 93,127,244, +161,246, 44,190,239,245,250,190,190,205,101,208,176,222,239,156,255,233,198,134, 71,167, 15,235,121,141,255, 66, 58,121, 68,248, +194, 93, 71, 78,174,107,224, 46,194,255,249,101,255,203, 50,251,247,103,220, 42,236,166,155,205,150, 53,131,130,171, 53, 69,153, +201,115, 46,221, 41,189, 14,160,250, 15,206,231,164,199,122,176,246,254,183, 44,187,107,251, 49,239,131,135, 16,171, 19, 56, 36, +149,222, 61,182,178,217,249, 12, 9, 17,201, 75,225,168, 41,115, 41,127,138,194,234, 63,209,150, 4, 29, 58,116,232, 39, 18,137, +124,205,102,179,220, 96, 48,104,180, 90,109, 86,118,118,246, 21, 52, 62, 32,249, 95, 58,159,110,161, 99,214, 9,133,194,183, 1, +192,100, 50,109, 40, 73, 60,182,160,169, 23, 54, 49,253, 95,191, 62,199,143, 23,224,208, 33,243, 95,241, 30,121,118,126, 89,109, + 50,177,245, 99, 15,137,132, 76,101,254,237,195, 14,255,193,182, 68, 90,248,166, 82, 38,101, 82, 38,101, 62,137, 79,235,147, 50, +255,147,153, 30, 33, 35,125, 60, 66, 70, 90,253,176,228, 70,166,167,245, 73, 26,197,208, 42, 32,132,252, 7, 88,104, 21,144,255, +164,194,164,147,185,127,229,244,132,240,154,168, 66, 91,210,245,247, 52,149,108, 34,101, 82, 38,101, 82, 38,101, 82, 38,101, 62, +119,153,205,101,211,169,199,191,168,240,162, 76,202,164, 76,202,164, 76,202,164,204,231, 47,243,153,194,167, 85, 64, 8, 33,132, + 16, 66, 5, 22, 33,132, 16, 66, 8, 21, 88,132, 16, 66, 8, 33, 84, 96, 17, 66, 8, 33,132, 16, 42,176, 8, 33,132, 16, 66, 8, + 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, + 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,127, 29, 26,105,156, 50, 41,147, 50, 41,147, 50, 41,147, 50,159, 59,244, + 36,119, 66, 8, 33,132, 16, 42,176, 8, 33,132, 16, 66,168,192, 34,132, 16, 66, 8,161, 2,139, 16, 66, 8, 33,132, 80,129, 69, + 8, 33,132, 16,242, 95,131,135,198,239, 4, 72,108, 65,206,211,220, 77,144, 72,153,148, 73,153,148, 73,153,148, 73,153,207, 93, +102,115,217,137, 32,127, 73,225, 69,153,148, 73,153,148, 73,153,148, 73,153,207, 95,230, 51,133, 78, 17, 18, 66, 8, 33,132, 80, +129, 69, 8, 33,132, 16, 66, 5, 22, 33,132, 16, 66, 8, 21, 88,132, 16, 66, 8, 33,132, 10, 44, 66, 8, 33,132, 16, 66, 8, 33, +132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, + 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66,200, 95,136, 70, 26,167, 76,202,164, 76,202,164, 76,202,164,204,231, 14, 61,201,157, + 16, 66, 8, 33,132, 10, 44, 66, 8, 33,132, 16, 42,176, 8, 33,132, 16, 66,168,192, 34,132, 16, 66, 8, 33, 84, 96, 17, 66, 8, + 33,132,252,215,224,161,241, 59, 1, 18, 91,144,243, 52,119, 19, 36, 82, 38,101, 82, 38,101, 82, 38,101, 82,230,115,151,217, 92, +118, 34,200, 95, 82,120, 81, 38,101, 82, 38,101, 82, 38,101, 82,230,243,151,249, 76,161, 83,132,132, 16, 66, 8, 33, 84, 96, 17, + 66, 8, 33,132, 80,129, 69, 8, 33,132, 16, 66, 5, 22, 33,132, 16, 66, 8,161, 2,139, 16, 66, 8, 33,132, 16, 66, 8, 33,132, + 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, + 8, 33,132, 16, 66, 8, 33,132, 16,242, 23,162,145,198, 41,147, 50, 41,147, 50, 41,147, 50, 41,243,185, 67, 79,114, 39,132, 16, + 66, 8,161, 2,139, 16, 66, 8, 33,132, 10, 44, 66, 8, 33,132, 16, 42,176, 8, 33,132, 16, 66, 8, 21, 88,132, 16, 66, 8, 33, +255, 53,120,104,252, 78,128,196, 22,228, 60,205,221, 4,137,148, 73,153,148, 73,153,148, 73,153,148,249,220,101, 54,151,157, 8, +242,151, 20, 94,148, 73,153,148, 73,153,148, 73,153,148,249,252,101, 62, 83,232, 20, 33, 33,132, 16, 66, 8, 21, 88,132,128, 85, + 79,218, 0, 0, 32, 0, 73, 68, 65, 84, 16, 66, 8, 33, 84, 96, 17, 66, 8, 33,132, 80,129, 69, 8, 33,132, 16, 66,168,192, 34, +132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, + 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132, 16, 66, 8, 33,132,252,133,104,164,113,202,164, 76,202,164, 76,202,164, + 76,202,124,238,208,147,220, 9, 33,132, 16, 66,168,192, 34,132, 16, 66, 8,161, 2,139, 16, 66, 8, 33,132, 10, 44, 66, 8, 33, +132, 16, 66, 5, 22, 33,132, 16, 66,200,127, 13, 30, 26,191, 19, 32,177, 5, 57, 79,115, 55, 65, 34,101, 82, 38,101, 82, 38,101, + 82, 38,101, 62,119,153,205,101, 39,130,252, 37,133, 23,101, 82, 38,101, 82, 38,101, 82, 38,101, 62,127,153,207, 20, 58, 69, 72, + 8, 33,132, 16,242, 39, 99, 26,252, 97,247, 53,197, 44,203,186, 1, 0,195, 48, 37,166, 27,203,149, 77,133,248,120,120, 12, 49, + 3,223, 3,128, 0,120, 35,175,176,240,124, 3,153,231, 89,150,117,124,148, 89, 97,186,177,252,197,166, 50,133,221,215,156,123, +124,122,246,198,242,161, 79, 78,195, 1,124, 97,247, 53,133, 79,204,171,135,181, 11,207, 3, 44,255, 63,230,243,127, 37,243,121, + 38,236,177,166,216,100,122,216,142,132, 66,166,196,120,189,233,118, 36,234,177,166,240,241,233, 77,215,151,187, 63, 57,141,184, +215, 71, 57, 38, 19,235, 1, 0, 18,177,184, 52,200,207,125,125, 83,153, 25,185, 37,239,104,117,122,215, 71,153,133,134,171,255, +240,253, 95,221, 54,173,229,238,238,222,149,207,231, 47,231,241,120,118,143,253, 56,161,160,160,224, 29,106,149,132,144,103,174, +192, 98, 89,214,237,214,209, 85,168,213, 3,131,167,174,113,107, 53,118,243,158, 39,167, 49,233, 42,196,154,212, 99,237, 4, 38, +181,163,131,140,115, 76, 77, 77,229, 3,128,167,167,231,247, 0,124, 27,200,116,188,117,116, 21, 52, 6, 32,124,226,106,199, 78, +126,126,118, 85, 60,222, 34,153, 76, 54, 72,167,211,181, 7, 0,169, 84,122, 87,171,213, 94,176,227,184,207,159,156,190,177, 5, +120,124, 94, 7, 77, 89,227,214, 58,242,251,191,155,205,102,177, 62,227, 64,127, 75,245, 3, 70, 96, 54,124, 53,188,176,240,244, +119,128,217,154, 21,242,248,223,237,255,234, 63,156,125, 60, 60,134,200,228,242,174,114, 27,155,126,102,179, 57,196, 98,177,192, + 98,177, 36,105,107,107, 47,177, 38,211, 77,179, 73,227,124,235,199,143, 44, 77,205,231,147,203,210, 5, 96, 74,148,202, 9, 50, + 27,155, 1, 2,129,160, 15, 0,152,205,230,203,218,154,154, 95,220,138,138, 14, 90,179,236,214,174,159,167,157,254,121, 99, 50, +177,110,153,103, 87, 65,111, 2,194, 94,254,216,173,227,107, 59,247, 2,128,161, 36,222,189, 38,245,120, 15, 0, 80, 4,142,188, + 46, 81,134, 21, 3, 0,243,160,208, 45,229,228,123,208,155,128,144,145,171,221, 26,202, 52, 24,140, 62,105,167, 86, 64,111, 2, +254, 22,117,200, 99,201,236,241,114, 0,136,249,241,187,192,115,135, 54,188, 4, 0, 47,142,127,251,167,129, 99,223, 76, 7,128, +207,190, 61,228,177,251,195,241,208,155,128,208, 49, 31,248, 60,237,182,201,234, 43, 69,234,148,147, 65,166,170, 2, 71, 31, 5, +163,108,233,182,105, 15,216,215, 0,243,120, 2, 65,223,160,160,160, 46, 0,144,158,158,126,203,194,178,191,218, 0, 95,253,153, +109, 73, 32, 16,252, 61, 63, 63,127,212,227, 63,243,242,242,162, 6, 73, 8,121, 54, 11, 44, 0,168,213, 3,177,105, 64,255,158, + 29, 49,107,242, 75, 54,143,255,238,199,237,159,248,228,223, 61, 23,242,217,190,245,130,214,173, 91, 35, 53, 53,213,170, 63,166, + 49, 0,191,164, 2, 18, 93,150,173, 70, 40,204,136, 90,190,220,174,111,223,190,140,167,167, 39, 0,160,164,164,164,231,165, 75, +151,186,174, 94,189,122,142, 68,151, 85,161, 49,160,250, 23, 43,162,235,230,181,125,235, 23,240,222,252,137,246, 0,176,126,209, +193,174,167,174,196, 59,101,101,101, 13,254,232,163,143,202,189,174, 94,221,100, 99,177,108, 75, 46, 46,206,181,102, 62,247,159, +142,147, 5, 25,207,183, 26, 63, 99,198, 17, 95, 95, 95,185,183,183, 55, 79, 42,149, 66, 32, 16,160,166,166,198, 51, 57, 57,121, +200,237,219,183,181, 23,175, 30, 19,198,199,141,203, 44, 16,134,105,173, 89,118, 17, 91, 38,173, 13, 14,190, 55, 62, 34,194,123, +228,200,145, 82,127,127,127, 0, 64, 86, 86, 86,240, 79, 63,253, 52,233,212,169, 83, 43, 69,108, 25,171, 49, 64,215,220,178,215, +101, 2,128, 16,232,237,228,230, 54, 89, 40, 20,134,178, 44,235,245,168,119, 33,223,100, 50, 37,170, 74, 74,118, 63, 57, 61,249, +119,122, 19,144, 84, 8, 12,233, 23,134, 41,227,134, 40, 0, 96,233,171, 31,246,124,144,149, 38, 50, 24, 12,104,221, 38,164,207, + 7, 31,127,113, 22,124, 62,126, 56,242,115,253,244, 77, 22,182, 28, 31,169, 37, 64,194,253, 76,172,250,112, 35, 87,148,112,168, + 27, 91,113,111,104,121, 89, 25, 3, 0,206, 46, 46, 19,246,239,221,125, 94,217,113,252,111,233,197,181,245,211, 91,211,222, 27, +218, 54, 79,237,219,232,153,159,120,161,221, 55,103,183, 8,125,125,125,145,152,152,216,162,109, 19,149,201,182,114, 15,143,164, +168, 37, 75,148,225,225,225, 80, 40, 20, 16, 10,133, 48,153, 76, 67, 46, 95,190, 60,100,213,170, 85,115,170, 42,147,107,173,221, + 54,173,232, 59,252,220,189,117,255,129,145,163, 71,120, 12,234,223, 19,227,134,247,161,134, 72, 8,121,118, 11, 44,134, 97, 74, +134, 78,251,200,173, 95,143, 80,252, 22,159, 82,153,149, 83, 84, 83,247, 59,245,253,163,193,179, 35, 59,133,110, 62,117, 18, 70, +163, 17, 87,174, 92,193,205,155, 55,113,229,202, 21,238,243,207, 63,215, 10,128, 55, 26,201,172, 8,159,184,218, 81,162,207,181, +233,226,156,235,191,127,239, 47, 2,173, 86,139,216,216, 88, 84, 84, 84, 64, 34,145,192,203,203, 11,253,250,245, 99, 98, 98, 98, +156, 94,157, 52,217,254,197,177, 51, 51,245, 18,159, 26,134, 97, 42,216,198, 22,128, 97, 74, 6, 79, 93,227,214, 46,248, 5,164, +103, 23, 84,190,247,241,150, 26,139,153, 99,116, 15,242,140, 23, 47, 94, 68,231,206,157,177,127,255,126,231,138,138,138, 21, 59, +118,236, 88,238,254,229,246, 13,197,121,201,139,208,120, 94, 69,248,196,213,142,173,205,209,190, 7,247,108, 19,197,199,199,139, + 54,109,218, 4,149, 74, 5,177, 88, 12,123,123,123, 40,149, 74,180,110,221,154, 55,103,206, 28,249,192,129,169,120,111,209, 12, +223, 34,199,200,228,198,230,179, 46, 83,100, 40,148, 7, 11,110, 6,126,191,115, 39,191,123,247,238,188,199,167,241,245,245,197, +128, 1, 3,164,145,145,145,129,115,230,206,183, 12,137,124, 51,221, 40,246,208, 52,151,137,218, 92,153,179,230,170,231,144,137, + 19, 79, 68, 69, 69, 57,120,120,120, 64, 46,151, 3, 0, 42, 43, 43,189,179,179,179,123,174, 90,181,106,252,245,132,253, 76,248, +200,220, 2, 40,124,180, 77,173,207,231,149, 80,200,148,212,245, 68,217, 42,100, 21,185,121,197,181, 15,123,161, 12, 48, 24, 12, +208,235,245,120,107,206,155,130, 55, 94,238, 30,228,215,239,239,183,179,242,139, 85, 33, 63, 95,115,170,123,173,169,225,204,178, +118,163, 63,112, 4, 0,126, 85,102,109, 69,246,185,191,189,187, 96,129,151, 82, 57, 27, 34,145, 8, 0,176,125,219, 54,166,188, +188, 60,226,131, 15, 62, 8,229, 20,131,171,218,141,254, 64,241,232,181, 21,166, 22,110,155, 21, 41, 39, 91,125, 56,111, 88,167, +239, 63, 62, 9,179,217,140,107,215,174,225,226,197,139,248,226,139, 47,184,211,167, 79, 87,218, 41, 20, 77,110,155,168, 76,182, +237,235, 81, 20,240,233,167,135,121, 98,177, 24,199,142, 29,195,253,251,247,193,231,243,209,177, 99, 71, 76,153, 50, 5, 67,134, + 12, 81,206,154,245, 38, 23, 62,252,213, 12,216,183,169,254, 99,109, 41,138,207, 58,222,249,251,188, 89,175,121,188, 60,102, 24, + 54,126,249, 13, 21, 88,132,144,103, 27, 7,240,252,199,110,222,123,240, 22,119,210,127,236,230,189, 28,192,227, 0,158, 4,240, + 29, 52,104,144,161,166,166,134,139,143,143,231, 38, 76,152, 80,177,116,201,146,173, 59,183,111,143,210,107, 52,111,117,233,212, +105, 10,247,240,209, 15, 13,103, 58, 56,216, 5, 4, 4,148,230,230,230,114,167, 79,159,230, 86,175, 94,205,237,217,179,135, 59, +115,230, 12, 23, 29, 29,205,157, 57,115,134, 59,112,224, 0, 23, 31, 31,207,165,165,165,113,129,129,129,165,254, 14, 14,118, 77, +100,242, 57,128, 31, 20,249,221,162, 67, 55,205, 81,193,145,223,191,195, 1,252, 64,165,178,205,208,161, 67,205,135, 15, 31,230, +118,239,222,205,237,220,185,147, 75, 72, 72,224,202,202,202, 56, 47,191,128,210,186,215, 53, 54,159, 28,192, 11, 11, 11, 43, 85, +171,213,156,175,175, 47, 39, 18,137, 56, 55, 55, 55,174,117,235,214, 92,207,158, 61,185,225,195,135,115,147, 38, 77,226, 86,172, + 88,193,169,213,106,206,207,207,175,184,238,117,141,101,246,244,242,146, 6, 6, 6,230,220,185,115,135,107,140, 78,167,227,202, +202,202,184, 11, 23, 46,112,129,129,129, 57, 61,189,188,164, 77,101, 10,129,176,208,208,208,210,178,178, 50,206, 98,177,112, 26, +141,134, 43, 47, 47,231,202,203,203,185,138,138, 10,206, 96, 48,112, 22,139,133,179, 88, 44, 92,114,114, 50, 23, 16, 16, 80, 34, + 4,194, 26,203,124,206,219, 60,191,161, 47, 47,119,247,225, 74,165, 82,123,248,240, 97, 46, 63, 63,159,219,177, 99, 7,199, 7, + 62,124,114,186,134, 50,199,135,140, 23,133,133,205,146, 9, 4,178,151,122,247,238,109,190,114,229, 10,119,235,214, 45,238,221, +119,223,229, 70,141, 26,197,141, 30, 61,154,139,138,138,226,114,114,114,184,220,220, 92,238,197, 23, 95, 52, 11, 4,178,151,194, +194,102,201,198,135,140, 23,181,100,219,148, 2, 62, 35, 71,142,212, 26,141, 70, 46, 35, 35,131,107,223,190,125,158, 0,152, 44, + 2, 66, 2, 0,113,115,237,211, 14,112,240,240,240, 40,188,122,245, 42,119,248,240, 97,206,207,207,175, 84, 0,188, 46, 1,252, + 37,128,191, 0,120,189, 85,171, 86,165, 87,175, 94,229,202,202,202, 56, 95, 95,223, 66, 59,192,225,233,219, 82, 20,223,173,253, +216,109, 31,124,121,152, 75,206,171,229, 62,248,242, 48,231,222,122, 64, 14,199,113,156,135,135,199,121,106,145,132,144,103,178, + 7,171, 49,124,153,108,213,199, 31,127, 44,210,106,181,120,255,253,247, 75,223,154, 61,123,141,139,155,155, 81, 40, 20, 66, 40, +145, 52, 31, 96,103,247,206,178,101,203, 28, 12, 6, 3,226,226,226,208,165, 75, 23, 72,165, 82, 8,133, 66,136, 68, 34, 48, 12, + 3,165, 82,137,178,178, 50,184,187,187, 99,206,156, 57,246, 95,109,220,248, 14,212,234,247,155,138,181,152, 57, 6, 0,204,102, +179,216,199,211,115, 86,251, 14, 29, 62,159, 51,103, 14, 95,161, 80, 64,175,215, 67,175,215, 35, 57, 57, 25,206,206,206,144,203, +100, 86, 45, 51,159,207,231,219,216,216, 32, 54, 54, 22,219,182,109, 67,102,102, 38, 10, 10, 10, 96,103,103,135,206,157, 59, 35, + 36, 36, 4,125,250,244, 65, 90, 90, 26,120, 60, 94,179, 31, 50,197, 2,193,188, 41, 19, 39,186,133,134, 54,124,103,171, 94,175, +135, 90,173,134, 90,173,134,187,187, 59, 34, 34, 34,220, 78, 28, 59, 54, 15,192,218,134,166,151, 3, 74,255,224,224, 19, 55,110, +220,112,225,243,249,136,141,141,133, 70,163,129, 78,167, 3,203,178,224,241,120,144, 74,165,232,213,171, 23,156,157,157, 17, 28, + 28,140,163, 71,143,186, 14, 29, 58,244, 39,121,113,113, 24,128, 66,106,254,205,203, 43, 46, 62,215, 5,112,126,237,181,215, 78, + 39, 36, 36,132, 79,158, 60, 25,197,197,197,255, 16,188,251,110,133, 25, 88,215,212,107, 15, 38, 29, 98,189, 1,133,147,171,235, +119,159,124,242, 9,191,168,168, 8, 11, 23, 46, 44, 47,200,205, 93, 38, 5,174, 2,192, 79,199,143,247,218,181,107,215,199,187, +119,239,118,222,185,115, 39,191, 75,151, 46,155, 75,226, 54,183,187, 5, 84,182,164,114,209, 1,127, 95,191,126,189, 84,167,211, + 97,232,208,161, 25,154,172,172,142, 44,160,181,246,245, 53,192,188,168, 37, 75,148, 18,137, 4,139, 23, 47, 46, 43,123,240,160, + 61, 11,148, 62, 54, 73,182, 34, 51,243,244,212,169, 83,239, 38, 36, 36,184,172, 91,183, 78,249,114,100,228, 60, 0,107,172,253, + 27,255,186,160,157,111,103,182,137, 13, 30, 59, 60,194,189, 77, 43, 55, 28, 62,118, 22, 95,109,222,179, 29,234,244,239,188,188, +188,230,241,249,252,207,168,229, 17, 66,158,171, 2,203,209,209,177,107, 96, 96, 32,162,163,163,209,182,109,219,163,110,117,197, +149, 80, 8,179,185,249,107,200,101, 10,197,224,240,240,112,230,202,149, 43,240,247,247,135, 76, 38,171, 47,172,234,138, 44,161, + 80, 8,165, 82,137,202,202, 74,244,237,219, 87,184,109,219,182,193, 0,222,111, 46,187, 48, 59,217, 6, 25,219, 94, 91,253,193, + 7, 1, 93,187,118,133,209,104,124, 88,136,200,229,208,235,245, 16, 10,133, 48, 26,141,208, 25,184, 42,107,150,213,108, 54,155, + 5, 2, 1,124,125,125,177,114,229, 74,232,116,186,250,211, 58, 85, 85, 85, 80,171,213,136,139,139, 67, 86, 86, 22, 44, 22, 11, +215, 92,158,220,198, 38, 98,244,232,209,226,134,126,103, 48, 24,234,139,171,202,202, 74,232,116, 58,116,234,212, 73,124,225,194, +133,136,198, 10, 44,158, 84, 58,126,231,206,157,110, 98,177, 24, 58,157, 14,169,169,169, 72, 79, 79, 71,114,114,178, 94,165, 82, +177, 54, 54, 54, 60, 15, 15, 15, 65,101,101,165,120,234,212,169,188,234,234,106, 0, 64,100,100,164,243,246,173, 91, 95,129,193, +176,142,154,191,117,110, 1,250, 64,131, 97, 84,247,238,221, 47,252,246,219,111, 93,222,126,251,109, 36, 36, 36,252, 83,190,127, +255, 69, 13,112,187,201,118, 9,204,249,108,233, 82, 15,133, 66,129, 41, 83,166,168, 52,185,185, 29, 89,160,232,177, 73, 82,156, +179,178,206, 76,155, 54, 45, 49, 33, 33,193,113,221,186,117,202, 87,198,143,159, 3,224,227,150,204,163,189,189,125,119,165, 82, +137, 51,103,206, 32, 39, 43,107,105, 75,138, 43, 0,224, 9, 4,125,251,247,239,143, 31,127,252, 17,121, 15, 30, 44,125,162,184, + 2, 0,212, 2,165, 76, 70,198,210,237,219,183,111,155, 49, 99, 6,248, 12,211, 23,172,245, 39, 8, 27,186,160,253,173,165,159, +225,232,153,107,219, 75,238,118,248, 27,240,163, 5,192, 13,106,113,132,144,103, 65,139,158,131,213,170, 85,171, 86, 18,137, 4, +217,217,217,232,209,163, 71,150, 80, 44,134, 68, 44,134, 68, 38,179,238, 40, 91,167,235,160, 84, 42, 81, 85, 85, 5, 23, 23, 23, +136, 68, 34,136, 68, 34,136,197, 98,136,197,226,250,239,109,109,109,193,231,243,225,229,229, 5,157, 78,215,161,185, 92,182, 50, +213,237,236,142,165,115, 79, 29,221, 21, 16, 25, 25, 9, 79, 79, 15,120,121,121, 66,161, 80,128, 97, 24,248,250,250, 34, 48, 48, + 16, 91,183,110, 5,207, 46,248,186, 53,243,250,120,209, 36, 16, 8, 96, 54,155, 81, 92, 92,140,228,228,100, 36, 36, 36,224,234, +213,171,136,139,139, 67, 77, 77,141, 85,203,174,209,104, 58, 55,212,209,245,100,113,165, 86,171, 81, 90, 90,138,244,244,116, 84, + 87, 87,135, 53, 90,236, 58, 59,143, 11, 13, 13, 21, 0,128, 84, 42, 69,171, 86,173,240,237,183,223,178,231,207,156,121, 69,246, +219,111, 14,230, 11, 23,236,247,254,240,195, 43, 51,103,206, 52, 95,191,126, 29, 85, 85, 85, 72, 73, 73,129,171,171, 43, 35,145, +201, 94,161,166,223, 50,233, 64,173,162,186,122,120,239,222,189, 51, 43, 43, 43,241,217,103,159,241, 25, 91,219,239,222, 4, 4, + 77,110, 96, 2, 65,191,129, 3, 7,226,216,177, 99,200,123,240,224,221,242,223, 23, 87, 0,128,114,160, 40, 43, 61,125,233,246, +237,219, 17, 17, 17, 1,134, 97,250,181,116,254,122,246,236, 25,202,113, 28,238,220,185, 3, 49,112,173,165,175, 15, 10, 10,234, + 98, 99, 99,131,251,247,239, 67, 8, 92,108,108, 58, 33,112, 49, 46, 46, 14, 50,153, 12,237,218,181,235,218,178,191, 34,252,220, +189,117,255,194,183,150,126,134, 35,103, 46, 3, 0,126, 60,113,186,248, 97,113, 21,101,161, 86, 70, 8,121,110, 11, 44, 0,224, + 56, 14, 2,129, 0, 34,134,129, 76, 34,129, 88, 34,129, 88, 40,180,254, 72,153,199,131, 68, 34,249,183,162,170,174,208,170,251, + 87,161, 80, 88,157,105, 42,252, 53,124,250,180,169, 98, 27, 27, 27,152,205, 44, 24,134,129, 92, 46,135, 82,233,142, 54,109,218, + 64,165, 82, 97,212,232,177,186, 7, 42,230,132,208,123,112,194,211,172, 40,150,101, 81, 91, 91,139,138,138, 10,168, 84, 42, 84, + 85, 85, 65,167,211,193,138,179,131,245,117, 90, 78, 78, 14,246,237,219,135,242,242,242, 70,139,171,140,140, 12,236,218,181, 11, + 89, 89, 89, 16, 8, 4, 86,191, 63,131, 7, 15,198,201,147, 39, 5, 3, 6, 15,222,242,192,207,175,240,129,159, 95,225,128,193, +131,183, 28, 63,126, 92,224,229,229,133,156,156, 28,196,197,197, 65,165, 82,193, 98,177,208, 53, 88, 79,161, 0,168,208,168, 84, + 51,254,241,143,127,112, 54, 54, 54, 88,187,118,109,231,173,192,164,166, 94, 19, 16, 24,216,197,198,198, 6, 73, 73, 73,144, 55, + 81,184,200,129,139,183,110,221,130, 76, 38, 67,155,144,144,174, 79,179, 93, 90, 44, 22,152,205,230, 6,159,239,102,205,118, 41, + 20, 10,193,231,255, 85,207, 30,142,226,179,142,157,254, 62,111,222,124,143,191,207,127, 11, 23, 98, 31,214,128,130,154,140, 84, + 42,174, 8, 33,207,162, 22,157, 34, 76, 79, 79,207,210,233,116, 33,254,254,254,184,123,247,174,127,251, 14, 29, 18,132, 66, 33, + 36, 66, 97,211,135,241,143, 72,165,210, 59,197,197,197,125,188,189,189, 97, 50,153,234, 79, 9,214,157, 38,172,251, 30, 0, 36, + 18, 9,146,146,146, 32,149, 74,239, 52,187, 16,230, 26,191, 86,173, 90,161,168,168, 24, 18,137, 4,142,142, 14,144,201,100,144, + 72,164,248,248,227,143, 45, 91, 54,111,254, 90,210,126,158,122,193,204,165,220,141, 53,223,255, 71, 86,180, 92, 46,191,227,239, +239,223, 75,161, 80,224,232,209,163,200,202,202,130, 90,173,174,191,110, 74,171,213, 66,175,215, 67, 42,149,162, 93,187,118,112, +114,114,194,221,187,119, 27, 93,246,138,242,242, 35,137,137,137,189,186,117,235, 86,191,234, 7, 12, 24,192, 27, 48, 96,128,203, + 99,189,102, 40, 47, 47, 71,124,124, 60, 98, 99, 99,193,178, 44,238,221,187,103,214,107,181,251,169,233, 63, 29, 29,112, 89,176, +125,251,182,217,179,103,207,236,211,167, 15, 56, 96, 4,128, 31, 26, 61,130,225,243,121, 12,195,128,199,227, 53, 89,248,240, 0, + 11,199,113,117,197, 78,139, 11,224,171, 87,175, 38,154,205,230, 62,173, 91,183,134, 30,232, 14,224,100, 75, 94,159,150,150,118, +203,100, 50, 13,233,212,169, 19,142, 28, 60, 24, 14, 32,187,193,131, 25, 32, 60, 44, 44, 12, 90,173, 22,247,238,221,187,105,109, +113,229,214,254,206,150,121,179, 94,123,253,229, 49,195,112,248,216, 89,252,120,226, 76,238, 55,159, 46,241,225, 56,139,145, 90, + 21, 33,228,185,239,193,170,172,172,252,237,254,253,251,232,217,179, 39,210, 50, 50, 34,245, 90,173,168,174, 23,139, 47,104,190, +196,210,214,214, 70,255,250,235,175,108,231,206,157, 81, 83, 83, 83, 95, 84, 61,222,123, 85, 87,112, 41, 20, 10,156, 62,125,218, +168,173,173,141,110, 46,215,204,154, 45,124, 62, 31, 60, 30, 15,122,189, 30,133,133, 69,208,233,244,248,254,251,239,177,117,243, +230, 73,121,133,133,239, 64,226,168,253, 43, 86,160,181,159,133, 90,173, 54, 58, 58, 58,218,228,239,239,143,233,211,167, 99,193, +130, 5, 88,176, 96, 1,222,124,243, 77,188,254,250,235,152, 60,121, 50,198,141, 27,135, 30, 61,122,192,213,213, 21,153,153,153, + 38,173, 86,219,232,178,115, 58,221,161,105,211,166,149,232,116, 58,152,205,102,232,245,122,104,181,218,250, 94,182,184,184, 56, + 28, 57,114, 4,155, 55,111,198, 79, 63,253,132,218,218, 90, 84, 85, 85,225,214,173, 91,106,129,201,116,128,154,254, 31,218,104, + 14,255,250,235,175,112,116,116,132,167,183,119,255, 38, 15, 74,210,210,110,155,205,102,116,236,216, 17,181, 64,163,211,214, 2, +253, 59,119,238, 12,157, 78,135,164,123,247,226, 90, 58, 79,213,213,213, 55, 50, 51, 51, 49, 96,192, 0,120,120,123,127,238, 14, +200, 90,242,122, 11,203,254,122,249,242,101, 76,157, 58, 21,126,173, 90,125,170, 0, 92,159,156, 70, 1,184,250, 7, 6,126,250, +250,235,175,227,220,185,115,176,176,236,175,141,229,185,187,187,119,245,240,240, 56,238,233,233, 25,235, 30,120, 62, 59,114,120, +207,215, 31,191,160,157, 83,167, 79,240,242,242,218,205,231,243, 23, 83,139, 34,132, 60,247, 5,150, 69,171, 93,189,108,217, 50, +131, 64, 32,192,220,185,115, 93,191,250,230,155,213, 7, 14, 28,232, 22,127,231,142,210,160,215, 55, 95, 97, 85, 85,173,255,224, +131, 15,212, 70,163, 17,109,219,182,133, 74,165,130,217,108,134, 64, 32, 0,195, 48, 16, 8, 4,224,243,249,144,203,229, 72, 76, + 76,196,254,253,251,171, 80, 85,181,190,217,249,178, 88,238, 28, 61,122, 20, 12,195,112, 82,169,180,190,232,217,184,113, 99,201, +204,194,194, 35, 0, 32, 16, 8, 12, 0,192, 23,240,172,186, 42,151,207,231, 55,123,225,186, 88, 44,174,187,184,191,249,139,220, + 89,118,253,183,223,126, 91,157,154,154, 10,141, 70, 83,127,106,176,166,166, 6,213,213,213,245,223,215, 21,137, 23, 47, 94,172, +150,179,108,163,203,174, 1,138,178, 82, 83, 71,117,235,214,173, 60, 59, 59, 27, 53, 53, 53, 72, 75, 75,195,213,171, 87,113,242, +228, 73,196,196,196, 32, 61, 61, 29, 6,131, 1, 14, 14, 14,168,170,170,194,241,227,199,171,244, 53, 53,195, 52, 13, 92, 7, 68, +254,197,199,195, 99,176,187,155, 91,174,171,139, 75,190,143,135,199,224, 6, 10,141,148,148,148, 20,152,205,102, 4, 4, 4, 56, + 53,117, 29,150,153,101,127,189,122,245, 42, 38, 79,158, 12,165,151,215,199,174, 13, 20, 46,174,128,171,135,183,247,199,211,167, + 79, 71,116,116, 52,204, 77, 20, 46,141,145, 2, 27,151, 44, 89,162, 21,137, 68,216,191,127,127,128, 93, 80, 80, 50, 3,188, 38, + 6,218, 6, 2,162,230, 94,111, 3,124,181, 98,197,138, 34, 0,216,189,123,183,139, 71, 96,224, 93, 6,152, 46, 5, 94,144, 2, + 47, 48,192,116,143,192,192,187,251,247,239,119, 97, 89, 22, 11, 22, 44, 40,178, 1,190,106, 44, 79, 32, 16,252,189,160,160, 96, + 84,126,126,126,120, 81,218, 21,159,111, 62, 93,130, 11,177,215,240,213,230, 61,219, 75,238,118,248, 91, 73, 73,254,141,130,130, +130, 41,249,249,249,137,212,226, 8, 33,207,162, 6,187, 95,152,238,107,138, 1,206,173,127,207,142,248, 45, 62,185,210,217,209, +254, 76,221,239,212,247,143, 6,191, 50,192,175,243,234,213,171,193,227,241,112,255,254,125, 36, 36, 60,188,172,233,179,207, 62, +211,240, 57, 46,242,177,241,206, 66, 1, 36, 62,202, 60,207,178,172,163, 68,159,107, 19,230,152,217,234,135,157,219, 5,182,182, +182,168,169,169,129, 64, 32,128, 84, 42,133, 66,161,128, 68, 34, 65, 66, 66, 2,166, 78,159, 97, 78,103, 59,253,235, 65,163,255, + 26,239,172, 62,179,238,249, 67,125,156,157,229, 57, 34,209, 34, 87,119,247, 37,243,231,207,151,133,135,135, 67, 44, 22,163,107, +143,126, 69,178,206, 75, 54,240, 5, 60,182,160,172,114,121,224, 11,158,246,247, 82,179, 1,240, 74, 76, 55,150,123, 60,118,202, +230,223,230,179,131, 52, 33,224,135,111,222,183,107,223,190, 61, 56,142, 67,101,101, 37,138,139,139, 81, 82, 82, 2,181, 90, 13, +173, 86, 11,139,197,130,159,127,254, 25, 63, 95,207,168, 42,182,125, 49,163,177,249,252,215,178,103,219,134,200, 82,252, 55,172, +251, 92,224,232,232,136,226,226, 98,148,149,149,213,159, 42, 52,155,205,168,174,174,198,177, 19, 63,153, 51,204, 29,178,244,146, + 23,170,155,203, 68,109,174,204,169,230,178, 87,215, 80,127,238,205, 55,223,180,181,179,179,131,197, 98,129, 74,165, 66, 86, 86, + 22, 82, 82, 82,112,233,210, 37, 77, 73,149,137,211,186, 12,205,171,127,208,104, 3,153,127,162,255,185,204,199,159,101,229,233, +225, 81,248,224,193, 3, 55,179,217, 12, 47, 47, 47, 86,173, 82,125, 34, 6,206,137,128, 2, 30,192, 85, 3, 43,214,109,216, 48, + 99,204,152, 49,232,222,189,123,110, 81,113,241, 11, 13,181, 37, 14,224,123, 2,142, 34, 63,191,164,107,215,174,185,166,164,164, + 96,218,180,105,165, 5,185,185,139,236,128, 88, 0,168, 2,250,123,250,248,124,190,119,239, 94,215,208,208, 80,116,236,216,177, + 84,159,149, 21, 82, 0, 84, 52,210, 62, 27,221, 54, 43, 82, 78,182,154, 27, 25,218,237,173,183,222, 2,203,178,136,141,141,197, +245,235,215,145,147,147,131,203,151, 47,171,237, 20,138, 87,155,218, 54, 81,153,108, 27, 17, 92, 27,176,123,247, 15, 60,145, 72, +132,237,219,183, 35, 46,238, 97,103, 90, 88, 88, 24, 94,127,253,117,176, 44,139,201,147,167,112, 63, 37,203,254,245,160,209, 6, +218,146,151,151, 87,168,197, 98, 89,203,227,241, 68,102,177, 91,183,162,204, 56,169, 71,235,190, 5, 69,169,131,125, 90,120,205, + 21,181, 79,202,164,204,231, 39,243,153,210,236, 88,132,107, 54,193,254,247,195,113,188, 81,120,108,251, 39,204,136,151, 70,133, + 44,127,111,153,160, 67,135, 14,176, 88, 44,232,222,189, 59,166, 77,155, 38, 15, 9, 9,105,110,188,179,154, 23,199,206,204,124, +241,197, 23, 29,230,206,157,107,223,191,127,127, 97,221, 80, 57,119,238,220,193,169, 83,167,140,251,246,237,171,202, 23,247, 83, + 95, 62,189,181,198,154,241,206, 46,151,151,107, 0,188,223,218,104,220,188,226,189,247,162,218,119,232, 48,243,157,119,222,225, +219, 40,228,194, 53,203,223,144, 2,192,135, 95,238,179, 31, 51,254, 53,172, 15, 2,250, 79,106,120,236,184,199,231, 51,175,176, +228,193,107, 51, 38, 4,205,156, 28,105, 25, 59,118,172,220,222,222, 30, 62, 62, 62,112,112,112, 64,102,102, 38,238,220,185,195, +157, 59,119,174, 38,254,126,142,112,215,129,115, 15,196, 54,110,214,140, 27, 88,253,226,152,105, 89,211,167, 79,119,140,140,140, +180,109,223,190,189, 80, 40, 20, 66, 34,145,160,172,172, 12,121,121,121,198,152,152,152,154,124, 81,175,138,203,103,118, 84, 91, + 57, 22,161, 54,124,226,234,180,232,179, 81,239,196,199,199, 79, 1,208,201,104, 52,122,155,205,102, 30,159,207, 47, 52,155,205, + 9,186,154,154,109,108, 88,212,122, 26,139,208, 58,102,179, 89,100, 54,155,161, 86,171,113,254,252,121, 38, 61, 61,125,121,124, +124,252,242,130,130, 2, 24,141, 70,140, 31, 63, 30, 97, 97, 97,248,229,151, 95, 80, 90, 92,124,162,169,172, 2,160,130,121,240, + 96,198,156, 57,115, 78,238,216,177,131,119,231,206, 29,215,109,219,182,253,112,235,214, 45, 0, 64,151, 46, 93, 48, 99,198, 12, + 48, 12,131,105,211,166,113, 57, 89, 89, 51, 88,160,162,137,246,217,212,182, 89,122,106,223,198,248,177,227,198,183, 91,181,226, + 61, 97,159, 62,125,224,234,234,138,126,253,250,193,104, 52, 58, 88,177,109, 86,135, 15,127, 53,163, 83,167, 78,138,117,235,214, + 41,103,204,152,129,121,243,230, 1, 0,180, 90, 45,206,157, 59,135, 5, 11, 22, 20,229, 48, 61,106,111,197,236,111,178,125, 62, +234,153, 26, 10, 0,158,158,136, 5, 16,206,175,205,206,160, 11,218, 9, 33,207,117,129, 5,252,107,188,179, 75,215, 19,241,248, +112, 28, 15, 57, 37,153,156, 34, 51,102, 44,248,164,157,192,164,118,148, 49, 6,199,132,248,120,126,102,102,102,147,127,172,110, +188, 51,189,196,167,198, 92, 88,222,109,227,250,245,239,108,217,178,101,112,221,163, 24,164, 82,233, 29,109,109,109, 52,170,170, +214,235,253,125, 46,180,116,236,188,148,242,242, 98, 0,179, 3, 45,150, 13,211,103,190,249, 25,207,198,135, 89,182,230,123,157, + 64, 32, 48,100,228, 23, 99,125, 16,160,176,226,121,168, 26, 3,112,167,220,141,189,203,245, 79, 94,251,201, 39, 11, 55,125,245, + 85, 15,153,141, 77,184,209,104, 12,177, 88, 44, 0,144,164,211,104, 46,178, 70,227,245,124,207, 89, 95,136,109,220, 56,107,199, + 13,212, 75,253,171, 21,218, 75,221, 14, 31, 60,248,246,233,211,167,255,109,217,109,129, 13,122, 59,255,104,107,150,253,241,105, + 76,192, 21,148,148, 92,105,170,171,146,198, 34,180, 14,159,227,222,112,116,116,252, 97,240,224,193,210, 33, 67,134, 96,196,136, + 17,232,221,187, 55, 44, 22, 11, 56,142, 67,117,117, 53, 14, 28, 56,128,127,254,243,159,169,238,192,234,230,242, 88,224, 12,115, +236,216,232, 46, 93,186,108, 91,183,110,157,243,236,217,179, 33,123,244,104, 19,173, 86,139,152,152, 24, 44, 88,176,160, 60, 59, + 35, 99, 6, 11,156,105, 46,175,233,109, 83,154,194, 58,140,201,122,117,222, 39, 65,166,170, 2, 71,103, 57,171,188,155,120,199, +234,109, 19,246,109,170, 43,227, 14,116,127, 57, 50,114, 30,159, 97,250,214, 61,138,225,222,189,123, 55,235, 6,123, 70,216,235, + 63,183,164, 45,113,220,195,103,207,113, 28, 71, 23,180, 19, 66,158,239, 2,139, 97,152,146,186, 94, 30,134, 97, 74, 50,127,156, +245, 90, 83, 33, 62, 30, 30, 67, 30, 29, 29,163,185,177, 8,235,254,159,169, 86, 87, 63,122, 66,123,131, 15, 17, 21, 62, 49,125, + 75,198, 59, 75, 47, 46, 78, 6,240, 18,240, 0, 72,190,244, 48,175,251,154,119, 31, 95,166, 70, 87,200,239,254,174, 72,149, 87, + 92,124, 9,192, 37, 0,255,108,112, 62,125, 69,170,230,230,243,201,101,143,127,240,160,234,209,114, 55,188,236,110,205, 47,251, +147,153,205,190,209,127, 96,125, 62,111, 10, 75, 75,127, 4,160,112, 57,121,210,253,212,201,147,175, 44, 92,184,240,101, 79, 79, +207, 32, 23, 23, 23, 71, 91, 91, 91,254,181,107,215, 50, 13, 58,221,134, 64, 96, 71, 10,160,177, 38,147, 5, 78, 41, 51, 50,218, +142, 30, 57,242, 29, 62,195,244, 13, 9, 9, 9, 3,128,164,164,164, 56, 11,203,254,234, 10,172,103, 1,149, 21,239, 99,203,182, + 77, 73,203,183,205, 74,160, 18,192, 26,176, 44,144,144,240,135,183, 77,139,197,178,198,203,203,171,154,158,208, 78, 8, 33,127, +158, 80,202,164,204,103, 40, 83, 0,192,142,214, 39,101, 82, 38,101, 82,230, 95,146,249, 76,225,211, 42, 32,196,106,102, 0, 85, +180, 26, 8, 33,132, 52,135,215, 68, 21,218,146,187, 3,158,166,146, 77,164, 76,202,164, 76,202,164, 76,202,164,204,231, 46,179, +185,108,186, 59,241, 47, 42,188, 40,147, 50, 41,147, 50, 41,147, 50, 41,243,249,203,124,166,208, 41, 66, 66, 8,121, 36, 42, 10, +124,142, 3,143,227,162,248, 28,119, 80,192,113,227, 5, 28,135, 63, 52,118,231,248,241, 13, 63,136,118,254,107,176,165, 53, 78, +200,179,139,161, 85,240,159,163, 84, 42,125,221,221,221,191,227, 56,142, 87, 82, 82, 50,171,168,168, 40,135,214,202,127, 31, 39, + 39,167,193, 0,160, 82,169,162,159,213,101,108,231,143, 72,142,135,182,143,255,140,103, 65,206,189,236,223,143,179,216,238, 5, + 76,225,248,191,127,150, 22,143,195,253,123, 89, 56,218,146, 3,187,177,131, 93,215, 2,192,143,209,165,139,241, 20,131, 83, 55, +199,195,195,163,181,179,179,243, 89,129, 64,192,152,205,230, 57,137,137,137, 39,155, 59,208,124,107, 28,150,177, 69, 46,203, 86, +204,230, 9, 13,250,207,212,122,157,174,146,207,231,103,137, 68,162, 75,243, 39,115,103,190,220,109,186,219,200,235, 27,157,255, +246,254,136,224,235,219,141, 10,107,155,153,177,118, 66,247,245,253,103,186, 8, 51,111,222,182,217,116, 52,231, 59,123, 7,247, + 81,127,127,181,232,164, 68,102,158,242,207,109,168,161, 45,205, 58, 31, 1, 78, 70,160,131, 72, 34,241, 54,179,172, 59, 0, 8, + 24,166,216,164,215,231,138,128,132,101,128,250,191, 36,211,197,196, 48,161, 34,177,216,219,108, 50,185,243, 0, 14, 66, 97,137, +197, 96,200, 53,179,108, 98, 20, 80,254,180,243, 41,148, 72,124,204, 44,235,206, 3,184, 63,107,217,255,204, 76,210, 76,129, 21, + 16, 16,112,147,207,231,123,243,249, 15, 59,185, 30, 31,115,175,238,255, 79,254,107, 54,155,243,146,147,147,187, 90,251,199,253, +253,253,237,116, 58,221, 43, 60, 30,239, 53, 0,224, 56,110,143, 84, 42, 61,144,149,149,245, 84, 23, 18,251,251,251,219,113, 28, +183, 88, 38,147, 13,210,233,116,237, 1, 64, 42,149,222,213,106,181, 23,120, 60,222,218,167,204,101, 60, 60, 60, 38, 40, 20,138, +129, 44,203, 14,228, 56,142,199, 48, 76,140, 70,163,185, 80, 88, 88,120, 16, 64,139,159,120,224,225,225, 33,115,118,118,254,208, +193,193, 97,210,220,185,115,203,157,156,156,218,172, 94,189,250, 55,103,103,231,189, 42,149,234,189,194,194, 66,237,127, 73,251, + 8, 84, 42,149,123,132, 66,161, 32, 55, 55,119, 32, 0,248,248,248,196, 24, 12, 6,115, 73, 73,201,107, 0,210, 91, 18,230,226, +226,162, 16, 10,133, 61, 21, 10, 69, 87,133, 66, 17,110, 54,155, 67, 44, 22, 11, 44, 22, 75, 82,109,109,237, 69,147,201,116,211, +100, 50, 93, 43, 43, 43,171,253, 47,218, 70,108, 69, 34,209, 15, 44,203, 2, 64, 48,128,234,103,113, 71,192,241,208,246,222,221, +164, 54,191, 43,166,218,135,252,251,116,124,248, 54, 50,157,213, 5,214,136,190, 14,195, 71, 69,116,226, 3,128,209,240,219,240, + 83,191,170, 79,253,217,197,213,136, 17, 35,174,108,216,176,193, 81,175,215, 99,201,146, 37,123,244,122,253,215,105,105,105,203, +154,122,157,157,157,253,194,247, 63,250, 74,254,104,127,230,102,177, 88,220, 10, 11,114,131,147,239,223, 25,158,124, 63,241,227, +249,227,239, 95,213,178,230, 55,183,254,136,251,214,204, 71,200, 11, 24, 57,106, 92,228, 75,239,175,140,194,164, 73,147, 94,184, +171,210,201,188,238,198,139,107, 57,155, 64, 23, 55,239,209, 75,223,251,148,119,237,202, 47,163, 15,238,219,114,225,255,102,152, + 6, 81,145,213, 44,222, 26,134,233,105, 31, 20, 20,254,234,143, 63,194,198,199,135, 97, 36, 18, 62, 0,176,122,189, 79, 77,110, +174,199,254,209,163,123, 68,165,164,252, 18, 5, 92,255, 79,102,190,207, 48,125,236,131,130,250, 76, 58,117, 10, 54, 30, 30, 12, + 95, 36,226, 3,128,197,104,244,174, 42, 40,240,216,255,210, 75,221,163,210,210, 46, 70,177,236, 53, 88, 49,212,218,255,208,178, + 19,107, 10, 44, 62,159,239, 29, 23, 23,231,166, 80, 40,240,168,248,129,217,108,134,217,108,198,163, 15,197,250, 7, 47,114, 28, + 7,150,101, 49, 96,192, 0,171,142, 94, 61, 60, 60, 6, 1,152, 30, 20, 20,244,242,226,197,139, 69,125,250,244,129,217,108,198, +133, 11, 23,250,173, 91,183,238, 75,189, 94,127, 4,192,142,194,194,194,104,107,143,110,149, 74,229, 48,129, 64,176,123,249,242, +229,118,125,251,246,101,234,158, 14, 95, 82, 82,210,243,210,165, 75, 93, 87,175, 94, 61, 71,169, 84, 78, 46, 42, 42, 58,107,237, +202,241,242,242, 10,149,203,229,135, 34, 34, 34,188,187,118,237, 42,109,221,186, 53, 56,142,195,237,219,183,103, 36, 39, 39, 79, + 60,117,234,212, 42,141, 70, 51,190, 5,227,169,241, 2, 3, 3,167,217,218,218,126,184,112,225, 66,167,177, 99,199,138, 19, 19, + 19, 43, 2, 2, 2,120, 71,142, 28,113, 61,113,226,196,156,175,191,254,122,130, 92, 46,127, 47, 61, 61,125,167, 53, 27, 94, 80, + 80,208, 77, 62,159,239,109, 77, 1,220,194, 34,184,179,191,191,255,129,139, 23, 47,250,103,103,103,155, 35, 35, 35,119, 1,192, +229,203,151, 59,114, 28,199,235,211,167,207,233,188,188,188, 87, 0,220,182,102,193, 61, 61, 61, 59,218,219,219, 31, 27, 59,118, +172,147,175,175,175,220,219,219,155, 39,149, 74, 33, 16, 8, 80, 83, 83,227,153,156,156, 60,228,246,237,219,218,203,151, 47,171, + 68, 34,209,232,130,130,130,132, 22,180,227,222,110,110,110, 83,132, 66, 97, 40,203,178, 94, 0,192, 48, 76,190,201,100, 74, 44, + 41, 41,249, 1,192,149,167,221, 64,220,221,221,191, 92,183,110,157, 75,113,113, 49, 23, 21, 21,245,101,101,101,229,180,103,121, +135,144,120,251, 26, 46, 93,190,136,111, 55,255, 80,201,113,120,240,111, 5,150, 5,105,237,219,135,184,190,249,198, 20,167,126, +125,194, 17,218,185,103,179,153, 99, 6, 57,191, 47, 22, 49,206, 26,189,254,122, 89, 30,255,152, 92, 33,138,156, 60,174,107, 6, + 0,156,249,249, 78,100,247, 0,199, 95, 93,188, 45, 99,228, 18, 73, 15,131,145, 45, 63,118,161,124,101, 75,138, 41,165, 82,121, +214,198,198, 70,174, 86,171,139,202,203,137,167, 96,192, 0, 0, 32, 0, 73, 68, 65, 84,203, 55, 69, 68, 68,172, 89,183,110,157, + 99, 70, 70, 6,114,115,115, 49,125,250,116,155,252,252,252,185,122,189,254,106,110,110,110,163, 61, 89, 85,213,149,235, 63,140, + 90,184,202,214,222, 81, 32,151, 41, 96, 99,107, 7,255, 86,193,232,214,163, 31,134,188, 56, 26, 25,233,201,189, 14,236,222,114, +123,206,184,188,143,147, 85,248, 32, 54,182,241,125, 83, 59, 63,244, 31,253,242,195,226,106,229,251, 81, 72, 73,190, 95,157,157, +195,159,255,211, 45,190, 60, 98, 80, 59,137, 65, 95,147,125,237,202, 47,254, 61,123, 15, 0,128,174, 7,247,109,185, 16,245,154, +105,112,212,158,103,179,128,255, 51,138,171,247,133,194,105,195,214,173,115, 11,155, 51, 71, 84,147,149,101,204,248,246, 91, 77, +241,197,139,102, 70, 34,225,124,134, 15,231,185, 14, 28, 40,157,147,148, 36,186,252,201, 39,225,194,213,171, 3,222, 51, 26,119, +255,167, 50, 71,108,220,232,218,121,214, 44, 81, 85, 70,134, 49,229,203, 47,181, 69, 63,255,204,138,164, 82,139,247,136, 17, 2, +247,161, 67, 37,115,238,222, 21, 93,253,236,179, 62,204,138, 21,173,150,155, 76, 63, 60, 35,203, 78, 90, 80, 96, 65,161, 80, 96, +223,190,125, 16, 10,133, 16, 10,133, 96, 24,166,209,255,251,249,249, 89, 83, 4,141,115,118,118,254,106,225,194,133,238,163, 70, +141,130,163,227,239, 71,217, 24, 57,114, 36, 70,140, 24, 33,202,204,204,156,120,240,224,193,137,187,118,237, 42,170,169,169,153, + 95, 84, 84,116,164,153, 15,239,129,254,254,254, 71,246,237,219, 39,211,106,181,136,141,141, 69, 69, 69, 5, 36, 18, 9,188,188, +188,208,175, 95, 63, 38, 38, 38,198,105,226,196,137, 71,248,124,254,200,130,130,130, 24, 43, 62, 88,187, 58, 58, 58,198,110,222, +188, 89,218,182,109, 91, 94, 90, 90, 26, 58,117,234, 4, 0, 40, 47, 47,199,200,145, 35,165, 99,199,142, 13,156, 59,119,238, 85, +150,101, 7, 20, 23, 23,223,108,102,217,187,184,187,187,239, 28, 62,124,184,231,187,239,190,107,103, 99, 99,131,236,236,236, 66, +165, 82, 25, 92, 87, 4,141, 25, 51, 70, 60,116,232, 80,143, 77,155, 54,109, 56,117,234,212,146,210,210,210,105, 69, 69, 69,183, +154,172, 86,249,124,239, 91,183,110,185,201,229,114, 20, 23, 23, 99,247,238,221,152, 59,119, 46, 24,134, 65, 73, 73, 9, 14, 28, + 56,128,249,243,231,131,207,231,163,170,170,202,170, 34, 88, 46,151, 15, 9, 10, 10,218, 26, 29, 29,237,237,224,224, 0, 79, 79, + 79,254,138, 21, 43, 66, 3, 2, 2,100, 30, 30, 30,252,130,130, 2, 28, 57,114, 36, 96,202,148, 41,199,114,114,114,102,232,245, +250,102, 79,157, 57, 59, 59,111,219,181,107,151,111,124,124, 60, 54,109,218, 4,149, 74, 5,177, 88, 12,123,123,123, 40,149, 74, +180,110,221,154, 55,103,206, 28,249,192,129, 3,229, 81, 81, 81,219, 0,116,182,162,253,118,114,115,115,251,110,224,192,129, 1, + 81, 81, 81, 14, 30, 30, 30,144,203,229, 0,128,202,202, 74,239,236,236,236,158,171, 86,173, 26,127,243,230,205,204,146,146,146, + 55, 1,196,183,112,251,232,220,174, 93,187,145, 99,199,142, 21, 20, 21, 21, 97,203,150, 45, 35, 43, 43, 43, 59, 91, 91, 84,254, + 47,186,116,249, 34, 6, 14,159, 8, 45, 43, 19,158, 56,186,155,171, 62,251,133,179,141,131, 3, 3, 0, 53,106, 53, 59,226,181, + 69,150,145,163, 39, 27, 7, 13, 31,163,185,112,102,143,220,154, 2, 75, 44, 98,156,247,111,157,157,123,241, 90,106,200,217, 11, +217, 67,198,142, 30,194,103, 20,109, 2, 1, 96,209, 59,111,136,127, 60,254,243,215,195, 6,189, 80, 24,222, 51, 56,247,213,153, +223,250,180,164,184, 10, 8, 8,248,229,236,217,179,238, 98,177, 24, 21, 21, 21,206,219,183,111,255,162,103,207,158,252,244,244, +116,220,191,127, 31, 89, 89, 89, 80,171,213,232,222,189,187,205,189,123,247, 54, 1,104,180,192,250,230, 48, 62,252,100,169,251, + 70, 87, 15, 87,127,147, 65,239,202,234,139,219, 71,159,141,239,120,248,128,166,139,155,210, 59,120,226,228, 89, 88,186,226, 83, +225,209, 67, 59, 87, 34,230, 28, 98,155,122,138, 63, 15,189,255,241,238, 50, 84,105,244,152,252,218, 27,152, 50,249, 13,103,206, + 98,240,224, 44, 58,133, 65, 87,225, 96, 47, 74, 62,185,115,251,129, 72, 0,222,143, 21, 89,209, 84,100, 53,236,125,134,233,241, +226,231,159,187,117,154, 51, 71, 18,191,122,117,109,217,197,139,218, 86, 35, 70, 84,132,205,158,173, 7,128,234,172, 44, 81,202, +170, 85,114,215,240,112, 89,159,255,251, 63, 7,147, 70,163,124,255,163,143,186,175, 4,110,180, 52,211,127,210, 36,243,218, 35, + 71,186, 93,251,228,147, 1,248,224, 3,193,192,176,176,219, 43,190,253, 54,207,154,204, 53, 12,211, 51,226,235,175,221, 58,188, +254,186,228,230,178,101,181,234, 27, 55,180,129,145,145,170,110, 11, 22, 24, 32, 16, 64,147,151, 39, 76, 95,189, 90, 97,223,163, +135,172,215,162, 69, 14,102,131,193, 61,106,213,170, 30, 77,245, 16,189,207, 48, 61,134,175, 95,239,218,105,246,108, 73,252,154, + 53,181, 5, 23, 46,232,171, 66, 66,208,249,229,151,203,189,156,157,245, 79,187,236,143,103,150,197,196,252,225,245, 73, 26,218, + 13, 52,162,117,235,214,197,201,201,201,110,135, 15, 31,182,170,192,242,244,244, 68,191,126,253, 74, 18, 19, 19,221,155,216, 33, +230,230,230,230,122,179, 44, 11,177, 88,220,228,140, 85, 87, 87, 35, 33, 33, 1, 19, 39, 78,204, 43, 44, 44,108,116,167,235,232, +232,104,235,232,232,152, 17, 19, 19,227,114,239,222, 61,220,188,121, 19, 1, 1, 1,112,116,116,132, 80, 40,132,201,100, 66,117, +117, 53,130,130,130, 32,151,203, 49, 98,196,136, 50,149, 74, 21, 80, 81, 81,209,232, 78,204,207,207, 79, 34, 20, 10, 83, 15, 31, + 62,236, 19, 26, 26,138, 27, 55,110,192,199,199, 7, 74,165, 18, 0,144,149,149,133,203,151, 47, 35, 34, 34, 2,137,137,137,152, + 61,123,118,174,201,100, 10,126,240,224,129,190,209,211, 5, 33, 33,133, 7, 15, 30,204,107,219,182,173,174,182,182,150, 95, 92, + 92, 44,188,120,241, 34, 91, 83, 83, 99,163, 86,171,133,149,149,149, 76,101,101,165,176,182,182, 86,200,231,243, 69,122,189, 94, +120,237,218, 53,129, 74,165,106,242,193,150,109,218,180, 41,190,127,255,190,219,241,227,199,209,161, 67, 7, 28, 62,124, 24,139, + 23, 47,198,229,203,151,225,237,237,141, 67,135, 14, 97,241,226,197,184,127,255, 62, 92, 93, 93, 49,104,208,160, 38,223, 35, 0, + 8, 12, 12, 76, 75, 72, 72, 8, 20,139,197, 72, 79, 79, 71, 94, 94, 30,194,195,195, 97,177, 88, 80, 84, 84,132,212,212, 84, 20, + 20, 20, 32, 48, 48, 16,175,189,246, 90,122,126,126,126, 80,115, 13, 45, 44, 44,172, 52, 58, 58,218,165, 99,199,142, 40, 42, 42, +130,131,131, 67,253,151,189,189, 61, 28, 28, 28,208,170, 85, 43, 44, 92,184, 16,157, 58,117, 42,121,240,224,129,123,115,197, 79, +104,104,232,217, 11, 23, 46,184, 56, 57, 57, 65,167,211, 65,167,211,213, 31, 28,200,229,114, 8,133, 66, 0, 64,106,106, 42, 70, +142, 28, 89,154,145,145, 49,188, 5,197, 17,223,221,221,253,126,124,124,124,176,173,173, 45,114,115,115,145,152,152,136,153, 51, +103,166,214,214,214,182,197, 95,112,221,208,127, 82, 72, 43, 44,191,119, 55,169, 77,187,118, 33,149, 83,103,188, 41, 28, 51,106, + 76,109,220,245,115, 38,161,254,151,154, 23,251,217, 23, 0, 64,244,181,106, 55,189,176,159,168,107,247, 97,188, 99,199,142, 73, +119,238,248,142,185,123, 55, 73,217,174,125, 72,114, 82, 38,214, 52,150,253,210, 0,251,169,139,231, 13, 15, 9,239, 19,206, 84, +213,114,202,173,219,190,239,254, 32, 59,195, 29, 0,252, 94, 8, 40,158, 57,227,141, 27,118, 10, 94,209,197,203, 23,217,181, 95, +157, 73,250,233,151,202, 93, 86,244, 46, 7,248,248,248, 92,221,190,125,187,139,139,139, 11,236,237,237,161,209,104, 96, 52, 26, +113,239,222, 61,221,254,253,251, 77,118,118,118,182, 69, 69, 69,168,168,168, 0,195, 48,184,118,237, 90, 78,113,113,113, 67, 71, +130,245, 55,251, 28, 60, 24,197,244,239,234,235, 40,226,115, 50,177, 57,217,147, 17,112, 98, 30, 28,220,163, 99,175,117,250, 37, +246,226,228, 17,163, 94,117,237,213,103, 32, 62, 93,179,212,148,149,155,219,249,209,233,194,127,107, 11,109,253, 49,104,236,184, +200, 9,239,175,140, 66,212,251,171,113,242,196,143,149, 54, 50,190,222,206, 86,104, 31,222,183,143,110,225,252, 87,114, 53,213, +106,159, 47,214,173,157, 52,116,120,164,119,207,222, 3,112,237,202, 47, 56,184,111,203, 77,145,132, 78, 23, 62, 46, 10,112,116, + 8, 8,120,115, 94,106,170,232, 78, 84, 84, 13, 91, 80, 80,209,117,193,130,178,134,166,205, 59,127, 94, 33,246,244,180,115, 30, + 61,218,113,157,159, 31, 76, 37, 37,223, 53,116, 13, 81, 67,153, 55, 60, 60, 28,142,198,196, 12,182, 48, 76,255,185,243,230,201, +134, 12, 25,130,170,170, 42,156, 60,121, 18,123,247,236,209, 43,149,202, 4,135, 27, 55,110, 7, 20, 22, 46,111, 40,243, 35,192, +201,182,117,235, 89,115,147,146, 68,113,203,151,215, 64,165, 82,133,205,159, 95,110, 54,155,121,179,214,172, 25,145, 81, 88,216, +191,184,172,204, 15, 0,220, 28, 28,114,219,122,120,196,109,220,181,235,222, 87,109,218,112, 53, 5, 5,223, 69, 53, 48, 6,233, +147,243,185,255,242,101,247,211,165,165,127,115,116,116,148,149,149,151, 11, 68, 66,161,170, 75,112,240,254, 79,231,207,143,213, +222,188, 41,126,218,101,239,186, 96, 65, 89,165, 70,195,188,183,113, 99,159,130,242,242, 23,106, 13,134,160,202,154, 26, 37,107, + 52,242,109,101,178,242, 23, 2, 3,139,171, 46, 92, 40,242,171,169,121,123,131, 70, 83, 66,173,242, 15,246, 96,241,120, 60,112, + 28,103, 85,113, 37, 20, 10,127,119, 26,170, 9, 34,129, 64,128, 27, 55,110,160,164,164, 4, 29, 58,116,128,191,191,255,239, 38, +200,200,200,192,169, 83,167, 80, 81, 81,129, 46, 93,186, 0,128,168,169, 64, 91, 91,219,119,150, 45, 91,230, 96, 48, 24, 16, 23, + 23,135, 46, 93,186, 64, 42,149, 66, 40, 20, 66, 36, 18,129, 97, 24, 40,149, 74,148,149,149,193,221,221, 29,115,230,204,177,223, +184,113,227, 59, 21, 21, 21,239, 55,150,201,113,220,188,137, 19, 39,186,133,134, 62,188, 11, 53, 55, 55,183,110, 94, 0, 0,110, +110,110,184,125,251, 54,186,116,233, 2,119,119,119, 68, 68, 68,184, 29, 59,118,108, 30,128,181,141, 46,184, 72,196,111,219,182, +109, 55, 0, 80, 40, 20,224,243,249, 41,118,118,118,174,238,238,238, 10, 59, 59,187,127, 91,198,237,219,183,171,197, 98,177,201, +154,149, 90, 84, 84,132,208,208, 80,168,213, 15,183,165,218,218, 90, 4, 5, 5,161,178,178, 18, 0,160,215,235,225,233,233, 89, + 95,128, 52,166, 99,199,142, 81,109,219,182,125, 81,161, 80, 72, 24,134, 65,124,124, 60,194,194,194,176,127,255,126,248,249,249, + 65, 46,151, 35, 57, 57, 25, 29, 59,118, 68,108,108, 44, 92, 93, 93,209,190,125,123,137,155,155,219, 37,149, 74, 21,243,224,193, +131,168, 38,122,218,248, 54, 54, 54,136,141,141,197,182,109,219,144,153,153,137,130,130, 2,216,217,217,161,115,231,206, 8, 9, + 9, 65,159, 62,125,144,150,150, 6, 94,243,141, 73, 25, 28, 28,124,242,198,141, 27, 46,124, 62, 31,177,177,177,208,104, 52,208, +233,116, 96, 89, 22, 60, 30, 15, 82,169, 20,189,122,245,130,179,179, 51,130,131,131,113,244,232, 81,215,161, 67,135,158, 42, 46, + 46,238, 12,160,168,185,117,234,232,232,248,246,202,149, 43,125,220,221,221, 81, 93, 93, 13,141, 70, 3, 79, 79, 79, 12, 29, 58, +212,235,212,169, 83,111, 27, 12,134,117,207,212,145,150, 5, 57,237,218,135,128,227,240,224,196,209,221,156,183,171, 52,116, 64, + 23,139, 91,202, 61,166,215,181,107,137,237, 1,192, 81,225, 31, 31, 28, 98, 76,137,253,237,124,222,201,227,123,227,205,102,240, + 67,218,133,180,225,115,200,111, 42,187, 44,143,127,236,236,133,236, 33, 29, 59,246, 19,108,252, 98,213,152, 89, 51,134, 73,156, + 28,251,241,170,242, 14,224,242,173, 59,126, 43, 86,188,235,246,193, 7,159,156, 56,123, 33,219, 92,150,199,255,208,154,249, 13, +124,193,233,203,195,159, 11, 93,170,171,247, 32, 62,205, 6, 60, 89, 71,248,183, 10, 68, 85, 85, 21, 36, 18,137,116,210,164, 73, +230,101,203,150,105,108,109,109,229,143,218,114, 9,159,207, 31,214,108,240,253, 36,176, 29,130, 88,161,173,193, 98,225,108,180, +208, 85,138,238,164,101,160,223,192,136,226,238, 93, 58,175,249,100,237,186,229, 1, 65,109, 92, 39, 77,125, 83,248,249,167,203, +191, 5,184,126, 13,198,100,225, 2,239,240, 81, 25,128,151,222, 95, 25,133,140,140, 84,199, 89,227,212,171, 25,129,204,179,109, +135,254,182,223,110, 63, 63, 60,168,117,155, 23,102,205,121,251,167,205,155, 54,188,244,120, 79,214,190, 61,155,143, 1,230,193, +176,238,218,156,231, 65,199, 41, 39, 79, 66,147,147, 99, 82, 93,186,164, 27,252,213, 87,101, 93,166, 78, 93,103, 52,153, 92,120, + 60,222,239, 46,133,224,241,120,128,197,194, 99,214,174,229,115,158,158, 48, 57, 56, 76, 71, 74, 74,235,230, 50, 63, 49,153,198, +141,237,220,249,165,173,187,119,195,207,207,175, 62,211,222,222, 30,243,230,205,195,156, 57,115, 36, 9, 9, 9, 61, 78,157, 58, +213, 99,215,215, 95,187,163,180,116,220,147,129, 70,160,195,164,227,199, 81,147,149,101, 84,221,184,161, 27,180, 97, 67,249, 47, +191,253,230,244,238,215, 95,175,232, 16, 22,230,245, 77, 84,148,196,215,247,225,253, 33, 57, 57, 57, 65, 27,214,175,247, 29, 56, +116,104,159,165,139, 22,109,191,189,112, 97, 59, 60, 28,146,173,209,249, 44,186,120,209,112, 90,165,250,219,193, 67,135, 28,218, +180,105, 3,142,227,144,150,150,230,182,109,219,182, 55,251,207,153, 51,101,209,196,137, 43,134,102,102, 86,152,203,203,197, 35, +191,252, 82,184,111,194,132,246,205,101,214,173, 79, 0,120,121,241,226,119,186,247,238,221, 46, 98,210, 36, 39, 79, 79, 79,158, + 76, 38,131,209,104, 68, 81, 81,145, 99,114,114,114, 96,116,101,101,213,185,219,183,127,128, 70, 51,148,154,228, 31, 44,176, 0, +192,108, 54,183,168,192,178,178,200,170,239,241, 42, 43, 43, 67, 98, 98, 34,252,252,252, 96, 50,153,112,246,236, 89,168,213,106, +136, 68, 34,136, 68, 34, 24, 12,134,102,179, 20, 10,197,144,240,240,112,230,202,149, 43,240,247,247,135, 76, 38,171, 47,172,234, +138, 44,161, 80, 8,165, 82,137,202,202, 74,244,237,219, 87,184,109,219,182, 33,104,100, 28, 64, 0,176,177,177, 25, 49,122,244, +232,250, 46,182,218,218, 90, 8, 4, 15,239,180, 54, 24, 12,168,174,174, 70,121,121, 57, 42, 43, 43,161,211,233,208,169, 83, 39, +241,133, 11, 23, 70, 52, 85, 96, 61, 78,163,209,212,148,148,148, 56,244,235,215,207,113,199,142, 29,201,189,122,245,250,221, 69, +195,191,252,242,139, 78,175,215, 51, 98,177,216,170,139,221,119,239,222, 93,191,238, 11, 10, 10,240,221,119,223,193, 98,177,128, +199,227, 33, 53, 53, 21, 27, 55,110,172,191, 86,174,169,247,168,109,219,182, 17, 63,252,240, 67,215, 93,187,118, 85, 48, 12,131, +228,228,100,236,217,179, 7, 28,199,193,197,197, 5, 26,141, 6, 37, 37, 37, 88,183,110, 29,140, 70, 35,108,108,108,224,229,229, + 37,157, 55,111, 94,223,213,171, 87, 11,155, 42,176,204,102,179, 89, 32, 16,192,215,215, 23, 43, 87,174,132, 78,167,131, 72,244, +176,174,172,170,170,130, 90,173, 70, 92, 92, 28,178,178,178, 96,177, 88,154,252, 96,145, 74,165,227,119,238,220,233, 38, 22,139, +161,211,233,144,154,154,138,244,244,116, 36, 39, 39,235, 85, 42, 21,107, 99, 99,195,243,240,240, 16, 84, 86, 86,138,167, 78,157, +202,171,174,174, 6,199,113,136,140,140,116,222,186,117,235, 43, 6,131, 97,125, 51,171,212, 85,169, 84,254, 99,214,172, 89,210, +186,245,102,177, 88, 80, 90, 90,138, 9, 19, 38,200, 99, 98, 98,150, 25, 12,134, 61, 0, 74,159,149, 29,193,227,119, 11, 86,159, +253,194,249,220,185,111, 94, 72,185,199,244, 18,160,188, 71, 88,255,183, 25, 0,184,127,115,123,159,180,164, 27,102, 27, 11, 47, +227,167, 61,107,175,218, 6,191, 89, 14,224, 88, 83,189,128, 35,250, 58, 12,151, 43, 68,145, 99, 71, 15,225,111,221,246,125,247, + 89, 51,134, 73,220, 58,125,207, 3, 0, 71,137, 55,122,155, 22,241,117,134, 90,233,214,109,223,119, 31, 59,122,196,245,172,236, + 7,235,156,149, 14, 71, 79,253,170, 62,211, 84, 47,161,135, 11,227,229, 40, 43,131,163,207, 16,248,133, 56, 34, 46, 46, 14,199, +142, 92, 65, 80,155,110, 48, 24, 12, 48,153, 76,138,145, 35, 71,106, 14, 29, 58,164, 43, 47, 47,175, 54, 26,141,253, 11, 11, 11, + 83,154,173,175, 80,102,233,196,183, 24,197,102, 33,171,173, 21,215,206, 95,113,228,149,238,189, 35,186, 56,249,122, 9,157,165, +236,137, 1,253,195,119,239,221,245,221,194, 69, 75, 63, 64,167,176, 94,189,231,139,126,107,255,229,110,211,157,134,178,146,178, +113,146,127,244, 40,155,145,146,246,210,131,220,236,188,214, 62, 74, 67,122, 14,103,122,123,217,183, 67,251, 13, 25,223, 49,176, + 77, 79,241,221,251, 87,120, 11, 23, 44,220,251,197, 23,159, 77,170, 43,178, 46,198,158,237, 31, 53, 61, 91, 28,181, 3,122,250, +136, 2, 68, 18,137,183,141,159, 31,147,181, 99,135, 54, 96,212,168, 10, 0, 48,177,172,203,181,235,215,237,229,114, 57, 56,142, +131,201,100,250,221, 53,194,117,215, 5, 15, 25, 48,192,221,154,204,220,111,190,233, 56,119,238, 92, 20, 21, 21,129,101,217,250, +222,239,199,246,217,168,170,170,194,184,113,227,176,125,211,166, 6,207,139, 11, 37, 18, 31, 27, 31, 31, 38,107,199, 14,109,224, + 75, 47,169, 96, 54,243,150,126,253,245,202, 69, 75,150,248, 79,120,229,149,223, 29, 55,134,132,132,224,155, 77,155,196,123,246, +236,241,250,100,211,166, 25, 17, 18, 73, 6,244,250, 38,231,179,186,125,123, 56, 38, 38,202,218,180,105, 83, 95, 80, 6, 7, 7, +227,211, 79, 63,149, 76,158, 60, 89, 60,109,202,148,207,239,182,105,179, 33, 42, 43, 43,205,185,117,107, 59, 70, 34,241,110, 46, +179,110,125, 2, 64,141,193, 16, 26,245,193, 7,142,215,175, 95, 71, 65, 65, 1, 56,142,171,255, 59, 29, 59,118,228,189,242,202, + 43,246, 61,187,118,237, 78, 45,242, 79,234,193,106,168,192,106,172,208,178,182,184,122,242,111,120,120,120,192,104, 52,226,251, +239,191,175, 47,172,234,143, 8,140,198,102, 51,116, 58, 93, 7,165, 82,137,170,170, 42,180,110,221,186, 62,163,110,190,234,190, +164, 82, 41,116, 58, 29,188,188,188,160,211,233, 58, 52, 83, 0,117,182,183,183,175,235,205,130,254, 81, 35, 53, 24, 12, 80,171, +213, 80,171,213, 48, 24, 12,168,168,168, 64, 77, 77, 13,212,106, 53,170,171,171,195,172, 89,102,139,197,130,196,196,196,244, 54, +109,218,116, 22, 8, 4,176,177,177, 81,212,214,214,162,238,102, 2,149, 74,133,157, 59,119,214, 78,157, 58,213,229,218,181,107, + 90,107,214,225,252,249,243, 33,145, 72,160,209,104,176,105,211, 38,204,159, 63, 31, 34,145, 8,213,213,213,216,180,105, 19, 22, + 46, 92, 8,134, 97,160,215,235,177,127,255,254,198, 63,100,239,221,203,186,118,237, 90, 88,151, 46, 93, 28,143, 30, 61, 90, 58, +100,200, 16,215, 97,195,134,213,175, 59,150,101,209,163, 71, 15,180,109,219, 22, 37, 37, 37, 56,125,250,116, 89,112,112,176,203, +245,235,215, 45, 69, 69, 69, 15,154, 89,238,250,162, 73, 32, 16,192,108, 54,163,184,184, 24,106,181, 26,165,165,165, 40, 40, 40, + 64, 94, 94, 30, 24,166,249, 39,135, 56, 59, 59,191, 28, 26, 26, 42,120, 84,108,161, 85,171, 86, 88,180,104, 17,171,213,106, 39, + 0, 56,253,104,178,136,189,123,247, 30, 13, 10, 10, 98, 60, 61, 61,145,154,154, 10, 87, 87, 87, 70, 38,147,189,218, 92,129,165, + 84, 42,183,159, 56,113,194,169,238, 14,218, 58, 90,173, 22, 44,203, 98,226,196,137, 78, 91,183,110,221,110, 52, 26, 71, 60,139, + 59, 5, 27, 7, 7,230,197,126,246, 5,215,174, 37,182, 15,235,255, 54,227,212,122,213,195, 2, 28, 96,226, 46,110, 8,235,215, + 35,116, 79,221,117, 89, 77, 25, 59,216,117,237,168,136, 78,252,201,227,186,102, 48,138, 54,129,187,119,110,112,119,114,236,247, +175, 29, 5,227, 4,133, 20,104,235,103,230, 95, 61,153,225,190,112, 97, 27,195,158,111,255,150,177,251,200,205, 33, 34,113,252, +160, 31,163, 75, 23, 54,150,125, 55,195,116,188, 82,231, 20, 98, 95,121,132, 7,231, 55, 16, 22, 22, 6, 87, 87, 79,124,179,249, + 7,120,189,208, 5, 6,131, 1,118,118,118,242,135,187, 17,227,110,107,138, 43, 0,136,138,138,181,132,135,247, 55, 50,174, 46, +236,188,121, 95,140, 27, 22, 49, 46,164,255,128,193,220,249,243,103,140,189, 67,140, 5,131,251,247, 44,250, 37, 54, 54,181,168, + 40, 63,184,109, 72, 71, 36,223,189, 57,140,227,144,200,227, 53,220,219,116, 55, 19,103,116,188,123, 49,251,151,204,178,104, 13, +113,178, 53, 95,223,137,120,105,204,180,208,240,190,253, 44,231,127, 62,103, 16, 67,157,100,211,183,119,254,180, 41,175, 30,221, +127,224,240,139, 49, 63,159, 12,170, 84, 23,159, 92,251, 3, 21, 87,245, 7,103, 44,235,206, 72, 36,252,226,152, 24,182,211,204, +153,245,235, 69, 46,151,227,216,177, 99, 16,139,197, 16,137, 68, 16,139,197,245, 95, 34,145, 8, 74,165, 18, 60,142,227,183, 36, +179,176,176, 16, 69, 69, 69,176,183,183,135,171,171, 43,138,138,138,112,249,242,101,164,166,166,130, 97, 24, 68, 68, 68,128,223, +200,231,230, 19,153,134,191,189,255,254,240,246, 29, 59,122, 62, 89, 92,213,125,182,169, 84, 42,244,239,223,159,119,254,252,121, +215,139, 25, 25, 99,160,215,255,208, 84,102,135,209,163,203, 75,162,163, 27,252,219,237,218,181,227, 29, 61,118, 76, 50,105,226, +196, 5,159,110,222,188,126,197,231,159, 23,129,101,149, 45, 89,118, 30,143,199,231,241,120,240,241,241,129, 74,165, 66, 77, 77, + 77, 93,135, 3, 28, 29, 29, 97, 50,153, 96,177, 88,132,212, 34,173,199,111,174, 24,120,178,144,106,236,139,207,231, 63, 85,145, +213, 20,107, 10,172,186, 34, 67, 34,145,252,110,227,170,251,122,124,227,171, 43, 98,172, 32,168,170,170,194,145, 35, 71,160, 82, +169, 80, 93, 93,253,187,226,170,174,231, 42, 51, 51, 19,123,247,238, 69,126,126, 62, 4, 2,129, 85, 15,109,205,204,204,188,233, +239,239,223,185,174, 71,108,224,192,129,222,151, 46, 93, 42,168, 43,230,150, 47, 95, 94,214,179,103, 79,151, 39, 63,220,155,156, + 89,129, 0,151, 47, 95,134, 70,163, 1,199,113, 16,137, 68, 72, 78, 78, 6,203,178,224, 56, 14, 12,195,160,180,180,180,217, 30, +172,196,196,196,215,103,204,152,177,126,230,204,153, 49, 75,151, 46, 61, 63,104,208,160, 92, 30,143, 7,147,201, 4, 59, 59, 59, + 40,149, 74,164,164,164, 64,171,213,226,157,119,222,201,217,181,107,215,207,155, 54,109,138,217,178,101,203,250,188,188,188, 25, + 45,121,111, 89,150, 69,109,109, 45, 42, 42, 42,160, 82,169, 80, 85, 85, 5,157, 78,247, 84,109,104,240,224,193, 56,121,242,164, + 96,240,224,193, 91,253,252,252,138,252,252,252,138, 6, 15, 30,188,245,248,241,227, 2, 47, 47, 47,228,230,230, 34, 46, 46, 14, + 42,149, 10, 22,139,133,215, 76,239,234,192, 41, 83,166,244,245,245,245,229, 25,141, 70,232,245,122, 24, 12, 6, 24,141, 70,152, +205,102,228,228,228,160, 93,187,118,124, 95, 95,223, 94, 0, 6,210, 46,164,101,170,242, 14,128, 43,249, 10,156,106, 31, 44, 37, + 95,163, 86,247,116, 57, 21, 21, 21, 31,190,245, 81,101,137,185, 50, 6,247,110, 29, 65,181,150,129,119,208, 64,188, 57,115, 34, +126,187, 30,131,242,242,114, 36, 37, 37, 33, 60, 60, 92,196,227,241, 90,212, 54,247,237, 59,105,158, 52,241,255, 94, 25, 60,108, + 92,215,193, 67, 70,152,207,159,143,214,223,184,122,230,102,144,191, 93, 9,199,170,139,237,237,228,183,210, 82,146, 16,220,166, + 29, 76,172, 37, 28,136,106,178, 77,101,100,192,240, 83,145,135,249,149,249,137, 83,134,141,154,222,105,240,144, 97,166,179,103, + 78,152, 47,157, 59, 20, 55,108,224, 11,177, 31,127,182,199, 71,101,106,221, 94,106,167, 60,213,171,179,188,223,236,177,190,179, +168,165, 52,208,235, 36,149, 90,240,104,191,201,227,241, 96,177, 88,126, 87, 84, 61,249,101,205,103,210,227,153,117, 56,142,131, + 90,173, 70,106,106, 42, 62,251,236, 51,220,190,125, 27,102,179,185,190, 39,171,209,207,161, 71,167,116, 69, 82,169, 5, 0, 50, + 10, 11,251,207,157, 59, 87,210, 80,113, 85, 94, 94,142,178,178, 50,228,231,231, 35, 34, 34, 66, 84,229,228,212,185,185,249,244, +114,115,211,203,165,210,226,148,148,148,127,155,223,234,234,106, 72, 36, 18,124,245,245,215,162,147,137,137,243, 47, 93,190,236, +208,146,245, 89,151,195,227,241,224,230,230,134,192,192, 64,132,133,133,161, 67,135, 14,144, 74,165,184,123,247, 46,190,251,238, + 59, 8,120, 60,150, 90,226,159,208,131,213, 88,129,213,208,255, 25,134, 65, 75, 10, 2,107, 89,115,138, 80, 42,149,222, 41, 46, + 46,238,227,237,237, 13,147,201, 84,223,123, 85,119,154,176,238,123, 0,144, 72, 36, 72, 74, 74,130, 84, 42,189,211, 84,166, 92, + 46,191, 35, 16, 8,122,117,235,214, 13, 71,143, 30, 69, 76, 76, 12, 50, 51, 51,161,213,106,161,211,233,160,213,106,113,247,238, + 93, 88, 44, 22,132,134,134,194,222,222, 30,114,185,252, 78,115,243, 90, 91, 91, 91,200, 48, 76, 27,153, 76,246,175, 83, 29, 30, + 30, 40, 43, 43,179,152, 76, 38,236,220,185,179, 74,169, 84, 42,100, 50,153,213,235,147,199,227,161,164,164, 4, 62, 62, 62,168, +170,122,248,152,175,234,234,106,184,185,185,193,104, 52,194, 98,177, 64,175,215,195,198,198,166,190,203,183,169, 14,193,180,180, +180, 69,143,125,223,109,194,132, 9,123,247,239,223,223,234,231,159,127,198,245,235,215,225,226,226,130,143, 62,250, 40, 51, 59, + 59,123, 18,128,223, 74, 74,254,255, 95,239, 88, 94, 94,126, 56, 49, 49,177, 87,183,110,221,234,247, 14, 3, 6, 12,224, 13, 24, + 48,192,229,241, 46,253,242,242,114,196,199,199, 35, 54, 54, 22, 38,147, 9, 73, 73, 73,102,173, 86,187,175,169,125,142,151,151, +215,142, 21, 43, 86,216,176, 44, 11,129, 64, 0,161, 80, 8,150,101, 33,145, 72,234,123,106,115,114,114, 16, 25, 25,105,191, 97, +195,134,237,122,189, 62, 16,128,241, 89,218, 41,212,168,213,108,244,181,106, 55, 71,133,127,252,253,155,219,251,180,125,180,159, +184,127,115, 27, 43, 85,248, 92,191, 30,175,181,237, 33, 85, 55,187,163,253, 49,186,116,177,209,240,219,240, 51, 63,223,137, 92, +244,206, 27, 98,191, 23, 2,138, 47,223,186,227,215,219,180,136,175,144, 2,181, 58, 64, 85, 9,220,127, 32,176,248,189, 16, 80, +252,219,173,100,241,231,235,183, 4,104,106, 13,117,167, 8, 27,149,159,159,175,187,196,113, 99, 23,125, 33,143,157, 56, 89, 32, + 22, 75,157, 80,173, 74,131,159,159, 23, 94, 25,219, 7, 95,125,127, 14,246, 14,142,112,119,119, 7,143,199, 83,180, 96,241,121, + 87,163,227,102, 78,157,241,102,207,161, 47,142, 48,159, 61,119, 10,209,103,143, 92,223,177,126,217, 17, 35, 83,173,224,155,107, +100, 62,222,202,132,172,204,148,215,194, 7,188, 8,169, 76,254,255,216,187,238,240, 40,170,183,123,102,182,167,247,186, 36,144, +132,144,132, 36,148, 16, 64,233, 85, 32,128, 20, 65, 84, 16, 16, 21, 80, 64,177, 80, 68, 1, 65, 4,233,216,144, 14,210, 5, 1, +233, 61, 64, 32,210, 75, 26, 33,189,236,166,183,221,108,223,153,185,223, 31, 36,252, 2,134,100, 19,208,207, 50,231,121,246,201, +238,100,230,204,189,115,239,204, 61,243,190,239,125,111,115, 32,164,214, 81,188,101, 51,188, 9, 26,190,224,144,253,235,246,249, +178, 55,223,122,183, 83,191, 1, 47, 51, 39,143, 31,196,201,195, 63,255, 62,111,106,179, 99,233,119,118,138, 99,175,229,202,134, +142,152, 92,118,228,108,162,241,149, 5,126,201,222, 45,218,234,128,116,126,116,170,126,129, 20, 10, 11, 24,131,193,167, 73,191, +126, 2,109, 86,150,200,214,195,131,169,126, 73,171,249, 82,253,164, 5,139,166,105,128,166, 57, 75, 56, 45, 45,139, 78,167, 3, +247,148,220,135, 84, 53,231,128, 1, 2,109,110,174,168,176,164,164, 89,179,102,205, 30,219,199,108, 54,163,164,164,228,209,167, +188,188, 28, 50,153, 12,165,102,179,135, 37,229,236,214,186,245,182,149, 43, 86,124,178,126,195,134, 71,174, 30,181, 90, 13,149, + 74,133,138,138, 10,208, 52,141, 25, 51,103, 74,103, 46, 88,240,254, 32,161,112, 58, 24,198,226,235, 89,253,178, 78,211, 52,132, + 66, 33,178,178,178, 30,125,178,179,179, 33,147,201, 64, 40,138,227,123,228,115, 16, 88,213, 65,238,245,137,171,234,239, 2,129, +192, 50,115,111,213,155,192,243,178, 96,105, 52,154, 51, 49, 49, 49, 29,251,245,235, 39,140,141,141,133,151,151,215, 31,220,132, + 66,161, 16, 20, 69,193,218,218, 26,199,143, 31, 55,105, 52,154, 51,245,220, 68,103,207,158, 61, 27,249,209, 71, 31,137,198,141, + 27,135,248,248,120, 76,154, 52, 9,101,101,101, 80,169, 84, 40, 41, 41,129, 78,167, 67,199,142, 29, 33,147,201,144,146,146, 98, +214,233,116,245,165, 42, 32,133,133,133,149,110,110,110, 94, 79,254, 99,196,136, 17, 30, 63,254,248,163, 54, 41, 41,201,220,185, +115,103,123, 0, 13, 18,172,187,118,237,122,212,102,247,239,223,199,218,181,107, 31,197, 33,220,188,121, 19,203,151, 47, 7,203, +178,150, 8,172, 39,113,189,184,184,152, 49,153, 76, 8, 12, 12,132, 92, 46,135, 78,167,195,154, 53,107, 24, 0,215,255,140, 14, +105,137, 5, 75,175,215,239, 27, 59,118,236,204,219,183,111,123,137,197,226,106,211, 53, 56,142,131,201,100, 66,102,102, 38, 18, + 19, 19,145,146,146,130,226,226, 98, 16, 66, 96, 52, 26,113,243,230,205,114,179,217,188,247,105,188,110,110,110,159,111,218,180, +201,211,202,202,234, 15,137,117,171, 31, 58,213,174, 87,119,119,119,244,232,209,195,253,220,185,115,159,155, 76,166,185,255,244, + 7, 65,117,134,118,194, 33, 37,234,141,143,185,201,147, 38,136, 91,180, 52, 37,167, 36, 94, 99,111, 93, 92, 19, 1, 0, 50, 27, +159,171, 45,130,219, 37, 92,138,179,229, 6,190, 57,163,109,136, 63, 4, 20, 65, 48, 69, 80,252,100,198,247,234,119,180, 99, 49, +229,199, 58, 4, 56,197, 28,252,237,204, 15,179, 62,126,231,218, 23, 95,204,114,215, 27, 53,178,144,166, 44, 13, 60, 20, 87,177, +241, 54,250,133, 11,223,185,182,100,197, 54, 46, 59,213, 52,253, 90, 90,249, 83,103,248,214, 20, 45, 52,173,148,121, 6, 76, 87, +250,181,232,213,236,238,239,235, 40, 87,123, 1,236, 90, 14,194,128,254, 47,225,244,217, 24,100,229,233, 80,245, 2, 80,103,218, +131,150, 77, 49,166,154,147,162, 33, 27, 51,254,221,110, 3, 6,188, 76,142, 29,253,141, 57,248,203,207, 49,187,118, 47,223, 75, +139,197, 66, 19,103,111,164, 4,250,114, 86,224, 24,175,169, 40, 5, 0,136,132, 98,251, 58,252, 3,190, 9,241, 73,193,161,161, + 33,158, 99,198, 79,116,136, 26, 48,132, 28, 59,118,144,219,187, 99,219,249,189,223,182,218,193,153, 85,226,188, 76,173,180, 66, +109,174, 32, 2,137, 99,165,154,211, 22,232,155,235,189,127, 31, 97, 2,246,241,163, 83,245, 56, 96, 48,228, 86,230,228,120, 57, +119,239, 46, 77,153, 63,223,218,163, 99, 71, 61, 69, 81,245, 10, 44,129, 64, 0,242,148, 56,190, 39, 57, 27, 34,176, 8, 69,213, + 58,249,136, 53, 24,114, 42,179,178,188, 92,187,119,151,165,206,157,107, 93,155,213,190,164,164, 4,165,165,165,143, 9,172,170, +103,141, 69,229, 92,246,225,135,191,183, 31, 55,174, 52, 54, 54,214,227,197, 23, 95,164, 84, 42,213, 35,113, 85,253,221,205,205, +141,242,109,214,204,238,140, 66, 17, 80, 91, 12, 86,109,215,211,146,186,211, 52,253,212,235,201,227, 25, 44, 88,150, 10, 44, 11, + 6, 71,179,217,108,134,187,187, 59,138,139,139,193,113,220, 83, 27,210,202,202,170,218, 7, 92,231, 76, 58,181, 90,189,122,225, +194,133, 83,122,246,236,233, 26, 18, 18,130,162,162, 34,184,187,187, 67, 32, 16, 60, 42, 87, 53, 95, 92, 92, 28,246,236,217,163, + 82,171,213,171,235,169,247,170,159,126,250,233,253,168,168, 40,103, 55, 55, 55, 56, 57, 57,225,238,221,187,112,116,116,132, 90, +173,198,253,251,247, 97,103,103, 7,138,162, 96, 48, 24,112,241,226, 69, 53,199,113,171,234,185, 49,201,229,203,151, 77,214,214, +214,119, 75, 74, 74, 4,197,197,197,130,170,244, 12,162,138,138, 10,209,137, 19, 39, 92, 29, 28, 28,180,231,206,157, 43,242,245, +245, 21,100,100,100, 8,140, 70, 99,189, 42,139,162, 40,124,248,225,135, 16,139,197, 48, 24, 12, 88,189,122, 53, 62,254,248, 99, + 8,133, 66, 24,141, 70, 44, 93,186, 20,115,230,204,121, 36,152, 15, 31, 62,220,160, 14, 82, 29, 64,106, 50,153, 96, 50,153, 96, + 54,155,255,212, 14,105,161,139, 48,255,193,131, 7,131,218,183,111,127,234,224,193,131, 46,246,246,246, 80, 42,149, 40, 42, 42, + 66, 65, 65, 1, 10, 11, 11,161, 86,171, 97, 48, 24,224,232,232,136,172,172, 44,156, 58,117, 74, 85, 89, 89,249, 18,234,152, 65, + 40, 16, 8,198,118,235,214, 77,248,100, 25,104,154,126,212,159, 68, 34, 17, 36, 18, 9, 20, 10, 5,186,117,235, 38,185,112,225, +194, 88, 0,255,120,129, 85,157,161, 61, 44,172,165,219,160,151, 71,155, 34, 59,244,171,188,112,253,116,174, 45, 71,165,117,237, + 24,190, 19, 0,174,222,209,217, 93,138,179,229,218,180,235, 67, 13, 28,164,107,187,117,243,122, 73, 66,124,130, 95,104,120,104, +157, 25,253, 93,155,112, 67,250,245,106,150,103,111, 67, 9, 23, 46, 92,114,120,211,230, 13, 29, 98,143,252, 47, 77,195,194,133, + 15,211, 52,244,235,213,140, 73,184,159, 60, 4,105,248,217, 82,209, 50,104, 80,191, 91,155,182,236,129, 34,229,176,247,170, 79, +172, 36, 40, 41, 4,172,219,161, 91,164, 11,110,108, 76,196,157, 59,119,242, 57,142,171,219,149, 75,195, 55, 46, 46, 33, 56, 44, + 60,212,243,205,241,239, 58, 68, 69, 13,193,177, 99,135,176,125,203,250, 11, 47, 58, 70,108,202,186, 94, 44,144, 7, 59,137,173, + 29, 37, 98,161, 88, 38, 20, 11,197,197, 38,243, 67,235,186, 80, 44,178, 7, 70,214, 57,232, 76,154, 56,218,161, 87,223, 33, 56, + 90,197,249, 69,219, 17, 27,253,132, 45,169,142,159, 44,155,236,215,212,175,169, 70, 91,160,162,105,137, 73,111,224,236,150,109, +204, 92,153,150, 58, 54, 13,192, 10,240,179, 8,171,113,119,123, 84, 84,135,105,169,169, 98,183, 46, 93,172,148,231,207, 91, 63, +233, 34,172, 77, 96, 9,133, 66,128,166, 25, 75, 56,169,211,167,105, 0, 16,139,197, 79,125,177, 23,139,197,208,106,181, 96, 40, +170,214, 29,196,192,221,237,131, 6,117,156,150,154, 42,114,238,217,211,218,237,246,237,236,140,140,140,160,136,136, 8,176, 44, +251,152,229,170,250,163,215,235, 97, 52, 26, 33,147, 74,227, 44, 41,103,193,197,139,250, 57,227,199,207,125,255,189,247,190,221, +179,119,175,204,222,222, 30, 42,149, 10,106,181,250,209,199, 96, 48, 32,178,125,123,209,207,247,239,143, 65, 89,217, 60, 75,174, +167, 71,207,158,218,250,158,201, 85,130,149,119, 17, 54, 0,116,125, 22,172,103, 76,211, 16,254, 4,231,156, 1, 3, 6,232,211, +211,211,225,227,227,243, 72,164,212, 60,167,189,189, 61, 28, 29, 29,145,144,144,128, 77,155, 54,233, 40,138,154, 83, 23,103, 89, + 89,153, 90,175,215,143,122,237,181,215,116, 34,145, 8,193,193,193,143,220, 58,132,144, 71,177, 87,113,113,113, 24, 59,118,172, + 86,175,215,143,170, 37, 7,214, 99,156, 89, 89, 89, 21, 26,141,230,141,209,163, 71,107,147,146,146,208,181,107, 87,220,190,125, + 27, 26,141, 6,149,149,149,200,200,200, 64,104,104, 40, 76, 38, 19,246,237,219,167,213,104, 52,111,100,101,101, 85,212,197,169, + 86,171, 7,127,243,205, 55,130, 99,199,142,249,121,123,123,135,181,111,223, 62,164, 87,175, 94,205,135, 13, 27,214, 52, 42, 42, +202,171, 69,139, 22,250,126,253,250,185, 13, 24, 48,192, 77, 32, 16,136, 82, 83, 83,243, 8, 33, 3,234,226,172, 41, 0,146,147, +147, 97, 50,153,254, 16,115, 85, 61,155,144,101, 89,139,218,168, 54,145, 93, 45,172,170,133,150, 5,150,176,240, 90,202, 88,239, + 65, 18,137,164,218,194, 73, 44,224,188,157,152,152,216,183, 83,167, 78,183,198,142, 29, 35,244,127, 68, 0, 0, 32, 0, 73, 68, + 65, 84,171,206,206,206,134, 88, 44,134, 92, 46, 71,211,166, 77, 97, 99, 99,131,210,210, 82,236,219,183, 79,123,252,248,241, 56, +149, 74,213, 3,127,204,129, 21,254, 68, 25, 51,106,123,184, 10, 4,130, 63, 8,172,234,149, 2,104,154,206,104,200,245,108, 36, +254, 50,206,137,239,140,113, 30, 56,120,136,221,161, 67,135,100,107,215,110, 76,232,218,245,221,109,182, 94,239,159,176,245,122, +255, 68,199, 23,223,222,249,221, 79, 91, 30, 28,248,237, 55,171,129, 3,135, 57, 76,126,119,140, 55, 40, 74, 88, 31,167,181, 84, +218,177,219, 11, 45,202, 47, 94,190,200, 44, 89,177,141,237,220, 53,234,234,183,223,253,180,247,219,239,126,218,219,185,107,212, +213, 37, 43,182,177, 23, 47, 95,100,186,189,208,162,220, 90, 42,237,104, 73, 57, 39, 77, 28,237, 48, 48,106, 8,142, 28, 57,192, +236,218,182,122,233,161,104, 99,247, 17, 51,245, 5, 89, 15,206, 18,228, 47,130,187, 36, 6,217,217,217, 21, 12,195,244,172, 37, +192,189, 86,206,201,239,142,174, 41,174, 46, 38,100, 96,195,250, 91,183,216, 31,199,207, 55,239, 60,121, 64,119,228,194, 45,213, +133, 27,217,101, 69, 15, 42,210, 52,106,149,145,227, 56, 16,142, 21,124,249, 37,168,186,218,168,115,231, 30, 56,119,122, 39,182, +109, 94, 87,193,113,208,143,220,183,143, 29,249,227,124,210,180,105,179,166, 59,118,236,164, 6, 13, 30,234, 64, 8,184,193, 67, +135, 56,238,218,177,139,242,247,247,111, 22, 16, 0,241, 63,189, 47, 61, 47,206,249, 64,153, 42, 43,235,194,245, 53,107,140, 30, +163, 70, 57, 75, 60, 60,236,193,113, 84,125, 49, 88,181, 88,176,158,202,233,225,236,172, 56,121,242, 36,130,131,131, 33,151,203, + 31,243,200,136, 68, 34,248,250,250,194,205,205, 13,167, 78,157, 2, 1,110,212,198, 57, 27, 40, 47, 79, 75,139,190,186,108,153, +193, 99,196, 8,167,182,254,254, 55,190, 93,179,198,200,178,236, 35,171, 85,205,191,101,101,101, 96, 89, 22,231,207,157, 51, 86, +234,116,155,234, 42,231,205,239,191, 55, 84,215,189,163, 94,175, 25, 26, 25,185,120,204,152, 49,166,140,140, 12,176, 44,139,154, +150,172,194,194, 66,216,217,217, 65,167,215, 55,113,119,119,183,182,132,179,240,216, 49, 91,212,243, 92, 23, 8, 4, 79,186, 8, +255,140,118,255,239, 88,176, 24,134,129,143,143,207, 99,121, 70,170, 3, 7,171, 45, 67, 22, 90,174, 0, 0, 74,165,242,103,134, + 97, 78,142, 25, 51,102,110,219,182,109, 39, 77,159, 62, 93,224,239,239,143,138,138, 10, 56, 57, 57,193,205,205, 13,153,153,153, +216,191,127, 63, 91, 94, 94,254, 19,203,178, 11, 10, 11, 11,139, 44,224, 61, 15, 96,208, 75, 47,189,180,231,253,247,223,119,232, +222,189,187,168,122, 0,188,119,239, 30,142, 29, 59,102,218,189,123,183, 74,175,215,143,178, 36,139, 59, 0,228,231,231,159, 2, +240,202,184,113,227,118, 12, 27, 54,204, 78,175,215,139,210,211,211, 97, 52, 26,193, 48, 12, 74, 75, 75, 77,209,209,209,149, 90, +173,118,116,213,190,245,241,221,204,207,207, 15, 53,153, 76, 99,111,221,186,181,232,149, 87, 94,113,233,212,169,147,152, 97, 24, +196,196,196, 20, 69, 68, 68,184,171, 84, 42,211,229,203,151, 75,244,122,253, 28,165, 82,105,209, 82, 57, 20, 69, 65,165, 82,193, +213,213, 21,122,189, 30, 28,199,193,104, 52,194,206,206,238,209,242, 70,132,144,135, 55, 71,195, 93,132, 96, 24, 70, 96, 54,155, +241,218,107,175,129,227, 56,172, 94,189, 26, 12,195, 8, 26,202, 99,107,107,123, 35, 62, 62,126, 80, 88, 88,216,163,242,208, 52, + 13,154,166, 33,149, 74,225,234,234, 10, 23, 23, 23,156, 57,115, 6, 52, 77,223,176,144,246, 78,113,113,113,187,147, 39, 79,118, +186,115,231,206,155, 0,218,152, 76,166, 38, 44,203, 82, 52, 77,231,177, 44,123,183,178,178,114, 19, 44, 92, 42,167,176,176,112, +209,216,177, 99, 35,118,237,218,101, 43, 20, 10, 31, 93, 47,154,166, 33, 22,139,225,234,234, 10,153, 76,134,230,205,155, 67,167, +211,225,243,207, 63, 87,105,181,218, 69,255,166, 7, 66,215,206,221,112,238,196, 78,235,109, 91,183,171, 89, 22,116, 85, 42,134, + 71, 8,241,135, 96,235,230,245, 18,153, 80,239,212,181,115, 55,139, 92, 43, 70, 19, 83, 50,106,194, 79, 62, 85, 75,229, 44,202, +200,204, 90,181,243,167,183,211, 0, 96,197,234,141, 1,217,169,166,233, 9,247,147,135,172,221, 24,221,209,104, 98, 44, 90, 0, +247,127,162,101, 71, 5, 8,244, 74,165,242, 42, 69,201,253,186,190,101,154, 19,220,140,122,185,160,132, 83, 80, 20, 53, 85,169, + 84,166, 89, 90,247, 78,157,186, 35,250,244, 46,108,219,178,163,130,226,160,175,190,255,246, 1,100,223,252, 11, 4,184, 80,189, +171,102,242, 43,248,114,206,140, 73, 31,171,212, 21, 43,215,254, 88,183,219,164,117,155, 23,208,186,205, 11,152, 50,245, 51,135, +208,176, 16, 95, 0,216,183, 15,108,152, 95,194,225,185, 11,230,191,188, 96,238,124,168,180, 6, 84, 47,171,115, 63, 41,225,104, + 90, 58,140,252,240,244, 63,204,101,152,171,248,244,211, 22,250,138, 10,183, 46, 51,103,186, 10,151, 45,163,171, 95,160,159,180, + 96, 61,178, 94, 53,128,243,196,217,179, 71, 63,253,228, 19,197,242,101,203,250, 45,249,230, 27,171,150, 45, 91, 34, 63, 63, 31, + 33, 33, 33,144,203,229,136,137,137,193,169,227,199, 53,149, 58,221, 28, 79, 79,207,181,121,121,121,181,114,206, 7,174, 10,231, +204,105,110,212,104, 60,150,111,222,252,160, 87,159, 62, 5,155, 54,109,106,210,191,127,127, 90,171,213,162,162,162, 2, 21, 21, + 21, 48, 24, 12, 16,139,197, 80, 42, 20, 92,174, 66,113, 55, 59, 59,123, 83,157,229,252,232,163, 22,218,210, 82,183, 46, 51,103, +186,154, 75, 74,100, 31,103,102,230,210, 91,183,126, 51,105,226,196, 79,166,127,244,145,180, 73,147, 38,148,193, 96,120, 36,180, +204,102, 51,172,172,172,204, 12,195,184, 0,208, 90,194, 41, 59,122,148, 41, 41, 41,129,179,179,243,163,180, 75, 52, 77, 67, 38, +147,193,201,201, 9,149,149,149, 32,132,240, 9,112, 27,226,145,121,218, 63,130,131,131,111, 8,133,194, 38, 53, 77,132,181,173, +109, 87,243, 59,195, 48,185,241,241,241,145, 79, 40,220, 90, 77,159,114,185, 60,128,227,184,175, 59,117,234,244,202, 59,239,188, + 67, 93,184,112, 1,103,207,158, 37, 10,133, 98, 31, 77,211,115, 20, 10, 69, 90, 29,111, 54,181,114, 58, 57, 57,217,217,217,217, +125,104, 99, 99,211,167, 58, 21,131, 76, 38,187,167,209,104,206,168,213,234,213,117,100,111,127, 42,167,159,159,159, 61,199,113, + 31,216,216,216,244, 45, 46, 46,110, 11, 0,174,174,174,183, 53, 26,205,105,154,166,215,212,177,128,244, 83, 57,189,188,188,172, +108,109,109, 23, 57, 59, 59,191,241,206, 59,239,184, 92,184,112, 33,239,246,237,219, 98,149, 74,181,147, 97,152,186, 22,123,254, + 3,103,203,150, 45, 31, 91,139,240,121,182, 17, 0,180,110,221,250,200,224,193,131, 7,190,241,198, 27, 48,155,205,248,233,167, +159,112,234,212,169,163,169,169,169,131,234,121,251,124,140,211,195,195,195, 85, 46,151, 71,143, 30, 61,186,233,208,161, 67,173, + 29, 28, 28, 32, 16, 8,160,209,104,144,150,150,134,123,247,238,145, 83,167, 78, 85, 38, 36, 36,228,234,116,186, 30, 5, 5, 5, +197,150, 94,207,103,124, 75,126,140, 83, 40, 20,118,247,241,241,217, 61,111,222, 60,187,190,125,251, 90,185,184,184, 64, 40, 20, +130, 97, 24, 20, 20, 20, 32, 46, 46, 14,199,142, 29,211,252,242,203, 47,154,146,146,146,215, 80, 99,212,253, 43,203,249,188, 57, +171, 51,185, 63,214,183, 66, 91, 38, 36,101, 96,241, 99,219,252,240, 81, 66,124, 66,171,154,150,171, 26,153,220, 45, 42,103, 84, + 23,199,168, 87,134,182,239, 3, 0,251, 15, 94, 63, 83,207, 98,207, 79,150,243,139,132,248,164, 39, 22,155, 14,185,159,152,142, +133,141,174,187, 31,230,198,197, 37, 60,198, 25, 30, 30,122, 63, 49,227,233,217,233,159, 52,244,214,122,111, 86,199,139, 61,190, +103,118, 98,230,255, 92,160, 45,155, 97,208,144, 87,134, 13,252,108,214,108,124,189,100, 49, 14,237, 63,112, 52, 49,243,209,114, + 62,255,200,190,244, 39,114, 82, 95, 9,133, 47, 88,123,121,117,219,229,234, 58,251,228,233,211,182,213,241,181,213, 49,146, 79, + 78,184,138,136,136, 40,188,115,231,142,135, 37,156,131,190,251,206,164,183,179,147, 46,249,233,167,238, 90,163,177,251,199, 31, +127, 44,188,113,227, 6,118,239,220,201,232,114,114,118,228,179,236, 7, 79,241,126,252,161,238, 95,137, 68, 29,101, 46, 46, 61, + 90,204,158, 45, 93,178,103,207, 56,121,147, 38, 30,131, 6, 15, 22, 11,133, 66,104, 52, 26, 40,149, 74, 92,142,137,209,103,101, +103,199,233,245,250, 97,185,185,185,121,150,214,125,208,119,223,153, 28, 3, 2, 96,235,225,193, 93,186,124,217,113,230,188,121, +147, 60,188,188, 28,186,116,237, 42,178,182,182, 70, 89, 89, 25,178,179,179,113,233,210,165,194,180,180, 52,111, 0,172, 37,156, +191,221,187,215,250,220,213,171, 35, 62,253,244, 83, 73, 72, 72, 8,236,236,236,160, 82,169,144,152,152,136,203,151, 47, 27,246, +236,217, 83,161,209,104, 38,229,230,230,254,246, 39,182,251,127, 67, 96,253, 85, 55,158,135,135, 71, 36, 77,211, 95, 84,185,163, + 22,214,183,166,223,191,233,161,227,233,233,233,235,228,228,180, 94,167,211, 17,131,193, 48, 49, 63, 63, 63,251,111, 88, 78, 97, +100,100,228,143,133,133,133,157, 8, 33,112,112,112,184, 18, 31, 31,255, 30,234,246,197, 63,141, 83,224,233,233,217,201,198,198, +166,163,141,141, 77,119,147,201,212,178, 42, 14, 47, 81,171,213, 94, 48,155,205, 87,243,243,243,175, 84, 61, 16,254, 63,235, 46, + 0,208,215,219,219,251,109,142,227, 2,105,154,118,172,114,149,150, 19, 66, 82,202,202,202, 54, 2, 56,253, 55, 40,231,115,227, + 12,245,195, 48, 66, 33,228,177,135, 3,135,236, 39,131,215,171,131,225, 31,219,143, 32, 41, 33, 3, 7, 26, 80, 78,122,104,111, +183,229,192,195,153,134,168, 59,112,246,113, 49,100,129,104,105,176,192,106,138,177,181,114,102, 97,187,133,124,220,179,180, 81, +104, 83,116, 7,133, 78, 28,133,171, 73, 25, 56,247,111,124,214, 61, 79,206,175, 1,231, 95,130,130,174,208, 66,161, 39, 69, 81, + 52, 0, 80, 52,205,113, 0, 11,154,102,106,186, 5,159,120,161,172,147,211, 4,180, 18, 75,165, 77, 88,134,241, 40, 17,139,237, + 46,219,216,180, 51, 0,149,158, 44,251,197,217,210,210,251, 13, 45,231,124,192, 9, 64,168, 80, 42,245,189,108,109, 61,184,212, +201,169, 93, 25,195,120, 0,224,164, 82,105,124,165, 86,187, 41, 39, 39,103, 99, 45,158,138,122,203, 41,146, 74,125, 88,134,241, +160, 0, 66, 11,133,133, 39,165, 82,159, 34, 55,183, 55,181, 58, 93, 83,169, 84,106, 6,160, 50,153, 76,163,115,114,114,206, 54, +132, 51, 91, 32, 8,189,107,103,215,149,181,183,119, 49, 1, 54, 38,142, 51,153,204,230, 28,131,193,112, 79, 32, 16,172, 84, 40, + 20,169,127,114,187,243,104,224, 77,194,115,242,156, 60, 39,207,201,115,242,156, 60,231,159,204,233,238,238,110,237,233,233,233, + 91,245,146,248, 79,172,251,191, 10, 66,254, 18,240,224,193,131, 7, 15, 30,255,124, 20, 22, 22,106, 81, 75,204, 21,143,255, 31, +212, 53,251,165, 33,166,191,198, 40,217, 56,158,147,231,228, 57,121, 78,158,147,231,228, 57,255,115,156,245,113,243,174,199, 63, + 73,120,241,156, 60, 39,207,201,115,242,156, 60, 39,207,249,223,227,252, 87,129,230, 47,193, 83,225, 81,245,121,222,251,242,248, +119,247,133, 39, 33,175,250, 52,100,127, 47,254,146,243,224,193,131,199, 63, 27,255, 31, 49, 88,213, 3, 85,193,115,218,239,121, + 31, 11, 0,139, 41, 10, 51, 0,128, 16, 44, 5, 48,251, 89,246, 37, 79, 89,209,253, 73,132,133,133,185, 82, 20,213,219,193,193, +161,149, 90,173,142, 35,132,156,190,119,239, 94, 9,101,225,250, 79, 62, 62, 62,126, 50,153,108, 28, 69, 81, 45,171,206,155,168, +215,235,183,230,228,228,100, 60,135,118,163, 0,188, 43,149, 74, 95,117,116,116, 12, 44, 43, 43, 75, 49, 26,141,191, 0, 88,135, + 70,100,156,246,242,242, 10, 2, 48,150,227, 56, 33, 77,211,187,242,242,242,238, 88,122,172,123,216,144,189, 4,104, 1,128,230, + 40,110, 4, 77,232,125, 0, 56, 10,120, 80, 24,127,232,213,231,220, 95, 27,210, 23, 30,127,123,161,233, 37,132,112,159, 2, 0, + 69,209,203, 88,150,253,172,174,253, 5, 2,193, 10,194,113, 31,128, 2,161, 40,122, 25,199,113,179,248, 71, 20, 15, 30, 60,120, +252, 7, 32,151,203, 7,120,121,121,237,240,242,242,218, 33,151,203, 7, 88,112, 72,120, 45,131, 21, 75, 81, 96,129,199,243,235, + 52, 96,191,250,204,146, 53,143, 93,110, 97,213,106,114,122, 80, 20, 88, 82, 5,138, 2,231,238,238,190,222,219,219,123,245,147, + 31,119,119,247,245, 20, 5,174,198,190,108, 13,113, 23, 94, 83, 96,213,247,137,136,136,112,121,235,173,183,214, 40, 20,138,117, + 38,147,105,125,118,118,246,186,145, 35, 71,174, 9, 14, 14,246,180,164,238,254,254,254, 67,135, 12,125, 37,250, 98,236,141,251, +201, 41, 89,202,132,251,105,153, 39,207, 92,186,218,111, 64,212, 25,127,127,255,161, 13,104, 35, 10,192, 68,161, 80,120,222,214, +214, 54, 87, 40, 20,158, 7, 48, 89, 32, 16,252,182,120,241,226,204,248,248,248,130,152,152,152,242,232,232,104,197,132, 9, 19, + 82, 40,138, 58,140, 63, 90, 66,195,235,179,226,120,121,121, 45,200,201,201,185,145,151,151,119,179, 73,147, 38, 63, 60,193, 81, +155,213,231, 17,167, 91,216,144,187,133, 21, 38, 82, 88, 97, 34,110, 97, 67, 72,141,239,119, 27,216,165,235,235, 75,127,232, 11, + 54, 54, 54,193, 79, 8,121,143,167,112,254,225, 88,103,103,103,111, 66, 8,221,188,121,243, 14,114,185,252,123,185, 92,254,125, +243,230,205, 59, 16, 66,104,103,103,103,111,153, 84, 90,111, 95,122,142,224, 57,121, 78,158,147,231,252,187,113,254,119, 45, 88, +132,144, 55, 83, 82, 82,172, 57,142, 67,112,112,240, 24, 0,199, 27, 98, 85,162, 40,204,224,184,135,214, 28,154,166,102,246,236, +217, 43,194,202,202,234,177,140,197, 58,157, 78,114,254,252,185,222, 28, 71,168,170,253,102, 16,130, 53, 22, 90,163, 60, 40, 10, + 51,140, 70, 3, 45, 18, 73, 32, 16,208, 31,135,135,183,138, 44, 46, 46, 62,203,178,236, 79,181, 36,175,172,223,108, 67, 81,216, +180,105, 83, 75, 15, 15,143, 63,172,161, 82, 80, 80, 32, 30, 60,120, 80,131,248,222,108,213, 74,166, 79, 75,235, 74,139, 68,190, + 38,179,217, 21, 0, 68, 34, 81,137,204,214,214,231,243, 57,115,172,109,108,108,184,146,146, 18,168, 84, 42,106,202,148, 41,178, + 41, 83,166,244, 5,176,173, 46,206, 38, 77,154,248,135,183,110, 59,109,235,150, 45, 29, 43, 74, 75,245, 27, 87,174,189,101, 16, + 74,181, 77, 91, 6,137,191,152,247,149,195,130,185,179, 39,154, 76,166,184,220,220,220,244,250,140, 46, 0, 14,124,248,225,135, + 97,131, 6, 13,146,168,213,106,153, 86,171,109,182, 99,199,142,207,219,183,111,111, 27, 17, 17, 33,217,189,123, 55, 85, 94, 94, + 14, 66,136,117, 72, 72, 8, 25, 57,114,164,126,239,222,189, 83, 0,124,219, 16, 11, 16,203,178,162,234, 76,233, 12,195, 72,170, +250,162,201, 18,139, 17, 5, 60, 8,235, 50, 18,160, 16, 24, 31,243,139, 44,172,235, 72, 61, 8, 82, 40,224, 65,213,139,192, 59, + 28,199,249, 61,197,170,148,161, 80, 40, 54, 52,230,102, 25, 56,112, 16, 0,172,191,121,243,230,197,162,162,162, 38, 28,199,142, +182,212,178, 69, 81, 20, 37, 20, 10,199, 2, 88,162,211,233, 38,156, 61,123,182, 45, 0,244,238,221, 91, 12,224, 6, 33,164, 19, +254,252,188,116, 60,120,240,224,193,227,111, 42,176,196, 0,112,241,226, 69, 16, 66, 36,141, 56, 31, 85, 83,184,124,240,193, 7, +240,242,122, 60,220, 36, 47, 47, 15,209,209,231,159,165, 78,143, 13, 82,139, 22, 45,114, 40, 41, 41,121,121,211,166, 77,253, 0, +124, 94, 80, 80, 16, 93,207,241, 5,132, 96, 41, 77, 83, 51, 41,138,130, 68, 34,205,152, 56,113,226,141,170,250, 7, 28, 62,124, +216,122,240,224,193, 90,138,162,210, 0, 64, 34,145,186, 11, 4,180, 31, 33,164,122,160,125,170, 16,124,197,214, 54,152, 16, 50, +120,210,138, 21,108,187,168, 40,161,189,187,187, 0, 52,141,162,236,108,151,245, 63,252,208,233,254,169, 83, 82,207,144,144,108, +163, 68, 82,158,156,156, 12, 47, 47, 47,136,197,226,122,223, 18,172,173,173, 39,124, 56,253, 19,183,138,210, 50,157, 89,173, 54, +217,114, 44, 99, 47, 19, 81,170,162,146,242,140, 28,123,237,132,201,211,132,115,103,125, 52, 1,192,103,245, 80, 77,153, 62,125, +122,203, 14, 29, 58,200,247,236,217, 67, 85, 84, 84, 64, 40, 20,218,182,109,219, 22,145,145,145,236,217,179,103, 41,127,127,127, +132,135,135, 35, 38, 38, 6,151, 47, 95,166, 34, 34, 34,172, 15, 28, 56, 48,198,108, 54,127, 91,159,168, 22, 8,232, 89, 35, 70, +140, 28, 96,109,109,109,214,233,116,120,231,157,119,160,209,104,208,178,101,203,214, 61,122,244,136, 53, 24, 12,162, 67,135, 14, +134,179, 44,135,186,196,117,181, 27,176,202, 98,213, 10, 4, 41, 69,241,135, 90, 87,255,159,227, 56,191,251,247,239,135,150,151, +151,131,227,184, 71,107, 50, 2, 64,183,110,221, 26,210,151, 10, 8,193,210,193,131, 7,205, 4, 40,244,234,213,171,100,218,180, +105,108, 98, 98, 98,143,225,195,135,189,240,224, 65, 74, 93, 47, 1, 5, 20, 69, 47,163,105,106, 6, 69, 81,212,184,113,227, 11, +108,109,109,135,249,248,248,220,167, 40, 74, 40, 22,139,171,239, 3, 65,203,150, 45,221,194,195,195, 39, 59, 57, 57, 21, 10,104, +218,157,128, 16,138,162,151, 17,194, 21,240,143, 40, 30, 60,120,240,248, 15, 8, 44,138,162,138,111,223,190,237,165,215,235, 65, + 81,148, 37,214,160,184, 39, 6,156, 31,105,154,122,143,162, 40,132,135,183, 74, 95,189,122,117,109,235,109, 25,195,195, 91,165, + 11, 4,180, 63, 33, 4, 20, 69,175,125, 98,160,137,171,111, 64,148, 72,164, 51, 0,192,203,203,187,224,200,145, 35,230, 17, 35, + 70, 96,217,178,101,146, 89,179,102,125, 69,211,244,168,188,188,188,220, 58,202, 9, 0,179,221,220,220,157, 55,109,218,212,114, +226,196,137, 55,148, 74,229,135, 0,224,237,237,189, 26, 64, 43,138,162,210,106,108,195,186,117,235, 34, 39, 76,152,144, 88, 88, + 88, 56,251,105,156,175,216,217, 5,186,120,123, 15, 93, 30, 19, 67,132, 12, 67, 85,220,184, 81,158,155,159,111, 50,178, 44,125, + 60, 61,189,227,168,241,227,197, 30, 94, 94,228,208,186,117, 77,181, 34, 17, 97,101,178,138,248,248,120, 98, 50,153,238,213, 87, +119,138,162, 66,156, 28,157,108, 54,174, 88,123,195, 77, 42,160, 92,125,188, 41,177,189,163,144,182,181,147, 18,129, 64,215,212, +199,219,142,162,168,144,250,218, 72, 44, 22,143,233,215,175,159,245,238,221,187,169,240,240,112, 56, 58, 58,226,226,197,139,184, +125,251, 54,202,202,202,104,134, 97,208,190,125,123, 44, 93,186, 20, 62, 62, 62,168,168,168, 64,102,102,166,171, 88, 44,118, 51, +155,205, 79,187,158,143, 9,222, 25, 51,102,192,221,221, 29, 44,203, 34, 47, 47, 15,149,149,149,176,177,177,129,131,131, 3,148, + 74, 37, 14, 29, 58,104, 73, 95,178, 8, 47,190,248,162, 22, 64,230,147, 22,172,134,112,202,229,242, 83,133,133, 69, 93,123,246, +236,137,242,242,114,211,188,121,243,208,182,109, 91,180,104, 17, 84,111, 57, 89,150,253,204,213,213,117,179,139,139,203,138,105, +211,166,121,186,184,184,192, 96, 48,204, 41, 41, 41,193,140, 25, 51, 0, 0,145,145,145,173, 8, 33, 71, 39, 76,152, 0, 63, 63, + 63, 69,105,105,105,246,253,251,247, 39, 22, 22, 22,198,213, 88,226,232,207,152,178,204,115,242,156, 60, 39,207,249,119,227,252, + 87, 10, 44, 82, 99, 32, 36,120,138,171,130, 16, 82, 38,151,203,189,172,172,172, 64, 8, 41,107,232,201, 56,142,155,226,226,226, + 82, 56,123,246,236, 46, 65, 65, 65,198, 41, 83,166,196,101,102,102,206,169,185, 79,179,102,205, 22,125,255,253,247, 72, 78, 78, +206, 92,188,120,113, 76, 73, 73,201,194, 6,158,102, 22, 33, 88, 13, 0, 74,165,178,248,240,225,195, 29, 46, 92,184, 48,107,245, +234,213, 94, 83,166, 76,145, 76,155, 54,109,178, 5,150, 28, 8,133, 66, 93,109,110,193,218,224,225,225, 97, 18, 10,133, 79, 91, + 63, 16, 19,219,181,147, 18,142, 27,250,205,197,139, 28,151,155,171, 63,182,101, 11,150, 93,190, 60,201,193,213,213,215,205,205, +141,248, 53,105, 82,100,197, 48, 5,170,162, 34, 58,162, 95, 63,209,201,109,219,154, 74,253,252, 18,246,237,219, 87,201,113,220, + 41, 11,138, 80,105, 52,155, 13, 54, 62,222,230,193, 67,250,181,186,119,237,118,178,149,179, 51,221,170,125,219,208,164,148,204, +155, 20, 96, 4,234, 95, 60,214,193,193, 33,168,184,184, 24, 42,149, 10,110,110,110, 88,179,102, 13, 60, 60, 60,160,213,106, 17, + 31, 31, 79,154, 52,105, 66, 93,186,116, 9,222,222,222, 40, 42, 42,130,209,104,132, 86,171, 45, 52, 26,141, 79,171,123, 1, 77, + 11, 54,210, 52,245, 14, 69, 81, 8, 12,108, 81,240,237,183,223,154, 9, 33, 8, 9, 9,193,176, 97,195,112,241,226, 69,196,199, +199, 87, 91,153,204,126,126,254, 5, 52, 77,185, 63,236,110,117, 91, 4,235,233,107, 0,144,153,151,151, 55,187, 49,199,203,229, +114, 25,203,178,147, 2, 3, 3, 7,189,254,250,235, 38,177, 88, 12,173, 86, 91,125, 45, 76,253,251,247, 47, 25, 60,120,144,203, +209,163, 71,235, 44,103,113,113,113, 90,203,150, 45,223,249,228,147, 79,182,175, 93,187,214,241,179,207, 62,123,180, 8, 55,203, +178,224, 56,238,145,149,237,192,129, 3,200,200,200,248,186,176,176,144,127,112,241,224,193,227,191, 8,139,180,200, 63,209,130, +245,151, 84, 70, 32, 16,172, 59,117,234, 84,219,110,221,186, 9,123,247,238, 29,126,226,196,137,112,133, 66, 17, 87, 53,168,133, +247,238,221, 59,220,221,221, 29,107,214,172,209, 10, 4,130,117,141, 60,205,163,193, 46, 47, 47, 47,150,162,168, 47,126,253,245, +215, 77, 19, 39, 78,132,135,135, 71, 91,165, 82,249,151, 94,228,178,228,228,206,227, 22, 44,224,100,128,224,232,246,237,228,171, +152,152,111,246,254,242,139, 56, 32, 32, 0,132, 16,100,102,102,218,255,180,105,147,243,168,190,125,227,243, 53, 26, 42, 53, 63, +159, 77, 56,114,132, 46,161,233,239,210,210,210,138,107, 46,214, 92, 27, 76, 38,211,245,236,172,172,160,206, 93, 59,123, 93,188, +145,112,107,248,208, 65, 61,105, 33, 77,103,100,229, 93,119,115,113,182,185,124, 37, 70,101, 50,153,174,215, 87, 78,141, 70,147, +193, 48,140, 51, 33,196, 45, 58, 58, 26,174,174,174, 40, 43, 43,131,217,108,134,201,100, 50,106,181, 90, 89, 82, 82, 18, 12, 6, + 3, 12, 6, 3,236,237,237,113,239,222,189, 2,134, 97,206, 61,141,147,101,217,119, 1, 44, 32,132, 32, 57, 57, 89, 81,229,250, +108,225,232,232,184,147, 97, 24, 40,149, 74, 68, 71, 71,143,206,203,203, 75,174,169,111,170,254, 42, 26,125,151, 18,210,232,246, +114,115,115, 11, 23,139,197,179,167, 78,157,234, 17, 22, 22, 6,189, 94, 15, 0,176,181,181,133, 86,171,133,189,189, 61, 58,117, +234,148,184,112,225, 66, 19, 33, 24, 7, 32,191, 46,190,196,196,196,162,160,160,160,169, 19, 39, 78,252, 50, 40, 40,200,159, 16, +130,192,192, 64,244,235,215, 15,199,142, 29,195,131, 7, 15,160,209,104,216,107,215,174,237,206,201,201, 57,194, 63, 99,121,240, +224,193,139,172,127,143, 5, 11, 85, 21, 34,127,246, 9, 11, 11, 11,139,146,146,146, 78,220,188,121,115,208,171,175,190,138,232, +232,232,113, 0, 62, 2, 0,169, 84, 58,238,213, 87, 95,197,205,155, 55,145,148,148,116,162,176,176,176,232,121,156,147,162, 40, +173,209,248,208,128, 35,147,201,172, 26, 56, 80, 7, 84,185, 6, 65, 8, 9,120,218,182,122,172, 97,190, 47, 14, 27, 70, 87,222, +190, 93,190,224,228,201, 15,119,253,250,171,216,199,199, 7,106,181, 26, 2,129, 0,246,246,246, 84,191,168, 40,167,141,187,118, +121,250,216,217, 93,158, 60,126,252,253,175, 79,159,214, 94,174,168,176, 40,189,130, 94,175,223,180,104,225, 23, 61,183,239,216, + 27, 18, 28, 18,232,116,236,212,249, 91, 46, 46,246, 86,126,126, 1,210,138,242,114,195,247,171,151, 9, 53, 26,205,230,250,120, +116, 58,221,129,179,103,207, 14,245,241,241,113,139,139,139,131,209,104, 4,203,178,232,211,167, 15, 8, 33, 82, 0,156, 80, 40, + 68, 98, 98, 34, 76, 38, 83,225,131, 7, 15, 20,169,169,169, 82, 0, 75,234,161,126, 76, 40,209, 52, 61,106,208,160, 65, 96, 24, + 6,253,250,245,195,193,131, 7, 95, 5,240,229,211,246,127, 6, 11, 86, 51, 47, 47,175,197, 85,231,180, 40,184,221,211,211,179, + 75,243,230,205,191, 92,190,124, 41,229,225,225, 5,150,101, 96, 54,155, 80, 84, 84, 2,181, 90,141,208,208, 80,248,250,250, 98, +201,146, 37, 0,112,176, 62,113, 85,141,228,228,228, 20, 0,175,141, 31, 63, 94,124,241,226,197, 72,189, 94,191,170,111,223,190, +184,117,235, 22,238,220,185,243,134,187,187,123,161,143,143, 15, 35,151,203,223,161, 40,202, 94, 38,147,237,122, 30,215,129, 7, + 15, 30, 60,254, 97,248, 75,180,200, 95, 45,176,234,172,152,187,187,187,117, 89, 73,225, 7,126,126,126, 50, 0,144,138, 5,189, + 92, 92, 92,190, 46, 41, 41,169,108,232, 73,181, 90,237,222, 29, 59,118,188,180,114,229, 74,113, 84, 84, 84,243, 95,127,253,181, + 3, 0, 68, 69, 69, 53,183,179,179,195,142, 29, 59, 76, 90,173,118,239,243,170, 36,199,113,253,218,183,111,143,210,210, 82,100, +102,102,222,104,200,177,135, 15, 31,182, 6,208,170,190,109,117,193,104, 54,187,217,123,121, 9, 11, 46, 94, 52,233, 24,198, 55, + 40, 40, 8,106,181, 26, 18,137, 4, 6,131, 1, 25, 25, 25, 16,139,197,212,131,244,116,215, 89, 31,125,116,201, 42, 40,200,182, +122,134,161, 37,200,203,203,211, 1,152,246,213,162,175,118, 46, 95,182,204,189,180,164, 44, 89, 44,177,210, 91, 91, 73,157,103, +126,178,144, 20, 20, 20,124, 92,181, 70, 85,125, 88,178,115,231,206,254, 47,189,244,210, 93, 31, 31, 31,247,226,226, 98, 79,149, + 74, 69, 74, 75, 75,169,170,190, 65, 1,192,221,187,119,145,149,149,197,176, 44,123, 9,192, 2, 88,224,126,124,100,154,146,203, +157, 58,116,232,208,223,197,197,229,145, 43, 50, 34, 34,162, 63,128,239, 20, 10, 69,217,243,236,220,167, 78,157,178,230, 56, 46, + 20, 0,250,247,239,111,169, 24,127,115,212,168, 81,148,149,149, 13, 24,134,129, 84, 42,134, 84, 42,133,173,173, 61,156,157,157, +145,149,149,133, 94,189,122,113,233,233,233,135,172,173,173,183, 52,180, 76,231,207,159,127,185, 67,135, 14, 31, 77,158, 60, 25, +102,179, 25, 67,135, 14,133, 66,161, 88,158,145,145,177,199,211,211,115,244,156, 57,115, 92, 93, 92, 92, 48, 99,198, 12, 43, 0, +243,249,103, 45, 15, 30, 60,120,145,245,239, 16, 88, 79, 27, 20,219, 59, 57, 57, 77, 41, 44, 44,148, 85,187, 94, 40,138,146,181, +105,222,124,157, 88, 44,254, 49, 47, 47,239,114, 67, 78, 90, 94, 94,174, 74, 79, 79, 63, 20, 27, 27, 59,114,248,240,225, 56,125, +250,244, 88, 0, 24, 62,124, 56, 98, 99, 99,145,158,158,126,168,188,188, 92,245, 60, 42,232,237,237,253, 74,143, 30, 61,198,118, +232,208, 1,135, 15, 31, 6,203,178,231, 26,114,124,205, 25,131,181,205, 34,172,222,102, 9,151,228, 97,158, 35,176, 44, 11,129, + 64, 0,189, 94,143,188,188, 60,220,191,127, 31,246,246,246, 40, 43, 45,165,236,157,157, 77, 6,131,129,109,104, 61,243,242,242, +114,111,223,248, 61, 85,167,215,139,156, 92,156,181,118, 54, 18,162, 82,171,233,187,119,111,229, 21, 22, 22,102, 90,170, 5, 9, + 33,221, 79,158, 60, 57, 87, 32, 16,188, 42,151,203, 49,114,228, 72,170,119,239,222,144, 72, 36,208,233,116, 40, 47, 47,175,190, +142,254, 0,224,234,234,234, 97,109,109,189,159,166,233,130,140,140,140, 9,245,157,128,101,217,225, 67,134, 12, 17,154,205,102, + 44, 92,184, 16,243,231,207,199,128, 1, 3,132,215,175, 95, 31, 14, 96,195,243,234,216,132, 16,188,244,210, 75,143,130,220,159, + 8,110,175, 21,221,187,119, 23,166,167,167, 7,200,229,114,100,102,102,194,218,218, 26, 30, 30, 30,112,116,116,132,171,171, 43, + 86,174, 92,137, 85,171, 86,221, 17, 8, 4,107,243,242,242, 82, 27, 90, 38, 95, 95,223,119,198,140, 25,243,206,200,145, 35,161, + 86,171, 17, 27, 27,139,206,157, 59, 99,241,226,197,158, 49, 49, 49,211,219,183,111, 15,161, 80,136, 11, 23, 46,128,101,217, 28, +254, 25,203,131, 7, 15, 30,255,124,129, 69, 61,161, 28, 1, 0,142,142,142,246, 50,153,108, 98, 84, 84, 84,151,161, 67,135,162, + 95,191,126,143, 29,188,102,205, 26,219,232,232,232,153,223,126,251,109,119, 0,107,149, 74,101,105, 3,172, 74, 7,118,238,220, + 25,245,226,139, 47, 90,247,236,217, 51, 0, 0,164, 82,169,113,231,206,157, 90,142,227, 14, 52,162, 46,143,101,111,151,203,229, +237, 5, 2,193,184, 1, 3, 6,180,127,235,173,183, 16, 31, 31,143, 29, 59,118, 36, 6, 5, 5,157, 46, 40,176, 60,110,250,137, + 25,131,181,205, 34, 92, 93,159, 53, 75, 34, 18, 21,169,242,242, 92,132, 94, 94, 18, 27,137, 36,231,250,245,235, 1,205,155, 55, +167,210,211,211,145,156,156, 12,147,201,132,219,183,111, 19, 26,200, 21,216,219,211, 89,119,239, 82, 98,145,168,193, 57,187,172, +196, 92,187,207,103,188, 27,168,215,235, 66, 43, 42, 42, 24,161, 80, 40,148,138,216,244, 6,210, 24,124,124,124,134,176, 44,235, +106, 52, 26,205, 30, 30, 30,162, 51,103,206, 64, 34,145,224,225,236,207,112, 72, 36, 18,163, 92, 46, 87, 3,128,173,173, 45,189, +120,241, 98,209,244,233,211,227,235, 35,142,136,136, 16, 73, 36,146, 81, 65, 65, 65,184,114,229, 10, 18, 18, 18,210,174, 92,185, + 18,208,174, 93, 59,248,248,248,140,242,242,242,218,122,235,214, 45,243,243, 18, 88,104, 96,144,251,133, 11, 23, 56,111,111,111, + 80, 20, 5,129, 64, 0,173, 86,139,244,244,116,116,234,212, 9,155, 55,111,198,234,213,171,127,206,207,207,223,210,152,242,140, + 31, 63, 94,220,186,117,235, 55, 71,142, 28,137,180,180, 52, 44, 89,178,164, 36, 63, 63,255,252,201,147, 39,135, 79,158, 60, 89, +208,185,115,103, 20, 23, 23, 99,235,214,173,204,173, 91,183,182, 68, 69, 69,109, 95,191,126, 61,255,132,226,193,131,199,127,205, +114, 85,219,247,127,151, 5,203,219,219,123,160, 76, 38,123,123,212,168, 81,130,224,224, 96, 20, 20, 20,192,206, 70,106,164, 40, + 74, 2, 0,118, 54, 50,163,217,108,198,228,201,147,209,182,109,219, 14, 51,103,206,108,207,178,236,207, 5, 5, 5,251, 45, 57, +113, 97, 97,161,150,166,233,125,239,189,247,222,146,219,183,111,249, 3,192,181,107,215,210,149, 74,229, 44, 11,221, 89, 53, 81, +157,156,146,146,201,172,238, 6, 6, 6,150, 68, 70, 70, 58, 13, 27, 54, 12,174,174,174,184,117,235, 22, 22, 47, 94, 28,175,215, +235,167, 92,184,112,129,249,171, 47, 50,195, 48,217, 87,143, 28,113,122,105,244,104,167,133,163, 70,125,255,214,248,241, 75,191, + 94,188, 88, 44,151,203, 41,123,123,123,220,185,115,135,108,220,176,193,180,103,217,178,239, 5, 86, 86,226,139, 7, 15, 74, 88, +179, 57,165, 33,231,144,203,229,221,219,119,236, 16,190,124,229,183,208,105, 43,113, 45,246, 8,202, 74,139,177,110,195,175,173, +228,114,121,119,133, 66,113,161, 1,229, 13,216,183,111,223, 67,113, 40,145, 96,193,130, 5,240,246,246,134,189,189, 61, 42, 43, + 43,241,238,187,239, 74, 62,248,224, 3, 0, 64, 66, 66, 2,108,109,109, 45,181,178,245,156, 56,113,162,189,217,108,198,241,227, +199, 13, 44,203, 78, 59,125,250,244,129, 54,109,218, 72,187,117,235,102,191,125,251,246, 94, 0, 78,254, 63,222, 15, 28, 33, 36, +251,212,169, 83,190, 35, 71,142,132, 88, 44, 70, 89, 89, 25,236,236,236,176,124,249,114, 98, 50,153,246, 55,150, 88,161, 80, 72, + 92, 93, 93, 37, 44,203, 98,223,190,125, 80,169, 84, 19,114,115,115,243,155, 55,111,126, 96,230,204,153, 31, 7, 6, 6,250,165, +164,164,100,177, 44,187, 76,161, 80,100, 0, 0, 47,176,120,240,224,193,227, 95, 40,176, 0,188,113,226,196, 9, 1,199,113, 88, +191,126, 61,110,222,188, 73,108,237,157, 63,180,115,160,182,217,219,219,179,229,229,229,111, 44, 93,186,116,232,220,185,115,169, +174, 93,187, 34, 54, 54,150,242,247,247, 31, 14,160,230, 32, 20,142, 58,114,101, 84, 84, 84, 92, 47, 40,200,247,175,145,181,221, + 95, 42,149,213, 55,219,237, 73,206, 39,147, 89,182, 89,180,104, 81,156,187,187,187, 57, 46, 46, 14,107,215,174,229,110,222,188, +121, 20,192,242,194,194, 66,157,133,156,207, 3,143, 56,157,130,130, 46,111,158, 61, 59,226,197,151, 95, 38,189, 94,125,149, 91, + 33,145,124,242,197,188,121,211, 74, 85, 42, 31,142,227,224,226,224,144,253,243,162, 69, 43, 59,119,237,170,187,247,251,239, 54, + 49,191,253,102,229,209,172,217,165,134,148, 83,161, 80, 92,136,142,190,132,173, 27, 86,194,100, 50, 32, 79,145, 5, 0, 40, 46, +169, 64, 61,226,234, 15,156, 52, 77,151,143, 27, 55,206,218,104, 52, 82,163, 70,141, 18, 21, 22, 22,162,121,243,230, 0, 0,149, + 74,133,163, 71,143, 34, 36,228, 97, 90,173,123,247,238, 61,250, 94, 95, 57,173,173,173, 95,237,210,165, 11, 50, 51, 51, 17, 31, + 31,127,172,176,176,176, 40, 33, 33,225, 88, 86, 86,214,240,200,200, 72, 28, 56,112, 96,100, 29, 2,171, 65,109, 84,157, 88,180, +129,125, 9, 12,195,204, 60,112,224,192,196,216,216,216,238, 31,125,244, 17,213,187,119,111, 0,128, 70,163, 97, 45,140, 55,124, +106, 57,171,221,195, 28,199,193,199,199, 71, 3, 0,169,169,169, 25, 0,222,111, 44,231,243,232,159, 60, 39,207,201,115,242,156, +127, 19,206,255,140,192, 98, 56,142, 67,116,116, 52,126,253,245, 87,214,104, 52,206,206,207,207,191, 95, 53,152, 3,192,150,219, +183,111, 95, 26, 62,124,248,138,228,228,100, 65, 66, 66, 2, 8, 33, 13,138, 29,210,235,245,230, 39, 51, 16,232,245,250,103,118, + 17,109,222,188, 25,249,249,249,198,172,172,172,223, 76, 38,211,142,146,146,146,188,198,114, 61,143, 89,132,235,110,222, 52,188, + 98,103,119,112, 86,207,158,195, 23,158, 56, 33, 27, 48,126,188,177, 71,255,254, 95,195,104, 52,138, 68, 34, 14, 86, 86, 2,129, +149,149, 56,225,247,223,109,150, 79,154,228, 66,209,244,161, 31, 18, 18,116, 13,181, 96,245,232,209, 21,227,222,158, 14,157,174, + 18,191, 95, 57,130,242,210, 98,196, 94, 79,134,193,132, 6, 89,176,132, 66,161,175,217,108,150, 50, 12,163, 32,132,224,205, 55, +223, 4,203,178,208,235,245, 80,171,213, 40, 45, 45,213, 79,157, 58,149,174, 18, 77,120,233,165,151, 44,202,234, 31, 16, 16,224, + 43, 20, 10,113,242,228, 73, 8, 4,130,253, 15, 5,177, 96,255,217,179,103,135,143, 26, 53, 10,114,185, 60, 40, 45, 45,173,222, +224,198, 71,139, 61, 83, 8, 4, 0, 80, 8,116, 11, 27,114,183,122,177,103,154,166, 51,218,182,109,107, 81,220,213,147, 40, 42, + 42, 42,196,195,192,253, 95,102,204,152, 49,185, 67,135, 14,225, 95,126,249, 37, 0, 8,158,217, 60,198,113, 96, 24,230,153, 82, + 72,240,224,193,131, 7,143,127,184,192,162, 40,106,119,207,158, 61, 95, 35,132, 8,104,154,222, 81, 45,174,106, 34, 55, 55, 55, + 93, 46,151,175,247,243,243,123,189,202,242,177,171,129,231, 47, 32, 4,223,208, 52, 85,115,237,185,130, 70,112, 44,173,226,160, +132, 66,209,142,171, 87,175,126,166, 84, 42,243, 1,176,207,122,129,158,199, 44, 66, 0,216,175, 86,167,188, 98,107,123,104,114, +155, 54,131,135, 78,155, 70, 34,251,246,117,240,108,214,140, 97,204,102, 54,237,238, 93, 42,230,192, 1,113,204,111,191, 89, 9, + 40,234,240,126,141,230,126, 67,203,169, 80, 40, 46,156, 59,127,225,212,136,225, 81, 47, 5,248,121, 3, 0,210, 50,148, 40, 46, +173, 56,213, 16,113, 5, 0, 89, 89, 89, 6, 0, 6, 79, 79,207,225,123,247,238,221, 71, 81, 20, 85,115,185, 25, 0, 6,161, 80, +216, 2, 0,212,106,117,211, 3, 7, 14,236, 20, 10,133,185,245,241, 38, 36, 36,236,158, 55,111,222,232,244,244,244,223, 20, 10, + 69,106, 85,185, 83, 47, 93,186,180, 86,169, 84,142,206,202,202,218, 14, 11,102,142, 16,160, 69,124,204, 47,173, 0, 32,172,203, + 72,196, 15, 89,161,117, 0, 0, 32, 0, 73, 68, 65, 84,199,252, 34, 3,208, 42,172,203,200,234,107,241,204,193,242, 85,121,185, + 62,184,118,237,218,139,253,250,245, 27, 71, 8, 41,124, 22, 62,153, 76,102, 54, 24, 12, 12,203,178, 66,147,201, 68,100, 50,153, +153,127,252,240,224,193,131,199,191, 23,127,118, 16,153,165, 38,196,199, 2,212, 27,201,217, 16,142,122, 57,189,188,188,166, 80, + 20, 21, 96, 41, 1, 33, 36, 45, 47, 47,239,251,218, 56, 9,121,232,190, 4,158,190,216, 51, 49,155,179,100, 1, 1,151,126,190, +119, 79, 95,139,216,229, 26,114, 61, 3, 3, 3, 73, 74, 74,138,165,237, 91, 39,167, 92, 46,151, 9,133,194, 39, 45, 84,134, 42, + 17, 86,179, 31, 9, 0, 48, 13,108,247, 70,181,209, 35, 11, 22, 64,115, 20, 55,130, 38,244, 62, 0, 92,181, 5,235, 79,232,159, +141, 42,103,205,118, 7,128,128,128,128,247, 66, 66, 66, 70,223,189,123,119,111, 78, 78,206,154,122,111,206, 6,182,251,159,116, +111,242,156, 60, 39,207,201,115,254, 85,156,245,141,179,237, 1,184, 85,253,172,206,147,233,246,196,119, 35,128,154, 99, 86,245, +239, 34,138,162,174,215,224,120,180,221,130, 99, 1,160, 24,192, 93,138,162,140,248,155, 32,156,231,228, 57,121,206,255,161,123, +247,238, 66,254,122,242,156, 60, 39,207,201,115, 54, 92, 92, 17, 66, 6,226,161,151,131, 16, 66, 6, 86,255,126,242,123,245, 62, + 53,127, 87,253,197,147,251, 89,114, 44, 0, 50,107,214,172,217,132,144,158, 13, 41, 51, 13, 30, 60,120,252,101,248,255,152,197, +202,131, 7, 15, 30,255, 2,184, 81, 20,117,132, 16, 50,136, 16, 50,136,162,168, 35,117,136,177, 65, 53,255,214,133,218,120,170, +207, 81,243,247,146, 37, 75,190, 6,208,160,149, 96,132,117,168,208,134,152,254,194, 27,241,191, 56,158,147,231,228, 57,121, 78, +158,147,231,228, 57,255,115,156,207,235,248,103, 70,109, 98,173, 90,200,213,252, 61,107,214,172,207,208,128, 85, 75,254, 10,240, +230, 83,158,147,231,228, 57,121, 78,158,147,231,228, 57,159, 85, 8, 61,213,165, 87,151,187,240,201,239,150,184, 8,235,218,183, + 33,101, 22,130, 7, 15, 30, 60,120,240,224,193,227,239,141,162,154,214,166, 42, 11, 19, 59,107,214,172,207,170,183, 85, 89,153, + 12, 0,164, 79, 30,252,196,113,117,162, 33,251,242, 2,171, 17,104,211,156, 94,232,235,235, 30, 89,117,145, 65,170, 82, 20,112, + 85, 89, 4, 72,117, 50, 35,194,129,112, 4,202,188,242,155,247,210,241,197, 83,148,119,189,177,110, 93,187,122, 58, 11,116,149, +171, 88,142,237, 12, 0, 20,232,139, 34,145,227, 71,103,175, 41,202,107,204, 38,171, 19, 33, 1,104, 41, 19,226, 83,142, 67,107, +138, 2, 40, 10,119,245, 12,150, 37,165, 33,241, 57, 92, 18, 42,204, 31,239, 74,164,214,163, 28, 28,157, 2,203, 74,138, 31,152, + 76,134, 95, 18, 50,176, 14,141, 88,148, 51, 56, 0,109,193, 98, 38,203, 65, 36,164,177, 42, 41, 19, 49,124,175,227,193,131,199, + 95,100, 13,121,166,248,227,218,158,201,132, 16,234, 25, 57,249, 4,121,117, 95,159,235, 85,129,238,213,162,167, 8,192,189,197, +139, 23,151, 45, 94,188,184,230,182, 59, 0,218, 84,237, 87, 84,139, 80, 50, 86,253, 54,214,178,143,209,146,125,255, 20,129, 21, +218, 4,147, 65, 48, 31, 20, 8,128, 47, 19,114,177,182, 65,199, 55, 71, 31,153, 80,176, 17, 4, 2,189,153,253,152,176,184, 88, +235,133, 20,160,155, 76, 36, 88, 1, 10,156,158, 97, 39, 36,164,226,140,165,231, 8, 11, 68,127, 33, 69,111,231, 56, 34, 98, 57, +178, 13, 28,142,216,154,113,249,119, 5,244, 13, 41,171,175,175,123,228,193, 51,121, 47,157,223, 61, 13, 29,219, 6,130,112,102, +128, 48,176, 14,249, 20,103,127,126, 19, 29, 91,249, 62,220,198,153, 97, 27,177, 2, 3,186, 56,144,123,233,141, 91,159,186,107, + 87, 79,103, 43,142,187,187,118,211,118, 79,223,192, 23, 41,194, 25,144,114,251,248, 27, 31,204,152,211,179,119, 7,121,107, 0, +245,174,241,216, 58, 16,111,251,250, 6,127, 58,125,206, 74,218,219,187,137, 45,199, 24,153,188,156,132,118,223,173,156,183, 95, + 76,103,173,184,155,130,141,150,246,227, 80, 63, 76, 20,138, 36, 35,173,172,109, 2,181, 90,117, 10,107, 54,255, 66, 11,132,253, +151, 45, 93,221,182,123,207, 1,182,156, 33,159, 54, 51, 84,232,158,189,187,154,126,255,227,218,168,184, 52,246,101, 0, 92,131, + 42,205,226,195,123,135,222, 29, 33, 18, 10,168,144,129, 27,108, 0,166, 95,131, 57, 0,132,249, 33,140,212,159, 9, 29, 20,240, + 67,124, 6,226, 27,211, 62, 33,126,216, 68, 1, 65, 0,246, 81, 4,187, 19, 50, 81,200, 63,238,120,240,248,119, 65, 46,151,159, + 87, 40, 20, 61,159, 51,103, 71,133, 66,113,149,191,186,207, 79,100,213,178,249, 90, 45,219,174,255, 29,202,219, 80, 11,214, 87, +241, 41, 57, 78,224, 76, 8, 11, 10, 88, 8, 52, 76, 96,201,132,130,109,215,239, 22,120,130,152,176, 97,229,123,123,140,102,128, + 97, 76, 96, 25, 51, 88,198,252,240, 59,107, 6,199,232, 49,111, 85, 52,192,168, 17,217,182,197, 54,128,245,178,244, 28, 34,208, +219,111, 94, 62,229, 76, 49, 21,216,179,117,241,212, 44,101,229,212, 51,215,148,197,161, 34,221,236,132, 76,108,105,200, 32,126, +126,247, 7,216,177,255, 88,238,154, 13,123,147, 56, 16, 56,217, 74,131,199, 12,143,247,249,121,255,249,156,213,155,245, 73,132, + 35,112,180,147, 6,143,125, 57,197,247, 89, 26, 65,160,171, 92,245,227,134, 45,158,190, 77,155, 82,230,140,175, 0,179, 1, 62, +190, 81,130, 57,211,223,246,250,114,233, 15, 43, 1,140,173,211, 26,228,143,208,102, 1, 45, 63,222,182,231,138,175,166,178,208, +120,238,232,103,169, 20, 33,102, 87,215, 16,241,130,175,150, 91,125, 62,123,250, 71, 70, 54,247,234,253,116, 36,212, 83, 20,186, +165, 31, 14,125,253,245,178,214,189,251, 14,182,101,141, 69, 2,125,165, 58,104,227,150, 77,243, 67,194, 58, 88,119,137,104, 34, + 46,186, 60,137,210,170, 75, 97, 34, 86,210, 94,145,189,237,181, 99, 94, 53,111,250,121,215,148,132,116,124,219, 32,125,197,252, + 47,215,136,137,129, 12,128, 8,141, 8, 32, 36,192,251,183, 99,207, 79,100,202,174, 3,156,169, 74,244,154, 0,206, 12, 82,227, +239, 11,175,111, 1,128, 73,141,105, 31,154,194, 75,103,206, 92,247, 42, 40,200,107,191,106,213,215,179, 9,117,253, 56, 40,108, + 79, 76,199,133,198,136, 66, 30, 60,120,252, 61,225,237,237,205, 42,149, 74,193,243,228,148,203,229, 81, 10,133,226,216,179,112, +120,121,121,125, 10,224,237,170,159, 27,243,242,242,150, 61,107,185, 34, 35, 35,155, 16, 66, 60,171,132, 75,254,141, 27, 55,114, +249, 30,240,255, 43,176,100, 32, 28,112,121, 40, 64, 53,108,186, 98,213, 96, 40, 3, 37, 0,204,149, 24, 50,168, 15, 92, 93,188, + 0, 86, 3,176, 58,128,209, 2,236,195, 79,113, 81, 22,192,104,128,162,227, 96, 8,145, 54,184, 86,230, 10,160,240, 23,188,244, +162, 47, 28,237,100,248,224,181, 80,215,245, 7,147, 55,110, 60,120,191, 79, 66, 58, 70, 89, 84, 86, 66,208, 49, 34, 16,107, 54, +104,146, 14, 71, 23,245, 3,128,168,238, 46, 39, 58,182,106,234,179,122,179, 62,233,216,197,178,254, 0,208,191,179,253,241, 14, +225,158,190,220, 51, 44,127,194,114,108, 23,223,230, 17, 20,147,189, 20, 52, 93,134,202,202, 98,228,164,109,133,171, 71, 63,154, +225,184,110,245, 29,111, 37,196,172, 15, 62, 93, 34,212, 84, 22, 24, 9, 83,200,121,216, 22,139, 69,160, 4,156,230,146, 81,151, + 95, 94,249,225,251, 99,152,143,103,125, 61, 11,192,232,186,120, 66,253, 49,101,197,210,213,173, 58,119, 8,118,207,143,249,128, +170,172, 40,128,153, 88, 73, 95,238,222, 25, 78, 77, 67,185,130,219, 43, 40,169, 87, 31, 56,249, 5, 32,247,222, 14,100,221,253, +149,234,218, 97,184,116,219, 78,241, 24,192, 84,171,192, 10,244, 68,151,126, 47,117,216, 19,208,212,219,139, 16, 14, 28,199,129, + 16, 14,122, 35,139,217,223,167, 66,163, 99, 48,168,207, 11,157, 93, 28, 4, 6, 26, 0, 33, 28,114,148, 37,218,115, 87,146,122, +167, 41, 81,239,155, 31, 5,252,208,230,197,158, 93,238, 94,139, 13, 49, 41,143,160,253,176,197, 73, 20,254,231,110, 36, 64,151, + 91,103,183,132, 0, 91, 26,253,210, 68, 8,216,236,223,151,160, 73,196,187,130,117, 91, 78,184, 85,148, 40,198,254,186,247,199, + 17, 63,174, 95,183, 35, 41,189,113,162,141, 7, 15, 30,127, 63, 40,149,202,231, 46,178,174, 92,185,162,124, 22,145, 21, 25, 25, +217, 77,169, 84, 46, 85, 42,149,213, 34,112,105,135, 14, 29,230, 86,143, 83, 79,160,130, 16, 50,250,198,141, 27, 23,235,226,156, + 62,125,186,247,229,203,151,253,110,220,184, 1, 0,104,223,190,189, 95,100,100,164, 95,109,251, 90, 91, 91,179,109,218,180,201, + 92,181,106,149,146,239, 33,127,174,192, 74,202,191,244, 97,132,177, 84, 11, 0, 73, 22,236,255,216, 84, 75,189,153, 93,178,117, +245,216, 37, 97, 65, 78, 80,169,141, 56,125, 41,179,202,130,197,128,101,205,143,254,246,123,209, 21,157,152, 73,248,118,247,125, + 48, 44,183,184, 46,206, 39, 97,226,184,215,219,118,123,117, 47, 71,136,196,218,154,174,104,238,227,226,254,241,152, 54,244, 7, +175,133, 65,167,103, 94,221,121, 60,245, 92, 98, 38, 54, 88,196,201, 49,181, 8,175, 90,182,113,108,189,117,127, 26,218, 4, 91, +117, 28, 54,160,171, 61,204,165, 96, 53, 25, 48,178, 28,242,242, 52, 72, 87,138,225,192, 21, 88,196,201,113,104,237,233,233,101, +125,229,212,204, 12,119,187, 50,177,139, 21, 43, 22, 83, 28,161,205, 68, 96, 52, 38,233,157,188,251,136, 56, 14,173,235,107, 35, + 43, 43,187, 55,187,246, 28,232,144,125,246,109,202,202,103, 0,220,253,155, 32,227,230, 86, 20,198, 29, 65, 73, 97, 22,229, 64, +202, 96,221, 34, 0, 3,134,191,134,165, 83, 34,161, 82, 85,130, 42, 74,115,144, 72,164,142,128,169, 86, 78, 66, 99,244,138,111, + 22,121, 9,133,244,195,235, 73, 24,128,152, 1, 98,134,186,210, 0,163,209, 8,153,152,192, 70, 70,128, 42, 55, 44,203, 26,173, + 91,247,158,245, 30,192, 94,173,175,238,241, 25,136, 15,245, 67, 12, 8, 19, 66, 88, 29, 40, 32, 38, 33,227,127,162, 39,204, 15, + 97,237,122,143,127,159, 2,126,104, 76, 27,133, 55,195,160,200, 16, 91, 27, 43, 38, 9,185,209, 83,145,202,202,136, 71,171,183, +241,218,232, 41,214,235, 54,174, 31, 12,144,201,120, 60, 6,237,207,152, 94,204,115,242,156,255, 72, 78,123,123,123,255,102,205, +154,205, 53,155,205,221,196, 98,177,135,201,100, 2,199,113,249, 18,137,228, 82,102,102,230, 2,149, 74,149,254,119,171,251,241, +227,199, 27, 34,178,234,229, 20,137, 68, 56,118,236, 88, 74, 3, 68,214, 99,156, 52, 77,111,223,183,111, 31,246,238,221, 11, 0, + 56,127,254, 60, 90,180,104, 97, 83,219,129, 57, 57, 57, 54,175,188,242,202,118, 0, 62,117,113, 62,120,240,192,127,209,162, 69, +216,183,111, 31, 0,224,231,159,127, 70, 80, 80, 80,173,133,185,115,231,142,224,243,207, 63,247, 7,160,252, 11,218,232, 95, 43, +176, 8,234, 95, 90, 37,205,211, 78, 20, 1,179, 25, 0,210, 26,122,178,196, 52,124,179,102,211,137,254,103,127,253,161,155, 76, + 66, 99,254,170,143,115,138,138,212, 47, 8, 5, 15,221, 44, 12, 11,218,201, 81, 18,187,120,106, 27,223,178, 10, 61,126,187,160, +184,152,144,142, 6,153, 66, 19,210,112, 26,224, 28,171,108, 67,208,168, 10,131,198,206, 57,189,123,247, 55,253, 91, 79, 31,221, + 26,135,162, 51,167, 3, 76,189,107,213, 17,142, 3, 33,204,163,160,246,170,141, 85, 46,167,255,109,227, 8, 1,136, 25,164,129, +113,222, 95,126, 57, 82,120,104,247,129,254, 54, 82,225,119,147,222,153,104,111, 46, 73, 64, 69, 57,139,252, 98, 13,178,138, 28, +193, 90, 53, 71,114,252, 85, 86, 64,211,245,198,159, 81, 52, 84,196,172,177,115,178,178,162, 67, 59,188,231, 85, 17,247,153, 74, + 42, 48, 11, 28,219, 46,178, 43,184,183, 34,155, 49, 20, 86, 82,244,227, 10,168,214,135,161,131, 67, 11,131, 58, 83, 80, 81, 94, + 2,199, 86,161, 24,240,242, 96,204,159,208, 18,106,181, 6, 69, 37, 87, 72, 96, 83, 7, 74,127,107, 39,230,188, 25,130,146,226, + 60, 24,205, 0,173,210,151,234,141,250,202,167, 91, 2,177,238,195,143,103,188,222,180,137,155, 77,245,100, 1,194,177,104, 19, + 30,128,190, 61, 59,226,116,236, 21, 92,191,149, 12,142,112, 85,147, 9, 88,228, 22,150, 23,232, 77,236,214, 6, 89, 71, 57,230, +161, 37,180, 22, 1,134, 70,184, 6,195,195, 97,205,106,240, 69,251,150,118, 19,102,190,217,212,206, 78, 66, 65,111,197, 66,175, + 55, 67,157,244, 61, 92,154,180,130,181, 76, 70, 69, 68,232,132,183,110,129, 95, 87,144, 7,143, 26, 24, 49, 98,132,172,160,160, + 32,218,199,199, 39,180, 79,159, 62,214,221,186,117,131, 70,163,193,201,147, 39,161,213,106,155,250,248,248, 52, 61,117,234,212, +240,172,172,172, 4, 31, 31,159, 30,251,246,237,211, 55,244, 28,213, 65,229,207, 59, 56, 92, 34,145, 32, 54, 54,246,185, 90,178, + 36, 18, 9,174, 93,187,150,210, 24, 75,150, 70,163, 17,123,122,122,194,197,197, 5, 44,203, 66,163,209,224,224,193,131, 80,169, + 84,224, 56, 14, 86, 86, 86, 88,113,188, 2,250,251,251,176,241,187, 69,168,168,168, 16,215,199, 89, 92, 92, 76, 5, 7, 7,195, + 96, 48,128, 97, 24,232,245,122,156, 57,115,230,209,111,161, 80,136,133,251, 10, 96, 72,222,141,109,235, 86,160,184,184,152,250, + 11,187,143, 37, 90,228, 31, 37,176,170, 43,244,167, 87,140,101,153,217,235,183,238,142,157, 61,117, 20,166,188,217,219,103,193, +183, 7,250, 36,166, 99, 27, 0,180,244,199,216, 49, 81,129,190,142, 54, 34,124,249,211, 13, 0,100,246,179,158, 47, 62, 11,201, +161, 1,220,244, 3,209, 89,209,159, 77,136, 64,128,143,125,139, 50, 83,169, 36, 45,205,130,120, 31,206, 12, 39, 91,105,112, 84, +119,151, 19, 32, 28, 28,109,165, 33, 32, 44, 28,237,164,193,253, 59,219, 31,231, 8,129,163,141, 56,132,112,150, 39,231,238, 16, + 46,125,199, 74, 68,191, 99, 99,231,232,251,225,164, 49, 86, 3, 7,190, 98,101, 35, 33, 40, 73, 56, 6, 21, 9,131,209,198, 6, + 68, 91,142,244, 7,113,236,241, 11, 55, 20, 82, 23,175, 79,128,140,186,139,201,226,162, 50, 39,113, 88,179,192, 62,142, 69, 55, +230, 20,250,247,222,233, 71,131,165, 53,177,195, 11,109,236, 66,197, 49,119,226, 24,142,197,149,250,202,166, 86,169, 50,205, 38, +120,233,205, 34,187,212,107, 91, 48,107, 76, 24,202,203,138,160, 55, 48, 40,215, 48, 38, 47, 87,147, 84, 95,118, 15, 6, 35, 3, +131,137, 64,100,237,141, 83,177,113,197, 28, 99, 62,254, 84, 69,158,135,219,105, 59,110,219,214,220, 22,224,133, 54, 51,157,172, +110,131,213, 33, 43, 91,137,109,251, 99, 35,210,242,112,251,217,110, 73, 6,132,249,223, 51,186, 58,248,189, 49,193,237, 33, 77, +209, 65,204,136,190,251,114,214,192,208, 30, 97,172,148,210,231,129, 2, 96, 45, 19,194, 32, 99,225, 32, 11, 0, 49,169,137, 86, +175, 47,143,143, 3,159,153,157, 7,143, 26, 8, 14, 14,246, 84, 40, 20,241, 31,127,252,177,243,176, 97,195, 30,137,129,173, 91, +183, 98,245,234,213,152, 63,127, 62,204,102, 51,214,175, 95,111,189,127,255,254, 14, 63,252,240, 67,174,175,175,111, 88,118,118, +118,190,133,162, 74, 92, 53,118, 61,140, 42, 32,132,253,242,203, 47,201,252,249,243, 81,189, 13, 0, 11,212,255, 82,249, 52, 49, + 36,145, 72,144,148,148,244, 92, 68,150, 72, 36,130, 88, 44,134, 68, 34,193,253,251,247, 27, 44,178, 24,134, 17,228,230,230, 66, +165, 82,161,239,224,193, 88,189,100, 9,186,117,235,134, 62,125,250,128, 16,130,179,103,207,162,147, 83, 50,156, 7,119, 71, 98, + 98, 34,204,102,179, 69,158,169,220,220, 92,148,148,148,160,255,224,193,216,240,227,143,104,215,174, 29,130,131,131, 1, 0,209, +209,209,232, 45,207,132,109,112, 31, 36, 39, 39,255,149,221,231, 47,211, 34,127,181, 5,235, 47, 65,124, 26,126,231, 14, 92, 56, +242,218,192,246,131, 6,247, 10,197,134,221,231, 22, 65,170,218, 13, 0, 46, 82,233, 87,111, 14, 12, 64, 66, 90, 25,206, 94, 83, + 30, 73,204,192,239,207,227,156, 28, 11, 87, 23, 71,107,128,150, 64,107,100, 25,123,251,250, 3,147, 57, 16, 88,183,156,133, 49, +195, 18,125, 58,182,242,241, 33,132,169,154, 49,184, 18, 99, 95, 78,241,109, 31,230,225,251,208,229,101,134,125,167,157, 0,103, + 83,111, 57,186,182,149,157,250,100,218,212, 23, 7, 14,126,205, 74,108,237, 2, 78,151, 3,115,233, 93,148,164,159,135,193,170, + 45,138,114, 51,176,251,208,111, 21, 73,233, 5, 42,129,128, 62, 45,116,240,152,113,230, 76,122, 37, 69,213,221,207,244, 2, 44, +158, 63,119,246,192,221, 59,118, 57, 88,121,119,197,131, 67, 81,229, 18,129, 89,234, 46, 15,130,142,177, 99,151,111, 62,226,168, + 1,150,212, 87, 62,173, 70,245,235,153,179, 39, 70, 5,122,117,177,203,136, 59, 2,173,214, 8,131, 25, 8,111,215, 19, 44, 71, + 36, 20, 77,113,246, 2, 1, 85, 80, 80, 10,202,204, 21, 92,186,149,145, 23,115, 61, 77, 96,160,235,231,126,172,211,137, 5,211, + 6,247,105, 3,176, 58,188,220, 55, 28,171, 54,159,157, 10,176,227,159,237,182, 52,131,176, 58, 16,160, 75,168, 31,126,226,128, + 46, 55,143,175, 10,137, 28, 48, 29, 13,177, 96,133,249, 97, 64,104,144,247,150, 85,139,102, 59, 59,187,251, 8,192,234, 64, 49, + 42,194,149,254, 14,161,230, 1,236,155, 12, 4,235,208, 25,235,126, 92, 94,201,113,100, 55, 26,145,162,130, 7,143,127, 51,244, +122,253,175, 75,150, 44,113, 30, 52,232,225,108,247,202,202, 74, 92,185,114, 5, 27, 55,110,132,141,141, 77, 77,177,132,168,168, + 40, 16, 66,156,231,205,155,247, 43,128, 23,159,198,217,169, 83,167,193, 43, 87,174,204, 6,240, 0, 15,115, 28,137,241,112,129, +121,114,230,204, 25, 26, 0, 58,116,232,192, 94,187,118,141, 3, 64, 70,143, 30, 45, 58,116,232, 80, 11,141, 70,115,161,177, 2, + 75, 34,145, 64,161, 80, 60,179,200, 18,137, 68,143,248,196, 98, 49, 20, 10, 69,131, 68, 22,195, 48,194,163, 71,143,226,214,173, + 91,248, 50, 34, 2, 31,120,121,193,197,197, 5, 23, 46, 92, 0, 33, 4, 54, 54, 54, 40, 45, 45,197,238,221,187,209,179,103, 79, + 48, 12, 35,182,132,247,224,193,131,184,121,243, 38, 22, 70, 70, 98,170,141, 13, 28, 29, 29, 17, 29, 29, 13, 0,144, 74,165, 80, + 40, 20, 56,115,230, 12,122,244,232,193,119,234, 63, 91, 96,117, 7,132,165, 20, 60,205, 38, 29, 8, 67, 0, 10,222, 45, 91, 66, +156,152,216,240,183, 4, 26,152,179,102,243,145,129,171,102,191, 76,189, 59, 34,194,123,193, 15,231, 39, 3,192,132, 87,131,228, +214, 82, 33,214,236, 78, 32, 52, 48,231,121, 84,176,101, 75,136, 41, 3, 38,247,237, 28, 12,101,177, 17,105,217, 21,231, 18, 51, + 44,115,233,156,221, 54, 6, 63,255, 26,157,179,122,203,227, 51, 6,183, 28,188,153,189, 98,155, 62,137,128,192,209, 74, 20, 50, +254,229, 78,245,206, 34,236, 16, 46,125,103,230,244,233, 47, 14,121, 99,134,149, 57,247, 0, 12,153, 71, 1, 86, 11,173,134,130, +138, 9, 68, 94,118, 46,190, 92,181, 43,199, 96,166, 95,191,145,160,111,144,176,124,240, 0,149, 66,127,213,176, 37,223,204, 61, +253,245,151,243,108,165,138,179, 42,145, 16, 26,218,165,155,232,171,185,107,133,234, 10,227, 43,105,217, 80,215,199, 99,160,177, +228,155, 21,223, 14,124,123,204,176,164, 32,159, 30, 46,108,126,154,139,182,162,162,112,231,241,155,158, 85,111, 19, 20, 0,164, +102,148,160,168, 84,195,176,140,249,130,157, 9, 11, 18, 20,150,207,254,243,119,135,219,160, 94, 97,111,184, 57, 74,160,211,148, +193,221, 73,140,126, 93,154,191, 97,214, 39,207, 76, 47,108, 88,142,145,199,244, 85,149,139, 48,118, 99,175, 16,112,166, 16,194, +153, 97,204,218,222,152,215,167,233,211, 71, 53,117,112,182, 49,210, 20,171, 1, 68, 78,128,196,141,162,173,252, 32,176,242, 69, +102,202, 13,102,250,123,163, 74, 50, 51,243, 55,185, 18, 44,227, 31, 33, 60,120, 60,142,172,172,172, 55, 63,251,236,179,152,142, + 29, 59,122,184,186,186, 34, 60, 60, 28,135, 15, 31,198, 39,159,124,242,104,159,182,109,219, 2, 0, 74, 74, 74,240,205, 55,223, +228, 43,149,202, 55,235,124, 49,143,143, 79,218,190,125,123,151,214,173, 91, 27,197, 98,113, 89,181,200,202,202,202, 18,106, 52, + 26,202,104, 52, 18, 27, 27, 27, 78, 42,149,154, 71,142, 28,105,186,118,237, 90, 11,141, 70,147,245, 44, 22,172,200,200,200,123, +229,229,229, 21, 20, 69, 61,115, 10,135,106,113, 21, 18, 18,226,102, 52, 26, 89, 0,165,141, 73,225,192, 48, 12, 34, 35, 35,113, +230,226, 13, 28,191,120, 15,149, 69,105, 24,253, 74, 63,132,132,132,224,228,201,147,141,110,179,200,200, 72,156, 57, 19,131,232, + 27,247, 81,144,149,128, 49,175, 13, 69,112,112, 48,206,156, 57,195,119,232,231, 32,176,234, 52,201,133,248,162, 13,109, 47,249, +121,206,203,205, 67,133,225,243, 65, 9,173,112, 96,203,225,206,179,191,254, 41, 73, 80,145, 61, 58,206,130,217, 94,143,221, 44, + 25,136, 39,184,191,235, 78, 66,200, 27, 47,119,243,193,134, 95,172,191, 0,128, 87,251,250,227, 90, 66, 17,174,198, 21,238, 74, +104,100,206,162,154, 8,119,135, 53,107,192,174,111,102, 12,233,209,180,137, 39, 54,238,141, 1, 69,240,171, 69, 3, 45, 33,164, + 99,107, 95,172,222,242,228,140, 65, 47,223, 21,219,244, 73,167,174,168, 7, 0, 64,223, 23,172,143,183,111,233,236, 75, 72,221, +211, 8,101, 34,250,221, 1, 47,191,105,197, 20,156, 4, 87,250, 11, 68, 18, 49,116, 26, 22,121,133, 6,232,172,173,112,238,210, + 5, 93,165,150,153,126, 55,133,105,148,213, 46, 49, 29,105, 98,225,173,108,141, 78,231,101,235,220, 92, 67, 83, 32,149, 70, 17, +185,153,160,208, 36,100,227,190, 37, 28,105,105, 48,190, 32,103,186,174,219,246,203, 92,145, 72,242,170, 64, 0,202,221,209,198, +237,167, 53, 11, 97,103,103, 11,194,168, 65, 12,197, 24, 54,225,235,162,184, 20,179, 63, 0,180,104, 1,219,174,173, 69,219,132, + 52,149,123,254,182,233,243,250,206, 65, 9, 48,105,244,203,109, 68,156, 89,131,105,243,246, 96,221, 87, 47, 99,204,224,150,162, +163,231,146, 39, 1, 88,208,120, 51,229, 67, 23,225,139,239, 94, 76,162,128, 24, 2,116,185,113,228,171, 16, 52,192,243, 24, 17, + 1, 17, 91, 73,181,108, 41, 55,138,216,220,221,160,100,114, 34,112,237, 1,216,180,160,136,109, 56,190, 95, 51,183,114,195,198, +141,167, 56, 10, 95,222,207,172, 55,229, 5, 15, 30,255, 85,164, 41,149,202,254, 81, 81, 81,103, 79,158, 60,233, 28, 30,254,112, + 69,149,155, 55,111, 2,192, 35, 87, 84, 65, 65, 1, 94,127,253,245,226,188,188,188,254,168, 39,166, 87,173, 86,167, 31, 56,112, +192, 67,167,211,181,255,252,243,207, 11,154, 53,107,166, 54,155,205, 68,173, 86,131, 97, 24,226,230,230, 38,106,215,174, 29, 21, + 22, 22,166, 59,123,246,172, 75, 78, 78,142, 26, 64,102, 99, 10,255,246,219,111, 99,255,254,253, 0,128,231,145, 23, 75, 44, 22, + 35, 42, 42, 74,126,229,202, 21, 69, 21,103,163,243, 98, 17, 66,112,247,238, 93, 92, 74, 97, 33,177,113, 66,102,146, 10,103,126, + 59,132,209,239, 78, 4,195, 52, 62, 90,225,206,157, 59,216,125,230, 14, 60,228,205, 81, 97,184,139,131, 7, 15, 98,242,228,201, +207,196,217, 72,252,107,220,131, 79, 90,176,254, 80,161,128, 0, 72,164, 70,204,235,219, 65, 62, 99,100,239,230, 2, 70,171, 4, +199,113, 16, 0,112,181,163,177,121,195, 58,255, 95, 14, 28,139,253,238,219, 31,190,133,145,155, 19, 87, 8,109, 3,204, 88,243, + 86,110,189,252,234,246,133,221,133,147, 71,132, 56, 3,128, 88, 68, 99,205,174,120, 6, 52,230, 61, 75,165, 94,144, 67, 86, 41, +198,187,238,238, 14, 95,204,126,111,160,115,143,142, 65,184, 16, 27,135,111,119,196, 94,148, 56,225,103, 75,111, 59,194, 49,143, + 5,180, 63,220, 86,139,241,139,212,223, 9, 89,142,120, 74,172, 93,161,207, 60, 6,161, 68, 10,134, 49,161,168, 64,139,140,124, + 14, 50,111, 17,174,221,205,210, 13,125, 99,216,209,103,233,152, 54,214, 50,239,121, 95, 45,111,162,211,169, 25, 85,121, 49, 35, + 20,199, 10,173,173,164,249, 15, 87, 14,176, 12,191, 43,160,239,214, 70,212, 14,132, 19, 72, 5, 68, 59,123,250, 56, 27, 69,242, + 73, 4,186, 41, 65,129,192,202,123, 32,236,108, 4,226, 46,173, 69,217, 0, 96, 99,109, 45,249,102,193, 39, 14, 31,206,252,242, +146, 37,214,196, 32,119,207, 15,195, 3,157,113,225,106, 34, 46, 94,207,138,191,248,123,114, 88,207, 14,222, 8,242,119,252, 64, +226, 88,190,164, 49, 22,209,135,109,240,208, 69, 88, 61,139, 48,204, 15, 97,237, 7,125,254,180,217,131,181,194,239, 22,184,100, +127, 2,138, 18,128,128, 2,244, 10, 48, 57,219, 33,240,159, 74,126, 61,244,149,110,227,134,141, 11, 19, 51,121,171, 21, 15, 30, +245,161,162,162,226,110, 82, 82, 82,191, 54,109,218,108,157, 54,109,154,221, 27,111,188,225,253,246,219,111,211, 0, 80, 80, 80, +192,173, 94,189, 90,249,221,119,223, 85, 20, 23, 23,143, 55,155,205,247, 44,185,195,243,242,242,174,108,222,188,185, 40, 38, 38, + 38,236,133, 23, 94,176,110,223,190, 61,231,238,238, 46,214,106,181,108, 78, 78,142, 46, 54, 54,150, 77, 73, 73,113, 40, 47, 47, + 79, 1,144,138, 70,184,239,189,189,189, 65,211,244, 2, 31, 31,159,185, 10,133,162,213,243,136,193, 10, 12, 12,244, 6,144, 34, +151,203, 3, 27,234, 30,252,195,128, 45, 20,162,172,172, 12,234,220, 84,104, 75,138, 17, 44,208,162,173,179, 43,236,236,236,158, + 73, 12, 85, 84, 84, 64,104, 40, 64,218,221, 44,148,231,103, 34,180,105, 36,108,108,108, 96, 48, 24,254, 63,186, 15,245,111,185, + 15,158,234, 34, 12,109,130,201, 86,192,234,113, 35,253,197,254, 77,155,192, 88,116, 19,183, 83, 43,241,249,166, 14, 9, 2,177, +157, 97,202,216,190,237,122,246,113, 67,247, 30, 29,168,102, 77, 29, 63, 88,178,100,237,251,161,146,226, 79, 18,114,176,198,146, + 19, 39,164, 33,157,227, 10, 55,158,191,174,152,212,196, 77, 7, 2,130,243, 55,242,112, 47,181,108, 99, 82, 6,210, 27, 82,137, +208,230,232, 35,164,232, 61,132, 37, 50, 7, 59, 27,117,104, 72, 19,215, 62, 93, 90,211,253,123,182,135, 88, 8,196, 92,189,131, +233, 95,253,250, 59, 39, 33, 3, 45,158,241, 69,184, 63, 8,167,135, 51, 6,153,199,102, 12, 18, 66, 8, 56, 6,132,212, 29,214, + 37,160,169,124, 77,193, 13, 79,137, 93, 40, 76, 37,231, 80, 80, 80,137,248, 52, 19, 42,225,131,178,220, 92, 16,194,102,207,155, +247, 75,163,239, 16, 87, 87, 87,119,255, 22, 65,205,191,219,176, 15, 38, 67, 5,210, 18,182,160, 82,149,143,175, 22,255,214, 92, + 46,119,233,174, 80, 40, 46, 88,222,187,169,160,179,231,118,185,131, 0, 2,161, 20, 71,215,239, 69,177,208, 10,174, 14, 98,112, +250, 66,188,251,206,104,135,168,129,163, 29, 0, 32, 59,245, 14,124,157, 45,211,213,166,114, 12,127,117,124,176, 35, 88, 45,126, + 62,120, 71, 79, 83,232,255,243,111,241,169, 61,219, 57,202, 94,237,219,212,105,193,186,242, 87, 0,236,106,148,190,226,216,199, +102, 17, 54,102,246,224, 62,128, 13, 33, 72,221,117,166,200,118,100, 84,132,149, 88, 72, 81, 68,175, 0, 71,137,169, 53, 63,108, + 86, 75, 40,172,231,135, 78, 30, 60, 44,131, 78,167,187,169,211,233, 90,125,250,233,167,175,127,246,217,103,221,108,108,108,252, + 1, 64,163,209,164,155,205,230,139, 85,247, 58,219,144,219, 28, 64, 74,106,106,106,122,106,106,170,199,207, 63,255,236, 8, 64, + 86,245, 63, 61,128,114, 0, 5, 13,228,124, 12,213, 98,202,219,219,123,238,243,186, 14,213, 98, 74, 46,151, 7, 54,230,120,129, + 64,192,210,244,195,149,125,164, 82, 41, 46, 93,186,132, 1, 93,186,226,206,153, 44,132,120,248,160,231,232,113, 56,120,254, 60, + 4, 2, 65,245,254, 13, 26, 71,132, 66, 33, 98, 98, 98, 48, 98, 80, 15, 28, 60,120, 16, 1,145,109, 48,117,234, 84,156, 56,113, + 2, 66, 33,191,154,222,159, 34,176, 64,176,224,244,158,175,197,224,204,216,183,115, 41, 78, 95,215, 26,239, 43, 48, 39, 56, 23, +171,247, 65,205, 21, 22,239,159,116, 52, 58,109,217, 91,227, 7, 89,247,234,222, 23,189,186,245, 20,134,181,233,254, 5,240,152, +192, 10, 71, 29,185, 50, 88, 51, 22,174,223,159, 52,113,207,177,100, 10,140, 26,163, 94,110, 79, 88, 51, 22,214, 83,230, 63,112, + 58, 88,219,238,137,185, 20,235, 4,182, 18,249, 25,231,101,158, 30,254, 0, 49,227,193,131,100,124,191,249, 32, 23, 29,123,127, +187, 81,128,105,105,137,208, 88,202,249, 80, 81, 49,112,176,149,252, 97,198,160,163,149, 40,164,239, 11,214,199, 9, 33,196,206, + 90, 20, 66,106,183, 96, 61,198,169, 55,115,235,183,111,219,176,124,194,132,183,109, 74, 12, 10, 36,231,196, 67, 47,144, 67, 96, +221, 28,241, 55, 78,234,116,102,110,131, 5,237,245,212,235, 89, 92, 92, 92,120,243, 70, 41,246,108, 93, 12,179,217,128,194,188, +135, 26, 53,175, 64, 5,123,123,121,172, 66,161,176,152,211,196,112, 21,195,135,189, 43,182,146,193,106,244,171, 3, 37,169, 74, + 3, 34,130,237, 30,118, 11, 83, 49,146,162, 47,161,167,251,195, 96,200,212, 36, 1,124, 95,240,182,168,156,118,118,226,105, 3, +186,202,145,158,149,143, 75, 55, 21,219,210,149, 80,178, 36,111, 91,106,118,249,164, 33, 61,125,177,106,123,194, 84,192,188,171, + 33,117, 15,243, 67, 24, 7,116, 1, 49,131, 48,122, 16,160, 75,152, 31,194, 44,156, 57,248, 7, 78, 33,141, 55, 86,238,201,252, +124, 95,116,209,144, 25,111,119,181,239,252,226, 0, 9, 56, 51, 81,107, 13,230,196, 12,168,158,165,141,158, 1, 60, 39,207,249, + 79,229,100, 1,108, 55,155,205,219,203,203,203,159, 39,167, 18,127,204,203,244, 76,117,175,233, 14, 84, 42,149, 2,111,111,111, +214,130, 32,247,250, 56,175,214, 20, 90, 85,214,171,250,172, 88, 79,114, 42, 59,118,236,232, 60,120,240, 96, 48, 12,131,148,148, + 20,100,101,101, 97,240, 91,227,225,228,228,132,171, 9, 9, 72, 73, 73,193,220,185,115,193, 48, 12,174, 93,187,150, 91, 31,167, + 72, 36, 50,181,105,211, 70, 60,116,232, 80, 48, 12,131,180,180, 52,100,102,102, 98,234,212,169,112,112,112, 64, 66, 66, 2,210, +210,210, 48,119,238, 92, 24, 12, 6,164,167,167,155,254,162,190,244, 31, 17, 88, 20, 88,112,102, 84, 92,159,135,159,142,192,100, + 98, 16,146,144,139,140,234,192,147,132, 92,172, 21,144,187,135,239,198, 39,165,223,188,218, 75, 2,213, 61, 52,244,205,225, 65, + 46,242,236,172,213,106, 48,106,123, 20, 29, 71,134, 66, 93,249, 32, 23,121,141,176, 94, 80, 96,255,143,189,243, 14,143,162,106, +219,248, 61, 51, 91,179,233,125,119,211, 12, 33, 9, 9, 53, 33,180, 36, 72,135,208, 68, 4, 4, 68, 16, 84,148, 34, 42,168,116, + 1, 1, 1, 17, 68,170,128,136, 40, 34, 32, 85,164,133,222, 33, 36, 4, 8, 33,161,132,132,148, 77,239, 91,103,119,102,190, 63, +146,205, 27, 48,101, 19,248,240,149,119,126,215,181,215,102,119, 38,247,158,153, 51, 51,231, 62,207,105, 26,160,228, 58,246, 31, + 58, 3,137,244, 6, 98,226,238, 50,151, 98,147,119,146, 28, 22, 38,166,226, 94,195, 53, 57,216,180, 93,133,119, 94,123, 80, 49, + 98,144, 51,130, 99, 77,176,143,216,129,177,175,133,123,183, 11,114,240, 6,107, 4,199, 25,225,216,227, 52, 48, 71, 90,167,222, +181,219,250,205,157, 67,164, 67,202, 74,243, 59,244,234,214,213,218, 53,240, 77,148,220,187,131,132,184,104,237,245, 91,201,151, +175,221,214,111,126,150,140,244,240,240,120,181, 71,143,102, 24,254,206, 76,208,250, 98, 60, 76,248, 9,101,165,217, 56,127,209, + 6,119, 31,151,118, 2, 96,113, 4,235,114,130,169, 5, 80,132,136,150,194,199,118, 98,131,124,244,208, 1,144, 8,116, 96,141, +101, 32,232,124, 60, 40,164, 75,134,204,203, 96, 0, 64, 38, 37, 4,214,130, 18, 59,139, 34,141,126,206, 1, 50,145, 17,191, 28, + 72, 0, 75, 84, 44,179,196, 18,216,240,203,159, 15, 62, 92, 56, 57, 20,205,253, 28,219,220,184,159,107,110,131,183,180, 74, 59, +233,250,193, 5, 65,186,132,185,224, 88, 35, 46, 44,119, 12,234,252,121,209, 36, 52,114, 89,156,219, 15,145, 9,224, 67, 48,154, +141, 31, 47, 62, 58, 55,172,229,157,200,105, 31, 14,178, 3,193, 47,140,206,195,195,243,226,209,104, 52, 31, 76,159, 62,125, 35, + 69, 81,174, 0, 8,142,227,160,215,235, 5, 63,254,248,163,208,100, 50,145, 20, 69, 49, 82,169,212, 20, 27, 27,107,100, 89, 54, +143,166,233, 15,234,211, 52, 24, 12, 15,214,174, 93,219,212,104, 52, 86,141, 56,212,235,245,248,245,215, 95,161,215,235, 33,145, + 72, 96, 99, 99,131,135, 15, 31,130, 32, 8,154, 97,152, 7,124, 78, 60, 79,131, 5, 44,136,120, 99,222, 60,112, 32, 64, 96,254, +157,140,191, 79,198,116, 43, 19, 89,205, 61,233, 79, 91,132,116,153, 87,105,202, 22, 52, 52, 1, 58,134, 25,218,174,109,224,239, + 0,160,103,153,183, 27,115, 16,165, 58,237,155, 33,237, 59,237,100, 57, 78, 96, 98,184, 31, 73, 18,123,116, 64,226,195, 71,245, +143,156,171,141, 44, 85,113,108,223, 72,123,206,188, 4, 78, 85,179, 96,229,116, 12, 28,199,113, 85,205,130,115,164,200, 47,208, +215,219,155,250,252, 13, 93,239,246, 45, 37,239, 31, 59, 27, 55,158, 97, 57, 57, 69, 18,217, 58, 35,187,233, 89,205, 85,101,237, +232,236,137, 19,153,199,111, 70,186,247,118,169,156,102, 53,191, 24,200, 47,193,241,204,204,242,179,141,209, 44,210, 26, 7,205, + 90,126,224,160, 88, 64, 9, 0, 14, 44, 91,113,188, 58,154, 41,172, 48, 97, 64, 43,127, 40, 63,255,209,244, 59, 69, 17,105,245, +233, 93,189,165,250,110,248,231, 39, 62, 75,184, 95,244, 99,106,102, 69,205, 39, 53, 19,183,119, 29,123, 52,247, 65,122,217,103, +183,239, 23,125,139, 6,246,155, 32,128,117,237, 94,155,247,183,239,158,245,124,222,125,140,120, 0,131,193,101,244, 26, 62, 97, +205, 52,130, 0,191, 76, 4, 15,207,255, 16,230, 40, 22, 73,146, 95, 61, 47, 77,115, 20, 11,192,253, 6,164,227, 42,128, 86,207, +243,216,226,226,226, 10, 0, 20,240,185,252,239,166, 37,175, 9,112, 28, 71, 62,203,171,161,233,244,247,247,231, 26, 96, 84,248, + 60,226, 53,121, 77, 94,147,127, 38, 63,227, 51,153,227, 56,226, 89, 94,124, 30,189,124,240,205, 30, 47, 0,130, 32,216, 23,249, +123,247,239,223, 39,248,179,206,195,195,195,243,226,158,201,207,123,201, 30,158,127, 63, 36,127, 10,120,120,120,120,120,120,120, +120,158,179,233, 70,237, 97,190,134,140, 14,104, 76,168,240, 54,175,201,107,242,154,188, 38,175,201,107,242,154,255,115,154,245, +105,243,163, 19,255,159,140, 23,175,201,107,242,154,188, 38,175,201,107,242,154,255,123,154, 47, 21,124, 19, 33, 15, 15, 15, 15, + 15, 15, 15, 15,111,176,120,120,120,120,120,120,120,120,120,131,197,195,195,195,195,195,195,195,195, 27, 44, 30, 30, 30, 30, 30, + 30, 30, 30, 30,222, 96,241,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,188,236,152,151, 86,233,194,159, 10, + 30, 30, 30, 30, 30, 30, 30,222,139, 60,191,131,170,254,206,195,195,195,195,195,195,195,195,123, 17,222, 53,242,240,240,240,240, +240,240,240, 94,228,191,211, 53,242,240,240,240,240,240,240,240,240, 94,228, 25,225, 71, 17,242,240,240,240,240,240,240,240,240, +240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240, 60, 71,248,149,198,121, 77, 94,147,215,228, 53,121, 77, + 94,147,215,252,159,131,239,131,197,195,195,195,195,195,195,195,195, 27, 44, 30, 30, 30, 30, 30, 30, 30, 30,222, 96,241,240,240, +240,240,240,240,240,240, 6,139,135,135,135,135,135,135,135,135,135, 55, 88, 60, 60, 60, 60, 60, 60, 60, 60,255, 53, 16,168,125, + 36,192,237, 6,232, 52,102, 52,193,109, 94,147,215,228, 53,121, 77, 94,147,215,228, 53,255,231, 52,235,211,190, 13,158,255, 23, +227,197,107,242,154,188, 38,175,201,107,242,154,188,230,255,158,230, 75, 5,223, 68,200,195,195,195,195,195,195,195,243,156, 17, +252,195,230,206,108,240, 88,252,103, 21,237,255, 54, 77, 30, 30,158,231, 64,231, 54,152, 46, 22, 9,199,233,104,227,178,139,241, +248,169, 75, 40,156, 77, 44,150, 74, 69,130,206,122,131,189, 50,127,110, 0, 0, 32, 0, 73, 68, 65, 84,233,155, 11, 55,241, 99, + 3, 37,137,167, 62,243,247,250, 51,210,171, 87,175,241, 0,230,113, 28,199,177, 44, 59,251,212,169, 83,219,158,199,179, 94, 46, +151,143, 0, 32, 3, 0,146, 36, 75,178,178,178,118, 91,242,143, 93,186,116, 17,148,151,151,167, 2,240,168,252,234, 94, 92, 92, + 92, 96,125,219,120, 26, 78, 76, 76, 12,231,227,227,131, 86,173, 90, 37,101,103,103,175, 1,176,129, 63, 43,255, 69, 6, 43,208, + 85,218,241, 21, 47,215,254, 71, 99, 31,207,174,239,134,243,240,240, 88,234,234,234, 58, 65,163,209,232, 0,112, 36, 73,114, 4, + 65,192,252, 2, 0,134, 97,242,146,146,146, 44, 13, 67, 62, 55,205,128,128,128,235, 36, 73,122,154,255, 7, 0,234,251,155,101, +217,140,196,196,196,176,250, 18, 41,151,203,251,144, 36, 57,163,190,253, 88,150, 93,154,157,157,125,172,174,125, 90,182,108, 25, +103,109,109,237, 78,146, 36, 81,219, 62, 28,247,159, 50,199,100, 50,113, 26,141, 38,231,206,157, 59,161, 13,205, 91,165, 82, 57, +155,227,184, 80, 0, 63,171, 84,170,195, 0,152,103,185, 86,148, 74,229, 16,142,227,230, 84,158,195, 69, 89, 89, 89,123, 26,242, +255,254,254,254,215, 69, 34,145, 39, 69, 81,196,211,121, 82,211,103,150,101, 57,131,193,144,145,156,156, 28,198,223,246, 47,158, + 78,109,208,177,169,175,226,203,201,111,117,195,103, 75,119, 78,142,104,105,202, 23,137, 69, 27,134, 68, 54,117,104,238,231,128, +175, 54, 94,158, 2,176, 13, 49, 88,132,151,151, 87,136,187,187,187,175, 86,171, 53, 95,139, 28, 69, 81, 79,236, 68,211, 52,157, +148,148,116,152,207, 1, 11, 11, 4,129,224,203, 63,255,252, 83,193,178, 44,250,245,235, 55, 31,192,243, 48, 88,132, 68, 34,177, +122,244,232, 17,140, 70, 35,233,227,227, 99,211,192, 50,202, 37, 54, 54, 22, 52, 77, 27, 58,117,234,228, 83,125,155, 88, 44,118, +185,116,233, 18, 0, 24,218,182,109,235,211,216, 4, 6, 7, 7, 91, 91, 91, 89, 77,165, 8,162, 39,195,113, 65, 0, 64, 17,196, + 93,134,227, 78,168,181,218,149,137,137,137,234,151, 61,239,163,163,163, 49,126,252,120,220,186,117,171,217,225,195,135,215,207, +158, 61,123,146, 74,165,234, 6, 32,143,191, 51,254, 97,131,213, 84,110,221,204,213,209,225,208,178,197, 11,112,180,247, 59,117, + 25, 44, 82,161, 80, 44,235,220,185,243,184,237,219,183, 91,239,219,183,207,218,215,215, 23, 34,145, 8, 20, 69,129,162, 40,144, + 36, 9,138,162, 48,104,208, 32,194, 82,115, 85, 93,243,228,201,147,214,129,129,129, 85,133, 44,199,113, 85, 38,171, 95,191,126, +245,106,146, 36,233, 25, 23, 23,231, 38,149, 74,171,254,159,101,217, 39, 94, 28,199, 85,189, 24,134, 65,231,206,157, 45, 75, 40, + 73,206, 72, 76, 76,124, 85,173, 86, 63,161, 97,254, 13,243,223,175,190,250, 42, 0, 28,171, 71, 75,121,241,252, 73, 55,130, 78, + 1, 76,133,224, 40, 39, 64,220, 4, 32, 37, 53,238, 95, 88, 88,136,110,221,186, 81,141,201, 95, 87, 87,215,209,103,206,156,241, +127,244,232,209,235, 95,127,253,117,193,229,203,151,215, 3,216,162, 82,169,210, 27,163,199,113,220,162,148,148,148, 0,142,227, +224,231,231,183, 16, 64,131, 12, 22, 69, 81,158,209,209,209,110, 98,177,184, 42,159,107,123,103, 24, 6, 52, 77, 35, 42, 42,202, +196,223,242,255,208,131,134,192,194,225,175,245,130,214, 72,194,104, 52,185, 42, 92,109,127,157, 50,186,139, 16,156, 1,219, 14, +198,193,104, 98,127,106,168,185,234,219,183,175,207,134, 13, 27, 4,137,137,137,130,224,224, 96, 48, 12, 83,245, 98, 89,182, 65, +247, 37, 79,149,193, 34, 72,146, 68,102,102, 38,108,108,108,236,187,118,237,154,197, 48,204,172,243,231,207,111,251,127,248,185, + 39, 34, 91, 4, 65,168, 85, 42,213,142, 23,125,204,109,218,180,233, 44, 21, 10,119, 46,152,247,169, 91, 80,139,150,164,179,171, + 51, 30, 60,200,128, 88,192, 69, 60, 72,186,215, 97,225,146,239, 63,108,211,166,205,240,248,248,248,243, 47, 91,126,123, 15,222, +188,158, 53,209, 19, 0, 96, 99, 12, 0,108, 66, 89, 89, 25,222,123,239, 61, 28, 56,112, 32,184, 99,199,142, 75, 25,134, 25,199, +223, 25,255,160,193,242, 83, 74, 61,108, 68,210,227, 27,127, 88, 67, 24,203,114, 28,235,185,161, 22,117,238,220,249,237,237,219, +183, 59, 18, 4,129,147, 31,189, 11, 7, 90, 7,229,151,223,192,209,197, 21,134, 25,227, 97,203,152,208,234, 84,124, 67,110,210, + 39, 52,147,146,146, 80, 88, 88, 8, 87, 87, 87,200,100, 50, 72, 36, 18,136, 68, 34,136,197, 98,203,158,222, 4, 1,169, 84,138, +232,232,104, 8, 4,130,170, 23, 69, 81, 53,126,118,119,119,183,248, 92,177, 44,187, 52, 40, 40,168,117,114,114,178, 93, 81, 81, + 17, 58,117,234, 84, 74, 16,196,205,106,198,163,245,205,155, 55,237, 44, 46,105,232, 20,148, 63,254, 1, 92,209, 30,192,225, 13, + 48,118,195,161, 67,147, 39, 10, 25,179, 41,100,152,198, 7,157,242,242,242,232,115,231,206, 33, 36, 36, 4, 59,119,238,116, 46, + 42, 42,250,242,231,159,127,158,179,106,213,170,217, 42,149,106,105, 35, 36,157, 0, 32, 41, 41, 9, 0, 28, 27,147, 38,177, 88, +140, 43, 87,174,128,227,184, 42, 83, 78,146, 36, 72,146,196,159,247, 93,160, 54,144,208,228,220,198,148,129, 62,240,245,245,253, + 91, 84,139,231,197, 16,217, 26,253,218,182,110,217,209,199,203, 27,103, 46, 93,131, 72, 44,116,152, 56,102, 0,108,109, 4, 88, +190,229, 47,246,113, 70,225,228, 11, 55, 45,142,148, 16, 10,133,162,117,239,222,189,189, 54,108,216, 32, 2,128,219,183,111, 67, +165, 82,193,205,205, 13, 82,169, 20, 66,161, 16, 20, 69, 65, 36, 18,241, 39,191, 1,132,134,134,182,104,209,162,133, 53,195, 48, +208,104, 52,248,225,135, 31,236,165, 82,169,253,128, 1, 3, 44,142,100,213,210,108, 23,164,215,235,181, 10,133, 66, 6,128, 37, + 73,178,252,233,200, 22, 0, 40, 20, 10,235, 26, 36, 77, 0,242,219,182,109,235, 1, 64, 12,224, 94,245,109, 6,131,161,182,109, +150, 30,115, 68,104,235,102,135, 23, 46,154,103,157,157,115, 15,246,118,217, 96,141,185, 88,191,126, 61,172,172,236, 48,127,254, + 44,193,254,176,182,242, 79, 62,157,121, 72, 32, 16, 68, 93,191,126,253,242,203,148,231,172,137,158,208, 38, 44,188,234,243,182, +232,213,208,219,135, 34,115,254,124,172, 90,181, 10, 1, 1, 1,237,239,222,189,203,223, 28,255,148,193,106,225,101,231,192,177, +220,241, 31, 55,172, 20,131, 86, 59, 38,197, 92,172,190,185,250, 80, 75, 2, 0,233,238,238, 62,113,199,142, 29,118,230,194, 46, +144, 96,224, 0, 26,175, 52,111, 14,153,189, 3,114, 76, 52, 56, 35, 13,177, 72, 84, 91,129, 88,175, 38, 73,146, 16, 10,133, 79, +188,196, 98, 49,170, 71, 59,234,208,172, 94,155, 3, 69, 81,136,142,142,134,209,104,196,208,161, 67,107, 52, 91,181, 80,163,102, +118,118,246, 49,165, 82,121,147,227,184, 87, 89,150, 5, 65, 16, 55,179,178,178,186,152,183,203,229,242, 62,109,218,180,153,193, +178,236,210,250, 52, 57,142, 3, 76, 5,224, 10,119,192,182, 83, 62, 74, 47,187,128,176,238, 9, 6, 62,184,125, 63, 27, 39,175, +167, 34,191,176, 28,109, 3,221,208,187,147, 31, 88,150,181, 56,157,213, 81, 40, 20, 1,193,193,193, 65, 70,163, 17,231,206,157, + 3,195, 48,104,213,170, 21,198,142, 29, 75,174, 94,189,122, 44,128,165, 13,213, 4, 16, 31, 27, 27,219, 51, 59, 59, 27, 0,110, + 89,176,255,237,154,140,240, 47,191,252, 2,157, 78,247,183,157, 29,187,124,141,207,222,240,193,216,143,182,225,155,228,221, 88, +183,110,221, 19,205,165, 13, 72,103, 67,225, 53,255,150, 81, 24, 59,108,240,235,160, 68,214, 72,122,144,129, 46, 29, 67,225,230, +230,134,155,137, 15,240, 56,179, 48,135, 32,240, 78,159,112,241, 82,173,214, 48,231,124, 60,182,212,167,169, 80, 40,154,108,218, +180, 73, 88,253, 59,145, 72, 84, 21, 5,175, 30, 13,127,186,201,144,207,163,154, 53, 67, 67, 67, 91,244,234,213,235,252,188,121, +243,108, 31, 63,126,140,139, 23, 47,194,199,199, 7, 90,173,182,166,251,166, 46,205,154,154,237,216,236,236,236,223, 26,147,206, +179,103,207,154, 0,120,214,180, 67, 93,219, 44, 57,246,150, 45, 91,202, 68, 2,193,174,175, 22,206,181,142,141, 61,140,240,136, + 40, 88,217,250,195, 68,103,160,160,176, 28, 69,247,179,176,100,201, 74,204,153, 51, 19, 95, 47, 94,104, 59, 98,212,216,157, 29, + 59,118, 12,184,114,229,138,238,101,201,119, 82, 32,218, 16,127,253,210, 4, 0, 40, 77,220,139,143, 71,134,163,172,236, 62, 62, +252,112, 46, 50, 51, 51,113,239,222,189,216, 23,156,206,151,214, 96,113,248,123,167,209, 58,241,240,128,148, 49, 26, 15,173,255, +110,169,189,173,141,204,245,250,241,253, 72, 75,203,174,243,127, 52, 26,141,225,192,129, 3, 56, 62,105, 28, 2, 8, 19, 28,191, + 92, 14, 55,165, 18, 37,227, 6,161,220, 72,163,233,145,107,144,216,216, 64,108,109, 99,113,196, 65,163,209, 24, 78,159, 62,141, +132,132, 4, 8, 4, 2,216,216,216,192,218,218, 26, 18,137,164,202, 88,153, 31,192,150,106,114, 28, 7,129, 64,128,219,183,111, + 35, 45, 45, 13, 14, 14, 14,184,120,241, 34,122,246,236,249,132,185,162, 40,234,137, 62, 94,150, 98,110, 90,172,201,128,161,158, +166,193, 39, 16,186, 0, 78,111,163,236,138, 18,112, 28, 5, 35,103, 15,150, 99,113,227,126, 1, 62, 24,213, 31, 0, 48,113,206, + 15,232,217,193,183,170, 9,178, 33, 40,149,202, 15, 90,181,106,181,114,194,132, 9,164,181,181, 53,244,122, 61,244,122, 61,146, +146,146,224,236,236, 12,153, 76,214,168, 48, 1,199,113,143,148, 74, 37,164, 82, 41, 56,142,123,212, 24, 13,130, 32,176,107,215, +174, 26,183,189,179,242, 14, 4, 21,221,179,176, 97,195, 6,152, 76, 38,112, 28,199,135,176,254, 9, 56,120,184,203, 61, 65,114, + 70,100,229,228, 99, 80,191,222, 16,136,108,144,154,145,143, 54,205,253, 20,111, 13,140, 80, 80,132, 9, 95, 44,219, 49, 17, 96, +183, 88,112,191, 51,137,137,137,194,248,248,120, 80, 20, 5, 59, 59, 59,200,100, 50,136, 68, 34, 72, 36,146, 42, 99,197, 71,176, +234,166,119,239,222,147, 89,150,157,197,178,108, 81,187,118,237,148, 11, 22, 44,176,207,200,200,192,237,219,183,177, 99,199,142, +124,142,227, 76,149,157,221,231, 63,235,111, 89, 16,217, 2, 65, 16, 13,238,231, 20, 28, 28, 44, 50,209,197, 31,219, 91, 49,175, + 9, 72, 59, 31, 83,105,249,163, 82, 35,121, 32, 57, 35,107,117,101,244,171, 86, 36, 66,225,228, 85,203,103,185,187, 56,211,232, +211,231, 53, 60,124, 84,132,153, 51,135,162,180, 84,135,237,191,172, 0, 32, 6,109,162, 16,218, 62, 10, 10,133, 23, 34,195, 35, + 21,231, 46,156,155, 8, 96,197,203,114, 13, 60,222,247,254, 68, 0, 11,189,189,189,207,254,176,100,137,127,143, 30, 61, 0, 0, + 39, 79,158,196, 79, 35, 71, 98, 62, 48,218, 22, 80,125, 12,204,124,161, 79,140, 6,122,145,255,118,131,101, 62,160,134, 28, 24, + 33, 53,217,238, 94, 48,107,178,175,119, 19, 63,249,213,191,118, 33, 37, 37, 19, 57, 57, 69,117,157, 52,150, 32, 8,182, 73,147, + 38,176, 51,234, 96,207, 25,224,166, 80,194,214,201, 25, 69,198,202,200,149,181, 53,196,214, 54,150, 62, 28,171, 52,155, 55,111, +142,156,156, 28,136, 68, 34,216,216,216,192,214,214,182,202, 96,153,205,149,165, 15, 92,130, 32,192,178, 44, 4, 2, 1,110,222, +188,137,200,200, 72,120,121,121, 97,231,206,157,232,211,167,207,223,162, 88,141,105,122, 50,247,185,170, 30,185, 34, 73,114,134, + 37,157,219,159, 64,220, 20, 38,219, 55, 65,202,122,128,230,236,160,231, 20,149, 77,130, 28,254,186,150,131,228,180,252, 39,154, + 11, 45, 55,207, 30, 74,169, 84,186,109,230,204,153,221,195,194,194, 64,211, 52, 0, 64, 38,147, 65,175,215, 67, 40, 20,130,166, +105,104,181,218,204,127,226,194, 53,159,243,227,199,143,131, 32,136, 42,163,107,110, 42, 84,171,210, 49,118,202,118,136, 5,192, +205,155, 55, 17, 20, 20,196,151,168,255, 16, 86, 82,169,179, 88,106, 15,214,164,131, 64, 40,132,183,215, 43, 96, 25, 61,138, 74, + 53,120,231,205,129,136,187,117, 7,135, 79, 95, 53, 25,141,236,106, 75, 53, 3, 3, 3,145,155,155, 11,138,162, 96,107,107, 11, +107,107,107, 52,107,214, 12,233,233,233, 79, 68,177,120,106,135, 36,201,217,135, 15, 31,118,167, 40, 74,110, 50,153,144,158,158, +142,155, 55,111, 98,205,154, 53, 57,106,181,186,107, 92, 92, 92,114, 35,100,107,107,182,171,169,179,122, 99, 34, 91,213, 43,127, +254,118, 18,195,137,229,203, 38,121,182,106,211,142,144, 82, 54, 37,154, 7,185,145,215,174, 94,142,152,179,229,143,201,105,197, +154, 30,185,185,185,181, 86,222, 40,146,236,217,172, 69, 75,146,101, 51, 64,137,130,240,221,202,207, 80, 88,164, 70,121,153, 22, +128, 24, 6,163, 0,122, 61,129,110,221,123, 96,231,174, 3,104, 23,214,142,162, 72,178,247,203,100,176, 0,128,162,168,165,251, +247,239,247,151, 74,165, 88,188,120, 49,108,109,109,113,101,225, 66,252, 36, 18,193, 10,192, 6,154,158,129, 23,103,176, 26,227, + 69,254, 21, 17,172, 6,225,233,233,185,162, 99, 68,135, 87,155, 52,111, 39,189,122,116, 47,238,223, 75, 67,126,126, 9, 56, 64, + 91,215,201, 35, 8,130, 19, 10,133,112,251,226, 43,120,183,106, 5,205,248, 33, 40, 50,210,240,251,235, 10, 36, 54, 54,184,219, + 43, 20,156,193,128,206,137, 57,150, 26, 23,142, 32, 8, 14, 0, 92, 92, 92, 32, 18,137, 32,149, 74, 33,149, 74,171,250, 94, 85, +127, 89,106,134, 88,150, 69,105,105, 41, 30, 61,122,132,241,227,199, 67, 38,147,129, 32, 8,228,228,228,192,199,199, 7, 20, 69, + 33, 51, 51, 19,167, 78,157, 66,147, 38, 77, 32, 22,139, 27,116, 49, 84,235,212,222, 90,169, 84,158,229, 56,174,245,245,235,215, +237,194,194,194,208,160, 8, 22, 33,130, 30, 62, 96,224, 9,150,251, 79, 95, 43,163,233,201,202,155,217,100, 89,130,187,187,123, +112, 80, 80,208,229, 53,107, 86,219,186,185,185,131,101, 25, 24,141, 70,148,148,148, 66,163,209,192,219,219, 27,214,214,214,220, +242,229,203, 9,134, 97,254,177,161,188,102, 67,101,142, 32,154,251, 95,145, 36,137, 41,175,121,163,168,200, 22, 20, 85,241,217, +210, 99,231,121,254, 88, 91,219, 58, 9, 68,214, 96, 73, 1,236,237, 29, 33, 16, 91,131, 53, 9,192,176,128,173,189, 11, 46,197, + 37,225,242,173,178, 15,114, 11, 96,201,208,125, 78, 32, 16,112, 20, 69,193,205,205,173,202, 76, 9,133, 66,243,181,139,210,210, + 82, 80, 20, 85,245, 29, 79,221, 21,201,212,212, 84,168,213,106, 92,185,114, 5,187,118,237,202,123,218, 92,245,234,213,107,130, + 76, 38,155,163,211,233, 22, 31, 59,118,108,125, 93,154,141,104,182,107, 76,228, 43, 48, 52, 52, 84, 40,228,138, 14, 31,217,187, +210,211,142,137, 35,144,250, 62,144, 92,154,104,115,205, 45,188, 71,251, 1, 68,243,175, 62,241, 25, 52,119,229,145,220, 92, 4, +163,150, 17,207, 28,208, 82,106, 37, 5, 56, 2, 23, 47, 28,173,104, 22, 44, 44, 67,185, 90, 7, 61, 77, 65,111, 32,160,163, 9, +244,232, 25,133, 77, 91,126,135, 42,183, 8, 28,208,234,101,187, 14, 2, 2, 2,218,122,120,120,224,147, 79, 62,129,110,199, 14, +148, 3, 24, 0, 96,127,101,165,218, 22,152,198,223, 45, 47,208, 96,121,120,120, 76,110,221,186,245,123,155,127,222,110,179,108, +238, 23,165, 69,137,183, 40,131,150,182,214, 27,141,134, 7,170,130,213,245,152,161,138, 90,167,131, 35,100,118,246,208, 63, 21, +185,226, 12, 6,176,180, 1, 34,203, 31,142, 28, 65, 16,224, 56, 14, 86, 86, 86, 16,139,197, 53, 70,174, 26, 18,193, 2,128,226, +226, 98,236,218,181, 11,237,219,183,135, 76, 38, 3, 69, 81,104,221,186, 53, 18, 19, 19,225,231,231, 7, 0,216,191,127, 63,222, +120,227, 13,220,191,127, 31,193,193,193, 54, 49, 49, 49, 13, 50, 88, 12,195,224,248,241,227,118, 28,199,189,202,113, 28,242,242, + 26, 55, 26,150, 97, 24,168,213,106, 28, 63,126, 28, 89, 89, 89,144,203,229, 40, 41,177,133,157,146,173, 50,139,230,151,133, 15, +222, 47,222,125,247, 93, 91, 27, 27, 27, 48,140, 9, 66,161,176,202,184, 10,133, 34, 36, 37, 37, 97,228,200,145, 37,169,169,169, +159, 55,114,212, 15, 33, 16, 16,238, 37, 37, 69, 40, 43, 45, 6, 69,193, 11, 0,133, 70, 76,253, 64,146,100,213,187,249, 69, 16, + 4, 68, 66, 10,114,119,215,170,142,239,149,209, 59,190,137,240, 5,250, 42, 0,195, 1,188, 93, 84,102, 16, 20,150,105, 1,147, + 1,143, 82, 31,161, 88, 77,131, 51, 25,241, 56, 67, 5,181,158, 69, 65, 97, 25,218,180,237,179,230,244,233,211,179,105,154,158, + 5,224,144, 37,215,124, 76, 76, 12,206,157, 59,135, 11, 23, 46,192,220, 81, 26, 0,236,236,236, 16, 29, 29,141,110,221,186,241, +185, 80, 7, 52, 77, 47,238,221,187,247, 44,185, 92, 46, 93,177, 98,133,189,183,183, 55, 8,130, 40,125, 58,114, 21, 22, 22, 54, +123,198,140, 25,138,161, 67,135, 78, 1,176,190,145, 63, 87, 87,103,245, 58,203,168,154,166, 98,200,205,205,158,176,113,219, 88, + 87,107,225,163, 44,164,126, 87,105,190, 40, 64, 83, 10,156,222, 14,209,171, 95,165,142,234, 62,209, 45,171,108,245,187,153,217, +153,155,106,121,208,177, 73,201,105, 88,183,110, 21,230,204,153,136, 29,219, 87,129,229, 68, 40, 83, 27,225,174, 12,129,193,200, +130, 32,133,232, 20,222, 25, 23, 46, 93, 5, 24, 26, 83,198, 95,126,233,230, 90,187,119,239,222,181,180,180,180,160,185,115,231, + 98,171,135, 7,108,109,109, 49,117,222,188,203, 12,195,132,243,119,201,243, 49, 88, 22,135,228, 60, 60, 60, 6, 43, 20,138,101, +219,183,111,183,202,202,202,130, 50,160,133,221,159,127,236,210,187,217,136,180,170,194,162, 49,241, 89,234,122,135,219,147, 36, + 9,211,194,169, 40, 48, 25,224,251,231, 37, 72,108,108,144,220, 39, 12,156,193,128,240,216, 84, 72,108,108, 32,144, 90, 53,248, + 96,106,138, 88, 85,127,153, 11,227,250, 48, 24, 12, 14, 61,123,246, 68,143, 30, 61, 48,100,200,144,170,166,192,144,144, 16,252, +254,251,239, 24, 60,120, 48,226,227,227,161, 84, 42,209,172, 89, 51, 52,107,214, 12,167, 79,159,110, 88, 28,180, 50,130,213,167, + 79,159, 82,130, 32,110,114, 28,215,250,218,181,107,118, 13,213, 48, 27,168,227,199,143,163,127,255,254,240,243,243, 67, 92, 92, + 28,162,191, 90, 14,129,141, 11, 64,186,129, 99,185,170,200,150, 37,125,176, 68, 34, 81,100,147, 38, 77,144,157,157, 3,137, 68, + 2, 71, 71, 7, 88, 89, 89, 65, 34,145, 98,201,146, 37,236,166, 77,155,214, 18, 4,241,149, 74,165, 42,108,132, 57,111,234,226, +226,242,203,152,209,163, 58, 56, 59,187,192,221, 93,129, 25,211,103, 70,237,248,125,103,194,227,199,143, 71,100,101,101,221,178, + 84,139, 32, 8, 24, 12, 6, 80, 20,133,253,201,174, 80, 27, 8,148,102,196,226,227,215,124,170,204,150,185,169,215, 60,253, 5, +207,139,129,162,168,173, 83,167, 78,237, 58,108,216, 48, 66, 68, 26, 13,209,199,182, 9, 24,198, 68,124, 54,235, 71,230,204,249, +179, 36,195,152,136, 33, 35,167,177,135, 79,221, 34, 63,152,178,156, 9,233,216, 31,183,111,223,150, 15, 24, 48, 96,145,209,104, +180,200, 96,153,243,184,150,223,231,155, 8,235,225,228,201,147,107, 1,172,237,213,171, 87,182, 76, 38, 67,121,121,249,223,250, + 41, 6, 7, 7, 91,167,164,164,136,196, 98, 49,218,182,109,235,202,178,108, 50, 65, 16, 43,142, 31, 63,190,185, 33,191, 85, 75, +100,171,209,211, 52,216, 58, 49, 3, 91,181,107,102,155,100, 61,215,214, 74,168,187,241, 74,178,212,142, 0, 80,162,149, 63,188, +152, 49,162,156,204,165,218,180,234,222, 28,182, 66,217,107, 0,106, 52, 88, 4,112, 83, 93, 86,214, 91,163, 53,225,236,153,120, + 12, 29,234, 13, 29, 77, 66,171, 35, 65, 27, 57,144,148, 8, 4, 37,194,152,113,239,193, 96, 98, 81,172, 82,129, 0,226, 95,182, +235,128, 97,152, 25,131, 6, 13,106,183,120,241,226,224,169, 83,167, 2, 0,148, 74,101,167,217,179,103,223,249, 7,230,193,122, +105,154, 7,159,142, 96,213,121, 96, 93,186,116,217,108, 52, 26, 95, 47, 44, 44,116,124,239,189,247,232,252,252,124,236,219,183, + 15, 63,253,244,147, 70,109,164,174, 23, 23,152, 70,167,168,212, 25,150, 20,138, 36, 73, 66,100, 52,130, 51,253, 39,114,197,234, +245, 85,145, 44,161,149,172, 97, 57, 82, 25,193,170,201, 84,153, 35, 89, 13,121,216, 74, 36,146,226, 11, 23, 46,184,101,100,100, + 60,209,161,221,215,215, 23, 0,112,237,218, 53, 92,185,114, 5, 35, 70,140,128, 64, 32,128, 72, 36,194,205,155, 55,203, 26,146, +102,179,225, 49,143, 34,148,203,229,125, 58,116,232, 80,219,232,193,122,181, 30, 63,126, 12, 63, 63, 63,232,245,122, 56, 56, 56, +160, 64,245, 8,143, 31,165, 64,163, 79, 70, 19,185, 20,185,185,185,144, 72, 36,150,222,112,140,185,224,210,235,245, 80,169,178, +161, 84, 42,241,235,175,219,177,121,243,230, 17, 42,149,106,119, 99,174, 53,133, 66, 49,173, 95,191,126,139, 94,127,253,117,129, + 70, 93, 14,142,173, 48, 60, 34,177, 8,223,127,255,125,179, 83,167, 78,221, 88,179,102,205,215, 82,169,116,209,195,135, 15, 13, +245,229, 57, 0,108,221,186, 21, 0, 32,235, 56, 15, 51,134,189,130,183, 39,110,195,138, 21,123,159, 56, 86,138,162,176, 96,193, + 2,190, 68,125,129,116,236,216, 49,100,214,172, 89, 66,115,159, 56,165,247, 98, 19, 77,211, 44, 0, 4,181,126,245, 63,145,202, + 62,192,253,251,247,177, 98,197, 10,168,213,106, 8, 4, 2,145,209,104,180,232, 55,122,246,236,137, 62,125,250, 84, 53, 19,186, +184,184,128,166,105,152, 76, 38,222, 92, 53, 48,146,213,191,127,255, 89, 44,203,114, 44,203,206, 53,127, 31, 26, 26,106,229,230, +230,118,113,213,170, 85,206, 38,147, 9,211,166, 77,115,200,207,207,119,152, 52,105,210, 76, 0,155,107, 41, 39, 26, 50,187,186, + 69,211, 52,212,212,167,139, 32,136, 38,214,214,246,200, 67, 54,138, 93,140, 33,197,206,166,194,227,170, 15,110,122,165,183, 9, +178, 98,140,126,100,169, 1,246, 86,118, 0,203, 5,212,250,156, 99,217,227,137, 9,119,122,120,122,248, 81, 7,254, 60,131,254, + 3, 7, 67,103, 32,160,163, 73, 16,148, 16, 4, 37, 66,187, 14,225,240,245, 11, 4,203, 2,119,226, 99,105, 35,203, 30,121,153, +242,190,250, 60, 88,211,190, 63,137,217, 11,191,195,168, 33,125, 48,118,236,216,127,114, 30,172,151,182, 15, 86,109,230,234, 29, + 71, 71,199,145,227,198,141,179,186,118,237, 26, 22, 46, 92, 40,136,142,142,166, 99, 98, 98, 76, 12,195, 76,203,202,202,218,216, +144, 31, 37, 73, 18, 77,182,255, 5,165, 92,142,123, 81,237,158,136, 92,157,109,237, 9, 86,175, 71,175,148,146, 6, 31,140,185, + 41,203,108,172,204,230,170,142,169, 20,234,170,129,215, 56,239,213,135, 31,126,136,205,155, 55, 35, 60, 60, 28,254,254,254, 16, + 8, 4, 85,205, 82,141,137, 96,153,105,240,232,193,167,106,243,222,222,222,184,117,235, 22,236,237,237,241,203, 47,191,192,203, +211, 3,163,123,251,194, 96, 48,192,104, 52, 66,173, 86,155, 35, 88,245, 38,148,101,217,132,125,251,246,249, 13, 27, 54,140, 19, + 8, 4,132, 94,175, 7, 0,172, 94,189, 58,183,161, 51,174, 87,214,134,134, 72, 36,146, 45, 35, 70,140,176,109,214,172, 25,114, +114,114,112,245,234,101,204,156, 57,227,170, 80, 40,208, 69,245,237,215, 53, 56,184, 5, 38, 78,156, 72,134,132,132,204,153, 57, +115,230, 52, 79, 79,207,177, 25, 25, 25,187,234, 51, 89,191,255,254, 59, 0,224,221,239,239,194, 96,168, 40,152, 55,108,216, 0, +185, 92,254,196,190, 15, 30, 60,224, 71, 17,190, 64, 76, 38, 19, 71,146, 36,145,158,158, 78,203,100, 50,194,201,201, 73, 32,145, + 72,160,215,235,171,140,214,253,251,247,113,232,208, 33,100,100,100,192,201,201,137,180,183,183,135,201,100, 42,178,244,154,175, + 62, 90,208,108,168,120,115,213,112,206,158, 61,187, 22,192, 90,243,231, 30, 61,122,140, 39, 8, 98,186,209,104,180,219,188,121, +179,131,157,157, 29,113,232,208, 33,195, 15, 63,252, 80, 78, 81, 84, 17,128,229,117,149, 41,207,107,118,245, 58, 34, 95, 96, 76, +184, 87, 84,158,226, 35,180, 81,176,241, 58,226,210, 39,233, 51,130,138,200, 0,119,162, 69, 11,211,208,220,132,139,163,141, 15, +195,243,114,114, 9,134,227,106,157,196,169,168,164,100,253,150,159,119,126,188,111,207, 54,111,169,157, 12,163,222,158,140,227, + 39,206, 67, 44,145,225,234,245, 27, 48,208, 12, 82, 31,103, 98,196, 91,163,160,112,115, 6,165,201, 82,233, 13,134,141, 47, 83, +222, 63, 49, 15, 86, 88, 56, 46,238, 93,142,223,147,189,145,185,112,225, 63, 61, 15,214, 75, 23,193,170,145,246,237,219,219, 22, + 23, 23,127,255,233,167,159, 90,169,213,106,228,231,231,163,160,160, 0, 87,175, 94,141, 54, 26,141, 31,215, 53, 74, 3, 21,171, +109,223,126,186, 80,164, 40, 10, 78,174,110,144,216,216,130, 51, 24,170, 34, 87, 34,153, 53, 88,189, 30, 44,109, 0,106,111,206, +169, 81,147, 32,136,191, 69,173, 26, 96,174,158,208, 52, 71,196,106,154, 84,212,203,203, 11, 95,127,253,245,223,166,105,176, 36, +157, 64,197,104, 65,142,227, 90,155, 35, 79, 28,199,181,150,203,229,125, 44, 28, 57, 88,163, 38,203,178,232,210,165, 11,162,163, +163,113,235,214, 45,144, 36,137,190,125,251,130, 32, 8,216,219,219, 67, 32, 16, 84,153, 57,243,128,128,186, 52, 25,134,121,251, +167,159,126,250,236,200,145, 35, 95,124,244,209, 71, 86,175,190,250,170,185,159, 87, 30, 42,214,120,108, 80, 58, 89,150,157,127, +243,230, 77, 91,147,201,132,197,139, 23,227,250,245,235,234, 7, 15, 30,124,170, 82,169,182, 0,224,138,138,203, 70, 61,124,248, +104,221,151, 95,126,105,219,189,123,119, 92,187,118, 77,234,229,229,245, 37,128, 93,245, 29,251,213,171, 87, 65, 81, 20, 76,133, +105,152, 56, 99, 39,108,100, 66, 36, 37, 37,161,160,160,160,234, 90,171,163, 41,169, 70,205,103,132,215, 4, 16, 19, 19,243,199, +218,181,107, 63, 28, 51,102,140,136,227, 56, 38, 45, 45,205, 8,128,144,203,229, 84, 76, 76, 12,123,240,224, 65,104,181, 90,120, +122,122,146, 30, 30, 30, 68,116,116, 52,155,152,152,120,149,227,184, 89,150,166,179,186,185, 18, 10,133,208,106,181,150,154, 43, + 62,143,234,102,222,222,189,123, 21, 58,157, 14, 98,177, 24,187,119,239,166,183,109,219,118,167,180,180,180,115, 92, 92,156,182, + 49,154,141,152,166,161, 78,205,178, 34,242, 80,244,241, 59,173,141,221,126, 36, 62,202, 46,136,172,170,184, 18,132,203,110,247, +150, 46,210,246,109, 50,109,206,125, 75,150,115,154,131,181,105, 62,124,248,208, 96, 27, 18,242,198,212,207,230,158, 94, 56,127, +158,237,210,111,150,225,118,255,161, 40, 46,209, 64,111, 96, 64,155, 88,204,159,255, 21,220,156, 28,224, 40,162,203,139,181,196, + 27,137,137,137,244,203,148,239,207, 56, 15,214,255, 71, 58, 95, 42,234,117, 31, 26,141,102, 97, 96, 96,160, 56, 49, 49, 17, 15, + 30, 60, 64,114,114, 50, 24,134,185,159,153,153, 57,160,177, 63, 74,146, 36,236,237,237, 33, 22,139,209,233, 86, 38,196, 34, 17, +196,214, 21,203, 83,245, 74, 41, 1, 56, 14,164, 88,210, 96,205,167,231,188,122,150, 81, 68, 12,195, 84,205,208, 94,125, 61,195, +167, 71,171, 53, 52,114, 69,146,228,140,203,151, 47,219,165,165,165,129,227, 56,236,221,187,215,110,200,144, 33, 51, 26, 19,189, +226, 56, 14, 5, 5, 5, 96, 89, 22, 66,161, 16,221,187,119, 71,104,104, 40,202,203,203,193, 48, 76, 85,243,165, 72, 36,106,208, + 40,194,220,220, 92, 13,128, 5, 70,163,113,227,156, 57,115, 22,180,108,217,242,189, 79, 62,249,132, 68, 35, 7, 69, 16, 4, 97, + 50,153, 76,216,189,123, 55,246,236,217, 83,198,113, 92,160, 74,165,202,174, 22,189,219,126,229,202,149,232,193,131, 7,223,127, +248,240,161, 93, 73, 73, 9, 80,207, 28, 54,149,215, 38,252,253,253,193, 48, 12,150, 77,244, 68, 89, 89, 43, 48, 12, 3,147,201, + 4,153, 76,246,196, 18, 68,252, 44,238, 47,184,102,204,178, 51,103,207,158,125,244,235,175,191,158, 49,101,202,148, 14, 99,198, +140, 17,138, 68, 34, 54, 51, 51,211,180, 99,199, 14, 34, 32, 32,128, 20, 10,133,196,241,227,199,217,107,215,174, 93, 49,153, 76, +203, 0, 52,104, 41,146,234,230,138,239,115,245, 92,217, 53,108,216,176, 49, 67,135, 14,181, 10, 9, 9,145,252,244,211, 79,197, +106,181,186, 54,115,245,183,224,101,109,211, 52, 60,167, 9, 72, 1, 0, 42,149,106,227, 87,243,206, 77, 28,229, 63, 50,224, 61, +231, 87,112, 66,157,139, 34, 33, 69,218, 57,144, 8,241,161,160, 41,126,232,118,226,218,222,100,149, 74,181,181, 46,157, 27, 55, +110,196,145, 36,217,229,237,119,222,221, 55,110,204, 56,229, 23,159,124, 44, 60, 20,125, 26,140, 81,143,243, 39, 79,194,197,134, +100,104,117, 78, 86,137,145, 28, 20, 23, 23,247,210,245,191,170,156, 7,107, 34,128, 17,243,230,205,219, 49,113,226, 68,176, 44, +139, 51,103,206, 96,221,244,233,152,207, 48,163,109, 1,205,199, 21,251,240, 60, 47,131,213,174, 93,187, 87,212,106,245, 47, 6, +131, 33,132,101, 89,241,217,179,103,161,211,233,144,152,152,168,101, 89,246,143,103,248,205,180,190,125,251,146, 79,175, 23, 87, +139,201,177,180,115, 93, 90,207,158, 61,159,155, 38,203,178, 25,213,215, 48,171, 77,183,250,103,147,201,148, 97, 73, 66, 89,150, + 93,218,169, 83,167,191,125,215,200, 66, 44,165, 71,143, 30,244,211,166,171,166,191,171, 29,127,134,165,250,249,249,249, 57, 0, + 62, 96, 89,118,213,216,177, 99,231, 1,184,223, 72,131,181, 40, 56, 56,120, 78,197,159,196,194,172,172,172,236, 26, 76, 93,158, + 82,169,124,207,203,203,171,106, 1,232,250,142,189, 87,175, 94,116,125,139, 60, 87,143, 92,177, 44,155,193,223,242, 47,148,243, + 26,141,230,252,146, 37, 75, 58,175, 91,183,110,230,135, 31,126,216,126,248,240,225,130, 46, 93,186,224,240,225,195,204,153, 51, +103,174,106,181,218,165, 13, 53, 86, 4, 65,148, 63,125, 15,213, 81, 9,209,241,217,208, 48, 78,158, 60, 57, 53, 60, 60,124,222, +174, 93,187, 82,125,124,124, 36, 4, 65,152, 44, 52, 87,207,125,154,134,186,140, 28, 85,174, 27,184,125,228,135,135, 66, 62,122, +215,167, 79,120, 91,169,103, 83,133, 60, 41,173, 0,233, 55,163,181, 15,207,174,123,196,233, 10, 6,194,130,136,123,108,108,108, +188,159,159, 95,224,198,159, 54,191, 43,162,168, 94, 44,199,133,126, 62,105, 52, 72,130,136,163, 25, 38,186,180,172,108, 75,125, +125, 66,255,237, 72, 68,162,209,147, 38, 77,194,175,191,254,138,125,171, 86,161, 79, 70, 6,126, 23,137, 96, 37, 18, 97, 3, 77, + 79, 0,111,176, 26, 69,173, 78, 36, 48, 48,240,247,194,194,194,161,165,165,165, 38,147,201,196, 16, 4, 97, 34, 8, 66,203,178, +236, 87, 44,203,254,128,138, 78,104,245,193,135,226,121, 77, 94,147,215, 52,211,217,206,206,238, 19,150,101, 81, 94, 94,190,202, + 66, 99,197,159,207,127, 72,179, 91,183,110, 43, 73,146,236,192, 48,204,207,103,206,156,217,244, 44,154, 13,236,252,222,144,116, + 10,228,114,249, 56,206,209,102, 0,140, 2,127,142,166,146, 40,186,240, 80,101,228,138,229,243,221, 50,205,164,164, 36,206,201, +201, 9,133,133,133,216,211,172,217, 19,219,108,129, 13,181, 68,176, 94,104, 19, 33,199,113,237, 0,184,154,235,255, 0,146, 0, +180, 5, 96, 5, 64, 15,160, 28,128, 75,181,127, 41,168,220,102,222,126,142, 32, 8, 35, 94, 34, 90,242,154,188, 38,175,201,107, +242,154,188, 38,175,201,107, 62,163,193,234,143,138,192, 14, 55, 99,198,140,153, 28,199, 69,205,152, 49, 99,102,181,207, 85,219, + 43,118,231,250, 63,181,189, 29, 94, 50,248,139,143,215,228, 53,121, 77, 94,147,215,228, 53,121,205,231, 98,176,234,122,175,237, +239,106,239, 47, 20,162,142,147,116,251,255,249, 68,223,230, 53,121, 77, 94,147,215,228, 53,121, 77, 94,243,127, 78,179, 62,237, +219, 53, 25, 44,130, 32, 14,113, 28, 55,160,250,123,181,237, 3, 0,192,188,205,252,119,245,237, 4, 65,252,133,151, 8,222,221, +243,154,188, 38,175,201,107,242,154,188, 38,175,249, 76,252, 27, 35, 88,181,142, 34,228,118,239,166, 50,131, 97, 39,182,146,137, + 0,192,160,213,208, 30,137, 40, 37,134, 13, 99,192,195,195,195,195,195,195,195,243,130, 33, 8,226,208,140, 25, 51,102,253, 27, +210, 42,168,205, 92,229,135,201, 92, 4,250,162, 64,198, 68, 7, 1,128,128,228,238,230,135, 57, 38,115,187,119,231, 63,111,147, + 21, 21, 21, 53,139,227, 56,119,161, 80,248,151, 92, 46, 63,179,105,211, 38, 35,127, 25,189,120, 56,142,171,119,177,198,182,109, +219, 58,234,245,250,229, 44,203,118,175, 92,231,239,140, 72, 36,250,236,198,141, 27,133, 4, 65,212, 58, 36,218,219,219,123,135, +159,159, 95, 32, 87, 1, 0, 60, 49, 47,151,249, 59,243,246,199,143, 31,223,203,200,200,120,203,210,180,123,121,121,249, 74,165, +210,119, 8,130, 8,174,212, 73,212,233,116, 63,167,167,167, 63,250, 95,203, 71,133, 66, 97,197,113,220,235, 66,161,112,140,147, +147, 83,251,188,188,188,249, 89, 89, 89,223, 61,195, 51, 98,154,131,131,195, 8, 7, 7,135, 38,133,133,133, 15, 75, 75, 75,119, + 1, 88, 1,160,222,251,244,171, 73,202,142,175,246,235, 50,247,220,225,179, 11,191, 92,151,117,229,233,237,243,167, 41,156,187, +247,136,152,123,228,175, 75, 95, 45, 89,151,213,208,181, 45,201,202, 23, 80, 49, 98,204,220,193,245,191, 53, 95, 66, 0, 76,103, + 24, 70, 72,146,228,119,217,217,217, 23,254,219,175,165,102,205,154,125, 33, 22,139, 39,144, 36,249, 48, 39, 39,103,156, 74,165, +122, 94, 83,157,144, 62, 62, 62,182,105,105,105,101,176,108,242, 98, 30, 0, 29, 59,118,204,161,105,218,173,174,125, 68, 34, 81, +238,149, 43, 87,220, 95,194,195,207, 55, 55,253, 1,200, 5, 64, 85,126, 54, 84,190,231, 84,251, 46,167,150,237,255,188,193,202, + 12,134,157, 64, 95, 20, 88,144,115,103,120,158,234,198,155, 0,224,170, 8,217,229,236,222,124,103,102,176,152,150, 55, 27,108, + 35,148, 9,214, 83,148, 48, 68,103,208,187, 8, 5,194,124,218,100,188, 65, 26,184,137,217, 73,251, 30, 91,242,195, 3, 6, 12, + 8, 4, 96, 31, 26, 26, 26,115,254,252,249,246,223,125,247,157, 98,207,158, 61,173, 99, 99, 99, 71, 14, 28, 56,240, 79,142,227, +142, 29, 58,116, 72,219,160,163,233,210, 69,224, 86,236, 52,154, 18, 8, 6, 2,104,205,113, 0, 8,234, 38,107,164,255,202,117, + 44,248, 25, 21,115,180, 52,238,194, 14,117, 10, 36, 88,250,115, 33,197,117, 54, 50,196,121,142, 20, 45,191, 18, 87,152,108,185, + 1, 80,244, 20, 11,136, 31, 1,192, 96,226,222, 75, 79, 87,157,120,150,253,106,121,128,247, 2,176,157, 32, 8, 33,128, 13, 12, +195,236,207,201,201,137,135, 5,147,118, 90, 66,243,230,205, 93, 9,130,184,185,114,229, 74,231, 14, 29, 58, 80, 44,203,226,212, +169, 83,111,205,153, 51,167, 79,139, 22, 45, 90, 86, 94,244, 53,226,231,231, 23,120,242,228,201, 54, 71,143, 30, 69,120,120, 56, + 88,150, 5,203,178,112,112,112,192,193,131, 7,209,161, 67,135,170,239,220,221,221,209,165, 75, 23,100,100, 88,246, 44,111,210, +164,201,235, 45, 90,182,153,242,233,231,211,221,221,156, 93,108, 77,140,137,206,204, 84, 41, 87,125,183,172,163, 80, 40, 92,159, +146,146,178,191, 49, 21, 37, 79, 79,207,225, 66,161,112, 0,128,224,202,239, 18,141, 70,227,161,140,140,140,157,150, 22,228,173, + 91,183, 62, 71,146,228, 43, 13,249, 97,134, 97, 30,223,186,117, 43,178, 49,121,164, 84, 42,135, 41,149,202,159, 58,118,236, 40, + 11, 9, 9,129, 72, 36,194, 55,223,124, 51,205, 2,131, 37, 0, 48, 77, 38,147, 13,183,182,182,246, 43, 47, 47,127,160,213,106, +247,136,197,226,158,223,127,255,189, 87, 68, 68,132,109, 78, 78, 14, 65, 81,148,251,159,127,254, 57,122,205,154, 53,125, 76, 38, + 83,143,250,174,173,162,135,236, 92,137, 48,168,115,209,131,211,115, 1,244,125,122,187, 73, 39, 29, 67, 9,189, 6, 80, 92, 92, +122,165,105,179,184,128,246,244,244,252,222,221,221,125,172, 86,171,213, 17, 4,193, 85,190,204,181, 92, 0,128,193, 96, 40, 74, + 78, 78,110, 86,151,208, 43, 29, 29,175, 83, 36, 85,235,220, 77, 12,203,100,164, 94, 41, 10,123, 14, 21,166,190,165,130, 0, 0, + 32, 0, 73, 68, 65, 84,152, 79,226,227,227,135, 10, 4, 2,162, 77,155, 54,214, 0,250, 88,106, 46, 20, 10, 69, 32, 65, 16,179, + 57,142,139, 81,169, 84,235, 1, 48, 74,165,178, 27,199,113, 95, 84, 30,239, 55, 89, 89, 89,167, 43,175,129,245,254,254,254,175, +221,191,127,127, 67, 86, 86,214,162,198,166,215,223,223,127,226,228,201,147,231, 77,152, 48,193,170,160,160,192,167,119,239,222, +191,169, 84,170,206,207,114, 14, 66, 67, 67,133,217,217,217,211, 92, 93, 93, 63,106,215,174,157,226,206,157, 59,217,105,105,105, +171,229,114,249,138,184,184,184,122, 13,123,171, 86,173,148, 2,129, 96, 44,128,209,149, 5,232,239, 0,126,190,113,227,198,195, +255, 5,131, 69,211,180,219,137, 69,115, 65, 80, 20,164,157,123,130,101, 89,228, 47,159, 7, 83, 97, 62, 92, 22,173,134,201,100, + 66,207,158, 61,221, 94,210,200,213,181,127, 91,154,107, 52, 88, 98, 43,153,136, 49,209, 65,121,170, 27,111,182,143, 90,109, 15, + 0,215,142, 78,121,211,217,163,197,109,177, 64,150, 44,177,147,238,125, 99, 96,207,144,161, 3,186, 16,158, 10, 55,100,168,114, +221,183,252,126, 44,234,208,177,211,123, 81, 49, 47, 69,189,148,150,150, 46,246,241,241,113, 61,121,242,100,170, 88, 44,182,146, + 74,165,196,176, 97,195,172, 70,142, 28,217,252,212,169, 83,126, 71,143, 30, 29,250,218,107,175, 29, 21,137, 68,127,253,241,199, + 31,245,174, 79,230,214,242,245,230,100,153,228,143, 65,175,247,125,165,127, 47, 55,177,143,220, 21, 44, 43, 69, 82, 10,237, 29, +125, 62, 46,234,240,209,227,159, 51,193,175, 15,203, 75,220,127,203,210,147,211,162,133,157,131, 21,201, 77,181, 18,115, 35,186, +134,251,251, 14,236, 27, 78, 52,105,218, 4,201,137,201,126,167,207,198,140,149, 80,119, 30,105, 13,196,239, 90,150, 88,153,144, + 80, 90, 92,151,150, 88, 64,108,189,153,112, 95,201, 48, 12,190, 89,246,117, 52,203,145, 85,179,171,155, 95,230, 89,200,191,253, +246, 91,232,245,122,180, 11,105,177, 21,255,153, 55,198, 18,126,187,115,231,142,179, 70,163,193,209,163, 71,103,170, 84,170,153, +199,142, 29, 83,165,167,167,127,174, 82,169,126,127, 14,181,251,181, 27, 54,108,112,110,223,190, 61, 69,211, 21,243,155, 70, 68, + 68, 80,179,102,205,114, 90,178,100,201, 42, 0, 35,234, 40, 92,184,163, 71,143,226,151, 95,126,201, 95,182,108, 89, 6, 0,184, +184,184,120,188,245,214, 91,174,219,183,111,207, 91,185,114,101, 6,199,113,112,118,118,246, 28, 62,124,184, 43,199, 89,150, 84, + 79, 79,207, 38, 45, 91,135, 76,249,121,235,214, 14, 37,133,133,186, 31, 87,110,136,211, 11, 36, 26,159,224, 64,209,220,121,139, +236,191,250,114,230, 7, 52, 77,223,206,200,200, 72,177,244, 32,229,114,185,183, 68, 34,217, 59,107,214,172,150,145,145,145, 66, + 55, 55, 55,228,228,228, 32, 41, 41,169,229,197,139, 23, 95,223,191,127,255, 52,189, 94,255, 70,118,118,118,189,149, 9,142,227, + 2, 14,124,243,181,155,196,217, 5,172,209, 8,199, 86, 33, 85,219,178, 78, 29, 3,107, 52,130, 53, 26,225,213,255,245,170, 72, + 94,183,110,221, 26, 53, 37,185,135,135,135, 50, 32, 32,224,215, 25, 51,102,136,244,122, 61,110,220,184,129,203,151, 47,179,185, +185,185,245, 77,100, 43, 32, 8,226,248,188,121,243, 60, 35, 35, 35,109,243,243,243,193, 48,140,203,254,253,251, 39,134,134,134, +218,121,122,122,138,183,109,219,102, 94, 33,192,201,207,207,207,105,228,200,145,134, 95,126,249,101, 26,128,101,181, 69,174,138, + 31,176,115, 85,148, 95, 84,179,176,119,144, 45, 56, 22,245,105,111, 28,113,240, 35,171, 34, 89, 81,126,126,182, 37,153, 86,211, +109,236, 90, 58,149,100, 70, 79,143,242,243,219,124,244,225, 67, 75, 22, 77, 39, 61, 60, 60,190,239,215,175,223, 91, 27, 54,108, +144, 37, 38, 38,202,130,131,131,193,178, 44, 76, 38, 19, 24,134, 49,175,187,137,234, 19, 6,215, 6, 69, 82,158, 23,247, 38,184, + 89, 89, 89, 85,221,135,230,119,181, 90,141, 62, 99, 58, 62,151,135, 45,203,178, 98,243,117,109, 50,153,164, 0,132, 0, 44,157, +192,114,193,165, 75,151,134, 29, 57,114,100,212,162, 69,139, 2, 84, 42,213,100,150,101,231, 38, 38, 38,118, 1,128,224,224, 96, + 49,128,211, 10,133, 98,220,135, 31,126, 56, 97,210,164, 73, 24, 51,102,204,220,172,172,172,197,141,189,239,197, 98,241,151, 31, +126,248,161,149,209,104,132,149,149, 21,104,154,110,250, 44,199, 31, 28, 28, 44, 42, 44, 44,220,179, 96,193,130, 1,131, 6, 13, + 50, 47,225, 37, 63,119,238,220,146,207, 62,251, 44, 60, 52, 52,116,112,109, 38, 43, 52, 52, 52, 4,192, 87,190,190,190,125,198, +140, 25, 67, 69, 68, 68,160,188,188, 28,199,143, 31,159,189,119,239,222,217,161,161,161,151, 0,204,141,139,139, 59,243,178,155, + 44,202,198, 22, 73,111,116,131, 95, 98, 1, 0, 32,123,125,197,210,144,118, 95,126,203,135,248,254, 13, 6,171, 62, 52, 26, 77, +232,204, 41,163, 65,146, 21,181, 68,255, 38,222, 88, 50,107, 60,113,224,208,177,208,122,194,155, 43, 25,134, 9,112,114,114,250, +188,160,160, 64,186,106,213, 42,105,102,102,102,208,158, 61,123,184,248,248,120,136, 68, 34,216,219,219,163,123,247,238,146,168, +168,168,166,151, 46, 93,242,222,187,119,239,160,126,253,250,253,124,248,240,225, 63,107,211,117,110, 57, 48,192,197,213,245,236, +183,139,222,119,106,217,196, 15, 6,163, 17, 25,185,153,224, 32,134,220,205, 26,163, 94,111, 35,138, 8, 19,249,175, 88,119,242, + 12, 65,190,246,106,110,194,193,132,250,142, 49, 50, 84,118,173, 91,167, 87,218,190,214, 39,156,244, 15,110, 14,145, 68,246,159, + 90, 84,104, 40, 90,133,134, 18,227,199,151, 53,137,143,139,159,115,244,228,213, 89,246, 34, 83,236,133, 56, 77,251,218, 75, 90, + 72,204,107,167,189, 49,228, 77, 4, 6, 6, 62,241, 48, 55,255,157,154,154, 10,130, 32,144,159,159, 15,150,131,184, 17,121,131, + 43, 87,174,160, 77,155, 54,232,221,187, 55, 70,140, 24,161,216,191,127,255,111,107,215,174,237,146,153,153, 57,254, 89, 46, 22, +134, 97, 34, 66, 67, 67, 41,154,166, 65, 81, 20, 10, 10, 10,144,146,146, 2, 63, 63, 63,138, 97,152,174,245, 24, 13,132,135,135, + 99,217,178,101, 25,231,206,157, 11, 5,128,206,157, 59,199,117,232,208,193,117,229,202,149, 25, 23, 46, 92,104, 11, 0,225,225, +225,177, 97, 97, 97,174,150,166, 73, 38,147,189,251,201,167,159,185,150, 20, 22,105,141,101,101,180, 13,203,152,236,164, 66,162, + 52,175,160,248, 81,186,157,230,221, 9, 83, 4, 95,206,152,250, 46, 0,139,218,236,229,114,185,119, 80, 80,208,181,205,155, 55, +187, 57, 59, 59,163,184,184, 24, 5, 5, 5,184,118,237, 26, 88,150, 69, 84, 84,148, 36,180,117,235,208, 21, 43, 87, 94, 6,208, +201, 18,147, 37,113,118,193,158, 46, 21,183,198,176,135, 5, 85, 17,150,163, 35, 6, 86,237, 51, 50,173, 98,113,115,169, 84,218, +232,101,125, 56,142,235, 20, 17, 17, 33, 2,128,105,211,166,149,170,213,234, 37, 4, 65,252,166, 82,169, 50,235,249,215,105,115, +230,204,241,104,210,164,137,207,111,191,253,134,242,242,114, 0,112,107,210,164, 9, 2, 2, 2,152,179,103,207, 34, 48, 48, 16, +182,182,182, 56,123,246, 44,174, 92,185,130,144,144, 16, 91,145, 72,244, 38, 77,211, 53, 26,172, 87,251,117,153, 43, 17, 6,117, +110, 22,246, 14,108,236, 20,216,188, 99, 39,146,174,255,220, 89,111,188, 59,119, 38,206,190, 77,113,146,119,114, 31, 91,207,240, + 13,235,234,236,223, 98, 16, 94,105,123,195, 69,207,156, 75,153,211,171,201, 82,129, 84,183,109,254, 10, 85, 65,109,230, 74, 46, +151, 47,239,219,183,239,176, 13, 27, 54, 56, 0,192,173, 91,183,144,157,157, 13, 87, 87, 87, 72,165, 82, 8,133, 66, 8, 4,130, + 6, 45,149,101,101,101, 5,149, 74, 5,115,197,129, 97, 24,148,149,149, 85, 45, 26, 62,127, 62,200,249,243, 45,139, 54,201,229, +242,200,208,208,208,237,158,158,158, 94,213,191,215,235,245, 24, 63,126, 60,212,106, 53, 66, 66, 66, 34,220,221,221,245, 4, 65, +128,101, 89,228,228,228,148,223,186,117,171, 87, 86, 86,214,213, 90,106,239,218,236,236,108, 76,152, 48, 1,143, 31, 63,158,244, +235,175,191,166, 17, 4, 33, 21,139,197,230,237, 98,133, 66, 17, 24, 24, 24,248,253,251,239,191,143,212,212, 84, 36, 39, 39, 95, +123,150, 74,149, 68, 34, 81, 51, 12,227,102, 50,153,160,213,106, 17, 21, 21, 37,101, 89, 54, 71, 40, 20,222, 45, 46, 46, 30,149, +145,145,161,178,180,156, 81, 40, 20,114,181, 90,189, 97,202,148, 41,253,186,116,233,130,187,119,239,226,232,209,163,120,237,181, +215,208,181,107, 87,204,158, 61,187,255,220,185,115,167, 1,168,173, 50,240,199,158, 61,123,124, 61, 61, 61,171,150, 68,178,179, +179,195,187,239,190,139,209,163, 71,227,240,225,195,225, 95,127,253,245,158, 46, 93,186,184,157,125,134,150,138,127, 3,146,176, +112,248, 37, 22,224, 97,176,115, 69,235, 64,165,209, 50,127,134, 71, 40,239,108,254,155, 13,150, 65,171,161, 5, 36,119,215, 85, + 17,178,235,218,209, 41, 85, 77,132, 48,113,119, 13,180,134,174, 8,155,115, 40,213,152, 96, 37, 33,145,170, 42,195,237,135,249, + 53, 73,221,126,170,240,255,116,245,234,213,248,230,155,111,250,106,181,218,242,148,148, 20, 85,121,121,185,122,212,168, 81,132, + 80, 40,196,197,139, 23,241,232,209, 35,180,106,213, 10, 14, 14, 14,136,140,140, 20,245,238,221,219,107,220,184,113,111, 3,248, +179, 38, 77, 12, 29, 74,137,210,136,131,203, 23, 13,119, 34,168,100, 36, 63, 46, 70, 83,207,246,112,182,247, 66,102, 94, 57, 98, +239, 28, 70,242,131,191,208,212,211, 27,227,223,106,234,240,221, 15,121,135, 16, 58,190, 41,226,158,232,231,245,183, 33,161, 82, + 17,211,110,254,234,120, 48,234, 7,224,140,143,193,209,217,127, 47,220, 29,188, 16,212,198, 29, 50,177, 43,121, 43,241,187,118, +117, 29,187,222,196,125,177,120,225,130, 45,173, 67,218,162,164,164, 4,107,214,172,169, 50, 86, 28,199, 85,213,184, 59,118,236, + 8,163,209,136, 45, 91,182,192,200, 86,132,255,235, 74,231, 83,140,236,208,161,195, 78,142,227,196, 86, 86, 86,217,109,218,180, +241,153, 60,121,178, 96,248,240,225,208,106,181,239,111,222,188,249, 88,118,118,246,190, 6,106, 86, 52,163,188,242, 74,100,215, +174, 93,173, 40,138, 2, 77,211, 40, 41, 41, 65, 70, 70, 6, 82, 82, 82,224,226,226, 2,252,167, 47, 76,173,154, 79,175,133,200, +113, 28,103, 62,254,234, 70,204,124, 94, 44, 73, 39, 65, 16, 65,142, 14,142,214, 63,174,216,112,221, 85, 66, 17, 46, 94, 74, 66, +100,231, 32, 32,109,108, 37, 28, 69,105,125,188,148,182, 4, 65, 4,213,114, 88, 79,107, 18, 18,137,100,239,214,173, 91,221,132, + 66, 33, 24,134,129,171,171, 43, 82, 82, 82, 80, 92, 92,140,178,178, 50,164,220, 77,132,175,167, 39, 62, 30,255,158, 98,193,183, + 43,247, 2, 8,123,170, 16,251,251, 98,220, 70,227,211,105,174, 45, 4, 14, 11,211, 89, 91,132,228, 81, 86, 86, 22,100, 50, 25, +130,131,131,109, 98, 98, 98,206,103,101,101,101,214,167, 41,149, 74,223,140,136,136,176,221,177, 99, 7,218,182,109, 11,123,123, +123,156, 62,125, 26,183,110,221, 2, 77,211,100, 89, 89, 25,108,108,108,176,116,233, 82,120,123,123,163,164,164, 4,105,105,105, +206, 66,161,208,197,108, 72,158,214, 60,119,248,236,194,162,135,167,231,102, 83,199,162, 54,239,216,137,247, 71, 14,135,220,244, +240,188, 99, 83,114, 97,223,254,225, 95, 82, 66,175, 1,214,182, 45, 29, 3, 90, 14,130, 72,108,131,201, 95,124,133,228,219, 7, + 29, 53,101,183, 38, 49,198,116,175,249, 43,118,127, 92,195,177, 19, 0, 72,165, 82,249,222,198,141, 27,109,171, 28, 23, 73, 66, + 40, 20, 62, 97,172,204,139,177,215,114, 78,111,215, 80,121, 0, 77,211,160,105, 26, 44,203, 34, 47, 47, 15,101,101,101,112,116, +116,172,216, 97, 30,128,121, 32, 64,212,106, 88,110, 87, 75,207,168,157, 59,119,122,201,100,178,191,237,148,158,158,142,146,146, + 18, 88, 91, 91,195,193,193, 1, 70,163, 17, 38,147, 9,122,189,222,166,107,215,174, 19, 1, 92,173, 73,147,162,168,169, 19, 38, + 76,136, 56,116,232,144,223,162, 69,139, 64,211,244,242,188,188, 60,188,255,254,251, 96, 89, 22,145,145,145, 29, 57,142, 75,154, + 50,101, 74, 69,184,107,193, 2, 99,121,121,249,135,141,189,150,220,220,220,154,183,110,221,218,241,196,137, 19,136,140,140,132, + 94,175,199,196,137, 19,237,222,123,239, 61,187, 75,151, 46,185,174, 90,181,106, 91, 70, 70, 70,207,186, 52, 67, 67, 67,133, 57, + 57, 57,211,187,118,237, 58,173,103,207,158,246,249,249,249,144, 72, 36,216,181,107, 23,126,252,241,199, 35, 52, 77,207,217,179, +103,207,226, 77,155, 54, 69, 13, 26, 52, 8,155, 54,109,154,162, 82,169,190, 65, 69,179,233,211,154, 74, 47, 47, 47,220,188,121, + 19,142,142,142,112,113,113, 65, 73, 73, 9,174, 92,185,130,107,215,174, 33, 40, 40, 8, 4, 65, 56, 86,150,105,166,103,185,143, + 26,200, 11,215,172, 90, 99,181,218,181, 11, 0, 76,221,110,218,162, 89,241,149, 74,229, 32, 7, 7,135, 73, 28,199, 9,138,138, +138, 54,202,100,178, 63,234, 88, 38,136, 95,232,217, 66,131,101,206,151,174, 0,206,122, 36,162, 52, 63,204, 49,217,217,189,249, + 78,103,143, 22, 21, 39,209,196,221,165, 36,142,201,238,215, 53,165, 0, 64, 27, 57, 92,186, 91,132,155,247,115,112,243, 94, 54, +108,164,245,215,186,157,157,157, 17, 30, 30,142, 3, 7, 14, 32, 61, 61,221,102,233,210,165, 1, 52, 77,211, 3, 7, 14,204,122, +229,149, 87,138, 34, 35, 35, 33, 20, 10,113,245,234, 85,148,150,150,130,162, 40,136,197, 98,176, 44, 91,107,164,205,237, 30,243, +206,152,241,161,126, 46, 14, 36,254,188,120, 12, 29,131, 6, 67, 38, 17, 34,175, 72, 11,146, 32,240,224,209, 9, 48,140, 53,226, +239, 62, 70,167,150,214,232,220,193,222,179,252,100,225,248,124, 96,157, 37, 39,136,206, 60, 3,241, 43,111, 0,210, 22,224, 12, + 15,192, 26, 50,193, 9,221,160,214, 72,145,159,154,134,187, 87,254, 0,103,210,212,171,147,145,161,250,105,203,214,109,145,103, + 70,191,243, 14,203,178, 88,182,108,217,153,251,247,239,119,171,190,143,159,159,223,233,217,179,103,119, 45, 42, 42,194,177, 99, +199,126,174,111,161,210,167, 81,169, 84, 39, 0, 56, 85, 51,180,222,113,113,113, 59,126,253,245,215, 78,111,191,253, 54,118,239, +222,253,121, 13, 6,171, 78,166, 76,153, 34, 60,112,224, 64, 31, 43, 43,171, 53,115,231,206,181, 49, 24, 12, 80,169, 84,200,206, +206,174,138,182, 37, 36, 36, 48, 2,129,224, 82, 61,133,127,141,139, 77, 63,109,176,170,125,103,105,205,187,220, 96, 52,234,173, +189,148,198,129,131,250,180,186,117,237, 70,178,149,147, 19,217,170, 93, 72,243,187,247, 83, 99,137,138, 38, 24,139,154, 97, 60, + 61, 61,135,207,155, 55,175,149,157,157, 29, 88,150,133,189,189, 61,242,242,242,170, 12,165,161,172, 20,116,105, 9,110,166,165, + 32,178,107,119,244,238,212, 49,248, 47,163,113,120, 70, 70,198,239,117,233, 58,181, 14,173,138, 92,237,246,115,174,250,126, 68, +106,113,149, 1, 56,220,222, 31, 18, 27,107,180,252,100,102,163,111,230,236,236,236,184, 19, 39, 78, 28,142,138,138,234, 55,126, +252,120, 50, 59, 59,251,168,201,100,138,200,205,205,189, 83,215,255,217,216,216, 52,205,207,207, 71, 89, 89, 25,236,237,237,177, +106,213, 42,184,185,185, 65,163,209, 32, 38, 38,134,243,244,244, 36, 78,159, 62, 13, 15, 15, 15, 20, 20, 20,128,166,105,104, 52, +154,108,131,193, 80,107, 31,201,202,102,192,190,159,246,194,145,164,235, 63,119,246, 64, 74,204,208,207, 59,223,139,191,150,156, +126,234,228,197,133, 38,157, 52,189, 56, 35,122,122,147,118,241, 46,147, 62, 95,128,181,203,231, 33,233,234,217, 66,119,239,178, +117, 12,161,255,185,158, 40,173, 46, 49, 49,209, 54, 62, 62, 30, 36, 73,194,206,206, 14,214,214,214, 85, 11,155,155,205,149, 64, + 96,121,128,222, 92,193, 49,155,171,188,188, 60, 60, 72, 75,198,158, 83,219, 96, 52, 25, 93,182,118,176,203,246, 19,137,110,150, +180,200,159, 85,144,128,184,122, 10,192,141, 35, 70,140, 24,238,225,225, 97, 91,253,251, 54,109,218,224,173,183,222,194,209,163, + 71,113,253,250,245, 39, 42, 88,121,121,121, 42,134, 97,106, 61,238,244,244,244, 98,150,101,163,222,123,239,189,216,125,251,246, +217,125,251,237,183, 85, 93, 10,204,205,162,230,247, 29, 59,118, 32, 54, 54,118,110, 78, 78,206,221,198, 92, 71,238,238,238, 65, + 3, 6, 12, 56,183,110,221, 58,135,156,156, 28,228,231,231, 67,173, 86, 67, 40, 20,194,100, 50,193,223,223,159, 96, 24,198,183, +190,230, 64,154,166, 15,158, 58,117,170, 79, 64, 64, 0, 0,192,104, 52,226,226,197,139, 24, 63,126,124,129, 76, 38,123, 51, 45, + 45, 77,173, 80, 40,102, 31, 58,116, 40,170, 77,155, 54,104,213,170,149, 60, 55, 55,215, 54, 45,173, 50,156, 91,195,179,130, 97, +152,170,252,217,178,101, 75,213, 54,157,174, 98,201, 73,131,193, 64,132,133,133,249, 94,191,126,253,165, 29,220,146,246,235,102, +164,206,250, 8, 62,231,147, 0, 0,177,205, 43,186, 92,249,156, 77,172,216, 97,244,232, 6,233, 41, 20, 10,103,142,227,222,111, +222,188,249, 39, 81, 81, 81,174, 10,133, 2,206,206,206,184,117,235, 86,196,177, 99,199,214,232,245,250, 31, 24,134,249,193,146, +104,253,115,224, 9, 47,242, 50, 69,176,136,202,131, 35,136, 97,195, 24,110,247,238,252,204, 96, 49, 45, 22,200,146, 1,192, 64, +107,104,247,235,154, 82, 98,216, 48,198,181,197, 32,112,224,192,176,149,209, 6,142, 3, 99,225, 56, 16,221,221, 33, 96,139, 15, +194,205,113, 16, 54,109,218,135,220,220, 92,209,170, 85,171, 94,217,183,111,159,231,168, 81,163, 30,251,251,251,151,116,239,222, + 29,219,182,109,131, 92, 46,135,193, 96, 0,203,178,181,186, 55, 91, 39,102,104,135, 86,254, 84,114,218, 45,132, 5, 12,129,175, + 34, 18, 15, 50, 75, 80, 84,166, 71, 65,137, 22,129,129,159, 35,167, 80,131, 82,181, 14,183,146,126,131,167,162, 9, 73, 9, 31, + 68,193, 66,131,165,127,176, 29,250,148,157, 16, 41,186, 65,220,100, 56,132, 46,157,144,158,116, 6, 55, 78,172, 68,198,189, 11, +224, 88, 6,238, 94, 65,150, 54,225,204, 95,189,122,245,168, 37, 75,150, 8, 62,250,232,163,174, 75,151, 46,237,154,149,149,117, + 6, 0,148, 74,101,215,119,222,121,167,171,173,173, 45, 22, 47, 94,108,228, 56,110,254,179,102,110,118,118,246, 99,165, 82, 57, +233,196,137, 19,241,227,198,141, 67, 80, 80, 80,104,114,114, 50, 9, 11, 58,214,250,251,251,143, 23,139,197, 99, 77, 38, 83,192, +200,145, 35,201,247,223,127,223,198,205,205, 13,169,169,169,208,235,245, 32, 73, 18, 34,145, 8, 9, 9, 9,236,193,131, 7, 75, + 68, 34,209, 20, 11, 34, 44,112,113,113,241,136,140,140,140, 5, 0, 39, 39, 39, 79,150,101,225,236,236,236,217,169, 83,167, 88, + 0,112,116,116,244,168,201,136,213,106,128,105, 58,230,113, 90, 90, 96, 68,231, 8,197,185,235,119,226,222,120,125, 64, 55, 82, + 64,146,143,210, 84, 49,174,206, 78,214, 23, 47, 93, 40,165,105, 58,198, 18, 45,161, 80, 56, 32, 50, 50, 82, 80, 84, 84, 4,165, + 82,137,188,188, 60,100,102,102,194,104, 52, 66, 87, 82, 4,186,180, 20,116, 73, 49, 56, 77, 57, 30,198, 92, 69,176,151,135,228, +120, 69, 39,248,223,235,171,113,214, 20,161, 34, 8,162,234, 59,137,173, 13,172,108,109,171,154, 63, 26,240,112, 28,100,103,103, + 55,189,172,172,236,112, 86, 86,214, 34,131,193, 48,121,201,146, 37,237,190,250,234, 43,151,233,211,167,219, 77,159, 62,125,183, + 84, 42, 13, 73, 75, 75,211,215,234, 80,203,203, 31, 24,141, 70,103, 0,238, 39, 79,158,132,171,171, 43, 74, 75, 75, 97, 52, 26, +161,213,106, 13,142,142,142,210,130,130, 2,232,116, 58, 24, 12, 6,216,217,217, 33, 54, 54,182,208,100, 50,253, 89, 95,250, 28, +154,146, 11,245,198,187,115,157,154, 91,103, 50,156,115,151, 50, 45, 91, 52,127,133,106, 33,128, 21, 81,126,126,155, 13,236,217, +148,228,219, 7, 28, 83, 98, 78, 23,102,221,211,248,253,120, 56,165,172,158,135, 47, 75, 16, 4,215,172, 89, 51,228,229,229,129, +162, 40, 88, 91, 91,195,198,198, 6, 65, 65, 65, 72, 79, 79,111,180,193,170,110,174, 78, 92, 62,132,252,114, 21, 54, 47,223, 1, + 15,185, 23, 9,192, 53, 51, 59,189,215,184,105,195, 58, 60,182,123,180,228,209,197,226,165,117, 84,116,110,168, 84, 42,187, 39, +194, 47, 74,101, 55, 71, 71,199, 83, 52, 77, 35, 53, 53, 21,199,143, 31,239,154,153,153,217,160, 2, 36, 51, 51,243, 33,199,113, + 81,175,191,254,250,182, 86,173, 90, 53,229, 56, 14, 65, 65, 65, 24, 52,104, 16,246,236,217,131, 59,119,238,160,180,180,148, 61, +127,254,252, 86,149, 74,213,168, 14, 57,114,185,188, 89,191,126,253, 46,172, 93,187,214, 49, 63, 63, 31, 58,157, 14,229,229,229, +248,227,143, 63, 16, 17, 17, 1,169, 84,138,213,171, 87,151,154, 76,166,181,117,153, 43,142,227, 14,236,219,183,175,143,159,159, + 31,238,222,189,139,243,231,207,195,213,213, 21, 86, 86, 86, 24, 56,112,160,243,206,157, 59, 39, 7, 7, 7,175, 84,171,213, 11, +251,245,235, 7,134, 97,112,253,250,117, 85,229,168,194, 90,243,168,214,114, 69,167, 3,199,113, 48, 26,141,171, 72,146,124, 51, + 52, 52,180,119, 92, 92,220, 53,188, 36,120,120,120,180, 16, 10,133, 31, 3, 64, 94, 94, 30,138, 89,192,166,176, 98,208,109, 73, +229,227,178,176,176,176,234, 89,227,239,239,255,151, 86,171,157,149,153,153, 89,107,148, 73,169, 84,182,150,201,100,159,116,235, +214,109, 84,255,254,253, 41,154,166,113,232,208, 33,172, 93,187, 22, 81, 81, 81,240,247,247,199,231,159,127,110,175,215,235,103, + 28, 61,122,116,250,185,115,231,142,150,149,149,205,172, 75,243, 57, 81,229, 69, 94, 38,131,197, 85,186,198,138, 35,172,152,138, +161,168,178, 70,227,226,228,228,180,150, 97,152,110,129,129,129, 48,113, 57, 72,125,112, 15,101, 69, 44,140, 6, 61, 88,150, 3, +199, 90,118, 46,216,226,131,176,123,149, 67,233, 57, 2, 52, 77,195,205,205, 13, 75,151, 46, 69, 73, 73,137, 96,220,184,113,190, + 11, 22, 44,184,161,211,233,160, 86,171,161,213,106,161,213,106,235, 52, 88, 34,169,190,149,143,123, 0,202,180,237, 33, 19,139, + 81, 80,170, 71, 81,153, 30,249,197, 58,236, 61, 48, 18,122,173, 6, 38,131, 1, 12,109,130,141,251, 96,248, 59,117, 3,112,223, +162, 9,210,170,130, 40,172, 9,116,102, 52,232,204,104,200,218,204,198,129,213,111, 63,177,159,201,100, 89,147,127,118,118,246, +227,253,251,247,175, 31, 59,118,236,148,215, 95,127, 29, 63,252,240,195, 55, 89, 89, 89, 97,149, 81,132,111, 6, 15, 30,140,132, +132, 4,156, 59,119,110,195,243,170, 45,112, 28,231,236,228,228, 4,146, 36,161,209,104,244,245,153,171, 63,254,248,131, 88,176, + 96,193,209,129, 3, 7,118,154, 60,121,178, 76, 46,151,131,227, 56, 24, 12, 6,100,100,100,128, 36, 73, 20, 23, 23, 99,203,150, + 45,234,235,215,175,115, 98,177,248,146, 80, 40,252, 32, 33, 33, 33,171,190,190, 67,142,142,142, 24, 57,114,164,107,251,246,237, + 93,171,143, 24,124,243,205, 55, 93,195,194,194,170,190,243,244,244,180,248,248,116, 58,221,150,197, 11,231,118,251,117,251,174, +160,102, 65,254,142,135,143,159,142,115,118,182,179,242,245,245,147,148, 20, 23,235,215,174, 90, 46, 80,171,213, 63, 89, 40, 23, +236,226,226,130,236,236,108,220,191,127, 31,122,189,190,162, 9, 71, 83, 14, 67,113, 49,232,146, 34, 64,167,133,152, 97,160,207, +207,129,175,159, 47,240,159, 17,134,117, 63, 49,170,153,169,167,155, 4, 9,130,128,149,189, 29,196,214,214,160,132, 2,139,251, + 96,201,229,242,182, 33, 33, 33,187, 54,109,218, 36,154, 58,117,106,135,171, 87,175,174, 77, 75, 75, 75, 19, 8, 4, 61,150, 47, + 95,126,109,209,162, 69,146, 81,163, 70, 53,219,184,113,227, 24, 0, 27,235, 56,135,187, 14, 31, 62,252,150,183,183,183,251,237, +219,183,161,211,233,192,178, 44,250,246,237, 11, 0, 82,243,126, 73, 73, 73, 90,173, 86,155,147,144,144, 80,150,150,150, 70,195, +130, 81,127, 95,174,203,186,242,105,222,185, 55, 20, 10,229,101,177,196,167, 9,169,137, 29,252,233, 80,143,111,191,251, 35, 83, +119,244,225,195,178, 57,189,154, 44,213,148,221,158,228,232,169, 94,183,254, 80,138, 37, 29,220,171, 70, 11,186,184,184, 84, 53, + 9,138, 68, 34,115,244, 5, 37, 37, 37,245, 53, 17,214, 88,120,151,148,148,160,164,164, 4,247, 30,221, 69, 94,153, 10,209,191, + 95, 6,195, 48, 85,209, 17,165,187, 39, 78,252,126,205,182,235,208,118,179, 74, 91, 21,159, 46,188,133, 24, 75,175, 83,146, 36, + 63, 25, 50,100, 8,104,154,198,160, 65,131,176, 99,199,142, 79, 26, 83, 67,207,202,202,186,146,149,149, 21,112,255,254,125, 59, +163,209,248,218,192,129, 3,127,238,215,175, 31, 46, 95,190,140,147, 39, 79,118, 53, 24, 12,201, 12,195,104, 21, 10,197, 18,142, +227,220, 8,130, 88,162, 82,169,234, 28,237, 28, 16, 16, 48,202,214,214,118,177,149,149, 85, 89,211,166, 77,149,230,200,149, 90, +173,134,201,100, 66, 70, 70, 6,142, 28, 57,162, 58,124,248,176,138,227, 56, 89,121,121,249,188,244,244,244, 63,106,107, 22, 44, + 47, 47,223,127,240,224,193, 40, 63, 63, 63,156, 61,123, 22,203,150, 45, 67,211,166, 77,177,117,235, 86,132,135,135,195,215,215, + 23, 78, 78, 78, 31,151,150,150,118, 90,182,108, 89,191,208,208, 80,236,219,183, 15,185,185,185,107,234,122, 62,213,245,156,213, +106,181,224, 56, 14,221,187,119, 31, 63,117,234, 84, 12, 28, 56,240,120,219,182,109,219,199,198,198,222,251,183, 23,210, 10,133, + 98,105,247,238,221,167,183,110,221, 26,219,183,111,135, 62, 44, 18,214, 91,255,196,237, 1, 17,224, 0, 40,183, 30,168,104,175, +123,173, 98, 64,135,111,143,161,152, 62,125,122,191,193,131, 7,123, 3,104, 81,139,230,183,163, 70,141,154,246,246,219,111, 35, + 46, 46, 14, 27, 55,110,196,141, 27, 55,170,202, 60,163,209,136,196,196, 68, 36, 38, 38, 66,161, 80, 96,192,128, 1,196, 7, 31, +124,208,183,111,223,190,174,168,232, 22,241,255, 29,197,234,250, 50, 53, 17,214,234, 26,221,221,221, 93, 28, 29, 29, 19,214,174, + 93,235,220,161, 67, 7,202,100, 50,225,228,169, 83,248,236,163,113,136, 26, 48, 9, 58,189, 24, 38, 29, 1, 70,100, 99,217, 47, +218, 13, 64,233, 57, 2,172, 77, 63, 24, 12, 6,140,223, 33,130, 3,145,131, 85,239,184, 3, 0,161,213,106,161,215,235,161,213, +106,161, 86,171,161, 86,171,193, 48, 76,173, 79,201,178, 98,107,154, 54,178,200,204, 77, 67,134,234, 54,236,109,188,193,145, 94, +200, 41,212,128,128, 27,140,186, 36,176,149, 55,166, 94,155, 1,181,254,217, 76, 49, 83,150, 82, 67,100,198,242, 62,149, 12,195, + 44, 94,190,124,249,248,181,107,215, 74, 38, 77,154,212,118,209,162, 69,175, 1,192,251,239,191,223, 86, 42,149, 98,221,186,117, +122,134, 97, 22, 63,167,252,165, 72,146,252,228,213, 87, 95, 69,105,105, 41, 18, 18, 18, 14,213,247, 15,179,103,207,158, 56,100, +200,144, 78, 11, 22, 44,144,233,116, 58,104, 52, 21,205,159, 37, 37, 37, 80,171,213,200,201,201,193,180,105,211,138,104,154,158, +240,232,209,163, 61, 13, 48,122, 56,120,240, 32,126,253,245,215, 39, 70, 12,190,249,230,155,174, 59,118,236,200, 93,189,122,117, + 38,199,113,156,147,147,147,231,208,161, 67,221, 44,109, 33, 84,169, 84, 90, 0, 83, 22, 45, 94,244,219,183,203,151,187, 21, 22, + 20, 37,139,196, 86, 58,153,149,196,105,250,103, 11,185,156,156,156,105,185,185,185, 26, 75,211, 89, 84, 84,132,148,148, 20, 88, + 89, 89, 65, 36, 18,129,209,148,131, 85,171,161, 47, 42, 0,105,208, 67,194, 48,112,146, 73,224,229,238, 14,111, 55,203,250,226, +171, 78, 31,199,145,225, 3,158,104, 22, 36, 8, 2, 71,195,155, 65,108, 99, 13,169,141, 13, 34,247,159,175,168, 48,136, 68,192, +170, 77,150, 52,227,184, 40, 20,138,131,107,214,172, 17,229,231,231, 35, 33, 33, 33, 62, 45, 45,173,196,209,209,209,214,104, 52, +178,247,238,221, 59,145,148,148, 52,192,215,215, 23, 28,199,213, 55,250,107,197,222,189,123,123, 69, 68, 68,152,124,125,125,173, +243,242,242,188,139,138,138, 8,149,234,201, 62,204, 49, 49, 49,210,199,143, 31,107, 88,150,221, 87,105,174,234,189,240, 63, 29, +234, 33,189, 20,135, 41, 93, 92,124, 91,219,187,182, 70,190,241, 70,235, 43,241,217, 83, 62, 29,234,177,250,187, 63, 50,117, 12, +161,255,153, 49,166,123, 9,164,186,109, 13,105, 66,224, 56, 14, 49, 49, 49, 56,127,254, 60,206,159, 63,143,212,212,212,170, 29, +236,237,237, 17, 29, 29,141,110,221,186, 89,124,163,104, 52, 26, 40, 20, 10, 56, 56, 56, 96,223,153, 95,240,227,183, 59,170, 58, +186,155,201,207,207,135, 76, 38,195,226,207, 86,218,140,251, 98,232,194, 66,228,247,182, 68,219,211,211,179, 73, 68, 68, 68,127, +119,119,119, 20, 21, 21,193,213,213, 21,237,218,181, 27, 72,211,180,111,110,110,110,163,154,178, 12, 6,195,196,110,221,186, 45, +154, 54,109, 26,140, 70, 35,134, 15, 31,142,148,148,148, 93, 15, 31, 62, 92,229,227,227, 51,101,210,164, 73,238, 46, 46, 46,152, + 56,113,162, 53,128, 55,106,211,105,214,172,217,167, 95,124,241,197,215,163, 71,143,150, 24,141, 70,156, 60,121,178, 42, 74,109, + 50,153,144,150,150,134,121,243,230,169, 74, 75, 75,187,100,102,102, 62,176,160, 18, 57,109,255,254,253,125, 3, 3, 3,113,244, +232, 81, 76,152, 48,225, 47, 27, 27,155, 22,253,251,247,247,182,182,182, 70,124,124, 60,104,154,134, 66,161,112,159, 49, 99,198, +128, 62,125,250,224,196,137, 19, 88,184,112,225, 33,185, 92,190,226,233,107,238,105, 19, 44, 16, 8, 96,124,170, 79, 35, 69, 81, +184,113,227, 6,186,119,239,142,233,211,167, 3, 0, 78,156, 56, 97,215,187,119,239,219, 93,186,116,177, 59,123,246,172,254,223, + 92, 72, 91, 91, 91,143,221,186,117, 43,238,223,191,143, 11, 23, 46,160,160,160, 0, 6,131, 1, 37,108,197,205, 32,169,140, 92, +113, 30, 62, 8,159, 54, 11, 35, 6,188, 1,149, 74, 5,146, 36, 93,234,168,240,141,154, 53,107, 22,142, 28, 57,130,165, 75,151, +162,180,180,180,198,253,172,172,172,208,174, 93, 59,132,132,132, 32, 37, 37, 5, 0, 92, 94,192, 33,191,148, 17,172,218,162, 14, +171,214,175, 95,239, 28, 17, 17, 65,169,213,106,176, 44,139, 78, 29, 59, 98,204, 59, 99,112,108,223, 31, 80, 52,233, 6, 74,103, + 5,147,173,204, 50,131,225,245, 51, 10, 11, 11, 33,145, 72, 32,173,236, 80,122, 51,163, 42,188, 11,157, 78, 87,101,174,204,239, +117, 97, 50,136, 99, 19, 31, 50, 94,165,229, 55,112, 53,246, 87, 24, 13, 6,248, 6,204,132,222,228, 2,107,183,119,161,165, 15, +130, 46,174, 24,185, 43,182,235,138,156,156,124, 0,132, 69, 33,206,154, 10,121, 86,251,247,206,238, 44, 99,185,193,202,205,205, +205, 59,127,254,252,138, 27, 55,110,204,238,219,183, 47,126,252,241,199,165, 28,199,161, 95,191,126,136,137,137, 65,124,124,252, +138,220,220,220,188,231,145,183,114,185,124,203,186,117,235,250,185,187,187, 99,239,222,189,224, 56,174, 94, 67, 36, 22,139,223, +159, 50,101,138,204, 28,197, 16,139,197,208,106,181,200,206,206, 6, 77,211,216,183,111,159,222, 96, 48, 76, 77, 77, 77,221,211, +144,196,112, 28,199,181,111,223, 30, 43, 87,174,204,184,120,241, 98, 91, 0,232,212,169, 83,108, 88, 88,152,235,234,213,171, 51, +175, 94,189,218, 22, 0,218,183,111,127, 61, 36, 36,164, 65,243,184,168, 84,170,140, 27,215,175, 60,208,234,116, 66, 71,103, 39, +141,173,181,152, 43, 45, 43, 35,111,222,140, 83,229,230,230,166, 54, 64, 42, 49, 33, 33,161,101,102,102, 38,210,210,210,192,104, +202, 65,234,245, 32,244, 90,244,232,212, 17, 86,224, 32, 1, 11, 17,107,132,144, 18,160,172,172, 28, 0, 18,235,141,218, 86, 43, + 16,204,230,138, 32, 8, 72,109,108, 32,182,181,129,196,198,230,137,136,150, 37,230,210,202,202,234,183,141, 27, 55, 42, 20, 10, + 5,190,251,238, 59, 40, 20,138, 32,185, 92,174,177,181,181,181,114,113,113, 65, 96, 96, 32,194,194,194,112,250,244,105, 16, 4, + 81, 95,193,104,226, 56,174,247,133, 11, 23,166, 93,186,116,105,152, 82,169, 36, 70,143, 30,141,168,168, 40, 72, 36, 18,104,181, + 90, 20, 21, 21,225,175,191,254, 34, 88,150, 13,173, 52,120, 62, 18,137,100, 7, 65, 16, 25,169,169,169,111, 62, 45,184, 97, 81, + 43,101,153,150, 29, 71,170,173,222,232,210,199,183, 85,247, 62, 61,209, 36,160, 7,186,247, 73, 7,128,165, 46,194, 71,195,151, +205,114,216,231,104, 71,108,189,180,255,196,151,145,125,187,205,153, 79,159, 89, 56,127, 77, 81,189, 81, 44,130, 32,170, 10, 91, +146, 36,107,140, 82, 81, 20, 5,146, 36, 45,123, 38,177, 76, 70,212, 59,157,170, 62, 27, 77,180,139,135,220,139, 52, 71,174, 0, +160,180,180, 20,143, 31, 63,134,209,104,132,179,179, 51,140, 70,186,117, 3, 42, 85, 83,134, 15, 31, 78,232,116, 58, 76,155, 54, + 13,203,151, 47,199,160, 65,131,136,171, 87,175, 78, 1,240, 73, 67,111,108,165, 82,185,124,226,196,137,211,198,142, 29,139,226, +226, 98,156, 58,117, 10,221,186,117,195,250,245,235, 93, 79,157, 58,245,117,120,120, 56, 40,138, 66,116,116, 52,104,154, 78,170, +231,126,255,104,244,232,209,146,244,244,116,136, 68, 34,132,133,133, 33, 35, 35, 3,106,181, 26,185,185,185,248,234,171,175,178, + 75, 74, 74,186,102,101,101, 61,176, 32,105,164,159,159,223,199,254,254,254, 56,121,242, 36, 38, 78,156,120,196,218,218,250,141, +162,162,162, 15,244,122,253,234, 1, 3, 6, 32, 60, 60, 28, 73, 73, 73, 24, 56,112, 32,218,181,107,135, 83,167, 78, 97,250,244, +233,127,201,100,178, 33,245,204,131,117,239,204,153, 51, 45,195,194,194,160, 86,171, 81, 86, 86, 6,161, 80, 8, 7, 7, 7, 36, + 38, 38, 34, 32, 32, 0,211,167, 79,199,202,149, 43, 49,117,234, 84,182,119,239,222, 38,154,166, 69,230, 81,150,255,102,212,106, + 53,167, 82,169, 96,103,103,135,221,187,119,227,214,137,255, 99,239,187,195,163,168,254,175,207,204,236,206,150,236,166,144,190, + 73,168,161, 38, 1, 66, 66,232, 18, 66, 17, 69, 4, 81,145, 34, 69, 4, 20, 41, 74, 83,154, 18,106, 16,164,131, 52,165, 41, 32, + 4, 16,233, 69, 8, 29, 66, 42,164, 16, 90, 72,217,221, 52, 82, 73,182,206,206,188,127, 36, 27,147,144,178, 65,120,191,234,111, +206,243,236,179, 59,101,207,220, 50,229,204,185,247,126,238, 89,156,154,250, 41, 36, 11, 86,129,227, 56,164, 47,157,131,222, 95, + 47, 64,151,152,199, 80,171,213,216,179,103, 15, 72,146, 68,149, 1, 40, 47, 60,219, 10, 10, 10,208,161, 67, 7,220,185,115, 7, +123,246,236,193,218,181,107,203,221, 90,161, 80,136, 94,189,122,161, 95,191,126,120,240,224, 1,182,109,219, 6, 27, 27, 27,240, +120, 57,129, 69, 84,249,174,224,206,176,189, 3, 2, 2,168,231,207,159, 67,171,213, 34, 51, 51, 19,201,201,201,144, 74,165, 80, +102,165,162, 83,243,231,200, 32,244,136,139, 78, 50, 17,148, 48,186, 46, 27,222, 96, 48, 64,175,215, 35, 54, 54,182,116,232,123, +203,144,242,206,207,101,125, 62,160,213,106, 17, 22, 22,198, 73,165, 82,200,100, 50,162,182,182,119,150,209,157,190,116, 61,102, +192,168, 33,189, 69,231,195,126,130, 81,199,224,185,206, 14,197, 90, 61,138, 52, 66,232,197,253, 65, 16, 87, 65, 82, 98,116,235, +208, 28, 23,175, 61,208,154,140,134, 51,150,169, 2, 19, 40,251,246, 48,229,198, 86, 16, 88,149,223,176,104,177, 28, 38,166,126, +163,130, 37, 18,201,170,213,171, 87, 79,253,249,231,159,173, 63,251,236,179, 86,230,135,197,230,205,155,139, 36, 18,201,170,191, + 91,167, 10,133, 98, 84,211,166, 77, 23, 47, 92,184,208,189, 67,135, 14,136,140,140, 68, 72, 72,200,201,140,140,140, 99, 22,188, + 25,123, 56, 56, 56,224,249,243,231, 16,137, 68, 48,153, 76,200,202,202, 66,106,106, 42,196, 98, 49,194,195,195,245,141, 27, 55, + 62,242, 50, 9,179,164, 67,123,197, 17,149,245,129,148,102,253, 23,124, 61,177,133, 86,171,241, 46, 42, 42, 98, 4, 2,129, 64, + 44, 52, 61,169, 15,135, 7,243, 62,169, 0, 0, 32, 0, 73, 68, 65, 84,209,104, 60,113,245,234,213,247,122,244,232, 33, 78,138, +141,134,161,160, 0,198,194,124,208, 38, 6,246,254, 29, 64,234,181, 32,244, 70,184,123,113,208,228,203,112, 61,234,177,209,104, + 52,214,233, 10,154, 5, 22, 73, 81,149,251, 93,217, 88, 67, 36, 47, 21, 88, 21,215, 19,117,180,107, 57, 59, 59, 91,245,236,217, +179,143,159,159, 31, 56,142,195,170, 85,171,160,215,235, 69, 70,163, 17, 70,163, 17, 6,131, 1, 69, 69, 69, 56,124,248, 48,246, +238,221,123,221,214,214,118,151, 74,165,170, 43,153,140,187,187,251, 20,150,101,157, 25,134, 49, 56, 57, 57,209, 7, 15, 30,132, + 68, 34, 1, 73,146,232,208,161, 3, 36, 18,137, 78,161, 80, 24, 0,192,201,201,201,184,122,245,106,193,248,241,227,233,234,200, +124, 59,181,154,101,226, 28, 2, 69,226,198, 77,109,157,218,163, 89,203, 62, 0,128,126, 3,199,161, 89,139,134, 40,200,142,109, +166,215,165, 12,161,136,103, 13,126,185,169, 76,120,195,170,237, 39,207,210,195,146, 0,252,108,233,185,212,167, 79, 31,188,249, +230,155,229,205,129,206,206,206,208,235,245, 96, 24,198, 98,113, 5, 0,230, 32,162,193,193, 32,177, 16,216,213,217, 58, 3, 64, +185, 61, 89, 80, 80,128,180,180, 52,164,164,164,148,223,167, 88,206,178,183,107,133, 66, 33,109,214,172,217, 88, 31, 31, 31, 92, +188,120, 17,177,177,177,202,203,151, 47,187,119,234,212, 9, 30, 30, 30,159,112, 28, 55,175,204,133,181, 8,142,142,142,178,206, +157, 59, 79,253,228,147, 79,112,255,254,125,124,243,205, 55,207, 50, 50, 50,142,158, 56,113, 98,252,244,233,211,201,192,192, 64, +100,101,101, 97,235,214,173,166,240,240,240, 31, 26, 52,104,176, 56, 35, 35,163,182,114,124,162, 82,169,154,104,181, 90, 60,123, +246, 12,230,144, 12,103,206,156,193,217,179,103, 51,243,243,243,123,169,213,234,135,150,164,173,113,227,198,214,254,254,254, 46, + 73, 73, 73, 56,112,224, 0, 12, 6,195,130,148,148, 20,131,141,141,205,175,155, 55,111, 94,232,233,233,105,223,179,103, 79,116, +235,214, 13, 28,199,225,248,241,227, 8, 14, 14, 62, 41,149, 74,223, 79, 72, 72, 48,212, 65, 63,100,201,146, 37, 75, 28, 29, 29, + 63, 26, 57,114, 36,233,239,239,143,136,136, 8,152, 76, 38,244,233,211,167, 92, 92,157, 57,115,102,223,153, 51,103, 62, 4, 64, +203,229,114,201,191,221,189, 50, 67,171,213, 34, 41, 41, 9, 46, 46, 46,104,209,169, 43,190,185,151,140,171, 55,110,130,227, 56, +244,136, 75,198,243,231,197,216,181,107, 23, 34, 35, 35, 65, 81, 20, 60, 61, 61,235,228, 52, 24, 12,120,248,240, 33,178,179,179, + 49,120,240, 96,124,252,241,199, 88,185,114, 37, 12, 6, 3,230,207,159,143,220,220, 92,108,223,190, 29, 15, 31, 62,132, 64, 32, +128, 92, 46,255,255,145,213, 26,181,200,127,210,193, 2, 74,219,190, 89,150,133, 74,165,194,157, 59,119,144,156,156, 12,153, 76, + 6, 13,195,178, 27,111,197,176, 36, 33, 84,154, 56, 92,227, 24,124, 93,151, 18, 55, 26,141,132, 64, 32,192,141, 27, 55,240,232, +209, 35,216,180,224,202,221, 43,163,209, 8,157, 78,135,146,146, 18, 8,133,194,231, 55,111,222,124, 26, 17, 17,209, 76, 32, 16, +212, 56, 10, 44,171, 37,181,251,252,133, 63,103,249,119,240,110,213, 55, 48, 24, 39, 78,124,135,252,194, 66, 20,235, 4,120,174, + 49,160, 88,203,193,205,186, 57, 58,183,247, 67,246, 51, 61, 30,196, 69,166,231,208,246,117,182,193, 24, 77,100,193,190, 77,159, +217, 14,250,240, 11, 72, 92,123, 66,159,124, 16,172, 38,179, 92, 96,209, 18,107,216, 56, 54, 66,225,115, 13,174, 39, 60,129,209, + 68, 22, 88, 90,232,201,201,201,133, 58,157,110,217,245,235,215,191, 55,143,252,185,114,229, 10, 30, 63,126,188, 76,173, 86, 23, +214,167, 2, 21, 10, 69, 95, 0,251, 1, 72,156,157,157, 51, 3, 2, 2, 20,111,190,249,166, 36, 48, 48, 16, 20, 69, 33, 42, 42, + 10,159,125,246,217, 57,185, 92,254, 62, 44,136,137, 35, 18,137, 50, 11, 10, 10,108,197, 98, 49,140, 70, 35, 50, 50, 50,112,255, +254,125,104, 52, 26,100,102,102,130, 32, 8, 85, 88, 88,152,166,190, 39,154,121,132, 86,213,135,100,117,226,185,158,163, 8,225, +238,238, 30, 24,208,185, 83,219, 31,214,108,128,166,228, 57,194,111,158, 64, 94,110, 14,182,237, 56,210,206,221,221, 61,208,210, +206,196,233,233,233,191, 29, 57,114,100,166,175,143,143,159,103,195,134,184,155,146, 12,154, 53, 65,100, 50,129,210,107, 65,154, +116,240,104,203,129, 36,229,200,204, 40,194,150,115, 23,239,149, 69,117,175, 61,125,111, 15,194,136,148, 2, 16, 4,129,115,111, +120, 67, 34,151,131,150,203,208,237,112, 88,185,168,122,186, 98, 54,104,153, 28, 13, 2,234, 14,140,153,149,149, 85,114,253,250, +245,136,196,196,196,128,214,173, 91, 99,209,162, 69, 72, 75, 75, 3,199,113,200,202,202,210,102,103,103, 43,159, 61,123,246,148, + 32,136,163, 42,149,106, 7, 44,140, 22,206,178,172,243,241,227,199, 1,128, 6,128, 63,255,252, 19,110,110,110,176,181,181, 69, + 97, 97, 33, 70,143, 30, 45,254,246,219,111, 1, 0, 81, 81, 81, 66,137, 68, 82, 35, 87, 92,244,253,213,121,133, 92, 30, 89, 28, +249,126, 14, 19,221,174,119,255,116,244, 27,248, 9,206,159,216,133,139,103, 47,192, 81,152,252,196, 36,125,126, 58,251, 73, 78, +145,186,184,229, 86,239,142,227, 41,213,243,179,219,190, 24,148, 36,240, 80,176,135,230,110,169, 61,112, 47,199,113,160, 40,234, +133, 14,237,245, 21, 87, 21, 17, 28, 12, 22, 11, 65, 52, 19, 10,162,149, 25,105,253,221, 92, 60,202, 95, 46, 82, 83, 83,145,150, +150,134, 22, 45, 90, 32, 57,229, 49, 68, 34, 58,218,194,243,126,228,192,129, 3,173,245,122, 61,126,255,253,119,134, 32,136,129, +199,143, 31,143,240,245,245, 21, 4, 5, 5, 89,239,218,181,107, 36,128, 29,245,105, 49,146,203,229,180,209,104,196,238,221,187, +161, 84, 42, 3, 51, 51, 51, 19, 56,142,219,250,249,231,159,255,232,229,229,213, 34, 33, 33,225,129, 70,163,249, 66,173, 86,199, +214,214,228, 6, 0,249,249,249, 99,222,122,235,173, 67, 44,203, 54,238,222,189,187,108,196,136, 17, 54, 28,199,193,203,203, 11, +167, 78,157, 82,169,213,106,139,251, 48,165,164,164, 20, 93,189,122, 53,211,219,219,219, 69,161, 80,128,166,233, 21,174,174,174, + 75, 41,138,250,225,221,119,223,181, 63,120,240, 32, 66, 67, 67, 33,147,201,240,228,201, 19, 85, 98, 98,226, 58, 87, 87,215,245, +150, 68,112,143,138,138,122, 2, 96, 68, 64, 64, 64,240,218,181,107, 23,144, 36, 57,234,220,185,115,229,177,206,204,226,170,105, +211,166, 99, 66, 67, 67, 63,254,143, 25, 33, 70,189, 94, 15, 7, 7, 7,100,103,103, 35, 43, 43, 11,141, 26, 53, 66,215,174, 93, + 97, 52, 26,113,236,196, 73, 92,189,122, 21, 28,199,193,209,209, 17, 54, 54, 54,136,137,137, 1,128,218, 70, 15, 27, 13, 6, 3, +236,237,237,145,159,159,143,152,152, 24, 56, 59, 59, 99,198,140, 25,208,235,245, 56,120,240, 32,162,163,163, 65,146, 36,156,156, +156, 96,109,109,141,232,232,232,186, 56,121,212, 87, 96, 81, 20,117,233,210,165, 75, 31,182,111,223, 94,240,224,193, 3, 60,120, + 80,122,189,105, 52, 26, 70, 64, 33, 52,235,238,177, 17,181,252,189, 45, 42,196,202, 16,137, 68, 91, 62,252,240,195, 47,198,141, + 27,135,201,147, 39,131, 36, 73,252, 28,165, 67,106, 42, 11,131,193,128,204,204, 76,220,189,123,151, 11, 8, 8, 32, 88,150, 53, +244,234,213,107, 66,100,100,100, 39,138,162, 10,107,226, 68,104,168,137,105,251,238,224,205, 91,118,220, 24, 59,118,172,253,160, +193,155, 17, 21, 31,135,252,226,210, 86, 38, 55, 71, 25, 58,183,158,141,172,103, 58,156, 61,125, 34,143,101,180, 31, 32,238, 55, + 99,109,233, 4,128,236, 18,141,243,214, 61, 71, 86, 29, 56,124,116,194,196, 49, 35, 36,189,122,141,129,176,232, 46, 76,207, 34, +225,214,178, 59, 8,202, 10,183, 99,162, 16,251, 48, 77, 91,162,165,118, 20, 26, 52,179,235,226,172,228,165,147,228,198,237, 91, + 54, 44, 63,115, 62,140, 50, 24, 12, 24,240, 86, 31, 19, 73,146, 27,235,168,142, 23, 56,173,172,172, 14,196,196,196,216,235,116, + 58,164,167,167, 55,107,213,170, 21, 56,142, 67, 74, 74, 10,214,173, 91,199,156, 58,117,106,179, 68, 34,249,166,150, 55,196, 74, +156, 70,163,113,255,238,221,187,231, 78,153, 50, 69,146,149,149,133,196,196, 68, 20, 23, 23,195, 96, 48, 32, 50, 50, 82,107, 52, + 26, 15, 88,112, 94,189,144, 78,179,192,178,183,183,119,239,220,185,179,121, 20,161, 59,203,178,104,208,160,129, 71, 64, 64, 64, + 4, 0,216,218,218,214, 52,138,176,198,242, 84, 42,149,151,195,194,174, 98,247,142, 53, 48, 24,116, 80, 43, 75,157,134,156,103, + 5,168, 67, 92, 85,229,228,180, 90,237,251,107,215,173,187, 53,105,204, 40,215, 55,122,247, 65, 90,108, 12,244,185,217, 32, 77, + 12,132,156, 0, 37, 89, 82,100,102, 62,199,242, 83, 23,178, 52, 90,109,117,162,181,218,116,150, 55, 11,218, 88, 67, 44,151, 67, + 84,230, 90,153,183,137,228,214, 16,202,228,160,104,186,186, 38,175, 23, 56, 75, 74, 74, 62,152, 56,113, 98,236,169, 83,167, 26, +140, 24, 49, 2,131, 6, 13,138,202,207,207, 15,202,203,203, 43,178,240,218,127,129,147, 36,201,172, 1, 3, 6, 56,235,245,122, +102,216,176, 97,130,156,156, 28,152,135,216, 23, 21, 21,225,244,233,211,104,221,186,116,214,153,184,184, 56,120,123,123,215,200, + 57,225,155,123, 74, 0, 75,166,127,232,254,195,173,152,140,105, 0, 86, 52,107,225,129,139,103, 47,224,234,197, 27,115,186,180, +101, 55,188, 51,178,211, 98, 73,239,143,102,123,251,143,167,228, 54, 10,236, 57,114,152,138,143,252,105,153,182,248,158, 39,182, + 28,153, 93, 83, 58, 9,130, 0,199,113,149,196,149, 64, 32, 64, 73, 73,137,165,226,170,230,107,147, 0, 87,232,147,183, 96,236, +140,161, 93,255, 60,112,219, 90, 38,147,149,247,249,105,222,188, 57, 4, 66, 1,126, 62,186,177, 56, 63, 63,231, 91, 75, 56,101, + 50,217,148,160,160, 32, 60,126,252, 24,177,177,177,135,213,106,117, 44,199,113,135,159, 60,121, 50,172, 83,167, 78,248,237,183, +223,166,212, 34,176,170,229, 52, 71,172, 47,115,123,115, 1, 64,173, 86,199, 0,232,242,232,209,163,122,229,189, 44, 88,104,247, +178,114, 77, 27, 50,100,136, 13,195, 48, 40, 19,207, 14,245, 60,151, 88,181, 90,189, 62, 60, 60, 60,164, 67,135, 14, 24, 62,124, +120,191,136,136,136,126,190,190,190,240,244,244, 68, 94, 94, 30,194,194,194,126, 97, 89,246,115,181, 90,173, 5,192,213, 34, 0, +171,205,251,157, 59,119, 30, 2, 24,237,231,231,247,145, 64, 32,128,141,141, 13,165, 84, 42,169,115,231,206, 1,192,196,208,208, + 80,211, 75,213,251,203,227,181,115, 18, 4, 49,127,204,152, 49, 91, 63,251,236, 51, 73,167, 78,157, 80, 80, 80, 80, 46,250, 79, +157, 58,133,178,145,216,112,112,112,192,195,135, 15,113,244,232, 81,125, 65, 65,193, 58,154,166, 87,212,198, 57,122,244,232, 74, +156,102,241,118,226,196, 9,152, 7,145, 56, 56, 56,224,193,131, 7, 56,114,228,136,182,160,160, 96,141, 94,175, 95,249,154,243, +254,127, 75, 96,229,230,230,126, 57,119,238,220,160, 79, 63,253,212, 65,163,209, 80,142,142,142, 80,169, 84,204,217,179,103,115, +139,138,138,190,172,207,193,110,222,188, 57,249,157,119,222, 89,183,115,231,206,237,219,183,111, 15, 28, 62,124, 56, 70, 15, 24, +128, 47,186,202,160,211,233, 64, 16, 4,206,158, 61,123,255,210,165, 75,205,104,154,214, 5, 7, 7,179, 0,110,213,197,251,236, +222,241, 7, 84,219,247, 2, 55,108,252, 49,212,175, 99,151,198, 77,154, 54, 17,119,111,104, 11,131,209,132,204,172,103,184,124, + 35, 94,247, 32, 62, 38,141, 53,232,135,102, 39,212, 29,197, 29, 0, 18, 18, 96, 0,138,190,244,242,178, 94,180,114,203,190, 45, +123, 15, 29, 30, 50, 97,248,251, 2,255,118, 65, 72,206, 56,134, 43, 17,151,152,188, 34,238,104,145,158,154,148,144, 80,148, 87, +223,130, 87, 42,149, 90,137,144, 43,208,106,181,246,201,201,201,200, 84,171, 10,149, 74,149,246,101,154,221,116, 58, 29, 30, 63, +126,140, 11, 23, 46, 32, 42, 42, 10,215,175, 95, 55,156, 59,119,110, 39, 73,146,203,106, 9, 52, 89,253,149,221,182,237,247, 63, +253,244,211,135, 38,147,201,179, 87,175, 94, 18,123,123,123,228,228,228, 32, 60, 60, 92, 31, 29, 29,253,184,109,219,182, 43, 95, +246,100,115,117,117,197,208,161, 67,157,253,253,253,157,205, 35, 6, 27, 54,108,136, 15, 62,248,192,217,215,215,183,124, 93,163, + 70,141, 80,159, 80, 13,238,238,238,129,189,122,189,129,177,227,167, 67,163,121,142, 91, 55, 78, 32, 63, 55, 7, 55,239, 36, 65, +103, 64, 96,125,134,195,151,141,222,236,178,116,221,134, 35,111,117, 14,240,106,229,230, 42,118,104,218, 4, 50, 39, 87,228, 62, +123,134, 91, 49,143,140,155,206, 95,190,167,209,106,223,183,116,164, 39,203,178,229,163,220,188,167,205, 1, 73,146,229,179, 32, +152,183,219,116,236, 1, 82, 32,132,137, 3, 12, 6, 67,157,238,157, 90,173, 78, 39, 8,226,131,169, 83,167,254,185,123,247,110, +178, 87,175, 94, 29,254,248,227,143,191, 53,105,174, 82,169,244, 40,115, 69, 11,109,108,108, 4,159,124,242, 9,140, 70, 35, 74, + 74, 74, 80, 88, 88,136,103,207,158,233,190,250,234, 43, 49, 0,208, 52,109,124,235,173,183,234,188,127,172, 13, 85,106,167,127, +232,190,193, 81,152, 60,172, 32, 59,182,153,163, 48,249, 73,151,182,236,134,181,161, 74,173,179, 93,201, 82,101,118, 88,146,234, +249,217,109,123,142, 28,166,198, 12,249,192,164,144, 63,152,227,216, 16,135, 44,186,121, 85, 17, 88, 47,235, 92,189,112, 63,137, + 67, 84,186,236,113, 72,208,208, 78,243,150,206, 92, 45,119,116,114, 4,195, 48,120,146,250, 24, 59,143,108, 42, 46,210,229, 45, +203, 77, 64,132, 37, 92,205,154, 53,107, 74, 81, 20,142, 29, 59, 6, 0,230,208, 6,155, 78,159, 62, 61,108,228,200,145,104,212, +168,145, 55,203,178,226,218,194,104, 84,231,222, 25,141,198,122, 55,163,215,217, 54, 67, 16,143, 99, 98, 98,220,221,221,221,137, + 3, 7, 14, 60, 55, 24, 12,193, 47,113,141,175, 62,121,242,228, 27, 28,199,189,229,231,231,135,198,141, 27, 3, 0,226,227,227, +113,245,234,213,253, 74,165,114, 44, 94,205,228,206, 28, 65, 16, 40, 44, 44, 52,199, 53, 49,200,229,242,255,228,164,209, 42,149, +106, 47,195, 48,103,131,131,131,191,107,222,188,249,231, 19, 39, 78,164, 90,181,106,133,130,130, 2,216,216,216, 64,161, 80, 64, +169, 84, 98,239,222,189,166,172,172,172,157, 36, 73, 46, 82,171,213,170,151,229,108,208,160, 1, 20, 10, 5,210,211,211,205,156, +219,141, 70,227,226,156,156,156, 76,240,168,223, 53,101,201, 78,101, 97, 26,214,155, 76,166, 32,179,171,149,155,155,251,101,102, +105,143,241,151, 82,247,239,188,243, 78,243,156,156,156,237, 6,131, 33,112,208,160, 65, 24, 62,124, 56,222,125,247, 93, 12, 31, + 62,156, 50,187, 86,127,252,241, 71, 98,189,222, 24,202, 38,123, 38, 41,122, 32,199,113,237, 1, 16, 4, 73, 90, 50,217,115,157, + 74,188,131,151,181,167, 84,204,238,144,138,216, 30, 26, 61,121, 77,163, 35, 39, 68, 39, 20, 61,254, 59,111, 54,101, 19, 59,255, + 10, 0, 58, 35, 55, 42, 61, 93,125,190,190,229, 89,214, 68,120,128, 32, 8,138,227,184,141, 28,199, 29, 80, 40, 20,143, 45,177, +221,171,114,114, 28, 71, 2,165,193, 69, 47, 92,184,240, 29, 65, 16,163,116, 58,157,147, 88, 44,206,230, 56,238,151,190,125,251, + 46,222,176, 97,131,177,150, 27, 52, 91, 83, 58, 61, 60, 60,246,185,185,185,181, 44, 59, 78,165, 62, 87,230,111,243,250,178,120, + 68,143,148, 74,229, 72, 75,203,211,179,153,251, 89,207,166,238,111,122, 54,117, 3, 0, 60, 78, 86,225,113,178,242,220,227, 39, +202,254, 47, 89, 71,229,147, 61, 19,101,161, 24, 56,203, 38,123,174,196,233,237,237, 29, 65, 81,148, 71,125, 46, 74,150,101, 85, +113,113,113,126,150,164, 83,161, 80,140,104,216,176,225, 10,149, 74,117, 36, 61, 61,125,250,171,120,243, 86, 40, 20,221, 72,146, + 60,197,178,172,180,170,195,101, 22, 97, 53,116,114,175,145,243,251,121, 62,223,118, 15,124, 99,200,245,203, 87,143,126,179, 60, +110, 73,197,109,147,223,107, 48,110,228,228, 47, 87,238,219,188,254,235,205,191,231,237,172, 43,157,237,218,181, 11, 3,208,210, +236,102,213, 6,147,201,164,138,139,139,235,248, 50,174,131,125, 59, 4,216,201, 28,151,232, 13, 6, 95,146, 0, 39,164,233,152, +252,252,156,111,107, 16, 87,213,114,186,187,187,175,104,209,162,197,151,143, 30, 61,218,159,158,158,254,105,133, 50,254,161, 73, +147, 38,147,211,210,210, 54,165,167,167,207,182,180,142,154, 54,109,106,227,235,235,155,183,104,209, 34,114,225,194,133, 8, 15, + 15,183, 87, 42,149,121,175,162,222, 27, 53,106,228, 42,145, 72,246,176, 44,235,105, 50,153, 54, 63,121,242,100,245,203,112,122, +121,121,209,249,249,249, 95, 54,108,216,112,134,139,139,139, 75,102,102,102, 74,106,106,106, 72, 70, 70,198, 79,245, 16, 87,117, +214,145,159,159,159, 14, 40,157, 78,204,194,254, 86,255, 74, 7,171,202,249,228,201,178,236, 50, 95, 95,223, 15,199,141, 27, 71, + 36, 36, 36,224,252,249,243,120,250,244,233,209,178,254,124, 15, 94, 5,231,217,179,103,185,148,148,148, 67, 36, 73, 46, 80, 42, +149,143,255, 63,230,157, 71, 61, 79,148, 90,241,206, 59,239, 52,239,212,169, 83, 88,187,118,237,216,118,237,218, 21,189, 10,206, +215,145,206,191, 52,156,163,236, 85,115,190,142,116,190, 12, 39,199,113,228,223,249,252, 19,242,222,162, 69, 11, 14,150,207,191, +246,175,171,163,127, 43,231,150,165,237,220,110, 95,248,104,237,142,239,219,190, 48,121,121,240,212, 6,214,127, 30,123,127,101, +240,212, 6,214,255,209,242, 36, 95,242, 5,183,109,245, 47,102, 13,183,190,247,222,123,166,134, 13, 27,110,255,135,231,157,104, +220,184,177,152,191,142, 94, 61,167,139,139, 75, 71,133, 66,113, 92,161, 80, 28,119,119,119,239,244,138, 57,127,119,117,117,245, +251, 31,229,157,199,235, 56,249,222,125,247, 93,231,247,222,123,207,158,191,240,120, 78,158,147,231,228, 57,107,231, 84, 40, 20, + 82,190, 60,121,206,255, 32,231,127, 10,130,127, 74, 66,142, 31, 63,158,197, 87, 7, 15, 30, 60,120,212,141,250,132,118,224,193, +131,199,255, 6, 68, 45, 42,180, 62,109,171, 47,163,100,239,241,156, 60, 39,207,201,115,242,156, 60, 39,207,249,127,142,179, 46, +110,190,111,215,107, 18, 94, 60, 39,207,201,115,242,156, 60, 39,207,201,115,254,223,227,252, 79,129,228,139,128,199,235,198,134, +241,112,223, 48, 30,238,175,107,127, 30, 60,120,240,224,193,227,159, 6,193,127, 45, 67,254,254,254,222, 28,199,141, 36, 8,226, + 67, 0,224, 56, 46,148, 32,136,125,145,145,145, 22, 69,160,149, 72, 36, 25, 90,173,214,185,236,119,150, 86,171, 85, 84,216, 76, + 84,248, 0,165,163,213, 42,126,170, 69,211,166, 77, 51,116, 58,157, 37,243,235, 69, 19, 4, 17,197,178,108,164, 92, 46,191,246, +240,225,195, 36, 75,243,221,183,111,223,207,101, 50,217,183, 26,141,102,229,185,115,231,214,255,127, 40,234,206, 13,221, 92,119, + 25, 25, 3,155,145,149, 59, 31, 64,181,211,240,108, 30,135, 16,130,195,236,178,223,171, 38,239,196,220,218, 72,235,187,127, 45, +232, 40, 20, 10,167,184,184,184,188,157,158,158, 30, 1,224,107,240, 81,136,121,240,224,193,131,199, 63, 81, 96,117,241,179,111, + 69,176,134,217, 66,138,123,195,104, 34,174,114, 36,189,234, 86, 84,110,210,223, 73,128, 66,161,104, 72, 16, 68, 47,142,227,188, + 72,146,188,203,178,236, 57,181, 90,253,172, 62, 28,126,126,126, 13, 1, 12, 7, 48,162,115,231,206,109, 39, 77,154,132, 22, 45, + 90, 64,171,213, 34, 60, 60,124,206,175,191,254, 58,135,227,184,123, 40,157, 82,230, 64, 84, 84, 84, 90, 77, 92, 90,173,214,217, + 28,155,137, 32, 8,231, 15, 63,252, 48,188,194, 36,188,132,121,114, 89,142,227,110, 1,184, 73, 16,196,141,223,126,251, 45,189, +149,147,164, 75,147,134, 78,239,156,137, 76,157, 95,149, 83,167,211, 57, 71, 31, 63, 10,142, 49,225,185, 50, 21,205,223, 31, 94, +190,237,252,251,125,192, 21, 23, 66, 40,166,163,131,254,184, 17, 5, 32, 50, 53, 53, 53,170,113,227,198, 73,181,113, 86, 69,135, + 14, 29, 22, 7, 7, 7, 59, 14, 26, 52,104, 10,128, 26, 5, 86,125, 56,107,129,184, 75,199,246,151,142, 31, 62, 32, 1, 65,226, +189, 33, 31,238,191, 30,121,111, 52,128, 74, 19, 64,111, 30, 11, 23,130,192,236, 73, 95, 77,162, 0,224,199,117, 91,190, 94,251, + 49, 54, 76,255, 21, 25,110,110,110, 65, 28,199,125, 93, 86,206, 43, 85, 42,213,165,205, 99,225, 2,224,155, 73, 95, 77, 34, 0, + 96,203,186, 45,179, 55,143,197,250,201,187, 81,223, 0,119, 95,140, 29, 59,118,195,178,101,203,168,178, 32,124,111,121,123,123, +183, 42, 44, 44,244, 6,192,119, 14,230,193,131, 7, 15, 30,255,123,129,229,227, 99, 99, 39, 37,185, 25, 82, 17, 55,188, 87,183, + 22, 77,223,125,187, 27,209,172,121, 51, 36, 37, 36,121, 94,186,124,231, 19, 49, 21,159,172,209, 19, 7, 52, 44,177, 38, 46,174, +246,249,195, 22,140,135,145, 97, 74,143, 41, 16,192,180,231,156,199,209,160,160,160,166,227,198,141,131,159,159, 31, 34, 34, 34, +130, 14, 29, 58,244,229,201,147, 39,239, 24,141,198, 83, 98,177, 56,172,174, 8,199,126,126,126, 43,220,221,221,191,158, 57,115, + 38,209,177, 99, 71,136,197,127,133, 93,145,203,229,232,211,167, 15,250,244,233,131,140,140,140,182, 97, 97, 97,109,247,237,219, + 23,226,231,231,183, 50, 42, 42,106,142, 37, 5,244,237,183,223,250, 87,179,250, 44, 65, 16,143, 72,146,140,244,242,242, 74,111, +238, 42,107,237,104,111,119,226,251,101,139,112,230,205,177, 53, 10,151,223,251,119, 3,128, 74, 2,203,144,147, 9,137,181, 60, +154,150, 74,163, 0, 68, 2,136,106,220,184,113,180,165,156, 0, 16, 24, 24, 40,190,127,255, 62,193,113, 28, 58,117,234,100, 79, + 16, 68, 18, 73,146,235,207,156, 57,179,165,226,126,245,225,172,203,189, 10,158, 61,153,206,121, 28,141,196, 27,231, 48,216,223, + 93, 18, 21,119,127,169, 86,111, 60, 92,219,159, 8,130, 36,119, 71, 56,206, 1,178,190,100, 89,246,219,132,132,132, 64, 0,240, +242,242, 18, 1,184,180, 39,188,193,128,177,221, 10,254,206, 36,159, 52, 69, 81,155,119,238,220, 57,126,244,232,209, 72, 73, 73, +193,181,107,215, 32,151,203,177,120,241,226, 38, 51,103,206, 12, 97, 24,230, 75,254,178,231,193,131, 7, 15, 30,255, 83,129,213, +195,207, 42, 60,168,107, 19,255, 65,253,187,145, 45,188,188, 65,139,173,202,183,181,243,243, 67, 59, 63, 63, 98,226,196,162,102, + 49, 81, 49, 11,206,252,121,123,158, 45,205, 68, 94,139, 42,169, 49,232, 25,195, 64, 16,178,108, 31, 0, 96,207,142,145, 84, 82, + 82, 82, 83,169, 84, 90, 81, 40, 32, 48, 48,144, 12, 9, 9,233,124,233,210,165,206, 7, 14, 28, 48, 24,141,198,117, 42,149,170, +182,169, 51,190, 62,116,232, 16, 65, 81, 20, 40,138,170,113, 39, 87, 87, 87,244,235,215, 15,174,174,174,196,236,217,179,191, 6, + 80,173,192,146, 72, 36, 89, 4, 65, 56, 3, 64,131, 6, 13, 76,193,193,193, 49, 92, 25, 0,128,101,217, 91, 20, 69,221, 36, 8, +226,214,209,163, 71,149,158,110, 18,119, 57, 45, 62,183,125,235, 70, 24, 11, 51,107,140,227, 85,162, 74, 55,171,140, 74,235, 69, + 50,171,104,145, 76, 22, 37,146,203, 35, 1, 68, 17, 4, 17,109, 41,167, 89, 92, 73,165,210, 43, 91,183,110,109, 0, 0, 83,167, + 78,181, 43, 41, 41,177,155, 48, 97,194, 28, 0,229, 2,171, 62,156,181,192,238,141,174, 29,159,126,240,238, 91, 54,126,157,123, +224, 86,232,143,200,207, 47, 70,113, 81, 9, 88,150,125, 97,230,223,201,187,145,185,121, 28, 86,253,184,118,203, 55, 4, 73, 18, +190,253,191, 70,127,123,110, 90,206, 47,191,196, 1, 16,138, 68,162,178, 34, 33, 4,238,238,238,110,214,110,173, 86,181,232,209, + 26, 91,214,111, 6,199,178, 28,128, 85,245,112,175,156,173,173,173,143,157, 59,119,174,115, 64, 64, 0,110,221,186,133,199,143, + 31, 99,242,228,201,250,201,147, 39,211, 99,198,140, 33,102,204,152, 49,117,229,202,149,161, 0,174,243,151, 62, 15, 30, 60,120, +240,248,159, 9, 44, 9,109, 10, 8,222, 16, 3, 83,241, 35,112,198, 84,112,134,140, 23,246,177,178,107,136, 54,190, 46,176, 18, + 57,145,119, 19,214, 6, 84,217, 92,235, 80, 75,179,184, 10, 93,237,230,163, 41, 86,211, 0, 32,149, 41, 12, 31,204, 80,198, 5, + 4, 4,192,201,201,137,190,113,227,198, 12,160,210,220,100, 85, 57, 9,125,108, 4, 18,223,237,142,230,137,185,176,178,178,130, +249,193,109, 70, 82, 82, 18,174, 92,185,130,148,148, 20,120,122,122, 2, 47, 70, 80, 46,231,212,106,181,174,253,251,247, 15, 91, +185,114,101,207, 21, 43, 86,220,221,191,127,127, 47, 0, 37,213,186,123, 13,109,236, 88,134, 59,183, 99,203, 90, 33,244,197,246, +247,239, 92,175, 49,239, 77,223,253, 0,147,242, 75,155, 30, 15,122,187, 65, 98, 35,135, 88,110, 29,221,239,236,157,114,231,138, + 32,136,104, 75, 57,131,130,130, 62, 17, 8, 4,243, 13, 6,131,237,182,109,219,236,236,236,236,200, 99,199,142, 25,182,110,221, + 90, 68,211,180,158, 32,136,229, 47,147,206,218, 32,164,168, 37, 63, 4,207,182,177, 34, 25, 68,157,250, 5,233, 41,169,136,125, +168, 52,254,118, 53,222,164, 55,154,198, 85,199, 57,121, 39,230,206,120, 79,180, 43, 66,237,121,124,224,194,201, 45,151, 14,114, +129,193, 96,216,145,157,157,141, 9, 19, 38,128,101, 89,244,232,209,163, 59,199,113,202,105,211,166,193,211,211, 19, 59,254,120, + 80, 34, 40,188,221,107,223,197,162, 8, 11,211,217,182,113,227,198,231, 46, 93,186,228,226,238,238,142,176,176, 48,100,100,100, + 64,161, 80, 96,242,228,201,162, 21, 43, 86,236, 41, 44, 44, 28,186,108,217, 50,201,189,123,247, 14,156, 61,123,182, 33, 74,251, +204,189,142,161,192, 60, 39,207,201,115,242,156, 60,231, 43, 6,199,113, 1, 0,156, 0,100, 19, 4,113,167,226,114,217, 46, 78, +101,223, 85,151,115,202,158,249, 21, 39, 47,207, 41,123, 6, 56, 1, 48, 1, 8, 39, 8, 34,239, 85,167,217, 44,176, 2, 1,132, + 1, 88, 4, 32,184,234, 78, 6,101, 24, 68, 77,222, 7, 36, 62,224,244,143,192,234,149,224,132,206, 40, 46,145, 32,231,105, 10, + 18,111,133,130, 99, 74,234, 62,152, 0,204,198,117, 35, 5,214, 86, 0, 45,118, 50, 20, 21, 21, 65, 38,147, 65, 83,172,166,199, + 76, 40,119,182,232, 75,151, 46, 33, 50, 50, 18,110,110,110,117,138, 64, 0,224,244,165,173,136,122,189, 30,122,189, 30, 25, 3, + 58, 65,214,165, 39,242, 70, 77,198,133, 11, 23,144,157,157, 13,154,166, 65,211, 52, 24,134,169, 51,157,100,217, 76,188,102,211, +170,186,125,220,221, 33, 49, 25,141, 39, 54,174, 89,110, 99, 35,183,114,137, 56,247, 59, 82, 82, 50, 44, 42,116,145,204, 10, 34, +169, 85,180, 72, 38,173, 36,174,234,195, 73, 81,212,226,195,135, 15,187,235,116, 58,208, 52,141,208,208, 80,195,238,221,187,227, +138,139,139,223,136,138,138,210,188,138,116, 86,133,131,147,211,201,247, 63,254,108,242,210, 79,251, 65, 83,172,197,209,171,241, +248,243,110,242, 32, 0,215, 0, 20,215,244,191, 53,191,235, 31,186,185, 21,244,153, 48, 97, 66,244,145, 35, 71, 28,127,248,225, + 7,152, 76, 38, 48, 12, 3,134, 97,202,127,155, 76, 38,236,223,191, 31,215,110,199, 79, 83,171,139, 34, 44, 76,150, 91,211,166, + 77, 47,220,190,125,219,201,202,202, 10,231,207,159, 71,126,126, 62,190,248,226,139,114,231, 42, 63, 63,127,248,150, 45, 91, 62, +120,250,244,233, 15, 87,175, 94,125, 6,128, 2,192,128, 7, 15, 30, 60,120,252,147, 80,155, 22,113, 34, 8,226, 4,199,113, 3, + 57,142,235, 11, 64,100, 94, 6, 0,130, 32, 78,148, 61,183, 43, 45,207,153, 51,103, 94, 72, 72, 72,156,121,217,188,207,220,185, +115,125, 86,172, 88,177,188,107,215,174, 7,110,220,184,241, 4,192,107, 19, 88, 97,168,101, 94, 44,221,163, 95,161,123,242, 27, +104, 69, 16, 68,205,134, 65,232,216, 21,105,247,195, 16,125, 97, 13,210, 31, 92, 3,199,154,224,210,176, 77,157, 7, 91,250, 19, +132, 10,133, 34, 82,165, 82, 33, 42, 42, 10,143, 30, 61,130, 68,242, 66,203, 18,254,252,243, 79, 0,128,139,139,139,101,130, 37, +160, 59, 26,198,168,145,230, 91, 58,224,175, 97,140, 26, 0,176,124,238, 92,136, 68, 34,208, 52, 93,190,175,201,100,170,147,143, + 40,235,213, 94,214, 44, 88,221,232, 64, 66,194, 88, 31, 90, 56,103, 74,227,166,158, 45,220,110,159, 60,136, 39, 79,148,200,204, +180,172,126,196,114, 89,180,216, 90, 22, 37,146,254,213, 44,248, 18,156, 7,135, 14, 29,250,201,144, 33, 67,164, 93,186,116, 17, +255,252,243,207,249, 85,197,213,223, 77,103, 69,184,186,186,246,127,231,157,119, 78, 78,156, 56, 17,131,223,234,139,145, 61,188, +184,244,172, 2, 13,128,243,101,111, 0,181, 66,165, 82, 41, 1,244,123,255,253,247,127,245,241,241,241,226, 56, 14,109,218,180, +193,224,193,131,113,248,240, 97,196,199,199,163,168,168,200,112,245,234,213,117,106,181,122,167,133,201,178,106,208,160,193,153, +139, 23, 47, 58, 89, 89, 89,225,220,185,115, 40, 41, 41,121,193,185, 90,190,124,185, 36, 57, 57,121,211,217,179,103,155,160, 52, + 52, 9, 47,174,120,240,224,193,227,159,135, 90,181,136, 89, 56,113, 28, 55,176,162, 96,170, 42,180,204,191,205,251,133,132,132, + 12,172, 40,190, 0, 96,197,138, 21,203, 43, 44,151,188,142,204,152, 5, 86,175, 50, 33,209, 11,192,229, 42,182, 92,233, 15,150, +129, 65,121, 30, 6,229,121, 88,249,206,199,177, 13,163, 42, 17, 89,226, 12, 85, 7,173, 86, 11,161,200,193,176,103,199, 72, 26, + 0, 76,156,204,240,194,177,235,182, 14, 45, 62,158, 37,233, 36, 8,130,172,192,251,130,120,240,240,240, 88,221,181,123,231, 30, + 45,218,117,178,186,125,230, 8, 30, 62, 72, 65, 78, 78, 1,192, 65, 91, 19,231,249, 97,111,163,248,113, 18,164, 54, 54,209,253, + 47,198, 84,114,174, 94,134,243,194,133, 11,179,186,116,233,242,109,104,104,168,202,211,211, 83, 44, 16, 8, 12, 85,196,213, 75, +165,179, 34, 20, 10, 69,119,129, 64,112,142, 36, 73,105, 80, 80, 16,166, 77,155,134,245,235,215, 51,172, 80, 50,112,203,153,136, +161,207,117,134,249,150,136,171, 10, 34, 43, 86,165, 82,121, 39, 37, 37,137, 25,134, 9,122,247,221,119, 79, 13, 24, 48, 0, 55, +111,222,196,133, 11, 23, 90, 26, 12, 6,117,217,113, 23, 3,112, 33, 73,114,101, 45, 51,185,147, 52, 77, 31,184,112,225,130,143, +155,155, 27,206,159, 63,143,146,146,146,114,231,106,236,216,177,149,156,171, 27, 55,110, 60,227,197, 21, 15, 30, 60,120,252,163, + 81,163, 22,169,232, 62, 85, 39,178, 44, 65, 5,241,165,153, 51,103,206, 60,130, 32, 78,148, 57, 92, 26, 0,170,215, 37,176, 46, +151,169, 70, 14,117,207,240, 14, 83,209,147, 23,214,177,236,203, 63,183, 90,246, 61, 27, 39,149, 74,177,101,203, 22, 88, 89, 89, +213, 91, 56, 21,159, 58,130,180,201, 31,151, 59, 87,102, 39, 11,253,199,188,172,192, 50, 59, 88,183, 80,165,137,208,221,221,125, + 74,187,118,237, 62,221,190,251, 87,235, 21,223,126, 93, 80,152, 24, 39,208,150,232,100, 58, 35, 99,120,148,153, 83, 99,120, 4, +166, 48, 31, 98,153, 44, 90,104, 37,125, 65, 92,189, 44,231,173, 91,183,180,189,123,247,222,181,124,249,242, 46, 44,203,238,126, + 21,233,172, 40,174, 28, 28, 28,206,110,218,180, 73, 42,149, 74,161,211,233,176,114,229, 74,252,249,231,159, 3, 51, 50, 50,206, + 2, 56,251,178,245,109, 48, 24,198,247,237,219,119,237,172, 89,179, 96, 52, 26, 49,108,216, 48, 60,125,250,244,220,195,135, 15, +215,123,120,120,204,250,226,139, 47,220, 28, 29, 29, 49,105,210, 36, 26,192,216, 26,104,190,223,183,111,223, 64, 95, 95, 95, 92, +190,124, 25, 5, 5, 5, 80, 40, 20,152, 50,101,138, 40, 36, 36,100, 79, 81, 81,209,208,144,144, 16,222,185,226,193,131, 7,143, +127, 15, 44,210, 34, 21,157,168,250,160,194,255,132, 33, 33, 33,113, 33, 33, 33,149, 28,174,215, 37,176,184, 10,234,177, 78,119, +136,213,188,216,135,135, 53, 49,245,201,164, 69,251, 89,210,156, 7,252,213, 7,171, 26,161,244,194,114, 61,250, 96,157,229, 56, +238, 70, 69,129,229,238,238,254,158,171,171,235,247,251,246,237,147,170, 84, 42,120,180,106,107,123,242,240,111, 58, 23,153, 88, +155,158,155, 59, 38, 86, 85, 28, 90, 19, 39,171, 45,142,150,200,228, 81, 18, 43,121, 85,113,245,210,156, 0,112,241,226,197,153, + 85,215,253, 93, 78,133, 66,209,221,209,209,241,236,166, 77,155,172, 84, 42, 21,104,154,134, 92, 46,199,197,139, 23, 81, 38,174, + 94, 26,238,238,238,193,147, 39, 79, 94, 56,118,236, 88,228,229,229,225,194,133, 11, 8, 10, 10,194,166, 77,155, 26, 95,188,120, +113,109,183,110,221, 64, 81, 20,206,159, 63, 15,163,209,248,160, 6,154, 33, 19, 39, 78,156,245,193, 7, 31, 32, 60, 60, 28,106, +181, 26,147, 38, 77,210, 79,153, 50,165,188,207,213,143, 63,254,248, 65,114,114, 50,239, 92,241,224,193,131,199,191, 7, 53,106, +145, 42,207,242,147, 28,199,189, 83,213,213,170, 42,190,204, 14, 85,197,229,170,251,151,109,215,190,142,204,152, 5, 86,205,174, + 21,103, 2,101,223, 30,166,220,216, 10, 2, 75, 93,105, 23, 90, 44,135,201, 2,225,178, 96, 60,140, 78,118,106,193,222,197, 36, +132, 34, 7, 67,203,190,103,227,106,218, 87, 46,151,131,101, 89,139,116, 24, 61,224, 3,170,121,255,247,240,184,157, 43, 56,163, +161,220,201,194,188,121,149,196, 21, 77,211,208,235,245, 64,221,205, 90,225, 4, 65, 60,165, 40,234, 38, 0, 46, 48, 48,112,135, +209,104,124, 47, 47, 47,175,193,132, 9, 19, 12, 57, 57, 57, 56,122,244, 40,118,237,218,165,121,110, 16, 68,228, 61, 51,142,122, +162, 46, 78,175,133, 47,250,157,203,113,149,156,171, 87,192,249, 2, 94, 5,167, 66,161,232,238,236,236, 92, 46,174,196, 98, 49, +228,114, 57,148, 74, 37, 4, 2,193,223, 10,210,217,184,113, 99,177,191,191,255, 55, 99,198,140, 65, 98, 98, 34,230,204,153,163, + 86,169, 84, 71,142, 29, 59, 54,105,198,140, 25,130,192,192, 64,100,101,101, 97,235,214,173,198,240,240,240,229, 25, 25, 25,171, +170, 61,105, 5,130,241, 75,150, 44,225, 84, 42, 21,241,248,241,227, 74,206, 85, 97, 97,225,208,144,144, 16,201,147, 39, 79,120, +231,138, 7, 15, 30, 60,254, 93,168,173, 5, 45,167, 76, 60,101, 86,179, 76, 85, 16, 86, 85,151,179,170, 44, 3,128,190,202,246, +152,215, 41,176,170,133,209, 68, 22,236,219,244,153,237,160, 15,191,128,196,181, 39,244,201, 7,193,106, 50,203, 5, 22, 45,177, +134,141, 99, 35, 20, 62,215,224,122,194, 19, 24, 77,100, 65,109,124, 12, 3,193,212,175,254, 26, 45,104,103,103,135,130,130,130, + 74,142,150,149,149, 21,220,220,220, 80, 88, 88,136,208,208, 80,112, 28,119,189, 14, 55,108,201,152, 49, 99,190,251,226,139, 47, +200,230, 35,198,225,249,173,171, 47,184, 86, 18,137, 4, 82,169, 20, 74,165, 18,247,239,223,103, 57,142, 91, 82,135, 58,190, 77, +146,100,244,111,191,253,150, 30, 24, 24, 56,182, 65,131, 6, 35,198,141, 27, 39, 13, 15, 15,199,146, 37, 75, 4,231,207,159, 55, +220,185,115,135, 49,153, 76, 51, 85, 42,213,214, 58,207, 24,130,168, 42,174,254, 54,103, 53,226,234,111,115, 42, 20,138,110,110, +110,110,103,215,175, 95,111,149,145,145, 1,177, 88, 12,107,107,107,164,166,166, 98,201,146, 37,197, 12,195,188,245, 55,207, 55, +177, 76, 38, 19, 27,141, 70,236,222,189, 27, 74,165,178,107, 70, 70, 70, 42,203,178, 91, 63,255,252,243, 13, 94, 94, 94,109,238, +223,191,255,224,249,243,231,147, 51, 51, 51, 19,107, 34,177,179,179,235,234,228,228, 68,220,188,121, 19,147, 38, 77,210, 79,157, + 58,181,188,207, 21,239, 92,241,224,193,131,199,127, 80,121, 17, 68,120,109,203,255, 68,212, 58,217,115,118,137,198,121,235,158, + 35, 27,134,125,212, 71,123,246,226, 69,160,241, 24, 8,221,251, 3,148, 4,110, 45,187,195,169, 73, 23,196, 60,204,192,209,171, +113,218, 36,165,126, 67,118,137,166,234,124,123,181,206,182, 93, 80, 80, 35, 29,184,229, 0, 0, 32, 0, 73, 68, 65, 84,128, 38, + 77,154,224,209,197, 1, 62,119, 14,181,241,243,179,223,232,215, 16,171,125, 46, 94,188,136,213,171, 87, 63, 79, 74, 74, 90,211, +178,101,203, 89,181,113, 70, 71, 71, 47, 74, 75, 75,235, 48,119,238,220, 51,243,211, 11,145,183,120, 51, 10,191, 26,131,140, 62, +237, 96,101,101, 5, 71, 71, 71, 20, 23, 23,227,202,149, 43,136,137,137, 57,163,213,106, 59, 68, 71, 71, 47,170,141,147,227,184, + 91, 94, 94, 94,143, 59,117,234,100, 93, 80, 80,176,126,204,152, 49,210,226,226, 98,228,228,228,224,217,179,103,184,125,251,246, +121,189, 94,239, 83,135,104, 41,231,100, 89,182, 92, 92,189, 42,206,138,120, 85,156, 50,153,108,246,209,163, 71,173, 72,146,132, + 88, 44,134,173,173, 45,210,210,210,176,120,241,226, 98,141, 70,243,150, 90,173,182, 52, 64,103,141,245,206,178, 44, 24,134, 1, +199,113, 16,137, 68,133, 0,144,153,153,153,248,228,201,147, 62,199,143, 31, 87, 60,122,244,168, 87, 13,226,170,156, 51, 39, 39, + 39,236,233,211,167,144,201,100,152, 58,117,170,104,249,242,229,123,215,175, 95,175, 13, 9, 9,161,251,246,237,187,233,236,217, +179,173, 53, 26, 77, 79, 11,196,213,255,229, 89,235,121, 78,158,147,231,228, 57,255,105,156,255, 41,212,234, 96, 37, 36,192, 0, + 20,125,233,229,101,189,104,229,150,125, 91,246, 30, 58, 60,100,194,240,247, 5,254,237,130,144,156,113, 12, 87, 34, 46, 49,121, + 69,220,209, 34, 61, 53, 41, 33,161,168,206,177,255, 2, 1,152,185,243, 71, 10, 0, 64, 40, 4, 51,111,224,192, 48, 31, 31,159, + 30,131,124,179,232, 73, 83, 75,157,173, 45, 27, 71,210, 97, 97, 97,135,196, 98,241,182,228,228,228, 66,165, 82, 89,103, 38, 98, + 98, 98,238, 2,120,155,162,168,158,179,102,205,250,126, 64, 83,143, 78, 67,186,246,130, 80, 40,196,157, 59,119,144,155,155, 27, + 78,146,228, 55,209,209,209, 87, 44, 41,148, 63,254,248, 35, 29, 0, 74, 74, 74,150,180,108,217, 82,148,144,144,128, 71,143, 30, + 33, 41, 41, 9, 38,147,233,161, 82,169,172, 87,135, 56,137, 68,114,155, 32,136,184, 87,201, 89, 17,175,138, 83,163,209, 44, 95, +186,116,233,155,139, 22, 45, 18, 91, 91, 91, 35, 58, 58, 26,139, 22, 45, 42,214,106,181,245, 17, 87,181,130,227, 56, 24,141,198, +122,141,252,172, 6,223,248,250,250,182, 94,186,116,105,203,178,190, 92,188,115,197,131, 7, 15, 30, 60,254, 61, 2,235, 47,161, + 85,148, 7,224,163, 14, 94,214,158,203, 55,255,186, 67, 42, 98,123,104,244,228, 53,141,142,156, 16,157, 80,244,216,210,131, 45, +253, 9,194,202,107,212,176,179,179,147,165,185,226,185,121, 77, 90, 38,160, 86,171, 87,190, 76,102, 34, 34, 34,174, 0,232,204, +113,220,144, 83, 4, 49, 15,120, 2,142,227,150, 71, 71, 71, 31,173, 15, 79, 64, 64, 64,147,226,226,226,189, 58,157,174, 3,203, +178,162,203,151, 47, 67,171,213, 34, 33, 33, 65,195,178,108,104,125,211,149,156,156, 28,247,170, 57, 95, 71, 58,149, 74,229,157, + 19, 39, 78,244, 37, 8,226,194, 55,223,124, 35, 94,188,120,241, 43, 21, 87,246,246,246, 37, 25, 25, 25,207,180, 90,173, 67,102, +102,166,222,222,222,190, 36, 37, 37,229,101,168, 30, 22, 22, 22,182,155, 62,125,250,226, 89,179,102,205,254,254,251,239,105,190, +207, 21, 15, 30, 60,120,240,248,215, 35, 48,208, 81,102,225,174, 22, 89,136, 11,198,195, 56,103, 44,184, 57, 99,193, 45, 24, 15, +227,171,224,172, 39, 42,113,182,106,213,234,128,163,163, 35, 67,211,180,142, 36,201, 18,138,162, 10, 5, 2, 65, 6, 73,146,147, + 96, 65, 24,139,127, 51, 39, 0,184,184,184,116,244,246,246, 62,160, 80, 40,186,189,138,242,172, 8, 87, 87,215, 55, 61, 60, 60, + 14,186,185,185,245,122, 69,156, 1,111,189,245,214, 83,169, 84,122,195,210, 23,134,255,159,231, 18,207,201,115,242,156, 60, 39, +207,201, 3,252,137,194,115,254, 75, 57,137,151, 16, 87,124,121,242,156, 60, 39,207,201,115,242, 2,235,181,129,228,139,128,199, +127, 0, 28,248,102, 65, 30, 60,120,240,224,241, 15, 2, 81,139, 10,173,207, 76,217, 47,163,100,239,241,156, 60, 39,207,201,115, +242,156, 60, 39,207,249,127,142,179, 46,238,123,224,241, 90,132, 23,207,201,115,242,156, 60, 39,207,201,115,242,156,255,247, 56, +255, 83,224,155, 8,121,240,224,193,131, 7, 15, 30, 60, 94, 49,234,221, 49, 56, 32, 32,160, 5, 0,220,185,115,231,225,107, 76, +215, 20,133, 66, 49,161,125,251,246, 94, 52, 77,147, 5, 5, 5,139, 46, 95,190,188,168,186, 29,219,183,111, 31,241,230,155,111, +122, 94,186,116, 73, 15,252, 53,255,160,249,219,100, 50,165, 71, 70, 70,118,228,171,250,127, 3, 87, 87,215,179, 18,137,164,113, +105,128, 81, 14, 12,107,130,137,229, 96, 50,177, 48,154, 56, 24,244,218, 20,125, 73, 97,255,151,226,246, 29,210,200,100, 98, 67, + 56,112, 91, 8,142,152,196, 17,220, 22,130, 35, 62,231, 72, 98, 11,193,114,159, 65,192,252, 0, 70, 48, 75,192, 10,231,171, 19, + 66,211,254, 11,229, 25, 28, 28, 76,254,205,255, 87, 59,255, 84,135, 14, 29, 78, 72, 36,146,230, 53,253,175,164,164, 68, 29, 27, + 27, 27,244, 95, 62, 87, 93, 92, 92,122,146, 36,185, 17,128, 79,149, 77,137, 0,190, 84,171,213,127,254,211,210,236,228,228,116, +133,162,168,150,197, 37, 37,197,207,139,138, 60,229,114,249, 99,169,149, 76,102, 98, 76, 15,158, 61,203,238,201,223,129,120,240, +248, 7, 11, 44, 63, 63,191, 86, 0, 2, 9,130, 8,228, 56,174,103,203,150, 45, 93, 74, 74, 74, 96, 50,153, 50, 9,130,184,194, +113,220,101, 0,151,163,162,162,146, 94, 69,130, 72,146, 92,181,118,237,218,153, 83,167, 78, 45, 23, 73,247,238,221, 67,187,118, +237,170,221,159,162, 40,143, 21, 43, 86,216,166,166,166,130,166,105,136, 68,162,242, 15, 69, 81,232,210,165, 75,189,142,223,160, + 65, 3,107,103,103,231, 69, 4, 65, 12, 37, 73,146,170,107,127,150,101, 77, 28,199, 29,202,202,202, 90,152,151,151, 87, 84,159, + 99,117,244,111,103, 4,136, 26,142,193,153, 34, 34,239, 10,107,251,127,171, 86,173, 34, 4, 2,129, 71, 69, 65,105, 70,197,229, +138,191, 77, 38, 83,122,124,124,124, 71, 75,203, 66, 98,101, 53,155, 32, 5,125,193,177,109, 74,201,200, 68,142,101, 46,104, 75, + 74, 86, 89,146, 95,177, 88,220, 56, 50, 42,170,101,252,253, 39,240,108,214, 8,122, 3, 3,157,222,136, 99, 23,238,192,215,171, + 41, 6, 13,232,247,210,231, 10,195, 18,193,243,167,140,234,189,124,227,254,128,121, 83, 71,200,151,111,220,223,113,222,212, 17, +214,203, 55,237,239, 56,127,218, 72,235,165, 27,247,117,156, 63,109,164,237,178,141,251,244, 0,198,191,204, 49,198,181,109, 84, + 76,154, 24,113,181,117, 79, 9,116, 59,239,165,202,254, 23, 23,238,242,229,203, 91, 25, 12,134,132,177,195, 58, 46,105,211,194, + 57,171,186,125, 10, 10,178,156, 31, 37, 70,124, 11, 33,237,229,213,105, 94,173,215, 39, 77,211,205,174, 92,185,210,210, 28,105, +223,100, 50,193,100, 50,129, 97, 24,232,245,122,124,240,193, 7,130, 87,145,110,127,127,255,113, 28,199, 45, 43, 61, 45,137,165, +145,145,145,155,254, 6,157, 92, 32, 16, 76, 23,137, 68,129, 12,195,120, 1,128, 80, 40, 76,208,233,116,151, 25,134, 89, 11,252, + 21, 95,207,194,123,207,186,240,240,112,111,107,107,107, 24, 12,134,242,137,225, 41,138,106,211,185,115,231,205, 0, 90, 90,202, +229,238,238, 30, 65, 16,132, 71,125,142,207,113, 92,186, 82,169,172,215,203, 32, 69, 81, 45,159,166,170,156,155, 52,114,195,243, +162, 34, 88, 89,201,100,119,238, 37, 59,251,251, 52,225,159,110, 60,120,252, 83, 5,150,159,159,223, 41, 0,129,109,218,180,145, +246,235,215, 15,126,126,126,104,220,184, 49, 36, 18, 9, 0, 32, 55, 55,215, 37, 62, 62,254,163,232,232,232,143,110,222,188, 9, + 0, 26, 0,215,162,162,162,170,117, 35,250, 12,236, 49, 85, 34, 23,175, 7,128,108,229, 51,117,250,227,172,141,106,181,122, 21, +128,138,111,212,158,163, 71,143,158, 49,109,218, 52,156, 56,113, 2,251,247,239,135, 78,167, 67, 65, 65,205, 83, 28,154, 76,166, +244,209,163, 71, 11,146,146,146,152,154, 28,172,250, 20,136,179,179,243,162, 97,195,134,125,229,237,237, 93, 62,173,139,209,104, + 44,255,206,203,203,195,140, 25, 51,204, 55, 68,176, 44,139,139, 23, 47, 78,253,250,235,175,145,151,151, 55,189, 58,206,190, 61, + 61, 35, 4, 4,225,193,254, 37,202,210, 47, 92,125,210, 17, 32,168, 59, 17, 49, 68,149,155, 44, 0,160, 83, 64,135, 58,197,157, + 64, 32,240,136,138,138,114,166,105,218,162,188,177, 44, 11, 63, 63, 63,139,246,117,115,115, 11,162, 4,244,254, 33,195, 63,109, +208,193,207, 79,232,225,166,128,145, 97,240, 36, 57,181, 83, 76,116,100,135,115,199,127,155, 32,145, 72, 70,168, 84,170, 75,181, +241, 24, 77, 44, 98,226, 30,226,252,181, 40,188, 75, 75, 80,162,213,163,168, 68,143,189,127, 92, 71,122, 86,193, 75,159,184,157, + 58,117,114,207,102,244,157,167,141,127, 79,246,195,143,123,100,211,198,191,135,213, 91,246,150,127, 79,253,116, 48, 86,253,184, + 71, 62,237,211,193,216,184,117, 87,215,166,157, 58,185,135,135,135,215, 56, 45, 64, 77,117, 68,154, 24,241,142,120, 37, 5, 0, +217, 91,183,194,144,153, 9,183,133, 11, 1, 0, 19,125, 60,196,245, 73,179,143,143, 79,185, 32,174, 85, 56, 50, 76,122, 92, 92, + 92,199,186,196, 21,195, 48,156, 64, 32,248,246,234,233, 69,161,221, 58,181,170, 84,152, 73, 15,146,108,131,191, 91,248,225,193, + 51, 69,220, 71,111, 89, 39, 36,132, 47,175, 85,100,177, 44, 75,234,116, 58, 60,120,240,160,218, 40,251, 36, 73,154, 94,166,158, + 2, 3, 3,197,197,197,197,251,228,114,121,251,226,226,226,113, 44,203,126, 23, 22, 22,230, 66,146, 36,250,246,237,251,157,191, +191,127,178, 88, 44,254, 81,171,213, 70,203,229,242, 17,151, 47, 95,214, 89, 72,221,211,218,218,122,239,239,191,255,222,192,207, +207,143,204,201,201, 65,211,166, 77,145,155,155,219,233,202,149, 43,254,159,126,250,233,167, 69, 69, 69,163, 1, 92,169, 71,114, + 91,203,100, 50,110,204,152, 49,132,201,244, 87,118,127,254,249,103,248, 55,207,108,222,175,131,164, 68,107,224, 10,174,198, 74, + 62,231, 72,238, 90, 74, 74,205, 55, 38,130, 32, 60, 22,237,248,210, 89, 36, 18,193,104, 52,150,127, 56, 22, 0, 7,112, 44,192, +177, 28, 56, 14, 0, 71,128, 53,177, 88, 61,119,199, 75, 95, 15, 86, 50,153,149,139,139,107,166,212,202,202,138,227,159,107, 60, +120,252,227, 29,172,183,195,194,194,192, 48, 12,172,173,173, 65, 81,149,159,247,246,246,246,232,217,179, 39, 58,119,238,140,190, +125,251,226,254,253,251,210,239,191,255,190, 70, 59, 98,228,204,129,104,216,210,197, 44, 34, 20, 87, 79, 68,133,252,180,232,176, +163, 90,173,174, 56,215,224,184,137, 19, 39, 18,207,158, 61,195,208,161, 67,175,232,116,186,193, 0, 10,107,203, 64,108,108,108, +199,216,216,216, 87, 86, 32, 4, 65, 12, 85, 40, 20, 56,112,224, 0,244,122,253, 11,219,109,108,108, 16, 23, 23, 87,241, 13, 18, + 29, 58,116,160, 8,130, 24, 10,160, 90,129, 69, 18,132,199,233,176,135,229,243, 52, 14, 27,212,129,238,215,211, 51,243,185,214, +200, 1, 32,230,207,159, 95, 46,174, 56,142,195,226,197,139, 45, 78, 47, 77,211, 72, 76, 76, 4, 69, 81,120,220,163, 21, 0,160, +109, 84, 26, 40,138, 66, 76,123, 55, 0, 64,215, 7,121, 16, 8, 4,144,203,229,150,138,171, 94, 46, 10,143,223,231, 46, 12,177, +214, 26, 57,156,188, 24,142, 84,213,121,112, 28, 7,133,179, 61,186,249,251, 9,189,218,181,119,222,185,121,213,239, 0, 6,171, + 84,170,176,154,197,130, 9, 94,173,154, 97,247,239, 87,176,236,199, 80, 60, 43,212,162,168,164,180, 92,251,118,245,198,207,171, + 95,174,158, 40,138, 90,213,166, 89,179,134,187, 15,158, 69,183, 46,157,176,251,224, 25,116,237,210, 9,187, 15,149, 46,239, 57, +116, 22,111,116,237,140, 61,135,206,162,173, 87,203, 70,207,158, 22,172, 2, 48,188, 70,247,162,106, 29, 13, 46,173, 35, 65,190, +137, 48,215,205,211, 73,147, 74,203,167, 76, 96,213,251, 98, 43, 19,196, 22,184,198,117, 58, 87, 12,195, 32, 43, 43,139,200,207, +207,231,236,236,236, 62,172, 40,178,204,226,234,183,211,133,208, 36,109, 36,126,253,245, 50,251,241,199,129, 9, 9,225,203,189, + 80,218,220,245, 2, 12, 6, 67,242,155,111,190,201, 1,128, 94,175,119, 23,137, 68,116, 21, 1,230,214,173, 91,183, 23, 4, 90, + 93, 77,135,197,197,197,251, 14, 29, 58, 52,196,197,197, 5,131, 7, 15, 62,231,237,237, 45,178,178,178,194,233,211,167,225,225, +225,225,104, 99, 99,115, 42, 36, 36, 4,107,214,172,105,116,238,220,185,253, 0,134, 88, 80,148,125,131,130,130, 14,156, 56,113, + 66, 66,211, 52, 52, 26, 13,226,226,226, 96,107,107, 11,145, 72,132,193,131, 7, 83,221,186,117,115, 8, 10, 10, 58,156,148,148, + 52, 2,192, 5, 75,235, 72,163,209,112,115,231,206,133,149,149, 21,100, 50, 89,249, 71, 42, 50, 17, 91,130,155, 73,191, 90,145, + 33,157,255,245,199, 43,182,239, 60,126,137,101,185,239,210,210, 10,243,107,226,242,160,218, 97,206,172, 57,102,129, 10,145, 72, + 84,201,101, 55,255,166,105, 26, 29, 58,116,168, 51,109,109,218,180,217, 74, 81,148, 83,197,117,121,121,121,212,183, 11,230, 49, +119,227,238,203,140, 12,100, 90,189, 17, 75, 23,127,199, 80, 36, 69,249,248,248, 28,229, 56, 46, 59, 62, 62,254,115,254, 81,199, +131,199, 63, 75, 96, 65, 46,151,227,206,157, 59, 32, 8, 2,214,214,214,176,177,177,129,173,173, 45, 10, 11, 11, 17, 31, 31,143, +196,196, 68, 36, 39, 39,131, 36, 73,120,122,122, 2, 47, 70, 15, 47, 31,106,185,111,245, 9, 72,228, 98, 16, 4, 16,208,175, 61, + 58,246,246,197,189,219,143,191,188,115, 14, 59,212,106,245, 3, 0,130,182,109,219,126,218,165, 75, 23,172, 89,179, 6, 58,157, +110,109, 13,226,234,133,225,155,159,189, 39,184, 74, 11,200,134, 6,134, 77,219,246, 59,243,134,175,175,111,132,159,159, 95,211, +187,119,239, 26,205,110, 86,213,102,178, 42,253,178, 42,113,230,228,228,128,101, 89,139, 93,161,252,252,106,239,177,247,170,186, + 82,102, 44, 13, 89, 99, 87, 84,144,133, 37, 43,127,129,209,104,196,204,153, 51,193,178, 44, 88,150,133,201,100, 66, 94, 94, 94, +105,100,167, 58,242,110,206, 19, 69, 81,149, 4,112, 93,203,181,113, 58, 58, 58,202, 72, 74,184,127,214,252, 37,214,177, 73,233, + 56,113, 49, 28, 28,199,225,216,246,239, 0, 0,131, 39, 46,134, 82,157,141,110,254,109, 48,246,179,233,214,235, 66,230,239,119, +116,116,108,158,147,147, 83, 92, 29,167,145, 97, 17,122,230, 38,212,207,158, 99,244,144,222,208,233,141,200,202, 84, 99,215,143, + 63,224,139, 79,142,160,129, 92,234, 42,117,106,150, 84,177,140,172,173,173, 41,173, 86,123,229,193,131, 7,227,107, 74,167,209, +104,124,123,238, 87, 19,176,110, 71, 40,124, 60, 93,112,226,252, 45, 4,180,109,140, 83, 23,195,209,181, 93, 83,156,185, 28,129, +110,190,158,184,116,243, 30,190,252,252, 99,204,254,242,202,219,245,170,163,229,107,236,138, 10,179,112,114,249, 30,100,109,218, +132,148,169, 83, 17, 80,118, 78,220, 33, 73,208,238,238,128, 77,221,229, 89, 29, 18, 19, 19,161,211,189,104,212,136,197, 98,180, +105,211,166, 86, 78,179,115,149,153,153, 73,100,102,102, 66, 38,147, 17, 9,113,247, 76, 94, 62,109, 63, 52,229, 30,220, 1, 0, +165,206, 85, 33, 74,238,111,128,230,193, 70,208,249,119,201,237,139, 63,211, 79,252,110, 91, 66,133,107,244, 94,149, 23,149,242, +242,233,220,185,115,226,181,107,215, 90, 87,112,129,193, 48, 12,205, 48, 76, 75,115,179, 33,195, 48,208,233,116, 24, 49, 98, 4, + 85, 91,222,165, 82,105,123, 23, 23, 23,220,190,125, 27,193,193,193, 34, 31, 31, 31, 60,120,240, 0, 36, 73, 98,220,184,113,240, +246,246, 70,118,118, 54, 2, 2, 2,112,245,234,213, 14, 22,148,167,181, 76, 38,219,121,252,248,113, 9, 73,146, 40, 42, 42, 2, +203,178,232,222,189, 59, 8,130,192,221,187,119,177, 96,193, 2, 28, 57,114, 4,191,255,254,187,212,223,223,127,103, 73, 73,137, + 23,128, 34, 11,234,136,211,233,116,156, 68, 34,129, 68, 34,129, 88, 44,134, 88, 44, 6, 77,211,208,232, 41,124,182, 48, 89, 39, + 20,203,217,246,237, 60,155,127, 49,113, 8,185,100,197,174,139, 0,142,213,196,169,226,226, 96,239, 67,224,220,174, 8, 12,158, +212, 19,180, 80, 4, 90, 72, 67, 68,139, 32, 44,251, 77, 11,105,136,132, 98, 80,142,218, 58,207, 37,161, 80,232, 24, 21, 21,101, + 87,241, 90,102, 24, 38, 97,234,212,169,158, 67, 6, 13,116, 57,120,228, 4, 53,106,216, 96,147,171,139,115, 78, 90, 90,202, 67, + 0,118,254,254,254, 92,125,207,207,151, 0,207,201,115,190,118,112, 28, 23, 0,160,226, 11,134, 30,128,200,252,216, 46,187,183, + 57, 84, 89, 15, 0,217,101,223, 78, 53, 44,231, 0,136, 7,224, 85,182,206, 4, 32,156, 32,136,188,191,155,102,179,192,170,120, + 17, 18,213,100, 12,133,133,133, 40, 44, 44, 68, 90, 90, 26,182,108,217, 2,161, 80, 8,129, 64, 0,129, 64, 0,146, 36,203,251, + 43,212,132, 63, 79, 92,219, 8, 96,163,159,159,159,240,167,155,161,167,230,239,254,178, 79,231,126,254, 84,196,249,187, 31, 2, + 88, 10,224,237, 49, 99,198, 56, 2,192,158, 61,123,114, 0,156,182,216,197, 17,144, 13, 55,172,255,165,209,180, 47, 71,153, 5, +133,199,142, 29, 59, 26,164,167,167, 87,122, 75,164,105,186,206,126, 89, 28,199, 29,122,248,240,225, 87, 10,133,162,252, 65, 82, +177,153,144, 97, 24, 72, 36,146,114, 49,164,211,233,176,111,223, 62,134,227,184, 67,181,112, 34, 41,238, 79, 60,136,187, 4,147, +137,173, 36,166,180, 90, 45,130,131,131,203,221, 43, 0,152, 84,230,148, 88,138,218,156, 43,138,162,112,205,179, 84, 9, 12,200, +230, 94,232,171, 85, 21, 66,145,100,230,128,247, 63,182,103, 56,170, 92, 92,149,230,161, 84, 92,136,132, 2, 72,197, 66, 60,120, +156,134,166,238,254,232,243,214,123, 13, 46,156, 58, 60, 19, 64,181,131, 16,140, 38, 22, 3,122,249,227,199, 3,151, 80,248, 92, +139,194,252, 92,228,164, 37, 34, 33, 54, 28, 34,145, 8,183,110,221,178,182,181,181,179,110,214,172, 41, 76, 38, 22,215,110, 69, +192,202, 74,138, 3,251,127,109,170, 51, 24,145,250, 52,121,124, 13,194, 86,208,173,163, 23, 10,115, 82, 33, 16, 8,208,205,175, + 57, 4, 2, 1,186,251,183, 4, 69, 81,232, 17,208, 26, 20, 69, 33,176,179, 55,154, 55,111, 14,150,101, 5,117, 92,188, 72,186, +247, 39,146,226, 47,129, 99, 89,152,216,210,230, 95, 14,128, 65,173,126, 49, 95, 25, 25,224,108,156, 95,230, 38,129,111,190,249, + 38, 95,165, 82, 25,170,113, 14,233, 35, 71,142,216,213, 54, 17, 54, 77,211, 94, 2,129, 32, 33, 55, 55,151,181,178,178, 34, 77, + 38,134,245,242,105, 75, 93, 61,189,168,124,238,201,224,197,139, 66, 63,122,203,230,195, 95,118, 29,231,104,167,238, 4, 65,137, +153, 9,223,109, 19, 65, 72,123, 1, 6, 75, 94, 26, 72,157, 78,135,251,247,239,215, 57, 41, 55,199,113,181,158, 80,197,197,197, + 99, 7, 15, 30,124,238,243,207, 63,151,152, 95, 94, 4, 2, 65,185,232,127,244,232, 17, 72,146,196,246,237,219,161,211,233,234, + 60,241, 5, 2,193, 87,135, 15, 31,182, 21,137, 68,229,226,138,227, 56, 80, 20,133,196,196, 68,172, 94,189, 26, 99,198,140, 65, +106,106, 42, 20, 10, 5,102,206,156, 41, 95,177, 98,197, 87, 6,131,193, 18, 91, 56, 86,175,215,119,148, 74,165, 16,139,197, 48, + 11, 45, 0,136,124,228,114, 47, 57, 57,185, 93,163, 70, 50,215,166,222,119,255,232,213,163,189,175,131,131, 93,215, 39, 41, 5, +199,106,124, 65,125,222, 8, 69, 73, 2, 4, 6, 6,226,242,229, 43, 24, 56,112, 32, 76, 52, 13, 86, 36, 2, 43, 18,129,163,105, + 64, 36, 2, 33, 18,129,179,178,178,232,244,161, 40, 10, 25, 25, 25,149,214, 77,156, 56, 49,229,227,143, 63,118, 6, 56,168, 84, + 74,110,250, 87,211,148, 57, 57, 57,156,139,139, 11,111, 33,240,248,183,161, 54, 45,226, 68, 16,196,137, 10,247,158,129,230,229, + 57,115,230,204, 11, 9, 9,137, 35, 8,226, 68,197,245,230,253,202, 12,137, 19,213, 45,151,253,215, 97,238,220,185,109, 87,172, + 88,177,188,107,215,174, 7,110,220,184,241, 4,192, 43, 19, 88, 68, 89,198, 44,154,191,174,186,135,116, 93, 2,203,140,168,168, + 40,163,155,155,219, 79,137, 17, 79,250,180,238,216, 18, 82,153,184, 31,128,141, 98,177,120,250,232,209,163,113,235,214, 45,220, +187,119,239,103,212, 35, 50,183,129, 97,211,166,125, 57, 10, 6,134, 77, 51, 59, 84, 51,103,206,164,175, 93,187,102,168,201,193, +170,137, 43, 43, 43,107, 97,120,120, 56,106,235,228,254,209, 71, 31, 85,124, 24,149,119,114,175,241,140, 97, 57, 24, 12, 70, 20, + 23,107, 74,133, 85,217,195,219,100, 50,161,184,184, 24,195,134, 13, 43, 23, 93, 44,203, 34, 43, 43,235,165, 42,147, 36,201,250, + 56, 87,213,115, 80, 84,255,246,190,126,194,139, 55, 98, 43, 61, 92,223,251,108, 41, 68,116,169,184,146, 74,104, 72,197, 66,164, +169, 50,209,198,203,135,190,124,254, 68,255, 26, 5, 22, 99,194,198, 95,207, 3, 4,129,208, 19, 23,209,177,169, 21, 22, 45,248, + 6, 67,135, 14,133, 72, 36,193,225,195,135,176,106,243,110, 76,106,220, 24, 28,128,206, 29, 59, 96,229,214, 3, 88,178,120, 49, +121,232, 96,104,143,186,210, 43, 20, 10, 65, 81, 84,249, 67,187,234, 55, 69, 81,117,138,132,242, 58, 50, 26, 81, 82,172,129,137, +101,193,178, 28, 56,150, 5, 56, 14,238,203,150,193,125,217, 50,220, 33, 75, 7,240,121, 23, 23, 67,163,209, 0,189,218,215, 91, + 92,233,245,122,168, 84, 42, 67,108,108,108,117, 79,191, 76,189, 94, 95,107,122,231,205,155,151,180,124,249,114, 47,123,123,251, +132,216,216, 24, 99,251,246,190,194,170,125,176, 90,181,108, 85, 16,188,120, 81,232,168, 79,222,253,112,235,130,225,204,231, 11, +247, 10,204, 29,221, 67,207, 4,215,125, 61, 25, 12,201,125,251,246,181,168, 43,143, 70,163,201,168,105,155,185, 67,123,171, 86, +173,196,189,123,247,198,149, 43, 87,176,108,217, 50,150, 97,152, 28, 0,232,214,173,155,211,146, 37, 75,136,248,248,120,216,217, +217, 33, 43, 43,107,183,191,191,255,146,218, 58,190,139, 68,162, 94, 1, 1, 1,164, 78,167, 43,127, 41, 33, 73, 18,137,137,137, + 88,177, 98, 5, 70,140, 24,129, 86,173, 90,149, 95, 91, 65, 65, 65,194, 13, 27, 54,244,178, 68, 96,145, 36,249,101,159, 62,125, +126, 64,233, 40,194,138, 55,185, 4, 0,179, 1, 32, 53,245, 89, 70,100,100, 82, 92,159, 64,191,142,205,155,186, 43,194, 35,159, +214,200,247, 76,248, 8, 10, 63, 41,104, 33,141, 49, 95, 15,194,137, 19, 39, 48, 57,248,227, 50, 39,171,212,193, 18, 10,105,208, + 66, 17, 68, 78, 47, 55, 17, 65,217,125,132,176,177,177, 5, 0,216,218,218,154,239,113, 4, 0,142, 36, 73,190, 75, 22,143,127, + 19,234,212, 34,102,129, 84, 85,104,133,132,132, 12,172,186,174,162,152,170,238,119,197,255,174, 88,177, 98,121, 5,238,146, 87, +145, 25,193,171, 42, 21,163,177,246, 57,154,131,130,130,166, 90, 91, 91,175, 55, 47, 63,189,174,196,211,235, 74,120,181,246,233, +238,231,219, 49,127,196,136, 17,112,112,112,192,236,217,179, 57, 0, 59,235,115,236,109,191, 51,111, 84, 92,142,137,137,233, 24, + 19, 19,243, 82,249,200,203,203, 43, 42,235,172, 62,253, 21, 90,155, 48, 26,140, 40, 46,209,194, 96, 48,192,104, 52,129, 97, 76, +240,247,182,198,222,109,223, 64,175, 55,192,104, 42, 93, 87,234,148,153, 32,166,117,232,217,217,195, 8,130,212, 92,185,149,106, + 83, 27,191, 79,100, 42, 40,138, 66,172,175,123,181,206, 85, 63,149,193, 98,161,197,177,166,214, 46, 46,206, 72, 61,115,187,244, + 45,220, 74,130,179,123,150, 64,102, 85,250, 38,255,246,152,121,165, 34, 75, 76,195, 96,208,195,217,165, 9, 24,147,177,117, 77, +124,140,209,160,111,223,210, 29,118,214, 82,196,220,185,137,233, 83,198, 99,220,184, 79, 65, 75,172,113,249,242, 37,164,170,178, +240, 40, 61, 15, 83, 22,254, 8,163,209, 4, 3, 99,130,145, 97,177,110,215, 9, 24, 76,117, 43, 35,154,166, 49,115,230, 76,105, + 77,219, 15, 28, 56,160,177, 72, 96,113,101, 34,184, 68, 3,157, 86, 7,189,161,180, 46, 76,205,132, 88,186,224, 99, 24,141, 70, +104,134,119,133,193,104,132,233,203, 33, 48, 24, 12, 72,179, 18,144,221,253, 21, 70, 16,164,230,122,132,210,198, 82,129, 85, 83, +122, 56,142,171,182,233,176, 38,145,213,190,189,111,194,152, 97, 29, 67,174,223,184,147,125,253,198,157, 23,246,107,214,170,227, +227,207,151, 30,152,107,201, 40,194, 74, 54, 78,133,230,194,191,121,222,127, 23, 22, 22,230, 34,151,203,145,148,148, 4,138,162, + 64, 16,196,179,168,168, 40, 23, 0,120,231,157,119,114,132, 66,161, 3, 69, 81,248,234,171,175, 64, 81,148,211,228,201,147,191, + 5, 80,163,192, 98, 24,198,203,218,218, 26, 69, 69, 69,229,229, 40, 18,137, 48,103,206, 28,140, 26, 53,170, 92, 92,137, 68, 34, +236,222,189, 27,254,254,254,208,235,245, 94,150,164, 87,169, 84,222, 1,240,134, 5,162,166,180, 95, 30,203,214,122, 98,201,139, + 27, 66,155, 44,130,137,166,113,224,216, 49,140, 26, 53, 10, 34,145,184,220,185, 2, 77,131, 16,137, 64,210, 52, 76,148,184,222, +229,203,178, 44, 10, 11, 11,169,221,187,119, 55,243,241,241, 33, 56, 0,109,218,120, 19, 39, 78,158,108, 36,151,203,159,216,219, +219, 27,192,131,199,127, 77,129, 85, 16, 72,175,130,107,206,156, 57,243, 0,112,115,230,204,153,103, 94, 14, 9, 9,209, 0, 80, +253, 99, 4, 86, 93, 14,214,154, 53,107,106, 12,181, 96,126,184,108,216,176, 1,123,247,238, 93, 3,224,113,125,142, 61,113,176, +224,182,149,148, 86,148,104, 12,234,237,199,152,206,237,219,183,143,232,218,181,107,179,136,136,136, 26, 29,172,154, 98, 99,189, +142, 48, 13, 28,199, 65,111, 48,162,164, 68, 3,173, 94,143, 25,223,108,182,168,238, 13,250, 34,193, 59,111,245,148,214,229, 36, + 90,210, 7,171,174,166,193,202, 98,153,129, 89, 3, 60, 47,209, 34,104,196, 28,220,249,163, 84, 27,155,197,149, 84, 44,132, 68, + 36, 4, 73, 0, 68, 45,198,167, 81, 83, 56,232,235,169,227,175,110,249,121,175,199,123, 61, 39, 96,218,180,105, 16,136,172,208, +192,193, 9,140,137, 67, 35, 55,103, 60, 74,207,195,225, 77,223,148,121,195, 28,122,142, 12,198,154, 5, 19,176, 42,184,238,183, +122,138,162,176,105,211, 38, 77, 85,215,170,162,147,101,169, 8, 54,187,140, 26,157, 30,179,230,254,104,121, 29,245,127, 67,106, +105,217, 86, 55,112,194, 82, 1, 86, 85,100, 1,160,128,154, 27,253,196, 14,128, 87,247, 1, 11,254,151, 55, 67,150,101,113,242, +228,201, 23,220,213,170,117,104,169,219,202,178, 44, 82, 82, 82,112,239,222, 61,116,237,218, 21, 5, 5, 5, 16, 0,152,121,247, + 46,188, 71,143,134,174,172,235,130, 72, 36,194,196,137, 19, 95,215, 59,118,169,192, 34,106,175,168, 98,171,116,184,180, 21, 99, +231,138,163,152,186,120, 12,156,218, 72,176,122,238,246,242,237,171,126, 10, 46,235,135, 37,130, 68, 94,255,100, 20, 22, 22, 10, +126, 88,189,186,125,231, 78, 93,164,163,198,140, 35,245, 12,139,165,223,175,167, 14,238,223,227,176,103,207, 47, 82,137, 68,146, +192, 63,142,121,252,215,240,170,196, 85, 85, 7, 43, 36, 36, 36, 46, 36, 36,228, 5, 55,236,181, 10, 44,138,162, 80,113,200,114, +117, 15,121, 75,250, 96,205,152, 49, 3,214,214,214,213,110, 51, 24, 12, 92,108,108,108,188, 90,173,222, 81,219,219,107, 77, 16, + 9, 73,151, 53, 63,236,242,152,246,229, 40, 22, 40, 29,173,181,121,243,102, 59,115, 31,172,138,253,176,234,234,131,229,236,236, +188,104,229,202,149,211,222,126,251,109,146, 36,201, 74, 15, 63,115, 88,134,138, 31,163,209,136,227,199,143, 79, 11, 9, 9,169, + 49, 76, 3,199,149, 54, 63, 21,151,104,160,213,149, 62, 96, 31,221, 11,181,244, 12,168,219,113, 40,115,174,186, 36,229, 86,235, + 92,157,113, 41,125,112, 13,200,174,155,139, 32,169,164,228,148,180, 78,174,142,118,200, 43,120, 14,113, 89,179,160, 25,102,113, + 37, 21,211,104, 96, 43, 71,238,179, 44, 8,133,194,218,220,145,148, 44,117,202, 27,195,134, 12, 56, 71, 82, 2, 73,197, 13, 66, +169,141,213,249,235,119, 27,100,230,149,128,173,144, 79,150,227, 48,117,137,101, 38,166, 80, 40,196,228,201,147,107, 20, 56,199, +142, 29,211,212, 95, 96,233,234, 87, 71,245,112, 50,235,114,176, 44, 21, 88, 85, 97, 30, 93, 72,211,180, 87,153,248,178, 24,237, +219,183, 63,109,101,101,213,212,210,253, 45, 13, 58, 74, 16,196,226,222,189,123, 47,243,240,240,112,254,252,243,207, 9,129, 64, +128,142, 29, 59, 58,246,237,219,183, 0, 0, 90,183,110,109,109,190,199,172, 91,183, 14, 9, 9, 9,217, 4, 65, 44,169,245, 90, + 23,137, 18,109,109,109, 59,246,238,221, 27, 5, 5, 5, 72, 77, 77,133, 92, 46,135,247,234,213,184,251,197, 23,240,221,186, 21, +100,239,222,165, 2, 83, 44,198,221,187,119, 33, 22,139, 19,181,218,106, 59,145,195,205,205,173, 51,199,113, 43, 1,116,199, 95, +205, 18, 28,128,235, 4, 65,124,173, 82,169,110,191,240, 39,146, 32, 75, 95,212,106,175, 40, 81,129, 11,116,105, 98,140, 29, 59, + 22, 52, 45, 2, 68, 34,204,154, 53,171,194,253, 72, 4,170,172, 63, 22,107, 18, 89,242,182,205, 85, 17,235,132, 88, 36, 18,143, +249,228, 83,242,235, 89,211, 89, 35,195,176, 2,129,144,156, 57,127, 57,249,224,254, 61,113,113,113, 49, 73,212,231,205,138, 7, +143,127,137,131, 85, 81,104, 85,112,161,106, 66,118,197,126, 89, 53, 9,180,138,125,178, 0,232, 94, 69, 90, 5,149,222,203, 42, +227, 65, 76, 76, 76, 75, 31, 31, 31,164,166,166,214, 52, 82,174,116, 8,179, 84,138,135, 15, 31, 2,192,131,154, 14,116,233,210, +165,141, 0, 54,154,151, 21, 10, 69,215, 94, 67,123, 93,247,237,237,135,208,181, 7, 11,212,106,181, 47,254,138,137, 69,184,185, +185,141, 18,138, 4, 31, 53,111,219, 40,208,196,178, 43, 47, 29,191,190,168, 38,238,170,125,176, 24,134,121,233, 62, 88, 4, 65, + 12,125,251,237,183,201,248,248,120, 12, 27, 54, 12,191,252,242, 75,141,133, 55,106,212, 40, 28, 56,112, 0,253,251,247, 39, 87, +172, 88, 81, 99,152, 6,142, 3,140, 6, 6,197, 37, 90,104,181,186,215,118,226,253, 93,231, 10, 0, 56,150,185,112, 55, 58,178, + 67, 59,255,174,194,228,180, 12, 72, 68,194, 74, 2,203, 74, 76, 67, 34, 46, 93,231,234,212, 0,225, 55, 46, 27, 24,198, 88,215, + 48,248, 20,131,246,249, 11, 65, 26, 57,130, 74,234,215,189, 93,131,106, 29,207,185, 99,208,238,183, 53, 22, 9,172,159,127,254, + 89, 83,147,123,101,105, 25,112, 28,202,155, 8, 75, 52,175,182,142,156,157,157,157,156,157,157,183,216,217,217, 73,204,125,135, +170,219,110,107,107, 43,169,205,225,170, 75, 92,149,197,197, 74, 88,190,124,121,189, 68,150, 72, 36,106,122,253,250,245,150,230, +126,129,181,125,235,245,122,124,244,209, 71, 22,217,130,145,145,145, 59, 59,116,232,240,200,201,201,233,124,183,110,221,196,241, +241,241, 88,186,116, 41, 33, 20, 10,109,204,215,101, 81, 81, 17, 4, 2, 1,242,242,242, 64, 16,196,216,200,200,200, 51,181,113, +234,116,186,176,176,176,176, 14,131, 6, 13,162, 18, 18, 18, 32, 16, 8,192,178, 44,116, 93,186,192,119,235, 86,220,155, 62, 29, + 61,147,147,161, 51, 26, 33,145, 72,112,230,204, 25, 67, 73, 73, 73, 88, 45,121,223,126,243,230, 77, 31,137, 68, 2,131,193, 0, +150,101, 65,146, 36, 65, 81, 84, 15, 31, 31,159, 13, 0, 2, 42,238,223,164,137,147,115, 71,223, 86,173, 77, 44,107, 82,170,178, +179,107,117, 43,173,179,225,228, 37, 46,239,111, 69, 11,105,208,130, 82, 97,101,118,174,104, 33, 13,154, 22, 65, 44,178,168, 9, +159,171,122,238,152,251, 94,201,100, 86,108,139, 22, 45,226, 31, 60,124,228, 13,128,180,181,181,179,184, 95, 44, 15, 30,255, 52, + 13, 85,155, 80,170,120,137, 85, 88,206, 6, 64,148, 45,103, 87, 16, 82,217, 4, 65,220,225, 56, 46,160,202,190,230,237,250, 42, +223,230,237, 49,175, 34, 35,181,221, 40, 7,140, 31, 63,126,235,155,111,190,217,103,230,204,153,144,203,229, 80,171,213,229, 23, +173, 72, 36, 66,195,134, 13,161,209,104,112,229,202, 21,228,231,231, 95, 4,240,153,165, 7, 86,171,213,183, 30, 70, 63,120,214, + 99, 80,103, 7,175,206,173,237,210,147,210,187,168,213,234, 27, 0, 8,119,119,247,159,134, 79,127,251,147,160,247, 59,129, 22, + 9,145,246, 48, 3,151,142, 95,175,145,171,106, 31,172,191, 19, 27,139, 36, 73,138, 32, 8, 12, 27, 54,204,162,253,135, 15, 31, +142,203,151, 47,163,182,230,196,210, 38, 66, 3, 74,138, 53, 40,121,133, 2,139, 32, 8,152, 76,166,114,231,202,252,233,167, 50, +128, 36,201,114, 97,241,118, 22,107, 49,167,182,164,100,213,213, 11,199, 38,182,246,110,239,212,213,175, 21, 30, 60, 73,195,170, +121,127, 53,181,204,154, 52, 28,187, 15, 28,135,155,171, 3,116,154,231, 56,123,234,120, 65, 97, 97,225,170,151,205,195,238,163, +151, 1, 0,111,140,172, 60, 70, 96,216, 87,235, 44, 59,129, 5, 2,140, 27, 55,174, 70, 7,235,252,249,243,154,138, 78,100, 93, +117, 84, 92,172, 69,137, 70,243,202,234, 72,161, 80,248, 6, 4, 4,156,223,182,109,155,131,163,163, 35, 84, 42, 85, 37,129,165, + 80, 40,124, 59,118,236,120,126,219,182,109, 14, 78, 78, 78, 72, 77, 77,181, 56, 68, 72, 21,113,133,236,236,108, 34, 47, 47,143, +109,208,160, 65,189, 68, 22, 73,146,208,233,116, 72, 72, 72,176,244, 26,177, 56,232,104,211,166, 77,127, 89,191,126,189,248,233, +211,167, 48, 26,141,136,143,143,127, 97, 16, 2, 69, 81,152, 51,103, 14,230,207,159,191, 5, 64,227,218,248, 24,134, 89, 59,122, +244,232,241, 74,165,178,129,139,139, 11,212,106, 53,104,154, 6,199,113, 32,130,130,240,198,147, 39, 48,152, 76,144, 74,165,184, +127,255, 62,118,236,216, 81,108, 48, 24,214, 86,199,229,233,233, 41, 2,208,146,166,105,124,252,241,199,149,182,237,217,179, 7, + 93,189,242, 58,218,117,162,159,155, 56, 90,247, 28, 94,167, 73,146, 36, 58,250,181,106,213,163,107,187,182,113,241,201,143, 84, + 89,185,215,107, 21,255, 5, 14, 48,168,196, 0, 77,255,213,223,170,172,207, 21, 37, 18,149,143, 40,228, 68, 34,176, 34,203,130, + 5, 87, 20, 77, 4, 65,192,193,193, 65,183,110,237, 42,177, 76, 38, 51, 1,128,181, 92,102, 58,184,103, 51, 28,236,237,117,220, +203, 88,161, 60,120,252,115,157,171, 59,255,139,255,190, 22,129, 21, 21, 21,245, 4, 64, 95, 0, 35,175, 92,185,178,102,198,140, + 25, 78, 61,122,244, 64,110,110, 46, 26, 55,110, 12,133, 66,129,136,136, 8,196,196,196,228,112, 28, 55, 51, 50, 50,178, 58,171, +167, 45,106,137, 57,163,122,172, 62,100, 40, 41,249,194,183, 71,107, 92, 14,189, 26,226,234,234,250,153, 64, 32,248,114,204,220, + 65,159,244,122, 47, 0, 73, 81,201,184,117,238, 46,212,169, 57,181,114, 90,210, 7,171,226,119, 53,125,176,202, 57, 89,150, 53, +233,245,122,252,246,219,111, 22,137,172,253,251,247, 67,171,213,130,101, 89, 83, 77,121, 55,177, 38,194,218,198, 9,238,141,188, + 96,208, 23,131,101, 45,127,179,228,234, 40, 79,134, 97,176,104,209, 34,204,158, 61, 27, 75,150, 44,169, 85,136,108,222, 92,109, +223,175, 74,156,121,121,121, 69, 98,177,120,212,129,159,215,135,142,156, 48,205,218,163,155, 47,118, 30, 60, 5,163,193, 8,137, + 88,128, 6, 54,114,180,104,234, 14,189,182, 4, 63,110, 92, 83,168,213,106, 70, 85,211,247,172,182,122,175,132,177, 67, 2,241, +253,142, 63,112,117,223, 95, 6,229, 27, 35, 23,226,215, 31,166,194,207,111, 87,173,156, 38,147, 9, 66,161, 16,251,246,237,211, +212, 52,154,144,162, 40,212, 34,176, 42,213,145,141,141, 19, 60,154,120, 67,175,125,254,202,234,200,193,193, 97,246, 79, 63,253, +228,160,209,104,144,152,152,136,196,196, 68, 16, 4,145, 80,117,123,113,113, 49,238,221,187,103, 22, 57, 9,150,150,167,217,185, +202,206,206, 38,212,106, 53,172,172,172,200,216,216, 88,109,251,246,237, 19, 80,214, 71,171,174,188,235,116,186,167,125,236, 87, +186, 77, 0, 0, 32, 0, 73, 68, 65, 84,250,244,169,201, 49,114, 23,139,197,149,166,108, 50, 7, 29,173,166,169,240,133,116,166, +165,165, 69,175, 95,191,190, 81,171, 86,173,176,125,251,118,157,181,181,181,104,198,140, 25,160, 40,138, 88,183,110, 29,151,155, +155,107,152, 51,103,142,232,218,181,107, 40, 46, 46,142,182,224, 30, 82,164,213,106, 39,118,235,214,109,239,233,211,167,165, 45, + 91,182, 44,159,233, 97,247,238,221,152, 50,101, 10,164, 82, 41,146,146,146, 48,120,240,224,146,146,146,146,137,168, 28, 3,171, +156,147, 97, 24, 66, 40, 20,114, 44,203, 98,193,130, 5,149, 2,139, 90, 89, 89, 65, 42, 50, 97,219, 98, 79,217,244,239, 51,100, +211,190, 24, 61,186,244, 60, 97, 77,113,241,201,143,182,237,252,227, 18, 42, 71,137,127, 33,239,172,109, 1, 28, 91,150, 58, 88, + 66,115,204, 43, 90, 92,105,244, 96,105, 28,172,210,184, 88,117,229,189,106, 87, 12,123,123,123,198,223,223, 47, 94,163,209, 80, +102, 45,229,232,232,120,175,108, 95,174, 97,195,134,250, 23, 79, 79,203,175,205,122,128,231,228, 57,121,212,211,193, 2, 0, 68, + 71, 71,239,243,241,241, 57,189, 98,197,138, 21, 71,143, 30,157, 48,109,218, 52,194,198,198, 6,135, 14, 29,226,114,115,115,119, +137, 68,162,217,183,110,221,122,169,120, 17, 28,199,237,190,118,252,214,164, 17,211,223, 37,166,253, 48,182,123,116,216,189,132, +246,221, 91,162, 93,183,150,136,184, 24,143,205,243, 14,252,194, 24,153,239, 50, 50, 50, 82,107,227,177,164, 15,150,249, 35, 16, + 8,234,140,131,117,244,232,209,105, 3, 6, 12, 32,195,195,195, 95,232,115, 85,177, 31,214,249,243,231, 97, 48, 24,112,232,208, + 33,182,182, 56, 88, 44,112,108,237, 15,223,141,249,121,207, 73, 17, 73, 24,112,243,202, 97, 20,228,101,212, 90, 54, 52, 45,196, +175,251,143, 25, 4, 2,234,126, 45,105, 77,137,140,140,116,248,254,251,239, 41,146, 36,177,121,243,230, 74,206, 85, 85,220,189, +123,151, 53, 26,141,117,214,149, 90,173, 62,207,178,236,240,173,107, 23,239, 14,234, 63,200,174, 77, 27, 31,129,179,115, 35, 8, + 72, 18,249,185,217,184,115,235, 26,115,230,228,239,249,122,189,126,172, 90,173, 62,255,119, 78,192,144,109,191, 87,187,254,131, +105,107,234,114, 81, 24,163,209, 40,144,201,100, 96, 24,166, 90,113,213,167, 79, 31,233,245,235,215, 53, 6,131, 1, 20, 69,213, +170,152, 74,235,104,225,152,159,247,190,218, 58, 50,153, 76, 94,121,121,121, 40, 46, 46, 70, 68, 68, 4,183,121,243,230,236,252, +252,252,121, 21,183,231,230,230,162,168,168, 8,119,238,220,225,182,111,223,158, 93, 88, 88, 56,207,210,242, 51,199,197,202,203, +203, 99,173,172,172, 72,163,209,104,108,223,190,189,132,166,105, 47, 75, 57, 98, 98, 98,222,170,105, 91,183,110,221, 30, 92,191, +126,189, 69,197,185, 9, 25,134,161,117, 58, 93,203,193,131, 7,215,121,255,144, 74,165, 35, 14, 31, 62,188, 79, 34,145,180,211, +106,181,227,179,178,178,118, 3,104, 68, 81, 20, 30, 62,124,152,195, 48,204,208, 5, 11, 22,252, 92, 92, 92,124, 87, 46,151,143, +180, 48,201,255,143,189,239, 14,143,162,218,223,127,103,102,123, 73,111,187, 73, 72, 32, 13,210, 8, 9, 1, 2,132, 42,157, 32, + 40, 32,136, 74, 81, 81, 80,138,128, 20,175,210, 53, 8, 40,136, 10, 2, 34,196, 6,132,166,180, 32, 72, 9, 37,148, 20, 74, 42, +144, 0,105,155,108,122,219,190, 51,243,251,131, 36, 23, 48,101, 19,245,119,239,247, 58,239,243,236,179, 59, 59, 51,239,156, 57, +115,230,204, 59,239, 57,231,115,226,178,178,178,166, 4, 6, 6,126,183,114,229, 74,217,192,129, 3,249,174,174,174,232,222,189, + 59,178,178,178,112,252,248,113,227,214,173, 91, 53, 26,141,102, 6,128,211, 45,188,116,176, 0, 8,179,217,252,212, 28,166, 66, +161, 16,124, 62, 31, 26, 61,137, 55, 63,204,214, 50,224,107, 63,217,240,195,113,150, 5, 81,168, 42, 45, 45, 42,174,188,198, 51, +153,226, 31,169,106, 91,156,235,137, 46,149,162,163,117,112,227,203, 29, 65, 16, 32, 25, 18,132,145, 0, 69, 83,160, 76, 20, 8, + 30,239,177,187,101,217,116, 87,172,217,108, 70, 84, 84, 20,142, 29, 59,134,113,227,198,177,104,161,175,200,177, 99,199, 96,137, +123,203,129, 3,135,255,144,192, 2,128,212,212,212, 74, 0,111, 17, 4, 17, 51,103,206,156, 99, 12,195,240, 25,134, 25,125,243, +230,205,139,127,230,224, 69, 69, 69, 73, 87,142, 39,126,224,228,102, 27, 61, 98, 74, 95, 4,245,240, 4,109,166,113,249, 68, 10, +118,127,114,100,111,126, 94,254,116, 60, 61, 87, 97,147,176,164, 15,214,179, 14, 86,115, 92,106,181,122,197,218,181,107,241,241, +199, 31,183,121, 20, 97,115,219, 36, 36, 22,190, 21,209,157,113, 31,255,124,223,225, 36, 65,176,250, 22,250,217, 16, 4,216,134, +158, 22, 60, 30,149, 25,127, 45, 63,164,133,252,123,110,246,236,217,191,147, 36,233,249,132, 21,138, 22, 30,246,170,178,178,178, + 97,150, 92,155,226,226,226,147,110,110,110,157, 47,196,253,186,236,210,153,147, 3,105,218,232, 67,128,128, 64, 32,184,111,162, +205,231, 77, 6, 67,116, 65, 65,193,159, 14,196,182,236,173,113,120, 84, 88, 10, 30,143,122, 28,123,170, 62,160,233,193, 45, 11, + 16, 22,246, 99,179,251,137, 68,162,147,223,125,247, 93,212,107,175,189, 70,240,120,188,198,102,183,134,243, 39, 73, 18, 87,175, + 94,213, 26, 12, 6,236,222,189,155,149, 72, 36, 45, 6,174,253,187,174, 81,109,109,237,140,177, 99,199,238, 1, 32, 2,112,175, +170,170,234,109,149, 74,149,255,228,250,113,227,198,237, 1, 32, 34, 8,226, 15,235, 91, 67, 67,200, 6, 59, 59,187,244,122,231, + 74,220,158,142,238, 45,148,111,170,185,230, 67, 75,154, 10,235,231, 22,124,177, 97,185,123,247,238,171,103,205,154,245,228,100, +207,241, 0,188,219,145,180,211, 90,173, 54,232,195, 15, 63,156, 39,145, 72, 6,105,181, 90,127, 0,144, 74,165, 25, 26,141,230, +156,209,104,252, 2, 64,101, 75, 4,217,217,217,134, 78,157, 58,101,153,205,230, 96,103,103,231,198,209,135, 66,225, 99, 55,233, +106,134,125, 98, 97, 97, 97,143,199,227, 52,175,181,245,229, 49,191, 37, 71,185,185,125, 90, 90,111, 48, 24, 74,174, 92,185, 98, +127,230,204, 25,138,166,105,196,197,197, 53,190,244, 53,213, 26,152,157,157, 13,131,193,160,227, 30,115, 28, 56,252,103,240,119, +143, 48,177,200, 66, 84, 42,149,147,196, 50,209,108,207,206,202,144,194, 28,117, 90, 77,165,230, 71,149, 74,181, 29,143, 67,214, +115,246,233,255, 40,167, 64, 98,117,138,160, 4,158,205, 62,112,104,227, 35,163,182,102,120, 83,156, 61,123,246,116, 19, 8, 4, + 27,244,122,253,200,150,162,180, 83, 20,101,150, 72, 36, 39,117, 58,221,251, 77, 76,246,252,127, 46, 63, 87,174, 92,217,164, 37, + 97,233, 40,194,149, 43, 87, 50,109, 73,103, 72, 72,200, 57,169, 84,170,108,106,157, 70,163,201,189,117,235,214,176,255,146,252, +124,114, 4,160,197,156,237, 26, 69,248, 31,186,143,220,220,220,196,214,214,214, 27, 72,146, 84, 90, 40,142, 13,106,181,122, 65, + 89, 89, 89, 17, 87, 47,113,156,224,154, 8,255,231, 16,204,113,114,156, 28, 39,199,201,113,114,156, 28, 39,199,249, 79, 3,215, + 64,207,129, 3, 7, 14, 28, 56,112,224,240, 23,131,104, 65,133,182,197,250,107,143,146,189,195,113,114,156, 28, 39,199,201,113, +114,156, 28,231, 63,142,179, 53,110,174,233,241,111, 18, 94, 28, 39,199,201,113,114,156, 28, 39,199,201,113,254,243, 56,255,167, +192, 53, 17,114,224,192,129, 3, 7, 14, 28, 56,252,167, 4,150,204,197, 63,192,209, 51,100,143,157,123,215, 91,118,238, 93,111, + 57,122,134,236,145,185,248, 7,252, 19, 51, 77,169, 84, 74, 20, 10,197,148, 14, 29, 58,156,238,214,173, 91,181,171,171,235,123, + 92, 81,106, 59, 6, 0,188, 73,192, 59,175, 1,185,175, 1,185,147,128,119, 6,252,133, 19,144,255,183, 96,245, 59,174, 17,241, + 39,167,156, 92,253,142,107,147, 1,216, 86, 46, 84, 58, 92,138,155,248,197,178,119, 92,237,255,162, 67, 90, 57, 59, 59,239,112, +113,113,121,232,236,236,252,200,217,217,249, 59, 0, 54, 92,137,227,192,129, 3,135,255,127,176,232, 97,102,231, 17,252,134,143, +151,207,251,171, 87, 44, 35,220, 20, 78, 82,147,153, 54, 62,120,152, 31,184, 98,237,186, 3,133, 66,222,231, 21,185,119,190,109, +199,177, 9,119,119,247, 73,124, 62, 63, 10, 64,131, 80, 75, 55,153, 76,199,242,243,243,247,193,178,225,214,232,218,181,235, 37, +138,162, 60,218,114, 96,134, 97, 30,222,186,117,171,127,123, 50,204,213,213,117,162,171,171,235,119, 17, 17, 17,210,208,208, 80, + 8, 4, 2,172, 95,191,126, 97, 97, 97,225, 38,203,149,197, 0,158,115,165,253,107, 20,143, 55, 6, 64, 8,203, 2, 32,168, 91, +140,201,120, 92,109, 87,182, 7, 23, 46, 88, 20, 70, 92,161, 80,124, 64, 16,196,180,250,188,250, 86,165, 82,109,248, 59, 10,137, + 82,169,236, 64, 16,196, 32,150,101,253, 73,146,188,205, 48,204,111, 42,149,170,236,207,242,186, 0,111,245,137,140,252, 98,234, +194,133,148, 54, 62, 30, 95,124,247,221,102, 84, 87, 3,192,215,109, 45, 75,189,122,133, 78,176,178, 66, 20, 1,132,129, 0, 65, +130, 77, 41,175, 36, 79,220,184,145,188, 15, 22,196, 82,107, 14, 97, 97, 97,199, 1,140,170, 95, 60,145,156,156, 60,186,173, 28, + 21,217,204, 71, 34,190,127,191,138,251,231, 62, 2, 48,242,217,245,102,157,120, 42,197,239, 16, 69,177,201,121, 0, 62,251,147, +217, 42,117,114,114,186,117,228,200, 17,247, 94,189,122,241, 0, 32, 49, 49,241,181,168,168,168,193, 37, 37, 37,193, 0,170,255, + 19, 21, 77, 68, 68,132,157,217,108,142,161, 8, 34,130, 97, 24, 91, 0, 32, 73,178,146,102,217,171, 60, 30,111,106,123,131, 21, +115,224,192,129,195,255, 89,129, 37,115,238, 18,232,231,227,187, 48,238,112, 76,135,202,242, 74,221,215, 27,246, 36,107,121, 66, + 77,167, 64, 63,193,150,207, 63,181,125,119,254,162,249, 70,189,233, 90,157, 58, 51,205,210,131, 42, 20, 10, 15,145, 72,116,232, +131, 15, 62, 8,142,140,140,228, 59, 59, 59,163,184,184, 24,153,153,153,193,151, 47, 95, 30,119,228,200,145,133,122,189,254,197, +214, 34,184, 3,128, 76, 40,240,218,247,233, 39, 10,161,173, 29, 88,218, 12,219,160,110, 0, 0,150, 97,160, 58,127, 26,140,201, + 4,150,161,225, 62,226,249,199,255,179, 44,122,246,236, 41,104, 79,102,185,185,185,185,250,249,249,253,176,116,233, 82,129, 94, +175, 71, 74, 74, 10, 18, 18, 18, 24,181, 90,189,206, 82, 14,231,224,113,129,100,141,232,192,216,113, 35, 59,142, 30,234, 44,244, + 84, 56,129, 97,196,200,204, 49,122,156,190,152, 60,226, 68,220,111,239,211, 1,227, 38,150,164, 31,185,221, 18, 79, 80, 80, 80, + 68, 69, 69,197,199, 5, 5, 5, 13,194,111,125,207,158, 61,151, 63,185,205,179,193, 7, 25,134, 1,143,199, 43,214,104, 52,147, + 82, 83, 83,147,155,226,253,240, 13,152,204,230,199,229,130,199, 3, 29,243,155,251,225, 65,131, 6,117,154, 49, 99, 6,194,194, +194,144,152,152, 56, 40, 54, 54,118,222,241,227,199,111,152, 76,166, 19, 34,145,232,252,163, 71,143,218, 53,193,162, 0, 88, 60, +117,225, 66, 74,254,240, 33,228, 41, 41,120,165,186,154,247, 41,176,184, 45, 2, 43, 44, 44,204,203,193, 14, 7,198,189, 56, 32, + 64,161, 8, 20,240,249,142, 96, 89, 22, 38, 83,121,231,146,146,244, 9, 54, 54, 88, 90, 85, 69,141,191,113,227,198, 61, 75,248, +194,195,195, 93, 24,134,249,134,101, 89, 1, 65, 16,115, 0,140,138,139,139, 3, 77,211, 24, 61,122,244,168,176,176, 48, 47,150, +101,191,148,203,229,172, 86,171,125, 61, 49, 49,177,184, 37,231,170,242, 62,243,145,138,242, 30,209, 37,124, 26,138,120,167, 70, +188, 55, 12, 39,109,189,201, 53,203,191, 46,188, 10, 0, 35,188,189,173,170, 10, 36, 75,228,214,193,246, 85, 5,167,151,140,240, +246,222, 25,151,157, 93,211,222, 27,218,213,213,117, 67, 76, 76, 76,135,136,136,136,198, 32,185,161,161,161,212,250,245,235,221, + 22, 44, 88,176,185,162,162, 98,186,133,162,186,179,131,131,195, 41,134, 97,244,105,105,105,157, 27,254,119, 10,121,161,143,131, +149,236,185,146,138,154,248,178,180, 95, 46, 88,194,213,189,123,247, 25, 4, 77,239,248,252,195,119,169,128,144, 16, 72, 29,157, + 97, 44, 44, 68,157,217,100,127,245,102,234,232, 79, 55,237, 40,233,222,189,251,204,164,164,164,239,184, 42,153, 3, 7, 14,255, + 24,129, 37, 18, 9,151,174,248,215, 18,162,162,172, 82,107,172,169, 54, 74, 89,131,217, 90, 42, 38,170,213, 37,149, 15,172,165, +154, 5,243,231,138,151, 44,253,215,210, 58,224, 21, 75,197,149,191,191,255,245,157, 59,119, 58,219,219,219,163,170,170, 10,101, +101,101,184,126,253, 58, 88,150,197,200,145, 35, 69,221,186,118, 13,251,124,211,166, 4, 0,189, 91, 19, 89, 60, 62,143,224,203, +100, 56, 56, 32, 12,164, 64,128,241, 25,170,199,226,194,100, 68,220,228, 49, 0, 0, 74, 40,196, 75,119,213, 0, 0,177, 88,220, +238,204, 98, 89,182,119,223,190,125, 5, 0,176,112,225,194,234,186,186,186,104,130, 32,126, 82,169, 84, 5,150,236,239, 16, 60, +198,207,209,201,233,194,198,181,111,218, 7,123,121,195, 96, 50, 33, 95, 93, 0, 22, 66, 40,156,101,120,101, 92, 55, 65,223,112, +129,239,103, 95,255,126,158, 32,159,239,175, 78,253, 53,181, 89, 97, 41,147,197,108,222,188, 25,251,247,239, 7, 0,156, 59,119, + 14,126,126,126,178,214,210,144,153,153,233, 61,109,218,180,189, 0,124,155, 90,111, 54,131, 23,253,241, 79, 0,128,152,157, 83, +168,172,172,172, 78, 18,137,228, 9,243,109, 0, 6, 12, 24, 64, 70, 71, 71,247, 58,119,238, 92,175,189,123,247, 26, 77, 38,211, +230,194,194,194,216,246,228,169, 54, 62, 30,242,148, 20, 32, 62,190,205,251,118,235,214,205, 35, 32,192, 33,225,179,141,203,157, +142, 30, 75,197,198,141,223,225,254,253,251, 0, 0,111,111,111, 76,121,121, 34,255,167, 31,191, 9, 90,186,116,229, 21,154, 14, +139, 76, 78, 78,110, 53,186, 57,195, 48,223, 68, 71, 71, 63, 47,151,203,177,116,233,210, 44, 47, 47, 47, 88, 91, 91, 99,251,246, +237,176,179,179,131,201,100,202, 90,191,126, 61,175,176,176, 16, 91,182,108,217,245,132,187,245, 7,244, 31, 53,224, 35, 17,223, +191, 95,151,240,105,144, 91, 43,177,243,231,125,200, 76,220,211, 79,111,202,248,104, 25, 46,188, 74,177,162,105,234, 92,217,210, + 78,225, 3, 29,124,131,198,162, 99,247, 20, 71, 61, 29,159,243,225, 80,175,117, 60,177, 46,102,229,103, 77,184,132, 19, 98,169, +224,234, 27,246,119, 78,203,202,128,198,160,161, 68,253, 7, 12,139, 49, 3, 6, 12,160, 26, 4,246,195,135, 15, 97, 48, 24, 16, + 24, 24, 72, 26, 12,134, 65,150,138,171,254,253,251, 95,250,225,135, 31, 28,250,245,235, 87,242,212,253,235, 96, 59,252,194,161, +205,115, 63,254,226, 71,255,239, 89,162,178,181, 23,129,238,221,187,207,232,218,217,251,219,205,235, 87, 16, 84, 93, 62,120,182, +101, 0, 83, 6,213,222, 93,128,212, 30,163,223, 94,128, 30,189,122, 81,115,231,127,240, 45, 17, 30,206, 38, 38, 38,238,230,170, +101, 14, 28, 56,252, 35, 4, 22,195, 50, 33, 78, 78,246,226, 45, 27,246, 36, 42,197, 36,161,112,119, 37,132,214,182, 60,200,101, + 34,146,226,107,189,189,221, 5, 12,203, 52, 55, 85,200,179, 67, 45, 9,145, 72,116,104,247,238,221,206,124, 62, 31, 12,195,192, +201,201, 9, 57, 57, 57,168,168,168, 64,109,109, 45,238,167,167,163, 99, 7,119,204,157,249,166,114,205,198,207, 14, 1, 8,199, +211,205,133, 79,113,178, 12, 11,198,252,116,139, 26, 65, 16, 77,182, 47,182, 48,141,140, 69, 67, 66, 25,134,121, 80, 88, 88, 8, +169, 84,138,128,128, 0,249,141, 27, 55, 46, 22, 22, 22, 22, 88,196, 57, 97, 2, 37,120, 68,252,186, 97,237, 36,123,130,202, 66, + 86,110, 37,124,220,123,194,193,166, 3, 10, 74,106,145,148,118, 2, 89,247,143,195,199,221, 3, 51,167,248,216,110,250,166,228, + 24,194,102,250, 32,121,135,169, 41,206,154,154, 26,185,135,135, 7,220,220,220,192, 48, 12,104,154, 70,106,106,106,227,239,134, +249, 18, 27,126,111,254,233, 50,236,168, 82, 76,122, 97, 20,202,203,203,229,150,158,123,131,184, 58,240,153,107,144,182, 78, 37, + 0, 0,137, 76,105, 28,191,160, 32,181, 71,143, 30,112,114,114, 18, 92,185,114,101, 1,128,216,182,230,167, 17, 88,255,197,238, +221, 91, 94,169,170, 34, 1,224, 91,130, 96,140,143,163,106, 91, 84,150,156, 28,137,195,155, 54,125,228, 68,176,105,176,183,249, + 20,215,175, 63,130,209,248,248,202,151,149,169, 49,231,157,106,240,120, 86,248,236,179, 21, 14, 47, 77,154,117, 16,143, 71,189, + 48, 45,165,147,101, 89, 65, 70, 70, 6,130,130,130,176,119,239, 94, 30, 69, 81,184,118,237, 26, 36, 18, 9,166, 77,155,134,224, +224, 96,158, 68, 34,193,197,139, 23, 81, 93, 93, 77,180,148,206,248, 19, 23,214, 84,100,159,251,168,136, 58, 53, 98,231,207,251, +240,230,203,147,160, 48,103, 95,180,243, 33,215,140, 28,221,103, 57,197,239, 16, 37,179, 10,182,243, 11, 30, 11,129, 80,142,119, + 23,175, 70,214,157, 95,237, 52, 53,183,223,161, 77,121, 29, 86,126, 22, 59,239, 15,233, 60, 48,145,158,186, 59,190,251, 25,143, +100,207, 59, 41, 51,175,169,146,119,220,250,247,161, 3,120, 32,181,182, 13,226,234,222,189,123,184,127,255, 62, 40,138,130, 86, +171,125,106,162,224, 39, 57, 67, 67, 67,223,162,105,122, 57, 0, 24, 12,134, 61, 18,137,100,198,151, 95,126,233, 64, 81,255,158, + 41,170,193,185, 42, 86,151, 85, 92,185,145,154,185,224,173, 9, 3,227,175,222,201, 51,242,199,230, 86,221,250,165,170,169,252, +140,136,136,176, 35, 25,102,199, 23, 27, 87, 17,116,246,239, 16, 5, 12, 4, 79,238, 7,218, 84, 0, 93, 69, 45,180, 57, 69, 48, +110,255, 10,222,111,207,199,134,245, 31, 19, 47,191,250,250, 14,111,111,239, 67,217, 79, 59,120,127,199,112,109,142,147,227,228, + 56,255, 59, 57,255, 89, 2,139, 32,200,106,163,209,196,183,238,224,102, 26,255, 98,255,174,201,215,238,100,201,237,109,200,110, + 61,187, 6,222,201,202, 79,130,153, 54, 18, 4,105, 81,191, 14,119,119,247, 73, 43, 86,172,232,106,109,109, 13,134, 97, 96, 99, + 99,131,146,146, 18, 24,141, 70, 84, 87, 87, 67, 95, 91, 3, 99, 77, 53,110,230, 62, 68,228,192,129, 24,218,187,119,192, 9,147, +105, 82,126,126,254,222,230, 56,105,146, 98, 29,194,122, 98, 98,118, 25, 24,163, 1,177,222, 14,141,174,213,228,135,149, 32, 8, + 2,180, 65,143, 19, 61,125, 33,146,203, 16,242,254,138,118,103, 86, 81, 81, 81,242,153, 51,103, 78,142, 24, 49, 98,228,204,153, + 51,201,162,162,162, 56,179,217,220, 87,173, 86,183,218, 60,234,124,151,158, 54,117,102,152,183,163, 45,137,163,151, 79, 33,194, +255, 5, 72, 69,124,148, 84,104, 65, 18, 4,238, 63, 56, 3,154,150,225,102, 70, 46,122, 7,203,208,175,151,141,123,237,239,229, + 51, 75,155,111, 46, 35, 42, 42, 42,160, 86,171, 97, 50,153, 96, 54,155, 49, 97,226, 68,196,236,217,131,186,186, 58,232,116, 58, + 24, 12, 6, 48,204, 99, 61, 81, 84, 82,139,235, 55,227, 16,222,181,115,131,227,209,116,129,224,193,252,229,230, 41, 60, 43, 41, + 32, 16, 57, 25,107,106,106, 32,147,201,160,173, 83, 9,166,190,217,232,108, 9,206,157, 59,135,164,164, 36,184,186,186, 90, 84, +142,154,194,125, 96,199, 3,154,254,112,228,225,195,206,151, 15, 31,102,174, 30, 61,154, 47,170,169,217,110,201,190,189,122,133, + 78,120,247,221,209, 1, 18,177, 4,249,185,155,225,239, 47,192,194,247, 28, 16,253,105, 41, 0, 96,238,187,238, 8, 15,119, 64, +117,229, 1, 56, 58,127,128,133, 11,198,249,212,214,178,175, 37, 36,164,236,105,185,188, 19,115,126,252,241,199,172, 97,195,134, +241,146,147,147, 33, 18,137, 32,145, 72, 32, 22,139, 33,145, 72, 80, 84, 84, 4,131,193,128,216,216, 88,115,125, 19, 98,179,168, +111, 6, 28,249,222, 80,156,204, 76,220,211,207,141,204,185, 57,110, 65,159, 7,201,215,110,214,158,253,253,242, 26,179, 78,156, + 87,153,127,122,137, 87,143,155,142,239,188,191, 10, 95,109, 88,129,204,107, 23,202, 93, 60,106,190,166, 9,125,147,233, 28, 48, + 96, 37,207,221, 93, 97,154, 61, 99,188,205, 49,229,149, 55,143,241, 80, 90, 92,126,123, 35,178,175,107, 69,126, 65,175,118,246, + 34, 12,103,207,158,149,244,239,223, 31, 90,173,246,241,189, 64, 81,248,241,199, 31, 25,179,217,124,174, 41, 78,147,201,180, 60, + 41, 41, 73,169,209,104,240,242,203, 47,207, 93,185,114,165,140,207,231, 63,190,191,104,250, 41,231,106,237,166,239, 79,205, 95, +254,245,185, 83,123, 63,117, 93,187,116,198,192, 87,222,253,248, 28,128,184,166,221, 80,115,204,166, 79,151, 81, 34, 91, 35,136, + 30,195, 96, 84,107,241,232,219,153, 48, 84,105,209,121,205,106, 0, 2, 24,140, 20,142,141,155, 8,202,222, 21,111,244,239,203, +219,126,225, 82, 12,128,113, 92,213,204,129, 3,135,103, 94,126,123, 0,112,170, 95, 44,173,127,142, 57, 0,104,112,217,157, 0, + 24, 0, 8,159,216,237,217,229, 39,183,125,118,249,201,223,165,245,198,142, 19, 30, 79,217,119,157, 32,136, 54,247, 19,109, 24, + 69,248,164,225,195, 62,227,218,196,223,207,126,168, 29, 56, 32, 92,121,238,250,221,228, 17, 47, 12,237,217,127,112,175,136,226, +178,234,108,133,147,181,236,202,181,171, 34,134, 97, 44,106,223,225,243,249, 81,145,145,145,188,138,138, 10, 72,165, 82,148,148, +148,160,160,160, 0, 70,163, 17,218,170, 74,232, 43, 43,160,173, 40,135,169,166, 18,247,111, 92, 67, 23, 15, 55, 81,125, 39,120, +139,240,172, 67,213, 48,131, 61, 65,146, 16, 91, 91, 65, 98,109, 13,138,106, 91,100, 10,165, 82, 57,182, 75,151, 46, 87, 93, 93, + 93, 63,172,127,195,127, 39, 58, 58,186,148,101, 89, 44, 89,178,196,218,218,218, 58,214,211,211, 83,212, 26,143,149, 61, 61,161, + 87, 87, 95, 42,235,209,109,132,251,141, 71, 39,101,127,220, 47,168, 66, 73,149, 14, 69,229,117,232,220,249,125, 56,185,190, 9, + 27,197,219,184,157,153, 7,165,162, 19, 73,241, 5, 35, 90, 17,124, 79, 45,255,252,211, 79,208,104, 52,240,245,245,197,228,201, +147,177,120,241, 98, 76,154, 52, 9,174,174,174,232,231,203,195,140, 87, 39, 64,173, 86,183,152,206,181,223,130,191,238, 39,101, +242,212, 21,108,178,239,115, 39, 83,239,223,191,143,172,172, 63,182,172,253,254,251,239,168,170,170,106,124, 0, 91, 2,103,103, +231,101, 10,133,226,150, 66,161, 72, 85, 40, 20, 39,138, 93, 93, 51, 76,222,222, 46,125,199,141, 35, 2, 95,122,137,202,147,201, +136, 7, 29, 58,200, 45,225,178,182,198,232,240,240, 72, 97,101,197,119,141,166,212,140,233, 78,184,116, 33, 8,151, 47,118,199, +156,119,189, 65, 18, 98, 16,164, 0,154,186,223, 17, 24, 20, 44,176,178, 98, 91, 44, 75,245, 29,218,179,131,130,130,120,179,102, +205,130, 72, 36, 66, 76, 76, 12,182,109,219,134,207, 63,255, 28, 89, 89, 89,240,244,244,132, 82,169,132,139,139, 11, 15, 64,118, +253, 62, 45,194,214,135, 92,163, 55,101, 92,180,243,147,101, 19,164,115, 31,189, 89, 60,126,229,103,170,178,181, 91,115, 62,123, +144,169,245,206,184,118,161, 44,235,206, 47, 76,206,141,115,165,133,119,107,189,215,110,205,249, 44,250,235,194,242,166,184, 46, + 92, 88, 65, 31, 57,113,193, 88, 87,171,225,141, 29,249,156,246,237,233,147, 59,219, 75,187,252, 8,183, 97,161, 29, 59, 40, 95, + 93,241,201, 22,195, 27,179,230, 27,191,221,245, 29, 91, 83, 83,131,234,234,106,124,241,197, 23,230,163, 71,143, 22,208, 52, 61, +191,153, 36, 82,245,130, 8, 19, 39, 78,148, 73, 36, 18,228,229,229, 53,186,160, 0,160, 42, 41,187,125,249,198,157,140, 5,111, + 79, 28, 80,167,215,235, 79,157, 79, 76, 15,244,243,116, 39, 8,182, 99,115,231, 77, 17, 68, 68, 80, 72, 8, 88,182, 18, 36,207, + 3,249,223,111,132,182,168, 28,154,146,114,144,124, 25, 76, 16,195,200, 10, 33, 14,233,137, 71, 73, 41,112,145, 91,131, 71, 16, +125,185, 71, 9, 7, 14,255, 92, 29,213,156, 22, 1,224, 68, 16,196, 49,130, 32,142, 45, 91,182,108, 16, 0, 7,130, 32,142,213, +139, 32,167,250,223,194,134,109,154, 89,118,122,146,231,153,125,159,252,237,184,108,217,178,193, 4, 65, 28,235,211,167,207,171, +245, 66,174,205,104, 85,109, 80, 58, 67,244,178, 15, 87,144,214,114,161, 85, 96, 64, 39,187,163,191,197, 39, 95,190,154,146,110, + 37, 21,139,106,235,234,132,159,127,185,205,131,208,104, 45,237,228, 29,224,232,232, 8,163,209,136,123,247,238, 33, 63, 63, 31, + 70,163, 17,102, 77, 29,244,149,149,208, 85, 84,128,209,212, 66, 64, 51,208,150,150,192, 78, 44, 4,254, 61,194,176, 37,101,219, + 40,166,154, 18, 92, 4, 65, 64,108,109, 5,161,149, 28, 36,143,178, 56,115, 20, 10, 69,247,208,208,208,253,103,207,158,237, 21, + 25, 25,185,198,211,211,211,166,184,184,248, 81,113,113,241,115, 27, 54,108,208, 59, 57, 57,225,149, 87, 94,233, 98, 50,153,166, +182,198, 37, 16,235,187,122,186,248,193,195,101, 44, 92, 29, 34, 80, 86,173, 71, 73,165, 22, 69,101, 26,236, 59, 56, 25,167, 79, + 78, 70,202,197, 87,113,239,218, 12,148,213, 89, 67,108, 63, 8, 0,219, 98, 32,183,171, 87,175,226,155,111,190,105,252,124,245, +213, 87, 40, 47, 47, 71, 80, 80, 16,242,242,242, 16, 23, 23,135,162,162, 34, 56, 57, 57, 33, 37, 37, 5,219,183,111,199,181,107, +215,218, 92, 72,116, 58, 29,248, 66, 7, 99,204,206, 41,136,217, 57, 5, 52, 43, 51, 62,153,247, 22, 23, 54,146,156,166, 26, 55, +174,171,202,214, 54, 48, 36, 36,100,228, 75, 47,189,228,221,171, 87,175,198,245, 62, 62, 62, 30, 60, 30,175, 72,169, 84,126,171, + 84, 42, 67, 91, 36, 99,216, 48, 59,251, 0, 24,244, 25,245,215,152, 7,130, 16, 97,240,208,116,244,237,151, 4,163, 73, 8,130, + 20,129, 36,196, 48,155,203, 96,109,229, 2,150, 37, 90, 11,140, 55, 42, 46, 46, 14,223,124,243, 13,114,114,114, 26,155, 71,163, +162,162,230,188,252,242,203,135,104,154,198,177, 99,199,112,228,200, 17,120,121,121, 33, 52, 52, 20, 70,163,113, 84,107,231,189, +252,235,194,171, 63,125,126,114, 50,223,108, 27, 42, 20,121,122,145, 53,210,177,179, 7, 56,202, 0, 32, 46, 59,187,198,197,163, +102,157,166,230, 78,174,157,123,221,167,173,119,112, 39,216,196,172,212,107,123, 15,254, 86, 85, 92, 90,198, 15,235, 22,172,253, +120,213,251,130,142,157,124,215,175, 88, 50,219,165,160, 90, 92, 53,116,238,201,140, 67,113,215,107, 95,155, 49,211,252,250,204, +119,117,167,126,251,253, 48,195, 48, 33,104,102, 4, 33,195, 48, 80,169, 84,184,115,231, 14,114,114,114, 80, 90, 90,138,146,146, + 18,212,212,212, 52, 54, 43, 74,107,170,143,127,181,251,232, 77,153, 68, 34,237,213,213,207,227, 90,114,154, 90, 38,145, 72,253, + 58,121,116, 6,154,158,128,154, 97, 24,219,199,121, 72,160,230, 78, 60,116,229, 53,208, 86,214, 66, 91, 94, 11,189,145,130, 78, + 79, 66,103, 36,225,216,111, 24,106,235,180,208,149, 87,130, 97, 89, 59,238, 25,195,129, 3,135, 22,158,247, 81,235,214,173,251, +164,165,245, 79,124, 27,158, 89, 6, 65, 16,199, 88,150,141, 98, 89, 54,170, 94, 76, 53,232,132, 99, 79,242,172, 91,183,238, 19, +150,101,163,174, 92,185,242, 51, 0, 77,123,210,218,106,211, 78, 89,217,221, 90, 43, 34,224,197,249, 75,150,159,248,113,231, 22, +231,242,242,138, 44,129, 88,162, 19,139,133,246,139,151,172,178,173,211, 84,189, 88, 87, 97,249,168,167,138,138,138,198,135,151, + 64, 32, 0,173,169, 3,173,213, 64, 87, 81, 6,194,168,135,128,166, 97, 47,149,194,195,213, 5, 29, 93, 20,173,242, 81, 12, 77, + 20,158, 62,129, 83,175,190,240, 84,179, 32, 99, 52, 32,174, 79, 23, 8,229, 50, 72,108,237, 16,121,228,226, 99,161, 35, 16, 0, + 43, 62,109,149,215,197,197,197, 81,169, 84,254,250,229,151, 95, 10, 74, 75, 75,145,154,154,122,243,209,163, 71, 85,118,118,118, + 86, 38,147,137,185,123,247,238,153,204,204,204,168, 78,157, 58,129,101, 89,159,214,248,106, 42,101, 70,163,137, 65,129,250, 17, +242, 85,119, 96, 35,247, 0, 75,118, 64,113,185, 6, 4,156, 97,210,101, 54,246, 37,211,107,243, 81,167, 39, 44,202, 79,163,209, + 8,147,201, 4,147,201, 4,131,193,128,215, 94,123, 13, 87, 18, 18,240,211,145,243,200,203,203,131,151, 66,138,201,147, 38,162, + 91,183,110, 72, 76, 76,108,119,161,246, 27,114, 42, 85, 34,145, 96,219,182,109,144, 74,165,104,171,192, 82, 40, 20,159,249,251, +251,251,102,214,213, 33, 45, 35, 3, 61, 39, 78, 4, 0, 92,186,116,169,113, 27,173, 86,139, 41, 83,166, 8,115,114,114, 94,207, +200,200,120,157,101,217,207,139,138,138, 22, 54,199,121,252,120, 2,222,126, 59, 13, 37, 37,143,157,221,125, 63, 7, 54,174,123, +144, 99,196,136,209,143, 91,174,108,109,109,241,217,103,150, 5, 29,166,105, 26,219,183,111,135, 68, 34,105, 20, 88, 2,129,160, +239,130, 5, 11, 94,108,106,251,192,192,192, 86, 57,223,155,224, 38,190,116,147,125,199,198,183, 83,176,141, 83, 8, 74,205, 41, + 93,147, 11,138,230,188, 55,193,109,243,166, 3, 5, 58,154,208,239,161, 77,121, 29,120, 98, 93,140, 37,105,204,142,251,210, 80, +222,105,102, 76,145,186,234, 95,239,206,124,197,193,214,206,165,246,219, 47,163,109, 73,146,196,209, 36, 67, 69,144,183,131,221, +216,136, 47,106,223,126,239,163,100,131,249,209, 28,228, 29,203, 68, 11, 97, 79, 24,134, 65, 65, 65, 1, 74, 75, 75,145,155,155, +139,146,146, 18, 16, 4,129,146,146,146, 54, 57,148, 77, 57,202,134,252, 2, 20, 29,222, 5,197,148, 87,208,121,245,106, 48, 12, + 31, 90,141, 25, 7,250, 61,135,234, 42, 45, 12, 12, 1,219,238,125, 48,244,216, 69,144,140, 25, 72,184,194, 61, 65, 56,112,224, +208, 82,189,114,108,233,210,165, 31, 88,184,237, 25,150,101, 45, 10,173,243,172,224, 90,186,116,233, 7, 13,199,138,142,142,214, + 2, 40,252,203, 5, 22, 0,212,148,166,103,167,165,241, 84,181, 26,173,216,206,222, 78, 99, 37, 23,178, 85,149, 85, 84,198,189, + 44, 93, 93,209,253,204, 54, 28, 47, 61, 53, 53, 53,184,160,160, 0,185,143, 30,193,164,169, 3, 97,208, 3, 58, 45,134,244,235, + 11, 49, 0, 49, 1, 8, 24, 35, 40, 74,136,218,218,106, 0, 72,111,141,148, 49,153,158,170,212, 27,155, 5,173,172, 32,148,203, + 32,178,182,122,202,209,178, 4, 18,137,228,167,237,219,183, 43,149, 74, 37, 54,109,218, 4,165, 82,233,175, 80, 40, 52, 86, 86, + 86, 18, 71, 71, 71,116,238,220, 25,225,225,225, 56,119,238, 28, 8,130,184,223, 26,159,217, 32, 76, 74,207,166, 59, 84,215,166, +224, 90,210, 15, 48, 25, 12,232,228,183, 12,122,179, 35,100,206,175, 67,107,252, 21,198,202,243, 0, 0,161,245, 64, 20, 23,151, + 2, 32,238,180,230,220, 61,187,124,235,214, 45,236, 57,124, 9, 30, 1, 3, 81, 84, 30,135, 59,119, 18,225, 98,247, 27,252, 2, +131, 96, 50,153,218,242,150, 96,177, 32,177,176,160, 79, 89,182,108, 25,170, 36, 18, 96,244,104, 8,178,179, 97, 52, 26, 17, 17, + 17,129, 30, 61,122, 0, 0, 34, 34, 34, 64, 81, 20,124,125,125, 97,111,111,143, 67,135, 14, 77, 1,208,164,192, 98, 9, 34,133, +161,203,252,189,189,189, 27, 5, 86,204,247, 37, 72, 78, 28, 2, 2, 66,108,249,234,223,151,196,195,195, 3, 69, 69, 57, 32, 8, +182,181, 78,153, 39, 70,143, 30, 61,202,206,206, 14,211,167, 79,135, 68, 34,193, 11, 47,188, 0,173, 86,251, 82,253, 27, 13,150, + 45, 91, 6, 0, 88,177, 98, 5, 86,174, 92, 9,141, 70,211,108,136,138,109,107,187,186,214,104,153, 25,164, 70,242,194, 32,199, + 78, 33,131,135, 15,129,151,223,115, 24, 60, 60, 15, 0, 62,113,228, 63,152,248,233, 7,182,135,237,172,137,221, 87,142,156, 89, + 30, 57,114,208,135, 43,141,231,215,172,252,178,162,213, 23,150,202, 7, 59,106, 50,248, 99, 54,111,249,198,188,105,197, 7, 11, + 68,143, 74,141,229,133, 21, 76,173, 76,196,179,242,113,129,124,206,226, 53, 57,133,133,247, 22, 33,239,183, 44, 75,174, 97, 78, + 78, 14,244,122, 61,104,154,134, 94,175, 71,109,109, 45,242,243,243, 27,175,175, 86,102, 61,226,221,233, 99,186,213,105,181,154, +107,183,239,230,126, 56,247,149,222,117, 90,173,230,238,131,220, 44, 96, 11,211,204, 53,175,212,212,212,218, 27,106, 76,168,188, +153, 5,199,193,158, 48,152, 9,232,205, 20,202, 75,107, 96,164, 1, 19,201,135,251,132,215, 96, 38,120,168, 46, 41, 2,217,142, +126, 14, 28, 56,112,248,103, 57, 88, 4, 65, 28,139,142,142,142,250,187,184, 1, 32, 58, 58, 58, 53, 58, 58,250, 79, 29,171, 65, + 96, 13,124,226, 13,119, 96, 83,117,165,135,109,149,219, 39, 31,188,232,106, 50, 25,252,107,107,107,105, 30, 79,200,235, 96,163, + 45, 42,207,181,252, 96, 38,147,233,216,197,139, 23,199,245,235,215, 79,116,247,246, 77,232,171,170,160,175,170,132,128, 49,195, + 94, 28, 14,210,100, 0, 97,208,195,173, 11, 3,109,181, 24, 9, 55, 50, 77, 38,147,233, 88,139, 25, 2,150,101,204,143,133, 3, + 73, 82, 79, 53, 21,138,172,228, 16,202,229, 16,201,173,154,108, 66,108, 14,206,206,206,210,254,253,251, 63, 23, 22, 22, 6,150, +101,177, 97,195, 6, 24, 12, 6, 97,131, 83,100, 52, 26, 81, 83, 83,131,131, 7, 15,226,251,239,191,191,108, 99, 99,179,187,176, +176,101,113,203,152,245, 39,207, 93,190, 57,234,213, 23, 6, 11, 79,159,255, 22, 38,189, 25,181,122, 91,212,233, 12,168,209,242, + 97, 16, 13, 7, 65, 92, 4, 73,137,208, 39,212, 7,103, 47,221,213,209, 38, 99, 92, 91,196, 16, 65, 16,208,235,245, 80,171, 75, + 80, 94,115, 14,168, 41,128,163,177, 6,181, 15,238, 35,244,181,169, 48, 24, 12,173,114,125,248, 6, 76, 78,182, 42,222,247,171, + 73,240,133, 14, 70,191, 33,167,154, 13, 21, 33,151,203, 27,251,232, 88,130,234,234,106,252,240,195, 15,136,136,136,192,128, 1, + 3, 80, 80, 80,128,236,236,108,140, 26,245,239, 86,182,155, 55,111, 34, 57, 57, 25, 62, 62, 62,173,112,177, 39,202,203,239, 77, + 28, 59,118,172,224,234,213,171, 96, 89, 22,126,126, 54,176,182,146,131, 32, 69, 8, 8,112, 2,144, 9,130, 32, 48,112,224, 64, + 24,141,133,230,186, 58,156,104,137, 51, 57, 57,121,116, 88, 88,152,151,201,100,202, 10, 14, 14,230, 21, 21, 21, 97,194,132, 9, +216,183,111, 95,195, 27, 13,150, 46, 93,250,212, 62,181,181,181,186,230,248,186,245,236,188,136,102, 29, 6, 8, 69,158, 94, 54, + 78, 33,240,242,123, 14, 0, 48, 52,106, 6,188,124, 59,160,170,228,150,151, 65,255,232, 5,138, 40,179,251,241,106, 65, 90, 63, +105,240,244,210,188,243,119, 1, 88, 18,184,151,213,222, 61, 90,156,203,183,222,127,224,151, 99,111,141, 25,243, 60,207, 68, 51, +230, 96, 15,158,205,190, 67,199,213, 5,143,114,191, 64,238,111,169, 79,221, 42,205, 11, 44,186,178,178, 18,114,185, 28,217,217, +217,250, 49, 99,198,136,180, 90, 45,238,222,189,219, 40,176,156, 29,237, 3,251,246, 8,246, 95,187,233,251, 83, 50,145, 72, 52, +124, 96,120, 64,218,221, 71,249, 44, 75, 60,108,150,151,101,175,222, 77, 79, 31,237,228,232, 1,213,249, 43,144, 69,142,132, 94, + 79, 64,103,100, 96,160, 1, 51, 37,128, 77,183,158,144,120, 7,128, 97,129,244,219, 55, 97,102,217,203,220, 35,132, 3,135,127, + 44, 90,211, 34, 32, 8,226, 88,239,222,189,247, 62,233, 50, 53,252, 6,160, 7,208, 82,159,232,146, 39, 69, 84, 67,179, 97,115, +199,121,134,183,221, 2,235, 2, 90, 24, 89,230,232,232,232, 28,208, 37,200,123,231,174,111, 97,212, 87, 33, 59,109, 55,234,106, +138,241,209, 39, 9, 62,110,110,110, 3, 10, 10, 10, 46, 88,114,176,252,252,252,125,135, 14, 29, 90,216, 45, 40, 40,172,163,187, + 59,110, 61,124, 0, 1, 75, 67, 64,211, 32,141,122,240,104, 3,220, 3, 25,144,164, 12, 69, 69, 53,216, 30,247,251,157,250,168, +238,205,191,125, 19, 20, 58,140, 25,143,151,135,142, 6,107, 50,226,183,126,129, 16,203,229, 16,217,218,162,207,193,243,143, 67, + 54,152, 77,120,184,238,125, 8,100,114,216, 71, 12,108, 53,157,106,181, 90,115,249,242,229,196,140,140,140, 30, 93,186,116,193, +170, 85,171,144,151,151, 7,150,101,161,182,100, 14,165, 0, 0, 32, 0, 73, 68, 65, 84, 86,171,117, 37, 37, 37, 5,101,101,101, + 15, 9,130, 56, 92, 88, 88,184, 19, 22, 68, 10, 87,251, 81,123, 78,159,249,125, 81,247,208,192,206, 67, 6,172,196,177, 99,203, + 81, 89, 93,141, 58, 61, 15,181, 90, 35,234,116, 44, 92,173,124,208, 43, 36, 12, 37,101, 6,220, 77, 77,202, 47, 21,216,239,104, +163,117,138,155, 55,111,194,211,158, 64, 90, 86, 50, 28,117,229,232, 98, 43, 71, 88,100, 63,228,228,228, 88,228, 76,153,205,224, +205,153,255,239,209,130,182,182,182,168,170,170,122,106, 63,169, 84, 10, 87, 87, 87, 84, 87, 87,227,192,129, 3, 96, 45,123, 40, +154, 12, 6, 3,252,253,253,113,227,198, 13,156, 57,115, 6,131, 7, 15, 70,255,254,253,113,254,252,121, 36, 38, 38, 34, 57, 57, + 25, 4, 65,192,193,193,161,193,109,107,214,114,187,126,253,102,172, 92, 78, 44,155, 62,125, 86,240, 43,175,188,130,131, 7,247, + 98,198,244, 46, 32, 72, 17, 8, 66,132,231,199,248, 99,245,154, 68,244,234, 53, 16,142,142, 2,156, 57,147,154,195,227,217,124, +111,129, 88,253,114,253,250,245, 60,177, 88, 12,131,193,128,218,218, 90,148,149, 61, 14, 71,213,148,131,165,213,106,155, 13,172, +150,154,146,249, 89, 69, 53, 91, 65,106,146, 94, 40, 53,165,132, 12, 30,158,143,161, 81,211,113,250,216,110,156, 61,117, 6,142, +252, 7, 57,180,164,246,100, 73, 78,105, 77, 97,173,223,246,192,240, 55, 40, 85,221,169,111,102, 63,159, 69,185, 43,153,216,101, +219,170, 43, 91, 75,111,121,218, 15,191,254,202,226,249,200,136,158, 62, 93, 61, 92,133,229,101,106, 28,250,229,100,170,241,193, +193, 99,245, 21,149, 37, 86,228,234, 45, 91,182, 44, 7, 0,134, 97,246,108,218,180,233,141, 69,139, 22, 57, 21, 20, 20, 52, 10, + 44,117,105,249,217, 62,163,231,208,101,149, 85,134,239, 54, 45,158, 32, 17,139,132, 31,174,251,238,188,137,194,213,102, 43, 23, + 30,111,234, 7, 91,127, 44, 57, 16,187,155,114, 18, 11,112,105,201, 10,100,255,126, 14, 70, 66,128,225,191, 93,131,193, 72,163, + 90, 93,134,179,211,103,195, 78,105,143, 19,101,119,233,170,154,234,169,220, 51,134, 3,135,127, 44, 90,210, 34, 37, 79, 8,162, +114, 0, 15,163,163,163, 75,159,112,151, 74, 0,220, 4,208,173,126,187,146,103,246, 43, 33, 8,226, 6,203,178, 61,158,224, 41, +121, 66,104, 61,249,219,240,204, 54, 55,255,140,192,106, 17,165,165,165,234,235,137,119,112,249,244, 54,152, 77,122, 84,213,219, + 86,133,197, 58, 88, 91, 91, 39, 52, 68, 19,111, 2,193,120, 58, 86, 6,171,211,233, 94,220,180,121,243,213,183,166,190,170,232, +255,220,115,120,116,251, 22,244,229,165,160,104, 26, 20,193, 71,109,169, 24,197, 69,213,136,254,245,164, 90,171,211,189,216,196, + 3,226, 89,206,198, 78,238, 44, 65, 64,108, 99, 13,145, 76, 6,145,141,245,191, 29, 43,130,128, 80,110, 5,190, 76, 14, 74, 32, +180, 36,157,208,104, 52,227,103,206,156,121,235,196,137, 19,118, 47,191,252, 50,158,127,254,249,228,202,202,202, 65, 21, 21, 21, +150,246, 55,123,154,243,192, 1,218, 28, 60,102,236,215,219,118, 94,153, 54,109,154,253,243, 99,191, 70,114, 90, 42, 42,235,156, + 1, 0,174,142, 50,244,234,242, 62,212,101,122,156, 58,121,172,130, 49,235,198, 35,117,159,169, 57, 78,150,101, 89, 71, 71,199, +167, 92, 57,138,162,112,254,252,121,204,155, 55, 15,142, 86,231, 81,243, 48, 27, 93,251, 13,192,208, 87,166, 98,198,140, 25,160, + 40, 10, 14, 14, 14,207,186, 25,127, 56,247, 39, 81, 85, 85,133,142, 29, 59,226,183,157, 93,130, 12, 58,181, 32,204, 30, 32, 96, + 99, 60,125,118, 84,106,124,124,124, 45,128,157,126,126,126,177,207,140,104,252, 3, 39, 65, 16,255,250,228,147, 79,182,245,237, +219, 87, 34,151,203,225,231,231,135,203,151, 47,227,242,229,203,184,120,241,113,255, 56, 7, 7, 7,216,219,219,163,178,178, 18, +121,121,121, 90,130, 32,254,213, 2, 39, 83, 93, 77,141, 59,125,250,240,181, 49, 99, 94,116, 28, 49,162, 55, 20,138, 26,152,205, +165, 32, 72, 1, 68, 98,103,236,220,185, 14,234,226,114, 92, 73, 72, 40,175,173,229,141, 79, 74,250,195, 20, 68, 77,165,211, 24, + 23, 23, 7,177, 88,140,131, 7, 15,154, 93, 92, 92,120,182,182,182,205, 58, 88, 58,157, 78,212, 28,231,155, 75,238, 20, 0, 88, +243,222, 4,183,141, 87, 82,139,199, 1,248,201,203,215, 29,103, 79,157,193,197,179, 87,150, 70, 4, 51, 91, 70, 79,233,185, 90, + 60,248,165,247, 3,187,191, 65,201,173,149,136, 57,116,144, 74, 75,250,246, 99, 93,221, 29,111,108, 59,244,126, 43,215,136, 5, +128, 90,117,241,178,232,207,191,218, 19,189,106,185,100,195, 23, 91, 11,181,165, 69, 31,212,139,126,182, 5,247,170,145, 51, 39, + 39,103, 59,128,237, 79, 56,205, 63,172, 91,183, 46,254,213, 87, 95,117,106,112, 40, 75,210,126, 77, 40, 1, 18,130, 6,206,248, +168, 79,143,160, 46, 31,127,241,227,169,220,188,226, 31,171,210, 27, 99, 96,253, 33,157, 87,175, 94,173,232,222,189,251,204,247, +151,172,252,118,213,234, 21,132,255,252,165,200,186,124, 3,122,173, 17, 70,150,130, 9, 4,146,214,126, 14, 43, 39,107, 92, 98, +203, 89, 61, 69,190,153,253,199, 78,254, 45,150,207,118,130,227,228, 56, 57,206,255, 78,206,150, 12,132, 27, 77,252,221,212, 76, + 26, 55, 90,218,175, 25,158,191, 5, 22, 9, 44, 55, 55,183,254, 67,159,139, 64,223,161,179, 96,212, 87, 34, 59,245, 59,212,214, + 20,195, 77, 33, 66,118,110,117,239,122,213,105, 17,234, 35,179, 71,124,188,121,203,161,225, 61,123, 4,248,185, 41, 69,182, 29, + 61, 33,115,118, 65,105, 73, 9,174, 37,101,153,182,158, 58,123, 71,171,211, 89, 52, 85, 14,195, 48, 44,203,178, 16, 8, 4, 96, + 41, 10,129,115,150,128, 36,201,103, 70, 11, 18,176, 14,143, 4,201,227,195,100, 97,159, 33,149, 74,149, 79, 16,196,248, 57,115, +230,252,190,103,207, 30,114,224,192,129,161,191,254,250, 43,243,103, 50,187,236,206,209,187, 84,240,184, 1, 91,190,220,122, 32, + 44, 60,194,179, 99,167,142,162,190, 29,108, 96, 52,209, 40, 86,151,225,194,149, 52,253,221,180,155,121,140,209, 48,177, 36,189, +249, 40,238,245, 15,193, 92, 87, 87, 87,151,149, 43, 87,194,108, 54,131,166,105,152,205,102,148,150,150, 34, 57, 57, 25,221, 35, +122,195,255,245, 55, 80, 94, 94,142, 93,187,118,193,221,221, 29,163, 70,141, 66, 77, 77, 13,226,227,227,115,155,119, 29, 96, 94, +246,175, 41, 60, 0,224,243, 97,254, 32, 42,234,124, 80, 80, 80,228,243,221,212,130, 89,115, 30, 59, 91,159,174,155, 34, 56,127, +254,124,172, 72, 36,218,254,224,193,131,234, 22, 4, 54,188,189,189,133, 58,157, 46,148,101, 89, 94,117,117,245,102,189, 94, 63, +109,193,130, 5,202,245,235,215, 35, 36, 36, 4,165,165,165,176,183,183,135, 82,169, 68,109,109, 45,114,114,114,104,163,209,248, + 13, 77,211,171,213,106,117, 73, 75,121,144,152,152,248,128,166, 67,123, 23, 23,109, 59, 52,235,237, 97,126, 38, 83,184,208,218, +166, 31, 88,214,140,202,138, 60, 16,236, 45,227,225, 35,191,223,175,172,164, 94, 76, 74, 74,186,107,201, 53, 34, 73,242,237,163, + 71,143,162, 97,170,156,194,194,194,108,146, 36,155,117,176, 44,193,166, 3, 5, 58, 0, 63, 79, 24,174,156, 95, 85,114,171,179, + 35,255, 65, 78, 68, 48,179,101,211,129, 2,157,179,173,102,109, 65,201,249,172,194,218, 83,219, 99, 14, 29,164,166,190, 48,158, + 86,202,239, 46,117,236, 0, 75, 34,227,179, 33, 33, 33, 30, 36, 89,222, 73, 93,150,153, 56,227,205,183, 94,178, 17,104, 79,132, +184,149,250,154, 93, 2,197,105,105,105, 15,219,224, 98, 61, 89,246,179, 0,244,255,236,179,207, 78, 61,107,141,171, 75,203,207, +246,142,122,151,173,172,172, 74, 41, 73,255,245,118,107, 92, 13,211,223,188,246,234,140, 29,111,190, 62,147, 10,158,187, 24,249, +231,126, 7,204, 38,168, 46, 94,128,212,138,198,177,210,135,180,134, 34,103, 38, 37, 37,113, 81,220, 57,112,224,240, 63, 3,139, +123,125,123,123,185,157,242,238,228, 54,204,187,147, 43, 0, 32,251, 65, 33,178, 31, 20,252,150,157, 83, 48,188,157, 10,183,113, +178,103,162, 62, 20, 3,107,217,100,207, 79,113, 6, 5, 5, 37,147, 36,233,218,150,147,166,105, 58, 63, 45, 45, 45,220,146,116, + 42,149,202,151, 59,116,232,176,174,176,176,240, 80,126,126,254,123,127,137,186,175,159,236,153,164, 4, 81, 44,203,134, 0, 32, + 8,146,180,100,178,231, 70, 78, 87, 87,215,174, 18,137,100, 59,143,199,243,104,184,142, 13,205,120, 70,163,145,170,170,170, 18, + 27, 12, 6, 10, 0, 33, 16, 8,204,114,185, 92,199,231,243,205, 52, 77,231,154, 76,166,183, 10, 11, 11,111, 91,250, 22, 18, 16, + 16, 32,139, 10, 79,175,109,152, 66,103,217,191,166, 96,221,158, 22,203, 78, 35,231,221,187,119, 59,219,217,217, 77, 34, 8, 98, + 2,203,178, 93,106,106,106,244,203,151, 47, 79,185,112,225, 66,181,135,135,199,136,126,253,250, 17,183,110,221,194,195,135, 15, +217,218,218,218, 3, 36, 73,254,171,160,160, 32,187,141,101,137,236,211, 39,116,178,149, 28,163, 25, 22,221, 0,150, 32, 8,226, +118,109, 45,113, 66,169,236,244,227,129, 3, 7,232,246,190,129,133,133,133, 29,175,173,173, 29,117,247,238,221,230,222,170,158, +189,143,154,229,220,240, 65,240,191,122, 15,136, 28,127,249,194,197,195, 75, 62, 73, 93,243,228,186,119,198,217,205,152,242,206, +188,245, 63,125,253,197,226,175,143, 84,124,103, 73, 58,195,194,194,188, 0, 76,102, 89, 54,136, 32, 8, 63,134,129,152, 32,216, +114,130, 32,210, 24,134,185,201, 48,204,209,219,183,111, 23,254, 55,188,209, 62, 57,217, 51, 65,211,182, 52, 65, 88, 58,217, 51, +231, 16,112,156, 28, 39,231, 96,253,159,132,197, 17,184,179,115, 10,134,103,231, 20,192,215,215,151,189,119,239, 94,155,196, 89, +115,111,223,245, 17,218,247,254, 25,146,212,212,212,176,191, 51,131, 84, 42,213,207, 42,149,234,231,191,148,244,194, 5,179, 26, +248, 14,143, 63,237, 66,189, 64,234,101,201,182, 26,141, 6,149,149,149,237, 78,110,122,122,122,221,184,136,127, 59, 91, 60, 30, +204,150,238, 59,108,216,176, 71, 70,163,241, 12,128,124, 0,182, 0,202, 77, 38, 83, 92,105,105,105, 49, 77,211,225,143, 30, 61, +250,168,222,137, 92, 83, 92, 92,220,222, 56, 18,204,149, 43, 41, 63, 1,248,233,143,171,146,255,212,165, 74, 78, 78, 30,173, 84, + 42,147, 29, 28, 28,124,116, 58,157, 80,167,211,241, 89,150,109, 44,251, 18,137,164,164, 33, 98,122,107,176,177, 70, 12, 69,148, + 57,216, 89, 19,127,112,106, 28,221,112, 80, 91,119,167,179,163, 27, 14,182, 33,109, 57,221,186,117,251,129, 36,201, 78, 12,195, +184, 0,176,102, 89,148,178, 44, 91, 74,211,116,254,157, 59,119, 10,255, 91, 42,154,122, 1, 21, 5, 14, 28, 56,112,224,240,151, + 41, 92,142,147,227,228, 56, 57, 78,142,147,227,228, 56, 57,206,127, 20, 72, 46, 11, 56,112,224,192,129, 3, 7, 14, 28,254, 90, + 16, 45,168,208,182,180,173,182, 71,201,222,225, 56, 57, 78,142,147,227,228, 56, 57, 78,142,243, 31,199,217, 26, 55,215,183,235, +111, 18, 94, 28, 39,199,201,113,114,156, 28, 39,199,201,113,254,243, 56,255,167,192, 53, 17,114,224,192,129, 3, 7, 14, 28, 56, +252,197,104,118, 20,161,151,151,123, 32, 73, 51,125, 89,150,164, 88,146, 53, 17,213,218,125,217,207, 4,217,236,208,161,131, 45, +159,196, 24,130,101,101, 4,193,208, 12, 69, 94,206,201,201, 79,179,228,192, 1, 1, 1, 2, 0,211,248,124,126,164,209,104, 84, +242,249,124,149, 78,167,187,196,231,243,247,164,167,167, 27,255,155, 50,169,111,223,190,147, 15, 28, 56, 96, 27, 21, 21,165, 55, + 26,141,102,129, 64,192,219,187,119,175,104,250,244,233,149,151, 47, 95,110,215, 40,200,208,208,208, 65,159,126,250,169,215,115, +207, 61,135,200,200,200,186,145, 35, 71, 10,194,195,195, 5, 75,150, 44,201, 73, 73, 73, 57,215, 22, 46,103,103,231, 64, 30,143, +247, 61, 65, 16, 20,203,178,175, 61, 17,130,225,239,192,203, 0, 38, 2, 80, 2, 40, 2,176, 31, 64,123, 71, 89,142, 0, 48, 6, + 64, 72,253,242, 45, 0, 71, 1,196,253,137,244,141, 0, 48,134, 32,136,110, 0,192,178,236,205,191,144, 51,164,158,243, 47, 75, +231,159, 61,247,176,176,176,229, 66,161,240, 77, 0, 48, 24, 12,223,201,229,242,232,166,182,187,112,225,130, 1,205,132, 62, 9, +232, 4, 54,237,168, 63, 0, 32,112, 76, 6, 0,160,181,229,244, 7,237, 27, 69,204,166,249,179, 77,241, 18,129, 25,237, 30,149, +172, 84, 42,103,143, 26, 53,106, 73, 92, 92,220,199, 5, 5, 5, 59,192,129, 3, 7, 14,255,173, 2,203,203,203, 61,112,194,184, + 23, 63,121,251,173, 89, 4, 69,145, 72,207,200,224,189, 51,247,189, 97,254, 46, 46,110, 50,157, 46,128, 5, 24,173, 68,114, 71, +171,213, 20,108,251,250, 75,171, 46,157, 59,211, 52,205,224,155,237,219, 70, 30, 56,114,232,131,214, 68,150,147,147,147, 23,159, +207,223, 60,119,238, 92,231, 97,195,134,145, 46, 46, 46,200,207,207,183, 62,124,248,176,239,174, 93,187,162,156,156,156,230,151, +148,148,228,180,231,132, 20, 10, 69, 63,165, 29, 70, 72, 68,236, 32, 84, 19,208,154,137,115, 42, 3, 27, 87, 84, 84,116,177,189, +153,100, 48, 24,230,104, 52,154,136,192,192, 64,102,219,182,109,196,204,153, 51, 89,130, 32, 72,173, 86,187, 27,237, 12, 51, 33, +145, 72,190,126,238,185,231,252, 34, 35, 35,179, 47, 95,190, 60, 26,192,241,137, 19, 39,122, 75, 36,146,187, 0,186,180,133,139, +162,168,221,105,105,105,221,180, 90, 45,194,195,195,119, 1,232,254, 55,149,151, 93,118,118,118,166,173, 91,183,110, 15, 13, 13, +245,169,168,168,168,123,235,173,183,134,220,190,125,123, 48,128,215,219,192, 35, 3,176, 69, 42,149, 82,243,231,207, 63,249,194, + 11, 47,220,148,201,100,242,204,204, 76,254,188,121,243, 94,203,205,205,157, 0, 96, 46,128,186,182,114, 58, 56, 56, 72,214,174, + 93,155,212,167, 79, 31,181, 88, 44,150,228,228,228, 16,243,231,207,159,153,153,153,249,103, 56, 5,171, 87,175,190, 60,112,224, +192,108,145, 72, 36,205,205,205,165, 22, 45, 90, 52, 35, 41, 41,169,221,156,182,182,182,194,229,203,151, 39, 12, 24, 48,224,161, + 88, 44,150,101,103,103,147, 11, 22, 44,120,227,222,189,123, 22,115,246,239,223,127,178, 86,171, 93, 21, 31, 31, 15, 0,232,221, +187,247,114,131,193,240,225, 31, 68, 13,203, 34, 50, 50, 82, 71,146,228,155,241,241,241, 77,150,215, 61,137,239, 79, 6,128, 69, + 31, 53, 44, 63,254,110,106,121, 90,248,134,189, 68, 96, 70,155, 10, 78, 64,167,199,226,110,219,197,119, 95, 5,128,119, 22, 61, +254,127,219,197,134,245,179,217,182,136, 54, 87, 87,215,183,122,246,236,185,236,218,181,107, 49,225,225,225,243,118,236,216,193, +143,138,138, 90,203, 48,140,207,136, 17, 35, 38, 36, 36, 36,108,200,204,204,252,154,171,226, 57,112,224,240, 95, 37,176, 72,154, +233,251,246, 91,179,136, 73, 47, 79, 46, 82, 21,171, 25,185,149,205,203,251, 99, 99,165,157, 59,119, 38,117, 91,182,192, 92, 90, + 10,122,225,194, 62, 23, 46, 92, 48,189, 59,127,161, 86,175,211,236, 86,186, 56, 75,247,253,188, 87,113,232,224,129,190, 0,210, + 90,114,174,248,124,254,230,131, 7, 15, 42,188,188,188, 96, 48, 24, 80, 82, 82, 2,163,209,136, 23, 94,120,129,138,136,136, 80, +204,152, 49, 99,179,163,163,227,139,109,113,178, 28, 29, 29, 93,186,120,240, 79, 76,153, 56,188,243,160,254,225, 18,133, 91, 39, + 32,159, 65, 65,246,221, 30,191, 95, 77,154, 27,123,250,124, 86,102,149,113, 84,105,105,105,113, 91, 51,169,172,172,108,201, 91, +111,189,117, 32, 36, 36,196, 73, 36, 18,193,197,197,133,120,227,141, 55,138, 85, 42,213,234,246,102,124, 67,116,112,146, 36,233, +103,190,219, 67,231,110, 99, 99, 3,107,107,107, 0,112,251, 51, 5, 98,194,132, 9, 84,110,110,238,155, 12,195, 4, 60,249,191, + 74,165,242, 54,155,205,165, 15, 30, 60,236,166, 51, 24,123,205, 94,180,106,237,164, 49,131,172, 19, 18, 18,200,209,163, 71,243, +207,159, 63,255,114, 27,156,172, 45, 93,186,116,185,189,126,253,122, 67,250,221,156,224,223,206, 39,144,206,246, 50,198,171, 99, + 71,121,106,106,170, 32, 58, 58,186, 36, 58, 58,122, 11,128, 25,109, 72,250,150,161, 67,135,230, 45, 91,182,140, 74,207,186,239, +125, 49, 33, 5,214,114, 33,237,225,238, 42, 78, 72, 72,224,109,219,182, 13, 31,124,240, 65,155, 57, 7, 13, 26,116,119,205,154, + 53,108,145,186,220, 55,231,129, 10, 86,114,161,217,193,193, 65,114,254,252,121, 98,207,158, 61,134,121,243,230,109, 97, 24,166, + 77,156,125,250,244,185,191, 98,197, 10, 34,227, 94,142,239,165,132, 20,200,101, 2,115, 71, 15,119,241,245,235,215,137, 47,191, +252,210,180,124,249,114,139,210,201,178,236, 55, 27, 54,108,192, 47,191,252, 2, 0,248,249,231,159,225,237,237,253, 84, 1,210, +234,116, 32, 8, 2, 15, 31, 60,144,190,253,246,219,223, 52,245, 66,144,118,212, 31,123, 18,129,105,211,166, 21, 89,116, 6,233, + 27,218,236, 90, 53, 8,171, 89,179,102,229, 55,179,217,171, 95,111,180, 92,100,245,237,219,119,201,190,125,251, 28, 99, 99, 99, + 23, 29, 62,124, 24, 0, 32,149, 74,165, 95,125,245,213,236,177, 99,199,226,245,215, 95, 95,194, 9, 44, 14, 28, 56,252,215, 9, + 44,150, 37, 41,138, 34,161, 46, 46, 53, 13, 29, 50,108,198, 87, 91,183,138,132, 66, 33, 12, 6, 3,234,206,158, 5,171,215,195, + 70, 34,193,168, 81,163,248,193,193,193,214, 51,103,204,120, 67, 93, 92,180,157,162, 72, 5,203,146, 84, 43,199,156, 54,119,238, + 92,103, 47, 47,175,167, 38, 16,166,105, 26,197,197,197,176,178,178,194, 75, 47,189,228,248,195, 15, 63, 76, 3, 96,145,221,239, +236,236,220,209,175,147,227,149,216,111, 23, 41,156,109, 9,160,228, 32,240,232, 46,240,147, 24,126,206,158,240, 27,220, 95, 50, +166, 87,112,183,201,235,247,164,144, 36,217, 71,173, 86, 63,108, 75, 38, 61,124,248,240,146,193, 96,120, 83,167,211, 29, 1, 64, + 94,190,124,153,205,205,205,125,187,184,184,248, 81,123, 51,158,166,105, 84, 86, 86,130, 97, 24, 10, 64,227, 55,109,225, 84, 62, +127, 7, 38, 76,152, 64,229,229,229,189, 21, 16, 16,224,187,115,231, 78,168,213,106,136,197, 98, 48, 12,131,222,189,123,123, 12, + 25, 50,228,126, 73,121,149,157,217, 76, 27,243, 31, 61, 8, 95,183, 33,165,164, 91, 96,151, 75,177,177,177,161,142,142,142, 47, + 89, 40,176, 70, 88, 89, 89,241, 62,254,248, 99,173,194,221,123,146,210,195,143,127,229,198,237, 44,129, 84,200,150, 85,213,212, +164,164,164,100,173, 90,181,170,255,137, 19, 39,212,119,238,220, 25, 1,203,154,204, 70, 56, 56, 56, 72,150, 46, 93, 74,216, 56, +184, 14,141,236,239,193, 79,186,149,118, 95, 40, 21, 50,145,145,145, 99,174, 92,185,178,107,193,130, 5,161,199,143, 31,175, 78, + 72, 72,176,152,211,222,222,158,191,122,245,106,218,197,213,115,172, 71, 39, 95,190,155,194, 49, 16, 0, 50,179,238,125, 91, 92, + 92,124,255,237,183,223,238,117,242,228,201,154,184,184, 56,139, 57,109,108,108, 4,203,151, 47,103, 3,130, 67,103, 4,133,116, + 39,143,254, 22,159, 32,145, 9,233,234, 58,109,109, 90, 90,218,253,197,139, 23,247, 60,126,252,120,205,141, 27, 55, 90,229,212, +104, 52, 86,238,238,238, 80, 40, 20, 96,180, 90, 84, 87, 87,227,208,161, 67,168,169,169, 1, 77,211,144, 72, 36,248, 34,174, 28, +186,123, 71,177,125,243,106,104,181, 90,171,191,162,156, 52, 52,239,181, 69, 92,181, 32,172,240,132,240,122,117, 86,191,175,216, +150,154, 11, 27,156,171, 75,151, 46,229,199,198,198, 58,251,248,248, 96,224,192,199, 19,184,207,152, 49, 3, 67,134, 12,193, 47, +191,252,130,223,126,251, 45,119,220,184,113, 57, 73, 73, 73, 27,242,243,243,191,225,170,122, 14, 28, 56,252,255, 70,147,118, 9, + 75, 16,117,169,233,233,124,185,173,237,171, 95,109,221, 42,226,243,249,120,248,240, 33,210,210,210,160, 57,123, 22,218, 43, 87, +160, 86,171, 81, 83, 83, 3, 39, 39, 39, 68,111,216, 32, 19, 72,100, 51,238,222,187, 71,177, 36,251,228, 4,197,127, 24,106, 41, + 20, 10, 35, 71,141, 26, 69, 62, 41,174,158, 68, 81, 81, 17,134, 13, 27,198,227,241,120,145,205,164,249, 89, 78,194,213,137, 56, +186,127,199,124,133, 51,239, 54,112,111, 30, 80,121, 17, 48, 87, 2,218, 90,224,193,109,224,240,103,112, 47,191, 71,252, 52,119, +162,139,155, 68,112, 20,127,140, 66,223,226,144, 80, 55, 55, 55,111, 31, 31,159,157,227,199,143, 39, 1, 32, 50, 50,146,240,241, +241,217,238,230,230,230,221,194,110, 45,114,234,116,186,171, 21, 21, 21,196,232,209,163, 29,250,244,233,115,122,244,232,209, 14, + 0, 8,157, 78,119,181,189,156,245,112, 24, 52,104, 80,153,151,151,215,207,158,158,158, 34, 11,182,111,228,204,205,205,125,211, +223,223,223,119,231,206,157, 20, 69, 81,216,177, 99, 7,246,239,223,143,248,248,120,148,148,148, 72, 23, 44, 88, 96,251,235,217, +228, 51,167, 47,222, 60, 54,127,214, 91,204,208,238,161, 74, 81,105, 81,153,131,131,195, 72, 0, 10, 11,211, 57,102,206,156, 57, + 39,146,211, 30, 40, 8, 74, 36, 18, 8, 4, 98,133,139,163,179,210,217,165,163,210,217,165,179,149, 84,106, 87, 87, 87,151,123, +228,200, 17, 22,143,251, 40, 89,196,185,106,213,170,235,105,119,115,157, 89, 82, 32, 20, 8,248, 2, 71, 59, 91,251, 9,207, 15, + 27, 3, 0, 82,145, 72, 90, 87, 87,167,250,225,135, 31,218,196,185, 98,197,138,139, 5,197,149, 10, 30, 95, 32, 18,139, 68,141, +179,132,219,219,217,184,201,101, 50,169,193, 96,200,219,185,115,167,185, 45,156, 31,126,248,225,229,244,123,185, 46, 36, 73, 81, + 36, 73,240,156, 28,236, 28, 29, 28, 28,148, 14,118,246,110, 18,161, 80, 86, 91, 91,155,255,243,207, 63,211,150,114, 22, 23, 23, + 35, 35, 35, 3, 29,122,244,192,153, 51,103,208,161, 67, 7, 76,156, 56, 17,147, 38, 77,130, 68, 34, 65, 79,219,251,120, 97, 68, + 31,220,191,127,191,217,235,110,137, 96,114,117,117,189,208,150,178, 4, 60,110, 22,108, 73, 92, 61,203,217,204,118,119,158,117, +174, 14, 29, 58,228,184,105,211,166,208,247,222,123, 47,251,208,161, 67, 8, 9, 9, 65,122,122, 58,220,220,220,176,119,239, 94, +188,251,238,187,217, 43, 87,174, 12,221,191,127,191, 75,112,112,240,210,118,222, 71,109, 5,199,201,113,114,156, 28, 90, 23, 88, + 38, 6, 71,231,204, 91,160,137,137,137,145, 10,133, 66, 60,122,244, 8, 69, 69, 69, 56,124,240, 32, 61,165,107,215,154,215, 66, + 67,171, 15, 31, 60,200, 26,141, 70,176, 44, 11, 95, 95, 95,140, 26, 53, 74,242,198,204, 89,106,162, 90,187,175,197, 55, 90,150, +117,118,114,114,106,156, 52,247, 41,107,107,218, 52,152,205,102, 88, 89, 89,129, 32, 8,103, 75, 78, 64,169, 84, 78,156,177,232, +185, 14,214,158,214,197,108,209,238,114,128, 4,120, 86, 0,207, 26,144, 90, 3, 18, 43, 64, 36,131, 62,241, 74, 57, 75, 68, 62, + 28, 30,246,146,155, 82,169,156,216,150, 76,114,116,116,252, 48, 54, 54,214,233,246,237,219,108, 77, 77, 13,212,106, 53,187,120, +241, 98, 39, 71, 71,199, 15,219,155,241,133,133,133,107,103,204,152, 81, 52,126,252,120,219,152,152, 24,143,241,227,199,219,206, +152, 49,163,168,176,176,112,237,159,185,160,124, 62,159, 58,123,246,172,253,162, 69,139, 38,155, 76,166,196,193,131, 7,151,133, +134,134, 38,186,184,184,120,182,182, 47,195, 48, 1, 13,226, 10, 0, 40,138,130, 80, 40,132, 88, 44,134,141,141, 77,101, 78, 78, +142,185,163,131,128, 71,215, 85,104, 60,109,132,226,200,110,129,174,206,238, 30, 47,214,213,213, 37, 1, 80, 89,152,196,144, 17, + 35, 70,240,140, 16, 97,246,235, 67, 58,191, 61, 53,210,119,251,198,215, 7,109,249,248,181,222,159,175,122,117,192,218,101, 83, + 38, 19,140,217,228,233,233,233,221,208, 81,189, 53, 16, 4,209,173, 95,191,126, 18, 51, 37, 34,175,165,220,205,206,188,151,167, + 30, 51, 60, 50,162,241,128, 97, 97,147, 28, 28, 28, 70,121,121,121, 13, 36, 8, 98,184,165,233, 28, 56,112,160,136, 47,145,145, + 30,174,142, 93,236,109,229, 62, 13, 43,156,156,156,134,187, 40, 20,175, 19, 44, 93,167, 84, 42,221, 69, 34, 81, 55, 75, 57, 7, + 15, 30, 44, 50, 83, 34, 82,225,100,235,236,236, 96,235, 48,110, 68,255,200,193,145, 61,250,244,233,221,115,104, 88,143, 30,211, + 64,155, 52,158,158,158,110,150,158,251,145, 35, 71,240,229,151, 95,162,111, 96, 32, 60, 61, 61,225,228,228,132,179,103,207,226, +236,217,179,144,201,100,168,172,172,196, 55,223,124,131,184,184,184, 63, 93, 89, 52, 8,162,134,142,233,127, 5,158, 21, 89,173, +137,189, 75,151, 46, 29,138,141,141,133,143,143, 15,166, 79,159,238,189,123,247,238,236,236,236,108,200,229,114,220,188,121, 19, +239,191,255,126,246,202,149, 43,189,167, 77,155,134, 61,123,246,224,230,205,155, 49, 92, 53,207,129, 3,135,255, 4, 26,154, 8, +217,122, 87,135, 5, 64,228,229,229, 85,250,251,251,187,249,248,248,144, 6,131, 1, 85, 85, 85, 56,117,242, 36,189,119,255,254, +227, 6,131, 97, 46, 73,146,130, 61,223,127,255,141,179,139,203,160, 9, 19, 39, 18, 38,147, 9,207, 61,247,156,240,236,217,179, + 14,183,243,242,106, 90, 58, 32, 69, 81,141,238,209,236,217,179,177,121,243,102, 0,192,212,169, 83,255, 45,240, 76,166,134, 73, +116, 91,133,212,134,142, 26, 48, 36,200, 42, 79,246,165,149,174, 79,117,141, 87,150,219, 21,121,141,172, 39,120, 98, 30,164,114, + 48,102,152,239,214, 70, 36,101, 63,234, 20, 32, 62,161,238,212,183, 75, 79,236, 79, 56, 28,133,199,163,223, 44,130, 68, 34,233, + 41,147,201,144,158,158, 94, 30, 30, 30, 94,105,109,109,109,227,231,231,231, 40,145, 72,122,182, 55,227,213,106,245, 3, 30,143, + 55,224,197, 23, 95,124,135, 36,201, 33, 12,195,156, 41, 43, 43,251, 90,173, 86, 63,176,240,193, 52,139,101,217, 21, 0, 14, 52, +252,103, 52, 26, 65,146, 36, 88,150,197,152, 49, 99,176,110,221,186,192, 51,103,206, 32, 62, 62,222,126,202,148, 41, 87,149, 74, +101, 37, 65, 16,175, 23, 22, 22, 54,235,146,149,149,149, 97,219,182,109,160, 40, 10,182,182,182,176,178,178,130, 88, 44,198,192, +129, 3,139,215,175, 95,239, 23, 27, 27,107, 42,243, 85,179,194,218,170, 58, 7,137,159, 43,233,232,228,245,206,204,183,174, 1, +136,181,244,220,229,114,185,149, 21,165,173,165, 88, 29,181,105,203,118,158,148, 71, 66,198, 23, 64, 76,214, 18,203,150,175, 97, +197, 4, 37, 69, 27,230,201, 4, 0,129, 64, 32,181, 17,194, 32,144,242,105,185, 84, 72,252, 21, 55,135, 68, 34,145,201, 5, 48, + 52,183, 94, 72,242,132, 0,196, 4, 65,104, 44,229, 20,139,197,114,107, 33,171,111,110,189, 21, 95, 32, 32, 8, 66,140,102, 58, +185, 79,120, 14,108,236,230,199, 2,167,251,191,111, 25,208, 52,141, 30, 61,122, 96,255, 47,103,112,234, 98, 42,202,243,211,240, +234,196,145,232,216,177, 35, 24,134,105, 49, 77, 13,125,176, 44,120, 41,128,171,171,235,133,194,211, 54,173,110,107,105,211,224, +147,156,129, 99, 50, 90, 28,157,232,230,230, 54, 51, 36, 36,100,234,225,195,135, 49,104,208, 32, 68, 69, 69,161, 75,151, 46,222, + 83,166, 76, 1, 0,244,239,223, 31,209,209,209,222,147, 39, 79,198,145, 35, 71,112,226,196, 9,132,135,135,207, 75, 76, 76, 84, +171, 84,170,173, 92,117,207,129,195,127, 61,158,210, 34,255, 43, 2,235, 15, 16, 25,141, 93,116,219,182, 65,115,230, 12,132,167, + 79,227,120,183,110,181,102,179,121,161, 74,165,202, 3, 0,103,103,231,249,177, 7, 14, 92, 30,118,238,156,181, 33, 61, 29, 29, +238,220, 1,175,115,231, 80, 75, 15, 28, 29, 29,221, 40, 10, 0, 32, 38, 38, 6,213,213,213,168,170,170,130,217,108,241, 92,194, +224,243,137,190,206,142, 30, 80,225, 46, 24, 30,207,234, 65,160,161,143, 76,107, 93,208,225,129, 99,109, 21,191, 27,145,165,238, +102,165,171, 49,245, 34, 5, 6, 24, 42,117,112,117,112, 3,143,228,245,109, 75, 38, 53, 56, 58, 18,137,164, 60, 41, 41,233,249, +126,253,250,253, 10,192,177,225,255, 63,225, 98,221, 43, 44, 44,156,215, 46,235,145, 36, 87,156, 63,127,222, 57, 54, 54,246,221, +175,190,250,138, 5, 0,131,193,208,216, 73,222, 96, 48,128,199,227,129, 97, 24,200,100, 50,240,120, 60,151,195,135, 15,187,140, + 29, 59,246,107, 0,205, 94, 39,169, 84, 10, 23, 23, 23,240,249,124,216,216,216,160,174,186, 66,182,237,147, 15, 7, 74,237, 92, +236,231,205, 91, 72, 78,155, 54, 45,245,171,175,190,114,119,245,241, 13,202,200,200,200,125,121,250,140,203,123,247,238,173,133, +229, 29,220,111,101,103,103, 11,131, 2,124,197,199, 15,212, 50, 82, 30, 11,105,233,199,144, 74,148, 16, 10,221, 33, 21,137, 32, + 16, 10, 29, 85, 69, 69,197, 44,203,222,183,232,142,100,217,155, 57, 57, 57, 84, 39, 15,133,176, 70, 99,174,145, 82,180,213,189, +228, 91, 89,190, 97, 33,157, 1, 64,151,126,235,188,168,147,143, 80, 85, 81, 37,114,117,117, 77,107, 67, 58, 5, 46, 46, 46,194, +212,244,123, 59, 29,237,173, 61, 92, 92,156,135, 2,128, 73,171, 73, 37, 12,186, 66,138,199, 83,150, 87, 84,148,232,116,186,123, +150,114,102,101,101,241,124, 58,186,139, 14, 29, 59,253,157,179,181,188,131,163, 68,228, 98, 45, 19,200,133, 52, 93, 39,100,232, + 66,129, 72,164, 40, 44, 42, 42,101, 89, 54,171, 57,146,134, 14,227,192,174, 31,234,207,191,193,221,193,149,108, 22,118, 78,174, + 40,203,203,196,217,163, 71, 48,117,246,187, 22,221, 79, 27,215, 76,223,187,113,205,244,102,195, 51, 60, 35,136,254,124,205,147, + 30,112,225, 89, 78,149,170,229, 10,117,196,136, 17,255,218,177, 99,135,180,145, 34, 61, 29,145,145,143,123, 18,172, 90,181, 10, +195,135, 15,135,159,159, 31,210,210,210,224,233,233,137, 67,135, 14,129,162, 40,254,204,153, 51,151,236,220,185,147, 19, 88, 28, + 56,112,248,255,138,102,135,172, 49, 44,203,208, 21, 21, 96, 13,134, 6,135,128,101, 89, 86,250,111, 97,195,151,218,218,218, 18, +124, 55, 55, 16, 98,241,227, 63, 9,226, 79,247,208,230,241,120,109, 18, 88, 52, 13, 10,132, 9, 44, 88, 0, 36, 8,144,208, 72, +132, 88,233, 18, 69, 44, 83, 46,161, 74,164,118, 4, 65,145, 32, 72, 2, 32, 0,214,196,128,102,233,182, 42, 35,182,182,182, 22, +122,189,222,206,199,199,231,184, 78,167,179,171,127,176,177,255,169, 11, 71,211,116, 54, 73,146,120,237,181,215,208,160,244, 13, + 6, 3,178,178,178,160,211,233, 96, 48, 24,144,150,150,134,234,234,106, 24, 12, 6, 36, 38, 38,194,211,211, 19, 60, 30, 79,217, + 18,175,217,108,134,147,147, 19,148, 74, 37,244,117,213,178,131, 59, 54,143, 94,191,106,153,227,203, 62, 44,185,107,203,103, 76, +231,206,157, 43,131,130,130, 28, 37, 18, 73, 69, 72, 72, 72,217,222,189,123, 15,163,109, 33, 26,142, 46, 91,182,172,215,192,129, + 3,253,108,173, 36, 38,153, 24,144, 82,117, 16,178, 90,240,205,197,240,243,242,101, 8,169,180,203,228,201,147,245,120, 28, 23, +202, 34,206, 5, 11, 22,248, 4, 7, 7, 43,237,172, 69,117, 18, 1, 81, 36,166,104, 85,101,218,173,171, 0, 32,178,181,215, 66, + 36, 9,158, 58,117,170,182, 45,156,139, 23, 47, 14,232,212,169,147, 66,192, 99, 53, 4,109, 46,108, 92,163,215, 21, 83,124,129, + 6, 2, 65,216,188,121,243,140,109,225, 92,180,104,145,127,183,110,221, 92,156,108,196,117, 18, 62, 10, 37, 20, 93,200, 55,232, +243, 4,102, 67,177,216,206, 78, 3,137, 52,244,213, 87, 95, 53, 52,199,217,224, 94, 61,235, 12,241,120, 60, 20, 22, 22,162,252, +193, 21,148, 63,184,141,206,100, 13,122,185, 56, 65, 46,151,183,122, 63, 17,129, 25, 68,250, 3, 16,233, 15, 64, 16,129, 25, 68, + 83,203,207,138, 44,165, 82,217, 98,217,111,177,169, 47, 61,224, 66,123, 56, 79,156, 56,241,233,216,177, 99, 77,147, 38, 77,194, +233,211,167, 65, 16, 4, 46, 93,186,132,130,130, 2, 12, 31, 62, 28, 44,203, 34, 37, 37, 5, 70,163, 17,233,233,233,152, 48, 97, + 2,162,162,162, 52,113,113,113, 31,115, 85, 61, 7, 14, 28,254, 83, 2,107, 96,189, 37, 55,176, 97,133, 73, 36, 74,101,230,204, +129,205, 47,191,128,127,247, 46, 38,188,248,162,181, 72, 36,218,162, 80, 40,186, 43,149,202,190, 18,137,228,235, 5, 11, 22, 88, + 57, 68, 71,195, 53, 62, 30,170,211,167, 97,226,243,111,180,229,224, 90,173,182,193,141,129,161, 94,200,217,218,218,130, 97, 24, + 88,170, 93, 88, 26, 9,170,146,187, 16,162, 35, 88,160,230,100,205,224,132,151,179, 87,187,156,169,233,220,249,110, 53,223,103, +189,115, 47,199,157,157,250,220,208, 18,252, 90,129,181, 16,133,133,133, 96,193, 36,180, 37,157, 58,157,174,170,174,174,142,240, +241,241,113, 76, 74, 74,242,241,245,245,117, 0, 64,232,245,250,235,127, 38,243,149, 74,101,239,208,208,208,253, 97, 97, 97, 57, +161,161,161,251,149, 74,101,239, 54,236,190, 43, 57, 57, 25, 20, 69, 97,230,204,153,168,169,169,129,193, 96, 64, 94, 94, 30,114, +115,115, 97, 48, 24,144,154,154,138,140,140, 12, 24, 12, 6,164,164,164, 64,175,215, 91, 34,220, 96,101,101,133,202, 50,181,108, +223,182,207, 70,127,188,234, 35, 73,213,189, 36,228, 23, 22,131,161,181,133, 31,125,244, 81,182,143,143,207, 37,131,193,224, 79, +211,244, 40, 0,251,218, 88,222, 82,186,116,233, 50,112,227,198,141,125, 87,127,250,189,208, 70, 94, 13,145,173, 61,132,118, 82, + 8, 61,195, 49,245,253,207,121,219,183,111,189,117,233,210,165, 18, 88, 54, 50,143, 4,144,210,163, 71,143,190, 69, 69, 69, 3, +194,194,194,194,221, 58,117,146,201, 20,202, 10,145,194,181,148,209,235,174, 66,225,214, 63, 38, 38,230,250,185,115,231, 84,109, +225,244,244,244,236,191,117,235,214, 94, 29, 59,118,236, 37,181,182,150,235,106,106,126, 48,107, 52,177,148, 92, 46,132, 68, 54, + 44, 46, 46,238,210,222,189,123,139,218,194, 25, 16, 16,208, 47, 58, 58,186, 71,247,238,221,123,185,123,123,203, 37,206,138, 50, +153,171,187, 90,226, 23, 40,128,194,125, 72, 76, 76,204,149,243,231,207, 91,154, 78,144, 36, 9, 30,143, 7,185, 92,142, 11, 23, + 46, 32,170, 95, 23, 40,201,114,132,116, 84, 98,228,244,215,241,219,111,191,129,207,231,227,207,186,173, 77,184,175,173, 10,162, +182,138,175,214, 56, 85, 42,213,214,196,196,196, 47, 94,122,233, 37, 12, 25, 50, 4, 55,111,222,196,226,197,139,179,207,159, 63, + 15, 0,184,121,243, 38,214,174, 93,155,157,144,144,128,233,211,167, 35, 50, 50, 18, 41, 41, 41, 49, 92,240, 81, 14, 28,254,207, +224, 15, 90,228,255, 50, 26,154, 8, 47, 60,249,237,109,103,103,165,211,105,242, 47, 92,184, 96, 28, 53,106,148, 64, 34,145, 96, +226,164, 73,100, 7, 15,143,126, 23, 98, 98,206,202,164, 82, 98,210,178,101,242,224,224,224,198, 74,254,215, 95,127,213, 86, 85, + 85,150,117,232,208,193, 54, 47, 47,175,210,146,131,151,150,150, 66,161, 80,128,162, 40,212,213,213,129,162, 40,200,229,114,104, + 52, 26,139,251, 96,213, 85,147,167, 47, 93, 72, 29, 50,104,226,236,154, 97,217, 70,153,153,117,232,109, 69,178,160, 97,130, 78, +195,194,204,176,188,107,172,109,143,179,126, 81, 21,107,125, 75, 51,243,207,108,117,210,178,134,211,109,201,164,138,138,138, 15, +103,207,158,189, 47, 40, 40,200,209,202,202, 10, 46, 46, 46,228,155,111,190, 89,146,151,151,183,166,189, 25, 31, 16, 16, 48,217, +223,223,127, 75,108,108,172,125, 78, 78, 14, 0,116, 90,182,108,217,160,140,140,140,185,233,233,233,150, 4, 47,221,191,113,227, +198, 45,131, 7, 15,150, 69, 68, 68, 52, 10, 44,163,209,216,248,253,236,239,134,230,216,150,192, 48, 12,196, 98, 49, 98,191,221, + 60,236,227, 85, 31, 73,202,210, 19,112,235,210,105,196, 61,208,107, 54,124,183,231,170,184,193,173,108,235,249, 58, 73,187, 90, +217, 90,237, 31, 52,116,132,235,184,169,179,201, 85,171, 86,177,191,159,138,101,191,251,106, 14,188,253,191, 0, 65,144,200,200, +188,137, 89,147,250,179,169,183, 83,123, 0,112,111, 43,231,167,159,126, 90,151,145,145, 81,181,127,255,126,113,135, 14, 29,124, + 72,146, 20, 21, 21, 23,151, 77,158, 60,249,230,229,203,151,203, 25,134,153,211,174,116,224, 23, 88,155, 0, 0, 32, 0, 73, 68, + 65, 84,254,254,123, 93, 76, 76,140,212,201,201,201,159, 36, 73, 81, 85, 85, 85,233,236,217,179,147, 99, 99, 99,107, 24,134,153, +219, 30,206,200,200,200,218,125,251,246, 73, 61, 60, 60,186,144, 36, 41, 42, 44, 42, 42,157, 52,105, 82, 74, 66, 66, 66, 53, 30, + 7, 26,109, 18, 19,231,103, 96,224, 11,143,127, 75, 36,146,178,128,128, 0,135, 81,163, 70,129,166,105,228,228,228,224,246,237, +219, 24, 49,229, 21,216,219,219,227,220,157, 59, 80,169, 84,248,224,131, 15,160,213,106,113,239,222, 61,213, 95, 89,121,212, 55, +237,177, 42,149,234, 15, 55,107,218, 81,255,198, 32,162, 79,137, 43, 47,226, 66, 75,253,172, 90,226, 4,128, 97,195,134, 77, 31, + 59,118, 44,126,249,229, 23, 44, 94,188, 56,123,229,202,149,222,147, 38, 77, 66, 90, 90, 26, 66, 67, 67,177,112,225, 66,239,141, + 27, 55,102,179, 44,235,221,167, 79, 31,184,187,187, 63,175, 82,169,222,231,158, 91, 28, 56,252,159,192,133,103,190,255, 39, 4, + 22,240, 68,135, 50,214, 90, 50,105,199,214,175,109,222,157,191,176, 46, 48, 48,208,206,197,197, 5, 36, 73, 98,196,200,145, 68, +239, 83,167,172,248, 74, 37, 28,186,118, 5,203,178, 96, 24, 6, 23,227,227,113,246,236,217,186, 31,190,219,229, 54,227,141, 55, +198, 0,104,118,228, 78, 67,179, 26, 65, 16, 40, 41, 41,105, 20, 88, 98,177, 24,133,133,133, 80, 40, 20, 16, 8, 4,160, 40,138, + 7,128, 2,208, 98,179,163, 66,161,248, 62,122,109,218,210,188,144, 69, 94,145, 82,146, 56, 89, 87, 4, 18, 4,204, 44, 3, 82, +203,130, 97, 88,232, 77, 64,144, 27,101,119, 70, 15,219,235,169,167,115, 20, 10,197,247, 42,149,229,207,154,156,156,156,115, 90, +173,246,237,186,186,186, 3, 0,200,171, 87,175, 50, 15, 30, 60,120,199,210, 14,233, 77, 65, 34,145,188, 31, 27, 27,107,191,102, +205,154,138,179,103,207, 86, 13, 30, 60,216, 38, 58, 58,218, 97,242,228,201,239,195,130,232,240, 42,149, 74, 11, 32,166,184,184, +248,157, 30, 61,122,160,188,188, 28, 6,131, 1,201,201,201,240,245,245, 69, 98, 98, 34,186,116,233,130,235,215,175,195,223,223, + 31, 52, 77, 67,167,211,129,182, 32,208, 86, 97,222, 35,185, 84, 95, 97, 93,120,237, 4, 50,111, 37,226, 68,182, 94,179,225,187, +125, 39,186,134,134,215, 89, 42,124,159, 68,103,103,105,144,139,163,195,169,207, 55,174,179, 42,184,118, 18,251,183,127,206,254, +126,236, 88,119,145, 53, 94,235, 61,244,221,137, 38, 35, 58, 48, 44, 4,145,145,125, 48,166,123, 42,193,215,163,226,108, 82,203, +145,204,155,226, 60,240,253,207, 97, 58, 32,200,203,203,107, 12, 69, 81, 78, 0,140, 52, 77,167,193,194, 41,104,154, 75,167, 14, + 8, 82, 42,149, 99,196, 98,177, 27, 65, 16, 90,173, 86,123,247,175,224,244,246,246, 30, 67, 81,148, 43, 0, 13, 77,211, 89,104, +227, 84, 57, 67,134, 12,217,176,107,215,174, 5,122,189,222,225, 9,183,149, 56,121,242, 36, 12, 6, 3,132, 66, 33, 43,147,201, +144,151,151,199, 2, 80,177, 44,251,246, 95, 85,113,140, 31, 63, 30, 87,175, 94, 93, 5, 96, 69, 75,219,149,151,151,243,236,237, +237,205, 79, 10,175,230,162,192, 91,194,121,237,218,181, 79,223,124,243,205,247,227,226,226,242, 87,174, 92, 25, 58,109,218, 52, + 28, 57,114, 4, 30, 30, 30,200,204,204,196,130, 5, 11, 64, 16,132,247,198,141, 27, 83,246,238,221,171, 44, 42, 42,250,140,123, +102,113,224,240,127, 10,196,255,202,137, 52,217, 7,139, 96, 8,190,159,175, 47,109,208,212,238,126, 99,250,116, 77,106,106, 42, +104,154,134,217,108,134,238,250,117,212,157, 58, 5,179,217, 12,150,101,113,237,234, 85,204,157, 51,167, 86,167,169,253,182, 83, +167,142, 44,193,178,178, 39,168,254, 48,219,182,161,161, 45, 16,143,155, 8,181, 90, 45,248,124, 62,228,114, 57, 74, 74, 74, 32, + 20, 10, 33,145, 72,208,173, 91, 55,210,221,221, 61,170,137,228, 61,197,153,156,156,108, 66,181,126,194, 47, 83,231, 21,185,107, +204,236, 76,219, 78,232,192,151, 60,238,111, 5,192,201,138,196,144, 64, 30,236,121,165,236,237, 61, 47,171, 8,115,213,132,228, +228,100, 83, 75,156,207, 66,169, 84,118, 14, 10, 10,250,186, 33, 14, 86,191,126,253,200,224,224,224, 47,149, 74,101,231, 22,118, +107,145, 83, 44, 22,139, 0,224,244,233,211,229,241,241,241, 35, 79,159, 62, 93, 14,128,109,248,223, 18, 78,146, 36,119,108,223, +190, 29, 82,169, 20,102,179, 25, 6,131, 1,122,189, 30, 6,131,225, 15, 31, 71, 71, 71,156, 57,115, 6, 12,195, 28,111, 45,157, + 1,193, 33,181, 85, 60,219,226, 61,191,254,142,147, 15,141,181,237, 16, 87,141,156,129, 10, 89, 23, 55,167,199, 2,163, 44, 61, + 1,247,110, 39,226,196,241,163, 41, 58,160,160,178, 26,159, 84, 86, 35,164, 78, 7,187,158, 1, 40, 61,117, 96, 41,177,240, 21, + 16, 32,154,156, 51,207, 34,206,122,129, 50,139,166,233,158, 52, 77,247, 4, 48,171, 5,209,210, 38, 78,157, 78,215, 75,171,213, +254,165,156,109, 77,103, 67, 31, 44, 0,248,232,163,143,174,199,199,199,191,116,253,250,245,193, 13,159, 59,119,238, 12,202,201, +201, 25, 84, 80, 80, 48, 40,231,168,136,186,115,231, 14, 47, 49, 49,145,159,152,152,232,145,148,148, 20,103,105,249,108, 14, 79, +118,112, 87,169, 84, 43,159,113,154, 26, 57,137,192, 12,226,235,141,179,127,136,141,141, 85,252, 85,156, 0,144,153,153,249,245, +174, 93,187, 60,187,117,235,230,222, 16,138,225,219,111,191, 5,240, 56,146,253,231,159,127,142,222,189,123,195,221,221,221, 57, + 41, 41,201,171,176,176,112,123, 91,239,205,118,130,227,228, 56, 57, 78, 14, 22, 8, 44,130,161,105,154,129,179,139,179, 85,137, + 90,253,213,236,217,179,202, 86,175, 94,173,251,127,237, 93,121, 92, 84,213,251,126,238,157,125,103, 21, 24, 65, 81, 65, 4,113, + 65, 92, 48,181, 12,197,157,178, 92, 75,203,221,220,181,197,204,212,159,184,164,169,165,102,230,146, 90,238, 75,102,101,185,100, +148, 95,200, 21, 17,220, 80,217, 20, 20, 24,246, 29,134, 89,238,242,251, 3,102, 26, 8, 97, 6, 53,177,238,243,249,220,207,157, + 59,119,230,153,115,206,189,115,206,115,223,247, 61,239,137,136,136,128,254,206, 29, 84,196,196, 32, 60, 60, 28,115,231,206, 45, +127,103,218, 52, 77, 69,121,233, 70, 55, 87, 23,103,154,102, 64, 16, 76,157, 22, 18,146, 36,147, 19, 18, 18, 0, 0, 58,157, 14, + 95,126,249,165,209, 96, 48, 64,165, 82,129,101, 89,236,216,177,131, 1,128,190,125,251,202, 5, 2,129, 85, 75,144,100,100,100, + 92, 47,126,152,209,255,251, 55,166, 39,223, 62,244,115,113,135, 60, 61, 70, 73,212,120,173, 3,139, 86,146, 84, 60,184,248, 77, +209,197,109,195,146,203, 11, 30, 14,200,200,200,184,110,107, 35,185,185,185,253,223,129, 3, 7, 92,174, 94,189,202,234,116, 58, +164,167,167,179,243,231,207,119,113,115,115,251,191,199, 81,233,133,133,133, 32, 73,146,169,106, 23,198, 86,245,158,158,158,126, +243,232,209,163, 63,157, 61,123, 22, 30, 30, 30,160,105,218, 44,176, 44,247,124, 62, 31, 4, 65, 96,219,182,109,133, 4, 65, 44, +172,143, 87, 36, 18, 97,251,145,147,167, 62,216,122,236,200,145,240,168, 99, 13,181, 92, 1,128, 76,169, 90,241,249,186, 79,237, + 76,174,198, 3, 87, 51,138, 9,154,173,221, 85,103, 72,175,188, 71,106, 23, 88, 13,227,124, 26,229,124,134,156,207, 18,149, 51, +253, 52, 68,211,166, 77,241,253,247,223,219, 28,131,229,223,138,248, 91,112,123, 67, 57,111,222,188,249,233,168, 81,163,178,194, +194,194,182, 84, 84, 84,148, 85, 61,188, 25, 62,255,252,243,207,102,205,154,149,149,158,158,206, 89,174, 56,112,224,240, 76, 81, +107,154, 6,134, 71,158,223,182,125,235,160,195, 7, 15,185,241,120,164,219,189,123,247,175,188, 61,105, 82,122,100,100,164,163, +160,117,235,110, 36, 73, 50,250,143, 62,186, 88, 90, 92,148,191,247,219,111, 60, 91,182,108, 17, 80,181,216, 51,203,240,200,243, +117,253, 96,126,126,254,238,121,243,230,117,219,179,103,143,112,221,186,117,101,233,233,233,103, 46, 95,190, 60,104,203,150, 45, +146, 29, 59,118,148, 23, 21, 21, 29, 63,121,242,228,208,224,224, 96, 74,175,215, 91,157, 95, 40, 59, 59, 59, 14,217,217,126,228, +250, 29, 99,226,183,239,235,207,242,200, 30,168, 16,130, 96,233, 11, 36, 85,122, 38, 59, 35,227, 0, 0,170, 33,141, 36,145, 72, + 2,164, 82, 41, 18, 19, 19, 11,186,117,235,166, 23,137, 68,130, 22, 45, 90, 56, 73, 36,146,128,134, 54, 60,203,178,108, 65, 65, + 1, 88,150,229, 3, 32,104,154,230, 3, 0, 83, 95,210,162, 26, 16, 10,133,111, 76,156, 56,241,167, 45, 91,182,244,239,219,183, + 47,188,188,188, 96, 52, 26,225,235,235, 11,189, 94, 15, 31, 31, 31, 84, 84, 84,224,139, 47,190, 64,105,105,233,123, 25, 25, 25, + 5,117,241, 49, 12, 3,177, 88, 12,145, 72, 4,223,182,237,203, 37, 18, 9, 26, 42,174, 0, 64, 46, 66,171,135,151, 78, 32,241, +198, 85, 28,142,209, 20,150, 25,152,129,241, 57,229,183,106,126,174, 92,143,178,224,129,211, 43,133,183, 17,165, 79,130,243,105, +148,243, 89,115, 90,198, 96, 89,243,217, 39,133, 71,197, 68,213,133,219,247, 65, 76,127,113, 51,139,219,155,107,205,113,213, 16, + 78, 19,210,210,210,182,153,150,192, 33, 73, 50,105,206,156, 57,243,211,211,211, 55,104, 52,154, 45, 26,141,102, 41,215,181,115, +224,192,161, 81, 10,172,123,247,210,226,142,254,120,236,227, 99,223, 31,237,201,178, 36,143, 37,136, 50,128,252, 57, 46, 46,174, + 90,240,186,151,131,131,114,226,148,137,163, 9,134, 16, 16, 4, 67, 51, 60,242,252,189,123,105,113,245, 88,155,110,244,233,211, +103,115,112,112,240, 36,154,166,215, 38, 38, 38,158, 33, 73, 50,118,224,192,129, 31, 80, 20,245, 89,114,114,242, 25, 95, 95,223, +223, 14, 31, 62,252, 33, 77,211,182, 90,136,168,140,140,140, 61,168, 35, 6,172,129, 88, 14,192, 78, 44, 22, 23, 93,189,122,245, + 80,207,158, 61,223, 32, 8,194, 14, 64, 81, 67, 9,117, 58,221,156,146,146, 18,231,209,163, 71, 27, 1,248,190,254,250,235, 11, + 19, 18, 18, 4,101,101,101,201,182,240,164,166,166,234, 60, 61, 61,135,206,152, 49, 99,167, 80, 40,236,139,191,146,180,153,132, + 28, 88,150, 5, 77,211,199,171,218,230,145, 16, 8, 4,165, 67,134, 12, 81, 88, 97,225, 42,181,182,124,153,185, 37,115, 86,238, + 62,185, 90,103,100, 24,138, 97,167,197,103,151,215, 58,234, 95,137, 67,187, 39,205,105, 11,158, 23, 78, 0,152,254,226,230,125, +184,189,217, 44,160, 76,110,195,154,199, 79, 11, 85, 22, 39, 22,192,178,250, 62, 91,215,186,130, 13,229,172,137,244,244,244,175, +185,153,130, 28, 56,112,248,175,129,243, 79,115,156, 28, 39,199,201,113,114,156, 28, 39,199,249,159, 3,201, 53, 1, 7, 14, 28, + 56,112,224,192,129,195,147, 5, 81,135, 10,181,101,165,236,134, 40,217,155, 28, 39,199,201,113,114,156, 28, 39,199,201,113,254, +231, 56,235,227,190, 9, 14, 79, 69,120,113,156, 28, 39,199,201,113,114,156, 28, 39,199,249,223,227,252, 87,129,115, 17,114,224, +192,129, 3, 7, 14, 28, 56,112, 2,171, 81,224,109, 84, 38,133,188, 9,224,215,170,227,134, 66, 10,224, 35, 11,190, 83, 0, 62, + 4, 32,230,154,185, 81,131,199, 53, 1,135,134, 66,173, 86,183,105,219,182,237,213,122,146, 21,115,224,192,225, 57, 6,255, 81, + 39,188,188,188, 46,144, 36,217,138, 36, 43, 53,152,101, 46, 36,211,235,154,123,150,101,239,221,190,125,187,199,163, 56, 91,182, +108,105,230, 36, 73, 18, 4, 65,128, 36, 73, 24,141, 70, 37,143,199, 43,169,141,147,166,233,180,248,248,248, 46,141,168,205,246, + 57, 56, 56, 24,183,108,217,242, 85, 96, 96, 96,235,252,252,252,178,169, 83,167, 14,184,121,243,102, 8,128,183,108,228,106, 79, + 16,196,222,174, 93,187, 30,155, 53,107,214,119,254,254,254,202,178,178, 50,241,225,195,135,221,182,109,219,246, 39, 77,211, 19, + 1,196,113,183,105,227,129,155,155, 91, 32, 65, 16,155, 21, 10, 69,151,210,210,210, 43, 0,102,106, 52,154,107, 92,203,252,163, +152, 44, 18,137, 6,250,248,248,116,211,233,116, 5,247,238,221,139,170, 74,233,146,249,132,248,237, 0,252,159, 88, 44, 14,242, +246,246,110,150,144,144,240,208, 96, 48, 92, 70,101,186,150,162,199, 37, 87,171,213,109,130,130,130,206,173, 90,181,202,105,225, +194,133,231,162,162,162,122,105, 52,154,120,238,178,114,120, 22,104,214,172,153,125, 89, 89,217, 78,146, 36, 3, 37, 18,137,155, + 82,169,132, 66,161,200, 20,139,197,177, 50,153,108,210,201,147, 39, 11,185, 86,122,194, 2,139,199,227,121, 68, 69, 69,185, 40, +149, 74,208, 52, 13,134, 97,192, 48,140,121,253,193,170, 37, 5, 77,194, 10, 52, 77, 35, 56, 56,184,206,213,132,249,124,126,179, +171, 87,175,186, 40, 20,127,165, 90, 50, 24, 12,232,216,177, 35, 19, 19, 19,227, 82,115, 33, 97,189, 94,143,206,157, 59,179,141, +168,189,198, 58, 57, 57,233, 83, 83, 31,188, 80,161, 51,244,152, 49,127,197,255,141,126,181,183,221,197,139, 23,201, 87, 94,121, + 69,112,246,236,217,183, 1,236,181,146, 75, 74, 16,196,174,197,139, 23,127,202, 23,202, 92,142,158,188,192,255,114,251,129,135, +237,219,182, 36,230,205,158, 33,155, 51,103, 78,148,159,159,223, 55, 52, 77,191, 8, 64,199,221,170,141,227,255, 34, 16, 8,126, + 90,189,122,181,123,166, 70,131,245, 27, 54,116, 7,176, 5, 64,119,174,105,254, 49,124,180,108,217,178,213, 99,198,140, 1, 69, + 81,208,106,181, 77,147,146,146,218, 45, 94,188,248,245,164,164,164,110, 0,146, 31,147,191,137,143,143,207,157,121,243,230, 57, +118,235,214, 13, 36, 73,162,176,176,176,233,185,115,231,186,239,218,181,235,237, 7, 15, 30,248, 1,200,121,156, 31,112,112,112, +216,255,217,103,159, 57,137,197, 98,124,251,237,183, 78,163, 70,141,250, 19,192,139,143, 33,178, 72, 39, 39,167, 57, 0,130, 25, +134, 17, 3,184, 92, 80, 80,176, 18,128,129,187, 93, 56,212, 5, 39, 39,167,201, 89, 89, 89, 95,201,100, 50,161,189,189, 61,164, + 82, 41,132, 66, 33, 68, 34, 81,115, 7, 7,135,230, 10,133, 98,240, 27,111,188, 49,243,208,161, 67, 59,185,214,122,130, 2,139, + 36, 73, 72,165, 82, 28, 62,124, 24, 60, 30, 15, 66,161, 16, 2,129, 0, 2,129,160,218,107,211,113,179,102,205,234,253, 49,147, + 85,234,248,241,227,176,179,179,131, 74,165, 66,219,182,109, 65, 16, 4,196, 98, 49,194,195,195,171,241,118,233,210,229,177,178, +136, 55, 4, 35,250, 86, 38,233,172, 45,121, 99,232,204, 52,188, 50,102,213,240,114,157,241, 37,150, 37,180,153, 5,198,252,229, +235,190,138,235,212,174, 45,113,228,200,145,206,206,206,206,111,218, 32,176,230,118,235,214,237, 56, 5,145,235,196,241, 19,198, + 79, 32, 9,106,216,132,247,151,157,139, 73, 42,216,233, 31,120, 32, 39, 39,109,218,151, 95,126, 25, 63, 99,198,140, 57, 0,214, + 90, 91,254, 46, 93,186, 60, 96, 24,166, 89,149, 72,206,149, 74,165,234,136,136, 8,170, 17,220,107, 77, 1,172, 3, 96, 4,176, + 6,128,101,210,205, 54, 66,161,112,173,193, 96,200, 71,229, 66,191, 15, 27,227,159,197,221,221,221,239,173,183,222,114,206,203, +201,193,250, 13, 27,204, 77, 14, 43, 22, 37,127,210, 8, 12, 12,108, 37,145, 72,214, 1, 8,212,233,116,238, 0, 32,149, 74,211, + 89,150,253, 65,171,213, 46,138,137,137,209, 54,244,129, 22, 64, 59, 60,122,201, 38,118,237,218,181,241, 31,126,248,225,189,103, +192,217,194,213,213,117,213,200,145, 35,113,226,196, 9,156, 60,121,210, 40,145, 72,248,227,199,143, 39,102,206,156,233, 48,111, +222,188,193, 0,190,120,204,166, 29,188,108,217, 50,199,182,109,219,226,232,209,163,184,118,237,154,182, 77,155, 54,210,222,189, +123,131,199,227, 57, 46, 90,180,104, 16,128,221,143,243, 3, 5, 5, 5, 43, 87,172, 88,177,103,243,230,205,202,228,228,100, 44, + 91,182,204,121,214,172, 89, 17, 0,122,219, 32,178,196, 0,230, 0, 8,230,241,120, 47,142, 31, 63,158,154, 61,123,182,128, 36, + 73,227,198,141, 27,155,236,220,185,115,180, 64, 32, 8,204,203,203, 43, 5, 7,212, 49,206, 25, 24,134, 17, 0,144, 0,208,213, +119,252,111,170,187,163,163,227,244,252,252,252, 45, 77,155, 54, 69,147, 38, 77,204, 99, 45,195, 48, 40, 43, 43,131, 86,171, 69, +171, 86,173,132,109,219,182,221, 49,115,230, 76,193, 87, 95,125,181,149,187, 99,108, 23, 88,189, 1, 68, 88,188,215, 27, 64, 4, + 65, 16, 96, 24, 6, 2,129, 0, 60, 30, 15,124, 62,223, 44,124, 44, 95,155,182, 71, 8,161,155, 53,110,102,162,164,164,196, 44, +174,236,236,236,204,150, 48,163,209,248, 55, 78,154,166, 65,146, 36, 91, 23,231, 19,130,153,243,187,141,126,216, 29, 61,255,141, +221,209,149,199,131,198, 84,238,119, 71, 3,225,151,167,173, 91,187,181,103,179,185, 43,191, 93,157,151, 87,152,237,239,209,132, +122,115, 76,111, 79, 81,110, 86,174, 83,203,150,161, 0,178,109, 40,103,175,105,211,166, 29, 61,122, 54, 81, 46, 22,139, 68, 60, + 18,188, 54, 94,173, 4,238,170,214,142, 77, 6,116, 19,165, 36, 39,255,249,246,219,111, 79,155, 49, 99,134,147,133,192,170,183, +238, 44,203,170,207,156, 57, 3, 62,159,143,144,144, 16,135,170,107, 76, 89, 83,247,167,209,158, 22, 88,156,149,149,245, 70, 69, + 69, 5,186,116,233,242,106, 94, 94, 94, 48,128, 88, 0, 29,134, 14, 29,250,231,119,223,125,167,140,137,137, 65,247,238,221,165, + 0, 70, 61,195,114,254, 13,106,181,250, 12,128,126, 4, 65, 64, 95, 81,161, 95,247,121,181,101,238,162,107,136,171,167, 94,206, +128,128, 0, 63,137, 68,114,225,243,207, 63, 87,249,251,251, 19, 2,129, 0, 20, 69, 33, 33, 33,161,217,190,125,251,222,185,114, +229,202,160,192,192, 64,255, 90, 22, 53,183,166,238,237,254,252,243,207, 50, 47, 47,175, 90, 5, 99,121,121, 57,207,203,203,235, +229, 71,136,161,167,205,153,150,149,149,245, 90,191,126,253,166,101,102,102,222,161, 40,106, 1,128,246,206,206,206, 49,195,135, + 15,135, 84, 42, 13,214,106,181, 95, 60,206,117,119,113,113, 25,218,163, 71, 15,108,222,188, 25,107,214,172, 9, 1,240,251, 47, +191,252,210,183,184,184, 56,252,213, 87, 95,133,189,189,253,107,133,133,133,187, 31,227, 94,106,211,173, 91,183, 29,239,189,247, +158,242,151, 95,126,129,143,143, 15,138,139,139, 49,113,226, 68,151, 77,155, 54,253, 15,192,203, 22, 34,235, 81,156,254, 98,177, +120,247,193,131, 7, 21, 94, 94, 94, 94, 66,161,144,244,242,242, 66,126,126, 62, 42, 42, 42,196, 43, 87,174,236, 32,145, 72,174, +125,241,197, 23,187, 1, 12,123,198,255,163, 34, 0, 42, 0,246,176,205,189,122,179, 14, 62,115,124,170, 64, 32,128, 88, 44,134, + 68, 34,129, 68, 34,193,189,123,247,190,231,241,120, 19, 8,130, 48, 90,195, 73,252, 53,112, 5, 0,136,170,239, 24, 0,211, 8, +250, 37, 15,130, 32, 54, 2, 8, 70,101, 28,117,132,139,139,203,220,172,172,172, 84,107, 57,213,106,181, 83, 94, 94,222, 23, 77, +155, 54,133,139,139, 11,170, 30,200,209,165, 75, 23, 84, 84, 84,224,214,173, 91, 96, 24, 6, 73, 73, 73, 80,169, 84,232,208,161, +195, 23, 97, 97, 97, 71,195,194,194,242,158, 98,221,107,213, 34,207,187,192,250, 95,213,147,165,169, 50,166, 99,208, 52,109, 22, + 88, 53,197, 79, 77,193, 69, 16, 4, 88,150, 37,234,177, 96,145,122,189,222, 44,174, 84, 42,149, 89,156, 81, 20, 85,171,192,106, + 40,236,237,237,127, 45, 44, 44,220, 0,224, 76, 67,190, 63,126,252,248,191,197,115,124,244,209, 71, 15,115,114,114,232,161,189, +218,136,247,238, 61,145,247,118,232,203,110,254,222, 30,190,114, 39,151,128,242,242,242, 43, 0, 4,182, 24, 68,252,253,253,149, + 91, 15, 70,100,143,153,179,110,185,135,171,130,238,234,227,170,242,118,148,139,156, 36,124,202,158,165, 10,101, 50, 89, 59, 0, +121,182,150,221,206,206, 14,199,143, 31,111,108,247,154,131, 86,171, 69, 65, 65, 1,182,109,219,166,154, 54,109,218,217,188,188, +188,185, 67,135, 14,221,124,244,232, 81,121, 97, 97, 33, 12, 6, 3, 0,104, 27,225,255,100,133,131,131,195, 75,193,193,193,162, + 67, 71,142,136, 88,150, 45, 67,229,114, 68,165, 44,203,206,250,167, 11, 35,145, 72, 62, 88,185,114,165,202,223,223,159,200,205, +205, 5,203,178, 32, 73, 18,206,206,206,152, 63,127,190,100,209,162, 69,238,241,241,241, 31,163, 1,203,206, 0, 32, 30, 37,132, + 0, 64, 38,147,209,176,125,114, 76,173,156, 20, 69, 17, 61,123,246,156,159,155,155,219, 65,171,213,126, 98, 5, 15, 5,224,120, + 90, 90,154,229,205,125,237,206,157, 59, 90, 62,159, 47,109,217,178,101, 80, 92,220,227,133, 44,182,105,211,230, 5,129, 64,128, +203,151, 47,235, 44, 58,247,136,235,215,175,235,134, 13, 27, 38,110,214,172,217, 11,133,133,214,133,164,168,213,234, 54,222,222, +222,191, 57, 59, 59, 75, 77, 75, 86, 57, 57, 57, 9,214,174, 93,171, 76, 75, 75, 3, 69, 81, 88,184,112, 33, 66, 67, 67,225,224, +224,128, 9, 19, 38,184,238,216,177, 99, 63,128,206,117, 89,174,196, 98,241,238,196,196, 68, 95,181, 90, 45,189,116,233, 18, 58, +118,236,136,220,220, 92,100,102,102,162,180,180, 20,153,153,153,152, 52,105,146,203,250,245,235,213,141,232, 63, 84,200,231,243, + 33,151,203,237,139,138,138, 30, 39,142, 77, 12, 64, 4, 0,124, 62,223, 44,174,196, 98, 49,196,226,255,196,188, 32,119,130, 32, +226, 4, 2,129, 88, 46,151, 11, 73,146,132, 92, 46, 31,224,225,225,113, 43, 36, 36,164,253,190,125,251, 82,172, 33,169,168,168, +216, 43,149, 74, 5, 77,154, 52, 1, 0,244,239,223, 31,227,199,143, 71, 78, 78, 14,147,145,145, 1, 95, 95, 95, 50, 34, 34, 2, + 89, 89, 89,184,118,237, 26,186,118,237, 42,112,116,116,220, 11, 96,208, 83,172,219, 35,181,200,243, 44,176,106, 86,206, 12,134, + 97,170,137,171,218, 44, 87,150, 22,172,250,220,121, 4, 65,128,166,105,184,185,185, 65, 38,147, 65, 38,147,153,207,153,196,156, +229,198,178,108,131, 93,132,173, 91,183,238, 35,147,201, 94, 60,123,246,236,171, 0,194,173,253,222,200,121,119,204, 86,171,154, + 8, 8, 8,184,176,112,225,194,129,127,252,241, 71,193, 11, 29, 91, 49,226,140,135,121, 50, 7,231,142, 68, 19,151,144, 25, 83, +166, 94, 4,112,208,134, 34,102, 84, 84, 84,136, 91,184,145,218,140,162, 98,125, 43,149,157,125, 43, 59,133,172,133,179,157,147, +131, 68, 68,202, 93, 93,154, 26,141,198, 66, 0, 25,245, 17, 89,186, 5,197, 98,177,158, 32, 8,190,189,189, 61,236,236,236, 12, + 5, 5, 5, 21,129,129,129, 16,137, 68,185, 66,161,208,106,119, 97,215,174, 93,179,104,154,118,169,235, 51, 66,161, 48,251,210, +165, 75,174, 86,214,119, 81, 64, 64, 64,239, 45, 91,182, 52,241,241,241,193,182,109,219, 84, 71,143, 30,221,189,127,255,126, 20, + 22, 22,226,254,253,251,152, 56,113, 98, 49, 42,221,136,141,205,148,126,110,196,136, 17,216,185,115, 39, 91,245, 16, 33, 39, 8, +162,163,157,157,221,221,219,183,111,255,227,113, 46, 36, 73, 14,240,245,245, 37,138,138,138,192,178, 44,120, 60, 94,181,109,254, +252,249,210, 73,147, 38, 45,238,222,189,251,124,129, 64, 80, 76, 81,212,161,210,210,210, 79,110,221,186,213,168,130, 85, 95,124, +241,197,119, 31, 62,124, 24,234,233,233,249,243, 99,208,176, 20, 69,233, 89,150,149,242,120, 60,193,227,150,137, 32, 8, 94, 85, +127, 84, 97, 97,249,165,170,142,197,176, 97,246,168,163,163,227,254,125,251,246,121,120,120,120,192,104, 52,194,104, 52,162,172, +172, 12, 17, 17, 17,208,233,116,230, 69,217, 63,253,244,211,138,153, 51,103, 74,142, 28, 57,146,173,213,106,199,214, 67, 59,231, +187,239,190, 83,170,213,106,169, 86,171, 69,114,114, 50, 58,119,238,140,146,146, 18,148,149,149,161,188,188, 28, 6,131, 1, 69, + 69, 69,246, 52, 77,235, 27,203,181,230,241,120, 16,139,197, 16, 8, 4,133,205,154, 53, 3, 73,146,146,212,212,212,134,184,220, + 84, 0,138,249,124,190,200, 82, 88, 73, 36, 18,220,188,121,243,112, 29,214,171,218,111, 30,203, 96, 98, 43,142,159, 53, 8,130, +216, 40, 16, 8,196, 78, 78, 78, 66,211,123, 6,131, 65,232,224,224, 0, 79, 79,207,205, 0, 6, 91,201,211,201,201,201, 9, 4, + 65, 64, 40, 20, 98,202,148, 41,136,138,138,250, 33, 45, 45,237,237,236,236,108,148,150,150,238, 85,169, 84,175,103,103,103,131, +166,105,164,164,164, 32, 32, 32,160,211, 63, 84,205,231, 94, 88,213, 20, 88,189,107,236, 77, 22,169,122, 45, 87,245,184, 8,171, +193, 96, 48, 40, 66, 67, 67, 25,147, 24, 51,205, 34, 4, 64,208, 52, 13,161, 80, 88,141,179, 74, 96, 53,232, 6, 23,139,197, 24, + 60,120,176, 68, 38,147,253,248,203, 47,191,188, 10,224,143,134, 54,210,241,163, 7, 92,215, 46, 93,184,212,177,105, 75,239,143, + 63,254,152, 63,104,208,160,240, 67,135, 14,117,117,238,213,103, 96,228,239,135, 93,183, 45, 56,254,243,225,195,135, 75, 96,125, +252, 21, 0,156,255,225,135, 31,212, 31,204,158, 33,236,221,187,247,247,227, 58,188,199, 87,139, 24,165,163, 88,200,147,241,248, +164,184, 89,139,129,191, 71, 68,106, 0, 68, 90,209, 73,168,195,195,195, 97,111,111, 15, 0, 34,189, 94, 15,123,123,123,108,219, +182, 77,162, 82,169,160, 82,169,208,163, 71, 15, 7,161, 80, 88,159,187,208, 82,240,186,252,239,127,255,131, 66,161, 64, 89, 89, + 25,116, 58, 29, 40,138, 2,203,178,230, 39,199,151, 95,126,217,197,134,250, 38, 23, 23, 23,191, 52, 99,198,140,200, 45, 91,182, + 52,241,246,246,198,242,229,203,145,151,151,135, 7, 15, 30, 96,236,216,177,197,247,238,221, 11, 70,245,216,172,103,142,246,237, +219,179,231,206,157,195,169, 83,167,240,202, 43,175, 16,199,143, 31, 55,208, 52, 45,204,200,200,184,145,145,145,241, 76,202, 68, + 81,148, 82, 36, 18,193,104, 52,130,207,231,155, 93,248, 38,129,229,238,238,142,223,126,251,141, 95, 94, 94,206,207,203,203,147, +237,218,181,107,118,116,116,180, 26,192,155,207,178, 45,183,110,221,234, 57,101,202,148, 7,124, 62,159, 29, 56,112,224, 91,169, +169,169,175,169,213,234,223,207,158, 61,251, 57, 0,155,211, 21,180,107,215, 46,154,199,227,121, 24,141, 70,225,143, 63,254,104, +164,105, 90,216,190,125,251, 44,147,181,200, 52, 54, 82, 20,149,150,144,144,208,197, 26, 62,173, 86, 43,252,250,235,175,141, 21, + 21, 21,194, 14, 29, 58,152,185, 12, 6,131,240,167,159,126, 50, 26,141, 70, 97,155, 54,109,162,173,153,217,156,159,159, 63,118, +222,188,121,127, 30, 62,124,216,153,199,227, 33, 53, 53, 21,249,249,249,176,183,183,199,190,125,251,208,162, 69, 11,132,135,135, +231,211, 52, 61,121,231,206,157,139,181, 90,237, 88, 43, 98,176, 94, 14, 10, 10,242, 44, 44, 44,132,157,157, 29, 74, 75, 75, 17, + 29, 29, 13,127,127,127,100,100,100,128, 36, 73,216,219,219, 99,235,214,173,229, 4, 65,228, 55,134,255, 16, 73,146,102, 33,100, + 33,136, 42,130,130,130,112,254,252,249, 3, 54,138, 34,189,169,255,177,116, 13,138,197, 98,240,120, 60,155, 93, 30, 12,195, 8, + 1,116, 50, 13,232,245, 29, 55, 2,244,150,203,229,194,154,111, 22, 20, 20, 8,125,125,125, 95,180, 97,124,116,146, 74,165,149, +132,189,123, 35, 59, 59,155,246,242,242, 26, 61,122,244,104, 35, 0, 76,157, 58,117,116, 78, 78, 78,133,209,104,228,241,249,124, +228,228,228,160, 85,171, 86, 78,255, 68,253,106,106,145,231, 93, 96, 17,168,116,119, 88,238,205, 22,172,250, 44, 87,166,115, 38, +161, 84,207, 31,173,240,234,213,171,114,185, 92,110,126,207,104, 52,162, 83,167, 78, 12,195, 48, 68,205,223,122, 28, 11,150, 88, + 44,134,189,189, 61,222,124,243, 77, 89,122,122,250,238,107,215,174,121, 88,243,189,202, 24,172,234,226,106,251,154,229,155,191, + 92,187,210, 41,233,212,183,216,185,233, 51, 90, 46, 87,196, 4, 4, 4,188, 84, 84, 84,164,179,151,235,144,153,135,163, 0,246, +219,210,231, 0, 56,124,241,226,197,216,254,253,251, 95,188,127,255,190, 67,106, 98,226, 57,149,190,180, 84,209,172, 37, 37,116, +113, 29,170, 53, 24,249, 35, 70,140,112, 5,176,201,138,167, 17, 48, 12,131, 19, 39, 78, 64,169, 84, 66,165, 82,193,222,222, 30, + 38,113,213, 80,220,187,119, 15,105,105,105,144,203,229,144,203,229, 80, 40, 20, 80, 40, 20, 16,137, 68,213,172,143, 54, 32,190, +184,184,120,238,177, 99,199, 14,173, 94,189, 26, 5, 5, 5, 40, 43, 43,195,210,165, 75,145,156,156, 60, 15,149, 49, 89,141, 6, + 29, 58,116, 96, 47, 92,184,128,115,231,206,161,172,172, 12,155, 55,111,134, 90,173,238, 3, 96,201,179, 44, 23,195, 48, 66, 83, +170, 19,146, 36,255,102,193, 50,137, 45,169, 84, 10,103,103,103, 44, 92,184, 80, 56,116,232,208,208,103, 89,230,181,107,215,182, +222,184,113,227,174, 61,123,246,156, 26, 59,118,236,145,155, 55,111, 78,176,179,179,187,241,199, 31,127,172, 20,139,197, 76,131, + 58, 47, 62,223, 35, 54, 54,214, 82,228, 11,104,154,150,209, 52, 13,138,162, 96, 52, 26, 81, 94, 94,142,144,144, 16,171,249,162, +162,162,100, 0,176,100,201, 18, 1, 0, 25,195, 48,176,228,211,106,181,130,190,125,251, 90,213,151,104, 52,154,248,203,151, 47, +191, 56,122,244,232, 11,135, 14, 29,114,240,244,244, 68, 90, 90, 26, 50, 50, 50,224,237,237,141, 77,155, 54,149,177, 44,219,179, + 74, 84,253,100,101,181,155, 58, 56, 56, 8, 30, 60,120, 0,138,162, 16, 24, 24,136,173, 91,183, 98,212,168, 81,104,215,174, 29, + 74, 74, 74, 16, 23, 23,135,221,187,119, 59, 8,133,194,225,141, 65, 92,153, 68, 80,109, 91, 3, 31, 48, 84, 18,137,164, 88, 34, +145,136, 76, 66,235,202,149, 43, 54, 91,175, 44, 16,107,227,241, 51,131,169, 15, 54, 26,171, 87, 83, 46,151,195,199,199,199,106, + 30,185, 92, 78,152,198, 88,163,209, 8,141, 70, 67,223,188,121,211, 44, 80,213,106, 53,125,233,210, 37, 90,167,211,241,148, 74, + 37, 0,192,222,222,254,105,139,204, 71,106,145,231,221,130, 21, 89, 99,111,182, 96,153, 4, 79, 93, 65,238,124, 62,223, 90,129, + 5, 30,143,135,211,167, 79, 67,161, 80, 64,169, 84,194,207,207,207,100,133,169,213, 42,214, 80,129, 37, 18,137, 96,103,103,135, + 51,103,206, 84, 92,187,118,109, 74, 67, 45, 87,219,215, 44,223,252,233, 39,203,156,242,110, 95, 68, 90,134, 6,121, 89,134,232, +243, 55, 83,126, 69,101,130, 81,224,118,219, 8,194,255,142,213,226,202,207, 89, 26,160,114, 80,253, 20,220,111,160,251,107,227, +102,144, 51,103,206,124, 97,252,248,241,249,111,189,245,214, 28,169, 84,218,142,162,168,130,240,136,136,148,145, 35, 71, 58, 21, + 21, 21,141,135, 21, 49, 73, 60, 30, 79,211,191,127,255,102, 0,160, 84, 42,245,223,124,243,141,200,222,222, 30, 99,198,140,169, +200,204,204,148, 84,181, 71,129,181,214,171,170,193, 38,123,242,228,201, 46,245,180,113,182,141, 77,218, 41, 52, 52,116,199,225, +195,135,145,151,151,135,178,178, 50, 8,133, 66,172, 91,183, 14, 15, 30, 60,248, 34, 62, 62,254,102, 99,233,204, 58,118,236,200, + 94,186,116, 9, 55,110,220,128, 78,167,195,148, 41, 83, 0,128,208,104, 52, 0,208,255, 89,123, 10,210,211,211,177,111,223, 62, +208, 52,141,177, 99,199,162, 69,139, 22,102,129,149,153,153,137,111,190,249, 6, 52, 77, 99,242,228,201,104,222,188, 57,140, 70, +163,164,119,239,222,252,103, 53,163,244,189,247,222, 75,250,225,135, 31, 78, 61,124,248,112,208,154, 53,107,122, 19, 4,193,204, +159, 63,255, 83,149, 74,245, 88,179, 47, 11,138, 74,112, 55, 49, 21, 20, 69,213,186, 53,113,118,180,153, 47, 33,249, 1, 40,138, + 54,115,208,244, 95,124, 78,142,182,241,105, 52,154,242,188,188,188,178,201,147, 39,219,239,216,177,131,240,241,241,193,253,251, +247, 33, 16, 8,160, 84, 42,203,239,222,189,107,107,106,134,244,252,252,124, 31, 30,143, 39, 76, 76, 76,132,167,167, 39,186,117, +235,134, 85,171, 86, 33, 39, 39, 7, 20, 69,193,197,197,133, 49, 26,141, 49, 6,131, 33,242, 89,255,143,106, 90,174, 76, 91,149, +229,138, 4,240, 51,254, 30, 56, 94,175, 21,203,210,130,213, 80,235,213, 83, 20,149, 79,109,102,162,143,143, 79,132, 74,165, 10, +189,115,231, 78, 53, 43,214,155,111,190,105,240,246,246,254,211, 90, 30,149, 74, 85, 32, 18,137,156, 42, 42, 42,112,241,226, 69, +248,249,249, 9,139,138,138, 86,163, 50,233, 53,126,250,233,167,213, 89, 89, 89, 66,119,119,119, 0,128,175,175, 47,138,138,138, + 10,254,129,230,251,155, 22,249, 55, 8,172, 90,205,114, 53, 93,132,117,137, 44, 83, 66,210,250, 44, 45, 90,173,214,108, 17,145, +203,229, 96, 24,166,154, 59,178,166,192,170,101, 22,161,213,127,236,179,103,207, 86,108,223,190,125,132, 89, 12, 89, 1,203, 24, +172,175,215,175, 92,107, 18, 87,215,207,253,134,159,238, 20,229,206, 95,181,126, 99, 67, 27,187,173,179,172,163,171,171,211,255, +214,175,251, 84,149,126,249, 20,142,108, 95,207, 94,143,138,234, 58, 61, 42,106,248,244,233,211, 29, 81, 25,111,149, 14,224, 28, + 42,167,155, 91, 21,240,125,249,242,229,230,166,215, 93,187,118, 53,170, 84, 42, 40, 20, 10,228,228,228, 8, 21, 10,133, 36, 34, + 34,194,230, 88,135,168,168, 40,215, 39,124,175,181,121,229,149, 87, 34,191,255,254,123,121, 97, 97, 33, 82, 82, 82,240,225,135, + 31,226,171,175,190,130, 74,165,194,137, 19, 39,148,161,161,161,255,187,123,247,110, 15, 60,227,228,170, 1, 1, 1,108, 84, 84, + 20, 82, 82, 82, 64, 81, 20, 94,123,237,181,122, 31, 30,254, 97, 11, 22, 59,111,222, 60,236,216,177, 3, 36, 73, 98,220,184,113, + 40, 46, 46, 54,159,119,116,116,172,237, 28, 15,245,207, 40,125,122, 29, 13,159,207, 70, 68, 68,172,233,221,187, 55, 30, 62,124, + 56,168,115,231,206, 95, 78,152, 48, 33,253,113,121, 29,236,148, 8,240,247,130, 78,167,131, 78,167, 67,211,166, 77, 81, 82, 82, +130,164,164, 36,232,116, 58,184,186,216,219,204,215,169, 93,107,232,245,122,232,116, 58,184,184,184,160,172,172, 12,247,239,223, +135, 78,167, 67,147, 38, 14,182,208, 53, 27, 48, 96,192,217, 3, 7, 14, 56,237,223,191, 95, 63,108,216, 48,209,242,229,203, 9, +149, 74,133,172,172, 44, 52, 48,188, 39,226,220,185,115,158, 33, 33, 33,190,113,113,113,136,140,140,132, 94,175, 71,167, 78,157, +144,144,144,128, 23, 94,120, 1,197,197,197,151,175, 92,185,210, 40,102,185,212, 20, 86,209,209,209,135,133, 66, 33, 11,160,161, +214, 38, 0, 64, 90, 90,154,184,125,251,246, 58,177, 88, 44,186,112,225,194,129,199,176, 94, 61,249,167,159,199,159,153,248, 72, +180,110,221,122,158,135,135, 71, 72, 96, 96, 32,226,226,226,132, 98,177, 24,111,189,245,150, 97,240,224,193, 6, 62,159,111,245, +132, 27,137, 68,114, 91,169, 84,190,164,211,233,160,215,235, 17, 30, 30, 14, 71, 71,199, 15, 67, 67, 67,231,106, 52, 26,100,100, +100,136,196, 98,177,217, 74, 30, 28, 28,140,252,252,252,219,255, 64,243,213,170, 69,158,119,129, 85,171, 24,178,180, 96,213,229, + 30,180, 86, 96,145, 36, 9,189, 94, 15,153, 76,102, 22, 88,150,153,226, 27,194,249, 72,155,111,108,236,133,228,228,228,207, 1, +156,108,200,247,191,219,191, 71,109,199,148, 55,203,184,124, 18,119,175, 71,227,135,184,194,220,249,171,214,207,126,117,196,152, +172,154,130,204,170, 39,143, 38,178,246,174, 46,149,226, 42,239,246, 69, 36,222,136,198,201,203,105, 87,245, 64, 2,128, 79,158, +228, 69, 53,249,214, 27, 19,196, 98,241, 60,211,108,193,228,228,100,140, 29, 59,182, 48, 37, 37,101,198,107,175,189,246,213,175, +191,254,234,224,224,224,128, 51,103,206, 40,155, 53,107,182, 26,192,179,116,103,177, 87,175, 94, 69, 94, 94,229,228,205,158, 61, +123, 54, 42,113, 5, 0, 87,175, 94, 21,134,134,134,254, 14,160,207,237,219,183,193, 48,204,133,152,152,152,158,166,243,117,157, +179, 70,191,149,148,148, 8,148, 74,101,173,131,149, 80, 40, 20, 54,192,226, 96,230, 60,127,254,252,167,159,127,254,249, 15,239, +191,255,126,226, 99,114,214,106,193, 10, 13, 13, 69,133,206,136,180,172, 34, 80, 20,133,114,125,214, 99, 89,176, 66, 67, 67,161, +173,208,227,129, 38, 31, 20, 69,161,180,194,106, 67,137,172, 95,191,126,191, 30, 58,116,200,237,194,133, 11,208,235,245, 76,116, +116,244, 3,215, 14,207, 0, 0, 32, 0, 73, 68, 65, 84,253,169, 83,167,170, 38, 77,154,228, 84, 89,229, 6, 97,211,155,111,190, + 57,226,252,249,243,249,190,190,190,142, 87,174, 92, 65,118,118, 54,140, 70, 35,250,244,233, 3,177, 88,156,186,122,245,106, 33, +172, 8, 45,248, 39, 5,214,237,219,183, 77,194,106,220,147, 18, 66, 38, 11,214,127, 9, 7, 14, 28, 72,255,230,155,111,252,213, +106,245,198,183,222,122, 43,184,105,211,166,164, 72, 36,138,224,243,249,115, 9,130, 72,181,161,237, 38, 56, 56, 56, 36,241,120, + 60, 94,122,122, 58, 18, 19, 19,193,227,241,192,178,172, 72,171,213,194,213,213, 21, 60, 30,207,100, 29,131,135,135, 7,157,144, +144, 48, 1, 28,158,140,192, 50, 97,197,138, 21,216,190,125, 59,222,121,231,157, 58, 63, 87,149, 22,160,230, 64,212, 30, 22,185, + 50, 76,179, 8,195,194,194,170,125,207,228, 10,156, 49, 99, 70,181, 47,255,248,227,143,181,185, 8,171,113, 62, 10,201,201,201, +182, 40, 96, 51,167, 41, 6,107,228,216,113,154,205,159, 46,189,177,251,248,239, 29, 52, 90, 86, 51,127,213,250,247,106,138, 43, +107, 57,253, 92,229,109,213,206,142, 17,159,175,251,212,206,100, 13, 59, 20,147, 89, 4,138,125,199,198,235, 85,111,221, 5, 2, +129,166, 71,143, 30,205, 0,171,221,130, 86,181,231,227,150, 83,167,211,225,210,165, 75, 0,128,137, 19, 39, 22,166,164,164,188, + 4,224, 86, 74, 74,202,237,129, 3, 7, 70,156, 62,125,218,161,234,137, 62,239, 89,150, 19,168,156,209,202,231,243, 77, 49, 13, +196,147,190, 70, 79,162,156, 26,141,230,157,105,211,166,109,215,233,116,252,178,178,178,119,172, 61, 87, 95, 57,191,251,238,187, + 68, 31, 31,159,222,120,116, 42, 6, 6,192,197,199,225,220,184,113, 35, 0,248, 62, 14,231,163, 44, 88,135, 15, 31, 6, 77,211, +240,112,181,131, 78,167,131,101,188,167, 53,156, 53, 45, 88, 71,142, 28, 1,195, 48,104,174,118,132, 78,167,171, 43,246,176, 26, +167,147,147,211,250, 61,123,246,120,220,190,125, 27,233,233,233,216,176, 97, 67,106, 78, 78,206, 96, 62,159, 47,254,242,203, 47, +255, 55,100,200, 16, 87,138,162,116, 13,184,151,116, 6,131, 97, 66,143, 30, 61,246,174, 92,185,242,158,159,159, 95,179, 30, 61, +122, 56,228,231,231,103,199,198,198,166,108,223,190, 93, 65, 81,212, 4, 60,218,245,244,143,253,143, 0, 32, 35, 35,227, 56, 42, +211,215,216, 42,172,234, 45,103, 84, 84,212,145, 42,238,147, 86,114,255, 35,117,127, 2, 51, 19,235, 44,231,196,137, 19,211,240, +247,252,102, 54,149,243,183,223,126, 75, 25, 61,122,244,138,246,237,219,135, 41, 20, 10,196,199,199,155,211, 34,153, 30,208, 9, +130,192,200,145, 35, 49,125,250,116,156, 57,115,102,197,200,145, 35, 83,254,129,246,252,111, 8, 44,154,166, 31,166,164,164,168, +247,236,217,195, 35, 8, 2,251,246,237, 67,205,192, 90,211, 30, 0, 46, 93,186, 68,177, 44,155, 84,215,143,209, 52,253, 48, 58, + 58,218,245,219,111,191, 21, 72,165, 82,136,197, 98,100,100,100,128, 97, 24, 38, 43, 43,139, 60,112,224, 64,181, 96,221,139, 23, + 47, 82, 6,131,225,193,179,106,156, 63,227, 82,231,158, 62,241,131,243, 11,221, 95, 42, 84, 57, 58,214, 42, 84,190,219,232, 7, +194,191,110, 43,150, 92,169,250,244,243,117,159,218,155,196,213,225,152,204,194, 10, 29, 29,124, 39, 87,123,253, 73,151,249,194, +133, 11,205, 27,233,189,182,180,119,239,222, 12, 0,103, 0,139, 81,105,185, 3,128, 91,247,239,223,239,238,227,227,243, 62, 42, + 23,190, 94,250, 44,173, 87, 12,195, 88, 90, 78, 27,109,144,101, 76, 76,204, 61, 0,125,109, 61, 87, 31, 70,142, 28,153,140,199, + 95,110,230,169,115,154,144, 95, 88,140,164,251,233, 85, 75,121,209,160, 83, 51, 45,226,167,140,200, 47,182, 45,141, 92, 65, 81, + 9,146,238,167,129, 97,216, 74, 62, 58,221, 28,228, 78, 81, 20,114, 11,235,247,218,243,249,252, 94, 97, 97, 97,131, 73,146, 36, + 47, 93,186,164, 91,183,110,221,195,156,156,156,161, 0, 30, 84,197,240,189,252,227,143, 63,238,183, 34, 37,131, 37, 39, 65, 81, +148,105, 96,142, 51, 26,141, 47, 44, 88,176, 96, 14,128, 94, 0,154, 3,120,128,202,208,130, 77,104, 68, 25,199, 9,130, 24,247, + 60,114, 63, 14,158,151,153,137,135, 15, 31, 94, 54,125,250,116,126, 80, 80,208,199, 93,187,118, 37,239,223,191,143,236,236,108, +243,195,229,128, 1, 3,224,233,233,201,156, 60,121,114,213,176, 97,195,150,129,195,147, 19, 88,185,185,185, 3,198,141, 27,247, + 27, 73,146, 45, 31,181,184,179,165,117,137, 97,152,148,172,172,172, 58,147,144,229,230,230, 14, 88,186,116,233,111,124, 62,191, +165,197, 98,206,186,188,188,188, 25, 35, 71,142,220, 34, 16, 8,196,150,214, 46,134, 97, 82, 53, 26,205, 63, 26, 80, 92, 51, 15, +214,192, 33,175,231, 62, 46,167, 92, 4,175,135,151, 78, 32,241,198, 85, 28,142,201, 44, 40,209,211, 47, 39,228,150,255,215,148, +127, 54,128, 25,143, 56,151, 8,224,157, 70, 80, 70,162, 42,230,143,224,186,134,198, 15,138,162,210, 66,250,188,140,154,105, 25, +106, 30,211, 52,157,102, 45, 95,223,224,222,143,228, 49,189,174,143,143,199,227,189, 31, 20, 20,196,123,255,253,247,179, 78,157, + 58,245,123, 65, 65,193,123, 0,202, 45, 44,140,241,168, 59,153,104,109,156,206, 20, 69, 89,174,129,168, 67,229, 10, 15,107,185, + 59,161, 81,226,185,152,153,184,117,235,214, 37,243,231,207,223,221,180,105,211,125,189,122,245,242,245,246,246, 86, 41,149, 74, + 20, 23, 23,151,228,231,231,223, 61,113,226,196,216,241,227,199,223,227, 46,103,227, 68,251,231,141,115, 68, 95,176,108,156, 31, +203,198,249,177, 35,250,130,181,230,184, 62,206, 54,174,242,222,221,154,171,174,118,104,170,188,226,235, 34,247,255, 47,181, 39, +199,201,113,254, 7, 57,155,139, 68,162,159,248,124,126,175, 39,200,233, 44, 18,137,154,112,215,136,227,124,154,156, 35, 70,140, +224,141, 24, 49,130,247, 12,203,249, 72,176, 44,219,149,101,217, 33, 85,123,211,235, 16,211,123,141, 81, 0,241,193,161, 26,142, +254, 14,162,166,203,175,190,227,250, 16,159, 85, 22, 97,235, 19, 43, 7, 14, 28,158, 91, 60,208,235,245, 67,159, 48,103,174, 94, +175,231, 90,150,195,211, 29,255,142, 30,165, 27,113,241,154, 16, 4,241, 11,203,178,161, 0, 96,122,109,249, 94, 99, 3,201,221, + 82, 28, 56,112,224,192,129, 3, 7, 14, 79, 22, 4, 30,109,230,179, 37, 70,168, 33,166,194,155, 28, 39,199,201,113,114,156, 28, + 39,199,201,113,254,231, 56,235,227,254,219,247, 89,150, 29, 82,151, 5,139, 32,136, 19,255, 53, 1,199,249,188, 57, 78,142,147, +227,228, 56, 57, 78,142,147,227,124, 44,176, 44, 59,164,114,199, 14,177,124,109,177,111,116,224, 98,176, 56,112,224,192,129, 3, + 7, 14,141, 29,218,143, 62,250,232, 99,130, 32,126, 1,128,143, 62,250,232,227,198, 94, 96, 78, 96,113,224,192,129,131, 5,212, +106,245, 43, 0,150,161, 50,132, 98,181, 70,163, 57,194,181, 10,135,127, 19,156,157,157,229, 78, 78, 78,191,147, 36,233, 9, 84, + 79,185, 84,219,250,191, 12,195,104,242,243,243,251,103,101,101,229,254,147,156, 53,112, 97,245,234,213,229,171, 87,175, 54, 5, +180,231, 0, 32,170, 92,134, 57,255, 10,129,181,160, 95,139, 23,155,186,187, 31, 40,204,203,139,209,149,151, 76, 90,253, 71, 70, +126, 3,127,219, 73, 36, 18,141,150,203,229, 33, 44,203,122,241,120,188, 59, 69, 69, 69,225, 70,163,241, 16,128, 82,238, 47,192, +225, 89, 35, 32, 32,160,131, 72, 36,250,144, 32,136,238, 20, 69,121, 8, 4,130, 12, 0,151,117, 58,221,186,216,216,216, 24,174, +133,254, 53, 32,213,106,245, 23,246,246,246, 65,133,133,133, 99, 1,124, 28, 31, 31,223,145, 36, 73,248,251,251,127,172, 86,171, +147,148, 74,229,206,146,146,146, 11, 26,141,102, 46, 26,184,172, 15,135,198, 5, 47, 47,175,104,146, 36, 61, 44,151,107,171, 41, + 8,106,238, 89,150,189,119,251,246,237, 30,143,226,116,119,119,247, 82,169, 84, 91, 0,116,173, 77, 84, 88,162, 42,191,218,149, +226,226,226, 25,233,233,233,181, 38,226,117,112,112, 80,186,184,184, 44, 35, 8, 98, 36, 73,146,245,166, 79, 96, 24,134,102, 89, +246,187,236,236,236,165, 5, 5, 5, 37,143, 28,124,157,156,194, 35, 35, 35,187, 58, 59, 59,215,155,243,143,162, 40,164,165,165, + 53, 9, 13, 13,141,204,202,202,242,251, 39, 57, 45, 65, 16,132, 30,149,107, 55, 62, 55,176, 89, 96, 17, 52,222,154, 52,101,156, +123,225,195,120,247, 61,135, 78,183,249,184, 63,255,229, 85,103, 30,100,218,194, 33,145, 72, 70,123,123,123,111,218,180,105,147, + 83,203,150, 45, 9,169, 84, 10,141, 70,227,119,237,218,181,215,195,194,194,150,166,165,165, 77,160, 40,234,183,199,172,155,189, +163,130,255, 97,126, 41,181,144,235, 74, 56,216,130, 17, 35, 70,240, 30, 62,124, 24,166, 82,169, 62, 88,176, 96,129,184, 85,171, + 86, 80, 40, 20,200,206,206,110,158,144,144,208,108,203,150, 45,175,188,240,194, 11, 95, 10,133,194, 69, 17, 17, 17, 20,215, 98, +207, 55,212,106,245, 23,145,145,145,179,154, 54,109,138,158, 61,123, 94,232,212,169,147, 74, 38,147,225,212,169, 83,240,242,242, +106,103,103,103,119,121,219,182,109,130,101,203,150, 5, 28, 59,118, 12, 26,141,102, 54,215,106,255, 2, 85, 77,146, 30, 49, 49, + 49, 46, 50,153, 12, 52, 77, 87,173, 6,192,128,101, 89,243,222, 82, 12,209, 52,141,224,224, 96, 67, 61, 99,219, 87, 55,110,220, + 8, 49,173,112, 98, 33,164,106, 69, 70, 70, 70, 72,112,112,240, 87, 0,106, 77,168,237,226,226,178,108,212,168, 81,243,218,181, +107,103, 94,106,142, 97, 24,243, 62, 55, 55, 23, 51,103,206, 52,255, 6,195, 48,136,140,140,156,243,238,187,239,162,160,160,224, +221, 58,234,238,233,236,236, 76,212,183, 4, 94, 88, 88, 24,194,194,194,176,105,211, 38,130,207,231,219,215,211,158, 79,156,243, +121,135,237, 2, 11,236,201,147, 71,143, 76, 10,237,237, 75,140, 31, 26,232,179,255,120,244,197, 5,125, 91,190,180,230,247,251, + 15,173, 20, 87,115,166, 77,155,246,233,242,229,203, 37,119,239,222, 69, 92, 92, 28, 40,138,130, 66,161, 64,135, 14, 29,200,147, + 39, 79,170,231,204,153,115,244,207, 63,255,156,104, 48, 24,142, 53,180, 98,110, 14,188,117,114, 41,111, 76,169,150,189,108,160, +233,227,141,177,241,187,117,235,118,198,104, 52,174,137,141,141, 61,251,188,220, 48,129,129,129, 61,133, 66,225, 82,145, 72, 52, +240,223, 42, 46, 82, 83, 83,151,190,248,226,139, 31,132,133,133,137,239,223,191,143,248,248,120,104, 52, 26,180,108,217, 18, 45, + 91,182, 36, 54,109,218, 36,249,242,203, 47,103, 95,187,118,141, 4, 48,223,150, 62,221,205,205,109,114,223,190,125,135, 59, 59, + 59,219,165,167,167, 23,157, 63,127,254, 39,141, 70,243, 53,234, 95, 51,242,145,156,206,206,206,227, 67, 67, 67,135, 59, 58, 58, + 58,106, 52,154,252,223,127,255,253,167,236,236,236,157,143,105,105, 81, 3,232, 8,192,169,234, 88,211,162, 69,139, 91, 41, 41, + 41,217, 79,144, 51,163, 69,139, 22,113, 13,225,116,118,118,150,243,249,252, 35, 4, 65, 52,173,195, 66,144, 65, 81,212,168,220, +220,220,178,186,184, 84, 42, 85,119,181, 90,141,203,151, 47, 99,241,226,197,142,193,193,193, 72, 72, 72, 0, 73,146,248,224,131, + 15, 8,127,127,127, 65,102,102, 38,186,116,233,130,240,240,240, 30, 85,203,221,112,176, 14,223, 1,176, 7,240, 38, 0, 75, 87, +144, 51,128, 31, 81,185,194,195,176,103, 85, 56,169, 84,138,131, 7, 15, 66, 32, 16, 64, 40, 20,162,160,160, 0,238,238,238, 16, + 10,133, 16, 8, 4,230, 77, 40, 20,162, 89,179,102,245,242, 49, 12,211,141,199,227,161,180,180, 20, 52, 77,155,151, 89, 42, 42, + 42, 2,203,178, 16,137, 68,230,247, 77,231, 24,134,233, 86,135,213,102,100,211,166, 77,113,232,208, 33,212,150, 7, 77,165, 82, +225,230,205,191, 38,220,241,120, 60, 4, 4, 4,144, 4, 65,140, 4,240,110, 29,188, 44, 0, 76,153, 50,165,218,242,116, 53, 55, +211,218,193, 44,203, 90, 46, 33,246,143,113,254,171, 5,214, 71,125, 90,206,104, 23, 24,176, 78, 36, 18, 72, 25,218, 8,134, 50, +130, 49,234,193, 48, 20,238,165,106,224,229, 34,194,196, 65,222,158,123,207, 36,220, 92,216,175,117,208,234,223, 18,227,107, 80, +212,156,106,217,162, 93,187,118,203, 86,174, 92, 41,249,253,247,223,113,247,238, 93,172, 90,181, 10, 0, 32,151,203,113,234,212, + 41,208, 52,141,245,235,215, 43, 7, 14, 28,184, 37, 35, 35, 35, 2, 64,126, 61,156,181,193,179,117, 43,245,208, 99,159,189, 36, +110,247,250,209,141,153,249,244, 9, 0,117, 37, 80,123, 26,203,214,212,203, 73, 81, 84, 63,129, 64,208,163, 83,167, 78,175, 88, + 41,178,158, 73, 57, 45,197,149, 64, 32, 56,109, 48, 24,100, 34,145,136, 95,135, 40,120,166,229,124, 28,206,128,128,128, 14, 42, +149,234,131,165, 75,151,138, 47, 93,186,132,130,130, 2,100,103,103, 99,238,220,185,216,186,117, 43,218,181,107, 7,185, 92,142, +217,179,103, 75,102,206,156, 57,163, 75,151, 46,223, 69, 71, 71, 71, 91, 81, 78,178,119,239,222, 7,247,237,219,215,146,162, 40, + 18, 0,140, 70,163, 67,106,106,234,184,133, 11, 23,246,142,137,137,121,179, 1,237, 73,246,232,209, 99,223,254,253,251,189, 69, + 34, 17, 89,213, 89, 55,121,251,237,183, 39, 45, 90,180, 40,248,234,213,171, 99,234,184,239,235,106,207, 78, 50,153,172,237,140, + 25, 51,114,135, 14, 29,154, 14, 0, 87,175, 94, 37, 98, 99, 99,123,142, 27, 55, 46, 37, 44, 44, 44,182, 1,156,157,101, 50,153, +239,172, 89,179,114, 6, 15, 30,156, 33, 20, 10,153, 75,151, 46,241,110,222,188,217,107,242,228,201,201,139, 22, 45,186,110, 11, +167, 64, 32, 56,124,236,216,177,222,238,238,238, 52, 80,185,154, 2, 65, 16, 44, 65, 16, 44, 73,146, 44, 73,146, 72, 78, 78,110, + 49, 98,196,136, 3, 0, 94,173,139,179,176,176,112, 92,175, 94,189, 34, 23, 47, 94,236, 8, 0,145,145,145,224,243,249,230, 1, +225,238,221,187,208,233,116,216,180,105,147,161,164,164,100,242,191,237,158,127,202,156,205, 0,116, 3,240, 7,128, 62, 85, 34, +203, 25,192, 89, 0,254, 0,206, 63,171,114,146, 36, 9,154,166,205, 34,234,183,223,126,195,214,173, 91,113,232,208, 33,184,187, +187, 87, 19, 88, 2,129, 0,143,112,249,221,172, 33, 50, 76,125, 59,104,154, 70, 84, 84, 20,118,238,220, 9, 23, 23, 23, 56, 59, + 57,193,185, 73, 19, 4, 5, 5,193,100, 53,163,105,186, 54,222,106,156,185,185,185, 96, 24,235,158,149, 88,150, 69,113,113,177, +213,237, 89,151, 16,178,220,108,185, 70,143,201,249,223, 17, 88,106, 55,231, 69, 35,134,247,147,130,166, 0, 67, 25, 96, 40, 7, +107, 40, 7,171, 47, 3, 33,146,130, 53, 86, 64,206,203,195, 59,125, 93, 85, 71, 47,102,221, 94, 16,220,124,200,154,179, 15, 78, +215,241,164,184,100,251,246,237,118, 55,110,220, 64,124,124, 60, 54,108,216,128,229,203,151,155,159, 28, 94,125,245, 85, 92,184, +112, 1,122,189, 30,139, 23, 47,118, 92,176, 96,193,172,146,146, 18,155, 23,153,116,115,226,111, 61,178,119,147,163,163, 52, 23, + 19,135, 94,113,250,234, 72,202,140,162, 50,227,151,141,241, 2, 44, 88,176, 64,182,118,237,218,159,109, 16, 89,207,204,114, 37, + 22,139, 79, 47, 89,178, 68,190,100,201, 18,250, 9,113,182,227,243,249,135,141, 70,227,251,177,177,177,191, 54,128,162,121,215, +174, 93, 87,197,199,199,159, 46, 41, 41,217, 95,243,164, 80, 40,124,181,115,231,206, 99, 47, 94,188,248, 49,128, 36,107, 8,197, + 98,241,156, 15, 62,248, 64,146,150,150,134,194,194, 66,136,197,226,106,157,155, 88, 44, 6, 73,146, 16,137, 68,120,251,237,183, + 37,187,118,237,122, 15,192, 27,245,222,147,110,110,147,247,238,221,219,210, 96, 48,144,101,101,101, 16, 10,133, 16, 10,133,232, +208,161, 3,111,254,252,249,205,230,205,155, 55, 45, 43, 43,107,179, 45,149,119,112,112, 24,183,111,223, 62,111,145, 72, 68,106, + 52, 26,244,236,217, 19,151, 47, 95, 70, 80, 80, 16,111,254,252,249,205,103,207,158, 61, 53, 39, 39,103,171,173, 86, 38,153, 76, +214, 46, 50, 50,242, 97,211,166,127, 25,135, 90,182,108,201, 14, 26, 52, 40, 63, 62, 62,222,247,234,213,171,121,157, 59,119,126, +104, 3,167,187, 76, 38,243,251,245,215, 95, 53,203,151, 47,239,187,117,235,214,161, 85, 22,220,227,171, 86,173,250, 61, 47, 47, +207,255,242,229,203,121, 65, 65, 65,233, 54,112, 58,185,185,185, 81, 51,102,204, 80,214, 60,177,116,233, 82, 44, 91,182, 12,187, +119,239,206, 3,224, 82,103,101,171, 2,218,219,181,107,167,234,211,167, 15, 34, 35, 35, 49,123,246,108,157,209,104, 76, 0,128, +144,144,144, 54, 97, 97, 97,162,152,152, 24, 56, 56, 56, 8, 52, 26,205, 55,106,181,154, 11,124,183, 30, 67, 1,252, 15, 64,187, + 42,145, 53, 10,192, 81, 0,109, 1,196, 3, 24,241, 44, 11,103, 18, 88,233,233,233,216,181,107, 23, 86,173, 90, 5, 31, 31, 31, + 24, 12, 6,240,249,124,179,184,226,243,249, 32, 8, 2, 44,203, 18,214,242, 94,185,114, 5,123,247,238,197,226, 69,139,160, 84, + 86,222,166, 6,131, 1,249, 5, 5,144, 72, 36,102, 17, 86,143, 96,250, 46, 49, 49,113,158,187,187,187,217, 77,105,233, 34, 4, + 0,133, 66, 1,134, 97, 64, 81, 20,116, 58, 29,118,236,216, 65,177, 44,251, 93, 61,214, 38,179, 24,122,247,221,119,161,211,253, +181, 62,120,199,142, 29, 43,173, 33, 45, 90, 32, 32, 32,192,124,108,178, 80, 89,195,185,179,103, 7,104, 45, 62,237, 27,246, 25, + 0,192,195,195, 3,190,190,190, 80,171,213, 86,113,254, 91, 4,150,105,129,219,106, 11,221,102,102,102,175,217,189,237,155,207, + 68, 2, 82, 16,210,195, 23, 14, 98, 10,132,204, 17,194,222, 31,129,176,247,172,252, 98,126, 50,244,191,126,132, 81, 1,185,228, + 94, 29,239,199,176,129, 94, 77,194, 78, 39,215, 26, 92, 71,146,100,247,230,205,155, 35, 50, 50, 18, 45, 91,182,196,146, 37, 75, +224,231,231, 7,153, 76,134,172,172, 44,148,149,149, 65, 46,151,131,166,105, 4, 6, 6,242,148, 74,101,112, 3, 4, 86,224,224, + 62,157,187,241, 85,126,232, 57,240, 5,156,217,210, 91,190,251,151,140,133, 69,101,198,111, 96,177,224,106, 99,193,107,175,189, +134,172,172, 44,217,190,125,251, 26, 44,178,186,117,235,118,134,162,168,126, 86,152,195,207,158, 59,119,174, 79, 67,197,213,174, + 93,187,228,246,246,246,168, 47,120,211, 6,113,117,110,220,184,113,170,125,251,246,253,208,169, 83,167,215,109, 20, 89,205, 71, +141, 26,117, 98,231,206,157,126, 67,134, 12, 81, 68, 70, 70,254, 77, 96,181,107,215,238,181, 51,103,206,188, 62,125,250,244,118, +251,247,239,127, 5,149,139, 74,215,103,230,238,209,170, 85, 43, 60,120,240, 0, 89, 89, 89,208,233,116,200,202,202, 2, 0,164, +165,165,193,195,195, 3, 14, 14, 14,240,240,240, 64,155, 54,109, 8,146, 36,131,172, 41,108,112,112,240, 80, 0,100,114,114, 50, +114,114,114, 96,103,103, 7,185, 92, 14,119,119,119,244,233,211,135,239,237,237, 61,216, 86,129, 53,104,208,160,225, 50,153,140, + 76, 77, 77, 69, 74, 74, 10,116, 58, 29, 18, 18, 18, 96,103,103,135,144,144, 16,129,183,183,119,104, 3, 4, 86,251,169, 83,167, +102, 91,138, 43, 19,228,114, 57,225,235,235,155,111,111,111,223, 5,128, 45, 2,171,253,236,217,179,179, 86,175, 94,253, 82,120, +120,248, 2,211,155,225,225,225, 31, 2,192,230,205,155, 35, 29, 29, 29,187, 0,176, 69, 96,129,101, 89,102,210,164, 73,137, 34, +145, 8,166,205, 36, 92, 63,251,236, 51,144, 36,105,103, 5,205,199,241,241,241, 29, 21, 10, 5,226,227,227,193,227,241, 64, 16, + 68,162, 70,163,233, 8, 0, 46, 46, 46, 73, 21, 21, 21, 94, 21, 21, 21, 24, 49, 98, 4, 49,100,200,144, 14, 27, 54,108, 88, 4, +160,177, 8,172,174, 0,214, 3,208, 3, 88, 4,224,114, 35,235,226,178, 0,188,108, 33,178, 98, 1,136,171,196,213,203, 85,231, +159, 9, 8,130, 0,195, 48,224,243,249,248,236,179,207, 96, 48, 24,176,127,255,126, 28, 61,122, 20, 36, 73,130, 32, 8, 16, 4, + 1,149, 74,133, 47,190,248,194,124,108, 13, 40,138,194,183,223,126,139,143, 22, 44, 48,139,171,170,135, 62,184,185,186,194,201, +217, 25,201,201,201,245, 10,172,236,236,236,165, 81, 81, 81,168, 43,200,125,216,176,191, 60,172,150, 65,238,214,148,147,199,227, + 65,167,211,161, 95,191,191,134,143, 89,179,102,153, 95, 23, 20, 20,152,254, 19, 32,172,172, 60,143,199,131,150, 5, 94,147,252, +245,222,224,247,223,175,102,145,171,131,179, 86, 45,242,175,180, 96,137,122,165,110,190,127,129, 12, 24, 25,250,194,120, 71,149, + 20, 76, 73, 6,132,125,195,112, 35, 95,134,141,219, 42,199,194,121, 35, 2,209,190,223, 74,232,190,233,143, 62, 45,244,162,111, + 98,164,243, 1, 44,169,141,207,217,217,217,153,162, 40,144, 36, 9,185, 92, 14, 71, 71, 71, 72,165, 82,228,230,230, 98,206,156, + 57, 56,125,250, 52,244,122, 61,132, 66, 33, 90,181,106, 5,131,193,224,101,179,245,202,129,191,115,195,103,171,236,243,146, 15, +224,234,221, 66,200,236, 60,176,104,106, 23,135,176, 45,209, 75,115, 10,202, 63,108,140, 23,193,223,223, 31,115,231,206,149,125, +249,229,151, 13, 18, 89, 20, 69,173,224,243,249, 61,223,127,255,125,233,136, 17,127,127, 32,140,139,139,195,180,105,211,180,229, +229,229,159, 52, 68, 92,137, 68,162,211, 59,119,238,148,219,217,217,225,193,131, 7, 79, 76, 92,109,218,180, 73,229,229,229, 5, +129, 64, 32,249,246,219,111,109, 17, 89,109,134, 13, 27,118,114,231,206,157,158, 83,167, 78, 77,139,140,140, 76, 65,229,180,250, +106,136,137,137, 41, 24, 63,126,124,234,238,221,187,189, 25,134,249,245,224,193,131,161, 0,110,215,211,150,205,101, 50, 25,114, +115,115, 49,111,222,188,106, 1,170, 38,119, 54, 0,196,199,199,195,195,195, 3, 21, 21, 21,238,214,212,217,209,209,209,129,101, + 89, 76,153, 50, 5, 15, 31,254,165, 77,220,221,221,241,240,225, 67, 80, 20,229,104,107, 59, 58, 56, 56, 56, 26,141, 70,244,238, +221, 27, 21, 21, 21, 0,128, 81,163, 70, 65, 32, 16, 32, 59, 59, 27, 6,131,193,169, 1,151,199,121,200,144, 33, 25,143, 58, 41, +151,203,141, 14, 14, 14, 45,108,228,116, 10, 13, 13, 77,223,190,125,123, 77, 87, 29,162,162,162, 94,181,179,179, 11,119,116,116, +244,109, 64, 89, 25,177, 88, 12,177, 88, 12,129, 64, 0,145, 72, 4,177, 88, 12,145, 72, 4,129, 64, 0, 30,143,103,149, 95,133, + 97, 24,156, 56,113, 2, 36, 73, 86,115, 93, 44, 94,188,248, 29,153, 76,230, 26, 17, 17, 97,126, 0, 44, 45, 45, 69,235,214,173, + 91,181,106,213,234, 90,102,102,102,202,237,219,183, 95,127,198,221,199, 58, 0,166, 89,109, 91, 1, 4, 52,194, 46, 46, 11,192, + 72, 0,209, 85,226, 74, 15, 96,248,179, 20, 87,150,215,158,207,231,155,255,231, 18,137, 4,129,129,129,102, 49, 69, 16, 4,202, +203,203,205, 46, 66,107, 45, 88, 69, 69, 69, 80,171,213, 80, 42,149,104,237,227,131,196,132, 4, 0, 48,191, 22,137, 68,102, 33, + 86, 23, 10, 10, 10, 74,170,130,213,223,125,194,226,146, 5, 0, 62,191,238, 48,108,181, 90, 13,134, 97, 76,194,146,125, 18,156, +206,206,206, 40, 45, 45,181,138,243,223, 34,176,254,166, 24,195,194, 64,234, 46,180,220, 53,114,112,183,241,109, 61,228,208,229, + 38, 67,164,112, 2, 97,223, 2, 27,183,253,138,219, 41,149,161, 81, 27,143,198, 96,247,194, 1, 32,100,142, 80,107,239, 66, 41, + 17,191,254, 40,129,149,151,151, 87,106, 48, 24, 28,165, 82, 41,248,124, 62,132, 66, 33,114,115,115,241,127,255,247,127, 56,114, +228, 8, 90,180,104, 1,138,162, 32, 18,137,144,147,147, 3,161, 80,104,211,236, 68, 30, 15, 67,102,140,239,215, 82,238,228,131, +188,152,229,149,111,170, 2, 49,117, 20, 79,244,249,222, 91,227,114, 10,202, 63, 71,101, 80,101,163,130, 66,161, 64, 64, 64, 0, +198,140, 25, 35,219,191,127,255, 30, 0, 30,182,124, 63, 38, 38,230,124, 96, 96, 96,255,245,235,215,159,209,104, 52,210, 78,157, + 58, 65,161, 80, 64,161, 80, 32, 57, 57, 25,203,151, 47,175,208,233,116,161, 13,177,142,241,249,252,111, 39, 77,154, 36, 87,169, + 84, 72, 78, 78,134,163,163,227, 99,213, 53, 48, 48,176,157, 64, 32, 56,183,105,211, 38,149,183,183, 55,238,220,185,131,206,157, + 59,195,205,205, 77,178,122,245,106,107, 69,214, 87, 7, 14, 28,104, 33, 18,137,136,131, 7, 15, 54, 63,120,240,224,156,250,126, +119,239,222,189, 45, 14, 30, 60,184, 9, 64, 8,234, 8,254, 22, 10,133,105, 57, 57, 57,222,205,154, 53,195,174, 93,187, 64,146, + 36, 50, 50, 50,176,104,209, 34,172, 94,189, 26, 65, 65, 65, 80, 42,149,104,214,172, 25, 18, 19, 19, 33,145, 72,172,138,120, 78, + 79, 79,207, 7,224,114,250,244,105,228,228,252,149,178,197,211,211, 19,249,249,249,208,233,116,121,182,182,101,122,122,122, 30, + 0,215,107,215,174, 33, 37, 37, 5, 3, 7, 14,196,143, 63,254,136, 46, 93,186,128,166,105, 24,141,198,188, 6, 92, 34,154,199, +227,177,117,116,162, 4, 0, 7, 27, 57,169,186, 56,171,250, 29, 91, 57,193,178, 44,251, 40,113, 37, 18,137, 80,207,111,154,117, +179,159,159,223,178, 86,173, 90,181, 93,180,104,145,128,207,231,163, 87,175, 94,109,134, 15, 31,158, 74,146,164,211, 71, 31,125, + 36,171,205, 24, 12,160, 99,219,182,109,229,141,160,251,176,180,210, 53,214, 73, 39, 46, 85, 22, 63, 17, 0, 67,213,254, 16,254, +138,201,122,166, 22, 44,161, 80,136,176,176, 48, 76,159, 62, 29,174,174,174, 88,176, 96, 1,248,124,190,121, 51, 89,101, 76, 86, + 45, 43,239, 77,184,186,184,212,253, 71,171, 10,114,175,231, 33,234,169,164,105, 48,137, 33,107, 98,161, 44,172, 77, 86,137,182, +199,228,252,215, 88,175, 44, 5, 86, 53,179,156, 89, 92, 13,236, 60,222,207, 67,138,216,152,155,104,239,102, 4, 43, 16,212,113, +183, 24, 65, 8,229,176,151,242, 61,234,184, 0, 49, 41, 41, 41,158,246,246,246, 48, 24, 12, 16,137, 68,104,223,190, 61, 46, 94, +188, 8,157, 78, 7,189, 94, 15,177, 88, 12,161, 80,136, 91,183,110,193, 96, 48, 68,218,162,175,156, 85,188, 77, 31,126,188, 92, +137,244, 93,176, 87,138, 16,220,221, 27,144,183, 5,175,236, 46,214, 47, 14,117,124,103,209,143, 27,179,114,139,223,104,108, 23, + 65,161, 80, 32, 53, 53, 21, 7, 15, 30, 44,215,233,116,227, 26,194, 97, 18, 89, 71,142, 28, 57, 99,111,111, 47, 13, 10, 10, 66, + 66, 66, 2, 62,249,228,147, 10,157, 78, 55,164,161,241, 93, 20, 69, 77,216,177, 99,199,105,138,162,228, 38,113,241,184,150,171, + 57,115,230, 40, 91,183,110,141,164,164, 36,216,217,217, 65,169, 84,162,101,203,150, 80,171,213,146, 57,115,230, 88, 35,178,102, +142, 25, 51,230,228,238,221,187, 61,167, 78,157,154,118,232,208,161,227, 0,138,106,107,218, 97,195,134,189,186,123,247,110,207, +119,222,121,231, 1,128, 57,168,103,102, 29,195, 48, 23,146,146,146,188,252,252,252,136, 54,109,218, 64, 36, 18,193,221,189,210, + 72,213,177, 99, 71,248,249,249, 65, 40, 20, 2, 0,146,146,146, 0, 43,243,178,252,249,231,159, 63,197,199,199, 79,238,210,165, + 11,207,205,205,173,218,236,164,213,171, 87, 27, 82, 83, 83,109, 94, 71,235,143, 63,254,248,241,230,205,155, 83,122,245,234,197, +119,112,112,128, 88, 44, 70,251,246,237,161, 86,171,241,201, 39,159, 24,238,223,191,223,144,181,185, 30, 92,187,118, 77,226,227, +227, 67, 63,226, 94, 85, 54,192,242,144,118,245,234, 85, 97,247,238,221,143,159, 58,117,170,157,229,137,110,221,186, 29, 87, 40, + 20,118, 0, 26, 50, 53,143,177,116, 13, 90,186, 10, 69, 34, 17,248,124,126,189, 22, 44,141, 70,243,179,171,171,235, 61, 87, 87, +215,243, 61,122,244,176,139,142,142,198,146, 37, 75,132, 58,157,174,121,120,120,184,121, 32,174,109, 0, 45, 43, 43,147, 52,130, +238, 99, 30,128, 13, 0,100, 0, 22, 52,194, 49,198, 21,149, 1,237,190,168,116, 11,142,170, 18, 91,166,152,172,103, 42,178, 24, +134,129, 64, 32,128,175,175, 47,222,125,247, 93,172, 89,179, 6, 51,102,204, 64,235,214,173,205,215,222, 20,131, 85, 53,227,205, +170,129, 95, 40, 20,194,213,205, 13, 70,163,209,108,189, 2,128,196,132, 4,240,249,124, 48, 12, 3,157, 78, 87,175,139,208,197, +197,101,217,218,181,107,231, 12, 26, 52,136,180,156,113,199,178,172, 57,157,132,229,102, 52, 26,241,243,207, 63,207, 89,189,122, +117,157,105, 26, 44,133, 78,199,142, 29,171,185, 5, 55,111,222,108,217,103, 35, 36, 36,196,166,217,126, 60, 30, 15,190, 97,159, + 85,115, 11,158,108,242, 87,179, 53,123,123, 42, 90,127,178,233, 81,156,255, 42, 23, 97,173, 53, 52, 92,244, 92, 57, 98, 64,192, +120, 63,119, 49,174,197,220,194, 47, 81,154,187,185,185,133, 96,178,110,130,201,185,131,121, 35, 2,209,182,133, 35,218,182,112, +196,188, 17,129, 96,178,111,129, 45, 72, 6, 43,113, 64,118, 25,241, 72,247, 66,126,126,254,186, 21, 43, 86, 20, 56, 56, 56, 64, + 34,145, 64, 36, 18, 33, 45, 45, 13,254,254,254,230,227,170, 39, 79, 44, 89,178, 36, 39, 39, 39,103,155,181, 21,145, 75,201,169, +107, 22,189,225, 42, 20, 43,129,252, 72,168, 84, 10,236,218,246, 25,160,203, 0, 72, 17, 94, 9, 9,224,169, 93,237,251, 0,104, +211,216, 46,194,131, 7, 15, 16, 22, 22, 86,174,213,106, 31, 43,208, 61, 38, 38,230,188,193, 96,232,191,109,219, 54,237, 47,191, +252,242,216,226,202,196,105, 52, 26, 7,238,217,179,167,236,193,131, 7, 80, 40, 20, 13,174,167, 80, 40,252,136,162, 40,213,134, + 13, 27,152,126,253,250,209, 51,103,206,164, 39, 76,152, 64, 15, 27, 54,140, 14, 9, 9,161,167, 77,155, 70,235,116, 58,177, 76, + 38, 91, 91, 15, 85,252,177, 99,199,130, 39, 79,158,124,231,235,175,191,246,120,233,165,151, 90, 0, 88, 90,115, 11, 12, 12,116, +216,189,123,183,231,244,233,211,147, 14, 30, 60, 56, 0,245,184, 7, 1, 64,167,211,109,222,186,117,107, 5, 73,146, 80, 40, 20, + 16,137, 68,104,210,164,137, 89, 8,155, 6,114,131,193,128, 45, 91,182,104,181, 90,237, 70,107,234,158,151,151,183,107,254,252, +249,247,207,156, 57, 99, 52,205,242,201,200,200,192, 39,159,124, 98,216,182,109, 91,122, 97, 97,225,215,182,182,103,113,113,241, +183, 31,126,248, 97,202,137, 19, 39,140, 36, 73,162,160,160, 0,246,246,246,248,228,147, 79, 12, 95,127,253,117,122, 73, 73,137, +205,156, 47,188,240, 66, 82,122,122,186, 82,167,211,253,205,250, 35, 16, 8, 8,137, 68, 98,154, 17,102, 53,186,116,233,146,148, +146,146,162, 90,185,114,101, 68, 72, 72,200, 26,165, 82,153,160, 84, 42, 19, 66, 66, 66,214,110,217,178,229,108, 21,103,184,205, +157, 23, 73,154, 5,150,201, 85,104,178, 98, 85, 89,178,172,114, 17,250,249,249, 29,216,187,119,175, 93, 66, 66, 2,138,139,139, + 17, 27, 27,139,152,152, 24,179, 43,215, 52,152, 89,110, 0, 80, 94, 94, 46,109, 4,221,199,255, 80,153,250,194,187, 74,200, 52, + 54, 28,181, 16, 87, 47,163,114,230,217,203, 85,199,237, 0,252,244, 44, 45, 88, 44,203,154, 31,118,222,120,227, 13,132,135,135, +163,117,235,214,102, 81,101, 57,139,208, 22,145, 65,211, 52,218,183,111, 15,157, 94, 95, 77,160,243,249,124, 52,105,210, 4, 73, + 73, 73,160, 40,170, 94, 11, 22, 65, 16, 35, 7, 13, 26, 68,198,197,197,193,207,207, 15, 49, 49, 49,136,137,137, 65,108,108, 44, +174, 93,187,134, 27, 55,110,224,214,173, 91,184,125,251, 54, 58,119,238,140,212,212, 84, 12, 24, 48,192,148,166,161, 78, 35,155, + 45,214, 38, 43,173,119, 79,131,243, 95, 97,193, 34, 44,247,174, 14,242, 9,109,213,124, 92,187,118, 27,199,175,230,239, 38, 8, +242, 88,204,125,221, 47, 3, 90,149,192,112,228, 77,180, 31,185, 15,187, 23, 14,168,124, 2,200,190, 5,195,119,111,129,144, 57, + 35,177, 88, 14,173,190,176,174,167,230,168,232,232,232,195,123,247,238,157, 52,126,252,120, 17,195, 48,144, 74,165,120,239,189, +247,204, 57, 66,120, 60, 30,102,204,152, 81,154,157,157,189, 1, 86,206,252, 2, 32,181,147, 11, 22,143,157,178, 68,130,135,219, + 1, 82,136, 92,116, 66,199,151, 38, 33, 59,229, 34, 80,118, 27, 32,132,216,246,233,100,231, 87, 39,124,254,117,102, 78,225,139, +141,229, 2,220,185,115, 7, 75,151, 46,125,108,113, 85,211,146,117,252,248,241, 61, 58,157,110,202, 19,228, 28,184,102,205,154, +211, 46, 46, 46, 13,118,139,184,187,187,191,157,155,155, 59,201, 26,195,153, 53,186,244,200,145, 35, 67, 82, 82, 82, 86,197,199, +199,215, 58,115,245,214,173, 91, 63,246,239,223, 95,102,203, 44,194,216,216,216,152,160,160,160,173, 27, 54,108,152, 49,119,238, + 92,137, 84, 42,133, 74,165, 66,124,124, 60,154, 55,111, 14, 0,208,106,181, 88,184,112,161,214,104, 52,238,142,142,142,190,104, +237,195,242,205,155, 55,199, 78,155, 54,109,114,155, 54,109, 94,101, 24,198, 73,175,215,231,165,166,166,158,168, 18, 66, 13,113, +239, 48,113,113,113, 99,166, 79,159, 62,222,199,199,103,184,193, 96,112,162, 40, 42,239,225,195,135,199,139,139,139,119, 53,132, +243,226,197,139, 57, 19, 38, 76, 72,206,204,204,244, 87,171,213, 69,118,118,118,122,189, 94,207, 83, 40, 20, 74,145, 72,212, 25, +192, 69,130, 32,110,219,194, 25, 29, 29,157, 53,113,226,196, 20,157, 78,215,102,199,142, 29,145,114,185,252,119,130, 32, 8,161, + 80,232, 32,151,203,131, 1, 68, 16, 4,145,104,107, 89, 73,146,100, 44, 5,149,165, 21, 75, 40, 20,130, 32, 8,171, 4, 86, 82, + 82,210,249, 21, 43, 86,116,104,213,170, 21,182,109,219,150,175, 80, 40,148,195,135, 15,231, 23, 21, 21, 17,117, 89,176,180, 90, +173, 4, 28,234,125,182,168,178,242, 14,181,176,124,154, 2,223,143, 2, 40,124,150,133, 99, 89,182,154,144,106,222,188,121, 53, + 81,101,121,206, 22,129, 69, 81, 20,132, 66, 33,248,124, 62,220,212,106,179,152, 99, 89, 22, 9,137,137, 40, 40, 40, 48,167,105, +168,231, 30,231, 17, 4,129,209,163, 71, 91,245,187,111,188,241, 6, 34, 34, 34, 80,159, 59,209,114,198, 95,139, 22, 45,234, 21, + 67, 85,101,177,122, 22,161,135,135, 71, 67, 57,137, 26,251,127,133,192,170,134,140,252,242,149, 59,127,136, 93,152, 81, 76, 29, + 19,247, 72,125, 55, 44, 12,236,194,190, 45,206,120,200, 69,253,219,146,233,208,125,221, 11,132,170,114,176, 97, 75, 51, 64,200, +221, 80, 32,104,142,159, 99, 50, 51, 73, 1,175, 78,235, 67, 97, 97,225,188, 47,190,248,130,119,250,244,233,145,171, 86,173,178, +247,245,245,197,216,177, 99,161,215,235,113,227,198, 13, 76,155, 54, 45, 63, 39, 39,103,123, 97, 97,225, 26,107, 43,225,172,226, +255,223,198,143,251, 59,145, 76, 41, 80,124, 21,224,219,193,217, 81,137,235,209,145, 64, 81, 52, 64, 10, 1, 82,132, 46,157,252, +208,177,157,183, 95,230, 31, 87,122, 1, 56,215, 24, 46,192, 59,239,188,243,196,196,149,165, 32, 2,208,234, 73,150,211, 36,178, +222,127,255,253,211, 12,195,200, 26,244, 40,123,244, 40,141,186,243,145,217,108,252,187,114,229,202,152, 71,157, 52, 24, 12,199, + 47, 94,188,104,115,146, 89,163,209,184, 48, 46, 46, 14,179,102,205,154,254,214, 91,111, 73,125,125,125,225,233,233,137,132,132, + 4,196,199,199, 99,235,214,173, 21, 12,195,236, 42, 44, 44,252,192, 70,106,186,184,184,120,123, 84, 84,212,246, 39,216, 6, 76, + 81, 81,209, 55, 81, 81, 81,223, 60, 41,194, 41, 83,166,220, 76, 72, 72,200,119,119,119, 15,226,241,120, 29, 80,153, 40, 82, 3, +224,155,134, 8, 33, 0,152, 62,125,250,181,164,164,164, 92, 55, 55,183, 32,161, 80,232, 93,197,153, 14, 96, 87, 3, 57,243,174, + 95,191,238,221,173, 91, 55,134,199,227,177, 2,129,128,173, 26, 12, 89, 62,159,207, 18, 4,193,254,250,235,175, 18, 88, 17,115, +153,150,150, 54,103,247,238,221,172, 66,161, 8, 42, 45, 45, 29, 11, 96,143, 86,171,237, 86, 88, 88,104, 30,132,107, 67, 69, 69, +133,152,211, 79,245,226,181, 71,188,159, 5,160, 87, 99, 40,224,138, 21, 43,176,125,251,118,212,151,129,252,248,241,227,245, 14, +252,166,123,197, 20, 95,165,215,235, 17, 23, 23, 7,130, 32,204,199,150, 73, 70,105,154,174, 51,211, 59,195, 48,180, 94,175,199, +225,195,135,173, 18, 89, 7, 15, 30, 68, 69, 69, 5, 24,190,144,179, 28, 0, 0, 2,246, 73, 68, 65, 84,134,177,170,159,173, 74, + 76,138,130,130, 2,115,234,132,192,192, 64,203, 62,212,230,246,228,241,120,240,245,245, 69,110,110, 46,156,157,157, 1, 84,186, + 5,205,226,179,172,236, 63,115,243, 91,173, 18,195,122,123,218, 85,240,201, 31, 2,220,153,151,187,120,138,225,108, 47, 1, 79, + 32, 70,113, 5,129,184,140, 10,156,187, 93,252,144,166,216,208, 85,127,164, 88,155, 32,174,187, 90,173,254,152,166,233,118, 36, + 73,202, 88,150, 45,229,241,120,177, 25, 25, 25,203, 0,220,178,165, 18,118, 10, 50,209, 65,206,179, 19,136, 68, 44, 77, 49, 0, + 72,128, 36, 1,130, 4,192,171,218, 87, 30,107,181, 6, 33,205, 16,199,178,115,243, 38, 63,235,198,127,241,197, 23,207,148,149, +149, 61,119,153,220,165, 82,233, 82, 30,143, 55,240,223,190, 76, 76,151, 46, 93,186, 72,165,210,143, 25,134,233, 90, 81, 81,225, + 38,149, 74,179, 8,130,136, 46, 41, 41,249,244,218,181,107,151,184,177,243,217,225, 73,102,114,175, 9, 83,110, 44,103,103,103, +159,235,215,175, 75, 44, 45, 88,150,131, 97,213,251, 4,119, 53,158, 79,248,249,249, 93, 62,112,224, 64,151,230,205,155,147,166, +128,107,146, 36,205,155,201,141,101,178,182, 92,186,116,137,154, 57,115,230,197,235,215,175,191,244, 40, 78,111,111,239, 51,225, +225,225,253, 44, 45, 84, 38, 33, 85,243, 53, 77,211, 40, 47, 47,199,210,165, 75,127, 75, 74, 74,170,117,169, 28, 95, 95,223, 13, +139, 23, 47,158, 51,120,240, 96,146, 36,201,191,197, 92,213,140,195, 50, 24, 12, 56,118,236, 24,243,237,183,223,110,186,123,247, +238, 35, 99,176, 2, 2, 2, 30,198,198,198,122,152, 82, 38,212,220,106,206,168, 5,128,238,221,187,107,162,162,162,154,254,147, +156,255, 25,129,101,250,252,130, 62,158,163, 8,144, 35, 73,130,105, 15,130, 16, 49, 44,226, 9,224,140, 72,162,223, 18,246,139, + 70, 91,227,243,237,241,228, 51,242,114,156, 28,231,179,224, 36, 97,221,210, 51, 92,123,254, 75, 56,189,189,189, 19, 19, 19, 19, +189, 31,217, 25, 86, 23, 88, 92,123, 62,103,156,206,206,206,242, 38, 77,154,252, 78,146,164,231,163, 22,119,182, 20,215, 12,195, +164,100,101,101,245,205,206,206, 46,127, 20,167,187,187,187,151, 68, 34,249,138, 97,152,110,214, 44,246, 76,146,100, 84, 69, 69, +197,204, 26,139, 61,155, 57,159,224, 44,194,106,229,244,247,247, 79,138,138,138,242,146, 74,165,213,226, 10,107,214,217,132,251, +247,239, 99,248,240,225,169,215,175, 95,111,241,148, 57,255, 85,176,117, 45, 66,118,205, 31,169,135, 1, 28,230,158,127, 56,252, +199,192,112, 77,240,223,130, 86,171, 45,104,210,164, 73,105, 69, 69,133, 64,167,211, 9, 40,138,170, 54,192, 73,165,210, 28,173, + 86,203, 53,212,115,138,220,220,220,178,220,220,220,160, 39,201, 89, 37,148,250, 63, 41,190,167,149, 7,171,160,160, 32,180,107, +215,174,191,242,249,124,113, 77,241, 83,155, 24,162,105,186, 34, 47, 47,111,224, 63,205,249, 95, 19, 88, 28, 56,112,224,240,159, + 64, 70, 70, 70, 80, 61, 2,140,107, 36, 14,207, 37, 52, 26, 77,188, 70,163,241,108,236,156,207, 59, 72,174, 9, 56,112,224,192, +129, 3, 7, 14, 28, 56,129,197,129, 3, 7, 14, 28, 56,112,224,192, 9, 44, 14, 28, 56,112,224,192,129, 3, 7, 78, 96,113,224, +192,129, 3, 7, 14, 28, 56,112,104, 48,254, 31,162, 69, 35,218,144, 32, 45,122, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130, 0}; diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 8bafc5ce1e8..0bf64f75552 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1261,7 +1261,7 @@ static void ui_litem_estimate_row(uiLayout *litem) static int ui_litem_min_width(int itemw) { - return MIN2(UI_UNIT_X, itemw); + return MIN2(2*UI_UNIT_X, itemw); } static void ui_litem_layout_row(uiLayout *litem) diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 3e009b50045..a3c456c0a93 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -653,6 +653,14 @@ static int get_panel_header(Panel *pa) return PNL_HEADER; } +static int get_panel_size_y(uiStyle *style, Panel *pa) +{ + if(pa->type && (pa->type->flag & PNL_NO_HEADER)) + return pa->sizey; + + return PNL_HEADER + pa->sizey + style->panelouter; +} + /* this function is needed because uiBlock and Panel itself dont change sizey or location when closed */ static int get_panel_real_ofsy(Panel *pa) @@ -771,18 +779,18 @@ int uiAlignPanelStep(ScrArea *sa, ARegion *ar, float fac, int drag) /* no smart other default start loc! this keeps switching f5/f6/etc compatible */ ps= panelsort; ps->pa->ofsx= 0; - ps->pa->ofsy= -ps->pa->sizey-get_panel_header(ps->pa)-style->panelouter; + ps->pa->ofsy= -get_panel_size_y(style, ps->pa); for(a=0; apa->ofsx= ps->pa->ofsx; - psnext->pa->ofsy= get_panel_real_ofsy(ps->pa) - psnext->pa->sizey-get_panel_header(psnext->pa)-style->panelouter; + psnext->pa->ofsy= get_panel_real_ofsy(ps->pa) - get_panel_size_y(style, psnext->pa); } else { psnext->pa->ofsx= get_panel_real_ofsx(ps->pa); - psnext->pa->ofsy= ps->pa->ofsy + ps->pa->sizey + get_panel_header(ps->pa) - psnext->pa->sizey - get_panel_header(psnext->pa); + psnext->pa->ofsy= ps->pa->ofsy + get_panel_size_y(style, ps->pa) - get_panel_size_y(style, psnext->pa); } } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 1ce352444e6..5fd84ad3c9f 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -211,11 +211,15 @@ static void template_ID(bContext *C, uiBlock *block, TemplateID *template, Struc if(idptr.type) type= idptr.type; - if(type) - uiDefIconBut(block, LABEL, 0, RNA_struct_ui_icon(type), 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); - if(flag & UI_ID_BROWSE) - uiDefBlockButN(block, search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X, UI_UNIT_Y, "Browse ID data"); + if(flag & UI_ID_BROWSE) { + but= uiDefBlockButN(block, search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*1.6, UI_UNIT_Y, "Browse ID data"); + if(type) { + but->icon= RNA_struct_ui_icon(type); + but->flag|= UI_HAS_ICON; + but->flag|= UI_ICON_LEFT; + } + } /* text button with name */ if(idptr.data) { diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 1a061172ec1..69af4fbb45d 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1187,7 +1187,10 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex uiEndBlock(C, block); if(vertical) { - y += yco-style->panelouter; + if(pt->flag & PNL_NO_HEADER) + y += yco; + else + y += yco-style->panelouter; } else { x += w; @@ -1216,13 +1219,20 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex if(vertical) { v2d->keepofs |= V2D_LOCKOFS_X; v2d->keepofs &= ~V2D_LOCKOFS_Y; + + // don't jump back when panels close or hide + y= MAX2(-y, -v2d->cur.ymin); } else { v2d->keepofs &= ~V2D_LOCKOFS_X; v2d->keepofs |= V2D_LOCKOFS_Y; + + // don't jump back when panels close or hide + x= MAX2(x, v2d->cur.xmax); + y= -y; } - UI_view2d_totRect_set(v2d, x, -y); + UI_view2d_totRect_set(v2d, x, y); /* set the view */ UI_view2d_view_ortho(C, v2d); diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 97644097108..24d5fcc648a 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -690,7 +690,7 @@ void buttons_context_draw(const bContext *C, uiLayout *layout) block= uiLayoutGetBlock(row); uiBlockSetEmboss(block, UI_EMBOSSN); - but= uiDefIconButBitC(block, ICONTOG, SB_PIN_CONTEXT, 0, (sbuts->flag & SB_PIN_CONTEXT)? ICON_PINNED: ICON_UNPINNED, 0, 0, UI_UNIT_X, UI_UNIT_Y, &sbuts->flag, 0, 0, 0, 0, "Follow context or keep fixed datablock displayed."); + but= uiDefIconButBitC(block, ICONTOG, SB_PIN_CONTEXT, 0, ICON_UNPINNED, 0, 0, UI_UNIT_X, UI_UNIT_Y, &sbuts->flag, 0, 0, 0, 0, "Follow context or keep fixed datablock displayed."); uiButSetFunc(but, pin_cb, NULL, NULL); for(a=0; alen; a++) { diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 2bc3bdaa613..66b380ab413 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -516,3 +516,4 @@ void PARTICLE_OT_new(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } + -- cgit v1.2.3 From 9241559ab4c223d30a949f2e06c776642b69715c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 9 Jul 2009 19:49:04 +0000 Subject: 2.5: Various * Weight paint: brush strength was changed to both define weight and strength, this can't work, made them separate buttons. * Allow adding particle system as modifier (fix crash). * 3D view modal ops (zoom ..) could not be ended when invoked from a button. * Fix some warnings. * Fix spelling in particle RNA property. --- source/blender/blenloader/intern/readfile.c | 12 ++---- source/blender/editors/object/object_modifier.c | 49 ++++++++++++---------- source/blender/editors/sculpt_paint/paint_vertex.c | 19 +++++---- source/blender/editors/space_file/file_ops.c | 3 +- source/blender/editors/space_file/file_panels.c | 3 +- .../blender/editors/space_view3d/view3d_buttons.c | 5 +++ source/blender/editors/space_view3d/view3d_edit.c | 9 ++-- source/blender/editors/transform/transform_input.c | 2 +- source/blender/makesrna/intern/rna_object_force.c | 2 +- source/blender/makesrna/intern/rna_particle.c | 2 +- 10 files changed, 59 insertions(+), 47 deletions(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d816708f8a4..c36a287b981 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9009,14 +9009,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) //do_versions_ipos_to_animato(main); /* toolsettings */ - for(scene= main->scene.first; scene; scene= scene->id.next) { + for(scene= main->scene.first; scene; scene= scene->id.next) scene->r.audio = scene->audio; - - if(!scene->toolsettings->uv_selectmode) { - scene->toolsettings->uv_selectmode= UV_SELECT_VERTEX; - scene->toolsettings->vgroup_weight= 1.0f; - } - } /* shader, composit and texture node trees have id.name empty, put something in * to have them show in RNA viewer and accessible otherwise. @@ -9152,10 +9146,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for(sce = main->scene.first; sce; sce = sce->id.next) { ts= sce->toolsettings; - if(ts->normalsize == 0.0) { + if(ts->normalsize == 0.0 || !ts->uv_selectmode || ts->vgroup_weight == 0.0) { ts->normalsize= 0.1f; ts->selectmode= SCE_SELECT_VERTEX; ts->autokey_mode= U.autokey_mode; + ts->uv_selectmode= UV_SELECT_VERTEX; + ts->vgroup_weight= 1.0f; } } } diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index eb723dcca6c..6b9f2db0d96 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -83,33 +83,38 @@ int ED_object_modifier_add(ReportList *reports, Scene *scene, Object *ob, int ty } } - if(mti->flags&eModifierTypeFlag_RequiresOriginalData) { - md = ob->modifiers.first; + if(type == eModifierType_ParticleSystem) { + object_add_particle_system(scene, ob); + } + else { + if(mti->flags&eModifierTypeFlag_RequiresOriginalData) { + md = ob->modifiers.first; - while(md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform) - md = md->next; + while(md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform) + md = md->next; - BLI_insertlinkbefore(&ob->modifiers, md, modifier_new(type)); - } - else - BLI_addtail(&ob->modifiers, modifier_new(type)); - - /* special cases */ - if(type == eModifierType_Softbody) { - if(!ob->soft) { - ob->soft= sbNew(scene); - ob->softflag |= OB_SB_GOAL|OB_SB_EDGES; + BLI_insertlinkbefore(&ob->modifiers, md, modifier_new(type)); } - } - else if(type == eModifierType_Collision) { - if(!ob->pd) - ob->pd= object_add_collision_fields(); + else + BLI_addtail(&ob->modifiers, modifier_new(type)); + + /* special cases */ + if(type == eModifierType_Softbody) { + if(!ob->soft) { + ob->soft= sbNew(scene); + ob->softflag |= OB_SB_GOAL|OB_SB_EDGES; + } + } + else if(type == eModifierType_Collision) { + if(!ob->pd) + ob->pd= object_add_collision_fields(); - ob->pd->deflect= 1; - DAG_scene_sort(scene); + ob->pd->deflect= 1; + DAG_scene_sort(scene); + } + else if(type == eModifierType_Surface) + DAG_scene_sort(scene); } - else if(type == eModifierType_Surface) - DAG_scene_sort(scene); DAG_object_flush_update(scene, ob, OB_RECALC_DATA); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 0710079301b..74b5d5a4206 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -424,8 +424,9 @@ void clear_vpaint_selectedfaces(Scene *scene) /* fills in the selected faces with the current weight and vertex group */ void clear_wpaint_selectedfaces(Scene *scene) { - VPaint *wp= scene->toolsettings->wpaint; - float paintweight= wp->brush->alpha; + ToolSettings *ts= scene->toolsettings; + VPaint *wp= ts->wpaint; + float paintweight= ts->vgroup_weight; Mesh *me; MFace *mface; Object *ob; @@ -909,7 +910,7 @@ static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float void sample_wpaint(Scene *scene, ARegion *ar, View3D *v3d, int mode) { ViewContext vc; - VPaint *wp= scene->toolsettings->wpaint; + ToolSettings *ts= scene->toolsettings; Object *ob= OBACT; Mesh *me= get_mesh(ob); int index; @@ -1019,20 +1020,20 @@ void sample_wpaint(Scene *scene, ARegion *ar, View3D *v3d, int mode) fac= MIN4(w1, w2, w3, w4); if(w1==fac) { dw= get_defweight(me->dvert+mface->v1, ob->actdef-1); - if(dw) wp->brush->alpha= dw->weight; else wp->brush->alpha= 0.0f; + if(dw) ts->vgroup_weight= dw->weight; else ts->vgroup_weight= 0.0f; } else if(w2==fac) { dw= get_defweight(me->dvert+mface->v2, ob->actdef-1); - if(dw) wp->brush->alpha= dw->weight; else wp->brush->alpha= 0.0f; + if(dw) ts->vgroup_weight= dw->weight; else ts->vgroup_weight= 0.0f; } else if(w3==fac) { dw= get_defweight(me->dvert+mface->v3, ob->actdef-1); - if(dw) wp->brush->alpha= dw->weight; else wp->brush->alpha= 0.0f; + if(dw) ts->vgroup_weight= dw->weight; else ts->vgroup_weight= 0.0f; } else if(w4==fac) { if(mface->v4) { dw= get_defweight(me->dvert+mface->v4, ob->actdef-1); - if(dw) wp->brush->alpha= dw->weight; else wp->brush->alpha= 0.0f; + if(dw) ts->vgroup_weight= dw->weight; else ts->vgroup_weight= 0.0f; } } } @@ -1308,7 +1309,7 @@ static int wpaint_modal(bContext *C, wmOperator *op, wmEvent *event) Object *ob= vc->obact; Mesh *me= ob->data; float mat[4][4]; - float paintweight= wp->brush->alpha; + float paintweight= ts->vgroup_weight; int *indexar= wpd->indexar; int totindex, index, alpha, totw; short mval[2]; @@ -1365,7 +1366,7 @@ static int wpaint_modal(bContext *C, wmOperator *op, wmEvent *event) if(wp->mode==VP_BLUR) paintweight= 0.0f; else - paintweight= wp->brush->alpha; + paintweight= ts->vgroup_weight; for(index=0; indextotface) { diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 9f703a9802b..c4435e85749 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -770,4 +770,5 @@ void FILE_OT_filenum(struct wmOperatorType *ot) /* props */ RNA_def_int(ot->srna, "increment", 1, 0, 100, "Increment", "", 0,100); -} \ No newline at end of file +} + diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 72a4133fe75..96366b9f82b 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -160,4 +160,5 @@ void file_panels_register(ARegionType *art) strcpy(pt->label, "Operator"); pt->draw= file_panel_operator; BLI_addtail(&art->paneltypes, pt); -} \ No newline at end of file +} + diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index cf197f1d405..7db577bf139 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1107,6 +1107,7 @@ static int view3d_panel_brush_poll(const bContext *C, PanelType *pt) static void view3d_panel_brush(const bContext *C, Panel *pa) { uiBlock *block; + ToolSettings *ts= CTX_data_tool_settings(C); Brush **brp = current_brush_source(CTX_data_scene(C)), *br; short w = 268, h = 400, cx = 10, cy = h; rctf rect; @@ -1143,6 +1144,10 @@ static void view3d_panel_brush(const bContext *C, Panel *pa) uiBlockBeginAlign(block); uiDefButI(block,NUMSLI,B_NOP,"Size: ",cx,cy,w,19,&br->size,1.0,200.0,0,0,"Set brush radius in pixels"); cy-= 20; + if(G.f & G_WEIGHTPAINT) { + uiDefButF(block,NUMSLI,B_NOP,"Weight: ",cx,cy,w,19,&ts->vgroup_weight,0,1.0,0,0,"Set vertex weight"); + cy-= 20; + } uiDefButF(block,NUMSLI,B_NOP,"Strength: ",cx,cy,w,19,&br->alpha,0,1.0,0,0,"Set brush strength"); cy-= 25; uiBlockEndAlign(block); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index bd89bd519f3..5e77c932a6c 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -503,7 +503,8 @@ static int viewrotate_modal(bContext *C, wmOperator *op, wmEvent *event) break; default: - if(event->type==vod->origkey && event->val==0) { + /* origkey may be zero when invoked from a button */ + if(ELEM3(event->type, ESCKEY, LEFTMOUSE, RIGHTMOUSE) || (event->type==vod->origkey && event->val==0)) { request_depth_update(CTX_wm_region_view3d(C)); MEM_freeN(vod); @@ -603,7 +604,8 @@ static int viewmove_modal(bContext *C, wmOperator *op, wmEvent *event) break; default: - if(event->type==vod->origkey && event->val==0) { + /* origkey may be zero when invoked from a button */ + if(ELEM3(event->type, ESCKEY, LEFTMOUSE, RIGHTMOUSE) || (event->type==vod->origkey && event->val==0)) { request_depth_update(CTX_wm_region_view3d(C)); MEM_freeN(vod); @@ -763,7 +765,8 @@ static int viewzoom_modal(bContext *C, wmOperator *op, wmEvent *event) break; default: - if(event->type==vod->origkey && event->val==0) { + /* origkey may be zero when invoked from a button */ + if(ELEM3(event->type, ESCKEY, LEFTMOUSE, RIGHTMOUSE) || (event->type==vod->origkey && event->val==0)) { request_depth_update(CTX_wm_region_view3d(C)); MEM_freeN(vod); diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 678d581b2b4..ae8aacb3477 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -270,7 +270,7 @@ void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode) break; case INPUT_TRACKBALL: /* factor has to become setting or so */ - mi->factor = 0.02f; + mi->factor = 0.01f; mi->apply = InputTrackBall; t->helpline = HLP_TRACKBALL; break; diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 45a9dc44875..269437a8fae 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -107,7 +107,7 @@ static void rna_Cache_idname_change(bContext *C, PointerRNA *ptr) { Object *ob = CTX_data_active_object(C); PointCache *cache = (PointCache*)ptr->data; - PTCacheID *pid = NULL, *pid2; + PTCacheID *pid = NULL, *pid2= NULL; ListBase pidlist; int new_name = 1; char name[80]; diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 5c94c81da1f..bb19b66b34d 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1249,7 +1249,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "acc"); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, -200.0f, 200.0f); - RNA_def_property_ui_text(prop, "Accelaration", "Constant acceleration"); + RNA_def_property_ui_text(prop, "Acceleration", "Constant acceleration"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "drag_factor", PROP_FLOAT, PROP_NONE); -- cgit v1.2.3 From d7a7081e633f458d3c68f6ccff5376c0340fe42e Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 10 Jul 2009 00:32:13 +0000 Subject: NLA SoC: Tweaks from feedback from Broken + jez * Renamed the 'blend' blending mode to 'replace', since that's what it usually does * Drawing a darkened rect behind the keyframes shown in the action line -- * Fixed typo made last night which broke compiling * Consolidated all the keyframe-shape drawing code to use a single codebase. Even if we don't ultimately go with OpenGL keyframes, there's always a tidy option for that now. --- source/blender/blenkernel/intern/anim_sys.c | 2 +- source/blender/blenkernel/intern/ipo.c | 2 +- source/blender/editors/animation/keyframes_draw.c | 27 +++-- source/blender/editors/include/ED_keyframes_draw.h | 16 +++ source/blender/editors/space_action/action_draw.c | 2 +- source/blender/editors/space_nla/nla_draw.c | 128 +++++++++++---------- source/blender/makesdna/DNA_anim_types.h | 2 +- source/blender/makesrna/intern/rna_nla.c | 2 +- 8 files changed, 102 insertions(+), 79 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index ebe3d28cb21..19337f9de5d 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -859,7 +859,7 @@ static void nlaevalchan_accumulate (NlaEvalChannel *nec, NlaEvalStrip *nes, shor nec->value *= value; break; - case NLASTRIP_MODE_BLEND: + case NLASTRIP_MODE_REPLACE: default: // TODO: do we really want to blend by default? it seems more uses might prefer add... /* do linear interpolation * - the influence of the accumulated data (elsewhere, that is called dstweight) diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index c3c5483574e..cf7e486613b 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1518,7 +1518,7 @@ static void nlastrips_to_animdata (ID *id, ListBase *strips) /* blending */ strip->blendin= as->blendin; strip->blendout= as->blendout; - strip->blendmode= (as->mode==ACTSTRIPMODE_ADD) ? NLASTRIP_MODE_ADD : NLASTRIP_MODE_BLEND; + strip->blendmode= (as->mode==ACTSTRIPMODE_ADD) ? NLASTRIP_MODE_ADD : NLASTRIP_MODE_REPLACE; if (as->flag & ACTSTRIP_AUTO_BLENDS) strip->flag |= NLASTRIP_FLAG_AUTO_BLENDS; /* assorted setting flags */ diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index f122e045776..1db78beb2cb 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -243,7 +243,7 @@ static const float _unit_diamond_shape[4][2] = { }; /* draw a simple diamond shape with OpenGL */ -static void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel) +void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel, short mode) { static GLuint displist1=0; static GLuint displist2=0; @@ -281,16 +281,21 @@ static void draw_keyframe_shape (float x, float y, float xscale, float hsize, sh /* anti-aliased lines for more consistent appearance */ glEnable(GL_LINE_SMOOTH); - /* draw! ---------------------------- */ - - /* interior - hardcoded colors (for selected and unselected only) */ - if (sel) UI_ThemeColorShade(TH_STRIP_SELECT, 50);//glColor3ub(0xF1, 0xCA, 0x13); - else glColor3ub(0xE9, 0xE9, 0xE9); - glCallList(displist2); + /* draw! */ + if ELEM(mode, KEYFRAME_SHAPE_INSIDE, KEYFRAME_SHAPE_BOTH) { + /* interior - hardcoded colors (for selected and unselected only) */ + if (sel) UI_ThemeColorShade(TH_STRIP_SELECT, 50); + else glColor3ub(0xE9, 0xE9, 0xE9); + + glCallList(displist2); + } - /* exterior - black frame */ - glColor3ub(0, 0, 0); - glCallList(displist1); + if ELEM(mode, KEYFRAME_SHAPE_FRAME, KEYFRAME_SHAPE_BOTH) { + /* exterior - black frame */ + glColor3ub(0, 0, 0); + + glCallList(displist1); + } glDisable(GL_LINE_SMOOTH); @@ -345,7 +350,7 @@ static void draw_keylist(View2D *v2d, ListBase *keys, ListBase *blocks, float yp for (ak= keys->first; ak; ak= ak->next) { /* draw using OpenGL - uglier but faster */ // NOTE: a previous version of this didn't work nice for some intel cards - draw_keyframe_shape(ak->cfra, ypos, xscale, 5.0f, (ak->sel & SELECT)); + draw_keyframe_shape(ak->cfra, ypos, xscale, 5.0f, (ak->sel & SELECT), KEYFRAME_SHAPE_BOTH); #if 0 // OLD CODE //int sc_x, sc_y; diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h index 22ee7a42121..63adcf39c12 100644 --- a/source/blender/editors/include/ED_keyframes_draw.h +++ b/source/blender/editors/include/ED_keyframes_draw.h @@ -67,6 +67,22 @@ typedef struct ActKeyBlock { short totcurve; } ActKeyBlock; + +/* *********************** Keyframe Drawing ****************************** */ + +/* options for keyframe shape drawing */ +typedef enum eKeyframeShapeDrawOpts { + /* only the border */ + KEYFRAME_SHAPE_FRAME = 0, + /* only the inside filling */ + KEYFRAME_SHAPE_INSIDE, + /* the whole thing */ + KEYFRAME_SHAPE_BOTH +} eKeyframeShapeDrawOpts; + +/* draw simple diamond-shape keyframe (with OpenGL) */ +void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel, short mode); + /* ******************************* Methods ****************************** */ /* Channel Drawing */ diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 743cc1f128e..93d061e8bf3 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -1194,7 +1194,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) glColor3f(0.0f, 0.0f, 0.0f); glBegin(GL_LINES); - glVertex2f(saction->timeslide, v2d->cur.ymin-EXTRA_SCROLL_PAD) + glVertex2f(saction->timeslide, v2d->cur.ymin-EXTRA_SCROLL_PAD); glVertex2f(saction->timeslide, v2d->cur.ymax); glEnd(); } diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 3385906979a..6219acf6fae 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -91,66 +91,78 @@ extern void gl_round_box_shade(int mode, float minx, float miny, float maxx, flo /* *********************************************** */ /* Strips */ -/* Keyframe Ghosts ---------------------- */ +/* Action-Line ---------------------- */ -/* helper func - draw keyframe as a frame only */ -static void draw_nla_keyframe_ghost (float x, float y, float xscale, float hsize) +/* get colors for drawing Action-Line + * NOTE: color returned includes fine-tuned alpha! + */ +static void nla_action_get_color (AnimData *adt, bAction *act, float color[4]) { - static GLuint displist=0; - - /* initialise empty diamond shape */ - if (displist == 0) { - const float dist= 1.0f; - - displist= glGenLists(1); - glNewList(displist, GL_COMPILE); - - glBegin(GL_LINE_LOOP); - glVertex2f(0.0f, dist); - glVertex2f(dist, 0.0f); - glVertex2f(0.0f, -dist); - glVertex2f(-dist, 0.0f); - glEnd(); - - glEndList(); + // TODO: if tweaking some action, use the same color as for the tweaked track (quick hack done for now) + if (adt && (adt->flag & ADT_NLA_EDIT_ON)) { + // greenish color (same as tweaking strip) - hardcoded for now + color[0]= 0.30f; + color[1]= 0.95f; + color[2]= 0.10f; + color[3]= 0.30f; + } + else { + if (act) { + // reddish color - hardcoded for now + color[0]= 0.8f; + color[1]= 0.2f; + color[2]= 0.0f; + color[3]= 0.4f; + } + else { + // greyish-red color - hardcoded for now + color[0]= 0.6f; + color[1]= 0.5f; + color[2]= 0.5f; + color[3]= 0.3f; + } } - - /* adjust view transform before starting */ - glTranslatef(x, y, 0.0f); - glScalef(1.0f/xscale*hsize, hsize, 1.0f); - - /* anti-aliased lines for more consistent appearance */ - glEnable(GL_LINE_SMOOTH); - - /* draw! */ - glCallList(displist); - - glDisable(GL_LINE_SMOOTH); - - /* restore view transform */ - glScalef(xscale/hsize, 1.0f/hsize, 1.0); - glTranslatef(-x, -y, 0.0f); } /* draw the keyframes in the specified Action */ -static void nla_action_draw_keyframes (AnimData *adt, View2D *v2d, float y) +static void nla_action_draw_keyframes (AnimData *adt, bAction *act, View2D *v2d, float y, float ymin, float ymax) { ListBase keys = {NULL, NULL}; ActKeyColumn *ak; - float xscale; - - /* for now, color is hardcoded to be black */ - glColor3f(0.0f, 0.0f, 0.0f); + float xscale, f1, f2; + float color[4]; /* get a list of the keyframes with NLA-scaling applied */ - action_to_keylist(adt, adt->action, &keys, NULL); + action_to_keylist(adt, act, &keys, NULL); + + if ELEM(NULL, act, keys.first) + return; + + /* draw a darkened region behind the strips + * - get and reset the background color, this time without the alpha to stand out better + */ + nla_action_get_color(adt, act, color); + glColor3fv(color); + /* - draw a rect from the first to the last frame (no extra overlaps for now) + * that is slightly stumpier than the track background (hardcoded 2-units here) + */ + f1= ((ActKeyColumn *)keys.first)->cfra; + f2= ((ActKeyColumn *)keys.last)->cfra; + + glRectf(f1, ymin+2, f2, ymax-2); + /* get View2D scaling factor */ UI_view2d_getscale(v2d, &xscale, NULL); - /* just draw each keyframe as a simple dot (regardless of the selection status) */ + /* for now, color is hardcoded to be black */ + glColor3f(0.0f, 0.0f, 0.0f); + + /* just draw each keyframe as a simple dot (regardless of the selection status) + * - size is 3.0f which is smaller than the editable keyframes, so that there is a distinction + */ for (ak= keys.first; ak; ak= ak->next) - draw_nla_keyframe_ghost(ak->cfra, y, xscale, 3.0f); + draw_keyframe_shape(ak->cfra, y, xscale, 3.0f, 0, KEYFRAME_SHAPE_FRAME); /* free icons */ BLI_freelistN(&keys); @@ -158,6 +170,7 @@ static void nla_action_draw_keyframes (AnimData *adt, View2D *v2d, float y) /* Strips (Proper) ---------------------- */ +/* get colors for drawing NLA-Strips */ static void nla_strip_get_color_inside (AnimData *adt, NlaStrip *strip, float color[3]) { if (strip->type == NLASTRIP_TYPE_TRANSITION) { @@ -179,6 +192,7 @@ static void nla_strip_get_color_inside (AnimData *adt, NlaStrip *strip, float co } else if (strip->type == NLASTRIP_TYPE_META) { /* Meta Clip */ + // TODO: should temporary metas get different colours too? if (strip->flag & NLASTRIP_FLAG_SELECT) { /* selected - use a bold purple color */ // FIXME: hardcoded temp-hack colors @@ -535,6 +549,7 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) case ANIMTYPE_NLAACTION: { AnimData *adt= BKE_animdata_from_id(ale->id); + float color[4]; /* just draw a semi-shaded rect spanning the width of the viewable area if there's data, * and a second darker rect within which we draw keyframe indicator dots if there's data @@ -542,30 +557,17 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); - // TODO: if tweaking some action, use the same color as for the tweaked track (quick hack done for now) - if (adt && (adt->flag & ADT_NLA_EDIT_ON)) { - // greenish color (same as tweaking strip) - hardcoded for now - glColor4f(0.3f, 0.95f, 0.1f, 0.3f); - } - else { - if (ale->data) - glColor4f(0.8f, 0.2f, 0.0f, 0.4f); // reddish color - hardcoded for now - else - glColor4f(0.6f, 0.5f, 0.5f, 0.3f); // greyish-red color - hardcoded for now - } - + /* get colors for drawing */ + nla_action_get_color(adt, ale->data, color); + glColor4fv(color); + /* draw slightly shifted up for greater separation from standard channels, * but also slightly shorter for some more contrast when viewing the strips */ - glBegin(GL_QUADS); - glVertex2f(v2d->cur.xmin, yminc+NLACHANNEL_SKIP); - glVertex2f(v2d->cur.xmin, ymaxc-NLACHANNEL_SKIP); - glVertex2f(v2d->cur.xmax, ymaxc-NLACHANNEL_SKIP); - glVertex2f(v2d->cur.xmax, yminc+NLACHANNEL_SKIP); - glEnd(); + glRectf(v2d->cur.xmin, yminc+NLACHANNEL_SKIP, v2d->cur.xmax, ymaxc-NLACHANNEL_SKIP); /* draw keyframes in the action */ - nla_action_draw_keyframes(adt, v2d, y); + nla_action_draw_keyframes(adt, ale->data, v2d, y, yminc+NLACHANNEL_SKIP, ymaxc-NLACHANNEL_SKIP); /* draw 'embossed' lines above and below the strip for effect */ /* white base-lines */ diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index ac8d44a86e6..d71beb8785b 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -464,7 +464,7 @@ typedef struct NlaStrip { /* NLA Strip Blending Mode */ enum { - NLASTRIP_MODE_BLEND = 0, + NLASTRIP_MODE_REPLACE = 0, NLASTRIP_MODE_ADD, NLASTRIP_MODE_SUBTRACT, NLASTRIP_MODE_MULTIPLY, diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 219feaad09b..97f35af1db7 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -239,7 +239,7 @@ void rna_def_nlastrip(BlenderRNA *brna) {NLASTRIP_TYPE_META, "META", 0, "Meta", "NLA Strip acts as a container for adjacent strips."}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_mode_blend_items[] = { - {NLASTRIP_MODE_BLEND, "BLEND", 0, "Blend", "Results of strip and accumulated results are combined in ratio governed by influence."}, + {NLASTRIP_MODE_REPLACE, "REPLACE", 0, "Replace", "Result strip replaces the accumulated results by amount specified by influence."}, {NLASTRIP_MODE_ADD, "ADD", 0, "Add", "Weighted result of strip is added to the accumlated results."}, {NLASTRIP_MODE_SUBTRACT, "SUBTRACT", 0, "Subtract", "Weighted result of strip is removed from the accumlated results."}, {NLASTRIP_MODE_MULTIPLY, "MULITPLY", 0, "Multiply", "Weighted result of strip is multiplied with the accumlated results."}, -- cgit v1.2.3 From b1a9281ed801ae8b2483cd4246880b1009efe955 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 10 Jul 2009 02:04:50 +0000 Subject: NLA SoC: Fixes for renamed headers (BIF_transform.h -> ED_transform.h) --- source/blender/editors/space_action/action_header.c | 2 +- source/blender/editors/space_graph/graph_header.c | 2 +- source/blender/editors/space_nla/nla_edit.c | 3 +-- source/blender/editors/space_nla/nla_header.c | 5 ++--- source/blender/editors/space_nla/nla_ops.c | 3 +-- 5 files changed, 6 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index f4bb5b335a4..f5c85d4d983 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -48,6 +48,7 @@ #include "ED_anim_api.h" #include "ED_screen.h" +#include "ED_transform.h" #include "ED_types.h" #include "ED_util.h" @@ -58,7 +59,6 @@ #include "BIF_gl.h" #include "BIF_glutil.h" -#include "BIF_transform.h" #include "UI_interface.h" #include "UI_resources.h" diff --git a/source/blender/editors/space_graph/graph_header.c b/source/blender/editors/space_graph/graph_header.c index 6c12b44f082..05d9b2f7e6c 100644 --- a/source/blender/editors/space_graph/graph_header.c +++ b/source/blender/editors/space_graph/graph_header.c @@ -43,6 +43,7 @@ #include "BKE_screen.h" #include "ED_anim_api.h" +#include "ED_transform.h" #include "ED_screen.h" #include "ED_types.h" #include "ED_util.h" @@ -54,7 +55,6 @@ #include "BIF_gl.h" #include "BIF_glutil.h" -#include "BIF_transform.h" #include "UI_interface.h" #include "UI_resources.h" diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 262255524db..6cbc9cab253 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -61,8 +61,7 @@ #include "ED_markers.h" #include "ED_space_api.h" #include "ED_screen.h" - -#include "BIF_transform.h" +#include "ED_transform.h" #include "RNA_access.h" #include "RNA_define.h" diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index a82056d6efb..8e4c71b9f80 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -53,11 +53,12 @@ #include "ED_util.h" #include "ED_anim_api.h" +#include "ED_markers.h" #include "ED_space_api.h" #include "ED_screen.h" +#include "ED_transform.h" #include "BIF_gl.h" -#include "BIF_transform.h" #include "RNA_access.h" @@ -68,8 +69,6 @@ #include "UI_resources.h" #include "UI_view2d.h" -#include "ED_markers.h" - #include "nla_intern.h" /* button events */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 431768c4e02..ad5f5174690 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -53,8 +53,7 @@ #include "ED_anim_api.h" #include "ED_space_api.h" #include "ED_screen.h" - -#include "BIF_transform.h" +#include "ED_transform.h" #include "WM_api.h" #include "WM_types.h" -- cgit v1.2.3 From 1e85785704c8602ed90e2feae99b94735eec4d33 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 10 Jul 2009 04:25:49 +0000 Subject: PyRNA api wasnt using python subclasses most of the time. Now this will return True isinstance(bpy.data.meshes[0], bpy.types.Mesh) Use the StructRNA identifier for the new classes name properties because classes were being named by the data names rather then the type names. Set the __module__ for the new type which makes printing the class not use the script name where the type is first initialized. eg: bpy.types.Mesh instead of buttons_object.Mesh This still isnt quite right since opertators and panels all get their own type, when they should all use an operator type. --- source/blender/makesrna/RNA_access.h | 1 + source/blender/makesrna/intern/rna_access.c | 5 ++ source/blender/python/intern/bpy_rna.c | 72 +++++++++++++++++++---------- 3 files changed, 54 insertions(+), 24 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index e145722428c..3b2520c41b2 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -496,6 +496,7 @@ int RNA_struct_ui_icon(StructRNA *type); PropertyRNA *RNA_struct_name_property(StructRNA *type); PropertyRNA *RNA_struct_iterator_property(StructRNA *type); +StructRNA *RNA_struct_base(StructRNA *type); int RNA_struct_is_ID(StructRNA *type); int RNA_struct_is_a(StructRNA *type, StructRNA *srna); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index cc8704dc350..eb53d0fbf51 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -392,6 +392,11 @@ PropertyRNA *RNA_struct_iterator_property(StructRNA *type) return type->iteratorproperty; } +StructRNA *RNA_struct_base(StructRNA *type) +{ + return type->base; +} + int RNA_struct_is_ID(StructRNA *type) { return (type->flag & STRUCT_ID) != 0; diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index bf2f41389cc..8314a3cc89c 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -2175,40 +2175,54 @@ static void pyrna_subtype_set_rna(PyObject *newclass, StructRNA *srna) PyObject* pyrna_struct_Subtype(PointerRNA *ptr) { PyObject *newclass = NULL; - PropertyRNA *nameprop; + StructRNA *srna, *base; + + if(ptr->type == &RNA_Struct) + srna= ptr->data; + else + srna= ptr->type; - if (ptr->type==NULL) { + if (srna == NULL) { newclass= NULL; /* Nothing to do */ - } else if ((newclass= RNA_struct_py_type_get(ptr->data))) { + } else if ((newclass= RNA_struct_py_type_get(srna))) { Py_INCREF(newclass); - } else if ((nameprop = RNA_struct_name_property(ptr->type))) { + } else { /* for now, return the base RNA type rather then a real module */ - /* Assume RNA_struct_py_type_get(ptr->data) was alredy checked */ + /* Assume RNA_struct_py_type_get(srna) was alredy checked */ /* subclass equivelents - class myClass(myBase): some='value' # or ... - - myClass = type(name='myClass', bases=(myBase,), dict={'some':'value'}) + - myClass = type(name='myClass', bases=(myBase,), dict={'__module__':'bpy.types'}) */ - char name[256], *nameptr; - const char *descr= RNA_struct_ui_description(ptr->type); + const char *descr= RNA_struct_ui_description(srna); PyObject *args = PyTuple_New(3); PyObject *bases = PyTuple_New(1); + PyObject *py_base= NULL; PyObject *dict = PyDict_New(); PyObject *item; - nameptr= RNA_property_string_get_alloc(ptr, nameprop, name, sizeof(name)); - // arg 1 //PyTuple_SET_ITEM(args, 0, PyUnicode_FromString(tp_name)); - PyTuple_SET_ITEM(args, 0, PyUnicode_FromString(nameptr)); + PyTuple_SET_ITEM(args, 0, PyUnicode_FromString(RNA_struct_identifier(srna))); // arg 2 - PyTuple_SET_ITEM(bases, 0, (PyObject *)&pyrna_struct_Type); - Py_INCREF(&pyrna_struct_Type); +#if 0 // XXX - This should be possible but for some reason it does a recursive call for MirrorModifier + base= RNA_struct_base(srna); + if(base && base != srna) { + // printf("debug subtype %s\n", RNA_struct_identifier(srna)); + py_base= pyrna_struct_Subtype(base); + } +#endif + if(py_base==NULL) { + py_base= &pyrna_struct_Type; + Py_INCREF(py_base); + } + + PyTuple_SET_ITEM(bases, 0, py_base); PyTuple_SET_ITEM(args, 1, bases); @@ -2219,6 +2233,13 @@ PyObject* pyrna_struct_Subtype(PointerRNA *ptr) Py_DECREF(item); } + /* this isnt needed however its confusing if we get python script names in blender types, + * because the __module__ is used when printing the class */ + item= PyUnicode_FromString("bpy.types"); /* just to know its an internal type */ + PyDict_SetItemString(dict, "__module__", item); + Py_DECREF(item); + + PyTuple_SET_ITEM(args, 2, dict); // fill with useful subclass things! if (PyErr_Occurred()) { @@ -2229,11 +2250,15 @@ PyObject* pyrna_struct_Subtype(PointerRNA *ptr) newclass = PyObject_CallObject((PyObject *)&PyType_Type, args); Py_DECREF(args); - if (newclass) - pyrna_subtype_set_rna(newclass, ptr->data); - - if (name != nameptr) - MEM_freeN(nameptr); + if (newclass) { + pyrna_subtype_set_rna(newclass, srna); + // PyObSpit("NewStructRNA Type: ", (PyObject *)newclass); + } + else { + /* this should not happen */ + PyErr_Print(); + PyErr_Clear(); + } } return newclass; @@ -2247,8 +2272,7 @@ PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr ) if (ptr->data==NULL && ptr->type==NULL) { /* Operator RNA has NULL data */ Py_RETURN_NONE; } - - if (ptr->type == &RNA_Struct) { /* always return a python subtype from rna struct types */ + else { PyTypeObject *tp = (PyTypeObject *)pyrna_struct_Subtype(ptr); if (tp) { @@ -2259,10 +2283,7 @@ PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr ) pyrna = ( BPy_StructRNA * ) PyObject_NEW( BPy_StructRNA, &pyrna_struct_Type ); } } - else { - pyrna = ( BPy_StructRNA * ) PyObject_NEW( BPy_StructRNA, &pyrna_struct_Type ); - } - + if( !pyrna ) { PyErr_SetString( PyExc_MemoryError, "couldn't create BPy_StructRNA object" ); return NULL; @@ -2270,6 +2291,9 @@ PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr ) pyrna->ptr= *ptr; pyrna->freeptr= 0; + + // PyObSpit("NewStructRNA: ", (PyObject *)pyrna); + return ( PyObject * ) pyrna; } -- cgit v1.2.3 From 6f0de59c551235d5e26281eca6e172d08ff5eb73 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 10 Jul 2009 10:48:25 +0000 Subject: NLA SoC: Notifier Fixes for Animation Editors I've gone through all the Animation Editor operators, making sure they send appropriate notifiers, and that these notifiers are handled. * Added a separate category for animation-related notifiers, since the old-style ones attached to specific datatypes only was turning out to be not too feasible. * For now, the focus has been on making sure that all Animation Editors update when there have been any potentially suitable changes at all. Later on, we can filter these more carefully to only take the ones we really need (for optimisation purposes) --- source/blender/editors/animation/anim_channels.c | 77 ++++++++++++++++------ source/blender/editors/animation/anim_deps.c | 70 ++------------------ .../blender/editors/animation/keyframes_general.c | 2 + source/blender/editors/animation/keyingsets.c | 6 ++ source/blender/editors/include/ED_anim_api.h | 13 ---- source/blender/editors/space_action/action_edit.c | 49 +++++++------- .../blender/editors/space_action/action_select.c | 15 +++-- source/blender/editors/space_action/space_action.c | 9 +++ source/blender/editors/space_graph/graph_edit.c | 62 ++++++++--------- source/blender/editors/space_graph/graph_select.c | 13 ++-- source/blender/editors/space_graph/space_graph.c | 6 ++ source/blender/editors/space_nla/nla_channels.c | 53 ++++++++++++--- source/blender/editors/space_nla/nla_edit.c | 49 +++++--------- source/blender/editors/space_nla/nla_select.c | 7 +- source/blender/editors/space_nla/space_nla.c | 15 ++++- source/blender/editors/space_view3d/space_view3d.c | 9 +++ source/blender/editors/transform/transform.c | 22 ++----- source/blender/windowmanager/WM_types.h | 11 ++++ 18 files changed, 260 insertions(+), 228 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index 5e9abd42aeb..1cf553f6f26 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -614,8 +614,8 @@ static int animchannels_rearrange_exec(bContext *C, wmOperator *op) mode= RNA_enum_get(op->ptr, "direction"); rearrange_action_channels(&ac, mode); - /* set notifier tha things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_CHANNELS); + /* send notifier that things have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL); return OPERATOR_FINISHED; } @@ -728,8 +728,8 @@ static int animchannels_visibility_toggle_exec(bContext *C, wmOperator *op) /* cleanup */ BLI_freelistN(&anim_data); - /* set notifier tha things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_CHANNELS); + /* send notifier that things have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL); return OPERATOR_FINISHED; } @@ -992,8 +992,8 @@ static int animchannels_setflag_exec(bContext *C, wmOperator *op) /* modify setting */ setflag_anim_channels(&ac, setting, mode, 1); - /* set notifier tha things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_CHANNELS); + /* send notifier that things have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL); return OPERATOR_FINISHED; } @@ -1101,8 +1101,8 @@ static int animchannels_expand_exec (bContext *C, wmOperator *op) /* modify setting */ setflag_anim_channels(&ac, ACHANNEL_SETTING_EXPAND, ACHANNEL_SETFLAG_ADD, onlysel); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_CHANNELS); + /* send notifier that things have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL); return OPERATOR_FINISHED; } @@ -1142,8 +1142,8 @@ static int animchannels_collapse_exec (bContext *C, wmOperator *op) /* modify setting */ setflag_anim_channels(&ac, ACHANNEL_SETTING_EXPAND, ACHANNEL_SETFLAG_CLEAR, onlysel); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_CHANNELS); + /* send notifier that things have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL); return OPERATOR_FINISHED; } @@ -1181,8 +1181,8 @@ static int animchannels_deselectall_exec(bContext *C, wmOperator *op) else ANIM_deselect_anim_channels(ac.data, ac.datatype, 1, ACHANNEL_SETFLAG_ADD); - /* set notifier tha things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_CHANNELS); + /* send notifier that things have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_SELECT, NULL); return OPERATOR_FINISHED; } @@ -1310,6 +1310,9 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op) /* apply borderselect animation channels */ borderselect_anim_channels(&ac, &rect, selectmode); + /* send notifier that things have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_SELECT, NULL); + return OPERATOR_FINISHED; } @@ -1344,11 +1347,12 @@ void ANIM_OT_channels_select_border(wmOperatorType *ot) * NOTE: eventually, this should probably be phased out when many of these things are replaced with buttons */ -static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, short selectmode) +static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, short selectmode) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; + int notifierFlags = 0; /* get the channel that was clicked on */ /* filter channels */ @@ -1362,7 +1366,7 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s printf("Error: animation channel (index = %d) not found in mouse_anim_channels() \n", channel_index); BLI_freelistN(&anim_data); - return; + return 0; } /* selectmode -1 is a special case for ActionGroups only, which selects all of the channels underneath it only... */ @@ -1370,7 +1374,7 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s if ((selectmode == -1) && (ale->type != ANIMTYPE_GROUP)) { /* normal channels should not behave normally in this case */ BLI_freelistN(&anim_data); - return; + return 0; } /* action to take depends on what channel we've got */ @@ -1382,6 +1386,8 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s if (x < 16) { /* toggle expand */ sce->flag ^= SCE_DS_COLLAPSED; + + notifierFlags |= ND_ANIMCHAN_EDIT; } else { /* set selection status */ @@ -1392,6 +1398,8 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s else { sce->flag |= SCE_DS_SELECTED; } + + notifierFlags |= ND_ANIMCHAN_SELECT; } } break; @@ -1405,6 +1413,8 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s if (x < 16) { /* toggle expand */ ob->nlaflag ^= OB_ADS_COLLAPSED; // XXX + + notifierFlags |= ND_ANIMCHAN_EDIT; } else { /* set selection status */ @@ -1429,6 +1439,8 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s /* xxx should be ED_base_object_activate(), but we need context pointer for that... */ //set_active_base(base); + + notifierFlags |= ND_ANIMCHAN_SELECT; } } break; @@ -1436,18 +1448,21 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s { bAction *act= (bAction *)ale->data; act->flag ^= ACT_COLLAPSED; + notifierFlags |= ND_ANIMCHAN_EDIT; } break; case ANIMTYPE_FILLDRIVERS: { AnimData *adt= (AnimData* )ale->data; adt->flag ^= ADT_DRIVERS_COLLAPSED; + notifierFlags |= ND_ANIMCHAN_EDIT; } break; case ANIMTYPE_FILLMATD: { Object *ob= (Object *)ale->data; ob->nlaflag ^= OB_ADS_SHOWMATS; // XXX + notifierFlags |= ND_ANIMCHAN_EDIT; } break; @@ -1455,36 +1470,42 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s { Material *ma= (Material *)ale->data; ma->flag ^= MA_DS_EXPAND; + notifierFlags |= ND_ANIMCHAN_EDIT; } break; case ANIMTYPE_DSLAM: { Lamp *la= (Lamp *)ale->data; la->flag ^= LA_DS_EXPAND; + notifierFlags |= ND_ANIMCHAN_EDIT; } break; case ANIMTYPE_DSCAM: { Camera *ca= (Camera *)ale->data; ca->flag ^= CAM_DS_EXPAND; + notifierFlags |= ND_ANIMCHAN_EDIT; } break; case ANIMTYPE_DSCUR: { Curve *cu= (Curve *)ale->data; cu->flag ^= CU_DS_EXPAND; + notifierFlags |= ND_ANIMCHAN_EDIT; } break; case ANIMTYPE_DSSKEY: { Key *key= (Key *)ale->data; key->flag ^= KEYBLOCK_DS_EXPAND; + notifierFlags |= ND_ANIMCHAN_EDIT; } break; case ANIMTYPE_DSWOR: { World *wo= (World *)ale->data; wo->flag ^= WO_DS_EXPAND; + notifierFlags |= ND_ANIMCHAN_EDIT; } break; @@ -1496,18 +1517,22 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s if ((x < (offset+17)) && (agrp->channels.first)) { /* toggle expand */ agrp->flag ^= AGRP_EXPANDED; + notifierFlags |= ND_ANIMCHAN_EDIT; } else if ((x < (offset+32)) && (ac->spacetype==SPACE_IPO)) { /* toggle visibility (of grouped F-Curves in Graph editor) */ agrp->flag ^= AGRP_NOTVISIBLE; + notifierFlags |= ND_ANIMCHAN_EDIT; } else if (x >= (ACHANNEL_NAMEWIDTH-ACHANNEL_BUTTON_WIDTH)) { /* toggle protection/locking */ agrp->flag ^= AGRP_PROTECTED; + notifierFlags |= ND_ANIMCHAN_EDIT; } else if (x >= (ACHANNEL_NAMEWIDTH-2*ACHANNEL_BUTTON_WIDTH)) { /* toggle mute */ agrp->flag ^= AGRP_MUTED; + notifierFlags |= ND_ANIMCHAN_EDIT; } else { /* select/deselect group */ @@ -1536,6 +1561,8 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s /* if group is selected now, make group the 'active' one in the visible list */ if (agrp->flag & AGRP_SELECTED) ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, agrp, ANIMTYPE_GROUP); + + notifierFlags |= ND_ANIMCHAN_SELECT; } } break; @@ -1556,16 +1583,20 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s if (x >= (ACHANNEL_NAMEWIDTH-ACHANNEL_BUTTON_WIDTH)) { /* toggle protection (only if there's a toggle there) */ - if (fcu->bezt) + if (fcu->bezt) { fcu->flag ^= FCURVE_PROTECTED; + notifierFlags |= ND_ANIMCHAN_EDIT; + } } else if (x >= (ACHANNEL_NAMEWIDTH-2*ACHANNEL_BUTTON_WIDTH)) { /* toggle mute */ fcu->flag ^= FCURVE_MUTED; + notifierFlags |= ND_ANIMCHAN_EDIT; } else if ((x < (offset+17)) && (ac->spacetype==SPACE_IPO)) { /* toggle visibility */ fcu->flag ^= FCURVE_VISIBLE; + notifierFlags |= ND_ANIMCHAN_EDIT; } else { /* select/deselect */ @@ -1582,6 +1613,8 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s /* if F-Curve is selected now, make F-Curve the 'active' one in the visible list */ if (fcu->flag & FCURVE_SELECTED) ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE); + + notifierFlags |= ND_ANIMCHAN_SELECT; } } break; @@ -1591,6 +1624,8 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s /* toggle expand */ gpd->flag ^= GP_DATA_EXPAND; + + notifierFlags |= ND_ANIMCHAN_EDIT; } break; case ANIMTYPE_GPLAYER: @@ -1629,6 +1664,9 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s /* free channels */ BLI_freelistN(&anim_data); + + /* return notifier flags */ + return notifierFlags; } /* ------------------- */ @@ -1641,6 +1679,7 @@ static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent * ARegion *ar; View2D *v2d; int mval[2], channel_index; + int notifierFlags = 0; short selectmode; float x, y; @@ -1675,10 +1714,10 @@ static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent * UI_view2d_listview_view_to_cell(v2d, ACHANNEL_NAMEWIDTH, ACHANNEL_STEP, 0, (float)ACHANNEL_HEIGHT_HALF, x, y, NULL, &channel_index); /* handle mouse-click in the relevant channel then */ - mouse_anim_channels(&ac, x, channel_index, selectmode); + notifierFlags= mouse_anim_channels(&ac, x, channel_index, selectmode); - /* set notifier tha things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_CHANNELS); + /* set notifier that things have changed */ + WM_event_add_notifier(C, NC_ANIMATION|notifierFlags, NULL); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index 1ff2169bf61..13667159fe0 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -77,72 +77,6 @@ void ED_anim_object_flush_update(const bContext *C, Object *ob) } -/* **************************** animation tool notifiers ******************************** */ - -/* Send notifiers on behalf of animation editing tools, based on various context info - * - data_changed: eAnimData_Changed - */ -void ANIM_animdata_send_notifiers (bContext *C, bAnimContext *ac, short data_changed) -{ - /* types of notifiers to send, depends on the editor context */ - switch (ac->datatype) { - case ANIMCONT_DOPESHEET: /* dopesheet */ - case ANIMCONT_FCURVES: /* fcurve editor */ - case ANIMCONT_DRIVERS: /* drivers editor */ // XXX probably this will need separate handling, since these are part of dependency system - { - /* what action was taken */ - switch (data_changed) { - case ANIM_CHANGED_KEYFRAMES_VALUES: - /* keyframe values changed, so transform may have changed */ - // XXX what about other cases? maybe we need general ND_KEYFRAMES or ND_ANIMATION? - WM_event_add_notifier(C, NC_OBJECT|ND_KEYS|ND_TRANSFORM, NULL); - break; - case ANIM_CHANGED_KEYFRAMES_SELECT: - WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, NULL); - break; - case ANIM_CHANGED_CHANNELS: - // XXX err... check available datatypes in dopesheet first? - // FIXME: this currently doesn't work (to update own view) - WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE|ND_OB_SELECT, ac->scene); - WM_event_add_notifier(C, NC_OBJECT|ND_BONE_ACTIVE|ND_BONE_SELECT, NULL); - break; - } - - // XXX for now, at least update own editor! - ED_area_tag_redraw(CTX_wm_area(C)); - } - break; - - case ANIMCONT_ACTION: /* action editor */ - { - Object *obact= CTX_data_active_object(C); - - switch (data_changed) { - case ANIM_CHANGED_KEYFRAMES_VALUES: - /* keyframe values changed, so transform may have changed */ - // XXX what about other cases? maybe we need general ND_KEYFRAMES or ND_ANIMATION? - WM_event_add_notifier(C, NC_OBJECT|ND_KEYS|ND_TRANSFORM, obact); - break; - case ANIM_CHANGED_KEYFRAMES_SELECT: - WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, obact); - break; - case ANIM_CHANGED_CHANNELS: - // XXX err... check available datatypes in dopesheet first? - // FIXME: this currently doesn't work (to update own view) - WM_event_add_notifier(C, NC_OBJECT|ND_BONE_ACTIVE|ND_BONE_SELECT, obact); - break; - } - - // XXX for now, at least update own editor! - ED_area_tag_redraw(CTX_wm_area(C)); - } - break; - - default: /* some other data... just update area for now */ - ED_area_tag_redraw(CTX_wm_area(C)); - } -} - /* **************************** pose <-> action syncing ******************************** */ /* Summary of what needs to be synced between poses and actions: * 1) Flags @@ -152,6 +86,10 @@ void ANIM_animdata_send_notifiers (bContext *C, bAnimContext *ac, short data_cha * 3) Grouping (only for pose to action for now) */ +/* XXX OBSOLETE CODE WARNING: + * With the Animato system, the code below is somewhat obsolete now... + */ + /* Notifier from Action/Dopesheet (this may be extended to include other things such as Python...) * Channels in action changed, so update pose channels/groups to reflect changes. * diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 48ca06fb73d..6e62b163ca9 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -52,6 +52,8 @@ #include "ED_keyframing.h" #include "ED_keyframes_edit.h" +#include "RNA_access.h" + /* This file contains code for various keyframe-editing tools which are 'destructive' * (i.e. they will modify the order of the keyframes, and change the size of the array). * While some of these tools may eventually be moved out into blenkernel, for now, it is diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 240089d26a6..0f8de7f607d 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -1085,6 +1085,9 @@ int modify_keyframes (bContext *C, ListBase *dsources, bAction *act, KeyingSet * case ID_MA: /* Material Keyframes */ WM_event_add_notifier(C, NC_MATERIAL|ND_KEYS, ksp->id); break; + default: /* Any keyframes */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + break; } } } @@ -1191,6 +1194,9 @@ int modify_keyframes (bContext *C, ListBase *dsources, bAction *act, KeyingSet * case ID_MA: /* Material Keyframes */ WM_event_add_notifier(C, NC_MATERIAL|ND_KEYS, cks->id); break; + default: /* Any keyframes */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + break; } } } diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 2745be978d2..cc18c81fe51 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -315,7 +315,6 @@ void ANIM_draw_previewrange(const struct bContext *C, struct View2D *v2d); struct uiLayout; /* draw a given F-Modifier for some layout/UI-Block */ -// XXX not quite complete yet void ANIM_uiTemplate_fmodifier_draw(struct uiLayout *layout, struct ID *id, ListBase *modifiers, struct FModifier *fcm); /* ************************************************* */ @@ -385,18 +384,6 @@ void ED_anim_object_flush_update(const struct bContext *C, struct Object *ob); void ANIM_action_to_pose_sync(struct Object *ob); void ANIM_pose_to_action_sync(struct Object *ob, struct ScrArea *sa); - -/* what types of animation data was changed (for sending notifiers from animation tools) */ -enum { - ANIM_CHANGED_BOTH= 0, - ANIM_CHANGED_KEYFRAMES_VALUES, - ANIM_CHANGED_KEYFRAMES_SELECT, - ANIM_CHANGED_CHANNELS -} eAnimData_Changed; - -/* Send notifiers on behalf of animation editing tools, based on various context info */ -void ANIM_animdata_send_notifiers(struct bContext *C, bAnimContext *ac, short data_changed); - /* ************************************************* */ /* OPERATORS */ diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 04dda2e6c4c..8d2d342e28a 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -214,7 +214,7 @@ static int actkeys_viewall_exec(bContext *C, wmOperator *op) /* do View2D syncing */ UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY); - /* set notifier that things have changed */ + /* just redraw this view */ ED_area_tag_redraw(CTX_wm_area(C)); return OPERATOR_FINISHED; @@ -301,9 +301,6 @@ static int actkeys_copy_exec(bContext *C, wmOperator *op) } } - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); - return OPERATOR_FINISHED; } @@ -345,8 +342,8 @@ static int actkeys_paste_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -441,8 +438,8 @@ static int actkeys_insertkey_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -508,8 +505,8 @@ static int actkeys_duplicate_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; // xxx - start transform } @@ -585,8 +582,8 @@ static int actkeys_delete_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -648,8 +645,8 @@ static int actkeys_clean_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -772,8 +769,8 @@ static int actkeys_sample_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -847,8 +844,8 @@ static int actkeys_expo_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframe properties have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); return OPERATOR_FINISHED; } @@ -917,8 +914,8 @@ static int actkeys_ipo_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframe properties have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); return OPERATOR_FINISHED; } @@ -1005,8 +1002,8 @@ static int actkeys_handletype_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframe properties have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); return OPERATOR_FINISHED; } @@ -1169,8 +1166,8 @@ static int actkeys_snap_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -1285,8 +1282,8 @@ static int actkeys_mirror_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 8f95f5ea52d..d9e6bb10ceb 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -174,8 +174,8 @@ static int actkeys_deselectall_exec(bContext *C, wmOperator *op) else deselect_action_keys(&ac, 1, SELECT_ADD); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + /* set notifier that keyframe selection have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL); return OPERATOR_FINISHED; } @@ -337,6 +337,9 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op) /* apply borderselect action */ borderselect_action(&ac, rect, mode, selectmode); + /* set notifier that keyframe selection have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL); + return OPERATOR_FINISHED; } @@ -551,8 +554,8 @@ static int actkeys_columnselect_exec(bContext *C, wmOperator *op) else columnselect_action_keys(&ac, mode); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_SELECT); + /* set notifier that keyframe selection have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL); return OPERATOR_FINISHED; } @@ -954,8 +957,8 @@ static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even mouse_action_keys(&ac, mval, selectmode, column); } - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + /* set notifier that keyframe selection (and channels too) have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT|ND_ANIMCHAN_SELECT, NULL); /* for tweak grab to work */ return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index b4e43c29c3d..0b06499693c 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -288,6 +288,9 @@ static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ switch(wmn->category) { + case NC_ANIMATION: + ED_region_tag_redraw(ar); + break; case NC_SCENE: switch(wmn->data) { case ND_OB_ACTIVE: @@ -314,6 +317,9 @@ static void action_main_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ switch(wmn->category) { + case NC_ANIMATION: + ED_region_tag_redraw(ar); + break; case NC_SCENE: switch(wmn->data) { case ND_OB_ACTIVE: @@ -344,6 +350,9 @@ static void action_listener(ScrArea *sa, wmNotifier *wmn) { /* context changes */ switch (wmn->category) { + case NC_ANIMATION: + ED_area_tag_refresh(sa); + break; case NC_SCENE: /*switch (wmn->data) { case ND_OB_ACTIVE: diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 86970f3565c..1837b6d4ecd 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -474,8 +474,8 @@ static int graphkeys_insertkey_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -532,8 +532,8 @@ static int graphkeys_click_insert_exec (bContext *C, wmOperator *op) /* free temp data */ MEM_freeN(ale); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -644,9 +644,7 @@ static int graphkeys_copy_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); - + /* just return - no operator needed here (no changes) */ return OPERATOR_FINISHED; } @@ -683,8 +681,8 @@ static int graphkeys_paste_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -740,8 +738,8 @@ static int graphkeys_duplicate_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -811,8 +809,8 @@ static int graphkeys_delete_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -872,8 +870,8 @@ static int graphkeys_clean_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -953,8 +951,9 @@ static int graphkeys_bake_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + // NOTE: some distinction between order/number of keyframes and type should be made? + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -1079,8 +1078,8 @@ static int graphkeys_sample_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -1153,8 +1152,8 @@ static int graphkeys_expo_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframe properties have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); return OPERATOR_FINISHED; } @@ -1221,8 +1220,8 @@ static int graphkeys_ipo_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframe properties have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); return OPERATOR_FINISHED; } @@ -1309,7 +1308,7 @@ static int graphkeys_handletype_exec(bContext *C, wmOperator *op) ANIM_editkeyframes_refresh(&ac); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); return OPERATOR_FINISHED; } @@ -1554,8 +1553,8 @@ static int graphkeys_snap_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -1665,8 +1664,8 @@ static int graphkeys_mirror_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -1719,8 +1718,8 @@ static int graphkeys_smooth_exec(bContext *C, wmOperator *op) /* validate keyframes after editing */ ANIM_editkeyframes_refresh(&ac); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES); + /* set notifier that keyframes have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); return OPERATOR_FINISHED; } @@ -1810,7 +1809,8 @@ static int graph_fmodifier_add_exec(bContext *C, wmOperator *op) ANIM_editkeyframes_refresh(&ac); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + // FIXME: this really isn't the best description for it... + WM_event_add_notifier(C, NC_ANIMATION, NULL); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index c855222df02..a78cacb42ef 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -169,7 +169,7 @@ static int graphkeys_deselectall_exec(bContext *C, wmOperator *op) deselect_graph_keys(&ac, 1, SELECT_ADD); /* set notifier that things have changed */ - ED_area_tag_redraw(CTX_wm_area(C)); // FIXME... should be updating 'keyframes' data context or so instead! + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL); return OPERATOR_FINISHED; } @@ -302,6 +302,9 @@ static int graphkeys_borderselect_exec(bContext *C, wmOperator *op) /* apply borderselect action */ borderselect_graphkeys(&ac, rect, mode, selectmode); + /* send notifier that keyframe selection has changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL); + return OPERATOR_FINISHED; } @@ -492,8 +495,8 @@ static int graphkeys_columnselect_exec(bContext *C, wmOperator *op) else columnselect_graph_keys(&ac, mode); - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_SELECT); + /* set notifier that keyframe selection has changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL); return OPERATOR_FINISHED; } @@ -911,8 +914,8 @@ static int graphkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *ev mouse_graph_keys(&ac, mval, selectmode, 0); } - /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + /* set notifier that keyframe selection (and also channel selection in some cases) has changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT|ND_ANIMCHAN_SELECT, NULL); /* for tweak grab to work */ return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 2f3700bc733..a5578e88076 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -365,6 +365,9 @@ static void graph_region_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ switch(wmn->category) { + case NC_ANIMATION: + ED_region_tag_redraw(ar); + break; case NC_SCENE: switch(wmn->data) { case ND_OB_ACTIVE: @@ -395,6 +398,9 @@ static void graph_listener(ScrArea *sa, wmNotifier *wmn) { /* context changes */ switch (wmn->category) { + case NC_ANIMATION: + ED_area_tag_refresh(sa); + break; case NC_SCENE: /*switch (wmn->data) { case ND_OB_ACTIVE: diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 5a891a541cb..1ab348eb28e 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -89,11 +89,12 @@ * NOTE: eventually, this should probably be phased out when many of these things are replaced with buttons */ -static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, short selectmode) +static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, short selectmode) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; + int notifierFlags = 0; /* get the channel that was clicked on */ /* filter channels */ @@ -107,7 +108,7 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh printf("Error: animation channel (index = %d) not found in mouse_anim_channels() \n", channel_index); BLI_freelistN(&anim_data); - return; + return 0; } /* action to take depends on what channel we've got */ @@ -119,6 +120,8 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh if (x < 16) { /* toggle expand */ sce->flag ^= SCE_DS_COLLAPSED; + + notifierFlags |= ND_ANIMCHAN_EDIT; } else { /* set selection status */ @@ -129,6 +132,8 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh else { sce->flag |= SCE_DS_SELECTED; } + + notifierFlags |= ND_ANIMCHAN_SELECT; } } break; @@ -141,7 +146,8 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh if (x < 16) { /* toggle expand */ - ob->nlaflag ^= OB_ADS_COLLAPSED; // XXX + ob->nlaflag ^= OB_ADS_COLLAPSED; // XXX + notifierFlags |= ND_ANIMCHAN_EDIT; } else if (nlaedit_is_tweakmode_on(ac) == 0) { /* set selection status */ @@ -166,6 +172,9 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh /* xxx should be ED_base_object_activate(), but we need context pointer for that... */ //set_active_base(base); + + /* notifiers - channel was selected */ + notifierFlags |= ND_ANIMCHAN_SELECT; } } break; @@ -173,6 +182,7 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh { Object *ob= (Object *)ale->data; ob->nlaflag ^= OB_ADS_SHOWMATS; // XXX + notifierFlags |= ND_ANIMCHAN_EDIT; } break; @@ -180,36 +190,42 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh { Material *ma= (Material *)ale->data; ma->flag ^= MA_DS_EXPAND; + notifierFlags |= ND_ANIMCHAN_EDIT; } break; case ANIMTYPE_DSLAM: { Lamp *la= (Lamp *)ale->data; la->flag ^= LA_DS_EXPAND; + notifierFlags |= ND_ANIMCHAN_EDIT; } break; case ANIMTYPE_DSCAM: { Camera *ca= (Camera *)ale->data; ca->flag ^= CAM_DS_EXPAND; + notifierFlags |= ND_ANIMCHAN_EDIT; } break; case ANIMTYPE_DSCUR: { Curve *cu= (Curve *)ale->data; cu->flag ^= CU_DS_EXPAND; + notifierFlags |= ND_ANIMCHAN_EDIT; } break; case ANIMTYPE_DSSKEY: { Key *key= (Key *)ale->data; key->flag ^= KEYBLOCK_DS_EXPAND; + notifierFlags |= ND_ANIMCHAN_EDIT; } break; case ANIMTYPE_DSWOR: { World *wo= (World *)ale->data; wo->flag ^= WO_DS_EXPAND; + notifierFlags |= ND_ANIMCHAN_EDIT; } break; @@ -233,14 +249,23 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh if (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) { /* toggle protection (only if there's a toggle there) */ nlt->flag ^= NLATRACK_PROTECTED; + + /* notifier flags - channel was edited */ + notifierFlags |= ND_ANIMCHAN_EDIT; } else if (x >= (NLACHANNEL_NAMEWIDTH-2*NLACHANNEL_BUTTON_WIDTH)) { /* toggle mute */ nlt->flag ^= NLATRACK_MUTED; + + /* notifier flags - channel was edited */ + notifierFlags |= ND_ANIMCHAN_EDIT; } else if (x <= ((NLACHANNEL_BUTTON_WIDTH*2)+offset)) { /* toggle 'solo' */ BKE_nlatrack_solo_toggle(adt, nlt); + + /* notifier flags - channel was edited */ + notifierFlags |= ND_ANIMCHAN_EDIT; } else if (nlaedit_is_tweakmode_on(ac) == 0) { /* set selection */ @@ -257,6 +282,9 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh /* if NLA-Track is selected now, make NLA-Track the 'active' one in the visible list */ if (nlt->flag & NLATRACK_SELECTED) ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, nlt, ANIMTYPE_NLATRACK); + + /* notifier flags - channel was selected */ + notifierFlags |= ND_ANIMCHAN_SELECT; } } break; @@ -275,6 +303,9 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh /* when in tweakmode, this button becomes the toggle for mapped editing */ adt->flag ^= ADT_NLA_EDIT_NOMAP; } + + /* changes to NLA-Action occurred */ + notifierFlags |= ND_NLA_ACTCHANGE; } } break; @@ -285,6 +316,9 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh /* free channels */ BLI_freelistN(&anim_data); + + /* return the notifier-flags set */ + return notifierFlags; } /* ------------------- */ @@ -297,6 +331,7 @@ static int nlachannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *e ARegion *ar; View2D *v2d; int mval[2], channel_index; + int notifierFlags = 0; short selectmode; float x, y; @@ -328,10 +363,10 @@ static int nlachannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *e UI_view2d_listview_view_to_cell(v2d, NLACHANNEL_NAMEWIDTH, NLACHANNEL_STEP, 0, (float)NLACHANNEL_HEIGHT_HALF, x, y, NULL, &channel_index); /* handle mouse-click in the relevant channel then */ - mouse_nla_channels(&ac, x, channel_index, selectmode); + notifierFlags= mouse_nla_channels(&ac, x, channel_index, selectmode); - /* set notifier tha things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_CHANNELS); + /* set notifier that things have changed */ + WM_event_add_notifier(C, NC_ANIMATION|notifierFlags, NULL); return OPERATOR_FINISHED; } @@ -401,8 +436,7 @@ static int nlaedit_add_tracks_exec (bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -458,8 +492,7 @@ static int nlaedit_delete_tracks_exec (bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 6cbc9cab253..cb151429dd1 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -127,8 +127,7 @@ static int nlaedit_enable_tweakmode_exec (bContext *C, wmOperator *op) ac.scene->flag |= SCE_NLA_EDIT_ON; /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_ACTCHANGE, NULL); } else { BKE_report(op->reports, RPT_ERROR, "No active strip(s) to enter tweakmode on."); @@ -197,8 +196,7 @@ static int nlaedit_disable_tweakmode_exec (bContext *C, wmOperator *op) ac.scene->flag &= ~SCE_NLA_EDIT_ON; /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_ACTCHANGE, NULL); } /* done */ @@ -315,8 +313,7 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -424,8 +421,7 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op) /* was anything added? */ if (done) { /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -483,8 +479,7 @@ static int nlaedit_add_meta_exec (bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -536,8 +531,7 @@ static int nlaedit_remove_meta_exec (bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -621,8 +615,7 @@ static int nlaedit_duplicate_exec (bContext *C, wmOperator *op) if (done) { /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -707,8 +700,7 @@ static int nlaedit_delete_exec (bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -831,8 +823,7 @@ static int nlaedit_split_exec (bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -894,8 +885,7 @@ static int nlaedit_toggle_mute_exec (bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -966,8 +956,7 @@ static int nlaedit_move_up_exec (bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -1038,8 +1027,7 @@ static int nlaedit_move_down_exec (bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -1137,8 +1125,7 @@ static int nlaedit_apply_scale_exec (bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -1198,8 +1185,7 @@ static int nlaedit_clear_scale_exec (bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -1337,8 +1323,7 @@ static int nlaedit_snap_exec (bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); /* done */ return OPERATOR_FINISHED; @@ -1447,8 +1432,8 @@ static int nla_fmodifier_add_exec(bContext *C, wmOperator *op) BLI_freelistN(&anim_data); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); - WM_event_add_notifier(C, NC_SCENE, NULL); + // FIXME: this doesn't really do it justice... + WM_event_add_notifier(C, NC_ANIMATION, NULL); /* done */ return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 895d0dbf88a..dd9ef2621c5 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -186,7 +186,7 @@ static int nlaedit_deselectall_exec(bContext *C, wmOperator *op) deselect_nla_strips(&ac, DESELECT_STRIPS_TEST, SELECT_ADD); /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_SELECT, NULL); return OPERATOR_FINISHED; } @@ -324,6 +324,9 @@ static int nlaedit_borderselect_exec(bContext *C, wmOperator *op) /* apply borderselect action */ borderselect_nla_strips(&ac, rect, mode, selectmode); + /* set notifier that things have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_SELECT, NULL); + return OPERATOR_FINISHED; } @@ -583,7 +586,7 @@ static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even } /* set notifier that things have changed */ - ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_SELECT, NULL); /* for tweak grab to work */ return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index a7e9844726d..923208f3b35 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -371,6 +371,9 @@ static void nla_region_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ switch(wmn->category) { + case NC_ANIMATION: + ED_region_tag_redraw(ar); + break; case NC_SCENE: switch(wmn->data) { case ND_OB_ACTIVE: @@ -392,7 +395,7 @@ static void nla_region_listener(ARegion *ar, wmNotifier *wmn) default: if(wmn->data==ND_KEYS) ED_region_tag_redraw(ar); - + break; } } @@ -401,6 +404,9 @@ static void nla_main_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ switch(wmn->category) { + case NC_ANIMATION: + ED_region_tag_redraw(ar); + break; case NC_SCENE: switch(wmn->data) { case ND_OB_ACTIVE: @@ -430,6 +436,9 @@ static void nla_channel_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ switch(wmn->category) { + case NC_ANIMATION: + ED_region_tag_redraw(ar); + break; case NC_SCENE: switch(wmn->data) { case ND_OB_ACTIVE: @@ -457,6 +466,10 @@ static void nla_listener(ScrArea *sa, wmNotifier *wmn) { /* context changes */ switch (wmn->category) { + case NC_ANIMATION: + // TODO: filter specific types of changes? + ED_area_tag_refresh(sa); + break; case NC_SCENE: /*switch (wmn->data) { case ND_OB_ACTIVE: diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index f3797ec308b..6c3bb798c18 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -409,6 +409,15 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ switch(wmn->category) { + case NC_ANIMATION: + switch(wmn->data) { + case ND_KEYFRAME_EDIT: + case ND_KEYFRAME_PROP: + case ND_NLA_ACTCHANGE: + case ND_ANIMCHAN_SELECT: + ED_region_tag_redraw(ar); + break; + } case NC_SCENE: switch(wmn->data) { case ND_TRANSFORM: diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 368730b1cfa..016400e0fa9 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -300,27 +300,15 @@ static void viewRedrawForce(bContext *C, TransInfo *t) WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); } else if (t->spacetype == SPACE_ACTION) { - SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first; - - // TRANSFORM_FIX_ME - if (saction->lock) { - // whole window... - } - else - ED_area_tag_redraw(t->sa); + //SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first; + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } else if (t->spacetype == SPACE_IPO) { - SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first; - - // TRANSFORM_FIX_ME - if (sipo->lock) { - // whole window... - } - else - ED_area_tag_redraw(t->sa); + //SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first; + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } else if (t->spacetype == SPACE_NLA) { - ED_area_tag_redraw(t->sa); // XXX this should use a notifier instead! + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } else if(t->spacetype == SPACE_NODE) { diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index e3a7a906fef..432140f1cf7 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -129,6 +129,7 @@ typedef struct wmNotifier { #define NC_TEXT (12<<24) #define NC_WORLD (13<<24) #define NC_FILE (14<<24) +#define NC_ANIMATION (15<<24) /* data type, 256 entries is enough, it can overlap */ #define NOTE_DATA 0x00FF0000 @@ -188,6 +189,16 @@ typedef struct wmNotifier { #define ND_PARAMS (60<<16) #define ND_FILELIST (61<<16) + /* NC_ANIMATION Animato */ +#define ND_KEYFRAME_SELECT (70<<16) +#define ND_KEYFRAME_EDIT (71<<16) +#define ND_KEYFRAME_PROP (72<<16) +#define ND_ANIMCHAN_SELECT (73<<16) +#define ND_ANIMCHAN_EDIT (74<<16) +#define ND_NLA_SELECT (75<<16) +#define ND_NLA_EDIT (76<<16) +#define ND_NLA_ACTCHANGE (77<<16) + /* subtype, 256 entries too */ #define NOTE_SUBTYPE 0x0000FF00 -- cgit v1.2.3 From 146a887b81b45ca92972e037976ccf9205da97ee Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 10 Jul 2009 11:33:01 +0000 Subject: 2.5: Fix for crash on reload file. Cursor grab should not assume there to be a window, but also reload file exec was not returing an OPERATOR_* value. --- source/blender/windowmanager/intern/wm_cursors.c | 3 ++- source/blender/windowmanager/intern/wm_files.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index 5ddd8f5a1a9..79830aca12f 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -158,7 +158,8 @@ void WM_cursor_wait(int val) void WM_cursor_grab(wmWindow *win, int val) { - GHOST_SetCursorGrab(win->ghostwin, val); + if(win) + GHOST_SetCursorGrab(win->ghostwin, val); } /* afer this you can call restore too */ diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 29ec58befd9..51389ef890c 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -334,8 +334,8 @@ int WM_read_homefile(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_WM|ND_FILEREAD, NULL); CTX_wm_window_set(C, NULL); /* exits queues */ - - return success; + + return OPERATOR_FINISHED; } -- cgit v1.2.3 From 3496437585c79d590b18d423d1b34d93f226f296 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 10 Jul 2009 11:36:02 +0000 Subject: 2.5: * RNA: enum items with "" indentifier are now interpreted as separators. * Add Object menu: added consistent names, separators. --- source/blender/editors/interface/interface.c | 8 +++-- .../blender/editors/interface/interface_layout.c | 21 ++++++++----- .../blender/editors/interface/interface_regions.c | 34 ---------------------- source/blender/editors/object/object_edit.c | 27 ++++++++++------- source/blender/makesrna/intern/makesrna.c | 19 ++++++++---- source/blender/makesrna/intern/rna_access.c | 6 ++-- source/blender/makesrna/intern/rna_define.c | 4 +-- source/blender/makesrna/intern/rna_rna.c | 9 +++++- 8 files changed, 62 insertions(+), 66 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index a76fdcbf39d..b84a3ab469c 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2123,7 +2123,9 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, dynstr= BLI_dynstr_new(); BLI_dynstr_appendf(dynstr, "%s%%t", RNA_property_ui_name(prop)); for(i=0; isrna) - return ""; - - RNA_pointer_create(NULL, ot->srna, NULL, &ptr); - prop= RNA_struct_find_property(&ptr, propname); - - if(prop) { - const EnumPropertyItem *item; - int totitem, i; - - RNA_property_enum_items(&ptr, prop, &item, &totitem); - - for (i=0; iitem) { for(a=0; atotitem; a++) - mask |= eprop->item[a].value; + if(eprop->item[a].identifier[0]) + mask |= eprop->item[a].value; } return mask; @@ -971,7 +977,8 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR fprintf(f, "enum {\n"); for(i=0; itotitem; i++) - fprintf(f, "\t%s_%s_%s = %d,\n", srna->identifier, prop->identifier, eprop->item[i].identifier, eprop->item[i].value); + if(eprop->item[i].identifier[0]) + fprintf(f, "\t%s_%s_%s = %d,\n", srna->identifier, prop->identifier, eprop->item[i].identifier, eprop->item[i].value); fprintf(f, "};\n\n"); } @@ -1059,7 +1066,8 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property fprintf(f, "\tenum %s_enum {\n", prop->identifier); for(i=0; itotitem; i++) - fprintf(f, "\t\t%s_%s = %d,\n", prop->identifier, eprop->item[i].identifier, eprop->item[i].value); + if(eprop->item[i].identifier[0]) + fprintf(f, "\t\t%s_%s = %d,\n", prop->identifier, eprop->item[i].identifier, eprop->item[i].value); fprintf(f, "\t};\n"); } @@ -1577,8 +1585,9 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr rna_print_c_string(f, eprop->item[i].name); fprintf(f, ", "); rna_print_c_string(f, eprop->item[i].description); fprintf(f, "}, "); - if(eprop->defaultvalue == eprop->item[i].value) - defaultfound= 1; + if(eprop->item[i].identifier[0]) + if(eprop->defaultvalue == eprop->item[i].value) + defaultfound= 1; } fprintf(f, "{0, NULL, 0, NULL, NULL}};\n\n"); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index eb53d0fbf51..42f6250728f 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -666,7 +666,7 @@ int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *iden RNA_property_enum_items(ptr, prop, &item, NULL); for(; item->identifier; item++) { - if(strcmp(item->identifier, identifier)==0) { + if(item->identifier[0] && strcmp(item->identifier, identifier)==0) { *value = item->value; return 1; } @@ -678,7 +678,7 @@ int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *iden int RNA_enum_identifier(const EnumPropertyItem *item, const int value, const char **identifier) { for (; item->identifier; item++) { - if(item->value==value) { + if(item->identifier[0] && item->value==value) { *identifier = item->identifier; return 1; } @@ -689,7 +689,7 @@ int RNA_enum_identifier(const EnumPropertyItem *item, const int value, const cha int RNA_enum_name(const EnumPropertyItem *item, const int value, const char **name) { for (; item->identifier; item++) { - if(item->value==value) { + if(item->identifier[0] && item->value==value) { *name = item->name; return 1; } diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 2916c1bcb6e..2b414adf05b 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1117,7 +1117,7 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item for(i=0; item[i].identifier; i++) { eprop->totitem++; - if(item[i].value == eprop->defaultvalue) + if(item[i].identifier[0] && item[i].value == eprop->defaultvalue) defaultfound= 1; } @@ -1280,7 +1280,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value) eprop->defaultvalue= value; for(i=0; itotitem; i++) { - if(eprop->item[i].value == eprop->defaultvalue) + if(eprop->item[i].identifier[0] && eprop->item[i].value == eprop->defaultvalue) defaultfound= 1; } diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 557d472afef..0b605db20cf 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -516,6 +516,13 @@ static int rna_StringProperty_max_length_get(PointerRNA *ptr) return ((StringPropertyRNA*)prop)->maxlength; } +static int rna_enum_check_separator(CollectionPropertyIterator *iter, void *data) +{ + EnumPropertyItem *item= (EnumPropertyItem*)data; + + return (item->identifier[0] != 0); +} + static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { PropertyRNA *prop= (PropertyRNA*)ptr->data; @@ -524,7 +531,7 @@ static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, Point rna_idproperty_check(&prop, ptr); eprop= (EnumPropertyRNA*)prop; - rna_iterator_array_begin(iter, (void*)eprop->item, sizeof(eprop->item[0]), eprop->totitem, NULL); + rna_iterator_array_begin(iter, (void*)eprop->item, sizeof(eprop->item[0]), eprop->totitem, rna_enum_check_separator); } static void rna_EnumPropertyItem_identifier_get(PointerRNA *ptr, char *value) -- cgit v1.2.3 From 56d4501d91227b97884c8bf0736a249543fa4ce8 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 10 Jul 2009 11:59:45 +0000 Subject: 2.5: fix to allow python panels to override C panels with the same name. --- source/blender/makesrna/intern/rna_ui.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 9da8c8b2df3..b10ca6c5e83 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -170,6 +170,8 @@ static StructRNA *rna_Panel_register(const bContext *C, ReportList *reports, voi if(strcmp(pt->idname, dummypt.idname) == 0) { if(pt->py_srna) rna_Panel_unregister(C, pt->py_srna); + else + BLI_freelinkN(&art->paneltypes, pt); break; } } -- cgit v1.2.3 From d6ef4380a0d23acb619018fdaf84f5381b71f325 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 10 Jul 2009 12:11:00 +0000 Subject: NLA SoC: Delete Channels operator F-Curves and Groups can now be deleted again from DopeSheet/Graph Editors. --- source/blender/editors/animation/anim_channels.c | 148 ++++++++++++++++++++++- 1 file changed, 142 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index 1cf553f6f26..5c31d007705 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -63,9 +63,10 @@ #include "RNA_access.h" #include "RNA_define.h" +#include "BKE_animsys.h" #include "BKE_action.h" #include "BKE_depsgraph.h" -#include "BKE_ipo.h" +#include "BKE_fcurve.h" #include "BKE_key.h" #include "BKE_material.h" #include "BKE_object.h" @@ -133,7 +134,7 @@ void ANIM_set_active_channel (bAnimContext *ac, void *data, short datatype, int } /* set active flag */ - if (channel_data) { + if (channel_data != NULL) { switch (channel_type) { case ANIMTYPE_GROUP: { @@ -691,6 +692,121 @@ void ANIM_OT_channels_move_bottom (wmOperatorType *ot) #endif // XXX old animation system - needs to be updated for new system... +/* ******************** Delete Channel Operator *********************** */ + +static int animchannels_delete_exec(bContext *C, wmOperator *op) +{ + bAnimContext ac; + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + + /* cannot delete in shapekey */ + if (ac.datatype == ANIMCONT_SHAPEKEY) + return OPERATOR_CANCELLED; + + + /* do groups only first (unless in Drivers mode, where there are none) */ + if (ac.datatype != ANIMCONT_DRIVERS) { + /* filter data */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_CHANNELS | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* delete selected groups and their associated channels */ + for (ale= anim_data.first; ale; ale= ale->next) { + /* only groups - don't check other types yet, since they may no-longer exist */ + if (ale->type == ANIMTYPE_GROUP) { + bActionGroup *agrp= (bActionGroup *)ale->data; + AnimData *adt= BKE_animdata_from_id(ale->id); + FCurve *fcu, *fcn; + + /* skip this group if no AnimData available, as we can't safely remove the F-Curves */ + if (adt == NULL) + continue; + + /* delete all of the Group's F-Curves, but no others */ + for (fcu= agrp->channels.first; fcu && fcu->grp==agrp; fcu= fcn) { + fcn= fcu->next; + + /* remove from group and action, then free */ + action_groups_remove_channel(adt->action, fcu); + free_fcurve(fcu); + } + + /* free the group itself */ + if (adt->action) + BLI_freelinkN(&adt->action->groups, agrp); + else + MEM_freeN(agrp); + } + } + + /* cleanup */ + BLI_freelistN(&anim_data); + } + + /* now do F-Curves */ + if (ac.datatype != ANIMCONT_GPENCIL) { + /* filter data */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* delete selected F-Curves */ + for (ale= anim_data.first; ale; ale= ale->next) { + /* only F-Curves, and only if we can identify its parent */ + if (ale->type == ANIMTYPE_FCURVE) { + AnimData *adt= BKE_animdata_from_id(ale->id); + FCurve *fcu= (FCurve *)ale->data; + + /* if no AnimData, we've got nowhere to remove the F-Curve from */ + if (adt == NULL) + continue; + + /* remove from whatever list it came from + * - Action Group + * - Action + * - Drivers + * - TODO... some others? + */ + if (fcu->grp) + action_groups_remove_channel(adt->action, fcu); + else if (adt->action) + BLI_remlink(&adt->action->curves, fcu); + else if (ac.datatype == ANIMCONT_DRIVERS) + BLI_remlink(&adt->drivers, fcu); + + /* free the F-Curve itself */ + free_fcurve(fcu); + } + } + + /* cleanup */ + BLI_freelistN(&anim_data); + } + + /* send notifier that things have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL); + + return OPERATOR_FINISHED; +} + +void ANIM_OT_channels_delete (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Delete Channels"; + ot->idname= "ANIM_OT_channels_delete"; + + /* api callbacks */ + ot->exec= animchannels_delete_exec; + ot->poll= animedit_poll_channels_active; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} /* ******************** Toggle Channel Visibility Operator *********************** */ @@ -707,7 +823,7 @@ static int animchannels_visibility_toggle_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; /* filter data */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); /* See if we should be making showing all selected or hiding */ @@ -715,14 +831,28 @@ static int animchannels_visibility_toggle_exec(bContext *C, wmOperator *op) if (vis == ACHANNEL_SETFLAG_CLEAR) break; - if (ale->flag & FCURVE_VISIBLE) + if ((ale->type == ANIMTYPE_FCURVE) && (ale->flag & FCURVE_VISIBLE)) + vis= ACHANNEL_SETFLAG_CLEAR; + else if ((ale->type == ANIMTYPE_GROUP) && !(ale->flag & AGRP_NOTVISIBLE)) vis= ACHANNEL_SETFLAG_CLEAR; } /* Now set the flags */ for (ale= anim_data.first; ale; ale= ale->next) { - FCurve *fcu= (FCurve *)ale->data; - ACHANNEL_SET_FLAG(fcu, vis, FCURVE_VISIBLE); + switch (ale->type) { + case ANIMTYPE_FCURVE: /* F-Curve */ + { + FCurve *fcu= (FCurve *)ale->data; + ACHANNEL_SET_FLAG(fcu, vis, FCURVE_VISIBLE); + } + break; + case ANIMTYPE_GROUP: /* Group */ + { + bActionGroup *agrp= (bActionGroup *)ale->data; + ACHANNEL_SET_FLAG_NEG(agrp, vis, AGRP_NOTVISIBLE); + } + break; + } } /* cleanup */ @@ -1753,6 +1883,8 @@ void ED_operatortypes_animchannels(void) WM_operatortype_append(ANIM_OT_channels_setting_disable); WM_operatortype_append(ANIM_OT_channels_setting_toggle); + WM_operatortype_append(ANIM_OT_channels_delete); + // XXX does this need to be a separate operator? WM_operatortype_append(ANIM_OT_channels_editable_toggle); @@ -1786,6 +1918,10 @@ void ED_keymap_animchannels(wmWindowManager *wm) /* borderselect */ WM_keymap_add_item(keymap, "ANIM_OT_channels_select_border", BKEY, KM_PRESS, 0, 0); + /* delete */ + WM_keymap_add_item(keymap, "ANIM_OT_channels_delete", XKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "ANIM_OT_channels_delete", DELKEY, KM_PRESS, 0, 0); + /* settings */ WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_toggle", WKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); -- cgit v1.2.3 From b609f2aa790e122504aad34512d08241c2e01079 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 10 Jul 2009 12:42:17 +0000 Subject: NLA SoC: Attempt at solving the jumping-views problem The 'jumping-views' problem affected the NLA and DopeSheet editors, whereby the channels-list and the data-area would get out of sync (vertically) due to the size calculations of the two being done differently. --- source/blender/editors/space_action/action_draw.c | 2 ++ source/blender/editors/space_nla/nla_draw.c | 2 ++ 2 files changed, 4 insertions(+) (limited to 'source') diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 93d061e8bf3..2fd5b9bbd93 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -422,6 +422,8 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar) */ v2d->tot.ymin= (float)(-height); } + /* need to do a view-sync here, so that the keys area doesn't jump around */ + UI_view2d_sync(NULL, ac->sa, v2d, V2D_VIEWSYNC_AREA_VERTICAL); /* loop through channels, and set up drawing depending on their type */ y= (float)ACHANNEL_FIRST; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 6219acf6fae..7fb15c62277 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -512,6 +512,8 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) * (NOTE: this is ok here, the configuration is pretty straightforward) */ v2d->tot.ymin= (float)(-height); + /* need to do a view-sync here, so that the strips area doesn't jump around */ + UI_view2d_sync(NULL, ac->sa, v2d, V2D_VIEWSYNC_AREA_VERTICAL); /* loop through channels, and set up drawing depending on their type */ y= (float)(-NLACHANNEL_HEIGHT); -- cgit v1.2.3 From 2a7a8a04da7e6e469eb461d8fa6eb2e209a4a9a3 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 10 Jul 2009 13:56:29 +0000 Subject: 2.5: * 3D view Object menu works again, many operators missing still because they are not yet implemented. * Constraint types now have separator, and fix too much spacing in the constraints header. --- source/blender/editors/interface/interface.c | 2 +- .../blender/editors/interface/interface_layout.c | 6 +- .../editors/interface/interface_templates.c | 30 +- source/blender/editors/object/editgroup.c | 2 +- source/blender/editors/object/object_edit.c | 53 ++-- source/blender/editors/object/object_intern.h | 2 +- source/blender/editors/object/object_ops.c | 10 +- .../blender/editors/space_view3d/view3d_header.c | 323 +++++---------------- source/blender/makesrna/intern/rna_constraint.c | 18 +- 9 files changed, 134 insertions(+), 312 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index b84a3ab469c..4fe28c2e457 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2124,7 +2124,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, BLI_dynstr_appendf(dynstr, "%s%%t", RNA_property_ui_name(prop)); for(i=0; iflag, 0.0, 0.0, 0.0, 0.0, "Collapse/Expand Constraint"); /* name */ - if ((con->flag & CONSTRAINT_EXPAND) && (proxy_protected==0)) { - /* XXX if (con->flag & CONSTRAINT_DISABLE) - uiBlockSetCol(block, TH_REDALERT);*/ - - uiBlockSetEmboss(block, UI_EMBOSS); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, xco+10, yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - + uiBlockSetEmboss(block, UI_EMBOSS); + + /* XXX if (con->flag & CONSTRAINT_DISABLE) + uiBlockSetCol(block, TH_REDALERT);*/ + + uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, xco+10, yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); + + if(proxy_protected == 0) { but = uiDefBut(block, TEX, B_CONSTRAINT_TEST, "", xco+120, yco, 85, 18, con->name, 0.0, 29.0, 0.0, 0.0, "Constraint name"); uiButSetFunc(but, verify_constraint_name_func, con, NULL); - } - else { - uiBlockSetEmboss(block, UI_EMBOSSN); - - /* XXX if (con->flag & CONSTRAINT_DISABLE) - uiBlockSetCol(block, TH_REDALERT);*/ - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, xco+10, yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, con->name, xco+120, yco-1, 135, 19, NULL, 0.0, 0.0, 0.0, 0.0, ""); } + else + uiDefBut(block, LABEL, B_CONSTRAINT_TEST, con->name, xco+120, yco-1, 135, 19, NULL, 0.0, 0.0, 0.0, 0.0, ""); // XXX uiBlockSetCol(block, TH_AUTO); diff --git a/source/blender/editors/object/editgroup.c b/source/blender/editors/object/editgroup.c index b49e2040b03..5943b36a6b0 100644 --- a/source/blender/editors/object/editgroup.c +++ b/source/blender/editors/object/editgroup.c @@ -161,7 +161,7 @@ void GROUP_OT_objects_remove_active(wmOperatorType *ot) { /* identifiers */ - ot->name= "Remove Selected From active group"; + ot->name= "Remove Selected From Active Group"; ot->description = "Remove the object from an object group that contains the active object."; ot->idname= "GROUP_OT_objects_remove_active"; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index da3b5e1e6b3..0a9ed945c1d 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -704,8 +704,8 @@ void OBJECT_OT_delete(wmOperatorType *ot) { /* identifiers */ - ot->name= "Delete Objects"; - ot->description = "Delete the object."; + ot->name= "Delete"; + ot->description = "Delete selected objects."; ot->idname= "OBJECT_OT_delete"; /* api callbacks */ @@ -1407,7 +1407,7 @@ static int parent_clear_exec(bContext *C, wmOperator *op) void OBJECT_OT_parent_clear(wmOperatorType *ot) { /* identifiers */ - ot->name= "Clear parent"; + ot->name= "Clear Parent"; ot->description = "Clear the object's parenting."; ot->idname= "OBJECT_OT_parent_clear"; @@ -1895,7 +1895,7 @@ void OBJECT_OT_location_clear(wmOperatorType *ot) { /* identifiers */ - ot->name= "Clear Object Location"; + ot->name= "Clear Location"; ot->description = "Clear the object's location."; ot->idname= "OBJECT_OT_location_clear"; @@ -1939,7 +1939,7 @@ void OBJECT_OT_rotation_clear(wmOperatorType *ot) { /* identifiers */ - ot->name= "Clear Object Rotation"; + ot->name= "Clear Rotation"; ot->description = "Clear the object's rotation."; ot->idname= "OBJECT_OT_rotation_clear"; @@ -1987,7 +1987,7 @@ void OBJECT_OT_scale_clear(wmOperatorType *ot) { /* identifiers */ - ot->name= "Clear Object Scale"; + ot->name= "Clear Scale"; ot->description = "Clear the object's scale."; ot->idname= "OBJECT_OT_scale_clear"; @@ -2033,7 +2033,7 @@ void OBJECT_OT_origin_clear(wmOperatorType *ot) { /* identifiers */ - ot->name= "Clear Object Origin"; + ot->name= "Clear Origin"; ot->description = "Clear the object's origin."; ot->idname= "OBJECT_OT_origin_clear"; @@ -2076,12 +2076,11 @@ void OBJECT_OT_restrictview_clear(wmOperatorType *ot) { /* identifiers */ - ot->name= "Clear restrict view"; + ot->name= "Clear Restrict View"; ot->description = "Reveal the object by setting the restrictview flag."; ot->idname= "OBJECT_OT_restrictview_clear"; /* api callbacks */ - ot->invoke= WM_operator_confirm; ot->exec= object_restrictview_clear_exec; ot->poll= ED_operator_view3d_active; @@ -2089,19 +2088,14 @@ void OBJECT_OT_restrictview_clear(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static EnumPropertyItem prop_set_restrictview_types[] = { - {0, "SELECTED", 0, "Selected", ""}, - {1, "UNSELECTED", 0, "Unselected ", ""}, - {0, NULL, 0, NULL, NULL} -}; - static int object_restrictview_set_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); short changed = 0; + int unselected= RNA_boolean_get(op->ptr, "unselected"); CTX_DATA_BEGIN(C, Base*, base, visible_bases) { - if(RNA_enum_is_equal(op->ptr, "type", "SELECTED")){ + if(!unselected) { if (base->flag & SELECT){ base->flag &= ~SELECT; base->object->flag = base->flag; @@ -2112,7 +2106,7 @@ static int object_restrictview_set_exec(bContext *C, wmOperator *op) } } } - else if (RNA_enum_is_equal(op->ptr, "type", "UNSELECTED")){ + else { if (!(base->flag & SELECT)){ base->object->restrictflag |= OB_RESTRICT_VIEW; changed = 1; @@ -2134,19 +2128,18 @@ static int object_restrictview_set_exec(bContext *C, wmOperator *op) void OBJECT_OT_restrictview_set(wmOperatorType *ot) { /* identifiers */ - ot->name= "Set restrict view"; + ot->name= "Set Restrict View"; ot->description = "Hide the object by setting the restrictview flag."; ot->idname= "OBJECT_OT_restrictview_set"; /* api callbacks */ - ot->invoke= WM_menu_invoke; ot->exec= object_restrictview_set_exec; ot->poll= ED_operator_view3d_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", prop_set_restrictview_types, 0, "Type", ""); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects."); } /* ************* Slow Parent ******************* */ @@ -2643,7 +2636,7 @@ static int parent_set_invoke(bContext *C, wmOperator *op, wmEvent *event) void OBJECT_OT_parent_set(wmOperatorType *ot) { /* identifiers */ - ot->name= "Make parent"; + ot->name= "Make Parent"; ot->description = "Set the object's parenting."; ot->idname= "OBJECT_OT_parent_set"; @@ -2797,7 +2790,7 @@ static void make_object_duplilist_real(Scene *scene, View3D *v3d, Base *base) } -static int object_dupli_set_real_exec(bContext *C, wmOperator *op) +static int object_duplicates_make_real_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); ScrArea *sa= CTX_wm_area(C); @@ -2817,17 +2810,17 @@ static int object_dupli_set_real_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void OBJECT_OT_dupli_set_real(wmOperatorType *ot) +void OBJECT_OT_duplicates_make_real(wmOperatorType *ot) { /* identifiers */ - ot->name= "Make Dupli Real"; + ot->name= "Make Duplicates Real"; ot->description = "Make dupli objects attached to this object real."; - ot->idname= "OBJECT_OT_dupli_set_real"; + ot->idname= "OBJECT_OT_duplicates_make_real"; /* api callbacks */ ot->invoke= WM_operator_confirm; - ot->exec= object_dupli_set_real_exec; + ot->exec= object_duplicates_make_real_exec; ot->poll= ED_operator_scene_editable; @@ -5966,7 +5959,8 @@ static int duplicate_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); View3D *v3d= CTX_wm_view3d(C); - int dupflag= U.dupflag; + int linked= RNA_boolean_get(op->ptr, "linked"); + int dupflag= (linked)? 0: U.dupflag; clear_id_newpoins(); clear_sca_new_poins(); /* sensor/contr/act */ @@ -6008,8 +6002,8 @@ void OBJECT_OT_duplicate(wmOperatorType *ot) { /* identifiers */ - ot->name= "Duplicate Objects"; - ot->description = "Duplicate the objects."; + ot->name= "Duplicate"; + ot->description = "Duplicate selected objects."; ot->idname= "OBJECT_OT_duplicate"; /* api callbacks */ @@ -6022,6 +6016,7 @@ void OBJECT_OT_duplicate(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* to give to transform */ + RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data."); RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); } diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 12776c08d4f..2173e79ac66 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -59,7 +59,7 @@ void OBJECT_OT_restrictview_clear(struct wmOperatorType *ot); void OBJECT_OT_slowparent_set(struct wmOperatorType *ot); void OBJECT_OT_slowparent_clear(struct wmOperatorType *ot); void OBJECT_OT_center_set(struct wmOperatorType *ot); -void OBJECT_OT_dupli_set_real(struct wmOperatorType *ot); +void OBJECT_OT_duplicates_make_real(struct wmOperatorType *ot); void OBJECT_OT_object_add(struct wmOperatorType *ot); void OBJECT_OT_duplicate(struct wmOperatorType *ot); void OBJECT_OT_delete(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 3a9973b7ec5..50c14673939 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -83,7 +83,7 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_slowparent_set); WM_operatortype_append(OBJECT_OT_slowparent_clear); WM_operatortype_append(OBJECT_OT_center_set); - WM_operatortype_append(OBJECT_OT_dupli_set_real); + WM_operatortype_append(OBJECT_OT_duplicates_make_real); WM_operatortype_append(OBJECT_OT_duplicate); WM_operatortype_append(GROUP_OT_group_create); WM_operatortype_append(GROUP_OT_objects_remove); @@ -155,12 +155,14 @@ void ED_keymap_object(wmWindowManager *wm) WM_keymap_verify_item(keymap, "OBJECT_OT_scale_clear", SKEY, KM_PRESS, KM_ALT, 0); WM_keymap_verify_item(keymap, "OBJECT_OT_origin_clear", OKEY, KM_PRESS, KM_ALT, 0); - WM_keymap_verify_item(keymap, "OBJECT_OT_restrictview_clear", HKEY, KM_PRESS, KM_ALT, 0); - WM_keymap_verify_item(keymap, "OBJECT_OT_restrictview_set", HKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "OBJECT_OT_restrictview_clear", HKEY, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "OBJECT_OT_restrictview_set", HKEY, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_restrictview_set", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1); WM_keymap_verify_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "OBJECT_OT_primitive_add", AKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_verify_item(keymap, "OBJECT_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "OBJECT_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_duplicate", DKEY, KM_PRESS, KM_ALT, 0)->ptr, "linked", 1); // XXX this should probably be in screen instead... here for testing purposes in the meantime... - Aligorith WM_keymap_verify_item(keymap, "ANIM_OT_insert_keyframe_menu", IKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index d23b47092bf..9a03a602ac2 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -1707,6 +1707,7 @@ static uiBlock *view3d_transformmenu(bContext *C, ARegion *ar, void *arg_unused) return block; } +#if 0 void do_view3d_object_mirrormenu(bContext *C, void *arg, int event) { #if 0 @@ -1752,64 +1753,29 @@ static uiBlock *view3d_object_mirrormenu(bContext *C, ARegion *ar, void *arg_unu uiTextBoundsBlock(block, 60); return block; } - -static void do_view3d_edit_object_transformmenu(bContext *C, void *arg, int event) -{ -#if 0 - switch(event) { - case 0: /* clear origin */ - clear_object('o'); - break; - case 1: /* clear scale */ - clear_object('s'); - break; - case 2: /* clear rotation */ - clear_object('r'); - break; - case 3: /* clear location */ - clear_object('g'); - break; - case 4: - if(OBACT) object_apply_deform(OBACT); - break; - case 5: /* make duplis real */ - make_duplilist_real(); - break; - case 6: /* apply scale/rotation or deformation */ - apply_objects_locrot(); - break; - case 7: /* apply visual matrix to objects loc/size/rot */ - apply_objects_visual_tx(); - break; - } #endif -} -static uiBlock *view3d_edit_object_transformmenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_edit_object_transformmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_object_transformmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_object_transformmenu, NULL); - +#if 0 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Scale/Rotation to ObData|Ctrl A, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + apply_objects_locrot(); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Visual Transform|Ctrl A, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + apply_objects_visual_tx(); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Deformation|Ctrl Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Duplicates Real|Ctrl Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Location|Alt G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Rotation|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Scale|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Origin|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; + if(OBACT) object_apply_deform(OBACT); +#endif + uiItemO(layout, NULL, 0, "OBJECT_OT_duplicates_make_real"); + + uiItemS(layout); + + uiItemO(layout, NULL, 0, "OBJECT_OT_location_clear"); + uiItemO(layout, NULL, 0, "OBJECT_OT_rotation_clear"); + uiItemO(layout, NULL, 0, "OBJECT_OT_scale_clear"); + uiItemO(layout, NULL, 0, "OBJECT_OT_origin_clear"); } +#if 0 static void do_view3d_edit_object_makelocalmenu(bContext *C, void *arg, int event) { #if 0 @@ -2046,164 +2012,49 @@ static uiBlock *view3d_edit_object_copyattrmenu(bContext *C, ARegion *ar, void * uiTextBoundsBlock(block, 60); return block; } - - -static void do_view3d_edit_object_parentmenu(bContext *C, void *arg, int event) -{ -#if 0 - switch(event) { - case 0: /* clear parent */ - clear_parent(); - break; - case 1: /* make parent */ - make_parent(); - break; - } #endif -} -static uiBlock *view3d_edit_object_parentmenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_edit_object_parentmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_object_parentmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_object_parentmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Parent...|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Parent...|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; + uiItemO(layout, "Make Parent...", 0, "OBJECT_OT_parent_set"); + uiItemO(layout, "Clear Parent...", 0, "OBJECT_OT_parent_clear"); } -static void do_view3d_edit_object_groupmenu(bContext *C, void *arg, int event) +static void view3d_edit_object_groupmenu(bContext *C, uiLayout *layout, void *arg_unused) { -#if 0 - switch(event) { - case 1: - case 2: - case 3: - group_operation(event); - break; - } -#endif -} + uiItemO(layout, NULL, 0, "GROUP_OT_group_create"); + uiItemO(layout, NULL, 0, "GROUP_OT_objects_remove"); -static uiBlock *view3d_edit_object_groupmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_object_groupmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_object_groupmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add to Existing Group|Ctrl G, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add to New Group|Ctrl G, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove from All Groups|Ctrl G, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} + uiItemS(layout); -static void do_view3d_edit_object_trackmenu(bContext *C, void *arg, int event) -{ -#if 0 - switch(event) { - case 0: /* clear track */ - clear_track(); - break; - case 1: /* make track */ - make_track(); - break; - } -#endif + uiItemO(layout, NULL, 0, "GROUP_OT_objects_add_active"); + uiItemO(layout, NULL, 0, "GROUP_OT_objects_remove_active"); } -static uiBlock *view3d_edit_object_trackmenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_edit_object_trackmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_object_trackmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_object_trackmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Track...|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Track...|Alt T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; + uiItemO(layout, "Make Track...", 0, "OBJECT_OT_track_set"); + uiItemO(layout, "Clear Track...", 0, "OBJECT_OT_track_clear"); } -static void do_view3d_edit_object_constraintsmenu(bContext *C, void *arg, int event) +static void view3d_edit_object_constraintsmenu(bContext *C, uiLayout *layout, void *arg_unused) { #if 0 - switch(event) { - case 1: /* add constraint */ - add_constraint(0); - break; - case 2: /* clear constraint */ - ob_clear_constraints(); - break; - } -#endif -} - -static uiBlock *view3d_edit_object_constraintsmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_object_constraintsmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_object_constraintsmenu, NULL); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Constraint...|Ctrl Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + add_constraint(0); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Constraints", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_edit_object_showhidemenu(bContext *C, void *arg, int event) -{ -#if 0 - - switch(event) { - - case 0: /* show objects */ - show_objects(); - break; - case 1: /* hide selected objects */ - hide_objects(1); - break; - case 2: /* hide deselected objects */ - hide_objects(0); - break; - } + ob_clear_constraints(); #endif } -static uiBlock *view3d_edit_object_showhidemenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_edit_object_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_object_showhidemenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_object_showhidemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Unselected|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; + uiItemO(layout, "Show Hidden", 0, "OBJECT_OT_restrictview_clear"); + uiItemO(layout, "Hide Selected", 0, "OBJECT_OT_restrictview_set"); + uiItemBooleanO(layout, "Hide Unselected", 0, "OBJECT_OT_restrictview_set", "unselected", 1); } +#if 0 #ifndef DISABLE_PYTHON static void do_view3d_edit_object_scriptsmenu(bContext *C, void *arg, int event) { @@ -2233,11 +2084,12 @@ static uiBlock *view3d_edit_object_scriptsmenu(bContext *C, ARegion *ar, void *a return block; } #endif /* DISABLE_PYTHON */ +#endif +#if 0 static void do_view3d_edit_objectmenu(bContext *C, void *arg, int event) { -#if 0 Scene *scene= CTX_data_scene(C); ScrArea *sa= CTX_wm_area(C); View3D *v3d= sa->spacedata.first; @@ -2247,15 +2099,6 @@ static void do_view3d_edit_objectmenu(bContext *C, void *arg, int event) case 0: /* transform properties*/ // XXX mainqenter(NKEY, 1); break; - case 1: /* delete */ - delete_context_selected(); - break; - case 2: /* duplicate */ - duplicate_context_selected(); - break; - case 3: /* duplicate linked */ - adduplicate(0, 0); - break; case 5: /* make single user */ single_user(); break; @@ -2274,9 +2117,6 @@ static void do_view3d_edit_objectmenu(bContext *C, void *arg, int event) case 11: /* insert keyframe */ common_insertkey(); break; - case 15: /* Object Panel */ - add_blockhandler(sa, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW); - break; case 16: /* make proxy object*/ make_proxy(); break; @@ -2284,82 +2124,75 @@ static void do_view3d_edit_objectmenu(bContext *C, void *arg, int event) common_deletekey(); break; } -#endif } +#endif -static uiBlock *view3d_edit_objectmenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_edit_objectmenu(bContext *C, uiLayout *layout, void *arg_unused) { - Scene *scene= CTX_data_scene(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "view3d_edit_objectmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_objectmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, ""); +#if 0 + Object *ob= CTX_data_active_object(C); + uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_object_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); +#endif - uiDefIconTextBlockBut(block, view3d_edit_object_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Clear/Apply", 0, yco-=20, 120, 19, ""); - // XXX uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - + uiItemMenuF(layout, "Clear/Apply", 0, view3d_edit_object_transformmenu); + uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu); + + uiItemS(layout); + +#if 0 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Linked|Alt D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiItemS(layout); +#endif + uiItemO(layout, NULL, 0, "OBJECT_OT_duplicate"); + uiItemBooleanO(layout, "Duplicate Linked", 0, "OBJECT_OT_duplicate", "linked", 1); + uiItemO(layout, NULL, 0, "OBJECT_OT_delete"); + +#if 0 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Proxy|Ctrl Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); uiDefIconTextBlockBut(block, view3d_edit_object_makelinksmenu, NULL, ICON_RIGHTARROW_THIN, "Make Links", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_object_singleusermenu, NULL, ICON_RIGHTARROW_THIN, "Make Single User", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_object_makelocalmenu, NULL, ICON_RIGHTARROW_THIN, "Make Local", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_object_copyattrmenu, NULL, ICON_RIGHTARROW_THIN, "Copy Attributes", 0, yco-=20, 120, 19, ""); +#endif - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_edit_object_parentmenu, NULL, ICON_RIGHTARROW_THIN, "Parent", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_trackmenu, NULL, ICON_RIGHTARROW_THIN, "Track", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_constraintsmenu, NULL, ICON_RIGHTARROW_THIN, "Constraints", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiItemS(layout); - if (OBACT && OBACT->type == OB_MESH) { + uiItemMenuF(layout, "Parent", 0, view3d_edit_object_parentmenu); + uiItemMenuF(layout, "Track", 0, view3d_edit_object_trackmenu); + uiItemMenuF(layout, "Group", 0, view3d_edit_object_groupmenu); + uiItemMenuF(layout, "Constraints", 0, view3d_edit_object_constraintsmenu); + +#if 0 + uiItemS(layout); + + if(ob && ob->type == OB_MESH) { uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Boolean Operation...|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); } uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Join Objects|Ctrl J", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Object Type...|Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); +#endif + + uiItemS(layout); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - +#if 0 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Objects", 0, yco-=20, 120, 19, ""); +#endif + + uiItemMenuF(layout, "Show/Hide", 0, view3d_edit_object_showhidemenu); +#if 0 #ifndef DISABLE_PYTHON uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBlockBut(block, view3d_edit_object_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, ""); #endif - - if(ar->alignment==RGN_ALIGN_TOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; +#endif } - static void view3d_edit_mesh_verticesmenu(bContext *C, uiLayout *layout, void *arg_unused) { uiItemO(layout, "Merge...", 0, "MESH_OT_merge"); @@ -4612,7 +4445,7 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o } else { xmax= GetButStringLength("Object"); - uiDefPulldownBut(block, view3d_edit_objectmenu, NULL, "Object", xco,yco, xmax-3, 20, ""); + uiDefMenuBut(block, view3d_edit_objectmenu, NULL, "Object", xco,yco, xmax-3, 20, ""); xco+= xmax; } } diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 5c4b6a95524..cda1716f664 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -38,33 +38,33 @@ EnumPropertyItem constraint_type_items[] ={ {CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", 0, "Child Of", ""}, {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", 0, "Transformation", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", 0, "Copy Location", ""}, {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", 0, "Copy Rotation", ""}, {CONSTRAINT_TYPE_SIZELIKE, "COPY_SCALE", 0, "Copy Scale", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", 0, "Limit Location", ""}, {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", 0, "Limit Rotation", ""}, {CONSTRAINT_TYPE_SIZELIMIT, "LIMIT_SCALE", 0, "Limit Scale", ""}, {CONSTRAINT_TYPE_DISTLIMIT, "LIMIT_DISTANCE", 0, "Limit Distance", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", 0, "Track To", ""}, {CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", 0, "Locked Track", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_MINMAX, "FLOOR", 0, "Floor", ""}, {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", 0, "Shrinkwrap", ""}, {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", 0, "Follow Path", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", 0, "Clamp To", ""}, {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO", 0, "Stretch To", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_KINEMATIC, "IK", 0, "IK", ""}, {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", 0, "Rigid Body Joint", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_ACTION, "ACTION", 0, "Action", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_PYTHON, "SCRIPT", 0, "Script", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_NULL, "NULL", 0, "Null", ""}, {0, NULL, 0, NULL, NULL}}; -- cgit v1.2.3 From 3bf0400a6935b8d77404d86d3d0c5e6067d031cb Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 10 Jul 2009 16:55:49 +0000 Subject: 2.5 Render usability: - Option back to render to imagewindow, or fullscreen. The latter is default. Setting is stored in Scene. - Added button in output panel, the option "to new window" will follow! - F11 again toggles render view (moved MS Windows "full screen" to shift+F11 for now) --- source/blender/blenkernel/intern/image.c | 4 + source/blender/blenloader/intern/readfile.c | 1 + source/blender/blenloader/intern/writefile.c | 5 +- source/blender/editors/screen/screen_ops.c | 158 +++++++++++++++++---- source/blender/editors/space_image/image_draw.c | 13 +- source/blender/makesdna/DNA_image_types.h | 7 + source/blender/makesdna/DNA_scene_types.h | 13 +- source/blender/makesrna/intern/rna_scene.c | 13 +- source/blender/windowmanager/intern/wm_operators.c | 2 +- 9 files changed, 181 insertions(+), 35 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index ef0984bf93d..754ec06f23f 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -253,6 +253,10 @@ void free_image(Image *ima) if (ima->preview) { BKE_previewimg_free(&ima->preview); } + if (ima->render_text) { + MEM_freeN(ima->render_text); + ima->render_text= NULL; + } } /* only image block itself */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c36a287b981..460a1dcb2f5 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2641,6 +2641,7 @@ static void direct_link_image(FileData *fd, Image *ima) ima->anim= NULL; ima->rr= NULL; ima->repbind= NULL; + ima->render_text= newdataadr(fd, ima->render_text); ima->packedfile = direct_link_packedfile(fd, ima->packedfile); ima->preview = direct_link_preview_image(fd, ima->preview); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index c433232d084..9d35967c95d 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1439,7 +1439,10 @@ static void write_images(WriteData *wd, ListBase *idbase) write_previews(wd, ima->preview); - } + /* exception: render text only saved in undo files (wd->current) */ + if (ima->render_text && wd->current) + writedata(wd, DATA, IMA_RW_MAXTEXT, ima->render_text); + } ima= ima->id.next; } /* flush helps the compression for undo-save */ diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 631ab3cf8cb..01cb4427944 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2286,46 +2286,54 @@ static ScrArea *find_area_showing_r_result(bContext *C) static void screen_set_image_output(bContext *C) { + Scene *scene= CTX_data_scene(C); ScrArea *sa; SpaceImage *sima; - sa= find_area_showing_r_result(C); + if(scene->r.displaymode==R_OUTPUT_SCREEN) { + /* this function returns with changed context */ + ED_screen_full_newspace(C, CTX_wm_area(C), SPACE_IMAGE); + sa= CTX_wm_area(C); + } + else { - if(sa==NULL) { - /* find largest open non-image area */ - sa= biggest_non_image_area(C); - if(sa) { - ED_area_newspace(C, sa, SPACE_IMAGE); - sima= sa->spacedata.first; - - /* makes ESC go back to prev space */ - sima->flag |= SI_PREVSPACE; - } - else { - /* use any area of decent size */ - sa= biggest_area(C); - if(sa->spacetype!=SPACE_IMAGE) { - // XXX newspace(sa, SPACE_IMAGE); + sa= find_area_showing_r_result(C); + + if(sa==NULL) { + /* find largest open non-image area */ + sa= biggest_non_image_area(C); + if(sa) { + ED_area_newspace(C, sa, SPACE_IMAGE); sima= sa->spacedata.first; /* makes ESC go back to prev space */ sima->flag |= SI_PREVSPACE; } + else { + /* use any area of decent size */ + sa= biggest_area(C); + if(sa->spacetype!=SPACE_IMAGE) { + // XXX newspace(sa, SPACE_IMAGE); + sima= sa->spacedata.first; + + /* makes ESC go back to prev space */ + sima->flag |= SI_PREVSPACE; + } + } } - } - + } sima= sa->spacedata.first; /* get the correct image, and scale it */ sima->image= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"); - if(G.displaymode==2) { // XXX - if(sa->full==0) { - sima->flag |= SI_FULLWINDOW; +// if(G.displaymode==2) { // XXX + if(sa->full) { + sima->flag |= SI_FULLWINDOW|SI_PREVSPACE; - ed_screen_fullarea(C, sa); +// ed_screen_fullarea(C, sa); } - } +// } } @@ -2371,6 +2379,62 @@ static void render_freejob(void *rjv) MEM_freeN(rj); } +/* str is IMA_RW_MAXTEXT in size */ +static void make_renderinfo_string(RenderStats *rs, Scene *scene, char *str) +{ + char info_time_str[32]; // used to be extern to header_info.c + uintptr_t mem_in_use, mmap_in_use; + float megs_used_memory, mmap_used_memory; + char *spos= str; + + mem_in_use= MEM_get_memory_in_use(); + mmap_in_use= MEM_get_mapped_memory_in_use(); + + megs_used_memory= (mem_in_use-mmap_in_use)/(1024.0*1024.0); + mmap_used_memory= (mmap_in_use)/(1024.0*1024.0); + + if(scene->lay & 0xFF000000) + spos+= sprintf(spos, "Localview | "); + else if(scene->r.scemode & R_SINGLE_LAYER) + spos+= sprintf(spos, "Single Layer | "); + + spos+= sprintf(spos, "Fra:%d Ve:%d Fa:%d ", (scene->r.cfra), rs->totvert, rs->totface); + if(rs->tothalo) spos+= sprintf(spos, "Ha:%d ", rs->tothalo); + if(rs->totstrand) spos+= sprintf(spos, "St:%d ", rs->totstrand); + spos+= sprintf(spos, "La:%d Mem:%.2fM (%.2fM) ", rs->totlamp, megs_used_memory, mmap_used_memory); + + if(rs->curfield) + spos+= sprintf(spos, "Field %d ", rs->curfield); + if(rs->curblur) + spos+= sprintf(spos, "Blur %d ", rs->curblur); + + BLI_timestr(rs->lastframetime, info_time_str); + spos+= sprintf(spos, "Time:%s ", info_time_str); + + if(rs->infostr) + spos+= sprintf(spos, "| %s ", rs->infostr); + + /* very weak... but 512 characters is quite safe */ + if(spos >= str+IMA_RW_MAXTEXT) + printf("WARNING! renderwin text beyond limit \n"); + +} + +static void image_renderinfo_cb(void *rjv, RenderStats *rs) +{ + RenderJob *rj= rjv; + + /* malloc OK here, stats_draw is not in tile threads */ + if(rj->image->render_text==NULL) + rj->image->render_text= MEM_callocN(IMA_RW_MAXTEXT, "rendertext"); + + make_renderinfo_string(rs, rj->scene, rj->image->render_text); + + /* make jobs timer to send notifier */ + *(rj->do_update)= 1; + +} + /* called inside thread! */ static void image_rect_update(void *rjv, RenderResult *rr, volatile rcti *renrect) { @@ -2552,6 +2616,8 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) re= RE_NewRender(scene->id.name); RE_test_break_cb(re, rj, render_breakjob); RE_display_draw_cb(re, rj, image_rect_update); + RE_stats_draw_cb(re, rj, image_renderinfo_cb); + rj->re= re; G.afbreek= 0; @@ -2626,6 +2692,48 @@ void SCREEN_OT_render_view_cancel(struct wmOperatorType *ot) ot->poll= ED_operator_image_active; } +/* *********************** show render viewer *************** */ + +static int render_view_show_exec(bContext *C, wmOperator *unused) +{ + ScrArea *sa= find_area_showing_r_result(C); + + /* determine if render already shows */ + if(sa) { + SpaceImage *sima= sa->spacedata.first; + + if(sima->flag & SI_PREVSPACE) { + sima->flag &= ~SI_PREVSPACE; + + if(sima->flag & SI_FULLWINDOW) { + sima->flag &= ~SI_FULLWINDOW; + ED_screen_full_prevspace(C); + } + else if(sima->next) { + ED_area_newspace(C, sa, sima->next->spacetype); + ED_area_tag_redraw(sa); + } + } + } + else { + screen_set_image_output(C); + } + + return OPERATOR_FINISHED; +} + +void SCREEN_OT_render_view_show(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Show/Hide Render View"; + ot->idname= "SCREEN_OT_render_view_show"; + + /* api callbacks */ + ot->exec= render_view_show_exec; + ot->poll= ED_operator_screenactive; +} + + /* **************** Assigning operatortypes to global list, adding handlers **************** */ @@ -2661,7 +2769,8 @@ void ED_operatortypes_screen(void) /* render */ WM_operatortype_append(SCREEN_OT_render); WM_operatortype_append(SCREEN_OT_render_view_cancel); - + WM_operatortype_append(SCREEN_OT_render_view_show); + /* tools shared by more space types */ WM_operatortype_append(ED_OT_undo); WM_operatortype_append(ED_OT_redo); @@ -2722,6 +2831,7 @@ void ED_keymap_screen(wmWindowManager *wm) /* render */ WM_keymap_add_item(keymap, "SCREEN_OT_render", F12KEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "SCREEN_OT_render_view_cancel", ESCKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "SCREEN_OT_render_view_show", F11KEY, KM_PRESS, 0, 0); /* frame offsets & play */ keymap= WM_keymap_listbase(wm, "Frames", 0, 0); diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index e61931f2fad..e5d74e6dddd 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -127,14 +127,13 @@ static void image_verify_buffer_float(SpaceImage *sima, ImBuf *ibuf) } } -static void draw_render_info(SpaceImage *sima, ARegion *ar) +static void draw_render_info(Image *ima, ARegion *ar) { rcti rect; float colf[3]; int showspare= 0; // XXX BIF_show_render_spare(); - char *str= "render text"; // XXX BIF_render_text(); - if(str==NULL) + if(ima->render_text==NULL) return; rect= ar->winrct; @@ -152,10 +151,10 @@ static void draw_render_info(SpaceImage *sima, ARegion *ar) if(showspare) { UI_DrawString(12, rect.ymin + 5, "(Previous)"); - UI_DrawString(72, rect.ymin + 5, str); + UI_DrawString(72, rect.ymin + 5, ima->render_text); } else - UI_DrawString(12, rect.ymin + 5, str); + UI_DrawString(12, rect.ymin + 5, ima->render_text); } void draw_image_info(ARegion *ar, int channels, int x, int y, char *cp, float *fp, int *zp, float *zpf) @@ -685,8 +684,8 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene) draw_image_paint_helpers(sima, ar, scene, zoomx, zoomy); /* render info */ - if(ibuf && show_render) - draw_render_info(sima, ar); + if(ibuf && ima && show_render) + draw_render_info(ima, ar); /* XXX integrate this code */ #if 0 diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h index 371b0d75951..65e4be1173d 100644 --- a/source/blender/makesdna/DNA_image_types.h +++ b/source/blender/makesdna/DNA_image_types.h @@ -87,6 +87,9 @@ typedef struct Image { struct PackedFile * packedfile; struct PreviewImage * preview; + /* not saved in file, statistics for render result */ + char *render_text; + float lastupdate; int lastused; short animspeed; @@ -120,5 +123,9 @@ typedef struct Image { /* ima->type and ima->source moved to BKE_image.h, for API */ +/* render_text maxlen */ +#define IMA_RW_MAXTEXT 512 + + #endif diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 31724bb5665..e9b246a323d 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -218,7 +218,12 @@ typedef struct RenderData { short bufflag; short quality; - short rpad, rpad1, rpad2; + /** + * Render to image editor, fullscreen or to new window. + */ + short displaymode; + + short rpad1, rpad2; /** * Flags for render settings. Use bit-masking to access the settings. @@ -652,6 +657,12 @@ typedef struct Scene { #define R_TOUCH 0x800000 /* touch files before rendering */ #define R_SIMPLIFY 0x1000000 +/* displaymode */ + +#define R_OUTPUT_SCREEN 0 +#define R_OUTPUT_AREA 1 +#define R_OUTPUT_WINDOW 2 +#define R_OUTPUT_FORKED 3 /* filtertype */ #define R_FILTER_BOX 0 diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index b363e55ca75..3cd45bb6dd8 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -283,7 +283,13 @@ void rna_def_scene_render_data(BlenderRNA *brna) {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"}, {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"}, {0, NULL, 0, NULL, NULL}}; - + + static EnumPropertyItem display_mode_items[] ={ + {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"}, + {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"}, + {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"}, + {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem octree_resolution_items[] = { {64, "OCTREE_RES_64", 0, "64", ""}, {128, "OCTREE_RES_128", 0, "128", ""}, @@ -841,6 +847,11 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Back Buffer", "Render backbuffer image"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode"); + RNA_def_property_enum_items(prop, display_mode_items); + RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed"); + prop= RNA_def_property(srna, "output_path", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_sdna(prop, NULL, "pic"); RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers."); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 9cec463193e..330196a7a73 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1554,7 +1554,7 @@ void wm_window_keymap(wmWindowManager *wm) WM_keymap_verify_item(keymap, "WM_OT_open_mainfile", F1KEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "WM_OT_save_mainfile", WKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_verify_item(keymap, "WM_OT_save_as_mainfile", F2KEY, KM_PRESS, 0, 0); - WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, 0, 0); + WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_verify_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0); /* debug/testing */ -- cgit v1.2.3 From 66ca86b40b7f4f66f46572ca218e522d5bbf7919 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Fri, 10 Jul 2009 17:05:04 +0000 Subject: 2.5 file browser * directory button enabled again, c code for now, can later become nicer operator * filename button enabled (pattern match for selection) * RNA completed (title, file and directory) * some unused code removal. --- .../blender/editors/interface/interface_handlers.c | 2 +- source/blender/editors/space_file/file_draw.c | 24 ++- source/blender/editors/space_file/file_header.c | 187 --------------------- source/blender/editors/space_file/file_intern.h | 13 +- source/blender/editors/space_file/file_ops.c | 135 +++++++++++++++ source/blender/editors/space_file/filesel.c | 30 ++++ source/blender/editors/space_file/space_file.c | 4 + source/blender/makesrna/intern/rna_space.c | 15 ++ 8 files changed, 206 insertions(+), 204 deletions(-) delete mode 100644 source/blender/editors/space_file/file_header.c (limited to 'source') diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index ee86b612332..e0ce6a7a83f 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3434,7 +3434,7 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA data= MEM_callocN(sizeof(uiHandleButtonData), "uiHandleButtonData"); data->window= CTX_wm_window(C); data->region= ar; - if( ELEM(but->type, BUT_CURVE, SEARCH_MENU) ); // XXX curve is temp + if( ELEM3(but->type, BUT_CURVE, SEARCH_MENU, TEX) ); // XXX curve is temp else data->interactive= 1; data->state = BUTTON_STATE_INIT; diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 02ee8f508c1..f22290ce19b 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -90,6 +90,8 @@ enum { B_FS_EXEC, B_FS_CANCEL, B_FS_PARENT, + B_FS_DIRNAME, + B_FS_FILENAME } eFile_ButEvents; @@ -105,6 +107,12 @@ static void do_file_buttons(bContext *C, void *arg, int event) case B_FS_PARENT: file_parent_exec(C, NULL); /* file_ops.c */ break; + case B_FS_FILENAME: + file_filename_exec(C, NULL); + break; + case B_FS_DIRNAME: + file_directory_exec(C, NULL); + break; } } @@ -130,10 +138,6 @@ void file_draw_buttons(const bContext *C, ARegion *ar) block = uiBeginBlock(C, ar, name, UI_EMBOSS); uiBlockSetHandleFunc(block, do_file_buttons, NULL); - /* XXXX - uiSetButLock( filelist_gettype(simasel->files)==FILE_MAIN && simasel->returnfunc, NULL); - */ - /* space available for load/save buttons? */ slen = UI_GetStringWidth(sfile->params->title); loadbutton= slen > 60 ? slen + 20 : MAX2(80, 20+UI_GetStringWidth(params->title)); @@ -146,8 +150,8 @@ void file_draw_buttons(const bContext *C, ARegion *ar) loadbutton= 0; } - uiDefBut(block, TEX, 0 /* XXX B_FS_FILENAME */,"", xmin+2, filebuty1, xmax-xmin-loadbutton-4, 21, params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); - uiDefBut(block, TEX, 0 /* XXX B_FS_DIRNAME */,"", xmin+2, filebuty2, xmax-xmin-loadbutton-4, 21, params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); + uiDefBut(block, TEX, B_FS_FILENAME ,"", xmin+2, filebuty1, xmax-xmin-loadbutton-4, 21, params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); + uiDefBut(block, TEX, B_FS_DIRNAME,"", xmin+2, filebuty2, xmax-xmin-loadbutton-4, 21, params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); if(loadbutton) { uiDefBut(block, BUT, B_FS_EXEC, params->title, xmax-loadbutton, filebuty2, loadbutton, 21, params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); @@ -160,13 +164,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) static void draw_tile(short sx, short sy, short width, short height, int colorid, int shade) -{ - /* TODO: BIF_ThemeColor seems to need this to show the color, not sure why? - elubie */ - //glEnable(GL_BLEND); - //glColor4ub(0, 0, 0, 100); - //glDisable(GL_BLEND); - /* I think it was a missing glDisable() - ton */ - +{ UI_ThemeColorShade(colorid, shade); uiSetRoundBox(15); uiRoundBox(sx, sy - height, sx + width, sy, 6); diff --git a/source/blender/editors/space_file/file_header.c b/source/blender/editors/space_file/file_header.c deleted file mode 100644 index 4799003d6c7..00000000000 --- a/source/blender/editors/space_file/file_header.c +++ /dev/null @@ -1,187 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL 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. - * - * 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) 2008 Blender Foundation. - * All rights reserved. - * - * - * Contributor(s): Blender Foundation - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include - -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_windowmanager_types.h" - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" - -#include "BKE_context.h" -#include "BKE_screen.h" -#include "BKE_global.h" - -#include "ED_screen.h" -#include "ED_types.h" -#include "ED_util.h" -#include "ED_fileselect.h" - -#include "WM_api.h" -#include "WM_types.h" - -#include "BIF_gl.h" -#include "BIF_glutil.h" - -#include "UI_interface.h" -#include "UI_resources.h" -#include "UI_view2d.h" - -#include "file_intern.h" -#include "filelist.h" - -#define B_SORTIMASELLIST 1 -#define B_RELOADIMASELDIR 2 -#define B_FILTERIMASELDIR 3 -#define B_HIDEDOTFILES 4 - -/* ************************ header area region *********************** */ - -static void do_file_header_buttons(bContext *C, void *arg, int event) -{ - SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); - switch(event) { - case B_SORTIMASELLIST: - filelist_sort(sfile->files, sfile->params->sort); - WM_event_add_notifier(C, NC_WINDOW, NULL); - break; - case B_RELOADIMASELDIR: - WM_event_add_notifier(C, NC_WINDOW, NULL); - break; - case B_FILTERIMASELDIR: - if(sfile->params) { - if (sfile->params->flag & FILE_FILTER) { - filelist_setfilter(sfile->files,sfile->params->filter); - filelist_filter(sfile->files); - } else { - filelist_setfilter(sfile->files,0); - filelist_filter(sfile->files); - } - } - WM_event_add_notifier(C, NC_WINDOW, NULL); - break; - case B_HIDEDOTFILES: - if(sfile->params) { - filelist_free(sfile->files); - filelist_hidedot(sfile->files, sfile->params->flag & FILE_HIDE_DOT); - WM_event_add_notifier(C, NC_WINDOW, NULL); - } - break; - } -} - - -void file_header_buttons(const bContext *C, ARegion *ar) -{ - SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); - FileSelectParams* params = ED_fileselect_get_params(sfile); - - uiBlock *block; - int xco, yco= 3; - int xcotitle; - - block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS); - uiBlockSetHandleFunc(block, do_file_header_buttons, NULL); - - xco= ED_area_header_standardbuttons(C, block, yco); - - /* - if((sa->flag & HEADER_NO_PULLDOWN)==0) { - int xmax; - - xmax= GetButStringLength("View"); - uiDefPulldownBut(block, dummy_viewmenu, CTX_wm_area(C), - "View", xco, yco-2, xmax-3, 24, ""); - xco+=XIC+xmax; - } - */ - - xco += 5; - - uiBlockBeginAlign(block); - uiDefIconButO(block, BUT, "FILE_OT_parent", WM_OP_INVOKE_DEFAULT, ICON_FILE_PARENT, xco+=XIC, yco, 20, 20, "Navigate to Parent Folder"); - uiDefIconButO(block, BUT, "FILE_OT_refresh", WM_OP_INVOKE_DEFAULT, ICON_FILE_REFRESH, xco+=XIC, yco, 20, 20, "Refresh List of Files"); - uiBlockEndAlign(block); - - xco += 5; - - uiBlockBeginAlign(block); - uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_SHORTDISPLAY, xco+=XIC, yco, XIC,YIC, ¶ms->display, 1.0, FILE_SHORTDISPLAY, 0, 0, "Displays short file description"); - uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_LONGDISPLAY, xco+=XIC, yco, XIC,YIC, ¶ms->display, 1.0, FILE_LONGDISPLAY, 0, 0, "Displays long file description"); - uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_IMGDISPLAY, xco+=XIC, yco, XIC,YIC, ¶ms->display, 1.0, FILE_IMGDISPLAY, 0, 0, "Displays files as thumbnails"); - uiBlockEndAlign(block); - - xco+=XIC; - - - uiBlockBeginAlign(block); - uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTALPHA, xco+=XIC, yco, XIC,YIC, ¶ms->sort, 1.0, 0.0, 0, 0, "Sorts files alphabetically"); - uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTBYEXT, xco+=XIC, yco, XIC,YIC, ¶ms->sort, 1.0, 3.0, 0, 0, "Sorts files by extension"); - uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTTIME, xco+=XIC, yco, XIC,YIC, ¶ms->sort, 1.0, 1.0, 0, 0, "Sorts files by time"); - uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTSIZE, xco+=XIC, yco, XIC,YIC, ¶ms->sort, 1.0, 2.0, 0, 0, "Sorts files by size"); - uiBlockEndAlign(block); - - xco+=XIC; - uiDefIconButBitS(block, TOG, FILE_HIDE_DOT, B_HIDEDOTFILES, ICON_GHOST,xco+=XIC,yco,XIC,YIC, ¶ms->flag, 0, 0, 0, 0, "Hide dot files"); - xco+=XIC; - uiDefIconButBitS(block, TOG, FILE_FILTER, B_FILTERIMASELDIR, ICON_FILTER,xco+=XIC,yco,XIC,YIC, ¶ms->flag, 0, 0, 0, 0, "Filter files"); - - if (params->flag & FILE_FILTER) { - xco+=4; - uiBlockBeginAlign(block); - uiDefIconButBitS(block, TOG, IMAGEFILE, B_FILTERIMASELDIR, ICON_FILE_IMAGE,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show images"); - uiDefIconButBitS(block, TOG, BLENDERFILE, B_FILTERIMASELDIR, ICON_FILE_BLEND,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show .blend files"); - uiDefIconButBitS(block, TOG, MOVIEFILE, B_FILTERIMASELDIR, ICON_FILE_MOVIE,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show movies"); - uiDefIconButBitS(block, TOG, PYSCRIPTFILE, B_FILTERIMASELDIR, ICON_FILE_SCRIPT,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show python scripts"); - uiDefIconButBitS(block, TOG, FTFONTFILE, B_FILTERIMASELDIR, ICON_FILE_FONT,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show fonts"); - uiDefIconButBitS(block, TOG, SOUNDFILE, B_FILTERIMASELDIR, ICON_FILE_SOUND,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show sound files"); - uiDefIconButBitS(block, TOG, TEXTFILE, B_FILTERIMASELDIR, ICON_FILE_BLANK,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show text files"); - uiDefIconButBitS(block, TOG, FOLDERFILE, B_FILTERIMASELDIR, ICON_FILE_FOLDER,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show folders"); - uiBlockEndAlign(block); - xco+=XIC; - } - - xcotitle= xco; - xco+= UI_GetStringWidth(params->title); - - uiBlockSetEmboss(block, UI_EMBOSS); - - /* always as last */ - UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); - - uiEndBlock(C, block); - uiDrawBlock(C, block); -} - - - diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 2f3fae47abb..732313c5a3a 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -34,9 +34,6 @@ struct ARegion; struct ARegionType; struct SpaceFile; -/* file_header.c */ -void file_header_buttons(const bContext *C, ARegion *ar); - /* file_ops.c */ struct ARegion *file_buttons_region(struct ScrArea *sa); @@ -65,23 +62,33 @@ void FILE_OT_loadimages(struct wmOperatorType *ot); void FILE_OT_exec(struct wmOperatorType *ot); void FILE_OT_cancel(struct wmOperatorType *ot); void FILE_OT_parent(struct wmOperatorType *ot); +void FILE_OT_directory_new(struct wmOperatorType *ot); +void FILE_OT_filename(struct wmOperatorType *ot); void FILE_OT_previous(struct wmOperatorType *ot); void FILE_OT_next(struct wmOperatorType *ot); void FILE_OT_refresh(struct wmOperatorType *ot); void FILE_OT_bookmark_toggle(struct wmOperatorType *ot); void FILE_OT_filenum(struct wmOperatorType *ot); +void FILE_OT_delete(struct wmOperatorType *ot); int file_exec(bContext *C, struct wmOperator *unused); int file_cancel_exec(bContext *C, struct wmOperator *unused); int file_parent_exec(bContext *C, struct wmOperator *unused); int file_previous_exec(bContext *C, struct wmOperator *unused); int file_next_exec(bContext *C, struct wmOperator *unused); +int file_filename_exec(bContext *C, struct wmOperator *unused); +int file_directory_exec(bContext *C, struct wmOperator *unused); +int file_directory_new_exec(bContext *C,struct wmOperator *unused); +int file_delete_exec(bContext *C, struct wmOperator *unused); + int file_hilight_set(struct SpaceFile *sfile, struct ARegion *ar, int mx, int my); + /* filesel.c */ float file_string_width(const char* str); float file_font_pointsize(); void file_change_dir(struct SpaceFile *sfile); +int file_select_match(struct SpaceFile *sfile, const char *pattern); /* file_panels.c */ void file_panels_register(struct ARegionType *art); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index c4435e85749..ef15586bba9 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -652,6 +652,96 @@ int file_next_exec(bContext *C, wmOperator *unused) return OPERATOR_FINISHED; } +int file_directory_new_exec(bContext *C, wmOperator *unused) +{ + char tmpstr[FILE_MAX]; + char tmpdir[FILE_MAXFILE]; + int i = 1; + + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + + if(sfile->params) { + + BLI_strncpy(tmpstr, sfile->params->dir, FILE_MAX); + BLI_join_dirfile(tmpstr, tmpstr, "New Folder"); + while (BLI_exists(tmpstr)) { + BLI_snprintf(tmpdir, FILE_MAXFILE, "New Folder(%d)", i++); + BLI_strncpy(tmpstr, sfile->params->dir, FILE_MAX); + BLI_join_dirfile(tmpstr, tmpstr, tmpdir); + } + BLI_recurdir_fileops(tmpstr); + if (!BLI_exists(tmpstr)) { + filelist_free(sfile->files); + filelist_parent(sfile->files); + BLI_strncpy(sfile->params->dir, filelist_dir(sfile->files), FILE_MAX); + } + } + WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + + return OPERATOR_FINISHED; +} + + +void FILE_OT_directory_new(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Create New Directory"; + ot->idname= "FILE_OT_directory_new"; + + /* api callbacks */ + ot->invoke= WM_operator_confirm; + ot->exec= file_directory_new_exec; + ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ +} + +int file_directory_exec(bContext *C, wmOperator *unused) +{ + char tmpstr[FILE_MAX]; + + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + + if(sfile->params) { + + if ( sfile->params->dir[0] == '~' ) { + if (sfile->params->dir[1] == '\0') { + BLI_strncpy(sfile->params->dir, BLI_gethome(), sizeof(sfile->params->dir) ); + } else { + /* replace ~ with home */ + char homestr[FILE_MAX]; + char *d = &sfile->params->dir[1]; + + while ( (*d == '\\') || (*d == '/') ) + d++; + BLI_strncpy(homestr, BLI_gethome(), FILE_MAX); + BLI_add_slash(homestr); + BLI_join_dirfile(tmpstr, homestr, d); + BLI_strncpy(sfile->params->dir, tmpstr, sizeof(sfile->params->dir)); + } + } + + file_change_dir(sfile); + } + WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + + return OPERATOR_FINISHED; +} + +int file_filename_exec(bContext *C, wmOperator *unused) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + + if(sfile->params) { + if (file_select_match(sfile, sfile->params->file)) + { + sfile->params->file[0] = '\0'; + WM_event_add_notifier(C, NC_FILE|ND_PARAMS, NULL); + } + } + + return OPERATOR_FINISHED; +} + + void FILE_OT_refresh(struct wmOperatorType *ot) { /* identifiers */ @@ -772,3 +862,48 @@ void FILE_OT_filenum(struct wmOperatorType *ot) RNA_def_int(ot->srna, "increment", 1, 0, 100, "Increment", "", 0,100); } +int file_delete_poll(bContext *C) +{ + int poll = ED_operator_file_active(C); + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + struct direntry* file; + + if(!sfile->params ) poll= 0; + + if (sfile->params->active_file < 0) { + poll= 0; + } else { + file = filelist_file(sfile->files, sfile->params->active_file); + if (file && S_ISDIR(file->type)) poll= 0; + } + return poll; +} + +int file_delete_exec(bContext *C, wmOperator *op) +{ + char str[FILE_MAX]; + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + struct direntry* file; + + + file = filelist_file(sfile->files, sfile->params->active_file); + BLI_make_file_string(G.sce, str, sfile->params->dir, file->relname); + BLI_delete(str, 0, 0); + WM_event_add_notifier(C, NC_FILE | ND_FILELIST, NULL); + + return OPERATOR_FINISHED; + +} + +void FILE_OT_delete(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Delete File"; + ot->idname= "FILE_OT_delete"; + + /* api callbacks */ + ot->invoke= WM_operator_confirm; + ot->exec= file_delete_exec; + ot->poll= file_delete_poll; /* <- important, handler is on window level */ +} + diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index c42c83eda98..be5feb45b4e 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -80,6 +80,17 @@ #include "file_intern.h" #include "filelist.h" +#if defined __BeOS +static int fnmatch(const char *pattern, const char *string, int flags) +{ + return 0; +} +#elif defined WIN32 && !defined _LIBC + /* use fnmatch included in blenlib */ + #include "BLI_fnmatch.h" +#else + #include +#endif FileSelectParams* ED_fileselect_get_params(struct SpaceFile *sfile) { @@ -299,3 +310,22 @@ void file_change_dir(struct SpaceFile *sfile) sfile->params->active_file = -1; } } + +int file_select_match(struct SpaceFile *sfile, const char *pattern) +{ + int match = 0; + if (strchr(pattern, '*') || strchr(pattern, '?') || strchr(pattern, '[')) { + int i; + struct direntry *file; + int n = filelist_numfiles(sfile->files); + + for (i = 0; i < n; i++) { + file = filelist_file(sfile->files, i); + if (fnmatch(pattern, file->relname, 0) == 0) { + file->flags |= ACTIVE; + match = 1; + } + } + } + return match; +} diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 3167d2809c9..5af79eb2800 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -321,6 +321,8 @@ void file_operatortypes(void) WM_operatortype_append(FILE_OT_delete_bookmark); WM_operatortype_append(FILE_OT_hidedot); WM_operatortype_append(FILE_OT_filenum); + WM_operatortype_append(FILE_OT_directory_new); + WM_operatortype_append(FILE_OT_delete); } /* NOTE: do not add .blend file reading on this level */ @@ -335,6 +337,8 @@ void file_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "FILE_OT_hidedot", HKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_previous", BACKSPACEKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_next", BACKSPACEKEY, KM_PRESS, KM_SHIFT, 0); + /* WM_keymap_add_item(keymap, "FILE_OT_directory_new", IKEY, KM_PRESS, 0, 0); */ /* XXX needs button */ + WM_keymap_add_item(keymap, "FILE_OT_delete", XKEY, KM_PRESS, 0, 0); /* keys for main area */ keymap= WM_keymap_listbase(wm, "FileMain", SPACE_FILE, 0); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index fea932ca29a..f1a58ba058a 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -893,6 +893,21 @@ static void rna_def_fileselect_params(BlenderRNA *brna) srna= RNA_def_struct(brna, "FileSelectParams", NULL); RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters."); + prop= RNA_def_property(srna, "title", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "title"); + RNA_def_property_ui_text(prop, "Title", "Title for the file browser."); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + + prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "dir"); + RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser."); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "file", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "file"); + RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser."); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + prop= RNA_def_property(srna, "display", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "display"); RNA_def_property_enum_items(prop, file_display_items); -- cgit v1.2.3 From b3d6b2f7283e200e3b3724cc93c8279fe7b4dcf0 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Fri, 10 Jul 2009 17:26:19 +0000 Subject: 2.5 file browser * buttons for increment/decrement number in filename Patch provided by Johannes Meng, many thanks! --- source/blender/editors/space_file/file_draw.c | 125 +++++++++++++++++++------- 1 file changed, 95 insertions(+), 30 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index f22290ce19b..f8705fe63a4 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -116,48 +116,113 @@ static void do_file_buttons(bContext *C, void *arg, int event) } } -/* note; this function uses pixelspace (0, 0, winx, winy), not view2d */ +/* Note: This function uses pixelspace (0, 0, winx, winy), not view2d. + * The controls are laid out as follows: + * + * ------------------------------------------- + * | Directory input | execute | + * ------------------------------------------- + * | Filename input | + | - | cancel | + * ------------------------------------------- + * + * The input widgets will stretch to fill any excess space. + * When there isn't enough space for all controls to be shown, they are + * hidden in this order: x/-, execute/cancel, input widgets. + */ void file_draw_buttons(const bContext *C, ARegion *ar) { - SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + /* Button layout. */ + const short min_x = 10; + const short max_x = ar->winx - 10; + const short line2_y = ar->winy - IMASEL_BUTTONS_HEIGHT - 12; + const short line1_y = line2_y + IMASEL_BUTTONS_HEIGHT/2 + 4; + const short input_minw = 20; + const short btn_h = 21; + const short btn_fn_w = 14; + const short btn_minw = 80; + const short btn_margin = 20; + const short separator = 4; + + /* Additional locals. */ + char name[20]; + short loadbutton; + short fnumbuttons; + short available_w = max_x - min_x; + short line1_w = available_w; + short line2_w = available_w; + + uiBut* but; + uiBlock* block; + SpaceFile* sfile = (SpaceFile*) CTX_wm_space_data(C); FileSelectParams* params = ED_fileselect_get_params(sfile); - uiBlock *block; - int loadbutton; - char name[20]; - float slen; - int filebuty1, filebuty2; - - float xmin = 8; - float xmax = ar->winx - 10; - - filebuty1= ar->winy - IMASEL_BUTTONS_HEIGHT - 12; - filebuty2= filebuty1 + IMASEL_BUTTONS_HEIGHT/2 + 4; - - /* HEADER */ + + /* Initialize UI block. */ sprintf(name, "win %p", ar); block = uiBeginBlock(C, ar, name, UI_EMBOSS); uiBlockSetHandleFunc(block, do_file_buttons, NULL); - - /* space available for load/save buttons? */ - slen = UI_GetStringWidth(sfile->params->title); - loadbutton= slen > 60 ? slen + 20 : MAX2(80, 20+UI_GetStringWidth(params->title)); - if(ar->winx > loadbutton+20) { - if(params->title[0]==0) { - loadbutton= 0; - } + + /* Is there enough space for the execute / cancel buttons? */ + loadbutton = UI_GetStringWidth(sfile->params->title) + btn_margin; + if (loadbutton < btn_minw) { + loadbutton = MAX2(btn_minw, + btn_margin + UI_GetStringWidth(params->title)); } - else { - loadbutton= 0; + + if (available_w <= loadbutton + separator + input_minw + || params->title[0] == 0) { + loadbutton = 0; + } else { + line1_w -= (loadbutton + separator); + line2_w = line1_w; } - uiDefBut(block, TEX, B_FS_FILENAME ,"", xmin+2, filebuty1, xmax-xmin-loadbutton-4, 21, params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); - uiDefBut(block, TEX, B_FS_DIRNAME,"", xmin+2, filebuty2, xmax-xmin-loadbutton-4, 21, params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); + /* Is there enough space for file number increment/decrement buttons? */ + fnumbuttons = 2 * btn_fn_w; + if (!loadbutton || line2_w <= fnumbuttons + separator + input_minw) { + fnumbuttons = 0; + } else { + line2_w -= (fnumbuttons + separator); + } + + /* Text input fields for directory and file. */ + if (available_w > 0) { + uiDefBut(block, TEX, B_FS_DIRNAME, "", + min_x, line1_y, line1_w, btn_h, + params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, + "File path."); + uiDefBut(block, TEX, B_FS_FILENAME, "", + min_x, line2_y, line2_w, btn_h, + params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, + "File name."); + } + /* Filename number increment / decrement buttons. */ + if (fnumbuttons) { + uiBlockBeginAlign(block); + but = uiDefButO(block, BUT, "FILE_OT_filenum", 0, "-", + min_x + line2_w + separator, line2_y, + btn_fn_w, btn_h, + "Decrement the filename number."); + RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", -1); + + but = uiDefButO(block, BUT, "FILE_OT_filenum", 0, "+", + min_x + line2_w + separator + btn_fn_w, line2_y, + btn_fn_w, btn_h, + "Increment the filename number."); + RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", 1); + uiBlockEndAlign(block); + } + + /* Execute / cancel buttons. */ if(loadbutton) { - uiDefBut(block, BUT, B_FS_EXEC, params->title, xmax-loadbutton, filebuty2, loadbutton, 21, params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); - uiDefBut(block, BUT, B_FS_CANCEL, "Cancel", xmax-loadbutton, filebuty1, loadbutton, 21, params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); + uiDefBut(block, BUT, B_FS_EXEC, params->title, + max_x - loadbutton, line1_y, loadbutton, btn_h, + params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, params->title); + uiDefBut(block, BUT, B_FS_CANCEL, "Cancel", + max_x - loadbutton, line2_y, loadbutton, btn_h, + params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "Cancel."); } - + uiEndBlock(C, block); uiDrawBlock(C, block); } -- cgit v1.2.3 From 64f300ccf4ffa687b196b111b91682d8a50d0069 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 10 Jul 2009 18:09:53 +0000 Subject: Use python subtypes so bpy.types.Mesh is a subtype of bpy.types.ID This means checks like this work. isinstance(bpy.data.meshes[0], bpy.types.ID) bpy.types.Mesh.__base__ == bpy.types.ID --- source/blender/python/generic/Mathutils.h | 7 +++++ source/blender/python/intern/bpy_rna.c | 47 ++++++++++++++++--------------- 2 files changed, 31 insertions(+), 23 deletions(-) (limited to 'source') diff --git a/source/blender/python/generic/Mathutils.h b/source/blender/python/generic/Mathutils.h index 6a4e28d6068..5bdd9d9cfe0 100644 --- a/source/blender/python/generic/Mathutils.h +++ b/source/blender/python/generic/Mathutils.h @@ -85,6 +85,13 @@ int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps); #endif typedef struct Mathutils_Callback Mathutils_Callback; + +typedef int (*BaseMathCheckFunc)(PyObject *); +typedef int (*BaseMathGetFunc)(PyObject *, int, float *); +typedef int (*BaseMathSetFunc)(PyObject *, int, float *); +typedef int (*BaseMathGetIndexFunc)(PyObject *, int, float *, int); +typedef int (*BaseMathSetIndexFunc)(PyObject *, int, float *, int); + struct Mathutils_Callback { int (*check)(PyObject *user); /* checks the user is still valid */ int (*get)(PyObject *user, int subtype, float *from); /* gets the vector from the user */ diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 8314a3cc89c..c6fbda0caef 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -94,13 +94,14 @@ static int mathutils_rna_vector_set_index(BPy_PropertyRNA *self, int subtype, fl } Mathutils_Callback mathutils_rna_array_cb = { - mathutils_rna_generic_check, - mathutils_rna_vector_get, - mathutils_rna_vector_set, - mathutils_rna_vector_get_index, - mathutils_rna_vector_set_index + (BaseMathCheckFunc) mathutils_rna_generic_check, + (BaseMathGetFunc) mathutils_rna_vector_get, + (BaseMathSetFunc) mathutils_rna_vector_set, + (BaseMathGetIndexFunc) mathutils_rna_vector_get_index, + (BaseMathSetIndexFunc) mathutils_rna_vector_set_index }; + /* bpyrna matrix callbacks */ static int mathutils_rna_matrix_cb_index= -1; /* index for our callbacks */ @@ -123,11 +124,11 @@ static int mathutils_rna_matrix_set(BPy_PropertyRNA *self, int subtype, float *m } Mathutils_Callback mathutils_rna_matrix_cb = { - mathutils_rna_generic_check, - mathutils_rna_matrix_get, - mathutils_rna_matrix_set, - NULL, - NULL + (BaseMathCheckFunc) mathutils_rna_generic_check, + (BaseMathGetFunc) mathutils_rna_matrix_get, + (BaseMathSetFunc) mathutils_rna_matrix_set, + (BaseMathGetIndexFunc) NULL, + (BaseMathSetIndexFunc) NULL }; #endif @@ -2172,21 +2173,17 @@ static void pyrna_subtype_set_rna(PyObject *newclass, StructRNA *srna) /* done with rna instance */ } -PyObject* pyrna_struct_Subtype(PointerRNA *ptr) +PyObject* pyrna_srna_Subtype(StructRNA *srna) { PyObject *newclass = NULL; - StructRNA *srna, *base; - - if(ptr->type == &RNA_Struct) - srna= ptr->data; - else - srna= ptr->type; if (srna == NULL) { newclass= NULL; /* Nothing to do */ } else if ((newclass= RNA_struct_py_type_get(srna))) { Py_INCREF(newclass); } else { + StructRNA *base; + /* for now, return the base RNA type rather then a real module */ /* Assume RNA_struct_py_type_get(srna) was alredy checked */ @@ -2203,22 +2200,21 @@ PyObject* pyrna_struct_Subtype(PointerRNA *ptr) PyObject *py_base= NULL; PyObject *dict = PyDict_New(); PyObject *item; - + // arg 1 //PyTuple_SET_ITEM(args, 0, PyUnicode_FromString(tp_name)); PyTuple_SET_ITEM(args, 0, PyUnicode_FromString(RNA_struct_identifier(srna))); // arg 2 -#if 0 // XXX - This should be possible but for some reason it does a recursive call for MirrorModifier base= RNA_struct_base(srna); if(base && base != srna) { - // printf("debug subtype %s\n", RNA_struct_identifier(srna)); - py_base= pyrna_struct_Subtype(base); + /*/printf("debug subtype %s %p\n", RNA_struct_identifier(srna), srna); */ + py_base= pyrna_srna_Subtype(base); } -#endif + if(py_base==NULL) { - py_base= &pyrna_struct_Type; + py_base= (PyObject *)&pyrna_struct_Type; Py_INCREF(py_base); } @@ -2264,6 +2260,11 @@ PyObject* pyrna_struct_Subtype(PointerRNA *ptr) return newclass; } +PyObject* pyrna_struct_Subtype(PointerRNA *ptr) +{ + return pyrna_srna_Subtype((ptr->type == &RNA_Struct) ? ptr->data : ptr->type); +} + /*-----------------------CreatePyObject---------------------------------*/ PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr ) { -- cgit v1.2.3 From c7e308367a6d1ed7db914e35d0660b6afa44456d Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 10 Jul 2009 18:10:40 +0000 Subject: 2.5: * Fix missing update when browsing to different text. * Fix wrong spacing in font size 15 drawing in the text editor. * Fix numbers not updating in color picker buttons. --- source/blender/editors/interface/interface_regions.c | 11 +++++++---- source/blender/editors/space_text/text_draw.c | 2 +- source/blender/makesrna/intern/rna_space.c | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 1b968508918..e0c6fbd7134 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1460,11 +1460,10 @@ static void update_picker_hex(uiBlock *block, float *rgb) // this updates button strings, is hackish... but button pointers are on stack of caller function for(bt= block->buttons.first; bt; bt= bt->next) { - if(strcmp(bt->str, "Hex: ")==0) { + if(strcmp(bt->str, "Hex: ")==0) strcpy(bt->poin, col); - ui_check_but(bt); - break; - } + + ui_check_but(bt); } } @@ -1506,6 +1505,8 @@ void ui_update_block_buts_hsv(uiBlock *block, float *hsv) ui_set_but_val(bt, hsv[2]); } } + + ui_check_but(bt); } } @@ -1547,6 +1548,8 @@ static void ui_update_block_buts_hex(uiBlock *block, char *hexcol) ui_set_but_val(bt, v); } } + + ui_check_but(bt); } } diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 48c14804b13..f58af47a6bd 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -101,7 +101,7 @@ static int text_font_draw_character(SpaceText *st, int x, int y, char c) int text_font_width_character(SpaceText *st) { // XXX need quick BLF function, or cache it somewhere - return (st->lheight == 12)? 7: 8; + return (st->lheight == 12)? 7: 9; } int text_font_width(SpaceText *st, char *str) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index f1a58ba058a..996e54384e2 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -800,8 +800,8 @@ static void rna_def_space_text(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem font_size_items[] = { - {12, "SCREEN_12", 0, "Screen 12", ""}, - {15, "SCREEN_15", 0, "Screen 15", ""}, + {12, "12", 0, "12", ""}, + {15, "15", 0, "15", ""}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SpaceTextEditor", "Space"); @@ -813,7 +813,7 @@ static void rna_def_space_text(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space."); RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL); - RNA_def_property_update(prop, NC_TEXT|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); /* display */ prop= RNA_def_property(srna, "syntax_highlight", PROP_BOOLEAN, PROP_NONE); -- cgit v1.2.3 From ac11d522c8cad7eeabe07e643effbc776e933728 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Fri, 10 Jul 2009 19:19:54 +0000 Subject: 2.5 filebrowser * bugfix: don't allow parent dir to go beyond root * bugfix: only attempt to change directory if it exists New (WIP) feature: autocomplete for directory * works on TAB * so far only one level (in current directory) --- source/blender/blenlib/BLI_util.h | 3 +++ source/blender/blenlib/intern/util.c | 16 +++++++++++++++ source/blender/editors/space_file/file_draw.c | 3 ++- source/blender/editors/space_file/file_intern.h | 1 + source/blender/editors/space_file/file_ops.c | 19 ++++++++++-------- source/blender/editors/space_file/filesel.c | 26 ++++++++++++++++++++++++- 6 files changed, 58 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/blenlib/BLI_util.h b/source/blender/blenlib/BLI_util.h index a138ea780ea..d323f701ba5 100644 --- a/source/blender/blenlib/BLI_util.h +++ b/source/blender/blenlib/BLI_util.h @@ -72,6 +72,9 @@ void BLI_cleanup_dir(const char *relabase, char *dir); /* same as above but adds /* go back one directory */ int BLI_parent_dir(char *path); +/* return whether directory is root and thus has no parent dir */ +int BLI_has_parent(char *path); + /** * Blender's path code replacement function. * Bases @a path strings leading with "//" by the diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 838648ebfd7..a236defc515 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -494,6 +494,22 @@ void BLI_makestringcode(const char *relfile, char *file) } } +int BLI_has_parent(char *path) +{ + int len; + int slashes = 0; + BLI_clean(path); + BLI_add_slash(path); + + len = strlen(path)-1; + while (len) { + if ((path[len] == '\\') || (path[len] == '/')) + slashes++; + len--; + } + return slashes > 1; +} + int BLI_parent_dir(char *path) { #ifdef WIN32 diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index f8705fe63a4..f1f20a36b59 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -186,10 +186,11 @@ void file_draw_buttons(const bContext *C, ARegion *ar) /* Text input fields for directory and file. */ if (available_w > 0) { - uiDefBut(block, TEX, B_FS_DIRNAME, "", + but = uiDefBut(block, TEX, B_FS_DIRNAME, "", min_x, line1_y, line1_w, btn_h, params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, "File path."); + uiButSetCompleteFunc(but, autocomplete_directory, NULL); uiDefBut(block, TEX, B_FS_FILENAME, "", min_x, line2_y, line2_w, btn_h, params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 732313c5a3a..dce56e05d6b 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -89,6 +89,7 @@ float file_string_width(const char* str); float file_font_pointsize(); void file_change_dir(struct SpaceFile *sfile); int file_select_match(struct SpaceFile *sfile, const char *pattern); +void autocomplete_directory(struct bContext *C, char *str, void *arg_v); /* file_panels.c */ void file_panels_register(struct ARegionType *art); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index ef15586bba9..585e042ae8a 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -142,10 +142,10 @@ static void file_select(SpaceFile* sfile, ARegion* ar, const rcti* rect, short v { // XXX error("Path too long, cannot enter this directory"); } else { + BLI_cleanup_dir(G.sce, params->dir); strcat(params->dir, file->relname); - strcat(params->dir,"/"); + BLI_add_slash(params->dir); params->file[0] = '\0'; - BLI_cleanup_dir(G.sce, params->dir); file_change_dir(sfile); } } @@ -557,11 +557,13 @@ int file_parent_exec(bContext *C, wmOperator *unused) SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); if(sfile->params) { - BLI_parent_dir(sfile->params->dir); - file_change_dir(sfile); + if (BLI_has_parent(sfile->params->dir)) { + BLI_parent_dir(sfile->params->dir); + file_change_dir(sfile); + WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + } } - WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); - + return OPERATOR_FINISHED; } @@ -718,10 +720,11 @@ int file_directory_exec(bContext *C, wmOperator *unused) BLI_strncpy(sfile->params->dir, tmpstr, sizeof(sfile->params->dir)); } } - + BLI_add_slash(sfile->params->dir); file_change_dir(sfile); + WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); } - WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index be5feb45b4e..6c8e84f0db8 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -298,7 +298,7 @@ FileLayout* ED_fileselect_get_layout(struct SpaceFile *sfile, struct ARegion *ar void file_change_dir(struct SpaceFile *sfile) { - if (sfile->params) { + if (sfile->params && BLI_exists(sfile->params->dir)) { filelist_setdir(sfile->files, sfile->params->dir); if(folderlist_clear_next(sfile)) @@ -329,3 +329,27 @@ int file_select_match(struct SpaceFile *sfile, const char *pattern) } return match; } + + +void autocomplete_directory(struct bContext *C, char *str, void *arg_v) +{ + char tmp[FILE_MAX]; + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + + /* search if str matches the beginning of name */ + if(str[0] && sfile->files) { + AutoComplete *autocpl= autocomplete_begin(str, FILE_MAX); + int nentries = filelist_numfiles(sfile->files); + int i; + + for(i= 0; ifiles, i); + char* dir = filelist_dir(sfile->files); + if (file && S_ISDIR(file->type)) { + BLI_make_file_string(G.sce, tmp, dir, file->relname); + autocomplete_do_name(autocpl,tmp); + } + } + autocomplete_end(autocpl, str); + } +} \ No newline at end of file -- cgit v1.2.3 From a95c68a3eaa692f742e7f2e626b65daa71727c17 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Fri, 10 Jul 2009 19:52:00 +0000 Subject: 2.5 file browser * bugfix: set the directory to the default root when directory button is empty --- source/blender/editors/space_file/file_ops.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source') diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 585e042ae8a..8f1d2598c61 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -720,6 +720,10 @@ int file_directory_exec(bContext *C, wmOperator *unused) BLI_strncpy(sfile->params->dir, tmpstr, sizeof(sfile->params->dir)); } } +#ifdef WIN32 + if (sfile->params->dir[0] == '\0') + get_default_root(sfile->params->dir); +#endif BLI_add_slash(sfile->params->dir); file_change_dir(sfile); WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); -- cgit v1.2.3 From 2e3e044d27e90dc87bdce6af9cef77d9543e4d89 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 10 Jul 2009 19:56:13 +0000 Subject: RNA * Enums can now be dynamically created in the _itemf callback, using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking for enum items now need to potentially free the items. * This callback now also gets context, this was added specifically for operators. This doesn't fit design well at all, needed to do some ugly hacks, but can't find a good solution at the moment. * All enums must have a default list of items too, even with an _itemf callback, for docs and fallback in case there is no context. * Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation. * Also changes some operator properties that were enums to booleas (unselected, deselect), to make them consistent with other ops. --- source/blender/editors/include/ED_transform.h | 3 +- source/blender/editors/interface/interface.c | 27 +++-- .../blender/editors/interface/interface_intern.h | 2 + .../blender/editors/interface/interface_layout.c | 66 +++++++---- source/blender/editors/mesh/editmesh.c | 8 +- source/blender/editors/mesh/editmesh_mods.c | 27 ++++- source/blender/editors/mesh/editmesh_tools.c | 47 ++++---- source/blender/editors/mesh/mesh_ops.c | 3 +- source/blender/editors/object/object_edit.c | 21 ++-- .../editors/space_sequencer/sequencer_edit.c | 15 +-- .../editors/space_sequencer/sequencer_ops.c | 8 +- source/blender/editors/space_view3d/view3d_ops.c | 4 +- .../blender/editors/space_view3d/view3d_select.c | 21 +--- source/blender/editors/transform/transform_ops.c | 18 +-- .../editors/transform/transform_orientations.c | 38 +++++-- source/blender/makesrna/RNA_access.h | 16 +-- source/blender/makesrna/RNA_define.h | 7 ++ source/blender/makesrna/RNA_types.h | 2 +- source/blender/makesrna/intern/makesrna.c | 1 - source/blender/makesrna/intern/rna_access.c | 57 ++++++---- source/blender/makesrna/intern/rna_constraint.c | 29 ++--- source/blender/makesrna/intern/rna_define.c | 36 +++++- .../blender/makesrna/intern/rna_internal_types.h | 4 +- source/blender/makesrna/intern/rna_particle.c | 123 +++++++++++---------- source/blender/makesrna/intern/rna_space.c | 2 +- source/blender/python/intern/bpy_rna.c | 34 ++++-- source/blender/python/intern/bpy_util.c | 3 +- 27 files changed, 382 insertions(+), 240 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index adcf2cfc024..fde270040a9 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -38,6 +38,7 @@ struct wmEvent; struct bContext; struct Object; struct uiLayout; +struct EnumPropertyItem; void transform_keymap_for_space(struct wmWindowManager *wm, struct ListBase *keymap, int spaceid); void transform_operatortypes(void); @@ -114,7 +115,7 @@ int BIF_menuselectTransformOrientation(void); void BIF_selectTransformOrientation(struct bContext *C, struct TransformOrientation *ts); void BIF_selectTransformOrientationValue(struct bContext *C, int orientation); -void BIF_menuTransformOrientation(struct bContext *C, struct uiLayout *layout, void *arg); +struct EnumPropertyItem *BIF_enumTransformOrientation(struct bContext *C); char * BIF_menustringTransformOrientation(const struct bContext *C, char *title); /* the returned value was allocated and needs to be freed after use */ int BIF_countTransformOrientation(const struct bContext *C); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 4fe28c2e457..391be4ba591 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1615,6 +1615,7 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, shor block= MEM_callocN(sizeof(uiBlock), "uiBlock"); block->active= 1; block->dt= dt; + block->evil_C= C; // XXX BLI_strncpy(block->name, name, sizeof(block->name)); if(region) @@ -2113,11 +2114,11 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, /* use rna values if parameters are not specified */ if(!str) { if(type == MENU && proptype == PROP_ENUM) { - const EnumPropertyItem *item; + EnumPropertyItem *item; DynStr *dynstr; - int i, totitem, value; + int i, totitem, value, free; - RNA_property_enum_items(ptr, prop, &item, &totitem); + RNA_property_enum_items(block->evil_C, ptr, prop, &item, &totitem, &free); value= RNA_property_enum_get(ptr, prop); dynstr= BLI_dynstr_new(); @@ -2136,13 +2137,16 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, str= BLI_dynstr_get_cstring(dynstr); BLI_dynstr_free(dynstr); + if(free) + MEM_freeN(item); + freestr= 1; } else if(type == ROW && proptype == PROP_ENUM) { - const EnumPropertyItem *item; - int i, totitem; + EnumPropertyItem *item; + int i, totitem, free; - RNA_property_enum_items(ptr, prop, &item, &totitem); + RNA_property_enum_items(block->evil_C, ptr, prop, &item, &totitem, &free); for(i=0; ievil_C, ptr, prop, &item, &totitem, &free); for(i=0; ievil_C, ptr, prop, &item, &totitem, &free); uiBlockSetCurLayout(block, ui_item_local_sublayout(layout, layout, 1)); for(a=0; aroot->block->evil_C, &ptr, prop, &item, &totitem, &free); + if(RNA_enum_name(item, retval, &name)) { + if(free) MEM_freeN(item); return (char*)name; + } + + if(free) + MEM_freeN(item); } return ""; @@ -578,7 +586,7 @@ void uiItemEnumO(uiLayout *layout, char *name, int icon, char *opname, char *pro RNA_enum_set(&ptr, propname, value); if(!name) - name= ui_menu_enumpropname(opname, propname, value); + name= ui_menu_enumpropname(layout, opname, propname, value); uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext); } @@ -598,16 +606,19 @@ void uiItemsEnumO(uiLayout *layout, char *opname, char *propname) prop= RNA_struct_find_property(&ptr, propname); if(prop && RNA_property_type(prop) == PROP_ENUM) { - const EnumPropertyItem *item; - int totitem, i; + EnumPropertyItem *item; + int totitem, i, free; - RNA_property_enum_items(&ptr, prop, &item, &totitem); + RNA_property_enum_items(layout->root->block->evil_C, &ptr, prop, &item, &totitem, &free); for(i=0; iroot->block->evil_C, &ptr, prop, &item, NULL, &free); if(RNA_enum_value_from_id(item, value_str, &value)==0) { + if(free) MEM_freeN(item); printf("uiItemEnumO_string: %s.%s, enum %s not found.\n", RNA_struct_identifier(ptr.type), propname, value_str); return; } + + if(free) + MEM_freeN(item); } else { printf("uiItemEnumO_string: %s.%s not found.\n", RNA_struct_identifier(ptr.type), propname); @@ -640,7 +655,7 @@ void uiItemEnumO_string(uiLayout *layout, char *name, int icon, char *opname, ch /* same as uiItemEnumO */ if(!name) - name= ui_menu_enumpropname(opname, propname, value); + name= ui_menu_enumpropname(layout, opname, propname, value); uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext); } @@ -845,8 +860,8 @@ void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, char *value) { PropertyRNA *prop; - const EnumPropertyItem *item; - int ivalue, a; + EnumPropertyItem *item; + int ivalue, a, free; if(!ptr->data || !propname) return; @@ -859,9 +874,10 @@ void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRN return; } - RNA_property_enum_items(ptr, prop, &item, NULL); + RNA_property_enum_items(layout->root->block->evil_C, ptr, prop, &item, NULL, &free); if(!RNA_enum_value_from_id(item, value, &ivalue)) { + if(free) MEM_freeN(item); ui_item_disabled(layout, propname); printf("uiItemEnumR: enum property value not found: %s\n", value); return; @@ -873,6 +889,9 @@ void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRN break; } } + + if(free) + MEM_freeN(item); } void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname) @@ -887,16 +906,19 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname) } if(RNA_property_type(prop) == PROP_ENUM) { - const EnumPropertyItem *item; - int totitem, i; + EnumPropertyItem *item; + int totitem, i, free; - RNA_property_enum_items(ptr, prop, &item, &totitem); + RNA_property_enum_items(layout->root->block->evil_C, ptr, prop, &item, &totitem, &free); for(i=0; iptr, "type"); - if(RNA_enum_is_equal(op->ptr, "type", "SELECTED")) + if(type == 0) retval= mesh_separate_selected(scene, base); - else if(RNA_enum_is_equal(op->ptr, "type", "MATERIAL")) + else if(type == 1) retval= mesh_separate_material (scene, base); - else if(RNA_enum_is_equal(op->ptr, "type", "LOOSE")) + else if(type == 2) retval= mesh_separate_loose(scene, base); if(retval) { diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index ca0f73ece68..2995e2d895b 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -1227,12 +1227,29 @@ static int select_similar_exec(bContext *C, wmOperator *op) return similar_face_select_exec(C, op); } -static EnumPropertyItem *select_similar_type_itemf(PointerRNA *ptr) +static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *ptr, int *free) { - /* XXX need context! */ - return prop_simface_types; - return prop_simvertex_types; - return prop_simedge_types; + Object *obedit= CTX_data_edit_object(C); + + if(obedit && obedit->type == OB_MESH) { + EditMesh *em= BKE_mesh_get_editmesh(obedit->data); + EnumPropertyItem *item= NULL; + int totitem= 0; + + if(em->selectmode & SCE_SELECT_VERTEX) + RNA_enum_items_add(&item, &totitem, prop_simvertex_types); + else if(em->selectmode & SCE_SELECT_EDGE) + RNA_enum_items_add(&item, &totitem, prop_simedge_types); + else if(em->selectmode & SCE_SELECT_FACE) + RNA_enum_items_add(&item, &totitem, prop_simface_types); + RNA_enum_item_end(&item, &totitem); + + *free= 1; + + return item; + } + + return NULL; } void MESH_OT_select_similar(wmOperatorType *ot) diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 4377f459081..682b1ee4a64 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -5799,29 +5799,38 @@ static EnumPropertyItem merge_type_items[]= { {5, "COLLAPSE", 0, "Collapse", ""}, {0, NULL, 0, NULL, NULL}}; -static EnumPropertyItem *merge_type_itemf(PointerRNA *ptr) +static EnumPropertyItem *merge_type_itemf(bContext *C, PointerRNA *ptr, int *free) { - /* XXX need context here */ -#if 0 - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); - EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - if(em->selectmode & SCE_SELECT_VERTEX) - if(em->selected.first && em->selected.last && - ((EditSelection*)em->selected.first)->type == EDITVERT && ((EditSelection*)em->selected.last)->type == EDITVERT) - event = pupmenu("Merge %t|At First %x6|At Last%x1|At Center%x3|At Cursor%x4|Collapse%x2"); - else if (em->selected.first && ((EditSelection*)em->selected.first)->type == EDITVERT) - event = pupmenu("Merge %t|At First %x6|At Center%x3|At Cursor%x4|Collapse%x2"); - else if (em->selected.last && ((EditSelection*)em->selected.last)->type == EDITVERT) - event = pupmenu("Merge %t|At Last %x1|At Center%x3|At Cursor%x4|Collapse%x2"); - else event = pupmenu("Merge %t|At Center%x3|At Cursor%x4|Collapse%x2"); - else event = pupmenu("Merge %t|At Center%x3|At Cursor%x4|Collapse%x2"); + if(obedit && obedit->type == OB_MESH) { + EditMesh *em= BKE_mesh_get_editmesh(obedit->data); + EnumPropertyItem *item= NULL; + int totitem= 0; - BKE_mesh_end_editmesh(obedit->data, em); -#endif + if(em->selectmode & SCE_SELECT_VERTEX) { + if(em->selected.first && em->selected.last && + ((EditSelection*)em->selected.first)->type == EDITVERT && ((EditSelection*)em->selected.last)->type == EDITVERT) { + RNA_enum_item_add(&item, &totitem, &merge_type_items[0]); + RNA_enum_item_add(&item, &totitem, &merge_type_items[1]); + } + else if(em->selected.first && ((EditSelection*)em->selected.first)->type == EDITVERT) + RNA_enum_item_add(&item, &totitem, &merge_type_items[1]); + else if(em->selected.last && ((EditSelection*)em->selected.last)->type == EDITVERT) + RNA_enum_item_add(&item, &totitem, &merge_type_items[0]); + } + + RNA_enum_item_add(&item, &totitem, &merge_type_items[2]); + RNA_enum_item_add(&item, &totitem, &merge_type_items[3]); + RNA_enum_item_add(&item, &totitem, &merge_type_items[4]); + RNA_enum_item_end(&item, &totitem); + + *free= 1; + + return item; + } - return merge_type_items; + return NULL; } void MESH_OT_merge(wmOperatorType *ot) @@ -5841,7 +5850,7 @@ void MESH_OT_merge(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "type", merge_type_items, 6, "Type", "Merge method to use."); + prop= RNA_def_enum(ot->srna, "type", merge_type_items, 3, "Type", "Merge method to use."); RNA_def_enum_funcs(prop, merge_type_itemf); RNA_def_boolean(ot->srna, "uvs", 0, "UVs", "Move UVs according to merge."); } diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 6bc2f240859..cfe8dd4352d 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -75,7 +75,7 @@ static int vertex_specials_invoke(bContext *C, wmOperator *op, wmEvent *event) uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN); uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles"); - uiItemO(layout, "Merge...", 0, "MESH_OT_merge"); // mergmenu(em) + uiItemO(layout, "Merge...", 0, "MESH_OT_merge"); uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth"); uiItemO(layout, "Select Vertex Path", 0, "MESH_OT_select_vertex_path"); //uiItemO(layout, "Blend From Shape", 0, "MESH_OT_blend_from_shape"); @@ -387,6 +387,7 @@ void ED_keymap_mesh(wmWindowManager *wm) WM_keymap_add_item(keymap, "MESH_OT_colors_mirror",EIGHTKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "MESH_OT_rip",VKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "MESH_OT_merge", MKEY, KM_PRESS, KM_ALT, 0); /* add/remove */ WM_keymap_add_item(keymap, "MESH_OT_edge_face_add", FKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 0a9ed945c1d..9ea8907e172 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1379,20 +1379,21 @@ static EnumPropertyItem prop_clear_parent_types[] = { /* note, poll should check for editable scene */ static int parent_clear_exec(bContext *C, wmOperator *op) { + int type= RNA_enum_get(op->ptr, "type"); CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) { - if(RNA_enum_is_equal(op->ptr, "type", "CLEAR")) { + if(type == 0) { ob->parent= NULL; } - if(RNA_enum_is_equal(op->ptr, "type", "CLEAR_KEEP_TRANSFORM")) { + else if(type == 1) { ob->parent= NULL; ob->track= NULL; ED_object_apply_obmat(ob); } - if(RNA_enum_is_equal(op->ptr, "type", "CLEAR_INVERSE")) { + else if(type == 2) Mat4One(ob->parentinv); - } + ob->recalc |= OB_RECALC; } CTX_DATA_END; @@ -1435,6 +1436,8 @@ static EnumPropertyItem prop_clear_track_types[] = { /* note, poll should check for editable scene */ static int object_track_clear_exec(bContext *C, wmOperator *op) { + int type= RNA_enum_get(op->ptr, "type"); + if(CTX_data_edit_object(C)) { BKE_report(op->reports, RPT_ERROR, "Operation cannot be performed in EditMode"); return OPERATOR_CANCELLED; @@ -1443,9 +1446,8 @@ static int object_track_clear_exec(bContext *C, wmOperator *op) ob->track= NULL; ob->recalc |= OB_RECALC; - if(RNA_enum_is_equal(op->ptr, "type", "CLEAR_KEEP_TRANSFORM")) { + if(type == 1) ED_object_apply_obmat(ob); - } } CTX_DATA_END; @@ -2663,8 +2665,9 @@ static EnumPropertyItem prop_make_track_types[] = { static int track_set_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); + int type= RNA_enum_get(op->ptr, "type"); - if(RNA_enum_is_equal(op->ptr, "type", "TRACKTO")){ + if(type == 1) { bConstraint *con; bTrackToConstraint *data; @@ -2688,7 +2691,7 @@ static int track_set_exec(bContext *C, wmOperator *op) } CTX_DATA_END; } - else if(RNA_enum_is_equal(op->ptr, "type", "LOCKTRACK")){ + else if(type == 2) { bConstraint *con; bLockTrackConstraint *data; @@ -2712,7 +2715,7 @@ static int track_set_exec(bContext *C, wmOperator *op) } CTX_DATA_END; } - else if(RNA_enum_is_equal(op->ptr, "type", "OLDTRACK")){ + else { CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) { if(base!=BASACT) { base->object->track= BASACT->object; diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index a030603996c..868897b76ac 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -122,11 +122,6 @@ EnumPropertyItem sequencer_prop_effect_types[] = { }; /* mute operator */ -EnumPropertyItem sequencer_prop_operate_types[] = { /* better name? */ - {SEQ_SELECTED, "SELECTED", 0, "Selected", ""}, - {SEQ_UNSELECTED, "UNSELECTED", 0, "Unselected ", ""}, - {0, NULL, 0, NULL, NULL} -}; EnumPropertyItem prop_side_types[] = { {SEQ_SIDE_LEFT, "LEFT", 0, "Left", ""}, @@ -1491,8 +1486,7 @@ static int sequencer_mute_exec(bContext *C, wmOperator *op) if(ed==NULL) return OPERATOR_CANCELLED; - selected= RNA_enum_is_equal(op->ptr, "type", "SELECTED"); - + selected= !RNA_boolean_get(op->ptr, "unselected"); for(seq= ed->seqbasep->first; seq; seq= seq->next) { if ((seq->flag & SEQ_LOCK)==0) { @@ -1528,7 +1522,7 @@ void SEQUENCER_OT_mute(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", sequencer_prop_operate_types, SEQ_SELECTED, "Type", ""); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Mute unselected rather than selected strips."); } @@ -1543,8 +1537,7 @@ static int sequencer_unmute_exec(bContext *C, wmOperator *op) if(ed==NULL) return OPERATOR_CANCELLED; - selected= RNA_enum_is_equal(op->ptr, "type", "SELECTED"); - + selected= !RNA_boolean_get(op->ptr, "unselected"); for(seq= ed->seqbasep->first; seq; seq= seq->next) { if ((seq->flag & SEQ_LOCK)==0) { @@ -1580,7 +1573,7 @@ void SEQUENCER_OT_unmute(struct wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", sequencer_prop_operate_types, SEQ_SELECTED, "Type", ""); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "UnMute unselected rather than selected strips."); } diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index 82047272049..f561fb2ac43 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -116,11 +116,11 @@ void sequencer_keymap(wmWindowManager *wm) RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_cut", KKEY, KM_PRESS, 0, 0)->ptr, "type", SEQ_CUT_SOFT); RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_cut", KKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", SEQ_CUT_HARD); - RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_mute", HKEY, KM_PRESS, 0, 0)->ptr, "type", SEQ_SELECTED); - RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_mute", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", SEQ_UNSELECTED); + WM_keymap_add_item(keymap, "SEQUENCER_OT_mute", HKEY, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_mute", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1); - RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_unmute", HKEY, KM_PRESS, KM_ALT, 0)->ptr, "type", SEQ_SELECTED); - RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_unmute", HKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0)->ptr, "type", SEQ_UNSELECTED); + WM_keymap_add_item(keymap, "SEQUENCER_OT_unmute", HKEY, KM_PRESS, KM_ALT, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_unmute", HKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0)->ptr, "unselected", 1); WM_keymap_add_item(keymap, "SEQUENCER_OT_lock", LKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_unlock", HKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 70dde481018..112847272e5 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -203,10 +203,10 @@ void view3d_keymap(wmWindowManager *wm) /* selection*/ WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, 0, 0); - RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "type", 1); + RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", 1); WM_keymap_add_item(keymap, "VIEW3D_OT_select_border", BKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL, 0); - RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT|KM_CTRL, 0)->ptr, "type", 1); + RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT|KM_CTRL, 0)->ptr, "deselect", 1); WM_keymap_add_item(keymap, "VIEW3D_OT_select_circle", CKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_clip_border", BKEY, KM_PRESS, KM_ALT, 0); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index fedf3a30181..2537982210a 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -715,12 +715,6 @@ void view3d_lasso_select(bContext *C, ViewContext *vc, short mcords[][2], short } -static EnumPropertyItem lasso_select_types[] = { - {0, "SELECT", 0, "Select", ""}, - {1, "DESELECT", 0, "Deselect", ""}, - {0, NULL, 0, NULL, NULL} -}; - /* lasso operator gives properties, but since old code works with short array we convert */ @@ -747,7 +741,7 @@ static int view3d_lasso_select_exec(bContext *C, wmOperator *op) /* setup view context for argument to callbacks */ view3d_set_viewcontext(C, &vc); - select= RNA_enum_is_equal(op->ptr, "type", "SELECT"); + select= !RNA_boolean_get(op->ptr, "deselect"); view3d_lasso_select(C, &vc, mcords, i, select); return OPERATOR_FINISHED; @@ -769,7 +763,7 @@ void VIEW3D_OT_select_lasso(wmOperatorType *ot) ot->flag= OPTYPE_UNDO; RNA_def_collection_runtime(ot->srna, "path", &RNA_OperatorMousePath, "Path", ""); - RNA_def_enum(ot->srna, "type", lasso_select_types, 0, "Type", ""); + RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect rather than select items."); } @@ -1528,11 +1522,6 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) /* *****************Selection Operators******************* */ -static EnumPropertyItem prop_select_types[] = { - {0, "EXCLUSIVE", 0, "Exclusive", ""}, - {1, "EXTEND", 0, "Extend", ""}, - {0, NULL, 0, NULL, NULL} -}; /* ****** Border Select ****** */ void VIEW3D_OT_select_border(wmOperatorType *ot) @@ -1558,7 +1547,7 @@ void VIEW3D_OT_select_border(wmOperatorType *ot) RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); - RNA_def_enum(ot->srna, "type", prop_select_types, 0, "Type", ""); + RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everyting first."); } /* ****** Mouse Select ****** */ @@ -1567,7 +1556,7 @@ void VIEW3D_OT_select_border(wmOperatorType *ot) static int view3d_select_invoke(bContext *C, wmOperator *op, wmEvent *event) { Object *obedit= CTX_data_edit_object(C); - short extend= RNA_enum_is_equal(op->ptr, "type", "EXTEND"); + short extend= RNA_boolean_get(op->ptr, "extend"); view3d_operator_needs_opengl(C); @@ -1605,7 +1594,7 @@ void VIEW3D_OT_select(wmOperatorType *ot) ot->flag= OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", prop_select_types, 0, "Type", ""); + RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everyting first."); } diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 97fb3531718..dcd34011eef 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -109,10 +109,6 @@ TransformModeItem transform_modes[] = static int select_orientation_exec(bContext *C, wmOperator *op) { int orientation = RNA_enum_get(op->ptr, "orientation"); - int custom_index= RNA_int_get(op->ptr, "custom_index");; - - if(orientation == V3D_MANIP_CUSTOM) - orientation += custom_index; BIF_selectTransformOrientationValue(C, orientation); @@ -126,20 +122,26 @@ static int select_orientation_invoke(bContext *C, wmOperator *op, wmEvent *event pup= uiPupMenuBegin(C, "Orientation", 0); layout= uiPupMenuLayout(pup); - BIF_menuTransformOrientation(C, layout, NULL); + uiItemsEnumO(layout, "TFM_OT_select_orientation", "orientation"); uiPupMenuEnd(C, pup); return OPERATOR_CANCELLED; } +static EnumPropertyItem *select_orientation_itemf(bContext *C, PointerRNA *ptr, int *free) +{ + *free= 1; + return BIF_enumTransformOrientation(C); +} + void TFM_OT_select_orientation(struct wmOperatorType *ot) { + PropertyRNA *prop; static EnumPropertyItem orientation_items[]= { {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", ""}, {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal", ""}, {V3D_MANIP_LOCAL, "LOCAL", 0, "Local", ""}, {V3D_MANIP_VIEW, "VIEW", 0, "View", ""}, - {V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", ""}, {0, NULL, 0, NULL, NULL}}; /* identifiers */ @@ -151,8 +153,8 @@ void TFM_OT_select_orientation(struct wmOperatorType *ot) ot->exec = select_orientation_exec; ot->poll = ED_operator_areaactive; - RNA_def_enum(ot->srna, "orientation", orientation_items, V3D_MANIP_CUSTOM, "Orientation", "DOC_BROKEN"); - RNA_def_int(ot->srna, "custom_index", 0, 0, INT_MAX, "Custom Index", "", 0, INT_MAX); + prop= RNA_def_enum(ot->srna, "orientation", orientation_items, V3D_MANIP_GLOBAL, "Orientation", "DOC_BROKEN"); + RNA_def_enum_funcs(prop, select_orientation_itemf); } static void transformops_exit(bContext *C, wmOperator *op) diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 1e065de94e1..f3b373f0e48 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -59,6 +59,8 @@ #include "UI_interface.h" +#include "RNA_define.h" + #include "transform.h" /* *********************** TransSpace ************************** */ @@ -354,19 +356,37 @@ void BIF_selectTransformOrientationValue(bContext *C, int orientation) { v3d->twmode = orientation; } -void BIF_menuTransformOrientation(bContext *C, uiLayout *layout, void *arg) +EnumPropertyItem *BIF_enumTransformOrientation(bContext *C) { ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces; - TransformOrientation *ts; - int i= V3D_MANIP_CUSTOM; + TransformOrientation *ts = transform_spaces->first; + EnumPropertyItem global = {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", ""}; + EnumPropertyItem normal = {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal", ""}; + EnumPropertyItem local = {V3D_MANIP_LOCAL, "LOCAL", 0, "Local", ""}; + EnumPropertyItem view = {V3D_MANIP_VIEW, "VIEW", 0, "View", ""}; + EnumPropertyItem sepr = {0, "", 0, NULL, NULL}; + EnumPropertyItem tmp = {0, "", 0, "", ""}; + EnumPropertyItem *item= NULL; + int i = V3D_MANIP_CUSTOM, totitem= 0; + + RNA_enum_item_add(&item, &totitem, &global); + RNA_enum_item_add(&item, &totitem, &normal); + RNA_enum_item_add(&item, &totitem, &local); + RNA_enum_item_add(&item, &totitem, &view); + + if(ts) + RNA_enum_item_add(&item, &totitem, &sepr); + + for(; ts; ts = ts->next) { + tmp.identifier = "CUSTOM"; + tmp.name= ts->name; + tmp.value = i++; + RNA_enum_item_add(&item, &totitem, &tmp); + } - uiItemEnumO(layout, NULL, 0, "TFM_OT_select_orientation", "orientation", V3D_MANIP_GLOBAL); - uiItemEnumO(layout, NULL, 0, "TFM_OT_select_orientation", "orientation", V3D_MANIP_LOCAL); - uiItemEnumO(layout, NULL, 0, "TFM_OT_select_orientation", "orientation", V3D_MANIP_NORMAL); - uiItemEnumO(layout, NULL, 0, "TFM_OT_select_orientation", "orientation", V3D_MANIP_VIEW); + RNA_enum_item_end(&item, &totitem); - for(ts = transform_spaces->first; ts; ts = ts->next) - uiItemIntO(layout, ts->name, 0, "TFM_OT_select_orientation", "custom_index", i++); + return item; } char * BIF_menustringTransformOrientation(const bContext *C, char *title) { diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 3b2520c41b2..93fbc8b5f17 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -548,12 +548,12 @@ void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin, void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax); void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision); -int RNA_enum_identifier(const EnumPropertyItem *item, const int value, const char **identifier); -int RNA_enum_name(const EnumPropertyItem *item, const int value, const char **name); +int RNA_enum_identifier(EnumPropertyItem *item, const int value, const char **identifier); +int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name); -void RNA_property_enum_items(PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **item, int *totitem); -int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value); -int RNA_property_enum_identifier(PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier); +void RNA_property_enum_items(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free); +int RNA_property_enum_value(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value); +int RNA_property_enum_identifier(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier); StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop); @@ -677,11 +677,11 @@ void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values) int RNA_enum_get(PointerRNA *ptr, const char *name); void RNA_enum_set(PointerRNA *ptr, const char *name, int value); -int RNA_enum_is_equal(PointerRNA *ptr, const char *name, const char *enumname); +int RNA_enum_is_equal(struct bContext *C, PointerRNA *ptr, const char *name, const char *enumname); /* lower level functions that donr use a PointerRNA */ -int RNA_enum_value_from_id(const EnumPropertyItem *item, const char *identifier, int *value); -int RNA_enum_id_from_value(const EnumPropertyItem *item, int value, const char **identifier); +int RNA_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int *value); +int RNA_enum_id_from_value(EnumPropertyItem *item, int value, const char **identifier); void RNA_string_get(PointerRNA *ptr, const char *name, char *value); char *RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen); diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index 69f5b5adc37..a3fa97bf4b1 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -160,6 +160,13 @@ void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret); void RNA_def_function_flag(FunctionRNA *func, int flag); void RNA_def_function_ui_description(FunctionRNA *func, const char *description); +/* Dynamic Enums + * strings are not freed, assumed pointing to static location. */ + +void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, EnumPropertyItem *item); +void RNA_enum_items_add(EnumPropertyItem **items, int *totitem, EnumPropertyItem *item); +void RNA_enum_item_end(EnumPropertyItem **items, int *totitem); + #ifdef __cplusplus } #endif diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 98646acd727..dc2a2a1a1de 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -157,7 +157,7 @@ typedef struct EnumPropertyItem { const char *description; } EnumPropertyItem; -typedef EnumPropertyItem *(*EnumPropertyItemFunc)(PointerRNA *ptr); +typedef EnumPropertyItem *(*EnumPropertyItemFunc)(struct bContext *C, PointerRNA *ptr, int *free); typedef struct PropertyRNA PropertyRNA; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index ec509dbf863..5230c260dbd 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1597,7 +1597,6 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr DefRNA.error= 1; } } - else if(eprop->itemf); else { fprintf(stderr, "rna_generate_structs: %s%s.%s, enum must have items defined.\n", srna->identifier, errnest, prop->identifier); DefRNA.error= 1; diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 42f6250728f..f20df81d6ad 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -640,17 +640,19 @@ StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop) return &RNA_UnknownType; } -void RNA_property_enum_items(PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **item, int *totitem) +void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free) { EnumPropertyRNA *eprop= (EnumPropertyRNA*)rna_ensure_property(prop); int tot; - if(eprop->itemf) { - *item= eprop->itemf(ptr); - if(totitem) { + *free= 0; + + if(C && eprop->itemf) { + *item= eprop->itemf(C, ptr, free); + + if(totitem) for(tot=0; (*item)[tot].identifier; tot++); - *totitem= tot; - } + *totitem= tot; } else { *item= eprop->item; @@ -659,11 +661,12 @@ void RNA_property_enum_items(PointerRNA *ptr, PropertyRNA *prop, const EnumPrope } } -int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value) +int RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value) { - const EnumPropertyItem *item; + EnumPropertyItem *item; + int free; - RNA_property_enum_items(ptr, prop, &item, NULL); + RNA_property_enum_items(C, ptr, prop, &item, NULL, &free); for(; item->identifier; item++) { if(item->identifier[0] && strcmp(item->identifier, identifier)==0) { @@ -672,10 +675,13 @@ int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *iden } } + if(free) + MEM_freeN(item); + return 0; } -int RNA_enum_identifier(const EnumPropertyItem *item, const int value, const char **identifier) +int RNA_enum_identifier(EnumPropertyItem *item, const int value, const char **identifier) { for (; item->identifier; item++) { if(item->identifier[0] && item->value==value) { @@ -686,7 +692,7 @@ int RNA_enum_identifier(const EnumPropertyItem *item, const int value, const cha return 0; } -int RNA_enum_name(const EnumPropertyItem *item, const int value, const char **name) +int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name) { for (; item->identifier; item++) { if(item->identifier[0] && item->value==value) { @@ -697,12 +703,17 @@ int RNA_enum_name(const EnumPropertyItem *item, const int value, const char **na return 0; } -int RNA_property_enum_identifier(PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier) +int RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier) { - const EnumPropertyItem *item= NULL; + EnumPropertyItem *item= NULL; + int result, free; - RNA_property_enum_items(ptr, prop, &item, NULL); - return RNA_enum_identifier(item, value, identifier); + RNA_property_enum_items(C, ptr, prop, &item, NULL, &free); + result= RNA_enum_identifier(item, value, identifier); + if(free) + MEM_freeN(item); + + return result; } const char *RNA_property_ui_name(PropertyRNA *prop) @@ -2384,18 +2395,22 @@ void RNA_enum_set(PointerRNA *ptr, const char *name, int value) printf("RNA_enum_set: %s.%s not found.\n", ptr->type->identifier, name); } -int RNA_enum_is_equal(PointerRNA *ptr, const char *name, const char *enumname) +int RNA_enum_is_equal(bContext *C, PointerRNA *ptr, const char *name, const char *enumname) { PropertyRNA *prop= RNA_struct_find_property(ptr, name); - const EnumPropertyItem *item; + EnumPropertyItem *item; + int free; if(prop) { - RNA_property_enum_items(ptr, prop, &item, NULL); + RNA_property_enum_items(C, ptr, prop, &item, NULL, &free); for(; item->identifier; item++) if(strcmp(item->identifier, enumname) == 0) return (item->value == RNA_property_enum_get(ptr, prop)); + if(free) + MEM_freeN(item); + printf("RNA_enum_is_equal: %s.%s item %s not found.\n", ptr->type->identifier, name, enumname); return 0; } @@ -2405,7 +2420,7 @@ int RNA_enum_is_equal(PointerRNA *ptr, const char *name, const char *enumname) } } -int RNA_enum_value_from_id(const EnumPropertyItem *item, const char *identifier, int *value) +int RNA_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int *value) { for( ; item->identifier; item++) { if(strcmp(item->identifier, identifier)==0) { @@ -2417,7 +2432,7 @@ int RNA_enum_value_from_id(const EnumPropertyItem *item, const char *identifier, return 0; } -int RNA_enum_id_from_value(const EnumPropertyItem *item, int value, const char **identifier) +int RNA_enum_id_from_value(EnumPropertyItem *item, int value, const char **identifier) { for( ; item->identifier; item++) { if(item->value==value) { @@ -2659,7 +2674,7 @@ char *RNA_property_as_string(PointerRNA *ptr, PropertyRNA *prop) const char *identifier; int val = RNA_property_enum_get(ptr, prop); - if(RNA_property_enum_identifier(ptr, prop, val, &identifier)) { + if(RNA_property_enum_identifier(NULL, ptr, prop, val, &identifier)) { BLI_dynstr_appendf(dynstr, "'%s'", identifier); } else { diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index cda1716f664..cd3642f65a2 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -68,6 +68,17 @@ EnumPropertyItem constraint_type_items[] ={ {CONSTRAINT_TYPE_NULL, "NULL", 0, "Null", ""}, {0, NULL, 0, NULL, NULL}}; +EnumPropertyItem space_pchan_items[] = { + {0, "WORLD", 0, "World Space", ""}, + {2, "POSE", 0, "Pose Space", ""}, + {3, "LOCAL_WITH_PARENT", 0, "Local With Parent", ""}, + {1, "LOCAL", 0, "Local Space", ""}, + {0, NULL, 0, NULL, NULL}}; + +EnumPropertyItem space_object_items[] = { + {0, "WORLD", 0, "World Space", ""}, + {1, "LOCAL", 0, "Local (Without Parent) Space", ""}, + {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME @@ -166,19 +177,7 @@ static void rna_Constraint_influence_update(bContext *C, PointerRNA *ptr) rna_Constraint_update(C, ptr); } -static EnumPropertyItem space_pchan_items[] = { - {0, "WORLD", 0, "World Space", ""}, - {2, "POSE", 0, "Pose Space", ""}, - {3, "LOCAL_WITH_PARENT", 0, "Local With Parent", ""}, - {1, "LOCAL", 0, "Local Space", ""}, - {0, NULL, 0, NULL, NULL}}; - -static EnumPropertyItem space_object_items[] = { - {0, "WORLD", 0, "World Space", ""}, - {1, "LOCAL", 0, "Local (Without Parent) Space", ""}, - {0, NULL, 0, NULL, NULL}}; - -static EnumPropertyItem *rna_Constraint_owner_space_itemf(PointerRNA *ptr) +static EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *C, PointerRNA *ptr, int *free) { Object *ob= (Object*)ptr->id.data; bConstraint *con= (bConstraint*)ptr->data; @@ -189,7 +188,7 @@ static EnumPropertyItem *rna_Constraint_owner_space_itemf(PointerRNA *ptr) return space_object_items; } -static EnumPropertyItem *rna_Constraint_target_space_itemf(PointerRNA *ptr) +static EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *C, PointerRNA *ptr, int *free) { bConstraint *con= (bConstraint*)ptr->data; bConstraintTypeInfo *cti= constraint_get_typeinfo(con); @@ -1505,11 +1504,13 @@ void RNA_def_constraint(BlenderRNA *brna) prop= RNA_def_property(srna, "owner_space", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ownspace"); + RNA_def_property_enum_items(prop, space_pchan_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_owner_space_itemf"); RNA_def_property_ui_text(prop, "Owner Space", "Space that owner is evaluated in."); prop= RNA_def_property(srna, "target_space", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "tarspace"); + RNA_def_property_enum_items(prop, space_pchan_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Constraint_target_space_itemf"); RNA_def_property_ui_text(prop, "Target Space", "Space that target is evaluated in."); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 2b414adf05b..07515d3ad56 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1112,7 +1112,7 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item switch(prop->type) { case PROP_ENUM: { EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop; - eprop->item= item; + eprop->item= (EnumPropertyItem*)item; eprop->totitem= 0; for(i=0; item[i].identifier; i++) { eprop->totitem++; @@ -2262,3 +2262,37 @@ int rna_parameter_size(PropertyRNA *parm) return sizeof(void *); } +/* Dynamic Enums */ + +void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, EnumPropertyItem *item) +{ + EnumPropertyItem *newitems; + int tot= *totitem; + + if(tot == 0) { + *items= MEM_callocN(sizeof(EnumPropertyItem)*8, "RNA_enum_items_add"); + } + else if(tot >= 8 && (tot&(tot-1)) == 0){ + /* power of two > 8 */ + newitems= MEM_callocN(sizeof(EnumPropertyItem)*tot*2, "RNA_enum_items_add"); + memcpy(newitems, *items, sizeof(EnumPropertyItem)*tot); + MEM_freeN(*items); + *items= newitems; + } + + (*items)[tot]= *item; + *totitem= tot+1; +} + +void RNA_enum_items_add(EnumPropertyItem **items, int *totitem, EnumPropertyItem *item) +{ + for(; item->identifier; item++) + RNA_enum_item_add(items, totitem, item); +} + +void RNA_enum_item_end(EnumPropertyItem **items, int *totitem) +{ + static EnumPropertyItem empty = {0, NULL, 0, NULL, NULL}; + RNA_enum_item_add(items, totitem, &empty); +} + diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 401b430ebc9..b63e347e165 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -68,7 +68,7 @@ typedef int (*PropStringLengthFunc)(struct PointerRNA *ptr); typedef void (*PropStringSetFunc)(struct PointerRNA *ptr, const char *value); typedef int (*PropEnumGetFunc)(struct PointerRNA *ptr); typedef void (*PropEnumSetFunc)(struct PointerRNA *ptr, int value); -typedef EnumPropertyItem *(*PropEnumItemFunc)(struct PointerRNA *ptr); +typedef EnumPropertyItem *(*PropEnumItemFunc)(struct bContext *C, struct PointerRNA *ptr, int *free); typedef PointerRNA (*PropPointerGetFunc)(struct PointerRNA *ptr); typedef StructRNA* (*PropPointerTypeFunc)(struct PointerRNA *ptr); typedef void (*PropPointerSetFunc)(struct PointerRNA *ptr, const PointerRNA value); @@ -225,7 +225,7 @@ typedef struct EnumPropertyRNA { PropEnumSetFunc set; PropEnumItemFunc itemf; - const EnumPropertyItem *item; + EnumPropertyItem *item; int totitem; int defaultvalue; diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index bb19b66b34d..c4f2c29409f 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -40,6 +40,57 @@ #include "WM_types.h" #include "WM_api.h" +EnumPropertyItem part_from_items[] = { + {PART_FROM_VERT, "VERT", 0, "Verts", ""}, + {PART_FROM_FACE, "FACE", 0, "Faces", ""}, + {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""}, + {0, NULL, 0, NULL, NULL} +}; + +EnumPropertyItem part_reactor_from_items[] = { + {PART_FROM_VERT, "VERT", 0, "Verts", ""}, + {PART_FROM_FACE, "FACE", 0, "Faces", ""}, + {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""}, + {PART_FROM_PARTICLE, "PARTICLE", 0, "Particle", ""}, + {0, NULL, 0, NULL, NULL} +}; + +EnumPropertyItem part_draw_as_items[] = { + {PART_DRAW_NOT, "NONE", 0, "None", ""}, + {PART_DRAW_REND, "RENDER", 0, "Rendered", ""}, + {PART_DRAW_DOT, "DOT", 0, "Point", ""}, + {PART_DRAW_CIRC, "CIRC", 0, "Circle", ""}, + {PART_DRAW_CROSS, "CROSS", 0, "Cross", ""}, + {PART_DRAW_AXIS, "AXIS", 0, "Axis", ""}, + {0, NULL, 0, NULL, NULL} +}; + +EnumPropertyItem part_hair_draw_as_items[] = { + {PART_DRAW_NOT, "NONE", 0, "None", ""}, + {PART_DRAW_REND, "RENDER", 0, "Rendered", ""}, + {PART_DRAW_PATH, "PATH", 0, "Path", ""}, + {0, NULL, 0, NULL, NULL} +}; + +EnumPropertyItem part_ren_as_items[] = { + {PART_DRAW_NOT, "NONE", 0, "None", ""}, + {PART_DRAW_HALO, "HALO", 0, "Halo", ""}, + {PART_DRAW_LINE, "LINE", 0, "Line", ""}, + {PART_DRAW_PATH, "PATH", 0, "Path", ""}, + {PART_DRAW_OB, "OBJECT", 0, "Object", ""}, + {PART_DRAW_GR, "GROUP", 0, "Group", ""}, + {PART_DRAW_BB, "BILLBOARD", 0, "Billboard", ""}, + {0, NULL, 0, NULL, NULL} +}; + +EnumPropertyItem part_hair_ren_as_items[] = { + {PART_DRAW_NOT, "NONE", 0, "None", ""}, + {PART_DRAW_PATH, "PATH", 0, "Path", ""}, + {PART_DRAW_OB, "OBJECT", 0, "Object", ""}, + {PART_DRAW_GR, "GROUP", 0, "Group", ""}, + {0, NULL, 0, NULL, NULL} +}; + #ifdef RNA_RUNTIME #include "BKE_context.h" @@ -248,85 +299,34 @@ static void rna_ParticleSystem_name_get(PointerRNA *ptr, char *str) strcpy(str, ""); } -static EnumPropertyItem from_items[] = { - {PART_FROM_VERT, "VERT", 0, "Vertexes", ""}, - {PART_FROM_FACE, "FACE", 0, "Faces", ""}, - {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""}, - {0, NULL, 0, NULL, NULL} -}; - -static EnumPropertyItem reactor_from_items[] = { - {PART_FROM_VERT, "VERT", 0, "Vertexes", ""}, - {PART_FROM_FACE, "FACE", 0, "Faces", ""}, - {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""}, - {PART_FROM_PARTICLE, "PARTICLE", 0, "Particle", ""}, - {0, NULL, 0, NULL, NULL} -}; - -static EnumPropertyItem *rna_Particle_from_itemf(PointerRNA *ptr) +static EnumPropertyItem *rna_Particle_from_itemf(bContext *C, PointerRNA *ptr, int *free) { ParticleSettings *part = ptr->id.data; if(part->type==PART_REACTOR) - return reactor_from_items; + return part_reactor_from_items; else - return from_items; + return part_from_items; } -static EnumPropertyItem draw_as_items[] = { - {PART_DRAW_NOT, "NONE", 0, "None", ""}, - {PART_DRAW_REND, "RENDER", 0, "Rendered", ""}, - {PART_DRAW_DOT, "DOT", 0, "Point", ""}, - {PART_DRAW_CIRC, "CIRC", 0, "Circle", ""}, - {PART_DRAW_CROSS, "CROSS", 0, "Cross", ""}, - {PART_DRAW_AXIS, "AXIS", 0, "Axis", ""}, - {0, NULL, 0, NULL, NULL} -}; - -static EnumPropertyItem hair_draw_as_items[] = { - {PART_DRAW_NOT, "NONE", 0, "None", ""}, - {PART_DRAW_REND, "RENDER", 0, "Rendered", ""}, - {PART_DRAW_PATH, "PATH", 0, "Path", ""}, - {0, NULL, 0, NULL, NULL} -}; - -static EnumPropertyItem ren_as_items[] = { - {PART_DRAW_NOT, "NONE", 0, "None", ""}, - {PART_DRAW_HALO, "HALO", 0, "Halo", ""}, - {PART_DRAW_LINE, "LINE", 0, "Line", ""}, - {PART_DRAW_PATH, "PATH", 0, "Path", ""}, - {PART_DRAW_OB, "OBJECT", 0, "Object", ""}, - {PART_DRAW_GR, "GROUP", 0, "Group", ""}, - {PART_DRAW_BB, "BILLBOARD", 0, "Billboard", ""}, - {0, NULL, 0, NULL, NULL} -}; - -static EnumPropertyItem hair_ren_as_items[] = { - {PART_DRAW_NOT, "NONE", 0, "None", ""}, - {PART_DRAW_PATH, "PATH", 0, "Path", ""}, - {PART_DRAW_OB, "OBJECT", 0, "Object", ""}, - {PART_DRAW_GR, "GROUP", 0, "Group", ""}, - {0, NULL, 0, NULL, NULL} -}; - -static EnumPropertyItem *rna_Particle_draw_as_itemf(PointerRNA *ptr) +static EnumPropertyItem *rna_Particle_draw_as_itemf(bContext *C, PointerRNA *ptr, int *free) { ParticleSettings *part = ptr->id.data; if(part->type==PART_HAIR) - return hair_draw_as_items; + return part_hair_draw_as_items; else - return draw_as_items; + return part_draw_as_items; } -static EnumPropertyItem *rna_Particle_ren_as_itemf(PointerRNA *ptr) +static EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *C, PointerRNA *ptr, int *free) { ParticleSettings *part = ptr->id.data; if(part->type==PART_HAIR) - return hair_ren_as_items; + return part_hair_ren_as_items; else - return ren_as_items; + return part_ren_as_items; } @@ -801,6 +801,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "emit_from", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "from"); + RNA_def_property_enum_items(prop, part_reactor_from_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_from_itemf"); RNA_def_property_ui_text(prop, "Emit From", "Where to emit particles from"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); @@ -914,12 +915,14 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "draw_as", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "draw_as"); + RNA_def_property_enum_items(prop, part_draw_as_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_draw_as_itemf"); RNA_def_property_ui_text(prop, "Particle Drawing", "How particles are drawn in viewport"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); prop= RNA_def_property(srna, "ren_as", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ren_as"); + RNA_def_property_enum_items(prop, part_ren_as_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_ren_as_itemf"); RNA_def_property_ui_text(prop, "Particle Rendering", "How particles are rendered"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 996e54384e2..b4422541718 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -173,7 +173,7 @@ static EnumPropertyItem dc_rgb_items[] = {DC_RGB, DC_LCMS, DC_ZERO}; static EnumPropertyItem dc_alpha_items[] = {DC_RGB, DC_RGBA, DC_ALPHA, DC_LCMS, DC_ZERO}; static EnumPropertyItem dc_z_items[] = {DC_RGB, DC_Z, DC_LCMS, DC_ZERO}; -static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(PointerRNA *ptr) +static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, PointerRNA *ptr, int *free) { SpaceImage *sima= (SpaceImage*)ptr->data; ImBuf *ibuf= ED_space_image_buffer(sima); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index c6fbda0caef..49bca247431 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -223,10 +223,16 @@ static void pyrna_struct_dealloc( BPy_StructRNA * self ) static char *pyrna_enum_as_string(PointerRNA *ptr, PropertyRNA *prop) { - const EnumPropertyItem *item; + EnumPropertyItem *item; + char *result; + int free; - RNA_property_enum_items(ptr, prop, &item, NULL); - return (char*)BPy_enum_as_string((EnumPropertyItem*)item); + RNA_property_enum_items(BPy_GetContext(), ptr, prop, &item, NULL, &free); + result= (char*)BPy_enum_as_string(item); + if(free) + MEM_freeN(item); + + return result; } PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop) @@ -309,14 +315,15 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop) const char *identifier; int val = RNA_property_enum_get(ptr, prop); - if (RNA_property_enum_identifier(ptr, prop, val, &identifier)) { + if (RNA_property_enum_identifier(BPy_GetContext(), ptr, prop, val, &identifier)) { ret = PyUnicode_FromString( identifier ); } else { - const EnumPropertyItem *item; + EnumPropertyItem *item; + int free; /* don't throw error here, can't trust blender 100% to give the * right values, python code should not generate error for that */ - RNA_property_enum_items(ptr, prop, &item, NULL); + RNA_property_enum_items(BPy_GetContext(), ptr, prop, &item, NULL, &free); if(item->identifier) { ret = PyUnicode_FromString( item->identifier ); } @@ -329,6 +336,9 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop) ret = PyUnicode_FromString( "" ); } + if(free) + MEM_freeN(item); + /*PyErr_Format(PyExc_AttributeError, "RNA Error: Current value \"%d\" matches no enum", val); ret = NULL;*/ } @@ -626,7 +636,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v return -1; } else { int val; - if (RNA_property_enum_value(ptr, prop, param, &val)) { + if (RNA_property_enum_value(BPy_GetContext(), ptr, prop, param, &val)) { if(data) *((int*)data)= val; else RNA_property_enum_set(ptr, prop, val); } else { @@ -1818,19 +1828,23 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data) const char *identifier; int val = *(int*)data; - if (RNA_property_enum_identifier(ptr, prop, val, &identifier)) { + if (RNA_property_enum_identifier(BPy_GetContext(), ptr, prop, val, &identifier)) { ret = PyUnicode_FromString( identifier ); } else { - const EnumPropertyItem *item; + EnumPropertyItem *item; + int free; /* don't throw error here, can't trust blender 100% to give the * right values, python code should not generate error for that */ - RNA_property_enum_items(ptr, prop, &item, NULL); + RNA_property_enum_items(BPy_GetContext(), ptr, prop, &item, NULL, &free); if(item[0].identifier) ret = PyUnicode_FromString( item[0].identifier ); else ret = PyUnicode_FromString( "" ); + if(free) + MEM_freeN(item); + /*PyErr_Format(PyExc_AttributeError, "RNA Error: Current value \"%d\" matches no enum", val); ret = NULL;*/ } diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index bce73b903c0..9f1ef0c6251 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -412,7 +412,8 @@ char *BPy_enum_as_string(EnumPropertyItem *item) char *cstring; for (e= item; item->identifier; item++) { - BLI_dynstr_appendf(dynstr, (e==item)?"'%s'":", '%s'", item->identifier); + if(item->identifier[0]) + BLI_dynstr_appendf(dynstr, (e==item)?"'%s'":", '%s'", item->identifier); } cstring = BLI_dynstr_get_cstring(dynstr); -- cgit v1.2.3 From ad59d04c77a9b096fd4d7454b0d59e9bf30ffca6 Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Fri, 10 Jul 2009 20:18:19 +0000 Subject: Yes!! a nice font again!! Matt, I found the problem in one of my previous commit, so I revert all my changes and now the font look good again. Also remove all the options (kerning, overlap and user kerning), I want to make this a little better. --- source/blender/blenfont/BLF_api.h | 6 +-- source/blender/blenfont/intern/blf.c | 9 ----- source/blender/blenfont/intern/blf_font.c | 45 +++------------------- source/blender/blenfont/intern/blf_glyph.c | 12 +----- .../blender/blenfont/intern/blf_internal_types.h | 3 -- source/blender/editors/interface/interface_style.c | 13 ------- source/blender/makesdna/DNA_userdef_types.h | 3 -- source/blender/makesrna/intern/rna_userdef.c | 10 ----- 8 files changed, 9 insertions(+), 92 deletions(-) (limited to 'source') diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index c373fde5693..53f108f87eb 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -90,7 +90,6 @@ void BLF_default_rotation(float angle); void BLF_rotation(float angle); void BLF_clipping(float xmin, float ymin, float xmax, float ymax); void BLF_blur(int size); -void BLF_kerning(float space); void BLF_enable(int option); void BLF_disable(int option); @@ -137,10 +136,7 @@ void BLF_dir_free(char **dirs, int count); /* font->flags. */ #define BLF_ROTATION (1<<0) #define BLF_CLIPPING (1<<1) -#define BLF_FONT_KERNING (1<<2) -#define BLF_USER_KERNING (1<<3) -#define BLF_SHADOW (1<<4) -#define BLF_OVERLAP_CHAR (1<<5) +#define BLF_SHADOW (1<<2) /* font->mode. */ #define BLF_MODE_TEXTURE 0 diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index a7e599fabf9..9a249c2f241 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -505,15 +505,6 @@ void BLF_mode(int mode) font->mode= mode; } -void BLF_kerning(float space) -{ - FontBLF *font; - - font= global_font[global_font_cur]; - if (font) - font->kerning= space; -} - void BLF_shadow(int level, float r, float g, float b, float a) { FontBLF *font; diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index a3c5232cc76..989746ca501 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -101,7 +101,7 @@ void blf_font_draw(FontBLF *font, char *str) GlyphBLF *g, *g_prev; FT_Vector delta; FT_UInt glyph_index, g_prev_index; - float pen_x, pen_y, old_pen_x; + int pen_x, pen_y; int i, has_kerning; if (!font->glyph_cache) @@ -139,33 +139,17 @@ void blf_font_draw(FontBLF *font, char *str) else if (font->mode == BLF_MODE_TEXTURE && (!g->tex_data)) g= blf_glyph_add(font, glyph_index, c); - if ((font->flags & BLF_FONT_KERNING) && has_kerning && g_prev) { - old_pen_x= pen_x; + if (has_kerning && g_prev) { delta.x= 0; delta.y= 0; if (FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta) == 0) { pen_x += delta.x >> 6; - - if (font->flags & BLF_OVERLAP_CHAR) { - if (pen_x < old_pen_x) - pen_x= old_pen_x; - } - } - } - - if (font->flags & BLF_USER_KERNING) { - old_pen_x= pen_x; - pen_x += font->kerning; - - if (font->flags & BLF_OVERLAP_CHAR) { - if (pen_x < old_pen_x) - pen_x= old_pen_x; } } /* do not return this loop if clipped, we want every character tested */ - blf_glyph_render(font, g, pen_x, pen_y); + blf_glyph_render(font, g, (float)pen_x, (float)pen_y); pen_x += g->advance; g_prev= g; @@ -180,7 +164,7 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) FT_Vector delta; FT_UInt glyph_index, g_prev_index; rctf gbox; - float pen_x, pen_y, old_pen_x; + int pen_x, pen_y; int i, has_kerning; if (!font->glyph_cache) @@ -223,28 +207,12 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) else if (font->mode == BLF_MODE_TEXTURE && (!g->tex_data)) g= blf_glyph_add(font, glyph_index, c); - if ((font->flags & BLF_FONT_KERNING) && has_kerning && g_prev) { - old_pen_x= pen_x; + if (has_kerning && g_prev) { delta.x= 0; delta.y= 0; if (FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta) == 0) { pen_x += delta.x >> 6; - - if (font->flags & BLF_OVERLAP_CHAR) { - if (pen_x < old_pen_x) - pen_x= old_pen_x; - } - } - } - - if (font->flags & BLF_USER_KERNING) { - old_pen_x= pen_x; - pen_x += font->kerning; - - if (font->flags & BLF_OVERLAP_CHAR) { - if (pen_x < old_pen_x) - pen_x= old_pen_x; } } @@ -329,10 +297,9 @@ void blf_font_fill(FontBLF *font) font->clip_rec.xmax= 0.0f; font->clip_rec.ymin= 0.0f; font->clip_rec.ymax= 0.0f; - font->flags= BLF_USER_KERNING | BLF_FONT_KERNING; + font->flags= 0; font->dpi= 0; font->size= 0; - font->kerning= 0.0f; font->cache.first= NULL; font->cache.last= NULL; font->glyph_cache= NULL; diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index a637774d7bf..d2767d6ffb1 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -213,11 +213,7 @@ GlyphBLF *blf_glyph_texture_add(FontBLF *font, FT_UInt index, unsigned int c) else do_new= 1; - if (font->flags & BLF_FONT_KERNING) - err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_BITMAP); - else - err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); - + err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); if (err) return(NULL); @@ -332,11 +328,7 @@ GlyphBLF *blf_glyph_bitmap_add(FontBLF *font, FT_UInt index, unsigned int c) else do_new= 1; - if (font->flags & BLF_FONT_KERNING) - err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_BITMAP); - else - err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); - + err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); if (err) return(NULL); diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h index 5382ac19aae..64d95986867 100644 --- a/source/blender/blenfont/intern/blf_internal_types.h +++ b/source/blender/blenfont/intern/blf_internal_types.h @@ -177,9 +177,6 @@ typedef struct FontBLF { /* font size. */ int size; - /* kerning space, user setting. */ - float kerning; - /* max texture size. */ int max_tex_size; diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index e8fba38f793..9ff1f2d6b29 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -91,8 +91,6 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->paneltitle.uifont_id= UIFONT_DEFAULT; style->paneltitle.points= 13; - style->paneltitle.kerning= 0.0; - style->paneltitle.overlap= 0; style->paneltitle.shadow= 5; style->paneltitle.shadx= 2; style->paneltitle.shady= -2; @@ -101,8 +99,6 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->grouplabel.uifont_id= UIFONT_DEFAULT; style->grouplabel.points= 12; - style->grouplabel.kerning= 0.0; - style->grouplabel.overlap= 0; style->grouplabel.shadow= 3; style->grouplabel.shadx= 1; style->grouplabel.shady= -1; @@ -110,8 +106,6 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->widgetlabel.uifont_id= UIFONT_DEFAULT; style->widgetlabel.points= 11; - style->widgetlabel.kerning= 0.0; - style->widgetlabel.overlap= 0; style->widgetlabel.shadow= 3; style->widgetlabel.shadx= 1; style->widgetlabel.shady= -1; @@ -120,7 +114,6 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->widget.uifont_id= UIFONT_DEFAULT; style->widget.points= 11; - style->widget.kerning= 0.0; style->widget.shadowalpha= 0.25f; style->columnspace= 5; @@ -174,15 +167,10 @@ void uiStyleFontDraw(uiFontStyle *fs, rcti *rect, char *str) BLF_shadow_offset(fs->shadx, fs->shady); } - if (fs->overlap) - BLF_enable(BLF_OVERLAP_CHAR); - BLF_draw(str); BLF_disable(BLF_CLIPPING); if (fs->shadow) BLF_disable(BLF_SHADOW); - if (fs->overlap) - BLF_disable(BLF_OVERLAP_CHAR); } /* ************** helpers ************************ */ @@ -263,6 +251,5 @@ void uiStyleFontSet(uiFontStyle *fs) BLF_set(font->blf_id); BLF_size(fs->points, U.dpi); - BLF_kerning(fs->kerning); } diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 771a7e43793..dec3fde8f53 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -66,9 +66,6 @@ typedef struct uiFont { typedef struct uiFontStyle { short uifont_id; /* saved in file, 0 is default */ short points; /* actual size depends on 'global' dpi */ - float kerning; /* kerning space between characters. */ - short overlap; /* check overlaped characters. */ - short pad; short italic, bold; /* style hint */ short shadow; /* value is amount of pixels blur */ short shadx, shady; /* shadow offset in pixels */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 609082144e1..a2bc652ad1a 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -137,16 +137,6 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Points", ""); RNA_def_property_update(prop, NC_WINDOW, NULL); - prop= RNA_def_property(srna, "kerning", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, -5.0, 5.0); - RNA_def_property_ui_text(prop, "Kerning", "User kerning value in pixels"); - RNA_def_property_update(prop, NC_WINDOW, NULL); - - prop= RNA_def_property(srna, "overlap", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "overlap", 1); - RNA_def_property_ui_text(prop, "Overlap", "Check for overlap characters"); - RNA_def_property_update(prop, NC_WINDOW, NULL); - prop= RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 5); RNA_def_property_ui_text(prop, "Shadow Size", "Shadow size in pixels (0, 3 and 5 supported)"); -- cgit v1.2.3 From 395025d67ec9374039703d591d6d44b664f79dcd Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 10 Jul 2009 20:43:32 +0000 Subject: 2.5: * Default panel zoom level user preference, when creating new button windows or pressing home-key to reset. Patch by Matt D., thanks! --- source/blender/editors/interface/interface.c | 2 +- source/blender/editors/interface/interface_style.c | 2 ++ source/blender/editors/interface/view2d.c | 9 +++++++-- source/blender/editors/interface/view2d_ops.c | 11 ++++++----- source/blender/makesdna/DNA_userdef_types.h | 4 +++- source/blender/makesrna/intern/rna_userdef.c | 4 ++++ 6 files changed, 23 insertions(+), 9 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 391be4ba591..6f86e3e809a 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1615,7 +1615,7 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, shor block= MEM_callocN(sizeof(uiBlock), "uiBlock"); block->active= 1; block->dt= dt; - block->evil_C= C; // XXX + block->evil_C= (void*)C; // XXX BLI_strncpy(block->name, name, sizeof(block->name)); if(region) diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 9ff1f2d6b29..83eb8a32701 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -89,6 +89,8 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) BLI_addtail(styles, style); BLI_strncpy(style->name, name, MAX_STYLE_NAME); + style->panelzoom= 1.0; + style->paneltitle.uifont_id= UIFONT_DEFAULT; style->paneltitle.points= 13; style->paneltitle.shadow= 5; diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index fcac1987fdc..e0e2af5472d 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -155,7 +155,8 @@ static void view2d_masks(View2D *v2d) void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) { short tot_changed= 0; - + uiStyle *style= U.uistyles.first; + /* initialise data if there is a need for such */ if ((v2d->flag & V2D_IS_INITIALISED) == 0) { /* set initialised flag so that View2D doesn't get reinitialised next time again */ @@ -250,7 +251,11 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) v2d->tot.ymax= 0.0f; v2d->tot.ymin= -winy; - v2d->cur= v2d->tot; + v2d->cur.xmin= 0.0f; + v2d->cur.xmax= winx*style->panelzoom; + + v2d->cur.ymax= 0.0f; + v2d->cur.ymin= -winy*style->panelzoom; } break; diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 101d89da618..54ab0d9ef61 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1273,6 +1273,7 @@ void VIEW2D_OT_scroller_activate(wmOperatorType *ot) static int reset_exec(bContext *C, wmOperator *op) { + uiStyle *style= U.uistyles.first; ARegion *ar= CTX_wm_region(C); View2D *v2d= &ar->v2d; int winx, winy; @@ -1283,26 +1284,26 @@ static int reset_exec(bContext *C, wmOperator *op) v2d->cur.xmax= v2d->cur.xmin + winx; v2d->cur.ymax= v2d->cur.ymin + winy; - + /* align */ if(v2d->align) { /* posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) { v2d->cur.xmax= 0.0f; - v2d->cur.xmin= v2d->winx; + v2d->cur.xmin= v2d->winx*style->panelzoom; } else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) { - v2d->cur.xmax= v2d->cur.xmax - v2d->cur.xmin; + v2d->cur.xmax= (v2d->cur.xmax - v2d->cur.xmin)*style->panelzoom; v2d->cur.xmin= 0.0f; } /* - posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) { v2d->cur.ymax= 0.0f; - v2d->cur.ymin= -v2d->winy; + v2d->cur.ymin= -v2d->winy*style->panelzoom; } else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) { - v2d->cur.ymax= v2d->cur.ymax - v2d->cur.ymin; + v2d->cur.ymax= (v2d->cur.ymax - v2d->cur.ymin)*style->panelzoom; v2d->cur.ymin= 0.0f; } } diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index dec3fde8f53..fcb10a33fda 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -92,6 +92,8 @@ typedef struct uiStyle { uiFontStyle widgetlabel; uiFontStyle widget; + float panelzoom; + short minlabelchars; /* in characters */ short minwidgetchars; /* in characters */ @@ -103,7 +105,7 @@ typedef struct uiStyle { short panelspace; short panelouter; - short pad[3]; + short pad[1]; } uiStyle; typedef struct uiWidgetColors { diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index a2bc652ad1a..03bd0c9cfe2 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -174,6 +174,10 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna) RNA_def_struct_sdna(srna, "uiStyle"); RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets."); + prop= RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.5, 2.0); + RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas."); + prop= RNA_def_property(srna, "paneltitle", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "paneltitle"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); -- cgit v1.2.3 From b80b581bc03b6df28bd3a10118d85b78d5ca011b Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Fri, 10 Jul 2009 22:16:25 +0000 Subject: Allow the user set which style to use for the kerning value. This are freetype2 options: Unfitted - Scaled but un-grid-fitted kerning distances Default - Scaled and grid-fitted kerning distances We always use Unfitted, but the "Default" style give better result here, so please test and if nobody complain we can set this style as the default. --- source/blender/blenfont/BLF_api.h | 1 + source/blender/blenfont/intern/blf_font.c | 20 ++++++++++++++------ source/blender/editors/interface/interface_style.c | 9 +++++++++ source/blender/makesdna/DNA_userdef_types.h | 2 ++ source/blender/makesrna/intern/rna_userdef.c | 11 +++++++++++ 5 files changed, 37 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index 53f108f87eb..99934a80143 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -137,6 +137,7 @@ void BLF_dir_free(char **dirs, int count); #define BLF_ROTATION (1<<0) #define BLF_CLIPPING (1<<1) #define BLF_SHADOW (1<<2) +#define BLF_KERNING_DEFAULT (1<<3) /* font->mode. */ #define BLF_MODE_TEXTURE 0 diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 989746ca501..affc35ea11e 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -102,7 +102,7 @@ void blf_font_draw(FontBLF *font, char *str) FT_Vector delta; FT_UInt glyph_index, g_prev_index; int pen_x, pen_y; - int i, has_kerning; + int i, has_kerning, st; if (!font->glyph_cache) return; @@ -143,9 +143,13 @@ void blf_font_draw(FontBLF *font, char *str) delta.x= 0; delta.y= 0; - if (FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta) == 0) { + if (font->flags & BLF_KERNING_DEFAULT) + st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, ft_kerning_default, &delta); + else + st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta); + + if (st == 0) pen_x += delta.x >> 6; - } } /* do not return this loop if clipped, we want every character tested */ @@ -165,7 +169,7 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) FT_UInt glyph_index, g_prev_index; rctf gbox; int pen_x, pen_y; - int i, has_kerning; + int i, has_kerning, st; if (!font->glyph_cache) return; @@ -211,9 +215,13 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) delta.x= 0; delta.y= 0; - if (FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta) == 0) { + if (font->flags & BLF_KERNING_DEFAULT) + st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, ft_kerning_default, &delta); + else + st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta); + + if (st == 0) pen_x += delta.x >> 6; - } } gbox.xmin= g->box.xmin + pen_x; diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 83eb8a32701..57f35f71927 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -93,6 +93,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->paneltitle.uifont_id= UIFONT_DEFAULT; style->paneltitle.points= 13; + style->paneltitle.kerning= 0; style->paneltitle.shadow= 5; style->paneltitle.shadx= 2; style->paneltitle.shady= -2; @@ -101,6 +102,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->grouplabel.uifont_id= UIFONT_DEFAULT; style->grouplabel.points= 12; + style->grouplabel.kerning= 0; style->grouplabel.shadow= 3; style->grouplabel.shadx= 1; style->grouplabel.shady= -1; @@ -108,6 +110,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->widgetlabel.uifont_id= UIFONT_DEFAULT; style->widgetlabel.points= 11; + style->widgetlabel.kerning= 0; style->widgetlabel.shadow= 3; style->widgetlabel.shadx= 1; style->widgetlabel.shady= -1; @@ -116,6 +119,7 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name) style->widget.uifont_id= UIFONT_DEFAULT; style->widget.points= 11; + style->widget.kerning= 0; style->widget.shadowalpha= 0.25f; style->columnspace= 5; @@ -169,10 +173,15 @@ void uiStyleFontDraw(uiFontStyle *fs, rcti *rect, char *str) BLF_shadow_offset(fs->shadx, fs->shady); } + if (fs->kerning == 1) + BLF_enable(BLF_KERNING_DEFAULT); + BLF_draw(str); BLF_disable(BLF_CLIPPING); if (fs->shadow) BLF_disable(BLF_SHADOW); + if (fs->kerning == 1) + BLF_disable(BLF_KERNING_DEFAULT); } /* ************** helpers ************************ */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index fcb10a33fda..0709d2d58b0 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -66,6 +66,8 @@ typedef struct uiFont { typedef struct uiFontStyle { short uifont_id; /* saved in file, 0 is default */ short points; /* actual size depends on 'global' dpi */ + short kerning; /* unfitted or default kerning value. */ + char pad[6]; short italic, bold; /* style hint */ short shadow; /* value is amount of pixels blur */ short shadx, shady; /* shadow offset in pixels */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 03bd0c9cfe2..977c43e6b95 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -128,6 +128,11 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; + static EnumPropertyItem font_kerning_style[] = { + {0, "UNFITTED", 0, "Unfitted", "Use scaled but un-grid-fitted kerning distances."}, + {1, "DEFAULT", 0, "Default", "Use scaled and grid-fitted kerning distances."}, + {0, NULL, 0, NULL, NULL}}; + srna= RNA_def_struct(brna, "ThemeFontStyle", NULL); RNA_def_struct_sdna(srna, "uiFontStyle"); RNA_def_struct_ui_text(srna, "Font Style", "Theme settings for Font."); @@ -137,6 +142,12 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Points", ""); RNA_def_property_update(prop, NC_WINDOW, NULL); + prop= RNA_def_property(srna, "font_kerning_style", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "kerning"); + RNA_def_property_enum_items(prop, font_kerning_style); + RNA_def_property_ui_text(prop, "Kerning Style", "Which style to use for font kerning."); + RNA_def_property_update(prop, NC_WINDOW, NULL); + prop= RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 5); RNA_def_property_ui_text(prop, "Shadow Size", "Shadow size in pixels (0, 3 and 5 supported)"); -- cgit v1.2.3 From 66a81a4062b8cc01452316c8eeb442b0acf2663e Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 10 Jul 2009 23:25:30 +0000 Subject: NLA SoC: Names for NLA Strips In order to be able to better identify NLA Strips (and to reduce the complexity of the text on them), I've implemented a name property for the strips. The names are made to be unique within the AnimData block the strip comes from, though this may not always happen if not enough relevant context info is present to validate this. --- source/blender/blenkernel/BKE_nla.h | 4 ++ source/blender/blenkernel/intern/nla.c | 93 +++++++++++++++++++++++++- source/blender/editors/space_nla/nla_buttons.c | 3 +- source/blender/editors/space_nla/nla_draw.c | 25 ++----- source/blender/editors/space_nla/nla_edit.c | 31 +++++++-- source/blender/makesdna/DNA_anim_types.h | 2 + source/blender/makesrna/intern/rna_nla.c | 22 ++++++ 7 files changed, 152 insertions(+), 28 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 04d4b0f8da2..bb5a2782663 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -83,6 +83,10 @@ struct NlaStrip *BKE_nlastrip_find_active(struct NlaTrack *nlt); short BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max); +void BKE_nlastrip_validate_name(struct AnimData *adt, struct NlaStrip *strip); + +/* ............ */ + short BKE_nlatrack_has_animated_strips(struct NlaTrack *nlt); short BKE_nlatracks_have_animated_strips(ListBase *tracks); void BKE_nlastrip_validate_fcurves(struct NlaStrip *strip); diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index c697f639021..a240de209d9 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -30,12 +30,14 @@ #include #include #include +#include #include #include #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" +#include "BLI_ghash.h" #include "DNA_anim_types.h" #include "DNA_action_types.h" @@ -326,6 +328,9 @@ NlaStrip *add_nlastrip_to_stack (AnimData *adt, bAction *act) BKE_nlatrack_add_strip(nlt, strip); } + /* automatically name it too */ + BKE_nlastrip_validate_name(adt, strip); + /* returns the strip added */ return strip; } @@ -503,7 +508,7 @@ float BKE_nla_tweakedit_remap (AnimData *adt, float cframe, short mode) } /* *************************************************** */ -/* Basic Utilities */ +/* NLA API */ /* List of Strips ------------------------------------ */ /* (these functions are used for NLA-Tracks and also for nested/meta-strips) */ @@ -1140,8 +1145,90 @@ void BKE_nlastrip_validate_fcurves (NlaStrip *strip) } } } - -/* Tools ------------------------------------------- */ + +/* Sanity Validation ------------------------------------ */ + +/* Find (and set) a unique name for a strip from the whole AnimData block + * Uses a similar method to the BLI method, but is implemented differently + * as we need to ensure that the name is unique over several lists of tracks, + * not just a single track. + */ +void BKE_nlastrip_validate_name (AnimData *adt, NlaStrip *strip) +{ + GHash *gh; + NlaStrip *tstrip; + NlaTrack *nlt; + + /* sanity checks */ + if ELEM(NULL, adt, strip) + return; + + /* give strip a default name if none already */ + if (strip->name[0]==0) { + switch (strip->type) { + case NLASTRIP_TYPE_CLIP: /* act-clip */ + sprintf(strip->name, "Act: %s", (strip->act)?(strip->act->id.name+2):("")); + break; + case NLASTRIP_TYPE_TRANSITION: /* transition */ + sprintf(strip->name, "Transition"); + break; + case NLASTRIP_TYPE_META: /* meta */ + sprintf(strip->name, "Meta"); + break; + default: + sprintf(strip->name, "NLA Strip"); + break; + } + } + + /* build a hash-table of all the strips in the tracks + * - this is easier than iterating over all the tracks+strips hierarchy everytime + * (and probably faster) + */ + gh= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp); + + for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { + for (tstrip= nlt->strips.first; tstrip; tstrip= tstrip->next) { + /* don't add the strip of interest */ + if (tstrip == strip) + continue; + + /* use the name of the strip as the key, and the strip as the value, since we're mostly interested in the keys */ + BLI_ghash_insert(gh, tstrip->name, tstrip); + } + } + + /* if the hash-table has a match for this name, try other names... + * - in an extreme case, it might not be able to find a name, but then everything else in Blender would fail too :) + */ + if (BLI_ghash_haskey(gh, strip->name)) { + char tempname[128]; + int number = 1; + char *dot; + + /* Strip off the suffix */ + dot = strchr(strip->name, '.'); + if (dot) *dot=0; + + /* Try different possibilities */ + for (number = 1; number <= 999; number++) { + /* assemble alternative name */ + BLI_snprintf(tempname, 128, "%s%c%03d", strip->name, ".", number); + + /* if hash doesn't have this, set it */ + if (BLI_ghash_haskey(gh, tempname) == 0) { + BLI_strncpy(strip->name, tempname, sizeof(strip->name)); + break; + } + } + } + + /* free the hash... */ + BLI_ghash_free(gh, NULL, NULL); +} + + +/* Core Tools ------------------------------------------- */ /* For the given AnimData block, add the active action to the NLA * stack (i.e. 'push-down' action). The UI should only allow this diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index c0a2b9476e3..a74037d1ace 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -215,7 +215,8 @@ static void nla_panel_properties(const bContext *C, Panel *pa) /* Strip Properties ------------------------------------- */ /* strip type */ - row= uiLayoutRow(layout, 1); + row= uiLayoutColumn(layout, 1); + uiItemR(row, NULL, ICON_NLA, &strip_ptr, "name", 0, 0, 0); // XXX icon? uiItemR(row, NULL, 0, &strip_ptr, "type", 0, 0, 0); /* strip extents */ diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 7fb15c62277..8d56670a149 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -445,26 +445,11 @@ static void nla_draw_strip_text (NlaTrack *nlt, NlaStrip *strip, int index, View else sprintf(dir, "->"); - /* for now, just init the string with fixed-formats */ - switch (strip->type) { - case NLASTRIP_TYPE_TRANSITION: /* Transition */ - sprintf(str, "%d | Transition | %.2f %s %.2f", - index, strip->start, dir, strip->end); - break; - - case NLASTRIP_TYPE_META: /* Meta */ - sprintf(str, "%d | %sMeta | %.2f %s %.2f", - index, ((strip->flag & NLASTRIP_FLAG_TEMP_META)?"Temp-":""), - strip->start, dir, strip->end); - break; - - case NLASTRIP_TYPE_CLIP: /* Action-Clip (default) */ - default: - sprintf(str, "%d | Act: %s | %.2f %s %.2f", - index, ((strip->act)?strip->act->id.name+2:""), - strip->start, dir, strip->end); - break; - } + /* just print the name and the range */ + if (strip->flag & NLASTRIP_FLAG_TEMP_META) + sprintf(str, "Temp-Meta | %.2f %s %.2f", strip->start, dir, strip->end); + else + sprintf(str, "%s | %.2f %s %.2f", strip->name, strip->start, dir, strip->end); /* set text colour - if colours (see above) are light, draw black text, otherwise draw white */ if (strip->flag & (NLASTRIP_FLAG_ACTIVE|NLASTRIP_FLAG_SELECT|NLASTRIP_FLAG_TWEAKUSER)) diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index cb151429dd1..9ddd8daab0d 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -307,6 +307,9 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op) nlt= add_nlatrack(adt, NULL); BKE_nlatrack_add_strip(nlt, strip); } + + /* auto-name it */ + BKE_nlastrip_validate_name(adt, strip); } /* free temp data */ @@ -363,6 +366,7 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op) /* for each track, find pairs of strips to add transitions to */ for (ale= anim_data.first; ale; ale= ale->next) { NlaTrack *nlt= (NlaTrack *)ale->data; + AnimData *adt= BKE_animdata_from_id(ale->id); NlaStrip *s1, *s2; /* get initial pair of strips */ @@ -410,6 +414,9 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op) strip->scale= 1.0f; strip->repeat = 1.0f; + /* auto-name it */ + BKE_nlastrip_validate_name(adt, strip); + /* make note of this */ done++; } @@ -470,9 +477,18 @@ static int nlaedit_add_meta_exec (bContext *C, wmOperator *op) /* for each track, find pairs of strips to add transitions to */ for (ale= anim_data.first; ale; ale= ale->next) { NlaTrack *nlt= (NlaTrack *)ale->data; + AnimData *adt= BKE_animdata_from_id(ale->id); + NlaStrip *strip; /* create meta-strips from the continuous chains of selected strips */ BKE_nlastrips_make_metas(&nlt->strips, 0); + + /* name the metas */ + for (strip= nlt->strips.first; strip; strip= strip->next) { + /* auto-name this strip if selected (that means it is a meta) */ + if (strip->flag & NLASTRIP_FLAG_SELECT) + BKE_nlastrip_validate_name(adt, strip); + } } /* free temp data */ @@ -605,6 +621,9 @@ static int nlaedit_duplicate_exec (bContext *C, wmOperator *op) /* deselect the original and the active flag */ strip->flag &= ~(NLASTRIP_FLAG_SELECT|NLASTRIP_FLAG_ACTIVE); + /* auto-name it */ + BKE_nlastrip_validate_name(adt, strip); + done++; } } @@ -728,7 +747,7 @@ void NLA_OT_delete (wmOperatorType *ot) // - variable-length splits? /* split a given Action-Clip strip */ -static void nlaedit_split_strip_actclip (NlaTrack *nlt, NlaStrip *strip) +static void nlaedit_split_strip_actclip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip) { NlaStrip *nstrip; float midframe, midaframe, len; @@ -765,10 +784,13 @@ static void nlaedit_split_strip_actclip (NlaTrack *nlt, NlaStrip *strip) /* clear the active flag from the copy */ nstrip->flag &= ~NLASTRIP_FLAG_ACTIVE; + + /* auto-name the new strip */ + BKE_nlastrip_validate_name(adt, nstrip); } /* split a given Meta strip */ -static void nlaedit_split_strip_meta (NlaTrack *nlt, NlaStrip *strip) +static void nlaedit_split_strip_meta (AnimData *adt, NlaTrack *nlt, NlaStrip *strip) { /* simply ungroup it for now... */ BKE_nlastrips_clear_metastrip(&nlt->strips, strip); @@ -795,6 +817,7 @@ static int nlaedit_split_exec (bContext *C, wmOperator *op) /* for each NLA-Track, split all selected strips into two strips */ for (ale= anim_data.first; ale; ale= ale->next) { NlaTrack *nlt= (NlaTrack *)ale->data; + AnimData *adt= BKE_animdata_from_id(ale->id); NlaStrip *strip, *next; for (strip= nlt->strips.first; strip; strip= next) { @@ -805,11 +828,11 @@ static int nlaedit_split_exec (bContext *C, wmOperator *op) /* splitting method depends on the type of strip */ switch (strip->type) { case NLASTRIP_TYPE_CLIP: /* action-clip */ - nlaedit_split_strip_actclip(nlt, strip); + nlaedit_split_strip_actclip(adt, nlt, strip); break; case NLASTRIP_TYPE_META: /* meta-strips need special handling */ - nlaedit_split_strip_meta(nlt, strip); + nlaedit_split_strip_meta(adt, nlt, strip); break; default: /* for things like Transitions, do not split! */ diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index d71beb8785b..fed0c490014 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -445,6 +445,8 @@ typedef struct NlaStrip { ListBase fcurves; /* F-Curves for controlling this strip's influence and timing */ // TODO: move out? ListBase modifiers; /* F-Curve modifiers to be applied to the entire strip's referenced F-Curves */ + char name[64]; /* User-Visible Identifier for Strip */ + float influence; /* Influence of strip */ float strip_time; /* Current 'time' within action being used (automatically evaluated, but can be overridden) */ diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 97f35af1db7..bc636af6849 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -41,11 +41,27 @@ #include /* needed for some of the validation stuff... */ +#include "BKE_animsys.h" #include "BKE_nla.h" /* temp constant defined for these funcs only... */ #define NLASTRIP_MIN_LEN_THRESH 0.1f +void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value) +{ + NlaStrip *data= (NlaStrip *)ptr->data; + + /* copy the name first */ + BLI_strncpy(data->name, value, sizeof(data->name)); + + /* validate if there's enough info to do so */ + if (ptr->id.data) { + AnimData *adt= BKE_animdata_from_id(ptr->id.data); + BKE_nlastrip_validate_name(adt, data); + } +} + + static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) { NlaStrip *data= (NlaStrip*)ptr->data; @@ -255,6 +271,12 @@ void rna_def_nlastrip(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "NLA Strip", "A container referencing an existing Action."); RNA_def_struct_ui_icon(srna, ICON_NLA); // XXX + /* name property */ + prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); + RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_NlaStrip_name_set"); + RNA_def_struct_name_property(srna, prop); + /* Enums */ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); -- cgit v1.2.3 From 1105ee701ed20d6301a174fc4285de00f8e0f95e Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 11 Jul 2009 03:09:44 +0000 Subject: NLA SoC: Quick commit of skeleton of auto-blending setting code to be completed later... --- source/blender/blenkernel/intern/nla.c | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'source') diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index a240de209d9..457df9be7a9 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1227,6 +1227,62 @@ void BKE_nlastrip_validate_name (AnimData *adt, NlaStrip *strip) BLI_ghash_free(gh, NULL, NULL); } +/* ---- */ + +/* Determine auto-blending for the given strip */ +void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls) +{ + NlaTrack *track; + NlaStrip *strip; + //float *ps=NULL, *pe=NULL; + //float *ns=NULL, *ne=NULL; + + /* sanity checks */ + if ELEM(NULL, nls, nlt) + return; + if ((nlt->prev == NULL) && (nlt->next == NULL)) + return; + if ((nls->flag & NLASTRIP_FLAG_AUTO_BLENDS)==0) + return; + + /* get test ranges */ + if (nlt->prev) { + /* find strips that overlap over the start/end of the given strip, + * but which don't cover the entire length + */ + track= nlt->prev; + for (strip= track->strips.first; strip; strip= strip->next) { + + } + } + if (nlt->next) { + /* find strips that overlap over the start/end of the given strip, + * but which don't cover the entire length + */ + track= nlt->next; + for (strip= track->strips.first; strip; strip= strip->next) { + + } + } +} + +/* Ensure that auto-blending and other settings are set correctly */ +void BKE_nla_validate_state (AnimData *adt) +{ + NlaStrip *strip; + NlaTrack *nlt; + + /* sanity checks */ + if ELEM(NULL, adt, adt->nla_tracks.first) + return; + + /* adjust blending values for auto-blending */ + for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { + for (strip= nlt->strips.first; strip; strip= strip->next) { + BKE_nlastrip_validate_autoblends(nlt, strip); + } + } +} /* Core Tools ------------------------------------------- */ -- cgit v1.2.3 From a7287165dbd4d0fbbe446a7bb71fd2b947bcf4f8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 11 Jul 2009 07:46:11 +0000 Subject: remove duplicate function. --- source/blender/editors/space_graph/graph_draw.c | 40 ------------------------- 1 file changed, 40 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 8b242794ca3..f8f613223db 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -775,46 +775,6 @@ void graph_draw_ghost_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, Vie glDisable(GL_BLEND); } -/* check if any FModifiers to draw controls for - fcm is 'active' modifier */ -static short fcurve_needs_draw_fmodifier_controls (FCurve *fcu, FModifier *fcm) -{ - /* don't draw if there aren't any modifiers at all */ - if (fcu->modifiers.first == NULL) - return 0; - - /* if there's an active modifier - don't draw if it doesn't drastically - * alter the curve... - */ - if (fcm) { - switch (fcm->type) { - /* clearly harmless */ - case FMODIFIER_TYPE_CYCLES: - return 0; - - /* borderline... */ - case FMODIFIER_TYPE_NOISE: - return 0; - } - } - - /* if only one modifier - don't draw if it is muted or disabled */ - if (fcu->modifiers.first == fcu->modifiers.last) { - fcm= fcu->modifiers.first; - if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) - return 0; - } - - /* if only active modifier - don't draw if it is muted or disabled */ - if (fcm) { - if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) - return 0; - } - - /* if we're still here, this means that there are modifiers with controls to be drawn */ - // FIXME: what happens if all the modifiers were muted/disabled - return 1; -} - /* This is called twice from space_graph.c -> graph_main_area_draw() * Unselected then selected F-Curves are drawn so that they do not occlude each other. */ -- cgit v1.2.3 From a7837efb16d244acbdc32bfacb97279728e64252 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 11 Jul 2009 10:20:48 +0000 Subject: 2.5 - Added descriptions to all Animation Editor operators DopeSheet and Graph Editor operators were missing these, since many of these operators were written before that field was added. NLA Editor's operators already have them. --- source/blender/editors/animation/anim_channels.c | 11 +++++++++++ source/blender/editors/mesh/meshtools.c | 5 +++++ source/blender/editors/space_action/action_edit.c | 17 ++++++++++++++++- source/blender/editors/space_action/action_select.c | 4 ++++ source/blender/editors/space_graph/graph_edit.c | 20 +++++++++++++++++++- source/blender/editors/space_graph/graph_header.c | 1 + source/blender/editors/space_graph/graph_select.c | 4 ++++ 7 files changed, 60 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index 5c31d007705..6cb00f9285b 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -799,6 +799,7 @@ void ANIM_OT_channels_delete (wmOperatorType *ot) /* identifiers */ ot->name= "Delete Channels"; ot->idname= "ANIM_OT_channels_delete"; + ot->description= "Delete all selected animation channels."; /* api callbacks */ ot->exec= animchannels_delete_exec; @@ -869,6 +870,7 @@ void ANIM_OT_channels_visibility_toggle (wmOperatorType *ot) /* identifiers */ ot->name= "Toggle Visibility"; ot->idname= "ANIM_OT_channels_visibility_toggle"; + ot->description= "Toggle visibility in Graph Editor of all selected animation channels."; /* api callbacks */ ot->exec= animchannels_visibility_toggle_exec; @@ -1134,6 +1136,7 @@ void ANIM_OT_channels_setting_enable (wmOperatorType *ot) /* identifiers */ ot->name= "Enable Channel Setting"; ot->idname= "ANIM_OT_channels_setting_enable"; + ot->description= "Enable specified setting on all selected animation channels."; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1155,6 +1158,7 @@ void ANIM_OT_channels_setting_disable (wmOperatorType *ot) /* identifiers */ ot->name= "Disable Channel Setting"; ot->idname= "ANIM_OT_channels_setting_disable"; + ot->description= "Disable specified setting on all selected animation channels."; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1176,6 +1180,7 @@ void ANIM_OT_channels_setting_toggle (wmOperatorType *ot) /* identifiers */ ot->name= "Toggle Channel Setting"; ot->idname= "ANIM_OT_channels_setting_toggle"; + ot->description= "Toggle specified setting on all selected animation channels."; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1198,6 +1203,7 @@ void ANIM_OT_channels_editable_toggle (wmOperatorType *ot) /* identifiers */ ot->name= "Toggle Channel Editability"; ot->idname= "ANIM_OT_channels_editable_toggle"; + ot->description= "Toggle editability of selected channels."; /* api callbacks */ ot->exec= animchannels_setflag_exec; @@ -1242,6 +1248,7 @@ void ANIM_OT_channels_expand (wmOperatorType *ot) /* identifiers */ ot->name= "Expand Channels"; ot->idname= "ANIM_OT_channels_expand"; + ot->description= "Expand (i.e. open) all selected expandable animation channels."; /* api callbacks */ ot->exec= animchannels_expand_exec; @@ -1283,6 +1290,7 @@ void ANIM_OT_channels_collapse (wmOperatorType *ot) /* identifiers */ ot->name= "Collapse Channels"; ot->idname= "ANIM_OT_channels_collapse"; + ot->description= "Collapse (i.e. close) all selected expandable animation channels."; /* api callbacks */ ot->exec= animchannels_collapse_exec; @@ -1322,6 +1330,7 @@ void ANIM_OT_channels_select_all_toggle (wmOperatorType *ot) /* identifiers */ ot->name= "Select All"; ot->idname= "ANIM_OT_channels_select_all_toggle"; + ot->description= "Toggle selection of all animation channels."; /* api callbacks */ ot->exec= animchannels_deselectall_exec; @@ -1451,6 +1460,7 @@ void ANIM_OT_channels_select_border(wmOperatorType *ot) /* identifiers */ ot->name= "Border Select"; ot->idname= "ANIM_OT_channels_select_border"; + ot->description= "Select all animation channels within the specified region."; /* api callbacks */ ot->invoke= WM_border_select_invoke; @@ -1857,6 +1867,7 @@ void ANIM_OT_channels_click (wmOperatorType *ot) /* identifiers */ ot->name= "Mouse Click on Channels"; ot->idname= "ANIM_OT_channels_click"; + ot->description= "Handle mouse-clicks over animation channels."; /* api callbacks */ ot->invoke= animchannels_mouseclick_invoke; diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index f8f0030b258..df3e2a5685c 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -105,6 +105,11 @@ static int pupmenu() {return 0;} /* join selected meshes into the active mesh, context sensitive return 0 if no join is made (error) and 1 of the join is done */ + +// XXX NOTE to whoever ports this: +// Check the version of this code in the animsys2 branch, which has been nicely commented, +// but more importantly has proper support for handling meshes with shapekeys (instead of lamely bailing out)! +// -- Aligorith, July 2009 int join_mesh(Scene *scene, View3D *v3d, wmOperator *op) { Base *base, *nextb; diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 8d2d342e28a..d4709e94e5e 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -101,7 +101,7 @@ static void get_keyframe_extents (bAnimContext *ac, float *min, float *max) int filter; /* get data to filter, from Action or Dopesheet */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* set large values to try to override */ @@ -178,6 +178,7 @@ void ACT_OT_previewrange_set (wmOperatorType *ot) /* identifiers */ ot->name= "Auto-Set Preview Range"; ot->idname= "ACT_OT_previewrange_set"; + ot->description= "Set Preview Range based on extents of selected Keyframes."; /* api callbacks */ ot->exec= actkeys_previewrange_exec; @@ -225,6 +226,7 @@ void ACT_OT_view_all (wmOperatorType *ot) /* identifiers */ ot->name= "View All"; ot->idname= "ACT_OT_view_all"; + ot->description= "Reset viewable area to show full keyframe range."; /* api callbacks */ ot->exec= actkeys_viewall_exec; @@ -309,6 +311,7 @@ void ACT_OT_copy (wmOperatorType *ot) /* identifiers */ ot->name= "Copy Keyframes"; ot->idname= "ACT_OT_copy"; + ot->description= "Copy selected keyframes to the copy/paste buffer."; /* api callbacks */ ot->exec= actkeys_copy_exec; @@ -353,6 +356,7 @@ void ACT_OT_paste (wmOperatorType *ot) /* identifiers */ ot->name= "Paste Keyframes"; ot->idname= "ACT_OT_paste"; + ot->description= "Paste keyframes from copy/paste buffer for the selected channels, starting on the current frame."; /* api callbacks */ ot->exec= actkeys_paste_exec; @@ -449,6 +453,7 @@ void ACT_OT_insert_keyframe (wmOperatorType *ot) /* identifiers */ ot->name= "Insert Keyframes"; ot->idname= "ACT_OT_insert_keyframe"; + ot->description= "Insert keyframes for the specified channels."; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -526,6 +531,7 @@ void ACT_OT_duplicate (wmOperatorType *ot) /* identifiers */ ot->name= "Duplicate Keyframes"; ot->idname= "ACT_OT_duplicate"; + ot->description= "Make a copy of all selected keyframes."; /* api callbacks */ ot->invoke= actkeys_duplicate_invoke; @@ -593,6 +599,7 @@ void ACT_OT_delete (wmOperatorType *ot) /* identifiers */ ot->name= "Delete Keyframes"; ot->idname= "ACT_OT_delete"; + ot->description= "Remove all selected keyframes."; /* api callbacks */ ot->invoke= WM_operator_confirm; @@ -656,6 +663,7 @@ void ACT_OT_clean (wmOperatorType *ot) /* identifiers */ ot->name= "Clean Keyframes"; ot->idname= "ACT_OT_clean"; + ot->description= "Simplify F-Curves by removing closely spaced keyframes."; /* api callbacks */ //ot->invoke= // XXX we need that number popup for this! @@ -780,6 +788,7 @@ void ACT_OT_sample (wmOperatorType *ot) /* identifiers */ ot->name= "Sample Keyframes"; ot->idname= "ACT_OT_sample"; + ot->description= "Add keyframes on every frame between the selected keyframes."; /* api callbacks */ ot->exec= actkeys_sample_exec; @@ -855,6 +864,7 @@ void ACT_OT_extrapolation_type (wmOperatorType *ot) /* identifiers */ ot->name= "Set Keyframe Extrapolation"; ot->idname= "ACT_OT_extrapolation_type"; + ot->description= "Set extrapolation mode for selected F-Curves."; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -925,6 +935,7 @@ void ACT_OT_interpolation_type (wmOperatorType *ot) /* identifiers */ ot->name= "Set Keyframe Interpolation"; ot->idname= "ACT_OT_interpolation_type"; + ot->description= "Set interpolation mode for the F-Curve segments starting from the selected keyframes."; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1013,6 +1024,7 @@ void ACT_OT_handle_type (wmOperatorType *ot) /* identifiers */ ot->name= "Set Keyframe Handle Type"; ot->idname= "ACT_OT_handle_type"; + ot->description= "Set type of handle for selected keyframes."; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1082,6 +1094,7 @@ void ACT_OT_frame_jump (wmOperatorType *ot) /* identifiers */ ot->name= "Jump to Frame"; ot->idname= "ACT_OT_frame_jump"; + ot->description= "Set the current frame to the average frame of the selected keyframes."; /* api callbacks */ ot->exec= actkeys_framejump_exec; @@ -1177,6 +1190,7 @@ void ACT_OT_snap (wmOperatorType *ot) /* identifiers */ ot->name= "Snap Keys"; ot->idname= "ACT_OT_snap"; + ot->description= "Snap selected keyframes to the times specified."; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1293,6 +1307,7 @@ void ACT_OT_mirror (wmOperatorType *ot) /* identifiers */ ot->name= "Mirror Keys"; ot->idname= "ACT_OT_mirror"; + ot->description= "Flip selected keyframes over the selected mirror line."; /* api callbacks */ ot->invoke= WM_menu_invoke; diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index d9e6bb10ceb..ef1b392815d 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -185,6 +185,7 @@ void ACT_OT_select_all_toggle (wmOperatorType *ot) /* identifiers */ ot->name= "Select All"; ot->idname= "ACT_OT_select_all_toggle"; + ot->description= "Toggle selection of all keyframes."; /* api callbacks */ ot->exec= actkeys_deselectall_exec; @@ -348,6 +349,7 @@ void ACT_OT_select_border(wmOperatorType *ot) /* identifiers */ ot->name= "Border Select"; ot->idname= "ACT_OT_select_border"; + ot->description= "Select all keyframes within the specified region."; /* api callbacks */ ot->invoke= WM_border_select_invoke; @@ -565,6 +567,7 @@ void ACT_OT_select_column (wmOperatorType *ot) /* identifiers */ ot->name= "Select All"; ot->idname= "ACT_OT_select_column"; + ot->description= "Select all keyframes on the specified frame(s)."; /* api callbacks */ ot->exec= actkeys_columnselect_exec; @@ -969,6 +972,7 @@ void ACT_OT_clickselect (wmOperatorType *ot) /* identifiers */ ot->name= "Mouse Select Keys"; ot->idname= "ACT_OT_clickselect"; + ot->description= "Select keyframes by clicking on them."; /* api callbacks - absolutely no exec() this yet... */ ot->invoke= actkeys_clickselect_invoke; diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 1837b6d4ecd..d11ceac3264 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -103,7 +103,7 @@ void get_graph_keyframe_extents (bAnimContext *ac, float *xmin, float *xmax, flo int filter; /* get data to filter, from Dopesheet */ - filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* set large values to try to override */ @@ -234,6 +234,7 @@ void GRAPH_OT_view_all (wmOperatorType *ot) /* identifiers */ ot->name= "View All"; ot->idname= "GRAPH_OT_view_all"; + ot->description= "Reset viewable area to show full keyframe range."; /* api callbacks */ ot->exec= graphkeys_viewall_exec; @@ -485,6 +486,7 @@ void GRAPH_OT_insert_keyframe (wmOperatorType *ot) /* identifiers */ ot->name= "Insert Keyframes"; ot->idname= "GRAPH_OT_insert_keyframe"; + ot->description= "Insert keyframes for the specified channels."; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -572,6 +574,7 @@ void GRAPH_OT_click_insert (wmOperatorType *ot) /* identifiers */ ot->name= "Click-Insert Keyframes"; ot->idname= "GRAPH_OT_click_insert"; + ot->description= "Insert new keyframe at the cursor position for the active F-Curve."; /* api callbacks */ ot->invoke= graphkeys_click_insert_invoke; @@ -653,6 +656,7 @@ void GRAPH_OT_copy (wmOperatorType *ot) /* identifiers */ ot->name= "Copy Keyframes"; ot->idname= "GRAPH_OT_copy"; + ot->description= "Copy selected keyframes to the copy/paste buffer."; /* api callbacks */ ot->exec= graphkeys_copy_exec; @@ -692,6 +696,7 @@ void GRAPH_OT_paste (wmOperatorType *ot) /* identifiers */ ot->name= "Paste Keyframes"; ot->idname= "GRAPH_OT_paste"; + ot->description= "Paste keyframes from copy/paste buffer for the selected channels, starting on the current frame."; /* api callbacks */ ot->exec= graphkeys_paste_exec; @@ -759,6 +764,7 @@ void GRAPH_OT_duplicate (wmOperatorType *ot) /* identifiers */ ot->name= "Duplicate Keyframes"; ot->idname= "GRAPH_OT_duplicate"; + ot->description= "Make a copy of all selected keyframes."; /* api callbacks */ ot->invoke= graphkeys_duplicate_invoke; @@ -820,6 +826,7 @@ void GRAPH_OT_delete (wmOperatorType *ot) /* identifiers */ ot->name= "Delete Keyframes"; ot->idname= "GRAPH_OT_delete"; + ot->description= "Remove all selected keyframes."; /* api callbacks */ ot->invoke= WM_operator_confirm; @@ -881,6 +888,7 @@ void GRAPH_OT_clean (wmOperatorType *ot) /* identifiers */ ot->name= "Clean Keyframes"; ot->idname= "GRAPH_OT_clean"; + ot->description= "Simplify F-Curves by removing closely spaced keyframes."; /* api callbacks */ //ot->invoke= // XXX we need that number popup for this! @@ -963,6 +971,7 @@ void GRAPH_OT_bake (wmOperatorType *ot) /* identifiers */ ot->name= "Bake Curve"; ot->idname= "GRAPH_OT_bake"; + ot->description= "Bake selected F-Curves to a set of sampled points defining a similar curve."; /* api callbacks */ ot->invoke= WM_operator_confirm; // FIXME... @@ -1089,6 +1098,7 @@ void GRAPH_OT_sample (wmOperatorType *ot) /* identifiers */ ot->name= "Sample Keyframes"; ot->idname= "GRAPH_OT_sample"; + ot->description= "Add keyframes on every frame between the selected keyframes."; /* api callbacks */ ot->exec= graphkeys_sample_exec; @@ -1163,6 +1173,7 @@ void GRAPH_OT_extrapolation_type (wmOperatorType *ot) /* identifiers */ ot->name= "Set Keyframe Extrapolation"; ot->idname= "GRAPH_OT_extrapolation_type"; + ot->description= "Set extrapolation mode for selected F-Curves."; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1231,6 +1242,7 @@ void GRAPH_OT_interpolation_type (wmOperatorType *ot) /* identifiers */ ot->name= "Set Keyframe Interpolation"; ot->idname= "GRAPH_OT_interpolation_type"; + ot->description= "Set interpolation mode for the F-Curve segments starting from the selected keyframes."; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1318,6 +1330,7 @@ void GRAPH_OT_handletype (wmOperatorType *ot) /* identifiers */ ot->name= "Set Keyframe Handle Type"; ot->idname= "GRAPH_OT_handletype"; + ot->description= "Set type of handle for selected keyframes."; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1473,6 +1486,7 @@ void GRAPH_OT_frame_jump (wmOperatorType *ot) /* identifiers */ ot->name= "Jump to Frame"; ot->idname= "GRAPH_OT_frame_jump"; + ot->description= "Set the current frame to the average frame of the selected keyframes."; /* api callbacks */ ot->exec= graphkeys_framejump_exec; @@ -1564,6 +1578,7 @@ void GRAPH_OT_snap (wmOperatorType *ot) /* identifiers */ ot->name= "Snap Keys"; ot->idname= "GRAPH_OT_snap"; + ot->description= "Snap selected keyframes to the times specified."; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1675,6 +1690,7 @@ void GRAPH_OT_mirror (wmOperatorType *ot) /* identifiers */ ot->name= "Mirror Keys"; ot->idname= "GRAPH_OT_mirror"; + ot->description= "Flip selected keyframes over the selected mirror line."; /* api callbacks */ ot->invoke= WM_menu_invoke; @@ -1729,6 +1745,7 @@ void GRAPH_OT_smooth (wmOperatorType *ot) /* identifiers */ ot->name= "Smooth Keys"; ot->idname= "GRAPH_OT_smooth"; + ot->description= "Apply weighted moving means to make selected F-Curves less bumpy."; /* api callbacks */ ot->exec= graphkeys_smooth_exec; @@ -1820,6 +1837,7 @@ void GRAPH_OT_fmodifier_add (wmOperatorType *ot) /* identifiers */ ot->name= "Add F-Curve Modifier"; ot->idname= "GRAPH_OT_fmodifier_add"; + ot->description= "Add F-Modifiers to the selected F-Curves."; /* api callbacks */ ot->invoke= graph_fmodifier_add_invoke; diff --git a/source/blender/editors/space_graph/graph_header.c b/source/blender/editors/space_graph/graph_header.c index 05d9b2f7e6c..eeede3ae95b 100644 --- a/source/blender/editors/space_graph/graph_header.c +++ b/source/blender/editors/space_graph/graph_header.c @@ -219,6 +219,7 @@ static void graph_editmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemO(layout, NULL, 0, "GRAPH_OT_clean"); uiItemO(layout, NULL, 0, "GRAPH_OT_sample"); + uiItemO(layout, NULL, 0, "GRAPH_OT_bake"); uiItemS(layout); diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index a78cacb42ef..c4885d095ed 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -179,6 +179,7 @@ void GRAPH_OT_select_all_toggle (wmOperatorType *ot) /* identifiers */ ot->name= "Select All"; ot->idname= "GRAPH_OT_select_all_toggle"; + ot->description= "Toggle selection of all keyframes."; /* api callbacks */ ot->exec= graphkeys_deselectall_exec; @@ -313,6 +314,7 @@ void GRAPH_OT_select_border(wmOperatorType *ot) /* identifiers */ ot->name= "Border Select"; ot->idname= "GRAPH_OT_select_border"; + ot->description= "Select all keyframes within the specified region."; /* api callbacks */ ot->invoke= WM_border_select_invoke; @@ -506,6 +508,7 @@ void GRAPH_OT_select_column (wmOperatorType *ot) /* identifiers */ ot->name= "Select All"; ot->idname= "GRAPH_OT_select_column"; + ot->description= "Select all keyframes on the specified frame(s)."; /* api callbacks */ ot->exec= graphkeys_columnselect_exec; @@ -926,6 +929,7 @@ void GRAPH_OT_clickselect (wmOperatorType *ot) /* identifiers */ ot->name= "Mouse Select Keys"; ot->idname= "GRAPH_OT_clickselect"; + ot->description= "Select keyframes by clicking on them."; /* api callbacks */ ot->invoke= graphkeys_clickselect_invoke; -- cgit v1.2.3 From 5022bf7ccd734ad5867fdceb7f8ef125a4de4ae0 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 11 Jul 2009 10:23:07 +0000 Subject: 2.5 - Fixing some typos for name of Graph Editor operator An error that slipped in during the merge process? --- source/blender/editors/space_graph/graph_edit.c | 4 ++-- source/blender/editors/space_graph/graph_intern.h | 2 +- source/blender/editors/space_graph/graph_ops.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index d11ceac3264..24c7a0c5c23 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1325,11 +1325,11 @@ static int graphkeys_handletype_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void GRAPH_OT_handletype (wmOperatorType *ot) +void GRAPH_OT_handle_type (wmOperatorType *ot) { /* identifiers */ ot->name= "Set Keyframe Handle Type"; - ot->idname= "GRAPH_OT_handletype"; + ot->idname= "GRAPH_OT_handle_type"; ot->description= "Set type of handle for selected keyframes."; /* api callbacks */ diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h index 697c31eaa98..31f1c6d4301 100644 --- a/source/blender/editors/space_graph/graph_intern.h +++ b/source/blender/editors/space_graph/graph_intern.h @@ -102,7 +102,7 @@ void GRAPH_OT_sample(struct wmOperatorType *ot); void GRAPH_OT_bake(struct wmOperatorType *ot); void GRAPH_OT_smooth(struct wmOperatorType *ot); -void GRAPH_OT_handletype(struct wmOperatorType *ot); +void GRAPH_OT_handle_type(struct wmOperatorType *ot); void GRAPH_OT_interpolation_type(struct wmOperatorType *ot); void GRAPH_OT_extrapolation_type(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 305ad825030..68f4db555f8 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -118,7 +118,7 @@ void graphedit_operatortypes(void) WM_operatortype_append(GRAPH_OT_snap); WM_operatortype_append(GRAPH_OT_mirror); WM_operatortype_append(GRAPH_OT_frame_jump); - WM_operatortype_append(GRAPH_OT_handletype); + WM_operatortype_append(GRAPH_OT_handle_type); WM_operatortype_append(GRAPH_OT_interpolation_type); WM_operatortype_append(GRAPH_OT_extrapolation_type); WM_operatortype_append(GRAPH_OT_sample); @@ -191,7 +191,7 @@ static void graphedit_keymap_keyframes (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "GRAPH_OT_snap", SKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "GRAPH_OT_mirror", MKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_add_item(keymap, "GRAPH_OT_handletype", HKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_handle_type", HKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "GRAPH_OT_interpolation_type", TKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "GRAPH_OT_extrapolation_type", EKEY, KM_PRESS, KM_SHIFT, 0); -- cgit v1.2.3 From 8a1caaed32717f88218ea0c6222c749c14648ab3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 11 Jul 2009 11:31:49 +0000 Subject: Object mode select grouped operator (Shift+G and Select manu) Group option currently doesnt handle multiple groups. Set makefiles python version to 2.6 for linux since its common now. --- source/blender/blenkernel/BKE_context.h | 3 + source/blender/blenkernel/intern/context.c | 10 + source/blender/editors/object/object_edit.c | 303 +++++++++++++++++++++ source/blender/editors/object/object_intern.h | 1 + source/blender/editors/object/object_ops.c | 2 + source/blender/editors/space_view3d/space_view3d.c | 16 ++ .../blender/editors/space_view3d/view3d_header.c | 1 + source/nan_definitions.mk | 2 +- 8 files changed, 337 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h index f536e117b7b..92c79ff757f 100644 --- a/source/blender/blenkernel/BKE_context.h +++ b/source/blender/blenkernel/BKE_context.h @@ -186,6 +186,9 @@ int CTX_data_selected_bases(const bContext *C, ListBase *list); int CTX_data_visible_objects(const bContext *C, ListBase *list); int CTX_data_visible_bases(const bContext *C, ListBase *list); +int CTX_data_selectable_objects(const bContext *C, ListBase *list); +int CTX_data_selectable_bases(const bContext *C, ListBase *list); + struct Object *CTX_data_active_object(const bContext *C); struct Base *CTX_data_active_base(const bContext *C); struct Object *CTX_data_edit_object(const bContext *C); diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 4a68d90a4ed..1b499384886 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -606,6 +606,16 @@ int CTX_data_visible_bases(const bContext *C, ListBase *list) return ctx_data_collection_get(C, "visible_bases", list); } +int CTX_data_selectable_objects(const bContext *C, ListBase *list) +{ + return ctx_data_collection_get(C, "selectable_objects", list); +} + +int CTX_data_selectable_bases(const bContext *C, ListBase *list) +{ + return ctx_data_collection_get(C, "selectable_bases", list); +} + struct Object *CTX_data_active_object(const bContext *C) { return ctx_data_pointer_get(C, "active_object"); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 9ea8907e172..f122412fdd6 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1690,6 +1690,309 @@ void OBJECT_OT_select_linked(wmOperatorType *ot) RNA_def_enum(ot->srna, "seltype", prop_select_types, 1, "Selection", "Extend selection or clear selection then select"); } + +/* ****** selection grouped *******/ + +static EnumPropertyItem prop_select_grouped_types[] = { + {1, "CHILDREN_RECURSIVE", 0, "Children", ""}, // XXX depreceated animation system stuff... + {2, "CHILDREN", 0, "Immediate Children", ""}, + {3, "PARENT", 0, "Parent", ""}, + {4, "SIBLINGS", 0, "Siblings", "Shared Parent"}, + {5, "TYPE", 0, "Type", "Shared object type"}, + {6, "LAYER", 0, "Layer", "Shared layers"}, + {7, "GROUP", 0, "Group", "Shared group"}, + {8, "HOOK", 0, "Hook", ""}, + {9, "PASS", 0, "Pass", "Render pass Index"}, + {10, "COLOR", 0, "Color", "Object Color"}, + {11, "PROPERTIES", 0, "Properties", "Game Properties"}, + {0, NULL, 0, NULL, NULL} +}; + + +static short select_grouped_children(bContext *C, Object *ob, int recursive) +{ + short changed = 0; + + CTX_DATA_BEGIN(C, Base*, base, selectable_bases) { + if (ob == base->object->parent) { + if (!(base->flag & SELECT)) { + ED_base_object_select(base, BA_SELECT); + changed = 1; + } + + if (recursive) + changed |= select_grouped_children(C, base->object, 1); + } + } + CTX_DATA_END; + return changed; +} + +static short select_grouped_parent(bContext *C) /* Makes parent active and de-selected OBACT */ +{ + Scene *scene= CTX_data_scene(C); + View3D *v3d= CTX_wm_view3d(C); + + short changed = 0; + Base *baspar, *basact= CTX_data_active_base(C); + + if (!basact || !(basact->object->parent)) return 0; /* we know OBACT is valid */ + + baspar= object_in_scene(basact->object->parent, scene); + + /* can be NULL if parent in other scene */ + if(baspar && BASE_SELECTABLE(v3d, baspar)) { + ED_base_object_select(basact, BA_DESELECT); + ED_base_object_select(baspar, BA_SELECT); + ED_base_object_activate(C, baspar); + changed = 1; + } + return changed; +} + + +#define GROUP_MENU_MAX 24 +static short select_grouped_group(bContext *C, Object *ob) /* Select objects in the same group as the active */ +{ + short changed = 0; + Base *base; + Group *group, *ob_groups[GROUP_MENU_MAX]; + char str[10 + (24*GROUP_MENU_MAX)]; + char *p = str; + int group_count=0, menu, i; + + for ( group=G.main->group.first; + group && group_count < GROUP_MENU_MAX; + group=group->id.next + ) { + if (object_in_group (ob, group)) { + ob_groups[group_count] = group; + group_count++; + } + } + + if (!group_count) + return 0; + + else if (group_count == 1) { + group = ob_groups[0]; + CTX_DATA_BEGIN(C, Base*, base, visible_bases) { + if (!(base->flag & SELECT) && object_in_group(base->object, group)) { + ED_base_object_select(base, BA_SELECT); + changed = 1; + } + } + CTX_DATA_END; + return changed; + } +#if 0 // XXX hows this work in 2.5? + /* build the menu. */ + p += sprintf(str, "Groups%%t"); + for (i=0; iid.name+2, i); + } + + menu = pupmenu (str); + if (menu == -1) + return 0; + + group = ob_groups[menu]; + for (base= FIRSTBASE; base; base= base->next) { + if (!(base->flag & SELECT) && object_in_group(base->object, group)) { + ED_base_object_select(base, BA_SELECT); + changed = 1; + } + } +#endif + return changed; +} + +static short select_grouped_object_hooks(bContext *C, Object *ob) +{ + Scene *scene= CTX_data_scene(C); + View3D *v3d= CTX_wm_view3d(C); + + short changed = 0; + Base *base; + ModifierData *md; + HookModifierData *hmd; + + for (md = ob->modifiers.first; md; md=md->next) { + if (md->type==eModifierType_Hook) { + hmd= (HookModifierData*) md; + if (hmd->object && !(hmd->object->flag & SELECT)) { + base= object_in_scene(hmd->object, scene); + if (base && (BASE_SELECTABLE(v3d, base))) { + ED_base_object_select(base, BA_SELECT); + changed = 1; + } + } + } + } + return changed; +} + +/* Select objects woth the same parent as the active (siblings), + * parent can be NULL also */ +static short select_grouped_siblings(bContext *C, Object *ob) +{ + short changed = 0; + + CTX_DATA_BEGIN(C, Base*, base, selectable_bases) { + if ((base->object->parent==ob->parent) && !(base->flag & SELECT)) { + ED_base_object_select(base, BA_SELECT); + changed = 1; + } + } + CTX_DATA_END; + return changed; +} + +static short select_grouped_type(bContext *C, Object *ob) +{ + short changed = 0; + + CTX_DATA_BEGIN(C, Base*, base, selectable_bases) { + if ((base->object->type == ob->type) && !(base->flag & SELECT)) { + ED_base_object_select(base, BA_SELECT); + changed = 1; + } + } + CTX_DATA_END; + return changed; +} + +static short select_grouped_layer(bContext *C, Object *ob) +{ + char changed = 0; + + CTX_DATA_BEGIN(C, Base*, base, selectable_bases) { + if ((base->lay & ob->lay) && !(base->flag & SELECT)) { + ED_base_object_select(base, BA_SELECT); + changed = 1; + } + } + CTX_DATA_END; + return changed; +} + +static short select_grouped_index_object(bContext *C, Object *ob) +{ + char changed = 0; + + CTX_DATA_BEGIN(C, Base*, base, selectable_bases) { + if ((base->object->index == ob->index) && !(base->flag & SELECT)) { + ED_base_object_select(base, BA_SELECT); + changed = 1; + } + } + CTX_DATA_END; + return changed; +} + +static short select_grouped_color(bContext *C, Object *ob) +{ + char changed = 0; + + CTX_DATA_BEGIN(C, Base*, base, selectable_bases) { + if (!(base->flag & SELECT) && (FloatCompare(base->object->col, ob->col, 0.005f))) { + ED_base_object_select(base, BA_SELECT); + changed = 1; + } + } + CTX_DATA_END; + return changed; +} + +static short objects_share_gameprop(Object *a, Object *b) +{ + bProperty *prop; + /*make a copy of all its properties*/ + + for( prop= a->prop.first; prop; prop = prop->next ) { + if ( get_ob_property(b, prop->name) ) + return 1; + } + return 0; +} + +static short select_grouped_gameprops(bContext *C, Object *ob) +{ + char changed = 0; + + CTX_DATA_BEGIN(C, Base*, base, selectable_bases) { + if (!(base->flag & SELECT) && (objects_share_gameprop(base->object, ob))) { + ED_base_object_select(base, BA_SELECT); + changed = 1; + } + } + CTX_DATA_END; + return changed; +} + +static int object_select_grouped_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob; + int nr = RNA_enum_get(op->ptr, "type"); + short changed = 0, seltype; + + seltype = RNA_enum_get(op->ptr, "seltype"); + + if (seltype == 0) { + CTX_DATA_BEGIN(C, Base*, base, visible_bases) { + ED_base_object_select(base, BA_DESELECT); + } + CTX_DATA_END; + } + + ob= OBACT; + if(ob==0){ + BKE_report(op->reports, RPT_ERROR, "No Active Object"); + return OPERATOR_CANCELLED; + } + + if(nr==1) changed = select_grouped_children(C, ob, 1); + else if(nr==2) changed = select_grouped_children(C, ob, 0); + else if(nr==3) changed = select_grouped_parent(C); + else if(nr==4) changed = select_grouped_siblings(C, ob); + else if(nr==5) changed = select_grouped_type(C, ob); + else if(nr==6) changed = select_grouped_layer(C, ob); + else if(nr==7) changed = select_grouped_group(C, ob); + else if(nr==8) changed = select_grouped_object_hooks(C, ob); + else if(nr==9) changed = select_grouped_index_object(C, ob); + else if(nr==10) changed = select_grouped_color(C, ob); + else if(nr==11) changed = select_grouped_gameprops(C, ob); + + if (changed) { + WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C)); + return OPERATOR_FINISHED; + } + + return OPERATOR_CANCELLED; +} + +void OBJECT_OT_select_grouped(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Select Grouped"; + ot->description = "Select all visible objects grouped by various properties."; + ot->idname= "OBJECT_OT_select_grouped"; + + /* api callbacks */ + ot->invoke= WM_menu_invoke; + ot->exec= object_select_grouped_exec; + ot->poll= ED_operator_scene_editable; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_enum(ot->srna, "type", prop_select_grouped_types, 0, "Type", ""); + RNA_def_enum(ot->srna, "seltype", prop_select_types, 1, "Selection", "Extend selection or clear selection then select"); + +} + /* ****** selection by layer *******/ static int object_select_by_layer_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 2173e79ac66..748e8f7b396 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -50,6 +50,7 @@ void OBJECT_OT_select_random(struct wmOperatorType *ot); void OBJECT_OT_select_by_type(struct wmOperatorType *ot); void OBJECT_OT_select_by_layer(struct wmOperatorType *ot); void OBJECT_OT_select_linked(struct wmOperatorType *ot); +void OBJECT_OT_select_grouped(struct wmOperatorType *ot); void OBJECT_OT_location_clear(struct wmOperatorType *ot); void OBJECT_OT_rotation_clear(struct wmOperatorType *ot); void OBJECT_OT_scale_clear(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 50c14673939..258fc3386cf 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -74,6 +74,7 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_select_by_type); WM_operatortype_append(OBJECT_OT_select_by_layer); WM_operatortype_append(OBJECT_OT_select_linked); + WM_operatortype_append(OBJECT_OT_select_grouped); WM_operatortype_append(OBJECT_OT_location_clear); WM_operatortype_append(OBJECT_OT_rotation_clear); WM_operatortype_append(OBJECT_OT_scale_clear); @@ -144,6 +145,7 @@ void ED_keymap_object(wmWindowManager *wm) WM_keymap_add_item(keymap, "OBJECT_OT_select_by_type", PADASTERKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "OBJECT_OT_select_by_layer", PADASTERKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "OBJECT_OT_select_linked", LKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "OBJECT_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_verify_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_verify_item(keymap, "OBJECT_OT_parent_clear", PKEY, KM_PRESS, KM_ALT, 0); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index e52d2886439..9b6b70eb396 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -675,6 +675,22 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes return 1; } + else if(CTX_data_equals(member, "selectable_objects") || CTX_data_equals(member, "selectable_bases")) { + int selectable_objects= CTX_data_equals(member, "selectable_objects"); + + for(base=scene->base.first; base; base=base->next) { + if(base->lay & v3d->lay) { + if((base->object->restrictflag & OB_RESTRICT_VIEW)==0 && (base->object->restrictflag & OB_RESTRICT_SELECT)==0) { + if(selectable_objects) + CTX_data_id_list_add(result, &base->object->id); + else + CTX_data_list_add(result, &scene->id, &RNA_UnknownType, base); + } + } + } + + return 1; + } else if(CTX_data_equals(member, "active_base")) { if(scene->basact && (scene->basact->lay & v3d->lay)) if((scene->basact->object->restrictflag & OB_RESTRICT_VIEW)==0) diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index e6d3ec54d44..387c3c7626a 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -1039,6 +1039,7 @@ static void view3d_select_objectmenu(bContext *C, uiLayout *layout, void *arg_un uiItemO(layout, "Random", 0, "OBJECT_OT_select_random"); uiItemO(layout, "Select All by Layer", 0, "OBJECT_OT_select_by_layer"); uiItemMenuEnumO(layout, "Select All by Type", 0, "OBJECT_OT_select_by_type", "type"); + uiItemMenuEnumO(layout, "Select Grouped", 0, "OBJECT_OT_select_grouped", "type"); #if 0 uiDefIconTextBlockBut(block, view3d_select_object_layermenu, NULL, ICON_RIGHTARROW_THIN, "Select All by Layer", 0, yco-=20, 120, 19, ""); diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk index 91f90525c1e..fc0f3a7aa19 100644 --- a/source/nan_definitions.mk +++ b/source/nan_definitions.mk @@ -307,7 +307,7 @@ endif export FREEDESKTOP ?= true export NAN_PYTHON ?= /usr - export NAN_PYTHON_VERSION ?= 2.5 + export NAN_PYTHON_VERSION ?= 2.6 export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION) export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a export NAN_OPENAL ?= /usr -- cgit v1.2.3 From 10d14e72599e891ce253e37826ce6ed3c0aecd8d Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 11 Jul 2009 11:52:20 +0000 Subject: 2.5 - Restored Set/Clear Inverse Buttons for ChildOf Constraint I've tagged these operators with CONSTRAINT_OT_* not OBJECT_OT_constraint_* since constraints can operate on Bones too (and do so more often) --- source/blender/editors/include/ED_object.h | 2 - source/blender/editors/object/editconstraint.c | 108 +++++++++++-------------- source/blender/editors/object/object_intern.h | 3 + source/blender/editors/object/object_ops.c | 2 + 4 files changed, 50 insertions(+), 65 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 9dcdc30a691..83bcd6a5176 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -35,7 +35,6 @@ struct bContext; struct Base; struct View3D; struct bConstraint; -struct bConstraintChannel; struct KeyBlock; struct Lattice; struct Mesh; @@ -78,7 +77,6 @@ void add_constraint_to_object(struct bConstraint *con, struct Object *ob); struct ListBase *get_active_constraints(struct Object *ob); struct bConstraint *get_active_constraint(struct Object *ob); -struct bConstraintChannel *get_active_constraint_channel(struct Scene *scene, struct Object *ob); void object_test_constraints(struct Object *ob); diff --git a/source/blender/editors/object/editconstraint.c b/source/blender/editors/object/editconstraint.c index ff2f79e7cdb..4c9a0bf4c67 100644 --- a/source/blender/editors/object/editconstraint.c +++ b/source/blender/editors/object/editconstraint.c @@ -117,63 +117,6 @@ bConstraint *get_active_constraint (Object *ob) return NULL; } - -/* single channel, for ipo */ -bConstraintChannel *get_active_constraint_channel (Scene *scene, Object *ob) -{ - bConstraint *con; - - if (ob->flag & OB_POSEMODE) { - //if (ob->action) { // XXX old animation system - bPoseChannel *pchan; - - pchan = get_active_posechannel(ob); - if (pchan) { - for (con= pchan->constraints.first; con; con= con->next) { - if (con->flag & CONSTRAINT_ACTIVE) - break; - } - - if (con) { -#if 0 // XXX old animation system - bActionChannel *achan = get_action_channel(ob->action, pchan->name); - if (achan) { - for (chan= achan->constraintChannels.first; chan; chan= chan->next) { - if (!strcmp(chan->name, con->name)) - break; - } - return chan; - } -#endif // XXX old animation system - } - } - //} // xxx old animation system - } - else { - for (con= ob->constraints.first; con; con= con->next) { - if (con->flag & CONSTRAINT_ACTIVE) - break; - } - - if (con) { -#if 0 // XXX old animation system - ListBase *lb= get_active_constraint_channels(scene, ob, 0); - - if (lb) { - for (chan= lb->first; chan; chan= chan->next) { - if (!strcmp(chan->name, con->name)) - break; - } - - return chan; - } -#endif // XXX old animation system - } - } - - return NULL; -} - /* -------------- Constraint Management (Add New, Remove, Rename) -------------------- */ /* ------------- PyConstraints ------------------ */ @@ -790,15 +733,17 @@ void object_test_constraints (Object *owner) /* ------------- Child-Of Constraint ------------------ */ /* ChildOf Constraint - set inverse callback */ -void childof_const_setinv (void *conv, void *scenev) +static int childof_set_inverse_exec (bContext *C, wmOperator *op) { - bConstraint *con= (bConstraint *)conv; - Scene *scene= (Scene *)scenev; + PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_ChildOfConstraint); + Scene *scene= CTX_data_scene(C); + Object *ob= ptr.id.data; + bConstraint *con= ptr.data; bChildOfConstraint *data= (bChildOfConstraint *)con->data; - Object *ob= OBACT; bPoseChannel *pchan= NULL; /* try to find a pose channel */ + // TODO: get from context instead? if (ob && ob->pose) pchan= get_active_posechannel(ob); @@ -839,16 +784,53 @@ void childof_const_setinv (void *conv, void *scenev) } else Mat4One(data->invmat); + + WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, ob); + + return OPERATOR_FINISHED; } +void CONSTRAINT_OT_childof_set_inverse (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Set Inverse"; + ot->idname= "CONSTRAINT_OT_childof_set_inverse"; + ot->description= "Set inverse correction for ChildOf constraint."; + + ot->exec= childof_set_inverse_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + + /* ChildOf Constraint - clear inverse callback */ -void childof_const_clearinv (void *conv, void *unused) +static int childof_clear_inverse_exec (bContext *C, wmOperator *op) { - bConstraint *con= (bConstraint *)conv; + PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_ChildOfConstraint); + Object *ob= ptr.id.data; + bConstraint *con= ptr.data; bChildOfConstraint *data= (bChildOfConstraint *)con->data; /* simply clear the matrix */ Mat4One(data->invmat); + + WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, ob); + + return OPERATOR_FINISHED; +} + +void CONSTRAINT_OT_childof_clear_inverse (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Clear Inverse"; + ot->idname= "CONSTRAINT_OT_childof_clear_inverse"; + ot->description= "Clear inverse correction for ChildOf constraint."; + + ot->exec= childof_clear_inverse_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } /***************************** BUTTONS ****************************/ diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 748e8f7b396..0ad5bd7d08e 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -102,6 +102,9 @@ void OBJECT_OT_modifier_mdef_bind(struct wmOperatorType *ot); /* editconstraint.c */ void OBJECT_OT_constraint_add(struct wmOperatorType *ot); +void CONSTRAINT_OT_childof_set_inverse(struct wmOperatorType *ot); +void CONSTRAINT_OT_childof_clear_inverse(struct wmOperatorType *ot); + /* object_vgroup.c */ void OBJECT_OT_vertex_group_add(struct wmOperatorType *ot); void OBJECT_OT_vertex_group_remove(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 258fc3386cf..66dd1b8fbb9 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -111,6 +111,8 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_modifier_mdef_bind); WM_operatortype_append(OBJECT_OT_constraint_add); + WM_operatortype_append(CONSTRAINT_OT_childof_set_inverse); + WM_operatortype_append(CONSTRAINT_OT_childof_clear_inverse); WM_operatortype_append(OBJECT_OT_vertex_group_add); WM_operatortype_append(OBJECT_OT_vertex_group_remove); -- cgit v1.2.3 From 0096a3dee2082d5dd15278a2e5627b6446f18e0a Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 11 Jul 2009 12:54:17 +0000 Subject: 2.5 - Made more operators for constraint buttons * Move Up/Down and Delete are now operators * Made TrackTo constraint use expanded enum toggles for up axis too. --> BUG ALERT: specifying name and expand in the arguments to itemR doesn't work (name gets skipped) --- source/blender/editors/include/ED_object.h | 3 - .../editors/interface/interface_templates.c | 48 +------ source/blender/editors/object/editconstraint.c | 142 +++++++++++++-------- source/blender/editors/object/object_intern.h | 4 + source/blender/editors/object/object_ops.c | 3 + 5 files changed, 98 insertions(+), 102 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 83bcd6a5176..f7dcc7fd1a0 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -82,9 +82,6 @@ void object_test_constraints(struct Object *ob); void ED_object_constraint_rename(struct Object *ob, struct bConstraint *con, char *oldname); void ED_object_constraint_set_active(struct Object *ob, struct bConstraint *con); -int ED_object_constraint_delete(struct ReportList *reports, struct Object *ob, struct bConstraint *con); -int ED_object_constraint_move_down(struct ReportList *reports, struct Object *ob, struct bConstraint *con); -int ED_object_constraint_move_up(struct ReportList *reports, struct Object *ob, struct bConstraint *con); /* editlattice.c */ void mouse_lattice(struct bContext *C, short mval[2], int extend); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 91fbd24f8a6..8f25459a682 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -616,12 +616,6 @@ static void constraint_active_func(bContext *C, void *ob_v, void *con_v) ED_object_constraint_set_active(ob_v, con_v); } -static void del_constraint_func (bContext *C, void *ob_v, void *con_v) -{ - if(ED_object_constraint_delete(NULL, ob_v, con_v)) - ED_undo_push(C, "Delete Constraint"); -} - static void verify_constraint_name_func (bContext *C, void *con_v, void *name_v) { Object *ob= CTX_data_active_object(C); @@ -639,18 +633,6 @@ static void verify_constraint_name_func (bContext *C, void *con_v, void *name_v) // XXX allqueue(REDRAWACTION, 0); } -static void constraint_moveUp(bContext *C, void *ob_v, void *con_v) -{ - if(ED_object_constraint_move_up(NULL, ob_v, con_v)) - ED_undo_push(C, "Move Constraint"); -} - -static void constraint_moveDown(bContext *C, void *ob_v, void *con_v) -{ - if(ED_object_constraint_move_down(NULL, ob_v, con_v)) - ED_undo_push(C, "Move Constraint"); -} - /* some commonly used macros in the constraints drawing code */ #define is_armature_target(target) (target && target->type==OB_ARMATURE) #define is_armature_owner(ob) ((ob->type == OB_ARMATURE) && (ob->flag & OB_POSEMODE)) @@ -828,25 +810,18 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) uiBlockBeginAlign(block); uiBlockSetEmboss(block, UI_EMBOSS); - if (show_upbut) { - but = uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, VICON_MOVE_UP, xco+width-50, yco, 16, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Move constraint up in constraint stack"); - uiButSetFunc(but, constraint_moveUp, ob, con); - } + if (show_upbut) + uiDefIconButO(block, BUT, "CONSTRAINT_OT_move_up", WM_OP_INVOKE_DEFAULT, VICON_MOVE_UP, xco+width-50, yco, 16, 18, "Move constraint up in constraint stack"); - if (show_downbut) { - but = uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, VICON_MOVE_DOWN, xco+width-50+18, yco, 16, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Move constraint down in constraint stack"); - uiButSetFunc(but, constraint_moveDown, ob, con); - } + if (show_downbut) + uiDefIconButO(block, BUT, "CONSTRAINT_OT_move_down", WM_OP_INVOKE_DEFAULT, VICON_MOVE_DOWN, xco+width-50+18, yco, 16, 18, "Move constraint down in constraint stack"); uiBlockEndAlign(block); } /* Close 'button' - emboss calls here disable drawing of 'button' behind X */ uiBlockSetEmboss(block, UI_EMBOSSN); - - but = uiDefIconBut(block, BUT, B_CONSTRAINT_CHANGETARGET, ICON_X, xco+262, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete constraint"); - uiButSetFunc(but, del_constraint_func, ob, con); - + uiDefIconButO(block, BUT, "CONSTRAINT_OT_delete", WM_OP_INVOKE_DEFAULT, ICON_X, xco+262, yco, 19, 19, "Delete constraint"); uiBlockSetEmboss(block, UI_EMBOSS); } @@ -944,19 +919,6 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) } break; #endif /* DISABLE_PYTHON */ - /*case CONSTRAINT_TYPE_CHILDOF: - { - // Inverse options - uiBlockBeginAlign(block); - but=uiDefBut(block, BUT, B_CONSTRAINT_TEST, "Set Offset", xco, yco-151, (width/2),18, NULL, 0, 24, 0, 0, "Calculate current Parent-Inverse Matrix (i.e. restore offset from parent)"); - // XXX uiButSetFunc(but, childof_const_setinv, con, NULL); - - but=uiDefBut(block, BUT, B_CONSTRAINT_TEST, "Clear Offset", xco+((width/2)+10), yco-151, (width/2),18, NULL, 0, 24, 0, 0, "Clear Parent-Inverse Matrix (i.e. clear offset from parent)"); - // XXX uiButSetFunc(but, childof_const_clearinv, con, NULL); - uiBlockEndAlign(block); - } - break; - */ /*case CONSTRAINT_TYPE_RIGIDBODYJOINT: { diff --git a/source/blender/editors/object/editconstraint.c b/source/blender/editors/object/editconstraint.c index 4c9a0bf4c67..7be4697d0c8 100644 --- a/source/blender/editors/object/editconstraint.c +++ b/source/blender/editors/object/editconstraint.c @@ -81,7 +81,6 @@ static int pupmenu() {return 0;} /* -------------- Get Active Constraint Data ---------------------- */ - /* if object in posemode, active bone constraints, else object constraints */ ListBase *get_active_constraints (Object *ob) { @@ -841,7 +840,6 @@ void ED_object_constraint_rename(Object *ob, bConstraint *con, char *oldname) bConstraint *tcon; ListBase *conlist= NULL; int from_object= 0; - char *channame=""; /* get context by searching for con (primitive...) */ for (tcon= ob->constraints.first; tcon; tcon= tcon->next) { @@ -851,7 +849,6 @@ void ED_object_constraint_rename(Object *ob, bConstraint *con, char *oldname) if (tcon) { conlist= &ob->constraints; - channame= "Object"; from_object= 1; } else if (ob->pose) { @@ -868,7 +865,6 @@ void ED_object_constraint_rename(Object *ob, bConstraint *con, char *oldname) if (tcon) { conlist= &pchan->constraints; - channame= pchan->name; } } @@ -878,7 +874,7 @@ void ED_object_constraint_rename(Object *ob, bConstraint *con, char *oldname) } /* first make sure it's a unique name within context */ - unique_constraint_name (con, conlist); + unique_constraint_name(con, conlist); } @@ -901,77 +897,111 @@ void ED_object_constraint_set_active(Object *ob, bConstraint *con) if(con==origcon) con->flag |= CONSTRAINT_ACTIVE; else con->flag &= ~CONSTRAINT_ACTIVE; } - - /* make sure ipowin and buttons shows it */ - if(ob->ipowin==ID_CO) { - // XXX allqueue(REDRAWIPO, ID_CO); - // XXX allspace(REMAKEIPO, 0); - // XXX allqueue(REDRAWNLA, 0); - } - // XXX allqueue(REDRAWBUTSOBJECT, 0); } -int ED_object_constraint_delete(ReportList *reports, Object *ob, bConstraint *con) +static int constraint_delete_exec (bContext *C, wmOperator *op) { - bConstraintChannel *chan; + PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint); + Object *ob= ptr.id.data; + bConstraint *con= ptr.data; ListBase *lb; - /* remove ipo channel */ - lb= NULL; // XXX get_active_constraint_channels(ob, 0); - if(lb) { - chan = NULL; // XXX get_constraint_channel(lb, con->name); - if(chan) { - if(chan->ipo) chan->ipo->id.us--; - BLI_freelinkN(lb, chan); - } - } - /* remove constraint itself */ lb= get_active_constraints(ob); free_constraint_data(con); BLI_freelinkN(lb, con); ED_object_constraint_set_active(ob, NULL); + WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, ob); - return 1; + return OPERATOR_FINISHED; } -int ED_object_constraint_move_down(ReportList *reports, Object *ob, bConstraint *constr) +void CONSTRAINT_OT_delete (wmOperatorType *ot) { - bConstraint *con; - ListBase *conlist; - - if(constr->next) { - conlist = get_active_constraints(ob); - for(con= conlist->first; con; con= con->next) { - if(con==constr) { - BLI_remlink(conlist, con); - BLI_insertlink(conlist, con->next, con); - return 1; - } - } + /* identifiers */ + ot->name= "Delete Constraint"; + ot->idname= "CONSTRAINT_OT_delete"; + ot->description= "Remove constraitn from constraint stack."; + + /* callbacks */ + ot->exec= constraint_delete_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int constraint_move_down_exec (bContext *C, wmOperator *op) +{ + PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint); + Object *ob= ptr.id.data; + bConstraint *con= ptr.data; + + if (con->next) { + ListBase *conlist= get_active_constraints(ob); + bConstraint *nextCon= con->next; + + /* insert the nominated constraint after the one that used to be after it */ + BLI_remlink(conlist, con); + BLI_insertlinkafter(conlist, nextCon, con); + + WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, ob); + + return OPERATOR_FINISHED; } + + return OPERATOR_CANCELLED; +} - return 0; +void CONSTRAINT_OT_move_down (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Move Constraint Down"; + ot->idname= "CONSTRAINT_OT_move_down"; + ot->description= "Move constraint down constraint stack."; + + /* callbacks */ + ot->exec= constraint_move_down_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -int ED_object_constraint_move_up(ReportList *reports, Object *ob, bConstraint *constr) + +static int constraint_move_up_exec (bContext *C, wmOperator *op) { - bConstraint *con; - ListBase *conlist; - - if(constr->prev) { - conlist = get_active_constraints(ob); - for(con= conlist->first; con; con= con->next) { - if(con==constr) { - BLI_remlink(conlist, con); - BLI_insertlink(conlist, con->prev->prev, con); - return 1; - } - } + PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint); + Object *ob= ptr.id.data; + bConstraint *con= ptr.data; + + if (con->prev) { + ListBase *conlist= get_active_constraints(ob); + bConstraint *prevCon= con->prev; + + /* insert the nominated constraint before the one that used to be before it */ + BLI_remlink(conlist, con); + BLI_insertlinkbefore(conlist, prevCon, con); + + WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT, ob); + + return OPERATOR_FINISHED; } + + return OPERATOR_CANCELLED; +} - return 0; +void CONSTRAINT_OT_move_up (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Move Constraint Up"; + ot->idname= "CONSTRAINT_OT_move_up"; + ot->description= "Move constraint up constraint stack."; + + /* callbacks */ + ot->exec= constraint_move_up_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } /***************************** OPERATORS ****************************/ @@ -1015,10 +1045,10 @@ static int constraint_add_exec(bContext *C, wmOperator *op) case CONSTRAINT_TYPE_RIGIDBODYJOINT: { bRigidBodyJointConstraint *data; - + /* set selected first object as target - moved from new_constraint_data */ data = (bRigidBodyJointConstraint*)con->data; - + CTX_DATA_BEGIN(C, Object*, selob, selected_objects) { if(selob != ob) { data->tar= selob; diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 0ad5bd7d08e..76ce8857c2c 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -101,6 +101,10 @@ void OBJECT_OT_modifier_mdef_bind(struct wmOperatorType *ot); /* editconstraint.c */ void OBJECT_OT_constraint_add(struct wmOperatorType *ot); +void CONSTRAINT_OT_delete(struct wmOperatorType *ot); + +void CONSTRAINT_OT_move_up(struct wmOperatorType *ot); +void CONSTRAINT_OT_move_down(struct wmOperatorType *ot); void CONSTRAINT_OT_childof_set_inverse(struct wmOperatorType *ot); void CONSTRAINT_OT_childof_clear_inverse(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 66dd1b8fbb9..9a0ce23a970 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -111,6 +111,9 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_modifier_mdef_bind); WM_operatortype_append(OBJECT_OT_constraint_add); + WM_operatortype_append(CONSTRAINT_OT_delete); + WM_operatortype_append(CONSTRAINT_OT_move_up); + WM_operatortype_append(CONSTRAINT_OT_move_down); WM_operatortype_append(CONSTRAINT_OT_childof_set_inverse); WM_operatortype_append(CONSTRAINT_OT_childof_clear_inverse); -- cgit v1.2.3 From b775f1bb322a6277916c24ca282b899532a52e96 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 11 Jul 2009 13:32:20 +0000 Subject: 2.5: * Code to start moving 3D view header and panels to python, at the moment the View menu and one empty panel is in python. The C header code is wrapped in one template, so parts of that can be moved over while still keeping things working. * Fix for mistake in RNA enum commit yesterday, and some warning fixes. --- source/blender/editors/include/UI_interface.h | 1 + source/blender/editors/object/object_edit.c | 6 +- source/blender/editors/space_view3d/space_view3d.c | 23 +----- .../blender/editors/space_view3d/view3d_header.c | 93 +--------------------- source/blender/makesrna/intern/rna_access.c | 5 +- source/blender/makesrna/intern/rna_ui_api.c | 3 + 6 files changed, 16 insertions(+), 115 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 67438120eef..66089272737 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -622,6 +622,7 @@ void uiTemplateImageLayers(uiLayout *layout, struct bContext *C, struct Image *i ListBase uiTemplateList(uiLayout *layout, struct PointerRNA *ptr, char *propname, struct PointerRNA *activeptr, char *activeprop, int rows, int columns, int compact); void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C); void uiTemplateOperatorSearch(uiLayout *layout); +void uiTemplateHeader3D(uiLayout *layout, struct bContext *C); /* items */ void uiItemO(uiLayout *layout, char *name, int icon, char *opname); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index f122412fdd6..e39ed800e0c 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1757,9 +1757,9 @@ static short select_grouped_group(bContext *C, Object *ob) /* Select objects in short changed = 0; Base *base; Group *group, *ob_groups[GROUP_MENU_MAX]; - char str[10 + (24*GROUP_MENU_MAX)]; - char *p = str; - int group_count=0, menu, i; + //char str[10 + (24*GROUP_MENU_MAX)]; + //char *p = str; + int group_count=0; //, menu, i; for ( group=G.main->group.first; group && group_count < GROUP_MENU_MAX; diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 9b6b70eb396..718b74e5225 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -490,30 +490,13 @@ static void view3d_header_area_init(wmWindowManager *wm, ARegion *ar) ListBase *keymap= WM_keymap_listbase(wm, "View3D Generic", SPACE_VIEW3D, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); + + ED_region_header_init(ar); } static void view3d_header_area_draw(const bContext *C, ARegion *ar) { - float col[3]; - - /* clear */ - if(ED_screen_area_active(C)) - UI_GetThemeColor3fv(TH_HEADER, col); - else - UI_GetThemeColor3fv(TH_HEADERDESEL, col); - - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - /* set view2d view matrix for scrolling (without scrollers) */ - UI_view2d_view_ortho(C, &ar->v2d); - - view3d_header_buttons(C, ar); - - /* restore view matrix? */ - UI_view2d_view_restore(C); + ED_region_header(C, ar); } static void view3d_header_area_listener(ARegion *ar, wmNotifier *wmn) diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 387c3c7626a..e68a1c8a10a 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -636,86 +636,6 @@ static void do_view3d_viewmenu(bContext *C, void *arg, int event) } #endif -static void view3d_view_viewnavmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ -// uiItemO(layout, NULL, 0, "VIEW3D_OT_view_fly_mode"); - -// uiItemS(layout); - - uiItemsEnumO(layout, "VIEW3D_OT_view_orbit", "type"); - - uiItemS(layout); - - uiItemsEnumO(layout, "VIEW3D_OT_view_pan", "type"); - - uiItemS(layout); - - uiItemFloatO(layout, "Zoom in", 0, "VIEW3D_OT_zoom", "delta", 1.0f); - uiItemFloatO(layout, "Zoom out", 0, "VIEW3D_OT_zoom", "delta", -1.0f); - -} -static void view3d_view_alignviewmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - -} - -static void view3d_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - ScrArea *sa= CTX_wm_area(C); - - uiItemO(layout, NULL, ICON_MENU_PANEL, "VIEW3D_OT_properties"); - uiItemO(layout, NULL, ICON_MENU_PANEL, "VIEW3D_OT_toolbar"); - -// uiItemO(layout, ICON_MENU_PANEL, "VIEW3D_OT_toggle_transform_orientations_panel"); // Transform Orientations... -// uiItemO(layout, ICON_MENU_PANEL, "VIEW3D_OT_toggle_render_preview_panel"); // render preview... -// uiItemO(layout, ICON_MENU_PANEL, "VIEW3D_OT_toggle_view_properties_panel"); // View Properties.... -// uiItemO(layout, ICON_MENU_PANEL, "VIEW3D_OT_toggle_background_image_panel"); // Background Image.... -// uiItemO(layout, ICON_MENU_PANEL, "VIEW3D_OT_toggle_grease_pencil_panel"); // Grease Pencil.... - - uiItemS(layout); - - uiItemEnumO(layout, NULL, 0, "VIEW3D_OT_viewnumpad", "type", V3D_VIEW_CAMERA); - uiItemEnumO(layout, NULL, 0, "VIEW3D_OT_viewnumpad", "type", V3D_VIEW_TOP); - uiItemEnumO(layout, NULL, 0, "VIEW3D_OT_viewnumpad", "type", V3D_VIEW_FRONT); - uiItemEnumO(layout, NULL, 0, "VIEW3D_OT_viewnumpad", "type", V3D_VIEW_RIGHT); - - //uiItemMenuF(layout, "Cameras", view3d_view_camerasmenu); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "VIEW3D_OT_view_persportho"); - - uiItemS(layout); - -// uiItemO(layout, NULL, 0, "VIEW3D_OT_view_show_all_layers"); - -// uiItemS(layout); - -// uiItemO(layout, NULL, 0, "VIEW3D_OT_view_local_view"); -// uiItemO(layout, NULL, 0, "VIEW3D_OT_view_global_view"); - -// uiItemS(layout); - - uiItemMenuF(layout, "View Navigation", 0, view3d_view_viewnavmenu); - uiItemMenuF(layout, "Align View", 0, view3d_view_alignviewmenu); - - uiItemS(layout); - - uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN); - - uiItemO(layout, NULL, 0, "VIEW3D_OT_clip_border"); - uiItemO(layout, NULL, 0, "VIEW3D_OT_zoom_border"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "VIEW3D_OT_view_center"); - uiItemO(layout, NULL, 0, "VIEW3D_OT_view_all"); - - uiItemS(layout); - - if(sa->full) uiItemO(layout, NULL, 0, "SCREEN_OT_screen_full_area"); // "Tile Window", Ctrl UpArrow - else uiItemO(layout, NULL, 0, "SCREEN_OT_screen_full_area"); // "Maximize Window", Ctr DownArrow -} #if 0 static uiBlock *view3d_viewmenu(bContext *C, ARegion *ar, void *arg_unused) { @@ -4344,7 +4264,6 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o RegionView3D *rv3d= wm_region_view3d(C); short xmax, xco= *xcoord; - /* compensate for local mode when setting up the viewing menu/iconrow values */ if(rv3d->view==7) rv3d->viewbut= 1; else if(rv3d->view==1) rv3d->viewbut= 2; @@ -4355,11 +4274,6 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o * menu is drawn wider than it should be. The ypos of -2 is to make it properly fill the * height of the header */ - xmax= GetButStringLength("View"); - uiDefMenuBut(block, view3d_viewmenu, NULL, "View", xco, yco, xmax-3, 20, ""); - //uiDefPulldownBut(block, view3d_viewmenu, NULL, "View", xco, yco, xmax-3, 20, ""); - xco+= xmax; - xmax= GetButStringLength("Select"); if (obedit) { if (ob && ob->type == OB_MESH) { @@ -4495,8 +4409,9 @@ static void header_xco_step(ARegion *ar, int *xco, int *yco, int *maxco, int ste } } -void view3d_header_buttons(const bContext *C, ARegion *ar) +void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) { + ARegion *ar= CTX_wm_region(C); ScrArea *sa= CTX_wm_area(C); View3D *v3d= sa->spacedata.first; Scene *scene= CTX_data_scene(C); @@ -4506,11 +4421,9 @@ void view3d_header_buttons(const bContext *C, ARegion *ar) uiBlock *block; int a, xco, maxco=0, yco= 3; - block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS); + block= uiLayoutFreeBlock(layout); uiBlockSetHandleFunc(block, do_view3d_header_buttons, NULL); - xco= ED_area_header_standardbuttons(C, block, yco); - if((sa->flag & HEADER_NO_PULLDOWN)==0) view3d_header_pulldowns(C, block, ob, &xco, yco); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index f20df81d6ad..d6ca03c85a2 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -650,9 +650,10 @@ void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, En if(C && eprop->itemf) { *item= eprop->itemf(C, ptr, free); - if(totitem) + if(totitem) { for(tot=0; (*item)[tot].identifier; tot++); - *totitem= tot; + *totitem= tot; + } } else { *item= eprop->item; diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 363891e0f24..404befc9bb2 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -273,6 +273,9 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_function_flag(func, FUNC_USE_CONTEXT); func= RNA_def_function(srna, "template_operator_search", "uiTemplateOperatorSearch"); + + func= RNA_def_function(srna, "template_header_3D", "uiTemplateHeader3D"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); } #endif -- cgit v1.2.3 From b1d01dae36ffa735090e8daec9b8ed953fef0aa4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 11 Jul 2009 13:57:56 +0000 Subject: PyApi * refcount error if StringIO or io modules could not be imported * importing python modules like math didnt work because the script registration overwrote the script path. now just prepend the path. --- source/blender/editors/space_view3d/space_view3d.c | 2 +- source/blender/python/intern/bpy_interface.c | 22 ++++++++----------- source/blender/python/intern/bpy_util.c | 25 +++++++++++++++------- 3 files changed, 27 insertions(+), 22 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 718b74e5225..f0c3a2c200c 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -601,7 +601,7 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes if(CTX_data_dir(member)) { static const char *dir[] = { "selected_objects", "selected_bases" "selected_editable_objects", - "selected_editable_bases" "visible_objects", "visible_bases", + "selected_editable_bases" "visible_objects", "visible_bases", "selectable_objects", "selectable_bases", "active_base", "active_object", "visible_bones", "editable_bones", "selected_bones", "selected_editable_bones" "visible_pchans", "selected_pchans", "active_bone", "active_pchan", NULL}; diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 42eb9c4c57a..a07c447c718 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -457,8 +457,7 @@ void BPY_run_ui_scripts(bContext *C, int reload) PyGILState_STATE gilstate; PyObject *mod; - PyObject *sys_path_orig; - PyObject *sys_path_new; + PyObject *sys_path; gilstate = PyGILState_Ensure(); @@ -466,6 +465,10 @@ void BPY_run_ui_scripts(bContext *C, int reload) BPy_SetContext(C); bpy_import_main_set(CTX_data_main(C)); + + sys_path= PySys_GetObject("path"); /* borrow */ + PyList_Insert(sys_path, 0, Py_None); /* place holder, resizes the list */ + for(a=0; dirs[a]; a++) { dirname= BLI_gethome_folder(dirs[a]); @@ -476,15 +479,9 @@ void BPY_run_ui_scripts(bContext *C, int reload) if(!dir) continue; - - /* backup sys.path */ - sys_path_orig= PySys_GetObject("path"); - Py_INCREF(sys_path_orig); /* dont free it */ - sys_path_new= PyList_New(1); - PyList_SET_ITEM(sys_path_new, 0, PyUnicode_FromString(dirname)); - PySys_SetObject("path", sys_path_new); - Py_DECREF(sys_path_new); + /* set the first dir in the sys.path for fast importing of modules */ + PyList_SetItem(sys_path, 0, PyUnicode_FromString(dirname)); /* steals the ref */ while((de = readdir(dir)) != NULL) { /* We could stat the file but easier just to let python @@ -514,11 +511,10 @@ void BPY_run_ui_scripts(bContext *C, int reload) } closedir(dir); - - PySys_SetObject("path", sys_path_orig); - Py_DECREF(sys_path_orig); } + PyList_SetSlice(sys_path, 0, 1, NULL); /* remove the first item */ + bpy_import_main_set(NULL); PyGILState_Release(gilstate); diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index 9f1ef0c6251..b451923e780 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -348,8 +348,8 @@ PyObject *BPY_exception_buffer(void) PyObject *stderr_backup = PySys_GetObject("stderr"); /* borrowed */ PyObject *string_io = NULL; PyObject *string_io_buf = NULL; - PyObject *string_io_mod; - PyObject *string_io_getvalue; + PyObject *string_io_mod= NULL; + PyObject *string_io_getvalue= NULL; PyObject *error_type, *error_value, *error_traceback; @@ -369,14 +369,11 @@ PyObject *BPY_exception_buffer(void) #else if(! (string_io_mod= PyImport_ImportModule("io")) ) { #endif - return NULL; + goto error_cleanup; } else if (! (string_io = PyObject_CallMethod(string_io_mod, "StringIO", NULL))) { - Py_DECREF(string_io_mod); - return NULL; + goto error_cleanup; } else if (! (string_io_getvalue= PyObject_GetAttrString(string_io, "getvalue"))) { - Py_DECREF(string_io_mod); - Py_DECREF(string_io); - return NULL; + goto error_cleanup; } Py_INCREF(stdout_backup); // since these were borrowed we dont want them freed when replaced. @@ -403,6 +400,18 @@ PyObject *BPY_exception_buffer(void) PyErr_Clear(); return string_io_buf; + + +error_cleanup: + /* could not import the module so print the error and close */ + Py_XDECREF(string_io_mod); + Py_XDECREF(string_io); + + PyErr_Restore(error_type, error_value, error_traceback); + PyErr_Print(); /* print the error */ + PyErr_Clear(); + + return NULL; } char *BPy_enum_as_string(EnumPropertyItem *item) -- cgit v1.2.3 From f3fdf9257b8d68603b827f62273c79d3cc476207 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 11 Jul 2009 14:50:12 +0000 Subject: 2.5: use primitive icons in the Add Object menu. --- source/blender/editors/object/object_edit.c | 40 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'source') diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index e39ed800e0c..35b6e23eaa5 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -322,16 +322,16 @@ void OBJECT_OT_object_add(wmOperatorType *ot) /* ****** work both in and outside editmode ****** */ static EnumPropertyItem prop_mesh_types[] = { - {0, "PLANE", 0, "Plane", ""}, - {1, "CUBE", 0, "Cube", ""}, - {2, "CIRCLE", 0, "Circle", ""}, - {3, "UVSPHERE", 0, "UVsphere", ""}, - {4, "ICOSPHERE", 0, "Icosphere", ""}, - {5, "CYLINDER", 0, "Cylinder", ""}, - {6, "CONE", 0, "Cone", ""}, + {0, "PLANE", ICON_MESH_PLANE, "Plane", ""}, + {1, "CUBE", ICON_MESH_CUBE, "Cube", ""}, + {2, "CIRCLE", ICON_MESH_CIRCLE, "Circle", ""}, + {3, "UVSPHERE", ICON_MESH_UVSPHERE, "UVsphere", ""}, + {4, "ICOSPHERE", ICON_MESH_ICOSPHERE, "Icosphere", ""}, + {5, "CYLINDER", ICON_MESH_TUBE, "Cylinder", ""}, + {6, "CONE", ICON_MESH_CONE, "Cone", ""}, {0, "", 0, NULL, NULL}, - {7, "GRID", 0, "Grid", ""}, - {8, "MONKEY", 0, "Monkey", ""}, + {7, "GRID", ICON_MESH_GRID, "Grid", ""}, + {8, "MONKEY", ICON_MESH_MONKEY, "Monkey", ""}, {0, NULL, 0, NULL, NULL} }; @@ -407,11 +407,11 @@ void OBJECT_OT_mesh_add(wmOperatorType *ot) } static EnumPropertyItem prop_curve_types[] = { - {CU_BEZIER|CU_2D|CU_PRIM_CURVE, "BEZIER_CURVE", 0, "Bezier Curve", ""}, - {CU_BEZIER|CU_2D|CU_PRIM_CIRCLE, "BEZIER_CIRCLE", 0, "Bezier Circle", ""}, - {CU_NURBS|CU_2D|CU_PRIM_CURVE, "NURBS_CURVE", 0, "NURBS Curve", ""}, - {CU_NURBS|CU_2D|CU_PRIM_CIRCLE, "NURBS_CIRCLE", 0, "NURBS Circle", ""}, - {CU_NURBS|CU_2D|CU_PRIM_PATH, "PATH", 0, "Path", ""}, + {CU_BEZIER|CU_2D|CU_PRIM_CURVE, "BEZIER_CURVE", ICON_CURVE_BEZCURVE, "Bezier Curve", ""}, + {CU_BEZIER|CU_2D|CU_PRIM_CIRCLE, "BEZIER_CIRCLE", ICON_CURVE_BEZCIRCLE, "Bezier Circle", ""}, + {CU_NURBS|CU_2D|CU_PRIM_CURVE, "NURBS_CURVE", ICON_CURVE_NCURVE, "NURBS Curve", ""}, + {CU_NURBS|CU_2D|CU_PRIM_CIRCLE, "NURBS_CIRCLE", ICON_CURVE_NCIRCLE, "NURBS Circle", ""}, + {CU_NURBS|CU_2D|CU_PRIM_PATH, "PATH", ICON_CURVE_PATH, "Path", ""}, {0, NULL, 0, NULL, NULL} }; @@ -481,12 +481,12 @@ void OBJECT_OT_curve_add(wmOperatorType *ot) } static EnumPropertyItem prop_surface_types[]= { - {CU_PRIM_CURVE|CU_NURBS, "NURBS_CURVE", 0, "NURBS Curve", ""}, - {CU_PRIM_CIRCLE|CU_NURBS, "NURBS_CIRCLE", 0, "NURBS Circle", ""}, - {CU_PRIM_PATCH|CU_NURBS, "NURBS_SURFACE", 0, "NURBS Surface", ""}, - {CU_PRIM_TUBE|CU_NURBS, "NURBS_TUBE", 0, "NURBS Tube", ""}, - {CU_PRIM_SPHERE|CU_NURBS, "NURBS_SPHERE", 0, "NURBS Sphere", ""}, - {CU_PRIM_DONUT|CU_NURBS, "NURBS_DONUT", 0, "NURBS Donut", ""}, + {CU_PRIM_CURVE|CU_NURBS, "NURBS_CURVE", ICON_SURFACE_NCURVE, "NURBS Curve", ""}, + {CU_PRIM_CIRCLE|CU_NURBS, "NURBS_CIRCLE", ICON_SURFACE_NCIRCLE, "NURBS Circle", ""}, + {CU_PRIM_PATCH|CU_NURBS, "NURBS_SURFACE", ICON_SURFACE_NSURFACE, "NURBS Surface", ""}, + {CU_PRIM_TUBE|CU_NURBS, "NURBS_TUBE", ICON_SURFACE_NTUBE, "NURBS Tube", ""}, + {CU_PRIM_SPHERE|CU_NURBS, "NURBS_SPHERE", ICON_SURFACE_NSPHERE, "NURBS Sphere", ""}, + {CU_PRIM_DONUT|CU_NURBS, "NURBS_DONUT", ICON_SURFACE_NDONUT, "NURBS Donut", ""}, {0, NULL, 0, NULL, NULL} }; -- cgit v1.2.3 From 79134a54b96e6ca1c835be374481d18853446353 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 11 Jul 2009 14:51:13 +0000 Subject: 2.5: X11 * Cursor grabbing is now done only if the OPTYPE_BLOCKING flag is set for the operator, since for e.g. render it should not block. --- source/blender/editors/animation/anim_markers.c | 2 +- source/blender/editors/animation/anim_ops.c | 3 +++ .../blender/editors/armature/editarmature_sketch.c | 5 +++-- source/blender/editors/armature/poselib.c | 2 +- source/blender/editors/interface/view2d_ops.c | 7 +++++-- source/blender/editors/physics/editparticle.c | 4 ++-- source/blender/editors/screen/screen_ops.c | 16 ++++++++++++---- source/blender/editors/sculpt_paint/paint_image.c | 6 +++--- source/blender/editors/sculpt_paint/paint_vertex.c | 8 ++++---- source/blender/editors/sculpt_paint/sculpt.c | 4 ++-- source/blender/editors/space_image/image_ops.c | 9 +++++++++ source/blender/editors/space_node/node_edit.c | 4 ++-- source/blender/editors/space_node/node_select.c | 2 +- source/blender/editors/space_text/text_ops.c | 8 +++++++- source/blender/editors/space_view3d/view3d_edit.c | 6 +++--- source/blender/editors/transform/transform_ops.c | 20 ++++++++++---------- source/blender/windowmanager/WM_types.h | 5 +++-- .../blender/windowmanager/intern/wm_event_system.c | 5 +++-- 18 files changed, 74 insertions(+), 42 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index d6543b41f47..7de3acdacef 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -620,7 +620,7 @@ static void MARKER_OT_move(wmOperatorType *ot) ot->poll= ED_operator_areaactive; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* rna storage */ RNA_def_int(ot->srna, "frames", 0, INT_MIN, INT_MAX, "Frames", "", INT_MIN, INT_MAX); diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 10691c558bf..73a1c934d97 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -209,6 +209,9 @@ void ANIM_OT_change_frame(wmOperatorType *ot) ot->invoke= change_frame_invoke; ot->cancel= change_frame_cancel; ot->modal= change_frame_modal; + + /* flags */ + ot->flag= OPTYPE_BLOCKING; /* rna */ RNA_def_int(ot->srna, "frame", 0, MINAFRAME, MAXFRAME, "Frame", "", MINAFRAME, MAXFRAME); diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 33351c99828..af1ed3e2746 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -3463,7 +3463,7 @@ void SKETCH_OT_draw_stroke(wmOperatorType *ot) RNA_def_boolean(ot->srna, "snap", 0, "Snap", ""); /* flags */ -// ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_BLOCKING; // OPTYPE_REGISTER|OPTYPE_UNDO } void SKETCH_OT_gesture(wmOperatorType *ot) @@ -3482,5 +3482,6 @@ void SKETCH_OT_gesture(wmOperatorType *ot) RNA_def_boolean(ot->srna, "snap", 0, "Snap", ""); /* flags */ -// ot->flag= OPTYPE_UNDO; + ot->flag= OPTYPE_BLOCKING; // OPTYPE_UNDO } + diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index fcc1e8f9644..93611a30bd8 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -1489,7 +1489,7 @@ void POSELIB_OT_browse_interactive (wmOperatorType *ot) ot->poll= ED_operator_posemode; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* properties */ RNA_def_int(ot->srna, "pose_index", -1, -2, INT_MAX, "Pose", "Index of the pose to apply (-2 for no change to pose, -1 for poselib active pose)", 0, INT_MAX); diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 54ab0d9ef61..14872f05f8a 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -257,7 +257,7 @@ void VIEW2D_OT_pan(wmOperatorType *ot) ot->modal= view_pan_modal; /* operator is repeatable */ - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; /* rna - must keep these in sync with the other operators */ RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX); @@ -832,7 +832,7 @@ void VIEW2D_OT_zoom(wmOperatorType *ot) ot->modal= view_zoomdrag_modal; /* operator is repeatable */ - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; /* rna - must keep these in sync with the other operators */ RNA_def_float(ot->srna, "deltax", 0, -FLT_MAX, FLT_MAX, "Delta X", "", -FLT_MAX, FLT_MAX); @@ -1261,6 +1261,9 @@ void VIEW2D_OT_scroller_activate(wmOperatorType *ot) /* identifiers */ ot->name= "Scroller Activate"; ot->idname= "VIEW2D_OT_scroller_activate"; + + /* flags */ + ot->flag= OPTYPE_BLOCKING; /* api callbacks */ ot->invoke= scroller_activate_invoke; diff --git a/source/blender/editors/physics/editparticle.c b/source/blender/editors/physics/editparticle.c index b656aa8fbf6..3f7880b7fef 100644 --- a/source/blender/editors/physics/editparticle.c +++ b/source/blender/editors/physics/editparticle.c @@ -2344,7 +2344,7 @@ void PARTICLE_OT_brush_radial_control(wmOperatorType *ot) ot->poll= PE_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } /*************************** delete operator **************************/ @@ -3358,7 +3358,7 @@ void PARTICLE_OT_brush_edit(wmOperatorType *ot) ot->poll= PE_poll_3dview; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* properties */ RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 99bbe0514c9..c3b68eb74ce 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -503,8 +503,10 @@ void SCREEN_OT_actionzone(wmOperatorType *ot) ot->invoke= actionzone_invoke; ot->modal= actionzone_modal; - ot->poll= actionzone_area_poll; + + ot->flag= OPTYPE_BLOCKING; + RNA_def_int(ot->srna, "modifier", 0, 0, 2, "modifier", "modifier state", 0, 2); } @@ -618,6 +620,8 @@ static void SCREEN_OT_area_swap(wmOperatorType *ot) ot->invoke= area_swap_invoke; ot->modal= area_swap_modal; ot->poll= ED_operator_areaactive; + + ot->flag= OPTYPE_BLOCKING; } /* *********** Duplicate area as new window operator ****************** */ @@ -912,9 +916,10 @@ void SCREEN_OT_area_move(wmOperatorType *ot) ot->invoke= area_move_invoke; ot->cancel= area_move_cancel; ot->modal= area_move_modal; - ot->poll= ED_operator_screen_mainwinactive; /* when mouse is over area-edge */ + ot->flag= OPTYPE_BLOCKING; + /* rna */ RNA_def_int(ot->srna, "x", 0, INT_MIN, INT_MAX, "X", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "y", 0, INT_MIN, INT_MAX, "Y", "", INT_MIN, INT_MAX); @@ -1227,7 +1232,7 @@ void SCREEN_OT_area_split(wmOperatorType *ot) ot->modal= area_split_modal; ot->poll= ED_operator_areaactive; - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; /* rna */ RNA_def_enum(ot->srna, "direction", prop_direction_items, 'h', "Direction", ""); @@ -1344,6 +1349,8 @@ static void SCREEN_OT_region_scale(wmOperatorType *ot) ot->modal= region_scale_modal; ot->poll= ED_operator_areaactive; + + ot->flag= OPTYPE_BLOCKING; } @@ -1725,9 +1732,10 @@ void SCREEN_OT_area_join(wmOperatorType *ot) ot->exec= area_join_exec; ot->invoke= area_join_invoke; ot->modal= area_join_modal; - ot->poll= ED_operator_areaactive; + ot->flag= OPTYPE_BLOCKING; + /* rna */ RNA_def_int(ot->srna, "x1", -100, INT_MIN, INT_MAX, "X 1", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "y1", -100, INT_MIN, INT_MAX, "Y 1", "", INT_MIN, INT_MAX); diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index a163ef5f8e2..720e64d260f 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -4804,7 +4804,7 @@ void PAINT_OT_image_paint(wmOperatorType *ot) ot->poll= image_paint_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* properties */ RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); @@ -4911,7 +4911,7 @@ void PAINT_OT_image_paint_radial_control(wmOperatorType *ot) ot->poll= image_paint_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } /************************ grab clone operator ************************/ @@ -5010,7 +5010,7 @@ void PAINT_OT_grab_clone(wmOperatorType *ot) ot->poll= image_paint_2d_clone_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* properties */ RNA_def_float_vector(ot->srna, "delta", 2, NULL, -FLT_MAX, FLT_MAX, "Delta", "Delta offset of clone image in 0.0..1.0 coordinates.", -1.0f, 1.0f); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 74b5d5a4206..c5aea5ae077 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1225,7 +1225,7 @@ void PAINT_OT_weight_paint_radial_control(wmOperatorType *ot) ot->poll= wp_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } void PAINT_OT_vertex_paint_radial_control(wmOperatorType *ot) @@ -1241,7 +1241,7 @@ void PAINT_OT_vertex_paint_radial_control(wmOperatorType *ot) ot->poll= vp_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } /* ************ weight paint operator ********** */ @@ -1567,7 +1567,7 @@ void PAINT_OT_weight_paint(wmOperatorType *ot) ot->poll= wp_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } @@ -1864,6 +1864,6 @@ void PAINT_OT_vertex_paint(wmOperatorType *ot) ot->poll= vp_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 457deb8c113..7245218c688 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1151,7 +1151,7 @@ static void SCULPT_OT_radial_control(wmOperatorType *ot) ot->exec= sculpt_radial_control_exec; ot->poll= sculpt_poll; - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } /**** Operator for applying a stroke (various attributes including mouse path) @@ -1589,7 +1589,7 @@ static void SCULPT_OT_brush_stroke(wmOperatorType *ot) ot->poll= sculpt_poll; /* flags (sculpt does own undo? (ton) */ - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; /* properties */ RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 358da483744..578da29f102 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -251,6 +251,9 @@ void IMAGE_OT_view_pan(wmOperatorType *ot) ot->modal= view_pan_modal; ot->cancel= view_pan_cancel; ot->poll= space_image_main_area_poll; + + /* flags */ + ot->flag= OPTYPE_BLOCKING; /* properties */ RNA_def_float_vector(ot->srna, "offset", 2, NULL, -FLT_MAX, FLT_MAX, @@ -363,6 +366,9 @@ void IMAGE_OT_view_zoom(wmOperatorType *ot) ot->modal= view_zoom_modal; ot->cancel= view_zoom_cancel; ot->poll= space_image_main_area_poll; + + /* flags */ + ot->flag= OPTYPE_BLOCKING; /* properties */ RNA_def_float(ot->srna, "factor", 0.0f, 0.0f, FLT_MAX, @@ -1487,6 +1493,9 @@ void IMAGE_OT_sample(wmOperatorType *ot) ot->modal= sample_modal; ot->cancel= sample_cancel; ot->poll= space_image_main_area_poll; + + /* flags */ + ot->flag= OPTYPE_BLOCKING; } /******************** set curve point operator ********************/ diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 89d81f846d2..0384965e49e 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1178,7 +1178,7 @@ void NODE_OT_resize(wmOperatorType *ot) ot->poll= ED_operator_node_active; /* flags */ - ot->flag= 0; + ot->flag= OPTYPE_BLOCKING; } @@ -2012,7 +2012,7 @@ void NODE_OT_link(wmOperatorType *ot) ot->poll= ED_operator_node_active; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index 6746c21ebcf..450b17e69bb 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -213,7 +213,7 @@ void NODE_OT_select(wmOperatorType *ot) ot->modal= node_select_modal; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; RNA_def_enum(ot->srna, "select_type", prop_select_items, 0, "Select Type", ""); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 95970798e53..5568900e621 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -1836,6 +1836,9 @@ void TEXT_OT_scroll(wmOperatorType *ot) ot->cancel= scroll_cancel; ot->poll= text_space_edit_poll; + /* flags */ + ot->flag= OPTYPE_BLOCKING; + /* properties */ RNA_def_int(ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll.", -100, 100); } @@ -1880,6 +1883,9 @@ void TEXT_OT_scroll_bar(wmOperatorType *ot) ot->cancel= scroll_cancel; ot->poll= text_region_edit_poll; + /* flags */ + ot->flag= OPTYPE_BLOCKING; + /* properties */ RNA_def_int(ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll.", -100, 100); } @@ -2151,7 +2157,7 @@ void TEXT_OT_cursor_set(wmOperatorType *ot) ot->poll= text_region_edit_poll; /* flags */ - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; /* properties */ RNA_def_boolean(ot->srna, "select", 0, "Select", "Set selection end rather than cursor."); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 5e77c932a6c..3c80b650cf3 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -560,7 +560,7 @@ void VIEW3D_OT_viewrotate(wmOperatorType *ot) ot->poll= ED_operator_view3d_active; /* flags */ - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; } /* ************************ viewmove ******************************** */ @@ -644,7 +644,7 @@ void VIEW3D_OT_viewmove(wmOperatorType *ot) ot->poll= ED_operator_view3d_active; /* flags */ - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; } /* ************************ viewzoom ******************************** */ @@ -844,7 +844,7 @@ void VIEW3D_OT_zoom(wmOperatorType *ot) ot->poll= ED_operator_view3d_active; /* flags */ - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; RNA_def_int(ot->srna, "delta", 0, INT_MIN, INT_MAX, "Delta", "", INT_MIN, INT_MAX); } diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index ee4f1b90451..f2630f40c9c 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -302,7 +302,7 @@ void TFM_OT_translation(struct wmOperatorType *ot) /* identifiers */ ot->name = "Translation"; ot->idname = OP_TRANSLATION; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -327,7 +327,7 @@ void TFM_OT_resize(struct wmOperatorType *ot) /* identifiers */ ot->name = "Resize"; ot->idname = OP_RESIZE; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -353,7 +353,7 @@ void TFM_OT_trackball(struct wmOperatorType *ot) /* identifiers */ ot->name = "Trackball"; ot->idname = OP_TRACKBALL; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -374,7 +374,7 @@ void TFM_OT_rotation(struct wmOperatorType *ot) /* identifiers */ ot->name = "Rotation"; ot->idname = OP_ROTATION; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -399,7 +399,7 @@ void TFM_OT_tilt(struct wmOperatorType *ot) /* identifiers */ ot->name = "Tilt"; ot->idname = OP_TILT; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -422,7 +422,7 @@ void TFM_OT_warp(struct wmOperatorType *ot) /* identifiers */ ot->name = "Warp"; ot->idname = OP_WARP; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -446,7 +446,7 @@ void TFM_OT_shear(struct wmOperatorType *ot) /* identifiers */ ot->name = "Shear"; ot->idname = OP_SHEAR; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -470,7 +470,7 @@ void TFM_OT_shrink_fatten(struct wmOperatorType *ot) /* identifiers */ ot->name = "Shrink/Fatten"; ot->idname = OP_SHRINK_FATTEN; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -491,7 +491,7 @@ void TFM_OT_tosphere(struct wmOperatorType *ot) /* identifiers */ ot->name = "To Sphere"; ot->idname = OP_TOSPHERE; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -542,7 +542,7 @@ void TFM_OT_transform(struct wmOperatorType *ot) /* identifiers */ ot->name = "Transform"; ot->idname = "TFM_OT_transform"; - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 432140f1cf7..ab55f8a4459 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -40,8 +40,9 @@ struct wmWindowManager; /* ************** wmOperatorType ************************ */ /* flag */ -#define OPTYPE_REGISTER 1 -#define OPTYPE_UNDO 2 +#define OPTYPE_REGISTER 1 /* register operators in stack after finishing */ +#define OPTYPE_UNDO 2 /* do undo push after after */ +#define OPTYPE_BLOCKING 4 /* let blender grab all input from the WM (X11) */ /* context to call operator in for WM_operator_name_call */ /* rna_ui.c contains EnumPropertyItem's of these, keep in sync */ diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 5bcbf526460..491b70deedc 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -379,8 +379,9 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P WM_operator_free(op); } else if(retval & OPERATOR_RUNNING_MODAL) { - /* automatically grab cursor during modal ops (X11) */ - WM_cursor_grab(CTX_wm_window(C), 1); + /* grab cursor during blocking modal ops (X11) */ + if(ot->flag & OPTYPE_BLOCKING) + WM_cursor_grab(CTX_wm_window(C), 1); } else WM_operator_free(op); -- cgit v1.2.3 From 42469ba1e51c639c3fd317b812c486913d803fde Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Sat, 11 Jul 2009 22:22:53 +0000 Subject: SVN maintenance. --- source/blender/blenkernel/intern/fmodifier.c | 2 +- source/blender/blenkernel/nla_private.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index aa5214979d9..64558d0b456 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -1,5 +1,5 @@ /** - * $Id: fcurve.c 21299 2009-07-02 02:12:37Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/blenkernel/nla_private.h b/source/blender/blenkernel/nla_private.h index df7ffaa3064..325798f325f 100644 --- a/source/blender/blenkernel/nla_private.h +++ b/source/blender/blenkernel/nla_private.h @@ -1,5 +1,5 @@ /** - * $Id: BKE_nla.h 20999 2009-06-19 04:45:56Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * -- cgit v1.2.3 From 8b9bb47a3faf753cb0ca2ec0e9c6a741c7af31c2 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Sun, 12 Jul 2009 02:01:13 +0000 Subject: Cleaning up manipulator code a bit Made transform confirm or cancel on mouse up. More inline with button clicking and better for tablets. Add operator params to make sure Rip and Extrude turn off PET and Mirror correctly. Note: sorry for all the whitespace changes, I need to reconfigure this editor not to do autocleanup. --- source/blender/editors/include/ED_transform.h | 10 +- source/blender/editors/mesh/editmesh_tools.c | 2419 ++++++++++---------- source/blender/editors/transform/transform.c | 1197 +++++----- source/blender/editors/transform/transform.h | 30 +- .../editors/transform/transform_constraints.c | 207 +- .../editors/transform/transform_conversions.c | 1236 +++++----- .../blender/editors/transform/transform_generics.c | 316 ++- .../editors/transform/transform_manipulator.c | 84 +- 8 files changed, 2659 insertions(+), 2840 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index d2185854a95..768040597a4 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -1,5 +1,5 @@ /** - * $Id: ED_transform.h 21450 2009-07-09 02:45:48Z theeth $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -119,12 +119,16 @@ struct EnumPropertyItem *BIF_enumTransformOrientation(struct bContext *C); char * BIF_menustringTransformOrientation(const struct bContext *C, char *title); /* the returned value was allocated and needs to be freed after use */ int BIF_countTransformOrientation(const struct bContext *C); -void BIF_getPropCenter(float *center); - void BIF_TransformSetUndo(char *str); void BIF_selectOrientation(void); +/* to be able to add operator properties to other operators */ + +void Properties_Proportional(struct wmOperatorType *ot); +void Properties_Snapping(struct wmOperatorType *ot, short align); +void Properties_Constraints(struct wmOperatorType *ot); + /* view3d manipulators */ void initManipulator(int mode); void ManipulatorTransform(); diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 682b1ee4a64..eab06444a79 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -1,4 +1,4 @@ - /* $Id: + /* $Id: * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -133,7 +133,7 @@ struct facesort { static int vergface(const void *v1, const void *v2) { const struct facesort *x1=v1, *x2=v2; - + if( x1->x > x2->x ) return 1; else if( x1->x < x2->x) return -1; return 0; @@ -146,7 +146,7 @@ void convert_to_triface(EditMesh *em, int direction) { EditFace *efa, *efan, *next; float fac; - + efa= em->faces.last; while(efa) { next= efa->prev; @@ -167,17 +167,17 @@ void convert_to_triface(EditMesh *em, int direction) efan= EM_face_from_faces(em, efa, NULL, 1, 2, 3, -1); if(efa->f & SELECT) EM_select_face(efan, 1); } - + BLI_remlink(&em->faces, efa); free_editface(em, efa); } } efa= next; } - + EM_fgon_flags(em); // redo flags and indices for fgons - + } int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) /* return amount */ @@ -188,7 +188,7 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) / Used for "Auto Weld" mode. warning. limit - Quick manhattan distance between verts. */ - + /* all verts with (flag & 'flag') are being evaluated */ EditVert *eve, *v1, *nextve; EditEdge *eed, *e1, *nexted; @@ -196,8 +196,8 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) / xvertsort *sortblock, *sb, *sb1; struct facesort *vlsortblock, *vsb, *vsb1; int a, b, test, amount; - - + + /* flag 128 is cleared, count */ /* Normal non weld operation */ @@ -223,9 +223,9 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) / } qsort(sortblock, amount, sizeof(xvertsort), vergxco); - + /* test for doubles */ - sb= sortblock; + sb= sortblock; if (automerge) { for(a=0; av1; @@ -233,12 +233,12 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) / sb1= sb+1; for(b=a+1; bf & 128)==0; b++, sb1++) { if(sb1->x - sb->x > limit) break; - + /* when automarge, only allow unselected->selected */ v1= sb1->v1; if( (v1->f & 128)==0 ) { if ((eve->f & flag)==0 && (v1->f & flag)==1) { - if( (float)fabs(v1->co[0]-eve->co[0])<=limit && + if( (float)fabs(v1->co[0]-eve->co[0])<=limit && (float)fabs(v1->co[1]-eve->co[1])<=limit && (float)fabs(v1->co[2]-eve->co[2])<=limit) { /* unique bit */ @@ -246,7 +246,7 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) / eve->tmp.v = v1; } } else if( (eve->f & flag)==1 && (v1->f & flag)==0 ) { - if( (float)fabs(v1->co[0]-eve->co[0])<=limit && + if( (float)fabs(v1->co[0]-eve->co[0])<=limit && (float)fabs(v1->co[1]-eve->co[1])<=limit && (float)fabs(v1->co[2]-eve->co[2])<=limit) { /* unique bit */ @@ -267,10 +267,10 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) / /* first test: simpel dist */ if(sb1->x - sb->x > limit) break; v1= sb1->v1; - + /* second test: is vertex allowed */ if( (v1->f & 128)==0 ) { - if( (float)fabs(v1->co[0]-eve->co[0])<=limit && + if( (float)fabs(v1->co[0]-eve->co[0])<=limit && (float)fabs(v1->co[1]-eve->co[1])<=limit && (float)fabs(v1->co[2]-eve->co[2])<=limit) { @@ -283,12 +283,12 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) / } } MEM_freeN(sortblock); - + if (!automerge) for(eve = em->verts.first; eve; eve=eve->next) if((eve->f & flag) && (eve->f & 128)) EM_data_interp_from_verts(em, eve, eve->tmp.v, eve->tmp.v, 0.5f); - + /* test edges and insert again */ eed= em->edges.first; while(eed) { @@ -327,7 +327,7 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) / else if(efa->v2->f & 128) efa->f1= 1; else if(efa->v3->f & 128) efa->f1= 1; else if(efa->v4 && (efa->v4->f & 128)) efa->f1= 1; - + if(efa->f1==1) amount++; efa= efa->next; } @@ -337,12 +337,12 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) / while(efa) { nextvl= efa->next; if(efa->f1==1) { - + if(efa->v1->f & 128) efa->v1= efa->v1->tmp.v; if(efa->v2->f & 128) efa->v2= efa->v2->tmp.v; if(efa->v3->f & 128) efa->v3= efa->v3->tmp.v; if(efa->v4 && (efa->v4->f & 128)) efa->v4= efa->v4->tmp.v; - + test= 0; if(efa->v1==efa->v2) test+=1; if(efa->v2==efa->v3) test+=2; @@ -350,7 +350,7 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) / if(efa->v4==efa->v1) test+=8; if(efa->v3==efa->v4) test+=16; if(efa->v2==efa->v4) test+=32; - + if(test) { if(efa->v4) { if(test==1 || test==2) { @@ -378,7 +378,7 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) / amount--; } } - + if(test==0) { /* set edge pointers */ efa->e1= findedgelist(em, efa->v1, efa->v2); @@ -423,9 +423,9 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) / } efa= efa->next; } - + qsort(vlsortblock, amount, sizeof(struct facesort), vergface); - + vsb= vlsortblock; for(a=0; aefa; @@ -433,24 +433,24 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) / vsb1= vsb+1; for(b=a+1; bx != vsb1->x) break; - + /* second test: is test permitted? */ efa= vsb1->efa; if( (efa->f1 & 128)==0 ) { if( compareface(efa, vsb->efa)) efa->f1 |= 128; - + } vsb1++; } } vsb++; } - + MEM_freeN(vlsortblock); - + /* remove double faces */ efa= (struct EditFace *)em->faces.first; while(efa) { @@ -462,7 +462,7 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) / efa= nextvl; } } - + /* remove double vertices */ a= 0; eve= (struct EditVert *)em->verts.first; @@ -495,12 +495,12 @@ static int removedoublesflag_exec(bContext *C, wmOperator *op) sprintf(msg, "Removed %d vertices", cnt); BKE_report(op->reports, RPT_INFO, msg); } - + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - + BKE_mesh_end_editmesh(obedit->data, em); - return OPERATOR_FINISHED; + return OPERATOR_FINISHED; } void MESH_OT_remove_doubles(wmOperatorType *ot) @@ -508,11 +508,11 @@ void MESH_OT_remove_doubles(wmOperatorType *ot) /* identifiers */ ot->name= "Remove Doubles"; ot->idname= "MESH_OT_remove_doubles"; - + /* api callbacks */ ot->exec= removedoublesflag_exec; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -534,18 +534,18 @@ void xsortvert_flag(bContext *C, int flag) xvertsort *sortblock; ListBase tbase; int i, amount; - + em_setup_viewcontext(C, &vc); - + amount = BLI_countlist(&vc.em->verts); sortblock = MEM_callocN(sizeof(xvertsort)*amount,"xsort"); for (i=0,eve= vc.em->verts.first; eve; i++,eve=eve->next) if(eve->f & flag) sortblock[i].v1 = eve; - + mesh_foreachScreenVert(&vc, xsortvert_flag__doSetX, sortblock, 0); qsort(sortblock, amount, sizeof(xvertsort), vergxco); - + /* make temporal listbase */ tbase.first= tbase.last= 0; for (i=0; iverts, &tbase); - + MEM_freeN(sortblock); } @@ -571,7 +571,7 @@ void hashvert_flag(EditMesh *em, int flag) struct xvertsort *sortblock, *sb, onth, *newsort; ListBase tbase; int amount, a, b; - + /* count */ eve= em->verts.first; amount= 0; @@ -580,7 +580,7 @@ void hashvert_flag(EditMesh *em, int flag) eve= eve->next; } if(amount==0) return; - + /* allocate memory */ sb= sortblock= (struct xvertsort *)MEM_mallocN(sizeof(struct xvertsort)*amount,"sortremovedoub"); eve= em->verts.first; @@ -593,7 +593,7 @@ void hashvert_flag(EditMesh *em, int flag) } BLI_srand(1); - + sb= sortblock; for(a=0; averts, &tbase); - + MEM_freeN(sortblock); } @@ -632,11 +632,11 @@ void extrude_mesh(Object *obedit, EditMesh *em, wmOperator *op) if(em->totvertsel==0) nr= 0; else if(em->totvertsel==1) nr= 4; else if(em->totedgesel==0) nr= 4; - else if(em->totfacesel==0) + else if(em->totfacesel==0) nr= 3; // pupmenu("Extrude %t|Only Edges%x3|Only Vertices%x4"); else if(em->totfacesel==1) nr= 1; // pupmenu("Extrude %t|Region %x1|Only Edges%x3|Only Vertices%x4"); - else + else nr= 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3|Only Vertices%x4"); } else if(em->selectmode & SCE_SELECT_EDGE) { @@ -654,27 +654,27 @@ void extrude_mesh(Object *obedit, EditMesh *em, wmOperator *op) else nr= 1; // pupmenu("Extrude %t|Region %x1||Individual Faces %x2"); } - + if(nr<1) return; if(nr==1) transmode= extrudeflag(obedit, em, SELECT, nor); else if(nr==4) transmode= extrudeflag_verts_indiv(em, SELECT, nor); else if(nr==3) transmode= extrudeflag_edges_indiv(em, SELECT, nor); else transmode= extrudeflag_face_indiv(em, SELECT, nor); - + if(transmode==0) { BKE_report(op->reports, RPT_ERROR, "Not a valid selection for extrude"); } else { EM_fgon_flags(em); - - /* We need to force immediate calculation here because + + /* We need to force immediate calculation here because * transform may use derived objects (which are now stale). * * This shouldn't be necessary, derived queries should be * automatically building this data if invalid. Or something. */ -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); object_handle_update(scene, obedit); /* individual faces? */ @@ -709,11 +709,12 @@ static int mesh_extrude_invoke(bContext *C, wmOperator *op, wmEvent *event) DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - - RNA_int_set(op->ptr, "mode", TFM_TRANSLATION); - WM_operator_name_call(C, "TFM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr); - - return OPERATOR_FINISHED; + + RNA_enum_set(op->ptr, "proportional", 0); + RNA_boolean_set(op->ptr, "mirror", 0); + WM_operator_name_call(C, "TFM_OT_translation", WM_OP_INVOKE_REGION_WIN, op->ptr); + + return OPERATOR_FINISHED; } /* extrude without transform */ @@ -722,14 +723,14 @@ static int mesh_extrude_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(obedit->data); - + extrude_mesh(obedit,em, op); - + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - + BKE_mesh_end_editmesh(obedit->data, em); - return OPERATOR_FINISHED; + return OPERATOR_FINISHED; } @@ -738,17 +739,18 @@ void MESH_OT_extrude(wmOperatorType *ot) /* identifiers */ ot->name= "Extrude"; ot->idname= "MESH_OT_extrude"; - + /* api callbacks */ ot->invoke= mesh_extrude_invoke; ot->exec= mesh_extrude_exec; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* to give to transform */ - RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); + Properties_Proportional(ot); + RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", ""); } static int split_mesh(bContext *C, wmOperator *op) @@ -779,11 +781,11 @@ void MESH_OT_split(wmOperatorType *ot) /* identifiers */ ot->name= "Split"; ot->idname= "MESH_OT_split"; - + /* api callbacks */ ot->exec= split_mesh; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -795,10 +797,10 @@ static int extrude_repeat_mesh(bContext *C, wmOperator *op) Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - RegionView3D *rv3d = ED_view3d_context_rv3d(C); - + RegionView3D *rv3d = ED_view3d_context_rv3d(C); + int steps = RNA_int_get(op->ptr,"steps"); - + float offs = RNA_float_get(op->ptr,"offset"); float dvec[3], tmat[3][3], bmat[3][3], nor[3]= {0.0, 0.0, 0.0}; @@ -822,11 +824,11 @@ static int extrude_repeat_mesh(bContext *C, wmOperator *op) extrudeflag(obedit, em, SELECT, nor); translateflag(em, SELECT, dvec); } - + recalc_editnormals(em); - + EM_fgon_flags(em); - + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); @@ -839,14 +841,14 @@ void MESH_OT_extrude_repeat(wmOperatorType *ot) /* identifiers */ ot->name= "Extrude Repeat Mesh"; ot->idname= "MESH_OT_extrude_repeat"; - + /* api callbacks */ ot->exec= extrude_repeat_mesh; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - + /* props */ RNA_def_float(ot->srna, "offset", 2.0f, 0.0f, 100.0f, "Offset", "", 0.0f, FLT_MAX); RNA_def_int(ot->srna, "steps", 10, 0, 180, "Steps", "", 0, INT_MAX); @@ -868,7 +870,7 @@ static int spin_mesh(bContext *C, wmOperator *op, float *dvec, int steps, float short a, ok= 1; RNA_float_get_array(op->ptr, "center", cent); - + /* imat and center and size */ Mat3CpyMat4(bmat, obedit->obmat); Mat3Inv(imat,bmat); @@ -895,14 +897,14 @@ static int spin_mesh(bContext *C, wmOperator *op, float *dvec, int steps, float Mat3MulMat3(tmat,cmat,bmat); Mat3MulMat3(bmat,imat,tmat); - if(dupli==0) - if(scene->toolsettings->editbutflag & B_KEEPORIG) + if(dupli==0) + if(scene->toolsettings->editbutflag & B_KEEPORIG) adduplicateflag(em, 1); for(a=0; adata, em); return ok; } @@ -942,7 +944,7 @@ static int spin_mesh_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); int ok; - + ok= spin_mesh(C, op, NULL, RNA_int_get(op->ptr,"steps"), RNA_float_get(op->ptr,"degrees"), RNA_boolean_get(op->ptr,"dupli")); if(ok==0) { BKE_report(op->reports, RPT_ERROR, "No valid vertices are selected"); @@ -961,10 +963,10 @@ static int spin_mesh_invoke(bContext *C, wmOperator *op, wmEvent *event) Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d= ED_view3d_context_rv3d(C); - + RNA_float_set_array(op->ptr, "center", give_cursor(scene, v3d)); RNA_float_set_array(op->ptr, "axis", rv3d->viewinv[2]); - + return spin_mesh_exec(C, op); } @@ -973,20 +975,20 @@ void MESH_OT_spin(wmOperatorType *ot) /* identifiers */ ot->name= "Spin"; ot->idname= "MESH_OT_spin"; - + /* api callbacks */ ot->invoke= spin_mesh_invoke; ot->exec= spin_mesh_exec; ot->poll= EM_view3d_poll; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - + /* props */ RNA_def_int(ot->srna, "steps", 9, 0, INT_MAX, "Steps", "Steps", 0, INT_MAX); RNA_def_boolean(ot->srna, "dupli", 0, "Dupli", "Make Duplicates"); RNA_def_float(ot->srna, "degrees", 90.0f, -FLT_MAX, FLT_MAX, "Degrees", "Degrees", -360.0f, 360.0f); - + RNA_def_float_vector(ot->srna, "center", 3, NULL, -FLT_MAX, FLT_MAX, "Center", "Center in global view space", -FLT_MAX, FLT_MAX); RNA_def_float_vector(ot->srna, "axis", 3, NULL, -1.0f, 1.0f, "Axis", "Axis in global view space", -FLT_MAX, FLT_MAX); @@ -1004,7 +1006,7 @@ static int screw_mesh_exec(bContext *C, wmOperator *op) turns= RNA_int_get(op->ptr, "turns"); steps= RNA_int_get(op->ptr, "steps"); - + /* clear flags */ for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0; @@ -1048,12 +1050,12 @@ static int screw_mesh_exec(bContext *C, wmOperator *op) dvec[1]= -dvec[1]; dvec[2]= -dvec[2]; } - + if(spin_mesh(C, op, dvec, turns*steps, 360.0f*turns, 0)) { DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - BKE_mesh_end_editmesh(obedit->data, em); + BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } else { @@ -1069,10 +1071,10 @@ static int screw_mesh_invoke(bContext *C, wmOperator *op, wmEvent *event) Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d= ED_view3d_context_rv3d(C); - + RNA_float_set_array(op->ptr, "center", give_cursor(scene, v3d)); RNA_float_set_array(op->ptr, "axis", rv3d->viewinv[1]); - + return screw_mesh_exec(C, op); } @@ -1081,15 +1083,15 @@ void MESH_OT_screw(wmOperatorType *ot) /* identifiers */ ot->name= "Screw"; ot->idname= "MESH_OT_screw"; - + /* api callbacks */ ot->invoke= screw_mesh_invoke; ot->exec= screw_mesh_exec; ot->poll= EM_view3d_poll; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - + /*props */ RNA_def_int(ot->srna, "steps", 9, 0, INT_MAX, "Steps", "Steps", 0, 256); RNA_def_int(ot->srna, "turns", 1, 0, INT_MAX, "Turns", "Turns", 0, 256); @@ -1101,7 +1103,7 @@ void MESH_OT_screw(wmOperatorType *ot) static void erase_edges(EditMesh *em, ListBase *l) { EditEdge *ed, *nexted; - + ed = (EditEdge *) l->first; while(ed) { nexted= ed->next; @@ -1127,7 +1129,7 @@ static void erase_faces(EditMesh *em, ListBase *l) } f = nextf; } -} +} static void erase_vertices(EditMesh *em, ListBase *l) { @@ -1152,7 +1154,7 @@ void delete_mesh(Object *obedit, EditMesh *em, wmOperator *op, int event) int count; char *str="Erase"; - + if(event<1) return; if(event==10 ) { @@ -1160,7 +1162,7 @@ void delete_mesh(Object *obedit, EditMesh *em, wmOperator *op, int event) erase_edges(em, &em->edges); erase_faces(em, &em->faces); erase_vertices(em, &em->verts); - } + } else if(event==6) { if(!EdgeLoopDelete(em, op)) return; @@ -1201,14 +1203,14 @@ void delete_mesh(Object *obedit, EditMesh *em, wmOperator *op, int event) if( efa->v2->f & SELECT) event++; if( efa->v3->f & SELECT) event++; if(efa->v4 && (efa->v4->f & SELECT)) event++; - + if(event>1) { BLI_remlink(&em->faces, efa); free_editface(em, efa); } efa= nextvl; } - } + } else if(event==1) { str= "Erase Edges"; // faces first @@ -1220,7 +1222,7 @@ void delete_mesh(Object *obedit, EditMesh *em, wmOperator *op, int event) if( efa->e2->f & SELECT) event++; if( efa->e3->f & SELECT) event++; if(efa->e4 && (efa->e4->f & SELECT)) event++; - + if(event) { BLI_remlink(&em->faces, efa); free_editface(em, efa); @@ -1298,12 +1300,12 @@ static int delete_mesh_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - + delete_mesh(obedit, em, op, RNA_enum_get(op->ptr, "type")); - + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - + BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -1313,16 +1315,16 @@ void MESH_OT_delete(wmOperatorType *ot) /* identifiers */ ot->name= "Delete"; ot->idname= "MESH_OT_delete"; - + /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= delete_mesh_exec; - + ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - + /*props */ RNA_def_enum(ot->srna, "type", prop_mesh_delete_types, 10, "Type", "Method used for deleting mesh data"); } @@ -1344,38 +1346,38 @@ void MESH_OT_delete(wmOperatorType *ot) static void alter_co(float *co, EditEdge *edge, float smooth, float fractal, int beauty, float perc) { float vec1[3], fac; - + if(beauty & B_SMOOTH) { /* we calculate an offset vector vec1[], to be added to *co */ float len, fac, nor[3], nor1[3], nor2[3]; - + VecSubf(nor, edge->v1->co, edge->v2->co); len= 0.5f*Normalize(nor); - + VECCOPY(nor1, edge->v1->no); VECCOPY(nor2, edge->v2->no); - + /* cosine angle */ fac= nor[0]*nor1[0] + nor[1]*nor1[1] + nor[2]*nor1[2] ; - + vec1[0]= fac*nor1[0]; vec1[1]= fac*nor1[1]; vec1[2]= fac*nor1[2]; - + /* cosine angle */ fac= -nor[0]*nor2[0] - nor[1]*nor2[1] - nor[2]*nor2[2] ; - + vec1[0]+= fac*nor2[0]; vec1[1]+= fac*nor2[1]; vec1[2]+= fac*nor2[2]; /* falloff for multi subdivide */ smooth *= sqrt(fabs(1.0f - 2.0f*fabs(0.5f-perc))); - + vec1[0]*= smooth*len; vec1[1]*= smooth*len; vec1[2]*= smooth*len; - + co[0] += vec1[0]; co[1] += vec1[1]; co[2] += vec1[2]; @@ -1403,14 +1405,14 @@ static EditVert *subdivide_edge_addvert(EditMesh *em, EditEdge *edge, float smoo { EditVert *ev; float co[3]; - + co[0] = (edge->v2->co[0]-edge->v1->co[0])*percent + edge->v1->co[0]; co[1] = (edge->v2->co[1]-edge->v1->co[1])*percent + edge->v1->co[1]; - co[2] = (edge->v2->co[2]-edge->v1->co[2])*percent + edge->v1->co[2]; - + co[2] = (edge->v2->co[2]-edge->v1->co[2])*percent + edge->v1->co[2]; + /* offset for smooth or sphere or fractal */ alter_co(co, edge, smooth, fractal, beauty, percent); - + /* clip if needed by mirror modifier */ if (edge->v1->f2) { if ( edge->v1->f2 & edge->v2->f2 & 1) { @@ -1423,18 +1425,18 @@ static EditVert *subdivide_edge_addvert(EditMesh *em, EditEdge *edge, float smoo co[2]= 0.0f; } } - + ev = addvertlist(em, co, NULL); - + /* vert data (vgroups, ..) */ EM_data_interp_from_verts(em, edge->v1, edge->v2, ev, percent); - + /* normal */ ev->no[0] = (edge->v2->no[0]-edge->v1->no[0])*percent + edge->v1->no[0]; ev->no[1] = (edge->v2->no[1]-edge->v1->no[1])*percent + edge->v1->no[1]; ev->no[2] = (edge->v2->no[2]-edge->v1->no[2])*percent + edge->v1->no[2]; Normalize(ev->no); - + return ev; } @@ -1442,11 +1444,11 @@ static void flipvertarray(EditVert** arr, short size) { EditVert *hold; int i; - + for(i=0; ifdata, &em->fdata, source->data, &target->data); target->mat_nr = source->mat_nr; - target->flag = source->flag; + target->flag = source->flag; target->h = source->h; - + InterpWeightsQ3Dfl(v1, v2, v3, v4, target->v1->co, w[0]); InterpWeightsQ3Dfl(v1, v2, v3, v4, target->v2->co, w[1]); InterpWeightsQ3Dfl(v1, v2, v3, v4, target->v3->co, w[2]); if (target->v4) InterpWeightsQ3Dfl(v1, v2, v3, v4, target->v4->co, w[3]); - + CustomData_em_interp(&em->fdata, &source->data, NULL, (float*)w, 1, target->data); } @@ -1476,17 +1478,17 @@ static void fill_quad_single(EditMesh *em, EditFace *efa, struct GHash *gh, int EditEdge *cedge=NULL; EditVert *v[4], **verts; EditFace *hold; - short start=0, end, left, right, vertsize,i; - + short start=0, end, left, right, vertsize,i; + v[0] = efa->v1; v[1] = efa->v2; v[2] = efa->v3; - v[3] = efa->v4; + v[3] = efa->v4; if(efa->e1->f & SELECT) { cedge = efa->e1; start = 0;} - else if(efa->e2->f & SELECT) { cedge = efa->e2; start = 1;} - else if(efa->e3->f & SELECT) { cedge = efa->e3; start = 2;} - else if(efa->e4->f & SELECT) { cedge = efa->e4; start = 3;} + else if(efa->e2->f & SELECT) { cedge = efa->e2; start = 1;} + else if(efa->e3->f & SELECT) { cedge = efa->e3; start = 2;} + else if(efa->e4->f & SELECT) { cedge = efa->e4; start = 3;} // Point verts to the array of new verts for cedge verts = BLI_ghash_lookup(gh, cedge); @@ -1500,30 +1502,30 @@ static void fill_quad_single(EditMesh *em, EditFace *efa, struct GHash *gh, int if(verts[0] != v[start]) {flipvertarray(verts,numcuts+2);} end = (start+1)%4; left = (start+2)%4; - right = (start+3)%4; - + right = (start+3)%4; + /* We should have something like this now - end start - 3 2 1 0 + end start + 3 2 1 0 |---*---*---| | | - | | | | - ------------- + | | + ------------- left right where start,end,left, right are indexes of EditFace->v1, etc (stored in v) and 0,1,2... are the indexes of the new verts stored in verts We will fill this case like this or this depending on even or odd cuts - + |---*---*---| |---*---| | / \ | | / \ | - | / \ | | / \ | + | / \ | | / \ | |/ \| |/ \| - ------------- --------- + ------------- --------- */ // Make center face @@ -1532,7 +1534,7 @@ static void fill_quad_single(EditMesh *em, EditFace *efa, struct GHash *gh, int hold->e2->f2 |= EDGEINNER; hold->e4->f2 |= EDGEINNER; }else{ - hold = addfacelist(em, verts[(vertsize-1)/2],v[left],v[right],NULL, NULL,NULL); + hold = addfacelist(em, verts[(vertsize-1)/2],v[left],v[right],NULL, NULL,NULL); hold->e1->f2 |= EDGEINNER; hold->e3->f2 |= EDGEINNER; } @@ -1540,21 +1542,21 @@ static void fill_quad_single(EditMesh *em, EditFace *efa, struct GHash *gh, int // Make side faces for(i=0;i<(vertsize-1)/2;i++) { - hold = addfacelist(em, verts[i],verts[i+1],v[right],NULL,NULL,NULL); + hold = addfacelist(em, verts[i],verts[i+1],v[right],NULL,NULL,NULL); facecopy(em, efa,hold); if(i+1 != (vertsize-1)/2) { if(seltype == SUBDIV_SELECT_INNER) { hold->e2->f2 |= EDGEINNER; } } - hold = addfacelist(em, verts[vertsize-2-i],verts[vertsize-1-i],v[left],NULL,NULL,NULL); + hold = addfacelist(em, verts[vertsize-2-i],verts[vertsize-1-i],v[left],NULL,NULL,NULL); facecopy(em, efa,hold); if(i+1 != (vertsize-1)/2) { if(seltype == SUBDIV_SELECT_INNER) { hold->e3->f2 |= EDGEINNER; } } - } + } } static void fill_tri_single(EditMesh *em, EditFace *efa, struct GHash *gh, int numcuts, int seltype) @@ -1562,15 +1564,15 @@ static void fill_tri_single(EditMesh *em, EditFace *efa, struct GHash *gh, int n EditEdge *cedge=NULL; EditVert *v[3], **verts; EditFace *hold; - short start=0, end, op, vertsize,i; - + short start=0, end, op, vertsize,i; + v[0] = efa->v1; v[1] = efa->v2; - v[2] = efa->v3; + v[2] = efa->v3; if(efa->e1->f & SELECT) { cedge = efa->e1; start = 0;} - else if(efa->e2->f & SELECT) { cedge = efa->e2; start = 1;} - else if(efa->e3->f & SELECT) { cedge = efa->e3; start = 2;} + else if(efa->e2->f & SELECT) { cedge = efa->e2; start = 1;} + else if(efa->e3->f & SELECT) { cedge = efa->e3; start = 2;} // Point verts to the array of new verts for cedge verts = BLI_ghash_lookup(gh, cedge); @@ -1584,30 +1586,30 @@ static void fill_tri_single(EditMesh *em, EditFace *efa, struct GHash *gh, int n if(verts[0] != v[start]) {flipvertarray(verts,numcuts+2);} end = (start+1)%3; op = (start+2)%3; - + /* We should have something like this now - end start - 3 2 1 0 + end start + 3 2 1 0 |---*---*---| \ | - \ | + \ | \ | \ | \ | \ | |op - + where start,end,op are indexes of EditFace->v1, etc (stored in v) and 0,1,2... are the indexes of the new verts stored in verts We will fill this case like this or this depending on even or odd cuts - - 3 2 1 0 + + 3 2 1 0 |---*---*---| \ \ \ | - \ \ \ | + \ \ \ | \ \ \ | \ \ \| \ \\| @@ -1617,14 +1619,14 @@ static void fill_tri_single(EditMesh *em, EditFace *efa, struct GHash *gh, int n // Make side faces for(i=0;i<(vertsize-1);i++) { - hold = addfacelist(em, verts[i],verts[i+1],v[op],NULL,NULL,NULL); + hold = addfacelist(em, verts[i],verts[i+1],v[op],NULL,NULL,NULL); if(i+1 != vertsize-1) { if(seltype == SUBDIV_SELECT_INNER) { hold->e2->f2 |= EDGEINNER; } } facecopy(em, efa,hold); - } + } } static void fill_quad_double_op(EditMesh *em, EditFace *efa, struct GHash *gh, int numcuts) @@ -1633,11 +1635,11 @@ static void fill_quad_double_op(EditMesh *em, EditFace *efa, struct GHash *gh, i EditVert *v[4], **verts[2]; EditFace *hold; short start=0, end, left, right, vertsize,i; - + v[0] = efa->v1; v[1] = efa->v2; v[2] = efa->v3; - v[3] = efa->v4; + v[3] = efa->v4; if(efa->e1->f & SELECT) { cedge[0] = efa->e1; cedge[1] = efa->e3; start = 0;} else if(efa->e2->f & SELECT) { cedge[0] = efa->e2; cedge[1] = efa->e4; start = 1;} @@ -1655,39 +1657,39 @@ static void fill_quad_double_op(EditMesh *em, EditFace *efa, struct GHash *gh, i if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);} end = (start+1)%4; left = (start+2)%4; - right = (start+3)%4; - if(verts[1][0] != v[left]) {flipvertarray(verts[1],numcuts+2);} + right = (start+3)%4; + if(verts[1][0] != v[left]) {flipvertarray(verts[1],numcuts+2);} /* We should have something like this now - end start - 3 2 1 0 + end start + 3 2 1 0 |---*---*---| | | - | | | | - |---*---*---| + | | + |---*---*---| 0 1 2 3 left right We will fill this case like this or this depending on even or odd cuts - + |---*---*---| | | | | - | | | | | | | | - |---*---*---| + | | | | + |---*---*---| */ - + // Make side faces for(i=0;ie2->f2 |= EDGEINNER; hold->e2->f2 |= DOUBLEOPFILL; } facecopy(em, efa,hold); - } + } } static void fill_quad_double_adj_path(EditMesh *em, EditFace *efa, struct GHash *gh, int numcuts) @@ -1697,11 +1699,11 @@ static void fill_quad_double_adj_path(EditMesh *em, EditFace *efa, struct GHash EditFace *hold; short start=0, start2=0, vertsize,i; int ctrl= 0; // XXX - + v[0] = efa->v1; v[1] = efa->v2; v[2] = efa->v3; - v[3] = efa->v4; + v[3] = efa->v4; if(efa->e1->f & SELECT && efa->e2->f & SELECT) {cedge[0] = efa->e1; cedge[1] = efa->e2; start = 0; start2 = 1;} if(efa->e2->f & SELECT && efa->e3->f & SELECT) {cedge[0] = efa->e2; cedge[1] = efa->e3; start = 1; start2 = 2;} @@ -1719,53 +1721,53 @@ static void fill_quad_double_adj_path(EditMesh *em, EditFace *efa, struct GHash // the array to the correct direction if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);} - if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);} + if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);} /* We should have something like this now - end start - 3 2 1 0 + end start + 3 2 1 0 start2 0|---*---*---| | | 1* | | | - 2* | + 2* | | | - end2 3|-----------| + end2 3|-----------| We will fill this case like this or this depending on even or odd cuts |---*---*---| | / / / | * / / | | / / | - * / | + * / | | / | - |-----------| + |-----------| */ // Make outside tris - hold = addfacelist(em, verts[0][vertsize-2],verts[0][vertsize-1],verts[1][1],NULL,NULL,NULL); + hold = addfacelist(em, verts[0][vertsize-2],verts[0][vertsize-1],verts[1][1],NULL,NULL,NULL); /* when ctrl is depressed, only want verts on the cutline selected */ if (ctrl) hold->e3->f2 |= EDGEINNER; - facecopy(em, efa,hold); + facecopy(em, efa,hold); hold = addfacelist(em, verts[0][0],verts[1][vertsize-1],v[(start2+2)%4],NULL,NULL,NULL); /* when ctrl is depressed, only want verts on the cutline selected */ if (ctrl) - hold->e1->f2 |= EDGEINNER; - facecopy(em, efa,hold); + hold->e1->f2 |= EDGEINNER; + facecopy(em, efa,hold); //if(scene->toolsettings->editbutflag & B_AUTOFGON) { // hold->e1->h |= EM_FGON; - //} + //} // Make side faces for(i=0;ie2->f2 |= EDGEINNER; facecopy(em, efa,hold); } //EM_fgon_flags(em); - + } static void fill_quad_double_adj_fan(EditMesh *em, EditFace *efa, struct GHash *gh, int numcuts) @@ -1774,18 +1776,18 @@ static void fill_quad_double_adj_fan(EditMesh *em, EditFace *efa, struct GHash * EditVert *v[4], *op=NULL, **verts[2]; EditFace *hold; short start=0, start2=0, vertsize,i; - + v[0] = efa->v1; v[1] = efa->v2; v[2] = efa->v3; - v[3] = efa->v4; + v[3] = efa->v4; if(efa->e1->f & SELECT && efa->e2->f & SELECT) {cedge[0] = efa->e1; cedge[1] = efa->e2; start = 0; start2 = 1; op = efa->v4;} if(efa->e2->f & SELECT && efa->e3->f & SELECT) {cedge[0] = efa->e2; cedge[1] = efa->e3; start = 1; start2 = 2; op = efa->v1;} if(efa->e3->f & SELECT && efa->e4->f & SELECT) {cedge[0] = efa->e3; cedge[1] = efa->e4; start = 2; start2 = 3; op = efa->v2;} if(efa->e4->f & SELECT && efa->e1->f & SELECT) {cedge[0] = efa->e4; cedge[1] = efa->e1; start = 3; start2 = 0; op = efa->v3;} - + // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1] verts[0] = BLI_ghash_lookup(gh, cedge[0]); verts[1] = BLI_ghash_lookup(gh, cedge[1]); @@ -1797,39 +1799,39 @@ static void fill_quad_double_adj_fan(EditMesh *em, EditFace *efa, struct GHash * // the array to the correct direction if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);} - if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);} + if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);} /* We should have something like this now - end start - 3 2 1 0 + end start + 3 2 1 0 start2 0|---*---*---| | | 1* | | | - 2* | + 2* | | | - end2 3|-----------|op + end2 3|-----------|op We will fill this case like this or this (warning horrible ascii art follows) |---*---*---| | \ \ \ | *---\ \ \ | | \ \ \ \| - *---- \ \ \ | + *---- \ \ \ | | --- \\\| - |-----------| + |-----------| */ for(i=0;i<=numcuts;i++) { - hold = addfacelist(em, op,verts[1][numcuts-i],verts[1][numcuts-i+1],NULL,NULL,NULL); + hold = addfacelist(em, op,verts[1][numcuts-i],verts[1][numcuts-i+1],NULL,NULL,NULL); hold->e1->f2 |= EDGEINNER; facecopy(em, efa,hold); - hold = addfacelist(em, op,verts[0][i],verts[0][i+1],NULL,NULL,NULL); + hold = addfacelist(em, op,verts[0][i],verts[0][i+1],NULL,NULL,NULL); hold->e3->f2 |= EDGEINNER; facecopy(em, efa,hold); - } + } } static void fill_quad_double_adj_inner(EditMesh *em, EditFace *efa, struct GHash *gh, int numcuts) @@ -1839,18 +1841,18 @@ static void fill_quad_double_adj_inner(EditMesh *em, EditFace *efa, struct GHash EditFace *hold; short start=0, start2=0, vertsize,i; float co[3]; - + v[0] = efa->v1; v[1] = efa->v2; v[2] = efa->v3; - v[3] = efa->v4; + v[3] = efa->v4; if(efa->e1->f & SELECT && efa->e2->f & SELECT) {cedge[0] = efa->e1; cedge[1] = efa->e2; start = 0; start2 = 1; op = efa->v4;} if(efa->e2->f & SELECT && efa->e3->f & SELECT) {cedge[0] = efa->e2; cedge[1] = efa->e3; start = 1; start2 = 2; op = efa->v1;} if(efa->e3->f & SELECT && efa->e4->f & SELECT) {cedge[0] = efa->e3; cedge[1] = efa->e4; start = 2; start2 = 3; op = efa->v2;} if(efa->e4->f & SELECT && efa->e1->f & SELECT) {cedge[0] = efa->e4; cedge[1] = efa->e1; start = 3; start2 = 0; op = efa->v3;} - + // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1] verts[0] = BLI_ghash_lookup(gh, cedge[0]); verts[1] = BLI_ghash_lookup(gh, cedge[1]); @@ -1862,19 +1864,19 @@ static void fill_quad_double_adj_inner(EditMesh *em, EditFace *efa, struct GHash // the array to the correct direction if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);} - if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);} + if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);} /* We should have something like this now - end start - 3 2 1 0 + end start + 3 2 1 0 start2 0|---*---*---| | | 1* | | | - 2* | + 2* | | | - end2 3|-----------|op + end2 3|-----------|op We will fill this case like this or this (warning horrible ascii art follows) |---*-----*---| @@ -1882,14 +1884,14 @@ static void fill_quad_double_adj_inner(EditMesh *em, EditFace *efa, struct GHash * \ / | | * | | / \ | - * \ | + * \ | | \ | - |-------------| + |-------------| */ // Add Inner Vert(s) inner = MEM_mallocN(sizeof(EditVert*)*numcuts,"New inner verts"); - + for(i=0;ico[0] + verts[1][i+1]->co[0] ) / 2 ; co[1] = (verts[0][numcuts-i]->co[1] + verts[1][i+1]->co[1] ) / 2 ; @@ -1899,45 +1901,45 @@ static void fill_quad_double_adj_inner(EditMesh *em, EditFace *efa, struct GHash EM_data_interp_from_verts(em, verts[0][numcuts-i], verts[1][i+1], inner[i], 0.5f); } - + // Add Corner Quad - hold = addfacelist(em, verts[0][numcuts+1],verts[1][1],inner[0],verts[0][numcuts],NULL,NULL); + hold = addfacelist(em, verts[0][numcuts+1],verts[1][1],inner[0],verts[0][numcuts],NULL,NULL); hold->e2->f2 |= EDGEINNER; hold->e3->f2 |= EDGEINNER; - facecopy(em, efa,hold); + facecopy(em, efa,hold); // Add Bottom Quads - hold = addfacelist(em, verts[0][0],verts[0][1],inner[numcuts-1],op,NULL,NULL); + hold = addfacelist(em, verts[0][0],verts[0][1],inner[numcuts-1],op,NULL,NULL); hold->e2->f2 |= EDGEINNER; - facecopy(em, efa,hold); + facecopy(em, efa,hold); - hold = addfacelist(em, op,inner[numcuts-1],verts[1][numcuts],verts[1][numcuts+1],NULL,NULL); + hold = addfacelist(em, op,inner[numcuts-1],verts[1][numcuts],verts[1][numcuts+1],NULL,NULL); hold->e2->f2 |= EDGEINNER; - facecopy(em, efa,hold); - + facecopy(em, efa,hold); + //if(scene->toolsettings->editbutflag & B_AUTOFGON) { // hold->e1->h |= EM_FGON; - //} + //} // Add Fill Quads (if # cuts > 1) for(i=0;ie1->f2 |= EDGEINNER; hold->e3->f2 |= EDGEINNER; facecopy(em, efa,hold); - hold = addfacelist(em, inner[i],inner[i+1],verts[0][numcuts-1-i],verts[0][numcuts-i],NULL,NULL); + hold = addfacelist(em, inner[i],inner[i+1],verts[0][numcuts-1-i],verts[0][numcuts-i],NULL,NULL); hold->e2->f2 |= EDGEINNER; hold->e4->f2 |= EDGEINNER; - facecopy(em, efa,hold); - + facecopy(em, efa,hold); + //if(scene->toolsettings->editbutflag & B_AUTOFGON) { // hold->e1->h |= EM_FGON; - //} - } - + //} + } + //EM_fgon_flags(em); - - MEM_freeN(inner); + + MEM_freeN(inner); } static void fill_tri_double(EditMesh *em, EditFace *efa, struct GHash *gh, int numcuts) @@ -1946,7 +1948,7 @@ static void fill_tri_double(EditMesh *em, EditFace *efa, struct GHash *gh, int n EditVert *v[3], **verts[2]; EditFace *hold; short start=0, start2=0, vertsize,i; - + v[0] = efa->v1; v[1] = efa->v2; v[2] = efa->v3; @@ -1966,41 +1968,41 @@ static void fill_tri_double(EditMesh *em, EditFace *efa, struct GHash *gh, int n // the array to the correct direction if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);} - if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);} + if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);} /* We should have something like this now - end start - 3 2 1 0 + end start + 3 2 1 0 start2 0|---*---*---| - | / - 1* / - | / - 2* / - | / - end2 3| + | / + 1* / + | / + 2* / + | / + end2 3| We will fill this case like this or this depending on even or odd cuts |---*---*---| - | / / / - * / / - | / / - * / - | / + | / / / + * / / + | / / + * / + | / | */ // Make outside tri - hold = addfacelist(em, verts[0][vertsize-2],verts[0][vertsize-1],verts[1][1],NULL,NULL,NULL); + hold = addfacelist(em, verts[0][vertsize-2],verts[0][vertsize-1],verts[1][1],NULL,NULL,NULL); hold->e3->f2 |= EDGEINNER; - facecopy(em, efa,hold); + facecopy(em, efa,hold); // Make side faces for(i=0;ie2->f2 |= EDGEINNER; facecopy(em, efa,hold); - } + } } static void fill_quad_triple(EditMesh *em, EditFace *efa, struct GHash *gh, int numcuts) @@ -2009,133 +2011,133 @@ static void fill_quad_triple(EditMesh *em, EditFace *efa, struct GHash *gh, int EditVert *v[4], **verts[3]; EditFace *hold; short start=0, start2=0, start3=0, vertsize, i, repeats; - + v[0] = efa->v1; v[1] = efa->v2; v[2] = efa->v3; - v[3] = efa->v4; - + v[3] = efa->v4; + if(!(efa->e1->f & SELECT)) { - cedge[0] = efa->e2; - cedge[1] = efa->e3; + cedge[0] = efa->e2; + cedge[1] = efa->e3; cedge[2] = efa->e4; - start = 1;start2 = 2;start3 = 3; + start = 1;start2 = 2;start3 = 3; } if(!(efa->e2->f & SELECT)) { - cedge[0] = efa->e3; - cedge[1] = efa->e4; + cedge[0] = efa->e3; + cedge[1] = efa->e4; cedge[2] = efa->e1; - start = 2;start2 = 3;start3 = 0; + start = 2;start2 = 3;start3 = 0; } if(!(efa->e3->f & SELECT)) { - cedge[0] = efa->e4; - cedge[1] = efa->e1; + cedge[0] = efa->e4; + cedge[1] = efa->e1; cedge[2] = efa->e2; - start = 3;start2 = 0;start3 = 1; + start = 3;start2 = 0;start3 = 1; } if(!(efa->e4->f & SELECT)) { - cedge[0] = efa->e1; - cedge[1] = efa->e2; + cedge[0] = efa->e1; + cedge[1] = efa->e2; cedge[2] = efa->e3; - start = 0;start2 = 1;start3 = 2; - } + start = 0;start2 = 1;start3 = 2; + } // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1] verts[0] = BLI_ghash_lookup(gh, cedge[0]); verts[1] = BLI_ghash_lookup(gh, cedge[1]); verts[2] = BLI_ghash_lookup(gh, cedge[2]); //This is the index size of the verts array vertsize = numcuts+2; - + // Is the original v1 the same as the first vert on the selected edge? // if not, the edge is running the opposite direction in this face so flip // the array to the correct direction - + if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);} - if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);} - if(verts[2][0] != v[start3]) {flipvertarray(verts[2],numcuts+2);} + if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);} + if(verts[2][0] != v[start3]) {flipvertarray(verts[2],numcuts+2);} /* We should have something like this now - - start2 - 3 2 1 0 - start3 0|---*---*---|3 + + start2 + 3 2 1 0 + start3 0|---*---*---|3 | | 1* *2 | | - 2* *1 + 2* *1 | | - 3|-----------|0 start - - We will fill this case like this or this depending on even or odd cuts + 3|-----------|0 start + + We will fill this case like this or this depending on even or odd cuts there are a couple of differences. For odd cuts, there is a tri in the middle as well as 1 quad at the bottom (not including the extra quads - for odd cuts > 1 - + for odd cuts > 1 + For even cuts, there is a quad in the middle and 2 quads on the bottom - + they are numbered here for clarity - + 1 outer tris and bottom quads 2 inner tri or quad 3 repeating quads - + |---*---*---*---| |1/ / \ \ 1| |/ 3 / \ 3 \| * / 2 \ * | / \ | - |/ \ | + |/ \ | *---------------* | 3 | - | | + | | *---------------* | | - | 1 | + | 1 | | | |---------------| - + |---*---*---*---*---| - | 1/ / \ \ 1| - | / / \ \ | + | 1/ / \ \ 1| + | / / \ \ | |/ 3 / \ 3 \| * / \ * - | / \ | - | / 2 \ | + | / \ | + | / 2 \ | |/ \| *-------------------* | | | 3 | - | | + | | *-------------------* | | | 1 | - | | + | | *-------------------* | | | 1 | - | | + | | |-------------------| - + */ // Make outside tris - hold = addfacelist(em, verts[0][vertsize-2],verts[0][vertsize-1],verts[1][1],NULL,NULL,NULL); + hold = addfacelist(em, verts[0][vertsize-2],verts[0][vertsize-1],verts[1][1],NULL,NULL,NULL); hold->e3->f2 |= EDGEINNER; - facecopy(em, efa,hold); - hold = addfacelist(em, verts[1][vertsize-2],verts[1][vertsize-1],verts[2][1],NULL,NULL,NULL); + facecopy(em, efa,hold); + hold = addfacelist(em, verts[1][vertsize-2],verts[1][vertsize-1],verts[2][1],NULL,NULL,NULL); hold->e3->f2 |= EDGEINNER; - facecopy(em, efa,hold); + facecopy(em, efa,hold); // Make bottom quad - hold = addfacelist(em, verts[0][0],verts[0][1],verts[2][vertsize-2],verts[2][vertsize-1],NULL,NULL); + hold = addfacelist(em, verts[0][0],verts[0][1],verts[2][vertsize-2],verts[2][vertsize-1],NULL,NULL); hold->e2->f2 |= EDGEINNER; - facecopy(em, efa,hold); + facecopy(em, efa,hold); //If it is even cuts, add the 2nd lower quad if(numcuts % 2 == 0) { - hold = addfacelist(em, verts[0][1],verts[0][2],verts[2][vertsize-3],verts[2][vertsize-2],NULL,NULL); + hold = addfacelist(em, verts[0][1],verts[0][2],verts[2][vertsize-3],verts[2][vertsize-2],NULL,NULL); hold->e2->f2 |= EDGEINNER; - facecopy(em, efa,hold); + facecopy(em, efa,hold); // Also Make inner quad - hold = addfacelist(em, verts[1][numcuts/2],verts[1][(numcuts/2)+1],verts[2][numcuts/2],verts[0][(numcuts/2)+1],NULL,NULL); + hold = addfacelist(em, verts[1][numcuts/2],verts[1][(numcuts/2)+1],verts[2][numcuts/2],verts[0][(numcuts/2)+1],NULL,NULL); hold->e3->f2 |= EDGEINNER; //if(scene->toolsettings->editbutflag & B_AUTOFGON) { // hold->e3->h |= EM_FGON; @@ -2143,47 +2145,47 @@ static void fill_quad_triple(EditMesh *em, EditFace *efa, struct GHash *gh, int facecopy(em, efa,hold); repeats = (numcuts / 2) -1; } else { - // Make inner tri - hold = addfacelist(em, verts[1][(numcuts/2)+1],verts[2][(numcuts/2)+1],verts[0][(numcuts/2)+1],NULL,NULL,NULL); + // Make inner tri + hold = addfacelist(em, verts[1][(numcuts/2)+1],verts[2][(numcuts/2)+1],verts[0][(numcuts/2)+1],NULL,NULL,NULL); hold->e2->f2 |= EDGEINNER; //if(scene->toolsettings->editbutflag & B_AUTOFGON) { // hold->e2->h |= EM_FGON; //} - facecopy(em, efa,hold); + facecopy(em, efa,hold); repeats = ((numcuts+1) / 2)-1; } - + // cuts for 1 and 2 do not have the repeating quads if(numcuts < 3) {repeats = 0;} for(i=0;ie2->f2 |= EDGEINNER; - facecopy(em, efa,hold); - hold = addfacelist(em, verts[1][vertsize-i-3],verts[1][vertsize-i-2],verts[2][i+1],verts[2][i+2],NULL,NULL); + hold = addfacelist(em, verts[1][i+1],verts[1][i+2],verts[0][vertsize-i-3],verts[0][vertsize-i-2],NULL,NULL); + hold->e2->f2 |= EDGEINNER; + facecopy(em, efa,hold); + hold = addfacelist(em, verts[1][vertsize-i-3],verts[1][vertsize-i-2],verts[2][i+1],verts[2][i+2],NULL,NULL); hold->e4->f2 |= EDGEINNER; - facecopy(em, efa,hold); + facecopy(em, efa,hold); } - // Do repeating bottom quads + // Do repeating bottom quads for(i=0;ie2->f2 |= EDGEINNER; - facecopy(em, efa,hold); - } + facecopy(em, efa,hold); + } //EM_fgon_flags(em); } static void fill_quad_quadruple(EditMesh *em, EditFace *efa, struct GHash *gh, int numcuts, float smooth, float fractal, int beauty) { EditVert **verts[4], ***innerverts; - EditFace *hold; + EditFace *hold; EditEdge temp; short vertsize, i, j; - + // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1] verts[0] = BLI_ghash_lookup(gh, efa->e1); verts[1] = BLI_ghash_lookup(gh, efa->e2); @@ -2198,79 +2200,79 @@ static void fill_quad_quadruple(EditMesh *em, EditFace *efa, struct GHash *gh, i // the array to the correct direction if(verts[0][0] != efa->v1) {flipvertarray(verts[0],numcuts+2);} - if(verts[1][0] != efa->v2) {flipvertarray(verts[1],numcuts+2);} + if(verts[1][0] != efa->v2) {flipvertarray(verts[1],numcuts+2);} if(verts[2][0] == efa->v3) {flipvertarray(verts[2],numcuts+2);} - if(verts[3][0] == efa->v4) {flipvertarray(verts[3],numcuts+2);} + if(verts[3][0] == efa->v4) {flipvertarray(verts[3],numcuts+2);} /* We should have something like this now 1 - - 3 2 1 0 - 0|---*---*---|0 + + 3 2 1 0 + 0|---*---*---|0 | | 1* *1 2 | | 4 - 2* *2 + 2* *2 | | - 3|---*---*---|3 + 3|---*---*---|3 3 2 1 0 3 // we will fill a 2 dim array of editvert*s to make filling easier // the innervert order is shown - 0 0---1---2---3 + 0 0---1---2---3 | | | | - 1 0---1---2---3 + 1 0---1---2---3 | | | | - 2 0---1---2---3 + 2 0---1---2---3 | | | | - 3 0---1---2---3 - + 3 0---1---2---3 + */ - innerverts = MEM_mallocN(sizeof(EditVert*)*(numcuts+2),"quad-quad subdiv inner verts outer array"); + innerverts = MEM_mallocN(sizeof(EditVert*)*(numcuts+2),"quad-quad subdiv inner verts outer array"); for(i=0;ie1->f2 = EDGENEW; - hold->e2->f2 = EDGENEW; - hold->e3->f2 = EDGENEW; - hold->e4->f2 = EDGENEW; - + hold = addfacelist(em, innerverts[i][j+1],innerverts[i][j],innerverts[i+1][j],innerverts[i+1][j+1],NULL,NULL); + hold->e1->f2 = EDGENEW; + hold->e2->f2 = EDGENEW; + hold->e3->f2 = EDGENEW; + hold->e4->f2 = EDGENEW; + if(i != 0) { hold->e1->f2 |= EDGEINNER; } if(j != 0) { hold->e2->f2 |= EDGEINNER; } if(i != numcuts) { hold->e3->f2 |= EDGEINNER; } if(j != numcuts) { hold->e4->f2 |= EDGEINNER; } - - facecopy(em, efa,hold); - } + + facecopy(em, efa,hold); + } } // Clean up our dynamic multi-dim array for(i=0;iv1) {flipvertarray(verts[0],numcuts+2);} - if(verts[1][0] != efa->v2) {flipvertarray(verts[1],numcuts+2);} - if(verts[2][0] != efa->v3) {flipvertarray(verts[2],numcuts+2);} + if(verts[1][0] != efa->v2) {flipvertarray(verts[1],numcuts+2);} + if(verts[2][0] != efa->v3) {flipvertarray(verts[2],numcuts+2);} /* We should have something like this now 3 - - 3 2 1 0 - 0|---*---*---|3 - | / - 1 1* *2 - | / - 2* *1 2 - | / - 3|/ + + 3 2 1 0 + 0|---*---*---|3 + | / + 1 1* *2 + | / + 2* *1 2 + | / + 3|/ 0 we will fill a 2 dim array of editvert*s to make filling easier @@ -2315,33 +2317,33 @@ static void fill_tri_triple(EditMesh *em, EditFace *efa, struct GHash *gh, int n 3 0 0---1---2---3---4 - | / | / |/ | / - 1 0---1----2---3 - 1 | / | / | / + | / | / |/ | / + 1 0---1----2---3 + 1 | / | / | / 2 0----1---2 2 - | / | / - |/ |/ - 3 0---1 + | / | / + |/ |/ + 3 0---1 | / |/ - 4 0 - + 4 0 + */ - - innerverts = MEM_mallocN(sizeof(EditVert*)*(numcuts+2),"tri-tri subdiv inner verts outer array"); + + innerverts = MEM_mallocN(sizeof(EditVert*)*(numcuts+2),"tri-tri subdiv inner verts outer array"); for(i=0;ie1->f2 |= EDGENEW; - hold->e2->f2 |= EDGENEW; - hold->e3->f2 |= EDGENEW; + hold = addfacelist(em, innerverts[i][j+1],innerverts[i][j],innerverts[i+1][j],NULL,NULL,NULL); + hold->e1->f2 |= EDGENEW; + hold->e2->f2 |= EDGENEW; + hold->e3->f2 |= EDGENEW; if(i != 0) { hold->e1->f2 |= EDGEINNER; } if(j != 0) { hold->e2->f2 |= EDGEINNER; } if(j+1 != (numcuts+1)-i) {hold->e3->f2 |= EDGEINNER;} - - facecopy(em, efa,hold); - //if there are more to come, we do the 2nd + + facecopy(em, efa,hold); + //if there are more to come, we do the 2nd if(j+1 <= numcuts-i) { - hold = addfacelist(em, innerverts[i+1][j],innerverts[i+1][j+1],innerverts[i][j+1],NULL,NULL,NULL); - facecopy(em, efa,hold); - hold->e1->f2 |= EDGENEW; - hold->e2->f2 |= EDGENEW; - hold->e3->f2 |= EDGENEW; + hold = addfacelist(em, innerverts[i+1][j],innerverts[i+1][j+1],innerverts[i][j+1],NULL,NULL,NULL); + facecopy(em, efa,hold); + hold->e1->f2 |= EDGENEW; + hold->e2->f2 |= EDGENEW; + hold->e3->f2 |= EDGENEW; } - } + } } // Clean up our dynamic multi-dim array for(i=0;iv1, efa->v2, efa->v3, 0, efa, NULL); hold->e1->f2 |= EDGENEW; @@ -2402,7 +2404,7 @@ static void fill_quad_doublevert(EditMesh *em, EditFace *efa, int v1, int v2) hold->e3->f2 |= EDGENEW; hold->e3->f2 |= EDGEINNER; facecopy(em, efa, hold); - + hold= addfacelist(em, efa->v1, efa->v3, efa->v4, 0, efa, NULL); hold->e1->f2 |= EDGENEW; hold->e2->f2 |= EDGENEW; @@ -2417,7 +2419,7 @@ static void fill_quad_doublevert(EditMesh *em, EditFace *efa, int v1, int v2) hold->e3->f2 |= EDGENEW; hold->e2->f2 |= EDGEINNER; facecopy(em, efa, hold); - + hold= addfacelist(em, efa->v2, efa->v3, efa->v4, 0, efa, NULL); hold->e1->f2 |= EDGENEW; hold->e2->f2 |= EDGENEW; @@ -2432,17 +2434,17 @@ static void fill_quad_singlevert(EditMesh *em, EditFace *efa, struct GHash *gh) EditEdge *cedge=NULL; EditVert *v[4], **verts; EditFace *hold; - short start=0, end, left, right, vertsize; - + short start=0, end, left, right, vertsize; + v[0] = efa->v1; v[1] = efa->v2; v[2] = efa->v3; - v[3] = efa->v4; + v[3] = efa->v4; if(efa->e1->f & SELECT) { cedge = efa->e1; start = 0;} - else if(efa->e2->f & SELECT) { cedge = efa->e2; start = 1;} - else if(efa->e3->f & SELECT) { cedge = efa->e3; start = 2;} - else if(efa->e4->f & SELECT) { cedge = efa->e4; start = 3;} + else if(efa->e2->f & SELECT) { cedge = efa->e2; start = 1;} + else if(efa->e3->f & SELECT) { cedge = efa->e3; start = 2;} + else if(efa->e4->f & SELECT) { cedge = efa->e4; start = 3;} // Point verts to the array of new verts for cedge verts = BLI_ghash_lookup(gh, cedge); @@ -2456,25 +2458,25 @@ static void fill_quad_singlevert(EditMesh *em, EditFace *efa, struct GHash *gh) if(verts[0] != v[start]) {flipvertarray(verts,3);} end = (start+1)%4; left = (start+2)%4; - right = (start+3)%4; + right = (start+3)%4; /* We should have something like this now - end start - 2 1 0 + end start + 2 1 0 |-----*-----| | | - | | | | - ------------- + | | + ------------- left right where start,end,left, right are indexes of EditFace->v1, etc (stored in v) and 0,1,2 are the indexes of the new verts stored in verts. We fill like this, depending on whether its vertex 'left' or vertex 'right' thats been knifed through... - + |---*---| |---*---| | / | | \ | | / | | \ | @@ -2490,7 +2492,7 @@ static void fill_quad_singlevert(EditMesh *em, EditFace *efa, struct GHash *gh) hold->e3->f2 |= EDGENEW; hold->e3->f2 |= EDGEINNER; facecopy(em, efa, hold); - + //quad is composed of cutvert, left, right and start hold = addfacelist(em, verts[1],v[left],v[right],v[start], NULL, NULL); hold->e1->f2 |= EDGENEW; @@ -2517,17 +2519,17 @@ static void fill_quad_singlevert(EditMesh *em, EditFace *efa, struct GHash *gh) hold->e4->f2 |= EDGEINNER; facecopy(em, efa, hold); } - -} -// This function takes an example edge, the current point to create and +} + +// This function takes an example edge, the current point to create and // the total # of points to create, then creates the point and return the // editvert pointer to it. static EditVert *subdivideedgenum(EditMesh *em, EditEdge *edge, int curpoint, int totpoint, float smooth, float fractal, int beauty) { EditVert *ev; float percent; - + if (beauty & (B_PERCENTSUBD) && totpoint == 1) //percent=(float)(edge->tmp.l)/32768.0f; percent= edge->tmp.fp; @@ -2536,7 +2538,7 @@ static EditVert *subdivideedgenum(EditMesh *em, EditEdge *edge, int curpoint, in ev= subdivide_edge_addvert(em, edge, smooth, fractal, beauty, percent); ev->f = edge->v1->f; - + return ev; } @@ -2550,7 +2552,7 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float int i, j, edgecount, touchcount, facetype,hold; ModifierData *md= obedit->modifiers.first; int ctrl= 0; // XXX - + //Set faces f1 to 0 cause we need it later for(ef=em->faces.first;ef;ef = ef->next) ef->f1 = 0; for(eve=em->verts.first; eve; eve=eve->next) { @@ -2561,8 +2563,8 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float for (; md; md=md->next) { if (md->type==eModifierType_Mirror) { - MirrorModifierData *mmd = (MirrorModifierData*) md; - + MirrorModifierData *mmd = (MirrorModifierData*) md; + if(mmd->flag & MOD_MIR_CLIPPING) { for (eve= em->verts.first; eve; eve= eve->next) { eve->f2= 0; @@ -2584,23 +2586,23 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float } } } - + //Flush vertex flags upward to the edges for(eed = em->edges.first;eed;eed = eed->next) { //if(eed->f & flag && eed->v1->f == eed->v2->f) { - // eed->f |= eed->v1->f; + // eed->f |= eed->v1->f; // } - eed->f2 = 0; + eed->f2 = 0; if(eed->f & flag) { eed->f2 |= EDGEOLD; } } - + // We store an array of verts for each edge that is subdivided, // we put this array as a value in a ghash which is keyed by the EditEdge* // Now for beauty subdivide deselect edges based on length - if(beauty & B_BEAUTY) { + if(beauty & B_BEAUTY) { for(ef = em->faces.first;ef;ef = ef->next) { if(!ef->v4) { continue; @@ -2609,12 +2611,12 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float VECCOPY(v1mat, ef->v1->co); VECCOPY(v2mat, ef->v2->co); VECCOPY(v3mat, ef->v3->co); - VECCOPY(v4mat, ef->v4->co); + VECCOPY(v4mat, ef->v4->co); Mat4Mul3Vecfl(obedit->obmat, v1mat); - Mat4Mul3Vecfl(obedit->obmat, v2mat); + Mat4Mul3Vecfl(obedit->obmat, v2mat); Mat4Mul3Vecfl(obedit->obmat, v3mat); Mat4Mul3Vecfl(obedit->obmat, v4mat); - + length[0] = VecLenf(v1mat, v2mat); length[1] = VecLenf(v2mat, v3mat); length[2] = VecLenf(v3mat, v4mat); @@ -2623,20 +2625,20 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float sort[1] = ef->e2; sort[2] = ef->e3; sort[3] = ef->e4; - - + + // Beauty Short Edges if(beauty & B_BEAUTY_SHORT) { for(j=0;j<2;j++) { hold = -1; for(i=0;i<4;i++) { if(length[i] < 0) { - continue; - } else if(hold == -1) { - hold = i; + continue; + } else if(hold == -1) { + hold = i; } else { if(length[hold] < length[i]) { - hold = i; + hold = i; } } } @@ -2647,19 +2649,19 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float } } } - + // Beauty Long Edges else { for(j=0;j<2;j++) { hold = -1; for(i=0;i<4;i++) { if(length[i] < 0) { - continue; - } else if(hold == -1) { - hold = i; + continue; + } else if(hold == -1) { + hold = i; } else { if(length[hold] > length[i]) { - hold = i; + hold = i; } } } @@ -2674,18 +2676,18 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float } } - gh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); + gh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); // If we are knifing, We only need the selected edges that were cut, so deselect if it was not cut - if(beauty & B_KNIFE) { - for(eed= em->edges.first;eed;eed=eed->next) { + if(beauty & B_KNIFE) { + for(eed= em->edges.first;eed;eed=eed->next) { if( eed->tmp.fp == 0 ) { EM_select_edge(eed,0); } } - } + } // So for each edge, if it is selected, we allocate an array of size cuts+2 - // so we can have a place for the v1, the new verts and v2 + // so we can have a place for the v1, the new verts and v2 for(eed=em->edges.first;eed;eed = eed->next) { if(eed->f & flag) { templist = MEM_mallocN(sizeof(EditVert*)*(numcuts+2),"vertlist"); @@ -2703,9 +2705,9 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float //Do the last edge too cedge = addedgelist(em, templist[i],templist[i+1],eed); cedge->f2 = EDGENEW; - // Now that the edge is subdivided, we can put its verts in the ghash - BLI_ghash_insert(gh, eed, templist); - } + // Now that the edge is subdivided, we can put its verts in the ghash + BLI_ghash_insert(gh, eed, templist); + } } // DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); @@ -2720,7 +2722,7 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float if(ef->v4) { facetype = 4; if(ef->e4->f & flag) {edgecount++;} - } + } if(facetype == 4) { switch(edgecount) { case 0: @@ -2732,9 +2734,9 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float if(ef->v3->f1) touchcount++; if(ef->v4->f1) touchcount++; if(touchcount == 2){ - if(ef->v1->f1 && ef->v3->f1){ + if(ef->v1->f1 && ef->v3->f1){ ef->f1 = SELECT; - fill_quad_doublevert(em, ef, 1, 3); + fill_quad_doublevert(em, ef, 1, 3); } else if(ef->v2->f1 && ef->v4->f1){ ef->f1 = SELECT; @@ -2742,9 +2744,9 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float } } } - break; - - case 1: + break; + + case 1: if(beauty & B_KNIFE && numcuts == 1){ /*Test for when knifing through an edge and one vert*/ touchcount = 0; @@ -2752,14 +2754,14 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float if(ef->v2->f1) touchcount++; if(ef->v3->f1) touchcount++; if(ef->v4->f1) touchcount++; - + if(touchcount == 1){ if( (ef->e1->f & flag && ( !ef->e1->v1->f1 && !ef->e1->v2->f1 )) || (ef->e2->f & flag && ( !ef->e2->v1->f1 && !ef->e2->v2->f1 )) || (ef->e3->f & flag && ( !ef->e3->v1->f1 && !ef->e3->v2->f1 )) || (ef->e4->f & flag && ( !ef->e4->v1->f1 && !ef->e4->v2->f1 )) ){ - - ef->f1 = SELECT; + + ef->f1 = SELECT; fill_quad_singlevert(em, ef, gh); } else{ @@ -2767,64 +2769,64 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float fill_quad_single(em, ef, gh, numcuts, seltype); } } - else{ - ef->f1 = SELECT; + else{ + ef->f1 = SELECT; fill_quad_single(em, ef, gh, numcuts, seltype); } } - else{ + else{ ef->f1 = SELECT; fill_quad_single(em, ef, gh, numcuts, seltype); } - break; + break; case 2: ef->f1 = SELECT; // if there are 2, we check if edge 1 and 3 are either both on or off that way // we can tell if the selected pair is Adjacent or Opposite of each other - if((ef->e1->f & flag && ef->e3->f & flag) || + if((ef->e1->f & flag && ef->e3->f & flag) || (ef->e2->f & flag && ef->e4->f & flag)) { - fill_quad_double_op(em, ef, gh, numcuts); + fill_quad_double_op(em, ef, gh, numcuts); }else{ switch(0) { // XXX scene->toolsettings->cornertype) { case 0: fill_quad_double_adj_path(em, ef, gh, numcuts); break; case 1: fill_quad_double_adj_inner(em, ef, gh, numcuts); break; case 2: fill_quad_double_adj_fan(em, ef, gh, numcuts); break; } - + } - break; + break; case 3: ef->f1 = SELECT; - fill_quad_triple(em, ef, gh, numcuts); - break; + fill_quad_triple(em, ef, gh, numcuts); + break; case 4: ef->f1 = SELECT; - fill_quad_quadruple(em, ef, gh, numcuts, smooth, fractal, beauty); - break; + fill_quad_quadruple(em, ef, gh, numcuts, smooth, fractal, beauty); + break; } } else { switch(edgecount) { case 0: break; case 1: ef->f1 = SELECT; fill_tri_single(em, ef, gh, numcuts, seltype); - break; + break; case 2: ef->f1 = SELECT; fill_tri_double(em, ef, gh, numcuts); - break; + break; case 3: ef->f1 = SELECT; fill_tri_triple(em, ef, gh, numcuts, smooth, fractal, beauty); - break; - } - } - } - + break; + } + } + } + // Delete Old Edges and Faces for(eed = em->edges.first;eed;eed = eed->next) { if(BLI_ghash_haskey(gh,eed)) { - eed->f1 = SELECT; + eed->f1 = SELECT; } else { - eed->f1 = 0; + eed->f1 = 0; } - } - free_tagged_edges_faces(em, em->edges.first, em->faces.first); - + } + free_tagged_edges_faces(em, em->edges.first, em->faces.first); + if(seltype == SUBDIV_SELECT_ORIG && !ctrl) { /* bugfix: vertex could get flagged as "not-selected" // solution: clear flags before, not at the same time as setting SELECT flag -dg @@ -2832,7 +2834,7 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float for(eed = em->edges.first;eed;eed = eed->next) { if(!(eed->f2 & EDGENEW || eed->f2 & EDGEOLD)) { eed->f &= !flag; - EM_select_edge(eed,0); + EM_select_edge(eed,0); } } for(eed = em->edges.first;eed;eed = eed->next) { @@ -2845,14 +2847,14 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float for(eed = em->edges.first;eed;eed = eed->next) { if(eed->f2 & EDGEINNER) { eed->f |= flag; - EM_select_edge(eed,1); + EM_select_edge(eed,1); if(eed->v1->f & EDGEINNER) eed->v1->f |= SELECT; if(eed->v2->f & EDGEINNER) eed->v2->f |= SELECT; }else{ eed->f &= !flag; - EM_select_edge(eed,0); + EM_select_edge(eed,0); } - } + } } else if(seltype == SUBDIV_SELECT_LOOPCUT){ for(eed = em->edges.first;eed;eed = eed->next) { if(eed->f2 & DOUBLEOPFILL){ @@ -2863,16 +2865,16 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float EM_select_edge(eed,0); } } - } + } if(em->selectmode & SCE_SELECT_VERTEX) { for(eed = em->edges.first;eed;eed = eed->next) { if(eed->f & SELECT) { eed->v1->f |= SELECT; eed->v2->f |= SELECT; } - } + } } - + //fix hide flags for edges. First pass, hide edges of hidden faces for(ef=em->faces.first; ef; ef=ef->next){ if(ef->h){ @@ -2891,25 +2893,25 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float if(ef->e4) ef->e4->h &= ~1; } } - - // Free the ghash and call MEM_freeN on all the value entries to return + + // Free the ghash and call MEM_freeN on all the value entries to return // that memory - BLI_ghash_free(gh, NULL, (GHashValFreeFP)MEM_freeN); - + BLI_ghash_free(gh, NULL, (GHashValFreeFP)MEM_freeN); + EM_selectmode_flush(em); for(ef=em->faces.first;ef;ef = ef->next) { if(ef->e4) { if( (ef->e1->f & SELECT && ef->e2->f & SELECT) && (ef->e3->f & SELECT && ef->e4->f & SELECT) ) { - ef->f |= SELECT; - } + ef->f |= SELECT; + } } else { if( (ef->e1->f & SELECT && ef->e2->f & SELECT) && ef->e3->f & SELECT) { - ef->f |= SELECT; + ef->f |= SELECT; } } } - + recalc_editnormals(em); } @@ -2948,15 +2950,15 @@ static int collect_quadedges(EVPTuple *efaa, EditEdge *eed, EditFace *efa) i++; } else eed->tmp.p = NULL; - + eed= eed->next; } - - + + /* find edges pointing to 2 faces by procedure: - + - run through faces and their edges, increase - face counter e->f1 for each face + face counter e->f1 for each face */ while(efa) { @@ -3001,20 +3003,20 @@ static int collect_quadedges(EVPTuple *efaa, EditEdge *eed, EditFace *efa) } -/* returns vertices of two adjacent triangles forming a quad +/* returns vertices of two adjacent triangles forming a quad - can be righthand or lefthand 4-----3 |\ | | \ 2 | <- efa1 - | \ | - efa-> | 1 \ | - | \| + | \ | + efa-> | 1 \ | + | \| 1-----2 */ #define VTEST(face, num, other) \ - (face->v##num != other->v1 && face->v##num != other->v2 && face->v##num != other->v3) + (face->v##num != other->v1 && face->v##num != other->v2 && face->v##num != other->v3) static void givequadverts(EditFace *efa, EditFace *efa1, EditVert **v1, EditVert **v2, EditVert **v3, EditVert **v4, int *vindex) { @@ -3036,7 +3038,7 @@ static void givequadverts(EditFace *efa, EditFace *efa1, EditVert **v1, EditVert vindex[0]= 2; vindex[1]= 0; } - + if VTEST(efa1, 1, efa) { *v3= efa1->v1; *v4= efa1->v2; @@ -3093,65 +3095,65 @@ static void free_tagged_edges_faces(EditMesh *em, EditEdge *eed, EditFace *efa) free_editedge(em, eed); } eed= nexted; - } -} + } +} /* ******************** BEGIN TRIANGLE TO QUAD ************************************* */ static float measure_facepair(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4, float limit) { - + /*gives a 'weight' to a pair of triangles that join an edge to decide how good a join they would make*/ /*Note: this is more complicated than it needs to be and should be cleaned up...*/ float measure = 0.0, noA1[3], noA2[3], noB1[3], noB2[3], normalADiff, normalBDiff, edgeVec1[3], edgeVec2[3], edgeVec3[3], edgeVec4[3], diff, minarea, maxarea, areaA, areaB; - + /*First Test: Normal difference*/ CalcNormFloat(v1->co, v2->co, v3->co, noA1); CalcNormFloat(v1->co, v3->co, v4->co, noA2); - + if(noA1[0] == noA2[0] && noA1[1] == noA2[1] && noA1[2] == noA2[2]) normalADiff = 0.0; else normalADiff = VecAngle2(noA1, noA2); //if(!normalADiff) normalADiff = 179; CalcNormFloat(v2->co, v3->co, v4->co, noB1); CalcNormFloat(v4->co, v1->co, v2->co, noB2); - + if(noB1[0] == noB2[0] && noB1[1] == noB2[1] && noB1[2] == noB2[2]) normalBDiff = 0.0; else normalBDiff = VecAngle2(noB1, noB2); //if(!normalBDiff) normalBDiff = 179; - + measure += (normalADiff/360) + (normalBDiff/360); if(measure > limit) return measure; - + /*Second test: Colinearity*/ VecSubf(edgeVec1, v1->co, v2->co); VecSubf(edgeVec2, v2->co, v3->co); VecSubf(edgeVec3, v3->co, v4->co); VecSubf(edgeVec4, v4->co, v1->co); - + diff = 0.0; - + diff = ( fabs(VecAngle2(edgeVec1, edgeVec2) - 90) + - fabs(VecAngle2(edgeVec2, edgeVec3) - 90) + - fabs(VecAngle2(edgeVec3, edgeVec4) - 90) + + fabs(VecAngle2(edgeVec2, edgeVec3) - 90) + + fabs(VecAngle2(edgeVec3, edgeVec4) - 90) + fabs(VecAngle2(edgeVec4, edgeVec1) - 90)) / 360; if(!diff) return 0.0; - + measure += diff; if(measure > limit) return measure; /*Third test: Concavity*/ areaA = AreaT3Dfl(v1->co, v2->co, v3->co) + AreaT3Dfl(v1->co, v3->co, v4->co); areaB = AreaT3Dfl(v2->co, v3->co, v4->co) + AreaT3Dfl(v4->co, v1->co, v2->co); - + if(areaA <= areaB) minarea = areaA; else minarea = areaB; - + if(areaA >= areaB) maxarea = areaA; else maxarea = areaB; - + if(!maxarea) measure += 1; else measure += (1 - (minarea / maxarea)); @@ -3160,38 +3162,38 @@ static float measure_facepair(EditVert *v1, EditVert *v2, EditVert *v3, EditVert #define T2QUV_LIMIT 0.005 #define T2QCOL_LIMIT 3 -static int compareFaceAttribs(EditMesh *em, EditFace *f1, EditFace *f2, EditEdge *eed) +static int compareFaceAttribs(EditMesh *em, EditFace *f1, EditFace *f2, EditEdge *eed) { - /*Test to see if the per-face attributes for the joining edge match within limit*/ + /*Test to see if the per-face attributes for the joining edge match within limit*/ MTFace *tf1, *tf2; unsigned int *col1, *col2; short i,attrok=0, flag = 0, /* XXX scene->toolsettings->editbutflag,*/ fe1[2], fe2[2]; - + tf1 = CustomData_em_get(&em->fdata, f1->data, CD_MTFACE); tf2 = CustomData_em_get(&em->fdata, f2->data, CD_MTFACE); col1 = CustomData_em_get(&em->fdata, f1->data, CD_MCOL); col2 = CustomData_em_get(&em->fdata, f2->data, CD_MCOL); - + /*store indices for faceedges*/ f1->v1->f1 = 0; f1->v2->f1 = 1; f1->v3->f1 = 2; - + fe1[0] = eed->v1->f1; fe1[1] = eed->v2->f1; - + f2->v1->f1 = 0; f2->v2->f1 = 1; f2->v3->f1 = 2; - + fe2[0] = eed->v1->f1; fe2[1] = eed->v2->f1; - + /*compare faceedges for each face attribute. Additional per face attributes can be added later*/ /*do UVs*/ if(flag & B_JOINTRIA_UV){ - + if(tf1 == NULL || tf2 == NULL) attrok |= B_JOINTRIA_UV; else if(tf1->tpage != tf2->tpage); /*do nothing*/ else{ @@ -3201,7 +3203,7 @@ static int compareFaceAttribs(EditMesh *em, EditFace *f1, EditFace *f2, EditEdge } } } - + /*do VCOLs*/ if(flag & B_JOINTRIA_VCOL){ if(!col1 || !col2) attrok |= B_JOINTRIA_VCOL; @@ -3210,7 +3212,7 @@ static int compareFaceAttribs(EditMesh *em, EditFace *f1, EditFace *f2, EditEdge for(i = 0; i < 2; i++){ f1vcol = (char *)&(col1[fe1[i]]); f2vcol = (char *)&(col2[fe2[i]]); - + /*compare f1vcol with f2vcol*/ if( f1vcol[1] + T2QCOL_LIMIT > f2vcol[1] && f1vcol[1] - T2QCOL_LIMIT < f2vcol[1] && f1vcol[2] + T2QCOL_LIMIT > f2vcol[2] && f1vcol[2] - T2QCOL_LIMIT < f2vcol[2] && @@ -3218,18 +3220,18 @@ static int compareFaceAttribs(EditMesh *em, EditFace *f1, EditFace *f2, EditEdge } } } - + if( ((attrok & B_JOINTRIA_UV) == (flag & B_JOINTRIA_UV)) && ((attrok & B_JOINTRIA_VCOL) == (flag & B_JOINTRIA_VCOL)) ) return 1; return 0; -} - +} + static int fplcmp(const void *v1, const void *v2) { const EditEdge *e1= *((EditEdge**)v1), *e2=*((EditEdge**)v2); - + if( e1->crease > e2->crease) return 1; else if( e1->crease < e2->crease) return -1; - + return 0; } @@ -3248,21 +3250,21 @@ void join_triangles(EditMesh *em) float measure; /*Used to set tolerance*/ float limit = 0.0f; // XXX scene->toolsettings->jointrilimit; int i, ok, totedge=0, totseledge=0, complexedges, vindex[4]; - + /*if we take a long time on very dense meshes we want waitcursor to display*/ waitcursor(1); - + totseledge = count_selected_edges(em->edges.first); if(totseledge==0) return; - + /*abusing crease value to store weights for edge pairs. Nasty*/ for(eed=em->edges.first; eed; eed=eed->next) totedge++; - if(totedge) creases = MEM_callocN(sizeof(float) * totedge, "Join Triangles Crease Array"); + if(totedge) creases = MEM_callocN(sizeof(float) * totedge, "Join Triangles Crease Array"); for(eed=em->edges.first, i = 0; eed; eed=eed->next, i++){ - creases[i] = eed->crease; + creases[i] = eed->crease; eed->crease = 0.0; } - + /*clear temp flags*/ for(eve=em->verts.first; eve; eve=eve->next) eve->f1 = eve->f2 = 0; for(eed=em->edges.first; eed; eed=eed->next) eed->f2 = eed->f1 = 0; @@ -3272,11 +3274,11 @@ void join_triangles(EditMesh *em) efaar= (EVPTuple *) MEM_callocN(totseledge * sizeof(EVPTuple), "Tri2Quad"); ok = collect_quadedges(efaar, em->edges.first, em->faces.first); complexedges = 0; - + if(ok){ - - - /*clear tmp.l flag and store number of faces that are selected and coincident to current face here.*/ + + + /*clear tmp.l flag and store number of faces that are selected and coincident to current face here.*/ for(eed=em->edges.first; eed; eed=eed->next){ /* eed->f2 is 2 only if this edge is part of exactly two triangles, and both are selected, and it has EVPTuple assigned */ @@ -3286,7 +3288,7 @@ void join_triangles(EditMesh *em) efaa[1]->tmp.l++; } } - + for(eed=em->edges.first; eed; eed=eed->next){ if(eed->f2 == 2){ efaa= (EVPtr *) eed->tmp.p; @@ -3299,30 +3301,30 @@ void join_triangles(EditMesh *em) efaa[0]->f1 = 1; //mark for join efaa[1]->f1 = 1; //mark for join } - else{ - + else{ + /* The face pair is part of a 'complex' island, so the rules for dealing with it are more involved. Depending on what options the user has chosen, this face pair can be 'thrown out' based upon the following criteria: - + 1: the two faces do not share the same material 2: the edge joining the two faces is marked as sharp. 3: the two faces UV's do not make a good match 4: the two faces Vertex colors do not make a good match - + If the face pair passes all the applicable tests, it is then given a 'weight' with the measure_facepair() function. This measures things like concavity, colinearity ect. If this weight is below the threshold set by the user the edge joining them is marked as being 'complex' and will be compared against other possible pairs which contain one of the same faces in the current pair later. - + This technique is based upon an algorithm that Campbell Barton developed for his Tri2Quad script that was previously part of the python scripts bundled with Blender releases. */ - + // XXX if(scene->toolsettings->editbutflag & B_JOINTRIA_SHARP && eed->sharp); /*do nothing*/ // else if(scene->toolsettings->editbutflag & B_JOINTRIA_MAT && efaa[0]->mat_nr != efaa[1]->mat_nr); /*do nothing*/ // else if(((scene->toolsettings->editbutflag & B_JOINTRIA_UV) || (scene->toolsettings->editbutflag & B_JOINTRIA_VCOL)) && compareFaceAttribs(em, efaa[0], efaa[1], eed); // XXX == 0); /*do nothing*/ -// else{ +// else{ measure = measure_facepair(v1, v2, v3, v4, limit); if(measure < limit){ complexedges++; @@ -3334,7 +3336,7 @@ void join_triangles(EditMesh *em) } } } - + /*Quicksort the complex edges according to their weighting*/ if(complexedges){ edsortblock = edb = MEM_callocN(sizeof(EditEdge*) * complexedges, "Face Pairs quicksort Array"); @@ -3346,7 +3348,7 @@ void join_triangles(EditMesh *em) } qsort(edsortblock, complexedges, sizeof(EditEdge*), fplcmp); /*now go through and mark the edges who get the highest weighting*/ - for(edb=edsortblock, i=0; i < complexedges; edb++, i++){ + for(edb=edsortblock, i=0; i < complexedges; edb++, i++){ efaa = (EVPtr *)((*edb)->tmp.p); /*suspect!*/ if( !efaa[0]->f1 && !efaa[1]->f1){ efaa[0]->f1 = 1; //mark for join @@ -3355,8 +3357,8 @@ void join_triangles(EditMesh *em) } } } - - /*finally go through all edges marked for join (simple and complex) and create new faces*/ + + /*finally go through all edges marked for join (simple and complex) and create new faces*/ for(eed=em->edges.first; eed; eed=eed->next){ if(eed->f1 & T2QJOIN){ efaa= (EVPtr *)eed->tmp.p; @@ -3376,10 +3378,10 @@ void join_triangles(EditMesh *em) } } } - + /*free data and cleanup*/ if(creases){ - for(eed=em->edges.first, i = 0; eed; eed=eed->next, i++) eed->crease = creases[i]; + for(eed=em->edges.first, i = 0; eed; eed=eed->next, i++) eed->crease = creases[i]; MEM_freeN(creases); } for(eed=em->edges.first; eed; eed=eed->next){ @@ -3389,7 +3391,7 @@ void join_triangles(EditMesh *em) free_tagged_edges_faces(em, em->edges.first, em->faces.first); if(efaar) MEM_freeN(efaar); if(edsortblock) MEM_freeN(edsortblock); - + EM_selectmode_flush(em); } @@ -3407,7 +3409,7 @@ void edge_flip(EditMesh *em) EVPTuple *efaar; EVPtr *efaa; int totedge, ok, vindex[4]; - + /* - all selected edges with two faces * - find the faces: store them in edges (using datablock) * - per edge: - test convex @@ -3415,7 +3417,7 @@ void edge_flip(EditMesh *em) - if true: remedge, addedge, all edges at the edge get new face pointers */ - EM_selectmode_flush(em); // makes sure in selectmode 'face' the edges of selected faces are selected too + EM_selectmode_flush(em); // makes sure in selectmode 'face' the edges of selected faces are selected too totedge = count_selected_edges(em->edges.first); if(totedge==0) return; @@ -3424,15 +3426,15 @@ void edge_flip(EditMesh *em) efaar= (EVPTuple *) MEM_callocN(totedge * sizeof(EVPTuple), "edgeflip"); ok = collect_quadedges(efaar, em->edges.first, em->faces.first); - + eed= em->edges.first; while(eed) { nexted= eed->next; - + if(eed->f2==2) { /* points to 2 faces */ - + efaa= (EVPtr *) eed->tmp.p; - + /* don't do it if flagged */ ok= 1; @@ -3440,7 +3442,7 @@ void edge_flip(EditMesh *em) if(efa->e1->f1 || efa->e2->f1 || efa->e3->f1) ok= 0; efa= efaa[1]; if(efa->e1->f1 || efa->e2->f1 || efa->e3->f1) ok= 0; - + if(ok) { /* test convex */ givequadverts(efaa[0], efaa[1], &v1, &v2, &v3, &v4, vindex); @@ -3449,8 +3451,8 @@ void edge_flip(EditMesh *em) 4-----3 4-----3 |\ | | /| | \ 1 | | 1 / | - | \ | -> | / | - | 0 \ | | / 0 | + | \ | -> | / | + | 0 \ | | / 0 | | \| |/ | 1-----2 1-----2 */ @@ -3458,7 +3460,7 @@ void edge_flip(EditMesh *em) if (v1 && v2 && v3) { if( convex(v1->co, v2->co, v3->co, v4->co) ) { if(exist_face(em, v1, v2, v3, v4)==0) { - /* outch this may break seams */ + /* outch this may break seams */ w= EM_face_from_faces(em, efaa[0], efaa[1], vindex[0], vindex[1], 4+vindex[2], -1); @@ -3473,8 +3475,8 @@ void edge_flip(EditMesh *em) /* tag as to-be-removed */ FACE_MARKCLEAR(efaa[1]); FACE_MARKCLEAR(efaa[0]); - eed->f1 = 1; - + eed->f1 = 1; + } /* endif test convex */ } } @@ -3484,7 +3486,7 @@ void edge_flip(EditMesh *em) /* clear tagged edges and faces: */ free_tagged_edges_faces(em, em->edges.first, em->faces.first); - + MEM_freeN(efaar); } @@ -3511,7 +3513,7 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir) EditEdge **edges[2], **hiddenedges, *srchedge; int facecount, p1, p2, p3, p4, fac1, fac2, i, j; int numhidden, numshared, p[2][4]; - + /* check to make sure that the edge is only part of 2 faces */ facecount = 0; for(efa = em->faces.first;efa;efa = efa->next) { @@ -3526,7 +3528,7 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir) } } } - + if(facecount < 2) return; @@ -3536,7 +3538,7 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir) if(face[1]->e4) fac2= 4; else fac2= 3; - + /* make a handy array for verts and edges */ verts[0]= &face[0]->v1; edges[0]= &face[0]->e1; @@ -3552,7 +3554,7 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir) if(numshared > 1) return; - + /* we want to construct an array of vertex indicis in both faces, starting at the last vertex of the edge being rotated. - first we find the two vertices that lie on the rotating edge @@ -3566,12 +3568,12 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir) if(eed->v1 == verts[1][i]) p3 = i; if(eed->v2 == verts[1][i]) p4 = i; } - + if((p1+1)%fac1 == p2) SWAP(int, p1, p2); if((p3+1)%fac2 == p4) SWAP(int, p3, p4); - + for (i = 0; i < 4; i++) { p[0][i]= (p1 + i)%fac1; p[1][i]= (p3 + i)%fac2; @@ -3586,7 +3588,7 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir) hiddenedges = MEM_mallocN(sizeof(EditVert*)*numhidden+1, "RotateEdgeHiddenVerts"); if(!hiddenedges) { BKE_report(op->reports, RPT_ERROR, "Memory allocation failed"); - return; + return; } numhidden = 0; @@ -3608,9 +3610,9 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir) } else if (dir == DIRECTION_CCW) { newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][2], 4+p[1][1], p[0][0], p[0][1]); newFace[1]= EM_face_from_faces(em, face[1], face[0], 4+p[0][2], p[1][0], p[1][1], -1); - + verts[0][p[0][2]]->f |= SELECT; - verts[1][p[1][1]]->f |= SELECT; + verts[1][p[1][1]]->f |= SELECT; } } else if(fac1 == 3 && fac2 == 4) { @@ -3620,11 +3622,11 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir) } else if (dir == DIRECTION_CCW) { newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][0], p[0][1], 4+p[1][2], -1); newFace[1]= EM_face_from_faces(em, face[1], face[0], p[1][1], p[1][2], 4+p[0][1], 4+p[0][2]); - + verts[0][p[0][1]]->f |= SELECT; - verts[1][p[1][2]]->f |= SELECT; + verts[1][p[1][2]]->f |= SELECT; } - + } else if(fac1 == 4 && fac2 == 4) { if(dir == DIRECTION_CW) { @@ -3633,11 +3635,11 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir) } else if (dir == DIRECTION_CCW) { newFace[0]= EM_face_from_faces(em, face[0], face[1], p[0][2], p[0][3], 4+p[1][1], 4+p[1][2]); newFace[1]= EM_face_from_faces(em, face[1], face[0], p[1][2], p[1][3], 4+p[0][1], 4+p[0][2]); - + verts[0][p[0][2]]->f |= SELECT; - verts[1][p[1][2]]->f |= SELECT; + verts[1][p[1][2]]->f |= SELECT; } - } + } else return; /* This should never happen */ @@ -3645,7 +3647,7 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir) verts[0][p[0][1]]->f |= SELECT; verts[1][p[1][1]]->f |= SELECT; } - + /* copy old edge's flags to new center edge*/ for(srchedge=em->edges.first;srchedge;srchedge=srchedge->next) { if((srchedge->v1->f & SELECT) && (srchedge->v2->f & SELECT)) { @@ -3657,25 +3659,25 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir) srchedge->bweight = eed->bweight; } } - + /* resetting hidden flag */ for(numhidden--; numhidden>=0; numhidden--) hiddenedges[numhidden]->h= 1; - + /* check for orhphan edges */ for(srchedge=em->edges.first; srchedge; srchedge=srchedge->next) - srchedge->f1= -1; - + srchedge->f1= -1; + /* cleanup */ MEM_freeN(hiddenedges); - + /* get rid of the old edge and faces*/ remedge(em, eed); - free_editedge(em, eed); + free_editedge(em, eed); BLI_remlink(&em->faces, face[0]); - free_editface(em, face[0]); + free_editface(em, face[0]); BLI_remlink(&em->faces, face[1]); - free_editface(em, face[1]); + free_editface(em, face[1]); } // XXX ton please check @@ -3689,14 +3691,14 @@ static int edge_rotate_selected(bContext *C, wmOperator *op) EditFace *efa; int dir = RNA_int_get(op->ptr, "direction"); // dir == 2 when clockwise and ==1 for counter CW. short edgeCount = 0; - + /*clear new flag for new edges, count selected edges */ for(eed= em->edges.first; eed; eed= eed->next) { eed->f1= 0; eed->f2 &= ~2; - if(eed->f & SELECT) edgeCount++; + if(eed->f & SELECT) edgeCount++; } - + if(edgeCount>1) { /* more selected edges, check faces */ for(efa= em->faces.first; efa; efa= efa->next) { @@ -3719,7 +3721,7 @@ static int edge_rotate_selected(bContext *C, wmOperator *op) } } } - else + else { BKE_report(op->reports, RPT_ERROR, "Select one edge or two adjacent faces"); BKE_mesh_end_editmesh(obedit->data, em); @@ -3735,7 +3737,7 @@ static int edge_rotate_selected(bContext *C, wmOperator *op) } } } - else { + else { BKE_report(op->reports, RPT_ERROR, "Select one edge or two adjacent faces"); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; @@ -3743,7 +3745,7 @@ static int edge_rotate_selected(bContext *C, wmOperator *op) /* flush selected vertices (again) to edges/faces */ EM_select_flush(em); - + BKE_mesh_end_editmesh(obedit->data, em); DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); @@ -3757,14 +3759,14 @@ void MESH_OT_edge_rotate(wmOperatorType *ot) /* identifiers */ ot->name= "Rotate Selected Edge"; ot->idname= "MESH_OT_edge_rotate"; - + /* api callbacks */ ot->exec= edge_rotate_selected; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - + /* props */ RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "direction", "direction to rotate edge around."); } @@ -3774,7 +3776,7 @@ void MESH_OT_edge_rotate(wmOperatorType *ot) /* XXX old bevel not ported yet */ -void bevel_menu(EditMesh *em) +void bevel_menu(EditMesh *em) { BME_Mesh *bm; BME_TransData_Head *td; @@ -3829,7 +3831,7 @@ returns 0 if they do not, or if the function is passed the same edge 2 times short sharesFace(EditMesh *em, EditEdge* e1, EditEdge* e2) { EditFace *search=NULL; - + search = em->faces.first; if (e1 == e2){ return 0 ; @@ -3880,38 +3882,38 @@ useless: float shiftlabda= 0.0f,len = 0.0f; int i = 0,j, numsel, numadded=0, timesthrough = 0, vertsel=0, prop=1, cancel = 0,flip=0; int wasshift = 0; - + /* UV correction vars */ GHash **uvarray= NULL; int uvlay_tot= CustomData_number_of_layers(&em->fdata, CD_MTFACE); int uvlay_idx; - SlideUv *slideuvs=NULL, *suv=NULL, *suv_last=NULL; + SlideUv *slideuvs=NULL, *suv=NULL, *suv_last=NULL; float uv_tmp[2]; LinkNode *fuv_link; - + short event, draw=1; short mval[2], mvalo[2]; - char str[128]; + char str[128]; float labda = 0.0f; - + // initNumInput(&num); - + // view3d_get_object_project_mat(curarea, obedit, projectMat); - - mvalo[0] = -1; mvalo[1] = -1; - numsel =0; - + + mvalo[0] = -1; mvalo[1] = -1; + numsel =0; + // Get number of selected edges and clear some flags for(eed=em->edges.first;eed;eed=eed->next) { eed->f1 = 0; - eed->f2 = 0; + eed->f2 = 0; if(eed->f & SELECT) numsel++; } - + for(ev=em->verts.first;ev;ev=ev->next) { - ev->f1 = 0; - } - + ev->f1 = 0; + } + //Make sure each edge only has 2 faces // make sure loop doesn't cross face for(efa=em->faces.first;efa;efa=efa->next) { @@ -3921,7 +3923,7 @@ useless: efa->e1->f1++; if(efa->e1->f1 > 2) { BKE_report(op->reports, RPT_ERROR, "3+ face edge"); - return 0; + return 0; } } if(efa->e2->f & SELECT) { @@ -3929,7 +3931,7 @@ useless: efa->e2->f1++; if(efa->e2->f1 > 2) { BKE_report(op->reports, RPT_ERROR, "3+ face edge"); - return 0; + return 0; } } if(efa->e3->f & SELECT) { @@ -3937,7 +3939,7 @@ useless: efa->e3->f1++; if(efa->e3->f1 > 2) { BKE_report(op->reports, RPT_ERROR, "3+ face edge"); - return 0; + return 0; } } if(efa->e4 && efa->e4->f & SELECT) { @@ -3945,26 +3947,26 @@ useless: efa->e4->f1++; if(efa->e4->f1 > 2) { BKE_report(op->reports, RPT_ERROR, "3+ face edge"); - return 0; + return 0; } - } - // Make sure loop is not 2 edges of same face + } + // Make sure loop is not 2 edges of same face if(ct > 1) { BKE_report(op->reports, RPT_ERROR, "Loop crosses itself"); - return 0; + return 0; } - } + } // Get # of selected verts - for(ev=em->verts.first;ev;ev=ev->next) { + for(ev=em->verts.first;ev;ev=ev->next) { if(ev->f & SELECT) vertsel++; - } - + } + // Test for multiple segments if(vertsel > numsel+1) { BKE_report(op->reports, RPT_ERROR, "Please choose a single edge loop"); - return 0; - } - + return 0; + } + // Get the edgeloop in order - mark f1 with SELECT once added for(eed=em->edges.first;eed;eed=eed->next) { if((eed->f & SELECT) && !(eed->f1 & SELECT)) { @@ -3973,35 +3975,35 @@ useless: BLI_linklist_prepend(&edgelist,eed); numadded++; first = eed; - last = eed; + last = eed; eed->f1 = SELECT; - } else { + } else { if(editedge_getSharedVert(eed, last)) { BLI_linklist_append(&edgelist,eed); eed->f1 = SELECT; numadded++; - last = eed; + last = eed; } else if(editedge_getSharedVert(eed, first)) { BLI_linklist_prepend(&edgelist,eed); eed->f1 = SELECT; numadded++; - first = eed; - } + first = eed; + } } - } + } if(eed->next == NULL && numadded != numsel) { - eed=em->edges.first; + eed=em->edges.first; timesthrough++; } - + // It looks like there was an unexpected case - Hopefully should not happen if(timesthrough >= numsel*2) { - BLI_linklist_free(edgelist,NULL); + BLI_linklist_free(edgelist,NULL); BKE_report(op->reports, RPT_ERROR, "Could not order loop"); - return 0; + return 0; } } - + // Put the verts in order in a linklist look = edgelist; while(look) { @@ -4012,33 +4014,33 @@ useless: //This is the first entry takes care of extra vert if(eed->v1 != temp->v1 && eed->v1 != temp->v2) { - BLI_linklist_append(&vertlist,eed->v1); - eed->v1->f1 = 1; + BLI_linklist_append(&vertlist,eed->v1); + eed->v1->f1 = 1; } else { - BLI_linklist_append(&vertlist,eed->v2); - eed->v2->f1 = 1; - } + BLI_linklist_append(&vertlist,eed->v2); + eed->v2->f1 = 1; + } } else { //This is the case that we only have 1 edge - BLI_linklist_append(&vertlist,eed->v1); - eed->v1->f1 = 1; + BLI_linklist_append(&vertlist,eed->v1); + eed->v1->f1 = 1; } - } + } // for all the entries if(eed->v1->f1 != 1) { - BLI_linklist_append(&vertlist,eed->v1); - eed->v1->f1 = 1; + BLI_linklist_append(&vertlist,eed->v1); + eed->v1->f1 = 1; } else if(eed->v2->f1 != 1) { - BLI_linklist_append(&vertlist,eed->v2); - eed->v2->f1 = 1; - } - look = look->next; - } - + BLI_linklist_append(&vertlist,eed->v2); + eed->v2->f1 = 1; + } + look = look->next; + } + // populate the SlideVerts - - vertgh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); - look = vertlist; + + vertgh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); + look = vertlist; while(look) { i=0; j=0; @@ -4054,14 +4056,14 @@ useless: tempsv->origvert.no[2] = ev->no[2]; // i is total edges that vert is on // j is total selected edges that vert is on - + for(eed=em->edges.first;eed;eed=eed->next) { if(eed->v1 == ev || eed->v2 == ev) { - i++; + i++; if(eed->f & SELECT) { - j++; + j++; } - } + } } // If the vert is in the middle of an edge loop, it touches 2 selected edges and 2 unselected edges if(i == 4 && j == 2) { @@ -4071,11 +4073,11 @@ useless: if(!tempsv->up) { tempsv->up = eed; } else if (!(tempsv->down)) { - tempsv->down = eed; + tempsv->down = eed; } } - } - } + } + } } // If it is on the end of the loop, it touches 1 selected and as least 2 more unselected if(i >= 3 && j == 1) { @@ -4087,63 +4089,63 @@ useless: if(!tempsv->up) { tempsv->up = efa->e1; } else if (!(tempsv->down)) { - tempsv->down = efa->e1; - } + tempsv->down = efa->e1; + } } if(editedge_containsVert(efa->e2, ev) && efa->e2 != eed) { if(!tempsv->up) { tempsv->up = efa->e2; } else if (!(tempsv->down)) { - tempsv->down = efa->e2; - } - } + tempsv->down = efa->e2; + } + } if(editedge_containsVert(efa->e3, ev) && efa->e3 != eed) { if(!tempsv->up) { tempsv->up = efa->e3; } else if (!(tempsv->down)) { - tempsv->down = efa->e3; - } - } + tempsv->down = efa->e3; + } + } if(efa->e4) { if(editedge_containsVert(efa->e4, ev) && efa->e4 != eed) { if(!tempsv->up) { tempsv->up = efa->e4; } else if (!(tempsv->down)) { - tempsv->down = efa->e4; - } + tempsv->down = efa->e4; + } } - } - + } + } } - } - } - } + } + } + } if(i > 4 && j == 2) { BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN); - BLI_linklist_free(vertlist,NULL); - BLI_linklist_free(edgelist,NULL); - return 0; + BLI_linklist_free(vertlist,NULL); + BLI_linklist_free(edgelist,NULL); + return 0; } BLI_ghash_insert(vertgh,ev,tempsv); - - look = look->next; - } - + + look = look->next; + } + // make sure the UPs nad DOWNs are 'faceloops' // Also find the nearest slidevert to the cursor // XXX getmouseco_areawin(mval); - look = vertlist; + look = vertlist; nearest = NULL; - vertdist = -1; - while(look) { + vertdist = -1; + while(look) { tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link); - + if(!tempsv->up || !tempsv->down) { BKE_report(op->reports, RPT_ERROR, "Missing rails"); BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN); - BLI_linklist_free(vertlist,NULL); - BLI_linklist_free(edgelist,NULL); + BLI_linklist_free(vertlist,NULL); + BLI_linklist_free(edgelist,NULL); return 0; } @@ -4174,39 +4176,39 @@ useless: EditEdge *swap; swap = sv->up; sv->up = sv->down; - sv->down = swap; + sv->down = swap; } // view3d_project_float(curarea, tempsv->origvert.co, co, projectMat); - + tempdist = sqrt(pow(co[0] - mval[0],2)+pow(co[1] - mval[1],2)); if(vertdist < 0) { vertdist = tempdist; - nearest = (EditVert*)look->link; + nearest = (EditVert*)look->link; } else if ( tempdist < vertdist ) { vertdist = tempdist; - nearest = (EditVert*)look->link; - } - } - } - - - - look = look->next; - } - - + nearest = (EditVert*)look->link; + } + } + } + + + + look = look->next; + } + + if (uvlay_tot) { // XXX && (scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) { int maxnum = 0; uvarray = MEM_callocN( uvlay_tot * sizeof(GHash *), "SlideUVs Array"); suv_last = slideuvs = MEM_callocN( uvlay_tot * (numadded+1) * sizeof(SlideUv), "SlideUVs"); /* uvLayers * verts */ suv = NULL; - + for (uvlay_idx=0; uvlay_idxverts.first;ev;ev=ev->next) { ev->tmp.l = 0; } @@ -4214,25 +4216,25 @@ useless: while(look) { float *uv_new; tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link); - + ev = look->link; suv = NULL; for(efa = em->faces.first;efa;efa=efa->next) { if (ev->tmp.l != -1) { /* test for self, in this case its invalid */ int k=-1; /* face corner */ - + /* Is this vert in the faces corner? */ if (efa->v1==ev) k=0; else if (efa->v2==ev) k=1; else if (efa->v3==ev) k=2; else if (efa->v4 && efa->v4==ev) k=3; - + if (k != -1) { MTFace *tf = CustomData_em_get_n(&em->fdata, efa->data, CD_MTFACE, uvlay_idx); EditVert *ev_up, *ev_down; - + uv_new = tf->uv[k]; - + if (ev->tmp.l) { if (fabs(suv->origuv[0]-uv_new[0]) > 0.0001 || fabs(suv->origuv[1]-uv_new[1])) { ev->tmp.l = -1; /* Tag as invalid */ @@ -4250,14 +4252,14 @@ useless: suv->uv_up = suv->uv_down = NULL; suv->origuv[0] = uv_new[0]; suv->origuv[1] = uv_new[1]; - + BLI_linklist_prepend(&suv->fuv_list, uv_new); BLI_ghash_insert(uvarray[uvlay_idx],ev,suv); - + suv_last++; /* advance to next slide UV */ maxnum++; } - + /* Now get the uvs along the up or down edge if we can */ if (suv) { if (!suv->uv_up) { @@ -4274,7 +4276,7 @@ useless: else if (efa->v3==ev_down) suv->uv_down = tf->uv[2]; else if (efa->v4 && efa->v4==ev_down) suv->uv_down = tf->uv[3]; } - + /* Copy the pointers to the face UV's */ BLI_linklist_prepend(&suv->fuv_list, uv_new); } @@ -4285,32 +4287,32 @@ useless: } } /* end uv layer loop */ } /* end uvlay_tot */ - - - + + + // we should have enough info now to slide - len = 0.0f; - + len = 0.0f; + percp = -1; while(draw) { - /* For the % calculation */ - short mval[2]; + /* For the % calculation */ + short mval[2]; float rc[2]; float v2[2], v3[2]; EditVert *centerVert, *upVert, *downVert; - -// XXX getmouseco_areawin(mval); - + +// XXX getmouseco_areawin(mval); + if (!immediate && (mval[0] == mvalo[0] && mval[1] == mvalo[1])) { PIL_sleep_ms(10); } else { char *p = str; int ctrl= 0, shift= 0; // XXX - + mvalo[0] = mval[0]; mvalo[1] = mval[1]; - + tempsv = BLI_ghash_lookup(vertgh,nearest); @@ -4321,31 +4323,31 @@ useless: // view3d_project_float(curarea, upVert->co, v2, projectMat); // view3d_project_float(curarea, downVert->co, v3, projectMat); - /* Determine the % on which the loop should be cut */ + /* Determine the % on which the loop should be cut */ - rc[0]= v3[0]-v2[0]; - rc[1]= v3[1]-v2[1]; + rc[0]= v3[0]-v2[0]; + rc[1]= v3[1]-v2[1]; len= rc[0]*rc[0]+ rc[1]*rc[1]; if (len==0) {len = 0.0001;} if (shift) { wasshift = 0; - labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len; + labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len; } else { if (wasshift==0) { wasshift = 1; shiftlabda = labda; - } - labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len / 10.0 + shiftlabda; + } + labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len / 10.0 + shiftlabda; } - - if(labda<=0.0) labda=0.0; - else if(labda>=1.0)labda=1.0; - perc=((1-labda)*2)-1; - + if(labda<=0.0) labda=0.0; + else if(labda>=1.0)labda=1.0; + + perc=((1-labda)*2)-1; + if(shift == 0 && ctrl==0) { perc *= 100; perc = floor(perc); @@ -4353,20 +4355,20 @@ useless: } else if (ctrl) { perc *= 10; perc = floor(perc); - perc /= 10; - } - + perc /= 10; + } + if(prop == 0) { len = VecLenf(upVert->co,downVert->co)*((perc+1)/2); if(flip == 1) { len = VecLenf(upVert->co,downVert->co) - len; - } + } } - + if (0) // XXX hasNumInput(&num)) { // XXX applyNumInput(&num, &perc); - + if (prop) { perc = MIN2(perc, 1); @@ -4381,19 +4383,19 @@ useless: //Adjust Edgeloop if(immediate) { - perc = imperc; + perc = imperc; } percp = perc; if(prop) { - look = vertlist; - while(look) { + look = vertlist; + while(look) { EditVert *tempev; ev = look->link; tempsv = BLI_ghash_lookup(vertgh,ev); - + tempev = editedge_getOtherVert((perc>=0)?tempsv->up:tempsv->down, ev); VecLerpf(ev->co, tempsv->origvert.co, tempev->co, fabs(perc)); - + if (0) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) { for (uvlay_idx=0; uvlay_idxnext; + + look = look->next; } } else { - //Non prop code - look = vertlist; - while(look) { + //Non prop code + look = vertlist; + while(look) { float newlen; ev = look->link; tempsv = BLI_ghash_lookup(vertgh,ev); @@ -4422,7 +4424,7 @@ useless: if(newlen > 1.0) {newlen = 1.0;} if(newlen < 0.0) {newlen = 0.0;} if(flip == 0) { - VecLerpf(ev->co, editedge_getOtherVert(tempsv->down,ev)->co, editedge_getOtherVert(tempsv->up,ev)->co, fabs(newlen)); + VecLerpf(ev->co, editedge_getOtherVert(tempsv->down,ev)->co, editedge_getOtherVert(tempsv->up,ev)->co, fabs(newlen)); if (0) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) { /* dont do anything if no UVs */ for (uvlay_idx=0; uvlay_idxco, editedge_getOtherVert(tempsv->up,ev)->co, editedge_getOtherVert(tempsv->down,ev)->co, fabs(newlen)); - + VecLerpf(ev->co, editedge_getOtherVert(tempsv->up,ev)->co, editedge_getOtherVert(tempsv->down,ev)->co, fabs(newlen)); + if (0) { // XXX scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT) { /* dont do anything if no UVs */ for (uvlay_idx=0; uvlay_idxnext; + look = look->next; } } - + // Highlight the Control Edges -// scrarea_do_windraw(curarea); -// persp(PERSP_VIEW); -// glPushMatrix(); +// scrarea_do_windraw(curarea); +// persp(PERSP_VIEW); +// glPushMatrix(); // mymultmatrix(obedit->obmat); - glColor3ub(0, 255, 0); + glColor3ub(0, 255, 0); glBegin(GL_LINES); glVertex3fv(upVert->co); glVertex3fv(downVert->co); - glEnd(); - + glEnd(); + if(prop == 0) { // draw start edge for non-prop glPointSize(5); @@ -4480,24 +4482,24 @@ useless: if(flip) { glVertex3fv(upVert->co); } else { - glVertex3fv(downVert->co); + glVertex3fv(downVert->co); } - glEnd(); + glEnd(); } - - - glPopMatrix(); + + + glPopMatrix(); if(prop) { p += sprintf(str, "(P)ercentage: "); } else { p += sprintf(str, "Non (P)rop Length: "); } - + if (0) // XXX hasNumInput(&num)) { char num_str[20]; - + // XX outputNumInput(&num, num_str); p += sprintf(p, "%s", num_str); } @@ -4512,20 +4514,20 @@ useless: p += sprintf(p, "%f", len); } } - - + + if (prop == 0) { p += sprintf(p, ", Press (F) to flip control side"); } // headerprint(str); -// screen_swapbuffers(); +// screen_swapbuffers(); } if(!immediate) { while(qtest()) { - short val=0; - event= extern_qread(&val); // extern_qread stores important events for the mainloop to handle - + short val=0; + event= extern_qread(&val); // extern_qread stores important events for the mainloop to handle + /* val==0 on key-release event */ if (val) { if(ELEM(event, ESCKEY, RIGHTMOUSE)) { @@ -4537,7 +4539,7 @@ useless: } else if(ELEM3(event, PADENTER, LEFTMOUSE, RETKEY)) { draw = 0; // End looping now } else if(event==MIDDLEMOUSE) { - perc = 0; + perc = 0; immediate = 1; } else if(event==PKEY) { // XXX initNumInput(&num); /* reset num input */ @@ -4548,61 +4550,61 @@ useless: else { prop = 1; } - mvalo[0] = -1; + mvalo[0] = -1; } else if(event==FKEY) { - (flip == 1) ? (flip = 0):(flip = 1); - mvalo[0] = -1; + (flip == 1) ? (flip = 0):(flip = 1); + mvalo[0] = -1; } else if(ELEM(event, RIGHTARROWKEY, WHEELUPMOUSE)) { // Scroll through Control Edges - look = vertlist; - while(look) { + look = vertlist; + while(look) { if(nearest == (EditVert*)look->link) { if(look->next == NULL) { - nearest = (EditVert*)vertlist->link; + nearest = (EditVert*)vertlist->link; } else { nearest = (EditVert*)look->next->link; - } + } mvalo[0] = -1; - break; + break; } - look = look->next; - } + look = look->next; + } } else if(ELEM(event, LEFTARROWKEY, WHEELDOWNMOUSE)) { // Scroll through Control Edges - look = vertlist; - while(look) { + look = vertlist; + while(look) { if(look->next) { if(look->next->link == nearest) { nearest = (EditVert*)look->link; mvalo[0] = -1; break; - } + } } else { if((EditVert*)vertlist->link == nearest) { nearest = look->link; mvalo[0] = -1; - break; - } - } - look = look->next; - } + break; + } + } + look = look->next; + } } - + // XXX if (handleNumInput(&num, event)) { mvalo[0] = -1; /* NEED A BETTER WAY TO TRIGGER REDRAW */ } } - - } + + } } else { draw = 0; } -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); } - - + + if(me->drawflag & ME_DRAW_EDGELEN) { look = vertlist; - while(look) { + while(look) { tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link); if(tempsv != NULL) { tempsv->up->f &= !SELECT; @@ -4611,26 +4613,26 @@ useless: look = look->next; } } - + // force_draw(0); - + if(!immediate) EM_automerge(0); // DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); -// scrarea_queue_winredraw(curarea); - - //BLI_ghash_free(edgesgh, freeGHash, NULL); +// scrarea_queue_winredraw(curarea); + + //BLI_ghash_free(edgesgh, freeGHash, NULL); BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN); - BLI_linklist_free(vertlist,NULL); - BLI_linklist_free(edgelist,NULL); - + BLI_linklist_free(vertlist,NULL); + BLI_linklist_free(edgelist,NULL); + if (uvlay_tot) { // XXX && (scene->toolsettings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) { for (uvlay_idx=0; uvlay_idx= slideuvs) { if (suv->fuv_list) { @@ -4648,21 +4650,21 @@ useless: #endif // END OF XXX } -int EdgeLoopDelete(EditMesh *em, wmOperator *op) +int EdgeLoopDelete(EditMesh *em, wmOperator *op) { - + /* temporal flag setting so we keep UVs when deleting edge loops, * this is a bit of a hack but it works how you would want in almost all cases */ - // short uvcalc_flag_orig = 0; // XXX scene->toolsettings->uvcalc_flag; + // short uvcalc_flag_orig = 0; // XXX scene->toolsettings->uvcalc_flag; // scene->toolsettings->uvcalc_flag |= UVCALC_TRANSFORM_CORRECT; - + if(!EdgeSlide(em, op, 1, 1)) { return 0; } - + /* restore uvcalc flag */ // scene->toolsettings->uvcalc_flag = uvcalc_flag_orig; - + EM_select_more(em); removedoublesflag(em, 1,0, 0.001); EM_select_flush(em); @@ -4683,12 +4685,12 @@ void mesh_set_face_flags(EditMesh *em, short mode) m_billboard=0, m_shadow=0, m_text=0, m_sort=0; short flag = 0, change = 0; - + // XXX if (!EM_texFaceCheck()) { // error("not a mesh with uv/image layers"); // return; // } - + add_numbut(0, TOG|SHO, "Texture", 0, 0, &m_tex, NULL); add_numbut(2, TOG|SHO, "Light", 0, 0, &m_light, NULL); add_numbut(3, TOG|SHO, "Invisible", 0, 0, &m_invis, NULL); @@ -4701,15 +4703,15 @@ void mesh_set_face_flags(EditMesh *em, short mode) add_numbut(10, TOG|SHO, "Shadow", 0, 0, &m_shadow, NULL); add_numbut(11, TOG|SHO, "Text", 0, 0, &m_text, NULL); add_numbut(12, TOG|SHO, "Sort", 0, 0, &m_sort, NULL); - + if (!do_clever_numbuts((mode ? "Set Flags" : "Clear Flags"), 13, REDRAW)) return; - + /* these 2 cant both be on */ if (mode) /* are we seeting*/ if (m_halo) m_billboard = 0; - + if (m_tex) flag |= TF_TEX; if (m_shared) flag |= TF_SHAREDCOL; if (m_light) flag |= TF_LIGHT; @@ -4722,10 +4724,10 @@ void mesh_set_face_flags(EditMesh *em, short mode) if (m_shadow) flag |= TF_SHADOW; if (m_text) flag |= TF_BMFONT; if (m_sort) flag |= TF_ALPHASORT; - + if (flag==0) return; - + efa= em->faces.first; while(efa) { if(efa->f & SELECT) { @@ -4736,7 +4738,7 @@ void mesh_set_face_flags(EditMesh *em, short mode) } efa= efa->next; } - + } #endif @@ -4746,12 +4748,12 @@ void mesh_set_face_flags(EditMesh *em, short mode) static float mesh_rip_edgedist(ARegion *ar, float mat[][4], float *co1, float *co2, short *mval) { float vec1[3], vec2[3], mvalf[2]; - + view3d_project_float(ar, co1, vec1, mat); view3d_project_float(ar, co2, vec2, mat); mvalf[0]= (float)mval[0]; mvalf[1]= (float)mval[1]; - + return PdistVL2Dfl(mvalf, vec1, vec2); } @@ -4763,16 +4765,16 @@ static void mesh_rip_setface(EditMesh *em, EditFace *sefa) if(sefa->v2->tmp.v) sefa->v2= sefa->v2->tmp.v; if(sefa->v3->tmp.v) sefa->v3= sefa->v3->tmp.v; if(sefa->v4 && sefa->v4->tmp.v) sefa->v4= sefa->v4->tmp.v; - + sefa->e1= addedgelist(em, sefa->v1, sefa->v2, sefa->e1); sefa->e2= addedgelist(em, sefa->v2, sefa->v3, sefa->e2); if(sefa->v4) { sefa->e3= addedgelist(em, sefa->v3, sefa->v4, sefa->e3); sefa->e4= addedgelist(em, sefa->v4, sefa->v1, sefa->e4); } - else + else sefa->e3= addedgelist(em, sefa->v3, sefa->v1, sefa->e3); - + } /* based on mouse cursor position, it defines how is being ripped */ @@ -4787,32 +4789,26 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) EditEdge *eed, *seed= NULL; EditFace *efa, *sefa= NULL; float projectMat[4][4], vec[3], dist, mindist; - short doit= 1, *mval= event->mval; // XXX ,propmode,prop; - - -// XXX propmode = scene->prop_mode; -// scene->prop_mode = 0; -// prop = scene->proportional; -// scene->proportional = 0; - + short doit= 1, *mval= event->mval; + /* select flush... vertices are important */ EM_selectmode_set(em); - + view3d_get_object_project_mat(rv3d, obedit, projectMat); /* find best face, exclude triangles and break on face select or faces with 2 edges select */ mindist= 1000000.0f; for(efa= em->faces.first; efa; efa=efa->next) { - if( efa->f & 1) + if( efa->f & 1) break; if(efa->v4 && faceselectedOR(efa, SELECT) ) { int totsel=0; - + if(efa->e1->f & SELECT) totsel++; if(efa->e2->f & SELECT) totsel++; if(efa->e3->f & SELECT) totsel++; if(efa->e4->f & SELECT) totsel++; - + if(totsel>1) break; view3d_project_float(ar, efa->cent, vec, projectMat); @@ -4823,7 +4819,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) } } } - + if(efa) { BKE_report(op->reports, RPT_ERROR, "Can't perform ripping with faces selected this way"); BKE_mesh_end_editmesh(obedit->data, em); @@ -4834,7 +4830,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } - + /* duplicate vertices, new vertices get selected */ for(eve = em->verts.last; eve; eve= eve->prev) { @@ -4845,20 +4841,20 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) eve->tmp.v->f |= SELECT; } } - + /* find the best candidate edge */ /* or one of sefa edges is selected... */ if(sefa->e1->f & SELECT) seed= sefa->e2; if(sefa->e2->f & SELECT) seed= sefa->e1; if(sefa->e3->f & SELECT) seed= sefa->e2; if(sefa->e4 && sefa->e4->f & SELECT) seed= sefa->e3; - + /* or we do the distance trick */ if(seed==NULL) { mindist= 1000000.0f; if(sefa->e1->v1->tmp.v || sefa->e1->v2->tmp.v) { - dist = mesh_rip_edgedist(ar, projectMat, - sefa->e1->v1->co, + dist = mesh_rip_edgedist(ar, projectMat, + sefa->e1->v1->co, sefa->e1->v2->co, mval); if(diste1; @@ -4867,7 +4863,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) } if(sefa->e2->v1->tmp.v || sefa->e2->v2->tmp.v) { dist = mesh_rip_edgedist(ar, projectMat, - sefa->e2->v1->co, + sefa->e2->v1->co, sefa->e2->v2->co, mval); if(diste2; @@ -4875,8 +4871,8 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) } } if(sefa->e3->v1->tmp.v || sefa->e3->v2->tmp.v) { - dist= mesh_rip_edgedist(ar, projectMat, - sefa->e3->v1->co, + dist= mesh_rip_edgedist(ar, projectMat, + sefa->e3->v1->co, sefa->e3->v2->co, mval); if(diste3; @@ -4884,8 +4880,8 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) } } if(sefa->e4 && (sefa->e4->v1->tmp.v || sefa->e4->v2->tmp.v)) { - dist= mesh_rip_edgedist(ar, projectMat, - sefa->e4->v1->co, + dist= mesh_rip_edgedist(ar, projectMat, + sefa->e4->v1->co, sefa->e4->v2->co, mval); if(diste4; @@ -4893,13 +4889,13 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) } } } - + if(seed==NULL) { // never happens? BKE_report(op->reports, RPT_ERROR, "No proper edge found to start"); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } - + faceloop_select(em, seed, 2); // tmp abuse for finding all edges that need duplicated, returns OK faces with f1 /* duplicate edges in the loop, with at least 1 vertex selected, needed for selection flip */ @@ -4907,8 +4903,8 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) eed->tmp.v = NULL; if((eed->v1->tmp.v) || (eed->v2->tmp.v)) { EditEdge *newed; - - newed= addedgelist(em, eed->v1->tmp.v?eed->v1->tmp.v:eed->v1, + + newed= addedgelist(em, eed->v1->tmp.v?eed->v1->tmp.v:eed->v1, eed->v2->tmp.v?eed->v2->tmp.v:eed->v2, eed); if(eed->f & SELECT) { EM_select_edge(eed, 0); @@ -4924,16 +4920,16 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) /* put new vertices & edges && flag in best face */ mesh_rip_setface(em, sefa); - + /* starting with neighbours of best face, we loop over the seam */ sefa->f1= 2; doit= 1; while(doit) { doit= 0; - + for(efa= em->faces.first; efa; efa=efa->next) { /* new vert in face */ - if (efa->v1->tmp.v || efa->v2->tmp.v || + if (efa->v1->tmp.v || efa->v2->tmp.v || efa->v3->tmp.v || (efa->v4 && efa->v4->tmp.v)) { /* face is tagged with loop */ if(efa->f1==1) { @@ -4942,9 +4938,9 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) doit= 1; } } - } + } } - + /* remove loose edges, that were part of a ripped face */ for(eve = em->verts.first; eve; eve= eve->next) eve->f1= 0; for(eed = em->edges.last; eed; eed= eed->prev) eed->f1= 0; @@ -4954,11 +4950,11 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) efa->e3->f1= 1; if(efa->e4) efa->e4->f1= 1; } - + for(eed = em->edges.last; eed; eed= seed) { seed= eed->prev; if(eed->f1==0) { - if(eed->v1->tmp.v || eed->v2->tmp.v || + if(eed->v1->tmp.v || eed->v2->tmp.v || (eed->v1->f & SELECT) || (eed->v2->f & SELECT)) { remedge(em, eed); free_editedge(em, eed); @@ -4970,7 +4966,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) eed->v2->f1= 1; } } - + /* and remove loose selected vertices, that got duplicated accidentally */ for(eve = em->verts.first; eve; eve= nextve) { nextve= eve->next; @@ -4979,17 +4975,15 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) free_editvert(em, eve); } } - + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); BKE_mesh_end_editmesh(obedit->data, em); - RNA_int_set(op->ptr, "mode", TFM_TRANSLATION); - WM_operator_name_call(C, "TFM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr); - -// scene->prop_mode = propmode; -// XXX scene->proportional = prop; + RNA_enum_set(op->ptr, "proportional", 0); + RNA_boolean_set(op->ptr, "mirror", 0); + WM_operator_name_call(C, "TFM_OT_translation", WM_OP_INVOKE_REGION_WIN, op->ptr); return OPERATOR_FINISHED; } @@ -4999,16 +4993,17 @@ void MESH_OT_rip(wmOperatorType *ot) /* identifiers */ ot->name= "Rip"; ot->idname= "MESH_OT_rip"; - + /* api callbacks */ ot->invoke= mesh_rip_invoke; ot->poll= EM_view3d_poll; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - + /* to give to transform */ - RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); + Properties_Proportional(ot); + RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", ""); } @@ -5021,39 +5016,39 @@ void shape_propagate(Scene *scene, Object *obedit, EditMesh *em, wmOperator *op) Key* ky = NULL; KeyBlock* kb = NULL; Base* base=NULL; - - + + if(me->key){ ky = me->key; } else { - BKE_report(op->reports, RPT_ERROR, "Object Has No Key"); + BKE_report(op->reports, RPT_ERROR, "Object Has No Key"); return; - } + } if(ky->block.first){ for(ev = em->verts.first; ev ; ev = ev->next){ if(ev->f & SELECT){ for(kb=ky->block.first;kb;kb = kb->next){ - float *data; - data = kb->data; - VECCOPY(data+(ev->keyindex*3),ev->co); + float *data; + data = kb->data; + VECCOPY(data+(ev->keyindex*3),ev->co); } - } - } + } + } } else { - BKE_report(op->reports, RPT_ERROR, "Object Has No Blendshapes"); - return; + BKE_report(op->reports, RPT_ERROR, "Object Has No Blendshapes"); + return; } - + //TAG Mesh Objects that share this data for(base = scene->base.first; base; base = base->next){ if(base->object && base->object->data == me){ base->object->recalc = OB_RECALC_DATA; } - } + } DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - return; + return; } void shape_copy_from_lerp(EditMesh *em, KeyBlock* thisBlock, KeyBlock* fromBlock) @@ -5063,10 +5058,10 @@ void shape_copy_from_lerp(EditMesh *em, KeyBlock* thisBlock, KeyBlock* fromBlock float perc = 0; char str[64]; float *data, *odata; - + data = fromBlock->data; odata = thisBlock->data; - + // XXX getmouseco_areawin(mval); curval[0] = mval[0] + 1; curval[1] = mval[1] + 1; @@ -5075,55 +5070,55 @@ void shape_copy_from_lerp(EditMesh *em, KeyBlock* thisBlock, KeyBlock* fromBlock // XXX getmouseco_areawin(mval); if (mval[0] != curval[0] || mval[1] != curval[1]) { - + if(mval[0] > curval[0]) perc += 0.1; else if(mval[0] < curval[0]) perc -= 0.1; - + if(perc < 0) perc = 0; if(perc > 1) perc = 1; - + curval[0] = mval[0]; curval[1] = mval[1]; if(fullcopy == 1){ - perc = 1; + perc = 1; } for(ev = em->verts.first; ev ; ev = ev->next){ if(ev->f & SELECT){ VecLerpf(ev->co,odata+(ev->keyindex*3),data+(ev->keyindex*3),perc); - } - } + } + } sprintf(str,"Blending at %d%c MMB to Copy at 100%c",(int)(perc*100),'%','%'); // DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); // headerprint(str); -// force_draw(0); +// force_draw(0); if(fullcopy == 1){ - break; + break; } } else { - PIL_sleep_ms(10); + PIL_sleep_ms(10); } while(qtest()) { - short val=0; - event= extern_qread(&val); + short val=0; + event= extern_qread(&val); if(val){ if(ELEM3(event, PADENTER, LEFTMOUSE, RETKEY)){ finished = 1; } else if (event == MIDDLEMOUSE){ - fullcopy = 1; + fullcopy = 1; } else if (ELEM3(event,ESCKEY,RIGHTMOUSE,RIGHTMOUSE)){ canceled = 1; finished = 1; } - } + } } } if(!canceled); @@ -5131,7 +5126,7 @@ void shape_copy_from_lerp(EditMesh *em, KeyBlock* thisBlock, KeyBlock* fromBlock for(ev = em->verts.first; ev ; ev = ev->next){ if(ev->f & SELECT){ VECCOPY(ev->co, odata+(ev->keyindex*3)); - } + } } return; } @@ -5143,63 +5138,63 @@ void shape_copy_select_from(Object *obedit, EditMesh *em, wmOperator *op) Mesh* me = (Mesh*)obedit->data; EditVert *ev = NULL; int totverts = 0,curshape = obedit->shapenr; - + Key* ky = NULL; KeyBlock *kb = NULL,*thisBlock = NULL; int maxlen=32, nr=0, a=0; char *menu; - + if(me->key){ ky = me->key; } else { - BKE_report(op->reports, RPT_ERROR, "Object Has No Key"); + BKE_report(op->reports, RPT_ERROR, "Object Has No Key"); return; } - + if(ky->block.first){ for(kb=ky->block.first;kb;kb = kb->next){ maxlen += 40; // Size of a block name if(a == curshape-1){ - thisBlock = kb; + thisBlock = kb; } - + a++; } a=0; menu = MEM_callocN(maxlen, "Copy Shape Menu Text"); strcpy(menu, "Copy Vert Positions from Shape %t|"); for(kb=ky->block.first;kb;kb = kb->next){ - if(a != curshape-1){ + if(a != curshape-1){ sprintf(menu,"%s %s %cx%d|",menu,kb->name,'%',a); } a++; } // XXX nr = pupmenu_col(menu, 20); - MEM_freeN(menu); + MEM_freeN(menu); } else { - BKE_report(op->reports, RPT_ERROR, "Object Has No Blendshapes"); - return; + BKE_report(op->reports, RPT_ERROR, "Object Has No Blendshapes"); + return; } - + a = 0; - + for(kb=ky->block.first;kb;kb = kb->next){ if(a == nr){ - + for(ev = em->verts.first;ev;ev = ev->next){ totverts++; } - + if(me->totvert != totverts){ BKE_report(op->reports, RPT_ERROR, "Shape Has had Verts Added/Removed, please cycle editmode before copying"); - return; + return; } - shape_copy_from_lerp(em, thisBlock,kb); - + shape_copy_from_lerp(em, thisBlock,kb); + return; } a++; - } + } return; } @@ -5228,17 +5223,17 @@ static void build_edgecollection(EditMesh *em, ListBase *allcollections) EditEdge *eed; Collection *edgecollection, *newcollection; CollectedEdge *newedge; - + int currtag = 1; short ebalanced = 0; short collectionfound = 0; - - for (eed=em->edges.first; eed; eed = eed->next){ + + for (eed=em->edges.first; eed; eed = eed->next){ eed->tmp.l = 0; eed->v1->tmp.l = 0; eed->v2->tmp.l = 0; } - + /*1st pass*/ for(eed=em->edges.first; eed; eed=eed->next){ if(eed->f&SELECT){ @@ -5247,26 +5242,26 @@ static void build_edgecollection(EditMesh *em, ListBase *allcollections) currtag +=1; } } - + /*2nd pass - Brute force. Loop through selected faces until there are no 'unbalanced' edges left (those with both vertices 'tmp.l' tag matching */ while(ebalanced == 0){ ebalanced = 1; for(eed=em->edges.first; eed; eed = eed->next){ if(eed->f&SELECT){ if(eed->v1->tmp.l != eed->v2->tmp.l) /*unbalanced*/{ - if(eed->v1->tmp.l > eed->v2->tmp.l && eed->v2->tmp.l !=0) eed->v1->tmp.l = eed->v2->tmp.l; - else if(eed->v1 != 0) eed->v2->tmp.l = eed->v1->tmp.l; + if(eed->v1->tmp.l > eed->v2->tmp.l && eed->v2->tmp.l !=0) eed->v1->tmp.l = eed->v2->tmp.l; + else if(eed->v1 != 0) eed->v2->tmp.l = eed->v1->tmp.l; ebalanced = 0; } } } } - + /*3rd pass, set all the edge flags (unnessecary?)*/ for(eed=em->edges.first; eed; eed = eed->next){ if(eed->f&SELECT) eed->tmp.l = eed->v1->tmp.l; } - + for(eed=em->edges.first; eed; eed=eed->next){ if(eed->f&SELECT){ if(allcollections->first){ @@ -5286,28 +5281,28 @@ static void build_edgecollection(EditMesh *em, ListBase *allcollections) newcollection->index = eed->tmp.l; newcollection->collectionbase.first = 0; newcollection->collectionbase.last = 0; - + newedge = MEM_mallocN(sizeof(CollectedEdge), "collected edge"); newedge->eed = eed; - + BLI_addtail(&(newcollection->collectionbase), newedge); BLI_addtail(allcollections, newcollection); } } - + } } static void freecollections(ListBase *allcollections) { struct Collection *curcollection; - + for(curcollection = allcollections->first; curcollection; curcollection = curcollection->next) BLI_freelistN(&(curcollection->collectionbase)); BLI_freelistN(allcollections); } -/*Begin UV Edge Collapse Code +/*Begin UV Edge Collapse Code Like Edge subdivide, Edge Collapse should handle UV's intelligently, but since UV's are a per-face attribute, normal edge collapse will fail in areas such as the boundries of 'UV islands'. So for each edge collection we need to build a set of 'welded' UV vertices and edges for it. The welded UV edges can then be sorted and collapsed. @@ -5337,7 +5332,7 @@ typedef struct wUVEdge{ typedef struct wUVEdgeCollect{ /*used for grouping*/ struct wUVEdgeCollect *next, *prev; wUVEdge *uved; - int id; + int id; } wUVEdgeCollect; static void append_weldedUV(EditMesh *em, EditFace *efa, EditVert *eve, int tfindex, ListBase *uvverts) @@ -5346,9 +5341,9 @@ static void append_weldedUV(EditMesh *em, EditFace *efa, EditVert *eve, int tfin wUVNode *newnode; int found; MTFace *tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - + found = 0; - + for(curwvert=uvverts->first; curwvert; curwvert=curwvert->next){ if(curwvert->eve == eve && curwvert->u == tf->uv[tfindex][0] && curwvert->v == tf->uv[tfindex][1]){ newnode = MEM_callocN(sizeof(wUVNode), "Welded UV Vert Node"); @@ -5359,20 +5354,20 @@ static void append_weldedUV(EditMesh *em, EditFace *efa, EditVert *eve, int tfin break; } } - + if(!found){ newnode = MEM_callocN(sizeof(wUVNode), "Welded UV Vert Node"); newnode->u = &(tf->uv[tfindex][0]); newnode->v = &(tf->uv[tfindex][1]); - + newwvert = MEM_callocN(sizeof(wUV), "Welded UV Vert"); newwvert->u = *(newnode->u); newwvert->v = *(newnode->v); newwvert->eve = eve; - + BLI_addtail(&(newwvert->nodes), newnode); BLI_addtail(uvverts, newwvert); - + } } @@ -5392,14 +5387,14 @@ static void append_weldedUVEdge(EditMesh *em, EditFace *efa, EditEdge *eed, List wUVEdge *curwedge, *newwedge; int v1tfindex, v2tfindex, found; MTFace *tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - + found = 0; - + if(eed->v1 == efa->v1) v1tfindex = 0; else if(eed->v1 == efa->v2) v1tfindex = 1; else if(eed->v1 == efa->v3) v1tfindex = 2; else /* if(eed->v1 == efa->v4) */ v1tfindex = 3; - + if(eed->v2 == efa->v1) v2tfindex = 0; else if(eed->v2 == efa->v2) v2tfindex = 1; else if(eed->v2 == efa->v3) v2tfindex = 2; @@ -5411,7 +5406,7 @@ static void append_weldedUVEdge(EditMesh *em, EditFace *efa, EditEdge *eed, List break; //do nothing, we don't need another welded uv edge } } - + if(!found){ newwedge = MEM_callocN(sizeof(wUVEdge), "Welded UV Edge"); newwedge->v1uv[0] = tf->uv[v1tfindex][0]; @@ -5419,7 +5414,7 @@ static void append_weldedUVEdge(EditMesh *em, EditFace *efa, EditEdge *eed, List newwedge->v2uv[0] = tf->uv[v2tfindex][0]; newwedge->v2uv[1] = tf->uv[v2tfindex][1]; newwedge->eed = eed; - + BLI_addtail(uvedges, newwedge); } } @@ -5429,15 +5424,15 @@ static void build_weldedUVEdges(EditMesh *em, ListBase *uvedges, ListBase *uvver wUV *curwvert; wUVEdge *curwedge; EditFace *efa; - + for(efa=em->faces.first; efa; efa=efa->next){ if(efa->e1->f1) append_weldedUVEdge(em, efa, efa->e1, uvedges); if(efa->e2->f1) append_weldedUVEdge(em, efa, efa->e2, uvedges); if(efa->e3->f1) append_weldedUVEdge(em, efa, efa->e3, uvedges); if(efa->e4 && efa->e4->f1) append_weldedUVEdge(em, efa, efa->e4, uvedges); } - - + + //link vertices: for each uvedge, search uvverts to populate v1 and v2 pointers for(curwedge=uvedges->first; curwedge; curwedge=curwedge->next){ for(curwvert=uvverts->first; curwvert; curwvert=curwvert->next){ @@ -5474,20 +5469,20 @@ static void collapse_edgeuvs(EditMesh *em) if (!EM_texFaceCheck(em)) return; - + uvverts.first = uvverts.last = uvedges.first = uvedges.last = allcollections.first = allcollections.last = NULL; - + build_weldedUVs(em, &uvverts); build_weldedUVEdges(em, &uvedges, &uvverts); - + curtag = 0; - + for(curwedge=uvedges.first; curwedge; curwedge=curwedge->next){ curwedge->v1->f = curtag; curwedge->v2->f = curtag; curtag +=1; } - + balanced = 0; while(!balanced){ balanced = 1; @@ -5499,10 +5494,10 @@ static void collapse_edgeuvs(EditMesh *em) } } } - + for(curwedge=uvedges.first; curwedge; curwedge=curwedge->next) curwedge->f = curwedge->v1->f; - - + + for(curwedge=uvedges.first; curwedge; curwedge=curwedge->next){ if(allcollections.first){ for(wuvecollection = allcollections.first; wuvecollection; wuvecollection=wuvecollection->next){ @@ -5513,7 +5508,7 @@ static void collapse_edgeuvs(EditMesh *em) collectionfound = 1; break; } - + else collectionfound = 0; } } @@ -5522,32 +5517,32 @@ static void collapse_edgeuvs(EditMesh *em) newcollection->index = curwedge->f; newcollection->collectionbase.first = 0; newcollection->collectionbase.last = 0; - + newcollectedwuve = MEM_callocN(sizeof(wUVEdgeCollect), "Collected Welded UV Edge"); newcollectedwuve->uved = curwedge; - + BLI_addtail(&(newcollection->collectionbase), newcollectedwuve); BLI_addtail(&allcollections, newcollection); } } - + for(wuvecollection=allcollections.first; wuvecollection; wuvecollection=wuvecollection->next){ - + vcount = avg[0] = avg[1] = 0; - + for(collectedwuve= wuvecollection->collectionbase.first; collectedwuve; collectedwuve = collectedwuve->next){ avg[0] += collectedwuve->uved->v1uv[0]; avg[1] += collectedwuve->uved->v1uv[1]; - + avg[0] += collectedwuve->uved->v2uv[0]; avg[1] += collectedwuve->uved->v2uv[1]; - + vcount +=2; - + } - + avg[0] /= vcount; avg[1] /= vcount; - + for(collectedwuve= wuvecollection->collectionbase.first; collectedwuve; collectedwuve = collectedwuve->next){ for(curwnode=collectedwuve->uved->v1->nodes.first; curwnode; curwnode=curwnode->next){ *(curwnode->u) = avg[0]; @@ -5559,7 +5554,7 @@ static void collapse_edgeuvs(EditMesh *em) } } } - + free_weldedUVs(&uvverts); BLI_freelistN(&uvedges); freecollections(&allcollections); @@ -5576,11 +5571,11 @@ static void collapseuvs(EditMesh *em, EditVert *mergevert) if (!EM_texFaceCheck(em)) return; - + uvcount = 0; uvav[0] = 0; uvav[1] = 0; - + for(efa = em->faces.first; efa; efa=efa->next){ tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); @@ -5590,7 +5585,7 @@ static void collapseuvs(EditMesh *em, EditVert *mergevert) uvcount += 1; } if(efa->v2->f1 && ELEM(mergevert, NULL, efa->v2)){ - uvav[0] += tf->uv[1][0]; + uvav[0] += tf->uv[1][0]; uvav[1] += tf->uv[1][1]; uvcount += 1; } @@ -5605,11 +5600,11 @@ static void collapseuvs(EditMesh *em, EditVert *mergevert) uvcount += 1; } } - + if(uvcount > 0) { - uvav[0] /= uvcount; + uvav[0] /= uvcount; uvav[1] /= uvcount; - + for(efa = em->faces.first; efa; efa=efa->next){ tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); @@ -5618,7 +5613,7 @@ static void collapseuvs(EditMesh *em, EditVert *mergevert) tf->uv[0][1] = uvav[1]; } if(efa->v2->f1){ - tf->uv[1][0] = uvav[0]; + tf->uv[1][0] = uvav[0]; tf->uv[1][1] = uvav[1]; } if(efa->v3->f1){ @@ -5637,49 +5632,49 @@ int collapseEdges(EditMesh *em) { EditVert *eve; EditEdge *eed; - + ListBase allcollections; CollectedEdge *curredge; Collection *edgecollection; - + int totedges, groupcount, mergecount,vcount; float avgcount[3]; - + allcollections.first = 0; allcollections.last = 0; - + mergecount = 0; - + build_edgecollection(em, &allcollections); groupcount = BLI_countlist(&allcollections); - - + + for(edgecollection = allcollections.first; edgecollection; edgecollection = edgecollection->next){ totedges = BLI_countlist(&(edgecollection->collectionbase)); mergecount += totedges; avgcount[0] = 0; avgcount[1] = 0; avgcount[2] = 0; - + vcount = 0; - + for(curredge = edgecollection->collectionbase.first; curredge; curredge = curredge->next){ avgcount[0] += ((EditEdge*)curredge->eed)->v1->co[0]; avgcount[1] += ((EditEdge*)curredge->eed)->v1->co[1]; avgcount[2] += ((EditEdge*)curredge->eed)->v1->co[2]; - + avgcount[0] += ((EditEdge*)curredge->eed)->v2->co[0]; avgcount[1] += ((EditEdge*)curredge->eed)->v2->co[1]; avgcount[2] += ((EditEdge*)curredge->eed)->v2->co[2]; - + vcount +=2; } - + avgcount[0] /= vcount; avgcount[1] /=vcount; avgcount[2] /= vcount; - + for(curredge = edgecollection->collectionbase.first; curredge; curredge = curredge->next){ VECCOPY(((EditEdge*)curredge->eed)->v1->co,avgcount); VECCOPY(((EditEdge*)curredge->eed)->v2->co,avgcount); } - + if (EM_texFaceCheck(em)) { /*uv collapse*/ for(eve=em->verts.first; eve; eve=eve->next) eve->f1 = 0; @@ -5691,7 +5686,7 @@ int collapseEdges(EditMesh *em) } collapse_edgeuvs(em); } - + } freecollections(&allcollections); removedoublesflag(em, 1, 0, MERGELIMIT); @@ -5703,44 +5698,44 @@ int merge_firstlast(EditMesh *em, int first, int uvmerge) { EditVert *eve,*mergevert; EditSelection *ese; - + /* do sanity check in mergemenu in edit.c ?*/ - if(first == 0){ + if(first == 0){ ese = em->selected.last; mergevert= (EditVert*)ese->data; } - else{ + else{ ese = em->selected.first; mergevert = (EditVert*)ese->data; } - + if(mergevert->f&SELECT){ for (eve=em->verts.first; eve; eve=eve->next){ if (eve->f&SELECT) VECCOPY(eve->co,mergevert->co); } } - + if(uvmerge && CustomData_has_layer(&em->fdata, CD_MTFACE)){ - + for(eve=em->verts.first; eve; eve=eve->next) eve->f1 = 0; for(eve=em->verts.first; eve; eve=eve->next){ if(eve->f&SELECT) eve->f1 = 1; } collapseuvs(em, mergevert); } - + return removedoublesflag(em, 1, 0, MERGELIMIT); } int merge_target(EditMesh *em, int target, int uvmerge) { EditVert *eve; - + // XXX not working if(target) snap_sel_to_curs(); else snap_to_center(); - + if(uvmerge && CustomData_has_layer(&em->fdata, CD_MTFACE)){ for(eve=em->verts.first; eve; eve=eve->next) eve->f1 = 0; for(eve=em->verts.first; eve; eve=eve->next){ @@ -5804,19 +5799,19 @@ static EnumPropertyItem *merge_type_itemf(bContext *C, PointerRNA *ptr, int *fre Object *obedit= CTX_data_edit_object(C); if(obedit && obedit->type == OB_MESH) { - EditMesh *em= BKE_mesh_get_editmesh(obedit->data); + EditMesh *em= BKE_mesh_get_editmesh(obedit->data); EnumPropertyItem *item= NULL; int totitem= 0; if(em->selectmode & SCE_SELECT_VERTEX) { - if(em->selected.first && em->selected.last && + if(em->selected.first && em->selected.last && ((EditSelection*)em->selected.first)->type == EDITVERT && ((EditSelection*)em->selected.last)->type == EDITVERT) { RNA_enum_item_add(&item, &totitem, &merge_type_items[0]); RNA_enum_item_add(&item, &totitem, &merge_type_items[1]); } - else if(em->selected.first && ((EditSelection*)em->selected.first)->type == EDITVERT) + else if(em->selected.first && ((EditSelection*)em->selected.first)->type == EDITVERT) RNA_enum_item_add(&item, &totitem, &merge_type_items[1]); - else if(em->selected.last && ((EditSelection*)em->selected.last)->type == EDITVERT) + else if(em->selected.last && ((EditSelection*)em->selected.last)->type == EDITVERT) RNA_enum_item_add(&item, &totitem, &merge_type_items[0]); } @@ -5840,12 +5835,12 @@ void MESH_OT_merge(wmOperatorType *ot) /* identifiers */ ot->name= "Merge"; ot->idname= "MESH_OT_merge"; - + /* api callbacks */ ot->exec= merge_exec; ot->invoke= WM_menu_invoke; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -5887,30 +5882,30 @@ int select_vertex_path_exec(bContext *C, wmOperator *op) short physical; float *cost; Heap *heap; /*binary heap for sorting pointers to PathNodes based upon a 'cost'*/ - + s = t = NULL; - + ese = ((EditSelection*)em->selected.last); if(ese && ese->type == EDITVERT && ese->prev && ese->prev->type == EDITVERT){ physical= pupmenu("Distance Method? %t|Edge Length%x1|Topological%x0"); - + t = (EditVert*)ese->data; s = (EditVert*)ese->prev->data; - + /*need to find out if t is actually reachable by s....*/ - for(eve=em->verts.first; eve; eve=eve->next){ + for(eve=em->verts.first; eve; eve=eve->next){ eve->f1 = 0; } - + s->f1 = 1; - + unbalanced = 1; totnodes = 1; while(unbalanced){ unbalanced = 0; for(eed=em->edges.first; eed; eed=eed->next){ if(!eed->h){ - if(eed->v1->f1 && !eed->v2->f1){ + if(eed->v1->f1 && !eed->v2->f1){ eed->v2->f1 = 1; totnodes++; unbalanced = 1; @@ -5923,7 +5918,7 @@ int select_vertex_path_exec(bContext *C, wmOperator *op) } } } - + if(s->f1 && t->f1){ /* t can be reached by s */ Q = MEM_callocN(sizeof(PathNode)*totnodes, "Path Select Nodes"); totnodes = 0; @@ -5938,12 +5933,12 @@ int select_vertex_path_exec(bContext *C, wmOperator *op) } else eve->tmp.p = NULL; } - + for(eed=em->edges.first; eed; eed=eed->next){ if(!eed->h){ if(eed->v1->f1){ currpn = ((PathNode*)eed->v1->tmp.p); - + newpe = MEM_mallocN(sizeof(PathEdge), "Path Edge"); newpe->v = ((PathNode*)eed->v2->tmp.p)->u; if(physical){ @@ -5953,9 +5948,9 @@ int select_vertex_path_exec(bContext *C, wmOperator *op) newpe->next = 0; newpe->prev = 0; BLI_addtail(&(currpn->edges), newpe); - } + } if(eed->v2->f1){ - currpn = ((PathNode*)eed->v2->tmp.p); + currpn = ((PathNode*)eed->v2->tmp.p); newpe = MEM_mallocN(sizeof(PathEdge), "Path Edge"); newpe->v = ((PathNode*)eed->v1->tmp.p)->u; if(physical){ @@ -5968,28 +5963,28 @@ int select_vertex_path_exec(bContext *C, wmOperator *op) } } } - + heap = BLI_heap_new(); cost = MEM_callocN(sizeof(float)*totnodes, "Path Select Costs"); previous = MEM_callocN(sizeof(int)*totnodes, "PathNode indices"); - + for(v=0; v < totnodes; v++){ cost[v] = 1000000; previous[v] = -1; /*array of indices*/ } - + pnindex = ((PathNode*)s->tmp.p)->u; cost[pnindex] = 0; BLI_heap_insert(heap, 0.0f, SET_INT_IN_POINTER(pnindex)); - + while( !BLI_heap_empty(heap) ){ - + pnindex = GET_INT_FROM_POINTER(BLI_heap_popmin(heap)); currpn = &(Q[pnindex]); - + if(currpn == (PathNode*)t->tmp.p) /*target has been reached....*/ break; - + for(currpe=currpn->edges.first; currpe; currpe=currpe->next){ if(!Q[currpe->v].visited){ if( cost[currpe->v] > (cost[currpn->u ] + currpe->w) ){ @@ -6001,7 +5996,7 @@ int select_vertex_path_exec(bContext *C, wmOperator *op) } } } - + pathvert = ((PathNode*)t->tmp.p)->u; while(pathvert != -1){ for(eve=em->verts.first; eve; eve=eve->next){ @@ -6011,7 +6006,7 @@ int select_vertex_path_exec(bContext *C, wmOperator *op) } pathvert = previous[pathvert]; } - + for(v=0; v < totnodes; v++) BLI_freelistN(&(Q[v].edges)); MEM_freeN(Q); MEM_freeN(cost); @@ -6025,7 +6020,7 @@ int select_vertex_path_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_ERROR, "Path Selection requires that exactly two vertices be selected"); return OPERATOR_CANCELLED; } - + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); BKE_mesh_end_editmesh(obedit->data, em); @@ -6042,12 +6037,12 @@ void MESH_OT_select_vertex_path(wmOperatorType *ot) /* identifiers */ ot->name= "Select Vertex Path"; ot->idname= "MESH_OT_select_vertex_path"; - + /* api callbacks */ ot->exec= select_vertex_path_exec; ot->invoke= WM_menu_invoke; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -6064,9 +6059,9 @@ static int region_to_loop(bContext *C, wmOperator *op) EditEdge *eed; EditFace *efa; int selected= 0; - + for(eed=em->edges.first; eed; eed=eed->next) eed->f1 = 0; - + for(efa=em->faces.first; efa; efa=efa->next){ if(efa->f&SELECT){ efa->e1->f1++; @@ -6081,20 +6076,20 @@ static int region_to_loop(bContext *C, wmOperator *op) if(!selected) return OPERATOR_CANCELLED; - + EM_clear_flag_all(em, SELECT); - + for(eed=em->edges.first; eed; eed=eed->next){ if(eed->f1 == 1) EM_select_edge(eed, 1); } - + em->selectmode = SCE_SELECT_EDGE; EM_selectmode_set(em); - + BKE_mesh_end_editmesh(obedit->data, em); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - + return OPERATOR_FINISHED; } @@ -6103,11 +6098,11 @@ void MESH_OT_region_to_loop(wmOperatorType *ot) /* identifiers */ ot->name= "Region to Loop"; ot->idname= "MESH_OT_region_to_loop"; - + /* api callbacks */ ot->exec= region_to_loop; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -6117,7 +6112,7 @@ static int validate_loop(EditMesh *em, Collection *edgecollection) EditEdge *eed; EditFace *efa; CollectedEdge *curredge; - + /*1st test*/ for(curredge = (CollectedEdge*)edgecollection->collectionbase.first; curredge; curredge=curredge->next){ curredge->eed->v1->f1 = 0; @@ -6131,7 +6126,7 @@ static int validate_loop(EditMesh *em, Collection *edgecollection) if(curredge->eed->v1->f1 > 2) return(0); else if(curredge->eed->v2->f1 > 2) return(0); } - + /*2nd test*/ for(eed = em->edges.first; eed; eed=eed->next) eed->f1 = 0; for(efa=em->faces.first; efa; efa=efa->next){ @@ -6147,20 +6142,20 @@ static int validate_loop(EditMesh *em, Collection *edgecollection) } static int loop_bisect(EditMesh *em, Collection *edgecollection){ - + EditFace *efa, *sf1, *sf2; EditEdge *eed, *sed; CollectedEdge *curredge; int totsf1, totsf2, unbalanced,balancededges; - + for(eed=em->edges.first; eed; eed=eed->next) eed->f1 = eed->f2 = 0; - for(efa=em->faces.first; efa; efa=efa->next) efa->f1 = 0; - + for(efa=em->faces.first; efa; efa=efa->next) efa->f1 = 0; + for(curredge = (CollectedEdge*)edgecollection->collectionbase.first; curredge; curredge=curredge->next) curredge->eed->f1 = 1; - + sf1 = sf2 = NULL; sed = ((CollectedEdge*)edgecollection->collectionbase.first)->eed; - + for(efa=em->faces.first; efa; efa=efa->next){ if(sf2) break; else if(sf1){ @@ -6170,24 +6165,24 @@ static int loop_bisect(EditMesh *em, Collection *edgecollection){ if(efa->e1 == sed || efa->e2 == sed || efa->e3 == sed || ( (efa->e4) ? efa->e4 == sed : 0) ) sf1 = efa; } } - + if(sf1==NULL || sf2==NULL) return(-1); - + if(!(sf1->e1->f1)) sf1->e1->f2 = 1; if(!(sf1->e2->f1)) sf1->e2->f2 = 1; if(!(sf1->e3->f1)) sf1->e3->f2 = 1; if(sf1->e4 && !(sf1->e4->f1)) sf1->e4->f2 = 1; sf1->f1 = 1; totsf1 = 1; - + if(!(sf2->e1->f1)) sf2->e1->f2 = 2; if(!(sf2->e2->f1)) sf2->e2->f2 = 2; if(!(sf2->e3->f1)) sf2->e3->f2 = 2; if(sf2->e4 && !(sf2->e4->f1)) sf2->e4->f2 = 2; sf2->f1 = 2; totsf2 = 1; - + /*do sf1*/ unbalanced = 1; while(unbalanced){ @@ -6209,7 +6204,7 @@ static int loop_bisect(EditMesh *em, Collection *edgecollection){ } } } - + /*do sf2*/ unbalanced = 1; while(unbalanced){ @@ -6231,7 +6226,7 @@ static int loop_bisect(EditMesh *em, Collection *edgecollection){ } } } - + if(totsf1 < totsf2) return(1); else return(2); } @@ -6246,9 +6241,9 @@ static int loop_to_region(bContext *C, wmOperator *op) ListBase allcollections={NULL,NULL}; Collection *edgecollection; int testflag; - + build_edgecollection(em, &allcollections); - + for(edgecollection = (Collection *)allcollections.first; edgecollection; edgecollection=edgecollection->next){ if(validate_loop(em, edgecollection)){ testflag = loop_bisect(em, edgecollection); @@ -6260,11 +6255,11 @@ static int loop_to_region(bContext *C, wmOperator *op) } } } - + for(efa=em->faces.first; efa; efa=efa->next){ /*fix this*/ if(efa->f&SELECT) EM_select_face(efa,1); } - + freecollections(&allcollections); BKE_mesh_end_editmesh(obedit->data, em); @@ -6278,11 +6273,11 @@ void MESH_OT_loop_to_region(wmOperatorType *ot) /* identifiers */ ot->name= "Loop to Region"; ot->idname= "MESH_OT_loop_to_region"; - + /* api callbacks */ ot->exec= loop_to_region; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -6309,41 +6304,41 @@ static int mesh_rotate_uvs(bContext *C, wmOperator *op) BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } - + for(efa=em->faces.first; efa; efa=efa->next) { if (efa->f & SELECT) { tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); u1= tf->uv[0][0]; v1= tf->uv[0][1]; - + if (dir == DIRECTION_CCW) { if(efa->v4) { tf->uv[0][0]= tf->uv[3][0]; tf->uv[0][1]= tf->uv[3][1]; - + tf->uv[3][0]= tf->uv[2][0]; tf->uv[3][1]= tf->uv[2][1]; } else { tf->uv[0][0]= tf->uv[2][0]; tf->uv[0][1]= tf->uv[2][1]; } - + tf->uv[2][0]= tf->uv[1][0]; tf->uv[2][1]= tf->uv[1][1]; - + tf->uv[1][0]= u1; tf->uv[1][1]= v1; - } else { + } else { tf->uv[0][0]= tf->uv[1][0]; tf->uv[0][1]= tf->uv[1][1]; - + tf->uv[1][0]= tf->uv[2][0]; tf->uv[1][1]= tf->uv[2][1]; - + if(efa->v4) { tf->uv[2][0]= tf->uv[3][0]; tf->uv[2][1]= tf->uv[3][1]; - + tf->uv[3][0]= u1; tf->uv[3][1]= v1; } @@ -6355,7 +6350,7 @@ static int mesh_rotate_uvs(bContext *C, wmOperator *op) change = 1; } } - + BKE_mesh_end_editmesh(obedit->data, em); if(!change) @@ -6363,7 +6358,7 @@ static int mesh_rotate_uvs(bContext *C, wmOperator *op) DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - + return OPERATOR_FINISHED; } @@ -6378,13 +6373,13 @@ static int mesh_mirror_uvs(bContext *C, wmOperator *op) MTFace *tf; float u1, v1; int axis= RNA_enum_get(op->ptr, "axis"); - + if (!EM_texFaceCheck(em)) { BKE_report(op->reports, RPT_ERROR, "Mesh has no uv/image layers."); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } - + for(efa=em->faces.first; efa; efa=efa->next) { if (efa->f & SELECT) { tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); @@ -6392,10 +6387,10 @@ static int mesh_mirror_uvs(bContext *C, wmOperator *op) u1= tf->uv[1][0]; v1= tf->uv[1][1]; if(efa->v4) { - + tf->uv[1][0]= tf->uv[2][0]; tf->uv[1][1]= tf->uv[2][1]; - + tf->uv[2][0]= u1; tf->uv[2][1]= v1; @@ -6404,7 +6399,7 @@ static int mesh_mirror_uvs(bContext *C, wmOperator *op) tf->uv[3][0]= tf->uv[0][0]; tf->uv[3][1]= tf->uv[0][1]; - + tf->uv[0][0]= u1; tf->uv[0][1]= v1; } @@ -6414,15 +6409,15 @@ static int mesh_mirror_uvs(bContext *C, wmOperator *op) tf->uv[2][0]= u1; tf->uv[2][1]= v1; } - + } else { u1= tf->uv[0][0]; v1= tf->uv[0][1]; if(efa->v4) { - + tf->uv[0][0]= tf->uv[1][0]; tf->uv[0][1]= tf->uv[1][1]; - + tf->uv[1][0]= u1; tf->uv[1][1]= v1; @@ -6431,7 +6426,7 @@ static int mesh_mirror_uvs(bContext *C, wmOperator *op) tf->uv[3][0]= tf->uv[2][0]; tf->uv[3][1]= tf->uv[2][1]; - + tf->uv[2][0]= u1; tf->uv[2][1]= v1; } @@ -6445,7 +6440,7 @@ static int mesh_mirror_uvs(bContext *C, wmOperator *op) change = 1; } } - + BKE_mesh_end_editmesh(obedit->data, em); if(!change) @@ -6467,18 +6462,18 @@ static int mesh_rotate_colors(bContext *C, wmOperator *op) short change = 0; MCol tmpcol, *mcol; int dir= RNA_enum_get(op->ptr, "direction"); - + if (!EM_vertColorCheck(em)) { BKE_report(op->reports, RPT_ERROR, "Mesh has no color layers."); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } - + for(efa=em->faces.first; efa; efa=efa->next) { if (efa->f & SELECT) { mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); tmpcol= mcol[0]; - + if (dir == DIRECTION_CCW) { if(efa->v4) { mcol[0]= mcol[3]; @@ -6491,7 +6486,7 @@ static int mesh_rotate_colors(bContext *C, wmOperator *op) } else { mcol[0]= mcol[1]; mcol[1]= mcol[2]; - + if(efa->v4) { mcol[2]= mcol[3]; mcol[3]= tmpcol; @@ -6502,7 +6497,7 @@ static int mesh_rotate_colors(bContext *C, wmOperator *op) change = 1; } } - + BKE_mesh_end_editmesh(obedit->data, em); if(!change) @@ -6525,13 +6520,13 @@ static int mesh_mirror_colors(bContext *C, wmOperator *op) short change = 0; MCol tmpcol, *mcol; int axis= RNA_enum_get(op->ptr, "axis"); - + if (!EM_vertColorCheck(em)) { BKE_report(op->reports, RPT_ERROR, "Mesh has no color layers"); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_CANCELLED; } - + for(efa=em->faces.first; efa; efa=efa->next) { if (efa->f & SELECT) { mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); @@ -6539,7 +6534,7 @@ static int mesh_mirror_colors(bContext *C, wmOperator *op) tmpcol= mcol[1]; mcol[1]= mcol[2]; mcol[2]= tmpcol; - + if(efa->v4) { tmpcol= mcol[0]; mcol[0]= mcol[3]; @@ -6549,7 +6544,7 @@ static int mesh_mirror_colors(bContext *C, wmOperator *op) tmpcol= mcol[0]; mcol[0]= mcol[1]; mcol[1]= tmpcol; - + if(efa->v4) { tmpcol= mcol[2]; mcol[2]= mcol[3]; @@ -6559,7 +6554,7 @@ static int mesh_mirror_colors(bContext *C, wmOperator *op) change = 1; } } - + BKE_mesh_end_editmesh(obedit->data, em); if(!change) @@ -6576,11 +6571,11 @@ void MESH_OT_uvs_rotate(wmOperatorType *ot) /* identifiers */ ot->name= "Rotate UVs"; ot->idname= "MESH_OT_uvs_rotate"; - + /* api callbacks */ ot->exec= mesh_rotate_uvs; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -6593,14 +6588,14 @@ void MESH_OT_uvs_mirror(wmOperatorType *ot) /* identifiers */ ot->name= "Mirror UVs"; ot->idname= "MESH_OT_uvs_mirror"; - + /* api callbacks */ ot->exec= mesh_mirror_uvs; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - + /* props */ RNA_def_enum(ot->srna, "axis", axis_items, DIRECTION_CW, "Axis", "Axis to mirror UVs around."); } @@ -6610,14 +6605,14 @@ void MESH_OT_colors_rotate(wmOperatorType *ot) /* identifiers */ ot->name= "Rotate Colors"; ot->idname= "MESH_OT_colors_rotate"; - + /* api callbacks */ ot->exec= mesh_rotate_colors; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - + /* props */ RNA_def_enum(ot->srna, "direction", direction_items, DIRECTION_CW, "Direction", "Direction to rotate edge around."); } @@ -6627,14 +6622,14 @@ void MESH_OT_colors_mirror(wmOperatorType *ot) /* identifiers */ ot->name= "Mirror Colors"; ot->idname= "MESH_OT_colors_mirror"; - + /* api callbacks */ ot->exec= mesh_mirror_colors; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - + /* props */ RNA_def_enum(ot->srna, "axis", axis_items, DIRECTION_CW, "Axis", "Axis to mirror colors around."); } @@ -6642,7 +6637,7 @@ void MESH_OT_colors_mirror(wmOperatorType *ot) /********************** Subdivide Operator *************************/ static int subdivide_exec(bContext *C, wmOperator *op) -{ +{ Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -6660,7 +6655,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - + return OPERATOR_FINISHED; } @@ -6669,14 +6664,14 @@ void MESH_OT_subdivide(wmOperatorType *ot) /* identifiers */ ot->name= "Subdivide"; ot->idname= "MESH_OT_subdivide"; - + /* api callbacks */ ot->exec= subdivide_exec; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - + /* properties */ RNA_def_int(ot->srna, "number_cuts", 1, 1, 10, "Number of Cuts", "", 1, INT_MAX); RNA_def_float(ot->srna, "fractal", 0.0, 0.0f, FLT_MAX, "Fractal", "Fractal randomness factor.", 0.0f, 1000.0f); @@ -6698,39 +6693,39 @@ static void beauty_fill(EditMesh *em) EVPtr *efaa; float len1, len2, len3, len4, len5, len6, opp1, opp2, fac1, fac2; int totedge, ok, notbeauty=8, onedone, vindex[4]; - + /* - all selected edges with two faces * - find the faces: store them in edges (using datablock) * - per edge: - test convex * - test edge: flip? * - if true: remedge, addedge, all edges at the edge get new face pointers */ - - EM_selectmode_set(em); // makes sure in selectmode 'face' the edges of selected faces are selected too - + + EM_selectmode_set(em); // makes sure in selectmode 'face' the edges of selected faces are selected too + totedge = count_selected_edges(em->edges.first); if(totedge==0) return; - + /* temp block with face pointers */ efaar= (EVPTuple *) MEM_callocN(totedge * sizeof(EVPTuple), "beautyfill"); - + while (notbeauty) { notbeauty--; - + ok = collect_quadedges(efaar, em->edges.first, em->faces.first); - + /* there we go */ onedone= 0; - + eed= em->edges.first; while(eed) { nexted= eed->next; - + /* f2 is set in collect_quadedges() */ if(eed->f2==2 && eed->h==0) { - + efaa = (EVPtr *) eed->tmp.p; - + /* none of the faces should be treated before, nor be part of fgon */ ok= 1; efa= efaa[0]; @@ -6739,13 +6734,13 @@ static void beauty_fill(EditMesh *em) efa= efaa[1]; if(efa->e1->f1 || efa->e2->f1 || efa->e3->f1) ok= 0; if(efa->fgonf) ok= 0; - + if(ok) { /* test convex */ givequadverts(efaa[0], efaa[1], &v1, &v2, &v3, &v4, vindex); if(v1 && v2 && v3 && v4) { if( convex(v1->co, v2->co, v3->co, v4->co) ) { - + /* test edges */ if( (v1) > (v3) ) { dia1.v1= v3; @@ -6755,7 +6750,7 @@ static void beauty_fill(EditMesh *em) dia1.v1= v1; dia1.v2= v3; } - + if( (v2) > (v4) ) { dia2.v1= v4; dia2.v2= v2; @@ -6764,28 +6759,28 @@ static void beauty_fill(EditMesh *em) dia2.v1= v2; dia2.v2= v4; } - + /* testing rule: * the area divided by the total edge lengths */ - + len1= VecLenf(v1->co, v2->co); len2= VecLenf(v2->co, v3->co); len3= VecLenf(v3->co, v4->co); len4= VecLenf(v4->co, v1->co); len5= VecLenf(v1->co, v3->co); len6= VecLenf(v2->co, v4->co); - + opp1= AreaT3Dfl(v1->co, v2->co, v3->co); opp2= AreaT3Dfl(v1->co, v3->co, v4->co); - + fac1= opp1/(len1+len2+len5) + opp2/(len3+len4+len5); - + opp1= AreaT3Dfl(v2->co, v3->co, v4->co); opp2= AreaT3Dfl(v2->co, v4->co, v1->co); - + fac2= opp1/(len2+len3+len6) + opp2/(len4+len1+len6); - + ok= 0; if(fac1 > fac2) { if(dia2.v1==eed->v1 && dia2.v2==eed->v2) { @@ -6794,16 +6789,16 @@ static void beauty_fill(EditMesh *em) efa->f1= 1; efa= efaa[1]; efa->f1= 1; - + w= EM_face_from_faces(em, efaa[0], efaa[1], vindex[0], vindex[1], 4+vindex[2], -1); w->f |= SELECT; - - + + w= EM_face_from_faces(em, efaa[0], efaa[1], vindex[0], 4+vindex[2], 4+vindex[3], -1); w->f |= SELECT; - + onedone= 1; } } @@ -6814,39 +6809,39 @@ static void beauty_fill(EditMesh *em) efa->f1= 1; efa= efaa[1]; efa->f1= 1; - - + + w= EM_face_from_faces(em, efaa[0], efaa[1], vindex[1], 4+vindex[2], 4+vindex[3], -1); w->f |= SELECT; - - + + w= EM_face_from_faces(em, efaa[0], efaa[1], vindex[0], 4+vindex[1], 4+vindex[3], -1); w->f |= SELECT; - + onedone= 1; } } } } } - + } eed= nexted; } - + free_tagged_edges_faces(em, em->edges.first, em->faces.first); - + if(onedone==0) break; - + EM_selectmode_set(em); // new edges/faces were added } - + MEM_freeN(efaar); - + EM_select_flush(em); - + } /* Got this from scanfill.c. You will need to juggle around the @@ -6857,10 +6852,10 @@ static void fill_mesh(EditMesh *em) EditEdge *eed,*e1,*nexted; EditFace *efa,*nextvl, *efan; short ok; - + if(em==NULL) return; waitcursor(1); - + /* copy all selected vertices */ eve= em->verts.first; while(eve) { @@ -6877,7 +6872,7 @@ static void fill_mesh(EditMesh *em) while(eed) { if( (eed->v1->f & SELECT) && (eed->v2->f & SELECT) ) { e1= BLI_addfilledge(eed->v1->tmp.v, eed->v2->tmp.v); - e1->v1->xs++; + e1->v1->xs++; e1->v2->xs++; } eed= eed->next; @@ -6895,7 +6890,7 @@ static void fill_mesh(EditMesh *em) efa->v3->tmp.v->xs--; if(efa->v4) efa->v4->tmp.v->xs--; ok= 1; - + } efa= nextvl; } @@ -6914,7 +6909,7 @@ static void fill_mesh(EditMesh *em) efa= fillfacebase.first; while(efa) { /* normals default pointing up */ - efan= addfacelist(em, efa->v3->tmp.v, efa->v2->tmp.v, + efan= addfacelist(em, efa->v3->tmp.v, efa->v2->tmp.v, efa->v1->tmp.v, 0, NULL, NULL); if(efan) EM_select_face(efan, 1); efa= efa->next; @@ -6934,16 +6929,16 @@ static int fill_mesh_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - + fill_mesh(em); BKE_mesh_end_editmesh(obedit->data, em); DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - + return OPERATOR_FINISHED; - + } void MESH_OT_fill(wmOperatorType *ot) @@ -6951,11 +6946,11 @@ void MESH_OT_fill(wmOperatorType *ot) /* identifiers */ ot->name= "Fill"; ot->idname= "MESH_OT_fill"; - + /* api callbacks */ ot->exec= fill_mesh_exec; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -6965,14 +6960,14 @@ static int beauty_fill_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - + beauty_fill(em); - + BKE_mesh_end_editmesh(obedit->data, em); DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - + return OPERATOR_FINISHED; } @@ -6981,11 +6976,11 @@ void MESH_OT_beauty_fill(wmOperatorType *ot) /* identifiers */ ot->name= "Beauty Fill"; ot->idname= "MESH_OT_beauty_fill"; - + /* api callbacks */ ot->exec= beauty_fill_exec; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -6997,12 +6992,12 @@ static int quads_convert_to_tris_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - + convert_to_triface(em,0); - + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - + BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -7012,11 +7007,11 @@ void MESH_OT_quads_convert_to_tris(wmOperatorType *ot) /* identifiers */ ot->name= "Quads to Tris"; ot->idname= "MESH_OT_quads_convert_to_tris"; - + /* api callbacks */ ot->exec= quads_convert_to_tris_exec; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -7028,10 +7023,10 @@ static int tris_convert_to_quads_exec(bContext *C, wmOperator *op) EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); join_triangles(em); - + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - + BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -7041,11 +7036,11 @@ void MESH_OT_tris_convert_to_quads(wmOperatorType *ot) /* identifiers */ ot->name= "Tris to Quads"; ot->idname= "MESH_OT_tris_convert_to_quads"; - + /* api callbacks */ ot->exec= tris_convert_to_quads_exec; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -7055,12 +7050,12 @@ static int edge_flip_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - + edge_flip(em); - + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - + BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -7070,11 +7065,11 @@ void MESH_OT_edge_flip(wmOperatorType *ot) /* identifiers */ ot->name= "Edge Flip"; ot->idname= "MESH_OT_edge_flip"; - + /* api callbacks */ ot->exec= edge_flip_exec; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -7086,7 +7081,7 @@ void mesh_set_smooth_faces(EditMesh *em, short smooth) EditFace *efa; if(em==NULL) return; - + for(efa= em->faces.first; efa; efa=efa->next) { if(efa->f & SELECT) { if(smooth) efa->flag |= ME_SMOOTH; @@ -7100,14 +7095,14 @@ static int mesh_faces_shade_smooth_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - + mesh_set_smooth_faces(em, 1); - + BKE_mesh_end_editmesh(obedit->data, em); DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - + return OPERATOR_FINISHED; } @@ -7116,11 +7111,11 @@ void MESH_OT_faces_shade_smooth(wmOperatorType *ot) /* identifiers */ ot->name= "Shade Smooth"; ot->idname= "MESH_OT_faces_shade_smooth"; - + /* api callbacks */ ot->exec= mesh_faces_shade_smooth_exec; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -7130,12 +7125,12 @@ static int mesh_faces_shade_solid_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); - + mesh_set_smooth_faces(em, 0); - + DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - + return OPERATOR_FINISHED; } @@ -7144,11 +7139,11 @@ void MESH_OT_faces_shade_solid(wmOperatorType *ot) /* identifiers */ ot->name= "Shade Flat"; ot->idname= "MESH_OT_faces_shade_solid"; - + /* api callbacks */ ot->exec= mesh_faces_shade_solid_exec; ot->poll= ED_operator_editmesh; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 016400e0fa9..888a15e2534 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -123,7 +123,7 @@ void setTransformViewMatrices(TransInfo *t) { if(t->spacetype==SPACE_VIEW3D && t->ar->regiontype == RGN_TYPE_WINDOW) { RegionView3D *rv3d = t->ar->regiondata; - + Mat4CpyMat4(t->viewmat, rv3d->viewmat); Mat4CpyMat4(t->viewinv, rv3d->viewinv); Mat4CpyMat4(t->persmat, rv3d->persmat); @@ -137,7 +137,7 @@ void setTransformViewMatrices(TransInfo *t) Mat4One(t->persinv); t->persp = V3D_ORTHO; } - + calculateCenter2D(t); } @@ -152,12 +152,12 @@ void convertViewVec(TransInfo *t, float *vec, short dx, short dy) else if(t->spacetype==SPACE_IMAGE) { View2D *v2d = t->view; float divx, divy, aspx, aspy; - + ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy); - + divx= v2d->mask.xmax-v2d->mask.xmin; divy= v2d->mask.ymax-v2d->mask.ymin; - + vec[0]= aspx*(v2d->cur.xmax-v2d->cur.xmin)*(dx)/divx; vec[1]= aspy*(v2d->cur.ymax-v2d->cur.ymin)*(dy)/divy; vec[2]= 0.0f; @@ -165,10 +165,10 @@ void convertViewVec(TransInfo *t, float *vec, short dx, short dy) else if(ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)) { View2D *v2d = t->view; float divx, divy; - + divx= v2d->mask.xmax-v2d->mask.xmin; divy= v2d->mask.ymax-v2d->mask.ymin; - + vec[0]= (v2d->cur.xmax-v2d->cur.xmin)*(dx) / (divx); vec[1]= (v2d->cur.ymax-v2d->cur.ymin)*(dy) / (divy); vec[2]= 0.0f; @@ -176,10 +176,10 @@ void convertViewVec(TransInfo *t, float *vec, short dx, short dy) else if(t->spacetype==SPACE_NODE) { View2D *v2d = &t->ar->v2d; float divx, divy; - + divx= v2d->mask.xmax-v2d->mask.xmin; divy= v2d->mask.ymax-v2d->mask.ymin; - + vec[0]= (v2d->cur.xmax-v2d->cur.xmin)*(dx)/divx; vec[1]= (v2d->cur.ymax-v2d->cur.ymin)*(dy)/divy; vec[2]= 0.0f; @@ -205,23 +205,23 @@ void projectIntView(TransInfo *t, float *vec, int *adr) } else if(t->spacetype==SPACE_IMAGE) { float aspx, aspy, v[2]; - + ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy); v[0]= vec[0]/aspx; v[1]= vec[1]/aspy; - + UI_view2d_to_region_no_clip(t->view, v[0], v[1], adr, adr+1); } else if(ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)) { int out[2] = {0, 0}; - - UI_view2d_view_to_region((View2D *)t->view, vec[0], vec[1], out, out+1); + + UI_view2d_view_to_region((View2D *)t->view, vec[0], vec[1], out, out+1); adr[0]= out[0]; adr[1]= out[1]; } else if(t->spacetype==SPACE_SEQ) { /* XXX not tested yet, but should work */ int out[2] = {0, 0}; - + UI_view2d_view_to_region((View2D *)t->view, vec[0], vec[1], out, out+1); adr[0]= out[0]; adr[1]= out[1]; @@ -236,14 +236,14 @@ void projectFloatView(TransInfo *t, float *vec, float *adr) } else if(t->spacetype==SPACE_IMAGE) { int a[2]; - + projectIntView(t, vec, a); adr[0]= a[0]; adr[1]= a[1]; } else if(ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)) { int a[2]; - + projectIntView(t, vec, a); adr[0]= a[0]; adr[1]= a[1]; @@ -296,7 +296,7 @@ static void viewRedrawForce(bContext *C, TransInfo *t) { if (t->spacetype == SPACE_VIEW3D) { - /* Do we need more refined tags? */ + /* Do we need more refined tags? */ WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); } else if (t->spacetype == SPACE_ACTION) { @@ -334,7 +334,7 @@ static void viewRedrawForce(bContext *C, TransInfo *t) static void viewRedrawPost(TransInfo *t) { ED_area_headerprint(t->sa, NULL); - + #if 0 // TRANSFORM_FIX_ME if(t->spacetype==SPACE_VIEW3D) { allqueue(REDRAWBUTSOBJECT, 0); @@ -365,7 +365,7 @@ void BIF_selectOrientation() { char *str_menu = BIF_menustringTransformOrientation("Orientation"); val= pupmenu(str_menu); MEM_freeN(str_menu); - + if(val >= 0) { G.vd->twmode = val; } @@ -381,18 +381,18 @@ static void view_editmove(unsigned short event) /* Ctrl: Scroll right */ /* Alt-Shift: Rotate up */ /* Alt-Ctrl: Rotate right */ - + /* only work in 3D window for now * In the end, will have to send to event to a 2D window handler instead */ if (Trans.flag & T_2D_EDIT) return; - + switch(event) { case WHEELUPMOUSE: - + if( G.qual & LR_SHIFTKEY ) { - if( G.qual & LR_ALTKEY ) { + if( G.qual & LR_ALTKEY ) { G.qual &= ~LR_SHIFTKEY; persptoetsen(PAD2); G.qual |= LR_SHIFTKEY; @@ -400,23 +400,23 @@ static void view_editmove(unsigned short event) persptoetsen(PAD2); } } else if( G.qual & LR_CTRLKEY ) { - if( G.qual & LR_ALTKEY ) { + if( G.qual & LR_ALTKEY ) { G.qual &= ~LR_CTRLKEY; persptoetsen(PAD4); G.qual |= LR_CTRLKEY; } else { persptoetsen(PAD4); } - } else if(U.uiflag & USER_WHEELZOOMDIR) + } else if(U.uiflag & USER_WHEELZOOMDIR) persptoetsen(PADMINUS); else persptoetsen(PADPLUSKEY); - + refresh = 1; break; case WHEELDOWNMOUSE: if( G.qual & LR_SHIFTKEY ) { - if( G.qual & LR_ALTKEY ) { + if( G.qual & LR_ALTKEY ) { G.qual &= ~LR_SHIFTKEY; persptoetsen(PAD8); G.qual |= LR_SHIFTKEY; @@ -424,18 +424,18 @@ static void view_editmove(unsigned short event) persptoetsen(PAD8); } } else if( G.qual & LR_CTRLKEY ) { - if( G.qual & LR_ALTKEY ) { + if( G.qual & LR_ALTKEY ) { G.qual &= ~LR_CTRLKEY; persptoetsen(PAD6); G.qual |= LR_CTRLKEY; } else { persptoetsen(PAD6); } - } else if(U.uiflag & USER_WHEELZOOMDIR) + } else if(U.uiflag & USER_WHEELZOOMDIR) persptoetsen(PADPLUSKEY); else persptoetsen(PADMINUS); - + refresh = 1; break; } @@ -500,19 +500,19 @@ void transformEvent(TransInfo *t, wmEvent *event) { float mati[3][3] = {{1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}}; char cmode = constraintModeToChar(t); - + t->redraw |= handleMouseInput(t, &t->mouse, event); if (event->type == MOUSEMOVE) { t->mval[0] = event->x - t->ar->winrct.xmin; t->mval[1] = event->y - t->ar->winrct.ymin; - + t->redraw = 1; - + applyMouseInput(t, &t->mouse, t->mval, t->values); } - + if (event->val) { switch (event->type){ /* enforce redraw of transform when modifiers are used */ @@ -521,7 +521,7 @@ void transformEvent(TransInfo *t, wmEvent *event) t->modifiers |= MOD_SNAP_GEARS; t->redraw = 1; break; - + case LEFTSHIFTKEY: case RIGHTSHIFTKEY: t->modifiers |= MOD_CONSTRAINT_PLANE; @@ -532,7 +532,7 @@ void transformEvent(TransInfo *t, wmEvent *event) if ((t->spacetype==SPACE_VIEW3D) && event->alt) { #if 0 // TRANSFORM_FIX_ME short mval[2]; - + getmouseco_sc(mval); BIF_selectOrientation(); calc_manipulator_stats(curarea); @@ -544,7 +544,7 @@ void transformEvent(TransInfo *t, wmEvent *event) t->state = TRANS_CONFIRM; } break; - + case MIDDLEMOUSE: if ((t->flag & T_NO_CONSTRAINT)==0) { /* exception for switching to dolly, or trackball, in camera view */ @@ -577,19 +577,16 @@ void transformEvent(TransInfo *t, wmEvent *event) } break; case ESCKEY: - case RIGHTMOUSE: - printf("cancelled\n"); t->state = TRANS_CANCEL; break; - case LEFTMOUSE: case PADENTER: case RETKEY: t->state = TRANS_CONFIRM; break; case GKEY: /* only switch when... */ - if( ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL) ) { - resetTransRestrictions(t); + if( ELEM3(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL) ) { + resetTransRestrictions(t); restoreTransObjects(t); initTranslation(t); initSnapping(t, NULL); // need to reinit after mode change @@ -598,8 +595,8 @@ void transformEvent(TransInfo *t, wmEvent *event) break; case SKEY: /* only switch when... */ - if( ELEM3(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL) ) { - resetTransRestrictions(t); + if( ELEM3(t->mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL) ) { + resetTransRestrictions(t); restoreTransObjects(t); initResize(t); initSnapping(t, NULL); // need to reinit after mode change @@ -609,9 +606,9 @@ void transformEvent(TransInfo *t, wmEvent *event) case RKEY: /* only switch when... */ if( ELEM4(t->mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) { - - resetTransRestrictions(t); - + + resetTransRestrictions(t); + if (t->mode == TFM_ROTATION) { restoreTransObjects(t); initTrackball(t); @@ -771,10 +768,10 @@ void transformEvent(TransInfo *t, wmEvent *event) // viewmoveNDOF(1); // break; } - + // Numerical input events t->redraw |= handleNumInput(&(t->num), event); - + // NDof input events switch(handleNDofInput(&(t->ndof), event)) { @@ -789,7 +786,7 @@ void transformEvent(TransInfo *t, wmEvent *event) if (t->options & CTX_NDOF) { /* Cancel on pure NDOF transform */ - t->state = TRANS_CANCEL; + t->state = TRANS_CANCEL; } else { @@ -807,16 +804,22 @@ void transformEvent(TransInfo *t, wmEvent *event) case NDOF_REFRESH: t->redraw = 1; break; - + } - + // Snapping events t->redraw |= handleSnapping(t, event); - + //arrows_move_cursor(event->type); } else { switch (event->type){ + case RIGHTMOUSE: + t->state = TRANS_CANCEL; + break; + case LEFTMOUSE: + t->state = TRANS_CONFIRM; + break; case LEFTSHIFTKEY: case RIGHTSHIFTKEY: t->modifiers &= ~MOD_CONSTRAINT_PLANE; @@ -826,7 +829,7 @@ void transformEvent(TransInfo *t, wmEvent *event) case LEFTCTRLKEY: case RIGHTCTRLKEY: t->modifiers &= ~MOD_SNAP_GEARS; - /* no redraw on release modifier keys! this makes sure you can assign the 'grid' still + /* no redraw on release modifier keys! this makes sure you can assign the 'grid' still after releasing modifer key */ //t->redraw = 1; break; @@ -837,15 +840,15 @@ void transformEvent(TransInfo *t, wmEvent *event) t->redraw = 1; } break; - case LEFTMOUSE: - case RIGHTMOUSE: - if(WM_modal_tweak_exit(event, t->event_type)) -// if (t->options & CTX_TWEAK) - t->state = TRANS_CONFIRM; - break; +// case LEFTMOUSE: +// case RIGHTMOUSE: +// if(WM_modal_tweak_exit(event, t->event_type)) +//// if (t->options & CTX_TWEAK) +// t->state = TRANS_CONFIRM; +// break; } } - + // Per transform event, if present if (t->handleEvent) t->redraw |= t->handleEvent(t, event); @@ -859,7 +862,7 @@ int calculateTransformCenter(bContext *C, wmEvent *event, int centerMode, float t->state = TRANS_RUNNING; t->options = CTX_NONE; - + t->mode = TFM_DUMMY; initTransInfo(C, t, NULL, event); // internal data, mouse, vectors @@ -873,10 +876,10 @@ int calculateTransformCenter(bContext *C, wmEvent *event, int centerMode, float } else { success = 1; - + calculateCenter(t); - - // Copy center from constraint center. Transform center can be local + + // Copy center from constraint center. Transform center can be local VECCOPY(vec, t->con.center); } @@ -884,9 +887,9 @@ int calculateTransformCenter(bContext *C, wmEvent *event, int centerMode, float /* aftertrans does insert ipos and action channels, and clears base flags, doesnt read transdata */ special_aftertrans_update(t); - + MEM_freeN(t); - + return success; } @@ -905,28 +908,28 @@ static void drawArrow(ArrowDirection d, short offset, short length, short size) length = -length; size = -size; case RIGHT: - glBegin(GL_LINES); - glVertex2s( offset, 0); - glVertex2s( offset + length, 0); - glVertex2s( offset + length, 0); - glVertex2s( offset + length - size, -size); - glVertex2s( offset + length, 0); + glBegin(GL_LINES); + glVertex2s( offset, 0); + glVertex2s( offset + length, 0); + glVertex2s( offset + length, 0); + glVertex2s( offset + length - size, -size); + glVertex2s( offset + length, 0); glVertex2s( offset + length - size, size); - glEnd(); + glEnd(); break; case DOWN: offset = -offset; length = -length; size = -size; case UP: - glBegin(GL_LINES); - glVertex2s( 0, offset); - glVertex2s( 0, offset + length); - glVertex2s( 0, offset + length); - glVertex2s(-size, offset + length - size); - glVertex2s( 0, offset + length); + glBegin(GL_LINES); + glVertex2s( 0, offset); + glVertex2s( 0, offset + length); + glVertex2s( 0, offset + length); + glVertex2s(-size, offset + length - size); + glVertex2s( 0, offset + length); glVertex2s( size, offset + length - size); - glEnd(); + glEnd(); break; } } @@ -938,22 +941,22 @@ static void drawArrowHead(ArrowDirection d, short size) case LEFT: size = -size; case RIGHT: - glBegin(GL_LINES); - glVertex2s( 0, 0); - glVertex2s( -size, -size); - glVertex2s( 0, 0); + glBegin(GL_LINES); + glVertex2s( 0, 0); + glVertex2s( -size, -size); + glVertex2s( 0, 0); glVertex2s( -size, size); - glEnd(); + glEnd(); break; case DOWN: size = -size; case UP: - glBegin(GL_LINES); - glVertex2s( 0, 0); - glVertex2s(-size, -size); - glVertex2s( 0, 0); + glBegin(GL_LINES); + glVertex2s( 0, 0); + glVertex2s(-size, -size); + glVertex2s( 0, 0); glVertex2s( size, -size); - glEnd(); + glEnd(); break; } } @@ -962,15 +965,15 @@ static void drawArc(float size, float angle_start, float angle_end, int segments { float delta = (angle_end - angle_start) / segments; float angle; - + glBegin(GL_LINE_STRIP); - + for( angle = angle_start; angle < angle_end; angle += delta) { glVertex2f( cosf(angle) * size, sinf(angle) * size); } glVertex2f( cosf(angle_end) * size, sinf(angle_end) * size); - + glEnd(); } @@ -979,7 +982,7 @@ void drawHelpline(const struct bContext *C, TransInfo *t) if (t->helpline != HLP_NONE && !(t->flag & T_USES_MANIPULATOR)) { float vecrot[3], cent[2]; - + VECCOPY(vecrot, t->center); if(t->flag & T_EDIT) { Object *ob= t->obedit; @@ -989,9 +992,9 @@ void drawHelpline(const struct bContext *C, TransInfo *t) Object *ob=t->poseobj; if(ob) Mat4MulVecfl(ob->obmat, vecrot); } - + projectFloatView(t, vecrot, cent); // no overflow in extreme cases - + glDisable(GL_DEPTH_TEST); glMatrixMode(GL_PROJECTION); @@ -1000,16 +1003,16 @@ void drawHelpline(const struct bContext *C, TransInfo *t) glPushMatrix(); ED_region_pixelspace(t->ar); - + switch(t->helpline) { case HLP_SPRING: UI_ThemeColor(TH_WIRE); - + setlinestyle(3); - glBegin(GL_LINE_STRIP); - glVertex2sv(t->mval); - glVertex2fv(cent); + glBegin(GL_LINE_STRIP); + glVertex2sv(t->mval); + glVertex2fv(cent); glEnd(); glTranslatef(t->mval[0], t->mval[1], 0); @@ -1037,7 +1040,7 @@ void drawHelpline(const struct bContext *C, TransInfo *t) glTranslatef(t->mval[0], t->mval[1], 0); glLineWidth(3.0); - glBegin(GL_LINES); + glBegin(GL_LINES); drawArrow(UP, 5, 10, 5); drawArrow(DOWN, 5, 10, 5); glLineWidth(1.0); @@ -1050,27 +1053,27 @@ void drawHelpline(const struct bContext *C, TransInfo *t) float delta_angle = MIN2(15 / dist, M_PI/4); float spacing_angle = MIN2(5 / dist, M_PI/12); UI_ThemeColor(TH_WIRE); - + setlinestyle(3); - glBegin(GL_LINE_STRIP); - glVertex2sv(t->mval); - glVertex2fv(cent); + glBegin(GL_LINE_STRIP); + glVertex2sv(t->mval); + glVertex2fv(cent); glEnd(); - + glTranslatef(cent[0], cent[1], 0); - + setlinestyle(0); glLineWidth(3.0); drawArc(dist, angle - delta_angle, angle - spacing_angle, 10); drawArc(dist, angle + spacing_angle, angle + delta_angle, 10); - + glPushMatrix(); glTranslatef(cosf(angle - delta_angle) * dist, sinf(angle - delta_angle) * dist, 0); glRotatef(180 / M_PI * (angle - delta_angle), 0, 0, 1); - + drawArrowHead(DOWN, 5); - + glPopMatrix(); glTranslatef(cosf(angle + delta_angle) * dist, sinf(angle + delta_angle) * dist, 0); @@ -1085,32 +1088,32 @@ void drawHelpline(const struct bContext *C, TransInfo *t) { char col[3], col2[3]; UI_GetThemeColor3ubv(TH_GRID, col); - + glTranslatef(t->mval[0], t->mval[1], 0); - + glLineWidth(3.0); - + UI_make_axis_color(col, col2, 'x'); glColor3ubv((GLubyte *)col2); - + drawArrow(RIGHT, 5, 10, 5); drawArrow(LEFT, 5, 10, 5); - + UI_make_axis_color(col, col2, 'y'); glColor3ubv((GLubyte *)col2); - + drawArrow(UP, 5, 10, 5); drawArrow(DOWN, 5, 10, 5); glLineWidth(1.0); break; } } - + glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glPopMatrix(); - + glEnable(GL_DEPTH_TEST); } } @@ -1118,7 +1121,7 @@ void drawHelpline(const struct bContext *C, TransInfo *t) void drawTransform(const struct bContext *C, struct ARegion *ar, void *arg) { TransInfo *t = arg; - + drawConstraint(C, t); drawPropCircle(C, t); drawSnapping(C, t); @@ -1164,7 +1167,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) { RNA_boolean_set(op->ptr, "mirror", t->flag & T_MIRROR); } - + if (RNA_struct_find_property(op->ptr, "constraint_axis")) { RNA_int_set(op->ptr, "constraint_orientation", t->current_orientation); @@ -1194,7 +1197,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) if(t->spacetype == SPACE_VIEW3D) { View3D *v3d = t->view; - + v3d->twmode = t->current_orientation; } } @@ -1209,7 +1212,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int t->state = TRANS_RUNNING; t->options = options; - + t->mode = mode; if (!initTransInfo(C, t, op, event)) // internal data, mouse, vectors @@ -1221,7 +1224,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int { //calc_manipulator_stats(curarea); initTransformOrientation(C, t); - + t->draw_handle = ED_region_draw_cb_activate(t->ar->type, drawTransform, t, REGION_DRAW_POST); } else if(t->spacetype == SPACE_IMAGE) { @@ -1244,10 +1247,10 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int /* EVIL2: we gave as argument also texture space context bit... was cleared */ /* EVIL3: extend mode for animation editors also switches modes... but is best way to avoid duplicate code */ mode = t->mode; - + calculatePropRatio(t); calculateCenter(t); - + initMouseInput(t, &t->mouse, t->center2d, t->imval); switch (mode) { @@ -1311,11 +1314,11 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int case TFM_TIME_SCALE: initTimeScale(t); break; - case TFM_TIME_EXTEND: + case TFM_TIME_EXTEND: /* now that transdata has been made, do like for TFM_TIME_TRANSLATE (for most Animation * Editors because they have only 1D transforms for time values) or TFM_TRANSLATION * (for Graph/NLA Editors only since they uses 'standard' transforms to get 2D movement) - * depending on which editor this was called from + * depending on which editor this was called from */ if ELEM(t->spacetype, SPACE_IPO, SPACE_NLA) initTranslation(t); @@ -1369,11 +1372,11 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int if (constraint_axis[2]) { t->con.mode |= CON_AXIS2; } - - setUserConstraint(t, t->con.mode, "%s"); + + setUserConstraint(t, t->con.mode, "%s"); } } - + return 1; } @@ -1392,7 +1395,7 @@ void transformApply(bContext *C, TransInfo *t) t->redraw = 0; } - /* If auto confirm is on, break after one pass */ + /* If auto confirm is on, break after one pass */ if (t->options & CTX_AUTOCONFIRM) { t->state = TRANS_CONFIRM; @@ -1409,7 +1412,7 @@ void transformApply(bContext *C, TransInfo *t) int transformEnd(bContext *C, TransInfo *t) { int exit_code = OPERATOR_RUNNING_MODAL; - + if (t->state != TRANS_RUNNING) { /* handle restoring objects */ @@ -1422,16 +1425,16 @@ int transformEnd(bContext *C, TransInfo *t) { exit_code = OPERATOR_FINISHED; } - + /* free data */ postTrans(t); - + /* aftertrans does insert keyframes, and clears base flags, doesnt read transdata */ special_aftertrans_update(t); - + /* send events out for redraws */ viewRedrawPost(t); - + /* Undo as last, certainly after special_trans_update! */ if(t->state == TRANS_CANCEL) { @@ -1445,7 +1448,7 @@ int transformEnd(bContext *C, TransInfo *t) viewRedrawForce(C, t); } - + return exit_code; } @@ -1454,14 +1457,14 @@ int transformEnd(bContext *C, TransInfo *t) void initManipulator(int mode) { printf("init manipulator mode %d\n", mode); - + #if 0 // TRANSFORM_FIX_ME Trans.state = TRANS_RUNNING; Trans.options = CTX_NONE; - + Trans.mode = mode; - + /* automatic switch to scaling bone envelopes */ if(mode==TFM_RESIZE && t->obedit && t->obedit->type==OB_ARMATURE) { bArmature *arm= t->obedit->data; @@ -1482,7 +1485,7 @@ void initManipulator(int mode) /* EVIL! posemode code can switch translation to rotate when 1 bone is selected. will be removed (ton) */ /* EVIL2: we gave as argument also texture space context bit... was cleared */ mode = Trans.mode; - + calculatePropRatio(&Trans); calculateCenter(&Trans); @@ -1505,7 +1508,7 @@ void initManipulator(int mode) #endif } -void ManipulatorTransform() +void ManipulatorTransform() { #if 0 // TRANSFORM_FIX_ME int mouse_moved = 0; @@ -1518,9 +1521,9 @@ void ManipulatorTransform() Trans.redraw = 1; /* initial draw */ while (Trans.state == TRANS_RUNNING) { - + getmouseco_areawin(mval); - + if (mval[0] != pmval[0] || mval[1] != pmval[1]) { Trans.redraw = 1; } @@ -1534,7 +1537,7 @@ void ManipulatorTransform() } Trans.redraw = 0; } - + /* essential for idling subloop */ if( qtest()==0) PIL_sleep_ms(2); @@ -1559,9 +1562,9 @@ void ManipulatorTransform() Trans.flag |= T_SHIFT_MOD; Trans.redraw = 1; } - else Trans.flag &= ~T_SHIFT_MOD; + else Trans.flag &= ~T_SHIFT_MOD; break; - + case ESCKEY: case RIGHTMOUSE: Trans.state = TRANS_CANCEL; @@ -1619,23 +1622,23 @@ void ManipulatorTransform() Trans.redraw= 1; break; } - + // Numerical input events Trans.redraw |= handleNumInput(&(Trans.num), event); } } } - + if(Trans.state == TRANS_CANCEL) { restoreTransObjects(&Trans); } - + /* free data, reset vars */ postTrans(&Trans); - + /* aftertrans does insert ipos and action channels, and clears base flags */ special_aftertrans_update(&Trans); - + /* send events out for redraws */ viewRedrawPost(&Trans); @@ -1681,21 +1684,21 @@ static void protectedQuaternionBits(short protectflag, float *quat, float *oldqu { /* quaternions get limited with euler... */ /* this function only does the delta rotation */ - + if(protectflag) { float eul[3], oldeul[3], quat1[4]; - + QUATCOPY(quat1, quat); QuatToEul(quat, eul); QuatToEul(oldquat, oldeul); - + if(protectflag & OB_LOCK_ROTX) eul[0]= oldeul[0]; if(protectflag & OB_LOCK_ROTY) eul[1]= oldeul[1]; if(protectflag & OB_LOCK_ROTZ) eul[2]= oldeul[2]; - + EulToQuat(eul, quat); /* quaternions flip w sign to accumulate rotations correctly */ if( (quat1[0]<0.0f && quat[0]>0.0f) || (quat1[0]>0.0f && quat[0]<0.0f) ) { @@ -1712,8 +1715,8 @@ static void constraintTransLim(TransInfo *t, TransData *td) bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_LOCLIMIT); bConstraintOb cob; bConstraint *con; - - /* Make a temporary bConstraintOb for using these limit constraints + + /* Make a temporary bConstraintOb for using these limit constraints * - they only care that cob->matrix is correctly set ;-) * - current space should be local */ @@ -1728,22 +1731,22 @@ static void constraintTransLim(TransInfo *t, TransData *td) else { VECCOPY(cob.matrix[3], td->loc); } - + /* Evaluate valid constraints */ for (con= td->con; con; con= con->next) { float tmat[4][4]; - + /* only consider constraint if enabled */ if (con->flag & CONSTRAINT_DISABLE) continue; if (con->enforce == 0.0f) continue; - + /* only use it if it's tagged for this purpose (and the right type) */ if (con->type == CONSTRAINT_TYPE_LOCLIMIT) { bLocLimitConstraint *data= con->data; - - if ((data->flag2 & LIMIT_TRANSFORM)==0) + + if ((data->flag2 & LIMIT_TRANSFORM)==0) continue; - + /* do space conversions */ if (con->ownspace == CONSTRAINT_SPACE_WORLD) { /* just multiply by td->mtx (this should be ok) */ @@ -1754,10 +1757,10 @@ static void constraintTransLim(TransInfo *t, TransData *td) /* skip... incompatable spacetype */ continue; } - + /* do constraint */ cti->evaluate_constraint(con, &cob, NULL); - + /* convert spaces again */ if (con->ownspace == CONSTRAINT_SPACE_WORLD) { /* just multiply by td->mtx (this should be ok) */ @@ -1766,7 +1769,7 @@ static void constraintTransLim(TransInfo *t, TransData *td) } } } - + /* copy results from cob->matrix */ if (td->tdi) { TransDataIpokey *tdi= td->tdi; @@ -1786,8 +1789,8 @@ static void constraintRotLim(TransInfo *t, TransData *td) bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_ROTLIMIT); bConstraintOb cob; bConstraint *con; - - /* Make a temporary bConstraintOb for using these limit constraints + + /* Make a temporary bConstraintOb for using these limit constraints * - they only care that cob->matrix is correctly set ;-) * - current space should be local */ @@ -1803,11 +1806,11 @@ static void constraintRotLim(TransInfo *t, TransData *td) /* ipo-keys eulers */ TransDataIpokey *tdi= td->tdi; float eul[3]; - + eul[0]= tdi->rotx[0]; eul[1]= tdi->roty[0]; eul[2]= tdi->rotz[0]; - + EulToMat4(eul, cob.matrix); } else { @@ -1817,22 +1820,22 @@ static void constraintRotLim(TransInfo *t, TransData *td) else return; } - + /* Evaluate valid constraints */ for (con= td->con; con; con= con->next) { /* only consider constraint if enabled */ if (con->flag & CONSTRAINT_DISABLE) continue; if (con->enforce == 0.0f) continue; - + /* we're only interested in Limit-Rotation constraints */ if (con->type == CONSTRAINT_TYPE_ROTLIMIT) { bRotLimitConstraint *data= con->data; float tmat[4][4]; - + /* only use it if it's tagged for this purpose */ - if ((data->flag2 & LIMIT_TRANSFORM)==0) + if ((data->flag2 & LIMIT_TRANSFORM)==0) continue; - + /* do space conversions */ if (con->ownspace == CONSTRAINT_SPACE_WORLD) { /* just multiply by td->mtx (this should be ok) */ @@ -1843,10 +1846,10 @@ static void constraintRotLim(TransInfo *t, TransData *td) /* skip... incompatable spacetype */ continue; } - + /* do constraint */ cti->evaluate_constraint(con, &cob, NULL); - + /* convert spaces again */ if (con->ownspace == CONSTRAINT_SPACE_WORLD) { /* just multiply by td->mtx (this should be ok) */ @@ -1855,7 +1858,7 @@ static void constraintRotLim(TransInfo *t, TransData *td) } } } - + /* copy results from cob->matrix */ if (td->flag & TD_USEQUAT) { /* quats */ @@ -1865,9 +1868,9 @@ static void constraintRotLim(TransInfo *t, TransData *td) /* ipo-keys eulers */ TransDataIpokey *tdi= td->tdi; float eul[3]; - + Mat4ToEul(cob.matrix, eul); - + tdi->rotx[0]= eul[0]; tdi->roty[0]= eul[1]; tdi->rotz[0]= eul[2]; @@ -1885,8 +1888,8 @@ static void constraintSizeLim(TransInfo *t, TransData *td) bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_SIZELIMIT); bConstraintOb cob; bConstraint *con; - - /* Make a temporary bConstraintOb for using these limit constraints + + /* Make a temporary bConstraintOb for using these limit constraints * - they only care that cob->matrix is correctly set ;-) * - current space should be local */ @@ -1894,12 +1897,12 @@ static void constraintSizeLim(TransInfo *t, TransData *td) if (td->tdi) { TransDataIpokey *tdi= td->tdi; float size[3]; - + size[0]= tdi->sizex[0]; size[1]= tdi->sizey[0]; size[2]= tdi->sizez[0]; SizeToMat4(size, cob.matrix); - } + } else if ((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)) { /* scale val and reset size */ return; // TODO: fix this case @@ -1908,25 +1911,25 @@ static void constraintSizeLim(TransInfo *t, TransData *td) /* Reset val if SINGLESIZE but using a constraint */ if (td->flag & TD_SINGLESIZE) return; - + SizeToMat4(td->ext->size, cob.matrix); } - + /* Evaluate valid constraints */ for (con= td->con; con; con= con->next) { /* only consider constraint if enabled */ if (con->flag & CONSTRAINT_DISABLE) continue; if (con->enforce == 0.0f) continue; - + /* we're only interested in Limit-Scale constraints */ if (con->type == CONSTRAINT_TYPE_SIZELIMIT) { bSizeLimitConstraint *data= con->data; float tmat[4][4]; - + /* only use it if it's tagged for this purpose */ - if ((data->flag2 & LIMIT_TRANSFORM)==0) + if ((data->flag2 & LIMIT_TRANSFORM)==0) continue; - + /* do space conversions */ if (con->ownspace == CONSTRAINT_SPACE_WORLD) { /* just multiply by td->mtx (this should be ok) */ @@ -1937,10 +1940,10 @@ static void constraintSizeLim(TransInfo *t, TransData *td) /* skip... incompatable spacetype */ continue; } - + /* do constraint */ cti->evaluate_constraint(con, &cob, NULL); - + /* convert spaces again */ if (con->ownspace == CONSTRAINT_SPACE_WORLD) { /* just multiply by td->mtx (this should be ok) */ @@ -1949,18 +1952,18 @@ static void constraintSizeLim(TransInfo *t, TransData *td) } } } - + /* copy results from cob->matrix */ if (td->tdi) { TransDataIpokey *tdi= td->tdi; float size[3]; - + Mat4ToSize(cob.matrix, size); - + tdi->sizex[0]= size[0]; tdi->sizey[0]= size[1]; tdi->sizez[0]= size[2]; - } + } else if ((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)) { /* scale val and reset size */ return; // TODO: fix this case @@ -1969,7 +1972,7 @@ static void constraintSizeLim(TransInfo *t, TransData *td) /* Reset val if SINGLESIZE but using a constraint */ if (td->flag & TD_SINGLESIZE) return; - + Mat4ToSize(cob.matrix, td->ext->size); } } @@ -1977,15 +1980,15 @@ static void constraintSizeLim(TransInfo *t, TransData *td) /* ************************** WARP *************************** */ -void initWarp(TransInfo *t) +void initWarp(TransInfo *t) { float max[3], min[3]; int i; - + t->mode = TFM_WARP; t->transform = Warp; t->handleEvent = handleEventWarp; - + initMouseInputMode(t, &t->mouse, INPUT_HORIZONTAL_RATIO); t->idx_max = 0; @@ -1993,9 +1996,9 @@ void initWarp(TransInfo *t) t->snap[0] = 0.0f; t->snap[1] = 5.0f; t->snap[2] = 1.0f; - + t->flag |= T_NO_CONSTRAINT; - + /* we need min/max in view space */ for(i = 0; i < t->total; i++) { float center[3]; @@ -2010,11 +2013,11 @@ void initWarp(TransInfo *t) VECCOPY(min, center); } } - + t->center[0]= (min[0]+max[0])/2.0f; t->center[1]= (min[1]+max[1])/2.0f; t->center[2]= (min[2]+max[2])/2.0f; - + if (max[0] == min[0]) max[0] += 0.1; /* not optimal, but flipping is better than invalid garbage (i.e. division by zero!) */ t->val= (max[0]-min[0])/2.0f; /* t->val is X dimension projected boundbox */ } @@ -2022,7 +2025,7 @@ void initWarp(TransInfo *t) int handleEventWarp(TransInfo *t, wmEvent *event) { int status = 0; - + if (event->type == MIDDLEMOUSE && event->val) { // Use customData pointer to signal warp direction @@ -2030,10 +2033,10 @@ int handleEventWarp(TransInfo *t, wmEvent *event) t->customData = (void*)1; else t->customData = 0; - + status = 1; } - + return status; } @@ -2043,7 +2046,7 @@ int Warp(TransInfo *t, short mval[2]) float vec[3], circumfac, dist, phi0, co, si, *curs, cursor[3], gcursor[3]; int i; char str[50]; - + curs= give_cursor(t->scene, t->view); /* * gcursor is the one used for helpline. @@ -2056,7 +2059,7 @@ int Warp(TransInfo *t, short mval[2]) * into account if in Edit mode. */ VECCOPY(cursor, curs); - VECCOPY(gcursor, cursor); + VECCOPY(gcursor, cursor); if (t->flag & T_EDIT) { VecSubf(cursor, cursor, t->obedit->obmat[3]); VecSubf(gcursor, gcursor, t->obedit->obmat[3]); @@ -2067,7 +2070,7 @@ int Warp(TransInfo *t, short mval[2]) /* amount of degrees for warp */ circumfac = 360.0f * t->values[0]; - + if (t->customData) /* non-null value indicates reversed input */ { circumfac *= -1; @@ -2075,22 +2078,22 @@ int Warp(TransInfo *t, short mval[2]) snapGrid(t, &circumfac); applyNumInput(&t->num, &circumfac); - + /* header print for NumInput */ if (hasNumInput(&t->num)) { char c[20]; - + outputNumInput(&(t->num), c); - + sprintf(str, "Warp: %s", c); } else { /* default header print */ sprintf(str, "Warp: %.3f", circumfac); } - + circumfac*= (float)(-M_PI/360.0); - + for(i = 0; i < t->total; i++, td++) { float loc[3]; if (td->flag & TD_NOACTION) @@ -2098,65 +2101,65 @@ int Warp(TransInfo *t, short mval[2]) if (td->flag & TD_SKIP) continue; - + /* translate point to center, rotate in such a way that outline==distance */ VECCOPY(vec, td->iloc); Mat3MulVecfl(td->mtx, vec); Mat4MulVecfl(t->viewmat, vec); VecSubf(vec, vec, t->viewmat[3]); - + dist= vec[0]-cursor[0]; - + /* t->val is X dimension projected boundbox */ - phi0= (circumfac*dist/t->val); - + phi0= (circumfac*dist/t->val); + vec[1]= (vec[1]-cursor[1]); - + co= (float)cos(phi0); si= (float)sin(phi0); loc[0]= -si*vec[1]+cursor[0]; loc[1]= co*vec[1]+cursor[1]; loc[2]= vec[2]; - + Mat4MulVecfl(t->viewinv, loc); VecSubf(loc, loc, t->viewinv[3]); Mat3MulVecfl(td->smtx, loc); - + VecSubf(loc, loc, td->iloc); VecMulf(loc, td->factor); VecAddf(td->loc, td->iloc, loc); } recalcData(t); - + ED_area_headerprint(t->sa, str); - + return 1; } /* ************************** SHEAR *************************** */ -void initShear(TransInfo *t) +void initShear(TransInfo *t) { t->mode = TFM_SHEAR; t->transform = Shear; t->handleEvent = handleEventShear; - + initMouseInputMode(t, &t->mouse, INPUT_HORIZONTAL_ABSOLUTE); - + t->idx_max = 0; t->num.idx_max = 0; t->snap[0] = 0.0f; t->snap[1] = 0.1f; t->snap[2] = t->snap[1] * 0.1f; - + t->flag |= T_NO_CONSTRAINT; } int handleEventShear(TransInfo *t, wmEvent *event) { int status = 0; - + if (event->type == MIDDLEMOUSE && event->val) { // Use customData pointer to signal Shear direction @@ -2170,15 +2173,15 @@ int handleEventShear(TransInfo *t, wmEvent *event) initMouseInputMode(t, &t->mouse, INPUT_HORIZONTAL_ABSOLUTE); t->customData = 0; } - + status = 1; } - + return status; } -int Shear(TransInfo *t, short mval[2]) +int Shear(TransInfo *t, short mval[2]) { TransData *td = t->data; float vec[3]; @@ -2208,18 +2211,18 @@ int Shear(TransInfo *t, short mval[2]) /* default header print */ sprintf(str, "Shear: %.3f %s", value, t->proptext); } - + Mat3One(smat); - + // Custom data signals shear direction if (t->customData == 0) smat[1][0] = value; else smat[0][1] = value; - + Mat3MulMat3(tmat, smat, persmat); Mat3MulMat3(totmat, persinv, tmat); - + for(i = 0 ; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) break; @@ -2256,13 +2259,13 @@ int Shear(TransInfo *t, short mval[2]) /* ************************** RESIZE *************************** */ -void initResize(TransInfo *t) +void initResize(TransInfo *t) { t->mode = TFM_RESIZE; t->transform = Resize; - + initMouseInputMode(t, &t->mouse, INPUT_SPRING_FLIP); - + t->flag |= T_NULL_ONE; t->num.flag |= NUM_NULL_ONE; t->num.flag |= NUM_AFFECT_ALL; @@ -2270,7 +2273,7 @@ void initResize(TransInfo *t) t->flag |= T_NO_ZERO; t->num.flag |= NUM_NO_ZERO; } - + t->idx_max = 2; t->num.idx_max = 2; t->snap[0] = 0.0f; @@ -2316,18 +2319,18 @@ static void headerResize(TransInfo *t, float vec[3], char *str) { static void TransMat3ToSize( float mat[][3], float smat[][3], float *size) { float vec[3]; - + VecCopyf(vec, mat[0]); size[0]= Normalize(vec); VecCopyf(vec, mat[1]); size[1]= Normalize(vec); VecCopyf(vec, mat[2]); size[2]= Normalize(vec); - + /* first tried with dotproduct... but the sign flip is crucial */ - if( VECSIGNFLIP(mat[0], smat[0]) ) size[0]= -size[0]; - if( VECSIGNFLIP(mat[1], smat[1]) ) size[1]= -size[1]; - if( VECSIGNFLIP(mat[2], smat[2]) ) size[2]= -size[2]; + if( VECSIGNFLIP(mat[0], smat[0]) ) size[0]= -size[0]; + if( VECSIGNFLIP(mat[1], smat[1]) ) size[1]= -size[1]; + if( VECSIGNFLIP(mat[2], smat[2]) ) size[2]= -size[2]; } @@ -2353,7 +2356,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) { VECCOPY(center, td->center); } else if (t->flag & T_EDIT) { - + if(t->around==V3D_LOCAL && (t->settings->selectmode & SCE_SELECT_FACE)) { VECCOPY(center, td->center); } @@ -2371,7 +2374,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) { if (td->ext) { float fsize[3]; - + if (t->flag & (T_OBJECT|T_TEXTURE|T_POSE)) { float obsizemat[3][3]; // Reorient the size mat to fit the oriented object. @@ -2383,28 +2386,28 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) { else { Mat3ToSize(tmat, fsize); } - + protectedSizeBits(td->protectflag, fsize); - + if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't resize objects itself /* handle ipokeys? */ if(td->tdi) { TransDataIpokey *tdi= td->tdi; /* calculate delta size (equal for size and dsize) */ - + vec[0]= (tdi->oldsize[0])*(fsize[0] -1.0f) * td->factor; vec[1]= (tdi->oldsize[1])*(fsize[1] -1.0f) * td->factor; vec[2]= (tdi->oldsize[2])*(fsize[2] -1.0f) * td->factor; - + add_tdi_poin(tdi->sizex, tdi->oldsize, vec[0]); add_tdi_poin(tdi->sizey, tdi->oldsize+1, vec[1]); add_tdi_poin(tdi->sizez, tdi->oldsize+2, vec[2]); - - } + + } else if((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)){ /* scale val and reset size */ *td->val = td->ival * fsize[0] * td->factor; - + td->ext->size[0] = td->ext->isize[0]; td->ext->size[1] = td->ext->isize[1]; td->ext->size[2] = td->ext->isize[2]; @@ -2413,16 +2416,16 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) { /* Reset val if SINGLESIZE but using a constraint */ if (td->flag & TD_SINGLESIZE) *td->val = td->ival; - + td->ext->size[0] = td->ext->isize[0] * (fsize[0]) * td->factor; td->ext->size[1] = td->ext->isize[1] * (fsize[1]) * td->factor; td->ext->size[2] = td->ext->isize[2] * (fsize[2]) * td->factor; } } - + constraintSizeLim(t, td); } - + /* For individual element center, Editmode need to use iloc */ if (t->flag & T_POINTS) VecSubf(vec, td->iloc, center); @@ -2452,11 +2455,11 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) { add_tdi_poin(tdi->locz, tdi->oldloc+2, vec[2]); } else VecAddf(td->loc, td->iloc, vec); - + constraintTransLim(t, td); } -int Resize(TransInfo *t, short mval[2]) +int Resize(TransInfo *t, short mval[2]) { TransData *td; float size[3], mat[3][3]; @@ -2473,7 +2476,7 @@ int Resize(TransInfo *t, short mval[2]) { ratio = t->values[0]; } - + size[0] = size[1] = size[2] = ratio; snapGrid(t, size); @@ -2499,7 +2502,7 @@ int Resize(TransInfo *t, short mval[2]) } Mat3CpyMat3(t->mat, mat); // used in manipulator - + headerResize(t, size, str); for(i = 0, td=t->data; i < t->total; i++, td++) { @@ -2508,7 +2511,7 @@ int Resize(TransInfo *t, short mval[2]) if (td->flag & TD_SKIP) continue; - + ElementResize(t, td, mat); } @@ -2532,14 +2535,14 @@ int Resize(TransInfo *t, short mval[2]) /* ************************** TOSPHERE *************************** */ -void initToSphere(TransInfo *t) +void initToSphere(TransInfo *t) { TransData *td = t->data; int i; t->mode = TFM_TOSPHERE; t->transform = ToSphere; - + initMouseInputMode(t, &t->mouse, INPUT_HORIZONTAL_RATIO); t->idx_max = 0; @@ -2547,10 +2550,10 @@ void initToSphere(TransInfo *t) t->snap[0] = 0.0f; t->snap[1] = 0.1f; t->snap[2] = t->snap[1] * 0.1f; - + t->num.flag |= NUM_NULL_ONE | NUM_NO_NEGATIVE; t->flag |= T_NO_CONSTRAINT; - + // Calculate average radius for(i = 0 ; i < t->total; i++, td++) { t->val += VecLenf(t->center, td->iloc); @@ -2559,7 +2562,7 @@ void initToSphere(TransInfo *t) t->val /= (float)t->total; } -int ToSphere(TransInfo *t, short mval[2]) +int ToSphere(TransInfo *t, short mval[2]) { float vec[3]; float ratio, radius; @@ -2590,8 +2593,8 @@ int ToSphere(TransInfo *t, short mval[2]) /* default header print */ sprintf(str, "To Sphere: %.4f %s", ratio, t->proptext); } - - + + for(i = 0 ; i < t->total; i++, td++) { float tratio; if (td->flag & TD_NOACTION) @@ -2610,7 +2613,7 @@ int ToSphere(TransInfo *t, short mval[2]) VecAddf(td->loc, t->center, vec); } - + recalcData(t); @@ -2622,23 +2625,23 @@ int ToSphere(TransInfo *t, short mval[2]) /* ************************** ROTATION *************************** */ -void initRotation(TransInfo *t) +void initRotation(TransInfo *t) { t->mode = TFM_ROTATION; t->transform = Rotation; - + initMouseInputMode(t, &t->mouse, INPUT_ANGLE); - + t->ndof.axis = 16; /* Scale down and flip input for rotation */ t->ndof.factor[0] = -0.2f; - + t->idx_max = 0; t->num.idx_max = 0; t->snap[0] = 0.0f; t->snap[1] = (float)((5.0/180)*M_PI); t->snap[2] = t->snap[1] * 0.2f; - + if (t->flag & T_2D_EDIT) t->flag |= T_NO_CONSTRAINT; } @@ -2647,7 +2650,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short float vec[3], totmat[3][3], smat[3][3]; float eul[3], fmat[3][3], quat[4]; float *center = t->center; - + /* local constraint shouldn't alter center */ if (around == V3D_LOCAL) { if (t->flag & (T_OBJECT|T_POSE)) { @@ -2660,14 +2663,14 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short } } } - + if (t->flag & T_POINTS) { Mat3MulMat3(totmat, mat, td->mtx); Mat3MulMat3(smat, td->smtx, totmat); - + VecSubf(vec, td->iloc, center); Mat3MulVecfl(smat, vec); - + VecAddf(td->loc, vec, center); VecSubf(vec,td->loc,td->iloc); @@ -2677,10 +2680,10 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short if(td->flag & TD_USEQUAT) { Mat3MulSerie(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0); Mat3ToQuat(fmat, quat); // Actual transform - + if(td->ext->quat){ QuatMul(td->ext->quat, quat, td->ext->iquat); - + /* is there a reason not to have this here? -jahka */ protectedQuaternionBits(td->protectflag, td->ext->quat, td->ext->iquat); } @@ -2688,11 +2691,11 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short } /** * HACK WARNING - * + * * This is some VERY ugly special case to deal with pose mode. - * + * * The problem is that mtx and smtx include each bone orientation. - * + * * That is needed to rotate each bone properly, HOWEVER, to calculate * the translation component, we only need the actual armature object's * matrix (and inverse). That is not all though. Once the proper translation @@ -2701,65 +2704,65 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short else if (t->flag & T_POSE) { float pmtx[3][3], imtx[3][3]; - // Extract and invert armature object matrix + // Extract and invert armature object matrix Mat3CpyMat4(pmtx, t->poseobj->obmat); Mat3Inv(imtx, pmtx); - + if ((td->flag & TD_NO_LOC) == 0) { VecSubf(vec, td->center, center); - + Mat3MulVecfl(pmtx, vec); // To Global space Mat3MulVecfl(mat, vec); // Applying rotation Mat3MulVecfl(imtx, vec); // To Local space - + VecAddf(vec, vec, center); /* vec now is the location where the object has to be */ - + VecSubf(vec, vec, td->center); // Translation needed from the initial location - + Mat3MulVecfl(pmtx, vec); // To Global space Mat3MulVecfl(td->smtx, vec);// To Pose space - + protectedTransBits(td->protectflag, vec); - + VecAddf(td->loc, td->iloc, vec); - + constraintTransLim(t, td); } - + /* rotation */ if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't rotate objects itself /* euler or quaternion? */ if (td->flag & TD_USEQUAT) { Mat3MulSerie(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0); - + Mat3ToQuat(fmat, quat); // Actual transform - + QuatMul(td->ext->quat, quat, td->ext->iquat); /* this function works on end result */ protectedQuaternionBits(td->protectflag, td->ext->quat, td->ext->iquat); } else { float eulmat[3][3]; - + Mat3MulMat3(totmat, mat, td->mtx); Mat3MulMat3(smat, td->smtx, totmat); - + /* calculate the total rotatation in eulers */ VECCOPY(eul, td->ext->irot); EulToMat3(eul, eulmat); - + /* mat = transform, obmat = bone rotation */ Mat3MulMat3(fmat, smat, eulmat); - + Mat3ToCompatibleEul(fmat, eul, td->ext->rot); - + /* and apply (to end result only) */ protectedRotateBits(td->protectflag, eul, td->ext->irot); VECCOPY(td->ext->rot, eul); } - + constraintRotLim(t, td); } } @@ -2773,9 +2776,9 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short /* vec now is the location where the object has to be */ VecSubf(vec, vec, td->center); Mat3MulVecfl(td->smtx, vec); - + protectedTransBits(td->protectflag, vec); - + if(td->tdi) { TransDataIpokey *tdi= td->tdi; add_tdi_poin(tdi->locx, tdi->oldloc, vec[0]); @@ -2784,8 +2787,8 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short } else VecAddf(td->loc, td->iloc, vec); } - - + + constraintTransLim(t, td); /* rotation */ @@ -2794,34 +2797,34 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short if (td->flag & TD_USEQUAT) { Mat3MulSerie(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0); Mat3ToQuat(fmat, quat); // Actual transform - + QuatMul(td->ext->quat, quat, td->ext->iquat); /* this function works on end result */ protectedQuaternionBits(td->protectflag, td->ext->quat, td->ext->iquat); } else { float obmat[3][3]; - + /* are there ipo keys? */ if(td->tdi) { TransDataIpokey *tdi= td->tdi; float current_rot[3]; float rot[3]; - + /* current IPO value for compatible euler */ current_rot[0] = (tdi->rotx) ? tdi->rotx[0] : 0.0f; current_rot[1] = (tdi->roty) ? tdi->roty[0] : 0.0f; current_rot[2] = (tdi->rotz) ? tdi->rotz[0] : 0.0f; VecMulf(current_rot, (float)(M_PI_2 / 9.0)); - + /* calculate the total rotatation in eulers */ VecAddf(eul, td->ext->irot, td->ext->drot); EulToMat3(eul, obmat); /* mat = transform, obmat = object rotation */ Mat3MulMat3(fmat, mat, obmat); - + Mat3ToCompatibleEul(fmat, eul, current_rot); - + /* correct back for delta rot */ if(tdi->flag & TOB_IPODROT) { VecSubf(rot, eul, td->ext->irot); @@ -2829,12 +2832,12 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short else { VecSubf(rot, eul, td->ext->drot); } - + VecMulf(rot, (float)(9.0/M_PI_2)); VecSubf(rot, rot, tdi->oldrot); - + protectedRotateBits(td->protectflag, rot, tdi->oldrot); - + add_tdi_poin(tdi->rotx, tdi->oldrot, rot[0]); add_tdi_poin(tdi->roty, tdi->oldrot+1, rot[1]); add_tdi_poin(tdi->rotz, tdi->oldrot+2, rot[2]); @@ -2842,37 +2845,37 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short else { Mat3MulMat3(totmat, mat, td->mtx); Mat3MulMat3(smat, td->smtx, totmat); - + /* calculate the total rotatation in eulers */ VecAddf(eul, td->ext->irot, td->ext->drot); /* we have to correct for delta rot */ EulToMat3(eul, obmat); /* mat = transform, obmat = object rotation */ Mat3MulMat3(fmat, smat, obmat); - + Mat3ToCompatibleEul(fmat, eul, td->ext->rot); - + /* correct back for delta rot */ VecSubf(eul, eul, td->ext->drot); - + /* and apply */ protectedRotateBits(td->protectflag, eul, td->ext->irot); VECCOPY(td->ext->rot, eul); } } - + constraintRotLim(t, td); } } } -static void applyRotation(TransInfo *t, float angle, float axis[3]) +static void applyRotation(TransInfo *t, float angle, float axis[3]) { TransData *td = t->data; float mat[3][3]; int i; VecRotToMat3(axis, angle, mat); - + for(i = 0 ; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) @@ -2880,7 +2883,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3]) if (td->flag & TD_SKIP) continue; - + if (t->con.applyRot) { t->con.applyRot(t, td, axis, NULL); VecRotToMat3(axis, angle * td->factor, mat); @@ -2893,7 +2896,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3]) } } -int Rotation(TransInfo *t, short mval[2]) +int Rotation(TransInfo *t, short mval[2]) { char str[64]; @@ -2909,13 +2912,13 @@ int Rotation(TransInfo *t, short mval[2]) final = t->values[0]; applyNDofInput(&t->ndof, &final); - + snapGrid(t, &final); if (t->con.applyRot) { t->con.applyRot(t, NULL, axis, &final); } - + applySnapping(t, &final); if (hasNumInput(&t->num)) { @@ -2930,7 +2933,7 @@ int Rotation(TransInfo *t, short mval[2]) /* Clamp between -180 and 180 */ while (final >= 180.0) final -= 360.0; - + while (final <= -180.0) final += 360.0; @@ -2945,9 +2948,9 @@ int Rotation(TransInfo *t, short mval[2]) // TRANSFORM_FIX_ME // t->values[0] = final; // used in manipulator // Mat3CpyMat3(t->mat, mat); // used in manipulator - + applyRotation(t, final, axis); - + recalcData(t); ED_area_headerprint(t->sa, str); @@ -2958,13 +2961,13 @@ int Rotation(TransInfo *t, short mval[2]) /* ************************** TRACKBALL *************************** */ -void initTrackball(TransInfo *t) +void initTrackball(TransInfo *t) { t->mode = TFM_TRACKBALL; t->transform = Trackball; - + initMouseInputMode(t, &t->mouse, INPUT_TRACKBALL); - + t->ndof.axis = 40; /* Scale down input for rotation */ t->ndof.factor[0] = 0.2f; @@ -2975,7 +2978,7 @@ void initTrackball(TransInfo *t) t->snap[0] = 0.0f; t->snap[1] = (float)((5.0/180)*M_PI); t->snap[2] = t->snap[1] * 0.2f; - + t->flag |= T_NO_CONSTRAINT; } @@ -2987,7 +2990,7 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a VecRotToMat3(axis1, angles[0], smat); VecRotToMat3(axis2, angles[1], totmat); - + Mat3MulMat3(mat, smat, totmat); for(i = 0 ; i < t->total; i++, td++) { @@ -2996,46 +2999,46 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a if (td->flag & TD_SKIP) continue; - + if (t->flag & T_PROP_EDIT) { VecRotToMat3(axis1, td->factor * angles[0], smat); VecRotToMat3(axis2, td->factor * angles[1], totmat); - + Mat3MulMat3(mat, smat, totmat); } - + ElementRotation(t, td, mat, t->around); } } -int Trackball(TransInfo *t, short mval[2]) +int Trackball(TransInfo *t, short mval[2]) { char str[128]; float axis1[3], axis2[3]; float mat[3][3], totmat[3][3], smat[3][3]; float phi[2]; - + VECCOPY(axis1, t->persinv[0]); VECCOPY(axis2, t->persinv[1]); Normalize(axis1); Normalize(axis2); - + phi[0] = t->values[0]; phi[1] = t->values[1]; - + applyNDofInput(&t->ndof, phi); - + snapGrid(t, phi); - + if (hasNumInput(&t->num)) { char c[40]; - + applyNumInput(&t->num, phi); - + outputNumInput(&(t->num), c); - + sprintf(str, "Trackball: %s %s %s", &c[0], &c[20], t->proptext); - + phi[0] *= (float)(M_PI / 180.0); phi[1] *= (float)(M_PI / 180.0); } @@ -3045,34 +3048,34 @@ int Trackball(TransInfo *t, short mval[2]) VecRotToMat3(axis1, phi[0], smat); VecRotToMat3(axis2, phi[1], totmat); - + Mat3MulMat3(mat, smat, totmat); - + // TRANSFORM_FIX_ME //Mat3CpyMat3(t->mat, mat); // used in manipulator - + applyTrackball(t, axis1, axis2, phi); - + recalcData(t); - + ED_area_headerprint(t->sa, str); - + return 1; } /* ************************** TRANSLATION *************************** */ - -void initTranslation(TransInfo *t) + +void initTranslation(TransInfo *t) { t->mode = TFM_TRANSLATION; t->transform = Translation; - + initMouseInputMode(t, &t->mouse, INPUT_VECTOR); t->idx_max = (t->flag & T_2D_EDIT)? 1: 2; t->num.flag = 0; t->num.idx_max = t->idx_max; - + t->ndof.axis = (t->flag & T_2D_EDIT)? 1|2: 1|2|4; if(t->spacetype == SPACE_VIEW3D) { @@ -3098,7 +3101,7 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str) { char distvec[20]; char autoik[20]; float dist; - + if (hasNumInput(&t->num)) { outputNumInput(&(t->num), tvec); dist = VecLength(t->num.val); @@ -3119,10 +3122,10 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str) { sprintf(distvec, "%.4e", dist); else sprintf(distvec, "%.4f", dist); - + if(t->flag & T_AUTOIK) { short chainlen= t->settings->autoik_chainlen; - + if(chainlen) sprintf(autoik, "AutoIK-Len: %d", chainlen); else @@ -3159,10 +3162,10 @@ static void applyTranslation(TransInfo *t, float vec[3]) { for(i = 0 ; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) break; - + if (td->flag & TD_SKIP) continue; - + /* handle snapping rotation before doing the translation */ if (usingSnappingNormal(t)) { @@ -3173,22 +3176,22 @@ static void applyTranslation(TransInfo *t, float vec[3]) { float quat[4]; float mat[3][3]; float angle; - + Crossf(axis, original_normal, t->tsnap.snapNormal); angle = saacos(Inpf(original_normal, t->tsnap.snapNormal)); - + AxisAngleToQuat(quat, axis, angle); - + QuatToMat3(quat, mat); - + ElementRotation(t, td, mat, V3D_LOCAL); } else { float mat[3][3]; - + Mat3One(mat); - + ElementRotation(t, td, mat, V3D_LOCAL); } } @@ -3200,12 +3203,12 @@ static void applyTranslation(TransInfo *t, float vec[3]) { else { VECCOPY(tvec, vec); } - + Mat3MulVecfl(td->smtx, tvec); VecMulf(tvec, td->factor); - + protectedTransBits(td->protectflag, tvec); - + /* transdata ipokey */ if(td->tdi) { TransDataIpokey *tdi= td->tdi; @@ -3214,17 +3217,17 @@ static void applyTranslation(TransInfo *t, float vec[3]) { add_tdi_poin(tdi->locz, tdi->oldloc+2, tvec[2]); } else VecAddf(td->loc, td->iloc, tvec); - + constraintTransLim(t, td); } } /* uses t->vec to store actual translation in */ -int Translation(TransInfo *t, short mval[2]) +int Translation(TransInfo *t, short mval[2]) { float tvec[3]; char str[250]; - + if (t->con.mode & CON_APPLY) { float pvec[3] = {0.0f, 0.0f, 0.0f}; applySnapping(t, t->values); @@ -3240,11 +3243,11 @@ int Translation(TransInfo *t, short mval[2]) { removeAspectRatio(t, t->values); } - + applySnapping(t, t->values); headerTranslation(t, t->values, str); } - + applyTranslation(t, t->values); /* evil hack - redo translation if clipping needed */ @@ -3260,7 +3263,7 @@ int Translation(TransInfo *t, short mval[2]) /* ************************** SHRINK/FATTEN *************************** */ -void initShrinkFatten(TransInfo *t) +void initShrinkFatten(TransInfo *t) { // If not in mesh edit mode, fallback to Resize if (t->obedit==NULL || t->obedit->type != OB_MESH) { @@ -3269,22 +3272,22 @@ void initShrinkFatten(TransInfo *t) else { t->mode = TFM_SHRINKFATTEN; t->transform = ShrinkFatten; - + initMouseInputMode(t, &t->mouse, INPUT_VERTICAL_ABSOLUTE); - + t->idx_max = 0; t->num.idx_max = 0; t->snap[0] = 0.0f; t->snap[1] = 1.0f; t->snap[2] = t->snap[1] * 0.1f; - + t->flag |= T_NO_CONSTRAINT; } } -int ShrinkFatten(TransInfo *t, short mval[2]) +int ShrinkFatten(TransInfo *t, short mval[2]) { float vec[3]; float distance; @@ -3310,8 +3313,8 @@ int ShrinkFatten(TransInfo *t, short mval[2]) /* default header print */ sprintf(str, "Shrink/Fatten: %.4f %s", distance, t->proptext); } - - + + for(i = 0 ; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) break; @@ -3335,11 +3338,11 @@ int ShrinkFatten(TransInfo *t, short mval[2]) /* ************************** TILT *************************** */ -void initTilt(TransInfo *t) +void initTilt(TransInfo *t) { t->mode = TFM_TILT; t->transform = Tilt; - + initMouseInputMode(t, &t->mouse, INPUT_ANGLE); t->ndof.axis = 16; @@ -3351,13 +3354,13 @@ void initTilt(TransInfo *t) t->snap[0] = 0.0f; t->snap[1] = (float)((5.0/180)*M_PI); t->snap[2] = t->snap[1] * 0.2f; - + t->flag |= T_NO_CONSTRAINT; } -int Tilt(TransInfo *t, short mval[2]) +int Tilt(TransInfo *t, short mval[2]) { TransData *td = t->data; int i; @@ -3366,7 +3369,7 @@ int Tilt(TransInfo *t, short mval[2]) float final; final = t->values[0]; - + applyNDofInput(&t->ndof, &final); snapGrid(t, &final); @@ -3412,72 +3415,72 @@ void initCurveShrinkFatten(TransInfo *t) { t->mode = TFM_CURVE_SHRINKFATTEN; t->transform = CurveShrinkFatten; - + initMouseInputMode(t, &t->mouse, INPUT_SPRING); - + t->idx_max = 0; t->num.idx_max = 0; t->snap[0] = 0.0f; t->snap[1] = 0.1f; t->snap[2] = t->snap[1] * 0.1f; - + t->flag |= T_NO_CONSTRAINT; } -int CurveShrinkFatten(TransInfo *t, short mval[2]) +int CurveShrinkFatten(TransInfo *t, short mval[2]) { TransData *td = t->data; float ratio; int i; char str[50]; - + ratio = t->values[0]; - + snapGrid(t, &ratio); - + applyNumInput(&t->num, &ratio); - + /* header print for NumInput */ if (hasNumInput(&t->num)) { char c[20]; - + outputNumInput(&(t->num), c); sprintf(str, "Shrink/Fatten: %s", c); } else { sprintf(str, "Shrink/Fatten: %3f", ratio); } - + for(i = 0 ; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) break; if (td->flag & TD_SKIP) continue; - + if(td->val) { //*td->val= ratio; *td->val= td->ival*ratio; if (*td->val <= 0.0f) *td->val = 0.0001f; } } - + recalcData(t); - + ED_area_headerprint(t->sa, str); - + return 1; } /* ************************** PUSH/PULL *************************** */ -void initPushPull(TransInfo *t) +void initPushPull(TransInfo *t) { t->mode = TFM_PUSHPULL; t->transform = PushPull; - + initMouseInputMode(t, &t->mouse, INPUT_VERTICAL_ABSOLUTE); - + t->ndof.axis = 4; /* Flip direction */ t->ndof.factor[0] = -1.0f; @@ -3490,7 +3493,7 @@ void initPushPull(TransInfo *t) } -int PushPull(TransInfo *t, short mval[2]) +int PushPull(TransInfo *t, short mval[2]) { float vec[3], axis[3]; float distance; @@ -3499,7 +3502,7 @@ int PushPull(TransInfo *t, short mval[2]) TransData *td = t->data; distance = t->values[0]; - + applyNDofInput(&t->ndof, &distance); snapGrid(t, &distance); @@ -3518,11 +3521,11 @@ int PushPull(TransInfo *t, short mval[2]) /* default header print */ sprintf(str, "Push/Pull: %.4f%s %s", distance, t->con.text, t->proptext); } - + if (t->con.applyRot && t->con.mode & CON_APPLY) { t->con.applyRot(t, NULL, axis, NULL); } - + for(i = 0 ; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) break; @@ -3558,11 +3561,11 @@ int PushPull(TransInfo *t, short mval[2]) /* ************************** BEVEL **************************** */ -void initBevel(TransInfo *t) +void initBevel(TransInfo *t) { t->transform = Bevel; t->handleEvent = handleEventBevel; - + initMouseInputMode(t, &t->mouse, INPUT_HORIZONTAL_ABSOLUTE); t->mode = TFM_BEVEL; @@ -3631,7 +3634,7 @@ int Bevel(TransInfo *t, short mval[2]) mode = (G.editBMesh->options & BME_BEVEL_VERT) ? "verts only" : "normal"; distance = t->values[0] / 4; /* 4 just seemed a nice value to me, nothing special */ - + distance = fabs(distance); snapGrid(t, &distance); @@ -3650,7 +3653,7 @@ int Bevel(TransInfo *t, short mval[2]) /* default header print */ sprintf(str, "Bevel - Dist: %.4f, Mode: %s (MMB to toggle))", distance, mode); } - + if (distance < 0) distance = -distance; for(i = 0 ; i < t->total; i++, td++) { if (td->axismtx[1][0] > 0 && distance > td->axismtx[1][0]) { @@ -3671,23 +3674,23 @@ int Bevel(TransInfo *t, short mval[2]) /* ************************** BEVEL WEIGHT *************************** */ -void initBevelWeight(TransInfo *t) +void initBevelWeight(TransInfo *t) { t->mode = TFM_BWEIGHT; t->transform = BevelWeight; - + initMouseInputMode(t, &t->mouse, INPUT_SPRING); - + t->idx_max = 0; t->num.idx_max = 0; t->snap[0] = 0.0f; t->snap[1] = 0.1f; t->snap[2] = t->snap[1] * 0.1f; - + t->flag |= T_NO_CONSTRAINT; } -int BevelWeight(TransInfo *t, short mval[2]) +int BevelWeight(TransInfo *t, short mval[2]) { TransData *td = t->data; float weight; @@ -3721,7 +3724,7 @@ int BevelWeight(TransInfo *t, short mval[2]) else sprintf(str, "Bevel Weight: %.3f %s", weight, t->proptext); } - + for(i = 0 ; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) break; @@ -3742,23 +3745,23 @@ int BevelWeight(TransInfo *t, short mval[2]) /* ************************** CREASE *************************** */ -void initCrease(TransInfo *t) +void initCrease(TransInfo *t) { t->mode = TFM_CREASE; t->transform = Crease; - + initMouseInputMode(t, &t->mouse, INPUT_SPRING); - + t->idx_max = 0; t->num.idx_max = 0; t->snap[0] = 0.0f; t->snap[1] = 0.1f; t->snap[2] = t->snap[1] * 0.1f; - + t->flag |= T_NO_CONSTRAINT; } -int Crease(TransInfo *t, short mval[2]) +int Crease(TransInfo *t, short mval[2]) { TransData *td = t->data; float crease; @@ -3792,7 +3795,7 @@ int Crease(TransInfo *t, short mval[2]) else sprintf(str, "Crease: %.3f %s", crease, t->proptext); } - + for(i = 0 ; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) break; @@ -3820,9 +3823,9 @@ void initBoneSize(TransInfo *t) { t->mode = TFM_BONESIZE; t->transform = BoneSize; - + initMouseInputMode(t, &t->mouse, INPUT_SPRING_FLIP); - + t->idx_max = 2; t->num.idx_max = 2; t->num.flag |= NUM_NULL_ONE; @@ -3846,7 +3849,7 @@ static void headerBoneSize(TransInfo *t, float vec[3], char *str) { if (t->con.mode & CON_APPLY) { if (t->num.idx_max == 0) sprintf(str, "ScaleB: %s%s %s", &tvec[0], t->con.text, t->proptext); - else + else sprintf(str, "ScaleB: %s : %s : %s%s %s", &tvec[0], &tvec[20], &tvec[40], t->con.text, t->proptext); } else { @@ -3854,18 +3857,18 @@ static void headerBoneSize(TransInfo *t, float vec[3], char *str) { } } -static void ElementBoneSize(TransInfo *t, TransData *td, float mat[3][3]) +static void ElementBoneSize(TransInfo *t, TransData *td, float mat[3][3]) { float tmat[3][3], smat[3][3], oldy; float sizemat[3][3]; - + Mat3MulMat3(smat, mat, td->mtx); Mat3MulMat3(tmat, td->smtx, smat); - + if (t->con.applySize) { t->con.applySize(t, td, tmat); } - + /* we've tucked the scale in loc */ oldy= td->iloc[1]; SizeToMat3(td->iloc, sizemat); @@ -3874,14 +3877,14 @@ static void ElementBoneSize(TransInfo *t, TransData *td, float mat[3][3]) td->loc[1]= oldy; } -int BoneSize(TransInfo *t, short mval[2]) +int BoneSize(TransInfo *t, short mval[2]) { TransData *td = t->data; float size[3], mat[3][3]; float ratio; int i; char str[60]; - + // TRANSFORM_FIX_ME MOVE TO MOUSE INPUT /* for manipulator, center handle, the scaling can't be done relative to center */ if( (t->flag & T_USES_MANIPULATOR) && t->con.mode==0) @@ -3892,40 +3895,40 @@ int BoneSize(TransInfo *t, short mval[2]) { ratio = t->values[0]; } - + size[0] = size[1] = size[2] = ratio; - + snapGrid(t, size); - + if (hasNumInput(&t->num)) { applyNumInput(&t->num, size); constraintNumInput(t, size); } - + SizeToMat3(size, mat); - + if (t->con.applySize) { t->con.applySize(t, NULL, mat); } - + Mat3CpyMat3(t->mat, mat); // used in manipulator - + headerBoneSize(t, size, str); - + for(i = 0 ; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) break; if (td->flag & TD_SKIP) continue; - + ElementBoneSize(t, td, mat); } - + recalcData(t); - + ED_area_headerprint(t->sa, str); - + return 1; } @@ -3936,9 +3939,9 @@ void initBoneEnvelope(TransInfo *t) { t->mode = TFM_BONE_ENVELOPE; t->transform = BoneEnvelope; - + initMouseInputMode(t, &t->mouse, INPUT_SPRING); - + t->idx_max = 0; t->num.idx_max = 0; t->snap[0] = 0.0f; @@ -3948,37 +3951,37 @@ void initBoneEnvelope(TransInfo *t) t->flag |= T_NO_CONSTRAINT; } -int BoneEnvelope(TransInfo *t, short mval[2]) +int BoneEnvelope(TransInfo *t, short mval[2]) { TransData *td = t->data; float ratio; int i; char str[50]; - + ratio = t->values[0]; - + snapGrid(t, &ratio); - + applyNumInput(&t->num, &ratio); - + /* header print for NumInput */ if (hasNumInput(&t->num)) { char c[20]; - + outputNumInput(&(t->num), c); sprintf(str, "Envelope: %s", c); } else { sprintf(str, "Envelope: %3f", ratio); } - + for(i = 0 ; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) break; if (td->flag & TD_SKIP) continue; - + if (td->val) { /* if the old/original value was 0.0f, then just use ratio */ if (td->ival) @@ -3987,11 +3990,11 @@ int BoneEnvelope(TransInfo *t, short mval[2]) *td->val= ratio; } } - + recalcData(t); - + ED_area_headerprint(t->sa, str); - + return 1; } @@ -4002,7 +4005,7 @@ void initBoneRoll(TransInfo *t) { t->mode = TFM_BONE_ROLL; t->transform = BoneRoll; - + initMouseInputMode(t, &t->mouse, INPUT_ANGLE); t->idx_max = 0; @@ -4010,11 +4013,11 @@ void initBoneRoll(TransInfo *t) t->snap[0] = 0.0f; t->snap[1] = (float)((5.0/180)*M_PI); t->snap[2] = t->snap[1] * 0.2f; - + t->flag |= T_NO_CONSTRAINT; } -int BoneRoll(TransInfo *t, short mval[2]) +int BoneRoll(TransInfo *t, short mval[2]) { TransData *td = t->data; int i; @@ -4040,18 +4043,18 @@ int BoneRoll(TransInfo *t, short mval[2]) else { sprintf(str, "Roll: %.2f", 180.0*final/M_PI); } - + /* set roll values */ - for (i = 0; i < t->total; i++, td++) { + for (i = 0; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) break; if (td->flag & TD_SKIP) continue; - + *(td->val) = td->ival - final; } - + recalcData(t); ED_area_headerprint(t->sa, str); @@ -4061,11 +4064,11 @@ int BoneRoll(TransInfo *t, short mval[2]) /* ************************** BAKE TIME ******************* */ -void initBakeTime(TransInfo *t) +void initBakeTime(TransInfo *t) { t->transform = BakeTime; initMouseInputMode(t, &t->mouse, INPUT_NONE); - + t->idx_max = 0; t->num.idx_max = 0; t->snap[0] = 0.0f; @@ -4073,15 +4076,15 @@ void initBakeTime(TransInfo *t) t->snap[2] = t->snap[1] * 0.1f; } -int BakeTime(TransInfo *t, short mval[2]) +int BakeTime(TransInfo *t, short mval[2]) { TransData *td = t->data; float time; int i; char str[50]; - + float fac = 0.1f; - + if(t->mouse.precision) { /* calculate ratio for shiftkey pos, and for total, and blend these for precision */ time= (float)(t->center2d[0] - t->mouse.precision_mval[0]) * fac; @@ -4113,7 +4116,7 @@ int BakeTime(TransInfo *t, short mval[2]) else sprintf(str, "Time: %.3f %s", time, t->proptext); } - + for(i = 0 ; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) break; @@ -4137,7 +4140,7 @@ int BakeTime(TransInfo *t, short mval[2]) /* ************************** MIRROR *************************** */ -void initMirror(TransInfo *t) +void initMirror(TransInfo *t) { t->transform = Mirror; initMouseInputMode(t, &t->mouse, INPUT_NONE); @@ -4148,7 +4151,7 @@ void initMirror(TransInfo *t) } } -int Mirror(TransInfo *t, short mval[2]) +int Mirror(TransInfo *t, short mval[2]) { TransData *td; float size[3], mat[3][3]; @@ -4164,47 +4167,47 @@ int Mirror(TransInfo *t, short mval[2]) /* if an axis has been selected */ if (t->con.mode & CON_APPLY) { size[0] = size[1] = size[2] = -1; - + SizeToMat3(size, mat); - + if (t->con.applySize) { t->con.applySize(t, NULL, mat); } - + sprintf(str, "Mirror%s", t->con.text); - + for(i = 0, td=t->data; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) break; - + if (td->flag & TD_SKIP) continue; - + ElementResize(t, td, mat); } - + recalcData(t); - + ED_area_headerprint(t->sa, str); } else { size[0] = size[1] = size[2] = 1; - + SizeToMat3(size, mat); - + for(i = 0, td=t->data; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) break; - + if (td->flag & TD_SKIP) continue; - + ElementResize(t, td, mat); } - + recalcData(t); - + ED_area_headerprint(t->sa, "Select a mirror axis (X, Y, Z)"); } @@ -4213,12 +4216,12 @@ int Mirror(TransInfo *t, short mval[2]) /* ************************** ALIGN *************************** */ -void initAlign(TransInfo *t) +void initAlign(TransInfo *t) { t->flag |= T_NO_CONSTRAINT; - + t->transform = Align; - + initMouseInputMode(t, &t->mouse, INPUT_NONE); } @@ -4234,13 +4237,13 @@ int Align(TransInfo *t, short mval[2]) for(i = 0 ; i < t->total; i++, td++) { float mat[3][3], invmat[3][3]; - + if (td->flag & TD_NOACTION) break; if (td->flag & TD_SKIP) continue; - + /* around local centers */ if (t->flag & (T_OBJECT|T_POSE)) { VECCOPY(t->center, td->center); @@ -4252,19 +4255,19 @@ int Align(TransInfo *t, short mval[2]) } Mat3Inv(invmat, td->axismtx); - - Mat3MulMat3(mat, t->spacemtx, invmat); + + Mat3MulMat3(mat, t->spacemtx, invmat); ElementRotation(t, td, mat, t->around); } /* restoring original center */ VECCOPY(t->center, center); - + recalcData(t); ED_area_headerprint(t->sa, "Align"); - + return 1; } @@ -4273,37 +4276,37 @@ int Align(TransInfo *t, short mval[2]) /* ---------------- Special Helpers for Various Settings ------------- */ -/* This function returns the snapping 'mode' for Animation Editors only +/* This function returns the snapping 'mode' for Animation Editors only * We cannot use the standard snapping due to NLA-strip scaling complexities. */ // XXX these modifier checks should be keymappable static short getAnimEdit_SnapMode(TransInfo *t) { short autosnap= SACTSNAP_OFF; - + /* currently, some of these are only for the action editor */ if (t->spacetype == SPACE_ACTION) { SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first; - + if (saction) autosnap= saction->autosnap; } else if (t->spacetype == SPACE_IPO) { SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first; - + if (sipo) autosnap= sipo->autosnap; } else if (t->spacetype == SPACE_NLA) { SpaceNla *snla= (SpaceNla *)t->sa->spacedata.first; - + if (snla) autosnap= snla->autosnap; } else { // TRANSFORM_FIX_ME This needs to use proper defines for t->modifiers // // FIXME: this still toggles the modes... -// if (ctrl) +// if (ctrl) // autosnap= SACTSNAP_STEP; // else if (shift) // autosnap= SACTSNAP_FRAME; @@ -4312,38 +4315,38 @@ static short getAnimEdit_SnapMode(TransInfo *t) // else autosnap= SACTSNAP_OFF; } - + return autosnap; } /* This function is used for testing if an Animation Editor is displaying * its data in frames or seconds (and the data needing to be edited as such). - * Returns 1 if in seconds, 0 if in frames + * Returns 1 if in seconds, 0 if in frames */ static short getAnimEdit_DrawTime(TransInfo *t) { short drawtime; - + /* currently, some of these are only for the action editor */ if (t->spacetype == SPACE_ACTION) { SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first; - + drawtime = (saction->flag & SACTION_DRAWTIME)? 1 : 0; } else if (t->spacetype == SPACE_NLA) { SpaceNla *snla= (SpaceNla *)t->sa->spacedata.first; - + drawtime = (snla->flag & SNLA_DRAWTIME)? 1 : 0; } else { drawtime = 0; } - + return drawtime; -} +} -/* This function is used by Animation Editor specific transform functions to do +/* This function is used by Animation Editor specific transform functions to do * the Snap Keyframe to Nearest Frame/Marker */ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, AnimData *adt, short autosnap) @@ -4354,19 +4357,19 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, AnimData *adt, sho const short doTime= getAnimEdit_DrawTime(t); const double secf= FPS; double val; - + /* convert frame to nla-action time (if needed) */ - if (adt) + if (adt) val= BKE_nla_tweakedit_remap(adt, *(td->val), NLATIME_CONVERT_MAP); else val= *(td->val); - + /* do the snapping to nearest frame/second */ if (doTime) val= (float)( floor((val/secf) + 0.5f) * secf ); else val= (float)( floor(val+0.5f) ); - + /* convert frame out of nla-action time */ if (adt) *(td->val)= BKE_nla_tweakedit_remap(adt, val, NLATIME_CONVERT_UNMAP); @@ -4376,17 +4379,17 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, AnimData *adt, sho /* snap key to nearest marker? */ else if (autosnap == SACTSNAP_MARKER) { float val; - + /* convert frame to nla-action time (if needed) */ - if (adt) + if (adt) val= BKE_nla_tweakedit_remap(adt, *(td->val), NLATIME_CONVERT_MAP); else val= *(td->val); - + /* snap to nearest marker */ // TODO: need some more careful checks for where data comes from val= (float)ED_markers_find_nearest_marker_time(&t->scene->markers, val); - + /* convert frame out of nla-action time */ if (adt) *(td->val)= BKE_nla_tweakedit_remap(adt, val, NLATIME_CONVERT_UNMAP); @@ -4397,27 +4400,27 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, AnimData *adt, sho /* ----------------- Translation ----------------------- */ -void initTimeTranslate(TransInfo *t) +void initTimeTranslate(TransInfo *t) { t->mode = TFM_TIME_TRANSLATE; t->transform = TimeTranslate; - + initMouseInputMode(t, &t->mouse, INPUT_NONE); /* num-input has max of (n-1) */ t->idx_max = 0; t->num.flag = 0; t->num.idx_max = t->idx_max; - + /* initialise snap like for everything else */ - t->snap[0] = 0.0f; + t->snap[0] = 0.0f; t->snap[1] = t->snap[2] = 1.0f; } -static void headerTimeTranslate(TransInfo *t, char *str) +static void headerTimeTranslate(TransInfo *t, char *str) { char tvec[60]; - + /* if numeric input is active, use results from that, otherwise apply snapping to result */ if (hasNumInput(&t->num)) { outputNumInput(&(t->num), tvec); @@ -4428,7 +4431,7 @@ static void headerTimeTranslate(TransInfo *t, char *str) const short doTime = getAnimEdit_DrawTime(t); const double secf= FPS; float val = t->values[0]; - + /* apply snapping + frame->seconds conversions */ if (autosnap == SACTSNAP_STEP) { if (doTime) @@ -4440,86 +4443,86 @@ static void headerTimeTranslate(TransInfo *t, char *str) if (doTime) val= val / secf; } - + sprintf(&tvec[0], "%.4f", val); } - + sprintf(str, "DeltaX: %s", &tvec[0]); } -static void applyTimeTranslate(TransInfo *t, float sval) +static void applyTimeTranslate(TransInfo *t, float sval) { TransData *td = t->data; Scene *scene = t->scene; int i; - + const short doTime= getAnimEdit_DrawTime(t); const double secf= FPS; - + const short autosnap= getAnimEdit_SnapMode(t); - + float deltax, val; - + /* it doesn't matter whether we apply to t->data or t->data2d, but t->data2d is more convenient */ for (i = 0 ; i < t->total; i++, td++) { /* it is assumed that td->extra is a pointer to the AnimData, - * whose active action is where this keyframe comes from + * whose active action is where this keyframe comes from * (this is only valid when not in NLA) */ AnimData *adt= (t->spacetype != SPACE_NLA) ? td->extra : NULL; - + /* check if any need to apply nla-mapping */ if (adt) { deltax = t->values[0]; - + if (autosnap == SACTSNAP_STEP) { - if (doTime) + if (doTime) deltax= (float)( floor((deltax/secf) + 0.5f) * secf ); else deltax= (float)( floor(deltax + 0.5f) ); } - + val = BKE_nla_tweakedit_remap(adt, td->ival, NLATIME_CONVERT_MAP); val += deltax; *(td->val) = BKE_nla_tweakedit_remap(adt, val, NLATIME_CONVERT_UNMAP); } else { deltax = val = t->values[0]; - + if (autosnap == SACTSNAP_STEP) { if (doTime) val= (float)( floor((deltax/secf) + 0.5f) * secf ); else val= (float)( floor(val + 0.5f) ); } - + *(td->val) = td->ival + val; } - + /* apply nearest snapping */ doAnimEdit_SnapFrame(t, td, adt, autosnap); } } -int TimeTranslate(TransInfo *t, short mval[2]) +int TimeTranslate(TransInfo *t, short mval[2]) { View2D *v2d = (View2D *)t->view; float cval[2], sval[2]; char str[200]; - + /* calculate translation amount from mouse movement - in 'time-grid space' */ UI_view2d_region_to_view(v2d, mval[0], mval[0], &cval[0], &cval[1]); UI_view2d_region_to_view(v2d, t->imval[0], t->imval[0], &sval[0], &sval[1]); - + /* we only need to calculate effect for time (applyTimeTranslate only needs that) */ t->values[0] = cval[0] - sval[0]; - + /* handle numeric-input stuff */ t->vec[0] = t->values[0]; applyNumInput(&t->num, &t->vec[0]); t->values[0] = t->vec[0]; headerTimeTranslate(t, str); - + applyTimeTranslate(t, sval[0]); recalcData(t); @@ -4531,36 +4534,36 @@ int TimeTranslate(TransInfo *t, short mval[2]) /* ----------------- Time Slide ----------------------- */ -void initTimeSlide(TransInfo *t) +void initTimeSlide(TransInfo *t) { /* this tool is only really available in the Action Editor... */ if (t->spacetype == SPACE_ACTION) { SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first; - + /* set flag for drawing stuff */ saction->flag |= SACTION_MOVING; } - + t->mode = TFM_TIME_SLIDE; t->transform = TimeSlide; t->flag |= T_FREE_CUSTOMDATA; - + initMouseInputMode(t, &t->mouse, INPUT_NONE); /* num-input has max of (n-1) */ t->idx_max = 0; t->num.flag = 0; t->num.idx_max = t->idx_max; - + /* initialise snap like for everything else */ - t->snap[0] = 0.0f; + t->snap[0] = 0.0f; t->snap[1] = t->snap[2] = 1.0f; } -static void headerTimeSlide(TransInfo *t, float sval, char *str) +static void headerTimeSlide(TransInfo *t, float sval, char *str) { char tvec[60]; - + if (hasNumInput(&t->num)) { outputNumInput(&(t->num), tvec); } @@ -4569,50 +4572,50 @@ static void headerTimeSlide(TransInfo *t, float sval, char *str) float maxx= *((float *)(t->customData) + 1); float cval= t->values[0]; float val; - + val= 2.0f*(cval-sval) / (maxx-minx); CLAMP(val, -1.0f, 1.0f); - + sprintf(&tvec[0], "%.4f", val); } - + sprintf(str, "TimeSlide: %s", &tvec[0]); } -static void applyTimeSlide(TransInfo *t, float sval) +static void applyTimeSlide(TransInfo *t, float sval) { TransData *td = t->data; int i; - + float minx= *((float *)(t->customData)); float maxx= *((float *)(t->customData) + 1); - + /* set value for drawing black line */ if (t->spacetype == SPACE_ACTION) { SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first; float cvalf = t->values[0]; - + saction->timeslide= cvalf; } - + /* it doesn't matter whether we apply to t->data or t->data2d, but t->data2d is more convenient */ for (i = 0 ; i < t->total; i++, td++) { /* it is assumed that td->extra is a pointer to the AnimData, - * whose active action is where this keyframe comes from + * whose active action is where this keyframe comes from * (this is only valid when not in NLA) */ AnimData *adt= (t->spacetype != SPACE_NLA) ? td->extra : NULL; float cval = t->values[0]; - + /* apply NLA-mapping to necessary values */ if (adt) cval= BKE_nla_tweakedit_remap(adt, cval, NLATIME_CONVERT_UNMAP); - + /* only apply to data if in range */ if ((sval > minx) && (sval < maxx)) { float cvalc= CLAMPIS(cval, minx, maxx); float timefac; - + /* left half? */ if (td->ival < sval) { timefac= (sval - td->ival) / (sval - minx); @@ -4626,26 +4629,26 @@ static void applyTimeSlide(TransInfo *t, float sval) } } -int TimeSlide(TransInfo *t, short mval[2]) +int TimeSlide(TransInfo *t, short mval[2]) { View2D *v2d = (View2D *)t->view; float cval[2], sval[2]; float minx= *((float *)(t->customData)); float maxx= *((float *)(t->customData) + 1); char str[200]; - + /* calculate mouse co-ordinates */ UI_view2d_region_to_view(v2d, mval[0], mval[0], &cval[0], &cval[1]); UI_view2d_region_to_view(v2d, t->imval[0], t->imval[0], &sval[0], &sval[1]); - + /* t->values[0] stores cval[0], which is the current mouse-pointer location (in frames) */ t->values[0] = cval[0]; - + /* handle numeric-input stuff */ t->vec[0] = 2.0f*(cval[0]-sval[0]) / (maxx-minx); applyNumInput(&t->num, &t->vec[0]); t->values[0] = (maxx-minx) * t->vec[0] / 2.0 + sval[0]; - + headerTimeSlide(t, sval[0], str); applyTimeSlide(t, sval[0]); @@ -4658,35 +4661,35 @@ int TimeSlide(TransInfo *t, short mval[2]) /* ----------------- Scaling ----------------------- */ -void initTimeScale(TransInfo *t) +void initTimeScale(TransInfo *t) { t->mode = TFM_TIME_SCALE; t->transform = TimeScale; - + initMouseInputMode(t, &t->mouse, INPUT_NONE); t->helpline = HLP_SPRING; /* set manually because we don't use a predefined input */ t->flag |= T_NULL_ONE; t->num.flag |= NUM_NULL_ONE; - + /* num-input has max of (n-1) */ t->idx_max = 0; t->num.flag = 0; t->num.idx_max = t->idx_max; - + /* initialise snap like for everything else */ - t->snap[0] = 0.0f; + t->snap[0] = 0.0f; t->snap[1] = t->snap[2] = 1.0f; } static void headerTimeScale(TransInfo *t, char *str) { char tvec[60]; - + if (hasNumInput(&t->num)) outputNumInput(&(t->num), tvec); else sprintf(&tvec[0], "%.4f", t->values[0]); - + sprintf(str, "ScaleX: %s", &tvec[0]); } @@ -4694,63 +4697,63 @@ static void applyTimeScale(TransInfo *t) { Scene *scene = t->scene; TransData *td = t->data; int i; - + const short autosnap= getAnimEdit_SnapMode(t); const short doTime= getAnimEdit_DrawTime(t); const double secf= FPS; - - + + for (i = 0 ; i < t->total; i++, td++) { /* it is assumed that td->extra is a pointer to the AnimData, - * whose active action is where this keyframe comes from + * whose active action is where this keyframe comes from * (this is only valid when not in NLA) */ AnimData *adt= (t->spacetype != SPACE_NLA) ? td->extra : NULL; float startx= CFRA; float fac= t->values[0]; - + if (autosnap == SACTSNAP_STEP) { if (doTime) fac= (float)( floor(fac/secf + 0.5f) * secf ); else fac= (float)( floor(fac + 0.5f) ); } - + /* check if any need to apply nla-mapping */ if (adt) startx= BKE_nla_tweakedit_remap(adt, startx, NLATIME_CONVERT_UNMAP); - + /* now, calculate the new value */ *(td->val) = td->ival - startx; *(td->val) *= fac; *(td->val) += startx; - + /* apply nearest snapping */ doAnimEdit_SnapFrame(t, td, adt, autosnap); } } -int TimeScale(TransInfo *t, short mval[2]) +int TimeScale(TransInfo *t, short mval[2]) { float cval, sval; float deltax, startx; float width= 0.0f; char str[200]; - + sval= t->imval[0]; cval= mval[0]; - + /* calculate scaling factor */ startx= sval-(width/2+(t->ar->winx)/2); deltax= cval-(width/2+(t->ar->winx)/2); t->values[0] = deltax / startx; - + /* handle numeric-input stuff */ t->vec[0] = t->values[0]; applyNumInput(&t->num, &t->vec[0]); t->values[0] = t->vec[0]; headerTimeScale(t, str); - + applyTimeScale(t); recalcData(t); @@ -4789,7 +4792,7 @@ void NDofTransform() maxval = val; } } - + switch(axis) { case -1: @@ -4810,7 +4813,7 @@ void NDofTransform() default: printf("ndof: what we are doing here ?"); } - + if (mode != 0) { initTransform(mode, CTX_NDOF); diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 74cf1df1fa5..ed825886a05 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -71,7 +71,7 @@ typedef struct NumInput { /* The ctrl value has different meaning: 0 : No value has been typed - + otherwise, |value| - 1 is where the cursor is located after the period Positive : number is positive Negative : number is negative @@ -100,7 +100,7 @@ typedef struct TransCon { float mtx[3][3]; /* Matrix of the Constraint space */ float imtx[3][3]; /* Inverse Matrix of the Constraint space */ float pmtx[3][3]; /* Projection Constraint Matrix (same as imtx with some axis == 0) */ - float center[3]; /* transformation center to define where to draw the view widget + float center[3]; /* transformation center to define where to draw the view widget ALWAYS in global space. Unlike the transformation center */ short imval[2]; /* initial mouse value for visual calculation */ /* the one in TransInfo is not garanty to stay the same (Rotates change it) */ @@ -138,7 +138,7 @@ typedef struct TransDataExtension { float iquat[4]; /* Initial rotation quaternion */ float *size; /* Size of the data to transform (Faculative) */ float isize[3]; /* Initial size */ - float obmat[4][4]; /* Object matrix */ + float obmat[4][4]; /* Object matrix */ } TransDataExtension; typedef struct TransData2D { @@ -158,7 +158,7 @@ typedef struct TransDataSeq { int flag; /* a copy of seq->flag that may be modified for nested strips */ short start_offset; /* use this so we can have transform data at the strips start, but apply correctly to the start frame */ short sel_flag; /* one of SELECT, SEQ_LEFTSEL and SEQ_RIGHTSEL */ - + } TransDataSeq; /* for NLA transform (stored in td->extra pointer) */ @@ -200,9 +200,9 @@ typedef struct TransData { typedef struct MouseInput { void (*apply)(struct TransInfo *, struct MouseInput *, short [2], float [3]); - + short imval[2]; /* initial mouse position */ - char precision; + char precision; short precision_mval[2]; /* mouse position when precision key was pressed */ int center[2]; float factor; @@ -239,7 +239,7 @@ typedef struct TransInfo { short idx_max; /* maximum index on the input vector */ float snap[3]; /* Snapping Gears */ char frame_side; /* Mouse side of the cfra, 'L', 'R' or 'B' */ - + float viewmat[4][4]; /* copy from G.vd, prevents feedback, */ float viewinv[4][4]; /* and to make sure we don't have to */ float persmat[4][4]; /* access G.vd from other space types */ @@ -248,16 +248,16 @@ typedef struct TransInfo { short around; char spacetype; /* spacetype where transforming is */ char helpline; /* helpline modes (not to be confused with hotline) */ - + float vec[3]; /* translation, to show for widget */ float mat[3][3]; /* rot/rescale, to show for widget */ - + char *undostr; /* if set, uses this string for undo */ float spacemtx[3][3]; /* orientation matrix of the current space */ char spacename[32]; /* name of the current space */ - + struct Object *poseobj; /* if t->flag & T_POSE, this denotes pose object */ - + void *customData; /* Per Transform custom data */ /*************** NEW STUFF *********************/ @@ -303,7 +303,7 @@ typedef struct TransInfo { #define T_POSE (1 << 2) #define T_TEXTURE (1 << 3) #define T_CAMERA (1 << 4) - // trans on points, having no rotation/scale + // trans on points, having no rotation/scale #define T_POINTS (1 << 6) // for manipulator exceptions, like scaling using center point, drawing help lines #define T_USES_MANIPULATOR (1 << 7) @@ -319,7 +319,7 @@ typedef struct TransInfo { #define T_V3D_ALIGN (1 << 14) /* for 2d views like uv or ipo */ -#define T_2D_EDIT (1 << 15) +#define T_2D_EDIT (1 << 15) #define T_CLIP_UV (1 << 16) #define T_FREE_CUSTOMDATA (1 << 17) @@ -507,6 +507,8 @@ void special_aftertrans_update(TransInfo *t); void transform_autoik_update(TransInfo *t, short mode); +int count_set_pose_transflags(int *out_mode, short around, struct Object *ob); + /* auto-keying stuff used by special_aftertrans_update */ short autokeyframe_cfra_can_key(struct Scene *scene, struct Object *ob); void autokeyframe_ob_cb_func(struct Scene *scene, struct View3D *v3d, struct Object *ob, int tmode); @@ -607,8 +609,6 @@ void calculatePropRatio(TransInfo *t); void getViewVector(TransInfo *t, float coord[3], float vec[3]); -TransInfo * BIF_GetTransInfo(void); - /*********************** NumInput ********************************/ void initNumInput(NumInput *n); diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 7f47bfd25af..158ea98c090 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -183,7 +183,7 @@ static void postConstraintChecks(TransInfo *t, float vec[3], float pvec[3]) { VECCOPY(vec, t->auto_values); constraintAutoValues(t, vec); } - + if (t->con.mode & CON_AXIS0) { pvec[i++] = vec[0]; } @@ -199,10 +199,10 @@ static void postConstraintChecks(TransInfo *t, float vec[3], float pvec[3]) { static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3]) { float norm[3], vec[3], factor; - + if(in[0]==0.0f && in[1]==0.0f && in[2]==0.0f) return; - + /* For when view is parallel to constraint... will cause NaNs otherwise So we take vertical motion in 3D space and apply it to the constraint axis. Nice for camera grab + MMB */ @@ -212,30 +212,30 @@ static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3 /* since camera distance is quite relative, use quadratic relationship. holding shift can compensate */ if(factor<0.0f) factor*= -factor; else factor*= factor; - + VECCOPY(out, axis); Normalize(out); VecMulf(out, -factor); /* -factor makes move down going backwards */ } else { float cb[3], ab[3]; - + VECCOPY(out, axis); - + /* Get view vector on axis to define a plane */ VecAddf(vec, t->con.center, in); getViewVector(t, vec, norm); - + Crossf(vec, norm, axis); - + /* Project input vector on the plane passing on axis */ Projf(vec, in, vec); VecSubf(vec, in, vec); - + /* intersect the two lines: axis and norm */ Crossf(cb, vec, norm); Crossf(ab, axis, norm); - + VecMulf(out, Inpf(cb, ab) / Inpf(ab, ab)); } } @@ -262,7 +262,7 @@ static void planeProjection(TransInfo *t, float in[3], float out[3]) { /* * Generic callback for constant spacial constraints applied to linear motion - * + * * The IN vector in projected into the constrained space and then further * projected along the view vector. * (in perspective mode, the view vector is relative to the position on screen) @@ -274,7 +274,7 @@ static void applyAxisConstraintVec(TransInfo *t, TransData *td, float in[3], flo VECCOPY(out, in); if (!td && t->con.mode & CON_APPLY) { Mat3MulVecfl(t->con.pmtx, out); - + // With snap, a projection is alright, no need to correct for view alignment if ((t->tsnap.status & SNAP_ON) == 0) { if (getConstraintSpaceDimension(t) == 2) { @@ -284,7 +284,7 @@ static void applyAxisConstraintVec(TransInfo *t, TransData *td, float in[3], flo } else if (getConstraintSpaceDimension(t) == 1) { float c[3]; - + if (t->con.mode & CON_AXIS0) { VECCOPY(c, t->con.mtx[0]); } @@ -303,7 +303,7 @@ static void applyAxisConstraintVec(TransInfo *t, TransData *td, float in[3], flo /* * Generic callback for object based spacial constraints applied to linear motion - * + * * At first, the following is applied to the first data in the array * The IN vector in projected into the constrained space and then further * projected along the view vector. @@ -360,7 +360,7 @@ static void applyObjectConstraintVec(TransInfo *t, TransData *td, float in[3], f /* * Generic callback for constant spacial constraints applied to resize motion - * + * * */ @@ -386,7 +386,7 @@ static void applyAxisConstraintSize(TransInfo *t, TransData *td, float smat[3][3 /* * Callback for object based spacial constraints applied to resize motion - * + * * */ @@ -415,7 +415,7 @@ static void applyObjectConstraintSize(TransInfo *t, TransData *td, float smat[3] /* * Generic callback for constant spacial constraints applied to rotations - * + * * The rotation axis is copied into VEC. * * In the case of single axis constraints, the rotation axis is directly the one constrained to. @@ -457,7 +457,7 @@ static void applyAxisConstraintRot(TransInfo *t, TransData *td, float vec[3], fl /* * Callback for object based spacial constraints applied to rotations - * + * * The rotation axis is copied into VEC. * * In the case of single axis constraints, the rotation axis is directly the one constrained to. @@ -473,7 +473,7 @@ static void applyObjectConstraintRot(TransInfo *t, TransData *td, float vec[3], { if (t->con.mode & CON_APPLY) { int mode = t->con.mode & (CON_AXIS0|CON_AXIS1|CON_AXIS2); - + /* on setup call, use first object */ if (td == NULL) { td= t->data; @@ -585,128 +585,6 @@ void setUserConstraint(TransInfo *t, int mode, const char ftext[]) { t->con.mode |= CON_USER; } -/*--------------------- EXTERNAL SETUP CALLS ------------------*/ - -void BIF_setLocalLockConstraint(char axis, char *text) { - TransInfo *t = BIF_GetTransInfo(); - - if (t->total == 0) { - return; - } - - switch (axis) { - case 'x': - setLocalConstraint(t, (CON_AXIS1|CON_AXIS2), text); - break; - case 'y': - setLocalConstraint(t, (CON_AXIS0|CON_AXIS2), text); - break; - case 'z': - setLocalConstraint(t, (CON_AXIS0|CON_AXIS1), text); - break; - } -} - -void BIF_setLocalAxisConstraint(char axis, char *text) { - TransInfo *t = BIF_GetTransInfo(); - - if (t->total == 0) { - return; - } - - switch (axis) { - case 'X': - setLocalConstraint(t, CON_AXIS0, text); - break; - case 'Y': - setLocalConstraint(t, CON_AXIS1, text); - break; - case 'Z': - setLocalConstraint(t, CON_AXIS2, text); - break; - } -} - -/* text is optional, for header print */ -void BIF_setSingleAxisConstraint(float vec[3], char *text) { - TransInfo *t = BIF_GetTransInfo(); - float space[3][3], v[3]; - - if (t->total == 0) { - return; - } - - VECCOPY(space[0], vec); - - v[0] = vec[2]; - v[1] = vec[0]; - v[2] = vec[1]; - - Crossf(space[1], vec, v); - Crossf(space[2], vec, space[1]); - Mat3Ortho(space); - - Mat3CpyMat3(t->con.mtx, space); - t->con.mode = CON_AXIS0; - - getConstraintMatrix(t); - - startConstraint(t); - - /* start copying with an offset of 1, to reserve a spot for the SPACE char */ - if(text) - { - strncpy(t->con.text+1, text, 48); /* 50 in struct */ - } - else - { - t->con.text[1] = '\0'; /* No text */ - } - - t->con.drawExtra = NULL; - t->con.applyVec = applyAxisConstraintVec; - t->con.applySize = applyAxisConstraintSize; - t->con.applyRot = applyAxisConstraintRot; - t->redraw = 1; -} - -void BIF_setDualAxisConstraint(float vec1[3], float vec2[3], char *text) { - TransInfo *t = BIF_GetTransInfo(); - float space[3][3]; - - if (t->total == 0) { - return; - } - - VECCOPY(space[0], vec1); - VECCOPY(space[1], vec2); - Crossf(space[2], space[0], space[1]); - Mat3Ortho(space); - - Mat3CpyMat3(t->con.mtx, space); - t->con.mode = CON_AXIS0|CON_AXIS1; - - getConstraintMatrix(t); - - startConstraint(t); - - /* start copying with an offset of 1, to reserve a spot for the SPACE char */ - if(text) - { - strncpy(t->con.text+1, text, 48); /* 50 in struct */ - } - else - { - t->con.text[1] = '\0'; /* No text */ - } - - t->con.drawExtra = NULL; - t->con.applyVec = applyAxisConstraintVec; - t->con.applySize = applyAxisConstraintSize; - t->con.applyRot = applyAxisConstraintRot; - t->redraw = 1; -} - /*----------------- DRAWING CONSTRAINTS -------------------*/ void drawConstraint(const struct bContext *C, TransInfo *t) @@ -721,10 +599,10 @@ void drawConstraint(const struct bContext *C, TransInfo *t) return; if (t->flag & T_NO_CONSTRAINT) return; - + /* nasty exception for Z constraint in camera view */ // TRANSFORM_FIX_ME -// if((t->flag & T_OBJECT) && G.vd->camera==OBACT && G.vd->persp==V3D_CAMOB) +// if((t->flag & T_OBJECT) && G.vd->camera==OBACT && G.vd->persp==V3D_CAMOB) // return; if (tc->drawExtra) { @@ -742,17 +620,17 @@ void drawConstraint(const struct bContext *C, TransInfo *t) drawLine(t, tc->center, tc->mtx[2], 'z', 0); glColor3ubv((GLubyte *)col2); - + glDisable(GL_DEPTH_TEST); setlinestyle(1); - glBegin(GL_LINE_STRIP); - glVertex3fv(tc->center); - glVertex3fv(vec); + glBegin(GL_LINE_STRIP); + glVertex3fv(tc->center); + glVertex3fv(vec); glEnd(); setlinestyle(0); // TRANSFORM_FIX_ME //if(G.vd->zbuf) - glEnable(GL_DEPTH_TEST); + glEnable(GL_DEPTH_TEST); } if (tc->mode & CON_AXIS0) { @@ -775,7 +653,7 @@ void drawPropCircle(const struct bContext *C, TransInfo *t) float tmat[4][4], imat[4][4]; UI_ThemeColor(TH_GRID); - + if(t->spacetype == SPACE_VIEW3D && rv3d != NULL) { Mat4CpyMat4(tmat, rv3d->viewmat); @@ -804,20 +682,9 @@ void drawPropCircle(const struct bContext *C, TransInfo *t) set_inverted_drawing(1); drawcircball(GL_LINE_LOOP, t->center, t->prop_size, imat); set_inverted_drawing(0); - - glPopMatrix(); - } -} -void BIF_getPropCenter(float *center) -{ - TransInfo *t = BIF_GetTransInfo(); - - if (t && t->flag & T_PROP_EDIT) { - VECCOPY(center, t->center); + glPopMatrix(); } - else - center[0] = center[1] = center[2] = 0.0f; } static void drawObjectConstraint(TransInfo *t) { @@ -839,7 +706,7 @@ static void drawObjectConstraint(TransInfo *t) { if (t->con.mode & CON_AXIS2) { drawLine(t, td->ob->obmat[3], td->axismtx[2], 'z', DRAWLIGHT); } - + td++; for(i=1;itotal;i++,td++) { @@ -954,12 +821,12 @@ static void setNearestAxis3d(TransInfo *t) float mvec[3], axis[3], proj[3]; float len[3]; int i, icoord[2]; - + /* calculate mouse movement */ mvec[0] = (float)(t->mval[0] - t->con.imval[0]); mvec[1] = (float)(t->mval[1] - t->con.imval[1]); mvec[2] = 0.0f; - + /* we need to correct axis length for the current zoomlevel of view, this to prevent projected values to be clipped behind the camera and to overflow the short integers. @@ -972,12 +839,12 @@ static void setNearestAxis3d(TransInfo *t) for (i = 0; i<3; i++) { VECCOPY(axis, t->con.mtx[i]); - + VecMulf(axis, zfac); /* now we can project to get window coordinate */ VecAddf(axis, axis, t->con.center); projectIntView(t, axis, icoord); - + axis[0] = (float)(icoord[0] - t->center2d[0]); axis[1] = (float)(icoord[1] - t->center2d[1]); axis[2] = 0.0f; @@ -1034,13 +901,13 @@ void setNearestAxis(TransInfo *t) /* constraint setting - depends on spacetype */ if (t->spacetype == SPACE_VIEW3D) { /* 3d-view */ - setNearestAxis3d(t); + setNearestAxis3d(t); } else { /* assume that this means a 2D-Editor */ setNearestAxis2d(t); } - + getConstraintMatrix(t); } @@ -1083,7 +950,7 @@ int isLockConstraint(TransInfo *t) { /* * Returns the dimension of the constraint space. - * + * * For that reason, the flags always needs to be set to properly evaluate here, * even if they aren't actually used in the callback function. (Which could happen * for weird constraints not yet designed. Along a path for example.) @@ -1107,7 +974,7 @@ int getConstraintSpaceDimension(TransInfo *t) Someone willing to do it criptically could do the following instead: return t->con & (CON_AXIS0|CON_AXIS1|CON_AXIS2); - + Based on the assumptions that the axis flags are one after the other and start at 1 */ } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 47f9159d87f..60d209ae2db 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -216,7 +216,7 @@ void sort_trans_data_dist(TransInfo *t) { qsort_trans_data(t, start, t->data + t->total - 1); } -static void sort_trans_data(TransInfo *t) +static void sort_trans_data(TransInfo *t) { TransData *sel, *unsel; TransData temp; @@ -252,16 +252,16 @@ static void set_prop_dist(TransInfo *t, short with_dist) int a; for(a=0, tob= t->data; atotal; a++, tob++) { - + tob->rdist= 0.0f; // init, it was mallocced - + if((tob->flag & TD_SELECTED)==0) { TransData *td; int i; float dist, vec[3]; tob->rdist = -1.0f; // signal for next loop - + for (i = 0, td= t->data; i < t->total; i++, td++) { if(td->flag & TD_SELECTED) { VecSubf(vec, tob->center, td->center); @@ -279,7 +279,7 @@ static void set_prop_dist(TransInfo *t, short with_dist) if (with_dist) { tob->dist = tob->rdist; } - } + } } } @@ -294,9 +294,9 @@ static void createTransTexspace(bContext *C, TransInfo *t) Object *ob; ID *id; int *texflag; - + ob = OBACT; - + if (ob == NULL) { // Shouldn't logically happen, but still... t->total = 0; return; @@ -311,20 +311,20 @@ static void createTransTexspace(bContext *C, TransInfo *t) t->total = 1; td= t->data= MEM_callocN(sizeof(TransData), "TransTexspace"); td->ext= t->ext= MEM_callocN(sizeof(TransDataExtension), "TransTexspace"); - + td->flag= TD_SELECTED; VECCOPY(td->center, ob->obmat[3]); td->ob = ob; - + Mat3CpyMat4(td->mtx, ob->obmat); Mat3CpyMat4(td->axismtx, ob->obmat); Mat3Ortho(td->axismtx); Mat3Inv(td->smtx, td->mtx); - + if (give_obdata_texspace(ob, &texflag, &td->loc, &td->ext->size, &td->ext->rot)) { *texflag &= ~AUTOSPACE; } - + VECCOPY(td->iloc, td->loc); VECCOPY(td->ext->irot, td->ext->rot); VECCOPY(td->ext->isize, td->ext->size); @@ -371,7 +371,7 @@ static void createTransEdge(bContext *C, TransInfo *t) { td->loc= NULL; if (eed->f & SELECT) td->flag= TD_SELECTED; - else + else td->flag= 0; @@ -400,14 +400,14 @@ static void createTransEdge(bContext *C, TransInfo *t) { static bKinematicConstraint *has_targetless_ik(bPoseChannel *pchan) { bConstraint *con= pchan->constraints.first; - + for(;con; con= con->next) { if(con->type==CONSTRAINT_TYPE_KINEMATIC && (con->enforce!=0.0)) { bKinematicConstraint *data= con->data; - - if(data->tar==NULL) + + if(data->tar==NULL) return data; - if(data->tar->type==OB_ARMATURE && data->subtarget[0]==0) + if(data->tar->type==OB_ARMATURE && data->subtarget[0]==0) return data; } } @@ -419,67 +419,67 @@ static short apply_targetless_ik(Object *ob) bPoseChannel *pchan, *parchan, *chanlist[256]; bKinematicConstraint *data; int segcount, apply= 0; - + /* now we got a difficult situation... we have to find the - target-less IK pchans, and apply transformation to the all + target-less IK pchans, and apply transformation to the all pchans that were in the chain */ - + for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) { data= has_targetless_ik(pchan); if(data && (data->flag & CONSTRAINT_IK_AUTO)) { - + /* fill the array with the bones of the chain (armature.c does same, keep it synced) */ segcount= 0; - + /* exclude tip from chain? */ if(!(data->flag & CONSTRAINT_IK_TIP)) parchan= pchan->parent; else parchan= pchan; - + /* Find the chain's root & count the segments needed */ for (; parchan; parchan=parchan->parent){ chanlist[segcount]= parchan; segcount++; - + if(segcount==data->rootbone || segcount>255) break; // 255 is weak } for(;segcount;segcount--) { Bone *bone; float rmat[4][4], tmat[4][4], imat[4][4]; - + /* pose_mat(b) = pose_mat(b-1) * offs_bone * channel * constraint * IK */ /* we put in channel the entire result of rmat= (channel * constraint * IK) */ /* pose_mat(b) = pose_mat(b-1) * offs_bone * rmat */ /* rmat = pose_mat(b) * inv( pose_mat(b-1) * offs_bone ) */ - + parchan= chanlist[segcount-1]; bone= parchan->bone; bone->flag |= BONE_TRANSFORM; /* ensures it gets an auto key inserted */ - + if(parchan->parent) { Bone *parbone= parchan->parent->bone; float offs_bone[4][4]; - + /* offs_bone = yoffs(b-1) + root(b) + bonemat(b) */ Mat4CpyMat3(offs_bone, bone->bone_mat); - + /* The bone's root offset (is in the parent's coordinate system) */ VECCOPY(offs_bone[3], bone->head); - + /* Get the length translation of parent (length along y axis) */ offs_bone[3][1]+= parbone->length; - + /* pose_mat(b-1) * offs_bone */ if(parchan->bone->flag & BONE_HINGE) { /* the rotation of the parent restposition */ Mat4CpyMat4(rmat, parbone->arm_mat); /* rmat used as temp */ - + /* the location of actual parent transform */ VECCOPY(rmat[3], offs_bone[3]); offs_bone[3][0]= offs_bone[3][1]= offs_bone[3][2]= 0.0f; Mat4MulVecfl(parchan->parent->pose_mat, rmat[3]); - + Mat4MulMat4(tmat, offs_bone, rmat); } else if(parchan->bone->flag & BONE_NO_SCALE) { @@ -488,7 +488,7 @@ static short apply_targetless_ik(Object *ob) } else Mat4MulMat4(tmat, offs_bone, parchan->parent->pose_mat); - + Mat4Invert(imat, tmat); } else { @@ -499,16 +499,16 @@ static short apply_targetless_ik(Object *ob) } /* result matrix */ Mat4MulMat4(rmat, parchan->pose_mat, imat); - + /* apply and decompose, doesn't work for constraints or non-uniform scale well */ { float rmat3[3][3], qmat[3][3], imat[3][3], smat[3][3]; - + Mat3CpyMat4(rmat3, rmat); - + /* quaternion */ Mat3ToQuat(rmat3, parchan->quat); - + /* for size, remove rotation */ /* causes problems with some constraints (so apply only if needed) */ if (data->flag & CONSTRAINT_IK_STRETCH) { @@ -517,19 +517,19 @@ static short apply_targetless_ik(Object *ob) Mat3MulMat3(smat, rmat3, imat); Mat3ToSize(smat, parchan->size); } - + /* causes problems with some constraints (e.g. childof), so disable this */ /* as it is IK shouldn't affect location directly */ /* VECCOPY(parchan->loc, rmat[3]); */ } - + } - + apply= 1; data->flag &= ~CONSTRAINT_IK_AUTO; } - } - + } + return apply; } @@ -542,7 +542,7 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr VECCOPY(vec, pchan->pose_mat[3]); VECCOPY(td->center, vec); - + td->ob = ob; td->flag = TD_SELECTED; if (pchan->rotmode == PCHAN_ROT_QUAT) @@ -553,43 +553,43 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr { td->flag |= TD_NOCENTER; } - + if (bone->flag & BONE_TRANSFORM_CHILD) { td->flag |= TD_NOCENTER; td->flag |= TD_NO_LOC; } - + td->protectflag= pchan->protectflag; - + td->loc = pchan->loc; VECCOPY(td->iloc, pchan->loc); - + td->ext->size= pchan->size; VECCOPY(td->ext->isize, pchan->size); - + if (pchan->rotmode) { td->ext->rot= pchan->eul; td->ext->quat= NULL; - + VECCOPY(td->ext->irot, pchan->eul); } else { td->ext->rot= NULL; td->ext->quat= pchan->quat; - + QUATCOPY(td->ext->iquat, pchan->quat); } /* proper way to get parent transform + own transform + constraints transform */ Mat3CpyMat4(omat, ob->obmat); - - if (pchan->parent) { - if(pchan->bone->flag & BONE_HINGE) - Mat3CpyMat4(pmat, pchan->parent->bone->arm_mat); - else + + if (pchan->parent) { + if(pchan->bone->flag & BONE_HINGE) + Mat3CpyMat4(pmat, pchan->parent->bone->arm_mat); + else Mat3CpyMat4(pmat, pchan->parent->pose_mat); - + if (constraints_list_needinv(t, &pchan->constraints)) { Mat3CpyMat4(tmat, pchan->constinv); Mat3Inv(cmat, tmat); @@ -604,20 +604,20 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr Mat3Inv(cmat, tmat); Mat3MulSerie(td->mtx, pchan->bone->bone_mat, omat, cmat, 0,0,0,0,0); // dang mulserie swaps args } - else - Mat3MulMat3(td->mtx, omat, pchan->bone->bone_mat); // Mat3MulMat3 has swapped args! + else + Mat3MulMat3(td->mtx, omat, pchan->bone->bone_mat); // Mat3MulMat3 has swapped args! } - + Mat3Inv(td->smtx, td->mtx); - + /* for axismat we use bone's own transform */ Mat3CpyMat4(pmat, pchan->pose_mat); Mat3MulMat3(td->axismtx, omat, pmat); Mat3Ortho(td->axismtx); - + if (t->mode==TFM_BONESIZE) { bArmature *arm= t->poseobj->data; - + if(arm->drawtype==ARM_ENVELOPE) { td->loc= NULL; td->val= &bone->dist; @@ -630,7 +630,7 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr td->val= NULL; } } - + /* in this case we can do target-less IK grabbing */ if (t->mode==TFM_TRANSLATION) { bKinematicConstraint *data= has_targetless_ik(pchan); @@ -644,27 +644,27 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr td->loc = data->grabtarget; VECCOPY(td->iloc, td->loc); data->flag |= CONSTRAINT_IK_AUTO; - + /* only object matrix correction */ Mat3CpyMat3 (td->mtx, omat); Mat3Inv (td->smtx, td->mtx); } } - + /* store reference to first constraint */ td->con= pchan->constraints.first; } -static void bone_children_clear_transflag(TransInfo *t, ListBase *lb) +static void bone_children_clear_transflag(int mode, short around, ListBase *lb) { Bone *bone= lb->first; - + for(;bone;bone= bone->next) { if((bone->flag & BONE_HINGE) && (bone->flag & BONE_CONNECTED)) { bone->flag |= BONE_HINGE_CHILD_TRANSFORM; } - else if (bone->flag & BONE_TRANSFORM && (t->mode == TFM_ROTATION || t->mode == TFM_TRACKBALL) && t->around == V3D_LOCAL) + else if (bone->flag & BONE_TRANSFORM && (mode == TFM_ROTATION || mode == TFM_TRACKBALL) && around == V3D_LOCAL) { bone->flag |= BONE_TRANSFORM_CHILD; } @@ -673,69 +673,73 @@ static void bone_children_clear_transflag(TransInfo *t, ListBase *lb) bone->flag &= ~BONE_TRANSFORM; } - bone_children_clear_transflag(t, &bone->childbase); + bone_children_clear_transflag(mode, around, &bone->childbase); } } /* sets transform flags in the bones, returns total */ -static void set_pose_transflags(TransInfo *t, Object *ob) +int count_set_pose_transflags(int *out_mode, short around, Object *ob) { bArmature *arm= ob->data; bPoseChannel *pchan; Bone *bone; - int hastranslation; - - t->total= 0; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - bone= pchan->bone; + int mode = *out_mode; + int hastranslation = 0; + int total = 0; + + for(pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { + bone = pchan->bone; if(bone->layer & arm->layer) { if(bone->flag & BONE_SELECTED) bone->flag |= BONE_TRANSFORM; else bone->flag &= ~BONE_TRANSFORM; - + bone->flag &= ~BONE_HINGE_CHILD_TRANSFORM; bone->flag &= ~BONE_TRANSFORM_CHILD; } } - + /* make sure no bone can be transformed when a parent is transformed */ /* since pchans are depsgraph sorted, the parents are in beginning of list */ - if(t->mode!=TFM_BONESIZE) { - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - bone= pchan->bone; + if(mode != TFM_BONESIZE) { + for(pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { + bone = pchan->bone; if(bone->flag & BONE_TRANSFORM) - bone_children_clear_transflag(t, &bone->childbase); + bone_children_clear_transflag(mode, around, &bone->childbase); } - } + } /* now count, and check if we have autoIK or have to switch from translate to rotate */ - hastranslation= 0; + hastranslation = 0; - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - bone= pchan->bone; + for(pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { + bone = pchan->bone; if(bone->flag & BONE_TRANSFORM) { - t->total++; - - if(t->mode==TFM_TRANSLATION) { + total++; + + if(mode == TFM_TRANSLATION) { if( has_targetless_ik(pchan)==NULL ) { if(pchan->parent && (pchan->bone->flag & BONE_CONNECTED)) { if(pchan->bone->flag & BONE_HINGE_CHILD_TRANSFORM) - hastranslation= 1; + hastranslation = 1; } else if((pchan->protectflag & OB_LOCK_LOC)!=OB_LOCK_LOC) - hastranslation= 1; + hastranslation = 1; } else - hastranslation= 1; + hastranslation = 1; } } } /* if there are no translatable bones, do rotation */ - if(t->mode==TFM_TRANSLATION && !hastranslation) - t->mode= TFM_ROTATION; + if(mode == TFM_TRANSLATION && !hastranslation) + { + *out_mode = TFM_ROTATION; + } + + return total; } @@ -745,16 +749,16 @@ static void set_pose_transflags(TransInfo *t, Object *ob) static void pchan_autoik_adjust (bPoseChannel *pchan, short chainlen) { bConstraint *con; - + /* don't bother to search if no valid constraints */ if ((pchan->constflag & (PCHAN_HAS_IK|PCHAN_HAS_TARGET))==0) return; - + /* check if pchan has ik-constraint */ for (con= pchan->constraints.first; con; con= con->next) { if (con->type == CONSTRAINT_TYPE_KINEMATIC && (con->enforce!=0.0)) { bKinematicConstraint *data= con->data; - + /* only accept if a temporary one (for auto-ik) */ if (data->flag & CONSTRAINT_IK_TEMP) { /* chainlen is new chainlen, but is limited by maximum chainlen */ @@ -772,7 +776,7 @@ void transform_autoik_update (TransInfo *t, short mode) { short *chainlen= &t->settings->autoik_chainlen; bPoseChannel *pchan; - + /* mode determines what change to apply to chainlen */ if (mode == 1) { /* mode=1 is from WHEELMOUSEDOWN... increases len */ @@ -782,15 +786,15 @@ void transform_autoik_update (TransInfo *t, short mode) /* mode==-1 is from WHEELMOUSEUP... decreases len */ if (*chainlen > 0) (*chainlen)--; } - + /* sanity checks (don't assume t->poseobj is set, or that it is an armature) */ if (ELEM(NULL, t->poseobj, t->poseobj->pose)) return; - + /* apply to all pose-channels */ for (pchan=t->poseobj->pose->chanbase.first; pchan; pchan=pchan->next) { pchan_autoik_adjust(pchan, *chainlen); - } + } } /* frees temporal IKs */ @@ -799,11 +803,11 @@ static void pose_grab_with_ik_clear(Object *ob) bKinematicConstraint *data; bPoseChannel *pchan; bConstraint *con, *next; - + for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { /* clear all temporary lock flags */ pchan->ikflag &= ~(BONE_IK_NO_XDOF_TEMP|BONE_IK_NO_YDOF_TEMP|BONE_IK_NO_ZDOF_TEMP); - + pchan->constflag &= ~(PCHAN_HAS_IK|PCHAN_HAS_TARGET); /* remove all temporary IK-constraints added */ for (con= pchan->constraints.first; con; con= next) { @@ -830,11 +834,11 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan) bKinematicConstraint *data; bConstraint *con; bConstraint *targetless = 0; - + /* Sanity check */ - if (pchan == NULL) + if (pchan == NULL) return 0; - + /* Rule: not if there's already an IK on this channel */ for (con= pchan->constraints.first; con; con= con->next) { if (con->type==CONSTRAINT_TYPE_KINEMATIC) { @@ -851,7 +855,7 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan) return 0; } } - + con = add_new_constraint(CONSTRAINT_TYPE_KINEMATIC); BLI_addtail(&pchan->constraints, con); pchan->constflag |= (PCHAN_HAS_IK|PCHAN_HAS_TARGET); /* for draw, but also for detecting while pose solving */ @@ -864,22 +868,22 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan) data->flag |= CONSTRAINT_IK_TEMP|CONSTRAINT_IK_AUTO; VECCOPY(data->grabtarget, pchan->pose_tail); data->rootbone= 1; - + /* we include only a connected chain */ while ((pchan) && (pchan->bone->flag & BONE_CONNECTED)) { /* here, we set ik-settings for bone from pchan->protectflag */ if (pchan->protectflag & OB_LOCK_ROTX) pchan->ikflag |= BONE_IK_NO_XDOF_TEMP; if (pchan->protectflag & OB_LOCK_ROTY) pchan->ikflag |= BONE_IK_NO_YDOF_TEMP; if (pchan->protectflag & OB_LOCK_ROTZ) pchan->ikflag |= BONE_IK_NO_ZDOF_TEMP; - + /* now we count this pchan as being included */ data->rootbone++; pchan= pchan->parent; } - + /* make a copy of maximum chain-length */ data->max_rootbone= data->rootbone; - + return 1; } @@ -901,7 +905,7 @@ static short pose_grab_with_ik_children(bPose *pose, Bone *bone) if (pchan) added+= pose_grab_with_ik_add(pchan); } - + return added; } @@ -912,12 +916,12 @@ static short pose_grab_with_ik(Object *ob) bPoseChannel *pchan, *parent; Bone *bonec; short tot_ik= 0; - + if ((ob==NULL) || (ob->pose==NULL) || (ob->flag & OB_POSEMODE)==0) return 0; - + arm = ob->data; - + /* Rule: allow multiple Bones (but they must be selected, and only one ik-solver per chain should get added) */ for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { if (pchan->bone->layer & arm->layer) { @@ -930,7 +934,7 @@ static short pose_grab_with_ik(Object *ob) } if ((pchan->bone->flag & BONE_CONNECTED)==0 && (bonec == NULL)) continue; - + /* rule: if selected Bone is not a root bone, it gets a temporal IK */ if (pchan->parent) { /* only adds if there's no IK yet (and no parent bone was selected) */ @@ -948,9 +952,9 @@ static short pose_grab_with_ik(Object *ob) } } } - + return (tot_ik) ? 1 : 0; -} +} /* only called with pose mode active object now */ @@ -962,13 +966,13 @@ static void createTransPose(bContext *C, TransInfo *t, Object *ob) TransDataExtension *tdx; short ik_on= 0; int i; - + t->total= 0; - + /* check validity of state */ arm= get_armature(ob); if ((arm==NULL) || (ob->pose==NULL)) return; - + if (arm->flag & ARM_RESTPOS) { if (ELEM(t->mode, TFM_DUMMY, TFM_BONESIZE)==0) { // XXX use transform operator reports @@ -982,15 +986,15 @@ static void createTransPose(bContext *C, TransInfo *t, Object *ob) ik_on= pose_grab_with_ik(ob); if (ik_on) t->flag |= T_AUTOIK; } - + /* set flags and count total (warning, can change transform to rotate) */ - set_pose_transflags(t, ob); - - if(t->total==0) return; + t->total = count_set_pose_transflags(&t->mode, t->around, ob); + + if(t->total == 0) return; t->flag |= T_POSE; t->poseobj= ob; /* we also allow non-active objects to be transformed, in weightpaint */ - + /* init trans data */ td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransPoseBone"); tdx = t->ext = MEM_callocN(t->total*sizeof(TransDataExtension), "TransPoseBoneExt"); @@ -998,8 +1002,8 @@ static void createTransPose(bContext *C, TransInfo *t, Object *ob) td->ext= tdx; td->tdi = NULL; td->val = NULL; - } - + } + /* use pose channels to fill trans data */ td= t->data; for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { @@ -1008,12 +1012,12 @@ static void createTransPose(bContext *C, TransInfo *t, Object *ob) td++; } } - + if(td != (t->data+t->total)) { // XXX use transform operator reports // BKE_report(op->reports, RPT_DEBUG, "Bone selection count error."); } - + /* initialise initial auto=ik chainlen's? */ if (ik_on) transform_autoik_update(t, 0); } @@ -1054,16 +1058,16 @@ static void createTransArmatureVerts(bContext *C, TransInfo *t) } if (!t->total) return; - + Mat3CpyMat4(mtx, t->obedit->obmat); Mat3Inv(smtx, mtx); td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransEditBone"); - + for (ebo = edbo->first; ebo; ebo = ebo->next) { ebo->oldlength = ebo->length; // length==0.0 on extrude, used for scaling radius of bone points - + if(ebo->layer & arm->layer) { if (t->mode==TFM_BONE_ENVELOPE) { @@ -1071,17 +1075,17 @@ static void createTransArmatureVerts(bContext *C, TransInfo *t) { td->val= &ebo->rad_head; td->ival= *td->val; - + VECCOPY (td->center, ebo->head); td->flag= TD_SELECTED; - + Mat3CpyMat3(td->smtx, smtx); Mat3CpyMat3(td->mtx, mtx); - + td->loc = NULL; td->ext = NULL; td->tdi = NULL; - + td++; } if (ebo->flag & BONE_TIPSEL) @@ -1090,17 +1094,17 @@ static void createTransArmatureVerts(bContext *C, TransInfo *t) td->ival= *td->val; VECCOPY (td->center, ebo->tail); td->flag= TD_SELECTED; - + Mat3CpyMat3(td->smtx, smtx); Mat3CpyMat3(td->mtx, mtx); - + td->loc = NULL; td->ext = NULL; td->tdi = NULL; - + td++; } - + } else if (t->mode==TFM_BONESIZE) { @@ -1120,19 +1124,19 @@ static void createTransArmatureVerts(bContext *C, TransInfo *t) } VECCOPY (td->center, ebo->head); td->flag= TD_SELECTED; - + /* use local bone matrix */ - VecSubf(delta, ebo->tail, ebo->head); + VecSubf(delta, ebo->tail, ebo->head); vec_roll_to_mat3(delta, ebo->roll, bonemat); Mat3MulMat3(td->mtx, mtx, bonemat); Mat3Inv(td->smtx, td->mtx); - + Mat3CpyMat3(td->axismtx, td->mtx); Mat3Ortho(td->axismtx); td->ext = NULL; td->tdi = NULL; - + td++; } } @@ -1143,13 +1147,13 @@ static void createTransArmatureVerts(bContext *C, TransInfo *t) td->loc= NULL; td->val= &(ebo->roll); td->ival= ebo->roll; - + VECCOPY (td->center, ebo->head); td->flag= TD_SELECTED; td->ext = NULL; td->tdi = NULL; - + td++; } } @@ -1167,7 +1171,7 @@ static void createTransArmatureVerts(bContext *C, TransInfo *t) Mat3CpyMat3(td->smtx, smtx); Mat3CpyMat3(td->mtx, mtx); - VecSubf(delta, ebo->tail, ebo->head); + VecSubf(delta, ebo->tail, ebo->head); vec_roll_to_mat3(delta, ebo->roll, td->axismtx); if ((ebo->flag & BONE_ROOTSEL) == 0) @@ -1193,7 +1197,7 @@ static void createTransArmatureVerts(bContext *C, TransInfo *t) Mat3CpyMat3(td->smtx, smtx); Mat3CpyMat3(td->mtx, mtx); - VecSubf(delta, ebo->tail, ebo->head); + VecSubf(delta, ebo->tail, ebo->head); vec_roll_to_mat3(delta, ebo->roll, td->axismtx); td->extra = ebo; /* to fix roll */ @@ -1230,16 +1234,16 @@ static void createTransMBallVerts(bContext *C, TransInfo *t) /* note: in prop mode we need at least 1 selected */ if (countsel==0) return; - - if(propmode) t->total = count; + + if(propmode) t->total = count; else t->total = countsel; - + td = t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(MBall EditMode)"); tx = t->ext = MEM_callocN(t->total*sizeof(TransDataExtension), "MetaElement_TransExtension"); Mat3CpyMat4(mtx, t->obedit->obmat); Mat3Inv(smtx, mtx); - + for(ml= editelems.first; ml; ml= ml->next) { if(propmode || (ml->flag & SELECT)) { td->loc= &ml->x; @@ -1357,7 +1361,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) /* to be sure */ if(cu->editnurb==NULL) return; - + /* count total of vertices, check identical as in 2nd loop for making transdata! */ for(nu= cu->editnurb->first; nu; nu= nu->next) { if((nu->type & 7)==CU_BEZIER) { @@ -1386,14 +1390,14 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) } /* note: in prop mode we need at least 1 selected */ if (countsel==0) return; - - if(propmode) t->total = count; + + if(propmode) t->total = count; else t->total = countsel; t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(Curve EditMode)"); Mat3CpyMat4(mtx, t->obedit->obmat); Mat3Inv(smtx, mtx); - + td = t->data; for(nu= cu->editnurb->first; nu; nu= nu->next) { if((nu->type & 7)==CU_BEZIER) { @@ -1402,7 +1406,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) for(a=0, bezt= nu->bezt; apntsu; a++, bezt++) { if(bezt->hide==0) { TransDataCurveHandleFlags *hdata = NULL; - + if( propmode || ((bezt->f2 & SELECT) && (G.f & G_HIDDENHANDLES)) || ((bezt->f1 & SELECT) && (G.f & G_HIDDENHANDLES)==0) @@ -1420,7 +1424,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) td->ext = NULL; td->tdi = NULL; td->val = NULL; - + hdata = initTransDataCurveHandes(td, bezt); Mat3CpyMat3(td->smtx, smtx); @@ -1430,7 +1434,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) count++; tail++; } - + /* This is the Curve Point, the other two are handles */ if(propmode || (bezt->f2 & SELECT)) { VECCOPY(td->iloc, bezt->vec[1]); @@ -1440,7 +1444,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) else td->flag= 0; td->ext = NULL; td->tdi = NULL; - + if (t->mode==TFM_CURVE_SHRINKFATTEN) { /* || t->mode==TFM_RESIZE) {*/ /* TODO - make points scale */ td->val = &(bezt->radius); td->ival = bezt->radius; @@ -1453,13 +1457,13 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) Mat3CpyMat3(td->smtx, smtx); Mat3CpyMat3(td->mtx, mtx); - + if ((bezt->f1&SELECT)==0 && (bezt->f3&SELECT)==0) /* If the middle is selected but the sides arnt, this is needed */ if (hdata==NULL) { /* if the handle was not saved by the previous handle */ hdata = initTransDataCurveHandes(td, bezt); } - + td++; count++; tail++; @@ -1485,7 +1489,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) if (hdata==NULL) { /* if the handle was not saved by the previous handle */ hdata = initTransDataCurveHandes(td, bezt); } - + Mat3CpyMat3(td->smtx, smtx); Mat3CpyMat3(td->mtx, mtx); @@ -1501,7 +1505,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) } if (propmode && head != tail) calc_distanceCurveVerts(head, tail-1); - + /* TODO - in the case of tilt and radius we can also avoid allocating the initTransDataCurveHandes * but for now just dont change handle types */ if (ELEM(t->mode, TFM_CURVE_SHRINKFATTEN, TFM_TILT) == 0) @@ -1520,7 +1524,7 @@ static void createTransCurveVerts(bContext *C, TransInfo *t) else td->flag= 0; td->ext = NULL; td->tdi = NULL; - + if (t->mode==TFM_CURVE_SHRINKFATTEN || t->mode==TFM_RESIZE) { td->val = &(bp->radius); td->ival = bp->radius; @@ -1569,14 +1573,14 @@ static void createTransLatticeVerts(bContext *C, TransInfo *t) } bp++; } - + /* note: in prop mode we need at least 1 selected */ if (countsel==0) return; - - if(propmode) t->total = count; + + if(propmode) t->total = count; else t->total = countsel; t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(Lattice EditMode)"); - + Mat3CpyMat4(mtx, t->obedit->obmat); Mat3Inv(smtx, mtx); @@ -1654,10 +1658,10 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) pa->flag |= PARS_TRANSFORM; } } - + /* note: in prop mode we need at least 1 selected */ if (hasselected==0) return; - + t->total = count; td = t->data = MEM_callocN(t->total * sizeof(TransData), "TransObData(Particle Mode)"); @@ -1795,13 +1799,13 @@ static void editmesh_set_connectivity_distance(EditMesh *em, int total, float *v /* Floodfill routine */ /* - At worst this is n*n of complexity where n is number of edges + At worst this is n*n of complexity where n is number of edges Best case would be n if the list is ordered perfectly. Estimate is n log n in average (so not too bad) */ while(done) { done= 0; - + for(eed= em->edges.first; eed; eed= eed->next) { if(eed->h==0) { EditVert *v1= eed->v1, *v2= eed->v2; @@ -1882,7 +1886,7 @@ static void editmesh_set_connectivity_distance(EditMesh *em, int total, float *v static void get_face_center(float *cent, EditMesh *em, EditVert *eve) { EditFace *efa; - + for(efa= em->faces.first; efa; efa= efa->next) if(efa->f & SELECT) if(efa->v1==eve || efa->v2==eve || efa->v3==eve || efa->v4==eve) @@ -1901,7 +1905,7 @@ static void VertsToTransData(TransInfo *t, TransData *td, EditMesh *em, EditVert // td->loc = key->co; //else td->loc = eve->co; - + VECCOPY(td->center, td->loc); if(t->around==V3D_LOCAL && (em->selectmode & SCE_SELECT_FACE)) get_face_center(td->center, em, eve); @@ -1931,7 +1935,7 @@ static void VertsToTransData(TransInfo *t, TransData *td, EditMesh *em, EditVert static void make_vertexcos__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) { float *vec = userData; - + vec+= 3*index; VECCOPY(vec, co); } @@ -1940,14 +1944,14 @@ static int modifiers_disable_subsurf_temporary(Object *ob) { ModifierData *md; int disabled = 0; - + for(md=ob->modifiers.first; md; md=md->next) if(md->type==eModifierType_Subsurf) if(md->mode & eModifierMode_OnCage) { md->mode ^= eModifierMode_DisableTemporary; disabled= 1; } - + return disabled; } @@ -1969,12 +1973,12 @@ static float *get_crazy_mapped_editverts(TransInfo *t) vertexcos= MEM_mallocN(3*sizeof(float)*me->edit_mesh->totvert, "vertexcos map"); dm->foreachMappedVert(dm, make_vertexcos__mapFunc, vertexcos); - + dm->release(dm); - + /* set back the flag, no new cage needs to be built, transform does it */ modifiers_disable_subsurf_temporary(t->obedit); - + return vertexcos; } @@ -1983,15 +1987,15 @@ static void set_crazy_vertex_quat(float *quat, float *v1, float *v2, float *v3, { float vecu[3], vecv[3]; float q1[4], q2[4]; - + TAN_MAKE_VEC(vecu, v1, v2); TAN_MAKE_VEC(vecv, v1, v3); triatoquat(v1, vecu, vecv, q1); - + TAN_MAKE_VEC(vecu, def1, def2); TAN_MAKE_VEC(vecv, def1, def3); triatoquat(def1, vecu, vecv, q2); - + QuatSub(quat, q2, q1); } #undef TAN_MAKE_VEC @@ -2002,16 +2006,16 @@ static void set_crazyspace_quats(EditMesh *em, float *origcos, float *mappedcos, EditFace *efa; float *v1, *v2, *v3, *v4, *co1, *co2, *co3, *co4; intptr_t index= 0; - + /* two abused locations in vertices */ for(eve= em->verts.first; eve; eve= eve->next, index++) { eve->tmp.p = NULL; eve->prev= (EditVert *)index; } - + /* first store two sets of tangent vectors in vertices, we derive it just from the face-edges */ for(efa= em->faces.first; efa; efa= efa->next) { - + /* retrieve mapped coordinates */ v1= mappedcos + 3*(intptr_t)(efa->v1->prev); v2= mappedcos + 3*(intptr_t)(efa->v2->prev); @@ -2026,7 +2030,7 @@ static void set_crazyspace_quats(EditMesh *em, float *origcos, float *mappedcos, efa->v2->tmp.p= (void*)quats; quats+= 4; } - + if(efa->v4) { v4= mappedcos + 3*(intptr_t)(efa->v4->prev); co4= (origcos)? origcos + 3*(intptr_t)(efa->v4->prev): efa->v4->co; @@ -2114,7 +2118,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t) // transform now requires awareness for select mode, so we tag the f1 flags in verts if(ts->selectmode & SCE_SELECT_VERTEX) { for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->h==0 && (eve->f & SELECT)) + if(eve->h==0 && (eve->f & SELECT)) eve->f1= SELECT; else eve->f1= 0; @@ -2138,7 +2142,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t) } } } - + /* now we can count */ for(eve= em->verts.first; eve; eve= eve->next) { if(eve->h==0) { @@ -2146,10 +2150,10 @@ static void createTransEditVerts(bContext *C, TransInfo *t) if(propmode) count++; } } - + /* note: in prop mode we need at least 1 selected */ if (countsel==0) return; - + /* check active */ if (em->selected.last) { EditSelection *ese = em->selected.last; @@ -2158,22 +2162,22 @@ static void createTransEditVerts(bContext *C, TransInfo *t) } } - + if(propmode) { - t->total = count; - + t->total = count; + /* allocating scratch arrays */ vectors = (float *)MEM_mallocN(t->total * 3 * sizeof(float), "scratch vectors"); nears = (EditVert**)MEM_mallocN(t->total * sizeof(EditVert*), "scratch nears"); } else t->total = countsel; tob= t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(Mesh EditMode)"); - + Mat3CpyMat4(mtx, t->obedit->obmat); Mat3Inv(smtx, mtx); if(propmode) editmesh_set_connectivity_distance(em, t->total, vectors, nears); - + /* detect CrazySpace [tm] */ if(propmode==0) { if(modifiers_getCageIndex(t->obedit, NULL)>=0) { @@ -2198,7 +2202,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t) } } } - + /* find out which half we do */ if(mirror) { for (eve=em->verts.first; eve; eve=eve->next) { @@ -2209,18 +2213,18 @@ static void createTransEditVerts(bContext *C, TransInfo *t) } } } - + for (a=0, eve=em->verts.first; eve; eve=eve->next, a++) { if(eve->h==0) { if(propmode || eve->f1) { VertsToTransData(t, tob, em, eve); - + /* selected */ if(eve->f1) tob->flag |= TD_SELECTED; - + /* active */ if(eve == eve_act) tob->flag |= TD_ACTIVE; - + if(propmode) { if (eve->f2) { float vec[3]; @@ -2233,11 +2237,11 @@ static void createTransEditVerts(bContext *C, TransInfo *t) tob->dist = MAXFLOAT; } } - + /* CrazySpace */ if(defmats || (quats && eve->tmp.p)) { float mat[3][3], imat[3][3], qmat[3][3]; - + /* use both or either quat and defmat correction */ if(quats && eve->tmp.f) { QuatToMat3(eve->tmp.p, qmat); @@ -2252,7 +2256,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t) Mat3MulMat3(mat, mtx, defmats[a]); Mat3Inv(imat, mat); - + Mat3CpyMat3(tob->smtx, imat); Mat3CpyMat3(tob->mtx, mat); } @@ -2260,7 +2264,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t) Mat3CpyMat3(tob->smtx, smtx); Mat3CpyMat3(tob->mtx, mtx); } - + /* Mirror? */ if( (mirror>0 && tob->iloc[0]>0.0f) || (mirror<0 && tob->iloc[0]<0.0f)) { EditVert *vmir= editmesh_get_x_mirror_vert(t->obedit, em, tob->iloc); /* initializes octree on first call */ @@ -2268,7 +2272,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t) } tob++; } - } + } } if (propmode) { MEM_freeN(vectors); @@ -2286,7 +2290,7 @@ void flushTransNodes(TransInfo *t) { int a; TransData2D *td; - + /* flush to 2d vector from internally used 3d vector */ for(a=0, td= t->data2d; atotal; a++, td++) { td->loc2d[0]= td->loc[0]; @@ -2304,7 +2308,7 @@ void flushTransSeq(TransInfo *t) TransDataSeq *tdsq= NULL; Sequence *seq; - + /* prevent updating the same seq twice * if the transdata order is changed this will mess up @@ -2322,7 +2326,7 @@ void flushTransSeq(TransInfo *t) case SELECT: if (seq->type != SEQ_META && seq_tx_test(seq)) /* for meta's, their children move */ seq->start= new_frame - tdsq->start_offset; - + if (seq->depth==0) { seq->machine= (int)(td2d->loc[1] + 0.5f); CLAMP(seq->machine, 1, MAXSEQ); @@ -2346,7 +2350,7 @@ void flushTransSeq(TransInfo *t) * children are ALWAYS transformed first * so we dont need to do this in another loop. */ calc_sequence(seq); - + /* test overlap, displayes red outline */ seq->flag &= ~SEQ_OVERLAP; if( seq_test_overlap(seqbasep, seq) ) { @@ -2423,7 +2427,7 @@ static void createTransUVs(bContext *C, TransInfo *t) EditMesh *em = ((Mesh *)t->obedit->data)->edit_mesh; EditFace *efa; - + if(!ED_uvedit_test(t->obedit)) return; /* count */ @@ -2432,10 +2436,10 @@ static void createTransUVs(bContext *C, TransInfo *t) if(uvedit_face_visible(scene, ima, efa, tf)) { efa->tmp.p = tf; - - if (uvedit_uv_selected(scene, efa, tf, 0)) countsel++; - if (uvedit_uv_selected(scene, efa, tf, 1)) countsel++; - if (uvedit_uv_selected(scene, efa, tf, 2)) countsel++; + + if (uvedit_uv_selected(scene, efa, tf, 0)) countsel++; + if (uvedit_uv_selected(scene, efa, tf, 1)) countsel++; + if (uvedit_uv_selected(scene, efa, tf, 2)) countsel++; if (efa->v4 && uvedit_uv_selected(scene, efa, tf, 3)) countsel++; if(propmode) count += (efa->v4)? 4: 3; @@ -2443,10 +2447,10 @@ static void createTransUVs(bContext *C, TransInfo *t) efa->tmp.p = NULL; } } - + /* note: in prop mode we need at least 1 selected */ if (countsel==0) return; - + t->total= (propmode)? count: countsel; t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(UV Editing)"); /* for each 2d uv coord a 3d vector is allocated, so that they can be @@ -2458,7 +2462,7 @@ static void createTransUVs(bContext *C, TransInfo *t) td= t->data; td2d= t->data2d; - + for (efa= em->faces.first; efa; efa= efa->next) { if ((tf=(MTFace *)efa->tmp.p)) { if (propmode) { @@ -2475,7 +2479,7 @@ static void createTransUVs(bContext *C, TransInfo *t) } } } - + if (sima->flag & SI_LIVE_UNWRAP) ED_uvedit_live_unwrap_begin(t->scene, t->obedit); } @@ -2496,7 +2500,7 @@ void flushTransUVs(TransInfo *t) for(a=0, td= t->data2d; atotal; a++, td++) { td->loc2d[0]= td->loc[0]*invx; td->loc2d[1]= td->loc[1]*invy; - + if((sima->flag & SI_PIXELSNAP) && (t->state != TRANS_CANCEL)) { td->loc2d[0]= (float)floor(width*td->loc2d[0] + 0.5f)/width; td->loc2d[1]= (float)floor(height*td->loc2d[1] + 0.5f)/height; @@ -2547,7 +2551,7 @@ int clipUVTransform(TransInfo *t, float *vec, int resize) vec[1] -= max[1]-aspy; else clipy= 0; - } + } return (clipx || clipy); } @@ -2559,7 +2563,7 @@ static short FrameOnMouseSide(char side, float frame, float cframe) { /* both sides, so it doesn't matter */ if (side == 'B') return 1; - + /* only on the named side */ if (side == 'R') return (frame >= cframe) ? 1 : 0; @@ -2574,28 +2578,28 @@ static void createTransNlaData(bContext *C, TransInfo *t) Scene *scene= CTX_data_scene(C); TransData *td = NULL; TransDataNla *tdn = NULL; - + bAnimContext ac; ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; - + int count=0; char side; - + /* determine what type of data we are operating on */ if (ANIM_animdata_get_context(C, &ac) == 0) return; - + /* filter data */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - + /* which side of the current frame should be allowed */ if (t->mode == TFM_TIME_EXTEND) { /* only side on which mouse is gets transformed */ float xmouse, ymouse; - + UI_view2d_region_to_view(&ac.ar->v2d, t->imval[0], t->imval[1], &xmouse, &ymouse); side = (xmouse > CFRA) ? 'R' : 'L'; // XXX use t->frame_side } @@ -2603,15 +2607,15 @@ static void createTransNlaData(bContext *C, TransInfo *t) /* normal transform - both sides of current frame are considered */ side = 'B'; } - + /* loop 1: count how many strips are selected (consider each strip as 2 points) */ for (ale= anim_data.first; ale; ale= ale->next) { NlaTrack *nlt= (NlaTrack *)ale->data; NlaStrip *strip; - + /* make some meta-strips for chains of selected strips */ BKE_nlastrips_make_metas(&nlt->strips, 1); - + /* only consider selected strips */ for (strip= nlt->strips.first; strip; strip= strip->next) { // TODO: we can make strips have handles later on... @@ -2624,29 +2628,29 @@ static void createTransNlaData(bContext *C, TransInfo *t) } } } - + /* stop if trying to build list if nothing selected */ if (count == 0) { /* cleanup temp list */ BLI_freelistN(&anim_data); return; } - + /* allocate memory for data */ t->total= count; - + t->data= MEM_callocN(t->total*sizeof(TransData), "TransData(NLA Editor)"); td= t->data; t->customData= MEM_callocN(t->total*sizeof(TransDataNla), "TransDataNla (NLA Editor)"); tdn= t->customData; - + /* loop 2: build transdata array */ for (ale= anim_data.first; ale; ale= ale->next) { /* only if a real NLA-track */ if (ale->type == ANIMTYPE_NLATRACK) { NlaTrack *nlt= (NlaTrack *)ale->data; NlaStrip *strip; - + /* only consider selected strips */ for (strip= nlt->strips.first; strip; strip= strip->next) { // TODO: we can make strips have handles later on... @@ -2663,44 +2667,44 @@ static void createTransNlaData(bContext *C, TransInfo *t) * cases, there will need to be 1 of these tdn elements in the array skipped... */ float center[3], yval; - + /* firstly, init tdn settings */ tdn->oldTrack= tdn->nlt= nlt; tdn->strip= strip; tdn->trackIndex= BLI_findindex(&nlt->strips, strip); - + yval= (float)(tdn->trackIndex * NLACHANNEL_STEP); - + tdn->h1[0]= strip->start; tdn->h1[1]= yval; tdn->h2[0]= strip->end; tdn->h2[1]= yval; - + center[0]= (float)CFRA; center[1]= yval; center[2]= 0.0f; - + /* set td's based on which handles are applicable */ - if (FrameOnMouseSide(side, strip->start, (float)CFRA)) + if (FrameOnMouseSide(side, strip->start, (float)CFRA)) { /* just set tdn to assume that it only has one handle for now */ tdn->handle= -1; - + /* now, link the transform data up to this data */ if (t->mode == TFM_TRANSLATION) { td->loc= tdn->h1; VECCOPY(td->iloc, tdn->h1); - + /* store all the other gunk that is required by transform */ VECCOPY(td->center, center); memset(td->axismtx, 0, sizeof(td->axismtx)); td->axismtx[2][2] = 1.0f; - + td->ext= NULL; td->tdi= NULL; td->val= NULL; - + td->flag |= TD_SELECTED; td->dist= 0.0f; - + Mat3One(td->mtx); Mat3One(td->smtx); } @@ -2708,30 +2712,30 @@ static void createTransNlaData(bContext *C, TransInfo *t) td->val= &tdn->h1[0]; td->ival= tdn->h1[0]; } - + td->extra= tdn; td++; } - if (FrameOnMouseSide(side, strip->end, (float)CFRA)) - { + if (FrameOnMouseSide(side, strip->end, (float)CFRA)) + { /* if tdn is already holding the start handle, then we're doing both, otherwise, only end */ tdn->handle= (tdn->handle) ? 2 : 1; - + /* now, link the transform data up to this data */ if (t->mode == TFM_TRANSLATION) { td->loc= tdn->h2; VECCOPY(td->iloc, tdn->h2); - + /* store all the other gunk that is required by transform */ VECCOPY(td->center, center); memset(td->axismtx, 0, sizeof(td->axismtx)); td->axismtx[2][2] = 1.0f; - + td->ext= NULL; td->tdi= NULL; td->val= NULL; - + td->flag |= TD_SELECTED; td->dist= 0.0f; - + Mat3One(td->mtx); Mat3One(td->smtx); } @@ -2739,12 +2743,12 @@ static void createTransNlaData(bContext *C, TransInfo *t) td->val= &tdn->h2[0]; td->ival= tdn->h2[0]; } - + td->extra= tdn; td++; } - - /* if both handles were used, skip the next tdn (i.e. leave it blank) since the counting code is dumb... + + /* if both handles were used, skip the next tdn (i.e. leave it blank) since the counting code is dumb... * otherwise, just advance to the next one... */ if (tdn->handle == 2) @@ -2756,7 +2760,7 @@ static void createTransNlaData(bContext *C, TransInfo *t) } } } - + /* cleanup temp list */ BLI_freelistN(&anim_data); } @@ -2772,25 +2776,25 @@ static void createTransNlaData(bContext *C, TransInfo *t) static void posttrans_gpd_clean (bGPdata *gpd) { bGPDlayer *gpl; - + for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { ListBase sel_buffer = {NULL, NULL}; bGPDframe *gpf, *gpfn; bGPDframe *gfs, *gfsn; - - /* loop 1: loop through and isolate selected gp-frames to buffer + + /* loop 1: loop through and isolate selected gp-frames to buffer * (these need to be sorted as they are isolated) */ for (gpf= gpl->frames.first; gpf; gpf= gpfn) { short added= 0; gpfn= gpf->next; - + if (gpf->flag & GP_FRAME_SELECT) { BLI_remlink(&gpl->frames, gpf); - + /* find place to add them in buffer * - go backwards as most frames will still be in order, - * so doing it this way will be faster + * so doing it this way will be faster */ for (gfs= sel_buffer.last; gfs; gfs= gfs->prev) { /* if current (gpf) occurs after this one in buffer, add! */ @@ -2804,27 +2808,27 @@ static void posttrans_gpd_clean (bGPdata *gpd) BLI_addhead(&sel_buffer, gpf); } } - + /* error checking: it is unlikely, but may be possible to have none selected */ if (sel_buffer.first == NULL) continue; - + /* if all were selected (i.e. gpl->frames is empty), then just transfer sel-buf over */ if (gpl->frames.first == NULL) { gpl->frames.first= sel_buffer.first; gpl->frames.last= sel_buffer.last; - + continue; } - + /* loop 2: remove duplicates of frames in buffers */ for (gpf= gpl->frames.first; gpf && sel_buffer.first; gpf= gpfn) { gpfn= gpf->next; - + /* loop through sel_buffer, emptying stuff from front of buffer if ok */ for (gfs= sel_buffer.first; gfs && gpf; gfs= gfsn) { gfsn= gfs->next; - + /* if this buffer frame needs to go before current, add it! */ if (gfs->framenum < gpf->framenum) { /* transfer buffer frame to frames list (before current) */ @@ -2836,18 +2840,18 @@ static void posttrans_gpd_clean (bGPdata *gpd) /* transfer buffer frame to frames list (before current) */ BLI_remlink(&sel_buffer, gfs); BLI_insertlinkbefore(&gpl->frames, gpf, gfs); - + /* get rid of current frame */ // TRANSFORM_FIX_ME //gpencil_layer_delframe(gpl, gpf); } } } - + /* if anything is still in buffer, append to end */ for (gfs= sel_buffer.first; gfs; gfs= gfsn) { gfsn= gfs->next; - + BLI_remlink(&sel_buffer, gfs); BLI_addtail(&gpl->frames, gfs); } @@ -2862,36 +2866,36 @@ static void posttrans_fcurve_clean (FCurve *fcu) { float *selcache; /* cache for frame numbers of selected frames (icu->totvert*sizeof(float)) */ int len, index, i; /* number of frames in cache, item index */ - + /* allocate memory for the cache */ // TODO: investigate using GHash for this instead? - if (fcu->totvert == 0) + if (fcu->totvert == 0) return; selcache= MEM_callocN(sizeof(float)*fcu->totvert, "FCurveSelFrameNums"); len= 0; index= 0; - - /* We do 2 loops, 1 for marking keyframes for deletion, one for deleting - * as there is no guarantee what order the keyframes are exactly, even though + + /* We do 2 loops, 1 for marking keyframes for deletion, one for deleting + * as there is no guarantee what order the keyframes are exactly, even though * they have been sorted by time. */ - + /* Loop 1: find selected keyframes */ for (i = 0; i < fcu->totvert; i++) { BezTriple *bezt= &fcu->bezt[i]; - + if (BEZSELECTED(bezt)) { selcache[index]= bezt->vec[1][0]; index++; len++; } } - + /* Loop 2: delete unselected keyframes on the same frames (if any keyframes were found) */ if (len) { for (i = 0; i < fcu->totvert; i++) { BezTriple *bezt= &fcu->bezt[i]; - + if (BEZSELECTED(bezt) == 0) { /* check beztriple should be removed according to cache */ for (index= 0; index < len; index++) { @@ -2904,10 +2908,10 @@ static void posttrans_fcurve_clean (FCurve *fcu) } } } - + testhandles_fcurve(fcu); } - + /* free cache */ MEM_freeN(selcache); } @@ -2916,33 +2920,33 @@ static void posttrans_fcurve_clean (FCurve *fcu) /* Called by special_aftertrans_update to make sure selected keyframes replace * any other keyframes which may reside on that frame (that is not selected). - * remake_action_ipos should have already been called + * remake_action_ipos should have already been called */ static void posttrans_action_clean (bAnimContext *ac, bAction *act) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; - + /* filter data */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(ac, &anim_data, filter, act, ANIMCONT_ACTION); - - /* loop through relevant data, removing keyframes from the ipo-blocks that were attached - * - all keyframes are converted in/out of global time + + /* loop through relevant data, removing keyframes from the ipo-blocks that were attached + * - all keyframes are converted in/out of global time */ for (ale= anim_data.first; ale; ale= ale->next) { AnimData *adt= ANIM_nla_mapping_get(ac, ale); - + if (adt) { - ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); + ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1); posttrans_fcurve_clean(ale->key_data); ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1); } - else + else posttrans_fcurve_clean(ale->key_data); } - + /* free temp data */ BLI_freelistN(&anim_data); } @@ -2954,23 +2958,23 @@ static int count_fcurve_keys(FCurve *fcu, char side, float cfra) { BezTriple *bezt; int i, count = 0; - + if (ELEM(NULL, fcu, fcu->bezt)) return count; - + /* only include points that occur on the right side of cfra */ for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) { if (bezt->f2 & SELECT) { /* fully select the other two keys */ bezt->f1 |= SELECT; bezt->f3 |= SELECT; - + /* increment by 3, as there are 3 points (3 * x-coordinates) that need transform */ if (FrameOnMouseSide(side, bezt->vec[1][0], cfra)) count += 3; } } - + return count; } @@ -2980,10 +2984,10 @@ static int count_gplayer_frames(bGPDlayer *gpl, char side, float cfra) { bGPDframe *gpf; int count = 0; - + if (gpl == NULL) return count; - + /* only include points that occur on the right side of cfra */ for (gpf= gpl->frames.first; gpf; gpf= gpf->next) { if (gpf->flag & GP_FRAME_SELECT) { @@ -2991,7 +2995,7 @@ static int count_gplayer_frames(bGPDlayer *gpl, char side, float cfra) count++; } } - + return count; } #endif @@ -3002,9 +3006,9 @@ static void TimeToTransData(TransData *td, float *time, AnimData *adt) /* memory is calloc'ed, so that should zero everything nicely for us */ td->val = time; td->ival = *(time); - - /* store the AnimData where this keyframe exists as a keyframe of the - * active action as td->extra. + + /* store the AnimData where this keyframe exists as a keyframe of the + * active action as td->extra. */ td->extra= adt; } @@ -3014,16 +3018,16 @@ static void TimeToTransData(TransData *td, float *time, AnimData *adt) * overwrite the existing ones... i.e. td = IcuToTransData(td, icu, ob, side, cfra); * * The 'side' argument is needed for the extend mode. 'B' = both sides, 'R'/'L' mean only data - * on the named side are used. + * on the named side are used. */ static TransData *FCurveToTransData(TransData *td, FCurve *fcu, AnimData *adt, char side, float cfra) { BezTriple *bezt; int i; - + if (fcu == NULL) return td; - + for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) { /* only add selected keyframes (for now, proportional edit is not enabled) */ if (BEZSELECTED(bezt)) { @@ -3032,16 +3036,16 @@ static TransData *FCurveToTransData(TransData *td, FCurve *fcu, AnimData *adt, c /* each control point needs to be added separetely */ TimeToTransData(td, bezt->vec[0], adt); td++; - + TimeToTransData(td, bezt->vec[1], adt); td++; - + TimeToTransData(td, bezt->vec[2], adt); td++; } - } + } } - + return td; } @@ -3056,17 +3060,17 @@ void flushTransGPactionData (TransInfo *t) { tGPFtransdata *tfd; int i; - + /* find the first one to start from */ if (t->mode == TFM_TIME_SLIDE) tfd= (tGPFtransdata *)( (float *)(t->customData) + 2 ); else tfd= (tGPFtransdata *)(t->customData); - + /* flush data! */ for (i = 0; i < t->total; i++, tfd++) { *(tfd->sdata)= (int)floor(tfd->val + 0.5); - } + } } /* This function advances the address to which td points to, so it must return @@ -3074,14 +3078,14 @@ void flushTransGPactionData (TransInfo *t) * overwrite the existing ones... i.e. td = GPLayerToTransData(td, ipo, ob, side, cfra); * * The 'side' argument is needed for the extend mode. 'B' = both sides, 'R'/'L' mean only data - * on the named side are used. + * on the named side are used. */ #if 0 static int GPLayerToTransData (TransData *td, tGPFtransdata *tfd, bGPDlayer *gpl, char side, float cfra) { bGPDframe *gpf; int count= 0; - + /* check for select frames on right side of current frame */ for (gpf= gpl->frames.first; gpf; gpf= gpf->next) { if (gpf->flag & GP_FRAME_SELECT) { @@ -3089,10 +3093,10 @@ static int GPLayerToTransData (TransData *td, tGPFtransdata *tfd, bGPDlayer *gpl /* memory is calloc'ed, so that should zero everything nicely for us */ td->val= &tfd->val; td->ival= (float)gpf->framenum; - + tfd->val= (float)gpf->framenum; tfd->sdata= &gpf->framenum; - + /* advance td now */ td++; tfd++; @@ -3100,7 +3104,7 @@ static int GPLayerToTransData (TransData *td, tGPFtransdata *tfd, bGPDlayer *gpl } } } - + return count; } #endif @@ -3110,32 +3114,32 @@ static void createTransActionData(bContext *C, TransInfo *t) Scene *scene= CTX_data_scene(C); TransData *td = NULL; tGPFtransdata *tfd = NULL; - + bAnimContext ac; ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; - + int count=0; float cfra; char side; - + /* determine what type of data we are operating on */ if (ANIM_animdata_get_context(C, &ac) == 0) return; - + /* filter data */ if (ac.datatype == ANIMCONT_GPENCIL) filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT); else filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - + /* which side of the current frame should be allowed */ if (t->mode == TFM_TIME_EXTEND) { /* only side on which mouse is gets transformed */ float xmouse, ymouse; - + UI_view2d_region_to_view(&ac.ar->v2d, t->imval[0], t->imval[1], &xmouse, &ymouse); side = (xmouse > CFRA) ? 'R' : 'L'; // XXX use t->frame_side } @@ -3143,38 +3147,38 @@ static void createTransActionData(bContext *C, TransInfo *t) /* normal transform - both sides of current frame are considered */ side = 'B'; } - + /* loop 1: fully select ipo-keys and count how many BezTriples are selected */ for (ale= anim_data.first; ale; ale= ale->next) { AnimData *adt= ANIM_nla_mapping_get(&ac, ale); - + /* convert current-frame to action-time (slightly less accurate, espcially under - * higher scaling ratios, but is faster than converting all points) + * higher scaling ratios, but is faster than converting all points) */ - if (adt) + if (adt) cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); else cfra = (float)CFRA; - + //if (ale->type == ANIMTYPE_GPLAYER) // count += count_gplayer_frames(ale->data, side, cfra); //else count += count_fcurve_keys(ale->key_data, side, cfra); } - + /* stop if trying to build list if nothing selected */ if (count == 0) { /* cleanup temp list */ BLI_freelistN(&anim_data); return; } - + /* allocate memory for data */ t->total= count; - + t->data= MEM_callocN(t->total*sizeof(TransData), "TransData(Action Editor)"); td= t->data; - + if (ac.datatype == ANIMCONT_GPENCIL) { if (t->mode == TFM_TIME_SLIDE) { t->customData= MEM_callocN((sizeof(float)*2)+(sizeof(tGPFtransdata)*count), "TimeSlide + tGPFtransdata"); @@ -3187,13 +3191,13 @@ static void createTransActionData(bContext *C, TransInfo *t) } else if (t->mode == TFM_TIME_SLIDE) t->customData= MEM_callocN(sizeof(float)*2, "TimeSlide Min/Max"); - + /* loop 2: build transdata array */ for (ale= anim_data.first; ale; ale= ale->next) { //if (ale->type == ANIMTYPE_GPLAYER) { // bGPDlayer *gpl= (bGPDlayer *)ale->data; // int i; - // + // // i = GPLayerToTransData(td, tfd, gpl, side, cfra); // td += i; // tfd += i; @@ -3201,38 +3205,38 @@ static void createTransActionData(bContext *C, TransInfo *t) //else { AnimData *adt= ANIM_nla_mapping_get(&ac, ale); FCurve *fcu= (FCurve *)ale->key_data; - + /* convert current-frame to action-time (slightly less accurate, espcially under - * higher scaling ratios, but is faster than converting all points) + * higher scaling ratios, but is faster than converting all points) */ - if (adt) + if (adt) cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); else cfra = (float)CFRA; - + td= FCurveToTransData(td, fcu, adt, side, cfra); //} } - + /* check if we're supposed to be setting minx/maxx for TimeSlide */ if (t->mode == TFM_TIME_SLIDE) { float min=999999999.0f, max=-999999999.0f; int i; - + td= (t->data + 1); for (i=1; i < count; i+=3, td+=3) { if (min > *(td->val)) min= *(td->val); if (max < *(td->val)) max= *(td->val); } - - /* minx/maxx values used by TimeSlide are stored as a + + /* minx/maxx values used by TimeSlide are stored as a * calloced 2-float array in t->customData. This gets freed - * in postTrans (T_FREE_CUSTOMDATA). + * in postTrans (T_FREE_CUSTOMDATA). */ *((float *)(t->customData)) = min; *((float *)(t->customData) + 1) = max; } - + /* cleanup temp list */ BLI_freelistN(&anim_data); } @@ -3250,18 +3254,18 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, AnimData *adt, * Due to NLA mapping, we apply NLA mapping to some of the verts here, * and then that mapping will be undone after transform is done. */ - + if (adt) { td2d->loc[0] = BKE_nla_tweakedit_remap(adt, loc[0], NLATIME_CONVERT_UNMAP); td2d->loc[1] = loc[1]; td2d->loc[2] = 0.0f; td2d->loc2d = loc; - + td->loc = td2d->loc; td->center[0] = BKE_nla_tweakedit_remap(adt, cent[0], NLATIME_CONVERT_UNMAP); td->center[1] = cent[1]; td->center[2] = 0.0f; - + VECCOPY(td->iloc, td->loc); } else { @@ -3269,7 +3273,7 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, AnimData *adt, td2d->loc[1] = loc[1]; td2d->loc[2] = 0.0f; td2d->loc2d = loc; - + td->loc = td2d->loc; VECCOPY(td->center, cent); VECCOPY(td->iloc, td->loc); @@ -3279,7 +3283,7 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, AnimData *adt, td->axismtx[2][2] = 1.0f; td->ext= NULL; td->tdi= NULL; td->val= NULL; - + /* store AnimData info in td->extra, for applying mapping when flushing */ td->extra= adt; @@ -3289,49 +3293,49 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, AnimData *adt, } else td->dist= MAXFLOAT; - - if (ishandle) + + if (ishandle) td->flag |= TD_NOTIMESNAP; if (intvals) td->flag |= TD_INTVALUES; - + Mat3One(td->mtx); Mat3One(td->smtx); -} +} static void createTransGraphEditData(bContext *C, TransInfo *t) { Scene *scene= CTX_data_scene(C); ARegion *ar= CTX_wm_region(C); View2D *v2d= &ar->v2d; - + TransData *td = NULL; TransData2D *td2d = NULL; - + bAnimContext ac; ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; - + BezTriple *bezt, *prevbezt; int count=0, i; float cfra; char side; - + /* determine what type of data we are operating on */ if (ANIM_animdata_get_context(C, &ac) == 0) return; - + /* filter data */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_CURVEVISIBLE); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - + /* which side of the current frame should be allowed */ // XXX we still want this mode, but how to get this using standard transform too? if (t->mode == TFM_TIME_EXTEND) { /* only side on which mouse is gets transformed */ float xmouse, ymouse; - + UI_view2d_region_to_view(&ac.ar->v2d, t->imval[0], t->imval[1], &xmouse, &ymouse); side = (xmouse > CFRA) ? 'R' : 'L'; // XXX use t->frame_side } @@ -3339,20 +3343,20 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) /* normal transform - both sides of current frame are considered */ side = 'B'; } - + /* loop 1: count how many BezTriples (specifically their verts) are selected (or should be edited) */ for (ale= anim_data.first; ale; ale= ale->next) { AnimData *adt= ANIM_nla_mapping_get(&ac, ale); FCurve *fcu= (FCurve *)ale->key_data; - + /* convert current-frame to action-time (slightly less accurate, espcially under - * higher scaling ratios, but is faster than converting all points) + * higher scaling ratios, but is faster than converting all points) */ - if (adt) + if (adt) cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); else cfra = (float)CFRA; - + /* only include BezTriples whose 'keyframe' occurs on the same side of the current frame as mouse */ if (fcu->bezt) { for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) { @@ -3380,47 +3384,47 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) } } } - + /* stop if trying to build list if nothing selected */ if (count == 0) { /* cleanup temp list */ BLI_freelistN(&anim_data); return; } - + /* allocate memory for data */ t->total= count; - + t->data= MEM_callocN(t->total*sizeof(TransData), "TransData (Graph Editor)"); /* for each 2d vert a 3d vector is allocated, so that they can be treated just as if they were 3d verts */ t->data2d= MEM_callocN(t->total*sizeof(TransData2D), "TransData2D (Graph Editor)"); - + td= t->data; td2d= t->data2d; - + /* loop 2: build transdata arrays */ for (ale= anim_data.first; ale; ale= ale->next) { AnimData *adt= ANIM_nla_mapping_get(&ac, ale); FCurve *fcu= (FCurve *)ale->key_data; short intvals= (fcu->flag & FCURVE_INT_VALUES); - + /* convert current-frame to action-time (slightly less accurate, espcially under - * higher scaling ratios, but is faster than converting all points) + * higher scaling ratios, but is faster than converting all points) */ - if (adt) + if (adt) cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); else cfra = (float)CFRA; - + /* only include BezTriples whose 'keyframe' occurs on the same side of the current frame as mouse (if applicable) */ bezt= fcu->bezt; prevbezt= NULL; - + for (i=0; i < fcu->totvert; i++, prevbezt=bezt, bezt++) { if (FrameOnMouseSide(side, bezt->vec[1][0], cfra)) { TransDataCurveHandleFlags *hdata = NULL; short h1=1, h2=1; - + /* only include handles if selected, and interpolaton mode uses beztriples */ if ( (!prevbezt && (bezt->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ)) ) { if (bezt->f1 & SELECT) { @@ -3439,7 +3443,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) else h2= 0; } - + /* only include main vert if selected */ if (bezt->f2 & SELECT) { /* if scaling around individuals centers, do no include keyframes */ @@ -3449,13 +3453,13 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) if (hdata == NULL) hdata = initTransDataCurveHandes(td, bezt); } - + bezt_to_transdata(td++, td2d++, adt, bezt->vec[1], bezt->vec[1], 1, 0, intvals); } - - /* special hack (must be done after initTransDataCurveHandes(), as that stores handle settings to restore...): - * - Check if we've got entire BezTriple selected and we're scaling/rotating that point, - * then check if we're using auto-handles. + + /* special hack (must be done after initTransDataCurveHandes(), as that stores handle settings to restore...): + * - Check if we've got entire BezTriple selected and we're scaling/rotating that point, + * then check if we're using auto-handles. * - If so, change them auto-handles to aligned handles so that handles get affected too */ if ((bezt->h1 == HD_AUTO) && (bezt->h2 == HD_AUTO) && ELEM(t->mode, TFM_ROTATION, TFM_RESIZE)) { @@ -3467,11 +3471,11 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) } } } - + /* Sets handles based on the selection */ - testhandles_fcurve(fcu); + testhandles_fcurve(fcu); } - + /* cleanup temp list */ BLI_freelistN(&anim_data); } @@ -3498,23 +3502,23 @@ static BeztMap *bezt_to_beztmaps (BezTriple *bezts, int totvert) BezTriple *prevbezt= NULL; BeztMap *bezm, *bezms; int i; - + /* allocate memory for this array */ if (totvert==0 || bezts==NULL) return NULL; bezm= bezms= MEM_callocN(sizeof(BeztMap)*totvert, "BeztMaps"); - + /* assign beztriples to beztmaps */ for (i=0; i < totvert; i++, bezm++, prevbezt=bezt, bezt++) { bezm->bezt= bezt; - + bezm->oldIndex= i; bezm->newIndex= i; - + bezm->pipo= (prevbezt) ? prevbezt->ipo : bezt->ipo; bezm->cipo= bezt->ipo; } - + return bezms; } @@ -3523,11 +3527,11 @@ static void sort_time_beztmaps (BeztMap *bezms, int totvert) { BeztMap *bezm; int i, ok= 1; - + /* keep repeating the process until nothing is out of place anymore */ while (ok) { ok= 0; - + bezm= bezms; i= totvert; while (i--) { @@ -3536,18 +3540,18 @@ static void sort_time_beztmaps (BeztMap *bezms, int totvert) if (bezm->bezt->vec[1][0] > (bezm+1)->bezt->vec[1][0]) { bezm->newIndex++; (bezm+1)->newIndex--; - + SWAP(BeztMap, *bezm, *(bezm+1)); - + ok= 1; } } - + /* do we need to check if the handles need to be swapped? * optimisation: this only needs to be performed in the first loop */ if (bezm->swapHs == 0) { - if ( (bezm->bezt->vec[0][0] > bezm->bezt->vec[1][0]) && + if ( (bezm->bezt->vec[0][0] > bezm->bezt->vec[1][0]) && (bezm->bezt->vec[2][0] < bezm->bezt->vec[1][0]) ) { /* handles need to be swapped */ @@ -3558,9 +3562,9 @@ static void sort_time_beztmaps (BeztMap *bezms, int totvert) bezm->swapHs = -1; } } - + bezm++; - } + } } } @@ -3572,24 +3576,24 @@ static void beztmap_to_data (TransInfo *t, FCurve *fcu, BeztMap *bezms, int totv TransData2D *td; int i, j; char *adjusted; - - /* dynamically allocate an array of chars to mark whether an TransData's + + /* dynamically allocate an array of chars to mark whether an TransData's * pointers have been fixed already, so that we don't override ones that are * already done */ adjusted= MEM_callocN(t->total, "beztmap_adjusted_map"); - + /* for each beztmap item, find if it is used anywhere */ bezm= bezms; for (i= 0; i < totvert; i++, bezm++) { - /* loop through transdata, testing if we have a hit + /* loop through transdata, testing if we have a hit * for the handles (vec[0]/vec[2]), we must also check if they need to be swapped... */ td= t->data2d; for (j= 0; j < t->total; j++, td++) { /* skip item if already marked */ if (adjusted[j] != 0) continue; - + /* only selected verts */ if (bezm->pipo == BEZT_IPO_BEZ) { if (bezm->bezt->f1 & SELECT) { @@ -3620,42 +3624,42 @@ static void beztmap_to_data (TransInfo *t, FCurve *fcu, BeztMap *bezms, int totv } } } - + } - + /* free temp memory used for 'adjusted' array */ MEM_freeN(adjusted); } -/* This function is called by recalcData during the Transform loop to recalculate +/* This function is called by recalcData during the Transform loop to recalculate * the handles of curves and sort the keyframes so that the curves draw correctly. * It is only called if some keyframes have moved out of order. * - * anim_data is the list of channels (F-Curves) retrieved already containing the + * anim_data is the list of channels (F-Curves) retrieved already containing the * channels to work on. It should not be freed here as it may still need to be used. */ void remake_graph_transdata (TransInfo *t, ListBase *anim_data) { bAnimListElem *ale; - + /* sort and reassign verts */ for (ale= anim_data->first; ale; ale= ale->next) { FCurve *fcu= (FCurve *)ale->key_data; - + if (fcu->bezt) { BeztMap *bezm; - + /* adjust transform-data pointers */ bezm= bezt_to_beztmaps(fcu->bezt, fcu->totvert); sort_time_beztmaps(bezm, fcu->totvert); beztmap_to_data(t, fcu, bezm, fcu->totvert); - + /* free mapping stuff */ MEM_freeN(bezm); - + /* re-sort actual beztriples (perhaps this could be done using the beztmaps to save time?) */ sort_time_fcurve(fcu); - + /* make sure handles are all set correctly */ testhandles_fcurve(fcu); } @@ -3663,7 +3667,7 @@ void remake_graph_transdata (TransInfo *t, ListBase *anim_data) } /* this function is called on recalcData to apply the transforms applied - * to the transdata on to the actual keyframe data + * to the transdata on to the actual keyframe data */ void flushTransGraphData(TransInfo *t) { @@ -3673,13 +3677,13 @@ void flushTransGraphData(TransInfo *t) Scene *scene= t->scene; double secf= FPS; int a; - + /* flush to 2d vector from internally used 3d vector */ for (a=0, td= t->data, td2d=t->data2d; atotal; a++, td++, td2d++) { AnimData *adt= (AnimData *)td->extra; /* pointers to relevant AnimData blocks are stored in the td->extra pointers */ - - /* handle snapping for time values - * - we should still be in NLA-mapping timespace + + /* handle snapping for time values + * - we should still be in NLA-mapping timespace * - only apply to keyframes (but never to handles) */ if ((td->flag & TD_NOTIMESNAP)==0) { @@ -3690,19 +3694,19 @@ void flushTransGraphData(TransInfo *t) else td2d->loc[0]= (float)( floor(td2d->loc[0]+0.5f) ); break; - + case SACTSNAP_MARKER: /* snap to nearest marker */ td2d->loc[0]= (float)ED_markers_find_nearest_marker_time(&t->scene->markers, td2d->loc[0]); break; } } - + /* we need to unapply the nla-scaling from the time in some situations */ if (adt) td2d->loc2d[0]= BKE_nla_tweakedit_remap(adt, td2d->loc[0], NLATIME_CONVERT_UNMAP); else td2d->loc2d[0]= td2d->loc[0]; - + /* if int-values only, truncate to integers */ if (td->flag & TD_INTVALUES) td2d->loc2d[1]= (float)((int)td2d->loc[1]); @@ -3739,13 +3743,13 @@ static void ipokey_to_transdata(IpoKey *ik, TransData *td) TransDataIpokey *tdi= td->tdi; BezTriple *bezt; int a, delta= 0; - + td->val= NULL; // is read on ESC - + for(a=0; adata[a]) { bezt= ik->data[a]; - + switch( ob_ar[a] ) { case OB_LOC_X: case OB_DLOC_X: @@ -3756,7 +3760,7 @@ static void ipokey_to_transdata(IpoKey *ik, TransData *td) case OB_LOC_Z: case OB_DLOC_Z: tdi->locz= &(bezt->vec[1][1]); break; - + case OB_DROT_X: delta= 1; case OB_ROT_X: @@ -3769,7 +3773,7 @@ static void ipokey_to_transdata(IpoKey *ik, TransData *td) delta= 1; case OB_ROT_Z: tdi->rotz= &(bezt->vec[1][1]); break; - + case OB_SIZE_X: case OB_DSIZE_X: tdi->sizex= &(bezt->vec[1][1]); break; @@ -3778,26 +3782,26 @@ static void ipokey_to_transdata(IpoKey *ik, TransData *td) tdi->sizey= &(bezt->vec[1][1]); break; case OB_SIZE_Z: case OB_DSIZE_Z: - tdi->sizez= &(bezt->vec[1][1]); break; - } + tdi->sizez= &(bezt->vec[1][1]); break; + } } } - + /* oldvals for e.g. undo */ if(tdi->locx) set_tdi_old(tdi->oldloc, tdi->locx); if(tdi->locy) set_tdi_old(tdi->oldloc+1, tdi->locy); if(tdi->locz) set_tdi_old(tdi->oldloc+2, tdi->locz); - + /* remember, for mapping curves ('1'=10 degrees) */ if(tdi->rotx) set_tdi_old(tdi->oldrot, tdi->rotx); if(tdi->roty) set_tdi_old(tdi->oldrot+1, tdi->roty); if(tdi->rotz) set_tdi_old(tdi->oldrot+2, tdi->rotz); - + /* this is not allowed to be dsize! */ if(tdi->sizex) set_tdi_old(tdi->oldsize, tdi->sizex); if(tdi->sizey) set_tdi_old(tdi->oldsize+1, tdi->sizey); if(tdi->sizez) set_tdi_old(tdi->oldsize+2, tdi->sizez); - + tdi->flag= TOB_IPO; if(delta) tdi->flag |= TOB_IPODROT; } @@ -3814,8 +3818,8 @@ static void ipokey_to_transdata(IpoKey *ik, TransData *td) static short constraints_list_needinv(TransInfo *t, ListBase *list) { bConstraint *con; - - /* loop through constraints, checking if there's one of the mentioned + + /* loop through constraints, checking if there's one of the mentioned * constraints needing special crazyspace corrections */ if (list) { @@ -3827,19 +3831,19 @@ static short constraints_list_needinv(TransInfo *t, ListBase *list) if (con->type == CONSTRAINT_TYPE_CHILDOF) return 1; if (con->type == CONSTRAINT_TYPE_FOLLOWPATH) return 1; if (con->type == CONSTRAINT_TYPE_CLAMPTO) return 1; - + /* constraints that require this only under special conditions */ if (con->type == CONSTRAINT_TYPE_ROTLIKE) { /* CopyRot constraint only does this when rotating, and offset is on */ bRotateLikeConstraint *data = (bRotateLikeConstraint *)con->data; - + if ((data->flag & ROTLIKE_OFFSET) && (t->mode == TFM_ROTATION)) return 1; } } } } - + /* no appropriate candidates found */ return 0; } @@ -3871,13 +3875,13 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count *flag= 0; } else if (seq->type ==SEQ_META) { - + /* for meta's we only ever need to extend their children, no matter what depth * just check the meta's are in the bounds */ if (t->frame_side=='R' && right <= cfra) *recursive= 0; else if (t->frame_side=='L' && left >= cfra) *recursive= 0; else *recursive= 1; - + *count= 0; *flag= 0; } @@ -4001,15 +4005,15 @@ static TransData *SeqToTransData(TransInfo *t, TransData *td, TransData2D *td2d, td2d->loc[2] = 0.0f; td2d->loc2d = NULL; - + tdsq->seq= seq; /* Use instead of seq->flag for nested strips and other * cases where the selection may need to be modified */ tdsq->flag= flag; tdsq->sel_flag= sel_flag; - - + + td->extra= (void *)tdsq; /* allow us to update the strip from here */ td->flag = 0; @@ -4031,7 +4035,7 @@ static TransData *SeqToTransData(TransInfo *t, TransData *td, TransData2D *td2d, /* Time Transform (extend) */ td->val= td2d->loc; td->ival= td2d->loc[0]; - + return td; } @@ -4040,15 +4044,15 @@ static int SeqToTransData_Recursive(TransInfo *t, ListBase *seqbase, TransData * Sequence *seq; int recursive, count, flag; int tot= 0; - + for (seq= seqbase->first; seq; seq= seq->next) { SeqTransInfo(t, seq, &recursive, &count, &flag); - + /* add children first so recalculating metastrips does nested strips first */ if (recursive) { int tot_children= SeqToTransData_Recursive(t, &seq->seqbase, td, td2d, tdsq); - + td= td + tot_children; td2d= td2d + tot_children; tdsq= tdsq + tot_children; @@ -4081,7 +4085,7 @@ static int SeqToTransData_Recursive(TransInfo *t, ListBase *seqbase, TransData * static void createTransSeqData(bContext *C, TransInfo *t) { - + View2D *v2d= UI_view2d_fromcontext(C); Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(t->scene, FALSE); @@ -4119,12 +4123,12 @@ static void createTransSeqData(bContext *C, TransInfo *t) if (count == 0) { return; } - + td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransSeq TransData"); td2d = t->data2d = MEM_callocN(t->total*sizeof(TransData2D), "TransSeq TransData2D"); tdsq = t->customData= MEM_callocN(t->total*sizeof(TransDataSeq), "TransSeq TransDataSeq"); - + /* loop 2: build transdata array */ SeqToTransData_Recursive(t, ed->seqbasep, td, td2d, tdsq); @@ -4132,7 +4136,7 @@ static void createTransSeqData(bContext *C, TransInfo *t) /* transcribe given object into TransData for Transforming */ -static void ObjectToTransData(bContext *C, TransInfo *t, TransData *td, Object *ob) +static void ObjectToTransData(bContext *C, TransInfo *t, TransData *td, Object *ob) { Scene *scene = CTX_data_scene(C); Object *track; @@ -4146,35 +4150,35 @@ static void ObjectToTransData(bContext *C, TransInfo *t, TransData *td, Object * Mat3Ortho(td->axismtx); td->con= ob->constraints.first; - - /* hack: tempolarily disable tracking and/or constraints when getting + + /* hack: tempolarily disable tracking and/or constraints when getting * object matrix, if tracking is on, or if constraints don't need * inverse correction to stop it from screwing up space conversion * matrix later */ constinv = constraints_list_needinv(t, &ob->constraints); - + /* disable constraints inversion for dummy pass */ if (t->mode == TFM_DUMMY) skip_invert = 1; - + if (skip_invert == 0 && (ob->track || constinv==0)) { track= ob->track; ob->track= NULL; - + if (constinv == 0) { fakecons.first = ob->constraints.first; fakecons.last = ob->constraints.last; ob->constraints.first = ob->constraints.last = NULL; } - + where_is_object(t->scene, ob); - + if (constinv == 0) { ob->constraints.first = fakecons.first; ob->constraints.last = fakecons.last; } - + ob->track= track; } else @@ -4184,23 +4188,23 @@ static void ObjectToTransData(bContext *C, TransInfo *t, TransData *td, Object * td->loc = ob->loc; VECCOPY(td->iloc, td->loc); - + td->ext->rot = ob->rot; VECCOPY(td->ext->irot, ob->rot); VECCOPY(td->ext->drot, ob->drot); - + td->ext->size = ob->size; VECCOPY(td->ext->isize, ob->size); VECCOPY(td->ext->dsize, ob->dsize); VECCOPY(td->center, ob->obmat[3]); - + Mat4CpyMat4(td->ext->obmat, ob->obmat); /* is there a need to set the global<->data space conversion matrices? */ if (ob->parent || constinv) { float totmat[3][3], obinv[3][3]; - + /* Get the effect of parenting, and/or certain constraints. * NOTE: some Constraints, and also Tracking should never get this * done, as it doesn't work well. @@ -4216,7 +4220,7 @@ static void ObjectToTransData(bContext *C, TransInfo *t, TransData *td, Object * Mat3One(td->smtx); Mat3One(td->mtx); } - + /* set active flag */ if (ob == OBACT) { @@ -4231,39 +4235,39 @@ static void set_trans_object_base_flags(bContext *C, TransInfo *t) { Scene *sce = CTX_data_scene(C); View3D *v3d = t->view; - + /* if Base selected and has parent selected: base->flag= BA_WAS_SEL */ Base *base; - + /* don't do it if we're not actually going to recalculate anything */ if(t->mode == TFM_DUMMY) return; /* makes sure base flags and object flags are identical */ copy_baseflags(t->scene); - + /* handle pending update events, otherwise they got copied below */ for (base= sce->base.first; base; base= base->next) { - if(base->object->recalc) + if(base->object->recalc) object_handle_update(t->scene, base->object); } - + for (base= sce->base.first; base; base= base->next) { base->flag &= ~BA_WAS_SEL; - + if(TESTBASELIB(v3d, base)) { Object *ob= base->object; Object *parsel= ob->parent; - + /* if parent selected, deselect */ while(parsel) { if(parsel->flag & SELECT) break; parsel= parsel->parent; } - + if(parsel) { if ((t->mode == TFM_ROTATION || t->mode == TFM_TRACKBALL) && t->around == V3D_LOCAL) @@ -4283,7 +4287,7 @@ static void set_trans_object_base_flags(bContext *C, TransInfo *t) /* all recalc flags get flushed to all layers, so a layer flip later on works fine */ DAG_scene_flush_update(t->scene, -1, 0); - + /* and we store them temporal in base (only used for transform code) */ /* this because after doing updates, the object->recalc is cleared */ for (base= sce->base.first; base; base= base->next) { @@ -4298,7 +4302,7 @@ static void clear_trans_object_base_flags(TransInfo *t) { Scene *sce = t->scene; Base *base; - + for (base= sce->base.first; base; base = base->next) { if(base->flag & BA_WAS_SEL) @@ -4313,34 +4317,34 @@ static void clear_trans_object_base_flags(TransInfo *t) short autokeyframe_cfra_can_key(Scene *scene, Object *ob) { float cfra= (float)CFRA; // XXX for now, this will do - + /* only filter if auto-key mode requires this */ if (IS_AUTOKEY_ON(scene) == 0) return 0; - else if (IS_AUTOKEY_MODE(scene, NORMAL)) + else if (IS_AUTOKEY_MODE(scene, NORMAL)) return 1; - else + else return id_frame_has_keyframe(&ob->id, cfra, ANIMFILTER_KEYS_LOCAL); } -/* auto-keyframing feature - for objects - * tmode: should be a transform mode +/* auto-keyframing feature - for objects + * tmode: should be a transform mode */ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode) { ID *id= &ob->id; FCurve *fcu; - + if (autokeyframe_cfra_can_key(scene, ob)) { AnimData *adt= ob->adt; float cfra= (float)CFRA; // xxx this will do for now short flag = 0; - + if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED; if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX; - + if (IS_AUTOKEY_FLAG(INSERTAVAIL)) { /* only key on available channels */ if (adt && adt->action) { @@ -4352,7 +4356,7 @@ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode) } else if (IS_AUTOKEY_FLAG(INSERTNEEDED)) { short doLoc=0, doRot=0, doScale=0; - + /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */ if (tmode == TFM_TRANSLATION) { doLoc = 1; @@ -4363,9 +4367,9 @@ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode) doLoc = 1; } else if (v3d->around == V3D_CURSOR) - doLoc = 1; - - if ((v3d->flag & V3D_ALIGN)==0) + doLoc = 1; + + if ((v3d->flag & V3D_ALIGN)==0) doRot = 1; } else if (tmode == TFM_RESIZE) { @@ -4374,12 +4378,12 @@ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode) doLoc = 1; } else if (v3d->around == V3D_CURSOR) - doLoc = 1; - + doLoc = 1; + if ((v3d->flag & V3D_ALIGN)==0) doScale = 1; } - + // TODO: the group names here are temporary... // TODO: should this be made to use the builtin KeyingSets instead? if (doLoc) { @@ -4404,22 +4408,22 @@ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode) insert_keyframe(id, NULL, "Object Transform", "location", 0, cfra, flag); insert_keyframe(id, NULL, "Object Transform", "location", 1, cfra, flag); insert_keyframe(id, NULL, "Object Transform", "location", 2, cfra, flag); - + insert_keyframe(id, NULL, "Object Transform", "rotation", 0, cfra, flag); insert_keyframe(id, NULL, "Object Transform", "rotation", 1, cfra, flag); insert_keyframe(id, NULL, "Object Transform", "rotation", 2, cfra, flag); - + insert_keyframe(id, NULL, "Object Transform", "scale", 0, cfra, flag); insert_keyframe(id, NULL, "Object Transform", "scale", 1, cfra, flag); insert_keyframe(id, NULL, "Object Transform", "scale", 2, cfra, flag); } - + // XXX todo... find a way to send notifiers from here... } } -/* auto-keyframing feature - for poses/pose-channels - * tmode: should be a transform mode +/* auto-keyframing feature - for poses/pose-channels + * tmode: should be a transform mode * targetless_ik: has targetless ik been done on any channels? */ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode, short targetless_ik) @@ -4431,13 +4435,13 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode, bPose *pose= ob->pose; bPoseChannel *pchan; FCurve *fcu; - + if (autokeyframe_cfra_can_key(scene, ob)) { float cfra= (float)CFRA; short flag= 0; char buf[512]; - - /* flag is initialised from UserPref keyframing settings + + /* flag is initialised from UserPref keyframing settings * - special exception for targetless IK - INSERTKEY_MATRIX keyframes should get * visual keyframes even if flag not set, as it's not that useful otherwise * (for quick animation recording) @@ -4446,12 +4450,12 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode, flag |= INSERTKEY_MATRIX; if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED; - + for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) { if (pchan->bone->flag & BONE_TRANSFORM) { /* clear any 'unkeyed' flag it may have */ pchan->bone->flag &= ~BONE_UNKEYED; - + /* only insert into available channels? */ if (IS_AUTOKEY_FLAG(INSERTAVAIL)) { if (act) { @@ -4462,29 +4466,29 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode, /* only insert keyframe if needed? */ else if (IS_AUTOKEY_FLAG(INSERTNEEDED)) { short doLoc=0, doRot=0, doScale=0; - + /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */ if (tmode == TFM_TRANSLATION) { - if (targetless_ik) + if (targetless_ik) doRot= 1; - else + else doLoc = 1; } else if (tmode == TFM_ROTATION) { if (ELEM(v3d->around, V3D_CURSOR, V3D_ACTIVE)) doLoc = 1; - - if ((v3d->flag & V3D_ALIGN)==0) + + if ((v3d->flag & V3D_ALIGN)==0) doRot = 1; } else if (tmode == TFM_RESIZE) { if (ELEM(v3d->around, V3D_CURSOR, V3D_ACTIVE)) doLoc = 1; - + if ((v3d->flag & V3D_ALIGN)==0) doScale = 1; } - + if (doLoc) { sprintf(buf, "pose.pose_channels[\"%s\"].location", pchan->name); insert_keyframe(id, NULL, pchan->name, buf, 0, cfra, flag); @@ -4519,7 +4523,7 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode, insert_keyframe(id, NULL, pchan->name, buf, 0, cfra, flag); insert_keyframe(id, NULL, pchan->name, buf, 1, cfra, flag); insert_keyframe(id, NULL, pchan->name, buf, 2, cfra, flag); - + if (pchan->rotmode == PCHAN_ROT_QUAT) { sprintf(buf, "pose.pose_channels[\"%s\"].rotation", pchan->name); insert_keyframe(id, NULL, pchan->name, buf, 0, cfra, flag); @@ -4533,7 +4537,7 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode, insert_keyframe(id, NULL, pchan->name, buf, 1, cfra, flag); insert_keyframe(id, NULL, pchan->name, buf, 2, cfra, flag); } - + sprintf(buf, "pose.pose_channels[\"%s\"].scale", pchan->name); insert_keyframe(id, NULL, pchan->name, buf, 0, cfra, flag); insert_keyframe(id, NULL, pchan->name, buf, 1, cfra, flag); @@ -4541,15 +4545,15 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode, } } } - + // XXX todo... figure out way to get appropriate notifiers sent - + /* do the bone paths */ #if 0 // TRANSFORM_FIX_ME if (arm->pathflag & ARM_PATH_ACFRA) { pose_clear_paths(ob); pose_recalculate_paths(ob); - } + } #endif } else { @@ -4573,7 +4577,7 @@ void special_aftertrans_update(TransInfo *t) // short redrawipo=0, resetslowpar=1; int cancelled= (t->state == TRANS_CANCEL); short duplicate= (t->undostr && strstr(t->undostr, "Duplicate")) ? 1 : 0; - + if (t->spacetype==SPACE_VIEW3D) { if (t->obedit) { if (cancelled==0) { @@ -4596,7 +4600,7 @@ void special_aftertrans_update(TransInfo *t) #if 0 // TRANSFORM_FIX_ME, Would prefer to use this since the array takes into // account what where transforming (with extend, locked strips etc) // But at the moment t->data is freed in postTrans so for now re-shuffeling selected strips works ok. - Campbell - + int a; TransData *td= t->data; @@ -4621,7 +4625,7 @@ void special_aftertrans_update(TransInfo *t) for(seq= seqbasep->first; seq; seq= seq->next) { max_machine = MAX2(max_machine, seq->machine); } - + for (machine = 0; machine <= max_machine; machine++) { for(seq= seqbasep->first; seq; seq= seq->next) { @@ -4631,7 +4635,7 @@ void special_aftertrans_update(TransInfo *t) } } #endif - + for(seq= seqbasep->first; seq; seq= seq->next) { /* We might want to build a list of effects that need to be updated during transform */ if(seq->type & SEQ_EFFECT) { @@ -4643,7 +4647,7 @@ void special_aftertrans_update(TransInfo *t) sort_seq(t->scene); } - + if (t->customData) MEM_freeN(t->customData); if (t->data) @@ -4653,39 +4657,39 @@ void special_aftertrans_update(TransInfo *t) SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first; Scene *scene; bAnimContext ac; - + /* initialise relevant anim-context 'context' data from TransInfo data */ /* NOTE: sync this with the code in ANIM_animdata_get_context() */ memset(&ac, 0, sizeof(bAnimContext)); - + scene= ac.scene= t->scene; ob= ac.obact= OBACT; ac.sa= t->sa; ac.ar= t->ar; ac.spacetype= (t->sa)? t->sa->spacetype : 0; ac.regiontype= (t->ar)? t->ar->regiontype : 0; - + if (ANIM_animdata_context_getdata(&ac) == 0) return; - + if (ac.datatype == ANIMCONT_DOPESHEET) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; short filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); - + /* get channels to work on */ ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - + /* these should all be ipo-blocks */ for (ale= anim_data.first; ale; ale= ale->next) { AnimData *adt= ANIM_nla_mapping_get(&ac, ale); FCurve *fcu= (FCurve *)ale->key_data; - - if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 && + + if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 && ((cancelled == 0) || (duplicate)) ) { if (adt) { - ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1); + ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1); posttrans_fcurve_clean(fcu); ANIM_nla_mapping_apply_fcurve(adt, fcu, 1, 1); } @@ -4693,7 +4697,7 @@ void special_aftertrans_update(TransInfo *t) posttrans_fcurve_clean(fcu); } } - + /* free temp memory */ BLI_freelistN(&anim_data); } @@ -4702,15 +4706,15 @@ void special_aftertrans_update(TransInfo *t) // fixme... some of this stuff is not good if (ob) { ob->ctime= -1234567.0f; - + if (ob->pose || ob_get_key(ob)) DAG_object_flush_update(scene, ob, OB_RECALC); else DAG_object_flush_update(scene, ob, OB_RECALC_OB); } - + /* Do curve cleanups? */ - if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 && + if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 && ((cancelled == 0) || (duplicate)) ) { posttrans_action_clean(&ac, (bAction *)ac.data); @@ -4720,16 +4724,16 @@ void special_aftertrans_update(TransInfo *t) #if 0 // XXX old animation system /* fix up the Ipocurves and redraw stuff */ Key *key= (Key *)ac.data; - + if (key->ipo) { - if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 && + if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 && ((cancelled == 0) || (duplicate)) ) { posttrans_ipo_clean(key->ipo); } } #endif // XXX old animation system - + DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA); } #if 0 // XXX future of this is still not clear @@ -4739,23 +4743,23 @@ void special_aftertrans_update(TransInfo *t) { bScreen *sc= (bScreen *)ac.data; ScrArea *sa; - + /* BAD... we need to loop over all screen areas for current screen... - * - sync this with actdata_filter_gpencil() in editaction.c + * - sync this with actdata_filter_gpencil() in editaction.c */ for (sa= sc->areabase.first; sa; sa= sa->next) { bGPdata *gpd= gpencil_data_getactive(sa); - - if (gpd) + + if (gpd) posttrans_gpd_clean(gpd); } } } #endif // XXX future of this is still not clear - + /* make sure all F-Curves are set correctly */ ANIM_editkeyframes_refresh(&ac); - + /* clear flag that was set for time-slide drawing */ saction->flag &= ~SACTION_MOVING; } @@ -4763,40 +4767,40 @@ void special_aftertrans_update(TransInfo *t) SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first; Scene *scene; bAnimContext ac; - + /* initialise relevant anim-context 'context' data from TransInfo data */ /* NOTE: sync this with the code in ANIM_animdata_get_context() */ memset(&ac, 0, sizeof(bAnimContext)); - + scene= ac.scene= t->scene; ob= ac.obact= OBACT; ac.sa= t->sa; ac.ar= t->ar; ac.spacetype= (t->sa)? t->sa->spacetype : 0; ac.regiontype= (t->ar)? t->ar->regiontype : 0; - + if (ANIM_animdata_context_getdata(&ac) == 0) return; - - if (ac.datatype) + + if (ac.datatype) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; short filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_CURVEVISIBLE); - + /* get channels to work on */ ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - + /* these should all be ipo-blocks */ for (ale= anim_data.first; ale; ale= ale->next) { AnimData *adt= ANIM_nla_mapping_get(&ac, ale); FCurve *fcu= (FCurve *)ale->key_data; - - if ( (sipo->flag & SIPO_NOTRANSKEYCULL)==0 && + + if ( (sipo->flag & SIPO_NOTRANSKEYCULL)==0 && ((cancelled == 0) || (duplicate)) ) { if (adt) { - ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1); + ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1); posttrans_fcurve_clean(fcu); ANIM_nla_mapping_apply_fcurve(adt, fcu, 1, 1); } @@ -4804,55 +4808,55 @@ void special_aftertrans_update(TransInfo *t) posttrans_fcurve_clean(fcu); } } - + /* free temp memory */ BLI_freelistN(&anim_data); } - + /* make sure all F-Curves are set correctly */ ANIM_editkeyframes_refresh(&ac); } else if (t->spacetype == SPACE_NLA) { Scene *scene; bAnimContext ac; - + /* initialise relevant anim-context 'context' data from TransInfo data */ /* NOTE: sync this with the code in ANIM_animdata_get_context() */ memset(&ac, 0, sizeof(bAnimContext)); - + scene= ac.scene= t->scene; ob= ac.obact= OBACT; ac.sa= t->sa; ac.ar= t->ar; ac.spacetype= (t->sa)? t->sa->spacetype : 0; ac.regiontype= (t->ar)? t->ar->regiontype : 0; - + if (ANIM_animdata_context_getdata(&ac) == 0) return; - - if (ac.datatype) + + if (ac.datatype) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; short filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NLATRACKS); - + /* get channels to work on */ ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - + for (ale= anim_data.first; ale; ale= ale->next) { NlaTrack *nlt= (NlaTrack *)ale->data; - + /* make sure strips are in order again */ BKE_nlatrack_sort_strips(nlt); - + /* remove the temp metas */ BKE_nlastrips_clear_metas(&nlt->strips, 0, 1); } - + /* free temp memory */ BLI_freelistN(&anim_data); } - + // XXX check on the calls below... we need some of these sanity checks //synchronize_action_strips(); //ANIM_editkeyframes_refresh(&ac); @@ -4861,7 +4865,7 @@ void special_aftertrans_update(TransInfo *t) // TRANSFORM_FIX_ME // if (t->mode==TFM_BONESIZE || t->mode==TFM_BONE_ENVELOPE) // allqueue(REDRAWBUTSEDIT, 0); - + if (t->obedit->type == OB_MESH) { EditMesh *em = ((Mesh *)t->obedit->data)->edit_mesh; @@ -4874,11 +4878,11 @@ void special_aftertrans_update(TransInfo *t) bPose *pose; bPoseChannel *pchan; short targetless_ik= 0; - + ob= t->poseobj; arm= ob->data; pose= ob->pose; - + /* if target-less IK grabbing, we calculate the pchan transforms and clear flag */ if (!cancelled && t->mode==TFM_TRANSLATION) targetless_ik= apply_targetless_ik(ob); @@ -4889,10 +4893,10 @@ void special_aftertrans_update(TransInfo *t) if(data) data->flag &= ~CONSTRAINT_IK_AUTO; } } - + if (t->mode==TFM_TRANSLATION) pose_grab_with_ik_clear(ob); - + /* automatic inserting of keys and unkeyed tagging - only if transform wasn't cancelled (or TFM_DUMMY) */ if (!cancelled && (t->mode != TFM_DUMMY)) { autokeyframe_pose_cb_func(t->scene, (View3D *)t->view, ob, t->mode, targetless_ik); @@ -4903,26 +4907,26 @@ void special_aftertrans_update(TransInfo *t) DAG_object_flush_update(t->scene, ob, OB_RECALC_DATA); ob->recalc= 0; // is set on OK position already by recalcData() } - else + else DAG_object_flush_update(t->scene, ob, OB_RECALC_DATA); - + //if (t->mode==TFM_BONESIZE || t->mode==TFM_BONE_ENVELOPE) // allqueue(REDRAWBUTSEDIT, 0); - + } else if(G.f & G_PARTICLEEDIT) { ; } - else { + else { /* Objects */ // XXX ideally, this would go through context iterators, but we don't have context iterator access here, // so we make do with old data + access styles... Scene *scene= t->scene; Base *base; - + for (base= FIRSTBASE; base; base= base->next) { ob= base->object; - + if (base->flag & SELECT && (t->mode != TFM_DUMMY)) { /* pointcache refresh */ if (BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH)) @@ -4933,14 +4937,14 @@ void special_aftertrans_update(TransInfo *t) /* autokey though, probably needed is an anim sys override? */ /* Please remove if some other solution is found. -jahka */ DAG_object_flush_update(scene, ob, OB_RECALC_OB); - + /* Set autokey if necessary */ if (!cancelled) autokeyframe_ob_cb_func(t->scene, (View3D *)t->view, ob, t->mode); } } } - + clear_trans_object_base_flags(t); #if 0 // TRANSFORM_FIX_ME @@ -4949,10 +4953,10 @@ void special_aftertrans_update(TransInfo *t) allqueue(REDRAWACTION, 0); allqueue(REDRAWIPO, 0); } - + if(resetslowpar) reset_slowparents(); - + /* note; should actually only be done for all objects when a lamp is moved... (ton) */ if(t->spacetype==SPACE_VIEW3D && G.vd->drawtype == OB_SHADED) reshadeall_displist(); @@ -4965,10 +4969,10 @@ static void createTransObject(bContext *C, TransInfo *t) TransDataExtension *tx; // IpoKey *ik; // ListBase elems; - + set_trans_object_base_flags(C, t); - /* count */ + /* count */ CTX_DATA_BEGIN(C, Object*, ob, selected_objects) { #if 0 // TRANSFORM_FIX_ME @@ -4976,12 +4980,12 @@ static void createTransObject(bContext *C, TransInfo *t) if ((ob->id.lib == 0) && (ob->ipo) && (ob->ipo->showkey) && (ob->ipoflag & OB_DRAWKEY)) { elems.first= elems.last= NULL; make_ipokey_transform(ob, &elems, 1); /* '1' only selected keys */ - + pushdata(&elems, sizeof(ListBase)); - + for(ik= elems.first; ik; ik= ik->next) t->total++; - + if(elems.first==NULL) t->total++; } @@ -4997,24 +5001,24 @@ static void createTransObject(bContext *C, TransInfo *t) clear_trans_object_base_flags(t); return; } - + td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransOb"); tx = t->ext = MEM_callocN(t->total*sizeof(TransDataExtension), "TransObExtension"); CTX_DATA_BEGIN(C, Base*, base, selected_bases) { Object *ob= base->object; - + td->flag = TD_SELECTED; td->protectflag= ob->protectflag; td->ext = tx; - + if (base->flag & BA_TRANSFORM_CHILD) { td->flag |= TD_NOCENTER; td->flag |= TD_NO_LOC; } - + /* select linked objects, but skip them later */ if (ob->id.lib != 0) { td->flag |= TD_SKIP; @@ -5024,55 +5028,55 @@ static void createTransObject(bContext *C, TransInfo *t) // TRANSFORM_FIX_ME #if 0 if((ob->id.lib == 0) && (ob->ipo) && (ob->ipo->showkey) && (ob->ipoflag & OB_DRAWKEY)) { - + popfirst(&elems); // bring back pushed listbase - + if(elems.first) { int cfraont; int ipoflag; - + base->flag |= BA_DO_IPO+BA_WAS_SEL; base->flag &= ~SELECT; - + cfraont= CFRA; set_no_parent_ipo(1); ipoflag= ob->ipoflag; ob->ipoflag &= ~OB_OFFS_OB; - + /* * This is really EVIL code that pushes down Object values * (loc, dloc, orig, size, dsize, rot, drot) * */ - + pushdata((void*)ob->loc, 7 * 3 * sizeof(float)); // tsk! tsk! - + for(ik= elems.first; ik; ik= ik->next) { - + /* weak... this doesn't correct for floating values, giving small errors */ CFRA= (int)(ik->val/t->scene->r.framelen); - + do_ob_ipo(ob); ObjectToTransData(C, t, td, ob); // does where_is_object() - + td->flag= TD_SELECTED; - + td->tdi= MEM_callocN(sizeof(TransDataIpokey), "TransDataIpokey"); /* also does tdi->flag and oldvals, needs to be after ob_to_transob()! */ ipokey_to_transdata(ik, td); - + td++; tx++; if(ik->next) td->ext= tx; // prevent corrupting mem! } free_ipokey(&elems); - + poplast(ob->loc); set_no_parent_ipo(0); - + CFRA= cfraont; ob->ipoflag= ipoflag; - - where_is_object(t->scene, ob); // restore + + where_is_object(t->scene, ob); // restore } else { ObjectToTransData(C, t, td, ob); @@ -5096,7 +5100,7 @@ static void createTransObject(bContext *C, TransInfo *t) /* transcribe given node into TransData2D for Transforming */ static void NodeToTransData(TransData *td, TransData2D *td2d, bNode *node) -// static void NodeToTransData(bContext *C, TransInfo *t, TransData2D *td, bNode *node) +// static void NodeToTransData(bContext *C, TransInfo *t, TransData2D *td, bNode *node) { td2d->loc[0] = node->locx; /* hold original location */ td2d->loc[1] = node->locy; @@ -5124,22 +5128,22 @@ void createTransNodeData(bContext *C, TransInfo *t) { TransData *td; TransData2D *td2d; - + t->total= CTX_DATA_COUNT(C, selected_nodes); - + td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransNode TransData"); td2d = t->data2d = MEM_callocN(t->total*sizeof(TransData2D), "TransNode TransData2D"); - + CTX_DATA_BEGIN(C, bNode *, selnode, selected_nodes) NodeToTransData(td++, td2d++, selnode); CTX_DATA_END } -void createTransData(bContext *C, TransInfo *t) +void createTransData(bContext *C, TransInfo *t) { Scene *scene = CTX_data_scene(C); Object *ob = OBACT; - + if (t->options == CTX_TEXTURE) { t->flag |= T_TEXTURE; createTransTexspace(C, t); @@ -5183,7 +5187,7 @@ void createTransData(bContext *C, TransInfo *t) else if (t->spacetype == SPACE_IPO) { t->flag |= T_POINTS|T_2D_EDIT; createTransGraphEditData(C, t); -#if 0 +#if 0 if (t->data && (t->flag & T_PROP_EDIT)) { sort_trans_data(t); // makes selected become first in array set_prop_dist(t, 1); @@ -5203,7 +5207,7 @@ void createTransData(bContext *C, TransInfo *t) else if (t->obedit) { t->ext = NULL; if (t->obedit->type == OB_MESH) { - createTransEditVerts(C, t); + createTransEditVerts(C, t); } else if ELEM(t->obedit->type, OB_CURVE, OB_SURF) { createTransCurveVerts(C, t); @@ -5217,7 +5221,7 @@ void createTransData(bContext *C, TransInfo *t) else if (t->obedit->type==OB_ARMATURE) { t->flag &= ~T_PROP_EDIT; createTransArmatureVerts(C, t); - } + } else { printf("edit type not implemented!\n"); } @@ -5236,7 +5240,7 @@ void createTransData(bContext *C, TransInfo *t) } t->flag |= T_EDIT|T_POINTS; - + /* exception... hackish, we want bonesize to use bone orientation matrix (ton) */ if(t->mode==TFM_BONESIZE) { t->flag &= ~(T_EDIT|T_POINTS); @@ -5245,7 +5249,7 @@ void createTransData(bContext *C, TransInfo *t) } } else if (ob && (ob->flag & OB_POSEMODE)) { - // XXX this is currently limited to active armature only... + // XXX this is currently limited to active armature only... // XXX active-layer checking isn't done as that should probably be checked through context instead createTransPose(C, t, ob); } @@ -5279,7 +5283,7 @@ void createTransData(bContext *C, TransInfo *t) t->flag &= ~T_PROP_EDIT; /* no proportional edit in object mode */ createTransObject(C, t); t->flag |= T_OBJECT; - + if (t->ar->regiontype == RGN_TYPE_WINDOW) { View3D *v3d = t->view; diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 3415c266cf1..af56079727f 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -154,8 +154,8 @@ static void clipMirrorModifier(TransInfo *t, Object *ob) for (; md; md=md->next) { if (md->type==eModifierType_Mirror) { - MirrorModifierData *mmd = (MirrorModifierData*) md; - + MirrorModifierData *mmd = (MirrorModifierData*) md; + if(mmd->flag & MOD_MIR_CLIPPING) { axis = 0; if(mmd->flag & MOD_MIR_AXIS_X) { @@ -174,7 +174,7 @@ static void clipMirrorModifier(TransInfo *t, Object *ob) float mtx[4][4], imtx[4][4]; int i; TransData *td = t->data; - + if (mmd->mirror_ob) { float obinv[4][4]; @@ -191,10 +191,10 @@ static void clipMirrorModifier(TransInfo *t, Object *ob) break; if (td->loc==NULL) break; - + if (td->flag & TD_SKIP) continue; - + VecCopyf(loc, td->loc); VecCopyf(iloc, td->iloc); @@ -205,22 +205,22 @@ static void clipMirrorModifier(TransInfo *t, Object *ob) clip = 0; if(axis & 1) { - if(fabs(iloc[0])<=tolerance[0] || + if(fabs(iloc[0])<=tolerance[0] || loc[0]*iloc[0]<0.0f) { loc[0]= 0.0f; clip = 1; } } - + if(axis & 2) { - if(fabs(iloc[1])<=tolerance[1] || + if(fabs(iloc[1])<=tolerance[1] || loc[1]*iloc[1]<0.0f) { loc[1]= 0.0f; clip = 1; } } if(axis & 4) { - if(fabs(iloc[2])<=tolerance[2] || + if(fabs(iloc[2])<=tolerance[2] || loc[2]*iloc[2]<0.0f) { loc[2]= 0.0f; clip = 1; @@ -246,7 +246,7 @@ static void editmesh_apply_to_mirror(TransInfo *t) TransData *td = t->data; EditVert *eve; int i; - + for(i = 0 ; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) break; @@ -254,14 +254,14 @@ static void editmesh_apply_to_mirror(TransInfo *t) break; if (td->flag & TD_SKIP) continue; - + eve = td->extra; if(eve) { eve->co[0]= -td->loc[0]; eve->co[1]= td->loc[1]; eve->co[2]= td->loc[2]; - } - } + } + } } /* called for updating while transform acts, once per redraw */ @@ -269,7 +269,7 @@ void recalcData(TransInfo *t) { Scene *scene = t->scene; Base *base; - + if (t->obedit) { } else if(G.f & G_PARTICLEEDIT) { @@ -284,56 +284,56 @@ void recalcData(TransInfo *t) else if (t->spacetype == SPACE_IPO) { SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first; Scene *scene; - + ListBase anim_data = {NULL, NULL}; bAnimContext ac; int filter; - + bAnimListElem *ale; int dosort = 0; - - + + /* initialise relevant anim-context 'context' data from TransInfo data */ /* NOTE: sync this with the code in ANIM_animdata_get_context() */ memset(&ac, 0, sizeof(bAnimContext)); - + scene= ac.scene= t->scene; ac.obact= OBACT; ac.sa= t->sa; ac.ar= t->ar; ac.spacetype= (t->sa)? t->sa->spacetype : 0; ac.regiontype= (t->ar)? t->ar->regiontype : 0; - + ANIM_animdata_context_getdata(&ac); - + /* do the flush first */ flushTransGraphData(t); - + /* get curves to check if a re-sort is needed */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_CURVEVISIBLE); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - + /* now test if there is a need to re-sort */ for (ale= anim_data.first; ale; ale= ale->next) { FCurve *fcu= (FCurve *)ale->key_data; - + /* watch it: if the time is wrong: do not correct handles yet */ if (test_time_fcurve(fcu)) dosort++; else calchandles_fcurve(fcu); } - + /* do resort and other updates? */ if (dosort) remake_graph_transdata(t, &anim_data); //if (sipo->showkey) update_ipokey_val(); - + /* now free temp channels */ BLI_freelistN(&anim_data); - + /* update realtime - not working? */ if (sipo->lock) { - + } } else if (t->spacetype == SPACE_NLA) { @@ -342,8 +342,8 @@ void recalcData(TransInfo *t) Scene *scene= t->scene; double secf= FPS; int i; - - /* for each strip we've got, perform some additional validation of the values that got set before + + /* for each strip we've got, perform some additional validation of the values that got set before * using RNA to set the value (which does some special operations when setting these values to make * sure that everything works ok) */ @@ -352,43 +352,43 @@ void recalcData(TransInfo *t) PointerRNA strip_ptr; short pExceeded, nExceeded, iter; int delta_y1, delta_y2; - + /* if this tdn has no handles, that means it is just a dummy that should be skipped */ if (tdn->handle == 0) continue; - + /* if cancelling transform, just write the values without validating, then move on */ if (t->state == TRANS_CANCEL) { - /* clear the values by directly overwriting the originals, but also need to restore + /* clear the values by directly overwriting the originals, but also need to restore * endpoints of neighboring transition-strips */ - + /* start */ strip->start= tdn->h1[0]; - + if ((strip->prev) && (strip->prev->type == NLASTRIP_TYPE_TRANSITION)) strip->prev->end= tdn->h1[0]; - + /* end */ strip->end= tdn->h2[0]; - + if ((strip->next) && (strip->next->type == NLASTRIP_TYPE_TRANSITION)) strip->next->start= tdn->h2[0]; - + /* flush transforms to child strips (since this should be a meta) */ BKE_nlameta_flush_transforms(strip); - + /* restore to original track (if needed) */ if (tdn->oldTrack != tdn->nlt) { /* just append to end of list for now, since strips get sorted in special_aftertrans_update() */ BLI_remlink(&tdn->nlt->strips, strip); BLI_addtail(&tdn->oldTrack->strips, strip); } - + continue; } - - /* firstly, check if the proposed transform locations would overlap with any neighbouring strips + + /* firstly, check if the proposed transform locations would overlap with any neighbouring strips * (barring transitions) which are absolute barriers since they are not being moved * * this is done as a iterative procedure (done 5 times max for now) @@ -396,10 +396,10 @@ void recalcData(TransInfo *t) for (iter=0; iter < 5; iter++) { pExceeded= ((strip->prev) && (strip->prev->type != NLASTRIP_TYPE_TRANSITION) && (tdn->h1[0] < strip->prev->end)); nExceeded= ((strip->next) && (strip->next->type != NLASTRIP_TYPE_TRANSITION) && (tdn->h2[0] > strip->next->start)); - + if ((pExceeded && nExceeded) || (iter == 4) ) { - /* both endpoints exceeded (or iteration ping-pong'd meaning that we need a compromise) - * - simply crop strip to fit within the bounds of the strips bounding it + /* both endpoints exceeded (or iteration ping-pong'd meaning that we need a compromise) + * - simply crop strip to fit within the bounds of the strips bounding it * - if there were no neighbours, clear the transforms (make it default to the strip's current values) */ if (strip->prev && strip->next) { @@ -414,21 +414,21 @@ void recalcData(TransInfo *t) else if (nExceeded) { /* move backwards */ float offset= tdn->h2[0] - strip->next->start; - + tdn->h1[0] -= offset; tdn->h2[0] -= offset; } else if (pExceeded) { /* more forwards */ float offset= strip->prev->end - tdn->h1[0]; - + tdn->h1[0] += offset; tdn->h2[0] += offset; } else /* all is fine and well */ break; } - + /* handle auto-snapping */ switch (snla->autosnap) { case SACTSNAP_FRAME: /* snap to nearest frame/time */ @@ -441,36 +441,36 @@ void recalcData(TransInfo *t) tdn->h2[0]= (float)( floor(tdn->h2[0]+0.5f) ); } break; - + case SACTSNAP_MARKER: /* snap to nearest marker */ tdn->h1[0]= (float)ED_markers_find_nearest_marker_time(&t->scene->markers, tdn->h1[0]); tdn->h2[0]= (float)ED_markers_find_nearest_marker_time(&t->scene->markers, tdn->h2[0]); break; } - + /* use RNA to write the values... */ // TODO: do we need to write in 2 passes to make sure that no truncation goes on? RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &strip_ptr); - + RNA_float_set(&strip_ptr, "start_frame", tdn->h1[0]); RNA_float_set(&strip_ptr, "end_frame", tdn->h2[0]); - + /* flush transforms to child strips (since this should be a meta) */ BKE_nlameta_flush_transforms(strip); - - - /* now, check if we need to try and move track + + + /* now, check if we need to try and move track * - we need to calculate both, as only one may have been altered by transform if only 1 handle moved */ delta_y1= ((int)tdn->h1[1] / NLACHANNEL_STEP - tdn->trackIndex); delta_y2= ((int)tdn->h2[1] / NLACHANNEL_STEP - tdn->trackIndex); - + if (delta_y1 || delta_y2) { NlaTrack *track; int delta = (delta_y2) ? delta_y2 : delta_y1; int n; - - /* move in the requested direction, checking at each layer if there's space for strip to pass through, + + /* move in the requested direction, checking at each layer if there's space for strip to pass through, * stopping on the last track available or that we're able to fit in */ if (delta > 0) { @@ -480,7 +480,7 @@ void recalcData(TransInfo *t) /* move strip to this track */ BLI_remlink(&tdn->nlt->strips, strip); BKE_nlatrack_add_strip(track, strip); - + tdn->nlt= track; tdn->trackIndex += (n + 1); /* + 1, since n==0 would mean that we didn't change track */ } @@ -491,14 +491,14 @@ void recalcData(TransInfo *t) else { /* make delta 'positive' before using it, since we now know to go backwards */ delta= -delta; - + for (track=tdn->nlt->prev, n=0; (track) && (n < delta); track=track->prev, n++) { /* check if space in this track for the strip */ if (BKE_nlatrack_has_space(track, strip->start, strip->end)) { /* move strip to this track */ BLI_remlink(&tdn->nlt->strips, strip); BKE_nlatrack_add_strip(track, strip); - + tdn->nlt= track; tdn->trackIndex -= (n - 1); /* - 1, since n==0 would mean that we didn't change track */ } @@ -513,9 +513,9 @@ void recalcData(TransInfo *t) if ELEM(t->obedit->type, OB_CURVE, OB_SURF) { Curve *cu= t->obedit->data; Nurb *nu= cu->editnurb->first; - + DAG_object_flush_update(scene, t->obedit, OB_RECALC_DATA); /* sets recalc flags */ - + if (t->state == TRANS_CANCEL) { while(nu) { calchandlesNurb(nu); /* Cant do testhandlesNurb here, it messes up the h1 and h2 flags */ @@ -535,7 +535,7 @@ void recalcData(TransInfo *t) else if(t->obedit->type==OB_LATTICE) { Lattice *la= t->obedit->data; DAG_object_flush_update(scene, t->obedit, OB_RECALC_DATA); /* sets recalc flags */ - + if(la->editlatt->flag & LT_OUTSIDE) outside_lattice(la->editlatt); } else if (t->obedit->type == OB_MESH) { @@ -545,7 +545,7 @@ void recalcData(TransInfo *t) flushTransUVs(t); if(sima->flag & SI_LIVE_UNWRAP) ED_uvedit_live_unwrap_re_solve(); - + DAG_object_flush_update(scene, t->obedit, OB_RECALC_DATA); } else { EditMesh *em = ((Mesh*)t->obedit->data)->edit_mesh; @@ -560,9 +560,9 @@ void recalcData(TransInfo *t) } if((t->options & CTX_NO_MIRROR) == 0 && (t->flag & T_MIRROR)) editmesh_apply_to_mirror(t); - + DAG_object_flush_update(scene, t->obedit, OB_RECALC_DATA); /* sets recalc flags */ - + recalc_editnormals(em); } } @@ -572,10 +572,10 @@ void recalcData(TransInfo *t) EditBone *ebo; TransData *td = t->data; int i; - + /* Ensure all bones are correctly adjusted */ for (ebo = edbo->first; ebo; ebo = ebo->next){ - + if ((ebo->flag & BONE_CONNECTED) && ebo->parent){ /* If this bone has a parent tip that has been moved */ if (ebo->parent->flag & BONE_TIPSEL){ @@ -588,7 +588,7 @@ void recalcData(TransInfo *t) if(t->mode==TFM_BONE_ENVELOPE) ebo->parent->rad_tail= ebo->rad_head; } } - + /* on extrude bones, oldlength==0.0f, so we scale radius of points */ ebo->length= VecLenf(ebo->head, ebo->tail); if(ebo->oldlength==0.0f) { @@ -608,8 +608,8 @@ void recalcData(TransInfo *t) ebo->oldlength= ebo->length; } } - - + + if (t->mode != TFM_BONE_ROLL) { /* fix roll */ @@ -619,10 +619,10 @@ void recalcData(TransInfo *t) { float vec[3], up_axis[3]; float qrot[4]; - + ebo = td->extra; VECCOPY(up_axis, td->axismtx[2]); - + if (t->mode != TFM_ROTATION) { VecSubf(vec, ebo->tail, ebo->head); @@ -634,15 +634,15 @@ void recalcData(TransInfo *t) { Mat3MulVecfl(t->mat, up_axis); } - + ebo->roll = ED_rollBoneToVector(ebo, up_axis); } } } - - if(arm->flag & ARM_MIRROR_EDIT) + + if(arm->flag & ARM_MIRROR_EDIT) transform_armature_mirror_update(t->obedit); - + } else DAG_object_flush_update(scene, t->obedit, OB_RECALC_DATA); /* sets recalc flags */ @@ -650,7 +650,7 @@ void recalcData(TransInfo *t) else if( (t->flag & T_POSE) && t->poseobj) { Object *ob= t->poseobj; bArmature *arm= ob->data; - + /* if animtimer is running, and the object already has animation data, * check if the auto-record feature means that we should record 'samples' * (i.e. uneditable animation values) @@ -661,7 +661,7 @@ void recalcData(TransInfo *t) short targetless_ik= (t->flag & T_AUTOIK); // XXX this currently doesn't work, since flags aren't set yet! autokeyframe_pose_cb_func(t->scene, (View3D *)t->view, ob, t->mode, targetless_ik); } - + /* old optimize trick... this enforces to bypass the depgraph */ if (!(arm->flag & ARM_DELAYDEFORM)) { DAG_object_flush_update(scene, ob, OB_RECALC_DATA); /* sets recalc flags */ @@ -672,13 +672,13 @@ void recalcData(TransInfo *t) else { for(base= FIRSTBASE; base; base= base->next) { Object *ob= base->object; - + /* this flag is from depgraph, was stored in initialize phase, handled in drawview.c */ if(base->flag & BA_HAS_RECALC_OB) ob->recalc |= OB_RECALC_OB; if(base->flag & BA_HAS_RECALC_DATA) ob->recalc |= OB_RECALC_DATA; - + /* if object/base is selected */ if ((base->flag & SELECT) || (ob->flag & SELECT)) { /* if animtimer is running, and the object already has animation data, @@ -691,13 +691,13 @@ void recalcData(TransInfo *t) autokeyframe_ob_cb_func(t->scene, (View3D *)t->view, ob, t->mode); } } - + /* proxy exception */ if(ob->proxy) ob->proxy->recalc |= ob->recalc; if(ob->proxy_group) group_tag_recalc(ob->proxy_group->dup_group); - } + } } /* update shaded drawmode while transform */ @@ -709,22 +709,22 @@ void drawLine(TransInfo *t, float *center, float *dir, char axis, short options) { float v1[3], v2[3], v3[3]; char col[3], col2[3]; - + if (t->spacetype == SPACE_VIEW3D) { View3D *v3d = t->view; - + glPushMatrix(); - + //if(t->obedit) glLoadMatrixf(t->obedit->obmat); // sets opengl viewing - - + + VecCopyf(v3, dir); VecMulf(v3, v3d->far); - + VecSubf(v2, center, v3); VecAddf(v1, center, v3); - + if (options & DRAWLIGHT) { col[0] = col[1] = col[2] = 220; } @@ -733,13 +733,13 @@ void drawLine(TransInfo *t, float *center, float *dir, char axis, short options) } UI_make_axis_color(col, col2, axis); glColor3ubv((GLubyte *)col2); - + setlinestyle(0); - glBegin(GL_LINE_STRIP); - glVertex3fv(v1); - glVertex3fv(v2); + glBegin(GL_LINE_STRIP); + glVertex3fv(v1); + glVertex3fv(v2); glEnd(); - + glPopMatrix(); } } @@ -756,13 +756,13 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) ARegion *ar = CTX_wm_region(C); ScrArea *sa = CTX_wm_area(C); Object *obedit = CTX_data_edit_object(C); - + /* moving: is shown in drawobject() (transform color) */ -// TRANSFORM_FIX_ME +// TRANSFORM_FIX_ME // if(obedit || (t->flag & T_POSE) ) G.moving= G_TRANSFORM_EDIT; // else if(G.f & G_PARTICLEEDIT) G.moving= G_TRANSFORM_PARTICLE; // else G.moving= G_TRANSFORM_OBJ; - + t->scene = sce; t->sa = sa; t->ar = ar; @@ -775,14 +775,14 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) t->helpline = HLP_NONE; t->flag = 0; - + t->redraw = 1; /* redraw first time */ - + if (event) { t->imval[0] = event->x - t->ar->winrct.xmin; t->imval[1] = event->y - t->ar->winrct.ymin; - + t->event_type = event->type; } else @@ -790,7 +790,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) t->imval[0] = 0; t->imval[1] = 0; } - + t->con.imval[0] = t->imval[0]; t->con.imval[1] = t->imval[1]; @@ -807,21 +807,21 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) t->vec[0] = t->vec[1] = t->vec[2] = 0.0f; - + t->center[0] = t->center[1] = t->center[2] = 0.0f; - + Mat3One(t->mat); - + t->spacetype = sa->spacetype; if(t->spacetype == SPACE_VIEW3D) { View3D *v3d = sa->spacedata.first; - + t->view = v3d; t->animtimer= CTX_wm_screen(C)->animtimer; - + if(v3d->flag & V3D_ALIGN) t->flag |= T_V3D_ALIGN; t->around = v3d->around; @@ -850,7 +850,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) { // XXX for now, get View2D from the active region t->view = &ar->v2d; - + t->around = V3D_CENTER; } @@ -886,7 +886,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) { if ((t->options & CTX_NO_PET) == 0 && (ts->proportional)) { t->flag |= T_PROP_EDIT; - + if(ts->proportional == 2) t->flag |= T_PROP_CONNECTED; // yes i know, has to become define } @@ -900,7 +900,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) { t->prop_size = ts->proportional_size; } - + if (op && RNA_struct_find_property(op->ptr, "proportional_editing_falloff") && RNA_property_is_set(op->ptr, "proportional_editing_falloff")) { t->prop_mode = RNA_enum_get(op->ptr, "proportional_editing_falloff"); @@ -919,12 +919,12 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) setTransformViewMatrices(t); initNumInput(&t->num); initNDofInput(&t->ndof); - + return 1; } /* Here I would suggest only TransInfo related issues, like free data & reset vars. Not redraws */ -void postTrans (TransInfo *t) +void postTrans (TransInfo *t) { TransData *td; @@ -932,7 +932,7 @@ void postTrans (TransInfo *t) { ED_region_draw_cb_exit(t->ar->type, t->draw_handle); } - + /* postTrans can be called when nothing is selected, so data is NULL already */ if (t->data) { int a; @@ -940,7 +940,7 @@ void postTrans (TransInfo *t) /* since ipokeys are optional on objects, we mallocced them per trans-data */ for(a=0, td= t->data; atotal; a++, td++) { if(td->tdi) MEM_freeN(td->tdi); - if (td->flag & TD_BEZTRIPLE) MEM_freeN(td->hdata); + if (td->flag & TD_BEZTRIPLE) MEM_freeN(td->hdata); } MEM_freeN(t->data); } @@ -965,7 +965,7 @@ void postTrans (TransInfo *t) void applyTransObjects(TransInfo *t) { TransData *td; - + for (td = t->data; td < t->data + t->total; td++) { VECCOPY(td->iloc, td->loc); if (td->ext->rot) { @@ -974,9 +974,9 @@ void applyTransObjects(TransInfo *t) if (td->ext->size) { VECCOPY(td->ext->isize, td->ext->size); } - } + } recalcData(t); -} +} /* helper for below */ static void restore_ipokey(float *poin, float *old) @@ -1009,15 +1009,15 @@ static void restoreElement(TransData *td) { } } } - + if (td->flag & TD_BEZTRIPLE) { *(td->hdata->h1) = td->hdata->ih1; *(td->hdata->h2) = td->hdata->ih2; } - + if(td->tdi) { TransDataIpokey *tdi= td->tdi; - + restore_ipokey(tdi->locx, tdi->oldloc); restore_ipokey(tdi->locy, tdi->oldloc+1); restore_ipokey(tdi->locz, tdi->oldloc+2); @@ -1025,7 +1025,7 @@ static void restoreElement(TransData *td) { restore_ipokey(tdi->rotx, tdi->oldrot); restore_ipokey(tdi->roty, tdi->oldrot+1); restore_ipokey(tdi->rotz, tdi->oldrot+2); - + restore_ipokey(tdi->sizex, tdi->oldsize); restore_ipokey(tdi->sizey, tdi->oldsize+1); restore_ipokey(tdi->sizez, tdi->oldsize+2); @@ -1035,13 +1035,13 @@ static void restoreElement(TransData *td) { void restoreTransObjects(TransInfo *t) { TransData *td; - + for (td = t->data; td < t->data + t->total; td++) { restoreElement(td); } - + Mat3One(t->mat); - + recalcData(t); } @@ -1050,7 +1050,7 @@ void calculateCenter2D(TransInfo *t) if (t->flag & (T_EDIT|T_POSE)) { Object *ob= t->obedit?t->obedit:t->poseobj; float vec[3]; - + VECCOPY(vec, t->center); Mat4MulVecfl(ob->obmat, vec); projectIntView(t, vec, t->center2d); @@ -1071,13 +1071,13 @@ void calculateCenterCursor(TransInfo *t) if (t->flag & (T_EDIT|T_POSE)) { Object *ob = t->obedit?t->obedit:t->poseobj; float mat[3][3], imat[3][3]; - + VecSubf(t->center, t->center, ob->obmat[3]); Mat3CpyMat4(mat, ob->obmat); Mat3Inv(imat, mat); Mat3MulVecfl(imat, t->center); } - + calculateCenter2D(t); } @@ -1085,13 +1085,13 @@ void calculateCenterCursor2D(TransInfo *t) { View2D *v2d= t->view; float aspx=1.0, aspy=1.0; - + if(t->spacetype==SPACE_IMAGE) /* only space supported right now but may change */ ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy); if (v2d) { - t->center[0] = v2d->cursor[0] * aspx; - t->center[1] = v2d->cursor[1] * aspy; + t->center[0] = v2d->cursor[0] * aspx; + t->center[1] = v2d->cursor[1] * aspy; } calculateCenter2D(t); @@ -1102,7 +1102,7 @@ void calculateCenterMedian(TransInfo *t) float partial[3] = {0.0f, 0.0f, 0.0f}; int total = 0; int i; - + for(i = 0; i < t->total; i++) { if (t->data[i].flag & TD_SELECTED) { if (!(t->data[i].flag & TD_NOCENTER)) @@ -1112,8 +1112,8 @@ void calculateCenterMedian(TransInfo *t) } } else { - /* - All the selected elements are at the head of the array + /* + All the selected elements are at the head of the array which means we can stop when it finds unselected data */ break; @@ -1138,8 +1138,8 @@ void calculateCenterBound(TransInfo *t) MinMax3(min, max, t->data[i].center); } else { - /* - All the selected elements are at the head of the array + /* + All the selected elements are at the head of the array which means we can stop when it finds unselected data */ break; @@ -1156,7 +1156,7 @@ void calculateCenterBound(TransInfo *t) calculateCenter2D(t); } -void calculateCenter(TransInfo *t) +void calculateCenter(TransInfo *t) { switch(t->around) { case V3D_CENTER: @@ -1188,7 +1188,7 @@ void calculateCenter(TransInfo *t) break; } /* END EDIT MODE ACTIVE ELEMENT */ #endif - + calculateCenterMedian(t); if((t->flag & (T_EDIT|T_POSE))==0) { @@ -1200,7 +1200,7 @@ void calculateCenter(TransInfo *t) projectIntView(t, t->center, t->center2d); } } - + } } @@ -1220,21 +1220,21 @@ void calculateCenter(TransInfo *t) View3D *v3d = t->view; Scene *scene = t->scene; RegionView3D *rv3d = t->ar->regiondata; - + if(v3d->camera == OBACT && rv3d->persp==V3D_CAMOB) { float axis[3]; /* persinv is nasty, use viewinv instead, always right */ VECCOPY(axis, t->viewinv[2]); Normalize(axis); - + /* 6.0 = 6 grid units */ axis[0]= t->center[0]- 6.0f*axis[0]; axis[1]= t->center[1]- 6.0f*axis[1]; axis[2]= t->center[2]- 6.0f*axis[2]; - + projectIntView(t, axis, t->center2d); - + /* rotate only needs correct 2d center, grab needs initgrabz() value */ if(t->mode==TFM_TRANSLATION) { @@ -1243,7 +1243,7 @@ void calculateCenter(TransInfo *t) } } } - } + } if(t->spacetype==SPACE_VIEW3D) { @@ -1251,14 +1251,14 @@ void calculateCenter(TransInfo *t) if(t->flag & (T_EDIT|T_POSE)) { Object *ob= t->obedit?t->obedit:t->poseobj; float vec[3]; - + VECCOPY(vec, t->center); Mat4MulVecfl(ob->obmat, vec); initgrabz(t->ar->regiondata, vec[0], vec[1], vec[2]); } else { initgrabz(t->ar->regiondata, t->center[0], t->center[1], t->center[2]); - } + } } } @@ -1268,18 +1268,18 @@ void calculatePropRatio(TransInfo *t) int i; float dist; short connected = t->flag & T_PROP_CONNECTED; - + if (t->flag & T_PROP_EDIT) { for(i = 0 ; i < t->total; i++, td++) { if (td->flag & TD_SELECTED) { td->factor = 1.0f; } - else if ((connected && + else if ((connected && (td->flag & TD_NOTCONNECTED || td->dist > t->prop_size)) || (connected == 0 && td->rdist > t->prop_size)) { - /* + /* The elements are sorted according to their dist member in the array, that means we can stop when it finds one element outside of the propsize. */ @@ -1291,7 +1291,7 @@ void calculatePropRatio(TransInfo *t) /* Use rdist for falloff calculations, it is the real distance */ td->flag &= ~TD_NOACTION; dist= (t->prop_size-td->rdist)/t->prop_size; - + /* * Clamp to positive numbers. * Certain corner cases with connectivity and individual centers @@ -1299,7 +1299,7 @@ void calculatePropRatio(TransInfo *t) */ if (dist < 0.0f) dist = 0.0f; - + switch(t->prop_mode) { case PROP_SHARP: td->factor= dist*dist; @@ -1362,27 +1362,19 @@ void calculatePropRatio(TransInfo *t) } } -/* XXX only to make manipulators run now */ -TransInfo *BIF_GetTransInfo() -{ - static struct TransInfo trans; - memset(&trans, 0, sizeof(struct TransInfo)); - return &trans; -} - float get_drawsize(ARegion *ar, float *co) { RegionView3D *rv3d= ar->regiondata; float size, vec[3], len1, len2; - + /* size calculus, depending ortho/persp settings, like initgrabz() */ size= rv3d->persmat[0][3]*co[0]+ rv3d->persmat[1][3]*co[1]+ rv3d->persmat[2][3]*co[2]+ rv3d->persmat[3][3]; - + VECCOPY(vec, rv3d->persinv[0]); len1= Normalize(vec); VECCOPY(vec, rv3d->persinv[1]); len2= Normalize(vec); - + size*= 0.01f*(len1>len2?len1:len2); /* correct for window size to make widgets appear fixed size */ diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 7c71e89f948..c656b097cb9 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -174,37 +174,10 @@ static void stats_editbone(View3D *v3d, EditBone *ebo) protectflag_to_drawflags(OB_LOCK_LOC|OB_LOCK_ROT|OB_LOCK_SCALE, &v3d->twdrawflag); } -/* only counts the parent selection, and tags transform flag */ -/* bad call... should re-use method from transform_conversion once */ -static void count_bone_select(TransInfo *t, bArmature *arm, ListBase *lb, int do_it) -{ - Bone *bone; - int do_next; - - for(bone= lb->first; bone; bone= bone->next) { - bone->flag &= ~BONE_TRANSFORM; - do_next= do_it; - if(do_it) { - if(bone->layer & arm->layer) { - if (bone->flag & BONE_SELECTED) { - /* We don't let connected children get "grabbed" */ - if ( (t->mode!=TFM_TRANSLATION) || (bone->flag & BONE_CONNECTED)==0 ) { - bone->flag |= BONE_TRANSFORM; - t->total++; - do_next= 0; // no transform on children if one parent bone is selected - } - } - } - } - count_bone_select(t, arm, &bone->childbase, do_next); - } -} - /* centroid, boundbox, of selection */ /* returns total items selected */ int calc_manipulator_stats(const bContext *C) { - TransInfo *t= BIF_GetTransInfo(); // XXX ScrArea *sa= CTX_wm_area(C); ARegion *ar= CTX_wm_region(C); Scene *scene= CTX_data_scene(C); @@ -369,17 +342,12 @@ int calc_manipulator_stats(const bContext *C) else if(ob && (ob->flag & OB_POSEMODE)) { bArmature *arm = ob->data; bPoseChannel *pchan; - int mode; + int mode = TFM_ROTATION; // mislead counting bones... bah. We don't know the manipulator mode, could be mixed if((ob->lay & v3d->lay)==0) return 0; - mode = t->mode; - t->mode = TFM_ROTATION; // mislead counting bones... bah + totsel = count_set_pose_transflags(&mode, 0, ob); - /* count total, we use same method as transform will do */ - t->total= 0; - count_bone_select(t, arm, &arm->bonebase, 1); - totsel = t->total; if(totsel) { /* use channels to get stats */ for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { @@ -391,8 +359,6 @@ int calc_manipulator_stats(const bContext *C) Mat4MulVecfl(ob->obmat, scene->twmin); Mat4MulVecfl(ob->obmat, scene->twmax); } - /* restore, mode can be TFM_INIT */ - t->mode = mode; } else if(G.f & (G_VERTEXPAINT + G_TEXTUREPAINT + G_WEIGHTPAINT + G_SCULPTMODE)) { ; @@ -446,17 +412,12 @@ int calc_manipulator_stats(const bContext *C) if(ob && totsel) { switch(v3d->twmode) { - case V3D_MANIP_GLOBAL: - strcpy(t->spacename, "global"); - break; case V3D_MANIP_NORMAL: if(obedit || ob->flag & OB_POSEMODE) { float mat[3][3]; int type; - strcpy(t->spacename, "normal"); - type = getTransformOrientation(C, normal, plane, (v3d->around == V3D_ACTIVE)); switch (type) @@ -499,7 +460,6 @@ int calc_manipulator_stats(const bContext *C) } /* no break we define 'normal' as 'local' in Object mode */ case V3D_MANIP_LOCAL: - strcpy(t->spacename, "local"); Mat4CpyMat4(rv3d->twmat, ob->obmat); Mat4Ortho(rv3d->twmat); break; @@ -507,14 +467,13 @@ int calc_manipulator_stats(const bContext *C) case V3D_MANIP_VIEW: { float mat[3][3]; - strcpy(t->spacename, "view"); Mat3CpyMat4(mat, rv3d->viewinv); Mat3Ortho(mat); Mat4CpyMat3(rv3d->twmat, mat); } break; default: /* V3D_MANIP_CUSTOM */ - applyTransformOrientation(C, t); + // XXX applyTransformOrientation(C, t); break; } @@ -710,7 +669,6 @@ static void draw_manipulator_axes(View3D *v3d, int colcode, int flagx, int flagy /* only called while G.moving */ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int drawflags) { - TransInfo *t= BIF_GetTransInfo(); // XXX GLUquadricObj *qobj; float size, phi, startphi, vec[3], svec[3], matt[4][4], cross[3], tmat[3][3]; int arcs= (G.rt!=2); @@ -726,7 +684,7 @@ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int d /* we need both [4][4] transforms, t->mat seems to be premul, not post for mat[][4] */ Mat4CpyMat4(matt, rv3d->twmat); // to copy the parts outside of [3][3] - Mat4MulMat34(matt, t->mat, rv3d->twmat); +// XXX Mat4MulMat34(matt, t->mat, rv3d->twmat); /* Screen aligned view rot circle */ if(drawflags & MAN_ROT_V) { @@ -735,15 +693,15 @@ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int d glPushMatrix(); size= screen_aligned(rv3d, rv3d->twmat); - vec[0]= (float)(t->con.imval[0] - t->center2d[0]); - vec[1]= (float)(t->con.imval[1] - t->center2d[1]); + vec[0]= 0; // XXX (float)(t->con.imval[0] - t->center2d[0]); + vec[1]= 0; // XXX (float)(t->con.imval[1] - t->center2d[1]); vec[2]= 0.0f; Normalize(vec); startphi= saacos( vec[1] ); if(vec[0]<0.0) startphi= -startphi; - phi= (float)fmod(180.0*t->val/M_PI, 360.0); + phi= 0; // XXX (float)fmod(180.0*t->val/M_PI, 360.0); if(phi > 180.0) phi-= 360.0; else if(phi<-180.0) phi+= 360.0; @@ -755,8 +713,8 @@ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int d float imat[3][3], ivmat[3][3]; /* try to get the start rotation */ - svec[0]= (float)(t->con.imval[0] - t->center2d[0]); - svec[1]= (float)(t->con.imval[1] - t->center2d[1]); + svec[0]= 0; // XXX (float)(t->con.imval[0] - t->center2d[0]); + svec[1]= 0; // XXX (float)(t->con.imval[1] - t->center2d[1]); svec[2]= 0.0f; /* screen aligned vec transform back to manipulator space */ @@ -848,7 +806,6 @@ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int d static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo) { - TransInfo *t= BIF_GetTransInfo(); // XXX GLUquadricObj *qobj; double plane[4]; float size, vec[3], unitmat[4][4]; @@ -900,8 +857,8 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, if(moving) { float vec[3]; - vec[0]= (float)(t->imval[0] - t->center2d[0]); - vec[1]= (float)(t->imval[1] - t->center2d[1]); + vec[0]= 0; // XXX (float)(t->imval[0] - t->center2d[0]); + vec[1]= 0; // XXX (float)(t->imval[1] - t->center2d[1]); vec[2]= 0.0f; Normalize(vec); VecMulf(vec, 1.2f*size); @@ -917,7 +874,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, if(moving) { float matt[4][4]; Mat4CpyMat4(matt, rv3d->twmat); // to copy the parts outside of [3][3] - Mat4MulMat34(matt, t->mat, rv3d->twmat); + // XXX Mat4MulMat34(matt, t->mat, rv3d->twmat); wmMultMatrix(matt); glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW); } @@ -1121,7 +1078,6 @@ static void drawsolidcube(float size) static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo, int colcode) { - TransInfo *t= BIF_GetTransInfo(); // XXX float cywid= 0.25f*0.01f*(float)U.tw_handlesize; float cusize= cywid*0.75f, dz; @@ -1153,7 +1109,7 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving, float matt[4][4]; Mat4CpyMat4(matt, rv3d->twmat); // to copy the parts outside of [3][3] - Mat4MulMat34(matt, t->mat, rv3d->twmat); + // XXX Mat4MulMat34(matt, t->mat, rv3d->twmat); wmMultMatrix(matt); glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW); } @@ -1238,7 +1194,6 @@ static void draw_cylinder(GLUquadricObj *qobj, float len, float width) static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo, int colcode) { - TransInfo *t= BIF_GetTransInfo(); // XXX GLUquadricObj *qobj; float cylen= 0.01f*(float)U.tw_handlesize; float cywid= 0.25f*cylen, dz, size; @@ -1248,7 +1203,7 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int movi /* when called while moving in mixed mode, do not draw when... */ if((drawflags & MAN_TRANS_C)==0) return; - if(moving) glTranslatef(t->vec[0], t->vec[1], t->vec[2]); + // XXX if(moving) glTranslatef(t->vec[0], t->vec[1], t->vec[2]); glDisable(GL_DEPTH_TEST); qobj= gluNewQuadric(); @@ -1314,7 +1269,6 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int movi static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo, int colcode) { - TransInfo *t= BIF_GetTransInfo(); // XXX GLUquadricObj *qobj; float size; float cylen= 0.01f*(float)U.tw_handlesize; @@ -1342,8 +1296,8 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov if(moving) { float vec[3]; - vec[0]= (float)(t->imval[0] - t->center2d[0]); - vec[1]= (float)(t->imval[1] - t->center2d[1]); + vec[0]= 0; // XXX (float)(t->imval[0] - t->center2d[0]); + vec[1]= 0; // XXX (float)(t->imval[1] - t->center2d[1]); vec[2]= 0.0f; Normalize(vec); VecMulf(vec, 1.2f*size); @@ -1359,9 +1313,9 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov if(moving) { float matt[4][4]; Mat4CpyMat4(matt, rv3d->twmat); // to copy the parts outside of [3][3] - if (t->flag & T_USES_MANIPULATOR) { - Mat4MulMat34(matt, t->mat, rv3d->twmat); - } + // XXX if (t->flag & T_USES_MANIPULATOR) { + // XXX Mat4MulMat34(matt, t->mat, rv3d->twmat); + // XXX } wmMultMatrix(matt); } else { -- cgit v1.2.3 From 3116062a828e24ed2e91c219ab338a38030f2f42 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 12 Jul 2009 02:06:15 +0000 Subject: 2.5: Couple of small fun features * Text window font size now supports full range 8-32, instead of just 12 and 15. I added BLF_fixed_width to get the character width of a fixed size font. * Buttons do undo push on change again. * Animated/Keyframe/Driver colors are now themable, with blend value to blend with original color. Set this to 0.5 now to give colors less constrast. * Fix tooltip popping up with RMB menu open, and missing redraw. * Autokeyframe now works for buttons. * Driver expressions can be edited in place in a button now. (still some refresh issues). * Also made python driver default for the Add Driver function in the RMB button. This way you don't have to open a Graph editor if you just want to type an expression. Also, the default expression then is the current value. * Tooltips now show some extra info, not sure what is good to have, but currently I added: * Shortcut key for operator buttons. * Python struct & property name for RNA buttons. * Expression for driven values. * Value for text/search/pointer buttons. --- source/blender/blenfont/BLF_api.h | 7 + source/blender/blenfont/intern/blf.c | 10 ++ source/blender/blenfont/intern/blf_font.c | 21 +++ source/blender/blenfont/intern/blf_internal.h | 1 + source/blender/editors/animation/drivers.c | 37 +++++- source/blender/editors/animation/keyframing.c | 16 +++ source/blender/editors/include/ED_keyframing.h | 6 +- source/blender/editors/interface/interface.c | 9 +- source/blender/editors/interface/interface_anim.c | 141 +++++++++++++++++---- .../blender/editors/interface/interface_handlers.c | 82 +++++++++--- .../blender/editors/interface/interface_intern.h | 3 + .../blender/editors/interface/interface_regions.c | 77 +++++++++-- .../blender/editors/interface/interface_widgets.c | 47 ++++--- .../blender/editors/space_buttons/space_buttons.c | 3 + source/blender/editors/space_outliner/outliner.c | 2 +- source/blender/editors/space_text/text_draw.c | 78 ++++++------ source/blender/editors/space_text/text_intern.h | 1 + source/blender/editors/space_text/text_ops.c | 16 ++- source/blender/editors/space_text/text_python.c | 8 +- source/blender/editors/transform/transform.h | 1 - .../editors/transform/transform_conversions.c | 21 +-- source/blender/makesdna/DNA_space_types.h | 3 +- source/blender/makesdna/DNA_userdef_types.h | 12 ++ source/blender/makesrna/intern/rna_space.c | 11 +- source/blender/makesrna/intern/rna_userdef.c | 50 ++++++++ 25 files changed, 520 insertions(+), 143 deletions(-) (limited to 'source') diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index 99934a80143..b77f4a8fcd1 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -70,6 +70,13 @@ void BLF_boundbox(char *str, struct rctf *box); float BLF_width(char *str); float BLF_height(char *str); + +/* + * For fixed width fonts only, returns the width of a + * character. + */ +float BLF_fixed_width(void); + /* * and this two function return the width and height * of the string, using the default font and both value diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 9a249c2f241..cd7f969d5e5 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -398,6 +398,16 @@ float BLF_width(char *str) return(0.0f); } +float BLF_fixed_width(void) +{ + FontBLF *font; + + font= global_font[global_font_cur]; + if (font) + return(blf_font_fixed_width(font)); + return(0.0f); +} + float BLF_width_default(char *str) { FontBLF *font; diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index affc35ea11e..6fc35a96e1e 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -274,6 +274,27 @@ float blf_font_height(FontBLF *font, char *str) return((box.ymax - box.ymin) * font->aspect); } +float blf_font_fixed_width(FontBLF *font) +{ + GlyphBLF *g; + FT_UInt glyph_index; + unsigned int c = ' '; + + if (!font->glyph_cache) + return 0.0f; + + glyph_index= FT_Get_Char_Index(font->face, c); + g= blf_glyph_search(font->glyph_cache, c); + if (!g) + g= blf_glyph_add(font, glyph_index, c); + + /* if we don't find the glyph. */ + if (!g) + return 0.0f; + + return g->advance; +} + void blf_font_free(FontBLF *font) { GlyphCacheBLF *gc; diff --git a/source/blender/blenfont/intern/blf_internal.h b/source/blender/blenfont/intern/blf_internal.h index c9bdc428ebb..30d5c8ede65 100644 --- a/source/blender/blenfont/intern/blf_internal.h +++ b/source/blender/blenfont/intern/blf_internal.h @@ -48,6 +48,7 @@ void blf_font_draw(FontBLF *font, char *str); void blf_font_boundbox(FontBLF *font, char *str, rctf *box); float blf_font_width(FontBLF *font, char *str); float blf_font_height(FontBLF *font, char *str); +float blf_font_fixed_width(FontBLF *font); void blf_font_free(FontBLF *font); GlyphCacheBLF *blf_glyph_cache_find(FontBLF *font, int size, int dpi); diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index fdce0965ce3..849e2d2eede 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -135,7 +135,7 @@ FCurve *verify_driver_fcurve (ID *id, const char rna_path[], const int array_ind /* Main Driver Management API calls: * Add a new driver for the specified property on the given ID block */ -short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short flag) +short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short flag, int type) { PointerRNA id_ptr, ptr; PropertyRNA *prop; @@ -150,6 +150,39 @@ short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short fla /* create F-Curve with Driver */ fcu= verify_driver_fcurve(id, rna_path, array_index, 1); + + if(fcu && fcu->driver) { + fcu->driver->type= type; + + /* fill in current value for python */ + if(type == DRIVER_TYPE_PYTHON) { + PropertyType proptype= RNA_property_type(prop); + int array= RNA_property_array_length(prop); + char *expression= fcu->driver->expression; + int val, maxlen= sizeof(fcu->driver->expression); + float fval; + + if(proptype == PROP_BOOLEAN) { + if(!array) val= RNA_property_boolean_get(&ptr, prop); + else val= RNA_property_boolean_get_index(&ptr, prop, array_index); + + BLI_strncpy(expression, (val)? "True": "False", maxlen); + } + else if(proptype == PROP_INT) { + if(!array) val= RNA_property_int_get(&ptr, prop); + else val= RNA_property_int_get_index(&ptr, prop, array_index); + + BLI_snprintf(expression, maxlen, "%d", val); + } + else if(proptype == PROP_FLOAT) { + if(!array) fval= RNA_property_float_get(&ptr, prop); + else fval= RNA_property_float_get_index(&ptr, prop, array_index); + + BLI_snprintf(expression, maxlen, "%.3f", fval); + } + + } + } /* done */ return (fcu != NULL); @@ -217,7 +250,7 @@ static int add_driver_button_exec (bContext *C, wmOperator *op) length= 1; for (a=0; asrna, "all", 1, "All", "Delete keyfames from all elements of the array."); } +/* ******************************************* */ +/* AUTO KEYFRAME */ + +int autokeyframe_cfra_can_key(Scene *scene, ID *id) +{ + float cfra= (float)CFRA; // XXX for now, this will do + + /* only filter if auto-key mode requires this */ + if (IS_AUTOKEY_ON(scene) == 0) + return 0; + else if (IS_AUTOKEY_MODE(scene, NORMAL)) + return 1; + else + return id_frame_has_keyframe(id, cfra, ANIMFILTER_KEYS_LOCAL); +} + /* ******************************************* */ /* KEYFRAME DETECTION */ diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 503d71b0d3e..3b3d0157362 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -30,6 +30,7 @@ struct ListBase; struct ID; +struct Scene; struct KeyingSet; @@ -168,7 +169,7 @@ void ANIM_OT_keyingset_add_destination(struct wmOperatorType *ot); /* Main Driver Management API calls: * Add a new driver for the specified property on the given ID block */ -short ANIM_add_driver (struct ID *id, const char rna_path[], int array_index, short flag); +short ANIM_add_driver (struct ID *id, const char rna_path[], int array_index, short flag, int type); /* Main Driver Management API calls: * Remove the driver for the specified property on the given ID block (if available) @@ -197,6 +198,9 @@ void ANIM_OT_remove_driver_button(struct wmOperatorType *ot); /* check if a flag is set for auto-keyframing (as userprefs only!) */ #define IS_AUTOKEY_FLAG(flag) (U.autokey_flag & AUTOKEY_FLAG_##flag) +/* auto-keyframing feature - checks for whether anything should be done for the current frame */ +int autokeyframe_cfra_can_key(struct Scene *scene, struct ID *id); + /* ************ Keyframe Checking ******************** */ /* Lesser Keyframe Checking API call: diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 6f86e3e809a..63e16c7933a 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1312,8 +1312,10 @@ void ui_get_but_string(uiBut *but, char *str, int maxlen) BLI_strncpy(str, but->poin, maxlen); return; } + else if(ui_but_anim_expression_get(but, str, maxlen)) + ; /* driver expression */ else { - /* number */ + /* number editing */ double value; value= ui_get_but_val(but); @@ -1384,7 +1386,12 @@ int ui_set_but_string(bContext *C, uiBut *but, const char *str) BLI_strncpy(but->poin, str, but->hardmax); return 1; } + else if(ui_but_anim_expression_set(but, str)) { + /* driver expression */ + return 1; + } else { + /* number editing */ double value; /* XXX 2.50 missing python api */ diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index 7c439f408ba..4a2ef50a31b 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -10,6 +10,7 @@ #include "DNA_screen_types.h" #include "BLI_listbase.h" +#include "BLI_string.h" #include "BKE_animsys.h" #include "BKE_context.h" @@ -27,49 +28,135 @@ #include "interface_intern.h" -void ui_but_anim_flag(uiBut *but, float cfra) +static FCurve *ui_but_get_fcurve(uiBut *but, bAction **action, int *driven) { - but->flag &= ~(UI_BUT_ANIMATED|UI_BUT_ANIMATED_KEY|UI_BUT_DRIVEN); - + FCurve *fcu= NULL; + + *driven= 0; + /* there must be some RNA-pointer + property combo for this button */ - if (but->rnaprop && but->rnapoin.id.data && + if(but->rnaprop && but->rnapoin.id.data && RNA_property_animateable(&but->rnapoin, but->rnaprop)) { AnimData *adt= BKE_animdata_from_id(but->rnapoin.id.data); - FCurve *fcu; char *path; - if (adt) { - if ((adt->action && adt->action->curves.first) || (adt->drivers.first)) { + if(adt) { + if((adt->action && adt->action->curves.first) || (adt->drivers.first)) { /* XXX this function call can become a performance bottleneck */ path= RNA_path_from_ID_to_property(&but->rnapoin, but->rnaprop); - - if (path) { + + if(path) { /* animation takes priority over drivers */ - if (adt->action && adt->action->curves.first) { + if(adt->action && adt->action->curves.first) fcu= list_find_fcurve(&adt->action->curves, path, but->rnaindex); - - if (fcu) { - but->flag |= UI_BUT_ANIMATED; - - if (fcurve_frame_has_keyframe(fcu, cfra, 0)) - but->flag |= UI_BUT_ANIMATED_KEY; - } - } /* if not animated, check if driven */ - if ((but->flag & UI_BUT_ANIMATED)==0 && (adt->drivers.first)) { + if(!fcu && (adt->drivers.first)) { fcu= list_find_fcurve(&adt->drivers, path, but->rnaindex); - if (fcu) - but->flag |= UI_BUT_DRIVEN; + if(fcu) + *driven= 1; } - + + if(fcu && action) + *action= adt->action; + MEM_freeN(path); } } } } + + return fcu; +} + +void ui_but_anim_flag(uiBut *but, float cfra) +{ + FCurve *fcu; + int driven; + + but->flag &= ~(UI_BUT_ANIMATED|UI_BUT_ANIMATED_KEY|UI_BUT_DRIVEN); + + fcu= ui_but_get_fcurve(but, NULL, &driven); + + if(fcu) { + if(!driven) { + but->flag |= UI_BUT_ANIMATED; + + if(fcurve_frame_has_keyframe(fcu, cfra, 0)) + but->flag |= UI_BUT_ANIMATED_KEY; + } + else { + but->flag |= UI_BUT_DRIVEN; + } + } +} + +int ui_but_anim_expression_get(uiBut *but, char *str, int maxlen) +{ + FCurve *fcu; + ChannelDriver *driver; + int driven; + + fcu= ui_but_get_fcurve(but, NULL, &driven); + + if(fcu && driven) { + driver= fcu->driver; + + if(driver && driver->type == DRIVER_TYPE_PYTHON) { + BLI_strncpy(str, driver->expression, maxlen); + return 1; + } + } + + return 0; +} + +int ui_but_anim_expression_set(uiBut *but, const char *str) +{ + FCurve *fcu; + ChannelDriver *driver; + int driven; + + fcu= ui_but_get_fcurve(but, NULL, &driven); + + if(fcu && driven) { + driver= fcu->driver; + + if(driver && driver->type == DRIVER_TYPE_PYTHON) { + BLI_strncpy(driver->expression, str, sizeof(driver->expression)); + return 1; + } + } + + return 0; +} + +void ui_but_anim_autokey(uiBut *but, Scene *scene, float cfra) +{ + ID *id; + bAction *action; + FCurve *fcu; + int driven; + + fcu= ui_but_get_fcurve(but, &action, &driven); + + if(fcu && !driven) { + id= but->rnapoin.id.data; + + if(autokeyframe_cfra_can_key(scene, id)) { + short flag = 0; + + if (IS_AUTOKEY_FLAG(INSERTNEEDED)) + flag |= INSERTKEY_NEEDED; + if (IS_AUTOKEY_FLAG(AUTOMATKEY)) + flag |= INSERTKEY_MATRIX; + + fcu->flag &= ~FCURVE_SELECTED; + insert_keyframe(id, action, ((fcu->grp)?(fcu->grp->name):(NULL)), fcu->rna_path, fcu->array_index, cfra, flag); + } + } } void uiAnimContextProperty(const bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop, int *index) @@ -140,6 +227,7 @@ void ui_but_anim_menu(bContext *C, uiBut *but) uiItemBooleanO(layout, "Delete Keyframe", 0, "ANIM_OT_delete_keyframe_button", "all", 0); } } + else if(but->flag & UI_BUT_DRIVEN); else if(RNA_property_animateable(&but->rnapoin, but->rnaprop)) { if(length) { uiItemBooleanO(layout, "Insert Keyframes", 0, "ANIM_OT_insert_keyframe_button", "all", 1); @@ -153,17 +241,18 @@ void ui_but_anim_menu(bContext *C, uiBut *but) uiItemS(layout); if(length) { - uiItemBooleanO(layout, "Remove Driver", 0, "ANIM_OT_remove_driver_button", "all", 1); - uiItemBooleanO(layout, "Remove Single Driver", 0, "ANIM_OT_remove_driver_button", "all", 0); + uiItemBooleanO(layout, "Delete Drivers", 0, "ANIM_OT_remove_driver_button", "all", 1); + uiItemBooleanO(layout, "Delete Single Driver", 0, "ANIM_OT_remove_driver_button", "all", 0); } else - uiItemBooleanO(layout, "Remove Driver", 0, "ANIM_OT_remove_driver_button", "all", 0); + uiItemBooleanO(layout, "Delete Driver", 0, "ANIM_OT_remove_driver_button", "all", 0); } + else if(but->flag & UI_BUT_ANIMATED_KEY); else if(RNA_property_animateable(&but->rnapoin, but->rnaprop)) { uiItemS(layout); if(length) { - uiItemBooleanO(layout, "Add Driver", 0, "ANIM_OT_add_driver_button", "all", 1); + uiItemBooleanO(layout, "Add Drivers", 0, "ANIM_OT_add_driver_button", "all", 1); uiItemBooleanO(layout, "Add Single Driver", 0, "ANIM_OT_add_driver_button", "all", 0); } else diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index e0ce6a7a83f..10e495cde94 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -32,6 +32,7 @@ #include "DNA_color_types.h" #include "DNA_object_types.h" +#include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "DNA_texture_types.h" #include "DNA_userdef_types.h" @@ -49,6 +50,7 @@ #include "BKE_utildefines.h" #include "ED_screen.h" +#include "ED_util.h" #include "UI_interface.h" @@ -166,6 +168,10 @@ typedef struct uiAfterFunc { PropertyRNA *rnaprop; bContextStore *context; + + char undostr[512]; + + int autokey; } uiAfterFunc; static int ui_mouse_inside_button(ARegion *ar, uiBut *but, int x, int y); @@ -174,6 +180,7 @@ static int ui_handler_region_menu(bContext *C, wmEvent *event, void *userdata); static int ui_handler_popup(bContext *C, wmEvent *event, void *userdata); static void ui_handler_remove_popup(bContext *C, void *userdata); static void ui_handle_button_activate(bContext *C, ARegion *ar, uiBut *but, uiButtonActivateType type); +static void button_timers_tooltip_remove(bContext *C, uiBut *but); /* ******************** menu navigation helpers ************** */ @@ -271,6 +278,32 @@ static void ui_apply_but_func(bContext *C, uiBut *but) } } +static void ui_apply_autokey_undo(bContext *C, uiBut *but) +{ + Scene *scene= CTX_data_scene(C); + uiAfterFunc *after; + char *str= NULL; + + if ELEM5(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX); + else { + /* define which string to use for undo */ + if ELEM(but->type, LINK, INLINK) str= "Add button link"; + else if ELEM(but->type, MENU, ICONTEXTROW) str= but->drawstr; + else if(but->drawstr[0]) str= but->drawstr; + else str= but->tip; + } + + /* delayed, after all other funcs run, popups are closed, etc */ + if(str) { + after= MEM_callocN(sizeof(uiAfterFunc), "uiAfterFunc"); + BLI_strncpy(after->undostr, str, sizeof(after->undostr)); + BLI_addtail(&UIAfterFuncs, after); + } + + /* try autokey */ + ui_but_anim_autokey(but, scene, scene->r.cfra); +} + static void ui_apply_but_funcs_after(bContext *C) { uiAfterFunc *afterf, after; @@ -311,6 +344,9 @@ static void ui_apply_but_funcs_after(bContext *C) after.handle_func(C, after.handle_func_arg, after.retval); if(after.butm_func) after.butm_func(C, after.butm_func_arg, after.a2); + + if(after.undostr[0]) + ED_undo_push(C, after.undostr); } } @@ -1324,7 +1360,7 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data) but->editstr= data->str; but->pos= strlen(data->str); but->selsta= 0; - but->selend= strlen(but->drawstr) - strlen(but->str); + but->selend= strlen(data->str); /* optional searchbox */ if(but->type==SEARCH_MENU) { @@ -1539,7 +1575,8 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle } if(changed) { - if(data->interactive) ui_apply_button(C, block, but, data, 1); + /* never update while typing for now */ + if(0/*data->interactive*/) ui_apply_button(C, block, but, data, 1); else ui_check_but(but); if(data->searchbox) @@ -3090,6 +3127,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event) } /* handle menu */ else if(event->type == RIGHTMOUSE && event->val == KM_PRESS) { + button_timers_tooltip_remove(C, but); ui_but_anim_menu(C, but); return WM_UI_HANDLER_BREAK; } @@ -3315,6 +3353,27 @@ static int button_modal_state(uiHandleButtonState state) BUTTON_STATE_TEXT_SELECTING, BUTTON_STATE_MENU_OPEN); } +static void button_timers_tooltip_remove(bContext *C, uiBut *but) +{ + uiHandleButtonData *data; + + data= but->active; + + if(data->tooltiptimer) { + WM_event_remove_window_timer(data->window, data->tooltiptimer); + data->tooltiptimer= NULL; + } + if(data->tooltip) { + ui_tooltip_free(C, data->tooltip); + data->tooltip= NULL; + } + + if(data->autoopentimer) { + WM_event_remove_window_timer(data->window, data->autoopentimer); + data->autoopentimer= NULL; + } +} + static void button_tooltip_timer_reset(uiBut *but) { uiHandleButtonData *data; @@ -3362,20 +3421,7 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s } else { but->flag |= UI_SELECT; - - if(data->tooltiptimer) { - WM_event_remove_window_timer(data->window, data->tooltiptimer); - data->tooltiptimer= NULL; - } - if(data->tooltip) { - ui_tooltip_free(C, data->tooltip); - data->tooltip= NULL; - } - - if(data->autoopentimer) { - WM_event_remove_window_timer(data->window, data->autoopentimer); - data->autoopentimer= NULL; - } + button_timers_tooltip_remove(C, but); } /* text editing */ @@ -3502,6 +3548,10 @@ static void button_activate_exit(bContext *C, uiHandleButtonData *data, uiBut *b } } + /* autokey & undo push */ + if(!data->cancel) + ui_apply_autokey_undo(C, but); + /* disable tooltips until mousemove */ ui_blocks_set_tooltips(data->region, 0); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 8c254419ec3..5760a28cb5c 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -455,6 +455,9 @@ void ui_but_anim_delete_keyframe(struct bContext *C); void ui_but_anim_add_driver(struct bContext *C); void ui_but_anim_remove_driver(struct bContext *C); void ui_but_anim_menu(struct bContext *C, uiBut *but); +int ui_but_anim_expression_get(uiBut *but, char *str, int maxlen); +int ui_but_anim_expression_set(uiBut *but, const char *str); +void ui_but_anim_autokey(uiBut *but, struct Scene *scene, float cfra); #endif diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index e0c6fbd7134..c574cf1072f 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -294,19 +294,33 @@ void ui_remove_temporary_region(bContext *C, bScreen *sc, ARegion *ar) typedef struct uiTooltipData { rcti bbox; uiFontStyle fstyle; - char *tip; + char lines[5][512]; + int totline; + int toth, spaceh, lineh; } uiTooltipData; static void ui_tooltip_region_draw(const bContext *C, ARegion *ar) { uiTooltipData *data= ar->regiondata; + rcti bbox= data->bbox; + int a; ui_draw_menu_back(U.uistyles.first, NULL, &data->bbox); /* draw text */ - glColor4f(1.0f, 1.0f, 1.0f, 1.0f); uiStyleFontSet(&data->fstyle); - uiStyleFontDraw(&data->fstyle, &data->bbox, data->tip); + + bbox.ymax= bbox.ymax - 0.5f*((bbox.ymax - bbox.ymin) - data->toth); + bbox.ymin= bbox.ymax - data->lineh; + + for(a=0; atotline; a++) { + if(a == 0) glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + else glColor4f(0.5f, 0.5f, 0.5f, 1.0f); + + uiStyleFontDraw(&data->fstyle, &bbox, data->lines[a]); + bbox.ymin -= data->lineh + data->spaceh; + bbox.ymax -= data->lineh + data->spaceh; + } } static void ui_tooltip_region_free(ARegion *ar) @@ -314,7 +328,6 @@ static void ui_tooltip_region_free(ARegion *ar) uiTooltipData *data; data= ar->regiondata; - MEM_freeN(data->tip); MEM_freeN(data); ar->regiondata= NULL; } @@ -325,9 +338,11 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) static ARegionType type; ARegion *ar; uiTooltipData *data; + IDProperty *prop; + char buf[512]; float fonth, fontw, aspect= but->block->aspect; float x1f, x2f, y1f, y2f; - int x1, x2, y1, y2, winx, winy, ofsx, ofsy; + int x1, x2, y1, y2, winx, winy, ofsx, ofsy, w, h, a; if(!but->tip || strlen(but->tip)==0) return NULL; @@ -342,18 +357,64 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) /* create tooltip data */ data= MEM_callocN(sizeof(uiTooltipData), "uiTooltipData"); - data->tip= BLI_strdup(but->tip); + + BLI_strncpy(data->lines[0], but->tip, sizeof(data->lines[0])); + data->totline= 1; + + if(but->optype && !(but->block->flag & UI_BLOCK_LOOP)) { + /* operator keymap (not menus, they already have it) */ + prop= (but->opptr)? but->opptr->data: NULL; + + if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, buf, sizeof(buf))) { + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Shortcut: %s", buf); + data->totline++; + } + } + + if(ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) { + /* full string */ + ui_get_but_string(but, buf, sizeof(buf)); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Value: %s", buf); + data->totline++; + } + + if(but->rnaprop) { + if(but->flag & UI_BUT_DRIVEN) { + if(ui_but_anim_expression_get(but, buf, sizeof(buf))) { + /* expression */ + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Expression: %s", buf); + data->totline++; + } + } + + /* rna info */ + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Python: %s.%s", RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop)); + data->totline++; + } /* set font, get bb */ data->fstyle= style->widget; /* copy struct */ data->fstyle.align= UI_STYLE_TEXT_CENTER; ui_fontscale(&data->fstyle.points, aspect); uiStyleFontSet(&data->fstyle); - fontw= aspect * BLF_width(data->tip); - fonth= aspect * BLF_height(data->tip); + + h= BLF_height(data->lines[0]); + + for(a=0, fontw=0, fonth=0; atotline; a++) { + w= BLF_width(data->lines[a]); + fontw= MAX2(fontw, w); + fonth += (a == 0)? h: h+5; + } + + fontw *= aspect; + fonth *= aspect; ar->regiondata= data; + data->toth= fonth; + data->lineh= h*aspect; + data->spaceh= 5*aspect; + /* compute position */ ofsx= (but->block->panel)? but->block->panel->ofsx: 0; ofsy= (but->block->panel)? but->block->panel->ofsy: 0; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 2cd7c1d61cd..8f40b2e4bfd 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -85,15 +85,6 @@ typedef struct uiWidgetTrias { } uiWidgetTrias; -typedef struct uiWidgetStateColors { - char inner_anim[4]; - char inner_anim_sel[4]; - char inner_key[4]; - char inner_key_sel[4]; - char inner_driven[4]; - char inner_driven_sel[4]; -} uiWidgetStateColors; - typedef struct uiWidgetBase { int totvert, halfwayvert; @@ -116,6 +107,7 @@ typedef struct uiWidgetType { /* pointer to theme color definition */ uiWidgetColors *wcol_theme; + uiWidgetStateColors *wcol_state; /* converted colors for state */ uiWidgetColors wcol; @@ -918,6 +910,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB char inner_key_sel[4]; char inner_driven[4]; char inner_driven_sel[4]; + float blend; */ @@ -925,9 +918,10 @@ static struct uiWidgetStateColors wcol_state= { {115, 190, 76, 255}, {90, 166, 51, 255}, {240, 235, 100, 255}, - {148, 204, 76, 255}, + {215, 211, 75, 255}, {180, 0, 255, 255}, - {153, 0, 230, 255} + {153, 0, 230, 255}, + 0.5f, 0.0f }; /* uiWidgetColors @@ -1147,7 +1141,6 @@ static struct uiWidgetColors wcol_tmp= { /* called for theme init (new theme) and versions */ void ui_widget_color_init(ThemeUI *tui) { - tui->wcol_regular= wcol_regular; tui->wcol_tool= wcol_tool; tui->wcol_text= wcol_text; @@ -1162,24 +1155,37 @@ void ui_widget_color_init(ThemeUI *tui) tui->wcol_menu_item= wcol_menu_item; tui->wcol_box= wcol_box; tui->wcol_scroll= wcol_scroll; + + tui->wcol_state= wcol_state; } /* ************ button callbacks, state ***************** */ +static void widget_state_blend(char *cp, char *cpstate, float fac) +{ + if(fac != 0.0f) { + cp[0]= (int)((1.0f-fac)*cp[0] + fac*cpstate[0]); + cp[1]= (int)((1.0f-fac)*cp[1] + fac*cpstate[1]); + cp[2]= (int)((1.0f-fac)*cp[2] + fac*cpstate[2]); + } +} + /* copy colors from theme, and set changes in it based on state */ static void widget_state(uiWidgetType *wt, int state) { + uiWidgetStateColors *wcol_state= wt->wcol_state; + wt->wcol= *(wt->wcol_theme); if(state & UI_SELECT) { + QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel) + if(state & UI_BUT_ANIMATED_KEY) - QUATCOPY(wt->wcol.inner, wcol_state.inner_key_sel) + widget_state_blend(wt->wcol.inner, wcol_state->inner_key_sel, wcol_state->blend); else if(state & UI_BUT_ANIMATED) - QUATCOPY(wt->wcol.inner, wcol_state.inner_anim_sel) + widget_state_blend(wt->wcol.inner, wcol_state->inner_anim_sel, wcol_state->blend); else if(state & UI_BUT_DRIVEN) - QUATCOPY(wt->wcol.inner, wcol_state.inner_driven_sel) - else - QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel) + widget_state_blend(wt->wcol.inner, wcol_state->inner_driven_sel, wcol_state->blend); VECCOPY(wt->wcol.text, wt->wcol.text_sel); @@ -1190,11 +1196,11 @@ static void widget_state(uiWidgetType *wt, int state) } else { if(state & UI_BUT_ANIMATED_KEY) - QUATCOPY(wt->wcol.inner, wcol_state.inner_key) + widget_state_blend(wt->wcol.inner, wcol_state->inner_key, wcol_state->blend); else if(state & UI_BUT_ANIMATED) - QUATCOPY(wt->wcol.inner, wcol_state.inner_anim) + widget_state_blend(wt->wcol.inner, wcol_state->inner_anim, wcol_state->blend); else if(state & UI_BUT_DRIVEN) - QUATCOPY(wt->wcol.inner, wcol_state.inner_driven) + widget_state_blend(wt->wcol.inner, wcol_state->inner_driven, wcol_state->blend); if(state & UI_ACTIVE) { /* mouse over? */ wt->wcol.inner[0]= wt->wcol.inner[0]>=240? 255 : wt->wcol.inner[0]+15; @@ -2039,6 +2045,7 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type) /* defaults */ wt.wcol_theme= &btheme->tui.wcol_regular; + wt.wcol_state= &btheme->tui.wcol_state; wt.state= widget_state; wt.draw= widget_but; wt.custom= NULL; diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index b89a13ce218..f7be323a4c5 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -377,6 +377,9 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn) ED_area_tag_redraw(sa); sbuts->preview= 1; } + + if(wmn->data == ND_KEYS) + ED_area_tag_redraw(sa); } /* only called once, from space/spacetypes.c */ diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 6563a7dc7df..e8c32d2a2c7 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -3239,7 +3239,7 @@ static void do_outliner_drivers_editop(SpaceOops *soops, ListBase *tree, short m case DRIVERS_EDITMODE_ADD: { /* add a new driver with the information obtained (only if valid) */ - ANIM_add_driver(id, path, array_index, flag); + ANIM_add_driver(id, path, array_index, flag, DRIVER_TYPE_AVERAGE); } break; case DRIVERS_EDITMODE_REMOVE: diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index f58af47a6bd..adba7ef100a 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -95,13 +95,7 @@ static int text_font_draw_character(SpaceText *st, int x, int y, char c) BLF_position(x, y, 0); BLF_draw(str); - return text_font_width_character(st); -} - -int text_font_width_character(SpaceText *st) -{ - // XXX need quick BLF function, or cache it somewhere - return (st->lheight == 12)? 7: 9; + return st->cwidth; } int text_font_width(SpaceText *st, char *str) @@ -523,7 +517,7 @@ int wrap_width(SpaceText *st, ARegion *ar) int x, max; x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET; - max= (ar->winx-x)/text_font_width_character(st); + max= (ar->winx-x)/st->cwidth; return max>8 ? max : 8; } @@ -615,7 +609,7 @@ static int text_draw_wrapped(SpaceText *st, char *str, int x, int y, int w, char len= flatten_string(st, &fs, str); str= fs.buf; - max= w/text_font_width_character(st); + max= w/st->cwidth; if(max<8) max= 8; basex= x; @@ -687,7 +681,7 @@ static int text_draw(SpaceText *st, char *str, int cshift, int maxwidth, int dra } else { while(w-- && *acc++ < maxwidth) - r+= text_font_width_character(st); + r+= st->cwidth; } flatten_string_free(&fs); @@ -877,18 +871,18 @@ static void draw_markers(SpaceText *st, ARegion *ar) if(y1==y2) { y -= y1*st->lheight; glBegin(GL_LINE_LOOP); - glVertex2i(x+x2*text_font_width_character(st)+1, y); - glVertex2i(x+x1*text_font_width_character(st)-2, y); - glVertex2i(x+x1*text_font_width_character(st)-2, y-st->lheight); - glVertex2i(x+x2*text_font_width_character(st)+1, y-st->lheight); + glVertex2i(x+x2*st->cwidth+1, y); + glVertex2i(x+x1*st->cwidth-2, y); + glVertex2i(x+x1*st->cwidth-2, y-st->lheight); + glVertex2i(x+x2*st->cwidth+1, y-st->lheight); glEnd(); } else { y -= y1*st->lheight; glBegin(GL_LINE_STRIP); glVertex2i(ar->winx, y); - glVertex2i(x+x1*text_font_width_character(st)-2, y); - glVertex2i(x+x1*text_font_width_character(st)-2, y-st->lheight); + glVertex2i(x+x1*st->cwidth-2, y); + glVertex2i(x+x1*st->cwidth-2, y-st->lheight); glVertex2i(ar->winx, y-st->lheight); glEnd(); y-=st->lheight; @@ -905,8 +899,8 @@ static void draw_markers(SpaceText *st, ARegion *ar) glBegin(GL_LINE_STRIP); glVertex2i(x, y); - glVertex2i(x+x2*text_font_width_character(st)+1, y); - glVertex2i(x+x2*text_font_width_character(st)+1, y-st->lheight); + glVertex2i(x+x2*st->cwidth+1, y); + glVertex2i(x+x2*st->cwidth+1, y-st->lheight); glVertex2i(x, y-st->lheight); glEnd(); } @@ -940,18 +934,18 @@ static void draw_documentation(SpaceText *st, ARegion *ar) if(l<0) return; if(st->showlinenrs) { - x= text_font_width_character(st)*(st->text->curc-st->left) + TXT_OFFSET + TEXTXLOC - 4; + x= st->cwidth*(st->text->curc-st->left) + TXT_OFFSET + TEXTXLOC - 4; } else { - x= text_font_width_character(st)*(st->text->curc-st->left) + TXT_OFFSET - 4; + x= st->cwidth*(st->text->curc-st->left) + TXT_OFFSET - 4; } if(texttool_suggest_first()) { - x += SUGG_LIST_WIDTH*text_font_width_character(st) + 50; + x += SUGG_LIST_WIDTH*st->cwidth + 50; } top= y= ar->winy - st->lheight*l - 2; len= strlen(docs); - boxw= DOC_WIDTH*text_font_width_character(st) + 20; + boxw= DOC_WIDTH*st->cwidth + 20; boxh= (DOC_HEIGHT+1)*st->lheight; /* Draw panel */ @@ -1034,14 +1028,14 @@ static void draw_suggestion_list(SpaceText *st, ARegion *ar) if(l<0) return; if(st->showlinenrs) { - x = text_font_width_character(st)*(st->text->curc-st->left) + TXT_OFFSET + TEXTXLOC - 4; + x = st->cwidth*(st->text->curc-st->left) + TXT_OFFSET + TEXTXLOC - 4; } else { - x = text_font_width_character(st)*(st->text->curc-st->left) + TXT_OFFSET - 4; + x = st->cwidth*(st->text->curc-st->left) + TXT_OFFSET - 4; } y = ar->winy - st->lheight*l - 2; - boxw = SUGG_LIST_WIDTH*text_font_width_character(st) + 20; + boxw = SUGG_LIST_WIDTH*st->cwidth + 20; boxh = SUGG_LIST_SIZE*st->lheight + 8; UI_ThemeColor(TH_SHADE1); @@ -1111,9 +1105,9 @@ static void draw_cursor(SpaceText *st, ARegion *ar) if(vcurl==vsell) { y -= vcurl*st->lheight; if(vcurc < vselc) - glRecti(x+vcurc*text_font_width_character(st)-1, y, x+vselc*text_font_width_character(st), y-st->lheight); + glRecti(x+vcurc*st->cwidth-1, y, x+vselc*st->cwidth, y-st->lheight); else - glRecti(x+vselc*text_font_width_character(st)-1, y, x+vcurc*text_font_width_character(st), y-st->lheight); + glRecti(x+vselc*st->cwidth-1, y, x+vcurc*st->cwidth, y-st->lheight); } else { int froml, fromc, tol, toc; @@ -1128,11 +1122,11 @@ static void draw_cursor(SpaceText *st, ARegion *ar) } y -= froml*st->lheight; - glRecti(x+fromc*text_font_width_character(st)-1, y, ar->winx, y-st->lheight); y-=st->lheight; + glRecti(x+fromc*st->cwidth-1, y, ar->winx, y-st->lheight); y-=st->lheight; for(i=froml+1; iwinx, y-st->lheight), y-=st->lheight; - glRecti(x-4, y, x+toc*text_font_width_character(st), y-st->lheight); y-=st->lheight; + glRecti(x-4, y, x+toc*st->cwidth, y-st->lheight); y-=st->lheight; } } else { @@ -1149,13 +1143,13 @@ static void draw_cursor(SpaceText *st, ARegion *ar) if(!hidden) { /* Draw the cursor itself (we draw the sel. cursor as this is the leading edge) */ x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET; - x += vselc*text_font_width_character(st); + x += vselc*st->cwidth; y= ar->winy-2 - vsell*st->lheight; if(st->overwrite) { char ch= text->sell->line[text->selc]; if(!ch) ch= ' '; - w= text_font_width_character(st); + w= st->cwidth; UI_ThemeColor(TH_HILITE); glRecti(x, y-st->lheight-1, x+w, y-st->lheight+1); } @@ -1255,8 +1249,8 @@ static void draw_brackets(SpaceText *st, ARegion *ar) if(viewc >= 0){ viewl= txt_get_span(text->lines.first, startl) - st->top + offl; - text_font_draw_character(st, x+viewc*text_font_width_character(st), y-viewl*st->lheight, ch); - text_font_draw_character(st, x+viewc*text_font_width_character(st)+1, y-viewl*st->lheight, ch); + text_font_draw_character(st, x+viewc*st->cwidth, y-viewl*st->lheight, ch); + text_font_draw_character(st, x+viewc*st->cwidth+1, y-viewl*st->lheight, ch); } /* draw closing bracket */ @@ -1267,8 +1261,8 @@ static void draw_brackets(SpaceText *st, ARegion *ar) if(viewc >= 0) { viewl= txt_get_span(text->lines.first, endl) - st->top + offl; - text_font_draw_character(st, x+viewc*text_font_width_character(st), y-viewl*st->lheight, ch); - text_font_draw_character(st, x+viewc*text_font_width_character(st)+1, y-viewl*st->lheight, ch); + text_font_draw_character(st, x+viewc*st->cwidth, y-viewl*st->lheight, ch); + text_font_draw_character(st, x+viewc*st->cwidth+1, y-viewl*st->lheight, ch); } } @@ -1313,6 +1307,8 @@ void draw_text_main(SpaceText *st, ARegion *ar) } text_font_begin(st); + st->cwidth= BLF_fixed_width(); + st->cwidth= MAX2(st->cwidth, 1); /* draw cursor */ draw_cursor(st, ar); @@ -1371,6 +1367,14 @@ void draw_text_main(SpaceText *st, ARegion *ar) /************************** update ***************************/ +void text_update_character_width(SpaceText *st) +{ + text_font_begin(st); + st->cwidth= BLF_fixed_width(); + st->cwidth= MAX2(st->cwidth, 1); + text_font_end(st); +} + /* Moves the view to the cursor location, also used to make sure the view isnt outside the file */ void text_update_cursor_moved(SpaceText *st, ARegion *ar) @@ -1380,6 +1384,8 @@ void text_update_cursor_moved(SpaceText *st, ARegion *ar) if(!text || !text->curl) return; + text_update_character_width(st); + i= txt_get_span(text->lines.first, text->sell); if(st->top+st->viewlines <= i || st->top > i) st->top= i - st->viewlines/2; @@ -1391,7 +1397,7 @@ void text_update_cursor_moved(SpaceText *st, ARegion *ar) x= text_draw(st, text->sell->line, st->left, text->selc, 0, 0, 0, NULL); if(x==0 || x>ar->winx) - st->left= text->curc-0.5*(ar->winx)/text_font_width_character(st); + st->left= text->curc-0.5*(ar->winx)/st->cwidth; } if(st->top < 0) st->top= 0; diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index 31d29ac7f17..5ea33e1660d 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -55,6 +55,7 @@ int text_font_width(struct SpaceText *st, char *str); void text_update_line_edited(struct Text *text, struct TextLine *line); void text_update_edited(struct Text *text); +void text_update_character_width(struct SpaceText *st); void text_update_cursor_moved(struct SpaceText *st, struct ARegion *ar); #define TEXTXLOC 38 diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 5568900e621..f9485f17bdc 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -1289,6 +1289,8 @@ static void wrap_move_bol(SpaceText *st, ARegion *ar, short sel) Text *text= st->text; int offl, offc, lin; + text_update_character_width(st); + lin= txt_get_span(text->lines.first, text->sell); wrap_offset(st, ar, text->sell, text->selc, &offl, &offc); @@ -1307,6 +1309,8 @@ static void wrap_move_eol(SpaceText *st, ARegion *ar, short sel) Text *text= st->text; int offl, offc, lin, startl, c; + text_update_character_width(st); + lin= txt_get_span(text->lines.first, text->sell); wrap_offset(st, ar, text->sell, text->selc, &offl, &offc); startl= offl; @@ -1331,6 +1335,8 @@ static void wrap_move_up(SpaceText *st, ARegion *ar, short sel) Text *text= st->text; int offl, offl_1, offc, fromline, toline, c, target; + text_update_character_width(st); + wrap_offset(st, ar, text->sell, 0, &offl_1, &offc); wrap_offset(st, ar, text->sell, text->selc, &offl, &offc); fromline= toline= txt_get_span(text->lines.first, text->sell); @@ -1376,6 +1382,8 @@ static void wrap_move_down(SpaceText *st, ARegion *ar, short sel) Text *text= st->text; int offl, startoff, offc, fromline, toline, c, target; + text_update_character_width(st); + wrap_offset(st, ar, text->sell, text->selc, &offl, &offc); fromline= toline= txt_get_span(text->lines.first, text->sell); target= text->selc + offc; @@ -1754,6 +1762,8 @@ static void scroll_apply(bContext *C, wmOperator *op, wmEvent *event) TextScroll *tsc= op->customdata; short *mval= event->mval; + text_update_character_width(st); + if(tsc->first) { tsc->old[0]= mval[0]; tsc->old[1]= mval[1]; @@ -1763,7 +1773,7 @@ static void scroll_apply(bContext *C, wmOperator *op, wmEvent *event) } if(!tsc->scrollbar) { - tsc->delta[0]= (tsc->hold[0]-mval[0])/text_font_width_character(st); + tsc->delta[0]= (tsc->hold[0]-mval[0])/st->cwidth; tsc->delta[1]= (mval[1]-tsc->hold[1])/st->lheight; } else @@ -1906,6 +1916,8 @@ static void set_cursor_to_pos(SpaceText *st, ARegion *ar, int x, int y, int sel) int *charp; int w; + text_update_character_width(st); + if(sel) { linep= &text->sell; charp= &text->selc; } else { linep= &text->curl; charp= &text->curc; } @@ -1917,7 +1929,7 @@ static void set_cursor_to_pos(SpaceText *st, ARegion *ar, int x, int y, int sel) x-= TXT_OFFSET; if(x<0) x= 0; - x = (x/text_font_width_character(st)) + st->left; + x = (x/st->cwidth) + st->left; if(st->wordwrap) { int i, j, endj, curs, max, chop, start, end, chars, loop; diff --git a/source/blender/editors/space_text/text_python.c b/source/blender/editors/space_text/text_python.c index 4fa54cdf27b..b606f8cb141 100644 --- a/source/blender/editors/space_text/text_python.c +++ b/source/blender/editors/space_text/text_python.c @@ -66,16 +66,18 @@ int text_do_suggest_select(SpaceText *st, ARegion *ar) /* Count the visible lines to the cursor */ for(tmp=st->text->curl, l=-st->top; tmp; tmp=tmp->prev, l++); if(l<0) return 0; + + text_update_character_width(st); if(st->showlinenrs) { - x = text_font_width_character(st)*(st->text->curc-st->left) + TXT_OFFSET + TEXTXLOC - 4; + x = st->cwidth*(st->text->curc-st->left) + TXT_OFFSET + TEXTXLOC - 4; } else { - x = text_font_width_character(st)*(st->text->curc-st->left) + TXT_OFFSET - 4; + x = st->cwidth*(st->text->curc-st->left) + TXT_OFFSET - 4; } y = ar->winy - st->lheight*l - 2; - w = SUGG_LIST_WIDTH*text_font_width_character(st) + 20; + w = SUGG_LIST_WIDTH*st->cwidth + 20; h = SUGG_LIST_SIZE*st->lheight + 8; // XXX getmouseco_areawin(mval); diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index ed825886a05..00353cfc457 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -510,7 +510,6 @@ void transform_autoik_update(TransInfo *t, short mode); int count_set_pose_transflags(int *out_mode, short around, struct Object *ob); /* auto-keying stuff used by special_aftertrans_update */ -short autokeyframe_cfra_can_key(struct Scene *scene, struct Object *ob); void autokeyframe_ob_cb_func(struct Scene *scene, struct View3D *v3d, struct Object *ob, int tmode); void autokeyframe_pose_cb_func(struct Scene *scene, struct View3D *v3d, struct Object *ob, int tmode, short targetless_ik); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 60d209ae2db..2262c6cdeaa 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4312,21 +4312,6 @@ static void clear_trans_object_base_flags(TransInfo *t) } } -/* auto-keyframing feature - checks for whether anything should be done for the current frame */ -// TODO: this should probably be done per channel instead... -short autokeyframe_cfra_can_key(Scene *scene, Object *ob) -{ - float cfra= (float)CFRA; // XXX for now, this will do - - /* only filter if auto-key mode requires this */ - if (IS_AUTOKEY_ON(scene) == 0) - return 0; - else if (IS_AUTOKEY_MODE(scene, NORMAL)) - return 1; - else - return id_frame_has_keyframe(&ob->id, cfra, ANIMFILTER_KEYS_LOCAL); -} - /* auto-keyframing feature - for objects * tmode: should be a transform mode */ @@ -4335,7 +4320,8 @@ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode) ID *id= &ob->id; FCurve *fcu; - if (autokeyframe_cfra_can_key(scene, ob)) { + // TODO: this should probably be done per channel instead... + if (autokeyframe_cfra_can_key(scene, id)) { AnimData *adt= ob->adt; float cfra= (float)CFRA; // xxx this will do for now short flag = 0; @@ -4436,7 +4422,8 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode, bPoseChannel *pchan; FCurve *fcu; - if (autokeyframe_cfra_can_key(scene, ob)) { + // TODO: this should probably be done per channel instead... + if (autokeyframe_cfra_can_key(scene, id)) { float cfra= (float)CFRA; short flag= 0; char buf[512]; diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index dc0ec51fa4f..951b12b82fe 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -293,7 +293,8 @@ typedef struct SpaceText { int top, viewlines; short flags, menunr; - int lheight; + short lheight; /* user preference */ + short cwidth; /* runtime computed */ int left; int showlinenrs; int tabnumber; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 0709d2d58b0..4fab0de1f0a 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -122,6 +122,16 @@ typedef struct uiWidgetColors { short pad; } uiWidgetColors; +typedef struct uiWidgetStateColors { + char inner_anim[4]; + char inner_anim_sel[4]; + char inner_key[4]; + char inner_key_sel[4]; + char inner_driven[4]; + char inner_driven_sel[4]; + float blend, pad; +} uiWidgetStateColors; + typedef struct ThemeUI { /* Interface Elements (buttons, menus, icons) */ @@ -130,6 +140,8 @@ typedef struct ThemeUI { uiWidgetColors wcol_num, wcol_numslider; uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item; uiWidgetColors wcol_box, wcol_scroll; + + uiWidgetStateColors wcol_state; char iconfile[80]; // FILE_MAXFILE length diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 9bf3f54e159..fa81af8f140 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -799,11 +799,6 @@ static void rna_def_space_text(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem font_size_items[] = { - {12, "12", 0, "12", ""}, - {15, "15", 0, "15", ""}, - {0, NULL, 0, NULL, NULL}}; - srna= RNA_def_struct(brna, "SpaceTextEditor", "Space"); RNA_def_struct_sdna(srna, "SpaceText"); RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space data."); @@ -848,9 +843,9 @@ static void rna_def_space_text(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with."); RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); - prop= RNA_def_property(srna, "font_size", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "lheight"); - RNA_def_property_enum_items(prop, font_size_items); + prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "lheight"); + RNA_def_property_range(prop, 8, 32); RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text."); RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 977c43e6b95..ffe3751908d 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -268,7 +268,50 @@ static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna) RNA_def_property_range(prop, -100, 100); RNA_def_property_ui_text(prop, "Shade Down", ""); RNA_def_property_update(prop, NC_WINDOW, NULL); +} + +static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "ThemeWidgetStateColors", NULL); + RNA_def_struct_sdna(srna, "uiWidgetStateColors"); + RNA_def_struct_ui_text(srna, "Theme Widget State Color", "Theme settings for widget state colors."); + + prop= RNA_def_property(srna, "inner_anim", PROP_FLOAT, PROP_COLOR); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Animated", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); + + prop= RNA_def_property(srna, "inner_anim_sel", PROP_FLOAT, PROP_COLOR); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Animated Selected", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); + prop= RNA_def_property(srna, "inner_key", PROP_FLOAT, PROP_COLOR); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Keyframe", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); + + prop= RNA_def_property(srna, "inner_key_sel", PROP_FLOAT, PROP_COLOR); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Keyframe Selected", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); + + prop= RNA_def_property(srna, "inner_driven", PROP_FLOAT, PROP_COLOR); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Driven", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); + + prop= RNA_def_property(srna, "inner_driven_sel", PROP_FLOAT, PROP_COLOR); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Driven Selected", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); + + prop= RNA_def_property(srna, "blend", PROP_FLOAT, PROP_PERCENTAGE); + RNA_def_property_ui_text(prop, "Blend", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); } static void rna_def_userdef_theme_ui(BlenderRNA *brna) @@ -277,6 +320,7 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) PropertyRNA *prop; rna_def_userdef_theme_ui_wcol(brna); + rna_def_userdef_theme_ui_wcol_state(brna); srna= RNA_def_struct(brna, "ThemeUserInterface", NULL); RNA_def_struct_sdna(srna, "ThemeUI"); @@ -365,6 +409,12 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Scroll Widget Colors", ""); RNA_def_property_update(prop, NC_WINDOW, NULL); + + prop= RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "wcol_state"); + RNA_def_property_struct_type(prop, "ThemeWidgetStateColors"); + RNA_def_property_ui_text(prop, "State Colors", ""); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "icon_file", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "iconfile"); -- cgit v1.2.3 From bb158ad5721b98086b77a8168a53c4901540907d Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 12 Jul 2009 03:42:39 +0000 Subject: 2.5 - Editing Animation data (keyframes/nla-strips) using transform tools now refreshes the 3d-view in realtime. For now, this directly sets the update flags, though this really should be calling the Depsgraph API instead. --- source/blender/editors/space_view3d/space_view3d.c | 12 ++ source/blender/editors/transform/transform.c | 2 +- source/blender/editors/transform/transform.h | 2 + .../editors/transform/transform_conversions.c | 225 +++++++++++---------- .../blender/editors/transform/transform_generics.c | 147 ++++++++++---- 5 files changed, 231 insertions(+), 157 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index f0c3a2c200c..387468f7160 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -413,11 +413,13 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn) switch(wmn->data) { case ND_KEYFRAME_EDIT: case ND_KEYFRAME_PROP: + case ND_NLA_EDIT: case ND_NLA_ACTCHANGE: case ND_ANIMCHAN_SELECT: ED_region_tag_redraw(ar); break; } + break; case NC_SCENE: switch(wmn->data) { case ND_TRANSFORM: @@ -536,6 +538,16 @@ static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ switch(wmn->category) { + case NC_ANIMATION: + switch(wmn->data) { + case ND_KEYFRAME_EDIT: + case ND_KEYFRAME_PROP: + case ND_NLA_EDIT: + case ND_NLA_ACTCHANGE: + ED_region_tag_redraw(ar); + break; + } + break; case NC_SCENE: switch(wmn->data) { case ND_FRAME: diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 888a15e2534..d45a6f42232 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -308,7 +308,7 @@ static void viewRedrawForce(bContext *C, TransInfo *t) WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } else if (t->spacetype == SPACE_NLA) { - WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL); } else if(t->spacetype == SPACE_NODE) { diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 00353cfc457..db78632e76a 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -163,6 +163,8 @@ typedef struct TransDataSeq { /* for NLA transform (stored in td->extra pointer) */ typedef struct TransDataNla { + ID *id; /* ID-block NLA-data is attached to */ + struct NlaTrack *oldTrack; /* Original NLA-Track that the strip belongs to */ struct NlaTrack *nlt; /* Current NLA-Track that the strip belongs to */ diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 2262c6cdeaa..3d643a2dec1 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2578,28 +2578,28 @@ static void createTransNlaData(bContext *C, TransInfo *t) Scene *scene= CTX_data_scene(C); TransData *td = NULL; TransDataNla *tdn = NULL; - + bAnimContext ac; ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; - + int count=0; char side; - + /* determine what type of data we are operating on */ if (ANIM_animdata_get_context(C, &ac) == 0) return; - + /* filter data */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_NLATRACKS | ANIMFILTER_FOREDIT); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - + /* which side of the current frame should be allowed */ if (t->mode == TFM_TIME_EXTEND) { /* only side on which mouse is gets transformed */ float xmouse, ymouse; - + UI_view2d_region_to_view(&ac.ar->v2d, t->imval[0], t->imval[1], &xmouse, &ymouse); side = (xmouse > CFRA) ? 'R' : 'L'; // XXX use t->frame_side } @@ -2607,15 +2607,15 @@ static void createTransNlaData(bContext *C, TransInfo *t) /* normal transform - both sides of current frame are considered */ side = 'B'; } - + /* loop 1: count how many strips are selected (consider each strip as 2 points) */ for (ale= anim_data.first; ale; ale= ale->next) { NlaTrack *nlt= (NlaTrack *)ale->data; NlaStrip *strip; - + /* make some meta-strips for chains of selected strips */ BKE_nlastrips_make_metas(&nlt->strips, 1); - + /* only consider selected strips */ for (strip= nlt->strips.first; strip; strip= strip->next) { // TODO: we can make strips have handles later on... @@ -2628,29 +2628,29 @@ static void createTransNlaData(bContext *C, TransInfo *t) } } } - + /* stop if trying to build list if nothing selected */ if (count == 0) { /* cleanup temp list */ BLI_freelistN(&anim_data); return; } - + /* allocate memory for data */ t->total= count; - + t->data= MEM_callocN(t->total*sizeof(TransData), "TransData(NLA Editor)"); td= t->data; t->customData= MEM_callocN(t->total*sizeof(TransDataNla), "TransDataNla (NLA Editor)"); tdn= t->customData; - + /* loop 2: build transdata array */ for (ale= anim_data.first; ale; ale= ale->next) { /* only if a real NLA-track */ if (ale->type == ANIMTYPE_NLATRACK) { NlaTrack *nlt= (NlaTrack *)ale->data; NlaStrip *strip; - + /* only consider selected strips */ for (strip= nlt->strips.first; strip; strip= strip->next) { // TODO: we can make strips have handles later on... @@ -2667,44 +2667,45 @@ static void createTransNlaData(bContext *C, TransInfo *t) * cases, there will need to be 1 of these tdn elements in the array skipped... */ float center[3], yval; - + /* firstly, init tdn settings */ + tdn->id= ale->id; tdn->oldTrack= tdn->nlt= nlt; tdn->strip= strip; tdn->trackIndex= BLI_findindex(&nlt->strips, strip); - + yval= (float)(tdn->trackIndex * NLACHANNEL_STEP); - + tdn->h1[0]= strip->start; tdn->h1[1]= yval; tdn->h2[0]= strip->end; tdn->h2[1]= yval; - + center[0]= (float)CFRA; center[1]= yval; center[2]= 0.0f; - + /* set td's based on which handles are applicable */ if (FrameOnMouseSide(side, strip->start, (float)CFRA)) { /* just set tdn to assume that it only has one handle for now */ tdn->handle= -1; - + /* now, link the transform data up to this data */ if (t->mode == TFM_TRANSLATION) { td->loc= tdn->h1; VECCOPY(td->iloc, tdn->h1); - + /* store all the other gunk that is required by transform */ VECCOPY(td->center, center); memset(td->axismtx, 0, sizeof(td->axismtx)); td->axismtx[2][2] = 1.0f; - + td->ext= NULL; td->tdi= NULL; td->val= NULL; - + td->flag |= TD_SELECTED; td->dist= 0.0f; - + Mat3One(td->mtx); Mat3One(td->smtx); } @@ -2712,7 +2713,7 @@ static void createTransNlaData(bContext *C, TransInfo *t) td->val= &tdn->h1[0]; td->ival= tdn->h1[0]; } - + td->extra= tdn; td++; } @@ -2720,22 +2721,22 @@ static void createTransNlaData(bContext *C, TransInfo *t) { /* if tdn is already holding the start handle, then we're doing both, otherwise, only end */ tdn->handle= (tdn->handle) ? 2 : 1; - + /* now, link the transform data up to this data */ if (t->mode == TFM_TRANSLATION) { td->loc= tdn->h2; VECCOPY(td->iloc, tdn->h2); - + /* store all the other gunk that is required by transform */ VECCOPY(td->center, center); memset(td->axismtx, 0, sizeof(td->axismtx)); td->axismtx[2][2] = 1.0f; - + td->ext= NULL; td->tdi= NULL; td->val= NULL; - + td->flag |= TD_SELECTED; td->dist= 0.0f; - + Mat3One(td->mtx); Mat3One(td->smtx); } @@ -2743,11 +2744,11 @@ static void createTransNlaData(bContext *C, TransInfo *t) td->val= &tdn->h2[0]; td->ival= tdn->h2[0]; } - + td->extra= tdn; td++; } - + /* if both handles were used, skip the next tdn (i.e. leave it blank) since the counting code is dumb... * otherwise, just advance to the next one... */ @@ -3114,32 +3115,32 @@ static void createTransActionData(bContext *C, TransInfo *t) Scene *scene= CTX_data_scene(C); TransData *td = NULL; tGPFtransdata *tfd = NULL; - + bAnimContext ac; ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; - + int count=0; float cfra; char side; - + /* determine what type of data we are operating on */ if (ANIM_animdata_get_context(C, &ac) == 0) return; - + /* filter data */ if (ac.datatype == ANIMCONT_GPENCIL) filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT); else filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - + /* which side of the current frame should be allowed */ if (t->mode == TFM_TIME_EXTEND) { /* only side on which mouse is gets transformed */ float xmouse, ymouse; - + UI_view2d_region_to_view(&ac.ar->v2d, t->imval[0], t->imval[1], &xmouse, &ymouse); side = (xmouse > CFRA) ? 'R' : 'L'; // XXX use t->frame_side } @@ -3147,11 +3148,11 @@ static void createTransActionData(bContext *C, TransInfo *t) /* normal transform - both sides of current frame are considered */ side = 'B'; } - + /* loop 1: fully select ipo-keys and count how many BezTriples are selected */ for (ale= anim_data.first; ale; ale= ale->next) { AnimData *adt= ANIM_nla_mapping_get(&ac, ale); - + /* convert current-frame to action-time (slightly less accurate, espcially under * higher scaling ratios, but is faster than converting all points) */ @@ -3159,26 +3160,26 @@ static void createTransActionData(bContext *C, TransInfo *t) cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); else cfra = (float)CFRA; - + //if (ale->type == ANIMTYPE_GPLAYER) // count += count_gplayer_frames(ale->data, side, cfra); //else count += count_fcurve_keys(ale->key_data, side, cfra); } - + /* stop if trying to build list if nothing selected */ if (count == 0) { /* cleanup temp list */ BLI_freelistN(&anim_data); return; } - + /* allocate memory for data */ t->total= count; - + t->data= MEM_callocN(t->total*sizeof(TransData), "TransData(Action Editor)"); td= t->data; - + if (ac.datatype == ANIMCONT_GPENCIL) { if (t->mode == TFM_TIME_SLIDE) { t->customData= MEM_callocN((sizeof(float)*2)+(sizeof(tGPFtransdata)*count), "TimeSlide + tGPFtransdata"); @@ -3191,7 +3192,7 @@ static void createTransActionData(bContext *C, TransInfo *t) } else if (t->mode == TFM_TIME_SLIDE) t->customData= MEM_callocN(sizeof(float)*2, "TimeSlide Min/Max"); - + /* loop 2: build transdata array */ for (ale= anim_data.first; ale; ale= ale->next) { //if (ale->type == ANIMTYPE_GPLAYER) { @@ -3205,7 +3206,7 @@ static void createTransActionData(bContext *C, TransInfo *t) //else { AnimData *adt= ANIM_nla_mapping_get(&ac, ale); FCurve *fcu= (FCurve *)ale->key_data; - + /* convert current-frame to action-time (slightly less accurate, espcially under * higher scaling ratios, but is faster than converting all points) */ @@ -3213,22 +3214,22 @@ static void createTransActionData(bContext *C, TransInfo *t) cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); else cfra = (float)CFRA; - + td= FCurveToTransData(td, fcu, adt, side, cfra); //} } - + /* check if we're supposed to be setting minx/maxx for TimeSlide */ if (t->mode == TFM_TIME_SLIDE) { float min=999999999.0f, max=-999999999.0f; int i; - + td= (t->data + 1); for (i=1; i < count; i+=3, td+=3) { if (min > *(td->val)) min= *(td->val); if (max < *(td->val)) max= *(td->val); } - + /* minx/maxx values used by TimeSlide are stored as a * calloced 2-float array in t->customData. This gets freed * in postTrans (T_FREE_CUSTOMDATA). @@ -3254,18 +3255,18 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, AnimData *adt, * Due to NLA mapping, we apply NLA mapping to some of the verts here, * and then that mapping will be undone after transform is done. */ - + if (adt) { td2d->loc[0] = BKE_nla_tweakedit_remap(adt, loc[0], NLATIME_CONVERT_UNMAP); td2d->loc[1] = loc[1]; td2d->loc[2] = 0.0f; td2d->loc2d = loc; - + td->loc = td2d->loc; td->center[0] = BKE_nla_tweakedit_remap(adt, cent[0], NLATIME_CONVERT_UNMAP); td->center[1] = cent[1]; td->center[2] = 0.0f; - + VECCOPY(td->iloc, td->loc); } else { @@ -3273,32 +3274,32 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, AnimData *adt, td2d->loc[1] = loc[1]; td2d->loc[2] = 0.0f; td2d->loc2d = loc; - + td->loc = td2d->loc; VECCOPY(td->center, cent); VECCOPY(td->iloc, td->loc); } - + memset(td->axismtx, 0, sizeof(td->axismtx)); td->axismtx[2][2] = 1.0f; - + td->ext= NULL; td->tdi= NULL; td->val= NULL; - + /* store AnimData info in td->extra, for applying mapping when flushing */ td->extra= adt; - + if (selected) { td->flag |= TD_SELECTED; td->dist= 0.0f; } else td->dist= MAXFLOAT; - + if (ishandle) td->flag |= TD_NOTIMESNAP; if (intvals) td->flag |= TD_INTVALUES; - + Mat3One(td->mtx); Mat3One(td->smtx); } @@ -3308,34 +3309,34 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) Scene *scene= CTX_data_scene(C); ARegion *ar= CTX_wm_region(C); View2D *v2d= &ar->v2d; - + TransData *td = NULL; TransData2D *td2d = NULL; - + bAnimContext ac; ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; - + BezTriple *bezt, *prevbezt; int count=0, i; float cfra; char side; - + /* determine what type of data we are operating on */ if (ANIM_animdata_get_context(C, &ac) == 0) return; - + /* filter data */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_CURVEVISIBLE); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - + /* which side of the current frame should be allowed */ // XXX we still want this mode, but how to get this using standard transform too? if (t->mode == TFM_TIME_EXTEND) { /* only side on which mouse is gets transformed */ float xmouse, ymouse; - + UI_view2d_region_to_view(&ac.ar->v2d, t->imval[0], t->imval[1], &xmouse, &ymouse); side = (xmouse > CFRA) ? 'R' : 'L'; // XXX use t->frame_side } @@ -3343,12 +3344,12 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) /* normal transform - both sides of current frame are considered */ side = 'B'; } - + /* loop 1: count how many BezTriples (specifically their verts) are selected (or should be edited) */ for (ale= anim_data.first; ale; ale= ale->next) { AnimData *adt= ANIM_nla_mapping_get(&ac, ale); FCurve *fcu= (FCurve *)ale->key_data; - + /* convert current-frame to action-time (slightly less accurate, espcially under * higher scaling ratios, but is faster than converting all points) */ @@ -3356,7 +3357,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); else cfra = (float)CFRA; - + /* only include BezTriples whose 'keyframe' occurs on the same side of the current frame as mouse */ if (fcu->bezt) { for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) { @@ -3384,30 +3385,30 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) } } } - + /* stop if trying to build list if nothing selected */ if (count == 0) { /* cleanup temp list */ BLI_freelistN(&anim_data); return; } - + /* allocate memory for data */ t->total= count; - + t->data= MEM_callocN(t->total*sizeof(TransData), "TransData (Graph Editor)"); /* for each 2d vert a 3d vector is allocated, so that they can be treated just as if they were 3d verts */ t->data2d= MEM_callocN(t->total*sizeof(TransData2D), "TransData2D (Graph Editor)"); - + td= t->data; td2d= t->data2d; - + /* loop 2: build transdata arrays */ for (ale= anim_data.first; ale; ale= ale->next) { AnimData *adt= ANIM_nla_mapping_get(&ac, ale); FCurve *fcu= (FCurve *)ale->key_data; short intvals= (fcu->flag & FCURVE_INT_VALUES); - + /* convert current-frame to action-time (slightly less accurate, espcially under * higher scaling ratios, but is faster than converting all points) */ @@ -3415,16 +3416,16 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP); else cfra = (float)CFRA; - + /* only include BezTriples whose 'keyframe' occurs on the same side of the current frame as mouse (if applicable) */ bezt= fcu->bezt; prevbezt= NULL; - + for (i=0; i < fcu->totvert; i++, prevbezt=bezt, bezt++) { if (FrameOnMouseSide(side, bezt->vec[1][0], cfra)) { TransDataCurveHandleFlags *hdata = NULL; short h1=1, h2=1; - + /* only include handles if selected, and interpolaton mode uses beztriples */ if ( (!prevbezt && (bezt->ipo==BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo==BEZT_IPO_BEZ)) ) { if (bezt->f1 & SELECT) { @@ -3443,7 +3444,7 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) else h2= 0; } - + /* only include main vert if selected */ if (bezt->f2 & SELECT) { /* if scaling around individuals centers, do no include keyframes */ @@ -3453,10 +3454,10 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) if (hdata == NULL) hdata = initTransDataCurveHandes(td, bezt); } - + bezt_to_transdata(td++, td2d++, adt, bezt->vec[1], bezt->vec[1], 1, 0, intvals); } - + /* special hack (must be done after initTransDataCurveHandes(), as that stores handle settings to restore...): * - Check if we've got entire BezTriple selected and we're scaling/rotating that point, * then check if we're using auto-handles. @@ -3471,11 +3472,11 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) } } } - + /* Sets handles based on the selection */ testhandles_fcurve(fcu); } - + /* cleanup temp list */ BLI_freelistN(&anim_data); } @@ -3502,19 +3503,19 @@ static BeztMap *bezt_to_beztmaps (BezTriple *bezts, int totvert) BezTriple *prevbezt= NULL; BeztMap *bezm, *bezms; int i; - + /* allocate memory for this array */ if (totvert==0 || bezts==NULL) return NULL; bezm= bezms= MEM_callocN(sizeof(BeztMap)*totvert, "BeztMaps"); - + /* assign beztriples to beztmaps */ for (i=0; i < totvert; i++, bezm++, prevbezt=bezt, bezt++) { bezm->bezt= bezt; - + bezm->oldIndex= i; bezm->newIndex= i; - + bezm->pipo= (prevbezt) ? prevbezt->ipo : bezt->ipo; bezm->cipo= bezt->ipo; } @@ -3527,11 +3528,11 @@ static void sort_time_beztmaps (BeztMap *bezms, int totvert) { BeztMap *bezm; int i, ok= 1; - + /* keep repeating the process until nothing is out of place anymore */ while (ok) { ok= 0; - + bezm= bezms; i= totvert; while (i--) { @@ -3540,13 +3541,13 @@ static void sort_time_beztmaps (BeztMap *bezms, int totvert) if (bezm->bezt->vec[1][0] > (bezm+1)->bezt->vec[1][0]) { bezm->newIndex++; (bezm+1)->newIndex--; - + SWAP(BeztMap, *bezm, *(bezm+1)); - + ok= 1; } } - + /* do we need to check if the handles need to be swapped? * optimisation: this only needs to be performed in the first loop */ @@ -3562,7 +3563,7 @@ static void sort_time_beztmaps (BeztMap *bezms, int totvert) bezm->swapHs = -1; } } - + bezm++; } } @@ -3576,13 +3577,13 @@ static void beztmap_to_data (TransInfo *t, FCurve *fcu, BeztMap *bezms, int totv TransData2D *td; int i, j; char *adjusted; - + /* dynamically allocate an array of chars to mark whether an TransData's * pointers have been fixed already, so that we don't override ones that are * already done */ adjusted= MEM_callocN(t->total, "beztmap_adjusted_map"); - + /* for each beztmap item, find if it is used anywhere */ bezm= bezms; for (i= 0; i < totvert; i++, bezm++) { @@ -3593,7 +3594,7 @@ static void beztmap_to_data (TransInfo *t, FCurve *fcu, BeztMap *bezms, int totv for (j= 0; j < t->total; j++, td++) { /* skip item if already marked */ if (adjusted[j] != 0) continue; - + /* only selected verts */ if (bezm->pipo == BEZT_IPO_BEZ) { if (bezm->bezt->f1 & SELECT) { @@ -3624,9 +3625,9 @@ static void beztmap_to_data (TransInfo *t, FCurve *fcu, BeztMap *bezms, int totv } } } - + } - + /* free temp memory used for 'adjusted' array */ MEM_freeN(adjusted); } @@ -3641,25 +3642,25 @@ static void beztmap_to_data (TransInfo *t, FCurve *fcu, BeztMap *bezms, int totv void remake_graph_transdata (TransInfo *t, ListBase *anim_data) { bAnimListElem *ale; - + /* sort and reassign verts */ for (ale= anim_data->first; ale; ale= ale->next) { FCurve *fcu= (FCurve *)ale->key_data; - + if (fcu->bezt) { BeztMap *bezm; - + /* adjust transform-data pointers */ bezm= bezt_to_beztmaps(fcu->bezt, fcu->totvert); sort_time_beztmaps(bezm, fcu->totvert); beztmap_to_data(t, fcu, bezm, fcu->totvert); - + /* free mapping stuff */ MEM_freeN(bezm); - + /* re-sort actual beztriples (perhaps this could be done using the beztmaps to save time?) */ sort_time_fcurve(fcu); - + /* make sure handles are all set correctly */ testhandles_fcurve(fcu); } @@ -3677,11 +3678,11 @@ void flushTransGraphData(TransInfo *t) Scene *scene= t->scene; double secf= FPS; int a; - + /* flush to 2d vector from internally used 3d vector */ for (a=0, td= t->data, td2d=t->data2d; atotal; a++, td++, td2d++) { AnimData *adt= (AnimData *)td->extra; /* pointers to relevant AnimData blocks are stored in the td->extra pointers */ - + /* handle snapping for time values * - we should still be in NLA-mapping timespace * - only apply to keyframes (but never to handles) @@ -3694,19 +3695,19 @@ void flushTransGraphData(TransInfo *t) else td2d->loc[0]= (float)( floor(td2d->loc[0]+0.5f) ); break; - + case SACTSNAP_MARKER: /* snap to nearest marker */ td2d->loc[0]= (float)ED_markers_find_nearest_marker_time(&t->scene->markers, td2d->loc[0]); break; } } - - /* we need to unapply the nla-scaling from the time in some situations */ + + /* we need to unapply the nla-mapping from the time in some situations */ if (adt) td2d->loc2d[0]= BKE_nla_tweakedit_remap(adt, td2d->loc[0], NLATIME_CONVERT_UNMAP); else td2d->loc2d[0]= td2d->loc[0]; - + /* if int-values only, truncate to integers */ if (td->flag & TD_INTVALUES) td2d->loc2d[1]= (float)((int)td2d->loc[1]); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index af56079727f..560b37caf0a 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -264,6 +264,29 @@ static void editmesh_apply_to_mirror(TransInfo *t) } } +/* tags the given ID block for refreshes (if applicable) due to + * Animation Editor editing + */ +static void animedit_refresh_id_tags (ID *id) +{ + AnimData *adt= BKE_animdata_from_id(id); + + /* tag AnimData for refresh so that other views will update in realtime with these changes */ + if (adt) + adt->recalc |= ADT_RECALC_ANIM; + + /* if ID-block is Object, set recalc flags */ + // TODO: this should probably go through the depsgraph instead... but for now, let's be lazy + switch (GS(id->name)) { + case ID_OB: + { + Object *ob= (Object *)id; + ob->recalc |= OB_RECALC; + } + break; + } +} + /* called for updating while transform acts, once per redraw */ void recalcData(TransInfo *t) { @@ -281,60 +304,93 @@ void recalcData(TransInfo *t) else if (t->spacetype==SPACE_SEQ) { flushTransSeq(t); } + else if (t->spacetype == SPACE_ACTION) { + SpaceAction *sact= (SpaceAction *)t->sa->spacedata.first; + Scene *scene; + + bAnimContext ac; + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + + /* initialise relevant anim-context 'context' data from TransInfo data */ + /* NOTE: sync this with the code in ANIM_animdata_get_context() */ + memset(&ac, 0, sizeof(bAnimContext)); + + scene= ac.scene= t->scene; + ac.obact= OBACT; + ac.sa= t->sa; + ac.ar= t->ar; + ac.spacetype= (t->sa)? t->sa->spacetype : 0; + ac.regiontype= (t->ar)? t->ar->regiontype : 0; + + ANIM_animdata_context_getdata(&ac); + + /* get animdata blocks visible in editor, assuming that these will be the ones where things changed */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_ANIMDATA); + ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); + + /* just tag these animdata-blocks to recalc, assuming that some data there changed */ + for (ale= anim_data.first; ale; ale= ale->next) { + /* set refresh tags for objects using this animation */ + animedit_refresh_id_tags(ale->id); + } + + /* now free temp channels */ + BLI_freelistN(&anim_data); + } else if (t->spacetype == SPACE_IPO) { SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first; Scene *scene; - + ListBase anim_data = {NULL, NULL}; bAnimContext ac; int filter; - + bAnimListElem *ale; int dosort = 0; - - + + /* initialise relevant anim-context 'context' data from TransInfo data */ /* NOTE: sync this with the code in ANIM_animdata_get_context() */ memset(&ac, 0, sizeof(bAnimContext)); - + scene= ac.scene= t->scene; ac.obact= OBACT; ac.sa= t->sa; ac.ar= t->ar; ac.spacetype= (t->sa)? t->sa->spacetype : 0; ac.regiontype= (t->ar)? t->ar->regiontype : 0; - + ANIM_animdata_context_getdata(&ac); - + /* do the flush first */ flushTransGraphData(t); - + /* get curves to check if a re-sort is needed */ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY | ANIMFILTER_CURVEVISIBLE); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - + /* now test if there is a need to re-sort */ for (ale= anim_data.first; ale; ale= ale->next) { FCurve *fcu= (FCurve *)ale->key_data; - + AnimData *adt= BKE_animdata_from_id(ale->id); + /* watch it: if the time is wrong: do not correct handles yet */ if (test_time_fcurve(fcu)) dosort++; else calchandles_fcurve(fcu); + + /* set refresh tags for objects using this animation */ + animedit_refresh_id_tags(ale->id); } - + /* do resort and other updates? */ if (dosort) remake_graph_transdata(t, &anim_data); - //if (sipo->showkey) update_ipokey_val(); - + /* now free temp channels */ BLI_freelistN(&anim_data); - - /* update realtime - not working? */ - if (sipo->lock) { - - } } else if (t->spacetype == SPACE_NLA) { TransDataNla *tdn= (TransDataNla *)t->customData; @@ -342,7 +398,7 @@ void recalcData(TransInfo *t) Scene *scene= t->scene; double secf= FPS; int i; - + /* for each strip we've got, perform some additional validation of the values that got set before * using RNA to set the value (which does some special operations when setting these values to make * sure that everything works ok) @@ -352,42 +408,45 @@ void recalcData(TransInfo *t) PointerRNA strip_ptr; short pExceeded, nExceeded, iter; int delta_y1, delta_y2; - + /* if this tdn has no handles, that means it is just a dummy that should be skipped */ if (tdn->handle == 0) continue; - + + /* set refresh tags for objects using this animation */ + animedit_refresh_id_tags(tdn->id); + /* if cancelling transform, just write the values without validating, then move on */ if (t->state == TRANS_CANCEL) { /* clear the values by directly overwriting the originals, but also need to restore * endpoints of neighboring transition-strips */ - + /* start */ strip->start= tdn->h1[0]; - + if ((strip->prev) && (strip->prev->type == NLASTRIP_TYPE_TRANSITION)) strip->prev->end= tdn->h1[0]; - + /* end */ strip->end= tdn->h2[0]; - + if ((strip->next) && (strip->next->type == NLASTRIP_TYPE_TRANSITION)) strip->next->start= tdn->h2[0]; - + /* flush transforms to child strips (since this should be a meta) */ BKE_nlameta_flush_transforms(strip); - + /* restore to original track (if needed) */ if (tdn->oldTrack != tdn->nlt) { /* just append to end of list for now, since strips get sorted in special_aftertrans_update() */ BLI_remlink(&tdn->nlt->strips, strip); BLI_addtail(&tdn->oldTrack->strips, strip); } - + continue; } - + /* firstly, check if the proposed transform locations would overlap with any neighbouring strips * (barring transitions) which are absolute barriers since they are not being moved * @@ -396,7 +455,7 @@ void recalcData(TransInfo *t) for (iter=0; iter < 5; iter++) { pExceeded= ((strip->prev) && (strip->prev->type != NLASTRIP_TYPE_TRANSITION) && (tdn->h1[0] < strip->prev->end)); nExceeded= ((strip->next) && (strip->next->type != NLASTRIP_TYPE_TRANSITION) && (tdn->h2[0] > strip->next->start)); - + if ((pExceeded && nExceeded) || (iter == 4) ) { /* both endpoints exceeded (or iteration ping-pong'd meaning that we need a compromise) * - simply crop strip to fit within the bounds of the strips bounding it @@ -414,21 +473,21 @@ void recalcData(TransInfo *t) else if (nExceeded) { /* move backwards */ float offset= tdn->h2[0] - strip->next->start; - + tdn->h1[0] -= offset; tdn->h2[0] -= offset; } else if (pExceeded) { /* more forwards */ float offset= strip->prev->end - tdn->h1[0]; - + tdn->h1[0] += offset; tdn->h2[0] += offset; } else /* all is fine and well */ break; } - + /* handle auto-snapping */ switch (snla->autosnap) { case SACTSNAP_FRAME: /* snap to nearest frame/time */ @@ -441,35 +500,35 @@ void recalcData(TransInfo *t) tdn->h2[0]= (float)( floor(tdn->h2[0]+0.5f) ); } break; - + case SACTSNAP_MARKER: /* snap to nearest marker */ tdn->h1[0]= (float)ED_markers_find_nearest_marker_time(&t->scene->markers, tdn->h1[0]); tdn->h2[0]= (float)ED_markers_find_nearest_marker_time(&t->scene->markers, tdn->h2[0]); break; } - + /* use RNA to write the values... */ // TODO: do we need to write in 2 passes to make sure that no truncation goes on? RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &strip_ptr); - + RNA_float_set(&strip_ptr, "start_frame", tdn->h1[0]); RNA_float_set(&strip_ptr, "end_frame", tdn->h2[0]); - + /* flush transforms to child strips (since this should be a meta) */ BKE_nlameta_flush_transforms(strip); - - + + /* now, check if we need to try and move track * - we need to calculate both, as only one may have been altered by transform if only 1 handle moved */ delta_y1= ((int)tdn->h1[1] / NLACHANNEL_STEP - tdn->trackIndex); delta_y2= ((int)tdn->h2[1] / NLACHANNEL_STEP - tdn->trackIndex); - + if (delta_y1 || delta_y2) { NlaTrack *track; int delta = (delta_y2) ? delta_y2 : delta_y1; int n; - + /* move in the requested direction, checking at each layer if there's space for strip to pass through, * stopping on the last track available or that we're able to fit in */ @@ -480,7 +539,7 @@ void recalcData(TransInfo *t) /* move strip to this track */ BLI_remlink(&tdn->nlt->strips, strip); BKE_nlatrack_add_strip(track, strip); - + tdn->nlt= track; tdn->trackIndex += (n + 1); /* + 1, since n==0 would mean that we didn't change track */ } @@ -491,14 +550,14 @@ void recalcData(TransInfo *t) else { /* make delta 'positive' before using it, since we now know to go backwards */ delta= -delta; - + for (track=tdn->nlt->prev, n=0; (track) && (n < delta); track=track->prev, n++) { /* check if space in this track for the strip */ if (BKE_nlatrack_has_space(track, strip->start, strip->end)) { /* move strip to this track */ BLI_remlink(&tdn->nlt->strips, strip); BKE_nlatrack_add_strip(track, strip); - + tdn->nlt= track; tdn->trackIndex -= (n - 1); /* - 1, since n==0 would mean that we didn't change track */ } -- cgit v1.2.3 From fa8bd34d95d91712ffa6dc9066c255e9ee40e7e4 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 12 Jul 2009 04:29:36 +0000 Subject: NLA Bugfixes: * Fixed crash when anim-playback is running and a strip beside a transition gets transformed. Transition strips no-longer assume that their neighbours are action-clips, using the standard NLA-strip evaluation function instead to evaluate their neighbours. However, a check for ping-pong recursion needed to be added there, so that a transition beside a meta-strip, with the meta having a transition nested at the start of one of its levels, wouldn't fail with stack overflow. * Moved 'Tweak Mode' menu entry to Edit menu, since it's not really that modal. --- source/blender/blenkernel/intern/anim_sys.c | 19 ++++++++++++++++--- source/blender/editors/space_nla/nla_header.c | 19 ++++++++++--------- 2 files changed, 26 insertions(+), 12 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 19337f9de5d..e4882d8f555 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1049,12 +1049,12 @@ static void nlastrip_evaluate_transition (PointerRNA *ptr, ListBase *channels, L /* first strip */ tmp_nes.strip_mode= NES_TIME_TRANSITION_START; tmp_nes.strip= s1; - nlastrip_evaluate_actionclip(ptr, &tmp_channels, &tmp_modifiers, &tmp_nes); + nlastrip_evaluate(ptr, &tmp_channels, &tmp_modifiers, &tmp_nes); /* second strip */ tmp_nes.strip_mode= NES_TIME_TRANSITION_END; tmp_nes.strip= s2; - nlastrip_evaluate_actionclip(ptr, &tmp_channels, &tmp_modifiers, &tmp_nes); + nlastrip_evaluate(ptr, &tmp_channels, &tmp_modifiers, &tmp_nes); /* assumulate temp-buffer and full-buffer, using the 'real' strip */ @@ -1108,8 +1108,18 @@ static void nlastrip_evaluate_meta (PointerRNA *ptr, ListBase *channels, ListBas /* evaluates the given evaluation strip */ void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes) { + NlaStrip *strip= nes->strip; + + /* to prevent potential infinite recursion problems (i.e. transition strip, beside meta strip containing a transition + * several levels deep inside it), we tag the current strip as being evaluated, and clear this when we leave + */ + // TODO: be careful with this flag, since some edit tools may be running and have set this while animplayback was running + if (strip->flag & NLASTRIP_FLAG_EDIT_TOUCHED) + return; + strip->flag |= NLASTRIP_FLAG_EDIT_TOUCHED; + /* actions to take depend on the type of strip */ - switch (nes->strip->type) { + switch (strip->type) { case NLASTRIP_TYPE_CLIP: /* action-clip */ nlastrip_evaluate_actionclip(ptr, channels, modifiers, nes); break; @@ -1120,6 +1130,9 @@ void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, ListBase *modifiers nlastrip_evaluate_meta(ptr, channels, modifiers, nes); break; } + + /* clear temp recursion safe-check */ + strip->flag &= ~NLASTRIP_FLAG_EDIT_TOUCHED; } /* write the accumulated settings to */ diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index 8e4c71b9f80..e997a096bce 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -83,7 +83,6 @@ static void nla_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) { bScreen *sc= CTX_wm_screen(C); ScrArea *sa= CTX_wm_area(C); - Scene *scene= CTX_data_scene(C); SpaceNla *snla= (SpaceNla*)CTX_wm_space_data(C); PointerRNA spaceptr; @@ -104,11 +103,6 @@ static void nla_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); - if (scene->flag & SCE_NLA_EDIT_ON) - uiItemO(layout, NULL, 0, "NLA_OT_tweakmode_exit"); - else - uiItemO(layout, NULL, 0, "NLA_OT_tweakmode_enter"); - uiItemS(layout); uiItemO(layout, NULL, 0, "ANIM_OT_previewrange_set"); @@ -153,6 +147,8 @@ static void nla_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused) static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused) { + Scene *scene= CTX_data_scene(C); + uiItemMenuF(layout, "Transform", 0, nla_edit_transformmenu); uiItemMenuF(layout, "Snap", 0, nla_edit_snapmenu); @@ -160,9 +156,6 @@ static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemO(layout, NULL, 0, "NLA_OT_duplicate"); uiItemO(layout, NULL, 0, "NLA_OT_split"); - - uiItemS(layout); - uiItemO(layout, NULL, 0, "NLA_OT_delete"); uiItemS(layout); @@ -178,6 +171,14 @@ static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemO(layout, NULL, 0, "NLA_OT_move_up"); uiItemO(layout, NULL, 0, "NLA_OT_move_down"); + + uiItemS(layout); + + // TODO: names of these tools for 'tweakmode' need changing? + if (scene->flag & SCE_NLA_EDIT_ON) + uiItemO(layout, "Stop Tweaking Strip Actions", 0, "NLA_OT_tweakmode_exit"); + else + uiItemO(layout, "Start Tweaking Strip Actions", 0, "NLA_OT_tweakmode_enter"); } static void nla_addmenu(bContext *C, uiLayout *layout, void *arg_unused) -- cgit v1.2.3 From 345be5cbbc8c78228b2ded7c2dcb7278c38631b1 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 12 Jul 2009 07:28:25 +0000 Subject: 2.5 - Tweaks for Split Strips in NLA and Graph Editor view ranges * Split strips now uses the current frame as the splitting-point for selected strips if the current frame falls within in the bounds of the strip. Otherwise, the code defaults to splitting by the midpoints of the strips. * Time-range for Graph Editor is saner now when there is only a single keyframe or none at all. --- source/blender/editors/space_graph/space_graph.c | 10 ++-- source/blender/editors/space_nla/nla_edit.c | 59 +++++++++++++++--------- 2 files changed, 44 insertions(+), 25 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index a5578e88076..c36d790f0be 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -68,14 +68,16 @@ ARegion *graph_has_buttons_region(ScrArea *sa) { ARegion *ar, *arnew; - for(ar= sa->regionbase.first; ar; ar= ar->next) + for (ar= sa->regionbase.first; ar; ar= ar->next) { if(ar->regiontype==RGN_TYPE_UI) return ar; + } /* add subdiv level; after main window */ - for(ar= sa->regionbase.first; ar; ar= ar->next) + for (ar= sa->regionbase.first; ar; ar= ar->next) { if(ar->regiontype==RGN_TYPE_WINDOW) break; + } /* is error! */ if(ar==NULL) return NULL; @@ -246,7 +248,9 @@ static void graph_main_area_draw(const bContext *C, ARegion *ar) /* XXX the slow way to set tot rect... but for nice sliders needed (ton) */ get_graph_keyframe_extents(&ac, &v2d->tot.xmin, &v2d->tot.xmax, &v2d->tot.ymin, &v2d->tot.ymax); - + /* extra offset so that these items are visible */ + v2d->tot.xmin -= 10.0f; + v2d->tot.xmax += 10.0f; } /* only free grid after drawing data, as we need to use it to determine sampling rate */ diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 9ddd8daab0d..01871d3d9d5 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -747,25 +747,37 @@ void NLA_OT_delete (wmOperatorType *ot) // - variable-length splits? /* split a given Action-Clip strip */ -static void nlaedit_split_strip_actclip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip) +static void nlaedit_split_strip_actclip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, float cfra) { NlaStrip *nstrip; - float midframe, midaframe, len; + float splitframe, splitaframe; - /* calculate the frames to do the splitting at */ - /* strip extents */ - len= strip->end - strip->start; - if (IS_EQ(len, 0.0f)) - return; - else - midframe= strip->start + (len / 2.0f); - - /* action range */ - len= strip->actend - strip->actstart; - if (IS_EQ(len, 0.0f)) - midaframe= strip->actend; - else - midaframe= strip->actstart + (len / 2.0f); + /* calculate the frames to do the splitting at + * - use current frame if within extents of strip + */ + if ((cfra > strip->start) && (cfra < strip->end)) { + /* use the current frame */ + splitframe= cfra; + splitaframe= nlastrip_get_frame(strip, cfra, NLATIME_CONVERT_UNMAP); + } + else { + /* split in the middle */ + float len; + + /* strip extents */ + len= strip->end - strip->start; + if (IS_EQ(len, 0.0f)) + return; + else + splitframe= strip->start + (len / 2.0f); + + /* action range */ + len= strip->actend - strip->actstart; + if (IS_EQ(len, 0.0f)) + splitaframe= strip->actend; + else + splitaframe= strip->actstart + (len / 2.0f); + } /* make a copy (assume that this is possible) and append * it immediately after the current strip @@ -774,13 +786,16 @@ static void nlaedit_split_strip_actclip (AnimData *adt, NlaTrack *nlt, NlaStrip BLI_insertlinkafter(&nlt->strips, strip, nstrip); /* set the endpoint of the first strip and the start of the new strip - * to the midframe values calculated above + * to the splitframe values calculated above */ - strip->end= midframe; - nstrip->start= midframe; + strip->end= splitframe; + nstrip->start= splitframe; - strip->actend= midaframe; - nstrip->actstart= midaframe; + if ((splitaframe > strip->actstart) && (splitaframe < strip->actend)) { + /* only do this if we're splitting down the middle... */ + strip->actend= splitaframe; + nstrip->actstart= splitaframe; + } /* clear the active flag from the copy */ nstrip->flag &= ~NLASTRIP_FLAG_ACTIVE; @@ -828,7 +843,7 @@ static int nlaedit_split_exec (bContext *C, wmOperator *op) /* splitting method depends on the type of strip */ switch (strip->type) { case NLASTRIP_TYPE_CLIP: /* action-clip */ - nlaedit_split_strip_actclip(adt, nlt, strip); + nlaedit_split_strip_actclip(adt, nlt, strip, (float)ac.scene->r.cfra); break; case NLASTRIP_TYPE_META: /* meta-strips need special handling */ -- cgit v1.2.3 From ba1082444efae1085bd01f240958bc9fceb826a5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 12 Jul 2009 07:37:25 +0000 Subject: made text editor margin work with different font sizes. also made it draw the width needed, was fixed at 4. --- source/blender/editors/space_text/text_draw.c | 31 ++++++++++++------------- source/blender/editors/space_text/text_intern.h | 2 +- source/blender/makesdna/DNA_space_types.h | 2 +- 3 files changed, 17 insertions(+), 18 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index adba7ef100a..9f8cedd569f 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1300,15 +1300,23 @@ void draw_text_main(SpaceText *st, ARegion *ar) linecount++; } + text_font_begin(st); + st->cwidth= BLF_fixed_width(); + st->cwidth= MAX2(st->cwidth, 1); + /* draw line numbers background */ if(st->showlinenrs) { + st->linenrs_tot = (int)floor(log10((float)(linecount + st->viewlines))) + 1; + x= TXT_OFFSET + TEXTXLOC; + UI_ThemeColor(TH_GRID); - glRecti(23, 0, (st->lheight==15)? 63: 59, ar->winy - 2); + glRecti((TXT_OFFSET-12), 0, (TXT_OFFSET-5) + TEXTXLOC, ar->winy - 2); } - - text_font_begin(st); - st->cwidth= BLF_fixed_width(); - st->cwidth= MAX2(st->cwidth, 1); + else { + st->linenrs_tot= 0; /* not used */ + x= TXT_OFFSET; + } + y= ar->winy-st->lheight; /* draw cursor */ draw_cursor(st, ar); @@ -1316,9 +1324,6 @@ void draw_text_main(SpaceText *st, ARegion *ar) /* draw the text */ UI_ThemeColor(TH_TEXT); - y= ar->winy-st->lheight; - x= (st->showlinenrs)? TXT_OFFSET + TEXTXLOC: TXT_OFFSET; - for(i=0; y>0 && iviewlines && tmp; i++, tmp= tmp->next) { if(st->showsyntax && !tmp->format) txt_format_line(st, tmp, 0); @@ -1330,14 +1335,8 @@ void draw_text_main(SpaceText *st, ARegion *ar) else UI_ThemeColor(TH_TEXT); - if(((float)(i + linecount + 1)/10000.0) < 1.0) { - sprintf(linenr, "%4d", i + linecount + 1); - text_font_draw(st, TXT_OFFSET - 7, y, linenr); - } - else { - sprintf(linenr, "%5d", i + linecount + 1); - text_font_draw(st, TXT_OFFSET - 11, y, linenr); - } + sprintf(linenr, "%d", i + linecount + 1); + text_font_draw(st, TXT_OFFSET - 7, y, linenr); UI_ThemeColor(TH_TEXT); } diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index 5ea33e1660d..cb425274fc0 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -58,7 +58,7 @@ void text_update_edited(struct Text *text); void text_update_character_width(struct SpaceText *st); void text_update_cursor_moved(struct SpaceText *st, struct ARegion *ar); -#define TEXTXLOC 38 +#define TEXTXLOC (st->cwidth * st->linenrs_tot) #define SUGG_LIST_SIZE 7 #define SUGG_LIST_WIDTH 20 diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 951b12b82fe..cc6987084d0 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -294,7 +294,7 @@ typedef struct SpaceText { short flags, menunr; short lheight; /* user preference */ - short cwidth; /* runtime computed */ + char cwidth, linenrs_tot; /* runtime computed, character width and the number of chars to use when showing line numbers */ int left; int showlinenrs; int tabnumber; -- cgit v1.2.3 From 2940384d9a8e3601e2ceefbf0487ce781a3b10f7 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Sun, 12 Jul 2009 08:12:22 +0000 Subject: 2.5 file browser * bugfix: adding back adding the region on read of old files * tweak: buttons for increment/decrement file number now have icons and size adjusted to UI_UNIT_X/UI_UNIT_Y --- source/blender/blenloader/intern/readfile.c | 11 +++++++++++ source/blender/editors/interface/interface_handlers.c | 2 +- source/blender/editors/space_file/file_draw.c | 8 ++++---- 3 files changed, 16 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 846e54526b8..479fa760423 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5677,6 +5677,17 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) /* temporarily hide it */ ar->flag = RGN_FLAG_HIDDEN; break; + case SPACE_FILE: + ar= MEM_callocN(sizeof(ARegion), "nodetree area for node"); + BLI_addtail(lb, ar); + ar->regiontype= RGN_TYPE_CHANNELS; + ar->alignment= RGN_ALIGN_LEFT; + + ar= MEM_callocN(sizeof(ARegion), "ui area for file"); + BLI_addtail(lb, ar); + ar->regiontype= RGN_TYPE_UI; + ar->alignment= RGN_ALIGN_TOP; + break; #if 0 case SPACE_BUTS: /* context UI region */ diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 10e495cde94..0693a771ffa 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3480,7 +3480,7 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA data= MEM_callocN(sizeof(uiHandleButtonData), "uiHandleButtonData"); data->window= CTX_wm_window(C); data->region= ar; - if( ELEM3(but->type, BUT_CURVE, SEARCH_MENU, TEX) ); // XXX curve is temp + if( ELEM(but->type, BUT_CURVE, SEARCH_MENU) ); // XXX curve is temp else data->interactive= 1; data->state = BUTTON_STATE_INIT; diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index f1f20a36b59..e107bcecb3b 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -137,8 +137,8 @@ void file_draw_buttons(const bContext *C, ARegion *ar) const short line2_y = ar->winy - IMASEL_BUTTONS_HEIGHT - 12; const short line1_y = line2_y + IMASEL_BUTTONS_HEIGHT/2 + 4; const short input_minw = 20; - const short btn_h = 21; - const short btn_fn_w = 14; + const short btn_h = UI_UNIT_Y; + const short btn_fn_w = UI_UNIT_X; const short btn_minw = 80; const short btn_margin = 20; const short separator = 4; @@ -200,13 +200,13 @@ void file_draw_buttons(const bContext *C, ARegion *ar) /* Filename number increment / decrement buttons. */ if (fnumbuttons) { uiBlockBeginAlign(block); - but = uiDefButO(block, BUT, "FILE_OT_filenum", 0, "-", + but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMOUT, min_x + line2_w + separator, line2_y, btn_fn_w, btn_h, "Decrement the filename number."); RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", -1); - but = uiDefButO(block, BUT, "FILE_OT_filenum", 0, "+", + but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMIN, min_x + line2_w + separator + btn_fn_w, line2_y, btn_fn_w, btn_h, "Increment the filename number."); -- cgit v1.2.3 From 184dca5396ee0de4535523c66d19f896cfb7a939 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Sun, 12 Jul 2009 09:03:09 +0000 Subject: 2.5 file browser * tweak for autocomplete, only update live if live_update and TAB key is hit. (Brecht, please check if it's ok, otherwise will revert and we'll find another way) * adding slash at the end of directory to allow for faster autocomplete * bugfix: directory name buton had wrong length --- source/blender/editors/interface/interface_handlers.c | 5 +++-- source/blender/editors/space_file/file_draw.c | 2 +- source/blender/editors/space_file/filesel.c | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 0693a771ffa..0fbfeffba0d 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1438,7 +1438,7 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, wmEvent *event) { - int mx, my, changed= 0, inbox=0, retval= WM_UI_HANDLER_CONTINUE; + int mx, my, changed= 0, inbox=0, update= 0, retval= WM_UI_HANDLER_CONTINUE; switch(event->type) { case WHEELUPMOUSE: @@ -1553,6 +1553,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle /* there is a key conflict here, we can't tab with autocomplete */ if(but->autocomplete_func || data->searchbox) { changed= ui_textedit_autocomplete(C, but, data); + update= 1; /* do live update for tab key */ retval= WM_UI_HANDLER_BREAK; } /* the hotkey here is not well defined, was G.qual so we check all */ @@ -1576,7 +1577,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle if(changed) { /* never update while typing for now */ - if(0/*data->interactive*/) ui_apply_button(C, block, but, data, 1); + if(update && data->interactive) ui_apply_button(C, block, but, data, 1); else ui_check_but(but); if(data->searchbox) diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index e107bcecb3b..339ebe27fcd 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -188,7 +188,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) if (available_w > 0) { but = uiDefBut(block, TEX, B_FS_DIRNAME, "", min_x, line1_y, line1_w, btn_h, - params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, + params->dir, 0.0, (float)FILE_MAXDIR-1, 0, 0, "File path."); uiButSetCompleteFunc(but, autocomplete_directory, NULL); uiDefBut(block, TEX, B_FS_FILENAME, "", diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index d34eb29a78d..c81dab454f8 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -354,5 +354,8 @@ void autocomplete_directory(struct bContext *C, char *str, void *arg_v) } } autocomplete_end(autocpl, str); + if (BLI_exists(str)) { + BLI_add_slash(str); + } } } \ No newline at end of file -- cgit v1.2.3 From 78703a9ef8983ce513c1d428ba947dfbe1a58f97 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 12 Jul 2009 12:47:34 +0000 Subject: python console in ~80 lines Shift+Enter in the text editor executes the TEXT_OT_line_console operator defined in space_text.py The operator's class stores a namespace for each text block. Eventually this should have its own input rather then using the text editor. Tested with py3.1 and 2.6 TEXT_OT_insert was only using the first char from a string, added support for inserting strings. --- source/blender/editors/space_text/space_text.c | 4 ++++ source/blender/editors/space_text/text_ops.c | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 8759fd00f74..5d3da461f71 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -285,6 +285,10 @@ static void text_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "TEXT_OT_to_3d_object", MKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_line_break", RETKEY, KM_PRESS, 0, 0); +#ifndef DISABLE_PYTHON + WM_keymap_add_item(keymap, "TEXT_OT_line_console", RETKEY, KM_PRESS, KM_SHIFT, 0); /* python operator - space_text.py */ +#endif + WM_keymap_add_item(keymap, "TEXT_OT_line_number", KM_TEXTINPUT, KM_ANY, KM_ANY, 0); WM_keymap_add_item(keymap, "TEXT_OT_insert", KM_TEXTINPUT, KM_ANY, KM_ANY, 0); // last! } diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index f9485f17bdc..e6d97071ef5 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -248,8 +248,6 @@ static int reload_exec(bContext *C, wmOperator *op) #ifndef DISABLE_PYTHON if(text->compiled) BPY_free_compiled_text(text); - - text->compiled = NULL; #endif text_update_edited(text); @@ -2229,19 +2227,21 @@ static int insert_exec(bContext *C, wmOperator *op) SpaceText *st= CTX_wm_space_text(C); Text *text= CTX_data_edit_text(C); char *str; - int done, ascii; + int done = 0, i; str= RNA_string_get_alloc(op->ptr, "text", NULL, 0); - ascii= str[0]; - MEM_freeN(str); - if(!ascii) - return OPERATOR_CANCELLED; + if(st && st->overwrite) { + for(i=0; str[i]; i++) { + done |= txt_replace_char(text, str[i]); + } + } else { + for(i=0; str[i]; i++) { + done |= txt_add_char(text, str[i]); + } + } - if(st && st->overwrite) - done= txt_replace_char(text, ascii); - else - done= txt_add_char(text, ascii); + MEM_freeN(str); if(!done) return OPERATOR_CANCELLED; @@ -2273,7 +2273,7 @@ static int insert_invoke(bContext *C, wmOperator *op, wmEvent *event) /* run the script while editing, evil but useful */ if(ret==OPERATOR_FINISHED && CTX_wm_space_text(C)->live_edit) run_script_exec(C, op); - + return ret; } -- cgit v1.2.3 From 5f8f2fc33a2f2fd363be16a36d14fa3b3f1ad78a Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Sun, 12 Jul 2009 13:06:52 +0000 Subject: 2.5 filebrowser * bugfix: parent on linux didn't account for first slash * added some BLI_cleanup_dir to prevent weird directory names * revert to old directory if user types bogus text. --- source/blender/blenlib/intern/util.c | 2 +- source/blender/editors/space_file/file_ops.c | 2 ++ source/blender/editors/space_file/filesel.c | 18 +++++++++++------- 3 files changed, 14 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index a236defc515..78a4599b3b3 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -502,7 +502,7 @@ int BLI_has_parent(char *path) BLI_add_slash(path); len = strlen(path)-1; - while (len) { + while (len>=0) { if ((path[len] == '\\') || (path[len] == '/')) slashes++; len--; diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 8f1d2598c61..0d36bac7505 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -559,6 +559,7 @@ int file_parent_exec(bContext *C, wmOperator *unused) if(sfile->params) { if (BLI_has_parent(sfile->params->dir)) { BLI_parent_dir(sfile->params->dir); + BLI_cleanup_dir(G.sce, sfile->params->dir); file_change_dir(sfile); WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); } @@ -724,6 +725,7 @@ int file_directory_exec(bContext *C, wmOperator *unused) if (sfile->params->dir[0] == '\0') get_default_root(sfile->params->dir); #endif + BLI_cleanup_dir(G.sce, sfile->params->dir); BLI_add_slash(sfile->params->dir); file_change_dir(sfile); WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index c81dab454f8..30712ea0b07 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -301,16 +301,20 @@ FileLayout* ED_fileselect_get_layout(struct SpaceFile *sfile, struct ARegion *ar void file_change_dir(struct SpaceFile *sfile) { - if (sfile->params && BLI_exists(sfile->params->dir)) { - filelist_setdir(sfile->files, sfile->params->dir); + if (sfile->params) { + if (BLI_exists(sfile->params->dir)) { + filelist_setdir(sfile->files, sfile->params->dir); - if(folderlist_clear_next(sfile)) - folderlist_free(sfile->folders_next); + if(folderlist_clear_next(sfile)) + folderlist_free(sfile->folders_next); - folderlist_pushdir(sfile->folders_prev, sfile->params->dir); + folderlist_pushdir(sfile->folders_prev, sfile->params->dir); - filelist_free(sfile->files); - sfile->params->active_file = -1; + filelist_free(sfile->files); + sfile->params->active_file = -1; + } else { + BLI_strncpy(sfile->params->dir, filelist_dir(sfile->files), FILE_MAX); + } } } -- cgit v1.2.3 From 6fb0181b50461b529bb960950870de941711041e Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sun, 12 Jul 2009 23:38:47 +0000 Subject: Keyed physics refresh: - Keyed targets in one list instead of "chaining", this opens up many more possibilities than before and is much less obscure. - Better keyed timing possibilities (time & duration in frames). - Looping over keyed targets list. Other changes: - New child setting "length" with threshold (great for guard & underfur with a single particle system) - Modularization of path interpolation code. - Cleared "animateable" flags from many particle settings that shouldn't be animateable. Fixes: - Keyed particles weren't copied properly (ancient bug). - Hair rotations depended on global z-axis for root rotation so downward facing strands could flip rotation randomly. Now initial hair rotation is derived from face dependent hair matrix. (This caused for example ugly flipping of child strands on some cases). - Children from faces weren't calculated straight after activating them. - Multiple disk cache fixes: * Disk cache didn't work correctly with frame steps. * Conversion from memory cache to disk cache didn't work with cloth. * Disk cache crashed on some frames trying to close an already closed cache file. * Trails didn't work with disk cached particles. - Child rough effects were effected by emitter object loc/rot making them next to useless with animation, why didn't anybody tell me this!! - Lots of random code cleanup. --- source/blender/blenkernel/BKE_particle.h | 5 +- source/blender/blenkernel/intern/depsgraph.c | 15 +- source/blender/blenkernel/intern/object.c | 26 +- source/blender/blenkernel/intern/particle.c | 669 +++++++++++---------- source/blender/blenkernel/intern/particle_system.c | 279 +++++---- source/blender/blenkernel/intern/pointcache.c | 36 +- source/blender/blenloader/intern/readfile.c | 13 +- source/blender/blenloader/intern/writefile.c | 5 + .../blender/editors/space_buttons/buttons_intern.h | 4 + source/blender/editors/space_buttons/buttons_ops.c | 204 ++++++- .../blender/editors/space_buttons/space_buttons.c | 4 + source/blender/editors/space_view3d/drawobject.c | 32 +- source/blender/makesdna/DNA_particle_types.h | 38 +- source/blender/makesrna/RNA_access.h | 1 + source/blender/makesrna/intern/rna_particle.c | 325 +++++++--- .../blender/render/intern/source/convertblender.c | 20 +- 16 files changed, 1044 insertions(+), 632 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index aa24706077d..bb0b905b8e3 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -260,7 +260,6 @@ void psys_flush_particle_settings(struct Scene *scene, struct ParticleSettings * void make_local_particlesettings(struct ParticleSettings *part); struct LinkNode *psys_using_settings(struct Scene *scene, struct ParticleSettings *part, int flush_update); -void psys_changed_type(struct ParticleSystem *psys); void psys_reset(struct ParticleSystem *psys, int mode); void psys_find_parents(struct Object *ob, struct ParticleSystemModifierData *psmd, struct ParticleSystem *psys); @@ -289,12 +288,14 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3], float zvec[3], float center[3]); /* particle_system.c */ -int psys_count_keyed_targets(struct Object *ob, struct ParticleSystem *psys); +void psys_count_keyed_targets(struct Object *ob, struct ParticleSystem *psys); void psys_get_reactor_target(struct Object *ob, struct ParticleSystem *psys, struct Object **target_ob, struct ParticleSystem **target_psys); void psys_init_effectors(struct Scene *scene, struct Object *obsrc, struct Group *group, struct ParticleSystem *psys); void psys_end_effectors(struct ParticleSystem *psys); +void psys_make_temp_pointcache(struct Object *ob, struct ParticleSystem *psys); +void psys_end_temp_pointcache(struct ParticleSystem *psys); void psys_get_pointcache_start_end(struct Scene *scene, struct ParticleSystem *psys, int *sfra, int *efra); void particle_system_update(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys); diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index de036e25d82..f52eec34cc7 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -562,10 +562,17 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O if(!psys_check_enabled(ob, psys)) continue; - if(part->phystype==PART_PHYS_KEYED && psys->keyed_ob && - BLI_findlink(&psys->keyed_ob->particlesystem,psys->keyed_psys-1)) { - node2 = dag_get_node(dag, psys->keyed_ob); - dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA, "Particle Keyed Physics"); + if(part->phystype==PART_PHYS_KEYED) { + KeyedParticleTarget *kpt = psys->keyed_targets.first; + + for(; kpt; kpt=kpt->next) { + if(kpt->ob && BLI_findlink(&kpt->ob->particlesystem, kpt->psys-1)) { + node2 = dag_get_node(dag, kpt->ob); + dag_add_relation(dag, node2, node, DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Particle Keyed Physics"); + } + else + break; + } } if(part->ren_as == PART_DRAW_OB && part->dup_ob) { diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 6490ff3c724..7d6a83d7900 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -427,17 +427,14 @@ void unlink_object(Scene *scene, Object *ob) if(obt->particlesystem.first) { ParticleSystem *tpsys= obt->particlesystem.first; for(; tpsys; tpsys=tpsys->next) { - if(tpsys->keyed_ob==ob) { - ParticleSystem *psys= BLI_findlink(&ob->particlesystem,tpsys->keyed_psys-1); - - if(psys && psys->keyed_ob) { - tpsys->keyed_ob= psys->keyed_ob; - tpsys->keyed_psys= psys->keyed_psys; + KeyedParticleTarget *kpt = tpsys->keyed_targets.first; + for(; kpt; kpt=kpt->next) { + if(kpt->ob==ob) { + BLI_remlink(&tpsys->keyed_targets, kpt); + MEM_freeN(kpt); + obt->recalc |= OB_RECALC_DATA; + break; } - else - tpsys->keyed_ob= NULL; - - obt->recalc |= OB_RECALC_DATA; } if(tpsys->target_ob==ob) { @@ -1050,18 +1047,23 @@ ParticleSystem *copy_particlesystem(ParticleSystem *psys) psysn= MEM_dupallocN(psys); psysn->particles= MEM_dupallocN(psys->particles); psysn->child= MEM_dupallocN(psys->child); + if(psysn->particles->keys) + psysn->particles->keys = MEM_dupallocN(psys->particles->keys); for(a=0, pa=psysn->particles; atotpart; a++, pa++) { if(pa->hair) pa->hair= MEM_dupallocN(pa->hair); - if(pa->keys) - pa->keys= MEM_dupallocN(pa->keys); + if(a) + pa->keys= (pa-1)->keys + (pa-1)->totkey; } if(psys->soft) { psysn->soft= copy_softbody(psys->soft); psysn->soft->particles = psysn; } + + if(psys->keyed_targets.first) + BLI_duplicatelist(&psysn->keyed_targets, &psys->keyed_targets); psysn->pathcache= NULL; psysn->childcache= NULL; diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 4488f8cdffd..cefeafcdd50 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -84,7 +84,8 @@ static void get_cpa_texture(DerivedMesh *dm, Material *ma, int face_index, static void get_child_modifier_parameters(ParticleSettings *part, ParticleThreadContext *ctx, ChildParticle *cpa, short cpa_from, int cpa_num, float *cpa_fuv, float *orco, ParticleTexture *ptex); static void do_child_modifiers(Scene *scene, Object *ob, ParticleSystem *psys, ParticleSettings *part, - ParticleTexture *ptex, ParticleKey *par, float *par_rot, ChildParticle *cpa, float *orco, ParticleKey *state, float t); + ParticleTexture *ptex, ParticleKey *par, float *par_rot, ChildParticle *cpa, + float *orco, float mat[4][4], ParticleKey *state, float t); /* few helpers for countall etc. */ int count_particles(ParticleSystem *psys){ @@ -478,10 +479,16 @@ void psys_free(Object *ob, ParticleSystem * psys) if(psys->pointcache) BKE_ptcache_free(psys->pointcache); + if(psys->keyed_targets.first) + BLI_freelistN(&psys->keyed_targets); + MEM_freeN(psys); } } +/************************************************/ +/* Rendering */ +/************************************************/ /* these functions move away particle data and bring it back after * rendering, to make different render settings possible without * removing the previous data. this should be solved properly once */ @@ -889,7 +896,7 @@ int psys_render_simplify_params(ParticleSystem *psys, ChildParticle *cpa, float } /************************************************/ -/* Interpolated Particles */ +/* Interpolation */ /************************************************/ static float interpolate_particle_value(float v1, float v2, float v3, float v4, float *w, int four) { @@ -938,6 +945,214 @@ void psys_interpolate_particle(short type, ParticleKey keys[4], float dt, Partic +typedef struct ParticleInterpolationData { + ParticleKey *kkey[2]; + HairKey *hkey[2]; + BodyPoint *bp[2]; + SoftBody *soft; + int keyed, cached; + float birthtime, dietime; +} ParticleInterpolationData; +/* Assumes pointcache->mem_cache exists, so for disk cached particles call psys_make_temp_pointcache() before use */ +static void get_pointcache_keys_for_time(Object *ob, ParticleSystem *psys, int index, float t, ParticleKey *key1, ParticleKey *key2) +{ + PointCache *cache = psys->pointcache; + static PTCacheMem *pm = NULL; /* not thread safe */ + + if(index < 0) { /* initialize */ + pm = cache->mem_cache.first; + + if(pm) + pm = pm->next; + } + else { + if(pm) { + while(pm && pm->next && (float)pm->frame < t) + pm = pm->next; + + copy_particle_key(key2, ((ParticleKey *)pm->data) + index, 1); + copy_particle_key(key1, ((ParticleKey *)(pm->prev)->data) + index, 1); + } + else if(cache->mem_cache.first) { + PTCacheMem *pm2 = cache->mem_cache.first; + copy_particle_key(key2, ((ParticleKey *)pm2->data) + index, 1); + copy_particle_key(key1, ((ParticleKey *)pm2->data) + index, 1); + } + } +} +static void init_particle_interpolation(Object *ob, ParticleSystem *psys, ParticleData *pa, ParticleInterpolationData *pind) +{ + + if(pind->keyed) { + pind->kkey[0] = pa->keys; + + if(pa->totkey > 1) + pind->kkey[1] = pa->keys + 1; + else + pind->kkey[1] = NULL; + + pind->birthtime = pa->keys->time; + pind->dietime = (pa->keys + pa->totkey - 1)->time; + } + else if(pind->cached) { + get_pointcache_keys_for_time(ob, psys, -1, 0.0f, NULL, NULL); + + pind->birthtime = pa->time; + pind->dietime = pa->dietime; + } + else { + pind->hkey[0] = pa->hair; + pind->hkey[1] = pa->hair + 1; + + pind->birthtime = pa->hair->time; + pind->dietime = (pa->hair + pa->totkey - 1)->time; + } + + if(pind->soft) { + pind->bp[0] = pind->soft->bpoint + pa->bpi; + pind->bp[1] = pind->soft->bpoint + pa->bpi + 1; + } +} +static void hair_to_particle(ParticleKey *key, HairKey *hkey) +{ + VECCOPY(key->co, hkey->co); + key->time = hkey->time; +} +static void bp_to_particle(ParticleKey *key, BodyPoint *bp, HairKey *hkey) +{ + VECCOPY(key->co, bp->pos); + key->time = hkey->time; +} + +static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData *pa, float t, float frs_sec, ParticleInterpolationData *pind, ParticleKey *result) +{ + ParticleKey keys[4]; + float real_t, dfra, keytime; + + /* interpret timing and find keys */ + if(pind->keyed) { + /* we have only one key, so let's use that */ + if(pind->kkey[1]==NULL) { + copy_particle_key(result, pind->kkey[0], 1); + return; + } + + if(result->time < 0.0f) + real_t = -result->time; + else + real_t = pind->kkey[0]->time + t * (pind->kkey[0][pa->totkey-1].time - pind->kkey[0]->time); + + if(psys->part->phystype==PART_PHYS_KEYED && psys->flag & PSYS_KEYED_TIMING) { + KeyedParticleTarget *kpt = psys->keyed_targets.first; + + kpt=kpt->next; + + while(kpt && pa->time + kpt->time < real_t) + kpt= kpt->next; + + if(kpt) { + kpt=kpt->prev; + + if(pa->time + kpt->time + kpt->duration > real_t) + real_t = pa->time + kpt->time; + } + else + real_t = pa->time + ((KeyedParticleTarget*)psys->keyed_targets.last)->time; + } + + CLAMP(real_t, pa->time, pa->dietime); + + while(pind->kkey[1]->time < real_t) + pind->kkey[1]++; + + pind->kkey[0] = pind->kkey[1] - 1; + } + else if(pind->cached) { + if(result->time < 0.0f) /* flag for time in frames */ + real_t = -result->time; + else + real_t = pa->time + t * (pa->dietime - pa->time); + } + else { + if(result->time < 0.0f) + real_t = -result->time; + else + real_t = pind->hkey[0]->time + t * (pind->hkey[0][pa->totkey-1].time - pind->hkey[0]->time); + + while(pind->hkey[1]->time < real_t) { + pind->hkey[1]++; + pind->bp[1]++; + } + + pind->hkey[0] = pind->hkey[1] - 1; + } + + /* set actual interpolation keys */ + if(pind->soft) { + pind->bp[0] = pind->bp[1] - 1; + bp_to_particle(keys + 1, pind->bp[0], pind->hkey[0]); + bp_to_particle(keys + 2, pind->bp[1], pind->hkey[1]); + } + else if(pind->keyed) { + memcpy(keys + 1, pind->kkey[0], sizeof(ParticleKey)); + memcpy(keys + 2, pind->kkey[1], sizeof(ParticleKey)); + } + else if(pind->cached) { + get_pointcache_keys_for_time(NULL, psys, p, real_t, keys+1, keys+2); + } + else { + hair_to_particle(keys + 1, pind->hkey[0]); + hair_to_particle(keys + 2, pind->hkey[1]); + } + + /* set secondary interpolation keys for hair */ + if(!pind->keyed && !pind->cached) { + if(pind->soft) { + if(pind->hkey[0] != pa->hair) + bp_to_particle(keys, pind->bp[0] - 1, pind->hkey[0] - 1); + else + bp_to_particle(keys, pind->bp[0], pind->hkey[0]); + } + else { + if(pind->hkey[0] != pa->hair) + hair_to_particle(keys, pind->hkey[0] - 1); + else + hair_to_particle(keys, pind->hkey[0]); + } + + if(pind->soft) { + if(pind->hkey[1] != pa->hair + pa->totkey - 1) + bp_to_particle(keys + 3, pind->bp[1] + 1, pind->hkey[1] + 1); + else + bp_to_particle(keys + 3, pind->bp[1], pind->hkey[1]); + } + else { + if(pind->hkey[1] != pa->hair + pa->totkey - 1) + hair_to_particle(keys + 3, pind->hkey[1] + 1); + else + hair_to_particle(keys + 3, pind->hkey[1]); + } + } + + dfra = keys[2].time - keys[1].time; + keytime = (real_t - keys[1].time) / dfra; + + /* convert velocity to timestep size */ + if(pind->keyed || pind->cached){ + VecMulf(keys[1].vel, dfra / frs_sec); + VecMulf(keys[2].vel, dfra / frs_sec); + QuatInterpol(result->rot,keys[1].rot,keys[2].rot,keytime); + } + + /* now we should have in chronologiacl order k1<=k2<=t<=k3<=k4 with keytime between [0,1]->[k2,k3] (k1 & k4 used for cardinal & bspline interpolation)*/ + psys_interpolate_particle((pind->keyed || pind->cached) ? -1 /* signal for cubic interpolation */ + : ((psys->part->flag & PART_HAIR_BSPLINE) ? KEY_BSPLINE : KEY_CARDINAL) + ,keys, keytime, result, 1); + + /* the velocity needs to be converted back from cubic interpolation */ + if(pind->keyed || pind->cached) + VecMulf(result->vel, frs_sec / dfra); +} /************************************************/ /* Particles on a dm */ /************************************************/ @@ -1438,16 +1653,6 @@ void psys_particle_on_emitter(ParticleSystemModifierData *psmd, int from, int in /************************************************/ /* Path Cache */ /************************************************/ -static void hair_to_particle(ParticleKey *key, HairKey *hkey) -{ - VECCOPY(key->co, hkey->co); - key->time = hkey->time; -} -static void bp_to_particle(ParticleKey *key, BodyPoint *bp, HairKey *hkey) -{ - VECCOPY(key->co, bp->pos); - key->time = hkey->time; -} static float vert_weight(MDeformVert *dvert, int group) { MDeformWeight *dw; @@ -1734,7 +1939,7 @@ int do_guide(Scene *scene, ParticleKey *state, int pa_num, float time, ListBase } return 0; } -static void do_rough(float *loc, float t, float fac, float size, float thres, ParticleKey *state) +static void do_rough(float *loc, float mat[4][4], float t, float fac, float size, float thres, ParticleKey *state) { float rough[3]; float rco[3]; @@ -1747,32 +1952,24 @@ static void do_rough(float *loc, float t, float fac, float size, float thres, Pa rough[0]=-1.0f+2.0f*BLI_gTurbulence(size, rco[0], rco[1], rco[2], 2,0,2); rough[1]=-1.0f+2.0f*BLI_gTurbulence(size, rco[1], rco[2], rco[0], 2,0,2); rough[2]=-1.0f+2.0f*BLI_gTurbulence(size, rco[2], rco[0], rco[1], 2,0,2); - VECADDFAC(state->co,state->co,rough,fac); + + VECADDFAC(state->co,state->co,mat[0],fac*rough[0]); + VECADDFAC(state->co,state->co,mat[1],fac*rough[1]); + VECADDFAC(state->co,state->co,mat[2],fac*rough[2]); } -static void do_rough_end(float *loc, float t, float fac, float shape, ParticleKey *state, ParticleKey *par) +static void do_rough_end(float *loc, float mat[4][4], float t, float fac, float shape, ParticleKey *state) { - float rough[3], rnor[3]; + float rough[2]; float roughfac; roughfac=fac*(float)pow((double)t,shape); VECCOPY(rough,loc); rough[0]=-1.0f+2.0f*rough[0]; rough[1]=-1.0f+2.0f*rough[1]; - rough[2]=-1.0f+2.0f*rough[2]; VecMulf(rough,roughfac); - - if(par){ - VECCOPY(rnor,par->vel); - } - else{ - VECCOPY(rnor,state->vel); - } - Normalize(rnor); - Projf(rnor,rough,rnor); - VECSUB(rough,rough,rnor); - - VECADD(state->co,state->co,rough); + VECADDFAC(state->co,state->co,mat[0],rough[0]); + VECADDFAC(state->co,state->co,mat[1],rough[1]); } static void do_path_effectors(Scene *scene, Object *ob, ParticleSystem *psys, int i, ParticleCacheKey *ca, int k, int steps, float *rootco, float effector, float dfra, float cfra, float *length, float *vec) { @@ -2007,7 +2204,7 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, ParticleData *pa=NULL; ParticleTexture ptex; float *cpa_fuv=0, *par_rot=0; - float co[3], orco[3], ornor[3], t, cpa_1st[3], dvec[3]; + float co[3], orco[3], ornor[3], hairmat[4][4], t, cpa_1st[3], dvec[3]; float branch_begin, branch_end, branch_prob, rough_rand; float length, max_length = 1.0f, cur_length = 0.0f; float eff_length, eff_vec[3]; @@ -2065,8 +2262,6 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, cpa_num = cpa->num; foffset= cpa->foffset; - if(part->childtype == PART_CHILD_FACES) - foffset = -(2.0f + part->childspread); cpa_fuv = cpa->fuv; cpa_from = PART_FROM_FACE; @@ -2078,6 +2273,10 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, Mat4MulVecfl(ob->obmat,cpa_1st); } + pa = psys->particles + cpa->parent; + + psys_mat_hair_to_global(ob, ctx->psmd->dm, psys->part->from, pa, hairmat); + pa=0; } else{ @@ -2099,6 +2298,8 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, cpa_fuv=pa->fuv; psys_particle_on_emitter(ctx->psmd,cpa_from,cpa_num,DMCACHE_ISCHILD,cpa_fuv,pa->foffset,co,ornor,0,0,orco,0); + + psys_mat_hair_to_global(ob, ctx->psmd->dm, psys->part->from, pa, hairmat); } keys->steps = ctx->steps; @@ -2190,7 +2391,7 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, } /* apply different deformations to the child path */ - do_child_modifiers(ctx->scene, ob, psys, part, &ptex, (ParticleKey *)par, par_rot, cpa, orco, (ParticleKey *)state, t); + do_child_modifiers(ctx->scene, ob, psys, part, &ptex, (ParticleKey *)par, par_rot, cpa, orco, hairmat, (ParticleKey *)state, t); /* TODO: better branching */ //if(part->flag & PART_BRANCHING && ctx->between == 0 && part->flag & PART_ANIM_BRANCHING) @@ -2247,20 +2448,12 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, /* check if path needs to be cut before actual end of data points */ if(k){ VECSUB(dvec,state->co,(state-1)->co); - if(part->flag&PART_ABS_LENGTH) - length=VecLength(dvec); - else - length=1.0f/(float)ctx->steps; - + length=1.0f/(float)ctx->steps; k=check_path_length(k,keys,state,max_length,&cur_length,length,dvec); } else{ /* initialize length calculation */ - if(part->flag&PART_ABS_LENGTH) - max_length= part->abslength*ptex.length; - else - max_length= ptex.length; - + max_length= ptex.length; cur_length= 0.0f; } @@ -2353,36 +2546,6 @@ void psys_cache_child_paths(Scene *scene, Object *ob, ParticleSystem *psys, floa psys_threads_free(pthreads); } -static void get_pointcache_keys_for_time(ParticleSystem *psys, int index, float t, ParticleKey *key1, ParticleKey *key2) -{ - PointCache *cache = psys->pointcache; - static PTCacheMem *pm = NULL; - - if(cache->flag & PTCACHE_DISK_CACHE) { - /* TODO */ - } - else { - if(index < 0) { /* initialize */ - pm = cache->mem_cache.first; - if(pm) - pm = pm->next; - } - else { - if(pm) { - while(pm && pm->next && (float)pm->frame < t) - pm = pm->next; - - copy_particle_key(key2, ((ParticleKey *)pm->data) + index, 1); - copy_particle_key(key1, ((ParticleKey *)(pm->prev)->data) + index, 1); - } - else if(cache->mem_cache.first) { - pm = cache->mem_cache.first; - copy_particle_key(key2, ((ParticleKey *)pm->data) + index, 1); - copy_particle_key(key1, ((ParticleKey *)pm->data) + index, 1); - } - } - } -} /* Calculates paths ready for drawing/rendering. */ /* -Usefull for making use of opengl vertex arrays for super fast strand drawing. */ /* -Makes child strands possible and creates them too into the cache. */ @@ -2395,7 +2558,7 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra ParticleSettings *part = psys->part; ParticleData *pa; - ParticleKey keys[4], result, *kkey[2] = {NULL, NULL}; + ParticleKey result, *kkey[2] = {NULL, NULL}; HairKey *hkey[2] = {NULL, NULL}; ParticleEdit *edit = 0; @@ -2405,11 +2568,14 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra BodyPoint *bp[2] = {NULL, NULL}; Material *ma; + + ParticleInterpolationData pind; float birthtime = 0.0, dietime = 0.0; float t, time = 0.0, keytime = 0.0, dfra = 1.0, frs_sec = scene->r.frs_sec; float col[4] = {0.5f, 0.5f, 0.5f, 1.0f}; float prev_tangent[3], hairmat[4][4]; + float rotmat[3][3]; int k,i; int steps = (int)pow(2.0, (double)psys->part->draw_step); int totpart = psys->totpart; @@ -2492,7 +2658,6 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra else memset(cache[i], 0, sizeof(*cache[i])*(steps+1)); if(!edit && !psys->totchild) { - //pa_length = part->length * (1.0f - part->randlength*pa->r_ave[0]); pa_length = 1.0f - part->randlength * 0.5 * (1.0f + pa->r_ave[0]); if(vg_length) pa_length *= psys_particle_value_from_verts(psmd->dm,part->from,pa,vg_length); @@ -2504,38 +2669,27 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra ekey = edit->keys[i]; /*--get the first data points--*/ - if(keyed) { - kkey[0] = pa->keys; - kkey[1] = kkey[0] + 1; + pind.keyed = keyed; + pind.cached = baked; + pind.soft = soft; + init_particle_interpolation(ob, psys, pa, &pind); - birthtime = kkey[0]->time; - dietime = kkey[0][pa->totkey-1].time; - } - else if(baked) { - get_pointcache_keys_for_time(psys, -1, 0.0f, NULL, NULL); - - birthtime = pa->time; - dietime = pa->dietime; - } - else { - hkey[0] = pa->hair; - hkey[1] = hkey[0] + 1; - birthtime = hkey[0]->time; - dietime = hkey[0][pa->totkey-1].time; - - psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat); - } + /* hairmat is needed for for non-hair particle too so we get proper rotations */ + psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat); + VECCOPY(rotmat[0], hairmat[2]); + VECCOPY(rotmat[1], hairmat[1]); + VECCOPY(rotmat[2], hairmat[0]); if(!edit) { if(part->draw & PART_ABS_PATH_TIME) { - birthtime = MAX2(birthtime, part->path_start); - dietime = MIN2(dietime, part->path_end); + birthtime = MAX2(pind.birthtime, part->path_start); + dietime = MIN2(pind.dietime, part->path_end); } else { - float tb = birthtime; - birthtime = tb + part->path_start * (dietime - tb); - dietime = tb + part->path_end * (dietime - tb); + float tb = pind.birthtime; + birthtime = tb + part->path_start * (pind.dietime - tb); + dietime = tb + part->path_end * (pind.dietime - tb); } if(birthtime >= dietime) { @@ -2546,101 +2700,18 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra dietime = birthtime + pa_length * (dietime - birthtime); } - if(soft){ - bp[0] = soft->bpoint + pa->bpi; - bp[1] = bp[0] + 1; - } - /*--interpolate actual path from data points--*/ for(k=0, ca=cache[i]; k<=steps; k++, ca++){ time = (float)k / (float)steps; t = birthtime + time * (dietime - birthtime); - if(keyed) { - while(kkey[1]->time < t) { - kkey[1]++; - } + result.time = -t; - kkey[0] = kkey[1] - 1; - } - else if(baked) { - get_pointcache_keys_for_time(psys, i, t, keys+1, keys+2); - } - else { - while(hkey[1]->time < t) { - hkey[1]++; - bp[1]++; - } - - hkey[0] = hkey[1] - 1; - } + do_particle_interpolation(psys, i, pa, t, frs_sec, &pind, &result); - if(soft) { - bp[0] = bp[1] - 1; - bp_to_particle(keys + 1, bp[0], hkey[0]); - bp_to_particle(keys + 2, bp[1], hkey[1]); - } - else if(keyed) { - memcpy(keys + 1, kkey[0], sizeof(ParticleKey)); - memcpy(keys + 2, kkey[1], sizeof(ParticleKey)); - } - else if(baked) - ; /* keys already set */ - else { - hair_to_particle(keys + 1, hkey[0]); - hair_to_particle(keys + 2, hkey[1]); - } - - - if(!keyed && !baked) { - if(soft) { - if(hkey[0] != pa->hair) - bp_to_particle(keys, bp[0] - 1, hkey[0] - 1); - else - bp_to_particle(keys, bp[0], hkey[0]); - } - else { - if(hkey[0] != pa->hair) - hair_to_particle(keys, hkey[0] - 1); - else - hair_to_particle(keys, hkey[0]); - } - - if(soft) { - if(hkey[1] != pa->hair + pa->totkey - 1) - bp_to_particle(keys + 3, bp[1] + 1, hkey[1] + 1); - else - bp_to_particle(keys + 3, bp[1], hkey[1]); - } - else { - if(hkey[1] != pa->hair + pa->totkey - 1) - hair_to_particle(keys + 3, hkey[1] + 1); - else - hair_to_particle(keys + 3, hkey[1]); - } - } - - dfra = keys[2].time - keys[1].time; - - keytime = (t - keys[1].time) / dfra; - - /* convert velocity to timestep size */ - if(keyed || baked){ - VecMulf(keys[1].vel, dfra / frs_sec); - VecMulf(keys[2].vel, dfra / frs_sec); - } - - /* now we should have in chronologiacl order k1<=k2<=t<=k3<=k4 with keytime between [0,1]->[k2,k3] (k1 & k4 used for cardinal & bspline interpolation)*/ - psys_interpolate_particle((keyed || baked) ? -1 /* signal for cubic interpolation */ - : ((psys->part->flag & PART_HAIR_BSPLINE) ? KEY_BSPLINE : KEY_CARDINAL) - ,keys, keytime, &result, 0); - - /* the velocity needs to be converted back from cubic interpolation */ - if(keyed || baked){ - VecMulf(result.vel, frs_sec / dfra); - } - else if(soft==NULL) { /* softbody and keyed are allready in global space */ + /* keyed, baked and softbody are allready in global space */ + if(!keyed && !baked && !soft) { Mat4MulVecfl(hairmat, result.co); } @@ -2678,8 +2749,9 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra VECCOPY(ca->col, col); } } + - /*--modify paths--*/ + /*--modify paths and calculate rotation & velocity--*/ VecSubf(vec,(cache[i]+1)->co,cache[i]->co); length = VecLength(vec); @@ -2708,12 +2780,18 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra float cosangle, angle, tangent[3], normal[3], q[4]; if(k == 1) { + /* calculate initial tangent for incremental rotations */ VECSUB(tangent, ca->co, (ca - 1)->co); - - vectoquat(tangent, OB_POSX, OB_POSZ, (ca-1)->rot); - VECCOPY(prev_tangent, tangent); Normalize(prev_tangent); + + /* First rotation is based on emitting face orientation. */ + /* This is way better than having flipping rotations resulting */ + /* from using a global axis as a rotation pole (vec_to_quat()). */ + /* It's not an ideal solution though since it disregards the */ + /* initial tangent, but taking that in to account will allow */ + /* the possibility of flipping again. -jahka */ + Mat3ToQuat_is_ok(rotmat, (ca-1)->rot); } else { VECSUB(tangent, ca->co, (ca - 1)->co); @@ -2780,15 +2858,6 @@ void copy_particle_key(ParticleKey *to, ParticleKey *from, int time){ memcpy(to,from,sizeof(ParticleKey)); to->time=to_time; } - /* - VECCOPY(to->co,from->co); - VECCOPY(to->vel,from->vel); - QUATCOPY(to->rot,from->rot); - if(time) - to->time=from->time; - to->flag=from->flag; - to->sbw=from->sbw; - */ } void psys_get_from_key(ParticleKey *key, float *loc, float *vel, float *rot, float *time){ if(loc) VECCOPY(loc,key->co); @@ -3017,8 +3086,6 @@ static void default_particle_settings(ParticleSettings *part) part->totpart= 1000; part->grid_res= 10; part->timetweak= 1.0; - part->keyed_time= 0.5; - //part->userjit; part->integrator= PART_INT_MIDPOINT; part->phystype= PART_PHYS_NEWTON; @@ -3032,7 +3099,6 @@ static void default_particle_settings(ParticleSettings *part) part->reactevent= PART_EVENT_DEATH; part->disp=100; part->from= PART_FROM_FACE; - part->length= 1.0; part->nbetween= 4; part->boidneighbours= 5; @@ -3059,10 +3125,15 @@ static void default_particle_settings(ParticleSettings *part) part->rough2_size=1.0; part->rough_end_shape=1.0; + part->clength=1.0f; + part->clength_thres=0.0f; + part->draw_line[0]=0.5; part->path_start = 0.0f; part->path_end = 1.0f; + part->keyed_loops = 1; + part->banking=1.0; part->max_bank=1.0; @@ -3480,7 +3551,7 @@ float psys_get_child_size(ParticleSystem *psys, ChildParticle *cpa, float cfra, } static void get_child_modifier_parameters(ParticleSettings *part, ParticleThreadContext *ctx, ChildParticle *cpa, short cpa_from, int cpa_num, float *cpa_fuv, float *orco, ParticleTexture *ptex) { - ptex->length=part->length*(1.0f - part->randlength*cpa->rand[0]); + ptex->length= 1.0f - part->randlength*cpa->rand[0]; ptex->clump=1.0; ptex->kink=1.0; ptex->rough1= 1.0; @@ -3489,6 +3560,8 @@ static void get_child_modifier_parameters(ParticleSettings *part, ParticleThread ptex->exist= 1.0; ptex->effector= 1.0; + ptex->length*= part->clength_thres < cpa->rand[1] ? part->clength : 1.0f; + get_cpa_texture(ctx->dm,ctx->ma,cpa_num,cpa_fuv,orco,ptex, MAP_PA_DENS|MAP_PA_LENGTH|MAP_PA_CLUMP|MAP_PA_KINK|MAP_PA_ROUGH); @@ -3511,7 +3584,7 @@ static void get_child_modifier_parameters(ParticleSettings *part, ParticleThread if(ctx->vg_effector) ptex->effector*=psys_interpolate_value_from_verts(ctx->dm,cpa_from,cpa_num,cpa_fuv,ctx->vg_effector); } -static void do_child_modifiers(Scene *scene, Object *ob, ParticleSystem *psys, ParticleSettings *part, ParticleTexture *ptex, ParticleKey *par, float *par_rot, ChildParticle *cpa, float *orco, ParticleKey *state, float t) +static void do_child_modifiers(Scene *scene, Object *ob, ParticleSystem *psys, ParticleSettings *part, ParticleTexture *ptex, ParticleKey *par, float *par_rot, ChildParticle *cpa, float *orco, float mat[4][4], ParticleKey *state, float t) { int guided = 0; @@ -3528,13 +3601,13 @@ static void do_child_modifiers(Scene *scene, Object *ob, ParticleSystem *psys, P } if(part->rough1 != 0.0 && ptex->rough1 != 0.0) - do_rough(orco, t, ptex->rough1*part->rough1, part->rough1_size, 0.0, state); + do_rough(orco, mat, t, ptex->rough1*part->rough1, part->rough1_size, 0.0, state); if(part->rough2 != 0.0 && ptex->rough2 != 0.0) - do_rough(cpa->rand, t, ptex->rough2*part->rough2, part->rough2_size, part->rough2_thres, state); + do_rough(cpa->rand, mat, t, ptex->rough2*part->rough2, part->rough2_size, part->rough2_thres, state); if(part->rough_end != 0.0 && ptex->roughe != 0.0) - do_rough_end(cpa->rand, t, ptex->roughe*part->rough_end, part->rough_end_shape, state, par); + do_rough_end(cpa->rand, mat, t, ptex->roughe*part->rough_end, part->rough_end_shape, state); } /* get's hair (or keyed) particles state at the "path time" specified in state->time */ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, int p, ParticleKey *state, int vel) @@ -3549,8 +3622,9 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i HairKey *hkey[2] = {NULL, NULL}; ParticleKey *par=0, keys[4], tstate; ParticleThreadContext ctx; /* fake thread context for child modifiers */ + ParticleInterpolationData pind; - float t, real_t, dfra, keytime, frs_sec = scene->r.frs_sec; + float t, frs_sec = scene->r.frs_sec; float co[3], orco[3]; float hairmat[4][4]; int totparent = 0; @@ -3558,7 +3632,7 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i int totchild = psys->totchild; short between = 0, edit = 0; - int keyed = psys->flag & PSYS_KEYED; + int keyed = part->phystype & PART_PHYS_KEYED && psys->flag & PSYS_KEYED; int cached = !keyed && part->type != PART_HAIR; float *cpa_fuv; int cpa_num; short cpa_from; @@ -3580,88 +3654,14 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i key_from_object(pa->stick_ob,state); return; } - - if(keyed) { - kkey[0] = pa->keys; - kkey[1] = kkey[0] + 1; - if(state->time < 0.0f) - real_t = -state->time; - else - real_t = kkey[0]->time + t * (kkey[0][pa->totkey-1].time - kkey[0]->time); - } - else if(cached) { - get_pointcache_keys_for_time(psys, -1, 0.0f, NULL, NULL); - } - else { - hkey[0] = pa->hair; - hkey[1] = pa->hair + 1; - - if(state->time < 0.0f) - real_t = -state->time; - else - real_t = hkey[0]->time + t * (hkey[0][pa->totkey-1].time - hkey[0]->time); - } - - if(keyed) { - while(kkey[1]->time < real_t) { - kkey[1]++; - } - kkey[0] = kkey[1] - 1; - - memcpy(keys + 1, kkey[0], sizeof(ParticleKey)); - memcpy(keys + 2, kkey[1], sizeof(ParticleKey)); - } - else if(cached) { - if(state->time < 0.0f) /* flag for time in frames */ - real_t = -state->time; - else - real_t = pa->time + t * (pa->dietime - pa->time); - - get_pointcache_keys_for_time(psys, p, real_t, keys+1, keys+2); - } - else { - while(hkey[1]->time < real_t) - hkey[1]++; - - hkey[0] = hkey[1] - 1; - - hair_to_particle(keys + 1, hkey[0]); - hair_to_particle(keys + 2, hkey[1]); - } + pind.keyed = keyed; + pind.cached = cached; + pind.soft = NULL; + init_particle_interpolation(ob, psys, pa, &pind); + do_particle_interpolation(psys, p, pa, t, frs_sec, &pind, state); if(!keyed && !cached) { - if(hkey[0] != pa->hair) - hair_to_particle(keys, hkey[0] - 1); - else - hair_to_particle(keys, hkey[0]); - - if(hkey[1] != pa->hair + pa->totkey - 1) - hair_to_particle(keys + 3, hkey[1] + 1); - else - hair_to_particle(keys + 3, hkey[1]); - } - - dfra = keys[2].time - keys[1].time; - - keytime = (real_t - keys[1].time) / dfra; - - /* convert velocity to timestep size */ - if(keyed || cached){ - VecMulf(keys[1].vel, dfra / frs_sec); - VecMulf(keys[2].vel, dfra / frs_sec); - QuatInterpol(state->rot,keys[1].rot,keys[2].rot,keytime); - } - - psys_interpolate_particle((keyed || cached) ? -1 /* signal for cubic interpolation */ - : ((psys->part->flag & PART_HAIR_BSPLINE) ? KEY_BSPLINE : KEY_CARDINAL) - ,keys, keytime, state, 1); - - /* the velocity needs to be converted back from cubic interpolation */ - if(keyed || cached){ - VecMulf(state->vel, frs_sec / dfra); - } - else { if((pa->flag & PARS_REKEY)==0) { psys_mat_hair_to_global(ob, psmd->dm, part->from, pa, hairmat); Mat4MulVecfl(hairmat, state->co); @@ -3709,8 +3709,6 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i cpa_num=cpa->num; foffset= cpa->foffset; - if(part->childtype == PART_CHILD_FACES) - foffset = -(2.0f + part->childspread); cpa_fuv = cpa->fuv; cpa_from = PART_FROM_FACE; @@ -3721,11 +3719,14 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i //Mat4MulVecfl(ob->obmat,cpa_1st); + pa = psys->particles + cpa->parent; + + psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat); + pa=0; } else{ /* get the parent state */ - keys->time = state->time; psys_get_particle_on_path(scene, ob, psys, cpa->parent, keys,1); @@ -3737,6 +3738,8 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i cpa_fuv=pa->fuv; psys_particle_on_emitter(psmd,cpa_from,cpa_num,DMCACHE_ISCHILD,cpa_fuv,pa->foffset,co,0,0,0,orco,0); + + psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat); } /* correct child ipo timing */ @@ -3785,7 +3788,7 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i copy_particle_key(&tstate, state, 1); /* apply different deformations to the child path */ - do_child_modifiers(scene, ob, psys, part, &ptex, par, par->rot, cpa, orco, state, t); + do_child_modifiers(scene, ob, psys, part, &ptex, par, par->rot, cpa, orco, hairmat, state, t); /* try to estimate correct velocity */ if(vel){ @@ -3856,7 +3859,7 @@ int psys_get_particle_state(struct Scene *scene, Object *ob, ParticleSystem *psy state->time= (cfra-(part->sta+(part->end-part->sta)*cpa->rand[0]))/(part->lifetime*cpa->rand[1]); } else - state->time= (cfra-pa->time)/(pa->dietime-pa->time); + state->time= -cfra; psys_get_particle_on_path(scene, ob, psys, p, state,1); return 1; @@ -3893,57 +3896,55 @@ int psys_get_particle_state(struct Scene *scene, Object *ob, ParticleSystem *psy calc_latt_deform(psys->lattice, state->co,1.0f); } else{ - if (pa) { /* TODO PARTICLE - should this ever be NULL? - Campbell */ - if(pa->state.time==state->time || ELEM(part->phystype,PART_PHYS_NO,PART_PHYS_KEYED)) - copy_particle_key(state, &pa->state, 1); - else if(pa->prev_state.time==state->time) - copy_particle_key(state, &pa->prev_state, 1); - else { - /* let's interpolate to try to be as accurate as possible */ - if(pa->state.time + 1.0f > state->time && pa->prev_state.time - 1.0f < state->time) { - ParticleKey keys[4]; - float dfra, keytime, frs_sec = scene->r.frs_sec; + if(pa->state.time==state->time || ELEM(part->phystype,PART_PHYS_NO,PART_PHYS_KEYED)) + copy_particle_key(state, &pa->state, 1); + else if(pa->prev_state.time==state->time) + copy_particle_key(state, &pa->prev_state, 1); + else { + /* let's interpolate to try to be as accurate as possible */ + if(pa->state.time + 1.0f > state->time && pa->prev_state.time - 1.0f < state->time) { + ParticleKey keys[4]; + float dfra, keytime, frs_sec = scene->r.frs_sec; - if(pa->prev_state.time >= pa->state.time) { - /* prev_state is wrong so let's not use it, this can happen at frame 1 or particle birth */ - copy_particle_key(state, &pa->state, 1); + if(pa->prev_state.time >= pa->state.time) { + /* prev_state is wrong so let's not use it, this can happen at frame 1 or particle birth */ + copy_particle_key(state, &pa->state, 1); - VECADDFAC(state->co, state->co, state->vel, (state->time-pa->state.time)/frs_sec); - } - else { - copy_particle_key(keys+1, &pa->prev_state, 1); - copy_particle_key(keys+2, &pa->state, 1); + VECADDFAC(state->co, state->co, state->vel, (state->time-pa->state.time)/frs_sec); + } + else { + copy_particle_key(keys+1, &pa->prev_state, 1); + copy_particle_key(keys+2, &pa->state, 1); - dfra = keys[2].time - keys[1].time; + dfra = keys[2].time - keys[1].time; - keytime = (state->time - keys[1].time) / dfra; + keytime = (state->time - keys[1].time) / dfra; - /* convert velocity to timestep size */ - VecMulf(keys[1].vel, dfra / frs_sec); - VecMulf(keys[2].vel, dfra / frs_sec); - - psys_interpolate_particle(-1, keys, keytime, state, 1); - - /* convert back to real velocity */ - VecMulf(state->vel, frs_sec / dfra); + /* convert velocity to timestep size */ + VecMulf(keys[1].vel, dfra / frs_sec); + VecMulf(keys[2].vel, dfra / frs_sec); + + psys_interpolate_particle(-1, keys, keytime, state, 1); + + /* convert back to real velocity */ + VecMulf(state->vel, frs_sec / dfra); - VecLerpf(state->ave, keys[1].ave, keys[2].ave, keytime); - QuatInterpol(state->rot, keys[1].rot, keys[2].rot, keytime); - } - } - else { - /* extrapolating over big ranges is not accurate so let's just give something close to reasonable back */ - copy_particle_key(state, &pa->state, 0); + VecLerpf(state->ave, keys[1].ave, keys[2].ave, keytime); + QuatInterpol(state->rot, keys[1].rot, keys[2].rot, keytime); } } - - if(pa->alive==PARS_DEAD && part->flag&PART_STICKY && pa->flag&PARS_STICKY && pa->stick_ob){ - key_from_object(pa->stick_ob,state); + else { + /* extrapolating over big ranges is not accurate so let's just give something close to reasonable back */ + copy_particle_key(state, &pa->state, 0); } + } - if(psys->lattice) - calc_latt_deform(psys->lattice, state->co,1.0f); + if(pa->alive==PARS_DEAD && part->flag&PART_STICKY && pa->flag&PARS_STICKY && pa->stick_ob){ + key_from_object(pa->stick_ob,state); } + + if(psys->lattice) + calc_latt_deform(psys->lattice, state->co,1.0f); } return 1; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 07e0e82a86d..56ca3e8e22b 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -111,10 +111,7 @@ static int get_current_display_percentage(ParticleSystem *psys) return 100; if(part->phystype==PART_PHYS_KEYED){ - if(psys->flag & PSYS_FIRST_KEYED) - return psys->part->disp; - else - return 100; + return psys->part->disp; } else return psys->part->disp; @@ -199,7 +196,7 @@ static void realloc_particles(Object *ob, ParticleSystem *psys, int new_totpart) if(psys->particles->keys) MEM_freeN(psys->particles->keys); - for(i=0, pa=psys->particles; itotpart; i++, pa++) + for(i=0, pa=newpars; ikeys) { pa->keys= NULL; pa->totkey= 0; @@ -1976,64 +1973,59 @@ static void reset_all_particles(Scene *scene, Object *ob, ParticleSystem *psys, /************************************************/ /* Keyed particles */ /************************************************/ -/* a bit of an unintuitive function :) counts objects in a keyed chain and returns 1 if some of them were selected (used in drawing) */ -int psys_count_keyed_targets(Object *ob, ParticleSystem *psys) +/* Counts valid keyed targets */ +void psys_count_keyed_targets(Object *ob, ParticleSystem *psys) { - ParticleSystem *kpsys=psys,*tpsys; - ParticleSettings *tpart; - Object *kob=ob,*tob; - int select=ob->flag&SELECT; - short totkeyed=0; - Base *base; - - ListBase lb; - lb.first=lb.last=0; - - tob=psys->keyed_ob; - while(tob){ - if((tpsys=BLI_findlink(&tob->particlesystem,kpsys->keyed_psys-1))){ - tpart=tpsys->part; - - if(tpart->phystype==PART_PHYS_KEYED){ - if(lb.first){ - for(base=lb.first;base;base=base->next){ - if(tob==base->object){ - fprintf(stderr,"Error: loop in keyed chain!\n"); - BLI_freelistN(&lb); - return select; - } - } - } - base=MEM_callocN(sizeof(Base), "keyed base"); - base->object=tob; - BLI_addtail(&lb,base); - - if(tob->flag&SELECT) - select++; - kob=tob; - kpsys=tpsys; - tob=tpsys->keyed_ob; - totkeyed++; + ParticleSystem *kpsys; + KeyedParticleTarget *kpt = psys->keyed_targets.first; + int psys_num = BLI_findindex(&ob->particlesystem, psys); + int keys_valid = 1; + psys->totkeyed = 0; + + for(; kpt; kpt=kpt->next) { + kpsys = NULL; + if(kpt->ob==ob || kpt->ob==NULL) { + if(kpt->psys >= psys_num) + kpsys = BLI_findlink(&ob->particlesystem, kpt->psys-1); + + if(kpsys && kpsys->totpart) { + kpt->flag |= KEYED_TARGET_VALID; + psys->totkeyed += keys_valid; + if(psys->flag & PSYS_KEYED_TIMING && kpt->duration != 0.0f) + psys->totkeyed += 1; } - else{ - tob=0; - totkeyed++; + else { + kpt->flag &= ~KEYED_TARGET_VALID; + keys_valid = 0; + } + } + else { + if(kpt->ob) + kpsys = BLI_findlink(&kpt->ob->particlesystem, kpt->psys-1); + + if(kpsys && kpsys->totpart) { + kpt->flag |= KEYED_TARGET_VALID; + psys->totkeyed += keys_valid; + if(psys->flag & PSYS_KEYED_TIMING && kpt->duration != 0.0f) + psys->totkeyed += 1; + } + else { + kpt->flag &= ~KEYED_TARGET_VALID; + keys_valid = 0; } } - else - tob=0; } - psys->totkeyed=totkeyed; - BLI_freelistN(&lb); - return select; + + psys->totkeyed *= psys->flag & PSYS_KEYED_TIMING ? 1 : psys->part->keyed_loops; } static void set_keyed_keys(Scene *scene, Object *ob, ParticleSystem *psys) { Object *kob = ob; ParticleSystem *kpsys = psys; + KeyedParticleTarget *kpt; ParticleData *pa; - int totpart = psys->totpart, i, k, totkeys = psys->totkeyed + 1; + int totpart = psys->totpart, i, k, totkeys = psys->totkeyed; float prevtime, nexttime, keyedtime; /* no proper targets so let's clear and bail out */ @@ -2046,7 +2038,7 @@ static void set_keyed_keys(Scene *scene, Object *ob, ParticleSystem *psys) if(totpart && psys->particles->totkey != totkeys) { free_keyed_keys(psys); - psys->particles->keys = MEM_callocN(psys->totpart*totkeys*sizeof(ParticleKey), "Keyed keys"); + psys->particles->keys = MEM_callocN(totpart*totkeys*sizeof(ParticleKey), "Keyed keys"); psys->particles->totkey = totkeys; for(i=1, pa=psys->particles+1; iflag &= ~PSYS_KEYED; + + kpt = psys->keyed_targets.first; for(k=0; kob) + kpsys = BLI_findlink(&kpt->ob->particlesystem, kpt->psys - 1); + else + kpsys = BLI_findlink(&ob->particlesystem, kpt->psys - 1); + for(i=0,pa=psys->particles; ikeys + k)->time = -1.0; /* use current time */ - if(kpsys->totpart > 0) - psys_get_particle_state(scene, kob, kpsys, i%kpsys->totpart, pa->keys + k, 1); + psys_get_particle_state(scene, kpt->ob, kpsys, i%kpsys->totpart, pa->keys + k, 1); - if(k==0) - pa->keys->time = pa->time; - else if(k==totkeys-1) - (pa->keys + k)->time = pa->time + pa->lifetime; - else{ - if(psys->flag & PSYS_KEYED_TIME){ - prevtime = (pa->keys + k - 1)->time; - nexttime = pa->time + pa->lifetime; - keyedtime = kpsys->part->keyed_time; - (pa->keys + k)->time = (1.0f - keyedtime) * prevtime + keyedtime * nexttime; + if(psys->flag & PSYS_KEYED_TIMING){ + (pa->keys+k)->time = pa->time + kpt->time; + if(kpt->duration != 0.0f && k+1 < totkeys) { + copy_particle_key(pa->keys+k+1, pa->keys+k, 1); + (pa->keys+k+1)->time = pa->time + kpt->time + kpt->duration; } - else - (pa->keys+k)->time = pa->time + (float)k / (float)(totkeys - 1) * pa->lifetime; } + else if(totkeys > 1) + (pa->keys+k)->time = pa->time + (float)k / (float)(totkeys - 1) * pa->lifetime; + else + pa->keys->time = pa->time; } - if(kpsys->keyed_ob){ - kob = kpsys->keyed_ob; - kpsys = BLI_findlink(&kob->particlesystem, kpsys->keyed_psys - 1); - } + + if(psys->flag & PSYS_KEYED_TIMING && kpt->duration!=0.0f) + k++; + + kpt = (kpt->next && kpt->next->flag & KEYED_TARGET_VALID) ? kpt = kpt->next : psys->keyed_targets.first; } psys->flag |= PSYS_KEYED; @@ -2198,6 +2194,60 @@ void psys_get_reactor_target(Object *ob, ParticleSystem *psys, Object **target_o /************************************************/ /* Point Cache */ /************************************************/ +void psys_make_temp_pointcache(Object *ob, ParticleSystem *psys) +{ + PointCache *cache = psys->pointcache; + PTCacheFile *pf = NULL; + PTCacheMem *pm = NULL; + PTCacheID pid; + int cfra, sfra = cache->startframe, efra = cache->endframe; + int totelem = psys->totpart; + int float_count = sizeof(ParticleKey) / sizeof(float); + int tot = totelem * float_count; + + if((cache->flag & PTCACHE_DISK_CACHE)==0 || cache->mem_cache.first) + return; + + BKE_ptcache_id_from_particles(&pid, ob, psys); + + for(cfra=sfra; cfra <= efra; cfra++) { + pf = BKE_ptcache_file_open(&pid, PTCACHE_FILE_READ, cfra); + + if(pf) { + pm = MEM_callocN(sizeof(PTCacheMem), "Pointcache temp mem"); + pm->data = MEM_callocN(sizeof(float)*tot, "Pointcache temp mem data"); + + if(fread(pm->data, sizeof(float), tot, pf->fp)!= tot) { + printf("Error reading from disk cache\n"); + + MEM_freeN(pm->data); + MEM_freeN(pm); + BKE_ptcache_file_close(pf); + return; + } + + pm->frame = cfra; + pm->totpoint = totelem; + + BLI_addtail(&cache->mem_cache, pm); + + BKE_ptcache_file_close(pf); + } + } +} +void psys_clear_temp_pointcache(ParticleSystem *psys) +{ + PTCacheMem *pm = psys->pointcache->mem_cache.first; + + if((psys->pointcache->flag & PTCACHE_DISK_CACHE)==0) + return; + + for(; pm; pm=pm->next) { + MEM_freeN(pm->data); + } + + BLI_freelistN(&psys->pointcache->mem_cache); +} void psys_get_pointcache_start_end(Scene *scene, ParticleSystem *psys, int *sfra, int *efra) { ParticleSettings *part = psys->part; @@ -3912,61 +3962,6 @@ static void boid_body(Scene *scene, BoidVecFunc *bvf, ParticleData *pa, Particle if(part->flag & PART_BOIDS_2D){ pa->state.vel[2]=0.0; pa->state.co[2]=part->groundz; - - if(psys->keyed_ob && (psys->keyed_ob->type == OB_MESH)){ - Object *zob=psys->keyed_ob; - int min_face; - float co1[3],co2[3],min_d=2.0,min_w[4],imat[4][4]; - VECCOPY(co1,pa->state.co); - VECCOPY(co2,pa->state.co); - - co1[2]=1000.0f; - co2[2]=-1000.0f; - - Mat4Invert(imat,zob->obmat); - Mat4MulVecfl(imat,co1); - Mat4MulVecfl(imat,co2); - - if(psys_intersect_dm(scene,zob,0,0,co1,co2,&min_d,&min_face,min_w,0,0,0,0)){ - DerivedMesh *dm; - MFace *mface; - MVert *mvert; - float loc[3],nor[3],q1[4]; - - psys_disable_all(zob); - dm=mesh_get_derived_final(scene, zob, 0); - psys_enable_all(zob); - - mface=dm->getFaceDataArray(dm,CD_MFACE); - mface+=min_face; - mvert=dm->getVertDataArray(dm,CD_MVERT); - - /* get deflection point & normal */ - psys_interpolate_face(mvert,mface,0,0,min_w,loc,nor,0,0,0,0); - - Mat4MulVecfl(zob->obmat,loc); - Mat4Mul3Vecfl(zob->obmat,nor); - - Normalize(nor); - - VECCOPY(pa->state.co,loc); - - zvec[2]=1.0; - - Crossf(loc,zvec,nor); - - bank=VecLength(loc); - if(bank>0.0){ - bank=saasin(bank); - - VecRotToQuat(loc,bank,q); - - QUATCOPY(q1,pa->state.rot); - - QuatMul(pa->state.rot,q,q1); - } - } - } } length=bvf->Length(pa->state.vel); @@ -4238,7 +4233,7 @@ static void psys_update_path_cache(Scene *scene, Object *ob, ParticleSystemModif if((psys->part->childtype && psys->totchild != get_psys_tot_child(scene, psys)) || psys->recalc&PSYS_RECALC_RESET) alloc=1; - if(alloc || psys->recalc&PSYS_RECALC_RESET || (psys->vgroup[PSYS_VG_DENSITY] && (G.f & G_WEIGHTPAINT))) + if(alloc || psys->recalc&PSYS_RECALC_CHILD || (psys->vgroup[PSYS_VG_DENSITY] && (G.f & G_WEIGHTPAINT))) distr=1; if(distr){ @@ -4416,12 +4411,15 @@ static void cached_step(Scene *scene, Object *ob, ParticleSystemModifierData *ps MEM_freeN(vg_size); } -void psys_changed_type(ParticleSystem *psys) +static void psys_changed_type(Object *ob, ParticleSystem *psys) { ParticleSettings *part; + PTCacheID pid; part= psys->part; + BKE_ptcache_id_from_particles(&pid, ob, psys); + /* system type has changed so set sensible defaults and clear non applicable flags */ if(part->from == PART_FROM_PARTICLE) { if(part->type != PART_REACTOR) @@ -4430,7 +4428,7 @@ void psys_changed_type(ParticleSystem *psys) part->distr = PART_DISTR_JIT; } - if(psys->part->phystype != PART_PHYS_KEYED) + if(part->phystype != PART_PHYS_KEYED) psys->flag &= ~PSYS_KEYED; if(part->type == PART_HAIR) { @@ -4442,6 +4440,8 @@ void psys_changed_type(ParticleSystem *psys) CLAMP(part->path_start, 0.0f, 100.0f); CLAMP(part->path_end, 0.0f, 100.0f); + + BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_ALL, 0); } else { free_hair(psys, 1); @@ -4454,7 +4454,18 @@ void psys_changed_type(ParticleSystem *psys) psys_reset(psys, PSYS_RESET_ALL); } - +void psys_changed_physics(Object *ob, ParticleSystem *psys) +{ + if(ELEM(psys->part->phystype, PART_PHYS_NO, PART_PHYS_KEYED)) { + PTCacheID pid; + BKE_ptcache_id_from_particles(&pid, ob, psys); + BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_ALL, 0); + } + else { + free_keyed_keys(psys); + psys->flag &= ~PSYS_KEYED; + } +} static void particles_fluid_step(Scene *scene, Object *ob, ParticleSystem *psys, int cfra) { if(psys->particles){ @@ -4588,6 +4599,8 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle BKE_ptcache_id_from_particles(&pid, ob, psys); BKE_ptcache_id_time(&pid, scene, 0.0f, &startframe, &endframe, NULL); + psys_clear_temp_pointcache(psys); + /* update ipo's */ #if 0 // XXX old animation system if((part->flag & PART_ABS_TIME) && part->ipo) { @@ -4736,7 +4749,7 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle if(usecache && psys->cfra == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0)) write_particles_to_cache(ob, psys, startframe); - if(part->phystype==PART_PHYS_KEYED && psys->flag&PSYS_FIRST_KEYED) + if(part->phystype==PART_PHYS_KEYED) psys_count_keyed_targets(ob,psys); /* initialize vertex groups */ @@ -4783,7 +4796,7 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle write_particles_to_cache(ob, psys, framenr); /* for keyed particles the path is allways known so it can be drawn */ - if(part->phystype==PART_PHYS_KEYED && psys->flag&PSYS_FIRST_KEYED){ + if(part->phystype==PART_PHYS_KEYED) { set_keyed_keys(scene, ob, psys); psys_update_path_cache(scene, ob, psmd, psys,(int)cfra); } @@ -4866,7 +4879,9 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys) return; if(psys->recalc & PSYS_RECALC_TYPE) - psys_changed_type(psys); + psys_changed_type(ob, psys); + else if(psys->recalc & PSYS_RECALC_PHYS) + psys_changed_physics(ob, psys); /* (re-)create hair */ if(psys->part->type==PART_HAIR && hair_needs_recalc(psys)) { diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 2fe46be7a89..6107510fa47 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -315,8 +315,10 @@ static int ptcache_pid_totelem(PTCacheID *pid) ParticleSystem *psys = pid->data; return psys->totpart; } - else if(pid->type==PTCACHE_TYPE_CLOTH) - return 0; // TODO + else if(pid->type==PTCACHE_TYPE_CLOTH) { + ClothModifierData *clmd = pid->data; + return clmd->clothObject->numverts; + } return 0; } @@ -429,6 +431,7 @@ int BKE_ptcache_read_cache(PTCacheReader *reader) if(pf) { BKE_ptcache_file_close(pf); + pf = NULL; MEM_freeN(data); } @@ -523,7 +526,9 @@ int BKE_ptcache_read_cache(PTCacheReader *reader) if(pf) { BKE_ptcache_file_close(pf); + pf = NULL; BKE_ptcache_file_close(pf2); + pf2 = NULL; MEM_freeN(data1); MEM_freeN(data2); } @@ -567,10 +572,13 @@ int BKE_ptcache_read_cache(PTCacheReader *reader) if(pf) { BKE_ptcache_file_close(pf); + pf = NULL; MEM_freeN(data); } - if(pf2) + if(pf2) { BKE_ptcache_file_close(pf2); + pf = NULL; + } ret = PTCACHE_READ_OLD; } @@ -602,13 +610,15 @@ int BKE_ptcache_write_cache(PTCacheWriter *writer) PTCacheFile *pf= NULL; int elemsize = ptcache_pid_elemsize(writer->pid); int i, incr = elemsize / sizeof(float); - int add = 0, overwrite = 0, ocfra; + int add = 0, overwrite = 0; float temp[14]; if(writer->totelem == 0 || writer->cfra <= 0) return 0; if(cache->flag & PTCACHE_DISK_CACHE) { + int cfra = cache->endframe; + /* allways start from scratch on the first frame */ if(writer->cfra == cache->startframe) { BKE_ptcache_id_clear(writer->pid, PTCACHE_CLEAR_ALL, writer->cfra); @@ -616,7 +626,7 @@ int BKE_ptcache_write_cache(PTCacheWriter *writer) add = 1; } else { - int cfra = cache->endframe; + int ocfra; /* find last cached frame */ while(cfra > cache->startframe && !BKE_ptcache_id_exist(writer->pid, cfra)) cfra--; @@ -626,7 +636,7 @@ int BKE_ptcache_write_cache(PTCacheWriter *writer) while(ocfra > cache->startframe && !BKE_ptcache_id_exist(writer->pid, ocfra)) ocfra--; - if(writer->cfra > cfra) { + if(cfra >= cache->startframe && writer->cfra > cfra) { if(ocfra >= cache->startframe && cfra - ocfra < cache->step) overwrite = 1; else @@ -636,7 +646,7 @@ int BKE_ptcache_write_cache(PTCacheWriter *writer) if(add || overwrite) { if(overwrite) - BKE_ptcache_id_clear(writer->pid, PTCACHE_CLEAR_FRAME, ocfra); + BKE_ptcache_id_clear(writer->pid, PTCACHE_CLEAR_FRAME, cfra); pf = BKE_ptcache_file_open(writer->pid, PTCACHE_FILE_WRITE, writer->cfra); if(!pf) @@ -665,7 +675,7 @@ int BKE_ptcache_write_cache(PTCacheWriter *writer) pm2 = cache->mem_cache.last; if(pm2 && writer->cfra > pm2->frame) { - if(pm2 && pm2->prev && pm2->frame - pm2->prev->frame < cache->step) + if(pm2->prev && pm2->frame - pm2->prev->frame < cache->step) overwrite = 1; else add = 1; @@ -1102,6 +1112,10 @@ PointCache *BKE_ptcache_copy(PointCache *cache) ncache= MEM_dupallocN(cache); + /* hmm, should these be copied over instead? */ + ncache->mem_cache.first = NULL; + ncache->mem_cache.last = NULL; + ncache->flag= 0; ncache->simframe= 0; @@ -1211,8 +1225,9 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) cache = pid->cache; if((cache->flag & PTCACHE_BAKED)==0) { if(pid->type==PTCACHE_TYPE_PARTICLES) { - /* skip hair particles */ - if(((ParticleSystem*)pid->data)->part->type == PART_HAIR) + ParticleSystem *psys = (ParticleSystem*)pid->data; + /* skip hair & keyed particles */ + if(psys->part->type == PART_HAIR || psys->part->phystype == PART_PHYS_KEYED) continue; psys_get_pointcache_start_end(scene, pid->data, &cache->startframe, &cache->endframe); @@ -1310,6 +1325,7 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid) { if (!G.relbase_valid){ cache->flag &= ~PTCACHE_DISK_CACHE; + printf("File must be saved before using disk cache!\n"); return; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 479fa760423..c2b19a804ee 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2968,6 +2968,9 @@ static void direct_link_pointcache(FileData *fd, PointCache *cache) for(; pm; pm=pm->next) pm->data = newdataadr(fd, pm->data); } + else + cache->mem_cache.first = cache->mem_cache.last = NULL; + cache->flag &= ~(PTCACHE_SIMULATION_VALID|PTCACHE_BAKE_EDIT_ACTIVE); cache->simframe= 0; } @@ -3011,12 +3014,18 @@ static void lib_link_particlesystems(FileData *fd, Object *ob, ID *id, ListBase psys->part = newlibadr_us(fd, id->lib, psys->part); if(psys->part) { + KeyedParticleTarget *kpt = psys->keyed_targets.first; + + for(; kpt; kpt=kpt->next) + kpt->ob=newlibadr(fd, id->lib, kpt->ob); + psys->target_ob = newlibadr(fd, id->lib, psys->target_ob); - psys->keyed_ob = newlibadr(fd, id->lib, psys->keyed_ob); for(a=0,pa=psys->particles; atotpart; a++,pa++){ pa->stick_ob=newlibadr(fd, id->lib, pa->stick_ob); } + + } else { /* particle modifier must be removed before particle system */ @@ -3066,6 +3075,8 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles) direct_link_pointcache(fd, sb->pointcache); } + link_list(fd, &psys->keyed_targets); + psys->edit = 0; psys->free_edit = NULL; psys->pathcache = 0; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 4b52da83019..65a4a355717 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -589,6 +589,7 @@ static void write_particlesettings(WriteData *wd, ListBase *idbase) static void write_particlesystems(WriteData *wd, ListBase *particles) { ParticleSystem *psys= particles->first; + KeyedParticleTarget *kpt; int a; for(; psys; psys=psys->next) { @@ -604,6 +605,10 @@ static void write_particlesystems(WriteData *wd, ListBase *particles) writestruct(wd, DATA, "HairKey", pa->totkey, pa->hair); } } + kpt = psys->keyed_targets.first; + for(; kpt; kpt=kpt->next) + writestruct(wd, DATA, "KeyedParticleTarget", 1, kpt); + if(psys->child) writestruct(wd, DATA, "ChildParticle", psys->totchild ,psys->child); writestruct(wd, DATA, "SoftBody", 1, psys->soft); if(psys->soft) write_pointcaches(wd, psys->soft->pointcache, PTCACHE_WRITE_PSYS); diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h index 65c2976d57c..f16a232f26d 100644 --- a/source/blender/editors/space_buttons/buttons_intern.h +++ b/source/blender/editors/space_buttons/buttons_intern.h @@ -75,6 +75,10 @@ void OBJECT_OT_particle_system_add(struct wmOperatorType *ot); void OBJECT_OT_particle_system_remove(struct wmOperatorType *ot); void PARTICLE_OT_new(struct wmOperatorType *ot); +void PARTICLE_OT_new_keyed_target(struct wmOperatorType *ot); +void PARTICLE_OT_remove_keyed_target(struct wmOperatorType *ot); +void PARTICLE_OT_keyed_target_move_up(struct wmOperatorType *ot); +void PARTICLE_OT_keyed_target_move_down(struct wmOperatorType *ot); #endif /* ED_BUTTONS_INTERN_H */ diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 66b380ab413..6fb52c61131 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -49,6 +49,7 @@ #include "BKE_world.h" #include "BLI_editVert.h" +#include "BLI_listbase.h" #include "RNA_access.h" @@ -473,33 +474,32 @@ static int new_particle_settings_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Main *bmain= CTX_data_main(C); - ParticleSettings *part= CTX_data_pointer_get_type(C, "particle_settings", &RNA_ParticleSettings).data; + ParticleSystem *psys; + ParticleSettings *part = NULL; Object *ob; PointerRNA ptr; + ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); + + psys = ptr.data; + /* add or copy particle setting */ - if(part) - part= psys_copy_settings(part); + if(psys->part) + part= psys_copy_settings(psys->part); else part= psys_new_settings("PSys", bmain); - /* attempt to assign to material slot */ - ptr= CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); + ob= ptr.id.data; - if(ptr.data) { - ParticleSystem *psys = (ParticleSystem*)ptr.data; - ob= ptr.id.data; - - if(psys->part) - psys->part->id.us--; + if(psys->part) + psys->part->id.us--; - psys->part = part; + psys->part = part; - DAG_scene_sort(scene); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_scene_sort(scene); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); - } + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); return OPERATOR_FINISHED; } @@ -517,3 +517,175 @@ void PARTICLE_OT_new(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/********************** keyed particle target operators *********************/ + +static int new_keyed_particle_target_exec(bContext *C, wmOperator *op) +{ + Scene *scene = CTX_data_scene(C); + PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); + ParticleSystem *psys= ptr.data; + Object *ob = ptr.id.data; + + KeyedParticleTarget *kpt; + + if(!psys) + return OPERATOR_CANCELLED; + + kpt = psys->keyed_targets.first; + for(; kpt; kpt=kpt->next) + kpt->flag &= ~KEYED_TARGET_CURRENT; + + kpt = MEM_callocN(sizeof(KeyedParticleTarget), "keyed particle target"); + + kpt->flag |= KEYED_TARGET_CURRENT; + kpt->psys = 1; + + BLI_addtail(&psys->keyed_targets, kpt); + + DAG_scene_sort(scene); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + + return OPERATOR_FINISHED; +} + +void PARTICLE_OT_new_keyed_target(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "New Keyed Particle Target"; + ot->idname= "PARTICLE_OT_new_keyed_target"; + + /* api callbacks */ + ot->exec= new_keyed_particle_target_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int remove_keyed_particle_target_exec(bContext *C, wmOperator *op) +{ + Scene *scene = CTX_data_scene(C); + PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); + ParticleSystem *psys= ptr.data; + Object *ob = ptr.id.data; + + KeyedParticleTarget *kpt; + + if(!psys) + return OPERATOR_CANCELLED; + + kpt = psys->keyed_targets.first; + for(; kpt; kpt=kpt->next) { + if(kpt->flag & KEYED_TARGET_CURRENT) { + BLI_remlink(&psys->keyed_targets, kpt); + MEM_freeN(kpt); + break; + } + + } + kpt = psys->keyed_targets.last; + + if(kpt) + kpt->flag |= KEYED_TARGET_CURRENT; + + DAG_scene_sort(scene); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + + return OPERATOR_FINISHED; +} + +void PARTICLE_OT_remove_keyed_target(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Keyed Particle Target"; + ot->idname= "PARTICLE_OT_remove_keyed_target"; + + /* api callbacks */ + ot->exec= remove_keyed_particle_target_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/************************ move up modifier operator *********************/ + +static int keyed_target_move_up_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); + ParticleSystem *psys= ptr.data; + Object *ob = ptr.id.data; + KeyedParticleTarget *kpt; + + if(!psys) + return OPERATOR_CANCELLED; + + kpt = psys->keyed_targets.first; + for(; kpt; kpt=kpt->next) { + if(kpt->flag & KEYED_TARGET_CURRENT && kpt->prev) { + BLI_remlink(&psys->keyed_targets, kpt); + BLI_insertlink(&psys->keyed_targets, kpt->prev->prev, kpt); + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + break; + } + } + + return OPERATOR_FINISHED; +} + +void PARTICLE_OT_keyed_target_move_up(wmOperatorType *ot) +{ + ot->name= "Move Up Keyed Target"; + ot->description= "Move keyed particle target up in the list."; + ot->idname= "PARTICLE_OT_keyed_target_move_up"; + + ot->exec= keyed_target_move_up_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/************************ move down modifier operator *********************/ + +static int keyed_target_move_down_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); + ParticleSystem *psys= ptr.data; + Object *ob = ptr.id.data; + KeyedParticleTarget *kpt; + + if(!psys) + return OPERATOR_CANCELLED; + kpt = psys->keyed_targets.first; + for(; kpt; kpt=kpt->next) { + if(kpt->flag & KEYED_TARGET_CURRENT && kpt->next) { + BLI_remlink(&psys->keyed_targets, kpt); + BLI_insertlink(&psys->keyed_targets, kpt->next, kpt); + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + break; + } + } + + return OPERATOR_FINISHED; +} + +void PARTICLE_OT_keyed_target_move_down(wmOperatorType *ot) +{ + ot->name= "Move Down Keyed Target"; + ot->description= "Move keyed particle target down in the list."; + ot->idname= "PARTICLE_OT_keyed_target_move_down"; + + ot->exec= keyed_target_move_down_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index f7be323a4c5..6cdb4dbf93d 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -224,6 +224,10 @@ void buttons_operatortypes(void) WM_operatortype_append(OBJECT_OT_particle_system_remove); WM_operatortype_append(PARTICLE_OT_new); + WM_operatortype_append(PARTICLE_OT_new_keyed_target); + WM_operatortype_append(PARTICLE_OT_remove_keyed_target); + WM_operatortype_append(PARTICLE_OT_keyed_target_move_up); + WM_operatortype_append(PARTICLE_OT_keyed_target_move_down); } void buttons_keymap(struct wmWindowManager *wm) diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index e8749537f5e..f83a0b9686e 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3161,15 +3161,11 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv /* 2. */ if(part->phystype==PART_PHYS_KEYED){ - if(psys->flag & PSYS_FIRST_KEYED){ - if(psys->flag&PSYS_KEYED){ - select=psys_count_keyed_targets(ob,psys); - if(psys->totkeyed==0) - return; - } + if(psys->flag&PSYS_KEYED){ + psys_count_keyed_targets(ob,psys); + if(psys->totkeyed==0) + return; } - else - return; } if(select){ @@ -3226,8 +3222,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv else draw_as = part->draw_as; - if(part->flag&PART_GLOB_TIME) - cfra=bsystem_time(scene, 0, (float)CFRA, 0.0f); + //if(part->flag&PART_GLOB_TIME) + cfra=bsystem_time(scene, 0, (float)CFRA, 0.0f); if(draw_as==PART_DRAW_PATH && psys->pathcache==NULL) draw_as=PART_DRAW_DOT; @@ -3306,8 +3302,10 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(draw_as && draw_as!=PART_DRAW_PATH) { int tot_vec_size = (totpart + totchild) * 3 * sizeof(float); - if(part->draw_as == PART_DRAW_REND && part->trail_count > 1) + if(part->draw_as == PART_DRAW_REND && part->trail_count > 1) { tot_vec_size *= part->trail_count; + psys_make_temp_pointcache(ob, psys); + } if(draw_as!=PART_DRAW_CIRC) { switch(draw_as) { @@ -3361,8 +3359,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv pa_dietime = pa->dietime; pa_size=pa->size; - if((part->flag&PART_ABS_TIME)==0){ -#if 0 // XXX old animation system +#if 0 // XXX old animation system + if((part->flag&PART_ABS_TIME)==0){ if(ma && ma->ipo){ IpoCurve *icu; @@ -3389,8 +3387,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv pa_size = icu->curval; } } -#endif // XXX old animation system } +#endif // XXX old animation system r_tilt = 1.0f + pa->r_ave[0]; r_length = 0.5f * (1.0f + pa->r_ave[1]); @@ -3400,9 +3398,9 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv pa_time=psys_get_child_time(psys,cpa,cfra,&pa_birthtime,&pa_dietime); +#if 0 // XXX old animation system if((part->flag&PART_ABS_TIME)==0) { if(ma && ma->ipo){ -#if 0 // XXX old animation system IpoCurve *icu; /* correction for lifetime */ @@ -3416,9 +3414,9 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv else if(icu->adrcode == MA_COL_B) ma_b = icu->curval; } -#endif // XXX old animation system } } +#endif // XXX old animation system pa_size=psys_get_child_size(psys,cpa,cfra,0); @@ -3444,7 +3442,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv else if(ct < 0.0f || ct > 1.0f) continue; - state.time = (part->draw & PART_ABS_PATH_TIME) ? -ct : ct; + state.time = (part->draw & PART_ABS_PATH_TIME) ? -ct : -(pa_birthtime + ct * (pa_dietime - pa_birthtime)); psys_get_particle_on_path(scene,ob,psys,a,&state,need_v); if(psys->parent) diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index c793362c223..0b3309bfc0c 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -61,6 +61,14 @@ typedef struct ChildParticle { float rand[3]; } ChildParticle; +typedef struct KeyedParticleTarget { + struct KeyedParticleTarget *next, *prev; + struct Object *ob; + int psys; + short flag, rt; + float time, duration; +} KeyedParticleTarget; + /* Everything that's non dynamic for a particle: */ typedef struct ParticleData { struct Object *stick_ob;/* object that particle sticks to when dead */ @@ -131,7 +139,7 @@ typedef struct ParticleSettings { /* general values */ float sta, end, lifetime, randlife; - float timetweak, jitfac, keyed_time, eff_hair; + float timetweak, jitfac, eff_hair; int totpart, userjit, grid_res; /* initial velocity factors */ @@ -142,11 +150,11 @@ typedef struct ParticleSettings { /* global physical properties */ float acc[3], dragfac, brownfac, dampfac; /* length */ - float length, abslength, randlength; + float randlength; /* children */ int child_nbr, ren_child_nbr; float parents, childsize, childrandsize; - float childrad, childflat, childspread; + float childrad, childflat, rt; /* clumping */ float clumpfac, clumppow; /* kink */ @@ -155,12 +163,16 @@ typedef struct ParticleSettings { float rough1, rough1_size; float rough2, rough2_size, rough2_thres; float rough_end, rough_end_shape; + /* length */ + float clength, clength_thres; /* branching */ float branch_thres; /* drawing stuff */ float draw_line[2]; float path_start, path_end; int trail_count; + /* keyed particles */ + int keyed_loops; /* boids */ float max_vel, max_lat_acc, max_tan_acc; @@ -195,17 +207,18 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in struct SoftBody *soft; /* hair softbody */ struct Object *target_ob; - struct Object *keyed_ob; struct Object *lattice; struct Object *parent; /* particles from global space -> parent space */ struct ListBase effectors, reactevents; /* runtime */ + + struct ListBase keyed_targets; float imat[4][4]; /* used for duplicators */ float cfra; int seed; int flag, totpart, totchild, totcached, totchildcache, rt; - short recalc, target_psys, keyed_psys, totkeyed, softflag, bakespace; + short recalc, target_psys, totkeyed, softflag, bakespace, rt2; char bb_uvname[3][32]; /* billboard uv name */ @@ -255,10 +268,10 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in #define PART_ROT_DYN (1<<14) /* dynamic rotation */ #define PART_SIZEMASS (1<<16) -#define PART_ABS_LENGTH (1<<15) +//#define PART_KEYED_TIMING (1<<15) -#define PART_ABS_TIME (1<<17) -#define PART_GLOB_TIME (1<<18) +//#define PART_ABS_TIME (1<<17) +//#define PART_GLOB_TIME (1<<18) #define PART_BOIDS_2D (1<<19) @@ -396,14 +409,15 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in #define PSYS_RECALC_RESET 2 /* reset everything including pointcache */ #define PSYS_RECALC_TYPE 4 /* handle system type change */ #define PSYS_RECALC_CHILD 16 /* only child settings changed */ +#define PSYS_RECALC_PHYS 32 /* physics type changed */ /* psys->flag */ #define PSYS_CURRENT 1 //#define PSYS_BAKING 2 //#define PSYS_BAKE_UI 4 -#define PSYS_KEYED_TIME 8 +#define PSYS_KEYED_TIMING 8 #define PSYS_ENABLED 16 /* deprecated */ -#define PSYS_FIRST_KEYED 32 +//#define PSYS_FIRST_KEYED 32 #define PSYS_DRAWING 64 //#define PSYS_SOFT_BAKE 128 #define PSYS_DELETE 256 /* remove particlesystem as soon as possible */ @@ -458,6 +472,10 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in #define BOID_GOAL 6 #define BOID_LEVEL 7 +/* psys->keyed_targets->flag */ +#define KEYED_TARGET_CURRENT 1 +#define KEYED_TARGET_VALID 2 + //#define PSYS_INTER_CUBIC 0 //#define PSYS_INTER_LINEAR 1 diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 3631d83310a..ed1a8052acd 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -221,6 +221,7 @@ extern StructRNA RNA_Key; extern StructRNA RNA_KeyboardSensor; extern StructRNA RNA_KeyingSet; extern StructRNA RNA_KeyingSetPath; +extern StructRNA RNA_KeyedParticleTarget; extern StructRNA RNA_KinematicConstraint; extern StructRNA RNA_Lamp; extern StructRNA RNA_LampSkySettings; diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 98ed12afd5a..39411752792 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -140,6 +140,35 @@ static void rna_Particle_reset(bContext *C, PointerRNA *ptr) } } +static void rna_Particle_keyed_reset(bContext *C, PointerRNA *ptr) +{ + Scene *scene = CTX_data_scene(C); + + if(ptr->type==&RNA_KeyedParticleTarget) { + Object *ob = (Object*)ptr->id.data; + ParticleSystem *psys = psys_get_current(ob); + + psys->recalc = PSYS_RECALC_RESET; + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_scene_sort(scene); + } +} + +static void rna_Particle_keyed_redo(bContext *C, PointerRNA *ptr) +{ + Scene *scene = CTX_data_scene(C); + + if(ptr->type==&RNA_KeyedParticleTarget) { + Object *ob = (Object*)ptr->id.data; + ParticleSystem *psys = psys_get_current(ob); + + psys->recalc = PSYS_RECALC_REDO; + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + } +} + static void rna_Particle_change_type(bContext *C, PointerRNA *ptr) { Scene *scene = CTX_data_scene(C); @@ -161,6 +190,13 @@ static void rna_Particle_change_type(bContext *C, PointerRNA *ptr) } } +static void rna_Particle_change_physics(bContext *C, PointerRNA *ptr) +{ + Scene *scene = CTX_data_scene(C); + ParticleSettings *part = ptr->id.data; + psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET|PSYS_RECALC_PHYS); +} + static void rna_Particle_redo_child(bContext *C, PointerRNA *ptr) { Scene *scene = CTX_data_scene(C); @@ -299,6 +335,97 @@ static void rna_ParticleSystem_name_get(PointerRNA *ptr, char *str) strcpy(str, ""); } +static PointerRNA rna_ParticleSystem_active_keyed_target_get(PointerRNA *ptr) +{ + ParticleSystem *psys= (ParticleSystem*)ptr->data; + KeyedParticleTarget *kpt = psys->keyed_targets.first; + + for(; kpt; kpt=kpt->next) { + if(kpt->flag & KEYED_TARGET_CURRENT) + return rna_pointer_inherit_refine(ptr, &RNA_KeyedParticleTarget, kpt); + } + return rna_pointer_inherit_refine(ptr, &RNA_KeyedParticleTarget, NULL); +} +static void rna_ParticleSystem_active_keyed_target_index_range(PointerRNA *ptr, int *min, int *max) +{ + ParticleSystem *psys= (ParticleSystem*)ptr->data; + *min= 0; + *max= BLI_countlist(&psys->keyed_targets)-1; + *max= MAX2(0, *max); +} + +static int rna_ParticleSystem_active_keyed_target_index_get(PointerRNA *ptr) +{ + ParticleSystem *psys= (ParticleSystem*)ptr->data; + KeyedParticleTarget *kpt = psys->keyed_targets.first; + int i=0; + + for(; kpt; kpt=kpt->next, i++) + if(kpt->flag & KEYED_TARGET_CURRENT) + return i; + + return 0; +} + +static void rna_ParticleSystem_active_keyed_target_index_set(struct PointerRNA *ptr, int value) +{ + ParticleSystem *psys= (ParticleSystem*)ptr->data; + KeyedParticleTarget *kpt = psys->keyed_targets.first; + int i=0; + + for(; kpt; kpt=kpt->next, i++) { + if(i==value) + kpt->flag |= KEYED_TARGET_CURRENT; + else + kpt->flag &= ~KEYED_TARGET_CURRENT; + } +} +static int rna_KeyedParticleTarget_name_length(PointerRNA *ptr) +{ + KeyedParticleTarget *kpt= ptr->data; + + if(kpt->flag & KEYED_TARGET_VALID) { + if(kpt->ob) + return strlen(kpt->ob->id.name+2) + 4; + else + return 20; + } + else + return 15; + + return 0; +} + +static void rna_KeyedParticleTarget_name_get(PointerRNA *ptr, char *str) +{ + KeyedParticleTarget *kpt= ptr->data; + + if(kpt->flag & KEYED_TARGET_VALID) { + if(kpt->ob) + sprintf(str, "%s: %i", kpt->ob->id.name+2, kpt->psys); + else + sprintf(str, "Particle System: %i", kpt->psys); + + } + else + strcpy(str, "Invalid target!"); +} + +static EnumPropertyItem from_items[] = { + {PART_FROM_VERT, "VERT", 0, "Vertexes", ""}, + {PART_FROM_FACE, "FACE", 0, "Faces", ""}, + {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""}, + {0, NULL, 0, NULL, NULL} +}; + +static EnumPropertyItem reactor_from_items[] = { + {PART_FROM_VERT, "VERT", 0, "Vertexes", ""}, + {PART_FROM_FACE, "FACE", 0, "Faces", ""}, + {PART_FROM_VOLUME, "VOLUME", 0, "Volume", ""}, + {PART_FROM_PARTICLE, "PARTICLE", 0, "Particle", ""}, + {0, NULL, 0, NULL, NULL} +}; + static EnumPropertyItem *rna_Particle_from_itemf(bContext *C, PointerRNA *ptr, int *free) { ParticleSettings *part = ptr->id.data; @@ -660,16 +787,19 @@ static void rna_def_particle_settings(BlenderRNA *brna) /* flag */ prop= RNA_def_property(srna, "react_start_end", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_STA_END); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Start/End", "Give birth to unreacted particles eventually."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "react_multiple", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_MULTIPLE); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Multi React", "React multiple times."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "loop", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_LOOP); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Loop", "Loop particle lives."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); @@ -690,54 +820,46 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "trand", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_TRAND); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Random", "Emit in random order of elements"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "even_distribution", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_EDISTR); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Even Distribution", "Use even distribution from faces based on face areas or edge lengths."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "sticky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_STICKY); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Sticky", "Particles stick to collided objects if they die in the collision."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "die_on_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIE_ON_COL); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Die on hit", "Particles die when they collide with a deflector object."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "size_deflect", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZE_DEFL); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Size Deflect", "Use particle's size in deflection."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "rotation_dynamic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ROT_DYN); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Dynamic", "Sets rotation to dynamic/constant"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "sizemass", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZEMASS); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Mass from Size", "Multiply mass with particle size."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); - prop= RNA_def_property(srna, "abs_length", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ABS_LENGTH); - RNA_def_property_ui_text(prop, "Abs Length", "Use maximum length for children"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); - - //prop= RNA_def_property(srna, "absolute_time", PROP_BOOLEAN, PROP_NONE); - //RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ABS_TIME); - //RNA_def_property_ui_text(prop, "Absolute Time", "Set all ipos that work on particles to be calculated in absolute/relative time."); - //RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); - - //prop= RNA_def_property(srna, "global_time", PROP_BOOLEAN, PROP_NONE); - //RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GLOB_TIME); - //RNA_def_property_ui_text(prop, "Global Time", "Set all ipos that work on particles to be calculated in global/object time."); - //RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); - prop= RNA_def_property(srna, "boids_2d", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BOIDS_2D); RNA_def_property_ui_text(prop, "Boids 2D", "Constrain boids to a surface"); @@ -796,18 +918,21 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, type_items); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Type", ""); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_change_type"); prop= RNA_def_property(srna, "emit_from", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "from"); RNA_def_property_enum_items(prop, part_reactor_from_items); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_from_itemf"); RNA_def_property_ui_text(prop, "Emit From", "Where to emit particles from"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "distr"); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_items(prop, dist_items); RNA_def_property_ui_text(prop, "Distribution", "How to distribute particles on selected element"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); @@ -815,24 +940,28 @@ static void rna_def_particle_settings(BlenderRNA *brna) /* physics modes */ prop= RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "phystype"); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_items(prop, phys_type_items); RNA_def_property_ui_text(prop, "Physics Type", "Particle physics type"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_change_physics"); prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rotmode"); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_items(prop, rot_mode_items); RNA_def_property_ui_text(prop, "Rotation", "Particles initial rotation"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "angular_velocity_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "avemode"); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_items(prop, ave_mode_items); RNA_def_property_ui_text(prop, "Angular Velocity Mode", "Particle angular velocity mode."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "react_event", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "reactevent"); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_items(prop, react_event_items); RNA_def_property_ui_text(prop, "React On", "The event of target particles to react on."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); @@ -843,11 +972,6 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Velocity", "Show particle velocity"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); - //prop= RNA_def_property(srna, "draw_path_length", PROP_BOOLEAN, PROP_NONE); - //RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_PATH_LEN); - //RNA_def_property_ui_text(prop, "Path length", "Draw path length"); - //RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); - prop= RNA_def_property(srna, "show_size", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_SIZE); RNA_def_property_ui_text(prop, "Size", "Show particle size"); @@ -936,7 +1060,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "childtype"); RNA_def_property_enum_items(prop, child_type_items); RNA_def_property_ui_text(prop, "Children From", "Create child particles"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 7); @@ -1091,12 +1215,15 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sta");//optional if prop names are the same RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_start_set", NULL); RNA_def_property_ui_text(prop, "Start", "Frame # to start emitting particles."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "end", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); + + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_end_set", NULL); RNA_def_property_ui_text(prop, "End", "Frame # to stop emitting particles."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); @@ -1119,38 +1246,35 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "jitter_factor", PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_float_sdna(prop, NULL, "jitfac"); RNA_def_property_range(prop, 0.0f, 2.0f); RNA_def_property_ui_text(prop, "Amount", "Amount of jitter applied to the sampling."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); - prop= RNA_def_property(srna, "keyed_time", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Time", "Keyed key time relative to remaining particle life."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); - prop= RNA_def_property(srna, "effect_hair", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "eff_hair"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Stiffnes", "Hair stiffness for effectors"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); - //float rt; TODO:find where rt is used - can't find it in UI - prop= RNA_def_property(srna, "amount", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "totpart"); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_range(prop, 0, 100000); RNA_def_property_ui_text(prop, "Amount", "Total number of particles."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "userjit", PROP_INT, PROP_UNSIGNED);//TODO: can we get a better name for userjit? RNA_def_property_int_sdna(prop, NULL, "userjit"); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_range(prop, 0, 1000); RNA_def_property_ui_text(prop, "P/F", "Emission locations / face (0 = automatic)."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "grid_resolution", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "grid_res"); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_text(prop, "Resolution", "The resolution of the particle grid."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); @@ -1273,19 +1397,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Damp", "Specify the amount of damping"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); - /* length */ - //TODO: is this readonly? - prop= RNA_def_property(srna, "length", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "length"); -// RNA_def_property_range(prop, 0.0f, upperLimitf);//TODO: limits - RNA_def_property_ui_text(prop, "Length", ""); - - prop= RNA_def_property(srna, "absolute_length", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "abslength"); - RNA_def_property_range(prop, 0.0f, 10000.0f); - RNA_def_property_ui_text(prop, "Max Length", "Absolute maximum path length for children, in blender units."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); - + /* random length */ prop= RNA_def_property(srna, "random_length", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "randlength"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -1334,13 +1446,6 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Child Roundness", "Roundness of children around parent."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); - //TODO: is this readonly? - prop= RNA_def_property(srna, "child_spread", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "childspread"); -// RNA_def_property_range(prop, 0.0f, upperLimitf); TODO: limits - RNA_def_property_ui_text(prop, "Child Spread", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); - /* clumping */ prop= RNA_def_property(srna, "clump_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clumpfac"); @@ -1414,6 +1519,18 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Shape", "Shape of end point rough"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + prop= RNA_def_property(srna, "child_length", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "clength"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Length", "Length of child paths"); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + + prop= RNA_def_property(srna, "child_length_thres", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "clength_thres"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by child path length."); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + /* branching */ prop= RNA_def_property(srna, "branch_threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "branch_thres"); @@ -1451,7 +1568,14 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, 1.0f, 100.0f); RNA_def_property_ui_text(prop, "Trail Count", "Number of trail particles."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); - + + /* keyed particles */ + prop= RNA_def_property(srna, "keyed_loops", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "keyed_loops"); + RNA_def_property_range(prop, 1.0f, 100.0f); + RNA_def_property_ui_text(prop, "Loop count", "Number of times the keys are looped."); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + /* boids */ prop= RNA_def_property(srna, "max_velocity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max_vel"); @@ -1494,14 +1618,6 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Ground Z", "Default Z value"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); - /*TODO: not sure how to deal with this - prop= RNA_def_property(srna, "boid_factor", PROP_FLOAT, PROP_VECTOR); - RNA_def_property_float_sdna(prop, NULL, "boidfac"); - RNA_def_property_ui_text(prop, "Boid Factor", ""); - - //char boidrule[8]; - */ - prop= RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "dup_group"); RNA_def_property_struct_type(prop, "Group"); @@ -1537,6 +1653,52 @@ static void rna_def_particle_settings(BlenderRNA *brna) // struct PartDeflect *pd2; } +static void rna_def_keyed_particle_target(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna = RNA_def_struct(brna, "KeyedParticleTarget", NULL); + RNA_def_struct_ui_text(srna, "Keyed Particle Target", "Target particle system for keyed particles."); + + prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); + RNA_def_property_string_funcs(prop, "rna_KeyedParticleTarget_name_get", "rna_KeyedParticleTarget_name_length", NULL); + RNA_def_property_ui_text(prop, "Name", "Keyed particle target name."); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_struct_name_property(srna, prop); + + prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "ob"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Target Object", "The object that has the target particle system (empty if same object)."); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_keyed_reset"); + + prop= RNA_def_property(srna, "system", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "psys"); + RNA_def_property_range(prop, 1, INT_MAX); + RNA_def_property_ui_text(prop, "Target Particle System", "The index of particle system on the target object."); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_keyed_reset"); + + prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "time"); + RNA_def_property_range(prop, 0.0, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5 + RNA_def_property_ui_text(prop, "Time", ""); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_keyed_redo"); + + prop= RNA_def_property(srna, "duration", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "duration"); + RNA_def_property_range(prop, 0.0, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5 + RNA_def_property_ui_text(prop, "Duration", ""); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_keyed_redo"); + + prop= RNA_def_property(srna, "valid", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYED_TARGET_VALID); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); + RNA_def_property_ui_text(prop, "Valid", "Keyed particles target is valid."); + + + +} static void rna_def_particle_system(BlenderRNA *brna) { StructRNA *srna; @@ -1604,34 +1766,33 @@ static void rna_def_particle_system(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); /* boids */ - prop= RNA_def_property(srna, "boids_surface_object", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "keyed_ob"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Boids Surface Object", "For boids physics systems, constrain boids to this object's surface."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + //prop= RNA_def_property(srna, "boids_surface_object", PROP_POINTER, PROP_NONE); + //RNA_def_property_pointer_sdna(prop, NULL, "keyed_ob"); + //RNA_def_property_flag(prop, PROP_EDITABLE); + //RNA_def_property_ui_text(prop, "Boids Surface Object", "For boids physics systems, constrain boids to this object's surface."); + //RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); /* keyed */ - prop= RNA_def_property(srna, "keyed_object", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "keyed_ob"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Keyed Object", "For keyed physics systems, the object that has the target particle system."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + prop= RNA_def_property(srna, "keyed_timing", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_KEYED_TIMING); + RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); + RNA_def_property_ui_text(prop, "Keyed timing", "Use key times"); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); - prop= RNA_def_property(srna, "keyed_particle_system", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_sdna(prop, NULL, "keyed_psys"); - RNA_def_property_range(prop, 1, INT_MAX); - RNA_def_property_ui_text(prop, "Keyed Particle System", "For keyed physics systems, index of particle system on the keyed object."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + prop= RNA_def_property(srna, "keyed_targets", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "keyed_targets", NULL); + RNA_def_property_struct_type(prop, "KeyedParticleTarget"); + RNA_def_property_ui_text(prop, "Keyed Targets", "Target particle systems for keyed particles"); - prop= RNA_def_property(srna, "keyed_first", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_FIRST_KEYED); - RNA_def_property_ui_text(prop, "Keyed First", "Set the system to be the starting point of keyed particles"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + prop= RNA_def_property(srna, "active_keyed_target", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "KeyedParticleTarget"); + RNA_def_property_pointer_funcs(prop, "rna_ParticleSystem_active_keyed_target_get", NULL, NULL); + RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed"); + + prop= RNA_def_property(srna, "active_keyed_target_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_funcs(prop, "rna_ParticleSystem_active_keyed_target_index_get", "rna_ParticleSystem_active_keyed_target_index_set", "rna_ParticleSystem_active_keyed_target_index_range"); + RNA_def_property_ui_text(prop, "Active Particle System Index", "Index of active particle system slot."); - prop= RNA_def_property(srna, "keyed_timed", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_KEYED_TIME); - RNA_def_property_ui_text(prop, "Keyed Timed", "Use intermediate key times for keyed particles (setting for starting point only)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); /* billboard */ prop= RNA_def_property(srna, "billboard_normal_uv", PROP_STRING, PROP_NONE); @@ -1782,7 +1943,6 @@ static void rna_def_particle_system(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Parent", "Use this object's coordinate system instead of global coordinate system."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); - } void RNA_def_particle(BlenderRNA *brna) @@ -1791,6 +1951,7 @@ void RNA_def_particle(BlenderRNA *brna) rna_def_particle_key(brna); rna_def_child_particle(brna); rna_def_particle(brna); + rna_def_keyed_particle_target(brna); rna_def_particle_system(brna); rna_def_particle_settings(brna); } diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 74686511b21..1d6d98bebdf 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -1513,12 +1513,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem return 1; /* 2. start initialising things */ - if(part->phystype==PART_PHYS_KEYED){ - if(psys->flag & PSYS_FIRST_KEYED) - psys_count_keyed_targets(ob,psys); - else - return 1; - } + if(part->phystype==PART_PHYS_KEYED) + psys_count_keyed_targets(ob,psys); /* last possibility to bail out! */ psmd= psys_get_modifier(ob,psys); @@ -1606,10 +1602,10 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem calc_ipo(part->ipo, cfra); execute_ipo((ID *)part, part->ipo); } -#endif // XXX old animation system if(part->flag & PART_GLOB_TIME) - cfra = bsystem_time(re->scene, 0, (float)re->scene->r.cfra, 0.0); +#endif // XXX old animation system + cfra = bsystem_time(re->scene, 0, (float)re->scene->r.cfra, 0.0); /* 2.4 setup reactors */ if(part->type == PART_REACTOR){ @@ -1707,8 +1703,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem pa_time=(cfra-pa->time)/pa->lifetime; pa_birthtime = pa->time; pa_dietime = pa->dietime; - if((part->flag&PART_ABS_TIME) == 0){ #if 0 // XXX old animation system + if((part->flag&PART_ABS_TIME) == 0){ if(ma->ipo) { /* correction for lifetime */ calc_ipo(ma->ipo, 100.0f * pa_time); @@ -1719,8 +1715,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem calc_ipo(part->ipo, 100.0f*pa_time); execute_ipo((ID *)part, part->ipo); } -#endif // XXX old animation system } +#endif // XXX old animation system hasize = ma->hasize; @@ -1767,8 +1763,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem pa_time = psys_get_child_time(psys, cpa, cfra, &pa_birthtime, &pa_dietime); - if((part->flag & PART_ABS_TIME) == 0) { #if 0 // XXX old animation system + if((part->flag & PART_ABS_TIME) == 0) { if(ma->ipo){ /* correction for lifetime */ calc_ipo(ma->ipo, 100.0f * pa_time); @@ -1779,8 +1775,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem calc_ipo(part->ipo, 100.0f * pa_time); execute_ipo((ID *)part, part->ipo); } -#endif // XXX old animation system } +#endif // XXX old animation system pa_size = psys_get_child_size(psys, cpa, cfra, &pa_time); -- cgit v1.2.3 From 26ef6da24b3324fb6f8ab6cfe12f101f0d7dedb4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 13 Jul 2009 00:40:20 +0000 Subject: 2.5 * Objects now support up to 32767 material slots. It's easy to increase this further, but I prefer not to increase the memory usage of mesh faces, it seems unlikely that someone would create 32767 distinct materials? * Forward compatibility: the only thing you can potentially lose reading a 2.5 file in 2.4 is object linking (instead of default data), though usually that will go fine too. Reading files with > 32 material slots in 2.4 can start giving issues. * The ob->colbits variable is deprecated by the array ob->matbits but I didn't remove the ob->colbits updates in very few places it is set. * I hope I changed all the relevant things, various places just hardcoded the number 16 instead of using the MAXMAT define. * Join Objects operator back. This is using the version from the animsys2 branch coded by Joshua, which means it now supports joining of shape keys. * Fix for crash reading file saved during render. --- source/blender/blenkernel/intern/exotic.c | 19 +- source/blender/blenkernel/intern/material.c | 52 +- source/blender/blenkernel/intern/object.c | 7 +- source/blender/blenkernel/intern/texture.c | 2 +- source/blender/blenlib/BLI_editVert.h | 3 +- source/blender/blenloader/intern/readfile.c | 10 + source/blender/blenloader/intern/writefile.c | 1 + source/blender/editors/armature/editarmature.c | 147 +++--- source/blender/editors/curve/editcurve.c | 85 ++-- source/blender/editors/include/ED_armature.h | 2 + source/blender/editors/include/ED_curve.h | 3 + source/blender/editors/include/ED_mesh.h | 3 + source/blender/editors/include/ED_transform.h | 1 + source/blender/editors/mesh/editmesh.c | 14 +- source/blender/editors/mesh/meshtools.c | 529 +++++++++++++-------- source/blender/editors/object/object_edit.c | 48 +- source/blender/editors/object/object_intern.h | 1 + source/blender/editors/object/object_ops.c | 2 + source/blender/editors/space_image/image_ops.c | 2 - source/blender/editors/space_outliner/outliner.c | 10 +- source/blender/editors/space_view3d/drawobject.c | 38 +- source/blender/gpu/GPU_draw.h | 4 +- source/blender/gpu/intern/gpu_draw.c | 52 +- source/blender/makesdna/DNA_material_types.h | 8 +- source/blender/makesdna/DNA_meshdata_types.h | 7 +- source/blender/makesdna/DNA_object_types.h | 14 +- source/blender/makesrna/intern/rna_curve.c | 1 - source/blender/makesrna/intern/rna_mesh.c | 1 - source/blender/makesrna/intern/rna_object.c | 12 +- .../blender/render/intern/source/convertblender.c | 44 +- 30 files changed, 683 insertions(+), 439 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index 4e7e76dfae3..c7a8b150d3a 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -1415,11 +1415,6 @@ static void displist_to_mesh(Scene *scene, DispList *dlfirst) return; } - if(totcol>16) { - //XXX error("Found more than 16 different colors"); - totcol= 16; - } - vec[0]= (min[0]+max[0])/2; vec[1]= (min[1]+max[1])/2; vec[2]= (min[2]+max[2])/2; @@ -1433,6 +1428,7 @@ static void displist_to_mesh(Scene *scene, DispList *dlfirst) /* colors */ if(totcol) { ob->mat= MEM_callocN(sizeof(void *)*totcol, "ob->mat"); + ob->matbits= MEM_callocN(sizeof(char)*totcol, "ob->matbits"); me->mat= MEM_callocN(sizeof(void *)*totcol, "me->mat"); me->totcol= totcol; ob->totcol= (unsigned char) me->totcol; @@ -1482,7 +1478,7 @@ static void displist_to_mesh(Scene *scene, DispList *dlfirst) dl= dlfirst; while(dl) { - colnr= (dl->col>15 ? 15: dl->col); + colnr= dl->col; if(colnr) colnr--; if(dl->type==DL_SURF) { @@ -2804,8 +2800,11 @@ static void dxf_add_mat (Object *ob, Mesh *me, float color[3], char *layer) if (!me) return; - if(ob) ob->mat= MEM_callocN(sizeof(void *)*1, "ob->mat"); - if(ob) ob->actcol= 1; + if(ob) { + ob->mat= MEM_callocN(sizeof(void *)*1, "ob->mat"); + ob->matbits= MEM_callocN(sizeof(char)*1, "ob->matbits"); + ob->actcol= 1; + } me->totcol= 1; me->mat= MEM_callocN(sizeof(void *)*1, "me->mat"); @@ -4053,7 +4052,6 @@ static void dxf_read(Scene *scene, char *filename) ob->type= OB_MESH; ob->dt= OB_SHADED; - if(U.flag & USER_MAT_ON_OB) ob->colbits= -1; ob->trackflag= OB_POSY; ob->upflag= OB_POSZ; @@ -4072,9 +4070,10 @@ static void dxf_read(Scene *scene, char *filename) VECCOPY(ob->rot, obrot); ob->mat= MEM_callocN(sizeof(void *)*1, "ob->mat"); + ob->matbits= MEM_callocN(sizeof(char)*1, "ob->matbits"); ob->totcol= (unsigned char) ((Mesh*)ob->data)->totcol; ob->actcol= 1; - + /* note: materials are either linked to mesh or object, if both then you have to increase user counts. below line is not needed. I leave it commented out here as warning (ton) */ diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 57b88bb0b3f..d1fdac65dbb 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -43,6 +43,7 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_texture_types.h" +#include "DNA_userdef_types.h" #include "BLI_blenlib.h" #include "BLI_arithb.h" @@ -445,7 +446,7 @@ Material *give_current_material(Object *ob, int act) if(act>ob->totcol) act= ob->totcol; else if(act<=0) act= 1; - if( BTST(ob->colbits, act-1) ) { /* in object */ + if(ob->matbits[act-1]) { /* in object */ ma= ob->mat[act-1]; } else { /* in data */ @@ -473,7 +474,7 @@ ID *material_from(Object *ob, int act) if(ob->totcol==0) return ob->data; if(act==0) act= 1; - if( BTST(ob->colbits, act-1) ) return (ID *)ob; + if(ob->matbits[act-1]) return (ID *)ob; else return ob->data; } @@ -498,6 +499,7 @@ void test_object_materials(ID *id) Curve *cu; MetaBall *mb; Material **newmatar; + char *newmatbits; int totcol=0; if(id==0) return; @@ -524,16 +526,22 @@ void test_object_materials(ID *id) if(totcol==0) { if(ob->totcol) { MEM_freeN(ob->mat); - ob->mat= 0; + MEM_freeN(ob->matbits); + ob->mat= NULL; + ob->matbits= NULL; } } else if(ob->totcoltotcol) { memcpy(newmatar, ob->mat, sizeof(void *)*ob->totcol); + memcpy(newmatbits, ob->matbits, sizeof(char)*ob->totcol); MEM_freeN(ob->mat); + MEM_freeN(ob->matbits); } ob->mat= newmatar; + ob->matbits= newmatbits; } ob->totcol= totcol; if(ob->totcol && ob->actcol==0) ob->actcol= 1; @@ -547,6 +555,7 @@ void test_object_materials(ID *id) void assign_material(Object *ob, Material *ma, int act) { Material *mao, **matar, ***matarar; + char *matbits; short *totcolp; if(act>MAXMAT) return; @@ -559,29 +568,41 @@ void assign_material(Object *ob, Material *ma, int act) if(totcolp==0 || matarar==0) return; - if( act > *totcolp) { + if(act > *totcolp) { matar= MEM_callocN(sizeof(void *)*act, "matarray1"); - if( *totcolp) { - memcpy(matar, *matarar, sizeof(void *)*( *totcolp )); + + if(*totcolp) { + memcpy(matar, *matarar, sizeof(void *)*(*totcolp)); MEM_freeN(*matarar); } + *matarar= matar; *totcolp= act; } if(act > ob->totcol) { matar= MEM_callocN(sizeof(void *)*act, "matarray2"); + matbits= MEM_callocN(sizeof(char)*act, "matbits1"); if( ob->totcol) { memcpy(matar, ob->mat, sizeof(void *)*( ob->totcol )); + memcpy(matbits, ob->matbits, sizeof(char)*(*totcolp)); MEM_freeN(ob->mat); + MEM_freeN(ob->matbits); } ob->mat= matar; + ob->matbits= matbits; ob->totcol= act; + + /* copy object/mesh linking, or assign based on userpref */ + if(ob->actcol) + ob->matbits[act-1]= ob->matbits[ob->actcol-1]; + else + ob->matbits[act-1]= (U.flag & USER_MAT_ON_OB)? 1: 0; } /* do it */ - if( BTST(ob->colbits, act-1) ) { /* in object */ + if(ob->matbits[act-1]) { /* in object */ mao= ob->mat[act-1]; if(mao) mao->id.us--; ob->mat[act-1]= ma; @@ -591,6 +612,7 @@ void assign_material(Object *ob, Material *ma, int act) if(mao) mao->id.us--; (*matarar)[act-1]= ma; } + id_us_plus((ID *)ma); test_object_materials(ob->data); } @@ -630,12 +652,6 @@ void object_add_material_slot(Object *ob) ma->id.us= 0; /* eeh... */ - if(ob->actcol) { - if( BTST(ob->colbits, ob->actcol-1) ) { - ob->colbits= BSET(ob->colbits, ob->totcol); - } - } - assign_material(ob, ma, ob->totcol+1); ob->actcol= ob->totcol; } @@ -880,9 +896,8 @@ void object_remove_material_slot(Object *ob) if(mao) mao->id.us--; } - for(a=ob->actcol; atotcol; a++) { + for(a=ob->actcol; atotcol; a++) (*matarar)[a-1]= (*matarar)[a]; - } (*totcolp)--; if(*totcolp==0) { @@ -900,13 +915,18 @@ void object_remove_material_slot(Object *ob) mao= obt->mat[actcol-1]; if(mao) mao->id.us--; - for(a=actcol; atotcol; a++) obt->mat[a-1]= obt->mat[a]; + for(a=actcol; atotcol; a++) { + obt->mat[a-1]= obt->mat[a]; + obt->matbits[a-1]= obt->matbits[a]; + } obt->totcol--; if(obt->actcol > obt->totcol) obt->actcol= obt->totcol; if(obt->totcol==0) { MEM_freeN(obt->mat); + MEM_freeN(obt->matbits); obt->mat= 0; + obt->matbits= NULL; } } obt= obt->id.next; diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 7d6a83d7900..02c0d46a73f 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -243,7 +243,9 @@ void free_object(Object *ob) if(ob->mat[a]) ob->mat[a]->id.us--; } if(ob->mat) MEM_freeN(ob->mat); + if(ob->matbits) MEM_freeN(ob->matbits); ob->mat= 0; + ob->matbits= 0; if(ob->bb) MEM_freeN(ob->bb); ob->bb= 0; if(ob->path) free_path(ob->path); @@ -942,7 +944,6 @@ Object *add_only_object(int type, char *name) Mat4One(ob->parentinv); Mat4One(ob->obmat); ob->dt= OB_SHADED; - if(U.flag & USER_MAT_ON_OB) ob->colbits= -1; ob->empty_drawtype= OB_ARROWS; ob->empty_drawsize= 1.0; @@ -1170,6 +1171,7 @@ Object *copy_object(Object *ob) if(ob->totcol) { obn->mat= MEM_dupallocN(ob->mat); + obn->matbits= MEM_dupallocN(ob->matbits); } if(ob->bb) obn->bb= MEM_dupallocN(ob->bb); @@ -1397,7 +1399,9 @@ void object_make_proxy(Object *ob, Object *target, Object *gob) /* copy material and index information */ ob->actcol= ob->totcol= 0; if(ob->mat) MEM_freeN(ob->mat); + if(ob->matbits) MEM_freeN(ob->matbits); ob->mat = NULL; + ob->matbits= NULL; if ((target->totcol) && (target->mat) && ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL)) { //XXX OB_SUPPORT_MATERIAL int i; ob->colbits = target->colbits; @@ -1406,6 +1410,7 @@ void object_make_proxy(Object *ob, Object *target, Object *gob) ob->totcol= target->totcol; ob->mat = MEM_dupallocN(target->mat); + ob->matbits = MEM_dupallocN(target->matbits); for(i=0; itotcol; i++) { /* dont need to run test_object_materials since we know this object is new and not used elsewhere */ id_us_plus((ID *)ob->mat[i]); diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 66f7fe8a44b..bcdea06936f 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -784,7 +784,7 @@ Tex *give_current_texture(Object *ob, int act) if(act>ob->totcol) act= ob->totcol; else if(act==0) act= 1; - if( BTST(ob->colbits, act-1) ) { /* in object */ + if(ob->matbits[act-1]) { /* in object */ ma= ob->mat[act-1]; } else { /* in data */ diff --git a/source/blender/blenlib/BLI_editVert.h b/source/blender/blenlib/BLI_editVert.h index 758e3d136aa..56a20d8462a 100644 --- a/source/blender/blenlib/BLI_editVert.h +++ b/source/blender/blenlib/BLI_editVert.h @@ -125,10 +125,11 @@ typedef struct EditFace float fp; } tmp; float n[3], cent[3]; - unsigned char mat_nr, flag; + unsigned char flag; unsigned char f, f1, h; unsigned char fast; /* only 0 or 1, for editmesh_fastmalloc */ unsigned char fgonf; /* flag for fgon options */ + short mat_nr; void *data; /* custom face data */ } EditFace; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c2b19a804ee..21e173bd87d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3732,6 +3732,7 @@ static void direct_link_object(FileData *fd, Object *ob) ob->mat= newdataadr(fd, ob->mat); test_pointer_array(fd, (void **)&ob->mat); + ob->matbits= newdataadr(fd, ob->matbits); /* do it here, below old data gets converted */ direct_link_modifiers(fd, &ob->modifiers); @@ -4221,6 +4222,7 @@ static void direct_link_windowmanager(FileData *fd, wmWindowManager *wm) wm->paintcursors.first= wm->paintcursors.last= NULL; wm->queue.first= wm->queue.last= NULL; wm->reports.first= wm->reports.last= NULL; + wm->jobs.first= wm->jobs.last= NULL; wm->windrawable= NULL; wm->initialized= 0; @@ -9242,6 +9244,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ob->data = olddata; } + + if(ob->totcol && ob->matbits == NULL) { + int a; + + ob->matbits= MEM_callocN(sizeof(char)*ob->totcol, "ob->matbits"); + for(a=0; atotcol; a++) + ob->matbits[a]= ob->colbits & (1<mat.first; ma; ma = ma->id.next) { diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 65a4a355717..ebec409ddf4 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1131,6 +1131,7 @@ static void write_objects(WriteData *wd, ListBase *idbase, int write_undo) /* direct data */ writedata(wd, DATA, sizeof(void *)*ob->totcol, ob->mat); + writedata(wd, DATA, sizeof(char)*ob->totcol, ob->matbits); /* write_effects(wd, &ob->effect); */ /* not used anymore */ write_properties(wd, &ob->prop); write_sensors(wd, &ob->sensors); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 4312838cba5..d00f4c770d1 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -669,24 +669,21 @@ static void joined_armature_fix_links(Object *tarArm, Object *srcArm, bPoseChann } } -int join_armature(Scene *scene, View3D *v3d) +int join_armature_exec(bContext *C, wmOperator *op) { - Object *ob= scene->basact->object; // XXX context - bArmature *arm= ob->data; - Base *base, *nextbase; + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_active_object(C); + bArmature *arm= (ob)? ob->data: NULL; bPose *pose, *opose; bPoseChannel *pchan, *pchann; EditBone *curbone; float mat[4][4], oimat[4][4]; /* Ensure we're not in editmode and that the active object is an armature*/ - if (ob->type!=OB_ARMATURE) return 0; - if (arm->edbo) return 0; - - if (object_data_is_libdata(ob)) { - error_libdata(); - return 0; - } + if (!ob || ob->type!=OB_ARMATURE) + return OPERATOR_CANCELLED; + if (!arm || arm->edbo) + return OPERATOR_CANCELLED; /* Get editbones of active armature to add editbones to */ ED_armature_to_edit(ob); @@ -694,89 +691,89 @@ int join_armature(Scene *scene, View3D *v3d) /* get pose of active object and move it out of posemode */ pose= ob->pose; ob->flag &= ~OB_POSEMODE; - - for (base=FIRSTBASE; base; base=nextbase) { - nextbase = base->next; - if (TESTBASE(v3d, base)){ - if ((base->object->type==OB_ARMATURE) && (base->object!=ob)) { - bArmature *curarm= base->object->data; - - /* Make a list of editbones in current armature */ - ED_armature_to_edit(base->object); - - /* Get Pose of current armature */ - opose= base->object->pose; - base->object->flag &= ~OB_POSEMODE; - BASACT->flag &= ~OB_POSEMODE; + + CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) { + if ((base->object->type==OB_ARMATURE) && (base->object!=ob)) { + bArmature *curarm= base->object->data; + + /* Make a list of editbones in current armature */ + ED_armature_to_edit(base->object); + + /* Get Pose of current armature */ + opose= base->object->pose; + base->object->flag &= ~OB_POSEMODE; + BASACT->flag &= ~OB_POSEMODE; + + /* Find the difference matrix */ + Mat4Invert(oimat, ob->obmat); + Mat4MulMat4(mat, base->object->obmat, oimat); + + /* Copy bones and posechannels from the object to the edit armature */ + for (pchan=opose->chanbase.first; pchan; pchan=pchann) { + pchann= pchan->next; + curbone= editbone_name_exists(curarm->edbo, pchan->name); - /* Find the difference matrix */ - Mat4Invert(oimat, ob->obmat); - Mat4MulMat4(mat, base->object->obmat, oimat); + /* Get new name */ + unique_editbone_name(arm->edbo, curbone->name, NULL); - /* Copy bones and posechannels from the object to the edit armature */ - for (pchan=opose->chanbase.first; pchan; pchan=pchann) { - pchann= pchan->next; - curbone= editbone_name_exists(curarm->edbo, pchan->name); + /* Transform the bone */ + { + float premat[4][4]; + float postmat[4][4]; + float difmat[4][4]; + float imat[4][4]; + float temp[3][3]; + float delta[3]; - /* Get new name */ - unique_editbone_name(arm->edbo, curbone->name, NULL); + /* Get the premat */ + VecSubf(delta, curbone->tail, curbone->head); + vec_roll_to_mat3(delta, curbone->roll, temp); - /* Transform the bone */ - { - float premat[4][4]; - float postmat[4][4]; - float difmat[4][4]; - float imat[4][4]; - float temp[3][3]; - float delta[3]; - - /* Get the premat */ - VecSubf(delta, curbone->tail, curbone->head); - vec_roll_to_mat3(delta, curbone->roll, temp); - - Mat4One(premat); /* Mat4MulMat34 only sets 3x3 part */ - Mat4MulMat34(premat, temp, mat); - - Mat4MulVecfl(mat, curbone->head); - Mat4MulVecfl(mat, curbone->tail); - - /* Get the postmat */ - VecSubf(delta, curbone->tail, curbone->head); - vec_roll_to_mat3(delta, curbone->roll, temp); - Mat4CpyMat3(postmat, temp); - - /* Find the roll */ - Mat4Invert(imat, premat); - Mat4MulMat4(difmat, postmat, imat); - - curbone->roll -= (float)atan2(difmat[2][0], difmat[2][2]); - } + Mat4One(premat); /* Mat4MulMat34 only sets 3x3 part */ + Mat4MulMat34(premat, temp, mat); - /* Fix Constraints and Other Links to this Bone and Armature */ - joined_armature_fix_links(ob, base->object, pchan, curbone); + Mat4MulVecfl(mat, curbone->head); + Mat4MulVecfl(mat, curbone->tail); - /* Rename pchan */ - BLI_strncpy(pchan->name, curbone->name, sizeof(pchan->name)); + /* Get the postmat */ + VecSubf(delta, curbone->tail, curbone->head); + vec_roll_to_mat3(delta, curbone->roll, temp); + Mat4CpyMat3(postmat, temp); - /* Jump Ship! */ - BLI_remlink(curarm->edbo, curbone); - BLI_addtail(arm->edbo, curbone); + /* Find the roll */ + Mat4Invert(imat, premat); + Mat4MulMat4(difmat, postmat, imat); - BLI_remlink(&opose->chanbase, pchan); - BLI_addtail(&pose->chanbase, pchan); + curbone->roll -= (float)atan2(difmat[2][0], difmat[2][2]); } - ED_base_object_free_and_unlink(scene, base); + /* Fix Constraints and Other Links to this Bone and Armature */ + joined_armature_fix_links(ob, base->object, pchan, curbone); + + /* Rename pchan */ + BLI_strncpy(pchan->name, curbone->name, sizeof(pchan->name)); + + /* Jump Ship! */ + BLI_remlink(curarm->edbo, curbone); + BLI_addtail(arm->edbo, curbone); + + BLI_remlink(&opose->chanbase, pchan); + BLI_addtail(&pose->chanbase, pchan); } + + ED_base_object_free_and_unlink(scene, base); } } + CTX_DATA_END; DAG_scene_sort(scene); // because we removed object(s) ED_armature_from_edit(scene, ob); ED_armature_edit_free(ob); + + WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene); - return 1; + return OPERATOR_FINISHED; } /* Helper function for armature separating - link fixing */ diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index c437f35c484..51a9cf5c75a 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -4594,12 +4594,10 @@ void CURVE_OT_smooth_set(wmOperatorType *ot) /************** join operator, to be used externally? ****************/ -int join_curve(bContext *C, wmOperator *op, int type) +int join_curve_exec(bContext *C, wmOperator *op) { - View3D *v3d= CTX_wm_view3d(C); Scene *scene= CTX_data_scene(C); - Object *ob= CTX_data_edit_object(C); - Base *base, *nextb; + Object *ob= CTX_data_active_object(C); Curve *cu; Nurb *nu, *newnu; BezTriple *bezt; @@ -4608,64 +4606,51 @@ int join_curve(bContext *C, wmOperator *op, int type) float imat[4][4], cmat[4][4]; int a; - // XXX not integrated yet, to be called by object/ module? */ - - if(object_data_is_libdata(ob)) { - BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata"); - return OPERATOR_CANCELLED; - } - - if(ob->type!=type) - return 0; - tempbase.first= tempbase.last= 0; /* trasnform all selected curves inverse in obact */ Mat4Invert(imat, ob->obmat); - for(base= FIRSTBASE; base; base=nextb) { - nextb= base->next; - - if(TESTBASE(v3d, base)) { - if(base->object->type==type) { - if(base->object != ob) { - - cu= base->object->data; - - if(cu->nurb.first) { - /* watch it: switch order here really goes wrong */ - Mat4MulMat4(cmat, base->object->obmat, imat); + CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) { + if(base->object->type==ob->type) { + if(base->object != ob) { + + cu= base->object->data; + + if(cu->nurb.first) { + /* watch it: switch order here really goes wrong */ + Mat4MulMat4(cmat, base->object->obmat, imat); + + nu= cu->nurb.first; + while(nu) { + newnu= duplicateNurb(nu); + BLI_addtail(&tempbase, newnu); - nu= cu->nurb.first; - while(nu) { - newnu= duplicateNurb(nu); - BLI_addtail(&tempbase, newnu); - - if( (bezt= newnu->bezt) ) { - a= newnu->pntsu; - while(a--) { - Mat4MulVecfl(cmat, bezt->vec[0]); - Mat4MulVecfl(cmat, bezt->vec[1]); - Mat4MulVecfl(cmat, bezt->vec[2]); - bezt++; - } + if( (bezt= newnu->bezt) ) { + a= newnu->pntsu; + while(a--) { + Mat4MulVecfl(cmat, bezt->vec[0]); + Mat4MulVecfl(cmat, bezt->vec[1]); + Mat4MulVecfl(cmat, bezt->vec[2]); + bezt++; } - if( (bp= newnu->bp) ) { - a= newnu->pntsu*nu->pntsv; - while(a--) { - Mat4MulVecfl(cmat, bp->vec); - bp++; - } + } + if( (bp= newnu->bp) ) { + a= newnu->pntsu*nu->pntsv; + while(a--) { + Mat4MulVecfl(cmat, bp->vec); + bp++; } - nu= nu->next; } + nu= nu->next; } - - ED_base_object_free_and_unlink(scene, base); } + + ED_base_object_free_and_unlink(scene, base); } } } + CTX_DATA_END; cu= ob->data; addlisttolist(&cu->nurb, &tempbase); @@ -4674,8 +4659,8 @@ int join_curve(bContext *C, wmOperator *op, int type) ED_object_enter_editmode(C, EM_WAITCURSOR); ED_object_exit_editmode(C, EM_FREEDATA|EM_WAITCURSOR); - - // BIF_undo_push("Join"); + + WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 1df9182fc9b..a9823bd9ff1 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -34,6 +34,7 @@ struct Base; struct Bone; struct bArmature; struct bPoseChannel; +struct wmOperator; struct wmWindowManager; struct ListBase; struct View3D; @@ -100,6 +101,7 @@ void ED_armature_edit_remake(struct Object *obedit); int ED_do_pose_selectbuffer(struct Scene *scene, struct Base *base, unsigned int *buffer, short hits, short extend); void mouse_armature(struct bContext *C, short mval[2], int extend); +int join_armature_exec(struct bContext *C, struct wmOperator *op); struct Bone *get_indexed_bone (struct Object *ob, int index); float ED_rollBoneToVector(EditBone *bone, float new_up_axis[3]); EditBone *ED_armature_bone_get_mirrored(struct ListBase *edbo, EditBone *ebo); // XXX this is needed for populating the context iterators diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index 2cebc6a572a..4149c6a9cca 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -35,6 +35,7 @@ struct Object; struct Scene; struct Text; struct View3D; +struct wmOperator; struct wmWindowManager; /* curve_ops.c */ @@ -55,6 +56,8 @@ struct Nurb *add_nurbs_primitive(struct bContext *C, int type, int newname); int isNurbsel (struct Nurb *nu);; +int join_curve_exec (struct bContext *C, struct wmOperator *op); + /* editfont.h */ void undo_push_font (struct bContext *C, char *name); void make_editText (struct Object *obedit); diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index c4fde48c631..0face00f82b 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -36,6 +36,7 @@ struct EditVert; struct EditEdge; struct EditFace; struct bContext; +struct wmOperator; struct wmWindowManager; struct EditSelection; struct ViewContext; @@ -76,6 +77,8 @@ struct EditVert *editmesh_get_x_mirror_vert(struct Object *ob, struct EditMesh int mesh_get_x_mirror_vert(struct Object *ob, int index); int *mesh_get_x_mirror_faces(struct Object *ob, struct EditMesh *em); +int join_mesh_exec(struct bContext *C, struct wmOperator *op); + /* mesh_ops.c */ void ED_operatortypes_mesh(void); void ED_keymap_mesh(struct wmWindowManager *wm); diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index 768040597a4..5719aa63234 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -33,6 +33,7 @@ /* ******************* Registration Function ********************** */ struct wmWindowManager; +struct wmOperatorType; struct ListBase; struct wmEvent; struct bContext; diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index cdd51a72f4f..6c66ae468fa 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1132,7 +1132,7 @@ void load_editMesh(Scene *scene, Object *ob) else VECCOPY(mvert->co, eve->co); - mvert->mat_nr= 255; /* what was this for, halos? */ + mvert->mat_nr= 32767; /* what was this for, halos? */ /* vertex normal */ VECCOPY(nor, eve->no); @@ -1218,14 +1218,14 @@ void load_editMesh(Scene *scene, Object *ob) /* mat_nr in vertex */ if(me->totcol>1) { mvert= me->mvert+mface->v1; - if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr; + if(mvert->mat_nr == (char)32767) mvert->mat_nr= mface->mat_nr; mvert= me->mvert+mface->v2; - if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr; + if(mvert->mat_nr == (char)32767) mvert->mat_nr= mface->mat_nr; mvert= me->mvert+mface->v3; - if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr; + if(mvert->mat_nr == (char)32767) mvert->mat_nr= mface->mat_nr; if(mface->v4) { mvert= me->mvert+mface->v4; - if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr; + if(mvert->mat_nr == (char)32767) mvert->mat_nr= mface->mat_nr; } } @@ -1669,8 +1669,8 @@ typedef struct EditEdgeC typedef struct EditFaceC { int v1, v2, v3, v4; - unsigned char mat_nr, flag, f, h, fgonf; - short pad1; + unsigned char flag, f, h, fgonf, pad1; + short mat_nr; } EditFaceC; typedef struct EditSelectionC{ diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index df3e2a5685c..c10fdbcfd8f 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -38,16 +38,17 @@ #include "MEM_guardedalloc.h" #include "DNA_image_types.h" -#include "DNA_mesh_types.h" +#include "DNA_key_types.h" +#include "DNA_material_types.h" #include "DNA_meshdata_types.h" +#include "DNA_mesh_types.h" #include "DNA_object_types.h" -#include "DNA_material_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "DNA_space_types.h" #include "DNA_view3d_types.h" -#include "DNA_world_types.h" #include "DNA_windowmanager_types.h" +#include "DNA_world_types.h" #include "BLI_arithb.h" #include "BLI_blenlib.h" @@ -58,10 +59,12 @@ #include "BKE_blender.h" +#include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_customdata.h" #include "BKE_global.h" #include "BKE_image.h" +#include "BKE_key.h" #include "BKE_library.h" #include "BKE_main.h" #include "BKE_mesh.h" @@ -86,15 +89,13 @@ #include "ED_object.h" #include "ED_view3d.h" +#include "WM_api.h" +#include "WM_types.h" + /* own include */ #include "mesh_intern.h" - -/* from rendercode.c */ -#define VECMUL(dest, f) dest[0]*= f; dest[1]*= f; dest[2]*= f - /* XXX */ -static void BIF_undo_push() {} static void waitcursor() {} static void error() {} static int pupmenu() {return 0;} @@ -103,145 +104,189 @@ static int pupmenu() {return 0;} /* * ********************** no editmode!!! *********** */ +/*********************** JOIN ***************************/ + /* join selected meshes into the active mesh, context sensitive return 0 if no join is made (error) and 1 of the join is done */ -// XXX NOTE to whoever ports this: -// Check the version of this code in the animsys2 branch, which has been nicely commented, -// but more importantly has proper support for handling meshes with shapekeys (instead of lamely bailing out)! -// -- Aligorith, July 2009 -int join_mesh(Scene *scene, View3D *v3d, wmOperator *op) +int join_mesh_exec(bContext *C, wmOperator *op) { - Base *base, *nextb; - Object *ob; + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_active_object(C); Material **matar, *ma; Mesh *me; - MVert *mvert, *mvertmain; + MVert *mvert, *mv, *mvertmain; MEdge *medge = NULL, *medgemain; MFace *mface = NULL, *mfacemain; - float imat[4][4], cmat[4][4]; - int a, b, totcol, totedge=0, totvert=0, totface=0, ok=0, vertofs, map[MAXMAT]; - int i, j, index, haskey=0, hasmulti=0, edgeofs, faceofs; + Key *key, *nkey=NULL; + KeyBlock *kb, *okb, *kbn; + float imat[4][4], cmat[4][4], *fp1, *fp2, curpos; + int a, b, totcol, totmat=0, totedge=0, totvert=0, totface=0, ok=0; + int vertofs, *matmap; + int i, j, index, haskey=0, edgeofs, faceofs; bDeformGroup *dg, *odg; MDeformVert *dvert; CustomData vdata, edata, fdata; - if(scene->obedit) return 0; + if(scene->obedit) + return OPERATOR_CANCELLED; - ob= OBACT; - if(!ob || ob->type!=OB_MESH) return 0; + /* ob is the object we are adding geometry to */ + if(!ob || ob->type!=OB_MESH) + return OPERATOR_CANCELLED; - if (object_data_is_libdata(ob)) { -// XXX error_libdata(); - return 0; - } - /* count & check */ - base= FIRSTBASE; - while(base) { - if(TESTBASELIB_BGMODE(base)) { /* BGMODE since python can access */ - if(base->object->type==OB_MESH) { - me= base->object->data; - totvert+= me->totvert; - totface+= me->totface; - - if(base->object == ob) ok= 1; - - if(me->key) { - haskey= 1; - break; - } - if(me->mr) { - hasmulti= 1; - break; - } - } + CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) { + if(base->object->type==OB_MESH) { + me= base->object->data; + + totvert+= me->totvert; + totedge+= me->totedge; + totface+= me->totface; + totmat+= base->object->totcol; + + if(base->object == ob) + ok= 1; + + /* check for shapekeys */ + if(me->key) + haskey++; } - base= base->next; } + CTX_DATA_END; - if(haskey) { - BKE_report(op->reports, RPT_ERROR, "Can't join meshes with vertex keys"); - return 0; - } - if(hasmulti) { - BKE_report(op->reports, RPT_ERROR, "Can't join meshes with Multires"); - return 0; - } /* that way the active object is always selected */ - if(ok==0) return 0; + if(ok==0) + return OPERATOR_CANCELLED; - if(totvert==0 || totvert>MESH_MAX_VERTS) return 0; - - /* if needed add edges to other meshes */ - for(base= FIRSTBASE; base; base= base->next) { - if(TESTBASELIB_BGMODE(base)) { - if(base->object->type==OB_MESH) { - me= base->object->data; - totedge += me->totedge; - } - } - } + /* only join meshes if there are verts to join, there aren't too many, and we only had one mesh selected */ + me= (Mesh *)ob->data; + key= me->key; + if(totvert==0 || totvert>MESH_MAX_VERTS || totvert==me->totvert) + return OPERATOR_CANCELLED; /* new material indices and material array */ - matar= MEM_callocN(sizeof(void *)*MAXMAT, "join_mesh"); + matar= MEM_callocN(sizeof(void*)*totmat, "join_mesh matar"); + matmap= MEM_callocN(sizeof(int)*totmat, "join_mesh matmap"); totcol= ob->totcol; /* obact materials in new main array, is nicer start! */ - for(a=1; a<=ob->totcol; a++) { - matar[a-1]= give_current_material(ob, a); - id_us_plus((ID *)matar[a-1]); + for(a=0; atotcol; a++) { + matar[a]= give_current_material(ob, a+1); + id_us_plus((ID *)matar[a]); /* increase id->us : will be lowered later */ } - base= FIRSTBASE; - while(base) { - if(TESTBASELIB_BGMODE(base)) { - if(ob!=base->object && base->object->type==OB_MESH) { - me= base->object->data; - - // Join this object's vertex groups to the base one's - for (dg=base->object->defbase.first; dg; dg=dg->next){ - /* See if this group exists in the object */ - for (odg=ob->defbase.first; odg; odg=odg->next){ - if (!strcmp(odg->name, dg->name)){ - break; - } - } - if (!odg){ - odg = MEM_callocN (sizeof(bDeformGroup), "join deformGroup"); - memcpy (odg, dg, sizeof(bDeformGroup)); - BLI_addtail(&ob->defbase, odg); + /* - if destination mesh had shapekeys, move them somewhere safe, and set up placeholders + * with arrays that are large enough to hold shapekey data for all meshes + * - if destination mesh didn't have shapekeys, but we encountered some in the meshes we're + * joining, set up a new keyblock and assign to the mesh + */ + if(key) { + /* make a duplicate copy that will only be used here... (must remember to free it!) */ + nkey= copy_key(key); + + /* for all keys in old block, clear data-arrays */ + for(kb= key->block.first; kb; kb= kb->next) { + if(kb->data) MEM_freeN(kb->data); + kb->data= MEM_callocN(sizeof(float)*3*totvert, "join_shapekey"); + kb->totelem= totvert; + kb->weights= NULL; + } + } + else if(haskey) { + /* add a new key-block and add to the mesh */ + key= me->key= add_key((ID *)me); + key->type = KEY_RELATIVE; + } + + /* first pass over objects - copying materials and vertexgroups across */ + CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) { + /* only act if a mesh, and not the one we're joining to */ + if((ob!=base->object) && (base->object->type==OB_MESH)) { + me= base->object->data; + + /* Join this object's vertex groups to the base one's */ + for(dg=base->object->defbase.first; dg; dg=dg->next) { + /* See if this group exists in the object (if it doesn't, add it to the end) */ + for(odg=ob->defbase.first; odg; odg=odg->next) { + if(!strcmp(odg->name, dg->name)) { + break; } - } - if (ob->defbase.first && ob->actdef==0) - ob->actdef=1; - - if(me->totvert) { + if(!odg) { + odg = MEM_callocN(sizeof(bDeformGroup), "join deformGroup"); + memcpy(odg, dg, sizeof(bDeformGroup)); + BLI_addtail(&ob->defbase, odg); + } + } + if(ob->defbase.first && ob->actdef==0) + ob->actdef=1; + + + if(me->totvert) { + /* Add this object's materials to the base one's if they don't exist already (but only if limits not exceeded yet) */ + if(totcol < MAXMAT-1) { for(a=1; a<=base->object->totcol; a++) { ma= give_current_material(base->object, a); - if(ma) { - for(b=0; bid.us++; - totcol++; + totcol++; + } + if(totcol>=MAXMAT-1) + break; + } + } + + /* if this mesh has shapekeys, check if destination mesh already has matching entries too */ + if(me->key && key) { + for(kb= me->key->block.first; kb; kb= kb->next) { + /* if key doesn't exist in destination mesh, add it */ + if(key_get_named_keyblock(key, kb->name) == NULL) { + /* copy this existing one over to the new shapekey block */ + kbn= MEM_dupallocN(kb); + kbn->prev= kbn->next= NULL; + + /* adjust adrcode and other settings to fit (allocate a new data-array) */ + kbn->data= MEM_callocN(sizeof(float)*3*totvert, "joined_shapekey"); + kbn->totelem= totvert; + kbn->weights= NULL; + + okb= key->block.last; + curpos= (okb) ? okb->pos : -0.1f; + if(key->type == KEY_RELATIVE) + kbn->pos= curpos + 0.1f; + else + kbn->pos= curpos; + + BLI_addtail(&key->block, kbn); + kbn->adrcode= key->totkey; + key->totkey++; + if(key->totkey==1) key->refkey= kbn; + + // XXX 2.5 Animato +#if 0 + /* also, copy corresponding ipo-curve to ipo-block if applicable */ + if(me->key->ipo && key->ipo) { + // FIXME... this is a luxury item! + puts("FIXME: ignoring IPO's when joining shapekeys on Meshes for now..."); } - if(totcol>=MAXMAT-1) break; +#endif } } } } - if(totcol>=MAXMAT-1) break; } - base= base->next; } - - me= ob->data; - + CTX_DATA_END; + + /* setup new data for destination mesh */ memset(&vdata, 0, sizeof(vdata)); memset(&edata, 0, sizeof(edata)); memset(&fdata, 0, sizeof(fdata)); @@ -249,114 +294,177 @@ int join_mesh(Scene *scene, View3D *v3d, wmOperator *op) mvert= CustomData_add_layer(&vdata, CD_MVERT, CD_CALLOC, NULL, totvert); medge= CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge); mface= CustomData_add_layer(&fdata, CD_MFACE, CD_CALLOC, NULL, totface); - + mvertmain= mvert; medgemain= medge; mfacemain= mface; - - /* inverse transorm all selected meshes in this object */ - Mat4Invert(imat, ob->obmat); - + vertofs= 0; edgeofs= 0; faceofs= 0; - base= FIRSTBASE; - while(base) { - nextb= base->next; - if (TESTBASELIB_BGMODE(base)) { - if(base->object->type==OB_MESH) { + + /* inverse transform for all selected meshes in this object */ + Mat4Invert(imat, ob->obmat); + + CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) { + /* only join if this is a mesh */ + if(base->object->type==OB_MESH) { + me= base->object->data; + + if(me->totvert) { + /* standard data */ + CustomData_merge(&me->vdata, &vdata, CD_MASK_MESH, CD_DEFAULT, totvert); + CustomData_copy_data(&me->vdata, &vdata, 0, vertofs, me->totvert); - me= base->object->data; + /* vertex groups */ + dvert= CustomData_get(&vdata, vertofs, CD_MDEFORMVERT); - if(me->totvert) { - CustomData_merge(&me->vdata, &vdata, CD_MASK_MESH, CD_DEFAULT, totvert); - CustomData_copy_data(&me->vdata, &vdata, 0, vertofs, me->totvert); - - dvert= CustomData_get(&vdata, vertofs, CD_MDEFORMVERT); - - /* NEW VERSION */ - if (dvert){ - for (i=0; itotvert; i++){ - for (j=0; jobject->defbase, dvert[i].dw[j].def_nr); - if(odg) { - // Search for a match in the new object - for (dg=ob->defbase.first, index=0; dg; dg=dg->next, index++){ - if (!strcmp(dg->name, odg->name)){ - dvert[i].dw[j].def_nr = index; - break; - } + /* NB: vertex groups here are new version */ + if(dvert) { + for(i=0; itotvert; i++) { + for(j=0; jobject->defbase, dvert[i].dw[j].def_nr); + if(odg) { + /* Search for a match in the new object, and set new index */ + for(dg=ob->defbase.first, index=0; dg; dg=dg->next, index++) { + if(!strcmp(dg->name, odg->name)) { + dvert[i].dw[j].def_nr = index; + break; } } } } } - - if(base->object != ob) { - /* watch this: switch matmul order really goes wrong */ - Mat4MulMat4(cmat, base->object->obmat, imat); - - a= me->totvert; - while(a--) { - Mat4MulVecfl(cmat, mvert->co); - mvert++; - } - } - else mvert+= me->totvert; } - if(me->totface) { - /* make mapping for materials */ - memset(map, 0, 4*MAXMAT); - for(a=1; a<=base->object->totcol; a++) { - ma= give_current_material(base->object, a); - if(ma) { - for(b=0; bobject != ob) { + /* watch this: switch matmul order really goes wrong */ + Mat4MulMat4(cmat, base->object->obmat, imat); + + /* transform vertex coordinates into new space */ + for(a=0, mv=mvert; a < me->totvert; a++, mv++) { + Mat4MulVecfl(cmat, mv->co); + } + + /* for each shapekey in destination mesh: + * - if there's a matching one, copy it across (will need to transform vertices into new space...) + * - otherwise, just copy own coordinates of mesh (no need to transform vertex coordinates into new space) + */ + if(key) { + /* if this mesh has any shapekeys, check first, otherwise just copy coordinates */ + for(kb= key->block.first; kb; kb= kb->next) { + /* get pointer to where to write data for this mesh in shapekey's data array */ + fp1= ((float *)kb->data) + (vertofs*3); + + /* check if this mesh has such a shapekey */ + okb= key_get_named_keyblock(me->key, kb->name); + if(okb) { + /* copy this mesh's shapekey to the destination shapekey (need to transform first) */ + fp2= ((float *)(okb->data)); + for(a=0; a < me->totvert; a++, fp1+=3, fp2+=3) { + VECCOPY(fp1, fp2); + Mat4MulVecfl(cmat, fp1); + } + } + else { + /* copy this mesh's vertex coordinates to the destination shapekey */ + mv= mvert; + for(a=0; a < me->totvert; a++, fp1+=3, mv++) { + VECCOPY(fp1, mv->co); } } } } - - CustomData_merge(&me->fdata, &fdata, CD_MASK_MESH, CD_DEFAULT, totface); - CustomData_copy_data(&me->fdata, &fdata, 0, faceofs, me->totface); - - for(a=0; atotface; a++, mface++) { - mface->v1+= vertofs; - mface->v2+= vertofs; - mface->v3+= vertofs; - if(mface->v4) mface->v4+= vertofs; - - mface->mat_nr= map[(int)mface->mat_nr]; + } + else { + /* for each shapekey in destination mesh: + * - if it was an 'original', copy the appropriate data from nkey + * - otherwise, copy across plain coordinates (no need to transform coordinates) + */ + if(key) { + for(kb= key->block.first; kb; kb= kb->next) { + /* get pointer to where to write data for this mesh in shapekey's data array */ + fp1= ((float *)kb->data) + (vertofs*3); + + /* check if this was one of the original shapekeys */ + okb= key_get_named_keyblock(nkey, kb->name); + if(okb) { + /* copy this mesh's shapekey to the destination shapekey */ + fp2= ((float *)(okb->data)); + for(a=0; a < me->totvert; a++, fp1+=3, fp2+=3) { + VECCOPY(fp1, fp2); + } + } + else { + /* copy base-coordinates to the destination shapekey */ + mv= mvert; + for(a=0; a < me->totvert; a++, fp1+=3, mv++) { + VECCOPY(fp1, mv->co); + } + } + } } - - faceofs += me->totface; } - if(me->totedge) { - CustomData_merge(&me->edata, &edata, CD_MASK_MESH, CD_DEFAULT, totedge); - CustomData_copy_data(&me->edata, &edata, 0, edgeofs, me->totedge); - - for(a=0; atotedge; a++, medge++) { - medge->v1+= vertofs; - medge->v2+= vertofs; + /* advance mvert pointer to end of base mesh's data */ + mvert+= me->totvert; + } + + if(me->totface) { + /* make mapping for materials */ + for(a=1; a<=base->object->totcol; a++) { + ma= give_current_material(base->object, a); + + for(b=0; btotedge; } - vertofs += me->totvert; + CustomData_merge(&me->fdata, &fdata, CD_MASK_MESH, CD_DEFAULT, totface); + CustomData_copy_data(&me->fdata, &fdata, 0, faceofs, me->totface); + + for(a=0; atotface; a++, mface++) { + mface->v1+= vertofs; + mface->v2+= vertofs; + mface->v3+= vertofs; + if(mface->v4) mface->v4+= vertofs; + + mface->mat_nr= matmap[(int)mface->mat_nr]; + } + + faceofs += me->totface; + } + + if(me->totedge) { + CustomData_merge(&me->edata, &edata, CD_MASK_MESH, CD_DEFAULT, totedge); + CustomData_copy_data(&me->edata, &edata, 0, edgeofs, me->totedge); + + for(a=0; atotedge; a++, medge++) { + medge->v1+= vertofs; + medge->v2+= vertofs; + } - if(base->object!=ob) - ED_base_object_free_and_unlink(scene, base); + edgeofs += me->totedge; } + + /* vertofs is used to help newly added verts be reattached to their edge/face + * (cannot be set earlier, or else reattaching goes wrong) + */ + vertofs += me->totvert; + + /* free base, now that data is merged */ + if(base->object != ob) + ED_base_object_free_and_unlink(scene, base); } - base= nextb; } + CTX_DATA_END; + /* return to mesh we're merging to */ me= ob->data; CustomData_free(&me->vdata, me->totvert); @@ -383,30 +491,53 @@ int join_mesh(Scene *scene, View3D *v3d, wmOperator *op) if(ma) ma->id.us--; } if(ob->mat) MEM_freeN(ob->mat); + if(ob->matbits) MEM_freeN(ob->matbits); if(me->mat) MEM_freeN(me->mat); - ob->mat= me->mat= 0; + ob->mat= me->mat= NULL; + ob->matbits= NULL; if(totcol) { me->mat= matar; ob->mat= MEM_callocN(sizeof(void *)*totcol, "join obmatar"); + ob->matbits= MEM_callocN(sizeof(char)*totcol, "join obmatbits"); } - else MEM_freeN(matar); + else + MEM_freeN(matar); ob->totcol= me->totcol= totcol; ob->colbits= 0; + + MEM_freeN(matmap); /* other mesh users */ test_object_materials((ID *)me); - DAG_scene_sort(scene); // removed objects, need to rebuild dag before editmode call + /* free temp copy of destination shapekeys (if applicable) */ + if(nkey) { + // XXX 2.5 Animato +#if 0 + /* free it's ipo too - both are not actually freed from memory yet as ID-blocks */ + if(nkey->ipo) { + free_ipo(nkey->ipo); + BLI_remlink(&G.main->ipo, nkey->ipo); + MEM_freeN(nkey->ipo); + } +#endif + + free_key(nkey); + BLI_remlink(&G.main->key, nkey); + MEM_freeN(nkey); + } -// XXX enter_editmode(EM_WAITCURSOR); -// exit_editmode(EM_FREEDATA|EM_WAITCURSOR); // freedata, but no undo + DAG_scene_sort(scene); // removed objects, need to rebuild dag before editmode call - BIF_undo_push("Join Mesh"); - return 1; -} + ED_object_enter_editmode(C, EM_WAITCURSOR); + ED_object_exit_editmode(C, EM_FREEDATA|EM_WAITCURSOR); + + WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene); + return OPERATOR_FINISHED; +} /* ********************** SORT FACES ******************* */ @@ -520,14 +651,14 @@ void sort_faces(Scene *scene, View3D *v3d) else face_sort_floats[i] = reverse; } else { /* find the faces center */ - VECADD(vec, (me->mvert+mf->v1)->co, (me->mvert+mf->v2)->co); + VecAddf(vec, (me->mvert+mf->v1)->co, (me->mvert+mf->v2)->co); if (mf->v4) { - VECADD(vec, vec, (me->mvert+mf->v3)->co); - VECADD(vec, vec, (me->mvert+mf->v4)->co); - VECMUL(vec, 0.25f); + VecAddf(vec, vec, (me->mvert+mf->v3)->co); + VecAddf(vec, vec, (me->mvert+mf->v4)->co); + VecMulf(vec, 0.25f); } else { - VECADD(vec, vec, (me->mvert+mf->v3)->co); - VECMUL(vec, 1.0f/3.0f); + VecAddf(vec, vec, (me->mvert+mf->v3)->co); + VecMulf(vec, 1.0f/3.0f); } /* done */ if (event == 1) { /* sort on view axis */ diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 35b6e23eaa5..0746fbaefb6 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1755,7 +1755,6 @@ static short select_grouped_parent(bContext *C) /* Makes parent active and de-se static short select_grouped_group(bContext *C, Object *ob) /* Select objects in the same group as the active */ { short changed = 0; - Base *base; Group *group, *ob_groups[GROUP_MENU_MAX]; //char str[10 + (24*GROUP_MENU_MAX)]; //char *p = str; @@ -6326,6 +6325,53 @@ void OBJECT_OT_duplicate(wmOperatorType *ot) RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); } +/* ************************** JOIN *********************** */ + +static int join_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_active_object(C); + + if(scene->obedit) { + BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode."); + return OPERATOR_CANCELLED; + } + else if(!ob) { + BKE_report(op->reports, RPT_ERROR, "Can't join unless there is an active object."); + return OPERATOR_CANCELLED; + } + else if(object_data_is_libdata(ob)) { + BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata."); + return OPERATOR_CANCELLED; + } + + if(ob->type == OB_MESH) + return join_mesh_exec(C, op); + else if(ELEM(ob->type, OB_CURVE, OB_SURF)) + return join_curve_exec(C, op); + else if(ob->type == OB_ARMATURE) + return join_armature_exec(C, op); + + BKE_report(op->reports, RPT_ERROR, "This object type doesn't support joining."); + + return OPERATOR_CANCELLED; +} + +void OBJECT_OT_join(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Join"; + ot->description = "Join selected objects into active object."; + ot->idname= "OBJECT_OT_join"; + + /* api callbacks */ + ot->exec= join_exec; + ot->poll= ED_operator_scene_editable; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /* ********************** */ void image_aspect(Scene *scene, View3D *v3d) diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 76ce8857c2c..23a4b5773ff 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -64,6 +64,7 @@ void OBJECT_OT_duplicates_make_real(struct wmOperatorType *ot); void OBJECT_OT_object_add(struct wmOperatorType *ot); void OBJECT_OT_duplicate(struct wmOperatorType *ot); void OBJECT_OT_delete(struct wmOperatorType *ot); +void OBJECT_OT_join(struct wmOperatorType *ot); void OBJECT_OT_mesh_add(struct wmOperatorType *ot); void OBJECT_OT_curve_add(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 9a0ce23a970..acfe2416d77 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -86,6 +86,7 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_center_set); WM_operatortype_append(OBJECT_OT_duplicates_make_real); WM_operatortype_append(OBJECT_OT_duplicate); + WM_operatortype_append(OBJECT_OT_join); WM_operatortype_append(GROUP_OT_group_create); WM_operatortype_append(GROUP_OT_objects_remove); WM_operatortype_append(GROUP_OT_objects_add_active); @@ -170,6 +171,7 @@ void ED_keymap_object(wmWindowManager *wm) WM_keymap_verify_item(keymap, "OBJECT_OT_primitive_add", AKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "OBJECT_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_duplicate", DKEY, KM_PRESS, KM_ALT, 0)->ptr, "linked", 1); + WM_keymap_add_item(keymap, "OBJECT_OT_join", JKEY, KM_PRESS, KM_CTRL, 0); // XXX this should probably be in screen instead... here for testing purposes in the meantime... - Aligorith WM_keymap_verify_item(keymap, "ANIM_OT_insert_keyframe_menu", IKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 578da29f102..fd37020c3b4 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -387,7 +387,6 @@ static int view_all_exec(bContext *C, wmOperator *op) ARegion *ar; Scene *scene; Object *obedit; - Image *ima; ImBuf *ibuf; float aspx, aspy, zoomx, zoomy, w, h; int width, height; @@ -398,7 +397,6 @@ static int view_all_exec(bContext *C, wmOperator *op) scene= (Scene*)CTX_data_scene(C); obedit= CTX_data_edit_object(C); - ima= ED_space_image(sima); ibuf= ED_space_image_buffer(sima); ED_space_image_size(sima, &width, &height); ED_space_image_aspect(sima, &aspx, &aspy); diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index e8c32d2a2c7..4776b42b631 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -1700,22 +1700,24 @@ static int tree_element_active_material(Scene *scene, SpaceOops *soops, TreeElem if(tes->idcode==ID_OB) { if(set) { ob->actcol= te->index+1; - ob->colbits |= (1<index); // make ob material active too + ob->matbits[te->index]= 1; // make ob material active too + ob->colbits |= (1<index); } else { if(ob->actcol == te->index+1) - if(ob->colbits & (1<index)) return 1; + if(ob->matbits[te->index]) return 1; } } /* or we search for obdata material */ else { if(set) { ob->actcol= te->index+1; - ob->colbits &= ~(1<index); // make obdata material active too + ob->matbits[te->index]= 0; // make obdata material active too + ob->colbits &= ~(1<index); } else { if(ob->actcol == te->index+1) - if( (ob->colbits & (1<index))==0 ) return 1; + if(ob->matbits[te->index]==0) return 1; } } if(set) { diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index f83a0b9686e..93c6c535a31 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2463,11 +2463,13 @@ static int draw_mesh_object(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base if(dt>OB_WIRE) { // no transp in editmode, the fancy draw over goes bad then glsl = draw_glsl_material(scene, ob, v3d, dt); - GPU_set_object_materials(v3d, rv3d, scene, ob, glsl, NULL); + GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, NULL); } draw_em_fancy(scene, v3d, rv3d, ob, em, cageDM, finalDM, dt); + GPU_end_object_materials(); + if (obedit!=ob && finalDM) finalDM->release(finalDM); } @@ -2482,17 +2484,19 @@ static int draw_mesh_object(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base check_alpha = check_material_alpha(base, me, glsl); if(dt==OB_SOLID || glsl) { - GPU_set_object_materials(v3d, rv3d, scene, ob, glsl, + GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, (check_alpha)? &do_alpha_pass: NULL); } draw_mesh_fancy(scene, v3d, rv3d, base, dt, flag); + + GPU_end_object_materials(); if(me->totvert==0) retval= 1; } } - /* GPU_set_object_materials checked if this is needed */ + /* GPU_begin_object_materials checked if this is needed */ if(do_alpha_pass) add_view3d_after(v3d, base, V3D_TRANSP, flag); return retval; @@ -2670,7 +2674,6 @@ static void drawDispListsolid(ListBase *lb, Object *ob, int glsl) glVertexPointer(3, GL_FLOAT, 0, dl->verts); glNormalPointer(GL_FLOAT, 0, dl->nors); glDrawElements(GL_QUADS, 4*dl->totindex, GL_UNSIGNED_INT, dl->index); - GPU_disable_material(); } break; @@ -2688,7 +2691,6 @@ static void drawDispListsolid(ListBase *lb, Object *ob, int glsl) glNormalPointer(GL_FLOAT, 0, dl->nors); glDrawElements(GL_TRIANGLES, 3*dl->parts, GL_UNSIGNED_INT, dl->index); - GPU_disable_material(); if(index3_nors_incr==0) glEnableClientState(GL_NORMAL_ARRAY); @@ -2702,8 +2704,6 @@ static void drawDispListsolid(ListBase *lb, Object *ob, int glsl) glNormalPointer(GL_FLOAT, 0, dl->nors); glDrawElements(GL_QUADS, 4*dl->parts, GL_UNSIGNED_INT, dl->index); - GPU_disable_material(); - break; } dl= dl->next; @@ -2797,17 +2797,19 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas } else { if(draw_glsl_material(scene, ob, v3d, dt)) { - GPU_set_object_materials(v3d, rv3d, scene, ob, 1, NULL); + GPU_begin_object_materials(v3d, rv3d, scene, ob, 1, NULL); drawDispListsolid(lb, ob, 1); + GPU_end_object_materials(); } else if(dt == OB_SHADED) { if(ob->disp.first==0) shadeDispList(scene, base); drawDispListshaded(lb, ob); } else { - GPU_set_object_materials(v3d, rv3d, scene, ob, 0, NULL); + GPU_begin_object_materials(v3d, rv3d, scene, ob, 0, NULL); glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0); drawDispListsolid(lb, ob, 0); + GPU_end_object_materials(); } if(cu->editnurb && cu->bevobj==NULL && cu->taperobj==NULL && cu->ext1 == 0.0 && cu->ext2 == 0.0) { cpack(0); @@ -2835,18 +2837,19 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas if(dl->nors==NULL) addnormalsDispList(ob, lb); if(draw_glsl_material(scene, ob, v3d, dt)) { - GPU_set_object_materials(v3d, rv3d, scene, ob, 1, NULL); + GPU_begin_object_materials(v3d, rv3d, scene, ob, 1, NULL); drawDispListsolid(lb, ob, 1); + GPU_end_object_materials(); } else if(dt==OB_SHADED) { if(ob->disp.first==NULL) shadeDispList(scene, base); drawDispListshaded(lb, ob); } else { - GPU_set_object_materials(v3d, rv3d, scene, ob, 0, NULL); + GPU_begin_object_materials(v3d, rv3d, scene, ob, 0, NULL); glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0); - drawDispListsolid(lb, ob, 0); + GPU_end_object_materials(); } } else { @@ -2863,8 +2866,9 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas if(solid) { if(draw_glsl_material(scene, ob, v3d, dt)) { - GPU_set_object_materials(v3d, rv3d, scene, ob, 1, NULL); + GPU_begin_object_materials(v3d, rv3d, scene, ob, 1, NULL); drawDispListsolid(lb, ob, 1); + GPU_end_object_materials(); } else if(dt == OB_SHADED) { dl= lb->first; @@ -2872,10 +2876,10 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas drawDispListshaded(lb, ob); } else { - GPU_set_object_materials(v3d, rv3d, scene, ob, 0, NULL); + GPU_begin_object_materials(v3d, rv3d, scene, ob, 0, NULL); glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0); - drawDispListsolid(lb, ob, 0); + GPU_end_object_materials(); } } else{ @@ -5615,7 +5619,7 @@ static void draw_object_mesh_instance(Scene *scene, View3D *v3d, RegionView3D *r if(dm) { glsl = draw_glsl_material(scene, ob, v3d, dt); - GPU_set_object_materials(v3d, rv3d, scene, ob, glsl, NULL); + GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, NULL); } else { glEnable(GL_COLOR_MATERIAL); @@ -5629,7 +5633,7 @@ static void draw_object_mesh_instance(Scene *scene, View3D *v3d, RegionView3D *r if(dm) { dm->drawFacesSolid(dm, GPU_enable_material); - GPU_disable_material(); + GPU_end_object_materials(); } else if(edm) edm->drawMappedFaces(edm, NULL, NULL, 0); diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h index ce130951840..802f30506f8 100644 --- a/source/blender/gpu/GPU_draw.h +++ b/source/blender/gpu/GPU_draw.h @@ -63,8 +63,10 @@ void GPU_state_init(void); * GPU_enable_material returns 0 if drawing should be skipped * - after drawing, the material must be disabled again */ -void GPU_set_object_materials(struct View3D *v3d, struct RegionView3D *rv3d, +void GPU_begin_object_materials(struct View3D *v3d, struct RegionView3D *rv3d, struct Scene *scene, struct Object *ob, int glsl, int *do_alpha_pass); +void GPU_end_object_materials(void); + int GPU_enable_material(int nr, void *attribs); void GPU_disable_material(void); diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 5edb619f7e5..efb7d688a49 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -776,16 +776,17 @@ void GPU_free_images(void) /* OpenGL Materials */ -/* materials start counting at # one.... */ -#define MAXMATBUF (MAXMAT+1) +#define FIXEDMAT 8 /* OpenGL state caching for materials */ static struct GPUMaterialState { - float matbuf[MAXMATBUF][2][4]; + float (*matbuf)[2][4]; + float matbuf_fixed[FIXEDMAT][2][4]; int totmat; - Material *gmatbuf[MAXMATBUF]; + Material **gmatbuf; + Material *gmatbuf_fixed[FIXEDMAT]; Material *gboundmat; Object *gob; Scene *gscene; @@ -793,7 +794,8 @@ static struct GPUMaterialState { float (*gviewmat)[4]; float (*gviewinv)[4]; - GPUBlendMode blendmode[MAXMATBUF]; + GPUBlendMode *blendmode; + GPUBlendMode blendmode_fixed[FIXEDMAT]; int alphapass; int lastmatnr, lastretval; @@ -814,7 +816,7 @@ Material *gpu_active_node_material(Material *ma) return ma; } -void GPU_set_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, Object *ob, int glsl, int *do_alpha_pass) +void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, Object *ob, int glsl, int *do_alpha_pass) { extern Material defmaterial; /* from material.c */ Material *ma; @@ -830,7 +832,7 @@ void GPU_set_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, Obj GMS.gob = ob; GMS.gscene = scene; - GMS.totmat= ob->totcol; + GMS.totmat= ob->totcol+1; /* materials start from 1, default material is 0 */ GMS.glay= v3d->lay; GMS.gviewmat= rv3d->viewmat; GMS.gviewinv= rv3d->viewinv; @@ -838,6 +840,17 @@ void GPU_set_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, Obj GMS.alphapass = (v3d && v3d->transp); if(do_alpha_pass) *do_alpha_pass = 0; + + if(GMS.totmat > FIXEDMAT) { + GMS.matbuf= MEM_callocN(sizeof(*GMS.matbuf)*GMS.totmat, "GMS.matbuf"); + GMS.gmatbuf= MEM_callocN(sizeof(*GMS.gmatbuf)*GMS.totmat, "GMS.matbuf"); + GMS.blendmode= MEM_callocN(sizeof(*GMS.blendmode)*GMS.totmat, "GMS.matbuf"); + } + else { + GMS.matbuf= GMS.matbuf_fixed; + GMS.gmatbuf= GMS.gmatbuf_fixed; + GMS.blendmode= GMS.blendmode_fixed; + } /* no materials assigned? */ if(ob->totcol==0) { @@ -870,10 +883,6 @@ void GPU_set_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, Obj if(!glsl) ma= gpu_active_node_material(ma); if(ma==NULL) ma= &defmaterial; - /* this shouldn't happen .. */ - if(a>=MAXMATBUF) - continue; - /* create glsl material if requested */ gpumat = (glsl)? GPU_material_from_blender(GMS.gscene, ma): NULL; @@ -926,14 +935,14 @@ int GPU_enable_material(int nr, void *attribs) GPUBlendMode blendmode; /* prevent index to use un-initialized array items */ - if(nr>GMS.totmat) - nr= GMS.totmat; + if(nr>=GMS.totmat) + nr= 0; if(gattribs) memset(gattribs, 0, sizeof(*gattribs)); /* keep current material */ - if(nr>=MAXMATBUF || nr==GMS.lastmatnr) + if(nr==GMS.lastmatnr) return GMS.lastretval; /* unbind glsl material */ @@ -1004,6 +1013,21 @@ void GPU_disable_material(void) GPU_set_material_blend_mode(GPU_BLEND_SOLID); } +void GPU_end_object_materials(void) +{ + GPU_disable_material(); + + if(GMS.matbuf && GMS.matbuf != GMS.matbuf_fixed) { + MEM_freeN(GMS.matbuf); + MEM_freeN(GMS.gmatbuf); + MEM_freeN(GMS.blendmode); + + GMS.matbuf= NULL; + GMS.gmatbuf= NULL; + GMS.blendmode= NULL; + } +} + /* Lights */ int GPU_default_lights(void) diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index cd0b73c8f70..561638bfd20 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -142,10 +142,10 @@ typedef struct Material { /* **************** MATERIAL ********************* */ - /* maximum number of materials per material array - * (on object, mesh, lamp, etc.) - */ -#define MAXMAT 16 +/* maximum number of materials per material array. + * (on object, mesh, lamp, etc.). limited by + * short mat_nr in verts, faces. */ +#define MAXMAT 32767 /* material_type */ #define MA_TYPE_SURFACE 0 diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index cec27b85b23..d53a7833d0e 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -37,7 +37,7 @@ struct Image; typedef struct MFace { unsigned int v1, v2, v3, v4; - char pad, mat_nr; + short mat_nr; char edcode, flag; /* we keep edcode, for conversion to edges draw flags in old files */ } MFace; @@ -61,7 +61,8 @@ typedef struct MDeformVert { typedef struct MVert { float co[3]; short no[3]; - char flag, mat_nr, bweight, pad[3]; + short mat_nr; + char flag, bweight, pad[2]; } MVert; /* at the moment alpha is abused for vertex painting @@ -134,7 +135,7 @@ typedef struct MultiresColFace { } MultiresColFace; typedef struct MultiresFace { unsigned int v[4]; - unsigned int mid; + unsigned int mid; char flag, mat_nr, pad[2]; } MultiresFace; typedef struct MultiresEdge { diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index febf2fe59cd..2b0ede846af 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -113,8 +113,12 @@ typedef struct Object { ListBase disp; ListBase defbase; ListBase modifiers; /* list of ModifierData structures */ - - struct Material **mat; + + /* materials */ + struct Material **mat; /* material slots */ + char *matbits; /* 1 if material linked to object */ + int totcol; /* copy of mesh or curve or meta */ + int actcol; /* currently selected material in the UI */ /* rot en drot have to be together! (transform('r' en 's')) */ float loc[3], dloc[3], orig[3]; @@ -129,7 +133,7 @@ typedef struct Object { unsigned int lay; /* copy of Base */ short flag; /* copy of Base */ - short colbits; /* when zero, from obdata */ + short colbits; /* deprecated */ short transflag, protectflag; /* transformation settings and transform locks */ short trackflag, upflag; @@ -164,9 +168,7 @@ typedef struct Object { float m_contactProcessingThreshold; char dt, dtx; - char totcol; /* copy of mesh or curve or meta */ - char actcol; /* currently selected material in the user interface */ - char empty_drawtype, pad1[3]; + char empty_drawtype, pad1[5]; float empty_drawsize; float dupfacesca; /* dupliface scale */ diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 91488aa2a49..5c9da19f9b2 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -701,7 +701,6 @@ static void rna_def_curve_nurb(BlenderRNA *brna) prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "mat_nr"); RNA_def_property_ui_text(prop, "Material Index", ""); - RNA_def_property_range(prop, 0, MAXMAT-1); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Curve_material_index_range"); prop= RNA_def_property(srna, "character_index", PROP_INT, PROP_UNSIGNED); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 39fa6f36f23..b69a804cf6a 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -879,7 +879,6 @@ static void rna_def_mface(BlenderRNA *brna) prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "mat_nr"); RNA_def_property_ui_text(prop, "Material Index", ""); - RNA_def_property_range(prop, 0, MAXMAT-1); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshFace_material_index_range"); prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 092d15de96e..33e8c1fbd26 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -331,7 +331,7 @@ static int rna_MaterialSlot_link_get(PointerRNA *ptr) Object *ob= (Object*)ptr->id.data; int index= (Material**)ptr->data - ob->mat; - return (ob->colbits & (1<matbits[index] != 0; } static void rna_MaterialSlot_link_set(PointerRNA *ptr, int value) @@ -339,10 +339,14 @@ static void rna_MaterialSlot_link_set(PointerRNA *ptr, int value) Object *ob= (Object*)ptr->id.data; int index= (Material**)ptr->data - ob->mat; - if(value) + if(value) { + ob->matbits[index]= 1; ob->colbits |= (1<matbits[index]= 0; ob->colbits &= ~(1<data; nu= cu->nurb.first; @@ -2594,13 +2594,14 @@ static void init_render_surf(Render *re, ObjectRen *obr) MTC_Mat4Invert(ob->imat, mat); /* material array */ - memset(matar, 0, 4*32); - matar[0]= give_render_material(re, ob, 0); - for(a=0; atotcol; a++) { + totmat= ob->totcol+1; + matar= MEM_callocN(sizeof(Material*)*totmat, "init_render_surf matar"); + + for(a=0; atexco & TEXCO_ORCO) { + + if(matar[a] && matar[a]->texco & TEXCO_ORCO) need_orco= 1; - } } if(ob->parent && (ob->parent->type==OB_LATTICE)) need_orco= 1; @@ -2610,17 +2611,15 @@ static void init_render_surf(Render *re, ObjectRen *obr) displist.first= displist.last= 0; makeDispListSurf(re->scene, ob, &displist, 1, 0); - dl= displist.first; /* walk along displaylist and create rendervertices/-faces */ - while(dl) { - /* watch out: u ^= y, v ^= x !! */ - if(dl->type==DL_SURF) { + for(dl=displist.first; dl; dl=dl->next) { + /* watch out: u ^= y, v ^= x !! */ + if(dl->type==DL_SURF) orco+= 3*dl_surf_to_renderdata(obr, dl, matar, orco, mat); - } - - dl= dl->next; } + freedisplist(&displist); + MEM_freeN(matar); } static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset) @@ -2631,11 +2630,11 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset) VlakRen *vlr; DispList *dl; ListBase olddl={NULL, NULL}; - Material *matar[32]; + Material **matar; float len, *data, *fp, *orco=NULL, *orcobase= NULL; float n[3], mat[4][4]; int nr, startvert, startvlak, a, b; - int frontside, need_orco=0; + int frontside, need_orco=0, totmat; cu= ob->data; if(ob->type==OB_FONT && cu->str==NULL) return; @@ -2656,13 +2655,14 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset) MTC_Mat4Invert(ob->imat, mat); /* material array */ - memset(matar, 0, 4*32); - matar[0]= give_render_material(re, ob, 0); - for(a=0; atotcol; a++) { + totmat= ob->totcol+1; + matar= MEM_callocN(sizeof(Material*)*totmat, "init_render_surf matar"); + + for(a=0; atexco & TEXCO_ORCO) { + + if(matar[a] && matar[a]->texco & TEXCO_ORCO) need_orco= 1; - } } if(need_orco) orcobase=orco= get_object_orco(re, ob); @@ -2840,6 +2840,8 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset) freedisplist(&cu->disp); SWAP(ListBase, olddl, cu->disp); } + + MEM_freeN(matar); } /* ------------------------------------------------------------------------- */ -- cgit v1.2.3 From 89830ea0c87765aea30bc2b69abe417ef941ea55 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 13 Jul 2009 08:33:51 +0000 Subject: calling operators from python was raising an error without returning an error value. brecht, switched the order back to fix this, added an argument for WM_operatortype_find() to fail without printing an error. --- source/blender/editors/interface/interface.c | 2 +- source/blender/editors/interface/interface_layout.c | 8 ++++---- source/blender/editors/interface/interface_regions.c | 2 +- source/blender/editors/space_text/space_text.c | 3 ++- source/blender/python/intern/bpy_operator.c | 19 +++++++++++++------ source/blender/windowmanager/WM_api.h | 2 +- source/blender/windowmanager/intern/wm_event_system.c | 4 ++-- source/blender/windowmanager/intern/wm_operators.c | 11 +++++++---- 8 files changed, 31 insertions(+), 20 deletions(-) (limited to 'source') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 63e16c7933a..9ded2ec9eb8 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2273,7 +2273,7 @@ uiBut *ui_def_but_operator(uiBlock *block, int type, char *opname, int opcontext uiBut *but; wmOperatorType *ot; - ot= WM_operatortype_find(opname); + ot= WM_operatortype_find(opname, 0); if(!str) { if(ot) str= ot->name; diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 77af58bacc1..7fa0bf6426f 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -515,7 +515,7 @@ static void ui_item_disabled(uiLayout *layout, char *name) void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDProperty *properties, int context) { uiBlock *block= layout->root->block; - wmOperatorType *ot= WM_operatortype_find(idname); + wmOperatorType *ot= WM_operatortype_find(idname, 0); uiBut *but; int w; @@ -550,7 +550,7 @@ void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDPropert static char *ui_menu_enumpropname(uiLayout *layout, char *opname, char *propname, int retval) { - wmOperatorType *ot= WM_operatortype_find(opname); + wmOperatorType *ot= WM_operatortype_find(opname, 0); PointerRNA ptr; PropertyRNA *prop; @@ -593,7 +593,7 @@ void uiItemEnumO(uiLayout *layout, char *name, int icon, char *opname, char *pro void uiItemsEnumO(uiLayout *layout, char *opname, char *propname) { - wmOperatorType *ot= WM_operatortype_find(opname); + wmOperatorType *ot= WM_operatortype_find(opname, 0); PointerRNA ptr; PropertyRNA *prop; @@ -1213,7 +1213,7 @@ static void menu_item_enum_opname_menu(bContext *C, uiLayout *layout, void *arg) void uiItemMenuEnumO(uiLayout *layout, char *name, int icon, char *opname, char *propname) { - wmOperatorType *ot= WM_operatortype_find(opname); + wmOperatorType *ot= WM_operatortype_find(opname, 0); MenuItemLevel *lvl; if(!ot || !ot->srna) { diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index c574cf1072f..edde575f695 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2812,7 +2812,7 @@ void uiPupBlockO(bContext *C, uiBlockCreateFunc func, void *arg, char *opname, i handle= ui_popup_block_create(C, NULL, NULL, func, NULL, arg); handle->popup= 1; - handle->optype= (opname)? WM_operatortype_find(opname): NULL; + handle->optype= (opname)? WM_operatortype_find(opname, 0): NULL; handle->opcontext= opcontext; UI_add_popup_handlers(C, &window->handlers, handle); diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 5d3da461f71..68848c39c25 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -286,7 +286,8 @@ static void text_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "TEXT_OT_line_break", RETKEY, KM_PRESS, 0, 0); #ifndef DISABLE_PYTHON - WM_keymap_add_item(keymap, "TEXT_OT_line_console", RETKEY, KM_PRESS, KM_SHIFT, 0); /* python operator - space_text.py */ + WM_keymap_add_item(keymap, "TEXT_OT_console_exec", RETKEY, KM_PRESS, KM_SHIFT, 0); /* python operator - space_text.py */ + WM_keymap_add_item(keymap, "TEXT_OT_console_autocomplete", RETKEY, KM_PRESS, KM_ALT, 0); /* python operator - space_text.py */ #endif WM_keymap_add_item(keymap, "TEXT_OT_line_number", KM_TEXTINPUT, KM_ANY, KM_ANY, 0); diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index b183120dd2d..b57ef54304b 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -68,7 +68,7 @@ static PyObject *pyop_base_call( PyObject * self, PyObject * args, PyObject * k return NULL; } - ot= WM_operatortype_find(opname); + ot= WM_operatortype_find(opname, 1); if (ot == NULL) { PyErr_Format( PyExc_SystemError, "Operator \"%s\"could not be found", opname); return NULL; @@ -130,12 +130,19 @@ static PyObject *pyop_base_getattro( BPy_OperatorBase * self, PyObject *pyname ) PyObject *ret; wmOperatorType *ot; - if ((ret = PyObject_GenericGetAttr((PyObject *)self, pyname))) { - /* do nothing, this accounts for methoddef's add and remove */ - } - else if ((ot= WM_operatortype_find(name))) { + /* First look for the operator, then our own methods if that fails. + * when methods are searched first, PyObject_GenericGetAttr will raise an error + * each time we want to call an operator, we could clear the error but I prefer + * not to since calling operators is a lot more common then adding and removing. - Campbell */ + + if ((ot= WM_operatortype_find(name, 1))) { ret = PyCFunction_New( pyop_base_call_meth, pyname); /* set the name string as self, PyCFunction_New incref's self */ } + else if ((ret = PyObject_GenericGetAttr((PyObject *)self, pyname))) { + /* do nothing, this accounts for methoddef's add and remove + * An exception is raised when PyObject_GenericGetAttr fails + * but its ok because its overwritten below */ + } else { PyErr_Format( PyExc_AttributeError, "Operator \"%s\" not found", name); ret= NULL; @@ -170,7 +177,7 @@ static PyObject *pyop_base_rna(PyObject *self, PyObject *pyname) char *name = _PyUnicode_AsString(pyname); wmOperatorType *ot; - if ((ot= WM_operatortype_find(name))) { + if ((ot= WM_operatortype_find(name, 1))) { BPy_StructRNA *pyrna; PointerRNA ptr; diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 7fe98488ec0..c72da8fe593 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -132,7 +132,7 @@ int WM_operator_redo_popup (struct bContext *C, struct wmOperator *op); void WM_operator_free (struct wmOperator *op); void WM_operator_stack_clear(struct bContext *C); -wmOperatorType *WM_operatortype_find(const char *idname); +wmOperatorType *WM_operatortype_find(const char *idnamem, int quiet); wmOperatorType *WM_operatortype_exists(const char *idname); wmOperatorType *WM_operatortype_first(void); void WM_operatortype_append (void (*opfunc)(wmOperatorType*)); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 491b70deedc..3ef6e545dda 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -393,7 +393,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P /* invokes operator in context */ int WM_operator_name_call(bContext *C, const char *opstring, int context, PointerRNA *properties) { - wmOperatorType *ot= WM_operatortype_find(opstring); + wmOperatorType *ot= WM_operatortype_find(opstring, 0); wmWindow *window= CTX_wm_window(C); wmEvent *event; @@ -723,7 +723,7 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand printf("wm_handler_operator_call error\n"); } else { - wmOperatorType *ot= WM_operatortype_find(event->keymap_idname); + wmOperatorType *ot= WM_operatortype_find(event->keymap_idname, 0); if(ot) retval= wm_operator_invoke(C, ot, event, properties); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 330196a7a73..d7cac82ef90 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -82,7 +82,7 @@ static ListBase global_ops= {NULL, NULL}; /* ************ operator API, exported ********** */ -wmOperatorType *WM_operatortype_find(const char *idname) +wmOperatorType *WM_operatortype_find(const char *idname, int quiet) { wmOperatorType *ot; @@ -90,7 +90,10 @@ wmOperatorType *WM_operatortype_find(const char *idname) if(strncmp(ot->idname, idname, OP_MAX_TYPENAME)==0) return ot; } - printf("search for unknown operator %s\n", idname); + + if(!quiet) + printf("search for unknown operator %s\n", idname); + return NULL; } @@ -137,7 +140,7 @@ void WM_operatortype_append_ptr(void (*opfunc)(wmOperatorType*, void*), void *us int WM_operatortype_remove(const char *idname) { - wmOperatorType *ot = WM_operatortype_find(idname); + wmOperatorType *ot = WM_operatortype_find(idname, 0); if (ot==NULL) return 0; @@ -190,7 +193,7 @@ char *WM_operator_pystring(wmOperator *op) void WM_operator_properties_create(PointerRNA *ptr, const char *opstring) { - wmOperatorType *ot= WM_operatortype_find(opstring); + wmOperatorType *ot= WM_operatortype_find(opstring, 0); if(ot) RNA_pointer_create(NULL, ot->srna, NULL, ptr); -- cgit v1.2.3 From 030e5bd93ee0aaea3e43b89fb87191d7ec45c3be Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 13 Jul 2009 11:41:24 +0000 Subject: Drawing a string longer then 255 chars wasnt working. changes to flatten_string_append(...), probably only brecht is interested. - It was copying from the old malloc'd buffer but never the fixed buffer - the reason >255 length strings didnt render. - on first malloc for the FlatString allocate 512 rather then 256 chars since the fixed string is 256 chars. - if the char was '\0' fs->pos was set to 0, not sure why since char cant be '\0' because of the loop that calls flatten_string_append, removed. --- source/blender/editors/space_text/text_draw.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 9f8cedd569f..9721fbc2b9c 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -109,22 +109,18 @@ static void flatten_string_append(FlattenString *fs, char c, int accum) { if(fs->pos>=fs->len && fs->pos>=sizeof(fs->fixedbuf)-1) { char *nbuf; int *naccum; - int olen= fs->len; - - if(olen) fs->len*= 2; - else fs->len= 256; - + if(fs->len) fs->len*= 2; + else fs->len= sizeof(fs->fixedbuf) * 2; + nbuf= MEM_callocN(sizeof(*fs->buf)*fs->len, "fs->buf"); naccum= MEM_callocN(sizeof(*fs->accum)*fs->len, "fs->accum"); + + memcpy(nbuf, fs->buf, fs->pos); + memcpy(naccum, fs->accum, fs->pos); - if(olen) { - memcpy(nbuf, fs->buf, olen); - memcpy(naccum, fs->accum, olen); - - if(fs->buf != fs->fixedbuf) { - MEM_freeN(fs->buf); - MEM_freeN(fs->accum); - } + if(fs->buf != fs->fixedbuf) { + MEM_freeN(fs->buf); + MEM_freeN(fs->accum); } fs->buf= nbuf; @@ -134,8 +130,7 @@ static void flatten_string_append(FlattenString *fs, char c, int accum) fs->buf[fs->pos]= c; fs->accum[fs->pos]= accum; - if(c==0) fs->pos= 0; - else fs->pos++; + fs->pos++; } int flatten_string(SpaceText *st, FlattenString *fs, char *in) @@ -1336,6 +1331,7 @@ void draw_text_main(SpaceText *st, ARegion *ar) UI_ThemeColor(TH_TEXT); sprintf(linenr, "%d", i + linecount + 1); + /* itoa(i + linecount + 1, linenr, 10); */ /* not ansi-c :/ */ text_font_draw(st, TXT_OFFSET - 7, y, linenr); UI_ThemeColor(TH_TEXT); -- cgit v1.2.3 From 1227d5d6d3e96362260f3e6eeadc01612cc18898 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 13 Jul 2009 12:17:07 +0000 Subject: mathutils types didnt work properly in python2x. vec*matrix failed for eg. Now with KX_Python.h line 35 commented YoFrankie 1.1 should run unmodified in blender2.5 --- source/blender/python/generic/Mathutils.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source') diff --git a/source/blender/python/generic/Mathutils.c b/source/blender/python/generic/Mathutils.c index 651c5b8a265..53077659655 100644 --- a/source/blender/python/generic/Mathutils.c +++ b/source/blender/python/generic/Mathutils.c @@ -114,6 +114,13 @@ PyObject *Mathutils_Init(const char *from) //seed the generator for the rand function BLI_srand((unsigned int) (PIL_check_seconds_timer() * 0x7FFFFFFF)); + +#if (PY_VERSION_HEX < 0x03000000) + vector_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES; + matrix_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES; + euler_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES; + quaternion_Type.tp_flags |= Py_TPFLAGS_CHECKTYPES; +#endif if( PyType_Ready( &vector_Type ) < 0 ) return NULL; -- cgit v1.2.3 From 689abe000dae8a36e4afe29ad01528408ae20e8c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 13 Jul 2009 18:47:08 +0000 Subject: 2.5: bugfix for BLI_is_writable, made render with Save Buffers not work anymore. Now it first tries to open the file without truncating, and only then tries to create a new file. --- source/blender/blenlib/intern/fileops.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index ffebd05f2f6..917537bf03d 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -153,10 +153,24 @@ int BLI_is_writable(char *filename) { int file; + /* first try to open without creating */ file = open(filename, O_BINARY | O_RDWR, 0666); - if (file < 0) - return 0; + if (file < 0) { + /* now try to open and create. a test without actually + * creating a file would be nice, but how? */ + file = open(filename, O_BINARY | O_RDWR | O_CREAT, 0666); + + if(file < 0) { + return 0; + } + else { + /* success, delete the file we create */ + close(file); + BLI_delete(filename, 0, 0); + return 1; + } + } else { close(file); return 1; -- cgit v1.2.3 From 41fb3626f3d7c1e75a31aebeb1e488f59aeedf68 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 13 Jul 2009 19:09:13 +0000 Subject: 2.5: Render * UI layout for scene buttons has quite some changes, I tried to better organize things according to the pipeline, and also showing important properties by default, and collapsing less important ones. Some changes compared to 2.4x: * Panorama is now a Camera property. * Sequence and Compositing are now enabled by default, but will only do something when there is a node tree using nodes, or a strip in the sequence editor. * Enabling Full Sample now automatically enables Save Buffers too. * Stamp option to include info in file is removed, it now simply always does this if one of the stamp infos is enabled. * Xvid, H.264 and Ogg Theora are now directly in the file format menu, but still using FFMPEG. Unfortunately Ogg is broken at the moment (also in 2.4x), so that's disabled. And Xvid crashes on 64bit linux, maybe solvable by upgrading extern/xvidcore/, using ubuntu libs makes it work. * Organized file format menu by image/movie types. Added: * Render layers RNA wrapped, operatorized, layouted. * FFMPEG format/codec options are now working. Defaults changed: * Compositing & Sequencer enabled. * Tiles set to 8x8. * Time/Date/Frame/Scene/Camera/Filename enabled for stamp. --- source/blender/blenkernel/BKE_writeffmpeg.h | 22 +- source/blender/blenkernel/intern/image.c | 11 +- source/blender/blenkernel/intern/scene.c | 17 +- source/blender/blenkernel/intern/sequence.c | 7 +- source/blender/blenkernel/intern/writeavi.c | 3 +- source/blender/blenkernel/intern/writeffmpeg.c | 317 +++++++++++++++ source/blender/blenloader/intern/readfile.c | 16 + .../blender/editors/interface/interface_layout.c | 9 +- .../blender/editors/interface/interface_regions.c | 6 +- source/blender/editors/screen/screen_ops.c | 36 ++ .../blender/editors/space_buttons/buttons_intern.h | 3 + source/blender/editors/space_buttons/buttons_ops.c | 74 ++++ .../blender/editors/space_buttons/space_buttons.c | 3 + source/blender/editors/space_file/writeimage.c | 3 + source/blender/makesdna/DNA_camera_types.h | 1 + source/blender/makesdna/DNA_scene_types.h | 8 +- source/blender/makesrna/SConscript | 26 +- source/blender/makesrna/intern/CMakeLists.txt | 1 + source/blender/makesrna/intern/Makefile | 1 + source/blender/makesrna/intern/SConscript | 17 +- source/blender/makesrna/intern/rna_camera.c | 5 + source/blender/makesrna/intern/rna_scene.c | 444 +++++++++++++++++---- source/blender/render/intern/source/initrender.c | 3 +- source/blender/render/intern/source/pipeline.c | 21 +- 24 files changed, 939 insertions(+), 115 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_writeffmpeg.h b/source/blender/blenkernel/BKE_writeffmpeg.h index dba3944a58d..be136bd9d6d 100644 --- a/source/blender/blenkernel/BKE_writeffmpeg.h +++ b/source/blender/blenkernel/BKE_writeffmpeg.h @@ -46,19 +46,29 @@ extern "C" { #define FFMPEG_MKV 9 #define FFMPEG_OGG 10 -#define FFMPEG_PRESET_NONE 0 -#define FFMPEG_PRESET_DVD 1 -#define FFMPEG_PRESET_SVCD 2 -#define FFMPEG_PRESET_VCD 3 -#define FFMPEG_PRESET_DV 4 -#define FFMPEG_PRESET_H264 5 +#define FFMPEG_PRESET_NONE 0 +#define FFMPEG_PRESET_DVD 1 +#define FFMPEG_PRESET_SVCD 2 +#define FFMPEG_PRESET_VCD 3 +#define FFMPEG_PRESET_DV 4 +#define FFMPEG_PRESET_H264 5 +#define FFMPEG_PRESET_THEORA 6 +#define FFMPEG_PRESET_XVID 7 +struct IDProperty; struct RenderData; extern void start_ffmpeg(struct RenderData *rd, int rectx, int recty); extern void end_ffmpeg(void); extern void append_ffmpeg(struct RenderData *rd, int frame, int *pixels, int rectx, int recty); +extern void ffmpeg_set_preset(struct RenderData *rd, int preset); +extern void ffmpeg_verify_image_type(struct RenderData *rd); + +extern struct IDProperty *ffmpeg_property_add(struct RenderData *Rd, char *type, int opt_index, int parent_index); +extern int ffmpeg_property_add_string(struct RenderData *rd, const char *type, const char *str); +extern void ffmpeg_property_del(struct RenderData *rd, void *type, void *prop_); + #ifdef __cplusplus } #endif diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 754ec06f23f..93924d1ea0d 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -860,6 +860,9 @@ int BKE_imtype_is_movie(int imtype) case R_AVICODEC: case R_QUICKTIME: case R_FFMPEG: + case R_H264: + case R_THEORA: + case R_XVID: case R_FRAMESERVER: return 1; } @@ -870,7 +873,7 @@ void BKE_add_image_extension(Scene *scene, char *string, int imtype) { char *extension=""; - if(scene->r.imtype== R_IRIS) { + if(imtype== R_IRIS) { if(!BLI_testextensie(string, ".rgb")) extension= ".rgb"; } @@ -882,7 +885,7 @@ void BKE_add_image_extension(Scene *scene, char *string, int imtype) if(!BLI_testextensie(string, ".hdr")) extension= ".hdr"; } - else if(imtype==R_PNG || imtype==R_FFMPEG) { + else if (ELEM5(imtype, R_PNG, R_FFMPEG, R_H264, R_THEORA, R_XVID)) { if(!BLI_testextensie(string, ".png")) extension= ".png"; } @@ -1230,7 +1233,7 @@ int BKE_write_ibuf(Scene *scene, ImBuf *ibuf, char *name, int imtype, int subimt else if ((imtype==R_RADHDR)) { ibuf->ftype= RADHDR; } - else if (imtype==R_PNG || imtype==R_FFMPEG) { + else if (ELEM5(imtype, R_PNG, R_FFMPEG, R_H264, R_THEORA, R_XVID)) { ibuf->ftype= PNG; } #ifdef WITH_DDS @@ -1305,7 +1308,7 @@ int BKE_write_ibuf(Scene *scene, ImBuf *ibuf, char *name, int imtype, int subimt BLI_make_existing_file(name); - if(scene->r.scemode & R_STAMP_INFO) + if(scene->r.stamp & R_STAMP_ALL) BKE_stamp_info(scene, ibuf); ok = IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat); diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 23da5c66850..598336886c2 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -204,17 +204,17 @@ Scene *add_scene(char *name) sce= alloc_libblock(&G.main->scene, ID_SCE, name); sce->lay= 1; - sce->r.mode= R_GAMMA; + sce->r.mode= R_GAMMA|R_OSA|R_SHADOW|R_SSS|R_ENVMAP|R_RAYTRACE; sce->r.cfra= 1; sce->r.sfra= 1; sce->r.efra= 250; - sce->r.xsch= 320; - sce->r.ysch= 256; + sce->r.xsch= 1920; + sce->r.ysch= 1080; sce->r.xasp= 1; sce->r.yasp= 1; - sce->r.xparts= 4; - sce->r.yparts= 4; - sce->r.size= 100; + sce->r.xparts= 8; + sce->r.yparts= 8; + sce->r.size= 25; sce->r.planes= 24; sce->r.quality= 90; sce->r.framapto= 100; @@ -225,7 +225,7 @@ Scene *add_scene(char *name) sce->r.ocres = 128; sce->r.bake_mode= 1; /* prevent to include render stuff here */ - sce->r.bake_filter= 2; + sce->r.bake_filter= 8; sce->r.bake_osa= 5; sce->r.bake_flag= R_BAKE_CLEAR; sce->r.bake_normal_space= R_BAKE_SPACE_TANGENT; @@ -234,6 +234,9 @@ Scene *add_scene(char *name) sce->r.yplay= 480; sce->r.freqplay= 60; sce->r.depth= 32; + + sce->r.scemode= R_DOCOMP|R_DOSEQ|R_EXTENSION; + sce->r.stamp= R_STAMP_TIME|R_STAMP_FRAME|R_STAMP_DATE|R_STAMP_SCENE|R_STAMP_CAMERA; sce->r.threads= 1; diff --git a/source/blender/blenkernel/intern/sequence.c b/source/blender/blenkernel/intern/sequence.c index c8d95929027..3eeecd94a85 100644 --- a/source/blender/blenkernel/intern/sequence.c +++ b/source/blender/blenkernel/intern/sequence.c @@ -2017,7 +2017,8 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int RenderResult rres; int doseq, rendering= G.rendering; char scenename[64]; - int sce_valid =sce&& (sce->camera || sce->r.scemode & R_DOSEQ); + int have_seq= (sce->r.scemode & R_DOSEQ) && sce->ed && sce->ed->seqbase.first; + int sce_valid =sce && (sce->camera || have_seq); if (se->ibuf == NULL && sce_valid && !build_proxy_run) { se->ibuf = seq_proxy_fetch(scene, seq, cfra, render_size); @@ -2038,7 +2039,7 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int } else if (se->ibuf==NULL && sce_valid) { /* no need to display a waitcursor on sequencer scene strips */ - if (!(sce->r.scemode & R_DOSEQ)) + if (!have_seq) waitcursor(1); /* Hack! This function can be called from do_render_seq(), in that case @@ -2093,7 +2094,7 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int // XXX #if 0 if((G.f & G_PLAYANIM)==0 /* bad, is set on do_render_seq */ - && !(sce->r.scemode & R_DOSEQ) + && !have_seq && !build_proxy_run) #endif diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index f84bd690347..cfbe3f629d6 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -40,6 +40,7 @@ #include "BLI_blenlib.h" #include "BKE_global.h" +#include "BKE_utildefines.h" #include "BKE_writeavi.h" #include "AVI_avi.h" @@ -87,7 +88,7 @@ bMovieHandle *BKE_get_movie_handle(int imtype) } #endif #ifdef WITH_FFMPEG - if (imtype == R_FFMPEG) { + if (ELEM4(imtype, R_FFMPEG, R_H264, R_XVID, R_THEORA)) { mh.start_movie = start_ffmpeg; mh.append_movie = append_ffmpeg; mh.end_movie = end_ffmpeg; diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 25dc6fa2fd7..5e3c8024524 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -937,5 +937,322 @@ void end_ffmpeg(void) img_convert_ctx = 0; } } + +/* properties */ + +void ffmpeg_property_del(RenderData *rd, void *type, void *prop_) +{ + struct IDProperty *prop = (struct IDProperty *) prop_; + IDProperty * group; + + if (!rd->ffcodecdata.properties) { + return; + } + + group = IDP_GetPropertyFromGroup( + rd->ffcodecdata.properties, (char*) type); + if (group && prop) { + IDP_RemFromGroup(group, prop); + IDP_FreeProperty(prop); + MEM_freeN(prop); + } +} + +IDProperty *ffmpeg_property_add(RenderData *rd, char * type, int opt_index, int parent_index) +{ + AVCodecContext c; + const AVOption * o; + const AVOption * parent; + IDProperty * group; + IDProperty * prop; + IDPropertyTemplate val; + int idp_type; + char name[256]; + + avcodec_get_context_defaults(&c); + + o = c.av_class->option + opt_index; + parent = c.av_class->option + parent_index; + + if (!rd->ffcodecdata.properties) { + IDPropertyTemplate val; + + rd->ffcodecdata.properties + = IDP_New(IDP_GROUP, val, "ffmpeg"); + } + + group = IDP_GetPropertyFromGroup( + rd->ffcodecdata.properties, (char*) type); + + if (!group) { + IDPropertyTemplate val; + + group = IDP_New(IDP_GROUP, val, (char*) type); + IDP_AddToGroup(rd->ffcodecdata.properties, group); + } + + if (parent_index) { + sprintf(name, "%s:%s", parent->name, o->name); + } else { + strcpy(name, o->name); + } + + fprintf(stderr, "ffmpeg_property_add: %s %d %d %s\n", + type, parent_index, opt_index, name); + + prop = IDP_GetPropertyFromGroup(group, name); + if (prop) { + return prop; + } + + switch (o->type) { + case FF_OPT_TYPE_INT: + case FF_OPT_TYPE_INT64: + val.i = o->default_val; + idp_type = IDP_INT; + break; + case FF_OPT_TYPE_DOUBLE: + case FF_OPT_TYPE_FLOAT: + val.f = o->default_val; + idp_type = IDP_FLOAT; + break; + case FF_OPT_TYPE_STRING: + val.str = " "; + idp_type = IDP_STRING; + break; + case FF_OPT_TYPE_CONST: + val.i = 1; + idp_type = IDP_INT; + break; + default: + return NULL; + } + prop = IDP_New(idp_type, val, name); + IDP_AddToGroup(group, prop); + return prop; +} + +/* not all versions of ffmpeg include that, so here we go ... */ + +static const AVOption *my_av_find_opt(void *v, const char *name, + const char *unit, int mask, int flags){ + AVClass *c= *(AVClass**)v; + const AVOption *o= c->option; + + for(;o && o->name; o++){ + if(!strcmp(o->name, name) && + (!unit || (o->unit && !strcmp(o->unit, unit))) && + (o->flags & mask) == flags ) + return o; + } + return NULL; +} + +int ffmpeg_property_add_string(RenderData *rd, const char * type, const char * str) +{ + AVCodecContext c; + const AVOption * o = 0; + const AVOption * p = 0; + char name_[128]; + char * name; + char * param; + IDProperty * prop; + + avcodec_get_context_defaults(&c); + + strncpy(name_, str, 128); + + name = name_; + while (*name == ' ') name++; + + param = strchr(name, ':'); + + if (!param) { + param = strchr(name, ' '); + } + if (param) { + *param++ = 0; + while (*param == ' ') param++; + } + + o = my_av_find_opt(&c, name, NULL, 0, 0); + if (!o) { + return 0; + } + if (param && o->type == FF_OPT_TYPE_CONST) { + return 0; + } + if (param && o->type != FF_OPT_TYPE_CONST && o->unit) { + p = my_av_find_opt(&c, param, o->unit, 0, 0); + prop = ffmpeg_property_add(rd, + (char*) type, p - c.av_class->option, + o - c.av_class->option); + } else { + prop = ffmpeg_property_add(rd, + (char*) type, o - c.av_class->option, 0); + } + + + if (!prop) { + return 0; + } + + if (param && !p) { + switch (prop->type) { + case IDP_INT: + IDP_Int(prop) = atoi(param); + break; + case IDP_FLOAT: + IDP_Float(prop) = atof(param); + break; + case IDP_STRING: + strncpy(IDP_String(prop), param, prop->len); + break; + } + } + return 1; +} + +void ffmpeg_set_preset(RenderData *rd, int preset) +{ + int isntsc = (rd->frs_sec != 25); + + switch (preset) { + case FFMPEG_PRESET_VCD: + rd->ffcodecdata.type = FFMPEG_MPEG1; + rd->ffcodecdata.video_bitrate = 1150; + rd->xsch = 352; + rd->ysch = isntsc ? 240 : 288; + rd->ffcodecdata.gop_size = isntsc ? 18 : 15; + rd->ffcodecdata.rc_max_rate = 1150; + rd->ffcodecdata.rc_min_rate = 1150; + rd->ffcodecdata.rc_buffer_size = 40*8; + rd->ffcodecdata.mux_packet_size = 2324; + rd->ffcodecdata.mux_rate = 2352 * 75 * 8; + break; + + case FFMPEG_PRESET_SVCD: + rd->ffcodecdata.type = FFMPEG_MPEG2; + rd->ffcodecdata.video_bitrate = 2040; + rd->xsch = 480; + rd->ysch = isntsc ? 480 : 576; + rd->ffcodecdata.gop_size = isntsc ? 18 : 15; + rd->ffcodecdata.rc_max_rate = 2516; + rd->ffcodecdata.rc_min_rate = 0; + rd->ffcodecdata.rc_buffer_size = 224*8; + rd->ffcodecdata.mux_packet_size = 2324; + rd->ffcodecdata.mux_rate = 0; + break; + + case FFMPEG_PRESET_DVD: + rd->ffcodecdata.type = FFMPEG_MPEG2; + rd->ffcodecdata.video_bitrate = 6000; + rd->xsch = 720; + rd->ysch = isntsc ? 480 : 576; + rd->ffcodecdata.gop_size = isntsc ? 18 : 15; + rd->ffcodecdata.rc_max_rate = 9000; + rd->ffcodecdata.rc_min_rate = 0; + rd->ffcodecdata.rc_buffer_size = 224*8; + rd->ffcodecdata.mux_packet_size = 2048; + rd->ffcodecdata.mux_rate = 10080000; + break; + + case FFMPEG_PRESET_DV: + rd->ffcodecdata.type = FFMPEG_DV; + rd->xsch = 720; + rd->ysch = isntsc ? 480 : 576; + break; + + case FFMPEG_PRESET_H264: + rd->ffcodecdata.type = FFMPEG_AVI; + rd->ffcodecdata.codec = CODEC_ID_H264; + rd->ffcodecdata.video_bitrate = 6000; + rd->ffcodecdata.gop_size = isntsc ? 18 : 15; + rd->ffcodecdata.rc_max_rate = 9000; + rd->ffcodecdata.rc_min_rate = 0; + rd->ffcodecdata.rc_buffer_size = 224*8; + rd->ffcodecdata.mux_packet_size = 2048; + rd->ffcodecdata.mux_rate = 10080000; + + ffmpeg_property_add_string(rd, "video", "coder:vlc"); + ffmpeg_property_add_string(rd, "video", "flags:loop"); + ffmpeg_property_add_string(rd, "video", "cmp:chroma"); + ffmpeg_property_add_string(rd, "video", "partitions:parti4x4"); + ffmpeg_property_add_string(rd, "video", "partitions:partp8x8"); + ffmpeg_property_add_string(rd, "video", "partitions:partb8x8"); + ffmpeg_property_add_string(rd, "video", "me:hex"); + ffmpeg_property_add_string(rd, "video", "subq:5"); + ffmpeg_property_add_string(rd, "video", "me_range:16"); + ffmpeg_property_add_string(rd, "video", "keyint_min:25"); + ffmpeg_property_add_string(rd, "video", "sc_threshold:40"); + ffmpeg_property_add_string(rd, "video", "i_qfactor:0.71"); + ffmpeg_property_add_string(rd, "video", "b_strategy:1"); + + break; + + case FFMPEG_PRESET_THEORA: + case FFMPEG_PRESET_XVID: + if(preset == FFMPEG_PRESET_XVID) { + rd->ffcodecdata.type = FFMPEG_AVI; + rd->ffcodecdata.codec = CODEC_ID_XVID; + } + else if(preset == FFMPEG_PRESET_THEORA) { + rd->ffcodecdata.type = FFMPEG_OGG; // XXX broken + rd->ffcodecdata.codec = CODEC_ID_THEORA; + } + + rd->ffcodecdata.video_bitrate = 6000; + rd->ffcodecdata.gop_size = isntsc ? 18 : 15; + rd->ffcodecdata.rc_max_rate = 9000; + rd->ffcodecdata.rc_min_rate = 0; + rd->ffcodecdata.rc_buffer_size = 224*8; + rd->ffcodecdata.mux_packet_size = 2048; + rd->ffcodecdata.mux_rate = 10080000; + break; + + } +} + +void ffmpeg_verify_image_type(RenderData *rd) +{ + int audio= 0; + + if(rd->imtype == R_FFMPEG) { + if(rd->ffcodecdata.type <= 0 || + rd->ffcodecdata.codec <= 0 || + rd->ffcodecdata.audio_codec <= 0 || + rd->ffcodecdata.video_bitrate <= 1) { + + rd->ffcodecdata.codec = CODEC_ID_MPEG2VIDEO; + ffmpeg_set_preset(rd, FFMPEG_PRESET_DVD); + } + + audio= 1; + } + else if(rd->imtype == R_H264) { + if(rd->ffcodecdata.codec != CODEC_ID_H264) { + ffmpeg_set_preset(rd, FFMPEG_PRESET_H264); + audio= 1; + } + } + else if(rd->imtype == R_XVID) { + if(rd->ffcodecdata.codec != CODEC_ID_XVID) { + ffmpeg_set_preset(rd, FFMPEG_PRESET_XVID); + audio= 1; + } + } + else if(rd->imtype == R_THEORA) { + if(rd->ffcodecdata.codec != CODEC_ID_THEORA) { + ffmpeg_set_preset(rd, FFMPEG_PRESET_THEORA); + audio= 1; + } + } + + if(audio && rd->ffcodecdata.audio_codec <= 0) { + rd->ffcodecdata.audio_codec = CODEC_ID_MP2; + rd->ffcodecdata.audio_bitrate = 128; + } +} + #endif diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 21e173bd87d..06092cc97d4 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9098,7 +9098,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if (main->versionfile < 250) { bScreen *screen; Scene *scene; + Base *base; Material *ma; + Camera *cam; Mesh *me; Scene *sce; Tex *tx; @@ -9132,6 +9134,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for(sce= main->scene.first; sce; sce= sce->id.next) { if(sce->nodetree && strlen(sce->nodetree->id.name)==0) strcpy(sce->nodetree->id.name, "NTComposit Nodetree"); + + /* move to cameras */ + if(sce->r.scemode & R_PANORAMA) { + for(base=scene->base.first; base; base=base->next) { + ob= newlibadr(fd, lib, base->object); + + if(ob->type == OB_CAMERA && !ob->id.lib) { + cam= newlibadr(fd, lib, ob->data); + cam->flag |= CAM_PANORAMA; + } + } + + sce->r.scemode &= ~R_PANORAMA; + } } /* and texture trees */ for(tx= main->tex.first; tx; tx= tx->id.next) { diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 7fa0bf6426f..284da29f0d2 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -466,13 +466,18 @@ static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, char *name, i uiLayout *sub; uiBut *but; PropertySubType subtype; + int labelw; sub= uiLayoutRow(layout, 0); uiBlockSetCurLayout(block, sub); if(strcmp(name, "") != 0) { - w= w/2; - uiDefBut(block, LABEL, 0, name, x, y, w, h, NULL, 0.0, 0.0, 0, 0, ""); + /* XXX UI_GetStringWidth is not accurate + labelw= UI_GetStringWidth(name); + CLAMP(labelw, w/4, 3*w/4);*/ + labelw= w/2; + uiDefBut(block, LABEL, 0, name, x, y, labelw, h, NULL, 0.0, 0.0, 0, 0, ""); + w= w-labelw; } subtype= RNA_property_subtype(prop); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index edde575f695..c1129db8ebe 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -374,8 +374,10 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) if(ELEM3(but->type, TEX, IDPOIN, SEARCH_MENU)) { /* full string */ ui_get_but_string(but, buf, sizeof(buf)); - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Value: %s", buf); - data->totline++; + if(buf[0]) { + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), "Value: %s", buf); + data->totline++; + } } if(but->rnaprop) { diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index c3b68eb74ce..113e7249e65 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2320,6 +2320,40 @@ static ScrArea *find_area_showing_r_result(bContext *C) return sa; } +static ScrArea *find_area_image_empty(bContext *C) +{ + bScreen *sc= CTX_wm_screen(C); + ScrArea *sa; + SpaceImage *sima; + + /* find an imagewindow showing render result */ + for(sa=sc->areabase.first; sa; sa= sa->next) { + if(sa->spacetype==SPACE_IMAGE) { + sima= sa->spacedata.first; + if(!sima->image) + break; + } + } + return sa; +} + +static ScrArea *find_empty_image_area(bContext *C) +{ + bScreen *sc= CTX_wm_screen(C); + ScrArea *sa; + SpaceImage *sima; + + /* find an imagewindow showing render result */ + for(sa=sc->areabase.first; sa; sa= sa->next) { + if(sa->spacetype==SPACE_IMAGE) { + sima= sa->spacedata.first; + if(!sima->image) + break; + } + } + return sa; +} + static void screen_set_image_output(bContext *C) { Scene *scene= CTX_data_scene(C); @@ -2334,6 +2368,8 @@ static void screen_set_image_output(bContext *C) else { sa= find_area_showing_r_result(C); + if(sa==NULL) + sa= find_area_image_empty(C); if(sa==NULL) { /* find largest open non-image area */ diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h index f16a232f26d..f09f35589b9 100644 --- a/source/blender/editors/space_buttons/buttons_intern.h +++ b/source/blender/editors/space_buttons/buttons_intern.h @@ -80,5 +80,8 @@ void PARTICLE_OT_remove_keyed_target(struct wmOperatorType *ot); void PARTICLE_OT_keyed_target_move_up(struct wmOperatorType *ot); void PARTICLE_OT_keyed_target_move_down(struct wmOperatorType *ot); +void SCENE_OT_render_layer_add(struct wmOperatorType *ot); +void SCENE_OT_render_layer_remove(struct wmOperatorType *ot); + #endif /* ED_BUTTONS_INTERN_H */ diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 6fb52c61131..fb1e9d1214d 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -33,6 +33,7 @@ #include "DNA_curve_types.h" #include "DNA_object_types.h" #include "DNA_material_types.h" +#include "DNA_node_types.h" #include "DNA_texture_types.h" #include "DNA_scene_types.h" #include "DNA_world_types.h" @@ -43,7 +44,9 @@ #include "BKE_library.h" #include "BKE_main.h" #include "BKE_material.h" +#include "BKE_node.h" #include "BKE_particle.h" +#include "BKE_scene.h" #include "BKE_texture.h" #include "BKE_utildefines.h" #include "BKE_world.h" @@ -689,3 +692,74 @@ void PARTICLE_OT_keyed_target_move_down(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/********************** render layer operators *********************/ + +static int render_layer_add_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + + scene_add_render_layer(scene); + scene->r.actlay= BLI_countlist(&scene->r.layers) - 1; + + WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene); + + return OPERATOR_FINISHED; +} + +void SCENE_OT_render_layer_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Render Layer"; + ot->idname= "SCENE_OT_render_layer_add"; + + /* api callbacks */ + ot->exec= render_layer_add_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int render_layer_remove_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + SceneRenderLayer *rl; + int act= scene->r.actlay; + + if(BLI_countlist(&scene->r.layers) <= 1) + return OPERATOR_CANCELLED; + + rl= BLI_findlink(&scene->r.layers, scene->r.actlay); + BLI_remlink(&scene->r.layers, rl); + MEM_freeN(rl); + + scene->r.actlay= 0; + + if(scene->nodetree) { + bNode *node; + for(node= scene->nodetree->nodes.first; node; node= node->next) { + if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) { + if(node->custom1==act) + node->custom1= 0; + else if(node->custom1>act) + node->custom1--; + } + } + } + + WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene); + + return OPERATOR_FINISHED; +} + +void SCENE_OT_render_layer_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Render Layer"; + ot->idname= "SCENE_OT_render_layer_remove"; + + /* api callbacks */ + ot->exec= render_layer_remove_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 6cdb4dbf93d..17f55c9395e 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -228,6 +228,9 @@ void buttons_operatortypes(void) WM_operatortype_append(PARTICLE_OT_remove_keyed_target); WM_operatortype_append(PARTICLE_OT_keyed_target_move_up); WM_operatortype_append(PARTICLE_OT_keyed_target_move_down); + + WM_operatortype_append(SCENE_OT_render_layer_add); + WM_operatortype_append(SCENE_OT_render_layer_remove); } void buttons_keymap(struct wmWindowManager *wm) diff --git a/source/blender/editors/space_file/writeimage.c b/source/blender/editors/space_file/writeimage.c index 25890953320..ac15ed93ad0 100644 --- a/source/blender/editors/space_file/writeimage.c +++ b/source/blender/editors/space_file/writeimage.c @@ -153,6 +153,9 @@ void save_image_filesel_str(Scene *scene, char *str) strcpy(str, "Save Radiance HDR"); break; case R_FFMPEG: + case R_H264: + case R_XVID: + case R_THEORA: case R_PNG: strcpy(str, "Save PNG"); break; diff --git a/source/blender/makesdna/DNA_camera_types.h b/source/blender/makesdna/DNA_camera_types.h index 7a504efdd2a..8ba7fa8b58d 100644 --- a/source/blender/makesdna/DNA_camera_types.h +++ b/source/blender/makesdna/DNA_camera_types.h @@ -79,6 +79,7 @@ typedef struct Camera { #define CAM_SHOWNAME 16 #define CAM_ANGLETOGGLE 32 #define CAM_DS_EXPAND 64 +#define CAM_PANORAMA 128 /* yafray: dof sampling switch */ #define CAM_YF_NO_QMC 512 diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index c71aa81147d..7a6cbced45e 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -635,7 +635,7 @@ typedef struct Scene { #define R_FIELDSTILL 0x0080 #define R_RADIO 0x0100 #define R_BORDER 0x0200 -#define R_PANORAMA 0x0400 +#define R_PANORAMA 0x0400 /* deprecated as scene option, still used in renderer */ #define R_CROP 0x0800 #define R_COSMO 0x1000 #define R_ODDFIELD 0x2000 @@ -694,7 +694,7 @@ typedef struct Scene { #define R_COMP_FREE 0x0800 #define R_NO_IMAGE_LOAD 0x1000 #define R_NO_TEX 0x2000 -#define R_STAMP_INFO 0x4000 +#define R_STAMP_INFO 0x4000 /* deprecated */ #define R_FULL_SAMPLE 0x8000 #define R_COMP_RERENDER 0x10000 #define R_RECURS_PROTECTION 0x20000 @@ -710,6 +710,7 @@ typedef struct Scene { #define R_STAMP_MARKER 0x0080 #define R_STAMP_FILENAME 0x0100 #define R_STAMP_SEQSTRIP 0x0200 +#define R_STAMP_ALL (R_STAMP_TIME|R_STAMP_FRAME|R_STAMP_DATE|R_STAMP_CAMERA|R_STAMP_SCENE|R_STAMP_NOTE|R_STAMP_MARKER|R_STAMP_FILENAME|R_STAMP_SEQSTRIP) /* alphamode */ #define R_ADDSKY 0 @@ -746,6 +747,9 @@ typedef struct Scene { #define R_MULTILAYER 28 #define R_DDS 29 #define R_JP2 30 +#define R_H264 31 +#define R_XVID 32 +#define R_THEORA 33 /* subimtype, flag options for imtype */ #define R_OPENEXR_HALF 1 diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index 967636fe36b..89118850b20 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -9,4 +9,28 @@ objs += o incs = '#/intern/guardedalloc ../blenkernel ../blenlib ../makesdna intern .' incs += ' ../windowmanager ../editors/include ../imbuf' -env.BlenderLib ( 'bf_rna', objs, Split(incs), [], libtype=['core'], priority = [195] ) +defs = [] + +if env['WITH_BF_OPENEXR']: + defs.append('WITH_OPENEXR') + +if env['WITH_BF_OPENJPEG']: + defs.append('WITH_OPENJPEG') + +if env['WITH_BF_DDS']: + defs.append('WITH_DDS') + +if env['WITH_BF_FFMPEG']: + defs.append('WITH_FFMPEG') + incs += ' ' + env['BF_FFMPEG_INC'] + +if env['WITH_BF_OGG']: + defs.append('WITH_OGG') + +if env['WITH_BF_QUICKTIME']: + defs.append('WITH_QUICKTIME') + +if env['WITH_BF_LCMS']: + defs.append('WITH_LCMS') + +env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core'], priority = [195] ) diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 3400b69ee38..85505d546c4 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -59,6 +59,7 @@ IF(WITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_FFMPEG) + SET(INC ${INC} ${FFMPEG_INC}) ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) diff --git a/source/blender/makesrna/intern/Makefile b/source/blender/makesrna/intern/Makefile index 1694e55ed4c..7f9bfbfea67 100644 --- a/source/blender/makesrna/intern/Makefile +++ b/source/blender/makesrna/intern/Makefile @@ -57,6 +57,7 @@ CPPFLAGS += -I. ifeq ($(WITH_FFMPEG),true) CPPFLAGS += -DWITH_FFMPEG + CPPFLAGS += $(NAN_FFMPEGCFLAGS) endif ifeq ($(WITH_OPENEXR), true) diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 03f0afdb2cc..7cd3fde21be 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -29,6 +29,10 @@ makesrna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesrna/\\"" ' defs = [] +incs = '#/intern/guardedalloc ../../blenlib ../../blenkernel' +incs += ' ../../imbuf ../../makesdna ../../makesrna' +incs += ' ../../windowmanager ../../editors/include' + if env['WITH_BF_OPENEXR']: defs.append('WITH_OPENEXR') @@ -40,6 +44,10 @@ if env['WITH_BF_DDS']: if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') + incs += ' ' + env['BF_FFMPEG_INC'] + +if env['WITH_BF_OGG']: + defs.append('WITH_OGG') if env['WITH_BF_QUICKTIME']: defs.append('WITH_QUICKTIME') @@ -49,14 +57,7 @@ if env['WITH_BF_LCMS']: makesrna_tool.Append(CPPDEFINES=defs) -makesrna_tool.Append (CPPPATH = ['#/intern/guardedalloc', - '../../blenlib', - '../../blenkernel', - '../../imbuf', - '../../makesdna', - '../../makesrna', - '../../windowmanager', - '../../editors/include']) +makesrna_tool.Append (CPPPATH = Split(incs)) if env['OURPLATFORM'] == 'linuxcross': USE_WINE = True # when cross compiling on linux 64bit this is useful diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 4814f9583a9..9c33b0afb00 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -153,6 +153,11 @@ void RNA_def_camera(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_lens_unit_items); RNA_def_property_ui_text(prop, "Lens Unit", "Unit to edit lens in for the user interface."); + prop= RNA_def_property(srna, "panorama", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_PANORAMA); + RNA_def_property_ui_text(prop, "Panorama", "Render the scene with a cylindrical camera for pseudo-fisheye lens effects."); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + /* pointers */ rna_def_animdata_common(srna); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 6e2a6e27928..9c9fbf0e3cf 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -31,11 +31,11 @@ #include "DNA_scene_types.h" -/* +#ifdef WITH_FFMPEG #include "BKE_writeffmpeg.h" #include #include -*/ +#endif #include "WM_types.h" @@ -52,8 +52,13 @@ EnumPropertyItem prop_mode_items[] ={ #ifdef RNA_RUNTIME +#include "DNA_node_types.h" + #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_node.h" + +#include "BLI_threads.h" PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter) { @@ -63,9 +68,8 @@ PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter) return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object); } -static void rna_Scene_layer_set(PointerRNA *ptr, const int *values) +static int layer_set(int lay, const int *values) { - Scene *scene= (Scene*)ptr->data; int i, tot= 0; /* ensure we always have some layer selected */ @@ -74,12 +78,21 @@ static void rna_Scene_layer_set(PointerRNA *ptr, const int *values) tot++; if(tot==0) - return; + return lay; for(i=0; i<20; i++) { - if(values[i]) scene->lay |= (1<lay &= ~(1<data; + + scene->lay= layer_set(scene->lay, values); } static void rna_Scene_start_frame_set(PointerRNA *ptr, int value) @@ -102,6 +115,92 @@ static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr) //update_for_newframe(); } +static int rna_SceneRenderData_threads_get(PointerRNA *ptr) +{ + RenderData *rd= (RenderData*)ptr->data; + + if(rd->mode & R_FIXED_THREADS) + return rd->threads; + else + return BLI_system_thread_count(); +} + +static int rna_SceneRenderData_save_buffers_get(PointerRNA *ptr) +{ + RenderData *rd= (RenderData*)ptr->data; + + return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0; +} + +static void rna_SceneRenderData_file_format_set(PointerRNA *ptr, int value) +{ + RenderData *rd= (RenderData*)ptr->data; + + rd->imtype= value; + ffmpeg_verify_image_type(rd); +} + +static int rna_SceneRenderData_active_layer_index_get(PointerRNA *ptr) +{ + RenderData *rd= (RenderData*)ptr->data; + return rd->actlay; +} + +static void rna_SceneRenderData_active_layer_index_set(PointerRNA *ptr, int value) +{ + RenderData *rd= (RenderData*)ptr->data; + rd->actlay= value; +} + +static void rna_SceneRenderData_active_layer_index_range(PointerRNA *ptr, int *min, int *max) +{ + RenderData *rd= (RenderData*)ptr->data; + + *min= 0; + *max= BLI_countlist(&rd->layers)-1; + *max= MAX2(0, *max); +} + +static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value) +{ + Scene *scene= (Scene*)ptr->id.data; + SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data; + + BLI_strncpy(rl->name, value, sizeof(rl->name)); + + if(scene->nodetree) { + bNode *node; + int index= BLI_findindex(&scene->r.layers, rl); + + for(node= scene->nodetree->nodes.first; node; node= node->next) { + if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) { + if(node->custom1==index) + BLI_strncpy(node->name, rl->name, NODE_MAXSTR); + } + } + } +} + +static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values) +{ + SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data; + rl->lay= layer_set(rl->lay, values); +} + +static void rna_SceneRenderLayer_zmask_layer_set(PointerRNA *ptr, const int *values) +{ + SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data; + rl->lay_zmask= layer_set(rl->lay_zmask, values); +} + +static void rna_SceneRenderLayer_pass_update(bContext *C, PointerRNA *ptr) +{ + Scene *scene= (Scene*)ptr->id.data; + + if(scene->nodetree) + ntreeCompositForceHidden(scene->nodetree, scene); +} + #else void rna_def_sculpt(BlenderRNA *brna) @@ -257,6 +356,194 @@ void rna_def_tool_settings(BlenderRNA *brna) rna_def_sculpt(brna); } +void rna_def_scene_render_layer(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "SceneRenderLayer", NULL); + RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer."); + + prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); + RNA_def_property_ui_text(prop, "Name", "Render layer name."); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + RNA_def_struct_name_property(srna, prop); + + prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "mat_override"); + RNA_def_property_struct_type(prop, "Material"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "Group"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + /* layers */ + prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "lay", 1); + RNA_def_property_array(prop, 20); + RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer."); + RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set"); + + prop= RNA_def_property(srna, "zmask_layers", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1); + RNA_def_property_array(prop, 20); + RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers."); + RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_zmask_layer_set"); + + /* layer options */ + prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE); + RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "zmask", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK); + RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "zmask_negate", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK); + RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "all_z", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z); + RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "solid", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID); + RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID); + RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "ztransp", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID); + RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos)."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID); + RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID); + RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "strand", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID); + RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + /* passes */ + prop= RNA_def_property(srna, "pass_combined", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED); + RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_z", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z); + RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_vector", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR); + RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_normal", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL); + RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_uv", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV); + RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_mist", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST); + RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_object_index", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB); + RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_color", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA); + RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_diffuse", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE); + RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_specular", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC); + RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_shadow", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW); + RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_ao", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO); + RNA_def_property_ui_text(prop, "AO", "Deliver AO pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_reflection", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT); + RNA_def_property_ui_text(prop, "Reflection", "Deliver ratraced reflection pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_refraction", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT); + RNA_def_property_ui_text(prop, "Refraction", "Deliver ratraced refraction pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_specular_exclude", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC); + RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_shadow_exclude", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW); + RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_ao_exclude", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO); + RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_reflection_exclude", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT); + RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude ratraced reflection pass from combined."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_refraction_exclude", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT); + RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude ratraced refraction pass from combined."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); +} + void rna_def_scene_render_data(BlenderRNA *brna) { StructRNA *srna; @@ -324,10 +611,27 @@ void rna_def_scene_render_data(BlenderRNA *brna) static EnumPropertyItem image_type_items[] = { - {R_FRAMESERVER, "FRAMESERVER", 0, "Frame Server", ""}, -#ifdef WITH_FFMPEG - {R_FFMPEG, "FFMPEG", 0, "FFMpeg", ""}, + {R_PNG, "PNG", 0, "PNG", ""}, + {R_JPEG90, "JPEG", 0, "JPEG", ""}, +#ifdef WITH_OPENJPEG + {R_JP2, "JPEG2000", 0, "JPEG 2000", ""}, +#endif + {R_TIFF, "TIFF", 0, "TIFF", ""}, // XXX only with G.have_libtiff + {R_BMP, "BMP", 0, "BMP", ""}, + {R_TARGA, "TARGA", 0, "Targa", ""}, + {R_RAWTGA, "RAWTARGA", 0, "Targa Raw", ""}, + //{R_DDS, "DDS", 0, "DDS", ""}, // XXX not yet implemented + {R_HAMX, "HAMX", 0, "HamX", ""}, + {R_IRIS, "IRIS", 0, "Iris", ""}, + {0, "", 0, NULL, NULL}, +#ifdef WITH_OPENEXR + {R_OPENEXR, "OPENEXR", 0, "OpenEXR", ""}, + {R_MULTILAYER, "MULTILAYER", 0, "MultiLayer", ""}, #endif + {R_RADHDR, "RADHDR", 0, "Radiance HDR", ""}, + {R_CINEON, "CINEON", 0, "Cineon", ""}, + {R_DPX, "DPX", 0, "DPX", ""}, + {0, "", 0, NULL, NULL}, {R_AVIRAW, "AVIRAW", 0, "AVI Raw", ""}, {R_AVIJPEG, "AVIJPEG", 0, "AVI JPEG", ""}, #ifdef _WIN32 @@ -336,31 +640,25 @@ void rna_def_scene_render_data(BlenderRNA *brna) #ifdef WITH_QUICKTIME {R_QUICKTIME, "QUICKTIME", 0, "QuickTime", ""}, #endif - {R_TARGA, "TARGA", 0, "Targa", ""}, - {R_RAWTGA, "RAWTARGA", 0, "Targa Raw", ""}, - {R_PNG, "PNG", 0, "PNG", ""}, - //{R_DDS, "DDS", 0, "DDS", ""}, // XXX not yet implemented -//#ifdef WITH_OPENJPEG - {R_JP2, "JPEG2000", 0, "JPEG 2000", ""}, -//#endif - {R_BMP, "BMP", 0, "BMP", ""}, - {R_JPEG90, "JPEG", 0, "JPEG", ""}, - {R_HAMX, "HAMX", 0, "HamX", ""}, - {R_IRIS, "IRIS", 0, "Iris", ""}, - {R_RADHDR, "RADHDR", 0, "Radiance HDR", ""}, - {R_CINEON, "CINEON", 0, "Cineon", ""}, - {R_DPX, "DPX", 0, "DPX", ""}, #ifdef __sgi {R_MOVIE, "MOVIE", 0, "Movie", ""}, #endif -//#ifdef WITH_OPENEXR - {R_OPENEXR, "OPENEXR", 0, "OpenEXR", ""}, - {R_MULTILAYER, "MULTILAYER", 0, "MultiLayer", ""}, -//#endif - {R_TIFF, "TIFF", 0, "TIFF", ""}, // XXX only with G.have_libtiff +#ifdef WITH_FFMPEG + {R_H264, "H264", 0, "H.264", ""}, + {R_XVID, "XVID", 0, "Xvid", ""}, + // XXX broken +#if 0 +#ifdef WITH_OGG + {R_THEORA, "THEORA", 0, "Ogg Theora", ""}, +#endif +#endif + {R_FFMPEG, "FFMPEG", 0, "FFMpeg", ""}, +#endif + {0, "", 0, NULL, NULL}, + {R_FRAMESERVER, "FRAMESERVER", 0, "Frame Server", ""}, {0, NULL, 0, NULL, NULL}}; -//#ifdef WITH_OPENEXR +#ifdef WITH_OPENEXR static EnumPropertyItem exr_codec_items[] = { {0, "NONE", 0, "None", ""}, {1, "PXR24", 0, "Pxr24 (lossy)", ""}, @@ -368,9 +666,9 @@ void rna_def_scene_render_data(BlenderRNA *brna) {3, "PIZ", 0, "PIZ (lossless)", ""}, {4, "RLE", 0, "RLE (lossless)", ""}, {0, NULL, 0, NULL, NULL}}; -//#endif +#endif -//#ifdef WITH_OPENJPEG +#ifdef WITH_OPENJPEG static EnumPropertyItem jp2_preset_items[] = { {0, "NO_PRESET", 0, "No Preset", ""}, {1, "R_JPEG2K_CINE_PRESET", 0, "Cinema 24fps 2048x1080", ""}, @@ -387,20 +685,24 @@ void rna_def_scene_render_data(BlenderRNA *brna) {R_JPEG2K_12BIT, "16", 0, "16", ""}, {R_JPEG2K_16BIT, "32", 0, "32", ""}, {0, NULL, 0, NULL, NULL}}; -//#endif +#endif -/* #ifdef WITH_FFMPEG static EnumPropertyItem ffmpeg_format_items[] = { {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""}, {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""}, {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""}, - {FFMPEG_AVI, "AVI", 0, "Avi", ""}, + {FFMPEG_AVI, "AVI", 0, "AVI", ""}, {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""}, {FFMPEG_DV, "DV", 0, "DV", ""}, - {FFMPEG_H264, "H264", 0, "H264", ""}, - {FFMPEG_XVID, "XVID", 0, "XVid", ""}, - {FFMPEG_OGG, "OGG", 0, "OGG", ""}, + {FFMPEG_H264, "H264", 0, "H.264", ""}, + {FFMPEG_XVID, "XVID", 0, "Xvid", ""}, + // XXX broken +#if 0 +#ifdef WITH_OGG + {FFMPEG_OGG, "OGG", 0, "Ogg", ""}, +#endif +#endif {FFMPEG_FLV, "FLASH", 0, "Flash", ""}, {0, NULL, 0, NULL, NULL}}; @@ -410,10 +712,12 @@ void rna_def_scene_render_data(BlenderRNA *brna) {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""}, {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""}, {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""}, - {CODEC_ID_H264, "H264", 0, "H264", ""}, - {CODEC_ID_XVID, "XVID", 0, "XVid", ""}, - {CODEC_ID_THEORA, "THEORA", 0, "OGG Theora", ""}, - {CODEC_ID_FLV1, "FLASH", 0, "FlashVideo1", ""}, + {CODEC_ID_H264, "H264", 0, "H.264", ""}, + {CODEC_ID_XVID, "XVID", 0, "Xvid", ""}, +#ifdef WITH_OGG + {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""}, +#endif + {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem ffmpeg_audio_codec_items[] = { @@ -425,7 +729,6 @@ void rna_def_scene_render_data(BlenderRNA *brna) {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""}, {0, NULL, 0, NULL, NULL}}; #endif -*/ srna= RNA_def_struct(brna, "SceneRenderData", NULL); RNA_def_struct_sdna(srna, "RenderData"); @@ -518,7 +821,7 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "G", "Log conversion gamma"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); -//#ifdef WITH_OPENEXR +#ifdef WITH_OPENEXR /* OpenEXR */ prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE); @@ -541,9 +844,9 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG); RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); -//#endif +#endif -//#ifdef WITH_OPENJPEG +#ifdef WITH_OPENJPEG /* Jpeg 2000 */ prop= RNA_def_property(srna, "jpeg_preset", PROP_ENUM, PROP_NONE); @@ -562,12 +865,11 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC); RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); -//#endif +#endif #ifdef WITH_FFMPEG /* FFMPEG Video*/ - /* prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type"); RNA_def_property_enum_items(prop, ffmpeg_format_items); @@ -579,7 +881,6 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_enum_items(prop, ffmpeg_codec_items); RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - */ prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate"); @@ -630,13 +931,11 @@ void rna_def_scene_render_data(BlenderRNA *brna) /* FFMPEG Audio*/ - /* prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec"); RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items); - RNA_def_property_ui_text(prop, Codec", "FFMpeg codec to use"); + RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - */ prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate"); @@ -765,14 +1064,10 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Edge Color", ""); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "panorama", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", R_PANORAMA); - RNA_def_property_ui_text(prop, "Panorama", "Render the scene with a cylindrical camera for pseudo-fisheye lens effects"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "threads"); RNA_def_property_range(prop, 1, 8); + RNA_def_property_int_funcs(prop, "rna_SceneRenderData_threads_get", NULL, NULL); RNA_def_property_ui_text(prop, "Threads", "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); @@ -806,14 +1101,14 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "No Overwrite", "Skip and don't overwrite existing files while rendering"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "do_composite", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP); - RNA_def_property_ui_text(prop, "Do Composite", "Process the render result through the compositing pipeline"); + RNA_def_property_ui_text(prop, "Compositing", "Process the render result through the compositing pipeline, if a compositing nodes are enabled."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "do_sequence", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ); - RNA_def_property_ui_text(prop, "Do Sequence", "Process the render (and composited) result through the video sequence editor pipeline"); + RNA_def_property_ui_text(prop, "Sequencer", "Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "file_extensions", PROP_BOOLEAN, PROP_NONE); @@ -824,6 +1119,7 @@ void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "imtype"); RNA_def_property_enum_items(prop, image_type_items); + RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_file_format_set", NULL); RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); @@ -834,12 +1130,13 @@ void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "save_buffers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE); - RNA_def_property_ui_text(prop, "Save Buffers","Save tiles for all RenderLayers and SceneNodes to files in the temp directory (saves memory, allows Full Sampling)."); + RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_save_buffers_get", NULL); + RNA_def_property_ui_text(prop, "Save Buffers","Save tiles for all RenderLayers and SceneNodes to files in the temp directory (saves memory, required for Full Sample)."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "full_sample", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE); - RNA_def_property_ui_text(prop, "Full Sample","Save for every anti-aliasing sample the entire RenderLayer results. This solves anti-aliasing issues with compositing"); + RNA_def_property_ui_text(prop, "Full Sample","Save for every anti-aliasing sample the entire RenderLayer results. This solves anti-aliasing issues with compositing."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "backbuf", PROP_BOOLEAN, PROP_NONE); @@ -857,11 +1154,6 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "stamp", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_STAMP_INFO); - RNA_def_property_ui_text(prop, "Stamp", "Embed metadata into the rendered image"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "stamp_time", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME); RNA_def_property_ui_text(prop, "Stamp Time", "Include the current time in image metadata"); @@ -935,6 +1227,21 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "layers", NULL); + RNA_def_property_struct_type(prop, "SceneRenderLayer"); + RNA_def_property_ui_text(prop, "Render Layers", ""); + + prop= RNA_def_property(srna, "single_layer", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER); + RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "active_layer_index", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "actlay"); + RNA_def_property_int_funcs(prop, "rna_SceneRenderData_active_layer_index_get", "rna_SceneRenderData_active_layer_index_set", "rna_SceneRenderData_active_layer_index_range"); + RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); } void RNA_def_scene(BlenderRNA *brna) @@ -1038,6 +1345,7 @@ void RNA_def_scene(BlenderRNA *brna) rna_def_tool_settings(brna); rna_def_scene_render_data(brna); + rna_def_scene_render_layer(brna); } #endif diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index a0185a64659..842adcf8520 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -453,6 +453,7 @@ void RE_SetCamera(Render *re, Object *camera) cam= camera->data; if(cam->type==CAM_ORTHO) re->r.mode |= R_ORTHO; + if(cam->flag & CAM_PANORAMA) re->r.mode |= R_PANORAMA; /* solve this too... all time depending stuff is in convertblender.c? * Need to update the camera early because it's used for projection matrices @@ -601,7 +602,7 @@ void initparts(Render *re) yparts= re->r.yparts; /* mininum part size, but for exr tile saving it was checked already */ - if(!(re->r.scemode & R_EXR_TILE_FILE)) { + if(!(re->r.scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE))) { if(re->r.mode & R_PANORAMA) { if(ceil(re->rectx/(float)xparts) < 8) xparts= 1 + re->rectx/8; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index ec2660566f5..3ef50af53c2 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -36,6 +36,7 @@ #include "DNA_node_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "DNA_sequence_types.h" #include "DNA_userdef_types.h" #include "BKE_utildefines.h" @@ -1092,14 +1093,14 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, int winx, int winy re->ok= 0; } else { -#ifndef WITH_OPENEXR +#ifdef WITH_OPENEXR + if(re->r.scemode & R_FULL_SAMPLE) + re->r.scemode |= R_EXR_TILE_FILE; /* enable automatic */ +#else /* can't do this without openexr support */ - re->r.scemode &= ~R_EXR_TILE_FILE; + re->r.scemode &= ~(R_EXR_TILE_FILE|R_FULL_SAMPLE); #endif - if(!(re->r.scemode & R_EXR_TILE_FILE)) - re->r.scemode &= ~R_FULL_SAMPLE; /* clear, so we can use this flag for test both */ - /* fullsample wants uniform osa levels */ if(source && (re->r.scemode & R_FULL_SAMPLE)) { /* but, if source has no full sample we disable it */ @@ -1499,7 +1500,7 @@ static void threaded_tile_processor(Render *re) else if(re->r.scemode & R_FULL_SAMPLE) re->result= new_full_sample_buffers_exr(re); else - re->result= new_render_result(re, &re->disprect, 0, re->r.scemode & R_EXR_TILE_FILE); + re->result= new_render_result(re, &re->disprect, 0, re->r.scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)); } if(re->result==NULL) @@ -2278,7 +2279,7 @@ static void do_render_all_options(Render *re) /* ensure no images are in memory from previous animated sequences */ BKE_image_all_free_anim_ibufs(re->r.cfra); - if(re->r.scemode & R_DOSEQ) { + if((re->r.scemode & R_DOSEQ) && re->scene->ed && re->scene->ed->seqbase.first) { /* note: do_render_seq() frees rect32 when sequencer returns float images */ if(!re->test_break(re->tbh)) ; //XXX do_render_seq(re->result, re->r.cfra); @@ -2299,7 +2300,7 @@ static void do_render_all_options(Render *re) re->stats_draw(re->sdh, &re->i); /* stamp image info here */ - if((re->r.scemode & R_STAMP_INFO) && (re->r.stamp & R_STAMP_DRAW)) { + if((re->r.stamp & R_STAMP_ALL) && (re->r.stamp & R_STAMP_DRAW)) { renderresult_stampinfo(re->scene); re->display_draw(re->ddh, re->result, NULL); } @@ -2327,13 +2328,13 @@ static int is_rendering_allowed(Render *re) re->error(re->erh, "No border area selected."); return 0; } - if(re->r.scemode & R_EXR_TILE_FILE) { + if(re->r.scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) { re->error(re->erh, "Border render and Buffer-save not supported yet"); return 0; } } - if(re->r.scemode & R_EXR_TILE_FILE) { + if(re->r.scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) { char str[FILE_MAX]; render_unique_exr_name(re, str, 0); -- cgit v1.2.3 From e1e489c13bee8ecd75b290af5d8cb5c3d2ce901c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 13 Jul 2009 19:10:35 +0000 Subject: 2.5: and the B.blend.c to go with the last commit. --- source/blender/editors/datafiles/B.blend.c | 5638 +++++++++++++++------------- 1 file changed, 3019 insertions(+), 2619 deletions(-) (limited to 'source') diff --git a/source/blender/editors/datafiles/B.blend.c b/source/blender/editors/datafiles/B.blend.c index fcdf83e98de..03d1d00cccf 100644 --- a/source/blender/editors/datafiles/B.blend.c +++ b/source/blender/editors/datafiles/B.blend.c @@ -1,631 +1,922 @@ /* DataToC output of file */ -int datatoc_B_blend_size= 93184; +int datatoc_B_blend_size= 106004; char datatoc_B_blend[]= { - - 66, 76, 69, 78, 68, 69, 82, 95, 86, 50, 53, 48, 82, 69, 78, 68, 0, 0, 0, 32,191,255,240,240, 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 1, 0, 0, 0,250, 83, 99,101,110,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 71, 76, 79, 66, 0, 0, 0, 32,191,255,240,232, 0, 0, 0,181, 0, 0, 0, 1, 32, 32, 32, 48, 0, 0, 0, 0, 0,250, 0, 0, - 0, 1, 1, 0, 0,232,214, 96, 1, 7,176, 32, 0, 0, 16, 0, 0, 4, 32,128, 0, 0, 87, 77, 0, 0, 0,124, 0,232,212,240, - 0, 0, 1, 68, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 77, 87,105,110, 77, 97,110, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,213,160, - 0,232,213,160, 0,232,213,160, 0,232,213,160, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,238,152, 96, - 5,210, 11, 64, 68, 65, 84, 65, 0, 0, 0,144, 0,232,213,160, 0, 0, 1, 69, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0,237,219, 32, 0, 0, 0, 1, 0, 0, 0, 0, 0,232,214, 96,115, 99,114,101,101,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 14, 7,108, 4,108, 0, 0, 0, 0, 0, 1, 3,238, - 0, 0, 0, 0, 0, 0, 0, 0, 0,238,151,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,227,142,160, - 0, 0, 0, 0, 0, 0, 0, 0, 6,147, 67,240, 6,160,144,208, 0,238,152,224, 0,238,153,208, 5,209,239,128, 5,210, 15,128, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 78, 0, 0, 0,136, 0,232,214, 96, 0, 0, 0,173, 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 83, 99,114,101,101,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,215, 16, 0,232,218, 80, 0,232,218,144, 0,232,222,208, - 0,232,223, 16, 0,233, 19,208, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7,176, 32, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 8,216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 0,232,215, 16, 0, 0, 0,174, 0, 0, 0, 1, 0,232,215, 80, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 0,232,215, 80, 0, 0, 0,174, 0, 0, 0, 1, - 0,232,215,144, 0,232,215, 16, 0, 0, 0, 0, 0, 0, 4,108, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 0,232,215,144, - 0, 0, 0,174, 0, 0, 0, 1, 0,232,215,208, 0,232,215, 80, 0, 0, 0, 0, 7,108, 4,108, 0, 0, 0, 0, 68, 65, 84, 65, - 0, 0, 0, 20, 0,232,215,208, 0, 0, 0,174, 0, 0, 0, 1, 0,232,216, 16, 0,232,215,144, 0, 0, 0, 0, 7,108, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 0,232,216, 16, 0, 0, 0,174, 0, 0, 0, 1, 0,232,216, 80, 0,232,215,208, - 0, 0, 0, 0, 0, 0, 4, 81, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 0,232,216, 80, 0, 0, 0,174, 0, 0, 0, 1, - 0,232,216,144, 0,232,216, 16, 0, 0, 0, 0, 7,108, 4, 81, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 0,232,216,144, - 0, 0, 0,174, 0, 0, 0, 1, 0,232,216,208, 0,232,216, 80, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 68, 65, 84, 65, - 0, 0, 0, 20, 0,232,216,208, 0, 0, 0,174, 0, 0, 0, 1, 0,232,217, 16, 0,232,216,144, 0, 0, 0, 0, 7,108, 0, 64, - 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 0,232,217, 16, 0, 0, 0,174, 0, 0, 0, 1, 0,232,217, 80, 0,232,216,208, - 0, 0, 0, 0, 5,224, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 0,232,217, 80, 0, 0, 0,174, 0, 0, 0, 1, - 0,232,217,144, 0,232,217, 16, 0, 0, 0, 0, 5,224, 4, 81, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 0,232,217,144, - 0, 0, 0,174, 0, 0, 0, 1, 0,232,217,208, 0,232,217, 80, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 1, 68, 65, 84, 65, - 0, 0, 0, 20, 0,232,217,208, 0, 0, 0,174, 0, 0, 0, 1, 0,232,218, 16, 0,232,217,144, 0, 0, 0, 0, 5,224, 0, 76, - 0, 0, 0, 1, 68, 65, 84, 65, 0, 0, 0, 20, 0,232,218, 16, 0, 0, 0,174, 0, 0, 0, 1, 0,232,218, 80, 0,232,217,208, - 0, 0, 0, 0, 5,224, 3, 76, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 20, 0,232,218, 80, 0, 0, 0,174, 0, 0, 0, 1, - 0, 0, 0, 0, 0,232,218, 16, 0, 0, 0, 0, 7,108, 3, 76, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 0,232,218,144, - 0, 0, 0,175, 0, 0, 0, 1, 0,232,218,208, 0, 0, 0, 0, 0,232,215, 80, 0,232,215,144, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 0, 0, 0, 24, 0,232,218,208, 0, 0, 0,175, 0, 0, 0, 1, 0,232,219, 16, 0,232,218,144, 0,232,215, 80, - 0,232,216, 16, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 0,232,219, 16, 0, 0, 0,175, 0, 0, 0, 1, - 0,232,219, 80, 0,232,218,208, 0,232,215,144, 0,232,216, 80, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, - 0,232,219, 80, 0, 0, 0,175, 0, 0, 0, 1, 0,232,219,144, 0,232,219, 16, 0,232,216, 16, 0,232,216, 80, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 0,232,219,144, 0, 0, 0,175, 0, 0, 0, 1, 0,232,219,208, 0,232,219, 80, - 0,232,215, 16, 0,232,217, 16, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 0,232,219,208, 0, 0, 0,175, - 0, 0, 0, 1, 0,232,220, 16, 0,232,219,144, 0,232,215,208, 0,232,217, 16, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 0, 0, 0, 24, 0,232,220, 16, 0, 0, 0,175, 0, 0, 0, 1, 0,232,220, 80, 0,232,219,208, 0,232,216, 16, 0,232,217, 80, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 0,232,220, 80, 0, 0, 0,175, 0, 0, 0, 1, 0,232,220,144, - 0,232,220, 16, 0,232,216, 80, 0,232,217, 80, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 0,232,220,144, - 0, 0, 0,175, 0, 0, 0, 1, 0,232,220,208, 0,232,220, 80, 0,232,215, 16, 0,232,217,144, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 0, 0, 0, 24, 0,232,220,208, 0, 0, 0,175, 0, 0, 0, 1, 0,232,221, 16, 0,232,220,144, 0,232,216, 16, - 0,232,217,144, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 0,232,221, 16, 0, 0, 0,175, 0, 0, 0, 1, - 0,232,221, 80, 0,232,220,208, 0,232,217, 80, 0,232,217,208, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, - 0,232,221, 80, 0, 0, 0,175, 0, 0, 0, 1, 0,232,221,144, 0,232,221, 16, 0,232,217, 16, 0,232,217,208, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 0,232,221,144, 0, 0, 0,175, 0, 0, 0, 1, 0,232,221,208, 0,232,221, 80, - 0,232,217,144, 0,232,217,208, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 0,232,221,208, 0, 0, 0,175, - 0, 0, 0, 1, 0,232,222, 16, 0,232,221,144, 0,232,217, 16, 0,232,218, 16, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 0, 0, 0, 24, 0,232,222, 16, 0, 0, 0,175, 0, 0, 0, 1, 0,232,222, 80, 0,232,221,208, 0,232,217, 80, 0,232,218, 16, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 0,232,222, 80, 0, 0, 0,175, 0, 0, 0, 1, 0,232,222,144, - 0,232,222, 16, 0,232,216, 80, 0,232,218, 80, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 0,232,222,144, - 0, 0, 0,175, 0, 0, 0, 1, 0,232,222,208, 0,232,222, 80, 0,232,215,208, 0,232,218, 80, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 0, 0, 0, 24, 0,232,222,208, 0, 0, 0,175, 0, 0, 0, 1, 0, 0, 0, 0, 0,232,222,144, 0,232,218, 16, - 0,232,218, 80, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,112, 0,232,223, 16, 0, 0, 0,179, 0, 0, 0, 1, - 0,232,225,240, 0, 0, 0, 0, 0,232,216, 16, 0,232,215, 80, 0,232,215,144, 0,232,216, 80, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 7,108, 0, 0, 4, 82, 0, 0, 4,108, 7, 7, 7,109, 0, 27, 0, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229, 69,160, 0,233, 31,144, 0,233, 31,144, 0,232,223,176, 0,232,224,208, - 0, 0, 0, 0, 0, 0, 0, 0, 5,216,137, 0, 5,209,241, 64, 68, 65, 84, 65, 0, 0, 0,236, 0,232,223,176, 0, 0, 0,180, - 0, 0, 0, 1, 0,232,224,208, 0, 0, 0, 0, 0, 0, 0, 0, 68, 68,192, 0, 0, 0, 0, 0, 65,208, 0, 0, 0, 0, 0, 0, - 68,237,160, 0, 0, 0, 0, 0, 65,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,108, 0, 0, 0, 0, 0, 0, 0, 25, 68,237,128, 0, - 65,200, 0, 0, 68,237,128, 0, 65,200, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 0, 4, 4, 12, - 0, 10, 7,109, 0, 26, 7,109, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,108, 0, 0, 4, 82, - 0, 0, 4,107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,109, 0, 26, 0, 2, 0, 1, 0, 2, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229, 70,192, 6,144,192,176, 6,144,192,176, 0, 0, 0, 0, 0, 0, 0, 0, - 5,209,243, 64, 5,209,243,176, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,236, 0,232,224,208, 0, 0, 0,180, - 0, 0, 0, 1, 0, 0, 0, 0, 0,232,223,176, 0, 0, 0, 0, 68,158, 64, 0, 0, 0, 0, 0, 65, 16, 0, 0, 0, 0, 0, 0, - 69, 21,180, 43, 63,184, 81,222, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,108, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 35,215, 10, 68,122, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 4, 0, - 0, 10, 7,109, 0, 6, 7,109, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,108, - 0, 0, 4,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, - 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,229, 70, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,112, 0,232,225,240, 0, 0, 0,179, - 0, 0, 0, 1, 0,233, 2, 0, 0,232,223, 16, 0,232,217, 16, 0,232,218, 16, 0,232,218, 80, 0,232,215,208, 0, 0, 0, 0, - 0, 0, 5,225, 0, 0, 7,108, 0, 0, 0, 0, 0, 0, 3, 75, 4, 4, 1,140, 3, 76, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229, 67, 96, 0,232,253,144, 0,233, 0,224, 0,232,226,144, - 0,232,227,176, 0, 0, 0, 0, 0, 0, 0, 0, 5,209,244, 32, 5,209,244,224, 68, 65, 84, 65, 0, 0, 0,236, 0,232,226,144, - 0, 0, 0,180, 0, 0, 0, 1, 0,232,227,176, 0, 0, 0, 0, 0, 0, 0, 0, 67,240, 0, 0, 0, 0, 0, 0, 65,208, 0, 0, - 0, 0, 0, 0, 67,198, 0, 0, 0, 0, 0, 0, 65,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,139, 0, 0, 0, 0, 0, 0, 0, 25, - 67,137,128, 0, 65,200, 0, 0, 67,137,128, 0, 65,200, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, - 0, 4, 4, 12, 0, 10, 1,140, 0, 26, 1,140, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,225, 0, 0, 7,108, - 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,140, 0, 26, 0, 3, 0, 1, - 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229, 68,128, 6,157, 67,144, 6,157, 67,144, 0, 0, 0, 0, - 0, 0, 0, 0, 5,209,246,144, 5,209,247,112, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,236, 0,232,227,176, - 0, 0, 0,180, 0, 0, 0, 1, 0, 0, 0, 0, 0,232,226,144, 0, 0, 0, 0, 67,163,128, 0,196,133,192, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 67,163,134,146,196, 41,151, 74,192, 50,112,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,139, 0, 0, 0, 0, 0, 0, 3, 49, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, - 0, 2, 4, 0, 0, 6, 1,140, 3, 50, 1,140, 3, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,225, 0, 0, 7,108, - 0, 0, 0, 26, 0, 0, 3, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,140, 3, 50, 0, 4, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229, 67,240, 6,160,103, 16, 6,160,111,112, 0,232,228,208, - 0,232,252,112, 5,209,249, 48, 5,209,251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,232,228,208, - 0, 0, 0,176, 0, 0, 0, 1, 0,232,229,240, 0, 0, 0, 0, 5,213,216,128, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, + 66, 76, 69, 78, 68, 69, 82, 45,118, 50, 53, 48, 82, 69, 78, 68, 32, 0, 0, 0, +128, 13,156,230,255,127, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0, 83, 99,101,110,101, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 76, 79, 66, 40, 0, 0, 0,112, 13,156,230,255,127, 0, 0, +184, 0, 0, 0, 1, 0, 0, 0, 32, 32, 32, 48, 0, 0, 0, 0,250, 0, 0, 0, 1, 0, 0, 1, 48, 3,160, 2, 0, 0, 0, 0, + 32,116,160, 2, 0, 0, 0, 0, 0, 16, 0, 0,128, 32, 4, 0, 87, 77, 0, 0,208, 0, 0, 0, 0, 1,160, 2, 0, 0, 0, 0, + 72, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 87, 77, 87,105,110, 77, 97,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 2,160, 2, 0, 0, 0, 0, 16, 2,160, 2, 0, 0, 0, 0, + 16, 2,160, 2, 0, 0, 0, 0, 16, 2,160, 2, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 64,203,233, 2, 0, 0, 0, 0, +224,220,232, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 80,142,166, 2, 0, 0, 0, 0,224, 48,170, 2, 0, 0, 0, 0, 68, 65, 84, 65,224, 0, 0, 0, + 16, 2,160, 2, 0, 0, 0, 0, 73, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +240,218,132, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 48, 3,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +115, 99,114,101,101,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 30, 0,118, 7, 97, 4, 0, 0, 0, 0, 1, 0,238, 3, 0, 0, 1, 0, 0, 0, 0, 0,192,141,166, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,246,196, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,206,238, 2, 0, 0, 0, 0, 16,206,238, 2, 0, 0, 0, 0, + 0,143,166, 2, 0, 0, 0, 0,112,144,166, 2, 0, 0, 0, 0,160,239,169, 2, 0, 0, 0, 0,192, 54,170, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 78, 0, 0,208, 0, 0, 0, 48, 3,160, 2, 0, 0, 0, 0, +176, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 83, 99,114,101,101,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 4,160, 2, 0, 0, 0, 0, 32, 9,160, 2, 0, 0, 0, 0, +128, 9,160, 2, 0, 0, 0, 0,240, 16,160, 2, 0, 0, 0, 0, 96, 17,160, 2, 0, 0, 0, 0,160, 97,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,116,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +236,101,152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, + 64, 4,160, 2, 0, 0, 0, 0,177, 0, 0, 0, 1, 0, 0, 0,160, 4,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,160, 4,160, 2, 0, 0, 0, 0, +177, 0, 0, 0, 1, 0, 0, 0, 0, 5,160, 2, 0, 0, 0, 0, 64, 4,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 97, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 0, 5,160, 2, 0, 0, 0, 0,177, 0, 0, 0, 1, 0, 0, 0, + 96, 5,160, 2, 0, 0, 0, 0,160, 4,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,118, 7, 97, 4, 0, 0, 0, 0, + 68, 65, 84, 65, 32, 0, 0, 0, 96, 5,160, 2, 0, 0, 0, 0,177, 0, 0, 0, 1, 0, 0, 0,192, 5,160, 2, 0, 0, 0, 0, + 0, 5,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,118, 7, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, +192, 5,160, 2, 0, 0, 0, 0,177, 0, 0, 0, 1, 0, 0, 0, 32, 6,160, 2, 0, 0, 0, 0, 96, 5,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 4, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 32, 6,160, 2, 0, 0, 0, 0, +177, 0, 0, 0, 1, 0, 0, 0,128, 6,160, 2, 0, 0, 0, 0,192, 5,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +118, 7, 70, 4, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,128, 6,160, 2, 0, 0, 0, 0,177, 0, 0, 0, 1, 0, 0, 0, +224, 6,160, 2, 0, 0, 0, 0, 32, 6,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 32, 0, 0, 0,224, 6,160, 2, 0, 0, 0, 0,177, 0, 0, 0, 1, 0, 0, 0, 64, 7,160, 2, 0, 0, 0, 0, +128, 6,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,118, 7, 64, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, + 64, 7,160, 2, 0, 0, 0, 0,177, 0, 0, 0, 1, 0, 0, 0,160, 7,160, 2, 0, 0, 0, 0,224, 6,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,232, 5, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,160, 7,160, 2, 0, 0, 0, 0, +177, 0, 0, 0, 1, 0, 0, 0, 0, 8,160, 2, 0, 0, 0, 0, 64, 7,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +232, 5, 70, 4, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 0, 8,160, 2, 0, 0, 0, 0,177, 0, 0, 0, 1, 0, 0, 0, + 96, 8,160, 2, 0, 0, 0, 0,160, 7,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 32, 0, 0, 0, 96, 8,160, 2, 0, 0, 0, 0,177, 0, 0, 0, 1, 0, 0, 0,192, 8,160, 2, 0, 0, 0, 0, + 0, 8,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 5, 80, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, +192, 8,160, 2, 0, 0, 0, 0,177, 0, 0, 0, 1, 0, 0, 0, 32, 9,160, 2, 0, 0, 0, 0, 96, 8,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,232, 5, 72, 3, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 32, 9,160, 2, 0, 0, 0, 0, +177, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 8,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +118, 7, 72, 3, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,128, 9,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, +240, 9,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 4,160, 2, 0, 0, 0, 0, 0, 5,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,240, 9,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, + 96, 10,160, 2, 0, 0, 0, 0,128, 9,160, 2, 0, 0, 0, 0,160, 4,160, 2, 0, 0, 0, 0,192, 5,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 96, 10,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, +208, 10,160, 2, 0, 0, 0, 0,240, 9,160, 2, 0, 0, 0, 0, 0, 5,160, 2, 0, 0, 0, 0, 32, 6,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,208, 10,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, + 64, 11,160, 2, 0, 0, 0, 0, 96, 10,160, 2, 0, 0, 0, 0,192, 5,160, 2, 0, 0, 0, 0, 32, 6,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 64, 11,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, +176, 11,160, 2, 0, 0, 0, 0,208, 10,160, 2, 0, 0, 0, 0, 64, 4,160, 2, 0, 0, 0, 0, 64, 7,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,176, 11,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, + 32, 12,160, 2, 0, 0, 0, 0, 64, 11,160, 2, 0, 0, 0, 0, 96, 5,160, 2, 0, 0, 0, 0, 64, 7,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 32, 12,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, +144, 12,160, 2, 0, 0, 0, 0,176, 11,160, 2, 0, 0, 0, 0,192, 5,160, 2, 0, 0, 0, 0,160, 7,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,144, 12,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, + 0, 13,160, 2, 0, 0, 0, 0, 32, 12,160, 2, 0, 0, 0, 0, 32, 6,160, 2, 0, 0, 0, 0,160, 7,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 0, 13,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, +112, 13,160, 2, 0, 0, 0, 0,144, 12,160, 2, 0, 0, 0, 0, 64, 4,160, 2, 0, 0, 0, 0, 0, 8,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,112, 13,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, +224, 13,160, 2, 0, 0, 0, 0, 0, 13,160, 2, 0, 0, 0, 0,192, 5,160, 2, 0, 0, 0, 0, 0, 8,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,224, 13,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, + 80, 14,160, 2, 0, 0, 0, 0,112, 13,160, 2, 0, 0, 0, 0,160, 7,160, 2, 0, 0, 0, 0, 96, 8,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 80, 14,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, +192, 14,160, 2, 0, 0, 0, 0,224, 13,160, 2, 0, 0, 0, 0, 64, 7,160, 2, 0, 0, 0, 0, 96, 8,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,192, 14,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, + 48, 15,160, 2, 0, 0, 0, 0, 80, 14,160, 2, 0, 0, 0, 0, 0, 8,160, 2, 0, 0, 0, 0, 96, 8,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 48, 15,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, +160, 15,160, 2, 0, 0, 0, 0,192, 14,160, 2, 0, 0, 0, 0, 64, 7,160, 2, 0, 0, 0, 0,192, 8,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,160, 15,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, + 16, 16,160, 2, 0, 0, 0, 0, 48, 15,160, 2, 0, 0, 0, 0,160, 7,160, 2, 0, 0, 0, 0,192, 8,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 16, 16,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, +128, 16,160, 2, 0, 0, 0, 0,160, 15,160, 2, 0, 0, 0, 0, 32, 6,160, 2, 0, 0, 0, 0, 32, 9,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,128, 16,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, +240, 16,160, 2, 0, 0, 0, 0, 16, 16,160, 2, 0, 0, 0, 0, 96, 5,160, 2, 0, 0, 0, 0, 32, 9,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,240, 16,160, 2, 0, 0, 0, 0,178, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,128, 16,160, 2, 0, 0, 0, 0,192, 8,160, 2, 0, 0, 0, 0, 32, 9,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,184, 0, 0, 0, 96, 17,160, 2, 0, 0, 0, 0,182, 0, 0, 0, 1, 0, 0, 0, + 32, 21,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 5,160, 2, 0, 0, 0, 0,160, 4,160, 2, 0, 0, 0, 0, + 0, 5,160, 2, 0, 0, 0, 0, 32, 6,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,118, 7, 0, 0, + 71, 4, 0, 0, 97, 4, 0, 0, 7, 7,119, 7, 27, 0, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,189,147, 2, 0, 0, 0, 0,144,115,160, 2, 0, 0, 0, 0, +144,115,160, 2, 0, 0, 0, 0, 96, 18,160, 2, 0, 0, 0, 0,192, 19,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,208,170,170, 2, 0, 0, 0, 0, 96, 66,189, 2, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0, + 96, 18,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0,192, 19,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 64,103, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0,224,238, 68, 0, 0, 0, 0, 0, 0,208, 65, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,118, 7, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,237, 68, 0, 0,200, 65, 0,128,237, 68, 0, 0,200, 65, + 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 4, 10, 0,119, 7, 26, 0,119, 7, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,118, 7, 0, 0, 71, 4, 0, 0, 96, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,119, 7, 26, 0, 2, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16,191,147, 2, 0, 0, 0, 0,208, 35,170, 2, 0, 0, 0, 0,208, 35,170, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,224,173,188, 2, 0, 0, 0, 0,128, 11,170, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0,192, 19,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 96, 18,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,158, 68, 0, 0, 0, 0, 0, 0, 16, 65, + 0, 0, 0, 0, 12,235,226, 69,222, 81,184, 63, 0, 0, 16, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 7, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,122, 68, 0, 0, 0, 0, 1, 0, 3, 0, + 0, 0, 0, 4, 10, 0,129, 7, 2, 0,129, 7, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 97, 4, 0, 0, 97, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 32,190,147, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176, 13,170, 2, 0, 0, 0, 0, + 32, 15,170, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,184, 0, 0, 0, + 32, 21,160, 2, 0, 0, 0, 0,182, 0, 0, 0, 1, 0, 0, 0,240, 67,160, 2, 0, 0, 0, 0, 96, 17,160, 2, 0, 0, 0, 0, + 64, 7,160, 2, 0, 0, 0, 0,192, 8,160, 2, 0, 0, 0, 0, 32, 9,160, 2, 0, 0, 0, 0, 96, 5,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,233, 5, 0, 0,118, 7, 0, 0, 0, 0, 0, 0, 71, 3, 0, 0, 4, 4,142, 1, 72, 3, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 96,185,147, 2, 0, 0, 0, 0, 64, 59,160, 2, 0, 0, 0, 0,144, 66,160, 2, 0, 0, 0, 0, 32, 22,160, 2, 0, 0, 0, 0, +128, 23,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 71,189, 2, 0, 0, 0, 0, +128, 82,189, 2, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0, 32, 22,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0, +128, 23,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,250, 67, 0, 0, 0, 0, 0, 0,208, 65, + 0, 0, 0, 0, 0, 0,199, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,141, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, + 0,128,137, 67, 0, 0,200, 65, 0,128,137, 67, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, + 4, 0, 12, 4, 10, 0,142, 1, 26, 0,142, 1, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 5, 0, 0,118, 7, 0, 0, + 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 1, 26, 0, 4, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,188,147, 2, 0, 0, 0, 0,128,218,232, 2, 0, 0, 0, 0, +128,218,232, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,189,195, 2, 0, 0, 0, 0, + 80, 20,170, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0, +128, 23,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 22,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0,128,163, 67, 0, 0,111,196, 0, 0, 0, 0, 0, 0, 0, 0,146,134,163, 67, 54, 57, 39,196, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,141, 1, 0, 0, 0, 0, 0, 0, 45, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, 0, 64, 0, 0, 0, 0, 1, 0, 3, 0, 2, 0, 0, 4, 6, 0,142, 1, 46, 3,142, 1, 46, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,233, 5, 0, 0,118, 7, 0, 0, 26, 0, 0, 0, 71, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,142, 1, 46, 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 80,186,147, 2, 0, 0, 0, 0, 48,200,238, 2, 0, 0, 0, 0, 32,157,232, 2, 0, 0, 0, 0,224, 24,160, 2, 0, 0, 0, 0, + 48,248,232, 2, 0, 0, 0, 0,112,129,194, 2, 0, 0, 0, 0,112, 25,170, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0,224, 24,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, +112, 26,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 56,255, 71, 1,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0,112, 26,160, 2, 0, 0, 0, 0, +179, 0, 0, 0, 1, 0, 0, 0, 0, 28,160, 2, 0, 0, 0, 0,224, 24,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68,105,109,101,110,115,105,111,110,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68,105,109,101,110,115,105,111,110,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,254, 71, 1,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, + 0, 28,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0,144, 29,160, 2, 0, 0, 0, 0,112, 26,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65,110,116,105, 45, 65,108,105, 97,115,105,110,103, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65,110,116,105, 45, 65,108,105, 97,115,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,253, 71, 1, 80, 0, 20, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 56, 1, 71, 0,176, - 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, - 0,232,229,240, 0, 0, 0,176, 0, 0, 0, 1, 0,232,231, 16, 0,232,228,208, 5,213,218, 16, 0, 0, 0, 0, 68,105,109,101, -110,115,105,111,110,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,105,109,101, -110,115,105,111,110,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 80, 1, 0, 0,144, 29,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, 32, 31,160, 2, 0, 0, 0, 0, + 0, 28,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,104, 97,100,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254, 88, - 1, 71, 0,200, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 0, 0, 0,240, 0,232,231, 16, 0, 0, 0,176, 0, 0, 0, 1, 0,232,232, 48, 0,232,229,240, 5,213,219,160, 0, 0, 0, 0, - 65,110,116,105, 45, 65,108,105, 97,115,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,104, 97,100,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 65,110,116,105, 45, 65,108,105, 97,115,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,253, 71, 1, 80, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,253,240, 1, 71, 0, 80, 0, 20, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 0, 0, 0,240, 0,232,232, 48, 0, 0, 0,176, 0, 0, 0, 1, 0,232,233, 80, 0,232,231, 16, 5,213,222,176, - 0, 0, 0, 0, 83,104, 97,100,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 83,104, 97,100,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, 32, 31,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, +176, 32,160, 2, 0, 0, 0, 0,144, 29,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,253,136, 1, 71, 0, 80, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,232,233, 80, 0, 0, 0,176, 0, 0, 0, 1, 0,232,234,112, 0,232,232, 48, - 5,213,224, 64, 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,194,252, 71, 1,174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0,176, 32,160, 2, 0, 0, 0, 0, +179, 0, 0, 0, 1, 0, 0, 0, 64, 34,160, 2, 0, 0, 0, 0, 32, 31,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 83,116, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,252,194, 1, 71, 0,174, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 20, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,232,234,112, 0, 0, 0,176, 0, 0, 0, 1, 0,232,235,144, - 0,232,233, 80, 5,213,225,208, 0, 0, 0, 0, 83,116, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 83,116, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,116, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,214,251, 71, 1,212, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,251,214, 1, 71, 0,212, 0, 20, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, - 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,232,235,144, 0, 0, 0,176, 0, 0, 0, 1, - 0,232,236,176, 0,232,234,112, 0, 0, 0, 0, 0, 0, 0, 0, 76,101,110,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, + 64, 34,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0,208, 35,160, 2, 0, 0, 0, 0,176, 32,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76,101,110,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76,101,110,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81,255, 74, 1,151, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 80, 1, 0, 0,208, 35,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, 96, 37,160, 2, 0, 0, 0, 0, + 64, 34,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,105,115,112,108, 97,121, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,105,115,112,108, 97,121, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,141,254, 74, 1,107, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 81, 1, 74, 0,151, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,232,236,176, 0, 0, 0,176, - 0, 0, 0, 1, 0,232,237,208, 0,232,235,144, 0, 0, 0, 0, 0, 0, 0, 0, 68,105,115,112,108, 97,121, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, 96, 37,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, +240, 38,160, 2, 0, 0, 0, 0,208, 35,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,105,115,112,108, 97,121, 0, 0, 0, 0, 0, + 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254,141, 1, 74, 0,107, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,232,237,208, - 0, 0, 0,176, 0, 0, 0, 1, 0,232,238,240, 0,232,236,176, 0, 0, 0, 0, 0, 0, 0, 0, 80,114,101,118,105,101,119, 0, + 0, 0, 96,255, 74, 1,136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0,240, 38,160, 2, 0, 0, 0, 0, +179, 0, 0, 0, 1, 0, 0, 0,128, 40,160, 2, 0, 0, 0, 0, 96, 37,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 96, 1, 74, 0,136, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, - 0,232,238,240, 0, 0, 0,176, 0, 0, 0, 1, 0,232,240, 16, 0,232,237,208, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108, -100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108, -100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254,247, - 1, 74, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 0, 0, 0,240, 0,232,240, 16, 0, 0, 0,176, 0, 0, 0, 1, 0,232,241, 48, 0,232,238,240, 0, 0, 0, 0, 0, 0, 0, 0, - 65,109, 98,105,101,110,116, 32, 79, 99, 99,108,117,115,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,247,254, 74, 1, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 65,109, 98,105,101,110,116, 32, 79, 99, 99,108,117,115,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, +128, 40,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, 16, 42,160, 2, 0, 0, 0, 0,240, 38,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65,109, 98,105,101,110,116, 32, 79, 99, 99,108,117,115,105,111, +110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65,109, 98,105,101,110,116, 32, 79, 99, 99,108,117,115,105,111, +110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,254, 43, 1, 74, 0,180, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 0, 0, 0,240, 0,232,241, 48, 0, 0, 0,176, 0, 0, 0, 1, 0,232,242, 80, 0,232,240, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 77,105,115,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43,254, 74, 1,180, 0, 20, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77,105,115,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 80, 1, 0, 0, 16, 42,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0,160, 43,160, 2, 0, 0, 0, 0, +128, 40,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77,105,115,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77,105,115,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,253,168, 1, 74, 0,107, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,232,242, 80, 0, 0, 0,176, 0, 0, 0, 1, 0,232,243,112, 0,232,241, 48, - 0, 0, 0, 0, 0, 0, 0, 0, 83,116, 97,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 83,116, 97,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168,253, 74, 1,107, 0, + 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 84, 1, 74, 0, 60, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,232,243,112, 0, 0, 0,176, 0, 0, 0, 1, 0,232,244,144, - 0,232,242, 80, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108,111,114, 32, 67,111,114,114,101, 99,116,105,111,110, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0,160, 43,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, + 48, 45,160, 2, 0, 0, 0, 0, 16, 42,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 83,116, 97,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108,111,114, 32, 67,111,114,114,101, 99,116,105,111,110, 0, 0, 0, 0, + 83,116, 97,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 24, 1, 74, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,232,244,144, 0, 0, 0,176, 0, 0, 0, 1, - 0,232,245,176, 0,232,243,112, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 84,253, 74, 1, 60, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, 48, 45,160, 2, 0, 0, 0, 0, +179, 0, 0, 0, 1, 0, 0, 0,192, 46,160, 2, 0, 0, 0, 0,160, 43,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108,111,114, 32, 67,111,114,114,101, 99,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108,111,114, 32, 67,111,114,114,101, 99,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,253, 74, 1, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, +192, 46,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, 80, 48,160, 2, 0, 0, 0, 0, 48, 45,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,255, 74, 1,149, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 80, 1, 0, 0, 80, 48,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0,224, 49,160, 2, 0, 0, 0, 0, +192, 46,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,104, 97,100,111,119, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,104, 97,100,111,119, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136,254, 74, 1,179, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0,224, 49,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, +112, 51,160, 2, 0, 0, 0, 0, 80, 48,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 83,117,114,102, 97, 99,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 83,117,114,102, 97, 99,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 83, 1, 74, 0,149, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,232,245,176, 0, 0, 0,176, - 0, 0, 0, 1, 0,232,246,208, 0,232,244,144, 0, 0, 0, 0, 0, 0, 0, 0, 83,104, 97,100,111,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,104, 97,100,111,119, 0, 0, 0, 0, 0, 0, + 0, 0,149,255, 74, 1, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0,112, 51,160, 2, 0, 0, 0, 0, +179, 0, 0, 0, 1, 0, 0, 0, 0, 53,160, 2, 0, 0, 0, 0,224, 49,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 67,111,110,115,116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254,136, 1, 74, 0,179, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,232,246,208, - 0, 0, 0,176, 0, 0, 0, 1, 0,232,247,240, 0,232,245,176, 0, 0, 0, 0, 0, 0, 0, 0, 83,117,114,102, 97, 99,101, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 67,111,110,115,116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,117,114,102, 97, 99,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,196,255, 74, 1, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,149, 1, 74, 0, 83, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, - 0,232,247,240, 0, 0, 0,176, 0, 0, 0, 1, 0,232,249, 16, 0,232,246,208, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,110,115, -116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,110,115, -116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, + 0, 53,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0,144, 54,160, 2, 0, 0, 0, 0,112, 51,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,196, - 1, 74, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 0, 0, 0,240, 0,232,249, 16, 0, 0, 0,176, 0, 0, 0, 1, 0,232,250, 48, 0,232,247,240, 0, 0, 0, 0, 0, 0, 0, 0, - 84,114, 97,110,115,102,111,114,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 84,114, 97,110,115,102,111,114,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76,255, 74, 1, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,255, 76, 1, 74, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 0, 0, 0,240, 0,232,250, 48, 0, 0, 0,176, 0, 0, 0, 1, 0,232,251, 80, 0,232,249, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 71,114,111,117,112,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 71,114,111,117,112,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 80, 1, 0, 0,144, 54,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, 32, 56,160, 2, 0, 0, 0, 0, + 0, 53,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71,114,111,117,112,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71,114,111,117,112,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,255, 16, 1, 74, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,232,251, 80, 0, 0, 0,176, 0, 0, 0, 1, 0,232,252,112, 0,232,250, 48, - 0, 0, 0, 0, 0, 0, 0, 0, 68,117,112,108,105, 99, 97,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68,117,112,108,105, 99, 97,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,255, 74, 1, 36, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, 32, 56,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, +176, 57,160, 2, 0, 0, 0, 0,144, 54,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68,117,112,108,105, 99, 97,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254, 81, 1, 74, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,232,252,112, 0, 0, 0,176, 0, 0, 0, 1, 0, 0, 0, 0, - 0,232,251, 80, 0, 0, 0, 0, 0, 0, 0, 0, 65,110,105,109, 97,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68,117,112,108,105, 99, 97,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65,110,105,109, 97,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 81,254, 74, 1, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253,167, 1, 74, 0,146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,224, 0,232,253,144, 0, 0, 0,151, 0, 0, 0, 1, - 0,233, 0,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0,176, 57,160, 2, 0, 0, 0, 0, +179, 0, 0, 0, 1, 0, 0, 0,176, 77,231, 2, 0, 0, 0, 0, 32, 56,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 65,110,105,109, 97,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 65,110,105,109, 97,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 0, 0, 0,236, 0,232,254,160, 0, 0, 0,180, 0, 0, 0, 1, 0,232,255,192, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 69, 0, 0, 0, 0, 0, 0, 65,208, 0, 0, 0, 0, 0, 0, 67,138, 0, 0, 0, 0, 0, 0, 65,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 19, 0, 0, 0, 0, 0, 0, 0, 25, 68,237,128, 0, 65,200, 0, 0, 68,237,128, 0, 65,200, 0, 0, 63,128, 0, 0, - 63,128, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 0, 4, 4, 12, 0, 10, 1, 20, 0, 26, 1, 20, 0, 26, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 6, 89, 0, 0, 7,108, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 20, 0, 26, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,167,253, 74, 1,146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 0, 0, 0,236, 0,232,255,192, 0, 0, 0,180, 0, 0, 0, 1, 0, 0, 0, 0, 0,232,254,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, +176, 77,231, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0,208, 74,231, 2, 0, 0, 0, 0,176, 57,160, 2, 0, 0, 0, 0, + 64,187,147, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 85, 84, 84, 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101, +120,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 85, 84, 84, 79, 78, 83, 95, 80, 84, 95, 99,111,110,116,101, +120,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,110,116,101,120,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,220,255, 71, 1, 36, 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 6, 89, 0, 0, 7,108, 0, 0, 0, 26, 0, 0, 4, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 20, 4, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7,160, 32, - 68, 65, 84, 65, 0, 0, 2,152, 1, 7,160, 32, 0, 0, 0,145, 0, 0, 0, 1, 64,136,212,103, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63,140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,128, 1, 80, -191,128, 0, 0,128, 0, 0, 0,128, 0, 0, 0,188,163,215,226,128, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 32, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 32, 0, 0, 63,128, 0, 0, 64,136,212,103, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63,140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,128, 1, 80, -191,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 31,175,184, 65, 32, 0, 0, 62,111,122,237, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63,106, 14,161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,195,249,252,209, -194, 71,253,115, 0, 0, 0, 0, 0, 0, 0, 0, 67,249,127, 98, 66, 71,255,129, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 32, 0, 0, 63,128, 0, 0, 64,136,212,103, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63,140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,128, 1, 80, -191,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 31,175,184, 65, 32, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 65, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58,222, 32,100, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 80, 1, 0, 0,208, 74,231, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0,176,232,233, 2, 0, 0, 0, 0, +176, 77,231, 2, 0, 0, 0, 0,144,244,210, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, + 84, 95,114,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, + 84, 95,114,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,135,255, 71, 1, 61, 0, + 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0,176,232,233, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, + 32,112,232, 2, 0, 0, 0, 0,208, 74,231, 2, 0, 0, 0, 0,144,246,210, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,105,111,110,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,100,105,109,101,110,115,105,111,110,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68,105,109,101,110,115,105,111,110,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,189,254, 71, 1,178, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, 32,112,232, 2, 0, 0, 0, 0, +179, 0, 0, 0, 1, 0, 0, 0,144,155,232, 2, 0, 0, 0, 0,176,232,233, 2, 0, 0, 0, 0,144,248,210, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95, 97,110,116,105, 97,108,105, 97,115,105,110,103, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 65,110,116,105, 45, 65,108,105, 97,115,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,254, 71, 1, 58, 0, 24, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, +144,155,232, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, 32,159,232, 2, 0, 0, 0, 0, 32,112,232, 2, 0, 0, 0, 0, +160,253,210, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,108, 97,121,101,114,115, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,121,101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,254, 71, 1, 0, 0, 0, 0, 0, 0, 4, 0, 6, 0, + 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 80, 1, 0, 0, 32,159,232, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0,192,195,232, 2, 0, 0, 0, 0, +144,155,232, 2, 0, 0, 0, 0,176, 2,211, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, + 84, 95,115,104, 97,100,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, + 84, 95,115,104, 97,100,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,104, 97,100,105,110,103, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,235,253, 71, 1, 80, 0, + 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0,192,195,232, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, + 80,199,232, 2, 0, 0, 0, 0, 32,159,232, 2, 0, 0, 0, 0,176, 4,211, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,111,115,116, 95,112,114,111, 99,101,115,115,105,110,103, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 80,111,115,116, 32, 80,114,111, 99,101,115,115,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,128,253, 71, 1, 83, 0, 0, 0, 0, 0, 4, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, 80,199,232, 2, 0, 0, 0, 0, +179, 0, 0, 0, 1, 0, 0, 0,224,202,232, 2, 0, 0, 0, 0,192,195,232, 2, 0, 0, 0, 0,192, 9,211, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,109, 97,110, 99,101, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,112,101,114,102,111,114,109, 97,110, 99,101, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 80,101,114,102,111,114,109, 97,110, 99,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,253, 71, 1,123, 0, 0, 0, 0, 0, 4, 0, 6, 0, 0, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, +224,202,232, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, 48,248,232, 2, 0, 0, 0, 0, 80,199,232, 2, 0, 0, 0, 0, +208, 14,211, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, 84, 95,111,117,116,112,117,116, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55,253, 71, 1,108, 0, 0, 0, 0, 0, 0, 0, 6, 0, + 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 80, 1, 0, 0, 48,248,232, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +224,202,232, 2, 0, 0, 0, 0,208, 18,211, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, + 84, 95,115,116, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 69, 78, 68, 69, 82, 95, 80, + 84, 95,115,116, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,116, 97,109,112, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,252, 71, 1,215, 0, + 24, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0, 64, 59,160, 2, 0, 0, 0, 0,151, 0, 0, 0, 1, 0, 0, 0, +144, 66,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,233, 0,224, 0, 0, 0,146, 0, 0, 0, 1, - 0, 0, 0, 0, 0,232,253,144, 0,232,254,160, 0,232,255,192, 0, 0, 0, 1, 63, 51, 51, 51, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 32, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 1, 0, 7, 1, 7,188, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, - 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 66, 12, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, - 60, 35,215, 10, 67,250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 16, 0, 0, 0, 7, 0, 10, 0,159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,112, 0,233, 2, 0, 0, 0, 0,179, - 0, 0, 0, 1, 0,233, 9, 16, 0,232,225,240, 0,232,215, 16, 0,232,217,144, 0,232,217,208, 0,232,217, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 5,223, 0, 0, 0, 0, 0, 0, 0, 75, 15, 15, 5,224, 0, 76, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229, 42,208, 0,233, 4,224, 0,233, 7,240, 0,233, 2,160, - 0,233, 3,192, 0, 0, 0, 0, 0, 0, 0, 0, 5,209,251,112, 5,209,252, 48, 68, 65, 84, 65, 0, 0, 0,236, 0,233, 2,160, - 0, 0, 0,180, 0, 0, 0, 1, 0,233, 3,192, 0, 0, 0, 0, 0, 0, 0, 0, 68,112,128, 0, 0, 0, 0, 0, 65,208, 0, 0, - 0, 0, 0, 0, 68,188, 0, 0, 0, 0, 0, 0, 65,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,223, 0, 0, 0, 0, 0, 0, 0, 25, - 68,202,224, 0, 65,200, 0, 0, 68,202,224, 0, 65,200, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, - 0, 4, 4, 12, 0, 10, 5,224, 0, 26, 5,224, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,223, - 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,224, 0, 26, 0, 5, 0, 1, - 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229, 43,240, 5,219, 95,160, 5,219, 95,160, 0, 0, 0, 0, - 0, 0, 0, 0, 5,209,253,224, 5,209,254, 80, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,236, 0,233, 3,192, - 0, 0, 0,180, 0, 0, 0, 1, 0, 0, 0, 0, 0,233, 2,160,192, 64, 0, 0, 67,126, 0, 0, 0, 0, 0, 0, 66, 72, 0, 0, -192, 17,189,112, 67,125, 70,246, 0, 0, 0, 0, 66, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 5,223, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 5,223, 0, 0, 0, 17, 0, 0, 0, 49, - 63,128, 0, 0, 66, 72, 0, 0, 72,146,124, 0, 66, 72, 0, 0, 61,204,204,205, 65, 32, 0, 0, 0, 72, 0, 0, 0, 0, 2, 0, - 0, 4, 4, 0, 0, 8, 5,224, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,223, - 0, 0, 0, 26, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,224, 0, 50, 0, 6, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229, 43, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 5,210, 0, 16, 5,210, 1,208, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,168, 0,233, 4,224, - 0, 0, 0,160, 0, 0, 0, 1, 0,233, 7,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 0, 0, 0, 0, 0, 0,208, 63,214, 2, 0, 0, 0, 0,255, 20, 0, 0,160, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0,144, 60,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0, +240, 61,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 68, 0, 0, 0, 0, 0, 0,208, 65, + 0, 0, 0, 0, 0, 0,138, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, + 0,128,237, 68, 0, 0,200, 65, 0,128,237, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, + 4, 0, 12, 4, 10, 0, 20, 1, 26, 0, 20, 1, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 6, 0, 0,108, 7, 0, 0, + 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 1, 26, 0, 0, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0, +240, 61,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144, 60,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 6, 68, 65, 84, 65, 0, 0, 0,236, 0,233, 5,176, 0, 0, 0,180, - 0, 0, 0, 1, 0,233, 6,208, 0, 0, 0, 0, 0, 0, 0, 0, 68, 69, 0, 0, 0, 0, 0, 0, 65,208, 0, 0, 0, 0, 0, 0, - 68,203, 0, 0, 0, 0, 0, 0, 65,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 87, 0, 0, 0, 0, 0, 0, 0, 25, 68,237,128, 0, - 65,200, 0, 0, 68,237,128, 0, 65,200, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 0, 4, 4, 12, - 0, 10, 6, 88, 0, 26, 6, 88, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 87, 0, 0, 0, 0, - 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 88, 0, 26, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,236, 0,233, 6,208, 0, 0, 0,180, - 0, 0, 0, 1, 0, 0, 0, 0, 0,233, 5,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 89, 6, 0, 0,108, 7, 0, 0, 26, 0, 0, 0, 80, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 20, 1, 55, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 87, 0, 0, 0, 26, - 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 88, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7,164, 32, 68, 65, 84, 65, 0, 0, 2,152, 1, 7,164, 32, 0, 0, 0,145, - 0, 0, 0, 1, 63,140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,108,213, 87, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,128, 1, 80,191,128, 0, 0,128, 0, 0, 0,128, 0, 0, 0,188,163,215,226, -128, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 32, 0, 0, - 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 32, 0, 0, - 63,128, 0, 0, 63,140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,108,213, 87, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,128, 1, 80,191,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 31,175,184, - 65, 32, 0, 0, 63,106, 14,161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60,138, 91,224, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,195,249,252,209,194, 71,253,115, 0, 0, 0, 0, 0, 0, 0, 0, 67,249,127, 98, - 66, 71,255,129, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 32, 0, 0, - 63,128, 0, 0, 63,140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66,108,213, 87, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,128, 1, 80,191,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 31,175,184, - 65, 32, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 58,147,149, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 0, 0, 0,240, 0,233, 7,240, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0, 0, 0,233, 4,224, 0,233, 5,176, 0,233, 6,208, - 0, 0, 0, 1, 63, 51, 51, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 65, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 7, 1, 7,188, 32, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, - 66, 12, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 60, 35,215, 10, 67,250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 7, 0, 10, 0,159, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 0, 0, 0,112, 0,233, 9, 16, 0, 0, 0,179, 0, 0, 0, 1, 0,233, 19,208, 0,233, 2, 0, 0,232,217,144, - 0,232,216, 16, 0,232,217, 80, 0,232,217,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,223, 0, 0, 0, 77, 0, 0, 4, 80, - 1, 1, 5,224, 4, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0,229, 44,128, 0,233, 18,176, 0,233, 18,176, 0,233, 9,176, 0,233, 17,144, 0, 0, 0, 0, 0, 0, 0, 0, 6,157,103,176, - 6,160,128,208, 68, 65, 84, 65, 0, 0, 0,236, 0,233, 9,176, 0, 0, 0,180, 0, 0, 0, 1, 0,233, 10,208, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 84, 0, 0, 0, 0, 0, 0, 65,208, 0, 0, 0, 0, 0, 0, 68,188, 0, 0, 0, 0, 0, 0, 65,208, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 5,223, 0, 0, 0, 0, 0, 0, 0, 25, 68,237,128, 0, 65,200, 0, 0, 68,237,128, 0, 65,200, 0, 0, - 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 0, 4, 4, 12, 0, 10, 5,224, 0, 26, 5,224, 0, 26, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,223, 0, 0, 0, 77, 0, 0, 0,102, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 5,224, 0, 26, 0, 7, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0,229, 52,192, 5,221, 1, 32, 5,221, 1, 32, 0, 0, 0, 0, 0, 0, 0, 0, 5,210, 5, 16, 5,210, 6, 96, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,236, 0,233, 10,208, 0, 0, 0,180, 0, 0, 0, 1, 0,233, 17,144, 0,233, 9,176, - 0, 0, 0, 0, 67, 92, 0, 0,196, 55, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 92, 0, 0,196, 41, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0,219, 0, 0, 0, 0, 0, 0, 2,163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 63, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 2, 0, 0, 0, 6, 0,220, 2,164, 0,220, 2,164, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,223, 0, 0, 5,223, 0, 0, 0,103, 0, 0, 4, 80, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, - 0,229, 45,160, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 11,240, 0,233, 16,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,233, 11,240, 0, 0, 0,176, 0, 0, 0, 1, 0,233, 13, 16, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 26, 0,220, 0,206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,233, 13, 16, 0, 0, 0,176, 0, 0, 0, 1, 0,233, 14, 48, - 0,233, 11,240, 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253,229, 0,220, 1, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,233, 14, 48, 0, 0, 0,176, 0, 0, 0, 1, - 0,233, 15, 80, 0,233, 13, 16, 0, 0, 0, 0, 0, 0, 0, 0, 66, 97, 99,107,103,114,111,117,110,100, 32, 73,109, 97,103,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 80, 63,160, 2, 0, 0, 0, 0, 68, 65, 84, 65,248, 2, 0, 0, 80, 63,160, 2, 0, 0, 0, 0,145, 0, 0, 0, 1, 0, 0, 0, +103,212,136, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0,128, 0, 0, 0,128,226,215,163,188, 0, 0, 0,128, + 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63, + 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 63, +103,212,136, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65, +237,122,111, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,161, 14,106, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,209,252,249,195,115,253, 71,194, 0, 0, 0, 0, 0, 0, 0, 0, 98,127,249, 67,129,255, 71, 66, + 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63, +103,212,136, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +100, 32,222, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 1, 0, 0, +144, 66,160, 2, 0, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 59,160, 2, 0, 0, 0, 0, +144, 60,160, 2, 0, 0, 0, 0,240, 61,160, 2, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, 7, 0, 96,138,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, + 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 7, 0, 10, 0,159, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,184, 0, 0, 0,240, 67,160, 2, 0, 0, 0, 0, +182, 0, 0, 0, 1, 0, 0, 0, 16, 80,160, 2, 0, 0, 0, 0, 32, 21,160, 2, 0, 0, 0, 0, 64, 4,160, 2, 0, 0, 0, 0, + 0, 8,160, 2, 0, 0, 0, 0, 96, 8,160, 2, 0, 0, 0, 0, 64, 7,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,231, 5, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 15, 15,232, 5, 80, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,123,147, 2, 0, 0, 0, 0, +176, 71,160, 2, 0, 0, 0, 0,176, 78,160, 2, 0, 0, 0, 0,240, 68,160, 2, 0, 0, 0, 0, 80, 70,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224, 87,189, 2, 0, 0, 0, 0,208, 98,189, 2, 0, 0, 0, 0, + 68, 65, 84, 65, 24, 1, 0, 0,240, 68,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0, 80, 70,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,118, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,189, 68, + 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,231, 5, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,224,202, 68, 0, 0,200, 65, + 0,224,202, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 4, 10, 0,232, 5, + 26, 0,232, 5, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,231, 5, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 5, 26, 0, 6, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,240,124,147, 2, 0, 0, 0, 0,208, 55,234, 2, 0, 0, 0, 0,208, 55,234, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,173,210, 2, 0, 0, 0, 0,224, 29,170, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0, 80, 70,160, 2, 0, 0, 0, 0, +183, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 68,160, 2, 0, 0, 0, 0, 0, 0, 64,192, 0, 0,126, 67, + 0, 0, 0, 0, 0, 0, 72, 66,112,189, 17,192,246, 70,125, 67, 0, 0, 0, 0, 0, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,231, 5, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,231, 5, 0, 0, + 18, 0, 0, 0, 53, 0, 0, 0, 0, 0,128, 63, 0, 0, 72, 66, 0,124,146, 72, 0, 0, 72, 66,205,204,204, 61, 0, 0, 32, 65, + 72, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 4, 8, 0,232, 5, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,231, 5, 0, 0, 26, 0, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +232, 5, 54, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,124,147, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16, 32,170, 2, 0, 0, 0, 0, 16, 35,170, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65,184, 0, 0, 0,176, 71,160, 2, 0, 0, 0, 0,161, 0, 0, 0, 1, 0, 0, 0,176, 78,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 6, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0,176, 72,160, 2, 0, 0, 0, 0, +183, 0, 0, 0, 1, 0, 0, 0, 16, 74,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 68, + 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,203, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 6, 0, 0, + 0, 0, 0, 0, 25, 0, 0, 0, 0,128,237, 68, 0, 0,200, 65, 0,128,237, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, + 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 4, 10, 0, 88, 6, 26, 0, 88, 6, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 87, 6, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 88, 6, 26, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 24, 1, 0, 0, 16, 74,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +176, 72,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 6, 0, 0, 26, 0, 0, 0, 55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 6, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,112, 75,160, 2, 0, 0, 0, 0, 68, 65, 84, 65,248, 2, 0, 0,112, 75,160, 2, 0, 0, 0, 0, +145, 0, 0, 0, 1, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,213,108, 66, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0,128, 0, 0, 0,128, +226,215,163,188, 0, 0, 0,128, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 32,193, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 32, 65, 0, 0,128, 63, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,213,108, 66, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0, +184,175, 31, 65, 0, 0, 32, 65,161, 14,106, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224, 91,138, 60, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,209,252,249,195,115,253, 71,194, 0, 0, 0, 0, 0, 0, 0, 0, + 98,127,249, 67,129,255, 71, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 32,193, 0, 0,128, 63, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,213,108, 66, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0, +184,175, 31, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 52,149,147, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 32, 1, 0, 0,176, 78,160, 2, 0, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +176, 71,160, 2, 0, 0, 0, 0,176, 72,160, 2, 0, 0, 0, 0, 16, 74,160, 2, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 32, 65, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0, 96,138,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 7, 0, 10, 0, +159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,184, 0, 0, 0, + 16, 80,160, 2, 0, 0, 0, 0,182, 0, 0, 0, 1, 0, 0, 0,160, 97,160, 2, 0, 0, 0, 0,240, 67,160, 2, 0, 0, 0, 0, + 0, 8,160, 2, 0, 0, 0, 0,192, 5,160, 2, 0, 0, 0, 0,160, 7,160, 2, 0, 0, 0, 0, 96, 8,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,231, 5, 0, 0, 81, 0, 0, 0, 69, 4, 0, 0, 1, 1,232, 5,245, 3, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +224,125,147, 2, 0, 0, 0, 0, 64, 96,160, 2, 0, 0, 0, 0, 64, 96,160, 2, 0, 0, 0, 0, 16, 81,160, 2, 0, 0, 0, 0, +160, 91,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,104,189, 2, 0, 0, 0, 0, +224,111,189, 2, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0, 16, 81,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0, +112, 82,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,208, 65, + 0, 0, 0, 0, 0, 0,189, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,231, 5, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, + 0,128,237, 68, 0, 0,200, 65, 0,128,237, 68, 0, 0,200, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, + 4, 0, 12, 4, 10, 0,232, 5, 26, 0,232, 5, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,231, 5, 0, 0, + 81, 0, 0, 0,106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 5, 26, 0, 8, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,165,147, 2, 0, 0, 0, 0,240, 61,239, 2, 0, 0, 0, 0, +240, 61,239, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,195,212, 2, 0, 0, 0, 0, +128, 41,170, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0, +112, 82,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0,160, 91,160, 2, 0, 0, 0, 0, 16, 81,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 92, 67, 0, 64, 55,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 67, 0, 0, 41,196, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,219, 0, 0, 0, 0, 0, 0, 0,163, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, 0, 64, 0, 0, 0, 0, 1, 0, 3, 0, 2, 0, 0, 0, 6, 0,220, 0,164, 2,220, 0,164, 2, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,231, 5, 0, 0,231, 5, 0, 0,107, 0, 0, 0, 69, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 4, 0, 4, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, +192,127,147, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208, 83,160, 2, 0, 0, 0, 0, + 16, 90,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0,208, 83,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, + 96, 85,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 26,255,220, 0,206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, 96, 85,160, 2, 0, 0, 0, 0, +179, 0, 0, 0, 1, 0, 0, 0,240, 86,160, 2, 0, 0, 0, 0,208, 83,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229,253,220, 0, 29, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, +240, 86,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0,128, 88,160, 2, 0, 0, 0, 0, 96, 85,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 97, 99,107,103,114,111,117,110,100, 32, 73,109, 97,103,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 97, 99,107,103,114,111,117,110,100, 32, 73,109, 97,103,101, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,169,253,220, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 80, 1, 0, 0,128, 88,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, 16, 90,160, 2, 0, 0, 0, 0, +240, 86,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114, +109, 32, 79,114,105,101,110,116, 97,116,105,111,110,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114, +109, 32, 79,114,105,101,110,116, 97,116,105,111,110,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,253,220, 0, 66, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 1, 0, 0, 16, 90,160, 2, 0, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,128, 88,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 76, 97,115,116, 32, 79,112,101,114, 97,116,111,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 76, 97,115,116, 32, 79,112,101,114, 97,116,111,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 39,253,220, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0,160, 91,160, 2, 0, 0, 0, 0, +183, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112, 82,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,231, 5, 0, 0,107, 0, 0, 0, 69, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +232, 5,219, 3, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208,126,147, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +176, 43,170, 2, 0, 0, 0, 0,144, 49,170, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93,160, 2, 0, 0, 0, 0, + 68, 65, 84, 65,248, 2, 0, 0, 0, 93,160, 2, 0, 0, 0, 0,145, 0, 0, 0, 1, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,212,119,214, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,225,215,163,188, 0, 0, 0, 0,238, 4, 53, 63,186,103, 59,190, +247,217, 46, 63, 0, 0, 0, 0,255, 4, 53, 63,126,103, 59, 62,244,217, 46,191, 0, 0, 0, 0,228, 3, 52, 50,248, 70,119, 63, +217,131,132, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152, 60,138,193, 0, 0,128, 63,236, 4, 53, 63,244, 4, 53, 63, + 0, 0, 24, 53, 0, 0, 0, 0,137,103, 59,190,118,103, 59, 62,227, 70,119, 63, 0, 0, 0, 0,238,217, 46, 63,221,217, 46,191, +213,131,132, 62, 0, 0, 0, 0,186,213, 60, 65,168,213, 60,193,221, 28,143, 64, 0, 0,128, 63,100,253, 69, 63,110, 0,157,190, +194,219, 46,191,247,217, 46,191,119,253, 69, 63, 60, 0,157, 62,191,219, 46, 63,244,217, 46, 63, 65,228, 68, 50, 18, 41,207, 63, + 53,133,132,190,217,131,132,190, 0, 0, 0, 0, 0, 0, 0, 0, 13, 21,138, 65,152, 60,138, 65, 20,129, 37, 63,162,128, 37, 63, + 0, 0,252, 53, 0, 0,160, 52,183,177,223,189,161,177,223, 61,201,148, 19, 63, 0, 0, 96, 51, 0,133, 19,196,242,132, 19, 68, + 28,154, 95,195, 81,253, 71,194,205, 90, 19, 68,191, 90, 19,196, 37, 90, 95, 67, 95,255, 71, 66,238, 4, 53, 63,186,103, 59,190, +247,217, 46, 63, 0, 0, 0, 0,255, 4, 53, 63,126,103, 59, 62,244,217, 46,191, 0, 0, 0, 0,228, 3, 52, 50,248, 70,119, 63, +217,131,132, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152, 60,138,193, 0, 0,128, 63,100,253, 69, 63,110, 0,157,190, +194,219, 46,191,247,217, 46,191,119,253, 69, 63, 60, 0,157, 62,191,219, 46, 63,244,217, 46, 63, 65,228, 68, 50, 18, 41,207, 63, + 53,133,132,190,217,131,132,190, 0, 0, 0, 0, 0, 0, 0, 0, 13, 21,138, 65,152, 60,138, 65,148,157,200, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,148,157,200, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +148,157,200, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,122,163, 59, 63,235,250, 15,191, +221,141,110,190,230,113,155,190,152, 60,138, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,131,158, 58, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 1, 0, 0, 64, 96,160, 2, 0, 0, 0, 0, +146, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0, + 96,138,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 12, 66, 0, 0,128, 63, + 0, 0,128, 63, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 7, 0, 10, 0,159, 0, 0, 0, 0, 0, 0, 0, 3, 0,255,255, 25, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,184, 0, 0, 0,160, 97,160, 2, 0, 0, 0, 0,182, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 16, 80,160, 2, 0, 0, 0, 0,192, 8,160, 2, 0, 0, 0, 0,160, 7,160, 2, 0, 0, 0, 0, + 32, 6,160, 2, 0, 0, 0, 0, 32, 9,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 5, 0, 0,118, 7, 0, 0, + 73, 3, 0, 0, 69, 4, 0, 0, 3, 3,142, 1,253, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,120,147, 2, 0, 0, 0, 0, 96,101,160, 2, 0, 0, 0, 0, + 48,114,160, 2, 0, 0, 0, 0,160, 98,160, 2, 0, 0, 0, 0, 0,100,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 96,114,189, 2, 0, 0, 0, 0,176, 5,194, 2, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0, +160, 98,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0, 0,100,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,190, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,199, 67, 0, 0, 0, 0, 0, 0,208, 65, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,141, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 66, 67, 0, 0,200, 65, 0, 0, 66, 67, 0, 0,200, 65, + 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 4, 10, 0,142, 1, 26, 0,142, 1, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,233, 5, 0, 0,118, 7, 0, 0, 73, 3, 0, 0, 98, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,142, 1, 26, 0, 10, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 32,122,147, 2, 0, 0, 0, 0,176, 3,235, 2, 0, 0, 0, 0,176, 3,235, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 96,182,212, 2, 0, 0, 0, 0, 0, 54,170, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0, 0,100,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,160, 98,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,131, 67, 0, 0,194,194, 0, 0, 0, 0, + 0, 0, 0, 0, 0,128,190, 67, 0, 0, 81,195, 0, 0, 0, 0,125, 1, 0, 0,142, 1, 0, 0, 18, 0, 0, 0,226, 0, 0, 0, + 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 18, 0, 0, 0,226, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 18, 0, 0, 0, 2, 0, 3, 3, + 0, 0, 0, 4, 6, 0,142, 1,227, 0,125, 1,209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 5, 0, 0,118, 7, 0, 0, + 99, 3, 0, 0, 69, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 1,227, 0, 11, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,121,147, 2, 0, 0, 0, 0,112, 31,236, 2, 0, 0, 0, 0, +112, 31,236, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,169,212, 2, 0, 0, 0, 0, +176, 57,170, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0, + 96,101,160, 2, 0, 0, 0, 0,155, 0, 0, 0, 1, 0, 0, 0,224,106,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,236, 2, 0, 0, 0, 0, 0, 4,236, 2, 0, 0, 0, 0, +192,102,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65, 16, 0, 0, 0,192,102,160, 2, 0, 0, 0, 0,206, 0, 0, 0, 1, 0, 0, 0, + 13, 0, 0, 0, 13, 0, 0, 0, 16,103,160, 2, 0, 0, 0, 0, 68, 65, 84, 65,208, 0, 0, 0, 16,103,160, 2, 0, 0, 0, 0, +205, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 32,116,160, 2, 0, 0, 0, 0, 19, 0, 0, 0, 1, 0, 1, 0, + 32,116,160, 2, 0, 0, 0, 0, 20, 0, 0, 0, 1, 0, 1, 0, 32,116,160, 2, 0, 0, 0, 0, 21, 0, 1, 0, 1, 0, 1, 0, + 32,116,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 64,130,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, +224,142,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,144,158,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, +128,152,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0,157,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, + 0,148,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 32,126,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, + 96,138,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 48,125,160, 2, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0, + 32,104,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0,128,105,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,240, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 55, 0, 0, 67, 67, 0, 0, 0, 0, 0, 0,208, 65, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,194, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,137, 67, 0, 0,200, 65, 0,128,137, 67, 0, 0,200, 65, + 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 4, 10, 0,195, 0, 26, 0,195, 0, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 53, 4, 0, 0,247, 4, 0, 0, 69, 2, 0, 0, 94, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,195, 0, 26, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0,128,105,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 32,104,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 67, 0,192,116,196, 0, 0, 0, 0, + 0, 0, 0, 0,205, 85,150, 67,223,204, 35,196, 26, 85,207,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,194, 0, 0, 0, 0, 0, 0, 0,155, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 0, 0, 0, 0, 1, 0, 3, 0, + 2, 0, 0, 4, 6, 0,195, 0,156, 0,195, 0,156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 4, 0, 0,247, 4, 0, 0, + 95, 2, 0, 0,250, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,195, 0,156, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0, +224,106,160, 2, 0, 0, 0, 0,151, 0, 0, 0, 1, 0, 0, 0, 48,114,160, 2, 0, 0, 0, 0, 96,101,160, 2, 0, 0, 0, 0, + 32,104,160, 2, 0, 0, 0, 0,128,105,160, 2, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0, + 48,108,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0,144,109,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 69, 68, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0,138, 67, 0, 0, 0, 0, 0, 0,208, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253,169, 0,220, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,233, 15, 80, 0, 0, 0,176, - 0, 0, 0, 1, 0,233, 16,112, 0,233, 14, 48, 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 79,114, -105,101,110,116, 97,116,105,111,110,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 79,114, -105,101,110,116, 97,116,105,111,110,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 79, 0,220, 0, 66, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,233, 16,112, - 0, 0, 0,176, 0, 0, 0, 1, 0, 0, 0, 0, 0,233, 15, 80, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,115,116, 32, 79,112,101, -114, 97,116,111,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,115,116, 32, 79,112,101, -114, 97,116,111,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,253, 39, 0,220, 0, 16, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,236, - 0,233, 17,144, 0, 0, 0,180, 0, 0, 0, 1, 0, 0, 0, 0, 0,233, 10,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 5,223, 0, 0, 0,103, 0, 0, 4, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,224, 3,234, - 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229, 45, 16, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 5,210, 8, 32, 5,210, 11,192, 0, 0, 0, 0, 1, 7,168, 32, 68, 65, 84, 65, 0, 0, 2,152, - 1, 7,168, 32, 0, 0, 0,145, 0, 0, 0, 1, 63,140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 63,210, 35,198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,128, 1, 80,191,128, 0, 0,128, 0, 0, 0, -128, 0, 0, 0,188,163,215,226,128, 0, 0, 0, 63, 53, 4,238,190, 59,103,186, 63, 46,217,247, 0, 0, 0, 0, 63, 53, 4,255, - 62, 59,103,126,191, 46,217,244, 0, 0, 0, 0, 50, 52, 3,228, 63,119, 70,248, 62,132,131,217, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,193,138, 60,152, 63,128, 0, 0, 63, 53, 4,236, 63, 53, 4,244, 53, 24, 0, 0, 0, 0, 0, 0,190, 59,103,137, - 62, 59,103,118, 63,119, 70,227, 0, 0, 0, 0, 63, 46,217,238,191, 46,217,221, 62,132,131,213, 0, 0, 0, 0, 65, 60,213,186, -193, 60,213,168, 64,143, 28,221, 63,128, 0, 0, 63, 69,253,100,190,153,213, 71,191, 46,219,194,191, 46,217,247, 63, 69,253,119, - 62,153,213, 21, 63, 46,219,191, 63, 46,217,244, 50, 68,228, 65, 63,202,250,197,190,132,133, 53,190,132,131,217, 0, 0, 0, 0, - 0, 0, 0, 0, 65,138, 21, 13, 65,138, 60,152, 63, 37,129, 20, 63, 37,128,162, 53,252, 0, 0, 52,160, 0, 0,189,228, 76,142, - 61,228, 76,119, 63, 22,159, 2, 52, 49, 0, 0,196, 19,133, 0, 68, 19,132,242,195, 95,154, 27,194, 71,253, 81, 68, 19, 90,205, -196, 19, 90,191, 67, 95, 90, 36, 66, 71,255, 95, 63, 53, 4,238,190, 59,103,186, 63, 46,217,247, 0, 0, 0, 0, 63, 53, 4,255, - 62, 59,103,126,191, 46,217,244, 0, 0, 0, 0, 50, 52, 3,228, 63,119, 70,248, 62,132,131,217, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,193,138, 60,152, 63,128, 0, 0, 63, 69,253,100,190,153,213, 71,191, 46,219,194,191, 46,217,247, 63, 69,253,119, - 62,153,213, 21, 63, 46,219,191, 63, 46,217,244, 50, 68,228, 65, 63,202,250,197,190,132,133, 53,190,132,131,217, 0, 0, 0, 0, - 0, 0, 0, 0, 65,138, 21, 13, 65,138, 60,152, 63, 59,163,122,191, 15,250,235,190,110,141,221,190,155,113,230, 65,138, 60,152, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58,159, 91,166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,233, 18,176, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 63, 51, 51, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 7, - 1, 7,188, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 1, 0, 0, - 0, 0, 8, 8, 0, 0, 0, 0, 66, 12, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 60, 35,215, 10, 67,250, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 7, 0, 10, - 0,159, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,112, 0,233, 19,208, 0, 0, 0,179, 0, 0, 0, 1, 0, 0, 0, 0, - 0,233, 9, 16, 0,232,218, 16, 0,232,217, 80, 0,232,216, 80, 0,232,218, 80, 0, 0, 0, 0, 0, 0, 5,225, 0, 0, 7,108, - 0, 0, 3, 77, 0, 0, 4, 80, 3, 3, 1,140, 1, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0,229, 41, 32, 0,233, 22,176, 0,233, 30,112, 0,233, 20,112, 0,233, 21,144, 0, 0, 0, 0, - 0, 0, 0, 0, 5,210, 12, 48, 6,160,116, 96, 68, 65, 84, 65, 0, 0, 0,236, 0,233, 20,112, 0, 0, 0,180, 0, 0, 0, 1, - 0,233, 21,144, 0, 0, 0, 0, 0, 0, 0, 0, 67,216, 0, 0, 0, 0, 0, 0, 65,208, 0, 0, 0, 0, 0, 0, 67,198, 0, 0, - 0, 0, 0, 0, 65,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,139, 0, 0, 0, 0, 0, 0, 0, 25, 67, 66, 0, 0, 65,200, 0, 0, - 67, 66, 0, 0, 65,200, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 0, 4, 4, 12, 0, 10, 1,140, - 0, 26, 1,140, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,225, 0, 0, 7,108, 0, 0, 3, 77, 0, 0, 3,102, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,140, 0, 26, 0, 9, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0,229, 42, 64, 5,216,145, 16, 5,216,145, 16, 0, 0, 0, 0, 0, 0, 0, 0, 5,210, 14,160, - 5,210, 15, 16, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,236, 0,233, 21,144, 0, 0, 0,180, 0, 0, 0, 1, - 0, 0, 0, 0, 0,233, 20,112, 0, 0, 0, 0, 67,132, 0, 0,194,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,190, 0, 0, -195, 89, 0, 0, 0, 0, 0, 0, 0, 0, 1,124, 0, 0, 1,140, 0, 0, 0, 17, 0, 0, 0,233, 0, 0, 0, 0, 0, 0, 1,123, - 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 1,123, 0, 0, 0, 17, 0, 0, 0,233, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 18, 0, 0, 0, 2, 3, 3, 0, 0, 4, 0, 0, 6, 1,140, - 0,234, 1,124, 0,217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,225, 0, 0, 7,108, 0, 0, 3,103, 0, 0, 4, 80, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,140, 0,234, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0,229, 41,176, 6,161, 8,240, 6,161, 8,240, 0, 0, 0, 0, 0, 0, 0, 0, 5,210, 16,208, - 5,210, 17,176, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,248, 0,233, 22,176, 0, 0, 0,154, 0, 0, 0, 1, - 0,233, 27, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,160,117, 80, 6,160,117, 80, 0,233, 23,208, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 68, 65, 84, 65, 0, 0, 0, 12, - 0,233, 23,208, 0, 0, 0,203, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, 13, 0,233, 24, 16, 68, 65, 84, 65, 0, 0, 0,156, - 0,233, 24, 16, 0, 0, 0,202, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 1, 1, 7,176, 32, 0, 19, 0, 0, 0, 1, 0, 1, - 1, 7,176, 32, 0, 20, 0, 0, 0, 1, 0, 1, 1, 7,176, 32, 0, 21, 0, 1, 0, 1, 0, 1, 1, 7,176, 32, 0, 0, 0, 0, - 0, 1, 0, 1, 0,233, 38, 96, 0, 0, 0, 0, 0, 1, 0, 1, 1, 7,192, 32, 0, 0, 0, 0, 0, 1, 0, 1, 0,233, 43,112, - 0, 0, 0, 0, 0, 1, 0, 1, 1, 7,200, 32, 0, 0, 0, 0, 0, 1, 0, 1, 0,233, 42, 48, 0, 0, 0, 0, 0, 1, 0, 1, - 1, 7,196, 32, 0, 0, 0, 0, 0, 1, 0, 1, 0,233, 35, 64, 0, 0, 0, 0, 0, 1, 0, 1, 1, 7,188, 32, 0, 0, 0, 0, - 0, 1, 0, 1, 0,233, 34,144, 68, 65, 84, 65, 0, 0, 0,236, 0,233, 24,224, 0, 0, 0,180, 0, 0, 0, 1, 0,233, 26, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 67,240, 0, 0, 0, 0, 0, 0, 65,208, 0, 0, 55, 0, 0, 0, 67, 67, 0, 0, 0, 0, 0, 0, - 65,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,194, 0, 0, 0, 0, 0, 0, 0, 25, 67,137,128, 0, 65,200, 0, 0, 67,137,128, 0, - 65,200, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 0, 4, 4, 12, 0, 10, 0,195, 0, 26, 0,195, - 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 53, 0, 0, 4,247, 0, 0, 2, 69, 0, 0, 2, 94, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,195, 0, 26, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,236, 0,233, 26, 0, 0, 0, 0,180, 0, 0, 0, 1, 0, 0, 0, 0, - 0,233, 24,224, 0, 0, 0, 0, 67,150, 0, 0,196,116,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,150, 85,205,196, 35,204,223, -195,207, 85, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,194, 0, 0, 0, 0, 0, 0, 0,155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 2, 4, 0, 0, 6, 0,195, 0,156, 0,195, - 0,156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 53, 0, 0, 4,247, 0, 0, 2, 95, 0, 0, 2,250, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,195, 0,156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,224, 0,233, 27, 32, 0, 0, 0,151, 0, 0, 0, 1, 0,233, 30,112, - 0,233, 22,176, 0,233, 24,224, 0,233, 26, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 0, 0, 0,236, 0,233, 28, 48, 0, 0, 0,180, 0, 0, 0, 1, 0,233, 29, 80, 0, 0, 0, 0, 0, 0, 0, 0, 68, 69, 0, 0, - 0, 0, 0, 0, 65,208, 0, 0, 0, 0, 0, 0, 67,138, 0, 0, 0, 0, 0, 0, 65,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 19, - 0, 0, 0, 0, 0, 0, 0, 25, 68,237,128, 0, 65,200, 0, 0, 68,237,128, 0, 65,200, 0, 0, 63,128, 0, 0, 63,128, 0, 0, - 0, 0, 0, 0, 0, 2, 3, 3, 0, 4, 4, 12, 0, 10, 1, 20, 0, 26, 1, 20, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 6, 89, 0, 0, 7,108, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 20, 0, 26, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 0, 0, 0,236, 0,233, 29, 80, 0, 0, 0,180, 0, 0, 0, 1, 0, 0, 0, 0, 0,233, 28, 48, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 6, 89, 0, 0, 7,108, 0, 0, 0, 26, 0, 0, 4, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 20, 4, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7,172, 32, 68, 65, 84, 65, - 0, 0, 2,152, 1, 7,172, 32, 0, 0, 0,145, 0, 0, 0, 1, 64,136,212,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63,140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,128, 1, 80,191,128, 0, 0, -128, 0, 0, 0,128, 0, 0, 0,188,163,215,226,128, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,193, 32, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 65, 32, 0, 0, 63,128, 0, 0, 64,136,212,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63,140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,128, 1, 80,191,128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 65, 31,175,184, 65, 32, 0, 0, 62,111,122,237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63,106, 14,161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,195,249,252,209,194, 71,253,115, - 0, 0, 0, 0, 0, 0, 0, 0, 67,249,127, 98, 66, 71,255,129, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,193, 32, 0, 0, 63,128, 0, 0, 64,136,212,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63,140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191,128, 1, 80,191,128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 65, 31,175,184, 65, 32, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 65, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58,222, 32,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,240, 0,233, 30,112, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0, 0, - 0,233, 27, 32, 0,233, 28, 48, 0,233, 29, 80, 0, 0, 0, 1, 63, 51, 51, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 0, 1, 0, 7, 1, 7,188, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 66, 12, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 60, 35,215, 10, - 67,250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, - 0, 7, 0, 10, 0,159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 0, 0, 4,248, 1, 7,176, 32, 0, 0, 0,143, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 83, 99,101,110,101, 0,116, 97,103,101, 0, 97,105,110, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7,188, 32, 0,233, 38, 96, - 0, 0, 0, 0, 0, 0, 0, 0, 0,232,212,160, 0,233, 32, 64, 0,232,212,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 61,204,204,205, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 32,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 32,224, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,172, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0,100, 0, 0, 0,100, 0, 0, 0, 1, 0, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,128, 1,224, 0, 60, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 6, 0, 25, - 0,141, 7,128, 4, 56, 0, 4, 0, 4, 0, 0, 0, 24, 0, 17, 0, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, - 0, 33, 0, 23, 0, 0, 0,128, 0, 0, 0, 8, 0, 24, 0, 10, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, + 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0,128,237, 68, 0, 0,200, 65, 0,128,237, 68, 0, 0,200, 65, + 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 2, 0, 3, 3, 4, 0, 12, 4, 10, 0, 20, 1, 26, 0, 20, 1, 26, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 89, 6, 0, 0,108, 7, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 20, 1, 26, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0,233, 34, 32, 0,233, 34, 32, 0, 0, 0, 0, 66,200, 0, 0, 66,200, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, - 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 5, 0, 2, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 1, 0, 0,144,109,160, 2, 0, 0, 0, 0,183, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 48,108,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 6, 0, 0,108, 7, 0, 0, + 26, 0, 0, 0, 80, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 1, 55, 4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,110,160, 2, 0, 0, 0, 0, 68, 65, 84, 65,248, 2, 0, 0, +240,110,160, 2, 0, 0, 0, 0,145, 0, 0, 0, 1, 0, 0, 0,103,212,136, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, + 0, 0, 0,128, 0, 0, 0,128,226,215,163,188, 0, 0, 0,128, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 63,103,212,136, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, + 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65,237,122,111, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,161, 14,106, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,209,252,249,195,115,253, 71,194, + 0, 0, 0, 0, 0, 0, 0, 0, 98,127,249, 67,129,255, 71, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63,103,212,136, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, + 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100, 32,222, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 1, 0, 0, 48,114,160, 2, 0, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,224,106,160, 2, 0, 0, 0, 0, 48,108,160, 2, 0, 0, 0, 0,144,109,160, 2, 0, 0, 0, 0, + 1, 0, 0, 0, 51, 51, 51, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0, 96,138,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, + 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, + 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 7, 0, 10, 0,159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 83, 67, 0, 0, 96, 5, 0, 0, 32,116,160, 2, 0, 0, 0, 0,143, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 83, 99,101,110,101, 0, +116, 97,103,101, 0, 97,105,110, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 96,138,160, 2, 0, 0, 0, 0, 64,130,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,192,121,160, 2, 0, 0, 0, 0,160,122,160, 2, 0, 0, 0, 0,192,121,160, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16,123,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,172, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 0, 0, +100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,128, 2,224, 1, 60, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 6, 0, 25, 0,141, 0,128, 7, 56, 4, 8, 0, + 8, 0, 0, 0, 24, 0, 17, 0, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 23, 0, 33, 0, 0, 0,128, 0, + 0, 0, 8, 0, 24, 0, 10, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144,124,160, 2, 0, 0, 0, 0, +144,124,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, + 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 5, 0, 2, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -639,645 +930,726 @@ char datatoc_B_blend[]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,204, 76, 63,205,204, 76, 63,205,204, 76, 63, 0, 0,128, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 62, 6, 0, 0, 0, 16, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, +173, 2, 95, 0,154,153,217, 63, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 0,180, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68,172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 76,204,205, 63, 76,204,205, 63, 76,204,205, 63,128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,128, 0, 0, 0, 0, 0, 6, 0, 0, 0, 16, 63,128, 0, 0, 63,128, 0, 0, - 2,173, 0, 95, 63,217,153,154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 0,180, 0, 0, 63,128, 0, 0, 63,128, 0, 0, - 0, 0, 0, 0, 0, 0,172, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0,232,101,128, - 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 28, - 0,232,212,160, 0, 0, 0,125, 0, 0, 0, 1, 0,233, 31,240, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, - 2,240, 1,245, 1, 7,192, 32, 68, 65, 84, 65, 0, 0, 0, 28, 0,233, 31,240, 0, 0, 0,125, 0, 0, 0, 1, 0,233, 32, 64, - 0,232,212,160, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 4, 0, 3,200, 3, 42, 1, 7,196, 32, 68, 65, 84, 65, 0, 0, 0, 28, - 0,233, 32, 64, 0, 0, 0,125, 0, 0, 0, 1, 0, 0, 0, 0, 0,233, 31,240, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 4, 0, - 3, 73, 3, 70, 1, 7,188, 32, 68, 65, 84, 65, 0, 0, 0, 40, 0,233, 32,144, 0, 0, 0,124, 0, 0, 0, 1, 1, 44, 0, 0, - 0, 1, 0, 2, 0, 1, 0, 2, 0, 0, 0, 1, 1,244, 0,200, 0,100, 0, 20, 0, 0, 39, 16, 61,204,204,205, 65,240, 0, 0, - 64, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 12, 0,233, 32,224, 0, 0, 0,141, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 1, 63, 76,204,205, 66,180, 0, 0, 0, 9, 0, 1, 63,128, 0, 0, 58,131, 18,111, 0, 32, 0, 32, - 0, 32, 0, 1, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 80, 0, 0, 0, 0, 0, 7, 0, 5, 0, 5,255,255, 0, 50, 0, 50, - 0, 10, 0, 0, 0, 50, 0,100, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, 50, 0, 50, - 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, 0, 0, 0, 62,128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 35,215, 10, 61,204,204,205, 0, 0, 0, 0, 0, 0, 0,250, 61,204,204,205, 61,204,204,205, 63,166,102,102, - 63,192, 0, 0, 65,240, 0, 0, 63,122,225, 72, 61,204,204,205, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 2, 67, 0, 3, - 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 72, 0,233, 34, 32, 0, 0, 0,130, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 49, 32, 82,101,110,100,101,114, 76, 97,121,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15,255,255, 0, 0, 0, 0, 0, 0,127,255, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, - 0, 0, 67, 65, 0, 0, 0,136, 0,233, 34,144, 0, 0, 0, 30, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 67, 65, 67, 97,109,101,114, 97, 0, 97,109,101,114, 97, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 63, 0, 0, 0, 66, 68,137,145, 61,204,204,205, 66,200, 0, 0, - 66, 12, 0, 0, 64,234, 14,161, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, - 0, 0, 1,132, 0,233, 35, 64, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 76, 65, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, - 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 65,239,255,247, 66,150, 0, 0, - 62, 25,153,154, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0,233, 36,240, 0, 1, 0, 0, 63,128, 26, 46, 65,240, 4, 25, - 66, 52, 0, 0, 63,128, 0, 0, 64, 64, 0, 0, 11, 64, 0, 3, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, - 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 58,131, 18,111, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 63,128, 0, 0, - 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 64, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, - 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 8, 0,233, 36,240, - 0, 0, 1, 50, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, - 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 2, 0, 1, 67,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, -191, 53, 4,243, 63, 53, 4,242,191, 53, 4,242, 63, 53, 4,243, 0,233, 38, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, - 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 0,233, 38, 32, 0, 0, 1, 48, - 0, 0, 0, 2, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 79, - 0, 0, 1,104, 0,233, 38, 96, 0, 0, 0,123, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 87, 79, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,128, 0, 0, 62,128, 0, 0, 62,128, 0, 0, 0, 0, 0, 0, - 61,204,204,205, 61,204,204,205, 61,204,204,205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 28,204,205, 0, 0, 0, 0, - 0, 0, 0, 32, 0,128, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 65,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 65, 32, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 61, 76,204,205, 0, 0, 0, 5, 0, 0, 0, 0, 59,163,215, 10, 0, 0, 0, 0, - 62,128, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 88, 0, 0, 0,120, - 0,233, 39,240, 0, 0, 0, 28, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 88, 84,101, -120,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 1, 0,233, 40,144, 0,233, 40,144, 0,233, 40,144, 0,233, 40,144, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7,182, 32,255,255,255,255, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 24, 0,233, 40,144, 0, 0, 0, 26, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0,233, 40,208, 0, 0, 0, 0, 0, 0, 0, 0, 70, 82, 69, 69, 68, 65, 84, 65, 0, 0, 0, 4, 0,233, 40,208, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 79, 66, 0, 0, 3, 80, 1, 7,188, 32, 0, 0, 0,115, 0, 0, 0, 1, 1, 7,192, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 67, 97,109,101,114, 97, 0, 97,109,101,114, 97, 46, 48, 48, 49, 0, 0, - 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 34,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64,239,101,110,192,208, 62,150, 64,170,255, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,141,254, 42, - 60, 49, 57,192, 63, 80,159, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 47,149,222, 63, 58, 70, 53,188, 49, 56,222, - 0, 0, 0, 0,190,162,126, 86, 62,159,251,227, 63,101, 53, 55, 0, 0, 0, 0, 63, 39,165, 7,191, 28, 84,149, 62,227,247, 51, - 0, 0, 0, 0, 64,239,101,110,192,208, 62,150, 64,170,255, 78, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 1, 51,128, 0, 1,179, 0, 0, 1, - 0, 0, 0, 0, 51, 0, 0, 0, 63,128, 0, 0, 51,128, 0, 1, 0, 0, 0, 0,179, 0, 0, 2,167, 0, 0, 2, 63,128, 0, 1, - 0, 0, 0, 0, 53, 0, 0, 1, 41, 0, 0, 1,168,128, 0, 1, 63,128, 0, 0, 63,128, 0, 0, 49,215,190,157, 52, 4,170,167, -128, 0, 0, 0,178,157,116,129, 63,128, 0, 1, 51, 15, 69, 33,128, 0, 0, 0, 51, 67,254, 73, 49,106, 97,243, 63,128, 0, 0, -128, 0, 0, 0, 52, 64, 0, 3, 39,157,164,183, 53,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 5, 0, 1, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, - 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 63, 16,225,187, 63,128, 0, 0, 62,204,204,205, 63, 32, 54,237, 0, 0, 0, 0, - 61,117,194,143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 80, 1, 7,192, 32, 0, 0, 0,115, 0, 0, 0, 1, - 1, 7,196, 32, 1, 7,188, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 67,117, 98,101, 0,112,104,101,114,101, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 6,144,198, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 43,112, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0,233, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 47,149,222, 63, 58, 70, 52, -188, 49, 56,179,128, 0, 0, 0,190,162,126, 86, 62,159,251,227, 63,101, 53, 56,128, 0, 0, 0, 63, 39,165, 7,191, 28, 84,149, - 62,227,247, 50,128, 0, 0, 0, 64,239,101,110,192,208, 62,151, 64,170,255, 77, 63,128, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 68, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0,100, 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 60,208, 19,169, 63,128, 0, 0, 62,204,204,205, 62, 34,208,229, - 0, 0, 0, 0, 61,117,194,143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 63,128, 0, 0, - 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,144,198,192, 6,144,204,128, 0, 0, 0, 25, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, 0,233, 41, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 3, 80, 1, 7,196, 32, 0, 0, 0,115, 0, 0, 0, 1, 0, 0, 0, 0, - 1, 7,192, 32, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 35, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64,130,112,154, 63,128,178,183, 64,188,236,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 38,123,229, - 61, 98, 43, 87, 63,238,229,229, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190,148,236, 54, 63,116,134, 25,189, 98, 13,236, - 0, 0, 0, 0,191, 69,102,221,190, 76,174, 57, 63, 26,194, 34, 0, 0, 0, 0, 63, 16,255, 37, 62, 95,161,241, 63, 75,111,164, - 0, 0, 0, 0, 64,130,112,154, 63,128,178,183, 64,188,236,112, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 50,128, 0, 1,179, 0, 0, 0, - 0, 0, 0, 0, 50,128, 0, 1, 63,128, 0, 1, 51, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, - 0, 0, 0, 0, 39, 0, 0, 1, 52, 0, 0, 1, 39,128, 0, 1, 63,128, 0, 0,190,148,236, 53,191, 69,102,222, 63, 16,255, 37, -128, 0, 0, 0, 63,116,134, 24,190, 76,174, 57, 62, 95,161,240,128, 0, 0, 0,189, 98, 13,235, 63, 26,194, 34, 63, 75,111,166, -128, 0, 0, 0, 63, 13, 19,208,190,102, 65,234,192,231, 10, 10, 63,128, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 5, 0, 1, 0, 0, 0, 68, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, - 0, 0, 0, 0,201,150,180, 56, 63,128, 0, 0, 60,208, 19,169, 63,128, 0, 0, 62,204,204,205, 62, 34,208,229, 0, 0, 0, 0, - 61,117,194,143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,219,142, 2, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 10, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, +192,121,160, 2, 0, 0, 0, 0,125, 0, 0, 0, 1, 0, 0, 0, 48,122,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,244, 2,237, 1,224,142,160, 2, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, + 48,122,160, 2, 0, 0, 0, 0,125, 0, 0, 0, 1, 0, 0, 0,160,122,160, 2, 0, 0, 0, 0,192,121,160, 2, 0, 0, 0, 0, + 1, 0, 0, 0, 2, 0, 0, 0, 0, 4, 0, 0,205, 3, 35, 3, 0,148,160, 2, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, +160,122,160, 2, 0, 0, 0, 0,125, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,122,160, 2, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, 77, 3, 63, 3, 96,138,160, 2, 0, 0, 0, 0, 68, 65, 84, 65, 64, 1, 0, 0, + 16,123,160, 2, 0, 0, 0, 0,141, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 1, 0, 1, 0,205,204, 76, 63, 0, 0,180, 66, 9, 0, 1, 0, 0, 0,128, 63, +111, 18,131, 58,205,204,204, 61, 0, 0, 1, 0, 32, 0, 32, 0, 32, 0, 1, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, + 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 80, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 5, 0, 5, 0,255,255, 50, 0, 50, 0, 10, 0, 0, 0, 50, 0,100, 0, 10, 0, 0, 0, + 50, 0, 50, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, + 50, 0, 50, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 10,215, 35, 60,205,204,204, 61, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,250, 0,205,204,204, 61,205,204,204, 61, +102,102,166, 63, 0, 0,192, 63, 0, 0,240, 65, 72,225,122, 63,205,204,204, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, + 67, 2, 0, 3, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 0, 0, 0,144,124,160, 2, 0, 0, 0, 0, +130, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 32, 82,101,110,100,101,114, + 76, 97,121,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,255,255, 15, 0, 0, 0, 0, 0,255,127, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + 67, 65, 0, 0,176, 0, 0, 0, 48,125,160, 2, 0, 0, 0, 0, 30, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 65, 67, 97,109,101,114, 97, + 0, 97,109,101,114, 97, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 63,145,137, 68, 66,205,204,204, 61, 0, 0,200, 66, 0, 0, 12, 66, +161, 14,234, 64, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0,248, 1, 0, 0, 32,126,160, 2, 0, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65, 0, 0, 2,112, 1, 7,200, 32, 0, 0, 0, 42, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 63, 76,204,205, - 63, 76,204,205, 63, 76,204,205, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, - 63,128, 0, 0, 63, 76,204,205, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,160, 0, 0, - 0, 0, 0, 0, 63,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 2, 0, 2, 0, 50, 0, 6, 63,128, 0, 0, - 63,128, 0, 0, 0, 18, 0, 18, 59,163,215, 10, 59,163,215, 10, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 3, - 3, 1, 0, 3, 0, 1, 0, 4, 0, 12, 0, 4, 63, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, - 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64,128, 0, 0, 63, 0, 0, 0, - 61,204,204,205, 63, 0, 0, 0, 61,204,204,205, 61,204,204,205, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0,233, 41, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 76, 65, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, + 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, +247,255,239, 65, 0, 0,150, 66,154,153, 25, 62, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 96,128,160, 2, 0, 0, 0, 0, + 1, 0, 0, 0, 46, 26,128, 63, 25, 4,240, 65, 0, 0, 52, 66, 0, 0,128, 63, 0, 0, 64, 64, 64, 11, 3, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,111, 18,131, 58, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, + 0, 0, 0, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0,233, 41,224, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63, 76,204,205, 63, 76,204,205, 63, 76,204,205, 61, 76,204,205, 61,204,204,205, - 63,166,102,102, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,136, 0,233, 41, 48, 0, 0, 0, 33, - 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 42, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, - 63,128, 0, 0, 62, 76,204,205, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 32, 0,233, 41,224, 0, 0, 0, 19, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 84, 69, 0, 0, 1, 24, 0,233, 42, 48, 0, 0, 0, 38, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 84, 69, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,128, 0, 0, 64,160, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, - 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, - 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 32, 0, 0, 0, 0, 0, 0, - 0, 2, 0, 0, 0, 0, 0, 0, 0, 5, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, - 0, 1, 0, 1, 0, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 60,204,204,205, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 0, 0, 1, 24, 0,233, 43,112, 0, 0, 0, 52, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 67,117, 98,101, 0,112,104,101,114,101, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 44,176, 0,233, 51, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 46, 96, 0,233, 48,208, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 44,224, 0, 0, 0, 1, - 0, 0, 0, 5, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 47, 80, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, - 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 49,144, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 8, 0, 0, 0, 12, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 51,128, 0, 0,180, 0, 0, 0, - 0, 0, 0, 0, 63,128, 0, 4, 63,128, 0, 4, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 67, 0, 30, 0, 4, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0, 4, - 0,233, 44,176, 0, 0, 0, 0, 0, 0, 0, 1, 1, 7,200, 32, 68, 65, 84, 65, 0, 0, 1, 84, 0,233, 44,224, 0, 0, 1, 53, - 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0,233, 46, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 1, 0, 0, + 96,128,160, 2, 0, 0, 0, 0, 53, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, + 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 2, 0, 1, 0, 0, 0,128, 67, + 0, 0, 0, 0, 0, 0,128, 63,243, 4, 53,191,242, 4, 53, 63,242, 4, 53,191,243, 4, 53, 63,224,129,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,192, - 0,233, 46, 96, 0, 0, 0, 58, 0, 0, 0, 8, 63,128, 0, 0, 63,127,255,255,191,128, 0, 0, 73,230, 73,230,182, 26, 3,255, - 0, 0, 0, 0, 63,128, 0, 0,191,128, 0, 0,191,128, 0, 0, 73,230,182, 26,182, 26, 3,255, 0, 0, 0, 0,191,128, 0, 1, -191,127,255,253,191,128, 0, 0,182, 26,182, 26,182, 26, 3,255, 0, 0, 0, 0,191,127,255,250, 63,128, 0, 3,191,128, 0, 0, -182, 26, 73,230,182, 26, 3,255, 0, 0, 0, 0, 63,128, 0, 4, 63,127,255,247, 63,128, 0, 0, 73,230, 73,230, 73,230, 3,255, - 0, 0, 0, 0, 63,127,255,245,191,128, 0, 5, 63,128, 0, 0, 73,230,182, 26, 73,230, 3,255, 0, 0, 0, 0,191,128, 0, 3, -191,127,255,250, 63,128, 0, 0,182, 26,182, 26, 73,230, 3,255, 0, 0, 0, 0,191,127,255,255, 63,128, 0, 0, 63,128, 0, 0, -182, 26, 73,230, 73,230, 3,255, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 1, 84, 0,233, 47, 80, 0, 0, 1, 53, 0, 0, 0, 5, - 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,224,129,160, 2, 0, 0, 0, 0, 51, 1, 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 87, 79, 0, 0,232, 1, 0, 0, + 64,130,160, 2, 0, 0, 0, 0,124, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 79, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 62, 0, 0,128, 62, 0, 0,128, 62, 0, 0, 0, 0,205,204,204, 61,205,204,204, 61, +205,204,204, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, + 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,205,204, 28, 65, 0, 0, 0, 0, 0, 0, 32, 0,128, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0,233, 48,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0,112, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 32, 65, 0, 0, 0, 0, 0, 0,128, 63,205,204, 76, 61, 0, 0, 5, 0, 0, 0, 0, 0, 10,215,163, 59, 0, 0, 0, 0, + 0, 0,128, 62, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 88, 0, 0,176, 0, 0, 0, +112,132,160, 2, 0, 0, 0, 0, 28, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 88, 84,101,120,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 1, 0, 0, 0, 96,133,160, 2, 0, 0, 0, 0, 96,133,160, 2, 0, 0, 0, 0, 96,133,160, 2, 0, 0, 0, 0, + 96,133,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 32,134,160, 2, 0, 0, 0, 0,255,255,255,255, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65, 40, 0, 0, 0, 96,133,160, 2, 0, 0, 0, 0, 26, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,208,133,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 69, 82, 70, + 68, 65, 84, 65, 4, 0, 0, 0,208,133,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 79, 66, 0, 0, + 64, 4, 0, 0, 96,138,160, 2, 0, 0, 0, 0,115, 0, 0, 0, 1, 0, 0, 0,224,142,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 67, 97,109,101,114, 97, 0, 97,109,101, +114, 97, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 0,144, 0,233, 48,208, - 0, 0, 0, 55, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 35, - 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 35, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 35, 0, 0, 0, 1, 0, 0, 0, 5, - 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 35, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 35, 0, 0, 0, 3, - 0, 0, 0, 7, 0, 0, 0, 35, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 35, 0, 0, 0, 4, 0, 0, 0, 7, 0, 0, 0, 35, - 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 35, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 35, 68, 65, 84, 65, 0, 0, 1, 84, - 0,233, 49,144, 0, 0, 1, 53, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 51, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,125,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,110,101,239, 64, +150, 62,208,192, 78,255,170, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42,254,141, 63,192, 57, 49, 60, + 34,159, 80, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,222,149, 47, 63, 53, 70, 58, 63,222, 56, 49,188, 0, 0, 0, 0, + 86,126,162,190,227,251,159, 62, 55, 53,101, 63, 0, 0, 0, 0, 7,165, 39, 63,149, 84, 28,191, 51,247,227, 62, 0, 0, 0, 0, +110,101,239, 64,150, 62,208,192, 78,255,170, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 1, 0,128, 63, 1, 0,128, 51, 1, 0, 0,179, 0, 0, 0, 0, + 0, 0, 0, 51, 0, 0,128, 63, 1, 0,128, 51, 0, 0, 0, 0, 2, 0, 0,179, 2, 0, 0,167, 1, 0,128, 63, 0, 0, 0, 0, + 1, 0, 0, 53, 1, 0, 0, 41, 1, 0,128,168, 0, 0,128, 63, 0, 0,128, 63,157,190,215, 49,167,170, 4, 52, 0, 0, 0,128, +129,116,157,178, 1, 0,128, 63, 33, 69, 15, 51, 0, 0, 0,128, 73,254, 67, 51,243, 97,106, 49, 0, 0,128, 63, 0, 0, 0,128, + 3, 0, 64, 52,183,164,157, 39, 0, 0,128, 53, 0, 0,128, 63, 1, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, + 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, + 56,180,150,201, 0, 0,128, 63,187,225, 16, 63, 0, 0,128, 63,205,204,204, 62,237, 54, 32, 63, 0, 0, 0, 0,143,194,117, 61, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 0, 0, 0,120, 0,233, 51, 16, 0, 0, 0, 54, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, - 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 5, 0, 0, 0, 2, 0, 0, 0, 0, - 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 2, - 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, - 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 2, 85, 83, 69, 82, 0, 0, 11, 40, 0,169, 26,192, 0, 0, 0,172, 0, 0, 0, 1, - 0, 1,152, 33, 0, 0, 2, 63, 0, 0, 0, 5, 47,116,109,112, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 64, 4, 0, 0,224,142,160, 2, + 0, 0, 0, 0,115, 0, 0, 0, 1, 0, 0, 0, 0,148,160, 2, 0, 0, 0, 0, 96,138,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 67,117, 98,101, 0,112,104,101,114,101, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 48,179,235, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,144,158,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 85,115,101,114,115, 47,116,111,110, 47, 68,101,115,107,116,111,112, - 47, 0, 45,112,111,119,101,114,112, 99, 47, 98,105,110, 47, 98,108,101,110,100,101,114, 46, 97,112,112, 47, 67,111,110,116,101, -110,116,115, 47, 82,101,115,111,117,114, 99,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176,147,160, 2, + 0, 0, 0, 0, 96,147,160, 2, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, + 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,128, 63,222,149, 47, 63, 52, 70, 58, 63,179, 56, 49,188, 0, 0, 0,128, 86,126,162,190,227,251,159, 62, + 56, 53,101, 63, 0, 0, 0,128, 7,165, 39, 63,149, 84, 28,191, 50,247,227, 62, 0, 0, 0,128,110,101,239, 64,151, 62,208,192, + 77,255,170, 64, 0, 0,128, 63, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 68, 0, 79, 66, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, +169, 19,208, 60, 0, 0,128, 63,205,204,204, 62,229,208, 34, 62, 0, 0, 0, 0,143,194,117, 61, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 64, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,201,234, 2, + 0, 0, 0, 0,128,171,235, 2, 0, 0, 0, 0, 25, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0,176,147,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 4, 0, 0, 0, 96,147,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 64, 4, 0, 0, 0,148,160, 2, 0, 0, 0, 0,115, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,224,142,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 79, 66, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,126,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,154,112,130, 64,183,178,128, 63,112,236,188, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,229,123, 38, 63, 87, 43, 98, 61,229,229,238, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54,236,148,190, + 25,134,116, 63,236, 13, 98,189, 0, 0, 0, 0,221,102, 69,191, 57,174, 76,190, 34,194, 26, 63, 0, 0, 0, 0, 37,255, 16, 63, +241,161, 95, 62,164,111, 75, 63, 0, 0, 0, 0,154,112,130, 64,183,178,128, 63,112,236,188, 64, 0, 0,128, 63, 0, 0,128, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, + 1, 0,128, 50, 0, 0, 0,179, 0, 0, 0, 0, 1, 0,128, 50, 1, 0,128, 63, 1, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 1, 0, 0, 39, 1, 0, 0, 52, 1, 0,128, 39, 0, 0,128, 63, 53,236,148,190, +222,102, 69,191, 37,255, 16, 63, 0, 0, 0,128, 24,134,116, 63, 57,174, 76,190,240,161, 95, 62, 0, 0, 0,128,235, 13, 98,189, + 34,194, 26, 63,166,111, 75, 63, 0, 0, 0,128,208, 19, 13, 63,234, 65,102,190, 10, 10,231,192, 0, 0,128, 63, 1, 0, 0, 0, + 0, 4, 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, 0, 0, 68, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63,169, 19,208, 60, 0, 0,128, 63,205,204,204, 62, +229,208, 34, 62, 0, 0, 0, 0,143,194,117, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 0, 0, 0, 0, 0, + 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 64, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 77, 65, 0, 0,248, 2, 0, 0,128,152,160, 2, 0, 0, 0, 0, 42, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65, 77, 97,116,101,114,105, + 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,205,204, 76, 63,205,204, 76, 63,205,204, 76, 63, 0, 0,128, 63, 0, 0,128, 63, + 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,205,204, 76, 63, 0, 0, 0, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,128, 63, 2, 0, 2, 0, 50, 0, 0, 6, 0, 0,128, 63, 0, 0,128, 63, 18, 0, 18, 0, 10,215,163, 59, 10,215,163, 59, + 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 3, 3, 0, 1, 3, 1, 0, 4, 0, 12, 0, 4, 0, 0, 0, 0, 63, + 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 63, 0, 0,128, 64, 0, 0, 0, 63,205,204,204, 61, 0, 0, 0, 63,205,204,204, 61,205,204,204, 61, + 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,128, 63, 0, 0,128, 63,192,155,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144,156,160, 2, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 63, +205,204, 76, 63,205,204, 76, 63,205,204, 76, 61,205,204,204, 61,102,102,166, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, + 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,144, 0, 0, 0,192,155,160, 2, 0, 0, 0, 0, + 33, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,157,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, + 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, +144,156,160, 2, 0, 0, 0, 0, 19, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 0, 0, 80, 1, 0, 0, + 0,157,160, 2, 0, 0, 0, 0, 38, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,128, 62, 0, 0,160, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, + 0, 0,128, 63, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 5, 0, 8, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 1, 0, 1, 0, 3, 0, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,205,204,204, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 77, 69, 0, 0,144, 1, 0, 0,144,158,160, 2, 0, 0, 0, 0, 52, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 67,117, 98,101, 0,112, +104,101,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0,168,160, 2, 0, 0, 0, 0, 64,167,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 16,162,160, 2, 0, 0, 0, 0,192,164,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 96,160,160, 2, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 16,163,160, 2, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,144,165,160, 2, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 12, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0,128, 51, 0, 0, 0,180, 0, 0, 0, 0, 4, 0,128, 63, 4, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 30, 0, 4, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0, 0,168,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, +128,152,160, 2, 0, 0, 0, 0, 68, 65, 84, 65,104, 1, 0, 0, 96,160,160, 2, 0, 0, 0, 0, 56, 1, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16,162,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 6, 52, 48, 0, 0, 0, 0, - 0, 0, 0, 2, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 64, 0, 5, 0, 2, 1, 7,216, 32, 1, 7,236, 32, - 5,210, 18, 32, 5,210, 18, 32, 5,210, 24, 64, 5,210, 24, 64, 0, 32, 0, 0, 0, 1, 0, 2, 0, 25, 0, 0, 0, 20, 0, 20, - 0, 0, 0, 1, 0, 0, 0, 0, 63, 76,204,205, 63, 76,204,205, 63, 76,204,205, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, - 63, 0, 0, 0, 63,128, 0, 0,191,100, 90, 30, 62,153,153,154, 63,102,102,102, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, - 62,254,250, 31, 63, 0, 0, 9, 63, 25,153,156, 0, 0, 0, 0, 62, 76,204,205, 62, 76,204,205, 62, 76,204,205, 63,128, 0, 0, - 63, 22,135, 44, 62,235,133, 32, 62,125,243,184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 76, 73,195, 63, 86,135, 42, - 63,128, 0, 0, 0, 0, 0, 0, 61,135, 43, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 62, 93, 47, 16,190,200,180, 58, -190, 93, 47, 24, 0, 0, 0, 0, 0, 14, 0, 0, 0, 25, 0, 15, 0,120, 0, 60, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 0, - 31,144, 0, 15, 0, 6, 0, 15, 0, 8, 0, 10, 0,250, 0, 0, 0,100, 0,100, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,192, 0, 0, 0, 16,162,160, 2, 0, 0, 0, 0, 58, 0, 0, 0, 8, 0, 0, 0, + 0, 0,128, 63,255,255,127, 63, 0, 0,128,191,230, 73,230, 73, 26,182,255, 0, 3, 0, 0, 0, 0, 0,128, 63, 0, 0,128,191, + 0, 0,128,191,230, 73, 26,182, 26,182,255, 0, 3, 0, 0, 0, 1, 0,128,191,253,255,127,191, 0, 0,128,191, 26,182, 26,182, + 26,182,255, 0, 3, 0, 0, 0,250,255,127,191, 3, 0,128, 63, 0, 0,128,191, 26,182,230, 73, 26,182,255, 0, 3, 0, 0, 0, + 4, 0,128, 63,247,255,127, 63, 0, 0,128, 63,230, 73,230, 73,230, 73,255, 0, 3, 0, 0, 0,245,255,127, 63, 5, 0,128,191, + 0, 0,128, 63,230, 73, 26,182,230, 73,255, 0, 3, 0, 0, 0, 3, 0,128,191,250,255,127,191, 0, 0,128, 63, 26,182, 26,182, +230, 73,255, 0, 3, 0, 0, 0,255,255,127,191, 0, 0,128, 63, 0, 0,128, 63, 26,182,230, 73,230, 73,255, 0, 3, 0, 0, 0, + 68, 65, 84, 65,104, 1, 0, 0, 16,163,160, 2, 0, 0, 0, 0, 56, 1, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,164,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,128, 0, 0, 63,128, 0, 0, - 63,128, 0, 0, 63,128, 0, 0, 63,128, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, - 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, - 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, - 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, - 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, - 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, - 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, - 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, - 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, - 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, - 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, - 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, - 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, - 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, - 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, - 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, - 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, - 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, - 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, - 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, - 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, - 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, - 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63,128, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 19, 8, 1, 7,216, 32, 0, 0, 0,170, 0, 0, 0, 1, 1, 7,236, 32, - 0, 0, 0, 0, 68,101,102, 97,117,108,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 25, 25, 25,255,153,153,153,255,100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0, 0, - 0, 0, 0, 0, 25, 25, 25,255,153,153,153,255,100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 0, 1, 0, 25, -255,231, 0, 0, 0, 0, 0,255, 70, 70, 70,255, 86,128,194,255,255,255,255,255,255,255,255,255, 0, 0, 0,255, 0, 1, 0, 15, -255,241, 0, 0, 25, 25, 25,255,153,153,153,255,153,153,153,255, 90, 90, 90,255, 0, 0, 0,255,255,255,255,255, 0, 1, 0, 0, - 0, 25, 0, 0, 0, 0, 0,255, 70, 70, 70,255, 70, 70, 70,255,255,255,255,255, 0, 0, 0,255,255,255,255,255, 0, 1, 0, 15, -255,241, 0, 0, 25, 25, 25,255,180,180,180,255,153,153,153,255, 90, 90, 90,255, 0, 0, 0,255,255,255,255,255, 0, 1,255,236, - 0, 0, 0, 0, 25, 25, 25,255,180,180,180,255,153,153,153,255,128,128,128,255, 0, 0, 0,255,255,255,255,255, 0, 1,255,236, - 0, 0, 0, 0, 0, 0, 0,255, 70, 70, 70,255, 70, 70, 70,255,255,255,255,255,255,255,255,255,204,204,204,255, 0, 1, 0, 15, -255,241, 0, 0, 0, 0, 0,255, 63, 63, 63,255, 86,128,194,255,255,255,255,255, 0, 0, 0,255, 0, 0, 0,255, 0, 0, 0, 25, -255,236, 0, 0, 0, 0, 0,255, 25, 25, 25,230, 46,124,217,204,255,255,255,255,255,255,255,255, 0, 0, 0,255, 0, 0, 0, 25, -255,236, 0, 0, 0, 0, 0,255, 0, 0, 0, 0, 86,128,194,255,255,255,255,255,255,255,255,255, 0, 0, 0,255, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255, -255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,130,130,130,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, -255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255, -219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, - 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 57, 57, 57,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, - 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, - 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18, -255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, - 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 90, 90,255, 0, 0, 0, 0,250,250,250,255, - 15, 15, 15,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,180,180,180,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,160,160,160,100,127,112,112,100,255,140, 25,255,250,250,250,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, -130,130,130,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255, -219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, - 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,250,250,250,255,250,250,250,255,250,250,250,255, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,102,102,102,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,255,255,255,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,150,150,150,100,112,112,112,100, 96,192, 64,255, - 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,255,140, 25,255, 79,101, 73,255,135,177,125,255,255,255,255,255, - 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18, -255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, - 82, 96,110,255,124,137,150,255, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -255,255,255,128, 0, 0, 0,255,255,133, 0,255, 3, 0, 0, 0, 0, 0, 0, 0,153,153,153,255, 0, 0, 0, 0, 0, 0, 0,255, -255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, -255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255, -219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, - 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,173,173,173,255,127,112,112,100, 0, 0, 0, 0, - 91, 91, 91,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, - 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18, -255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, - 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255, -255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,102,102,102,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,255,255,255,150, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,150,150,150,100,112,112,112,100, 96,192, 64,255, 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, -255,140, 25,255, 79,101, 73,255,135,177,125,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255, -219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, - 80,200,255, 80, 12, 10, 10,128,255,140, 0,255, 96,192, 64,255, 82, 96,110,255,124,137,150,255, 3, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0,255,255,133, 0,255, 3, 0, 0, 0, - 0, 0, 0, 0,116,116,116,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,172,172,172,255, 84, 44, 31,100, 17, 27, 60,100, - 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, - 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18, -255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,228,156,198,255,255,255,170,255, 96,192, 64,255, - 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,116,116,116,255, 0, 0, 0, 0, 0, 0, 0,255, -255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, -255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255, -219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, - 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81,105,135,255,109, 88,129,255, 78,152, 62,255, 46,143,143,255, -169, 84,124,255,126,126, 80,255,162, 95,111,255,109,145,131,255,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 53, 53, 53,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, - 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, - 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255,255,255,255, 10, -255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, - 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,110,110,110,255, 0, 0, 0, 0, 0, 0, 0,255, -255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,132,132,132,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255, 94, 94, 94,255,172,172,172,255, 17, 27, 60,100, 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, -195,195,195,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255, -219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, - 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,153,153,153,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,143,143,143,255,198,119,119,255,255, 0, 0,255, - 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, - 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18, -255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, - 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0,100, 0, 0,255, 0, 0,200,255,128, 0, 80,255, 95, 95, 0,255, 0,100, 50,255, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255, -255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, -255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255, -219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, - 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,173,173,173,255,127,112,112,100, 0, 0, 0, 0, - 91, 91, 91,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, - 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18, -255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, - 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 57, 57,255, 0, 0, 0, 0, 0, 0, 0,255, -255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255, -255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40, -255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,255,255,255, -219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, - 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0,150,150,150,255, -129,131,144,255,127,127,127,255,142,138,145,255,120,145,120,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,154, 0, 0,255,189, 17, 17,255,247, 10, 10,255, 0, 0, 0, 0,247, 64, 24,255,246,105, 19,255,250,153, 0,255, - 0, 0, 0, 0, 30,145, 9,255, 89,183, 11,255,131,239, 29,255, 0, 0, 0, 0, 10, 54,148,255, 54,103,223,255, 94,193,239,255, - 0, 0, 0, 0,169, 41, 78,255,193, 65,106,255,240, 93,145,255, 0, 0, 0, 0, 67, 12,120,255, 84, 58,163,255,135,100,213,255, - 0, 0, 0, 0, 36,120, 90,255, 60,149,121,255,111,182,171,255, 0, 0, 0, 0, 75,112,124,255,106,134,145,255,155,194,205,255, - 0, 0, 0, 0,244,201, 12,255,238,194, 54,255,243,255, 0,255, 0, 0, 0, 0, 30, 32, 36,255, 72, 76, 86,255,255,255,255,255, - 0, 0, 0, 0,111, 47,106,255,152, 69,190,255,211, 48,214,255, 0, 0, 0, 0,108,142, 34,255,127,176, 34,255,187,239, 91,255, - 0, 0, 0, 0,141,141,141,255,176,176,176,255,222,222,222,255, 0, 0, 0, 0,131, 67, 38,255,139, 88, 17,255,189,106, 17,255, - 0, 0, 0, 0, 8, 49, 14,255, 28, 67, 11,255, 52, 98, 43,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 0, 0, 19, 8, 1, 7,236, 32, 0, 0, 0,170, 0, 0, 0, 1, 0, 0, 0, 0, 1, 7,216, 32, - 82,111,117,110,100,101,100, 0, 0,101,119, 32, 85,115,101,114, 32, 84,104,101,109,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 25, 25, 25,255,153,153,153,255,100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, - 25, 25, 25,255,153,153,153,255,100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 0, 1, 0, 25,255,231, 0, 0, - 0, 0, 0,255, 70, 70, 70,255, 86,128,194,255,255,255,255,255,255,255,255,255, 0, 0, 0,255, 0, 1, 0, 15,255,241, 0, 0, - 25, 25, 25,255,153,153,153,255,153,153,153,255, 90, 90, 90,255, 0, 0, 0,255,255,255,255,255, 0, 1, 0, 0, 0, 25, 0, 0, - 0, 0, 0,255, 70, 70, 70,255, 70, 70, 70,255,255,255,255,255, 0, 0, 0,255,255,255,255,255, 0, 1, 0, 15,255,241, 0, 0, - 25, 25, 25,255,180,180,180,255,153,153,153,255, 90, 90, 90,255, 0, 0, 0,255,255,255,255,255, 0, 1,255,236, 0, 0, 0, 0, - 25, 25, 25,255,180,180,180,255,153,153,153,255,128,128,128,255, 0, 0, 0,255,255,255,255,255, 0, 1,255,236, 0, 0, 0, 0, - 0, 0, 0,255, 70, 70, 70,255, 70, 70, 70,255,255,255,255,255,255,255,255,255,204,204,204,255, 0, 1, 0, 15,255,241, 0, 0, - 0, 0, 0,255, 63, 63, 63,255, 86,128,194,255,255,255,255,255, 0, 0, 0,255, 0, 0, 0,255, 0, 0, 0, 25,255,236, 0, 0, - 0, 0, 0,255, 25, 25, 25,230, 46,124,217,204,255,255,255,255,255,255,255,255, 0, 0, 0,255, 0, 0, 0, 25,255,236, 0, 0, - 0, 0, 0,255, 0, 0, 0, 0, 86,128,194,255,255,255,255,255,255,255,255,255, 0, 0, 0,255, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, -107,107,107,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, -165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,175,175,175, 51, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, -160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, - 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 65, 84, 65,144, 0, 0, 0,192,164,160, 2, 0, 0, 0, 0, 55, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 35, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 35, 0, 1, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 35, 0, 1, 0, 0, 0, 5, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 35, 0, + 2, 0, 0, 0, 6, 0, 0, 0, 0, 0, 35, 0, 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 35, 0, 4, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, 35, 0, 6, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 35, 0, 68, 65, 84, 65,104, 1, 0, 0,144,165,160, 2, 0, 0, 0, 0, 56, 1, 0, 0, 5, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 64,167,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,120, 0, 0, 0, 64,167,160, 2, 0, 0, 0, 0, 54, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, + 5, 0, 0, 0, 6, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 2, 85, 83, 69, 82, 64, 11, 0, 0, + 96,184, 48, 2, 0, 0, 0, 0,175, 0, 0, 0, 1, 0, 0, 0, 33,152, 1, 0, 63, 2, 0, 0, 5, 0, 0, 0, 47,116,109,112, + 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 85, +115,101,114,115, 47,116,111,110, 47, 68,101,115,107,116,111,112, 47, 0, 45,112,111,119,101,114,112, 99, 47, 98,105,110, 47, 98, +108,101,110,100,101,114, 46, 97,112,112, 47, 67,111,110,116,101,110,116,115, 47, 82,101,115,111,117,114, 99,101, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 0, 0, 48, 52, 6, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 8, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, + 0, 0, 64, 0, 5, 0, 2, 0,208,179,160, 2, 0, 0, 0, 0,176,200,160, 2, 0, 0, 0, 0,112, 58,170, 2, 0, 0, 0, 0, +112, 58,170, 2, 0, 0, 0, 0, 0,168,170, 2, 0, 0, 0, 0, 0,168,170, 2, 0, 0, 0, 0, 32, 0, 0, 0, 1, 0, 2, 0, + 25, 0, 0, 0, 20, 0, 20, 0, 1, 0, 0, 0, 0, 0, 0, 0,205,204, 76, 63,205,204, 76, 63,205,204, 76, 63, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 30, 90,100,191,154,153,153, 62,102,102,102, 63, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 31,250,254, 62, 9, 0, 0, 63,156,153, 25, 63, 0, 0, 0, 0,205,204, 76, 62,205,204, 76, 62, +205,204, 76, 62, 0, 0,128, 63, 44,135, 22, 63, 32,133,235, 62,184,243,125, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +195, 73, 76, 63, 42,135, 86, 63, 0, 0,128, 63, 0, 0, 0, 0, 1, 43,135, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, + 16, 47, 93, 62, 58,180,200,190, 24, 47, 93,190, 0, 0, 0, 0, 14, 0, 0, 0, 25, 0, 15, 0,120, 0, 60, 0, 0, 0, 0, 0, +128, 0, 0, 0, 0, 0, 0, 0,144, 31, 15, 0, 6, 0, 15, 0, 8, 0, 10, 0,250, 0, 0, 0,100, 0,100, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, + 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, + 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, + 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, + 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, + 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, + 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, + 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, + 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, + 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, + 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, + 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, + 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, + 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, + 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, + 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, + 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 20, 0, 0,208,179,160, 2, 0, 0, 0, 0, +173, 0, 0, 0, 1, 0, 0, 0,176,200,160, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,101,102, 97,117,108,116, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25,255,153,153,153,255, +100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25,255,153,153,153,255, +100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 1, 0, 25, 0,231,255, 0, 0, 25, 25, 25,255,153,153,153,255, +153,153,153,255, 90, 90, 90,255, 0, 0, 0,255,255,255,255,255, 1, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0,255, 70, 70, 70,255, + 86,128,194,255,255,255,255,255,255,255,255,255, 0, 0, 0,255, 1, 0, 15, 0,241,255, 0, 0, 0, 0, 0,255, 70, 70, 70,255, + 70, 70, 70,255,255,255,255,255, 0, 0, 0,255,255,255,255,255, 1, 0, 15, 0,241,255, 0, 0, 25, 25, 25,255,153,153,153,255, +100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25,255,180,180,180,255, +153,153,153,255, 90, 90, 90,255, 0, 0, 0,255,255,255,255,255, 1, 0,236,255, 0, 0, 0, 0, 25, 25, 25,255,180,180,180,255, +153,153,153,255,128,128,128,255, 0, 0, 0,255,255,255,255,255, 1, 0,236,255, 0, 0, 0, 0, 0, 0, 0,255, 70, 70, 70,255, + 70, 70, 70,255,255,255,255,255,255,255,255,255,204,204,204,255, 1, 0, 15, 0,241,255, 0, 0, 0, 0, 0,255, 63, 63, 63,255, + 86,128,194,255,255,255,255,255, 0, 0, 0,255, 0, 0, 0,255, 0, 0, 25, 0,236,255, 0, 0, 0, 0, 0,255, 25, 25, 25,230, + 45, 45, 45,230,100,100,100,255,255,255,255,255,255,255,255,255, 0, 0, 25, 0,236,255, 0, 0, 0, 0, 0,255, 0, 0, 0, 0, + 86,128,194,255,255,255,255,255,255,255,255,255, 0, 0, 0,255, 0, 0, 38, 0, 0, 0, 0, 0, 25, 25, 25,255,128,128,128,255, +100,100,100,255, 25, 25, 25,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50,180, 80, 80, 80,180, +100,100,100,180,180,180,180,255, 0, 0, 0,255,255,255,255,255, 1, 0, 10, 0,236,255, 0, 0,115,190, 76,255, 90,166, 51,255, +240,235,100,255,215,211, 75,255,180, 0,255,255,153, 0,230,255, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,130,130,130,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, + 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255, +255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, + 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 57, 57,255, 0, 0, 0, 0, + 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, + 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255, +255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255, +200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 90, 90, 90,255, 0, 0, 0, 0,250,250,250,255, 15, 15, 15,255,114,114,114,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,180,180,180,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, +255,140, 25,255,250,250,250,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,130,130,130,255, 16, 64, 16,255, 85,187, 85,255, +255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, + 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,250,250,250,255,250,250,250,255,250,250,250,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, + 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,102,102,102,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,255,255,255,150, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,150,150,150,100,112,112,112,100, 96,192, 64,255, 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, + 0, 0, 0, 40,255,140, 25,255, 79,101, 73,255,135,177,125,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255, +255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255, +200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 82, 96,110,255,124,137,150,255, 3, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0,255,255,133, 0,255, + 3, 0, 0, 0, 0, 0, 0, 0,153,153,153,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, + 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255, +255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, + 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,114,114,114,255, 0, 0, 0, 0, + 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,173,173,173,255,127,112,112,100, 0, 0, 0, 0, 91, 91, 91,255, 0, 0, 0,255,241, 88, 0,255, + 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255, +255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255, +200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,102,102,102,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,255,255,255,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,150,150,150,100,112,112,112,100, + 96,192, 64,255, 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,255,140, 25,255, 79,101, 73,255,135,177,125,255, +255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, + 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 12, 10, 10,128,255,140, 0,255, + 96,192, 64,255, 82, 96,110,255,124,137,150,255, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255,128, 0, 0, 0,255,255,133, 0,255, 3, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, + 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,102,102,102,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,255,255,255,150, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,150,150,150,100,112,112,112,100, 96,192, 64,255, 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, + 0, 0, 0, 40,255,140, 25,255, 79,101, 73,255,135,177,125,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255, +255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255, +200,200,200,255, 80,200,255, 80, 12, 10, 10,128,255,140, 0,255, 96,192, 64,255, 82, 96,110,255,124,137,150,255, 3, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0,255,255,133, 0,255, + 3, 0, 0, 0, 0, 0, 0, 0,116,116,116,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, + 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255, +255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, + 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 81,105,135,255,109, 88,129,255, 78,152, 62,255, 46,143,143,255,169, 84,124,255,126,126, 80,255,162, 95,111,255, +109,145,131,255,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 53, 53,255, 0, 0, 0, 0, + 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, + 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255, +255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255,255,255,255, 10,255,133, 0, 60,255,133, 0,255, 34,221,221,255, +200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,110,110,110,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,132,132,132,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 94, 94, 94,255,172,172,172,255, + 17, 27, 60,100, 94, 94, 94,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,195,195,195,255, 16, 64, 16,255, 85,187, 85,255, +255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, + 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,153,153,153,255, 0, 0, 0, 0, + 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,143,143,143,255,198,119,119,255,255, 0, 0,255, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, + 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255, +255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255, +200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, +100, 0, 0,255, 0, 0,200,255,128, 0, 80,255, 95, 95, 0,255, 0,100, 50,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,114,114,114,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, + 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255, +255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, + 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,114,114,114,255, 0, 0, 0, 0, + 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,173,173,173,255,127,112,112,100, 0, 0, 0, 0, 91, 91, 91,255, 0, 0, 0,255,241, 88, 0,255, + 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255, +255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255, +200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 57, 57, 57,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, + 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255, +255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255,255,255,255,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, + 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0,150,150,150,255,129,131,144,255,127,127,127,255,142,138,145,255, +120,145,120,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100,100,100,255, 0, 0, 0, 0, + 0, 0, 0,255,255,255,255,255,114,114,114,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,127, 0, 0, 0,255, + 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 64, 64, 64,255, 0, 0, 0,255,241, 88, 0,255, + 0, 0, 0, 40,255,140, 25,255, 16, 64, 16,255, 85,187, 85,255,255,255,255,255, 0, 0, 0,255,255,133, 0,255, 0, 0, 0,255, +255,160, 0,255,219, 37, 18,255,255, 32, 32,255, 75, 75, 75,255, 0, 0, 0, 18,255,133, 0, 60,255,133, 0,255, 34,221,221,255, +200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,154, 0, 0,255,189, 17, 17,255,247, 10, 10,255, 0, 0, 0, 0,247, 64, 24,255,246,105, 19,255, +250,153, 0,255, 0, 0, 0, 0, 30,145, 9,255, 89,183, 11,255,131,239, 29,255, 0, 0, 0, 0, 10, 54,148,255, 54,103,223,255, + 94,193,239,255, 0, 0, 0, 0,169, 41, 78,255,193, 65,106,255,240, 93,145,255, 0, 0, 0, 0, 67, 12,120,255, 84, 58,163,255, +135,100,213,255, 0, 0, 0, 0, 36,120, 90,255, 60,149,121,255,111,182,171,255, 0, 0, 0, 0, 75,112,124,255,106,134,145,255, +155,194,205,255, 0, 0, 0, 0,244,201, 12,255,238,194, 54,255,243,255, 0,255, 0, 0, 0, 0, 30, 32, 36,255, 72, 76, 86,255, +255,255,255,255, 0, 0, 0, 0,111, 47,106,255,152, 69,190,255,211, 48,214,255, 0, 0, 0, 0,108,142, 34,255,127,176, 34,255, +187,239, 91,255, 0, 0, 0, 0,141,141,141,255,176,176,176,255,222,222,222,255, 0, 0, 0, 0,131, 67, 38,255,139, 88, 17,255, +189,106, 17,255, 0, 0, 0, 0, 8, 49, 14,255, 28, 67, 11,255, 52, 98, 43,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 20, 0, 0,176,200,160, 2, 0, 0, 0, 0,173, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,208,179,160, 2, 0, 0, 0, 0, 82,111,117,110,100,101,100, 0, 0,101,119, 32, 85,115,101,114, + 32, 84,104,101,109,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25,255,153,153,153,255,100,100,100,255, 25, 25, 25,255, + 0, 0, 0,255,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25,255,153,153,153,255,100,100,100,255, 25, 25, 25,255, + 0, 0, 0,255,255,255,255,255, 1, 0, 25, 0,231,255, 0, 0, 25, 25, 25,255,153,153,153,255,153,153,153,255, 90, 90, 90,255, + 0, 0, 0,255,255,255,255,255, 1, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0,255, 70, 70, 70,255, 86,128,194,255,255,255,255,255, +255,255,255,255, 0, 0, 0,255, 1, 0, 15, 0,241,255, 0, 0, 0, 0, 0,255, 70, 70, 70,255, 70, 70, 70,255,255,255,255,255, + 0, 0, 0,255,255,255,255,255, 1, 0, 15, 0,241,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25,255,180,180,180,255,153,153,153,255, 90, 90, 90,255, + 0, 0, 0,255,255,255,255,255, 1, 0,236,255, 0, 0, 0, 0, 25, 25, 25,255,180,180,180,255,153,153,153,255,128,128,128,255, + 0, 0, 0,255,255,255,255,255, 1, 0,236,255, 0, 0, 0, 0, 0, 0, 0,255, 70, 70, 70,255, 70, 70, 70,255,255,255,255,255, +255,255,255,255,204,204,204,255, 1, 0, 15, 0,241,255, 0, 0, 0, 0, 0,255, 63, 63, 63,255, 86,128,194,255,255,255,255,255, + 0, 0, 0,255, 0, 0, 0,255, 0, 0, 25, 0,236,255, 0, 0, 0, 0, 0,255, 25, 25, 25,230, 46,124,217,204,255,255,255,255, +255,255,255,255, 0, 0, 0,255, 0, 0, 25, 0,236,255, 0, 0, 0, 0, 0,255, 0, 0, 0, 0, 86,128,194,255,255,255,255,255, +255,255,255,255, 0, 0, 0,255, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,107,107,107,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, - 0, 0, 0, 51, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0,143,143,143,255, - 0, 0, 0,255,217,217,217,255, 0, 0, 0, 40,255,255,255,255, 16, 64, 16,255,102,255,102,255,255,130, 0,255, 0, 0, 0,255, -255,130, 0,255, 0, 0, 0,255,255,255,255,255,230,150, 50,255,255, 32, 32,255, 0, 0, 0, 0,255,255,255, 10,255,130, 0, 60, -255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, +175,175,175, 51, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, + 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255, +255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, 107,107,107,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, -165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, -160,160,160,100,127,112,112,100,255,130, 0,255, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, - 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0, 51, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, +160,160,160,100,127,112,112,100, 0, 0, 0, 0,143,143,143,255, 0, 0, 0,255,217,217,217,255, 0, 0, 0, 40,255,255,255,255, + 16, 64, 16,255,102,255,102,255,255,130, 0,255, 0, 0, 0,255,255,130, 0,255, 0, 0, 0,255,255,255,255,255,230,150, 50,255, +255, 32, 32,255, 0, 0, 0, 0,255,255,255, 10,255,130, 0, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, + 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,107,107,107,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, -107,107,107,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,107,107,107,100,143,143,143,100, 96,192, 64,255, 94, 94, 94,255, - 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, 79,101, 73,255,135,177,125,255,255,255,255,255,255,255,255,255, -255,130, 0,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 82, 96,110,255, -124,137,150,255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100,255,130, 0,255, 88, 88, 88,255, + 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255, +255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -255,255,255,255,255,130, 0,255, 2, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, 107,107,107,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, -165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, -160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, - 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, +165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,107,107,107,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, +107,107,107,100,143,143,143,100, 96,192, 64,255, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, + 79,101, 73,255,135,177,125,255,255,255,255,255,255,255,255,255,255,130, 0,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 82, 96,110,255,124,137,150,255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -158,158,158,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,158,158,158,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,130, 0,255, 2, 0, 0, 0, 0, 0, 0, 0, +107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,107,107,107,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, -165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,140,140,140,255,127,112,112,100, 0, 0, 0, 0,112,112, 96,255, +165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255, 255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, -107,107,107,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,158,158,158,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, +158,158,158,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, -107,107,107,255,178,178,178,100,255,130, 0,100, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, - 79,101, 73,255,135,177,125,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,143,143,143,255,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -228,156,198,204,255,255,170,204, 96,192, 64,255, 82, 96,110,255,124,137,150,255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +140,140,140,255,127,112,112,100, 0, 0, 0, 0,112,112, 96,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,143,143,143,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, +107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,107,107,107,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,107,107,107,255,178,178,178,100,255,130, 0,100, 94, 94, 94,255, - 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255, -255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,228,156,198,255,255,255,170,255, 96,192, 64,255, 0, 0, 0, 0, - 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, 79,101, 73,255,135,177,125,255,255,255,255,255,255,112,255,255, +255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,143,143,143,255,200,100,200, 60, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,228,156,198,204,255,255,170,204, 96,192, 64,255, 82, 96,110,255, +124,137,150,255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, -107,107,107,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, +143,143,143,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, -160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, - 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,130, 0,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,200,255,255, - 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81,105,135,255,109, 88,129,255, 78,152, 62,255, 46,143,143,255,169, 84,124,255, -126,126, 80,255,162, 95,111,255,109,145,131,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 53, 53, 53,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,195,195,195,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, +107,107,107,255,178,178,178,100,255,130, 0,100, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +228,156,198,255,255,255,170,255, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,107,107,107,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255, -255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, -255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 80,200,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, +255,130, 0,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,200,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81,105,135,255, +109, 88,129,255, 78,152, 62,255, 46,143,143,255,169, 84,124,255,126,126, 80,255,162, 95,111,255,109,145,131,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 53, 53,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, 195,195,195,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, -143,143,143,255,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, +160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60,255,133, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 80,200,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -153,153,153,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,153,153,153,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,195,195,195,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, -165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,143,143,143,255,198,119,119,255,255, 0, 0,255, 88, 88, 88,255, +165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,143,143,143,255,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255, 255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 2, 0, 0, 0,100, 0, 0,255, 0, 0,200,255,128, 0, 80,255, 95, 95, 0,255, 0,100, 50,255, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, -107,107,107,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,153,153,153,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, +153,153,153,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, -160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, +143,143,143,255,198,119,119,255,255, 0, 0,255, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,100, 0, 0,255, 0, 0,200,255, +128, 0, 80,255, 95, 95, 0,255, 0,100, 50,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -158,158,158,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,158,158,158,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, +107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,107,107,107,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, -165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,140,140,140,255,127,112,112,100, 0, 0, 0, 0,112,112, 96,255, +165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255, 255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,158,158,158,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, +158,158,158,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, +165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,150, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, +140,140,140,255,127,112,112,100, 0, 0, 0, 0,112,112, 96,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, + 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +107,107,107,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255,107,107,107,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, +145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, + 0, 0, 0, 51, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,160,160,160,100,127,112,112,100, 0, 0, 0, 0,143,143,143,255, + 0, 0, 0,255,217,217,217,255, 0, 0, 0, 40,255,255,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,130, 0,255, 0, 0, 0,255, +255,130, 0,255, 0, 0, 0,255,255,255,255,255,230,150, 50,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 10,255,130, 0, 60, +255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 4, 0, 0,150,150,150,255,129,131,144,255,127,127,127,255,142,138,145,255,120,145,120,255, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100,100,100,255, 0, 0, 0, 0, 0, 0, 0,255,255,255,255,255, 107,107,107,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255,145,145,145,245, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 165,165,165,255, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0, 51, 0, 0, 0,255, 0, 0, 0,255,255,255,255,255, 160,160,160,100,127,112,112,100, 0, 0, 0, 0,143,143,143,255, 0, 0, 0,255,217,217,217,255, 0, 0, 0, 40,255,255,255,255, - 0, 0, 0, 0, 0, 0, 0, 0,255,130, 0,255, 0, 0, 0,255,255,130, 0,255, 0, 0, 0,255,255,255,255,255,230,150, 50,255, - 0, 0, 0, 0, 0, 0, 0, 0,255,255,255, 10,255,130, 0, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0,150,150,150,255,129,131,144,255, -127,127,127,255,142,138,145,255,120,145,120,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 16, 64, 16,255,102,255,102,255,255,130, 0,255, 0, 0, 0,255,255,130, 0,255, 0, 0, 0,255,255,255,255,255,230,150, 50,255, +255, 32, 32,255, 0, 0, 0, 0,255,255,255, 10,255,130, 0, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, + 0, 0, 0, 0, 0, 0, 0, 0, 96,192, 64,255, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,255,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 154, 0, 0,255,189, 17, 17,255,247, 10, 10,255, 0, 0, 0, 0,247, 64, 24,255,246,105, 19,255,250,153, 0,255, 0, 0, 0, 0, 30,145, 9,255, 89,183, 11,255,131,239, 29,255, 0, 0, 0, 0, 10, 54,148,255, 54,103,223,255, 94,193,239,255, 0, 0, 0, 0, 169, 41, 78,255,193, 65,106,255,240, 93,145,255, 0, 0, 0, 0, 67, 12,120,255, 84, 58,163,255,135,100,213,255, 0, 0, 0, 0, @@ -1288,589 +1660,602 @@ char datatoc_B_blend[]= { 8, 49, 14,255, 28, 67, 11,255, 52, 98, 43,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 78, 65, 49, 0, 0,203, 56, 6, 62, 16, 32, 0, 0, 0, 0, 0, 0, 0, 1, 83, 68, 78, 65, 78, 65, 77, 69, 0, 0, 10, 5, - 42,110,101,120,116, 0, 42,112,114,101,118, 0, 42,100, 97,116, 97, 0, 42,102,105,114,115,116, 0, 42,108, 97,115,116, 0,120, - 0,121, 0,122, 0,119, 0,120,109,105,110, 0,120,109, 97,120, 0,121,109,105,110, 0,121,109, 97,120, 0, 42,112,111,105,110, -116,101,114, 0,103,114,111,117,112, 0,118, 97,108, 0,118, 97,108, 50, 0,116,121,112,101, 0,115,117, 98,116,121,112,101, 0, -102,108, 97,103, 0,110, 97,109,101, 91, 51, 50, 93, 0,115, 97,118,101,100, 0,100, 97,116, 97, 0,108,101,110, 0,116,111,116, - 97,108,108,101,110, 0, 42,110,101,119,105,100, 0, 42,108,105, 98, 0,110, 97,109,101, 91, 50, 52, 93, 0,117,115, 0,105, 99, -111,110, 95,105,100, 0, 42,112,114,111,112,101,114,116,105,101,115, 0,105,100, 0, 42,105,100, 98,108,111, 99,107, 0, 42,102, -105,108,101,100, 97,116, 97, 0,110, 97,109,101, 91, 50, 52, 48, 93, 0,102,105,108,101,110, 97,109,101, 91, 50, 52, 48, 93, 0, -116,111,116, 0,112, 97,100, 0, 42,112, 97,114,101,110,116, 0,119, 91, 50, 93, 0,104, 91, 50, 93, 0, 99,104, 97,110,103,101, -100, 91, 50, 93, 0,112, 97,100, 48, 0,112, 97,100, 49, 0, 42,114,101, 99,116, 91, 50, 93, 0, 42,111, 98, 0, 98,108,111, 99, -107,116,121,112,101, 0, 97,100,114, 99,111,100,101, 0,110, 97,109,101, 91, 49, 50, 56, 93, 0, 42, 98,112, 0, 42, 98,101,122, -116, 0,109, 97,120,114, 99,116, 0,116,111,116,114, 99,116, 0,118, 97,114,116,121,112,101, 0,116,111,116,118,101,114,116, 0, -105,112,111, 0,101,120,116,114, 97,112, 0,114,116, 0, 98,105,116,109, 97,115,107, 0,115,108,105,100,101, 95,109,105,110, 0, -115,108,105,100,101, 95,109, 97,120, 0, 99,117,114,118, 97,108, 0, 42,100,114,105,118,101,114, 0, 99,117,114,118,101, 0, 99, -117,114, 0,115,104,111,119,107,101,121, 0,109,117,116,101,105,112,111, 0,112,111,115, 0,114,101,108, 97,116,105,118,101, 0, -116,111,116,101,108,101,109, 0,112, 97,100, 50, 0, 42,119,101,105,103,104,116,115, 0,118,103,114,111,117,112, 91, 51, 50, 93, - 0,115,108,105,100,101,114,109,105,110, 0,115,108,105,100,101,114,109, 97,120, 0, 42, 97,100,116, 0, 42,114,101,102,107,101, -121, 0,101,108,101,109,115,116,114, 91, 51, 50, 93, 0,101,108,101,109,115,105,122,101, 0, 98,108,111, 99,107, 0, 42,105,112, -111, 0, 42,102,114,111,109, 0,116,111,116,107,101,121, 0,115,108,117,114,112,104, 0, 42, 42,115, 99,114,105,112,116,115, 0, - 42,102,108, 97,103, 0, 97, 99,116,115, 99,114,105,112,116, 0,116,111,116,115, 99,114,105,112,116, 0, 42,108,105,110,101, 0, - 42,102,111,114,109, 97,116, 0, 98,108,101,110, 0,108,105,110,101,110,111, 0,115,116, 97,114,116, 0,101,110,100, 0,102,108, - 97,103,115, 0, 99,111,108,111,114, 91, 52, 93, 0,112, 97,100, 91, 52, 93, 0, 42,110, 97,109,101, 0,110,108,105,110,101,115, - 0,108,105,110,101,115, 0, 42, 99,117,114,108, 0, 42,115,101,108,108, 0, 99,117,114, 99, 0,115,101,108, 99, 0,109, 97,114, -107,101,114,115, 0, 42,117,110,100,111, 95, 98,117,102, 0,117,110,100,111, 95,112,111,115, 0,117,110,100,111, 95,108,101,110, - 0, 42, 99,111,109,112,105,108,101,100, 0,109,116,105,109,101, 0,115,105,122,101, 0,115,101,101,107, 0,112, 97,115,115,101, -112, 97,114,116, 97,108,112,104, 97, 0, 97,110,103,108,101, 0, 99,108,105,112,115,116, 97, 0, 99,108,105,112,101,110,100, 0, -108,101,110,115, 0,111,114,116,104,111, 95,115, 99, 97,108,101, 0,100,114, 97,119,115,105,122,101, 0,115,104,105,102,116,120, - 0,115,104,105,102,116,121, 0, 89, 70, 95,100,111,102,100,105,115,116, 0, 89, 70, 95, 97,112,101,114,116,117,114,101, 0, 89, - 70, 95, 98,107,104,116,121,112,101, 0, 89, 70, 95, 98,107,104, 98,105, 97,115, 0, 89, 70, 95, 98,107,104,114,111,116, 0,115, - 99,114,105,112,116,108,105,110,107, 0, 42,100,111,102, 95,111, 98, 0,102,114, 97,109,101,110,114, 0,102,114, 97,109,101,115, - 0,111,102,102,115,101,116, 0,115,102,114, 97, 0,102,105,101, 95,105,109, 97, 0, 99,121, 99,108, 0,111,107, 0,109,117,108, -116,105, 95,105,110,100,101,120, 0,108, 97,121,101,114, 0,112, 97,115,115, 0,109,101,110,117,110,114, 0, 42,115, 99,101,110, -101, 0,105, 98,117,102,115, 0, 42,103,112,117,116,101,120,116,117,114,101, 0, 42, 97,110,105,109, 0, 42,114,114, 0,115,111, -117,114, 99,101, 0,108, 97,115,116,102,114, 97,109,101, 0,116,112, 97,103,101,102,108, 97,103, 0,116,111,116, 98,105,110,100, - 0,120,114,101,112, 0,121,114,101,112, 0,116,119,115,116, 97, 0,116,119,101,110,100, 0, 98,105,110,100, 99,111,100,101, 0, - 42,114,101,112, 98,105,110,100, 0, 42,112, 97, 99,107,101,100,102,105,108,101, 0, 42,112,114,101,118,105,101,119, 0,108, 97, -115,116,117,112,100, 97,116,101, 0,108, 97,115,116,117,115,101,100, 0, 97,110,105,109,115,112,101,101,100, 0,103,101,110, 95, -120, 0,103,101,110, 95,121, 0,103,101,110, 95,116,121,112,101, 0, 97,115,112,120, 0, 97,115,112,121, 0,116,101,120, 99,111, - 0,109, 97,112,116,111, 0,109, 97,112,116,111,110,101,103, 0, 98,108,101,110,100,116,121,112,101, 0, 42,111, 98,106,101, 99, -116, 0, 42,116,101,120, 0,117,118,110, 97,109,101, 91, 51, 50, 93, 0,112,114,111,106,120, 0,112,114,111,106,121, 0,112,114, -111,106,122, 0,109, 97,112,112,105,110,103, 0,111,102,115, 91, 51, 93, 0,115,105,122,101, 91, 51, 93, 0,116,101,120,102,108, - 97,103, 0, 99,111,108,111,114,109,111,100,101,108, 0,112,109, 97,112,116,111, 0,112,109, 97,112,116,111,110,101,103, 0,110, -111,114,109, 97,112,115,112, 97, 99,101, 0,119,104,105, 99,104, 95,111,117,116,112,117,116, 0,112, 97,100, 91, 50, 93, 0,114, - 0,103, 0, 98, 0,107, 0,100,101,102, 95,118, 97,114, 0, 99,111,108,102, 97, 99, 0,110,111,114,102, 97, 99, 0,118, 97,114, -102, 97, 99, 0,100,105,115,112,102, 97, 99, 0,119, 97,114,112,102, 97, 99, 0,110, 97,109,101, 91, 49, 54, 48, 93, 0, 42,104, - 97,110,100,108,101, 0, 42,112,110, 97,109,101, 0, 42,115,116,110, 97,109,101,115, 0,115,116,121,112,101,115, 0,118, 97,114, -115, 0, 42,118, 97,114,115,116,114, 0, 42,114,101,115,117,108,116, 0, 42, 99,102,114, 97, 0,100, 97,116, 97, 91, 51, 50, 93, - 0, 40, 42,100,111,105,116, 41, 40, 41, 0, 40, 42,105,110,115,116, 97,110, 99,101, 95,105,110,105,116, 41, 40, 41, 0, 40, 42, - 99, 97,108,108, 98, 97, 99,107, 41, 40, 41, 0,118,101,114,115,105,111,110, 0, 97, 0,105,112,111,116,121,112,101, 0, 42,105, -109, 97, 0, 42, 99,117, 98,101, 91, 54, 93, 0,105,109, 97,116, 91, 52, 93, 91, 52, 93, 0,111, 98,105,109, 97,116, 91, 51, 93, - 91, 51, 93, 0,115,116,121,112,101, 0,118,105,101,119,115, 99, 97,108,101, 0,110,111,116,108, 97,121, 0, 99,117, 98,101,114, -101,115, 0,100,101,112,116,104, 0,114,101, 99, 97,108, 99, 0,108, 97,115,116,115,105,122,101, 0,110,111,105,115,101,115,105, -122,101, 0,116,117,114, 98,117,108, 0, 98,114,105,103,104,116, 0, 99,111,110,116,114, 97,115,116, 0,114,102, 97, 99, 0,103, -102, 97, 99, 0, 98,102, 97, 99, 0,102,105,108,116,101,114,115,105,122,101, 0,109,103, 95, 72, 0,109,103, 95,108, 97, 99,117, -110, 97,114,105,116,121, 0,109,103, 95,111, 99,116, 97,118,101,115, 0,109,103, 95,111,102,102,115,101,116, 0,109,103, 95,103, - 97,105,110, 0,100,105,115,116, 95, 97,109,111,117,110,116, 0,110,115, 95,111,117,116,115, 99, 97,108,101, 0,118,110, 95,119, - 49, 0,118,110, 95,119, 50, 0,118,110, 95,119, 51, 0,118,110, 95,119, 52, 0,118,110, 95,109,101,120,112, 0,118,110, 95,100, -105,115,116,109, 0,118,110, 95, 99,111,108,116,121,112,101, 0,110,111,105,115,101,100,101,112,116,104, 0,110,111,105,115,101, -116,121,112,101, 0,110,111,105,115,101, 98, 97,115,105,115, 0,110,111,105,115,101, 98, 97,115,105,115, 50, 0,105,109, 97,102, -108, 97,103, 0, 99,114,111,112,120,109,105,110, 0, 99,114,111,112,121,109,105,110, 0, 99,114,111,112,120,109, 97,120, 0, 99, -114,111,112,121,109, 97,120, 0,120,114,101,112,101, 97,116, 0,121,114,101,112,101, 97,116, 0,101,120,116,101,110,100, 0, 99, -104,101, 99,107,101,114,100,105,115,116, 0,110, 97, 98,108, 97, 0,105,117,115,101,114, 0, 42,110,111,100,101,116,114,101,101, - 0, 42,112,108,117,103,105,110, 0, 42, 99,111, 98, 97, 0, 42,101,110,118, 0,117,115,101, 95,110,111,100,101,115, 0,112, 97, -100, 91, 55, 93, 0,108,111, 99, 91, 51, 93, 0,114,111,116, 91, 51, 93, 0,109, 97,116, 91, 52, 93, 91, 52, 93, 0,109,105,110, - 91, 51, 93, 0,109, 97,120, 91, 51, 93, 0,109,111,100,101, 0,116,111,116,101,120, 0,115,104,100,119,114, 0,115,104,100,119, -103, 0,115,104,100,119, 98, 0,115,104,100,119,112, 97,100, 0,101,110,101,114,103,121, 0,100,105,115,116, 0,115,112,111,116, -115,105,122,101, 0,115,112,111,116, 98,108,101,110,100, 0,104, 97,105,110,116, 0, 97,116,116, 49, 0, 97,116,116, 50, 0, 42, - 99,117,114,102, 97,108,108,111,102,102, 0,102, 97,108,108,111,102,102, 95,116,121,112,101, 0,115,104, 97,100,115,112,111,116, -115,105,122,101, 0, 98,105, 97,115, 0,115,111,102,116, 0, 98,117,102,115,105,122,101, 0,115, 97,109,112, 0, 98,117,102,102, -101,114,115, 0,102,105,108,116,101,114,116,121,112,101, 0, 98,117,102,102,108, 97,103, 0, 98,117,102,116,121,112,101, 0,114, - 97,121, 95,115, 97,109,112, 0,114, 97,121, 95,115, 97,109,112,121, 0,114, 97,121, 95,115, 97,109,112,122, 0,114, 97,121, 95, -115, 97,109,112, 95,116,121,112,101, 0, 97,114,101, 97, 95,115,104, 97,112,101, 0, 97,114,101, 97, 95,115,105,122,101, 0, 97, -114,101, 97, 95,115,105,122,101,121, 0, 97,114,101, 97, 95,115,105,122,101,122, 0, 97,100, 97,112,116, 95,116,104,114,101,115, -104, 0,114, 97,121, 95,115, 97,109,112, 95,109,101,116,104,111,100, 0,116,101,120, 97, 99,116, 0,115,104, 97,100,104, 97,108, -111,115,116,101,112, 0,115,117,110, 95,101,102,102,101, 99,116, 95,116,121,112,101, 0,115,107,121, 98,108,101,110,100,116,121, -112,101, 0,104,111,114,105,122,111,110, 95, 98,114,105,103,104,116,110,101,115,115, 0,115,112,114,101, 97,100, 0,115,117,110, - 95, 98,114,105,103,104,116,110,101,115,115, 0,115,117,110, 95,115,105,122,101, 0, 98, 97, 99,107,115, 99, 97,116,116,101,114, -101,100, 95,108,105,103,104,116, 0,115,117,110, 95,105,110,116,101,110,115,105,116,121, 0, 97,116,109, 95,116,117,114, 98,105, -100,105,116,121, 0, 97,116,109, 95,105,110,115, 99, 97,116,116,101,114,105,110,103, 95,102, 97, 99,116,111,114, 0, 97,116,109, - 95,101,120,116,105,110, 99,116,105,111,110, 95,102, 97, 99,116,111,114, 0, 97,116,109, 95,100,105,115,116, 97,110, 99,101, 95, -102, 97, 99,116,111,114, 0,115,107,121, 98,108,101,110,100,102, 97, 99, 0,115,107,121, 95,101,120,112,111,115,117,114,101, 0, -115,107,121, 95, 99,111,108,111,114,115,112, 97, 99,101, 0,112, 97,100, 52, 0, 89, 70, 95,110,117,109,112,104,111,116,111,110, -115, 0, 89, 70, 95,110,117,109,115,101, 97,114, 99,104, 0, 89, 70, 95,112,104,100,101,112,116,104, 0, 89, 70, 95,117,115,101, -113,109, 99, 0, 89, 70, 95, 98,117,102,115,105,122,101, 0, 89, 70, 95,112, 97,100, 0, 89, 70, 95, 99, 97,117,115,116,105, 99, - 98,108,117,114, 0, 89, 70, 95,108,116,114, 97,100,105,117,115, 0, 89, 70, 95,103,108,111,119,105,110,116, 0, 89, 70, 95,103, -108,111,119,111,102,115, 0, 89, 70, 95,103,108,111,119,116,121,112,101, 0, 89, 70, 95,112, 97,100, 50, 0, 42,109,116,101,120, - 91, 49, 56, 93, 0,109, 97,116,101,114,105, 97,108, 95,116,121,112,101, 0,115,112,101, 99,114, 0,115,112,101, 99,103, 0,115, -112,101, 99, 98, 0,109,105,114,114, 0,109,105,114,103, 0,109,105,114, 98, 0, 97,109, 98,114, 0, 97,109, 98, 98, 0, 97,109, - 98,103, 0, 97,109, 98, 0,101,109,105,116, 0, 97,110,103, 0,115,112,101, 99,116,114, 97, 0,114, 97,121, 95,109,105,114,114, -111,114, 0, 97,108,112,104, 97, 0,114,101,102, 0,115,112,101, 99, 0,122,111,102,102,115, 0, 97,100,100, 0,116,114, 97,110, -115,108,117, 99,101,110, 99,121, 0,102,114,101,115,110,101,108, 95,109,105,114, 0,102,114,101,115,110,101,108, 95,109,105,114, - 95,105, 0,102,114,101,115,110,101,108, 95,116,114, 97, 0,102,114,101,115,110,101,108, 95,116,114, 97, 95,105, 0,102,105,108, -116,101,114, 0,116,120, 95,108,105,109,105,116, 0,116,120, 95,102, 97,108,108,111,102,102, 0,114, 97,121, 95,100,101,112,116, -104, 0,114, 97,121, 95,100,101,112,116,104, 95,116,114, 97, 0,104, 97,114, 0,115,101,101,100, 49, 0,115,101,101,100, 50, 0, -103,108,111,115,115, 95,109,105,114, 0,103,108,111,115,115, 95,116,114, 97, 0,115, 97,109,112, 95,103,108,111,115,115, 95,109, -105,114, 0,115, 97,109,112, 95,103,108,111,115,115, 95,116,114, 97, 0, 97,100, 97,112,116, 95,116,104,114,101,115,104, 95,109, -105,114, 0, 97,100, 97,112,116, 95,116,104,114,101,115,104, 95,116,114, 97, 0, 97,110,105,115,111, 95,103,108,111,115,115, 95, -109,105,114, 0,100,105,115,116, 95,109,105,114, 0,102, 97,100,101,116,111, 95,109,105,114, 0,115,104, 97,100,101, 95,102,108, - 97,103, 0,109,111,100,101, 95,108, 0,102,108, 97,114,101, 99, 0,115,116, 97,114, 99, 0,108,105,110,101, 99, 0,114,105,110, -103, 99, 0,104, 97,115,105,122,101, 0,102,108, 97,114,101,115,105,122,101, 0,115,117, 98,115,105,122,101, 0,102,108, 97,114, -101, 98,111,111,115,116, 0,115,116,114, 97,110,100, 95,115,116, 97, 0,115,116,114, 97,110,100, 95,101,110,100, 0,115,116,114, - 97,110,100, 95,101, 97,115,101, 0,115,116,114, 97,110,100, 95,115,117,114,102,110,111,114, 0,115,116,114, 97,110,100, 95,109, -105,110, 0,115,116,114, 97,110,100, 95,119,105,100,116,104,102, 97,100,101, 0,115,116,114, 97,110,100, 95,117,118,110, 97,109, -101, 91, 51, 50, 93, 0,115, 98,105, 97,115, 0,108, 98,105, 97,115, 0,115,104, 97,100, 95, 97,108,112,104, 97, 0,115,101,112, -116,101,120, 0,114,103, 98,115,101,108, 0,112,114, 95,116,121,112,101, 0,112,114, 95, 98, 97, 99,107, 0,112,114, 95,108, 97, -109,112, 0,109,108, 95,102,108, 97,103, 0,100,105,102,102, 95,115,104, 97,100,101,114, 0,115,112,101, 99, 95,115,104, 97,100, -101,114, 0,114,111,117,103,104,110,101,115,115, 0,114,101,102,114, 97, 99, 0,112, 97,114, 97,109, 91, 52, 93, 0,114,109,115, - 0,100, 97,114,107,110,101,115,115, 0, 42,114, 97,109,112, 95, 99,111,108, 0, 42,114, 97,109,112, 95,115,112,101, 99, 0,114, - 97,109,112,105,110, 95, 99,111,108, 0,114, 97,109,112,105,110, 95,115,112,101, 99, 0,114, 97,109,112, 98,108,101,110,100, 95, - 99,111,108, 0,114, 97,109,112, 98,108,101,110,100, 95,115,112,101, 99, 0,114, 97,109,112, 95,115,104,111,119, 0,112, 97,100, - 51, 0,114, 97,109,112,102, 97, 99, 95, 99,111,108, 0,114, 97,109,112,102, 97, 99, 95,115,112,101, 99, 0, 42,103,114,111,117, -112, 0,102,114,105, 99,116,105,111,110, 0,102,104, 0,114,101,102,108,101, 99,116, 0,102,104,100,105,115,116, 0,120,121,102, -114,105, 99,116, 0,100,121,110, 97,109,111,100,101, 0,115,115,115, 95,114, 97,100,105,117,115, 91, 51, 93, 0,115,115,115, 95, - 99,111,108, 91, 51, 93, 0,115,115,115, 95,101,114,114,111,114, 0,115,115,115, 95,115, 99, 97,108,101, 0,115,115,115, 95,105, -111,114, 0,115,115,115, 95, 99,111,108,102, 97, 99, 0,115,115,115, 95,116,101,120,102, 97, 99, 0,115,115,115, 95,102,114,111, -110,116, 0,115,115,115, 95, 98, 97, 99,107, 0,115,115,115, 95,102,108, 97,103, 0,115,115,115, 95,112,114,101,115,101,116, 0, - 89, 70, 95, 97,114, 0, 89, 70, 95, 97,103, 0, 89, 70, 95, 97, 98, 0, 89, 70, 95,100,115, 99, 97,108,101, 0, 89, 70, 95,100, -112,119,114, 0, 89, 70, 95,100,115,109,112, 0, 89, 70, 95,112,114,101,115,101,116, 0, 89, 70, 95,100,106,105,116, 0,103,112, -117,109, 97,116,101,114,105, 97,108, 0,110, 97,109,101, 91, 50, 53, 54, 93, 0, 42, 98, 98, 0,105, 49, 0,106, 49, 0,107, 49, - 0,105, 50, 0,106, 50, 0,107, 50, 0,115,101,108, 99,111,108, 49, 0,115,101,108, 99,111,108, 50, 0,113,117, 97,116, 91, 52, - 93, 0,101,120,112,120, 0,101,120,112,121, 0,101,120,112,122, 0,114, 97,100, 0,114, 97,100, 50, 0,115, 0, 42,109, 97,116, - 0, 42,105,109, 97,116, 0,101,108,101,109,115, 0,100,105,115,112, 0, 42,101,100,105,116,101,108,101,109,115, 0, 42, 42,109, - 97,116, 0,116,111,116, 99,111,108, 0,119,105,114,101,115,105,122,101, 0,114,101,110,100,101,114,115,105,122,101, 0,116,104, -114,101,115,104, 0,118,101, 99, 91, 51, 93, 91, 51, 93, 0, 97,108,102, 97, 0,119,101,105,103,104,116, 0,114, 97,100,105,117, -115, 0,104, 49, 0,104, 50, 0,102, 49, 0,102, 50, 0,102, 51, 0,104,105,100,101, 0,118,101, 99, 91, 52, 93, 0,109, 97,116, - 95,110,114, 0,112,110,116,115,117, 0,112,110,116,115,118, 0,114,101,115,111,108,117, 0,114,101,115,111,108,118, 0,111,114, -100,101,114,117, 0,111,114,100,101,114,118, 0,102,108, 97,103,117, 0,102,108, 97,103,118, 0, 42,107,110,111,116,115,117, 0, - 42,107,110,111,116,115,118, 0,116,105,108,116, 95,105,110,116,101,114,112, 0,114, 97,100,105,117,115, 95,105,110,116,101,114, -112, 0, 99,104, 97,114,105,100,120, 0,107,101,114,110, 0,104, 0,110,117,114, 98, 0, 42,101,100,105,116,110,117,114, 98, 0, - 42, 98,101,118,111, 98,106, 0, 42,116, 97,112,101,114,111, 98,106, 0, 42,116,101,120,116,111,110, 99,117,114,118,101, 0, 42, -112, 97,116,104, 0, 42,107,101,121, 0, 98,101,118, 0,112, 97,116,104,108,101,110, 0, 98,101,118,114,101,115,111,108, 0,119, -105,100,116,104, 0,101,120,116, 49, 0,101,120,116, 50, 0,114,101,115,111,108,117, 95,114,101,110, 0,114,101,115,111,108,118, - 95,114,101,110, 0, 97, 99,116,110,117, 0, 42,108, 97,115,116,115,101,108, 98,112, 0,115,112, 97, 99,101,109,111,100,101, 0, -115,112, 97, 99,105,110,103, 0,108,105,110,101,100,105,115,116, 0,115,104,101, 97,114, 0,102,115,105,122,101, 0,119,111,114, -100,115,112, 97, 99,101, 0,117,108,112,111,115, 0,117,108,104,101,105,103,104,116, 0,120,111,102, 0,121,111,102, 0,108,105, -110,101,119,105,100,116,104, 0, 42,115,116,114, 0, 42,115,101,108, 98,111,120,101,115, 0, 42,101,100,105,116,102,111,110,116, - 0,102, 97,109,105,108,121, 91, 50, 52, 93, 0, 42,118,102,111,110,116, 0, 42,118,102,111,110,116, 98, 0, 42,118,102,111,110, -116,105, 0, 42,118,102,111,110,116, 98,105, 0,115,101,112, 99,104, 97,114, 0,116,111,116, 98,111,120, 0, 97, 99,116, 98,111, -120, 0, 42,116, 98, 0,115,101,108,115,116, 97,114,116, 0,115,101,108,101,110,100, 0, 42,115,116,114,105,110,102,111, 0, 99, -117,114,105,110,102,111, 0,101,102,102,101, 99,116, 0, 42,109,102, 97, 99,101, 0, 42,109,116,102, 97, 99,101, 0, 42,116,102, - 97, 99,101, 0, 42,109,118,101,114,116, 0, 42,109,101,100,103,101, 0, 42,100,118,101,114,116, 0, 42,109, 99,111,108, 0, 42, -109,115,116,105, 99,107,121, 0, 42,116,101,120, 99,111,109,101,115,104, 0, 42,109,115,101,108,101, 99,116, 0, 42,101,100,105, -116, 95,109,101,115,104, 0,118,100, 97,116, 97, 0,101,100, 97,116, 97, 0,102,100, 97,116, 97, 0,116,111,116,101,100,103,101, - 0,116,111,116,102, 97, 99,101, 0,116,111,116,115,101,108,101, 99,116, 0, 97, 99,116, 95,102, 97, 99,101, 0, 99,117, 98,101, -109, 97,112,115,105,122,101, 0,100,114, 97,119,102,108, 97,103, 0,115,109,111,111,116,104,114,101,115,104, 0,115,117, 98,100, -105,118, 0,115,117, 98,100,105,118,114, 0,115,117, 98,115,117,114,102,116,121,112,101, 0, 42,109,114, 0, 42,112,118, 0, 42, -116,112, 97,103,101, 0,117,118, 91, 52, 93, 91, 50, 93, 0, 99,111,108, 91, 52, 93, 0,116,114, 97,110,115,112, 0,116,105,108, -101, 0,117,110,119,114, 97,112, 0,118, 49, 0,118, 50, 0,118, 51, 0,118, 52, 0,101,100, 99,111,100,101, 0, 99,114,101, 97, -115,101, 0, 98,119,101,105,103,104,116, 0,100,101,102, 95,110,114, 0, 42,100,119, 0,116,111,116,119,101,105,103,104,116, 0, - 99,111, 91, 51, 93, 0,110,111, 91, 51, 93, 0,112, 97,100, 91, 51, 93, 0,117,118, 91, 50, 93, 0, 99,111, 91, 50, 93, 0,105, -110,100,101,120, 0,102, 0,105, 0,115, 91, 50, 53, 54, 93, 0,116,111,116,100,105,115,112, 0, 40, 42,100,105,115,112,115, 41, - 40, 41, 0,118, 91, 52, 93, 0,109,105,100, 0,118, 91, 50, 93, 0, 42,102, 97, 99,101,115, 0, 42, 99,111,108,102, 97, 99,101, -115, 0, 42,101,100,103,101,115, 0, 42,118,101,114,116,115, 0,108,101,118,101,108,115, 0,108,101,118,101,108, 95, 99,111,117, -110,116, 0, 99,117,114,114,101,110,116, 0,110,101,119,108,118,108, 0,101,100,103,101,108,118,108, 0,112,105,110,108,118,108, - 0,114,101,110,100,101,114,108,118,108, 0,117,115,101, 95, 99,111,108, 0, 42,101,100,103,101, 95,102,108, 97,103,115, 0, 42, -101,100,103,101, 95, 99,114,101, 97,115,101,115, 0, 42,118,101,114,116, 95,109, 97,112, 0, 42,101,100,103,101, 95,109, 97,112, - 0, 42,111,108,100, 95,102, 97, 99,101,115, 0, 42,111,108,100, 95,101,100,103,101,115, 0, 42,101,114,114,111,114, 0,109,111, -100,105,102,105,101,114, 0,115,117, 98,100,105,118, 84,121,112,101, 0,114,101,110,100,101,114, 76,101,118,101,108,115, 0, 42, -101,109, 67, 97, 99,104,101, 0, 42,109, 67, 97, 99,104,101, 0,100,101,102, 97,120,105,115, 0,112, 97,100, 91, 54, 93, 0,108, -101,110,103,116,104, 0,114, 97,110,100,111,109,105,122,101, 0,115,101,101,100, 0, 42,111, 98, 95, 97,114,109, 0, 42,115,116, - 97,114,116, 95, 99, 97,112, 0, 42,101,110,100, 95, 99, 97,112, 0, 42, 99,117,114,118,101, 95,111, 98, 0, 42,111,102,102,115, -101,116, 95,111, 98, 0,111,102,102,115,101,116, 91, 51, 93, 0,115, 99, 97,108,101, 91, 51, 93, 0,109,101,114,103,101, 95,100, -105,115,116, 0,102,105,116, 95,116,121,112,101, 0,111,102,102,115,101,116, 95,116,121,112,101, 0, 99,111,117,110,116, 0, 97, -120,105,115, 0,116,111,108,101,114, 97,110, 99,101, 0, 42,109,105,114,114,111,114, 95,111, 98, 0,115,112,108,105,116, 95, 97, -110,103,108,101, 0,118, 97,108,117,101, 0,114,101,115, 0,118, 97,108, 95,102,108, 97,103,115, 0,108,105,109, 95,102,108, 97, -103,115, 0,101, 95,102,108, 97,103,115, 0, 98,101,118,101,108, 95, 97,110,103,108,101, 0,100,101,102,103,114,112, 95,110, 97, -109,101, 91, 51, 50, 93, 0, 42,116,101,120,116,117,114,101, 0,115,116,114,101,110,103,116,104, 0,100,105,114,101, 99,116,105, -111,110, 0,109,105,100,108,101,118,101,108, 0,116,101,120,109, 97,112,112,105,110,103, 0, 42,109, 97,112, 95,111, 98,106,101, - 99,116, 0,117,118,108, 97,121,101,114, 95,110, 97,109,101, 91, 51, 50, 93, 0,117,118,108, 97,121,101,114, 95,116,109,112, 0, - 42,112,114,111,106,101, 99,116,111,114,115, 91, 49, 48, 93, 0, 42,105,109, 97,103,101, 0,110,117,109, 95,112,114,111,106,101, - 99,116,111,114,115, 0, 97,115,112,101, 99,116,120, 0, 97,115,112,101, 99,116,121, 0,112,101,114, 99,101,110,116, 0,102, 97, - 99,101, 67,111,117,110,116, 0,102, 97, 99, 0,114,101,112,101, 97,116, 0, 42,111, 98,106,101, 99,116, 99,101,110,116,101,114, - 0,115,116, 97,114,116,120, 0,115,116, 97,114,116,121, 0,104,101,105,103,104,116, 0,110, 97,114,114,111,119, 0,115,112,101, -101,100, 0,100, 97,109,112, 0,102, 97,108,108,111,102,102, 0,116,105,109,101,111,102,102,115, 0,108,105,102,101,116,105,109, -101, 0,100,101,102,111,114,109,102,108, 97,103, 0,109,117,108,116,105, 0, 42,112,114,101,118, 67,111,115, 0,112, 97,114,101, -110,116,105,110,118, 91, 52, 93, 91, 52, 93, 0, 99,101,110,116, 91, 51, 93, 0, 42,105,110,100,101,120, 97,114, 0,116,111,116, -105,110,100,101,120, 0,102,111,114, 99,101, 0, 42, 99,108,111,116,104, 79, 98,106,101, 99,116, 0, 42,115,105,109, 95,112, 97, -114,109,115, 0, 42, 99,111,108,108, 95,112, 97,114,109,115, 0, 42,112,111,105,110,116, 95, 99, 97, 99,104,101, 0, 42,120, 0, - 42,120,110,101,119, 0, 42,120,111,108,100, 0, 42, 99,117,114,114,101,110,116, 95,120,110,101,119, 0, 42, 99,117,114,114,101, -110,116, 95,120, 0, 42, 99,117,114,114,101,110,116, 95,118, 0, 42,109,102, 97, 99,101,115, 0,110,117,109,118,101,114,116,115, - 0,110,117,109,102, 97, 99,101,115, 0, 97, 98,115,111,114,112,116,105,111,110, 0,116,105,109,101, 0, 42, 98,118,104,116,114, -101,101, 0, 42,100,109, 0,111,112,101,114, 97,116,105,111,110, 0,118,101,114,116,101,120, 0,116,111,116,105,110,102,108,117, -101,110, 99,101, 0,103,114,105,100,115,105,122,101, 0,110,101,101,100, 98,105,110,100, 0, 42, 98,105,110,100,119,101,105,103, -104,116,115, 0, 42, 98,105,110,100, 99,111,115, 0,116,111,116, 99, 97,103,101,118,101,114,116, 0, 42,100,121,110,103,114,105, -100, 0, 42,100,121,110,105,110,102,108,117,101,110, 99,101,115, 0, 42,100,121,110,118,101,114,116,115, 0, 42,112, 97,100, 50, - 0,100,121,110,103,114,105,100,115,105,122,101, 0,100,121,110, 99,101,108,108,109,105,110, 91, 51, 93, 0,100,121,110, 99,101, -108,108,119,105,100,116,104, 0, 98,105,110,100,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 42,112,115,121,115, 0,116,111,116,100, -109,118,101,114,116, 0,116,111,116,100,109,101,100,103,101, 0,116,111,116,100,109,102, 97, 99,101, 0,112,115,121,115, 0,114, -116, 91, 50, 93, 0, 42,102, 97, 99,101,112, 97, 0,118,103,114,111,117,112, 0,112,114,111,116,101, 99,116, 0, 42,117,110,100, -111, 95,118,101,114,116,115, 0,117,110,100,111, 95,118,101,114,116,115, 95,116,111,116, 0,117,110,100,111, 95,115,105,103,110, - 97,108, 0,108,118,108, 0,116,111,116,108,118,108, 0,115,105,109,112,108,101, 0, 42,102,115,115, 0, 42,116, 97,114,103,101, -116, 0, 42, 97,117,120, 84, 97,114,103,101,116, 0,118,103,114,111,117,112, 95,110, 97,109,101, 91, 51, 50, 93, 0,107,101,101, -112, 68,105,115,116, 0,115,104,114,105,110,107, 84,121,112,101, 0,115,104,114,105,110,107, 79,112,116,115, 0,112,114,111,106, - 65,120,105,115, 0,115,117, 98,115,117,114,102, 76,101,118,101,108,115, 0, 42,111,114,105,103,105,110, 0,102, 97, 99,116,111, -114, 0,108,105,109,105,116, 91, 50, 93, 0,111,114,105,103,105,110, 79,112,116,115, 0,112,110,116,115,119, 0,111,112,110,116, -115,117, 0,111,112,110,116,115,118, 0,111,112,110,116,115,119, 0,116,121,112,101,117, 0,116,121,112,101,118, 0,116,121,112, -101,119, 0,102,117, 0,102,118, 0,102,119, 0,100,117, 0,100,118, 0,100,119, 0, 42,100,101,102, 0, 42,108, 97,116,116,105, - 99,101,100, 97,116, 97, 0,108, 97,116,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 42,101,100,105,116,108, 97,116,116, 0,118,101, - 99, 91, 56, 93, 91, 51, 93, 0,112, 97,114,116,121,112,101, 0,112, 97,114, 49, 0,112, 97,114, 50, 0,112, 97,114, 51, 0,112, - 97,114,115,117, 98,115,116,114, 91, 51, 50, 93, 0, 42,116,114, 97, 99,107, 0, 42,112,114,111,120,121, 0, 42,112,114,111,120, -121, 95,103,114,111,117,112, 0, 42,112,114,111,120,121, 95,102,114,111,109, 0, 42, 97, 99,116,105,111,110, 0, 42,112,111,115, -101,108,105, 98, 0, 42,112,111,115,101, 0, 99,111,110,115,116,114, 97,105,110,116, 67,104, 97,110,110,101,108,115, 0,100,101, -102, 98, 97,115,101, 0,109,111,100,105,102,105,101,114,115, 0,100,108,111, 99, 91, 51, 93, 0,111,114,105,103, 91, 51, 93, 0, -100,115,105,122,101, 91, 51, 93, 0,100,114,111,116, 91, 51, 93, 0,111, 98,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 99,111,110, -115,116,105,110,118, 91, 52, 93, 91, 52, 93, 0,108, 97,121, 0, 99,111,108, 98,105,116,115, 0,116,114, 97,110,115,102,108, 97, -103, 0,112,114,111,116,101, 99,116,102,108, 97,103, 0,116,114, 97, 99,107,102,108, 97,103, 0,117,112,102,108, 97,103, 0,110, -108, 97,102,108, 97,103, 0,105,112,111,102,108, 97,103, 0,105,112,111,119,105,110, 0,115, 99, 97,102,108, 97,103, 0,115, 99, - 97,118,105,115,102,108, 97,103, 0, 98,111,117,110,100,116,121,112,101, 0,100,117,112,111,110, 0,100,117,112,111,102,102, 0, -100,117,112,115,116, 97, 0,100,117,112,101,110,100, 0,115,102, 0, 99,116,105,109,101, 0,109, 97,115,115, 0,100, 97,109,112, -105,110,103, 0,105,110,101,114,116,105, 97, 0,102,111,114,109,102, 97, 99,116,111,114, 0,114,100, 97,109,112,105,110,103, 0, -115,105,122,101,102, 97, 99, 0,109, 97,114,103,105,110, 0,109, 97,120, 95,118,101,108, 0,109,105,110, 95,118,101,108, 0,100, -116, 0,100,116,120, 0, 97, 99,116, 99,111,108, 0,101,109,112,116,121, 95,100,114, 97,119,116,121,112,101, 0,112, 97,100, 49, - 91, 51, 93, 0,101,109,112,116,121, 95,100,114, 97,119,115,105,122,101, 0,100,117,112,102, 97, 99,101,115, 99, 97, 0,112,114, -111,112, 0,115,101,110,115,111,114,115, 0, 99,111,110,116,114,111,108,108,101,114,115, 0, 97, 99,116,117, 97,116,111,114,115, - 0, 98, 98,115,105,122,101, 91, 51, 93, 0, 97, 99,116,100,101,102, 0,103, 97,109,101,102,108, 97,103, 0,103, 97,109,101,102, -108, 97,103, 50, 0, 42, 98,115,111,102,116, 0,115,111,102,116,102,108, 97,103, 0, 97,110,105,115,111,116,114,111,112,105, 99, - 70,114,105, 99,116,105,111,110, 91, 51, 93, 0, 99,111,110,115,116,114, 97,105,110,116,115, 0,110,108, 97,115,116,114,105,112, -115, 0,104,111,111,107,115, 0,112, 97,114,116,105, 99,108,101,115,121,115,116,101,109, 0, 42,112,100, 0, 42,115,111,102,116, - 0, 42,100,117,112, 95,103,114,111,117,112, 0,102,108,117,105,100,115,105,109, 70,108, 97,103, 0,114,101,115,116,114,105, 99, -116,102,108, 97,103, 0,115,104, 97,112,101,110,114, 0,115,104, 97,112,101,102,108, 97,103, 0,114,101, 99, 97,108, 99,111, 0, - 98,111,100,121, 95,116,121,112,101, 0, 42,102,108,117,105,100,115,105,109, 83,101,116,116,105,110,103,115, 0, 42,100,101,114, -105,118,101,100, 68,101,102,111,114,109, 0, 42,100,101,114,105,118,101,100, 70,105,110, 97,108, 0,108, 97,115,116, 68, 97,116, - 97, 77, 97,115,107, 0,115,116, 97,116,101, 0,105,110,105,116, 95,115,116, 97,116,101, 0,103,112,117,108, 97,109,112, 0, 99, -117,114,105,110,100,101,120, 0, 97, 99,116,105,118,101, 0,100,101,102,108,101, 99,116, 0,102,111,114, 99,101,102,105,101,108, -100, 0,112,100,101,102, 95,100, 97,109,112, 0,112,100,101,102, 95,114,100, 97,109,112, 0,112,100,101,102, 95,112,101,114,109, - 0,112,100,101,102, 95,102,114,105, 99,116, 0,112,100,101,102, 95,114,102,114,105, 99,116, 0,102, 95,115,116,114,101,110,103, -116,104, 0,102, 95,112,111,119,101,114, 0,102, 95,100,105,115,116, 0,102, 95,100, 97,109,112, 0,109, 97,120,100,105,115,116, - 0,109,105,110,100,105,115,116, 0,109, 97,120,114, 97,100, 0,109,105,110,114, 97,100, 0,102, 95,112,111,119,101,114, 95,114, - 0,112,100,101,102, 95,115, 98,100, 97,109,112, 0,112,100,101,102, 95,115, 98,105,102,116, 0,112,100,101,102, 95,115, 98,111, -102,116, 0, 99,108,117,109,112, 95,102, 97, 99, 0, 99,108,117,109,112, 95,112,111,119, 0,107,105,110,107, 95,102,114,101,113, - 0,107,105,110,107, 95,115,104, 97,112,101, 0,107,105,110,107, 95, 97,109,112, 0,102,114,101,101, 95,101,110,100, 0,116,101, -120, 95,110, 97, 98,108, 97, 0,116,101,120, 95,109,111,100,101, 0,107,105,110,107, 0,107,105,110,107, 95, 97,120,105,115, 0, -114,116, 50, 0, 42,114,110,103, 0,102, 95,110,111,105,115,101, 0,115,105,109,102,114, 97,109,101, 0,115,116, 97,114,116,102, -114, 97,109,101, 0,101,110,100,102,114, 97,109,101, 0,101,100,105,116,102,114, 97,109,101, 0,108,105,110, 83,116,105,102,102, - 0, 97,110,103, 83,116,105,102,102, 0,118,111,108,117,109,101, 0,118,105,116,101,114, 97,116,105,111,110,115, 0,112,105,116, -101,114, 97,116,105,111,110,115, 0,100,105,116,101,114, 97,116,105,111,110,115, 0, 99,105,116,101,114, 97,116,105,111,110,115, - 0,107, 83, 82, 72, 82, 95, 67, 76, 0,107, 83, 75, 72, 82, 95, 67, 76, 0,107, 83, 83, 72, 82, 95, 67, 76, 0,107, 83, 82, 95, - 83, 80, 76, 84, 95, 67, 76, 0,107, 83, 75, 95, 83, 80, 76, 84, 95, 67, 76, 0,107, 83, 83, 95, 83, 80, 76, 84, 95, 67, 76, 0, -107, 86, 67, 70, 0,107, 68, 80, 0,107, 68, 71, 0,107, 76, 70, 0,107, 80, 82, 0,107, 86, 67, 0,107, 68, 70, 0,107, 77, 84, - 0,107, 67, 72, 82, 0,107, 75, 72, 82, 0,107, 83, 72, 82, 0,107, 65, 72, 82, 0, 99,111,108,108,105,115,105,111,110,102,108, - 97,103,115, 0,110,117,109, 99,108,117,115,116,101,114,105,116,101,114, 97,116,105,111,110,115, 0, 42,112, 97,114,116,105, 99, -108,101,115, 0,116,111,116,112,111,105,110,116, 0,116,111,116,115,112,114,105,110,103, 0, 42, 98,112,111,105,110,116, 0, 42, - 98,115,112,114,105,110,103, 0,110,111,100,101,109, 97,115,115, 0,103,114, 97,118, 0,109,101,100,105, 97,102,114,105, 99,116, - 0,114,107,108,105,109,105,116, 0,112,104,121,115,105, 99,115, 95,115,112,101,101,100, 0,103,111, 97,108,115,112,114,105,110, -103, 0,103,111, 97,108,102,114,105, 99,116, 0,109,105,110,103,111, 97,108, 0,109, 97,120,103,111, 97,108, 0,100,101,102,103, -111, 97,108, 0,118,101,114,116,103,114,111,117,112, 0,102,117,122,122,121,110,101,115,115, 0,105,110,115,112,114,105,110,103, - 0,105,110,102,114,105, 99,116, 0,101,102,114, 97, 0,105,110,116,101,114,118, 97,108, 0,108,111, 99, 97,108, 0,115,111,108, -118,101,114,102,108, 97,103,115, 0, 42, 42,107,101,121,115, 0,116,111,116,112,111,105,110,116,107,101,121, 0,115,101, 99,111, -110,100,115,112,114,105,110,103, 0, 99,111,108, 98, 97,108,108, 0, 98, 97,108,108,100, 97,109,112, 0, 98, 97,108,108,115,116, -105,102,102, 0,115, 98, 99, 95,109,111,100,101, 0, 97,101,114,111,101,100,103,101, 0,109,105,110,108,111,111,112,115, 0,109, - 97,120,108,111,111,112,115, 0, 99,104,111,107,101, 0,115,111,108,118,101,114, 95, 73, 68, 0,112,108, 97,115,116,105, 99, 0, -115,112,114,105,110,103,112,114,101,108,111, 97,100, 0, 42,115, 99,114, 97,116, 99,104, 0,115,104,101, 97,114,115,116,105,102, -102, 0,105,110,112,117,115,104, 0, 42,112,111,105,110,116, 99, 97, 99,104,101, 0,115,104,111,119, 95, 97,100,118, 97,110, 99, -101,100,111,112,116,105,111,110,115, 0,114,101,115,111,108,117,116,105,111,110,120,121,122, 0,112,114,101,118,105,101,119,114, -101,115,120,121,122, 0,114,101, 97,108,115,105,122,101, 0,103,117,105, 68,105,115,112,108, 97,121, 77,111,100,101, 0,114,101, -110,100,101,114, 68,105,115,112,108, 97,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 86, 97,108,117,101, 0,118, -105,115, 99,111,115,105,116,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 69,120,112,111,110,101,110,116, 0,103, -114, 97,118,120, 0,103,114, 97,118,121, 0,103,114, 97,118,122, 0, 97,110,105,109, 83,116, 97,114,116, 0, 97,110,105,109, 69, -110,100, 0,103,115,116, 97,114, 0,109, 97,120, 82,101,102,105,110,101, 0,105,110,105, 86,101,108,120, 0,105,110,105, 86,101, -108,121, 0,105,110,105, 86,101,108,122, 0, 42,111,114,103, 77,101,115,104, 0, 42,109,101,115,104, 83,117,114,102, 97, 99,101, - 0, 42,109,101,115,104, 66, 66, 0,115,117,114,102,100, 97,116, 97, 80, 97,116,104, 91, 50, 52, 48, 93, 0, 98, 98, 83,116, 97, -114,116, 91, 51, 93, 0, 98, 98, 83,105,122,101, 91, 51, 93, 0,116,121,112,101, 70,108, 97,103,115, 0,100,111,109, 97,105,110, - 78,111,118,101, 99,103,101,110, 0,118,111,108,117,109,101, 73,110,105,116, 84,121,112,101, 0,112, 97,114,116, 83,108,105,112, - 86, 97,108,117,101, 0,103,101,110,101,114, 97,116,101, 84,114, 97, 99,101,114,115, 0,103,101,110,101,114, 97,116,101, 80, 97, -114,116,105, 99,108,101,115, 0,115,117,114,102, 97, 99,101, 83,109,111,111,116,104,105,110,103, 0,115,117,114,102, 97, 99,101, - 83,117, 98,100,105,118,115, 0,112, 97,114,116,105, 99,108,101, 73,110,102, 83,105,122,101, 0,112, 97,114,116,105, 99,108,101, - 73,110,102, 65,108,112,104, 97, 0,102, 97,114, 70,105,101,108,100, 83,105,122,101, 0, 42,109,101,115,104, 83,117,114,102, 78, -111,114,109, 97,108,115, 0, 99,112,115, 84,105,109,101, 83,116, 97,114,116, 0, 99,112,115, 84,105,109,101, 69,110,100, 0, 99, -112,115, 81,117, 97,108,105,116,121, 0, 97,116,116,114, 97, 99,116,102,111,114, 99,101, 83,116,114,101,110,103,116,104, 0, 97, -116,116,114, 97, 99,116,102,111,114, 99,101, 82, 97,100,105,117,115, 0,118,101,108,111, 99,105,116,121,102,111,114, 99,101, 83, -116,114,101,110,103,116,104, 0,118,101,108,111, 99,105,116,121,102,111,114, 99,101, 82, 97,100,105,117,115, 0,108, 97,115,116, -103,111,111,100,102,114, 97,109,101, 0,109,105,115,116,121,112,101, 0,104,111,114,114, 0,104,111,114,103, 0,104,111,114, 98, - 0,104,111,114,107, 0,122,101,110,114, 0,122,101,110,103, 0,122,101,110, 98, 0,122,101,110,107, 0, 97,109, 98,107, 0,102, - 97,115,116, 99,111,108, 0,101,120,112,111,115,117,114,101, 0,101,120,112, 0,114, 97,110,103,101, 0,108,105,110,102, 97, 99, - 0,108,111,103,102, 97, 99, 0,103,114, 97,118,105,116,121, 0, 97, 99,116,105,118,105,116,121, 66,111,120, 82, 97,100,105,117, -115, 0,115,107,121,116,121,112,101, 0,111, 99, 99,108,117,115,105,111,110, 82,101,115, 0,112,104,121,115,105, 99,115, 69,110, -103,105,110,101, 0,109,105,115,105, 0,109,105,115,116,115,116, 97, 0,109,105,115,116,100,105,115,116, 0,109,105,115,116,104, -105, 0,115,116, 97,114,114, 0,115,116, 97,114,103, 0,115,116, 97,114, 98, 0,115,116, 97,114,107, 0,115,116, 97,114,115,105, -122,101, 0,115,116, 97,114,109,105,110,100,105,115,116, 0,115,116, 97,114,100,105,115,116, 0,115,116, 97,114, 99,111,108,110, -111,105,115,101, 0,100,111,102,115,116, 97, 0,100,111,102,101,110,100, 0,100,111,102,109,105,110, 0,100,111,102,109, 97,120, - 0, 97,111,100,105,115,116, 0, 97,111,100,105,115,116,102, 97, 99, 0, 97,111,101,110,101,114,103,121, 0, 97,111, 98,105, 97, -115, 0, 97,111,109,111,100,101, 0, 97,111,115, 97,109,112, 0, 97,111,109,105,120, 0, 97,111, 99,111,108,111,114, 0, 97,111, - 95, 97,100, 97,112,116, 95,116,104,114,101,115,104, 0, 97,111, 95, 97,100, 97,112,116, 95,115,112,101,101,100, 95,102, 97, 99, - 0, 97,111, 95, 97,112,112,114,111,120, 95,101,114,114,111,114, 0, 97,111, 95, 97,112,112,114,111,120, 95, 99,111,114,114,101, - 99,116,105,111,110, 0, 97,111, 95,115, 97,109,112, 95,109,101,116,104,111,100, 0, 97,111, 95,103, 97,116,104,101,114, 95,109, -101,116,104,111,100, 0, 97,111, 95, 97,112,112,114,111,120, 95,112, 97,115,115,101,115, 0, 42, 97,111,115,112,104,101,114,101, - 0, 42, 97,111,116, 97, 98,108,101,115, 0,104,101,109,105,114,101,115, 0,109, 97,120,105,116,101,114, 0,100,114, 97,119,116, -121,112,101, 0,115,117, 98,115,104,111,111,116,112, 0,115,117, 98,115,104,111,111,116,101, 0,110,111,100,101,108,105,109, 0, -109, 97,120,115,117, 98,108, 97,109,112, 0,112, 97,109, 97, 0,112, 97,109,105, 0,101,108,109, 97, 0,101,108,109,105, 0,109, - 97,120,110,111,100,101, 0, 99,111,110,118,101,114,103,101,110, 99,101, 0,114, 97,100,102, 97, 99, 0,103, 97,109,109, 97, 0, -115,101,108, 99,111,108, 0,115,120, 0,115,121, 0, 42,108,112, 70,111,114,109, 97,116, 0, 42,108,112, 80, 97,114,109,115, 0, - 99, 98, 70,111,114,109, 97,116, 0, 99, 98, 80, 97,114,109,115, 0,102, 99, 99, 84,121,112,101, 0,102, 99, 99, 72, 97,110,100, -108,101,114, 0,100,119, 75,101,121, 70,114, 97,109,101, 69,118,101,114,121, 0,100,119, 81,117, 97,108,105,116,121, 0,100,119, - 66,121,116,101,115, 80,101,114, 83,101, 99,111,110,100, 0,100,119, 70,108, 97,103,115, 0,100,119, 73,110,116,101,114,108,101, - 97,118,101, 69,118,101,114,121, 0, 97,118,105, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0, 42, 99,100, 80, 97, -114,109,115, 0, 42,112, 97,100, 0, 99,100, 83,105,122,101, 0,113,116, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, - 0, 99,111,100,101, 99, 0, 97,117,100,105,111, 95, 99,111,100,101, 99, 0,118,105,100,101,111, 95, 98,105,116,114, 97,116,101, - 0, 97,117,100,105,111, 95, 98,105,116,114, 97,116,101, 0,103,111,112, 95,115,105,122,101, 0,114, 99, 95,109,105,110, 95,114, - 97,116,101, 0,114, 99, 95,109, 97,120, 95,114, 97,116,101, 0,114, 99, 95, 98,117,102,102,101,114, 95,115,105,122,101, 0,109, -117,120, 95,112, 97, 99,107,101,116, 95,115,105,122,101, 0,109,117,120, 95,114, 97,116,101, 0,109,105,120,114, 97,116,101, 0, -109, 97,105,110, 0, 42,109, 97,116, 95,111,118,101,114,114,105,100,101, 0, 42,108,105,103,104,116, 95,111,118,101,114,114,105, -100,101, 0,108, 97,121, 95,122,109, 97,115,107, 0,108, 97,121,102,108, 97,103, 0,112, 97,115,115,102,108, 97,103, 0,112, 97, -115,115, 95,120,111,114, 0, 42, 97,118,105, 99,111,100,101, 99,100, 97,116, 97, 0, 42,113,116, 99,111,100,101, 99,100, 97,116, - 97, 0,102,102, 99,111,100,101, 99,100, 97,116, 97, 0, 97,117,100,105,111, 0, 99,102,114, 97, 0,112,115,102,114, 97, 0,112, -101,102,114, 97, 0,105,109, 97,103,101,115, 0,102,114, 97,109, 97,112,116,111, 0,116,104,114,101, 97,100,115, 0,102,114, 97, -109,101,108,101,110, 0, 98,108,117,114,102, 97, 99, 0,101,100,103,101, 82, 0,101,100,103,101, 71, 0,101,100,103,101, 66, 0, -102,117,108,108,115, 99,114,101,101,110, 0,120,112,108, 97,121, 0,121,112,108, 97,121, 0,102,114,101,113,112,108, 97,121, 0, - 97,116,116,114,105, 98, 0,114,116, 49, 0,115,116,101,114,101,111,109,111,100,101, 0,100,105,109,101,110,115,105,111,110,115, -112,114,101,115,101,116, 0,109, 97,120,105,109,115,105,122,101, 0,120,115, 99,104, 0,121,115, 99,104, 0,120,112, 97,114,116, -115, 0,121,112, 97,114,116,115, 0,119,105,110,112,111,115, 0,112,108, 97,110,101,115, 0,105,109,116,121,112,101, 0,115,117, - 98,105,109,116,121,112,101, 0,113,117, 97,108,105,116,121, 0,114,112, 97,100, 0,114,112, 97,100, 49, 0,114,112, 97,100, 50, - 0,115, 99,101,109,111,100,101, 0,114,101,110,100,101,114,101,114, 0,111, 99,114,101,115, 0, 97,108,112,104, 97,109,111,100, -101, 0,111,115, 97, 0,102,114,115, 95,115,101, 99, 0,101,100,103,101,105,110,116, 0,115, 97,102,101,116,121, 0, 98,111,114, -100,101,114, 0,100,105,115,112,114,101, 99,116, 0,108, 97,121,101,114,115, 0, 97, 99,116,108, 97,121, 0,120, 97,115,112, 0, -121, 97,115,112, 0,102,114,115, 95,115,101, 99, 95, 98, 97,115,101, 0,103, 97,117,115,115, 0,112,111,115,116,109,117,108, 0, -112,111,115,116,103, 97,109,109, 97, 0,112,111,115,116,104,117,101, 0,112,111,115,116,115, 97,116, 0,100,105,116,104,101,114, - 95,105,110,116,101,110,115,105,116,121, 0, 98, 97,107,101, 95,111,115, 97, 0, 98, 97,107,101, 95,102,105,108,116,101,114, 0, - 98, 97,107,101, 95,109,111,100,101, 0, 98, 97,107,101, 95,102,108, 97,103, 0, 98, 97,107,101, 95,110,111,114,109, 97,108, 95, -115,112, 97, 99,101, 0, 98, 97,107,101, 95,113,117, 97,100, 95,115,112,108,105,116, 0, 98, 97,107,101, 95,109, 97,120,100,105, -115,116, 0, 98, 97,107,101, 95, 98,105, 97,115,100,105,115,116, 0, 98, 97,107,101, 95,112, 97,100, 0, 71, 73,113,117, 97,108, -105,116,121, 0, 71, 73, 99, 97, 99,104,101, 0, 71, 73,109,101,116,104,111,100, 0, 71, 73,112,104,111,116,111,110,115, 0, 71, - 73,100,105,114,101, 99,116, 0, 89, 70, 95, 65, 65, 0, 89, 70,101,120,112,111,114,116,120,109,108, 0, 89, 70, 95,110,111, 98, -117,109,112, 0, 89, 70, 95, 99,108, 97,109,112,114,103, 98, 0,121,102,112, 97,100, 49, 0, 71, 73,100,101,112,116,104, 0, 71, - 73, 99, 97,117,115,100,101,112,116,104, 0, 71, 73,112,105,120,101,108,115,112,101,114,115, 97,109,112,108,101, 0, 71, 73,112, -104,111,116,111,110, 99,111,117,110,116, 0, 71, 73,109,105,120,112,104,111,116,111,110,115, 0, 71, 73,112,104,111,116,111,110, -114, 97,100,105,117,115, 0, 89, 70, 95,114, 97,121,100,101,112,116,104, 0, 89, 70, 95, 65, 65,112, 97,115,115,101,115, 0, 89, - 70, 95, 65, 65,115, 97,109,112,108,101,115, 0,121,102,112, 97,100, 50, 0, 71, 73,115,104, 97,100,111,119,113,117, 97,108,105, -116,121, 0, 71, 73,114,101,102,105,110,101,109,101,110,116, 0, 71, 73,112,111,119,101,114, 0, 71, 73,105,110,100,105,114,112, -111,119,101,114, 0, 89, 70, 95,103, 97,109,109, 97, 0, 89, 70, 95,101,120,112,111,115,117,114,101, 0, 89, 70, 95,114, 97,121, - 98,105, 97,115, 0, 89, 70, 95, 65, 65,112,105,120,101,108,115,105,122,101, 0, 89, 70, 95, 65, 65,116,104,114,101,115,104,111, -108,100, 0, 98, 97, 99,107, 98,117,102, 91, 49, 54, 48, 93, 0,112,105, 99, 91, 49, 54, 48, 93, 0,115,116, 97,109,112, 0,115, -116, 97,109,112, 95,102,111,110,116, 95,105,100, 0,115,116, 97,109,112, 95,117,100, 97,116, 97, 91, 49, 54, 48, 93, 0,102,103, - 95,115,116, 97,109,112, 91, 52, 93, 0, 98,103, 95,115,116, 97,109,112, 91, 52, 93, 0,115,105,109,112,108,105,102,121, 95,115, -117, 98,115,117,114,102, 0,115,105,109,112,108,105,102,121, 95,115,104, 97,100,111,119,115, 97,109,112,108,101,115, 0,115,105, -109,112,108,105,102,121, 95,112, 97,114,116,105, 99,108,101,115, 0,115,105,109,112,108,105,102,121, 95, 97,111,115,115,115, 0, - 99,105,110,101,111,110,119,104,105,116,101, 0, 99,105,110,101,111,110, 98,108, 97, 99,107, 0, 99,105,110,101,111,110,103, 97, -109,109, 97, 0,106,112, 50, 95,112,114,101,115,101,116, 0,106,112, 50, 95,100,101,112,116,104, 0,114,112, 97,100, 51, 0,100, -111,109,101,114,101,115, 0,100,111,109,101,109,111,100,101, 0,100,111,109,101, 97,110,103,108,101, 0,112, 97,100, 57, 0,100, -111,109,101,115,105,122,101, 0,100,111,109,101,114,101,115, 98,117,102, 0, 42,100,111,109,101,116,101,120,116, 0,112, 97,114, -116,105, 99,108,101, 95,112,101,114, 99, 0,115,117, 98,115,117,114,102, 95,109, 97,120, 0,115,104, 97,100, 98,117,102,115, 97, -109,112,108,101, 95,109, 97,120, 0, 97,111, 95,101,114,114,111,114, 0, 99,111,108, 91, 51, 93, 0,102,114, 97,109,101, 0,110, - 97,109,101, 91, 54, 52, 93, 0, 42, 98,114,117,115,104, 0,116,111,111,108, 0,115,101, 97,109, 95, 98,108,101,101,100, 0,110, -111,114,109, 97,108, 95, 97,110,103,108,101, 0, 42,112, 97,105,110,116, 99,117,114,115,111,114, 0,115,116,101,112, 0,105,110, -118,101,114,116, 0,116,111,116,114,101,107,101,121, 0,116,111,116, 97,100,100,107,101,121, 0, 98,114,117,115,104,116,121,112, -101, 0, 98,114,117,115,104, 91, 55, 93, 0,101,109,105,116,116,101,114,100,105,115,116, 0,100,114, 97,119, 95,116,105,109,101, -100, 0,110, 97,109,101, 91, 51, 54, 93, 0,109, 97,116, 91, 51, 93, 91, 51, 93, 0, 42,115,101,115,115,105,111,110, 0,112,105, -118,111,116, 91, 51, 93, 0,116,101,120,115,101,112, 0,116, 97, 98,108,101,116, 95,115,105,122,101, 0,116, 97, 98,108,101,116, - 95,115,116,114,101,110,103,116,104, 0,112, 97,100, 91, 53, 93, 0,109,117,108, 0, 42,118,112, 97,105,110,116, 95,112,114,101, -118, 0, 42,119,112, 97,105,110,116, 95,112,114,101,118, 0, 42,118,112, 97,105,110,116, 0, 42,119,112, 97,105,110,116, 0, 42, -115, 99,117,108,112,116, 0, 99,111,114,110,101,114,116,121,112,101, 0,101,100,105,116, 98,117,116,102,108, 97,103, 0,106,111, -105,110,116,114,105,108,105,109,105,116, 0,100,101,103,114, 0,116,117,114,110, 0,101,120,116,114, 95,111,102,102,115, 0,100, -111,117, 98,108,105,109,105,116, 0,115,101,103,109,101,110,116,115, 0,114,105,110,103,115, 0,118,101,114,116,105, 99,101,115, - 0,117,110,119,114, 97,112,112,101,114, 0,117,118, 99, 97,108, 99, 95,114, 97,100,105,117,115, 0,117,118, 99, 97,108, 99, 95, - 99,117, 98,101,115,105,122,101, 0,117,118, 99, 97,108, 99, 95,109, 97,114,103,105,110, 0,117,118, 99, 97,108, 99, 95,109, 97, -112,100,105,114, 0,117,118, 99, 97,108, 99, 95,109, 97,112, 97,108,105,103,110, 0,117,118, 99, 97,108, 99, 95,102,108, 97,103, - 0,117,118, 95,102,108, 97,103, 0,117,118, 95,115,101,108,101, 99,116,109,111,100,101, 0,117,118, 95,112, 97,100, 91, 50, 93, - 0, 97,117,116,111,105,107, 95, 99,104, 97,105,110,108,101,110, 0,105,109, 97,112, 97,105,110,116, 0,112, 97,114,116,105, 99, -108,101, 0,112,114,111,112,111,114,116,105,111,110, 97,108, 95,115,105,122,101, 0,115,101,108,101, 99,116, 95,116,104,114,101, -115,104, 0, 99,108,101, 97,110, 95,116,104,114,101,115,104, 0,114,101,116,111,112,111, 95,109,111,100,101, 0,114,101,116,111, -112,111, 95,112, 97,105,110,116, 95,116,111,111,108, 0,108,105,110,101, 95,100,105,118, 0,101,108,108,105,112,115,101, 95,100, -105,118, 0,114,101,116,111,112,111, 95,104,111,116,115,112,111,116, 0,109,117,108,116,105,114,101,115, 95,115,117, 98,100,105, -118, 95,116,121,112,101, 0,115,107,103,101,110, 95,114,101,115,111,108,117,116,105,111,110, 0,115,107,103,101,110, 95,116,104, -114,101,115,104,111,108,100, 95,105,110,116,101,114,110, 97,108, 0,115,107,103,101,110, 95,116,104,114,101,115,104,111,108,100, - 95,101,120,116,101,114,110, 97,108, 0,115,107,103,101,110, 95,108,101,110,103,116,104, 95,114, 97,116,105,111, 0,115,107,103, -101,110, 95,108,101,110,103,116,104, 95,108,105,109,105,116, 0,115,107,103,101,110, 95, 97,110,103,108,101, 95,108,105,109,105, -116, 0,115,107,103,101,110, 95, 99,111,114,114,101,108, 97,116,105,111,110, 95,108,105,109,105,116, 0,115,107,103,101,110, 95, -115,121,109,109,101,116,114,121, 95,108,105,109,105,116, 0,115,107,103,101,110, 95,114,101,116, 97,114,103,101,116, 95, 97,110, -103,108,101, 95,119,101,105,103,104,116, 0,115,107,103,101,110, 95,114,101,116, 97,114,103,101,116, 95,108,101,110,103,116,104, - 95,119,101,105,103,104,116, 0,115,107,103,101,110, 95,114,101,116, 97,114,103,101,116, 95,100,105,115,116, 97,110, 99,101, 95, -119,101,105,103,104,116, 0,115,107,103,101,110, 95,111,112,116,105,111,110,115, 0,115,107,103,101,110, 95,112,111,115,116,112, -114,111, 0,115,107,103,101,110, 95,112,111,115,116,112,114,111, 95,112, 97,115,115,101,115, 0,115,107,103,101,110, 95,115,117, - 98,100,105,118,105,115,105,111,110,115, 91, 51, 93, 0,115,107,103,101,110, 95,109,117,108,116,105, 95,108,101,118,101,108, 0, -115,107,103,101,110, 95,112, 97,100, 0, 42,115,107,103,101,110, 95,116,101,109,112,108, 97,116,101, 0, 98,111,110,101, 95,115, -107,101,116, 99,104,105,110,103, 0, 98,111,110,101, 95,115,107,101,116, 99,104,105,110,103, 95, 99,111,110,118,101,114,116, 0, -115,107,103,101,110, 95,115,117, 98,100,105,118,105,115,105,111,110, 95,110,117,109, 98,101,114, 0,115,107,103,101,110, 95,114, -101,116, 97,114,103,101,116, 95,111,112,116,105,111,110,115, 0,115,107,103,101,110, 95,114,101,116, 97,114,103,101,116, 95,114, -111,108,108, 0,115,107,103,101,110, 95,115,105,100,101, 95,115,116,114,105,110,103, 91, 56, 93, 0,115,107,103,101,110, 95,110, -117,109, 95,115,116,114,105,110,103, 91, 56, 93, 0,101,100,103,101, 95,109,111,100,101, 0,112, 97,100, 51, 91, 50, 93, 0,116, -111,116,111, 98,106, 0,116,111,116,108, 97,109,112, 0,116,111,116,111, 98,106,115,101,108, 0,116,111,116, 99,117,114,118,101, - 0,116,111,116,109,101,115,104, 0,116,111,116, 97,114,109, 97,116,117,114,101, 0, 42, 99, 97,109,101,114, 97, 0, 42,119,111, -114,108,100, 0, 42,115,101,116, 0, 98, 97,115,101, 0, 42, 98, 97,115, 97, 99,116, 0, 42,111, 98,101,100,105,116, 0, 99,117, -114,115,111,114, 91, 51, 93, 0,116,119, 99,101,110,116, 91, 51, 93, 0,116,119,109,105,110, 91, 51, 93, 0,116,119,109, 97,120, - 91, 51, 93, 0,101,100,105,116, 98,117,116,115,105,122,101, 0,115,101,108,101, 99,116,109,111,100,101, 0,112,114,111,112,111, -114,116,105,111,110, 97,108, 0,112,114,111,112, 95,109,111,100,101, 0, 97,117,116,111,109,101,114,103,101, 0,112, 97,100, 53, - 0, 97,117,116,111,107,101,121, 95,109,111,100,101, 0, 42,101,100, 0, 42,114, 97,100,105,111, 0,102,114, 97,109,105,110,103, - 0, 42,116,111,111,108,115,101,116,116,105,110,103,115, 0, 42,115,116, 97,116,115, 0,116,114, 97,110,115,102,111,114,109, 95, -115,112, 97, 99,101,115, 0,106,117,109,112,102,114, 97,109,101, 0,115,110, 97,112, 95,109,111,100,101, 0,115,110, 97,112, 95, -102,108, 97,103, 0,115,110, 97,112, 95,116, 97,114,103,101,116, 0, 42,116,104,101, 68, 97,103, 0,100, 97,103,105,115,118, 97, -108,105,100, 0,100, 97,103,102,108, 97,103,115, 0,102,114, 97,109,101, 95,115,116,101,112, 0, 97, 99,116,105,118,101, 95,107, -101,121,105,110,103,115,101,116, 0,107,101,121,105,110,103,115,101,116,115, 0,122,111,111,109, 0, 98,108,101,110,100, 0,120, -105,109, 0,121,105,109, 0,119,105,110,109, 97,116, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,109, 97,116, 91, 52, 93, 91, 52, - 93, 0,118,105,101,119,105,110,118, 91, 52, 93, 91, 52, 93, 0,112,101,114,115,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,101, -114,115,105,110,118, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,109, 97,116,111, 98, 91, 52, 93, 91, 52, 93, 0,112,101,114,115, -109, 97,116,111, 98, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,113,117, 97,116, 91, 52, 93, 0,122,102, 97, 99, 0, 99, 97,109, -100,120, 0, 99, 97,109,100,121, 0,112,105,120,115,105,122,101, 0, 99, 97,109,122,111,111,109, 0,118,105,101,119, 98,117,116, - 0,108, 97,115,116,109,111,100,101, 0,114,102,108, 97,103, 0,118,105,101,119,108,111, 99,107, 0,112,101,114,115,112, 0,118, -105,101,119, 0, 99,108,105,112, 91, 54, 93, 91, 52, 93, 0, 42, 99,108,105,112, 98, 98, 0, 42,103,112,100, 0, 42,108,111, 99, - 97,108,118,100, 0, 42,114,105, 0, 42,114,101,116,111,112,111, 95,118,105,101,119, 95,100, 97,116, 97, 0, 42,100,101,112,116, -104,115, 0, 42,115,109,115, 0, 42,115,109,111,111,116,104, 95,116,105,109,101,114, 0,108,118,105,101,119,113,117, 97,116, 91, - 52, 93, 0,108,112,101,114,115,112, 0,108,118,105,101,119, 0,114,101,103,105,111,110, 98, 97,115,101, 0,115,112, 97, 99,101, -116,121,112,101, 0, 98,108,111, 99,107,115, 99, 97,108,101, 0, 98,108,111, 99,107,104, 97,110,100,108,101,114, 91, 56, 93, 0, -108, 97,121, 95,117,115,101,100, 0, 42,111, 98, 95, 99,101,110,116,114,101, 0, 42, 98,103,112,105, 99, 0,111, 98, 95, 99,101, -110,116,114,101, 95, 98,111,110,101, 91, 51, 50, 93, 0,108, 97,121, 97, 99,116, 0,108,111, 99, 97,108,118,105,101,119, 0,115, - 99,101,110,101,108,111, 99,107, 0, 97,114,111,117,110,100, 0,102,108, 97,103, 50, 0,112,105,118,111,116, 95,108, 97,115,116, - 0,103,114,105,100, 0,103,114,105,100,118,105,101,119, 0,112, 97,100,102, 0,110,101, 97,114, 0,102, 97,114, 0,103,114,105, -100,108,105,110,101,115, 0,103,114,105,100,102,108, 97,103, 0,103,114,105,100,115,117, 98,100,105,118, 0,109,111,100,101,115, -101,108,101, 99,116, 0,107,101,121,102,108, 97,103,115, 0,116,119,116,121,112,101, 0,116,119,109,111,100,101, 0,116,119,102, -108, 97,103, 0,116,119,100,114, 97,119,102,108, 97,103, 0, 99,117,115,116,111,109,100, 97,116, 97, 95,109, 97,115,107, 0, 97, -102,116,101,114,100,114, 97,119, 0,122, 98,117,102, 0,120,114, 97,121, 0,110,100,111,102,109,111,100,101, 0,110,100,111,102, -102,105,108,116,101,114, 0, 42,112,114,111,112,101,114,116,105,101,115, 95,115,116,111,114, 97,103,101, 0,118,101,114,116, 0, -104,111,114, 0,109, 97,115,107, 0,109,105,110, 91, 50, 93, 0,109, 97,120, 91, 50, 93, 0,109,105,110,122,111,111,109, 0,109, - 97,120,122,111,111,109, 0,115, 99,114,111,108,108, 0,115, 99,114,111,108,108, 95,117,105, 0,107,101,101,112,116,111,116, 0, -107,101,101,112,122,111,111,109, 0,107,101,101,112,111,102,115, 0, 97,108,105,103,110, 0,119,105,110,120, 0,119,105,110,121, - 0,111,108,100,119,105,110,120, 0,111,108,100,119,105,110,121, 0, 99,117,114,115,111,114, 91, 50, 93, 0, 42,115, 99,114,101, -101,110, 0,118, 50,100, 0, 42, 97,100,115, 0,103,104,111,115,116, 67,117,114,118,101,115, 0, 97,117,116,111,115,110, 97,112, - 0,112,105,110, 0,108,111, 99,107, 0, 99,117,114,115,101,110,115, 0, 99,117,114, 97, 99,116, 0,116, 97, 98,111, 0,109, 97, -105,110, 98, 0,109, 97,105,110, 98,111, 0, 42,108,111, 99,107,112,111,105,110, 0,116,101,120,110,114, 0,116,101,120,102,114, -111,109, 0,115,104,111,119,103,114,111,117,112, 0,109,111,100,101,108,116,121,112,101, 0,115, 99,114,105,112,116, 98,108,111, - 99,107, 0,114,101, 95, 97,108,105,103,110, 0,111,108,100,107,101,121,112,114,101,115,115, 0,116, 97, 98, 91, 56, 93, 0, 99, -104, 97,110,115,104,111,119,110, 0,122,101, 98,114, 97, 0, 42,112, 97,114, 97,109,115, 0, 42,102,105,108,101,115, 0, 42,111, -112, 0, 42,108,111, 97,100,105,109, 97,103,101, 95,116,105,109,101,114, 0, 42,108, 97,121,111,117,116, 0,116,114,101,101, 0, - 42,116,114,101,101,115,116,111,114,101, 0,115,101, 97,114, 99,104, 95,115,116,114,105,110,103, 91, 51, 50, 93, 0,115,101, 97, -114, 99,104, 95,116,115,101, 0,115,101, 97,114, 99,104, 95,102,108, 97,103,115, 0,100,111, 95, 0,111,117,116,108,105,110,101, -118,105,115, 0,115,116,111,114,101,102,108, 97,103, 0, 42, 99,117,109, 97,112, 0,105,109, 97,110,114, 0, 99,117,114,116,105, -108,101, 0,105,109,116,121,112,101,110,114, 0,100,116, 95,117,118, 0,115,116,105, 99,107,121, 0,100,116, 95,117,118,115,116, -114,101,116, 99,104, 0, 99,101,110,116,120, 0, 99,101,110,116,121, 0, 42,116,101,120,116, 0,116,111,112, 0,118,105,101,119, -108,105,110,101,115, 0,108,104,101,105,103,104,116, 0,108,101,102,116, 0,115,104,111,119,108,105,110,101,110,114,115, 0,116, - 97, 98,110,117,109, 98,101,114, 0,115,104,111,119,115,121,110,116, 97,120, 0,111,118,101,114,119,114,105,116,101, 0,112,105, -120, 95,112,101,114, 95,108,105,110,101, 0,116,120,116,115, 99,114,111,108,108, 0,116,120,116, 98, 97,114, 0,119,111,114,100, -119,114, 97,112, 0,100,111,112,108,117,103,105,110,115, 0,102,105,110,100,115,116,114, 91, 50, 53, 54, 93, 0,114,101,112,108, - 97, 99,101,115,116,114, 91, 50, 53, 54, 93, 0, 42,112,121, 95,100,114, 97,119, 0, 42,112,121, 95,101,118,101,110,116, 0, 42, -112,121, 95, 98,117,116,116,111,110, 0, 42,112,121, 95, 98,114,111,119,115,101,114, 99, 97,108,108, 98, 97, 99,107, 0, 42,112, -121, 95,103,108,111, 98, 97,108,100,105, 99,116, 0,108, 97,115,116,115,112, 97, 99,101, 0,115, 99,114,105,112,116,110, 97,109, -101, 91, 50, 53, 54, 93, 0,115, 99,114,105,112,116, 97,114,103, 91, 50, 53, 54, 93, 0, 42,115, 99,114,105,112,116, 0, 42, 98, -117,116, 95,114,101,102,115, 0,114,101,100,114, 97,119,115, 0, 42,105,100, 0, 97,115,112,101, 99,116, 0, 42, 99,117,114,102, -111,110,116, 0,109,120, 0,109,121, 0, 42,101,100,105,116,116,114,101,101, 0,116,114,101,101,116,121,112,101, 0,116,105,116, -108,101, 91, 50, 52, 93, 0,100,105,114, 91, 50, 52, 48, 93, 0,102,105,108,101, 91, 56, 48, 93, 0,109,101,110,117, 0,115,111, -114,116, 0, 97, 99,116,105,118,101, 95,102,105,108,101, 0,110,117,109,116,105,108,101,115,120, 0,110,117,109,116,105,108,101, -115,121, 0,115,101,108,115,116, 97,116,101, 0,118,105,101,119,114,101, 99,116, 0, 98,111,111,107,109, 97,114,107,114,101, 99, -116, 0,115, 99,114,111,108,108,112,111,115, 0,115, 99,114,111,108,108,104,101,105,103,104,116, 0,115, 99,114,111,108,108, 97, -114,101, 97, 0,114,101,116,118, 97,108, 0, 97, 99,116,105,118,101, 95, 98,111,111,107,109, 97,114,107, 0,112,114,118, 95,119, - 0,112,114,118, 95,104, 0, 40, 42,114,101,116,117,114,110,102,117,110, 99, 41, 40, 41, 0, 40, 42,114,101,116,117,114,110,102, -117,110, 99, 95,101,118,101,110,116, 41, 40, 41, 0, 40, 42,114,101,116,117,114,110,102,117,110, 99, 95, 97,114,103,115, 41, 40, - 41, 0, 42, 97,114,103, 49, 0, 42, 97,114,103, 50, 0, 42,109,101,110,117,112, 0, 42,112,117,112,109,101,110,117, 0, 42,105, -109,103, 0,102,105,108,101,110, 97,109,101, 91, 50, 53, 54, 93, 0, 98,108,102, 95,105,100, 0,117,105,102,111,110,116, 95,105, -100, 0,114, 95,116,111, 95,108, 0,112,111,105,110,116,115, 0,105,116, 97,108,105, 99, 0, 98,111,108,100, 0,115,104, 97,100, -111,119, 0,115,104, 97,100,120, 0,115,104, 97,100,121, 0,115,104, 97,100,111,119, 97,108,112,104, 97, 0,115,104, 97,100,111, -119, 99,111,108,111,114, 0,112, 97,110,101,108,116,105,116,108,101, 0,103,114,111,117,112,108, 97, 98,101,108, 0,119,105,100, -103,101,116,108, 97, 98,101,108, 0,119,105,100,103,101,116, 0,109,105,110,108, 97, 98,101,108, 99,104, 97,114,115, 0,109,105, -110,119,105,100,103,101,116, 99,104, 97,114,115, 0, 99,111,108,117,109,110,115,112, 97, 99,101, 0,116,101,109,112,108, 97,116, -101,115,112, 97, 99,101, 0, 98,111,120,115,112, 97, 99,101, 0, 98,117,116,116,111,110,115,112, 97, 99,101,120, 0, 98,117,116, -116,111,110,115,112, 97, 99,101,121, 0,112, 97,110,101,108,115,112, 97, 99,101, 0,112, 97,110,101,108,111,117,116,101,114, 0, -111,117,116,108,105,110,101, 91, 52, 93, 0,105,110,110,101,114, 91, 52, 93, 0,105,110,110,101,114, 95,115,101,108, 91, 52, 93, - 0,105,116,101,109, 91, 52, 93, 0,116,101,120,116, 91, 52, 93, 0,116,101,120,116, 95,115,101,108, 91, 52, 93, 0,115,104, 97, -100,101,100, 0,115,104, 97,100,101,116,111,112, 0,115,104, 97,100,101,100,111,119,110, 0,119, 99,111,108, 95,114,101,103,117, -108, 97,114, 0,119, 99,111,108, 95,116,111,111,108, 0,119, 99,111,108, 95,114, 97,100,105,111, 0,119, 99,111,108, 95,116,101, -120,116, 0,119, 99,111,108, 95,111,112,116,105,111,110, 0,119, 99,111,108, 95,110,117,109, 0,119, 99,111,108, 95,110,117,109, -115,108,105,100,101,114, 0,119, 99,111,108, 95,109,101,110,117, 0,119, 99,111,108, 95,112,117,108,108,100,111,119,110, 0,119, - 99,111,108, 95,109,101,110,117, 95, 98, 97, 99,107, 0,119, 99,111,108, 95,109,101,110,117, 95,105,116,101,109, 0,105, 99,111, -110,102,105,108,101, 91, 56, 48, 93, 0, 98, 97, 99,107, 91, 52, 93, 0,116,105,116,108,101, 91, 52, 93, 0,116,101,120,116, 95, -104,105, 91, 52, 93, 0,104,101, 97,100,101,114, 91, 52, 93, 0,104,101, 97,100,101,114, 95,116,105,116,108,101, 91, 52, 93, 0, -104,101, 97,100,101,114, 95,116,101,120,116, 91, 52, 93, 0,104,101, 97,100,101,114, 95,116,101,120,116, 95,104,105, 91, 52, 93, - 0, 98,117,116,116,111,110, 91, 52, 93, 0, 98,117,116,116,111,110, 95,116,105,116,108,101, 91, 52, 93, 0, 98,117,116,116,111, -110, 95,116,101,120,116, 91, 52, 93, 0, 98,117,116,116,111,110, 95,116,101,120,116, 95,104,105, 91, 52, 93, 0,108,105,115,116, - 91, 52, 93, 0,108,105,115,116, 95,116,105,116,108,101, 91, 52, 93, 0,108,105,115,116, 95,116,101,120,116, 91, 52, 93, 0,108, -105,115,116, 95,116,101,120,116, 95,104,105, 91, 52, 93, 0,112, 97,110,101,108, 91, 52, 93, 0,112, 97,110,101,108, 95,116,105, -116,108,101, 91, 52, 93, 0,112, 97,110,101,108, 95,116,101,120,116, 91, 52, 93, 0,112, 97,110,101,108, 95,116,101,120,116, 95, -104,105, 91, 52, 93, 0,115,104, 97,100,101, 49, 91, 52, 93, 0,115,104, 97,100,101, 50, 91, 52, 93, 0,104,105,108,105,116,101, - 91, 52, 93, 0,103,114,105,100, 91, 52, 93, 0,119,105,114,101, 91, 52, 93, 0,115,101,108,101, 99,116, 91, 52, 93, 0,108, 97, -109,112, 91, 52, 93, 0, 97, 99,116,105,118,101, 91, 52, 93, 0,103,114,111,117,112, 91, 52, 93, 0,103,114,111,117,112, 95, 97, - 99,116,105,118,101, 91, 52, 93, 0,116,114, 97,110,115,102,111,114,109, 91, 52, 93, 0,118,101,114,116,101,120, 91, 52, 93, 0, -118,101,114,116,101,120, 95,115,101,108,101, 99,116, 91, 52, 93, 0,101,100,103,101, 91, 52, 93, 0,101,100,103,101, 95,115,101, -108,101, 99,116, 91, 52, 93, 0,101,100,103,101, 95,115,101, 97,109, 91, 52, 93, 0,101,100,103,101, 95,115,104, 97,114,112, 91, - 52, 93, 0,101,100,103,101, 95,102, 97, 99,101,115,101,108, 91, 52, 93, 0,102, 97, 99,101, 91, 52, 93, 0,102, 97, 99,101, 95, -115,101,108,101, 99,116, 91, 52, 93, 0,102, 97, 99,101, 95,100,111,116, 91, 52, 93, 0,110,111,114,109, 97,108, 91, 52, 93, 0, - 98,111,110,101, 95,115,111,108,105,100, 91, 52, 93, 0, 98,111,110,101, 95,112,111,115,101, 91, 52, 93, 0,115,116,114,105,112, - 91, 52, 93, 0,115,116,114,105,112, 95,115,101,108,101, 99,116, 91, 52, 93, 0, 99,102,114, 97,109,101, 91, 52, 93, 0,100,115, - 95, 99,104, 97,110,110,101,108, 91, 52, 93, 0,100,115, 95,115,117, 98, 99,104, 97,110,110,101,108, 91, 52, 93, 0,118,101,114, -116,101,120, 95,115,105,122,101, 0,102, 97, 99,101,100,111,116, 95,115,105,122,101, 0, 98,112, 97,100, 91, 50, 93, 0,115,121, -110,116, 97,120,108, 91, 52, 93, 0,115,121,110,116, 97,120,110, 91, 52, 93, 0,115,121,110,116, 97,120, 98, 91, 52, 93, 0,115, -121,110,116, 97,120,118, 91, 52, 93, 0,115,121,110,116, 97,120, 99, 91, 52, 93, 0,109,111,118,105,101, 91, 52, 93, 0,105,109, - 97,103,101, 91, 52, 93, 0,115, 99,101,110,101, 91, 52, 93, 0, 97,117,100,105,111, 91, 52, 93, 0,101,102,102,101, 99,116, 91, - 52, 93, 0,112,108,117,103,105,110, 91, 52, 93, 0,116,114, 97,110,115,105,116,105,111,110, 91, 52, 93, 0,109,101,116, 97, 91, - 52, 93, 0,101,100,105,116,109,101,115,104, 95, 97, 99,116,105,118,101, 91, 52, 93, 0,104, 97,110,100,108,101, 95,118,101,114, -116,101,120, 91, 52, 93, 0,104, 97,110,100,108,101, 95,118,101,114,116,101,120, 95,115,101,108,101, 99,116, 91, 52, 93, 0,104, - 97,110,100,108,101, 95,118,101,114,116,101,120, 95,115,105,122,101, 0,104,112, 97,100, 91, 51, 93, 0,115,111,108,105,100, 91, - 52, 93, 0,116,117,105, 0,116, 98,117,116,115, 0,116,118, 51,100, 0,116,102,105,108,101, 0,116,105,112,111, 0,116,105,110, -102,111, 0,116,115,110,100, 0,116, 97, 99,116, 0,116,110,108, 97, 0,116,115,101,113, 0,116,105,109, 97, 0,116,105,109, 97, -115,101,108, 0,116,101,120,116, 0,116,111,111,112,115, 0,116,116,105,109,101, 0,116,110,111,100,101, 0,116, 97,114,109, 91, - 50, 48, 93, 0,115,112,101, 99, 91, 52, 93, 0,100,117,112,102,108, 97,103, 0,115, 97,118,101,116,105,109,101, 0,116,101,109, -112,100,105,114, 91, 49, 54, 48, 93, 0,102,111,110,116,100,105,114, 91, 49, 54, 48, 93, 0,114,101,110,100,101,114,100,105,114, - 91, 49, 54, 48, 93, 0,116,101,120,116,117,100,105,114, 91, 49, 54, 48, 93, 0,112,108,117,103,116,101,120,100,105,114, 91, 49, - 54, 48, 93, 0,112,108,117,103,115,101,113,100,105,114, 91, 49, 54, 48, 93, 0,112,121,116,104,111,110,100,105,114, 91, 49, 54, - 48, 93, 0,115,111,117,110,100,100,105,114, 91, 49, 54, 48, 93, 0,121,102,101,120,112,111,114,116,100,105,114, 91, 49, 54, 48, - 93, 0,118,101,114,115,105,111,110,115, 0,103, 97,109,101,102,108, 97,103,115, 0,119,104,101,101,108,108,105,110,101,115, 99, -114,111,108,108, 0,117,105,102,108, 97,103, 0,108, 97,110,103,117, 97,103,101, 0,117,115,101,114,112,114,101,102, 0,118,105, -101,119,122,111,111,109, 0,109,105,120, 98,117,102,115,105,122,101, 0,100,112,105, 0,101,110, 99,111,100,105,110,103, 0,116, -114, 97,110,115,111,112,116,115, 0,109,101,110,117,116,104,114,101,115,104,111,108,100, 49, 0,109,101,110,117,116,104,114,101, -115,104,111,108,100, 50, 0,116,104,101,109,101,115, 0,117,105,102,111,110,116,115, 0,117,105,115,116,121,108,101,115, 0,117, -110,100,111,115,116,101,112,115, 0,117,110,100,111,109,101,109,111,114,121, 0,103,112, 95,109, 97,110,104, 97,116,116,101,110, -100,105,115,116, 0,103,112, 95,101,117, 99,108,105,100,101, 97,110,100,105,115,116, 0,103,112, 95,101,114, 97,115,101,114, 0, -103,112, 95,115,101,116,116,105,110,103,115, 0,116, 98, 95,108,101,102,116,109,111,117,115,101, 0,116, 98, 95,114,105,103,104, -116,109,111,117,115,101, 0,108,105,103,104,116, 91, 51, 93, 0,116,119, 95,104,111,116,115,112,111,116, 0,116,119, 95,102,108, - 97,103, 0,116,119, 95,104, 97,110,100,108,101,115,105,122,101, 0,116,119, 95,115,105,122,101, 0,116,101,120,116,105,109,101, -111,117,116, 0,116,101,120, 99,111,108,108,101, 99,116,114, 97,116,101, 0,119,109,100,114, 97,119,109,101,116,104,111,100, 0, -119,109,112, 97,100, 0,109,101,109, 99, 97, 99,104,101,108,105,109,105,116, 0,112,114,101,102,101,116, 99,104,102,114, 97,109, -101,115, 0,102,114, 97,109,101,115,101,114,118,101,114,112,111,114,116, 0,112, 97,100, 95,114,111,116, 95, 97,110,103,108,101, - 0,111, 98, 99,101,110,116,101,114, 95,100,105, 97, 0,114,118,105,115,105,122,101, 0,114,118,105, 98,114,105,103,104,116, 0, -114,101, 99,101,110,116, 95,102,105,108,101,115, 0,115,109,111,111,116,104, 95,118,105,101,119,116,120, 0,103,108,114,101,115, -108,105,109,105,116, 0,110,100,111,102, 95,112, 97,110, 0,110,100,111,102, 95,114,111,116, 97,116,101, 0, 99,117,114,115,115, -105,122,101, 0,105,112,111, 95,110,101,119, 0,118,101,114,115,101,109, 97,115,116,101,114, 91, 49, 54, 48, 93, 0,118,101,114, -115,101,117,115,101,114, 91, 49, 54, 48, 93, 0,103,108, 97,108,112,104, 97, 99,108,105,112, 0, 97,117,116,111,107,101,121, 95, -102,108, 97,103, 0, 99,111, 98, 97, 95,119,101,105,103,104,116, 0,118,101,114,116, 98, 97,115,101, 0,101,100,103,101, 98, 97, -115,101, 0, 97,114,101, 97, 98, 97,115,101, 0,102,117,108,108, 0,119,105,110,105,100, 0,100,111, 95,100,114, 97,119, 0,100, -111, 95,114,101,102,114,101,115,104, 0,100,111, 95,100,114, 97,119, 95,103,101,115,116,117,114,101, 0,100,111, 95,100,114, 97, -119, 95,112, 97,105,110,116, 99,117,114,115,111,114, 0,115,119, 97,112, 0,109, 97,105,110,119,105,110, 0,115,117, 98,119,105, -110, 97, 99,116,105,118,101, 0, 42, 97,110,105,109,116,105,109,101,114, 0, 42, 99,111,110,116,101,120,116, 0,104, 97,110,100, -108,101,114, 91, 56, 93, 0, 42,110,101,119,118, 0,118,101, 99, 0, 42,118, 49, 0, 42,118, 50, 0, 42,116,121,112,101, 0,112, - 97,110,101,108,110, 97,109,101, 91, 54, 52, 93, 0,116, 97, 98,110, 97,109,101, 91, 54, 52, 93, 0,100,114, 97,119,110, 97,109, -101, 91, 54, 52, 93, 0,111,102,115,120, 0,111,102,115,121, 0,115,105,122,101,120, 0,115,105,122,101,121, 0,108, 97, 98,101, -108,111,102,115, 0,114,117,110,116,105,109,101, 95,102,108, 97,103, 0, 99,111,110,116,114,111,108, 0,115,110, 97,112, 0,115, -111,114,116,111,114,100,101,114, 0, 42,112, 97,110,101,108,116, 97, 98, 0, 42, 97, 99,116,105,118,101,100, 97,116, 97, 0, 42, -118, 51, 0, 42,118, 52, 0, 42,102,117,108,108, 0, 98,117,116,115,112, 97, 99,101,116,121,112,101, 0,104,101, 97,100,101,114, -116,121,112,101, 0, 99,117,114,115,111,114, 0,115,112, 97, 99,101,100, 97,116, 97, 0,104, 97,110,100,108,101,114,115, 0, 97, - 99,116,105,111,110,122,111,110,101,115, 0,119,105,110,114, 99,116, 0,100,114, 97,119,114, 99,116, 0,115,119,105,110,105,100, - 0,114,101,103,105,111,110,116,121,112,101, 0, 97,108,105,103,110,109,101,110,116, 0,117,105, 98,108,111, 99,107,115, 0,112, - 97,110,101,108,115, 0, 42,104,101, 97,100,101,114,115,116,114, 0, 42,114,101,103,105,111,110,100, 97,116, 97, 0,115,117, 98, -118,115,116,114, 91, 52, 93, 0,115,117, 98,118,101,114,115,105,111,110, 0,112, 97,100,115, 0,109,105,110,118,101,114,115,105, -111,110, 0,109,105,110,115,117, 98,118,101,114,115,105,111,110, 0,100,105,115,112,108, 97,121,109,111,100,101, 0, 42, 99,117, -114,115, 99,114,101,101,110, 0, 42, 99,117,114,115, 99,101,110,101, 0,102,105,108,101,102,108, 97,103,115, 0,103,108,111, 98, - 97,108,102, 0,110, 97,109,101, 91, 56, 48, 93, 0, 42,105, 98,117,102, 0, 42,105, 98,117,102, 95, 99,111,109,112, 0, 42,115, -101, 49, 0, 42,115,101, 50, 0, 42,115,101, 51, 0,110,114, 0, 98,111,116,116,111,109, 0,114,105,103,104,116, 0,120,111,102, -115, 0,121,111,102,115, 0,108,105,102,116, 91, 51, 93, 0,103, 97,109,109, 97, 91, 51, 93, 0,103, 97,105,110, 91, 51, 93, 0, -115, 97,116,117,114, 97,116,105,111,110, 0,100,105,114, 91, 49, 54, 48, 93, 0,100,111,110,101, 0,115,116, 97,114,116,115,116, -105,108,108, 0,101,110,100,115,116,105,108,108, 0, 42,115,116,114,105,112,100, 97,116, 97, 0,111,114,120, 0,111,114,121, 0, - 42, 99,114,111,112, 0, 42,116,114, 97,110,115,102,111,114,109, 0, 42, 99,111,108,111,114, 95, 98, 97,108, 97,110, 99,101, 0, - 42,116,115,116,114,105,112,100, 97,116, 97, 0, 42,116,115,116,114,105,112,100, 97,116, 97, 95,115,116, 97,114,116,115,116,105, -108,108, 0, 42,116,115,116,114,105,112,100, 97,116, 97, 95,101,110,100,115,116,105,108,108, 0, 42,105, 98,117,102, 95,115,116, - 97,114,116,115,116,105,108,108, 0, 42,105, 98,117,102, 95,101,110,100,115,116,105,108,108, 0, 42,105,110,115,116, 97,110, 99, -101, 95,112,114,105,118, 97,116,101, 95,100, 97,116, 97, 0, 42, 42, 99,117,114,114,101,110,116, 95,112,114,105,118, 97,116,101, - 95,100, 97,116, 97, 0, 42,116,109,112, 0,115,116, 97,114,116,111,102,115, 0,101,110,100,111,102,115, 0,109, 97, 99,104,105, -110,101, 0,115,116, 97,114,116,100,105,115,112, 0,101,110,100,100,105,115,112, 0,104, 97,110,100,115,105,122,101, 0, 97,110, -105,109, 95,112,114,101,115,101,101,107, 0, 42,115,116,114,105,112, 0,102, 97, 99,102, 48, 0,102, 97, 99,102, 49, 0, 42,115, -101,113, 49, 0, 42,115,101,113, 50, 0, 42,115,101,113, 51, 0,115,101,113, 98, 97,115,101, 0, 42,115,111,117,110,100, 0, 42, -104,100, 97,117,100,105,111, 0,108,101,118,101,108, 0,112, 97,110, 0, 99,117,114,112,111,115, 0,115,116,114,111, 98,101, 0, - 42,101,102,102,101, 99,116,100, 97,116, 97, 0, 97,110,105,109, 95,115,116, 97,114,116,111,102,115, 0, 97,110,105,109, 95,101, -110,100,111,102,115, 0, 98,108,101,110,100, 95,109,111,100,101, 0, 98,108,101,110,100, 95,111,112, 97, 99,105,116,121, 0,115, - 99,101,110,101,110,114, 0, 42,111,108,100, 98, 97,115,101,112, 0, 42,112, 97,114,115,101,113, 0, 42,115,101,113, 98, 97,115, -101,112, 0,109,101,116, 97,115,116, 97, 99,107, 0, 42, 97, 99,116, 95,115,101,113, 0, 97, 99,116, 95,105,109, 97,103,101,100, -105,114, 91, 50, 53, 54, 93, 0, 97, 99,116, 95,115,111,117,110,100,100,105,114, 91, 50, 53, 54, 93, 0,101,100,103,101, 87,105, -100,116,104, 0,102,111,114,119, 97,114,100, 0,119,105,112,101,116,121,112,101, 0,102, 77,105,110,105, 0,102, 67,108, 97,109, -112, 0,102, 66,111,111,115,116, 0,100, 68,105,115,116, 0,100, 81,117, 97,108,105,116,121, 0, 98, 78,111, 67,111,109,112, 0, - 83, 99, 97,108,101,120, 73,110,105, 0, 83, 99, 97,108,101,121, 73,110,105, 0, 83, 99, 97,108,101,120, 70,105,110, 0, 83, 99, - 97,108,101,121, 70,105,110, 0,120, 73,110,105, 0,120, 70,105,110, 0,121, 73,110,105, 0,121, 70,105,110, 0,114,111,116, 73, -110,105, 0,114,111,116, 70,105,110, 0,105,110,116,101,114,112,111,108, 97,116,105,111,110, 0, 42,102,114, 97,109,101, 77, 97, -112, 0,103,108,111, 98, 97,108, 83,112,101,101,100, 0,108, 97,115,116, 86, 97,108,105,100, 70,114, 97,109,101, 0, 98,117,116, -116,121,112,101, 0,117,115,101,114,106,105,116, 0,115,116, 97, 0,116,111,116,112, 97,114,116, 0,110,111,114,109,102, 97, 99, - 0,111, 98,102, 97, 99, 0,114, 97,110,100,102, 97, 99, 0,116,101,120,102, 97, 99, 0,114, 97,110,100,108,105,102,101, 0,102, -111,114, 99,101, 91, 51, 93, 0,118,101, 99,116,115,105,122,101, 0,109, 97,120,108,101,110, 0,100,101,102,118,101, 99, 91, 51, - 93, 0,109,117,108,116, 91, 52, 93, 0,108,105,102,101, 91, 52, 93, 0, 99,104,105,108,100, 91, 52, 93, 0,109, 97,116, 91, 52, - 93, 0,116,101,120,109, 97,112, 0, 99,117,114,109,117,108,116, 0,115,116, 97,116,105, 99,115,116,101,112, 0,111,109, 97,116, - 0,116,105,109,101,116,101,120, 0,115,112,101,101,100,116,101,120, 0,102,108, 97,103, 50,110,101,103, 0,118,101,114,116,103, -114,111,117,112, 95,118, 0,118,103,114,111,117,112,110, 97,109,101, 91, 51, 50, 93, 0,118,103,114,111,117,112,110, 97,109,101, - 95,118, 91, 51, 50, 93, 0, 42,107,101,121,115, 0,109,105,110,102, 97, 99, 0,117,115,101,100, 0,117,115,101,100,101,108,101, -109, 0,111,116,121,112,101, 0,111,108,100, 0, 42,112,111,105,110, 0, 42,111,108,100,112,111,105,110, 0,114,101,115,101,116, -100,105,115,116, 0,108, 97,115,116,118, 97,108, 0, 42,109, 97, 0,107,101,121, 0,113,117, 97,108, 0,113,117, 97,108, 50, 0, -116, 97,114,103,101,116, 78, 97,109,101, 91, 51, 50, 93, 0,116,111,103,103,108,101, 78, 97,109,101, 91, 51, 50, 93, 0,118, 97, -108,117,101, 91, 51, 50, 93, 0,109, 97,120,118, 97,108,117,101, 91, 51, 50, 93, 0,100,101,108, 97,121, 0,100,117,114, 97,116, -105,111,110, 0,109, 97,116,101,114,105, 97,108, 78, 97,109,101, 91, 51, 50, 93, 0,100, 97,109,112,116,105,109,101,114, 0,112, -114,111,112,110, 97,109,101, 91, 51, 50, 93, 0,109, 97,116,110, 97,109,101, 91, 51, 50, 93, 0, 97,120,105,115,102,108, 97,103, - 0, 42,102,114,111,109, 79, 98,106,101, 99,116, 0,115,117, 98,106,101, 99,116, 91, 51, 50, 93, 0, 98,111,100,121, 91, 51, 50, - 93, 0,112,117,108,115,101, 0,102,114,101,113, 0,116,111,116,108,105,110,107,115, 0, 42, 42,108,105,110,107,115, 0,106,111, -121,105,110,100,101,120, 0, 97,120,105,115, 95,115,105,110,103,108,101, 0, 97,120,105,115,102, 0, 98,117,116,116,111,110, 0, -104, 97,116, 0,104, 97,116,102, 0,112,114,101, 99,105,115,105,111,110, 0,115,116,114, 91, 49, 50, 56, 93, 0, 42,109,121,110, -101,119, 0,105,110,112,117,116,115, 0,116,111,116,115,108,105,110,107,115, 0, 42, 42,115,108,105,110,107,115, 0,118, 97,108, -111, 0,115,116, 97,116,101, 95,109, 97,115,107, 0, 42, 97, 99,116, 0,102,114, 97,109,101, 80,114,111,112, 91, 51, 50, 93, 0, - 98,108,101,110,100,105,110, 0,112,114,105,111,114,105,116,121, 0,101,110,100, 95,114,101,115,101,116, 0,115,116,114,105,100, -101, 97,120,105,115, 0,115,116,114,105,100,101,108,101,110,103,116,104, 0,115,110,100,110,114, 0,112, 97,100, 49, 91, 50, 93, - 0,109, 97,107,101, 99,111,112,121, 0, 99,111,112,121,109, 97,100,101, 0,112, 97,100, 50, 91, 49, 93, 0,116,114, 97, 99,107, - 0, 42,109,101, 0,108,105,110, 86,101,108,111, 99,105,116,121, 91, 51, 93, 0, 97,110,103, 86,101,108,111, 99,105,116,121, 91, - 51, 93, 0,108,111, 99, 97,108,102,108, 97,103, 0,100,121,110, 95,111,112,101,114, 97,116,105,111,110, 0,102,111,114, 99,101, -108,111, 99, 91, 51, 93, 0,102,111,114, 99,101,114,111,116, 91, 51, 93, 0,108,105,110,101, 97,114,118,101,108,111, 99,105,116, -121, 91, 51, 93, 0, 97,110,103,117,108, 97,114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0, 98,117,116,115,116, 97, 0, 98, + 68, 78, 65, 49,176,206, 0, 0, 48,121,237, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 83, 68, 78, 65, 78, 65, 77, 69, + 49, 10, 0, 0, 42,110,101,120,116, 0, 42,112,114,101,118, 0, 42,100, 97,116, 97, 0, 42,102,105,114,115,116, 0, 42,108, 97, +115,116, 0,120, 0,121, 0,122, 0,119, 0,120,109,105,110, 0,120,109, 97,120, 0,121,109,105,110, 0,121,109, 97,120, 0, 42, +112,111,105,110,116,101,114, 0,103,114,111,117,112, 0,118, 97,108, 0,118, 97,108, 50, 0,116,121,112,101, 0,115,117, 98,116, +121,112,101, 0,102,108, 97,103, 0,110, 97,109,101, 91, 51, 50, 93, 0,115, 97,118,101,100, 0,100, 97,116, 97, 0,108,101,110, + 0,116,111,116, 97,108,108,101,110, 0, 42,110,101,119,105,100, 0, 42,108,105, 98, 0,110, 97,109,101, 91, 50, 52, 93, 0,117, +115, 0,105, 99,111,110, 95,105,100, 0, 42,112,114,111,112,101,114,116,105,101,115, 0,105,100, 0, 42,105,100, 98,108,111, 99, +107, 0, 42,102,105,108,101,100, 97,116, 97, 0,110, 97,109,101, 91, 50, 52, 48, 93, 0,102,105,108,101,110, 97,109,101, 91, 50, + 52, 48, 93, 0,116,111,116, 0,112, 97,100, 0, 42,112, 97,114,101,110,116, 0,119, 91, 50, 93, 0,104, 91, 50, 93, 0, 99,104, + 97,110,103,101,100, 91, 50, 93, 0,112, 97,100, 48, 0,112, 97,100, 49, 0, 42,114,101, 99,116, 91, 50, 93, 0, 42,111, 98, 0, + 98,108,111, 99,107,116,121,112,101, 0, 97,100,114, 99,111,100,101, 0,110, 97,109,101, 91, 49, 50, 56, 93, 0, 42, 98,112, 0, + 42, 98,101,122,116, 0,109, 97,120,114, 99,116, 0,116,111,116,114, 99,116, 0,118, 97,114,116,121,112,101, 0,116,111,116,118, +101,114,116, 0,105,112,111, 0,101,120,116,114, 97,112, 0,114,116, 0, 98,105,116,109, 97,115,107, 0,115,108,105,100,101, 95, +109,105,110, 0,115,108,105,100,101, 95,109, 97,120, 0, 99,117,114,118, 97,108, 0, 42,100,114,105,118,101,114, 0, 99,117,114, +118,101, 0, 99,117,114, 0,115,104,111,119,107,101,121, 0,109,117,116,101,105,112,111, 0,112,111,115, 0,114,101,108, 97,116, +105,118,101, 0,116,111,116,101,108,101,109, 0,112, 97,100, 50, 0, 42,119,101,105,103,104,116,115, 0,118,103,114,111,117,112, + 91, 51, 50, 93, 0,115,108,105,100,101,114,109,105,110, 0,115,108,105,100,101,114,109, 97,120, 0, 42, 97,100,116, 0, 42,114, +101,102,107,101,121, 0,101,108,101,109,115,116,114, 91, 51, 50, 93, 0,101,108,101,109,115,105,122,101, 0, 98,108,111, 99,107, + 0, 42,105,112,111, 0, 42,102,114,111,109, 0,116,111,116,107,101,121, 0,115,108,117,114,112,104, 0, 42, 42,115, 99,114,105, +112,116,115, 0, 42,102,108, 97,103, 0, 97, 99,116,115, 99,114,105,112,116, 0,116,111,116,115, 99,114,105,112,116, 0, 42,108, +105,110,101, 0, 42,102,111,114,109, 97,116, 0, 98,108,101,110, 0,108,105,110,101,110,111, 0,115,116, 97,114,116, 0,101,110, +100, 0,102,108, 97,103,115, 0, 99,111,108,111,114, 91, 52, 93, 0,112, 97,100, 91, 52, 93, 0, 42,110, 97,109,101, 0,110,108, +105,110,101,115, 0,108,105,110,101,115, 0, 42, 99,117,114,108, 0, 42,115,101,108,108, 0, 99,117,114, 99, 0,115,101,108, 99, + 0,109, 97,114,107,101,114,115, 0, 42,117,110,100,111, 95, 98,117,102, 0,117,110,100,111, 95,112,111,115, 0,117,110,100,111, + 95,108,101,110, 0, 42, 99,111,109,112,105,108,101,100, 0,109,116,105,109,101, 0,115,105,122,101, 0,115,101,101,107, 0,112, + 97,115,115,101,112, 97,114,116, 97,108,112,104, 97, 0, 97,110,103,108,101, 0, 99,108,105,112,115,116, 97, 0, 99,108,105,112, +101,110,100, 0,108,101,110,115, 0,111,114,116,104,111, 95,115, 99, 97,108,101, 0,100,114, 97,119,115,105,122,101, 0,115,104, +105,102,116,120, 0,115,104,105,102,116,121, 0, 89, 70, 95,100,111,102,100,105,115,116, 0, 89, 70, 95, 97,112,101,114,116,117, +114,101, 0, 89, 70, 95, 98,107,104,116,121,112,101, 0, 89, 70, 95, 98,107,104, 98,105, 97,115, 0, 89, 70, 95, 98,107,104,114, +111,116, 0,115, 99,114,105,112,116,108,105,110,107, 0, 42,100,111,102, 95,111, 98, 0,102,114, 97,109,101,110,114, 0,102,114, + 97,109,101,115, 0,111,102,102,115,101,116, 0,115,102,114, 97, 0,102,105,101, 95,105,109, 97, 0, 99,121, 99,108, 0,111,107, + 0,109,117,108,116,105, 95,105,110,100,101,120, 0,108, 97,121,101,114, 0,112, 97,115,115, 0,109,101,110,117,110,114, 0, 42, +115, 99,101,110,101, 0,105, 98,117,102,115, 0, 42,103,112,117,116,101,120,116,117,114,101, 0, 42, 97,110,105,109, 0, 42,114, +114, 0,115,111,117,114, 99,101, 0,108, 97,115,116,102,114, 97,109,101, 0,116,112, 97,103,101,102,108, 97,103, 0,116,111,116, + 98,105,110,100, 0,120,114,101,112, 0,121,114,101,112, 0,116,119,115,116, 97, 0,116,119,101,110,100, 0, 98,105,110,100, 99, +111,100,101, 0, 42,114,101,112, 98,105,110,100, 0, 42,112, 97, 99,107,101,100,102,105,108,101, 0, 42,112,114,101,118,105,101, +119, 0, 42,114,101,110,100,101,114, 95,116,101,120,116, 0,108, 97,115,116,117,112,100, 97,116,101, 0,108, 97,115,116,117,115, +101,100, 0, 97,110,105,109,115,112,101,101,100, 0,103,101,110, 95,120, 0,103,101,110, 95,121, 0,103,101,110, 95,116,121,112, +101, 0, 97,115,112,120, 0, 97,115,112,121, 0,116,101,120, 99,111, 0,109, 97,112,116,111, 0,109, 97,112,116,111,110,101,103, + 0, 98,108,101,110,100,116,121,112,101, 0, 42,111, 98,106,101, 99,116, 0, 42,116,101,120, 0,117,118,110, 97,109,101, 91, 51, + 50, 93, 0,112,114,111,106,120, 0,112,114,111,106,121, 0,112,114,111,106,122, 0,109, 97,112,112,105,110,103, 0,111,102,115, + 91, 51, 93, 0,115,105,122,101, 91, 51, 93, 0,116,101,120,102,108, 97,103, 0, 99,111,108,111,114,109,111,100,101,108, 0,112, +109, 97,112,116,111, 0,112,109, 97,112,116,111,110,101,103, 0,110,111,114,109, 97,112,115,112, 97, 99,101, 0,119,104,105, 99, +104, 95,111,117,116,112,117,116, 0,112, 97,100, 91, 50, 93, 0,114, 0,103, 0, 98, 0,107, 0,100,101,102, 95,118, 97,114, 0, + 99,111,108,102, 97, 99, 0,110,111,114,102, 97, 99, 0,118, 97,114,102, 97, 99, 0,100,105,115,112,102, 97, 99, 0,119, 97,114, +112,102, 97, 99, 0,110, 97,109,101, 91, 49, 54, 48, 93, 0, 42,104, 97,110,100,108,101, 0, 42,112,110, 97,109,101, 0, 42,115, +116,110, 97,109,101,115, 0,115,116,121,112,101,115, 0,118, 97,114,115, 0, 42,118, 97,114,115,116,114, 0, 42,114,101,115,117, +108,116, 0, 42, 99,102,114, 97, 0,100, 97,116, 97, 91, 51, 50, 93, 0, 40, 42,100,111,105,116, 41, 40, 41, 0, 40, 42,105,110, +115,116, 97,110, 99,101, 95,105,110,105,116, 41, 40, 41, 0, 40, 42, 99, 97,108,108, 98, 97, 99,107, 41, 40, 41, 0,118,101,114, +115,105,111,110, 0, 97, 0,105,112,111,116,121,112,101, 0, 42,105,109, 97, 0, 42, 99,117, 98,101, 91, 54, 93, 0,105,109, 97, +116, 91, 52, 93, 91, 52, 93, 0,111, 98,105,109, 97,116, 91, 51, 93, 91, 51, 93, 0,115,116,121,112,101, 0,118,105,101,119,115, + 99, 97,108,101, 0,110,111,116,108, 97,121, 0, 99,117, 98,101,114,101,115, 0,100,101,112,116,104, 0,114,101, 99, 97,108, 99, + 0,108, 97,115,116,115,105,122,101, 0,110,111,105,115,101,115,105,122,101, 0,116,117,114, 98,117,108, 0, 98,114,105,103,104, +116, 0, 99,111,110,116,114, 97,115,116, 0,114,102, 97, 99, 0,103,102, 97, 99, 0, 98,102, 97, 99, 0,102,105,108,116,101,114, +115,105,122,101, 0,109,103, 95, 72, 0,109,103, 95,108, 97, 99,117,110, 97,114,105,116,121, 0,109,103, 95,111, 99,116, 97,118, +101,115, 0,109,103, 95,111,102,102,115,101,116, 0,109,103, 95,103, 97,105,110, 0,100,105,115,116, 95, 97,109,111,117,110,116, + 0,110,115, 95,111,117,116,115, 99, 97,108,101, 0,118,110, 95,119, 49, 0,118,110, 95,119, 50, 0,118,110, 95,119, 51, 0,118, +110, 95,119, 52, 0,118,110, 95,109,101,120,112, 0,118,110, 95,100,105,115,116,109, 0,118,110, 95, 99,111,108,116,121,112,101, + 0,110,111,105,115,101,100,101,112,116,104, 0,110,111,105,115,101,116,121,112,101, 0,110,111,105,115,101, 98, 97,115,105,115, + 0,110,111,105,115,101, 98, 97,115,105,115, 50, 0,105,109, 97,102,108, 97,103, 0, 99,114,111,112,120,109,105,110, 0, 99,114, +111,112,121,109,105,110, 0, 99,114,111,112,120,109, 97,120, 0, 99,114,111,112,121,109, 97,120, 0,120,114,101,112,101, 97,116, + 0,121,114,101,112,101, 97,116, 0,101,120,116,101,110,100, 0, 99,104,101, 99,107,101,114,100,105,115,116, 0,110, 97, 98,108, + 97, 0,105,117,115,101,114, 0, 42,110,111,100,101,116,114,101,101, 0, 42,112,108,117,103,105,110, 0, 42, 99,111, 98, 97, 0, + 42,101,110,118, 0,117,115,101, 95,110,111,100,101,115, 0,112, 97,100, 91, 55, 93, 0,108,111, 99, 91, 51, 93, 0,114,111,116, + 91, 51, 93, 0,109, 97,116, 91, 52, 93, 91, 52, 93, 0,109,105,110, 91, 51, 93, 0,109, 97,120, 91, 51, 93, 0,109,111,100,101, + 0,116,111,116,101,120, 0,115,104,100,119,114, 0,115,104,100,119,103, 0,115,104,100,119, 98, 0,115,104,100,119,112, 97,100, + 0,101,110,101,114,103,121, 0,100,105,115,116, 0,115,112,111,116,115,105,122,101, 0,115,112,111,116, 98,108,101,110,100, 0, +104, 97,105,110,116, 0, 97,116,116, 49, 0, 97,116,116, 50, 0, 42, 99,117,114,102, 97,108,108,111,102,102, 0,102, 97,108,108, +111,102,102, 95,116,121,112,101, 0,115,104, 97,100,115,112,111,116,115,105,122,101, 0, 98,105, 97,115, 0,115,111,102,116, 0, + 98,117,102,115,105,122,101, 0,115, 97,109,112, 0, 98,117,102,102,101,114,115, 0,102,105,108,116,101,114,116,121,112,101, 0, + 98,117,102,102,108, 97,103, 0, 98,117,102,116,121,112,101, 0,114, 97,121, 95,115, 97,109,112, 0,114, 97,121, 95,115, 97,109, +112,121, 0,114, 97,121, 95,115, 97,109,112,122, 0,114, 97,121, 95,115, 97,109,112, 95,116,121,112,101, 0, 97,114,101, 97, 95, +115,104, 97,112,101, 0, 97,114,101, 97, 95,115,105,122,101, 0, 97,114,101, 97, 95,115,105,122,101,121, 0, 97,114,101, 97, 95, +115,105,122,101,122, 0, 97,100, 97,112,116, 95,116,104,114,101,115,104, 0,114, 97,121, 95,115, 97,109,112, 95,109,101,116,104, +111,100, 0,116,101,120, 97, 99,116, 0,115,104, 97,100,104, 97,108,111,115,116,101,112, 0,115,117,110, 95,101,102,102,101, 99, +116, 95,116,121,112,101, 0,115,107,121, 98,108,101,110,100,116,121,112,101, 0,104,111,114,105,122,111,110, 95, 98,114,105,103, +104,116,110,101,115,115, 0,115,112,114,101, 97,100, 0,115,117,110, 95, 98,114,105,103,104,116,110,101,115,115, 0,115,117,110, + 95,115,105,122,101, 0, 98, 97, 99,107,115, 99, 97,116,116,101,114,101,100, 95,108,105,103,104,116, 0,115,117,110, 95,105,110, +116,101,110,115,105,116,121, 0, 97,116,109, 95,116,117,114, 98,105,100,105,116,121, 0, 97,116,109, 95,105,110,115, 99, 97,116, +116,101,114,105,110,103, 95,102, 97, 99,116,111,114, 0, 97,116,109, 95,101,120,116,105,110, 99,116,105,111,110, 95,102, 97, 99, +116,111,114, 0, 97,116,109, 95,100,105,115,116, 97,110, 99,101, 95,102, 97, 99,116,111,114, 0,115,107,121, 98,108,101,110,100, +102, 97, 99, 0,115,107,121, 95,101,120,112,111,115,117,114,101, 0,115,107,121, 95, 99,111,108,111,114,115,112, 97, 99,101, 0, +112, 97,100, 52, 0, 89, 70, 95,110,117,109,112,104,111,116,111,110,115, 0, 89, 70, 95,110,117,109,115,101, 97,114, 99,104, 0, + 89, 70, 95,112,104,100,101,112,116,104, 0, 89, 70, 95,117,115,101,113,109, 99, 0, 89, 70, 95, 98,117,102,115,105,122,101, 0, + 89, 70, 95,112, 97,100, 0, 89, 70, 95, 99, 97,117,115,116,105, 99, 98,108,117,114, 0, 89, 70, 95,108,116,114, 97,100,105,117, +115, 0, 89, 70, 95,103,108,111,119,105,110,116, 0, 89, 70, 95,103,108,111,119,111,102,115, 0, 89, 70, 95,103,108,111,119,116, +121,112,101, 0, 89, 70, 95,112, 97,100, 50, 0, 42,109,116,101,120, 91, 49, 56, 93, 0,109, 97,116,101,114,105, 97,108, 95,116, +121,112,101, 0,115,112,101, 99,114, 0,115,112,101, 99,103, 0,115,112,101, 99, 98, 0,109,105,114,114, 0,109,105,114,103, 0, +109,105,114, 98, 0, 97,109, 98,114, 0, 97,109, 98, 98, 0, 97,109, 98,103, 0, 97,109, 98, 0,101,109,105,116, 0, 97,110,103, + 0,115,112,101, 99,116,114, 97, 0,114, 97,121, 95,109,105,114,114,111,114, 0, 97,108,112,104, 97, 0,114,101,102, 0,115,112, +101, 99, 0,122,111,102,102,115, 0, 97,100,100, 0,116,114, 97,110,115,108,117, 99,101,110, 99,121, 0,102,114,101,115,110,101, +108, 95,109,105,114, 0,102,114,101,115,110,101,108, 95,109,105,114, 95,105, 0,102,114,101,115,110,101,108, 95,116,114, 97, 0, +102,114,101,115,110,101,108, 95,116,114, 97, 95,105, 0,102,105,108,116,101,114, 0,116,120, 95,108,105,109,105,116, 0,116,120, + 95,102, 97,108,108,111,102,102, 0,114, 97,121, 95,100,101,112,116,104, 0,114, 97,121, 95,100,101,112,116,104, 95,116,114, 97, + 0,104, 97,114, 0,115,101,101,100, 49, 0,115,101,101,100, 50, 0,103,108,111,115,115, 95,109,105,114, 0,103,108,111,115,115, + 95,116,114, 97, 0,115, 97,109,112, 95,103,108,111,115,115, 95,109,105,114, 0,115, 97,109,112, 95,103,108,111,115,115, 95,116, +114, 97, 0, 97,100, 97,112,116, 95,116,104,114,101,115,104, 95,109,105,114, 0, 97,100, 97,112,116, 95,116,104,114,101,115,104, + 95,116,114, 97, 0, 97,110,105,115,111, 95,103,108,111,115,115, 95,109,105,114, 0,100,105,115,116, 95,109,105,114, 0,102, 97, +100,101,116,111, 95,109,105,114, 0,115,104, 97,100,101, 95,102,108, 97,103, 0,109,111,100,101, 95,108, 0,102,108, 97,114,101, + 99, 0,115,116, 97,114, 99, 0,108,105,110,101, 99, 0,114,105,110,103, 99, 0,104, 97,115,105,122,101, 0,102,108, 97,114,101, +115,105,122,101, 0,115,117, 98,115,105,122,101, 0,102,108, 97,114,101, 98,111,111,115,116, 0,115,116,114, 97,110,100, 95,115, +116, 97, 0,115,116,114, 97,110,100, 95,101,110,100, 0,115,116,114, 97,110,100, 95,101, 97,115,101, 0,115,116,114, 97,110,100, + 95,115,117,114,102,110,111,114, 0,115,116,114, 97,110,100, 95,109,105,110, 0,115,116,114, 97,110,100, 95,119,105,100,116,104, +102, 97,100,101, 0,115,116,114, 97,110,100, 95,117,118,110, 97,109,101, 91, 51, 50, 93, 0,115, 98,105, 97,115, 0,108, 98,105, + 97,115, 0,115,104, 97,100, 95, 97,108,112,104, 97, 0,115,101,112,116,101,120, 0,114,103, 98,115,101,108, 0,112,114, 95,116, +121,112,101, 0,112,114, 95, 98, 97, 99,107, 0,112,114, 95,108, 97,109,112, 0,109,108, 95,102,108, 97,103, 0,100,105,102,102, + 95,115,104, 97,100,101,114, 0,115,112,101, 99, 95,115,104, 97,100,101,114, 0,114,111,117,103,104,110,101,115,115, 0,114,101, +102,114, 97, 99, 0,112, 97,114, 97,109, 91, 52, 93, 0,114,109,115, 0,100, 97,114,107,110,101,115,115, 0, 42,114, 97,109,112, + 95, 99,111,108, 0, 42,114, 97,109,112, 95,115,112,101, 99, 0,114, 97,109,112,105,110, 95, 99,111,108, 0,114, 97,109,112,105, +110, 95,115,112,101, 99, 0,114, 97,109,112, 98,108,101,110,100, 95, 99,111,108, 0,114, 97,109,112, 98,108,101,110,100, 95,115, +112,101, 99, 0,114, 97,109,112, 95,115,104,111,119, 0,112, 97,100, 51, 0,114, 97,109,112,102, 97, 99, 95, 99,111,108, 0,114, + 97,109,112,102, 97, 99, 95,115,112,101, 99, 0, 42,103,114,111,117,112, 0,102,114,105, 99,116,105,111,110, 0,102,104, 0,114, +101,102,108,101, 99,116, 0,102,104,100,105,115,116, 0,120,121,102,114,105, 99,116, 0,100,121,110, 97,109,111,100,101, 0,115, +115,115, 95,114, 97,100,105,117,115, 91, 51, 93, 0,115,115,115, 95, 99,111,108, 91, 51, 93, 0,115,115,115, 95,101,114,114,111, +114, 0,115,115,115, 95,115, 99, 97,108,101, 0,115,115,115, 95,105,111,114, 0,115,115,115, 95, 99,111,108,102, 97, 99, 0,115, +115,115, 95,116,101,120,102, 97, 99, 0,115,115,115, 95,102,114,111,110,116, 0,115,115,115, 95, 98, 97, 99,107, 0,115,115,115, + 95,102,108, 97,103, 0,115,115,115, 95,112,114,101,115,101,116, 0, 89, 70, 95, 97,114, 0, 89, 70, 95, 97,103, 0, 89, 70, 95, + 97, 98, 0, 89, 70, 95,100,115, 99, 97,108,101, 0, 89, 70, 95,100,112,119,114, 0, 89, 70, 95,100,115,109,112, 0, 89, 70, 95, +112,114,101,115,101,116, 0, 89, 70, 95,100,106,105,116, 0,103,112,117,109, 97,116,101,114,105, 97,108, 0,110, 97,109,101, 91, + 50, 53, 54, 93, 0, 42, 98, 98, 0,105, 49, 0,106, 49, 0,107, 49, 0,105, 50, 0,106, 50, 0,107, 50, 0,115,101,108, 99,111, +108, 49, 0,115,101,108, 99,111,108, 50, 0,113,117, 97,116, 91, 52, 93, 0,101,120,112,120, 0,101,120,112,121, 0,101,120,112, +122, 0,114, 97,100, 0,114, 97,100, 50, 0,115, 0, 42,109, 97,116, 0, 42,105,109, 97,116, 0,101,108,101,109,115, 0,100,105, +115,112, 0, 42,101,100,105,116,101,108,101,109,115, 0, 42, 42,109, 97,116, 0,116,111,116, 99,111,108, 0,119,105,114,101,115, +105,122,101, 0,114,101,110,100,101,114,115,105,122,101, 0,116,104,114,101,115,104, 0,118,101, 99, 91, 51, 93, 91, 51, 93, 0, + 97,108,102, 97, 0,119,101,105,103,104,116, 0,114, 97,100,105,117,115, 0,104, 49, 0,104, 50, 0,102, 49, 0,102, 50, 0,102, + 51, 0,104,105,100,101, 0,118,101, 99, 91, 52, 93, 0,109, 97,116, 95,110,114, 0,112,110,116,115,117, 0,112,110,116,115,118, + 0,114,101,115,111,108,117, 0,114,101,115,111,108,118, 0,111,114,100,101,114,117, 0,111,114,100,101,114,118, 0,102,108, 97, +103,117, 0,102,108, 97,103,118, 0, 42,107,110,111,116,115,117, 0, 42,107,110,111,116,115,118, 0,116,105,108,116, 95,105,110, +116,101,114,112, 0,114, 97,100,105,117,115, 95,105,110,116,101,114,112, 0, 99,104, 97,114,105,100,120, 0,107,101,114,110, 0, +104, 0,110,117,114, 98, 0, 42,101,100,105,116,110,117,114, 98, 0, 42, 98,101,118,111, 98,106, 0, 42,116, 97,112,101,114,111, + 98,106, 0, 42,116,101,120,116,111,110, 99,117,114,118,101, 0, 42,112, 97,116,104, 0, 42,107,101,121, 0, 98,101,118, 0,112, + 97,116,104,108,101,110, 0, 98,101,118,114,101,115,111,108, 0,119,105,100,116,104, 0,101,120,116, 49, 0,101,120,116, 50, 0, +114,101,115,111,108,117, 95,114,101,110, 0,114,101,115,111,108,118, 95,114,101,110, 0, 97, 99,116,110,117, 0, 42,108, 97,115, +116,115,101,108, 98,112, 0,115,112, 97, 99,101,109,111,100,101, 0,115,112, 97, 99,105,110,103, 0,108,105,110,101,100,105,115, +116, 0,115,104,101, 97,114, 0,102,115,105,122,101, 0,119,111,114,100,115,112, 97, 99,101, 0,117,108,112,111,115, 0,117,108, +104,101,105,103,104,116, 0,120,111,102, 0,121,111,102, 0,108,105,110,101,119,105,100,116,104, 0, 42,115,116,114, 0, 42,115, +101,108, 98,111,120,101,115, 0, 42,101,100,105,116,102,111,110,116, 0,102, 97,109,105,108,121, 91, 50, 52, 93, 0, 42,118,102, +111,110,116, 0, 42,118,102,111,110,116, 98, 0, 42,118,102,111,110,116,105, 0, 42,118,102,111,110,116, 98,105, 0,115,101,112, + 99,104, 97,114, 0, 99,116,105,109,101, 0,116,111,116, 98,111,120, 0, 97, 99,116, 98,111,120, 0, 42,116, 98, 0,115,101,108, +115,116, 97,114,116, 0,115,101,108,101,110,100, 0, 42,115,116,114,105,110,102,111, 0, 99,117,114,105,110,102,111, 0,101,102, +102,101, 99,116, 0, 42,109,102, 97, 99,101, 0, 42,109,116,102, 97, 99,101, 0, 42,116,102, 97, 99,101, 0, 42,109,118,101,114, +116, 0, 42,109,101,100,103,101, 0, 42,100,118,101,114,116, 0, 42,109, 99,111,108, 0, 42,109,115,116,105, 99,107,121, 0, 42, +116,101,120, 99,111,109,101,115,104, 0, 42,109,115,101,108,101, 99,116, 0, 42,101,100,105,116, 95,109,101,115,104, 0,118,100, + 97,116, 97, 0,101,100, 97,116, 97, 0,102,100, 97,116, 97, 0,116,111,116,101,100,103,101, 0,116,111,116,102, 97, 99,101, 0, +116,111,116,115,101,108,101, 99,116, 0, 97, 99,116, 95,102, 97, 99,101, 0, 99,117, 98,101,109, 97,112,115,105,122,101, 0,100, +114, 97,119,102,108, 97,103, 0,115,109,111,111,116,104,114,101,115,104, 0,115,117, 98,100,105,118, 0,115,117, 98,100,105,118, +114, 0,115,117, 98,115,117,114,102,116,121,112,101, 0, 42,109,114, 0, 42,112,118, 0, 42,116,112, 97,103,101, 0,117,118, 91, + 52, 93, 91, 50, 93, 0, 99,111,108, 91, 52, 93, 0,116,114, 97,110,115,112, 0,116,105,108,101, 0,117,110,119,114, 97,112, 0, +118, 49, 0,118, 50, 0,118, 51, 0,118, 52, 0,101,100, 99,111,100,101, 0, 99,114,101, 97,115,101, 0, 98,119,101,105,103,104, +116, 0,100,101,102, 95,110,114, 0, 42,100,119, 0,116,111,116,119,101,105,103,104,116, 0, 99,111, 91, 51, 93, 0,110,111, 91, + 51, 93, 0,117,118, 91, 50, 93, 0, 99,111, 91, 50, 93, 0,105,110,100,101,120, 0,102, 0,105, 0,115, 91, 50, 53, 54, 93, 0, +116,111,116,100,105,115,112, 0, 40, 42,100,105,115,112,115, 41, 40, 41, 0,118, 91, 52, 93, 0,109,105,100, 0,118, 91, 50, 93, + 0, 42,102, 97, 99,101,115, 0, 42, 99,111,108,102, 97, 99,101,115, 0, 42,101,100,103,101,115, 0, 42,118,101,114,116,115, 0, +108,101,118,101,108,115, 0,108,101,118,101,108, 95, 99,111,117,110,116, 0, 99,117,114,114,101,110,116, 0,110,101,119,108,118, +108, 0,101,100,103,101,108,118,108, 0,112,105,110,108,118,108, 0,114,101,110,100,101,114,108,118,108, 0,117,115,101, 95, 99, +111,108, 0, 42,101,100,103,101, 95,102,108, 97,103,115, 0, 42,101,100,103,101, 95, 99,114,101, 97,115,101,115, 0, 42,118,101, +114,116, 95,109, 97,112, 0, 42,101,100,103,101, 95,109, 97,112, 0, 42,111,108,100, 95,102, 97, 99,101,115, 0, 42,111,108,100, + 95,101,100,103,101,115, 0, 42,101,114,114,111,114, 0,109,111,100,105,102,105,101,114, 0,115,117, 98,100,105,118, 84,121,112, +101, 0,114,101,110,100,101,114, 76,101,118,101,108,115, 0, 42,101,109, 67, 97, 99,104,101, 0, 42,109, 67, 97, 99,104,101, 0, +100,101,102, 97,120,105,115, 0,112, 97,100, 91, 54, 93, 0,108,101,110,103,116,104, 0,114, 97,110,100,111,109,105,122,101, 0, +115,101,101,100, 0, 42,111, 98, 95, 97,114,109, 0, 42,115,116, 97,114,116, 95, 99, 97,112, 0, 42,101,110,100, 95, 99, 97,112, + 0, 42, 99,117,114,118,101, 95,111, 98, 0, 42,111,102,102,115,101,116, 95,111, 98, 0,111,102,102,115,101,116, 91, 51, 93, 0, +115, 99, 97,108,101, 91, 51, 93, 0,109,101,114,103,101, 95,100,105,115,116, 0,102,105,116, 95,116,121,112,101, 0,111,102,102, +115,101,116, 95,116,121,112,101, 0, 99,111,117,110,116, 0, 97,120,105,115, 0,116,111,108,101,114, 97,110, 99,101, 0, 42,109, +105,114,114,111,114, 95,111, 98, 0,115,112,108,105,116, 95, 97,110,103,108,101, 0,118, 97,108,117,101, 0,114,101,115, 0,118, + 97,108, 95,102,108, 97,103,115, 0,108,105,109, 95,102,108, 97,103,115, 0,101, 95,102,108, 97,103,115, 0, 98,101,118,101,108, + 95, 97,110,103,108,101, 0,100,101,102,103,114,112, 95,110, 97,109,101, 91, 51, 50, 93, 0, 42,116,101,120,116,117,114,101, 0, +115,116,114,101,110,103,116,104, 0,100,105,114,101, 99,116,105,111,110, 0,109,105,100,108,101,118,101,108, 0,116,101,120,109, + 97,112,112,105,110,103, 0, 42,109, 97,112, 95,111, 98,106,101, 99,116, 0,117,118,108, 97,121,101,114, 95,110, 97,109,101, 91, + 51, 50, 93, 0,117,118,108, 97,121,101,114, 95,116,109,112, 0, 42,112,114,111,106,101, 99,116,111,114,115, 91, 49, 48, 93, 0, + 42,105,109, 97,103,101, 0,110,117,109, 95,112,114,111,106,101, 99,116,111,114,115, 0, 97,115,112,101, 99,116,120, 0, 97,115, +112,101, 99,116,121, 0,112,101,114, 99,101,110,116, 0,102, 97, 99,101, 67,111,117,110,116, 0,102, 97, 99, 0,114,101,112,101, + 97,116, 0, 42,111, 98,106,101, 99,116, 99,101,110,116,101,114, 0,115,116, 97,114,116,120, 0,115,116, 97,114,116,121, 0,104, +101,105,103,104,116, 0,110, 97,114,114,111,119, 0,115,112,101,101,100, 0,100, 97,109,112, 0,102, 97,108,108,111,102,102, 0, +116,105,109,101,111,102,102,115, 0,108,105,102,101,116,105,109,101, 0,100,101,102,111,114,109,102,108, 97,103, 0,109,117,108, +116,105, 0, 42,112,114,101,118, 67,111,115, 0,112, 97,114,101,110,116,105,110,118, 91, 52, 93, 91, 52, 93, 0, 99,101,110,116, + 91, 51, 93, 0, 42,105,110,100,101,120, 97,114, 0,116,111,116,105,110,100,101,120, 0,102,111,114, 99,101, 0, 42, 99,108,111, +116,104, 79, 98,106,101, 99,116, 0, 42,115,105,109, 95,112, 97,114,109,115, 0, 42, 99,111,108,108, 95,112, 97,114,109,115, 0, + 42,112,111,105,110,116, 95, 99, 97, 99,104,101, 0, 42,120, 0, 42,120,110,101,119, 0, 42,120,111,108,100, 0, 42, 99,117,114, +114,101,110,116, 95,120,110,101,119, 0, 42, 99,117,114,114,101,110,116, 95,120, 0, 42, 99,117,114,114,101,110,116, 95,118, 0, + 42,109,102, 97, 99,101,115, 0,110,117,109,118,101,114,116,115, 0,110,117,109,102, 97, 99,101,115, 0, 97, 98,115,111,114,112, +116,105,111,110, 0,116,105,109,101, 0, 42, 98,118,104,116,114,101,101, 0, 42,100,109, 0,111,112,101,114, 97,116,105,111,110, + 0,118,101,114,116,101,120, 0,116,111,116,105,110,102,108,117,101,110, 99,101, 0,103,114,105,100,115,105,122,101, 0,110,101, +101,100, 98,105,110,100, 0, 42, 98,105,110,100,119,101,105,103,104,116,115, 0, 42, 98,105,110,100, 99,111,115, 0,116,111,116, + 99, 97,103,101,118,101,114,116, 0, 42,100,121,110,103,114,105,100, 0, 42,100,121,110,105,110,102,108,117,101,110, 99,101,115, + 0, 42,100,121,110,118,101,114,116,115, 0, 42,112, 97,100, 50, 0,100,121,110,103,114,105,100,115,105,122,101, 0,100,121,110, + 99,101,108,108,109,105,110, 91, 51, 93, 0,100,121,110, 99,101,108,108,119,105,100,116,104, 0, 98,105,110,100,109, 97,116, 91, + 52, 93, 91, 52, 93, 0, 42,112,115,121,115, 0,116,111,116,100,109,118,101,114,116, 0,116,111,116,100,109,101,100,103,101, 0, +116,111,116,100,109,102, 97, 99,101, 0,112,115,121,115, 0,112,111,115,105,116,105,111,110, 0,114, 97,110,100,111,109, 95,112, +111,115,105,116,105,111,110, 0, 42,102, 97, 99,101,112, 97, 0,118,103,114,111,117,112, 0,112,114,111,116,101, 99,116, 0, 42, +117,110,100,111, 95,118,101,114,116,115, 0,117,110,100,111, 95,118,101,114,116,115, 95,116,111,116, 0,117,110,100,111, 95,115, +105,103,110, 97,108, 0,108,118,108, 0,116,111,116,108,118,108, 0,115,105,109,112,108,101, 0, 42,102,115,115, 0, 42,116, 97, +114,103,101,116, 0, 42, 97,117,120, 84, 97,114,103,101,116, 0,118,103,114,111,117,112, 95,110, 97,109,101, 91, 51, 50, 93, 0, +107,101,101,112, 68,105,115,116, 0,115,104,114,105,110,107, 84,121,112,101, 0,115,104,114,105,110,107, 79,112,116,115, 0,112, +114,111,106, 65,120,105,115, 0,115,117, 98,115,117,114,102, 76,101,118,101,108,115, 0, 42,111,114,105,103,105,110, 0,102, 97, + 99,116,111,114, 0,108,105,109,105,116, 91, 50, 93, 0,111,114,105,103,105,110, 79,112,116,115, 0,112,110,116,115,119, 0,111, +112,110,116,115,117, 0,111,112,110,116,115,118, 0,111,112,110,116,115,119, 0,116,121,112,101,117, 0,116,121,112,101,118, 0, +116,121,112,101,119, 0,102,117, 0,102,118, 0,102,119, 0,100,117, 0,100,118, 0,100,119, 0, 42,100,101,102, 0, 42,108, 97, +116,116,105, 99,101,100, 97,116, 97, 0,108, 97,116,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 42,101,100,105,116,108, 97,116,116, + 0,118,101, 99, 91, 56, 93, 91, 51, 93, 0,112, 97,114,116,121,112,101, 0,112, 97,114, 49, 0,112, 97,114, 50, 0,112, 97,114, + 51, 0,112, 97,114,115,117, 98,115,116,114, 91, 51, 50, 93, 0, 42,116,114, 97, 99,107, 0, 42,112,114,111,120,121, 0, 42,112, +114,111,120,121, 95,103,114,111,117,112, 0, 42,112,114,111,120,121, 95,102,114,111,109, 0, 42, 97, 99,116,105,111,110, 0, 42, +112,111,115,101,108,105, 98, 0, 42,112,111,115,101, 0, 99,111,110,115,116,114, 97,105,110,116, 67,104, 97,110,110,101,108,115, + 0,100,101,102, 98, 97,115,101, 0,109,111,100,105,102,105,101,114,115, 0, 42,109, 97,116, 98,105,116,115, 0, 97, 99,116, 99, +111,108, 0,100,108,111, 99, 91, 51, 93, 0,111,114,105,103, 91, 51, 93, 0,100,115,105,122,101, 91, 51, 93, 0,100,114,111,116, + 91, 51, 93, 0,111, 98,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 99,111,110,115,116,105,110,118, 91, 52, 93, 91, 52, 93, 0,108, + 97,121, 0, 99,111,108, 98,105,116,115, 0,116,114, 97,110,115,102,108, 97,103, 0,112,114,111,116,101, 99,116,102,108, 97,103, + 0,116,114, 97, 99,107,102,108, 97,103, 0,117,112,102,108, 97,103, 0,110,108, 97,102,108, 97,103, 0,105,112,111,102,108, 97, +103, 0,105,112,111,119,105,110, 0,115, 99, 97,102,108, 97,103, 0,115, 99, 97,118,105,115,102,108, 97,103, 0, 98,111,117,110, +100,116,121,112,101, 0,100,117,112,111,110, 0,100,117,112,111,102,102, 0,100,117,112,115,116, 97, 0,100,117,112,101,110,100, + 0,115,102, 0,109, 97,115,115, 0,100, 97,109,112,105,110,103, 0,105,110,101,114,116,105, 97, 0,102,111,114,109,102, 97, 99, +116,111,114, 0,114,100, 97,109,112,105,110,103, 0,115,105,122,101,102, 97, 99, 0,109, 97,114,103,105,110, 0,109, 97,120, 95, +118,101,108, 0,109,105,110, 95,118,101,108, 0,109, 95, 99,111,110,116, 97, 99,116, 80,114,111, 99,101,115,115,105,110,103, 84, +104,114,101,115,104,111,108,100, 0,100,116, 0,100,116,120, 0,101,109,112,116,121, 95,100,114, 97,119,116,121,112,101, 0,112, + 97,100, 49, 91, 53, 93, 0,101,109,112,116,121, 95,100,114, 97,119,115,105,122,101, 0,100,117,112,102, 97, 99,101,115, 99, 97, + 0,112,114,111,112, 0,115,101,110,115,111,114,115, 0, 99,111,110,116,114,111,108,108,101,114,115, 0, 97, 99,116,117, 97,116, +111,114,115, 0, 98, 98,115,105,122,101, 91, 51, 93, 0, 97, 99,116,100,101,102, 0,103, 97,109,101,102,108, 97,103, 0,103, 97, +109,101,102,108, 97,103, 50, 0, 42, 98,115,111,102,116, 0,115,111,102,116,102,108, 97,103, 0, 97,110,105,115,111,116,114,111, +112,105, 99, 70,114,105, 99,116,105,111,110, 91, 51, 93, 0, 99,111,110,115,116,114, 97,105,110,116,115, 0,110,108, 97,115,116, +114,105,112,115, 0,104,111,111,107,115, 0,112, 97,114,116,105, 99,108,101,115,121,115,116,101,109, 0, 42,112,100, 0, 42,115, +111,102,116, 0, 42,100,117,112, 95,103,114,111,117,112, 0,102,108,117,105,100,115,105,109, 70,108, 97,103, 0,114,101,115,116, +114,105, 99,116,102,108, 97,103, 0,115,104, 97,112,101,110,114, 0,115,104, 97,112,101,102,108, 97,103, 0,114,101, 99, 97,108, + 99,111, 0, 98,111,100,121, 95,116,121,112,101, 0, 42,102,108,117,105,100,115,105,109, 83,101,116,116,105,110,103,115, 0, 42, +100,101,114,105,118,101,100, 68,101,102,111,114,109, 0, 42,100,101,114,105,118,101,100, 70,105,110, 97,108, 0,108, 97,115,116, + 68, 97,116, 97, 77, 97,115,107, 0,115,116, 97,116,101, 0,105,110,105,116, 95,115,116, 97,116,101, 0,103,112,117,108, 97,109, +112, 0, 99,117,114,105,110,100,101,120, 0, 97, 99,116,105,118,101, 0,100,101,102,108,101, 99,116, 0,102,111,114, 99,101,102, +105,101,108,100, 0,112,100,101,102, 95,100, 97,109,112, 0,112,100,101,102, 95,114,100, 97,109,112, 0,112,100,101,102, 95,112, +101,114,109, 0,112,100,101,102, 95,102,114,105, 99,116, 0,112,100,101,102, 95,114,102,114,105, 99,116, 0,102, 95,115,116,114, +101,110,103,116,104, 0,102, 95,112,111,119,101,114, 0,102, 95,100,105,115,116, 0,102, 95,100, 97,109,112, 0,109, 97,120,100, +105,115,116, 0,109,105,110,100,105,115,116, 0,109, 97,120,114, 97,100, 0,109,105,110,114, 97,100, 0,102, 95,112,111,119,101, +114, 95,114, 0,112,100,101,102, 95,115, 98,100, 97,109,112, 0,112,100,101,102, 95,115, 98,105,102,116, 0,112,100,101,102, 95, +115, 98,111,102,116, 0, 99,108,117,109,112, 95,102, 97, 99, 0, 99,108,117,109,112, 95,112,111,119, 0,107,105,110,107, 95,102, +114,101,113, 0,107,105,110,107, 95,115,104, 97,112,101, 0,107,105,110,107, 95, 97,109,112, 0,102,114,101,101, 95,101,110,100, + 0,116,101,120, 95,110, 97, 98,108, 97, 0,116,101,120, 95,109,111,100,101, 0,107,105,110,107, 0,107,105,110,107, 95, 97,120, +105,115, 0,114,116, 50, 0, 42,114,110,103, 0,102, 95,110,111,105,115,101, 0,102,114, 97,109,101, 0,116,111,116,112,111,105, +110,116, 0, 42,120,100, 97,116, 97, 0,115,116,101,112, 0,115,105,109,102,114, 97,109,101, 0,115,116, 97,114,116,102,114, 97, +109,101, 0,101,110,100,102,114, 97,109,101, 0,101,100,105,116,102,114, 97,109,101, 0,108, 97,115,116, 95,101,120, 97, 99,116, + 0,120,100, 97,116, 97, 95,116,121,112,101, 0,110, 97,109,101, 91, 54, 52, 93, 0,112,114,101,118, 95,110, 97,109,101, 91, 54, + 52, 93, 0,105,110,102,111, 91, 54, 52, 93, 0,109,101,109, 95, 99, 97, 99,104,101, 0,108,105,110, 83,116,105,102,102, 0, 97, +110,103, 83,116,105,102,102, 0,118,111,108,117,109,101, 0,118,105,116,101,114, 97,116,105,111,110,115, 0,112,105,116,101,114, + 97,116,105,111,110,115, 0,100,105,116,101,114, 97,116,105,111,110,115, 0, 99,105,116,101,114, 97,116,105,111,110,115, 0,107, + 83, 82, 72, 82, 95, 67, 76, 0,107, 83, 75, 72, 82, 95, 67, 76, 0,107, 83, 83, 72, 82, 95, 67, 76, 0,107, 83, 82, 95, 83, 80, + 76, 84, 95, 67, 76, 0,107, 83, 75, 95, 83, 80, 76, 84, 95, 67, 76, 0,107, 83, 83, 95, 83, 80, 76, 84, 95, 67, 76, 0,107, 86, + 67, 70, 0,107, 68, 80, 0,107, 68, 71, 0,107, 76, 70, 0,107, 80, 82, 0,107, 86, 67, 0,107, 68, 70, 0,107, 77, 84, 0,107, + 67, 72, 82, 0,107, 75, 72, 82, 0,107, 83, 72, 82, 0,107, 65, 72, 82, 0, 99,111,108,108,105,115,105,111,110,102,108, 97,103, +115, 0,110,117,109, 99,108,117,115,116,101,114,105,116,101,114, 97,116,105,111,110,115, 0,119,101,108,100,105,110,103, 0, 42, +112, 97,114,116,105, 99,108,101,115, 0,116,111,116,115,112,114,105,110,103, 0, 42, 98,112,111,105,110,116, 0, 42, 98,115,112, +114,105,110,103, 0,110,111,100,101,109, 97,115,115, 0,103,114, 97,118, 0,109,101,100,105, 97,102,114,105, 99,116, 0,114,107, +108,105,109,105,116, 0,112,104,121,115,105, 99,115, 95,115,112,101,101,100, 0,103,111, 97,108,115,112,114,105,110,103, 0,103, +111, 97,108,102,114,105, 99,116, 0,109,105,110,103,111, 97,108, 0,109, 97,120,103,111, 97,108, 0,100,101,102,103,111, 97,108, + 0,118,101,114,116,103,114,111,117,112, 0,102,117,122,122,121,110,101,115,115, 0,105,110,115,112,114,105,110,103, 0,105,110, +102,114,105, 99,116, 0,101,102,114, 97, 0,105,110,116,101,114,118, 97,108, 0,108,111, 99, 97,108, 0,115,111,108,118,101,114, +102,108, 97,103,115, 0, 42, 42,107,101,121,115, 0,116,111,116,112,111,105,110,116,107,101,121, 0,115,101, 99,111,110,100,115, +112,114,105,110,103, 0, 99,111,108, 98, 97,108,108, 0, 98, 97,108,108,100, 97,109,112, 0, 98, 97,108,108,115,116,105,102,102, + 0,115, 98, 99, 95,109,111,100,101, 0, 97,101,114,111,101,100,103,101, 0,109,105,110,108,111,111,112,115, 0,109, 97,120,108, +111,111,112,115, 0, 99,104,111,107,101, 0,115,111,108,118,101,114, 95, 73, 68, 0,112,108, 97,115,116,105, 99, 0,115,112,114, +105,110,103,112,114,101,108,111, 97,100, 0, 42,115, 99,114, 97,116, 99,104, 0,115,104,101, 97,114,115,116,105,102,102, 0,105, +110,112,117,115,104, 0, 42,112,111,105,110,116, 99, 97, 99,104,101, 0,115,104,111,119, 95, 97,100,118, 97,110, 99,101,100,111, +112,116,105,111,110,115, 0,114,101,115,111,108,117,116,105,111,110,120,121,122, 0,112,114,101,118,105,101,119,114,101,115,120, +121,122, 0,114,101, 97,108,115,105,122,101, 0,103,117,105, 68,105,115,112,108, 97,121, 77,111,100,101, 0,114,101,110,100,101, +114, 68,105,115,112,108, 97,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 86, 97,108,117,101, 0,118,105,115, 99, +111,115,105,116,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 69,120,112,111,110,101,110,116, 0,103,114, 97,118, +120, 0,103,114, 97,118,121, 0,103,114, 97,118,122, 0, 97,110,105,109, 83,116, 97,114,116, 0, 97,110,105,109, 69,110,100, 0, +103,115,116, 97,114, 0,109, 97,120, 82,101,102,105,110,101, 0,105,110,105, 86,101,108,120, 0,105,110,105, 86,101,108,121, 0, +105,110,105, 86,101,108,122, 0, 42,111,114,103, 77,101,115,104, 0, 42,109,101,115,104, 83,117,114,102, 97, 99,101, 0, 42,109, +101,115,104, 66, 66, 0,115,117,114,102,100, 97,116, 97, 80, 97,116,104, 91, 50, 52, 48, 93, 0, 98, 98, 83,116, 97,114,116, 91, + 51, 93, 0, 98, 98, 83,105,122,101, 91, 51, 93, 0,116,121,112,101, 70,108, 97,103,115, 0,100,111,109, 97,105,110, 78,111,118, +101, 99,103,101,110, 0,118,111,108,117,109,101, 73,110,105,116, 84,121,112,101, 0,112, 97,114,116, 83,108,105,112, 86, 97,108, +117,101, 0,103,101,110,101,114, 97,116,101, 84,114, 97, 99,101,114,115, 0,103,101,110,101,114, 97,116,101, 80, 97,114,116,105, + 99,108,101,115, 0,115,117,114,102, 97, 99,101, 83,109,111,111,116,104,105,110,103, 0,115,117,114,102, 97, 99,101, 83,117, 98, +100,105,118,115, 0,112, 97,114,116,105, 99,108,101, 73,110,102, 83,105,122,101, 0,112, 97,114,116,105, 99,108,101, 73,110,102, + 65,108,112,104, 97, 0,102, 97,114, 70,105,101,108,100, 83,105,122,101, 0, 42,109,101,115,104, 83,117,114,102, 78,111,114,109, + 97,108,115, 0, 99,112,115, 84,105,109,101, 83,116, 97,114,116, 0, 99,112,115, 84,105,109,101, 69,110,100, 0, 99,112,115, 81, +117, 97,108,105,116,121, 0, 97,116,116,114, 97, 99,116,102,111,114, 99,101, 83,116,114,101,110,103,116,104, 0, 97,116,116,114, + 97, 99,116,102,111,114, 99,101, 82, 97,100,105,117,115, 0,118,101,108,111, 99,105,116,121,102,111,114, 99,101, 83,116,114,101, +110,103,116,104, 0,118,101,108,111, 99,105,116,121,102,111,114, 99,101, 82, 97,100,105,117,115, 0,108, 97,115,116,103,111,111, +100,102,114, 97,109,101, 0,109,105,115,116,121,112,101, 0,104,111,114,114, 0,104,111,114,103, 0,104,111,114, 98, 0,104,111, +114,107, 0,122,101,110,114, 0,122,101,110,103, 0,122,101,110, 98, 0,122,101,110,107, 0, 97,109, 98,107, 0,102, 97,115,116, + 99,111,108, 0,101,120,112,111,115,117,114,101, 0,101,120,112, 0,114, 97,110,103,101, 0,108,105,110,102, 97, 99, 0,108,111, +103,102, 97, 99, 0,103,114, 97,118,105,116,121, 0, 97, 99,116,105,118,105,116,121, 66,111,120, 82, 97,100,105,117,115, 0,115, +107,121,116,121,112,101, 0,111, 99, 99,108,117,115,105,111,110, 82,101,115, 0,112,104,121,115,105, 99,115, 69,110,103,105,110, +101, 0,116,105, 99,114, 97,116,101, 0,109, 97,120,108,111,103,105, 99,115,116,101,112, 0,112,104,121,115,117, 98,115,116,101, +112, 0,109, 97,120,112,104,121,115,116,101,112, 0,109,105,115,105, 0,109,105,115,116,115,116, 97, 0,109,105,115,116,100,105, +115,116, 0,109,105,115,116,104,105, 0,115,116, 97,114,114, 0,115,116, 97,114,103, 0,115,116, 97,114, 98, 0,115,116, 97,114, +107, 0,115,116, 97,114,115,105,122,101, 0,115,116, 97,114,109,105,110,100,105,115,116, 0,115,116, 97,114,100,105,115,116, 0, +115,116, 97,114, 99,111,108,110,111,105,115,101, 0,100,111,102,115,116, 97, 0,100,111,102,101,110,100, 0,100,111,102,109,105, +110, 0,100,111,102,109, 97,120, 0, 97,111,100,105,115,116, 0, 97,111,100,105,115,116,102, 97, 99, 0, 97,111,101,110,101,114, +103,121, 0, 97,111, 98,105, 97,115, 0, 97,111,109,111,100,101, 0, 97,111,115, 97,109,112, 0, 97,111,109,105,120, 0, 97,111, + 99,111,108,111,114, 0, 97,111, 95, 97,100, 97,112,116, 95,116,104,114,101,115,104, 0, 97,111, 95, 97,100, 97,112,116, 95,115, +112,101,101,100, 95,102, 97, 99, 0, 97,111, 95, 97,112,112,114,111,120, 95,101,114,114,111,114, 0, 97,111, 95, 97,112,112,114, +111,120, 95, 99,111,114,114,101, 99,116,105,111,110, 0, 97,111, 95,115, 97,109,112, 95,109,101,116,104,111,100, 0, 97,111, 95, +103, 97,116,104,101,114, 95,109,101,116,104,111,100, 0, 97,111, 95, 97,112,112,114,111,120, 95,112, 97,115,115,101,115, 0, 42, + 97,111,115,112,104,101,114,101, 0, 42, 97,111,116, 97, 98,108,101,115, 0,115,101,108, 99,111,108, 0,115,120, 0,115,121, 0, + 42,108,112, 70,111,114,109, 97,116, 0, 42,108,112, 80, 97,114,109,115, 0, 99, 98, 70,111,114,109, 97,116, 0, 99, 98, 80, 97, +114,109,115, 0,102, 99, 99, 84,121,112,101, 0,102, 99, 99, 72, 97,110,100,108,101,114, 0,100,119, 75,101,121, 70,114, 97,109, +101, 69,118,101,114,121, 0,100,119, 81,117, 97,108,105,116,121, 0,100,119, 66,121,116,101,115, 80,101,114, 83,101, 99,111,110, +100, 0,100,119, 70,108, 97,103,115, 0,100,119, 73,110,116,101,114,108,101, 97,118,101, 69,118,101,114,121, 0, 97,118,105, 99, +111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0, 42, 99,100, 80, 97,114,109,115, 0, 42,112, 97,100, 0, 99,100, 83,105, +122,101, 0,113,116, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0, 99,111,100,101, 99, 0, 97,117,100,105,111, 95, + 99,111,100,101, 99, 0,118,105,100,101,111, 95, 98,105,116,114, 97,116,101, 0, 97,117,100,105,111, 95, 98,105,116,114, 97,116, +101, 0,103,111,112, 95,115,105,122,101, 0,114, 99, 95,109,105,110, 95,114, 97,116,101, 0,114, 99, 95,109, 97,120, 95,114, 97, +116,101, 0,114, 99, 95, 98,117,102,102,101,114, 95,115,105,122,101, 0,109,117,120, 95,112, 97, 99,107,101,116, 95,115,105,122, +101, 0,109,117,120, 95,114, 97,116,101, 0,109,105,120,114, 97,116,101, 0,109, 97,105,110, 0,112, 97,100, 91, 51, 93, 0, 42, +109, 97,116, 95,111,118,101,114,114,105,100,101, 0, 42,108,105,103,104,116, 95,111,118,101,114,114,105,100,101, 0,108, 97,121, + 95,122,109, 97,115,107, 0,108, 97,121,102,108, 97,103, 0,112, 97,115,115,102,108, 97,103, 0,112, 97,115,115, 95,120,111,114, + 0, 42, 97,118,105, 99,111,100,101, 99,100, 97,116, 97, 0, 42,113,116, 99,111,100,101, 99,100, 97,116, 97, 0,102,102, 99,111, +100,101, 99,100, 97,116, 97, 0, 97,117,100,105,111, 0, 99,102,114, 97, 0,112,115,102,114, 97, 0,112,101,102,114, 97, 0,105, +109, 97,103,101,115, 0,102,114, 97,109, 97,112,116,111, 0,116,104,114,101, 97,100,115, 0,102,114, 97,109,101,108,101,110, 0, + 98,108,117,114,102, 97, 99, 0,101,100,103,101, 82, 0,101,100,103,101, 71, 0,101,100,103,101, 66, 0,102,117,108,108,115, 99, +114,101,101,110, 0,120,112,108, 97,121, 0,121,112,108, 97,121, 0,102,114,101,113,112,108, 97,121, 0, 97,116,116,114,105, 98, + 0,114,116, 49, 0,115,116,101,114,101,111,109,111,100,101, 0,100,105,109,101,110,115,105,111,110,115,112,114,101,115,101,116, + 0,109, 97,120,105,109,115,105,122,101, 0,120,115, 99,104, 0,121,115, 99,104, 0,120,112, 97,114,116,115, 0,121,112, 97,114, +116,115, 0,119,105,110,112,111,115, 0,112,108, 97,110,101,115, 0,105,109,116,121,112,101, 0,115,117, 98,105,109,116,121,112, +101, 0,113,117, 97,108,105,116,121, 0,100,105,115,112,108, 97,121,109,111,100,101, 0,114,112, 97,100, 49, 0,114,112, 97,100, + 50, 0,115, 99,101,109,111,100,101, 0,114,101,110,100,101,114,101,114, 0,111, 99,114,101,115, 0, 97,108,112,104, 97,109,111, +100,101, 0,111,115, 97, 0,102,114,115, 95,115,101, 99, 0,101,100,103,101,105,110,116, 0,115, 97,102,101,116,121, 0, 98,111, +114,100,101,114, 0,100,105,115,112,114,101, 99,116, 0,108, 97,121,101,114,115, 0, 97, 99,116,108, 97,121, 0,120, 97,115,112, + 0,121, 97,115,112, 0,102,114,115, 95,115,101, 99, 95, 98, 97,115,101, 0,103, 97,117,115,115, 0,112,111,115,116,109,117,108, + 0,112,111,115,116,103, 97,109,109, 97, 0,112,111,115,116,104,117,101, 0,112,111,115,116,115, 97,116, 0,100,105,116,104,101, +114, 95,105,110,116,101,110,115,105,116,121, 0, 98, 97,107,101, 95,111,115, 97, 0, 98, 97,107,101, 95,102,105,108,116,101,114, + 0, 98, 97,107,101, 95,109,111,100,101, 0, 98, 97,107,101, 95,102,108, 97,103, 0, 98, 97,107,101, 95,110,111,114,109, 97,108, + 95,115,112, 97, 99,101, 0, 98, 97,107,101, 95,113,117, 97,100, 95,115,112,108,105,116, 0, 98, 97,107,101, 95,109, 97,120,100, +105,115,116, 0, 98, 97,107,101, 95, 98,105, 97,115,100,105,115,116, 0, 98, 97,107,101, 95,112, 97,100, 0, 71, 73,113,117, 97, +108,105,116,121, 0, 71, 73, 99, 97, 99,104,101, 0, 71, 73,109,101,116,104,111,100, 0, 71, 73,112,104,111,116,111,110,115, 0, + 71, 73,100,105,114,101, 99,116, 0, 89, 70, 95, 65, 65, 0, 89, 70,101,120,112,111,114,116,120,109,108, 0, 89, 70, 95,110,111, + 98,117,109,112, 0, 89, 70, 95, 99,108, 97,109,112,114,103, 98, 0,121,102,112, 97,100, 49, 0, 71, 73,100,101,112,116,104, 0, + 71, 73, 99, 97,117,115,100,101,112,116,104, 0, 71, 73,112,105,120,101,108,115,112,101,114,115, 97,109,112,108,101, 0, 71, 73, +112,104,111,116,111,110, 99,111,117,110,116, 0, 71, 73,109,105,120,112,104,111,116,111,110,115, 0, 71, 73,112,104,111,116,111, +110,114, 97,100,105,117,115, 0, 89, 70, 95,114, 97,121,100,101,112,116,104, 0, 89, 70, 95, 65, 65,112, 97,115,115,101,115, 0, + 89, 70, 95, 65, 65,115, 97,109,112,108,101,115, 0,121,102,112, 97,100, 50, 0, 71, 73,115,104, 97,100,111,119,113,117, 97,108, +105,116,121, 0, 71, 73,114,101,102,105,110,101,109,101,110,116, 0, 71, 73,112,111,119,101,114, 0, 71, 73,105,110,100,105,114, +112,111,119,101,114, 0, 89, 70, 95,103, 97,109,109, 97, 0, 89, 70, 95,101,120,112,111,115,117,114,101, 0, 89, 70, 95,114, 97, +121, 98,105, 97,115, 0, 89, 70, 95, 65, 65,112,105,120,101,108,115,105,122,101, 0, 89, 70, 95, 65, 65,116,104,114,101,115,104, +111,108,100, 0, 98, 97, 99,107, 98,117,102, 91, 49, 54, 48, 93, 0,112,105, 99, 91, 49, 54, 48, 93, 0,115,116, 97,109,112, 0, +115,116, 97,109,112, 95,102,111,110,116, 95,105,100, 0,115,116, 97,109,112, 95,117,100, 97,116, 97, 91, 49, 54, 48, 93, 0,102, +103, 95,115,116, 97,109,112, 91, 52, 93, 0, 98,103, 95,115,116, 97,109,112, 91, 52, 93, 0,115,105,109,112,108,105,102,121, 95, +115,117, 98,115,117,114,102, 0,115,105,109,112,108,105,102,121, 95,115,104, 97,100,111,119,115, 97,109,112,108,101,115, 0,115, +105,109,112,108,105,102,121, 95,112, 97,114,116,105, 99,108,101,115, 0,115,105,109,112,108,105,102,121, 95, 97,111,115,115,115, + 0, 99,105,110,101,111,110,119,104,105,116,101, 0, 99,105,110,101,111,110, 98,108, 97, 99,107, 0, 99,105,110,101,111,110,103, + 97,109,109, 97, 0,106,112, 50, 95,112,114,101,115,101,116, 0,106,112, 50, 95,100,101,112,116,104, 0,114,112, 97,100, 51, 0, +100,111,109,101,114,101,115, 0,100,111,109,101,109,111,100,101, 0,100,111,109,101, 97,110,103,108,101, 0,100,111,109,101,116, +105,108,116, 0,100,111,109,101,114,101,115, 98,117,102, 0, 42,100,111,109,101,116,101,120,116, 0,112, 97,114,116,105, 99,108, +101, 95,112,101,114, 99, 0,115,117, 98,115,117,114,102, 95,109, 97,120, 0,115,104, 97,100, 98,117,102,115, 97,109,112,108,101, + 95,109, 97,120, 0, 97,111, 95,101,114,114,111,114, 0, 99,111,108, 91, 51, 93, 0, 42, 98,114,117,115,104, 0,116,111,111,108, + 0,115,101, 97,109, 95, 98,108,101,101,100, 0,110,111,114,109, 97,108, 95, 97,110,103,108,101, 0, 42,112, 97,105,110,116, 99, +117,114,115,111,114, 0,105,110,118,101,114,116, 0,116,111,116,114,101,107,101,121, 0,116,111,116, 97,100,100,107,101,121, 0, + 98,114,117,115,104,116,121,112,101, 0, 98,114,117,115,104, 91, 55, 93, 0,101,109,105,116,116,101,114,100,105,115,116, 0,100, +114, 97,119, 95,116,105,109,101,100, 0,115,101,108,101, 99,116,109,111,100,101, 0,110, 97,109,101, 91, 51, 54, 93, 0,109, 97, +116, 91, 51, 93, 91, 51, 93, 0, 42,115,101,115,115,105,111,110, 0,112,105,118,111,116, 91, 51, 93, 0,116,101,120,115,101,112, + 0,116, 97, 98,108,101,116, 95,115,105,122,101, 0,116, 97, 98,108,101,116, 95,115,116,114,101,110,103,116,104, 0,112, 97,100, + 91, 53, 93, 0,103, 97,109,109, 97, 0,109,117,108, 0, 42,118,112, 97,105,110,116, 95,112,114,101,118, 0, 42,119,112, 97,105, +110,116, 95,112,114,101,118, 0, 42,118,112, 97,105,110,116, 0, 42,119,112, 97,105,110,116, 0, 42,115, 99,117,108,112,116, 0, +118,103,114,111,117,112, 95,119,101,105,103,104,116, 0, 99,111,114,110,101,114,116,121,112,101, 0,101,100,105,116, 98,117,116, +102,108, 97,103, 0,106,111,105,110,116,114,105,108,105,109,105,116, 0,100,101,103,114, 0,116,117,114,110, 0,101,120,116,114, + 95,111,102,102,115, 0,100,111,117, 98,108,105,109,105,116, 0,110,111,114,109, 97,108,115,105,122,101, 0, 97,117,116,111,109, +101,114,103,101, 0,115,101,103,109,101,110,116,115, 0,114,105,110,103,115, 0,118,101,114,116,105, 99,101,115, 0,117,110,119, +114, 97,112,112,101,114, 0,117,118, 99, 97,108, 99, 95,114, 97,100,105,117,115, 0,117,118, 99, 97,108, 99, 95, 99,117, 98,101, +115,105,122,101, 0,117,118, 99, 97,108, 99, 95,109, 97,114,103,105,110, 0,117,118, 99, 97,108, 99, 95,109, 97,112,100,105,114, + 0,117,118, 99, 97,108, 99, 95,109, 97,112, 97,108,105,103,110, 0,117,118, 99, 97,108, 99, 95,102,108, 97,103, 0,117,118, 95, +102,108, 97,103, 0,117,118, 95,115,101,108,101, 99,116,109,111,100,101, 0,117,118, 95,112, 97,100, 91, 50, 93, 0, 97,117,116, +111,105,107, 95, 99,104, 97,105,110,108,101,110, 0,105,109, 97,112, 97,105,110,116, 0,112, 97,114,116,105, 99,108,101, 0,112, +114,111,112,111,114,116,105,111,110, 97,108, 95,115,105,122,101, 0,115,101,108,101, 99,116, 95,116,104,114,101,115,104, 0, 99, +108,101, 97,110, 95,116,104,114,101,115,104, 0, 97,117,116,111,107,101,121, 95,109,111,100,101, 0,114,101,116,111,112,111, 95, +109,111,100,101, 0,114,101,116,111,112,111, 95,112, 97,105,110,116, 95,116,111,111,108, 0,108,105,110,101, 95,100,105,118, 0, +101,108,108,105,112,115,101, 95,100,105,118, 0,114,101,116,111,112,111, 95,104,111,116,115,112,111,116, 0,109,117,108,116,105, +114,101,115, 95,115,117, 98,100,105,118, 95,116,121,112,101, 0,115,107,103,101,110, 95,114,101,115,111,108,117,116,105,111,110, + 0,115,107,103,101,110, 95,116,104,114,101,115,104,111,108,100, 95,105,110,116,101,114,110, 97,108, 0,115,107,103,101,110, 95, +116,104,114,101,115,104,111,108,100, 95,101,120,116,101,114,110, 97,108, 0,115,107,103,101,110, 95,108,101,110,103,116,104, 95, +114, 97,116,105,111, 0,115,107,103,101,110, 95,108,101,110,103,116,104, 95,108,105,109,105,116, 0,115,107,103,101,110, 95, 97, +110,103,108,101, 95,108,105,109,105,116, 0,115,107,103,101,110, 95, 99,111,114,114,101,108, 97,116,105,111,110, 95,108,105,109, +105,116, 0,115,107,103,101,110, 95,115,121,109,109,101,116,114,121, 95,108,105,109,105,116, 0,115,107,103,101,110, 95,114,101, +116, 97,114,103,101,116, 95, 97,110,103,108,101, 95,119,101,105,103,104,116, 0,115,107,103,101,110, 95,114,101,116, 97,114,103, +101,116, 95,108,101,110,103,116,104, 95,119,101,105,103,104,116, 0,115,107,103,101,110, 95,114,101,116, 97,114,103,101,116, 95, +100,105,115,116, 97,110, 99,101, 95,119,101,105,103,104,116, 0,115,107,103,101,110, 95,111,112,116,105,111,110,115, 0,115,107, +103,101,110, 95,112,111,115,116,112,114,111, 0,115,107,103,101,110, 95,112,111,115,116,112,114,111, 95,112, 97,115,115,101,115, + 0,115,107,103,101,110, 95,115,117, 98,100,105,118,105,115,105,111,110,115, 91, 51, 93, 0,115,107,103,101,110, 95,109,117,108, +116,105, 95,108,101,118,101,108, 0, 42,115,107,103,101,110, 95,116,101,109,112,108, 97,116,101, 0, 98,111,110,101, 95,115,107, +101,116, 99,104,105,110,103, 0, 98,111,110,101, 95,115,107,101,116, 99,104,105,110,103, 95, 99,111,110,118,101,114,116, 0,115, +107,103,101,110, 95,115,117, 98,100,105,118,105,115,105,111,110, 95,110,117,109, 98,101,114, 0,115,107,103,101,110, 95,114,101, +116, 97,114,103,101,116, 95,111,112,116,105,111,110,115, 0,115,107,103,101,110, 95,114,101,116, 97,114,103,101,116, 95,114,111, +108,108, 0,115,107,103,101,110, 95,115,105,100,101, 95,115,116,114,105,110,103, 91, 56, 93, 0,115,107,103,101,110, 95,110,117, +109, 95,115,116,114,105,110,103, 91, 56, 93, 0,101,100,103,101, 95,109,111,100,101, 0,115,110, 97,112, 95,109,111,100,101, 0, +115,110, 97,112, 95,102,108, 97,103, 0,115,110, 97,112, 95,116, 97,114,103,101,116, 0,112,114,111,112,111,114,116,105,111,110, + 97,108, 0,112,114,111,112, 95,109,111,100,101, 0,116,111,116,111, 98,106, 0,116,111,116,108, 97,109,112, 0,116,111,116,111, + 98,106,115,101,108, 0,116,111,116, 99,117,114,118,101, 0,116,111,116,109,101,115,104, 0,116,111,116, 97,114,109, 97,116,117, +114,101, 0, 42, 99, 97,109,101,114, 97, 0, 42,119,111,114,108,100, 0, 42,115,101,116, 0, 98, 97,115,101, 0, 42, 98, 97,115, + 97, 99,116, 0, 42,111, 98,101,100,105,116, 0, 99,117,114,115,111,114, 91, 51, 93, 0,116,119, 99,101,110,116, 91, 51, 93, 0, +116,119,109,105,110, 91, 51, 93, 0,116,119,109, 97,120, 91, 51, 93, 0, 42,101,100, 0,102,114, 97,109,105,110,103, 0, 42,116, +111,111,108,115,101,116,116,105,110,103,115, 0, 42,115,116, 97,116,115, 0,116,114, 97,110,115,102,111,114,109, 95,115,112, 97, + 99,101,115, 0, 42,116,104,101, 68, 97,103, 0,100, 97,103,105,115,118, 97,108,105,100, 0,100, 97,103,102,108, 97,103,115, 0, +106,117,109,112,102,114, 97,109,101, 0,102,114, 97,109,101, 95,115,116,101,112, 0, 97, 99,116,105,118,101, 95,107,101,121,105, +110,103,115,101,116, 0,107,101,121,105,110,103,115,101,116,115, 0, 98,108,101,110,100, 0,119,105,110,109, 97,116, 91, 52, 93, + 91, 52, 93, 0,118,105,101,119,109, 97,116, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,105,110,118, 91, 52, 93, 91, 52, 93, 0, +112,101,114,115,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,101,114,115,105,110,118, 91, 52, 93, 91, 52, 93, 0,118,105,101,119, +109, 97,116,111, 98, 91, 52, 93, 91, 52, 93, 0,112,101,114,115,109, 97,116,111, 98, 91, 52, 93, 91, 52, 93, 0,116,119,109, 97, +116, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,113,117, 97,116, 91, 52, 93, 0,122,102, 97, 99, 0, 99, 97,109,100,120, 0, 99, + 97,109,100,121, 0,112,105,120,115,105,122,101, 0, 99, 97,109,122,111,111,109, 0,118,105,101,119, 98,117,116, 0,108, 97,115, +116,109,111,100,101, 0,114,102,108, 97,103, 0,118,105,101,119,108,111, 99,107, 0,112,101,114,115,112, 0,118,105,101,119, 0, + 99,108,105,112, 91, 54, 93, 91, 52, 93, 0, 42, 99,108,105,112, 98, 98, 0, 42,103,112,100, 0, 42,108,111, 99, 97,108,118,100, + 0, 42,114,105, 0, 42,114,101,116,111,112,111, 95,118,105,101,119, 95,100, 97,116, 97, 0, 42,100,101,112,116,104,115, 0, 42, +115,109,115, 0, 42,115,109,111,111,116,104, 95,116,105,109,101,114, 0,108,118,105,101,119,113,117, 97,116, 91, 52, 93, 0,108, +112,101,114,115,112, 0,108,118,105,101,119, 0,114,101,103,105,111,110, 98, 97,115,101, 0,115,112, 97, 99,101,116,121,112,101, + 0, 98,108,111, 99,107,115, 99, 97,108,101, 0, 98,108,111, 99,107,104, 97,110,100,108,101,114, 91, 56, 93, 0,108, 97,121, 95, +117,115,101,100, 0, 42,111, 98, 95, 99,101,110,116,114,101, 0, 42, 98,103,112,105, 99, 0,111, 98, 95, 99,101,110,116,114,101, + 95, 98,111,110,101, 91, 51, 50, 93, 0,108, 97,121, 97, 99,116, 0,100,114, 97,119,116,121,112,101, 0,108,111, 99, 97,108,118, +105,101,119, 0,115, 99,101,110,101,108,111, 99,107, 0, 97,114,111,117,110,100, 0,102,108, 97,103, 50, 0,112,105,118,111,116, + 95,108, 97,115,116, 0,103,114,105,100, 0,103,114,105,100,118,105,101,119, 0,112, 97,100,102, 0,110,101, 97,114, 0,102, 97, +114, 0,103,114,105,100,108,105,110,101,115, 0,103,114,105,100,102,108, 97,103, 0,103,114,105,100,115,117, 98,100,105,118, 0, +109,111,100,101,115,101,108,101, 99,116, 0,107,101,121,102,108, 97,103,115, 0,116,119,116,121,112,101, 0,116,119,109,111,100, +101, 0,116,119,102,108, 97,103, 0,116,119,100,114, 97,119,102,108, 97,103, 0, 99,117,115,116,111,109,100, 97,116, 97, 95,109, + 97,115,107, 0, 97,102,116,101,114,100,114, 97,119, 0,122, 98,117,102, 0,120,114, 97,121, 0,110,100,111,102,109,111,100,101, + 0,110,100,111,102,102,105,108,116,101,114, 0, 42,112,114,111,112,101,114,116,105,101,115, 95,115,116,111,114, 97,103,101, 0, +118,101,114,116, 0,104,111,114, 0,109, 97,115,107, 0,109,105,110, 91, 50, 93, 0,109, 97,120, 91, 50, 93, 0,109,105,110,122, +111,111,109, 0,109, 97,120,122,111,111,109, 0,115, 99,114,111,108,108, 0,115, 99,114,111,108,108, 95,117,105, 0,107,101,101, +112,116,111,116, 0,107,101,101,112,122,111,111,109, 0,107,101,101,112,111,102,115, 0, 97,108,105,103,110, 0,119,105,110,120, + 0,119,105,110,121, 0,111,108,100,119,105,110,120, 0,111,108,100,119,105,110,121, 0, 99,117,114,115,111,114, 91, 50, 93, 0, + 42,115, 99,114,101,101,110, 0,118, 50,100, 0, 42, 97,100,115, 0,103,104,111,115,116, 67,117,114,118,101,115, 0, 97,117,116, +111,115,110, 97,112, 0,112,105,110, 0,108,111, 99,107, 0, 99,117,114,115,101,110,115, 0, 99,117,114, 97, 99,116, 0,112,114, +101,118,105,101,119, 0,109, 97,105,110, 98, 0,109, 97,105,110, 98,111, 0, 42,108,111, 99,107,112,111,105,110, 0,116,101,120, +110,114, 0,116,101,120,102,114,111,109, 0,115,104,111,119,103,114,111,117,112, 0,109,111,100,101,108,116,121,112,101, 0,115, + 99,114,105,112,116, 98,108,111, 99,107, 0,114,101, 95, 97,108,105,103,110, 0,111,108,100,107,101,121,112,114,101,115,115, 0, +112, 97,116,104,102,108, 97,103, 0,100, 97,116, 97,105, 99,111,110, 0, 42,112,105,110,105,100, 0,114,101,110,100,101,114, 95, +115,105,122,101, 0, 99,104, 97,110,115,104,111,119,110, 0,122,101, 98,114, 97, 0,122,111,111,109, 0,116,105,116,108,101, 91, + 50, 52, 93, 0,100,105,114, 91, 50, 52, 48, 93, 0,102,105,108,101, 91, 56, 48, 93, 0,115,111,114,116, 0,100,105,115,112,108, + 97,121, 0, 97, 99,116,105,118,101, 95, 98,111,111,107,109, 97,114,107, 0, 97, 99,116,105,118,101, 95,102,105,108,101, 0,115, +101,108,115,116, 97,116,101, 0,102, 95,102,112, 0,109,101,110,117, 0,102,112, 95,115,116,114, 91, 56, 93, 0, 42,112,117,112, +109,101,110,117, 0, 42,112, 97,114, 97,109,115, 0, 42,102,105,108,101,115, 0, 42,102,111,108,100,101,114,115, 95,112,114,101, +118, 0, 42,102,111,108,100,101,114,115, 95,110,101,120,116, 0, 42,111,112, 0, 42,108,111, 97,100,105,109, 97,103,101, 95,116, +105,109,101,114, 0, 42,108, 97,121,111,117,116, 0,116,114,101,101, 0, 42,116,114,101,101,115,116,111,114,101, 0,115,101, 97, +114, 99,104, 95,115,116,114,105,110,103, 91, 51, 50, 93, 0,115,101, 97,114, 99,104, 95,116,115,101, 0,115,101, 97,114, 99,104, + 95,102,108, 97,103,115, 0,100,111, 95, 0,111,117,116,108,105,110,101,118,105,115, 0,115,116,111,114,101,102,108, 97,103, 0, + 42, 99,117,109, 97,112, 0,105,109, 97,110,114, 0, 99,117,114,116,105,108,101, 0,105,109,116,121,112,101,110,114, 0,100,116, + 95,117,118, 0,115,116,105, 99,107,121, 0,100,116, 95,117,118,115,116,114,101,116, 99,104, 0, 99,101,110,116,120, 0, 99,101, +110,116,121, 0, 42,116,101,120,116, 0,116,111,112, 0,118,105,101,119,108,105,110,101,115, 0,108,104,101,105,103,104,116, 0, + 99,119,105,100,116,104, 0,108,105,110,101,110,114,115, 95,116,111,116, 0,108,101,102,116, 0,115,104,111,119,108,105,110,101, +110,114,115, 0,116, 97, 98,110,117,109, 98,101,114, 0,115,104,111,119,115,121,110,116, 97,120, 0,111,118,101,114,119,114,105, +116,101, 0,108,105,118,101, 95,101,100,105,116, 0,112,105,120, 95,112,101,114, 95,108,105,110,101, 0,116,120,116,115, 99,114, +111,108,108, 0,116,120,116, 98, 97,114, 0,119,111,114,100,119,114, 97,112, 0,100,111,112,108,117,103,105,110,115, 0,102,105, +110,100,115,116,114, 91, 50, 53, 54, 93, 0,114,101,112,108, 97, 99,101,115,116,114, 91, 50, 53, 54, 93, 0, 42,112,121, 95,100, +114, 97,119, 0, 42,112,121, 95,101,118,101,110,116, 0, 42,112,121, 95, 98,117,116,116,111,110, 0, 42,112,121, 95, 98,114,111, +119,115,101,114, 99, 97,108,108, 98, 97, 99,107, 0, 42,112,121, 95,103,108,111, 98, 97,108,100,105, 99,116, 0,108, 97,115,116, +115,112, 97, 99,101, 0,115, 99,114,105,112,116,110, 97,109,101, 91, 50, 53, 54, 93, 0,115, 99,114,105,112,116, 97,114,103, 91, + 50, 53, 54, 93, 0, 42,115, 99,114,105,112,116, 0, 42, 98,117,116, 95,114,101,102,115, 0,114,101,100,114, 97,119,115, 0, 42, +105,100, 0, 97,115,112,101, 99,116, 0, 42, 99,117,114,102,111,110,116, 0,109,120, 0,109,121, 0, 42,101,100,105,116,116,114, +101,101, 0,116,114,101,101,116,121,112,101, 0,110,117,109,116,105,108,101,115,120, 0,110,117,109,116,105,108,101,115,121, 0, +118,105,101,119,114,101, 99,116, 0, 98,111,111,107,109, 97,114,107,114,101, 99,116, 0,115, 99,114,111,108,108,112,111,115, 0, +115, 99,114,111,108,108,104,101,105,103,104,116, 0,115, 99,114,111,108,108, 97,114,101, 97, 0,114,101,116,118, 97,108, 0,112, +114,118, 95,119, 0,112,114,118, 95,104, 0, 40, 42,114,101,116,117,114,110,102,117,110, 99, 41, 40, 41, 0, 40, 42,114,101,116, +117,114,110,102,117,110, 99, 95,101,118,101,110,116, 41, 40, 41, 0, 40, 42,114,101,116,117,114,110,102,117,110, 99, 95, 97,114, +103,115, 41, 40, 41, 0, 42, 97,114,103, 49, 0, 42, 97,114,103, 50, 0, 42,109,101,110,117,112, 0, 42,105,109,103, 0,102,105, +108,101,110, 97,109,101, 91, 50, 53, 54, 93, 0, 98,108,102, 95,105,100, 0,117,105,102,111,110,116, 95,105,100, 0,114, 95,116, +111, 95,108, 0,112,111,105,110,116,115, 0,107,101,114,110,105,110,103, 0,105,116, 97,108,105, 99, 0, 98,111,108,100, 0,115, +104, 97,100,111,119, 0,115,104, 97,100,120, 0,115,104, 97,100,121, 0,115,104, 97,100,111,119, 97,108,112,104, 97, 0,115,104, + 97,100,111,119, 99,111,108,111,114, 0,112, 97,110,101,108,116,105,116,108,101, 0,103,114,111,117,112,108, 97, 98,101,108, 0, +119,105,100,103,101,116,108, 97, 98,101,108, 0,119,105,100,103,101,116, 0,112, 97,110,101,108,122,111,111,109, 0,109,105,110, +108, 97, 98,101,108, 99,104, 97,114,115, 0,109,105,110,119,105,100,103,101,116, 99,104, 97,114,115, 0, 99,111,108,117,109,110, +115,112, 97, 99,101, 0,116,101,109,112,108, 97,116,101,115,112, 97, 99,101, 0, 98,111,120,115,112, 97, 99,101, 0, 98,117,116, +116,111,110,115,112, 97, 99,101,120, 0, 98,117,116,116,111,110,115,112, 97, 99,101,121, 0,112, 97,110,101,108,115,112, 97, 99, +101, 0,112, 97,110,101,108,111,117,116,101,114, 0,112, 97,100, 91, 49, 93, 0,111,117,116,108,105,110,101, 91, 52, 93, 0,105, +110,110,101,114, 91, 52, 93, 0,105,110,110,101,114, 95,115,101,108, 91, 52, 93, 0,105,116,101,109, 91, 52, 93, 0,116,101,120, +116, 91, 52, 93, 0,116,101,120,116, 95,115,101,108, 91, 52, 93, 0,115,104, 97,100,101,100, 0,115,104, 97,100,101,116,111,112, + 0,115,104, 97,100,101,100,111,119,110, 0,105,110,110,101,114, 95, 97,110,105,109, 91, 52, 93, 0,105,110,110,101,114, 95, 97, +110,105,109, 95,115,101,108, 91, 52, 93, 0,105,110,110,101,114, 95,107,101,121, 91, 52, 93, 0,105,110,110,101,114, 95,107,101, +121, 95,115,101,108, 91, 52, 93, 0,105,110,110,101,114, 95,100,114,105,118,101,110, 91, 52, 93, 0,105,110,110,101,114, 95,100, +114,105,118,101,110, 95,115,101,108, 91, 52, 93, 0,119, 99,111,108, 95,114,101,103,117,108, 97,114, 0,119, 99,111,108, 95,116, +111,111,108, 0,119, 99,111,108, 95,116,101,120,116, 0,119, 99,111,108, 95,114, 97,100,105,111, 0,119, 99,111,108, 95,111,112, +116,105,111,110, 0,119, 99,111,108, 95,116,111,103,103,108,101, 0,119, 99,111,108, 95,110,117,109, 0,119, 99,111,108, 95,110, +117,109,115,108,105,100,101,114, 0,119, 99,111,108, 95,109,101,110,117, 0,119, 99,111,108, 95,112,117,108,108,100,111,119,110, + 0,119, 99,111,108, 95,109,101,110,117, 95, 98, 97, 99,107, 0,119, 99,111,108, 95,109,101,110,117, 95,105,116,101,109, 0,119, + 99,111,108, 95, 98,111,120, 0,119, 99,111,108, 95,115, 99,114,111,108,108, 0,119, 99,111,108, 95,115,116, 97,116,101, 0,105, + 99,111,110,102,105,108,101, 91, 56, 48, 93, 0, 98, 97, 99,107, 91, 52, 93, 0,116,105,116,108,101, 91, 52, 93, 0,116,101,120, +116, 95,104,105, 91, 52, 93, 0,104,101, 97,100,101,114, 91, 52, 93, 0,104,101, 97,100,101,114, 95,116,105,116,108,101, 91, 52, + 93, 0,104,101, 97,100,101,114, 95,116,101,120,116, 91, 52, 93, 0,104,101, 97,100,101,114, 95,116,101,120,116, 95,104,105, 91, + 52, 93, 0, 98,117,116,116,111,110, 91, 52, 93, 0, 98,117,116,116,111,110, 95,116,105,116,108,101, 91, 52, 93, 0, 98,117,116, +116,111,110, 95,116,101,120,116, 91, 52, 93, 0, 98,117,116,116,111,110, 95,116,101,120,116, 95,104,105, 91, 52, 93, 0,108,105, +115,116, 91, 52, 93, 0,108,105,115,116, 95,116,105,116,108,101, 91, 52, 93, 0,108,105,115,116, 95,116,101,120,116, 91, 52, 93, + 0,108,105,115,116, 95,116,101,120,116, 95,104,105, 91, 52, 93, 0,112, 97,110,101,108, 91, 52, 93, 0,112, 97,110,101,108, 95, +116,105,116,108,101, 91, 52, 93, 0,112, 97,110,101,108, 95,116,101,120,116, 91, 52, 93, 0,112, 97,110,101,108, 95,116,101,120, +116, 95,104,105, 91, 52, 93, 0,115,104, 97,100,101, 49, 91, 52, 93, 0,115,104, 97,100,101, 50, 91, 52, 93, 0,104,105,108,105, +116,101, 91, 52, 93, 0,103,114,105,100, 91, 52, 93, 0,119,105,114,101, 91, 52, 93, 0,115,101,108,101, 99,116, 91, 52, 93, 0, +108, 97,109,112, 91, 52, 93, 0, 97, 99,116,105,118,101, 91, 52, 93, 0,103,114,111,117,112, 91, 52, 93, 0,103,114,111,117,112, + 95, 97, 99,116,105,118,101, 91, 52, 93, 0,116,114, 97,110,115,102,111,114,109, 91, 52, 93, 0,118,101,114,116,101,120, 91, 52, + 93, 0,118,101,114,116,101,120, 95,115,101,108,101, 99,116, 91, 52, 93, 0,101,100,103,101, 91, 52, 93, 0,101,100,103,101, 95, +115,101,108,101, 99,116, 91, 52, 93, 0,101,100,103,101, 95,115,101, 97,109, 91, 52, 93, 0,101,100,103,101, 95,115,104, 97,114, +112, 91, 52, 93, 0,101,100,103,101, 95,102, 97, 99,101,115,101,108, 91, 52, 93, 0,102, 97, 99,101, 91, 52, 93, 0,102, 97, 99, +101, 95,115,101,108,101, 99,116, 91, 52, 93, 0,102, 97, 99,101, 95,100,111,116, 91, 52, 93, 0,110,111,114,109, 97,108, 91, 52, + 93, 0, 98,111,110,101, 95,115,111,108,105,100, 91, 52, 93, 0, 98,111,110,101, 95,112,111,115,101, 91, 52, 93, 0,115,116,114, +105,112, 91, 52, 93, 0,115,116,114,105,112, 95,115,101,108,101, 99,116, 91, 52, 93, 0, 99,102,114, 97,109,101, 91, 52, 93, 0, +100,115, 95, 99,104, 97,110,110,101,108, 91, 52, 93, 0,100,115, 95,115,117, 98, 99,104, 97,110,110,101,108, 91, 52, 93, 0,118, +101,114,116,101,120, 95,115,105,122,101, 0,102, 97, 99,101,100,111,116, 95,115,105,122,101, 0, 98,112, 97,100, 91, 50, 93, 0, +115,121,110,116, 97,120,108, 91, 52, 93, 0,115,121,110,116, 97,120,110, 91, 52, 93, 0,115,121,110,116, 97,120, 98, 91, 52, 93, + 0,115,121,110,116, 97,120,118, 91, 52, 93, 0,115,121,110,116, 97,120, 99, 91, 52, 93, 0,109,111,118,105,101, 91, 52, 93, 0, +105,109, 97,103,101, 91, 52, 93, 0,115, 99,101,110,101, 91, 52, 93, 0, 97,117,100,105,111, 91, 52, 93, 0,101,102,102,101, 99, +116, 91, 52, 93, 0,112,108,117,103,105,110, 91, 52, 93, 0,116,114, 97,110,115,105,116,105,111,110, 91, 52, 93, 0,109,101,116, + 97, 91, 52, 93, 0,101,100,105,116,109,101,115,104, 95, 97, 99,116,105,118,101, 91, 52, 93, 0,104, 97,110,100,108,101, 95,118, +101,114,116,101,120, 91, 52, 93, 0,104, 97,110,100,108,101, 95,118,101,114,116,101,120, 95,115,101,108,101, 99,116, 91, 52, 93, + 0,104, 97,110,100,108,101, 95,118,101,114,116,101,120, 95,115,105,122,101, 0,104,112, 97,100, 91, 51, 93, 0,115,111,108,105, +100, 91, 52, 93, 0,116,117,105, 0,116, 98,117,116,115, 0,116,118, 51,100, 0,116,102,105,108,101, 0,116,105,112,111, 0,116, +105,110,102,111, 0,116,115,110,100, 0,116, 97, 99,116, 0,116,110,108, 97, 0,116,115,101,113, 0,116,105,109, 97, 0,116,105, +109, 97,115,101,108, 0,116,101,120,116, 0,116,111,111,112,115, 0,116,116,105,109,101, 0,116,110,111,100,101, 0,116,108,111, +103,105, 99, 0,116, 97,114,109, 91, 50, 48, 93, 0,115,112,101, 99, 91, 52, 93, 0,100,117,112,102,108, 97,103, 0,115, 97,118, +101,116,105,109,101, 0,116,101,109,112,100,105,114, 91, 49, 54, 48, 93, 0,102,111,110,116,100,105,114, 91, 49, 54, 48, 93, 0, +114,101,110,100,101,114,100,105,114, 91, 49, 54, 48, 93, 0,116,101,120,116,117,100,105,114, 91, 49, 54, 48, 93, 0,112,108,117, +103,116,101,120,100,105,114, 91, 49, 54, 48, 93, 0,112,108,117,103,115,101,113,100,105,114, 91, 49, 54, 48, 93, 0,112,121,116, +104,111,110,100,105,114, 91, 49, 54, 48, 93, 0,115,111,117,110,100,100,105,114, 91, 49, 54, 48, 93, 0,121,102,101,120,112,111, +114,116,100,105,114, 91, 49, 54, 48, 93, 0,118,101,114,115,105,111,110,115, 0,103, 97,109,101,102,108, 97,103,115, 0,119,104, +101,101,108,108,105,110,101,115, 99,114,111,108,108, 0,117,105,102,108, 97,103, 0,108, 97,110,103,117, 97,103,101, 0,117,115, +101,114,112,114,101,102, 0,118,105,101,119,122,111,111,109, 0,109,105,120, 98,117,102,115,105,122,101, 0,100,112,105, 0,101, +110, 99,111,100,105,110,103, 0,116,114, 97,110,115,111,112,116,115, 0,109,101,110,117,116,104,114,101,115,104,111,108,100, 49, + 0,109,101,110,117,116,104,114,101,115,104,111,108,100, 50, 0,116,104,101,109,101,115, 0,117,105,102,111,110,116,115, 0,117, +105,115,116,121,108,101,115, 0,117,110,100,111,115,116,101,112,115, 0,117,110,100,111,109,101,109,111,114,121, 0,103,112, 95, +109, 97,110,104, 97,116,116,101,110,100,105,115,116, 0,103,112, 95,101,117, 99,108,105,100,101, 97,110,100,105,115,116, 0,103, +112, 95,101,114, 97,115,101,114, 0,103,112, 95,115,101,116,116,105,110,103,115, 0,116, 98, 95,108,101,102,116,109,111,117,115, +101, 0,116, 98, 95,114,105,103,104,116,109,111,117,115,101, 0,108,105,103,104,116, 91, 51, 93, 0,116,119, 95,104,111,116,115, +112,111,116, 0,116,119, 95,102,108, 97,103, 0,116,119, 95,104, 97,110,100,108,101,115,105,122,101, 0,116,119, 95,115,105,122, +101, 0,116,101,120,116,105,109,101,111,117,116, 0,116,101,120, 99,111,108,108,101, 99,116,114, 97,116,101, 0,119,109,100,114, + 97,119,109,101,116,104,111,100, 0,119,109,112, 97,100, 0,109,101,109, 99, 97, 99,104,101,108,105,109,105,116, 0,112,114,101, +102,101,116, 99,104,102,114, 97,109,101,115, 0,102,114, 97,109,101,115,101,114,118,101,114,112,111,114,116, 0,112, 97,100, 95, +114,111,116, 95, 97,110,103,108,101, 0,111, 98, 99,101,110,116,101,114, 95,100,105, 97, 0,114,118,105,115,105,122,101, 0,114, +118,105, 98,114,105,103,104,116, 0,114,101, 99,101,110,116, 95,102,105,108,101,115, 0,115,109,111,111,116,104, 95,118,105,101, +119,116,120, 0,103,108,114,101,115,108,105,109,105,116, 0,110,100,111,102, 95,112, 97,110, 0,110,100,111,102, 95,114,111,116, + 97,116,101, 0, 99,117,114,115,115,105,122,101, 0,105,112,111, 95,110,101,119, 0,118,101,114,115,101,109, 97,115,116,101,114, + 91, 49, 54, 48, 93, 0,118,101,114,115,101,117,115,101,114, 91, 49, 54, 48, 93, 0,103,108, 97,108,112,104, 97, 99,108,105,112, + 0, 97,117,116,111,107,101,121, 95,102,108, 97,103, 0, 99,111, 98, 97, 95,119,101,105,103,104,116, 0,118,101,114,116, 98, 97, +115,101, 0,101,100,103,101, 98, 97,115,101, 0, 97,114,101, 97, 98, 97,115,101, 0, 42,110,101,119,115, 99,101,110,101, 0,102, +117,108,108, 0,119,105,110,105,100, 0,100,111, 95,100,114, 97,119, 0,100,111, 95,114,101,102,114,101,115,104, 0,100,111, 95, +100,114, 97,119, 95,103,101,115,116,117,114,101, 0,100,111, 95,100,114, 97,119, 95,112, 97,105,110,116, 99,117,114,115,111,114, + 0,115,119, 97,112, 0,109, 97,105,110,119,105,110, 0,115,117, 98,119,105,110, 97, 99,116,105,118,101, 0, 42, 97,110,105,109, +116,105,109,101,114, 0, 42, 99,111,110,116,101,120,116, 0,104, 97,110,100,108,101,114, 91, 56, 93, 0, 42,110,101,119,118, 0, +118,101, 99, 0, 42,118, 49, 0, 42,118, 50, 0, 42,116,121,112,101, 0,112, 97,110,101,108,110, 97,109,101, 91, 54, 52, 93, 0, +116, 97, 98,110, 97,109,101, 91, 54, 52, 93, 0,100,114, 97,119,110, 97,109,101, 91, 54, 52, 93, 0,111,102,115,120, 0,111,102, +115,121, 0,115,105,122,101,120, 0,115,105,122,101,121, 0,108, 97, 98,101,108,111,102,115, 0,114,117,110,116,105,109,101, 95, +102,108, 97,103, 0, 99,111,110,116,114,111,108, 0,115,110, 97,112, 0,115,111,114,116,111,114,100,101,114, 0, 42,112, 97,110, +101,108,116, 97, 98, 0, 42, 97, 99,116,105,118,101,100, 97,116, 97, 0,108,105,115,116, 95,115, 99,114,111,108,108, 0,108,105, +115,116, 95,115,105,122,101, 0,108,105,115,116, 95,115,101, 97,114, 99,104, 91, 54, 52, 93, 0, 42,118, 51, 0, 42,118, 52, 0, + 42,102,117,108,108, 0, 98,117,116,115,112, 97, 99,101,116,121,112,101, 0,104,101, 97,100,101,114,116,121,112,101, 0, 99,117, +114,115,111,114, 0,115,112, 97, 99,101,100, 97,116, 97, 0,104, 97,110,100,108,101,114,115, 0, 97, 99,116,105,111,110,122,111, +110,101,115, 0,119,105,110,114, 99,116, 0,100,114, 97,119,114, 99,116, 0,115,119,105,110,105,100, 0,114,101,103,105,111,110, +116,121,112,101, 0, 97,108,105,103,110,109,101,110,116, 0,117,105, 98,108,111, 99,107,115, 0,112, 97,110,101,108,115, 0, 42, +104,101, 97,100,101,114,115,116,114, 0, 42,114,101,103,105,111,110,100, 97,116, 97, 0,115,117, 98,118,115,116,114, 91, 52, 93, + 0,115,117, 98,118,101,114,115,105,111,110, 0,112, 97,100,115, 0,109,105,110,118,101,114,115,105,111,110, 0,109,105,110,115, +117, 98,118,101,114,115,105,111,110, 0, 42, 99,117,114,115, 99,114,101,101,110, 0, 42, 99,117,114,115, 99,101,110,101, 0,102, +105,108,101,102,108, 97,103,115, 0,103,108,111, 98, 97,108,102, 0,110, 97,109,101, 91, 56, 48, 93, 0, 42,105, 98,117,102, 0, + 42,105, 98,117,102, 95, 99,111,109,112, 0, 42,115,101, 49, 0, 42,115,101, 50, 0, 42,115,101, 51, 0,110,114, 0, 98,111,116, +116,111,109, 0,114,105,103,104,116, 0,120,111,102,115, 0,121,111,102,115, 0,108,105,102,116, 91, 51, 93, 0,103, 97,109,109, + 97, 91, 51, 93, 0,103, 97,105,110, 91, 51, 93, 0,115, 97,116,117,114, 97,116,105,111,110, 0,100,105,114, 91, 49, 54, 48, 93, + 0,100,111,110,101, 0,115,116, 97,114,116,115,116,105,108,108, 0,101,110,100,115,116,105,108,108, 0, 42,115,116,114,105,112, +100, 97,116, 97, 0,111,114,120, 0,111,114,121, 0, 42, 99,114,111,112, 0, 42,116,114, 97,110,115,102,111,114,109, 0, 42, 99, +111,108,111,114, 95, 98, 97,108, 97,110, 99,101, 0, 42,116,115,116,114,105,112,100, 97,116, 97, 0, 42,116,115,116,114,105,112, +100, 97,116, 97, 95,115,116, 97,114,116,115,116,105,108,108, 0, 42,116,115,116,114,105,112,100, 97,116, 97, 95,101,110,100,115, +116,105,108,108, 0, 42,105, 98,117,102, 95,115,116, 97,114,116,115,116,105,108,108, 0, 42,105, 98,117,102, 95,101,110,100,115, +116,105,108,108, 0, 42,105,110,115,116, 97,110, 99,101, 95,112,114,105,118, 97,116,101, 95,100, 97,116, 97, 0, 42, 42, 99,117, +114,114,101,110,116, 95,112,114,105,118, 97,116,101, 95,100, 97,116, 97, 0, 42,116,109,112, 0,115,116, 97,114,116,111,102,115, + 0,101,110,100,111,102,115, 0,109, 97, 99,104,105,110,101, 0,115,116, 97,114,116,100,105,115,112, 0,101,110,100,100,105,115, +112, 0,104, 97,110,100,115,105,122,101, 0, 97,110,105,109, 95,112,114,101,115,101,101,107, 0, 42,115,116,114,105,112, 0,102, + 97, 99,102, 48, 0,102, 97, 99,102, 49, 0, 42,115,101,113, 49, 0, 42,115,101,113, 50, 0, 42,115,101,113, 51, 0,115,101,113, + 98, 97,115,101, 0, 42,115,111,117,110,100, 0, 42,104,100, 97,117,100,105,111, 0,108,101,118,101,108, 0,112, 97,110, 0,115, + 99,101,110,101,110,114, 0,115,116,114,111, 98,101, 0, 42,101,102,102,101, 99,116,100, 97,116, 97, 0, 97,110,105,109, 95,115, +116, 97,114,116,111,102,115, 0, 97,110,105,109, 95,101,110,100,111,102,115, 0, 98,108,101,110,100, 95,109,111,100,101, 0, 98, +108,101,110,100, 95,111,112, 97, 99,105,116,121, 0, 42,111,108,100, 98, 97,115,101,112, 0, 42,112, 97,114,115,101,113, 0, 42, +115,101,113, 98, 97,115,101,112, 0,109,101,116, 97,115,116, 97, 99,107, 0, 42, 97, 99,116, 95,115,101,113, 0, 97, 99,116, 95, +105,109, 97,103,101,100,105,114, 91, 50, 53, 54, 93, 0, 97, 99,116, 95,115,111,117,110,100,100,105,114, 91, 50, 53, 54, 93, 0, +101,100,103,101, 87,105,100,116,104, 0,102,111,114,119, 97,114,100, 0,119,105,112,101,116,121,112,101, 0,102, 77,105,110,105, + 0,102, 67,108, 97,109,112, 0,102, 66,111,111,115,116, 0,100, 68,105,115,116, 0,100, 81,117, 97,108,105,116,121, 0, 98, 78, +111, 67,111,109,112, 0, 83, 99, 97,108,101,120, 73,110,105, 0, 83, 99, 97,108,101,121, 73,110,105, 0, 83, 99, 97,108,101,120, + 70,105,110, 0, 83, 99, 97,108,101,121, 70,105,110, 0,120, 73,110,105, 0,120, 70,105,110, 0,121, 73,110,105, 0,121, 70,105, +110, 0,114,111,116, 73,110,105, 0,114,111,116, 70,105,110, 0,105,110,116,101,114,112,111,108, 97,116,105,111,110, 0, 42,102, +114, 97,109,101, 77, 97,112, 0,103,108,111, 98, 97,108, 83,112,101,101,100, 0,108, 97,115,116, 86, 97,108,105,100, 70,114, 97, +109,101, 0, 98,117,116,116,121,112,101, 0,117,115,101,114,106,105,116, 0,115,116, 97, 0,116,111,116,112, 97,114,116, 0,110, +111,114,109,102, 97, 99, 0,111, 98,102, 97, 99, 0,114, 97,110,100,102, 97, 99, 0,116,101,120,102, 97, 99, 0,114, 97,110,100, +108,105,102,101, 0,102,111,114, 99,101, 91, 51, 93, 0,118,101, 99,116,115,105,122,101, 0,109, 97,120,108,101,110, 0,100,101, +102,118,101, 99, 91, 51, 93, 0,109,117,108,116, 91, 52, 93, 0,108,105,102,101, 91, 52, 93, 0, 99,104,105,108,100, 91, 52, 93, + 0,109, 97,116, 91, 52, 93, 0,116,101,120,109, 97,112, 0, 99,117,114,109,117,108,116, 0,115,116, 97,116,105, 99,115,116,101, +112, 0,111,109, 97,116, 0,116,105,109,101,116,101,120, 0,115,112,101,101,100,116,101,120, 0,102,108, 97,103, 50,110,101,103, + 0,118,101,114,116,103,114,111,117,112, 95,118, 0,118,103,114,111,117,112,110, 97,109,101, 91, 51, 50, 93, 0,118,103,114,111, +117,112,110, 97,109,101, 95,118, 91, 51, 50, 93, 0, 42,107,101,121,115, 0,109,105,110,102, 97, 99, 0,117,115,101,100, 0,117, +115,101,100,101,108,101,109, 0,111,116,121,112,101, 0,111,108,100, 0, 42,112,111,105,110, 0, 42,111,108,100,112,111,105,110, + 0,114,101,115,101,116,100,105,115,116, 0,108, 97,115,116,118, 97,108, 0, 42,109, 97, 0,107,101,121, 0,113,117, 97,108, 0, +113,117, 97,108, 50, 0,116, 97,114,103,101,116, 78, 97,109,101, 91, 51, 50, 93, 0,116,111,103,103,108,101, 78, 97,109,101, 91, + 51, 50, 93, 0,118, 97,108,117,101, 91, 51, 50, 93, 0,109, 97,120,118, 97,108,117,101, 91, 51, 50, 93, 0,100,101,108, 97,121, + 0,100,117,114, 97,116,105,111,110, 0,109, 97,116,101,114,105, 97,108, 78, 97,109,101, 91, 51, 50, 93, 0,100, 97,109,112,116, +105,109,101,114, 0,112,114,111,112,110, 97,109,101, 91, 51, 50, 93, 0,109, 97,116,110, 97,109,101, 91, 51, 50, 93, 0, 97,120, +105,115,102,108, 97,103, 0, 42,102,114,111,109, 79, 98,106,101, 99,116, 0,115,117, 98,106,101, 99,116, 91, 51, 50, 93, 0, 98, +111,100,121, 91, 51, 50, 93, 0,112,117,108,115,101, 0,102,114,101,113, 0,116,111,116,108,105,110,107,115, 0, 42, 42,108,105, +110,107,115, 0,116, 97,112, 0,106,111,121,105,110,100,101,120, 0, 97,120,105,115, 95,115,105,110,103,108,101, 0, 97,120,105, +115,102, 0, 98,117,116,116,111,110, 0,104, 97,116, 0,104, 97,116,102, 0,112,114,101, 99,105,115,105,111,110, 0,115,116,114, + 91, 49, 50, 56, 93, 0,109,111,100,117,108,101, 91, 54, 52, 93, 0, 42,109,121,110,101,119, 0,105,110,112,117,116,115, 0,116, +111,116,115,108,105,110,107,115, 0, 42, 42,115,108,105,110,107,115, 0,118, 97,108,111, 0,115,116, 97,116,101, 95,109, 97,115, +107, 0, 42, 97, 99,116, 0,102,114, 97,109,101, 80,114,111,112, 91, 51, 50, 93, 0, 98,108,101,110,100,105,110, 0,112,114,105, +111,114,105,116,121, 0,101,110,100, 95,114,101,115,101,116, 0,115,116,114,105,100,101, 97,120,105,115, 0,115,116,114,105,100, +101,108,101,110,103,116,104, 0,115,110,100,110,114, 0,112, 97,100, 49, 91, 50, 93, 0,109, 97,107,101, 99,111,112,121, 0, 99, +111,112,121,109, 97,100,101, 0,112, 97,100, 50, 91, 49, 93, 0,116,114, 97, 99,107, 0, 42,109,101, 0,108,105,110, 86,101,108, +111, 99,105,116,121, 91, 51, 93, 0, 97,110,103, 86,101,108,111, 99,105,116,121, 91, 51, 93, 0,108,111, 99, 97,108,102,108, 97, +103, 0,100,121,110, 95,111,112,101,114, 97,116,105,111,110, 0,102,111,114, 99,101,108,111, 99, 91, 51, 93, 0,102,111,114, 99, +101,114,111,116, 91, 51, 93, 0,108,105,110,101, 97,114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0, 97,110,103,117,108, 97, +114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0, 42,114,101,102,101,114,101,110, 99,101, 0, 98,117,116,115,116, 97, 0, 98, 117,116,101,110,100, 0,109,105,110, 0,109, 97,120, 0,118,105,115,105,102, 97, 99, 0,114,111,116,100, 97,109,112, 0,109,105, 110,108,111, 99, 91, 51, 93, 0,109, 97,120,108,111, 99, 91, 51, 93, 0,109,105,110,114,111,116, 91, 51, 93, 0,109, 97,120,114, 111,116, 91, 51, 93, 0,109, 97,116,112,114,111,112, 91, 51, 50, 93, 0,100,105,115,116,114,105, 98,117,116,105,111,110, 0,105, @@ -1892,1028 +2277,1043 @@ char datatoc_B_blend[]= { 114,109, 95,104,101, 97,100, 91, 51, 93, 0, 97,114,109, 95,116, 97,105,108, 91, 51, 93, 0, 97,114,109, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,120,119,105,100,116,104, 0,122,119,105,100,116,104, 0,101, 97,115,101, 49, 0,101, 97,115,101, 50, 0,114, 97,100, 95,104,101, 97,100, 0,114, 97,100, 95,116, 97,105,108, 0, 98,111,110,101, 98, 97,115,101, 0, 99,104, 97,105,110, 98, - 97,115,101, 0, 42,101,100, 98,111, 0,112, 97,116,104,102,108, 97,103, 0,108, 97,121,101,114, 95,112,114,111,116,101, 99,116, -101,100, 0,103,104,111,115,116,101,112, 0,103,104,111,115,116,115,105,122,101, 0,103,104,111,115,116,116,121,112,101, 0,112, - 97,116,104,115,105,122,101, 0,103,104,111,115,116,115,102, 0,103,104,111,115,116,101,102, 0,112, 97,116,104,115,102, 0,112, - 97,116,104,101,102, 0,112, 97,116,104, 98, 99, 0,112, 97,116,104, 97, 99, 0, 42,112,114,111,112, 0, 99,111,110,115,116,102, -108, 97,103, 0,105,107,102,108, 97,103, 0,115,101,108,101, 99,116,102,108, 97,103, 0, 97,103,114,112, 95,105,110,100,101,120, - 0, 42, 98,111,110,101, 0, 42, 99,104,105,108,100, 0,105,107,116,114,101,101, 0, 42, 98, 95, 98,111,110,101, 95,109, 97,116, -115, 0, 42,100,117, 97,108, 95,113,117, 97,116, 0, 42, 98, 95, 98,111,110,101, 95,100,117, 97,108, 95,113,117, 97,116,115, 0, -101,117,108, 91, 51, 93, 0,114,111,116,109,111,100,101, 0, 99,104, 97,110, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,111, -115,101, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,111,115,101, 95,104,101, 97,100, 91, 51, 93, 0,112,111,115,101, 95,116, - 97,105,108, 91, 51, 93, 0,108,105,109,105,116,109,105,110, 91, 51, 93, 0,108,105,109,105,116,109, 97,120, 91, 51, 93, 0,115, -116,105,102,102,110,101,115,115, 91, 51, 93, 0,105,107,115,116,114,101,116, 99,104, 0, 42, 99,117,115,116,111,109, 0, 99,104, - 97,110, 98, 97,115,101, 0,112,114,111,120,121, 95,108, 97,121,101,114, 0,115,116,114,105,100,101, 95,111,102,102,115,101,116, - 91, 51, 93, 0, 99,121, 99,108,105, 99, 95,111,102,102,115,101,116, 91, 51, 93, 0, 97,103,114,111,117,112,115, 0, 97, 99,116, -105,118,101, 95,103,114,111,117,112, 0, 99,117,115,116,111,109, 67,111,108, 0, 99,115, 0, 99,117,114,118,101,115, 0,103,114, -111,117,112,115, 0, 97, 99,116,105,118,101, 95,109, 97,114,107,101,114, 0, 42,115,111,117,114, 99,101, 0,102,105,108,116,101, -114,102,108, 97,103, 0, 97,100,115, 0, 97, 99,116,110,114, 0, 97, 99,116,119,105,100,116,104, 0,116,105,109,101,115,108,105, -100,101, 0, 42,103,114,112, 0,116,101,109,112, 0,110, 97,109,101, 91, 51, 48, 93, 0,111,119,110,115,112, 97, 99,101, 0,116, - 97,114,115,112, 97, 99,101, 0,101,110,102,111,114, 99,101, 0,104,101, 97,100,116, 97,105,108, 0, 42,116, 97,114, 0,115,117, - 98,116, 97,114,103,101,116, 91, 51, 50, 93, 0,109, 97,116,114,105,120, 91, 52, 93, 91, 52, 93, 0,115,112, 97, 99,101, 0,116, - 97,114,110,117,109, 0,116, 97,114,103,101,116,115, 0,105,116,101,114, 97,116,105,111,110,115, 0,114,111,111,116, 98,111,110, -101, 0,109, 97,120, 95,114,111,111,116, 98,111,110,101, 0, 42,112,111,108,101,116, 97,114, 0,112,111,108,101,115,117, 98,116, - 97,114,103,101,116, 91, 51, 50, 93, 0,112,111,108,101, 97,110,103,108,101, 0,111,114,105,101,110,116,119,101,105,103,104,116, - 0,103,114, 97, 98,116, 97,114,103,101,116, 91, 51, 93, 0,114,101,115,101,114,118,101,100, 49, 0,114,101,115,101,114,118,101, -100, 50, 0,109,105,110,109, 97,120,102,108, 97,103, 0,115,116,117, 99,107, 0, 99, 97, 99,104,101, 91, 51, 93, 0,108,111, 99, -107,102,108, 97,103, 0,102,111,108,108,111,119,102,108, 97,103, 0,118,111,108,109,111,100,101, 0,112,108, 97,110,101, 0,111, -114,103,108,101,110,103,116,104, 0, 98,117,108,103,101, 0,112,105,118, 88, 0,112,105,118, 89, 0,112,105,118, 90, 0, 97,120, - 88, 0, 97,120, 89, 0, 97,120, 90, 0,109,105,110, 76,105,109,105,116, 91, 54, 93, 0,109, 97,120, 76,105,109,105,116, 91, 54, - 93, 0,101,120,116,114, 97, 70,122, 0,105,110,118,109, 97,116, 91, 52, 93, 91, 52, 93, 0,102,114,111,109, 0,116,111, 0,109, - 97,112, 91, 51, 93, 0,101,120,112,111, 0,102,114,111,109, 95,109,105,110, 91, 51, 93, 0,102,114,111,109, 95,109, 97,120, 91, - 51, 93, 0,116,111, 95,109,105,110, 91, 51, 93, 0,116,111, 95,109, 97,120, 91, 51, 93, 0,122,109,105,110, 0,122,109, 97,120, - 0,112, 97,100, 91, 57, 93, 0, 99,104, 97,110,110,101,108, 91, 51, 50, 93, 0,110,111, 95,114,111,116, 95, 97,120,105,115, 0, -115,116,114,105,100,101, 95, 97,120,105,115, 0, 99,117,114,109,111,100, 0, 97, 99,116,115,116, 97,114,116, 0, 97, 99,116,101, -110,100, 0, 97, 99,116,111,102,102,115, 0,115,116,114,105,100,101,108,101,110, 0,115, 99, 97,108,101, 0, 98,108,101,110,100, -111,117,116, 0,115,116,114,105,100,101, 99,104, 97,110,110,101,108, 91, 51, 50, 93, 0,111,102,102,115, 95, 98,111,110,101, 91, - 51, 50, 93, 0,104, 97,115,105,110,112,117,116, 0,104, 97,115,111,117,116,112,117,116, 0,100, 97,116, 97,116,121,112,101, 0, -115,111, 99,107,101,116,116,121,112,101, 0, 42,110,101,119, 95,115,111, 99,107, 0,110,115, 0,108,105,109,105,116, 0,115,116, - 97, 99,107, 95,105,110,100,101,120, 0,105,110,116,101,114,110, 0,115,116, 97, 99,107, 95,105,110,100,101,120, 95,101,120,116, - 0,108,111, 99,120, 0,108,111, 99,121, 0,111,119,110, 95,105,110,100,101,120, 0,116,111, 95,105,110,100,101,120, 0, 42,116, -111,115,111, 99,107, 0, 42,108,105,110,107, 0, 42,110,101,119, 95,110,111,100,101, 0,117,115,101,114,110, 97,109,101, 91, 51, - 50, 93, 0,108, 97,115,116,121, 0,111,117,116,112,117,116,115, 0, 42,115,116,111,114, 97,103,101, 0,109,105,110,105,119,105, -100,116,104, 0, 99,117,115,116,111,109, 49, 0, 99,117,115,116,111,109, 50, 0, 99,117,115,116,111,109, 51, 0, 99,117,115,116, -111,109, 52, 0,110,101,101,100, 95,101,120,101, 99, 0,101,120,101, 99, 0, 42,116,104,114,101, 97,100,100, 97,116, 97, 0,116, -111,116,114, 0, 98,117,116,114, 0,112,114,118,114, 0, 42,116,121,112,101,105,110,102,111, 0, 42,102,114,111,109,110,111,100, -101, 0, 42,116,111,110,111,100,101, 0, 42,102,114,111,109,115,111, 99,107, 0,110,111,100,101,115, 0,108,105,110,107,115, 0, - 42,115,116, 97, 99,107, 0, 42,116,104,114,101, 97,100,115,116, 97, 99,107, 0,105,110,105,116, 0,115,116, 97, 99,107,115,105, -122,101, 0, 99,117,114, 95,105,110,100,101,120, 0, 97,108,108,116,121,112,101,115, 0, 42,111,119,110,116,121,112,101, 0, 42, -115,101,108,105,110, 0, 42,115,101,108,111,117,116, 0, 40, 42,116,105,109,101, 99,117,114,115,111,114, 41, 40, 41, 0, 40, 42, -115,116, 97,116,115, 95,100,114, 97,119, 41, 40, 41, 0, 40, 42,116,101,115,116, 95, 98,114,101, 97,107, 41, 40, 41, 0, 42,116, - 98,104, 0, 42,116, 99,104, 0, 42,115,100,104, 0, 99,121, 99,108,105, 99, 0,109,111,118,105,101, 0,115, 97,109,112,108,101, -115, 0,109,105,110,115,112,101,101,100, 0,112,101,114, 99,101,110,116,120, 0,112,101,114, 99,101,110,116,121, 0, 98,111,107, -101,104, 0, 99,117,114,118,101,100, 0,105,109, 97,103,101, 95,105,110, 95,119,105,100,116,104, 0,105,109, 97,103,101, 95,105, -110, 95,104,101,105,103,104,116, 0, 99,101,110,116,101,114, 95,120, 0, 99,101,110,116,101,114, 95,121, 0,115,112,105,110, 0, -105,116,101,114, 0,119,114, 97,112, 0,115,105,103,109, 97, 95, 99,111,108,111,114, 0,115,105,103,109, 97, 95,115,112, 97, 99, -101, 0,104,117,101, 0,115, 97,116, 0,116, 49, 0,116, 50, 0,116, 51, 0,102,115,116,114,101,110,103,116,104, 0,102, 97,108, -112,104, 97, 0,107,101,121, 91, 52, 93, 0,120, 49, 0,120, 50, 0,121, 49, 0,121, 50, 0, 99,111,108,110, 97,109,101, 91, 51, - 50, 93, 0, 98,107,116,121,112,101, 0,114,111,116, 97,116,105,111,110, 0,112,114,101,118,105,101,119, 0,103, 97,109, 99,111, - 0,110,111, 95,122, 98,117,102, 0,102,115,116,111,112, 0,109, 97,120, 98,108,117,114, 0, 98,116,104,114,101,115,104, 0, 42, -100,105, 99,116, 0, 42,110,111,100,101, 0, 97,110,103,108,101, 95,111,102,115, 0, 99,111,108,109,111,100, 0,109,105,120, 0, -116,104,114,101,115,104,111,108,100, 0,102, 97,100,101, 0,109, 0, 99, 0,106,105,116, 0,112,114,111,106, 0,102,105,116, 0, -115,104,111,114,116,121, 0,109,105,110,116, 97, 98,108,101, 0,109, 97,120,116, 97, 98,108,101, 0,101,120,116, 95,105,110, 91, - 50, 93, 0,101,120,116, 95,111,117,116, 91, 50, 93, 0, 42, 99,117,114,118,101, 0, 42,116, 97, 98,108,101, 0, 42,112,114,101, -109,117,108,116, 97, 98,108,101, 0, 99,117,114,114, 0, 99,108,105,112,114, 0, 99,109, 91, 52, 93, 0, 98,108, 97, 99,107, 91, - 51, 93, 0,119,104,105,116,101, 91, 51, 93, 0, 98,119,109,117,108, 91, 51, 93, 0,115, 97,109,112,108,101, 91, 51, 93, 0,111, -102,102,115,101,116, 91, 50, 93, 0, 99,108,111,110,101, 0,105,110,110,101,114,114, 97,100,105,117,115, 0,114, 97,116,101, 0, -114,103, 98, 91, 51, 93, 0,114,111,116, 0,115, 99,117,108,112,116, 95,116,111,111,108, 0, 97, 99,116,105,118,101, 95,114,110, -100, 0, 97, 99,116,105,118,101, 95, 99,108,111,110,101, 0, 97, 99,116,105,118,101, 95,109, 97,115,107, 0, 42,108, 97,121,101, -114,115, 0,116,111,116,108, 97,121,101,114, 0,109, 97,120,108, 97,121,101,114, 0,116,111,116,115,105,122,101, 0, 42,112,111, -111,108, 0,101,100,105,116,102,108, 97,103, 0,118,101,108, 91, 51, 93, 0,114,111,116, 91, 52, 93, 0, 97,118,101, 91, 51, 93, - 0,110,117,109, 0,112, 97,114,101,110,116, 0,112, 97, 91, 52, 93, 0,119, 91, 52, 93, 0,102,117,118, 91, 52, 93, 0,102,111, -102,102,115,101,116, 0,114, 97,110,100, 91, 51, 93, 0, 42,115,116,105, 99,107, 95,111, 98, 0,112,114,101,118, 95,115,116, 97, -116,101, 0, 42,104, 97,105,114, 0,105, 95,114,111,116, 91, 52, 93, 0,114, 95,114,111,116, 91, 52, 93, 0,114, 95, 97,118,101, - 91, 51, 93, 0,114, 95,118,101, 91, 51, 93, 0,100,105,101,116,105,109,101, 0, 98, 97,110,107, 0,115,105,122,101,109,117,108, - 0,110,117,109, 95,100,109, 99, 97, 99,104,101, 0, 98,112,105, 0, 97,108,105,118,101, 0,108,111,111,112, 0,100,105,115,116, -114, 0,112,104,121,115,116,121,112,101, 0, 97,118,101,109,111,100,101, 0,114,101, 97, 99,116,101,118,101,110,116, 0,100,114, - 97,119, 0,100,114, 97,119, 95, 97,115, 0,100,114, 97,119, 95,115,105,122,101, 0, 99,104,105,108,100,116,121,112,101, 0,100, -114, 97,119, 95,115,116,101,112, 0,114,101,110, 95,115,116,101,112, 0,104, 97,105,114, 95,115,116,101,112, 0,107,101,121,115, - 95,115,116,101,112, 0, 97,100, 97,112,116, 95, 97,110,103,108,101, 0, 97,100, 97,112,116, 95,112,105,120, 0,114,111,116,102, -114,111,109, 0,105,110,116,101,103,114, 97,116,111,114, 0,110, 98,101,116,119,101,101,110, 0, 98,111,105,100,110,101,105,103, -104, 98,111,117,114,115, 0, 98, 98, 95, 97,108,105,103,110, 0, 98, 98, 95,117,118, 95,115,112,108,105,116, 0, 98, 98, 95, 97, -110,105,109, 0, 98, 98, 95,115,112,108,105,116, 95,111,102,102,115,101,116, 0, 98, 98, 95,116,105,108,116, 0, 98, 98, 95,114, - 97,110,100, 95,116,105,108,116, 0, 98, 98, 95,111,102,102,115,101,116, 91, 50, 93, 0,115,105,109,112,108,105,102,121, 95,102, -108, 97,103, 0,115,105,109,112,108,105,102,121, 95,114,101,102,115,105,122,101, 0,115,105,109,112,108,105,102,121, 95,114, 97, -116,101, 0,115,105,109,112,108,105,102,121, 95,116,114, 97,110,115,105,116,105,111,110, 0,115,105,109,112,108,105,102,121, 95, -118,105,101,119,112,111,114,116, 0,116,105,109,101,116,119,101, 97,107, 0,106,105,116,102, 97, 99, 0,107,101,121,101,100, 95, -116,105,109,101, 0,101,102,102, 95,104, 97,105,114, 0,103,114,105,100, 95,114,101,115, 0,112, 97,114,116,102, 97, 99, 0,116, - 97,110,102, 97, 99, 0,116, 97,110,112,104, 97,115,101, 0,114,101, 97, 99,116,102, 97, 99, 0, 97,118,101,102, 97, 99, 0,112, -104, 97,115,101,102, 97, 99, 0,114, 97,110,100,114,111,116,102, 97, 99, 0,114, 97,110,100,112,104, 97,115,101,102, 97, 99, 0, -114, 97,110,100,115,105,122,101, 0,114,101, 97, 99,116,115,104, 97,112,101, 0, 97, 99, 99, 91, 51, 93, 0,100,114, 97,103,102, - 97, 99, 0, 98,114,111,119,110,102, 97, 99, 0,100, 97,109,112,102, 97, 99, 0, 97, 98,115,108,101,110,103,116,104, 0,114, 97, -110,100,108,101,110,103,116,104, 0, 99,104,105,108,100, 95,110, 98,114, 0,114,101,110, 95, 99,104,105,108,100, 95,110, 98,114, - 0,112, 97,114,101,110,116,115, 0, 99,104,105,108,100,115,105,122,101, 0, 99,104,105,108,100,114, 97,110,100,115,105,122,101, - 0, 99,104,105,108,100,114, 97,100, 0, 99,104,105,108,100,102,108, 97,116, 0, 99,104,105,108,100,115,112,114,101, 97,100, 0, - 99,108,117,109,112,102, 97, 99, 0, 99,108,117,109,112,112,111,119, 0,114,111,117,103,104, 49, 0,114,111,117,103,104, 49, 95, -115,105,122,101, 0,114,111,117,103,104, 50, 0,114,111,117,103,104, 50, 95,115,105,122,101, 0,114,111,117,103,104, 50, 95,116, -104,114,101,115, 0,114,111,117,103,104, 95,101,110,100, 0,114,111,117,103,104, 95,101,110,100, 95,115,104, 97,112,101, 0, 98, -114, 97,110, 99,104, 95,116,104,114,101,115, 0,100,114, 97,119, 95,108,105,110,101, 91, 50, 93, 0,109, 97,120, 95,108, 97,116, - 95, 97, 99, 99, 0,109, 97,120, 95,116, 97,110, 95, 97, 99, 99, 0, 97,118,101,114, 97,103,101, 95,118,101,108, 0, 98, 97,110, -107,105,110,103, 0,109, 97,120, 95, 98, 97,110,107, 0,103,114,111,117,110,100,122, 0, 98,111,105,100,102, 97, 99, 91, 56, 93, - 0, 98,111,105,100,114,117,108,101, 91, 56, 93, 0, 42,101,102,102, 95,103,114,111,117,112, 0, 42,100,117,112, 95,111, 98, 0, - 42, 98, 98, 95,111, 98, 0, 42,112,100, 50, 0, 42,112, 97,114,116, 0, 42,101,100,105,116, 0, 40, 42,102,114,101,101, 95,101, -100,105,116, 41, 40, 41, 0, 42, 42,112, 97,116,104, 99, 97, 99,104,101, 0, 42, 42, 99,104,105,108,100, 99, 97, 99,104,101, 0, -112, 97,116,104, 99, 97, 99,104,101, 98,117,102,115, 0, 99,104,105,108,100, 99, 97, 99,104,101, 98,117,102,115, 0, 42,116, 97, -114,103,101,116, 95,111, 98, 0, 42,107,101,121,101,100, 95,111, 98, 0, 42,108, 97,116,116,105, 99,101, 0,101,102,102,101, 99, -116,111,114,115, 0,114,101, 97, 99,116,101,118,101,110,116,115, 0,116,111,116, 99,104,105,108,100, 0,116,111,116, 99, 97, 99, -104,101,100, 0,116,111,116, 99,104,105,108,100, 99, 97, 99,104,101, 0,116, 97,114,103,101,116, 95,112,115,121,115, 0,107,101, -121,101,100, 95,112,115,121,115, 0,116,111,116,107,101,121,101,100, 0, 98, 97,107,101,115,112, 97, 99,101, 0, 98, 98, 95,117, -118,110, 97,109,101, 91, 51, 93, 91, 51, 50, 93, 0,118,103,114,111,117,112, 91, 49, 50, 93, 0,118,103, 95,110,101,103, 0,114, -116, 51, 0, 42,114,101,110,100,101,114,100, 97,116, 97, 0, 42, 99, 97, 99,104,101, 0, 67,100,105,115, 0, 67,118,105, 0, 91, - 51, 93, 0,115,116,114,117, 99,116,117,114, 97,108, 0, 98,101,110,100,105,110,103, 0,109, 97,120, 95, 98,101,110,100, 0,109, - 97,120, 95,115,116,114,117, 99,116, 0,109, 97,120, 95,115,104,101, 97,114, 0, 97,118,103, 95,115,112,114,105,110,103, 95,108, -101,110, 0,116,105,109,101,115, 99, 97,108,101, 0,101,102,102, 95,102,111,114, 99,101, 95,115, 99, 97,108,101, 0,101,102,102, - 95,119,105,110,100, 95,115, 99, 97,108,101, 0,115,105,109, 95,116,105,109,101, 95,111,108,100, 0,115,116,101,112,115, 80,101, -114, 70,114, 97,109,101, 0,112,114,101,114,111,108,108, 0,109, 97,120,115,112,114,105,110,103,108,101,110, 0,115,111,108,118, -101,114, 95,116,121,112,101, 0,118,103,114,111,117,112, 95, 98,101,110,100, 0,118,103,114,111,117,112, 95,109, 97,115,115, 0, -118,103,114,111,117,112, 95,115,116,114,117, 99,116, 0,112,114,101,115,101,116,115, 0, 42, 99,111,108,108,105,115,105,111,110, - 95,108,105,115,116, 0,101,112,115,105,108,111,110, 0,115,101,108,102, 95,102,114,105, 99,116,105,111,110, 0,115,101,108,102, -101,112,115,105,108,111,110, 0,115,101,108,102, 95,108,111,111,112, 95, 99,111,117,110,116, 0,108,111,111,112, 95, 99,111,117, -110,116, 0,112,114,101,115,115,117,114,101, 0, 42,112,111,105,110,116,115, 0,116,111,116,112,111,105,110,116,115, 0,116,104, -105, 99,107,110,101,115,115, 0,115,116,114,111,107,101,115, 0,102,114, 97,109,101,110,117,109, 0, 42, 97, 99,116,102,114, 97, -109,101, 0,103,115,116,101,112, 0,105,110,102,111, 91, 49, 50, 56, 93, 0,115, 98,117,102,102,101,114, 95,115,105,122,101, 0, -115, 98,117,102,102,101,114, 95,115,102,108, 97,103, 0, 42,115, 98,117,102,102,101,114, 0, 42,119,105,110,100,114, 97,119, 97, - 98,108,101, 0, 42,119,105,110, 97, 99,116,105,118,101, 0,119,105,110,100,111,119,115, 0,105,110,105,116,105, 97,108,105,122, -101,100, 0,102,105,108,101, 95,115, 97,118,101,100, 0,111,112,101,114, 97,116,111,114,115, 0,113,117,101,117,101, 0,114,101, -112,111,114,116,115, 0,106,111, 98,115, 0,112, 97,105,110,116, 99,117,114,115,111,114,115, 0,107,101,121,109, 97,112,115, 0, - 42,103,104,111,115,116,119,105,110, 0,115, 99,114,101,101,110,110, 97,109,101, 91, 51, 50, 93, 0,112,111,115,120, 0,112,111, -115,121, 0,119,105,110,100,111,119,115,116, 97,116,101, 0,109,111,110,105,116,111,114, 0,108, 97,115,116, 99,117,114,115,111, -114, 0, 42,101,118,101,110,116,115,116, 97,116,101, 0, 42, 99,117,114,115,119,105,110, 0, 42,116,119,101, 97,107, 0,100,114, - 97,119,109,101,116,104,111,100, 0,100,114, 97,119,102, 97,105,108, 0, 42,100,114, 97,119,100, 97,116, 97, 0,116,105,109,101, -114,115, 0,115,117, 98,119,105,110,100,111,119,115, 0,103,101,115,116,117,114,101, 0,105,100,110, 97,109,101, 91, 54, 52, 93, - 0, 42,112,116,114, 0,115,104,105,102,116, 0, 99,116,114,108, 0, 97,108,116, 0,111,115,107,101,121, 0,107,101,121,109,111, -100,105,102,105,101,114, 0,107,101,121,109, 97,112, 0,110, 97,109,101,105,100, 91, 54, 52, 93, 0,115,112, 97, 99,101,105,100, - 0,114,101,103,105,111,110,105,100, 0, 42, 99,117,115,116,111,109,100, 97,116, 97, 0, 42,114,101,112,111,114,116,115, 0, 42, -101,100, 97,116, 97, 0,105,110,102,108,117,101,110, 99,101, 0,101,120,112,114,101,115,115,105,111,110, 91, 50, 53, 54, 93, 0, - 42, 99,111,101,102,102,105, 99,105,101,110,116,115, 0, 97,114,114, 97,121,115,105,122,101, 0,112,111,108,121, 95,111,114,100, -101,114, 0,102,117,110, 99, 95,116,121,112,101, 0,109,105,100,118, 97,108, 0, 98,101,102,111,114,101, 95,109,111,100,101, 0, - 97,102,116,101,114, 95,109,111,100,101, 0, 98,101,102,111,114,101, 95, 99,121, 99,108,101,115, 0, 97,102,116,101,114, 95, 99, -121, 99,108,101,115, 0,114,101, 99,116, 0,112,104, 97,115,101, 0,109,111,100,105,102,105, 99, 97,116,105,111,110, 0, 42,114, -110, 97, 95,112, 97,116,104, 0, 97,114,114, 97,121, 95,105,110,100,101,120, 0,118,101, 99, 91, 50, 93, 0, 42,102,112,116, 0, - 99,111,108,111,114, 95,109,111,100,101, 0, 99,111,108,111,114, 91, 51, 93, 0,102,114,111,109, 91, 49, 50, 56, 93, 0,116,111, - 91, 49, 50, 56, 93, 0,109, 97,112,112,105,110,103,115, 0, 42,114,101,109, 97,112, 0,102, 99,117,114,118,101,115, 0, 97, 99, -116, 95,116,105,109,101, 0, 98,108,101,110,100,109,111,100,101, 0,115,116,114,105,112,115, 0,105,110,102,111, 91, 54, 52, 93, - 0,103,114,111,117,112, 91, 54, 52, 93, 0,105,100,116,121,112,101, 0,116,101,109,112,108, 97,116,101,115, 0,103,114,111,117, -112,109,111,100,101, 0,112, 97,116,104,115, 0,107,101,121,105,110,103,102,108, 97,103, 0,110,108, 97, 95,116,114, 97, 99,107, -115, 0,100,114,105,118,101,114,115, 0,111,118,101,114,114,105,100,101,115, 0, 84, 89, 80, 69, 0, 0, 1,154, 99,104, 97,114, - 0,117, 99,104, 97,114, 0,115,104,111,114,116, 0,117,115,104,111,114,116, 0,105,110,116, 0,108,111,110,103, 0,117,108,111, -110,103, 0,102,108,111, 97,116, 0,100,111,117, 98,108,101, 0,118,111,105,100, 0, 76,105,110,107, 0, 76,105,110,107, 68, 97, -116, 97, 0, 76,105,115,116, 66, 97,115,101, 0,118,101, 99, 50,115, 0,118,101, 99, 50,105, 0,118,101, 99, 50,102, 0,118,101, - 99, 50,100, 0,118,101, 99, 51,105, 0,118,101, 99, 51,102, 0,118,101, 99, 51,100, 0,118,101, 99, 52,105, 0,118,101, 99, 52, -102, 0,118,101, 99, 52,100, 0,114, 99,116,105, 0,114, 99,116,102, 0, 73, 68, 80,114,111,112,101,114,116,121, 68, 97,116, 97, - 0, 73, 68, 80,114,111,112,101,114,116,121, 0, 73, 68, 0, 76,105, 98,114, 97,114,121, 0, 70,105,108,101, 68, 97,116, 97, 0, - 80,114,101,118,105,101,119, 73,109, 97,103,101, 0, 73,112,111, 68,114,105,118,101,114, 0, 79, 98,106,101, 99,116, 0, 73,112, -111, 67,117,114,118,101, 0, 66, 80,111,105,110,116, 0, 66,101,122, 84,114,105,112,108,101, 0, 73,112,111, 0, 75,101,121, 66, -108,111, 99,107, 0, 75,101,121, 0, 65,110,105,109, 68, 97,116, 97, 0, 83, 99,114,105,112,116, 76,105,110,107, 0, 84,101,120, -116, 76,105,110,101, 0, 84,101,120,116, 77, 97,114,107,101,114, 0, 84,101,120,116, 0, 80, 97, 99,107,101,100, 70,105,108,101, - 0, 67, 97,109,101,114, 97, 0, 73,109, 97,103,101, 85,115,101,114, 0, 83, 99,101,110,101, 0, 73,109, 97,103,101, 0, 71, 80, - 85, 84,101,120,116,117,114,101, 0, 97,110,105,109, 0, 82,101,110,100,101,114, 82,101,115,117,108,116, 0, 77, 84,101,120, 0, - 84,101,120, 0, 80,108,117,103,105,110, 84,101,120, 0, 67, 66, 68, 97,116, 97, 0, 67,111,108,111,114, 66, 97,110,100, 0, 69, -110,118, 77, 97,112, 0, 73,109, 66,117,102, 0, 98, 78,111,100,101, 84,114,101,101, 0, 84,101,120, 77, 97,112,112,105,110,103, - 0, 76, 97,109,112, 0, 67,117,114,118,101, 77, 97,112,112,105,110,103, 0, 87, 97,118,101, 0, 77, 97,116,101,114,105, 97,108, - 0, 71,114,111,117,112, 0, 86, 70,111,110,116, 0, 86, 70,111,110,116, 68, 97,116, 97, 0, 77,101,116, 97, 69,108,101,109, 0, - 66,111,117,110,100, 66,111,120, 0, 77,101,116, 97, 66, 97,108,108, 0, 78,117,114, 98, 0, 67,104, 97,114, 73,110,102,111, 0, - 84,101,120,116, 66,111,120, 0, 67,117,114,118,101, 0, 80, 97,116,104, 0, 83,101,108, 66,111,120, 0, 69,100,105,116, 70,111, -110,116, 0, 77,101,115,104, 0, 77, 70, 97, 99,101, 0, 77, 84, 70, 97, 99,101, 0, 84, 70, 97, 99,101, 0, 77, 86,101,114,116, - 0, 77, 69,100,103,101, 0, 77, 68,101,102,111,114,109, 86,101,114,116, 0, 77, 67,111,108, 0, 77, 83,116,105, 99,107,121, 0, - 77, 83,101,108,101, 99,116, 0, 69,100,105,116, 77,101,115,104, 0, 67,117,115,116,111,109, 68, 97,116, 97, 0, 77,117,108,116, -105,114,101,115, 0, 80, 97,114,116,105, 97,108, 86,105,115,105, 98,105,108,105,116,121, 0, 77, 68,101,102,111,114,109, 87,101, -105,103,104,116, 0, 77, 84,101,120, 80,111,108,121, 0, 77, 76,111,111,112, 85, 86, 0, 77, 76,111,111,112, 67,111,108, 0, 77, - 70,108,111, 97,116, 80,114,111,112,101,114,116,121, 0, 77, 73,110,116, 80,114,111,112,101,114,116,121, 0, 77, 83,116,114,105, -110,103, 80,114,111,112,101,114,116,121, 0, 79,114,105,103, 83,112, 97, 99,101, 70, 97, 99,101, 0, 77, 68,105,115,112,115, 0, - 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 69, 68, 71, 69, 68, 82, 65, 87, 32, 40, 49, 60, 60, 49, 41, 32, 35,100,101,102, -105,110,101, 32, 77, 69, 95, 83, 69, 65, 77, 32, 40, 49, 60, 60, 50, 41, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 71, - 79, 78, 32, 40, 49, 60, 60, 51, 41, 32, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 69, 68, 71, 69, 82, 69, 78, 68, 69, 82, - 32, 40, 49, 60, 60, 53, 41, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 76, 79, 79, 83, 69, 69, 68, 71, 69, 32, 40, 49, 60, - 60, 55, 41, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 83, 69, 65, 77, 95, 76, 65, 83, 84, 32, 40, 49, 60, 60, 56, 41, 32, - 35,100,101,102,105,110,101, 32, 77, 69, 95, 83, 72, 65, 82, 80, 32, 40, 49, 60, 60, 57, 41, 32, 32, 32, 35,100,101,102,105,110, -101, 32, 77, 69, 95, 70, 76, 73, 80, 86, 49, 32, 49, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 76, 73, 80, 86, 50, 32, - 50, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 76, 73, 80, 86, 51, 32, 52, 32, 35,100,101,102,105,110,101, 32, 77, 69, - 95, 70, 76, 73, 80, 86, 52, 32, 56, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 80, 82, 79, 74, 88, 89, 32, 49, 54, 32, 35, -100,101,102,105,110,101, 32, 77, 69, 95, 80, 82, 79, 74, 88, 90, 32, 51, 50, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 80, - 82, 79, 74, 89, 90, 32, 54, 52, 32, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 49, 86, 50, 32, 49, 32, 35,100,101,102, -105,110,101, 32, 77, 69, 95, 86, 50, 86, 51, 32, 50, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 51, 86, 49, 32, 52, 32, - 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 51, 86, 52, 32, 52, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 52, 86, - 49, 32, 56, 32, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 83, 77, 79, 79, 84, 72, 32, 49, 32, 35,100,101,102,105,110,101, - 32, 77, 69, 95, 70, 65, 67, 69, 95, 83, 69, 76, 32, 50, 32, 32, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 83, 69,108, - 32, 48, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 69, 83, 69,108, 32, 49, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, - 70, 83, 69, 76, 32, 50, 32, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 69, 76, 69, 67, 84, 32, 49, 32, 32, 35,100,101, -102,105,110,101, 32, 84, 70, 95, 65, 67, 84, 73, 86, 69, 32, 50, 32, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 69, 76, - 49, 32, 52, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 69, 76, 50, 32, 56, 32, 35,100,101,102,105,110,101, 32, 84, 70, - 95, 83, 69, 76, 51, 32, 49, 54, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 69, 76, 52, 32, 51, 50, 32, 35,100,101,102, -105,110,101, 32, 84, 70, 95, 72, 73, 68, 69, 32, 54, 52, 32, 32, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 68, 89, 78, 65, - 77, 73, 67, 32, 49, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 65, 76, 80, 72, 65, 83, 79, 82, 84, 32, 50, 32, 35,100,101, -102,105,110,101, 32, 84, 70, 95, 84, 69, 88, 32, 52, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 72, 65, 82, 69, 68, 86, - 69, 82, 84, 32, 56, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 76, 73, 71, 72, 84, 32, 49, 54, 32, 35,100,101,102,105,110, -101, 32, 84, 70, 95, 83, 72, 65, 82, 69, 68, 67, 79, 76, 32, 54, 52, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 84, 73, 76, - 69, 83, 32, 49, 50, 56, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 66, 73, 76, 76, 66, 79, 65, 82, 68, 32, 50, 53, 54, 32, - 35,100,101,102,105,110,101, 32, 84, 70, 95, 84, 87, 79, 83, 73, 68, 69, 32, 53, 49, 50, 32, 35,100,101,102,105,110,101, 32, 84, - 70, 95, 73, 78, 86, 73, 83, 73, 66, 76, 69, 32, 49, 48, 50, 52, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 79, 66, 67, 79, - 76, 32, 50, 48, 52, 56, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 66, 73, 76, 76, 66, 79, 65, 82, 68, 50, 32, 52, 48, 57, - 54, 32, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 72, 65, 68, 79, 87, 32, 56, 49, 57, 50, 32, 35,100,101,102,105,110, -101, 32, 84, 70, 95, 66, 77, 70, 79, 78, 84, 32, 49, 54, 51, 56, 52, 32, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 79, - 76, 73, 68, 32, 48, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 65, 68, 68, 32, 49, 32, 35,100,101,102,105,110,101, 32, 84, - 70, 95, 65, 76, 80, 72, 65, 32, 50, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 67, 76, 73, 80, 32, 52, 32, 32, 32, 35,100, -101,102,105,110,101, 32, 84, 70, 95, 83, 85, 66, 32, 51, 32, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 68, 69, 80, 82, 69, - 67, 65, 84, 69, 68, 49, 32, 49, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 68, 69, 80, 82, 69, 67, 65, 84, 69, 68, 50, 32, - 50, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 68, 69, 80, 82, 69, 67, 65, 84, 69, 68, 51, 32, 52, 32, 35,100,101,102,105, -110,101, 32, 84, 70, 95, 68, 69, 80, 82, 69, 67, 65, 84, 69, 68, 52, 32, 56, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 80, - 73, 78, 49, 32, 49, 54, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 80, 73, 78, 50, 32, 51, 50, 32, 35,100,101,102,105,110, -101, 32, 84, 70, 95, 80, 73, 78, 51, 32, 54, 52, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 80, 73, 78, 52, 32, 49, 50, 56, - 32, 35,101,110,100,105,102, 32,108,118,108, 59, 10, 9,117,110,115,105,103,110,101,100, 32, 99,104, 97,114, 32,117,115,101, 95, - 99,111,108, 44, 32,102,108, 97,103, 59, 10, 10, 9, 47, 42, 32, 83,112,101, 99,105, 97,108, 32,108,101,118,101,108, 32, 49, 32, -100, 97,116, 97, 32,116,104, 97,116, 32, 99, 97,110,110,111,116, 32, 98,101, 32,109,111,100,105,102,105,101,100, 32,102,114,111, -109, 32,111,116,104,101,114, 32,108,101,118,101,108,115, 32, 42, 47, 10, 9, 67,117,115,116,111,109, 68, 97,116, 97, 32,118,100, - 97,116, 97, 59, 10, 9, 67,117,115,116,111,109, 68, 97,116, 97, 32,102,100, 97,116, 97, 59, 10, 9,115,104,111,114,116, 32, 42, -101,100,103,101, 95,102,108, 97,103,115, 59, 10, 9, 99,104, 97,114, 32, 42,101,100,103,101, 95, 99,114,101, 97,115,101,115, 59, - 10,125, 32, 77,117,108,116,105,114,101,115, 59, 10, 10, 47, 42, 42, 32, 69,110,100, 32, 77,117,108,116,105,114,101,115, 32, 42, - 42, 47, 10, 10,116,121,112,101,100,101,102, 32,115,116,114,117, 99,116, 32, 80, 97,114,116,105, 97,108, 86,105,115,105, 98,105, -108,105,116,121, 32,123, 10, 9,117,110,115,105,103,110,101,100, 32,105,110,116, 32, 42,118,101,114,116, 95,109, 97,112, 59, 32, - 47, 42, 32,118,101,114,116, 95,109, 97,112, 91, 79,108,100, 32, 73,110,100,101,120, 93, 61, 32, 78,101,119, 32, 73,110,100,101, -120, 32, 42, 47, 10, 9,105,110,116, 32, 42,101,100,103,101, 95,109, 97,112, 59, 32, 47, 42, 32,101,100,103,101, 95,109, 97,112, - 91, 79,108,100, 32, 73,110,100,101,120, 93, 61, 32, 78,101,119, 32, 73,110,100,101,120, 44, 32, 45, 49, 61, 32,104,105,100,100, -101,110, 32, 42, 47, 10, 9, 77, 70, 97, 99,101, 32, 42,111,108,100, 95,102, 97, 99,101,115, 59, 10, 9, 77, 69,100,103,101, 32, - 42,111,108,100, 95,101,100,103,101,115, 59, 10, 9,117,110,115,105,103,110,101,100, 32,105,110,116, 32,116,111,116,102, 97, 99, -101, 44, 32,116,111,116,101,100,103,101, 44, 32,116,111,116,118,101,114,116, 44, 32,112, 97,100, 59, 10,125, 32, 80, 97,114,116, -105, 97,108, 86,105,115,105, 98,105,108,105,116,121, 59, 10, 10, 47, 42, 32,109,118,101,114,116, 45, 62,102,108, 97,103, 32, 40, - 49, 61, 83, 69, 76, 69, 67, 84, 41, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 83, 80, 72, 69, 82, 69, 84, 69, - 83, 84, 9, 50, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 83, 80, 72, 69, 82, 69, 84, 69, 77, 80, 9, 52, 10, 35,100,101, -102,105,110,101, 32, 77, 69, 95, 72, 73, 68, 69, 9, 9, 9, 49, 54, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 69, 82, - 84, 95, 77, 69, 82, 71, 69, 68, 9, 9, 40, 49, 60, 60, 54, 41, 10, 10, 47, 42, 32,109,101,100,103,101, 45, 62,102,108, 97,103, - 32, 40, 49, 61, 83, 69, 76, 69, 67, 84, 41, 42, 47, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 69, 68, 71, 69, 68, 82, 65, - 87, 9, 9, 9, 40, 49, 60, 60, 49, 41, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 83, 69, 65, 77, 9, 9, 9, 9, 40, 49, - 60, 60, 50, 41, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 71, 79, 78, 9, 9, 9, 9, 40, 49, 60, 60, 51, 41, 10, 9, - 9, 9, 9, 9, 9, 47, 42, 32,114,101,115,101,114,118,101, 32, 49, 54, 32,102,111,114, 32, 77, 69, 95, 72, 73, 68, 69, 32, 42, - 47, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 69, 68, 71, 69, 82, 69, 78, 68, 69, 82, 9, 9, 40, 49, 60, 60, 53, 41, 10, - 35,100,101,102,105,110,101, 32, 77, 69, 95, 76, 79, 79, 83, 69, 69, 68, 71, 69, 9, 9, 40, 49, 60, 60, 55, 41, 10, 35,100,101, -102,105,110,101, 32, 77, 69, 95, 83, 69, 65, 77, 95, 76, 65, 83, 84, 9, 9, 40, 49, 60, 60, 56, 41, 10, 35,100,101,102,105,110, -101, 32, 77, 69, 95, 83, 72, 65, 82, 80, 9, 9, 9, 40, 49, 60, 60, 57, 41, 10, 10, 47, 42, 32,112,117,110,111, 32, 61, 32,118, -101,114,116,101,120,110,111,114,109, 97,108, 32, 40,109,102, 97, 99,101, 41, 32, 42, 47, 10, 47, 42, 32,114,101,110,100,101,114, - 32, 97,115,115,117,109,101,115, 32,102,108,105,112,115, 32,116,111, 32, 98,101, 32,111,114,100,101,114,101,100, 32,108,105,107, -101, 32,116,104,105,115, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 76, 73, 80, 86, 49, 9, 9, 49, 10, 35, -100,101,102,105,110,101, 32, 77, 69, 95, 70, 76, 73, 80, 86, 50, 9, 9, 50, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, - 76, 73, 80, 86, 51, 9, 9, 52, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 76, 73, 80, 86, 52, 9, 9, 56, 10, 35,100, -101,102,105,110,101, 32, 77, 69, 95, 80, 82, 79, 74, 88, 89, 9, 9, 49, 54, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 80, - 82, 79, 74, 88, 90, 9, 9, 51, 50, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 80, 82, 79, 74, 89, 90, 9, 9, 54, 52, 10, - 10, 47, 42, 32,101,100, 99,111,100,101, 32, 40,109,102, 97, 99,101, 41, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 77, 69, - 95, 86, 49, 86, 50, 9, 9, 9, 49, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 50, 86, 51, 9, 9, 9, 50, 10, 35,100, -101,102,105,110,101, 32, 77, 69, 95, 86, 51, 86, 49, 9, 9, 9, 52, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 51, 86, - 52, 9, 9, 9, 52, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 52, 86, 49, 9, 9, 9, 56, 10, 10, 47, 42, 32,102,108, - 97,103, 32, 40,109,102, 97, 99,101, 41, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 83, 77, 79, 79, 84, 72, 9, - 9, 9, 49, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 65, 67, 69, 95, 83, 69, 76, 9, 9, 9, 50, 10, 9, 9, 9, 9, - 9, 9, 47, 42, 32,102,108, 97,103, 32, 77, 69, 95, 72, 73, 68, 69, 61, 61, 49, 54, 32,105,115, 32,117,115,101,100, 32,104,101, -114,101, 32,116,111,111, 32, 42, 47, 32, 10, 47, 42, 32,109,115,101,108,101, 99,116, 45, 62,116,121,112,101, 32, 42, 47, 10, 35, -100,101,102,105,110,101, 32, 77, 69, 95, 86, 83, 69,108, 9, 48, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 69, 83, 69,108, - 32, 49, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 83, 69, 76, 32, 50, 10, 10, 47, 42, 32,109,116,102, 97, 99,101, 45, - 62,102,108, 97,103, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 69, 76, 69, 67, 84, 9, 49, 32, 47, 42, 32, -117,115,101, 32, 77, 70, 97, 99,101, 32,104,105,100,101, 32,102,108, 97,103, 32, 40, 97,102,116,101,114, 32, 50, 46, 52, 51, 41, - 44, 32,115,104,111,117,108,100, 32, 98,101, 32, 97, 98,108,101, 32,116,111, 32,114,101,117,115,101, 32, 97,102,116,101,114, 32, - 50, 46, 52, 52, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 65, 67, 84, 73, 86, 69, 9, 50, 32, 47, 42, 32,100, -101,112,114,101, 99, 97,116,101,100, 33, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 69, 76, 49, 9, 9, 52, - 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 69, 76, 50, 9, 9, 56, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, - 69, 76, 51, 9, 9, 49, 54, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 69, 76, 52, 9, 9, 51, 50, 10, 35,100,101,102, -105,110,101, 32, 84, 70, 95, 72, 73, 68, 69, 9, 9, 54, 52, 32, 47, 42, 32,117,110,117,115,101,100, 44, 32,115, 97,109,101, 32, - 97,115, 32, 84, 70, 95, 83, 69, 76, 69, 67, 84, 32, 42, 47, 10, 10, 47, 42, 32,109,116,102, 97, 99,101, 45, 62,109,111,100,101, - 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 68, 89, 78, 65, 77, 73, 67, 9, 9, 49, 10, 35,100,101,102,105,110, -101, 32, 84, 70, 95, 65, 76, 80, 72, 65, 83, 79, 82, 84, 9, 50, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 84, 69, 88, 9, - 9, 9, 52, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 72, 65, 82, 69, 68, 86, 69, 82, 84, 9, 56, 10, 35,100,101,102, -105,110,101, 32, 84, 70, 95, 76, 73, 71, 72, 84, 9, 9, 49, 54, 10, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 72, 65, - 82, 69, 68, 67, 79, 76, 9, 54, 52, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 84, 73, 76, 69, 83, 9, 9, 49, 50, 56, 10, - 35,100,101,102,105,110,101, 32, 84, 70, 95, 66, 73, 76, 76, 66, 79, 65, 82, 68, 9, 50, 53, 54, 10, 35,100,101,102,105,110,101, - 32, 84, 70, 95, 84, 87, 79, 83, 73, 68, 69, 9, 9, 53, 49, 50, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 73, 78, 86, 73, - 83, 73, 66, 76, 69, 9, 49, 48, 50, 52, 10, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 79, 66, 67, 79, 76, 9, 9, 50, 48, - 52, 56, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 66, 73, 76, 76, 66, 79, 65, 82, 68, 50, 9, 52, 48, 57, 54, 9, 47, 42, - 32,119,105,116,104, 32, 90, 32, 97,120,105,115, 32, 99,111,110,115,116,114, 97,105,110,116, 32, 42, 47, 10, 35,100,101,102,105, -110,101, 32, 84, 70, 95, 83, 72, 65, 68, 79, 87, 9, 9, 56, 49, 57, 50, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 66, 77, - 70, 79, 78, 84, 9, 9, 49, 54, 51, 56, 52, 10, 10, 47, 42, 32,109,116,102, 97, 99,101, 45, 62,116,114, 97,110,115,112, 44, 32, -118, 97,108,117,101,115, 32, 49, 45, 52, 32, 97,114,101, 32,117,115,101,100, 32, 97,115, 32,102,108, 97,103,115, 32,105,110, 32, -116,104,101, 32, 71, 76, 44, 32, 87, 65, 82, 78, 73, 78, 71, 44, 32, 84, 70, 95, 83, 85, 66, 32, 99, 97,110,116, 32,119,111,114, -107, 32,119,105,116,104, 32,116,104,105,115, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 79, 76, 73, 68, 9, - 48, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 65, 68, 68, 9, 9, 49, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 65, - 76, 80, 72, 65, 9, 50, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 67, 76, 73, 80, 9, 9, 52, 32, 47, 42, 32, 99,108,105, -112,109, 97,112, 32, 97,108,112,104, 97, 47, 98,105,110, 97,114,121, 32, 97,108,112,104, 97, 32, 97,108,108, 32,111,114, 32,110, -111,116,104,105,110,103, 33, 32, 42, 47, 10, 10, 47, 42, 32,115,117, 98, 32,105,115, 32,110,111,116, 32, 97,118, 97,105,108, 97, - 98,108,101, 32,105,110, 32,116,104,101, 32,117,115,101,114, 32,105,110,116,101,114,102, 97, 99,101, 32, 97,110,121,109,111,114, -101, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 85, 66, 9, 9, 51, 10, 10, 10, 47, 42, 32,109,116,102, 97, - 99,101, 45, 62,117,110,119,114, 97,112, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 68, 69, 80, 82, 69, 67, 65, - 84, 69, 68, 49, 9, 49, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 68, 69, 80, 82, 69, 67, 65, 84, 69, 68, 50, 9, 50, 10, - 35,100,101,102,105,110,101, 32, 84, 70, 95, 68, 69, 80, 82, 69, 67, 65, 84, 69, 68, 51, 9, 52, 10, 35,100,101,102,105,110,101, - 32, 84, 70, 95, 68, 69, 80, 82, 69, 67, 65, 84, 69, 68, 52, 9, 56, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 80, 73, 78, - 49, 9, 9, 32, 32, 32, 32, 49, 54, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 80, 73, 78, 50, 9, 9, 32, 32, 32, 32, 51, - 50, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 80, 73, 78, 51, 9, 32, 32, 32, 9, 9, 54, 52, 10, 35,100,101,102,105,110, -101, 32, 84, 70, 95, 80, 73, 78, 52, 9, 32, 32, 32, 32, 9, 49, 50, 56, 10, 10, 35,101,110,100,105,102, 10, 32, 79, 67, 75, 33, - 99,116, 32, 77, 86,101,114,116, 59, 32,115,116,114,117, 99,116, 32, 77, 69,100,103,101, 59, 32,115,116,114,117, 99,116, 32, 77, - 70, 97, 99,101, 59, 32,115,116,114,117, 99,116, 32, 77, 67,111,108, 59, 32,115,116,114,117, 99,116, 32, 77, 83,116,105, 99,107, -121, 59, 32,115,116,114,117, 99,116, 32, 77,101,115,104, 59, 32,115,116,114,117, 99,116, 32, 79, 99, 73,110,102,111, 59, 32,115, -116,114,117, 99,116, 32, 77,117,108,116,105,114,101,115, 59, 32,115,116,114,117, 99,116, 32, 80, 97,114,116,105, 97,108, 86,105, -115,105, 98,105,108,105,116,121, 59, 32,115,116,114,117, 99,116, 32, 69,100,105,116, 77,101,115,104, 59, 32, 32,116,121,112,101, -100,101,102, 32,115,116,114,117, 99,116, 32, 77,101,115,104, 32,123, 32, 32, 73, 68, 32,105,100, 59, 32, 32, 32,115,116,114,117, - 99,116, 32, 66,111,117,110,100, 66,111,120, 32, 42, 98, 98, 59, 32, 32, 32, 76,105,115,116, 66, 97,115,101, 32,101,102,102,101, - 99,116, 59, 32, 32, 32, 32,115,116,114,117, 99,116, 32, 73,112,111, 32, 42,105,112,111, 59, 32, 32,115,116,114,117, 99,116, 32, - 75,101,121, 32, 42,107,101,121, 59, 32, 32,115,192, 0, 77,117,108,116,105,114,101,115, 67,111,108, 0, 77,117,108,116,105,114, -101,115, 67,111,108, 70, 97, 99,101, 0, 77,117,108,116,105,114,101,115, 70, 97, 99,101, 0, 77,117,108,116,105,114,101,115, 69, -100,103,101, 0, 77,117,108,116,105,114,101,115, 76,101,118,101,108, 0, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83, -117, 98,115,117,114,102, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 76, 97,116,116,105, 99,101, 77,111,100,105,102,105, -101,114, 68, 97,116, 97, 0, 67,117,114,118,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66,117,105,108,100, 77,111, -100,105,102,105,101,114, 68, 97,116, 97, 0, 77, 97,115,107, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 65,114,114, 97, -121, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77,105,114,114,111,114, 77,111,100,105,102,105,101,114, 68, 97,116, 97, - 0, 69,100,103,101, 83,112,108,105,116, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66,101,118,101,108, 77,111,100,105, -102,105,101,114, 68, 97,116, 97, 0, 66, 77,101,115,104, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 68,105,115,112,108, - 97, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 85, 86, 80,114,111,106,101, 99,116, 77,111,100,105,102,105,101, -114, 68, 97,116, 97, 0, 68,101, 99,105,109, 97,116,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,109,111,111,116, -104, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67, 97,115,116, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 87, - 97,118,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 65,114,109, 97,116,117,114,101, 77,111,100,105,102,105,101,114, - 68, 97,116, 97, 0, 72,111,111,107, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,111,102,116, 98,111,100,121, 77,111, -100,105,102,105,101,114, 68, 97,116, 97, 0, 67,108,111,116,104, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67,108,111, -116,104, 0, 67,108,111,116,104, 83,105,109, 83,101,116,116,105,110,103,115, 0, 67,108,111,116,104, 67,111,108,108, 83,101,116, -116,105,110,103,115, 0, 80,111,105,110,116, 67, 97, 99,104,101, 0, 67,111,108,108,105,115,105,111,110, 77,111,100,105,102,105, -101,114, 68, 97,116, 97, 0, 66, 86, 72, 84,114,101,101, 0, 83,117,114,102, 97, 99,101, 77,111,100,105,102,105,101,114, 68, 97, -116, 97, 0, 68,101,114,105,118,101,100, 77,101,115,104, 0, 66, 86, 72, 84,114,101,101, 70,114,111,109, 77,101,115,104, 0, 66, -111,111,108,101, 97,110, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77, 68,101,102, 73,110,102,108,117,101,110, 99,101, - 0, 77, 68,101,102, 67,101,108,108, 0, 77,101,115,104, 68,101,102,111,114,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, - 0, 80, 97,114,116,105, 99,108,101, 83,121,115,116,101,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 80, 97,114,116, -105, 99,108,101, 83,121,115,116,101,109, 0, 80, 97,114,116,105, 99,108,101, 73,110,115,116, 97,110, 99,101, 77,111,100,105,102, -105,101,114, 68, 97,116, 97, 0, 69,120,112,108,111,100,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77,117,108,116, -105,114,101,115, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 70,108,117,105,100,115,105,109, 77,111,100,105,102,105,101, -114, 68, 97,116, 97, 0, 70,108,117,105,100,115,105,109, 83,101,116,116,105,110,103,115, 0, 83,104,114,105,110,107,119,114, 97, -112, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,105,109,112,108,101, 68,101,102,111,114,109, 77,111,100,105,102,105, -101,114, 68, 97,116, 97, 0, 76, 97,116,116,105, 99,101, 0, 98, 68,101,102,111,114,109, 71,114,111,117,112, 0, 98, 65, 99,116, -105,111,110, 0, 98, 80,111,115,101, 0, 66,117,108,108,101,116, 83,111,102,116, 66,111,100,121, 0, 80, 97,114,116, 68,101,102, -108,101, 99,116, 0, 83,111,102,116, 66,111,100,121, 0, 79, 98, 72,111,111,107, 0, 82, 78, 71, 0, 83, 66, 86,101,114,116,101, -120, 0, 66,111,100,121, 80,111,105,110,116, 0, 66,111,100,121, 83,112,114,105,110,103, 0, 83, 66, 83, 99,114, 97,116, 99,104, - 0, 87,111,114,108,100, 0, 82, 97,100,105,111, 0, 66, 97,115,101, 0, 65,118,105, 67,111,100,101, 99, 68, 97,116, 97, 0, 81, -117,105, 99,107,116,105,109,101, 67,111,100,101, 99, 68, 97,116, 97, 0, 70, 70, 77,112,101,103, 67,111,100,101, 99, 68, 97,116, - 97, 0, 65,117,100,105,111, 68, 97,116, 97, 0, 83, 99,101,110,101, 82,101,110,100,101,114, 76, 97,121,101,114, 0, 82,101,110, -100,101,114, 68, 97,116, 97, 0, 82,101,110,100,101,114, 80,114,111,102,105,108,101, 0, 71, 97,109,101, 70,114, 97,109,105,110, -103, 0, 84,105,109,101, 77, 97,114,107,101,114, 0, 73,109, 97,103,101, 80, 97,105,110,116, 83,101,116,116,105,110,103,115, 0, - 66,114,117,115,104, 0, 80, 97,114,116,105, 99,108,101, 66,114,117,115,104, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,108,101, - 69,100,105,116, 83,101,116,116,105,110,103,115, 0, 84,114, 97,110,115,102,111,114,109, 79,114,105,101,110,116, 97,116,105,111, -110, 0, 83, 99,117,108,112,116, 0, 83, 99,117,108,112,116, 83,101,115,115,105,111,110, 0, 86, 80, 97,105,110,116, 0, 84,111, -111,108, 83,101,116,116,105,110,103,115, 0, 98, 83,116, 97,116,115, 0, 83, 99,101,110,101, 83,116, 97,116,115, 0, 68, 97,103, - 70,111,114,101,115,116, 0, 66, 71,112,105, 99, 0, 82,101,103,105,111,110, 86,105,101,119, 51, 68, 0, 98, 71, 80,100, 97,116, - 97, 0, 82,101,110,100,101,114, 73,110,102,111, 0, 82,101,116,111,112,111, 86,105,101,119, 68, 97,116, 97, 0, 86,105,101,119, - 68,101,112,116,104,115, 0, 83,109,111,111,116,104, 86,105,101,119, 83,116,111,114,101, 0,119,109, 84,105,109,101,114, 0, 86, -105,101,119, 51, 68, 0, 83,112, 97, 99,101, 76,105,110,107, 0, 86,105,101,119, 50, 68, 0, 83,112, 97, 99,101, 73,110,102,111, - 0, 98, 83, 99,114,101,101,110, 0, 83,112, 97, 99,101, 73,112,111, 0, 98, 68,111,112,101, 83,104,101,101,116, 0, 83,112, 97, - 99,101, 66,117,116,115, 0, 83,112, 97, 99,101, 83,101,113, 0, 83,112, 97, 99,101, 70,105,108,101, 0, 70,105,108,101, 83,101, -108,101, 99,116, 80, 97,114, 97,109,115, 0, 70,105,108,101, 76,105,115,116, 0,119,109, 79,112,101,114, 97,116,111,114, 0, 70, -105,108,101, 76, 97,121,111,117,116, 0, 83,112, 97, 99,101, 79,111,112,115, 0, 84,114,101,101, 83,116,111,114,101, 0, 84,114, -101,101, 83,116,111,114,101, 69,108,101,109, 0, 83,112, 97, 99,101, 73,109, 97,103,101, 0, 83,112, 97, 99,101, 78,108, 97, 0, - 83,112, 97, 99,101, 84,101,120,116, 0, 83, 99,114,105,112,116, 0, 83,112, 97, 99,101, 83, 99,114,105,112,116, 0, 83,112, 97, - 99,101, 84,105,109,101, 0, 83,112, 97, 99,101, 78,111,100,101, 0, 83,112, 97, 99,101, 73,109, 97, 83,101,108, 0,117,105, 70, -111,110,116, 0,117,105, 70,111,110,116, 83,116,121,108,101, 0,117,105, 83,116,121,108,101, 0,117,105, 87,105,100,103,101,116, - 67,111,108,111,114,115, 0, 84,104,101,109,101, 85, 73, 0, 84,104,101,109,101, 83,112, 97, 99,101, 0, 84,104,101,109,101, 87, -105,114,101, 67,111,108,111,114, 0, 98, 84,104,101,109,101, 0, 83,111,108,105,100, 76,105,103,104,116, 0, 85,115,101,114, 68, -101,102, 0, 83, 99,114, 86,101,114,116, 0, 83, 99,114, 69,100,103,101, 0, 80, 97,110,101,108, 0, 80, 97,110,101,108, 84,121, -112,101, 0,117,105, 76, 97,121,111,117,116, 0, 72,101, 97,100,101,114, 0, 72,101, 97,100,101,114, 84,121,112,101, 0, 77,101, -110,117, 0, 77,101,110,117, 84,121,112,101, 0, 83, 99,114, 65,114,101, 97, 0, 83,112, 97, 99,101, 84,121,112,101, 0, 65, 82, -101,103,105,111,110, 0, 65, 82,101,103,105,111,110, 84,121,112,101, 0, 70,105,108,101, 71,108,111, 98, 97,108, 0, 83,116,114, -105,112, 69,108,101,109, 0, 84, 83,116,114,105,112, 69,108,101,109, 0, 83,116,114,105,112, 67,114,111,112, 0, 83,116,114,105, -112, 84,114, 97,110,115,102,111,114,109, 0, 83,116,114,105,112, 67,111,108,111,114, 66, 97,108, 97,110, 99,101, 0, 83,116,114, -105,112, 80,114,111,120,121, 0, 83,116,114,105,112, 0, 80,108,117,103,105,110, 83,101,113, 0, 83,101,113,117,101,110, 99,101, - 0, 98, 83,111,117,110,100, 0,104,100, 97,117,100,105,111, 0, 77,101,116, 97, 83,116, 97, 99,107, 0, 69,100,105,116,105,110, -103, 0, 87,105,112,101, 86, 97,114,115, 0, 71,108,111,119, 86, 97,114,115, 0, 84,114, 97,110,115,102,111,114,109, 86, 97,114, -115, 0, 83,111,108,105,100, 67,111,108,111,114, 86, 97,114,115, 0, 83,112,101,101,100, 67,111,110,116,114,111,108, 86, 97,114, -115, 0, 69,102,102,101, 99,116, 0, 66,117,105,108,100, 69,102,102, 0, 80, 97,114,116, 69,102,102, 0, 80, 97,114,116,105, 99, -108,101, 0, 87, 97,118,101, 69,102,102, 0, 98, 80,114,111,112,101,114,116,121, 0, 98, 78,101, 97,114, 83,101,110,115,111,114, - 0, 98, 77,111,117,115,101, 83,101,110,115,111,114, 0, 98, 84,111,117, 99,104, 83,101,110,115,111,114, 0, 98, 75,101,121, 98, -111, 97,114,100, 83,101,110,115,111,114, 0, 98, 80,114,111,112,101,114,116,121, 83,101,110,115,111,114, 0, 98, 65, 99,116,117, - 97,116,111,114, 83,101,110,115,111,114, 0, 98, 68,101,108, 97,121, 83,101,110,115,111,114, 0, 98, 67,111,108,108,105,115,105, -111,110, 83,101,110,115,111,114, 0, 98, 82, 97,100, 97,114, 83,101,110,115,111,114, 0, 98, 82, 97,110,100,111,109, 83,101,110, -115,111,114, 0, 98, 82, 97,121, 83,101,110,115,111,114, 0, 98, 77,101,115,115, 97,103,101, 83,101,110,115,111,114, 0, 98, 83, -101,110,115,111,114, 0, 98, 67,111,110,116,114,111,108,108,101,114, 0, 98, 74,111,121,115,116,105, 99,107, 83,101,110,115,111, -114, 0, 98, 69,120,112,114,101,115,115,105,111,110, 67,111,110,116, 0, 98, 80,121,116,104,111,110, 67,111,110,116, 0, 98, 65, - 99,116,117, 97,116,111,114, 0, 98, 65,100,100, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 65, 99,116,105, -111,110, 65, 99,116,117, 97,116,111,114, 0, 98, 83,111,117,110,100, 65, 99,116,117, 97,116,111,114, 0, 98, 67, 68, 65, 99,116, -117, 97,116,111,114, 0, 98, 69,100,105,116, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 83, 99,101,110,101, - 65, 99,116,117, 97,116,111,114, 0, 98, 80,114,111,112,101,114,116,121, 65, 99,116,117, 97,116,111,114, 0, 98, 79, 98,106,101, - 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 73,112,111, 65, 99,116,117, 97,116,111,114, 0, 98, 67, 97,109,101,114, 97, 65, - 99,116,117, 97,116,111,114, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 65, 99,116,117, 97,116,111,114, 0, 98, 71,114,111, -117,112, 65, 99,116,117, 97,116,111,114, 0, 98, 82, 97,110,100,111,109, 65, 99,116,117, 97,116,111,114, 0, 98, 77,101,115,115, - 97,103,101, 65, 99,116,117, 97,116,111,114, 0, 98, 71, 97,109,101, 65, 99,116,117, 97,116,111,114, 0, 98, 86,105,115,105, 98, -105,108,105,116,121, 65, 99,116,117, 97,116,111,114, 0, 98, 84,119,111, 68, 70,105,108,116,101,114, 65, 99,116,117, 97,116,111, -114, 0, 98, 80, 97,114,101,110,116, 65, 99,116,117, 97,116,111,114, 0, 98, 83,116, 97,116,101, 65, 99,116,117, 97,116,111,114, - 0, 70,114,101,101, 67, 97,109,101,114, 97, 0, 98, 83, 97,109,112,108,101, 0, 98, 83,111,117,110,100, 76,105,115,116,101,110, -101,114, 0, 83,112, 97, 99,101, 83,111,117,110,100, 0, 71,114,111,117,112, 79, 98,106,101, 99,116, 0, 66,111,110,101, 0, 98, - 65,114,109, 97,116,117,114,101, 0, 98, 80,111,115,101, 67,104, 97,110,110,101,108, 0, 98, 65, 99,116,105,111,110, 71,114,111, -117,112, 0, 83,112, 97, 99,101, 65, 99,116,105,111,110, 0, 98, 65, 99,116,105,111,110, 67,104, 97,110,110,101,108, 0, 98, 67, -111,110,115,116,114, 97,105,110,116, 67,104, 97,110,110,101,108, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 67,111, -110,115,116,114, 97,105,110,116, 84, 97,114,103,101,116, 0, 98, 80,121,116,104,111,110, 67,111,110,115,116,114, 97,105,110,116, - 0, 98, 75,105,110,101,109, 97,116,105, 99, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 84,114, 97, 99,107, 84,111, 67,111, -110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, 97,116,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98, - 76,111, 99, 97,116,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 77,105,110, 77, 97,120, 67,111,110,115, -116,114, 97,105,110,116, 0, 98, 83,105,122,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105, -111,110, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 76,111, 99,107, 84,114, 97, 99,107, 67,111,110,115,116,114, 97,105,110, -116, 0, 98, 70,111,108,108,111,119, 80, 97,116,104, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,116,114,101,116, 99,104, - 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,105,103,105,100, 66,111,100,121, 74,111,105,110,116, 67,111,110,115, -116,114, 97,105,110,116, 0, 98, 67,108, 97,109,112, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 67,104,105,108,100, - 79,102, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 84,114, 97,110,115,102,111,114,109, 67,111,110,115,116,114, 97,105,110, -116, 0, 98, 76,111, 99, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, 76,105,109,105,116, 67, -111,110,115,116,114, 97,105,110,116, 0, 98, 83,105,122,101, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, - 68,105,115,116, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,104,114,105,110,107,119,114, 97,112, 67, -111,110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105,111,110, 77,111,100,105,102,105,101,114, 0, 98, 65, 99,116,105,111, -110, 83,116,114,105,112, 0, 98, 78,111,100,101, 83,116, 97, 99,107, 0, 98, 78,111,100,101, 83,111, 99,107,101,116, 0, 98, 78, -111,100,101, 76,105,110,107, 0, 98, 78,111,100,101, 0, 98, 78,111,100,101, 80,114,101,118,105,101,119, 0, 98, 78,111,100,101, - 84,121,112,101, 0, 78,111,100,101, 73,109, 97,103,101, 65,110,105,109, 0, 78,111,100,101, 66,108,117,114, 68, 97,116, 97, 0, - 78,111,100,101, 68, 66,108,117,114, 68, 97,116, 97, 0, 78,111,100,101, 66,105,108, 97,116,101,114, 97,108, 66,108,117,114, 68, - 97,116, 97, 0, 78,111,100,101, 72,117,101, 83, 97,116, 0, 78,111,100,101, 73,109, 97,103,101, 70,105,108,101, 0, 78,111,100, -101, 67,104,114,111,109, 97, 0, 78,111,100,101, 84,119,111, 88, 89,115, 0, 78,111,100,101, 84,119,111, 70,108,111, 97,116,115, - 0, 78,111,100,101, 71,101,111,109,101,116,114,121, 0, 78,111,100,101, 86,101,114,116,101,120, 67,111,108, 0, 78,111,100,101, - 68,101,102,111, 99,117,115, 0, 78,111,100,101, 83, 99,114,105,112,116, 68,105, 99,116, 0, 78,111,100,101, 71,108, 97,114,101, - 0, 78,111,100,101, 84,111,110,101,109, 97,112, 0, 78,111,100,101, 76,101,110,115, 68,105,115,116, 0, 84,101,120, 78,111,100, -101, 79,117,116,112,117,116, 0, 67,117,114,118,101, 77, 97,112, 80,111,105,110,116, 0, 67,117,114,118,101, 77, 97,112, 0, 66, -114,117,115,104, 67,108,111,110,101, 0, 67,117,115,116,111,109, 68, 97,116, 97, 76, 97,121,101,114, 0, 72, 97,105,114, 75,101, -121, 0, 80, 97,114,116,105, 99,108,101, 75,101,121, 0, 67,104,105,108,100, 80, 97,114,116,105, 99,108,101, 0, 80, 97,114,116, -105, 99,108,101, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,108,101, 83,101,116,116,105,110,103,115, 0, 80, 97,114,116,105, 99, -108,101, 69,100,105,116, 0, 80, 97,114,116,105, 99,108,101, 67, 97, 99,104,101, 75,101,121, 0, 76,105,110,107, 78,111,100,101, - 0, 98, 71, 80, 68,115,112,111,105,110,116, 0, 98, 71, 80, 68,115,116,114,111,107,101, 0, 98, 71, 80, 68,102,114, 97,109,101, - 0, 98, 71, 80, 68,108, 97,121,101,114, 0,119,109, 87,105,110,100,111,119, 77, 97,110, 97,103,101,114, 0,119,109, 87,105,110, -100,111,119, 0,119,109, 69,118,101,110,116, 0,119,109, 83,117, 98, 87,105,110,100,111,119, 0,119,109, 71,101,115,116,117,114, -101, 0,119,109, 75,101,121,109, 97,112, 73,116,101,109, 0, 80,111,105,110,116,101,114, 82, 78, 65, 0,119,109, 75,101,121, 77, - 97,112, 0,119,109, 79,112,101,114, 97,116,111,114, 84,121,112,101, 0, 82,101,112,111,114,116, 76,105,115,116, 0, 70, 77,111, -100,105,102,105,101,114, 0, 70, 77,111,100, 95, 71,101,110,101,114, 97,116,111,114, 0, 70, 67, 77, 95, 69,110,118,101,108,111, -112,101, 68, 97,116, 97, 0, 70, 77,111,100, 95, 69,110,118,101,108,111,112,101, 0, 70, 77,111,100, 95, 67,121, 99,108,101,115, - 0, 70, 77,111,100, 95, 80,121,116,104,111,110, 0, 70, 77,111,100, 95, 76,105,109,105,116,115, 0, 70, 77,111,100, 95, 78,111, -105,115,101, 0, 68,114,105,118,101,114, 84, 97,114,103,101,116, 0, 67,104, 97,110,110,101,108, 68,114,105,118,101,114, 0, 70, - 80,111,105,110,116, 0, 70, 67,117,114,118,101, 0, 65,110,105,109, 77, 97,112, 80, 97,105,114, 0, 65,110,105,109, 77, 97,112, -112,101,114, 0, 78,108, 97, 83,116,114,105,112, 0, 78,108, 97, 84,114, 97, 99,107, 0, 75, 83, 95, 80, 97,116,104, 0, 75,101, -121,105,110,103, 83,101,116, 0, 65,110,105,109, 79,118,101,114,114,105,100,101, 0, 73,100, 65,100,116, 84,101,109,112,108, 97, -116,101, 0, 0, 84, 76, 69, 78, 0, 1, 0, 1, 0, 2, 0, 2, 0, 4, 0, 4, 0, 4, 0, 4, 0, 8, 0, 0, 0, 8, 0, 12, - 0, 8, 0, 4, 0, 8, 0, 8, 0, 16, 0, 12, 0, 12, 0, 24, 0, 16, 0, 16, 0, 32, 0, 16, 0, 16, 0, 20, 0, 76, 0, 52, - 2, 40, 0, 0, 0, 32, 0,140, 3, 80, 0, 92, 0, 36, 0, 56, 0, 84, 0,112, 0,124, 0, 40, 0, 16, 0, 24, 0, 40, 0,120, - 0, 12, 0,136, 0, 36, 4,248, 1,124, 0, 0, 0, 0, 0, 0, 0,136, 1, 24, 1, 84, 0, 24, 3, 8, 0,168, 0, 0, 0,140, - 0,132, 1,132, 1, 8, 0, 56, 2,112, 0, 76, 1, 60, 0, 0, 0,108, 0,104, 0,140, 0, 56, 0, 8, 0, 16, 1, 76, 0, 0, - 0, 0, 0, 0, 1, 24, 0, 20, 0, 44, 0, 60, 0, 24, 0, 12, 0, 12, 0, 4, 0, 8, 0, 8, 0, 0, 0, 24, 0, 76, 0, 32, - 0, 8, 0, 12, 0, 8, 0, 8, 0, 4, 0, 4, 1, 0, 0, 32, 0, 12, 0, 0, 0, 16, 0, 64, 0, 24, 0, 12, 0, 40, 0, 56, - 0, 72, 0, 92, 0,100, 0, 72, 0,100, 0,120, 0, 68, 0, 64, 0,112, 0, 64, 0,152, 0,156, 0, 64, 0, 96, 0,108, 0,188, - 0,104, 0,184, 0, 56, 0, 76, 0, 0, 0,132, 0, 28, 0, 20, 0,104, 0, 0, 0, 64, 0, 0, 0, 0, 0, 68, 0, 8, 0, 8, - 0,220, 0, 80, 1, 68, 0, 68, 0, 68, 0, 68, 0, 64, 1,164, 0,112, 0,108, 0,188, 0, 40, 0, 92, 0, 56, 0,112, 0,128, - 0,152, 0,208, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 1,104, 0, 40, 0, 28, 0,176, 0,144, 0, 52, 0, 16, 0, 72, 3,224, - 0, 56, 0, 16, 0, 80, 0, 16, 0,196, 0, 8, 0, 76, 0, 80, 0, 32, 0, 0, 0, 32, 1, 12, 0, 32, 0, 0, 0, 0, 0, 64, - 2,152, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 0, 40, 0,136, 0, 48, 0,136, 0,196, 0, 20, 0,224, 0,204, - 0, 44, 0, 0, 0, 0, 0, 92, 0, 0, 0,248, 0, 12, 0, 12, 0,136, 0,184, 2,124, 2, 80, 0, 40, 0,168, 0,232, 2,136, - 1, 16, 0, 24, 0,192, 0, 32, 1,176, 1, 16, 0, 16, 19, 8, 0, 56, 11, 40, 0, 20, 0, 24, 0,240, 0, 0, 0, 0, 0, 8, - 0, 0, 0, 8, 0, 0, 0,112, 0, 0, 0,236, 0, 0, 0, 32, 0, 80, 0, 28, 0, 16, 0, 8, 0, 52, 0,160, 0,240, 1,168, - 0,204, 1, 28, 0, 0, 0, 16, 2, 24, 0, 12, 0, 24, 0, 48, 0, 16, 0, 20, 0, 16, 0, 24, 1, 56, 0, 0, 0, 56, 0, 64, - 0, 48, 0, 8, 0, 44, 0, 72, 0,104, 0, 40, 0, 8, 0, 72, 0, 44, 0, 40, 0,108, 0, 68, 0, 76, 0, 80, 0, 60, 0,128, - 0, 4, 0, 60, 0, 12, 0, 92, 0, 28, 0, 20, 0, 80, 0, 16, 0, 76, 0,104, 0, 84, 0, 28, 0, 96, 0, 60, 0, 56, 0,108, - 0,140, 0, 4, 0, 20, 0, 12, 0, 8, 0, 40, 0, 0, 0, 68, 0,184, 0, 24, 1, 4, 0,120, 1,172, 0,104, 0,216, 0, 64, - 0, 44, 0, 64, 0,116, 0, 60, 0,104, 0, 52, 0, 44, 0, 44, 0, 68, 0, 44, 0, 64, 0, 44, 0, 20, 0, 52, 0, 96, 0, 12, - 0,108, 0, 92, 0, 28, 0, 28, 0, 28, 0, 52, 0, 20, 0, 60, 0,140, 0, 36, 0,120, 0, 32, 0,208, 0, 0, 0, 0, 0, 16, - 0, 40, 0, 28, 0, 12, 0, 12, 1, 16, 0, 40, 0, 8, 0, 8, 0, 64, 0, 32, 0, 24, 0, 8, 0, 24, 0, 32, 0, 8, 0, 32, - 0, 12, 0, 44, 0, 20, 0, 68, 0, 24, 0, 56, 0, 72, 0,252, 1,224, 0, 0, 0, 0, 0, 0, 0, 16, 0, 20, 0, 24, 0,172, - 0,124, 0,144, 0, 0, 0, 0, 0, 0, 0, 92, 0, 0, 0, 88, 0, 0, 0, 0, 0, 88, 1, 20, 0, 16, 0, 20, 0, 8, 0, 8, - 0, 24, 0, 20, 0, 88, 1, 24, 0, 16, 0, 68, 1, 0, 0, 20, 0,160, 0, 88, 0, 96, 0, 88, 0, 20, 0, 56, 83, 84, 82, 67, - 0, 0, 1, 94, 0, 10, 0, 2, 0, 10, 0, 0, 0, 10, 0, 1, 0, 11, 0, 3, 0, 11, 0, 0, 0, 11, 0, 1, 0, 9, 0, 2, - 0, 12, 0, 2, 0, 9, 0, 3, 0, 9, 0, 4, 0, 13, 0, 2, 0, 2, 0, 5, 0, 2, 0, 6, 0, 14, 0, 2, 0, 4, 0, 5, - 0, 4, 0, 6, 0, 15, 0, 2, 0, 7, 0, 5, 0, 7, 0, 6, 0, 16, 0, 2, 0, 8, 0, 5, 0, 8, 0, 6, 0, 17, 0, 3, - 0, 4, 0, 5, 0, 4, 0, 6, 0, 4, 0, 7, 0, 18, 0, 3, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0, 19, 0, 3, - 0, 8, 0, 5, 0, 8, 0, 6, 0, 8, 0, 7, 0, 20, 0, 4, 0, 4, 0, 5, 0, 4, 0, 6, 0, 4, 0, 7, 0, 4, 0, 8, - 0, 21, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0, 7, 0, 8, 0, 22, 0, 4, 0, 8, 0, 5, 0, 8, 0, 6, - 0, 8, 0, 7, 0, 8, 0, 8, 0, 23, 0, 4, 0, 4, 0, 9, 0, 4, 0, 10, 0, 4, 0, 11, 0, 4, 0, 12, 0, 24, 0, 4, - 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 12, 0, 25, 0, 4, 0, 9, 0, 13, 0, 12, 0, 14, 0, 4, 0, 15, - 0, 4, 0, 16, 0, 26, 0, 10, 0, 26, 0, 0, 0, 26, 0, 1, 0, 0, 0, 17, 0, 0, 0, 18, 0, 2, 0, 19, 0, 0, 0, 20, - 0, 4, 0, 21, 0, 25, 0, 22, 0, 4, 0, 23, 0, 4, 0, 24, 0, 27, 0, 9, 0, 9, 0, 0, 0, 9, 0, 1, 0, 27, 0, 25, - 0, 28, 0, 26, 0, 0, 0, 27, 0, 2, 0, 28, 0, 2, 0, 19, 0, 4, 0, 29, 0, 26, 0, 30, 0, 28, 0, 8, 0, 27, 0, 31, - 0, 27, 0, 32, 0, 29, 0, 33, 0, 0, 0, 34, 0, 0, 0, 35, 0, 4, 0, 36, 0, 4, 0, 37, 0, 28, 0, 38, 0, 30, 0, 6, - 0, 4, 0, 39, 0, 4, 0, 40, 0, 2, 0, 41, 0, 2, 0, 42, 0, 2, 0, 43, 0, 4, 0, 44, 0, 31, 0, 6, 0, 32, 0, 45, - 0, 2, 0, 46, 0, 2, 0, 47, 0, 2, 0, 17, 0, 2, 0, 19, 0, 0, 0, 48, 0, 33, 0, 21, 0, 33, 0, 0, 0, 33, 0, 1, - 0, 34, 0, 49, 0, 35, 0, 50, 0, 24, 0, 51, 0, 24, 0, 52, 0, 2, 0, 46, 0, 2, 0, 47, 0, 2, 0, 53, 0, 2, 0, 54, - 0, 2, 0, 55, 0, 2, 0, 56, 0, 2, 0, 19, 0, 2, 0, 57, 0, 7, 0, 11, 0, 7, 0, 12, 0, 4, 0, 58, 0, 7, 0, 59, - 0, 7, 0, 60, 0, 7, 0, 61, 0, 31, 0, 62, 0, 36, 0, 7, 0, 27, 0, 31, 0, 12, 0, 63, 0, 24, 0, 64, 0, 2, 0, 46, - 0, 2, 0, 65, 0, 2, 0, 66, 0, 2, 0, 37, 0, 37, 0, 16, 0, 37, 0, 0, 0, 37, 0, 1, 0, 7, 0, 67, 0, 7, 0, 61, - 0, 2, 0, 17, 0, 2, 0, 47, 0, 2, 0, 68, 0, 2, 0, 19, 0, 4, 0, 69, 0, 4, 0, 70, 0, 9, 0, 2, 0, 7, 0, 71, - 0, 0, 0, 20, 0, 0, 0, 72, 0, 7, 0, 73, 0, 7, 0, 74, 0, 38, 0, 13, 0, 27, 0, 31, 0, 39, 0, 75, 0, 37, 0, 76, - 0, 0, 0, 77, 0, 4, 0, 78, 0, 7, 0, 61, 0, 12, 0, 79, 0, 36, 0, 80, 0, 27, 0, 81, 0, 2, 0, 17, 0, 2, 0, 82, - 0, 2, 0, 83, 0, 2, 0, 19, 0, 40, 0, 5, 0, 27, 0, 84, 0, 2, 0, 85, 0, 2, 0, 86, 0, 2, 0, 87, 0, 4, 0, 37, - 0, 41, 0, 6, 0, 41, 0, 0, 0, 41, 0, 1, 0, 0, 0, 88, 0, 0, 0, 89, 0, 4, 0, 23, 0, 4, 0, 90, 0, 42, 0, 10, - 0, 42, 0, 0, 0, 42, 0, 1, 0, 4, 0, 91, 0, 4, 0, 92, 0, 4, 0, 93, 0, 4, 0, 43, 0, 4, 0, 14, 0, 4, 0, 94, - 0, 0, 0, 95, 0, 0, 0, 96, 0, 43, 0, 15, 0, 27, 0, 31, 0, 0, 0, 97, 0, 4, 0, 94, 0, 4, 0, 98, 0, 12, 0, 99, - 0, 41, 0,100, 0, 41, 0,101, 0, 4, 0,102, 0, 4, 0,103, 0, 12, 0,104, 0, 0, 0,105, 0, 4, 0,106, 0, 4, 0,107, - 0, 9, 0,108, 0, 8, 0,109, 0, 44, 0, 3, 0, 4, 0,110, 0, 4, 0,111, 0, 9, 0, 2, 0, 45, 0, 21, 0, 27, 0, 31, - 0, 39, 0, 75, 0, 2, 0, 17, 0, 2, 0, 19, 0, 7, 0,112, 0, 7, 0,113, 0, 7, 0,114, 0, 7, 0,115, 0, 7, 0,116, - 0, 7, 0,117, 0, 7, 0,118, 0, 7, 0,119, 0, 7, 0,120, 0, 7, 0,121, 0, 7, 0,122, 0, 2, 0,123, 0, 2, 0,124, - 0, 7, 0,125, 0, 36, 0, 80, 0, 40, 0,126, 0, 32, 0,127, 0, 46, 0, 13, 0, 4, 0,128, 0, 4, 0,129, 0, 4, 0,130, - 0, 4, 0,131, 0, 2, 0,132, 0, 2, 0,133, 0, 2, 0, 19, 0, 2, 0,134, 0, 2, 0,135, 0, 2, 0,136, 0, 2, 0,137, - 0, 2, 0,138, 0, 47, 0,139, 0, 48, 0, 31, 0, 27, 0, 31, 0, 0, 0, 34, 0, 12, 0,140, 0, 49, 0,141, 0, 50, 0,142, - 0, 51, 0,143, 0, 2, 0,134, 0, 2, 0, 19, 0, 2, 0,144, 0, 2, 0, 17, 0, 2, 0, 37, 0, 2, 0, 43, 0, 4, 0,145, - 0, 2, 0,146, 0, 2, 0,147, 0, 2, 0,148, 0, 2, 0,149, 0, 2, 0,150, 0, 2, 0,151, 0, 4, 0,152, 0, 4, 0,153, - 0, 44, 0,154, 0, 30, 0,155, 0, 7, 0,156, 0, 4, 0,157, 0, 2, 0,158, 0, 2, 0,159, 0, 2, 0,160, 0, 2, 0,161, - 0, 7, 0,162, 0, 7, 0,163, 0, 52, 0, 31, 0, 2, 0,164, 0, 2, 0,165, 0, 2, 0,166, 0, 2, 0,167, 0, 32, 0,168, - 0, 53, 0,169, 0, 0, 0,170, 0, 0, 0,171, 0, 0, 0,172, 0, 0, 0,173, 0, 0, 0,174, 0, 7, 0,175, 0, 7, 0,176, - 0, 2, 0,177, 0, 2, 0,178, 0, 2, 0,179, 0, 2, 0,180, 0, 2, 0,181, 0, 2, 0,182, 0, 2, 0,183, 0, 7, 0,184, - 0, 7, 0,185, 0, 7, 0,186, 0, 7, 0,187, 0, 7, 0,188, 0, 7, 0, 57, 0, 7, 0,189, 0, 7, 0,190, 0, 7, 0,191, - 0, 7, 0,192, 0, 7, 0,193, 0, 54, 0, 15, 0, 0, 0,194, 0, 9, 0,195, 0, 0, 0,196, 0, 0, 0,197, 0, 4, 0,198, - 0, 4, 0,199, 0, 9, 0,200, 0, 7, 0,201, 0, 7, 0,202, 0, 7, 0,203, 0, 4, 0,204, 0, 9, 0,205, 0, 9, 0,206, - 0, 4, 0,207, 0, 4, 0, 37, 0, 55, 0, 6, 0, 7, 0,184, 0, 7, 0,185, 0, 7, 0,186, 0, 7, 0,208, 0, 7, 0, 67, - 0, 4, 0, 64, 0, 56, 0, 5, 0, 2, 0, 19, 0, 2, 0, 36, 0, 2, 0, 64, 0, 2, 0,209, 0, 55, 0,203, 0, 57, 0, 17, - 0, 32, 0,168, 0, 48, 0,210, 0, 58, 0,211, 0, 7, 0,212, 0, 7, 0,213, 0, 2, 0, 17, 0, 2, 0,214, 0, 7, 0,114, - 0, 7, 0,115, 0, 7, 0,215, 0, 4, 0,216, 0, 2, 0,217, 0, 2, 0,218, 0, 4, 0,134, 0, 4, 0,145, 0, 2, 0,219, - 0, 2, 0,220, 0, 53, 0, 57, 0, 27, 0, 31, 0, 39, 0, 75, 0, 7, 0,221, 0, 7, 0,222, 0, 7, 0,223, 0, 7, 0,224, - 0, 7, 0,225, 0, 7, 0,226, 0, 7, 0,227, 0, 7, 0,228, 0, 7, 0,229, 0, 7, 0,230, 0, 7, 0,231, 0, 7, 0,232, - 0, 7, 0,233, 0, 7, 0,234, 0, 7, 0,235, 0, 7, 0,236, 0, 7, 0,237, 0, 7, 0,238, 0, 7, 0,239, 0, 7, 0,240, - 0, 2, 0,241, 0, 2, 0,242, 0, 2, 0,243, 0, 2, 0,244, 0, 2, 0,245, 0, 2, 0,246, 0, 2, 0,247, 0, 2, 0, 19, - 0, 2, 0, 17, 0, 2, 0,214, 0, 7, 0,248, 0, 7, 0,249, 0, 7, 0,250, 0, 7, 0,251, 0, 2, 0,252, 0, 2, 0,253, - 0, 2, 0,254, 0, 2, 0,132, 0, 4, 0, 23, 0, 4, 0,129, 0, 4, 0,130, 0, 4, 0,131, 0, 7, 0,255, 0, 7, 1, 0, - 0, 7, 0,190, 0, 46, 1, 1, 0, 59, 1, 2, 0, 36, 0, 80, 0, 48, 0,210, 0, 54, 1, 3, 0, 56, 1, 4, 0, 57, 1, 5, - 0, 30, 0,155, 0, 0, 1, 6, 0, 0, 1, 7, 0, 60, 0, 8, 0, 7, 1, 8, 0, 7, 1, 9, 0, 7, 0,176, 0, 4, 0, 19, - 0, 7, 1, 10, 0, 7, 1, 11, 0, 7, 1, 12, 0, 32, 0, 45, 0, 61, 0, 81, 0, 27, 0, 31, 0, 39, 0, 75, 0, 2, 0, 17, - 0, 2, 0, 19, 0, 4, 1, 13, 0, 2, 0,178, 0, 2, 1, 14, 0, 7, 0,184, 0, 7, 0,185, 0, 7, 0,186, 0, 7, 0,187, - 0, 7, 1, 15, 0, 7, 1, 16, 0, 7, 1, 17, 0, 7, 1, 18, 0, 7, 1, 19, 0, 7, 1, 20, 0, 7, 1, 21, 0, 7, 1, 22, - 0, 7, 1, 23, 0, 7, 1, 24, 0, 7, 1, 25, 0, 62, 1, 26, 0, 2, 1, 27, 0, 2, 0, 70, 0, 7, 0,114, 0, 7, 0,115, - 0, 7, 1, 28, 0, 7, 1, 29, 0, 7, 1, 30, 0, 2, 1, 31, 0, 2, 1, 32, 0, 2, 1, 33, 0, 2, 1, 34, 0, 0, 1, 35, - 0, 0, 1, 36, 0, 2, 1, 37, 0, 2, 1, 38, 0, 2, 1, 39, 0, 2, 1, 40, 0, 2, 1, 41, 0, 7, 1, 42, 0, 7, 1, 43, - 0, 7, 1, 44, 0, 7, 1, 45, 0, 2, 1, 46, 0, 2, 0, 43, 0, 2, 1, 47, 0, 2, 1, 48, 0, 2, 1, 49, 0, 2, 1, 50, - 0, 7, 1, 51, 0, 7, 1, 52, 0, 7, 1, 53, 0, 7, 1, 54, 0, 7, 1, 55, 0, 7, 1, 56, 0, 7, 1, 57, 0, 7, 1, 58, - 0, 7, 1, 59, 0, 7, 1, 60, 0, 7, 1, 61, 0, 7, 1, 62, 0, 2, 1, 63, 0, 2, 1, 64, 0, 4, 1, 65, 0, 4, 1, 66, - 0, 2, 1, 67, 0, 2, 1, 68, 0, 2, 1, 69, 0, 2, 1, 70, 0, 7, 1, 71, 0, 7, 1, 72, 0, 7, 1, 73, 0, 7, 1, 74, - 0, 2, 1, 75, 0, 2, 1, 76, 0, 52, 1, 77, 0, 36, 0, 80, 0, 30, 0,155, 0, 40, 0,126, 0, 63, 0, 2, 0, 27, 0, 31, - 0, 36, 0, 80, 0, 64, 0,130, 0, 27, 0, 31, 0, 39, 0, 75, 0, 2, 1, 78, 0, 2, 0, 19, 0, 7, 0,184, 0, 7, 0,185, - 0, 7, 0,186, 0, 7, 1, 79, 0, 7, 1, 80, 0, 7, 1, 81, 0, 7, 1, 82, 0, 7, 1, 83, 0, 7, 1, 84, 0, 7, 1, 85, - 0, 7, 1, 86, 0, 7, 1, 87, 0, 7, 1, 88, 0, 7, 1, 89, 0, 7, 1, 90, 0, 7, 1, 91, 0, 7, 1, 92, 0, 7, 1, 93, - 0, 7, 1, 94, 0, 7, 1, 95, 0, 7, 1, 96, 0, 7, 1, 97, 0, 7, 1, 98, 0, 7, 1, 99, 0, 7, 1,100, 0, 7, 1,101, - 0, 7, 1,102, 0, 7, 1,103, 0, 7, 1,104, 0, 7, 1,105, 0, 2, 1,106, 0, 2, 1,107, 0, 2, 1,108, 0, 0, 1,109, - 0, 0, 1,110, 0, 7, 1,111, 0, 7, 1,112, 0, 2, 1,113, 0, 2, 1,114, 0, 7, 1,115, 0, 7, 1,116, 0, 7, 1,117, - 0, 7, 1,118, 0, 2, 1,119, 0, 2, 1,120, 0, 4, 1, 13, 0, 4, 1,121, 0, 2, 1,122, 0, 2, 1,123, 0, 2, 1,124, - 0, 2, 1,125, 0, 7, 1,126, 0, 7, 1,127, 0, 7, 1,128, 0, 7, 1,129, 0, 7, 1,130, 0, 7, 1,131, 0, 7, 1,132, - 0, 7, 1,133, 0, 7, 1,134, 0, 7, 1,135, 0, 0, 1,136, 0, 7, 1,137, 0, 7, 1,138, 0, 7, 1,139, 0, 4, 1,140, - 0, 0, 1,141, 0, 0, 1, 47, 0, 0, 1,142, 0, 0, 1, 6, 0, 2, 1,143, 0, 2, 1,144, 0, 2, 1, 64, 0, 2, 1,145, - 0, 2, 1,146, 0, 2, 1,147, 0, 7, 1,148, 0, 7, 1,149, 0, 7, 1,150, 0, 7, 1,151, 0, 7, 1,152, 0, 2, 0,164, - 0, 2, 0,165, 0, 56, 1,153, 0, 56, 1,154, 0, 0, 1,155, 0, 0, 1,156, 0, 0, 1,157, 0, 0, 1,158, 0, 2, 1,159, - 0, 2, 1,160, 0, 7, 1,161, 0, 7, 1,162, 0, 52, 1, 77, 0, 59, 1, 2, 0, 36, 0, 80, 0, 65, 1,163, 0, 30, 0,155, - 0, 7, 1,164, 0, 7, 1,165, 0, 7, 1,166, 0, 7, 1,167, 0, 7, 1,168, 0, 2, 1,169, 0, 2, 0, 70, 0, 7, 1,170, - 0, 7, 1,171, 0, 7, 1,172, 0, 7, 1,173, 0, 7, 1,174, 0, 7, 1,175, 0, 7, 1,176, 0, 7, 1,177, 0, 7, 1,178, - 0, 2, 1,179, 0, 2, 1,180, 0, 7, 1,181, 0, 7, 1,182, 0, 7, 1,183, 0, 7, 1,184, 0, 7, 1,185, 0, 4, 1,186, - 0, 4, 1,187, 0, 4, 1,188, 0, 40, 0,126, 0, 12, 1,189, 0, 66, 0, 4, 0, 27, 0, 31, 0, 0, 1,190, 0, 67, 0, 2, - 0, 44, 0,154, 0, 68, 0, 26, 0, 68, 0, 0, 0, 68, 0, 1, 0, 69, 1,191, 0, 4, 1,192, 0, 4, 1,193, 0, 4, 1,194, - 0, 4, 1,195, 0, 4, 1,196, 0, 4, 1,197, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 1,198, 0, 2, 1,199, 0, 7, 0, 5, - 0, 7, 0, 6, 0, 7, 0, 7, 0, 7, 1,200, 0, 7, 1,201, 0, 7, 1,202, 0, 7, 1,203, 0, 7, 1,204, 0, 7, 1,205, - 0, 7, 1,206, 0, 7, 0, 23, 0, 7, 1,207, 0, 7, 1,208, 0, 70, 0, 16, 0, 27, 0, 31, 0, 69, 1,191, 0, 12, 1,209, - 0, 12, 1,210, 0, 12, 1,211, 0, 36, 0, 80, 0, 64, 1,212, 0, 2, 0, 19, 0, 2, 1,213, 0, 4, 0,177, 0, 7, 1, 8, - 0, 7, 0,176, 0, 7, 1, 9, 0, 7, 1,214, 0, 7, 1,215, 0, 7, 1,216, 0, 35, 0, 11, 0, 7, 1,217, 0, 7, 1,218, - 0, 7, 1,219, 0, 7, 1,220, 0, 2, 0, 55, 0, 0, 1,221, 0, 0, 1,222, 0, 0, 1,223, 0, 0, 1,224, 0, 0, 1,225, - 0, 0, 1,226, 0, 34, 0, 7, 0, 7, 1,227, 0, 7, 1,218, 0, 7, 1,219, 0, 2, 1,223, 0, 2, 1,226, 0, 7, 1,220, - 0, 7, 0, 37, 0, 71, 0, 21, 0, 71, 0, 0, 0, 71, 0, 1, 0, 2, 0, 17, 0, 2, 1,228, 0, 2, 1,226, 0, 2, 0, 19, - 0, 2, 1,229, 0, 2, 1,230, 0, 2, 1,231, 0, 2, 1,232, 0, 2, 1,233, 0, 2, 1,234, 0, 2, 1,235, 0, 2, 1,236, - 0, 7, 1,237, 0, 7, 1,238, 0, 34, 0, 49, 0, 35, 0, 50, 0, 2, 1,239, 0, 2, 1,240, 0, 4, 1,241, 0, 72, 0, 5, - 0, 2, 1,242, 0, 2, 1,228, 0, 0, 0, 19, 0, 0, 0, 37, 0, 2, 0, 70, 0, 73, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, - 0, 7, 0, 8, 0, 7, 1,243, 0, 74, 0, 62, 0, 27, 0, 31, 0, 39, 0, 75, 0, 69, 1,191, 0, 12, 1,244, 0, 12, 1,210, - 0, 12, 1,245, 0, 32, 1,246, 0, 32, 1,247, 0, 32, 1,248, 0, 36, 0, 80, 0, 75, 1,249, 0, 38, 1,250, 0, 64, 1,212, - 0, 12, 1,251, 0, 7, 1, 8, 0, 7, 0,176, 0, 7, 1, 9, 0, 4, 0,177, 0, 2, 1,252, 0, 2, 1,213, 0, 2, 0, 19, - 0, 2, 1,253, 0, 7, 1,254, 0, 7, 1,255, 0, 7, 2, 0, 0, 2, 1,231, 0, 2, 1,232, 0, 2, 2, 1, 0, 2, 2, 2, - 0, 4, 2, 3, 0, 34, 2, 4, 0, 2, 0, 23, 0, 2, 0, 99, 0, 2, 0, 67, 0, 2, 2, 5, 0, 7, 2, 6, 0, 7, 2, 7, - 0, 7, 2, 8, 0, 7, 2, 9, 0, 7, 2, 10, 0, 7, 2, 11, 0, 7, 2, 12, 0, 7, 2, 13, 0, 7, 2, 14, 0, 7, 2, 15, - 0, 0, 2, 16, 0, 76, 2, 17, 0, 77, 2, 18, 0, 0, 2, 19, 0, 66, 2, 20, 0, 66, 2, 21, 0, 66, 2, 22, 0, 66, 2, 23, - 0, 4, 2, 24, 0, 4, 2, 25, 0, 4, 2, 26, 0, 4, 0, 37, 0, 73, 2, 27, 0, 4, 2, 28, 0, 4, 2, 29, 0, 72, 2, 30, - 0, 72, 2, 31, 0, 78, 0, 39, 0, 27, 0, 31, 0, 69, 1,191, 0, 12, 2, 32, 0, 36, 0, 80, 0, 38, 1,250, 0, 64, 1,212, - 0, 79, 2, 33, 0, 80, 2, 34, 0, 81, 2, 35, 0, 82, 2, 36, 0, 83, 2, 37, 0, 84, 2, 38, 0, 85, 2, 39, 0, 86, 2, 40, - 0, 78, 2, 41, 0, 87, 2, 42, 0, 88, 2, 43, 0, 89, 2, 44, 0, 89, 2, 45, 0, 89, 2, 46, 0, 4, 0, 54, 0, 4, 2, 47, - 0, 4, 2, 48, 0, 4, 2, 49, 0, 4, 2, 50, 0, 4, 0,177, 0, 7, 1, 8, 0, 7, 0,176, 0, 7, 1, 9, 0, 7, 2, 51, - 0, 4, 2, 52, 0, 2, 2, 53, 0, 2, 0, 19, 0, 2, 2, 54, 0, 2, 2, 55, 0, 2, 1,213, 0, 2, 2, 56, 0, 90, 2, 57, - 0, 91, 2, 58, 0, 81, 0, 8, 0, 9, 2, 59, 0, 7, 2, 60, 0, 4, 2, 61, 0, 0, 0, 19, 0, 0, 2, 62, 0, 2, 1, 13, - 0, 2, 2, 63, 0, 2, 2, 64, 0, 79, 0, 8, 0, 4, 2, 65, 0, 4, 2, 66, 0, 4, 2, 67, 0, 4, 2, 68, 0, 0, 0, 37, - 0, 0, 1,228, 0, 0, 2, 69, 0, 0, 0, 19, 0, 83, 0, 5, 0, 4, 2, 65, 0, 4, 2, 66, 0, 0, 2, 70, 0, 0, 2, 71, - 0, 2, 0, 19, 0, 92, 0, 2, 0, 4, 2, 72, 0, 7, 1,219, 0, 84, 0, 3, 0, 92, 2, 73, 0, 4, 2, 74, 0, 4, 0, 19, - 0, 82, 0, 6, 0, 7, 2, 75, 0, 2, 2, 76, 0, 0, 0, 19, 0, 0, 1,228, 0, 0, 2, 71, 0, 0, 2, 77, 0, 85, 0, 4, - 0, 0, 0,208, 0, 0, 0,184, 0, 0, 0,185, 0, 0, 0,186, 0, 93, 0, 6, 0, 48, 2, 59, 0, 0, 0, 19, 0, 0, 2, 62, - 0, 2, 1, 13, 0, 2, 2, 63, 0, 2, 2, 64, 0, 94, 0, 1, 0, 7, 2, 78, 0, 95, 0, 5, 0, 0, 0,208, 0, 0, 0,184, - 0, 0, 0,185, 0, 0, 0,186, 0, 4, 0, 37, 0, 86, 0, 1, 0, 7, 2, 79, 0, 87, 0, 2, 0, 4, 2, 80, 0, 4, 0, 17, - 0, 80, 0, 7, 0, 7, 2, 60, 0, 48, 2, 59, 0, 0, 0, 19, 0, 0, 2, 62, 0, 2, 1, 13, 0, 2, 2, 63, 0, 2, 2, 64, - 0, 96, 0, 1, 0, 7, 2, 81, 0, 97, 0, 1, 0, 4, 2, 82, 0, 98, 0, 1, 0, 0, 2, 83, 0, 99, 0, 1, 0, 7, 2, 60, - 0,100, 0, 3, 0, 4, 2, 84, 0, 0, 0, 96, 0, 7, 2, 85, 0,102, 0, 4, 0, 7, 0,208, 0, 7, 0,184, 0, 7, 0,185, - 0, 7, 0,186, 0,103, 0, 1, 0,102, 2, 61, 0,104, 0, 5, 0, 4, 2, 86, 0, 4, 2, 87, 0, 0, 0, 19, 0, 0, 1,228, - 0, 0, 0,183, 0,105, 0, 2, 0, 4, 2, 88, 0, 4, 2, 87, 0,106, 0, 10, 0,106, 0, 0, 0,106, 0, 1, 0,104, 2, 89, - 0,103, 2, 90, 0,105, 2, 91, 0, 4, 0, 54, 0, 4, 2, 48, 0, 4, 2, 47, 0, 4, 0, 37, 0, 82, 2, 92, 0, 90, 0, 14, - 0, 12, 2, 93, 0, 82, 2, 92, 0, 0, 2, 94, 0, 0, 2, 95, 0, 0, 2, 96, 0, 0, 2, 97, 0, 0, 2, 98, 0, 0, 2, 99, - 0, 0, 2,100, 0, 0, 0, 19, 0, 89, 2, 44, 0, 89, 2, 46, 0, 2, 2,101, 0, 0, 2,102, 0, 91, 0, 8, 0, 4, 2,103, - 0, 4, 2,104, 0, 79, 2,105, 0, 83, 2,106, 0, 4, 2, 48, 0, 4, 2, 47, 0, 4, 0, 54, 0, 4, 0, 37, 0,107, 0, 7, - 0,107, 0, 0, 0,107, 0, 1, 0, 4, 0, 17, 0, 4, 1, 13, 0, 0, 0, 20, 0, 47, 0,139, 0, 0, 2,107, 0,108, 0, 7, - 0,107, 2,108, 0, 2, 2,109, 0, 2, 2, 93, 0, 2, 2,110, 0, 2, 0, 94, 0, 9, 2,111, 0, 9, 2,112, 0,109, 0, 3, - 0,107, 2,108, 0, 32, 0,168, 0, 0, 0, 20, 0,110, 0, 5, 0,107, 2,108, 0, 32, 0,168, 0, 0, 0, 20, 0, 2, 2,113, - 0, 0, 2,114, 0,111, 0, 5, 0,107, 2,108, 0, 7, 0, 92, 0, 7, 2,115, 0, 4, 2,116, 0, 4, 2,117, 0,112, 0, 5, - 0,107, 2,108, 0, 32, 2,118, 0, 0, 0, 72, 0, 4, 1, 13, 0, 4, 0, 19, 0,113, 0, 13, 0,107, 2,108, 0, 32, 2,119, - 0, 32, 2,120, 0, 32, 2,121, 0, 32, 2,122, 0, 7, 2,123, 0, 7, 2,124, 0, 7, 2,115, 0, 7, 2,125, 0, 4, 2,126, - 0, 4, 2,127, 0, 4, 0, 94, 0, 4, 2,128, 0,114, 0, 5, 0,107, 2,108, 0, 2, 2,129, 0, 2, 0, 19, 0, 7, 2,130, - 0, 32, 2,131, 0,115, 0, 3, 0,107, 2,108, 0, 7, 2,132, 0, 4, 0, 94, 0,116, 0, 10, 0,107, 2,108, 0, 7, 2,133, - 0, 4, 2,134, 0, 4, 0, 37, 0, 2, 0, 94, 0, 2, 2,135, 0, 2, 2,136, 0, 2, 2,137, 0, 7, 2,138, 0, 0, 2,139, - 0,117, 0, 3, 0,107, 2,108, 0, 7, 0, 37, 0, 4, 0, 17, 0,118, 0, 11, 0,107, 2,108, 0, 53, 2,140, 0, 7, 2,141, - 0, 4, 2,142, 0, 0, 2,139, 0, 7, 2,143, 0, 4, 2,144, 0, 32, 2,145, 0, 0, 2,146, 0, 4, 2,147, 0, 4, 0, 37, - 0,119, 0, 10, 0,107, 2,108, 0, 32, 2,148, 0, 48, 2,149, 0, 4, 0, 94, 0, 4, 2,150, 0, 7, 2,151, 0, 7, 2,152, - 0, 0, 2,146, 0, 4, 2,147, 0, 4, 0, 37, 0,120, 0, 3, 0,107, 2,108, 0, 7, 2,153, 0, 4, 2,154, 0,121, 0, 5, - 0,107, 2,108, 0, 7, 2,155, 0, 0, 2,139, 0, 2, 0, 19, 0, 2, 2,156, 0,122, 0, 8, 0,107, 2,108, 0, 32, 0,168, - 0, 7, 2,155, 0, 7, 1,220, 0, 7, 0,110, 0, 0, 2,139, 0, 2, 0, 19, 0, 2, 0, 17, 0,123, 0, 21, 0,107, 2,108, - 0, 32, 2,157, 0, 0, 2,139, 0, 53, 2,140, 0, 32, 2,145, 0, 2, 0, 19, 0, 2, 0, 37, 0, 7, 2,158, 0, 7, 2,159, - 0, 7, 2,160, 0, 7, 1,254, 0, 7, 2,161, 0, 7, 2,162, 0, 7, 2,163, 0, 7, 2,164, 0, 4, 2,144, 0, 4, 2,147, - 0, 0, 2,146, 0, 7, 2,165, 0, 7, 2,166, 0, 7, 0, 43, 0,124, 0, 7, 0,107, 2,108, 0, 2, 2,167, 0, 2, 2,168, - 0, 4, 0, 70, 0, 32, 0,168, 0, 7, 2,169, 0, 0, 2,139, 0,125, 0, 9, 0,107, 2,108, 0, 32, 0,168, 0, 7, 2,170, - 0, 7, 2,171, 0, 7, 2,164, 0, 4, 2,172, 0, 4, 2,173, 0, 7, 2,174, 0, 0, 0, 20, 0,126, 0, 1, 0,107, 2,108, - 0,127, 0, 6, 0,107, 2,108, 0, 47, 0,139, 0,128, 2,175, 0,129, 2,176, 0,130, 2,177, 0,131, 2,178, 0,132, 0, 14, - 0,107, 2,108, 0, 82, 2,179, 0, 82, 2,180, 0, 82, 2,181, 0, 82, 2,182, 0, 82, 2,183, 0, 82, 2,184, 0, 79, 2,185, - 0, 4, 2,186, 0, 4, 2,187, 0, 2, 2,188, 0, 2, 0, 37, 0, 7, 2,189, 0,133, 2,190, 0,134, 0, 3, 0,107, 2,108, - 0,135, 2,191, 0,136, 2,190, 0,137, 0, 4, 0,107, 2,108, 0, 32, 0,168, 0, 4, 2,192, 0, 4, 0, 37, 0,138, 0, 2, - 0, 4, 2,193, 0, 7, 1,219, 0,139, 0, 2, 0, 4, 0,130, 0, 4, 2,194, 0,140, 0, 20, 0,107, 2,108, 0, 32, 0,168, - 0, 0, 2,139, 0, 2, 2,195, 0, 2, 2,196, 0, 2, 0, 19, 0, 2, 0, 37, 0, 7, 2,197, 0, 7, 2,198, 0, 4, 0, 54, - 0, 4, 2,199, 0,139, 2,200, 0,138, 2,201, 0, 4, 2,202, 0, 4, 2,203, 0, 4, 2,204, 0, 4, 2,194, 0, 7, 2,205, - 0, 7, 2,206, 0, 7, 2,207, 0,141, 0, 8, 0,107, 2,108, 0,142, 2,208, 0,135, 2,191, 0, 4, 2,209, 0, 4, 2,210, - 0, 4, 2,211, 0, 2, 0, 19, 0, 2, 0, 57, 0,143, 0, 5, 0,107, 2,108, 0, 32, 0, 45, 0, 2, 2,212, 0, 2, 0, 19, - 0, 2, 2,213, 0,144, 0, 5, 0,107, 2,108, 0, 4, 2,214, 0, 2, 0, 19, 0, 2, 2,215, 0, 7, 2,216, 0,145, 0, 7, - 0,107, 2,108, 0, 82, 2,217, 0, 4, 2,218, 0, 0, 2,219, 0, 0, 2,220, 0, 0, 2,221, 0, 0, 2,222, 0,146, 0, 3, - 0,107, 2,108, 0,147, 2,223, 0,131, 2,178, 0,148, 0, 10, 0,107, 2,108, 0, 32, 2,224, 0, 32, 2,225, 0, 0, 2,226, - 0, 7, 2,227, 0, 2, 2,228, 0, 2, 2,229, 0, 0, 2,230, 0, 0, 2,231, 0, 0, 2,114, 0,149, 0, 9, 0,107, 2,108, - 0, 32, 2,232, 0, 0, 2,226, 0, 7, 2,233, 0, 7, 2,234, 0, 0, 1, 13, 0, 0, 2,129, 0, 0, 2,235, 0, 0, 0, 37, - 0,150, 0, 27, 0, 27, 0, 31, 0, 2, 1,229, 0, 2, 1,230, 0, 2, 2,236, 0, 2, 0, 19, 0, 2, 2,237, 0, 2, 2,238, - 0, 2, 2,239, 0, 2, 0, 70, 0, 0, 2,240, 0, 0, 2,241, 0, 0, 2,242, 0, 0, 0, 17, 0, 4, 0, 37, 0, 7, 2,243, - 0, 7, 2,244, 0, 7, 2,245, 0, 7, 2,246, 0, 7, 2,247, 0, 7, 2,248, 0, 34, 2,249, 0, 36, 0, 80, 0, 38, 1,250, - 0, 84, 2, 38, 0, 7, 2,250, 0, 7, 2,251, 0,150, 2,252, 0,151, 0, 3, 0,151, 0, 0, 0,151, 0, 1, 0, 0, 0, 20, - 0, 69, 0, 3, 0, 7, 2,253, 0, 4, 0, 19, 0, 4, 0, 37, 0, 32, 0,111, 0, 27, 0, 31, 0, 39, 0, 75, 0, 2, 0, 17, - 0, 2, 2,254, 0, 4, 2,255, 0, 4, 3, 0, 0, 4, 3, 1, 0, 0, 3, 2, 0, 32, 0, 38, 0, 32, 3, 3, 0, 32, 3, 4, - 0, 32, 3, 5, 0, 32, 3, 6, 0, 36, 0, 80, 0, 75, 1,249, 0, 69, 1,191, 0,152, 3, 7, 0,152, 3, 8, 0,153, 3, 9, - 0, 9, 0, 2, 0, 12, 3, 10, 0, 12, 2, 32, 0, 12, 1,210, 0, 12, 3, 11, 0, 12, 3, 12, 0, 64, 1,212, 0, 7, 1, 8, - 0, 7, 3, 13, 0, 7, 3, 14, 0, 7, 0,176, 0, 7, 3, 15, 0, 7, 1, 9, 0, 7, 3, 16, 0, 7, 3, 17, 0, 7, 2,170, - 0, 7, 3, 18, 0, 7, 0,212, 0, 4, 3, 19, 0, 2, 0, 19, 0, 2, 3, 20, 0, 2, 3, 21, 0, 2, 3, 22, 0, 2, 3, 23, - 0, 2, 3, 24, 0, 2, 3, 25, 0, 2, 3, 26, 0, 2, 3, 27, 0, 2, 3, 28, 0, 2, 3, 29, 0, 2, 3, 30, 0, 4, 3, 31, - 0, 4, 3, 32, 0, 4, 3, 33, 0, 4, 3, 34, 0, 7, 3, 35, 0, 7, 3, 36, 0, 7, 3, 37, 0, 7, 3, 38, 0, 7, 3, 39, - 0, 7, 3, 40, 0, 7, 3, 41, 0, 7, 3, 42, 0, 7, 3, 43, 0, 7, 3, 44, 0, 7, 3, 45, 0, 7, 1,160, 0, 0, 3, 46, - 0, 0, 3, 47, 0, 0, 1,213, 0, 0, 3, 48, 0, 0, 3, 49, 0, 0, 3, 50, 0, 7, 3, 51, 0, 7, 3, 52, 0, 40, 0,126, - 0, 12, 3, 53, 0, 12, 3, 54, 0, 12, 3, 55, 0, 12, 3, 56, 0, 7, 3, 57, 0, 2, 2, 80, 0, 2, 3, 58, 0, 7, 2, 61, - 0, 4, 3, 59, 0, 4, 3, 60, 0,154, 3, 61, 0, 2, 3, 62, 0, 2, 0,219, 0, 7, 3, 63, 0, 12, 3, 64, 0, 12, 3, 65, - 0, 12, 3, 66, 0, 12, 3, 67, 0,155, 3, 68, 0,156, 3, 69, 0, 65, 3, 70, 0, 2, 3, 71, 0, 2, 3, 72, 0, 2, 3, 73, - 0, 2, 3, 74, 0, 7, 2, 53, 0, 2, 3, 75, 0, 2, 3, 76, 0,147, 3, 77, 0,135, 3, 78, 0,135, 3, 79, 0, 4, 3, 80, - 0, 4, 3, 81, 0, 4, 3, 82, 0, 4, 0, 70, 0, 12, 3, 83, 0,157, 0, 14, 0,157, 0, 0, 0,157, 0, 1, 0, 32, 0, 38, - 0, 7, 2,170, 0, 7, 1, 10, 0, 7, 2,171, 0, 7, 2,164, 0, 0, 0, 20, 0, 4, 2,172, 0, 4, 2,173, 0, 4, 3, 84, - 0, 2, 0, 17, 0, 2, 3, 85, 0, 7, 2,174, 0,155, 0, 36, 0, 2, 3, 86, 0, 2, 3, 87, 0, 2, 0, 19, 0, 2, 2,164, - 0, 7, 3, 88, 0, 7, 3, 89, 0, 7, 3, 90, 0, 7, 3, 91, 0, 7, 3, 92, 0, 7, 3, 93, 0, 7, 3, 94, 0, 7, 3, 95, - 0, 7, 3, 96, 0, 7, 3, 97, 0, 7, 3, 98, 0, 7, 3, 99, 0, 7, 3,100, 0, 7, 3,101, 0, 7, 3,102, 0, 7, 3,103, - 0, 7, 3,104, 0, 7, 3,105, 0, 7, 3,106, 0, 7, 3,107, 0, 7, 3,108, 0, 7, 3,109, 0, 7, 3,110, 0, 7, 3,111, - 0, 2, 3,112, 0, 2, 3,113, 0, 2, 3,114, 0, 2, 3,115, 0, 53, 0,169, 0,158, 3,116, 0, 7, 3,117, 0, 4, 0, 37, - 0,131, 0, 5, 0, 4, 0, 19, 0, 4, 3,118, 0, 4, 3,119, 0, 4, 3,120, 0, 4, 3,121, 0,159, 0, 1, 0, 7, 1,227, - 0,154, 0, 28, 0, 4, 0, 19, 0, 7, 3,122, 0, 7, 3,123, 0, 7, 3,124, 0, 4, 3,125, 0, 4, 3,126, 0, 4, 3,127, - 0, 4, 3,128, 0, 7, 3,129, 0, 7, 3,130, 0, 7, 3,131, 0, 7, 3,132, 0, 7, 3,133, 0, 7, 3,134, 0, 7, 3,135, - 0, 7, 3,136, 0, 7, 3,137, 0, 7, 3,138, 0, 7, 3,139, 0, 7, 3,140, 0, 7, 3,141, 0, 7, 3,142, 0, 7, 3,143, - 0, 7, 3,144, 0, 7, 3,145, 0, 7, 3,146, 0, 4, 3,147, 0, 4, 3,148, 0,156, 0, 44, 0,142, 3,149, 0, 4, 3,150, - 0, 4, 3,151, 0,160, 3,152, 0,161, 3,153, 0, 7, 0, 37, 0, 7, 3,154, 0, 7, 3,155, 0, 7, 3,156, 0, 7, 3,157, - 0, 7, 3,158, 0, 7, 3,159, 0, 7, 3,160, 0, 7, 3,161, 0, 7, 3,162, 0, 7, 3,163, 0, 2, 3,164, 0, 2, 3,165, - 0, 7, 3,166, 0, 7, 3,167, 0, 4, 0,131, 0, 4, 3,168, 0, 4, 3,169, 0, 2, 3,170, 0, 2, 3,171, 0,159, 3,172, - 0, 4, 3,173, 0, 4, 0, 82, 0, 7, 3,174, 0, 7, 3,175, 0, 7, 3,176, 0, 7, 3,177, 0, 2, 3,178, 0, 2, 3,179, - 0, 2, 3,180, 0, 2, 3,181, 0, 2, 3,182, 0, 2, 3,183, 0, 2, 3,184, 0, 2, 3,185, 0,162, 3,186, 0, 7, 3,187, - 0, 7, 3,188, 0,131, 3,189, 0,147, 0, 48, 0, 2, 0, 17, 0, 2, 3,190, 0, 2, 3,191, 0, 2, 3,192, 0, 7, 3,193, - 0, 2, 3,194, 0, 2, 3,195, 0, 7, 3,196, 0, 2, 3,197, 0, 2, 3,198, 0, 7, 3,199, 0, 7, 3,200, 0, 7, 3,201, - 0, 7, 3,202, 0, 7, 3,203, 0, 7, 3,204, 0, 4, 3,205, 0, 7, 3,206, 0, 7, 3,207, 0, 7, 3,208, 0, 78, 3,209, - 0, 78, 3,210, 0, 78, 3,211, 0, 0, 3,212, 0, 7, 3,213, 0, 7, 3,214, 0, 36, 0, 80, 0, 2, 3,215, 0, 0, 3,216, - 0, 0, 3,217, 0, 7, 3,218, 0, 4, 3,219, 0, 7, 3,220, 0, 7, 3,221, 0, 4, 3,222, 0, 4, 0, 19, 0, 7, 3,223, - 0, 7, 3,224, 0, 7, 3,225, 0, 82, 3,226, 0, 7, 3,227, 0, 7, 3,228, 0, 7, 3,229, 0, 7, 3,230, 0, 7, 3,231, - 0, 7, 3,232, 0, 7, 3,233, 0, 4, 3,234, 0,163, 0, 68, 0, 27, 0, 31, 0, 39, 0, 75, 0, 2, 0,178, 0, 2, 1, 14, - 0, 2, 1, 47, 0, 2, 3,235, 0, 7, 3,236, 0, 7, 3,237, 0, 7, 3,238, 0, 7, 3,239, 0, 7, 3,240, 0, 7, 3,241, - 0, 7, 3,242, 0, 7, 3,243, 0, 7, 1, 85, 0, 7, 1, 87, 0, 7, 1, 86, 0, 7, 3,244, 0, 4, 3,245, 0, 7, 3,246, - 0, 7, 3,247, 0, 7, 3,248, 0, 7, 3,249, 0, 7, 3,250, 0, 7, 3,251, 0, 7, 3,252, 0, 2, 3,253, 0, 2, 1, 13, - 0, 2, 3,254, 0, 2, 3,255, 0, 7, 4, 0, 0, 7, 4, 1, 0, 7, 4, 2, 0, 7, 4, 3, 0, 7, 4, 4, 0, 7, 4, 5, - 0, 7, 4, 6, 0, 7, 4, 7, 0, 7, 4, 8, 0, 7, 4, 9, 0, 7, 4, 10, 0, 7, 4, 11, 0, 2, 4, 12, 0, 2, 4, 13, - 0, 2, 4, 14, 0, 2, 4, 15, 0, 7, 4, 16, 0, 7, 4, 17, 0, 7, 4, 18, 0, 7, 4, 19, 0, 2, 4, 20, 0, 2, 4, 21, - 0, 2, 4, 22, 0, 2, 4, 23, 0, 7, 4, 24, 0, 7, 4, 25, 0, 7, 4, 26, 0, 7, 4, 27, 0, 2, 4, 28, 0, 2, 4, 29, - 0, 2, 4, 30, 0, 2, 0, 19, 0, 7, 4, 31, 0, 7, 4, 32, 0, 36, 0, 80, 0, 52, 1, 77, 0, 30, 0,155, 0, 40, 0,126, - 0,164, 0, 16, 0, 2, 4, 33, 0, 2, 4, 34, 0, 2, 4, 35, 0, 2, 0, 19, 0, 2, 4, 36, 0, 2, 4, 37, 0, 2, 4, 38, - 0, 2, 4, 39, 0, 2, 4, 40, 0, 2, 4, 41, 0, 2, 4, 42, 0, 2, 4, 43, 0, 4, 4, 44, 0, 7, 4, 45, 0, 7, 4, 46, - 0, 7, 4, 47, 0,165, 0, 8, 0,165, 0, 0, 0,165, 0, 1, 0, 4, 3, 19, 0, 4, 4, 48, 0, 4, 0, 19, 0, 2, 4, 49, - 0, 2, 4, 50, 0, 32, 0,168, 0,166, 0, 13, 0, 9, 4, 51, 0, 9, 4, 52, 0, 4, 4, 53, 0, 4, 4, 54, 0, 4, 4, 55, - 0, 4, 4, 56, 0, 4, 4, 57, 0, 4, 4, 58, 0, 4, 4, 59, 0, 4, 4, 60, 0, 4, 4, 61, 0, 4, 0, 37, 0, 0, 4, 62, - 0,167, 0, 5, 0, 9, 4, 63, 0, 9, 4, 64, 0, 4, 4, 65, 0, 4, 0, 70, 0, 0, 4, 66, 0,168, 0, 13, 0, 4, 0, 17, - 0, 4, 4, 67, 0, 4, 4, 68, 0, 4, 4, 69, 0, 4, 4, 70, 0, 4, 4, 71, 0, 4, 0, 94, 0, 4, 4, 72, 0, 4, 4, 73, - 0, 4, 4, 74, 0, 4, 4, 75, 0, 4, 4, 76, 0, 26, 0, 30, 0,169, 0, 4, 0, 4, 4, 77, 0, 7, 4, 78, 0, 2, 0, 19, - 0, 2, 2, 77, 0,170, 0, 11, 0,170, 0, 0, 0,170, 0, 1, 0, 0, 0, 20, 0, 64, 4, 79, 0, 65, 4, 80, 0, 4, 3, 19, - 0, 4, 4, 81, 0, 4, 4, 82, 0, 4, 0, 37, 0, 4, 4, 83, 0, 4, 4, 84, 0,171, 0,131, 0,166, 4, 85, 0,167, 4, 86, - 0,168, 4, 87, 0,169, 4, 88, 0, 4, 4, 89, 0, 4, 0,131, 0, 4, 3,168, 0, 4, 4, 90, 0, 4, 4, 91, 0, 4, 4, 92, - 0, 4, 4, 93, 0, 2, 0, 19, 0, 2, 4, 94, 0, 7, 3, 36, 0, 7, 4, 95, 0, 7, 4, 96, 0, 7, 4, 97, 0, 7, 4, 98, - 0, 7, 4, 99, 0, 2, 4,100, 0, 2, 4,101, 0, 2, 4,102, 0, 2, 4,103, 0, 2, 0,218, 0, 2, 4,104, 0, 2, 4,105, - 0, 2, 3,115, 0, 2, 4,106, 0, 2, 4,107, 0, 2, 1, 34, 0, 2, 0,110, 0, 2, 4,108, 0, 2, 4,109, 0, 2, 4,110, - 0, 2, 4,111, 0, 2, 4,112, 0, 2, 4,113, 0, 2, 4,114, 0, 2, 4,115, 0, 2, 4,116, 0, 2, 1, 35, 0, 2, 4,117, - 0, 2, 4,118, 0, 2, 4,119, 0, 2, 4,120, 0, 4, 4,121, 0, 4, 1, 13, 0, 2, 4,122, 0, 2, 4,123, 0, 2, 4,124, - 0, 2, 4,125, 0, 2, 4,126, 0, 2, 4,127, 0, 24, 4,128, 0, 24, 4,129, 0, 23, 4,130, 0, 12, 4,131, 0, 2, 4,132, - 0, 2, 0, 37, 0, 7, 4,133, 0, 7, 4,134, 0, 7, 4,135, 0, 7, 4,136, 0, 7, 4,137, 0, 7, 4,138, 0, 7, 4,139, - 0, 7, 4,140, 0, 7, 4,141, 0, 2, 4,142, 0, 2, 4,143, 0, 2, 4,144, 0, 2, 4,145, 0, 2, 4,146, 0, 2, 4,147, - 0, 7, 4,148, 0, 7, 4,149, 0, 7, 4,150, 0, 2, 4,151, 0, 2, 4,152, 0, 2, 4,153, 0, 2, 4,154, 0, 2, 4,155, - 0, 2, 4,156, 0, 2, 4,157, 0, 2, 4,158, 0, 2, 4,159, 0, 2, 4,160, 0, 4, 4,161, 0, 4, 4,162, 0, 4, 4,163, - 0, 4, 4,164, 0, 4, 4,165, 0, 7, 4,166, 0, 4, 4,167, 0, 4, 4,168, 0, 4, 4,169, 0, 4, 4,170, 0, 7, 4,171, - 0, 7, 4,172, 0, 7, 4,173, 0, 7, 4,174, 0, 7, 4,175, 0, 7, 4,176, 0, 7, 4,177, 0, 7, 4,178, 0, 7, 4,179, - 0, 0, 4,180, 0, 0, 4,181, 0, 4, 4,182, 0, 2, 4,183, 0, 2, 1,160, 0, 0, 4,184, 0, 7, 4,185, 0, 7, 4,186, - 0, 4, 4,187, 0, 4, 4,188, 0, 7, 4,189, 0, 7, 4,190, 0, 2, 4,191, 0, 2, 4,192, 0, 7, 4,193, 0, 2, 4,194, - 0, 2, 4,195, 0, 4, 4,196, 0, 2, 4,197, 0, 2, 4,198, 0, 2, 4,199, 0, 2, 4,200, 0, 7, 4,201, 0, 7, 4,202, - 0, 43, 4,203, 0,172, 0, 9, 0,172, 0, 0, 0,172, 0, 1, 0, 0, 0, 20, 0, 2, 4,204, 0, 2, 4,205, 0, 2, 4,206, - 0, 2, 0, 43, 0, 7, 4,207, 0, 7, 0, 70, 0,173, 0, 5, 0, 7, 4,208, 0, 0, 0, 17, 0, 0, 0, 43, 0, 0, 0, 70, - 0, 0, 1,160, 0,174, 0, 5, 0,174, 0, 0, 0,174, 0, 1, 0, 4, 4,209, 0, 0, 4,210, 0, 4, 0, 19, 0,175, 0, 6, - 0,176, 4,211, 0, 2, 0, 19, 0, 2, 4,212, 0, 2, 4,213, 0, 2, 4,214, 0, 9, 4,215, 0,177, 0, 4, 0, 2, 0,110, - 0, 2, 2,141, 0, 2, 4,216, 0, 2, 4,217, 0,178, 0, 8, 0, 2, 0, 19, 0, 2, 4,218, 0, 2, 4,219, 0, 2, 4,220, - 0,177, 4,221, 0, 9, 4,215, 0, 7, 4,222, 0, 4, 4,223, 0,179, 0, 4, 0,179, 0, 0, 0,179, 0, 1, 0, 0, 4,224, - 0, 7, 4,225, 0,180, 0, 8, 0,181, 4,226, 0,176, 4,211, 0, 7, 4,227, 0, 4, 0, 94, 0, 0, 4,228, 0, 0, 4,229, - 0, 0, 4,230, 0, 0, 4,231, 0,182, 0, 9, 0,176, 4,211, 0, 7, 4, 47, 0, 7, 4,232, 0, 2, 1, 13, 0, 2, 0, 19, - 0, 4, 0, 36, 0, 4, 4,233, 0, 84, 4,234, 0, 9, 4,215, 0,183, 0, 64, 0,182, 4,235, 0,182, 4,236, 0,180, 4,237, - 0, 2, 4,238, 0, 2, 4,239, 0, 7, 4,240, 0, 7, 4,241, 0, 2, 4,216, 0, 2, 4,242, 0, 7, 4,243, 0, 7, 4,244, - 0, 2, 4,245, 0, 2, 4,246, 0, 2, 4,247, 0, 2, 4,248, 0, 7, 4,249, 0, 7, 4,250, 0, 7, 4,251, 0, 7, 0, 37, - 0, 2, 4,252, 0, 2, 4,253, 0, 2, 4,254, 0, 2, 4,255, 0, 2, 5, 0, 0, 2, 5, 1, 0, 2, 5, 2, 0,175, 5, 3, - 0,178, 5, 4, 0, 7, 5, 5, 0, 7, 5, 6, 0, 7, 5, 7, 0, 0, 5, 8, 0, 0, 5, 9, 0, 0, 5, 10, 0, 0, 5, 11, - 0, 0, 5, 12, 0, 0, 5, 13, 0, 2, 5, 14, 0, 7, 5, 15, 0, 7, 5, 16, 0, 7, 5, 17, 0, 7, 5, 18, 0, 7, 5, 19, - 0, 7, 5, 20, 0, 7, 5, 21, 0, 7, 5, 22, 0, 7, 5, 23, 0, 7, 5, 24, 0, 2, 5, 25, 0, 0, 5, 26, 0, 0, 5, 27, - 0, 0, 5, 28, 0, 0, 5, 29, 0, 4, 5, 30, 0, 32, 5, 31, 0, 0, 5, 32, 0, 0, 5, 33, 0, 0, 5, 34, 0, 0, 5, 35, - 0, 0, 5, 36, 0, 0, 5, 37, 0, 0, 5, 38, 0, 0, 5, 39, 0, 0, 5, 40, 0,184, 0, 8, 0, 4, 5, 41, 0, 4, 5, 42, - 0, 4, 5, 43, 0, 4, 5, 44, 0, 4, 5, 45, 0, 4, 5, 46, 0, 4, 0, 54, 0, 4, 2, 48, 0, 47, 0, 46, 0, 27, 0, 31, - 0, 39, 0, 75, 0, 32, 5, 47, 0,163, 5, 48, 0, 47, 5, 49, 0, 48, 0,210, 0, 12, 5, 50, 0,165, 5, 51, 0, 32, 5, 52, - 0, 7, 5, 53, 0, 7, 5, 54, 0, 7, 5, 55, 0, 7, 5, 56, 0, 4, 3, 19, 0, 7, 5, 57, 0, 2, 5, 58, 0, 2, 5, 59, - 0, 2, 5, 60, 0, 2, 5, 61, 0, 2, 5, 62, 0, 2, 0, 19, 0, 2, 5, 63, 0, 2, 1, 6, 0, 59, 1, 2, 0, 9, 5, 64, - 0,164, 5, 65, 0,173, 5, 66, 0,183, 5, 67, 0,185, 5, 68, 0,171, 0,184, 0,169, 4, 88, 0, 40, 0,126, 0, 12, 0,104, - 0, 12, 5, 69, 0, 2, 5, 70, 0, 2, 5, 71, 0, 2, 5, 72, 0, 2, 5, 73, 0,186, 5, 74, 0, 2, 5, 75, 0, 2, 5, 76, - 0, 2, 1, 64, 0, 2, 0,219, 0, 4, 5, 77, 0, 4, 5, 78, 0, 12, 5, 79, 0,187, 0, 9, 0, 48, 0,210, 0, 46, 1, 1, - 0, 7, 2, 13, 0, 7, 2, 14, 0, 7, 0,110, 0, 7, 5, 80, 0, 7, 5, 81, 0, 2, 5, 82, 0, 2, 5, 83, 0,188, 0, 34, - 0, 7, 5, 84, 0, 7, 5, 85, 0, 7, 5, 86, 0, 7, 5, 87, 0, 7, 5, 88, 0, 7, 5, 89, 0, 7, 5, 90, 0, 7, 5, 91, - 0, 7, 1, 20, 0, 7, 5, 92, 0, 7, 5, 93, 0, 7, 5, 94, 0, 7, 5, 95, 0, 7, 0,175, 0, 2, 5, 96, 0, 2, 5, 97, - 0, 4, 5, 98, 0, 2, 5, 99, 0, 2, 5,100, 0, 2, 5,101, 0, 2, 5,102, 0, 7, 5,103, 0, 69, 5,104, 0,189, 5,105, - 0,188, 5,106, 0,190, 5,107, 0,191, 5,108, 0,192, 5,109, 0,193, 5,110, 0,194, 5,111, 0, 7, 5,112, 0, 2, 5,113, - 0, 2, 5,114, 0, 4, 1,160, 0,195, 0, 54, 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, 0, 4, 5,116, 0, 7, 5,117, - 0, 2, 5,118, 0, 7, 5, 91, 0, 7, 1, 20, 0, 7, 0, 43, 0, 4, 5,119, 0, 2, 5,101, 0, 2, 5,102, 0, 32, 5, 47, - 0, 32, 5,120, 0,187, 5,121, 0,195, 5,106, 0, 0, 5,122, 0, 4, 3, 19, 0, 4, 5,123, 0, 2, 4, 35, 0, 2, 5,124, - 0, 2, 5,125, 0, 2, 5,126, 0, 2, 1,160, 0, 2, 0, 19, 0, 2, 5,127, 0, 2, 5,128, 0, 7, 0,116, 0, 7, 5,129, - 0, 7, 5,130, 0, 7, 5,131, 0, 7, 5,132, 0, 7, 5,133, 0, 7, 0,175, 0, 7, 5, 53, 0, 2, 5,134, 0, 2, 1, 64, - 0, 2, 5,135, 0, 2, 5,136, 0, 2, 5,137, 0, 2, 5,138, 0, 2, 5,139, 0, 2, 5,140, 0, 2, 5,141, 0, 2, 5,142, - 0, 4, 5,143, 0, 12, 5,144, 0, 2, 5,145, 0, 2, 2, 62, 0, 2, 5,146, 0, 0, 5,147, 0, 0, 5,148, 0, 9, 5,149, - 0,189, 5,105, 0,197, 0, 22, 0, 24, 0, 36, 0, 24, 0, 64, 0, 23, 5,150, 0, 23, 5,151, 0, 23, 5,152, 0, 7, 5,153, - 0, 7, 5,154, 0, 7, 5,155, 0, 7, 5,156, 0, 2, 5,157, 0, 2, 5,158, 0, 2, 5,159, 0, 2, 5,160, 0, 2, 5,161, - 0, 2, 0, 19, 0, 2, 5,162, 0, 2, 5,163, 0, 2, 5,164, 0, 2, 5,165, 0, 2, 5,166, 0, 2, 5,126, 0, 7, 5,167, - 0,196, 0, 6, 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, 0, 4, 5,116, 0, 7, 5,117, 0, 2, 5,118, 0,198, 0, 8, - 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, 0, 4, 5,116, 0, 7, 5,117, 0, 2, 5,118, 0,199, 5,168, 0, 47, 0,139, - 0,200, 0, 14, 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, 0, 4, 5,116, 0, 7, 5,117, 0, 2, 5,118, 0,197, 5,169, - 0,201, 5,170, 0, 12, 5,171, 0, 2, 1, 13, 0, 2, 0, 19, 0, 2, 5,172, 0, 0, 5,173, 0, 0, 5,174, 0,202, 0, 28, - 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, 0, 4, 5,116, 0, 7, 5,117, 0, 2, 5,118, 0,190, 5,107, 0, 2, 5,175, - 0, 2, 5,176, 0, 2, 5,162, 0, 2, 5,177, 0,197, 5,169, 0, 2, 5,178, 0, 2, 0,138, 0, 2, 5,173, 0, 2, 5,179, - 0, 9, 5,180, 0, 2, 5,181, 0, 0, 5,182, 0, 0, 5,183, 0, 2, 5,184, 0, 2, 5,185, 0, 2, 3, 28, 0, 2, 5,186, - 0, 2, 5,187, 0, 0, 0, 19, 0, 0, 1, 47, 0, 0, 5,188, 0,203, 0, 16, 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, - 0, 4, 5,116, 0, 7, 5,117, 0, 2, 5,118, 0,197, 5,169, 0, 7, 2, 13, 0, 7, 2, 14, 0, 2, 5,178, 0, 2, 0, 37, - 0, 2, 5,189, 0, 2, 5,190, 0, 4, 0, 19, 0, 7, 5, 80, 0,189, 5,105, 0,204, 0, 10, 0,196, 0, 0, 0,196, 0, 1, - 0, 12, 5,115, 0, 4, 5,116, 0, 4, 0, 37, 0,205, 5,191, 0,206, 5,192, 0,207, 5,193, 0,194, 5,194, 0,208, 5,195, - 0,209, 0, 17, 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, 0, 4, 5,116, 0, 7, 5,117, 0, 2, 5,118, 0,197, 5,169, - 0, 12, 5,196, 0,210, 5,197, 0, 0, 5,198, 0,211, 5,199, 0, 4, 5,200, 0, 4, 5,201, 0, 2, 0, 19, 0, 2, 5,202, - 0, 2, 5,203, 0, 2, 0, 37, 0,212, 0, 29, 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, 0, 4, 5,116, 0, 7, 5,117, - 0, 2, 5,118, 0, 48, 2,149, 0, 46, 1, 1, 0, 62, 5,204, 0, 2, 0,138, 0, 2, 5,205, 0, 2, 0, 70, 0, 2, 5,206, - 0, 4, 0, 19, 0, 2, 5,207, 0, 2, 5,174, 0, 2, 5,173, 0, 2, 1,160, 0, 0, 5,208, 0, 0, 5,209, 0, 0, 5,210, - 0, 0, 0, 37, 0, 7, 2, 13, 0, 7, 2, 14, 0, 7, 5, 80, 0, 7, 1, 64, 0, 7, 5,211, 0, 7, 5,212, 0,189, 5,105, - 0,213, 0, 11, 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, 0, 4, 5,116, 0, 7, 5,117, 0, 2, 5,118, 0, 2, 0,138, - 0, 2, 5,174, 0, 2, 5,172, 0, 2, 0, 19, 0,197, 5,169, 0,214, 0, 24, 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, - 0, 4, 5,116, 0, 7, 5,117, 0, 2, 5,118, 0, 43, 5,213, 0, 4, 5,214, 0, 4, 5,215, 0, 2, 0, 94, 0, 2, 0,138, - 0, 4, 5,216, 0, 4, 5,217, 0, 4, 5,218, 0, 4, 5,219, 0, 4, 5,220, 0, 4, 5,221, 0, 7, 5,222, 0, 23, 5,223, - 0, 23, 5,224, 0, 4, 5,225, 0, 4, 5,226, 0, 0, 5,227, 0, 0, 5,228, 0,215, 0, 10, 0, 27, 0, 31, 0, 9, 5,229, - 0, 9, 5,230, 0, 9, 5,231, 0, 9, 5,232, 0, 9, 5,233, 0, 4, 0, 94, 0, 4, 5,234, 0, 0, 5,235, 0, 0, 5,236, - 0,216, 0, 10, 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, 0, 4, 5,116, 0, 7, 5,117, 0,215, 5,237, 0, 2, 0, 94, - 0, 2, 0,138, 0, 4, 0, 43, 0, 9, 5,238, 0,217, 0, 8, 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, 0, 4, 5,116, - 0, 7, 5,117, 0,197, 5,169, 0, 4, 0, 19, 0, 4, 5,239, 0,218, 0, 22, 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, - 0, 4, 5,116, 0, 7, 5,117, 0, 2, 5,118, 0,197, 5,169, 0, 27, 5,240, 0, 27, 0, 81, 0, 2, 0, 19, 0, 2, 0,138, - 0, 7, 5,241, 0, 9, 5,242, 0, 7, 2, 13, 0, 7, 2, 14, 0, 7, 5,243, 0, 7, 5,244, 0, 59, 1, 2, 0, 59, 5,245, - 0, 4, 5,246, 0, 4, 0, 37, 0,189, 5,105, 0,219, 0, 42, 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, 0, 4, 5,116, - 0, 7, 5,117, 0, 2, 5,118, 0,197, 5,169, 0,206, 5,192, 0, 0, 5,247, 0, 0, 5,248, 0, 0, 5,249, 0, 2, 0, 17, - 0, 2, 5,250, 0, 2, 0, 19, 0, 2, 5,251, 0, 9, 5,242, 0, 4, 5,252, 0, 4, 5,253, 0, 4, 5,254, 0, 4, 5,255, - 0, 23, 6, 0, 0, 23, 6, 1, 0, 7, 6, 2, 0, 7, 6, 3, 0, 7, 6, 4, 0, 7, 5,241, 0, 2, 6, 5, 0, 2, 0,209, - 0, 2, 1,103, 0, 2, 6, 6, 0, 2, 0, 37, 0, 2, 0, 43, 0, 2, 6, 7, 0, 2, 6, 8, 0, 9, 6, 9, 0, 9, 6, 10, - 0, 9, 6, 11, 0, 9, 6, 12, 0, 9, 6, 13, 0, 2, 6, 14, 0, 0, 6, 15, 0, 58, 6, 16, 0,220, 0, 7, 0,220, 0, 0, - 0,220, 0, 1, 0, 0, 6, 17, 0, 2, 6, 18, 0, 2, 6, 19, 0, 2, 6, 20, 0, 2, 0, 37, 0,221, 0, 10, 0, 2, 6, 19, - 0, 2, 6, 21, 0, 2, 6, 22, 0, 2, 6, 23, 0, 2, 6, 24, 0, 2, 6, 25, 0, 2, 6, 26, 0, 2, 5,162, 0, 7, 6, 27, - 0, 7, 6, 28, 0,222, 0, 17, 0,222, 0, 0, 0,222, 0, 1, 0, 0, 4,210, 0,221, 6, 29, 0,221, 6, 30, 0,221, 6, 31, - 0,221, 6, 32, 0, 2, 6, 33, 0, 2, 6, 34, 0, 2, 6, 35, 0, 2, 6, 36, 0, 2, 6, 37, 0, 2, 6, 38, 0, 2, 6, 39, - 0, 2, 6, 40, 0, 2, 6, 41, 0, 2, 2, 77, 0,223, 0, 10, 0, 0, 6, 42, 0, 0, 6, 43, 0, 0, 6, 44, 0, 0, 6, 45, - 0, 0, 6, 46, 0, 0, 6, 47, 0, 2, 6, 48, 0, 2, 6, 49, 0, 2, 6, 50, 0, 2, 0, 37, 0,224, 0, 12, 0,223, 6, 51, - 0,223, 6, 52, 0,223, 6, 53, 0,223, 6, 54, 0,223, 6, 55, 0,223, 6, 56, 0,223, 6, 57, 0,223, 6, 58, 0,223, 6, 59, - 0,223, 6, 60, 0,223, 6, 61, 0, 0, 6, 62, 0,225, 0, 71, 0, 0, 6, 63, 0, 0, 6, 64, 0, 0, 6, 46, 0, 0, 6, 65, - 0, 0, 6, 66, 0, 0, 6, 67, 0, 0, 6, 68, 0, 0, 6, 69, 0, 0, 6, 70, 0, 0, 6, 71, 0, 0, 6, 72, 0, 0, 6, 73, - 0, 0, 6, 74, 0, 0, 6, 75, 0, 0, 6, 76, 0, 0, 6, 77, 0, 0, 6, 78, 0, 0, 6, 79, 0, 0, 6, 80, 0, 0, 6, 81, - 0, 0, 6, 82, 0, 0, 6, 83, 0, 0, 6, 84, 0, 0, 6, 85, 0, 0, 6, 86, 0, 0, 6, 87, 0, 0, 6, 88, 0, 0, 6, 89, - 0, 0, 6, 90, 0, 0, 6, 91, 0, 0, 6, 92, 0, 0, 6, 93, 0, 0, 6, 94, 0, 0, 6, 95, 0, 0, 6, 96, 0, 0, 6, 97, - 0, 0, 6, 98, 0, 0, 6, 99, 0, 0, 6,100, 0, 0, 6,101, 0, 0, 6,102, 0, 0, 6,103, 0, 0, 6,104, 0, 0, 6,105, - 0, 0, 6,106, 0, 0, 6,107, 0, 0, 6,108, 0, 0, 6,109, 0, 0, 6,110, 0, 0, 6,111, 0, 0, 6,112, 0, 0, 6,113, - 0, 0, 6,114, 0, 0, 6,115, 0, 0, 6,116, 0, 0, 6,117, 0, 0, 6,118, 0, 0, 6,119, 0, 0, 6,120, 0, 0, 6,121, - 0, 0, 6,122, 0, 0, 6,123, 0, 0, 6,124, 0, 0, 6,125, 0, 0, 6,126, 0, 0, 6,127, 0, 0, 6,128, 0, 0, 6,129, - 0, 0, 6,130, 0, 0, 6,131, 0, 0, 0, 96, 0,226, 0, 5, 0, 0, 6,132, 0, 0, 6, 87, 0, 0, 6, 89, 0, 2, 0, 19, - 0, 2, 0, 37, 0,227, 0, 20, 0,227, 0, 0, 0,227, 0, 1, 0, 0, 0, 20, 0,224, 6,133, 0,225, 6,134, 0,225, 6,135, - 0,225, 6,136, 0,225, 6,137, 0,225, 6,138, 0,225, 6,139, 0,225, 6,140, 0,225, 6,141, 0,225, 6,142, 0,225, 6,143, - 0,225, 6,144, 0,225, 6,145, 0,225, 6,146, 0,225, 6,147, 0,225, 6,148, 0,226, 6,149, 0,228, 0, 5, 0, 4, 0, 19, - 0, 4, 0, 37, 0, 7, 2, 61, 0, 7, 6,150, 0, 7, 1,227, 0,229, 0, 67, 0, 4, 0, 19, 0, 4, 6,151, 0, 4, 6,152, - 0, 0, 6,153, 0, 0, 6,154, 0, 0, 6,155, 0, 0, 6,156, 0, 0, 6,157, 0, 0, 6,158, 0, 0, 6,159, 0, 0, 6,160, - 0, 0, 6,161, 0, 2, 6,162, 0, 2, 0, 37, 0, 4, 6,163, 0, 4, 6,164, 0, 4, 6,165, 0, 4, 6,166, 0, 2, 6,167, - 0, 2, 6,168, 0, 4, 6,169, 0, 4, 0, 43, 0, 4, 6,170, 0, 2, 6,171, 0, 2, 6,172, 0, 2, 6,173, 0, 2, 6,174, - 0, 12, 6,175, 0, 12, 6,176, 0, 12, 6,177, 0, 2, 6,178, 0, 2, 6,179, 0, 2, 6,180, 0, 2, 6,181, 0, 2, 6,182, - 0, 2, 6,183, 0, 2, 6,184, 0, 2, 6,185, 0,228, 6,186, 0, 2, 6,187, 0, 2, 6,188, 0, 2, 6,189, 0, 2, 6,190, - 0, 2, 6,191, 0, 2, 6,192, 0, 2, 6,193, 0, 2, 6,194, 0, 4, 6,195, 0, 4, 6,196, 0, 2, 6,197, 0, 2, 6,198, - 0, 2, 6,199, 0, 2, 6,200, 0, 2, 6,201, 0, 2, 6,202, 0, 2, 6,203, 0, 2, 6,204, 0, 2, 6,205, 0, 2, 6,206, - 0, 2, 6,207, 0, 2, 6,208, 0, 0, 6,209, 0, 0, 6,210, 0, 7, 6,211, 0, 2, 5, 63, 0, 2, 6,212, 0, 56, 6,213, - 0,199, 0, 20, 0, 27, 0, 31, 0, 12, 6,214, 0, 12, 6,215, 0, 12, 6,216, 0, 12, 5,115, 0, 47, 0,139, 0, 2, 6,217, - 0, 2, 6,218, 0, 2, 6,219, 0, 2, 6,220, 0, 2, 6,221, 0, 2, 6,222, 0, 2, 6,223, 0, 2, 0, 37, 0, 2, 6,224, - 0, 2, 6,225, 0, 4, 0, 70, 0,194, 6,226, 0, 9, 6,227, 0, 2, 6,228, 0,230, 0, 5, 0,230, 0, 0, 0,230, 0, 1, - 0,230, 6,229, 0, 13, 6,230, 0, 4, 0, 19, 0,231, 0, 7, 0,231, 0, 0, 0,231, 0, 1, 0,230, 6,231, 0,230, 6,232, - 0, 2, 4,129, 0, 2, 0, 19, 0, 4, 0, 37, 0,232, 0, 20, 0,232, 0, 0, 0,232, 0, 1, 0,233, 6,233, 0,234, 5,195, - 0, 0, 6,234, 0, 0, 6,235, 0, 0, 6,236, 0, 2, 6,237, 0, 2, 6,238, 0, 2, 6,239, 0, 2, 6,240, 0, 2, 6,241, - 0, 2, 0, 37, 0, 2, 0, 19, 0, 2, 6,242, 0, 2, 6,243, 0, 2, 6,244, 0, 4, 6,245, 0,232, 6,246, 0, 9, 6,247, - 0,235, 0, 2, 0,236, 6,233, 0,234, 5,195, 0,237, 0, 2, 0,238, 6,233, 0,234, 5,195, 0,239, 0, 23, 0,239, 0, 0, - 0,239, 0, 1, 0,230, 6,231, 0,230, 6,232, 0,230, 6,248, 0,230, 6,249, 0,199, 6,250, 0, 23, 0, 52, 0, 0, 5,116, - 0, 0, 6,251, 0, 2, 5,163, 0, 2, 5,164, 0, 2, 6,252, 0, 2, 0, 37, 0, 2, 6,220, 0, 2, 6,253, 0, 2, 0, 19, - 0, 40, 0,126, 0,240, 6,233, 0, 12, 6,254, 0, 12, 5,115, 0, 12, 6,255, 0, 12, 7, 0, 0,241, 0, 21, 0,241, 0, 0, - 0,241, 0, 1, 0,197, 5,169, 0, 23, 7, 1, 0, 23, 7, 2, 0, 2, 5,163, 0, 2, 5,164, 0, 2, 7, 3, 0, 2, 7, 4, - 0, 2, 7, 5, 0, 2, 0, 19, 0, 7, 2, 9, 0, 2, 6,219, 0, 2, 6,223, 0, 4, 0, 43, 0,242, 6,233, 0, 12, 7, 6, - 0, 12, 7, 7, 0, 12, 6,255, 0, 0, 7, 8, 0, 9, 7, 9, 0,243, 0, 11, 0, 0, 7, 10, 0, 2, 7, 11, 0, 2, 7, 12, - 0, 2, 7, 13, 0, 2, 7, 14, 0, 2, 7, 15, 0, 2, 4,113, 0,199, 7, 16, 0, 47, 7, 17, 0, 4, 7, 18, 0, 4, 7, 19, - 0,244, 0, 1, 0, 0, 7, 20, 0,245, 0, 8, 0, 58, 7, 21, 0, 58, 7, 22, 0,245, 7, 23, 0,245, 7, 24, 0,245, 7, 25, - 0, 2, 0,134, 0, 2, 0, 19, 0, 4, 7, 26, 0,246, 0, 4, 0, 4, 5,214, 0, 4, 7, 27, 0, 4, 5,217, 0, 4, 7, 28, - 0,247, 0, 2, 0, 4, 7, 29, 0, 4, 7, 30, 0,248, 0, 7, 0, 7, 7, 31, 0, 7, 7, 32, 0, 7, 7, 33, 0, 4, 0, 19, - 0, 4, 0, 37, 0, 7, 3,246, 0, 7, 7, 34, 0,249, 0, 1, 0, 0, 7, 35, 0,250, 0, 21, 0,250, 0, 0, 0,250, 0, 1, - 0, 4, 0, 57, 0, 4, 0, 23, 0, 4, 0, 28, 0, 4, 7, 36, 0, 4, 7, 37, 0, 4, 7, 38, 0,244, 7, 39, 0, 0, 7, 35, - 0, 4, 7, 40, 0, 4, 7, 41, 0,249, 3, 4, 0,246, 7, 42, 0,247, 7, 43, 0,248, 7, 44, 0,245, 7, 45, 0,245, 7, 46, - 0,245, 7, 47, 0, 58, 7, 48, 0, 58, 7, 49, 0,251, 0, 12, 0, 0, 1,190, 0, 9, 0,195, 0, 0, 0,196, 0, 4, 0,199, - 0, 4, 0,207, 0, 9, 0,200, 0, 7, 0,202, 0, 7, 0,203, 0, 9, 7, 50, 0, 9, 7, 51, 0, 9, 0,204, 0, 9, 0,206, - 0,252, 0, 45, 0,252, 0, 0, 0,252, 0, 1, 0, 9, 7, 52, 0, 9, 0, 26, 0, 0, 0, 27, 0, 4, 0, 19, 0, 4, 0, 17, - 0, 4, 0, 23, 0, 4, 0, 92, 0, 4, 7, 53, 0, 4, 7, 54, 0, 4, 7, 37, 0, 4, 7, 38, 0, 4, 7, 55, 0, 4, 0,218, - 0, 4, 7, 56, 0, 4, 7, 57, 0, 7, 4,232, 0, 7, 7, 58, 0, 4, 0,131, 0, 4, 7, 59, 0,250, 7, 60, 0, 36, 0, 80, - 0, 47, 0,139, 0, 50, 0,142, 0, 7, 7, 61, 0, 7, 7, 62, 0,251, 1, 3, 0,252, 7, 63, 0,252, 7, 64, 0,252, 7, 65, - 0, 12, 7, 66, 0,253, 7, 67, 0,254, 7, 68, 0, 7, 7, 69, 0, 7, 7, 70, 0, 4, 7, 71, 0, 7, 7, 72, 0, 9, 7, 73, - 0, 4, 7, 74, 0, 4, 7, 75, 0, 4, 7, 76, 0, 7, 7, 77, 0, 4, 7, 78, 0, 4, 0, 37, 0,255, 0, 4, 0,255, 0, 0, - 0,255, 0, 1, 0, 12, 7, 79, 0,252, 7, 80, 1, 0, 0, 6, 0, 12, 7, 81, 0, 12, 7, 66, 0, 12, 7, 82, 0,252, 7, 83, - 0, 0, 7, 84, 0, 0, 7, 85, 1, 1, 0, 4, 0, 7, 7, 86, 0, 7, 0,113, 0, 2, 7, 87, 0, 2, 7, 88, 1, 2, 0, 6, - 0, 7, 7, 89, 0, 7, 7, 90, 0, 7, 7, 91, 0, 7, 7, 92, 0, 4, 7, 93, 0, 4, 7, 94, 1, 3, 0, 12, 0, 7, 7, 95, - 0, 7, 7, 96, 0, 7, 7, 97, 0, 7, 7, 98, 0, 7, 7, 99, 0, 7, 7,100, 0, 7, 7,101, 0, 7, 7,102, 0, 7, 7,103, - 0, 7, 7,104, 0, 4, 2,153, 0, 4, 7,105, 1, 4, 0, 2, 0, 7, 4,208, 0, 7, 0, 37, 1, 5, 0, 5, 0, 7, 7,106, - 0, 7, 7,107, 0, 4, 0, 94, 0, 4, 2,115, 0, 4, 7,108, 1, 6, 0, 6, 1, 6, 0, 0, 1, 6, 0, 1, 0, 2, 0, 17, - 0, 2, 0, 19, 0, 2, 7,109, 0, 2, 0, 57, 1, 7, 0, 8, 1, 7, 0, 0, 1, 7, 0, 1, 0, 2, 0, 17, 0, 2, 0, 19, - 0, 2, 7,109, 0, 2, 0, 57, 0, 7, 0, 23, 0, 7, 0,131, 1, 8, 0, 45, 1, 8, 0, 0, 1, 8, 0, 1, 0, 2, 0, 17, - 0, 2, 0, 19, 0, 2, 7,109, 0, 2, 0,214, 0, 2, 3,164, 0, 2, 7,110, 0, 7, 7,111, 0, 7, 0, 93, 0, 7, 2,166, - 0, 4, 7,112, 0, 4, 0, 82, 0, 4, 2,117, 0, 7, 7,113, 0, 7, 7,114, 0, 7, 7,115, 0, 7, 7,116, 0, 7, 7,117, - 0, 7, 7,118, 0, 7, 2,163, 0, 7, 1, 0, 0, 7, 7,119, 0, 7, 7,120, 0, 7, 0, 37, 0, 7, 7,121, 0, 7, 7,122, - 0, 7, 7,123, 0, 2, 7,124, 0, 2, 7,125, 0, 2, 7,126, 0, 2, 7,127, 0, 2, 7,128, 0, 2, 7,129, 0, 2, 7,130, - 0, 2, 7,131, 0, 2, 5,127, 0, 2, 7,132, 0, 2, 1,210, 0, 2, 7,133, 0, 0, 7,134, 0, 0, 7,135, 0, 7, 0,212, - 1, 9, 7,136, 0, 65, 1,163, 1, 10, 0, 16, 1, 10, 0, 0, 1, 10, 0, 1, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 7,109, - 0, 2, 0,214, 0, 7, 2,158, 0, 7, 2,159, 0, 7, 2,160, 0, 7, 1,254, 0, 7, 2,161, 0, 7, 2,162, 0, 7, 7,137, - 0, 7, 2,163, 0, 7, 2,165, 0, 7, 2,166, 0,211, 0, 5, 0, 2, 0, 17, 0, 2, 7, 26, 0, 2, 0, 19, 0, 2, 7,138, - 0, 27, 5,240, 0,210, 0, 3, 0, 4, 0, 69, 0, 4, 7,139, 0,211, 0, 2, 1, 11, 0, 11, 1, 11, 0, 0, 1, 11, 0, 1, - 0, 0, 0, 20, 0, 2, 0, 17, 0, 2, 7,140, 0, 4, 0, 22, 0, 4, 7,141, 0, 2, 0, 19, 0, 2, 0, 37, 0, 9, 7,142, - 0, 9, 7,143, 1, 12, 0, 5, 0, 0, 0, 20, 0, 7, 1, 20, 0, 7, 7,144, 0, 4, 7,145, 0, 4, 0, 37, 1, 13, 0, 4, - 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0, 43, 0, 2, 0, 70, 1, 14, 0, 4, 0, 0, 0, 20, 0, 64, 7,146, 0, 7, 1, 20, - 0, 7, 0, 37, 1, 15, 0, 6, 0, 2, 7,147, 0, 2, 7,148, 0, 2, 0, 17, 0, 2, 7,149, 0, 0, 7,150, 0, 0, 7,151, - 1, 16, 0, 5, 0, 4, 0, 17, 0, 4, 0, 37, 0, 0, 0, 20, 0, 0, 7,152, 0, 0, 7,153, 1, 17, 0, 3, 0, 4, 0, 17, - 0, 4, 0, 37, 0, 0, 0, 20, 1, 18, 0, 4, 0, 2, 7,154, 0, 2, 7,155, 0, 2, 0, 19, 0, 2, 0, 37, 1, 19, 0, 6, - 0, 0, 0, 20, 0, 0, 7,156, 0, 2, 7,157, 0, 2, 2,163, 0, 2, 1, 13, 0, 2, 0, 70, 1, 20, 0, 5, 0, 0, 0, 20, - 0, 7, 0,113, 0, 7, 3,248, 0, 2, 0, 19, 0, 2, 2,129, 1, 21, 0, 3, 0, 0, 0, 20, 0, 4, 2,117, 0, 4, 7,154, - 1, 22, 0, 7, 0, 0, 0, 20, 0, 7, 3,248, 0, 0, 7,158, 0, 0, 7,159, 0, 2, 1, 13, 0, 2, 0, 43, 0, 4, 7,160, - 1, 23, 0, 3, 0, 32, 7,161, 0, 0, 7,162, 0, 0, 7,163, 1, 24, 0, 17, 1, 24, 0, 0, 1, 24, 0, 1, 0, 2, 0, 17, - 0, 2, 7,140, 0, 2, 0, 19, 0, 2, 7,164, 0, 2, 7,165, 0, 2, 7,166, 0, 2, 0, 43, 0, 2, 0, 70, 0, 0, 0, 20, - 0, 9, 0, 2, 1, 25, 7,167, 0, 32, 0, 45, 0, 2, 4,217, 0, 2, 7, 69, 0, 4, 0, 37, 1, 26, 0, 11, 0, 0, 0, 20, - 0, 0, 0, 17, 0, 0, 7,168, 0, 2, 0, 19, 0, 2, 2,129, 0, 2, 7,169, 0, 4, 7,170, 0, 4, 7,171, 0, 4, 7,172, - 0, 4, 7,173, 0, 4, 7,174, 1, 27, 0, 1, 0, 0, 7,175, 1, 28, 0, 1, 0, 43, 5,213, 1, 25, 0, 18, 1, 25, 0, 0, - 1, 25, 0, 1, 1, 25, 7,176, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 7,177, 0, 2, 7,166, 0, 2, 7,140, 0, 2, 7,178, - 0, 2, 0, 70, 0, 2, 1,160, 0, 0, 0, 20, 0, 9, 0, 2, 1, 29, 7,167, 1, 24, 7,179, 0, 2, 0, 15, 0, 2, 7,180, - 0, 4, 7,181, 1, 30, 0, 3, 0, 4, 2,189, 0, 4, 0, 37, 0, 32, 0, 45, 1, 31, 0, 12, 0,152, 7,182, 0, 2, 0, 17, - 0, 2, 0, 19, 0, 4, 7,111, 0, 4, 0, 93, 0, 0, 0, 20, 0, 0, 7,183, 0, 2, 7,184, 0, 2, 7,185, 0, 2, 7,186, - 0, 2, 7,187, 0, 7, 7,188, 1, 32, 0, 10, 0, 2, 0, 19, 0, 2, 7,189, 0, 4, 7,111, 0, 4, 0, 93, 0, 2, 7,190, - 0,253, 7, 67, 0, 2, 0, 17, 0, 2, 7,191, 0, 2, 7,192, 0, 2, 7,193, 1, 33, 0, 7, 0, 2, 0, 19, 0, 2, 7,189, - 0, 4, 7,111, 0, 4, 0, 93, 0, 2, 0, 17, 0, 2, 7,194, 0, 7, 3,124, 1, 34, 0, 11, 0, 4, 2,189, 0, 2, 0, 17, - 0, 2, 0, 19, 0, 32, 0, 45, 0, 78, 7,195, 0, 0, 0, 20, 0, 7, 7,196, 0, 7, 7,197, 0, 7, 3, 37, 0, 2, 7,198, - 0, 2, 7,199, 1, 35, 0, 5, 0, 2, 0, 17, 0, 2, 0, 19, 0, 4, 0, 37, 0, 47, 0,139, 0, 32, 5, 47, 1, 36, 0, 5, - 0, 4, 0, 19, 0, 4, 0, 17, 0, 0, 0, 20, 0, 0, 7,152, 0, 32, 0, 45, 1, 37, 0, 12, 0, 2, 0, 19, 0, 2, 0, 17, - 0, 2, 7,140, 0, 2, 3, 38, 0, 7, 7,200, 0, 7, 7,201, 0, 7, 1, 8, 0, 7, 1, 9, 0, 7, 3, 13, 0, 7, 3, 16, - 0, 7, 7,202, 0, 7, 7,203, 1, 38, 0, 10, 0, 2, 0, 19, 0, 2, 0, 17, 0, 4, 7,111, 0, 4, 0, 93, 0, 0, 0, 20, - 0, 0, 7,183, 0, 2, 0, 43, 0, 2, 0, 64, 0, 2, 7,204, 0, 2, 7,205, 1, 39, 0, 8, 0, 32, 0, 45, 0, 7, 2,160, - 0, 7, 7,206, 0, 7, 7,207, 0, 7, 2,155, 0, 2, 0, 19, 0, 2, 2,129, 0, 7, 7,208, 1, 40, 0, 12, 0, 2, 0, 17, - 0, 2, 1, 13, 0, 2, 0, 19, 0, 2, 2,163, 0, 2, 2,189, 0, 2, 7,209, 0, 4, 0, 37, 0, 7, 7,210, 0, 7, 7,211, - 0, 7, 7,212, 0, 7, 7,213, 0, 0, 7,214, 1, 41, 0, 10, 0, 2, 0, 19, 0, 2, 0, 17, 0, 4, 7,111, 0, 4, 0, 93, - 0, 0, 0, 20, 0, 2, 2, 77, 0, 2, 0, 64, 0, 2, 7,204, 0, 2, 7,205, 0, 65, 1,163, 1, 42, 0, 7, 0, 4, 2,117, - 0, 4, 7,215, 0, 4, 7,216, 0, 4, 7,217, 0, 7, 7,218, 0, 7, 7,219, 0, 0, 7,158, 1, 43, 0, 7, 0, 0, 7,220, - 0, 32, 7,221, 0, 0, 7,162, 0, 2, 7,222, 0, 2, 0, 43, 0, 4, 0, 70, 0, 0, 7,163, 1, 44, 0, 6, 0, 2, 0, 19, - 0, 2, 0, 17, 0, 4, 7,111, 0, 4, 0, 93, 0, 0, 7,223, 0, 0, 7,224, 1, 45, 0, 1, 0, 4, 0, 19, 1, 46, 0, 6, - 0, 0, 0, 96, 0, 2, 0, 17, 0, 2, 0, 19, 0, 4, 7,225, 0, 7, 7,226, 0, 43, 5,213, 1, 47, 0, 3, 0, 0, 0, 96, - 0, 4, 0, 17, 0, 32, 0, 45, 1, 48, 0, 2, 0, 4, 0, 17, 0, 4, 5,152, 1, 29, 0, 10, 1, 29, 0, 0, 1, 29, 0, 1, - 1, 29, 7,176, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 7,140, 0, 2, 7,227, 0, 0, 0, 20, 0, 9, 0, 2, 0, 32, 0, 45, - 1, 49, 0, 10, 0, 7, 3, 37, 0, 7, 7,228, 0, 7, 7,229, 0, 7, 7,230, 0, 7, 7,231, 0, 4, 0, 19, 0, 7, 7,209, - 0, 7, 7,232, 0, 7, 7,233, 0, 7, 0, 37, 0,253, 0, 20, 0, 27, 0, 31, 0, 0, 0,194, 1, 50, 7,234, 0, 9, 7,235, - 0, 44, 0,154, 0, 44, 7,236, 0, 9, 7,237, 0, 36, 0, 80, 0, 7, 3,124, 0, 7, 7,238, 0, 7, 7,239, 0, 7, 7,240, - 0, 7, 7,241, 0, 7, 7,242, 0, 7, 7,243, 0, 4, 0, 94, 0, 4, 7,244, 0, 0, 7,245, 0, 0, 7,246, 0, 0, 7,247, - 1, 51, 0, 6, 0, 27, 0, 31, 0, 7, 7,248, 0, 7, 7,249, 0, 7, 7,250, 0, 2, 7,251, 0, 2, 7,252, 1, 52, 0, 15, - 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, 0, 4, 5,116, 0, 7, 5,117, 0,239, 7,253, 0,197, 5,169, 0,253, 7, 67, - 0, 2, 1, 13, 0, 2, 7,189, 0, 2, 2, 13, 0, 2, 2, 14, 0, 2, 0, 19, 0, 2, 5,174, 0, 4, 0, 70, 1, 53, 0, 6, - 1, 53, 0, 0, 1, 53, 0, 1, 0, 32, 0, 45, 0, 9, 7,254, 0, 4, 0,219, 0, 4, 0, 37, 0, 65, 0, 4, 0, 27, 0, 31, - 0, 12, 7,255, 0, 4, 0,136, 0, 7, 8, 0, 1, 54, 0, 25, 1, 54, 0, 0, 1, 54, 0, 1, 1, 54, 0, 38, 0, 12, 8, 1, - 0, 0, 0, 20, 0, 7, 8, 2, 0, 7, 8, 3, 0, 7, 8, 4, 0, 7, 8, 5, 0, 4, 0, 19, 0, 7, 8, 6, 0, 7, 8, 7, - 0, 7, 8, 8, 0, 7, 1, 20, 0, 7, 1,219, 0, 7, 8, 9, 0, 7, 2,115, 0, 7, 8, 10, 0, 7, 8, 11, 0, 7, 8, 12, - 0, 7, 8, 13, 0, 7, 8, 14, 0, 7, 0,176, 0, 2, 0,136, 0, 2, 4,245, 1, 55, 0, 20, 0, 27, 0, 31, 0, 12, 8, 15, - 0, 12, 8, 16, 0, 12, 8, 17, 0, 4, 0, 19, 0, 4, 4, 35, 0, 2, 2,167, 0, 2, 8, 18, 0, 2, 0,136, 0, 2, 8, 19, - 0, 2, 8, 20, 0, 2, 8, 21, 0, 2, 8, 22, 0, 2, 8, 23, 0, 4, 8, 24, 0, 4, 8, 25, 0, 4, 8, 26, 0, 4, 8, 27, - 0, 4, 8, 28, 0, 4, 8, 29, 1, 56, 0, 38, 1, 56, 0, 0, 1, 56, 0, 1, 0, 26, 8, 30, 0, 12, 3, 64, 0, 0, 0, 20, - 0, 2, 0, 19, 0, 2, 8, 31, 0, 2, 8, 32, 0, 2, 8, 33, 0, 2, 3, 22, 0, 2, 8, 34, 0, 4, 1,252, 0, 4, 8, 26, - 0, 4, 8, 27, 1, 54, 8, 35, 1, 56, 0, 38, 1, 56, 8, 36, 0, 12, 8, 37, 0, 9, 8, 38, 0, 9, 8, 39, 0, 9, 8, 40, - 0, 7, 1, 8, 0, 7, 0,176, 0, 7, 8, 41, 0, 7, 1,200, 0, 2, 8, 42, 0, 2, 0, 37, 0, 7, 8, 43, 0, 7, 8, 44, - 0, 7, 3, 18, 0, 7, 8, 45, 0, 7, 8, 46, 0, 7, 8, 47, 0, 7, 8, 48, 0, 7, 8, 49, 0, 7, 8, 50, 0, 7, 1,249, - 0, 32, 8, 51, 0,153, 0, 9, 0, 12, 8, 52, 0, 2, 0, 19, 0, 2, 8, 53, 0, 7, 3, 36, 0, 7, 8, 54, 0, 7, 8, 55, - 0, 12, 8, 56, 0, 4, 8, 57, 0, 4, 0, 37, 1, 57, 0, 7, 1, 57, 0, 0, 1, 57, 0, 1, 0, 12, 7,245, 0, 4, 0, 19, - 0, 4, 8, 58, 0, 0, 4,210, 0,226, 8, 59, 0,152, 0, 7, 0, 27, 0, 31, 0, 12, 8, 60, 0, 12, 8, 52, 0, 12, 8, 61, - 0, 12, 0,104, 0, 4, 0, 19, 0, 4, 8, 62, 0,201, 0, 4, 0, 27, 8, 63, 0, 12, 8, 52, 0, 4, 8, 64, 0, 4, 0, 19, - 1, 58, 0, 17, 0,196, 0, 0, 0,196, 0, 1, 0, 12, 5,115, 0, 4, 5,116, 0, 7, 5,117, 0, 2, 5,118, 0,197, 5,169, - 0,152, 3, 7, 0,201, 8, 65, 0, 0, 1, 13, 0, 0, 5,172, 0, 2, 0, 19, 0, 2, 8, 66, 0, 2, 5,173, 0, 2, 5,174, - 0, 2, 8, 67, 0, 7, 8, 68, 1, 59, 0, 8, 1, 59, 0, 0, 1, 59, 0, 1, 1, 57, 8, 69, 0, 36, 0, 80, 0, 12, 3, 10, - 0, 4, 0, 19, 0, 0, 0, 20, 0, 4, 8, 70, 1, 60, 0, 5, 1, 60, 0, 0, 1, 60, 0, 1, 0, 36, 0, 80, 0, 2, 0, 19, - 0, 0, 8, 71, 1, 61, 0, 12, 1, 61, 0, 0, 1, 61, 0, 1, 0, 9, 0, 2, 0, 2, 0, 17, 0, 2, 0, 19, 0, 0, 8, 72, - 0, 0, 8, 73, 0, 0, 8, 71, 0, 7, 8, 74, 0, 7, 8, 75, 0, 4, 0, 37, 0, 36, 0, 80, 1, 62, 0, 9, 1, 62, 0, 0, - 1, 62, 0, 1, 0, 32, 8, 76, 0, 0, 8, 77, 0, 7, 8, 78, 0, 2, 8, 79, 0, 2, 0, 19, 0, 2, 0, 17, 0, 2, 0, 37, - 1, 63, 0, 7, 0, 43, 5,213, 0, 26, 8, 30, 0, 4, 0, 19, 0, 4, 8, 80, 0, 12, 8, 81, 0, 32, 8, 76, 0, 0, 8, 77, - 1, 64, 0, 12, 0, 32, 8, 76, 0, 2, 8, 82, 0, 2, 0, 19, 0, 2, 8, 83, 0, 2, 8, 84, 0, 0, 8, 77, 0, 32, 8, 85, - 0, 0, 8, 86, 0, 7, 8, 87, 0, 7, 1,219, 0, 7, 8, 88, 0, 7, 8, 89, 1, 65, 0, 6, 0, 32, 8, 76, 0, 4, 8, 90, - 0, 4, 8, 91, 0, 4, 0, 94, 0, 4, 0, 37, 0, 0, 8, 77, 1, 66, 0, 4, 0, 32, 8, 76, 0, 4, 0, 19, 0, 4, 8, 90, - 0, 0, 8, 77, 1, 67, 0, 4, 0, 32, 8, 76, 0, 4, 0, 19, 0, 4, 8, 90, 0, 0, 8, 77, 1, 68, 0, 10, 0, 32, 8, 76, - 0, 4, 8, 92, 0, 7, 0,130, 0, 4, 0, 19, 0, 2, 5,209, 0, 2, 8, 93, 0, 2, 0, 43, 0, 2, 0, 70, 0, 7, 8, 94, - 0, 0, 8, 77, 1, 69, 0, 4, 0, 32, 8, 76, 0, 4, 0, 19, 0, 4, 8, 90, 0, 0, 8, 77, 1, 70, 0, 10, 0, 32, 8, 76, - 0, 2, 0, 17, 0, 2, 3,170, 0, 4, 0, 92, 0, 4, 0, 93, 0, 7, 7,206, 0, 7, 7,207, 0, 4, 0, 37, 0,152, 7,182, - 0, 0, 8, 77, 1, 71, 0, 4, 0, 32, 8, 76, 0, 4, 3, 23, 0, 4, 8, 95, 0, 0, 8, 77, 1, 72, 0, 5, 0, 32, 8, 76, - 0, 7, 0,130, 0, 4, 8, 96, 0, 4, 3, 23, 0, 4, 3, 24, 1, 73, 0, 6, 0, 32, 8, 76, 0, 4, 8, 97, 0, 4, 8, 98, - 0, 7, 8, 99, 0, 7, 8,100, 0, 0, 8, 77, 1, 74, 0, 16, 0, 32, 8, 76, 0, 32, 8, 36, 0, 4, 0, 17, 0, 7, 8,101, - 0, 7, 8,102, 0, 7, 8,103, 0, 7, 8,104, 0, 7, 8,105, 0, 7, 8,106, 0, 7, 8,107, 0, 7, 8,108, 0, 7, 8,109, - 0, 2, 0, 19, 0, 2, 0, 37, 0, 2, 0, 43, 0, 2, 0, 70, 1, 75, 0, 3, 0, 32, 8, 76, 0, 4, 0, 19, 0, 4, 5,127, - 1, 76, 0, 5, 0, 32, 8, 76, 0, 4, 0, 19, 0, 4, 0, 37, 0, 7, 8,110, 0, 0, 8, 77, 1, 77, 0, 10, 0, 32, 8, 76, - 0, 0, 8, 77, 0, 2, 8,111, 0, 2, 8,112, 0, 0, 8,113, 0, 0, 8,114, 0, 7, 8,115, 0, 7, 8,116, 0, 7, 8,117, - 0, 7, 8,118, 1, 78, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 12, 0, 7, 8,119, 0, 7, 8,120, - 0, 2, 0, 19, 0, 2, 5,127, 1, 79, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 12, 0, 7, 8,119, - 0, 7, 8,120, 0, 2, 0, 19, 0, 2, 5,127, 1, 80, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 12, - 0, 7, 8,119, 0, 7, 8,120, 0, 2, 0, 19, 0, 2, 5,127, 1, 81, 0, 7, 0, 32, 8, 76, 0, 0, 8, 77, 0, 7, 1, 20, - 0, 7, 1, 30, 0, 2, 0, 19, 0, 2, 1, 13, 0, 4, 0, 37, 1, 82, 0, 5, 0, 32, 2,224, 0, 7, 1, 20, 0, 2, 2,228, - 0, 0, 2,230, 0, 0, 8,121, 1, 83, 0, 10, 1, 83, 0, 0, 1, 83, 0, 1, 0, 2, 0, 17, 0, 2, 0, 19, 0, 0, 8,122, - 0, 7, 0,221, 0, 7, 0,222, 0, 2, 7,245, 0, 2, 8,123, 0, 32, 0, 45, 1, 84, 0, 22, 1, 84, 0, 0, 1, 84, 0, 1, - 0, 2, 0, 19, 0, 2, 1, 13, 0, 2, 8,124, 0, 2, 8,125, 0, 36, 0, 80, 0,152, 7,182, 0, 32, 0,168, 0, 7, 0, 92, - 0, 7, 0, 93, 0, 7, 8,126, 0, 7, 8,127, 0, 7, 8,128, 0, 7, 8,129, 0, 7, 2,156, 0, 7, 8,130, 0, 7, 7,184, - 0, 7, 8,131, 0, 0, 8,132, 0, 0, 8,133, 0, 12, 3, 12, 1, 85, 0, 8, 0, 7, 1,227, 0, 7, 7,206, 0, 7, 7,207, - 0, 9, 0, 2, 0, 2, 8,134, 0, 2, 8,135, 0, 2, 8,136, 0, 2, 8,137, 1, 86, 0, 18, 1, 86, 0, 0, 1, 86, 0, 1, - 1, 86, 8,138, 0, 0, 0, 20, 1, 85, 8,139, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 8,140, 0, 2, 8,141, 0, 2, 8,142, - 0, 2, 8,143, 0, 4, 0, 43, 0, 7, 8,144, 0, 7, 8,145, 0, 4, 8,146, 0, 4, 8,147, 1, 86, 8,148, 1, 87, 8,149, - 1, 88, 0, 33, 1, 88, 0, 0, 1, 88, 0, 1, 1, 88, 8,150, 0, 0, 0, 20, 0, 0, 8,151, 0, 2, 0, 17, 0, 2, 0, 19, - 0, 2, 7, 36, 0, 2, 7, 69, 0, 2, 8,152, 0, 2, 0,138, 0, 2, 8,141, 0, 2, 7, 26, 0, 12, 7,177, 0, 12, 8,153, - 0, 27, 5,240, 0, 9, 8,154, 0, 7, 8,144, 0, 7, 8,145, 0, 7, 1,254, 0, 7, 8,155, 0, 2, 8,156, 0, 2, 8,157, - 0, 7, 8,158, 0, 7, 8,159, 0, 2, 8,160, 0, 2, 8,161, 0, 9, 8,162, 0, 24, 8,163, 0, 24, 8,164, 0, 24, 8,165, - 1, 89, 0,155, 1, 90, 8,166, 1, 87, 0, 8, 1, 87, 0, 0, 1, 87, 0, 1, 1, 88, 8,167, 1, 88, 8,168, 1, 86, 8,169, - 1, 86, 8,148, 0, 4, 0, 19, 0, 4, 0, 37, 0, 59, 0, 20, 0, 27, 0, 31, 0, 39, 0, 75, 0, 12, 8,170, 0, 12, 8,171, - 1, 85, 8,172, 0, 12, 8,173, 0, 4, 0, 17, 0, 4, 8,174, 0, 4, 8,175, 0, 4, 8,176, 0, 12, 8,177, 1, 90, 8,178, - 1, 86, 8,179, 1, 86, 8,180, 0, 9, 8,181, 0, 9, 8,182, 0, 4, 8,183, 0, 9, 8,184, 0, 9, 8,185, 0, 9, 8,186, - 1, 91, 0, 6, 0, 4, 0,129, 0, 4, 0,131, 0, 4, 7, 26, 0, 0, 8,187, 0, 0, 8,188, 0, 2, 0, 37, 1, 92, 0, 16, - 0, 2, 6,239, 0, 2, 6,240, 0, 2, 8,189, 0, 2, 7,229, 0, 2, 8,190, 0, 2, 0, 68, 0, 7, 2,155, 0, 7, 8,191, - 0, 7, 8,192, 0, 2, 1, 34, 0, 0, 8,193, 0, 0, 4, 47, 0, 2, 8,194, 0, 2, 0, 37, 0, 4, 8,195, 0, 4, 8,196, - 1, 93, 0, 9, 0, 7, 8,197, 0, 7, 8,198, 0, 7, 7,243, 0, 7, 0,113, 0, 7, 8,199, 0, 7, 5, 80, 0, 2, 8,200, - 0, 0, 8,201, 0, 0, 0, 37, 1, 94, 0, 4, 0, 7, 8,202, 0, 7, 8,203, 0, 2, 8,200, 0, 2, 0, 37, 1, 95, 0, 3, - 0, 7, 8,204, 0, 7, 8,205, 0, 7, 0, 15, 1, 96, 0, 7, 0, 0, 1,190, 0, 2, 4,115, 0, 2, 4,116, 0, 2, 4,117, - 0, 2, 4, 67, 0, 4, 0,131, 0, 4, 3,168, 1, 97, 0, 7, 0, 7, 8,206, 0, 7, 8,207, 0, 7, 8,208, 0, 7, 2, 9, - 0, 7, 8,209, 0, 7, 8,210, 0, 7, 8,211, 1, 98, 0, 4, 0, 2, 8,212, 0, 2, 8,213, 0, 2, 8,214, 0, 2, 8,215, - 1, 99, 0, 2, 0, 7, 0, 5, 0, 7, 0, 6, 1,100, 0, 2, 0, 0, 0,170, 0, 0, 8,216, 1,101, 0, 1, 0, 0, 0, 20, - 1,102, 0, 10, 0, 0, 8,217, 0, 0, 8,218, 0, 0, 8,219, 0, 0, 8,220, 0, 2, 8,189, 0, 2, 8,221, 0, 7, 8,222, - 0, 7, 8,223, 0, 7, 8,224, 0, 7, 8,130, 1,103, 0, 2, 0, 9, 8,225, 0, 9, 8,226, 1,104, 0, 11, 0, 0, 4,117, - 0, 0, 0, 17, 0, 0, 8,200, 0, 0, 0,113, 0, 0, 8,227, 0, 0, 0,110, 0, 0, 0,183, 0, 7, 8,228, 0, 7, 8,229, - 0, 7, 8,230, 0, 7, 8,231, 1,105, 0, 8, 0, 7, 7,147, 0, 7, 0,130, 0, 7, 4, 47, 0, 7, 2, 81, 0, 7, 8,232, - 0, 7, 0,208, 0, 7, 8,233, 0, 4, 0, 17, 1,106, 0, 4, 0, 2, 8,234, 0, 2, 8,235, 0, 2, 8,236, 0, 2, 0, 37, - 1,107, 0, 1, 0, 0, 0, 20, 1,108, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 2, 0, 19, 0, 2, 8,237, 1,109, 0, 10, - 0, 2, 3,150, 0, 2, 0, 19, 0, 7, 3,248, 0, 7, 8,238, 0, 7, 8,239, 0, 7, 8,240, 0, 7, 8,241, 1,108, 8,242, - 1,108, 8,243, 1,108, 8,244, 0, 62, 0, 9, 0, 4, 0, 19, 0, 4, 0, 64, 0, 24, 8,245, 0, 24, 8,246, 1,109, 8,247, - 0, 7, 8,248, 0, 7, 8,249, 0, 7, 8,250, 0, 7, 8,251, 1,110, 0, 4, 0, 48, 2,149, 0, 7, 8,252, 0, 7, 1, 93, - 0, 7, 0, 37, 0,176, 0, 17, 0, 27, 0, 31, 1,110, 8,253, 0, 62, 8,242, 0, 52, 1, 77, 0, 2, 0, 19, 0, 2, 5, 81, - 0, 4, 0,110, 0, 7, 8,254, 0, 7, 2, 6, 0, 7, 8,255, 0, 7, 9, 0, 0, 7, 1, 93, 0, 7, 9, 1, 0, 2, 1, 47, - 0, 0, 9, 2, 0, 0, 3,112, 0, 0, 0, 96, 1,111, 0, 10, 0, 4, 0, 17, 0, 4, 0,130, 0, 4, 0, 19, 0, 4, 3, 85, - 0, 4, 9, 3, 0, 4, 9, 4, 0, 4, 9, 5, 0, 0, 0, 96, 0, 0, 0, 20, 0, 9, 0, 2, 0, 89, 0, 6, 1,111, 9, 6, - 0, 4, 9, 7, 0, 4, 9, 8, 0, 4, 9, 9, 0, 4, 0, 37, 0, 9, 9, 10, 1,112, 0, 5, 0, 7, 2, 75, 0, 7, 2,189, - 0, 7, 1,219, 0, 2, 9, 11, 0, 2, 0, 37, 1,113, 0, 5, 0, 7, 2, 75, 0, 7, 9, 12, 0, 7, 9, 13, 0, 7, 9, 14, - 0, 7, 2,189, 1,114, 0, 7, 0, 4, 9, 15, 0, 4, 9, 16, 0, 4, 9, 17, 0, 7, 9, 18, 0, 7, 9, 19, 0, 7, 9, 20, - 0, 7, 9, 21, 1,115, 0, 26, 0, 32, 9, 22, 1,113, 3, 81, 1,113, 9, 23, 1,112, 9, 24, 1,113, 7,136, 0, 7, 9, 25, - 0, 7, 9, 26, 0, 7, 9, 27, 0, 7, 9, 28, 0, 7, 9, 19, 0, 7, 9, 20, 0, 7, 2,189, 0, 7, 2,166, 0, 7, 9, 29, - 0, 7, 9, 30, 0, 7, 0,110, 0, 7, 9, 31, 0, 4, 9, 15, 0, 4, 9, 32, 0, 4, 0, 37, 0, 4, 0, 82, 0, 4, 9, 33, - 0, 2, 0, 19, 0, 2, 9, 34, 0, 2, 9, 35, 0, 2, 3,115, 1,116, 0,112, 0, 27, 0, 31, 0, 4, 0, 19, 0, 2, 0, 17, - 0, 2, 8,111, 0, 2, 9, 36, 0, 2, 9, 37, 0, 2, 8, 42, 0, 2, 9, 38, 0, 2, 9, 39, 0, 2, 9, 40, 0, 2, 9, 41, - 0, 2, 9, 42, 0, 2, 9, 43, 0, 2, 9, 44, 0, 2, 9, 45, 0, 2, 9, 46, 0, 2, 9, 47, 0, 2, 9, 48, 0, 2, 9, 49, - 0, 2, 1,210, 0, 2, 7,129, 0, 2, 7,105, 0, 2, 9, 50, 0, 2, 9, 51, 0, 2, 3,113, 0, 2, 3,114, 0, 2, 9, 52, - 0, 2, 9, 53, 0, 2, 9, 54, 0, 2, 9, 55, 0, 2, 9, 56, 0, 2, 9, 57, 0, 7, 9, 58, 0, 7, 9, 59, 0, 7, 9, 60, - 0, 2, 9, 61, 0, 2, 9, 62, 0, 7, 9, 63, 0, 7, 9, 64, 0, 7, 9, 65, 0, 7, 7,111, 0, 7, 0, 93, 0, 7, 2,166, - 0, 7, 7,117, 0, 7, 9, 66, 0, 7, 9, 67, 0, 7, 9, 68, 0, 7, 9, 69, 0, 7, 0, 57, 0, 4, 7,112, 0, 4, 7,110, - 0, 4, 9, 70, 0, 7, 7,113, 0, 7, 7,114, 0, 7, 7,115, 0, 7, 9, 71, 0, 7, 9, 72, 0, 7, 9, 73, 0, 7, 9, 74, - 0, 7, 9, 75, 0, 7, 9, 76, 0, 7, 9, 77, 0, 7, 9, 78, 0, 7, 3, 37, 0, 7, 0,110, 0, 7, 9, 79, 0, 7, 9, 80, - 0, 7, 9, 81, 0, 7, 9, 82, 0, 7, 9, 83, 0, 7, 9, 84, 0, 7, 2,115, 0, 7, 9, 85, 0, 7, 9, 86, 0, 4, 9, 87, - 0, 4, 9, 88, 0, 7, 9, 89, 0, 7, 9, 90, 0, 7, 9, 91, 0, 7, 9, 92, 0, 7, 9, 93, 0, 7, 9, 94, 0, 7, 9, 95, - 0, 7, 9, 96, 0, 7, 3,109, 0, 7, 3,107, 0, 7, 3,108, 0, 7, 9, 97, 0, 7, 9, 98, 0, 7, 9, 99, 0, 7, 9,100, - 0, 7, 9,101, 0, 7, 9,102, 0, 7, 9,103, 0, 7, 9,104, 0, 7, 9,105, 0, 7, 3, 44, 0, 7, 9,106, 0, 7, 9,107, - 0, 7, 9,108, 0, 7, 9,109, 0, 7, 9,110, 0, 7, 9,111, 0, 7, 9,112, 0, 0, 9,113, 0, 65, 3, 70, 0, 65, 9,114, - 0, 32, 9,115, 0, 32, 9,116, 0, 36, 0, 80, 0,155, 3, 68, 0,155, 9,117, 0,142, 0, 38, 0,142, 0, 0, 0,142, 0, 1, - 1,116, 9,118, 1,115, 3,149, 1,114, 8, 36, 1,117, 9,119, 0, 9, 9,120, 1,118, 9,121, 1,118, 9,122, 0, 12, 9,123, - 0, 12, 9,124, 0,156, 3, 69, 0, 32, 9,125, 0, 32, 9,126, 0, 32, 9,127, 0, 12, 9,128, 0, 12, 9,129, 0, 7, 0,212, - 0, 7, 4, 89, 0, 4, 2,117, 0, 4, 0, 19, 0, 4, 7,112, 0, 4, 9,130, 0, 4, 9,131, 0, 4, 9,132, 0, 4, 0, 57, - 0, 2, 0,219, 0, 2, 9,133, 0, 2, 9,134, 0, 2, 9,135, 0, 2, 3, 62, 0, 2, 9,136, 0, 0, 9,137, 0, 2, 9,138, - 0, 2, 9,139, 0, 2, 9,140, 0, 9, 9,141, 0,131, 3,189, 0,129, 0, 34, 1,119, 9,142, 0, 7, 3,161, 0, 7, 9,143, - 0, 7, 9,144, 0, 7, 3,251, 0, 7, 9,145, 0, 7, 3, 46, 0, 7, 3, 37, 0, 7, 9,146, 0, 7, 2, 8, 0, 7, 9,147, - 0, 7, 9,148, 0, 7, 9,149, 0, 7, 9,150, 0, 7, 9,151, 0, 7, 9,152, 0, 7, 3,162, 0, 7, 9,153, 0, 7, 9,154, - 0, 7, 9,155, 0, 7, 3,163, 0, 7, 3,159, 0, 7, 3,160, 0, 4, 9,156, 0, 4, 0, 94, 0, 4, 9,157, 0, 4, 9,158, - 0, 2, 9,159, 0, 2, 9,160, 0, 2, 9,161, 0, 2, 9,162, 0, 2, 9,163, 0, 2, 0, 37, 0, 4, 0, 70, 0,130, 0, 8, - 1,119, 9,164, 0, 7, 9,165, 0, 7, 9,166, 0, 7, 1,164, 0, 7, 9,167, 0, 4, 0, 94, 0, 2, 9,168, 0, 2, 9,169, - 1,120, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0, 7, 9,170, 1,121, 0, 6, 1,121, 0, 0, 1,121, 0, 1, - 1,120, 9,171, 0, 4, 9,172, 0, 2, 9,173, 0, 2, 0, 19, 1,122, 0, 5, 1,122, 0, 0, 1,122, 0, 1, 0, 12, 9,174, - 0, 4, 9,175, 0, 4, 0, 19, 1,123, 0, 9, 1,123, 0, 0, 1,123, 0, 1, 0, 12, 0,129, 1,122, 9,176, 0, 4, 0, 19, - 0, 2, 9,173, 0, 2, 9,177, 0, 7, 0, 95, 0, 0, 9,178, 0,189, 0, 6, 0, 27, 0, 31, 0, 12, 4,131, 0, 4, 0, 19, - 0, 2, 9,179, 0, 2, 9,180, 0, 9, 9,181, 1,124, 0, 13, 0, 27, 0, 31, 1,125, 9,182, 1,125, 9,183, 0, 12, 9,184, - 0, 4, 9,185, 0, 2, 9,186, 0, 2, 0, 37, 0, 12, 9,187, 0, 12, 9,188, 0, 12, 9,189, 0, 12, 9,190, 0, 12, 9,191, - 0, 12, 9,192, 1,125, 0, 29, 1,125, 0, 0, 1,125, 0, 1, 0, 9, 9,193, 0, 4, 6,218, 0, 4, 0, 37, 0,199, 5,168, - 0, 0, 9,194, 0, 2, 9,195, 0, 2, 9,196, 0, 2, 6,239, 0, 2, 6,240, 0, 2, 9,197, 0, 2, 9,198, 0, 2, 3, 85, - 0, 2, 6,253, 0, 2, 9,199, 0, 2, 0, 70, 0, 4, 1,160, 1,126, 9,200, 1,127, 9,201, 1,128, 9,202, 0, 4, 9,203, - 0, 4, 9,204, 0, 9, 9,205, 0, 12, 9,206, 0, 12, 9,188, 0, 12, 6,255, 0, 12, 9,207, 0, 12, 9,208, 1,129, 0, 12, - 1,129, 0, 0, 1,129, 0, 1, 0, 0, 9,209, 1,130, 9,210, 0, 2, 0, 17, 0, 2, 0, 15, 0, 2, 9,211, 0, 2, 9,212, - 0, 2, 9,213, 0, 2, 9,214, 0, 2, 9,215, 0, 2, 0, 37, 1,131, 0, 6, 1,131, 0, 0, 1,131, 0, 1, 0, 12, 9,216, - 0, 0, 9,217, 0, 4, 9,218, 0, 4, 9,219, 0,207, 0, 8, 0,207, 0, 0, 0,207, 0, 1, 0, 0, 9,209, 0, 26, 0, 30, - 1,132, 6,233, 0, 9, 9,220, 1,130, 9,210, 1,133, 9,221, 1,134, 0, 8, 1,134, 0, 0, 1,134, 0, 1, 0, 9, 0, 2, - 0, 9, 9,222, 0, 0, 4,210, 0, 2, 0, 17, 0, 2, 0, 19, 0, 7, 9,223, 1,135, 0, 8, 0, 0, 9,224, 0, 7, 9,225, - 0, 4, 9,226, 0, 2, 9,227, 0, 2, 9,228, 0, 4, 0, 37, 0, 2, 0, 19, 0, 2, 1, 13, 1,136, 0, 5, 0, 7, 7,206, - 0, 7, 7,207, 0, 7, 2,189, 0, 2, 1,223, 0, 2, 1,224, 1,137, 0, 5, 1,136, 0, 2, 0, 4, 0, 54, 0, 7, 9,229, - 0, 7, 7,206, 0, 7, 7,207, 1,138, 0, 4, 0, 2, 9,230, 0, 2, 9,231, 0, 2, 9,232, 0, 2, 9,233, 1,139, 0, 2, - 0, 43, 5,237, 0, 26, 8, 30, 1,140, 0, 3, 0, 24, 9,234, 0, 4, 0, 19, 0, 4, 0, 37, 1,141, 0, 6, 0, 7, 0,110, - 0, 7, 2,141, 0, 7, 9,235, 0, 7, 0, 37, 0, 2, 0,218, 0, 2, 9,236, 1,142, 0, 7, 1,142, 0, 0, 1,142, 0, 1, - 0, 27, 5,240, 0, 0, 9,237, 0, 4, 9,238, 0, 4, 0, 94, 0, 0, 4,210, 1,143, 0, 6, 0, 12, 8, 81, 0, 0, 9,224, - 0, 7, 0, 61, 0, 7, 9,223, 0, 4, 0, 17, 0, 4, 0, 19, 1,144, 0, 3, 0, 7, 9,239, 0, 4, 0, 19, 0, 4, 0, 37, - 1,145, 0, 15, 1,145, 0, 0, 1,145, 0, 1, 1, 57, 8, 69, 1,143, 0, 62, 0, 12, 3, 12, 0, 35, 0, 50, 1,144, 9,240, - 0, 4, 0, 54, 0, 7, 0, 61, 0, 2, 0, 19, 0, 2, 0,254, 0, 4, 9,238, 0, 0, 9,237, 0, 4, 9,241, 0, 7, 9,242, - 1,146, 0, 2, 0, 0, 9,243, 0, 0, 9,244, 1,147, 0, 4, 1,147, 0, 0, 1,147, 0, 1, 0,152, 2,224, 0, 12, 9,245, - 1,148, 0, 24, 1,148, 0, 0, 1,148, 0, 1, 0,152, 7,182, 1,147, 9,246, 0, 12, 3, 12, 0, 12, 9,247, 0, 7, 9,223, - 0, 7, 9,248, 0, 7, 0, 92, 0, 7, 0, 93, 0, 7, 8,126, 0, 7, 8,127, 0, 7, 2,156, 0, 7, 8,130, 0, 7, 7,184, - 0, 7, 8,131, 0, 4, 9,249, 0, 4, 0, 19, 0, 4, 8,124, 0, 4, 0, 37, 0, 7, 8,128, 0, 7, 8,129, 0, 0, 8,132, - 0, 0, 8,133, 1,149, 0, 6, 1,149, 0, 0, 1,149, 0, 1, 0, 12, 9,250, 0, 4, 0, 19, 0, 4, 2, 80, 0, 0, 9,251, - 1,150, 0, 10, 1,150, 0, 0, 1,150, 0, 1, 0, 27, 5,240, 0, 0, 9,252, 0, 4, 9,253, 0, 4, 9,254, 0, 0, 9,237, - 0, 4, 9,238, 0, 2, 0, 19, 0, 2, 9,255, 1,151, 0, 6, 1,151, 0, 0, 1,151, 0, 1, 0, 12, 10, 0, 0, 0, 4,210, - 0, 4, 0, 19, 0, 4, 10, 1, 1,152, 0, 5, 1,152, 0, 0, 1,152, 0, 1, 0, 0, 9,237, 0, 4, 9,238, 0, 7, 2,133, - 0, 39, 0, 7, 0,152, 3, 7, 1,147, 9,246, 0, 12, 10, 2, 0, 12, 10, 3, 0, 12, 10, 4, 0, 4, 0, 19, 0, 4, 0,219, - 1,153, 0, 2, 0, 27, 0, 31, 0, 39, 0, 75, 69, 78, 68, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 97,115,101, 0, 42,101,100, 98,111, 0,108, 97,121,101,114, 95,112,114,111,116,101, 99,116,101,100, 0,103,104,111,115,116,101, +112, 0,103,104,111,115,116,115,105,122,101, 0,103,104,111,115,116,116,121,112,101, 0,112, 97,116,104,115,105,122,101, 0,103, +104,111,115,116,115,102, 0,103,104,111,115,116,101,102, 0,112, 97,116,104,115,102, 0,112, 97,116,104,101,102, 0,112, 97,116, +104, 98, 99, 0,112, 97,116,104, 97, 99, 0, 42,112,114,111,112, 0, 99,111,110,115,116,102,108, 97,103, 0,105,107,102,108, 97, +103, 0,115,101,108,101, 99,116,102,108, 97,103, 0, 97,103,114,112, 95,105,110,100,101,120, 0, 42, 98,111,110,101, 0, 42, 99, +104,105,108,100, 0,105,107,116,114,101,101, 0, 42, 98, 95, 98,111,110,101, 95,109, 97,116,115, 0, 42,100,117, 97,108, 95,113, +117, 97,116, 0, 42, 98, 95, 98,111,110,101, 95,100,117, 97,108, 95,113,117, 97,116,115, 0,101,117,108, 91, 51, 93, 0,114,111, +116,109,111,100,101, 0, 99,104, 97,110, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,111,115,101, 95,109, 97,116, 91, 52, 93, + 91, 52, 93, 0,112,111,115,101, 95,104,101, 97,100, 91, 51, 93, 0,112,111,115,101, 95,116, 97,105,108, 91, 51, 93, 0,108,105, +109,105,116,109,105,110, 91, 51, 93, 0,108,105,109,105,116,109, 97,120, 91, 51, 93, 0,115,116,105,102,102,110,101,115,115, 91, + 51, 93, 0,105,107,115,116,114,101,116, 99,104, 0, 42, 99,117,115,116,111,109, 0, 99,104, 97,110, 98, 97,115,101, 0,112,114, +111,120,121, 95,108, 97,121,101,114, 0,115,116,114,105,100,101, 95,111,102,102,115,101,116, 91, 51, 93, 0, 99,121, 99,108,105, + 99, 95,111,102,102,115,101,116, 91, 51, 93, 0, 97,103,114,111,117,112,115, 0, 97, 99,116,105,118,101, 95,103,114,111,117,112, + 0, 99,117,115,116,111,109, 67,111,108, 0, 99,115, 0, 99,117,114,118,101,115, 0,103,114,111,117,112,115, 0, 97, 99,116,105, +118,101, 95,109, 97,114,107,101,114, 0, 42,115,111,117,114, 99,101, 0,102,105,108,116,101,114,102,108, 97,103, 0, 97,100,115, + 0, 97, 99,116,110,114, 0, 97, 99,116,119,105,100,116,104, 0,116,105,109,101,115,108,105,100,101, 0, 42,103,114,112, 0,116, +101,109,112, 0,110, 97,109,101, 91, 51, 48, 93, 0,111,119,110,115,112, 97, 99,101, 0,116, 97,114,115,112, 97, 99,101, 0,101, +110,102,111,114, 99,101, 0,104,101, 97,100,116, 97,105,108, 0, 42,116, 97,114, 0,115,117, 98,116, 97,114,103,101,116, 91, 51, + 50, 93, 0,109, 97,116,114,105,120, 91, 52, 93, 91, 52, 93, 0,115,112, 97, 99,101, 0,116, 97,114,110,117,109, 0,116, 97,114, +103,101,116,115, 0,105,116,101,114, 97,116,105,111,110,115, 0,114,111,111,116, 98,111,110,101, 0,109, 97,120, 95,114,111,111, +116, 98,111,110,101, 0, 42,112,111,108,101,116, 97,114, 0,112,111,108,101,115,117, 98,116, 97,114,103,101,116, 91, 51, 50, 93, + 0,112,111,108,101, 97,110,103,108,101, 0,111,114,105,101,110,116,119,101,105,103,104,116, 0,103,114, 97, 98,116, 97,114,103, +101,116, 91, 51, 93, 0,114,101,115,101,114,118,101,100, 49, 0,114,101,115,101,114,118,101,100, 50, 0,109,105,110,109, 97,120, +102,108, 97,103, 0,115,116,117, 99,107, 0, 99, 97, 99,104,101, 91, 51, 93, 0,108,111, 99,107,102,108, 97,103, 0,102,111,108, +108,111,119,102,108, 97,103, 0,118,111,108,109,111,100,101, 0,112,108, 97,110,101, 0,111,114,103,108,101,110,103,116,104, 0, + 98,117,108,103,101, 0,112,105,118, 88, 0,112,105,118, 89, 0,112,105,118, 90, 0, 97,120, 88, 0, 97,120, 89, 0, 97,120, 90, + 0,109,105,110, 76,105,109,105,116, 91, 54, 93, 0,109, 97,120, 76,105,109,105,116, 91, 54, 93, 0,101,120,116,114, 97, 70,122, + 0,105,110,118,109, 97,116, 91, 52, 93, 91, 52, 93, 0,102,114,111,109, 0,116,111, 0,109, 97,112, 91, 51, 93, 0,101,120,112, +111, 0,102,114,111,109, 95,109,105,110, 91, 51, 93, 0,102,114,111,109, 95,109, 97,120, 91, 51, 93, 0,116,111, 95,109,105,110, + 91, 51, 93, 0,116,111, 95,109, 97,120, 91, 51, 93, 0,122,109,105,110, 0,122,109, 97,120, 0,112, 97,100, 91, 57, 93, 0, 99, +104, 97,110,110,101,108, 91, 51, 50, 93, 0,110,111, 95,114,111,116, 95, 97,120,105,115, 0,115,116,114,105,100,101, 95, 97,120, +105,115, 0, 99,117,114,109,111,100, 0, 97, 99,116,115,116, 97,114,116, 0, 97, 99,116,101,110,100, 0, 97, 99,116,111,102,102, +115, 0,115,116,114,105,100,101,108,101,110, 0,115, 99, 97,108,101, 0, 98,108,101,110,100,111,117,116, 0,115,116,114,105,100, +101, 99,104, 97,110,110,101,108, 91, 51, 50, 93, 0,111,102,102,115, 95, 98,111,110,101, 91, 51, 50, 93, 0,104, 97,115,105,110, +112,117,116, 0,104, 97,115,111,117,116,112,117,116, 0,100, 97,116, 97,116,121,112,101, 0,115,111, 99,107,101,116,116,121,112, +101, 0, 42,110,101,119, 95,115,111, 99,107, 0,110,115, 0,108,105,109,105,116, 0,115,116, 97, 99,107, 95,105,110,100,101,120, + 0,105,110,116,101,114,110, 0,115,116, 97, 99,107, 95,105,110,100,101,120, 95,101,120,116, 0,108,111, 99,120, 0,108,111, 99, +121, 0,111,119,110, 95,105,110,100,101,120, 0,116,111, 95,105,110,100,101,120, 0, 42,116,111,115,111, 99,107, 0, 42,108,105, +110,107, 0, 42,110,101,119, 95,110,111,100,101, 0,117,115,101,114,110, 97,109,101, 91, 51, 50, 93, 0,108, 97,115,116,121, 0, +111,117,116,112,117,116,115, 0, 42,115,116,111,114, 97,103,101, 0,109,105,110,105,119,105,100,116,104, 0, 99,117,115,116,111, +109, 49, 0, 99,117,115,116,111,109, 50, 0, 99,117,115,116,111,109, 51, 0, 99,117,115,116,111,109, 52, 0,110,101,101,100, 95, +101,120,101, 99, 0,101,120,101, 99, 0, 42,116,104,114,101, 97,100,100, 97,116, 97, 0,116,111,116,114, 0, 98,117,116,114, 0, +112,114,118,114, 0, 42,116,121,112,101,105,110,102,111, 0, 42,102,114,111,109,110,111,100,101, 0, 42,116,111,110,111,100,101, + 0, 42,102,114,111,109,115,111, 99,107, 0,110,111,100,101,115, 0,108,105,110,107,115, 0, 42,115,116, 97, 99,107, 0, 42,116, +104,114,101, 97,100,115,116, 97, 99,107, 0,105,110,105,116, 0,115,116, 97, 99,107,115,105,122,101, 0, 99,117,114, 95,105,110, +100,101,120, 0, 97,108,108,116,121,112,101,115, 0, 42,111,119,110,116,121,112,101, 0, 42,115,101,108,105,110, 0, 42,115,101, +108,111,117,116, 0, 40, 42,116,105,109,101, 99,117,114,115,111,114, 41, 40, 41, 0, 40, 42,115,116, 97,116,115, 95,100,114, 97, +119, 41, 40, 41, 0, 40, 42,116,101,115,116, 95, 98,114,101, 97,107, 41, 40, 41, 0, 42,116, 98,104, 0, 42,116, 99,104, 0, 42, +115,100,104, 0, 99,121, 99,108,105, 99, 0,109,111,118,105,101, 0,115, 97,109,112,108,101,115, 0,109,105,110,115,112,101,101, +100, 0,112,101,114, 99,101,110,116,120, 0,112,101,114, 99,101,110,116,121, 0, 98,111,107,101,104, 0, 99,117,114,118,101,100, + 0,105,109, 97,103,101, 95,105,110, 95,119,105,100,116,104, 0,105,109, 97,103,101, 95,105,110, 95,104,101,105,103,104,116, 0, + 99,101,110,116,101,114, 95,120, 0, 99,101,110,116,101,114, 95,121, 0,115,112,105,110, 0,105,116,101,114, 0,119,114, 97,112, + 0,115,105,103,109, 97, 95, 99,111,108,111,114, 0,115,105,103,109, 97, 95,115,112, 97, 99,101, 0,104,117,101, 0,115, 97,116, + 0,116, 49, 0,116, 50, 0,116, 51, 0,102,115,116,114,101,110,103,116,104, 0,102, 97,108,112,104, 97, 0,107,101,121, 91, 52, + 93, 0,120, 49, 0,120, 50, 0,121, 49, 0,121, 50, 0, 99,111,108,110, 97,109,101, 91, 51, 50, 93, 0, 98,107,116,121,112,101, + 0,114,111,116, 97,116,105,111,110, 0,103, 97,109, 99,111, 0,110,111, 95,122, 98,117,102, 0,102,115,116,111,112, 0,109, 97, +120, 98,108,117,114, 0, 98,116,104,114,101,115,104, 0, 42,100,105, 99,116, 0, 42,110,111,100,101, 0, 97,110,103,108,101, 95, +111,102,115, 0, 99,111,108,109,111,100, 0,109,105,120, 0,116,104,114,101,115,104,111,108,100, 0,102, 97,100,101, 0,109, 0, + 99, 0,106,105,116, 0,112,114,111,106, 0,102,105,116, 0,115,104,111,114,116,121, 0,109,105,110,116, 97, 98,108,101, 0,109, + 97,120,116, 97, 98,108,101, 0,101,120,116, 95,105,110, 91, 50, 93, 0,101,120,116, 95,111,117,116, 91, 50, 93, 0, 42, 99,117, +114,118,101, 0, 42,116, 97, 98,108,101, 0, 42,112,114,101,109,117,108,116, 97, 98,108,101, 0, 99,117,114,114, 0, 99,108,105, +112,114, 0, 99,109, 91, 52, 93, 0, 98,108, 97, 99,107, 91, 51, 93, 0,119,104,105,116,101, 91, 51, 93, 0, 98,119,109,117,108, + 91, 51, 93, 0,115, 97,109,112,108,101, 91, 51, 93, 0,111,102,102,115,101,116, 91, 50, 93, 0, 99,108,111,110,101, 0,105,110, +110,101,114,114, 97,100,105,117,115, 0,114, 97,116,101, 0,114,103, 98, 91, 51, 93, 0,114,111,116, 0,115, 99,117,108,112,116, + 95,116,111,111,108, 0, 97, 99,116,105,118,101, 95,114,110,100, 0, 97, 99,116,105,118,101, 95, 99,108,111,110,101, 0, 97, 99, +116,105,118,101, 95,109, 97,115,107, 0, 42,108, 97,121,101,114,115, 0,116,111,116,108, 97,121,101,114, 0,109, 97,120,108, 97, +121,101,114, 0,116,111,116,115,105,122,101, 0, 42,112,111,111,108, 0,101,100,105,116,102,108, 97,103, 0,118,101,108, 91, 51, + 93, 0,114,111,116, 91, 52, 93, 0, 97,118,101, 91, 51, 93, 0,110,117,109, 0,112, 97,114,101,110,116, 0,112, 97, 91, 52, 93, + 0,119, 91, 52, 93, 0,102,117,118, 91, 52, 93, 0,102,111,102,102,115,101,116, 0,114, 97,110,100, 91, 51, 93, 0, 42,115,116, +105, 99,107, 95,111, 98, 0,112,114,101,118, 95,115,116, 97,116,101, 0, 42,104, 97,105,114, 0,105, 95,114,111,116, 91, 52, 93, + 0,114, 95,114,111,116, 91, 52, 93, 0,114, 95, 97,118,101, 91, 51, 93, 0,114, 95,118,101, 91, 51, 93, 0,100,105,101,116,105, +109,101, 0, 98, 97,110,107, 0,115,105,122,101,109,117,108, 0,110,117,109, 95,100,109, 99, 97, 99,104,101, 0, 98,112,105, 0, + 97,108,105,118,101, 0,108,111,111,112, 0,100,105,115,116,114, 0,112,104,121,115,116,121,112,101, 0, 97,118,101,109,111,100, +101, 0,114,101, 97, 99,116,101,118,101,110,116, 0,100,114, 97,119, 0,100,114, 97,119, 95, 97,115, 0,100,114, 97,119, 95,115, +105,122,101, 0, 99,104,105,108,100,116,121,112,101, 0,114,101,110, 95, 97,115, 0,114,116, 50, 91, 51, 93, 0,100,114, 97,119, + 95,115,116,101,112, 0,114,101,110, 95,115,116,101,112, 0,104, 97,105,114, 95,115,116,101,112, 0,107,101,121,115, 95,115,116, +101,112, 0, 97,100, 97,112,116, 95, 97,110,103,108,101, 0, 97,100, 97,112,116, 95,112,105,120, 0,114,111,116,102,114,111,109, + 0,105,110,116,101,103,114, 97,116,111,114, 0,110, 98,101,116,119,101,101,110, 0, 98,111,105,100,110,101,105,103,104, 98,111, +117,114,115, 0, 98, 98, 95, 97,108,105,103,110, 0, 98, 98, 95,117,118, 95,115,112,108,105,116, 0, 98, 98, 95, 97,110,105,109, + 0, 98, 98, 95,115,112,108,105,116, 95,111,102,102,115,101,116, 0, 98, 98, 95,116,105,108,116, 0, 98, 98, 95,114, 97,110,100, + 95,116,105,108,116, 0, 98, 98, 95,111,102,102,115,101,116, 91, 50, 93, 0,115,105,109,112,108,105,102,121, 95,102,108, 97,103, + 0,115,105,109,112,108,105,102,121, 95,114,101,102,115,105,122,101, 0,115,105,109,112,108,105,102,121, 95,114, 97,116,101, 0, +115,105,109,112,108,105,102,121, 95,116,114, 97,110,115,105,116,105,111,110, 0,115,105,109,112,108,105,102,121, 95,118,105,101, +119,112,111,114,116, 0,116,105,109,101,116,119,101, 97,107, 0,106,105,116,102, 97, 99, 0,101,102,102, 95,104, 97,105,114, 0, +103,114,105,100, 95,114,101,115, 0,112, 97,114,116,102, 97, 99, 0,116, 97,110,102, 97, 99, 0,116, 97,110,112,104, 97,115,101, + 0,114,101, 97, 99,116,102, 97, 99, 0, 97,118,101,102, 97, 99, 0,112,104, 97,115,101,102, 97, 99, 0,114, 97,110,100,114,111, +116,102, 97, 99, 0,114, 97,110,100,112,104, 97,115,101,102, 97, 99, 0,114, 97,110,100,115,105,122,101, 0,114,101, 97, 99,116, +115,104, 97,112,101, 0, 97, 99, 99, 91, 51, 93, 0,100,114, 97,103,102, 97, 99, 0, 98,114,111,119,110,102, 97, 99, 0,100, 97, +109,112,102, 97, 99, 0,114, 97,110,100,108,101,110,103,116,104, 0, 99,104,105,108,100, 95,110, 98,114, 0,114,101,110, 95, 99, +104,105,108,100, 95,110, 98,114, 0,112, 97,114,101,110,116,115, 0, 99,104,105,108,100,115,105,122,101, 0, 99,104,105,108,100, +114, 97,110,100,115,105,122,101, 0, 99,104,105,108,100,114, 97,100, 0, 99,104,105,108,100,102,108, 97,116, 0, 99,108,117,109, +112,102, 97, 99, 0, 99,108,117,109,112,112,111,119, 0,114,111,117,103,104, 49, 0,114,111,117,103,104, 49, 95,115,105,122,101, + 0,114,111,117,103,104, 50, 0,114,111,117,103,104, 50, 95,115,105,122,101, 0,114,111,117,103,104, 50, 95,116,104,114,101,115, + 0,114,111,117,103,104, 95,101,110,100, 0,114,111,117,103,104, 95,101,110,100, 95,115,104, 97,112,101, 0, 99,108,101,110,103, +116,104, 0, 99,108,101,110,103,116,104, 95,116,104,114,101,115, 0, 98,114, 97,110, 99,104, 95,116,104,114,101,115, 0,100,114, + 97,119, 95,108,105,110,101, 91, 50, 93, 0,112, 97,116,104, 95,115,116, 97,114,116, 0,112, 97,116,104, 95,101,110,100, 0,116, +114, 97,105,108, 95, 99,111,117,110,116, 0,107,101,121,101,100, 95,108,111,111,112,115, 0,109, 97,120, 95,108, 97,116, 95, 97, + 99, 99, 0,109, 97,120, 95,116, 97,110, 95, 97, 99, 99, 0, 97,118,101,114, 97,103,101, 95,118,101,108, 0, 98, 97,110,107,105, +110,103, 0,109, 97,120, 95, 98, 97,110,107, 0,103,114,111,117,110,100,122, 0, 98,111,105,100,102, 97, 99, 91, 56, 93, 0, 98, +111,105,100,114,117,108,101, 91, 56, 93, 0, 42,101,102,102, 95,103,114,111,117,112, 0, 42,100,117,112, 95,111, 98, 0, 42, 98, + 98, 95,111, 98, 0, 42,112,100, 50, 0, 42,112, 97,114,116, 0, 42,101,100,105,116, 0, 40, 42,102,114,101,101, 95,101,100,105, +116, 41, 40, 41, 0, 42, 42,112, 97,116,104, 99, 97, 99,104,101, 0, 42, 42, 99,104,105,108,100, 99, 97, 99,104,101, 0,112, 97, +116,104, 99, 97, 99,104,101, 98,117,102,115, 0, 99,104,105,108,100, 99, 97, 99,104,101, 98,117,102,115, 0, 42,116, 97,114,103, +101,116, 95,111, 98, 0, 42,108, 97,116,116,105, 99,101, 0,101,102,102,101, 99,116,111,114,115, 0,114,101, 97, 99,116,101,118, +101,110,116,115, 0,107,101,121,101,100, 95,116, 97,114,103,101,116,115, 0,116,111,116, 99,104,105,108,100, 0,116,111,116, 99, + 97, 99,104,101,100, 0,116,111,116, 99,104,105,108,100, 99, 97, 99,104,101, 0,116, 97,114,103,101,116, 95,112,115,121,115, 0, +116,111,116,107,101,121,101,100, 0, 98, 97,107,101,115,112, 97, 99,101, 0, 98, 98, 95,117,118,110, 97,109,101, 91, 51, 93, 91, + 51, 50, 93, 0,118,103,114,111,117,112, 91, 49, 50, 93, 0,118,103, 95,110,101,103, 0,114,116, 51, 0, 42,114,101,110,100,101, +114,100, 97,116, 97, 0, 42, 99, 97, 99,104,101, 0, 67,100,105,115, 0, 67,118,105, 0, 91, 51, 93, 0,115,116,114,117, 99,116, +117,114, 97,108, 0, 98,101,110,100,105,110,103, 0,109, 97,120, 95, 98,101,110,100, 0,109, 97,120, 95,115,116,114,117, 99,116, + 0,109, 97,120, 95,115,104,101, 97,114, 0, 97,118,103, 95,115,112,114,105,110,103, 95,108,101,110, 0,116,105,109,101,115, 99, + 97,108,101, 0,101,102,102, 95,102,111,114, 99,101, 95,115, 99, 97,108,101, 0,101,102,102, 95,119,105,110,100, 95,115, 99, 97, +108,101, 0,115,105,109, 95,116,105,109,101, 95,111,108,100, 0,115,116,101,112,115, 80,101,114, 70,114, 97,109,101, 0,112,114, +101,114,111,108,108, 0,109, 97,120,115,112,114,105,110,103,108,101,110, 0,115,111,108,118,101,114, 95,116,121,112,101, 0,118, +103,114,111,117,112, 95, 98,101,110,100, 0,118,103,114,111,117,112, 95,109, 97,115,115, 0,118,103,114,111,117,112, 95,115,116, +114,117, 99,116, 0,112,114,101,115,101,116,115, 0, 42, 99,111,108,108,105,115,105,111,110, 95,108,105,115,116, 0,101,112,115, +105,108,111,110, 0,115,101,108,102, 95,102,114,105, 99,116,105,111,110, 0,115,101,108,102,101,112,115,105,108,111,110, 0,115, +101,108,102, 95,108,111,111,112, 95, 99,111,117,110,116, 0,108,111,111,112, 95, 99,111,117,110,116, 0,112,114,101,115,115,117, +114,101, 0, 42,112,111,105,110,116,115, 0,116,111,116,112,111,105,110,116,115, 0,116,104,105, 99,107,110,101,115,115, 0,115, +116,114,111,107,101,115, 0,102,114, 97,109,101,110,117,109, 0, 42, 97, 99,116,102,114, 97,109,101, 0,103,115,116,101,112, 0, +105,110,102,111, 91, 49, 50, 56, 93, 0,115, 98,117,102,102,101,114, 95,115,105,122,101, 0,115, 98,117,102,102,101,114, 95,115, +102,108, 97,103, 0, 42,115, 98,117,102,102,101,114, 0, 42,119,105,110,100,114, 97,119, 97, 98,108,101, 0, 42,119,105,110, 97, + 99,116,105,118,101, 0,119,105,110,100,111,119,115, 0,105,110,105,116,105, 97,108,105,122,101,100, 0,102,105,108,101, 95,115, + 97,118,101,100, 0,111,112,101,114, 97,116,111,114,115, 0,113,117,101,117,101, 0,114,101,112,111,114,116,115, 0,106,111, 98, +115, 0,112, 97,105,110,116, 99,117,114,115,111,114,115, 0,107,101,121,109, 97,112,115, 0, 42,103,104,111,115,116,119,105,110, + 0, 42,110,101,119,115, 99,114,101,101,110, 0,115, 99,114,101,101,110,110, 97,109,101, 91, 51, 50, 93, 0,112,111,115,120, 0, +112,111,115,121, 0,119,105,110,100,111,119,115,116, 97,116,101, 0,109,111,110,105,116,111,114, 0,108, 97,115,116, 99,117,114, +115,111,114, 0, 97,100,100,109,111,117,115,101,109,111,118,101, 0, 42,101,118,101,110,116,115,116, 97,116,101, 0, 42, 99,117, +114,115,119,105,110, 0, 42,116,119,101, 97,107, 0,100,114, 97,119,109,101,116,104,111,100, 0,100,114, 97,119,102, 97,105,108, + 0, 42,100,114, 97,119,100, 97,116, 97, 0,116,105,109,101,114,115, 0,115,117, 98,119,105,110,100,111,119,115, 0,103,101,115, +116,117,114,101, 0,105,100,110, 97,109,101, 91, 54, 52, 93, 0, 42,112,116,114, 0,115,104,105,102,116, 0, 99,116,114,108, 0, + 97,108,116, 0,111,115,107,101,121, 0,107,101,121,109,111,100,105,102,105,101,114, 0,107,101,121,109, 97,112, 0,110, 97,109, +101,105,100, 91, 54, 52, 93, 0,115,112, 97, 99,101,105,100, 0,114,101,103,105,111,110,105,100, 0, 42, 99,117,115,116,111,109, +100, 97,116, 97, 0, 42,114,101,112,111,114,116,115, 0,109,118, 97,108, 91, 50, 93, 0,112,114,101,118,120, 0,112,114,101,118, +121, 0,117,110,105, 99,111,100,101, 0, 97,115, 99,105,105, 0, 42,107,101,121,109, 97,112, 95,105,100,110, 97,109,101, 0, 99, +117,115,116,111,109, 0, 99,117,115,116,111,109,100, 97,116, 97,102,114,101,101, 0, 42,101,100, 97,116, 97, 0,105,110,102,108, +117,101,110, 99,101, 0, 42, 99,111,101,102,102,105, 99,105,101,110,116,115, 0, 97,114,114, 97,121,115,105,122,101, 0,112,111, +108,121, 95,111,114,100,101,114, 0, 97,109,112,108,105,116,117,100,101, 0,112,104, 97,115,101, 95,109,117,108,116,105,112,108, +105,101,114, 0,112,104, 97,115,101, 95,111,102,102,115,101,116, 0,118, 97,108,117,101, 95,111,102,102,115,101,116, 0,109,105, +100,118, 97,108, 0, 98,101,102,111,114,101, 95,109,111,100,101, 0, 97,102,116,101,114, 95,109,111,100,101, 0, 98,101,102,111, +114,101, 95, 99,121, 99,108,101,115, 0, 97,102,116,101,114, 95, 99,121, 99,108,101,115, 0,114,101, 99,116, 0,112,104, 97,115, +101, 0,109,111,100,105,102,105, 99, 97,116,105,111,110, 0, 42,114,110, 97, 95,112, 97,116,104, 0, 97,114,114, 97,121, 95,105, +110,100,101,120, 0,101,120,112,114,101,115,115,105,111,110, 91, 50, 53, 54, 93, 0,118,101, 99, 91, 50, 93, 0, 42,102,112,116, + 0, 99,111,108,111,114, 95,109,111,100,101, 0, 99,111,108,111,114, 91, 51, 93, 0,102,114,111,109, 91, 49, 50, 56, 93, 0,116, +111, 91, 49, 50, 56, 93, 0,109, 97,112,112,105,110,103,115, 0,115,116,114,105,112,115, 0, 42,114,101,109, 97,112, 0,102, 99, +117,114,118,101,115, 0,115,116,114,105,112, 95,116,105,109,101, 0, 98,108,101,110,100,109,111,100,101, 0,101,120,116,101,110, +100,109,111,100,101, 0,103,114,111,117,112, 91, 54, 52, 93, 0,105,100,116,121,112,101, 0,116,101,109,112,108, 97,116,101,115, + 0,103,114,111,117,112,109,111,100,101, 0,112, 97,116,104,115, 0,107,101,121,105,110,103,102,108, 97,103, 0, 42,116,109,112, + 97, 99,116, 0,110,108, 97, 95,116,114, 97, 99,107,115, 0, 42, 97, 99,116,115,116,114,105,112, 0,100,114,105,118,101,114,115, + 0,111,118,101,114,114,105,100,101,115, 0, 0, 84, 89, 80, 69,158, 1, 0, 0, 99,104, 97,114, 0,117, 99,104, 97,114, 0,115, +104,111,114,116, 0,117,115,104,111,114,116, 0,105,110,116, 0,108,111,110,103, 0,117,108,111,110,103, 0,102,108,111, 97,116, + 0,100,111,117, 98,108,101, 0,118,111,105,100, 0, 76,105,110,107, 0, 76,105,110,107, 68, 97,116, 97, 0, 76,105,115,116, 66, + 97,115,101, 0,118,101, 99, 50,115, 0,118,101, 99, 50,105, 0,118,101, 99, 50,102, 0,118,101, 99, 50,100, 0,118,101, 99, 51, +105, 0,118,101, 99, 51,102, 0,118,101, 99, 51,100, 0,118,101, 99, 52,105, 0,118,101, 99, 52,102, 0,118,101, 99, 52,100, 0, +114, 99,116,105, 0,114, 99,116,102, 0, 73, 68, 80,114,111,112,101,114,116,121, 68, 97,116, 97, 0, 73, 68, 80,114,111,112,101, +114,116,121, 0, 73, 68, 0, 76,105, 98,114, 97,114,121, 0, 70,105,108,101, 68, 97,116, 97, 0, 80,114,101,118,105,101,119, 73, +109, 97,103,101, 0, 73,112,111, 68,114,105,118,101,114, 0, 79, 98,106,101, 99,116, 0, 73,112,111, 67,117,114,118,101, 0, 66, + 80,111,105,110,116, 0, 66,101,122, 84,114,105,112,108,101, 0, 73,112,111, 0, 75,101,121, 66,108,111, 99,107, 0, 75,101,121, + 0, 65,110,105,109, 68, 97,116, 97, 0, 83, 99,114,105,112,116, 76,105,110,107, 0, 84,101,120,116, 76,105,110,101, 0, 84,101, +120,116, 77, 97,114,107,101,114, 0, 84,101,120,116, 0, 80, 97, 99,107,101,100, 70,105,108,101, 0, 67, 97,109,101,114, 97, 0, + 73,109, 97,103,101, 85,115,101,114, 0, 83, 99,101,110,101, 0, 73,109, 97,103,101, 0, 71, 80, 85, 84,101,120,116,117,114,101, + 0, 97,110,105,109, 0, 82,101,110,100,101,114, 82,101,115,117,108,116, 0, 77, 84,101,120, 0, 84,101,120, 0, 80,108,117,103, +105,110, 84,101,120, 0, 67, 66, 68, 97,116, 97, 0, 67,111,108,111,114, 66, 97,110,100, 0, 69,110,118, 77, 97,112, 0, 73,109, + 66,117,102, 0, 98, 78,111,100,101, 84,114,101,101, 0, 84,101,120, 77, 97,112,112,105,110,103, 0, 76, 97,109,112, 0, 67,117, +114,118,101, 77, 97,112,112,105,110,103, 0, 87, 97,118,101, 0, 77, 97,116,101,114,105, 97,108, 0, 71,114,111,117,112, 0, 86, + 70,111,110,116, 0, 86, 70,111,110,116, 68, 97,116, 97, 0, 77,101,116, 97, 69,108,101,109, 0, 66,111,117,110,100, 66,111,120, + 0, 77,101,116, 97, 66, 97,108,108, 0, 78,117,114, 98, 0, 67,104, 97,114, 73,110,102,111, 0, 84,101,120,116, 66,111,120, 0, + 67,117,114,118,101, 0, 80, 97,116,104, 0, 83,101,108, 66,111,120, 0, 69,100,105,116, 70,111,110,116, 0, 77,101,115,104, 0, + 77, 70, 97, 99,101, 0, 77, 84, 70, 97, 99,101, 0, 84, 70, 97, 99,101, 0, 77, 86,101,114,116, 0, 77, 69,100,103,101, 0, 77, + 68,101,102,111,114,109, 86,101,114,116, 0, 77, 67,111,108, 0, 77, 83,116,105, 99,107,121, 0, 77, 83,101,108,101, 99,116, 0, + 69,100,105,116, 77,101,115,104, 0, 67,117,115,116,111,109, 68, 97,116, 97, 0, 77,117,108,116,105,114,101,115, 0, 80, 97,114, +116,105, 97,108, 86,105,115,105, 98,105,108,105,116,121, 0, 77, 68,101,102,111,114,109, 87,101,105,103,104,116, 0, 77, 84,101, +120, 80,111,108,121, 0, 77, 76,111,111,112, 85, 86, 0, 77, 76,111,111,112, 67,111,108, 0, 77, 70,108,111, 97,116, 80,114,111, +112,101,114,116,121, 0, 77, 73,110,116, 80,114,111,112,101,114,116,121, 0, 77, 83,116,114,105,110,103, 80,114,111,112,101,114, +116,121, 0, 79,114,105,103, 83,112, 97, 99,101, 70, 97, 99,101, 0, 77, 68,105,115,112,115, 0, 32, 35,100,101,102,105,110,101, + 32, 77, 69, 95, 69, 68, 71, 69, 68, 82, 65, 87, 32, 40, 49, 60, 60, 49, 41, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 83, + 69, 65, 77, 32, 40, 49, 60, 60, 50, 41, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 71, 79, 78, 32, 40, 49, 60, 60, 51, + 41, 32, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 69, 68, 71, 69, 82, 69, 78, 68, 69, 82, 32, 40, 49, 60, 60, 53, 41, 32, + 35,100,101,102,105,110,101, 32, 77, 69, 95, 76, 79, 79, 83, 69, 69, 68, 71, 69, 32, 40, 49, 60, 60, 55, 41, 32, 35,100,101,102, +105,110,101, 32, 77, 69, 95, 83, 69, 65, 77, 95, 76, 65, 83, 84, 32, 40, 49, 60, 60, 56, 41, 32, 35,100,101,102,105,110,101, 32, + 77, 69, 95, 83, 72, 65, 82, 80, 32, 40, 49, 60, 60, 57, 41, 32, 32, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 76, 73, + 80, 86, 49, 32, 49, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 76, 73, 80, 86, 50, 32, 50, 32, 35,100,101,102,105,110, +101, 32, 77, 69, 95, 70, 76, 73, 80, 86, 51, 32, 52, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 76, 73, 80, 86, 52, 32, + 56, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 80, 82, 79, 74, 88, 89, 32, 49, 54, 32, 35,100,101,102,105,110,101, 32, 77, + 69, 95, 80, 82, 79, 74, 88, 90, 32, 51, 50, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 80, 82, 79, 74, 89, 90, 32, 54, 52, + 32, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 49, 86, 50, 32, 49, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, + 50, 86, 51, 32, 50, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 51, 86, 49, 32, 52, 32, 35,100,101,102,105,110,101, 32, + 77, 69, 95, 86, 51, 86, 52, 32, 52, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 52, 86, 49, 32, 56, 32, 32, 35,100,101, +102,105,110,101, 32, 77, 69, 95, 83, 77, 79, 79, 84, 72, 32, 49, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 65, 67, 69, + 95, 83, 69, 76, 32, 50, 32, 32, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 83, 69,108, 32, 48, 32, 35,100,101,102,105, +110,101, 32, 77, 69, 95, 69, 83, 69,108, 32, 49, 32, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 83, 69, 76, 32, 50, 32, 32, + 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 69, 76, 69, 67, 84, 32, 49, 32, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, + 65, 67, 84, 73, 86, 69, 32, 50, 32, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 69, 76, 49, 32, 52, 32, 35,100,101,102, +105,110,101, 32, 84, 70, 95, 83, 69, 76, 50, 32, 56, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 69, 76, 51, 32, 49, 54, + 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 69, 76, 52, 32, 51, 50, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 72, + 73, 68, 69, 32, 54, 52, 32, 32, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 68, 89, 78, 65, 77, 73, 67, 32, 49, 32, 35,100, +101,102,105,110,101, 32, 84, 70, 95, 65, 76, 80, 72, 65, 83, 79, 82, 84, 32, 50, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, + 84, 69, 88, 32, 52, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 72, 65, 82, 69, 68, 86, 69, 82, 84, 32, 56, 32, 35,100, +101,102,105,110,101, 32, 84, 70, 95, 76, 73, 71, 72, 84, 32, 49, 54, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 72, 65, + 82, 69, 68, 67, 79, 76, 32, 54, 52, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 84, 73, 76, 69, 83, 32, 49, 50, 56, 32, 32, + 35,100,101,102,105,110,101, 32, 84, 70, 95, 66, 73, 76, 76, 66, 79, 65, 82, 68, 32, 50, 53, 54, 32, 35,100,101,102,105,110,101, + 32, 84, 70, 95, 84, 87, 79, 83, 73, 68, 69, 32, 53, 49, 50, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 73, 78, 86, 73, 83, + 73, 66, 76, 69, 32, 49, 48, 50, 52, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 79, 66, 67, 79, 76, 32, 50, 48, 52, 56, 32, + 35,100,101,102,105,110,101, 32, 84, 70, 95, 66, 73, 76, 76, 66, 79, 65, 82, 68, 50, 32, 52, 48, 57, 54, 32, 32, 35,100,101,102, +105,110,101, 32, 84, 70, 95, 83, 72, 65, 68, 79, 87, 32, 56, 49, 57, 50, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 66, 77, + 70, 79, 78, 84, 32, 49, 54, 51, 56, 52, 32, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 79, 76, 73, 68, 32, 48, 32, 35, +100,101,102,105,110,101, 32, 84, 70, 95, 65, 68, 68, 32, 49, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 65, 76, 80, 72, 65, + 32, 50, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 67, 76, 73, 80, 32, 52, 32, 32, 32, 35,100,101,102,105,110,101, 32, 84, + 70, 95, 83, 85, 66, 32, 51, 32, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 68, 69, 80, 82, 69, 67, 65, 84, 69, 68, 49, 32, + 49, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 68, 69, 80, 82, 69, 67, 65, 84, 69, 68, 50, 32, 50, 32, 35,100,101,102,105, +110,101, 32, 84, 70, 95, 68, 69, 80, 82, 69, 67, 65, 84, 69, 68, 51, 32, 52, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 68, + 69, 80, 82, 69, 67, 65, 84, 69, 68, 52, 32, 56, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 80, 73, 78, 49, 32, 49, 54, 32, + 35,100,101,102,105,110,101, 32, 84, 70, 95, 80, 73, 78, 50, 32, 51, 50, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 80, 73, + 78, 51, 32, 54, 52, 32, 35,100,101,102,105,110,101, 32, 84, 70, 95, 80, 73, 78, 52, 32, 49, 50, 56, 32, 35,101,110,100,105,102, + 32, 32, 99,104, 97,114, 32,117,115,101, 95, 99,111,108, 44, 32,102,108, 97,103, 59, 10, 10, 9, 47, 42, 32, 83,112,101, 99,105, + 97,108, 32,108,101,118,101,108, 32, 49, 32,100, 97,116, 97, 32,116,104, 97,116, 32, 99, 97,110,110,111,116, 32, 98,101, 32,109, +111,100,105,102,105,101,100, 32,102,114,111,109, 32,111,116,104,101,114, 32,108,101,118,101,108,115, 32, 42, 47, 10, 9, 67,117, +115,116,111,109, 68, 97,116, 97, 32,118,100, 97,116, 97, 59, 10, 9, 67,117,115,116,111,109, 68, 97,116, 97, 32,102,100, 97,116, + 97, 59, 10, 9,115,104,111,114,116, 32, 42,101,100,103,101, 95,102,108, 97,103,115, 59, 10, 9, 99,104, 97,114, 32, 42,101,100, +103,101, 95, 99,114,101, 97,115,101,115, 59, 10,125, 32, 77,117,108,116,105,114,101,115, 59, 10, 10, 47, 42, 42, 32, 69,110,100, + 32, 77,117,108,116,105,114,101,115, 32, 42, 42, 47, 10, 10,116,121,112,101,100,101,102, 32,115,116,114,117, 99,116, 32, 80, 97, +114,116,105, 97,108, 86,105,115,105, 98,105,108,105,116,121, 32,123, 10, 9,117,110,115,105,103,110,101,100, 32,105,110,116, 32, + 42,118,101,114,116, 95,109, 97,112, 59, 32, 47, 42, 32,118,101,114,116, 95,109, 97,112, 91, 79,108,100, 32, 73,110,100,101,120, + 93, 61, 32, 78,101,119, 32, 73,110,100,101,120, 32, 42, 47, 10, 9,105,110,116, 32, 42,101,100,103,101, 95,109, 97,112, 59, 32, + 47, 42, 32,101,100,103,101, 95,109, 97,112, 91, 79,108,100, 32, 73,110,100,101,120, 93, 61, 32, 78,101,119, 32, 73,110,100,101, +120, 44, 32, 45, 49, 61, 32,104,105,100,100,101,110, 32, 42, 47, 10, 9, 77, 70, 97, 99,101, 32, 42,111,108,100, 95,102, 97, 99, +101,115, 59, 10, 9, 77, 69,100,103,101, 32, 42,111,108,100, 95,101,100,103,101,115, 59, 10, 9,117,110,115,105,103,110,101,100, + 32,105,110,116, 32,116,111,116,102, 97, 99,101, 44, 32,116,111,116,101,100,103,101, 44, 32,116,111,116,118,101,114,116, 44, 32, +112, 97,100, 59, 10,125, 32, 80, 97,114,116,105, 97,108, 86,105,115,105, 98,105,108,105,116,121, 59, 10, 10, 47, 42, 32,109,118, +101,114,116, 45, 62,102,108, 97,103, 32, 40, 49, 61, 83, 69, 76, 69, 67, 84, 41, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, + 77, 69, 95, 83, 80, 72, 69, 82, 69, 84, 69, 83, 84, 9, 50, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 83, 80, 72, 69, 82, + 69, 84, 69, 77, 80, 9, 52, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 72, 73, 68, 69, 9, 9, 9, 49, 54, 10, 35,100,101, +102,105,110,101, 32, 77, 69, 95, 86, 69, 82, 84, 95, 77, 69, 82, 71, 69, 68, 9, 9, 40, 49, 60, 60, 54, 41, 10, 10, 47, 42, 32, +109,101,100,103,101, 45, 62,102,108, 97,103, 32, 40, 49, 61, 83, 69, 76, 69, 67, 84, 41, 42, 47, 10, 35,100,101,102,105,110,101, + 32, 77, 69, 95, 69, 68, 71, 69, 68, 82, 65, 87, 9, 9, 9, 40, 49, 60, 60, 49, 41, 10, 35,100,101,102,105,110,101, 32, 77, 69, + 95, 83, 69, 65, 77, 9, 9, 9, 9, 40, 49, 60, 60, 50, 41, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 71, 79, 78, 9, + 9, 9, 9, 40, 49, 60, 60, 51, 41, 10, 9, 9, 9, 9, 9, 9, 47, 42, 32,114,101,115,101,114,118,101, 32, 49, 54, 32,102,111, +114, 32, 77, 69, 95, 72, 73, 68, 69, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 69, 68, 71, 69, 82, 69, 78, 68, + 69, 82, 9, 9, 40, 49, 60, 60, 53, 41, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 76, 79, 79, 83, 69, 69, 68, 71, 69, 9, + 9, 40, 49, 60, 60, 55, 41, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 83, 69, 65, 77, 95, 76, 65, 83, 84, 9, 9, 40, 49, + 60, 60, 56, 41, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 83, 72, 65, 82, 80, 9, 9, 9, 40, 49, 60, 60, 57, 41, 10, 10, + 47, 42, 32,112,117,110,111, 32, 61, 32,118,101,114,116,101,120,110,111,114,109, 97,108, 32, 40,109,102, 97, 99,101, 41, 32, 42, + 47, 10, 47, 42, 32,114,101,110,100,101,114, 32, 97,115,115,117,109,101,115, 32,102,108,105,112,115, 32,116,111, 32, 98,101, 32, +111,114,100,101,114,101,100, 32,108,105,107,101, 32,116,104,105,115, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, + 70, 76, 73, 80, 86, 49, 9, 9, 49, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 76, 73, 80, 86, 50, 9, 9, 50, 10, 35, +100,101,102,105,110,101, 32, 77, 69, 95, 70, 76, 73, 80, 86, 51, 9, 9, 52, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, + 76, 73, 80, 86, 52, 9, 9, 56, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 80, 82, 79, 74, 88, 89, 9, 9, 49, 54, 10, 35, +100,101,102,105,110,101, 32, 77, 69, 95, 80, 82, 79, 74, 88, 90, 9, 9, 51, 50, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, + 80, 82, 79, 74, 89, 90, 9, 9, 54, 52, 10, 10, 47, 42, 32,101,100, 99,111,100,101, 32, 40,109,102, 97, 99,101, 41, 32, 42, 47, + 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 49, 86, 50, 9, 9, 9, 49, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, + 86, 50, 86, 51, 9, 9, 9, 50, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 51, 86, 49, 9, 9, 9, 52, 10, 35,100,101, +102,105,110,101, 32, 77, 69, 95, 86, 51, 86, 52, 9, 9, 9, 52, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 52, 86, 49, + 9, 9, 9, 56, 10, 10, 47, 42, 32,102,108, 97,103, 32, 40,109,102, 97, 99,101, 41, 32, 42, 47, 10, 35,100,101,102,105,110,101, + 32, 77, 69, 95, 83, 77, 79, 79, 84, 72, 9, 9, 9, 49, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 65, 67, 69, 95, 83, + 69, 76, 9, 9, 9, 50, 10, 9, 9, 9, 9, 9, 9, 47, 42, 32,102,108, 97,103, 32, 77, 69, 95, 72, 73, 68, 69, 61, 61, 49, 54, + 32,105,115, 32,117,115,101,100, 32,104,101,114,101, 32,116,111,111, 32, 42, 47, 32, 10, 47, 42, 32,109,115,101,108,101, 99,116, + 45, 62,116,121,112,101, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 86, 83, 69,108, 9, 48, 10, 35,100,101,102, +105,110,101, 32, 77, 69, 95, 69, 83, 69,108, 32, 49, 10, 35,100,101,102,105,110,101, 32, 77, 69, 95, 70, 83, 69, 76, 32, 50, 10, + 10, 47, 42, 32,109,116,102, 97, 99,101, 45, 62,102,108, 97,103, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, + 69, 76, 69, 67, 84, 9, 49, 32, 47, 42, 32,117,115,101, 32, 77, 70, 97, 99,101, 32,104,105,100,101, 32,102,108, 97,103, 32, 40, + 97,102,116,101,114, 32, 50, 46, 52, 51, 41, 44, 32,115,104,111,117,108,100, 32, 98,101, 32, 97, 98,108,101, 32,116,111, 32,114, +101,117,115,101, 32, 97,102,116,101,114, 32, 50, 46, 52, 52, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 65, 67, + 84, 73, 86, 69, 9, 50, 32, 47, 42, 32,100,101,112,114,101, 99, 97,116,101,100, 33, 32, 42, 47, 10, 35,100,101,102,105,110,101, + 32, 84, 70, 95, 83, 69, 76, 49, 9, 9, 52, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 69, 76, 50, 9, 9, 56, 10, 35, +100,101,102,105,110,101, 32, 84, 70, 95, 83, 69, 76, 51, 9, 9, 49, 54, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 69, + 76, 52, 9, 9, 51, 50, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 72, 73, 68, 69, 9, 9, 54, 52, 32, 47, 42, 32,117,110, +117,115,101,100, 44, 32,115, 97,109,101, 32, 97,115, 32, 84, 70, 95, 83, 69, 76, 69, 67, 84, 32, 42, 47, 10, 10, 47, 42, 32,109, +116,102, 97, 99,101, 45, 62,109,111,100,101, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 68, 89, 78, 65, 77, 73, + 67, 9, 9, 49, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 65, 76, 80, 72, 65, 83, 79, 82, 84, 9, 50, 10, 35,100,101,102, +105,110,101, 32, 84, 70, 95, 84, 69, 88, 9, 9, 9, 52, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 72, 65, 82, 69, 68, + 86, 69, 82, 84, 9, 56, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 76, 73, 71, 72, 84, 9, 9, 49, 54, 10, 10, 35,100,101, +102,105,110,101, 32, 84, 70, 95, 83, 72, 65, 82, 69, 68, 67, 79, 76, 9, 54, 52, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, + 84, 73, 76, 69, 83, 9, 9, 49, 50, 56, 9, 9, 47, 42, 32,100,101,112,114,101, 99, 97,116,101,100, 32, 42, 47, 10, 35,100,101, +102,105,110,101, 32, 84, 70, 95, 66, 73, 76, 76, 66, 79, 65, 82, 68, 9, 50, 53, 54, 10, 35,100,101,102,105,110,101, 32, 84, 70, + 95, 84, 87, 79, 83, 73, 68, 69, 9, 9, 53, 49, 50, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 73, 78, 86, 73, 83, 73, 66, + 76, 69, 9, 49, 48, 50, 52, 10, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 79, 66, 67, 79, 76, 9, 9, 50, 48, 52, 56, 10, + 35,100,101,102,105,110,101, 32, 84, 70, 95, 66, 73, 76, 76, 66, 79, 65, 82, 68, 50, 9, 52, 48, 57, 54, 9, 47, 42, 32,119,105, +116,104, 32, 90, 32, 97,120,105,115, 32, 99,111,110,115,116,114, 97,105,110,116, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, + 84, 70, 95, 83, 72, 65, 68, 79, 87, 9, 9, 56, 49, 57, 50, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 66, 77, 70, 79, 78, + 84, 9, 9, 49, 54, 51, 56, 52, 10, 10, 47, 42, 32,109,116,102, 97, 99,101, 45, 62,116,114, 97,110,115,112, 44, 32,118, 97,108, +117,101,115, 32, 49, 45, 52, 32, 97,114,101, 32,117,115,101,100, 32, 97,115, 32,102,108, 97,103,115, 32,105,110, 32,116,104,101, + 32, 71, 76, 44, 32, 87, 65, 82, 78, 73, 78, 71, 44, 32, 84, 70, 95, 83, 85, 66, 32, 99, 97,110,116, 32,119,111,114,107, 32,119, +105,116,104, 32,116,104,105,115, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 79, 76, 73, 68, 9, 48, 10, 35, +100,101,102,105,110,101, 32, 84, 70, 95, 65, 68, 68, 9, 9, 49, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 65, 76, 80, 72, + 65, 9, 50, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 67, 76, 73, 80, 9, 9, 52, 32, 47, 42, 32, 99,108,105,112,109, 97, +112, 32, 97,108,112,104, 97, 47, 98,105,110, 97,114,121, 32, 97,108,112,104, 97, 32, 97,108,108, 32,111,114, 32,110,111,116,104, +105,110,103, 33, 32, 42, 47, 10, 10, 47, 42, 32,115,117, 98, 32,105,115, 32,110,111,116, 32, 97,118, 97,105,108, 97, 98,108,101, + 32,105,110, 32,116,104,101, 32,117,115,101,114, 32,105,110,116,101,114,102, 97, 99,101, 32, 97,110,121,109,111,114,101, 32, 42, + 47, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 83, 85, 66, 9, 9, 51, 10, 10, 10, 47, 42, 32,109,116,102, 97, 99,101, 45, + 62,117,110,119,114, 97,112, 32, 42, 47, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 68, 69, 80, 82, 69, 67, 65, 84, 69, 68, + 49, 9, 49, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 68, 69, 80, 82, 69, 67, 65, 84, 69, 68, 50, 9, 50, 10, 35,100,101, +102,105,110,101, 32, 84, 70, 95, 68, 69, 80, 82, 69, 67, 65, 84, 69, 68, 51, 9, 52, 10, 35,100,101,102,105,110,101, 32, 84, 70, + 95, 68, 69, 80, 82, 69, 67, 65, 84, 69, 68, 52, 9, 56, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 80, 73, 78, 49, 9, 9, + 32, 32, 32, 32, 49, 54, 10, 35,100,101,102,105,110,101, 32, 84, 70, 95, 80, 73, 78, 50, 9, 9, 32, 32, 32, 32, 51, 50, 10, 35, +100,101,102,105,110,101, 32, 84, 70, 95, 80, 73, 78, 51, 9, 32, 32, 32, 9, 9, 54, 52, 10, 35,100,101,102,105,110,101, 32, 84, + 70, 95, 80, 73, 78, 52, 9, 32, 32, 32, 32, 9, 49, 50, 56, 10, 10, 35,101,110,100,105,102, 10,105,110, 79, 67, 75, 33,116, 95, +102, 97, 99,101, 59, 32, 32, 32, 32, 32, 65, 69, 0, 77,117,108,116,105,114,101,115, 67,111,108, 0, 77,117,108,116,105,114,101, +115, 67,111,108, 70, 97, 99,101, 0, 77,117,108,116,105,114,101,115, 70, 97, 99,101, 0, 77,117,108,116,105,114,101,115, 69,100, +103,101, 0, 77,117,108,116,105,114,101,115, 76,101,118,101,108, 0, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,117, + 98,115,117,114,102, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 76, 97,116,116,105, 99,101, 77,111,100,105,102,105,101, +114, 68, 97,116, 97, 0, 67,117,114,118,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66,117,105,108,100, 77,111,100, +105,102,105,101,114, 68, 97,116, 97, 0, 77, 97,115,107, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 65,114,114, 97,121, + 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77,105,114,114,111,114, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, + 69,100,103,101, 83,112,108,105,116, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66,101,118,101,108, 77,111,100,105,102, +105,101,114, 68, 97,116, 97, 0, 66, 77,101,115,104, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 68,105,115,112,108, 97, + 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 85, 86, 80,114,111,106,101, 99,116, 77,111,100,105,102,105,101,114, + 68, 97,116, 97, 0, 68,101, 99,105,109, 97,116,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,109,111,111,116,104, + 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67, 97,115,116, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 87, 97, +118,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 65,114,109, 97,116,117,114,101, 77,111,100,105,102,105,101,114, 68, + 97,116, 97, 0, 72,111,111,107, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,111,102,116, 98,111,100,121, 77,111,100, +105,102,105,101,114, 68, 97,116, 97, 0, 67,108,111,116,104, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67,108,111,116, +104, 0, 67,108,111,116,104, 83,105,109, 83,101,116,116,105,110,103,115, 0, 67,108,111,116,104, 67,111,108,108, 83,101,116,116, +105,110,103,115, 0, 80,111,105,110,116, 67, 97, 99,104,101, 0, 67,111,108,108,105,115,105,111,110, 77,111,100,105,102,105,101, +114, 68, 97,116, 97, 0, 66, 86, 72, 84,114,101,101, 0, 83,117,114,102, 97, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, + 97, 0, 68,101,114,105,118,101,100, 77,101,115,104, 0, 66, 86, 72, 84,114,101,101, 70,114,111,109, 77,101,115,104, 0, 66,111, +111,108,101, 97,110, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77, 68,101,102, 73,110,102,108,117,101,110, 99,101, 0, + 77, 68,101,102, 67,101,108,108, 0, 77,101,115,104, 68,101,102,111,114,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, + 80, 97,114,116,105, 99,108,101, 83,121,115,116,101,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 80, 97,114,116,105, + 99,108,101, 83,121,115,116,101,109, 0, 80, 97,114,116,105, 99,108,101, 73,110,115,116, 97,110, 99,101, 77,111,100,105,102,105, +101,114, 68, 97,116, 97, 0, 69,120,112,108,111,100,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77,117,108,116,105, +114,101,115, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 70,108,117,105,100,115,105,109, 77,111,100,105,102,105,101,114, + 68, 97,116, 97, 0, 70,108,117,105,100,115,105,109, 83,101,116,116,105,110,103,115, 0, 83,104,114,105,110,107,119,114, 97,112, + 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,105,109,112,108,101, 68,101,102,111,114,109, 77,111,100,105,102,105,101, +114, 68, 97,116, 97, 0, 76, 97,116,116,105, 99,101, 0, 98, 68,101,102,111,114,109, 71,114,111,117,112, 0, 98, 65, 99,116,105, +111,110, 0, 98, 80,111,115,101, 0, 66,117,108,108,101,116, 83,111,102,116, 66,111,100,121, 0, 80, 97,114,116, 68,101,102,108, +101, 99,116, 0, 83,111,102,116, 66,111,100,121, 0, 79, 98, 72,111,111,107, 0, 82, 78, 71, 0, 80, 84, 67, 97, 99,104,101, 77, +101,109, 0, 83, 66, 86,101,114,116,101,120, 0, 66,111,100,121, 80,111,105,110,116, 0, 66,111,100,121, 83,112,114,105,110,103, + 0, 83, 66, 83, 99,114, 97,116, 99,104, 0, 87,111,114,108,100, 0, 66, 97,115,101, 0, 65,118,105, 67,111,100,101, 99, 68, 97, +116, 97, 0, 81,117,105, 99,107,116,105,109,101, 67,111,100,101, 99, 68, 97,116, 97, 0, 70, 70, 77,112,101,103, 67,111,100,101, + 99, 68, 97,116, 97, 0, 65,117,100,105,111, 68, 97,116, 97, 0, 83, 99,101,110,101, 82,101,110,100,101,114, 76, 97,121,101,114, + 0, 82,101,110,100,101,114, 68, 97,116, 97, 0, 82,101,110,100,101,114, 80,114,111,102,105,108,101, 0, 71, 97,109,101, 70,114, + 97,109,105,110,103, 0, 84,105,109,101, 77, 97,114,107,101,114, 0, 73,109, 97,103,101, 80, 97,105,110,116, 83,101,116,116,105, +110,103,115, 0, 66,114,117,115,104, 0, 80, 97,114,116,105, 99,108,101, 66,114,117,115,104, 68, 97,116, 97, 0, 80, 97,114,116, +105, 99,108,101, 69,100,105,116, 83,101,116,116,105,110,103,115, 0, 84,114, 97,110,115,102,111,114,109, 79,114,105,101,110,116, + 97,116,105,111,110, 0, 83, 99,117,108,112,116, 0, 83, 99,117,108,112,116, 83,101,115,115,105,111,110, 0, 86, 80, 97,105,110, +116, 0, 84,111,111,108, 83,101,116,116,105,110,103,115, 0, 98, 83,116, 97,116,115, 0, 69,100,105,116,105,110,103, 0, 83, 99, +101,110,101, 83,116, 97,116,115, 0, 68, 97,103, 70,111,114,101,115,116, 0, 66, 71,112,105, 99, 0, 82,101,103,105,111,110, 86, +105,101,119, 51, 68, 0, 98, 71, 80,100, 97,116, 97, 0, 82,101,110,100,101,114, 73,110,102,111, 0, 82,101,116,111,112,111, 86, +105,101,119, 68, 97,116, 97, 0, 86,105,101,119, 68,101,112,116,104,115, 0, 83,109,111,111,116,104, 86,105,101,119, 83,116,111, +114,101, 0,119,109, 84,105,109,101,114, 0, 86,105,101,119, 51, 68, 0, 83,112, 97, 99,101, 76,105,110,107, 0, 86,105,101,119, + 50, 68, 0, 83,112, 97, 99,101, 73,110,102,111, 0, 98, 83, 99,114,101,101,110, 0, 83,112, 97, 99,101, 73,112,111, 0, 98, 68, +111,112,101, 83,104,101,101,116, 0, 83,112, 97, 99,101, 66,117,116,115, 0, 83,112, 97, 99,101, 83,101,113, 0, 70,105,108,101, + 83,101,108,101, 99,116, 80, 97,114, 97,109,115, 0, 83,112, 97, 99,101, 70,105,108,101, 0, 70,105,108,101, 76,105,115,116, 0, +119,109, 79,112,101,114, 97,116,111,114, 0, 70,105,108,101, 76, 97,121,111,117,116, 0, 83,112, 97, 99,101, 79,111,112,115, 0, + 84,114,101,101, 83,116,111,114,101, 0, 84,114,101,101, 83,116,111,114,101, 69,108,101,109, 0, 83,112, 97, 99,101, 73,109, 97, +103,101, 0, 83,112, 97, 99,101, 78,108, 97, 0, 83,112, 97, 99,101, 84,101,120,116, 0, 83, 99,114,105,112,116, 0, 83,112, 97, + 99,101, 83, 99,114,105,112,116, 0, 83,112, 97, 99,101, 84,105,109,101, 0, 83,112, 97, 99,101, 78,111,100,101, 0, 83,112, 97, + 99,101, 76,111,103,105, 99, 0, 83,112, 97, 99,101, 73,109, 97, 83,101,108, 0,117,105, 70,111,110,116, 0,117,105, 70,111,110, +116, 83,116,121,108,101, 0,117,105, 83,116,121,108,101, 0,117,105, 87,105,100,103,101,116, 67,111,108,111,114,115, 0,117,105, + 87,105,100,103,101,116, 83,116, 97,116,101, 67,111,108,111,114,115, 0, 84,104,101,109,101, 85, 73, 0, 84,104,101,109,101, 83, +112, 97, 99,101, 0, 84,104,101,109,101, 87,105,114,101, 67,111,108,111,114, 0, 98, 84,104,101,109,101, 0, 83,111,108,105,100, + 76,105,103,104,116, 0, 85,115,101,114, 68,101,102, 0, 83, 99,114, 86,101,114,116, 0, 83, 99,114, 69,100,103,101, 0, 80, 97, +110,101,108, 0, 80, 97,110,101,108, 84,121,112,101, 0,117,105, 76, 97,121,111,117,116, 0, 72,101, 97,100,101,114, 0, 72,101, + 97,100,101,114, 84,121,112,101, 0, 77,101,110,117, 0, 77,101,110,117, 84,121,112,101, 0, 83, 99,114, 65,114,101, 97, 0, 83, +112, 97, 99,101, 84,121,112,101, 0, 65, 82,101,103,105,111,110, 0, 65, 82,101,103,105,111,110, 84,121,112,101, 0, 70,105,108, +101, 71,108,111, 98, 97,108, 0, 83,116,114,105,112, 69,108,101,109, 0, 84, 83,116,114,105,112, 69,108,101,109, 0, 83,116,114, +105,112, 67,114,111,112, 0, 83,116,114,105,112, 84,114, 97,110,115,102,111,114,109, 0, 83,116,114,105,112, 67,111,108,111,114, + 66, 97,108, 97,110, 99,101, 0, 83,116,114,105,112, 80,114,111,120,121, 0, 83,116,114,105,112, 0, 80,108,117,103,105,110, 83, +101,113, 0, 83,101,113,117,101,110, 99,101, 0, 98, 83,111,117,110,100, 0,104,100, 97,117,100,105,111, 0, 77,101,116, 97, 83, +116, 97, 99,107, 0, 87,105,112,101, 86, 97,114,115, 0, 71,108,111,119, 86, 97,114,115, 0, 84,114, 97,110,115,102,111,114,109, + 86, 97,114,115, 0, 83,111,108,105,100, 67,111,108,111,114, 86, 97,114,115, 0, 83,112,101,101,100, 67,111,110,116,114,111,108, + 86, 97,114,115, 0, 69,102,102,101, 99,116, 0, 66,117,105,108,100, 69,102,102, 0, 80, 97,114,116, 69,102,102, 0, 80, 97,114, +116,105, 99,108,101, 0, 87, 97,118,101, 69,102,102, 0, 98, 80,114,111,112,101,114,116,121, 0, 98, 78,101, 97,114, 83,101,110, +115,111,114, 0, 98, 77,111,117,115,101, 83,101,110,115,111,114, 0, 98, 84,111,117, 99,104, 83,101,110,115,111,114, 0, 98, 75, +101,121, 98,111, 97,114,100, 83,101,110,115,111,114, 0, 98, 80,114,111,112,101,114,116,121, 83,101,110,115,111,114, 0, 98, 65, + 99,116,117, 97,116,111,114, 83,101,110,115,111,114, 0, 98, 68,101,108, 97,121, 83,101,110,115,111,114, 0, 98, 67,111,108,108, +105,115,105,111,110, 83,101,110,115,111,114, 0, 98, 82, 97,100, 97,114, 83,101,110,115,111,114, 0, 98, 82, 97,110,100,111,109, + 83,101,110,115,111,114, 0, 98, 82, 97,121, 83,101,110,115,111,114, 0, 98, 77,101,115,115, 97,103,101, 83,101,110,115,111,114, + 0, 98, 83,101,110,115,111,114, 0, 98, 67,111,110,116,114,111,108,108,101,114, 0, 98, 74,111,121,115,116,105, 99,107, 83,101, +110,115,111,114, 0, 98, 69,120,112,114,101,115,115,105,111,110, 67,111,110,116, 0, 98, 80,121,116,104,111,110, 67,111,110,116, + 0, 98, 65, 99,116,117, 97,116,111,114, 0, 98, 65,100,100, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 65, + 99,116,105,111,110, 65, 99,116,117, 97,116,111,114, 0, 98, 83,111,117,110,100, 65, 99,116,117, 97,116,111,114, 0, 98, 67, 68, + 65, 99,116,117, 97,116,111,114, 0, 98, 69,100,105,116, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 83, 99, +101,110,101, 65, 99,116,117, 97,116,111,114, 0, 98, 80,114,111,112,101,114,116,121, 65, 99,116,117, 97,116,111,114, 0, 98, 79, + 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 73,112,111, 65, 99,116,117, 97,116,111,114, 0, 98, 67, 97,109,101, +114, 97, 65, 99,116,117, 97,116,111,114, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 65, 99,116,117, 97,116,111,114, 0, 98, + 71,114,111,117,112, 65, 99,116,117, 97,116,111,114, 0, 98, 82, 97,110,100,111,109, 65, 99,116,117, 97,116,111,114, 0, 98, 77, +101,115,115, 97,103,101, 65, 99,116,117, 97,116,111,114, 0, 98, 71, 97,109,101, 65, 99,116,117, 97,116,111,114, 0, 98, 86,105, +115,105, 98,105,108,105,116,121, 65, 99,116,117, 97,116,111,114, 0, 98, 84,119,111, 68, 70,105,108,116,101,114, 65, 99,116,117, + 97,116,111,114, 0, 98, 80, 97,114,101,110,116, 65, 99,116,117, 97,116,111,114, 0, 98, 83,116, 97,116,101, 65, 99,116,117, 97, +116,111,114, 0, 70,114,101,101, 67, 97,109,101,114, 97, 0, 98, 83, 97,109,112,108,101, 0, 98, 83,111,117,110,100, 76,105,115, +116,101,110,101,114, 0, 83,112, 97, 99,101, 83,111,117,110,100, 0, 71,114,111,117,112, 79, 98,106,101, 99,116, 0, 66,111,110, +101, 0, 98, 65,114,109, 97,116,117,114,101, 0, 98, 80,111,115,101, 67,104, 97,110,110,101,108, 0, 98, 65, 99,116,105,111,110, + 71,114,111,117,112, 0, 83,112, 97, 99,101, 65, 99,116,105,111,110, 0, 98, 65, 99,116,105,111,110, 67,104, 97,110,110,101,108, + 0, 98, 67,111,110,115,116,114, 97,105,110,116, 67,104, 97,110,110,101,108, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 0, + 98, 67,111,110,115,116,114, 97,105,110,116, 84, 97,114,103,101,116, 0, 98, 80,121,116,104,111,110, 67,111,110,115,116,114, 97, +105,110,116, 0, 98, 75,105,110,101,109, 97,116,105, 99, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 84,114, 97, 99,107, 84, +111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, 97,116,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110, +116, 0, 98, 76,111, 99, 97,116,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 77,105,110, 77, 97,120, 67, +111,110,115,116,114, 97,105,110,116, 0, 98, 83,105,122,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 65, + 99,116,105,111,110, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 76,111, 99,107, 84,114, 97, 99,107, 67,111,110,115,116,114, + 97,105,110,116, 0, 98, 70,111,108,108,111,119, 80, 97,116,104, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,116,114,101, +116, 99,104, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,105,103,105,100, 66,111,100,121, 74,111,105,110,116, 67, +111,110,115,116,114, 97,105,110,116, 0, 98, 67,108, 97,109,112, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 67,104, +105,108,100, 79,102, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 84,114, 97,110,115,102,111,114,109, 67,111,110,115,116,114, + 97,105,110,116, 0, 98, 76,111, 99, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, 76,105,109, +105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,105,122,101, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110, +116, 0, 98, 68,105,115,116, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,104,114,105,110,107,119,114, + 97,112, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105,111,110, 77,111,100,105,102,105,101,114, 0, 98, 65, 99, +116,105,111,110, 83,116,114,105,112, 0, 98, 78,111,100,101, 83,116, 97, 99,107, 0, 98, 78,111,100,101, 83,111, 99,107,101,116, + 0, 98, 78,111,100,101, 76,105,110,107, 0, 98, 78,111,100,101, 0, 98, 78,111,100,101, 80,114,101,118,105,101,119, 0, 98, 78, +111,100,101, 84,121,112,101, 0, 78,111,100,101, 73,109, 97,103,101, 65,110,105,109, 0, 78,111,100,101, 66,108,117,114, 68, 97, +116, 97, 0, 78,111,100,101, 68, 66,108,117,114, 68, 97,116, 97, 0, 78,111,100,101, 66,105,108, 97,116,101,114, 97,108, 66,108, +117,114, 68, 97,116, 97, 0, 78,111,100,101, 72,117,101, 83, 97,116, 0, 78,111,100,101, 73,109, 97,103,101, 70,105,108,101, 0, + 78,111,100,101, 67,104,114,111,109, 97, 0, 78,111,100,101, 84,119,111, 88, 89,115, 0, 78,111,100,101, 84,119,111, 70,108,111, + 97,116,115, 0, 78,111,100,101, 71,101,111,109,101,116,114,121, 0, 78,111,100,101, 86,101,114,116,101,120, 67,111,108, 0, 78, +111,100,101, 68,101,102,111, 99,117,115, 0, 78,111,100,101, 83, 99,114,105,112,116, 68,105, 99,116, 0, 78,111,100,101, 71,108, + 97,114,101, 0, 78,111,100,101, 84,111,110,101,109, 97,112, 0, 78,111,100,101, 76,101,110,115, 68,105,115,116, 0, 84,101,120, + 78,111,100,101, 79,117,116,112,117,116, 0, 67,117,114,118,101, 77, 97,112, 80,111,105,110,116, 0, 67,117,114,118,101, 77, 97, +112, 0, 66,114,117,115,104, 67,108,111,110,101, 0, 67,117,115,116,111,109, 68, 97,116, 97, 76, 97,121,101,114, 0, 72, 97,105, +114, 75,101,121, 0, 80, 97,114,116,105, 99,108,101, 75,101,121, 0, 67,104,105,108,100, 80, 97,114,116,105, 99,108,101, 0, 75, +101,121,101,100, 80, 97,114,116,105, 99,108,101, 84, 97,114,103,101,116, 0, 80, 97,114,116,105, 99,108,101, 68, 97,116, 97, 0, + 80, 97,114,116,105, 99,108,101, 83,101,116,116,105,110,103,115, 0, 80, 97,114,116,105, 99,108,101, 69,100,105,116, 0, 80, 97, +114,116,105, 99,108,101, 67, 97, 99,104,101, 75,101,121, 0, 76,105,110,107, 78,111,100,101, 0, 98, 71, 80, 68,115,112,111,105, +110,116, 0, 98, 71, 80, 68,115,116,114,111,107,101, 0, 98, 71, 80, 68,102,114, 97,109,101, 0, 98, 71, 80, 68,108, 97,121,101, +114, 0,119,109, 87,105,110,100,111,119, 77, 97,110, 97,103,101,114, 0,119,109, 87,105,110,100,111,119, 0,119,109, 69,118,101, +110,116, 0,119,109, 83,117, 98, 87,105,110,100,111,119, 0,119,109, 71,101,115,116,117,114,101, 0,119,109, 75,101,121,109, 97, +112, 73,116,101,109, 0, 80,111,105,110,116,101,114, 82, 78, 65, 0,119,109, 75,101,121, 77, 97,112, 0,119,109, 79,112,101,114, + 97,116,111,114, 84,121,112,101, 0, 82,101,112,111,114,116, 76,105,115,116, 0, 70, 77,111,100,105,102,105,101,114, 0, 70, 77, +111,100, 95, 71,101,110,101,114, 97,116,111,114, 0, 70, 77,111,100, 95, 70,117,110, 99,116,105,111,110, 71,101,110,101,114, 97, +116,111,114, 0, 70, 67, 77, 95, 69,110,118,101,108,111,112,101, 68, 97,116, 97, 0, 70, 77,111,100, 95, 69,110,118,101,108,111, +112,101, 0, 70, 77,111,100, 95, 67,121, 99,108,101,115, 0, 70, 77,111,100, 95, 80,121,116,104,111,110, 0, 70, 77,111,100, 95, + 76,105,109,105,116,115, 0, 70, 77,111,100, 95, 78,111,105,115,101, 0, 68,114,105,118,101,114, 84, 97,114,103,101,116, 0, 67, +104, 97,110,110,101,108, 68,114,105,118,101,114, 0, 70, 80,111,105,110,116, 0, 70, 67,117,114,118,101, 0, 65,110,105,109, 77, + 97,112, 80, 97,105,114, 0, 65,110,105,109, 77, 97,112,112,101,114, 0, 78,108, 97, 83,116,114,105,112, 0, 78,108, 97, 84,114, + 97, 99,107, 0, 75, 83, 95, 80, 97,116,104, 0, 75,101,121,105,110,103, 83,101,116, 0, 65,110,105,109, 79,118,101,114,114,105, +100,101, 0, 73,100, 65,100,116, 84,101,109,112,108, 97,116,101, 0, 0, 0, 0, 84, 76, 69, 78, 1, 0, 1, 0, 2, 0, 2, 0, + 4, 0, 4, 0, 4, 0, 4, 0, 8, 0, 0, 0, 16, 0, 24, 0, 16, 0, 4, 0, 8, 0, 8, 0, 16, 0, 12, 0, 12, 0, 24, 0, + 16, 0, 16, 0, 32, 0, 16, 0, 16, 0, 32, 0, 96, 0, 72, 0, 72, 2, 0, 0, 40, 0,144, 0, 64, 4,112, 0, 36, 0, 56, 0, +112, 0,128, 0,168, 0, 88, 0, 24, 0, 40, 0, 48, 0,176, 0, 16, 0,176, 0, 40, 0, 96, 5,184, 1, 0, 0, 0, 0, 0, 0, +144, 0, 80, 1,120, 1, 24, 0, 8, 3,200, 0, 0, 0,232, 0,136, 0,248, 1, 56, 1, 80, 0,248, 2,104, 0, 88, 1, 0, 0, +128, 0,104, 0,192, 0, 80, 0, 8, 0, 16, 0,200, 1, 0, 0, 0, 0, 0, 0,144, 1, 20, 0, 48, 0, 64, 0, 24, 0, 12, 0, + 16, 0, 4, 0, 8, 0, 8, 0, 0, 0, 32, 0,112, 0, 48, 0, 8, 0, 16, 0, 8, 0, 8, 0, 4, 0, 4, 0, 0, 1, 32, 0, + 16, 0, 0, 0, 16, 0, 64, 0, 24, 0, 12, 0, 64, 0, 72, 0, 96, 0,112, 0,120, 0, 88, 0,120, 0,152, 0, 88, 0, 80, 0, +128, 0, 80, 0,176, 0,216, 0, 80, 0,112, 0,128, 0,216, 0,128, 0,208, 0, 72, 0,112, 0, 0, 0,136, 0, 32, 0,240, 0, +152, 0, 0, 0, 88, 0, 0, 0, 0, 0, 88, 0, 8, 0, 8, 0, 8, 1,104, 0,176, 1, 96, 0, 88, 0, 88, 0, 88, 0,184, 1, +136, 0,128, 0,232, 0, 48, 0,144, 0, 72, 0,120, 0,136, 0,176, 0,224, 0, 0, 0, 40, 0, 16, 0, 0, 0, 0, 0, 0, 0, +232, 1, 40, 0,184, 0,152, 0, 56, 0, 16, 0, 88, 0,248, 3, 64, 0, 16, 0, 88, 0, 24, 0, 40, 1, 8, 0, 88, 0, 88, 0, + 40, 0, 0, 0, 48, 0, 64, 1, 32, 0, 48, 2, 0, 0, 0, 0, 64, 0,248, 2,104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 32, 1, 56, 0,136, 0, 72, 0,208, 0,224, 0, 32, 0, 8, 1,224, 0,128, 1, 96, 0, 0, 0,120, 0, 0, 0, 24, 1, 16, 0, + 16, 0,168, 0,208, 0,144, 2,120, 2, 64, 0,184, 0, 16, 1, 72, 0,192, 2, 24, 1, 32, 0,232, 0, 32, 0, 32, 0, 48, 2, + 16, 1, 16, 0,160, 20, 56, 0, 64, 11, 32, 0, 40, 0, 80, 1, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0,184, 0, 0, 0, + 24, 1, 0, 0, 40, 0, 80, 0, 48, 0, 16, 0, 8, 0, 52, 0, 0, 1, 32, 1,200, 1, 8, 1, 72, 1, 0, 0, 32, 0, 12, 0, + 24, 0, 48, 0, 16, 0, 24, 0, 24, 0, 32, 0, 72, 1, 0, 0, 64, 0, 80, 0, 48, 0, 8, 0, 48, 0, 72, 0,104, 0, 40, 0, + 8, 0, 72, 0, 44, 0, 40, 0,108, 0, 72, 0, 96, 0,104, 0, 60, 0,128, 0, 80, 0, 80, 0, 16, 0, 96, 0, 32, 0, 20, 0, + 88, 0, 24, 0, 80, 0,112, 0, 84, 0, 32, 0, 96, 0, 64, 0, 56, 0,112, 0,140, 0, 4, 0, 24, 0, 16, 0, 8, 0, 40, 0, + 0, 0, 88, 0,208, 0, 40, 0, 24, 1,160, 0,232, 1,120, 0,248, 0, 88, 0, 56, 0, 80, 0,128, 0, 80, 0,112, 0, 56, 0, + 48, 0, 48, 0, 72, 0, 48, 0, 72, 0, 48, 0, 24, 0, 56, 0,104, 0, 16, 0,112, 0, 96, 0, 28, 0, 28, 0, 28, 0, 56, 0, + 24, 0, 72, 0,168, 0, 40, 0,144, 0, 56, 0, 0, 1, 0, 0, 0, 0, 16, 0, 40, 0, 28, 0, 12, 0, 12, 0, 16, 1, 40, 0, + 8, 0, 8, 0, 64, 0, 32, 0, 24, 0, 16, 0, 24, 0, 32, 0, 8, 0, 32, 0, 12, 0, 56, 0, 24, 0, 72, 0, 24, 0, 56, 0, + 72, 0, 40, 0, 8, 1, 40, 2, 0, 0, 0, 0, 0, 0, 16, 0, 32, 0, 40, 0,192, 0,208, 0,224, 0, 72, 0, 0, 0, 0, 0, +104, 0, 0, 0,104, 0, 0, 0, 0, 0,104, 0, 24, 0, 24, 0, 16, 0, 24, 0, 8, 0, 16, 0, 24, 0, 20, 0,104, 0, 32, 1, + 16, 0,104, 0, 0, 1, 40, 0,192, 0,104, 0,112, 0,104, 0, 32, 0, 80, 0, 83, 84, 82, 67,100, 1, 0, 0, 10, 0, 2, 0, + 10, 0, 0, 0, 10, 0, 1, 0, 11, 0, 3, 0, 11, 0, 0, 0, 11, 0, 1, 0, 9, 0, 2, 0, 12, 0, 2, 0, 9, 0, 3, 0, + 9, 0, 4, 0, 13, 0, 2, 0, 2, 0, 5, 0, 2, 0, 6, 0, 14, 0, 2, 0, 4, 0, 5, 0, 4, 0, 6, 0, 15, 0, 2, 0, + 7, 0, 5, 0, 7, 0, 6, 0, 16, 0, 2, 0, 8, 0, 5, 0, 8, 0, 6, 0, 17, 0, 3, 0, 4, 0, 5, 0, 4, 0, 6, 0, + 4, 0, 7, 0, 18, 0, 3, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0, 19, 0, 3, 0, 8, 0, 5, 0, 8, 0, 6, 0, + 8, 0, 7, 0, 20, 0, 4, 0, 4, 0, 5, 0, 4, 0, 6, 0, 4, 0, 7, 0, 4, 0, 8, 0, 21, 0, 4, 0, 7, 0, 5, 0, + 7, 0, 6, 0, 7, 0, 7, 0, 7, 0, 8, 0, 22, 0, 4, 0, 8, 0, 5, 0, 8, 0, 6, 0, 8, 0, 7, 0, 8, 0, 8, 0, + 23, 0, 4, 0, 4, 0, 9, 0, 4, 0, 10, 0, 4, 0, 11, 0, 4, 0, 12, 0, 24, 0, 4, 0, 7, 0, 9, 0, 7, 0, 10, 0, + 7, 0, 11, 0, 7, 0, 12, 0, 25, 0, 4, 0, 9, 0, 13, 0, 12, 0, 14, 0, 4, 0, 15, 0, 4, 0, 16, 0, 26, 0, 10, 0, + 26, 0, 0, 0, 26, 0, 1, 0, 0, 0, 17, 0, 0, 0, 18, 0, 2, 0, 19, 0, 0, 0, 20, 0, 4, 0, 21, 0, 25, 0, 22, 0, + 4, 0, 23, 0, 4, 0, 24, 0, 27, 0, 9, 0, 9, 0, 0, 0, 9, 0, 1, 0, 27, 0, 25, 0, 28, 0, 26, 0, 0, 0, 27, 0, + 2, 0, 28, 0, 2, 0, 19, 0, 4, 0, 29, 0, 26, 0, 30, 0, 28, 0, 8, 0, 27, 0, 31, 0, 27, 0, 32, 0, 29, 0, 33, 0, + 0, 0, 34, 0, 0, 0, 35, 0, 4, 0, 36, 0, 4, 0, 37, 0, 28, 0, 38, 0, 30, 0, 6, 0, 4, 0, 39, 0, 4, 0, 40, 0, + 2, 0, 41, 0, 2, 0, 42, 0, 2, 0, 43, 0, 4, 0, 44, 0, 31, 0, 6, 0, 32, 0, 45, 0, 2, 0, 46, 0, 2, 0, 47, 0, + 2, 0, 17, 0, 2, 0, 19, 0, 0, 0, 48, 0, 33, 0, 21, 0, 33, 0, 0, 0, 33, 0, 1, 0, 34, 0, 49, 0, 35, 0, 50, 0, + 24, 0, 51, 0, 24, 0, 52, 0, 2, 0, 46, 0, 2, 0, 47, 0, 2, 0, 53, 0, 2, 0, 54, 0, 2, 0, 55, 0, 2, 0, 56, 0, + 2, 0, 19, 0, 2, 0, 57, 0, 7, 0, 11, 0, 7, 0, 12, 0, 4, 0, 58, 0, 7, 0, 59, 0, 7, 0, 60, 0, 7, 0, 61, 0, + 31, 0, 62, 0, 36, 0, 7, 0, 27, 0, 31, 0, 12, 0, 63, 0, 24, 0, 64, 0, 2, 0, 46, 0, 2, 0, 65, 0, 2, 0, 66, 0, + 2, 0, 37, 0, 37, 0, 16, 0, 37, 0, 0, 0, 37, 0, 1, 0, 7, 0, 67, 0, 7, 0, 61, 0, 2, 0, 17, 0, 2, 0, 47, 0, + 2, 0, 68, 0, 2, 0, 19, 0, 4, 0, 69, 0, 4, 0, 70, 0, 9, 0, 2, 0, 7, 0, 71, 0, 0, 0, 20, 0, 0, 0, 72, 0, + 7, 0, 73, 0, 7, 0, 74, 0, 38, 0, 13, 0, 27, 0, 31, 0, 39, 0, 75, 0, 37, 0, 76, 0, 0, 0, 77, 0, 4, 0, 78, 0, + 7, 0, 61, 0, 12, 0, 79, 0, 36, 0, 80, 0, 27, 0, 81, 0, 2, 0, 17, 0, 2, 0, 82, 0, 2, 0, 83, 0, 2, 0, 19, 0, + 40, 0, 5, 0, 27, 0, 84, 0, 2, 0, 85, 0, 2, 0, 86, 0, 2, 0, 87, 0, 4, 0, 37, 0, 41, 0, 6, 0, 41, 0, 0, 0, + 41, 0, 1, 0, 0, 0, 88, 0, 0, 0, 89, 0, 4, 0, 23, 0, 4, 0, 90, 0, 42, 0, 10, 0, 42, 0, 0, 0, 42, 0, 1, 0, + 4, 0, 91, 0, 4, 0, 92, 0, 4, 0, 93, 0, 4, 0, 43, 0, 4, 0, 14, 0, 4, 0, 94, 0, 0, 0, 95, 0, 0, 0, 96, 0, + 43, 0, 15, 0, 27, 0, 31, 0, 0, 0, 97, 0, 4, 0, 94, 0, 4, 0, 98, 0, 12, 0, 99, 0, 41, 0,100, 0, 41, 0,101, 0, + 4, 0,102, 0, 4, 0,103, 0, 12, 0,104, 0, 0, 0,105, 0, 4, 0,106, 0, 4, 0,107, 0, 9, 0,108, 0, 8, 0,109, 0, + 44, 0, 3, 0, 4, 0,110, 0, 4, 0,111, 0, 9, 0, 2, 0, 45, 0, 21, 0, 27, 0, 31, 0, 39, 0, 75, 0, 2, 0, 17, 0, + 2, 0, 19, 0, 7, 0,112, 0, 7, 0,113, 0, 7, 0,114, 0, 7, 0,115, 0, 7, 0,116, 0, 7, 0,117, 0, 7, 0,118, 0, + 7, 0,119, 0, 7, 0,120, 0, 7, 0,121, 0, 7, 0,122, 0, 2, 0,123, 0, 2, 0,124, 0, 7, 0,125, 0, 36, 0, 80, 0, + 40, 0,126, 0, 32, 0,127, 0, 46, 0, 13, 0, 4, 0,128, 0, 4, 0,129, 0, 4, 0,130, 0, 4, 0,131, 0, 2, 0,132, 0, + 2, 0,133, 0, 2, 0, 19, 0, 2, 0,134, 0, 2, 0,135, 0, 2, 0,136, 0, 2, 0,137, 0, 2, 0,138, 0, 47, 0,139, 0, + 48, 0, 32, 0, 27, 0, 31, 0, 0, 0, 34, 0, 12, 0,140, 0, 49, 0,141, 0, 50, 0,142, 0, 51, 0,143, 0, 2, 0,134, 0, + 2, 0, 19, 0, 2, 0,144, 0, 2, 0, 17, 0, 2, 0, 37, 0, 2, 0, 43, 0, 4, 0,145, 0, 2, 0,146, 0, 2, 0,147, 0, + 2, 0,148, 0, 2, 0,149, 0, 2, 0,150, 0, 2, 0,151, 0, 4, 0,152, 0, 4, 0,153, 0, 44, 0,154, 0, 30, 0,155, 0, + 0, 0,156, 0, 7, 0,157, 0, 4, 0,158, 0, 2, 0,159, 0, 2, 0,160, 0, 2, 0,161, 0, 2, 0,162, 0, 7, 0,163, 0, + 7, 0,164, 0, 52, 0, 31, 0, 2, 0,165, 0, 2, 0,166, 0, 2, 0,167, 0, 2, 0,168, 0, 32, 0,169, 0, 53, 0,170, 0, + 0, 0,171, 0, 0, 0,172, 0, 0, 0,173, 0, 0, 0,174, 0, 0, 0,175, 0, 7, 0,176, 0, 7, 0,177, 0, 2, 0,178, 0, + 2, 0,179, 0, 2, 0,180, 0, 2, 0,181, 0, 2, 0,182, 0, 2, 0,183, 0, 2, 0,184, 0, 7, 0,185, 0, 7, 0,186, 0, + 7, 0,187, 0, 7, 0,188, 0, 7, 0,189, 0, 7, 0, 57, 0, 7, 0,190, 0, 7, 0,191, 0, 7, 0,192, 0, 7, 0,193, 0, + 7, 0,194, 0, 54, 0, 15, 0, 0, 0,195, 0, 9, 0,196, 0, 0, 0,197, 0, 0, 0,198, 0, 4, 0,199, 0, 4, 0,200, 0, + 9, 0,201, 0, 7, 0,202, 0, 7, 0,203, 0, 7, 0,204, 0, 4, 0,205, 0, 9, 0,206, 0, 9, 0,207, 0, 4, 0,208, 0, + 4, 0, 37, 0, 55, 0, 6, 0, 7, 0,185, 0, 7, 0,186, 0, 7, 0,187, 0, 7, 0,209, 0, 7, 0, 67, 0, 4, 0, 64, 0, + 56, 0, 5, 0, 2, 0, 19, 0, 2, 0, 36, 0, 2, 0, 64, 0, 2, 0,210, 0, 55, 0,204, 0, 57, 0, 17, 0, 32, 0,169, 0, + 48, 0,211, 0, 58, 0,212, 0, 7, 0,213, 0, 7, 0,214, 0, 2, 0, 17, 0, 2, 0,215, 0, 7, 0,114, 0, 7, 0,115, 0, + 7, 0,216, 0, 4, 0,217, 0, 2, 0,218, 0, 2, 0,219, 0, 4, 0,134, 0, 4, 0,145, 0, 2, 0,220, 0, 2, 0,221, 0, + 53, 0, 57, 0, 27, 0, 31, 0, 39, 0, 75, 0, 7, 0,222, 0, 7, 0,223, 0, 7, 0,224, 0, 7, 0,225, 0, 7, 0,226, 0, + 7, 0,227, 0, 7, 0,228, 0, 7, 0,229, 0, 7, 0,230, 0, 7, 0,231, 0, 7, 0,232, 0, 7, 0,233, 0, 7, 0,234, 0, + 7, 0,235, 0, 7, 0,236, 0, 7, 0,237, 0, 7, 0,238, 0, 7, 0,239, 0, 7, 0,240, 0, 7, 0,241, 0, 2, 0,242, 0, + 2, 0,243, 0, 2, 0,244, 0, 2, 0,245, 0, 2, 0,246, 0, 2, 0,247, 0, 2, 0,248, 0, 2, 0, 19, 0, 2, 0, 17, 0, + 2, 0,215, 0, 7, 0,249, 0, 7, 0,250, 0, 7, 0,251, 0, 7, 0,252, 0, 2, 0,253, 0, 2, 0,254, 0, 2, 0,255, 0, + 2, 0,132, 0, 4, 0, 23, 0, 4, 0,129, 0, 4, 0,130, 0, 4, 0,131, 0, 7, 0, 0, 1, 7, 0, 1, 1, 7, 0,191, 0, + 46, 0, 2, 1, 59, 0, 3, 1, 36, 0, 80, 0, 48, 0,211, 0, 54, 0, 4, 1, 56, 0, 5, 1, 57, 0, 6, 1, 30, 0,155, 0, + 0, 0, 7, 1, 0, 0, 8, 1, 60, 0, 8, 0, 7, 0, 9, 1, 7, 0, 10, 1, 7, 0,177, 0, 4, 0, 19, 0, 7, 0, 11, 1, + 7, 0, 12, 1, 7, 0, 13, 1, 32, 0, 45, 0, 61, 0, 81, 0, 27, 0, 31, 0, 39, 0, 75, 0, 2, 0, 17, 0, 2, 0, 19, 0, + 4, 0, 14, 1, 2, 0,179, 0, 2, 0, 15, 1, 7, 0,185, 0, 7, 0,186, 0, 7, 0,187, 0, 7, 0,188, 0, 7, 0, 16, 1, + 7, 0, 17, 1, 7, 0, 18, 1, 7, 0, 19, 1, 7, 0, 20, 1, 7, 0, 21, 1, 7, 0, 22, 1, 7, 0, 23, 1, 7, 0, 24, 1, + 7, 0, 25, 1, 7, 0, 26, 1, 62, 0, 27, 1, 2, 0, 28, 1, 2, 0, 70, 0, 7, 0,114, 0, 7, 0,115, 0, 7, 0, 29, 1, + 7, 0, 30, 1, 7, 0, 31, 1, 2, 0, 32, 1, 2, 0, 33, 1, 2, 0, 34, 1, 2, 0, 35, 1, 0, 0, 36, 1, 0, 0, 37, 1, + 2, 0, 38, 1, 2, 0, 39, 1, 2, 0, 40, 1, 2, 0, 41, 1, 2, 0, 42, 1, 7, 0, 43, 1, 7, 0, 44, 1, 7, 0, 45, 1, + 7, 0, 46, 1, 2, 0, 47, 1, 2, 0, 43, 0, 2, 0, 48, 1, 2, 0, 49, 1, 2, 0, 50, 1, 2, 0, 51, 1, 7, 0, 52, 1, + 7, 0, 53, 1, 7, 0, 54, 1, 7, 0, 55, 1, 7, 0, 56, 1, 7, 0, 57, 1, 7, 0, 58, 1, 7, 0, 59, 1, 7, 0, 60, 1, + 7, 0, 61, 1, 7, 0, 62, 1, 7, 0, 63, 1, 2, 0, 64, 1, 2, 0, 65, 1, 4, 0, 66, 1, 4, 0, 67, 1, 2, 0, 68, 1, + 2, 0, 69, 1, 2, 0, 70, 1, 2, 0, 71, 1, 7, 0, 72, 1, 7, 0, 73, 1, 7, 0, 74, 1, 7, 0, 75, 1, 2, 0, 76, 1, + 2, 0, 77, 1, 52, 0, 78, 1, 36, 0, 80, 0, 30, 0,155, 0, 40, 0,126, 0, 63, 0, 2, 0, 27, 0, 31, 0, 36, 0, 80, 0, + 64, 0,130, 0, 27, 0, 31, 0, 39, 0, 75, 0, 2, 0, 79, 1, 2, 0, 19, 0, 7, 0,185, 0, 7, 0,186, 0, 7, 0,187, 0, + 7, 0, 80, 1, 7, 0, 81, 1, 7, 0, 82, 1, 7, 0, 83, 1, 7, 0, 84, 1, 7, 0, 85, 1, 7, 0, 86, 1, 7, 0, 87, 1, + 7, 0, 88, 1, 7, 0, 89, 1, 7, 0, 90, 1, 7, 0, 91, 1, 7, 0, 92, 1, 7, 0, 93, 1, 7, 0, 94, 1, 7, 0, 95, 1, + 7, 0, 96, 1, 7, 0, 97, 1, 7, 0, 98, 1, 7, 0, 99, 1, 7, 0,100, 1, 7, 0,101, 1, 7, 0,102, 1, 7, 0,103, 1, + 7, 0,104, 1, 7, 0,105, 1, 7, 0,106, 1, 2, 0,107, 1, 2, 0,108, 1, 2, 0,109, 1, 0, 0,110, 1, 0, 0,111, 1, + 7, 0,112, 1, 7, 0,113, 1, 2, 0,114, 1, 2, 0,115, 1, 7, 0,116, 1, 7, 0,117, 1, 7, 0,118, 1, 7, 0,119, 1, + 2, 0,120, 1, 2, 0,121, 1, 4, 0, 14, 1, 4, 0,122, 1, 2, 0,123, 1, 2, 0,124, 1, 2, 0,125, 1, 2, 0,126, 1, + 7, 0,127, 1, 7, 0,128, 1, 7, 0,129, 1, 7, 0,130, 1, 7, 0,131, 1, 7, 0,132, 1, 7, 0,133, 1, 7, 0,134, 1, + 7, 0,135, 1, 7, 0,136, 1, 0, 0,137, 1, 7, 0,138, 1, 7, 0,139, 1, 7, 0,140, 1, 4, 0,141, 1, 0, 0,142, 1, + 0, 0, 48, 1, 0, 0,143, 1, 0, 0, 7, 1, 2, 0,144, 1, 2, 0,145, 1, 2, 0, 65, 1, 2, 0,146, 1, 2, 0,147, 1, + 2, 0,148, 1, 7, 0,149, 1, 7, 0,150, 1, 7, 0,151, 1, 7, 0,152, 1, 7, 0,153, 1, 2, 0,165, 0, 2, 0,166, 0, + 56, 0,154, 1, 56, 0,155, 1, 0, 0,156, 1, 0, 0,157, 1, 0, 0,158, 1, 0, 0,159, 1, 2, 0,160, 1, 2, 0,161, 1, + 7, 0,162, 1, 7, 0,163, 1, 52, 0, 78, 1, 59, 0, 3, 1, 36, 0, 80, 0, 65, 0,164, 1, 30, 0,155, 0, 7, 0,165, 1, + 7, 0,166, 1, 7, 0,167, 1, 7, 0,168, 1, 7, 0,169, 1, 2, 0,170, 1, 2, 0, 70, 0, 7, 0,171, 1, 7, 0,172, 1, + 7, 0,173, 1, 7, 0,174, 1, 7, 0,175, 1, 7, 0,176, 1, 7, 0,177, 1, 7, 0,178, 1, 7, 0,179, 1, 2, 0,180, 1, + 2, 0,181, 1, 7, 0,182, 1, 7, 0,183, 1, 7, 0,184, 1, 7, 0,185, 1, 7, 0,186, 1, 4, 0,187, 1, 4, 0,188, 1, + 4, 0,189, 1, 40, 0,126, 0, 12, 0,190, 1, 66, 0, 4, 0, 27, 0, 31, 0, 0, 0,191, 1, 67, 0, 2, 0, 44, 0,154, 0, + 68, 0, 26, 0, 68, 0, 0, 0, 68, 0, 1, 0, 69, 0,192, 1, 4, 0,193, 1, 4, 0,194, 1, 4, 0,195, 1, 4, 0,196, 1, + 4, 0,197, 1, 4, 0,198, 1, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0,199, 1, 2, 0,200, 1, 7, 0, 5, 0, 7, 0, 6, 0, + 7, 0, 7, 0, 7, 0,201, 1, 7, 0,202, 1, 7, 0,203, 1, 7, 0,204, 1, 7, 0,205, 1, 7, 0,206, 1, 7, 0,207, 1, + 7, 0, 23, 0, 7, 0,208, 1, 7, 0,209, 1, 70, 0, 16, 0, 27, 0, 31, 0, 69, 0,192, 1, 12, 0,210, 1, 12, 0,211, 1, + 12, 0,212, 1, 36, 0, 80, 0, 64, 0,213, 1, 2, 0, 19, 0, 2, 0,214, 1, 4, 0,178, 0, 7, 0, 9, 1, 7, 0,177, 0, + 7, 0, 10, 1, 7, 0,215, 1, 7, 0,216, 1, 7, 0,217, 1, 35, 0, 11, 0, 7, 0,218, 1, 7, 0,219, 1, 7, 0,220, 1, + 7, 0,221, 1, 2, 0, 55, 0, 0, 0,222, 1, 0, 0,223, 1, 0, 0,224, 1, 0, 0,225, 1, 0, 0,226, 1, 0, 0,227, 1, + 34, 0, 7, 0, 7, 0,228, 1, 7, 0,219, 1, 7, 0,220, 1, 2, 0,224, 1, 2, 0,227, 1, 7, 0,221, 1, 7, 0, 37, 0, + 71, 0, 21, 0, 71, 0, 0, 0, 71, 0, 1, 0, 2, 0, 17, 0, 2, 0,229, 1, 2, 0,227, 1, 2, 0, 19, 0, 2, 0,230, 1, + 2, 0,231, 1, 2, 0,232, 1, 2, 0,233, 1, 2, 0,234, 1, 2, 0,235, 1, 2, 0,236, 1, 2, 0,237, 1, 7, 0,238, 1, + 7, 0,239, 1, 34, 0, 49, 0, 35, 0, 50, 0, 2, 0,240, 1, 2, 0,241, 1, 4, 0,242, 1, 72, 0, 5, 0, 2, 0,243, 1, + 2, 0,229, 1, 0, 0, 19, 0, 0, 0, 37, 0, 2, 0, 70, 0, 73, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 8, 0, + 7, 0,244, 1, 74, 0, 62, 0, 27, 0, 31, 0, 39, 0, 75, 0, 69, 0,192, 1, 12, 0,245, 1, 12, 0,211, 1, 12, 0,246, 1, + 32, 0,247, 1, 32, 0,248, 1, 32, 0,249, 1, 36, 0, 80, 0, 75, 0,250, 1, 38, 0,251, 1, 64, 0,213, 1, 12, 0,252, 1, + 7, 0, 9, 1, 7, 0,177, 0, 7, 0, 10, 1, 4, 0,178, 0, 2, 0,253, 1, 2, 0,214, 1, 2, 0, 19, 0, 2, 0,254, 1, + 7, 0,255, 1, 7, 0, 0, 2, 7, 0, 1, 2, 2, 0,232, 1, 2, 0,233, 1, 2, 0, 2, 2, 2, 0, 3, 2, 4, 0, 4, 2, + 34, 0, 5, 2, 2, 0, 23, 0, 2, 0, 99, 0, 2, 0, 67, 0, 2, 0, 6, 2, 7, 0, 7, 2, 7, 0, 8, 2, 7, 0, 9, 2, + 7, 0, 10, 2, 7, 0, 11, 2, 7, 0, 12, 2, 7, 0, 13, 2, 7, 0, 14, 2, 7, 0, 15, 2, 7, 0, 16, 2, 0, 0, 17, 2, + 76, 0, 18, 2, 77, 0, 19, 2, 0, 0, 20, 2, 66, 0, 21, 2, 66, 0, 22, 2, 66, 0, 23, 2, 66, 0, 24, 2, 4, 0, 25, 2, + 7, 0, 26, 2, 4, 0, 27, 2, 4, 0, 28, 2, 73, 0, 29, 2, 4, 0, 30, 2, 4, 0, 31, 2, 72, 0, 32, 2, 72, 0, 33, 2, + 78, 0, 39, 0, 27, 0, 31, 0, 69, 0,192, 1, 12, 0, 34, 2, 36, 0, 80, 0, 38, 0,251, 1, 64, 0,213, 1, 79, 0, 35, 2, + 80, 0, 36, 2, 81, 0, 37, 2, 82, 0, 38, 2, 83, 0, 39, 2, 84, 0, 40, 2, 85, 0, 41, 2, 86, 0, 42, 2, 78, 0, 43, 2, + 87, 0, 44, 2, 88, 0, 45, 2, 89, 0, 46, 2, 89, 0, 47, 2, 89, 0, 48, 2, 4, 0, 54, 0, 4, 0, 49, 2, 4, 0, 50, 2, + 4, 0, 51, 2, 4, 0, 52, 2, 4, 0,178, 0, 7, 0, 9, 1, 7, 0,177, 0, 7, 0, 10, 1, 7, 0, 53, 2, 4, 0, 54, 2, + 2, 0, 55, 2, 2, 0, 19, 0, 2, 0, 56, 2, 2, 0, 57, 2, 2, 0,214, 1, 2, 0, 58, 2, 90, 0, 59, 2, 91, 0, 60, 2, + 81, 0, 8, 0, 9, 0, 61, 2, 7, 0, 62, 2, 4, 0, 63, 2, 0, 0, 19, 0, 0, 0, 64, 2, 2, 0, 14, 1, 2, 0, 65, 2, + 2, 0, 66, 2, 79, 0, 7, 0, 4, 0, 67, 2, 4, 0, 68, 2, 4, 0, 69, 2, 4, 0, 70, 2, 2, 0,229, 1, 0, 0, 71, 2, + 0, 0, 19, 0, 83, 0, 5, 0, 4, 0, 67, 2, 4, 0, 68, 2, 0, 0, 72, 2, 0, 0, 73, 2, 2, 0, 19, 0, 92, 0, 2, 0, + 4, 0, 74, 2, 7, 0,220, 1, 84, 0, 3, 0, 92, 0, 75, 2, 4, 0, 76, 2, 4, 0, 19, 0, 82, 0, 6, 0, 7, 0, 77, 2, + 2, 0, 78, 2, 2, 0,229, 1, 0, 0, 19, 0, 0, 0, 73, 2, 0, 0,184, 0, 85, 0, 4, 0, 0, 0,209, 0, 0, 0,185, 0, + 0, 0,186, 0, 0, 0,187, 0, 93, 0, 6, 0, 48, 0, 61, 2, 0, 0, 19, 0, 0, 0, 64, 2, 2, 0, 14, 1, 2, 0, 65, 2, + 2, 0, 66, 2, 94, 0, 1, 0, 7, 0, 79, 2, 95, 0, 5, 0, 0, 0,209, 0, 0, 0,185, 0, 0, 0,186, 0, 0, 0,187, 0, + 4, 0, 37, 0, 86, 0, 1, 0, 7, 0, 80, 2, 87, 0, 2, 0, 4, 0, 81, 2, 4, 0, 17, 0, 80, 0, 7, 0, 7, 0, 62, 2, + 48, 0, 61, 2, 0, 0, 19, 0, 0, 0, 64, 2, 2, 0, 14, 1, 2, 0, 65, 2, 2, 0, 66, 2, 96, 0, 1, 0, 7, 0, 82, 2, + 97, 0, 1, 0, 4, 0, 83, 2, 98, 0, 1, 0, 0, 0, 84, 2, 99, 0, 1, 0, 7, 0, 62, 2,100, 0, 3, 0, 4, 0, 85, 2, + 0, 0, 96, 0, 7, 0, 86, 2,102, 0, 4, 0, 7, 0,209, 0, 7, 0,185, 0, 7, 0,186, 0, 7, 0,187, 0,103, 0, 1, 0, +102, 0, 63, 2,104, 0, 5, 0, 4, 0, 87, 2, 4, 0, 88, 2, 0, 0, 19, 0, 0, 0,229, 1, 0, 0,184, 0,105, 0, 2, 0, + 4, 0, 89, 2, 4, 0, 88, 2,106, 0, 10, 0,106, 0, 0, 0,106, 0, 1, 0,104, 0, 90, 2,103, 0, 91, 2,105, 0, 92, 2, + 4, 0, 54, 0, 4, 0, 50, 2, 4, 0, 49, 2, 4, 0, 37, 0, 82, 0, 93, 2, 90, 0, 14, 0, 12, 0, 94, 2, 82, 0, 93, 2, + 0, 0, 95, 2, 0, 0, 96, 2, 0, 0, 97, 2, 0, 0, 98, 2, 0, 0, 99, 2, 0, 0,100, 2, 0, 0,101, 2, 0, 0, 19, 0, + 89, 0, 46, 2, 89, 0, 48, 2, 2, 0,102, 2, 0, 0,103, 2, 91, 0, 8, 0, 4, 0,104, 2, 4, 0,105, 2, 79, 0,106, 2, + 83, 0,107, 2, 4, 0, 50, 2, 4, 0, 49, 2, 4, 0, 54, 0, 4, 0, 37, 0,107, 0, 7, 0,107, 0, 0, 0,107, 0, 1, 0, + 4, 0, 17, 0, 4, 0, 14, 1, 0, 0, 20, 0, 47, 0,139, 0, 0, 0,108, 2,108, 0, 7, 0,107, 0,109, 2, 2, 0,110, 2, + 2, 0, 94, 2, 2, 0,111, 2, 2, 0, 94, 0, 9, 0,112, 2, 9, 0,113, 2,109, 0, 3, 0,107, 0,109, 2, 32, 0,169, 0, + 0, 0, 20, 0,110, 0, 5, 0,107, 0,109, 2, 32, 0,169, 0, 0, 0, 20, 0, 2, 0,114, 2, 0, 0,115, 2,111, 0, 5, 0, +107, 0,109, 2, 7, 0, 92, 0, 7, 0,116, 2, 4, 0,117, 2, 4, 0,118, 2,112, 0, 5, 0,107, 0,109, 2, 32, 0,119, 2, + 0, 0, 72, 0, 4, 0, 14, 1, 4, 0, 19, 0,113, 0, 13, 0,107, 0,109, 2, 32, 0,120, 2, 32, 0,121, 2, 32, 0,122, 2, + 32, 0,123, 2, 7, 0,124, 2, 7, 0,125, 2, 7, 0,116, 2, 7, 0,126, 2, 4, 0,127, 2, 4, 0,128, 2, 4, 0, 94, 0, + 4, 0,129, 2,114, 0, 5, 0,107, 0,109, 2, 2, 0,130, 2, 2, 0, 19, 0, 7, 0,131, 2, 32, 0,132, 2,115, 0, 3, 0, +107, 0,109, 2, 7, 0,133, 2, 4, 0, 94, 0,116, 0, 10, 0,107, 0,109, 2, 7, 0,134, 2, 4, 0,135, 2, 4, 0, 37, 0, + 2, 0, 94, 0, 2, 0,136, 2, 2, 0,137, 2, 2, 0,138, 2, 7, 0,139, 2, 0, 0,140, 2,117, 0, 3, 0,107, 0,109, 2, + 7, 0, 37, 0, 4, 0, 17, 0,118, 0, 11, 0,107, 0,109, 2, 53, 0,141, 2, 7, 0,142, 2, 4, 0,143, 2, 0, 0,140, 2, + 7, 0,144, 2, 4, 0,145, 2, 32, 0,146, 2, 0, 0,147, 2, 4, 0,148, 2, 4, 0, 37, 0,119, 0, 10, 0,107, 0,109, 2, + 32, 0,149, 2, 48, 0,150, 2, 4, 0, 94, 0, 4, 0,151, 2, 7, 0,152, 2, 7, 0,153, 2, 0, 0,147, 2, 4, 0,148, 2, + 4, 0, 37, 0,120, 0, 3, 0,107, 0,109, 2, 7, 0,154, 2, 4, 0,155, 2,121, 0, 5, 0,107, 0,109, 2, 7, 0,156, 2, + 0, 0,140, 2, 2, 0, 19, 0, 2, 0,157, 2,122, 0, 8, 0,107, 0,109, 2, 32, 0,169, 0, 7, 0,156, 2, 7, 0,221, 1, + 7, 0,110, 0, 0, 0,140, 2, 2, 0, 19, 0, 2, 0, 17, 0,123, 0, 21, 0,107, 0,109, 2, 32, 0,158, 2, 0, 0,140, 2, + 53, 0,141, 2, 32, 0,146, 2, 2, 0, 19, 0, 2, 0, 37, 0, 7, 0,159, 2, 7, 0,160, 2, 7, 0,161, 2, 7, 0,255, 1, + 7, 0,162, 2, 7, 0,163, 2, 7, 0,164, 2, 7, 0,165, 2, 4, 0,145, 2, 4, 0,148, 2, 0, 0,147, 2, 7, 0,166, 2, + 7, 0,167, 2, 7, 0, 43, 0,124, 0, 7, 0,107, 0,109, 2, 2, 0,168, 2, 2, 0,169, 2, 4, 0, 70, 0, 32, 0,169, 0, + 7, 0,170, 2, 0, 0,140, 2,125, 0, 9, 0,107, 0,109, 2, 32, 0,169, 0, 7, 0,171, 2, 7, 0,172, 2, 7, 0,165, 2, + 4, 0,173, 2, 4, 0,174, 2, 7, 0,175, 2, 0, 0, 20, 0,126, 0, 1, 0,107, 0,109, 2,127, 0, 6, 0,107, 0,109, 2, + 47, 0,139, 0,128, 0,176, 2,129, 0,177, 2,130, 0,178, 2,131, 0,179, 2,132, 0, 14, 0,107, 0,109, 2, 82, 0,180, 2, + 82, 0,181, 2, 82, 0,182, 2, 82, 0,183, 2, 82, 0,184, 2, 82, 0,185, 2, 79, 0,186, 2, 4, 0,187, 2, 4, 0,188, 2, + 2, 0,189, 2, 2, 0, 37, 0, 7, 0,190, 2,133, 0,191, 2,134, 0, 3, 0,107, 0,109, 2,135, 0,192, 2,136, 0,191, 2, +137, 0, 4, 0,107, 0,109, 2, 32, 0,169, 0, 4, 0,193, 2, 4, 0, 37, 0,138, 0, 2, 0, 4, 0,194, 2, 7, 0,220, 1, +139, 0, 2, 0, 4, 0,130, 0, 4, 0,195, 2,140, 0, 20, 0,107, 0,109, 2, 32, 0,169, 0, 0, 0,140, 2, 2, 0,196, 2, + 2, 0,197, 2, 2, 0, 19, 0, 2, 0, 37, 0, 7, 0,198, 2, 7, 0,199, 2, 4, 0, 54, 0, 4, 0,200, 2,139, 0,201, 2, +138, 0,202, 2, 4, 0,203, 2, 4, 0,204, 2, 4, 0,205, 2, 4, 0,195, 2, 7, 0,206, 2, 7, 0,207, 2, 7, 0,208, 2, +141, 0, 8, 0,107, 0,109, 2,142, 0,209, 2,135, 0,192, 2, 4, 0,210, 2, 4, 0,211, 2, 4, 0,212, 2, 2, 0, 19, 0, + 2, 0, 57, 0,143, 0, 8, 0,107, 0,109, 2, 32, 0, 45, 0, 2, 0,213, 2, 2, 0, 19, 0, 2, 0,130, 2, 2, 0, 57, 0, + 7, 0,214, 2, 7, 0,215, 2,144, 0, 5, 0,107, 0,109, 2, 4, 0,216, 2, 2, 0, 19, 0, 2, 0,217, 2, 7, 0,218, 2, +145, 0, 7, 0,107, 0,109, 2, 82, 0,219, 2, 4, 0,220, 2, 0, 0,221, 2, 0, 0,222, 2, 0, 0,223, 2, 0, 0,224, 2, +146, 0, 3, 0,107, 0,109, 2,147, 0,225, 2,131, 0,179, 2,148, 0, 10, 0,107, 0,109, 2, 32, 0,226, 2, 32, 0,227, 2, + 0, 0,228, 2, 7, 0,229, 2, 2, 0,230, 2, 2, 0,231, 2, 0, 0,232, 2, 0, 0,233, 2, 0, 0,115, 2,149, 0, 9, 0, +107, 0,109, 2, 32, 0,234, 2, 0, 0,228, 2, 7, 0,235, 2, 7, 0,236, 2, 0, 0, 14, 1, 0, 0,130, 2, 0, 0,237, 2, + 0, 0, 37, 0,150, 0, 27, 0, 27, 0, 31, 0, 2, 0,230, 1, 2, 0,231, 1, 2, 0,238, 2, 2, 0, 19, 0, 2, 0,239, 2, + 2, 0,240, 2, 2, 0,241, 2, 2, 0, 70, 0, 0, 0,242, 2, 0, 0,243, 2, 0, 0,244, 2, 0, 0, 17, 0, 4, 0, 37, 0, + 7, 0,245, 2, 7, 0,246, 2, 7, 0,247, 2, 7, 0,248, 2, 7, 0,249, 2, 7, 0,250, 2, 34, 0,251, 2, 36, 0, 80, 0, + 38, 0,251, 1, 84, 0, 40, 2, 7, 0,252, 2, 7, 0,253, 2,150, 0,254, 2,151, 0, 3, 0,151, 0, 0, 0,151, 0, 1, 0, + 0, 0, 20, 0, 69, 0, 3, 0, 7, 0,255, 2, 4, 0, 19, 0, 4, 0, 37, 0, 32, 0,112, 0, 27, 0, 31, 0, 39, 0, 75, 0, + 2, 0, 17, 0, 2, 0, 0, 3, 4, 0, 1, 3, 4, 0, 2, 3, 4, 0, 3, 3, 0, 0, 4, 3, 32, 0, 38, 0, 32, 0, 5, 3, + 32, 0, 6, 3, 32, 0, 7, 3, 32, 0, 8, 3, 36, 0, 80, 0, 75, 0,250, 1, 69, 0,192, 1,152, 0, 9, 3,152, 0, 10, 3, +153, 0, 11, 3, 9, 0, 2, 0, 12, 0, 12, 3, 12, 0, 34, 2, 12, 0,211, 1, 12, 0, 13, 3, 12, 0, 14, 3, 64, 0,213, 1, + 0, 0, 15, 3, 4, 0,214, 1, 4, 0, 16, 3, 7, 0, 9, 1, 7, 0, 17, 3, 7, 0, 18, 3, 7, 0,177, 0, 7, 0, 19, 3, + 7, 0, 10, 1, 7, 0, 20, 3, 7, 0, 21, 3, 7, 0,171, 2, 7, 0, 22, 3, 7, 0,213, 0, 4, 0, 23, 3, 2, 0, 19, 0, + 2, 0, 24, 3, 2, 0, 25, 3, 2, 0, 26, 3, 2, 0, 27, 3, 2, 0, 28, 3, 2, 0, 29, 3, 2, 0, 30, 3, 2, 0, 31, 3, + 2, 0, 32, 3, 2, 0, 33, 3, 2, 0, 34, 3, 4, 0, 35, 3, 4, 0, 36, 3, 4, 0, 37, 3, 4, 0, 38, 3, 7, 0, 39, 3, + 7, 0, 26, 2, 7, 0, 40, 3, 7, 0, 41, 3, 7, 0, 42, 3, 7, 0, 43, 3, 7, 0, 44, 3, 7, 0, 45, 3, 7, 0, 46, 3, + 7, 0, 47, 3, 7, 0, 48, 3, 7, 0, 49, 3, 0, 0, 50, 3, 0, 0, 51, 3, 0, 0, 52, 3, 0, 0, 53, 3, 7, 0, 54, 3, + 7, 0, 55, 3, 40, 0,126, 0, 12, 0, 56, 3, 12, 0, 57, 3, 12, 0, 58, 3, 12, 0, 59, 3, 7, 0, 60, 3, 2, 0, 81, 2, + 2, 0, 61, 3, 7, 0, 63, 2, 4, 0, 62, 3, 4, 0, 63, 3,154, 0, 64, 3, 2, 0, 65, 3, 2, 0,220, 0, 7, 0, 66, 3, + 12, 0, 67, 3, 12, 0, 68, 3, 12, 0, 69, 3, 12, 0, 70, 3,155, 0, 71, 3,156, 0, 72, 3, 65, 0, 73, 3, 2, 0, 74, 3, + 2, 0, 75, 3, 2, 0, 76, 3, 2, 0, 77, 3, 7, 0, 55, 2, 2, 0, 78, 3, 2, 0, 79, 3,147, 0, 80, 3,135, 0, 81, 3, +135, 0, 82, 3, 4, 0, 83, 3, 4, 0, 84, 3, 4, 0, 85, 3, 4, 0, 70, 0, 12, 0, 86, 3,157, 0, 14, 0,157, 0, 0, 0, +157, 0, 1, 0, 32, 0, 38, 0, 7, 0,171, 2, 7, 0, 11, 1, 7, 0,172, 2, 7, 0,165, 2, 0, 0, 20, 0, 4, 0,173, 2, + 4, 0,174, 2, 4, 0, 87, 3, 2, 0, 17, 0, 2, 0, 88, 3, 7, 0,175, 2,155, 0, 36, 0, 2, 0, 89, 3, 2, 0, 90, 3, + 2, 0, 19, 0, 2, 0,165, 2, 7, 0, 91, 3, 7, 0, 92, 3, 7, 0, 93, 3, 7, 0, 94, 3, 7, 0, 95, 3, 7, 0, 96, 3, + 7, 0, 97, 3, 7, 0, 98, 3, 7, 0, 99, 3, 7, 0,100, 3, 7, 0,101, 3, 7, 0,102, 3, 7, 0,103, 3, 7, 0,104, 3, + 7, 0,105, 3, 7, 0,106, 3, 7, 0,107, 3, 7, 0,108, 3, 7, 0,109, 3, 7, 0,110, 3, 7, 0,111, 3, 7, 0,112, 3, + 7, 0,113, 3, 7, 0,114, 3, 2, 0,115, 3, 2, 0,116, 3, 2, 0,117, 3, 2, 0,118, 3, 53, 0,170, 0,158, 0,119, 3, + 7, 0,120, 3, 4, 0,118, 2,159, 0, 6, 0,159, 0, 0, 0,159, 0, 1, 0, 4, 0,121, 3, 4, 0,122, 3, 7, 0, 2, 0, + 9, 0,123, 3,131, 0, 12, 0, 4, 0, 19, 0, 4, 0,124, 3, 4, 0,125, 3, 4, 0,126, 3, 4, 0,127, 3, 4, 0,128, 3, + 4, 0,129, 3, 4, 0,130, 3, 0, 0,131, 3, 0, 0,132, 3, 0, 0,133, 3, 12, 0,134, 3,160, 0, 1, 0, 7, 0,228, 1, +154, 0, 30, 0, 4, 0, 19, 0, 7, 0,135, 3, 7, 0,136, 3, 7, 0,137, 3, 4, 0,138, 3, 4, 0,139, 3, 4, 0,140, 3, + 4, 0,141, 3, 7, 0,142, 3, 7, 0,143, 3, 7, 0,144, 3, 7, 0,145, 3, 7, 0,146, 3, 7, 0,147, 3, 7, 0,148, 3, + 7, 0,149, 3, 7, 0,150, 3, 7, 0,151, 3, 7, 0,152, 3, 7, 0,153, 3, 7, 0,154, 3, 7, 0,155, 3, 7, 0,156, 3, + 7, 0,157, 3, 7, 0,158, 3, 7, 0,159, 3, 4, 0,160, 3, 4, 0,161, 3, 7, 0,162, 3, 7, 0, 46, 3,156, 0, 44, 0, +142, 0,163, 3, 4, 0,122, 3, 4, 0,164, 3,161, 0,165, 3,162, 0,166, 3, 7, 0, 37, 0, 7, 0,167, 3, 7, 0,168, 3, + 7, 0,169, 3, 7, 0,170, 3, 7, 0,171, 3, 7, 0,172, 3, 7, 0,173, 3, 7, 0,174, 3, 7, 0,175, 3, 7, 0,176, 3, + 2, 0,177, 3, 2, 0,178, 3, 7, 0,179, 3, 7, 0,180, 3, 4, 0,131, 0, 4, 0,181, 3, 4, 0,182, 3, 2, 0,183, 3, + 2, 0,184, 3,160, 0,185, 3, 4, 0,186, 3, 4, 0, 82, 0, 7, 0,187, 3, 7, 0,188, 3, 7, 0,189, 3, 7, 0,190, 3, + 2, 0,191, 3, 2, 0,192, 3, 2, 0,193, 3, 2, 0,194, 3, 2, 0,195, 3, 2, 0,196, 3, 2, 0,197, 3, 2, 0,198, 3, +163, 0,199, 3, 7, 0,200, 3, 7, 0,201, 3,131, 0,202, 3,147, 0, 48, 0, 2, 0, 17, 0, 2, 0,203, 3, 2, 0,204, 3, + 2, 0,205, 3, 7, 0,206, 3, 2, 0,207, 3, 2, 0,208, 3, 7, 0,209, 3, 2, 0,210, 3, 2, 0,211, 3, 7, 0,212, 3, + 7, 0,213, 3, 7, 0,214, 3, 7, 0,215, 3, 7, 0,216, 3, 7, 0,217, 3, 4, 0,218, 3, 7, 0,219, 3, 7, 0,220, 3, + 7, 0,221, 3, 78, 0,222, 3, 78, 0,223, 3, 78, 0,224, 3, 0, 0,225, 3, 7, 0,226, 3, 7, 0,227, 3, 36, 0, 80, 0, + 2, 0,228, 3, 0, 0,229, 3, 0, 0,230, 3, 7, 0,231, 3, 4, 0,232, 3, 7, 0,233, 3, 7, 0,234, 3, 4, 0,235, 3, + 4, 0, 19, 0, 7, 0,236, 3, 7, 0,237, 3, 7, 0,238, 3, 82, 0,239, 3, 7, 0,240, 3, 7, 0,241, 3, 7, 0,242, 3, + 7, 0,243, 3, 7, 0,244, 3, 7, 0,245, 3, 7, 0,246, 3, 4, 0,247, 3,164, 0, 72, 0, 27, 0, 31, 0, 39, 0, 75, 0, + 2, 0,179, 0, 2, 0, 15, 1, 2, 0, 48, 1, 2, 0,248, 3, 7, 0,249, 3, 7, 0,250, 3, 7, 0,251, 3, 7, 0,252, 3, + 7, 0,253, 3, 7, 0,254, 3, 7, 0,255, 3, 7, 0, 0, 4, 7, 0, 86, 1, 7, 0, 88, 1, 7, 0, 87, 1, 7, 0, 1, 4, + 4, 0, 2, 4, 7, 0, 3, 4, 7, 0, 4, 4, 7, 0, 5, 4, 7, 0, 6, 4, 7, 0, 7, 4, 7, 0, 8, 4, 7, 0, 9, 4, + 2, 0, 10, 4, 2, 0, 14, 1, 2, 0, 11, 4, 2, 0, 12, 4, 2, 0, 13, 4, 2, 0, 14, 4, 2, 0, 15, 4, 2, 0, 16, 4, + 7, 0, 17, 4, 7, 0, 18, 4, 7, 0, 19, 4, 7, 0, 20, 4, 7, 0, 21, 4, 7, 0, 22, 4, 7, 0, 23, 4, 7, 0, 24, 4, + 7, 0, 25, 4, 7, 0, 26, 4, 7, 0, 27, 4, 7, 0, 28, 4, 2, 0, 29, 4, 2, 0, 30, 4, 2, 0, 31, 4, 2, 0, 32, 4, + 7, 0, 33, 4, 7, 0, 34, 4, 7, 0, 35, 4, 7, 0, 36, 4, 2, 0, 37, 4, 2, 0, 38, 4, 2, 0, 39, 4, 2, 0, 40, 4, + 7, 0, 41, 4, 7, 0, 42, 4, 7, 0, 43, 4, 7, 0, 44, 4, 2, 0, 45, 4, 2, 0, 46, 4, 2, 0, 47, 4, 2, 0, 19, 0, + 7, 0, 48, 4, 7, 0, 49, 4, 36, 0, 80, 0, 52, 0, 78, 1, 30, 0,155, 0, 40, 0,126, 0,165, 0, 8, 0,165, 0, 0, 0, +165, 0, 1, 0, 4, 0, 23, 3, 4, 0, 50, 4, 4, 0, 19, 0, 2, 0, 51, 4, 2, 0, 52, 4, 32, 0,169, 0,166, 0, 13, 0, + 9, 0, 53, 4, 9, 0, 54, 4, 4, 0, 55, 4, 4, 0, 56, 4, 4, 0, 57, 4, 4, 0, 58, 4, 4, 0, 59, 4, 4, 0, 60, 4, + 4, 0, 61, 4, 4, 0, 62, 4, 4, 0, 63, 4, 4, 0, 37, 0, 0, 0, 64, 4,167, 0, 5, 0, 9, 0, 65, 4, 9, 0, 66, 4, + 4, 0, 67, 4, 4, 0, 70, 0, 0, 0, 68, 4,168, 0, 13, 0, 4, 0, 17, 0, 4, 0, 69, 4, 4, 0, 70, 4, 4, 0, 71, 4, + 4, 0, 72, 4, 4, 0, 73, 4, 4, 0, 94, 0, 4, 0, 74, 4, 4, 0, 75, 4, 4, 0, 76, 4, 4, 0, 77, 4, 4, 0, 78, 4, + 26, 0, 30, 0,169, 0, 4, 0, 4, 0, 79, 4, 7, 0, 80, 4, 2, 0, 19, 0, 2, 0, 81, 4,170, 0, 11, 0,170, 0, 0, 0, +170, 0, 1, 0, 0, 0, 20, 0, 64, 0, 82, 4, 65, 0, 83, 4, 4, 0, 23, 3, 4, 0, 84, 4, 4, 0, 85, 4, 4, 0, 37, 0, + 4, 0, 86, 4, 4, 0, 87, 4,171, 0,131, 0,166, 0, 88, 4,167, 0, 89, 4,168, 0, 90, 4,169, 0, 91, 4, 4, 0, 92, 4, + 4, 0,131, 0, 4, 0,181, 3, 4, 0, 93, 4, 4, 0, 94, 4, 4, 0, 95, 4, 4, 0, 96, 4, 2, 0, 19, 0, 2, 0, 97, 4, + 7, 0, 26, 2, 7, 0, 98, 4, 7, 0, 99, 4, 7, 0,100, 4, 7, 0,101, 4, 7, 0,102, 4, 2, 0,103, 4, 2, 0,104, 4, + 2, 0,105, 4, 2, 0,106, 4, 2, 0,219, 0, 2, 0,107, 4, 2, 0,108, 4, 2, 0,118, 3, 2, 0,109, 4, 2, 0,110, 4, + 2, 0, 35, 1, 2, 0,110, 0, 2, 0,111, 4, 2, 0,112, 4, 2, 0,113, 4, 2, 0,114, 4, 2, 0,115, 4, 2, 0,116, 4, + 2, 0,117, 4, 2, 0,118, 4, 2, 0,119, 4, 2, 0, 36, 1, 2, 0,120, 4, 2, 0,121, 4, 2, 0,122, 4, 2, 0,123, 4, + 4, 0,124, 4, 4, 0, 14, 1, 2, 0,125, 4, 2, 0,126, 4, 2, 0,127, 4, 2, 0,128, 4, 2, 0,129, 4, 2, 0,130, 4, + 24, 0,131, 4, 24, 0,132, 4, 23, 0,133, 4, 12, 0,134, 4, 2, 0,135, 4, 2, 0, 37, 0, 7, 0,136, 4, 7, 0,137, 4, + 7, 0,138, 4, 7, 0,139, 4, 7, 0,140, 4, 7, 0,141, 4, 7, 0,142, 4, 7, 0,143, 4, 7, 0,144, 4, 2, 0,145, 4, + 2, 0,146, 4, 2, 0,147, 4, 2, 0,148, 4, 2, 0,149, 4, 2, 0,150, 4, 7, 0,151, 4, 7, 0,152, 4, 7, 0,153, 4, + 2, 0,154, 4, 2, 0,155, 4, 2, 0,156, 4, 2, 0,157, 4, 2, 0,158, 4, 2, 0,159, 4, 2, 0,160, 4, 2, 0,161, 4, + 2, 0,162, 4, 2, 0,163, 4, 4, 0,164, 4, 4, 0,165, 4, 4, 0,166, 4, 4, 0,167, 4, 4, 0,168, 4, 7, 0,169, 4, + 4, 0,170, 4, 4, 0,171, 4, 4, 0,172, 4, 4, 0,173, 4, 7, 0,174, 4, 7, 0,175, 4, 7, 0,176, 4, 7, 0,177, 4, + 7, 0,178, 4, 7, 0,179, 4, 7, 0,180, 4, 7, 0,181, 4, 7, 0,182, 4, 0, 0,183, 4, 0, 0,184, 4, 4, 0,185, 4, + 2, 0,186, 4, 2, 0,161, 1, 0, 0,187, 4, 7, 0,188, 4, 7, 0,189, 4, 4, 0,190, 4, 4, 0,191, 4, 7, 0,192, 4, + 7, 0,193, 4, 2, 0,194, 4, 2, 0,195, 4, 7, 0,196, 4, 2, 0,197, 4, 2, 0,198, 4, 4, 0,199, 4, 2, 0,200, 4, + 2, 0,201, 4, 2, 0,202, 4, 2, 0,203, 4, 7, 0,204, 4, 7, 0, 70, 0, 43, 0,205, 4,172, 0, 9, 0,172, 0, 0, 0, +172, 0, 1, 0, 0, 0, 20, 0, 2, 0,206, 4, 2, 0,207, 4, 2, 0,208, 4, 2, 0, 43, 0, 7, 0,209, 4, 7, 0, 70, 0, +173, 0, 5, 0, 7, 0,210, 4, 0, 0, 17, 0, 0, 0, 43, 0, 0, 0, 70, 0, 0, 0,161, 1,174, 0, 5, 0,174, 0, 0, 0, +174, 0, 1, 0, 4, 0,121, 3, 0, 0,131, 3, 4, 0, 19, 0,175, 0, 6, 0,176, 0,211, 4, 2, 0, 19, 0, 2, 0,212, 4, + 2, 0,213, 4, 2, 0,214, 4, 9, 0,215, 4,177, 0, 4, 0, 2, 0,110, 0, 2, 0,142, 2, 2, 0,124, 3, 2, 0,216, 4, +178, 0, 10, 0, 2, 0, 19, 0, 2, 0,217, 4, 2, 0,218, 4, 2, 0,219, 4,177, 0,220, 4, 9, 0,215, 4, 7, 0,221, 4, + 4, 0,222, 4, 4, 0,223, 4, 4, 0, 37, 0,179, 0, 4, 0,179, 0, 0, 0,179, 0, 1, 0, 0, 0,224, 4, 7, 0,225, 4, +180, 0, 8, 0,181, 0,226, 4,176, 0,211, 4, 7, 0,227, 4, 4, 0, 94, 0, 0, 0,228, 4, 0, 0,229, 4, 0, 0,230, 4, + 0, 0,231, 4,182, 0, 9, 0,176, 0,211, 4, 7, 0,232, 4, 7, 0,233, 4, 2, 0, 14, 1, 2, 0, 19, 0, 4, 0, 36, 0, + 4, 0,234, 4, 84, 0,235, 4, 9, 0,215, 4,183, 0, 72, 0,182, 0,236, 4,182, 0,237, 4,180, 0,238, 4, 7, 0,239, 4, + 2, 0,240, 4, 2, 0,241, 4, 7, 0,242, 4, 7, 0,243, 4, 2, 0,124, 3, 2, 0,244, 4, 7, 0,245, 4, 7, 0,246, 4, + 7, 0,247, 4, 2, 0,248, 4, 2, 0,223, 4, 2, 0,249, 4, 2, 0,250, 4, 2, 0,251, 4, 2, 0,252, 4, 7, 0,253, 4, + 7, 0,254, 4, 7, 0,255, 4, 2, 0, 0, 5, 2, 0, 1, 5, 2, 0, 2, 5, 2, 0, 3, 5, 2, 0, 4, 5, 2, 0, 5, 5, + 2, 0, 6, 5,175, 0, 7, 5,178, 0, 8, 5, 7, 0, 9, 5, 7, 0, 10, 5, 7, 0, 11, 5, 2, 0, 12, 5, 2, 0, 70, 0, + 0, 0, 13, 5, 0, 0, 14, 5, 0, 0, 15, 5, 0, 0, 16, 5, 0, 0, 17, 5, 0, 0, 18, 5, 2, 0, 19, 5, 7, 0, 20, 5, + 7, 0, 21, 5, 7, 0, 22, 5, 7, 0, 23, 5, 7, 0, 24, 5, 7, 0, 25, 5, 7, 0, 26, 5, 7, 0, 27, 5, 7, 0, 28, 5, + 7, 0, 29, 5, 2, 0, 30, 5, 0, 0, 31, 5, 0, 0, 32, 5, 0, 0, 33, 5, 0, 0, 34, 5, 32, 0, 35, 5, 0, 0, 36, 5, + 0, 0, 37, 5, 0, 0, 38, 5, 0, 0, 39, 5, 0, 0, 40, 5, 0, 0, 41, 5, 0, 0, 42, 5, 0, 0, 43, 5, 2, 0, 44, 5, + 2, 0, 45, 5, 2, 0, 46, 5, 2, 0, 47, 5, 2, 0, 48, 5,184, 0, 8, 0, 4, 0, 49, 5, 4, 0, 50, 5, 4, 0, 51, 5, + 4, 0, 52, 5, 4, 0, 53, 5, 4, 0, 54, 5, 4, 0, 54, 0, 4, 0, 50, 2, 47, 0, 34, 0, 27, 0, 31, 0, 39, 0, 75, 0, + 32, 0, 55, 5,164, 0, 56, 5, 47, 0, 57, 5, 48, 0,211, 0, 12, 0, 58, 5,165, 0, 59, 5, 32, 0, 60, 5, 7, 0, 61, 5, + 7, 0, 62, 5, 7, 0, 63, 5, 7, 0, 64, 5, 4, 0, 23, 3, 2, 0, 19, 0, 2, 0, 7, 1, 59, 0, 3, 1,185, 0, 65, 5, +173, 0, 66, 5,183, 0, 67, 5,186, 0, 68, 5,171, 0,185, 0,169, 0, 91, 4, 40, 0,126, 0, 12, 0,104, 0, 12, 0, 69, 5, +187, 0, 70, 5, 2, 0, 71, 5, 2, 0, 72, 5, 2, 0,220, 0, 2, 0, 73, 5, 4, 0, 74, 5, 4, 0, 75, 5, 12, 0, 76, 5, +188, 0, 6, 0, 48, 0,211, 0, 46, 0, 2, 1, 7, 0, 14, 2, 7, 0, 15, 2, 7, 0,110, 0, 7, 0, 77, 5,189, 0, 35, 0, + 7, 0, 78, 5, 7, 0, 79, 5, 7, 0, 80, 5, 7, 0, 81, 5, 7, 0, 82, 5, 7, 0, 83, 5, 7, 0, 84, 5, 7, 0, 85, 5, + 7, 0, 86, 5, 7, 0, 21, 1, 7, 0, 87, 5, 7, 0, 88, 5, 7, 0, 89, 5, 7, 0, 90, 5, 7, 0,176, 0, 2, 0, 91, 5, + 2, 0, 92, 5, 4, 0, 93, 5, 2, 0, 94, 5, 2, 0, 95, 5, 2, 0, 96, 5, 2, 0, 97, 5, 7, 0, 98, 5, 69, 0, 99, 5, +190, 0,100, 5,189, 0,101, 5,191, 0,102, 5,192, 0,103, 5,193, 0,104, 5,194, 0,105, 5,195, 0,106, 5, 7, 0,107, 5, + 2, 0,108, 5, 2, 0,109, 5, 4, 0,161, 1,196, 0, 54, 0,197, 0, 0, 0,197, 0, 1, 0, 12, 0,110, 5, 4, 0,111, 5, + 7, 0,112, 5, 2, 0,113, 5, 7, 0, 86, 5, 7, 0, 21, 1, 7, 0, 43, 0, 4, 0,114, 5, 2, 0, 96, 5, 2, 0, 97, 5, + 32, 0, 55, 5, 32, 0,115, 5,188, 0,116, 5,196, 0,101, 5, 0, 0,117, 5, 4, 0, 23, 3, 4, 0,118, 5, 2, 0,119, 5, + 2, 0,120, 5, 2, 0,121, 5, 2, 0,122, 5, 2, 0,161, 1, 2, 0, 19, 0, 2, 0,123, 5, 2, 0,124, 5, 7, 0,116, 0, + 7, 0,125, 5, 7, 0,126, 5, 7, 0,127, 5, 7, 0,128, 5, 7, 0,129, 5, 7, 0,176, 0, 7, 0, 61, 5, 2, 0,130, 5, + 2, 0, 65, 1, 2, 0,131, 5, 2, 0,132, 5, 2, 0,133, 5, 2, 0,134, 5, 2, 0,135, 5, 2, 0,136, 5, 2, 0,137, 5, + 2, 0,138, 5, 4, 0,139, 5, 12, 0,140, 5, 2, 0,141, 5, 2, 0, 64, 2, 2, 0,142, 5, 0, 0,143, 5, 0, 0,144, 5, + 9, 0,145, 5,190, 0,100, 5,198, 0, 22, 0, 24, 0, 36, 0, 24, 0, 64, 0, 23, 0,146, 5, 23, 0,147, 5, 23, 0,148, 5, + 7, 0,149, 5, 7, 0,150, 5, 7, 0,151, 5, 7, 0,152, 5, 2, 0,153, 5, 2, 0,154, 5, 2, 0,155, 5, 2, 0,156, 5, + 2, 0,157, 5, 2, 0, 19, 0, 2, 0,158, 5, 2, 0,159, 5, 2, 0,160, 5, 2, 0,161, 5, 2, 0,162, 5, 2, 0,122, 5, + 7, 0,163, 5,197, 0, 6, 0,197, 0, 0, 0,197, 0, 1, 0, 12, 0,110, 5, 4, 0,111, 5, 7, 0,112, 5, 2, 0,113, 5, +199, 0, 8, 0,197, 0, 0, 0,197, 0, 1, 0, 12, 0,110, 5, 4, 0,111, 5, 7, 0,112, 5, 2, 0,113, 5,200, 0,164, 5, + 47, 0,139, 0,201, 0, 14, 0,197, 0, 0, 0,197, 0, 1, 0, 12, 0,110, 5, 4, 0,111, 5, 7, 0,112, 5, 2, 0,113, 5, +198, 0,165, 5,202, 0,166, 5, 12, 0,167, 5, 2, 0, 14, 1, 2, 0, 19, 0, 2, 0,168, 5, 0, 0,169, 5, 0, 0,170, 5, +203, 0, 31, 0,197, 0, 0, 0,197, 0, 1, 0, 12, 0,110, 5, 4, 0,111, 5, 7, 0,112, 5, 2, 0,113, 5,191, 0,102, 5, + 2, 0,171, 5, 2, 0,172, 5, 2, 0,158, 5, 2, 0,173, 5,198, 0,165, 5, 2, 0,174, 5, 2, 0,138, 0, 2, 0,169, 5, + 2, 0,175, 5, 9, 0,176, 5, 2, 0,177, 5, 0, 0,178, 5, 0, 0,179, 5, 2, 0,180, 5, 2, 0,181, 5, 2, 0, 32, 3, + 2, 0,182, 5, 2, 0,183, 5, 0, 0, 19, 0, 0, 0, 48, 1, 9, 0,250, 1, 4, 0,184, 5, 4, 0,185, 5, 27, 0,186, 5, +204, 0, 16, 0,197, 0, 0, 0,197, 0, 1, 0, 12, 0,110, 5, 4, 0,111, 5, 7, 0,112, 5, 2, 0,113, 5,198, 0,165, 5, + 7, 0, 14, 2, 7, 0, 15, 2, 2, 0,174, 5, 2, 0,187, 5, 2, 0,188, 5, 2, 0,189, 5, 4, 0, 19, 0, 7, 0,190, 5, +190, 0,100, 5,205, 0, 15, 0, 0, 0,191, 5, 0, 0,192, 5, 0, 0,193, 5, 2, 0, 19, 0, 2, 0,194, 5, 2, 0,195, 5, + 2, 0,104, 1, 2, 0,196, 5, 2, 0, 37, 0, 4, 0,197, 5, 4, 0,198, 5, 2, 0,199, 5, 2, 0,200, 5, 0, 0,201, 5, + 0, 0,202, 5,206, 0, 12, 0,197, 0, 0, 0,197, 0, 1, 0, 12, 0,110, 5, 4, 0,111, 5, 4, 0, 37, 0,205, 0,203, 5, +207, 0,204, 5, 12, 0,205, 5, 12, 0,206, 5,208, 0,207, 5,195, 0,208, 5,209, 0,209, 5,210, 0, 17, 0,197, 0, 0, 0, +197, 0, 1, 0, 12, 0,110, 5, 4, 0,111, 5, 7, 0,112, 5, 2, 0,113, 5,198, 0,165, 5, 12, 0,210, 5,211, 0,211, 5, + 0, 0,212, 5,212, 0,213, 5, 4, 0,214, 5, 4, 0,215, 5, 2, 0, 19, 0, 2, 0,216, 5, 2, 0,217, 5, 2, 0, 37, 0, +213, 0, 29, 0,197, 0, 0, 0,197, 0, 1, 0, 12, 0,110, 5, 4, 0,111, 5, 7, 0,112, 5, 2, 0,113, 5, 48, 0,150, 2, + 46, 0, 2, 1, 62, 0,218, 5, 2, 0,138, 0, 2, 0,219, 5, 2, 0, 70, 0, 2, 0,220, 5, 4, 0, 19, 0, 2, 0,221, 5, + 2, 0,170, 5, 2, 0,169, 5, 2, 0,161, 1, 0, 0,222, 5, 0, 0,223, 5, 0, 0,224, 5, 0, 0,122, 5, 7, 0, 14, 2, + 7, 0, 15, 2, 7, 0,190, 5, 7, 0, 65, 1, 7, 0,225, 5, 7, 0,226, 5,190, 0,100, 5,214, 0, 11, 0,197, 0, 0, 0, +197, 0, 1, 0, 12, 0,110, 5, 4, 0,111, 5, 7, 0,112, 5, 2, 0,113, 5, 2, 0,168, 5, 2, 0, 19, 0, 4, 0, 37, 0, +202, 0,166, 5,198, 0,165, 5,215, 0, 27, 0,197, 0, 0, 0,197, 0, 1, 0, 12, 0,110, 5, 4, 0,111, 5, 7, 0,112, 5, + 2, 0,113, 5, 43, 0,227, 5, 4, 0,228, 5, 4, 0,229, 5, 2, 0, 94, 0, 2, 0,138, 0, 2, 0,230, 5, 0, 0,231, 5, + 0, 0,232, 5, 4, 0,233, 5, 4, 0,234, 5, 4, 0,235, 5, 4, 0,236, 5, 2, 0,237, 5, 2, 0,238, 5, 7, 0,239, 5, + 23, 0,240, 5, 23, 0,241, 5, 4, 0,242, 5, 4, 0,243, 5, 0, 0,244, 5, 0, 0,245, 5,216, 0, 10, 0, 27, 0, 31, 0, + 9, 0,246, 5, 9, 0,247, 5, 9, 0,248, 5, 9, 0,249, 5, 9, 0,250, 5, 4, 0, 94, 0, 4, 0,251, 5, 0, 0,252, 5, + 0, 0,253, 5,217, 0, 10, 0,197, 0, 0, 0,197, 0, 1, 0, 12, 0,110, 5, 4, 0,111, 5, 7, 0,112, 5,216, 0,254, 5, + 2, 0, 94, 0, 2, 0,138, 0, 4, 0, 43, 0, 9, 0,255, 5,218, 0, 8, 0,197, 0, 0, 0,197, 0, 1, 0, 12, 0,110, 5, + 4, 0,111, 5, 7, 0,112, 5,198, 0,165, 5, 4, 0, 19, 0, 4, 0, 0, 6,219, 0, 23, 0,197, 0, 0, 0,197, 0, 1, 0, + 12, 0,110, 5, 4, 0,111, 5, 7, 0,112, 5, 2, 0,113, 5,198, 0,165, 5, 27, 0, 1, 6, 27, 0, 81, 0, 2, 0, 19, 0, + 2, 0,138, 0, 7, 0, 2, 6, 9, 0, 3, 6, 7, 0, 14, 2, 7, 0, 15, 2, 7, 0, 4, 6, 7, 0, 5, 6, 59, 0, 3, 1, + 59, 0, 6, 6, 4, 0, 7, 6, 2, 0,178, 5, 2, 0, 37, 0,190, 0,100, 5,220, 0, 10, 0,197, 0, 0, 0,197, 0, 1, 0, + 12, 0,110, 5, 4, 0,111, 5, 7, 0,112, 5, 2, 0,113, 5, 2, 0, 19, 0, 2, 0, 32, 3, 4, 0, 37, 0,190, 0,100, 5, +221, 0, 42, 0,197, 0, 0, 0,197, 0, 1, 0, 12, 0,110, 5, 4, 0,111, 5, 7, 0,112, 5, 2, 0,113, 5,198, 0,165, 5, +207, 0,204, 5, 0, 0,191, 5, 0, 0,192, 5, 0, 0,193, 5, 2, 0, 17, 0, 2, 0,200, 5, 2, 0, 19, 0, 2, 0,194, 5, + 9, 0, 3, 6, 4, 0,197, 5, 4, 0, 8, 6, 4, 0, 9, 6, 4, 0,198, 5, 23, 0, 10, 6, 23, 0, 11, 6, 7, 0, 12, 6, + 7, 0, 13, 6, 7, 0, 14, 6, 7, 0, 2, 6, 2, 0, 15, 6, 2, 0,210, 0, 2, 0,104, 1, 2, 0,196, 5, 2, 0, 37, 0, + 2, 0, 43, 0, 2, 0, 16, 6, 2, 0, 17, 6, 9, 0, 18, 6, 9, 0, 19, 6, 9, 0, 20, 6, 9, 0, 21, 6, 9, 0, 22, 6, + 2, 0, 23, 6, 0, 0,202, 5, 58, 0, 24, 6,222, 0, 7, 0,222, 0, 0, 0,222, 0, 1, 0, 0, 0, 25, 6, 2, 0, 26, 6, + 2, 0, 27, 6, 2, 0, 28, 6, 2, 0, 37, 0,223, 0, 12, 0, 2, 0, 27, 6, 2, 0, 29, 6, 2, 0, 30, 6, 0, 0,115, 2, + 2, 0, 31, 6, 2, 0, 32, 6, 2, 0, 33, 6, 2, 0, 34, 6, 2, 0, 35, 6, 2, 0,158, 5, 7, 0, 36, 6, 7, 0, 37, 6, +224, 0, 18, 0,224, 0, 0, 0,224, 0, 1, 0, 0, 0,131, 3,223, 0, 38, 6,223, 0, 39, 6,223, 0, 40, 6,223, 0, 41, 6, + 7, 0, 42, 6, 2, 0, 43, 6, 2, 0, 44, 6, 2, 0, 45, 6, 2, 0, 46, 6, 2, 0, 47, 6, 2, 0, 48, 6, 2, 0, 49, 6, + 2, 0, 50, 6, 2, 0, 51, 6, 2, 0, 52, 6,225, 0, 10, 0, 0, 0, 53, 6, 0, 0, 54, 6, 0, 0, 55, 6, 0, 0, 56, 6, + 0, 0, 57, 6, 0, 0, 58, 6, 2, 0, 59, 6, 2, 0, 60, 6, 2, 0, 61, 6, 2, 0, 37, 0,226, 0, 8, 0, 0, 0, 62, 6, + 0, 0, 63, 6, 0, 0, 64, 6, 0, 0, 65, 6, 0, 0, 66, 6, 0, 0, 67, 6, 7, 0, 77, 5, 7, 0, 37, 0,227, 0, 16, 0, +225, 0, 68, 6,225, 0, 69, 6,225, 0, 70, 6,225, 0, 71, 6,225, 0, 72, 6,225, 0, 73, 6,225, 0, 74, 6,225, 0, 75, 6, +225, 0, 76, 6,225, 0, 77, 6,225, 0, 78, 6,225, 0, 79, 6,225, 0, 80, 6,225, 0, 81, 6,226, 0, 82, 6, 0, 0, 83, 6, +228, 0, 71, 0, 0, 0, 84, 6, 0, 0, 85, 6, 0, 0, 57, 6, 0, 0, 86, 6, 0, 0, 87, 6, 0, 0, 88, 6, 0, 0, 89, 6, + 0, 0, 90, 6, 0, 0, 91, 6, 0, 0, 92, 6, 0, 0, 93, 6, 0, 0, 94, 6, 0, 0, 95, 6, 0, 0, 96, 6, 0, 0, 97, 6, + 0, 0, 98, 6, 0, 0, 99, 6, 0, 0,100, 6, 0, 0,101, 6, 0, 0,102, 6, 0, 0,103, 6, 0, 0,104, 6, 0, 0,105, 6, + 0, 0,106, 6, 0, 0,107, 6, 0, 0,108, 6, 0, 0,109, 6, 0, 0,110, 6, 0, 0,111, 6, 0, 0,112, 6, 0, 0,113, 6, + 0, 0,114, 6, 0, 0,115, 6, 0, 0,116, 6, 0, 0,117, 6, 0, 0,118, 6, 0, 0,119, 6, 0, 0,120, 6, 0, 0,121, 6, + 0, 0,122, 6, 0, 0,123, 6, 0, 0,124, 6, 0, 0,125, 6, 0, 0,126, 6, 0, 0,127, 6, 0, 0,128, 6, 0, 0,129, 6, + 0, 0,130, 6, 0, 0,131, 6, 0, 0,132, 6, 0, 0,133, 6, 0, 0,134, 6, 0, 0,135, 6, 0, 0,136, 6, 0, 0,137, 6, + 0, 0,138, 6, 0, 0,139, 6, 0, 0,140, 6, 0, 0,141, 6, 0, 0,142, 6, 0, 0,143, 6, 0, 0,144, 6, 0, 0,145, 6, + 0, 0,146, 6, 0, 0,147, 6, 0, 0,148, 6, 0, 0,149, 6, 0, 0,150, 6, 0, 0,151, 6, 0, 0,152, 6, 0, 0, 96, 0, +229, 0, 5, 0, 0, 0,153, 6, 0, 0,108, 6, 0, 0,110, 6, 2, 0, 19, 0, 2, 0, 37, 0,230, 0, 21, 0,230, 0, 0, 0, +230, 0, 1, 0, 0, 0, 20, 0,227, 0,154, 6,228, 0,155, 6,228, 0,156, 6,228, 0,157, 6,228, 0,158, 6,228, 0,159, 6, +228, 0,160, 6,228, 0,161, 6,228, 0,162, 6,228, 0,163, 6,228, 0,164, 6,228, 0,165, 6,228, 0,166, 6,228, 0,167, 6, +228, 0,168, 6,228, 0,169, 6,228, 0,170, 6,229, 0,171, 6,231, 0, 5, 0, 4, 0, 19, 0, 4, 0, 37, 0, 7, 0, 63, 2, + 7, 0,172, 6, 7, 0,228, 1,232, 0, 67, 0, 4, 0, 19, 0, 4, 0,173, 6, 4, 0,174, 6, 0, 0,175, 6, 0, 0,176, 6, + 0, 0,177, 6, 0, 0,178, 6, 0, 0,179, 6, 0, 0,180, 6, 0, 0,181, 6, 0, 0,182, 6, 0, 0,183, 6, 2, 0,184, 6, + 2, 0, 37, 0, 4, 0,185, 6, 4, 0,186, 6, 4, 0,187, 6, 4, 0,188, 6, 2, 0,189, 6, 2, 0,190, 6, 4, 0,191, 6, + 4, 0, 43, 0, 4, 0,192, 6, 2, 0,193, 6, 2, 0,194, 6, 2, 0,195, 6, 2, 0,196, 6, 12, 0,197, 6, 12, 0,198, 6, + 12, 0,199, 6, 2, 0,200, 6, 2, 0,201, 6, 2, 0,202, 6, 2, 0,203, 6, 2, 0,204, 6, 2, 0,205, 6, 2, 0,206, 6, + 2, 0,207, 6,231, 0,208, 6, 2, 0,209, 6, 2, 0,210, 6, 2, 0,211, 6, 2, 0,212, 6, 2, 0,213, 6, 2, 0,214, 6, + 2, 0,215, 6, 2, 0,216, 6, 4, 0,217, 6, 4, 0,218, 6, 2, 0,219, 6, 2, 0,220, 6, 2, 0,221, 6, 2, 0,222, 6, + 2, 0,223, 6, 2, 0,224, 6, 2, 0,225, 6, 2, 0,226, 6, 2, 0,227, 6, 2, 0,228, 6, 2, 0,229, 6, 2, 0,230, 6, + 0, 0,231, 6, 0, 0,232, 6, 7, 0,233, 6, 2, 0, 12, 5, 2, 0,234, 6, 56, 0,235, 6,200, 0, 21, 0, 27, 0, 31, 0, + 12, 0,236, 6, 12, 0,237, 6, 12, 0,238, 6, 12, 0,110, 5, 47, 0,139, 0, 47, 0,239, 6, 2, 0,240, 6, 2, 0,241, 6, + 2, 0,242, 6, 2, 0,243, 6, 2, 0,244, 6, 2, 0,245, 6, 2, 0,246, 6, 2, 0, 37, 0, 2, 0,247, 6, 2, 0,248, 6, + 4, 0, 70, 0,195, 0,249, 6, 9, 0,250, 6, 2, 0,251, 6,233, 0, 5, 0,233, 0, 0, 0,233, 0, 1, 0,233, 0,252, 6, + 13, 0,253, 6, 4, 0, 19, 0,234, 0, 7, 0,234, 0, 0, 0,234, 0, 1, 0,233, 0,254, 6,233, 0,255, 6, 2, 0,132, 4, + 2, 0, 19, 0, 4, 0, 37, 0,235, 0, 23, 0,235, 0, 0, 0,235, 0, 1, 0,236, 0, 0, 7,237, 0,209, 5, 0, 0, 1, 7, + 0, 0, 2, 7, 0, 0, 3, 7, 2, 0, 4, 7, 2, 0, 5, 7, 2, 0, 6, 7, 2, 0, 7, 7, 2, 0, 8, 7, 2, 0, 37, 0, + 2, 0, 19, 0, 2, 0, 9, 7, 2, 0, 10, 7, 2, 0, 11, 7, 4, 0, 12, 7,235, 0, 13, 7, 9, 0, 14, 7, 4, 0, 15, 7, + 4, 0, 16, 7, 0, 0, 17, 7,238, 0, 2, 0,239, 0, 0, 7,237, 0,209, 5,240, 0, 2, 0,241, 0, 0, 7,237, 0,209, 5, +242, 0, 23, 0,242, 0, 0, 0,242, 0, 1, 0,233, 0,254, 6,233, 0,255, 6,233, 0, 18, 7,233, 0, 19, 7,200, 0, 20, 7, + 23, 0, 52, 0, 0, 0,111, 5, 0, 0, 21, 7, 2, 0,159, 5, 2, 0,160, 5, 2, 0, 22, 7, 2, 0, 37, 0, 2, 0,243, 6, + 2, 0, 23, 7, 2, 0, 19, 0, 40, 0,126, 0,243, 0, 0, 7, 12, 0, 24, 7, 12, 0,110, 5, 12, 0, 25, 7, 12, 0, 26, 7, +244, 0, 21, 0,244, 0, 0, 0,244, 0, 1, 0,198, 0,165, 5, 23, 0, 27, 7, 23, 0, 28, 7, 2, 0,159, 5, 2, 0,160, 5, + 2, 0, 29, 7, 2, 0, 30, 7, 2, 0, 31, 7, 2, 0, 19, 0, 7, 0, 10, 2, 2, 0,242, 6, 2, 0,246, 6, 4, 0, 43, 0, +245, 0, 0, 7, 12, 0, 32, 7, 12, 0, 33, 7, 12, 0, 25, 7, 0, 0, 34, 7, 9, 0, 35, 7,246, 0, 11, 0, 0, 0, 36, 7, + 2, 0, 37, 7, 2, 0, 38, 7, 2, 0, 39, 7, 2, 0, 40, 7, 2, 0,121, 4, 2, 0,116, 4,200, 0, 41, 7, 47, 0, 42, 7, + 4, 0, 43, 7, 4, 0, 44, 7,247, 0, 1, 0, 0, 0, 45, 7,248, 0, 8, 0, 58, 0, 46, 7, 58, 0, 47, 7,248, 0, 48, 7, +248, 0, 49, 7,248, 0, 50, 7, 2, 0,134, 0, 2, 0, 19, 0, 4, 0, 51, 7,249, 0, 4, 0, 4, 0,228, 5, 4, 0, 52, 7, + 4, 0,233, 5, 4, 0, 53, 7,250, 0, 2, 0, 4, 0, 54, 7, 4, 0, 55, 7,251, 0, 7, 0, 7, 0, 56, 7, 7, 0, 57, 7, + 7, 0, 58, 7, 4, 0, 19, 0, 4, 0, 37, 0, 7, 0, 3, 4, 7, 0, 59, 7,252, 0, 6, 0, 0, 0, 60, 7, 0, 0,193, 5, + 50, 0,142, 0, 2, 0,110, 0, 2, 0,120, 4, 4, 0, 37, 0,253, 0, 21, 0,253, 0, 0, 0,253, 0, 1, 0, 4, 0, 57, 0, + 4, 0, 23, 0, 4, 0, 28, 0, 4, 0, 61, 7, 4, 0, 62, 7, 4, 0, 63, 7,247, 0, 64, 7, 0, 0, 60, 7, 4, 0, 65, 7, + 4, 0, 66, 7,252, 0, 6, 3,249, 0, 67, 7,250, 0, 68, 7,251, 0, 69, 7,248, 0, 70, 7,248, 0, 71, 7,248, 0, 72, 7, + 58, 0, 73, 7, 58, 0, 74, 7,254, 0, 12, 0, 0, 0,191, 1, 9, 0,196, 0, 0, 0,197, 0, 4, 0,200, 0, 4, 0,208, 0, + 9, 0,201, 0, 7, 0,203, 0, 7, 0,204, 0, 9, 0, 75, 7, 9, 0, 76, 7, 9, 0,205, 0, 9, 0,207, 0,255, 0, 43, 0, +255, 0, 0, 0,255, 0, 1, 0, 9, 0, 77, 7, 9, 0, 26, 0, 0, 0, 27, 0, 4, 0, 19, 0, 4, 0, 17, 0, 4, 0, 23, 0, + 4, 0, 92, 0, 4, 0, 78, 7, 4, 0, 79, 7, 4, 0, 62, 7, 4, 0, 63, 7, 4, 0, 80, 7, 4, 0,219, 0, 4, 0, 81, 7, + 4, 0, 82, 7, 7, 0,233, 4, 7, 0, 83, 7, 4, 0,131, 0, 4, 0, 84, 7,253, 0, 85, 7, 36, 0, 80, 0, 47, 0,139, 0, + 50, 0,142, 0, 7, 0, 86, 7, 7, 0, 87, 7,254, 0, 4, 1,255, 0, 88, 7,255, 0, 89, 7,255, 0, 90, 7, 12, 0, 91, 7, + 0, 1, 92, 7, 1, 1, 93, 7, 7, 0, 94, 7, 7, 0, 95, 7, 4, 0, 96, 7, 7, 0, 97, 7, 9, 0, 98, 7, 4, 0, 99, 7, + 4, 0,100, 7, 4, 0,101, 7, 7, 0,102, 7, 2, 1, 4, 0, 2, 1, 0, 0, 2, 1, 1, 0, 12, 0,103, 7,255, 0,104, 7, +185, 0, 6, 0, 12, 0,105, 7, 12, 0, 91, 7, 12, 0,106, 7,255, 0,107, 7, 0, 0,108, 7, 0, 0,109, 7, 3, 1, 4, 0, + 7, 0,110, 7, 7, 0,113, 0, 2, 0,111, 7, 2, 0,112, 7, 4, 1, 6, 0, 7, 0,113, 7, 7, 0,114, 7, 7, 0,115, 7, + 7, 0,116, 7, 4, 0,117, 7, 4, 0,118, 7, 5, 1, 12, 0, 7, 0,119, 7, 7, 0,120, 7, 7, 0,121, 7, 7, 0,122, 7, + 7, 0,123, 7, 7, 0,124, 7, 7, 0,125, 7, 7, 0,126, 7, 7, 0,127, 7, 7, 0,128, 7, 4, 0,154, 2, 4, 0,129, 7, + 6, 1, 2, 0, 7, 0,210, 4, 7, 0, 37, 0, 7, 1, 5, 0, 7, 0,130, 7, 7, 0,131, 7, 4, 0, 94, 0, 4, 0,116, 2, + 4, 0,132, 7, 8, 1, 6, 0, 8, 1, 0, 0, 8, 1, 1, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0,133, 7, 2, 0, 57, 0, + 9, 1, 8, 0, 9, 1, 0, 0, 9, 1, 1, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0,133, 7, 2, 0, 57, 0, 7, 0, 23, 0, + 7, 0,131, 0, 10, 1, 45, 0, 10, 1, 0, 0, 10, 1, 1, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0,133, 7, 2, 0,215, 0, + 2, 0,177, 3, 2, 0,134, 7, 7, 0,135, 7, 7, 0, 93, 0, 7, 0,167, 2, 4, 0,136, 7, 4, 0, 82, 0, 4, 0,118, 2, + 7, 0,137, 7, 7, 0,138, 7, 7, 0,139, 7, 7, 0,140, 7, 7, 0,141, 7, 7, 0,142, 7, 7, 0,164, 2, 7, 0, 1, 1, + 7, 0,143, 7, 7, 0,144, 7, 7, 0, 37, 0, 7, 0,145, 7, 7, 0,146, 7, 7, 0,147, 7, 2, 0,148, 7, 2, 0,149, 7, + 2, 0,150, 7, 2, 0,151, 7, 2, 0,152, 7, 2, 0,153, 7, 2, 0,154, 7, 2, 0,155, 7, 2, 0,123, 5, 2, 0,156, 7, + 2, 0,211, 1, 2, 0,157, 7, 0, 0,158, 7, 0, 0,159, 7, 7, 0,213, 0, 11, 1,160, 7, 65, 0,164, 1, 12, 1, 16, 0, + 12, 1, 0, 0, 12, 1, 1, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0,133, 7, 2, 0,215, 0, 7, 0,159, 2, 7, 0,160, 2, + 7, 0,161, 2, 7, 0,255, 1, 7, 0,162, 2, 7, 0,163, 2, 7, 0,161, 7, 7, 0,164, 2, 7, 0,166, 2, 7, 0,167, 2, +212, 0, 5, 0, 2, 0, 17, 0, 2, 0, 51, 7, 2, 0, 19, 0, 2, 0,162, 7, 27, 0, 1, 6,211, 0, 3, 0, 4, 0, 69, 0, + 4, 0,163, 7,212, 0, 2, 0, 13, 1, 11, 0, 13, 1, 0, 0, 13, 1, 1, 0, 0, 0, 20, 0, 2, 0, 17, 0, 2, 0,164, 7, + 4, 0, 22, 0, 4, 0,165, 7, 2, 0, 19, 0, 2, 0, 37, 0, 9, 0,166, 7, 9, 0,167, 7, 14, 1, 5, 0, 0, 0, 20, 0, + 7, 0, 21, 1, 7, 0,168, 7, 4, 0,169, 7, 4, 0, 37, 0, 15, 1, 4, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0, 43, 0, + 2, 0, 70, 0, 16, 1, 4, 0, 0, 0, 20, 0, 64, 0,170, 7, 7, 0, 21, 1, 7, 0, 37, 0, 17, 1, 6, 0, 2, 0,171, 7, + 2, 0,172, 7, 2, 0, 17, 0, 2, 0,173, 7, 0, 0,174, 7, 0, 0,175, 7, 18, 1, 5, 0, 4, 0, 17, 0, 4, 0, 37, 0, + 0, 0, 20, 0, 0, 0,176, 7, 0, 0,177, 7, 19, 1, 3, 0, 4, 0, 17, 0, 4, 0, 37, 0, 0, 0, 20, 0, 20, 1, 4, 0, + 2, 0,178, 7, 2, 0,179, 7, 2, 0, 19, 0, 2, 0, 37, 0, 21, 1, 6, 0, 0, 0, 20, 0, 0, 0,180, 7, 2, 0,181, 7, + 2, 0,164, 2, 2, 0, 14, 1, 2, 0, 70, 0, 22, 1, 5, 0, 0, 0, 20, 0, 7, 0,113, 0, 7, 0, 5, 4, 2, 0, 19, 0, + 2, 0,130, 2, 23, 1, 3, 0, 0, 0, 20, 0, 4, 0,118, 2, 4, 0,178, 7, 24, 1, 7, 0, 0, 0, 20, 0, 7, 0, 5, 4, + 0, 0,182, 7, 0, 0,183, 7, 2, 0, 14, 1, 2, 0, 43, 0, 4, 0,184, 7, 25, 1, 3, 0, 32, 0,185, 7, 0, 0,186, 7, + 0, 0,187, 7, 26, 1, 18, 0, 26, 1, 0, 0, 26, 1, 1, 0, 2, 0, 17, 0, 2, 0,164, 7, 2, 0, 19, 0, 2, 0,188, 7, + 2, 0,189, 7, 2, 0,190, 7, 2, 0, 43, 0, 2, 0, 70, 0, 0, 0, 20, 0, 9, 0, 2, 0, 27, 1,191, 7, 32, 0, 45, 0, + 2, 0,216, 4, 2, 0, 94, 7, 2, 0,192, 7, 2, 0, 37, 0, 28, 1, 11, 0, 0, 0, 20, 0, 0, 0, 17, 0, 0, 0,193, 7, + 2, 0, 19, 0, 2, 0,130, 2, 2, 0,194, 7, 4, 0,195, 7, 4, 0,196, 7, 4, 0,197, 7, 4, 0,198, 7, 4, 0,199, 7, + 29, 1, 1, 0, 0, 0,200, 7, 30, 1, 4, 0, 43, 0,227, 5, 0, 0,201, 7, 4, 0, 14, 1, 4, 0, 19, 0, 27, 1, 18, 0, + 27, 1, 0, 0, 27, 1, 1, 0, 27, 1,202, 7, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0,203, 7, 2, 0,190, 7, 2, 0,164, 7, + 2, 0,204, 7, 2, 0, 70, 0, 2, 0,161, 1, 0, 0, 20, 0, 9, 0, 2, 0, 31, 1,191, 7, 26, 1,205, 7, 2, 0, 15, 0, + 2, 0,206, 7, 4, 0,207, 7, 32, 1, 3, 0, 4, 0,190, 2, 4, 0, 37, 0, 32, 0, 45, 0, 33, 1, 12, 0,152, 0,208, 7, + 2, 0, 17, 0, 2, 0, 19, 0, 4, 0,135, 7, 4, 0, 93, 0, 0, 0, 20, 0, 0, 0,209, 7, 2, 0,210, 7, 2, 0,211, 7, + 2, 0,212, 7, 2, 0,213, 7, 7, 0,214, 7, 34, 1, 10, 0, 2, 0, 19, 0, 2, 0,215, 7, 4, 0,135, 7, 4, 0, 93, 0, + 2, 0,216, 7, 0, 1, 92, 7, 2, 0, 17, 0, 2, 0,217, 7, 2, 0,218, 7, 2, 0,219, 7, 35, 1, 7, 0, 2, 0, 19, 0, + 2, 0,215, 7, 4, 0,135, 7, 4, 0, 93, 0, 2, 0, 17, 0, 2, 0,220, 7, 7, 0,137, 3, 36, 1, 11, 0, 4, 0,190, 2, + 2, 0, 17, 0, 2, 0, 19, 0, 32, 0, 45, 0, 78, 0,221, 7, 0, 0, 20, 0, 7, 0,222, 7, 7, 0,223, 7, 7, 0, 40, 3, + 2, 0,224, 7, 2, 0,225, 7, 37, 1, 5, 0, 2, 0, 17, 0, 2, 0, 19, 0, 4, 0, 37, 0, 47, 0,139, 0, 32, 0, 55, 5, + 38, 1, 5, 0, 4, 0, 19, 0, 4, 0, 17, 0, 0, 0, 20, 0, 0, 0,176, 7, 32, 0, 45, 0, 39, 1, 13, 0, 2, 0, 19, 0, + 2, 0, 17, 0, 2, 0,164, 7, 2, 0, 41, 3, 7, 0,226, 7, 7, 0,227, 7, 7, 0, 9, 1, 7, 0, 10, 1, 7, 0, 17, 3, + 7, 0, 20, 3, 7, 0,228, 7, 7, 0,229, 7, 32, 0,230, 7, 40, 1, 10, 0, 2, 0, 19, 0, 2, 0, 17, 0, 4, 0,135, 7, + 4, 0, 93, 0, 0, 0, 20, 0, 0, 0,209, 7, 2, 0, 43, 0, 2, 0, 64, 0, 2, 0,231, 7, 2, 0,232, 7, 41, 1, 8, 0, + 32, 0, 45, 0, 7, 0,161, 2, 7, 0,233, 7, 7, 0,234, 7, 7, 0,156, 2, 2, 0, 19, 0, 2, 0,130, 2, 7, 0,235, 7, + 42, 1, 12, 0, 2, 0, 17, 0, 2, 0, 14, 1, 2, 0, 19, 0, 2, 0,164, 2, 2, 0,190, 2, 2, 0,236, 7, 4, 0, 37, 0, + 7, 0,237, 7, 7, 0,238, 7, 7, 0,239, 7, 7, 0,240, 7, 0, 0,241, 7, 43, 1, 10, 0, 2, 0, 19, 0, 2, 0, 17, 0, + 4, 0,135, 7, 4, 0, 93, 0, 0, 0, 20, 0, 2, 0, 81, 4, 2, 0, 64, 0, 2, 0,231, 7, 2, 0,232, 7, 65, 0,164, 1, + 44, 1, 7, 0, 4, 0,118, 2, 4, 0,242, 7, 4, 0,243, 7, 4, 0,244, 7, 7, 0,245, 7, 7, 0,246, 7, 0, 0,182, 7, + 45, 1, 7, 0, 0, 0,247, 7, 32, 0,248, 7, 0, 0,186, 7, 2, 0,249, 7, 2, 0, 43, 0, 4, 0, 70, 0, 0, 0,187, 7, + 46, 1, 6, 0, 2, 0, 19, 0, 2, 0, 17, 0, 4, 0,135, 7, 4, 0, 93, 0, 0, 0,250, 7, 0, 0,251, 7, 47, 1, 1, 0, + 4, 0, 19, 0, 48, 1, 6, 0, 0, 0, 96, 0, 2, 0, 17, 0, 2, 0, 19, 0, 4, 0,252, 7, 7, 0,253, 7, 43, 0,227, 5, + 49, 1, 4, 0, 0, 0,184, 0, 2, 0, 19, 0, 4, 0, 17, 0, 32, 0, 45, 0, 50, 1, 2, 0, 4, 0, 17, 0, 4, 0,148, 5, + 31, 1, 10, 0, 31, 1, 0, 0, 31, 1, 1, 0, 31, 1,202, 7, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0,164, 7, 2, 0,254, 7, + 0, 0, 20, 0, 9, 0, 2, 0, 32, 0, 45, 0, 51, 1, 10, 0, 7, 0, 40, 3, 7, 0,255, 7, 7, 0, 0, 8, 7, 0, 1, 8, + 7, 0, 2, 8, 4, 0, 19, 0, 7, 0,236, 7, 7, 0, 3, 8, 7, 0, 4, 8, 7, 0, 37, 0, 0, 1, 20, 0, 27, 0, 31, 0, + 0, 0,195, 0, 52, 1, 5, 8, 9, 0, 6, 8, 44, 0,154, 0, 44, 0, 7, 8, 9, 0, 8, 8, 36, 0, 80, 0, 7, 0,137, 3, + 7, 0, 9, 8, 7, 0, 10, 8, 7, 0, 11, 8, 7, 0, 12, 8, 7, 0, 13, 8, 7, 0, 14, 8, 4, 0, 94, 0, 4, 0, 15, 8, + 0, 0, 16, 8, 0, 0, 17, 8, 0, 0, 18, 8, 53, 1, 6, 0, 27, 0, 31, 0, 7, 0, 19, 8, 7, 0, 20, 8, 7, 0, 21, 8, + 2, 0, 22, 8, 2, 0, 23, 8, 54, 1, 15, 0,197, 0, 0, 0,197, 0, 1, 0, 12, 0,110, 5, 4, 0,111, 5, 7, 0,112, 5, +242, 0, 24, 8,198, 0,165, 5, 0, 1, 92, 7, 2, 0, 14, 1, 2, 0,215, 7, 2, 0, 14, 2, 2, 0, 15, 2, 2, 0, 19, 0, + 2, 0,170, 5, 4, 0, 70, 0, 55, 1, 6, 0, 55, 1, 0, 0, 55, 1, 1, 0, 32, 0, 45, 0, 9, 0, 25, 8, 4, 0,220, 0, + 4, 0, 37, 0, 65, 0, 4, 0, 27, 0, 31, 0, 12, 0, 26, 8, 4, 0,136, 0, 7, 0, 27, 8, 56, 1, 25, 0, 56, 1, 0, 0, + 56, 1, 1, 0, 56, 1, 38, 0, 12, 0, 28, 8, 0, 0, 20, 0, 7, 0, 29, 8, 7, 0, 30, 8, 7, 0, 31, 8, 7, 0, 32, 8, + 4, 0, 19, 0, 7, 0, 33, 8, 7, 0, 34, 8, 7, 0, 35, 8, 7, 0, 21, 1, 7, 0,220, 1, 7, 0, 36, 8, 7, 0,116, 2, + 7, 0, 37, 8, 7, 0, 38, 8, 7, 0, 39, 8, 7, 0, 40, 8, 7, 0, 41, 8, 7, 0,177, 0, 2, 0,136, 0, 2, 0,249, 4, + 57, 1, 20, 0, 27, 0, 31, 0, 12, 0, 42, 8, 12, 0, 43, 8, 12, 0, 44, 8, 4, 0, 19, 0, 4, 0,119, 5, 2, 0,168, 2, + 2, 0,184, 5, 2, 0,136, 0, 2, 0, 45, 8, 2, 0, 46, 8, 2, 0, 47, 8, 2, 0, 48, 8, 2, 0, 49, 8, 4, 0, 50, 8, + 4, 0, 51, 8, 4, 0, 52, 8, 4, 0, 53, 8, 4, 0, 54, 8, 4, 0, 55, 8, 58, 1, 38, 0, 58, 1, 0, 0, 58, 1, 1, 0, + 26, 0, 56, 8, 12, 0, 67, 3, 0, 0, 20, 0, 2, 0, 19, 0, 2, 0, 57, 8, 2, 0, 58, 8, 2, 0, 59, 8, 2, 0, 26, 3, + 2, 0, 60, 8, 4, 0,253, 1, 4, 0, 52, 8, 4, 0, 53, 8, 56, 1, 61, 8, 58, 1, 38, 0, 58, 1, 62, 8, 12, 0, 63, 8, + 9, 0, 64, 8, 9, 0, 65, 8, 9, 0, 66, 8, 7, 0, 9, 1, 7, 0,177, 0, 7, 0, 67, 8, 7, 0,201, 1, 2, 0, 68, 8, + 2, 0, 37, 0, 7, 0, 69, 8, 7, 0, 70, 8, 7, 0, 22, 3, 7, 0, 71, 8, 7, 0, 72, 8, 7, 0, 73, 8, 7, 0, 74, 8, + 7, 0, 75, 8, 7, 0, 76, 8, 7, 0,250, 1, 32, 0, 77, 8,153, 0, 9, 0, 12, 0, 78, 8, 2, 0, 19, 0, 2, 0, 79, 8, + 7, 0, 26, 2, 7, 0, 80, 8, 7, 0, 81, 8, 12, 0, 82, 8, 4, 0, 83, 8, 4, 0, 37, 0, 59, 1, 7, 0, 59, 1, 0, 0, + 59, 1, 1, 0, 12, 0, 16, 8, 4, 0, 19, 0, 4, 0, 84, 8, 0, 0,131, 3,229, 0, 85, 8,152, 0, 7, 0, 27, 0, 31, 0, + 12, 0, 86, 8, 12, 0, 78, 8, 12, 0, 87, 8, 12, 0,104, 0, 4, 0, 19, 0, 4, 0, 88, 8,202, 0, 4, 0, 27, 0, 89, 8, + 12, 0, 78, 8, 4, 0, 90, 8, 4, 0, 19, 0, 60, 1, 17, 0,197, 0, 0, 0,197, 0, 1, 0, 12, 0,110, 5, 4, 0,111, 5, + 7, 0,112, 5, 2, 0,113, 5,198, 0,165, 5,152, 0, 9, 3,202, 0, 91, 8, 0, 0, 14, 1, 0, 0,168, 5, 2, 0, 19, 0, + 2, 0, 92, 8, 2, 0,169, 5, 2, 0,170, 5, 2, 0, 93, 8, 7, 0, 94, 8, 61, 1, 8, 0, 61, 1, 0, 0, 61, 1, 1, 0, + 59, 1, 95, 8, 36, 0, 80, 0, 12, 0, 12, 3, 4, 0, 19, 0, 0, 0, 20, 0, 4, 0, 96, 8, 62, 1, 5, 0, 62, 1, 0, 0, + 62, 1, 1, 0, 36, 0, 80, 0, 2, 0, 19, 0, 0, 0, 97, 8, 63, 1, 12, 0, 63, 1, 0, 0, 63, 1, 1, 0, 9, 0, 2, 0, + 2, 0, 17, 0, 2, 0, 19, 0, 0, 0, 98, 8, 0, 0, 99, 8, 0, 0, 97, 8, 7, 0,100, 8, 7, 0,101, 8, 4, 0, 37, 0, + 36, 0, 80, 0, 64, 1, 9, 0, 64, 1, 0, 0, 64, 1, 1, 0, 32, 0,102, 8, 0, 0,103, 8, 7, 0,104, 8, 2, 0,105, 8, + 2, 0, 19, 0, 2, 0, 17, 0, 2, 0, 37, 0, 65, 1, 7, 0, 43, 0,227, 5, 26, 0, 56, 8, 4, 0, 19, 0, 4, 0,106, 8, + 12, 0,107, 8, 32, 0,102, 8, 0, 0,103, 8, 66, 1, 12, 0, 32, 0,102, 8, 2, 0,108, 8, 2, 0, 19, 0, 2, 0,109, 8, + 2, 0,110, 8, 0, 0,103, 8, 32, 0,111, 8, 0, 0,112, 8, 7, 0,113, 8, 7, 0,220, 1, 7, 0,114, 8, 7, 0,115, 8, + 67, 1, 6, 0, 32, 0,102, 8, 4, 0,116, 8, 4, 0,117, 8, 4, 0, 94, 0, 4, 0, 37, 0, 0, 0,103, 8, 68, 1, 4, 0, + 32, 0,102, 8, 4, 0, 19, 0, 4, 0,116, 8, 0, 0,103, 8, 69, 1, 4, 0, 32, 0,102, 8, 4, 0, 19, 0, 4, 0,116, 8, + 0, 0,103, 8, 70, 1, 10, 0, 32, 0,102, 8, 4, 0,118, 8, 7, 0,130, 0, 4, 0, 19, 0, 2, 0,223, 5, 2, 0,119, 8, + 2, 0, 43, 0, 2, 0, 70, 0, 7, 0,120, 8, 0, 0,103, 8, 71, 1, 4, 0, 32, 0,102, 8, 4, 0, 19, 0, 4, 0,116, 8, + 0, 0,103, 8, 72, 1, 10, 0, 32, 0,102, 8, 2, 0, 17, 0, 2, 0,183, 3, 4, 0, 92, 0, 4, 0, 93, 0, 7, 0,233, 7, + 7, 0,234, 7, 4, 0, 37, 0,152, 0,208, 7, 0, 0,103, 8, 73, 1, 4, 0, 32, 0,102, 8, 4, 0, 27, 3, 4, 0,121, 8, + 0, 0,103, 8, 74, 1, 5, 0, 32, 0,102, 8, 7, 0,130, 0, 4, 0,122, 8, 4, 0, 27, 3, 4, 0, 28, 3, 75, 1, 6, 0, + 32, 0,102, 8, 4, 0,123, 8, 4, 0,124, 8, 7, 0,125, 8, 7, 0,126, 8, 0, 0,103, 8, 76, 1, 16, 0, 32, 0,102, 8, + 32, 0, 62, 8, 4, 0, 17, 0, 7, 0,127, 8, 7, 0,128, 8, 7, 0,129, 8, 7, 0,130, 8, 7, 0,131, 8, 7, 0,132, 8, + 7, 0,133, 8, 7, 0,134, 8, 7, 0,135, 8, 2, 0, 19, 0, 2, 0, 37, 0, 2, 0, 43, 0, 2, 0, 70, 0, 77, 1, 3, 0, + 32, 0,102, 8, 4, 0, 19, 0, 4, 0,123, 5, 78, 1, 5, 0, 32, 0,102, 8, 4, 0, 19, 0, 4, 0, 37, 0, 7, 0,136, 8, + 0, 0,103, 8, 79, 1, 10, 0, 32, 0,102, 8, 0, 0,103, 8, 2, 0,137, 8, 2, 0,138, 8, 0, 0,139, 8, 0, 0,140, 8, + 7, 0,141, 8, 7, 0,142, 8, 7, 0,143, 8, 7, 0,144, 8, 80, 1, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, + 7, 0, 12, 0, 7, 0,145, 8, 7, 0,146, 8, 2, 0, 19, 0, 2, 0,123, 5, 81, 1, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, + 7, 0, 11, 0, 7, 0, 12, 0, 7, 0,145, 8, 7, 0,146, 8, 2, 0, 19, 0, 2, 0,123, 5, 82, 1, 8, 0, 7, 0, 9, 0, + 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 12, 0, 7, 0,145, 8, 7, 0,146, 8, 2, 0, 19, 0, 2, 0,123, 5, 83, 1, 7, 0, + 32, 0,102, 8, 0, 0,103, 8, 7, 0, 21, 1, 7, 0, 31, 1, 2, 0, 19, 0, 2, 0, 14, 1, 4, 0, 37, 0, 84, 1, 5, 0, + 32, 0,226, 2, 7, 0, 21, 1, 2, 0,230, 2, 0, 0,232, 2, 0, 0,147, 8, 85, 1, 10, 0, 85, 1, 0, 0, 85, 1, 1, 0, + 2, 0, 17, 0, 2, 0, 19, 0, 0, 0,148, 8, 7, 0,222, 0, 7, 0,223, 0, 2, 0, 16, 8, 2, 0,149, 8, 32, 0, 45, 0, + 86, 1, 22, 0, 86, 1, 0, 0, 86, 1, 1, 0, 2, 0, 19, 0, 2, 0, 14, 1, 2, 0,150, 8, 2, 0,151, 8, 36, 0, 80, 0, +152, 0,208, 7, 32, 0,169, 0, 7, 0, 92, 0, 7, 0, 93, 0, 7, 0,152, 8, 7, 0,153, 8, 7, 0,154, 8, 7, 0,155, 8, + 7, 0,157, 2, 7, 0,156, 8, 7, 0,210, 7, 7, 0,157, 8, 0, 0,158, 8, 0, 0,159, 8, 12, 0, 14, 3, 87, 1, 8, 0, + 7, 0,228, 1, 7, 0,233, 7, 7, 0,234, 7, 9, 0, 2, 0, 2, 0,160, 8, 2, 0,161, 8, 2, 0,162, 8, 2, 0,163, 8, + 88, 1, 18, 0, 88, 1, 0, 0, 88, 1, 1, 0, 88, 1,164, 8, 0, 0, 20, 0, 87, 1,165, 8, 2, 0, 17, 0, 2, 0, 19, 0, + 2, 0,166, 8, 2, 0,167, 8, 2, 0,168, 8, 2, 0,169, 8, 4, 0, 43, 0, 7, 0,170, 8, 7, 0,171, 8, 4, 0,172, 8, + 4, 0,173, 8, 88, 1,174, 8, 89, 1,175, 8, 90, 1, 33, 0, 90, 1, 0, 0, 90, 1, 1, 0, 90, 1,176, 8, 0, 0, 20, 0, + 0, 0,177, 8, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0, 61, 7, 2, 0, 94, 7, 2, 0,178, 8, 2, 0,138, 0, 2, 0,167, 8, + 2, 0, 51, 7, 12, 0,203, 7, 12, 0,179, 8, 27, 0, 1, 6, 9, 0,180, 8, 7, 0,170, 8, 7, 0,171, 8, 7, 0,255, 1, + 7, 0,181, 8, 2, 0,182, 8, 2, 0,183, 8, 7, 0,184, 8, 7, 0,185, 8, 2, 0,186, 8, 2, 0,187, 8, 9, 0,188, 8, + 24, 0,189, 8, 24, 0,190, 8, 24, 0,191, 8, 91, 1,155, 0, 92, 1,192, 8, 89, 1, 8, 0, 89, 1, 0, 0, 89, 1, 1, 0, + 90, 1,193, 8, 90, 1,194, 8, 88, 1,195, 8, 88, 1,174, 8, 4, 0, 19, 0, 4, 0, 37, 0, 59, 0, 20, 0, 27, 0, 31, 0, + 39, 0, 75, 0, 12, 0,196, 8, 12, 0,197, 8, 87, 1,198, 8, 12, 0,199, 8, 4, 0, 17, 0, 4, 0,200, 8, 4, 0,201, 8, + 4, 0,202, 8, 12, 0,203, 8, 92, 1,204, 8, 88, 1,205, 8, 88, 1,206, 8, 9, 0,207, 8, 9, 0,208, 8, 4, 0,209, 8, + 9, 0,210, 8, 9, 0,211, 8, 9, 0,212, 8, 93, 1, 6, 0, 4, 0,129, 0, 4, 0,131, 0, 4, 0, 51, 7, 0, 0,213, 8, + 0, 0,214, 8, 2, 0, 37, 0, 94, 1, 16, 0, 2, 0, 6, 7, 2, 0, 7, 7, 2, 0,215, 8, 2, 0, 0, 8, 2, 0,216, 8, + 2, 0, 68, 0, 7, 0,156, 2, 7, 0,217, 8, 7, 0,218, 8, 2, 0, 35, 1, 0, 0,219, 8, 0, 0,232, 4, 2, 0,220, 8, + 2, 0, 37, 0, 4, 0,221, 8, 4, 0,222, 8, 95, 1, 9, 0, 7, 0,223, 8, 7, 0,224, 8, 7, 0, 14, 8, 7, 0,113, 0, + 7, 0,225, 8, 7, 0,190, 5, 2, 0,226, 8, 0, 0,227, 8, 0, 0, 37, 0, 96, 1, 4, 0, 7, 0,228, 8, 7, 0,229, 8, + 2, 0,226, 8, 2, 0, 37, 0, 97, 1, 3, 0, 7, 0,230, 8, 7, 0,231, 8, 7, 0, 15, 0, 98, 1, 7, 0, 0, 0,191, 1, + 2, 0,118, 4, 2, 0,119, 4, 2, 0,120, 4, 2, 0, 69, 4, 4, 0,131, 0, 4, 0,181, 3, 99, 1, 7, 0, 7, 0,232, 8, + 7, 0,233, 8, 7, 0,234, 8, 7, 0, 10, 2, 7, 0,235, 8, 7, 0,236, 8, 7, 0,237, 8,100, 1, 4, 0, 2, 0,238, 8, + 2, 0,239, 8, 2, 0,240, 8, 2, 0,241, 8,101, 1, 2, 0, 7, 0, 5, 0, 7, 0, 6, 0,102, 1, 2, 0, 0, 0,171, 0, + 0, 0,242, 8,103, 1, 1, 0, 0, 0, 20, 0,104, 1, 10, 0, 0, 0,243, 8, 0, 0,244, 8, 0, 0,173, 5, 0, 0,245, 8, + 2, 0,215, 8, 2, 0,246, 8, 7, 0,247, 8, 7, 0,248, 8, 7, 0,249, 8, 7, 0,156, 8,105, 1, 2, 0, 9, 0,250, 8, + 9, 0,251, 8,106, 1, 11, 0, 0, 0,120, 4, 0, 0, 17, 0, 0, 0,226, 8, 0, 0,113, 0, 0, 0,252, 8, 0, 0,110, 0, + 0, 0,184, 0, 7, 0,253, 8, 7, 0,254, 8, 7, 0,255, 8, 7, 0, 0, 9,107, 1, 8, 0, 7, 0,171, 7, 7, 0,130, 0, + 7, 0,232, 4, 7, 0, 82, 2, 7, 0, 1, 9, 7, 0,209, 0, 7, 0, 2, 9, 4, 0, 17, 0,108, 1, 4, 0, 2, 0, 3, 9, + 2, 0, 4, 9, 2, 0, 5, 9, 2, 0, 37, 0,109, 1, 1, 0, 0, 0, 20, 0,110, 1, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, + 2, 0, 19, 0, 2, 0, 6, 9,111, 1, 10, 0, 2, 0,122, 3, 2, 0, 19, 0, 7, 0, 5, 4, 7, 0, 7, 9, 7, 0, 8, 9, + 7, 0, 9, 9, 7, 0, 10, 9,110, 1, 11, 9,110, 1, 12, 9,110, 1, 13, 9, 62, 0, 9, 0, 4, 0, 19, 0, 4, 0, 64, 0, + 24, 0, 14, 9, 24, 0, 15, 9,111, 1, 16, 9, 7, 0, 17, 9, 7, 0, 18, 9, 7, 0, 19, 9, 7, 0, 20, 9,112, 1, 4, 0, + 48, 0,150, 2, 7, 0, 21, 9, 7, 0, 94, 1, 7, 0, 37, 0,176, 0, 17, 0, 27, 0, 31, 0,112, 1, 22, 9, 62, 0, 11, 9, + 52, 0, 78, 1, 2, 0, 19, 0, 2, 0, 77, 5, 4, 0,110, 0, 7, 0, 23, 9, 7, 0, 7, 2, 7, 0, 24, 9, 7, 0, 25, 9, + 7, 0, 94, 1, 7, 0, 26, 9, 2, 0, 48, 1, 0, 0, 27, 9, 0, 0,115, 3, 0, 0, 96, 0,113, 1, 10, 0, 4, 0, 17, 0, + 4, 0,130, 0, 4, 0, 19, 0, 4, 0, 88, 3, 4, 0, 28, 9, 4, 0, 29, 9, 4, 0, 30, 9, 0, 0, 96, 0, 0, 0, 20, 0, + 9, 0, 2, 0, 89, 0, 6, 0,113, 1, 31, 9, 4, 0, 32, 9, 4, 0, 33, 9, 4, 0, 34, 9, 4, 0, 37, 0, 9, 0, 35, 9, +114, 1, 5, 0, 7, 0, 77, 2, 7, 0,190, 2, 7, 0,220, 1, 2, 0, 36, 9, 2, 0, 37, 0,115, 1, 5, 0, 7, 0, 77, 2, + 7, 0, 37, 9, 7, 0, 38, 9, 7, 0, 39, 9, 7, 0,190, 2,116, 1, 7, 0, 4, 0, 40, 9, 4, 0, 41, 9, 4, 0, 42, 9, + 7, 0, 43, 9, 7, 0, 44, 9, 7, 0, 45, 9, 7, 0, 46, 9,117, 1, 8, 0,117, 1, 0, 0,117, 1, 1, 0, 32, 0, 45, 0, + 4, 0,213, 2, 2, 0, 19, 0, 2, 0, 57, 0, 7, 0,190, 2, 7, 0,179, 7,118, 1, 26, 0, 32, 0, 47, 9,115, 1, 84, 3, +115, 1, 48, 9,114, 1, 49, 9,115, 1,160, 7, 7, 0, 50, 9, 7, 0, 51, 9, 7, 0, 52, 9, 7, 0, 53, 9, 7, 0, 44, 9, + 7, 0, 45, 9, 7, 0,190, 2, 7, 0,167, 2, 7, 0, 54, 9, 7, 0, 55, 9, 7, 0,110, 0, 7, 0, 56, 9, 4, 0, 40, 9, + 4, 0, 57, 9, 4, 0, 37, 0, 4, 0, 82, 0, 4, 0, 58, 9, 2, 0, 19, 0, 2, 0, 59, 9, 2, 0, 60, 9, 2, 0,118, 3, +119, 1,117, 0, 27, 0, 31, 0, 39, 0, 75, 0, 4, 0, 19, 0, 2, 0, 17, 0, 2, 0,137, 8, 2, 0, 61, 9, 2, 0, 62, 9, + 2, 0, 68, 8, 2, 0, 63, 9, 2, 0, 64, 9, 2, 0, 65, 9, 2, 0, 66, 9, 2, 0, 67, 9, 2, 0, 68, 9, 2, 0, 69, 9, + 2, 0, 70, 9, 2, 0, 71, 9, 2, 0, 72, 9, 2, 0, 73, 9, 2, 0, 74, 9, 2, 0, 75, 9, 2, 0, 76, 9, 2, 0,211, 1, + 2, 0,153, 7, 2, 0,129, 7, 2, 0, 77, 9, 2, 0, 78, 9, 2, 0,116, 3, 2, 0,117, 3, 2, 0, 79, 9, 2, 0, 80, 9, + 2, 0, 81, 9, 2, 0, 82, 9, 2, 0, 83, 9, 2, 0, 84, 9, 7, 0, 85, 9, 7, 0, 86, 9, 7, 0, 87, 9, 2, 0, 88, 9, + 2, 0, 89, 9, 7, 0, 90, 9, 7, 0, 91, 9, 7, 0, 92, 9, 7, 0,135, 7, 7, 0, 93, 0, 7, 0,167, 2, 7, 0,141, 7, + 7, 0, 93, 9, 7, 0, 94, 9, 7, 0, 95, 9, 4, 0,136, 7, 4, 0,134, 7, 4, 0, 96, 9, 7, 0,137, 7, 7, 0,138, 7, + 7, 0,139, 7, 7, 0, 97, 9, 7, 0, 98, 9, 7, 0, 99, 9, 7, 0,100, 9, 7, 0,101, 9, 7, 0,102, 9, 7, 0,103, 9, + 7, 0,104, 9, 7, 0, 40, 3, 7, 0,110, 0, 7, 0,105, 9, 7, 0,106, 9, 7, 0,107, 9, 7, 0,108, 9, 7, 0,109, 9, + 7, 0,110, 9, 7, 0,111, 9, 4, 0,112, 9, 4, 0,113, 9, 7, 0,114, 9, 7, 0,115, 9, 7, 0,116, 9, 7, 0,117, 9, + 7, 0,118, 9, 7, 0, 57, 0, 7, 0,119, 9, 7, 0,120, 9, 7, 0,112, 3, 7, 0,110, 3, 7, 0,111, 3, 7, 0,121, 9, + 7, 0,122, 9, 7, 0,123, 9, 7, 0,124, 9, 7, 0,125, 9, 7, 0,126, 9, 7, 0,127, 9, 7, 0,128, 9, 7, 0,129, 9, + 7, 0,130, 9, 7, 0,131, 9, 7, 0,132, 9, 7, 0,133, 9, 4, 0,134, 9, 4, 0,135, 9, 7, 0, 47, 3, 7, 0,136, 9, + 7, 0,137, 9, 7, 0,138, 9, 7, 0,139, 9, 7, 0,140, 9, 7, 0,141, 9, 7, 0,142, 9, 0, 0,143, 9, 65, 0, 73, 3, + 65, 0,144, 9, 32, 0,145, 9, 32, 0,146, 9, 36, 0, 80, 0,155, 0, 71, 3,155, 0,147, 9,142, 0, 39, 0,142, 0, 0, 0, +142, 0, 1, 0,119, 1,148, 9,118, 1,163, 3,116, 1, 62, 8,120, 1,149, 9, 9, 0,150, 9,121, 1,151, 9,121, 1,152, 9, + 12, 0,153, 9, 12, 0,154, 9,156, 0, 72, 3, 32, 0,155, 9, 32, 0,156, 9, 32, 0, 38, 0, 12, 0,157, 9, 12, 0,158, 9, + 12, 0,159, 9, 7, 0,213, 0, 7, 0, 92, 4, 4, 0,118, 2, 4, 0, 19, 0, 4, 0,136, 7, 4, 0,160, 9, 4, 0,161, 9, + 4, 0,162, 9, 4, 0, 57, 0, 2, 0,220, 0, 2, 0,163, 9, 2, 0,164, 9, 2, 0, 65, 3, 2, 0,165, 9, 2, 0,118, 3, + 0, 0,166, 9, 2, 0,167, 9, 2, 0,168, 9, 2, 0,169, 9, 9, 0,170, 9,131, 0,202, 3,129, 0, 34, 0,122, 1,171, 9, + 7, 0,174, 3, 7, 0,172, 9, 7, 0,173, 9, 7, 0, 8, 4, 7, 0,174, 9, 7, 0, 50, 3, 7, 0, 40, 3, 7, 0,175, 9, + 7, 0, 9, 2, 7, 0,176, 9, 7, 0,177, 9, 7, 0,178, 9, 7, 0,179, 9, 7, 0,180, 9, 7, 0,181, 9, 7, 0,175, 3, + 7, 0,182, 9, 7, 0,183, 9, 7, 0,184, 9, 7, 0,176, 3, 7, 0,172, 3, 7, 0,173, 3, 4, 0,185, 9, 4, 0, 94, 0, + 4, 0,186, 9, 4, 0,187, 9, 2, 0,188, 9, 2, 0,189, 9, 2, 0,190, 9, 2, 0,191, 9, 2, 0,192, 9, 2, 0, 37, 0, + 4, 0, 70, 0,130, 0, 8, 0,122, 1,193, 9, 7, 0,194, 9, 7, 0,195, 9, 7, 0,165, 1, 7, 0,196, 9, 4, 0, 94, 0, + 2, 0,197, 9, 2, 0,198, 9,123, 1, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0, 7, 0,199, 9,124, 1, 6, 0, +124, 1, 0, 0,124, 1, 1, 0,123, 1,200, 9, 4, 0,201, 9, 2, 0,202, 9, 2, 0, 19, 0,125, 1, 5, 0,125, 1, 0, 0, +125, 1, 1, 0, 12, 0,203, 9, 4, 0,204, 9, 4, 0, 19, 0,126, 1, 9, 0,126, 1, 0, 0,126, 1, 1, 0, 12, 0,129, 0, +125, 1,205, 9, 4, 0, 19, 0, 2, 0,202, 9, 2, 0,206, 9, 7, 0, 95, 0, 0, 0,207, 9,190, 0, 6, 0, 27, 0, 31, 0, + 12, 0,134, 4, 4, 0, 19, 0, 2, 0,208, 9, 2, 0,209, 9, 9, 0,210, 9,127, 1, 13, 0, 27, 0, 31, 0,128, 1,211, 9, +128, 1,212, 9, 12, 0,213, 9, 4, 0,214, 9, 2, 0,215, 9, 2, 0, 37, 0, 12, 0,216, 9, 12, 0,217, 9, 12, 0,218, 9, + 12, 0,219, 9, 12, 0,220, 9, 12, 0,221, 9,128, 1, 30, 0,128, 1, 0, 0,128, 1, 1, 0, 9, 0,222, 9, 4, 0,241, 6, + 4, 0, 37, 0,200, 0,164, 5,200, 0,223, 9, 0, 0,224, 9, 2, 0,225, 9, 2, 0,226, 9, 2, 0, 6, 7, 2, 0, 7, 7, + 2, 0,227, 9, 2, 0,228, 9, 2, 0, 88, 3, 2, 0, 23, 7, 2, 0,229, 9, 2, 0,230, 9, 4, 0,161, 1,129, 1,231, 9, +130, 1,232, 9,131, 1,233, 9, 4, 0,234, 9, 4, 0,235, 9, 9, 0,236, 9, 12, 0,237, 9, 12, 0,217, 9, 12, 0, 25, 7, + 12, 0,238, 9, 12, 0,239, 9,132, 1, 12, 0,132, 1, 0, 0,132, 1, 1, 0, 0, 0,240, 9,133, 1,241, 9, 2, 0, 17, 0, + 2, 0, 15, 0, 2, 0,242, 9, 2, 0,243, 9, 2, 0,244, 9, 2, 0,245, 9, 2, 0,246, 9, 2, 0, 37, 0,134, 1, 6, 0, +134, 1, 0, 0,134, 1, 1, 0, 12, 0,247, 9, 0, 0,248, 9, 4, 0,249, 9, 4, 0,250, 9,208, 0, 8, 0,208, 0, 0, 0, +208, 0, 1, 0, 0, 0,240, 9, 26, 0, 30, 0,135, 1, 0, 7, 9, 0,251, 9,133, 1,241, 9,136, 1,252, 9,129, 1, 23, 0, +129, 1, 0, 0,129, 1, 1, 0, 2, 0, 17, 0, 2, 0, 15, 0, 2, 0, 5, 0, 2, 0, 6, 0, 2, 0,253, 9, 2, 0,254, 9, + 2, 0,255, 9, 2, 0, 0, 10, 0, 0, 1, 10, 0, 0, 37, 0, 2, 0,242, 9, 2, 0,243, 9, 2, 0,244, 9, 2, 0,245, 9, + 2, 0,246, 9, 2, 0, 43, 0, 0, 0, 2, 10, 2, 0, 3, 10, 2, 0, 4, 10, 4, 0, 70, 0, 9, 0,251, 9,137, 1, 8, 0, +137, 1, 0, 0,137, 1, 1, 0, 9, 0, 2, 0, 9, 0, 5, 10, 0, 0,131, 3, 2, 0, 17, 0, 2, 0, 19, 0, 7, 0, 6, 10, +138, 1, 5, 0, 7, 0, 7, 10, 4, 0, 8, 10, 4, 0, 9, 10, 4, 0, 14, 1, 4, 0, 19, 0,139, 1, 6, 0, 7, 0, 10, 10, + 7, 0, 11, 10, 7, 0, 12, 10, 7, 0, 13, 10, 4, 0, 17, 0, 4, 0, 19, 0,140, 1, 5, 0, 7, 0,233, 7, 7, 0,234, 7, + 7, 0,190, 2, 2, 0,224, 1, 2, 0,225, 1,141, 1, 5, 0,140, 1, 2, 0, 4, 0, 54, 0, 7, 0, 14, 10, 7, 0,233, 7, + 7, 0,234, 7,142, 1, 4, 0, 2, 0, 15, 10, 2, 0, 16, 10, 2, 0, 17, 10, 2, 0, 18, 10,143, 1, 2, 0, 43, 0,254, 5, + 26, 0, 56, 8,144, 1, 3, 0, 24, 0, 19, 10, 4, 0, 19, 0, 4, 0, 37, 0,145, 1, 6, 0, 7, 0,110, 0, 7, 0,142, 2, + 7, 0, 20, 10, 7, 0, 37, 0, 2, 0,219, 0, 2, 0, 21, 10,146, 1, 7, 0,146, 1, 0, 0,146, 1, 1, 0, 27, 0, 1, 6, + 0, 0, 22, 10, 4, 0, 23, 10, 4, 0, 94, 0, 0, 0,131, 3,147, 1, 6, 0, 12, 0,107, 8, 0, 0, 24, 10, 7, 0, 61, 0, + 7, 0, 6, 10, 4, 0, 17, 0, 4, 0, 19, 0,148, 1, 3, 0, 7, 0, 25, 10, 4, 0, 19, 0, 4, 0, 37, 0,149, 1, 15, 0, +149, 1, 0, 0,149, 1, 1, 0, 59, 1, 95, 8,147, 1, 62, 0, 12, 0, 14, 3, 35, 0, 50, 0,148, 1, 26, 10, 4, 0, 54, 0, + 7, 0, 61, 0, 2, 0, 19, 0, 2, 0,255, 0, 4, 0, 23, 10, 0, 0, 22, 10, 4, 0, 27, 10, 7, 0, 28, 10,150, 1, 2, 0, + 0, 0, 29, 10, 0, 0, 30, 10,151, 1, 4, 0,151, 1, 0, 0,151, 1, 1, 0,152, 0,226, 2, 12, 0, 31, 10,152, 1, 22, 0, +152, 1, 0, 0,152, 1, 1, 0, 12, 0, 32, 10,152, 0,208, 7,151, 1, 33, 10, 12, 0, 34, 10, 12, 0, 14, 3, 0, 0,131, 3, + 7, 0, 6, 10, 7, 0, 35, 10, 7, 0, 92, 0, 7, 0, 93, 0, 7, 0,152, 8, 7, 0,153, 8, 7, 0,157, 2, 7, 0,156, 8, + 7, 0,210, 7, 7, 0,157, 8, 2, 0, 36, 10, 2, 0, 37, 10, 2, 0, 19, 0, 2, 0, 17, 0,153, 1, 6, 0,153, 1, 0, 0, +153, 1, 1, 0, 12, 0, 32, 10, 4, 0, 19, 0, 4, 0, 81, 2, 0, 0,131, 3,154, 1, 10, 0,154, 1, 0, 0,154, 1, 1, 0, + 27, 0, 1, 6, 0, 0, 38, 10, 4, 0, 39, 10, 4, 0, 40, 10, 0, 0, 22, 10, 4, 0, 23, 10, 2, 0, 19, 0, 2, 0, 41, 10, +155, 1, 6, 0,155, 1, 0, 0,155, 1, 1, 0, 12, 0, 42, 10, 0, 0,131, 3, 4, 0, 19, 0, 4, 0, 43, 10,156, 1, 5, 0, +156, 1, 0, 0,156, 1, 1, 0, 0, 0, 22, 10, 4, 0, 23, 10, 7, 0,134, 2, 39, 0, 9, 0,152, 0, 9, 3,152, 0, 44, 10, +151, 1, 33, 10, 12, 0, 45, 10,152, 1, 46, 10, 12, 0, 47, 10, 12, 0, 48, 10, 4, 0, 19, 0, 4, 0,220, 0,157, 1, 2, 0, + 27, 0, 31, 0, 39, 0, 75, 0, 69, 78, 68, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -- cgit v1.2.3 From 1334ed303816531240294d17457575736bdd212b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 13 Jul 2009 19:17:52 +0000 Subject: 2.5: fix for last commit, missing ffmpeg #ifdef. --- source/blender/makesrna/intern/rna_scene.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 9c9fbf0e3cf..f52e130d527 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -137,7 +137,9 @@ static void rna_SceneRenderData_file_format_set(PointerRNA *ptr, int value) RenderData *rd= (RenderData*)ptr->data; rd->imtype= value; +#ifdef WITH_FFMPEG ffmpeg_verify_image_type(rd); +#endif } static int rna_SceneRenderData_active_layer_index_get(PointerRNA *ptr) -- cgit v1.2.3 From 2ba8b72157d22ee92359e87e88860443a1f5cef2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 13 Jul 2009 19:33:59 +0000 Subject: RNA & PyAPI * support for dynamic enums to be inspected enumProp.items() from python. * fix, enums check for a separator was flipped, meant no enums were in docs. * dynamic enum functions now check for a NULL context and return all possible options for the "items" attribute used for docs. * added an arg for rna arrays to free the array there looping over (needed to free dynamically allocated enum items) * python api checks for NULL items since this can happen in some cases. * python api, When getting an enum ID from an int in an array - If it failed it would get the first enum identifier and return that. Brecht? dont understand, making it return an empty string in these cases. --- source/blender/editors/mesh/editmesh_mods.c | 23 +++++++++--- source/blender/editors/mesh/editmesh_tools.c | 23 ++++++++---- .../editors/transform/transform_orientations.c | 15 ++++++-- source/blender/makesrna/intern/makesrna.c | 4 +-- source/blender/makesrna/intern/rna_access.c | 32 +++++++++++------ source/blender/makesrna/intern/rna_brush.c | 2 +- source/blender/makesrna/intern/rna_color.c | 2 +- source/blender/makesrna/intern/rna_constraint.c | 28 +++++++++++++++ source/blender/makesrna/intern/rna_curve.c | 2 +- source/blender/makesrna/intern/rna_internal.h | 3 +- source/blender/makesrna/intern/rna_key.c | 2 +- source/blender/makesrna/intern/rna_lamp.c | 2 +- source/blender/makesrna/intern/rna_lattice.c | 10 +++--- source/blender/makesrna/intern/rna_material.c | 2 +- source/blender/makesrna/intern/rna_mesh.c | 24 ++++++------- source/blender/makesrna/intern/rna_modifier.c | 2 +- source/blender/makesrna/intern/rna_particle.c | 42 ++++++++++++++++++++++ source/blender/makesrna/intern/rna_rna.c | 11 +++--- source/blender/makesrna/intern/rna_space.c | 5 +++ source/blender/makesrna/intern/rna_world.c | 2 +- source/blender/python/intern/bpy_rna.c | 34 +++++++++--------- 21 files changed, 197 insertions(+), 73 deletions(-) (limited to 'source') diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 2995e2d895b..5fc2ce46792 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -1229,12 +1229,25 @@ static int select_similar_exec(bContext *C, wmOperator *op) static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *ptr, int *free) { - Object *obedit= CTX_data_edit_object(C); - + Object *obedit; + EnumPropertyItem *item= NULL; + int totitem= 0; + + if(C==NULL) { + /* needed for doc generation */ + RNA_enum_items_add(&item, &totitem, prop_simvertex_types); + RNA_enum_items_add(&item, &totitem, prop_simedge_types); + RNA_enum_items_add(&item, &totitem, prop_simface_types); + RNA_enum_item_end(&item, &totitem); + *free= 1; + + return item; + } + + obedit= CTX_data_edit_object(C); + if(obedit && obedit->type == OB_MESH) { EditMesh *em= BKE_mesh_get_editmesh(obedit->data); - EnumPropertyItem *item= NULL; - int totitem= 0; if(em->selectmode & SCE_SELECT_VERTEX) RNA_enum_items_add(&item, &totitem, prop_simvertex_types); @@ -1248,7 +1261,7 @@ static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *ptr, return item; } - + return NULL; } diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index eab06444a79..efb68f69dac 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -5795,13 +5795,24 @@ static EnumPropertyItem merge_type_items[]= { {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem *merge_type_itemf(bContext *C, PointerRNA *ptr, int *free) -{ - Object *obedit= CTX_data_edit_object(C); - +{ + EnumPropertyItem *item= NULL; + int totitem= 0; + + Object *obedit; + + if(C==NULL) { + /* needed for doc generation */ + RNA_enum_items_add(&item, &totitem, merge_type_items); + RNA_enum_item_end(&item, &totitem); + + *free= 1; + return item; + } + + obedit= CTX_data_edit_object(C); if(obedit && obedit->type == OB_MESH) { EditMesh *em= BKE_mesh_get_editmesh(obedit->data); - EnumPropertyItem *item= NULL; - int totitem= 0; if(em->selectmode & SCE_SELECT_VERTEX) { if(em->selected.first && em->selected.last && @@ -5824,7 +5835,7 @@ static EnumPropertyItem *merge_type_itemf(bContext *C, PointerRNA *ptr, int *fre return item; } - + return NULL; } diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index f3b373f0e48..6d60c7602f4 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -358,8 +358,10 @@ void BIF_selectTransformOrientationValue(bContext *C, int orientation) { EnumPropertyItem *BIF_enumTransformOrientation(bContext *C) { - ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces; - TransformOrientation *ts = transform_spaces->first; + Scene *scene; + ListBase *transform_spaces; + TransformOrientation *ts= NULL; + EnumPropertyItem global = {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", ""}; EnumPropertyItem normal = {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal", ""}; EnumPropertyItem local = {V3D_MANIP_LOCAL, "LOCAL", 0, "Local", ""}; @@ -374,6 +376,15 @@ EnumPropertyItem *BIF_enumTransformOrientation(bContext *C) RNA_enum_item_add(&item, &totitem, &local); RNA_enum_item_add(&item, &totitem, &view); + if(C) { + scene= CTX_data_scene(C); + + if(scene) { + transform_spaces = &scene->transform_spaces; + ts = transform_spaces->first; + } + } + if(ts) RNA_enum_item_add(&item, &totitem, &sepr); diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 61a8f8a29e9..85c266e3f27 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -699,9 +699,9 @@ static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA * } else { if(dp->dnalengthname) - fprintf(f, "\n rna_iterator_array_begin(iter, data->%s, sizeof(data->%s[0]), data->%s, NULL);\n", dp->dnaname, dp->dnaname, dp->dnalengthname); + fprintf(f, "\n rna_iterator_array_begin(iter, data->%s, sizeof(data->%s[0]), data->%s, 0, NULL);\n", dp->dnaname, dp->dnaname, dp->dnalengthname); else - fprintf(f, "\n rna_iterator_array_begin(iter, data->%s, sizeof(data->%s[0]), %d, NULL);\n", dp->dnaname, dp->dnaname, dp->dnalengthfixed); + fprintf(f, "\n rna_iterator_array_begin(iter, data->%s, sizeof(data->%s[0]), %d, 0, NULL);\n", dp->dnaname, dp->dnaname, dp->dnalengthfixed); } } else { diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index d6ca03c85a2..e504d1d030b 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -643,15 +643,18 @@ StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop) void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free) { EnumPropertyRNA *eprop= (EnumPropertyRNA*)rna_ensure_property(prop); - int tot; *free= 0; - if(C && eprop->itemf) { + if(eprop->itemf) { + int tot= 0; *item= eprop->itemf(C, ptr, free); if(totitem) { - for(tot=0; (*item)[tot].identifier; tot++); + if(*item) { + for( ; (*item)[tot].identifier; tot++); + } + *totitem= tot; } } @@ -710,11 +713,14 @@ int RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop int result, free; RNA_property_enum_items(C, ptr, prop, &item, NULL, &free); - result= RNA_enum_identifier(item, value, identifier); - if(free) - MEM_freeN(item); + if(item) { + result= RNA_enum_identifier(item, value, identifier); + if(free) + MEM_freeN(item); - return result; + return result; + } + return 0; } const char *RNA_property_ui_name(PropertyRNA *prop) @@ -1303,9 +1309,9 @@ void RNA_property_collection_begin(PointerRNA *ptr, PropertyRNA *prop, Collectio iter->prop= prop; if(idprop) - rna_iterator_array_begin(iter, IDP_IDPArray(idprop), sizeof(IDProperty), idprop->len, NULL); + rna_iterator_array_begin(iter, IDP_IDPArray(idprop), sizeof(IDProperty), idprop->len, 0, NULL); else - rna_iterator_array_begin(iter, NULL, sizeof(IDProperty), 0, NULL); + rna_iterator_array_begin(iter, NULL, sizeof(IDProperty), 0, 0, NULL); if(iter->valid) rna_property_collection_get_idp(iter); @@ -1902,7 +1908,7 @@ void rna_iterator_listbase_end(CollectionPropertyIterator *iter) iter->internal= NULL; } -void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, IteratorSkipFunc skip) +void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, int free_ptr, IteratorSkipFunc skip) { ArrayIterator *internal; @@ -1911,6 +1917,7 @@ void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int i internal= MEM_callocN(sizeof(ArrayIterator), "ArrayIterator"); internal->ptr= ptr; + internal->free_ptr= free_ptr ? ptr:NULL; internal->endptr= ((char*)ptr)+length*itemsize; internal->itemsize= itemsize; internal->skip= skip; @@ -1955,6 +1962,11 @@ void *rna_iterator_array_dereference_get(CollectionPropertyIterator *iter) void rna_iterator_array_end(CollectionPropertyIterator *iter) { + ArrayIterator *internal= iter->internal; + + if(internal->free_ptr) + MEM_freeN(internal->free_ptr); + MEM_freeN(iter->internal); iter->internal= NULL; } diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 7355261c5aa..3b7df3aa948 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -37,7 +37,7 @@ static void rna_Brush_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Brush *brush= (Brush*)ptr->data; - rna_iterator_array_begin(iter, (void*)brush->mtex, sizeof(MTex*), MAX_MTEX, NULL); + rna_iterator_array_begin(iter, (void*)brush->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL); } static PointerRNA rna_Brush_active_texture_get(PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 179808ab66d..f4248d18db3 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -50,7 +50,7 @@ static void rna_CurveMapping_curves_begin(CollectionPropertyIterator *iter, Poin { CurveMapping *cumap= (CurveMapping*)ptr->data; - rna_iterator_array_begin(iter, cumap->cm, sizeof(CurveMap), rna_CurveMapping_curves_length(ptr), NULL); + rna_iterator_array_begin(iter, cumap->cm, sizeof(CurveMap), rna_CurveMapping_curves_length(ptr), 0, NULL); } static void rna_CurveMapping_clip_set(PointerRNA *ptr, int value) diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 56c0ca1b491..0e3dd799612 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -181,6 +181,20 @@ static EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *C, PointerRN { Object *ob= (Object*)ptr->id.data; bConstraint *con= (bConstraint*)ptr->data; + + if(C==NULL) { + EnumPropertyItem *item= NULL; + int totitem= 0; + + /* needed for doc generation */ + RNA_enum_items_add(&item, &totitem, space_object_items); + RNA_enum_items_add(&item, &totitem, space_pchan_items); + RNA_enum_item_end(&item, &totitem); + + *free= 1; + + return item; + } if(BLI_findindex(&ob->constraints, con) == -1) return space_pchan_items; @@ -195,6 +209,20 @@ static EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *C, PointerR ListBase targets = {NULL, NULL}; bConstraintTarget *ct; + if(C==NULL) { + EnumPropertyItem *item= NULL; + int totitem= 0; + + /* needed for doc generation */ + RNA_enum_items_add(&item, &totitem, space_object_items); + RNA_enum_items_add(&item, &totitem, space_pchan_items); + RNA_enum_item_end(&item, &totitem); + + *free= 1; + + return item; + } + if(cti && cti->get_constraint_targets) { cti->get_constraint_targets(con, &targets); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 5c9da19f9b2..faf6c3a1f75 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -139,7 +139,7 @@ static int rna_Nurb_length(PointerRNA *ptr) static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Nurb *nu= (Nurb*)ptr->data; - rna_iterator_array_begin(iter, (void*)nu->bp, sizeof(BPoint*), nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu, NULL); + rna_iterator_array_begin(iter, (void*)nu->bp, sizeof(BPoint*), nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu, 0, NULL); } #else diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 6a5d5ccfdc3..ad0e05b91a6 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -240,11 +240,12 @@ void rna_iterator_listbase_end(struct CollectionPropertyIterator *iter); typedef struct ArrayIterator { char *ptr; char *endptr; + void *free_ptr; /* will be free'd if set */ int itemsize; IteratorSkipFunc skip; } ArrayIterator; -void rna_iterator_array_begin(struct CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, IteratorSkipFunc skip); +void rna_iterator_array_begin(struct CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, int free_ptr, IteratorSkipFunc skip); void rna_iterator_array_next(struct CollectionPropertyIterator *iter); void *rna_iterator_array_get(struct CollectionPropertyIterator *iter); void *rna_iterator_array_dereference_get(struct CollectionPropertyIterator *iter); diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 0a7e989a93a..7297ee8cb97 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -198,7 +198,7 @@ static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA } } - rna_iterator_array_begin(iter, (void*)kb->data, size, tot, NULL); + rna_iterator_array_begin(iter, (void*)kb->data, size, tot, 0, NULL); } static int rna_ShapeKey_data_length(PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index a49b4377d9d..e592cb38693 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -54,7 +54,7 @@ static PointerRNA rna_Lamp_sky_settings_get(PointerRNA *ptr) static void rna_Lamp_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Lamp *la= (Lamp*)ptr->data; - rna_iterator_array_begin(iter, (void*)la->mtex, sizeof(MTex*), MAX_MTEX, NULL); + rna_iterator_array_begin(iter, (void*)la->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL); } static PointerRNA rna_Lamp_active_texture_get(PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index c685e5b6912..03a1dc9ec8f 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -68,10 +68,10 @@ static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, Poin BPoint *bp= (BPoint*)ptr->data; MDeformVert *dvert= lt->dvert + (bp-lt->def); - rna_iterator_array_begin(iter, (void*)dvert->dw, sizeof(MDeformWeight), dvert->totweight, NULL); + rna_iterator_array_begin(iter, (void*)dvert->dw, sizeof(MDeformWeight), dvert->totweight, 0, NULL); } else - rna_iterator_array_begin(iter, NULL, 0, 0, NULL); + rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL); } static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) @@ -80,11 +80,11 @@ static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRN int tot= lt->pntsu*lt->pntsv*lt->pntsw; if(lt->editlatt && lt->editlatt->def) - rna_iterator_array_begin(iter, (void*)lt->editlatt->def, sizeof(BPoint), tot, NULL); + rna_iterator_array_begin(iter, (void*)lt->editlatt->def, sizeof(BPoint), tot, 0, NULL); else if(lt->def) - rna_iterator_array_begin(iter, (void*)lt->def, sizeof(BPoint), tot, NULL); + rna_iterator_array_begin(iter, (void*)lt->def, sizeof(BPoint), tot, 0, NULL); else - rna_iterator_array_begin(iter, NULL, 0, 0, NULL); + rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL); } static void rna_Lattice_update_data(bContext *C, PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 41f31594f6e..17c91088761 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -75,7 +75,7 @@ static void rna_Material_type_set(PointerRNA *ptr, int value) static void rna_Material_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Material *ma= (Material*)ptr->data; - rna_iterator_array_begin(iter, (void*)ma->mtex, sizeof(MTex*), MAX_MTEX, NULL); + rna_iterator_array_begin(iter, (void*)ma->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL); } static PointerRNA rna_Material_active_texture_get(PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index b69a804cf6a..3a7015b65be 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -197,10 +197,10 @@ static void rna_MeshVertex_groups_begin(CollectionPropertyIterator *iter, Pointe MVert *mvert= (MVert*)ptr->data; MDeformVert *dvert= me->dvert + (mvert-me->mvert); - rna_iterator_array_begin(iter, (void*)dvert->dw, sizeof(MDeformWeight), dvert->totweight, NULL); + rna_iterator_array_begin(iter, (void*)dvert->dw, sizeof(MDeformWeight), dvert->totweight, 0, NULL); } else - rna_iterator_array_begin(iter, NULL, 0, 0, NULL); + rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL); } static void rna_MeshFace_material_index_range(PointerRNA *ptr, int *min, int *max) @@ -262,7 +262,7 @@ static void rna_Mesh_uv_textures_begin(CollectionPropertyIterator *iter, Pointer { Mesh *me= (Mesh*)ptr->data; CustomData *fdata= rna_mesh_fdata(me); - rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, rna_uv_texture_check); + rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, 0, rna_uv_texture_check); } static int rna_Mesh_uv_textures_length(PointerRNA *ptr) @@ -390,7 +390,7 @@ static void rna_MeshTextureFaceLayer_data_begin(CollectionPropertyIterator *iter { Mesh *me= (Mesh*)ptr->id.data; CustomDataLayer *layer= (CustomDataLayer*)ptr->data; - rna_iterator_array_begin(iter, layer->data, sizeof(MTFace), me->totface, NULL); + rna_iterator_array_begin(iter, layer->data, sizeof(MTFace), me->totface, 0, NULL); } static int rna_MeshTextureFaceLayer_data_length(PointerRNA *ptr) @@ -437,7 +437,7 @@ static void rna_Mesh_vertex_colors_begin(CollectionPropertyIterator *iter, Point { Mesh *me= (Mesh*)ptr->data; CustomData *fdata= rna_mesh_fdata(me); - rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, rna_vertex_color_check); + rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, 0, rna_vertex_color_check); } static int rna_Mesh_vertex_colors_length(PointerRNA *ptr) @@ -501,7 +501,7 @@ static void rna_MeshColorLayer_data_begin(CollectionPropertyIterator *iter, Poin { Mesh *me= (Mesh*)ptr->id.data; CustomDataLayer *layer= (CustomDataLayer*)ptr->data; - rna_iterator_array_begin(iter, layer->data, sizeof(MCol)*4, me->totface, NULL); + rna_iterator_array_begin(iter, layer->data, sizeof(MCol)*4, me->totface, 0, NULL); } static int rna_MeshColorLayer_data_length(PointerRNA *ptr) @@ -542,7 +542,7 @@ static void rna_MeshFloatPropertyLayer_data_begin(CollectionPropertyIterator *it { Mesh *me= (Mesh*)ptr->id.data; CustomDataLayer *layer= (CustomDataLayer*)ptr->data; - rna_iterator_array_begin(iter, layer->data, sizeof(MFloatProperty), me->totface, NULL); + rna_iterator_array_begin(iter, layer->data, sizeof(MFloatProperty), me->totface, 0, NULL); } static int rna_MeshFloatPropertyLayer_data_length(PointerRNA *ptr) @@ -561,7 +561,7 @@ static void rna_Mesh_float_layers_begin(CollectionPropertyIterator *iter, Pointe { Mesh *me= (Mesh*)ptr->data; CustomData *fdata= rna_mesh_fdata(me); - rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, rna_float_layer_check); + rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, 0, rna_float_layer_check); } static int rna_Mesh_float_layers_length(PointerRNA *ptr) @@ -579,7 +579,7 @@ static void rna_MeshIntPropertyLayer_data_begin(CollectionPropertyIterator *iter { Mesh *me= (Mesh*)ptr->id.data; CustomDataLayer *layer= (CustomDataLayer*)ptr->data; - rna_iterator_array_begin(iter, layer->data, sizeof(MIntProperty), me->totface, NULL); + rna_iterator_array_begin(iter, layer->data, sizeof(MIntProperty), me->totface, 0, NULL); } static int rna_MeshIntPropertyLayer_data_length(PointerRNA *ptr) @@ -592,7 +592,7 @@ static void rna_Mesh_int_layers_begin(CollectionPropertyIterator *iter, PointerR { Mesh *me= (Mesh*)ptr->data; CustomData *fdata= rna_mesh_fdata(me); - rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, rna_int_layer_check); + rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, 0, rna_int_layer_check); } static int rna_Mesh_int_layers_length(PointerRNA *ptr) @@ -610,7 +610,7 @@ static void rna_MeshStringPropertyLayer_data_begin(CollectionPropertyIterator *i { Mesh *me= (Mesh*)ptr->id.data; CustomDataLayer *layer= (CustomDataLayer*)ptr->data; - rna_iterator_array_begin(iter, layer->data, sizeof(MStringProperty), me->totface, NULL); + rna_iterator_array_begin(iter, layer->data, sizeof(MStringProperty), me->totface, 0, NULL); } static int rna_MeshStringPropertyLayer_data_length(PointerRNA *ptr) @@ -623,7 +623,7 @@ static void rna_Mesh_string_layers_begin(CollectionPropertyIterator *iter, Point { Mesh *me= (Mesh*)ptr->data; CustomData *fdata= rna_mesh_fdata(me); - rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, rna_string_layer_check); + rna_iterator_array_begin(iter, (void*)fdata->layers, sizeof(CustomDataLayer), fdata->totlayer, 0, rna_string_layer_check); } static int rna_Mesh_string_layers_length(PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index a789f9065e3..f207f4f605d 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -83,7 +83,7 @@ EnumPropertyItem modifier_type_items[] ={ static void rna_UVProject_projectors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { UVProjectModifierData *uvp= (UVProjectModifierData*)ptr->data; - rna_iterator_array_begin(iter, (void*)uvp->projectors, sizeof(Object*), 10, NULL); + rna_iterator_array_begin(iter, (void*)uvp->projectors, sizeof(Object*), 10, 0, NULL); } static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 39411752792..ef68e0ba019 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -430,6 +430,20 @@ static EnumPropertyItem *rna_Particle_from_itemf(bContext *C, PointerRNA *ptr, i { ParticleSettings *part = ptr->id.data; + if(C==NULL) { + EnumPropertyItem *item= NULL; + int totitem= 0; + + /* needed for doc generation */ + RNA_enum_items_add(&item, &totitem, part_reactor_from_items); + RNA_enum_items_add(&item, &totitem, part_from_items); + RNA_enum_item_end(&item, &totitem); + + *free= 1; + + return item; + } + if(part->type==PART_REACTOR) return part_reactor_from_items; else @@ -440,6 +454,20 @@ static EnumPropertyItem *rna_Particle_draw_as_itemf(bContext *C, PointerRNA *ptr { ParticleSettings *part = ptr->id.data; + if(C==NULL) { + EnumPropertyItem *item= NULL; + int totitem= 0; + + /* needed for doc generation */ + RNA_enum_items_add(&item, &totitem, part_hair_draw_as_items); + RNA_enum_items_add(&item, &totitem, part_draw_as_items); + RNA_enum_item_end(&item, &totitem); + + *free= 1; + + return item; + } + if(part->type==PART_HAIR) return part_hair_draw_as_items; else @@ -450,6 +478,20 @@ static EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *C, PointerRNA *ptr, { ParticleSettings *part = ptr->id.data; + if(C==NULL) { + EnumPropertyItem *item= NULL; + int totitem= 0; + + /* needed for doc generation */ + RNA_enum_items_add(&item, &totitem, part_hair_ren_as_items); + RNA_enum_items_add(&item, &totitem, part_ren_as_items); + RNA_enum_item_end(&item, &totitem); + + *free= 1; + + return item; + } + if(part->type==PART_HAIR) return part_hair_ren_as_items; else diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 0b605db20cf..aeaedd6f81d 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -520,18 +520,21 @@ static int rna_enum_check_separator(CollectionPropertyIterator *iter, void *data { EnumPropertyItem *item= (EnumPropertyItem*)data; - return (item->identifier[0] != 0); + return (item->identifier[0] == 0); } static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { PropertyRNA *prop= (PropertyRNA*)ptr->data; EnumPropertyRNA *eprop; - + EnumPropertyItem *item= NULL; + int totitem, free= 0; + rna_idproperty_check(&prop, ptr); eprop= (EnumPropertyRNA*)prop; - - rna_iterator_array_begin(iter, (void*)eprop->item, sizeof(eprop->item[0]), eprop->totitem, rna_enum_check_separator); + + RNA_property_enum_items(NULL, ptr, prop, &item, &totitem, &free); + rna_iterator_array_begin(iter, (void*)item, sizeof(EnumPropertyItem), totitem, free, rna_enum_check_separator); } static void rna_EnumPropertyItem_identifier_get(PointerRNA *ptr, char *value) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index fa81af8f140..3f9b87a7f37 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -179,6 +179,11 @@ static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, P ImBuf *ibuf= ED_space_image_buffer(sima); int zbuf, alpha; + if(C==NULL) { + /* needed for doc generation */ + return dc_all_items; + } + alpha= ibuf && (ibuf->channels == 4); zbuf= ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1)); diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 67328455a77..9ff474b82b0 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -56,7 +56,7 @@ static PointerRNA rna_World_mist_get(PointerRNA *ptr) static void rna_World_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { World *wo= (World*)ptr->data; - rna_iterator_array_begin(iter, (void*)wo->mtex, sizeof(MTex*), MAX_MTEX, NULL); + rna_iterator_array_begin(iter, (void*)wo->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL); } static PointerRNA rna_World_active_texture_get(PointerRNA *ptr) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 49bca247431..9ce9ec8e838 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -225,10 +225,16 @@ static char *pyrna_enum_as_string(PointerRNA *ptr, PropertyRNA *prop) { EnumPropertyItem *item; char *result; - int free; + int free= 0; RNA_property_enum_items(BPy_GetContext(), ptr, prop, &item, NULL, &free); - result= (char*)BPy_enum_as_string(item); + if(item) { + result= (char*)BPy_enum_as_string(item); + } + else { + result= ""; + } + if(free) MEM_freeN(item); @@ -319,12 +325,12 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop) ret = PyUnicode_FromString( identifier ); } else { EnumPropertyItem *item; - int free; + int free= 0; /* don't throw error here, can't trust blender 100% to give the * right values, python code should not generate error for that */ RNA_property_enum_items(BPy_GetContext(), ptr, prop, &item, NULL, &free); - if(item->identifier) { + if(item && item->identifier) { ret = PyUnicode_FromString( item->identifier ); } else { @@ -1831,20 +1837,12 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data) if (RNA_property_enum_identifier(BPy_GetContext(), ptr, prop, val, &identifier)) { ret = PyUnicode_FromString( identifier ); } else { - EnumPropertyItem *item; - int free; - - /* don't throw error here, can't trust blender 100% to give the - * right values, python code should not generate error for that */ - RNA_property_enum_items(BPy_GetContext(), ptr, prop, &item, NULL, &free); - if(item[0].identifier) - ret = PyUnicode_FromString( item[0].identifier ); - else - ret = PyUnicode_FromString( "" ); - - if(free) - MEM_freeN(item); - + /* prefer not fail silently incase of api errors, maybe disable it later */ + char error_str[128]; + sprintf(error_str, "RNA Warning: Current value \"%d\" matches no enum", val); + PyErr_Warn(PyExc_RuntimeWarning, error_str); + + ret = PyUnicode_FromString( "" ); /*PyErr_Format(PyExc_AttributeError, "RNA Error: Current value \"%d\" matches no enum", val); ret = NULL;*/ } -- cgit v1.2.3 From 8f98c5e87352c3622176913f80a4b6f5c72cea32 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Mon, 13 Jul 2009 22:35:04 +0000 Subject: Fix cloth UI + tooltips - patch provided by nudelZ --- source/blender/makesrna/intern/rna_cloth.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index cefd2316fbf..95b580ac298 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -215,7 +215,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "mass_vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ClothSettings_mass_vgroup_get", "rna_ClothSettings_mass_vgroup_length", "rna_ClothSettings_mass_vgroup_set"); - RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex group for fine control over mass distribution."); + RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex Group for pinning of vertices."); RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_VECTOR); @@ -235,7 +235,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "pin_cloth", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_GOAL); - RNA_def_property_ui_text(prop, "Pin Cloth", "Define forces for vertices to stick to animated position."); + RNA_def_property_ui_text(prop, "Pin Cloth", "Enable pinning of cloth vertices to other objects/positions."); RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "pin_stiffness", PROP_FLOAT, PROP_NONE); @@ -363,18 +363,18 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "min_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "epsilon"); RNA_def_property_range(prop, 0.001f, 1.0f); - RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance between collision objects before collision response takes in, can be changed for each frame."); + RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance between collision objects before collision response takes in"); RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 80.0f); - RNA_def_property_ui_text(prop, "Friction", "Friction force if a collision happened (0=movement not changed, 100=no movement left)"); + RNA_def_property_ui_text(prop, "Friction", "Friction force if a collision happened (higher = less movement)."); RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); prop= RNA_def_property(srna, "collision_quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "loop_count"); RNA_def_property_range(prop, 1, 20); - RNA_def_property_ui_text(prop, "Collision Quality", "How many collision iterations should be done. (higher is better quality but slower)"); + RNA_def_property_ui_text(prop, "Collision Quality", "How many collision iterations should be done (higher is better quality but slower)."); RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); /* self collision */ -- cgit v1.2.3 From 0bfc98706ef93f90bd74b195b98c36c7dcea94dd Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 14 Jul 2009 04:13:04 +0000 Subject: RNA/button tweaks: * Texture -> renamed 'no rgb' to 'rgb to intensity' (btw it's not just for image textures ) * Render -> stamp closed by default - not taking effect, because saved in .B.blend. How do we fix this? * Material -> removed 'Buffer Bias' dependency - it's for receiving shadows, not casting them * Material -> Ray Shadow bias renamed 'Auto Ray bias' - switches between an automatically calculated value vs the specified value --- source/blender/makesrna/intern/rna_material.c | 2 +- source/blender/makesrna/intern/rna_space.c | 4 ++++ source/blender/makesrna/intern/rna_texture.c | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 17c91088761..b0164bda27c 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -456,7 +456,7 @@ static void rna_def_material_raymirror(BlenderRNA *brna) prop= RNA_def_property(srna, "fresnel_fac", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fresnel_mir_i"); - RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_range(prop, 0.0f, 5.0f); RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 3f9b87a7f37..697548de817 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -544,6 +544,10 @@ static void rna_def_space_3dview(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_TEX); RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view"); + prop= RNA_def_property(srna, "display_background_image", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPIC); + RNA_def_property_ui_text(prop, "Display Background Image", "Display a reference image behind objects in the 3D View"); + prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "around"); RNA_def_property_enum_items(prop, pivot_items); diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 2a7f65e2d90..9ba98d766cc 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -270,9 +270,9 @@ static void rna_def_mtex(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Negate", "Inverts the values of the texture to reverse its effect."); RNA_def_property_update(prop, NC_TEXTURE, NULL); - prop= RNA_def_property(srna, "no_rgb", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "rgb_to_intensity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_RGBTOINT); - RNA_def_property_ui_text(prop, "No RGB", "Converts texture RGB values to intensity (gray) values."); + RNA_def_property_ui_text(prop, "RGB to Intensity", "Converts texture RGB values to intensity (gray) values."); RNA_def_property_update(prop, NC_TEXTURE, NULL); prop= RNA_def_property(srna, "default_value", PROP_FLOAT, PROP_VECTOR); -- cgit v1.2.3